arcane-os 0.95.0 → 0.97.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.
- package/CHANGELOG.md +32 -0
- package/README.md +1 -1
- package/browser-runtime/ai/core-model-assets.mjs +79 -0
- package/docs/reference/README.md +14 -0
- package/docs/reference/ai/browser-speech.md +61 -10
- package/docs/reference/core-client.md +35 -0
- package/docs/reference/core-native-packaging.md +51 -9
- package/docs/reference/inventory/package-api.json +239 -15
- package/docs/reference/inventory/runtime-modules.json +39 -13
- package/docs/reference/model-assets.md +219 -23
- package/docs/reference/native-speech.md +128 -4
- package/docs/reference/runtime-modules.md +157 -11
- package/docs/reference/sdk-api.md +475 -18
- package/package.json +3 -3
- package/src/core/host.mjs +22 -17
- package/src/core/services/local-ai.mjs +46 -12
- package/src/core/services/model-assets.mjs +885 -96
- package/src/core/services/speech.mjs +2 -2
- package/src/local-ai/nemo-models.mjs +160 -0
- package/src/local-ai/nemotron/index.mjs +63 -7
- package/src/native/macos-provider.mjs +14 -7
- package/src/native/portable-assembly.mjs +180 -0
- package/src/native/portable-provider.mjs +17 -161
- package/src/native/publish-output.mjs +101 -0
- package/src/native/windows-provider.mjs +12 -6
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,37 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.97.0
|
|
4
|
+
|
|
5
|
+
- Share native model storage across applications for the same operating-system
|
|
6
|
+
user on Windows, Linux and macOS. Preserve explicit model locations and
|
|
7
|
+
app-private settings, profiles and chat history without moving existing data.
|
|
8
|
+
- Retain completed model companions and interrupted partial downloads. Explicit
|
|
9
|
+
retries resume compatible HTTP transfers or restart only the affected member;
|
|
10
|
+
completed shards are reused and selected TAR companions remain preserved.
|
|
11
|
+
- Coordinate same-selection acquisition across processes, recover after an
|
|
12
|
+
exited transfer owner, and preserve independent caller cancellation.
|
|
13
|
+
- Expose actual activity, waiting, stalled, resumed and terminal download states
|
|
14
|
+
through the shared model-assets API. Deliver queued failure progress before
|
|
15
|
+
browser cleanup, with complete technical errors in developer inspection.
|
|
16
|
+
|
|
17
|
+
## 0.96.0
|
|
18
|
+
|
|
19
|
+
- Publish successful portable, Windows and macOS native builds to one stable
|
|
20
|
+
app-specific output directory. Assemble separately and retain the previous
|
|
21
|
+
output through promotion, callback acceptance and recoverable rollback;
|
|
22
|
+
keep model caches and user profiles outside replacement.
|
|
23
|
+
- Add persistent native model acquisition and installed-model discovery through
|
|
24
|
+
the shared Core model-assets owner. Preserve complete split GGUF sets and
|
|
25
|
+
companion files, stream selected TAR members, report file-based progress,
|
|
26
|
+
and join cancellation and cleanup while retaining completed originals.
|
|
27
|
+
- Expose upstream Nemotron/diarization and Magpie/NanoCodec model selections
|
|
28
|
+
through the existing native speech API. Nemotron retains selected resource
|
|
29
|
+
projections until its owned helper closes; no model or runtime redistribution
|
|
30
|
+
is added.
|
|
31
|
+
- Add explicit native language-model startup and an app-scoped Models directory.
|
|
32
|
+
Preserve existing automatic startup defaults and ordinary speech APIs.
|
|
33
|
+
Package delivery remains distinct from native inference or app acceptance.
|
|
34
|
+
|
|
3
35
|
## 0.95.0
|
|
4
36
|
|
|
5
37
|
- Add retained native Nemotron streaming recognition and optional diarization,
|
package/README.md
CHANGED
|
@@ -25,7 +25,7 @@ selected SDK projection or an explicit live SDK source mount. Both profiles
|
|
|
25
25
|
share the theme, packaging, event, cancellation,
|
|
26
26
|
and browser run contracts while retaining their selected application layout.
|
|
27
27
|
|
|
28
|
-
This checkout defines the `0.
|
|
28
|
+
This checkout defines the `0.97.0` SDK contract. Development applications declare
|
|
29
29
|
`arcane-os` as `latest` and retain their lockfile. Exact SDK pins begin when Roshi
|
|
30
30
|
designates a production build. Follow [Consumer updates](docs/consumer-updates.md)
|
|
31
31
|
to refresh and compare the installed SDK and lockfile with the published channel;
|
|
@@ -3,6 +3,85 @@ import {getInstalledCoreClient} from '../core/client.mjs';
|
|
|
3
3
|
|
|
4
4
|
const is = new Is(false);
|
|
5
5
|
|
|
6
|
+
/** Inspect selected native directories without downloading or loading a model. */
|
|
7
|
+
export function discoverCoreModelAssets({client = getInstalledCoreClient(), directories, catalog, recursive, signal} = {}) {
|
|
8
|
+
requireCore(client);
|
|
9
|
+
return client.invoke('modelAssets.discover', {directories, catalog, recursive}, {signal, timeoutMs: 0});
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
/** Retain existing complete files without copying them into an application build. */
|
|
13
|
+
export function openExistingCoreModelAssets({client = getInstalledCoreClient(), directory, members, signal} = {}) {
|
|
14
|
+
return prepareNativeProjection(client, 'modelAssets.openExisting', {directory, members}, {signal});
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
/** Explicitly download a selected complete native model and its companions. */
|
|
18
|
+
export function downloadCoreModelAssets({
|
|
19
|
+
client = getInstalledCoreClient(), workingDirectory, members, archives, refresh = false, signal, onProgress
|
|
20
|
+
} = {}) {
|
|
21
|
+
return prepareNativeProjection(client, 'modelAssets.prepare', {workingDirectory, members, archives, refresh}, {signal, onProgress});
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
function requireCore(client) {
|
|
25
|
+
if (!is.function(client?.invoke)) {
|
|
26
|
+
const error = new Error('Native model assets require an available Core connection.');
|
|
27
|
+
error.code = 'ARCANE_MODEL_ASSETS_CORE_UNAVAILABLE';
|
|
28
|
+
throw error;
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
async function prepareNativeProjection(client, method, params, {signal, onProgress}) {
|
|
33
|
+
requireCore(client);
|
|
34
|
+
if (!is.function(client.uuid)) throw new TypeError('Model asset preparation requires Core operation ids.');
|
|
35
|
+
if (onProgress !== undefined && !is.function(onProgress)) throw new TypeError('Model asset onProgress must be a function.');
|
|
36
|
+
if (onProgress && !is.function(client.events?.on)) throw new TypeError('Model asset progress requires Core events.');
|
|
37
|
+
const id = client.uuid();
|
|
38
|
+
const controller = new AbortController();
|
|
39
|
+
const operationSignal = signal ? AbortSignal.any([signal, controller.signal]) : controller.signal;
|
|
40
|
+
operationSignal.throwIfAborted();
|
|
41
|
+
let delivery = Promise.resolve();
|
|
42
|
+
let callbackFailure;
|
|
43
|
+
let releaseTask;
|
|
44
|
+
const unsubscribe = onProgress ? client.events.on('modelAssets.progress', function receiveProgress(event) {
|
|
45
|
+
if (event?.id !== id || operationSignal.aborted) return;
|
|
46
|
+
delivery = delivery.then(function orderedProgress() {
|
|
47
|
+
if (!operationSignal.aborted) return onProgress(event.progress);
|
|
48
|
+
});
|
|
49
|
+
delivery.catch(function failedProgress(error) {
|
|
50
|
+
callbackFailure ??= error;
|
|
51
|
+
controller.abort(error);
|
|
52
|
+
});
|
|
53
|
+
}) : undefined;
|
|
54
|
+
|
|
55
|
+
function release() {
|
|
56
|
+
releaseTask ??= client.invoke('modelAssets.release', {id}, {timeoutMs: 0});
|
|
57
|
+
return releaseTask;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
try {
|
|
61
|
+
const projection = await client.invoke(method, {id, ...params}, {signal: operationSignal, timeoutMs: 0});
|
|
62
|
+
await delivery;
|
|
63
|
+
operationSignal.throwIfAborted();
|
|
64
|
+
return {id, directory: projection.directory, members: projection.members, release};
|
|
65
|
+
} catch (error) {
|
|
66
|
+
// Core publishes the terminal transfer state before rejecting prepare.
|
|
67
|
+
// Deliver that queued state before our cleanup cancellation can suppress
|
|
68
|
+
// it. Explicit caller cancellation still owns its existing boundary.
|
|
69
|
+
try { await delivery; }
|
|
70
|
+
catch (deliveryError) { callbackFailure ??= deliveryError; }
|
|
71
|
+
const reason = callbackFailure ?? (error?.code === 'ARCANE_REQUEST_ABORTED' && operationSignal.aborted ? operationSignal.reason : error);
|
|
72
|
+
controller.abort(reason);
|
|
73
|
+
const errors = [reason];
|
|
74
|
+
try {
|
|
75
|
+
if (method === 'modelAssets.prepare') await client.invoke('modelAssets.cancelPrepare', {id}, {timeoutMs: 0});
|
|
76
|
+
else await release();
|
|
77
|
+
} catch (cleanupError) { if (!errors.includes(cleanupError)) errors.push(cleanupError); }
|
|
78
|
+
try { await delivery; }
|
|
79
|
+
catch (deliveryError) { if (!errors.includes(deliveryError)) errors.push(deliveryError); }
|
|
80
|
+
if (errors.length > 1) throw new AggregateError(errors, 'Native model preparation and cleanup failed.', {cause: reason});
|
|
81
|
+
throw reason;
|
|
82
|
+
} finally { unsubscribe?.(); }
|
|
83
|
+
}
|
|
84
|
+
|
|
6
85
|
/** Projects complete caller-owned assets through Core without changing their store. */
|
|
7
86
|
export async function prepareCoreModelAssets({
|
|
8
87
|
client = getInstalledCoreClient(), workingDirectory, members, signal, onProgress
|
package/docs/reference/README.md
CHANGED
|
@@ -76,11 +76,18 @@ alone does not make bare module names resolve in a browser.
|
|
|
76
76
|
| Select FLUX.2 Klein 4B and its three complementary model resources | [FLUX.2 Klein 4B through Core](local-image-flux.md) |
|
|
77
77
|
| Select the complete SDXL Base 1.0 checkpoint for generation and whole-image editing | [SDXL Base 1.0 through Core](local-image-sdxl.md) |
|
|
78
78
|
| Compose independently loaded transcription and synthesis engines | [Native speech service](native-speech.md) |
|
|
79
|
+
| Stream complete native recognition with retained speaker scope | [Native Nemotron](native-nemotron.md) and [Core speech streaming](native-speech.md#continuous-transcription-and-streaming-synthesis) |
|
|
80
|
+
| Produce native PCM speech with selected voice and language | [Native Magpie](native-magpie.md) |
|
|
81
|
+
| Capture and play native speech through shared AI controls | [Shared AI capture and playback](native-speech.md#shared-ai-capture-and-playback) |
|
|
79
82
|
| Keep a native Whisper model loaded across complete recordings | [Native Whisper transcription](local-whisper.md) |
|
|
80
83
|
| Select the optional Intel NPU encoder with independent CUDA or CPU decoding | [Intel NPU Whisper](../guides/native-whisper-openvino.md) |
|
|
81
84
|
| Edit an original PNG with a complete prompt and explicit strength | [Local image editing](local-image-editing.md) |
|
|
82
85
|
| Project complete stored model files into native working files | [Model assets through Core](model-assets.md) |
|
|
83
86
|
| Prepare selected upstream model members in native services | [Native preparation and retained lifetime](model-assets.md#native-ownership) |
|
|
87
|
+
| Discover installed models, ordered GGUF shards and required companion files | [Model discovery and existing-file projections](model-assets.md) |
|
|
88
|
+
| Download selected model members with visible file progress and joined cancellation | [downloadCoreModelAssets()](sdk-api.md#downloadcoremodelassets) and [native model assets](model-assets.md) |
|
|
89
|
+
| Prepare the complete Nemotron or Magpie model selection | [Shared native speech catalog](sdk-api.md#preparenemotronmodels) |
|
|
90
|
+
| Use same-user shared native model storage or explicit directory overrides and prepare engines on demand | [Model locations and activation](model-assets.md) |
|
|
84
91
|
| Retain a Nemotron model and diarize caller-fed audio streams | [Native speaker diarization](diarization.md) |
|
|
85
92
|
| Persist application-selected preferences through Core | [Core preferences service](core-preferences.md) |
|
|
86
93
|
| Read complete selected Git text without changing a checkout | [Git text snapshots](git-text-snapshot.md) |
|
|
@@ -89,6 +96,7 @@ alone does not make bare module names resolve in a browser.
|
|
|
89
96
|
| Write, commit and push complete selected repository text | [Selected-text repository writing](core-repositories.md#write-commit-and-push-selected-text) |
|
|
90
97
|
| Observe existing checkout configuration and capture an explicit remote/ref | [Repository configuration and selected targets](core-repositories.md#existing-checkout-configuration-and-selected-targets) |
|
|
91
98
|
| Build an installed-SDK portable Core payload | [Portable Core packaging](core-native-packaging.md) |
|
|
99
|
+
| Replace only the selected app's successful native build while preserving model storage | [Stable native output](core-native-packaging.md#output-and-host-contract) |
|
|
92
100
|
| Resolve matching native state/workspace/endpoint defaults and preserve explicit launch values | [Launch-time locations](core-native-packaging.md#launch-time-locations) and [resolveNativeLaunchContext()](sdk-api.md#resolvenativelaunchcontext) |
|
|
93
101
|
| Build a Windows executable without an OS checkout | [Windows executable packaging](core-native-packaging.md#windows-executable) |
|
|
94
102
|
| Compose a Mac application with an architecture-matched host | [macOS application composition](core-native-packaging.md#macos-application-composition) |
|
|
@@ -243,6 +251,12 @@ what those artifacts let a developer do.
|
|
|
243
251
|
|
|
244
252
|
## Normalized AI
|
|
245
253
|
|
|
254
|
+
A speech-only interface explicitly passes `null` for both the first and fourth
|
|
255
|
+
`AI` constructor arguments:
|
|
256
|
+
`new AI(null, 'LOCAL_SPEACH', 'LOCAL_SPEACH', null, ttsModel, sttModel)`.
|
|
257
|
+
This leaves the LLM unselected from construction; omitted or empty arguments
|
|
258
|
+
retain their historical defaults. See [native speech startup](native-speech.md#startup-and-status).
|
|
259
|
+
|
|
246
260
|
Portable applications start with the provider-neutral runtime rather than an
|
|
247
261
|
Ollama, Wllama, Whisper, Kokoro, native, or cloud transport:
|
|
248
262
|
|
|
@@ -233,6 +233,53 @@ Choose preparation according to the result the application needs:
|
|
|
233
233
|
| `ai.fetchTTS(payload,signal)` | Promise resolving a real audio Blob | Audio-file providers only; does not play |
|
|
234
234
|
| `ai.prepareTTS(options)` | Preparation handle with `ready` and `getAudio(index)` | Audio-file providers only; optional caller-owned durable storage |
|
|
235
235
|
|
|
236
|
+
## Native Core streaming speech
|
|
237
|
+
|
|
238
|
+
The shared AI controls also consume an explicitly selected native Core speech
|
|
239
|
+
service. [Nemotron](../native-nemotron.md) supplies retained streaming recognition
|
|
240
|
+
and optional diarization; [Magpie](../native-magpie.md) supplies streamed PCM and
|
|
241
|
+
complete WAV/PCM audio. These are separate from browser Web Speech voices:
|
|
242
|
+
Magpie can export audio, whereas the browser-native synthesis provider exposes
|
|
243
|
+
playback only. No selected route silently falls back to another engine.
|
|
244
|
+
|
|
245
|
+
For speech-only construction, pass `null` for both LLM arguments:
|
|
246
|
+
`new AI(null, 'LOCAL_SPEACH', 'LOCAL_SPEACH', null, ttsModel, sttModel)`.
|
|
247
|
+
This leaves the LLM unselected; omitted or empty arguments preserve defaults.
|
|
248
|
+
The existing per-realm AI singleton is reused if already present. Import and
|
|
249
|
+
construction do not prove native readiness.
|
|
250
|
+
|
|
251
|
+
After the selected STT role is ready, `ai.supportsTranscriptionCapture()`
|
|
252
|
+
reports its capture capability. `ai.createTranscriptionCapture(options)`
|
|
253
|
+
returns `null` without a provider capture implementation, otherwise an owned
|
|
254
|
+
`{start, stop, cancel, destroy, done, forceEndpoint?}` handle. Start from the
|
|
255
|
+
user's capture action with `{signal, mediaConstraints}`. Native options include
|
|
256
|
+
`sampleRate` (default 16000), `pcmChunkMs` (default 100),
|
|
257
|
+
`activityThreshold` (default 0.02), `streamOptions`, `onUpdate`,
|
|
258
|
+
`onInterim`, `onSegment`, `onActivity`, `onState`, `onError`,
|
|
259
|
+
`onProgress`, and `onRequest`. The actual capture rate must match the native
|
|
260
|
+
stream; every PCM contribution is delivered in order.
|
|
261
|
+
|
|
262
|
+
Native recognition callbacks receive `(result, {requestStop})`. Keep full
|
|
263
|
+
snapshots: interim results replace, and final segments retain their native
|
|
264
|
+
boundaries, words, timestamps and speaker scope. A callback can call
|
|
265
|
+
`requestStop()` without awaiting it and return; the external owner awaits
|
|
266
|
+
`stop()` or `done`. Never await those joins or `forceEndpoint()` from their
|
|
267
|
+
own callback. External `forceEndpoint()` flushes pending capture PCM and
|
|
268
|
+
recognition callbacks while leaving the microphone and native stream open.
|
|
269
|
+
`stop()` closes capture and drains recognition; `cancel()` and `destroy()`
|
|
270
|
+
join cleanup without claiming a complete transcript. No control sends chat.
|
|
271
|
+
|
|
272
|
+
For a streaming TTS catalog, `ai.prepareTTSPlayback({input, voice, languageCode, speed}, signal)`
|
|
273
|
+
returns an inert descriptor. Its explicit `play()` uses the shared provider
|
|
274
|
+
lane and Web Audio output. The returned control exposes `finished`,
|
|
275
|
+
`released`, `state`, `error`, `pause()`, `resume()`, and `stop()`.
|
|
276
|
+
`finished` describes playback completion, while `released` joins native
|
|
277
|
+
cleanup. Stop targets that utterance, independently of capture.
|
|
278
|
+
`fetchTTS({input, languageCode, ...}, signal)` still returns complete audio
|
|
279
|
+
when the selected engine supports it. Language is caller-selected control data,
|
|
280
|
+
separate from the text; Magpie supports natural speed `1` only. See
|
|
281
|
+
[shared native capture/playback](../native-speech.md#shared-ai-capture-and-playback).
|
|
282
|
+
|
|
236
283
|
<a id="digitalocean-fal-text-to-speech"></a>
|
|
237
284
|
|
|
238
285
|
## TWiN Cloud text-to-speech
|
|
@@ -665,13 +712,13 @@ selected execution device or assess the generated audio.
|
|
|
665
712
|
## Queue complete passages and wait for playback
|
|
666
713
|
|
|
667
714
|
For a complete page or passage, call
|
|
668
|
-
`ai.streamTTS(text, true, {voice, speed, pauseAfterMs, waitForPlayback:true})`.
|
|
715
|
+
`ai.streamTTS(text, true, {voice, speed, languageCode, pauseAfterMs, waitForPlayback:true})`.
|
|
669
716
|
The existing AI queue owns segmentation, concurrent synthesis, ordered
|
|
670
717
|
playback, and cancellation. Supply the exact text; there is no need for an
|
|
671
718
|
application sentence queue, audio cache, or playback scheduler.
|
|
672
719
|
|
|
673
720
|
This function uses the configured `ai` above. Its application-supplied
|
|
674
|
-
`passages` argument is an ordered array of `{text, voice?, speed?, pauseAfterMs?}`
|
|
721
|
+
`passages` argument is an ordered array of `{text, voice?, speed?, languageCode?, pauseAfterMs?}`
|
|
675
722
|
records. An omitted voice uses the selected model's default voice, an omitted
|
|
676
723
|
speed uses `ai.voiceSpeed`, and an omitted pause is zero. Each supplied voice
|
|
677
724
|
must be supported by the selected model; speed must be positive. A pause is
|
|
@@ -689,6 +736,7 @@ async function speakPassages(passages) {
|
|
|
689
736
|
{
|
|
690
737
|
voice: passage.voice,
|
|
691
738
|
speed: passage.speed,
|
|
739
|
+
languageCode: passage.languageCode,
|
|
692
740
|
pauseAfterMs: passage.pauseAfterMs,
|
|
693
741
|
waitForPlayback: true
|
|
694
742
|
}
|
|
@@ -709,14 +757,17 @@ streamed speech and prepared playback owned by that AI instance and settles
|
|
|
709
757
|
pending playback results `false`. Detached preparation described below keeps
|
|
710
758
|
its independent lifetime.
|
|
711
759
|
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
the
|
|
719
|
-
|
|
760
|
+
Voice, speed and languageCode remain associated with an unfinished `end:false`
|
|
761
|
+
utterance and its later `finishTTS()` flush; a supplied option replaces its retained
|
|
762
|
+
selection. An explicitly changed language first queues the preceding remainder
|
|
763
|
+
with its old selection, then accepts the new text. Language is separate control
|
|
764
|
+
information and does not rewrite the text. End, mute and stop clear the retained
|
|
765
|
+
selection. Pause and waitForPlayback remain per-call options. Finish a producer
|
|
766
|
+
before starting an independent passage; the automatic speech-input cleanup
|
|
767
|
+
still retains a pending single formatting mark until final flush.
|
|
768
|
+
|
|
769
|
+
A call extracting no segments returns `true` without waiting for earlier jobs,
|
|
770
|
+
except that a language-change call also joins its preceding remainder preparation.
|
|
720
771
|
An already muted call returns `false`.
|
|
721
772
|
|
|
722
773
|
Autoplay permission waiting and recoverable audio-resume attempts leave the
|
|
@@ -161,6 +161,41 @@ pre-aborted signal sends no transcription request; an in-flight abort sends
|
|
|
161
161
|
service owns interruption and release of its actual engine operation.
|
|
162
162
|
Its optional request observer uses the same pre-dispatch correlation contract.
|
|
163
163
|
|
|
164
|
+
## Streaming native speech
|
|
165
|
+
|
|
166
|
+
`Arcane.speech.openStream(request, {signal, onUpdate, onProgress, onRequest})`
|
|
167
|
+
returns `{streamId, ready, completion, current, push, forceEndpoint, finish, cancel}`
|
|
168
|
+
immediately. Await `ready` before feeding ordered mono `Float32Array` input at
|
|
169
|
+
the request's actual `sampleRate`. This API opens no microphone.
|
|
170
|
+
`forceEndpoint()` drains the current utterance and its ordered update callbacks
|
|
171
|
+
without closing the retained stream; `finish()` drains accepted input and final
|
|
172
|
+
delivery terminally. Partial snapshots replace prior partials; finals retain
|
|
173
|
+
their engine-defined segment and speaker scope. Recognition never decides a
|
|
174
|
+
human turn, instruction or approval.
|
|
175
|
+
|
|
176
|
+
An `onUpdate` callback must return before its own `forceEndpoint()`,
|
|
177
|
+
`finish()`, or `completion` join. Explicit `cancel(reason)` immediately
|
|
178
|
+
suppresses later callbacks and awaits the matching native cleanup control.
|
|
179
|
+
Aborting the signal instead follows ordinary request cancellation, whose browser
|
|
180
|
+
promise may settle before native cleanup.
|
|
181
|
+
|
|
182
|
+
`Arcane.speech.synthesizeStream(request, {signal, onAudio, onProgress, onRequest})`
|
|
183
|
+
requires an `onAudio` consumer and resolves to the engine's complete terminal
|
|
184
|
+
metadata. Every callback receives `{pcm: Uint8Array, format, sampleRate, channels, ...}`
|
|
185
|
+
in order. The facade awaits each callback before acknowledging that contribution
|
|
186
|
+
to the native producer. It does not play audio. An utterance abort joins its
|
|
187
|
+
explicit native cancellation and callback cleanup; actual failures remain
|
|
188
|
+
observable. A callback may abort its caller-owned signal and return, then the
|
|
189
|
+
external owner joins synthesis completion.
|
|
190
|
+
|
|
191
|
+
Both streaming operations have no fixed request timeout. Their scoped events
|
|
192
|
+
and controls retain exact request ownership through client close, document
|
|
193
|
+
retirement and transport loss. Engine support and loaded readiness are separate;
|
|
194
|
+
a facade method alone supplies neither. Complete-recording transcription and
|
|
195
|
+
complete-audio synthesis retain their existing contracts. See
|
|
196
|
+
[Core streaming speech](native-speech.md#continuous-transcription-and-streaming-synthesis)
|
|
197
|
+
for the complete protocol, cancellation and engine interfaces.
|
|
198
|
+
|
|
164
199
|
## Current-window state
|
|
165
200
|
|
|
166
201
|
`Arcane.window.state({signal}?)` reads the native window hosting the calling
|
|
@@ -93,11 +93,43 @@ See [the complete selection contract](protocols.md#native-only-application-resou
|
|
|
93
93
|
|
|
94
94
|
## Output and host contract
|
|
95
95
|
|
|
96
|
-
Each build
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
96
|
+
Each build assembles in a fresh temporary directory beneath `outputRoot`, then
|
|
97
|
+
publishes the complete artifact to one stable app-specific child. Portable and
|
|
98
|
+
Windows outputs use `<outputRoot>/<app-id>/`; macOS uses
|
|
99
|
+
`<outputRoot>/<app-id>.app/`. The result remains `{app, target, manifest}`, with
|
|
100
|
+
its actual payload directory at `target.rootDir` and the macOS bundle directory
|
|
101
|
+
also returned as `bundleRoot`. A later successful build replaces that app's
|
|
102
|
+
previous generated output instead of accumulating completed build directories.
|
|
103
|
+
Windows device-name spellings such as `con` receive an underscore in the output
|
|
104
|
+
folder name (`_con` or `_con.app`) on every build host; the app ID stays unchanged.
|
|
105
|
+
|
|
106
|
+
Assembly leaves the current output available. Publication uses same-filesystem
|
|
107
|
+
renames and retains the previous output in a temporary backup until the
|
|
108
|
+
`native.payload.completed` callback accepts the new final paths. A callback
|
|
109
|
+
rejection or cancellation restores the previous output; a successful build
|
|
110
|
+
removes its backup and temporary assembly. The completion callback runs before
|
|
111
|
+
build acceptance, including the following cancellation check; receiving that
|
|
112
|
+
event alone does not establish an accepted build. `native.payload.started` identifies
|
|
113
|
+
the temporary assembly, while `native.payload.completed` identifies the final
|
|
114
|
+
payload and, on macOS, final bundle. Manifest paths stay relative to that payload;
|
|
115
|
+
application content and explicitly supplied configuration paths stay unchanged.
|
|
116
|
+
|
|
117
|
+
Only final replacement of the same app is reserved; independent assemblies and
|
|
118
|
+
other apps remain concurrent. A competing publication reports the exact
|
|
119
|
+
`.arcane-publish-<app-output-name>` reservation so its owner can finish before
|
|
120
|
+
retrying. If recovery or backup cleanup fails, the error identifies the actual
|
|
121
|
+
output, assembly and reservation paths, and whether publication committed.
|
|
122
|
+
The reservation's `owner.json` records the process, acquisition time, advisory
|
|
123
|
+
five-minute TTL/expiry and recovery locations. Expiry never permits automatic
|
|
124
|
+
takeover or deletion. After an interrupted build, inspect those paths before restoring the previous
|
|
125
|
+
output or removing the reservation. A running or locked app may prevent Windows
|
|
126
|
+
replacement; close that app and retry the build after the reported failure.
|
|
127
|
+
|
|
128
|
+
Replacement applies only to the matching app's generated artifact directory.
|
|
129
|
+
Source/release roots, unrelated outputs, host/runtime download caches and the
|
|
130
|
+
host's separate saved profile/model directories remain outside replacement.
|
|
131
|
+
Existing randomly named outputs from earlier SDK versions are left untouched;
|
|
132
|
+
the new stable-output lifecycle does not sweep old directories or user data.
|
|
101
133
|
|
|
102
134
|
The selected app is copied unchanged under `app/`. Dependencies are copied
|
|
103
135
|
unchanged under `dependencies/<index>/`; the manifest relates each directory to
|
|
@@ -309,6 +341,10 @@ It returns a new complete context and fills only omitted fields:
|
|
|
309
341
|
| `stateRoot` on Windows | `%LOCALAPPDATA%/Arcane/<appId>`; standard home `AppData/Local` fallback when the environment value is absent |
|
|
310
342
|
| `stateRoot` on macOS | `~/Library/Application Support/Arcane/<appId>` |
|
|
311
343
|
| `stateRoot` on Linux | Absolute `$XDG_DATA_HOME/Arcane/<appId>`, otherwise `~/.local/share/Arcane/<appId>` |
|
|
344
|
+
| `modelsDirectory` on Windows | `%LOCALAPPDATA%/Arcane/Models`, with the same standard home fallback |
|
|
345
|
+
| `modelsDirectory` on macOS | `~/Library/Application Support/Arcane/Models` |
|
|
346
|
+
| `modelsDirectory` on Linux | Absolute `$XDG_DATA_HOME/Arcane/Models`, otherwise `~/.local/share/Arcane/Models` |
|
|
347
|
+
| `modelsDirectory` on other adapted hosts | `<resolved stateRoot>/Models` unless the host supplies an explicit shared location |
|
|
312
348
|
| `workspaceRoot` | `<resolved stateRoot>/Workspace` |
|
|
313
349
|
| `sharedHost.endpoint`, only when `sharedHost` is selected | Windows named pipe `\\.\pipe\Arcane-` followed by the URL-encoded complete resolved state path; Linux/macOS socket `<resolved stateRoot>/core.sock` |
|
|
314
350
|
| `sharedHost.logFile`, only when `sharedHost` is selected | `<resolved stateRoot>/Core.log` |
|
|
@@ -323,9 +359,15 @@ shared entry creates its selected state directory because its socket/log need
|
|
|
323
359
|
that parent; application services continue to own workspace I/O. Custom
|
|
324
360
|
endpoint/log parent directories retain the existing shared-host requirements.
|
|
325
361
|
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
362
|
+
Models default to one directory per operating-system user, independent of the
|
|
363
|
+
application ID or app-private state root. Apps selecting the same sources and
|
|
364
|
+
shared model store reuse the SDK acquisition owner. Preferences, profiles,
|
|
365
|
+
chat history, workspace and IPC remain app-scoped. Existing app-local models
|
|
366
|
+
are not moved or deleted: callers can discover and open them in place.
|
|
367
|
+
|
|
368
|
+
Explicit `stateRoot`, `modelsDirectory`, `workspaceRoot`, endpoint, log filename
|
|
369
|
+
and additional fields remain authored values. The resolver derives app-private
|
|
370
|
+
paths from the absolute selected state location. Relative explicit paths retain the caller's
|
|
329
371
|
working-directory meaning, so UI and MCP callers must select the same location.
|
|
330
372
|
No hashing, app-local OS path composition, directory scanning, or new repository
|
|
331
373
|
location rule is involved. `resolveArcaneDataPaths()` continues to own its
|
|
@@ -751,7 +793,7 @@ produce their actual download error. SDK collaborators may select an existing
|
|
|
751
793
|
version, another architecture or a browser-only artifact.
|
|
752
794
|
|
|
753
795
|
The complete unchanged portable payload lives at
|
|
754
|
-
`<app-id>.app/Contents/Resources/`. That directory remains `target.rootDir` and
|
|
796
|
+
`<outputRoot>/<app-id>.app/Contents/Resources/`. That directory remains `target.rootDir` and
|
|
755
797
|
contains `arcane-native.json`, `app/`, dependency releases, installed SDK files,
|
|
756
798
|
Core entry/client and `runtime/node`. The additive `bundleRoot` identifies the
|
|
757
799
|
`.app` directory. `Contents/MacOS/Arcane` and `Contents/Info.plist` belong to the
|