arcane-os 0.2.2 → 0.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (117) hide show
  1. package/CHANGELOG.md +29 -0
  2. package/README.md +8 -8
  3. package/browser-runtime/ARCANE_SDK_BROWSER_RELEASE.json +29 -22
  4. package/browser-runtime/ai/ARCANE_AI_BROWSER_SPEECH_COMPONENTS.json +203 -0
  5. package/browser-runtime/ai/browser-kokoro-worker.mjs +11 -2
  6. package/browser-runtime/ai/browser-speech-artifacts.mjs +3230 -397
  7. package/browser-runtime/ai/browser-speech-providers.mjs +1141 -157
  8. package/browser-runtime/ai/browser-speech.mjs +2 -0
  9. package/browser-runtime/ai/browser-whisper-worker.mjs +11 -2
  10. package/browser-runtime/ai/model-controller.mjs +285 -95
  11. package/browser-runtime/ai/speech-worker-client.mjs +247 -32
  12. package/browser-runtime/ai/speech-worker-runtime.mjs +2310 -167
  13. package/browser-runtime/event-manager.mjs +1097 -1
  14. package/docs/architecture.md +2 -2
  15. package/docs/event-manager.md +155 -27
  16. package/docs/reference/README.md +27 -27
  17. package/docs/reference/ai/browser-speech-package-authority.json +835 -0
  18. package/docs/reference/ai/browser-speech.md +1162 -246
  19. package/docs/reference/ai/browser-wasm.md +18 -7
  20. package/docs/reference/availability-and-normalization.md +6 -3
  21. package/docs/reference/behavioral-testing.md +29 -6
  22. package/docs/reference/cli.md +117 -9
  23. package/docs/reference/core/arcane-ai-contracts.md +1 -1
  24. package/docs/reference/event-manager.md +577 -32
  25. package/docs/reference/inventory/package-api.json +478 -2
  26. package/docs/reference/inventory/runtime-components.json +108 -44
  27. package/docs/reference/inventory/runtime-modules.json +131 -53
  28. package/docs/reference/mail.md +316 -0
  29. package/docs/reference/protocols.md +157 -43
  30. package/docs/reference/runtime-components.md +258 -83
  31. package/docs/reference/runtime-modules.md +613 -77
  32. package/docs/reference/sdk-api.md +1014 -25
  33. package/package.json +5 -4
  34. package/runtime/ARCANE_RUNTIME_RELEASE.json +145 -140
  35. package/runtime/arcane/components/app-bar.html +34 -13
  36. package/runtime/arcane/components/assistant-panel.html +110 -57
  37. package/runtime/arcane/components/calculator.html +7 -4
  38. package/runtime/arcane/components/chart.html +58 -17
  39. package/runtime/arcane/components/chat.html +606 -136
  40. package/runtime/arcane/components/conversation-view.html +13 -6
  41. package/runtime/arcane/components/dashboard-config.html +96 -59
  42. package/runtime/arcane/components/data-maintenance.html +69 -14
  43. package/runtime/arcane/components/data-view.html +53 -7
  44. package/runtime/arcane/components/directory-picker.html +118 -32
  45. package/runtime/arcane/components/document-inspector.html +47 -10
  46. package/runtime/arcane/components/file-drop.html +81 -35
  47. package/runtime/arcane/components/file-inspector.html +72 -22
  48. package/runtime/arcane/components/file-manager.html +374 -79
  49. package/runtime/arcane/components/integration-settings.html +12 -5
  50. package/runtime/arcane/components/local-ai-status.html +48 -19
  51. package/runtime/arcane/components/markdown-document.html +161 -68
  52. package/runtime/arcane/components/markdown-editor.html +110 -33
  53. package/runtime/arcane/components/media-embed.html +8 -5
  54. package/runtime/arcane/components/modal.html +15 -5
  55. package/runtime/arcane/components/output-panel.html +28 -23
  56. package/runtime/arcane/components/preferences-form.html +22 -4
  57. package/runtime/arcane/components/record-timeline.html +18 -2
  58. package/runtime/arcane/components/relationship-board.html +23 -3
  59. package/runtime/arcane/components/screen-capture.html +10 -4
  60. package/runtime/arcane/components/source-code-viewer.html +76 -9
  61. package/runtime/arcane/components/source-explanation.html +23 -3
  62. package/runtime/arcane/components/speech.html +462 -384
  63. package/runtime/arcane/components/summary-strip.html +22 -11
  64. package/runtime/arcane/components/table.html +39 -21
  65. package/runtime/arcane/components/task-progress.html +79 -21
  66. package/runtime/arcane/components/terminal-workspace.html +7 -4
  67. package/runtime/arcane/components/theme-editor.html +7 -3
  68. package/runtime/arcane/components/unified-inbox.html +9 -4
  69. package/runtime/arcane/components/voice-transcription.html +639 -98
  70. package/runtime/arcane/components/weather-widget.html +5 -3
  71. package/runtime/arcane/components/web-navigator.html +48 -8
  72. package/runtime/arcane/entities/Chat.js +1 -1
  73. package/runtime/arcane/entities/User.js +110 -23
  74. package/runtime/arcane/modules/AI.js +2109 -130
  75. package/runtime/arcane/modules/AIProviderRuntime.js +720 -13
  76. package/runtime/arcane/modules/AIRuntimeState.js +109 -52
  77. package/runtime/arcane/modules/ApiModelDatabase.js +390 -17
  78. package/runtime/arcane/modules/BrowserTestSuite.js +205 -28
  79. package/runtime/arcane/modules/CalculatorEngine.js +63 -3
  80. package/runtime/arcane/modules/CommunicationAppController.js +588 -28
  81. package/runtime/arcane/modules/CommunicationHub.js +590 -10
  82. package/runtime/arcane/modules/ComponentContracts.js +470 -0
  83. package/runtime/arcane/modules/ConversationTimebox.js +152 -33
  84. package/runtime/arcane/modules/DBLS.js +40 -7
  85. package/runtime/arcane/modules/DBOPFS.js +35 -11
  86. package/runtime/arcane/modules/DataMaintenance.js +12 -2
  87. package/runtime/arcane/modules/Errors.js +65 -7
  88. package/runtime/arcane/modules/HTMLImport.js +198 -14
  89. package/runtime/arcane/modules/LocalAIReadinessController.js +208 -29
  90. package/runtime/arcane/modules/Mail.js +738 -115
  91. package/runtime/arcane/modules/MailOutbox.mjs +1395 -0
  92. package/runtime/arcane/modules/MailTransport.mjs +197 -39
  93. package/runtime/arcane/modules/Ollama.js +36 -1
  94. package/runtime/arcane/modules/OpenMeteoWeatherProvider.js +583 -7
  95. package/runtime/arcane/modules/PreferenceStore.js +367 -33
  96. package/runtime/arcane/modules/RecordReviewStore.js +322 -23
  97. package/runtime/arcane/modules/ScreenCapture.js +1397 -15
  98. package/runtime/arcane/modules/SpeechPlayback.js +438 -41
  99. package/runtime/arcane/modules/TerminalClient.js +277 -12
  100. package/runtime/arcane/modules/ThemeBootstrap.js +80 -6
  101. package/runtime/arcane/modules/ThemeManager.js +39 -7
  102. package/runtime/arcane/modules/TimeGuard.js +131 -20
  103. package/runtime/arcane/modules/WaitForComponent.js +386 -33
  104. package/schemas/arcane-lock.schema.json +2 -2
  105. package/src/cli/main.mjs +435 -9
  106. package/src/event-manager.mjs +1097 -1
  107. package/src/import-map.mjs +21 -3
  108. package/src/index.mjs +13 -0
  109. package/src/installed-sdk-runtime.mjs +112 -0
  110. package/src/mail-api.mjs +22 -0
  111. package/src/mail-credentials.mjs +667 -0
  112. package/src/mail-server.mjs +1769 -0
  113. package/src/mail.mjs +261 -0
  114. package/src/sdk-browser-runtime.mjs +85 -41
  115. package/src/testing-loader.mjs +7 -0
  116. package/src/toolchain.mjs +3 -0
  117. package/src/workspace.mjs +1 -1
@@ -17,7 +17,7 @@ This table is the Node `package.json#exports` map: it defines package
17
17
  entrypoints for SDK/tooling code. It is distinct from the generated browser
18
18
  import map that resolves application-facing `arcane/*` modules and the focused
19
19
  EventManager entry. See [browser runtime delivery](protocols.md#browser-runtime-delivery)
20
- for that 91-entry physical-runtime contract in SDK `0.2.1`.
20
+ for the installed-inventory-derived physical-runtime contract in SDK `0.3.0`.
21
21
 
22
22
  | Specifier | Purpose |
23
23
  | --- | --- |
@@ -34,6 +34,7 @@ for that 91-entry physical-runtime contract in SDK `0.2.1`.
34
34
  | `arcane-os/event-manager` | Central synchronous events, bounded time-travel history, playback, and optional DOM instrumentation. |
35
35
  | `arcane-os/ai/browser-wasm` | Caller-selected browser-local Wllama inference, configurable DBOPFS model checks, streaming, cancellation, and structural tool-call results. |
36
36
  | `arcane-os/ai/browser-speech` | Caller-selected browser-local Whisper STT and Kokoro TTS provider mechanisms, authenticated DBOPFS artifacts, Workers, and cancellation; no model or adapter bytes. |
37
+ | `arcane-os/mail` | Portable Mail runtime, durable outbox, bounded transport, and provider-neutral acceptance contracts. |
37
38
 
38
39
  JSON schemas, the runtime manifest, and `package.json` are data-only export subpaths. In Node ESM, import JSON with `with {type: 'json'}`, or resolve and read it explicitly.
39
40
 
@@ -47,11 +48,14 @@ Protocol mechanics are intentionally kept in the [deep protocol guide](protocols
47
48
 
48
49
  ## Canonical member inventory
49
50
 
50
- SDK `0.2.1` exports exactly 169 distinct JavaScript members across 13
51
- JavaScript entrypoints. The complete export map has 23 subpaths: the other 10
52
- are the runtime manifest, eight JSON Schemas, and package metadata. Runtime
53
- projection modules in the managed browser map are cataloged separately in
54
- [Runtime modules](runtime-modules.md).
51
+ The current JavaScript member total is derived mechanically from every `.mjs`
52
+ entrypoint in `package.json#exports`. Records are grouped by export name and
53
+ `Object.is()` binding identity, then retain the sorted entrypoints that expose
54
+ that binding; `memberCount` in
55
+ [`inventory/package-api.json`](inventory/package-api.json) is the resulting
56
+ graph-node count. The remaining data-only subpaths are the runtime manifest,
57
+ JSON Schemas, and package metadata. Runtime projection modules in the managed
58
+ browser map are cataloged separately in [Runtime modules](runtime-modules.md).
55
59
 
56
60
  | Member | Kind | Import | Group | Availability |
57
61
  | --- | --- | --- | --- | --- |
@@ -90,6 +94,7 @@ projection modules in the managed browser map are cataloged separately in
90
94
  | `authenticateSharedPayloadSnapshot()` | function | `arcane-os` | Packaging and release bundles | Node |
91
95
  | `buildApplication()` | function | `arcane-os` | Headless toolchain operations | Node; selected operation may produce browser or native output |
92
96
  | `buildTarget()` | function | `arcane-os` | Targets, native plans, and providers | Node; selected browser/native target or provider as documented |
97
+ | `BROWSER_SPEECH_ARTIFACT_GRAPH_PROTOCOL` | constant | `arcane-os/ai/browser-speech` | Browser speech providers | Browser metadata; graph construction starts no fetch, cache, Worker, provider, or event operation |
93
98
  | `BROWSER_SPEECH_ARTIFACT_PROTOCOL` | constant | `arcane-os/ai/browser-speech` | Browser speech providers | Browser metadata; model/runtime use requires DBOPFS, Web Locks, Workers, and caller-supplied immutable artifacts |
94
99
  | `BROWSER_WASM_RUNTIME_AUTHORITY` | constant | `arcane-os/ai/browser-wasm` | Browser-WASM local AI | Browser metadata; no model or DBOPFS required to inspect |
95
100
  | `bumpVersion()` | function | `arcane-os/packager` | Packaging and release bundles | Node |
@@ -102,6 +107,7 @@ projection modules in the managed browser map are cataloged separately in
102
107
  | `createAppReleaseBundle()` | function | `arcane-os` | Packaging and release bundles | Node |
103
108
  | `createBrowserKokoroProvider()` | function | `arcane-os/ai/browser-speech` | Browser speech providers | Browser with DBOPFS, Web Locks, Workers, object URLs, and caller-admitted Kokoro runtime/model artifacts |
104
109
  | `createBrowserModelSource()` | function | `arcane-os/ai/browser-wasm` | Browser-WASM local AI | Browser Fetch with a readable response body |
110
+ | `createBrowserSpeechArtifactGraph()` | function | `arcane-os/ai/browser-speech` | Browser speech providers | Browser metadata; construction starts no fetch, cache, Worker, provider, or event operation |
105
111
  | `createBrowserSpeechAuthority()` | function | `arcane-os/ai/browser-speech` | Browser speech providers | Browser descriptor construction; use requires the selected storage and provider Web APIs |
106
112
  | `createBrowserWasmLlmProvider()` | function | `arcane-os/ai/browser-wasm` | Browser-WASM local AI | Browser secure context with WebAssembly, OPFS/DBOPFS, WebGPU, and admitted full-offload evidence; no CPU fallback |
107
113
  | `createBrowserWhisperProvider()` | function | `arcane-os/ai/browser-speech` | Browser speech providers | Browser with DBOPFS, Web Locks, Workers, object URLs, and caller-admitted Whisper runtime/model artifacts |
@@ -139,6 +145,7 @@ projection modules in the managed browser map are cataloged separately in
139
145
  | `loadArcaneNativeProvider()` | function | `arcane-os` | Targets, native plans, and providers | Node; selected browser/native target or provider as documented |
140
146
  | `loadArcanePortableProvider()` | function | `arcane-os` | Targets, native plans, and providers | Node; selected browser/native target or provider as documented |
141
147
  | `loadRuntimeRelease()` | function | `arcane-os` | Runtime and app descriptors | Node |
148
+ | `materializeInstalledSdkRuntime()` | function | `arcane-os` | Runtime and app descriptors | Node |
142
149
  | `NATIVE_BUILD_PLAN_PROTOCOL` | constant | `arcane-os` | Targets, native plans, and providers | Node; selected browser/native target or provider as documented |
143
150
  | `NATIVE_BUILDER_PROTOCOL` | constant | `arcane-os` | Targets, native plans, and providers | Node; selected browser/native target or provider as documented |
144
151
  | `normalizeError()` | function | `arcane-os` | Errors | Node |
@@ -204,6 +211,15 @@ projection modules in the managed browser map are cataloged separately in
204
211
  | `compareSdkVersions()` | function | `arcane-os` | Explicit SDK update checks | Node; on-demand CLI or maintainer check only |
205
212
  | `updateTagForVersion()` | function | `arcane-os` | Explicit SDK update checks | Node; on-demand CLI or maintainer check only |
206
213
  | `validateUpdateRegistry()` | function | `arcane-os` | Explicit SDK update checks | Node; on-demand CLI or maintainer check only |
214
+ | `ARCANE_EVENT_AUTHORITY_BRAND` | constant | `arcane-os/event-manager` | Central events, time travel, and DOM instrumentation | Node and browser/bundler |
215
+ | `ARCANE_EVENT_AUTHORITY_KIND` | constant | `arcane-os/event-manager` | Central events, time travel, and DOM instrumentation | Node and browser/bundler |
216
+ | `ARCANE_EVENT_AUTHORITY_PROTOCOL` | constant | `arcane-os/event-manager` | Central events, time travel, and DOM instrumentation | Node and browser/bundler |
217
+ | `ARCANE_EVENT_ERROR_CODES` | constant | `arcane-os/event-manager` | Central events, time travel, and DOM instrumentation | Node and browser/bundler |
218
+ | `ARCANE_EVENT_LISTENER_ERROR_EVENT` | constant | `arcane-os/event-manager` | Central events, time travel, and DOM instrumentation | Node and browser/bundler |
219
+ | `ARCANE_EVENT_OCCURRENCE_PROTOCOL` | constant | `arcane-os/event-manager` | Central events, time travel, and DOM instrumentation | Node and browser/bundler |
220
+ | `ARCANE_EVENT_SOURCE_DISPOSED_EVENT` | constant | `arcane-os/event-manager` | Central events, time travel, and DOM instrumentation | Node and browser/bundler |
221
+ | `ARCANE_EVENT_SOURCE_KIND` | constant | `arcane-os/event-manager` | Central events, time travel, and DOM instrumentation | Node and browser/bundler |
222
+ | `ARCANE_EVENT_SOURCE_PROTOCOL` | constant | `arcane-os/event-manager` | Central events, time travel, and DOM instrumentation | Node and browser/bundler |
207
223
  | `ARCANE_EVENT_STACK_PROTOCOL` | constant | `arcane-os/event-manager` | Central events, time travel, and DOM instrumentation | Node and browser/bundler |
208
224
  | `DEFAULT_DOM_EVENT_TYPES` | constant | `arcane-os/event-manager` | Central events, time travel, and DOM instrumentation | Node and browser/bundler; meaningful to browser DOM instrumentation |
209
225
  | `DOM_INTERACTION_EVENT` | constant | `arcane-os/event-manager` | Central events, time travel, and DOM instrumentation | Browser DOM or a DOM-compatible test host; constant imports in Node |
@@ -219,11 +235,30 @@ projection modules in the managed browser map are cataloged separately in
219
235
  | `TIME_TRAVEL_OVERFLOW_EVENT` | constant | `arcane-os/event-manager` | Central events, time travel, and DOM instrumentation | Node and browser/bundler |
220
236
  | `TIME_TRAVEL_SEEK_EVENT` | constant | `arcane-os/event-manager` | Central events, time travel, and DOM instrumentation | Node and browser/bundler |
221
237
  | `arcaneEvents` | singleton | `arcane-os/event-manager` | Central events, time travel, and DOM instrumentation | Node and browser/bundler; DOM capture requires a compatible DOM |
238
+ | `createArcaneEventSource()` | function | `arcane-os/event-manager` | Central events, time travel, and DOM instrumentation | Node and browser/bundler |
222
239
  | `createDOMInstrumentation()` | function | `arcane-os/event-manager` | Central events, time travel, and DOM instrumentation | Browser DOM or a DOM-compatible test host |
223
240
  | `createEventManager()` | function | `arcane-os/event-manager` | Central events, time travel, and DOM instrumentation | Node and browser/bundler; DOM capture requires a compatible DOM |
224
241
  | `describeDOMTarget()` | function | `arcane-os/event-manager` | Central events, time travel, and DOM instrumentation | Browser DOM or DOM-compatible objects; importable in Node |
225
242
  | `domSelector()` | function | `arcane-os/event-manager` | Central events, time travel, and DOM instrumentation | Browser DOM or DOM-compatible objects; importable in Node |
243
+ | `isArcaneEventOccurrence()` | function | `arcane-os/event-manager` | Central events, time travel, and DOM instrumentation | Node and browser/bundler |
226
244
  | `parseEventStack()` | function | `arcane-os/event-manager` | Central events, time travel, and DOM instrumentation | Node and browser/bundler |
245
+ | `projectArcaneDOMEvent()` | function | `arcane-os/event-manager` | Central events, time travel, and DOM instrumentation | Browser DOM or a DOM-compatible test host |
246
+ | `DEFAULT_MAIL_REQUEST_TIMEOUT_MS` | constant | `arcane-os/mail` | Portable Mail | Node and browser with Fetch and AbortController for transport use |
247
+ | `MAIL_OUTBOX_ACCEPTANCE_AUTHORITIES` | constant | `arcane-os/mail` | Portable Mail | Node and browser metadata |
248
+ | `MAIL_OUTBOX_IDEMPOTENCY_WINDOW_MS` | constant | `arcane-os/mail` | Portable Mail | Node and browser metadata |
249
+ | `MAIL_OUTBOX_PROTOCOL` | constant | `arcane-os/mail` | Portable Mail | Node and browser metadata |
250
+ | `MAIL_OUTBOX_STATES` | constant | `arcane-os/mail` | Portable Mail | Node and browser metadata |
251
+ | `MAIL_OUTBOX_TABLE` | constant | `arcane-os/mail` | Portable Mail | Node and browser metadata |
252
+ | `MAX_MAIL_RESPONSE_BYTES` | constant | `arcane-os/mail` | Portable Mail | Node and browser metadata |
253
+ | `Mail` | class | `arcane-os/mail` | Portable Mail | Node with injected host adapters, or browser/native WebView with durable storage and Web Locks |
254
+ | `MailOutbox` | class | `arcane-os/mail` | Portable Mail | Node or browser with injected DBOPFS-compatible storage and a Web Locks-compatible lock manager |
255
+ | `MailTransportError` | class | `arcane-os/mail` | Portable Mail | Node and browser |
256
+ | `createMailOutbox()` | function | `arcane-os/mail` | Portable Mail | Node or browser with the required injected outbox adapters |
257
+ | `Mail default export` | class | `arcane-os/mail` | Portable Mail | Node with injected host adapters, or browser/native WebView with durable storage and Web Locks |
258
+ | `normalizeMailEndpoint()` | function | `arcane-os/mail` | Portable Mail | Node and browser with URL support; relative endpoints require an explicit or global base URL |
259
+ | `resolveMailConfig()` | function | `arcane-os/mail` | Portable Mail | Node with explicit configuration, or browser/native WebView with optional document and location defaults |
260
+ | `sendMailReport()` | function | `arcane-os/mail` | Portable Mail | Node and browser with Fetch and AbortController, or an explicit fetch implementation |
261
+ | `serializeMailReport()` | function | `arcane-os/mail` | Portable Mail | Node and browser |
227
262
 
228
263
  # Packaging and release bundles
229
264
 
@@ -814,7 +849,7 @@ same deterministic map. The package root also contains the public
814
849
  {
815
850
  schemaVersion: 1,
816
851
  kind: 'arcane-app-runtime-projection',
817
- sdkVersion: '0.2.1',
852
+ sdkVersion: '0.3.0',
818
853
  pathPrefix: 'arcane/',
819
854
  fileCount,
820
855
  totalBytes,
@@ -1365,6 +1400,32 @@ async function useloadRuntimeRelease(...arguments_) {
1365
1400
  }
1366
1401
  ```
1367
1402
 
1403
+ ## materializeInstalledSdkRuntime()
1404
+
1405
+ ### Overview
1406
+
1407
+ Verifies the workspace's exact installed SDK runtime and browser runtime, then materializes their dynamic inventories.
1408
+
1409
+ ### Signature and result
1410
+
1411
+ ```text
1412
+ async materializeInstalledSdkRuntime({workspaceRoot,sdkPackageSource,signal,onEvent}={})
1413
+ ```
1414
+
1415
+ Import it from `arcane-os`. It resolves the workspace's exact installed SDK declaration, verifies both physical runtime receipts, materializes the authenticated runtime projection, and returns a frozen result containing the installation and all three receipts. Cancellation and progress remain caller-owned through `signal` and `onEvent`.
1416
+
1417
+ ### Availability and normalization
1418
+
1419
+ **Node.** Canonical workspace and installed-package identity, verified runtime receipts, and a frozen materialization result. Deep protocol: [Installed SDK runtime materialization](protocols.md).
1420
+
1421
+ ### Example
1422
+
1423
+ ```javascript
1424
+ import {materializeInstalledSdkRuntime} from 'arcane-os';
1425
+
1426
+ const result=await materializeInstalledSdkRuntime({workspaceRoot});
1427
+ ```
1428
+
1368
1429
  ## projectNativeDescriptor()
1369
1430
 
1370
1431
  ### Overview
@@ -2698,7 +2759,7 @@ The import-map operation also reports the stable operation-specific strings
2698
2759
  `ARCANE_IMPORT_MAP_COLLISION`; package assembly can additionally report
2699
2760
  `ARCANE_IMPORT_MAP_CLEANUP_FAILED`. They are normalized `ArcaneError.code`
2700
2761
  values, but are not properties added to this frozen general registry in SDK
2701
- `0.2.1`.
2762
+ `0.3.0`.
2702
2763
 
2703
2764
  ### Value and import
2704
2765
 
@@ -3364,7 +3425,7 @@ workspace it additionally returns the exact installed package authority:
3364
3425
  packageSource,
3365
3426
  canonicalPackageRoot,
3366
3427
  packageName: 'arcane-os',
3367
- packageVersion: '0.2.1',
3428
+ packageVersion: '0.3.0',
3368
3429
  runtimeRoot,
3369
3430
  browserRuntimeRoot,
3370
3431
  runtimeManifest,
@@ -3374,9 +3435,9 @@ workspace it additionally returns the exact installed package authority:
3374
3435
  ```
3375
3436
 
3376
3437
  The dependency can be named `arcane-os` or be one exact npm alias for
3377
- `npm:arcane-os@0.2.1`. The selected installation must still be one direct,
3438
+ `npm:arcane-os@0.3.0`. The selected installation must still be one direct,
3378
3439
  physical, non-link package directory whose manifest identifies exactly as
3379
- `arcane-os@0.2.1`; duplicate canonical/alias declarations fail closed.
3440
+ `arcane-os@0.3.0`; duplicate canonical/alias declarations fail closed.
3380
3441
  `allowMissingManagedImportMap` is an internal packaging/development seam. An
3381
3442
  ordinary caller should leave it `false`.
3382
3443
 
@@ -3553,7 +3614,7 @@ const toolchain = createToolchain({
3553
3614
 
3554
3615
  // Only this explicit call refreshes the managed map and configured HTML entry.
3555
3616
  const result = await toolchain.importMap();
3556
- console.log(result.importMap.entryCount); // 91 in SDK 0.2.1
3617
+ console.log(result.importMap.entryCount); // derived from installed inventories
3557
3618
  console.log(result.importMap.documentPaths, result.importMap.documentCount);
3558
3619
  ```
3559
3620
 
@@ -4851,28 +4912,467 @@ arcaneEvents.on(TIME_TRAVEL_SEEK_EVENT, ({sequence}) => {
4851
4912
 
4852
4913
  ### Overview
4853
4914
 
4854
- The package-scoped EventManager singleton exposed from both the package root and `arcane-os/event-manager`. It provides one shared bus when explicit per-subsystem ownership is unnecessary.
4915
+ The one SDK-owned synchronous semantic event authority in the current
4916
+ JavaScript realm. Module evaluation installs or reuses the exact branded value
4917
+ at `globalThis.arcaneEvents`; duplicate module URLs do not create another bus.
4918
+ Window, frame, worker, Node realm, and process boundaries remain distinct and
4919
+ have no automatic transport between them.
4855
4920
 
4856
4921
  ### Value and use
4857
4922
 
4858
4923
  ```text
4859
- const arcaneEvents = new EventManager()
4924
+ globalThis.arcaneEvents === arcaneEvents
4925
+ arcaneEvents.protocol === 'arcane-event-authority/1'
4926
+ arcaneEvents[Symbol.for('arcane-os.arcane-events-authority')]
4927
+ === 'arcane-event-authority/1'
4928
+ ```
4929
+
4930
+ The global is an own, non-enumerable, non-writable, non-configurable data
4931
+ property. Its brand and public protocol descriptors are immutable. An accessor,
4932
+ inherited or unbranded value, mismatched descriptor/protocol, incomplete API,
4933
+ or failed installation is rejected with its exact
4934
+ `ARCANE_EVENT_AUTHORITY_*` code; the SDK never replaces the collision.
4935
+
4936
+ Canonical subscription is
4937
+ `arcaneEvents.subscribe(type,handler,{once=false,signal}={})`. It returns an
4938
+ idempotent `unsubscribe` function with
4939
+ `unsubscribe.dispose === unsubscribe`. An already-aborted signal installs
4940
+ nothing; later abort removes the registration synchronously. `handler` receives
4941
+ one frozen `arcane-event-occurrence/1`, and wildcard subscription is not
4942
+ admitted.
4943
+
4944
+ The source factory signatures are:
4945
+
4946
+ ```text
4947
+ arcaneEvents.createSource(owner,{source,eventTypes,onListenerError?})
4948
+ createArcaneEventSource(owner,{source,eventTypes,onListenerError?})
4949
+ ```
4950
+
4951
+ The exported wrapper calls the authority method and returns the same frozen
4952
+ handle. One owner may have one active source. The handle exposes
4953
+ `protocol`, `descriptor`, `source`, `instanceId`, `eventTypes`, `disposed`,
4954
+ `subscribe`, `on`, `once`, `addEventListener`, `removeEventListener`,
4955
+ `dispatch`, `dispatchEvent`, `dispose`, and `destroy`.
4956
+ `onListenerError(error,errorOccurrence)` receives the raw listener failure and
4957
+ the canonical listener-error occurrence at the owner-local boundary;
4958
+ `errorOccurrence` is `null` only when that secondary publication could not be
4959
+ constructed.
4960
+
4961
+ `source.dispatch(type,compatibilityDetail,{operationId=null,publicDetail={},
4962
+ cancelable=false}={})` synchronously returns the frozen
4963
+ `{occurrence,accepted}` publication. The occurrence contains immutable
4964
+ `protocol`, `occurrenceId`, `type`, `source`, `instanceId`, `operationId`,
4965
+ privacy-admitted deeply frozen `detail`, `cancelable`, live
4966
+ `defaultPrevented`, and `preventDefault()`. Canonical listeners run before the
4967
+ source's EventTarget-compatible listeners. Cancellation is synchronous and only
4968
+ sets acceptance; the publisher decides whether to begin or continue domain work.
4969
+
4970
+ Listener promises are not awaited. The authority is not an async queue:
4971
+ operation-owned promises and `createEventQueue()` own async ordering,
4972
+ backpressure, cancellation, and failure. Listener exceptions are observational;
4973
+ they publish one privacy-safe `arcane.event.listener.error` occurrence with code
4974
+ `ARCANE_EVENT_LISTENER_CALLBACK_FAILED` and do not throw from committed source
4975
+ dispatch.
4976
+
4977
+ `ARCANE_EVENT_ERROR_CODES` is frozen and maps each stable key to that identical
4978
+ string value: `ARCANE_EVENT_AUTHORITY_ACCESSOR_COLLISION`,
4979
+ `ARCANE_EVENT_AUTHORITY_VALUE_COLLISION`,
4980
+ `ARCANE_EVENT_AUTHORITY_DESCRIPTOR_MISMATCH`,
4981
+ `ARCANE_EVENT_AUTHORITY_PROTOCOL_MISMATCH`,
4982
+ `ARCANE_EVENT_AUTHORITY_API_MISMATCH`,
4983
+ `ARCANE_EVENT_AUTHORITY_INSTALL_FAILED`, `ARCANE_EVENT_SOURCE_INVALID`,
4984
+ `ARCANE_EVENT_SOURCE_ALREADY_REGISTERED`, `ARCANE_EVENT_SOURCE_DISPOSED`,
4985
+ `ARCANE_EVENT_SOURCE_EVENT_TYPE_UNDECLARED`,
4986
+ `ARCANE_EVENT_COMPATIBILITY_DETAIL_INVALID`, `ARCANE_EVENT_OCCURRENCE_INVALID`,
4987
+ `ARCANE_EVENT_OCCURRENCE_SEQUENCE_EXHAUSTED`,
4988
+ `ARCANE_EVENT_SOURCE_SEQUENCE_EXHAUSTED`,
4989
+ `ARCANE_EVENT_LISTENER_CALLBACK_FAILED`, `ARCANE_EVENT_DOM_DETAIL_COLLISION`,
4990
+ `ARCANE_EVENT_DOM_TARGET_INVALID`, `ARCANE_EVENT_DOM_OPTIONS_INVALID`,
4991
+ `ARCANE_EVENT_SUBSCRIPTION_TYPE_INVALID`,
4992
+ `ARCANE_EVENT_SUBSCRIPTION_HANDLER_INVALID`,
4993
+ `ARCANE_EVENT_SUBSCRIPTION_OPTIONS_INVALID`,
4994
+ `ARCANE_EVENT_SUBSCRIPTION_SIGNAL_INVALID`, and
4995
+ `ARCANE_EVENT_DISPATCH_EVENT_INVALID`. Thrown authority failures expose the
4996
+ matching value as `error.code`; the listener callback code is carried by its
4997
+ observational error occurrence.
4998
+
4999
+ `projectArcaneDOMEvent(target,occurrence,{type,bubbles=false,composed=false,
5000
+ cancelable=occurrence.cancelable}={})` is a one-way compatibility projection.
5001
+ Its frozen detail carries `occurrenceId`, `arcaneSource`, `instanceId`, and
5002
+ `operationId`; it never republishes the DOM event. DOM cancellation propagates
5003
+ back to a cancelable occurrence. `isArcaneEventOccurrence(value)` recognizes
5004
+ only canonical occurrences and source compatibility views created by this
5005
+ realm's authority.
5006
+
5007
+ The first `source.dispose()`/`destroy()` publishes the final noncancelable
5008
+ `arcane.event.source.disposed` occurrence, removes source-owned listeners, frees
5009
+ the owner for a new source, and returns `true`; later or reentrant calls return
5010
+ `false`. The deprecated `aiRuntimeEvents` export is a frozen, state-free
5011
+ EventTarget compatibility view over the AIRuntimeState source, not another event
5012
+ owner.
5013
+
5014
+ ### Availability and normalization
5015
+
5016
+ **Node and browser/bundler, once per JavaScript realm; DOM projection requires
5017
+ `CustomEvent` and a target with `dispatchEvent`.** Canonical public detail is
5018
+ defensively snapshotted and deeply frozen. Rich compatibility detail remains
5019
+ owner-local and is shallow-frozen only when it is a plain record or array.
5020
+
5021
+ ### Example
5022
+
5023
+ ```javascript
5024
+ import {arcaneEvents, createArcaneEventSource} from 'arcane-os/event-manager';
5025
+
5026
+ const owner = {};
5027
+ const source = createArcaneEventSource(owner, {
5028
+ source:'sdk.operation',
5029
+ eventTypes:['sdk.operation.completed']
5030
+ });
5031
+ const unsubscribe = arcaneEvents.subscribe(
5032
+ 'sdk.operation.completed',
5033
+ occurrence => console.log(occurrence.detail.operationId)
5034
+ );
5035
+ source.dispatch(
5036
+ 'sdk.operation.completed',
5037
+ Object.freeze({operationId:'operation-1'}),
5038
+ {operationId:'operation-1', publicDetail:{operationId:'operation-1'}}
5039
+ );
5040
+ unsubscribe.dispose();
5041
+ source.dispose();
5042
+ ```
5043
+
5044
+ ## ARCANE_EVENT_AUTHORITY_BRAND
5045
+
5046
+ ### Overview
5047
+
5048
+ Global registry symbol that brands the one compatible Arcane event authority in
5049
+ a JavaScript realm.
5050
+
5051
+ ### Value and import
5052
+
5053
+ ```text
5054
+ const ARCANE_EVENT_AUTHORITY_BRAND
5055
+ ```
5056
+
5057
+ Its exact value is `Symbol.for('arcane-os.arcane-events-authority')`.
5058
+
5059
+ ### Availability and normalization
5060
+
5061
+ **Node and browser/bundler.** The brand property is immutable and
5062
+ non-enumerable. It is a compatibility marker, not transport or authenticity.
5063
+
5064
+ ### Example
5065
+
5066
+ ```javascript
5067
+ import {ARCANE_EVENT_AUTHORITY_BRAND,arcaneEvents} from 'arcane-os/event-manager';
5068
+ console.log(arcaneEvents[ARCANE_EVENT_AUTHORITY_BRAND]);
5069
+ ```
5070
+
5071
+ ## ARCANE_EVENT_AUTHORITY_KIND
5072
+
5073
+ ### Overview
5074
+
5075
+ Stable kind discriminator for the frozen authority descriptor.
5076
+
5077
+ ### Value and import
5078
+
5079
+ ```text
5080
+ const ARCANE_EVENT_AUTHORITY_KIND
5081
+ ```
5082
+
5083
+ Its exact value is `arcane-event-authority`.
5084
+
5085
+ ### Availability and normalization
5086
+
5087
+ **Node and browser/bundler.** Reading it creates no authority or listener.
5088
+
5089
+ ### Example
5090
+
5091
+ ```javascript
5092
+ import {ARCANE_EVENT_AUTHORITY_KIND,arcaneEvents} from 'arcane-os/event-manager';
5093
+ console.log(arcaneEvents.descriptor.kind===ARCANE_EVENT_AUTHORITY_KIND);
5094
+ ```
5095
+
5096
+ ## ARCANE_EVENT_AUTHORITY_PROTOCOL
5097
+
5098
+ ### Overview
5099
+
5100
+ Stable protocol discriminator for compatible per-realm event authorities.
5101
+
5102
+ ### Value and import
5103
+
5104
+ ```text
5105
+ const ARCANE_EVENT_AUTHORITY_PROTOCOL
5106
+ ```
5107
+
5108
+ Its exact value is `arcane-event-authority/1`.
5109
+
5110
+ ### Availability and normalization
5111
+
5112
+ **Node and browser/bundler.** An incompatible installed protocol fails closed
5113
+ and is never replaced or wrapped.
5114
+
5115
+ ### Example
5116
+
5117
+ ```javascript
5118
+ import {ARCANE_EVENT_AUTHORITY_PROTOCOL,arcaneEvents} from 'arcane-os/event-manager';
5119
+ console.log(arcaneEvents.protocol===ARCANE_EVENT_AUTHORITY_PROTOCOL);
5120
+ ```
5121
+
5122
+ ## ARCANE_EVENT_ERROR_CODES
5123
+
5124
+ ### Overview
5125
+
5126
+ Frozen registry of every stable canonical event-authority failure code.
5127
+
5128
+ ### Value and import
5129
+
5130
+ ```text
5131
+ const ARCANE_EVENT_ERROR_CODES
5132
+ ```
5133
+
5134
+ Every key maps to its identical string value; thrown authority failures expose
5135
+ the matching value as `error.code`.
5136
+
5137
+ ### Availability and normalization
5138
+
5139
+ **Node and browser/bundler.** The registry contains no mutable registration API
5140
+ or vague fallback code.
5141
+
5142
+ ### Example
5143
+
5144
+ ```javascript
5145
+ import {ARCANE_EVENT_ERROR_CODES} from 'arcane-os/event-manager';
5146
+ console.log(ARCANE_EVENT_ERROR_CODES.ARCANE_EVENT_SOURCE_DISPOSED);
5147
+ ```
5148
+
5149
+ ## ARCANE_EVENT_LISTENER_ERROR_EVENT
5150
+
5151
+ ### Overview
5152
+
5153
+ Canonical observational event emitted when an event listener throws.
5154
+
5155
+ ### Value and import
5156
+
5157
+ ```text
5158
+ const ARCANE_EVENT_LISTENER_ERROR_EVENT
5159
+ ```
5160
+
5161
+ Its exact value is `arcane.event.listener.error`.
5162
+
5163
+ ### Availability and normalization
5164
+
5165
+ **Node and browser/bundler.** Frozen public detail carries the exact failure code
5166
+ and source occurrence identifiers, never the raw error. Its shape is exactly
5167
+ `{code:'ARCANE_EVENT_LISTENER_CALLBACK_FAILED',reason:'listener-threw',
5168
+ eventType,occurrenceId,source,instanceId,operationId}`. Publication is
5169
+ synchronous and nonrecursive.
5170
+
5171
+ ### Example
5172
+
5173
+ ```javascript
5174
+ import {ARCANE_EVENT_LISTENER_ERROR_EVENT,arcaneEvents} from 'arcane-os/event-manager';
5175
+ const unsubscribe=arcaneEvents.subscribe(ARCANE_EVENT_LISTENER_ERROR_EVENT,console.log);
5176
+ ```
5177
+
5178
+ ## ARCANE_EVENT_OCCURRENCE_PROTOCOL
5179
+
5180
+ ### Overview
5181
+
5182
+ Stable protocol discriminator for immutable canonical occurrences.
5183
+
5184
+ ### Value and import
5185
+
5186
+ ```text
5187
+ const ARCANE_EVENT_OCCURRENCE_PROTOCOL
5188
+ ```
5189
+
5190
+ Its exact value is `arcane-event-occurrence/1`.
5191
+
5192
+ ### Availability and normalization
5193
+
5194
+ **Node and browser/bundler.** Occurrences are realm-owned identity values with
5195
+ deeply frozen public detail and synchronous cancellation state.
5196
+
5197
+ ### Example
5198
+
5199
+ ```javascript
5200
+ import {ARCANE_EVENT_OCCURRENCE_PROTOCOL} from 'arcane-os/event-manager';
5201
+ console.log(publication.occurrence.protocol===ARCANE_EVENT_OCCURRENCE_PROTOCOL);
5202
+ ```
5203
+
5204
+ ## ARCANE_EVENT_SOURCE_DISPOSED_EVENT
5205
+
5206
+ ### Overview
5207
+
5208
+ Final noncancelable occurrence published during a source's first disposal.
5209
+
5210
+ ### Value and import
5211
+
5212
+ ```text
5213
+ const ARCANE_EVENT_SOURCE_DISPOSED_EVENT
5214
+ ```
5215
+
5216
+ Its exact value is `arcane.event.source.disposed`.
5217
+
5218
+ ### Availability and normalization
5219
+
5220
+ **Node and browser/bundler.** Public detail is exactly
5221
+ `{reason:'source-disposed'}`. Delivery precedes source-listener cleanup;
5222
+ reentrant or later disposal publishes nothing and returns `false`.
5223
+
5224
+ ### Example
5225
+
5226
+ ```javascript
5227
+ import {ARCANE_EVENT_SOURCE_DISPOSED_EVENT} from 'arcane-os/event-manager';
5228
+ source.once(ARCANE_EVENT_SOURCE_DISPOSED_EVENT,console.log);
5229
+ source.dispose();
5230
+ ```
5231
+
5232
+ ## ARCANE_EVENT_SOURCE_KIND
5233
+
5234
+ ### Overview
5235
+
5236
+ Stable kind discriminator for frozen source descriptors.
5237
+
5238
+ ### Value and import
5239
+
5240
+ ```text
5241
+ const ARCANE_EVENT_SOURCE_KIND
5242
+ ```
5243
+
5244
+ Its exact value is `arcane-event-source`.
5245
+
5246
+ ### Availability and normalization
5247
+
5248
+ **Node and browser/bundler.** Reading it does not register or dispose a source.
5249
+
5250
+ ### Example
5251
+
5252
+ ```javascript
5253
+ import {ARCANE_EVENT_SOURCE_KIND} from 'arcane-os/event-manager';
5254
+ console.log(source.descriptor.kind===ARCANE_EVENT_SOURCE_KIND);
5255
+ ```
5256
+
5257
+ ## ARCANE_EVENT_SOURCE_PROTOCOL
5258
+
5259
+ ### Overview
5260
+
5261
+ Stable protocol discriminator for frozen source handles and descriptors.
5262
+
5263
+ ### Value and import
5264
+
5265
+ ```text
5266
+ const ARCANE_EVENT_SOURCE_PROTOCOL
5267
+ ```
5268
+
5269
+ Its exact value is `arcane-event-source/1`.
5270
+
5271
+ ### Availability and normalization
5272
+
5273
+ **Node and browser/bundler.** One handle belongs to one active owner in one
5274
+ realm and declares every publishable type before use.
5275
+
5276
+ ### Example
5277
+
5278
+ ```javascript
5279
+ import {ARCANE_EVENT_SOURCE_PROTOCOL} from 'arcane-os/event-manager';
5280
+ console.log(source.protocol===ARCANE_EVENT_SOURCE_PROTOCOL);
5281
+ ```
5282
+
5283
+ ## createArcaneEventSource()
5284
+
5285
+ ### Overview
5286
+
5287
+ Registers one active declared semantic source for a non-null object or function
5288
+ owner on the installed per-realm authority.
5289
+
5290
+ ### Signature and result
5291
+
5292
+ ```text
5293
+ createArcaneEventSource(owner, options)
5294
+ ```
5295
+
5296
+ `options` is the closed data record `{source,eventTypes,onListenerError?}`. The
5297
+ result is one frozen `arcane-event-source/1` handle with synchronous
5298
+ subscription, publication, cancellation admission, EventTarget compatibility,
5299
+ and idempotent disposal. A second active source for the same owner fails with
5300
+ `ARCANE_EVENT_SOURCE_ALREADY_REGISTERED`.
5301
+
5302
+ ### Availability and normalization
5303
+
5304
+ **Node and browser/bundler, within the current JavaScript realm.** The wrapper
5305
+ reuses `globalThis.arcaneEvents`; it creates no second bus, queue, Worker, or
5306
+ transport. Provider or host work remains owned by its own promise and signal.
5307
+
5308
+ ### Example
5309
+
5310
+ ```javascript
5311
+ import {createArcaneEventSource} from 'arcane-os/event-manager';
5312
+ const source=createArcaneEventSource({}, {
5313
+ source:'sdk.example',
5314
+ eventTypes:['sdk.example.completed']
5315
+ });
5316
+ source.dispose();
5317
+ ```
5318
+
5319
+ ## isArcaneEventOccurrence()
5320
+
5321
+ ### Overview
5322
+
5323
+ Recognizes canonical occurrences and source compatibility views created by the
5324
+ current realm's authority.
5325
+
5326
+ ### Signature and result
5327
+
5328
+ ```text
5329
+ isArcaneEventOccurrence(value)
4860
5330
  ```
4861
5331
 
4862
- The singleton starts with time travel disabled and no DOM instrumentation. Its listeners and history are process/module state, so tests should remove handlers and clear history they create. Full operational guidance: [central events, DOM instrumentation, and time-travel review](event-manager.md).
5332
+ Returns a boolean. Structurally similar or protocol-shaped foreign values return
5333
+ `false`.
4863
5334
 
4864
5335
  ### Availability and normalization
4865
5336
 
4866
- **Node and browser/bundler; DOM capture requires a compatible DOM.** It is the same ESM singleton across documented entrypoints in one module graph.
5337
+ **Node and browser/bundler, within the current JavaScript realm.** Recognition
5338
+ is synchronous and identity-based, with no parsing, cloning, or transport.
4867
5339
 
4868
5340
  ### Example
4869
5341
 
4870
5342
  ```javascript
4871
- import {arcaneEvents} from 'arcane-os/event-manager';
5343
+ import {isArcaneEventOccurrence} from 'arcane-os/event-manager';
5344
+ console.log(isArcaneEventOccurrence(publication.occurrence));
5345
+ ```
5346
+
5347
+ ## projectArcaneDOMEvent()
5348
+
5349
+ ### Overview
5350
+
5351
+ Projects one authority-created occurrence to one `CustomEvent` without
5352
+ republishing the DOM event into the canonical authority.
5353
+
5354
+ ### Signature and result
5355
+
5356
+ ```text
5357
+ projectArcaneDOMEvent(target, occurrence, options)
5358
+ ```
5359
+
5360
+ The result is the combined DOM/canonical acceptance boolean. Frozen projection
5361
+ detail adds the occurrence, canonical source, source instance, and operation
5362
+ identifiers while preserving a caller-owned compatibility `source`. A
5363
+ pre-cancelled occurrence skips DOM dispatch; DOM cancellation propagates only
5364
+ to a cancelable occurrence.
5365
+
5366
+ ### Availability and normalization
5367
+
5368
+ **Browser DOM or a DOM-compatible host with `CustomEvent` and
5369
+ `dispatchEvent`.** Projection is synchronous, state-free, and one-way.
5370
+
5371
+ ### Example
4872
5372
 
4873
- const handler = value => console.log(value);
4874
- arcaneEvents.on('status', handler).emit('status', 'ready');
4875
- arcaneEvents.off('status', handler);
5373
+ ```javascript
5374
+ import {projectArcaneDOMEvent} from 'arcane-os/event-manager';
5375
+ projectArcaneDOMEvent(button,publication.occurrence,{bubbles:true});
4876
5376
  ```
4877
5377
 
4878
5378
  ## createDOMInstrumentation()
@@ -5120,6 +5620,25 @@ visibility. It neither selects a provider fallback nor executes an application
5120
5620
  tool. Persistent sessions additionally require ChatEntity/DBOPFS in the
5121
5621
  managed browser runtime.
5122
5622
 
5623
+ `ai.llm.addEventListener(type,listener,options)` and
5624
+ `removeEventListener(type,listener,options)` are EventTarget compatibility
5625
+ views over `globalThis.arcaneEvents`; null/non-listener callbacks and event names
5626
+ other than `statechange` or `progress` are compatibility no-ops.
5627
+ `ai.llm.on(type,listener)` installs through that same view and returns
5628
+ one idempotent removal closure whose `.dispose` property is that same closure.
5629
+ The controller exposes no public `dispatchEvent()` and
5630
+ therefore does not let consumers forge lifecycle occurrences. Compatibility
5631
+ listeners receive the frozen full status as `event.detail` with the controller
5632
+ as `this`, `target`, and `currentTarget`. Canonical `statechange` and `progress`
5633
+ occurrences use source `ai-model-controller`; every load or unload owns one
5634
+ non-null operation ID shared by its state and progress occurrences. Public
5635
+ progress retains the exact admitted `modelId`, `phase`, `loaded`, `total`,
5636
+ `percent`, and nested file-progress field names rather
5637
+ than relabeling byte counts. Accessor-bearing provider status and malformed
5638
+ progress fail at admission with `ARCANE_AI_PROVIDER_STATUS_INVALID` and
5639
+ `ARCANE_AI_PROVIDER_PROGRESS_INVALID`. After disposal, lifecycle operations fail with
5640
+ `ARCANE_AI_DISPOSED`.
5641
+
5123
5642
  ### Example
5124
5643
 
5125
5644
  ```javascript
@@ -5368,7 +5887,7 @@ releaseProvider();
5368
5887
 
5369
5888
  # Browser speech providers
5370
5889
 
5371
- `arcane-os/ai/browser-speech` exports exactly the five package members below.
5890
+ `arcane-os/ai/browser-speech` exports exactly the seven package members below.
5372
5891
  It ships provider, authority, artifact-store, and Worker mechanisms but no
5373
5892
  Whisper/Kokoro model weights, adapter runtime bytes, voices, download URLs,
5374
5893
  default catalog, CDN loader, native bridge, or cloud fallback. The providers
@@ -5376,6 +5895,41 @@ implement `arcane-ai-provider/2`; the managed `arcane/AIProviderRuntime` and
5376
5895
  `arcane/AIRuntimeState` projection modules can normalize their independent
5377
5896
  role lifecycle and observation, but are not exports of this package subpath.
5378
5897
 
5898
+ ## BROWSER_SPEECH_ARTIFACT_GRAPH_PROTOCOL
5899
+
5900
+ ### Overview
5901
+
5902
+ Stable protocol identifier for an SDK-created authenticated browser speech
5903
+ artifact graph. It identifies one complete caller-owned runtime, model, and
5904
+ voice dependency graph; it grants no provider, model, runtime, voice, network,
5905
+ or license authority.
5906
+
5907
+ ### Value and import
5908
+
5909
+ ```text
5910
+ const BROWSER_SPEECH_ARTIFACT_GRAPH_PROTOCOL
5911
+ ```
5912
+
5913
+ Its exact value is `arcane-ai-browser-speech-artifact-graph/1`, and it is
5914
+ exported only by `arcane-os/ai/browser-speech`.
5915
+
5916
+ ### Availability and normalization
5917
+
5918
+ **Browser metadata; the ESM binding is importable in Node.** Reading the
5919
+ constant starts no fetch, cache, Worker, provider, or event operation. Actual
5920
+ artifact preparation and provider use require the selected browser storage and
5921
+ Worker capabilities.
5922
+
5923
+ ### Example
5924
+
5925
+ ```javascript
5926
+ import {
5927
+ BROWSER_SPEECH_ARTIFACT_GRAPH_PROTOCOL
5928
+ } from 'arcane-os/ai/browser-speech';
5929
+
5930
+ console.log(BROWSER_SPEECH_ARTIFACT_GRAPH_PROTOCOL);
5931
+ ```
5932
+
5379
5933
  ## BROWSER_SPEECH_ARTIFACT_PROTOCOL
5380
5934
 
5381
5935
  ### Overview
@@ -5409,13 +5963,68 @@ import {
5409
5963
  console.log(BROWSER_SPEECH_ARTIFACT_PROTOCOL);
5410
5964
  ```
5411
5965
 
5412
- ## createBrowserSpeechAuthority()
5966
+ ## createBrowserSpeechArtifactGraph()
5413
5967
 
5414
5968
  ### Overview
5415
5969
 
5416
- Validates and freezes one caller-owned Whisper STT or Kokoro TTS model/runtime
5417
- closure. The application owns every model, runtime, revision, URL, hash, voice,
5418
- license, and business-policy choice; the SDK supplies no artifact selection.
5970
+ Validates, canonicalizes, identifies, and freezes one complete caller-owned
5971
+ browser speech artifact graph. The caller declares every executable, WASM,
5972
+ model, and voice byte together with its immutable source identity, byte length,
5973
+ SHA-256 digest, license declaration, runtime route, dependency edge, transform,
5974
+ model/runtime identity, sample rate, and TTS default voice where applicable.
5975
+ The SDK selects none of those values.
5976
+
5977
+ ### Signature and result
5978
+
5979
+ ```text
5980
+ createBrowserSpeechArtifactGraph({ kind='browser-speech-authenticated-artifact-graph', identitySha256, providerId=null, role, model, runtime, files, edges, transforms }={})
5981
+ ```
5982
+
5983
+ `role` is exactly `stt` or `tts`; its model and runtime adapter fields must
5984
+ match that role. Every non-entry file must be reachable through the declared
5985
+ runtime, model, voice, or edge graph. Files are normalized into one unique
5986
+ path/source inventory with exact media types, positive byte lengths, lowercase
5987
+ SHA-256 values, immutable revisions, and explicitly admitted runtime routes.
5988
+ Unknown graph kinds, roles, adapters, paths, identities, files, edges,
5989
+ transforms, runtime routes, or voice policy fail closed with a concrete
5990
+ `artifact-graph-*` reason.
5991
+
5992
+ The result is one frozen
5993
+ `arcane-ai-browser-speech-artifact-graph/1` record containing
5994
+ `{kind,providerId,role,model,runtime,files,edges,transforms,identitySha256,
5995
+ artifactGraphStatus}`. `kind` and `runtime.moduleGraph` are exactly
5996
+ `browser-speech-authenticated-artifact-graph`; `artifactGraphStatus` is exactly
5997
+ `artifact-graph-descriptor-verified`. The SDK computes `identitySha256` from a
5998
+ canonical JSON projection. A supplied `identitySha256` is an assertion and must
5999
+ equal that computed value.
6000
+
6001
+ ### Availability and normalization
6002
+
6003
+ **Browser metadata; the ESM subpath is importable in Node.** Construction is
6004
+ synchronous and starts no fetch, cache, Worker, provider, or event operation.
6005
+ The graph is authority only because it was created and retained by this SDK
6006
+ realm; a structurally similar object is not admitted. Preparing and executing
6007
+ the graph requires the selected DBOPFS, Web Locks, Fetch, object URL, and Worker
6008
+ capabilities.
6009
+
6010
+ ### Example
6011
+
6012
+ ```javascript
6013
+ import {
6014
+ createBrowserSpeechArtifactGraph
6015
+ } from 'arcane-os/ai/browser-speech';
6016
+
6017
+ const graph = createBrowserSpeechArtifactGraph(callerOwnedGraphDescriptor);
6018
+ console.log(graph.identitySha256, graph.artifactGraphStatus);
6019
+ ```
6020
+
6021
+ ## createBrowserSpeechAuthority()
6022
+
6023
+ ### Overview
6024
+
6025
+ Validates and freezes one caller-owned Whisper STT or Kokoro TTS model/runtime
6026
+ closure. The application owns every model, runtime, revision, URL, hash, voice,
6027
+ license, and business-policy choice; the SDK supplies no artifact selection.
5419
6028
 
5420
6029
  ### Signature and result
5421
6030
 
@@ -5700,6 +6309,386 @@ async function synthesizeAfterUserChoice() {
5700
6309
  }
5701
6310
  ```
5702
6311
 
6312
+ # Portable Mail
6313
+
6314
+ The `arcane-os/mail` subpath is the dependency-free portable Mail boundary.
6315
+ Node credentials, Resend commands, and the loopback gateway remain toolchain
6316
+ and CLI responsibilities rather than browser-package exports.
6317
+
6318
+ ## DEFAULT_MAIL_REQUEST_TIMEOUT_MS
6319
+
6320
+ ### Overview
6321
+
6322
+ Default upper bound for one Mail HTTP request in milliseconds.
6323
+
6324
+ ### Value and import
6325
+
6326
+ ```text
6327
+ const DEFAULT_MAIL_REQUEST_TIMEOUT_MS
6328
+ ```
6329
+
6330
+ ### Availability and normalization
6331
+
6332
+ Node and browser with Fetch and AbortController. The immutable value is 590000.
6333
+
6334
+ ### Example
6335
+
6336
+ ```js
6337
+ import {DEFAULT_MAIL_REQUEST_TIMEOUT_MS} from 'arcane-os/mail';
6338
+ ```
6339
+
6340
+ ## MAIL_OUTBOX_ACCEPTANCE_AUTHORITIES
6341
+
6342
+ ### Overview
6343
+
6344
+ Frozen acceptance-authority allowlist for durable outbox delivery evidence.
6345
+
6346
+ ### Value and import
6347
+
6348
+ ```text
6349
+ const MAIL_OUTBOX_ACCEPTANCE_AUTHORITIES
6350
+ ```
6351
+
6352
+ ### Availability and normalization
6353
+
6354
+ Node and browser metadata. Acceptance means admitted provider or Core
6355
+ acceptance, not independent inbox delivery.
6356
+
6357
+ ### Example
6358
+
6359
+ ```js
6360
+ import {MAIL_OUTBOX_ACCEPTANCE_AUTHORITIES} from 'arcane-os/mail';
6361
+ ```
6362
+
6363
+ ## MAIL_OUTBOX_IDEMPOTENCY_WINDOW_MS
6364
+
6365
+ ### Overview
6366
+
6367
+ Duration for same-key retry before ambiguous delivery requires reconciliation.
6368
+
6369
+ ### Value and import
6370
+
6371
+ ```text
6372
+ const MAIL_OUTBOX_IDEMPOTENCY_WINDOW_MS
6373
+ ```
6374
+
6375
+ ### Availability and normalization
6376
+
6377
+ Node and browser metadata. The immutable value is 86400000 milliseconds.
6378
+
6379
+ ### Example
6380
+
6381
+ ```js
6382
+ import {MAIL_OUTBOX_IDEMPOTENCY_WINDOW_MS} from 'arcane-os/mail';
6383
+ ```
6384
+
6385
+ ## MAIL_OUTBOX_PROTOCOL
6386
+
6387
+ ### Overview
6388
+
6389
+ Stable protocol identifier written to durable Mail outbox records.
6390
+
6391
+ ### Value and import
6392
+
6393
+ ```text
6394
+ const MAIL_OUTBOX_PROTOCOL
6395
+ ```
6396
+
6397
+ ### Availability and normalization
6398
+
6399
+ Node and browser metadata. The immutable value is `arcane-mail-outbox/1`.
6400
+
6401
+ ### Example
6402
+
6403
+ ```js
6404
+ import {MAIL_OUTBOX_PROTOCOL} from 'arcane-os/mail';
6405
+ ```
6406
+
6407
+ ## MAIL_OUTBOX_STATES
6408
+
6409
+ ### Overview
6410
+
6411
+ Frozen ordered vocabulary for durable Mail outbox lifecycle states.
6412
+
6413
+ ### Value and import
6414
+
6415
+ ```text
6416
+ const MAIL_OUTBOX_STATES
6417
+ ```
6418
+
6419
+ ### Availability and normalization
6420
+
6421
+ Node and browser metadata. States are queued, sending, retry_wait, accepted,
6422
+ failed, and reconciliation_required.
6423
+
6424
+ ### Example
6425
+
6426
+ ```js
6427
+ import {MAIL_OUTBOX_STATES} from 'arcane-os/mail';
6428
+ ```
6429
+
6430
+ ## MAIL_OUTBOX_TABLE
6431
+
6432
+ ### Overview
6433
+
6434
+ Default DBOPFS-compatible table name for durable Mail outbox records.
6435
+
6436
+ ### Value and import
6437
+
6438
+ ```text
6439
+ const MAIL_OUTBOX_TABLE
6440
+ ```
6441
+
6442
+ ### Availability and normalization
6443
+
6444
+ Node and browser metadata. The immutable value is `mail_outbox`.
6445
+
6446
+ ### Example
6447
+
6448
+ ```js
6449
+ import {MAIL_OUTBOX_TABLE} from 'arcane-os/mail';
6450
+ ```
6451
+
6452
+ ## MAX_MAIL_RESPONSE_BYTES
6453
+
6454
+ ### Overview
6455
+
6456
+ Maximum response-body bytes admitted by the Mail HTTP transport.
6457
+
6458
+ ### Value and import
6459
+
6460
+ ```text
6461
+ const MAX_MAIL_RESPONSE_BYTES
6462
+ ```
6463
+
6464
+ ### Availability and normalization
6465
+
6466
+ Node and browser metadata. The immutable bound is 65536 bytes.
6467
+
6468
+ ### Example
6469
+
6470
+ ```js
6471
+ import {MAX_MAIL_RESPONSE_BYTES} from 'arcane-os/mail';
6472
+ ```
6473
+
6474
+ ## Mail
6475
+
6476
+ ### Overview
6477
+
6478
+ Owns the application Mail singleton, durable lifecycle, report normalization,
6479
+ and explicit transport selection.
6480
+
6481
+ ### Signature and result
6482
+
6483
+ ```text
6484
+ new Mail(config=globalThis.arcane?.config?.mail||{}, options={})
6485
+ ```
6486
+
6487
+ ### Availability and normalization
6488
+
6489
+ Node with injected host adapters, or browser/native WebView with durable
6490
+ storage and Web Locks. Reports persist before delivery and results are frozen.
6491
+
6492
+ ### Example
6493
+
6494
+ ```js
6495
+ import {Mail} from 'arcane-os/mail';
6496
+ const mail = new Mail({}, options);
6497
+ ```
6498
+
6499
+ ## MailOutbox
6500
+
6501
+ ### Overview
6502
+
6503
+ Owns durable FIFO delivery, retry classification, and invalid-record
6504
+ maintenance.
6505
+
6506
+ ### Signature and result
6507
+
6508
+ ```text
6509
+ new MailOutbox(options={})
6510
+ ```
6511
+
6512
+ ### Availability and normalization
6513
+
6514
+ Node or browser with injected DBOPFS-compatible storage and a Web
6515
+ Locks-compatible lock manager. Records and summaries are deeply frozen.
6516
+
6517
+ ### Example
6518
+
6519
+ ```js
6520
+ import {MailOutbox} from 'arcane-os/mail';
6521
+ const outbox = new MailOutbox(options);
6522
+ ```
6523
+
6524
+ ## MailTransportError
6525
+
6526
+ ### Overview
6527
+
6528
+ Normalized Mail transport failure with stable retry and uncertainty metadata.
6529
+
6530
+ ### Signature and result
6531
+
6532
+ ```text
6533
+ new MailTransportError(message, options={})
6534
+ ```
6535
+
6536
+ ### Availability and normalization
6537
+
6538
+ Node and browser. It exposes code, retryable, retryAfterMs, statusCode, and
6539
+ uncertain without unbounded remote detail.
6540
+
6541
+ ### Example
6542
+
6543
+ ```js
6544
+ import {MailTransportError} from 'arcane-os/mail';
6545
+ ```
6546
+
6547
+ ## createMailOutbox()
6548
+
6549
+ ### Overview
6550
+
6551
+ Creates a MailOutbox from caller-owned storage, locking, delivery, and
6552
+ lifecycle adapters.
6553
+
6554
+ ### Signature and result
6555
+
6556
+ ```text
6557
+ createMailOutbox(options)
6558
+ ```
6559
+
6560
+ ### Availability and normalization
6561
+
6562
+ Node or browser with the required injected adapters. The result is the same
6563
+ validated contract as direct MailOutbox construction.
6564
+
6565
+ ### Example
6566
+
6567
+ ```js
6568
+ import {createMailOutbox} from 'arcane-os/mail';
6569
+ const outbox = createMailOutbox(options);
6570
+ ```
6571
+
6572
+ ## Mail default export
6573
+
6574
+ ### Overview
6575
+
6576
+ Default package binding for the same Mail class exposed by the named export.
6577
+
6578
+ ### Signature and result
6579
+
6580
+ ```text
6581
+ default as Mail
6582
+ ```
6583
+
6584
+ ### Availability and normalization
6585
+
6586
+ Node with injected host adapters, or browser/native WebView with durable
6587
+ storage and Web Locks. Binding identity equals the named `Mail` export.
6588
+
6589
+ ### Example
6590
+
6591
+ ```js
6592
+ import Mail from 'arcane-os/mail';
6593
+ ```
6594
+
6595
+ ## normalizeMailEndpoint()
6596
+
6597
+ ### Overview
6598
+
6599
+ Resolves and validates one credential-free HTTPS or loopback-HTTP endpoint.
6600
+
6601
+ ### Signature and result
6602
+
6603
+ ```text
6604
+ normalizeMailEndpoint(endpoint, base=globalThis.location?.href)
6605
+ ```
6606
+
6607
+ ### Availability and normalization
6608
+
6609
+ Node and browser with URL support. Relative endpoints require a base;
6610
+ credentials, queries, fragments, and insecure non-loopback transport reject.
6611
+
6612
+ ### Example
6613
+
6614
+ ```js
6615
+ import {normalizeMailEndpoint} from 'arcane-os/mail';
6616
+ const endpoint = normalizeMailEndpoint('/v1/mail', location.href);
6617
+ ```
6618
+
6619
+ ## resolveMailConfig()
6620
+
6621
+ ### Overview
6622
+
6623
+ Resolves application identity, key, endpoint, and timeout without delivery.
6624
+
6625
+ ### Signature and result
6626
+
6627
+ ```text
6628
+ resolveMailConfig(config=globalThis.arcane?.config?.mail||{}, options={})
6629
+ ```
6630
+
6631
+ ### Availability and normalization
6632
+
6633
+ Node with explicit configuration, or browser/native WebView with optional
6634
+ document and location defaults. The returned configuration is frozen.
6635
+
6636
+ ### Example
6637
+
6638
+ ```js
6639
+ import {resolveMailConfig} from 'arcane-os/mail';
6640
+ const config = resolveMailConfig();
6641
+ ```
6642
+
6643
+ ## sendMailReport()
6644
+
6645
+ ### Overview
6646
+
6647
+ Sends one immutable Mail report with an idempotency key through bounded HTTP.
6648
+
6649
+ ### Signature and result
6650
+
6651
+ ```text
6652
+ sendMailReport({ appKey, appName, endpoint, fetchImpl=globalThis.fetch, report, reportKey, requestTimeout=590000, serializedReport, signal })
6653
+ ```
6654
+
6655
+ ### Availability and normalization
6656
+
6657
+ Node and browser with Fetch and AbortController, or an explicit fetch
6658
+ implementation. The response is bounded and normalized as acceptance or a
6659
+ `MailTransportError`.
6660
+
6661
+ ### Example
6662
+
6663
+ ```js
6664
+ import {sendMailReport} from 'arcane-os/mail';
6665
+ const result = await sendMailReport(options);
6666
+ ```
6667
+
6668
+ ## serializeMailReport()
6669
+
6670
+ ### Overview
6671
+
6672
+ Serializes one JSON-object Mail report for immutable body comparison.
6673
+
6674
+ ### Signature and result
6675
+
6676
+ ```text
6677
+ serializeMailReport(report)
6678
+ ```
6679
+
6680
+ ### Availability and normalization
6681
+
6682
+ Node and browser. Returns compact JSON and rejects non-object or
6683
+ non-serializable reports.
6684
+
6685
+ ### Example
6686
+
6687
+ ```js
6688
+ import {serializeMailReport} from 'arcane-os/mail';
6689
+ const body = serializeMailReport(report);
6690
+ ```
6691
+
5703
6692
  ## Data export subpaths
5704
6693
 
5705
6694
  The package also exposes the exact runtime manifest, eight JSON Schemas (including `arcane-os/schemas/event-stack.json`), and its package manifest. These are data contracts, not callable JavaScript members. See [schema and manifest contracts](../architecture.md) and the files under `schemas/`.