@arnilo/prism 0.4.0 → 0.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +33 -1
- package/README.md +23 -20
- package/dist/agent-run-state.d.ts +1 -2
- package/dist/agent-run-state.js +0 -3
- package/dist/agent-session/session/assemble.d.ts +6 -0
- package/dist/agent-session/session/assemble.js +391 -0
- package/dist/agent-session/session/persist.d.ts +28 -0
- package/dist/agent-session/session/persist.js +166 -0
- package/dist/agent-session/session/provider-round.d.ts +6 -0
- package/dist/agent-session/session/provider-round.js +231 -0
- package/dist/agent-session/session/tool-round.d.ts +31 -0
- package/dist/agent-session/session/tool-round.js +473 -0
- package/dist/agent-session/session/types.d.ts +115 -0
- package/dist/agent-session/session/types.js +5 -0
- package/dist/agent-session/session.d.ts +49 -43
- package/dist/agent-session/session.js +11 -1177
- package/dist/capture.d.ts +63 -0
- package/dist/capture.js +67 -0
- package/dist/cli-init.d.ts +18 -2
- package/dist/cli-init.js +2 -7
- package/dist/cli-runner.d.ts +2 -2
- package/dist/cli-runner.js +45 -9
- package/dist/content.d.ts +3 -3
- package/dist/content.js +3 -1
- package/dist/contracts-core/agent.d.ts +2 -0
- package/dist/contracts-core/batch.d.ts +97 -0
- package/dist/contracts-core/batch.js +65 -0
- package/dist/contracts-core/content.d.ts +72 -1
- package/dist/contracts-core/embeddings.d.ts +30 -0
- package/dist/contracts-core/embeddings.js +17 -0
- package/dist/contracts-core/images.d.ts +60 -0
- package/dist/contracts-core/images.js +17 -0
- package/dist/contracts-core/moderation.d.ts +46 -0
- package/dist/contracts-core/moderation.js +34 -0
- package/dist/contracts-core/speech.d.ts +39 -0
- package/dist/contracts-core/speech.js +17 -0
- package/dist/contracts-core/transcription.d.ts +48 -0
- package/dist/contracts-core/transcription.js +17 -0
- package/dist/contracts-core/video.d.ts +61 -0
- package/dist/contracts-core/video.js +17 -0
- package/dist/contracts-core.d.ts +7 -0
- package/dist/contracts-core.js +7 -0
- package/dist/index.d.ts +5 -3
- package/dist/index.js +4 -3
- package/dist/node/agent-definitions.d.ts +1 -8
- package/dist/node/agent-definitions.js +0 -34
- package/dist/node/settings.d.ts +0 -1
- package/dist/node/settings.js +0 -5
- package/dist/pinned-fetch.js +29 -3
- package/dist/provider-events.js +3 -4
- package/dist/providers/media.d.ts +1 -2
- package/dist/providers/media.js +1 -4
- package/dist/rpc.d.ts +1 -1
- package/dist/rpc.js +4 -4
- package/dist/testing/provider-conformance.d.ts +114 -5
- package/dist/testing/provider-conformance.js +342 -0
- package/dist/testing/tool-effect-store-conformance.d.ts +0 -1
- package/dist/testing/tool-effect-store-conformance.js +0 -3
- package/dist/thinking.d.ts +48 -9
- package/dist/thinking.js +134 -8
- package/docs/0.1.0-readiness.md +3 -3
- package/docs/a2a.md +2 -2
- package/docs/acp.md +3 -3
- package/docs/ag-ui-adoption.md +1 -1
- package/docs/ag-ui.md +1 -2
- package/docs/agent-definitions.md +1 -1
- package/docs/agent-events.md +5 -5
- package/docs/agent-identity.md +13 -2
- package/docs/audit-export.md +3 -3
- package/docs/batch-jobs.md +120 -0
- package/docs/cli-rpc.md +20 -9
- package/docs/coding-agent-tools.md +19 -19
- package/docs/coding-review-and-diagnostics.md +2 -2
- package/docs/coding-security.md +4 -4
- package/docs/coding-workspaces.md +2 -2
- package/docs/computer-use-linux.md +13 -2
- package/docs/context-and-skills.md +1 -1
- package/docs/conversations.md +4 -4
- package/docs/credential-storage.md +11 -7
- package/docs/credentials-and-redaction.md +1 -1
- package/docs/data-classification.md +1 -1
- package/docs/database-persistence.md +4 -4
- package/docs/dev-inspector.md +6 -6
- package/docs/device-adapters.md +2 -2
- package/docs/diagrams.md +1 -1
- package/docs/document-reader.md +6 -6
- package/docs/documents.md +5 -4
- package/docs/embeddings.md +112 -0
- package/docs/enterprise-postgres-state.md +7 -7
- package/docs/evaluations.md +8 -8
- package/docs/extensions.md +3 -3
- package/docs/forge-integration.md +3 -3
- package/docs/graft.md +2 -2
- package/docs/guardrails.md +1 -1
- package/docs/host-security.md +15 -15
- package/docs/image-generation.md +129 -0
- package/docs/impeccable.md +5 -3
- package/docs/index.md +60 -33
- package/docs/indexed-code-search.md +2 -2
- package/docs/language-intelligence.md +4 -4
- package/docs/live-testing.md +126 -0
- package/docs/mcp-tools.md +43 -12
- package/docs/middleware-hooks.md +1 -1
- package/docs/migrate-to-0.4.md +3 -3
- package/docs/migrate-to-0.5.md +122 -0
- package/docs/migration.md +29 -1
- package/docs/model-registry.md +38 -0
- package/docs/model-routing.md +5 -5
- package/docs/moderation.md +117 -0
- package/docs/multi-agent-patterns.md +4 -4
- package/docs/multimodal-content.md +26 -2
- package/docs/obscura.md +2 -2
- package/docs/observability.md +32 -7
- package/docs/openapi-tools.md +13 -3
- package/docs/operations.md +11 -0
- package/docs/performance.md +7 -7
- package/docs/persistence-credentials-multimodality-primitives.md +6 -6
- package/docs/policy-and-audit.md +17 -7
- package/docs/ponytail.md +1 -1
- package/docs/postgres-persistence.md +5 -5
- package/docs/process-sessions.md +2 -2
- package/docs/prompt-registry.md +7 -7
- package/docs/provider-caching.md +4 -0
- package/docs/provider-conformance.md +23 -1
- package/docs/provider-packages.md +39 -3
- package/docs/provider-primitives.md +1 -1
- package/docs/provider-request-policies.md +1 -1
- package/docs/providers/ai-sdk.md +15 -3
- package/docs/providers/alibaba.md +5 -1
- package/docs/providers/anthropic.md +4 -0
- package/docs/providers/azure.md +17 -1
- package/docs/providers/bedrock.md +15 -0
- package/docs/providers/clinepass.md +4 -0
- package/docs/providers/commandcode.md +253 -0
- package/docs/providers/deepseek.md +4 -0
- package/docs/providers/google.md +4 -0
- package/docs/providers/hyper.md +284 -0
- package/docs/providers/kimi.md +4 -0
- package/docs/providers/neuralwatt.md +4 -0
- package/docs/providers/ollama.md +15 -0
- package/docs/providers/openai-compatible.md +4 -0
- package/docs/providers/openai.md +4 -0
- package/docs/providers/opencode-go.md +4 -0
- package/docs/providers/openrouter.md +5 -1
- package/docs/providers/vertex.md +16 -0
- package/docs/providers/xai.md +4 -0
- package/docs/providers/zai.md +4 -0
- package/docs/rag.md +26 -4
- package/docs/release-and-install.md +103 -46
- package/docs/resource-loading.md +1 -1
- package/docs/runs-and-usage.md +14 -2
- package/docs/server.md +5 -5
- package/docs/settings-auth-trust-security.md +7 -5
- package/docs/sheets.md +2 -2
- package/docs/speech.md +126 -0
- package/docs/sqlite-persistence.md +4 -4
- package/docs/supervisors.md +3 -3
- package/docs/thinking-and-reasoning.md +93 -60
- package/docs/tool-conformance.md +1 -1
- package/docs/tool-execution-primitives.md +8 -8
- package/docs/tools.md +4 -4
- package/docs/web-tools.md +1 -1
- package/docs/wiki.md +1 -1
- package/docs/work-artifacts-and-review.md +17 -6
- package/docs/work-connectors.md +4 -4
- package/docs/work-tools.md +5 -5
- package/docs/workflow-orchestration-primitives.md +11 -11
- package/docs/workflows.md +5 -5
- package/package.json +11 -8
- package/templates/init/providers.json +24 -8
- package/docs/antigravity-agent.md +0 -207
package/docs/cli-rpc.md
CHANGED
|
@@ -4,14 +4,25 @@
|
|
|
4
4
|
|
|
5
5
|
The `prism` bin is a thin adapter over `AgentSession` plus a tiny project scaffold:
|
|
6
6
|
|
|
7
|
-
- `prism -p "prompt"`: print assistant text deltas.
|
|
8
|
-
- `prism --mode json -p "prompt"`: write one normalized event envelope per line.
|
|
9
|
-
- `prism --mode rpc
|
|
7
|
+
- `prism --provider <id> -p "prompt"`: print assistant text deltas. Provider ids come from the init provider catalog (`templates/init/providers.json`); `mock` is built in, real providers are dynamically imported from their `@arnilo/prism-providers/*` package (must be installed) and read their credential from the catalog's env var. Without `--provider` the CLI fails with a usage error.
|
|
8
|
+
- `prism --mode json --provider <id> -p "prompt"`: write one normalized event envelope per line.
|
|
9
|
+
- `prism --mode rpc --provider <id>`: read LF-delimited JSON requests from stdin and write correlated JSON responses/events to stdout.
|
|
10
10
|
- `prism init <dir>`: create a minimal TypeScript project with one selected provider, `.env.example`, and one offline mock test.
|
|
11
|
-
- `prism dev`: boot the loopback dev inspector over the scaffolded agent (delegates into `@arnilo/prism-dev` when resolvable; plan 040 Task 4).
|
|
11
|
+
- `prism dev`: boot the loopback dev inspector over the scaffolded agent (delegates into `@arnilo/prism-coding-tools/dev` when resolvable; plan 040 Task 4).
|
|
12
12
|
|
|
13
13
|
It does not add a TUI, app tools, provider globals, extension discovery, resource discovery, or credential storage. `init` uses Node standard-library filesystem APIs and checked-in templates only — no interactive prompts or template-engine dependency.
|
|
14
14
|
|
|
15
|
+
## Live CLI journey (plans/064 Task 5)
|
|
16
|
+
|
|
17
|
+
An env-gated e2e journey drives the packed `prism` bin end to end — `init` scaffold (generated offline test passes), `providers add` scaffold, and print/json/rpc modes over a real provider wire with a full-transcript secret scan:
|
|
18
|
+
|
|
19
|
+
```bash
|
|
20
|
+
PRISM_LIVE_PROVIDER_TESTS=1 OPENAI_API_KEY=sk-... \
|
|
21
|
+
node --test scripts/e2e-cli-live.test.mjs
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
The provider is the first init-catalog entry whose credential env var is present; override with `PRISM_LIVE_CLI_PROVIDER=<id>`. Wire legs skip (never fail) when the provider rejects the credential (401/403) — refresh the key and rerun. Registered in `scripts/live-matrix.json` as `cli/journey`.
|
|
25
|
+
|
|
15
26
|
## When to use it
|
|
16
27
|
|
|
17
28
|
Use the CLI for terminal smoke tests, scriptable JSON event streams, simple non-Node clients that can speak newline-delimited JSON, and bootstrapping a tiny host project with `prism init`.
|
|
@@ -32,12 +43,12 @@ prism init <dir> [--template <name>] [--list-templates] [--provider <name>] [--w
|
|
|
32
43
|
| `--template <name>` | Template starter name (`init` [default], `deep-research`). |
|
|
33
44
|
| `--list-templates` | List available starter templates from the templates gallery. |
|
|
34
45
|
| `--provider <name>` | `mock` (default), `openai`, `openrouter`, `kimi`, `zai`, `opencode-go`, or `neuralwatt`. |
|
|
35
|
-
| `--with-workflows` | Add `@arnilo/prism-workflows` and `src/workflows-example.ts`. |
|
|
36
|
-
| `--with-evals` | Add `@arnilo/prism-evals` and `src/evals-example.ts`. |
|
|
46
|
+
| `--with-workflows` | Add `@arnilo/prism-core/runtime/workflows` and `src/workflows-example.ts`. |
|
|
47
|
+
| `--with-evals` | Add `@arnilo/prism-core/governance/evals` and `src/evals-example.ts`. |
|
|
37
48
|
| `--force` | Overwrite generated files when the destination already exists. |
|
|
38
49
|
| `-h`, `--help` | Print init usage. |
|
|
39
50
|
|
|
40
|
-
Default generation (`init` template) installs only `@arnilo/prism` (mock provider). Selecting a real provider adds exactly one dependency: the `@arnilo/prism-providers` family package (the selected adapter imports from `@arnilo/prism-providers/<id>`). Specifying `--template deep-research` scaffolds a flagship deep research agent pipeline (`@arnilo/prism`, `@arnilo/prism-web-tools`, `@arnilo/prism-rag`, `@arnilo/prism-workflows`) with planning, attributable citations, bounded refine loops, and HITL decision clarification. Rerunning without `--force` refuses non-empty destinations and existing generated files. `.env.example` contains placeholders only; `.gitignore` excludes `.env` and local stores.
|
|
51
|
+
Default generation (`init` template) installs only `@arnilo/prism` (mock provider). Selecting a real provider adds exactly one dependency: the `@arnilo/prism-providers` family package (the selected adapter imports from `@arnilo/prism-providers/<id>`). Specifying `--template deep-research` scaffolds a flagship deep research agent pipeline (`@arnilo/prism`, `@arnilo/prism-web-tools`, `@arnilo/prism-memory/rag`, `@arnilo/prism-core/runtime/workflows`) with planning, attributable citations, bounded refine loops, and HITL decision clarification. Rerunning without `--force` refuses non-empty destinations and existing generated files. `.env.example` contains placeholders only; `.gitignore` excludes `.env` and local stores.
|
|
41
52
|
|
|
42
53
|
|
|
43
54
|
### `prism providers add` (0.1.7)
|
|
@@ -78,7 +89,7 @@ stub with docs-verified values before publishing.
|
|
|
78
89
|
prism dev [--port <n>] [--host <addr>]
|
|
79
90
|
```
|
|
80
91
|
|
|
81
|
-
Runs the local dev inspector over the current `prism init` scaffold's agent. Delegation, not duplication: the subcommand resolves `@arnilo/prism-dev` from the project's own `node_modules` (falling back to the CLI's own installation) and hands over to its `runDevCli` entry; unresolvable → install hint, exit `2`.
|
|
92
|
+
Runs the local dev inspector over the current `prism init` scaffold's agent. Delegation, not duplication: the subcommand resolves `@arnilo/prism-coding-tools/dev` from the project's own `node_modules` (falling back to the CLI's own installation) and hands over to its `runDevCli` entry; unresolvable → install hint, exit `2`.
|
|
82
93
|
|
|
83
94
|
| Flag / arg | Purpose |
|
|
84
95
|
| --- | --- |
|
|
@@ -222,7 +233,7 @@ CLI/RPC are adapters over `AgentSession`. They do not scan packages, import exte
|
|
|
222
233
|
|
|
223
234
|
RPC `command` executes only explicitly registered `CommandDefinition` values. `setModel` stores a model override for later prompt/follow-up calls. `compact`, `switchSession`, `forkSession`, `cloneSession`, and `checkout` call the existing session APIs.
|
|
224
235
|
|
|
225
|
-
Optional workflow control (from `@arnilo/prism-workflows`) registers `workflow.start`, `workflow.enqueue`, `workflow.replay`, `workflow.status`, `workflow.list`, `workflow.cancel`, and `workflow.resume` via `createWorkflowCommands({ workflows, checkpoints, runOptions? })`. Supplying an ownership-scoped `schedules` service additionally registers `schedule.create`, `schedule.list`, `schedule.pause`, `schedule.resume`, `schedule.trigger`, and `schedule.delete`. Pass the returned `CommandDefinition[]` into `runRpcServer({ commands })` the same way as observational-memory commands. Cancel aborts in-process runs through the package active-run registry; orphaned durable checkpoints still marked `running` are fail-closed to `aborted`.
|
|
236
|
+
Optional workflow control (from `@arnilo/prism-core/runtime/workflows`) registers `workflow.start`, `workflow.enqueue`, `workflow.replay`, `workflow.status`, `workflow.list`, `workflow.cancel`, and `workflow.resume` via `createWorkflowCommands({ workflows, checkpoints, runOptions? })`. Supplying an ownership-scoped `schedules` service additionally registers `schedule.create`, `schedule.list`, `schedule.pause`, `schedule.resume`, `schedule.trigger`, and `schedule.delete`. Pass the returned `CommandDefinition[]` into `runRpcServer({ commands })` the same way as observational-memory commands. Cancel aborts in-process runs through the package active-run registry; orphaned durable checkpoints still marked `running` are fail-closed to `aborted`.
|
|
226
237
|
|
|
227
238
|
Suspended workflow resume parameters are `{ workflowId, runId, decision: "approve" | "deny", input?, expectedVersion, ownership? }`. Read `expectedVersion` from `workflow.status`/`workflow.list`; stale or duplicate decisions fail checkpoint CAS before node execution. Ordinary recovery resume for failed/aborted runs remains backward-compatible without decision fields.
|
|
228
239
|
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
## What it does
|
|
4
4
|
|
|
5
|
-
`@arnilo/prism-coding-agent` is an optional first-party package that provides host shell/filesystem/repository tools as Prism `ToolDefinition` objects. It ships nine default coding tools — `shell`, `read`, `write`, `edit`, `repo_list`, `repo_search`, `glob`, `delete`, `move` — plus opt-in structured Git/check set (`createGitTools`), opt-in `createAskUserDecisionTool({ ask })`, and bounded coding-plan/checkpoint helpers. The tools are **inert** until a host imports them and registers them into a `ToolRegistry`. Hosts may register any subset, omit aggregators entirely, or mix first-party tools with host-owned `ToolDefinition`s. Behavior for shell/read/write/edit is a behavioral port of the pi coding agent's tools, adapted to Prism's `ToolDefinition` / `ToolResult` contracts (no `@earendil-works/*` or `typebox` dependencies; only `diff` plus the Node standard library). List/search/glob/Git are native Prism tools with no picomatch/ripgrep/Git-library dependency (hand-rolled `*`/`?`/`**` glob matcher).
|
|
5
|
+
`@arnilo/prism-coding-tools/agent` is an optional first-party package that provides host shell/filesystem/repository tools as Prism `ToolDefinition` objects. It ships nine default coding tools — `shell`, `read`, `write`, `edit`, `repo_list`, `repo_search`, `glob`, `delete`, `move` — plus opt-in structured Git/check set (`createGitTools`), opt-in `createAskUserDecisionTool({ ask })`, and bounded coding-plan/checkpoint helpers. The tools are **inert** until a host imports them and registers them into a `ToolRegistry`. Hosts may register any subset, omit aggregators entirely, or mix first-party tools with host-owned `ToolDefinition`s. Behavior for shell/read/write/edit is a behavioral port of the pi coding agent's tools, adapted to Prism's `ToolDefinition` / `ToolResult` contracts (no `@earendil-works/*` or `typebox` dependencies; only `diff` plus the Node standard library). List/search/glob/Git are native Prism tools with no picomatch/ripgrep/Git-library dependency (hand-rolled `*`/`?`/`**` glob matcher).
|
|
6
6
|
|
|
7
7
|
| Export | Purpose |
|
|
8
8
|
| --- | --- |
|
|
@@ -44,7 +44,7 @@ Each factory returns a plain `ToolDefinition` (no auto-registration). Register w
|
|
|
44
44
|
|
|
45
45
|
```ts
|
|
46
46
|
import { createToolRegistry } from "@arnilo/prism";
|
|
47
|
-
import { createCodingTools } from "@arnilo/prism-coding-agent";
|
|
47
|
+
import { createCodingTools } from "@arnilo/prism-coding-tools/agent";
|
|
48
48
|
|
|
49
49
|
const tools = createToolRegistry(createCodingTools(process.cwd()));
|
|
50
50
|
```
|
|
@@ -56,7 +56,7 @@ Every tool carries an explicit `kind` (`shell`→`execute`, `read`/`repo_list`
|
|
|
56
56
|
`createAcpFilesystemOperations` adapts any client with `readTextFile({ path, line?, limit? })` and `writeTextFile({ path, content })` methods to the `ReadOperations`, `WriteOperations`, and `EditOperations` seams. All reads and writes stay client-backed; `mkdir` is a no-op, `statFile` measures a bounded UTF-8 text read, and image MIME detection is always `null`.
|
|
57
57
|
|
|
58
58
|
```ts
|
|
59
|
-
import { createAcpFilesystemOperations, createCodingTools } from "@arnilo/prism-coding-agent";
|
|
59
|
+
import { createAcpFilesystemOperations, createCodingTools } from "@arnilo/prism-coding-tools/agent";
|
|
60
60
|
|
|
61
61
|
const operations = createAcpFilesystemOperations(clientFilesystem);
|
|
62
62
|
const tools = createCodingTools(cwd, {
|
|
@@ -72,11 +72,11 @@ This is an editor-buffer adapter, not a repository backend: `repo_list`, `repo_s
|
|
|
72
72
|
|
|
73
73
|
Use this package when a host wants ready-made coding tools for an agent, session, or run, registered explicitly into a `ToolRegistry` and dispatched through the normal Prism tool harness. The tools perform **real** shell and filesystem operations on the host — they are not mocked or sandboxed. Use the individual factories when you need per-tool options or custom operation backends; use the aggregators when you want the default set.
|
|
74
74
|
|
|
75
|
-
Do not use this package as a sandbox, permission policy, secret store, or provider loop. Prism gates tool dispatch with `PermissionPolicy` / `ToolValidator` / trust policies; pass an optional `ExecutionPolicy` (for example from `@arnilo/prism-coding-security`) for path/command approval before side effects. Do not register these tools for an untrusted provider.
|
|
75
|
+
Do not use this package as a sandbox, permission policy, secret store, or provider loop. Prism gates tool dispatch with `PermissionPolicy` / `ToolValidator` / trust policies; pass an optional `ExecutionPolicy` (for example from `@arnilo/prism-coding-tools/security`) for path/command approval before side effects. Do not register these tools for an untrusted provider.
|
|
76
76
|
|
|
77
77
|
```ts
|
|
78
|
-
import { createCodingTools } from "@arnilo/prism-coding-agent";
|
|
79
|
-
import { createCodingApprovalPolicy } from "@arnilo/prism-coding-security";
|
|
78
|
+
import { createCodingTools } from "@arnilo/prism-coding-tools/agent";
|
|
79
|
+
import { createCodingApprovalPolicy } from "@arnilo/prism-coding-tools/security";
|
|
80
80
|
|
|
81
81
|
const tools = createCodingTools(workspaceRoot, {
|
|
82
82
|
executionPolicy: createCodingApprovalPolicy({
|
|
@@ -88,7 +88,7 @@ const tools = createCodingTools(workspaceRoot, {
|
|
|
88
88
|
|
|
89
89
|
### pi name mapping
|
|
90
90
|
|
|
91
|
-
| Prism (`@arnilo/prism-coding-agent`) | pi coding agent |
|
|
91
|
+
| Prism (`@arnilo/prism-coding-tools/agent`) | pi coding agent |
|
|
92
92
|
| --- | --- |
|
|
93
93
|
| `shell` | `bash` |
|
|
94
94
|
| `read` | `read` |
|
|
@@ -180,7 +180,7 @@ Read a text or image file.
|
|
|
180
180
|
| `executionPolicy` | — | Structured pre-execution policy (see [Coding security](coding-security.md)). |
|
|
181
181
|
|
|
182
182
|
```ts
|
|
183
|
-
import { createReadTool, DEFAULT_MAX_IMAGE_BYTES } from "@arnilo/prism-coding-agent";
|
|
183
|
+
import { createReadTool, DEFAULT_MAX_IMAGE_BYTES } from "@arnilo/prism-coding-tools/agent";
|
|
184
184
|
|
|
185
185
|
const read = createReadTool(cwd, {
|
|
186
186
|
maxImageBytes: DEFAULT_MAX_IMAGE_BYTES,
|
|
@@ -229,7 +229,7 @@ Default local `writeFile` uses same-directory temp + `rename` so a crash mid-wri
|
|
|
229
229
|
Hosts may opt in to a session-scoped soft guard: share one `createReadPathSet()` across `read` / `write` / `edit` and set `requireReadBeforeWrite: true` on write/edit options. Successful `read` marks the path; unread existing-file writes/edits fail with a clear error unless `force: true`. Default is **off** (no behavior change for hosts that ignore it).
|
|
230
230
|
|
|
231
231
|
```ts
|
|
232
|
-
import { createReadPathSet, createReadTool, createWriteTool, createEditTool } from "@arnilo/prism-coding-agent";
|
|
232
|
+
import { createReadPathSet, createReadTool, createWriteTool, createEditTool } from "@arnilo/prism-coding-tools/agent";
|
|
233
233
|
|
|
234
234
|
const readPaths = createReadPathSet();
|
|
235
235
|
const read = createReadTool(cwd, { readPathSet: readPaths });
|
|
@@ -240,7 +240,7 @@ const edit = createEditTool(cwd, { requireReadBeforeWrite: true, readPathSet: re
|
|
|
240
240
|
Since 0.1.3 (plan 015 Task 4) hosts may opt in to persisting the set across restarts via the host-owned `CheckpointStore`:
|
|
241
241
|
|
|
242
242
|
```ts
|
|
243
|
-
import { createReadPathSet, createReadPathSetPersistence } from "@arnilo/prism-coding-agent";
|
|
243
|
+
import { createReadPathSet, createReadPathSetPersistence } from "@arnilo/prism-coding-tools/agent";
|
|
244
244
|
|
|
245
245
|
const readPaths = createReadPathSet();
|
|
246
246
|
const persistence = createReadPathSetPersistence({ checkpoints, key: sessionId, ownership });
|
|
@@ -287,7 +287,7 @@ List repository entries with deterministic relative paths. Uses Node `opendir`/`
|
|
|
287
287
|
- **Security:** `.git` internals never listed; paths re-checked against the workspace root; symlink escapes match native fail-closed behavior.
|
|
288
288
|
|
|
289
289
|
```ts
|
|
290
|
-
import { createCodingTools, createGitAwareRepositoryOperations } from "@arnilo/prism-coding-agent";
|
|
290
|
+
import { createCodingTools, createGitAwareRepositoryOperations } from "@arnilo/prism-coding-tools/agent";
|
|
291
291
|
|
|
292
292
|
const operations = createGitAwareRepositoryOperations(cwd); // native fallback outside Git
|
|
293
293
|
const tools = createCodingTools(cwd, { repository: { operations } });
|
|
@@ -392,7 +392,7 @@ Opt-in tools over a host-pinned Git executable (`gitPath`, default `/usr/bin/git
|
|
|
392
392
|
| `coding_check` | Included when `checks` are declared: model selects only a name; executable/args/env are host-fixed. |
|
|
393
393
|
|
|
394
394
|
```ts
|
|
395
|
-
import { createGitTools } from "@arnilo/prism-coding-agent";
|
|
395
|
+
import { createGitTools } from "@arnilo/prism-coding-tools/agent";
|
|
396
396
|
|
|
397
397
|
const gitTools = createGitTools(workspaceRoot, {
|
|
398
398
|
gitPath: "/usr/bin/git",
|
|
@@ -431,7 +431,7 @@ import {
|
|
|
431
431
|
createCodingTools,
|
|
432
432
|
suspendAskUserDecision,
|
|
433
433
|
createAskUserDecisionResumeValidator,
|
|
434
|
-
} from "@arnilo/prism-coding-agent";
|
|
434
|
+
} from "@arnilo/prism-coding-tools/agent";
|
|
435
435
|
|
|
436
436
|
const tools = createToolRegistry([
|
|
437
437
|
...createCodingTools(workspaceRoot),
|
|
@@ -453,10 +453,10 @@ return suspendAskUserDecision({
|
|
|
453
453
|
|
|
454
454
|
### Goal → verify helper (`runCodingGoalVerify`)
|
|
455
455
|
|
|
456
|
-
Thin composition over existing plan Markdown, named checks, workflow `suspend`/`resumeWorkflow`, and bounded PR handoff. **No Goal table / second runtime.** Peer `@arnilo/prism-workflows`. Example: `examples/coding-goal-verify.ts`.
|
|
456
|
+
Thin composition over existing plan Markdown, named checks, workflow `suspend`/`resumeWorkflow`, and bounded PR handoff. **No Goal table / second runtime.** Peer `@arnilo/prism-core/runtime/workflows`. Example: `examples/coding-goal-verify.ts`.
|
|
457
457
|
|
|
458
458
|
```ts
|
|
459
|
-
import { runCodingGoalVerify } from "@arnilo/prism-coding-agent";
|
|
459
|
+
import { runCodingGoalVerify } from "@arnilo/prism-coding-tools/agent";
|
|
460
460
|
|
|
461
461
|
const result = await runCodingGoalVerify({
|
|
462
462
|
goal: "Fix the flake",
|
|
@@ -524,7 +524,7 @@ Minimal drop-in for any Prism app:
|
|
|
524
524
|
|
|
525
525
|
```ts
|
|
526
526
|
import { createToolRegistry } from "@arnilo/prism";
|
|
527
|
-
import { createCodingTools, createReadOnlyTools } from "@arnilo/prism-coding-agent";
|
|
527
|
+
import { createCodingTools, createReadOnlyTools } from "@arnilo/prism-coding-tools/agent";
|
|
528
528
|
|
|
529
529
|
// Full coding set (shell + read + write + edit + repo_list + repo_search + glob + delete + move):
|
|
530
530
|
const tools = createToolRegistry(createCodingTools(process.cwd()));
|
|
@@ -536,7 +536,7 @@ const ro = createToolRegistry(createReadOnlyTools(process.cwd()));
|
|
|
536
536
|
Customizing a single tool (force bash, cap output, delegate writes to a remote backend):
|
|
537
537
|
|
|
538
538
|
```ts
|
|
539
|
-
import { createShellTool, createWriteTool } from "@arnilo/prism-coding-agent";
|
|
539
|
+
import { createShellTool, createWriteTool } from "@arnilo/prism-coding-tools/agent";
|
|
540
540
|
|
|
541
541
|
const shell = createShellTool("/repo", {
|
|
542
542
|
shellPath: "/bin/bash",
|
|
@@ -560,11 +560,11 @@ Packed capability demo: `examples/coding-tools-capability-gaps.ts` (search modes
|
|
|
560
560
|
|
|
561
561
|
## Extension and configuration notes
|
|
562
562
|
|
|
563
|
-
- **Long coding sessions.** Use `createCodingCompactionStrategy()` from optional `@arnilo/prism-compaction
|
|
563
|
+
- **Long coding sessions.** Use `createCodingCompactionStrategy()` from optional `@arnilo/prism-memory/compaction/llm` when history needs a bounded coding handoff. It is selected explicitly through normal `session.compact()` / agent compaction configuration, preserves raw session entries, and prioritizes file paths, patch intent, checks, plan/todo state, blockers, and verification steps. It does not read files, retain full diffs, or create a second coding runtime.
|
|
564
564
|
- **Pluggable operation backends.** Every tool accepts an `operations` seam. Custom `ReadOperations` must implement bounded `readText` plus `statFile`; custom `EditOperations` must implement `statFile`; read/write methods receive caps/signals. `BashOperations` must stream through `onData` and honor `signal`/`timeout`. Custom `RepositoryOperations` must honor depth/entry/file/match/scan/time caps and abort (including `glob`). Custom `DeleteOperations` / `MoveOperations` must honor containment and abort. A hostile custom backend can still violate its host-owned contract, so isolate it separately.
|
|
565
565
|
- **Per-tool options.** `ShellToolOptions` adds `timeout` and `maxTotalOutputBytes`; `ReadToolOptions` adds `maxScanBytes` and optional `readPathSet`; `WriteToolOptions` / `EditToolOptions` add input caps plus optional `requireReadBeforeWrite` / `readPathSet` / `force`; list/search/glob accept `repository` limits and shared aggregator `ToolsOptions.repository`.
|
|
566
566
|
- **Aggregator options.** `ToolsOptions` (`{ executionPolicy?, shell?, read?, write?, edit?, delete?, move?, list?, search?, glob?, repository? }`) threads each sub-object to the matching tool. `createCodingTools()`, `createAllTools()`, and `createReadOnlyTools()` apply the shared policy unless that tool has an explicit per-tool override. Full membership is nine tools; read-only is `read` + `repo_list` + `repo_search` + `glob`.
|
|
567
|
-
- **Sandbox composition.** Prefer `@arnilo/prism-coding-security` `createSandboxCodingComposition(cwd, { workspaceMode, sandbox, ... })` (or tools-only wrappers). `workspaceMode` is required: `"sandbox"` keeps shell/read/write/edit/list/search/glob/delete/move on one disposable tree; `"host"` runs against host cwd and never claims containment. Mixed sandbox-shell + host-FS wiring throws unless `allowMixedWorkspaceWiring: true`. Same-tree Git: `createGitTools(composition.workspaceRoot, { execFile: sandbox.execFile, commitIdentity })`.
|
|
567
|
+
- **Sandbox composition.** Prefer `@arnilo/prism-coding-tools/security` `createSandboxCodingComposition(cwd, { workspaceMode, sandbox, ... })` (or tools-only wrappers). `workspaceMode` is required: `"sandbox"` keeps shell/read/write/edit/list/search/glob/delete/move on one disposable tree; `"host"` runs against host cwd and never claims containment. Mixed sandbox-shell + host-FS wiring throws unless `allowMixedWorkspaceWiring: true`. Same-tree Git: `createGitTools(composition.workspaceRoot, { execFile: sandbox.execFile, commitIdentity })`.
|
|
568
568
|
- **`ToolsOptions`** and the per-tool option types are exported from the package barrel for host configuration.
|
|
569
569
|
- No auto-discovery or manifest registration: import and register explicitly. This package registers no extensions and owns no globals (the mutation queue is a process-wide per-path map — see `ponytail:` note in the source).
|
|
570
570
|
|
|
@@ -19,8 +19,8 @@ Bounded patch-review manifests plus normalized LSP/check diagnostics for the cod
|
|
|
19
19
|
A review is created per patch handoff. The manifest binds: repository identity (credential-free remote fingerprint + default branch + optional worktree path), `base`/`head`, the patch artifact reference (`kind`, `uri`, `sha256`, `bytes`), changed paths, diffstat, named-check summaries, and diagnostic summaries. The `digest` is SHA-256 over the canonical manifest JSON; the structural artifact input carries the manifest in `preview.review` and the patch SHA-256 as the artifact hash.
|
|
20
20
|
|
|
21
21
|
```ts
|
|
22
|
-
import { createCodingPatchReviewManifest, assertCodingPatchAccepted } from "@arnilo/prism-coding-agent";
|
|
23
|
-
import { createArtifactService } from "@arnilo/prism-server";
|
|
22
|
+
import { createCodingPatchReviewManifest, assertCodingPatchAccepted } from "@arnilo/prism-coding-tools/agent";
|
|
23
|
+
import { createArtifactService } from "@arnilo/prism-core/runtime/server";
|
|
24
24
|
|
|
25
25
|
const { review, artifactInput } = createCodingPatchReviewManifest({
|
|
26
26
|
threadId: "thread-1",
|
package/docs/coding-security.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
## What it does
|
|
4
4
|
|
|
5
|
-
`@arnilo/prism-coding-security` is an optional package that supplies structured execution policy for `@arnilo/prism-coding-agent` tools and one disposable Docker/OCI sandbox reference. It complements name-based `PermissionPolicy` at dispatch time with path/command context checked **inside** each tool before side effects, and optionally contains untrusted coding work in a host-invoked container.
|
|
5
|
+
`@arnilo/prism-coding-tools/security` is an optional package that supplies structured execution policy for `@arnilo/prism-coding-tools/agent` tools and one disposable Docker/OCI sandbox reference. It complements name-based `PermissionPolicy` at dispatch time with path/command context checked **inside** each tool before side effects, and optionally contains untrusted coding work in a host-invoked container.
|
|
6
6
|
|
|
7
7
|
| Export | Purpose |
|
|
8
8
|
| --- | --- |
|
|
@@ -43,7 +43,7 @@ Use `createEgressPolicy()` + `createAllowListEgressProxy()` when a coding agent
|
|
|
43
43
|
`createEgressPolicy({ allow, presets })` builds a deny-all policy. Rules are exact `{ host, port, protocol }` triples — no wildcards, no CIDR, no regex. Presets (`npm-registry`, `github`) expand to explicit rule lists at construction. The policy exposes a stable SHA-256 `fingerprint` over the canonical rule set.
|
|
44
44
|
|
|
45
45
|
```ts
|
|
46
|
-
import { createEgressPolicy, createAllowListEgressProxy } from "@arnilo/prism-coding-security";
|
|
46
|
+
import { createEgressPolicy, createAllowListEgressProxy } from "@arnilo/prism-coding-tools/security";
|
|
47
47
|
|
|
48
48
|
const policy = createEgressPolicy({
|
|
49
49
|
allow: [{ host: "api.github.com", port: 443, protocol: "https" }],
|
|
@@ -144,8 +144,8 @@ import {
|
|
|
144
144
|
createCodingApprovalPolicy,
|
|
145
145
|
createDockerSandbox,
|
|
146
146
|
createSandboxCodingComposition,
|
|
147
|
-
} from "@arnilo/prism-coding-security";
|
|
148
|
-
import { createGitTools } from "@arnilo/prism-coding-agent";
|
|
147
|
+
} from "@arnilo/prism-coding-tools/security";
|
|
148
|
+
import { createGitTools } from "@arnilo/prism-coding-tools/agent";
|
|
149
149
|
|
|
150
150
|
const policy = createCodingApprovalPolicy({
|
|
151
151
|
roots: [workspaceRoot],
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
# Coding workspaces
|
|
2
2
|
|
|
3
|
-
Ownership-scoped multi-repository and worktree lifecycle (plan 026 Task 3, `@arnilo/prism-coding-agent`). A durable coding workspace correlates task/session/run identity with host repositories and linked worktrees so that resume, cleanup, artifacts, and recovery stay bounded and reconcilable.
|
|
3
|
+
Ownership-scoped multi-repository and worktree lifecycle (plan 026 Task 3, `@arnilo/prism-coding-tools/agent`). A durable coding workspace correlates task/session/run identity with host repositories and linked worktrees so that resume, cleanup, artifacts, and recovery stay bounded and reconcilable.
|
|
4
4
|
|
|
5
5
|
The lifecycle composes existing bounded primitives only: `CheckpointStore` CAS records in a separate versioned namespace (`prism.coding-agent.workspace.v1`), `LeaseStore` fencing, and cwd-bound `GitOperations` runners. There is no clone manager, Git library, watcher, new database schema, or second task runtime.
|
|
6
6
|
|
|
7
7
|
## Activation
|
|
8
8
|
|
|
9
9
|
```ts
|
|
10
|
-
import { createCodingWorkspaceLifecycle } from "@arnilo/prism-coding-agent";
|
|
10
|
+
import { createCodingWorkspaceLifecycle } from "@arnilo/prism-coding-tools/agent";
|
|
11
11
|
|
|
12
12
|
const workspaces = createCodingWorkspaceLifecycle({
|
|
13
13
|
checkpoints, // CheckpointStore (ownership-scoped)
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
## What it does
|
|
4
4
|
|
|
5
|
-
`@arnilo/prism-computer-use-linux` wraps the host-owned [`computer-use-linux`](https://github.com/agent-sh/computer-use-linux) MCP binary as Prism `ToolDefinition`s. It connects over stdio only when `createComputerUseLinuxTools()` is called, keeps upstream tool names, filters unknown tools, and composes desktop admission, execution approval, result bounds, serialization, redaction, and trust labeling over Prism's existing seams.
|
|
5
|
+
`@arnilo/prism-coding-tools/computer-use-linux` wraps the host-owned [`computer-use-linux`](https://github.com/agent-sh/computer-use-linux) MCP binary as Prism `ToolDefinition`s. It connects over stdio only when `createComputerUseLinuxTools()` is called, keeps upstream tool names, filters unknown tools, and composes desktop admission, execution approval, result bounds, serialization, redaction, and trust labeling over Prism's existing seams.
|
|
6
6
|
|
|
7
7
|
The package also exports `loadComputerUseLinuxSkill()`, which loads the short Prism-authored desktop procedure bundled at `skills/computer-use-linux/SKILL.md`. It does not resolve or vendor an upstream skill tree.
|
|
8
8
|
|
|
@@ -75,7 +75,7 @@ import { createToolRegistry, type Skill } from "@arnilo/prism";
|
|
|
75
75
|
import {
|
|
76
76
|
createComputerUseLinuxTools,
|
|
77
77
|
loadComputerUseLinuxSkill,
|
|
78
|
-
} from "@arnilo/prism-computer-use-linux";
|
|
78
|
+
} from "@arnilo/prism-coding-tools/computer-use-linux";
|
|
79
79
|
|
|
80
80
|
async function installDesktop(hostSkills: { register(skill: Skill): void }, hostApproved: boolean) {
|
|
81
81
|
const desktop = await createComputerUseLinuxTools({
|
|
@@ -112,6 +112,17 @@ async function installDesktop(hostSkills: { register(skill: Skill): void }, host
|
|
|
112
112
|
- Imports are inert. The default setup surface is off, the skill file is capped at 64 KiB, and no full upstream skill tree is shipped.
|
|
113
113
|
- The host must keep credentials, desktop session state, binary paths, sandbox identity, and approval state outside model-controlled arguments.
|
|
114
114
|
|
|
115
|
+
## Live probe (plans/064 Task 7)
|
|
116
|
+
|
|
117
|
+
A live leg drives the host's real `computer-use-linux` MCP binary over stdio — real tool inventory, one bounded read-only screenshot, clean close (≤30 s):
|
|
118
|
+
|
|
119
|
+
```bash
|
|
120
|
+
PRISM_TEST_COMPUTER_USE=1 PRISM_COMPUTER_USE_BIN="$(command -v computer-use-linux)" \
|
|
121
|
+
node --test packages/prism-coding-tools/dist/computer-use-linux/__tests__/live.test.js
|
|
122
|
+
```
|
|
123
|
+
|
|
124
|
+
Skips (never fails) when the flag, binary path, or a desktop session is unavailable. The suite performs no network I/O, so screenshot bytes cannot leave the process. Registered in `scripts/live-matrix.json` as `coding-tools/computer-use-live`.
|
|
125
|
+
|
|
115
126
|
## Related APIs
|
|
116
127
|
|
|
117
128
|
- [Device adapters](device-adapters.md): generic admission, shared limits, chunk bounds, and telemetry redaction contract.
|
|
@@ -200,7 +200,7 @@ await agent.createSession().run("…", { activeSkills: ["ponytail"] });
|
|
|
200
200
|
|
|
201
201
|
### Third-party behavior packages (Caveman, Ponytail, Impeccable)
|
|
202
202
|
|
|
203
|
-
`@arnilo/prism-caveman` and `@arnilo/prism-ponytail` register upstream skills into the extension kernel skill registry. Hosts should:
|
|
203
|
+
`@arnilo/prism-coding-tools/caveman` and `@arnilo/prism-coding-tools/ponytail` register upstream skills into the extension kernel skill registry. Hosts should:
|
|
204
204
|
|
|
205
205
|
1. `kernel.load([createCavemanExtension(...), createPonytailExtension(...)])` with session `appendEntry` / `getEntries` callbacks.
|
|
206
206
|
2. Build `createSkillRegistry(kernel.registries.skills.list())` and pass `activeSkills` / `resolveActiveSkills` names.
|
package/docs/conversations.md
CHANGED
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
|
|
3
3
|
## What it does
|
|
4
4
|
|
|
5
|
-
`@arnilo/prism-server` ships a durable, user-scoped conversation service: create/list/get/continue/branch/archive/export/delete conversation threads on top of the existing session and event-ledger seams. A thread **is** an ownership-scoped session branch plus a `prismConversation` marker in `SessionRecord.metadata`; content stays in session entries and the redacted event ledger. Reconnectable replay pages durable redacted events without ever rerunning a provider or tool.
|
|
5
|
+
`@arnilo/prism-core/runtime/server` ships a durable, user-scoped conversation service: create/list/get/continue/branch/archive/export/delete conversation threads on top of the existing session and event-ledger seams. A thread **is** an ownership-scoped session branch plus a `prismConversation` marker in `SessionRecord.metadata`; content stays in session entries and the redacted event ledger. Reconnectable replay pages durable redacted events without ever rerunning a provider or tool.
|
|
6
6
|
|
|
7
|
-
Core (`@arnilo/prism`) exports only conversation **types and pure helpers** (`ConversationThread`, `ConversationError`, `CONVERSATION_METADATA_KEY`, thread-bound replay cursor codec, `conversationThreadFromRecord`, `conversationMarkerMetadata`). The service and optional HTTP handler live in `@arnilo/prism-server`.
|
|
7
|
+
Core (`@arnilo/prism`) exports only conversation **types and pure helpers** (`ConversationThread`, `ConversationError`, `CONVERSATION_METADATA_KEY`, thread-bound replay cursor codec, `conversationThreadFromRecord`, `conversationMarkerMetadata`). The service and optional HTTP handler live in `@arnilo/prism-core/runtime/server`.
|
|
8
8
|
|
|
9
9
|
## When to use it
|
|
10
10
|
|
|
@@ -15,8 +15,8 @@ Do not use it as a chat UI, a push/always-on daemon, or a file store. Slack/Team
|
|
|
15
15
|
## Inputs / request
|
|
16
16
|
|
|
17
17
|
```ts
|
|
18
|
-
import { createConversationService, createConversationHandler } from "@arnilo/prism-server";
|
|
19
|
-
import { createSqlitePersistence } from "@arnilo/prism-
|
|
18
|
+
import { createConversationService, createConversationHandler } from "@arnilo/prism-core/runtime/server";
|
|
19
|
+
import { createSqlitePersistence } from "@arnilo/prism-core/sessions/sqlite";
|
|
20
20
|
|
|
21
21
|
const persistence = createSqlitePersistence({ filename }); // implements ConversationServiceStore
|
|
22
22
|
const service = createConversationService(persistence, {
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
## What it does
|
|
4
4
|
|
|
5
|
-
The optional `@arnilo/prism-credentials
|
|
5
|
+
The optional `@arnilo/prism-core/credentials/node` package ships host-owned credential persistence for Node.js CLI and desktop apps:
|
|
6
6
|
|
|
7
7
|
- **Encrypted file store** — AES-256-GCM envelope with scrypt KDF, atomic rename writes, versioned on-disk format
|
|
8
8
|
- **System keychain store** — cross-platform secret service via `@napi-rs/keyring@^1.3.0`
|
|
@@ -17,7 +17,7 @@ Factories:
|
|
|
17
17
|
- `createOAuthCredentialStoreAdapter(store)`
|
|
18
18
|
- `rotateEncryptedCredentialStorePassphrase(options)`
|
|
19
19
|
|
|
20
|
-
The `@arnilo/prism-credentials
|
|
20
|
+
The `@arnilo/prism-core/credentials/node/oidc` subpath adds the optional OIDC/JWKS identity verifier (`createOidcIdentityVerifier`) — pinned issuer/audience/JWKS verification over native `fetch` + WebCrypto (see [Agent identity](agent-identity.md)).
|
|
21
21
|
|
|
22
22
|
Core `@arnilo/prism` remains storage-free. Hosts choose a backend explicitly at startup; there is no global credential singleton and no silent fallback from keychain to plaintext file storage.
|
|
23
23
|
|
|
@@ -37,7 +37,7 @@ Do **not** use it when credentials should live in a remote vault, HSM, or cloud
|
|
|
37
37
|
import {
|
|
38
38
|
openEncryptedCredentialStore,
|
|
39
39
|
createKeychainCredentialStore,
|
|
40
|
-
} from "@arnilo/prism-credentials
|
|
40
|
+
} from "@arnilo/prism-core/credentials/node";
|
|
41
41
|
```
|
|
42
42
|
|
|
43
43
|
### Encrypted file
|
|
@@ -79,6 +79,10 @@ Encrypted file stores also expose:
|
|
|
79
79
|
|
|
80
80
|
`encryptBytes()` and `decryptBytes()` are Promise-based because they use asynchronous `node:crypto.scrypt`.
|
|
81
81
|
|
|
82
|
+
### MCP OAuth records (plan 063)
|
|
83
|
+
|
|
84
|
+
When backing `McpClientAuthState` from `@arnilo/prism-mcp` with one of these stores, key OAuth rows by the validated authorization-server `issuer` the SDK stamps onto every `StoredOAuthTokens`/`StoredOAuthClientInformation` record (the credential methods receive it). Credentials must never cross issuers: a store that cannot partition by issuer stays single-slot-safe (the MCP provider re-validates the stamp), but partitioning is the preferred shape for hosts talking to more than one MCP server. Refresh tokens belong only in the encrypted file or keychain backends — never the plaintext memory store in production.
|
|
85
|
+
|
|
82
86
|
Errors are explicit and fail closed:
|
|
83
87
|
|
|
84
88
|
| Error | Code | When |
|
|
@@ -126,7 +130,7 @@ import {
|
|
|
126
130
|
createOAuthCredentialStoreAdapter,
|
|
127
131
|
createStoredCredentialResolver,
|
|
128
132
|
openEncryptedCredentialStore,
|
|
129
|
-
} from "@arnilo/prism-credentials
|
|
133
|
+
} from "@arnilo/prism-core/credentials/node";
|
|
130
134
|
|
|
131
135
|
const store = await openEncryptedCredentialStore({
|
|
132
136
|
path: "./credentials.vault",
|
|
@@ -157,7 +161,7 @@ import {
|
|
|
157
161
|
createGoogleWorkspaceOAuthProvider,
|
|
158
162
|
createOAuthWorkTokenProvider,
|
|
159
163
|
createOAuthCredentialStoreAdapter,
|
|
160
|
-
} from "@arnilo/prism-credentials
|
|
164
|
+
} from "@arnilo/prism-core/credentials/node";
|
|
161
165
|
|
|
162
166
|
// Read-only mail/calendar (no mutation scopes requested).
|
|
163
167
|
const m365 = createMicrosoft365OAuthProvider({ clientId: "<app-id>", capabilities: ["mail", "calendar"], access: "read" });
|
|
@@ -178,7 +182,7 @@ await revokeOAuthCredential({ provider: m365, credentials: creds, store: createO
|
|
|
178
182
|
Passphrase rotation:
|
|
179
183
|
|
|
180
184
|
```ts
|
|
181
|
-
import { rotateEncryptedCredentialStorePassphrase } from "@arnilo/prism-credentials
|
|
185
|
+
import { rotateEncryptedCredentialStorePassphrase } from "@arnilo/prism-core/credentials/node";
|
|
182
186
|
|
|
183
187
|
await rotateEncryptedCredentialStorePassphrase({
|
|
184
188
|
path: "./credentials.vault",
|
|
@@ -198,7 +202,7 @@ import {
|
|
|
198
202
|
import {
|
|
199
203
|
createKeychainCredentialStore,
|
|
200
204
|
createStoredCredentialResolver,
|
|
201
|
-
} from "@arnilo/prism-credentials
|
|
205
|
+
} from "@arnilo/prism-core/credentials/node";
|
|
202
206
|
import { createOpenAIProviderPackage } from "@arnilo/prism-providers/openai";
|
|
203
207
|
|
|
204
208
|
const keychain = createKeychainCredentialStore({
|
|
@@ -133,4 +133,4 @@ A future provider-local OAuth adapter needs published permission for third-party
|
|
|
133
133
|
- [LLM compaction package](compaction-llm.md): resolves optional summary-provider credentials per compaction call and redacts exact known values.
|
|
134
134
|
- [OpenAI-compatible provider](providers/openai-compatible.md): resolves API keys per request and redacts known values from adapter errors.
|
|
135
135
|
|
|
136
|
-
Phase 10 added `createMemoryCredentialStore()`, `createChainedCredentialResolver()`, and `createSecretRedactor()` for opt-in in-memory auth and runtime redaction. By default the memory store serves a providerless record for a provider-scoped request of the same name — that record is then shared across every provider; pass `{ allowProviderFallback: false }` for exact-match-only resolution (strict provider scoping). Phase 11 adds OAuth/API-key contracts plus explicit resolver order helpers. Core still has no persistent secret store and does not read environment variables or files for credentials. For durable storage, use [`@arnilo/prism-credentials
|
|
136
|
+
Phase 10 added `createMemoryCredentialStore()`, `createChainedCredentialResolver()`, and `createSecretRedactor()` for opt-in in-memory auth and runtime redaction. By default the memory store serves a providerless record for a provider-scoped request of the same name — that record is then shared across every provider; pass `{ allowProviderFallback: false }` for exact-match-only resolution (strict provider scoping). Phase 11 adds OAuth/API-key contracts plus explicit resolver order helpers. Core still has no persistent secret store and does not read environment variables or files for credentials. For durable storage, use [`@arnilo/prism-core/credentials/node`](credential-storage.md) encrypted-file or keychain backends. See [Security/auth/trust](settings-auth-trust-security.md).
|
|
@@ -77,6 +77,6 @@ const redactor = createAuditFieldRedactor(fieldPolicy, { labelFor });
|
|
|
77
77
|
|
|
78
78
|
- `redactMessage` / `redactProviderRequest` / `redactAgentEvent` / `redactSessionEntry` / `redactRunLedgerRecord` — the egress seams that take the optional policy (secret redaction first, then classification).
|
|
79
79
|
- `createAuditFieldRedactor` → the audit-export `redact` hook; see [Signed, hash-chained audit export](audit-export.md).
|
|
80
|
-
- `createOpenTelemetryInstrumentation` in `@arnilo/prism-observability
|
|
80
|
+
- `createOpenTelemetryInstrumentation` in `@arnilo/prism-core/governance/observability` — the telemetry `fieldPolicy` option.
|
|
81
81
|
- `createProtectedFieldPolicy`, `ALLOW_FIELD_POLICY`, `FieldPolicyError`, `FIELD_POLICY_LIMITS` — the protected default and limits.
|
|
82
82
|
- The ERP-T9 threat matrix (`src/__tests__/field-policy.test.ts`) and the boundary-drill scripts cover the enforcement evidence.
|
|
@@ -6,11 +6,11 @@ The production persistence contracts describe database-neutral types for durable
|
|
|
6
6
|
|
|
7
7
|
Prism itself does not ship a production database adapter. The built-in `SessionStore` contract (`append` / `list` / optional `get`) remains the runtime seam; `ProductionPersistenceStore` is the optional adapter-facing contract for hosts that need paginated reads, tenant isolation, audit tables, retention, and optional generic `CheckpointStore` / `LeaseStore` capabilities.
|
|
8
8
|
|
|
9
|
-
Plan 056 Task 1 adds dialect-neutral shared primitives under `@arnilo/prism/testing/persistence-schema`, `@arnilo/prism/testing/session-store-conformance`, and `@arnilo/prism/testing/run-ledger-conformance`. Task 2 ships `@arnilo/prism-
|
|
9
|
+
Plan 056 Task 1 adds dialect-neutral shared primitives under `@arnilo/prism/testing/persistence-schema`, `@arnilo/prism/testing/session-store-conformance`, and `@arnilo/prism/testing/run-ledger-conformance`. Task 2 ships `@arnilo/prism-core/sessions/sqlite` (see [SQLite persistence](sqlite-persistence.md)); Task 3 ships `@arnilo/prism-core/sessions/postgres` (see [PostgreSQL persistence](postgres-persistence.md)). Both implement dialect-local SQL against the shared model; Prism core still ships no ORM, driver, or migration runner.
|
|
10
10
|
|
|
11
|
-
Release 0.0.23 additionally ships [`@arnilo/prism-enterprise
|
|
11
|
+
Release 0.0.23 additionally ships [`@arnilo/prism-core/enterprise/postgres`](enterprise-postgres-state.md), a separate PostgreSQL composition for policy decisions, evaluations, work-mutation claims, and model-router state. It is not a `ProductionPersistenceStore` replacement and does not store sessions/runs. Its fixed `prism_enterprise_migrations` history is independent of `prism_migrations`; hosts may use both compositions against the same validated schema.
|
|
12
12
|
|
|
13
|
-
The optional [`@arnilo/prism-prompts`](prompt-registry.md) package is another independent persistence surface: its SQLite/PostgreSQL adapters own `prism_prompts`, `prism_prompt_labels`, and `prism_prompt_migrations`, apply a checked `001_init` history, and filter every read/write by exact prompt ownership. It does not extend the shared session schema or place prompt bodies in run/session metadata.
|
|
13
|
+
The optional [`@arnilo/prism-core/governance/prompts`](prompt-registry.md) package is another independent persistence surface: its SQLite/PostgreSQL adapters own `prism_prompts`, `prism_prompt_labels`, and `prism_prompt_migrations`, apply a checked `001_init` history, and filter every read/write by exact prompt ownership. It does not extend the shared session schema or place prompt bodies in run/session metadata.
|
|
14
14
|
|
|
15
15
|
## When to use it
|
|
16
16
|
|
|
@@ -457,7 +457,7 @@ const dbStore: ProductionPersistenceStore = {
|
|
|
457
457
|
- `SessionStore` (`append`/`list`/`get`/optional `readBranchPath`) can be implemented on top of `ProductionPersistenceStore` or kept separate.
|
|
458
458
|
- **State-concurrency conformance (0.2.2):** durable adapters must pass `assertStateConcurrencyConforms` from `@arnilo/prism/testing/state-concurrency-conformance` against both the memory stores and their own implementation (approval determinism, checkpoint CAS, replay-cursor resume, idempotency retry, router reservation, conversation metadata CAS, unknown-outcome recovery). The harness uses deterministic barriers only — no timing-only sleeps — and runs the memory leg in the default `npm test` and the durable legs in `test:postgres`/`test:nats`; `scripts/phase22-conformance.test.mjs` asserts every store leg executed (missing protected environment records a named BLOCKED GATE, never a green skip).
|
|
459
459
|
- Cursor values and idempotency keys are host-defined and opaque to Prism.
|
|
460
|
-
- First-party SQLite/PostgreSQL adapters expose `persistence.checkpoints` and `persistence.leases`, backed by package-owned `prism_checkpoints` / `prism_leases` tables. `@arnilo/prism-workflows` consumes them for durable resume, human suspension, multi-process coordination, Phase 11 schedule records/fire leases, shared state, and replay lineage; workflow code owns no SQL table. `suspended`/`denied`, schedules, state history, and replay lineage remain namespaces/categories plus bounded checkpoint JSON values, so Phases 8 and 11 need no database migration.
|
|
460
|
+
- First-party SQLite/PostgreSQL adapters expose `persistence.checkpoints` and `persistence.leases`, backed by package-owned `prism_checkpoints` / `prism_leases` tables. `@arnilo/prism-core/runtime/workflows` consumes them for durable resume, human suspension, multi-process coordination, Phase 11 schedule records/fire leases, shared state, and replay lineage; workflow code owns no SQL table. `suspended`/`denied`, schedules, state history, and replay lineage remain namespaces/categories plus bounded checkpoint JSON values, so Phases 8 and 11 need no database migration.
|
|
461
461
|
|
|
462
462
|
Schema version **7** adds the exact-owner durable event retention index (`prism_agent_events_owner_timestamp_sequence_idx`). Distributed subscribe/LISTEN remains PostgreSQL-only via `persistence.events`.
|
|
463
463
|
|
package/docs/dev-inspector.md
CHANGED
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
|
|
3
3
|
## What it does
|
|
4
4
|
|
|
5
|
-
`@arnilo/prism-dev` is a **loopback-only local dev inspector** over a host's already-configured Prism agent — the `prism dev` playground server (plan 040). It is a **composition-only consumer**: it adds zero core primitives and imports no core internals. Every capability is an existing public seam consumed verbatim:
|
|
5
|
+
`@arnilo/prism-coding-tools/dev` is a **loopback-only local dev inspector** over a host's already-configured Prism agent — the `prism dev` playground server (plan 040). It is a **composition-only consumer**: it adds zero core primitives and imports no core internals. Every capability is an existing public seam consumed verbatim:
|
|
6
6
|
|
|
7
|
-
- `@arnilo/prism-server` `createPrismHandler` — direct `POST /prism/agents/:id/runs` and SSE `POST /prism/agents/:id/stream` agent routes, authorization, ownership propagation, and the durable `Last-Event-ID` event route when an exposure carries `events` + `resolveRun`.
|
|
7
|
+
- `@arnilo/prism-core/runtime/server` `createPrismHandler` — direct `POST /prism/agents/:id/runs` and SSE `POST /prism/agents/:id/stream` agent routes, authorization, ownership propagation, and the durable `Last-Event-ID` event route when an exposure carries `events` + `resolveRun`.
|
|
8
8
|
- Core durable `AgentEventSource` contract (`page`/`subscribe`) — replay and reconnect without re-execution.
|
|
9
9
|
- `@arnilo/prism-ag-ui/renderer` — event projection for the served UI page (plan 040 Task 3).
|
|
10
10
|
- Run-ledger records (`RunRecord`/`AgentEventRecord`/`ToolCallRecord`/`UsageRecord`) surfaced only through the seams above — the package never touches a ledger.
|
|
@@ -12,16 +12,16 @@
|
|
|
12
12
|
|
|
13
13
|
## When to use it
|
|
14
14
|
|
|
15
|
-
Use it when iterating on prompts in a local Prism host and you want a inspectable timeline (events, tool calls, usage, HITL decisions, run replay) instead of building your own trace viewer. Do not deploy it: it is a developer-time surface,
|
|
15
|
+
Use it when iterating on prompts in a local Prism host and you want a inspectable timeline (events, tool calls, usage, HITL decisions, run replay) instead of building your own trace viewer. Do not deploy it: it is a developer-time surface, deliberately excluded from production dependency use, and it must never be the production API boundary — that stays `@arnilo/prism-core/runtime/server` under host authorization.
|
|
16
16
|
|
|
17
17
|
### Quickstart — `prism dev` (plan 040 Task 4)
|
|
18
18
|
|
|
19
19
|
```bash
|
|
20
|
-
npm install --save-dev @arnilo/prism-dev
|
|
20
|
+
npm install --save-dev @arnilo/prism-coding-tools/dev
|
|
21
21
|
cd my-agent && npm run dev # → prism dev → http://127.0.0.1:4311
|
|
22
22
|
```
|
|
23
23
|
|
|
24
|
-
`prism dev` (and the standalone `prism-dev` bin, plus the programmatic `runDevCli` from `@arnilo/prism-dev/cli`) boots the inspector over the current `prism init` scaffold: it imports `dist/agent.js` and calls its `createAppAgent()` export — the scaffold's own agent, with its own credentials. It defaults to `127.0.0.1:4311`, prints the loopback URL once listening (start-to-listen under 1s excluding provider network), and `Ctrl+C` drains and closes. A non-loopback `--host` is refused before binding (`ERR_PRISM_DEV_REMOTE_BIND`); the CLI never reads environment secrets itself. See `docs/cli-rpc.md` for the flag table.
|
|
24
|
+
`prism dev` (and the standalone `prism-dev` bin, plus the programmatic `runDevCli` from `@arnilo/prism-coding-tools/dev/cli`) boots the inspector over the current `prism init` scaffold: it imports `dist/agent.js` and calls its `createAppAgent()` export — the scaffold's own agent, with its own credentials. It defaults to `127.0.0.1:4311`, prints the loopback URL once listening (start-to-listen under 1s excluding provider network), and `Ctrl+C` drains and closes. A non-loopback `--host` is refused before binding (`ERR_PRISM_DEV_REMOTE_BIND`); the CLI never reads environment secrets itself. See `docs/cli-rpc.md` for the flag table.
|
|
25
25
|
|
|
26
26
|
## Inputs / request
|
|
27
27
|
|
|
@@ -89,7 +89,7 @@ POST /runs/<runId>/decisions/<approvalId>
|
|
|
89
89
|
## Implementation example
|
|
90
90
|
|
|
91
91
|
```ts
|
|
92
|
-
import { createPrismDevInspector } from "@arnilo/prism-dev";
|
|
92
|
+
import { createPrismDevInspector } from "@arnilo/prism-coding-tools/dev";
|
|
93
93
|
|
|
94
94
|
const inspector = createPrismDevInspector({
|
|
95
95
|
agent, // host-built agent (mock or provider-backed)
|
package/docs/device-adapters.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
## What it does
|
|
4
4
|
|
|
5
|
-
Optional realtime voice and desktop OS / computer-control surface for Prism agents, shipped in 0.0.14 as a **contract + deny-by-default policy** in `@arnilo/prism` (`src/devices.ts`). The first vendor adapter, `@arnilo/prism-computer-use-linux`, wraps the host-owned `computer-use-linux` MCP binary without changing this generic contract. The contract composes over the existing `PermissionPolicy`, `RunLimits`, approval (`tool_approval`), and redactor seams; it adds no second approval runtime and no device framework.
|
|
5
|
+
Optional realtime voice and desktop OS / computer-control surface for Prism agents, shipped in 0.0.14 as a **contract + deny-by-default policy** in `@arnilo/prism` (`src/devices.ts`). The first vendor adapter, `@arnilo/prism-coding-tools/computer-use-linux`, wraps the host-owned `computer-use-linux` MCP binary without changing this generic contract. The contract composes over the existing `PermissionPolicy`, `RunLimits`, approval (`tool_approval`), and redactor seams; it adds no second approval runtime and no device framework.
|
|
6
6
|
|
|
7
7
|
## When to use it
|
|
8
8
|
|
|
@@ -79,7 +79,7 @@ if (chunk.accepted) emit(redactDeviceTelemetry(createSecretRedactor([token]), fr
|
|
|
79
79
|
|
|
80
80
|
- Frozen caps: audio/screenshot/stream chunk **1 MiB / 8 MiB**; concurrent device sessions per identity **1 / 4**. Device wall time / turns / tool calls consume the shared `RunLimits` (admission fails closed without run accounting).
|
|
81
81
|
- `enabled` resolves to `true` only on an explicit `true`; any other value is disabled. `requireApproval` stays `true` unless the host explicitly sets `false` (it should not).
|
|
82
|
-
- `@arnilo/prism-computer-use-linux` is the first vendor package. It remains optional, Linux-only, host-binary-owned, and outside umbrella profiles; this page stays generic so future voice or desktop vendors can satisfy the same contract via `runDevicePolicyConformance`.
|
|
82
|
+
- `@arnilo/prism-coding-tools/computer-use-linux` is the first vendor package. It remains optional, Linux-only, host-binary-owned, and outside umbrella profiles; this page stays generic so future voice or desktop vendors can satisfy the same contract via `runDevicePolicyConformance`.
|
|
83
83
|
|
|
84
84
|
## Security and performance notes
|
|
85
85
|
|
package/docs/diagrams.md
CHANGED
|
@@ -244,4 +244,4 @@ const summary = validateDrawioXml(xml, {
|
|
|
244
244
|
- [`@arnilo/prism-office/sheets`](./sheets.md): Spreadsheet and CSV parsing engine with strict financial decimal safety guarantees.
|
|
245
245
|
- [`@arnilo/prism-web-tools/browser`](./browser-automation.md): Browser automation tools and quarantine lifecycle.
|
|
246
246
|
- [`@arnilo/prism-ag-ui`](./ag-ui.md): Agent-User Interface projection and timeline components.
|
|
247
|
-
- [`@arnilo/prism-observability
|
|
247
|
+
- [`@arnilo/prism-core/governance/observability`](./observability.md): OpenTelemetry instrumentation and trace adapters.
|
package/docs/document-reader.md
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# Document reader (`@arnilo/prism-document-reader`)
|
|
1
|
+
# Document reader (`@arnilo/prism-coding-tools/document-reader`)
|
|
2
2
|
|
|
3
3
|
## What it does
|
|
4
4
|
|
|
@@ -6,7 +6,7 @@ Optional bounded literal-text extraction for PDF and DOCX files, consumed by the
|
|
|
6
6
|
|
|
7
7
|
## When to use it
|
|
8
8
|
|
|
9
|
-
Use when coding agents must read PDF/Office files (specs, requirements docs, reports) as literal text. Do **not** use it when embedded content execution, macro evaluation, or external resource fetching is required — this adapter never does any of those by construction, and the optional peer parsers (`pdf-parse`, `mammoth`) are the only parsing code involved. Docker-less hosts that need document reads pair this with the network-free native sandbox backend (`@arnilo/prism-coding-security` `createNativeSandbox`) for the surrounding tool execution.
|
|
9
|
+
Use when coding agents must read PDF/Office files (specs, requirements docs, reports) as literal text. Do **not** use it when embedded content execution, macro evaluation, or external resource fetching is required — this adapter never does any of those by construction, and the optional peer parsers (`pdf-parse`, `mammoth`) are the only parsing code involved. Docker-less hosts that need document reads pair this with the network-free native sandbox backend (`@arnilo/prism-coding-tools/security` `createNativeSandbox`) for the surrounding tool execution.
|
|
10
10
|
|
|
11
11
|
Activation is explicit: no file-extension sniffing anywhere enables parsing. Absent `documentReader` option = exactly the 0.1.5 read behavior.
|
|
12
12
|
|
|
@@ -33,8 +33,8 @@ Errors: `DocumentReaderError` with code `ERR_PRISM_DOCUMENT_READER` for missing
|
|
|
33
33
|
## Request/response example
|
|
34
34
|
|
|
35
35
|
```ts
|
|
36
|
-
import { createReadTool } from "@arnilo/prism-coding-agent";
|
|
37
|
-
import { createDocumentReader } from "@arnilo/prism-document-reader";
|
|
36
|
+
import { createReadTool } from "@arnilo/prism-coding-tools/agent";
|
|
37
|
+
import { createDocumentReader } from "@arnilo/prism-coding-tools/document-reader";
|
|
38
38
|
|
|
39
39
|
const documentReader = await createDocumentReader({
|
|
40
40
|
maxBytes: 32 * 1024 * 1024,
|
|
@@ -49,7 +49,7 @@ A `read` of `spec.pdf` yields text content extracted from the PDF (up to 2 MiB o
|
|
|
49
49
|
## Implementation example
|
|
50
50
|
|
|
51
51
|
```ts
|
|
52
|
-
import { createDocumentReader, createPdfParser, type DocumentParser } from "@arnilo/prism-document-reader";
|
|
52
|
+
import { createDocumentReader, createPdfParser, type DocumentParser } from "@arnilo/prism-coding-tools/document-reader";
|
|
53
53
|
|
|
54
54
|
// Host-selected parser wiring: swap in a different PDF backend without touching bounds.
|
|
55
55
|
const myPdfParser: DocumentParser = {
|
|
@@ -79,7 +79,7 @@ const reader = await createDocumentReader({ parsers: [myPdfParser, await createP
|
|
|
79
79
|
|
|
80
80
|
## Related APIs
|
|
81
81
|
|
|
82
|
-
- `createReadTool` / `DocumentReader` / `DocumentReaderResult` (`@arnilo/prism-coding-agent`)
|
|
82
|
+
- `createReadTool` / `DocumentReader` / `DocumentReaderResult` (`@arnilo/prism-coding-tools/agent`)
|
|
83
83
|
- `SecretRedactor` (`@arnilo/prism` redaction)
|
|
84
84
|
- `docs/_evidence/phase18-primitive-review.md` (doc-reader threat model D1–D8)
|
|
85
85
|
- `docs/coding-security.md` (native sandbox backend for surrounding execution containment)
|