arcane-os 0.5.10 → 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.
- package/CHANGELOG.md +19 -0
- package/README.md +117 -26
- package/browser-runtime/ai/browser-speech-providers.mjs +1 -1
- package/docs/architecture.md +303 -0
- package/docs/compatibility.md +38 -0
- package/docs/event-manager.md +263 -0
- package/docs/platform-targets.md +104 -0
- package/docs/publishing.md +126 -0
- package/docs/reference/README.md +206 -0
- package/docs/reference/ai/browser-speech.md +813 -0
- package/docs/reference/ai/browser-wasm.md +637 -0
- package/docs/reference/ai/twin-cloud.md +156 -0
- package/docs/reference/arcane-ollama.md +288 -0
- package/docs/reference/availability-and-normalization.md +224 -0
- package/docs/reference/behavioral-testing.md +129 -0
- package/docs/reference/cli.md +820 -0
- package/docs/reference/core/README.md +61 -0
- package/docs/reference/core/arcane-ai-contracts.md +907 -0
- package/docs/reference/core/arcane-api.md +601 -0
- package/docs/reference/core/arcane-entities.md +59 -0
- package/docs/reference/core/arcane-events.md +134 -0
- package/docs/reference/core/ollama-module.md +181 -0
- package/docs/reference/core/reference/arcane-api/ai-and-ollama.md +1909 -0
- package/docs/reference/core/reference/arcane-api/applications-terminal-capabilities.md +1057 -0
- package/docs/reference/core/reference/arcane-api/core-and-events.md +320 -0
- package/docs/reference/core/reference/arcane-api/filesystem-storage-preferences-appearance.md +610 -0
- package/docs/reference/core/reference/arcane-api/namespaces.md +1157 -0
- package/docs/reference/core/reference/arcane-api/platform-installation-users-system.md +1423 -0
- package/docs/reference/core/reference/arcane-api/session-provisioning-diagnostics-development.md +315 -0
- package/docs/reference/event-manager.md +1409 -0
- package/docs/reference/inventory/package-api.json +3194 -0
- package/docs/reference/inventory/runtime-components.json +1015 -0
- package/docs/reference/inventory/runtime-entities.json +25 -0
- package/docs/reference/inventory/runtime-modules.json +1367 -0
- package/docs/reference/mail.md +309 -0
- package/docs/reference/protocols.md +749 -0
- package/docs/reference/runtime-components.md +1529 -0
- package/docs/reference/runtime-entities.md +305 -0
- package/docs/reference/runtime-modules.md +3275 -0
- package/docs/reference/sdk-api.md +6733 -0
- package/docs/roadmap.md +79 -0
- package/docs/work-amplification.md +66 -0
- package/examples/wasm-ai-demo/README.md +80 -0
- package/examples/wasm-ai-demo/app.js +787 -0
- package/examples/wasm-ai-demo/index.html +343 -0
- package/examples/wasm-ai-demo/profile-tools.js +217 -0
- package/examples/wasm-ai-demo/profiles/BOSS.Modelfile +106 -0
- package/examples/wasm-ai-demo/profiles/PreCrisis.Modelfile +693 -0
- package/examples/wasm-ai-demo/rag/boss-library.json +3006 -0
- package/examples/wasm-ai-demo/rag.js +295 -0
- package/examples/wasm-ai-demo/server.mjs +71 -0
- package/package.json +10 -1
- package/runtime/arcane/modules/AI.js +1 -1
- package/runtime/arcane/modules/AIProviderRuntime.js +26 -5
|
@@ -0,0 +1,206 @@
|
|
|
1
|
+
# Arcane OS SDK developer reference
|
|
2
|
+
|
|
3
|
+
This reference answers developer questions in this order:
|
|
4
|
+
|
|
5
|
+
1. **What can the application or tool do?**
|
|
6
|
+
2. **What should I import or call?**
|
|
7
|
+
3. **What does a successful result look like?**
|
|
8
|
+
4. **Where does it run?**
|
|
9
|
+
5. **Only when needed: which transport, host, provider, or kernel boundary implements it?**
|
|
10
|
+
|
|
11
|
+
The default path is capability-first. Transport and implementation detail is
|
|
12
|
+
kept in the [protocol and host architecture guide](protocols.md), and every
|
|
13
|
+
high-level page links to the relevant deep section instead of repeating it.
|
|
14
|
+
|
|
15
|
+
## Start with one working request
|
|
16
|
+
|
|
17
|
+
Install the SDK in your application:
|
|
18
|
+
|
|
19
|
+
```sh
|
|
20
|
+
npm install --save-exact arcane-os@0.5.11
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
For your first AI call, follow the [TWiN Cloud quick start](ai/twin-cloud.md).
|
|
24
|
+
For on-device speech, follow the [browser speech quick start](ai/browser-speech.md)
|
|
25
|
+
and the complete [browser AI demo](https://github.com/TheWizardNexus/arcane-os-sdk/tree/main/examples/wasm-ai-demo).
|
|
26
|
+
Each guide names the application configuration you supply and shows the public
|
|
27
|
+
call, response, cancellation, and error handling. Browser module imports use
|
|
28
|
+
the SDK's [materialized import map](cli.md#arcane-import-map); installing npm
|
|
29
|
+
alone does not make bare module names resolve in a browser.
|
|
30
|
+
|
|
31
|
+
## Reference map
|
|
32
|
+
|
|
33
|
+
| Need | Start here |
|
|
34
|
+
| --- | --- |
|
|
35
|
+
| Use the Node.js package API | [SDK JavaScript API](sdk-api.md) |
|
|
36
|
+
| Publish central events, capture complete time-travel history, or observe the DOM | [EventManager and event-stack reference](event-manager.md) |
|
|
37
|
+
| Use the `arcane` command | [CLI reference](cli.md) |
|
|
38
|
+
| 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) |
|
|
39
|
+
| Choose browser, native, cloud, or cross-host behavior | [Availability and normalization](availability-and-normalization.md) |
|
|
40
|
+
| Import a shipped renderer module | [Runtime module catalog](runtime-modules.md) |
|
|
41
|
+
| Use a shared entity | [Runtime entity modules](runtime-entities.md) and [exact export contracts](core/arcane-entities.md) |
|
|
42
|
+
| Load a reusable HTML component | [Runtime component catalog](runtime-components.md) |
|
|
43
|
+
| Call `globalThis.Arcane` | [Arcane Core API](core/arcane-api.md) |
|
|
44
|
+
| Subscribe to native events | [Arcane event reference](core/arcane-events.md) |
|
|
45
|
+
| Use provider-neutral AI lifecycle, chat, speech, persistence, or document context | [Normalized AI](#normalized-ai) |
|
|
46
|
+
| Run a caller-selected local LLM in the browser | [Browser-WASM local AI](ai/browser-wasm.md) |
|
|
47
|
+
| Run caller-selected Whisper or Kokoro in the browser | [Browser speech providers](ai/browser-speech.md) |
|
|
48
|
+
| Send one TWiN Cloud request or migrate saved LLM preferences | [TWiN Cloud quick start](ai/twin-cloud.md) |
|
|
49
|
+
| Use Arcane Ollama | [Arcane Ollama guide](arcane-ollama.md) |
|
|
50
|
+
| Understand transports and protocol switching | [Protocol and host architecture](protocols.md) |
|
|
51
|
+
| Run contract and behavior tests | [Behavioral testing](behavioral-testing.md) |
|
|
52
|
+
|
|
53
|
+
## Version scope and source ownership
|
|
54
|
+
|
|
55
|
+
This repository contains explicitly versioned surfaces with different owners:
|
|
56
|
+
|
|
57
|
+
| Surface | Source identity | Meaning |
|
|
58
|
+
| --- | --- | --- |
|
|
59
|
+
| SDK and CLI | `arcane-os` `0.5.11` | The Node.js toolchain, portable `arcane-os/event-manager`, `arcane-os/mail`, `arcane-os/preference-store`, and `arcane-os/speech-playback` entrypoints, plus the browser-only `arcane-os/ai/browser-wasm` and `arcane-os/ai/browser-speech` entrypoints in this checkout. |
|
|
60
|
+
| Browser runtime | SDK `0.5.11`, protocol `arcane/1`, `runtime/` | The SDK-canonical runtime tree. `listRuntimeFiles()`, `readRuntimeFile()`, and `loadRuntimeRelease()` derive its current inventory directly from the selected directory. |
|
|
61
|
+
| Browser SDK runtime | SDK `0.5.11`, `browser-runtime/` | The browser closure for events, Wllama, and Browser Speech mechanisms. `listSdkBrowserRuntimeFiles()`, `readSdkBrowserRuntimeFile()`, and `loadSdkBrowserRuntimeRelease()` derive its current inventory directly from the selected directory. |
|
|
62
|
+
| 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. |
|
|
63
|
+
|
|
64
|
+
The SDK runtime source and Core reference have different owners. A browser
|
|
65
|
+
module comes from the selected SDK runtime tree. A native build selects one
|
|
66
|
+
explicit Arcane OS checkout and Core, then checks the declared protocol,
|
|
67
|
+
version, features, capabilities, methods, and provider contract needed by that
|
|
68
|
+
build. A matching protocol name or higher version alone does not promise
|
|
69
|
+
functional compatibility.
|
|
70
|
+
|
|
71
|
+
See the [Core reference source notes](core/README.md) for the imported inventory
|
|
72
|
+
and the distinction between a documentation snapshot and the selected runtime.
|
|
73
|
+
|
|
74
|
+
## Installed documentation and release identity
|
|
75
|
+
|
|
76
|
+
This reference accompanies `arcane-os@0.5.11`. The installed package includes
|
|
77
|
+
the maintained `docs/` tree and `examples/wasm-ai-demo/` source alongside
|
|
78
|
+
README and CHANGELOG. Open `node_modules/arcane-os/docs/reference/README.md`
|
|
79
|
+
for the matching local reference. The generated website and test suites remain
|
|
80
|
+
repository surfaces.
|
|
81
|
+
|
|
82
|
+
Read the installed version and current registry channel separately:
|
|
83
|
+
|
|
84
|
+
```sh
|
|
85
|
+
npm list arcane-os
|
|
86
|
+
npm view arcane-os@latest version
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
The [changelog](../../CHANGELOG.md) records changes by version; the
|
|
90
|
+
[GitHub releases](https://github.com/TheWizardNexus/arcane-os-sdk/releases)
|
|
91
|
+
identify the corresponding published package source. A newer website does not
|
|
92
|
+
change the version installed in your application.
|
|
93
|
+
|
|
94
|
+
### Historical 0.3.4 publication record
|
|
95
|
+
|
|
96
|
+
The following records describe that earlier release only. They do not identify
|
|
97
|
+
the current registry channel or the package covered by this reference.
|
|
98
|
+
|
|
99
|
+
| Release boundary | Exact value |
|
|
100
|
+
| --- | --- |
|
|
101
|
+
| npm package | `arcane-os@0.3.4` |
|
|
102
|
+
| Package source | `9e657b31f758a2c7943446533fe87afda206ac49` |
|
|
103
|
+
| GitHub release | [`0.3.4`](https://github.com/TheWizardNexus/arcane-os-sdk/releases/tag/0.3.4) (tag and title are both exactly `0.3.4`) |
|
|
104
|
+
| Selected package run | [Check run 33268940871](https://github.com/TheWizardNexus/arcane-os-sdk/actions/runs/33268940871) |
|
|
105
|
+
| Selected publication run | [Publish run 33268987444](https://github.com/TheWizardNexus/arcane-os-sdk/actions/runs/33268987444) |
|
|
106
|
+
|
|
107
|
+
## MDN-style page contract
|
|
108
|
+
|
|
109
|
+
Public reference entries follow the established Arcane documentation model:
|
|
110
|
+
|
|
111
|
+
- one canonical, mechanically readable inventory owns each public name;
|
|
112
|
+
- every public member or module has one guide entry headed by its exact name;
|
|
113
|
+
- each guide leads with an overview and the shortest safe working example;
|
|
114
|
+
- parameters, return values, errors, side effects, cancellation, and events are
|
|
115
|
+
stated when they apply;
|
|
116
|
+
- availability is summarized near the call, while transport mechanics are
|
|
117
|
+
folded into or deep-linked from the entry;
|
|
118
|
+
- normalized results are distinguished from provider- or platform-native
|
|
119
|
+
envelopes;
|
|
120
|
+
- examples do not trigger destructive, privileged, expensive, or external
|
|
121
|
+
actions merely by being copied.
|
|
122
|
+
|
|
123
|
+
## Public runtime inventory
|
|
124
|
+
|
|
125
|
+
The package exposes 204 semantic JavaScript records across 16 JavaScript
|
|
126
|
+
entrypoints, plus eight JSON Schemas and package metadata. Ten entrypoints are
|
|
127
|
+
Node.js control-plane surfaces,
|
|
128
|
+
`arcane-os/event-manager`, `arcane-os/mail`, `arcane-os/preference-store`, and
|
|
129
|
+
`arcane-os/speech-playback` run in Node and browsers, and
|
|
130
|
+
`arcane-os/ai/browser-wasm` plus `arcane-os/ai/browser-speech` are browser-only.
|
|
131
|
+
The [machine-readable package
|
|
132
|
+
inventory](inventory/package-api.json) and [SDK member reference](sdk-api.md)
|
|
133
|
+
are checked bidirectionally against every declared JavaScript export.
|
|
134
|
+
|
|
135
|
+
The seven update-check records are explicit on-demand checks; they do not poll,
|
|
136
|
+
download, install, or self-update.
|
|
137
|
+
|
|
138
|
+
The synchronized browser payload exposes:
|
|
139
|
+
|
|
140
|
+
- 82 JavaScript module artifacts under `runtime/arcane/modules/`, including
|
|
141
|
+
ESM modules, classic vendor globals, one worker protocol, and one Node-oriented
|
|
142
|
+
mail transport;
|
|
143
|
+
- 14 shared entity modules under `runtime/arcane/entities/`;
|
|
144
|
+
- 39 reusable HTML-import components under `runtime/arcane/components/`;
|
|
145
|
+
- seven shared CSS artifacts, images, optional physical-workspace security
|
|
146
|
+
files where present, and the vendored `strong-type` dependency.
|
|
147
|
+
|
|
148
|
+
The module and component catalogs enumerate every shipped artifact, including
|
|
149
|
+
vendor support files that are not ESM imports. The selected runtime directories
|
|
150
|
+
and their current source inventories remain authoritative; the catalogs explain
|
|
151
|
+
what those artifacts let a developer do.
|
|
152
|
+
|
|
153
|
+
## Normalized AI
|
|
154
|
+
|
|
155
|
+
Portable applications start with the provider-neutral runtime rather than an
|
|
156
|
+
Ollama, Wllama, Whisper, Kokoro, native, or cloud transport:
|
|
157
|
+
|
|
158
|
+
| Need | Public surface | Availability |
|
|
159
|
+
| --- | --- | --- |
|
|
160
|
+
| Select, load, unload, inspect, cancel, and use LLM/STT/TTS independently | [`AIProviderRuntime.js`](runtime-modules.md#aiproviderruntimejs) | Cross-host controller; each registered provider declares its own host requirements. |
|
|
161
|
+
| Observe sticky role state and startup settlement | [`AIRuntimeState.js`](runtime-modules.md#airuntimestatejs) | Cross-host EventTarget state; observation grants no authority. |
|
|
162
|
+
| Offer explicit selected-model start/cancel UI | [`chat.html`](runtime-components.md#chathtml), [`speech.html`](runtime-components.md#speechhtml), and [`voice-transcription.html`](runtime-components.md#voice-transcriptionhtml) | Browser/native WebView components; user activation emits a cancelable request before any LLM or STT load intent, and recording stays disabled without sticky ready STT. |
|
|
163
|
+
| Use Core-normalized chat | [`globalThis.Arcane.ai`](core/arcane-ai-contracts.md) | Native/Core only when separately admitted. |
|
|
164
|
+
| Run a caller-selected GGUF LLM locally | [`arcane-os/ai/browser-wasm`](ai/browser-wasm.md) | Browser secure context with WebGPU full-offload availability, WebAssembly, and OPFS/DBOPFS. |
|
|
165
|
+
| Run caller-selected Whisper/Kokoro locally | [`arcane-os/ai/browser-speech`](ai/browser-speech.md) | Browser with DBOPFS, Web Locks, Workers, and caller-supplied runtime and model sources; Kokoro supports bounded Worker/session concurrency with automatic WebGPU-first execution and complete WASM-pool fallback. |
|
|
166
|
+
| Add bounded persistent history and memory | [`PersistentAIChatSession.js`](runtime-modules.md#persistentaichatsessionjs) | Browser/native WebView runtime with ChatEntity/DBOPFS and a configured chat function. |
|
|
167
|
+
| Add explicit document search/context | [`DBOPFSDocumentLibrary.js`](runtime-modules.md#dbopfsdocumentlibraryjs) | Existing DBOPFS-style adapter; search occurs only after the app calls it or deliberately wires its context builder into chat. |
|
|
168
|
+
|
|
169
|
+
There is no automatic local-to-cloud, browser-to-Core, provider-to-provider, or
|
|
170
|
+
storage fallback. Tool calls remain structural data until application-owned
|
|
171
|
+
policy and code decide whether to execute them. App prompts, model defaults,
|
|
172
|
+
profiles, tools, business policy, and private data remain app-owned.
|
|
173
|
+
|
|
174
|
+
An explicitly selected but unloaded model is not “ready.” `chat.html` keeps
|
|
175
|
+
Send disabled and exposes a visible keyboard-operable LLM Start/Try again or
|
|
176
|
+
Cancel loading control. `speech.html` and `voice-transcription.html` keep their
|
|
177
|
+
recording operations unavailable and share the equivalent Start
|
|
178
|
+
transcription/Try again/Cancel loading control for STT. Applications can
|
|
179
|
+
override `requestAIActivation(intent)` or `requestSTTActivation(intent)`, or
|
|
180
|
+
cancel the corresponding activation-request event. Imports and state
|
|
181
|
+
observation emit no lifecycle intent, and default
|
|
182
|
+
`startTranscription=false` does not request an STT startup load or begin an
|
|
183
|
+
automatic model download. It does not unload a role started independently.
|
|
184
|
+
Reported availability never creates ready STT/TTS state without an
|
|
185
|
+
admitted, loaded provider. Shared STT cancel/destroy propagates an owned signal,
|
|
186
|
+
and TTS Mute/Unmute updates the shared lifecycle owner. The selected local TTS
|
|
187
|
+
provider/model catalog owns its default voice; a saved OpenAI-route voice is not
|
|
188
|
+
forwarded to Core or browser speech.
|
|
189
|
+
|
|
190
|
+
## Authority and feature detection
|
|
191
|
+
|
|
192
|
+
The presence of a JavaScript function is not permission to use it. Native
|
|
193
|
+
applications should inspect `Arcane.capabilities.list()` where available and
|
|
194
|
+
then call the relevant status method. Android callers with `system.read` obtain
|
|
195
|
+
the nested capability snapshot through `Arcane.platform.status()`.
|
|
196
|
+
|
|
197
|
+
Do not infer local-AI readiness from `Arcane.runtime.current().managedLocalAI`,
|
|
198
|
+
infer authorization from a transport name, or treat an Ollama model inventory
|
|
199
|
+
as package admission. Each method rechecks native policy at invocation time.
|
|
200
|
+
|
|
201
|
+
## Source and licensing
|
|
202
|
+
|
|
203
|
+
- [SDK runtime source](../../runtime/arcane)
|
|
204
|
+
- [AGPL license](../../LICENSE)
|
|
205
|
+
- [Commercial-license notice](../../COMMERCIAL-LICENSE.md)
|
|
206
|
+
- [Third-party and distribution notice](../../NOTICE)
|