arcane-os 0.55.0 → 0.57.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 +51 -0
- package/README.md +5 -3
- package/browser-runtime/ai/core-local.mjs +306 -0
- package/browser-runtime/core/client.mjs +75 -14
- package/browser-runtime/core/contracts.mjs +2 -1
- package/docs/consumer-updates.md +82 -0
- package/docs/publishing.md +41 -18
- package/docs/reference/README.md +31 -1
- package/docs/reference/availability-and-normalization.md +11 -3
- package/docs/reference/cli.md +9 -1
- package/docs/reference/core-client.md +45 -2
- package/docs/reference/core-native-packaging.md +195 -11
- package/docs/reference/core-runtime.md +10 -0
- package/docs/reference/inventory/package-api.json +160 -20
- package/docs/reference/local-ai.md +197 -0
- package/docs/reference/protocols.md +91 -14
- package/docs/reference/pwa.md +17 -0
- package/docs/reference/runtime-modules.md +6 -5
- package/docs/reference/sdk-api.md +165 -26
- package/package.json +5 -1
- package/runtime/arcane/modules/LocalAIReadiness.js +3 -1
- package/schemas/arcane-app.schema.json +64 -0
- package/schemas/arcane-package.schema.json +54 -0
- package/src/app-descriptor.mjs +35 -2
- package/src/app-layout.mjs +6 -2
- package/src/cli/main.mjs +8 -2
- package/src/core/host.mjs +23 -0
- package/src/core/hosts/arcane-core-loader.cjs +2 -0
- package/src/core/hosts/linux/arcane_core_process.c +568 -0
- package/src/core/hosts/linux/arcane_core_process.h +127 -0
- package/src/core/hosts/macos/ArcaneCoreProcess.h +85 -0
- package/src/core/hosts/macos/ArcaneCoreProcess.m +357 -0
- package/src/core/hosts/sea-launcher.cjs +17 -0
- package/src/core/hosts/windows/ArcaneCoreProcess.cs +416 -0
- package/src/core/hosts/windows/ArcaneHost.cs +695 -0
- package/src/core/hosts/windows/ArcaneHost.manifest +22 -0
- package/src/core/hosts/windows/ArcaneLauncher.cs +239 -0
- package/src/core/runtime.mjs +15 -3
- package/src/core/services/local-ai.mjs +543 -0
- package/src/core-classic-source.mjs +2 -2
- package/src/dev-server.mjs +7 -0
- package/src/import-map.mjs +1 -0
- package/src/local-ai/archive.mjs +52 -0
- package/src/local-ai/config.mjs +62 -0
- package/src/local-ai/dev.mjs +390 -0
- package/src/local-ai/discover.mjs +71 -0
- package/src/local-ai/http.mjs +106 -0
- package/src/local-ai/install.mjs +344 -0
- package/src/local-ai/server.mjs +262 -0
- package/src/native/portable-layout.mjs +29 -4
- package/src/native/portable-provider.mjs +39 -8
- package/src/native/windows-provider.mjs +262 -0
- package/src/native-provider-loader.mjs +8 -2
- package/src/packager/core.mjs +89 -15
- package/src/process.mjs +74 -12
- package/src/toolchain.mjs +38 -8
|
@@ -88,9 +88,11 @@ Explicit host document lists use the separate root-exported
|
|
|
88
88
|
described below; they do not enter app discovery.
|
|
89
89
|
|
|
90
90
|
The application dependency boundary is conditional. Only an application that
|
|
91
|
-
actually consumes Arcane declares
|
|
92
|
-
|
|
93
|
-
|
|
91
|
+
actually consumes Arcane declares `arcane-os` in its own `package.json` and
|
|
92
|
+
resolves it through that project's normal install into its own `node_modules`.
|
|
93
|
+
During development the declaration tracks `latest`; the lockfile and installed
|
|
94
|
+
package record the exact selected version. An explicitly selected production
|
|
95
|
+
build may declare an exact version. An application that does not currently consume
|
|
94
96
|
Arcane adds no `arcane-os` dependency solely because of this rule; the user or
|
|
95
97
|
governing task may direct that application to adopt Arcane later, at which point
|
|
96
98
|
the same app-owned package, install, projection, and artifact boundary applies.
|
|
@@ -145,9 +147,70 @@ included resources without receiving application-document processing.
|
|
|
145
147
|
Component processing and shared runtime-resource traversal retain their existing
|
|
146
148
|
behavior. Offline inclusion still follows the app's PWA resource selection.
|
|
147
149
|
|
|
150
|
+
## Native-only application resources
|
|
151
|
+
|
|
152
|
+
An application's schema-2 `arcane-app.json` can explicitly select server modules
|
|
153
|
+
and their complete app-owned source closure without adding them to its browser
|
|
154
|
+
or PWA output:
|
|
155
|
+
|
|
156
|
+
```json
|
|
157
|
+
{
|
|
158
|
+
"package": {
|
|
159
|
+
"include": ["index.html", "modules", "css"],
|
|
160
|
+
"nativeResources": {
|
|
161
|
+
"include": ["server", "src", "package.json"],
|
|
162
|
+
"exclude": ["server/drafts"]
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
```
|
|
167
|
+
|
|
168
|
+
This is a package excerpt. Each path is literal and relative to the application
|
|
169
|
+
root; a directory includes its descendants. The app selects the full required
|
|
170
|
+
closure explicitly. The SDK does not crawl imports to discover server source,
|
|
171
|
+
filter it by extension, install app dependencies or execute a service.
|
|
172
|
+
`nativeResources.include` is required and may be empty; `exclude` defaults to
|
|
173
|
+
`[]`. Descriptor projection writes the same record at the top level of schema-1
|
|
174
|
+
`arcane-package.json`, and package-only apps may author it there directly.
|
|
175
|
+
Omission remains omission. The native registry descriptor is unchanged.
|
|
176
|
+
|
|
177
|
+
`packageApp({target})` and `inspectApp({target})` default to `'browser'`. A
|
|
178
|
+
nonbrowser SDK target adds these resources to the ordinary app/shared selection.
|
|
179
|
+
Native exclusions apply only to the additional selection, not the browser
|
|
180
|
+
selection. A file selected by both is emitted once through its ordinary browser
|
|
181
|
+
processing. Files selected only as native resources retain their complete
|
|
182
|
+
original content, including imports, HTML, line endings and data. They are copied
|
|
183
|
+
after browser document discovery, module projection, asset rewriting and PWA
|
|
184
|
+
processing, and appear in the complete release inventory. A collision with
|
|
185
|
+
generated output reports an error instead of replacing that output.
|
|
186
|
+
|
|
187
|
+
Target and module representation are independent: `moduleFormat:'native'`
|
|
188
|
+
controls browser module/script packaging and does not select native resources.
|
|
189
|
+
Nonbrowser targets use effective `browserPwa:false`; ordinary browser calls keep
|
|
190
|
+
their configured PWA behavior. An app adapter receives `target` and effective
|
|
191
|
+
`browserPwa` in its existing `buildArcanePackage()` context. Its `copyBase()`
|
|
192
|
+
copies ordinary browser/shared files; the packager appends native-only files
|
|
193
|
+
after the adapter and browser transformations finish.
|
|
194
|
+
|
|
195
|
+
A nonbrowser target with a nonempty native include list writes its app input to
|
|
196
|
+
`dist/.native/<target>/<app-id>`, even when the saved browser `outputDirectory`
|
|
197
|
+
is custom. This keeps an existing browser/PWA output separate. An explicit
|
|
198
|
+
low-level `outputDirectory` override takes precedence; it must name the
|
|
199
|
+
dedicated output the caller intends to replace. Omitted or empty native
|
|
200
|
+
resources preserve the existing output rules. `inspectApp()` reports the
|
|
201
|
+
effective `output` and complete selected files without writing them.
|
|
202
|
+
|
|
203
|
+
Paired native `buildApplication()` applies the same selected target and output
|
|
204
|
+
resolution to the selected app and every explicitly bundled app. Each app keeps
|
|
205
|
+
its own declaration; the provider receives actual release roots and complete
|
|
206
|
+
release records. Native artifact `outputRoot` remains a different directory.
|
|
207
|
+
Use `verifyApp({workspaceRoot,appId,outputDirectory:release.output})` to inspect
|
|
208
|
+
that emitted app release; verification does not launch its services or host.
|
|
209
|
+
See [the portable service composition guide](core-native-packaging.md#native-only-application-resources).
|
|
210
|
+
|
|
148
211
|
## App-selected package output
|
|
149
212
|
|
|
150
|
-
|
|
213
|
+
For browser selection, an app may set `"outputDirectory": "ai"` in its schema-1
|
|
151
214
|
`arcane-package.json`. This selects the final directory relative to the
|
|
152
215
|
workspace: `<workspace>/ai`, not `<workspace>/ai/<app-id>`. Omitting the
|
|
153
216
|
field retains `dist/<app-id>`. The root `arcane-packager.json` configuration
|
|
@@ -183,6 +246,10 @@ output must remain separate; a conflicting native assembly fails before it
|
|
|
183
246
|
packages any app. App launch paths, resource URLs, and enabled PWA
|
|
184
247
|
representations retain their package-relative layout.
|
|
185
248
|
|
|
249
|
+
The [native-only resource selection](#native-only-application-resources) above
|
|
250
|
+
adds a separate default native input directory when its include list is nonempty.
|
|
251
|
+
An explicit low-level output override still selects the exact directory to replace.
|
|
252
|
+
|
|
186
253
|
## Native-module package output
|
|
187
254
|
|
|
188
255
|
The public `packageApp` operation accepts `moduleFormat:'native'`. Omission, or
|
|
@@ -191,6 +258,9 @@ The public `packageApp` operation accepts `moduleFormat:'native'`. Omission, or
|
|
|
191
258
|
accepts that same override. Configuration, source layout, app identity, storage
|
|
192
259
|
scope and previously generated sibling outputs remain unchanged.
|
|
193
260
|
|
|
261
|
+
This module format does not select a native target. Use the separate `target`
|
|
262
|
+
option for [native-only resources](#native-only-application-resources).
|
|
263
|
+
|
|
194
264
|
The native transformation runs in the selected package stage after application
|
|
195
265
|
adapter work, before the final inventory and any enabled PWA artifacts. It uses
|
|
196
266
|
the existing selected document/runtime records and shared lexical/HTML owners.
|
|
@@ -381,10 +451,11 @@ layouts; the default nested scaffold continues to use its development dependency
|
|
|
381
451
|
## Installed SDK runtime materialization
|
|
382
452
|
|
|
383
453
|
`materializeInstalledSdkRuntime()` is the Node entrypoint for refreshing one
|
|
384
|
-
external workspace's checked-in `arcane/` projection from its one
|
|
385
|
-
installed SDK
|
|
454
|
+
external workspace's checked-in `arcane/` projection from its one declared and
|
|
455
|
+
installed SDK dependency. Import the function through the dependency key that
|
|
386
456
|
the workspace actually declares: `arcane-os` for the canonical package name or,
|
|
387
|
-
for example, `arcane-sdk` for the
|
|
457
|
+
for example, `arcane-sdk` for the development alias `npm:arcane-os@latest`. The
|
|
458
|
+
lockfile and installed package retain the exact resolved version. No
|
|
388
459
|
application- or Arcane OS-local copier owns this operation.
|
|
389
460
|
|
|
390
461
|
The operation resolves that declaration while holding the shared
|
|
@@ -563,8 +634,8 @@ exactly `dependencyName`, `packageSource`,
|
|
|
563
634
|
`canonicalPackageRoot`, `packageName`, `packageVersion`, `runtimeRoot`,
|
|
564
635
|
and `browserRuntimeRoot`. A
|
|
565
636
|
workspace may use the canonical dependency name or one npm alias such as
|
|
566
|
-
`npm:arcane-os@
|
|
567
|
-
and supplies its actual version. The resolver requires one declaration and a
|
|
637
|
+
`npm:arcane-os@latest`; the installed package manifest identifies `arcane-os`
|
|
638
|
+
and supplies its actual exact version. The resolver requires one declaration and a
|
|
568
639
|
direct physical installation with runtime and browser-runtime directories.
|
|
569
640
|
The application's normal npm declaration and lockfile own version selection.
|
|
570
641
|
|
|
@@ -999,9 +1070,12 @@ reachable.
|
|
|
999
1070
|
|
|
1000
1071
|
### macOS
|
|
1001
1072
|
|
|
1002
|
-
No macOS target, native bridge,
|
|
1003
|
-
by this SDK version. A browser may still run browser-only
|
|
1004
|
-
|
|
1073
|
+
No macOS executable target, native bridge, platform host, artifact, or run
|
|
1074
|
+
contract is exposed by this SDK version. A browser may still run browser-only
|
|
1075
|
+
application code. A separately composed macOS host may use the reusable Node
|
|
1076
|
+
Core runtime, framed stdio transport, host composition, and portable payload,
|
|
1077
|
+
but those SDK primitives do not create a native bridge or executable host and
|
|
1078
|
+
do not by themselves satisfy a native capability.
|
|
1005
1079
|
|
|
1006
1080
|
## Development and remote HTTP transport
|
|
1007
1081
|
|
|
@@ -1083,8 +1157,11 @@ The common contract ends where platform truth must remain different:
|
|
|
1083
1157
|
artifact kind, and some diagnostic/result fields remain platform-specific;
|
|
1084
1158
|
- unsupported platforms fail or return a documented unsupported state; they do
|
|
1085
1159
|
not run an unrelated browser implementation as a substitute;
|
|
1086
|
-
-
|
|
1087
|
-
|
|
1160
|
+
- the portable target defaults to the installed SDK provider and assembles a
|
|
1161
|
+
non-executable payload without an Arcane OS checkout;
|
|
1162
|
+
- executable native targets require their explicit checkout/provider, and the
|
|
1163
|
+
composed host must supply the protocol, version, features, capabilities,
|
|
1164
|
+
methods, and services that its application contract requires;
|
|
1088
1165
|
- that current-build compatibility does not promise that a future SDK will accept
|
|
1089
1166
|
this Core or that this SDK will accept a future Core.
|
|
1090
1167
|
|
package/docs/reference/pwa.md
CHANGED
|
@@ -206,6 +206,23 @@ manifest carries release information. Non-PWA and native packaging use the same
|
|
|
206
206
|
[clean local resource URLs](asset-versioning.md). Native packaging does not
|
|
207
207
|
generate the browser PWA worker, installation manifest or registration bootstrap.
|
|
208
208
|
|
|
209
|
+
## Package without browser PWA output
|
|
210
|
+
|
|
211
|
+
Select `browserPwa:false` for an artifact, such as an application directory
|
|
212
|
+
inside an extension-owned root. The package omits `arcane.webmanifest`,
|
|
213
|
+
`arcane-offline.json`, `arcane-sw.js`, and `arcane-pwa.mjs`. Before native-module
|
|
214
|
+
processing, it removes active SDK-marked `data-arcane-pwa` scripts and manifest
|
|
215
|
+
relationships that resolve to that package's `arcane.webmanifest` from the
|
|
216
|
+
selected application document set.
|
|
217
|
+
|
|
218
|
+
This is a package-output choice, not a source or saved-setting change. It
|
|
219
|
+
preserves unrelated manifest links and link relationships, comments, templates,
|
|
220
|
+
other inactive HTML, unselected documents, and authored PWA configuration. The
|
|
221
|
+
application remains responsible for any extension manifest, permissions,
|
|
222
|
+
background process, toolbar launcher, or other outer host. See the
|
|
223
|
+
[native-module output contract](protocols.md#native-module-package-output) and
|
|
224
|
+
[`packageApp()` options](sdk-api.md#packageapp) for the complete boundary.
|
|
225
|
+
|
|
209
226
|
## Development and hosting
|
|
210
227
|
|
|
211
228
|
Use the ordinary `arcane dev --app <id>` command after editing the selected
|
|
@@ -2252,10 +2252,11 @@ and `read`, filters source metadata before calling
|
|
|
2252
2252
|
### Availability and normalization
|
|
2253
2253
|
|
|
2254
2254
|
**Browser or compatible host with an injected DBOPFS adapter.** The adapter
|
|
2255
|
-
keeps the existing `get`, `set`, `getAllKeys`, and `delete` method names
|
|
2256
|
-
|
|
2257
|
-
|
|
2258
|
-
|
|
2255
|
+
keeps the existing `get`, `set`, `getAllKeys`, and `delete` method names. Node
|
|
2256
|
+
callers import the same class and factory from the public
|
|
2257
|
+
`arcane-os/dbopfs-document-library` subpath and supply a compatible storage
|
|
2258
|
+
adapter. That export supplies no Node filesystem storage implementation.
|
|
2259
|
+
Bootstrap uses a concurrent
|
|
2259
2260
|
generation, commits its manifest last, cleans partial data on failure, and
|
|
2260
2261
|
rejects case-colliding IDs. Search
|
|
2261
2262
|
returns `{failures,matches,total}` so one malformed record remains visible
|
|
@@ -2414,7 +2415,7 @@ const search = new DocumentLexicalSearch([{
|
|
|
2414
2415
|
kind: 'guide',
|
|
2415
2416
|
tags: ['intro']
|
|
2416
2417
|
}]);
|
|
2417
|
-
console.log(search.search('portable'
|
|
2418
|
+
console.log(search.search('portable'));
|
|
2418
2419
|
```
|
|
2419
2420
|
|
|
2420
2421
|
## DocumentNavigation.js
|
|
@@ -55,6 +55,8 @@ runtime layouts.
|
|
|
55
55
|
| `arcane-os/core/runtime` | App-neutral native Core dispatcher and service lifecycle. |
|
|
56
56
|
| `arcane-os/core/stdio` | Framed Node stdio transport with graceful runtime drain. |
|
|
57
57
|
| `arcane-os/core/host` | Node-only reusable Core host lifecycle with explicitly supplied services. |
|
|
58
|
+
| `arcane-os/core/local-ai` | Native llama.cpp and Ollama Core service, model readiness, complete streaming and owned process lifecycle. See [local AI through Core](local-ai.md). |
|
|
59
|
+
| `arcane-os/local-ai` | Official runtime installation and native artifact bundling for selected llama.cpp/Ollama requirements. |
|
|
58
60
|
| `arcane-os/integrated-provider` | Fixed integrated shared-development provider. |
|
|
59
61
|
| `arcane-os/packager` | Low-level browser app packager. |
|
|
60
62
|
| `arcane-os/release-bundle` | Deterministic external release bundles. |
|
|
@@ -83,6 +85,7 @@ runtime layouts.
|
|
|
83
85
|
| `arcane-os/browser-device` | Synchronous mobile or desktop identity hints for application-owned settings. |
|
|
84
86
|
| `arcane-os/pwa` | Nonblocking PWA registration, worker updates, native installation state and a dismissible installation component. |
|
|
85
87
|
| `arcane-os/ai/browser-wasm` | Caller-selected browser-local Wllama inference, complete DBOPFS model storage, streaming, cancellation, and structural tool-call results. |
|
|
88
|
+
| `arcane-os/ai/core-local` | Browser llama.cpp provider through an available Core connection; browser-local Wllama and ONNX remain independently available. |
|
|
86
89
|
| `arcane-os/ai/browser-decisions` | Explicit-load Laya FP16 and Julia-1 FP32 typed decisions through the shared Transformers.js Worker owner. |
|
|
87
90
|
| `arcane-os/ai/tool-text-stream` | Shared selected tool-argument text observer for provider integration. |
|
|
88
91
|
| `arcane-os/ai/twin-cloud` | Stateless chat, System One state/questions and image generation with explicit key/model, complete results and operation-specific retry/cancellation. |
|
|
@@ -362,6 +365,7 @@ The remaining data-only subpaths are eight JSON Schemas and package metadata.
|
|
|
362
365
|
| `createCoreClient()` | function | `arcane-os/core/client` | Core browser client | Browser and native WebView JavaScript hosts |
|
|
363
366
|
| `createCoreFacade()` | function | `arcane-os/core/client` | Core browser client | Browser and native WebView JavaScript hosts |
|
|
364
367
|
| `installCoreClient()` | function | `arcane-os/core/client` | Core browser client | Browser and native WebView JavaScript hosts |
|
|
368
|
+
| `getInstalledCoreClient()` | function | `arcane-os/core/client` | Core browser client | Browser and native WebView JavaScript hosts |
|
|
365
369
|
| `createCoreClassicSource()` | function | `arcane-os/core/classic-source` | Core classic client projection | Node; generated source runs in browser and native WebView renderers |
|
|
366
370
|
| `createCoreRuntime()` | function | `arcane-os/core/runtime` | Native Core runtime | Node on Windows, Linux and macOS native hosts; Android requires host adaptation |
|
|
367
371
|
| `encodeCoreFrame()` | function | `arcane-os/core/stdio` | Native Core stdio transport | Node |
|
|
@@ -807,7 +811,7 @@ descriptor-selected browser document inventory.
|
|
|
807
811
|
### Signature and result
|
|
808
812
|
|
|
809
813
|
```text
|
|
810
|
-
async inspectApp({workspaceRoot, appId, signal}={})
|
|
814
|
+
async inspectApp({workspaceRoot, appId, signal, target, outputDirectory}={})
|
|
811
815
|
```
|
|
812
816
|
|
|
813
817
|
Import it from `arcane-os` or `arcane-os/packager`. The result includes the
|
|
@@ -834,9 +838,18 @@ such as `apps/hello-world/index.html`. The complete `files` inventory uses
|
|
|
834
838
|
package-relative paths and includes the root `index.html`. Shared
|
|
835
839
|
files retain their configured route destinations.
|
|
836
840
|
|
|
837
|
-
`
|
|
838
|
-
|
|
839
|
-
`
|
|
841
|
+
`target` defaults to `'browser'`. A selected nonbrowser target adds the app's
|
|
842
|
+
explicit `nativeResources` to `files`, without adding those native-only paths
|
|
843
|
+
to `browserDocuments`. The optional normalized `nativeResources` record is
|
|
844
|
+
returned when authored. This inspection copies or executes no resources.
|
|
845
|
+
|
|
846
|
+
`output` is the selected workspace-relative final package directory. An explicit
|
|
847
|
+
operation `outputDirectory` wins. Otherwise, a nonbrowser target with a nonempty
|
|
848
|
+
native include list uses `dist/.native/<target>/<app-id>`; the app's saved browser
|
|
849
|
+
destination remains separate. Browser selection, omitted native resources and
|
|
850
|
+
an empty native include list use the app's saved `outputDirectory` or
|
|
851
|
+
`dist/<app-id>`. The SDK appends no app ID to an explicit destination. See
|
|
852
|
+
[native-only application resources](protocols.md#native-only-application-resources).
|
|
840
853
|
|
|
841
854
|
### Availability and normalization
|
|
842
855
|
|
|
@@ -881,9 +894,10 @@ console.log(normalizeRelativePath('apps/example/index.html'));
|
|
|
881
894
|
|
|
882
895
|
### Overview
|
|
883
896
|
|
|
884
|
-
Builds one complete
|
|
885
|
-
API. It does not run tests or checks
|
|
886
|
-
when explicitly requested or when
|
|
897
|
+
Builds one complete selected application release through the low-level packager
|
|
898
|
+
API, with browser selection by default. It does not run tests or checks
|
|
899
|
+
automatically; verification occurs only when explicitly requested or when
|
|
900
|
+
required for this selected release output.
|
|
887
901
|
|
|
888
902
|
### Signature and result
|
|
889
903
|
|
|
@@ -898,6 +912,21 @@ The package preserves the complete selected content, applying the documented
|
|
|
898
912
|
asset-version and enabled browser-PWA transformations to resource references.
|
|
899
913
|
Malformed configuration or descriptors fail while preserving the prior output.
|
|
900
914
|
|
|
915
|
+
`target` defaults to `'browser'`; supported target names are `browser`,
|
|
916
|
+
`portable`, `windows-x64`, `linux-x64`, `linux-arm64` and `android-arm64`.
|
|
917
|
+
A nonbrowser target adds the app's explicit `nativeResources` selection and
|
|
918
|
+
sets the effective `browserPwa` value to `false`. It does not compile or launch
|
|
919
|
+
that platform. Browser calls preserve the existing `browserPwa` default and
|
|
920
|
+
explicit setting. The app adapter's `buildArcanePackage()` context receives
|
|
921
|
+
the actual `target` and effective `browserPwa` alongside its existing fields.
|
|
922
|
+
`copyBase()` retains the browser/shared selection; native-only resources are
|
|
923
|
+
copied afterward, outside browser rewriting and PWA processing.
|
|
924
|
+
|
|
925
|
+
`moduleFormat` controls browser module representation independently of `target`.
|
|
926
|
+
In particular, `moduleFormat:'native'` alone remains a browser package and does
|
|
927
|
+
not add native resources. The complete selection and separate-output rules are
|
|
928
|
+
documented under [native-only application resources](protocols.md#native-only-application-resources).
|
|
929
|
+
|
|
901
930
|
`moduleFormat` defaults to `'import-map'`, preserving the ordinary browser
|
|
902
931
|
package. Select `'native'` to resolve saved document import maps into native
|
|
903
932
|
module URLs in the package stage and emit executable inline scripts as external
|
|
@@ -938,8 +967,8 @@ manifest or an operating-system launcher. Native-mode dry runs report selected
|
|
|
938
967
|
input files; generated script/context files are included in the completed
|
|
939
968
|
package's full returned inventory.
|
|
940
969
|
|
|
941
|
-
|
|
942
|
-
workspace-relative destination. For example, `"ai"` emits directly into
|
|
970
|
+
For browser selection, the app's optional schema-1 `outputDirectory` selects the
|
|
971
|
+
final workspace-relative destination. For example, `"ai"` emits directly into
|
|
943
972
|
`<workspace>/ai`; omission retains `dist/<app-id>`. The selected directory is
|
|
944
973
|
wholly replaced through the existing staged swap, not merged. Changing the
|
|
945
974
|
destination preserves the former output and siblings. Conflicting source,
|
|
@@ -947,6 +976,13 @@ selected input, or required control paths fail before output writes. Source
|
|
|
947
976
|
layout, app identity, OPFS scope, and internal package paths remain unchanged.
|
|
948
977
|
See [app-selected package output](protocols.md#app-selected-package-output).
|
|
949
978
|
|
|
979
|
+
For a nonbrowser target with a nonempty native include list, the default is
|
|
980
|
+
instead `dist/.native/<target>/<app-id>`, preserving a separately emitted browser
|
|
981
|
+
output even when its saved destination is custom. An explicit operation
|
|
982
|
+
`outputDirectory` still wins; choose a dedicated destination because packaging
|
|
983
|
+
replaces that selected directory. Omitted or empty native resources retain the
|
|
984
|
+
existing destination rules.
|
|
985
|
+
|
|
950
986
|
Root app files retain their paths at the output root; explicitly nested apps
|
|
951
987
|
retain their `apps/<id>/` paths. Shared files retain their configured route
|
|
952
988
|
destinations. When the selected content supplies no root `index.html`, the SDK
|
|
@@ -1147,9 +1183,15 @@ console.log(validateAppBundlePath('payload/apps/example/index.html'));
|
|
|
1147
1183
|
|
|
1148
1184
|
Validates one schema-1 packager app configuration and its relationship to the root config.
|
|
1149
1185
|
|
|
1150
|
-
Optional `
|
|
1151
|
-
|
|
1152
|
-
|
|
1186
|
+
Optional `nativeResources` contains a required literal-path `include` array
|
|
1187
|
+
(which may be empty) and optional `exclude` array (default `[]`). It selects
|
|
1188
|
+
additional app-owned resources only for a nonbrowser packaging target. Ordinary
|
|
1189
|
+
`include`, `exclude`, shared routes and document selection remain unchanged.
|
|
1190
|
+
|
|
1191
|
+
Optional `outputDirectory` is the saved workspace-relative browser package
|
|
1192
|
+
directory; omission preserves `dist/<app-id>`. Nonempty native selection uses
|
|
1193
|
+
the separate target-selected default described above. It is an app package
|
|
1194
|
+
field, not a change to the root configuration's `distRoot` or the schema-2 app identity. Packaging
|
|
1153
1195
|
reports conflicting output/input selections with `ARCANE_PACKAGE_INVALID`
|
|
1154
1196
|
before output writes. Authored-descriptor comparison treats the destination
|
|
1155
1197
|
as package-local, and descriptor refresh preserves the existing setting.
|
|
@@ -1216,7 +1258,8 @@ async function usevalidateRootConfig(...arguments_) {
|
|
|
1216
1258
|
|
|
1217
1259
|
### Overview
|
|
1218
1260
|
|
|
1219
|
-
|
|
1261
|
+
Reads one existing application release and compares its complete file inventory
|
|
1262
|
+
with its release manifest through the low-level packager API.
|
|
1220
1263
|
|
|
1221
1264
|
### Signature and result
|
|
1222
1265
|
|
|
@@ -1228,6 +1271,9 @@ Import it from `arcane-os` or `arcane-os/packager`. The signature above states w
|
|
|
1228
1271
|
|
|
1229
1272
|
Optional `outputDirectory` selects the same workspace-relative override accepted
|
|
1230
1273
|
by `packageApp`, without changing the app's saved destination.
|
|
1274
|
+
For a target-selected native input release, pass the returned `release.output`
|
|
1275
|
+
as this override. `verifyApp` has no target option and does not infer the native
|
|
1276
|
+
directory or execute the application, its services or a platform host.
|
|
1231
1277
|
|
|
1232
1278
|
### Availability and normalization
|
|
1233
1279
|
|
|
@@ -1238,9 +1284,13 @@ by `packageApp`, without changing the app's saved destination.
|
|
|
1238
1284
|
```javascript
|
|
1239
1285
|
import {verifyApp} from 'arcane-os';
|
|
1240
1286
|
|
|
1241
|
-
|
|
1242
|
-
|
|
1243
|
-
|
|
1287
|
+
// release is the result of packageApp() for this app and workspace.
|
|
1288
|
+
const inspected = await verifyApp({
|
|
1289
|
+
workspaceRoot,
|
|
1290
|
+
appId: 'moon-dashboard',
|
|
1291
|
+
outputDirectory: release.output
|
|
1292
|
+
});
|
|
1293
|
+
console.log(inspected.files);
|
|
1244
1294
|
```
|
|
1245
1295
|
|
|
1246
1296
|
## verifyAppReleaseBundle()
|
|
@@ -2210,6 +2260,13 @@ omitted and an authored empty list stays `[]`, so projection preserves automatic
|
|
|
2210
2260
|
discovery versus entry-only selection. See
|
|
2211
2261
|
[application document selection](protocols.md#application-document-selection).
|
|
2212
2262
|
|
|
2263
|
+
Optional `package.nativeResources` becomes top-level `nativeResources`.
|
|
2264
|
+
Omission remains omitted, an empty include remains `[]`, and an omitted exclude
|
|
2265
|
+
becomes `[]`. Package-only descriptor synthesis preserves the same selection.
|
|
2266
|
+
This is a packaging contract; `projectNativeDescriptor()` keeps its existing
|
|
2267
|
+
registry shape and ordinary include list. See
|
|
2268
|
+
[native-only application resources](protocols.md#native-only-application-resources).
|
|
2269
|
+
|
|
2213
2270
|
### Signature and result
|
|
2214
2271
|
|
|
2215
2272
|
```text
|
|
@@ -4336,7 +4393,17 @@ console.log(validation.sdkInstallation?.packageVersion);
|
|
|
4336
4393
|
|
|
4337
4394
|
### Overview
|
|
4338
4395
|
|
|
4339
|
-
Builds
|
|
4396
|
+
Builds one explicitly selected target through its adapter. A paired native
|
|
4397
|
+
builder packages the selected app and its explicit bundled-app closure, then
|
|
4398
|
+
passes those complete releases to the provider. Provider verification and host
|
|
4399
|
+
launch remain separate operations.
|
|
4400
|
+
|
|
4401
|
+
The selected target reaches each app's packager, so every app's own
|
|
4402
|
+
`nativeResources` and separate native input directory apply consistently to
|
|
4403
|
+
both copying and output-overlap calculations. The provider receives the actual
|
|
4404
|
+
release roots, manifests and complete file readers. An explicit `nativeBuilder`
|
|
4405
|
+
retains its existing identity and contract. See
|
|
4406
|
+
[portable Core packaging](core-native-packaging.md#native-only-application-resources).
|
|
4340
4407
|
|
|
4341
4408
|
### Signature and result
|
|
4342
4409
|
|
|
@@ -4632,8 +4699,10 @@ described by `packageApp()`.
|
|
|
4632
4699
|
The same low-level operation resolves the app's optional `outputDirectory`;
|
|
4633
4700
|
there is no separate high-level destination override. `release.outputRoot`
|
|
4634
4701
|
names the resulting complete release directory, with omitted configuration
|
|
4635
|
-
retaining `dist/<app-id>`. Browser preview
|
|
4636
|
-
|
|
4702
|
+
retaining `dist/<app-id>`. Browser preview and bundle creation use that selected
|
|
4703
|
+
root. This ordinary package operation retains browser selection; paired native
|
|
4704
|
+
assembly through `buildApplication()` separately passes its actual target and
|
|
4705
|
+
applies each app's native-resource output selection.
|
|
4637
4706
|
|
|
4638
4707
|
Packaging does not automatically run tests or checks. Verification occurs only
|
|
4639
4708
|
when explicitly requested or when required for the selected release output.
|
|
@@ -6505,8 +6574,8 @@ console.log(CORE_READY_EVENTS.includes('core.ready')); // true
|
|
|
6505
6574
|
### Overview
|
|
6506
6575
|
|
|
6507
6576
|
Describes the public fields for request, response, event, single-request
|
|
6508
|
-
cancellation
|
|
6509
|
-
not application validation or method admission.
|
|
6577
|
+
cancellation, all-request cancellation and `runtime.replay` control frames.
|
|
6578
|
+
These are wire descriptions, not application validation or method admission.
|
|
6510
6579
|
|
|
6511
6580
|
### Value and import
|
|
6512
6581
|
|
|
@@ -6640,11 +6709,11 @@ the client.
|
|
|
6640
6709
|
### Signature and result
|
|
6641
6710
|
|
|
6642
6711
|
```text
|
|
6643
|
-
createCoreClient({global=globalThis, transport=null, eventOwner=arcaneEvents, eventOwnerReady, autoConnect=true, onError}={})
|
|
6712
|
+
createCoreClient({global=globalThis, transport=null, eventOwner=arcaneEvents, eventOwnerReady, autoConnect=true, replayRuntimeState=false, onError}={})
|
|
6644
6713
|
```
|
|
6645
6714
|
|
|
6646
6715
|
Import it from `arcane-os/core/client`. The result exposes `invoke`, `receive`,
|
|
6647
|
-
`connect`, `close`, `cancelAll`, `events`, `eventsReady`, `runtime.current()`,
|
|
6716
|
+
`connect`, `close`, `failTransport`, `cancelAll`, `events`, `eventsReady`, `runtime.current()`,
|
|
6648
6717
|
`uuid`, `protocol` and `Error`. A supplied transport must provide callable
|
|
6649
6718
|
`send(frame)`; an invalid transport stays disconnected and reports
|
|
6650
6719
|
`ARCANE_TRANSPORT_INVALID`. Optional `subscribe(receive)` may return its cleanup
|
|
@@ -6656,6 +6725,21 @@ its still-pending request; a failure arriving after response, cancellation or
|
|
|
6656
6725
|
timeout reaches `onError`. Deferred event-owner connection preserves the FIFO
|
|
6657
6726
|
order of queued frames and subscription actions, including reentrant delivery.
|
|
6658
6727
|
|
|
6728
|
+
`replayRuntimeState:true` sends one observed `runtime.replay` control after the
|
|
6729
|
+
receive listener and `transport.ready` are established, without delaying page
|
|
6730
|
+
startup. The default is `false`; select replay only with a supporting host.
|
|
6731
|
+
Repeated connection calls do not repeat that control, and send failures reach
|
|
6732
|
+
`onError`. The host replays actual dispatcher and service state without
|
|
6733
|
+
restarting services; transport, Core and service readiness remain distinct.
|
|
6734
|
+
|
|
6735
|
+
`failTransport(error)` ends the client after an actual terminal transport
|
|
6736
|
+
failure. Pending RPCs and WebKit acknowledgements reject with the complete
|
|
6737
|
+
`CoreError`, future invocations reject with that failure, and `onError` observes
|
|
6738
|
+
it once. The client releases its owned listeners, callbacks and timers without
|
|
6739
|
+
sending cancellation frames to the failed transport. The first terminal failure
|
|
6740
|
+
returns `true`; an already closed client returns `false`. Ordinary `close()`
|
|
6741
|
+
retains its separate cancellation behavior.
|
|
6742
|
+
|
|
6659
6743
|
### Availability and normalization
|
|
6660
6744
|
|
|
6661
6745
|
**Browser and native WebView JavaScript hosts.** Built-in transports select
|
|
@@ -6729,8 +6813,8 @@ client.close();
|
|
|
6729
6813
|
### Overview
|
|
6730
6814
|
|
|
6731
6815
|
Installs one synchronous `globalThis.Arcane` facade and native
|
|
6732
|
-
`__arcaneReceive`
|
|
6733
|
-
that global lifetime.
|
|
6816
|
+
`__arcaneReceive` and `__arcaneTransportFailed` callbacks. Repeated installation
|
|
6817
|
+
returns the same client for that global lifetime.
|
|
6734
6818
|
|
|
6735
6819
|
### Signature and result
|
|
6736
6820
|
|
|
@@ -6742,6 +6826,12 @@ Import it from `arcane-os/core/client`. The returned client is the same contract
|
|
|
6742
6826
|
as `createCoreClient()`. Closing it releases subscriptions, native callbacks,
|
|
6743
6827
|
timers and pending renderer requests; it does not kill Core.
|
|
6744
6828
|
|
|
6829
|
+
`__arcaneTransportFailed(error)` delegates actual terminal host failures to
|
|
6830
|
+
`client.failTransport(error)`. Closing or failing restores previous facade and
|
|
6831
|
+
callback globals only while the installation still owns them, preserving later
|
|
6832
|
+
replacements. `getInstalledCoreClient()` returns `null` after release, including
|
|
6833
|
+
before an installed terminal failure reaches `onError`.
|
|
6834
|
+
|
|
6745
6835
|
### Availability and normalization
|
|
6746
6836
|
|
|
6747
6837
|
**Browser and native WebView JavaScript hosts.** Installation makes synchronous
|
|
@@ -6761,6 +6851,41 @@ try {
|
|
|
6761
6851
|
}
|
|
6762
6852
|
```
|
|
6763
6853
|
|
|
6854
|
+
## getInstalledCoreClient()
|
|
6855
|
+
|
|
6856
|
+
### Overview
|
|
6857
|
+
|
|
6858
|
+
Reads the existing live SDK-installed client without installing, connecting or
|
|
6859
|
+
replacing a facade. Applications use this accessor instead of private fields.
|
|
6860
|
+
|
|
6861
|
+
### Signature and result
|
|
6862
|
+
|
|
6863
|
+
```text
|
|
6864
|
+
getInstalledCoreClient(global=globalThis)
|
|
6865
|
+
```
|
|
6866
|
+
|
|
6867
|
+
Import it from `arcane-os/core/client`. It returns the exact client installed in
|
|
6868
|
+
the selected global, including a classic document-created installation, or
|
|
6869
|
+
`null` when no live SDK installation exists. A foreign `Arcane` facade does not
|
|
6870
|
+
constitute an SDK installation. Close and terminal failure release the
|
|
6871
|
+
installation before subsequent reads.
|
|
6872
|
+
|
|
6873
|
+
### Availability and normalization
|
|
6874
|
+
|
|
6875
|
+
**Browser and native WebView JavaScript hosts.** This synchronous read changes
|
|
6876
|
+
no globals and starts no service, transport or model. The returned client's
|
|
6877
|
+
`runtime.current()` describes transport state; service readiness remains with
|
|
6878
|
+
its authoritative owner. See [Core browser client](core-client.md).
|
|
6879
|
+
|
|
6880
|
+
### Example
|
|
6881
|
+
|
|
6882
|
+
```javascript
|
|
6883
|
+
import {getInstalledCoreClient} from 'arcane-os/core/client';
|
|
6884
|
+
|
|
6885
|
+
const client = getInstalledCoreClient();
|
|
6886
|
+
console.log(client ? client.runtime.current() : 'No SDK client is installed.');
|
|
6887
|
+
```
|
|
6888
|
+
|
|
6764
6889
|
## createCoreClassicSource()
|
|
6765
6890
|
|
|
6766
6891
|
### Overview
|
|
@@ -6771,13 +6896,17 @@ client and contracts. It creates no copied client implementation or bundler.
|
|
|
6771
6896
|
### Signature and result
|
|
6772
6897
|
|
|
6773
6898
|
```text
|
|
6774
|
-
async createCoreClassicSource({eventOwnerModuleURL}={})
|
|
6899
|
+
async createCoreClassicSource({eventOwnerModuleURL,replayRuntimeState=false}={})
|
|
6775
6900
|
```
|
|
6776
6901
|
|
|
6777
6902
|
Import it from `arcane-os/core/classic-source`. Supply the actual served URL for
|
|
6778
6903
|
the selected SDK event-manager module. The promise resolves to the complete
|
|
6779
6904
|
classic-script source.
|
|
6780
6905
|
|
|
6906
|
+
Optional `replayRuntimeState:true` forwards the current runtime-replay selection
|
|
6907
|
+
to the installed client. Omission retains the existing no-replay behavior; use
|
|
6908
|
+
`true` only when the composing host supports `runtime.replay`.
|
|
6909
|
+
|
|
6781
6910
|
### Availability and normalization
|
|
6782
6911
|
|
|
6783
6912
|
**Node; generated source runs in browser and native WebView renderers.** The
|
|
@@ -6821,6 +6950,11 @@ Shutdown stops admission, waits accepted responses, then runs each service's
|
|
|
6821
6950
|
startup, drain and dispose in order while independent services close
|
|
6822
6951
|
concurrently.
|
|
6823
6952
|
|
|
6953
|
+
The `runtime.replay` control publishes current dispatcher and service state
|
|
6954
|
+
without restarting services. Its snapshot preserves complete service errors
|
|
6955
|
+
and active request state; see [runtime replay](core-runtime.md#state-and-frames)
|
|
6956
|
+
for authoritative readiness and reentrant lifecycle ordering.
|
|
6957
|
+
|
|
6824
6958
|
### Availability and normalization
|
|
6825
6959
|
|
|
6826
6960
|
**Node on Windows, Linux and macOS native hosts; Android requires its native host
|
|
@@ -9419,3 +9553,8 @@ const cancelled = normalizeAIRequestAbort(new DOMException('Cancelled', 'AbortEr
|
|
|
9419
9553
|
## Data export subpaths
|
|
9420
9554
|
|
|
9421
9555
|
The package also exposes eight JSON Schemas (including `arcane-os/schemas/event-stack.json`) and its package manifest. These are data contracts, not callable JavaScript members. See [schema contracts](../architecture.md) and the files under `schemas/`.
|
|
9556
|
+
|
|
9557
|
+
`arcane-os/schemas/arcane-app.json` describes schema-2 `package.nativeResources`;
|
|
9558
|
+
`arcane-os/schemas/arcane-package.json` describes the projected schema-1
|
|
9559
|
+
`nativeResources`. Both use the existing literal application-relative path
|
|
9560
|
+
contract. See [native-only application resources](protocols.md#native-only-application-resources).
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "arcane-os",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.57.0",
|
|
4
4
|
"description": "Arcane OS JavaScript SDK, project-local CLI, browser runtime, and repository-portable application packager.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./src/index.mjs",
|
|
@@ -39,6 +39,7 @@
|
|
|
39
39
|
"./speech-playback": "./runtime/arcane/modules/SpeechPlayback.js",
|
|
40
40
|
"./speech-text": "./browser-runtime/speech-text.mjs",
|
|
41
41
|
"./ai/browser-wasm": "./browser-runtime/ai/browser-wasm.mjs",
|
|
42
|
+
"./ai/core-local": "./browser-runtime/ai/core-local.mjs",
|
|
42
43
|
"./ai/browser-decisions": "./browser-runtime/ai/browser-decisions.mjs",
|
|
43
44
|
"./ai/tool-text-stream": "./browser-runtime/ai/tool-text-stream.mjs",
|
|
44
45
|
"./ai/twin-cloud": "./browser-runtime/ai/twin-cloud.mjs",
|
|
@@ -49,12 +50,15 @@
|
|
|
49
50
|
"./native": "./src/native-plan.mjs",
|
|
50
51
|
"./native-provider": "./src/native-provider-loader.mjs",
|
|
51
52
|
"./native/portable-provider": "./src/native/portable-provider.mjs",
|
|
53
|
+
"./native/windows-provider": "./src/native/windows-provider.mjs",
|
|
52
54
|
"./core/client": "./browser-runtime/core/client.mjs",
|
|
53
55
|
"./core/contracts": "./browser-runtime/core/contracts.mjs",
|
|
54
56
|
"./core/classic-source": "./src/core-classic-source.mjs",
|
|
55
57
|
"./core/runtime": "./src/core/runtime.mjs",
|
|
56
58
|
"./core/stdio": "./src/core/stdio.mjs",
|
|
57
59
|
"./core/host": "./src/core/host.mjs",
|
|
60
|
+
"./core/local-ai": "./src/core/services/local-ai.mjs",
|
|
61
|
+
"./local-ai": "./src/local-ai/install.mjs",
|
|
58
62
|
"./integrated-provider": "./src/integrated-provider-loader.mjs",
|
|
59
63
|
"./packager": "./src/packager/core.mjs",
|
|
60
64
|
"./release-bundle": "./src/release-bundle.mjs",
|
|
@@ -555,7 +555,9 @@ async function probeRequiredServices({
|
|
|
555
555
|
arcane,
|
|
556
556
|
requirements.llm.model
|
|
557
557
|
)
|
|
558
|
-
:
|
|
558
|
+
:is.function(arcane?.localAI?.status)
|
|
559
|
+
?probeNativeOllama(arcane,requirements.llm.model)
|
|
560
|
+
:unavailableBrowserOllama()
|
|
559
561
|
:null,
|
|
560
562
|
requiresSpeech
|
|
561
563
|
?mode==='native'
|