arcane-os 0.63.0 → 0.65.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.
Files changed (58) hide show
  1. package/CHANGELOG.md +48 -0
  2. package/README.md +1 -1
  3. package/browser-runtime/core/client.mjs +69 -7
  4. package/docs/guides/native-whisper-openvino.md +334 -0
  5. package/docs/reference/README.md +6 -0
  6. package/docs/reference/arcane-ollama.md +1 -1
  7. package/docs/reference/codex-app-server.md +269 -0
  8. package/docs/reference/core-client.md +71 -4
  9. package/docs/reference/core-development.md +157 -0
  10. package/docs/reference/core-native-packaging.md +48 -6
  11. package/docs/reference/core-repositories.md +258 -0
  12. package/docs/reference/inventory/package-api.json +199 -3
  13. package/docs/reference/inventory/runtime-modules.json +3 -2
  14. package/docs/reference/local-ai.md +77 -4
  15. package/docs/reference/local-image-flux.md +1 -1
  16. package/docs/reference/local-image-generation.md +11 -0
  17. package/docs/reference/local-image-sdxl.md +139 -0
  18. package/docs/reference/local-whisper.md +219 -0
  19. package/docs/reference/mcp-stdio.md +263 -0
  20. package/docs/reference/native-speech.md +51 -2
  21. package/docs/reference/runtime-components.md +18 -1
  22. package/docs/reference/runtime-modules.md +26 -4
  23. package/docs/reference/sdk-api.md +412 -2
  24. package/package.json +9 -2
  25. package/runtime/arcane/components/speech.html +15 -3
  26. package/runtime/arcane/components/voice-transcription.html +19 -3
  27. package/runtime/arcane/modules/AI.js +406 -40
  28. package/runtime/arcane/modules/AIProviderRuntime.js +20 -3
  29. package/runtime/arcane/modules/AIRuntimeState.js +15 -2
  30. package/runtime/arcane/modules/ComponentContracts.js +3 -0
  31. package/runtime/arcane/modules/Ollama.js +1 -1
  32. package/runtime/arcane/modules/OllamaModelIdentifier.js +13 -0
  33. package/schemas/arcane-app.schema.json +60 -2
  34. package/schemas/arcane-package.schema.json +60 -2
  35. package/src/codex/app-server.mjs +845 -0
  36. package/src/core/development.mjs +457 -0
  37. package/src/core/repositories.mjs +375 -0
  38. package/src/core/services/local-ai.mjs +80 -10
  39. package/src/core/services/speech.mjs +1 -0
  40. package/src/dev-server.mjs +3 -2
  41. package/src/index.mjs +1 -0
  42. package/src/local-ai/config.mjs +7 -3
  43. package/src/local-ai/dev.mjs +85 -401
  44. package/src/local-ai/image-library.mjs +9 -0
  45. package/src/local-ai/image-models/sdxl.mjs +18 -0
  46. package/src/local-ai/install.mjs +26 -7
  47. package/src/local-ai/whisper/build.mjs +48 -0
  48. package/src/local-ai/whisper/config.mjs +89 -0
  49. package/src/local-ai/whisper/index.mjs +572 -0
  50. package/src/local-ai/whisper/install.mjs +332 -0
  51. package/src/local-ai/whisper/native/CMakeLists.txt +98 -0
  52. package/src/local-ai/whisper/native/NOTICE +18 -0
  53. package/src/local-ai/whisper/native/README.md +104 -0
  54. package/src/local-ai/whisper/native/main.cpp +520 -0
  55. package/src/local-ai/whisper/openvino-build.mjs +138 -0
  56. package/src/mcp/stdio-server.mjs +579 -0
  57. package/src/native/portable-layout.mjs +39 -7
  58. package/src/toolchain.mjs +19 -8
@@ -82,8 +82,9 @@ Each supplied engine implements:
82
82
  function.
83
83
  - `load({signal})`, resolving only after the constructor-selected model has
84
84
  loaded. Independent engines may load concurrently.
85
- - `transcribe(request, {signal, onProgress})` for STT, or
86
- `synthesize(request, {signal, onProgress})` for TTS.
85
+ - `transcribe(request, {signal, onProgress, requestId})` for STT, or
86
+ `synthesize(request, {signal, onProgress, requestId})` for TTS. `requestId` is
87
+ the actual Core request's control metadata, separate from the unchanged payload.
87
88
  - `close()`, cancelling and joining its native work and releasing its resources.
88
89
 
89
90
  The service forwards each complete request and result unchanged. It applies
@@ -112,3 +113,51 @@ share one shutdown promise. Actual engine cleanup failures reject with an
112
113
  `AggregateError` and remain in role diagnostics. `dispose()` additionally
113
114
  releases the service's event subscriptions. New work after shutdown begins
114
115
  rejects with `CORE_CLOSING`.
116
+
117
+ ## AI built-in native speech readiness
118
+
119
+ The `AI` module's `LOCAL_SPEACH` adapter observes `speech.state` before reading
120
+ `Arcane.speech.status()`. A newer event takes precedence over an outstanding
121
+ initial status response. Each role loads independently: STT does not wait for
122
+ TTS, and unmuting waits for the selected TTS model rather than a callable facade.
123
+
124
+ For this service's role snapshots, readiness requires the exact selected
125
+ `modelId`, its engine identity, `loaded: true`, `available: true`, and a `ready`
126
+ or `running` state. Model loading remains an ordinary cancellable waiting state.
127
+ An engine error, unavailable role, or different selected model rejects the
128
+ adapter load. Later readiness loss or engine/model replacement invalidates the
129
+ AI role and cancels its queued and active requests through the existing provider
130
+ runtime. A new explicit role load or unmute can observe the next ready state.
131
+
132
+ An engine can report `state: 'recovering'`, `loaded: false`, `busy: true`, and
133
+ the continuing Core `requestId` while retrying an already accepted request on
134
+ the same selected provider and model. Availability remains false. The built-in
135
+ STT adapter preserves only its own correlated pending request through this
136
+ state; another caller's recovery supplies no continuation authority. The real
137
+ RPC ID comes from `Arcane.speech.transcribe`'s optional `onRequest` observer.
138
+ The engine retains that ID on a terminal error snapshot until the snapshot is
139
+ superseded, allowing the pending RPC to deliver its actual complete failure
140
+ rather than converting it into cancellation. True unload, close, replacement,
141
+ transport loss and caller cancellation retain their existing ownership.
142
+
143
+ The shared AI observation becomes `recovering` with `loaded: false`, `busy:
144
+ true`, and its existing runtime `operationId`. An error may likewise retain
145
+ `busy: true` until the actual operation settles. New inference still requires
146
+ genuine loaded readiness. The STT provider request context includes a
147
+ `refreshState()` callback which rereads that provider's status only while the
148
+ exact request remains owned; it changes observation, not execution authority.
149
+ Shared speech components retain their own real runtime operation through this
150
+ recovery, keep new dispatch readiness-gated, and preserve native microphone
151
+ capture's separate cancellation and final/interim lifetime.
152
+
153
+ Older fixed-model hosts expose the published aggregate-only `SpeechStatus`
154
+ contract instead of per-model lifecycle. The adapter preserves their independent
155
+ health-based readiness for `whisper-small` with `whisper.cpp` and `kokoro` with
156
+ `kokoro-onnx`, using `status: 'ok'` and the corresponding availability boolean.
157
+ That contract is a one-shot health observation, not evidence of a persistently
158
+ loaded native model or a continuous lifecycle event stream.
159
+
160
+ Cancellation, unload, disposal, and route retirement release adapter-owned
161
+ subscriptions. They do not close the host's shared engines or alter complete
162
+ speech requests and results. Browser and explicitly registered speech providers
163
+ retain their existing lifecycle contracts.
@@ -1742,6 +1742,14 @@ owner, and the voice control retains its state-specific labels and retry action.
1742
1742
  Desktop speech and the dedicated `voice-transcription.html` component retain their
1743
1743
  existing behavior.
1744
1744
 
1745
+ An already accepted file transcription retains its exact owned runtime
1746
+ operation through the same provider/model's unloaded, busy `recovering` state
1747
+ or correlated pending error. This preserves the actual RPC result or failure;
1748
+ it does not enable another recording. Unload, close, provider/model replacement,
1749
+ transport loss and caller cancellation still invalidate owned work. Native Web
1750
+ Speech microphone capture keeps its independent readiness and final/interim
1751
+ cancellation lifetime. See [native speech recovery](native-speech.md).
1752
+
1745
1753
  On desktop, the Hold to talk control remains disabled unless sticky STT state
1746
1754
  is `ready`, the role is not busy, and microphone capture is available. For an explicitly
1747
1755
  selected STT route, a separate keyboard-operable control presents Start
@@ -2115,7 +2123,16 @@ Unknown provider/runtime diagnostics remain complete in the developer console
2115
2123
  and error events, while controls use generic visible outcomes unless the Error
2116
2124
  owner explicitly marks nonblank copy with `userSafe:true`.
2117
2125
 
2118
- For the default manual mode, if sticky readiness is lost during microphone acquisition, capture, or the STT
2126
+ An already accepted file transcription can continue through the exact same
2127
+ provider/model/runtime operation's unloaded, busy recovery or pending-error
2128
+ state. This uses the real runtime operation ID rather than the component's local
2129
+ counter; another request supplies no continuation authority. New recording and
2130
+ transcription remain readiness-gated, and actual unload, close, replacement,
2131
+ transport loss or cancellation still ends the owned request. The same shared
2132
+ rule applies to an active continuous file-transcription job. Native Web Speech
2133
+ capture retains its separate readiness, stop/final-drain and interim ownership.
2134
+
2135
+ Outside that exact continuing request, if sticky readiness is lost during microphone acquisition, capture, or the STT
2119
2136
  request, the component invalidates the session, aborts the owned request signal,
2120
2137
  releases media, discards late completion, and emits
2121
2138
  `speech-transcription-cancelled`. Its source-local reason is
@@ -1121,6 +1121,14 @@ work. Promise settlement proves only that the provider's exposed request promise
1121
1121
  completed; provider-specific cancellation acknowledgement remains the selected
1122
1122
  provider's boundary.
1123
1123
 
1124
+ An STT provider's request context also supplies `refreshState()`. An engine
1125
+ lifecycle observer may call it to reread `provider.status()` while that exact
1126
+ request remains active. A recovering or failed pending request is observed as
1127
+ `loaded: false`, `busy: true`, with its existing runtime operation ID; the
1128
+ callback does not make a new request ready or change its supplied payload.
1129
+ After cancellation, unload, disposal, replacement, or settlement it has no
1130
+ effect on the retired request.
1131
+
1124
1132
  Direct LLM `request()`, `chat()`, and `stream()` use the same message history,
1125
1133
  tool-declaration, emitted-call, all-choice, and ordered parallel-call contracts
1126
1134
  as the high-level AI API module, including one nonblank matching result for
@@ -1229,13 +1237,17 @@ observable without exposing provider transports in application code.
1229
1237
 
1230
1238
  Exact exports: `AI_RUNTIME_INTENT_EVENT`, `AI_RUNTIME_PROTOCOL`,
1231
1239
  `AI_RUNTIME_ROLES`, `AI_RUNTIME_STARTUP_EVENT`, `AI_RUNTIME_STATES`,
1232
- `AI_RUNTIME_STATE_EVENT`, `getAIRuntimeState`,
1240
+ `AI_RUNTIME_STATE_EVENT`, `continuesAIRuntimeOperation`, `getAIRuntimeState`,
1233
1241
  `publishAIRuntimeRoleState`, `publishAIRuntimeRolesState`,
1234
1242
  `requestAIRuntimeIntent`, `startAIRuntime`, `subscribeAIRuntimeIntents`, and
1235
1243
  `subscribeAIRuntimeState`.
1236
1244
 
1237
1245
  Each role record is exactly `{role,state,providerId,modelId,localOnly,loaded,
1238
1246
  busy,operationId,progress,error}`.
1247
+ `continuesAIRuntimeOperation(previous,current,operationId)` identifies the same
1248
+ already-owned provider/model/runtime operation in a busy, unloaded `recovering`
1249
+ or `error` observation. Pass the actual runtime operation ID, not a component's
1250
+ local counter. It grants neither readiness nor permission to start new work.
1239
1251
  `subscribeAIRuntimeState(listener,{signal=null,emitCurrent=true})` installs its
1240
1252
  subscription and synchronously replays the current mutable snapshot by default;
1241
1253
  `subscribeAIRuntimeIntents(listener,{signal=null})` is future-only. Both return
@@ -1251,7 +1263,9 @@ transcription-model load.
1251
1263
  ### Availability and normalization
1252
1264
 
1253
1265
  **Cross-host state contract.** States are `unavailable`, `unloaded`, `loading`,
1254
- `ready`, `unloading`, `error`, and `disposed`. Revisions increase monotonically.
1266
+ `recovering`, `ready`, `unloading`, `error`, and `disposed`. Recovery remains
1267
+ `loaded: false`; `recovering` and `error` may retain `busy: true` with an actual
1268
+ `operationId` until the pending request settles. Revisions increase monotonically.
1255
1269
  The events `arcane-ai-runtime-state`, `arcane-ai-runtime-intent`, and
1256
1270
  `arcane-ai-runtime-startup-settled` normalize observation only: receiving one
1257
1271
  does not grant a native capability, prove browser support, or load a provider.
@@ -3213,9 +3227,17 @@ Validates and canonicalizes the syntax of Ollama model identifiers without grant
3213
3227
 
3214
3228
  ### Public surface
3215
3229
 
3216
- `normalizeOllamaModelIdentifier()`, `isOllamaModelIdentifier()`.
3230
+ `normalizeOllamaModelIdentifier()`, `isOllamaModelIdentifier()`,
3231
+ `sameOllamaModelIdentifier(left, right)`.
3232
+
3233
+ Exact exports: `isOllamaModelIdentifier`, `normalizeOllamaModelIdentifier`,
3234
+ `sameOllamaModelIdentifier`.
3217
3235
 
3218
- Exact exports: `isOllamaModelIdentifier`, `normalizeOllamaModelIdentifier`.
3236
+ The comparison helper applies Ollama's default registry (`registry.ollama.ai`),
3237
+ namespace (`library`) and tag (`latest`) with case-insensitive name comparison.
3238
+ It compares a selected name with resident-model names without rewriting either
3239
+ string or any outbound payload; different explicit hosts, namespaces or tags
3240
+ remain distinct. The existing identifier-validation functions are unchanged.
3219
3241
 
3220
3242
  ### Availability and normalization
3221
3243