@arnilo/prism 0.0.5 → 0.0.6
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 +28 -1
- package/dist/agent-loops.d.ts +1 -0
- package/dist/agent-loops.js +26 -16
- package/dist/agents.js +2 -3
- package/dist/contracts.d.ts +2 -0
- package/dist/ids.d.ts +2 -0
- package/dist/ids.js +6 -0
- package/dist/index.d.ts +5 -1
- package/dist/index.js +3 -1
- package/dist/session-stores.js +2 -3
- package/dist/testing/persistence-schema.d.ts +45 -7
- package/dist/testing/persistence-schema.js +138 -24
- package/dist/thinking.d.ts +42 -0
- package/dist/thinking.js +92 -0
- package/dist/tools.js +2 -3
- package/dist/use-case-model.d.ts +63 -0
- package/dist/use-case-model.js +52 -0
- package/docs/a2a.md +4 -2
- package/docs/agent-events.md +10 -15
- package/docs/agent-loops.md +11 -8
- package/docs/coding-agent-tools.md +33 -12
- package/docs/coding-security.md +2 -2
- package/docs/compaction-llm.md +17 -7
- package/docs/compaction-observational-memory.md +28 -4
- package/docs/credential-storage.md +58 -9
- package/docs/credentials-and-redaction.md +1 -1
- package/docs/database-persistence.md +8 -3
- package/docs/host-security.md +10 -6
- package/docs/index.md +23 -20
- package/docs/mcp-tools.md +26 -10
- package/docs/migration.md +146 -2
- package/docs/node-filesystem-config.md +1 -0
- package/docs/node-jsonl-session-store.md +5 -4
- package/docs/postgres-persistence.md +3 -3
- package/docs/provider-caching.md +16 -4
- package/docs/provider-conformance.md +39 -1
- package/docs/provider-packages.md +60 -3
- package/docs/providers/ai-sdk.md +36 -0
- package/docs/providers/kimi.md +124 -61
- package/docs/providers/neuralwatt.md +19 -13
- package/docs/providers/openai.md +56 -13
- package/docs/providers/opencode-go.md +118 -30
- package/docs/providers/openrouter.md +105 -35
- package/docs/providers/zai.md +94 -45
- package/docs/release-and-install.md +47 -49
- package/docs/review-coverage-2026-07-17-provider-validation.md +192 -0
- package/docs/runs-and-usage.md +1 -1
- package/docs/sqlite-persistence.md +2 -2
- package/docs/structured-output.md +1 -1
- package/docs/thinking-and-reasoning.md +98 -0
- package/docs/tool-execution-primitives.md +3 -3
- package/docs/tools.md +15 -0
- package/docs/use-case-model-selection.md +109 -0
- package/docs/workflow-orchestration-primitives.md +1 -0
- package/docs/workflows.md +17 -10
- package/docs/working-and-semantic-memory.md +1 -0
- package/package.json +2 -2
package/docs/providers/zai.md
CHANGED
|
@@ -1,62 +1,85 @@
|
|
|
1
|
-
#
|
|
1
|
+
# Z.AI provider package
|
|
2
2
|
|
|
3
3
|
## What it does
|
|
4
4
|
|
|
5
|
-
`@arnilo/prism-provider-zai` provides explicit, side-effect-free setup for the
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
GLM tool-stream quirks.
|
|
5
|
+
`@arnilo/prism-provider-zai` provides explicit, side-effect-free setup for the Z.AI
|
|
6
|
+
GLM Chat Completions API (`POST /chat/completions`) with official deep-thinking,
|
|
7
|
+
reasoning-effort, and tool-stream request fields.
|
|
9
8
|
|
|
10
|
-
The package registers a provider,
|
|
11
|
-
method through `createExtensionKernel().load([...])`.
|
|
9
|
+
The package registers a provider, featured GLM model metadata, and an `api_key`
|
|
10
|
+
auth method through `createExtensionKernel().load([...])`.
|
|
12
11
|
|
|
13
12
|
## When to use it
|
|
14
13
|
|
|
15
|
-
Use it when a host app wants to run
|
|
16
|
-
`AgentSession` runtime with
|
|
14
|
+
Use it when a host app wants to run Z.AI GLM models through Prism's
|
|
15
|
+
`AgentSession` runtime with official `thinking` / `reasoning_effort` /
|
|
16
|
+
`tool_stream` mapping and implicit context caching.
|
|
17
17
|
|
|
18
|
-
Do not use it for automatic credential discovery, catalog fetches, or
|
|
18
|
+
Do not use it for automatic credential discovery, setup-time catalog fetches, or
|
|
19
19
|
real-network tests.
|
|
20
20
|
|
|
21
21
|
## Inputs / request
|
|
22
22
|
|
|
23
23
|
```ts
|
|
24
|
-
import {
|
|
24
|
+
import {
|
|
25
|
+
createZaiProviderPackage,
|
|
26
|
+
defineZaiModel,
|
|
27
|
+
listZaiModels,
|
|
28
|
+
} from "@arnilo/prism-provider-zai";
|
|
25
29
|
|
|
26
30
|
createZaiProviderPackage(options: ZaiProviderPackageOptions): ProviderPackage
|
|
27
|
-
defineZaiModel(config: ZaiModelConfig):
|
|
31
|
+
defineZaiModel(config: ZaiModelConfig): ModelConfig
|
|
32
|
+
listZaiModels(options?: ListZaiModelsOptions): Promise<ModelConfig[]>
|
|
28
33
|
```
|
|
29
34
|
|
|
30
35
|
| Field | Type | Purpose |
|
|
31
36
|
| --- | --- | --- |
|
|
32
37
|
| `apiKey` | `CredentialValueSource` | Direct/callback/resolver API-key source. |
|
|
33
38
|
| `fetch` | `typeof fetch` | Optional fetch implementation for tests/hosts. |
|
|
34
|
-
| `baseUrl` | `string` | Overrides the
|
|
39
|
+
| `baseUrl` | `string` | Overrides the Z.AI base URL (default `https://api.z.ai/api/paas/v4`). |
|
|
35
40
|
| `id` | `string` | Overrides the provider id (default `zai`). |
|
|
36
|
-
| `models` | `readonly ModelConfig[]` | Overrides `zaiModels` defaults. |
|
|
41
|
+
| `models` | `readonly ModelConfig[]` | Overrides featured `zaiModels` defaults. |
|
|
37
42
|
|
|
38
|
-
|
|
39
|
-
|
|
43
|
+
### Thinking / reasoning compat
|
|
44
|
+
|
|
45
|
+
Official body fields (request `options.compat` wins over `model.compat`):
|
|
46
|
+
|
|
47
|
+
| Compat / body field | Wire shape | Notes |
|
|
48
|
+
| --- | --- | --- |
|
|
49
|
+
| `thinking` | `boolean` or `{ type: "enabled" \| "disabled", clear_thinking?: boolean }` | Boolean `true`/`false` maps to `{ type: "enabled" }` / `{ type: "disabled" }`. |
|
|
50
|
+
| `reasoning_effort` | string | GLM-5.2+: `max` (default) \| `xhigh` \| `high` \| `medium` \| `low` \| `minimal` \| `none`. |
|
|
51
|
+
| `tool_stream` | boolean | GLM-4.6+: stream tool-call argument deltas (`false` by API default; featured 4.6+ models opt in). |
|
|
52
|
+
| `clear_thinking` | boolean | Nested into `thinking.clear_thinking`. Default on the API is `true` (drop prior reasoning). Set `false` for Preserved Thinking. |
|
|
53
|
+
| `preserveThinking` | boolean | Prism-local: when true (or when `clear_thinking: false`), replay prior thinking blocks as assistant `reasoning_content`. |
|
|
54
|
+
|
|
55
|
+
`ProviderRequestOptions.cacheRetention: "none"` forces `thinking: { type: "disabled" }`.
|
|
56
|
+
|
|
57
|
+
Shared Prism helpers (`applyThinkingLevel` / `thinkingFamilyForModel`) map portable
|
|
58
|
+
levels into the `reasoning_effort` family for Z.AI; hosts can also set
|
|
59
|
+
`thinking.type` directly for enable/disable.
|
|
40
60
|
|
|
41
61
|
## Outputs / response / events
|
|
42
62
|
|
|
43
63
|
| Surface | Behavior |
|
|
44
64
|
| --- | --- |
|
|
45
|
-
| Provider stream | Prism text, thinking (
|
|
46
|
-
| Block preservation | Text
|
|
65
|
+
| Provider stream | Prism text, thinking (`delta.reasoning_content`), tool-call delta/final, `usage`, `done`, redacted `error`. |
|
|
66
|
+
| Block preservation | Text; thinking → `reasoning_content` when Preserved Thinking is active (otherwise dropped, never flattened into text); assistant `tool_call` → `tool_calls`; `tool_result` → role `tool`; images when `capabilities.input` includes `"image"`. |
|
|
47
67
|
| Auth method | `api_key` for the configured provider id, credential name `apiKey`. |
|
|
48
68
|
|
|
49
69
|
Unsupported block placements or unclaimed images fail before fetch.
|
|
50
70
|
|
|
51
71
|
## Request/response example
|
|
52
72
|
|
|
53
|
-
Example request body (
|
|
73
|
+
Example request body (official Chat Completions shape):
|
|
54
74
|
|
|
55
75
|
```json
|
|
56
76
|
{
|
|
57
|
-
"model": "glm-
|
|
77
|
+
"model": "glm-5.2",
|
|
58
78
|
"messages": [{ "role": "user", "content": "Hello" }],
|
|
59
|
-
"stream": true
|
|
79
|
+
"stream": true,
|
|
80
|
+
"thinking": { "type": "enabled" },
|
|
81
|
+
"reasoning_effort": "max",
|
|
82
|
+
"tool_stream": true
|
|
60
83
|
}
|
|
61
84
|
```
|
|
62
85
|
|
|
@@ -64,63 +87,89 @@ Example request body (OpenAI-compatible Chat Completions shape):
|
|
|
64
87
|
|
|
65
88
|
```ts
|
|
66
89
|
import { createExtensionKernel } from "@arnilo/prism";
|
|
67
|
-
import { createZaiProviderPackage } from "@arnilo/prism-provider-zai";
|
|
90
|
+
import { createZaiProviderPackage, listZaiModels } from "@arnilo/prism-provider-zai";
|
|
68
91
|
|
|
69
92
|
const kernel = createExtensionKernel();
|
|
70
93
|
await kernel.load([createZaiProviderPackage({ apiKey: "fake-zai-key" })]);
|
|
94
|
+
|
|
95
|
+
// Optional caller-gated discovery (never runs during package setup):
|
|
96
|
+
const live = await listZaiModels({ apiKey: "fake-zai-key" });
|
|
97
|
+
await kernel.load([createZaiProviderPackage({ apiKey: "fake-zai-key", models: live })]);
|
|
71
98
|
```
|
|
72
99
|
|
|
73
|
-
|
|
100
|
+
Per-turn thinking override:
|
|
74
101
|
|
|
75
102
|
```ts
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
103
|
+
await session.prompt("Plan the refactor", {
|
|
104
|
+
providerOptions: {
|
|
105
|
+
compat: {
|
|
106
|
+
thinking: { type: "enabled", clear_thinking: false },
|
|
107
|
+
reasoning_effort: "high",
|
|
108
|
+
tool_stream: true,
|
|
109
|
+
},
|
|
110
|
+
},
|
|
111
|
+
});
|
|
81
112
|
```
|
|
82
113
|
|
|
83
114
|
## Extension and configuration notes
|
|
84
115
|
|
|
85
|
-
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
-
|
|
116
|
+
- Default base URL is the official international endpoint
|
|
117
|
+
`https://api.z.ai/api/paas/v4`. Hosts targeting China can pass
|
|
118
|
+
`baseUrl: "https://open.bigmodel.cn/api/paas/v4"`. Coding Plan hosts may use
|
|
119
|
+
`https://api.z.ai/api/coding/paas/v4`.
|
|
120
|
+
- Featured `zaiModels` are offline bootstrap aliases (`glm-5.2`, `glm-5.1`,
|
|
121
|
+
`glm-5`, `glm-5-turbo`, `glm-4.7`, `glm-4.6`, `glm-4.5`) curated from the
|
|
122
|
+
official Chat Completions model enum and overview context sizes.
|
|
123
|
+
- `listZaiModels()` is caller-gated OpenAI-compatible `GET /models` discovery
|
|
124
|
+
(not a first-class docs.z.ai list page). Setup never fetches.
|
|
125
|
+
- `defineZaiModel` sets Z.AI-specific `compat` (`thinking`, `reasoning_effort`,
|
|
126
|
+
`tool_stream`, `clear_thinking`, `preserveThinking`).
|
|
90
127
|
|
|
91
128
|
### Cache behavior
|
|
92
129
|
|
|
93
130
|
- Z.AI GLM models use **implicit context caching**: the server caches prompt
|
|
94
131
|
prefixes automatically based on request content, with no explicit request-side
|
|
95
132
|
cache payload. Catalog models declare `cache: { kind: "implicit" }`.
|
|
133
|
+
- Official docs: hits appear in `usage.prompt_tokens_details.cached_tokens`.
|
|
96
134
|
- The provider sends no `cache_control`, `prompt_cache_key`, `prompt_cache_retention`,
|
|
97
135
|
or other explicit cache-control fields regardless of `ProviderRequestOptions.cache`
|
|
98
136
|
/ `cacheKey` / `cacheRetention` settings — those options have no effect on the
|
|
99
|
-
Z.AI request body
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
`Usage.cacheWriteTokens` when the server reports them.
|
|
137
|
+
Z.AI request body (except `cacheRetention: "none"` disabling thinking).
|
|
138
|
+
- Usage accounting: `prompt_tokens_details.cached_tokens` → `Usage.cacheReadTokens`
|
|
139
|
+
and `prompt_tokens_details.cache_write_tokens` → `Usage.cacheWriteTokens` when
|
|
140
|
+
the server reports them.
|
|
104
141
|
|
|
105
142
|
## Security and performance notes
|
|
106
143
|
|
|
107
|
-
- SSE streams and HTTP error bodies use bounded `@arnilo/prism/providers/transport`
|
|
144
|
+
- SSE streams and HTTP error bodies use bounded `@arnilo/prism/providers/transport`
|
|
145
|
+
helpers (`readSseData`, `readBoundedResponseText`).
|
|
108
146
|
- No network calls during import, setup, build, or default tests.
|
|
109
147
|
- No automatic environment, file, keychain, or shell credential lookup.
|
|
110
148
|
- API keys are resolved per request from caller-supplied values or resolvers and
|
|
111
|
-
redacted from errors.
|
|
149
|
+
redacted from errors (including discovery failures).
|
|
112
150
|
- Caller-supplied `ProviderRequest.options.headers` can add non-owned headers,
|
|
113
151
|
but provider-owned headers (`content-type`, `authorization`) are applied last
|
|
114
152
|
and cannot be overridden by caller headers.
|
|
115
|
-
- Live tests stay opt-in behind `PRISM_LIVE_PROVIDER_TESTS=1` plus
|
|
116
|
-
|
|
153
|
+
- Live tests stay opt-in behind `PRISM_LIVE_PROVIDER_TESTS=1` plus `ZAI_API_KEY`;
|
|
154
|
+
default tests are network-free.
|
|
117
155
|
|
|
118
156
|
## Related APIs
|
|
119
157
|
|
|
120
158
|
- [Provider packages](../provider-packages.md): `defineProviderPackage`,
|
|
121
|
-
|
|
159
|
+
caller-gated discovery, per-turn thinking.
|
|
160
|
+
- [Thinking and reasoning](../thinking-and-reasoning.md): portable
|
|
161
|
+
`applyThinkingLevel` → Z.AI `reasoning_effort` / `thinking.type`.
|
|
122
162
|
- [Credentials and redaction](../credentials-and-redaction.md):
|
|
123
163
|
`resolveCredentialValue`, `redactSecrets`.
|
|
124
|
-
- [
|
|
125
|
-
adapter.
|
|
164
|
+
- [Provider caching](../provider-caching.md): implicit GLM context caching.
|
|
126
165
|
- [Provider conformance](../provider-conformance.md): network-free adapter tests.
|
|
166
|
+
|
|
167
|
+
## Official evidence
|
|
168
|
+
|
|
169
|
+
- [Deep Thinking](https://docs.z.ai/guides/capabilities/thinking)
|
|
170
|
+
- [Thinking Mode](https://docs.z.ai/guides/capabilities/thinking-mode) (Preserved Thinking / `clear_thinking`)
|
|
171
|
+
- [Tool Streaming](https://docs.z.ai/guides/capabilities/stream-tool)
|
|
172
|
+
- [Context Caching](https://docs.z.ai/guides/capabilities/cache)
|
|
173
|
+
- [Chat Completion](https://docs.z.ai/api-reference/llm/chat-completion)
|
|
174
|
+
- [Migrate to GLM-5.2](https://docs.z.ai/guides/overview/migrate-to-glm-new)
|
|
175
|
+
- [Models overview](https://docs.z.ai/guides/overview/overview)
|
|
@@ -6,9 +6,9 @@ Prism is published as one core package, twenty-three first-party capability pack
|
|
|
6
6
|
|
|
7
7
|
Core package:
|
|
8
8
|
|
|
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` ->
|
|
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 has non-optional `@arnilo/prism@0.0.
|
|
11
|
+
First-party workspace packages (each has non-optional `@arnilo/prism@0.0.6` 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
14
|
- `@arnilo/prism-provider-ai-sdk` — optional AI SDK `LanguageModelV4` adapter; included by the provider and all umbrellas.
|
|
@@ -36,7 +36,7 @@ Family/profile packages (pure manifests, no code or `dist`; ship `README.md` and
|
|
|
36
36
|
- `@arnilo/prism-sdk` — base + workflows + MCP + Node credentials + OpenTelemetry; providers and persistence remain explicit choices.
|
|
37
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
38
|
|
|
39
|
-
Profile footprint snapshot (Node 24/npm 11, lockfile graph, 2026-07-
|
|
39
|
+
Profile footprint snapshot (Node 24/npm 11, lockfile graph, 2026-07-19): `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
40
|
|
|
41
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`.
|
|
42
42
|
|
|
@@ -62,9 +62,9 @@ Consumers install the core package for the runtime and add first-party packages
|
|
|
62
62
|
| Run the default (network-free) test suite | `npm test` |
|
|
63
63
|
| Dry-run pack core + every package | `npm run pack:dry-run` |
|
|
64
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.
|
|
66
|
-
| Preview deterministic publish order | `npm run release:publish -- --version 0.0.
|
|
67
|
-
| Resume interrupted tagged publication | `npm run release:publish -- --version 0.0.
|
|
65
|
+
| Validate clean tag/version/ranges and reject registry collisions | `npm run release:check -- --version 0.0.6` |
|
|
66
|
+
| Preview deterministic publish order | `npm run release:publish -- --version 0.0.6 --dry-run --allow-dirty --allow-untagged` |
|
|
67
|
+
| Resume interrupted tagged publication | `npm run release:publish -- --version 0.0.6 --resume --report release-artifacts/publish-report.json` |
|
|
68
68
|
| Full SDK readiness gate (typecheck + offline tests + pack) | `npm run sdk:ready` |
|
|
69
69
|
|
|
70
70
|
Public core import specifiers (from the root `exports` map):
|
|
@@ -101,7 +101,7 @@ A packed tarball contains only public compiled output and release files:
|
|
|
101
101
|
- Code packages ship `README.md`, `LICENSE`, and `CHANGELOG.md`; family/profile packages ship `README.md` and `CHANGELOG.md`.
|
|
102
102
|
- The core tarball additionally ships the full `docs/` directory (the docs hub) and `templates/init/` used by `prism init`.
|
|
103
103
|
- `dist/cli.js` and the `bin` link in core.
|
|
104
|
-
- **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.6.tgz`; first-party packages produce `arnilo-prism-provider-<name>-0.0.6.tgz` / `arnilo-prism-compaction-<name>-0.0.6.tgz` / `arnilo-prism-coding-agent-0.0.6.tgz`; family/profile packages produce `arnilo-prism-{providers,compaction,base,code,sdk,all}-0.0.6.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).
|
|
105
105
|
|
|
106
106
|
Excluded from every tarball by `files` negation:
|
|
107
107
|
|
|
@@ -120,9 +120,9 @@ Excluded from every tarball by `files` negation:
|
|
|
120
120
|
"name": "host-app",
|
|
121
121
|
"type": "module",
|
|
122
122
|
"dependencies": {
|
|
123
|
-
"@arnilo/prism": "0.0.
|
|
124
|
-
"@arnilo/prism-provider-openai": "0.0.
|
|
125
|
-
"@arnilo/prism-compaction-observational-memory": "0.0.
|
|
123
|
+
"@arnilo/prism": "0.0.6",
|
|
124
|
+
"@arnilo/prism-provider-openai": "0.0.6",
|
|
125
|
+
"@arnilo/prism-compaction-observational-memory": "0.0.6"
|
|
126
126
|
}
|
|
127
127
|
}
|
|
128
128
|
```
|
|
@@ -132,7 +132,7 @@ Installing the provider/compaction packages without `@arnilo/prism` present prod
|
|
|
132
132
|
```text
|
|
133
133
|
npm error code ERESOLVE
|
|
134
134
|
npm error Could not resolve dependency:
|
|
135
|
-
npm error peer @arnilo/prism@"0.0.
|
|
135
|
+
npm error peer @arnilo/prism@"0.0.6" from @arnilo/prism-provider-openai@0.0.6
|
|
136
136
|
```
|
|
137
137
|
|
|
138
138
|
## Implementation example
|
|
@@ -165,11 +165,11 @@ For SDK readiness, run the same one-command gate directly. It composes existing
|
|
|
165
165
|
npm run sdk:ready
|
|
166
166
|
```
|
|
167
167
|
|
|
168
|
-
Release publication derives all 30 packages from the workspace once, validates exact `0.0.
|
|
168
|
+
Release publication derives all 30 packages from the workspace once, validates exact `0.0.6` manifest/lockfile/internal ranges, then uses deterministic dependency order. `release:check` requires a clean commit tagged `v0.0.6` 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
169
|
|
|
170
170
|
```bash
|
|
171
|
-
npm run release:check -- --version 0.0.
|
|
172
|
-
npm run release:publish -- --version 0.0.
|
|
171
|
+
npm run release:check -- --version 0.0.6
|
|
172
|
+
npm run release:publish -- --version 0.0.6 --dry-run --allow-dirty --allow-untagged
|
|
173
173
|
```
|
|
174
174
|
|
|
175
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.
|
|
@@ -180,7 +180,7 @@ Optional live smoke tests stay separate from SDK readiness because they require
|
|
|
180
180
|
PRISM_LIVE_PROVIDER_TESTS=1 npm run test --workspaces --if-present
|
|
181
181
|
```
|
|
182
182
|
|
|
183
|
-
### 0.0.
|
|
183
|
+
### 0.0.6 publish handoff
|
|
184
184
|
|
|
185
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
186
|
|
|
@@ -190,7 +190,7 @@ The existing GitHub Actions secret `NPM_TOKEN` is used only by the publish step
|
|
|
190
190
|
|
|
191
191
|
#### Release commit and tag
|
|
192
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.
|
|
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.6` is the workflow dispatch; there is no manual publish command.
|
|
194
194
|
|
|
195
195
|
```bash
|
|
196
196
|
# Prepare and push the release commit.
|
|
@@ -199,22 +199,22 @@ npm ci
|
|
|
199
199
|
npm run sdk:ready
|
|
200
200
|
git add -A
|
|
201
201
|
git diff --cached --check
|
|
202
|
-
git commit -S -m "Release 0.0.
|
|
202
|
+
git commit -S -m "Release 0.0.6"
|
|
203
203
|
git push origin HEAD
|
|
204
204
|
|
|
205
205
|
# Merge/confirm protected branch CI, then check out that exact clean merge commit.
|
|
206
206
|
test -z "$(git status --porcelain)"
|
|
207
207
|
npm ci
|
|
208
|
-
npm run release:check -- --version 0.0.
|
|
208
|
+
npm run release:check -- --version 0.0.6 --allow-untagged --report /tmp/prism-0.0.6-preflight.json
|
|
209
209
|
|
|
210
|
-
git tag -s v0.0.
|
|
211
|
-
git verify-tag v0.0.
|
|
212
|
-
test "$(git rev-parse HEAD)" = "$(git rev-list -n 1 v0.0.
|
|
213
|
-
npm run release:check -- --version 0.0.
|
|
214
|
-
git push origin v0.0.
|
|
210
|
+
git tag -s v0.0.6 -m "Prism 0.0.6"
|
|
211
|
+
git verify-tag v0.0.6
|
|
212
|
+
test "$(git rev-parse HEAD)" = "$(git rev-list -n 1 v0.0.6)"
|
|
213
|
+
npm run release:check -- --version 0.0.6 --report /tmp/prism-0.0.6-tagged-preflight.json
|
|
214
|
+
git push origin v0.0.6
|
|
215
215
|
```
|
|
216
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.
|
|
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.6` versions. Publisher order is stable and dependency-safe:
|
|
218
218
|
|
|
219
219
|
```text
|
|
220
220
|
1 @arnilo/prism
|
|
@@ -251,7 +251,7 @@ The tag workflow's only publication command is `npm run release:publish -- --ver
|
|
|
251
251
|
|
|
252
252
|
#### Interruption and resume
|
|
253
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.
|
|
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.6` and `publish-report-v0.0.6` for audit.
|
|
255
255
|
|
|
256
256
|
#### Bounded post-publish smoke
|
|
257
257
|
|
|
@@ -259,9 +259,9 @@ Download the workflow artifact and run `sha256sum -c SHA256SUMS`. Then verify al
|
|
|
259
259
|
|
|
260
260
|
```bash
|
|
261
261
|
while read -r package; do
|
|
262
|
-
test "$(npm view "$package@0.0.
|
|
263
|
-
test "$(npm view "$package" dist-tags.latest)" = "0.0.
|
|
264
|
-
npm view "$package@0.0.
|
|
262
|
+
test "$(npm view "$package@0.0.6" version)" = "0.0.6"
|
|
263
|
+
test "$(npm view "$package" dist-tags.latest)" = "0.0.6"
|
|
264
|
+
npm view "$package@0.0.6" dist.integrity >/dev/null
|
|
265
265
|
done <<'PACKAGES'
|
|
266
266
|
@arnilo/prism
|
|
267
267
|
@arnilo/prism-coding-agent
|
|
@@ -297,7 +297,7 @@ PACKAGES
|
|
|
297
297
|
consumer="$(mktemp -d)"
|
|
298
298
|
cd "$consumer"
|
|
299
299
|
npm init -y >/dev/null
|
|
300
|
-
npm install --no-audit --no-fund @arnilo/prism-all@0.0.
|
|
300
|
+
npm install --no-audit --no-fund @arnilo/prism-all@0.0.6
|
|
301
301
|
node --input-type=module <<'NODE'
|
|
302
302
|
for (const name of [
|
|
303
303
|
"@arnilo/prism", "@arnilo/prism-coding-agent", "@arnilo/prism-coding-security",
|
|
@@ -319,14 +319,14 @@ This smoke is bounded to registry metadata, imports, CLI startup, checksums, sig
|
|
|
319
319
|
|
|
320
320
|
#### Rollback limitations
|
|
321
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.
|
|
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.6`; 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.6` installs remain possible, so publish a fixed version promptly. Do not unpublish except for a security/legal emergency under npm policy.
|
|
323
323
|
|
|
324
324
|
## Extension and configuration notes
|
|
325
325
|
|
|
326
|
-
- **Required `@arnilo/prism` peer.** Every first-party package declares `peerDependencies: { "@arnilo/prism": "0.0.
|
|
326
|
+
- **Required `@arnilo/prism` peer.** Every first-party package declares `peerDependencies: { "@arnilo/prism": "0.0.6" }` with no `peerDependenciesMeta` (non-optional). The range stays pinned to `0.0.6` 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
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.
|
|
328
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).
|
|
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.
|
|
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.6 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`.
|
|
330
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.
|
|
331
331
|
|
|
332
332
|
## Security and performance notes
|
|
@@ -349,29 +349,27 @@ npm publication is not transactional and published versions are immutable. Parti
|
|
|
349
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.
|
|
350
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.
|
|
351
351
|
|
|
352
|
-
### 0.0.
|
|
352
|
+
### 0.0.6 dependency audit decision (2026-07-19)
|
|
353
353
|
|
|
354
|
-
`npm audit --audit-level=high` reports 0 vulnerabilities and `npm ls --all`
|
|
354
|
+
`npm audit --audit-level=high` reports 0 vulnerabilities and `npm ls --all --depth=0` resolves the exact 30-package `0.0.6` graph. No Phase 1 dependency was added. Native `better-sqlite3` remains the sole install-script dependency and stays in the opt-in SQLite package.
|
|
355
355
|
|
|
356
|
-
|
|
356
|
+
### 0.0.6 release-candidate verification — 2026-07-19
|
|
357
357
|
|
|
358
|
-
|
|
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.
|
|
358
|
+
Phase 1 validation ran from this working tree without creating a release commit/tag or publishing. Clean protected-branch/tag checks remain mandatory in the handoff above.
|
|
361
359
|
|
|
362
360
|
| Gate | Result |
|
|
363
361
|
| --- | --- |
|
|
364
|
-
| Node 24 full matrix | `npm
|
|
365
|
-
| Node 20 compatibility | Node 20.20.2
|
|
366
|
-
| PostgreSQL | Fresh `pgvector/pgvector:pg16` container
|
|
367
|
-
| Packed consumer |
|
|
368
|
-
| Artifact contents | All 30 dry-run packs
|
|
369
|
-
| Registry and order |
|
|
370
|
-
| Supply chain | `npm audit --audit-level=high`: 0 vulnerabilities
|
|
371
|
-
| Provenance |
|
|
372
|
-
| Deferred live smokes | No provider
|
|
373
|
-
|
|
374
|
-
|
|
362
|
+
| Node 24 full matrix | `npm run sdk:ready` passed inside its five-minute backstop: 1,767 tests (1,742 pass, 25 explicit live skips, 0 fail), full typecheck/build, docs/export/install-smoke tests, and 30 dry-run packs. |
|
|
363
|
+
| Node 20 compatibility | Docker Node 20.20.2 built all workspaces and imported every public root export target. |
|
|
364
|
+
| PostgreSQL | Fresh `pgvector/pgvector:pg16` container: 17 session-store plus 14 memory/pgvector checks passed with 0 skips/failures. |
|
|
365
|
+
| Packed consumer | Offline install-smoke packed all 30 exact `0.0.6` tarballs into a fresh consumer, imported public surfaces, ran packed integration/composition journeys, and ran the generated `prism init` project. |
|
|
366
|
+
| Artifact contents | All 30 dry-run packs passed; core is 230 files, 445.5 kB packed, and 1.6 MB unpacked. Packaging guards reject tests, maps, source, plans, internal artifacts, and real-looking secrets. |
|
|
367
|
+
| Registry and order | Public-registry preflight found all 30 `@arnilo/*@0.0.6` versions available. Dependency-ordered `release:publish --dry-run` completed 30/30 with explicit public/latest/provenance arguments; no publish occurred. Core uses npm's valid `bin` path form `dist/cli.js`. |
|
|
368
|
+
| Supply chain | `npm audit --audit-level=high`: 0 vulnerabilities. `npm ls --all --depth=0`: clean. |
|
|
369
|
+
| Provenance | Signed npm provenance is generated only by real OIDC publication from the clean signed `v0.0.6` tag workflow. |
|
|
370
|
+
| Deferred live smokes | No provider credentials or external A2A endpoint were configured. `PRISM_TEST_KEYCHAIN=1` found no working system-keychain backend (native read returned no value after write); run that explicit round-trip on the release host before publication. |
|
|
371
|
+
|
|
372
|
+
The temporary PostgreSQL container and local dry-run report are not release artifacts. CI recreates and retains package manifests, checksums, and the publication report.
|
|
375
373
|
|
|
376
374
|
## Release checklist
|
|
377
375
|
|