@arnilo/prism 0.3.1 → 0.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +58 -0
- package/README.md +34 -57
- package/dist/agent-definitions.js +4 -1
- package/dist/agent-run-lifecycle.js +4 -0
- package/dist/agent-run-state.d.ts +4 -0
- package/dist/agent-run-state.js +18 -5
- package/dist/agent-session/session.d.ts +7 -0
- package/dist/agent-session/session.js +59 -2
- package/dist/cli-dev.d.ts +29 -0
- package/dist/cli-dev.js +52 -0
- package/dist/cli-init.d.ts +17 -2
- package/dist/cli-init.js +194 -21
- package/dist/cli-runner.d.ts +5 -1
- package/dist/cli-runner.js +12 -1
- package/dist/contracts-core/agent.d.ts +29 -2
- package/dist/contracts-protocol.d.ts +18 -0
- package/dist/contracts-run-state.d.ts +1 -2
- package/dist/index.d.ts +3 -1
- package/dist/index.js +2 -1
- package/dist/input.d.ts +8 -0
- package/dist/input.js +4 -0
- package/dist/rpc.d.ts +4 -1
- package/dist/rpc.js +5 -1
- package/dist/testing/persistence-schema.d.ts +1 -1
- package/dist/testing/persistence-schema.js +32 -28
- package/dist/testing/tool-conformance.d.ts +25 -0
- package/dist/testing/tool-conformance.js +128 -1
- package/dist/tool-search.d.ts +76 -0
- package/dist/tool-search.js +199 -0
- package/docs/0.1.0-readiness.md +2 -2
- package/docs/acp-agent.md +1 -1
- package/docs/agent-definitions.md +1 -1
- package/docs/antigravity-agent.md +1 -1
- package/docs/browser-automation.md +5 -5
- package/docs/caveman.md +2 -2
- package/docs/cli-rpc.md +26 -3
- package/docs/coding-agent-tools.md +7 -1
- package/docs/coding-security.md +1 -1
- package/docs/coding-tools.md +82 -0
- package/docs/compaction-and-retry.md +5 -2
- package/docs/compaction-llm.md +4 -4
- package/docs/compaction-observational-memory.md +49 -2
- package/docs/context-and-skills.md +2 -0
- package/docs/core.md +85 -0
- package/docs/credential-storage.md +1 -1
- package/docs/database-persistence.md +4 -0
- package/docs/dev-inspector.md +103 -0
- package/docs/diagrams.md +247 -0
- package/docs/documents.md +213 -0
- package/docs/evaluations.md +35 -1
- package/docs/extension-authoring.md +42 -0
- package/docs/graft.md +3 -3
- package/docs/guardrails.md +1 -1
- package/docs/host-security.md +4 -3
- package/docs/impeccable.md +2 -2
- package/docs/index.md +34 -23
- package/docs/mcp-tools.md +1 -1
- package/docs/migrate-to-0.4.md +312 -0
- package/docs/migration.md +22 -0
- package/docs/model-routing.md +1 -1
- package/docs/multi-agent-patterns.md +177 -0
- package/docs/multimodal-content.md +1 -1
- package/docs/obscura.md +10 -10
- package/docs/openapi-tools.md +1 -1
- package/docs/performance.md +23 -3
- package/docs/persistence-credentials-multimodality-primitives.md +1 -1
- package/docs/policy-and-audit.md +1 -1
- package/docs/ponytail.md +2 -2
- package/docs/prompt-registry.md +106 -0
- package/docs/provider-caching.md +32 -32
- package/docs/provider-conformance.md +1 -1
- package/docs/provider-packages.md +19 -19
- package/docs/provider-primitives.md +4 -4
- package/docs/providers/ai-sdk.md +3 -3
- package/docs/providers/alibaba.md +5 -5
- package/docs/providers/anthropic.md +6 -6
- package/docs/providers/azure.md +3 -3
- package/docs/providers/bedrock.md +3 -3
- package/docs/providers/clinepass.md +3 -3
- package/docs/providers/deepseek.md +3 -3
- package/docs/providers/google.md +4 -4
- package/docs/providers/kimi.md +3 -3
- package/docs/providers/neuralwatt.md +8 -8
- package/docs/providers/ollama.md +3 -3
- package/docs/providers/openai-compatible.md +1 -1
- package/docs/providers/openai.md +5 -5
- package/docs/providers/opencode-go.md +4 -4
- package/docs/providers/openrouter.md +3 -3
- package/docs/providers/vertex.md +5 -5
- package/docs/providers/xai.md +3 -3
- package/docs/providers/zai.md +3 -3
- package/docs/public-contracts.md +1 -1
- package/docs/rag.md +5 -5
- package/docs/release-and-install.md +116 -50
- package/docs/runs-and-usage.md +14 -1
- package/docs/server.md +90 -1
- package/docs/sheets.md +229 -0
- package/docs/supervisors.md +9 -1
- package/docs/thinking-and-reasoning.md +10 -10
- package/docs/tool-conformance.md +27 -2
- package/docs/tools.md +29 -2
- package/docs/web-tools.md +2 -2
- package/docs/wiki.md +24 -10
- package/docs/workflow-orchestration-primitives.md +24 -0
- package/docs/workflows.md +102 -8
- package/docs/working-and-semantic-memory.md +53 -5
- package/package.json +10 -30
- package/templates/README.md +23 -0
- package/templates/deep-research/README.md.tmpl +47 -0
- package/templates/deep-research/env.example.tmpl +12 -0
- package/templates/deep-research/gitignore.tmpl +7 -0
- package/templates/deep-research/manifest.json +12 -0
- package/templates/deep-research/package.json.tmpl +23 -0
- package/templates/deep-research/src/agent.ts.tmpl +81 -0
- package/templates/deep-research/src/index.ts.tmpl +53 -0
- package/templates/deep-research/src/tests/research.test.ts.tmpl +114 -0
- package/templates/deep-research/src/tools.ts.tmpl +86 -0
- package/templates/deep-research/src/types.ts.tmpl +45 -0
- package/templates/deep-research/src/workflow.ts.tmpl +156 -0
- package/templates/deep-research/tsconfig.json.tmpl +15 -0
- package/templates/init/manifest.json +5 -0
- package/templates/init/package.json.tmpl +2 -1
- package/templates/init/providers.json +16 -16
package/docs/providers/azure.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
## What it does
|
|
4
4
|
|
|
5
|
-
`@arnilo/prism-
|
|
5
|
+
`@arnilo/prism-providers/azure` registers an Azure OpenAI / Foundry Chat Completions provider that uses host-supplied Entra workload identity (Bearer) or Azure resource keys (`api-key`). Deployment URLs keep the configured endpoint host (custom subdomain, private endpoint, or VNet FQDN).
|
|
6
6
|
|
|
7
7
|
## When to use it
|
|
8
8
|
|
|
@@ -11,7 +11,7 @@ Use it for enterprise Azure OpenAI / Foundry deployments with Managed Identity o
|
|
|
11
11
|
## Inputs / request
|
|
12
12
|
|
|
13
13
|
```ts
|
|
14
|
-
import { createAzureOpenAIProviderPackage } from "@arnilo/prism-
|
|
14
|
+
import { createAzureOpenAIProviderPackage } from "@arnilo/prism-providers/azure";
|
|
15
15
|
|
|
16
16
|
createAzureOpenAIProviderPackage({
|
|
17
17
|
endpoint: "https://my-resource.openai.azure.com",
|
|
@@ -72,4 +72,4 @@ Register via `createExtensionKernel().load([createAzureOpenAIProviderPackage(...
|
|
|
72
72
|
- [Provider packages](../provider-packages.md)
|
|
73
73
|
- [Model routing](../model-routing.md)
|
|
74
74
|
- [Credential storage](../credential-storage.md)
|
|
75
|
-
- Package README: [`@arnilo/prism-
|
|
75
|
+
- Package README: [`@arnilo/prism-providers` family README](../../packages/prism-providers/README.md)
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
## What it does
|
|
4
4
|
|
|
5
|
-
`@arnilo/prism-
|
|
5
|
+
`@arnilo/prism-providers/bedrock` registers an Amazon Bedrock Runtime OpenAI-compatible Chat Completions provider. Hosts supply IAM/IRSA/assumed-role credentials; the package signs requests with SigV4 (no AWS SDK). Region and optional PrivateLink endpoint URLs are preserved.
|
|
6
6
|
|
|
7
7
|
## When to use it
|
|
8
8
|
|
|
@@ -11,7 +11,7 @@ Use it for enterprise Bedrock access under workload identity. Do not embed long-
|
|
|
11
11
|
## Inputs / request
|
|
12
12
|
|
|
13
13
|
```ts
|
|
14
|
-
import { createBedrockProviderPackage } from "@arnilo/prism-
|
|
14
|
+
import { createBedrockProviderPackage } from "@arnilo/prism-providers/bedrock";
|
|
15
15
|
|
|
16
16
|
createBedrockProviderPackage({
|
|
17
17
|
region: "eu-west-1",
|
|
@@ -71,4 +71,4 @@ Uses Bedrock’s OpenAI-compatible runtime route (not Converse eventstream). Hos
|
|
|
71
71
|
- [OpenAI-compatible provider](openai-compatible.md)
|
|
72
72
|
- [Model routing](../model-routing.md)
|
|
73
73
|
- [Provider packages](../provider-packages.md)
|
|
74
|
-
- Package README: [`@arnilo/prism-
|
|
74
|
+
- Package README: [`@arnilo/prism-providers` family README](../../packages/prism-providers/README.md)
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
## What it does
|
|
4
4
|
|
|
5
|
-
`@arnilo/prism-
|
|
5
|
+
`@arnilo/prism-providers/clinepass` provides explicit, side-effect-free setup for
|
|
6
6
|
the ClinePass OpenAI-compatible Chat Completions API at
|
|
7
7
|
`https://api.cline.bot/api/v1`. Requests always stream. Model ids are official
|
|
8
8
|
`cline-pass/…` slugs from a static featured catalog.
|
|
@@ -19,7 +19,7 @@ or caller-gated `GET /models` (no documented OpenAI models endpoint).
|
|
|
19
19
|
## Inputs / request
|
|
20
20
|
|
|
21
21
|
```ts
|
|
22
|
-
import { createClinePassProviderPackage } from "@arnilo/prism-
|
|
22
|
+
import { createClinePassProviderPackage } from "@arnilo/prism-providers/clinepass";
|
|
23
23
|
|
|
24
24
|
createClinePassProviderPackage(options: ClinePassProviderPackageOptions): ProviderPackage
|
|
25
25
|
```
|
|
@@ -74,7 +74,7 @@ Completion budget is `max_completion_tokens` (not `max_tokens`).
|
|
|
74
74
|
|
|
75
75
|
```ts
|
|
76
76
|
import { createExtensionKernel } from "@arnilo/prism";
|
|
77
|
-
import { createClinePassProviderPackage } from "@arnilo/prism-
|
|
77
|
+
import { createClinePassProviderPackage } from "@arnilo/prism-providers/clinepass";
|
|
78
78
|
|
|
79
79
|
const kernel = createExtensionKernel();
|
|
80
80
|
await kernel.load([createClinePassProviderPackage({ apiKey: "fake-cline-key" })]);
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
## What it does
|
|
4
4
|
|
|
5
|
-
`@arnilo/prism-
|
|
5
|
+
`@arnilo/prism-providers/deepseek` provides explicit, side-effect-free setup for the
|
|
6
6
|
DeepSeek Chat Completions API (`POST /chat/completions`) with official thinking
|
|
7
7
|
mode, reasoning-effort mapping, tool-turn `reasoning_content` replay, and
|
|
8
8
|
implicit prefix caching.
|
|
@@ -26,7 +26,7 @@ import {
|
|
|
26
26
|
createDeepSeekProviderPackage,
|
|
27
27
|
defineDeepSeekModel,
|
|
28
28
|
listDeepSeekModels,
|
|
29
|
-
} from "@arnilo/prism-
|
|
29
|
+
} from "@arnilo/prism-providers/deepseek";
|
|
30
30
|
|
|
31
31
|
createDeepSeekProviderPackage(options: DeepSeekProviderPackageOptions): ProviderPackage
|
|
32
32
|
defineDeepSeekModel(config: DeepSeekModelConfig): ModelConfig
|
|
@@ -84,7 +84,7 @@ Unsupported media blocks fail before fetch. Text-only input.
|
|
|
84
84
|
|
|
85
85
|
```ts
|
|
86
86
|
import { createExtensionKernel } from "@arnilo/prism";
|
|
87
|
-
import { createDeepSeekProviderPackage, listDeepSeekModels } from "@arnilo/prism-
|
|
87
|
+
import { createDeepSeekProviderPackage, listDeepSeekModels } from "@arnilo/prism-providers/deepseek";
|
|
88
88
|
|
|
89
89
|
const kernel = createExtensionKernel();
|
|
90
90
|
await kernel.load([createDeepSeekProviderPackage({ apiKey: "fake-deepseek-key" })]);
|
package/docs/providers/google.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
## What it does
|
|
4
4
|
|
|
5
|
-
`@arnilo/prism-
|
|
5
|
+
`@arnilo/prism-providers/google` is the first-party Gemini `generateContent` / `streamGenerateContent` provider for Prism (`POST /v1beta/models/{model}:streamGenerateContent?alt=sse`). Setup is side-effect-free: no network, env scan, or keychain lookup during import/setup. Uses native `fetch` + SSE — no `@google/genai` runtime dependency.
|
|
6
6
|
|
|
7
7
|
## When to use it
|
|
8
8
|
|
|
@@ -18,7 +18,7 @@ import {
|
|
|
18
18
|
createGoogleGenerateContentProvider,
|
|
19
19
|
listGoogleModels,
|
|
20
20
|
defineGoogleModel,
|
|
21
|
-
} from "@arnilo/prism-
|
|
21
|
+
} from "@arnilo/prism-providers/google";
|
|
22
22
|
|
|
23
23
|
createGoogleProviderPackage(options?: GoogleProviderPackageOptions): ProviderPackage
|
|
24
24
|
createGoogleGenerateContentProvider(options?): AIProvider
|
|
@@ -57,7 +57,7 @@ Featured offline aliases include `gemini-2.5-pro`, `gemini-2.5-flash`, `gemini-2
|
|
|
57
57
|
## Implementation example
|
|
58
58
|
|
|
59
59
|
```ts
|
|
60
|
-
import { createGoogleProviderPackage, listGoogleModels } from "@arnilo/prism-
|
|
60
|
+
import { createGoogleProviderPackage, listGoogleModels } from "@arnilo/prism-providers/google";
|
|
61
61
|
|
|
62
62
|
api.registerProviderPackage(createGoogleProviderPackage({ apiKey: hostKey }));
|
|
63
63
|
|
|
@@ -86,4 +86,4 @@ api.registerProviderPackage(createGoogleProviderPackage({ apiKey: hostKey, model
|
|
|
86
86
|
- [Provider packages](../provider-packages.md): package setup + discovery contract.
|
|
87
87
|
- [Thinking and reasoning](../thinking-and-reasoning.md): portable thinking helpers.
|
|
88
88
|
- [Provider conformance](../provider-conformance.md): network-free assertions.
|
|
89
|
-
- Package README: [
|
|
89
|
+
- Package README: [`@arnilo/prism-providers` family README](../../packages/prism-providers/README.md)
|
package/docs/providers/kimi.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
## What it does
|
|
4
4
|
|
|
5
|
-
`@arnilo/prism-
|
|
5
|
+
`@arnilo/prism-providers/kimi` provides two distinct, side-effect-free routes:
|
|
6
6
|
|
|
7
7
|
1. **Kimi For Coding** (default) — Anthropic-compatible `POST /messages` on
|
|
8
8
|
`https://api.kimi.com/coding` with `User-Agent: KimiCLI/1.5` (unless overridden).
|
|
@@ -33,7 +33,7 @@ import {
|
|
|
33
33
|
createKimiProviderPackage,
|
|
34
34
|
listKimiModels,
|
|
35
35
|
defineKimiModel,
|
|
36
|
-
} from "@arnilo/prism-
|
|
36
|
+
} from "@arnilo/prism-providers/kimi";
|
|
37
37
|
|
|
38
38
|
createKimiProviderPackage(options: KimiProviderPackageOptions): ProviderPackage
|
|
39
39
|
listKimiModels(options?: ListKimiModelsOptions): Promise<ModelConfig[]>
|
|
@@ -137,7 +137,7 @@ import { createExtensionKernel } from "@arnilo/prism";
|
|
|
137
137
|
import {
|
|
138
138
|
createKimiProviderPackage,
|
|
139
139
|
listKimiModels,
|
|
140
|
-
} from "@arnilo/prism-
|
|
140
|
+
} from "@arnilo/prism-providers/kimi";
|
|
141
141
|
|
|
142
142
|
const kernel = createExtensionKernel();
|
|
143
143
|
await kernel.load([
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
## What it does
|
|
4
4
|
|
|
5
|
-
`@arnilo/prism-
|
|
5
|
+
`@arnilo/prism-providers/neuralwatt` provides explicit, side-effect-free setup for the
|
|
6
6
|
NeuralWatt OpenAI-compatible Chat Completions provider using Prism's OpenAI-compatible
|
|
7
7
|
route with NeuralWatt-specific reasoning/template escape hatches, SSE comment tolerance,
|
|
8
8
|
and implicit prefix caching.
|
|
@@ -34,7 +34,7 @@ import {
|
|
|
34
34
|
neuralWattEventsWithTelemetry,
|
|
35
35
|
neuralWattModels,
|
|
36
36
|
parseNeuralWattComment,
|
|
37
|
-
} from "@arnilo/prism-
|
|
37
|
+
} from "@arnilo/prism-providers/neuralwatt";
|
|
38
38
|
|
|
39
39
|
createNeuralWattProviderPackage(options: NeuralWattProviderPackageOptions): ProviderPackage
|
|
40
40
|
defineNeuralWattModel(config: NeuralWattModelConfig): ModelConfig
|
|
@@ -123,7 +123,7 @@ Example request body (OpenAI-compatible Chat Completions shape):
|
|
|
123
123
|
|
|
124
124
|
```ts
|
|
125
125
|
import { createExtensionKernel } from "@arnilo/prism";
|
|
126
|
-
import { createNeuralWattProviderPackage } from "@arnilo/prism-
|
|
126
|
+
import { createNeuralWattProviderPackage } from "@arnilo/prism-providers/neuralwatt";
|
|
127
127
|
|
|
128
128
|
const kernel = createExtensionKernel();
|
|
129
129
|
await kernel.load([createNeuralWattProviderPackage({ apiKey: "fake-neuralwatt-key" })]);
|
|
@@ -132,7 +132,7 @@ await kernel.load([createNeuralWattProviderPackage({ apiKey: "fake-neuralwatt-ke
|
|
|
132
132
|
Override the provider id and models:
|
|
133
133
|
|
|
134
134
|
```ts
|
|
135
|
-
import { createNeuralWattProviderPackage, defineNeuralWattModel, neuralWattModels } from "@arnilo/prism-
|
|
135
|
+
import { createNeuralWattProviderPackage, defineNeuralWattModel, neuralWattModels } from "@arnilo/prism-providers/neuralwatt";
|
|
136
136
|
|
|
137
137
|
await kernel.load([
|
|
138
138
|
createNeuralWattProviderPackage({ id: "neuralwatt", apiKey: "fake", models: neuralWattModels }),
|
|
@@ -142,7 +142,7 @@ await kernel.load([
|
|
|
142
142
|
Explicit catalog discovery:
|
|
143
143
|
|
|
144
144
|
```ts
|
|
145
|
-
import { listNeuralWattModels } from "@arnilo/prism-
|
|
145
|
+
import { listNeuralWattModels } from "@arnilo/prism-providers/neuralwatt";
|
|
146
146
|
|
|
147
147
|
const models = await listNeuralWattModels({ apiKey: "fake-neuralwatt-key", fetch });
|
|
148
148
|
await kernel.load([createNeuralWattProviderPackage({ apiKey: "fake", models })]);
|
|
@@ -154,7 +154,7 @@ setup and `generate()` never call model discovery implicitly.
|
|
|
154
154
|
Account quota:
|
|
155
155
|
|
|
156
156
|
```ts
|
|
157
|
-
import { getNeuralWattQuota } from "@arnilo/prism-
|
|
157
|
+
import { getNeuralWattQuota } from "@arnilo/prism-providers/neuralwatt";
|
|
158
158
|
|
|
159
159
|
const quota = await getNeuralWattQuota({ apiKey: "fake-neuralwatt-key", fetch });
|
|
160
160
|
console.log(quota.usage?.current_month?.energy_kwh, quota.balance?.balance_usd);
|
|
@@ -322,7 +322,7 @@ optional and tolerated when absent; malformed comments yield no telemetry event
|
|
|
322
322
|
and never crash the stream.
|
|
323
323
|
|
|
324
324
|
```ts
|
|
325
|
-
import { neuralWattEventsWithTelemetry } from "@arnilo/prism-
|
|
325
|
+
import { neuralWattEventsWithTelemetry } from "@arnilo/prism-providers/neuralwatt";
|
|
326
326
|
|
|
327
327
|
for await (const event of neuralWattEventsWithTelemetry(response.body)) {
|
|
328
328
|
if (event.type === "neuralwatt:telemetry") {
|
|
@@ -354,7 +354,7 @@ provider. Classification is O(1) over status/headers/body and makes no extra
|
|
|
354
354
|
provider calls.
|
|
355
355
|
|
|
356
356
|
```ts
|
|
357
|
-
import { classifyNeuralWattError } from "@arnilo/prism-
|
|
357
|
+
import { classifyNeuralWattError } from "@arnilo/prism-providers/neuralwatt";
|
|
358
358
|
|
|
359
359
|
const decision = classifyNeuralWattError({ status: 429, headers: { "retry-after": "1" }, body: { error: { code: "concurrent_budget_exceeded", retry_after: 1 } } });
|
|
360
360
|
// { retryable: true, code: 429, retryAfterMs: 1000, errorCode: "concurrent_budget_exceeded", strategy: undefined }
|
package/docs/providers/ollama.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
## What it does
|
|
4
4
|
|
|
5
|
-
`@arnilo/prism-
|
|
5
|
+
`@arnilo/prism-providers/ollama` is a side-effect-free adapter for Ollama — both
|
|
6
6
|
**Ollama Cloud** (`https://ollama.com`) and a **local** `ollama serve`
|
|
7
7
|
(`http://localhost:11434`) — over the OpenAI-compatible
|
|
8
8
|
`POST {base}/chat/completions` endpoint.
|
|
@@ -38,7 +38,7 @@ import {
|
|
|
38
38
|
listOllamaModels,
|
|
39
39
|
defineOllamaModel,
|
|
40
40
|
ollamaBaseUrl,
|
|
41
|
-
} from "@arnilo/prism-
|
|
41
|
+
} from "@arnilo/prism-providers/ollama";
|
|
42
42
|
|
|
43
43
|
createOllamaProviderPackage(options: OllamaProviderPackageOptions): ProviderPackage
|
|
44
44
|
createOllamaProvider(options?: OllamaProviderOptions): AIProvider
|
|
@@ -106,7 +106,7 @@ import { createExtensionKernel } from "@arnilo/prism";
|
|
|
106
106
|
import {
|
|
107
107
|
createOllamaProviderPackage,
|
|
108
108
|
listOllamaModels,
|
|
109
|
-
} from "@arnilo/prism-
|
|
109
|
+
} from "@arnilo/prism-providers/ollama";
|
|
110
110
|
|
|
111
111
|
const kernel = createExtensionKernel();
|
|
112
112
|
|
|
@@ -137,7 +137,7 @@ const provider = createOpenAICompatibleProvider({
|
|
|
137
137
|
});
|
|
138
138
|
```
|
|
139
139
|
|
|
140
|
-
- Cache behavior is intentionally minimal: this Chat Completions adapter sends no `prompt_cache_key`, `prompt_cache_retention`, or `cache_control` fields. Endpoints that cache implicitly do so automatically; hosts needing OpenAI `prompt_cache_key`/`prompt_cache_retention` should use the [`@arnilo/prism-
|
|
140
|
+
- Cache behavior is intentionally minimal: this Chat Completions adapter sends no `prompt_cache_key`, `prompt_cache_retention`, or `cache_control` fields. Endpoints that cache implicitly do so automatically; hosts needing OpenAI `prompt_cache_key`/`prompt_cache_retention` should use the [`@arnilo/prism-providers/openai`](openai.md) Responses package. The adapter still normalizes cache usage from `prompt_tokens_details.cached_tokens` (and `prompt_cache_hit_tokens`) into `Usage.cacheReadTokens`.
|
|
141
141
|
|
|
142
142
|
## Security and performance notes
|
|
143
143
|
|
package/docs/providers/openai.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
## What it does
|
|
4
4
|
|
|
5
|
-
`@arnilo/prism-
|
|
5
|
+
`@arnilo/prism-providers/openai` provides explicit, side-effect-free setup for the OpenAI
|
|
6
6
|
Responses API (`createOpenAIResponsesProvider`) and OpenAI Codex
|
|
7
7
|
subscription Responses (`createOpenAICodexProvider`), plus a Codex OAuth provider
|
|
8
8
|
implementing RFC 7636 PKCE browser/device-code login.
|
|
@@ -24,7 +24,7 @@ credential discovery, or real-network tests.
|
|
|
24
24
|
## Inputs / request
|
|
25
25
|
|
|
26
26
|
```ts
|
|
27
|
-
import { createOpenAIProviderPackage } from "@arnilo/prism-
|
|
27
|
+
import { createOpenAIProviderPackage } from "@arnilo/prism-providers/openai";
|
|
28
28
|
|
|
29
29
|
createOpenAIProviderPackage(options: OpenAIProviderPackageOptions): ProviderPackage
|
|
30
30
|
```
|
|
@@ -81,7 +81,7 @@ Responses request body (Codex subscription shape, abbreviated):
|
|
|
81
81
|
Realtime session (OpenAI session creation, abbreviated):
|
|
82
82
|
|
|
83
83
|
```ts
|
|
84
|
-
import { createOpenAIRealtimeSession } from "@arnilo/prism-
|
|
84
|
+
import { createOpenAIRealtimeSession } from "@arnilo/prism-providers/openai";
|
|
85
85
|
|
|
86
86
|
const session = createOpenAIRealtimeSession({
|
|
87
87
|
model: { provider: "openai", model: "gpt-realtime-2.1" },
|
|
@@ -103,7 +103,7 @@ https://auth.openai.com/authorize?response_type=code&client_id=...&code_challeng
|
|
|
103
103
|
|
|
104
104
|
```ts
|
|
105
105
|
import { createExtensionKernel, createEnvCredentialResolver } from "@arnilo/prism";
|
|
106
|
-
import { createOpenAIProviderPackage, listOpenAIModels } from "@arnilo/prism-
|
|
106
|
+
import { createOpenAIProviderPackage, listOpenAIModels } from "@arnilo/prism-providers/openai";
|
|
107
107
|
|
|
108
108
|
const apiKey = createEnvCredentialResolver({ OPENAI_API_KEY: "fake" }, { openai: "OPENAI_API_KEY" });
|
|
109
109
|
const models = await listOpenAIModels({ apiKey }); // caller-gated; never runs during setup
|
|
@@ -116,7 +116,7 @@ await kernel.load([
|
|
|
116
116
|
OAuth login (caller-supplied callbacks, mocked in tests):
|
|
117
117
|
|
|
118
118
|
```ts
|
|
119
|
-
import { createOpenAICodexOAuthProvider, createPkceVerifier, computeS256Challenge } from "@arnilo/prism-
|
|
119
|
+
import { createOpenAICodexOAuthProvider, createPkceVerifier, computeS256Challenge } from "@arnilo/prism-providers/openai";
|
|
120
120
|
|
|
121
121
|
const oauth = createOpenAICodexOAuthProvider({
|
|
122
122
|
redirectUri: "http://localhost:1455/auth/callback",
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
## What it does
|
|
4
4
|
|
|
5
|
-
`@arnilo/prism-
|
|
5
|
+
`@arnilo/prism-providers/opencode-go` provides explicit, side-effect-free setup for
|
|
6
6
|
[OpenCode Go](https://opencode.ai/docs/go/) — a low-cost subscription gateway for
|
|
7
7
|
open coding models. The package dual-routes by `ModelConfig.compat.route`:
|
|
8
8
|
|
|
@@ -36,7 +36,7 @@ real-network tests.
|
|
|
36
36
|
import {
|
|
37
37
|
createOpenCodeGoProviderPackage,
|
|
38
38
|
listOpenCodeGoModels,
|
|
39
|
-
} from "@arnilo/prism-
|
|
39
|
+
} from "@arnilo/prism-providers/opencode-go";
|
|
40
40
|
|
|
41
41
|
createOpenCodeGoProviderPackage(options: OpenCodeGoProviderPackageOptions): ProviderPackage
|
|
42
42
|
```
|
|
@@ -106,7 +106,7 @@ import {
|
|
|
106
106
|
createOpenCodeGoProviderPackage,
|
|
107
107
|
listOpenCodeGoModels,
|
|
108
108
|
openCodeGoModels,
|
|
109
|
-
} from "@arnilo/prism-
|
|
109
|
+
} from "@arnilo/prism-providers/opencode-go";
|
|
110
110
|
|
|
111
111
|
const kernel = createExtensionKernel();
|
|
112
112
|
await kernel.load([createOpenCodeGoProviderPackage({ apiKey: process.env.OPENCODE_API_KEY })]);
|
|
@@ -154,7 +154,7 @@ credential-gated probe:
|
|
|
154
154
|
|
|
155
155
|
```sh
|
|
156
156
|
PRISM_LIVE_PROVIDER_TESTS=1 OPENCODE_API_KEY=... \
|
|
157
|
-
npm run test --workspace=@arnilo/prism-
|
|
157
|
+
npm run test --workspace=@arnilo/prism-providers/opencode-go
|
|
158
158
|
```
|
|
159
159
|
|
|
160
160
|
`live_json_schema_structured_output_succeeds_<model>` must pass for a model
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
## What it does
|
|
4
4
|
|
|
5
|
-
`@arnilo/prism-
|
|
5
|
+
`@arnilo/prism-providers/openrouter` provides explicit, side-effect-free setup for the
|
|
6
6
|
OpenRouter API-key provider with **app-controlled** model registration, routing
|
|
7
7
|
passthrough, official `reasoning` controls, and Anthropic-style `cache_control`
|
|
8
8
|
(plus sticky `session_id` routing).
|
|
@@ -29,7 +29,7 @@ import {
|
|
|
29
29
|
createOpenRouterProviderPackage,
|
|
30
30
|
defineOpenRouterModel,
|
|
31
31
|
listOpenRouterModels,
|
|
32
|
-
} from "@arnilo/prism-
|
|
32
|
+
} from "@arnilo/prism-providers/openrouter";
|
|
33
33
|
|
|
34
34
|
createOpenRouterProviderPackage(options: OpenRouterProviderPackageOptions): ProviderPackage
|
|
35
35
|
defineOpenRouterModel(config: OpenRouterModelConfig): ModelConfig
|
|
@@ -83,7 +83,7 @@ import {
|
|
|
83
83
|
createOpenRouterProviderPackage,
|
|
84
84
|
defineOpenRouterModel,
|
|
85
85
|
listOpenRouterModels,
|
|
86
|
-
} from "@arnilo/prism-
|
|
86
|
+
} from "@arnilo/prism-providers/openrouter";
|
|
87
87
|
|
|
88
88
|
// App-controlled registration (default — no fetch):
|
|
89
89
|
const sonnet = defineOpenRouterModel({
|
package/docs/providers/vertex.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
## What it does
|
|
4
4
|
|
|
5
|
-
`@arnilo/prism-
|
|
5
|
+
`@arnilo/prism-providers/vertex` registers a Vertex AI OpenAPI-compatible Chat Completions provider authenticated with host ADC / workload identity tokens. It is intentionally separate from `@arnilo/prism-providers/google` (consumer Gemini API keys).
|
|
6
6
|
|
|
7
7
|
## When to use it
|
|
8
8
|
|
|
@@ -11,7 +11,7 @@ Use it for GCP enterprise Vertex deployments with Application Default Credential
|
|
|
11
11
|
## Inputs / request
|
|
12
12
|
|
|
13
13
|
```ts
|
|
14
|
-
import { createVertexProviderPackage } from "@arnilo/prism-
|
|
14
|
+
import { createVertexProviderPackage } from "@arnilo/prism-providers/vertex";
|
|
15
15
|
|
|
16
16
|
createVertexProviderPackage({
|
|
17
17
|
projectId: "my-gcp-project",
|
|
@@ -53,14 +53,14 @@ const provider = createVertexProvider({
|
|
|
53
53
|
|
|
54
54
|
## Extension and configuration notes
|
|
55
55
|
|
|
56
|
-
`@arnilo/prism-
|
|
56
|
+
`@arnilo/prism-providers/google` remains API-key Gemini (`generativelanguage.googleapis.com`) and must not register Vertex OAuth/ADC. Load this package explicitly for Vertex.
|
|
57
57
|
|
|
58
58
|
## Security and performance notes
|
|
59
59
|
|
|
60
60
|
- No Google Cloud SDK dependency in the package.
|
|
61
61
|
- Custom/private endpoint hosts are preserved.
|
|
62
62
|
- Tokens redacted from errors; no import-time credential prefetch — the credential is resolved exactly once per request (a rotating `CredentialValueSource` is never consumed twice; the same resolved token drives the wrapper check and the inner auth header).
|
|
63
|
-
- Conformance-proven (Task 6): package `setup()` performs zero fetch and zero credential resolution; an already-aborted signal fails fast; a truncated SSE stream (no `data: [DONE]`) ends in an `error` event; native Vertex cached-content lifecycle is intentionally unsupported on the OpenAI-compatible route — no cache wire fields are emitted even when the request carries Prism cache hints (use `@arnilo/prism-
|
|
63
|
+
- Conformance-proven (Task 6): package `setup()` performs zero fetch and zero credential resolution; an already-aborted signal fails fast; a truncated SSE stream (no `data: [DONE]`) ends in an `error` event; native Vertex cached-content lifecycle is intentionally unsupported on the OpenAI-compatible route — no cache wire fields are emitted even when the request carries Prism cache hints (use `@arnilo/prism-providers/google`'s `extra.cachedContent` on that package, or manage cache resources host-side).
|
|
64
64
|
- Pair with model-router residency allow-lists on `location`.
|
|
65
65
|
|
|
66
66
|
## Related APIs
|
|
@@ -69,4 +69,4 @@ const provider = createVertexProvider({
|
|
|
69
69
|
- [OpenAI-compatible provider](openai-compatible.md)
|
|
70
70
|
- [Provider packages](../provider-packages.md)
|
|
71
71
|
- [Model routing](../model-routing.md)
|
|
72
|
-
- Package README: [`@arnilo/prism-
|
|
72
|
+
- Package README: [`@arnilo/prism-providers` family README](../../packages/prism-providers/README.md)
|
package/docs/providers/xai.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
## What it does
|
|
4
4
|
|
|
5
|
-
`@arnilo/prism-
|
|
5
|
+
`@arnilo/prism-providers/xai` provides explicit, side-effect-free setup for the
|
|
6
6
|
xAI Grok Chat Completions API (`POST https://api.x.ai/v1/chat/completions`)
|
|
7
7
|
with implicit prefix caching via a sanitized `x-grok-conv-id` header, reasoning
|
|
8
8
|
replay, and host-invoked SuperGrok / X Premium OAuth.
|
|
@@ -25,7 +25,7 @@ import {
|
|
|
25
25
|
createXaiOAuthProvider,
|
|
26
26
|
createXaiProviderPackage,
|
|
27
27
|
listXaiModels,
|
|
28
|
-
} from "@arnilo/prism-
|
|
28
|
+
} from "@arnilo/prism-providers/xai";
|
|
29
29
|
|
|
30
30
|
createXaiProviderPackage(options: XaiProviderPackageOptions): ProviderPackage
|
|
31
31
|
createXaiOAuthProvider(options?: XaiOAuthOptions): OAuthProvider
|
|
@@ -84,7 +84,7 @@ Header: `x-grok-conv-id: sess-1`.
|
|
|
84
84
|
|
|
85
85
|
```ts
|
|
86
86
|
import { createExtensionKernel, refreshOAuthCredential } from "@arnilo/prism";
|
|
87
|
-
import { createXaiOAuthProvider, createXaiProviderPackage } from "@arnilo/prism-
|
|
87
|
+
import { createXaiOAuthProvider, createXaiProviderPackage } from "@arnilo/prism-providers/xai";
|
|
88
88
|
|
|
89
89
|
const kernel = createExtensionKernel();
|
|
90
90
|
await kernel.load([createXaiProviderPackage({ apiKey: "fake-xai-key" })]);
|
package/docs/providers/zai.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
## What it does
|
|
4
4
|
|
|
5
|
-
`@arnilo/prism-
|
|
5
|
+
`@arnilo/prism-providers/zai` provides explicit, side-effect-free setup for the Z.AI
|
|
6
6
|
GLM Chat Completions API (`POST /chat/completions`) with official deep-thinking,
|
|
7
7
|
reasoning-effort, and tool-stream request fields.
|
|
8
8
|
|
|
@@ -25,7 +25,7 @@ import {
|
|
|
25
25
|
createZaiProviderPackage,
|
|
26
26
|
defineZaiModel,
|
|
27
27
|
listZaiModels,
|
|
28
|
-
} from "@arnilo/prism-
|
|
28
|
+
} from "@arnilo/prism-providers/zai";
|
|
29
29
|
|
|
30
30
|
createZaiProviderPackage(options: ZaiProviderPackageOptions): ProviderPackage
|
|
31
31
|
defineZaiModel(config: ZaiModelConfig): ModelConfig
|
|
@@ -87,7 +87,7 @@ Example request body (official Chat Completions shape):
|
|
|
87
87
|
|
|
88
88
|
```ts
|
|
89
89
|
import { createExtensionKernel } from "@arnilo/prism";
|
|
90
|
-
import { createZaiProviderPackage, listZaiModels } from "@arnilo/prism-
|
|
90
|
+
import { createZaiProviderPackage, listZaiModels } from "@arnilo/prism-providers/zai";
|
|
91
91
|
|
|
92
92
|
const kernel = createExtensionKernel();
|
|
93
93
|
await kernel.load([createZaiProviderPackage({ apiKey: "fake-zai-key" })]);
|
package/docs/public-contracts.md
CHANGED
|
@@ -10,7 +10,7 @@ Current contract groups:
|
|
|
10
10
|
- Content/messages: `ContentBlock`, `TextContent`, `ImageContent`, `ThinkingContent`, `ToolCallDeltaContent`, `ToolCallContent`, `ToolResultContent`, `Message`
|
|
11
11
|
- Providers/models/auth: `ModelConfig`, `ModelCapabilities`, `ModelLimits`, `ModelCost`, `ModelCacheCapabilities`, `PromptCacheKind`, `Usage`, `CacheRetention`, `PromptCacheMode`, `PromptCacheBreakpoint`, `PromptCacheHints`, `ProviderRequestOptions`, `ProviderRequest`, `ProviderEvent`, `AIProvider`, `ProviderPackage`, `ProviderPackageAPI`, `ProviderPackageDocs`, `AuthMethod`, `ApiKeyAuthMethod`, `OAuthAuthMethod`, `CustomAuthMethod`, `OAuthLoginCallbacks`, `OAuthCredentials`, `OAuthProvider`, `CredentialResolverSource`, `OAuthCredentialStore`, `ProviderRequestPolicy`, `ProviderRequestPolicyContext`, `ProviderRequestPolicyResult`, `SystemPromptContribution`, `SystemPromptMode`, `SystemPromptSource`, `SystemPromptConfig`
|
|
12
12
|
- Agents/sessions: `AgentConfig`, `AgentDefinition`, `Agent`, `AgentSessionConfig`, `AgentSessionForkOptions`, `AgentSessionCloneOptions`, `AgentSession`, `SubscribeOptions`, `SubscriberOverflowPolicy`, `RunOptions`, `AgentEvent`
|
|
13
|
-
- Tools/commands: `ToolDefinition`, `ToolRegistry`, `ToolExecutionContext`, `ToolResult`, `CommandDefinition`, `CommandExecutionContext`, `CommandResult`
|
|
13
|
+
- Tools/commands: `ToolDefinition`, `ToolRegistry`, `ToolExecutionContext`, `ToolResult`, `CommandDefinition`, `CommandExecutionContext`, `CommandDrivers`, `CommandWorkflowRun`, `CommandResult`
|
|
14
14
|
- Input/prompt/context/skills: `InputBuilder`, `InputBuildContext`, `AgentInput`, `DefaultInputBuilder`, `DefaultInputBuildContext`, `InputAttachment`, `PromptInstruction`, `PromptBuilder`, `PromptBuildRequest`, `ContextBlock`, `ContextProvider`, `ContextResolutionContext`, `Skill`, `SkillRegistry`
|
|
15
15
|
- Extensions/middleware: `ExtensionLifecycleEventName`, `ExtensionEvent`, `Extension`, `ExtensionAPI`, `MiddlewareHookName`, `Middleware`, `MiddlewareNext`, `MiddlewareRegistry`
|
|
16
16
|
- Configuration/manifests: `ConfigProvider`, `ConfigLayer`, `ConfigLoadContext`, `PrismManifest`, `ManifestContributionDeclaration`, `ManifestResourceDeclaration`, `ManifestContributionKind`
|
package/docs/rag.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
## What it does
|
|
4
4
|
|
|
5
|
-
`@arnilo/prism-rag` is an optional
|
|
5
|
+
The `@arnilo/prism-memory/rag` subpath is an optional surface for deterministic text/Markdown chunking (with ATX heading-stack metadata), bounded embedding/vector indexing with embedder-identity drift guards, atomic scoped source replacement/deletion with content-hash skip and generation visibility, hybrid vector+lexical retrieval with reciprocal-rank fusion (one embed / one RRF / one rerank across one or many exact scopes), focused text/Markdown/HTML/PDF parsing, bounded reranking (host seam plus a TEI REST adapter), ingestion status, attributable citations, content-trust metadata, and explicit `ContextProvider` injection. It reuses `Embedder` and `VectorStore` from the memory root entry; Prism core input assembly is unchanged.
|
|
6
6
|
|
|
7
7
|
## When to use it
|
|
8
8
|
|
|
@@ -27,7 +27,7 @@ Document lifecycle:
|
|
|
27
27
|
| `replaceSource({ sourceId, chunks, store, scope, ... })` | Atomically replaces one source after all bounded embedding succeeds; the store must implement scoped `getBySource()` and `transaction()`. |
|
|
28
28
|
| `deleteSource({ sourceId, store, scope })` | Deletes only matching IDs under exact tenant/resource/corpus scope. |
|
|
29
29
|
| `replaceDocument({ uri, loader, parser, store, scope, ... })` | Loads through a host seam, parses, chunks, and atomically replaces. `sourceId` is required unless loader supplies one. |
|
|
30
|
-
| `DocumentLoader` / `Parser` | Small host-replaceable seams.
|
|
30
|
+
| `DocumentLoader` / `Parser` | Small host-replaceable seams. `@arnilo/prism-memory/rag/loaders` and `/rag/parsers` export reference adapters. |
|
|
31
31
|
| `textParser` / `markdownParser` / `htmlParser` / `pdfParser` | UTF-8 text, Markdown, script/style-stripping HTML, and uncompressed-text PDF parsers. |
|
|
32
32
|
|
|
33
33
|
Index/retrieve:
|
|
@@ -84,7 +84,7 @@ Default/hard ceilings include 1,000/16,384 chunk characters, 100/4,096 overlap,
|
|
|
84
84
|
```ts
|
|
85
85
|
import { createAgent, createMockProvider, providerDone, providerTextDelta } from "@arnilo/prism";
|
|
86
86
|
import { createHashEmbedder, createMemoryVectorStore } from "@arnilo/prism-memory";
|
|
87
|
-
import { chunkMarkdown, createMemoryIngestionStatusStore, createRagContextProvider, indexChunks, listIngestionStatus, retrieveContext } from "@arnilo/prism-rag";
|
|
87
|
+
import { chunkMarkdown, createMemoryIngestionStatusStore, createRagContextProvider, indexChunks, listIngestionStatus, retrieveContext } from "@arnilo/prism-memory/rag";
|
|
88
88
|
|
|
89
89
|
const embedder = createHashEmbedder(); // deterministic demo/test helper, not production semantic quality
|
|
90
90
|
const store = createMemoryVectorStore();
|
|
@@ -118,7 +118,7 @@ console.log(found.text, await agent.createSession().run("How do approvals work?"
|
|
|
118
118
|
Content-hash skip and hash validation:
|
|
119
119
|
|
|
120
120
|
```ts
|
|
121
|
-
import { isValidContentHash } from "@arnilo/prism-rag";
|
|
121
|
+
import { isValidContentHash } from "@arnilo/prism-memory/rag";
|
|
122
122
|
|
|
123
123
|
const digest = "ab12..."; // host-computed SHA-256 hex of the document
|
|
124
124
|
if (!isValidContentHash(digest)) throw new Error("invalid digest");
|
|
@@ -129,7 +129,7 @@ Hybrid retrieval, TEI reranking, and telemetry:
|
|
|
129
129
|
|
|
130
130
|
```ts
|
|
131
131
|
import { createRagTelemetry } from "@arnilo/prism-observability-opentelemetry";
|
|
132
|
-
import { createTeiReranker } from "@arnilo/prism-rag";
|
|
132
|
+
import { createTeiReranker } from "@arnilo/prism-memory/rag";
|
|
133
133
|
|
|
134
134
|
const telemetry = createRagTelemetry({ tracer, meter }); // @opentelemetry/api instruments
|
|
135
135
|
const org = { tenantId: "t1", resourceId: "docs", corpusId: "org" };
|