arcane-os 0.54.1 → 0.56.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 (45) hide show
  1. package/CHANGELOG.md +60 -0
  2. package/README.md +35 -28
  3. package/browser-runtime/core/client.mjs +552 -0
  4. package/browser-runtime/core/contracts.mjs +85 -0
  5. package/docs/architecture.md +31 -23
  6. package/docs/compatibility.md +10 -1
  7. package/docs/consumer-updates.md +82 -0
  8. package/docs/platform-targets.md +20 -11
  9. package/docs/publishing.md +41 -18
  10. package/docs/reference/README.md +19 -7
  11. package/docs/reference/availability-and-normalization.md +15 -5
  12. package/docs/reference/behavioral-testing.md +7 -6
  13. package/docs/reference/cli.md +12 -4
  14. package/docs/reference/core-client.md +163 -0
  15. package/docs/reference/core-native-packaging.md +149 -0
  16. package/docs/reference/core-runtime.md +185 -0
  17. package/docs/reference/inventory/package-api.json +271 -5
  18. package/docs/reference/protocols.md +38 -14
  19. package/docs/reference/pwa.md +17 -0
  20. package/docs/reference/sdk-api.md +772 -15
  21. package/package.json +10 -3
  22. package/schemas/arcane-app.schema.json +10 -0
  23. package/schemas/arcane-package.schema.json +10 -0
  24. package/schemas/native-build-plan.schema.json +8 -0
  25. package/src/app-descriptor.mjs +18 -1
  26. package/src/app-layout.mjs +6 -2
  27. package/src/cli/main.mjs +8 -6
  28. package/src/core/host.mjs +23 -0
  29. package/src/core/hosts/arcane-core-loader.cjs +2 -0
  30. package/src/core/hosts/linux/arcane_core_process.c +568 -0
  31. package/src/core/hosts/linux/arcane_core_process.h +127 -0
  32. package/src/core/hosts/sea-launcher.cjs +17 -0
  33. package/src/core/hosts/windows/ArcaneCoreProcess.cs +416 -0
  34. package/src/core/runtime.mjs +345 -0
  35. package/src/core/stdio.mjs +209 -0
  36. package/src/core-classic-source.mjs +43 -0
  37. package/src/import-map.mjs +62 -0
  38. package/src/native/portable-layout.mjs +184 -0
  39. package/src/native/portable-provider.mjs +211 -0
  40. package/src/native-plan.mjs +10 -4
  41. package/src/native-provider-loader.mjs +15 -4
  42. package/src/packager/core.mjs +131 -32
  43. package/src/process.mjs +8 -4
  44. package/src/targets/index.mjs +3 -1
  45. package/src/toolchain.mjs +23 -6
@@ -35,11 +35,12 @@ Arcane OS installation, source checkout or private Arcane OS import.
35
35
  Arcane OS is an SDK consumer like other applications. Its orchestrator,
36
36
  launcher, Shell, Provisioner, system AI application and internal tools use the
37
37
  same SDK modules and components rather than maintaining private runtime copies.
38
- Arcane OS and Core own the privileged host implementations, app/session
39
- admission and authorization, native transport and lifecycle, launcher and
40
- Shell orchestration, and system-AI policy specific to the Shell. The SDK may
41
- publish the capability-neutral Core bridge contract and adapters, but it does
42
- not embed Core or inherit another application's policy.
38
+ The SDK owns reusable Core protocol, browser client, native runtime, service
39
+ lifecycle and portable payload packaging. Privileged execution stays native;
40
+ the browser client imports no native implementation. Arcane OS retains its
41
+ product host composition, app/session policy, launcher, Shell, Provisioner and
42
+ system-AI orchestration. Applications explicitly supply their service modules;
43
+ the SDK does not discover or inherit another application's services or policy.
43
44
 
44
45
  Each application owns its branding, prompts, data, tools, business policy,
45
46
  model authorities and app-specific orchestration. Apply this decision order:
@@ -47,7 +48,8 @@ model authorities and app-specific orchestration. Apply this decision order:
47
48
  | Responsibility | Canonical owner |
48
49
  |---|---|
49
50
  | Reusable by any portable application | Arcane SDK |
50
- | Host privilege, launcher, Shell or app/session admission | Arcane OS / Core |
51
+ | Native execution | Native host using SDK runtime and explicit app services |
52
+ | Arcane OS product composition, launcher, Shell and app/session policy | Arcane OS |
51
53
  | Behavior unique to one product | That application |
52
54
 
53
55
  Do not copy a reusable implementation between the SDK, Arcane OS and an app,
@@ -405,18 +407,25 @@ safety remain in effect.
405
407
 
406
408
  The SDK implements protocol `arcane-native-build-plan/1` and the injected
407
409
  provider contract `arcane-native-builder/1`. Pairing is process-local; it never
408
- registers a mutable global provider or searches for a toolchain. For each
409
- supported native target, the CLI loads one fixed provider module from the
410
- explicit `--arcane-root` Arcane OS checkout. Provider code is bound to one
411
- process generation; if a pull changes loaded provider code, the caller starts a
412
- fresh worker. One paired toolchain can perform this lifecycle:
410
+ registers a mutable global provider or searches for a toolchain. With no
411
+ `--arcane-root`, the portable CLI target loads the provider from this installed
412
+ SDK package. An explicit root retains the fixed Arcane OS provider selection;
413
+ executable targets still require that override and their platform toolchains.
414
+ Normal Node module resolution owns the loaded module. The pairing reports
415
+ `providerSource` as `sdk-package` or `arcane-checkout`. One paired toolchain can
416
+ perform this lifecycle:
413
417
 
414
418
  ```text
415
419
  doctor -> prepare -> plan -> build -> run
416
420
  ```
417
421
 
418
- The portable provider reports honestly that run is unavailable because its
419
- result is a directory. Windows x64, Linux x64,
422
+ The package-owned portable provider copies the complete selected app and
423
+ dependency payloads and generates a Core entry and synchronous classic facade.
424
+ It accepts explicitly selected service modules through
425
+ `createPortableNativeProvider({services:[{module,options}]})`. Its result is a
426
+ directory, so run reports unavailable. It supplies no executable platform host,
427
+ installer, model assets or OS product services. The explicit Arcane OS
428
+ providers for Windows x64, Linux x64,
420
429
  Linux ARM64, and Android ARM64 implement same-process launch and owned
421
430
  cancellation when their compatible host/device requirements are present.
422
431
  Windows uses a retained per-build broker and host readiness. The
@@ -439,16 +448,15 @@ paths are withheld from the native provider. The provider copies the complete
439
448
  selected release rather than accepting an unrelated source path. Verification
440
449
  is a separate explicit operation for a selected release artifact.
441
450
 
442
- The current native build contract requires Arcane Core `0.8.12` or newer.
443
- Compatibility is contractual rather than exact-version pinning: the prepared Core must meet
444
- the highest minimum declared by the runtime, selected app, and bundled app
445
- dependencies; keep each app's Arcane protocol generation; and provide every
446
- declared feature, capability, and method. Missing requirements stop before
447
- provider build; a newer compatible Core is accepted. Browser-only apps may omit
448
- `minimumCoreVersion`, and missing permissions or optional security declarations
449
- normalize to empty records. The provider paths have
450
- been validated from independent workspaces. They do not copy proprietary source
451
- into the Arcane checkout.
451
+ The native plan preserves the selected descriptors, dependency releases and
452
+ minimum Core requirement for the provider. It accepts the CLI's nested
453
+ `signing:{mode,profileId}` request and existing flat `signing`/`signingProfileId`
454
+ inputs, emitting the same flat plan request. Payload assembly alone does not
455
+ establish that a composed host supplies an app's required methods or services.
456
+ See the [portable native packaging guide](reference/core-native-packaging.md)
457
+ for the SDK provider's actual output and composition boundary. Browser-only apps
458
+ may omit `minimumCoreVersion`; ordinary browser operation remains independent
459
+ of Core.
452
460
 
453
461
  See [compatibility.md](compatibility.md) for the complete app and bundled-app
454
462
  compatibility rule and the required handling of breaking contract changes.
@@ -23,7 +23,16 @@ When the selected target actually uses Arcane Core, compatibility requires:
23
23
  The effective Core floor for a native build is the highest minimum explicitly
24
24
  declared by the SDK runtime, the selected app, and its complete bundled-app
25
25
  closure. Browser-only targets do not invent a Core floor. The native build plan
26
- checks every member of that closure before producing output.
26
+ forwards the complete selected descriptors, release records and minimum to the
27
+ provider. Creating a portable payload does not establish host or service
28
+ compatibility; the composed host must actually supply the required contracts.
29
+
30
+ The portable CLI selects its provider from the installed SDK unless an explicit
31
+ `--arcane-root` chooses the existing checkout provider. Other native target
32
+ selection and the integrated shared-development provider remain unchanged.
33
+ Programmatic native plans accept both nested CLI signing options and the
34
+ existing flat signing/profile fields, retaining the flat plan result. The
35
+ package-owned portable output is a payload, not an executable host or installer.
27
36
 
28
37
  This permits normal non-breaking Arcane upgrades. For example, an app requiring
29
38
  Core `0.8.12` can run on `0.8.13` or `0.9.0` when the required protocol,
@@ -0,0 +1,82 @@
1
+ # Consumer updates
2
+
3
+ Development applications track the published npm `latest` channel. Declare
4
+ `"arcane-os": "latest"` in the application's existing dependency section.
5
+ Preserve an existing package alias where the application needs it; Arcane OS,
6
+ for example, uses `"arcane-sdk": "npm:arcane-os@latest"` to avoid a name collision.
7
+ Pin an application's SDK version only when Roshi explicitly designates it as a
8
+ production build. An exact version recorded in `package-lock.json` records what
9
+ was installed; it does not turn a development application into a production pin.
10
+
11
+ ## Development refresh
12
+
13
+ Each application's existing owner performs its refresh through the public npm
14
+ package workflow in its canonical `main` checkout. Coordinate the dependency
15
+ and Git mutation window before cleanup, preserve active processes and other
16
+ owners' work, and establish applicable dependency permissions before removing
17
+ the installed tree. Respect explicit project stops, including Lifeline.
18
+
19
+ 1. Keep the SDK declaration at `latest` and preserve `package-lock.json`.
20
+ 2. Resolve the exact application path and remove only that application's
21
+ disposable `node_modules`, before pulling. Do not sweep sibling projects or
22
+ shared caches.
23
+ 3. Run `git pull` and observe the result. Preserve existing changes and stop the
24
+ affected operation if the pull fails or leaves conflicts.
25
+ 4. Run `npm i` through the application's supported install workflow, retaining
26
+ its applicable lifecycle-script options.
27
+ 5. Explicitly run `npm update arcane-os` to refresh only the SDK. For an existing
28
+ alias, target its dependency key, such as `npm update arcane-sdk`.
29
+ 6. Before materializing managed files or building, obtain npm's published
30
+ `latest` version with a fresh registry lookup, such as
31
+ `npm view arcane-os@latest version --prefer-online`. Read the actual installed
32
+ package version and the lockfile's resolved SDK version. Both must match that
33
+ published version. If the tag advances during the operation, refresh the SDK
34
+ again and report the actual selected version.
35
+ 7. Update managed SDK projections only through the application's supported
36
+ public package workflow. Commit the intended declaration, retained updated
37
+ lockfile, managed files, and relevant instructions through its normal owner.
38
+
39
+ A `latest` declaration and `npm i` alone are insufficient: an existing lockfile
40
+ can preserve an older resolution. Keep and update the lockfile instead of
41
+ deleting it and re-resolving unrelated dependencies. Surface installation and
42
+ compatibility failures; do not claim current adoption from a manifest label.
43
+
44
+ This dependency-result comparison is part of the requested refresh. It does
45
+ not authorize application tests, unrelated checks or dependency updates,
46
+ recurring polling, broad cleanup, or production administration. A later release
47
+ can advance `latest`; record the exact version selected by each refresh.
48
+
49
+ ## Production builds
50
+
51
+ On Roshi's explicit production designation, record the selected exact SDK
52
+ version consistently in the dependency declaration, lockfile, managed
53
+ projections, and application instructions. Use the supported locked install
54
+ workflow, normally `npm ci`, to reproduce that selection. A production pin
55
+ records reproducibility, not a permanent ceiling on otherwise authorized
56
+ needed updates. Preserve an explicit update deferral or actual compatibility
57
+ constraint.
58
+
59
+ ## Feature requests and release notices
60
+
61
+ Inspect the published SDK's public API and documentation before implementing a
62
+ request. If it already supports the requested behavior, tell the requesting
63
+ application owner which API and usage provide it and link directly to the
64
+ relevant documentation. Do not present unpublished source as available support.
65
+
66
+ After a release's npm version and channel are confirmed, notify only existing
67
+ application owners whose requests it addresses. Notify every requester covered
68
+ by matching, similar, or bundled requests when one shared feature serves them.
69
+ Do not send routine release broadcasts to unrelated consumers.
70
+
71
+ Each notice includes the exact published version and channel, requested
72
+ functionality delivered, its relevance, release notes or a changelog link,
73
+ direct API and usage documentation references, and required compatibility or
74
+ adoption steps. Keep publication evidence distinct from application behavior.
75
+ Deduplicate by version and recipient and retain send outcomes in the release
76
+ handoff. Report unreachable owners and resume missing deliveries.
77
+
78
+ After every release and applicable requester notices, update the documentation
79
+ and existing SDK website for all affected public contracts, including releases
80
+ with no requesters. Record those delivery outcomes separately. The SDK owner
81
+ retains this follow-through; application upgrades and tests remain with their
82
+ owners and never gate SDK publication. See [npm publication](publishing.md).
@@ -16,8 +16,10 @@ toolchain, platform, architecture, format, signing mode, declared dependency
16
16
  releases, and destination. Verification is a separate operation only when the
17
17
  user explicitly selects it for the release artifact.
18
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
19
+ The portable target pairs with the installed SDK provider by default. An explicit
20
+ `--arcane-root` retains fixed-provider selection from an Arcane OS checkout;
21
+ Windows, Linux and Android executable targets still require that override and
22
+ their platform toolchains. Every native request also requires
21
23
  the canonical app descriptor to declare the exact target selected on the
22
24
  command line. The SDK package does not silently search for a toolchain, infer a
23
25
  descriptor target, embed the Arcane machine bundle, or substitute browser
@@ -29,8 +31,8 @@ npx arcane-os@latest new my-app --path ./my-app --target portable --git
29
31
  cd my-app
30
32
  npm install
31
33
  npm run import-map
32
- npm exec -- arcane native-doctor --target portable --arcane-root "../Arcane OS"
33
- npm exec -- arcane build --target portable --arcane-root "../Arcane OS"
34
+ npm exec -- arcane native-doctor --target portable
35
+ npm exec -- arcane build --target portable
34
36
 
35
37
  # In an app scaffolded with --target windows-x64:
36
38
  npm exec -- arcane build --target windows-x64 --arcane-root "../Arcane OS"
@@ -66,11 +68,16 @@ or `android-arm64`) before running the corresponding command.
66
68
  `native-prepare` remains a standalone diagnostic. The normal build recipe omits
67
69
  it and lets `build` prepare the selected toolchain state.
68
70
 
69
- The portable output is an app-scoped Arcane Core directory. It is an explicit
70
- portable builder payload, not an executable, and it has no direct run operation.
71
- The external workspace defaults to `build/portable/`; integrated Arcane work
72
- must use the same canonical checkout for `--workspace` and `--arcane-root`, and
73
- must name an `--output-root` outside that checkout.
71
+ The portable output is an app-scoped payload directory with complete selected
72
+ app and dependency files, a generated Core entry and classic client source.
73
+ It is not an executable and has no direct run operation. Explicit service
74
+ composition uses `createPortableNativeProvider({services:[{module,options}]})`;
75
+ the default adds no OS or application services. See
76
+ [Core native packaging](reference/core-native-packaging.md).
77
+ The external workspace defaults to `build/portable/`. Integrated Arcane work
78
+ must name an `--output-root` outside that checkout. Explicit checkout providers
79
+ still use the same canonical checkout for `--workspace` and `--arcane-root`;
80
+ the default SDK portable provider instead uses its installed package root.
74
81
 
75
82
  Compatibility uses the highest minimum Core version declared by the SDK runtime,
76
83
  selected app, and bundled app dependencies, plus each app's Arcane protocol and
@@ -81,7 +88,7 @@ for the complete compatibility and breaking-change rule.
81
88
  | Target | Formats | Development status |
82
89
  |---|---|---|
83
90
  | `browser` | `directory` | Available |
84
- | `portable` | `portable` directory | Available with explicit `--arcane-root`; not executable |
91
+ | `portable` | `portable` directory | SDK package provider by default; explicit checkout override retained; not executable |
85
92
  | `windows-x64` | `exe` bundle | Available with explicit `--arcane-root`; unsigned local development only |
86
93
  | `linux-x64` | `deb` | Available with explicit `--arcane-root`; unsigned local development only |
87
94
  | `linux-arm64` | `deb` | Available with explicit `--arcane-root` on a compatible native ARM64 toolchain; unsigned local development only |
@@ -89,7 +96,9 @@ for the complete compatibility and breaking-change rule.
89
96
 
90
97
  macOS can consume browser applications and portable JavaScript capabilities
91
98
  within their declared runtimes. The current target registry has no macOS native
92
- package adapter; it exposes only the six targets above. A source-development
99
+ package adapter, and the portable CLI request currently selects only Windows
100
+ or Linux. macOS native packaging and Android host adaptation remain incomplete;
101
+ the SDK portable payload does not supply executable hosts. A source-development
93
102
  native wrapper is also not an exposed `arcane dev` target. Native `run` uses the
94
103
  selected packaged application through its paired provider.
95
104
 
@@ -11,8 +11,12 @@ the npm `dev` dist-tag, while bare numeric stable versions select
11
11
 
12
12
  The package version and `publishConfig.tag` must agree exactly: `-dev` uses
13
13
  `dev`, and a bare numeric stable version uses `latest`. npm is the canonical
14
- SDK distribution: application repositories add an exact `arcane-os` project
15
- dependency and invoke its local CLI with `npm exec -- arcane`. A separate
14
+ SDK distribution: development applications declare `arcane-os` as `latest` and
15
+ invoke its local CLI with `npm exec -- arcane`. An exact application SDK pin
16
+ begins only when Roshi designates that application as a production build.
17
+ Keep the lockfile and explicitly refresh and compare its resolution and the
18
+ installed SDK with npm's published version before materializing or building;
19
+ see [Consumer updates](consumer-updates.md). A separate
16
20
  global installer, standalone SDK executable, NuGet package, Homebrew formula,
17
21
  or OS package is not part of this release surface.
18
22
 
@@ -30,8 +34,8 @@ agreement, and required license notices. One unprivileged producer packs one
30
34
  artifact with a recorded run id, artifact id, version, and source commit. It
31
35
  does not impose byte counts, hashes, digests, provenance receipts, or unrelated
32
36
  test suites as ordinary development gates. Broader integration, regression,
33
- platform, browser, presentation, and documentation work remains separately
34
- user selected.
37
+ and platform work remains separately user selected. Documentation and website
38
+ updates are required post-publication follow-through as described below.
35
39
 
36
40
  `publish-dev.yml` can run only when manually dispatched from `main` in
37
41
  `TheWizardNexus/arcane-os-sdk`. Dispatch supplies the exact successful Check
@@ -59,14 +63,15 @@ The unscoped package installs both `arcane` and `arcane-os`. The short command
59
63
  is the documented default; `arcane-os` is the collision-safe fallback. npm
60
64
  package names are unique, but executable names are not globally reserved.
61
65
 
62
- When `npm view arcane-os@dev version` reports the package unavailable, run
63
- `npm run pack:local` in this SDK checkout for local development, scaffold with
64
- `node ./bin/arcane.mjs new ...`, and install the resulting `.tgz` into the app
66
+ External applications consume published npm releases. An unavailable release
67
+ does not authorize them to use an unpublished SDK checkout or tarball. Only
68
+ tasks explicitly collaborating on an SDK update inside this project may use
69
+ the local `npm run pack:local` workflow and its resulting `.tgz`. That local
70
+ workflow can scaffold with `node ./bin/arcane.mjs new ...` and install the tarball
65
71
  with `npm install --save-dev --save-exact <path>`. Keep the tarball at the path
66
- recorded by `package-lock.json`; subsequent `npm ci` uses that declared package.
67
- Arcane reads the installed package's name and version against the root
68
- dependency declaration. A local directory `file:` install is intentionally unsupported because
69
- it may be linked.
72
+ recorded by `package-lock.json` for subsequent `npm ci`. Arcane reads the installed
73
+ package's name and version against the root dependency declaration. A local
74
+ directory `file:` install is unsupported because it may be linked.
70
75
 
71
76
  The npm package already has its trusted-publishing relationship. Each later
72
77
  release therefore follows the same direct selected-artifact path: push the
@@ -77,9 +82,11 @@ dist-tag after publication. Never rebuild or repack the artifact under
77
82
  publication authority, and never substitute a different source revision.
78
83
 
79
84
  Generated app CI uses `npm ci --ignore-scripts`, so its lock must exist and its
80
- dependency source must be reachable by the runner. A sibling local tarball is a
81
- workstation workflow, not a portable GitHub dependency source; switch to the
82
- exact registry release (or deliberately vendor the tarball) before remote CI.
85
+ dependency source must be reachable by the runner. External application CI uses
86
+ the published registry package recorded in the committed lockfile. A locked
87
+ install reproduces that selected version; it does not establish that the SDK is
88
+ currently npm's `latest`. Complete the development refresh before preparing and
89
+ committing managed application files and the updated lockfile for CI.
83
90
 
84
91
  ## Reusable application release workflow
85
92
 
@@ -111,8 +118,23 @@ GitHub release, and no release creates a Git branch for an npm dist-tag.
111
118
 
112
119
  ## Documentation publication
113
120
 
114
- Documentation publication occurs only when the user explicitly selects it. The
115
- Pages job checks out that selected `main` revision without persistent
121
+ After every successful npm release and its applicable requester notices, the
122
+ SDK owner updates documentation and the existing SDK website for all added,
123
+ removed, or modified features, APIs, members, methods, and affected public
124
+ contracts. Include the relevant signatures, inputs, outputs, defaults,
125
+ lifecycle, errors, platform availability, and usage examples. This standing
126
+ duty also applies when a release has no requesting applications. Record the
127
+ actual documentation and website delivery outcomes in the release handoff and
128
+ report any unfinished work. See [Consumer updates](consumer-updates.md) for
129
+ request intake and notice requirements.
130
+
131
+ Documentation and website content outside the selected npm payload does not
132
+ block npm publication. Prepare and deliver those updates through the existing
133
+ documentation/site workflow after publication; do not wait for consumer
134
+ adoption or application tests. This duty does not authorize ChatGPT Sites or
135
+ production-server administration.
136
+
137
+ The Pages job checks out the selected `main` revision without persistent
116
138
  credentials and uploads only the static `site/` tree. It does not automatically
117
139
  run the SDK test suite, checks, generators, or repository build code.
118
140
 
@@ -128,5 +150,6 @@ One producer creates the tarball. Publication names that producer's exact Check
128
150
  run, artifact, and version and does not rebuild from a later checkout. The
129
151
  release workflow checks only the publication contract and required legal
130
152
  inventory for that selected output.
131
- Platform matrices, full product regressions, Pages, and broader presentation
132
- work remain separate user-selected operations.
153
+ Platform matrices and full product regressions remain separate user-selected
154
+ operations. Documentation and the existing website are required post-release
155
+ follow-through, with their outcomes recorded separately from npm publication.
@@ -17,9 +17,14 @@ high-level page links to the relevant deep section instead of repeating it.
17
17
  Install the SDK in your application:
18
18
 
19
19
  ```sh
20
- npm install --save-exact arcane-os@latest
20
+ npm pkg set dependencies.arcane-os=latest
21
+ npm install
21
22
  ```
22
23
 
24
+ The development declaration tracks the current `latest` channel. The lockfile
25
+ and installed package record the exact version actually selected for the
26
+ workspace.
27
+
23
28
  For your first AI call, follow the [TWiN Cloud quick start](ai/twin-cloud.md).
24
29
  For local models, native browser voices or cloud speech, follow the [browser speech guide](ai/browser-speech.md)
25
30
  and the complete [browser AI demo](https://github.com/TheWizardNexus/arcane-os-sdk/tree/main/examples/wasm-ai-demo).
@@ -38,14 +43,19 @@ alone does not make bare module names resolve in a browser.
38
43
  | Use the `arcane` command | [CLI reference](cli.md) |
39
44
  | Install an app and cache selected resources offline | [Progressive web applications](pwa.md) |
40
45
  | Generate named browser imports or inspect the selected physical runtime | [`arcane import-map`](cli.md#arcane-import-map) and [browser runtime delivery](protocols.md#browser-runtime-delivery) |
46
+ | Connect an application through the shared WebSocket transport | [Shared WebSocket clients](websocket-client.md) |
41
47
  | Choose browser, native, cloud, or cross-host behavior | [Availability and normalization](availability-and-normalization.md) |
42
48
  | Import a shipped renderer module | [Runtime module catalog](runtime-modules.md) |
43
49
  | Use a shared entity | [Runtime entity modules](runtime-entities.md) and [exact export contracts](core/arcane-entities.md) |
44
50
  | Load a reusable HTML component | [Runtime component catalog](runtime-components.md) |
45
51
  | Submit complete speech parts immediately and play them in order | [`SpeechPlayback`](runtime-modules.md#speechplaybackjs) and the [basic browser example](ai/browser-speech.md#play-a-complete-array-with-speechplayback) |
46
52
  | Call `globalThis.Arcane` | [Arcane Core API](core/arcane-api.md) |
53
+ | Connect a browser to one Core transport | [Core browser client](core-client.md) |
54
+ | Compose native Core dispatch, service lifecycle, and stdio hosting | [Native Core runtime](core-runtime.md) |
55
+ | Build an installed-SDK portable Core payload | [Portable Core packaging](core-native-packaging.md) |
47
56
  | Subscribe to native events | [Arcane event reference](core/arcane-events.md) |
48
57
  | Use provider-neutral AI lifecycle, chat, speech, persistence, or document context | [Normalized AI](#normalized-ai) |
58
+ | Choose a normalized typed browser decision surface | [Browser typed decisions](ai/browser-decisions.md) |
49
59
  | Run a caller-selected local LLM in the browser | [Browser-WASM local AI](ai/browser-wasm.md) |
50
60
  | Run caller-selected Whisper/Kokoro, native browser recognition/voices or cloud TTS | [Browser speech providers](ai/browser-speech.md) |
51
61
  | Send TWiN chat, System One state/questions or image requests | [TWiN Cloud guide](ai/twin-cloud.md) |
@@ -67,12 +77,14 @@ This repository contains explicitly versioned surfaces with different owners:
67
77
  | Browser SDK runtime | Selected SDK, `browser-runtime/` | Events, logging, Wllama, local/native/cloud speech, TWiN requests and PWA mechanisms. `listSdkBrowserRuntimeFiles()`, `readSdkBrowserRuntimeFile()`, and `loadSdkBrowserRuntimeRelease()` derive its current inventory directly from the selected directory. |
68
78
  | Core reference snapshot | Arcane OS commit `567ad110bf57a1c2d4a3daa22ae93716cc5f4d7e`, protocol `arcane/1` | The application-facing Core contract imported into `docs/reference/core/`, with SDK-local links and package-boundary notes added explicitly. |
69
79
 
70
- The SDK runtime source and Core reference have different owners. A browser
71
- module comes from the selected SDK runtime tree. A native build selects one
72
- explicit Arcane OS checkout and Core, then checks the declared protocol,
73
- version, features, capabilities, methods, and provider contract needed by that
74
- build. A matching protocol name or higher version alone does not promise
75
- functional compatibility.
80
+ Browser modules and reusable Core client/runtime/lifecycle source belong to the
81
+ SDK. The portable provider uses this installed package by default and assembles
82
+ an app payload with explicitly selected services; it supplies no executable
83
+ platform host. Explicit Arcane OS provider overrides and integrated shared
84
+ checks remain available. Arcane OS retains its product composition and policy.
85
+ The historical Core reference snapshot describes a separate host contract;
86
+ matching a protocol name or assembling a payload alone does not establish that
87
+ a composed host supplies every required method or service.
76
88
 
77
89
  See the [Core reference source notes](core/README.md) for the imported inventory
78
90
  and the distinction between a documentation snapshot and the selected runtime.
@@ -58,9 +58,12 @@ false when a probe throws; SDK branching continues through its owning error path
58
58
  policy, package-owned model policy, platform support, and dependency readiness
59
59
  are independent checks.
60
60
 
61
- The current native host/target matrix covers Microsoft NT, Linux, and Android
62
- where listed. It exposes no macOS target or Core host contract in this SDK
63
- version; WebKitGTK availability must not be generalized to macOS.
61
+ The current executable host/target matrix covers Microsoft NT, Linux, and
62
+ Android where listed. This SDK exposes no macOS executable target, native
63
+ bridge, artifact, or run contract; WebKitGTK availability must not be
64
+ generalized to macOS. The reusable Node Core runtime, framed stdio transport,
65
+ host composition, and portable payload can be used by a separately composed
66
+ macOS host, but they do not supply that native platform host or bridge.
64
67
 
65
68
  ## Capability-first matrix
66
69
 
@@ -68,7 +71,9 @@ version; WebKitGTK availability must not be generalized to macOS.
68
71
  | --- | --- | --- | --- |
69
72
  | Scaffold, inspect, test, package, bundle, build, verify, or run an app | `arcane` CLI or `arcane-os` package functions | **Node**; native targets invoke one explicit provider | CLI events and SDK errors/results are normalized by versioned SDK contracts. Tests and checks run only when explicitly selected; verification is separate and selected-output-specific. |
70
73
  | Publish application events or review a complete event history | `arcane-os/event-manager` | **Node** and **Browser**; optional DOM capture needs a browser DOM or compatible host | Live listeners receive original arguments. Ordinary `secure:false` recording preserves complete URLs, public details, and captured stack text in deeply frozen `arcane-event-stack/1` snapshots while credential-named fields remain redacted. The stack format is local diagnostic data, not a host transport. |
74
+ | Share one native WebSocket by exact URI and ordered protocols | `arcane-os/websocket-client` | **Node** and **Browser**, using the host's native `WebSocket` | The selected upstream `ws-share` instance owns the connection pool and global observation. Native socket messages and events remain unchanged; there is no reconnect, heartbeat, application envelope, storage, or fallback. |
71
75
  | Build browser UI and app-local behavior | `/arcane/modules/*.js`, shared entities, and components | **Browser**; many modules also run inside every native renderer | Pure modules own their result contracts. Modules that call `Arcane` inherit the bridge boundary described below. |
76
+ | Score caller-supplied typed options with Laya or Julia | `arcane-os/ai/browser-decisions` | **Browser** only; caller-selected upstream runtime/model and backend | Typed decisions retain complete rows and return typed values, scores, probabilities, and diagnostics in caller order. This surface is separate from chat and speech and does not silently change model, precision, backend, or family. |
72
77
  | Select and observe independent LLM/STT/TTS roles | `/arcane/modules/AIProviderRuntime.js` and `AIRuntimeState.js` | **Cross-host** controller/state; registered providers retain their own host requirements | Required/projected provider members, route/configuration records, and status fields; per-role lifecycle, cancellation, stream cleanup, sticky state, and startup barriers are normalized. `localOnly` creates no fallback. |
73
78
  | Run a caller-selected local LLM entirely in a browser renderer | `arcane-os/ai/browser-wasm` through `createArcaneAI()` | **Browser** only; secure context, WebAssembly, and OPFS/DBOPFS; full WebGPU offload by default or explicit CPU with `gpuLayers:0` | The public AI API module normalizes multi-model lifecycle, status, complete all-choice streaming, cancellation, exact ordered structural tool-call visibility, and session persistence. Model sources are canonical ordered file descriptors; licenses and model choice remain application policy. |
74
79
  | Run caller-selected Whisper or Kokoro in a browser renderer | `arcane-os/ai/browser-speech` registered with `AIProviderRuntime` | **Browser** only; DBOPFS, Web Locks, Workers, Fetch/object URLs, and a caller-supplied self-contained runtime/model closure are required | Independent provider/2 lifecycle and status, with `auto`, `webnn-npu`, `webgpu`, or `wasm` execution. Whisper owns one Worker/session; Kokoro defaults to four and accepts one through four. Complete model/runtime selection, offline behavior, cancellation, Worker teardown, and request/result shapes are normalized. No runtime/model content or cloud fallback is supplied. |
@@ -81,6 +86,9 @@ version; WebKitGTK availability must not be generalized to macOS.
81
86
  | Print rendered editor content or file previews | `/arcane/modules/PrintView.js`, editor `print()`, and file/history `printPreview()` | **Browser / native WebView** with DOM and browser printing | Complete current rendered content, fonts, and resolved media are captured for print. Explicit requests await view preparation; native Print captures synchronously. Shared `print.css` supplies a light paper palette and one-inch margins; snapshots stay owned through `afterprint`. |
82
87
  | Search an app-owned document corpus for explicit chat context | `/arcane/modules/DBOPFSDocumentLibrary.js` | **Browser** or compatible injected DBOPFS adapter | Generation/manifest completion, complete lexical search, partial read failures, and untrusted context labels are normalized. Construction does not search; an explicitly wired context builder performs retrieval for each prepared chat send. |
83
88
  | Read host identity, capabilities, storage, preferences, appearance, or platform state | `globalThis.Arcane` | **Cross-host** where the method is implemented and admitted | Promise behavior and `Arcane.Error` are normalized. Result fields are normalized unless the method explicitly documents a platform-dependent snapshot. |
89
+ | Connect browser code to an existing Core transport | `arcane-os/core/client` and `arcane-os/core/contracts` | **Browser / native WebView** with an admitted transport; explicit development HTTP remains opt-in | The reusable client owns `arcane/1` correlation, readiness, cancellation, events, facades, and complete native error fidelity. It supplies no service, policy, or host process. |
90
+ | Compose native Core services and framed stdio hosting | `arcane-os/core/runtime`, `arcane-os/core/stdio`, and `arcane-os/core/host` | **Node** on Windows, Linux, or macOS; the composing native host supplies its process and bridge | The SDK owns reusable dispatch, per-service lifecycle, request/service work ownership, cooperative cancellation, drain, and stdio framing. Product identity, policy, privileges, models, storage, and services remain host-owned. |
91
+ | Assemble a portable Core payload from the installed SDK | `arcane-os/native/portable-provider` | **Node**; portable platform selection is currently Windows or Linux, while separately composed hosts may use the payload | The provider copies the selected app, dependencies, installed SDK runtime, Core client/runtime, and explicit service composition into a non-executable directory. It uses no `arcaneRoot` by default and does not prove host behavior or supply a platform bridge. |
84
92
  | Use local AI without coupling app code to Ollama HTTP | `Arcane.localAI`, `Arcane.ai`, or `/arcane/modules/Ollama.js` | Primarily **Native**; Android exposes a narrower admitted inference projection | Admission, errors, and managed-operation events are normalized. Direct Ollama response envelopes remain **Provider-native**. |
85
93
  | Use TWiN Cloud from the renderer profile | `/arcane/modules/AI.js` | **Cloud** from an allowed browser/native renderer | High-level chat behavior is normalized by the module. The TWiN access key authenticates remote LLM chat; raw provider diagnostics remain provider-specific. No automatic cloud fallback is inferred from local failure. |
86
94
  | Send one TWiN Cloud request with an explicit key and model | `fetchRequest` from `arcane-os/ai/twin-cloud` | **Node** and **Browser**, using standard Fetch and a remote HTTPS provider | Keeps complete messages and returns the full parsed provider JSON. Rejected Fetch and HTTP 529 share three retries after 3000 ms; HTTP 429 overload retains unlimited three-second retries. Optional `onRetry` reports waiting/requesting phases without blocking recovery. Shared structured-output mapping and cancellation match browser TWiN transport. No browser profile, AI/user singleton, DBOPFS, or retained request history is created. |
@@ -229,8 +237,10 @@ synthesis, and TWiN Cloud/FAL synthesis can be registered through
229
237
  `ai.configureSpeechProvider(role,provider,{modelId})`; configuration owns only
230
238
  the selected role and performs no network request. Saved selections remain
231
239
  application-owned, including selections waiting for provider registration.
232
- The SDK publishes no privileged Core implementation, credential, model, or
233
- speech-runtime authority. Capability-only built-in adapters report their
240
+ The SDK supplies reusable Core client/runtime/service-lifecycle primitives and
241
+ portable payload composition; privileged execution stays in a native host.
242
+ It supplies no application credential, selected model or product speech-service
243
+ authority. Capability-only built-in adapters report their
234
244
  existing routes without probing, downloading, or changing providers. The sticky
235
245
  [`AIRuntimeState`](runtime-modules.md#airuntimestatejs) surface keeps
236
246
  application UI independent of transport. A selected route remains explicit:
@@ -43,7 +43,7 @@ development evidence; it is not native artifact or release acceptance.
43
43
  | Browser-WASM local AI | The exported namespace, canonical ordered `{id, files:[{name?,url},...]}` descriptor, nonempty provider `sources` catalog, default `secure:false`, dormant `secure:true` intent, public AI API module lifecycle, lazy/manual policy, successful Wllama-load requirement, abort normalization, complete output and reasoning, all-choice validation, required structural-call `arguments.message`, exact call identity, and matching tool-result sequencing are represented in deterministic fixture sources. | A real Chrome exercise may load the selected Wllama runtime and model only after explicit user action. It is not an ordinary publication gate or an implicit model download. |
44
44
  | Browser speech | Caller-owned Whisper/Kokoro selection, independent STT/TTS routes, ordinary direct upstream runtime/model use, dormant `secure:true` intent, DBOPFS cache, materialized known-route/native-fallback behavior, NPU-to-GPU-to-CPU automatic selection for both roles, fresh Workers after a failed device load, explicit-device failure without fallback, bounded Kokoro Worker/session pools, out-of-order synthesis settlement with FIFO admission, request-targeted TTS cancellation, destructive lifecycle cleanup, Blob/File STT conversion, WAV TTS conversion, complete text/audio, and no cloud fallback are represented with synthetic artifacts and adapters. | A real runtime/model/voice download, WebNN or WebGPU model load, physical accelerator behavior, and actual transcription or synthesis use the application's selected upstream packages/providers, browser media support, and explicit user action. A selected backend is not proof that every operation ran on that physical accelerator; WebNN may execute unsupported operations through WASM. |
45
45
  | Persistent chat and document context | Atomic in-memory/history commit, explicit per-turn persistence, streamed/non-stream fallback, session-owned callback fields, complete data callbacks, per-turn request options, exact per-choice streamed/terminal call correlation before publication, terminal-only call acceptance, ordered parallel-call sequencing, atomic all-ID nonblank executed/declined/cancelled/not-executed result batches, readable unmodified malformed pre-existing rows, complete UI transcript metadata, generic visible failure outcomes with complete console diagnostics, BFCache-preserving component lifecycle, complete bootstrap/search/context, caller-source evaluation, cancellation, and partial-read handling are represented with app-scoped adapters. | Live Core/provider inference and durable browser storage remain separate authorities; tests never treat a fake chat function or in-memory adapter as host/storage proof. |
46
- | Core bridge docs | Canonical namespace/method/event/entity inventories match their one-per-member guides and required sections. | Live Core conformance belongs in Arcane OS because Core implementation is not shipped as SDK source. |
46
+ | Core bridge docs | Canonical namespace/method/event/entity inventories match their one-per-member guides and required sections. | SDK Core primitives and portable assembly have their own source fixtures. Live composed-host conformance and actual platform behavior remain separate evidence. |
47
47
  | Arcane Ollama wrapper | Missing-host error, method forwarding, text/readiness normalization, unload request, and stream-option forwarding run against a deterministic fake `Arcane.ollama`. | Real managed-service, model download/create, GPU/resource admission, and service restart require an admitted Arcane host. |
48
48
  | Native providers | Plan/provider protocol, explicit target, complete artifact reading, and unavailable-path honesty are tested with fixtures. | Windows, Linux, or Android artifact verification and launch must run on that actual platform/architecture and only when explicitly selected. |
49
49
 
@@ -122,8 +122,9 @@ not prove already-started host, provider, worker, or queue work stopped.
122
122
  The SDK owns the singleton authority, its per-realm source adapters, package and
123
123
  managed-browser projections, focused event/source/DOM contracts, runtime
124
124
  compatibility views, package, CLI, synchronized renderer, documentation, and
125
- injected provider-boundary behavior. Arcane OS owns live Core dispatch, native host
126
- bridges, capability policy, host service adapters, and real ArcaneOllama
127
- integration. A change that crosses both repositories needs focused tests at both
128
- owners; copying a Core test into this package would not make the SDK the Core
129
- implementation owner.
125
+ injected provider-boundary behavior, reusable Core client/runtime/service
126
+ lifecycle and package-owned portable assembly. Arcane OS owns its product host
127
+ composition, Shell, Provisioner, model choices and application policy. Source
128
+ fixtures do not establish execution of the composed host, platform executable,
129
+ installer or model service. Verification stays at the selected owning output
130
+ and follows the active testing authority.
@@ -692,11 +692,13 @@ npm exec -- arcane verify-bundle dist/hello-world-1.0.0.arcane-app.tar.gz
692
692
 
693
693
  ### Overview
694
694
 
695
- Loads one fixed native provider from one explicit Arcane OS checkout and
696
- diagnoses the selected target/host prerequisites without building an app.
695
+ Loads the SDK package provider for portable by default, or the fixed provider
696
+ from an explicitly selected Arcane OS checkout. It diagnoses the selected
697
+ provider prerequisites without building an app. Executable targets still
698
+ require `--arcane-root` and their platform toolchains.
697
699
 
698
700
  ```text
699
- arcane native-doctor --target <native-target> --arcane-root <directory>
701
+ arcane native-doctor --target <native-target> [--arcane-root <directory>]
700
702
  ```
701
703
 
702
704
  ### Availability
@@ -722,7 +724,7 @@ It is not a prerequisite command to repeat immediately before `build`; `build`
722
724
  prepares its own selected toolchain state.
723
725
 
724
726
  ```text
725
- arcane native-prepare --target <native-target> --arcane-root <directory>
727
+ arcane native-prepare --target <native-target> [--arcane-root <directory>]
726
728
  ```
727
729
 
728
730
  ### Example
@@ -749,6 +751,12 @@ The command selects one workspace, app, target, architecture, format, signing
749
751
  profile, and output root. Current providers emit a portable directory,
750
752
  Windows x64 EXE bundle, Linux x64/ARM64 DEB, or development-signed Android APK.
751
753
  The output remains target-specific inside the common plan contract.
754
+ Portable uses the SDK package without an OS checkout, copies complete selected
755
+ app/dependency payloads and generates the Core entry/classic client source.
756
+ It adds no executable platform host or automatically discovered app services.
757
+ An explicit `--arcane-root` continues to select the checkout provider.
758
+ Integrated builds retain an output root outside the OS checkout; only an
759
+ explicit checkout provider must share the workspace root.
752
760
  The app's `outputDirectory` selects its packaged browser-content input;
753
761
  native `--output-root` independently selects native build output.
754
762
  `--dry-run` is implemented for the browser build path. Native builds reject it