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,203 @@
|
|
|
1
|
+
# Development publication
|
|
2
|
+
|
|
3
|
+
## Current branch stage
|
|
4
|
+
|
|
5
|
+
Until the first official SDK release, `main` is the single canonical working,
|
|
6
|
+
integration, publication, and documentation branch. Pull requests and pushes
|
|
7
|
+
target `main`, and the complete Node/platform matrix runs there. Do not use a
|
|
8
|
+
separate development branch during this prerelease stage.
|
|
9
|
+
|
|
10
|
+
After the first official release, ordinary work will move to a long-lived
|
|
11
|
+
`dev` branch while `main` remains the canonical released line. That transition
|
|
12
|
+
must be made as one explicit release change that updates branch protections,
|
|
13
|
+
checks, trusted publication rules, documentation channels, and contributor
|
|
14
|
+
instructions together. The future branch name alone grants no authority.
|
|
15
|
+
|
|
16
|
+
## Development npm publication
|
|
17
|
+
|
|
18
|
+
The current development npm version is `0.1.0-dev.5` and `publishConfig.tag` is
|
|
19
|
+
`dev`, so a development publication does not become the default `latest`
|
|
20
|
+
release. Query `npm view arcane-os@dev version` for current registry
|
|
21
|
+
availability; immutable package documentation does not assert mutable registry
|
|
22
|
+
state. npm is the canonical SDK distribution: application repositories add an
|
|
23
|
+
exact `arcane-os` project dependency and invoke its local CLI with
|
|
24
|
+
`npm exec -- arcane`. A separate global installer, standalone SDK executable,
|
|
25
|
+
NuGet package, Homebrew formula, or OS package is not part of this release
|
|
26
|
+
surface. Vanilla Test's C# and Rust lifecycles do not turn this JavaScript SDK
|
|
27
|
+
into a .NET or Rust package.
|
|
28
|
+
|
|
29
|
+
`Check` first runs the development suite, then one unprivileged producer packs
|
|
30
|
+
one `.tgz` under pinned Node and npm versions. The producer writes a canonical
|
|
31
|
+
manifest containing the source SHA, clean-checkout flag, package inventory,
|
|
32
|
+
byte length, SHA-256, npm SHA-1 shasum, and SHA-512 integrity. Windows x64,
|
|
33
|
+
Linux x64, and a real macOS arm64 runner use the declared Node `22.23.2` floor
|
|
34
|
+
and each download that same Actions
|
|
35
|
+
artifact by immutable artifact id. They never repack it. Each runner verifies
|
|
36
|
+
the receipt, installs the tarball into a disposable project, exercises
|
|
37
|
+
`npm exec --offline -- arcane`, and runs a test imported from
|
|
38
|
+
`arcane-os/testing` through the installed package's `arcane-test.mjs`. A final
|
|
39
|
+
readiness job fails unless the producer and the complete native matrix pass.
|
|
40
|
+
|
|
41
|
+
`publish-dev.yml` can run only when manually dispatched from `main` in
|
|
42
|
+
`TheWizardNexus/arcane-os-sdk`. Dispatch requires an authorized npm content
|
|
43
|
+
classification. `unresolved` fails closed. `standard` permits the workflow's
|
|
44
|
+
direct trusted-publishing path only when the package has no conflicting
|
|
45
|
+
dual-use declaration. `dual-use` fails closed until the package includes npm's
|
|
46
|
+
persistent `contentPolicy.class=dual-use` metadata and root `DISCLOSURE`, and
|
|
47
|
+
the workflow is deliberately changed to `npm stage publish` plus human 2FA
|
|
48
|
+
promotion. Direct trusted publishing is not permitted for that class.
|
|
49
|
+
|
|
50
|
+
For the standard path, the workflow authenticates a successful `Check` push
|
|
51
|
+
run for that exact `main` SHA, downloads its immutable package artifact,
|
|
52
|
+
reverifies the manifest and bytes, and publishes the downloaded `.tgz`. It
|
|
53
|
+
never invokes `npm pack` or `npm publish .` under publication authority. A
|
|
54
|
+
repository-wide concurrency group prevents simultaneous publication jobs;
|
|
55
|
+
GitHub may replace an older pending dispatch, and each surviving dispatch is
|
|
56
|
+
safe to rerun. Preflight rejects byte mismatches, a backward `dev` move, or any
|
|
57
|
+
dist-tag other than `dev`; an already-published matching version is an
|
|
58
|
+
idempotent success. Post-publication
|
|
59
|
+
verification tolerates npm's publish-time scanning for up to 15 minutes. If
|
|
60
|
+
scanning or manual review remains pending, the workflow reports that state and
|
|
61
|
+
a rerun safely resumes verification without republishing immutable bytes.
|
|
62
|
+
|
|
63
|
+
The unscoped package installs both `arcane` and `arcane-os`. The short command
|
|
64
|
+
is the documented default; `arcane-os` is the collision-safe fallback. npm
|
|
65
|
+
package names are unique, but executable names are not globally reserved.
|
|
66
|
+
|
|
67
|
+
When `npm view arcane-os@dev version` reports the package unavailable, run
|
|
68
|
+
`npm run pack:local` in this SDK checkout for local development, scaffold with
|
|
69
|
+
`node ./bin/arcane.mjs new ...`, and install the resulting `.tgz` into the app
|
|
70
|
+
with `npm install --save-dev --save-exact <path>`. Keep the tarball at the path
|
|
71
|
+
recorded by `package-lock.json`; subsequent `npm ci` verifies its recorded npm
|
|
72
|
+
integrity. Arcane separately requires the installed package to identify exactly
|
|
73
|
+
as `arcane-os@0.1.0-dev.5` and verifies the locked runtime. A local directory
|
|
74
|
+
`file:` install is intentionally unsupported because it may be linked.
|
|
75
|
+
|
|
76
|
+
Before the first development publish, or while the registry package is absent:
|
|
77
|
+
|
|
78
|
+
1. Push the intended clean `main` commit and require the complete Check workflow,
|
|
79
|
+
including the exact-artifact Windows/Linux/macOS matrix, to pass.
|
|
80
|
+
2. Review the uploaded tarball inventory, manifest, checksum, and license
|
|
81
|
+
notices. Ensure the Arcane OS monorepo package is private so it cannot publish
|
|
82
|
+
the same npm name accidentally.
|
|
83
|
+
3. Make and record the npm content-policy decision before packing the bootstrap
|
|
84
|
+
bytes. A `standard` decision permits direct OIDC after bootstrap. A
|
|
85
|
+
`dual-use` decision requires `contentPolicy.class=dual-use`, a root
|
|
86
|
+
`DISCLOSURE` in the tarball, and staged publication with human 2FA promotion;
|
|
87
|
+
npm treats that declaration as persistent across versions.
|
|
88
|
+
4. Because npm requires a package to exist before trusted or staged publishing
|
|
89
|
+
can be configured, an authorized npm maintainer must download that exact
|
|
90
|
+
green Actions artifact and publish its `.tgz` once under `dev` through an
|
|
91
|
+
interactive session with 2FA. That method is permitted for either content
|
|
92
|
+
class; the dual-use metadata and disclosure must already be inside the exact
|
|
93
|
+
tarball. Do not rebuild or repack it for this bootstrap. After the package
|
|
94
|
+
exists, standard releases may publish directly through OIDC, while dual-use
|
|
95
|
+
releases must use `npm stage publish` and human 2FA promotion.
|
|
96
|
+
5. Allow for npm publish-time scanning, then verify the registry's
|
|
97
|
+
`dist.integrity` equals the manifest, verify `dev` is
|
|
98
|
+
the only dist-tag, add a second appropriate owner, and configure npm trusted
|
|
99
|
+
publishing for the exact `publish-dev.yml` workflow and `npm` environment.
|
|
100
|
+
For a dual-use classification, grant stage-only trust instead of direct
|
|
101
|
+
publish authority.
|
|
102
|
+
6. Later standard development versions may use the workflow's direct OIDC
|
|
103
|
+
authority. A dual-use version must be staged and promoted with human 2FA.
|
|
104
|
+
Any missing policy decision, package bootstrap, environment, publisher
|
|
105
|
+
binding, or exact-SHA artifact is a publication blocker rather than a reason
|
|
106
|
+
to fall back to a token or repack.
|
|
107
|
+
|
|
108
|
+
Generated app CI uses `npm ci --ignore-scripts`, so its lock must exist and its
|
|
109
|
+
dependency source must be reachable by the runner. A sibling local tarball is a
|
|
110
|
+
workstation workflow, not a portable GitHub dependency source; switch to the
|
|
111
|
+
exact registry release (or deliberately vendor the tarball) before remote CI.
|
|
112
|
+
|
|
113
|
+
## Reusable application release workflow
|
|
114
|
+
|
|
115
|
+
External app repositories can call `.github/workflows/release-app.yml` by an
|
|
116
|
+
immutable SDK repository revision. The reusable workflow checks out the exact
|
|
117
|
+
caller SHA, installs only the caller's committed dependency lock, requires
|
|
118
|
+
`arcane-os@0.1.0-dev.5`, and checks, packages, bundles, independently verifies,
|
|
119
|
+
and uploads one explicitly selected app. Every third-party action reference is
|
|
120
|
+
pinned to a full commit SHA. The workflow never publishes npm, creates a GitHub
|
|
121
|
+
Release, loops across apps, or changes Arcane admission state.
|
|
122
|
+
|
|
123
|
+
The build job holds only `contents: read`; its caller-owned checks, package
|
|
124
|
+
scripts, and adapters never receive `id-token: write` or `attestations: write`.
|
|
125
|
+
It uploads the exact bundle together with canonical metadata. A fresh
|
|
126
|
+
caller-code-free job downloads that upload by immutable artifact id, checks out
|
|
127
|
+
the called workflow's exact SDK revision, directly imports its verifier under
|
|
128
|
+
supported Node 24, binds the receipt app id to the requested app, and exposes
|
|
129
|
+
the independently reverified artifact, descriptor, and release identities as
|
|
130
|
+
the reusable workflow outputs. This post-upload boundary prevents a background
|
|
131
|
+
caller process from making the published outputs describe pre-upload bytes.
|
|
132
|
+
|
|
133
|
+
GitHub artifact attestation is an explicit `attest: true` input and is false by
|
|
134
|
+
default because availability for private repositories depends on the caller's
|
|
135
|
+
GitHub plan. A caller that requests an unsupported attestation fails instead of
|
|
136
|
+
silently producing weaker provenance. GitHub does not let a called workflow
|
|
137
|
+
raise the caller job's permission ceiling. An attesting caller must therefore
|
|
138
|
+
grant these permissions on the reusable-workflow job itself (prefer this
|
|
139
|
+
job-scoped grant over workflow-wide authority):
|
|
140
|
+
|
|
141
|
+
```yaml
|
|
142
|
+
jobs:
|
|
143
|
+
release-app:
|
|
144
|
+
permissions:
|
|
145
|
+
contents: read
|
|
146
|
+
id-token: write
|
|
147
|
+
attestations: write
|
|
148
|
+
uses: TheWizardNexus/arcane-os-sdk/.github/workflows/release-app.yml@<FULL_40_CHARACTER_COMMIT_SHA>
|
|
149
|
+
with:
|
|
150
|
+
app-id: example-app
|
|
151
|
+
attest: true
|
|
152
|
+
```
|
|
153
|
+
|
|
154
|
+
Without that caller grant, `attest: true` fails even when the repository plan
|
|
155
|
+
supports artifact attestations. When requested, a fresh privileged job
|
|
156
|
+
depends on the successful post-upload verifier, downloads the same immutable
|
|
157
|
+
artifact id with the pinned `actions/download-artifact` revision, checks out only
|
|
158
|
+
`job.workflow_repository` at `job.workflow_sha`, selects supported Node 24 via
|
|
159
|
+
the pinned `actions/setup-node` revision, and directly imports the
|
|
160
|
+
dependency-free verifier from those trusted SDK source bytes. It rechecks the
|
|
161
|
+
app id, bundle structure, digest, byte length, complete
|
|
162
|
+
canonical metadata, and every post-upload workflow output. No package manager,
|
|
163
|
+
dependency resolution, caller checkout, or caller-owned code runs while that job
|
|
164
|
+
holds OIDC and attestation permissions. Whether attested or not, the upload is a
|
|
165
|
+
build output.
|
|
166
|
+
Arcane must verify an approved provenance or independent signature and an
|
|
167
|
+
Arcane-owned authorization-lock entry before installation; the archive's
|
|
168
|
+
internal checksums alone do not grant authority.
|
|
169
|
+
|
|
170
|
+
Stable versioning, the npm `latest` tag, and an official GitHub release remain a
|
|
171
|
+
separate explicit release decision. Current `main` development does not
|
|
172
|
+
silently convert a `-dev` package into an official release. A stable release
|
|
173
|
+
must publish the same matrix-tested `.tgz` under `latest`; only after registry
|
|
174
|
+
integrity matches may GitHub attach that `.tgz`, manifest, and checksum. Its Git
|
|
175
|
+
tag and GitHub release title must both be the same bare numeric
|
|
176
|
+
`MAJOR.MINOR.PATCH`. The first stable change must also activate the documented
|
|
177
|
+
`dev`/`main` branch transition and protections; prerelease versions do not get a
|
|
178
|
+
misleading numeric GitHub release.
|
|
179
|
+
|
|
180
|
+
## Documentation publication
|
|
181
|
+
|
|
182
|
+
GitHub Pages publishes the static `site/` tree from the newest successful
|
|
183
|
+
`main` push `Check`. A completed Check triggers the Pages job, which resolves
|
|
184
|
+
the newest successful receipt at deployment time so out-of-order completion
|
|
185
|
+
cannot roll the site backward. It checks out that authenticated SHA without
|
|
186
|
+
persistent credentials, validates the static tree, and uploads only `site/`.
|
|
187
|
+
It does not rerun the SDK test suite or execute repository build code.
|
|
188
|
+
|
|
189
|
+
The deployment job holds only the read, Pages, and OIDC permissions required by
|
|
190
|
+
that single checked artifact. The `github-pages` environment remains the final
|
|
191
|
+
deployment authority. A separate `/dev/` documentation channel is deferred to
|
|
192
|
+
the same explicit post-release branch transition described above.
|
|
193
|
+
|
|
194
|
+
## Work-amplification record
|
|
195
|
+
|
|
196
|
+
The prerelease branch cardinality is one checked `main` SHA, one npm release
|
|
197
|
+
candidate, one static site, and one Pages artifact. Four source-check jobs cover
|
|
198
|
+
two supported Node lines on Windows and Linux. One producer creates the npm
|
|
199
|
+
tarball once; three native consumers execute those exact bytes on Windows,
|
|
200
|
+
Linux, and macOS; one readiness gate aggregates them. Development publication
|
|
201
|
+
and Pages authenticate and reuse that successful exact-SHA evidence. Neither
|
|
202
|
+
rebuilds the SDK package or reruns the suite, and Pages does not create a second
|
|
203
|
+
site placement.
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
# Arcane OS SDK developer reference
|
|
2
|
+
|
|
3
|
+
This reference answers developer questions in this order:
|
|
4
|
+
|
|
5
|
+
1. **What can the application or tool do?**
|
|
6
|
+
2. **What should I import or call?**
|
|
7
|
+
3. **What does a successful result look like?**
|
|
8
|
+
4. **Where does it run?**
|
|
9
|
+
5. **Only when needed: which transport, host, provider, or kernel boundary implements it?**
|
|
10
|
+
|
|
11
|
+
The default path is capability-first. Transport and implementation detail is
|
|
12
|
+
kept in the [protocol and host architecture guide](protocols.md), and every
|
|
13
|
+
high-level page links to the relevant deep section instead of repeating it.
|
|
14
|
+
|
|
15
|
+
## Reference map
|
|
16
|
+
|
|
17
|
+
| Need | Start here |
|
|
18
|
+
| --- | --- |
|
|
19
|
+
| Use the Node.js package API | [SDK JavaScript API](sdk-api.md) |
|
|
20
|
+
| Publish central events, capture bounded time-travel history, or observe the DOM | [EventManager and event-stack reference](event-manager.md) |
|
|
21
|
+
| Use the `arcane` command | [CLI reference](cli.md) |
|
|
22
|
+
| Choose browser, native, cloud, or cross-host behavior | [Availability and normalization](availability-and-normalization.md) |
|
|
23
|
+
| Import a shipped renderer module | [Runtime module catalog](runtime-modules.md) |
|
|
24
|
+
| Use a shared entity | [Runtime entity modules](runtime-entities.md) and [exact export contracts](core/arcane-entities.md) |
|
|
25
|
+
| Load a reusable HTML component | [Runtime component catalog](runtime-components.md) |
|
|
26
|
+
| Call `globalThis.Arcane` | [Arcane Core API](core/arcane-api.md) |
|
|
27
|
+
| Subscribe to native events | [Arcane event reference](core/arcane-events.md) |
|
|
28
|
+
| Use provider-neutral AI | [Arcane AI contracts](core/arcane-ai-contracts.md) |
|
|
29
|
+
| Use Arcane Ollama | [Arcane Ollama guide](arcane-ollama.md) |
|
|
30
|
+
| Understand transports and protocol switching | [Protocol and host architecture](protocols.md) |
|
|
31
|
+
| Run contract and behavior tests | [Behavioral testing](behavioral-testing.md) |
|
|
32
|
+
|
|
33
|
+
## Version scope and provenance
|
|
34
|
+
|
|
35
|
+
This repository contains two related, explicitly versioned surfaces:
|
|
36
|
+
|
|
37
|
+
| Surface | Source identity | Meaning |
|
|
38
|
+
| --- | --- | --- |
|
|
39
|
+
| SDK and CLI | `arcane-os` `0.1.0-dev.5` | The Node.js toolchain and package exports in this checkout. |
|
|
40
|
+
| Browser runtime | Arcane OS commit `567ad110bf57a1c2d4a3daa22ae93716cc5f4d7e`, bundle `0.8.12`, protocol `arcane/1` | The exact 155-file runtime snapshot shipped under `runtime/`. |
|
|
41
|
+
| Core reference snapshot | Arcane OS commit `567ad110bf57a1c2d4a3daa22ae93716cc5f4d7e`, protocol `arcane/1` | The application-facing Core contract derived into `docs/reference/core/`. Canonical inventory and focused-member content was verified unchanged at Arcane OS `main` commit `13f3ce0ae34f77a3495331c8b4c30b1bb105f8ed`; SDK-local provenance, link, and package-boundary annotations are added explicitly. |
|
|
42
|
+
|
|
43
|
+
The runtime receipt and Core reference remain distinct evidence even though
|
|
44
|
+
they currently share one pinned upstream source identity. A browser module's
|
|
45
|
+
bytes come from the generated runtime receipt. A native build selects one
|
|
46
|
+
explicit Arcane OS checkout and Core. This SDK version accepts that selection
|
|
47
|
+
only after its current native plan checks the exact declared protocol, version,
|
|
48
|
+
features, capabilities, methods, provider contract, and identity-bound
|
|
49
|
+
receipts. That current-build admission does not promise that a future SDK will
|
|
50
|
+
accept this Core or that this SDK will accept a future Core. A matching protocol
|
|
51
|
+
name or higher version alone is not compatibility or authority.
|
|
52
|
+
|
|
53
|
+
See [Core reference provenance](core/README.md) for the imported inventory and
|
|
54
|
+
the exact distinction between a documentation snapshot and shipped runtime
|
|
55
|
+
bytes.
|
|
56
|
+
|
|
57
|
+
## MDN-style page contract
|
|
58
|
+
|
|
59
|
+
Public reference entries follow the established Arcane documentation model:
|
|
60
|
+
|
|
61
|
+
- one canonical, mechanically readable inventory owns each public name;
|
|
62
|
+
- every public member or module has one guide entry headed by its exact name;
|
|
63
|
+
- each guide leads with an overview and the shortest safe working example;
|
|
64
|
+
- parameters, return values, errors, side effects, cancellation, and events are
|
|
65
|
+
stated when they apply;
|
|
66
|
+
- availability is summarized near the call, while transport mechanics are
|
|
67
|
+
folded into or deep-linked from the entry;
|
|
68
|
+
- normalized results are distinguished from provider- or platform-native
|
|
69
|
+
envelopes;
|
|
70
|
+
- examples do not trigger destructive, privileged, expensive, or external
|
|
71
|
+
actions merely by being copied.
|
|
72
|
+
|
|
73
|
+
## Public runtime inventory
|
|
74
|
+
|
|
75
|
+
The Node package exposes 158 semantic JavaScript records across 11 JavaScript
|
|
76
|
+
entrypoints, plus eight JSON Schemas, its exact runtime manifest, and package
|
|
77
|
+
metadata. The [machine-readable package inventory](inventory/package-api.json)
|
|
78
|
+
and [SDK member reference](sdk-api.md) are checked bidirectionally against every
|
|
79
|
+
declared JavaScript export.
|
|
80
|
+
|
|
81
|
+
The seven update-check records are explicit on-demand checks; they do not poll,
|
|
82
|
+
download, install, or self-update.
|
|
83
|
+
|
|
84
|
+
The synchronized browser payload exposes:
|
|
85
|
+
|
|
86
|
+
- 78 JavaScript module artifacts under `runtime/arcane/modules/`, including
|
|
87
|
+
ESM modules, classic vendor globals, one worker protocol, and one Node-oriented
|
|
88
|
+
mail transport;
|
|
89
|
+
- 15 shared entity modules under `runtime/arcane/entities/`;
|
|
90
|
+
- 39 reusable HTML-import components under `runtime/arcane/components/`;
|
|
91
|
+
- seven shared CSS artifacts, security policy, images, and the vendored
|
|
92
|
+
`strong-type` dependency.
|
|
93
|
+
|
|
94
|
+
The module and component catalogs enumerate every shipped artifact, including
|
|
95
|
+
vendor support files that are not ESM imports. The runtime manifest remains the
|
|
96
|
+
byte-level source of truth; the catalogs explain what those bytes let a
|
|
97
|
+
developer do.
|
|
98
|
+
|
|
99
|
+
## Authority and feature detection
|
|
100
|
+
|
|
101
|
+
The presence of a JavaScript function is not permission to use it. Native
|
|
102
|
+
applications should inspect `Arcane.capabilities.list()` where available and
|
|
103
|
+
then call the relevant status method. Android callers with `system.read` obtain
|
|
104
|
+
the nested capability snapshot through `Arcane.platform.status()`.
|
|
105
|
+
|
|
106
|
+
Do not infer local-AI readiness from `Arcane.runtime.current().managedLocalAI`,
|
|
107
|
+
infer authorization from a transport name, or treat an Ollama model inventory
|
|
108
|
+
as package admission. Each method rechecks native policy at invocation time.
|
|
109
|
+
|
|
110
|
+
## Source, receipts, and licensing
|
|
111
|
+
|
|
112
|
+
- [Pinned upstream ARCANE-OS source](https://github.com/TheWizardNexus/ARCANE-OS/tree/567ad110bf57a1c2d4a3daa22ae93716cc5f4d7e)
|
|
113
|
+
- [Exact runtime release manifest](../../runtime/ARCANE_RUNTIME_RELEASE.json)
|
|
114
|
+
- [Reviewed runtime source pin](../../tools/runtime-source.json)
|
|
115
|
+
- [AGPL license](../../LICENSE)
|
|
116
|
+
- [Commercial-license notice](../../COMMERCIAL-LICENSE.md)
|
|
117
|
+
- [Third-party and distribution notice](../../NOTICE)
|
|
@@ -0,0 +1,288 @@
|
|
|
1
|
+
# Arcane Ollama
|
|
2
|
+
|
|
3
|
+
Arcane Ollama lets an admitted application use local Ollama without knowing the
|
|
4
|
+
service port, service account, model directory, host process, or native
|
|
5
|
+
transport. Application code imports one browser module and calls one API:
|
|
6
|
+
|
|
7
|
+
```javascript
|
|
8
|
+
import ollama from '/arcane/modules/Ollama.js';
|
|
9
|
+
|
|
10
|
+
const reply = await ollama.chatText({
|
|
11
|
+
model: 'arcane:latest',
|
|
12
|
+
messages: [{role: 'user', content: 'Summarize this record.'}]
|
|
13
|
+
});
|
|
14
|
+
|
|
15
|
+
console.log(reply);
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
The module never connects directly to `localhost:11434`. It delegates to the
|
|
19
|
+
capability-gated `globalThis.Arcane.ollama` bridge. Core binds application
|
|
20
|
+
identity, checks the exact method and package-owned model policy, admits native
|
|
21
|
+
resources, and calls the managed ArcaneOllama service.
|
|
22
|
+
|
|
23
|
+
This npm package exposes the synchronized browser client only. It does not
|
|
24
|
+
bundle, install, start, or grant an Arcane Core or ArcaneOllama service. Every
|
|
25
|
+
native call therefore requires a separately installed, compatible Arcane host,
|
|
26
|
+
an app-scoped admitted Core session, the required capabilities, and a service
|
|
27
|
+
that is ready under native policy. Import success alone proves none of those
|
|
28
|
+
conditions.
|
|
29
|
+
|
|
30
|
+
## What developers can do
|
|
31
|
+
|
|
32
|
+
| Capability | Preferred call | Result style |
|
|
33
|
+
| --- | --- | --- |
|
|
34
|
+
| Check whether the admitted service answers | `ollama.readiness()` | Arcane-normalized frozen readiness snapshot |
|
|
35
|
+
| Generate text | `ollama.generateText(request)` | Arcane helper string |
|
|
36
|
+
| Chat and return only assistant text | `ollama.chatText(request)` | Arcane helper string |
|
|
37
|
+
| Use full generation/chat/tool/provider fields | `ollama.generate()` / `ollama.chat()` | Bounded Ollama provider-native envelope |
|
|
38
|
+
| Create embeddings | `ollama.embed()` | Bounded Ollama provider-native envelope |
|
|
39
|
+
| Read raw version/model/running/show inventory | `version()`, `models()`, `list()`, `running()`, `show()` | Provider-native diagnostic envelope |
|
|
40
|
+
| Unload one model | `ollama.unload(model)` | Translates to generate with `prompt: ""` and `keep_alive: 0` |
|
|
41
|
+
| Read managed selection/runtime/service settings | `selection()`, `settings()`, `serviceSettings()` | Arcane-managed snapshot; some service fields are platform-dependent |
|
|
42
|
+
| Change managed selection/runtime/service settings | `select()`, `saveSettings()`, `saveServiceSettings()` | Arcane-managed result plus operation receipt |
|
|
43
|
+
| Run admitted raw model mutations | `pull()`, `push()`, `create()`, `copy()`, `delete()` | Policy-bound provider-native result; several calls are intentionally denied to ordinary apps |
|
|
44
|
+
| Create an Arcane-managed brain alias | `createBrain()` | Arcane-managed model/default result plus operation receipt |
|
|
45
|
+
|
|
46
|
+
## Fast start
|
|
47
|
+
|
|
48
|
+
### 1. Feature-detect the module
|
|
49
|
+
|
|
50
|
+
```javascript
|
|
51
|
+
import ollama from '/arcane/modules/Ollama.js';
|
|
52
|
+
|
|
53
|
+
const readiness = await ollama.readiness();
|
|
54
|
+
|
|
55
|
+
if (!readiness.ready) {
|
|
56
|
+
console.info('Local AI is unavailable:', readiness.errorCode);
|
|
57
|
+
}
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
`readiness()` catches a failed `version()` call and returns a frozen object:
|
|
61
|
+
|
|
62
|
+
```text
|
|
63
|
+
{ ready: boolean, version: string|null, errorCode: string|null }
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
It is a connectivity convenience, not model admission or inference readiness.
|
|
67
|
+
Use `Arcane.localAI.status()` when the application needs the package-filtered
|
|
68
|
+
runnable model catalog.
|
|
69
|
+
|
|
70
|
+
### 2. Read admitted models
|
|
71
|
+
|
|
72
|
+
```javascript
|
|
73
|
+
const access = await globalThis.Arcane.capabilities.list();
|
|
74
|
+
|
|
75
|
+
if (!access.methods.includes('localAI.status')) {
|
|
76
|
+
throw new Error('This application is not admitted for local AI.');
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
const status = await globalThis.Arcane.localAI.status();
|
|
80
|
+
console.table(status.models.ollama);
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
Populate product UI from this filtered catalog. `ollama.models()` is the raw
|
|
84
|
+
diagnostic inventory for admitted Settings, Shell, or Terminal journeys; it is
|
|
85
|
+
not the application's package-admitted model list.
|
|
86
|
+
|
|
87
|
+
### 3. Stream a chat response
|
|
88
|
+
|
|
89
|
+
```javascript
|
|
90
|
+
let text = '';
|
|
91
|
+
|
|
92
|
+
const final = await ollama.chat({
|
|
93
|
+
model: 'arcane:latest',
|
|
94
|
+
messages: [{role: 'user', content: 'Explain the evidence.'}]
|
|
95
|
+
}, {
|
|
96
|
+
onChunk(chunk) {
|
|
97
|
+
text += chunk.message?.content ?? '';
|
|
98
|
+
},
|
|
99
|
+
signal: AbortSignal.timeout(60_000)
|
|
100
|
+
});
|
|
101
|
+
|
|
102
|
+
console.log(text, final.done);
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
Arcane correlates chunks to the originating request. The final promise resolves
|
|
106
|
+
with Ollama's final bounded chunk/envelope.
|
|
107
|
+
|
|
108
|
+
## Complete module API
|
|
109
|
+
|
|
110
|
+
`/arcane/modules/Ollama.js` exports the `Ollama` class, a frozen `ollama`
|
|
111
|
+
singleton, and that singleton as the default export. It also installs the
|
|
112
|
+
non-writable `globalThis.arcaneOllama` convenience and emits
|
|
113
|
+
`arcane-ollama-ready`. The pinned class defines exactly 24 public methods: the
|
|
114
|
+
20 bridge delegates below and the four normalized helpers that follow.
|
|
115
|
+
|
|
116
|
+
### Raw bridge methods
|
|
117
|
+
|
|
118
|
+
| Module method | Delegation | Capability/use | Detailed Core guide |
|
|
119
|
+
| --- | --- | --- | --- |
|
|
120
|
+
| `version()` | `Arcane.ollama.version()` | Raw service version diagnostic. | [version](core/reference/arcane-api/ai-and-ollama.md#arcaneollamaversion) |
|
|
121
|
+
| `models()` | `Arcane.ollama.models()` | Raw installed-model diagnostic. | [models](core/reference/arcane-api/ai-and-ollama.md#arcaneollamamodels) |
|
|
122
|
+
| `list()` | Calls `Arcane.ollama.models()` | Module alias for `models()`; it does not call the bridge's separate `list` alias. | [list](core/reference/arcane-api/ai-and-ollama.md#arcaneollamalist) |
|
|
123
|
+
| `running()` | `Arcane.ollama.running()` | Raw resident-model diagnostic. | [running](core/reference/arcane-api/ai-and-ollama.md#arcaneollamarunning) |
|
|
124
|
+
| `show(model, options)` | `Arcane.ollama.show(...)` | Raw bounded model metadata. | [show](core/reference/arcane-api/ai-and-ollama.md#arcaneollamashow) |
|
|
125
|
+
| `generate(request, options)` | `Arcane.ollama.generate(...)` | Admitted generation; optional chunk callback/signal/timeout. | [generate](core/reference/arcane-api/ai-and-ollama.md#arcaneollamagenerate) |
|
|
126
|
+
| `chat(request, options)` | `Arcane.ollama.chat(...)` | Admitted chat/tools; optional chunk callback/signal/timeout. | [chat](core/reference/arcane-api/ai-and-ollama.md#arcaneollamachat) |
|
|
127
|
+
| `embed(request)` | `Arcane.ollama.embed(...)` | Admitted embeddings. | [embed](core/reference/arcane-api/ai-and-ollama.md#arcaneollamaembed) |
|
|
128
|
+
| `pull(model, options, streamOptions)` | `Arcane.ollama.pull(...)` | Managed/policy-bound pull; denied to ordinary raw app flow. | [pull](core/reference/arcane-api/ai-and-ollama.md#arcaneollamapull) |
|
|
129
|
+
| `push(model, options, streamOptions)` | `Arcane.ollama.push(...)` | Raw push is policy-restricted/denied where documented. | [push](core/reference/arcane-api/ai-and-ollama.md#arcaneollamapush) |
|
|
130
|
+
| `create(request, options)` | `Arcane.ollama.create(...)` | Exact package-owned verified definition only. | [create](core/reference/arcane-api/ai-and-ollama.md#arcaneollamacreate) |
|
|
131
|
+
| `copy(source, destination)` | `Arcane.ollama.copy(...)` | Intentionally denied to applications; managed selection owns aliases. | [copy](core/reference/arcane-api/ai-and-ollama.md#arcaneollamacopy) |
|
|
132
|
+
| `delete(model)` | `Arcane.ollama.delete(...)` | Destructive exact package-owned verified model deletion. | [delete](core/reference/arcane-api/ai-and-ollama.md#arcaneollamadelete) |
|
|
133
|
+
| `selection()` | `Arcane.ollama.selection()` | Reads managed model preference/effective state. | [selection](core/reference/arcane-api/ai-and-ollama.md#arcaneollamaselection) |
|
|
134
|
+
| `select(preference)` | `Arcane.ollama.select(...)` | Runs managed size-selection/download/alias workflow. | [select](core/reference/arcane-api/ai-and-ollama.md#arcaneollamaselect) |
|
|
135
|
+
| `settings()` | `Arcane.ollama.settings()` | Reads managed runtime/provider settings. | [settings](core/reference/arcane-api/ai-and-ollama.md#arcaneollamasettings) |
|
|
136
|
+
| `saveSettings(settings)` | `Arcane.ollama.saveSettings(...)` | Saves runtime-owned default/load/context settings. | [saveSettings](core/reference/arcane-api/ai-and-ollama.md#arcaneollamasavesettings) |
|
|
137
|
+
| `createBrain(definition)` | `Arcane.ollama.createBrain(...)` | Creates a managed `arcane-<slug>:latest` alias. | [createBrain](core/reference/arcane-api/ai-and-ollama.md#arcaneollamacreatebrain) |
|
|
138
|
+
| `serviceSettings()` | `Arcane.ollama.serviceSettings()` | Reads host-level Ollama service configuration/support. | [serviceSettings](core/reference/arcane-api/ai-and-ollama.md#arcaneollamaservicesettings) |
|
|
139
|
+
| `saveServiceSettings(settings)` | `Arcane.ollama.saveServiceSettings(...)` | Applies privileged machine-wide service settings/restart. | [saveServiceSettings](core/reference/arcane-api/ai-and-ollama.md#arcaneollamasaveservicesettings) |
|
|
140
|
+
|
|
141
|
+
### Normalized helper methods
|
|
142
|
+
|
|
143
|
+
## `ollama.readiness()`
|
|
144
|
+
|
|
145
|
+
### Overview
|
|
146
|
+
|
|
147
|
+
Calls `version()` and converts success/failure into a frozen readiness snapshot.
|
|
148
|
+
It never throws for service unavailability.
|
|
149
|
+
|
|
150
|
+
### Return value
|
|
151
|
+
|
|
152
|
+
`{ready:true, version, errorCode:null}` on success, or
|
|
153
|
+
`{ready:false, version:null, errorCode}` on failure. A string version and an
|
|
154
|
+
object `{version}` are both accepted.
|
|
155
|
+
|
|
156
|
+
### Example
|
|
157
|
+
|
|
158
|
+
```javascript
|
|
159
|
+
const {ready, version, errorCode} = await ollama.readiness();
|
|
160
|
+
console.log(ready ? version : errorCode);
|
|
161
|
+
```
|
|
162
|
+
|
|
163
|
+
## `ollama.generateText()`
|
|
164
|
+
|
|
165
|
+
### Overview
|
|
166
|
+
|
|
167
|
+
Calls `generate()` and coerces the final envelope's `response` field to a
|
|
168
|
+
string with `String(response?.response || '')`. Valid Ollama responses document
|
|
169
|
+
`response` as a string. If an out-of-contract response supplies a truthy
|
|
170
|
+
nonstring, the helper stringifies it; a missing, null, undefined, or other
|
|
171
|
+
falsy nonstring value becomes an empty string.
|
|
172
|
+
|
|
173
|
+
### Example
|
|
174
|
+
|
|
175
|
+
```javascript
|
|
176
|
+
const text = await ollama.generateText({
|
|
177
|
+
model: 'arcane:latest',
|
|
178
|
+
prompt: 'Write one sentence.'
|
|
179
|
+
});
|
|
180
|
+
```
|
|
181
|
+
|
|
182
|
+
## `ollama.chatText()`
|
|
183
|
+
|
|
184
|
+
### Overview
|
|
185
|
+
|
|
186
|
+
Calls `chat()` and coerces the final envelope's `message.content` field to a
|
|
187
|
+
string with `String(response?.message?.content || '')`. Valid Ollama responses
|
|
188
|
+
document `message.content` as a string. If an out-of-contract response supplies
|
|
189
|
+
a truthy nonstring, the helper stringifies it; a missing, null, undefined, or
|
|
190
|
+
other falsy nonstring value becomes an empty string. Use `chat()` when tool
|
|
191
|
+
calls, metrics, context, or optional provider fields matter.
|
|
192
|
+
|
|
193
|
+
### Example
|
|
194
|
+
|
|
195
|
+
```javascript
|
|
196
|
+
const text = await ollama.chatText({
|
|
197
|
+
model: 'arcane:latest',
|
|
198
|
+
messages: [{role: 'user', content: 'Hello'}]
|
|
199
|
+
});
|
|
200
|
+
```
|
|
201
|
+
|
|
202
|
+
## `ollama.unload()`
|
|
203
|
+
|
|
204
|
+
### Overview
|
|
205
|
+
|
|
206
|
+
Translates `unload(model)` to:
|
|
207
|
+
|
|
208
|
+
```javascript
|
|
209
|
+
ollama.generate({model, prompt: '', keep_alive: 0});
|
|
210
|
+
```
|
|
211
|
+
|
|
212
|
+
It returns the raw final generation envelope. It is a convenience request, not
|
|
213
|
+
a proof that no other admitted client reloaded the model concurrently.
|
|
214
|
+
|
|
215
|
+
### Example
|
|
216
|
+
|
|
217
|
+
```javascript
|
|
218
|
+
async function unloadAfterTheUserChooses(model) {
|
|
219
|
+
return ollama.unload(model);
|
|
220
|
+
}
|
|
221
|
+
```
|
|
222
|
+
|
|
223
|
+
## Availability matrix
|
|
224
|
+
|
|
225
|
+
| Host | Inference | Raw inventory | Managed model/settings mutation | Notes |
|
|
226
|
+
| --- | --- | --- | --- | --- |
|
|
227
|
+
| Microsoft NT desktop Core | Yes when `ai.inference` is admitted | Settings/Shell/Terminal with `ai.models.read` | Admitted Settings/Shell journeys with management capabilities and privilege where required | Full managed ArcaneOllama service path. |
|
|
228
|
+
| Linux desktop Core | Yes when admitted | Admitted diagnostics | Managed workflows where implemented; administrator-owned service settings can return manual/unsupported guidance | Same application API, different host/service implementation. |
|
|
229
|
+
| Android WebView | Narrow admitted chat/inference projection for configured user-managed loopback | No general desktop raw inventory | No desktop model/service management | `managedLocalAI` remains false; listener reachability is not management authority. |
|
|
230
|
+
| Development HTTP bridge | Only when connected to an admitted Core-backed development host | Host/method dependent | Host/method dependent; never production authority | Development transport, not a standalone-browser upgrade. |
|
|
231
|
+
| Standalone browser | No Arcane Ollama | No | No | `ARCANE_OLLAMA_UNAVAILABLE`. |
|
|
232
|
+
| Cloud/OpenAI | Not through `Arcane.ollama` | No | No | Use an explicitly selected `AI.js` cloud profile; no automatic fallback. |
|
|
233
|
+
|
|
234
|
+
## Capabilities and policy
|
|
235
|
+
|
|
236
|
+
- `ai.inference` admits package-filtered local generation, chat, and embeddings.
|
|
237
|
+
- `ai.models.read` admits raw model diagnostics only to authorized system apps.
|
|
238
|
+
- `ai.models.manage` admits policy-bound managed model lifecycle operations.
|
|
239
|
+
- `ai.settings.manage` admits Settings-owned runtime/service configuration.
|
|
240
|
+
- `ai.models.unverified.inference` is an explicit inference-only exception for
|
|
241
|
+
already installed, hardware-admitted unverified models when the package says
|
|
242
|
+
`verified_only:false`; it does not admit model mutation.
|
|
243
|
+
|
|
244
|
+
The method allowlist is necessary but not sufficient. Exact package-owned model
|
|
245
|
+
definitions, reserved aliases, native resources, platform support, installed
|
|
246
|
+
state, and exclusive mutation policy remain authoritative.
|
|
247
|
+
|
|
248
|
+
## Raw versus normalized behavior
|
|
249
|
+
|
|
250
|
+
The module intentionally has two levels:
|
|
251
|
+
|
|
252
|
+
| Boundary | Normalized by Arcane | Intentionally preserved |
|
|
253
|
+
| --- | --- | --- |
|
|
254
|
+
| Missing bridge | Throws coded `ARCANE_OLLAMA_UNAVAILABLE`. | Nothing reaches a provider. |
|
|
255
|
+
| Core call | Promise settlement, capability/policy errors, request limits, diagnostics, stream ids/chunks. | Bounded Ollama success fields and optional provider detail. |
|
|
256
|
+
| `readiness()` | Frozen Boolean/version/error-code snapshot. | Provider error detail is reduced to `errorCode`. |
|
|
257
|
+
| `generateText()` / `chatText()` | Uses `String(value || '')`: documented string values pass through, truthy nonstrings stringify, and falsy nonstrings become empty. | Tool calls, timings, context, and other fields are discarded. |
|
|
258
|
+
| `unload()` | Stable translation to `keep_alive:0`. | Final generation envelope remains provider-native. |
|
|
259
|
+
|
|
260
|
+
## Streaming, cancellation, and uncertain mutation state
|
|
261
|
+
|
|
262
|
+
`generate`, `chat`, `pull`, `push`, and `create` accept stream controls through
|
|
263
|
+
the bridge forms documented on their detailed pages. Core cooperatively cancels
|
|
264
|
+
admitted inference methods where documented. For pull, push, create, selection,
|
|
265
|
+
settings, or service mutation, abort/timeout/page teardown can stop renderer
|
|
266
|
+
observation without proving host work rolled back.
|
|
267
|
+
|
|
268
|
+
After an uncertain model mutation, refresh the relevant raw inventory,
|
|
269
|
+
`selection()`, `settings()`, `serviceSettings()`, or `localAI.status()` before
|
|
270
|
+
retrying. Do not stack a second mutation merely because the renderer timed out.
|
|
271
|
+
|
|
272
|
+
## Behavioral testing
|
|
273
|
+
|
|
274
|
+
The SDK behavior suite uses an explicit fake `Arcane.ollama` to prove:
|
|
275
|
+
|
|
276
|
+
- every wrapper forwards the exact argument objects and provider-native result;
|
|
277
|
+
- stream options and signals are not rewritten;
|
|
278
|
+
- bridge absence throws `ARCANE_OLLAMA_UNAVAILABLE` before provider work;
|
|
279
|
+
- `readiness()` returns frozen success/failure snapshots;
|
|
280
|
+
- `generateText()` and `chatText()` use the pinned `String(value || '')`
|
|
281
|
+
behavior: truthy nonstrings stringify and falsy nonstrings become empty;
|
|
282
|
+
- `unload()` sends exactly `{model, prompt: "", keep_alive: 0}`.
|
|
283
|
+
|
|
284
|
+
Those tests prove the shipped renderer module. Live Core dispatch, cancellation,
|
|
285
|
+
ArcaneOllama health, real model pulls, GPU admission, service restart, and
|
|
286
|
+
rollback remain Arcane OS host/integration evidence.
|
|
287
|
+
|
|
288
|
+
Deep implementation path: [Arcane Ollama protocol](protocols.md#arcane-ollama-protocol-path).
|