arcane-os 0.57.0 → 0.59.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 +37 -0
- package/README.md +6 -2
- package/browser-runtime/ai/core-onnx.mjs +96 -0
- package/browser-runtime/ai/onnx-tensors.mjs +85 -0
- package/browser-runtime/core/client.mjs +152 -17
- package/docs/architecture.md +5 -2
- package/docs/platform-targets.md +30 -13
- package/docs/reference/README.md +22 -3
- package/docs/reference/availability-and-normalization.md +14 -7
- package/docs/reference/cli.md +22 -10
- package/docs/reference/core-client.md +87 -0
- package/docs/reference/core-native-packaging.md +129 -9
- package/docs/reference/core-preferences.md +49 -0
- package/docs/reference/diarization.md +206 -0
- package/docs/reference/git-text-snapshot.md +104 -0
- package/docs/reference/inventory/package-api.json +205 -23
- package/docs/reference/local-ai.md +145 -11
- package/docs/reference/protocols.md +28 -19
- package/docs/reference/pwa.md +74 -4
- package/docs/reference/sdk-api.md +589 -39
- package/package.json +11 -3
- package/schemas/arcane-app.schema.json +3 -3
- package/schemas/arcane-package.schema.json +2 -2
- package/schemas/native-build-plan.schema.json +27 -1
- package/schemas/target-adapter.schema.json +2 -0
- package/src/app-descriptor.mjs +1 -1
- package/src/cli/main.mjs +14 -4
- package/src/constants.mjs +2 -0
- package/src/core/host.mjs +14 -5
- package/src/core/hosts/macos/ArcaneHost.h +86 -0
- package/src/core/hosts/macos/ArcaneHost.m +455 -0
- package/src/core/hosts/macos/ArcaneLauncher.m +432 -0
- package/src/core/hosts/windows/ArcaneLauncher.cs +4 -1
- package/src/core/services/local-ai.mjs +82 -4
- package/src/core/services/packaged-web.mjs +89 -0
- package/src/core/services/preferences.mjs +201 -0
- package/src/core-classic-source.mjs +2 -2
- package/src/dev-server.mjs +2 -5
- package/src/diarization/build.mjs +35 -0
- package/src/diarization/index.mjs +432 -0
- package/src/diarization/native/CMakeLists.txt +9 -0
- package/src/diarization/native/main.cpp +269 -0
- package/src/diarization/service.mjs +129 -0
- package/src/git-text-snapshot.mjs +265 -0
- package/src/import-map.mjs +9 -4
- package/src/index.mjs +1 -0
- package/src/local-ai/config.mjs +1 -1
- package/src/local-ai/install.mjs +134 -19
- package/src/local-ai/onnx-worker.mjs +85 -0
- package/src/local-ai/onnx.mjs +368 -0
- package/src/native/macos-provider.mjs +291 -0
- package/src/native/portable-layout.mjs +10 -2
- package/src/native/portable-provider.mjs +10 -5
- package/src/native-plan.mjs +9 -1
- package/src/native-provider-loader.mjs +3 -1
- package/src/process.mjs +123 -17
- package/src/scaffold.mjs +1 -1
- package/src/targets/index.mjs +11 -1
- package/src/templates/workspace-template.mjs +6 -5
- package/src/toolchain.mjs +42 -13
|
@@ -1,23 +1,121 @@
|
|
|
1
1
|
{
|
|
2
2
|
"schemaVersion": 1,
|
|
3
|
-
"sdkVersion": "0.
|
|
3
|
+
"sdkVersion": "0.57.0",
|
|
4
4
|
"environment": {
|
|
5
5
|
"runtime": "Node.js for Node entrypoints; browser for browser-only entrypoints",
|
|
6
6
|
"minimumVersion": "22.23.2 for Node entrypoints",
|
|
7
7
|
"moduleSystem": "ESM"
|
|
8
8
|
},
|
|
9
|
-
"memberCount":
|
|
9
|
+
"memberCount": 267,
|
|
10
10
|
"runtimeSubpathPatterns": {
|
|
11
11
|
"arcane-os/modules/*": "./runtime/arcane/modules/*",
|
|
12
12
|
"arcane-os/entities/*": "./runtime/arcane/entities/*"
|
|
13
13
|
},
|
|
14
14
|
"members": [
|
|
15
|
+
{
|
|
16
|
+
"id": "local-ai-onnx:createONNXRuntime",
|
|
17
|
+
"name": "createONNXRuntime",
|
|
18
|
+
"displayName": "createONNXRuntime()",
|
|
19
|
+
"kind": "function",
|
|
20
|
+
"signature": "createONNXRuntime({modulePath,signal,onEvent}={})",
|
|
21
|
+
"entrypoints": ["arcane-os/local-ai/onnx"],
|
|
22
|
+
"primaryImport": "arcane-os/local-ai/onnx",
|
|
23
|
+
"group": "Core local AI",
|
|
24
|
+
"summary": "Owns explicitly loaded ONNX graphs and complete named tensor inference in retained native workers.",
|
|
25
|
+
"availability": "Node on Windows/Linux/macOS x64/arm64 with prepared onnxruntime-node; Android needs host adaptation",
|
|
26
|
+
"protocol": "Per-session worker lifecycle with structured-clone tensors and replaying state",
|
|
27
|
+
"normalization": "Returns load/run/unload/current/subscribe/close; explicit model and session IDs; native calls may delay worker termination, and close observes actual exit"
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
"id": "core-onnx:createCoreONNXRuntime",
|
|
31
|
+
"name": "createCoreONNXRuntime",
|
|
32
|
+
"displayName": "createCoreONNXRuntime()",
|
|
33
|
+
"kind": "function",
|
|
34
|
+
"signature": "createCoreONNXRuntime({client=getInstalledCoreClient()}={})",
|
|
35
|
+
"entrypoints": ["arcane-os/ai/core-onnx"],
|
|
36
|
+
"primaryImport": "arcane-os/ai/core-onnx",
|
|
37
|
+
"group": "Core local AI",
|
|
38
|
+
"summary": "Accesses local system ONNX through an existing Core client with complete tensor transport.",
|
|
39
|
+
"availability": "Browser with available Core ONNX service; construction installs no runtime or model",
|
|
40
|
+
"protocol": "arcane/1 onnx.status/load/run/unload and localai.state",
|
|
41
|
+
"normalization": "Returns load/run/unload/inspect/current/subscribe/close; preserves typed and string tensors; accessor close cancels its requests without closing shared Core or implicitly unloading shared models"
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
"id": "root:createGitTextSnapshot",
|
|
45
|
+
"name": "createGitTextSnapshot",
|
|
46
|
+
"displayName": "createGitTextSnapshot()",
|
|
47
|
+
"kind": "function",
|
|
48
|
+
"signature": "createGitTextSnapshot({cacheDirectory,remote,ref,selectPath,onEvent,run=runProcess}={})",
|
|
49
|
+
"entrypoints": ["arcane-os"],
|
|
50
|
+
"primaryImport": "arcane-os",
|
|
51
|
+
"group": "Workspace, doctor, repository, and server",
|
|
52
|
+
"summary": "Reads complete selected text from one fetched revision using a dedicated bare Git object cache and batched retrieval.",
|
|
53
|
+
"availability": "Node with Git; Android requires a host supplying Git/process capability",
|
|
54
|
+
"protocol": "Git tree and batched blob transport through the shared process owner",
|
|
55
|
+
"normalization": "Returns {refresh,close,drain,dispose}; refresh yields {revision,files:[{path,content}]}, shares concurrent work, reuses unchanged revisions, preserves exact UTF-8 text, isolates caller cancellation and drains accepted work. See git-text-snapshot.md."
|
|
56
|
+
},
|
|
57
|
+
{
|
|
58
|
+
"id": "diarization:createDiarization",
|
|
59
|
+
"name": "createDiarization",
|
|
60
|
+
"displayName": "createDiarization()",
|
|
61
|
+
"kind": "function",
|
|
62
|
+
"signature": "createDiarization({executable,modelPath,runtime,onEvent}={})",
|
|
63
|
+
"entrypoints": ["arcane-os/diarization"],
|
|
64
|
+
"primaryImport": "arcane-os/diarization",
|
|
65
|
+
"group": "Native speaker diarization",
|
|
66
|
+
"summary": "Retains one selected Nemotron 3 model helper and independently owned caller-fed audio streams.",
|
|
67
|
+
"availability": "Node with a host-built first-party helper, official NeMo-Speech.cpp CPU libraries and caller-selected model",
|
|
68
|
+
"protocol": "Owned native helper transport and replayable model lifecycle; mono Float32 audio streams",
|
|
69
|
+
"normalization": "Preserves complete audio, timed segments and requested probability frames; generic speaker labels are not person identity; finish/cancel/close retain native drain and complete failures"
|
|
70
|
+
},
|
|
71
|
+
{
|
|
72
|
+
"id": "diarization-build:buildDiarizationHelper",
|
|
73
|
+
"name": "buildDiarizationHelper",
|
|
74
|
+
"displayName": "buildDiarizationHelper()",
|
|
75
|
+
"kind": "function",
|
|
76
|
+
"signature": "async buildDiarizationHelper({runtime,outputRoot,signal,onEvent}={})",
|
|
77
|
+
"entrypoints": ["arcane-os/diarization/build"],
|
|
78
|
+
"primaryImport": "arcane-os/diarization/build",
|
|
79
|
+
"group": "Native speaker diarization",
|
|
80
|
+
"summary": "Builds the first-party helper against the explicitly installed NeMoSpeech Diarization component.",
|
|
81
|
+
"availability": "Node, installed CMake/C++17 toolchain and matching official CPU runtime for the current host",
|
|
82
|
+
"protocol": "CMake configure, build and install using runtime.cmakeDirectory",
|
|
83
|
+
"normalization": "Returns actual platform, architecture, root, executable and complete diagnostics; no compiler or model download"
|
|
84
|
+
},
|
|
85
|
+
{
|
|
86
|
+
"id": "core-diarization:createDiarizationService",
|
|
87
|
+
"name": "createDiarizationService",
|
|
88
|
+
"displayName": "createDiarizationService()",
|
|
89
|
+
"kind": "function",
|
|
90
|
+
"signature": "createDiarizationService(options={},launch={})",
|
|
91
|
+
"entrypoints": ["arcane-os/core/diarization"],
|
|
92
|
+
"primaryImport": "arcane-os/core/diarization",
|
|
93
|
+
"group": "Native speaker diarization",
|
|
94
|
+
"summary": "Composes lazy native diarization as an application-selected Core service.",
|
|
95
|
+
"availability": "Node Core runtime with explicitly selected helper, runtime and model",
|
|
96
|
+
"protocol": "arcane/1 diarization methods and state/update/probability events; f32le audio transport",
|
|
97
|
+
"normalization": "Resolves relative paths from selected workspaceRoot or appRoot; session audio uses service lifetime, recording cancellation is independent, and model loading never blocks Core startup"
|
|
98
|
+
},
|
|
99
|
+
{
|
|
100
|
+
"id": "core-diarization:default",
|
|
101
|
+
"name": "default",
|
|
102
|
+
"displayName": "createDiarizationService default export",
|
|
103
|
+
"kind": "function",
|
|
104
|
+
"signature": "default as createDiarizationService",
|
|
105
|
+
"entrypoints": ["arcane-os/core/diarization"],
|
|
106
|
+
"primaryImport": "arcane-os/core/diarization",
|
|
107
|
+
"group": "Native speaker diarization",
|
|
108
|
+
"summary": "Default binding for the same native Core diarization service factory.",
|
|
109
|
+
"availability": "Node Core runtime",
|
|
110
|
+
"protocol": "arcane/1 service definition",
|
|
111
|
+
"normalization": "Binding identity equals the named createDiarizationService export"
|
|
112
|
+
},
|
|
15
113
|
{
|
|
16
114
|
"id": "core-local:createCoreLocalAIProvider",
|
|
17
115
|
"name": "createCoreLocalAIProvider",
|
|
18
116
|
"displayName": "createCoreLocalAIProvider()",
|
|
19
117
|
"kind": "function",
|
|
20
|
-
"signature": "createCoreLocalAIProvider({client,id='llama.cpp'}={})",
|
|
118
|
+
"signature": "createCoreLocalAIProvider({client=getInstalledCoreClient(),id='llama.cpp'}={})",
|
|
21
119
|
"entrypoints": ["arcane-os/ai/core-local"],
|
|
22
120
|
"primaryImport": "arcane-os/ai/core-local",
|
|
23
121
|
"group": "Core local AI",
|
|
@@ -35,9 +133,9 @@
|
|
|
35
133
|
"entrypoints": ["arcane-os/core/local-ai"],
|
|
36
134
|
"primaryImport": "arcane-os/core/local-ai",
|
|
37
135
|
"group": "Core local AI",
|
|
38
|
-
"summary": "Composes selected native llama.cpp and
|
|
136
|
+
"summary": "Composes selected native llama.cpp, Ollama and ONNX engines as a Core service with retained process/worker ownership and model lifecycle.",
|
|
39
137
|
"availability": "Node with selected upstream runtime distributions or available configured system services",
|
|
40
|
-
"protocol": "arcane/1 methods and events; llama.cpp OpenAI HTTP/SSE
|
|
138
|
+
"protocol": "arcane/1 methods and events; llama.cpp OpenAI HTTP/SSE, Ollama native HTTP/NDJSON and ONNX tensor transport",
|
|
41
139
|
"normalization": "Application-owned runtime and model requirements; independent startup, complete responses and exact owned-process cleanup"
|
|
42
140
|
},
|
|
43
141
|
{
|
|
@@ -59,13 +157,13 @@
|
|
|
59
157
|
"name": "ensureLocalAIRuntimes",
|
|
60
158
|
"displayName": "ensureLocalAIRuntimes()",
|
|
61
159
|
"kind": "function",
|
|
62
|
-
"signature": "ensureLocalAIRuntimes({runtimes=[],directory,platform,architecture,signal,onEvent}={})",
|
|
160
|
+
"signature": "async ensureLocalAIRuntimes({runtimes=[],directory,platform=process.platform,architecture=process.arch,signal,onEvent}={})",
|
|
63
161
|
"entrypoints": ["arcane-os/local-ai"],
|
|
64
162
|
"primaryImport": "arcane-os/local-ai",
|
|
65
163
|
"group": "Core local AI",
|
|
66
|
-
"summary": "Reuses selected managed native runtimes or installs complete official llama.cpp
|
|
164
|
+
"summary": "Reuses selected managed native runtimes or installs complete official llama.cpp/Ollama distributions, ONNX npm runtime trees or NeMo libraries.",
|
|
67
165
|
"availability": "Node; upstream platform and architecture assets determine runtime availability",
|
|
68
|
-
"protocol": "Official upstream release
|
|
166
|
+
"protocol": "Official upstream release archives or selected ONNX npm installation",
|
|
69
167
|
"normalization": "Returns absolute runtime records; shares matching concurrent installs, preserves libraries and reports failures without changing global PATH or services"
|
|
70
168
|
},
|
|
71
169
|
{
|
|
@@ -73,7 +171,7 @@
|
|
|
73
171
|
"name": "bundleLocalAIRuntimes",
|
|
74
172
|
"displayName": "bundleLocalAIRuntimes()",
|
|
75
173
|
"kind": "function",
|
|
76
|
-
"signature": "bundleLocalAIRuntimes({runtimes=[],directory,outputRoot,platform,architecture,signal,onEvent}={})",
|
|
174
|
+
"signature": "async bundleLocalAIRuntimes({runtimes=[],directory,outputRoot,platform=process.platform,architecture=process.arch,signal,onEvent}={})",
|
|
77
175
|
"entrypoints": ["arcane-os/local-ai"],
|
|
78
176
|
"primaryImport": "arcane-os/local-ai",
|
|
79
177
|
"group": "Core local AI",
|
|
@@ -1114,7 +1212,7 @@
|
|
|
1114
1212
|
],
|
|
1115
1213
|
"primaryImport": "arcane-os",
|
|
1116
1214
|
"group": "Targets, native plans, and providers",
|
|
1117
|
-
"summary": "Loads the
|
|
1215
|
+
"summary": "Loads the installed SDK provider for portable or windows-x64 when arcaneRoot is omitted, or retains the explicitly selected Arcane OS checkout provider route.",
|
|
1118
1216
|
"availability": "Node; selected browser/native target or provider as documented",
|
|
1119
1217
|
"protocol": "arcane-target-adapter/1, arcane-native-build-plan/1, or provider protocol",
|
|
1120
1218
|
"normalization": "Normalized complete plan and result; target-specific artifact detail preserved"
|
|
@@ -1860,16 +1958,16 @@
|
|
|
1860
1958
|
"name": "runProcess",
|
|
1861
1959
|
"displayName": "runProcess()",
|
|
1862
1960
|
"kind": "function",
|
|
1863
|
-
"signature": "async runProcess(command, args=[], { cwd, env, signal, onEvent, heartbeatMs=5000, terminationGraceMs=DEFAULT_TERMINATION_GRACE_MS, allowNonzero=false, input }={})",
|
|
1961
|
+
"signature": "async runProcess(command, args=[], { cwd, env, signal, onEvent, onOutput, captureOutput=true, emitOutputEvents=true, outputEncoding='utf8', heartbeatMs=5000, terminationGraceMs=DEFAULT_TERMINATION_GRACE_MS, allowNonzero=false, input, cancellationMode='terminate-tree' }={})",
|
|
1864
1962
|
"entrypoints": [
|
|
1865
1963
|
"arcane-os"
|
|
1866
1964
|
],
|
|
1867
1965
|
"primaryImport": "arcane-os",
|
|
1868
1966
|
"group": "Events, processes, and testing",
|
|
1869
|
-
"summary": "Runs one shell-free child command with complete
|
|
1967
|
+
"summary": "Runs one shell-free child command with complete output and ordered events; default tree termination or explicit close-input cancellation waits for the selected child lifecycle.",
|
|
1870
1968
|
"availability": "Node",
|
|
1871
1969
|
"protocol": "Node ESM / owned process or test lifecycle",
|
|
1872
|
-
"normalization": "
|
|
1970
|
+
"normalization": "Defaults to complete UTF-8 capture/events. AsyncIterable input and awaited onOutput retain backpressure. Explicit null outputEncoding delivers native Buffers only to a selected onOutput owner with capture and line events disabled for that stream; failures retain complete chunks and drained process diagnostics."
|
|
1873
1971
|
},
|
|
1874
1972
|
{
|
|
1875
1973
|
"id": "root:runRegisteredTests",
|
|
@@ -2012,7 +2110,7 @@
|
|
|
2012
2110
|
],
|
|
2013
2111
|
"primaryImport": "arcane-os",
|
|
2014
2112
|
"group": "Workspace, doctor, repository, and server",
|
|
2015
|
-
"summary": "Starts
|
|
2113
|
+
"summary": "Starts an owned source or packaged browser server with complete selected routes, HTTPS by default, explicit HTTP selection, listener readiness and shutdown.",
|
|
2016
2114
|
"availability": "Node control plane; browser data plane",
|
|
2017
2115
|
"protocol": "Node ESM",
|
|
2018
2116
|
"normalization": "SDK-normalized inputs, errors, events, and documented result"
|
|
@@ -3779,14 +3877,14 @@
|
|
|
3779
3877
|
"name": "createCoreClient",
|
|
3780
3878
|
"displayName": "createCoreClient()",
|
|
3781
3879
|
"kind": "function",
|
|
3782
|
-
"signature": "createCoreClient({global=globalThis,transport=null,eventOwner=arcaneEvents,eventOwnerReady,autoConnect=true,replayRuntimeState=false,onError}={})",
|
|
3880
|
+
"signature": "createCoreClient({global=globalThis,transport=null,eventOwner=arcaneEvents,eventOwnerReady,autoConnect=true,replayRuntimeState=false,webKitDocumentLifecycle=false,onError}={})",
|
|
3783
3881
|
"entrypoints": ["arcane-os/core/client"],
|
|
3784
3882
|
"primaryImport": "arcane-os/core/client",
|
|
3785
3883
|
"group": "Core browser client",
|
|
3786
3884
|
"summary": "Creates one correlated Arcane Core RPC client with explicit transport, readiness, events, cancellation and lifetime ownership.",
|
|
3787
3885
|
"availability": "Browser and native WebView JavaScript hosts; custom transports require a callable send(frame)",
|
|
3788
3886
|
"protocol": "arcane/1 over the selected host transport",
|
|
3789
|
-
"normalization": "Preserves complete request, result and event data; retains FIFO event-owner handoff; failTransport(error) settles pending RPCs and acknowledgements with the complete failure and releases the client lifetime; opt-in replayRuntimeState sends one observed nonblocking runtime.replay control after transport readiness"
|
|
3887
|
+
"normalization": "Preserves complete request, result and event data; retains FIFO event-owner handoff; failTransport(error) settles pending RPCs and acknowledgements with the complete failure and releases the client lifetime; opt-in replayRuntimeState sends one observed nonblocking runtime.replay control after transport readiness. Optional webKitDocumentLifecycle selects WithReply activate/frame/retire metadata outside unchanged Core JSON, synchronous acceptsNativeDelivery(activation), guarded receive/failure delivery, page-hide retirement and fresh restored activation with current-state replay. Requests cancelled while awaiting attachment are never submitted afterward. Subscriptions survive restoration; retired renderer promises abort while accepted service-lifetime work continues. Existing transport behavior is unchanged when omitted; see core-client.md for the native ownership and acknowledgement contract"
|
|
3790
3888
|
},
|
|
3791
3889
|
{
|
|
3792
3890
|
"id": "core-client:createCoreFacade",
|
|
@@ -3814,7 +3912,7 @@
|
|
|
3814
3912
|
"summary": "Installs one synchronous global Arcane facade, native receive callback and terminal transport-failure callback for the selected renderer lifetime.",
|
|
3815
3913
|
"availability": "Browser and native WebView JavaScript hosts",
|
|
3816
3914
|
"protocol": "arcane/1 renderer facade",
|
|
3817
|
-
"normalization": "Repeated installation returns the same client; close/failTransport release owned resources and restore prior globals only while still owned; __arcaneTransportFailed preserves the complete host failure without killing Core"
|
|
3915
|
+
"normalization": "Repeated installation returns the same client; close/failTransport release owned resources and restore prior globals only while still owned; __arcaneTransportFailed preserves the complete host failure without killing Core. Forwards optional webKitDocumentLifecycle:false by default; when selected, __arcaneWebKitDocumentCurrent(activation) probes the executing realm and __arcaneReceive(json,activation)/__arcaneTransportFailed(error,activation) reject delivery to retired or different activations before changing installation ownership"
|
|
3818
3916
|
},
|
|
3819
3917
|
{
|
|
3820
3918
|
"id": "core-client:getInstalledCoreClient",
|
|
@@ -3835,14 +3933,14 @@
|
|
|
3835
3933
|
"name": "createCoreClassicSource",
|
|
3836
3934
|
"displayName": "createCoreClassicSource()",
|
|
3837
3935
|
"kind": "function",
|
|
3838
|
-
"signature": "async createCoreClassicSource({eventOwnerModuleURL,replayRuntimeState=false}={})",
|
|
3936
|
+
"signature": "async createCoreClassicSource({eventOwnerModuleURL,replayRuntimeState=false,webKitDocumentLifecycle=false}={})",
|
|
3839
3937
|
"entrypoints": ["arcane-os/core/classic-source"],
|
|
3840
3938
|
"primaryImport": "arcane-os/core/classic-source",
|
|
3841
3939
|
"group": "Core classic client projection",
|
|
3842
3940
|
"summary": "Generates the native host's classic injection script from the installed canonical Core client and contracts.",
|
|
3843
3941
|
"availability": "Node; generated source runs in browser and native WebView renderers",
|
|
3844
3942
|
"protocol": "arcane/1 classic-script injection",
|
|
3845
|
-
"normalization": "Returns the complete canonical client projection; installs synchronous facade shapes while deferring only the event-owner module connection when document parsing is incomplete; forwards explicit
|
|
3943
|
+
"normalization": "Returns the complete canonical client projection; installs synchronous facade shapes while deferring only the event-owner module connection when document parsing is incomplete; forwards explicit replayRuntimeState and webKitDocumentLifecycle selections with false defaults. Optional WebKit lifetime requires a native WithReply lifecycle host and the existing runtime.replay control; restoration requests current state after fresh activation while rendering and independent Core startup continue"
|
|
3846
3944
|
},
|
|
3847
3945
|
{
|
|
3848
3946
|
"id": "core-runtime:createCoreRuntime",
|
|
@@ -3905,7 +4003,7 @@
|
|
|
3905
4003
|
"name": "createPortableNativeProvider",
|
|
3906
4004
|
"displayName": "createPortableNativeProvider()",
|
|
3907
4005
|
"kind": "function",
|
|
3908
|
-
"signature": "createPortableNativeProvider({services}={})",
|
|
4006
|
+
"signature": "createPortableNativeProvider({services,packagedWeb=false,webKitDocumentLifecycle=false}={})",
|
|
3909
4007
|
"entrypoints": ["arcane-os/native/portable-provider"],
|
|
3910
4008
|
"primaryImport": "arcane-os/native/portable-provider",
|
|
3911
4009
|
"group": "Portable native provider",
|
|
@@ -3984,19 +4082,103 @@
|
|
|
3984
4082
|
"protocol": "arcane-native-builder/1 windows-x64 provider",
|
|
3985
4083
|
"normalization": "Binding identity is exactly equal to the named arcaneNativeBuilderProvider export"
|
|
3986
4084
|
},
|
|
4085
|
+
{
|
|
4086
|
+
"id": "native-macos-provider:createMacOSNativeProvider",
|
|
4087
|
+
"name": "createMacOSNativeProvider",
|
|
4088
|
+
"displayName": "createMacOSNativeProvider()",
|
|
4089
|
+
"kind": "function",
|
|
4090
|
+
"signature": "createMacOSNativeProvider({services,hostDirectory}={})",
|
|
4091
|
+
"entrypoints": ["arcane-os/native/macos-provider"],
|
|
4092
|
+
"primaryImport": "arcane-os/native/macos-provider",
|
|
4093
|
+
"group": "macOS native provider",
|
|
4094
|
+
"summary": "Composes a complete selected portable payload with the architecture-selected SDK Mac host in an application bundle.",
|
|
4095
|
+
"availability": "Node assembly; matching Darwin architecture and selected host artifact for execution",
|
|
4096
|
+
"protocol": "arcane-native-builder/1 macos-arm64 and macos-x64 provider",
|
|
4097
|
+
"normalization": "Resources remains target.rootDir; bundleRoot names the app bundle; selected hostDirectory or exact-version host assets; run closes stdin and awaits graceful drain; source availability does not establish artifact publication or Mac execution"
|
|
4098
|
+
},
|
|
4099
|
+
{
|
|
4100
|
+
"id": "native-macos-provider:arcaneNativeBuilderProvider",
|
|
4101
|
+
"name": "arcaneNativeBuilderProvider",
|
|
4102
|
+
"displayName": "arcaneNativeBuilderProvider",
|
|
4103
|
+
"kind": "singleton",
|
|
4104
|
+
"signature": "const arcaneNativeBuilderProvider",
|
|
4105
|
+
"entrypoints": ["arcane-os/native/macos-provider"],
|
|
4106
|
+
"primaryImport": "arcane-os/native/macos-provider",
|
|
4107
|
+
"group": "macOS native provider",
|
|
4108
|
+
"summary": "SDK-owned Mac provider selected by macos-arm64 and macos-x64 CLI routes.",
|
|
4109
|
+
"availability": "Node assembly; matching Darwin architecture and selected host artifact for execution",
|
|
4110
|
+
"protocol": "arcane-native-builder/1",
|
|
4111
|
+
"normalization": "Uses descriptor services and selected exact-version host; identical to the default binding"
|
|
4112
|
+
},
|
|
4113
|
+
{
|
|
4114
|
+
"id": "native-macos-provider:default",
|
|
4115
|
+
"name": "default",
|
|
4116
|
+
"displayName": "arcaneNativeBuilderProvider default export",
|
|
4117
|
+
"kind": "singleton",
|
|
4118
|
+
"signature": "default as arcaneNativeBuilderProvider",
|
|
4119
|
+
"entrypoints": ["arcane-os/native/macos-provider"],
|
|
4120
|
+
"primaryImport": "arcane-os/native/macos-provider",
|
|
4121
|
+
"group": "macOS native provider",
|
|
4122
|
+
"summary": "Default binding for the same SDK Mac native provider.",
|
|
4123
|
+
"availability": "Node assembly; matching Darwin architecture and selected host artifact for execution",
|
|
4124
|
+
"protocol": "arcane-native-builder/1",
|
|
4125
|
+
"normalization": "Identical to named arcaneNativeBuilderProvider export"
|
|
4126
|
+
},
|
|
4127
|
+
{
|
|
4128
|
+
"id": "core-packaged-web:createPackagedWebService",
|
|
4129
|
+
"name": "createPackagedWebService",
|
|
4130
|
+
"displayName": "createPackagedWebService()",
|
|
4131
|
+
"kind": "function",
|
|
4132
|
+
"signature": "createPackagedWebService({artifactRoot},context={})",
|
|
4133
|
+
"entrypoints": ["arcane-os/core/packaged-web"],
|
|
4134
|
+
"primaryImport": "arcane-os/core/packaged-web",
|
|
4135
|
+
"group": "Native packaged web serving",
|
|
4136
|
+
"summary": "Owns one packaged HTTP listener, persisted loopback port, real readiness and draining shutdown inside Core.",
|
|
4137
|
+
"availability": "Node Core service lifetime",
|
|
4138
|
+
"protocol": "arcane/1 core.web.ready and core.web.failed events",
|
|
4139
|
+
"normalization": "Preserves full webRoot and start URL; stateRoot keeps the selected port across launches; no origin fallback on conflicts; unchanged launch record; explicit ready/failure events and complete listener lifecycle"
|
|
4140
|
+
},
|
|
4141
|
+
{
|
|
4142
|
+
"id": "core-preferences:createPreferencesService",
|
|
4143
|
+
"name": "createPreferencesService",
|
|
4144
|
+
"displayName": "createPreferencesService()",
|
|
4145
|
+
"kind": "function",
|
|
4146
|
+
"signature": "createPreferencesService({file}={})",
|
|
4147
|
+
"entrypoints": ["arcane-os/core/preferences"],
|
|
4148
|
+
"primaryImport": "arcane-os/core/preferences",
|
|
4149
|
+
"group": "Core preference persistence",
|
|
4150
|
+
"summary": "Supplies the five existing preference RPC methods with application-selected file storage.",
|
|
4151
|
+
"availability": "Node Core runtime",
|
|
4152
|
+
"protocol": "arcane/1 preferences methods and schemaVersion 1 entries file",
|
|
4153
|
+
"normalization": "Preserves exact keys, complete JSON values and existing metadata; writes use service lifetime and flush before acknowledgment; unreadable files remain untouched and drain waits for accepted work"
|
|
4154
|
+
},
|
|
4155
|
+
{
|
|
4156
|
+
"id": "core-preferences:default",
|
|
4157
|
+
"name": "default",
|
|
4158
|
+
"displayName": "createPreferencesService default export",
|
|
4159
|
+
"kind": "function",
|
|
4160
|
+
"signature": "default as createPreferencesService",
|
|
4161
|
+
"entrypoints": ["arcane-os/core/preferences"],
|
|
4162
|
+
"primaryImport": "arcane-os/core/preferences",
|
|
4163
|
+
"group": "Core preference persistence",
|
|
4164
|
+
"summary": "Default binding for the same Core preferences service factory.",
|
|
4165
|
+
"availability": "Node Core runtime",
|
|
4166
|
+
"protocol": "arcane/1 preferences methods and schemaVersion 1 entries file",
|
|
4167
|
+
"normalization": "Binding identity is exactly equal to the named createPreferencesService export"
|
|
4168
|
+
},
|
|
3987
4169
|
{
|
|
3988
4170
|
"id": "core-host:readCoreLaunchContext",
|
|
3989
4171
|
"name": "readCoreLaunchContext",
|
|
3990
4172
|
"displayName": "readCoreLaunchContext()",
|
|
3991
4173
|
"kind": "function",
|
|
3992
|
-
"signature": "readCoreLaunchContext({argv=process.argv.slice(2)}={})",
|
|
4174
|
+
"signature": "async readCoreLaunchContext({argv=process.argv.slice(2)}={})",
|
|
3993
4175
|
"entrypoints": ["arcane-os/core/host"],
|
|
3994
4176
|
"primaryImport": "arcane-os/core/host",
|
|
3995
4177
|
"group": "Native Core host composition",
|
|
3996
|
-
"summary": "Reads
|
|
4178
|
+
"summary": "Reads explicit launch JSON with the separately supplied native host stateRoot default for service launch context.",
|
|
3997
4179
|
"availability": "Node, including the selected external-entry SEA launcher",
|
|
3998
4180
|
"protocol": "Explicit launch arguments and JSON configuration",
|
|
3999
|
-
"normalization": "
|
|
4181
|
+
"normalization": "Optional --arcane-host-state-root <directory> supplies the stateRoot default; every explicit --arcane-launch-config JSON field takes precedence unchanged, including relative or null stateRoot and application-owned preferencesFile. Returns an empty record with neither argument; surfaces missing argument values, file and JSON failures; performs no directory selection, path resolution, configuration search, rewrite, migration or environment mutation"
|
|
4000
4182
|
},
|
|
4001
4183
|
{
|
|
4002
4184
|
"id": "core-host:startCoreHost",
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
# Local AI through Core
|
|
2
2
|
|
|
3
|
-
Core owns native llama.cpp and Ollama processes. The browser retains its own
|
|
3
|
+
Core owns native llama.cpp and Ollama processes and ONNX worker sessions. The browser retains its own
|
|
4
4
|
Wllama and ONNX implementations, and can also use an explicitly connected Core
|
|
5
5
|
when that system service is available. Runtime installation, model loading and
|
|
6
6
|
inference are separate operations.
|
|
7
7
|
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
existing browser implementation.
|
|
8
|
+
Native ONNX runs caller-selected graphs with complete named input/output tensors.
|
|
9
|
+
Applications own preprocessing, tokenization and model-specific pipelines.
|
|
10
|
+
Browser ONNX continues through its existing browser implementation.
|
|
11
11
|
|
|
12
12
|
## Application requirements
|
|
13
13
|
|
|
@@ -19,7 +19,8 @@ Existing native fields remain alongside this record:
|
|
|
19
19
|
{
|
|
20
20
|
"runtimes": [
|
|
21
21
|
{"id": "llama.cpp"},
|
|
22
|
-
{"id": "ollama"}
|
|
22
|
+
{"id": "ollama"},
|
|
23
|
+
{"id": "onnx"}
|
|
23
24
|
],
|
|
24
25
|
"llamaCpp": {
|
|
25
26
|
"modelsDirectory": "models/llama"
|
|
@@ -31,7 +32,8 @@ Existing native fields remain alongside this record:
|
|
|
31
32
|
```
|
|
32
33
|
|
|
33
34
|
Each runtime requirement accepts `id`, optional upstream `version`, and an
|
|
34
|
-
optional runtime archive `url`.
|
|
35
|
+
optional runtime archive `url`. ONNX resolves its official npm package or an
|
|
36
|
+
explicitly supplied package archive. A string runtime ID is also accepted.
|
|
35
37
|
Omitting the version allows reuse of an available runtime. Explicit versions
|
|
36
38
|
select that upstream distribution; an existing service must match the requested
|
|
37
39
|
version before it is reused. A service occupying the selected address is
|
|
@@ -48,7 +50,7 @@ application. Applications choose and provision their models explicitly.
|
|
|
48
50
|
## Development
|
|
49
51
|
|
|
50
52
|
```sh
|
|
51
|
-
arcane dev --local-ai llama.cpp,ollama
|
|
53
|
+
arcane dev --local-ai llama.cpp,ollama,onnx
|
|
52
54
|
```
|
|
53
55
|
|
|
54
56
|
The option adds those runtime requirements to the authored application
|
|
@@ -64,6 +66,13 @@ service or machine environment. Windows and macOS use the host archive utility;
|
|
|
64
66
|
Linux requires `tar`, and `unzip` when extracting a selected Windows ZIP.
|
|
65
67
|
Zstandard archives use the supported Node runtime's decompressor.
|
|
66
68
|
|
|
69
|
+
Selected ONNX preparation installs `onnxruntime-node@1.30.0` by default into a
|
|
70
|
+
managed npm prefix, retaining its complete published runtime dependency tree.
|
|
71
|
+
It uses the upstream CPU installation option to skip supplementary GPU downloads.
|
|
72
|
+
Node/npm must be available while preparing that runtime; a native app consumes
|
|
73
|
+
the bundled tree without installing it again. Applications that omit ONNX do
|
|
74
|
+
not install its package.
|
|
75
|
+
|
|
67
76
|
For the optional development browser connection, load the bootstrap after the
|
|
68
77
|
managed import map and before creating a Core-backed provider:
|
|
69
78
|
|
|
@@ -111,6 +120,9 @@ service and a loaded model are separate facts.
|
|
|
111
120
|
`localai.services.recover({runtimes: ['llama.cpp']})` makes one explicit recovery
|
|
112
121
|
attempt for the selected runtimes; omission selects all configured runtimes.
|
|
113
122
|
Recovery restarts only SDK-owned processes and reconnects to external services.
|
|
123
|
+
Recovering ONNX releases its sessions; explicitly load models again afterward.
|
|
124
|
+
Its state is `recovering` and unavailable until the previous workers exit and
|
|
125
|
+
the new session owner is ready.
|
|
114
126
|
An external llama.cpp server returns HTTP 503 during initial model loading and
|
|
115
127
|
offers no readiness subscription at that stage. Core retains `state: 'loading'`;
|
|
116
128
|
a subsequent explicit load or recovery request checks again. There is no
|
|
@@ -175,6 +187,106 @@ silently change the application's saved model choice. Release registration
|
|
|
175
187
|
with `unregister()` and dispose the provider at the application's owning
|
|
176
188
|
lifecycle boundary.
|
|
177
189
|
|
|
190
|
+
## Native ONNX sessions
|
|
191
|
+
|
|
192
|
+
```js
|
|
193
|
+
import {ensureLocalAIRuntimes} from 'arcane-os/local-ai';
|
|
194
|
+
import {createONNXRuntime} from 'arcane-os/local-ai/onnx';
|
|
195
|
+
|
|
196
|
+
const [runtime] = await ensureLocalAIRuntimes({
|
|
197
|
+
runtimes: ['onnx'], directory: '.arcane/local-ai/runtimes'
|
|
198
|
+
});
|
|
199
|
+
const onnx = createONNXRuntime({modulePath: runtime.modulePath});
|
|
200
|
+
try {
|
|
201
|
+
const loaded = await onnx.load({id: 'cheese-radar', model: absoluteModelPath});
|
|
202
|
+
// Supply the actual names, shapes and values expected by this graph.
|
|
203
|
+
const outputs = await onnx.run({id: loaded.id, feeds});
|
|
204
|
+
console.log(outputs);
|
|
205
|
+
} finally {
|
|
206
|
+
await onnx.close();
|
|
207
|
+
}
|
|
208
|
+
```
|
|
209
|
+
|
|
210
|
+
The factory accepts `{modulePath,signal?,onEvent?}` and starts no worker until
|
|
211
|
+
`load({id,model,sessionOptions?,signal?})`. The model path is absolute for this
|
|
212
|
+
direct Node API. Session creation defaults to the CPU execution provider;
|
|
213
|
+
explicit native session options remain caller-owned. The returned session
|
|
214
|
+
record contains `id`, `model`, `state`, `loaded`, `error`, input/output names and
|
|
215
|
+
metadata. A live ID requires explicit unload before replacement. An ID may be
|
|
216
|
+
loaded again once its previous worker exits after a failed load or unload.
|
|
217
|
+
A run error retains the loaded session so a corrected request can use it.
|
|
218
|
+
|
|
219
|
+
`run({id,feeds,fetches?,runOptions?,signal?})` returns the complete output-name
|
|
220
|
+
map of `{type,dims,data}` tensors. Input records use that same shape with native
|
|
221
|
+
typed data or string arrays. Optional `fetches` selects output names or supplies
|
|
222
|
+
output tensors using the upstream API. Worker transport copies supplied tensor
|
|
223
|
+
data; returned output records contain the results, and caller-owned preallocated
|
|
224
|
+
buffers are not mutated in place. Each session retains its own worker and
|
|
225
|
+
loaded graph; work for independent sessions proceeds concurrently. Runs for one
|
|
226
|
+
session execute in order and wait at that session's loading boundary. There is
|
|
227
|
+
no token streaming in the generic tensor operation.
|
|
228
|
+
|
|
229
|
+
String input containing U+0000 reports an incompatibility at the native tensor
|
|
230
|
+
boundary: the Node binding uses null-terminated strings and cannot preserve
|
|
231
|
+
that input completely. The SDK does not alter the supplied string.
|
|
232
|
+
|
|
233
|
+
`current()` returns `{sessions,closed}`. `subscribe(listener)` replays current
|
|
234
|
+
state synchronously and returns an unsubscribe function. Load, readiness,
|
|
235
|
+
unload and failures remain observable. `unload({id,signal?})` releases that
|
|
236
|
+
session; `close()` owns all remaining workers and awaits their actual exits.
|
|
237
|
+
|
|
238
|
+
Cancelling a queued run removes that run. Cancelling active native work stops
|
|
239
|
+
delivery and retires its worker; the session becomes unavailable until loaded
|
|
240
|
+
again. ONNX Runtime's Node binding offers no native inference interruption:
|
|
241
|
+
worker termination can wait for a native call to return. Shutdown observes the
|
|
242
|
+
actual exit and does not claim that rejecting a request stopped native work.
|
|
243
|
+
Other sessions retain their own lifetimes.
|
|
244
|
+
|
|
245
|
+
### ONNX through Core and the browser
|
|
246
|
+
|
|
247
|
+
| Core method | Parameters | Result |
|
|
248
|
+
| --- | --- | --- |
|
|
249
|
+
| `onnx.status` | `{}` | Runtime availability and current `models` session records |
|
|
250
|
+
| `onnx.load` | `{id,model,sessionOptions?}` | Loaded session; relative model paths resolve from `appRoot` |
|
|
251
|
+
| `onnx.run` | `{id,feeds,fetches?,runOptions?}` | Complete encoded tensor output map |
|
|
252
|
+
| `onnx.unload` | `{id}` | Released session record |
|
|
253
|
+
|
|
254
|
+
Use the browser accessor to handle the Core tensor transport:
|
|
255
|
+
|
|
256
|
+
```js
|
|
257
|
+
import {createCoreONNXRuntime} from 'arcane-os/ai/core-onnx';
|
|
258
|
+
|
|
259
|
+
const onnx = createCoreONNXRuntime({client});
|
|
260
|
+
const stop = onnx.subscribe(function showRuntime(state) { console.log(state); });
|
|
261
|
+
await onnx.inspect();
|
|
262
|
+
await onnx.load({id: 'cheese-radar', model: 'models/cheese-radar.onnx'});
|
|
263
|
+
const outputs = await onnx.run({id: 'cheese-radar', feeds});
|
|
264
|
+
await onnx.unload({id: 'cheese-radar'});
|
|
265
|
+
stop();
|
|
266
|
+
onnx.close();
|
|
267
|
+
```
|
|
268
|
+
|
|
269
|
+
The accessor exposes `load`, `run`, `unload`, `inspect`, `current`, `subscribe`
|
|
270
|
+
and `close`. Request methods accept `signal` and optional `timeoutMs` (default
|
|
271
|
+
`0`, no elapsed-time cutoff). It preserves full typed tensor values, including
|
|
272
|
+
64-bit integers, floating-point special values and strings, through the
|
|
273
|
+
transport codec. `current()` adds `busy` and `closed` to its latest Core state.
|
|
274
|
+
Closing the accessor cancels its requests and subscriptions; model unloading
|
|
275
|
+
is explicit because other accessors may share the Core session. It never
|
|
276
|
+
closes the shared Core client.
|
|
277
|
+
|
|
278
|
+
Construction neither opens a connection nor installs a runtime. A browser needs
|
|
279
|
+
an already available native Core service or the explicit development bridge.
|
|
280
|
+
Unavailable native ONNX leaves browser ONNX/Wllama under the application's
|
|
281
|
+
existing selection. This tensor API does not select an LLM, tokenizer, speech,
|
|
282
|
+
image or avatar pipeline.
|
|
283
|
+
|
|
284
|
+
Native ONNX CPU package targets are Windows, Linux and macOS on `x64`/`arm64`,
|
|
285
|
+
as listed in Microsoft's [Node binding platform matrix](https://github.com/microsoft/onnxruntime/blob/v1.30.0/js/node/README.md).
|
|
286
|
+
Android needs its host's native ONNX adapter; the Node package contains no
|
|
287
|
+
Android binding. Platform support here describes upstream package targets,
|
|
288
|
+
not execution evidence on each platform.
|
|
289
|
+
|
|
178
290
|
## Native bundling
|
|
179
291
|
|
|
180
292
|
The SDK portable native build includes selected official runtime trees under
|
|
@@ -191,7 +303,29 @@ Architectures are `x64` or `arm64`. Availability depends on the upstream
|
|
|
191
303
|
runtime's published platform assets; Ollama has no official Android runtime
|
|
192
304
|
archive in this installer.
|
|
193
305
|
|
|
194
|
-
Ensure returns absolute `{id,version,platform,architecture,root
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
306
|
+
Ensure returns absolute `{id,version,platform,architecture,root}` records.
|
|
307
|
+
Server runtimes also include `executable`; ONNX includes `modulePath` pointing
|
|
308
|
+
to its public package entry. Bundle returns `{runtimes,files}`,
|
|
309
|
+
with artifact-relative runtime paths and a complete emitted file inventory.
|
|
310
|
+
Bundling requires a fresh native staging destination, preserving existing
|
|
311
|
+
completed outputs.
|
|
312
|
+
|
|
313
|
+
### NeMo Speech library runtime
|
|
314
|
+
|
|
315
|
+
The runtime helpers also accept `{id: 'nemo-speech', version: '0.2.0'}` to
|
|
316
|
+
prepare NVIDIA's official CPU library distribution. An omitted NeMo version
|
|
317
|
+
selects `0.2.0`. Its published targets are Windows `x64`, Linux `x64`/`arm64`,
|
|
318
|
+
and macOS `x64`/`arm64`.
|
|
319
|
+
|
|
320
|
+
NeMo records include `includeDirectory`, `libraryDirectory`, `binaryDirectory`,
|
|
321
|
+
and `cmakeDirectory`; they have no server `executable`. The complete upstream
|
|
322
|
+
tree remains under `root`, including any archive prefix directory. Use the
|
|
323
|
+
returned `cmakeDirectory` as `NeMoSpeech_DIR` when calling
|
|
324
|
+
`find_package(NeMoSpeech CONFIG REQUIRED COMPONENTS Diarization)`, then link
|
|
325
|
+
the upstream `NeMoSpeech::Diarization` target. Bundling preserves the complete
|
|
326
|
+
tree and makes all these paths relative to the native artifact root.
|
|
327
|
+
|
|
328
|
+
This helper installs the library. The application configuration and development
|
|
329
|
+
CLI select llama.cpp, Ollama and ONNX services described above;
|
|
330
|
+
NeMo model selection and a native diarization helper belong to their owning
|
|
331
|
+
integration.
|