arcane-os 0.1.0-dev.5 → 0.1.1
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/NOTICE +10 -0
- package/browser-runtime/ARCANE_SDK_BROWSER_RELEASE.json +162 -0
- package/browser-runtime/ai/ARCANE_AI_BROWSER_WASM_COMPONENTS.json +69 -0
- package/browser-runtime/ai/browser-wasm-llm-provider.mjs +1151 -0
- package/browser-runtime/ai/browser-wasm.mjs +44 -0
- package/browser-runtime/ai/browser-wllama-runtime.mjs +390 -0
- package/browser-runtime/ai/internal/sha256.mjs +166 -0
- package/browser-runtime/ai/model-controller.mjs +581 -0
- package/browser-runtime/ai/wllama/LICENCE +21 -0
- package/browser-runtime/ai/wllama/index.mjs +3494 -0
- package/browser-runtime/ai/wllama/llama.cpp-LICENSE +21 -0
- package/browser-runtime/ai/wllama/wllama.wasm +0 -0
- package/browser-runtime/dependencies/event-pubsub/index.js +141 -0
- package/browser-runtime/dependencies/event-pubsub/licence +21 -0
- package/browser-runtime/dependencies/event-pubsub/package.json +59 -0
- package/browser-runtime/dependencies/strong-type/index.js +1151 -0
- package/browser-runtime/dependencies/strong-type/licence +21 -0
- package/browser-runtime/dependencies/strong-type/package.json +61 -0
- package/browser-runtime/dom-event-instrumentation.mjs +594 -0
- package/browser-runtime/event-manager.mjs +1342 -0
- package/docs/publishing.md +65 -67
- package/docs/reference/README.md +2 -1
- package/docs/reference/cli.md +86 -3
- package/docs/reference/event-manager.md +20 -11
- package/docs/reference/inventory/package-api.json +1 -1
- package/docs/reference/protocols.md +112 -14
- package/docs/reference/sdk-api.md +40 -11
- package/docs/work-amplification.md +4 -3
- package/package.json +15 -8
- package/runtime/ARCANE_RUNTIME_RELEASE.json +1 -1
- package/schemas/arcane-lock.schema.json +97 -1
- package/src/cli/main.mjs +5 -0
- package/src/dev-server.mjs +78 -34
- package/src/doctor.mjs +77 -3
- package/src/import-map.mjs +2352 -0
- package/src/packager/core.mjs +607 -29
- package/src/scaffold.mjs +122 -5
- package/src/sdk-browser-runtime.mjs +702 -0
- package/src/targets/index.mjs +31 -4
- package/src/templates/workspace-template.mjs +141 -23
- package/src/toolchain.mjs +288 -55
- package/src/workspace-operation-lock.mjs +716 -0
- package/src/workspace-runtime.mjs +841 -0
- package/src/workspace.mjs +292 -37
package/docs/publishing.md
CHANGED
|
@@ -1,42 +1,37 @@
|
|
|
1
|
-
#
|
|
2
|
-
|
|
3
|
-
##
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
`
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
into a
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
artifact by immutable artifact id. They never repack it. Each runner verifies
|
|
36
|
-
the receipt, installs the tarball into a disposable project, exercises
|
|
37
|
-
`npm exec --offline -- arcane`, and runs a test imported from
|
|
38
|
-
`arcane-os/testing` through the installed package's `arcane-test.mjs`. A final
|
|
39
|
-
readiness job fails unless the producer and the complete native matrix pass.
|
|
1
|
+
# npm publication
|
|
2
|
+
|
|
3
|
+
## Canonical main and npm channels
|
|
4
|
+
|
|
5
|
+
`main` is the single canonical working and publication branch before and after
|
|
6
|
+
the first release. Do not create a development branch. `-dev` versions select
|
|
7
|
+
the npm `dev` dist-tag, while bare numeric stable versions select
|
|
8
|
+
`latest`. These are registry channels, not Git branches.
|
|
9
|
+
|
|
10
|
+
## Stable and development npm publication
|
|
11
|
+
|
|
12
|
+
The package version and `publishConfig.tag` must agree exactly: `-dev` uses
|
|
13
|
+
`dev`, and a bare numeric stable version uses `latest`. npm is the canonical
|
|
14
|
+
SDK distribution: application repositories add an exact `arcane-os` project
|
|
15
|
+
dependency and invoke its local CLI with `npm exec -- arcane`. A separate
|
|
16
|
+
global installer, standalone SDK executable, NuGet package, Homebrew formula,
|
|
17
|
+
or OS package is not part of this release surface.
|
|
18
|
+
|
|
19
|
+
`Check` validates only package-publication authority once: package metadata,
|
|
20
|
+
the executable and `.gitattributes` boundary, both authenticated runtime
|
|
21
|
+
receipts, and the focused npm identity/channel/provenance contract. One
|
|
22
|
+
unprivileged producer then packs one `.tgz` under pinned Node and npm versions.
|
|
23
|
+
The producer writes a canonical manifest containing the source SHA,
|
|
24
|
+
clean-checkout flag, package inventory, byte length, SHA-256, npm SHA-1 shasum,
|
|
25
|
+
and SHA-512 integrity. One Ubuntu x64 consumer at the declared Node `22.23.2`
|
|
26
|
+
floor downloads that Actions artifact by immutable artifact id, verifies the
|
|
27
|
+
receipt, installs the tarball into a disposable project, exercises
|
|
28
|
+
`npm exec --offline -- arcane`, and runs one small capability contract through
|
|
29
|
+
the installed package's `arcane-test.mjs`. It never repacks. A final readiness
|
|
30
|
+
job verifies the same artifact's identity, integrity, shasum, license inventory,
|
|
31
|
+
and content boundary once. Golden snapshots, broad integration/regression and
|
|
32
|
+
platform matrices, browser/process simulations, Pages, Examples, and
|
|
33
|
+
presentation work are normal or post-registry checks rather than npm
|
|
34
|
+
publication gates.
|
|
40
35
|
|
|
41
36
|
`publish-dev.yml` can run only when manually dispatched from `main` in
|
|
42
37
|
`TheWizardNexus/arcane-os-sdk`. Dispatch requires an authorized npm content
|
|
@@ -49,14 +44,19 @@ promotion. Direct trusted publishing is not permitted for that class.
|
|
|
49
44
|
|
|
50
45
|
For the standard path, the workflow authenticates a successful `Check` push
|
|
51
46
|
run for that exact `main` SHA, downloads its immutable package artifact,
|
|
52
|
-
reverifies the manifest and bytes,
|
|
47
|
+
reverifies the manifest and bytes, derives `dev` or `latest` from the strict
|
|
48
|
+
version, and publishes the downloaded `.tgz`. It
|
|
53
49
|
never invokes `npm pack` or `npm publish .` under publication authority. A
|
|
54
50
|
repository-wide concurrency group prevents simultaneous publication jobs;
|
|
55
51
|
GitHub may replace an older pending dispatch, and each surviving dispatch is
|
|
56
|
-
safe to rerun. Preflight rejects byte mismatches,
|
|
57
|
-
dist-tag other than `dev
|
|
58
|
-
idempotent success.
|
|
59
|
-
|
|
52
|
+
safe to rerun. Preflight rejects byte mismatches, tag rollback, malformed
|
|
53
|
+
registry state, or any dist-tag other than `dev` and `latest`; an
|
|
54
|
+
already-published matching version is an idempotent success. The historical
|
|
55
|
+
first-version state where both tags identify `0.1.0-dev.5` is accepted only
|
|
56
|
+
with its recorded integrity and shasum and only while no stable version exists.
|
|
57
|
+
Post-publication verification preserves the other channel, checks integrity
|
|
58
|
+
and shasum, and validates trusted-publisher provenance. It tolerates npm's
|
|
59
|
+
publish-time scanning for up to 15 minutes. If
|
|
60
60
|
scanning or manual review remains pending, the workflow reports that state and
|
|
61
61
|
a rerun safely resumes verification without republishing immutable bytes.
|
|
62
62
|
|
|
@@ -73,10 +73,11 @@ integrity. Arcane separately requires the installed package to identify exactly
|
|
|
73
73
|
as `arcane-os@0.1.0-dev.5` and verifies the locked runtime. A local directory
|
|
74
74
|
`file:` install is intentionally unsupported because it may be linked.
|
|
75
75
|
|
|
76
|
-
|
|
76
|
+
The first-version bootstrap established these permanent audit boundaries:
|
|
77
77
|
|
|
78
|
-
1. Push the intended clean `main` commit and require the
|
|
79
|
-
|
|
78
|
+
1. Push the intended clean `main` commit and require the npm-critical Check
|
|
79
|
+
workflow—package authority, one producer, one installed Linux capability
|
|
80
|
+
smoke, and one identity/legal verifier—to pass.
|
|
80
81
|
2. Review the uploaded tarball inventory, manifest, checksum, and license
|
|
81
82
|
notices. Ensure the Arcane OS monorepo package is private so it cannot publish
|
|
82
83
|
the same npm name accidentally.
|
|
@@ -93,12 +94,10 @@ Before the first development publish, or while the registry package is absent:
|
|
|
93
94
|
tarball. Do not rebuild or repack it for this bootstrap. After the package
|
|
94
95
|
exists, standard releases may publish directly through OIDC, while dual-use
|
|
95
96
|
releases must use `npm stage publish` and human 2FA promotion.
|
|
96
|
-
5.
|
|
97
|
-
`
|
|
98
|
-
the
|
|
99
|
-
|
|
100
|
-
For a dual-use classification, grant stage-only trust instead of direct
|
|
101
|
-
publish authority.
|
|
97
|
+
5. Verify the registry's `dist.integrity` and shasum. npm's required bootstrap
|
|
98
|
+
state has both `dev` and `latest` at the immutable `0.1.0-dev.5` bytes
|
|
99
|
+
until the first stable publish moves only `latest`. The sole trusted
|
|
100
|
+
publisher is the exact `publish-dev.yml` workflow and `npm` environment.
|
|
102
101
|
6. Later standard development versions may use the workflow's direct OIDC
|
|
103
102
|
authority. A dual-use version must be staged and promoted with human 2FA.
|
|
104
103
|
Any missing policy decision, package bootstrap, environment, publisher
|
|
@@ -170,12 +169,12 @@ internal checksums alone do not grant authority.
|
|
|
170
169
|
Stable versioning, the npm `latest` tag, and an official GitHub release remain a
|
|
171
170
|
separate explicit release decision. Current `main` development does not
|
|
172
171
|
silently convert a `-dev` package into an official release. A stable release
|
|
173
|
-
must publish the same
|
|
172
|
+
must publish the same source-validated and platform-smoked `.tgz` under
|
|
173
|
+
`latest`; only after registry
|
|
174
174
|
integrity matches may GitHub attach that `.tgz`, manifest, and checksum. Its Git
|
|
175
175
|
tag and GitHub release title must both be the same bare numeric
|
|
176
|
-
`MAJOR.MINOR.PATCH`.
|
|
177
|
-
|
|
178
|
-
misleading numeric GitHub release.
|
|
176
|
+
`MAJOR.MINOR.PATCH`. Prerelease versions do not get a misleading numeric
|
|
177
|
+
GitHub release, and no release creates a Git branch for an npm dist-tag.
|
|
179
178
|
|
|
180
179
|
## Documentation publication
|
|
181
180
|
|
|
@@ -188,16 +187,15 @@ It does not rerun the SDK test suite or execute repository build code.
|
|
|
188
187
|
|
|
189
188
|
The deployment job holds only the read, Pages, and OIDC permissions required by
|
|
190
189
|
that single checked artifact. The `github-pages` environment remains the final
|
|
191
|
-
deployment authority.
|
|
192
|
-
|
|
190
|
+
deployment authority. Documentation channels are post-registry presentation
|
|
191
|
+
work and do not change the canonical source branch.
|
|
193
192
|
|
|
194
193
|
## Work-amplification record
|
|
195
194
|
|
|
196
|
-
The
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
site placement.
|
|
195
|
+
The release graph is one checked `main` SHA and one npm release candidate. One
|
|
196
|
+
package-authority job runs the narrow source policy and publication contract;
|
|
197
|
+
one producer creates the tarball; one Ubuntu consumer executes those exact
|
|
198
|
+
installed bytes; and one readiness job verifies identity and legal inventory.
|
|
199
|
+
OIDC publication reuses that successful exact-SHA artifact without rebuilding.
|
|
200
|
+
Platform matrices, full product regressions, Pages, and broader presentation
|
|
201
|
+
work remain outside registry publication and run separately when warranted.
|
package/docs/reference/README.md
CHANGED
|
@@ -19,6 +19,7 @@ high-level page links to the relevant deep section instead of repeating it.
|
|
|
19
19
|
| Use the Node.js package API | [SDK JavaScript API](sdk-api.md) |
|
|
20
20
|
| Publish central events, capture bounded time-travel history, or observe the DOM | [EventManager and event-stack reference](event-manager.md) |
|
|
21
21
|
| Use the `arcane` command | [CLI reference](cli.md) |
|
|
22
|
+
| Generate named browser imports or inspect the authenticated physical runtime | [`arcane import-map`](cli.md#arcane-import-map) and [browser runtime delivery](protocols.md#browser-runtime-delivery) |
|
|
22
23
|
| Choose browser, native, cloud, or cross-host behavior | [Availability and normalization](availability-and-normalization.md) |
|
|
23
24
|
| Import a shipped renderer module | [Runtime module catalog](runtime-modules.md) |
|
|
24
25
|
| Use a shared entity | [Runtime entity modules](runtime-entities.md) and [exact export contracts](core/arcane-entities.md) |
|
|
@@ -36,7 +37,7 @@ This repository contains two related, explicitly versioned surfaces:
|
|
|
36
37
|
|
|
37
38
|
| Surface | Source identity | Meaning |
|
|
38
39
|
| --- | --- | --- |
|
|
39
|
-
| SDK and CLI | `arcane-os` `0.1.0
|
|
40
|
+
| SDK and CLI | `arcane-os` `0.1.0` | The Node.js toolchain and package exports in this checkout. |
|
|
40
41
|
| Browser runtime | Arcane OS commit `567ad110bf57a1c2d4a3daa22ae93716cc5f4d7e`, bundle `0.8.12`, protocol `arcane/1` | The exact 155-file runtime snapshot shipped under `runtime/`. |
|
|
41
42
|
| Core reference snapshot | Arcane OS commit `567ad110bf57a1c2d4a3daa22ae93716cc5f4d7e`, protocol `arcane/1` | The application-facing Core contract derived into `docs/reference/core/`. Canonical inventory and focused-member content was verified unchanged at Arcane OS `main` commit `13f3ce0ae34f77a3495331c8b4c30b1bb105f8ed`; SDK-local provenance, link, and package-boundary annotations are added explicitly. |
|
|
42
43
|
|
package/docs/reference/cli.md
CHANGED
|
@@ -16,6 +16,7 @@ and exits nonzero on failure. Machine output is defined by
|
|
|
16
16
|
| `arcane new <id>` | Creates one external app workspace. |
|
|
17
17
|
| `arcane init [id]` | Initializes one app in an external or integrated workspace without rewriting unrelated files. |
|
|
18
18
|
| `arcane doctor` | Reads and reports Node/tooling, SDK runtime, workspace, optional Arcane source recognition, and supported managed ArcaneOllama readiness. |
|
|
19
|
+
| `arcane import-map` | Authenticates and refreshes one app's managed browser import map and matching HTML entry. |
|
|
19
20
|
| `arcane dev` | Starts one owned browser development server for one selected app. |
|
|
20
21
|
| `arcane test` | Runs one app test boundary or one explicit integrated shared test file. |
|
|
21
22
|
| `arcane check` | Validates one app boundary or the canonical integrated shared check. |
|
|
@@ -162,6 +163,88 @@ failure into a failed doctor result.
|
|
|
162
163
|
npm exec -- arcane doctor --workspace . --arcane-root "../Arcane OS"
|
|
163
164
|
```
|
|
164
165
|
|
|
166
|
+
## `arcane import-map`
|
|
167
|
+
|
|
168
|
+
### Overview
|
|
169
|
+
|
|
170
|
+
Authenticates one selected application's physical browser runtime, generates
|
|
171
|
+
its standard browser import map, and commits the map artifact and matching
|
|
172
|
+
managed HTML entry as one bounded refresh.
|
|
173
|
+
|
|
174
|
+
```text
|
|
175
|
+
arcane import-map [--workspace <directory>] [--app <id>]
|
|
176
|
+
```
|
|
177
|
+
|
|
178
|
+
`--workspace` defaults to the current directory. `--app` selects one app when
|
|
179
|
+
the workspace does not already identify exactly one. The command accepts no
|
|
180
|
+
positional arguments and supports app scope only. `arcane-os import-map` is the
|
|
181
|
+
identical executable alias.
|
|
182
|
+
|
|
183
|
+
The generated artifact is
|
|
184
|
+
`apps/<id>/modules/arcane.importmap.json`. Its exact JSON is also installed in
|
|
185
|
+
the app entry as `<script type="importmap" data-arcane-import-map>` before
|
|
186
|
+
module loading. In SDK `0.1.0`, the authenticated physical-v1 runtime produces
|
|
187
|
+
85 entries and intentionally has no package-root mapping.
|
|
188
|
+
|
|
189
|
+
### Result and safety
|
|
190
|
+
|
|
191
|
+
Success returns the normal selected-workspace wrapper:
|
|
192
|
+
|
|
193
|
+
```javascript
|
|
194
|
+
{
|
|
195
|
+
workspaceRoot,
|
|
196
|
+
workspaceMode, // 'external' or 'integrated'
|
|
197
|
+
appId,
|
|
198
|
+
importMap:{
|
|
199
|
+
appId,
|
|
200
|
+
artifactPath,
|
|
201
|
+
artifactRelativePath,
|
|
202
|
+
entryPath,
|
|
203
|
+
imports,
|
|
204
|
+
entryCount:85,
|
|
205
|
+
excludedModules:['modules/CaseEvidenceIndexer.js'],
|
|
206
|
+
files:[
|
|
207
|
+
{role:'artifact',path,bytes,sha256},
|
|
208
|
+
{role:'entry',path,bytes,sha256}
|
|
209
|
+
],
|
|
210
|
+
cleanupWarnings,
|
|
211
|
+
committed:true
|
|
212
|
+
}
|
|
213
|
+
}
|
|
214
|
+
```
|
|
215
|
+
|
|
216
|
+
The two file records bind the committed byte length and SHA-256 for the artifact
|
|
217
|
+
and HTML entry. A post-commit observer failure preserves delivery as a successful
|
|
218
|
+
receipt with `eventDelivery.status === 'degraded'` and
|
|
219
|
+
`ARCANE_EVENT_DELIVERY_FAILED`; it does not roll back valid application bytes.
|
|
220
|
+
Packaging refuses a committed refresh that reports cleanup warnings.
|
|
221
|
+
|
|
222
|
+
The canonical integrated-legacy workspace has a deliberate compatibility
|
|
223
|
+
result instead of an artifact: `importMap.skipped` is `true`,
|
|
224
|
+
`importMap.compatibility` is `'integrated-legacy'`, and the reason states that
|
|
225
|
+
the physical two-route browser runtime is retained.
|
|
226
|
+
|
|
227
|
+
`new` and `init` generate the map during scaffolding. `dev` refreshes it once
|
|
228
|
+
before binding; non-dry-run `package` and browser `build` refresh it before
|
|
229
|
+
collection. Paired native packaging refreshes each packaged app. `test`,
|
|
230
|
+
`check`, `verify`, `bundle`, and browser `run` do not regenerate it. There is no
|
|
231
|
+
watcher, polling, scheduled refresh, download, or self-update behavior.
|
|
232
|
+
|
|
233
|
+
There is no supported `--dry-run` for `import-map`: do not pass that parser-wide
|
|
234
|
+
flag because this command performs the real commit. Import-map-specific failures
|
|
235
|
+
use `ARCANE_IMPORT_MAP_INVALID`, `ARCANE_IMPORT_MAP_UNRESOLVED`, or
|
|
236
|
+
`ARCANE_IMPORT_MAP_COLLISION`; packaging can additionally report
|
|
237
|
+
`ARCANE_IMPORT_MAP_CLEANUP_FAILED`. Workspace, policy, usage, busy, and
|
|
238
|
+
cancellation failures retain their normal SDK codes.
|
|
239
|
+
|
|
240
|
+
### Example
|
|
241
|
+
|
|
242
|
+
```bash
|
|
243
|
+
npm exec -- arcane import-map --workspace . --app hello-world --output json
|
|
244
|
+
```
|
|
245
|
+
|
|
246
|
+
Deep details: [authenticated browser delivery and receipts](protocols.md#browser-runtime-delivery).
|
|
247
|
+
|
|
165
248
|
## `arcane dev`
|
|
166
249
|
|
|
167
250
|
### Overview
|
|
@@ -471,9 +554,9 @@ Success returns:
|
|
|
471
554
|
```javascript
|
|
472
555
|
{
|
|
473
556
|
packageName:'arcane-os',
|
|
474
|
-
currentVersion:'0.1.0
|
|
475
|
-
registryVersion:'0.1.
|
|
476
|
-
tag:'
|
|
557
|
+
currentVersion:'0.1.0',
|
|
558
|
+
registryVersion:'0.1.1',
|
|
559
|
+
tag:'latest',
|
|
477
560
|
status:'update-available', // or 'current' or 'ahead'
|
|
478
561
|
updateAvailable:true,
|
|
479
562
|
registry:'https://registry.npmjs.org',
|
|
@@ -16,7 +16,10 @@ The API is capability-first:
|
|
|
16
16
|
|
|
17
17
|
All 20 JavaScript exports are available from both `arcane-os` and
|
|
18
18
|
`arcane-os/event-manager`. The bindings are identical, so choose the focused
|
|
19
|
-
subpath when event instrumentation is the only SDK capability you need.
|
|
19
|
+
subpath when event instrumentation is the only SDK capability you need. Node
|
|
20
|
+
can resolve either package entrypoint. The generated browser map intentionally
|
|
21
|
+
exposes only the focused `arcane-os/event-manager` entry, not the Node package
|
|
22
|
+
root.
|
|
20
23
|
|
|
21
24
|
## Quick start
|
|
22
25
|
|
|
@@ -53,15 +56,21 @@ bounded, export intentionally, then call `clearHistory()`.
|
|
|
53
56
|
|
|
54
57
|
| Capability | Node | Browser renderer | Native/Core host | Remote or cloud | Normalization |
|
|
55
58
|
| --- | --- | --- | --- | --- | --- |
|
|
56
|
-
| Pub/sub, semantic instrumentation, parse/export, seek, playback | Yes | Yes, through a bundler or import map | Only when the SDK module runs in that JavaScript host | No automatic transport | Same synchronous API; optional immutable JSON-like snapshots |
|
|
59
|
+
| Pub/sub, semantic instrumentation, parse/export, seek, playback | Yes | Yes, through a bundler or the managed Arcane import map | Only when the SDK module runs in that JavaScript host | No automatic transport | Same synchronous API; optional immutable JSON-like snapshots |
|
|
57
60
|
| DOM selectors and target descriptions | With DOM-like values or a test shim | Yes | No native UI observation | No | Stable diagnostic descriptors |
|
|
58
61
|
| DOM interaction and mutation capture | No native DOM | Yes | No | No | DOM activity becomes semantic event-stack records |
|
|
59
62
|
| Event-stack schema | Yes | Yes | Data contract only | Can be transported explicitly by the developer | `arcane-event-stack/1` |
|
|
60
63
|
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
64
|
+
In an external or physical-v1 integrated workspace, the managed browser map
|
|
65
|
+
resolves `arcane-os/event-manager` to
|
|
66
|
+
`./arcane/sdk/event-manager.mjs` and its private bare dependency
|
|
67
|
+
`event-pubsub` to
|
|
68
|
+
`./arcane/sdk/dependencies/event-pubsub/index.js`. The canonical
|
|
69
|
+
integrated-legacy workspace retains its older physical routes instead. The
|
|
70
|
+
hash-pinned Arcane browser runtime does not inject this SDK-authored module into
|
|
71
|
+
Shell, Provisioner, Core, or built-in apps. There is no transparent fallback to
|
|
72
|
+
the Node package root, `arcane/1`, HTTP, WebSocket, Ollama, or a cloud event
|
|
73
|
+
service.
|
|
65
74
|
|
|
66
75
|
## Export summary
|
|
67
76
|
|
|
@@ -235,11 +244,11 @@ Seeking never rewrites DOM, storage, native state, processes, or network state.
|
|
|
235
244
|
|
|
236
245
|
```javascript
|
|
237
246
|
await events.playback({
|
|
238
|
-
stack
|
|
239
|
-
fromSequence
|
|
240
|
-
toSequence
|
|
241
|
-
speed
|
|
242
|
-
mode
|
|
247
|
+
stack:null,
|
|
248
|
+
fromSequence:1,
|
|
249
|
+
toSequence:Number.MAX_SAFE_INTEGER,
|
|
250
|
+
speed:0,
|
|
251
|
+
mode:'review',
|
|
243
252
|
signal,
|
|
244
253
|
onRecord
|
|
245
254
|
});
|
|
@@ -47,6 +47,14 @@ These protocols normalize orchestration and evidence. They do not normalize a
|
|
|
47
47
|
Windows EXE, Linux DEB, Android APK, and portable directory into the same
|
|
48
48
|
artifact kind.
|
|
49
49
|
|
|
50
|
+
Managed browser imports have three supported control-plane entrypoints. The CLI
|
|
51
|
+
uses `arcane import-map`; Node callers use
|
|
52
|
+
`executeOperation('import-map', options)` or
|
|
53
|
+
`createToolchain(defaults).importMap(options)`. These are three routes to the
|
|
54
|
+
same app-scoped operation, not three import-map formats. There is no exported
|
|
55
|
+
`importMapApplication()` function, `generateImportMap()` function, or
|
|
56
|
+
`arcane-os/import-map` package subpath.
|
|
57
|
+
|
|
50
58
|
## Central events and time-travel data
|
|
51
59
|
|
|
52
60
|
`arcane-os/event-manager` is host-neutral JavaScript. Its live event path is
|
|
@@ -83,18 +91,105 @@ surface, DOM privacy defaults, playback modes, and recovery behavior.
|
|
|
83
91
|
|
|
84
92
|
## Browser runtime delivery
|
|
85
93
|
|
|
86
|
-
External and integrated workspaces keep the same application URLs
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
94
|
+
External and modern integrated workspaces keep the same application URLs and a
|
|
95
|
+
browser-standard import map. Each selected app owns
|
|
96
|
+
`apps/<id>/modules/arcane.importmap.json`; the exact canonical JSON is also
|
|
97
|
+
embedded in its HTML entry as a managed `<script type="importmap"
|
|
98
|
+
data-arcane-import-map>`. The map follows `<base>` and precedes module scripts,
|
|
99
|
+
classic scripts, and module preloads, so application code can use stable named
|
|
100
|
+
imports such as:
|
|
90
101
|
|
|
91
102
|
```javascript
|
|
92
|
-
import ollama from '
|
|
103
|
+
import ollama from 'arcane/Ollama';
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
The authenticated physical-v1 tree lives entirely beneath `arcane/`. It
|
|
107
|
+
contains 155 pinned Arcane runtime files plus eight SDK browser-runtime files:
|
|
108
|
+
163 files in all. Runtime `strong-type` 1.1 stays under
|
|
109
|
+
`arcane/dependencies/strong-type/`; the focused SDK event surface lives under
|
|
110
|
+
`arcane/sdk/`, with `event-pubsub` 6.1 and its sibling `strong-type` 2.0 under
|
|
111
|
+
`arcane/sdk/dependencies/`. This URL-key separation prevents the runtime and SDK
|
|
112
|
+
dependency versions from aliasing one another. Development serves the selected
|
|
113
|
+
app plus that authenticated tree. Packaging copies the same map, app entry, and
|
|
114
|
+
physical bytes into `dist/<id>`; targets never resolve through the consumer
|
|
115
|
+
workspace's root `node_modules/`.
|
|
116
|
+
|
|
117
|
+
In SDK `0.1.0`, the generated map has exactly 85 entries: 73 named
|
|
118
|
+
`arcane/*` modules, nine `arcane/entities/*` modules, and these three focused or
|
|
119
|
+
compatibility mappings:
|
|
120
|
+
|
|
121
|
+
| Browser specifier | Physical target |
|
|
122
|
+
| --- | --- |
|
|
123
|
+
| `arcane-os/event-manager` | `./arcane/sdk/event-manager.mjs` |
|
|
124
|
+
| `event-pubsub` | `./arcane/sdk/dependencies/event-pubsub/index.js` |
|
|
125
|
+
| `./node_modules/strong-type/index.js` | `./arcane/dependencies/strong-type/index.js` |
|
|
126
|
+
|
|
127
|
+
There is no `arcane-os` package-root mapping, bare `strong-type` mapping, or
|
|
128
|
+
catch-all `arcane/` prefix. Host-internal `CaseEvidenceIndexer.js` is explicitly
|
|
129
|
+
excluded; classic scripts, workers, stylesheets, and other non-ESM assets use
|
|
130
|
+
their documented URL or host loading contract rather than invented package
|
|
131
|
+
bindings.
|
|
132
|
+
|
|
133
|
+
The imported module can be pure browser logic, standard-Web-API logic, or a
|
|
134
|
+
client of `globalThis.Arcane`. Import-map resolution is not a new Arcane wire
|
|
135
|
+
protocol, Core capability, network authority, or provider fallback. Import
|
|
136
|
+
transport and host RPC remain separate layers.
|
|
137
|
+
|
|
138
|
+
The canonical integrated-legacy Arcane OS root is the documented exception. It
|
|
139
|
+
retains its physical `/arcane` and `/node_modules/strong-type` routes, returns
|
|
140
|
+
an `integrated-legacy` skip receipt, and does not create the managed map pair.
|
|
141
|
+
|
|
142
|
+
<details>
|
|
143
|
+
<summary>Refresh lifecycle and two-file commit behavior</summary>
|
|
144
|
+
|
|
145
|
+
Scaffolding (`new` and `init`) creates the map. `dev` refreshes once before
|
|
146
|
+
binding. Non-dry-run `package`, browser `build`, and paired native packaging
|
|
147
|
+
refresh before collecting source. `test`, `check`, `verify`, `bundle`, and
|
|
148
|
+
browser `run` do not refresh. Dry-run packaging/build validates an existing map
|
|
149
|
+
without rewriting it, and `import-map` itself has no supported dry-run.
|
|
150
|
+
|
|
151
|
+
Generation stages the artifact and HTML entry beside their destinations,
|
|
152
|
+
checks directory and file identity under the workspace-operation lock, and
|
|
153
|
+
uses backups to restore the prior pair after a handled pre-commit failure.
|
|
154
|
+
Success reports `committed: true` and SHA-256/byte-length records for both
|
|
155
|
+
files. Cleanup failures after commit remain warnings on the valid receipt;
|
|
156
|
+
packaging rejects them rather than publishing ambiguous state. This is a
|
|
157
|
+
bounded handled-error transaction, not a claim of one filesystem-atomic rename
|
|
158
|
+
for both files and not a durable crash journal.
|
|
159
|
+
|
|
160
|
+
No app watches, polls, downloads, or self-updates this map. An active operation's
|
|
161
|
+
heartbeat is event telemetry only and never regenerates browser state.
|
|
162
|
+
|
|
163
|
+
</details>
|
|
164
|
+
|
|
165
|
+
<details>
|
|
166
|
+
<summary>SDK browser-runtime admission and exact receipt fields</summary>
|
|
167
|
+
|
|
168
|
+
`arcane.lock.json.sdkBrowserRuntime` persists the trusted manifest path,
|
|
169
|
+
`manifestSha256`, `contentSha256`, `builder`, `sdkVersion`, and `source` record.
|
|
170
|
+
For SDK `0.1.0` those identities are:
|
|
171
|
+
|
|
172
|
+
```text
|
|
173
|
+
manifest: node_modules/arcane-os/browser-runtime/ARCANE_SDK_BROWSER_RELEASE.json
|
|
174
|
+
manifestSha256: 43baaec850291c28795f6c194001deb5febab88ccab1b033bce6597dd6f6f08f
|
|
175
|
+
contentSha256: 0caa302bc07d4a45f5290504ec62ddce98fdf5e3412f916c10aae3d51b1e5f7c
|
|
176
|
+
builder: arcane-sdk-browser-runtime-v1
|
|
177
|
+
sdkVersion: 0.1.0
|
|
178
|
+
source.protocol: arcane-sdk-browser-runtime/1
|
|
179
|
+
source.browserEntry: arcane-os/event-manager
|
|
93
180
|
```
|
|
94
181
|
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
182
|
+
The `source` record also binds the `arcane-os-sdk` authority/repository and the
|
|
183
|
+
exact `event-pubsub` 6.1.0 and `strong-type` 2.0.0 package identities. Before a
|
|
184
|
+
workspace tree is admitted, the same-process verifier returns
|
|
185
|
+
`schemaVersion`, `kind`, `canonicalLocation`, `rootIdentity`, `manifestPath`,
|
|
186
|
+
`manifestSha256`, `manifestIdentity`, `builder`, `sdkVersion`, `source`,
|
|
187
|
+
`files`, `fileCount`, `totalBytes`, `contentSha256`, `identities`,
|
|
188
|
+
`sourceIdentities`, and `directories`. Those object-identity-bound verifier
|
|
189
|
+
receipts are authority inside the issuing process; reconstructing the same JSON
|
|
190
|
+
does not recreate authority.
|
|
191
|
+
|
|
192
|
+
</details>
|
|
98
193
|
|
|
99
194
|
## Arcane application protocol
|
|
100
195
|
|
|
@@ -190,7 +285,7 @@ Arcane normalizes the outer promise/error and stream lifecycle. `chatText`,
|
|
|
190
285
|
|
|
191
286
|
## Explicit cloud provider path
|
|
192
287
|
|
|
193
|
-
|
|
288
|
+
`arcane/AI` can use an explicitly selected and configured cloud
|
|
194
289
|
profile over HTTPS. That path is not Core transport fallback. The module adapts
|
|
195
290
|
the selected provider into its high-level application behavior, while provider
|
|
196
291
|
diagnostics and optional fields can remain provider-specific. Native policy and
|
|
@@ -231,11 +326,14 @@ The common contract ends where platform truth must remain different:
|
|
|
231
326
|
|
|
232
327
|
## Receipt and generation boundaries
|
|
233
328
|
|
|
234
|
-
SDK runtime, app releases,
|
|
235
|
-
identity-bound receipts.
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
receipt
|
|
329
|
+
SDK runtime, app releases, import-map artifact/entry pairs, bundles, native
|
|
330
|
+
plans, providers, and artifacts use identity-bound receipts. The import-map
|
|
331
|
+
receipt binds each committed relative path, byte length, and SHA-256 in
|
|
332
|
+
addition to its exact imports, entry count, exclusions, and cleanup state. A
|
|
333
|
+
runtime or release receipt binds the exact location, filesystem identity,
|
|
334
|
+
bytes/inventory hashes, policy, toolchain, platform/architecture, signer/trust
|
|
335
|
+
result where applicable, and generation. Mutation invalidates the receipt
|
|
336
|
+
before bytes or authority change.
|
|
239
337
|
|
|
240
338
|
Process-local receipts do not authorize reuse across Shell, Core, providers, or
|
|
241
339
|
other processes. Cross-process reuse requires an authenticated shared host or
|
|
@@ -1,11 +1,17 @@
|
|
|
1
1
|
# Arcane OS SDK JavaScript API
|
|
2
2
|
|
|
3
|
-
The npm package exposes a Node.js ESM control plane. It is not a browser-importable renderer API.
|
|
3
|
+
The npm package exposes a Node.js ESM control plane. It is not a browser-importable renderer API. Application code uses named modules from the managed browser map, such as `arcane/ThemeBootstrap`, uses the focused `arcane-os/event-manager` browser entry when needed, and calls `globalThis.Arcane` for capability-gated host behavior.
|
|
4
4
|
|
|
5
5
|
This page is the canonical inventory for every JavaScript name reachable through `package.json#exports`. The same binding can appear at the root and a focused subpath; those entrypoints are listed together. The root workspace `discoverApps` and the low-level packager `discoverApps` are intentionally separate records because they are different functions.
|
|
6
6
|
|
|
7
7
|
## Import map
|
|
8
8
|
|
|
9
|
+
This table is the Node `package.json#exports` map: it defines package
|
|
10
|
+
entrypoints for SDK/tooling code. It is distinct from the generated browser
|
|
11
|
+
import map that resolves application-facing `arcane/*` modules and the focused
|
|
12
|
+
EventManager entry. See [browser runtime delivery](protocols.md#browser-runtime-delivery)
|
|
13
|
+
for that 85-entry physical-runtime contract.
|
|
14
|
+
|
|
9
15
|
| Specifier | Purpose |
|
|
10
16
|
| --- | --- |
|
|
11
17
|
| `arcane-os` | Complete high-level SDK surface. |
|
|
@@ -2634,6 +2640,13 @@ Frozen registry of stable SDK error-code strings.
|
|
|
2634
2640
|
registry, timeout, HTTP, or response failure; caller cancellation remains the
|
|
2635
2641
|
separate `ERROR_CODES.cancelled` value.
|
|
2636
2642
|
|
|
2643
|
+
The import-map operation also reports the stable operation-specific strings
|
|
2644
|
+
`ARCANE_IMPORT_MAP_INVALID`, `ARCANE_IMPORT_MAP_UNRESOLVED`, and
|
|
2645
|
+
`ARCANE_IMPORT_MAP_COLLISION`; package assembly can additionally report
|
|
2646
|
+
`ARCANE_IMPORT_MAP_CLEANUP_FAILED`. They are normalized `ArcaneError.code`
|
|
2647
|
+
values, but are not properties added to this frozen general registry in SDK
|
|
2648
|
+
`0.1.0`.
|
|
2649
|
+
|
|
2637
2650
|
### Value and import
|
|
2638
2651
|
|
|
2639
2652
|
```text
|
|
@@ -3417,9 +3430,12 @@ async function usecreateApplication(...arguments_) {
|
|
|
3417
3430
|
|
|
3418
3431
|
Returns a frozen convenience object that applies shared defaults to every headless application operation.
|
|
3419
3432
|
|
|
3420
|
-
The object includes `
|
|
3421
|
-
|
|
3422
|
-
|
|
3433
|
+
The object includes `importMap(options)`, which merges defaults with explicit
|
|
3434
|
+
call options and performs one selected app's authenticated map refresh. The
|
|
3435
|
+
equivalent generic route is `execute('import-map', options)`. It also includes
|
|
3436
|
+
`updateCheck(options)`, which invokes `checkSdkUpdate()` once. Constructing the
|
|
3437
|
+
toolchain does not check, poll, schedule, download, install, regenerate, or
|
|
3438
|
+
mutate anything.
|
|
3423
3439
|
|
|
3424
3440
|
### Signature and result
|
|
3425
3441
|
|
|
@@ -3440,14 +3456,15 @@ import {createToolchain} from 'arcane-os';
|
|
|
3440
3456
|
|
|
3441
3457
|
const toolchain = createToolchain({
|
|
3442
3458
|
workspaceRoot: process.cwd(),
|
|
3459
|
+
appId:'hello-world',
|
|
3443
3460
|
onEvent(event) {
|
|
3444
3461
|
console.info(event.type);
|
|
3445
3462
|
}
|
|
3446
3463
|
});
|
|
3447
3464
|
|
|
3448
|
-
// Only this explicit call
|
|
3449
|
-
const
|
|
3450
|
-
console.log(
|
|
3465
|
+
// Only this explicit call refreshes the managed map and HTML entry.
|
|
3466
|
+
const result = await toolchain.importMap();
|
|
3467
|
+
console.log(result.importMap.entryCount); // 85 in SDK 0.1.0
|
|
3451
3468
|
```
|
|
3452
3469
|
|
|
3453
3470
|
## describeTargets()
|
|
@@ -3512,9 +3529,18 @@ async function usedevelopApplication(...arguments_) {
|
|
|
3512
3529
|
|
|
3513
3530
|
Dispatches one named headless SDK operation with normalized acceptance, events, cancellation, and failure.
|
|
3514
3531
|
|
|
3532
|
+
The exact command `'import-map'` dispatches one app-scoped authenticated refresh
|
|
3533
|
+
and returns `{workspaceRoot, workspaceMode, appId, importMap}`. A normal
|
|
3534
|
+
`importMap` value binds the generated imports and the committed map/HTML file
|
|
3535
|
+
hashes; the canonical integrated-legacy layout returns its documented skip
|
|
3536
|
+
record instead. This route mutates the two managed application files and has no
|
|
3537
|
+
supported dry-run.
|
|
3538
|
+
|
|
3515
3539
|
The exact command `'update-check'` dispatches one `checkSdkUpdate(options)`
|
|
3516
|
-
call. Dispatch never installs a recurring task
|
|
3517
|
-
to check for updates implicitly.
|
|
3540
|
+
call. Dispatch never installs a recurring task, polls application state, or
|
|
3541
|
+
causes another command to check for updates implicitly. There is no exported
|
|
3542
|
+
`importMapApplication()` or `generateImportMap()` binding and no
|
|
3543
|
+
`arcane-os/import-map` package subpath.
|
|
3518
3544
|
|
|
3519
3545
|
### Signature and result
|
|
3520
3546
|
|
|
@@ -3533,8 +3559,11 @@ Import it from `arcane-os` or `arcane-os/toolchain`. The signature above states
|
|
|
3533
3559
|
```javascript
|
|
3534
3560
|
import {executeOperation} from 'arcane-os';
|
|
3535
3561
|
|
|
3536
|
-
const result = await executeOperation('
|
|
3537
|
-
|
|
3562
|
+
const result = await executeOperation('import-map', {
|
|
3563
|
+
workspaceRoot:process.cwd(),
|
|
3564
|
+
appId:'hello-world'
|
|
3565
|
+
});
|
|
3566
|
+
console.log(result.importMap.committed, result.importMap.entryCount);
|
|
3538
3567
|
```
|
|
3539
3568
|
|
|
3540
3569
|
## packageApplication()
|