arcane-os 0.1.0-dev.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +154 -0
- package/COMMERCIAL-LICENSE.md +13 -0
- package/LICENSE +661 -0
- package/NOTICE +70 -0
- package/README.md +448 -0
- package/bin/arcane-test.mjs +741 -0
- package/bin/arcane.mjs +5 -0
- package/docs/architecture.md +234 -0
- package/docs/compatibility.md +36 -0
- package/docs/event-manager.md +166 -0
- package/docs/platform-targets.md +108 -0
- package/docs/publishing.md +203 -0
- package/docs/reference/README.md +117 -0
- package/docs/reference/arcane-ollama.md +288 -0
- package/docs/reference/availability-and-normalization.md +123 -0
- package/docs/reference/behavioral-testing.md +86 -0
- package/docs/reference/cli.md +569 -0
- package/docs/reference/core/README.md +62 -0
- package/docs/reference/core/arcane-ai-contracts.md +873 -0
- package/docs/reference/core/arcane-api.md +601 -0
- package/docs/reference/core/arcane-entities.md +65 -0
- package/docs/reference/core/arcane-events.md +134 -0
- package/docs/reference/core/ollama-module.md +181 -0
- package/docs/reference/core/reference/arcane-api/ai-and-ollama.md +1909 -0
- package/docs/reference/core/reference/arcane-api/applications-terminal-capabilities.md +1057 -0
- package/docs/reference/core/reference/arcane-api/core-and-events.md +320 -0
- package/docs/reference/core/reference/arcane-api/filesystem-storage-preferences-appearance.md +610 -0
- package/docs/reference/core/reference/arcane-api/namespaces.md +1157 -0
- package/docs/reference/core/reference/arcane-api/platform-installation-users-system.md +1423 -0
- package/docs/reference/core/reference/arcane-api/session-provisioning-diagnostics-development.md +315 -0
- package/docs/reference/event-manager.md +957 -0
- package/docs/reference/inventory/package-api.json +2632 -0
- package/docs/reference/inventory/runtime-components.json +934 -0
- package/docs/reference/inventory/runtime-entities.json +26 -0
- package/docs/reference/inventory/runtime-modules.json +1249 -0
- package/docs/reference/protocols.md +242 -0
- package/docs/reference/runtime-components.md +1098 -0
- package/docs/reference/runtime-entities.md +303 -0
- package/docs/reference/runtime-modules.md +2010 -0
- package/docs/reference/sdk-api.md +4901 -0
- package/docs/roadmap.md +79 -0
- package/docs/work-amplification.md +124 -0
- package/node_modules/event-pubsub/CHANGELOG.md +55 -0
- package/node_modules/event-pubsub/MIGRATION.md +70 -0
- package/node_modules/event-pubsub/README.md +363 -0
- package/node_modules/event-pubsub/SECURITY.md +37 -0
- package/node_modules/event-pubsub/index.js +141 -0
- package/node_modules/event-pubsub/licence +21 -0
- package/node_modules/event-pubsub/package.json +59 -0
- package/node_modules/strong-type/README.md +408 -0
- package/node_modules/strong-type/assets/strong-type-header.png +0 -0
- package/node_modules/strong-type/index.js +1151 -0
- package/node_modules/strong-type/licence +21 -0
- package/node_modules/strong-type/node.js +125 -0
- package/node_modules/strong-type/package.json +61 -0
- package/package.json +95 -0
- package/runtime/ARCANE_RUNTIME_RELEASE.json +791 -0
- package/runtime/arcane/components/app-bar.html +468 -0
- package/runtime/arcane/components/assistant-panel.html +715 -0
- package/runtime/arcane/components/calculator.html +8 -0
- package/runtime/arcane/components/chart.html +655 -0
- package/runtime/arcane/components/chat.html +1225 -0
- package/runtime/arcane/components/conversation-view.html +13 -0
- package/runtime/arcane/components/dashboard-config.html +341 -0
- package/runtime/arcane/components/data-maintenance.html +112 -0
- package/runtime/arcane/components/data-view.html +92 -0
- package/runtime/arcane/components/directory-picker.html +197 -0
- package/runtime/arcane/components/document-inspector.html +252 -0
- package/runtime/arcane/components/file-drop.html +264 -0
- package/runtime/arcane/components/file-inspector.html +293 -0
- package/runtime/arcane/components/file-manager.html +1715 -0
- package/runtime/arcane/components/header.html +142 -0
- package/runtime/arcane/components/integration-settings.html +14 -0
- package/runtime/arcane/components/local-ai-status.html +360 -0
- package/runtime/arcane/components/markdown-document.html +1048 -0
- package/runtime/arcane/components/markdown-editor.html +360 -0
- package/runtime/arcane/components/media-embed.html +8 -0
- package/runtime/arcane/components/modal.html +402 -0
- package/runtime/arcane/components/output-panel.html +259 -0
- package/runtime/arcane/components/preferences-form.html +135 -0
- package/runtime/arcane/components/record-timeline.html +105 -0
- package/runtime/arcane/components/relationship-board.html +116 -0
- package/runtime/arcane/components/screen-capture.html +8 -0
- package/runtime/arcane/components/source-code-viewer.html +441 -0
- package/runtime/arcane/components/source-explanation.html +124 -0
- package/runtime/arcane/components/speech.html +365 -0
- package/runtime/arcane/components/summary-strip.html +177 -0
- package/runtime/arcane/components/table.html +77 -0
- package/runtime/arcane/components/task-progress.html +282 -0
- package/runtime/arcane/components/terminal-workspace.html +65 -0
- package/runtime/arcane/components/theme-editor.html +41 -0
- package/runtime/arcane/components/theme-switcher.html +46 -0
- package/runtime/arcane/components/unified-inbox.html +20 -0
- package/runtime/arcane/components/voice-transcription.html +476 -0
- package/runtime/arcane/components/weather-widget.html +8 -0
- package/runtime/arcane/components/web-navigator.html +239 -0
- package/runtime/arcane/css/communications.css +1 -0
- package/runtime/arcane/css/dashboard-config.css +45 -0
- package/runtime/arcane/css/document-site.css +981 -0
- package/runtime/arcane/css/layout.css +438 -0
- package/runtime/arcane/css/primitives.css +321 -0
- package/runtime/arcane/css/theme.css +112 -0
- package/runtime/arcane/css/utility-workspace.css +1 -0
- package/runtime/arcane/entities/ApiModelRecord.js +20 -0
- package/runtime/arcane/entities/Calculation.js +13 -0
- package/runtime/arcane/entities/Chat.js +581 -0
- package/runtime/arcane/entities/CommunicationMessage.js +29 -0
- package/runtime/arcane/entities/CommunicationThread.js +21 -0
- package/runtime/arcane/entities/Document.js +10 -0
- package/runtime/arcane/entities/File.js +143 -0
- package/runtime/arcane/entities/Image.js +135 -0
- package/runtime/arcane/entities/IntentEnvelope.js +834 -0
- package/runtime/arcane/entities/Preference.js +83 -0
- package/runtime/arcane/entities/TWiNPolicyDecision.js +1092 -0
- package/runtime/arcane/entities/TerminalSession.js +46 -0
- package/runtime/arcane/entities/Theme.js +107 -0
- package/runtime/arcane/entities/User.js +1046 -0
- package/runtime/arcane/entities/Weather.js +23 -0
- package/runtime/arcane/img/arcane-os-everywhere.png +0 -0
- package/runtime/arcane/img/arrow-left.png +0 -0
- package/runtime/arcane/img/arrow-right.png +0 -0
- package/runtime/arcane/img/doc.svg +5 -0
- package/runtime/arcane/img/folder.svg +4 -0
- package/runtime/arcane/img/image.svg +5 -0
- package/runtime/arcane/img/refresh.png +0 -0
- package/runtime/arcane/img/send.svg +9 -0
- package/runtime/arcane/img/trash.svg +5 -0
- package/runtime/arcane/img/upload.svg +5 -0
- package/runtime/arcane/modules/AI.js +2048 -0
- package/runtime/arcane/modules/AIPreferenceRuntime.js +32 -0
- package/runtime/arcane/modules/AIPreferenceTuple.js +92 -0
- package/runtime/arcane/modules/AIResponseLength.js +42 -0
- package/runtime/arcane/modules/AIResponseURLPolicy.js +626 -0
- package/runtime/arcane/modules/AnsiText.js +53 -0
- package/runtime/arcane/modules/ApiModelDatabase.js +25 -0
- package/runtime/arcane/modules/AppDataScope.js +245 -0
- package/runtime/arcane/modules/AppearancePreferences.js +28 -0
- package/runtime/arcane/modules/ArcaneCommunicationBridge.js +22 -0
- package/runtime/arcane/modules/ArcaneNavigationPolicy.js +135 -0
- package/runtime/arcane/modules/ArcaneNetworkPolicy.js +255 -0
- package/runtime/arcane/modules/AsyncBoundary.js +161 -0
- package/runtime/arcane/modules/BrowserTestSuite.js +326 -0
- package/runtime/arcane/modules/CalculatorEngine.js +20 -0
- package/runtime/arcane/modules/CaseEvidenceIndexer.js +134 -0
- package/runtime/arcane/modules/ChartLibrary.js +35 -0
- package/runtime/arcane/modules/ChatRecords.js +13 -0
- package/runtime/arcane/modules/CommunicationAppController.js +43 -0
- package/runtime/arcane/modules/CommunicationHub.js +16 -0
- package/runtime/arcane/modules/CommunicationPreferences.js +13 -0
- package/runtime/arcane/modules/CommunicationProviderRegistry.js +16 -0
- package/runtime/arcane/modules/ComponentContracts.js +586 -0
- package/runtime/arcane/modules/ConfiguredAIChatSession.js +288 -0
- package/runtime/arcane/modules/ConversationActionItems.js +488 -0
- package/runtime/arcane/modules/ConversationClosingReport.js +274 -0
- package/runtime/arcane/modules/ConversationTimebox.js +527 -0
- package/runtime/arcane/modules/CoreLocalModelCatalog.js +255 -0
- package/runtime/arcane/modules/DBLS.js +171 -0
- package/runtime/arcane/modules/DBOPFS.js +1154 -0
- package/runtime/arcane/modules/DBOPFSWorker.js +116 -0
- package/runtime/arcane/modules/DataMaintenance.js +91 -0
- package/runtime/arcane/modules/DevelopmentWorkspace.js +74 -0
- package/runtime/arcane/modules/DirectoryPicker.js +109 -0
- package/runtime/arcane/modules/DocumentNavigation.js +223 -0
- package/runtime/arcane/modules/Errors.js +1025 -0
- package/runtime/arcane/modules/GifEncoder.js +29 -0
- package/runtime/arcane/modules/HTMLImport.js +114 -0
- package/runtime/arcane/modules/InMemoryCommunicationProvider.js +14 -0
- package/runtime/arcane/modules/IsolatedModelQuestionRunner.js +275 -0
- package/runtime/arcane/modules/LocalAIReadiness.js +870 -0
- package/runtime/arcane/modules/LocalAIReadinessController.js +156 -0
- package/runtime/arcane/modules/MD.js +111 -0
- package/runtime/arcane/modules/Mail.js +352 -0
- package/runtime/arcane/modules/MailTransport.mjs +180 -0
- package/runtime/arcane/modules/Marked.min.js +71 -0
- package/runtime/arcane/modules/MemoryRecords.js +44 -0
- package/runtime/arcane/modules/MessageAdvisory.js +38 -0
- package/runtime/arcane/modules/ModelDefinition.js +189 -0
- package/runtime/arcane/modules/Ollama.js +74 -0
- package/runtime/arcane/modules/OllamaModelIdentifier.js +21 -0
- package/runtime/arcane/modules/OllamaSettings.js +24 -0
- package/runtime/arcane/modules/OpenMeteoWeatherProvider.js +14 -0
- package/runtime/arcane/modules/PreferenceStore.js +109 -0
- package/runtime/arcane/modules/QRCode.min.js +1 -0
- package/runtime/arcane/modules/Questionnaire.js +61 -0
- package/runtime/arcane/modules/RecordLinkIndex.js +24 -0
- package/runtime/arcane/modules/RecordPassageIndex.js +222 -0
- package/runtime/arcane/modules/RecordReviewStore.js +94 -0
- package/runtime/arcane/modules/RevocableProjectionLedger.js +1623 -0
- package/runtime/arcane/modules/RiskSignalAnalyzer.js +37 -0
- package/runtime/arcane/modules/ScamRiskPolicy.js +62 -0
- package/runtime/arcane/modules/ScopedOPFSCache.js +183 -0
- package/runtime/arcane/modules/ScreenCapture.js +20 -0
- package/runtime/arcane/modules/SpeechPlayback.js +581 -0
- package/runtime/arcane/modules/StaticDocumentCatalog.js +1248 -0
- package/runtime/arcane/modules/SystemAppearance.js +20 -0
- package/runtime/arcane/modules/SystemPlatformPresentation.js +51 -0
- package/runtime/arcane/modules/SystemToolRegistry.js +28 -0
- package/runtime/arcane/modules/TerminalClient.js +52 -0
- package/runtime/arcane/modules/TerminalCommandRegistry.js +50 -0
- package/runtime/arcane/modules/ThemeBootstrap.js +26 -0
- package/runtime/arcane/modules/ThemeManager.js +131 -0
- package/runtime/arcane/modules/TimeGuard.js +149 -0
- package/runtime/arcane/modules/ToolCallRouter.js +83 -0
- package/runtime/arcane/modules/WaitForComponent.js +102 -0
- package/runtime/arcane/modules/YouTubeMedia.js +16 -0
- package/runtime/arcane/modules/uPlot.LICENSE.txt +21 -0
- package/runtime/arcane/modules/uPlot.iife.min.js +2 -0
- package/runtime/arcane/modules/uPlot.min.css +1 -0
- package/runtime/arcane/security/arcane-network-policy.json +6 -0
- package/runtime/strong-type/index.js +352 -0
- package/runtime/strong-type/licence +21 -0
- package/runtime/strong-type/package.json +45 -0
- package/schemas/arcane-app-bundle.schema.json +125 -0
- package/schemas/arcane-app.schema.json +329 -0
- package/schemas/arcane-lock.schema.json +86 -0
- package/schemas/arcane-package.schema.json +224 -0
- package/schemas/cli-event.schema.json +122 -0
- package/schemas/event-stack.schema.json +152 -0
- package/schemas/native-build-plan.schema.json +176 -0
- package/schemas/target-adapter.schema.json +117 -0
- package/src/app-descriptor.mjs +500 -0
- package/src/cli/main.mjs +561 -0
- package/src/constants.mjs +31 -0
- package/src/dev-server.mjs +718 -0
- package/src/doctor.mjs +315 -0
- package/src/dom-event-instrumentation.mjs +594 -0
- package/src/errors.mjs +75 -0
- package/src/event-manager.mjs +1342 -0
- package/src/event-queue.mjs +138 -0
- package/src/events.mjs +219 -0
- package/src/index.mjs +177 -0
- package/src/integrated-provider-loader.mjs +432 -0
- package/src/native-plan.mjs +698 -0
- package/src/native-provider-loader.mjs +1126 -0
- package/src/packager/core.mjs +2691 -0
- package/src/process.mjs +353 -0
- package/src/release-bundle.mjs +2523 -0
- package/src/repository.mjs +90 -0
- package/src/runtime.mjs +452 -0
- package/src/scaffold.mjs +380 -0
- package/src/targets/index.mjs +436 -0
- package/src/templates/assets/app-icon.png +0 -0
- package/src/templates/workspace-template.mjs +388 -0
- package/src/testing-loader.mjs +9 -0
- package/src/testing.mjs +427 -0
- package/src/toolchain.mjs +1335 -0
- package/src/update-check.mjs +307 -0
- package/src/workspace.mjs +449 -0
|
@@ -0,0 +1,1157 @@
|
|
|
1
|
+
# Arcane API namespace guides
|
|
2
|
+
|
|
3
|
+
These namespace guides explain how related Arcane API members work together.
|
|
4
|
+
The individual method guides provide the exact parameters, resolved values,
|
|
5
|
+
errors, and focused examples for each call.
|
|
6
|
+
|
|
7
|
+
## Arcane.events
|
|
8
|
+
|
|
9
|
+
### Overview
|
|
10
|
+
|
|
11
|
+
`Arcane.events` is the application-facing event hub for messages delivered by
|
|
12
|
+
the bound Arcane host. It provides four synchronous subscription and observation
|
|
13
|
+
methods:
|
|
14
|
+
|
|
15
|
+
| Member | Use |
|
|
16
|
+
| --- | --- |
|
|
17
|
+
| `Arcane.events.on(eventName, listener)` | Observe every future matching event until unsubscribed. |
|
|
18
|
+
| `Arcane.events.once(eventName, listener)` | Observe the next future matching event, then unsubscribe automatically. |
|
|
19
|
+
| `Arcane.events.when(eventName, listener)` | Observe a designated durable completion, including an asynchronous replay when it already occurred. |
|
|
20
|
+
| `Arcane.events.completed(eventName)` | Check whether a designated durable completion has already been observed. |
|
|
21
|
+
|
|
22
|
+
Use a named subscription when the application knows the event it needs. A named
|
|
23
|
+
listener receives that event's data payload directly. A wildcard subscription
|
|
24
|
+
uses the event name `"*"` and receives an envelope shaped as
|
|
25
|
+
`{ event, data }`. Wildcard delivery is useful for bounded diagnostics, but it
|
|
26
|
+
should not replace named subscriptions in application logic. Some event
|
|
27
|
+
payloads can contain credentials or other sensitive values, so do not log
|
|
28
|
+
wildcard `data` indiscriminately.
|
|
29
|
+
|
|
30
|
+
See the [Arcane event catalog](../../arcane-events.md) for event names, triggers,
|
|
31
|
+
payloads, and host-specific availability.
|
|
32
|
+
|
|
33
|
+
### Delivery and replay model
|
|
34
|
+
|
|
35
|
+
Ordinary events are live and future-only. They are not retained for a late
|
|
36
|
+
subscriber. This includes progress, terminal streams, terminal exits, and
|
|
37
|
+
appearance changes. `on()` and `once()` never replay an earlier ordinary event.
|
|
38
|
+
|
|
39
|
+
Only `transport.ready` and `core.ready` are designated durable completions. The
|
|
40
|
+
first payload for each completion is snapshotted and frozen before listeners
|
|
41
|
+
run. Later occurrences do not replace it. `when()` delivers a future first
|
|
42
|
+
completion like a one-time subscription, or queues the stored first payload for
|
|
43
|
+
asynchronous delivery when the completion already occurred.
|
|
44
|
+
|
|
45
|
+
`transport.ready` means that the document selected a callable Arcane transport.
|
|
46
|
+
It does not prove that Core is healthy, that a method is admitted, or that a
|
|
47
|
+
capability is granted. `core.ready` reports the host's readiness event; use the
|
|
48
|
+
method-specific capability and status APIs for authorization and service state.
|
|
49
|
+
|
|
50
|
+
### Listener safety and cleanup
|
|
51
|
+
|
|
52
|
+
Every subscription method returns an unsubscribe function. Retain it and call it
|
|
53
|
+
when the component, view, or document no longer owns the listener. Calling an
|
|
54
|
+
unsubscribe function again is harmless.
|
|
55
|
+
|
|
56
|
+
Listener exceptions are caught and logged so one listener cannot stop delivery
|
|
57
|
+
to the remaining listeners. Handle expected failures inside the listener when
|
|
58
|
+
the application needs to surface or recover from them; an exception thrown by a
|
|
59
|
+
listener is not reported to the event producer.
|
|
60
|
+
|
|
61
|
+
### Example
|
|
62
|
+
|
|
63
|
+
```javascript
|
|
64
|
+
const events = globalThis.Arcane?.events;
|
|
65
|
+
|
|
66
|
+
if (!events?.on) {
|
|
67
|
+
throw new Error('Arcane event delivery is unavailable in this document.');
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
const unsubscribe = [
|
|
71
|
+
events.on('operation.progress', function reportOperationProgress(data) {
|
|
72
|
+
console.log('Operation progress', data.progress, data.message);
|
|
73
|
+
}),
|
|
74
|
+
events.on('*', function reportObservedEvent({event}) {
|
|
75
|
+
console.debug('Arcane event', event);
|
|
76
|
+
})
|
|
77
|
+
];
|
|
78
|
+
|
|
79
|
+
function stopObserving() {
|
|
80
|
+
for (const off of unsubscribe.splice(0)) {
|
|
81
|
+
off();
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
globalThis.addEventListener('pagehide', stopObserving, {once: true});
|
|
86
|
+
```
|
|
87
|
+
## Arcane.terminal
|
|
88
|
+
|
|
89
|
+
### Overview
|
|
90
|
+
|
|
91
|
+
`Arcane.terminal` owns a bounded native terminal-session lifecycle. It can start
|
|
92
|
+
and enumerate app-owned sessions, write input, update dimensions, send a
|
|
93
|
+
supported control signal, and request closure. Process output and final exit
|
|
94
|
+
state arrive through `Arcane.events`; they are not returned by `write()`,
|
|
95
|
+
`signal()`, or `close()`.
|
|
96
|
+
|
|
97
|
+
Terminal access is deliberately narrow. The bound application must have the
|
|
98
|
+
exact id `terminal`, must be granted `terminal.execute`, and must run through an
|
|
99
|
+
admitted Core or Android host. Other applications do not receive terminal access
|
|
100
|
+
by default, and a standalone browser preview is not a native terminal host.
|
|
101
|
+
|
|
102
|
+
### Availability and capability check
|
|
103
|
+
|
|
104
|
+
Feature detection answers whether the JavaScript surface was projected into the
|
|
105
|
+
document. `Arcane.capabilities.list()` confirms the bound application identity,
|
|
106
|
+
grants, and exact admitted RPC methods. Check both before presenting a terminal
|
|
107
|
+
workflow.
|
|
108
|
+
|
|
109
|
+
The complete namespace contains these methods:
|
|
110
|
+
|
|
111
|
+
| Member | Purpose |
|
|
112
|
+
| --- | --- |
|
|
113
|
+
| `Arcane.terminal.start(options?)` | Start one native session. |
|
|
114
|
+
| `Arcane.terminal.list()` | Return the wrapper containing current app-owned sessions. |
|
|
115
|
+
| `Arcane.terminal.write(sessionId, data)` | Write one nonempty UTF-8 input chunk. |
|
|
116
|
+
| `Arcane.terminal.resize(sessionId, columns, rows)` | Update the session's bounded dimensions. |
|
|
117
|
+
| `Arcane.terminal.signal(sessionId, signal?)` | Request `interrupt` or `terminate`. |
|
|
118
|
+
| `Arcane.terminal.close(sessionId)` | Request session closure. |
|
|
119
|
+
|
|
120
|
+
The host admits at most eight concurrent sessions for the application. Session
|
|
121
|
+
identifiers are opaque strings returned by `start()` or `list()`; do not invent,
|
|
122
|
+
parse, or persist them as durable identities.
|
|
123
|
+
|
|
124
|
+
### Session lifecycle
|
|
125
|
+
|
|
126
|
+
Subscribe to terminal events before calling `start()`. A newly spawned process
|
|
127
|
+
may produce output immediately, and the output forwarding path is active before
|
|
128
|
+
the start response reaches application code. Buffer early events by `sessionId`
|
|
129
|
+
until the returned session identifies the process of interest.
|
|
130
|
+
|
|
131
|
+
The normal lifecycle is:
|
|
132
|
+
|
|
133
|
+
1. Confirm the feature, application id, grant, and admitted methods.
|
|
134
|
+
2. Subscribe to `terminal.output`, `terminal.exit`, and `terminal.error`.
|
|
135
|
+
3. Call `start()` and retain the returned session object.
|
|
136
|
+
4. Use `write()`, `resize()`, and, when necessary, `signal()`.
|
|
137
|
+
5. Call `close()` when the application is finished with the session.
|
|
138
|
+
6. Treat `terminal.exit` as the process-completion observation.
|
|
139
|
+
7. Unsubscribe every listener during teardown.
|
|
140
|
+
|
|
141
|
+
An accepted write, signal, or close request is not command completion or process
|
|
142
|
+
exit. In particular, `close()` resolves when the host accepts the close request;
|
|
143
|
+
observe `terminal.exit` for the final process outcome.
|
|
144
|
+
|
|
145
|
+
### Shared values
|
|
146
|
+
|
|
147
|
+
`start()` resolves to this exact session shape:
|
|
148
|
+
|
|
149
|
+
| Property | Type | Meaning |
|
|
150
|
+
| --- | --- | --- |
|
|
151
|
+
| `id` | `string` | Opaque session identifier, at most 128 characters. |
|
|
152
|
+
| `shell` | `string` | Resolved shell name. |
|
|
153
|
+
| `cwd` | `string` | Resolved working directory. |
|
|
154
|
+
| `title` | `string` | Host-provided display title. |
|
|
155
|
+
| `columns` | `number` | Accepted column count, from 20 through 500. |
|
|
156
|
+
| `rows` | `number` | Accepted row count, from 5 through 200. |
|
|
157
|
+
| `createdAt` | `string` | Host timestamp for session creation. |
|
|
158
|
+
|
|
159
|
+
`list()` resolves to `{ sessions }`, not directly to an array. Each list entry
|
|
160
|
+
contains `id`, `shell`, `cwd`, `columns`, `rows`, `createdAt`, and `state`.
|
|
161
|
+
Supported state values are `starting`, `running`, `exited`, and `closed`, though a
|
|
162
|
+
host may remove a completed session from the current inventory promptly.
|
|
163
|
+
|
|
164
|
+
### Terminal events
|
|
165
|
+
|
|
166
|
+
Terminal events are ordinary, future-only events:
|
|
167
|
+
|
|
168
|
+
| Event | Trigger | Data payload |
|
|
169
|
+
| --- | --- | --- |
|
|
170
|
+
| `terminal.output` | The host reads a stdout or stderr chunk. | `{ sessionId, stream, data }`, where `stream` is `"stdout"` or `"stderr"` and `data` is a string. |
|
|
171
|
+
| `terminal.exit` | The process exits and the host retires the session. | `{ sessionId, exitCode, signal }`; `exitCode` or `signal` may be `null`. |
|
|
172
|
+
| `terminal.error` | A host reports an asynchronous stream/session error. | `{ sessionId, message }`; currently used by the Android provider for output-limit and stream-read failures. |
|
|
173
|
+
|
|
174
|
+
Output payloads are chunks, not lines. A chunk may contain part of a line,
|
|
175
|
+
several lines, or terminal control sequences. Preserve arrival order per session
|
|
176
|
+
and use a terminal-aware renderer when displaying native output.
|
|
177
|
+
|
|
178
|
+
### Platform behavior
|
|
179
|
+
|
|
180
|
+
On Microsoft NT Core hosts, `auto` resolves to PowerShell. PowerShell, Command
|
|
181
|
+
Prompt, and an installed Bash are selectable; POSIX `sh` is unavailable. On
|
|
182
|
+
Linux Core hosts, `auto` resolves to Bash, `sh` selects `/bin/sh`, PowerShell
|
|
183
|
+
requires an installed `pwsh`, and Command Prompt is unavailable.
|
|
184
|
+
|
|
185
|
+
On Android, terminal execution is confined to the Arcane Terminal application's
|
|
186
|
+
ordinary app identity and private files area. Only `auto` and `sh` are accepted,
|
|
187
|
+
and both resolve to the application-sandbox `/system/bin/sh`. Android stops a
|
|
188
|
+
session after one MiB of emitted output and reports the condition through
|
|
189
|
+
`terminal.error`.
|
|
190
|
+
|
|
191
|
+
### Errors and recovery
|
|
192
|
+
|
|
193
|
+
Rejected operations use `Arcane.Error`. Read `code`, `message`, and `resolution`
|
|
194
|
+
instead of matching the message text. Common terminal failures include:
|
|
195
|
+
|
|
196
|
+
| Code | Recovery |
|
|
197
|
+
| --- | --- |
|
|
198
|
+
| `METHOD_NOT_ALLOWED` | Open Arcane Terminal through an admitted host; another app cannot self-grant `terminal.execute`. |
|
|
199
|
+
| `ARCANE_TRANSPORT_UNAVAILABLE` | Open the application through the installed Arcane host or its development launcher. |
|
|
200
|
+
| `METHOD_CONTRACT_INPUT_INVALID` or `TERMINAL_REQUEST_INVALID` | Send only the documented values and bounds. |
|
|
201
|
+
| `TERMINAL_SESSION_LIMIT` | Close an existing session before starting another. |
|
|
202
|
+
| `TERMINAL_SHELL_INVALID` or `TERMINAL_SHELL_UNAVAILABLE` | Select a supported shell for the active platform. |
|
|
203
|
+
| `TERMINAL_CWD_INVALID` | Choose an existing accessible directory allowed by the host sandbox. |
|
|
204
|
+
| `TERMINAL_START_FAILED` | Verify that the selected shell is installed and available. |
|
|
205
|
+
| `TERMINAL_SESSION_INVALID` or `TERMINAL_SESSION_NOT_FOUND` | Refresh with `list()` or start a new session; do not reuse a retired id. |
|
|
206
|
+
| `TERMINAL_DATA_INVALID` or `TERMINAL_INPUT_CLOSED` | Send a nonempty chunk no larger than 64 KiB to a running session. |
|
|
207
|
+
| `TERMINAL_SIGNAL_INVALID` | Use only `interrupt` or `terminate`. |
|
|
208
|
+
|
|
209
|
+
### Example
|
|
210
|
+
|
|
211
|
+
```javascript
|
|
212
|
+
const arcane = globalThis.Arcane;
|
|
213
|
+
const terminal = arcane?.terminal;
|
|
214
|
+
const events = arcane?.events;
|
|
215
|
+
|
|
216
|
+
if (!terminal?.start || !events?.on || !arcane?.capabilities?.list) {
|
|
217
|
+
throw new Error('Open Arcane Terminal from an admitted Arcane host.');
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
const access = await arcane.capabilities.list();
|
|
221
|
+
const requiredMethods = [
|
|
222
|
+
'terminal.start',
|
|
223
|
+
'terminal.list',
|
|
224
|
+
'terminal.write',
|
|
225
|
+
'terminal.resize',
|
|
226
|
+
'terminal.close'
|
|
227
|
+
];
|
|
228
|
+
|
|
229
|
+
if (
|
|
230
|
+
access.app?.id !== 'terminal'
|
|
231
|
+
|| !access.grants.includes('terminal.execute')
|
|
232
|
+
|| !requiredMethods.every(function isRequiredTerminalMethodAdmitted(method) {
|
|
233
|
+
return access.methods.includes(method);
|
|
234
|
+
})
|
|
235
|
+
) {
|
|
236
|
+
throw new Error('This application is not admitted for terminal execution.');
|
|
237
|
+
}
|
|
238
|
+
|
|
239
|
+
const earlyOutput = new Map();
|
|
240
|
+
const observedExits = new Map();
|
|
241
|
+
const exitWaiters = new Map();
|
|
242
|
+
const maxBufferedChunksPerSession = 128;
|
|
243
|
+
let activeSessionId = null;
|
|
244
|
+
let session = null;
|
|
245
|
+
|
|
246
|
+
function displayOutput({stream, data}) {
|
|
247
|
+
const write = stream === 'stderr' ? console.error : console.log;
|
|
248
|
+
write(data);
|
|
249
|
+
}
|
|
250
|
+
|
|
251
|
+
const offOutput = events.on('terminal.output', function handleTerminalOutput(payload) {
|
|
252
|
+
if (payload.sessionId === activeSessionId) {
|
|
253
|
+
displayOutput(payload);
|
|
254
|
+
return;
|
|
255
|
+
}
|
|
256
|
+
const chunks = earlyOutput.get(payload.sessionId) ?? [];
|
|
257
|
+
chunks.push(payload);
|
|
258
|
+
// Bound pre-identification buffering; surface truncation in a real UI.
|
|
259
|
+
if (chunks.length > maxBufferedChunksPerSession) {
|
|
260
|
+
chunks.shift();
|
|
261
|
+
}
|
|
262
|
+
earlyOutput.set(payload.sessionId, chunks);
|
|
263
|
+
});
|
|
264
|
+
|
|
265
|
+
const offExit = events.on('terminal.exit', function handleTerminalExit(payload) {
|
|
266
|
+
observedExits.set(payload.sessionId, payload);
|
|
267
|
+
const waiter = exitWaiters.get(payload.sessionId);
|
|
268
|
+
if (waiter) {
|
|
269
|
+
clearTimeout(waiter.timer);
|
|
270
|
+
exitWaiters.delete(payload.sessionId);
|
|
271
|
+
waiter.resolve(payload);
|
|
272
|
+
}
|
|
273
|
+
});
|
|
274
|
+
|
|
275
|
+
const offError = events.on('terminal.error', function handleTerminalError(payload) {
|
|
276
|
+
console.error(`Terminal ${payload.sessionId}: ${payload.message}`);
|
|
277
|
+
});
|
|
278
|
+
|
|
279
|
+
function waitForExit(sessionId, timeoutMs = 5000) {
|
|
280
|
+
if (observedExits.has(sessionId)) {
|
|
281
|
+
return Promise.resolve(observedExits.get(sessionId));
|
|
282
|
+
}
|
|
283
|
+
return new Promise(function createExitWait(resolve, reject) {
|
|
284
|
+
const timer = setTimeout(function rejectTimedOutExitWait() {
|
|
285
|
+
exitWaiters.delete(sessionId);
|
|
286
|
+
reject(new Error(`Timed out waiting for ${sessionId} to exit.`));
|
|
287
|
+
}, timeoutMs);
|
|
288
|
+
exitWaiters.set(sessionId, {resolve, timer});
|
|
289
|
+
});
|
|
290
|
+
}
|
|
291
|
+
|
|
292
|
+
try {
|
|
293
|
+
session = await terminal.start({
|
|
294
|
+
shell: 'auto',
|
|
295
|
+
cwd: '',
|
|
296
|
+
columns: 120,
|
|
297
|
+
rows: 32
|
|
298
|
+
});
|
|
299
|
+
activeSessionId = session.id;
|
|
300
|
+
|
|
301
|
+
for (const payload of earlyOutput.get(session.id) ?? []) {
|
|
302
|
+
displayOutput(payload);
|
|
303
|
+
}
|
|
304
|
+
earlyOutput.delete(session.id);
|
|
305
|
+
|
|
306
|
+
await terminal.resize(session.id, 100, 30);
|
|
307
|
+
const {sessions} = await terminal.list();
|
|
308
|
+
console.log('Owned sessions', sessions);
|
|
309
|
+
|
|
310
|
+
const lineEnding = ['powershell', 'cmd'].includes(session.shell)
|
|
311
|
+
? '\r\n'
|
|
312
|
+
: '\n';
|
|
313
|
+
await terminal.write(
|
|
314
|
+
session.id,
|
|
315
|
+
`echo Arcane terminal ready${lineEnding}`
|
|
316
|
+
);
|
|
317
|
+
|
|
318
|
+
const exitPromise = waitForExit(session.id);
|
|
319
|
+
const closeResult = await terminal.close(session.id);
|
|
320
|
+
console.log('Close request accepted', closeResult.accepted);
|
|
321
|
+
|
|
322
|
+
const exit = await exitPromise;
|
|
323
|
+
console.log('Process exited', exit.exitCode, exit.signal);
|
|
324
|
+
} catch (error) {
|
|
325
|
+
if (error instanceof arcane.Error) {
|
|
326
|
+
console.error(error.code, error.message, error.resolution);
|
|
327
|
+
} else {
|
|
328
|
+
throw error;
|
|
329
|
+
}
|
|
330
|
+
} finally {
|
|
331
|
+
if (session && !observedExits.has(session.id)) {
|
|
332
|
+
await terminal.close(session.id).catch(function ignoreTerminalCloseFailure() {});
|
|
333
|
+
}
|
|
334
|
+
offOutput();
|
|
335
|
+
offExit();
|
|
336
|
+
offError();
|
|
337
|
+
for (const waiter of exitWaiters.values()) {
|
|
338
|
+
clearTimeout(waiter.timer);
|
|
339
|
+
}
|
|
340
|
+
exitWaiters.clear();
|
|
341
|
+
}
|
|
342
|
+
```
|
|
343
|
+
|
|
344
|
+
## Arcane.protocol
|
|
345
|
+
|
|
346
|
+
### Overview
|
|
347
|
+
|
|
348
|
+
`Arcane.protocol` is the immutable wire-protocol identifier used by the current
|
|
349
|
+
renderer bridge. Its value is currently the string `"arcane/1"`. It identifies
|
|
350
|
+
the message format; it does not establish connection health, host trust,
|
|
351
|
+
application admission, or feature availability.
|
|
352
|
+
|
|
353
|
+
### When to use
|
|
354
|
+
|
|
355
|
+
Use this value in diagnostics or compatibility checks that need to distinguish
|
|
356
|
+
the Arcane message contract. Do not use it as a capability or security decision.
|
|
357
|
+
|
|
358
|
+
### Example
|
|
359
|
+
|
|
360
|
+
```javascript
|
|
361
|
+
const protocol = globalThis.Arcane?.protocol;
|
|
362
|
+
|
|
363
|
+
if (protocol !== 'arcane/1') {
|
|
364
|
+
throw new Error('This document does not expose the expected Arcane protocol.');
|
|
365
|
+
}
|
|
366
|
+
```
|
|
367
|
+
|
|
368
|
+
## Arcane.Error
|
|
369
|
+
|
|
370
|
+
### Overview
|
|
371
|
+
|
|
372
|
+
`Arcane.Error` is the normalized error constructor used for rejected native API
|
|
373
|
+
requests. Instances always provide `code` and `message`; `resolution`,
|
|
374
|
+
`diagnosticId`, `technicalMessage`, `hresult`, `causeName`, and other bounded
|
|
375
|
+
diagnostic fields are present when the host supplied them. Native request
|
|
376
|
+
failures reject with this type, while synchronous JavaScript argument checks can
|
|
377
|
+
throw `TypeError` before a request is sent.
|
|
378
|
+
|
|
379
|
+
### Error handling
|
|
380
|
+
|
|
381
|
+
Branch on `code`, retain `diagnosticId` for support, and show `resolution` when
|
|
382
|
+
available. Do not match changing message prose or log sensitive request or result
|
|
383
|
+
data merely because an error object contains technical context.
|
|
384
|
+
|
|
385
|
+
### Example
|
|
386
|
+
|
|
387
|
+
```javascript
|
|
388
|
+
try {
|
|
389
|
+
await globalThis.Arcane.system.ping();
|
|
390
|
+
} catch (error) {
|
|
391
|
+
if (error instanceof globalThis.Arcane.Error) {
|
|
392
|
+
console.error(error.code, error.resolution ?? error.message);
|
|
393
|
+
} else {
|
|
394
|
+
throw error;
|
|
395
|
+
}
|
|
396
|
+
}
|
|
397
|
+
```
|
|
398
|
+
|
|
399
|
+
## Arcane.runtime
|
|
400
|
+
|
|
401
|
+
### Overview
|
|
402
|
+
|
|
403
|
+
`Arcane.runtime` owns renderer-local transport inspection. Its snapshot is
|
|
404
|
+
synchronous and frozen, and obtaining it sends no RPC. Transport connection,
|
|
405
|
+
native-host class, and managed-local-AI host class are descriptive facts rather
|
|
406
|
+
than health, admission, or trust claims.
|
|
407
|
+
|
|
408
|
+
### When to use
|
|
409
|
+
|
|
410
|
+
Use this namespace to adapt presentation to standalone, development HTTP,
|
|
411
|
+
WebView2, WebKitGTK, or Android WebView environments. Use
|
|
412
|
+
`Arcane.capabilities.list()` and method-specific status calls for authority and
|
|
413
|
+
service readiness.
|
|
414
|
+
|
|
415
|
+
### Example
|
|
416
|
+
|
|
417
|
+
```javascript
|
|
418
|
+
const runtime = globalThis.Arcane?.runtime?.current?.();
|
|
419
|
+
|
|
420
|
+
if (runtime) {
|
|
421
|
+
console.log(runtime.transport, runtime.connected, runtime.native);
|
|
422
|
+
}
|
|
423
|
+
```
|
|
424
|
+
|
|
425
|
+
## Arcane.ai
|
|
426
|
+
|
|
427
|
+
### Overview
|
|
428
|
+
|
|
429
|
+
`Arcane.ai` is the provider-neutral surface for model inventory, effective AI
|
|
430
|
+
profile, chat, provider settings, and account-visible provider models. It keeps
|
|
431
|
+
application code above raw provider protocols. Request and result objects use
|
|
432
|
+
the checked contracts linked from the canonical method pages.
|
|
433
|
+
|
|
434
|
+
### Availability and security
|
|
435
|
+
|
|
436
|
+
Inference requires `ai.inference`. Raw local inventory is restricted to
|
|
437
|
+
Settings, Shell, and Terminal with `ai.models.read`; provider settings and model
|
|
438
|
+
discovery are Settings-only with `ai.settings.manage`. Credentials stay inside
|
|
439
|
+
the native settings boundary and must not be logged or copied into prompts.
|
|
440
|
+
|
|
441
|
+
### Example
|
|
442
|
+
|
|
443
|
+
```javascript
|
|
444
|
+
const access = await globalThis.Arcane.capabilities.list();
|
|
445
|
+
const canChat = access.methods.includes('ai.chat');
|
|
446
|
+
|
|
447
|
+
console.log('Provider-neutral chat admitted:', canChat);
|
|
448
|
+
```
|
|
449
|
+
|
|
450
|
+
## Arcane.environment
|
|
451
|
+
|
|
452
|
+
### Overview
|
|
453
|
+
|
|
454
|
+
`Arcane.environment` manages the Vault application's authorized environment
|
|
455
|
+
profile. It separates listing, protected reads, writes, and deletion, and marks
|
|
456
|
+
known sensitive names as protected by default when `set()` is called without an
|
|
457
|
+
explicit protection choice.
|
|
458
|
+
|
|
459
|
+
### Availability and security
|
|
460
|
+
|
|
461
|
+
The namespace is restricted to app id `vault` on Core or Android hosts.
|
|
462
|
+
Listing requires `environment.read`, protected reads require
|
|
463
|
+
`environment.protected.read`, and mutations require `environment.write` and an
|
|
464
|
+
exclusive mutation boundary. Never print protected values in examples or logs.
|
|
465
|
+
|
|
466
|
+
### Example
|
|
467
|
+
|
|
468
|
+
```javascript
|
|
469
|
+
const access = await globalThis.Arcane.capabilities.list();
|
|
470
|
+
const canListEnvironmentNames = access.methods.includes('environment.list');
|
|
471
|
+
|
|
472
|
+
console.log('Environment inventory admitted:', canListEnvironmentNames);
|
|
473
|
+
```
|
|
474
|
+
|
|
475
|
+
## Arcane.mail
|
|
476
|
+
|
|
477
|
+
### Overview
|
|
478
|
+
|
|
479
|
+
`Arcane.mail` sends one bounded, already-prepared report through the native mail
|
|
480
|
+
gateway. It does not provide an interactive composer and a successful result
|
|
481
|
+
must be interpreted using its sent, partial, uncertain, and status fields rather
|
|
482
|
+
than as a blanket delivery guarantee.
|
|
483
|
+
|
|
484
|
+
### Availability and security
|
|
485
|
+
|
|
486
|
+
`mail.send` requires the `mail.send` capability, is limited to explicitly
|
|
487
|
+
admitted report applications, and is currently Core-hosted rather than
|
|
488
|
+
Android-hosted. Treat recipients and report content as sensitive and use a
|
|
489
|
+
stable report key to avoid ambiguous duplicates.
|
|
490
|
+
|
|
491
|
+
### Example
|
|
492
|
+
|
|
493
|
+
```javascript
|
|
494
|
+
const access = await globalThis.Arcane.capabilities.list();
|
|
495
|
+
const canSendReports = access.methods.includes('mail.send');
|
|
496
|
+
|
|
497
|
+
console.log('Native report delivery admitted:', canSendReports);
|
|
498
|
+
```
|
|
499
|
+
|
|
500
|
+
## Arcane.speech
|
|
501
|
+
|
|
502
|
+
### Overview
|
|
503
|
+
|
|
504
|
+
`Arcane.speech` exposes independent local speech status, synthesis, and
|
|
505
|
+
transcription through the native host. The status result keeps Kokoro and
|
|
506
|
+
Whisper readiness separate; successful readiness for one role does not imply
|
|
507
|
+
readiness for the other.
|
|
508
|
+
|
|
509
|
+
### Availability and security
|
|
510
|
+
|
|
511
|
+
All speech methods require `ai.inference`. Desktop Core uses its admitted fixed
|
|
512
|
+
local services; admitted Android applications use bounded native providers.
|
|
513
|
+
Transcription accepts only the documented bounded canonical audio envelope, and
|
|
514
|
+
applications should not retain microphone audio without an explicit need.
|
|
515
|
+
|
|
516
|
+
### Example
|
|
517
|
+
|
|
518
|
+
```javascript
|
|
519
|
+
const access = await globalThis.Arcane.capabilities.list();
|
|
520
|
+
const canReadSpeechStatus = access.methods.includes('speech.status');
|
|
521
|
+
|
|
522
|
+
console.log('Speech status admitted:', canReadSpeechStatus);
|
|
523
|
+
```
|
|
524
|
+
|
|
525
|
+
## Arcane.localAI
|
|
526
|
+
|
|
527
|
+
### Overview
|
|
528
|
+
|
|
529
|
+
`Arcane.localAI` is the policy-filtered local-AI control surface. It covers
|
|
530
|
+
readiness, Provisioner reconciliation, admitted service recovery, verified
|
|
531
|
+
parallel-request configuration, and an application-owned isolated-model
|
|
532
|
+
inspection and question lifecycle. Application selectors should use its
|
|
533
|
+
admitted catalog rather than raw Ollama inventory.
|
|
534
|
+
|
|
535
|
+
### Availability and security
|
|
536
|
+
|
|
537
|
+
Status requires `ai.inference`; lifecycle methods add app-id, app-type,
|
|
538
|
+
privilege, host, and exclusive-mutation restrictions. Parallel-request mutation
|
|
539
|
+
is Core-only, privileged, requires `ai.runtime.manage`, and is admitted only to
|
|
540
|
+
the owning application. Isolated operations are restricted to their owning
|
|
541
|
+
application. Long operations can emit `operation.*`; isolated questions correlate
|
|
542
|
+
`localai.isolated.phase` by `operationId`.
|
|
543
|
+
|
|
544
|
+
### Example
|
|
545
|
+
|
|
546
|
+
```javascript
|
|
547
|
+
const access = await globalThis.Arcane.capabilities.list();
|
|
548
|
+
const canInspectLocalAI = access.methods.includes('localai.status');
|
|
549
|
+
|
|
550
|
+
console.log('Policy-filtered local AI status admitted:', canInspectLocalAI);
|
|
551
|
+
```
|
|
552
|
+
|
|
553
|
+
## Arcane.ollama
|
|
554
|
+
|
|
555
|
+
### Overview
|
|
556
|
+
|
|
557
|
+
`Arcane.ollama` exposes admitted Ollama inference, raw diagnostic inventory,
|
|
558
|
+
managed selection and settings, and policy-controlled model management. Raw
|
|
559
|
+
provider inventory is not an application's model-admission catalog. Streaming
|
|
560
|
+
calls can deliver correlated `ollama.chunk` events or an `onChunk` callback.
|
|
561
|
+
|
|
562
|
+
### Availability and security
|
|
563
|
+
|
|
564
|
+
Inference requires `ai.inference`; diagnostic inventory requires
|
|
565
|
+
`ai.models.read` and is limited to Settings, Shell, and Terminal. Mutations use
|
|
566
|
+
`ai.models.manage` or Settings-only `ai.settings.manage`, frequently behind an
|
|
567
|
+
exclusive mutation boundary. Android user-managed loopback admission exposes
|
|
568
|
+
chat only and does not grant managed model lifecycle authority.
|
|
569
|
+
|
|
570
|
+
### Example
|
|
571
|
+
|
|
572
|
+
```javascript
|
|
573
|
+
const access = await globalThis.Arcane.capabilities.list();
|
|
574
|
+
const canUseOllamaChat = access.methods.includes('ollama.chat');
|
|
575
|
+
|
|
576
|
+
console.log('Native Ollama chat admitted:', canUseOllamaChat);
|
|
577
|
+
```
|
|
578
|
+
|
|
579
|
+
## Arcane.app
|
|
580
|
+
|
|
581
|
+
### Overview
|
|
582
|
+
|
|
583
|
+
`Arcane.app` reads the immutable application identity bound to the current host
|
|
584
|
+
session. The descriptor includes the app-owned id, display name, type, entry,
|
|
585
|
+
version, and bounded trust-status fields. It is session evidence, not a
|
|
586
|
+
caller-supplied identity.
|
|
587
|
+
|
|
588
|
+
### Availability and security
|
|
589
|
+
|
|
590
|
+
`app.current` is a capability-free provider read on Core and Android. An
|
|
591
|
+
Android app reports its independently packaged version and currently reports
|
|
592
|
+
unverified publisher status; the OS bundle version remains separate.
|
|
593
|
+
|
|
594
|
+
### Example
|
|
595
|
+
|
|
596
|
+
```javascript
|
|
597
|
+
const app = await globalThis.Arcane.app.current();
|
|
598
|
+
|
|
599
|
+
console.log(app.id, app.displayName, app.version);
|
|
600
|
+
```
|
|
601
|
+
|
|
602
|
+
## Arcane.applications
|
|
603
|
+
|
|
604
|
+
### Overview
|
|
605
|
+
|
|
606
|
+
`Arcane.applications` provides the application catalog visible to the bound
|
|
607
|
+
Shell or Terminal session and requests launch by canonical application id.
|
|
608
|
+
Catalog visibility and launchability are host-policy decisions; applications
|
|
609
|
+
cannot register or launch arbitrary executables through this namespace.
|
|
610
|
+
|
|
611
|
+
### Availability and security
|
|
612
|
+
|
|
613
|
+
Listing requires `applications.read`; launching requires
|
|
614
|
+
`applications.launch`. Both are restricted to Shell or Terminal on Core and
|
|
615
|
+
Android. Android launch resolves only a generated package installed for the
|
|
616
|
+
selected catalog entry.
|
|
617
|
+
|
|
618
|
+
### Example
|
|
619
|
+
|
|
620
|
+
```javascript
|
|
621
|
+
const access = await globalThis.Arcane.capabilities.list();
|
|
622
|
+
const canListApplications = access.methods.includes('apps.list');
|
|
623
|
+
|
|
624
|
+
console.log('Application catalog admitted:', canListApplications);
|
|
625
|
+
```
|
|
626
|
+
|
|
627
|
+
## Arcane.external
|
|
628
|
+
|
|
629
|
+
### Overview
|
|
630
|
+
|
|
631
|
+
`Arcane.external` requests a policy-validated operating-system handoff for an
|
|
632
|
+
external URI. The current public contract accepts only a tightly validated
|
|
633
|
+
`mailto:` URI. An `opened` result means the operating system accepted the
|
|
634
|
+
handoff, not that a composer opened or a message was sent.
|
|
635
|
+
|
|
636
|
+
### Availability and security
|
|
637
|
+
|
|
638
|
+
`external.open` requires the `external.open` capability on Core or Android.
|
|
639
|
+
The host rejects whitespace, fragments, backslashes, malformed escapes,
|
|
640
|
+
encoded controls, and unsupported schemes before any handoff.
|
|
641
|
+
|
|
642
|
+
### Example
|
|
643
|
+
|
|
644
|
+
```javascript
|
|
645
|
+
const access = await globalThis.Arcane.capabilities.list();
|
|
646
|
+
const canRequestExternalOpen = access.methods.includes('external.open');
|
|
647
|
+
|
|
648
|
+
console.log('External URI handoff admitted:', canRequestExternalOpen);
|
|
649
|
+
```
|
|
650
|
+
|
|
651
|
+
## Arcane.repository
|
|
652
|
+
|
|
653
|
+
### Overview
|
|
654
|
+
|
|
655
|
+
`Arcane.repository` is the parent for application-owned repository services.
|
|
656
|
+
The shared bridge projects fixed, package-owned workflows, while each owning
|
|
657
|
+
application reference defines the exact data and mutation contract.
|
|
658
|
+
|
|
659
|
+
### Availability and security
|
|
660
|
+
|
|
661
|
+
Every child method is restricted by its application id and a repository-specific
|
|
662
|
+
read or write capability. Repository identities, branches, paths, and mutation
|
|
663
|
+
rules are fixed by native policy; callers cannot supply credentials, remotes, or
|
|
664
|
+
an arbitrary checkout.
|
|
665
|
+
|
|
666
|
+
### Example
|
|
667
|
+
|
|
668
|
+
```javascript
|
|
669
|
+
const access = await globalThis.Arcane.capabilities.list();
|
|
670
|
+
const repositoryMethods = access.methods.filter(
|
|
671
|
+
function selectRepositoryMethod(method) {
|
|
672
|
+
return method.startsWith('repository.');
|
|
673
|
+
}
|
|
674
|
+
);
|
|
675
|
+
|
|
676
|
+
console.log('Admitted repository methods:', repositoryMethods);
|
|
677
|
+
```
|
|
678
|
+
|
|
679
|
+
## Arcane.capabilities
|
|
680
|
+
|
|
681
|
+
### Overview
|
|
682
|
+
|
|
683
|
+
`Arcane.capabilities` returns the bound application descriptor, sorted grants,
|
|
684
|
+
and exact method allowlist for the current session. This is the authoritative
|
|
685
|
+
application-side preflight for method admission; checking that a JavaScript
|
|
686
|
+
function exists is not enough because the shared surface is projected broadly.
|
|
687
|
+
|
|
688
|
+
### Availability and security
|
|
689
|
+
|
|
690
|
+
`capabilities.list` is a read-only bridge method. Its result describes current
|
|
691
|
+
admission but does not grant authority, prove dependency readiness, or replace
|
|
692
|
+
method-specific status and error handling. The direct method is Core-only;
|
|
693
|
+
Android callers with `system.read` use
|
|
694
|
+
`Arcane.platform.status().capabilities` for the same nested snapshot.
|
|
695
|
+
|
|
696
|
+
### Example
|
|
697
|
+
|
|
698
|
+
```javascript
|
|
699
|
+
const {app, grants, methods} = await globalThis.Arcane.capabilities.list();
|
|
700
|
+
|
|
701
|
+
console.log(app.id, grants.length, methods.length);
|
|
702
|
+
```
|
|
703
|
+
|
|
704
|
+
## Arcane.platform
|
|
705
|
+
|
|
706
|
+
### Overview
|
|
707
|
+
|
|
708
|
+
`Arcane.platform` returns bounded host platform, renderer, permission,
|
|
709
|
+
capability, and execution-evidence status. It distinguishes actual host platform
|
|
710
|
+
from simulated effective platform and keeps presentation labels separate from
|
|
711
|
+
authorization.
|
|
712
|
+
|
|
713
|
+
### Availability and security
|
|
714
|
+
|
|
715
|
+
`platform.status` requires `system.read` and is available on admitted Core and
|
|
716
|
+
Android hosts. Treat the result as status evidence, never as a substitute for a
|
|
717
|
+
capability check or a publisher, update, or release attestation.
|
|
718
|
+
|
|
719
|
+
### Example
|
|
720
|
+
|
|
721
|
+
```javascript
|
|
722
|
+
const access = await globalThis.Arcane.capabilities.list();
|
|
723
|
+
const canReadPlatform = access.methods.includes('platform.status');
|
|
724
|
+
|
|
725
|
+
console.log('Platform evidence admitted:', canReadPlatform);
|
|
726
|
+
```
|
|
727
|
+
|
|
728
|
+
## Arcane.permissions
|
|
729
|
+
|
|
730
|
+
### Overview
|
|
731
|
+
|
|
732
|
+
`Arcane.permissions` reports effective elevation and permission status exposed
|
|
733
|
+
by the native host. It helps explain whether an operation may require operating-
|
|
734
|
+
system authorization, but it does not itself approve or perform that operation.
|
|
735
|
+
|
|
736
|
+
### Availability and security
|
|
737
|
+
|
|
738
|
+
`permissions.status` requires `system.read`. Permission status can change, and
|
|
739
|
+
every privileged method still rechecks its own policy and operating-system
|
|
740
|
+
boundary when invoked.
|
|
741
|
+
|
|
742
|
+
### Example
|
|
743
|
+
|
|
744
|
+
```javascript
|
|
745
|
+
const access = await globalThis.Arcane.capabilities.list();
|
|
746
|
+
const canReadPermissions = access.methods.includes('permissions.status');
|
|
747
|
+
|
|
748
|
+
console.log('Permission status admitted:', canReadPermissions);
|
|
749
|
+
```
|
|
750
|
+
|
|
751
|
+
## Arcane.version
|
|
752
|
+
|
|
753
|
+
### Overview
|
|
754
|
+
|
|
755
|
+
`Arcane.version` separates the Arcane OS bundle or host version from
|
|
756
|
+
installation status. `current()` is the session's OS version even when an
|
|
757
|
+
application owns a different package version; `installation()` is an alias-like
|
|
758
|
+
read of the installation-status method.
|
|
759
|
+
|
|
760
|
+
### Availability and security
|
|
761
|
+
|
|
762
|
+
`version.current` is capability-free on Core and Android.
|
|
763
|
+
`version.installation` requires `installation.read` and may not be admitted to
|
|
764
|
+
the same applications. Neither result proves signing, update continuity, or
|
|
765
|
+
release-candidate acceptance.
|
|
766
|
+
|
|
767
|
+
### Example
|
|
768
|
+
|
|
769
|
+
```javascript
|
|
770
|
+
const version = await globalThis.Arcane.version.current();
|
|
771
|
+
|
|
772
|
+
console.log('Arcane OS host version:', version);
|
|
773
|
+
```
|
|
774
|
+
|
|
775
|
+
## Arcane.machine
|
|
776
|
+
|
|
777
|
+
### Overview
|
|
778
|
+
|
|
779
|
+
`Arcane.machine` exposes the Provisioner's bounded machine readiness and status
|
|
780
|
+
view. It is intended for planning and reconciliation, not general application
|
|
781
|
+
fingerprinting or unrestricted hardware inspection.
|
|
782
|
+
|
|
783
|
+
### Availability and security
|
|
784
|
+
|
|
785
|
+
`machine.status` requires `provisioning.manage` and the `provisioner` app type.
|
|
786
|
+
Other applications cannot gain this authority by calling the shared JavaScript
|
|
787
|
+
function directly.
|
|
788
|
+
|
|
789
|
+
### Example
|
|
790
|
+
|
|
791
|
+
```javascript
|
|
792
|
+
const access = await globalThis.Arcane.capabilities.list();
|
|
793
|
+
const canReadMachineStatus = access.methods.includes('machine.status');
|
|
794
|
+
|
|
795
|
+
console.log('Machine readiness admitted:', canReadMachineStatus);
|
|
796
|
+
```
|
|
797
|
+
|
|
798
|
+
## Arcane.user
|
|
799
|
+
|
|
800
|
+
### Overview
|
|
801
|
+
|
|
802
|
+
`Arcane.user` reads the privacy-minimized identity bound to the current host
|
|
803
|
+
session. Desktop Core can return a host-account identity; Android returns an
|
|
804
|
+
anonymous local-session identity with null account identifiers.
|
|
805
|
+
|
|
806
|
+
### Availability and security
|
|
807
|
+
|
|
808
|
+
`user.current` takes no parameters, requires `identity.read`, and is available
|
|
809
|
+
on Core and Android. Use only fields returned by the host and do not infer a
|
|
810
|
+
cross-device or durable person identity from the record.
|
|
811
|
+
|
|
812
|
+
### Example
|
|
813
|
+
|
|
814
|
+
```javascript
|
|
815
|
+
const access = await globalThis.Arcane.capabilities.list();
|
|
816
|
+
const canReadIdentity = access.methods.includes('user.current');
|
|
817
|
+
|
|
818
|
+
console.log('Bound identity read admitted:', canReadIdentity);
|
|
819
|
+
```
|
|
820
|
+
|
|
821
|
+
## Arcane.requirements
|
|
822
|
+
|
|
823
|
+
### Overview
|
|
824
|
+
|
|
825
|
+
`Arcane.requirements` reads the installation requirement inventory and lets the
|
|
826
|
+
Provisioner ensure selected requirements. Omitting the requirement-id array
|
|
827
|
+
selects only requirements marked required; `null` and an empty array have the
|
|
828
|
+
same default. The interruption option is exactly `"deny"` or `"allow"` and
|
|
829
|
+
defaults to `"deny"`.
|
|
830
|
+
|
|
831
|
+
### Availability and security
|
|
832
|
+
|
|
833
|
+
Listing requires `requirements.read`. Ensuring requires
|
|
834
|
+
`provisioning.manage`, the `provisioner` app type, privilege, and an exclusive
|
|
835
|
+
mutation boundary. `"allow"` does not bypass native process-identity and port
|
|
836
|
+
proof before an existing user process can be interrupted.
|
|
837
|
+
|
|
838
|
+
### Example
|
|
839
|
+
|
|
840
|
+
```javascript
|
|
841
|
+
const access = await globalThis.Arcane.capabilities.list();
|
|
842
|
+
const canListRequirements = access.methods.includes('requirements.list');
|
|
843
|
+
|
|
844
|
+
console.log('Requirement inventory admitted:', canListRequirements);
|
|
845
|
+
```
|
|
846
|
+
|
|
847
|
+
## Arcane.installation
|
|
848
|
+
|
|
849
|
+
### Overview
|
|
850
|
+
|
|
851
|
+
`Arcane.installation` reports installation status, lets the Provisioner ensure
|
|
852
|
+
the required installed state, and can request the globally installed Microsoft
|
|
853
|
+
NT uninstaller. Ensuring and opening the uninstaller are distinct operations;
|
|
854
|
+
the latter does not uninstall through checkout-local code.
|
|
855
|
+
|
|
856
|
+
### Availability and security
|
|
857
|
+
|
|
858
|
+
Status requires `installation.read`. Ensure and uninstaller access require
|
|
859
|
+
`provisioning.manage` and the `provisioner` app type; ensure is privileged and
|
|
860
|
+
exclusive. A returned `opened` value means process creation was accepted, not
|
|
861
|
+
that confirmation or uninstall completed.
|
|
862
|
+
|
|
863
|
+
### Example
|
|
864
|
+
|
|
865
|
+
```javascript
|
|
866
|
+
const access = await globalThis.Arcane.capabilities.list();
|
|
867
|
+
const canReadInstallation = access.methods.includes('installation.status');
|
|
868
|
+
|
|
869
|
+
console.log('Installation status admitted:', canReadInstallation);
|
|
870
|
+
```
|
|
871
|
+
|
|
872
|
+
## Arcane.users
|
|
873
|
+
|
|
874
|
+
### Overview
|
|
875
|
+
|
|
876
|
+
`Arcane.users` owns the Provisioner's bounded account inventory, validation,
|
|
877
|
+
creation, activation, temporary-password flow, and shell verification or
|
|
878
|
+
restoration. Usernames are explicit inputs; password application is separate
|
|
879
|
+
from password reset so the application can control disclosure and confirmation.
|
|
880
|
+
|
|
881
|
+
### Availability and security
|
|
882
|
+
|
|
883
|
+
Every method requires `users.manage` and the `provisioner` app type. Account and
|
|
884
|
+
shell mutations add privilege or exclusive-mutation controls as declared by
|
|
885
|
+
policy. Temporary passwords are sensitive: never log, persist, or place them in
|
|
886
|
+
diagnostic examples.
|
|
887
|
+
|
|
888
|
+
### Example
|
|
889
|
+
|
|
890
|
+
```javascript
|
|
891
|
+
const access = await globalThis.Arcane.capabilities.list();
|
|
892
|
+
const canValidateUsers = access.methods.includes('users.validate');
|
|
893
|
+
|
|
894
|
+
console.log('User validation admitted:', canValidateUsers);
|
|
895
|
+
```
|
|
896
|
+
|
|
897
|
+
## Arcane.system
|
|
898
|
+
|
|
899
|
+
### Overview
|
|
900
|
+
|
|
901
|
+
`Arcane.system` groups bounded operating-system session lock, bridge ping,
|
|
902
|
+
allowed metrics, and Settings-owned verification-failure policy. Ping proves
|
|
903
|
+
only that the host admitted and answered one request; it is not a health,
|
|
904
|
+
privilege, trust, or release-readiness result.
|
|
905
|
+
|
|
906
|
+
### Availability and security
|
|
907
|
+
|
|
908
|
+
Ping is capability-free on Core and Android. Metrics require
|
|
909
|
+
`system.metrics.read`; lock requires `session.control` and the Shell app type.
|
|
910
|
+
Failure-policy reads and writes are Settings-only through preference
|
|
911
|
+
capabilities, and writes are exclusive.
|
|
912
|
+
|
|
913
|
+
### Example
|
|
914
|
+
|
|
915
|
+
```javascript
|
|
916
|
+
const result = await globalThis.Arcane.system.ping();
|
|
917
|
+
|
|
918
|
+
console.log('Host answered:', result.ok);
|
|
919
|
+
```
|
|
920
|
+
|
|
921
|
+
## Arcane.network
|
|
922
|
+
|
|
923
|
+
### Overview
|
|
924
|
+
|
|
925
|
+
`Arcane.network` exposes a privacy-bounded connectivity snapshot containing only
|
|
926
|
+
`online` and `interfaceCount`. It counts interfaces with at least one
|
|
927
|
+
non-loopback address and returns no interface name or address.
|
|
928
|
+
|
|
929
|
+
### Availability and security
|
|
930
|
+
|
|
931
|
+
`network.status` requires `network.status.read` on Core or Android. `online`
|
|
932
|
+
does not prove Internet access, DNS, route, captive-portal, or service
|
|
933
|
+
reachability; probe the specific admitted service when that distinction matters.
|
|
934
|
+
|
|
935
|
+
### Example
|
|
936
|
+
|
|
937
|
+
```javascript
|
|
938
|
+
const access = await globalThis.Arcane.capabilities.list();
|
|
939
|
+
const canReadNetworkStatus = access.methods.includes('network.status');
|
|
940
|
+
|
|
941
|
+
console.log('Privacy-bounded network status admitted:', canReadNetworkStatus);
|
|
942
|
+
```
|
|
943
|
+
|
|
944
|
+
## Arcane.firewall
|
|
945
|
+
|
|
946
|
+
### Overview
|
|
947
|
+
|
|
948
|
+
`Arcane.firewall` exposes Firewall-app-only policy status, bounded audit, and
|
|
949
|
+
explicitly confirmed lifecycle operations for Arcane-owned development
|
|
950
|
+
simulation state. Mutation requests must carry the current positive policy and
|
|
951
|
+
machine-state generations; stale expectations fail instead of silently applying
|
|
952
|
+
to a different state.
|
|
953
|
+
|
|
954
|
+
### Availability and security
|
|
955
|
+
|
|
956
|
+
Reads require `firewall.read`; mutations require `firewall.manage`, the
|
|
957
|
+
`firewall` app id, Core, privilege, and an exclusive mutation boundary. Audit
|
|
958
|
+
`limit` defaults to 100 and must be an integer from 1 through 200. Current live
|
|
959
|
+
machine-wide mutation is unsupported; simulation must remain labeled.
|
|
960
|
+
|
|
961
|
+
### Example
|
|
962
|
+
|
|
963
|
+
```javascript
|
|
964
|
+
const access = await globalThis.Arcane.capabilities.list();
|
|
965
|
+
const canReadFirewallStatus = access.methods.includes('firewall.status');
|
|
966
|
+
|
|
967
|
+
console.log('Firewall review admitted:', canReadFirewallStatus);
|
|
968
|
+
```
|
|
969
|
+
|
|
970
|
+
## Arcane.filesystem
|
|
971
|
+
|
|
972
|
+
### Overview
|
|
973
|
+
|
|
974
|
+
`Arcane.filesystem` owns native directory selection. It returns a host-reviewed
|
|
975
|
+
selection rather than granting arbitrary path traversal or a general-purpose
|
|
976
|
+
filesystem API. The optional picker argument must be a non-array object.
|
|
977
|
+
|
|
978
|
+
### Availability and security
|
|
979
|
+
|
|
980
|
+
Directory selection requires `filesystem.directory.select`. The native picker,
|
|
981
|
+
host sandbox, and application policy remain authoritative for what can be
|
|
982
|
+
selected and what later operations may do with the returned path.
|
|
983
|
+
|
|
984
|
+
### Example
|
|
985
|
+
|
|
986
|
+
```javascript
|
|
987
|
+
const access = await globalThis.Arcane.capabilities.list();
|
|
988
|
+
const canSelectDirectory = access.methods.includes('filesystem.directory.select');
|
|
989
|
+
|
|
990
|
+
console.log('Directory picker admitted:', canSelectDirectory);
|
|
991
|
+
```
|
|
992
|
+
|
|
993
|
+
## Arcane.storage
|
|
994
|
+
|
|
995
|
+
### Overview
|
|
996
|
+
|
|
997
|
+
`Arcane.storage` is app-scoped native key/value storage. It supports inventory,
|
|
998
|
+
read, write, and delete without exposing another application's namespace.
|
|
999
|
+
Values must satisfy the method's bounded JSON-compatible contract.
|
|
1000
|
+
|
|
1001
|
+
### Availability and security
|
|
1002
|
+
|
|
1003
|
+
Listing and get require `storage.read`; set and delete require `storage.write`.
|
|
1004
|
+
Storage admission is not permission to store credentials, protected health
|
|
1005
|
+
information, or other sensitive data without the owning application's explicit
|
|
1006
|
+
data policy.
|
|
1007
|
+
|
|
1008
|
+
### Example
|
|
1009
|
+
|
|
1010
|
+
```javascript
|
|
1011
|
+
const access = await globalThis.Arcane.capabilities.list();
|
|
1012
|
+
const canListStorage = access.methods.includes('storage.list');
|
|
1013
|
+
|
|
1014
|
+
console.log('App storage inventory admitted:', canListStorage);
|
|
1015
|
+
```
|
|
1016
|
+
|
|
1017
|
+
## Arcane.preferences
|
|
1018
|
+
|
|
1019
|
+
### Overview
|
|
1020
|
+
|
|
1021
|
+
`Arcane.preferences` stores app-scoped user preferences. It supports individual
|
|
1022
|
+
reads and writes plus an atomic `setMany()` batch; the batch accepts a plain
|
|
1023
|
+
object with one through 32 entries and changes nothing when any entry is invalid.
|
|
1024
|
+
|
|
1025
|
+
### Availability and security
|
|
1026
|
+
|
|
1027
|
+
Reads require `preferences.read`; mutations require `preferences.write`.
|
|
1028
|
+
Preferences are for bounded settings, not secrets or large application records.
|
|
1029
|
+
Synchronous wrapper validation can throw `TypeError` before `setMany()` sends an
|
|
1030
|
+
RPC.
|
|
1031
|
+
|
|
1032
|
+
### Example
|
|
1033
|
+
|
|
1034
|
+
```javascript
|
|
1035
|
+
const access = await globalThis.Arcane.capabilities.list();
|
|
1036
|
+
const canReadPreferences = access.methods.includes('preferences.list');
|
|
1037
|
+
|
|
1038
|
+
console.log('Preference inventory admitted:', canReadPreferences);
|
|
1039
|
+
```
|
|
1040
|
+
|
|
1041
|
+
## Arcane.appearance
|
|
1042
|
+
|
|
1043
|
+
### Overview
|
|
1044
|
+
|
|
1045
|
+
`Arcane.appearance` reads and applies the native appearance contract. Host
|
|
1046
|
+
appearance changes can also arrive as the future-only `appearance.changed`
|
|
1047
|
+
event; application code should use the returned and event payload fields rather
|
|
1048
|
+
than infer theme state from operating-system internals.
|
|
1049
|
+
|
|
1050
|
+
### Availability and security
|
|
1051
|
+
|
|
1052
|
+
Current-state reads require `appearance.read`; applying values requires
|
|
1053
|
+
`appearance.write`. The host validates the bounded appearance object. A method
|
|
1054
|
+
result or event is presentation state and must never grant authority.
|
|
1055
|
+
|
|
1056
|
+
### Example
|
|
1057
|
+
|
|
1058
|
+
```javascript
|
|
1059
|
+
const access = await globalThis.Arcane.capabilities.list();
|
|
1060
|
+
const canReadAppearance = access.methods.includes('appearance.current');
|
|
1061
|
+
|
|
1062
|
+
console.log('Native appearance read admitted:', canReadAppearance);
|
|
1063
|
+
```
|
|
1064
|
+
|
|
1065
|
+
## Arcane.session
|
|
1066
|
+
|
|
1067
|
+
### Overview
|
|
1068
|
+
|
|
1069
|
+
`Arcane.session` owns the current operating-system session lifecycle. Its logout
|
|
1070
|
+
request is not an Arcane-only application exit and can end the user's host
|
|
1071
|
+
session, so it belongs behind a clear, separate confirmation journey.
|
|
1072
|
+
|
|
1073
|
+
### Availability and security
|
|
1074
|
+
|
|
1075
|
+
`session.logout` requires `session.control`, the Shell app type, and an
|
|
1076
|
+
exclusive mutation boundary. Feature detection is safe; this guide deliberately
|
|
1077
|
+
does not invoke logout in its example.
|
|
1078
|
+
|
|
1079
|
+
### Example
|
|
1080
|
+
|
|
1081
|
+
```javascript
|
|
1082
|
+
const access = await globalThis.Arcane.capabilities.list();
|
|
1083
|
+
const canRequestLogout = access.methods.includes('session.logout');
|
|
1084
|
+
|
|
1085
|
+
console.log('Operating-system logout admitted:', canRequestLogout);
|
|
1086
|
+
```
|
|
1087
|
+
|
|
1088
|
+
## Arcane.provisioning
|
|
1089
|
+
|
|
1090
|
+
### Overview
|
|
1091
|
+
|
|
1092
|
+
`Arcane.provisioning` creates a non-applying plan for one username or an array of
|
|
1093
|
+
usernames. Planning separates validation and review from privileged user,
|
|
1094
|
+
requirement, and installation mutations.
|
|
1095
|
+
|
|
1096
|
+
### Availability and security
|
|
1097
|
+
|
|
1098
|
+
`provisioning.plan` requires `provisioning.manage` and the `provisioner` app
|
|
1099
|
+
type. A returned plan is evidence for review, not proof that any account or
|
|
1100
|
+
machine change occurred.
|
|
1101
|
+
|
|
1102
|
+
### Example
|
|
1103
|
+
|
|
1104
|
+
```javascript
|
|
1105
|
+
const access = await globalThis.Arcane.capabilities.list();
|
|
1106
|
+
const canPlanProvisioning = access.methods.includes('provisioning.plan');
|
|
1107
|
+
|
|
1108
|
+
console.log('Provisioning plan admitted:', canPlanProvisioning);
|
|
1109
|
+
```
|
|
1110
|
+
|
|
1111
|
+
## Arcane.diagnostics
|
|
1112
|
+
|
|
1113
|
+
### Overview
|
|
1114
|
+
|
|
1115
|
+
`Arcane.diagnostics` reads a bounded recent-error summary and retrieves one
|
|
1116
|
+
structured diagnostic by id. Diagnostic ids are opaque correlation values; they
|
|
1117
|
+
are not filesystem paths or authorization tokens.
|
|
1118
|
+
|
|
1119
|
+
### Availability and security
|
|
1120
|
+
|
|
1121
|
+
Both methods require `diagnostics.read`. Diagnostic records can contain
|
|
1122
|
+
technical context, so applications should minimize display and retention and
|
|
1123
|
+
must not assume the capability permits exposing them to another user or service.
|
|
1124
|
+
|
|
1125
|
+
### Example
|
|
1126
|
+
|
|
1127
|
+
```javascript
|
|
1128
|
+
const access = await globalThis.Arcane.capabilities.list();
|
|
1129
|
+
const canReadDiagnostics = access.methods.includes('diagnostics.recent');
|
|
1130
|
+
|
|
1131
|
+
console.log('Recent diagnostics admitted:', canReadDiagnostics);
|
|
1132
|
+
```
|
|
1133
|
+
|
|
1134
|
+
## Arcane.development
|
|
1135
|
+
|
|
1136
|
+
### Overview
|
|
1137
|
+
|
|
1138
|
+
`Arcane.development` supports approved-workspace inspection, bounded source
|
|
1139
|
+
context, allowlisted setup tasks, and installation of the supported Node.js
|
|
1140
|
+
development runtime. It is a development tool surface, not arbitrary command
|
|
1141
|
+
execution.
|
|
1142
|
+
|
|
1143
|
+
### Availability and security
|
|
1144
|
+
|
|
1145
|
+
Inspect and context require `development.read`; setup and Node installation
|
|
1146
|
+
require `development.manage` and the `developer` app id. Setup is exclusive;
|
|
1147
|
+
Node installation is additionally privileged. Roots and task ids remain subject
|
|
1148
|
+
to native allowlists and path validation.
|
|
1149
|
+
|
|
1150
|
+
### Example
|
|
1151
|
+
|
|
1152
|
+
```javascript
|
|
1153
|
+
const access = await globalThis.Arcane.capabilities.list();
|
|
1154
|
+
const canInspectWorkspace = access.methods.includes('development.inspect');
|
|
1155
|
+
|
|
1156
|
+
console.log('Development workspace inspection admitted:', canInspectWorkspace);
|
|
1157
|
+
```
|