feat: publish HoloLake model-native living system source
This commit is contained in:
parent
6ad10edde1
commit
c395dd3a99
2467 changed files with 615073 additions and 0 deletions
20
product-source/hololake-platform/src/lib/agentDocsPath.ts
Normal file
20
product-source/hololake-platform/src/lib/agentDocsPath.ts
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
import { invoke } from '@tauri-apps/api/core'
|
||||
|
||||
let cachedAgentDocsPath: string | null | undefined
|
||||
|
||||
export async function getAgentDocsPath(): Promise<string | undefined> {
|
||||
if (cachedAgentDocsPath !== undefined) return cachedAgentDocsPath ?? undefined
|
||||
|
||||
try {
|
||||
const path = await invoke<string>('get_agent_docs_path')
|
||||
cachedAgentDocsPath = path.trim() || null
|
||||
} catch {
|
||||
cachedAgentDocsPath = null
|
||||
}
|
||||
|
||||
return cachedAgentDocsPath ?? undefined
|
||||
}
|
||||
|
||||
export function resetAgentDocsPathCacheForTests(): void {
|
||||
cachedAgentDocsPath = undefined
|
||||
}
|
||||
Loading…
Reference in a new issue