arcane-os 0.91.0 → 0.93.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.
@@ -4,8 +4,11 @@
4
4
  from one fetched Git revision. It uses a dedicated **bare object cache**, not a
5
5
  clone with a working checkout. It never reads uncommitted application files,
6
6
  checks out files, modifies a user checkout/index, or creates another worktree.
7
- Construction performs no I/O. The native host needs Git available on its PATH;
8
- Git owns remote access, authentication and its actual failures.
7
+ Construction performs no I/O. The native host needs Git available on its PATH
8
+ or an installed Git for Windows registration discoverable by the default
9
+ [process runner](sdk-api.md#runprocess). Discovery extends only that Git child's
10
+ PATH after its existing entries. Git owns remote access, authentication and
11
+ its actual failures; custom process adapters retain their own execution.
9
12
 
10
13
  ```js
11
14
  import {createGitTextSnapshot} from 'arcane-os';
@@ -33,7 +36,7 @@ policy stable for the lifetime of its snapshot owner.
33
36
 
34
37
  ## API and lifecycle
35
38
 
36
- `createGitTextSnapshot({cacheDirectory,remote,remoteBase,ref,selectPath,gitIdentity,onEvent,run})`
39
+ `createGitTextSnapshot({cacheDirectory,remote,remoteBase,ref,selectPath,allowUnborn=false,gitIdentity,onEvent,run})`
37
40
  returns `{refresh,close,drain,dispose}`. `run` defaults to the SDK's existing
38
41
  `runProcess`; applications normally omit it. It is the same process adapter
39
42
  contract, not a second process supervisor. `onEvent` is the ordinary SDK event
@@ -91,6 +94,47 @@ application owner; this factory does not install a daemon or cross-process lock.
91
94
  An empty cache is initialized once. An existing non-bare checkout is rejected
92
95
  without repurposing it. The cache is retained when the owner closes.
93
96
 
97
+ ## Unborn remotes
98
+
99
+ Optional `allowUnborn:true` adds an explicit no-advertised-revision state:
100
+
101
+ ```javascript
102
+ const snapshot = createGitTextSnapshot({
103
+ cacheDirectory: applicationCacheDirectory,
104
+ remote: applicationRepository,
105
+ ref: 'refs/heads/main',
106
+ selectPath: applicationSelectPath,
107
+ allowUnborn: true
108
+ });
109
+ const observed = await snapshot.refresh({signal});
110
+ // Empty advertisement: {revision: null, files: [], unborn: true}.
111
+ // Selected commit: {revision: actualCommit, files: selectedText, unborn: false}.
112
+ ```
113
+
114
+ Each opted-in acquisition first completes unfiltered
115
+ `git ls-remote --symref -- <remote>` with the same captured locator and identity.
116
+ Only successful empty stdout produces the explicit unborn result. No revision
117
+ is invented and no fetch, tree listing or blob process runs on that path.
118
+ The [Git remote advertisement](https://git-scm.com/docs/git-ls-remote) is scoped
119
+ to refs visible to that connection, not hidden refs or unreachable objects.
120
+
121
+ Any advertised HEAD, branch, tag or other output continues through the ordinary
122
+ selected-ref fetch and commit resolution. A missing selected ref on a populated
123
+ remote remains a Git failure. Failed observations, authentication/transport
124
+ errors and stderr wording never establish an unborn result. A real commit with
125
+ an empty tree or zero selected files retains its actual revision and
126
+ `unborn:false`. Omitting the boolean, or supplying `false`, preserves the
127
+ previous `{revision,files}` result and command sequence without a remote probe.
128
+
129
+ Bare-cache role discovery still precedes remote observation. Every later
130
+ refresh observes again, so prior empty or committed results cannot hide a
131
+ changed remote or a failure. Caller cancellation, shared acquisition, independent
132
+ result copies and drain remain unchanged. Opted-in completion events add
133
+ `unborn`; `revision:null` and `unborn:true` describe the explicit empty state.
134
+ This option adds one remote command per acquisition; existing revision-based
135
+ text reuse still applies to committed results. For writing the first commit,
136
+ see [first-publication composition](core-repositories.md#first-publication-from-an-unborn-remote).
137
+
94
138
  ## Complete text and observable failures
95
139
 
96
140
  Content is the exact Git blob text, including whitespace, CRLF, newlines,
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "schemaVersion": 1,
3
- "sdkVersion": "0.90.0",
3
+ "sdkVersion": "0.92.0",
4
4
  "environment": {
5
5
  "runtime": "Node.js for Node entrypoints; browser for browser-only entrypoints",
6
6
  "minimumVersion": "22.23.2 for Node entrypoints",
@@ -311,14 +311,14 @@
311
311
  "name": "createRepositoryWorkspace",
312
312
  "displayName": "createRepositoryWorkspace()",
313
313
  "kind": "function",
314
- "signature": "createRepositoryWorkspace({name,directory,dataRoot,remote,remoteBase,branch,longPaths,cloneIdentity,gitIdentity,onEvent,run=runProcess}={})",
314
+ "signature": "createRepositoryWorkspace({name,directory,dataRoot,remote,remoteBase,branch,initialBranch,longPaths,cloneIdentity,gitIdentity,onEvent,run=runProcess}={})",
315
315
  "entrypoints": ["arcane-os/core/repositories"],
316
316
  "primaryImport": "arcane-os/core/repositories",
317
317
  "group": "Native repository workspaces",
318
318
  "summary": "Owns one selected native working checkout with ArcaneData/Repos defaults and existing Git/process lifecycle.",
319
319
  "availability": "Node with Git on Windows, Linux and macOS; Android requires host process adaptation",
320
320
  "protocol": "Git working repository and SDK process adapter",
321
- "normalization": "Returns directory, open, status, configuration, pull, push, write and identical close/drain/dispose hooks. Only missing or empty destinations clone; existing roots are preserved. Optional factory remoteBase explicitly selects the initial-clone remote as a local filesystem locator and captures path.resolve(remoteBase, remote) once at construction. A relative base, including an empty string, uses the construction-time working directory. Only the Git argument is derived; the caller's original locator remains unchanged. Omission preserves every Git remote name, URL, SCP-like address and remote-helper string without guessed parsing. Optional longPaths captures a boolean: explicit Windows true/false supplies clone-local core.longpaths before the first checkout, persisting only in the new repository under ordinary Git configuration precedence. Omission preserves configuration; existing repositories and non-Windows clone commands remain unchanged. No global setting or migration. configuration observes the existing root, symbolic HEAD, origin URL/pushURL arrays and branch remote/merge/upstream URL arrays without clone/init/fetch, preserving unset, empty and repeated values. Explicit paths remain selected. Same-directory operations serialize within the process; cancellation and shutdown join accepted process work. pull/push/write accept a captured target {remote,ref,remoteBase?} for current-branch fast-forward pull or non-force current-HEAD selected-ref push; omission retains ordinary configured behavior. An operation's own remoteBase declares local-path intent and captures its native absolute argument once at acceptance, before queueing; factory remote/remoteBase/branch remain independent clone inputs. Targeted pull/push results and writer results/failure outcomes retain the original remote, ref and supplied remoteBase, including relative or empty base text. Unrepresentable base text reports TypeError without transformation. write snapshots exact text and paths, stages/commits only literal owned paths and preserves unrelated staged files and Git filters. Complete outputs and causal failures retain confirmed local/committed/pushed and uncertain outcomes plus the supplied target. Optional gitIdentity captures name/email/username for child Git operations only; omitted fields remain inherited and identity selection writes no config file. Optional cloneIdentity captures exact name/email strings and persists only supplied fields through clone --config before the first checkout on every supported platform. Empty strings are explicit; omitted or undefined fields preserve inherited/template configuration. Existing checkouts are never reconfigured. Unrepresentable process arguments fail honestly without transforming them. This option changes no global configuration or credentials and does not identify an authenticated account; command-local gitIdentity remains independent."
321
+ "normalization": "Returns directory, open, status, configuration, pull, push, write and identical close/drain/dispose hooks. Only missing or empty destinations clone; existing roots are preserved. Optional factory remoteBase explicitly selects the initial-clone remote as a local filesystem locator and captures path.resolve(remoteBase, remote) once at construction. A relative base, including an empty string, uses the construction-time working directory. Only the Git argument is derived; the caller's original locator remains unchanged. Omission preserves every Git remote name, URL, SCP-like address and remote-helper string without guessed parsing. Optional longPaths captures a boolean: explicit Windows true/false supplies clone-local core.longpaths before the first checkout, persisting only in the new repository under ordinary Git configuration precedence. Omission preserves configuration; existing repositories and non-Windows clone commands remain unchanged. No global setting or migration. configuration adds revision and unborn from successful porcelain-v2 branch state, preserving real commits including empty trees; it observes the existing root, symbolic HEAD, origin URL/pushURL arrays and branch remote/merge/upstream URL arrays without clone/init/fetch, preserving unset, empty and repeated values. Explicit paths remain selected. Same-directory operations serialize within the process; cancellation and shutdown join accepted process work. pull/push/write accept a captured target {remote,ref,remoteBase?} for current-branch fast-forward pull or non-force current-HEAD selected-ref push; omission retains ordinary configured behavior. An operation's own remoteBase declares local-path intent and captures its native absolute argument once at acceptance, before queueing; factory remote/remoteBase/branch remain independent clone inputs. Targeted pull/push results and writer results/failure outcomes retain the original remote, ref and supplied remoteBase, including relative or empty base text. Unrepresentable base text reports TypeError without transformation. write snapshots exact text and paths, stages/commits only literal owned paths and preserves unrelated staged files and Git filters. Complete outputs and causal failures retain confirmed local/committed/pushed and uncertain outcomes plus the supplied target. Optional gitIdentity captures name/email/username for child Git operations only; omitted fields remain inherited and identity selection writes no config file. Optional cloneIdentity captures exact name/email strings and persists only supplied fields through clone --config before the first checkout on every supported platform. Empty strings are explicit; omitted or undefined fields preserve inherited/template configuration. Existing checkouts are never reconfigured. Unrepresentable process arguments fail honestly without transforming them. This option changes no global configuration or credentials and does not identify an authenticated account; command-local gitIdentity remains independent. Optional initialBranch selects refs/heads/<initialBranch> only for a newly cloned checkout with successful complete empty remote advertisement, explicit local initial state and successful empty local-ref listing; branch remains clone --branch. Any template or hook-supplied local ref preserves HEAD. Existing destinations and committed or advertised clones remain unchanged. Explicit new-clone open adds complete ordered preparation outputs, including observeRefs when performed; later preparation failures retain completed outputs and their original cause. Omission preserves commands and result shape. First publication uses existing exact-file write and explicit target without an implicit pull."
322
322
  },
323
323
  {
324
324
  "id": "core-repositories:readGitIdentity",
@@ -493,14 +493,14 @@
493
493
  "name": "createGitTextSnapshot",
494
494
  "displayName": "createGitTextSnapshot()",
495
495
  "kind": "function",
496
- "signature": "createGitTextSnapshot({cacheDirectory,remote,remoteBase,ref,selectPath,gitIdentity,onEvent,run=runProcess}={})",
496
+ "signature": "createGitTextSnapshot({cacheDirectory,remote,remoteBase,ref,selectPath,allowUnborn=false,gitIdentity,onEvent,run=runProcess}={})",
497
497
  "entrypoints": ["arcane-os"],
498
498
  "primaryImport": "arcane-os",
499
499
  "group": "Workspace, doctor, repository, and server",
500
500
  "summary": "Reads complete selected text from one fetched revision using a dedicated bare Git object cache and batched retrieval.",
501
501
  "availability": "Node with Git; Android requires a host supplying Git/process capability",
502
502
  "protocol": "Git tree and batched blob transport through the shared process owner",
503
- "normalization": "Returns {refresh,close,drain,dispose}; refresh yields {revision,files:[{path,content}]}, shares concurrent work, reuses unchanged revisions, preserves exact UTF-8 text, isolates caller cancellation and drains accepted work. Optional remoteBase explicitly selects remote as a local filesystem locator and derives only its Git fetch argument through path.resolve(remoteBase, remote), once at construction independently of the cache location and later working-directory changes. A relative base, including an empty string, uses the construction-time working directory; original locator/options remain unchanged. Omission preserves every Git remote name, URL, SCP-like address and remote-helper string without guessed parsing. Unrepresentable base text reports TypeError without transformation; existing Git failures remain errors. Optional gitIdentity captures name/email/username for child Git commands including bare init and fetch, without changing config files, payloads or shared acquisition lifetime. See git-text-snapshot.md."
503
+ "normalization": "Returns {refresh,close,drain,dispose}; refresh yields {revision,files:[{path,content}]}, shares concurrent work, reuses unchanged revisions, preserves exact UTF-8 text, isolates caller cancellation and drains accepted work. Optional allowUnborn defaults false, preserving that shape and command sequence. Explicit true first observes the complete remote advertisement; successful empty stdout yields revision:null, files:[], unborn:true. Any advertised HEAD, branch, tag or other output retains normal selected-ref fetch and actual errors; committed results add unborn:false, including a real empty tree. Every acquisition reobserves rather than returning stale empty state; cache role, identity, cancellation and drain remain unchanged. Optional remoteBase explicitly selects remote as a local filesystem locator and derives only its Git remote argument through path.resolve(remoteBase, remote), once at construction independently of the cache location and later working-directory changes. A relative base, including an empty string, uses the construction-time working directory; original locator/options remain unchanged. Omission preserves every Git remote name, URL, SCP-like address and remote-helper string without guessed parsing. Unrepresentable base text reports TypeError without transformation; existing Git failures remain errors. Optional gitIdentity captures name/email/username for child Git commands including bare init and fetch, without changing config files, payloads or shared acquisition lifetime. See git-text-snapshot.md."
504
504
  },
505
505
  {
506
506
  "id": "diarization:createDiarization",
@@ -4304,7 +4304,7 @@
4304
4304
  "summary": "Describes existing Core method input, output and semantic shapes.",
4305
4305
  "availability": "Node and browser/bundler",
4306
4306
  "protocol": "arcane/1 method descriptions",
4307
- "normalization": "Descriptive data only, including independent localai.devices inventory and localai.resolveTarget physical-selection records; presence does not establish engine support or observed execution. The active host and its registered services remain the authority for method availability"
4307
+ "normalization": "Descriptive data only, including independent localai.devices inventory and localai.resolveTarget physical-selection records; presence does not establish engine support or observed execution. Native notifications.status/show/state/close describe actual host support, exact caller content, retained host-lifetime outcomes and explicit owned removal; native submission does not establish display or human receipt. The active host and its registered services remain the authority for method availability"
4308
4308
  },
4309
4309
  {
4310
4310
  "id": "core-contracts:CoreError",
@@ -4360,7 +4360,7 @@
4360
4360
  "summary": "Projects a Core client into the established application-facing Arcane namespace.",
4361
4361
  "availability": "Browser and native WebView JavaScript hosts with a Core client",
4362
4362
  "protocol": "arcane/1 compatibility facade",
4363
- "normalization": "Routes namespace methods through client.invoke while retaining operation-specific parameters, correlation, streaming callbacks, timeouts and cancellation; window.state({signal}?) reads the requesting window and window.setState({state},{signal}?) selects normal, maximized or fullscreen. The matching Windows host returns {platform:'windows',supported:true,state}, including observed minimized state, restores normal bounds/frame controls on leaving fullscreen and prevents activation/focus assignment during visible state transitions without changing TopMost, Core, origin or profile. Saved Settings remain application-owned; cancellation does not undo an applied change and unavailable hosts retain their actual errors without fallback. window.setTheme(presentation,{signal}?) forwards the complete per-window backgroundColor/textColor record, with omitted fields unchanged and null reset, and returns the host's actual applied/unsupported result without changing system appearance"
4363
+ "normalization": "Routes namespace methods through client.invoke while retaining operation-specific parameters, correlation, streaming callbacks, timeouts and cancellation; window.state({signal}?) reads the requesting window and window.setState({state},{signal}?) selects normal, maximized or fullscreen. The matching Windows host returns {platform:'windows',supported:true,state}, including observed minimized state, restores normal bounds/frame controls on leaving fullscreen and prevents activation/focus assignment during visible state transitions without changing TopMost, Core, origin or profile. Saved Settings remain application-owned; cancellation does not undo an applied change and unavailable hosts retain their actual errors without fallback. window.setTheme(presentation,{signal}?) forwards the complete per-window backgroundColor/textColor record, with omitted fields unchanged and null reset, and returns the host's actual applied/unsupported result without changing system appearance. notifications.status/show/state/close forward complete caller requests and standard invoke options; status normalizes only METHOD_NOT_ALLOWED with core-namespace-unavailable while retaining the complete original error. Matching native window hosts retain complete notification records and ordered revisions across renderer navigation, with notifications.state events and subscribe-before-snapshot recovery. Submitted means native Show returned, not displayed or read; cancellation after submission does not remove an accepted notice, and explicit close retains its record. Recipient, text, trigger, deduplication and navigation policy remains application-owned"
4364
4364
  },
4365
4365
  {
4366
4366
  "id": "core-client:installCoreClient",
@@ -0,0 +1,167 @@
1
+ # Native application diagnostics
2
+
3
+ Native diagnostics retain errors from the actual packaged application's top-level
4
+ document in its native host session. Read them through the existing app-control
5
+ connection, without foregrounding a window, desktop input, or arbitrary script
6
+ execution. This is a developer inspection surface, separate from ordinary product
7
+ status and saved conversation history.
8
+
9
+ The Windows WebView2 host installs the fixed observer at document creation, before
10
+ the ordinary Core client and application scripts. It captures `window.error` and
11
+ `unhandledrejection` events and accepts explicit reports of application-caught
12
+ errors. It leaves the browser's ordinary error behavior intact. It does not
13
+ intercept console output, inspect application state, collect resource/request
14
+ bodies, or capture errors from other applications or frame documents.
15
+
16
+ ## Report a caught application error
17
+
18
+ ```js
19
+ import {reportNativeError} from 'arcane-os/core/native-diagnostics';
20
+
21
+ const receipt = await reportNativeError(error, {
22
+ details: {operation: 'source.load', sourceId}
23
+ });
24
+ // receipt: {accepted: true, sessionId, sequence}
25
+ ```
26
+
27
+ `error` is the actual caught value, including non-Error rejection values.
28
+ `details` is optional application-selected diagnostic context. Supply diagnostic
29
+ information only; credentials, secrets, user documents and provider/tool payloads
30
+ do not belong in this report. The SDK adds document/session metadata outside the
31
+ reported values and does not rewrite their text. Reporting does not change the
32
+ application's own handling of the original failure.
33
+
34
+ The promise resolves after the native host retains the record. A missing document
35
+ observer or native handler rejects with
36
+ `ARCANE_NATIVE_DIAGNOSTICS_UNAVAILABLE`. A negative host acknowledgement rejects
37
+ with `ARCANE_NATIVE_DIAGNOSTIC_REJECTED`, preserving the complete host reply in
38
+ `details` and its error in `cause`. Reflection, encoding and native transport
39
+ failures reject with their actual error. A lost reply can leave the caller's
40
+ outcome unknown; the SDK does not automatically retry and duplicate the report.
41
+
42
+ Automatic capture observes its own reporting failures through the existing
43
+ console, with the original error, without recursively manufacturing an unhandled
44
+ rejection. Console output remains ordinary console output; it is not retained
45
+ diagnostic history. Applications must observe explicit reporting promises.
46
+
47
+ ## Retrieve retained errors
48
+
49
+ Use the endpoint of the selected running app from its existing app-control launch
50
+ configuration. Connecting does not launch the application.
51
+
52
+ ```js
53
+ import {connectAppControl} from 'arcane-os/core/app-control';
54
+
55
+ const control = await connectAppControl({endpoint});
56
+ try {
57
+ const snapshot = await control.diagnostics();
58
+ console.dir(snapshot, {depth: null});
59
+ } finally {
60
+ await control.close();
61
+ }
62
+ ```
63
+
64
+ `control.diagnostics({afterSequence?, documentId?}, {signal?})` invokes
65
+ `app.control.diagnostics`. Omitted filters return every retained error.
66
+ `afterSequence` selects records with a greater session sequence;
67
+ `documentId` selects one actual document. Retrieval is non-consuming: independent
68
+ inspectors can read the same complete records. Connection/cancellation behavior is
69
+ the existing app-control contract. Retrieval does not wait for renderer, Core,
70
+ model or application readiness and does not evaluate a script in the document.
71
+
72
+ The result is:
73
+
74
+ ```js
75
+ {
76
+ sessionId,
77
+ captureStartedAt,
78
+ captureInstalled,
79
+ latestSequence,
80
+ documents: [{documentId, documentUrl, time, receivedAt}],
81
+ records: [{
82
+ sequence, receivedAt, documentId, documentUrl, time,
83
+ kind, error, details, valueFormat, values, location, message
84
+ }]
85
+ }
86
+ ```
87
+
88
+ `sessionId` identifies this native window/host lifetime. `captureStartedAt` is the
89
+ time its in-memory ledger was created. `captureInstalled` means document-start
90
+ script registration completed; it does not prove that any application failure
91
+ occurred or that a particular operation succeeded. `documents` records actual
92
+ ingress from observed documents. Each document has one identity, shared with app
93
+ control, independent of Core bridge generations. A cancelled navigation that
94
+ leaves the same document alive keeps that identity.
95
+
96
+ `sequence` is assigned when an error is retained, in host arrival order.
97
+ `latestSequence` describes the whole session even when filters select fewer
98
+ records. `time` comes from document capture; `receivedAt` comes from the host.
99
+ `kind` is `window.error`, `unhandledrejection`, or `application`. Window errors
100
+ include `location: {file, line, column}` when the browser exposes those fields.
101
+ Their browser `message` is retained separately from `error`, preserving a null
102
+ or undefined error value rather than replacing it with that message.
103
+ `details` and `location` are otherwise omitted.
104
+
105
+ Records survive document navigation and Core transport failure within the host
106
+ session. Closing the inspector leaves them retained. Closing the native host ends
107
+ the session; this API does not persist, migrate, prune, or recover records across
108
+ host restarts. An empty snapshot means no matching records were retained in this
109
+ session, not that earlier failures never occurred. Errors before capture existed,
110
+ handled failures never explicitly reported, errors the browser does not expose,
111
+ and vanished documents whose pending reports never reached the host remain
112
+ unavailable. Earlier never-retained failures cannot be reconstructed through this API.
113
+
114
+ ## Complete error property representation
115
+
116
+ Each record uses `valueFormat: 'arcane.diagnostic-value/1'`. `error` and optional
117
+ `details` are roots into the single `values` graph. JSON-native primitives remain
118
+ their original values. Undefined, bigint, non-finite numbers and negative zero
119
+ have explicit typed representations. `{ref: id}` identifies a graph node.
120
+ Repeated references and cycles retain the same identity within the record.
121
+
122
+ Object nodes retain every own property descriptor, including non-enumerable and
123
+ symbol-keyed fields. This includes full Error messages and stacks, `cause`,
124
+ AggregateError members and custom diagnostic details. Standard error fields
125
+ inherited from a prototype appear in `inherited`. Data descriptors contain
126
+ `value`; accessor descriptors contain references for `get` and `set` without
127
+ invoking either function. An accessor supplied as the `details` option is likewise
128
+ represented rather than called. No `toJSON` method on reported content is called.
129
+ Maps and sets retain their entries, dates their numeric time, and regular
130
+ expressions their source and flags, alongside their own properties.
131
+
132
+ This is a diagnostic property representation, not an executable object snapshot:
133
+ functions retain their property identity, not executable closures; platform-private
134
+ internal state and private class fields are not observable properties. The host
135
+ stores and returns the graph without reconstructing or executing those objects.
136
+ An object that rejects reflection causes an observable reporting failure rather
137
+ than a silently incomplete success. Inspect the complete graph in developer
138
+ diagnostics; do not flatten it into ordinary chat or user-facing status.
139
+
140
+ ## Host ownership and availability
141
+
142
+ `installNativeDiagnostics(globalThis)` installs one observer per document and
143
+ returns its owner `{documentId, ready, report}`. `ready` resolves after the document
144
+ announcement is accepted, and `report` has the same report contract. Importing
145
+ the ESM module alone installs no observer. The packaged native host owns
146
+ installation and lifetime; ordinary applications use `reportNativeError`.
147
+
148
+ `createNativeDiagnosticsSource()` from
149
+ `arcane-os/core/native-diagnostics-source` projects that same canonical helper
150
+ into the top-level document-start script. It adds no second observer or serializer.
151
+ Windows binds the script to the dedicated `arcaneDiagnostics.Send` host object.
152
+ This route is independent of `arcaneBridge` and the Core subprocess. Host close
153
+ stops new ingress and removes the object/script during existing shutdown.
154
+
155
+ The implementation here supplies Windows WebView2 capture and app-control
156
+ retrieval. macOS, Linux and Android require their native host ingress/session and
157
+ app-control adapters; this source change does not claim those adapters exist.
158
+ The helper recognizes the same fixed-name WebKit reply handler when a host
159
+ provides it; that transport seam is not platform availability. A browser preview
160
+ cannot establish actual native acceptance.
161
+
162
+ Native delivery requires the corresponding rebuilt SDK Windows host asset and
163
+ consumer adoption through the published SDK package. Source inspection, authored
164
+ fixtures and configured capture are distinct from executed built-application
165
+ verification. Existing host stderr/log diagnostics, live Core events, readiness
166
+ replay and `Arcane.diagnostics.recentErrors/get` retain their existing semantics;
167
+ this API does not turn them into a historical error service.
@@ -5409,7 +5409,7 @@ a dedicated bare Git cache. It does not create or alter a working checkout.
5409
5409
  ### Signature, lifecycle, and result
5410
5410
 
5411
5411
  ```text
5412
- createGitTextSnapshot({cacheDirectory,remote,remoteBase,ref,selectPath,gitIdentity,onEvent,run=runProcess}={})
5412
+ createGitTextSnapshot({cacheDirectory,remote,remoteBase,ref,selectPath,allowUnborn=false,gitIdentity,onEvent,run=runProcess}={})
5413
5413
  ```
5414
5414
 
5415
5415
  Import from `arcane-os`. The application owns the cache location, remote, ref,
@@ -5421,6 +5421,14 @@ await accepted refresh/process cleanup. Errors remain observable instead of
5421
5421
  returning stale or partial success. See [Git text snapshots](git-text-snapshot.md)
5422
5422
  for complete inputs, text semantics, errors, events and Core service composition.
5423
5423
 
5424
+ Optional `allowUnborn:true` observes the complete remote advertisement on every
5425
+ acquisition. Only successful empty output returns
5426
+ `{revision:null,files:[],unborn:true}`; committed results add `unborn:false` and
5427
+ retain the actual commit even for an empty tree. Any advertised HEAD, branch
5428
+ or tag continues through ordinary selected-ref fetch; missing refs and actual
5429
+ Git failures remain errors. Omitted/false preserves the prior result and commands.
5430
+ See [unborn remotes](git-text-snapshot.md#unborn-remotes).
5431
+
5424
5432
  Optional `remoteBase` explicitly selects `remote` as a local filesystem locator.
5425
5433
  Only its Git fetch argument is derived using `path.resolve(remoteBase, remote)`,
5426
5434
  once at construction, independently of the cache location and later changes to
@@ -5476,6 +5484,28 @@ once and stdin remains open until cancellation or a callback/input failure
5476
5484
  requests shutdown. On Microsoft NT, `npm` and `npx` are normalized to their Node
5477
5485
  CLI entrypoints.
5478
5486
 
5487
+ For the literal `git` command on Windows, the default runner reads Git for
5488
+ Windows' registered `InstallPath` in the current-user and machine registry
5489
+ views. When that installation's `cmd/git.exe` exists, its `cmd` directory is
5490
+ appended only to this child's effective PATH. Existing entries and native
5491
+ command lookup retain priority; duplicate `Path`/`PATH` spellings follow Node's
5492
+ lexical selection. Other environment fields, explicit executable paths,
5493
+ custom process adapters, other commands and other platforms keep their existing
5494
+ behavior. No global environment or registry setting is changed, and no Git
5495
+ download, installation or command retry occurs.
5496
+
5497
+ One successful location is retained in memory for this process while its
5498
+ executable remains present. A removed executable triggers fresh discovery;
5499
+ absent, failed and cancelled lookups are not retained. Concurrent cold callers
5500
+ own independent discovery and cancellation. The standard Windows registry
5501
+ helper uses the existing process owner; its lifecycle callbacks have
5502
+ `process.git.discovery.*` event names, and its captured metadata is separate
5503
+ from the requested command's output. Missing registration leaves ordinary
5504
+ lookup unchanged. Discovery failure emits `process.git.discovery.unavailable`
5505
+ with the complete error before ordinary lookup continues. Cancellation or an
5506
+ event-callback failure stops the operation before Git starts. Normal Git
5507
+ errors and missing-working-directory errors remain actual command failures.
5508
+
5479
5509
  An `AsyncIterable` input instead feeds stdin with awaited writes and closes it
5480
5510
  when the producer finishes. Its `return()` must cooperate with cancellation of
5481
5511
  an outstanding `next()`; the process owner drains both input and output work.
@@ -8400,7 +8430,7 @@ explicit existing path. The application owns the remote, branch and Core API.
8400
8430
  ### Signature and result
8401
8431
 
8402
8432
  ```text
8403
- createRepositoryWorkspace({name,directory,dataRoot,remote,remoteBase,branch,longPaths,cloneIdentity,gitIdentity,onEvent,run=runProcess}={})
8433
+ createRepositoryWorkspace({name,directory,dataRoot,remote,remoteBase,branch,initialBranch,longPaths,cloneIdentity,gitIdentity,onEvent,run=runProcess}={})
8404
8434
  ```
8405
8435
 
8406
8436
  Returns `{directory,open,status,configuration,pull,push,write,close,drain,dispose}`. Construction does
@@ -8411,6 +8441,17 @@ work and preserves the checkout. No CLI cwd, launch state, preference, snapshot
8411
8441
  cache or existing user-data location changes. See the [complete inputs, results,
8412
8442
  errors and lifecycle](core-repositories.md#one-connected-working-checkout).
8413
8443
 
8444
+ Optional `initialBranch` selects `refs/heads/<initialBranch>` only after a new
8445
+ clone, successful complete empty remote advertisement, explicit local
8446
+ initial-state observation and a successful empty local-ref listing. Any local
8447
+ ref supplied by a Git template or hook remains unchanged. Existing destinations and committed/advertised
8448
+ clones keep their branches; `branch` still means Git's existing-branch/tag clone
8449
+ selection. New-clone `open` results with this option add complete ordered
8450
+ preparation `outputs`; subsequent failures retain completed outputs and their
8451
+ original cause. Omission adds no command or result field. See
8452
+ [first-publication composition](core-repositories.md#first-publication-from-an-unborn-remote)
8453
+ for the direct first commit/push without an implicit pull.
8454
+
8414
8455
  Optional factory `remoteBase` explicitly selects the initial-clone `remote` as
8415
8456
  a local filesystem locator. Only its Git argument is derived through the host's
8416
8457
  native `path.resolve(remoteBase, remote)`, once at construction. Relative bases,
@@ -8446,13 +8487,17 @@ omitted fields remain inherited. Username remains a credential hint, with
8446
8487
  authentication owned by ordinary Git and its configured helper.
8447
8488
 
8448
8489
  `configuration({signal})` observes an existing working root without clone,
8449
- initialization or fetch. It returns `{repositoryRoot,headRef,origin,upstream}`:
8490
+ initialization or fetch. It returns `{repositoryRoot,headRef,revision,unborn,origin,upstream}`:
8450
8491
  full symbolic HEAD (including unborn, null when detached), origin URL/pushURL
8451
8492
  arrays and current branch remote/merge/URL/pushURL arrays. Unset, empty and
8452
- repeated configuration values remain distinct. These are ordinary configured
8453
- values, not authentication or endpoint proof, and are not atomic with later
8454
- operations. Raw stdout is decoded without replacement; unrepresentable text
8455
- reports `ARCANE_GIT_CONFIGURATION_NOT_TEXT` with full diagnostics.
8493
+ repeated configuration values remain distinct. `revision:null,unborn:true`
8494
+ comes only from Git's explicit porcelain-v2 initial state; committed and
8495
+ detached states retain their current revision with `unborn:false`. Missing
8496
+ branch-state output reports `ARCANE_REPOSITORY_HEAD_UNAVAILABLE`. These are
8497
+ ordinary configured values and local branch observations, not authentication
8498
+ or endpoint proof, and are not atomic with later operations. Raw stdout is
8499
+ decoded without replacement; unrepresentable text reports
8500
+ `ARCANE_GIT_CONFIGURATION_NOT_TEXT` with full diagnostics.
8456
8501
 
8457
8502
  `pull({target,signal})`, `push({target,signal})` and
8458
8503
  `write({files:[{path,content}],message,target,signal})` accept optional
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "arcane-os",
3
- "version": "0.91.0",
3
+ "version": "0.93.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",
@@ -65,6 +65,8 @@
65
65
  "./core/stdio": "./src/core/stdio.mjs",
66
66
  "./core/host": "./src/core/host.mjs",
67
67
  "./core/app-control": "./src/core/app-control.mjs",
68
+ "./core/native-diagnostics": "./browser-runtime/core/native-diagnostics.mjs",
69
+ "./core/native-diagnostics-source": "./src/core-native-diagnostics-source.mjs",
68
70
  "./codex/app-server": "./src/codex/app-server.mjs",
69
71
  "./mcp/stdio": "./src/mcp/stdio-server.mjs",
70
72
  "./core/repositories": "./src/core/repositories.mjs",
@@ -15,6 +15,7 @@ export async function connectAppControl({endpoint, signal, onError = reportAppCo
15
15
  endpoint,
16
16
  closed: connection.closed,
17
17
  status(options) { return client.invoke('app.control.status', {}, options); },
18
+ diagnostics(parameters = {}, options) { return client.invoke('app.control.diagnostics', parameters, options); },
18
19
  inspect(parameters = {}, options) { return client.invoke('app.control.inspect', parameters, options); },
19
20
  capture(parameters = {}, options) { return client.invoke('app.control.capture', parameters, options); },
20
21
  act(parameters, options) { return client.invoke('app.control.act', parameters, options); },
@@ -452,7 +452,7 @@ namespace Arcane.Core.Hosts.Windows
452
452
  try
453
453
  {
454
454
  cancellation.Token.ThrowIfCancellationRequested();
455
- if (method != "app.control.status" && method != "app.control.inspect"
455
+ if (method != "app.control.status" && method != "app.control.diagnostics" && method != "app.control.inspect"
456
456
  && method != "app.control.capture" && method != "app.control.act"
457
457
  && method != "app.control.key" && method != "app.control.resize")
458
458
  throw new NotSupportedException("The app does not expose " + method + ".");