buckyos 0.7.200 → 0.7.203

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (75) hide show
  1. package/README.md +2 -0
  2. package/cli/dist/cli.mjs +42 -1
  3. package/cli/dist/cli.mjs.map +1 -1
  4. package/cli/modules/pikg.ts +7 -0
  5. package/cli/modules/pikg_protocol.ts +37 -0
  6. package/cli/version.ts +1 -1
  7. package/dist/{aiws_write-2f0baa6f.mjs → aiws_write-0606e098.mjs} +707 -291
  8. package/dist/aiws_write-0606e098.mjs.map +1 -0
  9. package/dist/aiws_write-7a9d71d1.js +13 -0
  10. package/dist/aiws_write-7a9d71d1.js.map +1 -0
  11. package/dist/app-frame.cjs +1 -1
  12. package/dist/app-frame.cjs.map +1 -1
  13. package/dist/app-frame.d.ts +129 -24
  14. package/dist/app-frame.d.ts.map +1 -1
  15. package/dist/app-frame.mjs +229 -70
  16. package/dist/app-frame.mjs.map +1 -1
  17. package/dist/audio.d.ts +84 -0
  18. package/dist/audio.d.ts.map +1 -0
  19. package/dist/browser.cjs +1 -1
  20. package/dist/browser.cjs.map +1 -1
  21. package/dist/browser.d.ts +5 -0
  22. package/dist/browser.d.ts.map +1 -1
  23. package/dist/browser.mjs +249 -219
  24. package/dist/browser.mjs.map +1 -1
  25. package/dist/content.cjs +1 -1
  26. package/dist/content.cjs.map +1 -1
  27. package/dist/content.mjs +357 -34
  28. package/dist/content.mjs.map +1 -1
  29. package/dist/{content_objid-0e63f1ff.js → content_objid-c69251aa.js} +2 -2
  30. package/dist/{content_objid-0e63f1ff.js.map → content_objid-c69251aa.js.map} +1 -1
  31. package/dist/{content_objid-8ebeead4.mjs → content_objid-e3fc56dd.mjs} +2 -2
  32. package/dist/{content_objid-8ebeead4.mjs.map → content_objid-e3fc56dd.mjs.map} +1 -1
  33. package/dist/index.cjs +1 -1
  34. package/dist/index.cjs.map +1 -1
  35. package/dist/index.d.ts +5 -0
  36. package/dist/index.d.ts.map +1 -1
  37. package/dist/index.mjs +249 -219
  38. package/dist/index.mjs.map +1 -1
  39. package/dist/msg_center_client.d.ts +37 -0
  40. package/dist/msg_center_client.d.ts.map +1 -1
  41. package/dist/node.cjs +1 -1
  42. package/dist/node.cjs.map +1 -1
  43. package/dist/node.d.ts +5 -0
  44. package/dist/node.d.ts.map +1 -1
  45. package/dist/node.mjs +246 -215
  46. package/dist/node.mjs.map +1 -1
  47. package/dist/open-app.cjs +2 -0
  48. package/dist/open-app.cjs.map +1 -0
  49. package/dist/open-app.mjs +160 -0
  50. package/dist/open-app.mjs.map +1 -0
  51. package/dist/open_app.d.ts +95 -0
  52. package/dist/open_app.d.ts.map +1 -0
  53. package/dist/provision.cjs +1 -1
  54. package/dist/provision.cjs.map +1 -1
  55. package/dist/provision.mjs +1 -3
  56. package/dist/provision.mjs.map +1 -1
  57. package/dist/provision_activate.d.ts.map +1 -1
  58. package/dist/runtime_env-39e4df98.mjs +44 -0
  59. package/dist/runtime_env-39e4df98.mjs.map +1 -0
  60. package/dist/runtime_env-6396e1eb.js +2 -0
  61. package/dist/runtime_env-6396e1eb.js.map +1 -0
  62. package/dist/runtime_env.d.ts +53 -0
  63. package/dist/runtime_env.d.ts.map +1 -0
  64. package/dist/sdk_core.d.ts +4 -2
  65. package/dist/sdk_core.d.ts.map +1 -1
  66. package/dist/zone_clients.d.ts +35 -0
  67. package/dist/zone_clients.d.ts.map +1 -0
  68. package/package.json +6 -1
  69. package/dist/aiws_write-2f0baa6f.mjs.map +0 -1
  70. package/dist/aiws_write-ad97b561.js +0 -13
  71. package/dist/aiws_write-ad97b561.js.map +0 -1
  72. package/dist/content_mime-dc80d960.js +0 -2
  73. package/dist/content_mime-dc80d960.js.map +0 -1
  74. package/dist/content_mime-e42d5f8d.mjs +0 -335
  75. package/dist/content_mime-e42d5f8d.mjs.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"app-frame.mjs","sources":["../src/app-frame.ts"],"sourcesContent":["import { isOpenRequest, isTransferableRef, isTransferableSession, readContentHints, readSelectDialogResult, systemOpenUrl, SELECT_DIALOG_PATH, SystemDialogError, SYSTEM_DIALOG_ERROR_CODES, type ContentHints, type ContentOpenTarget, type OpenRequest, type SelectDialogParams, type SelectDialogResult, type SystemDialogErrorCode, type TransferableContentRef, type TransferableSessionContext } from './content'\nexport type SystemDialogReply = { ok: true; result: unknown } | { ok: false; code: SystemDialogErrorCode }\nconst dialogErrorCode = (value: unknown): SystemDialogErrorCode =>\n SYSTEM_DIALOG_ERROR_CODES.includes(value as SystemDialogErrorCode) ? value as SystemDialogErrorCode : 'protocol'\nexport interface AppFrameMessage<T extends string = string, P = unknown> {\n protocol: 'buckyos.app-frame'; version: 1; type: T; id?: string; replyTo?: string; payload: P\n}\nexport interface FrameInit {\n nonce: string\n windowId: string\n formFactor: 'desktop' | 'mobile'\n theme: { mode: 'light' | 'dark'; accent?: string }\n locale: string\n launch?: OpenRequest\n shellCapabilities: string[]\n}\nexport type CloseDecision = 'allow' | 'deny' | 'pending'\nconst envelope = (type: string, payload: unknown, extra: { id?: string; replyTo?: string } = {}): AppFrameMessage =>\n ({ protocol: 'buckyos.app-frame', version: 1, type, payload, ...extra })\nconst isMessage = (value: unknown): value is AppFrameMessage => {\n if (!value || typeof value !== 'object') return false\n const v = value as AppFrameMessage\n return v.protocol === 'buckyos.app-frame' && v.version === 1 && typeof v.type === 'string' && !!v.payload && typeof v.payload === 'object'\n}\nexport class AppFrameHost {\n ready = false\n capabilities: string[] = []\n private pending = new Map<string, { resolve: (v: unknown) => void; reject: (e: Error) => void; timer: ReturnType<typeof setTimeout>; type: string }>()\n private listener = (event: MessageEvent) => this.receive(event)\n private opens: number[] = []\n constructor(private options: {\n target: () => Window | null; origin: string; init: FrameInit\n onReady?: () => void\n onTitle?: (title: string, dirty: boolean) => void\n onRequestClose?: () => void\n onContentOpen?: (request: OpenRequest, target: ContentOpenTarget, options: { newWindow: boolean; hints: ContentHints }) => void\n /** Shows a system dialog the App asked for (`sysdlg.open`). `params` is untrusted input: validate it. */\n onSystemDialog?: (path: string, params: unknown) => Promise<SystemDialogReply>\n }) { window.addEventListener('message', this.listener) }\n private focused?: boolean\n private dialogOpen = false\n private async systemDialog(id: string, path: unknown, params: unknown): Promise<void> {\n const reply = (payload: SystemDialogReply) => { if (this.ready) this.options.target()?.postMessage(envelope('sysdlg.openResult', payload, { replyTo: id }), this.options.origin) }\n if (!this.options.onSystemDialog || typeof path !== 'string') return reply({ ok: false, code: 'unsupported' })\n if (this.dialogOpen) return reply({ ok: false, code: 'busy' })\n this.dialogOpen = true\n try { reply(await this.options.onSystemDialog(path, params)) }\n catch (error) { reply({ ok: false, code: error instanceof SystemDialogError ? error.code : 'closed' }) }\n finally { this.dialogOpen = false }\n }\n private receive(event: MessageEvent): void {\n if (event.source !== this.options.target() || event.origin !== this.options.origin || !isMessage(event.data)) return\n const m = event.data\n const p = m.payload as Record<string, unknown>\n if (m.type === 'frame.hello') {\n if (p.nonce !== this.options.init.nonce || !Array.isArray(p.appCapabilities)) return\n this.ready = true\n this.capabilities = p.appCapabilities.filter((c): c is string => typeof c === 'string')\n this.send('frame.init', this.options.init)\n if (this.focused !== undefined) this.send('frame.focusChanged', { focused: this.focused })\n this.options.onReady?.()\n return\n }\n if (!this.ready) return\n if (m.replyTo) {\n const pending = this.pending.get(m.replyTo)\n if (pending && m.type === pending.type + 'Result') {\n clearTimeout(pending.timer); this.pending.delete(m.replyTo); pending.resolve(m.payload)\n }\n return\n }\n if (m.type === 'window.setTitle' && typeof p.title === 'string') this.options.onTitle?.(p.title.slice(0, 256), p.dirty === true)\n if (m.type === 'window.requestClose') this.options.onRequestClose?.()\n if (m.type === 'sysdlg.open' && typeof m.id === 'string') void this.systemDialog(m.id, p.path, p.params)\n if (m.type === 'content.open' && (p.target === 'default' || p.target === 'preview' || p.target === 'chooser')) {\n const request = { ...(p.request as object), requestId: crypto.randomUUID() }\n if (!isOpenRequest(request)) return\n this.opens = this.opens.filter(t => t > Date.now() - 10000)\n if (this.opens.length >= 5) return\n this.opens.push(Date.now())\n this.options.onContentOpen?.(request, p.target, { newWindow: p.newWindow === true, hints: readContentHints(p.hints) })\n }\n }\n update(init: Partial<FrameInit>): void { this.options.init = { ...this.options.init, ...init } }\n /** Reports whether the App's window is the focused one; only a change is sent. */\n setFocused(focused: boolean): void {\n if (this.focused === focused) return\n this.focused = focused\n this.send('frame.focusChanged', { focused })\n }\n send(type: string, payload: unknown): void {\n if (this.ready) this.options.target()?.postMessage(envelope(type, payload), this.options.origin)\n }\n request(type: string, payload: unknown, timeout = 3000): Promise<unknown> {\n if (!this.ready) return Promise.reject(new Error('App frame is not ready'))\n const id = crypto.randomUUID()\n return new Promise((resolve, reject) => {\n const timer = setTimeout(() => { this.pending.delete(id); reject(new Error('App frame timed out')) }, timeout)\n this.pending.set(id, { resolve, reject, timer, type })\n this.options.target()?.postMessage(envelope(type, payload, { id }), this.options.origin)\n })\n }\n async open(request: OpenRequest): Promise<{ accepted: boolean; fallback?: 'preview' }> {\n if (!this.capabilities.includes('open')) return { accepted: false }\n return await this.request('frame.open', { request }) as { accepted: boolean; fallback?: 'preview' }\n }\n async beforeClose(reason: 'user' | 'logout' | 'shell' = 'user'): Promise<CloseDecision> {\n if (!this.ready || !this.capabilities.includes('beforeClose')) return 'allow'\n const r = await this.request('frame.beforeClose', { reason }) as { decision?: CloseDecision }\n return r.decision === 'allow' || r.decision === 'pending' ? r.decision : 'deny'\n }\n async back(): Promise<boolean> {\n if (!this.capabilities.includes('back')) return false\n return (await this.request('frame.back', {}) as { handled?: boolean }).handled === true\n }\n dispose(): void {\n window.removeEventListener('message', this.listener)\n this.pending.forEach(p => { clearTimeout(p.timer); p.reject(new Error('App frame disposed')) })\n this.pending.clear(); this.ready = false\n }\n}\n/**\n * Origin of the window embedding this page, when `accept` admits it. `location.ancestorOrigins` names the real\n * parent even after the frame navigated through other pages (a sign-in round trip); the referrer is the fallback.\n */\nexport function embedderOrigin(accept: (origin: string) => boolean): string | null {\n if (window.parent === window) return null\n const candidates = [window.location.ancestorOrigins?.[0], document.referrer]\n for (const candidate of candidates) {\n if (!candidate) continue\n try {\n const origin = new URL(candidate).origin\n if (accept(origin)) return origin\n } catch {}\n }\n return null\n}\nexport const originInZone = (origin: string, zoneHost: string): boolean => {\n try {\n const url = new URL(origin)\n return url.protocol === window.location.protocol && (url.hostname === zoneHost || url.hostname.endsWith(`.${zoneHost}`))\n } catch { return false }\n}\nexport class AppFrameClient {\n init?: FrameInit\n private title?: string\n private focused?: boolean\n private helloTimer?: ReturnType<typeof setInterval>\n private helloDeadline?: ReturnType<typeof setTimeout>\n private readonly nonce: string | null\n private readonly origin: string\n private readonly listener = (event: MessageEvent) => { void this.receive(event) }\n private dialogs = new Map<string, { resolve: (result: SelectDialogResult) => void; reject: (error: Error) => void; allowLocal: boolean }>()\n private embedAbort?: AbortController\n constructor(private options: {\n shellOrigin: string\n /** The Zone's system entry (its root origin): where content is opened when this page is not embedded in the shell. */\n systemOrigin?: string\n /** This App's id, so the system does not offer the content back to it. */\n appId?: string\n onInit?: (init: FrameInit) => void\n onOpen?: (request: OpenRequest) => Promise<{ accepted: boolean; fallback?: 'preview' }> | { accepted: boolean; fallback?: 'preview' }\n onBeforeClose?: (reason: 'user' | 'logout' | 'shell') => Promise<CloseDecision> | CloseDecision\n onBack?: () => Promise<boolean> | boolean\n onTheme?: (theme: FrameInit['theme']) => void\n onLocale?: (locale: string) => void\n onFocus?: (focused: boolean) => void\n }) {\n this.origin = new URL(options.shellOrigin).origin\n this.nonce = new URLSearchParams(window.location.hash.slice(1)).get('bfp')\n window.addEventListener('message', this.listener)\n if (window.parent !== window && this.nonce) {\n const hello = () => window.parent.postMessage(envelope('frame.hello', { nonce: this.nonce, appCapabilities: [\n ...options.onOpen ? ['open'] : [], ...options.onBeforeClose ? ['beforeClose'] : [], ...options.onBack ? ['back'] : [],\n ] }), this.origin)\n hello()\n this.helloTimer = setInterval(hello, 250)\n this.helloDeadline = setTimeout(() => clearInterval(this.helloTimer), 1500)\n }\n }\n private async receive(event: MessageEvent): Promise<void> {\n if (event.source !== window.parent || event.origin !== this.origin || !isMessage(event.data)) return\n const m = event.data\n const p = m.payload as Record<string, unknown>\n if (m.type === 'frame.init') {\n if (!this.nonce || p.nonce !== this.nonce || typeof p.locale !== 'string' || !p.theme || typeof p.windowId !== 'string' || p.launch && !isOpenRequest(p.launch)) return\n clearInterval(this.helloTimer); clearTimeout(this.helloDeadline)\n this.init = p as unknown as FrameInit\n this.title = undefined; this.focused = undefined\n this.options.onInit?.(this.init)\n return\n }\n if (!this.init) return\n if (m.type === 'sysdlg.openResult') {\n const pending = m.replyTo ? this.dialogs.get(m.replyTo) : undefined\n if (!pending) return\n this.dialogs.delete(m.replyTo!)\n if (p.ok !== true) return pending.reject(new SystemDialogError(dialogErrorCode(p.code)))\n const result = readSelectDialogResult(p.result, { allowLocal: pending.allowLocal })\n if (result) pending.resolve(result)\n else pending.reject(new SystemDialogError('protocol'))\n return\n }\n const reply = (payload: unknown) => window.parent.postMessage(envelope(m.type + 'Result', payload, { replyTo: m.id }), this.origin)\n try {\n if (m.type === 'frame.open' && isOpenRequest(p.request)) reply(await this.options.onOpen?.(p.request) ?? { accepted: false })\n if (m.type === 'frame.beforeClose') reply({ decision: await this.options.onBeforeClose?.(p.reason as 'user') ?? 'allow' })\n if (m.type === 'frame.back') reply({ handled: await this.options.onBack?.() ?? false })\n if (m.type === 'frame.themeChanged' && (p.mode === 'dark' || p.mode === 'light')) this.options.onTheme?.(p as FrameInit['theme'])\n if (m.type === 'frame.localeChanged' && typeof p.locale === 'string') this.options.onLocale?.(p.locale)\n if (m.type === 'frame.focusChanged' && this.focused !== (p.focused === true)) { this.focused = p.focused === true; this.options.onFocus?.(this.focused) }\n } catch {\n if (m.type === 'frame.open') reply({ accepted: false, fallback: 'preview' })\n if (m.type === 'frame.beforeClose') reply({ decision: 'deny' })\n }\n }\n send(type: string, payload: unknown): void {\n if (this.init) window.parent.postMessage(envelope(type, payload), this.origin)\n }\n setTitle(title: string, dirty = false): void {\n const key = JSON.stringify([title, dirty])\n if (!this.init || key === this.title) return\n this.title = key\n this.send('window.setTitle', { title, dirty })\n }\n requestClose(): void { this.send('window.requestClose', {}) }\n /**\n * Asks the system to open content: with its default app, in Preview, or by letting the user choose (`chooser`).\n * Embedded in the shell the request goes over the frame; in a standalone tab it opens the Zone's system entry\n * (`systemOrigin`) in a new tab. Returns false when neither is available.\n */\n openContent(request: Omit<OpenRequest, 'requestId'>, target: ContentOpenTarget = 'default', options: { newWindow?: boolean; hints?: ContentHints } = {}): boolean {\n const hints = options.hints ?? {}\n if (this.init) { this.send('content.open', { request, target, newWindow: options.newWindow === true, hints }); return true }\n if (!this.options.systemOrigin) return false\n window.open(systemOpenUrl(this.options.systemOrigin, { request, target, hints, from: this.options.appId }), '_blank', 'noopener')\n return true\n }\n /**\n * Shows the system file picker (`sysdlg/select`) and resolves with what the user chose; cancelling resolves with\n * `{ action: 'cancelled' }`. Embedded in the shell the shell draws the dialog over this App's window; in a\n * standalone tab the picker page of the Zone's system entry (`systemOrigin`) is framed over this page. Rejects\n * with a `SystemDialogError` when no picker is available or the request did not complete.\n */\n selectContent(params: SelectDialogParams = {}, options: { signal?: AbortSignal; theme?: 'light' | 'dark'; locale?: string } = {}): Promise<SelectDialogResult> {\n if (this.init) {\n if (!this.init.shellCapabilities.includes(SELECT_DIALOG_PATH)) return Promise.reject(new SystemDialogError('unsupported'))\n if (this.dialogs.size) return Promise.reject(new SystemDialogError('busy'))\n const id = crypto.randomUUID()\n return new Promise((resolve, reject) => {\n this.dialogs.set(id, { resolve, reject, allowLocal: params.allowLocal === true })\n window.parent.postMessage(envelope('sysdlg.open', { path: SELECT_DIALOG_PATH, params }, { id }), this.origin)\n })\n }\n if (!this.options.systemOrigin) return Promise.reject(new SystemDialogError('unsupported'))\n const abort = this.embedAbort = new AbortController()\n options.signal?.addEventListener('abort', () => abort.abort(), { once: true })\n if (options.signal?.aborted) abort.abort()\n return openSelectEmbed(this.options.systemOrigin, params, { ...options, signal: abort.signal })\n }\n dispose(): void {\n clearInterval(this.helloTimer); clearTimeout(this.helloDeadline); window.removeEventListener('message', this.listener)\n this.dialogs.forEach(pending => pending.reject(new SystemDialogError('closed')))\n this.dialogs.clear(); this.embedAbort?.abort()\n }\n}\n\n/**\n * Preview embed protocol (`buckyos.preview-embed` v1): an App shows the system Preview component inside its own UI.\n * The App frames `<systemOrigin>/embed/preview` (component only, no shell) and hands it a content reference; the\n * system page reads the content with its own Zone-root session, so no token crosses origins. Open With goes back\n * through the App to the shell (`AppFrameClient.openContent(…, 'chooser')`).\n */\nexport type PreviewEmbedSource = TransferableContentRef | { kind: 'blob'; blob: Blob; name: string }\nexport interface PreviewEmbedInit {\n nonce: string\n source: PreviewEmbedSource\n session?: TransferableSessionContext\n theme: 'light' | 'dark'\n locale: string\n}\nexport interface PreviewEmbedState {\n status: 'loading' | 'ready' | 'error'\n /** Preview error kind (`unsupported`, `not-found`, `permission-denied`, `timeout`, `error`, …) and code. */\n error?: { kind: string; code: string }\n title?: string\n mediaType?: string\n}\nexport interface PreviewEmbedOpenWith { request: Omit<OpenRequest, 'requestId'>; hints: ContentHints }\nconst PREVIEW_EMBED = 'buckyos.preview-embed'\nconst embedEnvelope = (type: string, payload: unknown, protocol = PREVIEW_EMBED) => ({ protocol, version: 1, type, payload })\nconst isEmbedMessage = (value: unknown, protocol = PREVIEW_EMBED): value is { type: string; payload: Record<string, unknown> } => {\n const v = value as { protocol?: unknown; version?: unknown; type?: unknown; payload?: unknown } | null\n return !!v && v.protocol === protocol && v.version === 1 && typeof v.type === 'string' && !!v.payload && typeof v.payload === 'object'\n}\nconst isEmbedSource = (value: unknown): value is PreviewEmbedSource =>\n isTransferableRef(value) || (!!value && typeof value === 'object' && (value as { kind?: unknown }).kind === 'blob' &&\n typeof Blob !== 'undefined' && (value as { blob?: unknown }).blob instanceof Blob && typeof (value as { name?: unknown }).name === 'string')\nexport const PREVIEW_EMBED_PATH = '/embed/preview'\n\n/** App side: owns the iframe that shows the system Preview. */\nexport class PreviewEmbed {\n readonly url: string\n private readonly nonce = crypto.randomUUID()\n private readonly origin: string\n private readonly listener = (event: MessageEvent) => this.receive(event)\n private init: Omit<PreviewEmbedInit, 'nonce'>\n private ready = false\n constructor(private options: {\n systemOrigin: string\n frame: () => HTMLIFrameElement | null\n init: Omit<PreviewEmbedInit, 'nonce'>\n onState?: (state: PreviewEmbedState) => void\n onOpenWith?: (open: PreviewEmbedOpenWith) => void\n onExit?: () => void\n }) {\n this.origin = new URL(options.systemOrigin).origin\n this.init = options.init\n this.url = `${this.origin}${PREVIEW_EMBED_PATH}#bpe=${this.nonce}&po=${encodeURIComponent(window.location.origin)}`\n window.addEventListener('message', this.listener)\n }\n private post(type: string, payload: unknown): void {\n this.options.frame()?.contentWindow?.postMessage(embedEnvelope(type, payload), this.origin)\n }\n private receive(event: MessageEvent): void {\n if (event.origin !== this.origin || event.source !== this.options.frame()?.contentWindow || !isEmbedMessage(event.data)) return\n const { type, payload: p } = event.data\n if (type === 'embed.hello') { if (p.nonce === this.nonce) { this.ready = true; this.post('embed.init', { ...this.init, nonce: this.nonce }) } return }\n if (type === 'embed.state' && (p.status === 'loading' || p.status === 'ready' || p.status === 'error')) {\n const error = p.error as { kind?: unknown; code?: unknown } | undefined\n this.options.onState?.({ status: p.status,\n error: error && typeof error.kind === 'string' && typeof error.code === 'string' ? { kind: error.kind, code: error.code } : undefined,\n title: typeof p.title === 'string' ? p.title.slice(0, 256) : undefined, mediaType: typeof p.mediaType === 'string' ? p.mediaType.slice(0, 128) : undefined })\n }\n if (type === 'embed.openWith') {\n const request = p.request as Omit<OpenRequest, 'requestId'> | undefined\n if (request && isTransferableRef(request.source) && (request.session === undefined || isTransferableSession(request.session))) {\n this.options.onOpenWith?.({ request: { source: request.source, session: request.session }, hints: readContentHints(p.hints) })\n }\n }\n if (type === 'embed.exit') this.options.onExit?.()\n }\n update(patch: Partial<Pick<PreviewEmbedInit, 'theme' | 'locale'>>): void {\n this.init = { ...this.init, ...patch }\n // Before the handshake the frame still holds its initial about:blank (this App's origin, so the browser rejects\n // the target origin); `embed.init` carries the patch.\n if (this.ready) this.post('embed.update', patch)\n }\n dispose(): void { window.removeEventListener('message', this.listener) }\n}\n\n/** System side: the component-only page at `PREVIEW_EMBED_PATH`. Accepts one embedding App whose origin `accept` admits. */\nexport class PreviewEmbedHost {\n readonly parentOrigin: string | null\n private readonly nonce: string | null\n private ready = false\n private readonly hello?: ReturnType<typeof setInterval>\n private readonly listener = (event: MessageEvent) => this.receive(event)\n constructor(private options: {\n accept: (origin: string) => boolean\n onInit: (init: PreviewEmbedInit) => void\n onUpdate?: (patch: Partial<Pick<PreviewEmbedInit, 'theme' | 'locale'>>) => void\n }) {\n const params = new URLSearchParams(window.location.hash.slice(1))\n this.nonce = params.get('bpe')\n let parentOrigin: string | null = null\n try { parentOrigin = new URL(params.get('po') ?? '').origin } catch {}\n this.parentOrigin = window.parent !== window && this.nonce && parentOrigin && options.accept(parentOrigin) ? parentOrigin : null\n if (!this.parentOrigin) return\n window.addEventListener('message', this.listener)\n const hello = () => window.parent.postMessage(embedEnvelope('embed.hello', { nonce: this.nonce }), this.parentOrigin!)\n hello()\n this.hello = setInterval(() => { if (!this.ready) hello() }, 250)\n }\n private receive(event: MessageEvent): void {\n if (event.source !== window.parent || event.origin !== this.parentOrigin || !isEmbedMessage(event.data)) return\n const { type, payload: p } = event.data\n if (type === 'embed.init') {\n if (p.nonce !== this.nonce || !isEmbedSource(p.source) || (p.session !== undefined && !isTransferableSession(p.session)) || typeof p.locale !== 'string') return\n this.ready = true; clearInterval(this.hello)\n this.options.onInit({ nonce: String(p.nonce), source: p.source, session: p.session as TransferableSessionContext | undefined, theme: p.theme === 'dark' ? 'dark' : 'light', locale: p.locale })\n return\n }\n if (type === 'embed.update' && this.ready) {\n const patch: Partial<Pick<PreviewEmbedInit, 'theme' | 'locale'>> = {}\n if (p.theme === 'dark' || p.theme === 'light') patch.theme = p.theme\n if (typeof p.locale === 'string') patch.locale = p.locale\n this.options.onUpdate?.(patch)\n }\n }\n private post(type: string, payload: unknown): void {\n if (this.ready && this.parentOrigin) window.parent.postMessage(embedEnvelope(type, payload), this.parentOrigin)\n }\n state(state: PreviewEmbedState): void { this.post('embed.state', state) }\n openWith(open: PreviewEmbedOpenWith): void { this.post('embed.openWith', open) }\n exit(): void { this.post('embed.exit', {}) }\n dispose(): void { clearInterval(this.hello); window.removeEventListener('message', this.listener) }\n}\n\n/**\n * System dialog embed protocol (`buckyos.sysdlg-embed` v1): a standalone App page (no shell) shows the system file\n * picker by framing `<systemOrigin>/embed/sysdlg/select` over itself. The handshake is the Preview embed's\n * (`embed.hello` → `embed.init`); the system page browses with its own Zone-root session and answers with\n * `embed.result`. No token crosses origins, and every message names its exact target origin.\n */\nconst SYSDLG_EMBED = 'buckyos.sysdlg-embed'\nexport const SELECT_EMBED_PATH = '/embed/sysdlg/select'\nexport interface SelectEmbedInit { nonce: string; params: unknown; theme: 'light' | 'dark'; locale: string }\nlet selectEmbedOpen = false\n\n/** App side of `buckyos.sysdlg-embed`: the full-page layer that frames the picker. One at a time per page. */\nexport function openSelectEmbed(systemOrigin: string, params: SelectDialogParams, options: { signal?: AbortSignal; theme?: 'light' | 'dark'; locale?: string } = {}): Promise<SelectDialogResult> {\n if (options.signal?.aborted) return Promise.reject(new SystemDialogError('closed'))\n if (selectEmbedOpen) return Promise.reject(new SystemDialogError('busy'))\n selectEmbedOpen = true\n const origin = new URL(systemOrigin).origin\n const locale = options.locale ?? navigator.language ?? 'en'\n const theme = options.theme ?? (window.matchMedia?.('(prefers-color-scheme: dark)').matches ? 'dark' : 'light')\n const zh = locale.toLowerCase().startsWith('zh')\n return new Promise((resolve, reject) => {\n const body = document.body\n const html = document.documentElement\n const focused = document.activeElement instanceof HTMLElement ? document.activeElement : null\n const scroll = { x: window.scrollX, y: window.scrollY }\n const saved = { body: body.getAttribute('style'), html: html.getAttribute('style') }\n const siblings = Array.from(body.children).filter((el): el is HTMLElement => el instanceof HTMLElement)\n .map(el => ({ el, inert: el.inert, hidden: el.getAttribute('aria-hidden') }))\n const root = document.createElement('div')\n root.setAttribute('data-buckyos-sysdlg', 'select')\n root.setAttribute('role', 'dialog'); root.setAttribute('aria-modal', 'true')\n root.setAttribute('aria-label', zh ? '文件选择器' : 'File picker')\n root.style.cssText = 'position:fixed;inset:0;height:100vh;height:100dvh;z-index:2147483647;background:rgba(0,0,0,.32);display:flex;align-items:center;justify-content:center'\n let frame: HTMLIFrameElement | undefined\n let nonce = ''\n let timer: ReturnType<typeof setTimeout> | undefined\n let done = false\n const block = (event: Event) => { if (!root.contains(event.target as Node)) { event.stopPropagation(); event.preventDefault() } }\n const blocked = ['keydown', 'pointerdown', 'mousedown', 'touchstart', 'wheel'] as const\n const cleanup = () => {\n if (done) return false\n done = true; selectEmbedOpen = false\n clearTimeout(timer)\n window.removeEventListener('message', receive)\n options.signal?.removeEventListener('abort', abort)\n if (!('inert' in HTMLElement.prototype)) blocked.forEach(type => document.removeEventListener(type, block, true))\n root.remove()\n siblings.forEach(({ el, inert, hidden }) => { el.inert = inert; if (hidden === null) el.removeAttribute('aria-hidden'); else el.setAttribute('aria-hidden', hidden) })\n if (saved.body === null) body.removeAttribute('style'); else body.setAttribute('style', saved.body)\n if (saved.html === null) html.removeAttribute('style'); else html.setAttribute('style', saved.html)\n window.scrollTo(scroll.x, scroll.y)\n focused?.focus({ preventScroll: true })\n return true\n }\n const finish = (result: SelectDialogResult) => { if (cleanup()) resolve(result) }\n const fail = (code: SystemDialogErrorCode) => { if (cleanup()) reject(new SystemDialogError(code)) }\n const abort = () => fail('closed')\n const showFailure = () => {\n frame?.remove(); frame = undefined\n const panel = document.createElement('div')\n panel.setAttribute('role', 'alert')\n panel.style.cssText = `max-width:22rem;margin:1rem;padding:1.25rem;border-radius:16px;font:14px/1.6 system-ui,sans-serif;background:${theme === 'dark' ? '#1f2329' : '#fff'};color:${theme === 'dark' ? '#f2f3f5' : '#1f2329'};box-shadow:0 24px 64px rgba(0,0,0,.24)`\n const text = document.createElement('p')\n text.style.margin = '0 0 1rem'\n text.textContent = zh ? '无法加载文件选择器' : 'Unable to load the file picker'\n const actions = document.createElement('div')\n actions.style.cssText = 'display:flex;gap:.5rem;justify-content:flex-end'\n const button = (label: string, action: () => void) => {\n const el = document.createElement('button')\n el.type = 'button'; el.textContent = label\n el.style.cssText = 'min-height:2.25rem;padding:0 1rem;font:inherit;border-radius:999px;border:1px solid currentColor;background:transparent;color:inherit;cursor:pointer'\n el.addEventListener('click', action); actions.append(el); return el\n }\n button(zh ? '取消' : 'Cancel', () => fail('load_failed'))\n const retry = button(zh ? '重试' : 'Retry', () => { panel.remove(); load() })\n panel.append(text, actions); root.append(panel); retry.focus()\n }\n const load = () => {\n nonce = crypto.randomUUID()\n frame = document.createElement('iframe')\n frame.title = zh ? '文件选择器' : 'File picker'\n frame.style.cssText = 'position:absolute;inset:0;width:100%;height:100%;border:0;background:transparent;color-scheme:normal'\n frame.setAttribute('allowtransparency', 'true')\n frame.addEventListener('error', showFailure)\n frame.src = `${origin}${SELECT_EMBED_PATH}#bse=${nonce}&po=${encodeURIComponent(window.location.origin)}`\n root.append(frame)\n timer = setTimeout(showFailure, 10000)\n }\n const receive = (event: MessageEvent) => {\n if (!frame || event.origin !== origin || event.source !== frame.contentWindow || !isEmbedMessage(event.data, SYSDLG_EMBED)) return\n const { type, payload: p } = event.data\n if (type === 'embed.hello') {\n if (p.nonce !== nonce) return\n clearTimeout(timer)\n frame.contentWindow?.postMessage(embedEnvelope('embed.init', { nonce, params, theme, locale } satisfies SelectEmbedInit, SYSDLG_EMBED), origin)\n frame.focus()\n }\n if (type === 'embed.error') fail(dialogErrorCode(p.code))\n if (type === 'embed.result') {\n const result = readSelectDialogResult(p.result, { allowLocal: params.allowLocal === true })\n if (result) finish(result)\n else fail('protocol')\n }\n }\n window.addEventListener('message', receive)\n options.signal?.addEventListener('abort', abort, { once: true })\n if ('inert' in HTMLElement.prototype) siblings.forEach(({ el }) => { el.inert = true })\n else { siblings.forEach(({ el }) => el.setAttribute('aria-hidden', 'true')); blocked.forEach(type => document.addEventListener(type, block, true)) }\n // `overflow: hidden` alone does not stop the page behind from scrolling on iOS; pinning the body does.\n html.style.overflow = 'hidden'\n body.style.position = 'fixed'; body.style.top = `${-scroll.y}px`; body.style.left = `${-scroll.x}px`; body.style.right = '0'; body.style.overflow = 'hidden'\n body.append(root)\n load()\n })\n}\n\n/** System side: the picker page at `SELECT_EMBED_PATH`. Works only for an embedding page whose origin `accept` admits. */\nexport class SelectEmbedHost {\n readonly parentOrigin: string | null\n private readonly nonce: string | null\n private ready = false\n private readonly hello?: ReturnType<typeof setInterval>\n private readonly listener = (event: MessageEvent) => this.receive(event)\n constructor(private options: { accept: (origin: string) => boolean; onInit: (init: SelectEmbedInit) => void }) {\n const params = new URLSearchParams(window.location.hash.slice(1))\n this.nonce = params.get('bse')\n let parentOrigin: string | null = null\n try { parentOrigin = new URL(params.get('po') ?? '').origin } catch {}\n this.parentOrigin = window.parent !== window && this.nonce && parentOrigin && options.accept(parentOrigin) ? parentOrigin : null\n if (!this.parentOrigin) return\n window.addEventListener('message', this.listener)\n const hello = () => window.parent.postMessage(embedEnvelope('embed.hello', { nonce: this.nonce }, SYSDLG_EMBED), this.parentOrigin!)\n hello()\n this.hello = setInterval(() => { if (!this.ready) hello() }, 250)\n }\n private receive(event: MessageEvent): void {\n if (event.source !== window.parent || event.origin !== this.parentOrigin || !isEmbedMessage(event.data, SYSDLG_EMBED)) return\n const { type, payload: p } = event.data\n if (type !== 'embed.init' || this.ready || p.nonce !== this.nonce || typeof p.locale !== 'string') return\n this.ready = true; clearInterval(this.hello)\n this.options.onInit({ nonce: String(p.nonce), params: p.params, theme: p.theme === 'dark' ? 'dark' : 'light', locale: p.locale })\n }\n private post(type: string, payload: unknown): void {\n if (this.ready && this.parentOrigin) window.parent.postMessage(embedEnvelope(type, payload, SYSDLG_EMBED), this.parentOrigin)\n }\n result(result: SelectDialogResult): void { this.post('embed.result', { result }) }\n error(code: SystemDialogErrorCode): void { this.post('embed.error', { code }) }\n dispose(): void { clearInterval(this.hello); window.removeEventListener('message', this.listener) }\n}\n\n/**\n * Conversation embed protocol (`buckyos.conversation-embed` v1): an App shows a conversation of the user with an\n * Agent inside its own layout, rendered by the system conversation component. The App frames\n * `<systemOrigin>/embed/conversation` (component only, no shell); the handshake is the Preview embed's\n * (`embed.hello` → `embed.init`). The system page works with its own Zone-root session and derives the App from the\n * embedder's origin, never from anything the App says: no token crosses origins, and message contents never travel\n * back to the App (it reads them with its own session if it needs them).\n */\nconst CONVERSATION_EMBED = 'buckyos.conversation-embed'\nexport const CONVERSATION_EMBED_PATH = '/embed/conversation'\n/**\n * `agent`: the conversation with this Agent (the owner's default Agent when `agentDid` is left out) that this App\n * started; without one, the first message starts it. `session`: an existing conversation, when the system allows\n * this App to open it.\n */\nexport type ConversationEmbedTarget = { kind: 'agent'; agentDid?: string } | { kind: 'session'; sessionId: string }\nexport interface ConversationEmbedInit {\n nonce: string\n target: ConversationEmbedTarget\n theme: 'light' | 'dark'\n locale: string\n /** The composer's placeholder. */\n placeholder?: string\n}\n/** What the system page receives: `target` is untrusted input it validates itself. */\nexport type ConversationEmbedHostInit = Omit<ConversationEmbedInit, 'target'> & { target: unknown }\n/** A message the App sends in the user's name; `attachments` are content the user can read in the Zone. */\nexport interface ConversationEmbedSend { text: string; attachments?: TransferableContentRef[] }\nexport interface ConversationEmbedState {\n status: 'loading' | 'ready' | 'error'\n /** The conversation shown, once there is one. */\n sessionId?: string\n error?: string\n}\n/**\n * What the conversation in front is doing: `idle`; `running` while the Agent handles the message in front,\n * `interrupted` after a restart in the middle of it, `paused`; `answer` while a question of the Agent waits for the\n * user's answer.\n */\nexport type ConversationEmbedTurnMode = 'idle' | 'running' | 'interrupted' | 'paused' | 'answer'\nexport const CONVERSATION_EMBED_ERROR_CODES = ['invalid_params', 'not_found', 'denied'] as const\nexport type ConversationEmbedErrorCode = typeof CONVERSATION_EMBED_ERROR_CODES[number]\nconst TURN_MODES: readonly ConversationEmbedTurnMode[] = ['idle', 'running', 'interrupted', 'paused', 'answer']\nconst MAX_EMBED_TEXT = 64 * 1024\nconst MAX_EMBED_ATTACHMENTS = 32\nconst readEmbedSend = (p: Record<string, unknown>): ConversationEmbedSend | null => {\n if (typeof p.text !== 'string' || p.text.length > MAX_EMBED_TEXT) return null\n if (p.attachments === undefined) return { text: p.text }\n if (!Array.isArray(p.attachments) || p.attachments.length > MAX_EMBED_ATTACHMENTS || !p.attachments.every(isTransferableRef)) return null\n return { text: p.text, attachments: p.attachments as TransferableContentRef[] }\n}\n\n/** App side: owns the iframe that shows the system conversation. */\nexport class ConversationEmbed {\n readonly url: string\n private readonly nonce = crypto.randomUUID()\n private readonly origin: string\n private readonly listener = (event: MessageEvent) => this.receive(event)\n private init: Omit<ConversationEmbedInit, 'nonce'>\n private ready = false\n private outbox: ConversationEmbedSend[] = []\n constructor(private options: {\n systemOrigin: string\n frame: () => HTMLIFrameElement | null\n init: Omit<ConversationEmbedInit, 'nonce'>\n onState?: (state: ConversationEmbedState) => void\n onTurn?: (mode: ConversationEmbedTurnMode) => void\n onError?: (code: ConversationEmbedErrorCode) => void\n }) {\n this.origin = new URL(options.systemOrigin).origin\n this.init = options.init\n this.url = `${this.origin}${CONVERSATION_EMBED_PATH}#bce=${this.nonce}&po=${encodeURIComponent(window.location.origin)}`\n window.addEventListener('message', this.listener)\n }\n private post(type: string, payload: unknown): void {\n this.options.frame()?.contentWindow?.postMessage(embedEnvelope(type, payload, CONVERSATION_EMBED), this.origin)\n }\n private receive(event: MessageEvent): void {\n if (event.origin !== this.origin || event.source !== this.options.frame()?.contentWindow || !isEmbedMessage(event.data, CONVERSATION_EMBED)) return\n const { type, payload: p } = event.data\n if (type === 'embed.hello') {\n if (p.nonce !== this.nonce) return\n this.ready = true\n this.post('embed.init', { ...this.init, nonce: this.nonce })\n const queued = this.outbox\n this.outbox = []\n queued.forEach(message => this.post('embed.send', message))\n return\n }\n if (type === 'embed.state' && (p.status === 'loading' || p.status === 'ready' || p.status === 'error')) {\n this.options.onState?.({ status: p.status,\n sessionId: typeof p.sessionId === 'string' ? p.sessionId.slice(0, 512) : undefined,\n error: typeof p.error === 'string' ? p.error.slice(0, 128) : undefined })\n }\n if (type === 'embed.turn' && TURN_MODES.includes(p.mode as ConversationEmbedTurnMode)) this.options.onTurn?.(p.mode as ConversationEmbedTurnMode)\n if (type === 'embed.error' && CONVERSATION_EMBED_ERROR_CODES.includes(p.code as ConversationEmbedErrorCode)) this.options.onError?.(p.code as ConversationEmbedErrorCode)\n }\n update(patch: Partial<Pick<ConversationEmbedInit, 'theme' | 'locale'>>): void {\n this.init = { ...this.init, ...patch }\n if (this.ready) this.post('embed.update', patch)\n }\n /** Sends a message in the user's name. Before the handshake it waits and goes out right after `embed.init`. */\n send(message: ConversationEmbedSend): void {\n const payload: ConversationEmbedSend = { text: message.text, ...(message.attachments?.length ? { attachments: message.attachments } : {}) }\n if (this.ready) this.post('embed.send', payload)\n else this.outbox.push(payload)\n }\n dispose(): void { window.removeEventListener('message', this.listener); this.outbox = [] }\n}\n\n/** System side: the component-only page at `CONVERSATION_EMBED_PATH`. Accepts one embedding App whose origin `accept` admits. */\nexport class ConversationEmbedHost {\n readonly parentOrigin: string | null\n private readonly nonce: string | null\n private ready = false\n private readonly hello?: ReturnType<typeof setInterval>\n private readonly listener = (event: MessageEvent) => this.receive(event)\n constructor(private options: {\n accept: (origin: string) => boolean\n onInit: (init: ConversationEmbedHostInit) => void\n onUpdate?: (patch: Partial<Pick<ConversationEmbedInit, 'theme' | 'locale'>>) => void\n onSend?: (message: ConversationEmbedSend) => void\n }) {\n const params = new URLSearchParams(window.location.hash.slice(1))\n this.nonce = params.get('bce')\n let parentOrigin: string | null = null\n try { parentOrigin = new URL(params.get('po') ?? '').origin } catch {}\n this.parentOrigin = window.parent !== window && this.nonce && parentOrigin && options.accept(parentOrigin) ? parentOrigin : null\n if (!this.parentOrigin) return\n window.addEventListener('message', this.listener)\n const hello = () => window.parent.postMessage(embedEnvelope('embed.hello', { nonce: this.nonce }, CONVERSATION_EMBED), this.parentOrigin!)\n hello()\n this.hello = setInterval(() => { if (!this.ready) hello() }, 250)\n }\n private receive(event: MessageEvent): void {\n if (event.source !== window.parent || event.origin !== this.parentOrigin || !isEmbedMessage(event.data, CONVERSATION_EMBED)) return\n const { type, payload: p } = event.data\n if (type === 'embed.init') {\n if (this.ready || p.nonce !== this.nonce || typeof p.locale !== 'string') return\n this.ready = true; clearInterval(this.hello)\n this.options.onInit({ nonce: String(p.nonce), target: p.target, theme: p.theme === 'dark' ? 'dark' : 'light', locale: p.locale,\n ...(typeof p.placeholder === 'string' ? { placeholder: p.placeholder.slice(0, 200) } : {}) })\n return\n }\n if (!this.ready) return\n if (type === 'embed.update') {\n const patch: Partial<Pick<ConversationEmbedInit, 'theme' | 'locale'>> = {}\n if (p.theme === 'dark' || p.theme === 'light') patch.theme = p.theme\n if (typeof p.locale === 'string') patch.locale = p.locale\n this.options.onUpdate?.(patch)\n }\n if (type === 'embed.send') {\n const message = readEmbedSend(p)\n if (message) this.options.onSend?.(message)\n else this.error('invalid_params')\n }\n }\n private post(type: string, payload: unknown): void {\n if (this.ready && this.parentOrigin) window.parent.postMessage(embedEnvelope(type, payload, CONVERSATION_EMBED), this.parentOrigin)\n }\n state(state: ConversationEmbedState): void { this.post('embed.state', state) }\n turn(mode: ConversationEmbedTurnMode): void { this.post('embed.turn', { mode }) }\n error(code: ConversationEmbedErrorCode): void { this.post('embed.error', { code }) }\n dispose(): void { clearInterval(this.hello); window.removeEventListener('message', this.listener) }\n}\n"],"names":["_a"],"mappings":";;;;AAEA,MAAM,kBAAkB,CAAC,UACvB,0BAA0B,SAAS,KAA8B,IAAI,QAAiC;AAcxG,MAAM,WAAW,CAAC,MAAc,SAAkB,QAA2C,CAAA,OAC1F,EAAE,UAAU,qBAAqB,SAAS,GAAG,MAAM,SAAS,GAAG,MAAM;AACxE,MAAM,YAAY,C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AU,UAAU,EAAE,UAAU;AAAS,cAAM,QAAQ,EAAE;AAC3D,UAAA,OAAO,EAAE,WAAW;AAAU,cAAM,SAAS,EAAE;AAC9C,uBAAA,SAAQ,aAAR,4BAAmB;AAAA,IAC1B;AACA,QAAI,SAAS,cAAc;AACnB,YAAA,UAAU,cAAc,CAAC;AAC3B,UAAA;AAAc,yBAAA,SAAQ,WAAR,4BAAiB;AAAA;AAC9B,aAAK,MAAM,gBAAgB;AAAA,IAClC;AAAA,EACF;AAAA,EACQ,KAAK,MAAc,SAAwB;AAC7C,QAAA,KAAK,SAAS,KAAK;AAAqB,aAAA,OAAO,YAAY,cAAc,MAAM,SAAS,kBAAkB,GAAG,KAAK,YAAY;AAAA,EACpI;AAAA,EACA,MAAM,OAAqC;AAAO,SAAA,KAAK,eAAe,KAAK;AAAA,EAAE;AAAA,EAC7E,KAAK,MAAuC;AAAE,SAAK,KAAK,cAAc,EAAE,KAAM,CAAA;AAAA,EAAE;AAAA,EAChF,MAAM,MAAwC;AAAE,SAAK,KAAK,eAAe,EAAE,KAAM,CAAA;AAAA,EAAE;AAAA,EACnF,UAAgB;AAAE,kBAAc,KAAK,KAAK;AAAU,WAAA,oBAAoB,WAAW,KAAK,QAAQ;AAAA,EAAE;AACpG;"}
1
+ {"version":3,"file":"app-frame.mjs","sources":["../src/app-frame.ts"],"sourcesContent":["import { isOpenRequest, isTransferableRef, isTransferableSession, readContentHints, readSelectDialogResult, systemOpenUrl, SELECT_DIALOG_PATH, SystemDialogError, SYSTEM_DIALOG_ERROR_CODES, type ContentHints, type ContentOpenTarget, type OpenRequest, type SelectDialogParams, type SelectDialogResult, type SystemDialogErrorCode, type TransferableContentRef, type TransferableSessionContext } from './content'\nimport { readAppOpenRequest, systemOpenAppUrl, type AppOpenRequest } from './open_app'\nimport { getBuckyApi, type BuckyApi, type RuntimeContainer } from './runtime_env'\nexport type SystemDialogReply = { ok: true; result: unknown } | { ok: false; code: SystemDialogErrorCode }\nconst dialogErrorCode = (value: unknown): SystemDialogErrorCode =>\n SYSTEM_DIALOG_ERROR_CODES.includes(value as SystemDialogErrorCode) ? value as SystemDialogErrorCode : 'protocol'\nexport interface AppFrameMessage<T extends string = string, P = unknown> {\n protocol: 'buckyos.app-frame'; version: 1; type: T; id?: string; replyTo?: string; payload: P\n}\nexport interface FrameInit {\n nonce: string\n windowId: string\n formFactor: 'desktop' | 'mobile'\n theme: { mode: 'light' | 'dark'; accent?: string }\n locale: string\n launch?: OpenRequest\n shellCapabilities: string[]\n /** `tab`: the App fills a tab of the host, which has its own navigation, so the App leaves out its outer one. */\n presentation?: 'window' | 'tab'\n container?: RuntimeContainer\n}\nexport type CloseDecision = 'allow' | 'deny' | 'pending'\nexport type AppOpenErrorCode = 'not_found' | 'denied' | 'unsupported'\nexport type AppOpenReply = { ok: true } | { ok: false; code: AppOpenErrorCode }\nexport interface HeaderItem { id: string; label: string; active?: boolean }\n/** `icon`: the name of an icon, or the address of an image. */\nexport interface HeaderMenuItem { id: string; label: string; icon?: string; danger?: boolean }\n/**\n * What an App puts into the header the host draws above it (mobile containers; elsewhere it is ignored). A field left\n * out keeps its value; an empty list, or `null` for the search, removes it.\n */\nexport interface HeaderState {\n title?: string\n /** A second row below the title, such as tabs. Only a `standard` header has room for it. */\n second_row?: HeaderItem[]\n search?: { placeholder?: string; value?: string } | null\n menu?: HeaderMenuItem[]\n /** Whether the back button applies inside the App; pressing it arrives as `frame.back`. */\n back?: boolean\n}\n/** `search`: `value` is the text; `item` and `menu`: `id` is the entry that was chosen. */\nexport interface HeaderEvent { kind: 'search' | 'item' | 'menu'; id?: string; value?: string }\nconst text = (value: unknown, max: number): string | undefined => typeof value === 'string' ? value.slice(0, max) : undefined\nfunction readHeaderList<T extends HeaderMenuItem | HeaderItem>(value: unknown, read: (v: Record<string, unknown>, base: { id: string; label: string }) => T): T[] {\n if (!Array.isArray(value)) return []\n return value.slice(0, 32).flatMap((entry: unknown) => {\n const v = entry as Record<string, unknown> | null\n if (!v || typeof v !== 'object' || typeof v.id !== 'string' || !v.id || v.id.length > 128 || typeof v.label !== 'string') return []\n return [read(v, { id: v.id, label: v.label.slice(0, 128) })]\n })\n}\n/** Reads the header an App asks for; only the fields it gave are in the result. */\nfunction readHeader(p: Record<string, unknown>): HeaderState {\n const header: HeaderState = {}\n const title = text(p.title, 256)\n if (title !== undefined) header.title = title\n if (Array.isArray(p.second_row)) header.second_row = readHeaderList<HeaderItem>(p.second_row, (v, base) => ({ ...base, ...(v.active === true ? { active: true } : {}) }))\n if (Array.isArray(p.menu)) header.menu = readHeaderList<HeaderMenuItem>(p.menu, (v, base) => ({ ...base, ...(typeof v.icon === 'string' ? { icon: v.icon.slice(0, 2048) } : {}), ...(v.danger === true ? { danger: true } : {}) }))\n if (p.search === null) header.search = null\n else if (p.search && typeof p.search === 'object') {\n const search = p.search as Record<string, unknown>\n const placeholder = text(search.placeholder, 128), value = text(search.value, 1024)\n header.search = { ...(placeholder !== undefined ? { placeholder } : {}), ...(value !== undefined ? { value } : {}) }\n }\n if (typeof p.back === 'boolean') header.back = p.back\n return header\n}\n/**\n * A channel to one peer that the platform has already identified. The native client's bridge is one: it knows which\n * view a message comes from, so there is no origin to check.\n */\nexport interface AppFrameTransport {\n post(message: AppFrameMessage): void\n onMessage(cb: (message: unknown) => void): () => void\n}\n/** The channel to another window: messages count only when they come from that window and that origin. */\nfunction windowTransport(peer: () => Window | null, origin: string): AppFrameTransport {\n return {\n post: message => peer()?.postMessage(message, origin),\n onMessage: cb => {\n const own = window\n const listener = (event: MessageEvent) => { if (event.source === peer() && event.origin === origin) cb(event.data) }\n own.addEventListener('message', listener)\n return () => own.removeEventListener('message', listener)\n },\n }\n}\nfunction bridgeTransport(api: BuckyApi): AppFrameTransport {\n return {\n post: message => { void Promise.resolve(api.call('frame.post', message)).catch(() => {}) },\n onMessage: cb => api.on('frame.message', cb),\n }\n}\nconst envelope = (type: string, payload: unknown, extra: { id?: string; replyTo?: string } = {}): AppFrameMessage =>\n ({ protocol: 'buckyos.app-frame', version: 1, type, payload, ...extra })\nconst isMessage = (value: unknown): value is AppFrameMessage => {\n if (!value || typeof value !== 'object') return false\n const v = value as AppFrameMessage\n return v.protocol === 'buckyos.app-frame' && v.version === 1 && typeof v.type === 'string' && !!v.payload && typeof v.payload === 'object'\n}\nexport interface AppFrameHostCallbacks {\n onReady?: () => void\n onTitle?: (title: string, dirty: boolean) => void\n onRequestClose?: () => void\n onContentOpen?: (request: OpenRequest, target: ContentOpenTarget, options: { newWindow: boolean; hints: ContentHints }) => void\n /** Opens another App, or a page of one (`app.open`). Without a `zone` the request is for the App's own Zone. */\n onAppOpen?: (request: AppOpenRequest) => Promise<AppOpenReply> | AppOpenReply\n /** The header the App wants now (`header.set`), with everything it set so far. */\n onHeader?: (header: HeaderState) => void\n /** Shows a system dialog the App asked for (`sysdlg.open`). `params` is untrusted input: validate it. */\n onSystemDialog?: (path: string, params: unknown) => Promise<SystemDialogReply>\n}\n/**\n * `target` and `origin`: the App runs in a frame of this page, opened with `#bfp=<init.nonce>`. `transport`: the\n * platform connects this host to the App's view; the App picks the nonce and the host answers with it.\n */\nexport type AppFrameHostOptions = AppFrameHostCallbacks & (\n | { target: () => Window | null; origin: string; init: FrameInit; transport?: undefined }\n | { transport: AppFrameTransport; init: Omit<FrameInit, 'nonce'>; target?: undefined; origin?: undefined })\n/** Opening requests an App may send in ten seconds, for each kind. */\nconst OPEN_LIMIT = 5\nexport class AppFrameHost {\n ready = false\n capabilities: string[] = []\n header: HeaderState = {}\n private init: FrameInit\n private readonly framed: boolean\n private readonly channel: AppFrameTransport\n private readonly detach: () => void\n private readonly callbacks: AppFrameHostCallbacks\n private pending = new Map<string, { resolve: (v: unknown) => void; reject: (e: Error) => void; timer: ReturnType<typeof setTimeout>; type: string }>()\n private opens = new Map<string, number[]>()\n constructor(options: AppFrameHostOptions) {\n this.callbacks = options\n this.framed = !options.transport\n this.init = options.transport ? { ...options.init, nonce: '' } : options.init\n this.channel = options.transport ?? windowTransport(options.target, options.origin)\n this.detach = this.channel.onMessage(message => this.receive(message))\n }\n private focused?: boolean\n private dialogOpen = false\n private limited(type: string): boolean {\n const recent = (this.opens.get(type) ?? []).filter(t => t > Date.now() - 10000)\n this.opens.set(type, recent)\n if (recent.length >= OPEN_LIMIT) return true\n recent.push(Date.now())\n return false\n }\n private async appOpen(id: string, payload: unknown): Promise<void> {\n const reply = (result: AppOpenReply) => { if (this.ready) this.channel.post(envelope('app.openResult', result, { replyTo: id })) }\n if (!this.callbacks.onAppOpen) return reply({ ok: false, code: 'unsupported' })\n const request = readAppOpenRequest(payload)\n if (!request || this.limited('app.open')) return reply({ ok: false, code: 'denied' })\n try { reply(await this.callbacks.onAppOpen(request)) }\n catch { reply({ ok: false, code: 'denied' }) }\n }\n private async systemDialog(id: string, path: unknown, params: unknown): Promise<void> {\n const reply = (payload: SystemDialogReply) => { if (this.ready) this.channel.post(envelope('sysdlg.openResult', payload, { replyTo: id })) }\n if (!this.callbacks.onSystemDialog || typeof path !== 'string') return reply({ ok: false, code: 'unsupported' })\n if (this.dialogOpen) return reply({ ok: false, code: 'busy' })\n this.dialogOpen = true\n try { reply(await this.callbacks.onSystemDialog(path, params)) }\n catch (error) { reply({ ok: false, code: error instanceof SystemDialogError ? error.code : 'closed' }) }\n finally { this.dialogOpen = false }\n }\n private receive(m: unknown): void {\n if (!isMessage(m)) return\n const p = m.payload as Record<string, unknown>\n if (m.type === 'frame.hello') {\n if (!Array.isArray(p.appCapabilities)) return\n if (this.framed) { if (p.nonce !== this.init.nonce) return }\n else {\n if (typeof p.nonce !== 'string' || !p.nonce || p.nonce.length > 128) return\n // Another document took the view over: the one before it will not answer any more.\n if (p.nonce !== this.init.nonce) this.failPending('App frame reloaded')\n this.init = { ...this.init, nonce: p.nonce }\n }\n this.ready = true\n this.capabilities = p.appCapabilities.filter((c): c is string => typeof c === 'string')\n this.send('frame.init', this.init)\n if (this.focused !== undefined) this.send('frame.focusChanged', { focused: this.focused })\n if (Object.keys(this.header).length) { this.header = {}; this.callbacks.onHeader?.({}) }\n this.callbacks.onReady?.()\n return\n }\n if (!this.ready) return\n if (m.replyTo) {\n const pending = this.pending.get(m.replyTo)\n if (pending && m.type === pending.type + 'Result') {\n clearTimeout(pending.timer); this.pending.delete(m.replyTo); pending.resolve(m.payload)\n }\n return\n }\n if (m.type === 'window.setTitle' && typeof p.title === 'string') this.callbacks.onTitle?.(p.title.slice(0, 256), p.dirty === true)\n if (m.type === 'window.requestClose') this.callbacks.onRequestClose?.()\n if (m.type === 'header.set') { this.header = { ...this.header, ...readHeader(p) }; this.callbacks.onHeader?.(this.header) }\n if (m.type === 'app.open' && typeof m.id === 'string') void this.appOpen(m.id, p)\n if (m.type === 'sysdlg.open' && typeof m.id === 'string') void this.systemDialog(m.id, p.path, p.params)\n if (m.type === 'content.open' && (p.target === 'default' || p.target === 'preview' || p.target === 'chooser')) {\n const request = { ...(p.request as object), requestId: crypto.randomUUID() }\n if (!isOpenRequest(request) || this.limited('content.open')) return\n this.callbacks.onContentOpen?.(request, p.target, { newWindow: p.newWindow === true, hints: readContentHints(p.hints) })\n }\n }\n update(init: Partial<FrameInit>): void { this.init = { ...this.init, ...init } }\n /** Reports whether the App's window is the focused one; only a change is sent. */\n setFocused(focused: boolean): void {\n if (this.focused === focused) return\n this.focused = focused\n this.send('frame.focusChanged', { focused })\n }\n /** Tells the App what happened in the header the host draws for it. */\n headerEvent(event: HeaderEvent): void { this.send('header.event', event) }\n send(type: string, payload: unknown): void {\n if (this.ready) this.channel.post(envelope(type, payload))\n }\n request(type: string, payload: unknown, timeout = 3000): Promise<unknown> {\n if (!this.ready) return Promise.reject(new Error('App frame is not ready'))\n const id = crypto.randomUUID()\n return new Promise((resolve, reject) => {\n const timer = setTimeout(() => { this.pending.delete(id); reject(new Error('App frame timed out')) }, timeout)\n this.pending.set(id, { resolve, reject, timer, type })\n this.channel.post(envelope(type, payload, { id }))\n })\n }\n async open(request: OpenRequest): Promise<{ accepted: boolean; fallback?: 'preview' }> {\n if (!this.capabilities.includes('open')) return { accepted: false }\n return await this.request('frame.open', { request }) as { accepted: boolean; fallback?: 'preview' }\n }\n async beforeClose(reason: 'user' | 'logout' | 'shell' = 'user'): Promise<CloseDecision> {\n if (!this.ready || !this.capabilities.includes('beforeClose')) return 'allow'\n const r = await this.request('frame.beforeClose', { reason }) as { decision?: CloseDecision }\n return r.decision === 'allow' || r.decision === 'pending' ? r.decision : 'deny'\n }\n async back(): Promise<boolean> {\n if (!this.capabilities.includes('back')) return false\n return (await this.request('frame.back', {}) as { handled?: boolean }).handled === true\n }\n private failPending(reason: string): void {\n this.pending.forEach(p => { clearTimeout(p.timer); p.reject(new Error(reason)) })\n this.pending.clear()\n }\n dispose(): void {\n this.detach()\n this.failPending('App frame disposed')\n this.ready = false\n }\n}\n/**\n * Origin of the window embedding this page, when `accept` admits it. `location.ancestorOrigins` names the real\n * parent even after the frame navigated through other pages (a sign-in round trip); the referrer is the fallback.\n * In the BuckyOS client the page is the top document and its host is the client itself, reached over the bridge: the\n * answer is the page's own origin, so that code which connects only when it is embedded connects there too.\n */\nexport function embedderOrigin(accept: (origin: string) => boolean): string | null {\n if (window.parent === window) return getBuckyApi() && accept(window.location.origin) ? window.location.origin : null\n const candidates = [window.location.ancestorOrigins?.[0], document.referrer]\n for (const candidate of candidates) {\n if (!candidate) continue\n try {\n const origin = new URL(candidate).origin\n if (accept(origin)) return origin\n } catch {}\n }\n return null\n}\nexport const originInZone = (origin: string, zoneHost: string): boolean => {\n try {\n const url = new URL(origin)\n return url.protocol === window.location.protocol && (url.hostname === zoneHost || url.hostname.endsWith(`.${zoneHost}`))\n } catch { return false }\n}\nexport class AppFrameClient {\n init?: FrameInit\n private title?: string\n private focused?: boolean\n private helloTimer?: ReturnType<typeof setInterval>\n private helloDeadline?: ReturnType<typeof setTimeout>\n private header: HeaderState = {}\n private readonly nonce: string | null\n /** The page is a top document of the BuckyOS client: its host is reached over the bridge. */\n private readonly native: boolean\n private readonly channel: AppFrameTransport\n private readonly detach: () => void\n private dialogs = new Map<string, { resolve: (result: SelectDialogResult) => void; reject: (error: Error) => void; allowLocal: boolean }>()\n private appOpens = new Map<string, (reply: AppOpenReply) => void>()\n private embedAbort?: AbortController\n constructor(private options: {\n shellOrigin: string\n /** The Zone's system entry (its root origin): where content is opened when this page is not embedded in the shell. */\n systemOrigin?: string\n /** This App's id, so the system does not offer the content back to it. */\n appId?: string\n onInit?: (init: FrameInit) => void\n onOpen?: (request: OpenRequest) => Promise<{ accepted: boolean; fallback?: 'preview' }> | { accepted: boolean; fallback?: 'preview' }\n onBeforeClose?: (reason: 'user' | 'logout' | 'shell') => Promise<CloseDecision> | CloseDecision\n onBack?: () => Promise<boolean> | boolean\n onTheme?: (theme: FrameInit['theme']) => void\n onLocale?: (locale: string) => void\n onFocus?: (focused: boolean) => void\n /** The user used the header this App set with `setHeader`. */\n onHeaderEvent?: (event: HeaderEvent) => void\n }) {\n const origin = new URL(options.shellOrigin).origin\n const bridge = window.parent === window ? getBuckyApi() : undefined\n this.native = !!bridge\n this.nonce = new URLSearchParams(window.location.hash.slice(1)).get('bfp') ?? (bridge ? crypto.randomUUID() : null)\n this.channel = bridge ? bridgeTransport(bridge) : windowTransport(() => window.parent, origin)\n this.detach = this.channel.onMessage(message => { void this.receive(message) })\n if ((bridge || window.parent !== window) && this.nonce) {\n const hello = () => this.channel.post(envelope('frame.hello', { nonce: this.nonce, appCapabilities: [\n ...options.onOpen ? ['open'] : [], ...options.onBeforeClose ? ['beforeClose'] : [], ...options.onBack ? ['back'] : [],\n ] }))\n hello()\n this.helloTimer = setInterval(hello, 250)\n // A native host may only be set up after the view has loaded.\n this.helloDeadline = setTimeout(() => clearInterval(this.helloTimer), bridge ? 10000 : 1500)\n }\n }\n private async receive(m: unknown): Promise<void> {\n if (!isMessage(m)) return\n const p = m.payload as Record<string, unknown>\n if (m.type === 'frame.init') {\n if (!this.nonce || p.nonce !== this.nonce || typeof p.locale !== 'string' || !p.theme || typeof p.windowId !== 'string' || p.launch && !isOpenRequest(p.launch)) return\n clearInterval(this.helloTimer); clearTimeout(this.helloDeadline)\n this.init = p as unknown as FrameInit\n this.title = undefined; this.focused = undefined\n if (Object.keys(this.header).length) this.send('header.set', this.header)\n this.options.onInit?.(this.init)\n return\n }\n if (!this.init) return\n if (m.type === 'sysdlg.openResult') {\n const pending = m.replyTo ? this.dialogs.get(m.replyTo) : undefined\n if (!pending) return\n this.dialogs.delete(m.replyTo!)\n if (p.ok !== true) return pending.reject(new SystemDialogError(dialogErrorCode(p.code)))\n const result = readSelectDialogResult(p.result, { allowLocal: pending.allowLocal })\n if (result) pending.resolve(result)\n else pending.reject(new SystemDialogError('protocol'))\n return\n }\n if (m.type === 'app.openResult') {\n const code = p.code === 'not_found' || p.code === 'denied' ? p.code : 'unsupported'\n if (m.replyTo) this.appOpens.get(m.replyTo)?.(p.ok === true ? { ok: true } : { ok: false, code })\n return\n }\n if (m.type === 'header.event') {\n if (p.kind !== 'search' && p.kind !== 'item' && p.kind !== 'menu') return\n this.options.onHeaderEvent?.({ kind: p.kind, ...(typeof p.id === 'string' ? { id: p.id } : {}), ...(typeof p.value === 'string' ? { value: p.value } : {}) })\n return\n }\n const reply = (payload: unknown) => this.channel.post(envelope(m.type + 'Result', payload, { replyTo: m.id }))\n try {\n if (m.type === 'frame.open' && isOpenRequest(p.request)) reply(await this.options.onOpen?.(p.request) ?? { accepted: false })\n if (m.type === 'frame.beforeClose') reply({ decision: await this.options.onBeforeClose?.(p.reason as 'user') ?? 'allow' })\n if (m.type === 'frame.back') reply({ handled: await this.options.onBack?.() ?? false })\n if (m.type === 'frame.themeChanged' && (p.mode === 'dark' || p.mode === 'light')) this.options.onTheme?.(p as FrameInit['theme'])\n if (m.type === 'frame.localeChanged' && typeof p.locale === 'string') this.options.onLocale?.(p.locale)\n if (m.type === 'frame.focusChanged' && this.focused !== (p.focused === true)) { this.focused = p.focused === true; this.options.onFocus?.(this.focused) }\n } catch {\n if (m.type === 'frame.open') reply({ accepted: false, fallback: 'preview' })\n if (m.type === 'frame.beforeClose') reply({ decision: 'deny' })\n }\n }\n send(type: string, payload: unknown): void {\n if (this.init) this.channel.post(envelope(type, payload))\n }\n setTitle(title: string, dirty = false): void {\n const key = JSON.stringify([title, dirty])\n if (!this.init || key === this.title) return\n this.title = key\n this.send('window.setTitle', { title, dirty })\n }\n requestClose(): void { this.send('window.requestClose', {}) }\n /** Sets what the host shows in the header above this App. It may be called before the handshake. */\n setHeader(header: HeaderState): void {\n this.header = { ...this.header, ...header }\n this.send('header.set', header)\n }\n /**\n * Opens another App, or a page of one, in this App's Zone (or in `zone`). The host decides between a new window and\n * an open one. In a standalone tab it opens the Zone's system entry (`systemOrigin`) in a new tab, which only reaches\n * this App's own Zone. Never rejects.\n */\n openApp(request: AppOpenRequest): Promise<AppOpenReply> {\n const clean = readAppOpenRequest(request)\n if (!clean) return Promise.resolve({ ok: false, code: 'denied' })\n if (this.init) {\n if (!this.init.shellCapabilities.includes('app.open')) return Promise.resolve({ ok: false, code: 'unsupported' })\n const id = crypto.randomUUID()\n return new Promise(resolve => {\n const settle = (reply: AppOpenReply) => { clearTimeout(timer); this.appOpens.delete(id); resolve(reply) }\n const timer = setTimeout(() => settle({ ok: false, code: 'unsupported' }), 30000)\n this.appOpens.set(id, settle)\n this.channel.post(envelope('app.open', clean, { id }))\n })\n }\n if (!this.options.systemOrigin || clean.zone) return Promise.resolve({ ok: false, code: 'unsupported' })\n window.open(systemOpenAppUrl(this.options.systemOrigin, clean), '_blank', 'noopener')\n return Promise.resolve({ ok: true })\n }\n /**\n * Asks the system to open content: with its default app, in Preview, or by letting the user choose (`chooser`).\n * Inside the shell or the BuckyOS client the request goes to the host; in a standalone tab it opens the Zone's system\n * entry (`systemOrigin`) in a new tab. Returns false when neither is available.\n */\n openContent(request: Omit<OpenRequest, 'requestId'>, target: ContentOpenTarget = 'default', options: { newWindow?: boolean; hints?: ContentHints } = {}): boolean {\n const hints = options.hints ?? {}\n if (this.init) { this.send('content.open', { request, target, newWindow: options.newWindow === true, hints }); return true }\n if (!this.options.systemOrigin) return false\n window.open(systemOpenUrl(this.options.systemOrigin, { request, target, hints, from: this.options.appId }), '_blank', 'noopener')\n return true\n }\n /**\n * Shows the system file picker (`sysdlg/select`) and resolves with what the user chose; cancelling resolves with\n * `{ action: 'cancelled' }`. Embedded in the shell the shell draws the dialog over this App's window; in a\n * standalone tab, and in the BuckyOS client unless it lists the dialog, the picker page of the Zone's system entry\n * (`systemOrigin`) is framed over this page. Rejects with a `SystemDialogError` when no picker is available or the\n * request did not complete.\n */\n selectContent(params: SelectDialogParams = {}, options: { signal?: AbortSignal; theme?: 'light' | 'dark'; locale?: string } = {}): Promise<SelectDialogResult> {\n const offered = this.init?.shellCapabilities.includes(SELECT_DIALOG_PATH)\n if (this.init && (offered || !this.native)) {\n if (!offered) return Promise.reject(new SystemDialogError('unsupported'))\n if (this.dialogs.size) return Promise.reject(new SystemDialogError('busy'))\n const id = crypto.randomUUID()\n return new Promise((resolve, reject) => {\n this.dialogs.set(id, { resolve, reject, allowLocal: params.allowLocal === true })\n this.channel.post(envelope('sysdlg.open', { path: SELECT_DIALOG_PATH, params }, { id }))\n })\n }\n if (!this.options.systemOrigin) return Promise.reject(new SystemDialogError('unsupported'))\n const abort = this.embedAbort = new AbortController()\n options.signal?.addEventListener('abort', () => abort.abort(), { once: true })\n if (options.signal?.aborted) abort.abort()\n return openSelectEmbed(this.options.systemOrigin, params, { ...options, signal: abort.signal })\n }\n dispose(): void {\n clearInterval(this.helloTimer); clearTimeout(this.helloDeadline); this.detach()\n this.appOpens.forEach(settle => settle({ ok: false, code: 'unsupported' }))\n this.dialogs.forEach(pending => pending.reject(new SystemDialogError('closed')))\n this.dialogs.clear(); this.embedAbort?.abort()\n }\n}\n\n/**\n * Preview embed protocol (`buckyos.preview-embed` v1): an App shows the system Preview component inside its own UI.\n * The App frames `<systemOrigin>/embed/preview` (component only, no shell) and hands it a content reference; the\n * system page reads the content with its own Zone-root session, so no token crosses origins. Open With goes back\n * through the App to the shell (`AppFrameClient.openContent(…, 'chooser')`).\n */\nexport type PreviewEmbedSource = TransferableContentRef | { kind: 'blob'; blob: Blob; name: string }\nexport interface PreviewEmbedInit {\n nonce: string\n source: PreviewEmbedSource\n session?: TransferableSessionContext\n theme: 'light' | 'dark'\n locale: string\n}\nexport interface PreviewEmbedState {\n status: 'loading' | 'ready' | 'error'\n /** Preview error kind (`unsupported`, `not-found`, `permission-denied`, `timeout`, `error`, …) and code. */\n error?: { kind: string; code: string }\n title?: string\n mediaType?: string\n}\nexport interface PreviewEmbedOpenWith { request: Omit<OpenRequest, 'requestId'>; hints: ContentHints }\nconst PREVIEW_EMBED = 'buckyos.preview-embed'\nconst embedEnvelope = (type: string, payload: unknown, protocol = PREVIEW_EMBED) => ({ protocol, version: 1, type, payload })\nconst isEmbedMessage = (value: unknown, protocol = PREVIEW_EMBED): value is { type: string; payload: Record<string, unknown> } => {\n const v = value as { protocol?: unknown; version?: unknown; type?: unknown; payload?: unknown } | null\n return !!v && v.protocol === protocol && v.version === 1 && typeof v.type === 'string' && !!v.payload && typeof v.payload === 'object'\n}\nconst isEmbedSource = (value: unknown): value is PreviewEmbedSource =>\n isTransferableRef(value) || (!!value && typeof value === 'object' && (value as { kind?: unknown }).kind === 'blob' &&\n typeof Blob !== 'undefined' && (value as { blob?: unknown }).blob instanceof Blob && typeof (value as { name?: unknown }).name === 'string')\nexport const PREVIEW_EMBED_PATH = '/embed/preview'\n\n/** App side: owns the iframe that shows the system Preview. */\nexport class PreviewEmbed {\n readonly url: string\n private readonly nonce = crypto.randomUUID()\n private readonly origin: string\n private readonly listener = (event: MessageEvent) => this.receive(event)\n private init: Omit<PreviewEmbedInit, 'nonce'>\n private ready = false\n constructor(private options: {\n systemOrigin: string\n frame: () => HTMLIFrameElement | null\n init: Omit<PreviewEmbedInit, 'nonce'>\n onState?: (state: PreviewEmbedState) => void\n onOpenWith?: (open: PreviewEmbedOpenWith) => void\n onExit?: () => void\n }) {\n this.origin = new URL(options.systemOrigin).origin\n this.init = options.init\n this.url = `${this.origin}${PREVIEW_EMBED_PATH}#bpe=${this.nonce}&po=${encodeURIComponent(window.location.origin)}`\n window.addEventListener('message', this.listener)\n }\n private post(type: string, payload: unknown): void {\n this.options.frame()?.contentWindow?.postMessage(embedEnvelope(type, payload), this.origin)\n }\n private receive(event: MessageEvent): void {\n if (event.origin !== this.origin || event.source !== this.options.frame()?.contentWindow || !isEmbedMessage(event.data)) return\n const { type, payload: p } = event.data\n if (type === 'embed.hello') { if (p.nonce === this.nonce) { this.ready = true; this.post('embed.init', { ...this.init, nonce: this.nonce }) } return }\n if (type === 'embed.state' && (p.status === 'loading' || p.status === 'ready' || p.status === 'error')) {\n const error = p.error as { kind?: unknown; code?: unknown } | undefined\n this.options.onState?.({ status: p.status,\n error: error && typeof error.kind === 'string' && typeof error.code === 'string' ? { kind: error.kind, code: error.code } : undefined,\n title: typeof p.title === 'string' ? p.title.slice(0, 256) : undefined, mediaType: typeof p.mediaType === 'string' ? p.mediaType.slice(0, 128) : undefined })\n }\n if (type === 'embed.openWith') {\n const request = p.request as Omit<OpenRequest, 'requestId'> | undefined\n if (request && isTransferableRef(request.source) && (request.session === undefined || isTransferableSession(request.session))) {\n this.options.onOpenWith?.({ request: { source: request.source, session: request.session }, hints: readContentHints(p.hints) })\n }\n }\n if (type === 'embed.exit') this.options.onExit?.()\n }\n update(patch: Partial<Pick<PreviewEmbedInit, 'theme' | 'locale'>>): void {\n this.init = { ...this.init, ...patch }\n // Before the handshake the frame still holds its initial about:blank (this App's origin, so the browser rejects\n // the target origin); `embed.init` carries the patch.\n if (this.ready) this.post('embed.update', patch)\n }\n dispose(): void { window.removeEventListener('message', this.listener) }\n}\n\n/** System side: the component-only page at `PREVIEW_EMBED_PATH`. Accepts one embedding App whose origin `accept` admits. */\nexport class PreviewEmbedHost {\n readonly parentOrigin: string | null\n private readonly nonce: string | null\n private ready = false\n private readonly hello?: ReturnType<typeof setInterval>\n private readonly listener = (event: MessageEvent) => this.receive(event)\n constructor(private options: {\n accept: (origin: string) => boolean\n onInit: (init: PreviewEmbedInit) => void\n onUpdate?: (patch: Partial<Pick<PreviewEmbedInit, 'theme' | 'locale'>>) => void\n }) {\n const params = new URLSearchParams(window.location.hash.slice(1))\n this.nonce = params.get('bpe')\n let parentOrigin: string | null = null\n try { parentOrigin = new URL(params.get('po') ?? '').origin } catch {}\n this.parentOrigin = window.parent !== window && this.nonce && parentOrigin && options.accept(parentOrigin) ? parentOrigin : null\n if (!this.parentOrigin) return\n window.addEventListener('message', this.listener)\n const hello = () => window.parent.postMessage(embedEnvelope('embed.hello', { nonce: this.nonce }), this.parentOrigin!)\n hello()\n this.hello = setInterval(() => { if (!this.ready) hello() }, 250)\n }\n private receive(event: MessageEvent): void {\n if (event.source !== window.parent || event.origin !== this.parentOrigin || !isEmbedMessage(event.data)) return\n const { type, payload: p } = event.data\n if (type === 'embed.init') {\n if (p.nonce !== this.nonce || !isEmbedSource(p.source) || (p.session !== undefined && !isTransferableSession(p.session)) || typeof p.locale !== 'string') return\n this.ready = true; clearInterval(this.hello)\n this.options.onInit({ nonce: String(p.nonce), source: p.source, session: p.session as TransferableSessionContext | undefined, theme: p.theme === 'dark' ? 'dark' : 'light', locale: p.locale })\n return\n }\n if (type === 'embed.update' && this.ready) {\n const patch: Partial<Pick<PreviewEmbedInit, 'theme' | 'locale'>> = {}\n if (p.theme === 'dark' || p.theme === 'light') patch.theme = p.theme\n if (typeof p.locale === 'string') patch.locale = p.locale\n this.options.onUpdate?.(patch)\n }\n }\n private post(type: string, payload: unknown): void {\n if (this.ready && this.parentOrigin) window.parent.postMessage(embedEnvelope(type, payload), this.parentOrigin)\n }\n state(state: PreviewEmbedState): void { this.post('embed.state', state) }\n openWith(open: PreviewEmbedOpenWith): void { this.post('embed.openWith', open) }\n exit(): void { this.post('embed.exit', {}) }\n dispose(): void { clearInterval(this.hello); window.removeEventListener('message', this.listener) }\n}\n\n/**\n * System dialog embed protocol (`buckyos.sysdlg-embed` v1): a standalone App page (no shell) shows the system file\n * picker by framing `<systemOrigin>/embed/sysdlg/select` over itself. The handshake is the Preview embed's\n * (`embed.hello` → `embed.init`); the system page browses with its own Zone-root session and answers with\n * `embed.result`. No token crosses origins, and every message names its exact target origin.\n */\nconst SYSDLG_EMBED = 'buckyos.sysdlg-embed'\nexport const SELECT_EMBED_PATH = '/embed/sysdlg/select'\nexport interface SelectEmbedInit { nonce: string; params: unknown; theme: 'light' | 'dark'; locale: string }\nlet selectEmbedOpen = false\n\n/** App side of `buckyos.sysdlg-embed`: the full-page layer that frames the picker. One at a time per page. */\nexport function openSelectEmbed(systemOrigin: string, params: SelectDialogParams, options: { signal?: AbortSignal; theme?: 'light' | 'dark'; locale?: string } = {}): Promise<SelectDialogResult> {\n if (options.signal?.aborted) return Promise.reject(new SystemDialogError('closed'))\n if (selectEmbedOpen) return Promise.reject(new SystemDialogError('busy'))\n selectEmbedOpen = true\n const origin = new URL(systemOrigin).origin\n const locale = options.locale ?? navigator.language ?? 'en'\n const theme = options.theme ?? (window.matchMedia?.('(prefers-color-scheme: dark)').matches ? 'dark' : 'light')\n const zh = locale.toLowerCase().startsWith('zh')\n return new Promise((resolve, reject) => {\n const body = document.body\n const html = document.documentElement\n const focused = document.activeElement instanceof HTMLElement ? document.activeElement : null\n const scroll = { x: window.scrollX, y: window.scrollY }\n const saved = { body: body.getAttribute('style'), html: html.getAttribute('style') }\n const siblings = Array.from(body.children).filter((el): el is HTMLElement => el instanceof HTMLElement)\n .map(el => ({ el, inert: el.inert, hidden: el.getAttribute('aria-hidden') }))\n const root = document.createElement('div')\n root.setAttribute('data-buckyos-sysdlg', 'select')\n root.setAttribute('role', 'dialog'); root.setAttribute('aria-modal', 'true')\n root.setAttribute('aria-label', zh ? '文件选择器' : 'File picker')\n root.style.cssText = 'position:fixed;inset:0;height:100vh;height:100dvh;z-index:2147483647;background:rgba(0,0,0,.32);display:flex;align-items:center;justify-content:center'\n let frame: HTMLIFrameElement | undefined\n let nonce = ''\n let timer: ReturnType<typeof setTimeout> | undefined\n let done = false\n const block = (event: Event) => { if (!root.contains(event.target as Node)) { event.stopPropagation(); event.preventDefault() } }\n const blocked = ['keydown', 'pointerdown', 'mousedown', 'touchstart', 'wheel'] as const\n const cleanup = () => {\n if (done) return false\n done = true; selectEmbedOpen = false\n clearTimeout(timer)\n window.removeEventListener('message', receive)\n options.signal?.removeEventListener('abort', abort)\n if (!('inert' in HTMLElement.prototype)) blocked.forEach(type => document.removeEventListener(type, block, true))\n root.remove()\n siblings.forEach(({ el, inert, hidden }) => { el.inert = inert; if (hidden === null) el.removeAttribute('aria-hidden'); else el.setAttribute('aria-hidden', hidden) })\n if (saved.body === null) body.removeAttribute('style'); else body.setAttribute('style', saved.body)\n if (saved.html === null) html.removeAttribute('style'); else html.setAttribute('style', saved.html)\n window.scrollTo(scroll.x, scroll.y)\n focused?.focus({ preventScroll: true })\n return true\n }\n const finish = (result: SelectDialogResult) => { if (cleanup()) resolve(result) }\n const fail = (code: SystemDialogErrorCode) => { if (cleanup()) reject(new SystemDialogError(code)) }\n const abort = () => fail('closed')\n const showFailure = () => {\n frame?.remove(); frame = undefined\n const panel = document.createElement('div')\n panel.setAttribute('role', 'alert')\n panel.style.cssText = `max-width:22rem;margin:1rem;padding:1.25rem;border-radius:16px;font:14px/1.6 system-ui,sans-serif;background:${theme === 'dark' ? '#1f2329' : '#fff'};color:${theme === 'dark' ? '#f2f3f5' : '#1f2329'};box-shadow:0 24px 64px rgba(0,0,0,.24)`\n const text = document.createElement('p')\n text.style.margin = '0 0 1rem'\n text.textContent = zh ? '无法加载文件选择器' : 'Unable to load the file picker'\n const actions = document.createElement('div')\n actions.style.cssText = 'display:flex;gap:.5rem;justify-content:flex-end'\n const button = (label: string, action: () => void) => {\n const el = document.createElement('button')\n el.type = 'button'; el.textContent = label\n el.style.cssText = 'min-height:2.25rem;padding:0 1rem;font:inherit;border-radius:999px;border:1px solid currentColor;background:transparent;color:inherit;cursor:pointer'\n el.addEventListener('click', action); actions.append(el); return el\n }\n button(zh ? '取消' : 'Cancel', () => fail('load_failed'))\n const retry = button(zh ? '重试' : 'Retry', () => { panel.remove(); load() })\n panel.append(text, actions); root.append(panel); retry.focus()\n }\n const load = () => {\n nonce = crypto.randomUUID()\n frame = document.createElement('iframe')\n frame.title = zh ? '文件选择器' : 'File picker'\n frame.style.cssText = 'position:absolute;inset:0;width:100%;height:100%;border:0;background:transparent;color-scheme:normal'\n frame.setAttribute('allowtransparency', 'true')\n frame.addEventListener('error', showFailure)\n frame.src = `${origin}${SELECT_EMBED_PATH}#bse=${nonce}&po=${encodeURIComponent(window.location.origin)}`\n root.append(frame)\n timer = setTimeout(showFailure, 10000)\n }\n const receive = (event: MessageEvent) => {\n if (!frame || event.origin !== origin || event.source !== frame.contentWindow || !isEmbedMessage(event.data, SYSDLG_EMBED)) return\n const { type, payload: p } = event.data\n if (type === 'embed.hello') {\n if (p.nonce !== nonce) return\n clearTimeout(timer)\n frame.contentWindow?.postMessage(embedEnvelope('embed.init', { nonce, params, theme, locale } satisfies SelectEmbedInit, SYSDLG_EMBED), origin)\n frame.focus()\n }\n if (type === 'embed.error') fail(dialogErrorCode(p.code))\n if (type === 'embed.result') {\n const result = readSelectDialogResult(p.result, { allowLocal: params.allowLocal === true })\n if (result) finish(result)\n else fail('protocol')\n }\n }\n window.addEventListener('message', receive)\n options.signal?.addEventListener('abort', abort, { once: true })\n if ('inert' in HTMLElement.prototype) siblings.forEach(({ el }) => { el.inert = true })\n else { siblings.forEach(({ el }) => el.setAttribute('aria-hidden', 'true')); blocked.forEach(type => document.addEventListener(type, block, true)) }\n // `overflow: hidden` alone does not stop the page behind from scrolling on iOS; pinning the body does.\n html.style.overflow = 'hidden'\n body.style.position = 'fixed'; body.style.top = `${-scroll.y}px`; body.style.left = `${-scroll.x}px`; body.style.right = '0'; body.style.overflow = 'hidden'\n body.append(root)\n load()\n })\n}\n\n/** System side: the picker page at `SELECT_EMBED_PATH`. Works only for an embedding page whose origin `accept` admits. */\nexport class SelectEmbedHost {\n readonly parentOrigin: string | null\n private readonly nonce: string | null\n private ready = false\n private readonly hello?: ReturnType<typeof setInterval>\n private readonly listener = (event: MessageEvent) => this.receive(event)\n constructor(private options: { accept: (origin: string) => boolean; onInit: (init: SelectEmbedInit) => void }) {\n const params = new URLSearchParams(window.location.hash.slice(1))\n this.nonce = params.get('bse')\n let parentOrigin: string | null = null\n try { parentOrigin = new URL(params.get('po') ?? '').origin } catch {}\n this.parentOrigin = window.parent !== window && this.nonce && parentOrigin && options.accept(parentOrigin) ? parentOrigin : null\n if (!this.parentOrigin) return\n window.addEventListener('message', this.listener)\n const hello = () => window.parent.postMessage(embedEnvelope('embed.hello', { nonce: this.nonce }, SYSDLG_EMBED), this.parentOrigin!)\n hello()\n this.hello = setInterval(() => { if (!this.ready) hello() }, 250)\n }\n private receive(event: MessageEvent): void {\n if (event.source !== window.parent || event.origin !== this.parentOrigin || !isEmbedMessage(event.data, SYSDLG_EMBED)) return\n const { type, payload: p } = event.data\n if (type !== 'embed.init' || this.ready || p.nonce !== this.nonce || typeof p.locale !== 'string') return\n this.ready = true; clearInterval(this.hello)\n this.options.onInit({ nonce: String(p.nonce), params: p.params, theme: p.theme === 'dark' ? 'dark' : 'light', locale: p.locale })\n }\n private post(type: string, payload: unknown): void {\n if (this.ready && this.parentOrigin) window.parent.postMessage(embedEnvelope(type, payload, SYSDLG_EMBED), this.parentOrigin)\n }\n result(result: SelectDialogResult): void { this.post('embed.result', { result }) }\n error(code: SystemDialogErrorCode): void { this.post('embed.error', { code }) }\n dispose(): void { clearInterval(this.hello); window.removeEventListener('message', this.listener) }\n}\n\n/**\n * Conversation embed protocol (`buckyos.conversation-embed` v1): an App shows a conversation of the user with an\n * Agent inside its own layout, rendered by the system conversation component. The App frames\n * `<systemOrigin>/embed/conversation` (component only, no shell); the handshake is the Preview embed's\n * (`embed.hello` → `embed.init`). The system page works with its own Zone-root session and derives the App from the\n * embedder's origin, never from anything the App says: no token crosses origins, and message contents never travel\n * back to the App (it reads them with its own session if it needs them).\n */\nconst CONVERSATION_EMBED = 'buckyos.conversation-embed'\nexport const CONVERSATION_EMBED_PATH = '/embed/conversation'\n/**\n * `agent`: the conversation with this Agent (the owner's default Agent when `agentDid` is left out) that this App\n * started; without one, the first message starts it. With a `memoryMode`, only a conversation in that mode counts, and\n * the one the first message starts has it (`normal` when left out). `session`: an existing conversation, when the\n * system allows this App to open it.\n */\nexport type ConversationEmbedTarget = { kind: 'agent'; agentDid?: string; memoryMode?: ConversationMemoryMode } | { kind: 'session'; sessionId: string }\n/**\n * Whether what is said in a conversation with an Agent, and what the work it starts finds, reaches the Agent's\n * long-term memory (`no_write`: it does not), and whether that memory reaches the conversation (`no_read_write`:\n * neither way).\n */\nexport type ConversationMemoryMode = 'normal' | 'no_write' | 'no_read_write'\nexport interface ConversationEmbedInit {\n nonce: string\n target: ConversationEmbedTarget\n theme: 'light' | 'dark'\n locale: string\n /** The composer's placeholder. */\n placeholder?: string\n}\n/** What the system page receives: `target` is untrusted input it validates itself. */\nexport type ConversationEmbedHostInit = Omit<ConversationEmbedInit, 'target'> & { target: unknown }\n/** A message the App sends in the user's name; `attachments` are content the user can read in the Zone. */\nexport interface ConversationEmbedSend { text: string; attachments?: TransferableContentRef[] }\nexport interface ConversationEmbedState {\n status: 'loading' | 'ready' | 'error'\n /** The conversation shown, once there is one. */\n sessionId?: string\n error?: string\n}\n/**\n * What the conversation in front is doing: `idle`; `running` while the Agent handles the message in front,\n * `interrupted` after a restart in the middle of it, `paused`; `answer` while a question of the Agent waits for the\n * user's answer.\n */\nexport type ConversationEmbedTurnMode = 'idle' | 'running' | 'interrupted' | 'paused' | 'answer'\nexport const CONVERSATION_EMBED_ERROR_CODES = ['invalid_params', 'not_found', 'denied'] as const\nexport type ConversationEmbedErrorCode = typeof CONVERSATION_EMBED_ERROR_CODES[number]\nconst TURN_MODES: readonly ConversationEmbedTurnMode[] = ['idle', 'running', 'interrupted', 'paused', 'answer']\nconst MAX_EMBED_TEXT = 64 * 1024\nconst MAX_EMBED_ATTACHMENTS = 32\nconst readEmbedSend = (p: Record<string, unknown>): ConversationEmbedSend | null => {\n if (typeof p.text !== 'string' || p.text.length > MAX_EMBED_TEXT) return null\n if (p.attachments === undefined) return { text: p.text }\n if (!Array.isArray(p.attachments) || p.attachments.length > MAX_EMBED_ATTACHMENTS || !p.attachments.every(isTransferableRef)) return null\n return { text: p.text, attachments: p.attachments as TransferableContentRef[] }\n}\n\n/** App side: owns the iframe that shows the system conversation. */\nexport class ConversationEmbed {\n readonly url: string\n private readonly nonce = crypto.randomUUID()\n private readonly origin: string\n private readonly listener = (event: MessageEvent) => this.receive(event)\n private init: Omit<ConversationEmbedInit, 'nonce'>\n private ready = false\n private outbox: ConversationEmbedSend[] = []\n constructor(private options: {\n systemOrigin: string\n frame: () => HTMLIFrameElement | null\n init: Omit<ConversationEmbedInit, 'nonce'>\n onState?: (state: ConversationEmbedState) => void\n onTurn?: (mode: ConversationEmbedTurnMode) => void\n onError?: (code: ConversationEmbedErrorCode) => void\n }) {\n this.origin = new URL(options.systemOrigin).origin\n this.init = options.init\n this.url = `${this.origin}${CONVERSATION_EMBED_PATH}#bce=${this.nonce}&po=${encodeURIComponent(window.location.origin)}`\n window.addEventListener('message', this.listener)\n }\n private post(type: string, payload: unknown): void {\n this.options.frame()?.contentWindow?.postMessage(embedEnvelope(type, payload, CONVERSATION_EMBED), this.origin)\n }\n private receive(event: MessageEvent): void {\n if (event.origin !== this.origin || event.source !== this.options.frame()?.contentWindow || !isEmbedMessage(event.data, CONVERSATION_EMBED)) return\n const { type, payload: p } = event.data\n if (type === 'embed.hello') {\n if (p.nonce !== this.nonce) return\n this.ready = true\n this.post('embed.init', { ...this.init, nonce: this.nonce })\n const queued = this.outbox\n this.outbox = []\n queued.forEach(message => this.post('embed.send', message))\n return\n }\n if (type === 'embed.state' && (p.status === 'loading' || p.status === 'ready' || p.status === 'error')) {\n this.options.onState?.({ status: p.status,\n sessionId: typeof p.sessionId === 'string' ? p.sessionId.slice(0, 512) : undefined,\n error: typeof p.error === 'string' ? p.error.slice(0, 128) : undefined })\n }\n if (type === 'embed.turn' && TURN_MODES.includes(p.mode as ConversationEmbedTurnMode)) this.options.onTurn?.(p.mode as ConversationEmbedTurnMode)\n if (type === 'embed.error' && CONVERSATION_EMBED_ERROR_CODES.includes(p.code as ConversationEmbedErrorCode)) this.options.onError?.(p.code as ConversationEmbedErrorCode)\n }\n update(patch: Partial<Pick<ConversationEmbedInit, 'theme' | 'locale'>>): void {\n this.init = { ...this.init, ...patch }\n if (this.ready) this.post('embed.update', patch)\n }\n /** Sends a message in the user's name. Before the handshake it waits and goes out right after `embed.init`. */\n send(message: ConversationEmbedSend): void {\n const payload: ConversationEmbedSend = { text: message.text, ...(message.attachments?.length ? { attachments: message.attachments } : {}) }\n if (this.ready) this.post('embed.send', payload)\n else this.outbox.push(payload)\n }\n dispose(): void { window.removeEventListener('message', this.listener); this.outbox = [] }\n}\n\n/** System side: the component-only page at `CONVERSATION_EMBED_PATH`. Accepts one embedding App whose origin `accept` admits. */\nexport class ConversationEmbedHost {\n readonly parentOrigin: string | null\n private readonly nonce: string | null\n private ready = false\n private readonly hello?: ReturnType<typeof setInterval>\n private readonly listener = (event: MessageEvent) => this.receive(event)\n constructor(private options: {\n accept: (origin: string) => boolean\n onInit: (init: ConversationEmbedHostInit) => void\n onUpdate?: (patch: Partial<Pick<ConversationEmbedInit, 'theme' | 'locale'>>) => void\n onSend?: (message: ConversationEmbedSend) => void\n }) {\n const params = new URLSearchParams(window.location.hash.slice(1))\n this.nonce = params.get('bce')\n let parentOrigin: string | null = null\n try { parentOrigin = new URL(params.get('po') ?? '').origin } catch {}\n this.parentOrigin = window.parent !== window && this.nonce && parentOrigin && options.accept(parentOrigin) ? parentOrigin : null\n if (!this.parentOrigin) return\n window.addEventListener('message', this.listener)\n const hello = () => window.parent.postMessage(embedEnvelope('embed.hello', { nonce: this.nonce }, CONVERSATION_EMBED), this.parentOrigin!)\n hello()\n this.hello = setInterval(() => { if (!this.ready) hello() }, 250)\n }\n private receive(event: MessageEvent): void {\n if (event.source !== window.parent || event.origin !== this.parentOrigin || !isEmbedMessage(event.data, CONVERSATION_EMBED)) return\n const { type, payload: p } = event.data\n if (type === 'embed.init') {\n if (this.ready || p.nonce !== this.nonce || typeof p.locale !== 'string') return\n this.ready = true; clearInterval(this.hello)\n this.options.onInit({ nonce: String(p.nonce), target: p.target, theme: p.theme === 'dark' ? 'dark' : 'light', locale: p.locale,\n ...(typeof p.placeholder === 'string' ? { placeholder: p.placeholder.slice(0, 200) } : {}) })\n return\n }\n if (!this.ready) return\n if (type === 'embed.update') {\n const patch: Partial<Pick<ConversationEmbedInit, 'theme' | 'locale'>> = {}\n if (p.theme === 'dark' || p.theme === 'light') patch.theme = p.theme\n if (typeof p.locale === 'string') patch.locale = p.locale\n this.options.onUpdate?.(patch)\n }\n if (type === 'embed.send') {\n const message = readEmbedSend(p)\n if (message) this.options.onSend?.(message)\n else this.error('invalid_params')\n }\n }\n private post(type: string, payload: unknown): void {\n if (this.ready && this.parentOrigin) window.parent.postMessage(embedEnvelope(type, payload, CONVERSATION_EMBED), this.parentOrigin)\n }\n state(state: ConversationEmbedState): void { this.post('embed.state', state) }\n turn(mode: ConversationEmbedTurnMode): void { this.post('embed.turn', { mode }) }\n error(code: ConversationEmbedErrorCode): void { this.post('embed.error', { code }) }\n dispose(): void { clearInterval(this.hello); window.removeEventListener('message', this.listener) }\n}\n"],"names":["_a","text"],"mappings":";;;;;AAIA,MAAM,kBAAkB,CAAC,UACvB,0BAA0B,SAAS,KAA8B,IAAI,QAAiC;AAqCxG,MAAM,OAAO,CAAC,OAAgB,QAAoC,OAAO,UAAU,WAAW,MAAM,MAAM,GAAG,GAAG,IAAI;AACpH,SAAS,eAAsD,OAAgB,MAAmF;AAC5J,MAAA,CAAC,MAAM,QAAQ,KAAK;AAAG,WAAO;AAClC,SAAO,MAAM,MAAM,GAAG,EAAE,EAAE,QAAQ,CAAC,UAAmB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ays in the background or records. In the BuckyOS client the client does it; in a browser the page's
3
+ * own means stand in. `audioCapabilities` says which one applies.
4
+ */
5
+ export interface AudioCapabilities {
6
+ /**
7
+ * `native`: the client keeps the page playing when it is in the background. `media-session`: the system's media
8
+ * controls work, and whether the page goes on playing is up to the browser. `none`: neither.
9
+ */
10
+ background: 'native' | 'media-session' | 'none';
11
+ /** `native`: recorded by the client into a local file. `browser`: recorded by the page and kept in its memory. */
12
+ record: 'native' | 'browser' | 'none';
13
+ }
14
+ export declare function audioCapabilities(): AudioCapabilities;
15
+ export type AudioErrorCode = 'unsupported' | 'denied' | 'busy' | 'not_found' | 'invalid_state' | 'failed';
16
+ export declare class AudioError extends Error {
17
+ readonly code: AudioErrorCode;
18
+ constructor(code: AudioErrorCode, message?: string);
19
+ }
20
+ export interface BackgroundAudioInfo {
21
+ title: string;
22
+ artist?: string;
23
+ /** Address of an image; a relative one is resolved against the page. */
24
+ artwork?: string;
25
+ }
26
+ export type BackgroundAudioCommand = 'play' | 'pause' | 'stop' | 'next' | 'previous';
27
+ export interface BackgroundAudioHandle {
28
+ /** Changes what the system shows; `playing` decides between its play and pause button. */
29
+ update(patch: Partial<BackgroundAudioInfo> & {
30
+ playing?: boolean;
31
+ }): Promise<void>;
32
+ /** Call it when playback is over: until then the client keeps the page alive. */
33
+ release(): Promise<void>;
34
+ /** The user pressed a button of the system's media controls. Returns the function that stops listening. */
35
+ onCommand(handler: (command: BackgroundAudioCommand) => void): () => void;
36
+ }
37
+ /**
38
+ * Asks to keep this page's sound playing while the page is in the background. The sound still comes from the page (an
39
+ * `<audio>` element). A page holds one handle: acquiring again replaces it, and the earlier one stops having effect.
40
+ */
41
+ export declare function acquireBackgroundAudio(info: BackgroundAudioInfo): Promise<BackgroundAudioHandle>;
42
+ export interface StartRecordingOptions {
43
+ title?: string;
44
+ sampleRate?: number;
45
+ channels?: 1 | 2;
46
+ bitRate?: number;
47
+ }
48
+ /** A finished recording. The client keeps it as a local file; in a browser it lasts as long as the page. */
49
+ export interface AudioRecording {
50
+ id: string;
51
+ title?: string;
52
+ mime: string;
53
+ size: number;
54
+ durationMs?: number;
55
+ /** Milliseconds since the epoch. */
56
+ createdAt: number;
57
+ }
58
+ /** `interrupted`: the system took the microphone; the recording can be resumed or stopped. */
59
+ export type AudioRecordingState = 'idle' | 'recording' | 'paused' | 'interrupted';
60
+ export interface AudioRecordingStatus {
61
+ state: AudioRecordingState;
62
+ /** The recording in progress or, when it just ended by itself, the one that ended. */
63
+ id?: string;
64
+ startedAt?: number;
65
+ /** Recorded time, without pauses. */
66
+ elapsedMs: number;
67
+ /** Why it was interrupted or ended. */
68
+ error?: AudioErrorCode;
69
+ }
70
+ /** Starts recording the microphone. Rejects with an `AudioError`: `unsupported`, `denied`, `busy`, … */
71
+ export declare function startRecording(options?: StartRecordingOptions): Promise<AudioRecordingStatus>;
72
+ export declare function pauseRecording(): Promise<AudioRecordingStatus>;
73
+ export declare function resumeRecording(): Promise<AudioRecordingStatus>;
74
+ export declare function stopRecording(): Promise<AudioRecording>;
75
+ export declare function getRecordingStatus(): Promise<AudioRecordingStatus>;
76
+ /** This App's finished recordings, newest first. */
77
+ export declare function listRecordings(): Promise<AudioRecording[]>;
78
+ export declare function getRecording(id: string): Promise<AudioRecording & {
79
+ blob: Blob;
80
+ }>;
81
+ export declare function deleteRecording(id: string): Promise<void>;
82
+ /** Called when the recording starts, pauses, resumes or ends. Returns the function that stops listening. */
83
+ export declare function onRecordingState(handler: (status: AudioRecordingStatus) => void): () => void;
84
+ //# sourceMappingURL=audio.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"audio.d.ts","sourceRoot":"","sources":["../src/audio.ts"],"names":[],"mappings":"AAEA;;;GAGG;AACH,MAAM,WAAW,iBAAiB;IAChC;;;OAGG;IACH,UAAU,EAAE,QAAQ,GAAG,eAAe,GAAG,MAAM,CAAA;IAC/C,kHAAkH;IAClH,MAAM,EAAE,QAAQ,GAAG,SAAS,GAAG,MAAM,CAAA;CACtC;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AE,oBAAoB,KAAK,IAAI,GAAG,MAAM,IAAI,CAE5F"}
package/dist/browser.cjs CHANGED
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./aiws_write-ad97b561.js"),t=require("./account-b12ac6b9.js"),o=require("./ndn_types-5b138882.js"),r=require("./content_objid-0e63f1ff.js"),s=require("./object_url-88047ee2.js"),_=require("./aiws_bind-4fe77108.js"),p=require("./did_object_client-27835522.js"),E=require("./krpc_client-26c2dc8b.js");require("./content_mime-dc80d960.js"),require("./content.cjs");const A=e.createSDKModule("browser"),n=A.buckyos,i=A.initBuckyOS,T=A.getBuckyOSConfig,S=A.getRuntimeType,x=A.getAppId,O=A.getAppDid,a=A.getAppInstanceId,C=A.getAppDataDir,I=A.getKEventClient,c=A.createEventReader,R=A.create_event_reader,D=A.subscribeKEvent,l=A.attachEvent,d=A.removeEvent,N=A.getAccountInfo,M=A.getCurrentIdentity,u=A.loginByPassword,P=A.loginByBrowserSSO,L=A.loginByRuntimeSession,m=A.login,H=A.logout,U=A.getAppSetting,g=A.setAppSetting,K=A.getCurrentWalletUser,k=A.resolve_did,B=A.walletSignWithActiveDid,y=A.openExternalUrl,f=A.getZoneHostName,W=A.getZoneServiceURL,F=A.getServiceRpcClient,v=A.getVerifyHubClient,w=A.getSystemConfigClient,G=A.getTaskManagerClient,V=A.getWorkflowClient;exports.ACCESS_DENIED_ERROR_CODE=e.ACCESS_DENIED_ERROR_CODE,exports.AGENT_DELEGATE_TASK_SCHEMA_ID=e.AGENT_DELEGATE_TASK_SCHEMA_ID,exports.AICC_AI_METHODS=e.AICC_AI_METHODS,exports.AICC_COMPUTE_TASK_SCHEMA_ID=e.AICC_COMPUTE_TASK_SCHEMA_ID,exports.AICC_CORE_METHODS=e.AICC_CORE_METHODS,exports.AICC_EXECUTION_MODES=e.AICC_EXECUTION_MODES,exports.AICC_FEATURES=e.AICC_FEATURES,exports.AICC_MANAGEMENT_METHODS=e.AICC_MANAGEMENT_METHODS,exports.AICC_METHODS=e.AICC_METHODS,exports.AICC_POLICY_REFUSAL_CODES=e.AICC_POLICY_REFUSAL_CODES,exports.AICC_QUOTA_METHODS=e.AICC_QUOTA_METHODS,exports.AICC_SERVICE_SERVICE_NAME=e.AICC_SERVICE_SERVICE_NAME,exports.AICC_SERVICE_SERVICE_PORT=e.AICC_SERVICE_SERVICE_PORT,exports.AICC_SERVICE_UNIQUE_ID=e.AICC_SERVICE_UNIQUE_ID,exports.ANONYMOUS_IDENTITY=e.ANONYMOUS_IDENTITY,exports.APP_INSTALL_TASK_SCHEMA_ID=e.APP_INSTALL_TASK_SCHEMA_ID,exports.APP_LOGIN_EXCHANGE_METHOD=e.APP_LOGIN_EXCHANGE_METHOD,exports.APP_LOGIN_ISSUE_METHOD=e.APP_LOGIN_ISSUE_METHOD,exports.APP_LOGIN_SETTINGS_GET_METHOD=e.APP_LOGIN_SETTINGS_GET_METHOD,exports.APP_LOGIN_SETTINGS_SET_METHOD=e.APP_LOGIN_SETTINGS_SET_METHOD,exports.APP_START_TASK_SCHEMA_ID=e.APP_START_TASK_SCHEMA_ID,exports.APP_UNINSTALL_TASK_SCHEMA_ID=e.APP_UNINSTALL_TASK_SCHEMA_ID,exports.APP_UPDATE_BATCH_TASK_SCHEMA_ID=e.APP_UPDATE_BATCH_TASK_SCHEMA_ID,exports.APP_UPDATE_TASK_SCHEMA_ID=e.APP_UPDATE_TASK_SCHEMA_ID,exports.AiccClient=e.AiccClient,exports.BNS_DNS_TXT_DEFAULT_TTL=e.BNS_DNS_TXT_DEFAULT_TTL,exports.BNS_DNS_TXT_DOC_TYPE=e.BNS_DNS_TXT_DOC_TYPE,exports.BNS_EVM_DEFAULT_GAS_LIMIT=e.BNS_EVM_DEFAULT_GAS_LIMIT,exports.BNS_EVM_DEFAULT_MAX_FEE_PER_GAS=e.BNS_EVM_DEFAULT_MAX_FEE_PER_GAS,exports.BNS_EVM_DEFAULT_MAX_PRIORITY_FEE_PER_GAS=e.BNS_EVM_DEFAULT_MAX_PRIORITY_FEE_PER_GAS,exports.BNS_MAX_INLINE_DOCUMENT_BYTES=e.BNS_MAX_INLINE_DOCUMENT_BYTES,exports.BNS_PUBLISH_DOCUMENT_ABI=e.BNS_PUBLISH_DOCUMENT_ABI,exports.BS_SERVICE_TASK_MANAGER=e.BS_SERVICE_TASK_MANAGER,exports.BS_SERVICE_VERIFY_HUB=e.BS_SERVICE_VERIFY_HUB,exports.BnsEvmTxBuilder=e.BnsEvmTxBuilder,exports.BnsEvmTxError=e.BnsEvmTxError,exports.BnsTxExecutor=e.BnsTxExecutor,exports.BnsTxExecutorError=e.BnsTxExecutorError,exports.BuckyOSSDK=e.BuckyOSSDK,exports.COMPUTER_ELEMENT_ACTIONS=e.COMPUTER_ELEMENT_ACTIONS,exports.COMPUTER_ELEMENT_STATES=e.COMPUTER_ELEMENT_STATES,exports.COMPUTER_ROLES=e.COMPUTER_ROLES,exports.COMPUTER_SEMANTIC_FORMAT=e.COMPUTER_SEMANTIC_FORMAT,exports.CONTACT_CHANGED_EVENT_PATTERN=e.CONTACT_CHANGED_EVENT_PATTERN,exports.CONTACT_TAG_HOMESTATION_FOLLOWING=e.CONTACT_TAG_HOMESTATION_FOLLOWING,exports.CONTACT_TAG_ZONE_AGENT=e.CONTACT_TAG_ZONE_AGENT,exports.CONTACT_TAG_ZONE_USER=e.CONTACT_TAG_ZONE_USER,exports.DEFAULT_CHILD_CONTROL_POLICY=e.DEFAULT_CHILD_CONTROL_POLICY,exports.DEFAULT_JUMP_BASE_URL=e.DEFAULT_JUMP_BASE_URL,exports.DENY_REASONS=e.DENY_REASONS,exports.DOWNLOAD_TASK_SCHEMA_ID=e.DOWNLOAD_TASK_SCHEMA_ID,exports.EXTERNAL_PRINCIPAL_CLAIM=e.EXTERNAL_PRINCIPAL_CLAIM,exports.ExecutorClient=e.ExecutorClient,exports.ExecutorCommandStream=e.ExecutorCommandStream,exports.ExecutorStreamError=e.ExecutorStreamError,exports.FRIEND_INTENT=e.FRIEND_INTENT,exports.HUMAN_APPROVAL_SCHEMA_ID=e.HUMAN_APPROVAL_SCHEMA_ID,exports.HUMAN_INPUT_TASK_SCHEMA_ID=e.HUMAN_INPUT_TASK_SCHEMA_ID,exports.JUMP_ACTION_PATHS=e.JUMP_ACTION_PATHS,exports.KEventClient=e.KEventClient,exports.KEventReader=e.KEventReader,exports.MsgCenterClient=e.MsgCenterClient,exports.MsgQueueClient=e.MsgQueueClient,exports.NOTIFY_ACTION_ANSWER=e.NOTIFY_ACTION_ANSWER,exports.NOTIFY_ACTION_DISMISS=e.NOTIFY_ACTION_DISMISS,exports.NOTIFY_CHOICE_CONTROL_ID=e.NOTIFY_CHOICE_CONTROL_ID,exports.NOTIFY_DATA_VERSION=e.NOTIFY_DATA_VERSION,exports.NOTIFY_DELIVERED_INTENT=e.NOTIFY_DELIVERED_INTENT,exports.NOTIFY_INTENT=e.NOTIFY_INTENT,exports.NOTIFY_LINK_PATH=e.NOTIFY_LINK_PATH,exports.NOTIFY_SESSION_PREFIX=e.NOTIFY_SESSION_PREFIX,exports.NOTIFY_TEXT_CONTROL_ID=e.NOTIFY_TEXT_CONTROL_ID,exports.OPENDAN_ASYNC_TOOL_TASK_SCHEMA_ID=e.OPENDAN_ASYNC_TOOL_TASK_SCHEMA_ID,exports.OPENDAN_COMMAND_TASK_SCHEMA_ID=e.OPENDAN_COMMAND_TASK_SCHEMA_ID,exports.RAW_TASK_SCHEMA_ID=e.RAW_TASK_SCHEMA_ID,exports.RepoClient=e.RepoClient,exports.RuntimeType=e.RuntimeType,exports.SCHEDULER_DISPATCH_THUNK_TASK_SCHEMA_ID=e.SCHEDULER_DISPATCH_THUNK_TASK_SCHEMA_ID,exports.StorageDomain=e.StorageDomain,exports.SystemConfigClient=e.SystemConfigClient,exports.TASK_ERR_ALREADY_COMPLETED=e.TASK_ERR_ALREADY_COMPLETED,exports.TASK_ERR_CONTROL_ALREADY_PENDING=e.TASK_ERR_CONTROL_ALREADY_PENDING,exports.TASK_ERR_CONTROL_NOT_AVAILABLE=e.TASK_ERR_CONTROL_NOT_AVAILABLE,exports.TASK_ERR_IDEMPOTENCY_CONFLICT=e.TASK_ERR_IDEMPOTENCY_CONFLICT,exports.TASK_ERR_INPUT_SCHEMA_MISMATCH=e.TASK_ERR_INPUT_SCHEMA_MISMATCH,exports.TASK_ERR_INVALID_PHASE=e.TASK_ERR_INVALID_PHASE,exports.TASK_ERR_NOT_FOUND=e.TASK_ERR_NOT_FOUND,exports.TASK_ERR_PERMISSION_DENIED=e.TASK_ERR_PERMISSION_DENIED,exports.TASK_ERR_RESULT_SCHEMA_MISMATCH=e.TASK_ERR_RESULT_SCHEMA_MISMATCH,exports.TASK_ERR_REVISION_CONFLICT=e.TASK_ERR_REVISION_CONFLICT,exports.TASK_ERR_SCHEMA_NOT_FOUND=e.TASK_ERR_SCHEMA_NOT_FOUND,exports.TASK_ERR_STALE_RUNNER_EPOCH=e.TASK_ERR_STALE_RUNNER_EPOCH,exports.TASK_MANAGER_SERVICE_NAME=e.TASK_MANAGER_SERVICE_NAME,exports.TASK_MANAGER_SERVICE_PORT=e.TASK_MANAGER_SERVICE_PORT,exports.TASK_MANAGER_SERVICE_UNIQUE_ID=e.TASK_MANAGER_SERVICE_UNIQUE_ID,exports.TASK_MGR_ERROR_CODES=e.TASK_MGR_ERROR_CODES,exports.TASK_POLICY_PRESET_COLLABORATIVE_TREE_V1=e.TASK_POLICY_PRESET_COLLABORATIVE_TREE_V1,exports.TOOL_EXEC_BASH_TASK_SCHEMA_ID=e.TOOL_EXEC_BASH_TASK_SCHEMA_ID,exports.TaskAction=e.TaskAction,exports.TaskControlAction=e.TaskControlAction,exports.TaskDataScope=e.TaskDataScope,exports.TaskEventType=e.TaskEventType,exports.TaskExecutorKind=e.TaskExecutorKind,exports.TaskGrantScope=e.TaskGrantScope,exports.TaskManagerClient=e.TaskManagerClient,exports.TaskOutcome=e.TaskOutcome,exports.TaskPhase=e.TaskPhase,exports.TaskWaitReasonKind=e.TaskWaitReasonKind,exports.USER_GROUP_REF_PREFIX=e.USER_GROUP_REF_PREFIX,exports.USER_TYPE_GROUP_REF_PREFIX=e.USER_TYPE_GROUP_REF_PREFIX,exports.VerifyHubClient=e.VerifyHubClient,exports.WEB3_BRIDGE_HOST=e.WEB3_BRIDGE_HOST,exports.WELL_KNOWN_CONTACT_TAGS=e.WELL_KNOWN_CONTACT_TAGS,exports.WORKFLOW_EXECUTE_RPC_TASK_SCHEMA_ID=e.WORKFLOW_EXECUTE_RPC_TASK_SCHEMA_ID,exports.WORKFLOW_MAP_SHARD_TASK_SCHEMA_ID=e.WORKFLOW_MAP_SHARD_TASK_SCHEMA_ID,exports.WORKFLOW_RUN_TARGET_TASK_SCHEMA_ID=e.WORKFLOW_RUN_TARGET_TASK_SCHEMA_ID,exports.WORKFLOW_RUN_TREE_TASK_SCHEMA_ID=e.WORKFLOW_RUN_TREE_TASK_SCHEMA_ID,exports.WORKFLOW_SCHEDULE_TASK_SCHEMA_ID=e.WORKFLOW_SCHEDULE_TASK_SCHEMA_ID,exports.WORKFLOW_SEND_MESSAGE_TASK_SCHEMA_ID=e.WORKFLOW_SEND_MESSAGE_TASK_SCHEMA_ID,exports.WORKFLOW_SERVICE_NAME=e.WORKFLOW_SERVICE_NAME,exports.WORKFLOW_STEP_TASK_SCHEMA_ID=e.WORKFLOW_STEP_TASK_SCHEMA_ID,exports.WORKFLOW_THUNK_TASK_SCHEMA_ID=e.WORKFLOW_THUNK_TASK_SCHEMA_ID,exports.WorkflowClient=e.WorkflowClient,exports.WorkflowDefinitionStatus=e.WorkflowDefinitionStatus,exports.WorkflowErrorCode=e.WorkflowErrorCode,exports.WorkflowHumanActionKind=e.WorkflowHumanActionKind,exports.WorkflowJoinMode=e.WorkflowJoinMode,exports.WorkflowNodeRunState=e.WorkflowNodeRunState,exports.WorkflowOutputMode=e.WorkflowOutputMode,exports.WorkflowRequestError=e.WorkflowRequestError,exports.WorkflowRetryFallback=e.WorkflowRetryFallback,exports.WorkflowRunStatus=e.WorkflowRunStatus,exports.WorkflowScheduledTaskFireStatus=e.WorkflowScheduledTaskFireStatus,exports.WorkflowScheduledTaskMisfirePolicy=e.WorkflowScheduledTaskMisfirePolicy,exports.WorkflowScheduledTaskStatus=e.WorkflowScheduledTaskStatus,exports.WorkflowStepType=e.WorkflowStepType,exports.ZONE_USER_TYPES=e.ZONE_USER_TYPES,exports.accessDenialOf=e.accessDenialOf,exports.aiccMessageFirstText=e.aiccMessageFirstText,exports.aiccMessageTextContent=e.aiccMessageTextContent,exports.aiccRefusalOf=e.aiccRefusalOf,exports.aiccTextMessage=e.aiccTextMessage,exports.answerNotify=e.answerNotify,exports.appDidFromId=e.appDidFromId,exports.appIdFromDid=e.appIdFromDid,exports.baselineTaskControlProfile=e.baselineTaskControlProfile,exports.bns=e.bns_client,exports.bucket=e.bucket_client,exports.buildJumpUrl=e.buildJumpUrl,exports.cellValue=e.cellValue,exports.commitNotifyAnswer=e.commitNotifyAnswer,exports.commitOps=e.commitOps,exports.completeAppAccessTokenLogin=e.completeAppAccessTokenLogin,exports.contactTagApp=e.contactTagApp,exports.contactTagKind=e.contactTagKind,exports.createAppInstanceId=e.createAppInstanceId,exports.createSDKModule=e.createSDKModule,exports.decisionRequirements=e.decisionRequirements,exports.decodeBnsPublishDocumentCalldata=e.decodeBnsPublishDocumentCalldata,exports.encodeExecutorControl=e.encodeExecutorControl,exports.fieldAdd=e.fieldAdd,exports.fieldNamed=e.fieldNamed,exports.getActiveRuntimeType=e.getActiveRuntimeType,exports.getActiveSessionToken=e.getActiveSessionToken,exports.getActiveZoneGatewayOrigin=e.getActiveZoneGatewayOrigin,exports.getCurrentWalletUserFromHost=e.getCurrentWalletUserFromHost,exports.identityAllows=e.identityAllows,exports.identityKey=e.identityKey,exports.inputPrompt=e.inputPrompt,exports.isAiccAiMethod=e.isAiccAiMethod,exports.isExternalPrincipal=e.isExternalPrincipal,exports.isNotifyClosed=e.isNotifyClosed,exports.isTerminalTaskPhase=e.isTerminalTaskPhase,exports.isUserGroupRefTag=e.isUserGroupRefTag,exports.issueAppCustomerLink=e.issueAppCustomerLink,exports.issueAppLoginCode=e.issueAppLoginCode,exports.loginByAppAccessToken=e.loginByAppAccessToken,exports.mailboxAddress=e.mailboxAddress,exports.mailboxResource=e.mailboxResource,exports.markdownToBlocks=e.markdownToBlocks,exports.move=e.move,exports.msgMachineData=e.msgMachineData,exports.ndm=e.ndm_client,exports.ndm_proxy=e.ndm_proxy,exports.ndn=e.ndn,exports.normalizeZoneHostname=e.normalizeZoneHostname,exports.notifyAnswerToTaskResult=e.notifyAnswerToTaskResult,exports.notifyCategoryFromSessionId=e.notifyCategoryFromSessionId,exports.notifyCategorySessionId=e.notifyCategorySessionId,exports.notifyMessageData=e.notifyMessageData,exports.notifyUrl=e.notifyUrl,exports.optionAdd=e.optionAdd,exports.parseAccessDenial=e.parseAccessDenial,exports.parseAppId=e.parseAppId,exports.parseAppInstanceId=e.parseAppInstanceId,exports.parseAppLoginExchangeResult=e.parseAppLoginExchangeResult,exports.parseCurrentIdentity=e.parseCurrentIdentity,exports.parseSessionTokenClaims=e.parseSessionTokenClaims,exports.parseVideoPrompt=e.parseVideoPrompt,exports.parseZoneUserType=e.parseZoneUserType,exports.promptOptions=e.promptOptions,exports.randomAppLoginNonce=e.randomAppLoginNonce,exports.rename=e.rename,exports.resolveDidFromHost=e.resolveDidFromHost,exports.setProps=e.setProps,exports.sn=e.sn_client,exports.tableDelete=e.tableDelete,exports.tableInsert=e.tableInsert,exports.tableSet=e.tableSet,exports.taskMgrErrorCode=e.taskMgrErrorCode,exports.taskMgrTaskEventPath=e.taskMgrTaskEventPath,exports.taskMgrTreeEventPath=e.taskMgrTreeEventPath,exports.textAppend=e.textAppend,exports.textDeleteBlocks=e.textDeleteBlocks,exports.textReplaceBlock=e.textReplaceBlock,exports.validateAiccMessage=e.validateAiccMessage,exports.validateDecisionAnswers=e.validateDecisionAnswers,exports.validateDecisionRequest=e.validateDecisionRequest,exports.validateNotifyAnswer=e.validateNotifyAnswer,exports.validateVideoEdit=e.validateVideoEdit,exports.validateVideoGeneration=e.validateVideoGeneration,exports.validateVideoOutput=e.validateVideoOutput,exports.videoGenerationRequirement=e.videoGenerationRequirement,exports.waitNotify=e.waitNotify,exports.walletUserHasSnAccount=e.walletUserHasSnAccount,exports.zoneActionUrl=e.zoneActionUrl,exports.hashPassword=t.hashPassword,exports.DID_OBJECT_SERVICE_ID=o.DID_OBJECT_SERVICE_ID,exports.DID_OBJECT_SERVICE_TYPE=o.DID_OBJECT_SERVICE_TYPE,exports.NODE_IDENTITY_SCHEMA_V2=o.NODE_IDENTITY_SCHEMA_V2,exports.getDidIdentifier=o.getDidIdentifier,exports.getDidMethod=o.getDidMethod,exports.isBuckyOSAgentDocument=o.isBuckyOSAgentDocument,exports.isBuckyOSDIDObjectCard=o.isBuckyOSDIDObjectCard,exports.isBuckyOSDeviceDocument=o.isBuckyOSDeviceDocument,exports.isBuckyOSDeviceMiniDocument=o.isBuckyOSDeviceMiniDocument,exports.isBuckyOSLocalNodeIdentityConfig=o.isBuckyOSLocalNodeIdentityConfig,exports.isBuckyOSOwnerDocument=o.isBuckyOSOwnerDocument,exports.isBuckyOSZoneBootDocument=o.isBuckyOSZoneBootDocument,exports.isBuckyOSZoneConfig=o.isBuckyOSZoneConfig,exports.isBuckyOSZoneDocument=o.isBuckyOSZoneDocument,exports.isW3CDIDDocumentBase=o.isW3CDIDDocumentBase,exports.namelib=o.namelib,exports.parseBuckyOSDIDDocument=o.parseBuckyOSDIDDocument,exports.parseBuckyOSDeviceMiniDocument=o.parseBuckyOSDeviceMiniDocument,exports.parseBuckyOSOwnerDocument=o.parseBuckyOSOwnerDocument,exports.parseW3CDIDDocumentBase=o.parseW3CDIDDocumentBase,exports.ensureObjId=r.ensureObjId,exports.objectUrl=s.object_url,exports.AIWORKSPACE_SERVICE_NAME=_.AIWORKSPACE_SERVICE_NAME,exports.AIWS_COMMIT_MAX_BYTES=_.AIWS_COMMIT_MAX_BYTES,exports.AIWS_COMMIT_MAX_OPERATIONS=_.AIWS_COMMIT_MAX_OPERATIONS,exports.AIWS_COMMIT_PART_BYTES=_.AIWS_COMMIT_PART_BYTES,exports.AIWS_PROTOCOL_VERSION=_.AIWS_PROTOCOL_VERSION,exports.AiWorkspaceClient=_.AiWorkspaceClient,exports.AiwsFailure=_.AiwsFailure,exports.BindFailure=_.BindFailure,exports.CALENDAR_SCHEMA_ID=_.CALENDAR_SCHEMA_ID,exports.RRuleError=_.RRuleError,exports.SCHEDULE_CALENDAR_ID=_.SCHEDULE_CALENDAR_ID,exports.SCHEDULE_SURFACE_ID=_.SCHEDULE_SURFACE_ID,exports.SCHEDULE_TODO_ID=_.SCHEDULE_TODO_ID,exports.SCHEDULE_WORKSPACE_NAME=_.SCHEDULE_WORKSPACE_NAME,exports.STANDARD_SCHEMAS=_.STANDARD_SCHEMAS,exports.ScheduleClient=_.ScheduleClient,exports.TODO_DONE=_.TODO_DONE,exports.TODO_SCHEMA_ID=_.TODO_SCHEMA_ID,exports.WEEKDAYS=_.WEEKDAYS,exports.aiwsReferenceUrl=_.aiwsReferenceUrl,exports.aiwsTarget=_.aiwsTarget,exports.bindingAccepts=_.bindingAccepts,exports.bindingsPayload=_.bindingsPayload,exports.boundIds=_.boundIds,exports.calendarFields=_.calendarFields,exports.calendarOccurrences=_.calendarOccurrences,exports.canonicalOriginal=_.canonicalOriginal,exports.checkBindResult=_.checkBindResult,exports.checkBindSteps=_.checkBindSteps,exports.commitOverLimit=_.commitOverLimit,exports.commitWithParts=_.commitWithParts,exports.createOps=_.createOps,exports.dateOf=_.dateOf,exports.dayNumber=_.dayNumber,exports.dayOf=_.dayOf,exports.daysInMonth=_.daysInMonth,exports.defaultOnBind=_.defaultOnBind,exports.defaultOnInit=_.defaultOnInit,exports.deleteRecordsOp=_.deleteRecordsOp,exports.describeRRule=_.describeRRule,exports.eventAddOps=_.eventAddOps,exports.eventDeleteOps=_.eventDeleteOps,exports.eventEditOps=_.eventEditOps,exports.eventPostponeOps=_.eventPostponeOps,exports.eventSkipOps=_.eventSkipOps,exports.expandSeries=_.expandSeries,exports.findOccurrence=_.findOccurrence,exports.formatRRule=_.formatRRule,exports.insertRecordOp=_.insertRecordOp,exports.isDate=_.isDate,exports.isLeap=_.isLeap,exports.isOrderKey=_.isOrderKey,exports.isTimeZone=_.isTimeZone,exports.localDate=_.localDate,exports.localDay=_.localDay,exports.newRecordId=_.newRecordId,exports.noUiDialogs=_.noUiDialogs,exports.occurrenceId=_.occurrenceId,exports.orderAt=_.orderAt,exports.orderKeyBetween=_.orderKeyBetween,exports.orderKeysBetween=_.orderKeysBetween,exports.originalOf=_.originalOf,exports.parseAiwsReferenceUrl=_.parseAiwsReferenceUrl,exports.parseOccurrenceId=_.parseOccurrenceId,exports.parseRRule=_.parseRRule,exports.recurrencePresets=_.recurrencePresets,exports.resolveBindings=_.resolveBindings,exports.scheduleBoardOps=_.scheduleBoardOps,exports.scheduleLabel=_.scheduleLabel,exports.seriesStartOf=_.seriesStartOf,exports.setValuesOps=_.setValuesOps,exports.sortTodos=_.sortTodos,exports.splitCommitOperations=_.splitCommitOperations,exports.standardTableOp=_.standardTableOp,exports.stepsOnBind=_.stepsOnBind,exports.todoAddOps=_.todoAddOps,exports.todoCompleteOps=_.todoCompleteOps,exports.todoFields=_.todoFields,exports.todoItem=_.todoItem,exports.todoMoveOps=_.todoMoveOps,exports.todoUpdateOps=_.todoUpdateOps,exports.viewerTimeZone=_.viewerTimeZone,exports.weekdayOf=_.weekdayOf,exports.ymdOf=_.ymdOf,exports.zonedParts=_.zonedParts,exports.zonedToUtc=_.zonedToUtc,exports.DIDObjectClient=p.DIDObjectClient,exports.DIDObjectError=p.DIDObjectError,exports.RPCError=E.RPCError,exports.attachEvent=l,exports.buckyos=n,exports.createEventReader=c,exports.create_event_reader=R,exports.getAccountInfo=N,exports.getAppDataDir=C,exports.getAppDid=O,exports.getAppId=x,exports.getAppInstanceId=a,exports.getAppSetting=U,exports.getBuckyOSConfig=T,exports.getCurrentIdentity=M,exports.getCurrentWalletUser=K,exports.getKEventClient=I,exports.getRuntimeType=S,exports.getServiceRpcClient=F,exports.getSystemConfigClient=w,exports.getTaskManagerClient=G,exports.getVerifyHubClient=v,exports.getWorkflowClient=V,exports.getZoneHostName=f,exports.getZoneServiceURL=W,exports.initBuckyOS=i,exports.login=m,exports.loginByBrowserSSO=P,exports.loginByPassword=u,exports.loginByRuntimeSession=L,exports.logout=H,exports.openExternalUrl=y,exports.removeEvent=d,exports.resolve_did=k,exports.setAppSetting=g,exports.subscribeKEvent=D,exports.walletSignWithActiveDid=B;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./aiws_write-7a9d71d1.js"),t=require("./account-b12ac6b9.js"),o=require("./ndn_types-5b138882.js"),r=require("./content_objid-c69251aa.js"),s=require("./open-app.cjs"),_=require("./runtime_env-6396e1eb.js"),p=require("./object_url-88047ee2.js"),E=require("./aiws_bind-4fe77108.js"),A=require("./did_object_client-27835522.js"),n=require("./krpc_client-26c2dc8b.js");require("./content.cjs");const i=e.createSDKModule("browser"),T=i.buckyos,S=i.initBuckyOS,a=i.getBuckyOSConfig,x=i.getRuntimeType,O=i.getAppId,C=i.getAppDid,I=i.getAppInstanceId,c=i.getAppDataDir,R=i.getKEventClient,d=i.createEventReader,D=i.create_event_reader,l=i.subscribeKEvent,N=i.attachEvent,u=i.removeEvent,M=i.getAccountInfo,P=i.getCurrentIdentity,L=i.loginByPassword,g=i.loginByBrowserSSO,m=i.loginByRuntimeSession,U=i.login,H=i.logout,k=i.getAppSetting,K=i.setAppSetting,B=i.getCurrentWalletUser,y=i.resolve_did,W=i.walletSignWithActiveDid,f=i.openExternalUrl,F=i.getZoneHostName,v=i.getZoneServiceURL,w=i.getServiceRpcClient,G=i.getVerifyHubClient,V=i.getSystemConfigClient,b=i.getTaskManagerClient,Y=i.getWorkflowClient;exports.ACCESS_DENIED_ERROR_CODE=e.ACCESS_DENIED_ERROR_CODE,exports.AGENT_DELEGATE_TASK_SCHEMA_ID=e.AGENT_DELEGATE_TASK_SCHEMA_ID,exports.AICC_AI_METHODS=e.AICC_AI_METHODS,exports.AICC_COMPUTE_TASK_SCHEMA_ID=e.AICC_COMPUTE_TASK_SCHEMA_ID,exports.AICC_CORE_METHODS=e.AICC_CORE_METHODS,exports.AICC_EXECUTION_MODES=e.AICC_EXECUTION_MODES,exports.AICC_FEATURES=e.AICC_FEATURES,exports.AICC_MANAGEMENT_METHODS=e.AICC_MANAGEMENT_METHODS,exports.AICC_METHODS=e.AICC_METHODS,exports.AICC_POLICY_REFUSAL_CODES=e.AICC_POLICY_REFUSAL_CODES,exports.AICC_QUOTA_METHODS=e.AICC_QUOTA_METHODS,exports.AICC_SERVICE_SERVICE_NAME=e.AICC_SERVICE_SERVICE_NAME,exports.AICC_SERVICE_SERVICE_PORT=e.AICC_SERVICE_SERVICE_PORT,exports.AICC_SERVICE_UNIQUE_ID=e.AICC_SERVICE_UNIQUE_ID,exports.ANONYMOUS_IDENTITY=e.ANONYMOUS_IDENTITY,exports.APP_INSTALL_TASK_SCHEMA_ID=e.APP_INSTALL_TASK_SCHEMA_ID,exports.APP_LOGIN_EXCHANGE_METHOD=e.APP_LOGIN_EXCHANGE_METHOD,exports.APP_LOGIN_ISSUE_METHOD=e.APP_LOGIN_ISSUE_METHOD,exports.APP_LOGIN_SETTINGS_GET_METHOD=e.APP_LOGIN_SETTINGS_GET_METHOD,exports.APP_LOGIN_SETTINGS_SET_METHOD=e.APP_LOGIN_SETTINGS_SET_METHOD,exports.APP_START_TASK_SCHEMA_ID=e.APP_START_TASK_SCHEMA_ID,exports.APP_UNINSTALL_TASK_SCHEMA_ID=e.APP_UNINSTALL_TASK_SCHEMA_ID,exports.APP_UPDATE_BATCH_TASK_SCHEMA_ID=e.APP_UPDATE_BATCH_TASK_SCHEMA_ID,exports.APP_UPDATE_TASK_SCHEMA_ID=e.APP_UPDATE_TASK_SCHEMA_ID,exports.AiccClient=e.AiccClient,exports.AudioError=e.AudioError,exports.BNS_DNS_TXT_DEFAULT_TTL=e.BNS_DNS_TXT_DEFAULT_TTL,exports.BNS_DNS_TXT_DOC_TYPE=e.BNS_DNS_TXT_DOC_TYPE,exports.BNS_EVM_DEFAULT_GAS_LIMIT=e.BNS_EVM_DEFAULT_GAS_LIMIT,exports.BNS_EVM_DEFAULT_MAX_FEE_PER_GAS=e.BNS_EVM_DEFAULT_MAX_FEE_PER_GAS,exports.BNS_EVM_DEFAULT_MAX_PRIORITY_FEE_PER_GAS=e.BNS_EVM_DEFAULT_MAX_PRIORITY_FEE_PER_GAS,exports.BNS_MAX_INLINE_DOCUMENT_BYTES=e.BNS_MAX_INLINE_DOCUMENT_BYTES,exports.BNS_PUBLISH_DOCUMENT_ABI=e.BNS_PUBLISH_DOCUMENT_ABI,exports.BS_SERVICE_TASK_MANAGER=e.BS_SERVICE_TASK_MANAGER,exports.BS_SERVICE_VERIFY_HUB=e.BS_SERVICE_VERIFY_HUB,exports.BnsEvmTxBuilder=e.BnsEvmTxBuilder,exports.BnsEvmTxError=e.BnsEvmTxError,exports.BnsTxExecutor=e.BnsTxExecutor,exports.BnsTxExecutorError=e.BnsTxExecutorError,exports.BuckyOSSDK=e.BuckyOSSDK,exports.COMPUTER_ELEMENT_ACTIONS=e.COMPUTER_ELEMENT_ACTIONS,exports.COMPUTER_ELEMENT_STATES=e.COMPUTER_ELEMENT_STATES,exports.COMPUTER_ROLES=e.COMPUTER_ROLES,exports.COMPUTER_SEMANTIC_FORMAT=e.COMPUTER_SEMANTIC_FORMAT,exports.CONTACT_CHANGED_EVENT_PATTERN=e.CONTACT_CHANGED_EVENT_PATTERN,exports.CONTACT_TAG_HOMESTATION_FOLLOWING=e.CONTACT_TAG_HOMESTATION_FOLLOWING,exports.CONTACT_TAG_ZONE_AGENT=e.CONTACT_TAG_ZONE_AGENT,exports.CONTACT_TAG_ZONE_USER=e.CONTACT_TAG_ZONE_USER,exports.DEFAULT_CHILD_CONTROL_POLICY=e.DEFAULT_CHILD_CONTROL_POLICY,exports.DEFAULT_JUMP_BASE_URL=e.DEFAULT_JUMP_BASE_URL,exports.DENY_REASONS=e.DENY_REASONS,exports.DOWNLOAD_TASK_SCHEMA_ID=e.DOWNLOAD_TASK_SCHEMA_ID,exports.EXTERNAL_PRINCIPAL_CLAIM=e.EXTERNAL_PRINCIPAL_CLAIM,exports.ExecutorClient=e.ExecutorClient,exports.ExecutorCommandStream=e.ExecutorCommandStream,exports.ExecutorStreamError=e.ExecutorStreamError,exports.FRIEND_INTENT=e.FRIEND_INTENT,exports.HUMAN_APPROVAL_SCHEMA_ID=e.HUMAN_APPROVAL_SCHEMA_ID,exports.HUMAN_INPUT_TASK_SCHEMA_ID=e.HUMAN_INPUT_TASK_SCHEMA_ID,exports.JUMP_ACTION_PATHS=e.JUMP_ACTION_PATHS,exports.KEventClient=e.KEventClient,exports.KEventReader=e.KEventReader,exports.MsgCenterClient=e.MsgCenterClient,exports.MsgQueueClient=e.MsgQueueClient,exports.NOTIFY_ACTION_ANSWER=e.NOTIFY_ACTION_ANSWER,exports.NOTIFY_ACTION_DISMISS=e.NOTIFY_ACTION_DISMISS,exports.NOTIFY_CHOICE_CONTROL_ID=e.NOTIFY_CHOICE_CONTROL_ID,exports.NOTIFY_DATA_VERSION=e.NOTIFY_DATA_VERSION,exports.NOTIFY_DELIVERED_INTENT=e.NOTIFY_DELIVERED_INTENT,exports.NOTIFY_ERR_DISABLED=e.NOTIFY_ERR_DISABLED,exports.NOTIFY_ERR_NOT_DECLARED=e.NOTIFY_ERR_NOT_DECLARED,exports.NOTIFY_INTENT=e.NOTIFY_INTENT,exports.NOTIFY_LINK_PATH=e.NOTIFY_LINK_PATH,exports.NOTIFY_SESSION_PREFIX=e.NOTIFY_SESSION_PREFIX,exports.NOTIFY_TEXT_CONTROL_ID=e.NOTIFY_TEXT_CONTROL_ID,exports.OPENDAN_ASYNC_TOOL_TASK_SCHEMA_ID=e.OPENDAN_ASYNC_TOOL_TASK_SCHEMA_ID,exports.OPENDAN_COMMAND_TASK_SCHEMA_ID=e.OPENDAN_COMMAND_TASK_SCHEMA_ID,exports.RAW_TASK_SCHEMA_ID=e.RAW_TASK_SCHEMA_ID,exports.RepoClient=e.RepoClient,exports.RuntimeType=e.RuntimeType,exports.SCHEDULER_DISPATCH_THUNK_TASK_SCHEMA_ID=e.SCHEDULER_DISPATCH_THUNK_TASK_SCHEMA_ID,exports.StorageDomain=e.StorageDomain,exports.SystemConfigClient=e.SystemConfigClient,exports.TASK_ERR_ALREADY_COMPLETED=e.TASK_ERR_ALREADY_COMPLETED,exports.TASK_ERR_CONTROL_ALREADY_PENDING=e.TASK_ERR_CONTROL_ALREADY_PENDING,exports.TASK_ERR_CONTROL_NOT_AVAILABLE=e.TASK_ERR_CONTROL_NOT_AVAILABLE,exports.TASK_ERR_IDEMPOTENCY_CONFLICT=e.TASK_ERR_IDEMPOTENCY_CONFLICT,exports.TASK_ERR_INPUT_SCHEMA_MISMATCH=e.TASK_ERR_INPUT_SCHEMA_MISMATCH,exports.TASK_ERR_INVALID_PHASE=e.TASK_ERR_INVALID_PHASE,exports.TASK_ERR_NOT_FOUND=e.TASK_ERR_NOT_FOUND,exports.TASK_ERR_PERMISSION_DENIED=e.TASK_ERR_PERMISSION_DENIED,exports.TASK_ERR_RESULT_SCHEMA_MISMATCH=e.TASK_ERR_RESULT_SCHEMA_MISMATCH,exports.TASK_ERR_REVISION_CONFLICT=e.TASK_ERR_REVISION_CONFLICT,exports.TASK_ERR_SCHEMA_NOT_FOUND=e.TASK_ERR_SCHEMA_NOT_FOUND,exports.TASK_ERR_STALE_RUNNER_EPOCH=e.TASK_ERR_STALE_RUNNER_EPOCH,exports.TASK_MANAGER_SERVICE_NAME=e.TASK_MANAGER_SERVICE_NAME,exports.TASK_MANAGER_SERVICE_PORT=e.TASK_MANAGER_SERVICE_PORT,exports.TASK_MANAGER_SERVICE_UNIQUE_ID=e.TASK_MANAGER_SERVICE_UNIQUE_ID,exports.TASK_MGR_ERROR_CODES=e.TASK_MGR_ERROR_CODES,exports.TASK_POLICY_PRESET_COLLABORATIVE_TREE_V1=e.TASK_POLICY_PRESET_COLLABORATIVE_TREE_V1,exports.TOOL_EXEC_BASH_TASK_SCHEMA_ID=e.TOOL_EXEC_BASH_TASK_SCHEMA_ID,exports.TaskAction=e.TaskAction,exports.TaskControlAction=e.TaskControlAction,exports.TaskDataScope=e.TaskDataScope,exports.TaskEventType=e.TaskEventType,exports.TaskExecutorKind=e.TaskExecutorKind,exports.TaskGrantScope=e.TaskGrantScope,exports.TaskManagerClient=e.TaskManagerClient,exports.TaskOutcome=e.TaskOutcome,exports.TaskPhase=e.TaskPhase,exports.TaskWaitReasonKind=e.TaskWaitReasonKind,exports.USER_GROUP_REF_PREFIX=e.USER_GROUP_REF_PREFIX,exports.USER_TYPE_GROUP_REF_PREFIX=e.USER_TYPE_GROUP_REF_PREFIX,exports.VerifyHubClient=e.VerifyHubClient,exports.WEB3_BRIDGE_HOST=e.WEB3_BRIDGE_HOST,exports.WELL_KNOWN_CONTACT_TAGS=e.WELL_KNOWN_CONTACT_TAGS,exports.WORKFLOW_EXECUTE_RPC_TASK_SCHEMA_ID=e.WORKFLOW_EXECUTE_RPC_TASK_SCHEMA_ID,exports.WORKFLOW_MAP_SHARD_TASK_SCHEMA_ID=e.WORKFLOW_MAP_SHARD_TASK_SCHEMA_ID,exports.WORKFLOW_RUN_TARGET_TASK_SCHEMA_ID=e.WORKFLOW_RUN_TARGET_TASK_SCHEMA_ID,exports.WORKFLOW_RUN_TREE_TASK_SCHEMA_ID=e.WORKFLOW_RUN_TREE_TASK_SCHEMA_ID,exports.WORKFLOW_SCHEDULE_TASK_SCHEMA_ID=e.WORKFLOW_SCHEDULE_TASK_SCHEMA_ID,exports.WORKFLOW_SEND_MESSAGE_TASK_SCHEMA_ID=e.WORKFLOW_SEND_MESSAGE_TASK_SCHEMA_ID,exports.WORKFLOW_SERVICE_NAME=e.WORKFLOW_SERVICE_NAME,exports.WORKFLOW_STEP_TASK_SCHEMA_ID=e.WORKFLOW_STEP_TASK_SCHEMA_ID,exports.WORKFLOW_THUNK_TASK_SCHEMA_ID=e.WORKFLOW_THUNK_TASK_SCHEMA_ID,exports.WorkflowClient=e.WorkflowClient,exports.WorkflowDefinitionStatus=e.WorkflowDefinitionStatus,exports.WorkflowErrorCode=e.WorkflowErrorCode,exports.WorkflowHumanActionKind=e.WorkflowHumanActionKind,exports.WorkflowJoinMode=e.WorkflowJoinMode,exports.WorkflowNodeRunState=e.WorkflowNodeRunState,exports.WorkflowOutputMode=e.WorkflowOutputMode,exports.WorkflowRequestError=e.WorkflowRequestError,exports.WorkflowRetryFallback=e.WorkflowRetryFallback,exports.WorkflowRunStatus=e.WorkflowRunStatus,exports.WorkflowScheduledTaskFireStatus=e.WorkflowScheduledTaskFireStatus,exports.WorkflowScheduledTaskMisfirePolicy=e.WorkflowScheduledTaskMisfirePolicy,exports.WorkflowScheduledTaskStatus=e.WorkflowScheduledTaskStatus,exports.WorkflowStepType=e.WorkflowStepType,exports.ZONE_USER_TYPES=e.ZONE_USER_TYPES,exports.accessDenialOf=e.accessDenialOf,exports.acquireBackgroundAudio=e.acquireBackgroundAudio,exports.aiccMessageFirstText=e.aiccMessageFirstText,exports.aiccMessageTextContent=e.aiccMessageTextContent,exports.aiccRefusalOf=e.aiccRefusalOf,exports.aiccTextMessage=e.aiccTextMessage,exports.answerNotify=e.answerNotify,exports.appDidFromId=e.appDidFromId,exports.appIdFromDid=e.appIdFromDid,exports.audioCapabilities=e.audioCapabilities,exports.baselineTaskControlProfile=e.baselineTaskControlProfile,exports.bns=e.bns_client,exports.bucket=e.bucket_client,exports.buildJumpUrl=e.buildJumpUrl,exports.cellValue=e.cellValue,exports.commitNotifyAnswer=e.commitNotifyAnswer,exports.commitOps=e.commitOps,exports.completeAppAccessTokenLogin=e.completeAppAccessTokenLogin,exports.contactTagApp=e.contactTagApp,exports.contactTagKind=e.contactTagKind,exports.createAppInstanceId=e.createAppInstanceId,exports.createSDKModule=e.createSDKModule,exports.createZoneClients=e.createZoneClients,exports.decisionRequirements=e.decisionRequirements,exports.decodeBnsPublishDocumentCalldata=e.decodeBnsPublishDocumentCalldata,exports.deleteRecording=e.deleteRecording,exports.encodeExecutorControl=e.encodeExecutorControl,exports.fieldAdd=e.fieldAdd,exports.fieldNamed=e.fieldNamed,exports.getActiveRuntimeType=e.getActiveRuntimeType,exports.getActiveSessionToken=e.getActiveSessionToken,exports.getActiveZoneGatewayOrigin=e.getActiveZoneGatewayOrigin,exports.getCurrentWalletUserFromHost=e.getCurrentWalletUserFromHost,exports.getRecording=e.getRecording,exports.getRecordingStatus=e.getRecordingStatus,exports.identityAllows=e.identityAllows,exports.identityKey=e.identityKey,exports.inputPrompt=e.inputPrompt,exports.isAiccAiMethod=e.isAiccAiMethod,exports.isExternalPrincipal=e.isExternalPrincipal,exports.isNotifyClosed=e.isNotifyClosed,exports.isTerminalTaskPhase=e.isTerminalTaskPhase,exports.isUserGroupRefTag=e.isUserGroupRefTag,exports.issueAppCustomerLink=e.issueAppCustomerLink,exports.issueAppLoginCode=e.issueAppLoginCode,exports.listRecordings=e.listRecordings,exports.loginByAppAccessToken=e.loginByAppAccessToken,exports.mailboxAddress=e.mailboxAddress,exports.mailboxResource=e.mailboxResource,exports.markdownToBlocks=e.markdownToBlocks,exports.move=e.move,exports.msgMachineData=e.msgMachineData,exports.ndm=e.ndm_client,exports.ndm_proxy=e.ndm_proxy,exports.ndn=e.ndn,exports.normalizeZoneHostname=e.normalizeZoneHostname,exports.notifyAnswerToTaskResult=e.notifyAnswerToTaskResult,exports.notifyCategoryFromSessionId=e.notifyCategoryFromSessionId,exports.notifyCategorySessionId=e.notifyCategorySessionId,exports.notifyMessageData=e.notifyMessageData,exports.notifyUrl=e.notifyUrl,exports.onRecordingState=e.onRecordingState,exports.optionAdd=e.optionAdd,exports.parseAccessDenial=e.parseAccessDenial,exports.parseAppId=e.parseAppId,exports.parseAppInstanceId=e.parseAppInstanceId,exports.parseAppLoginExchangeResult=e.parseAppLoginExchangeResult,exports.parseCurrentIdentity=e.parseCurrentIdentity,exports.parseSessionTokenClaims=e.parseSessionTokenClaims,exports.parseVideoPrompt=e.parseVideoPrompt,exports.parseZoneUserType=e.parseZoneUserType,exports.pauseRecording=e.pauseRecording,exports.promptOptions=e.promptOptions,exports.randomAppLoginNonce=e.randomAppLoginNonce,exports.rename=e.rename,exports.resolveDidFromHost=e.resolveDidFromHost,exports.resumeRecording=e.resumeRecording,exports.setProps=e.setProps,exports.sn=e.sn_client,exports.startRecording=e.startRecording,exports.stopRecording=e.stopRecording,exports.tableDelete=e.tableDelete,exports.tableInsert=e.tableInsert,exports.tableSet=e.tableSet,exports.taskMgrErrorCode=e.taskMgrErrorCode,exports.taskMgrTaskEventPath=e.taskMgrTaskEventPath,exports.taskMgrTreeEventPath=e.taskMgrTreeEventPath,exports.textAppend=e.textAppend,exports.textDeleteBlocks=e.textDeleteBlocks,exports.textReplaceBlock=e.textReplaceBlock,exports.validateAiccMessage=e.validateAiccMessage,exports.validateDecisionAnswers=e.validateDecisionAnswers,exports.validateDecisionRequest=e.validateDecisionRequest,exports.validateNotifyAnswer=e.validateNotifyAnswer,exports.validateVideoEdit=e.validateVideoEdit,exports.validateVideoGeneration=e.validateVideoGeneration,exports.validateVideoOutput=e.validateVideoOutput,exports.videoGenerationRequirement=e.videoGenerationRequirement,exports.waitNotify=e.waitNotify,exports.walletUserHasSnAccount=e.walletUserHasSnAccount,exports.zoneActionUrl=e.zoneActionUrl,exports.hashPassword=t.hashPassword,exports.DID_OBJECT_SERVICE_ID=o.DID_OBJECT_SERVICE_ID,exports.DID_OBJECT_SERVICE_TYPE=o.DID_OBJECT_SERVICE_TYPE,exports.NODE_IDENTITY_SCHEMA_V2=o.NODE_IDENTITY_SCHEMA_V2,exports.getDidIdentifier=o.getDidIdentifier,exports.getDidMethod=o.getDidMethod,exports.isBuckyOSAgentDocument=o.isBuckyOSAgentDocument,exports.isBuckyOSDIDObjectCard=o.isBuckyOSDIDObjectCard,exports.isBuckyOSDeviceDocument=o.isBuckyOSDeviceDocument,exports.isBuckyOSDeviceMiniDocument=o.isBuckyOSDeviceMiniDocument,exports.isBuckyOSLocalNodeIdentityConfig=o.isBuckyOSLocalNodeIdentityConfig,exports.isBuckyOSOwnerDocument=o.isBuckyOSOwnerDocument,exports.isBuckyOSZoneBootDocument=o.isBuckyOSZoneBootDocument,exports.isBuckyOSZoneConfig=o.isBuckyOSZoneConfig,exports.isBuckyOSZoneDocument=o.isBuckyOSZoneDocument,exports.isW3CDIDDocumentBase=o.isW3CDIDDocumentBase,exports.namelib=o.namelib,exports.parseBuckyOSDIDDocument=o.parseBuckyOSDIDDocument,exports.parseBuckyOSDeviceMiniDocument=o.parseBuckyOSDeviceMiniDocument,exports.parseBuckyOSOwnerDocument=o.parseBuckyOSOwnerDocument,exports.parseW3CDIDDocumentBase=o.parseW3CDIDDocumentBase,exports.ensureObjId=r.ensureObjId,exports.APP_OPEN_ACTION=s.APP_OPEN_ACTION,exports.appWindowId=s.appWindowId,exports.formatAppOpenUrl=s.formatAppOpenUrl,exports.isAppPath=s.isAppPath,exports.parseAppOpenUrl=s.parseAppOpenUrl,exports.parseAppWindowId=s.parseAppWindowId,exports.parseBuckyosUrl=s.parseBuckyosUrl,exports.parseSystemOpenApp=s.parseSystemOpenApp,exports.readAppOpenRequest=s.readAppOpenRequest,exports.readAppWindowDeclaration=s.readAppWindowDeclaration,exports.resolveOpenApp=s.resolveOpenApp,exports.systemOpenAppUrl=s.systemOpenAppUrl,exports.getBuckyApi=_.getBuckyApi,exports.getRuntimeEnvironment=_.getRuntimeEnvironment,exports.objectUrl=p.object_url,exports.AIWORKSPACE_SERVICE_NAME=E.AIWORKSPACE_SERVICE_NAME,exports.AIWS_COMMIT_MAX_BYTES=E.AIWS_COMMIT_MAX_BYTES,exports.AIWS_COMMIT_MAX_OPERATIONS=E.AIWS_COMMIT_MAX_OPERATIONS,exports.AIWS_COMMIT_PART_BYTES=E.AIWS_COMMIT_PART_BYTES,exports.AIWS_PROTOCOL_VERSION=E.AIWS_PROTOCOL_VERSION,exports.AiWorkspaceClient=E.AiWorkspaceClient,exports.AiwsFailure=E.AiwsFailure,exports.BindFailure=E.BindFailure,exports.CALENDAR_SCHEMA_ID=E.CALENDAR_SCHEMA_ID,exports.RRuleError=E.RRuleError,exports.SCHEDULE_CALENDAR_ID=E.SCHEDULE_CALENDAR_ID,exports.SCHEDULE_SURFACE_ID=E.SCHEDULE_SURFACE_ID,exports.SCHEDULE_TODO_ID=E.SCHEDULE_TODO_ID,exports.SCHEDULE_WORKSPACE_NAME=E.SCHEDULE_WORKSPACE_NAME,exports.STANDARD_SCHEMAS=E.STANDARD_SCHEMAS,exports.ScheduleClient=E.ScheduleClient,exports.TODO_DONE=E.TODO_DONE,exports.TODO_SCHEMA_ID=E.TODO_SCHEMA_ID,exports.WEEKDAYS=E.WEEKDAYS,exports.aiwsReferenceUrl=E.aiwsReferenceUrl,exports.aiwsTarget=E.aiwsTarget,exports.bindingAccepts=E.bindingAccepts,exports.bindingsPayload=E.bindingsPayload,exports.boundIds=E.boundIds,exports.calendarFields=E.calendarFields,exports.calendarOccurrences=E.calendarOccurrences,exports.canonicalOriginal=E.canonicalOriginal,exports.checkBindResult=E.checkBindResult,exports.checkBindSteps=E.checkBindSteps,exports.commitOverLimit=E.commitOverLimit,exports.commitWithParts=E.commitWithParts,exports.createOps=E.createOps,exports.dateOf=E.dateOf,exports.dayNumber=E.dayNumber,exports.dayOf=E.dayOf,exports.daysInMonth=E.daysInMonth,exports.defaultOnBind=E.defaultOnBind,exports.defaultOnInit=E.defaultOnInit,exports.deleteRecordsOp=E.deleteRecordsOp,exports.describeRRule=E.describeRRule,exports.eventAddOps=E.eventAddOps,exports.eventDeleteOps=E.eventDeleteOps,exports.eventEditOps=E.eventEditOps,exports.eventPostponeOps=E.eventPostponeOps,exports.eventSkipOps=E.eventSkipOps,exports.expandSeries=E.expandSeries,exports.findOccurrence=E.findOccurrence,exports.formatRRule=E.formatRRule,exports.insertRecordOp=E.insertRecordOp,exports.isDate=E.isDate,exports.isLeap=E.isLeap,exports.isOrderKey=E.isOrderKey,exports.isTimeZone=E.isTimeZone,exports.localDate=E.localDate,exports.localDay=E.localDay,exports.newRecordId=E.newRecordId,exports.noUiDialogs=E.noUiDialogs,exports.occurrenceId=E.occurrenceId,exports.orderAt=E.orderAt,exports.orderKeyBetween=E.orderKeyBetween,exports.orderKeysBetween=E.orderKeysBetween,exports.originalOf=E.originalOf,exports.parseAiwsReferenceUrl=E.parseAiwsReferenceUrl,exports.parseOccurrenceId=E.parseOccurrenceId,exports.parseRRule=E.parseRRule,exports.recurrencePresets=E.recurrencePresets,exports.resolveBindings=E.resolveBindings,exports.scheduleBoardOps=E.scheduleBoardOps,exports.scheduleLabel=E.scheduleLabel,exports.seriesStartOf=E.seriesStartOf,exports.setValuesOps=E.setValuesOps,exports.sortTodos=E.sortTodos,exports.splitCommitOperations=E.splitCommitOperations,exports.standardTableOp=E.standardTableOp,exports.stepsOnBind=E.stepsOnBind,exports.todoAddOps=E.todoAddOps,exports.todoCompleteOps=E.todoCompleteOps,exports.todoFields=E.todoFields,exports.todoItem=E.todoItem,exports.todoMoveOps=E.todoMoveOps,exports.todoUpdateOps=E.todoUpdateOps,exports.viewerTimeZone=E.viewerTimeZone,exports.weekdayOf=E.weekdayOf,exports.ymdOf=E.ymdOf,exports.zonedParts=E.zonedParts,exports.zonedToUtc=E.zonedToUtc,exports.DIDObjectClient=A.DIDObjectClient,exports.DIDObjectError=A.DIDObjectError,exports.RPCError=n.RPCError,exports.attachEvent=N,exports.buckyos=T,exports.createEventReader=d,exports.create_event_reader=D,exports.getAccountInfo=M,exports.getAppDataDir=c,exports.getAppDid=C,exports.getAppId=O,exports.getAppInstanceId=I,exports.getAppSetting=k,exports.getBuckyOSConfig=a,exports.getCurrentIdentity=P,exports.getCurrentWalletUser=B,exports.getKEventClient=R,exports.getRuntimeType=x,exports.getServiceRpcClient=w,exports.getSystemConfigClient=V,exports.getTaskManagerClient=b,exports.getVerifyHubClient=G,exports.getWorkflowClient=Y,exports.getZoneHostName=F,exports.getZoneServiceURL=v,exports.initBuckyOS=S,exports.login=U,exports.loginByBrowserSSO=g,exports.loginByPassword=L,exports.loginByRuntimeSession=m,exports.logout=H,exports.openExternalUrl=f,exports.removeEvent=u,exports.resolve_did=y,exports.setAppSetting=K,exports.subscribeKEvent=l,exports.walletSignWithActiveDid=W;
2
2
  //# sourceMappingURL=browser.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"browser.cjs","sources":["../src/browser.ts"],"sourcesContent":["import { createSDKModule } from './sdk_core'\nimport { hashPassword } from './account'\n\nconst sdkModule = createSDKModule('browser')\n\nexport const buckyos = sdkModule.buckyos\nexport const initBuckyOS = sdkModule.initBuckyOS\nexport const getBuckyOSConfig = sdkModule.getBuckyOSConfig\nexport const getRuntimeType = sdkModule.getRuntimeType\nexport const getAppId = sdkModule.getAppId\nexport const getAppDid = sdkModule.getAppDid\nexport const getAppInstanceId = sdkModule.getAppInstanceId\nexport const getAppDataDir = sdkModule.getAppDataDir\nexport const getKEventClient = sdkModule.getKEventClient\nexport const createEventReader = sdkModule.createEventReader\nexport const create_event_reader = sdkModule.create_event_reader\nexport const subscribeKEvent = sdkModule.subscribeKEvent\nexport const attachEvent = sdkModule.attachEvent\nexport const removeEvent = sdkModule.removeEvent\nexport const getAccountInfo = sdkModule.getAccountInfo\nexport const getCurrentIdentity = sdkModule.getCurrentIdentity\nexport const loginByPassword = sdkModule.loginByPassword\nexport const loginByBrowserSSO = sdkModule.loginByBrowserSSO\nexport const loginByRuntimeSession = sdkModule.loginByRuntimeSession\nexport const login = sdkModule.login\nexport const logout = sdkModule.logout\nexport const getAppSetting = sdkModule.getAppSetting\nexport const setAppSetting = sdkModule.setAppSetting\nexport const getCurrentWalletUser = sdkModule.getCurrentWalletUser\nexport const resolve_did = sdkModule.resolve_did\nexport const walletSignWithActiveDid = sdkModule.walletSignWithActiveDid\nexport const openExternalUrl = sdkModule.openExternalUrl\nexport const getZoneHostName = sdkModule.getZoneHostName\nexport const getZoneServiceURL = sdkModule.getZoneServiceURL\nexport const getServiceRpcClient = sdkModule.getServiceRpcClient\nexport const getVerifyHubClient = sdkModule.getVerifyHubClient\nexport const getSystemConfigClient = sdkModule.getSystemConfigClient\nexport const getTaskManagerClient = sdkModule.getTaskManagerClient\nexport const getWorkflowClient = sdkModule.getWorkflowClient\n\nexport { hashPassword }\nexport * from './sdk_core'\nexport * from './types'\nexport * from './app_identity'\nexport * as namelib from './namelib'\nexport * as bns from './bns_client'\nexport * from './bns_evm_tx'\nexport * from './bns_tx_executor'\nexport * as sn from './sn_client'\nexport * as ndn from './ndn'\nexport * as ndm from './ndm_client'\nexport { ensureObjId, type EnsureObjIdOptions } from './content_objid'\nexport * as ndm_proxy from './ndm_proxy'\nexport * as bucket from './bucket_client'\nexport * as objectUrl from './object_url'\n\nexport * from './executor_client'\nexport * from './aiworkspace_client'\nexport * from './aiws_rrule'\nexport * from './aiws_schedule'\nexport * from './aiws_write'\nexport * from './aiws_bind'\nexport { DIDObjectClient, DIDObjectError } from './did_object_client'\nexport type { DIDObjectCard, DIDObjectClientOptions } from './did_object_client'\n"],"names":["sdkModule","createSDKModule","buckyos","initBuckyOS","getBuckyOSConfig","getRuntimeType","getAppId","getAppDid","getAppInstanceId","getAppDataDir","getKEventClient","createEventReader","create_event_reader","subscribeKEvent","attachEvent","removeEvent","getAccountInfo","getCurrentIdentity","loginByPassword","loginByBrowserSSO","loginByRuntimeSession","login","logout","getAppSetting","setAppSetting","getCurrentWalletUser","resolve_did","walletSignWithActiveDid","openExternalUrl","getZoneHostName","getZoneServiceURL","getServiceRpcClient","getVerifyHubClient","getSystemConfigClient","getTaskManagerClient","getWorkflowClient"],"mappings":"2cAGA,MAAMA,EAAYC,EAAAA,gBAAgB,WAErBC,EAAUF,EAAUE,QACpBC,EAAcH,EAAUG,YACxBC,EAAmBJ,EAAUI,iBAC7BC,EAAiBL,EAAUK,eAC3BC,EAAWN,EAAUM,SACrBC,EAAYP,EAAUO,UACtBC,EAAmBR,EAAUQ,iBAC7BC,EAAgBT,EAAUS,cAC1BC,EAAkBV,EAAUU,gBAC5BC,EAAoBX,EAAUW,kBAC9BC,EAAsBZ,EAAUY,oBAChCC,EAAkBb,EAAUa,gBAC5BC,EAAcd,EAAUc,YACxBC,EAAcf,EAAUe,YACxBC,EAAiBhB,EAAUgB,eAC3BC,EAAqBjB,EAAUiB,mBAC/BC,EAAkBlB,EAAUkB,gBAC5BC,EAAoBnB,EAAUmB,kBAC9BC,EAAwBpB,EAAUoB,sBAClCC,EAAQrB,EAAUqB,MAClBC,EAAStB,EAAUsB,OACnBC,EAAgBvB,EAAUuB,cAC1BC,EAAgBxB,EAAUwB,cAC1BC,EAAuBzB,EAAUyB,qBACjCC,EAAc1B,EAAU0B,YACxBC,EAA0B3B,EAAU2B,wBACpCC,EAAkB5B,EAAU4B,gBAC5BC,EAAkB7B,EAAU6B,gBAC5BC,EAAoB9B,EAAU8B,kBAC9BC,EAAsB/B,EAAU+B,oBAChCC,EAAqBhC,EAAUgC,mBAC/BC,EAAwBjC,EAAUiC,sBAClCC,EAAuBlC,EAAUkC,qBACjCC,EAAoBnC,EAAUmC"}
1
+ {"version":3,"file":"browser.cjs","sources":["../src/browser.ts"],"sourcesContent":["import { createSDKModule } from './sdk_core'\nimport { hashPassword } from './account'\n\nconst sdkModule = createSDKModule('browser')\n\nexport const buckyos = sdkModule.buckyos\nexport const initBuckyOS = sdkModule.initBuckyOS\nexport const getBuckyOSConfig = sdkModule.getBuckyOSConfig\nexport const getRuntimeType = sdkModule.getRuntimeType\nexport const getAppId = sdkModule.getAppId\nexport const getAppDid = sdkModule.getAppDid\nexport const getAppInstanceId = sdkModule.getAppInstanceId\nexport const getAppDataDir = sdkModule.getAppDataDir\nexport const getKEventClient = sdkModule.getKEventClient\nexport const createEventReader = sdkModule.createEventReader\nexport const create_event_reader = sdkModule.create_event_reader\nexport const subscribeKEvent = sdkModule.subscribeKEvent\nexport const attachEvent = sdkModule.attachEvent\nexport const removeEvent = sdkModule.removeEvent\nexport const getAccountInfo = sdkModule.getAccountInfo\nexport const getCurrentIdentity = sdkModule.getCurrentIdentity\nexport const loginByPassword = sdkModule.loginByPassword\nexport const loginByBrowserSSO = sdkModule.loginByBrowserSSO\nexport const loginByRuntimeSession = sdkModule.loginByRuntimeSession\nexport const login = sdkModule.login\nexport const logout = sdkModule.logout\nexport const getAppSetting = sdkModule.getAppSetting\nexport const setAppSetting = sdkModule.setAppSetting\nexport const getCurrentWalletUser = sdkModule.getCurrentWalletUser\nexport const resolve_did = sdkModule.resolve_did\nexport const walletSignWithActiveDid = sdkModule.walletSignWithActiveDid\nexport const openExternalUrl = sdkModule.openExternalUrl\nexport const getZoneHostName = sdkModule.getZoneHostName\nexport const getZoneServiceURL = sdkModule.getZoneServiceURL\nexport const getServiceRpcClient = sdkModule.getServiceRpcClient\nexport const getVerifyHubClient = sdkModule.getVerifyHubClient\nexport const getSystemConfigClient = sdkModule.getSystemConfigClient\nexport const getTaskManagerClient = sdkModule.getTaskManagerClient\nexport const getWorkflowClient = sdkModule.getWorkflowClient\n\nexport { hashPassword }\nexport * from './sdk_core'\nexport * from './types'\nexport * from './app_identity'\nexport * as namelib from './namelib'\nexport * as bns from './bns_client'\nexport * from './bns_evm_tx'\nexport * from './bns_tx_executor'\nexport * as sn from './sn_client'\nexport * as ndn from './ndn'\nexport * as ndm from './ndm_client'\nexport { ensureObjId, type EnsureObjIdOptions } from './content_objid'\nexport * as ndm_proxy from './ndm_proxy'\nexport * from './open_app'\nexport * from './runtime_env'\nexport * from './audio'\nexport { createZoneClients, type ZoneClients, type ZoneClientsOptions } from './zone_clients'\nexport * as bucket from './bucket_client'\nexport * as objectUrl from './object_url'\n\nexport * from './executor_client'\nexport * from './aiworkspace_client'\nexport * from './aiws_rrule'\nexport * from './aiws_schedule'\nexport * from './aiws_write'\nexport * from './aiws_bind'\nexport { DIDObjectClient, DIDObjectError } from './did_object_client'\nexport type { DIDObjectCard, DIDObjectClientOptions } from './did_object_client'\n"],"names":["sdkModule","createSDKModule","buckyos","initBuckyOS","getBuckyOSConfig","getRuntimeType","getAppId","getAppDid","getAppInstanceId","getAppDataDir","getKEventClient","createEventReader","create_event_reader","subscribeKEvent","attachEvent","removeEvent","getAccountInfo","getCurrentIdentity","loginByPassword","loginByBrowserSSO","loginByRuntimeSession","login","logout","getAppSetting","setAppSetting","getCurrentWalletUser","resolve_did","walletSignWithActiveDid","openExternalUrl","getZoneHostName","getZoneServiceURL","getServiceRpcClient","getVerifyHubClient","getSystemConfigClient","getTaskManagerClient","getWorkflowClient"],"mappings":"weAGA,MAAMA,EAAYC,EAAAA,gBAAgB,WAErBC,EAAUF,EAAUE,QACpBC,EAAcH,EAAUG,YACxBC,EAAmBJ,EAAUI,iBAC7BC,EAAiBL,EAAUK,eAC3BC,EAAWN,EAAUM,SACrBC,EAAYP,EAAUO,UACtBC,EAAmBR,EAAUQ,iBAC7BC,EAAgBT,EAAUS,cAC1BC,EAAkBV,EAAUU,gBAC5BC,EAAoBX,EAAUW,kBAC9BC,EAAsBZ,EAAUY,oBAChCC,EAAkBb,EAAUa,gBAC5BC,EAAcd,EAAUc,YACxBC,EAAcf,EAAUe,YACxBC,EAAiBhB,EAAUgB,eAC3BC,EAAqBjB,EAAUiB,mBAC/BC,EAAkBlB,EAAUkB,gBAC5BC,EAAoBnB,EAAUmB,kBAC9BC,EAAwBpB,EAAUoB,sBAClCC,EAAQrB,EAAUqB,MAClBC,EAAStB,EAAUsB,OACnBC,EAAgBvB,EAAUuB,cAC1BC,EAAgBxB,EAAUwB,cAC1BC,EAAuBzB,EAAUyB,qBACjCC,EAAc1B,EAAU0B,YACxBC,EAA0B3B,EAAU2B,wBACpCC,EAAkB5B,EAAU4B,gBAC5BC,EAAkB7B,EAAU6B,gBAC5BC,EAAoB9B,EAAU8B,kBAC9BC,EAAsB/B,EAAU+B,oBAChCC,EAAqBhC,EAAUgC,mBAC/BC,EAAwBjC,EAAUiC,sBAClCC,EAAuBlC,EAAUkC,qBACjCC,EAAoBnC,EAAUmC"}
package/dist/browser.d.ts CHANGED
@@ -1,6 +1,7 @@
1
1
  import { hashPassword } from './account';
2
2
  export declare const buckyos: {
3
3
  hashPassword: typeof hashPassword;
4
+ getRuntimeEnvironment: typeof import("./runtime_env").getRuntimeEnvironment;
4
5
  initBuckyOS: (appid?: string, config?: import("./runtime").BuckyOSConfig | null) => Promise<void>;
5
6
  getBuckyOSConfig: () => import("./runtime").BuckyOSConfig | null;
6
7
  getRuntimeType: () => import("./runtime").RuntimeType;
@@ -89,6 +90,10 @@ export * as ndn from './ndn';
89
90
  export * as ndm from './ndm_client';
90
91
  export { ensureObjId, type EnsureObjIdOptions } from './content_objid';
91
92
  export * as ndm_proxy from './ndm_proxy';
93
+ export * from './open_app';
94
+ export * from './runtime_env';
95
+ export * from './audio';
96
+ export { createZoneClients, type ZoneClients, type ZoneClientsOptions } from './zone_clients';
92
97
  export * as bucket from './bucket_client';
93
98
  export * as objectUrl from './object_url';
94
99
  export * from './executor_client';
@@ -1 +1 @@
1
- {"version":3,"file":"browser.d.ts","sourceRoot":"","sources":["../src/browser.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,MAAM,WAAW,CAAA;AAIxC,eAAO,MAAM,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAAoB,CAAA;AACxC,eAAO,MAAM,WAAW,sFAAwB,CAAA;AAChD,eAAO,MAAM,gBAAgB,gDAA6B,CAAA;AAC1D,eAAO,MAAM,cAAc,uCAA2B,CAAA;AACtD,eAAO,MAAM,QAAQ,qBAAqB,CAAA;AAC1C,eAAO,MAAM,SAAS,qBAAsB,CAAA;AAC5C,eAAO,MAAM,gBAAgB,qBAA6B,CAAA;AAC1D,eAAO,MAAM,aAAa,qBAA0B,CAAA;AACpD,eAAO,MAAM,eAAe,8CAA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