arcane-os 0.5.10 → 0.5.12
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 +41 -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 +879 -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 +906 -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 +1532 -0
- package/docs/reference/runtime-entities.md +305 -0
- package/docs/reference/runtime-modules.md +3310 -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 +60 -11
- package/runtime/arcane/modules/AIProviderRuntime.js +26 -5
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,46 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## Unreleased
|
|
4
|
+
|
|
5
|
+
## 0.5.12
|
|
6
|
+
|
|
7
|
+
- Add optional `voice`, `speed`, `pauseAfterMs`, and `waitForPlayback` fields to
|
|
8
|
+
`AI.streamTTS(text, end, options)`. Complete passages can enter the existing
|
|
9
|
+
segmented generation queue immediately, retain their authored pauses on the
|
|
10
|
+
audio clock, and await their own playback completion. Existing calls still
|
|
11
|
+
return after preparation; stop and terminal failure settle playback waits
|
|
12
|
+
as `false`, while autoplay permission waiting remains pending.
|
|
13
|
+
- Restore `AI.fetch(...)` and `AI.streamMessage(...)` after their unintended
|
|
14
|
+
removal during source cleanup. Their existing signatures, callbacks, return
|
|
15
|
+
behavior, and private inference plumbing remain available alongside
|
|
16
|
+
`fetchRequest({...})` and `streamRequest({...})`; callers do not need to
|
|
17
|
+
migrate. Restore chat-memory callers and document both public forms as
|
|
18
|
+
sharing the current provider implementations.
|
|
19
|
+
- Update maintained SDK references and their generated pages, omit obsolete
|
|
20
|
+
provider context-token guidance, and describe current native defaults and
|
|
21
|
+
Winlogon bindings without treating them
|
|
22
|
+
as retired SDK APIs. Native Core implementations and upstream dependencies
|
|
23
|
+
are not changed by this SDK cleanup.
|
|
24
|
+
|
|
25
|
+
## 0.5.11
|
|
26
|
+
|
|
27
|
+
- Default browser Kokoro TTS to four concurrent synthesis slots in both the
|
|
28
|
+
high-level AI configuration and direct provider. Explicit capacities 1–4
|
|
29
|
+
remain supported; LLM and Whisper/STT capacity remains one. Overflow waits
|
|
30
|
+
in the provider-neutral FIFO queue, and playback retains exact input order
|
|
31
|
+
with contiguous AudioContext scheduling. Each slot owns a Worker/model
|
|
32
|
+
session, trading memory for latency without promising physical GPU overlap.
|
|
33
|
+
- Add opt-in live execution details through
|
|
34
|
+
`ai.providerRuntime.status('tts', {execution: true}).execution`, including
|
|
35
|
+
requested and selected device, capacity, and active requests. Existing
|
|
36
|
+
no-option status snapshots keep their behavior; automatic WASM fallback is
|
|
37
|
+
observable without private provider access.
|
|
38
|
+
- Front-load basic browser speech and TWiN examples, document exact saved
|
|
39
|
+
preference migration, refresh current reference inventories and generated
|
|
40
|
+
site content, and include maintained `docs/` and the browser AI demo source
|
|
41
|
+
in the installed package. Documentation deployment now uses an explicit
|
|
42
|
+
selected-main Pages workflow.
|
|
43
|
+
|
|
3
44
|
## 0.5.10
|
|
4
45
|
|
|
5
46
|
- Show one Windows performance-GPU flag advisory for the current Chromium
|
package/README.md
CHANGED
|
@@ -19,7 +19,7 @@ version-locked SDK runtime, while an integrated Arcane checkout uses its live
|
|
|
19
19
|
`arcane/` runtime. Both profiles preserve the same app URLs, theme, packaging,
|
|
20
20
|
event, cancellation, and browser run contracts.
|
|
21
21
|
|
|
22
|
-
This checkout defines the `0.5.
|
|
22
|
+
This checkout defines the `0.5.12` SDK contract. Applications pin one exact npm
|
|
23
23
|
version and lockfile; registry state is deliberately not baked into application
|
|
24
24
|
artifacts.
|
|
25
25
|
|
|
@@ -29,16 +29,99 @@ The app repository's exact dependency and lockfile select the SDK; changing that
|
|
|
29
29
|
selection is an explicit repository update. Tests and checks run only when the
|
|
30
30
|
user expressly selects them, or when required for a selected release output.
|
|
31
31
|
|
|
32
|
+
## Beginner quick start
|
|
33
|
+
|
|
34
|
+
Create one browser application, install its pinned SDK, and start its source
|
|
35
|
+
server:
|
|
36
|
+
|
|
37
|
+
```bash
|
|
38
|
+
npx arcane-os@0.5.12 new hello-speech --path ./hello-speech --target browser
|
|
39
|
+
cd hello-speech
|
|
40
|
+
npm install
|
|
41
|
+
npm run dev
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
Open the URL printed by the server. The generated page owns its import map and
|
|
45
|
+
Arcane theme; its application module is `apps/hello-speech/modules/App.js`.
|
|
46
|
+
`arcane/AI` is a managed **browser import**, not an npm-exported Node inference
|
|
47
|
+
module.
|
|
48
|
+
|
|
49
|
+
For a first spoken sentence, copy the application-owned
|
|
50
|
+
[`speech-selection.js` configuration from the speech quick start](https://github.com/TheWizardNexus/arcane-os-sdk/blob/main/docs/reference/ai/browser-speech.md#quick-start-say-one-sentence)
|
|
51
|
+
beside `App.js`, then use this module. That one configuration file defines the
|
|
52
|
+
upstream runtime, model, dtype, and voice. This module creates the application's
|
|
53
|
+
DBOPFS store; the SDK creates and manages its speech providers and Workers.
|
|
54
|
+
|
|
55
|
+
```javascript
|
|
56
|
+
import arcaneThemeReady from 'arcane/ThemeBootstrap';
|
|
57
|
+
import AI, { AI_BROWSER_SPEECH_CONFIGURATION_PROTOCOL } from 'arcane/AI';
|
|
58
|
+
import DBOPFS from 'arcane/DBOPFS';
|
|
59
|
+
import { speechSelection } from './speech-selection.js';
|
|
60
|
+
|
|
61
|
+
await arcaneThemeReady;
|
|
62
|
+
const dbopfs = new DBOPFS();
|
|
63
|
+
await dbopfs.readyPromise;
|
|
64
|
+
const ai = new AI();
|
|
65
|
+
await ai.configureBrowserSpeech({
|
|
66
|
+
protocol: AI_BROWSER_SPEECH_CONFIGURATION_PROTOCOL,
|
|
67
|
+
id: 'hello-speech',
|
|
68
|
+
dbopfs,
|
|
69
|
+
tts: {
|
|
70
|
+
providerId: 'hello-kokoro',
|
|
71
|
+
model: speechSelection.model,
|
|
72
|
+
runtime: speechSelection.runtime,
|
|
73
|
+
offline: false
|
|
74
|
+
}
|
|
75
|
+
});
|
|
76
|
+
|
|
77
|
+
const button = document.createElement('button');
|
|
78
|
+
button.textContent = 'Load voice and say hello';
|
|
79
|
+
document.body.append(button);
|
|
80
|
+
button.addEventListener('click', async function sayHello() {
|
|
81
|
+
button.disabled = true;
|
|
82
|
+
try {
|
|
83
|
+
await ai.setSpeechMuted(false);
|
|
84
|
+
console.log(ai.providerRuntime.status('tts', { execution: true }).execution);
|
|
85
|
+
const prepared = await ai.streamTTS('Hello from Arcane. ', true);
|
|
86
|
+
console.log('Speech preparation completed:', prepared);
|
|
87
|
+
} catch (error) {
|
|
88
|
+
console.error(error.code, error.message);
|
|
89
|
+
} finally {
|
|
90
|
+
button.disabled = false;
|
|
91
|
+
}
|
|
92
|
+
});
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
The button explicitly loads/unmutes the selected model and requests speech.
|
|
96
|
+
The first load can download the app-selected runtime/model/voice; the browser
|
|
97
|
+
may need another audio-unlock gesture after a long load. Keep the complete
|
|
98
|
+
visual response available alongside speech.
|
|
99
|
+
|
|
100
|
+
Capacity 4 means up to four segments synthesize at once. Segment 5 and later
|
|
101
|
+
wait in the SDK's FIFO queue; they are not dropped. Synthesis may finish out of
|
|
102
|
+
order, but playback waits for earlier segments and plays exact input order.
|
|
103
|
+
Each slot owns a Worker/model session, so raising capacity trades memory for
|
|
104
|
+
latency.
|
|
105
|
+
|
|
106
|
+
Continue with [streaming chunks, device selection, cancellation, status, and cleanup](https://github.com/TheWizardNexus/arcane-os-sdk/blob/main/docs/reference/ai/browser-speech.md),
|
|
107
|
+
the [tiny TWiN Cloud request and saved-preference migration](https://github.com/TheWizardNexus/arcane-os-sdk/blob/main/docs/reference/ai/twin-cloud.md),
|
|
108
|
+
or the [maintained WASM voice-chat example](https://github.com/TheWizardNexus/arcane-os-sdk/tree/main/examples/wasm-ai-demo).
|
|
109
|
+
The installed package also includes `docs/` and the maintained example source:
|
|
110
|
+
open `node_modules/arcane-os/docs/reference/ai/browser-speech.md`,
|
|
111
|
+
`node_modules/arcane-os/docs/reference/ai/twin-cloud.md`, or
|
|
112
|
+
`node_modules/arcane-os/examples/wasm-ai-demo/README.md` locally. Public links
|
|
113
|
+
above work from both npm and GitHub.
|
|
114
|
+
|
|
32
115
|
## Developer API reference
|
|
33
116
|
|
|
34
|
-
Start with the [capability-first developer reference](docs/reference/README.md).
|
|
117
|
+
Start with the [capability-first developer reference](https://github.com/TheWizardNexus/arcane-os-sdk/blob/main/docs/reference/README.md).
|
|
35
118
|
It follows Arcane's MDN-style model and covers every public package export, CLI
|
|
36
119
|
command, synchronized runtime module, entity, component, Arcane Core member,
|
|
37
|
-
and Arcane Ollama method. Use the [availability and normalization matrix](docs/reference/availability-and-normalization.md)
|
|
120
|
+
and Arcane Ollama method. Use the [availability and normalization matrix](https://github.com/TheWizardNexus/arcane-os-sdk/blob/main/docs/reference/availability-and-normalization.md)
|
|
38
121
|
to distinguish Node, browser, native, cloud, and cross-host behavior; protocol
|
|
39
|
-
mechanics are kept in the folded/deep-linked [protocol guide](docs/reference/protocols.md).
|
|
40
|
-
The [behavioral-testing guide](docs/reference/behavioral-testing.md) explains the
|
|
41
|
-
executable contract, while the [machine-readable inventories](docs/reference/inventory/)
|
|
122
|
+
mechanics are kept in the folded/deep-linked [protocol guide](https://github.com/TheWizardNexus/arcane-os-sdk/blob/main/docs/reference/protocols.md).
|
|
123
|
+
The [behavioral-testing guide](https://github.com/TheWizardNexus/arcane-os-sdk/blob/main/docs/reference/behavioral-testing.md) explains the
|
|
124
|
+
executable contract, while the [machine-readable inventories](https://github.com/TheWizardNexus/arcane-os-sdk/tree/main/docs/reference/inventory/)
|
|
42
125
|
make completeness independently checkable.
|
|
43
126
|
|
|
44
127
|
## Central event instrumentation
|
|
@@ -54,7 +137,7 @@ off-by-default diagnostic option.
|
|
|
54
137
|
|
|
55
138
|
Recording is off by default. Once explicitly enabled, a session retains its
|
|
56
139
|
complete recorded content until the caller clears it or disables recording.
|
|
57
|
-
Review [the EventManager guide](docs/event-manager.md)
|
|
140
|
+
Review [the EventManager guide](https://github.com/TheWizardNexus/arcane-os-sdk/blob/main/docs/event-manager.md)
|
|
58
141
|
before enabling DOM values, node content, event details, source stacks, or live
|
|
59
142
|
event redispatch. Password targets, text-entry details, clipboard data, URL
|
|
60
143
|
attributes, and common credential keys are excluded or redacted by default.
|
|
@@ -90,10 +173,18 @@ Kokoro (`LOCAL_SPEACH` / `kokoro`) owns speech synthesis. Neither audio route
|
|
|
90
173
|
uses the TWiN key, and neither requires a cloud audio key.
|
|
91
174
|
|
|
92
175
|
The built-in provider and default-model preference sentinel are both `TWIN`.
|
|
93
|
-
Applications upgrading saved
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
176
|
+
Applications upgrading saved preference tuples must replace only uppercase
|
|
177
|
+
`OPENAI` in slot 0 (LLM provider) and slot 3 (default-model sentinel) with
|
|
178
|
+
`TWIN` through the existing application preference owner before importing
|
|
179
|
+
`AI.js` or any module that imports it, and before AI preference hydration.
|
|
180
|
+
Use dynamic import after migration; module evaluation can instantiate AI
|
|
181
|
+
immediately when the user is already ready. Keep every other
|
|
182
|
+
value unchanged, including `openai-gpt-oss-120b` and `openai-gpt-oss-20b`.
|
|
183
|
+
The SDK provides no built-in `OPENAI` alias and does not rewrite saved
|
|
184
|
+
preferences. OpenAI-compatible wire terminology and the separate Core
|
|
185
|
+
`provider:'openai'` contract are unchanged. The
|
|
186
|
+
[TWiN quick start and migration recipe](https://github.com/TheWizardNexus/arcane-os-sdk/blob/main/docs/reference/ai/twin-cloud.md)
|
|
187
|
+
show the exact application-owned operation.
|
|
97
188
|
|
|
98
189
|
`fetchRequest()` and `streamRequest()` accept the provider-neutral
|
|
99
190
|
`reasoningEffort` option with `none`, `low`, `medium`, `high`, or `max`. TWiN
|
|
@@ -110,6 +201,8 @@ profile. Each descriptor uses one ordered `files` array, so monolithic and
|
|
|
110
201
|
split GGUF models share the same contract:
|
|
111
202
|
|
|
112
203
|
```js
|
|
204
|
+
import { createBrowserModelSource } from 'arcane-os/ai/browser-wasm';
|
|
205
|
+
|
|
113
206
|
const source=createBrowserModelSource({
|
|
114
207
|
id:'app-model',
|
|
115
208
|
files:[
|
|
@@ -157,7 +250,7 @@ provider factories. The package contains the plain-JavaScript provider and
|
|
|
157
250
|
Worker machinery, not speech runtimes, models, voices, or a CDN default. An app
|
|
158
251
|
must supply each runtime/model selection explicitly. Speech roles
|
|
159
252
|
load, cancel, unload, fail, and recover independently, so speech failure never
|
|
160
|
-
silently falls back or prevents text chat. Kokoro defaults to a
|
|
253
|
+
silently falls back or prevents text chat. Kokoro defaults to a four-slot Worker
|
|
161
254
|
and model-session pool: it selects WebGPU when the browser can load the complete
|
|
162
255
|
pool and otherwise recreates that pool on WASM. Apps may select `webgpu` or
|
|
163
256
|
`wasm` explicitly and may set the bounded TTS capacity from one through four.
|
|
@@ -204,10 +297,9 @@ uses the same controller for automatic memory extraction.
|
|
|
204
297
|
Create a new repository-shaped Arcane application with the exact stable SDK:
|
|
205
298
|
|
|
206
299
|
```bash
|
|
207
|
-
npx arcane-os@0.5.
|
|
300
|
+
npx arcane-os@0.5.12 new my-app --path ./my-app --target portable --git
|
|
208
301
|
cd my-app
|
|
209
302
|
npm install
|
|
210
|
-
npm run check
|
|
211
303
|
npm run dev
|
|
212
304
|
```
|
|
213
305
|
|
|
@@ -215,7 +307,7 @@ To enroll an existing repository, install the exact SDK and initialize only
|
|
|
215
307
|
missing Arcane files:
|
|
216
308
|
|
|
217
309
|
```bash
|
|
218
|
-
npm install --save-dev --save-exact arcane-os@0.5.
|
|
310
|
+
npm install --save-dev --save-exact arcane-os@0.5.12
|
|
219
311
|
npm exec -- arcane init my-app --target portable
|
|
220
312
|
```
|
|
221
313
|
|
|
@@ -231,7 +323,7 @@ npm exec -- arcane-os targets
|
|
|
231
323
|
No global SDK install or standalone Arcane CLI is required. The application
|
|
232
324
|
repository's exact npm dependency and lockfile own the CLI and toolchain version.
|
|
233
325
|
|
|
234
|
-
Use `npx arcane-os@0.5.
|
|
326
|
+
Use `npx arcane-os@0.5.12` for the initial bootstrap because it names this npm
|
|
235
327
|
package explicitly; bare `npx arcane` outside an installed project could resolve
|
|
236
328
|
a different package. Both installed commands invoke the same headless toolchain.
|
|
237
329
|
Project-local npm scripts use the SDK pinned by that app's `package-lock.json`,
|
|
@@ -246,14 +338,12 @@ tarball install in the app's package manifest and lock:
|
|
|
246
338
|
```bash
|
|
247
339
|
# From the arcane-os-sdk checkout
|
|
248
340
|
npm ci
|
|
249
|
-
npm run check
|
|
250
341
|
npm run pack:local
|
|
251
342
|
node ./bin/arcane.mjs new local-app --path ../local-app --target portable --git
|
|
252
343
|
|
|
253
344
|
# From the generated app repository
|
|
254
345
|
cd ../local-app
|
|
255
|
-
npm install --save-dev --save-exact ../arcane-os-sdk/arcane-os-0.5.
|
|
256
|
-
npm run check
|
|
346
|
+
npm install --save-dev --save-exact ../arcane-os-sdk/arcane-os-0.5.12.tgz
|
|
257
347
|
npm ci
|
|
258
348
|
```
|
|
259
349
|
|
|
@@ -262,7 +352,7 @@ same location. The lockfile retains the selected package dependency while
|
|
|
262
352
|
Arcane uses the installed package name and version. Local directory `file:` dependencies are not
|
|
263
353
|
accepted because npm may install them as links; use a packed `.tgz`. A GitHub
|
|
264
354
|
runner also needs that tarball at the locked path. After publication, replace
|
|
265
|
-
the local declaration with the exact `arcane-os@0.5.
|
|
355
|
+
the local declaration with the exact `arcane-os@0.5.12` registry package and
|
|
266
356
|
commit the regenerated lock.
|
|
267
357
|
|
|
268
358
|
Generated repositories use `npm ci --ignore-scripts` in CI. Run dependency
|
|
@@ -393,14 +483,15 @@ npm run test:integration
|
|
|
393
483
|
npm run test:regression
|
|
394
484
|
```
|
|
395
485
|
|
|
396
|
-
|
|
486
|
+
Run a named set or `npm test` only when explicitly selecting that verification,
|
|
487
|
+
or when required for a selected release output. Large
|
|
397
488
|
fixtures stay inside one isolated file process and expose smaller nested cases,
|
|
398
489
|
so the report shows the individual behaviors without repeating setup, builds,
|
|
399
490
|
package installation, or assertions.
|
|
400
491
|
|
|
401
492
|
## Current target support
|
|
402
493
|
|
|
403
|
-
Version `0.5.
|
|
494
|
+
Version `0.5.12` exposes one browser target and five explicitly paired
|
|
404
495
|
native development targets: a non-runnable portable directory, a
|
|
405
496
|
Windows x64 unsigned-local-test EXE bundle, Linux x64 and Linux ARM64
|
|
406
497
|
unsigned-local-test DEBs, and an Android development-signed APK. The
|
|
@@ -502,11 +593,11 @@ artifact. Portable output is never represented as an executable, and unsigned
|
|
|
502
593
|
or development-signed evidence is never represented as production signing or
|
|
503
594
|
release acceptance.
|
|
504
595
|
|
|
505
|
-
See [docs/platform-targets.md](docs/platform-targets.md) for the matrix and
|
|
506
|
-
[docs/architecture.md](docs/architecture.md) for the boundary. The exact
|
|
596
|
+
See [docs/platform-targets.md](https://github.com/TheWizardNexus/arcane-os-sdk/blob/main/docs/platform-targets.md) for the matrix and
|
|
597
|
+
[docs/architecture.md](https://github.com/TheWizardNexus/arcane-os-sdk/blob/main/docs/architecture.md) for the boundary. The exact
|
|
507
598
|
minimum-version and required-contract compatibility rule is documented in
|
|
508
|
-
[docs/compatibility.md](docs/compatibility.md). The issue-ready
|
|
509
|
-
extraction sequence is tracked in [docs/roadmap.md](docs/roadmap.md).
|
|
599
|
+
[docs/compatibility.md](https://github.com/TheWizardNexus/arcane-os-sdk/blob/main/docs/compatibility.md). The issue-ready
|
|
600
|
+
extraction sequence is tracked in [docs/roadmap.md](https://github.com/TheWizardNexus/arcane-os-sdk/blob/main/docs/roadmap.md).
|
|
510
601
|
|
|
511
602
|
## Canonical app descriptor
|
|
512
603
|
|
|
@@ -21,7 +21,7 @@ const TTS_SAMPLE_RATE = 24_000;
|
|
|
21
21
|
const TTS_RESPONSE_FORMAT = "wav";
|
|
22
22
|
const TTS_EXECUTION_DEVICES = new Set(["auto", "webgpu", "wasm"]);
|
|
23
23
|
const DEFAULT_TTS_EXECUTION_DEVICE = "auto";
|
|
24
|
-
const DEFAULT_TTS_MAX_CONCURRENT_REQUESTS =
|
|
24
|
+
const DEFAULT_TTS_MAX_CONCURRENT_REQUESTS = 4;
|
|
25
25
|
const MAX_TTS_CONCURRENT_REQUESTS = 4;
|
|
26
26
|
const ROLE_REQUEST_REASON = completeValue({
|
|
27
27
|
stt: "stt-transcription-cancelled",
|
|
@@ -0,0 +1,303 @@
|
|
|
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
|
+
Arcane OS consumer checkout --+-- CLI / future GUI / Codex / CI
|
|
11
|
+
|
|
|
12
|
+
shared toolchain API
|
|
13
|
+
|
|
|
14
|
+
browser package or explicit target adapter
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
## Canonical ownership and portability boundary
|
|
18
|
+
|
|
19
|
+
The SDK repository is the canonical source for every mechanism that can be
|
|
20
|
+
reused by a portable Arcane application. That includes shared modules,
|
|
21
|
+
entities, components, themes, browser runtimes, providers, workers and assets;
|
|
22
|
+
protocol, state, startup, readiness, progress, cancellation, unload and dispose
|
|
23
|
+
machinery; public native contracts and adapters; the development source mount;
|
|
24
|
+
and the packaging and license boundaries for that portable content. In
|
|
25
|
+
particular, shared AI selected-role hydration, startup-settled state and events,
|
|
26
|
+
role readiness, lifecycle and
|
|
27
|
+
cancellation contracts, and the shared chat and speech components are
|
|
28
|
+
SDK-owned source and contracts rather than Arcane OS–owned snapshots.
|
|
29
|
+
|
|
30
|
+
Every portable application artifact materializes the complete SDK runtime,
|
|
31
|
+
assets, workers, licenses and public contracts it uses. It remains self-contained whether it runs as plain
|
|
32
|
+
HTML or inside an executable wrapper. It has no runtime dependency on an
|
|
33
|
+
Arcane OS installation, source checkout or private Arcane OS import.
|
|
34
|
+
|
|
35
|
+
Arcane OS is an SDK consumer like other applications. Its orchestrator,
|
|
36
|
+
launcher, Shell, Provisioner, system AI application and internal tools use the
|
|
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.
|
|
43
|
+
|
|
44
|
+
Each application owns its branding, prompts, data, tools, business policy,
|
|
45
|
+
model authorities and app-specific orchestration. Apply this decision order:
|
|
46
|
+
|
|
47
|
+
| Responsibility | Canonical owner |
|
|
48
|
+
|---|---|
|
|
49
|
+
| Reusable by any portable application | Arcane SDK |
|
|
50
|
+
| Host privilege, launcher, Shell or app/session admission | Arcane OS / Core |
|
|
51
|
+
| Behavior unique to one product | That application |
|
|
52
|
+
|
|
53
|
+
Do not copy a reusable implementation between the SDK, Arcane OS and an app,
|
|
54
|
+
and do not create a hidden Arcane OS source dependency. Extend one neutral SDK
|
|
55
|
+
contract and keep product policy in the consumer.
|
|
56
|
+
|
|
57
|
+
Application and consumer tasks do not modify this repository's SDK source and
|
|
58
|
+
do not hand-edit materialized `arcane/**` projections. They request a reusable
|
|
59
|
+
change from an SDK source owner, or implement behavior that is specific to their
|
|
60
|
+
product in that application's local source. Consumer projections change only
|
|
61
|
+
through the selected public package and materializer.
|
|
62
|
+
|
|
63
|
+
Development and distribution use different authority. The explicit
|
|
64
|
+
`arcane dev --sdk-runtime-source <sdk-root>` development-only live source mount
|
|
65
|
+
lets a refresh read the saved SDK source without copying it into the app.
|
|
66
|
+
Distribution never follows that mount. It embeds the application's complete
|
|
67
|
+
selected SDK projection.
|
|
68
|
+
|
|
69
|
+
`runtime/arcane/` is the SDK-canonical source. Arcane OS must consume the
|
|
70
|
+
selected SDK projection through the same package/source-mount boundary as
|
|
71
|
+
other apps; its repository-side consumer cutover is coordinated separately and
|
|
72
|
+
does not create a co-equal source. Git history records the completed ownership
|
|
73
|
+
migration; the current tree has no OS-to-SDK synchronization path.
|
|
74
|
+
|
|
75
|
+
## Workspace profiles
|
|
76
|
+
|
|
77
|
+
An external workspace maps the exact runtime shipped by its locked `arcane-os`
|
|
78
|
+
dependency. An Arcane OS checkout is an integrated SDK consumer, not the owner
|
|
79
|
+
of portable runtime source. For live shared development, the explicit
|
|
80
|
+
development-only SDK source mount maps the canonical SDK runtime and dependency
|
|
81
|
+
paths into that consumer. Without the mount, the workspace uses its locked SDK
|
|
82
|
+
projection. The development server and packager consume the same route
|
|
83
|
+
destinations in both cases, so app imports do not change. Integrated
|
|
84
|
+
initialization creates only app-owned files and never rewrites Arcane OS or SDK
|
|
85
|
+
root configuration.
|
|
86
|
+
|
|
87
|
+
The shared/Core development profile is a separate integrated-only scope selected
|
|
88
|
+
with `--scope shared`. The SDK loads exactly
|
|
89
|
+
`tools/integrated-development-provider.mjs` from the selected Arcane OS checkout
|
|
90
|
+
as one process generation. This is a privileged host-development provider, not
|
|
91
|
+
a source of portable SDK runtime content. That provider selects only one exact
|
|
92
|
+
repository-relative focused `.test.mjs` through Arcane's canonical focused
|
|
93
|
+
runner or Arcane's canonical development check. External workspaces cannot use
|
|
94
|
+
the scope, and shared operations never enter app discovery, packaging, target
|
|
95
|
+
planning, build, verification, or run paths. A generation change requires a new
|
|
96
|
+
CLI process.
|
|
97
|
+
Integrated app testing remains isolated to the selected `apps/<id>/test/`
|
|
98
|
+
tree; it cannot recursively select Arcane root tests or another app's tests.
|
|
99
|
+
External repositories retain their existing workspace-root plus selected-app
|
|
100
|
+
test layout.
|
|
101
|
+
|
|
102
|
+
## Development and release serving boundary
|
|
103
|
+
|
|
104
|
+
Arcane applications keep one browser-first plain HTML, CSS, and JavaScript
|
|
105
|
+
baseline. A native target runs that same application and progressively enhances
|
|
106
|
+
it through capability-gated Arcane Core access. Browser operation must not
|
|
107
|
+
depend on Core being present. A feature that genuinely requires Core reports
|
|
108
|
+
its unavailability without breaking unrelated browser
|
|
109
|
+
behavior or claiming that the capability exists.
|
|
110
|
+
|
|
111
|
+
Rapid development uses `arcane dev`. The development server maps the selected
|
|
112
|
+
application's canonical source tree and the live installed SDK/runtime routes.
|
|
113
|
+
Each request reads and returns the complete current saved source, so a browser
|
|
114
|
+
refresh shows source changes without packaging, copying
|
|
115
|
+
files into `dist`, or restarting the server. Restarting is not a content
|
|
116
|
+
synchronization step; when a refresh is stale, first verify the command, URL,
|
|
117
|
+
workspace, selected app, and resolved source route.
|
|
118
|
+
|
|
119
|
+
Development is an intentionally fast feedback loop. Keep each increment small
|
|
120
|
+
and independently understandable so its effect has one clear cause and a
|
|
121
|
+
mistake can be isolated without untangling unrelated work. A development
|
|
122
|
+
operation does not implicitly run tests, checks, packaging, builds, or release
|
|
123
|
+
verification. The developer invokes a focused test or check deliberately at an
|
|
124
|
+
explicit checkpoint; merely refreshing source does not trigger one.
|
|
125
|
+
|
|
126
|
+
Executable development uses an Arcane-owned native development wrapper around
|
|
127
|
+
the same source-serving browser surface. The wrapper is an escalated browser,
|
|
128
|
+
not a packaged application: it loads current source files and adds only the
|
|
129
|
+
selected application's declared, capability-gated local Arcane Core access.
|
|
130
|
+
It preserves the browser behavior when Core is absent, reports an unavailable
|
|
131
|
+
native-only capability honestly, and never silently substitutes a release
|
|
132
|
+
tree. Starting or refreshing this wrapper does not package, copy to `dist`, or
|
|
133
|
+
run tests automatically. The SDK must not describe native source development as
|
|
134
|
+
available until this wrapper and its explicit capability boundary are actually
|
|
135
|
+
implemented.
|
|
136
|
+
|
|
137
|
+
Packaging and release verification are separate explicit operations. Run
|
|
138
|
+
`arcane package` to generate `dist/<id>`, then use
|
|
139
|
+
`arcane run --target browser` to serve that selected release. Packaging does
|
|
140
|
+
not automatically run tests or checks; those run only when the user expressly
|
|
141
|
+
requests them or when required for a separately selected release output. The browser
|
|
142
|
+
run command does not substitute source files. If source changes after
|
|
143
|
+
packaging, the prior `dist` remains intentionally unchanged until the next
|
|
144
|
+
explicit package operation. Never use packaged `dist` as the everyday
|
|
145
|
+
development tree, and never treat source-serving behavior as evidence for the
|
|
146
|
+
release artifact.
|
|
147
|
+
|
|
148
|
+
## App and release contract
|
|
149
|
+
|
|
150
|
+
The first SDK version deliberately preserves Arcane's current repository-shaped
|
|
151
|
+
URLs and release schema:
|
|
152
|
+
|
|
153
|
+
```text
|
|
154
|
+
apps/<id>/arcane-app.json
|
|
155
|
+
apps/<id>/arcane-package.json
|
|
156
|
+
apps/<id>/index.html
|
|
157
|
+
dist/<id>/ARCANE_APP_RELEASE.json
|
|
158
|
+
```
|
|
159
|
+
|
|
160
|
+
The authored schema-2 descriptor is canonical for new apps and projects an
|
|
161
|
+
exact schema-1 `arcane-package.json` for current consumers. Existing Arcane
|
|
162
|
+
apps synthesize that descriptor from their schema-1 package plus the current
|
|
163
|
+
native registry during migration.
|
|
164
|
+
|
|
165
|
+
An external app's `arcane-packager.json` has three exact shared routes. They map
|
|
166
|
+
the installed SDK runtime to `/arcane`, its vendored strong-type dependency to
|
|
167
|
+
`/node_modules/strong-type`, and the SDK's `LICENSE`,
|
|
168
|
+
`COMMERCIAL-LICENSE.md`, and `NOTICE` to `/licenses/arcane-os`. Development does
|
|
169
|
+
not copy SDK runtime source into the app repository. Distribution materializes
|
|
170
|
+
those selected SDK routes completely inside the portable artifact, so the
|
|
171
|
+
finished app has no Arcane OS runtime dependency.
|
|
172
|
+
|
|
173
|
+
Release schema 1 and builder identity `arcane-app-packager-v1` remain unchanged
|
|
174
|
+
because current Arcane native consumers treat them as public contracts. Native
|
|
175
|
+
builders consume the schema-2 descriptor as a separate build input while v1
|
|
176
|
+
host artifacts remain unchanged.
|
|
177
|
+
|
|
178
|
+
External repository delivery adds a distinct schema-1
|
|
179
|
+
`arcane-app-release-bundle` envelope. Bundle creation uses an authored schema-2
|
|
180
|
+
`arcane-app.json`; a synthesized package or registry projection remains valid for integrated
|
|
181
|
+
packaging but is not used for an external bundle. The
|
|
182
|
+
archive contains exactly `ARCANE_APP_BUNDLE.json`, canonical `arcane-app.json`,
|
|
183
|
+
`payload/ARCANE_APP_RELEASE.json`, and the release inventory beneath `payload/`
|
|
184
|
+
in that order. The envelope adds no repository-only source or build tooling
|
|
185
|
+
beyond that selected release inventory. Individual apps remain responsible for
|
|
186
|
+
their authored source policy.
|
|
187
|
+
|
|
188
|
+
The bundle contract uses the documented USTAR+gzip structure. Explicit bundle
|
|
189
|
+
verification parses the selected archive without extraction and rejects
|
|
190
|
+
genuinely malformed structures, unsafe or colliding paths, unsupported members,
|
|
191
|
+
trailing data, and incompatible bundle generations. These corrupt-artifact
|
|
192
|
+
checks do not create byte-count, content-hash, provenance, or admission gates
|
|
193
|
+
for ordinary development, packaging, serving, or running.
|
|
194
|
+
|
|
195
|
+
Promotion preserves any prior output until the new archive is complete.
|
|
196
|
+
Pre-commit failure restores that backup when doing so will not overwrite a
|
|
197
|
+
concurrent change; otherwise the uncertain paths remain available for
|
|
198
|
+
inspection. Ordinary results report the selected artifact and complete
|
|
199
|
+
inventory without byte identities. The workflow creates no provenance,
|
|
200
|
+
attestation, signing, or restrictive admission record.
|
|
201
|
+
|
|
202
|
+
The governing reusable app-release contract uses one `contents: read` job to
|
|
203
|
+
check out the selected caller revision, perform the caller's normal locked
|
|
204
|
+
install, package and bundle one selected app, and upload that complete bundle.
|
|
205
|
+
The checked-in workflow is unavailable until it matches this contract. The
|
|
206
|
+
contract does not include a second verifier or privileged attestation job.
|
|
207
|
+
|
|
208
|
+
## Operation ownership
|
|
209
|
+
|
|
210
|
+
An invocation defaults to one workspace, one app, one command, one target, one
|
|
211
|
+
architecture, one format, and one signing profile. It acknowledges before long
|
|
212
|
+
work, uses one `AbortController`, supervises child processes, and routes progress
|
|
213
|
+
through one serialized owned event queue. Process streams apply pause/resume
|
|
214
|
+
backpressure and heartbeats coalesce. Callback failure cancels owned work, drains
|
|
215
|
+
the queue, and reaches the caller or CLI exit status. Packaging preserves prior
|
|
216
|
+
output until replacement is complete.
|
|
217
|
+
|
|
218
|
+
Each normalized queue event is also mirrored exactly once through the shared
|
|
219
|
+
`arcaneEvents` `EventManager`. That synchronous `event-pubsub` route is the
|
|
220
|
+
canonical cross-cutting instrumentation surface, but it does not replace the
|
|
221
|
+
owned asynchronous callback path or its backpressure. Time-travel history and
|
|
222
|
+
DOM observation remain explicitly disabled unless a diagnostic session enables
|
|
223
|
+
them. See [event-manager.md](event-manager.md) for the complete record, capture,
|
|
224
|
+
DOM coverage, and effect-isolated playback boundaries.
|
|
225
|
+
|
|
226
|
+
For `--scope shared`, the cardinality changes to one integrated workspace, one
|
|
227
|
+
named operation, and either one exact test file or one development check. The
|
|
228
|
+
same owned event queue and process supervisor provide acknowledgement, complete
|
|
229
|
+
stream delivery with backpressure, heartbeat, cancellation, process-tree
|
|
230
|
+
cleanup, and nonzero
|
|
231
|
+
failure propagation. No app or target loop exists in that scope.
|
|
232
|
+
|
|
233
|
+
## Complete-content ordinary path
|
|
234
|
+
|
|
235
|
+
Packaging writes the complete schema-1 release inventory to
|
|
236
|
+
`ARCANE_APP_RELEASE.json`. Ordinary development, packaging, serving, and run
|
|
237
|
+
paths do not count, limit, hash, truncate, tail, clip, or identify content by
|
|
238
|
+
bytes, and they do not require provenance or verification receipts. The
|
|
239
|
+
loopback server reads and returns each complete selected source, runtime, or
|
|
240
|
+
packaged file. Required credential protection, malformed-input rejection,
|
|
241
|
+
applicable law, unavoidable protocol rules, and operating-system or browser
|
|
242
|
+
safety remain in effect.
|
|
243
|
+
|
|
244
|
+
## Native provider boundary
|
|
245
|
+
|
|
246
|
+
The SDK implements protocol `arcane-native-build-plan/1` and the injected
|
|
247
|
+
provider contract `arcane-native-builder/1`. Pairing is process-local; it never
|
|
248
|
+
registers a mutable global provider or searches for a toolchain. For each
|
|
249
|
+
supported native target, the CLI loads one fixed provider module from the
|
|
250
|
+
explicit `--arcane-root` Arcane OS checkout. Provider code is bound to one
|
|
251
|
+
process generation; if a pull changes loaded provider code, the caller starts a
|
|
252
|
+
fresh worker. One paired toolchain can perform this lifecycle:
|
|
253
|
+
|
|
254
|
+
```text
|
|
255
|
+
doctor -> prepare -> plan -> build -> run
|
|
256
|
+
```
|
|
257
|
+
|
|
258
|
+
The portable provider reports honestly that run is unavailable because its
|
|
259
|
+
result is a directory. Windows x64, Linux x64,
|
|
260
|
+
Linux ARM64, and Android ARM64 implement same-process launch and owned
|
|
261
|
+
cancellation when their compatible host/device requirements are present.
|
|
262
|
+
Windows uses a retained per-build broker and host readiness. The
|
|
263
|
+
Linux provider produces an amd64 or ARM64 DEB and runs a retained
|
|
264
|
+
user-owned extraction without install or elevation. Portable, Windows, and
|
|
265
|
+
Linux use the `unsigned-local-test` signing profile.
|
|
266
|
+
|
|
267
|
+
The Android provider produces one development-signed APK. It contains no native
|
|
268
|
+
library or ABI-specific payload, so the artifact is architecture-neutral; the
|
|
269
|
+
`android-arm64` target instead binds the supported run path to one physical
|
|
270
|
+
device with native ARM64 support. APK is the only Android format in this
|
|
271
|
+
development provider. AAB, release signing, publishing, and update continuity
|
|
272
|
+
remain outside it.
|
|
273
|
+
|
|
274
|
+
The plan selects one explicit `toolchainRoot`, one app release root, its
|
|
275
|
+
schema-2 descriptor, only its
|
|
276
|
+
declared dependency releases, one non-overlapping output root, and one target,
|
|
277
|
+
platform, architecture, format, and signing request. App source and workspace
|
|
278
|
+
paths are withheld from the native provider. The provider copies the complete
|
|
279
|
+
selected release rather than accepting an unrelated source path. Verification
|
|
280
|
+
is a separate explicit operation for a selected release artifact.
|
|
281
|
+
|
|
282
|
+
The SDK `0.5.12` runtime requires Arcane `0.8.12` or newer. Compatibility
|
|
283
|
+
is contractual rather than exact-version pinning: the prepared Core must meet
|
|
284
|
+
the highest minimum declared by the runtime, selected app, and bundled app
|
|
285
|
+
dependencies; keep each app's Arcane protocol generation; and provide every
|
|
286
|
+
declared feature, capability, and method. Missing requirements stop before
|
|
287
|
+
provider build; a newer compatible Core is accepted. Browser-only apps may omit
|
|
288
|
+
`minimumCoreVersion`, and missing permissions or optional security declarations
|
|
289
|
+
normalize to empty records. The provider paths have
|
|
290
|
+
been validated from independent workspaces. They do not copy proprietary source
|
|
291
|
+
into the Arcane checkout.
|
|
292
|
+
|
|
293
|
+
See [compatibility.md](compatibility.md) for the complete app and bundled-app
|
|
294
|
+
compatibility rule and the required handling of breaking contract changes.
|
|
295
|
+
|
|
296
|
+
Linux ARM64 shares the implemented Linux provider, focused tests, and a
|
|
297
|
+
target-scoped remote evidence workflow. The recorded workflow exercised the
|
|
298
|
+
native AArch64 toolchain, DEB, host/Core/bridge, sandboxed WebKit readiness, and
|
|
299
|
+
owned process-group cancellation. The recorded Android development path
|
|
300
|
+
exercised physical-device build, readiness, cancellation, uninstall, and
|
|
301
|
+
absence behavior. Neither record establishes
|
|
302
|
+
production signing, installation, publishing, update continuity, release
|
|
303
|
+
acceptance, or production readiness.
|
|
@@ -0,0 +1,38 @@
|
|
|
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 a browser-only app, `permissions`, `security`, and
|
|
8
|
+
`requirements.minimumCoreVersion` may be omitted. Missing permissions normalize
|
|
9
|
+
to empty capability and method sets, and missing security normalizes to empty
|
|
10
|
+
origin declarations with optional hardening disabled. Existing explicitly
|
|
11
|
+
authored records remain unchanged.
|
|
12
|
+
|
|
13
|
+
When the selected target actually uses Arcane Core, compatibility requires:
|
|
14
|
+
|
|
15
|
+
- the requested target is declared by that app;
|
|
16
|
+
- the host Core version is greater than or equal to the explicitly declared
|
|
17
|
+
`requirements.minimumCoreVersion`;
|
|
18
|
+
- `requirements.arcaneProtocol` matches the host protocol generation;
|
|
19
|
+
- every declared `requirements.features` entry is advertised by the host;
|
|
20
|
+
- every declared `permissions.capabilities` entry is available; and
|
|
21
|
+
- every declared `permissions.methods` entry is available.
|
|
22
|
+
|
|
23
|
+
The effective Core floor for a native build is the highest minimum explicitly
|
|
24
|
+
declared by the SDK runtime, the selected app, and its complete bundled-app
|
|
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.
|
|
27
|
+
|
|
28
|
+
This permits normal non-breaking Arcane upgrades. For example, an app requiring
|
|
29
|
+
Core `0.8.12` can run on `0.8.13` or `0.9.0` when the required protocol,
|
|
30
|
+
features, capabilities, and methods are still present. A higher version does
|
|
31
|
+
not override a missing contract.
|
|
32
|
+
|
|
33
|
+
Breaking changes must be visible at the contract boundary. A host must not
|
|
34
|
+
continue advertising an old protocol, feature, capability, or method when its
|
|
35
|
+
meaning or guarantees are no longer compatible. It must instead change the
|
|
36
|
+
protocol generation or contract identifier so the incompatibility is reported
|
|
37
|
+
before launch. Ordinary compatibility does not depend on byte counts, hashes,
|
|
38
|
+
digests, provenance receipts, or optional security declarations.
|