arcane-os 0.5.9 → 0.5.11

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 (55) hide show
  1. package/CHANGELOG.md +28 -0
  2. package/README.md +117 -26
  3. package/browser-runtime/ai/browser-speech-providers.mjs +1 -1
  4. package/browser-runtime/ai/browser-wasm-llm-provider.mjs +63 -39
  5. package/docs/architecture.md +303 -0
  6. package/docs/compatibility.md +38 -0
  7. package/docs/event-manager.md +263 -0
  8. package/docs/platform-targets.md +104 -0
  9. package/docs/publishing.md +126 -0
  10. package/docs/reference/README.md +206 -0
  11. package/docs/reference/ai/browser-speech.md +813 -0
  12. package/docs/reference/ai/browser-wasm.md +637 -0
  13. package/docs/reference/ai/twin-cloud.md +156 -0
  14. package/docs/reference/arcane-ollama.md +288 -0
  15. package/docs/reference/availability-and-normalization.md +224 -0
  16. package/docs/reference/behavioral-testing.md +129 -0
  17. package/docs/reference/cli.md +820 -0
  18. package/docs/reference/core/README.md +61 -0
  19. package/docs/reference/core/arcane-ai-contracts.md +907 -0
  20. package/docs/reference/core/arcane-api.md +601 -0
  21. package/docs/reference/core/arcane-entities.md +59 -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 +1409 -0
  32. package/docs/reference/inventory/package-api.json +3194 -0
  33. package/docs/reference/inventory/runtime-components.json +1015 -0
  34. package/docs/reference/inventory/runtime-entities.json +25 -0
  35. package/docs/reference/inventory/runtime-modules.json +1367 -0
  36. package/docs/reference/mail.md +309 -0
  37. package/docs/reference/protocols.md +749 -0
  38. package/docs/reference/runtime-components.md +1529 -0
  39. package/docs/reference/runtime-entities.md +305 -0
  40. package/docs/reference/runtime-modules.md +3275 -0
  41. package/docs/reference/sdk-api.md +6733 -0
  42. package/docs/roadmap.md +79 -0
  43. package/docs/work-amplification.md +66 -0
  44. package/examples/wasm-ai-demo/README.md +80 -0
  45. package/examples/wasm-ai-demo/app.js +787 -0
  46. package/examples/wasm-ai-demo/index.html +343 -0
  47. package/examples/wasm-ai-demo/profile-tools.js +217 -0
  48. package/examples/wasm-ai-demo/profiles/BOSS.Modelfile +106 -0
  49. package/examples/wasm-ai-demo/profiles/PreCrisis.Modelfile +693 -0
  50. package/examples/wasm-ai-demo/rag/boss-library.json +3006 -0
  51. package/examples/wasm-ai-demo/rag.js +295 -0
  52. package/examples/wasm-ai-demo/server.mjs +71 -0
  53. package/package.json +11 -2
  54. package/runtime/arcane/modules/AI.js +1 -1
  55. package/runtime/arcane/modules/AIProviderRuntime.js +26 -5
@@ -0,0 +1,79 @@
1
+ # Development roadmap
2
+
3
+ The SDK contract keeps target names and operations stable while each current
4
+ development provider gathers its remaining promotion evidence. Each item below
5
+ is small enough to become a GitHub issue without combining every platform into
6
+ one unbounded build.
7
+
8
+ ## Publication prerequisites
9
+
10
+ - Mark the Arcane OS monorepo root package private or give it an internal-only
11
+ package name before the first `arcane-os` publication.
12
+ - Decide and document the license that permits proprietary applications to
13
+ bundle the synchronized Arcane runtime.
14
+ - Publish one fresh, never-reused prerelease candidate under only the npm `dev`
15
+ tag, verify the tarball and
16
+ provenance, add a second appropriate npm owner, and configure the exact
17
+ trusted-publisher workflow.
18
+
19
+ ## App admission and native extraction
20
+
21
+ - Keep the implemented process-local `arcane-native-build-plan/1` and
22
+ `arcane-native-builder/1` lifecycle as the single provider seam for the CLI,
23
+ GUI, CI, and Codex. Portable, Windows x64, Linux x64, Linux ARM64, and Android
24
+ ARM64 pair only through an explicit compatible Arcane root and a matching
25
+ canonical scaffold descriptor.
26
+ - Migrate built-in apps from the implemented schema-2 `arcane-app.json`
27
+ descriptor fallback to authored descriptors without changing exact v1 release
28
+ or native-host artifacts.
29
+ - Update Arcane's exact-key consumers to project the new descriptor into the
30
+ current catalog while preserving v1 app-release admission during migration.
31
+ - Preserve the implemented portable, Windows x64, Linux x64, Linux ARM64, and
32
+ Android ARM64 providers as one selected app plus its exact declared dependency
33
+ closure. Add new providers without weakening that release-reader boundary.
34
+ - Extend the implemented same-process retained receipt lifecycle through an
35
+ authenticated Arcane host broker only when persistent cross-process reuse or
36
+ restartable app-scoped Core sessions are required.
37
+ - Preserve exact packaged-artifact authority across browser and native plan,
38
+ verify, and run boundaries; never regress to treating a mutable path or
39
+ manifest file as a reusable receipt.
40
+ - Add a manifest-declared origin policy for native enforcement and an optional
41
+ policy-faithful development mode. The current capability-gated loopback host
42
+ deliberately uses a broad development-only policy so the shared runtime can
43
+ exercise remote providers, media, WebSockets, and embeds.
44
+
45
+ ## Platform adapters
46
+
47
+ - `portable`: keep the available verified app-scoped Core directory reproducible
48
+ from an external packed-SDK install and an explicit compatible Arcane checkout;
49
+ do not present it as an executable or direct-run target.
50
+ - `windows-x64`: keep the implemented retained toolchain broker, EXE bundle,
51
+ authenticated host-readiness signal, and owned same-process cancellation
52
+ reproducible. Production signing and installation remain separate work.
53
+ - `linux-x64`: keep the implemented single-app WebKitGTK host, verified amd64
54
+ DEB, user-owned extraction, and same-process cancellation reproducible. Add
55
+ AppImage and RPM only as distinct later format requests.
56
+ - `linux-arm64`: keep the implemented unsigned-local-test ARM64 DEB provider,
57
+ focused provider tests, and exact-SHA native build/verification/readiness/
58
+ cancellation workflow reproducible on a compatible native ARM64 toolchain.
59
+ Keep AppImage, RPM, and production signing as separate future requests.
60
+ - `android-arm64`: keep the implemented single-app, development-signed APK path
61
+ and exact-SHA physical/native ARM64 build/readiness/cleanup evidence
62
+ reproducible. The APK contains no native ABI and is architecture-neutral. Add
63
+ AAB, release signing, store publishing, and update continuity only as explicit
64
+ later promotion work.
65
+
66
+ ## Developer experience
67
+
68
+ - Keep the integrated shared/Core profile explicit through `--scope shared`:
69
+ one exact repository-relative focused test or Arcane's one canonical
70
+ development check, never app discovery or an arbitrary package-script loop.
71
+ - Add the Arcane Developer control panel as a client of the same operation API;
72
+ it stores local repository paths per user and never becomes a second builder.
73
+ - Add authenticated GitHub artifact admission so Arcane OS installs verified
74
+ releases without cloning proprietary source.
75
+ - Preserve the implemented integrated app-scoped native path: `--workspace` and
76
+ `--arcane-root` identify the same checkout, one app and one target are
77
+ selected, and `--output-root` remains outside the checkout. Future GUI clients
78
+ must use that path rather than introducing a second builder or an implicit
79
+ all-target build.
@@ -0,0 +1,66 @@
1
+ # Work-amplification review
2
+
3
+ The default cardinality is:
4
+
5
+ ```text
6
+ 1 workspace x 1 app x 1 command x 1 target x 1 architecture x 1 format x 1 signing profile
7
+ ```
8
+
9
+ There is no implicit all-app, all-target, or Android-flavor loop.
10
+ Selecting `android-arm64` produces exactly one architecture-neutral APK with no
11
+ native ABI fan-out. It does not build one artifact per ABI, an AAB, a release
12
+ signing variant, or a publication/update artifact. Every native invocation also
13
+ selects one explicit compatible `--arcane-root` and one app descriptor that
14
+ already declares that target; a target list never causes provider discovery or
15
+ additional builds.
16
+
17
+ The SDK repository test cardinality is:
18
+
19
+ ```text
20
+ 1 repository x 4 named sets x each assigned test file exactly once
21
+ ```
22
+
23
+ Unit, functional, integration, and regression scripts form one validated,
24
+ non-overlapping inventory. The complete command adds three lightweight set
25
+ coordinator launches compared with the former single discovery pass, but it
26
+ does not repeat a test file, assertion, package installation, provider scan,
27
+ build, or fixture. Smaller nested `vanilla-test` cases reuse their parent
28
+ file's already-owned setup and cleanup boundary.
29
+
30
+ Shared/Core development has a separate integrated-only cardinality:
31
+
32
+ ```text
33
+ 1 integrated workspace x 1 fixed provider generation x 1 operation x 1 owned process tree
34
+ ```
35
+
36
+ The focused-test operation selects exactly one repository-relative
37
+ `.test.mjs`; the development-check operation selects only Arcane's canonical
38
+ check. The provider and package manifest are each read once for the process
39
+ generation, and preparation launches one owned process tree. A focused fixture
40
+ completed in about 0.14 seconds on the development laptop; the canonical check
41
+ owns its nested npm/test process tree and performs the complete explicitly
42
+ selected check. Tests and checks run only when the user explicitly
43
+ selects them. Within one SDK process, one checkout admits only one
44
+ such process tree at a time, so concurrent requests fail busy instead of
45
+ multiplying that operation. Shared scope has no app, package, target, architecture,
46
+ format, or signing loop and does not produce app output.
47
+
48
+ ## Cold-path shape
49
+
50
+ - Scaffold writes the selected template files once before any separately
51
+ authorized dependency installation.
52
+ - Shared browser packaging copies the complete SDK runtime, browser runtime,
53
+ and licensing content once for the selected app.
54
+ - Portable build selects one app and one host platform request.
55
+ - A bundled-app closure reuses one shared runtime selection rather than reading
56
+ it again for every app; each app still writes its own complete output once.
57
+ - Windows, Linux, and Android each prepare one selected toolchain and produce
58
+ one requested development artifact. They do not fan out across undeclared
59
+ architectures, formats, or signing profiles.
60
+
61
+ Invariant work includes SDK/runtime resolution and each selected provider
62
+ generation, performed once per prepared toolchain state. App source discovery
63
+ and release inventory occur once per selected app state. Portable assembly,
64
+ Windows/Linux compilation, and Android APK assembly and development signing
65
+ occur once per requested target. Complete file traversal is streamed without
66
+ truncation, byte-count gates, byte identities, or hash-based admission.
@@ -0,0 +1,80 @@
1
+ # Arcane SDK WASM voice chat
2
+
3
+ This is a source example inside the canonical Arcane SDK repository. It consumes this checkout's live `/src`, `/browser-runtime`, and `/runtime` trees. It contains no copied SDK modules, generated runtime projection, Ollama integration, or separate local AI service.
4
+
5
+ For the smallest first request, start with the [browser speech quick start](../../docs/reference/ai/browser-speech.md) or [TWiN Cloud quick start](../../docs/reference/ai/twin-cloud.md). This example adds the shared Chat/Speech components, local LLM selection, persistence, and retrieval to those public APIs.
6
+
7
+ ## Speech defaults and inspection
8
+
9
+ The demo deliberately omits `tts.execution` in `speechConfiguration(dbopfs)` so it consumes the SDK default `{device:'auto',maxConcurrentRequests:4}`. Change that application's TTS record to `execution:{device:'wasm',maxConcurrentRequests:1}` to use less memory, or choose `webgpu` explicitly. Allowed capacities are 1 through 4; Whisper and the LLM retain capacity one.
10
+
11
+ Capacity 4 means up to four segments synthesize at once. Segment 5 and later wait in the SDK's FIFO queue; they are not dropped. Synthesis may finish out of order, but playback waits for earlier segments and plays exact input order. Each slot owns a Worker/model session, so raising capacity trades memory for latency.
12
+
13
+ Use the shared Speech component to load/unmute speech, then select **Inspect speech execution** below Chat. The button reads `ai.providerRuntime.status('tts',{execution:true}).execution` and displays requested device, selected device, capacity, active requests, and automatic WASM fallback. It is a snapshot at the moment clicked. `selectedDevice:null` means no pool is selected; `webgpu` reports the upstream execution-provider selection and does not prove physical GPU kernel overlap or audio quality. Auto may fall back to WASM with the same selected model/dtype; explicit WebGPU reports an error when it cannot load.
14
+
15
+ Shared Speech still owns mute, stop, and voice controls. The example's status button inspects the public report without loading a model or reaching into private providers.
16
+
17
+ ## Ownership
18
+
19
+ The Arcane SDK owns the shared behavior:
20
+
21
+ - `<html-import>` mounts `/runtime/arcane/components/chat.html`.
22
+ - Chat owns transcript rendering, persistence, submission state, cancellation, activation progress, and its composer.
23
+ - Chat renders AI messages on the left and user messages on the right.
24
+ - The nested SDK Speech component owns Talk, Stop, voice selection, mute state, and speech status.
25
+ - `AI`, the browser-WASM provider, and DBOPFS own model loading and model persistence.
26
+ - `ModelDefinition` owns loading and parsing the complete profile Modelfile prompt.
27
+ - Chat creates and binds the SDK's `PersistentAIChatSession`, which owns local conversation persistence.
28
+ - `DBOPFSDocumentLibrary` owns the profile-specific local document corpus, lexical retrieval, and complete request-context construction.
29
+ - `PreferenceStore` owns model and profile selection persistence.
30
+ - `startSourceExampleServer` owns live-source mounts, complete file streaming, model Range transport, TLS, and the browser-WASM isolation headers.
31
+
32
+ The example owns its branded outer shell, model/profile catalog, General, PreCrisis, and BOSS prompt policy, maintained BOSS demo catalog, local-document controls, and profile-specific tool declarations. Its BOSS retrieval policy wraps the complete context returned by `DBOPFSDocumentLibrary.buildContext()`; it does not serialize document records itself. SDK Chat displays structural tool calls; the example records them through Chat's public tool-result method with the explicit `not-executed` disposition so the persisted conversation can continue without pretending an action ran. Every declared tool requires a nonempty user-facing `message`, matching the browser-WASM provider contract.
33
+
34
+ Chat uses `PersistentAIChatSession`'s SDK-owned streaming seam, which composes live AI deltas with cancellation and one durable persisted turn. SDK Chat also owns the structural tool-call records and their visible disposition.
35
+
36
+ ## Local model assets
37
+
38
+ Model weights are deliberately excluded from Git. Place the maintained GGUF shards in `examples/wasm-ai-demo/models/`, or set `ARCANE_WASM_MODEL_ROOT` to an existing local model directory before starting the server.
39
+
40
+ The maintained model descriptors include each shard's known byte length as progress metadata. During a cold install, the SDK reports aggregate loaded and remaining bytes, transfer speed, estimated time, and active file or Range transfers while Chat presents the existing activation progress bar. Completed shards and completed Range parts within a shard remain available after interruption, so retry downloads only missing work.
41
+
42
+ The app gives the SDK browser-speech owner the existing Whisper tiny.en FP32 and Kokoro 82M Q8 descriptors. The app does not import those runtimes or create a speech worker itself.
43
+
44
+ ## Local retrieval
45
+
46
+ BOSS seeds the example's maintained document catalog through the SDK's `DBOPFSDocumentLibrary`. The Local knowledge control accepts user-selected text documents and merges them into the selected profile's SDK-owned document corpus. Retrieval remains isolated by profile, and every matching document is supplied in full to the current request.
47
+
48
+ General uses the selected model's local-browser identity prompt. PreCrisis loads `profiles/PreCrisis.Modelfile`; BOSS loads `profiles/BOSS.Modelfile` and the maintained `rag/boss-library.json` catalog. Those are consumer-owned inputs to the SDK rather than alternate Chat, persistence, speech, or model implementations.
49
+
50
+ ## Run from this checkout
51
+
52
+ From the canonical SDK repository root:
53
+
54
+ node .\examples\wasm-ai-demo\server.mjs
55
+
56
+ The npm package includes this same maintained source. From an application with
57
+ the exact SDK installed, run:
58
+
59
+ node ./node_modules/arcane-os/examples/wasm-ai-demo/server.mjs
60
+
61
+ For the installed copy, set `ARCANE_WASM_MODEL_ROOT` to your existing model
62
+ directory; do not store model downloads inside `node_modules`. The installed
63
+ server resolves `/src`, `/browser-runtime`, and `/runtime` inside its selected
64
+ SDK package. It does not require an SDK or Arcane OS source checkout.
65
+
66
+ Use this repository-root command rather than a generic Live Server extension. A server rooted at the example directory cannot expose the SDK checkout's live source routes.
67
+
68
+ Then open:
69
+
70
+ http://localhost:4173/examples/wasm-ai-demo/
71
+
72
+ The example's thin server entry imports `startSourceExampleServer` from the SDK's public `arcane-os` root export and supplies only its paths and assets; the SDK owns serving the current checkout's direct `/src`, `/browser-runtime`, and `/runtime` paths. Open the exact URL it prints at startup. HTTP is the default; when local certificate files are present in `examples/wasm-ai-demo/tls/`, the printed URL uses HTTPS instead. To reuse an existing local certificate directory without copying it into Git, set `ARCANE_WASM_TLS_ROOT` before starting the server.
73
+
74
+ For example, a local launch can point at preserved prototype assets without making them source authority:
75
+
76
+ $env:ARCANE_WASM_MODEL_ROOT = "C:\path\to\existing\models"
77
+ $env:ARCANE_WASM_TLS_ROOT = "C:\path\to\existing\tls"
78
+ node .\examples\wasm-ai-demo\server.mjs
79
+
80
+ Model weights, browser profiles, caches, generated evidence, runtime reproductions, and TLS private keys remain outside the maintained example. The preserved standalone prototype is not edited or used as runtime authority.