buckyos 0.7.159 → 0.7.162

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.
@@ -0,0 +1 @@
1
+ {"version":3,"file":"aiws_ext.mjs","sources":["../src/aiws_ext.ts"],"sourcesContent":["/**\n * AI Workspace extension controls (buckyos src/frame/aiworkspace/README.md “Extension controls”), shared by the\n * Desktop and the CLI: a control's source lives in a home folder of the Zone file service (files may sit in\n * sub-folders: their names are relative paths, Q23); `build` lists it over NFSP and hands each file's object to\n * `ext.build`, `pull` writes a Workspace snapshot back, `watch` rebuilds on change; bundles (the AIWS manifest plus\n * `controls/<dir>/<path>` and Workspace templates under `templates/<id>/`) are what exports, packages and the library\n * carry.\n * Runs in browsers and Deno (fetch, crypto.subtle); no dependencies.\n */\nimport type { AiWorkspaceClient, AiwsMigration, AiwsTemplateItem } from './aiworkspace_client'\nimport type { NfspClient, WireRef } from './nfsp'\n\n/** The two service calls these drivers make (an `AiWorkspaceClient`, or a host's own session with the same shape). */\nexport type AiwsExtRpc = Pick<AiWorkspaceClient, 'extBuild' | 'extExport'>\n\n/** Puts bytes into the Zone's named store as a FileObject the caller may read and answers its `cyfile:` id (the\n * Desktop's asset upload, the CLI's NDM upload): what a build sends by reference when inline bytes would exceed the\n * service's limit (Q22). */\nexport type AiwsUploader = (name: string, bytes: Uint8Array) => Promise<string>\n\nexport const AIWS_COMPONENT_FILE = 'component.json'\n/** The entry of a composite control (P1). */\nexport const AIWS_COMPOSITION_FILE = 'composition.json'\nexport const AIWS_MANIFEST_FILE = 'aiws-manifest.json'\n/** A client's own record of the base it last built or pulled (never part of the source snapshot: dot files are not). */\nexport const AIWS_BUILD_STATE_FILE = '.aiws-build.json'\n/** The newest component.json / AIWS manifest version this module reads (older ones stay readable, Q19). Version 2\n * adds `kind: composite` and non-empty `deps`; version 3 `events`, the declarative `button`, composite `events` and\n * Workspace templates. */\nexport const AIWS_MANIFEST_VERSION = 3\n/** The newest HTML Block host API (`window.aiws` v3: `emit`, `createBlock { parent, slot }`, `context.interactive`;\n * hosts run 2 and 3) and the declarative interpreter version. */\nexport const AIWS_HTML_API_VERSION = 3\nexport const AIWS_DECLARATIVE_API_VERSION = 1\n/** The `format` of a Workspace template's `snapshot.json` (Q32). */\nexport const AIWS_TEMPLATE_FORMAT = 'aiws-template/1'\nexport const AIWS_MAX_SOURCE_FILES = 64\n\n/**\n * One file of a source folder. `obj_id` is set when the file service holds it as a named-store FileObject (`cyfile:`):\n * the service then reads it by reference. Files of a native home folder have none (their `obj_id`, when the file\n * service reports one, is a `sha256:` content hash the service cannot fetch): their bytes travel with the build.\n */\nexport interface AiwsSourceFile { name: string; obj_id?: string; node_id?: string; etag?: string; size?: number }\nexport interface AiwsDiagnostic {\n file: string\n line?: number\n col?: number\n severity: 'error' | 'warning'\n message: string\n /** `DEP_MISSING`: a `deps` entry or a slot's `cell:<ident>` names no definition of the Workspace; `EVENT_UNDECLARED`:\n * a composite re-raises an event no `cell:<ident>` of that slot declares, or a button emits an undeclared event. */\n code?: string\n /** Blocks whose contract a rebuild would break. */\n instances?: { entity_id: string; title?: string | null }[]\n /** Definitions that build on the one a rebuild would narrow. */\n dependents?: { ident: string; def_entity_id: string }[]\n}\nexport interface AiwsBuildState { workspace_id: string; def_entity_id: string; def_rev: number; dir_rev: number; ident?: string; at?: string }\nexport interface AiwsManifestControl { ident: string; name: string; kind: string; version: number; digest: string; dir: string; title?: string; description?: string; catalog?: Record<string, unknown>; deps?: string[] }\nexport interface AiwsManifest { manifest_version: number; purpose: 'aiws'; host_api?: Record<string, number>; controls: AiwsManifestControl[]; workspace_templates: AiwsTemplateItem[] }\nexport interface AiwsBundle { manifest: AiwsManifest; files: Map<string, Uint8Array> }\n\n/** A source directory that cannot be built as it is (not a service refusal: `diagnostics` say why). */\nexport class AiwsSourceError extends Error {\n readonly diagnostics: AiwsDiagnostic[]\n constructor(diagnostics: AiwsDiagnostic[]) {\n super(diagnostics.filter((d) => d.severity === 'error').map((d) => `${d.file ? `${d.file}: ` : ''}${d.message}`).join('; ') || 'invalid control source')\n this.name = 'AiwsSourceError'\n this.diagnostics = diagnostics\n }\n}\n\nconst encoder = new TextEncoder()\nconst decoder = new TextDecoder()\n\nexport function joinPath(dir: string, name: string): string {\n return `${dir.replace(/\\/+$/, '')}/${name}`\n}\n\n/** A Workspace title as one folder name (no `/`, no leading dot). */\nexport function folderName(title: string): string {\n const cleaned = title.replace(/[/\\\\\\u0000-\\u001f]/g, ' ').replace(/^\\.+/, '').trim()\n return cleaned.slice(0, 80) || 'Workspace'\n}\n\n/** The suggested home folder of a control (README: a suggestion; the definition never stores it). */\nexport function homeControlDir(owner: string, workspaceTitle: string, name: string): string {\n return `/home/${owner}/AI Workspace/${folderName(workspaceTitle)}/controls/${name}`\n}\n\n/** Where a client writes an export bundle before packing it. */\nexport function homeExportDir(owner: string, pkg: string): string {\n return `/home/${owner}/AI Workspace/exports/${pkg}`\n}\n\n/** `user_state` key under which each person remembers the home folder of a definition. */\nexport function sourceStateKey(defEntityId: string): string {\n return `aiws:src:${defEntityId}`\n}\n\n// ---- digests (same canonical forms as the service: store/src/ext.rs)\n\nasync function sha256Hex(bytes: Uint8Array): Promise<string> {\n const digest = await crypto.subtle.digest('SHA-256', bytes as unknown as ArrayBuffer)\n return Array.from(new Uint8Array(digest), (b) => b.toString(16).padStart(2, '0')).join('')\n}\n\n/** `sha256:` over `[[name, sha256 hex of its bytes], …]` sorted by name: a control's content digest. */\nexport async function aiwsContentDigest(files: Iterable<[string, Uint8Array]>): Promise<string> {\n const pairs: [string, string][] = []\n for (const [name, bytes] of files) pairs.push([name, await sha256Hex(bytes)])\n pairs.sort((a, b) => (a[0] < b[0] ? -1 : a[0] > b[0] ? 1 : 0))\n return `sha256:${await sha256Hex(encoder.encode(JSON.stringify(pairs)))}`\n}\n\n/** What a set of sources is, for \"nothing changed since the last build\" (names, objects or versions). */\nexport function sourcesKey(files: AiwsSourceFile[]): string {\n return JSON.stringify([...files].sort((a, b) => a.name.localeCompare(b.name)).map((f) => [f.name, f.obj_id ?? f.etag ?? '']))\n}\n\n/** Bytes a single build may carry inline (the service's limit). */\nexport const AIWS_MAX_INLINE_BYTES = 4 * 1024 * 1024\n\nfunction base64(bytes: Uint8Array): string {\n let binary = ''\n for (let i = 0; i < bytes.length; i += 0x8000) binary += String.fromCharCode(...bytes.subarray(i, i + 0x8000))\n return btoa(binary)\n}\n\nexport type AiwsBuildFile = { name: string; obj_id: string } | { name: string; base64: string }\n\n/**\n * The `files` of `ext.build` from bytes the client holds: inline while the total stays within the service's limit;\n * beyond it, the largest files go to the named store through `upload` and are sent by reference (Q22) — without an\n * uploader the build is refused. `byRef` are files already held as FileObjects.\n */\nexport async function packBuildFiles(files: { name: string; bytes: Uint8Array }[], upload?: AiwsUploader, byRef: { name: string; obj_id: string }[] = []): Promise<AiwsBuildFile[]> {\n let total = files.reduce((n, f) => n + f.bytes.length, 0)\n const uploaded = new Map<string, string>()\n if (total > AIWS_MAX_INLINE_BYTES) {\n if (!upload) throw new AiwsSourceError([{ file: '', severity: 'error', message: `a control's inline files are limited to ${AIWS_MAX_INLINE_BYTES} bytes per build` }])\n for (const f of [...files].sort((a, b) => b.bytes.length - a.bytes.length)) {\n if (total <= AIWS_MAX_INLINE_BYTES) break\n uploaded.set(f.name, await upload(f.name, f.bytes))\n total -= f.bytes.length\n }\n }\n const out: AiwsBuildFile[] = [...byRef]\n for (const f of files) {\n const obj = uploaded.get(f.name)\n out.push(obj ? { name: f.name, obj_id: obj } : { name: f.name, base64: base64(f.bytes) })\n }\n return out.sort((a, b) => (a.name < b.name ? -1 : a.name > b.name ? 1 : 0))\n}\n\n/** The `files` of `ext.build`: FileObjects by reference, everything else read over the file service and sent inline\n * (or, past the inline limit, uploaded through `upload`). */\nexport async function buildFiles(nfsp: NfspClient, files: AiwsSourceFile[], upload?: AiwsUploader): Promise<AiwsBuildFile[]> {\n const byRef: { name: string; obj_id: string }[] = []\n const inline: { name: string; bytes: Uint8Array }[] = []\n for (const f of files) {\n if (f.obj_id?.startsWith('cyfile:')) { byRef.push({ name: f.name, obj_id: f.obj_id }); continue }\n if (!f.node_id) throw new AiwsSourceError([{ file: f.name, severity: 'error', message: 'the file service did not name this file' }])\n inline.push({ name: f.name, bytes: new Uint8Array(await (await nfsp.readFile(f.node_id)).arrayBuffer()) })\n }\n return packBuildFiles(inline, upload, byRef)\n}\n\n// ---- component.json pre-check (the service's composer is authoritative; this catches the usual mistakes early)\n\nconst COMPONENT_KEYS = ['manifest_version', 'ident', 'kind', 'title', 'description', 'host_api', 'accepts', 'allow_no_source', 'default_size', 'config_schema', 'bindings', 'entry', 'assets', 'catalog', 'agent', 'deps', 'events']\nconst SCHEMA_KEYWORDS = ['type', 'enum', 'default', 'required', 'title', 'description', 'minimum', 'maximum', 'minLength', 'maxLength', 'properties', 'items']\nconst NAME = /^[a-z0-9][a-z0-9._-]{0,63}$/\nconst DID = /^did:[a-z0-9]+:[^/#\\s]+$/\nconst BINDING = /^[a-z][a-z0-9_]{0,31}$/\nconst IDENT = /^did:[a-z0-9]+:[^/#\\s]+#[a-z0-9][a-z0-9._-]{0,63}$/\nconst V2_HINT = 'needs manifest_version 2 (raise it in component.json)'\nconst V3_HINT = 'needs manifest_version 3 (raise it in component.json)'\nconst EVENT_PARAM_TYPES = ['string', 'number', 'boolean', 'object', 'entity']\nconst ITEM_KINDS = ['text', 'value', 'metric', 'bar', 'list', 'badge']\nconst ITEM_KEYS = ['kind', 'text', 'label', 'bind', 'by', 'format', 'limit']\nconst ACTION_COMMANDS = ['open_source', 'activate_editor', 'open_definition']\nconst INSPECTOR_KINDS = ['text', 'number', 'select', 'boolean', 'color']\n\n/** What another control declares (the `events` names of its component.json), `undefined` when it is not at hand:\n * whether a composite's slot children raise an event can be judged only then (otherwise the build judges it). */\nexport type AiwsCellEvents = (ident: string) => string[] | undefined\n\nfunction isRecord(v: unknown): v is Record<string, unknown> {\n return !!v && typeof v === 'object' && !Array.isArray(v)\n}\n\n/** A file name of a source folder: a relative path whose parts are non-empty and do not start with `.` (Q23). */\nexport function isSourcePath(name: string): boolean {\n return name.length > 0 && encoder.encode(name).length <= 255 && !name.includes('\\0') && name.split('/').every((seg) => seg.length > 0 && !seg.startsWith('.'))\n}\n\nfunction configProps(configSchema: unknown): Record<string, unknown> {\n const props = isRecord(configSchema) ? configSchema.properties : undefined\n return isRecord(props) ? props : {}\n}\n\n/** `{{config.<key>}}` placeholders of a string: each names a property of `config_schema`. */\nfunction configPlaceholders(text: string, at: string, props: Record<string, unknown>, error: (message: string) => void): void {\n for (const m of text.matchAll(/\\{\\{([^}]*)\\}\\}/g)) {\n const inner = m[1].trim()\n if (!inner.startsWith('config.')) error(`${at}: only {{config.<key>}} may be used here`)\n else if (!(inner.slice(7) in props)) error(`${at}: {{${inner}}} names no property of config_schema`)\n }\n}\n\n/** A render control's `events` (Q26): ≤ 16 names `[a-z][a-z0-9_]{0,31}`, each `{ title?, description?, params? }` with\n * ≤ 16 params `{ type: string | number | boolean | object | entity, required?, description? }`. */\nfunction eventProblems(v: unknown, out: string[]): void {\n if (!isRecord(v)) { out.push('events must be an object { <name>: { title?, description?, params? } }'); return }\n if (Object.keys(v).length > 16) out.push('events: at most 16')\n for (const [name, raw] of Object.entries(v)) {\n const at = `events.${name}`\n if (!BINDING.test(name)) out.push(`${at}: an event name is [a-z][a-z0-9_]{0,31}`)\n if (!isRecord(raw)) { out.push(`${at} must be an object { title?, description?, params? }`); continue }\n for (const [k, x] of Object.entries(raw)) {\n if (k === 'title') { if (typeof x !== 'string' || x.length > 256) out.push(`${at}.title: at most 256 characters`) }\n else if (k === 'description') { if (typeof x !== 'string' || x.length > 4000) out.push(`${at}.description: at most 4000 characters`) }\n else if (k !== 'params') out.push(`${at}: unknown key ${k} (title, description, params)`)\n }\n if (raw.params === undefined) continue\n if (!isRecord(raw.params)) { out.push(`${at}.params must be an object { <param>: { type, required?, description? } }`); continue }\n if (Object.keys(raw.params).length > 16) out.push(`${at}.params: at most 16`)\n for (const [p, spec] of Object.entries(raw.params)) {\n const pat = `${at}.params.${p}`\n if (!BINDING.test(p)) out.push(`${pat}: a param name is [a-z][a-z0-9_]{0,31}`)\n if (!isRecord(spec)) { out.push(`${pat} must be an object { type, required?, description? }`); continue }\n for (const [k, x] of Object.entries(spec)) {\n if (k === 'type') { if (typeof x !== 'string' || !EVENT_PARAM_TYPES.includes(x)) out.push(`${pat}.type: ${EVENT_PARAM_TYPES.join(', ')}`) }\n else if (k === 'required') { if (typeof x !== 'boolean') out.push(`${pat}.required must be a boolean`) }\n else if (k === 'description') { if (typeof x !== 'string' || x.length > 1000) out.push(`${pat}.description: at most 1000 characters`) }\n else out.push(`${pat}: unknown key ${k} (type, required, description)`)\n }\n if (spec.type === undefined) out.push(`${pat}.type required`)\n }\n }\n}\n\nfunction schemaProblems(v: unknown, path: string, out: string[]): void {\n if (!v || typeof v !== 'object' || Array.isArray(v)) { out.push(`${path}: a schema is an object`); return }\n for (const [k, x] of Object.entries(v as Record<string, unknown>)) {\n if (!SCHEMA_KEYWORDS.includes(k)) { out.push(`${path}/${k}: keyword ${k} is outside the supported subset`); continue }\n if (k === 'properties' && x && typeof x === 'object') for (const [n, s] of Object.entries(x as Record<string, unknown>)) schemaProblems(s, `${path}/properties/${n}`, out)\n if (k === 'items') schemaProblems(x, `${path}/items`, out)\n }\n}\n\n/**\n * Check a declarative control's entry file the way `ext.build` does (store/src/ext.rs `check_declarative`): what the\n * interpreter draws (`layout`, `items` / `view.items`, `accent`, `actions`, `inspector`) and, with manifest_version 3,\n * the item `{ kind: \"button\", label, emit, params? }` raising an event of `events` (`EVENT_UNDECLARED` otherwise;\n * strings in `params` may hold `{{config.<key>}}`). Without `events` the emitted names are not judged.\n */\nexport function checkDeclarative(text: string, context: { bindings?: unknown; events?: string[]; configSchema?: unknown; manifestVersion?: number } = {}, file = 'declarative.json'): AiwsDiagnostic[] {\n const out: AiwsDiagnostic[] = []\n const error = (message: string, code?: string) => out.push({ file, severity: 'error', message, ...(code ? { code } : {}) })\n const warn = (message: string) => out.push({ file, severity: 'warning', message })\n let o: Record<string, unknown>\n try {\n const parsed = JSON.parse(text) as unknown\n if (!isRecord(parsed)) { error('a declarative definition is a JSON object'); return out }\n o = parsed\n } catch (e) {\n error(e instanceof Error ? e.message : String(e))\n return out\n }\n const bindings = isRecord(context.bindings) ? context.bindings : {}\n const props = configProps(context.configSchema)\n const strings = (v: unknown, at: string): void => {\n if (typeof v === 'string') configPlaceholders(v, at, props, error)\n else if (Array.isArray(v)) v.forEach((x, i) => strings(x, `${at}[${i}]`))\n else if (isRecord(v)) for (const [k, x] of Object.entries(v)) strings(x, `${at}.${k}`)\n }\n const button = (it: Record<string, unknown>, at: string) => {\n if (context.manifestVersion !== undefined && context.manifestVersion < 3) error(`${at}: a button ${V3_HINT}`)\n for (const k of Object.keys(it)) if (!['kind', 'label', 'emit', 'params'].includes(k)) warn(`${at}: key ${k} is ignored by the interpreter`)\n if (typeof it.label !== 'string' || !it.label) error(`${at}.label: the button's text (required)`)\n if (typeof it.emit !== 'string' || !it.emit) error(`${at}.emit: the event the button raises (required)`)\n else if (context.events && !context.events.includes(it.emit)) error(`${at}.emit ${it.emit}: not an event of component.json`, 'EVENT_UNDECLARED')\n if (it.params !== undefined) { if (isRecord(it.params)) strings(it.params, `${at}.params`); else error(`${at}.params must be an object`) }\n }\n const items = (list: unknown, at: string) => {\n if (list === undefined) return\n if (!Array.isArray(list)) { error(`${at} must be an array`); return }\n list.forEach((it, i) => {\n const iat = `${at}[${i}]`\n if (!isRecord(it)) { error(`${iat} must be an object`); return }\n if (it.kind === 'button') { button(it, iat); return }\n if (typeof it.kind !== 'string' || !ITEM_KINDS.includes(it.kind)) error(`${iat}.kind ${JSON.stringify(it.kind)}: one of ${[...ITEM_KINDS, 'button'].join(', ')}`)\n for (const k of Object.keys(it)) if (!ITEM_KEYS.includes(k)) warn(`${iat}: key ${k} is ignored by the interpreter`)\n if (it.format !== undefined && !['text', 'number', 'percent', 'currency'].includes(it.format as string)) error(`${iat}.format ${JSON.stringify(it.format)}: text, number, percent or currency`)\n if (typeof it.bind === 'string' && it.bind.includes('.')) {\n const prefix = it.bind.slice(0, it.bind.indexOf('.'))\n if (prefix !== 'props' && !(prefix in bindings)) warn(`${iat}.bind ${JSON.stringify(it.bind)}: ${prefix} is not a declared binding, so it reads the field ${JSON.stringify(it.bind)} of the main source`)\n }\n })\n }\n for (const [k, v] of Object.entries(o)) {\n if (k === 'layout') { if (v !== 'stack' && v !== 'row') error('layout: stack or row') }\n else if (k === 'items') items(v, 'items')\n else if (k === 'view') items(isRecord(v) ? v.items : undefined, 'view.items')\n else if (k === 'accent') { if (typeof v !== 'string') error('accent must be a colour string') }\n else if (k === 'actions') {\n (Array.isArray(v) ? v : []).forEach((a: unknown, i) => {\n const r = isRecord(a) ? a : {}\n if (typeof r.command !== 'string' || !ACTION_COMMANDS.includes(r.command)) error(`actions[${i}].command: one of ${ACTION_COMMANDS.join(', ')}`)\n if (typeof r.id !== 'string' || typeof r.label !== 'string') error(`actions[${i}] needs id and label`)\n })\n } else if (k === 'inspector') {\n (Array.isArray(v) ? v : []).forEach((f: unknown, i) => {\n const r = isRecord(f) ? f : {}\n if (typeof r.kind !== 'string' || !INSPECTOR_KINDS.includes(r.kind)) error(`inspector[${i}].kind: one of ${INSPECTOR_KINDS.join(', ')}`)\n if (typeof r.key !== 'string' || typeof r.label !== 'string') error(`inspector[${i}] needs key and label`)\n })\n } else warn(`key ${k} is not part of the declarative vocabulary`)\n }\n if (o.items === undefined && o.view === undefined) warn('no items: the control draws nothing')\n return out\n}\n\n/** A composite's `composition.json` (K3): what the slots accept and their counts, the layout, the Chrome and the\n * events it re-raises from its children (P2). */\nexport interface AiwsComposition {\n layout: { algorithm: 'stack' | 'fixed' | 'grid'; direction?: 'column' | 'row'; spacing?: number | string; padding?: number | string | { t?: number; r?: number; b?: number; l?: number }; columns?: number; gap?: number | string }\n slots: Record<string, { accepts?: string[]; min?: number; max?: number; placement?: 'stack' | 'top' | 'bottom' | 'free'; title?: string }>\n chrome?: { background?: string; radius?: number | string; border?: string; title?: { text: string; slot?: string }; empty?: string }\n events?: Record<string, { from: { slot: string; event: string }; title?: string; description?: string }>\n}\n\n/**\n * Check a `composition.json` the way `ext.build` does (store/src/ext.rs `check_composition`): `layout` is `stack`,\n * `fixed` or `grid` (`columns` 1…12, `gap`; a grid fills its cells with the slots' children in slot order, so its slots\n * take placement `stack` only), at most 16 slots named `[a-z][a-z0-9_]{0,31}` accepting `cell:<ident>`, a view type or\n * `container`, the Chrome's strings, `{{config.<key>}}` naming properties of `config_schema`, and `events`\n * (manifest_version 3) re-raising an event of a slot's children: `EVENT_UNDECLARED` when no `cell:<ident>` of that slot\n * declares it, judged as far as `cellEvents` knows those controls.\n */\nexport function checkComposition(text: string, configSchema?: unknown, file = AIWS_COMPOSITION_FILE, context: { manifestVersion?: number; cellEvents?: AiwsCellEvents } = {}): AiwsDiagnostic[] {\n const out: AiwsDiagnostic[] = []\n const error = (message: string, code?: string) => out.push({ file, severity: 'error', message, ...(code ? { code } : {}) })\n let o: Record<string, unknown>\n try {\n const parsed = JSON.parse(text) as unknown\n if (!parsed || typeof parsed !== 'object' || Array.isArray(parsed)) { error('a composition is a JSON object { layout, slots, chrome?, events? }'); return out }\n o = parsed as Record<string, unknown>\n } catch (e) {\n error(e instanceof Error ? e.message : String(e))\n return out\n }\n const props = configProps(configSchema)\n const placeholders = (t: string, at: string) => configPlaceholders(t, at, props, error)\n const dimension = (v: unknown, at: string, max: number) => {\n if (typeof v === 'number' && v >= 0 && v <= max) return\n if (typeof v === 'string' && /^\\s*\\{\\{.*\\}\\}\\s*$/.test(v)) { placeholders(v, at); return }\n error(`${at}: a number in [0, ${max}] or {{config.<key>}}`)\n }\n for (const k of Object.keys(o)) {\n if (!['layout', 'slots', 'chrome', 'events'].includes(k)) error(`unknown key ${k} (a composition says layout, slots, chrome and events)`)\n }\n const layout = o.layout as Record<string, unknown> | undefined\n let algorithm = 'stack'\n if (!layout || typeof layout !== 'object') error('layout { algorithm: stack | fixed | grid } required')\n else {\n if (layout.algorithm === 'stack' || layout.algorithm === 'fixed' || layout.algorithm === 'grid') algorithm = layout.algorithm\n else error(`layout.algorithm ${JSON.stringify(layout.algorithm)}: stack, fixed or grid (the algorithms the host ships)`)\n for (const [k, v] of Object.entries(layout)) {\n if (k === 'algorithm') continue\n if ((k === 'direction' || k === 'spacing') && algorithm !== 'stack') { error(`layout.${k} belongs to the stack layout`); continue }\n if ((k === 'columns' || k === 'gap') && algorithm !== 'grid') { error(`layout.${k} belongs to the grid layout`); continue }\n if (k === 'direction') { if (v !== 'column' && v !== 'row') error('layout.direction: column or row') }\n else if (k === 'spacing') dimension(v, 'layout.spacing', 2000)\n else if (k === 'columns') { if (!Number.isInteger(v) || (v as number) < 1 || (v as number) > 12) error('layout.columns: an integer in [1, 12]') }\n else if (k === 'gap') dimension(v, 'layout.gap', 2000)\n else if (k === 'padding') {\n if (v && typeof v === 'object' && !Array.isArray(v)) for (const [side, n] of Object.entries(v)) { if (!['t', 'r', 'b', 'l'].includes(side)) error(`layout.padding.${side}: t, r, b or l`); dimension(n, `layout.padding.${side}`, 2000) }\n else dimension(v, 'layout.padding', 2000)\n } else error(`layout: unknown key ${k}`)\n }\n if (algorithm === 'grid' && layout.columns === undefined) error('layout.columns (1…12) required: the cells of a grid row')\n }\n const slots = (o.slots && typeof o.slots === 'object' && !Array.isArray(o.slots) ? o.slots : null) as Record<string, unknown> | null\n if (!slots) error('slots { <name>: { accepts?, min?, max?, placement? } } required')\n else {\n if (Object.keys(slots).length > 16) error('at most 16 slots')\n for (const [name, raw] of Object.entries(slots)) {\n const at = `slots.${name}`\n if (!BINDING.test(name)) error(`${at}: a slot name is [a-z][a-z0-9_]{0,31}`)\n if (!raw || typeof raw !== 'object' || Array.isArray(raw)) { error(`${at} must be an object`); continue }\n const slot = raw as Record<string, unknown>\n for (const [k, v] of Object.entries(slot)) {\n if (k === 'accepts') {\n if (!Array.isArray(v) || v.length === 0 || v.length > 32) { error(`${at}.accepts: 1…32 entries (cell:<ident>, a view type, container)`); continue }\n for (const a of v) {\n if (typeof a === 'string' && a.startsWith('cell:')) { if (!IDENT.test(a.slice(5)) || encoder.encode(a.slice(5)).length > 128) error(`${at}.accepts ${JSON.stringify(a)}: cell:<author_did>#<name>`) }\n else if (a !== 'container' && !(typeof a === 'string' && NAME.test(a))) error(`${at}.accepts ${JSON.stringify(a)}: cell:<ident>, a view type or container`)\n }\n } else if (k === 'min') { if (!Number.isInteger(v) || (v as number) < 0 || (v as number) > 64) error(`${at}.min: an integer in [0, 64]`) }\n else if (k === 'max') { if (!Number.isInteger(v) || (v as number) < 1 || (v as number) > 1000) error(`${at}.max: an integer in [1, 1000]`) }\n else if (k === 'placement') {\n if (v !== 'stack' && v !== 'top' && v !== 'bottom' && v !== 'free') error(`${at}.placement: stack, top, bottom or free`)\n else if (algorithm === 'fixed' && v !== 'free') error(`${at}.placement: a fixed layout keeps every child where it is (free)`)\n else if (algorithm === 'grid' && v !== 'stack') error(`${at}.placement: a grid fills its cells with the slots' children in slot order (stack)`)\n } else if (k === 'title') { if (typeof v !== 'string' || v.length > 256) error(`${at}.title: at most 256 characters`) }\n else error(`${at}: unknown key ${k}`)\n }\n if (Number.isInteger(slot.min) && Number.isInteger(slot.max) && (slot.min as number) > (slot.max as number)) error(`${at}: min exceeds max`)\n }\n }\n const chrome = o.chrome\n if (chrome !== undefined) {\n if (!chrome || typeof chrome !== 'object' || Array.isArray(chrome)) error('chrome must be an object')\n else for (const [k, v] of Object.entries(chrome as Record<string, unknown>)) {\n const at = `chrome.${k}`\n if (k === 'background' || k === 'border') { if (typeof v === 'string' && v.length <= 64) placeholders(v, at); else error(`${at}: a colour (≤ 64 characters) or {{config.<key>}}`) }\n else if (k === 'radius') dimension(v, at, 200)\n else if (k === 'empty') { if (typeof v === 'string' && v.length <= 1000) placeholders(v, at); else error(`${at}: a text of at most 1000 characters`) }\n else if (k === 'title') {\n const t = v as Record<string, unknown> | null\n if (!t || typeof t !== 'object' || Array.isArray(t)) { error(`${at}: { text, slot? }`); continue }\n for (const [tk, tv] of Object.entries(t)) {\n if (tk === 'text') { if (typeof tv === 'string' && tv.length <= 256) placeholders(tv, 'chrome.title.text'); else error('chrome.title.text: at most 256 characters') }\n else if (tk === 'slot') { if (typeof tv !== 'string' || !slots || !(tv in slots)) error(`chrome.title.slot ${JSON.stringify(tv)}: a slot of this composition`) }\n else error(`chrome.title: unknown key ${tk}`)\n }\n if (typeof t.text !== 'string') error('chrome.title.text required')\n } else error(`chrome: unknown key ${k} (background, radius, border, title, empty)`)\n }\n }\n if (o.events !== undefined) {\n if (context.manifestVersion !== undefined && context.manifestVersion < 3) error(`events ${V3_HINT}`)\n if (!isRecord(o.events)) error('events must be an object { <name>: { from: { slot, event }, title?, description? } }')\n else {\n if (Object.keys(o.events).length > 16) error('events: at most 16')\n for (const [name, raw] of Object.entries(o.events)) {\n const at = `events.${name}`\n if (!BINDING.test(name)) error(`${at}: an event name is [a-z][a-z0-9_]{0,31}`)\n if (!isRecord(raw)) { error(`${at} must be an object { from: { slot, event }, title?, description? }`); continue }\n for (const [k, v] of Object.entries(raw)) {\n if (k === 'title') { if (typeof v !== 'string' || v.length > 256) error(`${at}.title: at most 256 characters`) }\n else if (k === 'description') { if (typeof v !== 'string' || v.length > 4000) error(`${at}.description: at most 4000 characters`) }\n else if (k !== 'from') error(`${at}: unknown key ${k} (from, title, description)`)\n }\n const from = raw.from\n if (!isRecord(from)) { error(`${at}.from { slot, event } required: the child event it re-raises`); continue }\n for (const k of Object.keys(from)) if (k !== 'slot' && k !== 'event') error(`${at}.from: unknown key ${k} (slot, event)`)\n const event = typeof from.event === 'string' && BINDING.test(from.event) ? from.event : undefined\n if (!event) error(`${at}.from.event: an event name [a-z][a-z0-9_]{0,31}`)\n const slot = typeof from.slot === 'string' && slots ? slots[from.slot] : undefined\n if (!isRecord(slot)) { error(`${at}.from.slot ${JSON.stringify(from.slot)}: a slot of this composition`); continue }\n if (!event) continue\n const cells = (Array.isArray(slot.accepts) ? slot.accepts : []).filter((a): a is string => typeof a === 'string' && a.startsWith('cell:')).map((a) => a.slice(5))\n if (cells.length === 0) { error(`${at}: slot ${from.slot} accepts no cell:<ident>, so no control there declares ${event}`, 'EVENT_UNDECLARED'); continue }\n const declared = cells.map((ident) => context.cellEvents?.(ident))\n if (declared.every((names) => names !== undefined && !names.includes(event))) error(`${at}: no control slot ${from.slot} accepts (${cells.join(', ')}) declares the event ${event}`, 'EVENT_UNDECLARED')\n }\n }\n }\n return out\n}\n\n/**\n * Check a `component.json` text against the files of its directory (and its declarative file or composition when\n * `readText` gives the entry's text; `cellEvents` says what other controls declare, for a composite's re-raised\n * events). Errors make a build fail; warnings do not.\n */\nexport function checkComponent(text: string, fileNames: string[], readText?: (name: string) => string | undefined, cellEvents?: AiwsCellEvents): AiwsDiagnostic[] {\n const out: AiwsDiagnostic[] = []\n const f = AIWS_COMPONENT_FILE\n const error = (message: string) => out.push({ file: f, severity: 'error', message })\n let c: Record<string, unknown>\n try {\n const parsed = JSON.parse(text) as unknown\n if (!parsed || typeof parsed !== 'object' || Array.isArray(parsed)) { error('must be a JSON object'); return out }\n c = parsed as Record<string, unknown>\n } catch (e) {\n error(e instanceof Error ? e.message : String(e))\n return out\n }\n for (const k of Object.keys(c)) if (!COMPONENT_KEYS.includes(k)) error(`unknown key ${k}`)\n const mv = c.manifest_version\n const version = typeof mv === 'number' && Number.isInteger(mv) && mv >= 1 ? mv : 0\n if (!version) error(`manifest_version (1…${AIWS_MANIFEST_VERSION}) required`)\n else if (version > AIWS_MANIFEST_VERSION) error(`manifest_version ${mv} is newer than this client reads (${AIWS_MANIFEST_VERSION})`)\n const before3 = version > 0 && version < 3\n const ident = c.ident as Record<string, unknown> | undefined\n let self = ''\n if (!ident || typeof ident !== 'object') error('ident { author_did, name } required')\n else {\n if (typeof ident.author_did !== 'string' || !DID.test(ident.author_did)) error('ident.author_did must be a DID (did:<method>:<id>)')\n if (typeof ident.name !== 'string' || !NAME.test(ident.name)) error('ident.name must be [a-z0-9][a-z0-9._-]{0,63}')\n if (typeof ident.author_did === 'string' && typeof ident.name === 'string') {\n self = `${ident.author_did}#${ident.name}`\n if (encoder.encode(self).length > 128) error('an identity is at most 128 bytes')\n }\n }\n const composite = c.kind === 'composite'\n if (c.kind !== 'declarative' && c.kind !== 'html' && !composite) error('kind must be declarative, html or composite')\n if (composite && version === 1) error(`kind composite ${V2_HINT}`)\n if (composite) for (const k of ['accepts', 'allow_no_source']) if (c[k] !== undefined) error(`${k}: a composite is a container of Blocks, not a Cell showing data`)\n if (typeof c.title !== 'string' || !c.title || c.title.length > 256) error('title: 1…256 characters')\n if (c.config_schema !== undefined) { const p: string[] = []; schemaProblems(c.config_schema, 'config_schema', p); p.forEach(error) }\n if (c.bindings !== undefined) {\n if (!c.bindings || typeof c.bindings !== 'object') error('bindings must be an object')\n else for (const n of Object.keys(c.bindings as object)) if (!BINDING.test(n) || n === 'props') error(`binding name ${n}: [a-z][a-z0-9_]{0,31}, not props`)\n }\n if (c.deps !== undefined) {\n if (!Array.isArray(c.deps) || c.deps.length > 32) error('deps: at most 32 identities <author_did>#<name>')\n else if (c.deps.length > 0 && version === 1) error(`deps ${V2_HINT}`)\n else {\n const seen = new Set<string>()\n for (const d of c.deps) {\n if (typeof d !== 'string' || !IDENT.test(d)) error(`deps: ${JSON.stringify(d)} is not an identity <author_did>#<name>`)\n else if (d === self) error('deps: a control cannot depend on itself')\n else if (seen.has(d)) error(`deps lists ${d} twice`)\n seen.add(String(d))\n }\n }\n }\n let events: string[] = []\n if (c.events !== undefined) {\n if (composite) error('events: a composite declares its events in composition.json (events.<name>.from re-raises an event of a child)')\n else if (before3) error(`events ${V3_HINT}`)\n else { const p: string[] = []; eventProblems(c.events, p); p.forEach(error) }\n if (!composite && isRecord(c.events)) events = Object.keys(c.events)\n }\n const has = (n: unknown) => typeof n === 'string' && fileNames.includes(n)\n const named = new Set([f])\n if (c.kind === 'html') {\n const e = c.entry as Record<string, unknown> | undefined\n if (!e || typeof e !== 'object' || typeof e.html !== 'string') error('entry must be { html, css?, js? }')\n else for (const [k, n] of Object.entries(e)) { if (!has(n)) error(`entry.${k} ${JSON.stringify(n)} is not in the directory`); else named.add(String(n)) }\n if (c.host_api !== undefined && c.host_api !== 2 && c.host_api !== 3) error('host_api: the HTML Block host speaks API 2 and 3')\n else if (c.host_api === 3 && before3) error(`host_api 3 ${V3_HINT}`)\n if (events.length > 0 && c.host_api !== 3) out.push({ file: f, severity: 'warning', message: 'events: an HTML control raises them with aiws.emit, which is host API 3 (set host_api to 3)' })\n } else if (c.kind === 'declarative' || composite) {\n if (!has(c.entry)) error(`entry ${JSON.stringify(c.entry)} is not in the directory`)\n else {\n named.add(String(c.entry))\n const entryText = readText?.(String(c.entry))\n const manifestVersion = version || undefined\n if (entryText !== undefined && composite) out.push(...checkComposition(entryText, c.config_schema, String(c.entry), { manifestVersion, cellEvents }))\n else if (entryText !== undefined) out.push(...checkDeclarative(entryText, { bindings: c.bindings, events, configSchema: c.config_schema, manifestVersion }, String(c.entry)))\n }\n if (composite && c.host_api !== undefined) error('host_api: a composite runs no code of its own (its layout and chrome are the host\\'s)')\n if (!composite && c.host_api !== undefined && c.host_api !== AIWS_DECLARATIVE_API_VERSION) error(`host_api: the declarative interpreter is version ${AIWS_DECLARATIVE_API_VERSION}`)\n }\n for (const a of Array.isArray(c.assets) ? c.assets : []) { if (!has(a)) error(`asset ${JSON.stringify(a)} is not in the directory`); else named.add(String(a)) }\n if (c.agent !== undefined) { if (!has(c.agent)) error(`agent ${JSON.stringify(c.agent)} is not in the directory`); else named.add(String(c.agent)) }\n for (const n of fileNames) {\n if (!isSourcePath(n)) out.push({ file: n, severity: 'error', message: 'a file of a source directory: a relative path whose parts do not start with \\'.\\'' })\n else if (!named.has(n)) out.push({ file: n, severity: 'warning', message: 'not named by component.json: kept in the source snapshot only' })\n }\n return out\n}\n\n/** The identities a composition's slots accept as `cell:<ident>`. */\nexport function slotCells(composition: AiwsComposition): string[] {\n const out = new Set<string>()\n for (const slot of Object.values(composition.slots ?? {})) for (const a of slot.accepts ?? []) if (a.startsWith('cell:')) out.add(a.slice(5))\n return [...out].sort()\n}\n\n// ---- bundles (exports, the `aiws` sub-package of a PIKG)\n\n/** Read an AIWS manifest of any supported version as the current one (Q19); a newer one is refused. */\nexport function compatManifest(value: unknown): AiwsManifest {\n if (!value || typeof value !== 'object') throw new AiwsSourceError([{ file: AIWS_MANIFEST_FILE, severity: 'error', message: 'must be a JSON object' }])\n const m = value as Record<string, unknown>\n const version = m.manifest_version\n if (typeof version !== 'number' || version < 1) throw new AiwsSourceError([{ file: AIWS_MANIFEST_FILE, severity: 'error', message: 'manifest_version required' }])\n if (version > AIWS_MANIFEST_VERSION) throw new AiwsSourceError([{ file: AIWS_MANIFEST_FILE, severity: 'error', message: `manifest_version ${version} needs a newer client (this one reads ${AIWS_MANIFEST_VERSION})` }])\n if (m.purpose !== 'aiws') throw new AiwsSourceError([{ file: AIWS_MANIFEST_FILE, severity: 'error', message: 'purpose must be aiws' }])\n if (!Array.isArray(m.controls)) throw new AiwsSourceError([{ file: AIWS_MANIFEST_FILE, severity: 'error', message: 'controls must be an array' }])\n return { manifest_version: version, purpose: 'aiws', host_api: (m.host_api as Record<string, number>) ?? {}, controls: m.controls as AiwsManifestControl[], workspace_templates: Array.isArray(m.workspace_templates) ? m.workspace_templates : [] }\n}\n\nconst TEMPLATE_ID = /^[a-z0-9][a-z0-9-]{0,63}$/\n\n/** Where a Workspace template's files sit in a bundle: `templates/<id>/` (`snapshot.json`, `objects/`, `chunks/`). */\nexport function templateDir(id: string): string {\n return `templates/${id}/`\n}\n\n/** The content digest of a Workspace template (its manifest `digest`): the files under `templates/<id>/`, named\n * relative to that folder, digested as a control's. */\nexport async function aiwsTemplateDigest(files: Iterable<[string, Uint8Array]>, id: string): Promise<string> {\n const dir = templateDir(id)\n const own: [string, Uint8Array][] = []\n for (const [path, bytes] of files) if (path.startsWith(dir)) own.push([path.slice(dir.length), bytes])\n return aiwsContentDigest(own)\n}\n\n/** The shape of a `workspace_templates` item (schemas/template.schema.json); `controls` are the manifest's identities. */\nfunction templateProblems(t: unknown, controls: Set<string>): string[] {\n if (!isRecord(t)) return ['a template is an object { id, title, snapshot, digest, requires, description?, params?, reset? }']\n const out: string[] = []\n for (const k of Object.keys(t)) if (!['id', 'title', 'description', 'snapshot', 'digest', 'requires', 'params', 'reset'].includes(k)) out.push(`unknown key ${k}`)\n if (typeof t.id !== 'string' || !TEMPLATE_ID.test(t.id)) out.push('id: [a-z0-9][a-z0-9-]{0,63}')\n else if (t.snapshot !== `${templateDir(t.id)}snapshot.json`) out.push(`snapshot must be ${templateDir(t.id)}snapshot.json`)\n if (typeof t.title !== 'string' || !t.title || t.title.length > 256) out.push('title: 1…256 characters')\n if (t.description !== undefined && (typeof t.description !== 'string' || t.description.length > 4000)) out.push('description: at most 4000 characters')\n if (typeof t.digest !== 'string' || !/^sha256:[0-9a-f]{64}$/.test(t.digest)) out.push('digest: sha256:<64 hex digits>')\n const requires = t.requires\n if (!isRecord(requires)) out.push('requires { host_api?, controls } required')\n else {\n for (const k of Object.keys(requires)) if (k !== 'host_api' && k !== 'controls') out.push(`requires: unknown key ${k}`)\n if (requires.host_api !== undefined) {\n if (!isRecord(requires.host_api)) out.push('requires.host_api must be an object { html?, declarative? }')\n else for (const [k, v] of Object.entries(requires.host_api)) if ((k !== 'html' && k !== 'declarative') || !Number.isInteger(v) || (v as number) < 1) out.push(`requires.host_api.${k}: html or declarative, a positive integer`)\n }\n if (!Array.isArray(requires.controls) || requires.controls.length > 256) out.push('requires.controls: at most 256 identities')\n else {\n const seen = new Set<unknown>()\n for (const ident of requires.controls) {\n if (typeof ident !== 'string' || !controls.has(ident)) out.push(`requires.controls: ${JSON.stringify(ident)} is not a control of this manifest`)\n else if (seen.has(ident)) out.push(`requires.controls lists ${ident} twice`)\n seen.add(ident)\n }\n }\n }\n if (t.params !== undefined) {\n if (!isRecord(t.params) || Object.keys(t.params).length > 32) out.push('params: an object of at most 32 { type, title?, default? }')\n else for (const [name, p] of Object.entries(t.params)) {\n const at = `params.${name}`\n if (!BINDING.test(name)) out.push(`${at}: a param name is [a-z][a-z0-9_]{0,31}`)\n if (!isRecord(p)) { out.push(`${at} must be an object { type, title?, default? }`); continue }\n for (const [k, v] of Object.entries(p)) {\n if (k === 'type') { if (v !== 'string' && v !== 'number' && v !== 'boolean') out.push(`${at}.type: string, number or boolean`) }\n else if (k === 'title') { if (typeof v !== 'string' || v.length > 256) out.push(`${at}.title: at most 256 characters`) }\n else if (k === 'default') { if (!['string', 'number', 'boolean'].includes(typeof v)) out.push(`${at}.default: a string, number or boolean`) }\n else out.push(`${at}: unknown key ${k} (type, title, default)`)\n }\n if (p.type === undefined) out.push(`${at}.type required`)\n }\n }\n if (t.reset !== undefined) {\n const tables = isRecord(t.reset) ? t.reset.tables : undefined\n if (!isRecord(t.reset) || Object.keys(t.reset).some((k) => k !== 'tables')) out.push('reset: { tables }')\n else if (tables !== undefined && (!Array.isArray(tables) || tables.length > 64 || new Set(tables).size !== tables.length || tables.some((x) => typeof x !== 'string' || !/^[a-z0-9][a-z0-9_-]{0,63}$/.test(x)))) out.push('reset.tables: at most 64 distinct table ids')\n }\n return out\n}\n\n/** Verify a bundle the way an installer does: manifest, each control's digest and component.json, each Workspace\n * template's shape, snapshot and digest, no stray files. */\nexport async function verifyBundle(files: Map<string, Uint8Array>): Promise<{ manifest: AiwsManifest; diagnostics: AiwsDiagnostic[] }> {\n const raw = files.get(AIWS_MANIFEST_FILE)\n if (!raw) throw new AiwsSourceError([{ file: AIWS_MANIFEST_FILE, severity: 'error', message: 'missing' }])\n let parsed: unknown\n try { parsed = JSON.parse(decoder.decode(raw)) } catch (e) { throw new AiwsSourceError([{ file: AIWS_MANIFEST_FILE, severity: 'error', message: String(e) }]) }\n const manifest = compatManifest(parsed)\n const diagnostics: AiwsDiagnostic[] = []\n const templates = manifest.workspace_templates\n if (templates.length > 0 && manifest.manifest_version < 3) diagnostics.push({ file: AIWS_MANIFEST_FILE, severity: 'error', message: `Workspace templates need manifest_version 3 (raise it in ${AIWS_MANIFEST_FILE})` })\n if (templates.length > 32) diagnostics.push({ file: AIWS_MANIFEST_FILE, severity: 'error', message: 'at most 32 Workspace templates' })\n if (manifest.controls.length === 0 && templates.length === 0) diagnostics.push({ file: AIWS_MANIFEST_FILE, severity: 'error', message: 'lists no control' })\n // what the bundle's controls declare: a composite's re-raised events are judged against them\n const declared = new Map<string, string[]>()\n for (const c of manifest.controls) {\n const component = typeof c.dir === 'string' ? files.get(`${c.dir}${AIWS_COMPONENT_FILE}`) : undefined\n try {\n const comp = component ? JSON.parse(decoder.decode(component)) as unknown : undefined\n if (isRecord(comp)) declared.set(c.ident, isRecord(comp.events) ? Object.keys(comp.events) : [])\n } catch { /* reported below */ }\n }\n const dirs = new Set<string>()\n for (const c of manifest.controls) {\n if (typeof c.dir !== 'string' || !/^controls\\/[a-z0-9][a-z0-9._-]{0,70}\\/$/.test(c.dir) || dirs.has(c.dir)) { diagnostics.push({ file: AIWS_MANIFEST_FILE, severity: 'error', message: `control ${c.ident}: bad or repeated dir` }); continue }\n dirs.add(c.dir)\n const own: [string, Uint8Array][] = [...files].filter(([p]) => p.startsWith(c.dir)).map(([p, b]) => [p.slice(c.dir.length), b])\n if (await aiwsContentDigest(own) !== c.digest) diagnostics.push({ file: c.dir, severity: 'error', message: 'the files do not match the manifest digest' })\n const component = own.find(([n]) => n === AIWS_COMPONENT_FILE)\n if (!component) { diagnostics.push({ file: `${c.dir}${AIWS_COMPONENT_FILE}`, severity: 'error', message: 'missing' }); continue }\n const text = (name: string) => { const hit = own.find(([n]) => n === name); return hit ? decoder.decode(hit[1]) : undefined }\n for (const d of checkComponent(decoder.decode(component[1]), own.map(([n]) => n), text, (ident) => declared.get(ident))) diagnostics.push({ ...d, file: `${c.dir}${d.file}` })\n try {\n const comp = JSON.parse(decoder.decode(component[1])) as { ident?: { author_did?: string; name?: string }; kind?: string; deps?: string[] }\n if (`${comp.ident?.author_did}#${comp.ident?.name}` !== c.ident || comp.kind !== c.kind) diagnostics.push({ file: c.dir, severity: 'error', message: 'ident and kind must match its component.json' })\n if (JSON.stringify([...(comp.deps ?? [])].sort()) !== JSON.stringify([...(c.deps ?? [])].sort())) diagnostics.push({ file: c.dir, severity: 'error', message: 'deps must match its component.json' })\n } catch { /* reported above */ }\n }\n // what a control builds on travels with it (P1): every dependency is another control of the bundle\n const idents = new Set(manifest.controls.map((c) => c.ident))\n for (const c of manifest.controls) for (const d of c.deps ?? []) if (!idents.has(d)) diagnostics.push({ file: AIWS_MANIFEST_FILE, severity: 'error', message: `${c.ident} depends on ${d}, which the bundle does not carry` })\n // a template is a snapshot under templates/<id>/ needing controls of the same manifest (Q32)\n for (const [i, t] of templates.entries()) {\n const label = isRecord(t) && typeof t.id === 'string' ? `template ${t.id}` : `workspace_templates[${i}]`\n for (const p of templateProblems(t, idents)) diagnostics.push({ file: AIWS_MANIFEST_FILE, severity: 'error', message: `${label}: ${p}` })\n if (!isRecord(t) || typeof t.id !== 'string' || !TEMPLATE_ID.test(t.id)) continue\n const dir = templateDir(t.id)\n if (dirs.has(dir)) { diagnostics.push({ file: AIWS_MANIFEST_FILE, severity: 'error', message: `${label} is listed twice` }); continue }\n dirs.add(dir)\n const snapshot = files.get(`${dir}snapshot.json`)\n let format: unknown\n try { format = snapshot ? (JSON.parse(decoder.decode(snapshot)) as { format?: unknown }).format : undefined } catch { format = undefined }\n if (!snapshot) diagnostics.push({ file: `${dir}snapshot.json`, severity: 'error', message: 'missing' })\n else if (format !== AIWS_TEMPLATE_FORMAT) diagnostics.push({ file: `${dir}snapshot.json`, severity: 'error', message: `not a template snapshot (format ${AIWS_TEMPLATE_FORMAT})` })\n if (await aiwsTemplateDigest(files, t.id) !== t.digest) diagnostics.push({ file: dir, severity: 'error', message: 'the files do not match the template digest' })\n }\n for (const p of files.keys()) if (p !== AIWS_MANIFEST_FILE && ![...dirs].some((d) => p.startsWith(d))) diagnostics.push({ file: p, severity: 'error', message: 'belongs to no control or template of the manifest' })\n return { manifest, diagnostics }\n}\n\n/** The bundle of Workspace definitions (`ext.export`): the manifest plus every file's bytes. */\nexport async function exportBundle(client: AiwsExtRpc, workspaceId: string, entityIds: string[], fetchAsset: (workspaceId: string, objId: string) => Promise<Uint8Array>): Promise<AiwsBundle & { controls: Record<string, unknown>[] }> {\n const r = await client.extExport(workspaceId, entityIds, 'package')\n const files = new Map<string, Uint8Array>()\n files.set(AIWS_MANIFEST_FILE, encoder.encode(`${JSON.stringify(r.manifest, null, 2)}\\n`))\n for (const f of r.files) files.set(f.path, f.text !== undefined ? encoder.encode(f.text) : await fetchAsset(workspaceId, String(f.obj_id)))\n return { manifest: compatManifest(r.manifest), files, controls: r.controls }\n}\n\n// ---- the home folder over NFSP\n\n/** The entry `name` of a folder, found with a filtered listing (no request fails for a missing name). */\nasync function child(nfsp: NfspClient, folder: WireRef | string, name: string) {\n const glob = /[*?[\\]\\\\]/.test(name) ? undefined : name\n const page = await nfsp.list(typeof folder === 'string' ? folder : { ref: folder }, { limit: glob ? 10 : 1000, ...(glob ? { filter: { name_glob: glob } } : {}) }, ['base', 'ident'])\n return page.entries.find((e) => e.name === name)\n}\n\n/** Make sure a folder exists, creating each missing level below the realm root (`/home`); answers its ref. Levels\n * are looked up by listing their parent, so a missing one is not a failed request. */\nexport async function ensureFolder(nfsp: NfspClient, path: string): Promise<WireRef> {\n const parts = path.split('/').filter(Boolean)\n if (parts.length === 0) throw new Error(`not a folder path: ${path}`)\n let ref = (await nfsp.stat(`/${parts[0]}`)).ref\n for (const name of parts.slice(1)) {\n const hit = await child(nfsp, ref, name)\n if (hit && hit.target.kind !== 'dir') throw new AiwsSourceError([{ file: name, severity: 'error', message: `${name} in ${path} is not a folder` }])\n ref = hit ? hit.target.ref : (await nfsp.mkdir({ ref }, name)).ref\n }\n return ref\n}\n\n/** A folder's ref, or null when it (or a level above it) does not exist — found without failed requests. */\nexport async function findFolder(nfsp: NfspClient, path: string): Promise<WireRef | null> {\n const parts = path.split('/').filter(Boolean)\n if (parts.length === 0) return null\n let ref = (await nfsp.stat(`/${parts[0]}`)).ref\n for (const name of parts.slice(1)) {\n const hit = await child(nfsp, ref, name)\n if (!hit || hit.target.kind !== 'dir') return null\n ref = hit.target.ref\n }\n return ref\n}\n\n/** Whether a folder holds a control source (its component.json). */\nexport async function hasControlSource(nfsp: NfspClient, dir: string): Promise<boolean> {\n const ref = await findFolder(nfsp, dir)\n return ref !== null && (await child(nfsp, ref, AIWS_COMPONENT_FILE)) !== undefined\n}\n\n/** Write one file into a folder (replacing it). */\nexport async function writeHomeFile(nfsp: NfspClient, dir: string | WireRef, name: string, bytes: Uint8Array): Promise<void> {\n const ref = typeof dir === 'string' ? await ensureFolder(nfsp, dir) : dir\n await nfsp.uploadFile(ref, name, bytes, { overwrite: true })\n}\n\nconst sleep = (ms: number) => new Promise((r) => setTimeout(r, ms))\n\n/** The files of a control's source folder, sub-folders included (names are relative paths, Q23); dot files and dot\n * folders are the client's own and skipped. */\nexport async function collectSources(nfsp: NfspClient, dir: string): Promise<AiwsSourceFile[]> {\n const out: AiwsSourceFile[] = []\n const problems: AiwsDiagnostic[] = []\n const walk = async (folder: string | WireRef, prefix: string, depth: number): Promise<void> => {\n let cursor: string | undefined\n do {\n const page = await nfsp.list(typeof folder === 'string' ? folder : { ref: folder }, { limit: 500, ...(cursor ? { cursor } : {}) }, ['base', 'ident'])\n for (const e of page.entries) {\n if (e.name.startsWith('.')) continue\n const name = `${prefix}${e.name}`\n if (e.target.kind === 'dir') {\n if (depth >= 8) problems.push({ file: name, severity: 'error', message: 'sub-folders nest at most 8 levels' })\n else await walk(e.target.ref, `${name}/`, depth + 1)\n continue\n }\n if (e.target.kind !== 'file') { problems.push({ file: name, severity: 'error', message: 'only files and folders belong to a control source' }); continue }\n const ref = e.target.ref\n const objId = ref.type === 'object' ? ref.obj_id : typeof e.target.attrs?.obj_id === 'string' ? e.target.attrs.obj_id : undefined\n out.push({\n name,\n ...(objId ? { obj_id: objId } : {}),\n ...(ref.type === 'live' ? { node_id: ref.node_id } : {}),\n ...(typeof e.target.attrs?.etag === 'string' ? { etag: e.target.attrs.etag } : {}),\n ...(typeof e.target.attrs?.size === 'number' ? { size: e.target.attrs.size } : {}),\n })\n }\n cursor = page.truncated ? page.next_cursor : undefined\n } while (cursor)\n }\n await walk(dir, '', 0)\n if (out.length === 0) problems.push({ file: '', severity: 'error', message: `${dir} holds no files` })\n if (out.length > AIWS_MAX_SOURCE_FILES) problems.push({ file: '', severity: 'error', message: `a control holds at most ${AIWS_MAX_SOURCE_FILES} files` })\n if (problems.some((p) => p.severity === 'error')) throw new AiwsSourceError(problems)\n return out.sort((a, b) => (a.name < b.name ? -1 : a.name > b.name ? 1 : 0))\n}\n\n/** Write a source file whose name may be a relative path (its sub-folders are created). */\nexport async function writeSourceFile(nfsp: NfspClient, dir: string, name: string, bytes: Uint8Array): Promise<void> {\n const cut = name.lastIndexOf('/')\n await writeHomeFile(nfsp, cut < 0 ? dir : joinPath(dir, name.slice(0, cut)), cut < 0 ? name : name.slice(cut + 1), bytes)\n}\n\n/** The content digest of a home folder's sources (what `ext.export` answers as a control's `digest`). */\nexport async function sourcesDigest(nfsp: NfspClient, files: AiwsSourceFile[]): Promise<string> {\n const pairs: [string, Uint8Array][] = []\n for (const f of files) {\n if (!f.node_id) throw new AiwsSourceError([{ file: f.name, severity: 'error', message: 'the file service did not name this file' }])\n pairs.push([f.name, new Uint8Array(await (await nfsp.readFile(f.node_id)).arrayBuffer())])\n }\n return aiwsContentDigest(pairs)\n}\n\n/**\n * Does the home folder of a definition hold changes that were not built (P0 遗留 L3)? Compares its sources with the\n * Workspace snapshot (`ext.export { purpose: pull }`). `null` when the folder holds no control.\n */\nexport async function unbuiltChanges(client: AiwsExtRpc, nfsp: NfspClient, workspaceId: string, defEntityId: string, dir: string): Promise<{ changed: boolean; home: string; built: string } | null> {\n if (!(await hasControlSource(nfsp, dir))) return null\n const home = await sourcesDigest(nfsp, await collectSources(nfsp, dir))\n const r = await client.extExport(workspaceId, [defEntityId], 'pull')\n const built = String((r.controls[0] as { digest?: string } | undefined)?.digest ?? '')\n return { changed: home !== built, home, built }\n}\n\nexport async function readBuildState(nfsp: NfspClient, dir: string): Promise<AiwsBuildState | null> {\n try {\n const entry = await child(nfsp, dir, AIWS_BUILD_STATE_FILE)\n const nodeId = entry?.target.ref.type === 'live' ? entry.target.ref.node_id : undefined\n if (!nodeId) return null\n const response = await nfsp.readFile(nodeId)\n return (await response.json()) as AiwsBuildState\n } catch {\n return null\n }\n}\n\nexport async function writeBuildState(nfsp: NfspClient, dir: string, state: AiwsBuildState): Promise<void> {\n await writeHomeFile(nfsp, dir, AIWS_BUILD_STATE_FILE, encoder.encode(`${JSON.stringify(state, null, 2)}\\n`))\n}\n\nexport interface AiwsBuildOptions { folderId?: string; force?: boolean; dryRun?: boolean; upload?: AiwsUploader; migration?: Record<string, AiwsMigration> }\n\n/**\n * Build the control in `dir` into a Workspace: collect the files, call `ext.build` with the base recorded in\n * `.aiws-build.json` (when it is this Workspace's), and record the new base. Service refusals throw `AiwsFailure`\n * (`BUILD_FAILED` carries `data.diagnostics`); source problems throw `AiwsSourceError`.\n */\nexport async function buildControl(client: AiwsExtRpc, nfsp: NfspClient, workspaceId: string, dir: string, opts: AiwsBuildOptions = {}): Promise<Record<string, unknown> & { files: AiwsSourceFile[] }> {\n const files = await collectSources(nfsp, dir)\n const state = await readBuildState(nfsp, dir)\n const base = state && state.workspace_id === workspaceId ? { def_rev: state.def_rev, dir_rev: state.dir_rev } : undefined\n const result = await client.extBuild(workspaceId, {\n files: await buildFiles(nfsp, files, opts.upload),\n ...(opts.folderId ? { folder_id: opts.folderId } : {}),\n ...(base ? { expect: base } : {}),\n ...(opts.force ? { force: true } : {}),\n ...(opts.dryRun ? { dry_run: true } : {}),\n ...(opts.migration ? { migration: opts.migration } : {}),\n })\n if (!opts.dryRun && typeof result.def_entity_id === 'string' && typeof result.def_rev === 'number') {\n await writeBuildState(nfsp, dir, { workspace_id: workspaceId, def_entity_id: result.def_entity_id, def_rev: result.def_rev, dir_rev: Number(result.dir_rev ?? 0), ident: String(result.ident ?? ''), at: new Date().toISOString() })\n }\n return { ...result, files }\n}\n\n/**\n * Write a definition's Workspace snapshot into `outDir` (a definition never built from source gets synthesized\n * files) and record it as the base of the next build.\n */\nexport async function pullControl(client: AiwsExtRpc, nfsp: NfspClient, workspaceId: string, defEntityId: string, outDir: string, fetchAsset: (workspaceId: string, objId: string) => Promise<Uint8Array>): Promise<{ files: string[]; state: AiwsBuildState }> {\n const r = await client.extExport(workspaceId, [defEntityId], 'pull')\n const control = r.controls[0] as { entity_id: string; ident: string; def_rev: number; dir_rev: number; files: { name: string; obj_id?: string; text?: string }[] }\n await ensureFolder(nfsp, outDir)\n for (const f of control.files) await writeSourceFile(nfsp, outDir, f.name, f.text !== undefined ? encoder.encode(f.text) : await fetchAsset(workspaceId, String(f.obj_id)))\n const state: AiwsBuildState = { workspace_id: workspaceId, def_entity_id: control.entity_id, def_rev: control.def_rev, dir_rev: control.dir_rev, ident: control.ident, at: new Date().toISOString() }\n await writeBuildState(nfsp, outDir, state)\n return { files: control.files.map((f) => f.name), state }\n}\n\n/**\n * Rebuild whenever the folder changes: NFSP watch events (lossy: a `resync` lists again), debounced, and only when\n * the files' objects differ from the last build. Returns when `signal` aborts.\n */\nexport async function watchControl(nfsp: NfspClient, dir: string, onChange: (files: AiwsSourceFile[]) => Promise<void>, opts: { debounceMs?: number; signal?: AbortSignal } = {}): Promise<void> {\n let last = ''\n let timer: ReturnType<typeof setTimeout> | undefined\n let running = Promise.resolve()\n const check = () => {\n running = running.then(async () => {\n let files: AiwsSourceFile[]\n try { files = await collectSources(nfsp, dir) } catch { return }\n const key = sourcesKey(files)\n if (key === last) return\n last = key\n await onChange(files)\n }).catch(() => undefined)\n }\n check()\n while (!opts.signal?.aborted) {\n const listing = await nfsp.list(dir, { limit: 1 }, ['base'])\n const stream = nfsp.watch({ tokens: listing.watch_token ? [listing.watch_token] : [], signal: opts.signal })\n try {\n for await (const _ of stream) {\n if (timer) clearTimeout(timer)\n timer = setTimeout(check, opts.debounceMs ?? 500)\n }\n } catch {\n if (opts.signal?.aborted) break\n await sleep(2_000)\n } finally {\n stream.close()\n }\n }\n if (timer) clearTimeout(timer)\n await running\n}\n\n// ---- skeletons\n\nexport interface AiwsSkeletonOptions {\n authorDid: string\n name: string\n title?: string\n kind?: 'declarative' | 'html' | 'composite'\n /** A composite's slots (default: one `items` slot taking any Block) and what it builds on. */\n slots?: AiwsComposition['slots']\n deps?: string[]\n algorithm?: 'stack' | 'fixed'\n}\n\n/** The files of a new control: a minimal working declarative or HTML control (with one public event, raised by a\n * button) with one optional binding, or a composite that stacks (or keeps in place) the Blocks of its slots under a\n * titled frame. */\nexport function controlSkeleton(opts: AiwsSkeletonOptions): Record<string, string> {\n const title = opts.title ?? opts.name\n if (opts.kind === 'composite') {\n const fixed = opts.algorithm === 'fixed'\n const slots = opts.slots ?? { items: { placement: fixed ? 'free' : 'stack', title: 'Items' } }\n const composition: AiwsComposition = {\n layout: fixed ? { algorithm: 'fixed', padding: 12 } : { algorithm: 'stack', direction: 'column', spacing: '{{config.gap}}', padding: 12 },\n slots,\n chrome: { background: '{{config.background}}', radius: 12, title: { text: '{{config.title}}' }, empty: 'Drop Blocks here' },\n }\n const component = {\n manifest_version: AIWS_MANIFEST_VERSION,\n ident: { author_did: opts.authorDid, name: opts.name },\n kind: 'composite',\n title,\n description: `${title}: a panel of Blocks`,\n default_size: { w: 320, h: 360 },\n config_schema: { type: 'object', properties: {\n title: { type: 'string', title: 'Title', default: title },\n background: { type: 'string', title: 'Background', default: '#f6f7fb' },\n gap: { type: 'integer', title: 'Gap (px)', default: 8, minimum: 0, maximum: 64 },\n } },\n entry: AIWS_COMPOSITION_FILE,\n deps: opts.deps ?? [],\n catalog: { group: 'custom', description: `${title}` },\n agent: 'AGENT.md',\n }\n const names = Object.keys(slots).map((n) => `\\`${n}\\``).join(', ')\n return {\n [AIWS_COMPONENT_FILE]: `${JSON.stringify(component, null, 2)}\\n`,\n [AIWS_COMPOSITION_FILE]: `${JSON.stringify(composition, null, 2)}\\n`,\n 'AGENT.md': `# ${title}\\n\\nA composite: an instance is a \\`buckyos.container { kind: \"composite\", def_ref }\\`; put Blocks under it with \\`slot\\` set to one of ${names}. Config: \\`title\\`, \\`background\\`, \\`gap\\`.\\n`,\n }\n }\n const base = {\n manifest_version: AIWS_MANIFEST_VERSION,\n ident: { author_did: opts.authorDid, name: opts.name },\n kind: opts.kind ?? 'declarative',\n title,\n description: `${title}: a control of this Workspace`,\n accepts: ['buckyos.table-source', 'buckyos.record'],\n allow_no_source: true,\n default_size: { w: 260, h: 140 },\n config_schema: { type: 'object', properties: { label: { type: 'string', title: 'Label', default: title } } },\n bindings: { data: { accepts: ['buckyos.table-source'], title: 'Data', description: 'The table this control summarizes' } },\n catalog: { group: 'custom', description: `${title}` },\n agent: 'AGENT.md',\n }\n const agent = `# ${title}\\n\\nBind \\`data\\` to a table. Config: \\`label\\` (text).\\n`\n if (opts.kind === 'html') {\n const events = { clicked: { title: 'Clicked', description: 'Raised when someone clicks the button (in run mode)', params: { count: { type: 'number', description: 'Rows of the bound table' } } } }\n return {\n [AIWS_COMPONENT_FILE]: `${JSON.stringify({ ...base, host_api: AIWS_HTML_API_VERSION, events, entry: { html: 'view.html', css: 'style.css', js: 'behavior.js' } }, null, 2)}\\n`,\n 'view.html': '<div class=\"card\"><div class=\"label\" id=\"label\"></div><div class=\"value\" id=\"value\">—</div><button id=\"go\" type=\"button\">Go</button></div>\\n',\n 'style.css': '.card{font:14px system-ui;padding:12px}.label{opacity:.7}.value{font-size:28px;font-weight:600}\\n',\n 'behavior.js': [\n \"document.getElementById('label').textContent = (aiws.context.config || {}).label || ''\",\n 'var count = 0',\n \"if (aiws.bindings.data) aiws.input('data').rows().then(function (rows) { count = rows.length; document.getElementById('value').textContent = String(count) })\",\n '// the public event of component.json: an instance binds handlers to it in its `on` (host API 3)',\n \"document.getElementById('go').addEventListener('click', function () { aiws.emit('clicked', { count: count }) })\",\n '',\n ].join('\\n'),\n 'AGENT.md': `${agent}Event: \\`clicked\\` (\\`count\\`), raised by its button; bind handlers to it in the instance's \\`on\\`.\\n`,\n }\n }\n return {\n [AIWS_COMPONENT_FILE]: `${JSON.stringify({ ...base, entry: 'declarative.json' }, null, 2)}\\n`,\n 'declarative.json': `${JSON.stringify({ layout: 'stack', items: [{ kind: 'metric', label: title, bind: 'data.count', format: 'number' }, { kind: 'text', text: 'Rows of the bound table' }] }, null, 2)}\\n`,\n 'AGENT.md': agent,\n }\n}\n\n/** Create a control's source folder from a skeleton (refuses to overwrite a folder that has a component.json). */\nexport async function createControlSource(nfsp: NfspClient, dir: string, files: Record<string, string>): Promise<WireRef> {\n const ref = await ensureFolder(nfsp, dir)\n const existing = await nfsp.list({ ref }, { limit: 500 }, ['base']).catch(() => null)\n if (existing?.entries.some((e) => e.name === AIWS_COMPONENT_FILE)) throw new AiwsSourceError([{ file: AIWS_COMPONENT_FILE, severity: 'error', message: `${dir} already holds a control` }])\n for (const [name, text] of Object.entries(files)) await writeHomeFile(nfsp, ref, name, encoder.encode(text))\n return ref\n}\n"],"names":[],"mappings":"AAoBO,MAAM,sBAAsB;AAE5B,MAAM,wBAAwB;AAC9B,MAAM,qBAAqB;AAE3B,MAAM,wBAAwB;AAI9B,MAAM,wBAAwB;AAG9B,MAAM,wBAAwB;AAC9B,MAAM,+BAA+B;AAErC,MAAM,uBAAuB;AAC7B,MAAM,wBAAwB;AA4B9B,MAAM,wBAAwB,MAAM;AAAA,EAEzC,YAAY,aAA+B;AACnC,UAAA,YAAY,OAAO,CAAC,MAAM,EAAE,aAAa,OAAO,EAAE,IAAI,CAAC,MAAM,GAAG,EAAE,OAAO,GAAG,EAAE,IAAI,OAAO,EAAE,GAAG,EAAE,OAAO,EAAE,EAAE,KAAK,IAAI,KAAK,wBAAwB;AACvJ,SAAK,O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AAG,2BAAA,CAA4B,CAAC;AAC1L,aAAW,CAAC,MAAM,IAAI,KAAK,OAAO,QAAQ,KAAK;AAAG,UAAM,cAAc,MAAM,KAAK,MAAM,QAAQ,OAAO,IAAI,CAAC;AACpG,SAAA;AACT;"}
package/dist/browser.cjs CHANGED
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./executor_client-24abb248.js"),t=require("./namelib-f8ff0045.js"),o=e.createSDKModule("browser"),_=o.buckyos,s=o.initBuckyOS,r=o.getBuckyOSConfig,E=o.getRuntimeType,A=o.getAppId,T=o.getAppDid,p=o.getAppInstanceId,S=o.getAppDataDir,n=o.getKEventClient,i=o.createEventReader,C=o.create_event_reader,I=o.subscribeKEvent,x=o.attachEvent,a=o.removeEvent,O=o.getAccountInfo,D=o.getCurrentIdentity,R=o.loginByPassword,N=o.loginByBrowserSSO,c=o.loginByRuntimeSession,l=o.login,M=o.logout,u=o.getAppSetting,d=o.setAppSetting,P=o.getCurrentWalletUser,L=o.resolve_did,H=o.walletSignWithActiveDid,g=o.openExternalUrl,K=o.getZoneHostName,U=o.getZoneServiceURL,k=o.getServiceRpcClient,m=o.getVerifyHubClient,y=o.getSystemConfigClient,B=o.getTaskManagerClient,F=o.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.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.RPCError=e.RPCError,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.WorkflowHumanActionKind=e.WorkflowHumanActionKind,exports.WorkflowJoinMode=e.WorkflowJoinMode,exports.WorkflowNodeRunState=e.WorkflowNodeRunState,exports.WorkflowOutputMode=e.WorkflowOutputMode,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.commitNotifyAnswer=e.commitNotifyAnswer,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.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.msgMachineData=e.msgMachineData,exports.ndm=e.ndm_client,exports.ndm_proxy=e.ndm_proxy,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.objectUrl=e.object_url,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.resolveDidFromHost=e.resolveDidFromHost,exports.sn=e.sn_client,exports.taskMgrErrorCode=e.taskMgrErrorCode,exports.taskMgrTaskEventPath=e.taskMgrTaskEventPath,exports.taskMgrTreeEventPath=e.taskMgrTreeEventPath,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.DID_OBJECT_SERVICE_ID=t.DID_OBJECT_SERVICE_ID,exports.DID_OBJECT_SERVICE_TYPE=t.DID_OBJECT_SERVICE_TYPE,exports.NODE_IDENTITY_SCHEMA_V2=t.NODE_IDENTITY_SCHEMA_V2,exports.getDidIdentifier=t.getDidIdentifier,exports.getDidMethod=t.getDidMethod,exports.hashPassword=t.hashPassword,exports.isBuckyOSAgentDocument=t.isBuckyOSAgentDocument,exports.isBuckyOSDIDObjectCard=t.isBuckyOSDIDObjectCard,exports.isBuckyOSDeviceDocument=t.isBuckyOSDeviceDocument,exports.isBuckyOSDeviceMiniDocument=t.isBuckyOSDeviceMiniDocument,exports.isBuckyOSLocalNodeIdentityConfig=t.isBuckyOSLocalNodeIdentityConfig,exports.isBuckyOSOwnerDocument=t.isBuckyOSOwnerDocument,exports.isBuckyOSZoneBootDocument=t.isBuckyOSZoneBootDocument,exports.isBuckyOSZoneConfig=t.isBuckyOSZoneConfig,exports.isBuckyOSZoneDocument=t.isBuckyOSZoneDocument,exports.isW3CDIDDocumentBase=t.isW3CDIDDocumentBase,exports.namelib=t.namelib,exports.ndn=t.ndn_types,exports.parseBuckyOSDIDDocument=t.parseBuckyOSDIDDocument,exports.parseBuckyOSDeviceMiniDocument=t.parseBuckyOSDeviceMiniDocument,exports.parseBuckyOSOwnerDocument=t.parseBuckyOSOwnerDocument,exports.parseW3CDIDDocumentBase=t.parseW3CDIDDocumentBase,exports.attachEvent=x,exports.buckyos=_,exports.createEventReader=i,exports.create_event_reader=C,exports.getAccountInfo=O,exports.getAppDataDir=S,exports.getAppDid=T,exports.getAppId=A,exports.getAppInstanceId=p,exports.getAppSetting=u,exports.getBuckyOSConfig=r,exports.getCurrentIdentity=D,exports.getCurrentWalletUser=P,exports.getKEventClient=n,exports.getRuntimeType=E,exports.getServiceRpcClient=k,exports.getSystemConfigClient=y,exports.getTaskManagerClient=B,exports.getVerifyHubClient=m,exports.getWorkflowClient=F,exports.getZoneHostName=K,exports.getZoneServiceURL=U,exports.initBuckyOS=s,exports.login=l,exports.loginByBrowserSSO=N,exports.loginByPassword=R,exports.loginByRuntimeSession=c,exports.logout=M,exports.openExternalUrl=g,exports.removeEvent=a,exports.resolve_did=L,exports.setAppSetting=d,exports.subscribeKEvent=I,exports.walletSignWithActiveDid=H;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./executor_client-3f7679e3.js"),t=require("./namelib-f8ff0045.js"),o=e.createSDKModule("browser"),_=o.buckyos,s=o.initBuckyOS,r=o.getBuckyOSConfig,E=o.getRuntimeType,A=o.getAppId,T=o.getAppDid,p=o.getAppInstanceId,S=o.getAppDataDir,n=o.getKEventClient,i=o.createEventReader,C=o.create_event_reader,I=o.subscribeKEvent,x=o.attachEvent,a=o.removeEvent,O=o.getAccountInfo,D=o.getCurrentIdentity,R=o.loginByPassword,N=o.loginByBrowserSSO,c=o.loginByRuntimeSession,l=o.login,M=o.logout,u=o.getAppSetting,d=o.setAppSetting,P=o.getCurrentWalletUser,L=o.resolve_did,H=o.walletSignWithActiveDid,g=o.openExternalUrl,K=o.getZoneHostName,U=o.getZoneServiceURL,k=o.getServiceRpcClient,m=o.getVerifyHubClient,y=o.getSystemConfigClient,B=o.getTaskManagerClient,F=o.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.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.RPCError=e.RPCError,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.WorkflowHumanActionKind=e.WorkflowHumanActionKind,exports.WorkflowJoinMode=e.WorkflowJoinMode,exports.WorkflowNodeRunState=e.WorkflowNodeRunState,exports.WorkflowOutputMode=e.WorkflowOutputMode,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.commitNotifyAnswer=e.commitNotifyAnswer,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.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.msgMachineData=e.msgMachineData,exports.ndm=e.ndm_client,exports.ndm_proxy=e.ndm_proxy,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.objectUrl=e.object_url,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.resolveDidFromHost=e.resolveDidFromHost,exports.sn=e.sn_client,exports.taskMgrErrorCode=e.taskMgrErrorCode,exports.taskMgrTaskEventPath=e.taskMgrTaskEventPath,exports.taskMgrTreeEventPath=e.taskMgrTreeEventPath,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.DID_OBJECT_SERVICE_ID=t.DID_OBJECT_SERVICE_ID,exports.DID_OBJECT_SERVICE_TYPE=t.DID_OBJECT_SERVICE_TYPE,exports.NODE_IDENTITY_SCHEMA_V2=t.NODE_IDENTITY_SCHEMA_V2,exports.getDidIdentifier=t.getDidIdentifier,exports.getDidMethod=t.getDidMethod,exports.hashPassword=t.hashPassword,exports.isBuckyOSAgentDocument=t.isBuckyOSAgentDocument,exports.isBuckyOSDIDObjectCard=t.isBuckyOSDIDObjectCard,exports.isBuckyOSDeviceDocument=t.isBuckyOSDeviceDocument,exports.isBuckyOSDeviceMiniDocument=t.isBuckyOSDeviceMiniDocument,exports.isBuckyOSLocalNodeIdentityConfig=t.isBuckyOSLocalNodeIdentityConfig,exports.isBuckyOSOwnerDocument=t.isBuckyOSOwnerDocument,exports.isBuckyOSZoneBootDocument=t.isBuckyOSZoneBootDocument,exports.isBuckyOSZoneConfig=t.isBuckyOSZoneConfig,exports.isBuckyOSZoneDocument=t.isBuckyOSZoneDocument,exports.isW3CDIDDocumentBase=t.isW3CDIDDocumentBase,exports.namelib=t.namelib,exports.ndn=t.ndn_types,exports.parseBuckyOSDIDDocument=t.parseBuckyOSDIDDocument,exports.parseBuckyOSDeviceMiniDocument=t.parseBuckyOSDeviceMiniDocument,exports.parseBuckyOSOwnerDocument=t.parseBuckyOSOwnerDocument,exports.parseW3CDIDDocumentBase=t.parseW3CDIDDocumentBase,exports.attachEvent=x,exports.buckyos=_,exports.createEventReader=i,exports.create_event_reader=C,exports.getAccountInfo=O,exports.getAppDataDir=S,exports.getAppDid=T,exports.getAppId=A,exports.getAppInstanceId=p,exports.getAppSetting=u,exports.getBuckyOSConfig=r,exports.getCurrentIdentity=D,exports.getCurrentWalletUser=P,exports.getKEventClient=n,exports.getRuntimeType=E,exports.getServiceRpcClient=k,exports.getSystemConfigClient=y,exports.getTaskManagerClient=B,exports.getVerifyHubClient=m,exports.getWorkflowClient=F,exports.getZoneHostName=K,exports.getZoneServiceURL=U,exports.initBuckyOS=s,exports.login=l,exports.loginByBrowserSSO=N,exports.loginByPassword=R,exports.loginByRuntimeSession=c,exports.logout=M,exports.openExternalUrl=g,exports.removeEvent=a,exports.resolve_did=L,exports.setAppSetting=d,exports.subscribeKEvent=I,exports.walletSignWithActiveDid=H;
2
2
  //# sourceMappingURL=browser.cjs.map
package/dist/browser.mjs CHANGED
@@ -1,5 +1,5 @@
1
- import { c as createSDKModule } from "./executor_client-24076936.mjs";
2
- import { aa, aM, bF, aR, bG, bL, bK, bH, bJ, bM, bI, bD, bE, bC, ad, aS, an, am, ao, ap, aU, aT, aW, aV, bT, cb, cc, c7, c8, c9, ca, cd, e, B, cf, ce, cj, ch, j, a2, a1, a0, $, bi, ah, a9, aC, E, ck, cn, cl, _, aB, aN, ai, c1, c0, t, M, C, D, z, x, w, N, F, y, A, aO, aP, aA, q, k, R, aD, bm, S, b2, b1, b0, b5, b3, a$, aX, aY, b4, aZ, b6, a_, ax, ay, aw, b7, az, aQ, bj, bg, bl, bn, bb, bk, bo, bf, bc, be, a5, a4, V, W, a3, aK, aG, aL, aE, aI, aJ, bp, aF, aH, bB, bu, bx, bs, bw, br, bt, bv, bA, bz, by, bq, Z, ac, bR, bQ, bN, bP, X, c4, c2, bh, b, d, al, U, av, a6, a7, c5, bU, cg, cm, f, i, h, g, ag, af, J, bO, m, G, bd, a8, ar, aq, au, u, v, Q, n, a, aj, L, I, H, T, P, o, ab, c3, c6, as, ae, p, bX, l, K, at, r, s, ba, b8, b9, bS, bW, bV, O, b_, bZ, bY, b$, Y, ci, ak } from "./executor_client-24076936.mjs";
1
+ import { c as createSDKModule } from "./executor_client-0856c3fc.mjs";
2
+ import { aa, aM, bF, aR, bG, bL, bK, bH, bJ, bM, bI, bD, bE, bC, ad, aS, an, am, ao, ap, aU, aT, aW, aV, bT, cb, cc, c7, c8, c9, ca, cd, e, B, cf, ce, cj, ch, j, a2, a1, a0, $, bi, ah, a9, aC, E, ck, cn, cl, _, aB, aN, ai, c1, c0, t, M, C, D, z, x, w, N, F, y, A, aO, aP, aA, q, k, R, aD, bm, S, b2, b1, b0, b5, b3, a$, aX, aY, b4, aZ, b6, a_, ax, ay, aw, b7, az, aQ, bj, bg, bl, bn, bb, bk, bo, bf, bc, be, a5, a4, V, W, a3, aK, aG, aL, aE, aI, aJ, bp, aF, aH, bB, bu, bx, bs, bw, br, bt, bv, bA, bz, by, bq, Z, ac, bR, bQ, bN, bP, X, c4, c2, bh, b, d, al, U, av, a6, a7, c5, bU, cg, cm, f, i, h, g, ag, af, J, bO, m, G, bd, a8, ar, aq, au, u, v, Q, n, a, aj, L, I, H, T, P, o, ab, c3, c6, as, ae, p, bX, l, K, at, r, s, ba, b8, b9, bS, bW, bV, O, b_, bZ, bY, b$, Y, ci, ak } from "./executor_client-0856c3fc.mjs";
3
3
  import { b as b10, D as D2, N as N2, t as t2, s as s2, h as h2, j as j2, l as l2, g as g2, d as d2, f as f2, c, e as e2, m as m2, k as k2, i as i2, n as n2, a as a10, r as r2, q as q2, o as o2, p as p2 } from "./namelib-b41b10cc.mjs";
4
4
  const sdkModule = createSDKModule("browser");
5
5
  const buckyos = sdkModule.buckyos;
@@ -799,6 +799,83 @@ class AiWorkspaceClient {
799
799
  getSubmission(workspace_id, epoch, idempotency_key) {
800
800
  return this.call("doc.get_submission", { workspace_id, epoch, idempotency_key });
801
801
  }
802
+ /** Changes after `after_seq` (`filter.detail: "touched"` for the touched entities only). */
803
+ getChanges(workspace_id, epoch, after_seq, opts = {}) {
804
+ return this.call("doc.get_changes", { workspace_id, epoch, after_seq, ...opts.limit ? { limit: opts.limit } : {}, ...opts.touchedOnly ? { filter: { detail: "touched" } } : {} });
805
+ }
806
+ /** Long poll until the head passes `after_seq` (or `timeout_ms`). */
807
+ waitChanges(workspace_id, after_seq, opts = {}) {
808
+ return this.call("doc.wait_changes", { workspace_id, after_seq, ...opts });
809
+ }
810
+ /** A whole-Workspace package (`.bcanvas`): `download` names it in the owner's exports bucket. */
811
+ exportDoc(workspace_id, mode, self_contained, include_notes) {
812
+ return this.call("doc.export", { workspace_id, mode, self_contained, ...include_notes === void 0 ? {} : { include_notes } });
813
+ }
814
+ // ---- assets
815
+ /** Register a FileObject as a staged asset: `{ bucket_id, key }` (the uploader's binding) or `{ obj_id }`. */
816
+ assetImportObject(workspace_id, source) {
817
+ return this.call("asset.import_object", { workspace_id, ...source });
818
+ }
819
+ // ---- Block-controls (code-registered layouts such as the mind map)
820
+ controlsList() {
821
+ return this.call("control.list", {});
822
+ }
823
+ controlsDescribe(kind) {
824
+ return this.call("control.describe", { kind });
825
+ }
826
+ controlsImport(workspace_id, params) {
827
+ return this.call("control.import", { workspace_id, ...params });
828
+ }
829
+ controlsExport(workspace_id, entity_id, format) {
830
+ return this.call("control.export", { workspace_id, entity_id, ...format ? { format } : {} });
831
+ }
832
+ // ---- extension controls (README “Extension controls”; buckyos-websdk src/aiws_ext.ts drives them)
833
+ /** Build one control's source files into the Workspace; `BUILD_FAILED` carries `data.diagnostics`. */
834
+ extBuild(workspace_id, params) {
835
+ return this.call("ext.build", { workspace_id, ...params });
836
+ }
837
+ /** The bundle of definitions (`purpose: pull` needs read only and synthesizes the source of never-built ones). */
838
+ extExport(workspace_id, entity_ids, purpose = "package") {
839
+ return this.call("ext.export", { workspace_id, entity_ids, purpose });
840
+ }
841
+ /** Into the caller's library: a `.pikg` object or one bound into the caller's `exports` bucket (consumed), or
842
+ * definitions of a Workspace (`from` + `package`). */
843
+ extInstall(params) {
844
+ return this.call("ext.install", params);
845
+ }
846
+ /** Pack definitions (and what they build on, and templates of the Workspace) as an `aiws` `.pikg` into the caller's
847
+ * `exports` bucket (unsigned). */
848
+ extPack(workspace_id, entity_ids, pkg, templates) {
849
+ return this.call("ext.pack", { workspace_id, entity_ids, package: pkg, ...templates ? { templates } : {} });
850
+ }
851
+ /** Rebuild imported definitions from the caller's library (same Zone; across Zones `ext.build { provenance, upgrade }`):
852
+ * `EXT_LOCAL_CHANGES` when the snapshot was built locally since, unless `force`. */
853
+ extUpgrade(params) {
854
+ return this.call("ext.upgrade", { ...params });
855
+ }
856
+ /** Chosen Surfaces as a template snapshot: the manifest item, the definitions it needs and the files (base64) of
857
+ * `templates/<id>/`. */
858
+ extExportTemplate(params) {
859
+ return this.call("ext.export_template", { ...params });
860
+ }
861
+ /** A new Workspace from a template of the caller's library (installing a template never creates one). */
862
+ extCreateFromTemplate(params) {
863
+ return this.call("ext.create_from_template", params);
864
+ }
865
+ extListLibrary() {
866
+ return this.call("ext.list_library", {});
867
+ }
868
+ extUninstall(pkg_id) {
869
+ return this.call("ext.uninstall", { pkg_id });
870
+ }
871
+ /** A library package's controls with their bytes (base64): what a client relays into a Workspace of another Zone. */
872
+ extLibraryBundle(pkg_id, idents) {
873
+ return this.call("ext.library_bundle", { pkg_id, ...idents ? { idents } : {} });
874
+ }
875
+ /** Bring library controls into a Workspace of this Zone (one Commit). */
876
+ extImport(workspace_id, items, opts = {}) {
877
+ return this.call("ext.import", { workspace_id, items, ...opts });
878
+ }
802
879
  // ---- runs (M3 executor protocol)
803
880
  runStart(workspace_id, program, params, idempotency_key) {
804
881
  return this.call("proc.start", { workspace_id, program, params, idempotency_key });
@@ -30643,4 +30720,4 @@ export {
30643
30720
  NOTIFY_SESSION_PREFIX as y,
30644
30721
  NOTIFY_CHOICE_CONTROL_ID as z
30645
30722
  };
30646
- //# sourceMappingURL=executor_client-24076936.mjs.map
30723
+ //# sourceMappingURL=executor_client-0856c3fc.mjs.map