arcane-os 0.55.0 → 0.56.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.
@@ -3657,7 +3657,7 @@
3657
3657
  "entrypoints": ["arcane-os/core/contracts"],
3658
3658
  "primaryImport": "arcane-os/core/contracts",
3659
3659
  "group": "Core protocol contracts",
3660
- "summary": "Describes the public fields on Core request, response, event and cancellation frames.",
3660
+ "summary": "Describes the public fields on Core request, response, event, cancellation and runtime.replay control frames.",
3661
3661
  "availability": "Node and browser/bundler",
3662
3662
  "protocol": "arcane/1 wire descriptions",
3663
3663
  "normalization": "Descriptive data only; it does not admit methods, validate application policy or create a transport"
@@ -3709,14 +3709,14 @@
3709
3709
  "name": "createCoreClient",
3710
3710
  "displayName": "createCoreClient()",
3711
3711
  "kind": "function",
3712
- "signature": "createCoreClient({global=globalThis,transport=null,eventOwner=arcaneEvents,eventOwnerReady,autoConnect=true,onError}={})",
3712
+ "signature": "createCoreClient({global=globalThis,transport=null,eventOwner=arcaneEvents,eventOwnerReady,autoConnect=true,replayRuntimeState=false,onError}={})",
3713
3713
  "entrypoints": ["arcane-os/core/client"],
3714
3714
  "primaryImport": "arcane-os/core/client",
3715
3715
  "group": "Core browser client",
3716
3716
  "summary": "Creates one correlated Arcane Core RPC client with explicit transport, readiness, events, cancellation and lifetime ownership.",
3717
3717
  "availability": "Browser and native WebView JavaScript hosts; custom transports require a callable send(frame)",
3718
3718
  "protocol": "arcane/1 over the selected host transport",
3719
- "normalization": "Preserves complete request, result and event data; rejects invalid transports before readiness, retains FIFO handoff to the shared event owner and reports transport failures that arrive after request settlement"
3719
+ "normalization": "Preserves complete request, result and event data; retains FIFO event-owner handoff; failTransport(error) settles pending RPCs and acknowledgements with the complete failure and releases the client lifetime; opt-in replayRuntimeState sends one observed nonblocking runtime.replay control after transport readiness"
3720
3720
  },
3721
3721
  {
3722
3722
  "id": "core-client:createCoreFacade",
@@ -3741,24 +3741,38 @@
3741
3741
  "entrypoints": ["arcane-os/core/client"],
3742
3742
  "primaryImport": "arcane-os/core/client",
3743
3743
  "group": "Core browser client",
3744
- "summary": "Installs one synchronous global Arcane facade and native receive callback for the selected renderer lifetime.",
3744
+ "summary": "Installs one synchronous global Arcane facade, native receive callback and terminal transport-failure callback for the selected renderer lifetime.",
3745
3745
  "availability": "Browser and native WebView JavaScript hosts",
3746
3746
  "protocol": "arcane/1 renderer facade",
3747
- "normalization": "Repeated installation returns the same client; closing releases subscriptions, callbacks, timers and pending renderer requests without killing Core"
3747
+ "normalization": "Repeated installation returns the same client; close/failTransport release owned resources and restore prior globals only while still owned; __arcaneTransportFailed preserves the complete host failure without killing Core"
3748
+ },
3749
+ {
3750
+ "id": "core-client:getInstalledCoreClient",
3751
+ "name": "getInstalledCoreClient",
3752
+ "displayName": "getInstalledCoreClient()",
3753
+ "kind": "function",
3754
+ "signature": "getInstalledCoreClient(global=globalThis)",
3755
+ "entrypoints": ["arcane-os/core/client"],
3756
+ "primaryImport": "arcane-os/core/client",
3757
+ "group": "Core browser client",
3758
+ "summary": "Returns the exact live SDK-installed client or null without installing, connecting or changing globals.",
3759
+ "availability": "Browser and native WebView JavaScript hosts",
3760
+ "protocol": "arcane/1 renderer client ownership",
3761
+ "normalization": "Recognizes ESM and classic SDK installation identity; returns null after close or terminal failure and does not treat a foreign Arcane facade as an SDK client"
3748
3762
  },
3749
3763
  {
3750
3764
  "id": "core-classic-source:createCoreClassicSource",
3751
3765
  "name": "createCoreClassicSource",
3752
3766
  "displayName": "createCoreClassicSource()",
3753
3767
  "kind": "function",
3754
- "signature": "async createCoreClassicSource({eventOwnerModuleURL}={})",
3768
+ "signature": "async createCoreClassicSource({eventOwnerModuleURL,replayRuntimeState=false}={})",
3755
3769
  "entrypoints": ["arcane-os/core/classic-source"],
3756
3770
  "primaryImport": "arcane-os/core/classic-source",
3757
3771
  "group": "Core classic client projection",
3758
3772
  "summary": "Generates the native host's classic injection script from the installed canonical Core client and contracts.",
3759
3773
  "availability": "Node; generated source runs in browser and native WebView renderers",
3760
3774
  "protocol": "arcane/1 classic-script injection",
3761
- "normalization": "Returns the complete canonical client projection; installs synchronous facade shapes while deferring only the shared event-owner module connection when document parsing is incomplete"
3775
+ "normalization": "Returns the complete canonical client projection; installs synchronous facade shapes while deferring only the event-owner module connection when document parsing is incomplete; forwards explicit runtime replay selection with a false default"
3762
3776
  },
3763
3777
  {
3764
3778
  "id": "core-runtime:createCoreRuntime",
@@ -3772,7 +3786,7 @@
3772
3786
  "summary": "Creates an app-neutral Core dispatcher with explicit services, request lifetimes, events and graceful drain.",
3773
3787
  "availability": "Node on Windows, Linux and macOS native hosts; Android requires its host adaptation",
3774
3788
  "protocol": "arcane/1 dispatcher and service lifecycle",
3775
- "normalization": "Starts services independently, preserves request correlation and complete results/errors, cancels only request-lifetime work and waits accepted service-lifetime responses before ordered service drain and disposal"
3789
+ "normalization": "Starts services independently, preserves complete results/errors, cancels only request-lifetime work and drains accepted service work; runtime.replay publishes current dispatcher/service state without restart and preserves reentrant lifecycle publication order"
3776
3790
  },
3777
3791
  {
3778
3792
  "id": "core-stdio:encodeCoreFrame",
@@ -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 one exact published `arcane-os` version in
92
- its own `package.json` and resolves it through that project's normal install
93
- into its own `node_modules`. An application that does not currently consume
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.
@@ -381,10 +383,11 @@ layouts; the default nested scaffold continues to use its development dependency
381
383
  ## Installed SDK runtime materialization
382
384
 
383
385
  `materializeInstalledSdkRuntime()` is the Node entrypoint for refreshing one
384
- external workspace's checked-in `arcane/` projection from its one exact
385
- installed SDK declaration. Import the function through the dependency key that
386
+ external workspace's checked-in `arcane/` projection from its one declared and
387
+ installed SDK dependency. Import the function through the dependency key that
386
388
  the workspace actually declares: `arcane-os` for the canonical package name or,
387
- for example, `arcane-sdk` for the exact `npm:arcane-os@<version>` alias. No
389
+ for example, `arcane-sdk` for the development alias `npm:arcane-os@latest`. The
390
+ lockfile and installed package retain the exact resolved version. No
388
391
  application- or Arcane OS-local copier owns this operation.
389
392
 
390
393
  The operation resolves that declaration while holding the shared
@@ -563,8 +566,8 @@ exactly `dependencyName`, `packageSource`,
563
566
  `canonicalPackageRoot`, `packageName`, `packageVersion`, `runtimeRoot`,
564
567
  and `browserRuntimeRoot`. A
565
568
  workspace may use the canonical dependency name or one npm alias such as
566
- `npm:arcane-os@0.51.1`; the installed package manifest identifies `arcane-os`
567
- and supplies its actual version. The resolver requires one declaration and a
569
+ `npm:arcane-os@latest`; the installed package manifest identifies `arcane-os`
570
+ and supplies its actual exact version. The resolver requires one declaration and a
568
571
  direct physical installation with runtime and browser-runtime directories.
569
572
  The application's normal npm declaration and lockfile own version selection.
570
573
 
@@ -999,9 +1002,12 @@ reachable.
999
1002
 
1000
1003
  ### macOS
1001
1004
 
1002
- No macOS target, native bridge, Core host, artifact, or run contract is exposed
1003
- by this SDK version. A browser may still run browser-only application code, but
1004
- that does not create a native Arcane host or satisfy a native capability.
1005
+ No macOS executable target, native bridge, platform host, artifact, or run
1006
+ contract is exposed by this SDK version. A browser may still run browser-only
1007
+ application code. A separately composed macOS host may use the reusable Node
1008
+ Core runtime, framed stdio transport, host composition, and portable payload,
1009
+ but those SDK primitives do not create a native bridge or executable host and
1010
+ do not by themselves satisfy a native capability.
1005
1011
 
1006
1012
  ## Development and remote HTTP transport
1007
1013
 
@@ -1083,8 +1089,11 @@ The common contract ends where platform truth must remain different:
1083
1089
  artifact kind, and some diagnostic/result fields remain platform-specific;
1084
1090
  - unsupported platforms fail or return a documented unsupported state; they do
1085
1091
  not run an unrelated browser implementation as a substitute;
1086
- - this SDK version requires a selected checkout and Core to provide the current
1087
- native plan's protocol, version, feature, capability, method, and provider;
1092
+ - the portable target defaults to the installed SDK provider and assembles a
1093
+ non-executable payload without an Arcane OS checkout;
1094
+ - executable native targets require their explicit checkout/provider, and the
1095
+ composed host must supply the protocol, version, features, capabilities,
1096
+ methods, and services that its application contract requires;
1088
1097
  - that current-build compatibility does not promise that a future SDK will accept
1089
1098
  this Core or that this SDK will accept a future Core.
1090
1099
 
@@ -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
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "arcane-os",
3
- "version": "0.55.0",
3
+ "version": "0.56.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",
@@ -48,6 +48,16 @@
48
48
  "pwa": { "$ref": "#/$defs/pwa" },
49
49
  "include": { "$ref": "#/$defs/nonemptyPathList" },
50
50
  "exclude": { "$ref": "#/$defs/pathList" },
51
+ "nativeResources": {
52
+ "type": "object",
53
+ "additionalProperties": false,
54
+ "required": ["include"],
55
+ "description": "Additional literal application-relative paths for a selected nonbrowser target. Exclude applies only to this additional selection. Native-only files retain their complete original content and do not enter browser document or PWA processing. Omission or an empty include preserves existing selection and output behavior.",
56
+ "properties": {
57
+ "include": { "$ref": "#/$defs/pathList" },
58
+ "exclude": { "$ref": "#/$defs/pathList" }
59
+ }
60
+ },
51
61
  "shared": {
52
62
  "type": "array",
53
63
  "minItems": 1,
@@ -88,6 +88,16 @@
88
88
  "exclude": {
89
89
  "$ref": "#/$defs/pathList"
90
90
  },
91
+ "nativeResources": {
92
+ "type": "object",
93
+ "additionalProperties": false,
94
+ "required": ["include"],
95
+ "description": "Additional literal application-relative paths for a selected nonbrowser target. Exclude applies only to this additional selection. Native-only files retain their complete original content and do not enter browser document or PWA processing. Omission or an empty include preserves existing selection and output behavior.",
96
+ "properties": {
97
+ "include": { "$ref": "#/$defs/pathList" },
98
+ "exclude": { "$ref": "#/$defs/pathList" }
99
+ }
100
+ },
91
101
  "shared": {
92
102
  "type": "array",
93
103
  "uniqueItems": true,
@@ -111,13 +111,21 @@ function validateLocalAIModelPolicy(value,label){
111
111
 
112
112
  function validatePackage(value,appId){
113
113
  assertOnlyKeys(value,new Set([
114
- 'entry','strategy','include','exclude','shared','adapter','localAIModelPolicy','pwa','documents'
114
+ 'entry','strategy','include','exclude','shared','adapter','localAIModelPolicy','pwa','documents','nativeResources'
115
115
  ]),'descriptor.package');
116
116
  const entry=normalizeRelativePath(value.entry,'descriptor.package.entry');
117
117
  const documents=normalizeAppDocuments(value.documents,'descriptor.package.documents');
118
118
  if(!['static','adapter'].includes(value.strategy))fail('descriptor.package.strategy must be static or adapter.');
119
119
  const include=relativePaths(value.include,'descriptor.package.include',{required:true});
120
120
  const exclude=relativePaths(value.exclude??[],'descriptor.package.exclude');
121
+ let nativeResources;
122
+ if(value.nativeResources!==undefined){
123
+ assertOnlyKeys(value.nativeResources,new Set(['include','exclude']),'descriptor.package.nativeResources');
124
+ nativeResources={
125
+ include:relativePaths(value.nativeResources.include,'descriptor.package.nativeResources.include'),
126
+ exclude:relativePaths(value.nativeResources.exclude??[],'descriptor.package.nativeResources.exclude')
127
+ };
128
+ }
121
129
  if(!include.some(candidate=>entry===candidate||entry.startsWith(`${candidate}/`))){
122
130
  fail('descriptor.package.entry must be covered by descriptor.package.include.');
123
131
  }
@@ -140,6 +148,7 @@ function validatePackage(value,appId){
140
148
  strategy:value.strategy,
141
149
  include,
142
150
  exclude,
151
+ ...(nativeResources===undefined?{}:{nativeResources}),
143
152
  shared,
144
153
  ...(value.pwa===undefined?{}:{pwa:normalizePwaConfig(value.pwa)}),
145
154
  ...(adapter?{adapter}:{}),
@@ -331,6 +340,10 @@ export function projectPackageManifest(descriptor){
331
340
  ...(value.package.pwa===undefined?{}:{pwa:value.package.pwa}),
332
341
  include:[...value.package.include],
333
342
  exclude:[...value.package.exclude],
343
+ ...(value.package.nativeResources===undefined?{}:{nativeResources:{
344
+ include:[...value.package.nativeResources.include],
345
+ exclude:[...value.package.nativeResources.exclude]
346
+ }}),
334
347
  shared:[...value.package.shared],
335
348
  ...(value.package.adapter?{adapter:value.package.adapter}:{})
336
349
  };
@@ -391,6 +404,10 @@ function synthesizedDescriptor(packageManifest,nativeDescriptor){
391
404
  ...(packageManifest.pwa===undefined?{}:{pwa:packageManifest.pwa}),
392
405
  include:[...packageManifest.include],
393
406
  exclude:[...(packageManifest.exclude??[])],
407
+ ...(packageManifest.nativeResources===undefined?{}:{nativeResources:{
408
+ include:[...packageManifest.nativeResources.include],
409
+ exclude:[...(packageManifest.nativeResources.exclude??[])]
410
+ }}),
394
411
  shared:[...packageManifest.shared],
395
412
  ...(packageManifest.adapter?{adapter:packageManifest.adapter}:{})
396
413
  },
@@ -9,8 +9,12 @@ export function resolveAppRoot(workspaceRoot, config, appId) {
9
9
  return path.resolve(workspaceRoot, appRelativeRoot(config, appId));
10
10
  }
11
11
 
12
- export function resolvePackageOutputRoot(workspaceRoot, config, app) {
13
- return path.resolve(workspaceRoot, app.outputDirectory ?? `${config.distRoot}/${app.id}`);
12
+ export function resolvePackageOutputRoot(workspaceRoot, config, app, {target='browser', outputDirectory}={}) {
13
+ const nativeSelection=target!=='browser'&&app.nativeResources?.include.length>0;
14
+ const selectedDirectory=outputDirectory??(nativeSelection
15
+ ?`${config.distRoot}/.native/${target}/${app.id}`
16
+ :app.outputDirectory??`${config.distRoot}/${app.id}`);
17
+ return path.resolve(workspaceRoot,selectedDirectory);
14
18
  }
15
19
 
16
20
  export function appBaseHref(workspaceRoot, appRoot, document = 'index.html') {
@@ -0,0 +1,2 @@
1
+ // This ordinary filesystem module retains Node's asynchronous ESM loader.
2
+ module.exports = import('./arcane-core.mjs');