arcane-os 0.1.0-dev.5

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 (248) hide show
  1. package/CHANGELOG.md +154 -0
  2. package/COMMERCIAL-LICENSE.md +13 -0
  3. package/LICENSE +661 -0
  4. package/NOTICE +70 -0
  5. package/README.md +448 -0
  6. package/bin/arcane-test.mjs +741 -0
  7. package/bin/arcane.mjs +5 -0
  8. package/docs/architecture.md +234 -0
  9. package/docs/compatibility.md +36 -0
  10. package/docs/event-manager.md +166 -0
  11. package/docs/platform-targets.md +108 -0
  12. package/docs/publishing.md +203 -0
  13. package/docs/reference/README.md +117 -0
  14. package/docs/reference/arcane-ollama.md +288 -0
  15. package/docs/reference/availability-and-normalization.md +123 -0
  16. package/docs/reference/behavioral-testing.md +86 -0
  17. package/docs/reference/cli.md +569 -0
  18. package/docs/reference/core/README.md +62 -0
  19. package/docs/reference/core/arcane-ai-contracts.md +873 -0
  20. package/docs/reference/core/arcane-api.md +601 -0
  21. package/docs/reference/core/arcane-entities.md +65 -0
  22. package/docs/reference/core/arcane-events.md +134 -0
  23. package/docs/reference/core/ollama-module.md +181 -0
  24. package/docs/reference/core/reference/arcane-api/ai-and-ollama.md +1909 -0
  25. package/docs/reference/core/reference/arcane-api/applications-terminal-capabilities.md +1057 -0
  26. package/docs/reference/core/reference/arcane-api/core-and-events.md +320 -0
  27. package/docs/reference/core/reference/arcane-api/filesystem-storage-preferences-appearance.md +610 -0
  28. package/docs/reference/core/reference/arcane-api/namespaces.md +1157 -0
  29. package/docs/reference/core/reference/arcane-api/platform-installation-users-system.md +1423 -0
  30. package/docs/reference/core/reference/arcane-api/session-provisioning-diagnostics-development.md +315 -0
  31. package/docs/reference/event-manager.md +957 -0
  32. package/docs/reference/inventory/package-api.json +2632 -0
  33. package/docs/reference/inventory/runtime-components.json +934 -0
  34. package/docs/reference/inventory/runtime-entities.json +26 -0
  35. package/docs/reference/inventory/runtime-modules.json +1249 -0
  36. package/docs/reference/protocols.md +242 -0
  37. package/docs/reference/runtime-components.md +1098 -0
  38. package/docs/reference/runtime-entities.md +303 -0
  39. package/docs/reference/runtime-modules.md +2010 -0
  40. package/docs/reference/sdk-api.md +4901 -0
  41. package/docs/roadmap.md +79 -0
  42. package/docs/work-amplification.md +124 -0
  43. package/node_modules/event-pubsub/CHANGELOG.md +55 -0
  44. package/node_modules/event-pubsub/MIGRATION.md +70 -0
  45. package/node_modules/event-pubsub/README.md +363 -0
  46. package/node_modules/event-pubsub/SECURITY.md +37 -0
  47. package/node_modules/event-pubsub/index.js +141 -0
  48. package/node_modules/event-pubsub/licence +21 -0
  49. package/node_modules/event-pubsub/package.json +59 -0
  50. package/node_modules/strong-type/README.md +408 -0
  51. package/node_modules/strong-type/assets/strong-type-header.png +0 -0
  52. package/node_modules/strong-type/index.js +1151 -0
  53. package/node_modules/strong-type/licence +21 -0
  54. package/node_modules/strong-type/node.js +125 -0
  55. package/node_modules/strong-type/package.json +61 -0
  56. package/package.json +95 -0
  57. package/runtime/ARCANE_RUNTIME_RELEASE.json +791 -0
  58. package/runtime/arcane/components/app-bar.html +468 -0
  59. package/runtime/arcane/components/assistant-panel.html +715 -0
  60. package/runtime/arcane/components/calculator.html +8 -0
  61. package/runtime/arcane/components/chart.html +655 -0
  62. package/runtime/arcane/components/chat.html +1225 -0
  63. package/runtime/arcane/components/conversation-view.html +13 -0
  64. package/runtime/arcane/components/dashboard-config.html +341 -0
  65. package/runtime/arcane/components/data-maintenance.html +112 -0
  66. package/runtime/arcane/components/data-view.html +92 -0
  67. package/runtime/arcane/components/directory-picker.html +197 -0
  68. package/runtime/arcane/components/document-inspector.html +252 -0
  69. package/runtime/arcane/components/file-drop.html +264 -0
  70. package/runtime/arcane/components/file-inspector.html +293 -0
  71. package/runtime/arcane/components/file-manager.html +1715 -0
  72. package/runtime/arcane/components/header.html +142 -0
  73. package/runtime/arcane/components/integration-settings.html +14 -0
  74. package/runtime/arcane/components/local-ai-status.html +360 -0
  75. package/runtime/arcane/components/markdown-document.html +1048 -0
  76. package/runtime/arcane/components/markdown-editor.html +360 -0
  77. package/runtime/arcane/components/media-embed.html +8 -0
  78. package/runtime/arcane/components/modal.html +402 -0
  79. package/runtime/arcane/components/output-panel.html +259 -0
  80. package/runtime/arcane/components/preferences-form.html +135 -0
  81. package/runtime/arcane/components/record-timeline.html +105 -0
  82. package/runtime/arcane/components/relationship-board.html +116 -0
  83. package/runtime/arcane/components/screen-capture.html +8 -0
  84. package/runtime/arcane/components/source-code-viewer.html +441 -0
  85. package/runtime/arcane/components/source-explanation.html +124 -0
  86. package/runtime/arcane/components/speech.html +365 -0
  87. package/runtime/arcane/components/summary-strip.html +177 -0
  88. package/runtime/arcane/components/table.html +77 -0
  89. package/runtime/arcane/components/task-progress.html +282 -0
  90. package/runtime/arcane/components/terminal-workspace.html +65 -0
  91. package/runtime/arcane/components/theme-editor.html +41 -0
  92. package/runtime/arcane/components/theme-switcher.html +46 -0
  93. package/runtime/arcane/components/unified-inbox.html +20 -0
  94. package/runtime/arcane/components/voice-transcription.html +476 -0
  95. package/runtime/arcane/components/weather-widget.html +8 -0
  96. package/runtime/arcane/components/web-navigator.html +239 -0
  97. package/runtime/arcane/css/communications.css +1 -0
  98. package/runtime/arcane/css/dashboard-config.css +45 -0
  99. package/runtime/arcane/css/document-site.css +981 -0
  100. package/runtime/arcane/css/layout.css +438 -0
  101. package/runtime/arcane/css/primitives.css +321 -0
  102. package/runtime/arcane/css/theme.css +112 -0
  103. package/runtime/arcane/css/utility-workspace.css +1 -0
  104. package/runtime/arcane/entities/ApiModelRecord.js +20 -0
  105. package/runtime/arcane/entities/Calculation.js +13 -0
  106. package/runtime/arcane/entities/Chat.js +581 -0
  107. package/runtime/arcane/entities/CommunicationMessage.js +29 -0
  108. package/runtime/arcane/entities/CommunicationThread.js +21 -0
  109. package/runtime/arcane/entities/Document.js +10 -0
  110. package/runtime/arcane/entities/File.js +143 -0
  111. package/runtime/arcane/entities/Image.js +135 -0
  112. package/runtime/arcane/entities/IntentEnvelope.js +834 -0
  113. package/runtime/arcane/entities/Preference.js +83 -0
  114. package/runtime/arcane/entities/TWiNPolicyDecision.js +1092 -0
  115. package/runtime/arcane/entities/TerminalSession.js +46 -0
  116. package/runtime/arcane/entities/Theme.js +107 -0
  117. package/runtime/arcane/entities/User.js +1046 -0
  118. package/runtime/arcane/entities/Weather.js +23 -0
  119. package/runtime/arcane/img/arcane-os-everywhere.png +0 -0
  120. package/runtime/arcane/img/arrow-left.png +0 -0
  121. package/runtime/arcane/img/arrow-right.png +0 -0
  122. package/runtime/arcane/img/doc.svg +5 -0
  123. package/runtime/arcane/img/folder.svg +4 -0
  124. package/runtime/arcane/img/image.svg +5 -0
  125. package/runtime/arcane/img/refresh.png +0 -0
  126. package/runtime/arcane/img/send.svg +9 -0
  127. package/runtime/arcane/img/trash.svg +5 -0
  128. package/runtime/arcane/img/upload.svg +5 -0
  129. package/runtime/arcane/modules/AI.js +2048 -0
  130. package/runtime/arcane/modules/AIPreferenceRuntime.js +32 -0
  131. package/runtime/arcane/modules/AIPreferenceTuple.js +92 -0
  132. package/runtime/arcane/modules/AIResponseLength.js +42 -0
  133. package/runtime/arcane/modules/AIResponseURLPolicy.js +626 -0
  134. package/runtime/arcane/modules/AnsiText.js +53 -0
  135. package/runtime/arcane/modules/ApiModelDatabase.js +25 -0
  136. package/runtime/arcane/modules/AppDataScope.js +245 -0
  137. package/runtime/arcane/modules/AppearancePreferences.js +28 -0
  138. package/runtime/arcane/modules/ArcaneCommunicationBridge.js +22 -0
  139. package/runtime/arcane/modules/ArcaneNavigationPolicy.js +135 -0
  140. package/runtime/arcane/modules/ArcaneNetworkPolicy.js +255 -0
  141. package/runtime/arcane/modules/AsyncBoundary.js +161 -0
  142. package/runtime/arcane/modules/BrowserTestSuite.js +326 -0
  143. package/runtime/arcane/modules/CalculatorEngine.js +20 -0
  144. package/runtime/arcane/modules/CaseEvidenceIndexer.js +134 -0
  145. package/runtime/arcane/modules/ChartLibrary.js +35 -0
  146. package/runtime/arcane/modules/ChatRecords.js +13 -0
  147. package/runtime/arcane/modules/CommunicationAppController.js +43 -0
  148. package/runtime/arcane/modules/CommunicationHub.js +16 -0
  149. package/runtime/arcane/modules/CommunicationPreferences.js +13 -0
  150. package/runtime/arcane/modules/CommunicationProviderRegistry.js +16 -0
  151. package/runtime/arcane/modules/ComponentContracts.js +586 -0
  152. package/runtime/arcane/modules/ConfiguredAIChatSession.js +288 -0
  153. package/runtime/arcane/modules/ConversationActionItems.js +488 -0
  154. package/runtime/arcane/modules/ConversationClosingReport.js +274 -0
  155. package/runtime/arcane/modules/ConversationTimebox.js +527 -0
  156. package/runtime/arcane/modules/CoreLocalModelCatalog.js +255 -0
  157. package/runtime/arcane/modules/DBLS.js +171 -0
  158. package/runtime/arcane/modules/DBOPFS.js +1154 -0
  159. package/runtime/arcane/modules/DBOPFSWorker.js +116 -0
  160. package/runtime/arcane/modules/DataMaintenance.js +91 -0
  161. package/runtime/arcane/modules/DevelopmentWorkspace.js +74 -0
  162. package/runtime/arcane/modules/DirectoryPicker.js +109 -0
  163. package/runtime/arcane/modules/DocumentNavigation.js +223 -0
  164. package/runtime/arcane/modules/Errors.js +1025 -0
  165. package/runtime/arcane/modules/GifEncoder.js +29 -0
  166. package/runtime/arcane/modules/HTMLImport.js +114 -0
  167. package/runtime/arcane/modules/InMemoryCommunicationProvider.js +14 -0
  168. package/runtime/arcane/modules/IsolatedModelQuestionRunner.js +275 -0
  169. package/runtime/arcane/modules/LocalAIReadiness.js +870 -0
  170. package/runtime/arcane/modules/LocalAIReadinessController.js +156 -0
  171. package/runtime/arcane/modules/MD.js +111 -0
  172. package/runtime/arcane/modules/Mail.js +352 -0
  173. package/runtime/arcane/modules/MailTransport.mjs +180 -0
  174. package/runtime/arcane/modules/Marked.min.js +71 -0
  175. package/runtime/arcane/modules/MemoryRecords.js +44 -0
  176. package/runtime/arcane/modules/MessageAdvisory.js +38 -0
  177. package/runtime/arcane/modules/ModelDefinition.js +189 -0
  178. package/runtime/arcane/modules/Ollama.js +74 -0
  179. package/runtime/arcane/modules/OllamaModelIdentifier.js +21 -0
  180. package/runtime/arcane/modules/OllamaSettings.js +24 -0
  181. package/runtime/arcane/modules/OpenMeteoWeatherProvider.js +14 -0
  182. package/runtime/arcane/modules/PreferenceStore.js +109 -0
  183. package/runtime/arcane/modules/QRCode.min.js +1 -0
  184. package/runtime/arcane/modules/Questionnaire.js +61 -0
  185. package/runtime/arcane/modules/RecordLinkIndex.js +24 -0
  186. package/runtime/arcane/modules/RecordPassageIndex.js +222 -0
  187. package/runtime/arcane/modules/RecordReviewStore.js +94 -0
  188. package/runtime/arcane/modules/RevocableProjectionLedger.js +1623 -0
  189. package/runtime/arcane/modules/RiskSignalAnalyzer.js +37 -0
  190. package/runtime/arcane/modules/ScamRiskPolicy.js +62 -0
  191. package/runtime/arcane/modules/ScopedOPFSCache.js +183 -0
  192. package/runtime/arcane/modules/ScreenCapture.js +20 -0
  193. package/runtime/arcane/modules/SpeechPlayback.js +581 -0
  194. package/runtime/arcane/modules/StaticDocumentCatalog.js +1248 -0
  195. package/runtime/arcane/modules/SystemAppearance.js +20 -0
  196. package/runtime/arcane/modules/SystemPlatformPresentation.js +51 -0
  197. package/runtime/arcane/modules/SystemToolRegistry.js +28 -0
  198. package/runtime/arcane/modules/TerminalClient.js +52 -0
  199. package/runtime/arcane/modules/TerminalCommandRegistry.js +50 -0
  200. package/runtime/arcane/modules/ThemeBootstrap.js +26 -0
  201. package/runtime/arcane/modules/ThemeManager.js +131 -0
  202. package/runtime/arcane/modules/TimeGuard.js +149 -0
  203. package/runtime/arcane/modules/ToolCallRouter.js +83 -0
  204. package/runtime/arcane/modules/WaitForComponent.js +102 -0
  205. package/runtime/arcane/modules/YouTubeMedia.js +16 -0
  206. package/runtime/arcane/modules/uPlot.LICENSE.txt +21 -0
  207. package/runtime/arcane/modules/uPlot.iife.min.js +2 -0
  208. package/runtime/arcane/modules/uPlot.min.css +1 -0
  209. package/runtime/arcane/security/arcane-network-policy.json +6 -0
  210. package/runtime/strong-type/index.js +352 -0
  211. package/runtime/strong-type/licence +21 -0
  212. package/runtime/strong-type/package.json +45 -0
  213. package/schemas/arcane-app-bundle.schema.json +125 -0
  214. package/schemas/arcane-app.schema.json +329 -0
  215. package/schemas/arcane-lock.schema.json +86 -0
  216. package/schemas/arcane-package.schema.json +224 -0
  217. package/schemas/cli-event.schema.json +122 -0
  218. package/schemas/event-stack.schema.json +152 -0
  219. package/schemas/native-build-plan.schema.json +176 -0
  220. package/schemas/target-adapter.schema.json +117 -0
  221. package/src/app-descriptor.mjs +500 -0
  222. package/src/cli/main.mjs +561 -0
  223. package/src/constants.mjs +31 -0
  224. package/src/dev-server.mjs +718 -0
  225. package/src/doctor.mjs +315 -0
  226. package/src/dom-event-instrumentation.mjs +594 -0
  227. package/src/errors.mjs +75 -0
  228. package/src/event-manager.mjs +1342 -0
  229. package/src/event-queue.mjs +138 -0
  230. package/src/events.mjs +219 -0
  231. package/src/index.mjs +177 -0
  232. package/src/integrated-provider-loader.mjs +432 -0
  233. package/src/native-plan.mjs +698 -0
  234. package/src/native-provider-loader.mjs +1126 -0
  235. package/src/packager/core.mjs +2691 -0
  236. package/src/process.mjs +353 -0
  237. package/src/release-bundle.mjs +2523 -0
  238. package/src/repository.mjs +90 -0
  239. package/src/runtime.mjs +452 -0
  240. package/src/scaffold.mjs +380 -0
  241. package/src/targets/index.mjs +436 -0
  242. package/src/templates/assets/app-icon.png +0 -0
  243. package/src/templates/workspace-template.mjs +388 -0
  244. package/src/testing-loader.mjs +9 -0
  245. package/src/testing.mjs +427 -0
  246. package/src/toolchain.mjs +1335 -0
  247. package/src/update-check.mjs +307 -0
  248. package/src/workspace.mjs +449 -0
package/bin/arcane.mjs ADDED
@@ -0,0 +1,5 @@
1
+ #!/usr/bin/env node
2
+
3
+ import {runCli} from '../src/cli/main.mjs';
4
+
5
+ process.exitCode=await runCli();
@@ -0,0 +1,234 @@
1
+ # Architecture
2
+
3
+ The CLI, future Arcane Developer graphical control panel, CI, and Codex all use
4
+ one headless operation API. A client selects a named operation and consumes the
5
+ same structured event stream; the GUI is not a second build system.
6
+
7
+ ```text
8
+ external app repository -----+
9
+ |
10
+ integrated Arcane checkout ---+-- CLI / future GUI / Codex / CI
11
+ |
12
+ shared toolchain API
13
+ |
14
+ browser package or explicit target adapter
15
+ ```
16
+
17
+ ## Workspace profiles
18
+
19
+ An external workspace maps the exact runtime shipped by its locked `arcane-os`
20
+ dependency. An integrated workspace maps the live `arcane/` and
21
+ `node_modules/strong-type` directories already owned by the Arcane checkout.
22
+ The development server and packager consume the same route destinations in
23
+ both cases, so app imports do not change. Integrated initialization creates
24
+ only app-owned files and never rewrites Arcane root configuration.
25
+
26
+ The shared/Core development profile is a separate integrated-only scope selected
27
+ with `--scope shared`. The SDK loads exactly
28
+ `tools/integrated-development-provider.mjs` from the selected Arcane checkout as
29
+ one process generation. That provider admits only one exact repository-relative
30
+ focused `.test.mjs` through Arcane's canonical focused runner or Arcane's
31
+ canonical development check. External workspaces cannot use the scope, and
32
+ shared operations never enter app discovery, packaging, target planning, build,
33
+ verification, or run paths. Provider bytes and filesystem identity are
34
+ authenticated before and after the owned child operation; a generation change
35
+ poisons that pairing and requires a new CLI process.
36
+ Integrated app testing remains isolated to the selected `apps/<id>/test/`
37
+ tree; it cannot recursively select Arcane root tests or another app's tests.
38
+ External repositories retain their existing workspace-root plus selected-app
39
+ test layout.
40
+
41
+ ## App and release contract
42
+
43
+ The first SDK version deliberately preserves Arcane's current repository-shaped
44
+ URLs and release schema:
45
+
46
+ ```text
47
+ apps/<id>/arcane-app.json
48
+ apps/<id>/arcane-package.json
49
+ apps/<id>/index.html
50
+ dist/<id>/ARCANE_APP_RELEASE.json
51
+ ```
52
+
53
+ The authored schema-2 descriptor is canonical for new apps and projects an
54
+ exact schema-1 `arcane-package.json` for current consumers. Existing Arcane
55
+ apps synthesize that descriptor from their schema-1 package plus the current
56
+ native registry during migration.
57
+
58
+ An external app's `arcane-packager.json` has three exact shared routes. They map the
59
+ installed SDK runtime to `/arcane`, its vendored strong-type dependency to
60
+ `/node_modules/strong-type`, and the SDK's `LICENSE`,
61
+ `COMMERCIAL-LICENSE.md`, and `NOTICE` to `/licenses/arcane-os`. The app does not
62
+ copy Arcane runtime source into its repository.
63
+
64
+ Release schema 1 and builder identity `arcane-app-packager-v1` remain unchanged
65
+ because current Arcane native admission treats them as exact contracts. Native
66
+ builders authenticate the schema-2 descriptor digest as a
67
+ separate build input while exact v1 host artifacts remain unchanged.
68
+
69
+ External repository delivery adds a distinct schema-1
70
+ `arcane-app-release-bundle` envelope. Bundle creation accepts only a
71
+ process-authenticated release receipt whose descriptor authority was an authored
72
+ schema-2 `arcane-app.json`; a synthesized legacy descriptor remains valid for
73
+ integrated packaging but cannot cross the external admission boundary. The
74
+ archive contains exactly `ARCANE_APP_BUNDLE.json`, canonical `arcane-app.json`,
75
+ `payload/ARCANE_APP_RELEASE.json`, and the release inventory beneath `payload/`
76
+ in that order. The envelope adds no repository-only source or build tooling
77
+ beyond that authenticated release inventory. Individual apps remain responsible
78
+ for leak/source policy, and Arcane's source-free runtime gates remain separate.
79
+
80
+ The byte contract is deterministic USTAR with regular 0644 files, zero owner
81
+ ids and modification times, canonical UTF-8 paths and headers, exact zero
82
+ padding, and exactly two terminal blocks, wrapped in one deterministic gzip
83
+ member. NFC inventory paths use raw UTF-8 byte order, not host locale collation;
84
+ the packager, bundle verifier, and Arcane importer share that ordering, while a
85
+ pinned golden bundle digest runs across the supported Node and runner matrix.
86
+
87
+ Verification parses the expanded stream without extraction, applies absolute
88
+ size/cardinality and expansion-ratio ceilings, recompresses the stream to
89
+ require the exact gzip encoding, and rejects appended bytes or concatenated
90
+ members. Every source control, payload, staged archive, and verification input
91
+ is opened no-follow as a single-link regular file, consumed at its recorded
92
+ length with an EOF growth probe, and rechecked by handle and pathname identity.
93
+ Every cumulative path prefix has one case-folded spelling and one file/directory
94
+ kind; prefix topology conflicts and the complete portable Windows device-name
95
+ set fail before creation or admission.
96
+ The current SDK admits only the explicitly compatible `0.1.0-dev.5` bundle
97
+ generation and rejects zero-byte payload releases.
98
+
99
+ Promotion retains any prior output as an identity-bound backup until the new
100
+ pathname has passed a second exact-length digest and single-link identity check
101
+ and its immutable receipt is bound. Pre-commit failure restores that backup
102
+ only when both the promoted pathname and prior backup retain their respective
103
+ full recorded identity tuples, pinned by their open handles. A replaced or
104
+ in-place-changed output is never removed during rollback; it and the prior
105
+ backup remain available for inspection. A missing or changed backup likewise
106
+ causes rollback to preserve the valid promoted output rather than delete it.
107
+ Post-commit backup or
108
+ nonce-bound lock cleanup failure is surfaced as degraded cleanup and preserves
109
+ the uncertain path for inspection. The receipt exposes
110
+ artifact digest/bytes, descriptor canonical/file/package digests and bytes, and
111
+ release manifest/policy/content digests, file count, and total payload bytes.
112
+ These hashes prove internal consistency. Repository provenance or an
113
+ independent signature plus an Arcane-owned authorization lock remains the
114
+ separate installation authority.
115
+
116
+ The reusable app-release workflow keeps caller checks and adapters in a
117
+ `contents: read` build job. A fresh unprivileged job downloads the immutable
118
+ upload by artifact id, checks the requested app id and complete identity with the
119
+ exact called-workflow SDK, and alone supplies reusable outputs. Its conditional
120
+ attestation job redownloads the same artifact id, repeats those checks against
121
+ the post-upload outputs, and directly imports the dependency-free verifier from
122
+ the trusted source checkout under supported Node 24 via the pinned
123
+ `actions/setup-node` revision. No package-manager install, dependency
124
+ resolution, caller checkout, or caller code runs while OIDC and
125
+ attestation-write authority is present.
126
+
127
+ ## Operation ownership
128
+
129
+ An invocation defaults to one workspace, one app, one command, one target, one
130
+ architecture, one format, and one signing profile. It acknowledges before long
131
+ work, uses one `AbortController`, supervises child processes, and routes progress
132
+ through one serialized owned event queue. Process streams apply pause/resume
133
+ backpressure and heartbeats coalesce. Callback failure cancels owned work, drains
134
+ the queue, and reaches the caller or CLI exit status. Packaging preserves prior
135
+ output until verified replacement.
136
+
137
+ Each normalized queue event is also mirrored exactly once through the shared
138
+ `arcaneEvents` `EventManager`. That synchronous `event-pubsub` route is the
139
+ canonical cross-cutting instrumentation surface, but it does not replace the
140
+ owned asynchronous callback path or its backpressure. Time-travel history and
141
+ DOM observation remain explicitly disabled unless a bounded diagnostic session
142
+ enables them. See [event-manager.md](event-manager.md) for the record, redaction,
143
+ DOM coverage, and effect-isolated playback boundaries.
144
+
145
+ For `--scope shared`, the cardinality changes to one integrated workspace, one
146
+ named operation, and either one exact test file or one development check. The
147
+ same owned event queue and process supervisor provide acknowledgement, bounded
148
+ stream delivery, heartbeat, cancellation, process-tree cleanup, and nonzero
149
+ failure propagation. No app or target loop exists in that scope.
150
+
151
+ ## Verification receipts
152
+
153
+ Runtime verification binds the exact SDK version, upstream Arcane commit,
154
+ runtime inventory, byte counts, and SHA-256 hashes. Packaging writes the full
155
+ schema-1 release inventory to `ARCANE_APP_RELEASE.json`; its operation result
156
+ returns a deeply immutable, process-authenticated receipt that binds the
157
+ canonical location, app policy, complete inventory, content digest, and verified
158
+ filesystem identities. The browser run path authenticates that receipt before
159
+ serving it, and every native provider consumes release bytes through SDK-bound
160
+ verified readers before verifying its app-scoped artifact. Windows and Linux
161
+ retain artifact authority for same-process verification and launch. Persistent
162
+ cross-process reuse still requires an authenticated Arcane broker; a path,
163
+ timestamp, environment variable, or receipt file alone is not authority.
164
+
165
+ The loopback server treats the mutable filesystem as an input, not as an
166
+ immutable receipt. Before sending headers it reads each requested source,
167
+ runtime, or packaged file into a bounded buffer, verifies the expected hash for
168
+ receipt-bound files, and repeats the handle/path identity check. A response is
169
+ therefore an exact verified byte snapshot even if another process writes during
170
+ the request. Development serving is limited to 64 MiB per file and four active
171
+ file responses, with a bounded wait queue.
172
+
173
+ ## Native provider boundary
174
+
175
+ The SDK implements protocol `arcane-native-build-plan/1` and the injected
176
+ provider contract `arcane-native-builder/1`. Pairing is process-local; it never
177
+ registers a mutable global provider or searches for a toolchain. For each
178
+ supported native target, the CLI loads one fixed provider module from the
179
+ explicit `--arcane-root` Arcane OS checkout. Provider code is bound to one
180
+ process generation; if a pull changes any loaded provider module, the SDK fails
181
+ closed and requires a fresh worker rather than combining new hashes with Node's
182
+ cached old modules. One paired toolchain can perform this lifecycle:
183
+
184
+ ```text
185
+ doctor -> prepare -> plan -> build -> verify receipt -> run receipt
186
+ ```
187
+
188
+ The portable provider implements the lifecycle through verification and fails
189
+ honestly on run because its result is a directory. Windows x64, Linux x64,
190
+ Linux ARM64, and Android ARM64 implement same-process launch and owned
191
+ cancellation when their compatible host/device requirements are present.
192
+ Windows uses a retained per-build broker and authenticated host readiness. The
193
+ Linux provider produces a verified amd64 or ARM64 DEB and runs a retained
194
+ user-owned extraction without install or elevation. Portable, Windows, and
195
+ Linux use the `unsigned-local-test` signing profile.
196
+
197
+ The Android provider produces one development-signed APK. It contains no native
198
+ library or ABI-specific payload, so the artifact is architecture-neutral; the
199
+ `android-arm64` target instead binds the supported run path to one physical
200
+ device with native ARM64 support. APK is the only Android format in this
201
+ development provider. AAB, release signing, publishing, and update continuity
202
+ remain outside it.
203
+
204
+ The plan binds one explicit `toolchainRoot` and authenticated receipt, one app
205
+ release root and receipt, its approved schema-2 descriptor digest, only its
206
+ declared dependency releases, one non-overlapping output root, and one target,
207
+ platform, architecture, format, and signing request. App source and workspace
208
+ paths are withheld from the native provider. The provider copies release bytes
209
+ through SDK-bound verified readers rather than accepting a mutable source path
210
+ as authority. Build completion requires provider verification, and later
211
+ verify/run calls receive the exact artifact receipt.
212
+
213
+ The SDK `0.1.0-dev.5` runtime requires Arcane `0.8.12` or newer. Compatibility
214
+ is contractual rather than exact-version pinning: the prepared Core must meet
215
+ the highest minimum declared by the runtime, selected app, and bundled app
216
+ dependencies; keep each app's Arcane protocol generation; and provide every
217
+ declared feature, capability, and method. Missing requirements stop before
218
+ provider build; a newer compatible Core is accepted. Exact hashes
219
+ remain integrity identities, not compatibility rules. The provider paths have
220
+ been validated from independent workspaces. They do not copy proprietary source
221
+ into the Arcane checkout.
222
+
223
+ See [compatibility.md](compatibility.md) for the complete app and bundled-app
224
+ admission rule and the required handling of breaking contract changes.
225
+
226
+ Linux ARM64 shares the implemented Linux provider, focused tests, and a
227
+ target-scoped remote evidence workflow. At Arcane revision
228
+ `4382043c09285ea203aa6daba1732660966ac409`, that workflow proved native AArch64
229
+ toolchain, DEB, host/Core/bridge, retained verification, sandboxed WebKit
230
+ readiness, and owned process-group cancellation. The hardened Android path has
231
+ exact-SHA physical ARM64/API 37 build, process/generation/nonce readiness,
232
+ cancellation, uninstall, and absence evidence. Neither record establishes
233
+ production signing, installation, publishing, update continuity, release
234
+ acceptance, or production readiness.
@@ -0,0 +1,36 @@
1
+ # Arcane application compatibility
2
+
3
+ Arcane application compatibility is a capability contract, not an exact
4
+ runtime-version pin. An app may run on a newer Arcane Core when the host meets
5
+ all of the app's declared requirements.
6
+
7
+ For the selected app and every declared bundled app, admission requires:
8
+
9
+ - the requested target is declared by that app;
10
+ - the host Core version is greater than or equal to
11
+ `requirements.minimumCoreVersion`;
12
+ - `requirements.arcaneProtocol` matches the host protocol generation;
13
+ - every declared `requirements.features` entry is advertised by the host;
14
+ - every declared `permissions.capabilities` entry is available; and
15
+ - every declared `permissions.methods` entry is available.
16
+
17
+ The effective Core floor for a build is the highest minimum declared by the
18
+ SDK runtime, the selected app, and its complete bundled-app closure. The native
19
+ build plan authenticates the host toolchain receipt and checks every member of
20
+ that closure before a provider may read release bytes or mutate output.
21
+
22
+ This permits normal non-breaking Arcane upgrades. For example, an app requiring
23
+ Core `0.8.12` can run on `0.8.13` or `0.9.0` when the required protocol,
24
+ features, capabilities, and methods are still present. A higher version does
25
+ not override a missing contract.
26
+
27
+ Breaking changes must be visible at the contract boundary. A host must not
28
+ continue advertising an old protocol, feature, capability, or method when its
29
+ meaning or guarantees are no longer compatible. It must instead change the
30
+ protocol generation or contract identifier so admission fails closed before
31
+ launch.
32
+
33
+ Hashes and lock-file identities serve a different purpose. They establish
34
+ which SDK runtime, release, toolchain, and artifact bytes were verified for one
35
+ build state; they do not require the installed Arcane version to equal the
36
+ app's minimum version forever.
@@ -0,0 +1,166 @@
1
+ # Central event instrumentation and time-travel review
2
+
3
+ `EventManager` is the preferred event instrumentation surface for new Arcane
4
+ SDK code. It composes `event-pubsub` for synchronous delivery and adds Arcane's
5
+ optional diagnostic record around that bus. Existing SDK operation queues mirror
6
+ their normalized events through the shared `arcaneEvents` manager exactly once
7
+ without replacing their awaited callback, backpressure, cancellation, or failure
8
+ semantics.
9
+
10
+ Import the dedicated host-neutral entry point:
11
+
12
+ ```javascript
13
+ import {
14
+ arcaneEvents,
15
+ createEventManager,
16
+ PLAYBACK_RECORD_EVENT
17
+ } from 'arcane-os/event-manager';
18
+ ```
19
+
20
+ Prefer one manager for an application or process boundary. Publish semantic
21
+ events through `instrument()` when source and correlation metadata are known:
22
+
23
+ ```javascript
24
+ arcaneEvents.on('document.save.completed',event=>{
25
+ console.info('Saved',event.documentId);
26
+ });
27
+
28
+ arcaneEvents.instrument(
29
+ 'document.save.completed',
30
+ {documentId:'example'},
31
+ {
32
+ source:'app:example',
33
+ category:'operation',
34
+ correlationId:'save-42'
35
+ }
36
+ );
37
+ ```
38
+
39
+ `on`, `once`, `off`, `emit`, `reset`, and `list` retain the synchronous
40
+ `event-pubsub` contract. Synchronous subscriber exceptions propagate to the
41
+ publisher. Subscriber promises are not awaited, so use the SDK's owned event
42
+ queues for work whose completion, failure, or cancellation depends on an
43
+ asynchronous callback.
44
+
45
+ ## Enable a bounded, complete event stack
46
+
47
+ Time-travel recording is disabled by default. With the flag off, the manager is
48
+ only a pub/sub bus: it captures no history, source stack, or DOM activity.
49
+
50
+ ```javascript
51
+ const events=createEventManager({
52
+ timeTravel:true,
53
+ maxEvents:10_000,
54
+ dom:{
55
+ root:document,
56
+ captureInputValues:false
57
+ }
58
+ });
59
+ ```
60
+
61
+ It can also be enabled around a diagnostic session:
62
+
63
+ ```javascript
64
+ arcaneEvents.enableTimeTravel({
65
+ dom:{root:document,captureInputValues:false}
66
+ });
67
+
68
+ // Exercise the scenario.
69
+
70
+ arcaneEvents.disableTimeTravel();
71
+ const serialized=arcaneEvents.exportStack();
72
+ ```
73
+
74
+ While enabled, every manager event receives an immutable
75
+ `arcane-event-stack/1` record containing the session and event ids, sequence,
76
+ UTC and monotonic timestamps, source/category, correlation and causation ids,
77
+ nested dispatch depth, a bounded payload snapshot, completion or failure
78
+ outcome, and dispatch duration. Source stacks are `null` by default; explicitly
79
+ set `captureStacks: true` only for a controlled local session. Stored strings,
80
+ collections, object entries, nesting, source stacks, and error stacks remain
81
+ bounded. The durable JSON shape is published as
82
+ `arcane-os/schemas/event-stack.json`.
83
+
84
+ The default event limit is 10,000 records. Recording retains the complete
85
+ session until that limit. On the next attempted record, it appends exactly one
86
+ `arcane.time-travel.overflow` marker, stops DOM observation, and disables
87
+ recording. It never silently evicts a prefix or presents a partial tail as a
88
+ complete session. Call `clearHistory()` before re-enabling recording. Tune
89
+ `maxEvents`, `maxSnapshotDepth`, `maxSnapshotEntries`, and
90
+ `maxSnapshotStringLength` for the diagnostic environment. The string limit has
91
+ a minimum of 64 characters so generated structural markers remain importable.
92
+ High-frequency
93
+ pointer, touch, drag, scroll, and wheel events can reach the limit quickly.
94
+ Arcane does not upload or persist a stack automatically.
95
+
96
+ ## DOM observation
97
+
98
+ When a DOM root is attached while time travel is enabled, capture-phase
99
+ listeners record the standard keyboard, pointer, mouse, touch, form, focus,
100
+ clipboard, drag, selection, and scroll interaction set. A `MutationObserver`
101
+ records attribute, text, insertion, and removal mutations, including old values
102
+ where the platform exposes them. Open shadow roots present at startup or found
103
+ in inserted nodes are observed separately; composed events are deduplicated.
104
+
105
+ Input values, node markup/text, and text-bearing event details are excluded by
106
+ default. Password/autocomplete-password fields and elements beneath
107
+ `data-arcane-private` stay redacted even when ordinary value capture is enabled.
108
+ Keyboard text, composition/input `data`, arbitrary `detail`, and clipboard
109
+ contents are not retained by the safe defaults. Mutation `value`, `srcdoc`,
110
+ style, credential-like attributes, and every URL-bearing attribute are replaced
111
+ with markers; the observed document URL is never retained. Raw added/removed
112
+ node markup is replaced with a content-omitted marker unless
113
+ `captureNodeMarkup: true` is explicitly selected. Event payload keys that look
114
+ like credentials, tokens, cookies, passwords, secrets, or private keys are also
115
+ redacted before history or export.
116
+
117
+ `captureInputValues`, `captureEventDetails`, `captureNodeMarkup`, and
118
+ `captureStacks` are separate, explicit diagnostic choices. They remain bounded,
119
+ and private targets plus URL fields remain protected, but any enabled diagnostic
120
+ content may still be sensitive. Treat recordings as local evidence and review
121
+ them before sharing.
122
+
123
+ Mutation observation is an audit backstop, not proof of every renderer state
124
+ change. It cannot see closed shadow roots, cross-origin frames, external web
125
+ content, CSSOM/canvas drawing, most property-only writes, native/kernel activity,
126
+ or interactions that happened before instrumentation started. Use semantic
127
+ `instrument()` events at SDK-owned mutation boundaries when exact intent and
128
+ causation matter.
129
+
130
+ ## Seek and playback
131
+
132
+ `seek(sequence)` moves the diagnostic review cursor and emits
133
+ `arcane.time-travel.seek`. It does not rewrite live DOM or application state.
134
+ The safe default playback mode emits each immutable record on
135
+ `arcane.time-travel.playback.record` for a debugger or review UI:
136
+
137
+ ```javascript
138
+ events.on(PLAYBACK_RECORD_EVENT,record=>reviewTimeline(record));
139
+ await events.playback({stack:serialized,mode:'review',speed:2});
140
+ ```
141
+
142
+ `speed: 0` plays immediately; a positive value preserves monotonic recorded
143
+ delays at that multiplier. Playback supports `AbortSignal` and emits an explicit
144
+ completed, cancelled, or failed terminal event. Recording is suppressed during
145
+ playback so replay cannot recursively add itself to the stack.
146
+
147
+ `mode: 'events'` redispatches recorded event payloads to live subscribers. That
148
+ mode can execute application effects and is only appropriate inside an isolated
149
+ diagnostic harness with effectful subscribers replaced. The SDK does not
150
+ synthesize trusted browser input, restore a prior DOM snapshot, resend native
151
+ RPC, repeat provisioning, launch processes, write storage, or repeat network or
152
+ other privileged effects.
153
+
154
+ ## Browser delivery boundary
155
+
156
+ The package entry point works directly in Node and through browser bundlers.
157
+ The npm artifact bundles the exact `event-pubsub` and `strong-type` pair because
158
+ `event-pubsub@6.1.0` uses a sibling-relative runtime import. Unbundled browser
159
+ use must preserve that physical sibling layout and provide import-map entries
160
+ for the public SDK entry and `event-pubsub`.
161
+
162
+ The current `0.1.0-dev.5` hash-pinned Arcane browser runtime does not yet
163
+ bootstrap or package this SDK-authored module. Built-in Shell, Provisioner, and
164
+ native Arcane application instrumentation therefore belongs in the downstream
165
+ Arcane OS integration work; this SDK release does not claim automatic coverage
166
+ inside those surfaces.
@@ -0,0 +1,108 @@
1
+ # Platform target contract
2
+
3
+ Every target adapter implements protocol `arcane-target-adapter/1` with these
4
+ named operations:
5
+
6
+ ```text
7
+ describe -> doctor -> prepare -> plan -> build -> verify -> run
8
+ ```
9
+
10
+ The available browser adapter plans from the selected workspace and schema-1
11
+ release manifest. The SDK also implements the process-local
12
+ `arcane-native-build-plan/1` and `arcane-native-builder/1` boundary for an
13
+ explicitly injected provider. It binds an authenticated app release and
14
+ schema-2 descriptor, toolchain receipt, platform, architecture, format, signing
15
+ mode and identity, declared dependency releases, and destination. A paired
16
+ provider must verify the built artifact before build completion, and verify/run
17
+ reuse that exact artifact receipt.
18
+
19
+ Native targets are available by explicitly pairing the SDK with fixed provider
20
+ modules in a compatible Arcane OS checkout. Every native request also requires
21
+ the canonical app descriptor to declare the exact target selected on the
22
+ command line. The SDK package does not silently search for a toolchain, infer a
23
+ descriptor target, embed the Arcane machine bundle, or substitute browser
24
+ output. For example:
25
+
26
+ ```bash
27
+ # Choose one target when creating each app repository.
28
+ npx arcane-os@dev new my-app --path ./my-app --target portable --git
29
+ cd my-app
30
+ npm install
31
+ npm exec -- arcane native-doctor --target portable --arcane-root "../Arcane OS"
32
+ npm exec -- arcane build --target portable --arcane-root "../Arcane OS"
33
+
34
+ # In an app scaffolded with --target windows-x64:
35
+ npm exec -- arcane build --target windows-x64 --arcane-root "../Arcane OS"
36
+ npm exec -- arcane run --target windows-x64 --arcane-root "../Arcane OS"
37
+
38
+ # In an app scaffolded with --target linux-x64:
39
+ npm exec -- arcane build --target linux-x64 --arcane-root "../Arcane OS"
40
+ npm exec -- arcane run --target linux-x64 --arcane-root "../Arcane OS"
41
+
42
+ # In an app scaffolded with --target linux-arm64, on native ARM64 Linux:
43
+ npm exec -- arcane native-doctor --target linux-arm64 --arcane-root "../Arcane OS" --format deb --signing unsigned-local-test
44
+ npm exec -- arcane build --target linux-arm64 --arcane-root "../Arcane OS" --format deb --signing unsigned-local-test
45
+ npm exec -- arcane run --target linux-arm64 --arcane-root "../Arcane OS" --format deb --signing unsigned-local-test
46
+
47
+ # In an app scaffolded with --target android-arm64. The run command requires
48
+ # one connected physical Android device with native ARM64 support:
49
+ npm exec -- arcane native-doctor --target android-arm64 --arcane-root "../Arcane OS" --format apk --signing development
50
+ npm exec -- arcane build --target android-arm64 --arcane-root "../Arcane OS" --format apk --signing development
51
+ npm exec -- arcane run --target android-arm64 --arcane-root "../Arcane OS" --format apk --signing development
52
+ ```
53
+
54
+ Every native scaffold also declares the browser target, so one repository can
55
+ use the normal browser development loop and its one selected native build. It
56
+ includes the raster icon required by current Arcane native admission. Use the
57
+ matching scaffold target (`portable`, `windows-x64`, `linux-x64`, `linux-arm64`,
58
+ or `android-arm64`) before running the corresponding command.
59
+
60
+ `native-prepare` remains a standalone integrity diagnostic. A receipt cannot be
61
+ carried through a later CLI process, so the normal build recipe omits it and
62
+ lets `build` prepare and reuse one exact toolchain state.
63
+
64
+ The portable output is a verified app-scoped Arcane Core directory. It is an explicit
65
+ portable builder payload, not an executable, and it has no direct run operation.
66
+ The external workspace defaults to `build/portable/`; integrated Arcane work
67
+ must use the same canonical checkout for `--workspace` and `--arcane-root`, and
68
+ must name an `--output-root` outside that checkout.
69
+
70
+ Compatibility uses the highest minimum Core version declared by the SDK runtime,
71
+ selected app, and bundled app dependencies, plus each app's Arcane protocol and
72
+ required features, capabilities, and methods. Newer Core versions are accepted
73
+ when those contracts remain available. See [compatibility.md](compatibility.md)
74
+ for the complete admission and breaking-change rule.
75
+
76
+ | Target | Formats | Development status |
77
+ |---|---|---|
78
+ | `browser` | `directory` | Available |
79
+ | `portable` | `portable` directory | Available with explicit `--arcane-root`; verified, not executable |
80
+ | `windows-x64` | `exe` bundle | Available with explicit `--arcane-root`; unsigned local development only |
81
+ | `linux-x64` | `deb` | Available with explicit `--arcane-root`; unsigned local development only |
82
+ | `linux-arm64` | `deb` | Available with explicit `--arcane-root` on a compatible native ARM64 toolchain; unsigned local development only |
83
+ | `android-arm64` | `apk` | Available with explicit `--arcane-root`; development-signed, architecture-neutral, and physical/native ARM64 for run |
84
+
85
+ Every native target accepts one verified app release and its exact bundled
86
+ dependency closure through the provider boundary. The providers retain the
87
+ toolchain and artifact authority required for same-process verification and,
88
+ where supported, launch; app source and workspace paths are not supplied to the
89
+ provider. Linux run extracts to a user-owned development tree without package
90
+ installation or elevation.
91
+
92
+ Linux ARM64 uses the implemented Linux provider and is available only with a
93
+ compatible native ARM64 toolchain. The target-scoped workflow at Arcane revision
94
+ `4382043c09285ea203aa6daba1732660966ac409` built and retained-verified a native
95
+ ARM64 DEB, proved AArch64 host/Core/bridge identities, reached WebKit readiness,
96
+ and drained the owned process group. It loaded Ubuntu's packaged Bubblewrap
97
+ AppArmor profile while leaving the global user-namespace restriction enabled.
98
+ Android produces one development-signed APK with no native library or
99
+ ABI-specific payload. The APK is therefore architecture-neutral, while
100
+ `arcane run --target android-arm64` deliberately requires a physical device
101
+ with native ARM64 support. The hardened path has exact-SHA physical ARM64/API 37
102
+ build, readiness, cancellation, uninstall, and absence evidence. Both records
103
+ are development evidence, not production readiness.
104
+
105
+ Android AAB output, release signing, store publishing, and update continuity are
106
+ deferred. Windows and Linux production signing, installation, and update
107
+ acceptance also remain separate promotion work. The SDK never copies
108
+ proprietary application source into the Arcane checkout to bypass the boundary.