@arnilo/prism 0.0.3 → 0.0.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 +40 -0
- package/README.md +62 -26
- package/dist/agent-loops.d.ts +8 -1
- package/dist/agent-loops.js +57 -11
- package/dist/agents.js +212 -32
- package/dist/checkpoints.d.ts +11 -0
- package/dist/checkpoints.js +144 -0
- package/dist/cli-init.d.ts +41 -0
- package/dist/cli-init.js +390 -0
- package/dist/cli-runner.d.ts +7 -1
- package/dist/cli-runner.js +13 -1
- package/dist/compaction.js +9 -1
- package/dist/content.d.ts +121 -0
- package/dist/content.js +538 -0
- package/dist/contracts.d.ts +236 -11
- package/dist/contracts.js +8 -0
- package/dist/event-multiplexer.d.ts +23 -0
- package/dist/event-multiplexer.js +136 -0
- package/dist/execution-policy.d.ts +28 -0
- package/dist/execution-policy.js +24 -0
- package/dist/feedback.d.ts +48 -0
- package/dist/feedback.js +230 -0
- package/dist/index.d.ts +20 -6
- package/dist/index.js +13 -5
- package/dist/input.js +11 -1
- package/dist/leases.d.ts +8 -0
- package/dist/leases.js +111 -0
- package/dist/node/agent-definitions.js +3 -5
- package/dist/node/config.d.ts +1 -0
- package/dist/node/config.js +5 -3
- package/dist/node/contribution-discovery.js +5 -8
- package/dist/node/session-store-jsonl.js +8 -5
- package/dist/node/settings.js +2 -2
- package/dist/node/trust.js +2 -4
- package/dist/observability.d.ts +3 -0
- package/dist/observability.js +18 -0
- package/dist/providers/media.d.ts +44 -0
- package/dist/providers/media.js +126 -0
- package/dist/providers/openai-compatible.js +18 -119
- package/dist/providers/openai-primitives.d.ts +9 -0
- package/dist/providers/openai-primitives.js +129 -0
- package/dist/providers/transport.d.ts +40 -0
- package/dist/providers/transport.js +221 -0
- package/dist/redaction.js +40 -13
- package/dist/resources.d.ts +5 -0
- package/dist/resources.js +4 -0
- package/dist/structured-output.d.ts +11 -0
- package/dist/structured-output.js +59 -0
- package/dist/testing/feedback.d.ts +6 -0
- package/dist/testing/feedback.js +37 -0
- package/dist/testing/persistence-schema.d.ts +102 -0
- package/dist/testing/persistence-schema.js +487 -0
- package/dist/testing/provider-conformance.js +10 -1
- package/dist/testing/run-ledger-conformance.d.ts +33 -0
- package/dist/testing/run-ledger-conformance.js +178 -0
- package/dist/testing/session-store-conformance.d.ts +16 -0
- package/dist/testing/session-store-conformance.js +73 -0
- package/dist/tools.d.ts +17 -0
- package/dist/tools.js +29 -2
- package/docs/a2a.md +73 -0
- package/docs/agent-events.md +17 -10
- package/docs/agent-loops.md +11 -5
- package/docs/agent-session-runtime.md +15 -16
- package/docs/cli-rpc.md +36 -5
- package/docs/coding-agent-tools.md +43 -9
- package/docs/coding-security.md +88 -0
- package/docs/compaction-observational-memory.md +2 -0
- package/docs/context-and-skills.md +1 -0
- package/docs/credential-storage.md +177 -0
- package/docs/credentials-and-redaction.md +4 -3
- package/docs/database-persistence.md +52 -7
- package/docs/evaluations.md +122 -0
- package/docs/extensions.md +2 -2
- package/docs/host-security.md +33 -2
- package/docs/index.md +46 -18
- package/docs/input-and-prompt-assembly.md +6 -5
- package/docs/mcp-tools.md +184 -0
- package/docs/middleware-hooks.md +2 -0
- package/docs/migration.md +51 -28
- package/docs/model-registry.md +5 -3
- package/docs/multimodal-content.md +156 -0
- package/docs/observability.md +171 -0
- package/docs/performance.md +249 -1
- package/docs/persistence-credentials-multimodality-primitives.md +303 -0
- package/docs/postgres-persistence.md +143 -0
- package/docs/provider-conformance.md +18 -0
- package/docs/provider-layer.md +1 -1
- package/docs/provider-packages.md +2 -0
- package/docs/provider-primitives.md +281 -0
- package/docs/providers/ai-sdk.md +113 -0
- package/docs/providers/kimi.md +1 -0
- package/docs/providers/neuralwatt.md +1 -0
- package/docs/providers/openai-compatible.md +2 -1
- package/docs/providers/openai.md +8 -1
- package/docs/providers/opencode-go.md +1 -0
- package/docs/providers/openrouter.md +1 -0
- package/docs/providers/zai.md +1 -0
- package/docs/public-contracts.md +13 -5
- package/docs/rag.md +113 -0
- package/docs/release-and-install.md +237 -30
- package/docs/resource-loading.md +14 -4
- package/docs/review-coverage-2026-07-14.md +260 -0
- package/docs/review-coverage-2026-07-15.md +193 -0
- package/docs/run-ledger-conformance.md +96 -0
- package/docs/runs-and-usage.md +43 -4
- package/docs/server.md +139 -0
- package/docs/session-store-conformance.md +16 -0
- package/docs/session-stores-and-branching.md +1 -0
- package/docs/settings-auth-trust-security.md +6 -5
- package/docs/sqlite-persistence.md +123 -0
- package/docs/structured-output.md +9 -0
- package/docs/supervisors.md +71 -0
- package/docs/tool-conformance.md +1 -0
- package/docs/tool-execution-primitives.md +374 -0
- package/docs/tools.md +39 -1
- package/docs/workflow-orchestration-primitives.md +581 -0
- package/docs/workflow-tui-primitives.md +5 -0
- package/docs/workflows.md +293 -0
- package/docs/working-and-semantic-memory.md +169 -0
- package/package.json +43 -5
- package/templates/init/README.md.tmpl +28 -0
- package/templates/init/env.example.tmpl +1 -0
- package/templates/init/gitignore.tmpl +11 -0
- package/templates/init/optional/evals-example.ts.tmpl +17 -0
- package/templates/init/optional/workflows-example.ts.tmpl +27 -0
- package/templates/init/package.json.tmpl +22 -0
- package/templates/init/providers.json +76 -0
- package/templates/init/src/agent.ts.tmpl +10 -0
- package/templates/init/src/index.ts.tmpl +12 -0
- package/templates/init/src/tests/agent.test.ts.tmpl +24 -0
- package/templates/init/tsconfig.json.tmpl +15 -0
package/docs/rag.md
ADDED
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
# Retrieval-augmented generation (RAG)
|
|
2
|
+
|
|
3
|
+
## What it does
|
|
4
|
+
|
|
5
|
+
`@arnilo/prism-rag` is an optional package for deterministic plain-text/Markdown chunking, bounded embedding/vector indexing, filtered semantic retrieval, stable citations, and explicit `ContextProvider` injection. It reuses `Embedder` and `VectorStore` from `@arnilo/prism-memory`; Prism core input assembly is unchanged.
|
|
6
|
+
|
|
7
|
+
## When to use it
|
|
8
|
+
|
|
9
|
+
Use it when a host already owns trusted document text and needs small retrieval primitives without a document framework. Do not use it for PDF/HTML/LaTeX parsing, semantic chunking, metadata extraction agents, reranker pipelines, GraphRAG, crawling, URL fetching, or filesystem discovery.
|
|
10
|
+
|
|
11
|
+
## Inputs / request
|
|
12
|
+
|
|
13
|
+
Chunking:
|
|
14
|
+
|
|
15
|
+
| API/field | Meaning |
|
|
16
|
+
| --- | --- |
|
|
17
|
+
| `chunkText(text, options)` | Character-bounded plain-text chunks |
|
|
18
|
+
| `chunkMarkdown(markdown, options)` | Same engine, preferring heading/paragraph boundaries |
|
|
19
|
+
| `sourceId` | Required stable, non-secret source identifier |
|
|
20
|
+
| `size` / `overlap` | Character ceiling and repeated context |
|
|
21
|
+
| `metadata` | JSON metadata copied to every chunk |
|
|
22
|
+
|
|
23
|
+
Index/retrieve:
|
|
24
|
+
|
|
25
|
+
| Field | Required | Meaning |
|
|
26
|
+
| --- | --- | --- |
|
|
27
|
+
| `embedder` / `store` | yes | Phase 7 `Embedder` and `VectorStore` |
|
|
28
|
+
| `scope` | yes | `{ tenantId, resourceId, corpusId }`; corpus maps to vector thread isolation |
|
|
29
|
+
| `chunks` | indexing | `RagChunk[]` from package chunkers or compatible host parser |
|
|
30
|
+
| `topK` / `queryCandidates` | retrieval | Returned result count and bounded pre-filter candidates |
|
|
31
|
+
| `filter` | no | Shallow JSON metadata equality filter |
|
|
32
|
+
| `redactor` / `secrets` | no | Redact before embedding, persistence, and injection |
|
|
33
|
+
| `signal` | no | Abort embedding, vector operations, and batch progression |
|
|
34
|
+
|
|
35
|
+
## Outputs / response / events
|
|
36
|
+
|
|
37
|
+
- `chunkText()` / `chunkMarkdown()` return frozen `RagChunk[]` with `sourceId`, zero-based index, offsets, and stable IDs such as `guide#0001`.
|
|
38
|
+
- `indexChunks()` returns `{ indexed, sourceIds }` after bounded batch upserts.
|
|
39
|
+
- `retrieveContext()` returns `{ query, text, hits, citations, truncated }`. Rendered text uses `[citation-id] text` blocks.
|
|
40
|
+
- `createRagContextProvider()` returns one ordinary context provider. Empty queries/results contribute no block.
|
|
41
|
+
- No events, tools, permissions, provider calls, loaders, or network requests are added.
|
|
42
|
+
|
|
43
|
+
Default hard ceilings include 1,000/16,384 chunk characters, 100/4,096 overlap, 1,048,576/8,388,608 document characters, 2,048/8,192 chunks, 32/128 embed batch, top-K 5/32, candidates 20/128, result 64/512 KiB, and context 2,000/8,000 estimated tokens.
|
|
44
|
+
|
|
45
|
+
## Request/response example
|
|
46
|
+
|
|
47
|
+
```json
|
|
48
|
+
{
|
|
49
|
+
"scope": { "tenantId": "t1", "resourceId": "docs", "corpusId": "handbook" },
|
|
50
|
+
"query": "How do approvals work?",
|
|
51
|
+
"topK": 1,
|
|
52
|
+
"result": {
|
|
53
|
+
"text": "[security-guide#0001] Recheck policy before side effects.",
|
|
54
|
+
"citations": [{ "id": "security-guide#0001", "sourceId": "security-guide" }]
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
## Implementation example
|
|
60
|
+
|
|
61
|
+
```ts
|
|
62
|
+
import { createAgent, createMockProvider, providerDone, providerTextDelta } from "@arnilo/prism";
|
|
63
|
+
import { createHashEmbedder, createMemoryVectorStore } from "@arnilo/prism-memory";
|
|
64
|
+
import { chunkMarkdown, createRagContextProvider, indexChunks, retrieveContext } from "@arnilo/prism-rag";
|
|
65
|
+
|
|
66
|
+
const embedder = createHashEmbedder(); // deterministic demo/test helper, not production semantic quality
|
|
67
|
+
const store = createMemoryVectorStore();
|
|
68
|
+
const scope = { tenantId: "t1", resourceId: "docs", corpusId: "handbook" };
|
|
69
|
+
const chunks = chunkMarkdown("# Approval\n\nRecheck current policy before side effects.", {
|
|
70
|
+
sourceId: "security-guide",
|
|
71
|
+
metadata: { category: "security" },
|
|
72
|
+
});
|
|
73
|
+
await indexChunks({ chunks, embedder, store, scope });
|
|
74
|
+
|
|
75
|
+
const found = await retrieveContext("approval policy", {
|
|
76
|
+
embedder,
|
|
77
|
+
store,
|
|
78
|
+
scope,
|
|
79
|
+
topK: 4,
|
|
80
|
+
filter: { category: "security" },
|
|
81
|
+
});
|
|
82
|
+
|
|
83
|
+
const agent = createAgent({
|
|
84
|
+
model: { provider: "mock", model: "demo" },
|
|
85
|
+
provider: createMockProvider([providerTextDelta("Policy checked."), providerDone()]),
|
|
86
|
+
context: [createRagContextProvider({ embedder, store, scope })],
|
|
87
|
+
});
|
|
88
|
+
console.log(found.text, await agent.createSession().run("How do approvals work?"));
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
## Extension and configuration notes
|
|
92
|
+
|
|
93
|
+
- Supply any Phase 7-conforming embedder/vector store, including the in-memory reference or PostgreSQL/pgvector adapter.
|
|
94
|
+
- Metadata filtering is package-local after a bounded candidate query so existing vector contracts/adapters remain unchanged. Increase `queryCandidates` only when selective filters measurably need it.
|
|
95
|
+
- `createRagContextProvider()` derives its query from latest user text by default; pass a fixed string or callback for host-controlled query generation.
|
|
96
|
+
- Load source text separately with a host-owned `ResourceLoader`. The RAG package intentionally accepts text, not URLs or filesystem paths.
|
|
97
|
+
- Package is available directly or through `@arnilo/prism-all`; installation does not create an embedder, vector store, or context provider.
|
|
98
|
+
|
|
99
|
+
## Security and performance notes
|
|
100
|
+
|
|
101
|
+
- Every index/query includes exact tenant/resource/corpus scope; returned records are rechecked and malformed/foreign records fail closed.
|
|
102
|
+
- Source IDs become citation/storage IDs and must be stable non-secret identifiers. Text and user metadata can be redacted before external embedding and persistence.
|
|
103
|
+
- Retrieved documents are untrusted inert context. Prompt-injection text cannot activate tools, skills, credentials, permissions, or extensions.
|
|
104
|
+
- Remote sources must pass existing resource/media trust, SSRF, MIME, and byte policies before their decoded text reaches this package.
|
|
105
|
+
- Indexing is bounded per batch and checks abort between embed/upsert operations. A failure can leave completed batches persisted; retry is idempotent for the same stable source/chunk IDs.
|
|
106
|
+
- Filtering scans at most `queryCandidates` hits; rendering stops at top-K, UTF-8 result bytes, or estimated context-token ceiling.
|
|
107
|
+
|
|
108
|
+
## Related APIs
|
|
109
|
+
|
|
110
|
+
- [Working and semantic memory](working-and-semantic-memory.md): shared `Embedder`/`VectorStore` contracts and adapters.
|
|
111
|
+
- [Context and skills](context-and-skills.md): explicit `ContextProvider` injection and inert context semantics.
|
|
112
|
+
- [Resource loading](resource-loading.md): host-owned trusted source loading.
|
|
113
|
+
- [Multimodal content](multimodal-content.md): remote media SSRF/MIME/byte policies before text extraction.
|
|
@@ -2,26 +2,43 @@
|
|
|
2
2
|
|
|
3
3
|
## What it does
|
|
4
4
|
|
|
5
|
-
Prism is published as one core package
|
|
5
|
+
Prism is published as one core package, twenty-three first-party capability packages, and six pure-manifest family/profile packages. This page describes how they are packed, what each tarball contains, how to install them, the required `@arnilo/prism` peer dependency, the release workflow, and the offline test budget.
|
|
6
6
|
|
|
7
7
|
Core package:
|
|
8
8
|
|
|
9
|
-
- `@arnilo/prism` — the runtime, contracts, registries, streaming events, CLI, and the `/docs` hub. `files`: `dist` (with `!dist/__tests__` and `!dist/**/*.map` negations), `docs`, `CHANGELOG.md`. `bin`: `prism` -> `./dist/cli.js`. `sideEffects`: `["dist/cli.js"]`.
|
|
9
|
+
- `@arnilo/prism` — the runtime, contracts, registries, streaming events, CLI (including `prism init`), and the `/docs` hub. `files`: `dist` (with `!dist/__tests__` and `!dist/**/*.map` negations), `docs`, `templates`, `CHANGELOG.md`. `bin`: `prism` -> `./dist/cli.js`. `sideEffects`: `["dist/cli.js"]`.
|
|
10
10
|
|
|
11
|
-
First-party workspace packages (each
|
|
11
|
+
First-party workspace packages (each has non-optional `@arnilo/prism@0.0.5` peer and `sideEffects: false`; RAG also peers on memory, and server also peers on workflows):
|
|
12
12
|
|
|
13
13
|
- `@arnilo/prism-provider-openai`, `@arnilo/prism-provider-openrouter`, `@arnilo/prism-provider-kimi`, `@arnilo/prism-provider-zai`, `@arnilo/prism-provider-opencode-go`, `@arnilo/prism-provider-neuralwatt` — provider adapters.
|
|
14
|
+
- `@arnilo/prism-provider-ai-sdk` — optional AI SDK `LanguageModelV4` adapter; included by the provider and all umbrellas.
|
|
14
15
|
- `@arnilo/prism-compaction-llm` — optional LLM-backed compaction strategy.
|
|
15
16
|
- `@arnilo/prism-compaction-observational-memory` — optional source-backed observational memory.
|
|
16
|
-
- `@arnilo/prism-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
- `@arnilo/prism-
|
|
21
|
-
- `@arnilo/prism-
|
|
22
|
-
- `@arnilo/prism-
|
|
23
|
-
|
|
24
|
-
|
|
17
|
+
- `@arnilo/prism-observability-opentelemetry` — optional OpenTelemetry adapter for `AgentEvent` streams.
|
|
18
|
+
- `@arnilo/prism-tool-validator-json-schema` — bounded JSON Schema tool argument validation.
|
|
19
|
+
- `@arnilo/prism-mcp` — MCP transport/client bridge plus explicit authorized Prism tool/command server exposure.
|
|
20
|
+
- `@arnilo/prism-coding-agent` / `@arnilo/prism-coding-security` — optional host shell/filesystem tools plus approval, containment, and sandbox policy.
|
|
21
|
+
- `@arnilo/prism-session-store-sqlite` / `@arnilo/prism-session-store-postgres` — production persistence, checkpoints, and leases.
|
|
22
|
+
- `@arnilo/prism-credentials-node` — encrypted-file and keychain credential storage.
|
|
23
|
+
- `@arnilo/prism-workflows` — typed bounded DAG orchestration with durable approval, schedules/background runs, composition/state/replay, and multi-process coordination.
|
|
24
|
+
- `@arnilo/prism-evals` — optional deterministic scorers, immutable datasets, and bounded batch experiments over `AgentRunResult`.
|
|
25
|
+
- `@arnilo/prism-memory` — optional working memory, semantic recall, Embedder/VectorStore contracts, and PostgreSQL/pgvector adapter.
|
|
26
|
+
- `@arnilo/prism-rag` — optional bounded text/Markdown chunking, vector indexing/retrieval, stable citations, and ContextProvider integration (peers on memory).
|
|
27
|
+
- `@arnilo/prism-server` — optional framework-free authorized Web agent/workflow routes (peers on workflows).
|
|
28
|
+
- `@arnilo/prism-supervisor` — optional bounded child delegation and A2A 1.0 card/server/client interoperability.
|
|
29
|
+
|
|
30
|
+
Family/profile packages (pure manifests, no code or `dist`; ship `README.md` and `CHANGELOG.md`; use exact hard `dependencies`):
|
|
31
|
+
|
|
32
|
+
- `@arnilo/prism-providers` — all seven `@arnilo/prism-provider-*` packages: six HTTP adapters plus AI SDK interoperability.
|
|
33
|
+
- `@arnilo/prism-compaction` — both `@arnilo/prism-compaction-*` packages.
|
|
34
|
+
- `@arnilo/prism-base` — core + compaction family + JSON Schema validator; excludes providers, MCP, native credentials/storage, and coding tools.
|
|
35
|
+
- `@arnilo/prism-code` — base + coding-agent + coding-security + MCP; providers and persistence remain explicit choices.
|
|
36
|
+
- `@arnilo/prism-sdk` — base + workflows + MCP + Node credentials + OpenTelemetry; providers and persistence remain explicit choices.
|
|
37
|
+
- `@arnilo/prism-all` — every first-party package: code + SDK + providers + persistence + evals + memory/RAG + server + supervisor. Installation alone activates no network/listener, telemetry, database, memory, evaluation, delegation, MCP, shell, or filesystem capability.
|
|
38
|
+
|
|
39
|
+
Profile footprint snapshot (Node 24/npm 11, lockfile graph, 2026-07-16): `base` reaches 6 first-party packages and one external dependency root (Ajv); `code` reaches 10 and three (Ajv, MCP SDK, diff); `sdk` reaches 11 and three (Ajv, MCP SDK, keyring); `all` reaches all 30 first-party manifests and seven external roots (those plus better-sqlite3, pg, and AI SDK provider types). Native database drivers stay out of base/code/sdk; both appear only in all.
|
|
40
|
+
|
|
41
|
+
Each code package's `files` array is `["dist", "!dist/__tests__", "!dist/**/*.map", "README.md", "CHANGELOG.md"]`; `README.md`, `LICENSE`, and `CHANGELOG.md` ship in every code-package tarball, the core tarball also ships the `docs/` directory, and family/profile tarballs ship `README.md` + `CHANGELOG.md` + `package.json`.
|
|
25
42
|
|
|
26
43
|
## When to use it
|
|
27
44
|
|
|
@@ -34,15 +51,20 @@ Consumers install the core package for the runtime and add first-party packages
|
|
|
34
51
|
| Operation | Command |
|
|
35
52
|
| --- | --- |
|
|
36
53
|
| Install core only | `npm install @arnilo/prism` |
|
|
54
|
+
| Scaffold a minimal project | `npx --package @arnilo/prism prism init my-agent [--provider openai] [--with-workflows] [--with-evals]` |
|
|
37
55
|
| Install core + all providers | `npm install @arnilo/prism @arnilo/prism-providers` |
|
|
38
|
-
| Install
|
|
39
|
-
| Install
|
|
40
|
-
| Install
|
|
56
|
+
| Install minimal safe profile | `npm install @arnilo/prism-base` |
|
|
57
|
+
| Install coding-agent profile | `npm install @arnilo/prism-code @arnilo/prism-provider-openai` |
|
|
58
|
+
| Install application SDK profile | `npm install @arnilo/prism-sdk @arnilo/prism-provider-openai @arnilo/prism-session-store-sqlite` |
|
|
59
|
+
| Install everything | `npm install @arnilo/prism-all` |
|
|
41
60
|
| Install core + a single provider | `npm install @arnilo/prism @arnilo/prism-provider-openai` |
|
|
42
61
|
| Build everything (core + workspaces) | `npm run build` |
|
|
43
62
|
| Run the default (network-free) test suite | `npm test` |
|
|
44
63
|
| Dry-run pack core + every package | `npm run pack:dry-run` |
|
|
45
64
|
| Local mirror of the release verify gate | `npm run release:dry-run` |
|
|
65
|
+
| Validate clean tag/version/ranges and reject registry collisions | `npm run release:check -- --version 0.0.5` |
|
|
66
|
+
| Preview deterministic publish order | `npm run release:publish -- --version 0.0.5 --dry-run --allow-dirty --allow-untagged` |
|
|
67
|
+
| Resume interrupted tagged publication | `npm run release:publish -- --version 0.0.5 --resume --report release-artifacts/publish-report.json` |
|
|
46
68
|
| Full SDK readiness gate (typecheck + offline tests + pack) | `npm run sdk:ready` |
|
|
47
69
|
|
|
48
70
|
Public core import specifiers (from the root `exports` map):
|
|
@@ -51,11 +73,17 @@ Public core import specifiers (from the root `exports` map):
|
|
|
51
73
|
| --- | --- |
|
|
52
74
|
| `@arnilo/prism` | `dist/index.{js,d.ts}` |
|
|
53
75
|
| `@arnilo/prism/providers/openai-compatible` | `dist/providers/openai-compatible.{js,d.ts}` |
|
|
76
|
+
| `@arnilo/prism/providers/transport` | `dist/providers/transport.{js,d.ts}` |
|
|
77
|
+
| `@arnilo/prism/providers/openai` | `dist/providers/openai-primitives.{js,d.ts}` |
|
|
78
|
+
| `@arnilo/prism/providers/media` | `dist/providers/media.{js,d.ts}` |
|
|
54
79
|
| `@arnilo/prism/testing/provider-conformance` | `dist/testing/provider-conformance.{js,d.ts}` |
|
|
55
80
|
| `@arnilo/prism/testing/session-store-conformance` | `dist/testing/session-store-conformance.{js,d.ts}` |
|
|
56
81
|
| `@arnilo/prism/testing/compaction-conformance` | `dist/testing/compaction-conformance.{js,d.ts}` |
|
|
57
82
|
| `@arnilo/prism/testing/tool-conformance` | `dist/testing/tool-conformance.{js,d.ts}` |
|
|
58
83
|
| `@arnilo/prism/testing/extension-conformance` | `dist/testing/extension-conformance.{js,d.ts}` |
|
|
84
|
+
| `@arnilo/prism/testing/persistence-schema` | `dist/testing/persistence-schema.{js,d.ts}` |
|
|
85
|
+
| `@arnilo/prism/testing/run-ledger-conformance` | `dist/testing/run-ledger-conformance.{js,d.ts}` |
|
|
86
|
+
| `@arnilo/prism/testing/feedback` | `dist/testing/feedback.{js,d.ts}` |
|
|
59
87
|
| `@arnilo/prism/node/config` | `dist/node/config.{js,d.ts}` |
|
|
60
88
|
| `@arnilo/prism/node/settings` | `dist/node/settings.{js,d.ts}` |
|
|
61
89
|
| `@arnilo/prism/node/trust` | `dist/node/trust.{js,d.ts}` |
|
|
@@ -70,10 +98,10 @@ Public core import specifiers (from the root `exports` map):
|
|
|
70
98
|
A packed tarball contains only public compiled output and release files:
|
|
71
99
|
|
|
72
100
|
- `dist/**` compiled `.js` and `.d.ts` for every exported subpath.
|
|
73
|
-
- `README.md`, `LICENSE`, `CHANGELOG.md
|
|
74
|
-
- The core tarball additionally ships the full `docs/` directory (the docs hub)
|
|
101
|
+
- Code packages ship `README.md`, `LICENSE`, and `CHANGELOG.md`; family/profile packages ship `README.md` and `CHANGELOG.md`.
|
|
102
|
+
- The core tarball additionally ships the full `docs/` directory (the docs hub) and `templates/init/` used by `prism init`.
|
|
75
103
|
- `dist/cli.js` and the `bin` link in core.
|
|
76
|
-
- **Tarball filenames.** npm strips the `@scope/` prefix, so the core package `@arnilo/prism` produces a tarball named `arnilo-prism-0.0.
|
|
104
|
+
- **Tarball filenames.** npm strips the `@scope/` prefix, so the core package `@arnilo/prism` produces a tarball named `arnilo-prism-0.0.5.tgz`; first-party packages produce `arnilo-prism-provider-<name>-0.0.5.tgz` / `arnilo-prism-compaction-<name>-0.0.5.tgz` / `arnilo-prism-coding-agent-0.0.5.tgz`; family/profile packages produce `arnilo-prism-{providers,compaction,base,code,sdk,all}-0.0.5.tgz`. The CLI bin name `prism` is unaffected by the package name (`npx prism` still works; npm allows the bin field to differ from the package name).
|
|
77
105
|
|
|
78
106
|
Excluded from every tarball by `files` negation:
|
|
79
107
|
|
|
@@ -83,6 +111,8 @@ Excluded from every tarball by `files` negation:
|
|
|
83
111
|
|
|
84
112
|
`sideEffects` is `false` for every first-party package (their entrypoints export only types and declarations). Core sets `sideEffects: ["dist/cli.js"]` because `src/cli.ts` runs the CLI and sets `process.exitCode` at import time; every other core entrypoint is side-effect-free.
|
|
85
113
|
|
|
114
|
+
`prism init` generates a private TypeScript project whose default dependency set is only `@arnilo/prism` (plus TypeScript tooling as `devDependencies`). Provider and `--with-workflows` / `--with-evals` flags add only the selected optional packages. Measured default clean install is ~27.5 MB versus the Mastra scaffold baseline of 439 MB.
|
|
115
|
+
|
|
86
116
|
## Request/response example
|
|
87
117
|
|
|
88
118
|
```json
|
|
@@ -90,9 +120,9 @@ Excluded from every tarball by `files` negation:
|
|
|
90
120
|
"name": "host-app",
|
|
91
121
|
"type": "module",
|
|
92
122
|
"dependencies": {
|
|
93
|
-
"@arnilo/prism": "0.0.
|
|
94
|
-
"@arnilo/prism-provider-openai": "0.0.
|
|
95
|
-
"@arnilo/prism-compaction-observational-memory": "0.0.
|
|
123
|
+
"@arnilo/prism": "0.0.5",
|
|
124
|
+
"@arnilo/prism-provider-openai": "0.0.5",
|
|
125
|
+
"@arnilo/prism-compaction-observational-memory": "0.0.5"
|
|
96
126
|
}
|
|
97
127
|
}
|
|
98
128
|
```
|
|
@@ -102,7 +132,7 @@ Installing the provider/compaction packages without `@arnilo/prism` present prod
|
|
|
102
132
|
```text
|
|
103
133
|
npm error code ERESOLVE
|
|
104
134
|
npm error Could not resolve dependency:
|
|
105
|
-
npm error peer @arnilo/prism@"0.0.
|
|
135
|
+
npm error peer @arnilo/prism@"0.0.5" from @arnilo/prism-provider-openai@0.0.5
|
|
106
136
|
```
|
|
107
137
|
|
|
108
138
|
## Implementation example
|
|
@@ -135,24 +165,174 @@ For SDK readiness, run the same one-command gate directly. It composes existing
|
|
|
135
165
|
npm run sdk:ready
|
|
136
166
|
```
|
|
137
167
|
|
|
168
|
+
Release publication derives all 30 packages from the workspace once, validates exact `0.0.5` manifest/lockfile/internal ranges, then uses deterministic dependency order. `release:check` requires a clean commit tagged `v0.0.5` and rejects any existing registry version. `release:publish --resume` skips only registry versions whose internal dependency fingerprint matches the local manifest; conflicting versions fail closed. Each attempted package is written immediately to the JSON report, so a failed job can rerun safely. `--dry-run` still performs registry availability checks and invokes `npm publish --dry-run` with explicit public access, provenance, and `latest` tag.
|
|
169
|
+
|
|
170
|
+
```bash
|
|
171
|
+
npm run release:check -- --version 0.0.5
|
|
172
|
+
npm run release:publish -- --version 0.0.5 --dry-run --allow-dirty --allow-untagged
|
|
173
|
+
```
|
|
174
|
+
|
|
175
|
+
`--allow-dirty` and `--allow-untagged` exist only for local preview; real publication and CI never pass them. npm registry calls occur only in these release preflight/publication commands, never build/test/package discovery.
|
|
176
|
+
|
|
138
177
|
Optional live smoke tests stay separate from SDK readiness because they require credentials and network access:
|
|
139
178
|
|
|
140
179
|
```bash
|
|
141
180
|
PRISM_LIVE_PROVIDER_TESTS=1 npm run test --workspaces --if-present
|
|
142
181
|
```
|
|
143
182
|
|
|
183
|
+
### 0.0.5 publish handoff
|
|
184
|
+
|
|
185
|
+
**Decision: GO after operator prerequisites below.** Code, tests, package graph, live PostgreSQL, registry availability, packed artifacts, and dependency-ordered publication dry-run passed from the Phase 14 working tree. Clean protected-branch CI, signed commit/tag, npm authentication, OIDC attestation, and actual publication remain operator/workflow prerequisites. No package was published during readiness work.
|
|
186
|
+
|
|
187
|
+
#### npm authentication prerequisite
|
|
188
|
+
|
|
189
|
+
The existing GitHub Actions secret `NPM_TOKEN` is used only by the publish step as `NODE_AUTH_TOKEN`, matching previous Prism releases. Confirm that token remains valid and can publish existing and new public packages under `@arnilo`; no additional secret or manual npm publish is required. The workflow also requests OIDC and always passes `--provenance`.
|
|
190
|
+
|
|
191
|
+
#### Release commit and tag
|
|
192
|
+
|
|
193
|
+
Merge through the protected release branch, then run these commands from a clean checkout of the protected merge commit. `git push origin v0.0.5` is the workflow dispatch; there is no manual publish command.
|
|
194
|
+
|
|
195
|
+
```bash
|
|
196
|
+
# Prepare and push the release commit.
|
|
197
|
+
git diff --check
|
|
198
|
+
npm ci
|
|
199
|
+
npm run sdk:ready
|
|
200
|
+
git add -A
|
|
201
|
+
git diff --cached --check
|
|
202
|
+
git commit -S -m "Release 0.0.5"
|
|
203
|
+
git push origin HEAD
|
|
204
|
+
|
|
205
|
+
# Merge/confirm protected branch CI, then check out that exact clean merge commit.
|
|
206
|
+
test -z "$(git status --porcelain)"
|
|
207
|
+
npm ci
|
|
208
|
+
npm run release:check -- --version 0.0.5 --allow-untagged --report /tmp/prism-0.0.5-preflight.json
|
|
209
|
+
|
|
210
|
+
git tag -s v0.0.5 -m "Prism 0.0.5"
|
|
211
|
+
git verify-tag v0.0.5
|
|
212
|
+
test "$(git rev-parse HEAD)" = "$(git rev-list -n 1 v0.0.5)"
|
|
213
|
+
npm run release:check -- --version 0.0.5 --report /tmp/prism-0.0.5-tagged-preflight.json
|
|
214
|
+
git push origin v0.0.5
|
|
215
|
+
```
|
|
216
|
+
|
|
217
|
+
The tag workflow's only publication command is `npm run release:publish -- --version "${GITHUB_REF_NAME#v}" --resume --report release-artifacts/publish-report.json`. Latest registry preflight returned `available` for all 30 `0.0.5` versions. Publisher order is stable and dependency-safe:
|
|
218
|
+
|
|
219
|
+
```text
|
|
220
|
+
1 @arnilo/prism
|
|
221
|
+
2 @arnilo/prism-coding-agent
|
|
222
|
+
3 @arnilo/prism-compaction-llm
|
|
223
|
+
4 @arnilo/prism-compaction-observational-memory
|
|
224
|
+
5 @arnilo/prism-credentials-node
|
|
225
|
+
6 @arnilo/prism-evals
|
|
226
|
+
7 @arnilo/prism-mcp
|
|
227
|
+
8 @arnilo/prism-memory
|
|
228
|
+
9 @arnilo/prism-observability-opentelemetry
|
|
229
|
+
10 @arnilo/prism-provider-ai-sdk
|
|
230
|
+
11 @arnilo/prism-provider-kimi
|
|
231
|
+
12 @arnilo/prism-provider-neuralwatt
|
|
232
|
+
13 @arnilo/prism-provider-openai
|
|
233
|
+
14 @arnilo/prism-provider-opencode-go
|
|
234
|
+
15 @arnilo/prism-provider-openrouter
|
|
235
|
+
16 @arnilo/prism-provider-zai
|
|
236
|
+
17 @arnilo/prism-session-store-postgres
|
|
237
|
+
18 @arnilo/prism-session-store-sqlite
|
|
238
|
+
19 @arnilo/prism-supervisor
|
|
239
|
+
20 @arnilo/prism-tool-validator-json-schema
|
|
240
|
+
21 @arnilo/prism-workflows
|
|
241
|
+
22 @arnilo/prism-coding-security
|
|
242
|
+
23 @arnilo/prism-compaction
|
|
243
|
+
24 @arnilo/prism-providers
|
|
244
|
+
25 @arnilo/prism-rag
|
|
245
|
+
26 @arnilo/prism-server
|
|
246
|
+
27 @arnilo/prism-base
|
|
247
|
+
28 @arnilo/prism-code
|
|
248
|
+
29 @arnilo/prism-sdk
|
|
249
|
+
30 @arnilo/prism-all
|
|
250
|
+
```
|
|
251
|
+
|
|
252
|
+
#### Interruption and resume
|
|
253
|
+
|
|
254
|
+
Do not create another tag or rerun packages manually. Re-run failed jobs for the same tag in GitHub Actions. The workflow invokes `release:publish --resume`: registry versions with matching names, versions, and internal dependency fingerprints are skipped; any mismatch stops the job. Retain `release-artifacts-v0.0.5` and `publish-report-v0.0.5` for audit.
|
|
255
|
+
|
|
256
|
+
#### Bounded post-publish smoke
|
|
257
|
+
|
|
258
|
+
Download the workflow artifact and run `sha256sum -c SHA256SUMS`. Then verify all registry versions/tags/integrity and install the complete profile in a fresh directory:
|
|
259
|
+
|
|
260
|
+
```bash
|
|
261
|
+
while read -r package; do
|
|
262
|
+
test "$(npm view "$package@0.0.5" version)" = "0.0.5"
|
|
263
|
+
test "$(npm view "$package" dist-tags.latest)" = "0.0.5"
|
|
264
|
+
npm view "$package@0.0.5" dist.integrity >/dev/null
|
|
265
|
+
done <<'PACKAGES'
|
|
266
|
+
@arnilo/prism
|
|
267
|
+
@arnilo/prism-coding-agent
|
|
268
|
+
@arnilo/prism-compaction-llm
|
|
269
|
+
@arnilo/prism-compaction-observational-memory
|
|
270
|
+
@arnilo/prism-credentials-node
|
|
271
|
+
@arnilo/prism-evals
|
|
272
|
+
@arnilo/prism-mcp
|
|
273
|
+
@arnilo/prism-memory
|
|
274
|
+
@arnilo/prism-rag
|
|
275
|
+
@arnilo/prism-server
|
|
276
|
+
@arnilo/prism-supervisor
|
|
277
|
+
@arnilo/prism-observability-opentelemetry
|
|
278
|
+
@arnilo/prism-provider-kimi
|
|
279
|
+
@arnilo/prism-provider-neuralwatt
|
|
280
|
+
@arnilo/prism-provider-openai
|
|
281
|
+
@arnilo/prism-provider-opencode-go
|
|
282
|
+
@arnilo/prism-provider-openrouter
|
|
283
|
+
@arnilo/prism-provider-zai
|
|
284
|
+
@arnilo/prism-session-store-postgres
|
|
285
|
+
@arnilo/prism-session-store-sqlite
|
|
286
|
+
@arnilo/prism-tool-validator-json-schema
|
|
287
|
+
@arnilo/prism-workflows
|
|
288
|
+
@arnilo/prism-coding-security
|
|
289
|
+
@arnilo/prism-compaction
|
|
290
|
+
@arnilo/prism-providers
|
|
291
|
+
@arnilo/prism-base
|
|
292
|
+
@arnilo/prism-code
|
|
293
|
+
@arnilo/prism-sdk
|
|
294
|
+
@arnilo/prism-all
|
|
295
|
+
PACKAGES
|
|
296
|
+
|
|
297
|
+
consumer="$(mktemp -d)"
|
|
298
|
+
cd "$consumer"
|
|
299
|
+
npm init -y >/dev/null
|
|
300
|
+
npm install --no-audit --no-fund @arnilo/prism-all@0.0.5
|
|
301
|
+
node --input-type=module <<'NODE'
|
|
302
|
+
for (const name of [
|
|
303
|
+
"@arnilo/prism", "@arnilo/prism-coding-agent", "@arnilo/prism-coding-security",
|
|
304
|
+
"@arnilo/prism-compaction-llm", "@arnilo/prism-compaction-observational-memory",
|
|
305
|
+
"@arnilo/prism-credentials-node", "@arnilo/prism-mcp", "@arnilo/prism-observability-opentelemetry",
|
|
306
|
+
"@arnilo/prism-provider-kimi", "@arnilo/prism-provider-neuralwatt", "@arnilo/prism-provider-openai",
|
|
307
|
+
"@arnilo/prism-provider-opencode-go", "@arnilo/prism-provider-openrouter", "@arnilo/prism-provider-zai",
|
|
308
|
+
"@arnilo/prism-session-store-postgres", "@arnilo/prism-session-store-sqlite",
|
|
309
|
+
"@arnilo/prism-tool-validator-json-schema", "@arnilo/prism-workflows", "@arnilo/prism-evals",
|
|
310
|
+
"@arnilo/prism-provider-ai-sdk", "@arnilo/prism-memory", "@arnilo/prism-rag",
|
|
311
|
+
"@arnilo/prism-server", "@arnilo/prism-supervisor",
|
|
312
|
+
]) await import(name);
|
|
313
|
+
NODE
|
|
314
|
+
./node_modules/.bin/prism --help >/dev/null
|
|
315
|
+
npm audit signatures --json --include-attestations > npm-signatures.json
|
|
316
|
+
```
|
|
317
|
+
|
|
318
|
+
This smoke is bounded to registry metadata, imports, CLI startup, checksums, signatures, and provenance; do not rerun the full release suite after immutable publication.
|
|
319
|
+
|
|
320
|
+
#### Rollback limitations
|
|
321
|
+
|
|
322
|
+
npm publication is not transactional and published versions are immutable. Partial publication is a resume case, not rollback. For a confirmed systemic defect after completion, deprecate every affected `@0.0.5`; restore `latest` to `0.0.3` only for the 13 previously published packages, and remove `latest` from the 11 first-publication packages. Exact `0.0.5` installs remain possible, so publish a fixed version promptly. Do not unpublish except for a security/legal emergency under npm policy.
|
|
323
|
+
|
|
144
324
|
## Extension and configuration notes
|
|
145
325
|
|
|
146
|
-
- **Required `@arnilo/prism` peer.** Every first-party package declares `peerDependencies: { "@arnilo/prism": "0.0.
|
|
147
|
-
- **Public access.** All
|
|
326
|
+
- **Required `@arnilo/prism` peer.** Every first-party package declares `peerDependencies: { "@arnilo/prism": "0.0.5" }` with no `peerDependenciesMeta` (non-optional). The range stays pinned to `0.0.5` for the 0.x series and will widen to `^1.0.0` at the 1.x stable release. Inside the workspace each package also declares `"@arnilo/prism": "file:../.."` in `devDependencies` so `npm install` resolves the peer locally; that devDependency is stripped from consumer installs and is not a runtime dependency.
|
|
327
|
+
- **Public access.** All 30 manifests (24 code packages + 6 family/profile packages) declare `"publishConfig": { "access": "public" }`; the publisher also passes `--access public` explicitly because scoped packages otherwise default to restricted on first publish.
|
|
148
328
|
- **Map retention knob.** Source maps are emitted locally but stripped from tarballs by `!dist/**/*.map`. Removing that `files` negation ships maps in releases (larger tarballs, better consumer stack traces).
|
|
149
|
-
- **Release workflow.** `.github/workflows/release.yml` has
|
|
329
|
+
- **Release workflow.** `.github/workflows/release.yml` has four jobs. `verify` runs the full SDK readiness gate on Node 24: `npm ci`, then `npm run sdk:ready` (`npm run typecheck`, network-free `npm test`, and `npm run pack:dry-run`). `node20-compat` runs on Node 20: `npm ci`, `npm run build`, then imports every public root `exports` default target from `dist/`. This proves published-package basics under declared `engines.node >=20` without docs examples, which require Node >=22.6 native TypeScript stripping. `postgres-integration` runs the PostgreSQL suite against `pgvector/pgvector:pg16`. `publish` runs only for exact `v*` tags after all three gates, checks clean/tagged state and the complete 0.0.5 graph, then publishes in topological order through `scripts/release.mjs`. The existing `NPM_TOKEN` GitHub secret is exposed only to the publish step; `id-token: write` also enables OIDC where configured. npm receives `--provenance --access public --tag latest`; no credential value is placed in source or output. Before publishing, CI packs all 30 tarballs, generates `SHA256SUMS`, and retains both pack manifests and artifacts for 30 days. Registry state is the resume journal: matching published packages are skipped, mismatches stop publication, and an incremental package-status report is also retained for 30 days. Local `npm run release:dry-run` delegates to `npm run sdk:ready`; local PostgreSQL coverage is `PRISM_TEST_POSTGRES_URL=... npm run test:postgres`.
|
|
150
330
|
- **Adding a package.** New workspace packages are picked up automatically by `npm run build --workspaces`, `npm test --workspaces`, `npm run pack:dry-run`, the packaging guard (`src/__tests__/packaging.test.ts`), and the install-smoke test (`src/__tests__/install-smoke.test.ts`) via the workspace glob; add the package to both tests' config arrays for explicit per-package assertions.
|
|
151
331
|
|
|
152
332
|
## Security and performance notes
|
|
153
333
|
|
|
154
334
|
- **No secrets or fixtures in tarballs.** Tests, fixtures, `src/`, `plans/`, `.agents/`, `roadmap.md`, and `tsconfig` files are excluded. The `docs avoid real-looking secret examples` docs check and the packaging guard's deny list prevent secret-bearing fixtures from shipping.
|
|
155
|
-
- **Live tests stay opt-in.** The default `npm test` is network-free by construction and never sets these vars.
|
|
335
|
+
- **Live tests stay opt-in.** The default `npm test` is network-free by construction and never sets these vars. Provider/compaction live gates stay credential-gated and are not set by default or during `sdk:ready`. The PostgreSQL adapter live matrix is the exception that runs in CI via the dedicated `postgres-integration` job (still skipped in the default suite).
|
|
156
336
|
- `PRISM_LIVE_PROVIDER_TESTS=1` — gates the six provider packages' `src/__tests__/live.test.ts` (`@arnilo/prism-provider-openai`, `provider-opencode-go`, `provider-openrouter`, `provider-zai`, `provider-kimi`, `provider-neuralwatt`). Each provider live test also requires its own API key env var and skips safely when it is missing:
|
|
157
337
|
- `OPENAI_API_KEY` for `@arnilo/prism-provider-openai`
|
|
158
338
|
- `OPENROUTER_API_KEY` for `@arnilo/prism-provider-openrouter`
|
|
@@ -162,14 +342,40 @@ PRISM_LIVE_PROVIDER_TESTS=1 npm run test --workspaces --if-present
|
|
|
162
342
|
- `OPENCODE_API_KEY` for `@arnilo/prism-provider-opencode-go`
|
|
163
343
|
- `PRISM_LIVE_COMPACTION_TESTS=1` — gates `@arnilo/prism-compaction-llm`'s live summary-provider smoke test (placeholder).
|
|
164
344
|
- `PRISM_LIVE_OBSERVATIONAL_MEMORY_TESTS=1` — gates `@arnilo/prism-compaction-observational-memory`'s live worker/provider checks (placeholder).
|
|
345
|
+
- `PRISM_TEST_POSTGRES_URL` — gates `@arnilo/prism-session-store-postgres` and `@arnilo/prism-memory` integration tests against a real database (memory path requires pgvector). Local: `PRISM_TEST_POSTGRES_URL=... npm run test:postgres`. CI: `postgres-integration` job with `pgvector/pgvector:pg16`.
|
|
346
|
+
- `PRISM_TEST_KEYCHAIN=1` — gates `@arnilo/prism-credentials-node` system-keychain round-trips (requires a working OS keychain backend; skipped by default).
|
|
165
347
|
- Provider live tests read the API key from the env only when both gates are set; the key is used as a bearer token and never logged. `assertNoSecretLeak` verifies the key value does not appear in any streamed event. The compaction placeholders still carry no real credentials.
|
|
166
348
|
- Enforced by `network-free-guard.test.ts` (default suite stays network-free) and by source-scanning meta-tests that assert each `live.test.ts` keeps its `skip:` guard.
|
|
167
|
-
- **Install smoke is offline.** The install-smoke test packs core + every package into a temp dir and installs
|
|
349
|
+
- **Install smoke is offline.** The install-smoke test packs core + every package into a temp dir and installs tarballs with `--offline --no-audit --no-fund` into a fresh project. External dependencies are satisfied from the lockfile-backed npm cache prepared by `npm ci`; any attempted uncached registry fetch fails the gate.
|
|
168
350
|
- **Offline test budget.** The default `npm test` (no `PRISM_LIVE_PROVIDER_TESTS`) is pinned at **< 60s on Node 20** with a measured local baseline of ~45s (build ~18s + network-free tests/workspace tests/packaging smoke ~27s). The full CI `sdk:ready` gate runs on Node 24 because docs tests execute `examples/*.ts` via native TypeScript stripping. `npm run sdk:ready` also runs typecheck and pack dry-run, so it is allowed to exceed the `npm test` budget while remaining network-free. The CI `sdk:ready` step has `timeout-minutes: 5` as a hang backstop; the separate Node 20 compatibility step has `timeout-minutes: 3`. The budget was raised from 30s after the default suite grew to include every first-party package, offline install smoke, packaging guards, docs examples, and workspace tests; optimize before raising it again.
|
|
169
351
|
|
|
352
|
+
### 0.0.5 dependency audit decision (2026-07-14)
|
|
353
|
+
|
|
354
|
+
`npm audit --audit-level=high` reports 0 vulnerabilities and `npm ls --all` is clean. Lockfile registry entries all carry integrity hashes and resolved registry URLs; direct/runtime dependency licenses are permissive. `@types/node` was updated within its declared Node 22 range from 22.19.21 to 22.20.1. No runtime dependency changed.
|
|
355
|
+
|
|
356
|
+
Major updates are deliberately deferred from this feature release: `diff` 8.0.4 → 9 requires coding-tool compatibility review, TypeScript 5.9.3 → 7 requires compiler/output review, and `@types/node` 22 → 26 would exceed the project's Node 20 support target. Revisit each in a dedicated dependency update after 0.0.5; none addresses a current audit finding. Native `better-sqlite3` is the sole dependency with an install hook and remains isolated in the opt-in SQLite package.
|
|
357
|
+
|
|
358
|
+
### 0.0.5 release-candidate verification — 2026-07-16
|
|
359
|
+
|
|
360
|
+
Phase 14 validation ran from the current working tree without creating a release commit/tag or publishing. Clean protected-branch/tag checks remain mandatory in the handoff above.
|
|
361
|
+
|
|
362
|
+
| Gate | Result |
|
|
363
|
+
| --- | --- |
|
|
364
|
+
| Node 24 full matrix | `npm test` 32.247 s; `npm run sdk:ready` 70.560 s; 1,618 tests (1,593 pass, 25 explicit live skips, 0 fail). The `< 60s` default-test budget and 5-minute SDK hang backstop hold. |
|
|
365
|
+
| Node 20 compatibility | Node 20.20.2 imported all 44 built root/package export targets. CI repeats build + root public imports from a clean checkout. |
|
|
366
|
+
| PostgreSQL | Fresh `pgvector/pgvector:pg16` container; 29 session/run/feedback/checkpoint/lease/memory/pgvector checks passed with 0 skips/failures. |
|
|
367
|
+
| Packed consumer | All 30 exact 0.0.5 tarballs installed together; every root subpath/code package imported. Public packed composition covers streaming, fake AI SDK, eval/feedback, memory/RAG, durable approval, schedules/replay, server/MCP, and supervisor/A2A offline. Generated `prism init` project installs packed core, typechecks, and tests. |
|
|
368
|
+
| Artifact contents | All 30 dry-run packs pass with 699 files. Follow-up umbrella snapshot: ~690.6 kB packed / 2.64 MB unpacked total; core ~403.7 kB / 1.46 MB / 221 files; `prism-providers` 1,370 / 3,540 B / 3 files; `prism-all` 1,556 / 3,561 B / 3 files. CI regenerates exact manifests/checksums after the release commit. Denied tests/maps/source/plans/internal artifacts are absent. |
|
|
369
|
+
| Registry and order | Live public-registry preflight reports all 30 `@arnilo/*@0.0.5` versions available. Dependency-ordered `release:publish --dry-run` completed 30/30 and retained JSON status/order; no publish occurred. |
|
|
370
|
+
| Supply chain | `npm audit --audit-level=high`: 0 vulnerabilities; `npm ls --all`: clean. CycloneDX 1.5 SBOM has 181 components and no prohibited licenses. MIT/ISC/BSD/Apache-family licenses only. `better-sqlite3` is the sole install-script package and remains isolated behind opt-in SQLite. All 30 SHA-256 tarball checksums re-verify; extracted tarball token/private-key scan has 0 hits. |
|
|
371
|
+
| Provenance | Dry-run used explicit public/latest/provenance arguments. Signed npm provenance attestation is intentionally generated only by real OIDC publication from the clean signed `v0.0.5` tag workflow. |
|
|
372
|
+
| Deferred live smokes | No provider API credentials, OS keychain gate, or external A2A endpoint was configured. Their tests remain explicit opt-in; offline conformance is authoritative for this release candidate. |
|
|
373
|
+
|
|
374
|
+
Pack manifests, SBOM, checksums, registry report, and dry-run publish report were generated under `/tmp/prism-p14-release`; CI recreates and retains release artifacts rather than committing generated files.
|
|
375
|
+
|
|
170
376
|
## Release checklist
|
|
171
377
|
|
|
172
|
-
Every release gate maps to an exact enforcement test or command, so the checklist is executable rather than manual. Run `npm run sdk:ready` for the full local SDK readiness gate: `npm run typecheck`, network-free `npm test`, and `npm run pack:dry-run`. `npm run release:dry-run` is an alias for the same gate. The GitHub Actions `verify` job runs `npm ci` and `npm run sdk:ready` on Node 24; `node20-compat` runs `npm ci`, `npm run build`, and public export imports on Node 20.
|
|
378
|
+
Every release gate maps to an exact enforcement test or command, so the checklist is executable rather than manual. Run `npm run sdk:ready` for the full local SDK readiness gate: `npm run typecheck`, network-free `npm test`, and `npm run pack:dry-run`. `npm run release:dry-run` is an alias for the same gate. The GitHub Actions `verify` job runs `npm ci` and `npm run sdk:ready` on Node 24; `node20-compat` runs `npm ci`, `npm run build`, and public export imports on Node 20; `postgres-integration` runs the opt-in PostgreSQL adapter suite against a CI Postgres service.
|
|
173
379
|
|
|
174
380
|
| Gate | Enforcement |
|
|
175
381
|
| --- | --- |
|
|
@@ -177,10 +383,11 @@ Every release gate maps to an exact enforcement test or command, so the checklis
|
|
|
177
383
|
| Package exports/subpaths resolve to built output | `public-export-contract.test.ts` asserts every `exports`/`main`/`types`/`bin` target resolves to a built file under `dist/` with a sibling `.d.ts`, and no target escapes `dist/` (no `src/` or `examples/` leak). CI `node20-compat` also imports every public root `exports` default target on Node 20. |
|
|
178
384
|
| Public-API drift | `public-export-contract.test.ts` `phase39_public_protocol_exports_and_types_do_not_drift` pins the runtime protocol (`providerToolCallDelta`, `ToolCallDeltaContent`), the `/testing/provider-conformance` subpath shape, and the observational-memory runtime `.d.ts` surface. |
|
|
179
385
|
| Root SDK export surface freeze | `public-export-contract.test.ts` `root export surface is frozen` snapshots every value and type export of `src/index.ts` (107 value + 69 type) so any add/remove is a deliberate test update; `every frozen value export resolves at runtime` rebuilds `dist/index.js` and asserts each value export is present (catches build drift), and `every frozen type export appears in the built type declarations` asserts each type export is in `dist/index.d.ts`. |
|
|
180
|
-
| Examples compile and are listed | `npm run typecheck` runs `tsc -p examples --noEmit`; `docs.test.ts` `
|
|
386
|
+
| Examples compile and are listed; runnable demos execute | `npm run typecheck` runs `tsc -p examples --noEmit`; `docs.test.ts` checks every `examples/*.ts` file is listed in `examples/README.md`, then runs demos offline and scans output for secrets. |
|
|
181
387
|
| Examples run to completion with no secret leakage | `docs.test.ts` `examples_demos_run_to_completion_and_emit_no_secret` runs each demo (Node strips TypeScript types natively) with exit-0 and real-secret scans; `external_app_example_*` pins the DB-backed adapter reference exercising the `RunLedger`, branch-handle checkout, fork, and prior-run resume. |
|
|
182
|
-
| Tarball excludes built tests, source maps, and source | `packaging.test.ts`
|
|
388
|
+
| Tarball excludes built tests, source maps, and source | `packaging.test.ts` rejects `dist/__tests__/`, `*.map`, `src/`, `plans/`, and internal files; confirms every package ships README/changelog (and code packages ship LICENSE), core ships docs + CLI, exported targets exist (`dist/index.js` + `dist/index.d.ts` for NeuralWatt), and `prism-all` transitively reaches all 30 published first-party manifests. |
|
|
183
389
|
| NeuralWatt package/docs/examples release gate | `packaging.test.ts` pins `@arnilo/prism-provider-neuralwatt` package exports/type declarations and `@arnilo/prism-providers`/`@arnilo/prism-all` membership; `docs.test.ts` asserts `docs/index.md` links `providers/neuralwatt.md` and `provider-caching.md`, and that `examples/cache-aware-prompt-assembly.ts` plus `examples/neuralwatt-agent-run.ts` exist and are listed. |
|
|
390
|
+
| Version graph and resumable publication | `release.test.ts` covers exact package/lock/range validation, topological order, registry collisions, dry-run, interrupted reports/resume, clean tagged git state, provenance/public/tag arguments, and token-safe errors. `release:check` and `release:publish` derive the workspace graph without a manual package list. |
|
|
184
391
|
| Network-free + offline test budget | `network-free-guard.test.ts` keeps the default suite network-free; budget pinned `< 60s` (measured baseline above). Install-smoke is offline (`--offline --no-audit --no-fund`, zero registry fetches). |
|
|
185
392
|
| Core security invariants reaffirmed | Runtime/docs tests hold the trust boundary: **no built-in app tools** (hosts register tools; the core ships only the mock provider and contract helpers), **no hidden provider/credential globals** (providers/credentials are host-owned `AgentConfig` fields, resolved via explicit `providerSource`/`CredentialResolver`), **no auto package discovery** (provider/tool/skill packages are opt-in and individually installed; contribution discovery is realpath-contained and emits inert envelopes the host registers), and **no secret persistence in core** (redaction applies before any `RunLedger`/`SessionStore` append; the ledger gate asserts each message event is written exactly once and redacted). |
|
|
186
393
|
|
package/docs/resource-loading.md
CHANGED
|
@@ -2,10 +2,11 @@
|
|
|
2
2
|
|
|
3
3
|
## What it does
|
|
4
4
|
|
|
5
|
-
Resource helpers decode text, JSON objects, and Prism manifests through a caller-provided `ResourceLoader`.
|
|
5
|
+
Resource helpers decode text, JSON objects, binary payloads, and Prism manifests through a caller-provided `ResourceLoader`.
|
|
6
6
|
|
|
7
7
|
APIs:
|
|
8
8
|
|
|
9
|
+
- `loadBinaryResource()`
|
|
9
10
|
- `loadTextResource()`
|
|
10
11
|
- `loadJsonResource()`
|
|
11
12
|
- `loadManifestResource()`
|
|
@@ -13,13 +14,14 @@ APIs:
|
|
|
13
14
|
|
|
14
15
|
## When to use it
|
|
15
16
|
|
|
16
|
-
Use these helpers when a host already has a resource loader and wants small decoding helpers for prompts, skills, manifests, or package resources.
|
|
17
|
+
Use these helpers when a host already has a resource loader and wants small decoding helpers for prompts, skills, manifests, binary attachments, or package resources.
|
|
17
18
|
|
|
18
19
|
Do not use them for filesystem access, network access, package discovery, URI routing, caching, trust policy, dynamic imports, or agent/session runtime startup. The host-provided loader owns all I/O and trust decisions.
|
|
19
20
|
|
|
20
21
|
## Inputs / request
|
|
21
22
|
|
|
22
23
|
```ts
|
|
24
|
+
loadBinaryResource(loader, uri, context?, options?)
|
|
23
25
|
loadTextResource(loader, uri, context?)
|
|
24
26
|
loadJsonResource(loader, uri, context?)
|
|
25
27
|
loadManifestResource(loader, uri, context?)
|
|
@@ -32,9 +34,11 @@ Inputs:
|
|
|
32
34
|
| `loader` | `ResourceLoader` | Host-owned loader called once for the requested URI. |
|
|
33
35
|
| `uri` | `string` | Resource identifier chosen by the host/package. |
|
|
34
36
|
| `context` | `ResourceLoadContext` | Optional abort signal and metadata forwarded to the loader. |
|
|
37
|
+
| `options` | `LoadBinaryResourceOptions` | Optional `maxItemBytes` override for `loadBinaryResource()`. |
|
|
35
38
|
|
|
36
39
|
## Outputs / response / events
|
|
37
40
|
|
|
41
|
+
- `loadBinaryResource()` returns `resource.data` or UTF-8 encoded `resource.text`, rejecting payloads above `maxItemBytes` (default `DEFAULT_MAX_MEDIA_ITEM_BYTES`).
|
|
38
42
|
- `loadTextResource()` returns `resource.text` or decodes `resource.data` with `TextDecoder`.
|
|
39
43
|
- `loadJsonResource()` parses text as JSON and returns a JSON object.
|
|
40
44
|
- `loadManifestResource()` parses a JSON object and validates it with `parsePrismManifest()`.
|
|
@@ -55,7 +59,7 @@ Inputs:
|
|
|
55
59
|
## Implementation example
|
|
56
60
|
|
|
57
61
|
```ts
|
|
58
|
-
import { loadManifestResource, loadTextResource, type ResourceLoader } from "@arnilo/prism";
|
|
62
|
+
import { loadBinaryResource, loadManifestResource, loadTextResource, type ResourceLoader } from "@arnilo/prism";
|
|
59
63
|
|
|
60
64
|
const loader: ResourceLoader = {
|
|
61
65
|
async load(uri, context) {
|
|
@@ -63,14 +67,18 @@ const loader: ResourceLoader = {
|
|
|
63
67
|
if (uri.endsWith("prism.manifest.json")) {
|
|
64
68
|
return { uri, mediaType: "application/json", text: '{"name":"demo-package"}' };
|
|
65
69
|
}
|
|
70
|
+
if (uri.endsWith(".pdf")) {
|
|
71
|
+
return { uri, mediaType: "application/pdf", data: pdfBytes };
|
|
72
|
+
}
|
|
66
73
|
return { uri, mediaType: "text/markdown", text: "Prompt text" };
|
|
67
74
|
},
|
|
68
75
|
};
|
|
69
76
|
|
|
77
|
+
const bytes = await loadBinaryResource(loader, "package://demo/report.pdf");
|
|
70
78
|
const manifest = await loadManifestResource(loader, "package://demo/prism.manifest.json");
|
|
71
79
|
const prompt = await loadTextResource(loader, "package://demo/prompt.md");
|
|
72
80
|
|
|
73
|
-
console.log(manifest.name, prompt);
|
|
81
|
+
console.log(bytes.byteLength, manifest.name, prompt);
|
|
74
82
|
```
|
|
75
83
|
|
|
76
84
|
## Extension and configuration notes
|
|
@@ -84,12 +92,14 @@ console.log(manifest.name, prompt);
|
|
|
84
92
|
|
|
85
93
|
- The caller-provided loader owns URI trust, permissions, filesystem/network access, and credential boundaries.
|
|
86
94
|
- Node hosts can use `@arnilo/prism/node/trust` (`createPathTrustPolicy`) to guard filesystem paths. It resolves symlinks on the trusted root and target and rejects paths whose realpath escapes the root; missing roots or realpath errors fail closed.
|
|
95
|
+
- `loadBinaryResource()` enforces `ResourceLoadContext.permission` and a finite byte ceiling per call.
|
|
87
96
|
- Helpers call `loader.load()` once per helper call and do not cache, scan, list, watch, poll, or discover packages.
|
|
88
97
|
- JSON parsing fails closed for invalid JSON or non-object JSON.
|
|
89
98
|
- Do not put resolved credential values, tokens, headers, or executable code in loaded config, manifests, prompts, skills, or metadata.
|
|
90
99
|
|
|
91
100
|
## Related APIs
|
|
92
101
|
|
|
102
|
+
- [Multimodal content](multimodal-content.md): bounded `resolveMediaContentBlock()` and SSRF/MIME policy for URL/resource/binary sources.
|
|
93
103
|
- [Configuration and manifests](configuration-and-manifests.md): data-only manifests and manifest resource declarations.
|
|
94
104
|
- [Contribution registries](contribution-registries.md): host-owned registries can store resource loaders.
|
|
95
105
|
- [Public contracts](public-contracts.md): base `ResourceLoader`, `Resource`, and `ResourceLoadContext` contracts.
|