@arnilo/prism 0.3.2 → 0.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +50 -1
- package/README.md +42 -62
- package/dist/agent-run-lifecycle.js +4 -0
- package/dist/agent-run-state.d.ts +5 -2
- package/dist/agent-run-state.js +18 -8
- package/dist/agent-session/session/assemble.d.ts +6 -0
- package/dist/agent-session/session/assemble.js +391 -0
- package/dist/agent-session/session/persist.d.ts +28 -0
- package/dist/agent-session/session/persist.js +166 -0
- package/dist/agent-session/session/provider-round.d.ts +6 -0
- package/dist/agent-session/session/provider-round.js +231 -0
- package/dist/agent-session/session/tool-round.d.ts +31 -0
- package/dist/agent-session/session/tool-round.js +473 -0
- package/dist/agent-session/session/types.d.ts +115 -0
- package/dist/agent-session/session/types.js +5 -0
- package/dist/agent-session/session.d.ts +54 -41
- package/dist/agent-session/session.js +23 -1132
- package/dist/capture.d.ts +63 -0
- package/dist/capture.js +67 -0
- package/dist/cli-dev.d.ts +29 -0
- package/dist/cli-dev.js +52 -0
- package/dist/cli-init.d.ts +34 -3
- package/dist/cli-init.js +192 -24
- package/dist/cli-runner.d.ts +6 -2
- package/dist/cli-runner.js +57 -10
- package/dist/content.d.ts +3 -3
- package/dist/content.js +3 -1
- package/dist/contracts-core/agent.d.ts +8 -0
- package/dist/contracts-core/batch.d.ts +97 -0
- package/dist/contracts-core/batch.js +65 -0
- package/dist/contracts-core/content.d.ts +72 -1
- package/dist/contracts-core/embeddings.d.ts +30 -0
- package/dist/contracts-core/embeddings.js +17 -0
- package/dist/contracts-core/images.d.ts +60 -0
- package/dist/contracts-core/images.js +17 -0
- package/dist/contracts-core/moderation.d.ts +46 -0
- package/dist/contracts-core/moderation.js +34 -0
- package/dist/contracts-core/speech.d.ts +39 -0
- package/dist/contracts-core/speech.js +17 -0
- package/dist/contracts-core/transcription.d.ts +48 -0
- package/dist/contracts-core/transcription.js +17 -0
- package/dist/contracts-core/video.d.ts +61 -0
- package/dist/contracts-core/video.js +17 -0
- package/dist/contracts-core.d.ts +7 -0
- package/dist/contracts-core.js +7 -0
- package/dist/contracts-protocol.d.ts +18 -0
- package/dist/contracts-run-state.d.ts +1 -2
- package/dist/index.d.ts +7 -3
- package/dist/index.js +5 -3
- package/dist/input.d.ts +8 -0
- package/dist/input.js +4 -0
- package/dist/node/agent-definitions.d.ts +1 -8
- package/dist/node/agent-definitions.js +0 -34
- package/dist/node/settings.d.ts +0 -1
- package/dist/node/settings.js +0 -5
- package/dist/pinned-fetch.js +29 -3
- package/dist/provider-events.js +3 -4
- package/dist/providers/media.d.ts +1 -2
- package/dist/providers/media.js +1 -4
- package/dist/rpc.d.ts +1 -1
- package/dist/rpc.js +4 -4
- package/dist/testing/persistence-schema.d.ts +1 -1
- package/dist/testing/persistence-schema.js +32 -28
- package/dist/testing/provider-conformance.d.ts +114 -5
- package/dist/testing/provider-conformance.js +342 -0
- package/dist/testing/tool-conformance.d.ts +25 -0
- package/dist/testing/tool-conformance.js +128 -1
- package/dist/testing/tool-effect-store-conformance.d.ts +0 -1
- package/dist/testing/tool-effect-store-conformance.js +0 -3
- package/dist/thinking.d.ts +48 -9
- package/dist/thinking.js +134 -8
- package/dist/tool-search.d.ts +76 -0
- package/dist/tool-search.js +199 -0
- package/docs/0.1.0-readiness.md +3 -3
- package/docs/a2a.md +2 -2
- package/docs/acp-agent.md +1 -1
- package/docs/acp.md +3 -3
- package/docs/ag-ui-adoption.md +1 -1
- package/docs/ag-ui.md +1 -2
- package/docs/agent-definitions.md +1 -1
- package/docs/agent-events.md +5 -5
- package/docs/agent-identity.md +13 -2
- package/docs/audit-export.md +3 -3
- package/docs/batch-jobs.md +120 -0
- package/docs/browser-automation.md +5 -5
- package/docs/caveman.md +2 -2
- package/docs/cli-rpc.md +43 -9
- package/docs/coding-agent-tools.md +19 -19
- package/docs/coding-review-and-diagnostics.md +2 -2
- package/docs/coding-security.md +5 -5
- package/docs/coding-tools.md +82 -0
- package/docs/coding-workspaces.md +2 -2
- package/docs/compaction-and-retry.md +2 -2
- package/docs/compaction-llm.md +4 -4
- package/docs/compaction-observational-memory.md +3 -3
- package/docs/computer-use-linux.md +13 -2
- package/docs/context-and-skills.md +3 -1
- package/docs/conversations.md +4 -4
- package/docs/core.md +85 -0
- package/docs/credential-storage.md +12 -8
- package/docs/credentials-and-redaction.md +1 -1
- package/docs/data-classification.md +1 -1
- package/docs/database-persistence.md +7 -3
- package/docs/dev-inspector.md +103 -0
- package/docs/device-adapters.md +2 -2
- package/docs/diagrams.md +247 -0
- package/docs/document-reader.md +6 -6
- package/docs/documents.md +214 -0
- package/docs/embeddings.md +112 -0
- package/docs/enterprise-postgres-state.md +7 -7
- package/docs/evaluations.md +41 -7
- package/docs/extensions.md +3 -3
- package/docs/forge-integration.md +3 -3
- package/docs/graft.md +5 -5
- package/docs/guardrails.md +2 -2
- package/docs/host-security.md +16 -15
- package/docs/image-generation.md +129 -0
- package/docs/impeccable.md +7 -5
- package/docs/index.md +84 -46
- package/docs/indexed-code-search.md +2 -2
- package/docs/language-intelligence.md +4 -4
- package/docs/live-testing.md +126 -0
- package/docs/mcp-tools.md +44 -13
- package/docs/middleware-hooks.md +1 -1
- package/docs/migrate-to-0.4.md +312 -0
- package/docs/migrate-to-0.5.md +122 -0
- package/docs/migration.md +51 -1
- package/docs/model-registry.md +38 -0
- package/docs/model-routing.md +6 -6
- package/docs/moderation.md +117 -0
- package/docs/multi-agent-patterns.md +177 -0
- package/docs/multimodal-content.md +27 -3
- package/docs/obscura.md +12 -12
- package/docs/observability.md +32 -7
- package/docs/openapi-tools.md +14 -4
- package/docs/operations.md +11 -0
- package/docs/performance.md +30 -10
- package/docs/persistence-credentials-multimodality-primitives.md +7 -7
- package/docs/policy-and-audit.md +18 -8
- package/docs/ponytail.md +3 -3
- package/docs/postgres-persistence.md +5 -5
- package/docs/process-sessions.md +2 -2
- package/docs/prompt-registry.md +106 -0
- package/docs/provider-caching.md +36 -32
- package/docs/provider-conformance.md +24 -2
- package/docs/provider-packages.md +58 -22
- package/docs/provider-primitives.md +5 -5
- package/docs/provider-request-policies.md +1 -1
- package/docs/providers/ai-sdk.md +18 -6
- package/docs/providers/alibaba.md +10 -6
- package/docs/providers/anthropic.md +10 -6
- package/docs/providers/azure.md +20 -4
- package/docs/providers/bedrock.md +18 -3
- package/docs/providers/clinepass.md +7 -3
- package/docs/providers/commandcode.md +253 -0
- package/docs/providers/deepseek.md +7 -3
- package/docs/providers/google.md +8 -4
- package/docs/providers/hyper.md +284 -0
- package/docs/providers/kimi.md +7 -3
- package/docs/providers/neuralwatt.md +12 -8
- package/docs/providers/ollama.md +18 -3
- package/docs/providers/openai-compatible.md +5 -1
- package/docs/providers/openai.md +9 -5
- package/docs/providers/opencode-go.md +8 -4
- package/docs/providers/openrouter.md +8 -4
- package/docs/providers/vertex.md +21 -5
- package/docs/providers/xai.md +7 -3
- package/docs/providers/zai.md +7 -3
- package/docs/rag.md +31 -9
- package/docs/release-and-install.md +181 -76
- package/docs/resource-loading.md +1 -1
- package/docs/runs-and-usage.md +28 -3
- package/docs/server.md +94 -5
- package/docs/settings-auth-trust-security.md +7 -5
- package/docs/sheets.md +229 -0
- package/docs/speech.md +126 -0
- package/docs/sqlite-persistence.md +4 -4
- package/docs/supervisors.md +4 -3
- package/docs/thinking-and-reasoning.md +93 -60
- package/docs/tool-conformance.md +28 -3
- package/docs/tool-execution-primitives.md +8 -8
- package/docs/tools.md +32 -5
- package/docs/web-tools.md +3 -3
- package/docs/wiki.md +7 -7
- package/docs/work-artifacts-and-review.md +17 -6
- package/docs/work-connectors.md +4 -4
- package/docs/work-tools.md +5 -5
- package/docs/workflow-orchestration-primitives.md +35 -11
- package/docs/workflows.md +74 -13
- package/docs/working-and-semantic-memory.md +53 -5
- package/package.json +14 -31
- 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 +40 -24
- package/docs/antigravity-agent.md +0 -207
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
/** Provider-neutral speech synthesis contract (plan 061 Task 3).
|
|
2
|
+
* Text→audio bytes plus a streaming variant whose first chunk resolves as soon as the
|
|
3
|
+
* provider starts responding. Adapters enforce input caps with typed errors — they never
|
|
4
|
+
* silently truncate. Audio bytes use `Uint8Array`/`ReadableStream` (repo convention). */
|
|
5
|
+
import type { ModelCapabilities, ModelConfig } from "./content.js";
|
|
6
|
+
export interface SpeechRequest {
|
|
7
|
+
readonly model: string;
|
|
8
|
+
readonly input: string;
|
|
9
|
+
/** Provider voice id, e.g. `alloy`. Adapter default when omitted. */
|
|
10
|
+
readonly voice?: string;
|
|
11
|
+
/** Audio container, e.g. `mp3`, `wav`, `opus`. Adapter default when omitted. */
|
|
12
|
+
readonly format?: string;
|
|
13
|
+
/** Playback speed multiplier (e.g. 0.25–4.0 on OpenAI). */
|
|
14
|
+
readonly speed?: number;
|
|
15
|
+
readonly signal?: AbortSignal;
|
|
16
|
+
}
|
|
17
|
+
export interface SpeechResult {
|
|
18
|
+
readonly audio: Uint8Array;
|
|
19
|
+
/** Actual audio container of `audio` (request value or provider default). */
|
|
20
|
+
readonly format: string;
|
|
21
|
+
}
|
|
22
|
+
export interface SpeechStreamResult {
|
|
23
|
+
/** Audio chunks in order; the first chunk is available as soon as the provider responds. */
|
|
24
|
+
readonly audio: ReadableStream<Uint8Array>;
|
|
25
|
+
/** Actual audio container of the stream (request value or provider default). */
|
|
26
|
+
readonly format: string;
|
|
27
|
+
}
|
|
28
|
+
export interface SpeechProvider {
|
|
29
|
+
readonly id: string;
|
|
30
|
+
synthesize(request: SpeechRequest): Promise<SpeechResult>;
|
|
31
|
+
synthesizeStream(request: SpeechRequest): Promise<SpeechStreamResult>;
|
|
32
|
+
}
|
|
33
|
+
export type SpeechErrorCode = "empty_input" | "input_too_large" | "request_failed" | "response_malformed" | "unsupported_model";
|
|
34
|
+
export declare class SpeechError extends Error {
|
|
35
|
+
readonly code: SpeechErrorCode;
|
|
36
|
+
constructor(code: SpeechErrorCode, message: string);
|
|
37
|
+
}
|
|
38
|
+
export declare function modelSupportsSpeech(capabilities?: ModelCapabilities): boolean;
|
|
39
|
+
export declare function assertSpeechSupported(model: ModelConfig): void;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export class SpeechError extends Error {
|
|
2
|
+
code;
|
|
3
|
+
constructor(code, message) {
|
|
4
|
+
super(message);
|
|
5
|
+
this.name = "SpeechError";
|
|
6
|
+
this.code = code;
|
|
7
|
+
}
|
|
8
|
+
}
|
|
9
|
+
export function modelSupportsSpeech(capabilities) {
|
|
10
|
+
return capabilities?.speech === true;
|
|
11
|
+
}
|
|
12
|
+
export function assertSpeechSupported(model) {
|
|
13
|
+
if (!modelSupportsSpeech(model.capabilities)) {
|
|
14
|
+
throw new SpeechError("unsupported_model", `Model ${model.provider}/${model.model} does not declare the speech capability`);
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
//# sourceMappingURL=speech.js.map
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
/** Provider-neutral transcription contract (plan 061 Task 3).
|
|
2
|
+
* One-shot audio→text plus a streaming variant yielding partials; both share the
|
|
3
|
+
* `TranscriptDelta` event type aligned with `RealtimeEvent.transcript_delta` naming.
|
|
4
|
+
* Adapters enforce audio byte caps with typed errors — they never silently truncate. */
|
|
5
|
+
import type { ModelCapabilities, ModelConfig, Usage } from "./content.js";
|
|
6
|
+
export interface TranscriptionRequest {
|
|
7
|
+
readonly model: string;
|
|
8
|
+
/** Audio bytes to transcribe. */
|
|
9
|
+
readonly audio: Uint8Array;
|
|
10
|
+
/** Audio container hint, e.g. `wav`, `mp3`; the adapter maps it to an upload filename. */
|
|
11
|
+
readonly format?: string;
|
|
12
|
+
/** ISO-639-1 hint, e.g. `en`. */
|
|
13
|
+
readonly language?: string;
|
|
14
|
+
/** Optional spelling/style hint text. */
|
|
15
|
+
readonly prompt?: string;
|
|
16
|
+
readonly signal?: AbortSignal;
|
|
17
|
+
}
|
|
18
|
+
export interface TranscriptionResult {
|
|
19
|
+
readonly text: string;
|
|
20
|
+
/** Provider-reported token usage; absent when the provider does not report it. */
|
|
21
|
+
readonly usage?: Usage;
|
|
22
|
+
}
|
|
23
|
+
/** Partial transcript. Naming mirrors `RealtimeEvent.transcript_delta` (no `role` —
|
|
24
|
+
* one-shot transcription has no speaker turn). */
|
|
25
|
+
export interface TranscriptDelta {
|
|
26
|
+
readonly type: "transcript_delta";
|
|
27
|
+
readonly text: string;
|
|
28
|
+
}
|
|
29
|
+
/** Terminal event: final full text plus optional usage. Exactly one per stream. */
|
|
30
|
+
export interface TranscriptDone {
|
|
31
|
+
readonly type: "done";
|
|
32
|
+
readonly text: string;
|
|
33
|
+
readonly usage?: Usage;
|
|
34
|
+
}
|
|
35
|
+
export type TranscriptEvent = TranscriptDelta | TranscriptDone;
|
|
36
|
+
export interface TranscriptionProvider {
|
|
37
|
+
readonly id: string;
|
|
38
|
+
transcribe(request: TranscriptionRequest): Promise<TranscriptionResult>;
|
|
39
|
+
/** Yields `transcript_delta` partials in order, then exactly one `done`. */
|
|
40
|
+
transcribeStream(request: TranscriptionRequest): AsyncIterable<TranscriptEvent>;
|
|
41
|
+
}
|
|
42
|
+
export type TranscriptionErrorCode = "empty_input" | "audio_too_large" | "request_failed" | "response_malformed" | "unsupported_model";
|
|
43
|
+
export declare class TranscriptionError extends Error {
|
|
44
|
+
readonly code: TranscriptionErrorCode;
|
|
45
|
+
constructor(code: TranscriptionErrorCode, message: string);
|
|
46
|
+
}
|
|
47
|
+
export declare function modelSupportsTranscription(capabilities?: ModelCapabilities): boolean;
|
|
48
|
+
export declare function assertTranscriptionSupported(model: ModelConfig): void;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export class TranscriptionError extends Error {
|
|
2
|
+
code;
|
|
3
|
+
constructor(code, message) {
|
|
4
|
+
super(message);
|
|
5
|
+
this.name = "TranscriptionError";
|
|
6
|
+
this.code = code;
|
|
7
|
+
}
|
|
8
|
+
}
|
|
9
|
+
export function modelSupportsTranscription(capabilities) {
|
|
10
|
+
return capabilities?.transcription === true;
|
|
11
|
+
}
|
|
12
|
+
export function assertTranscriptionSupported(model) {
|
|
13
|
+
if (!modelSupportsTranscription(model.capabilities)) {
|
|
14
|
+
throw new TranscriptionError("unsupported_model", `Model ${model.provider}/${model.model} does not declare the transcription capability`);
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
//# sourceMappingURL=transcription.js.map
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
/** Provider-neutral video generation contract (plan 061 Task 5).
|
|
2
|
+
*
|
|
3
|
+
* Minimal submit/status shape — video jobs run minutes, not seconds, so unlike
|
|
4
|
+
* image generation there is no synchronous `generate`. Hosts poll `status`
|
|
5
|
+
* (or a fake transport in conformance runs) and own download/persistence of
|
|
6
|
+
* the resulting video. Input video as a chat content part is the typed
|
|
7
|
+
* `VideoContent` block with the `"video"` input capability (see content.ts).
|
|
8
|
+
*/
|
|
9
|
+
import type { ImageContent, ModelCapabilities, ModelConfig, Usage } from "./content.js";
|
|
10
|
+
/** States mirror the DashScope/OpenAI async job lifecycle; terminal states are
|
|
11
|
+
* `succeeded` and `failed`. */
|
|
12
|
+
export type VideoGenerationJobState = "queued" | "running" | "succeeded" | "failed";
|
|
13
|
+
export type VideoGenerationErrorCode = "empty_input" | "input_too_large" | "unsupported_model" | "request_failed" | "response_malformed" | "unsupported_operation";
|
|
14
|
+
export declare class VideoGenerationError extends Error {
|
|
15
|
+
readonly code: VideoGenerationErrorCode;
|
|
16
|
+
constructor(code: VideoGenerationErrorCode, message: string);
|
|
17
|
+
}
|
|
18
|
+
export declare function modelSupportsVideoGeneration(capabilities?: ModelCapabilities): boolean;
|
|
19
|
+
export declare function assertVideoGenerationSupported(model: ModelConfig): void;
|
|
20
|
+
/** Video generation request: text-to-video by default; pass `images` (first
|
|
21
|
+
* entry wins) for image-to-video providers. Provider-defined vocabulary for
|
|
22
|
+
* `size` (e.g. `1280x720`), `durationSeconds`, and `fps`. */
|
|
23
|
+
export interface VideoGenerationRequest {
|
|
24
|
+
readonly model: string;
|
|
25
|
+
readonly prompt: string;
|
|
26
|
+
readonly images?: readonly ImageContent[];
|
|
27
|
+
readonly size?: string;
|
|
28
|
+
readonly durationSeconds?: number;
|
|
29
|
+
readonly fps?: number;
|
|
30
|
+
readonly metadata?: Readonly<Record<string, unknown>>;
|
|
31
|
+
readonly signal?: AbortSignal;
|
|
32
|
+
}
|
|
33
|
+
/** Provider job handle from `submit`; poll with `status(jobId)`. */
|
|
34
|
+
export interface VideoGenerationJobHandle {
|
|
35
|
+
readonly jobId: string;
|
|
36
|
+
}
|
|
37
|
+
/** The generated video. At least one of `bytes` or `url` is present when the
|
|
38
|
+
* job succeeded; provenance (`provider`/`model`) is always preserved. */
|
|
39
|
+
export interface GeneratedVideo {
|
|
40
|
+
readonly bytes?: Uint8Array;
|
|
41
|
+
readonly url?: string;
|
|
42
|
+
readonly mimeType?: string;
|
|
43
|
+
readonly provider: string;
|
|
44
|
+
readonly model: string;
|
|
45
|
+
readonly durationSeconds?: number;
|
|
46
|
+
}
|
|
47
|
+
/** Point-in-time job state; `video` only on `succeeded`, `error` only on `failed`. */
|
|
48
|
+
export interface VideoGenerationJob {
|
|
49
|
+
readonly jobId: string;
|
|
50
|
+
readonly state: VideoGenerationJobState;
|
|
51
|
+
readonly video?: GeneratedVideo;
|
|
52
|
+
readonly error?: string;
|
|
53
|
+
readonly usage?: Usage;
|
|
54
|
+
}
|
|
55
|
+
export interface VideoGenerationProvider {
|
|
56
|
+
readonly id: string;
|
|
57
|
+
/** Submit a job; never blocks on generation. */
|
|
58
|
+
submit(request: VideoGenerationRequest): Promise<VideoGenerationJobHandle>;
|
|
59
|
+
/** Point-in-time status probe — host-owned polling loop. */
|
|
60
|
+
status(jobId: string, signal?: AbortSignal): Promise<VideoGenerationJob>;
|
|
61
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export class VideoGenerationError extends Error {
|
|
2
|
+
code;
|
|
3
|
+
constructor(code, message) {
|
|
4
|
+
super(message);
|
|
5
|
+
this.name = "VideoGenerationError";
|
|
6
|
+
this.code = code;
|
|
7
|
+
}
|
|
8
|
+
}
|
|
9
|
+
export function modelSupportsVideoGeneration(capabilities) {
|
|
10
|
+
return capabilities?.videoGeneration === true;
|
|
11
|
+
}
|
|
12
|
+
export function assertVideoGenerationSupported(model) {
|
|
13
|
+
if (!modelSupportsVideoGeneration(model.capabilities)) {
|
|
14
|
+
throw new VideoGenerationError("unsupported_model", `Model ${model.provider}/${model.model} does not declare the videoGeneration capability`);
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
//# sourceMappingURL=video.js.map
|
package/dist/contracts-core.d.ts
CHANGED
|
@@ -3,12 +3,19 @@
|
|
|
3
3
|
* of `./contracts-core.js` is unchanged (0.1.4 barrel precedent). */
|
|
4
4
|
export type { AudioContent, DocumentContent, FileContent } from "./content.js";
|
|
5
5
|
export * from "./contracts-core/agent.js";
|
|
6
|
+
export * from "./contracts-core/batch.js";
|
|
6
7
|
export * from "./contracts-core/compaction.js";
|
|
7
8
|
export * from "./contracts-core/content.js";
|
|
9
|
+
export * from "./contracts-core/embeddings.js";
|
|
8
10
|
export * from "./contracts-core/extensions.js";
|
|
11
|
+
export * from "./contracts-core/images.js";
|
|
9
12
|
export * from "./contracts-core/loop.js";
|
|
13
|
+
export * from "./contracts-core/moderation.js";
|
|
10
14
|
export * from "./contracts-core/persistence.js";
|
|
11
15
|
export * from "./contracts-core/provider.js";
|
|
12
16
|
export * from "./contracts-core/resources.js";
|
|
13
17
|
export * from "./contracts-core/run-limits.js";
|
|
14
18
|
export * from "./contracts-core/session.js";
|
|
19
|
+
export * from "./contracts-core/speech.js";
|
|
20
|
+
export * from "./contracts-core/transcription.js";
|
|
21
|
+
export * from "./contracts-core/video.js";
|
package/dist/contracts-core.js
CHANGED
|
@@ -1,11 +1,18 @@
|
|
|
1
1
|
export * from "./contracts-core/agent.js";
|
|
2
|
+
export * from "./contracts-core/batch.js";
|
|
2
3
|
export * from "./contracts-core/compaction.js";
|
|
3
4
|
export * from "./contracts-core/content.js";
|
|
5
|
+
export * from "./contracts-core/embeddings.js";
|
|
4
6
|
export * from "./contracts-core/extensions.js";
|
|
7
|
+
export * from "./contracts-core/images.js";
|
|
5
8
|
export * from "./contracts-core/loop.js";
|
|
9
|
+
export * from "./contracts-core/moderation.js";
|
|
6
10
|
export * from "./contracts-core/persistence.js";
|
|
7
11
|
export * from "./contracts-core/provider.js";
|
|
8
12
|
export * from "./contracts-core/resources.js";
|
|
9
13
|
export * from "./contracts-core/run-limits.js";
|
|
10
14
|
export * from "./contracts-core/session.js";
|
|
15
|
+
export * from "./contracts-core/speech.js";
|
|
16
|
+
export * from "./contracts-core/transcription.js";
|
|
17
|
+
export * from "./contracts-core/video.js";
|
|
11
18
|
//# sourceMappingURL=contracts-core.js.map
|
|
@@ -57,6 +57,17 @@ export type RealtimeEvent = {
|
|
|
57
57
|
/** Neutral bidirectional realtime session seam. The provider owns the transport
|
|
58
58
|
* (e.g. WebSocket); the host owns audio capture/playback and session lifecycle. */
|
|
59
59
|
export type InputAssemblyLayout = "legacy" | "cache_aware";
|
|
60
|
+
/** Opaque provenance ref for the resolved prompt version that produced a run
|
|
61
|
+
* (plan 042). Identity only — never prompt content; the body is recoverable
|
|
62
|
+
* from the prompt store via `hash`. */
|
|
63
|
+
export interface PromptVersionRef {
|
|
64
|
+
/** Prompt name within the host's prompt store. */
|
|
65
|
+
readonly name: string;
|
|
66
|
+
/** Immutable version number assigned by the prompt store. */
|
|
67
|
+
readonly version: number;
|
|
68
|
+
/** Content hash of the exact UTF-8 body bytes: `sha256:<64 lowercase hex>`. */
|
|
69
|
+
readonly hash: string;
|
|
70
|
+
}
|
|
60
71
|
export interface RunOptions {
|
|
61
72
|
readonly signal?: AbortSignal;
|
|
62
73
|
readonly model?: ModelConfig;
|
|
@@ -84,6 +95,9 @@ export interface RunOptions {
|
|
|
84
95
|
readonly activateAllSkills?: true;
|
|
85
96
|
/** Progressive: catalog (name+description) unless loaded; eager: full instructions every turn. Default progressive. */
|
|
86
97
|
readonly skillsDisclosure?: import("./skill-disclosure.js").SkillsDisclosure;
|
|
98
|
+
/** Tools disclosure: "all" (default) sends every active tool schema; "search" sends top-k + the generated `search_tools` tool. */
|
|
99
|
+
readonly toolsDisclosure?: import("./tool-search.js").ToolsDisclosure;
|
|
100
|
+
readonly toolsSearch?: import("./tool-search.js").ToolsSearchOptions;
|
|
87
101
|
/** Opt-in projection-only fold for aged large tool results in provider view; store untouched. */
|
|
88
102
|
readonly toolResultFold?: import("./tool-result-fold.js").ToolResultFoldOptions;
|
|
89
103
|
readonly instructionInjectors?: readonly InstructionInjector[];
|
|
@@ -93,6 +107,8 @@ export interface RunOptions {
|
|
|
93
107
|
readonly guardrails?: Guardrails;
|
|
94
108
|
/** Opt-in durable interruption/checkpointing. */
|
|
95
109
|
readonly runState?: AgentRunStateOptions;
|
|
110
|
+
/** Prompt provenance: copied verbatim onto this run's start and finish ledger records. */
|
|
111
|
+
readonly promptVersion?: PromptVersionRef;
|
|
96
112
|
}
|
|
97
113
|
export interface ProviderTurnMetadata {
|
|
98
114
|
readonly providerId: string;
|
|
@@ -493,6 +509,8 @@ export interface RunRecord extends OwnershipScope {
|
|
|
493
509
|
readonly abortReason?: string;
|
|
494
510
|
readonly error?: ErrorInfo;
|
|
495
511
|
readonly metadata?: Readonly<Record<string, unknown>>;
|
|
512
|
+
/** Provenance ref copied from `RunOptions.promptVersion` when the host supplied one. */
|
|
513
|
+
readonly promptVersion?: PromptVersionRef;
|
|
496
514
|
}
|
|
497
515
|
export type AgentEventType = AgentEvent["type"];
|
|
498
516
|
/** Stored agent event ledger row. The `event` payload should be redacted before storage when secrets are present. */
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import type { AgentSessionCloneOptions, AgentSessionForkOptions, CompactionOptions, CompactionResult, ContentBlock, ErrorInfo, JsonObject, JsonValue, Message, ModelConfig, RunLimitBreach, SessionEntry, ToolCallContent, Usage } from "./contracts-core.js";
|
|
1
|
+
import type { AgentSessionCloneOptions, AgentSessionForkOptions, CheckpointStore, CompactionOptions, CompactionResult, ContentBlock, ErrorInfo, JsonObject, JsonValue, Message, ModelConfig, OwnershipScope, RunLimitBreach, SessionEntry, SubscribeOptions, ToolCallContent, Usage } from "./contracts-core.js";
|
|
2
2
|
import type { AgentEvent, RunOptions, ToolEffectKind } from "./contracts-protocol.js";
|
|
3
|
-
import type { CheckpointStore, OwnershipScope, SubscribeOptions } from "./contracts-core.js";
|
|
4
3
|
export type AgentRunStatus = "succeeded" | "failed" | "aborted" | "suspended" | "denied";
|
|
5
4
|
export type AgentRunInterruptionKind = "input_guardrail" | "tool_approval" | "elicitation";
|
|
6
5
|
export type ApprovalOutcome = "allow_once" | "allow_for_run" | "reject_once" | "reject_for_run";
|
package/dist/index.d.ts
CHANGED
|
@@ -13,6 +13,8 @@ export type { ApplyCacheControlOptions, CacheControlledContentBlock, CacheContro
|
|
|
13
13
|
export { applyCacheControl, cacheHitRate, cacheSavings, cacheUsageReport, mapCacheRetention, resolveBreakpoint, sanitizeCacheKey, systemCacheControlField, } from "./cache-helpers.js";
|
|
14
14
|
export type { CacheTelemetry, CacheTelemetryOptions, CacheTelemetryReport, CacheTelemetrySample, } from "./cache-telemetry.js";
|
|
15
15
|
export { CACHE_TELEMETRY_OVERFLOW_KEY, CacheTelemetryError, createCacheTelemetry, DEFAULT_CACHE_TELEMETRY_CAP, } from "./cache-telemetry.js";
|
|
16
|
+
export type { ProviderCapture, ProviderCaptureEntry, ProviderCaptureOptions, ProviderCapturePolicy } from "./capture.js";
|
|
17
|
+
export { createProviderCapture } from "./capture.js";
|
|
16
18
|
export type { MemoryCheckpointStoreOptions } from "./checkpoints.js";
|
|
17
19
|
export { CHECKPOINT_CONFLICT_CODE, CheckpointConflictError, createMemoryCheckpointStore } from "./checkpoints.js";
|
|
18
20
|
export type { DefaultCompactionStrategyOptions } from "./compaction.js";
|
|
@@ -25,7 +27,7 @@ export type { ContextBudget, ContextBudgetMessageGroups, ContextBudgetOmission,
|
|
|
25
27
|
export { applyContextBudget, CONTEXT_BUDGET_ERROR_CODE, CONTEXT_BUDGET_REPORT_METADATA_KEY, ContextBudgetError, DEFAULT_MAX_CONTEXT_BUDGET_OMISSIONS, estimateAssemblyTokens, estimateMessageBytes, estimateMessageTokens, estimateTextBytes, estimateTextTokens, getContextBudgetReport, HARD_MAX_CONTEXT_BUDGET_BYTES, HARD_MAX_CONTEXT_BUDGET_OMISSIONS, HARD_MAX_CONTEXT_BUDGET_TOKENS, isContextBudgetError, resolveContextBudget, } from "./context-budget.js";
|
|
26
28
|
export type * from "./contracts.js";
|
|
27
29
|
export type { ApprovalOutcome, DecisionScope, NestedRunApproval, NestedRunOutcome, NestedRunRef, PendingDecision, PendingDecisionKind, ProviderResolver, RealtimeCaps, RealtimeEvent, RealtimeSession, RealtimeSessionFactory, RealtimeSessionOptions, ResumeNestedRun, RunDecision, RunLimitCounters, RunLimitName, SecureAgentOptions, StickyDecision, ToolCallAuthority, ToolEffectClassifier, ToolEffectDeclaration, ToolEffectIdempotency, ToolEffectKey, ToolEffectKind, ToolEffectRecord, ToolEffectStatus, ToolEffectStore, ToolEffectTransition, ToolElicitationRequest, } from "./contracts.js";
|
|
28
|
-
export { AgentDecisionError, AgentDelegationSuspendedError, AgentLoopStateError, AgentRunError, AgentRunStateError, assertSessionMetadataKey, DEFAULT_MAX_PENDING_DECISIONS, DEFAULT_MAX_PENDING_STEER_BYTES, DEFAULT_MAX_PENDING_STEERS, DEFAULT_MAX_SESSION_SEARCH_CURSOR_BYTES, DEFAULT_MAX_SESSION_SEARCH_FTS_CANDIDATES, DEFAULT_MAX_SESSION_SEARCH_LINEAR_BYTES, DEFAULT_MAX_SESSION_SEARCH_LINEAR_ENTRIES, DEFAULT_MAX_SESSION_SEARCH_LINEAR_SESSIONS, DEFAULT_MAX_SESSION_SEARCH_QUERY_BYTES, DEFAULT_MAX_SESSION_SEARCH_SNIPPET_BYTES, DEFAULT_MAX_STICKY_DECISIONS, DEFAULT_SESSION_SEARCH_LIMIT, HARD_MAX_ACTION_CONSTRAINT_BYTES, HARD_MAX_ACTION_CONSTRAINTS, HARD_MAX_DECISION_REASON_BYTES, HARD_MAX_ELICITATION_BYTES, HARD_MAX_PENDING_DECISIONS, HARD_MAX_PENDING_STEER_BYTES, HARD_MAX_PENDING_STEERS, HARD_MAX_SESSION_SEARCH_CURSOR_BYTES, HARD_MAX_SESSION_SEARCH_FTS_CANDIDATES, HARD_MAX_SESSION_SEARCH_LIMIT, HARD_MAX_SESSION_SEARCH_LINEAR_BYTES, HARD_MAX_SESSION_SEARCH_LINEAR_ENTRIES, HARD_MAX_SESSION_SEARCH_LINEAR_SESSIONS, HARD_MAX_SESSION_SEARCH_QUERY_BYTES, HARD_MAX_SESSION_SEARCH_SNIPPET_BYTES, HARD_MAX_STICKY_DECISIONS, isSessionAppendConflict, isSessionEntryKind, isSessionMetadataConflict, isSessionSearchUnsupported, MAX_ACTION_CONSTRAINT_BYTES, MAX_ACTION_CONSTRAINTS, MAX_ATTRIBUTION_DEPTH, MAX_DECISION_REASON_BYTES, MAX_ELICITATION_BYTES, resolveSessionSearchQuery, SESSION_APPEND_CONFLICT_CODE, SESSION_ENTRY_KINDS, SESSION_ENTRY_SCHEMA_VERSION, SESSION_METADATA_CONFLICT_CODE, SESSION_SEARCH_UNSUPPORTED_CODE, SESSION_SEARCH_WORKSPACE_METADATA_KEY, SessionAppendConflictError, SessionMetadataConflictError, SessionSearchUnsupportedError, } from "./contracts.js";
|
|
30
|
+
export { AgentDecisionError, AgentDelegationSuspendedError, AgentLoopStateError, AgentRunError, AgentRunStateError, assertBatchJobsSupported, assertEmbeddingsSupported, assertImageGenerationSupported, assertModerationSupported, assertSessionMetadataKey, assertSpeechSupported, assertTranscriptionSupported, assertVideoGenerationSupported, BatchJobsError, DEFAULT_MAX_PENDING_DECISIONS, DEFAULT_MAX_PENDING_STEER_BYTES, DEFAULT_MAX_PENDING_STEERS, DEFAULT_MAX_SESSION_SEARCH_CURSOR_BYTES, DEFAULT_MAX_SESSION_SEARCH_FTS_CANDIDATES, DEFAULT_MAX_SESSION_SEARCH_LINEAR_BYTES, DEFAULT_MAX_SESSION_SEARCH_LINEAR_ENTRIES, DEFAULT_MAX_SESSION_SEARCH_LINEAR_SESSIONS, DEFAULT_MAX_SESSION_SEARCH_QUERY_BYTES, DEFAULT_MAX_SESSION_SEARCH_SNIPPET_BYTES, DEFAULT_MAX_STICKY_DECISIONS, DEFAULT_SESSION_SEARCH_LIMIT, EmbeddingsError, HARD_MAX_ACTION_CONSTRAINT_BYTES, HARD_MAX_ACTION_CONSTRAINTS, HARD_MAX_DECISION_REASON_BYTES, HARD_MAX_ELICITATION_BYTES, HARD_MAX_PENDING_DECISIONS, HARD_MAX_PENDING_STEER_BYTES, HARD_MAX_PENDING_STEERS, HARD_MAX_SESSION_SEARCH_CURSOR_BYTES, HARD_MAX_SESSION_SEARCH_FTS_CANDIDATES, HARD_MAX_SESSION_SEARCH_LIMIT, HARD_MAX_SESSION_SEARCH_LINEAR_BYTES, HARD_MAX_SESSION_SEARCH_LINEAR_ENTRIES, HARD_MAX_SESSION_SEARCH_LINEAR_SESSIONS, HARD_MAX_SESSION_SEARCH_QUERY_BYTES, HARD_MAX_SESSION_SEARCH_SNIPPET_BYTES, HARD_MAX_STICKY_DECISIONS, ImageGenerationError, isBatchJobTerminal, isSessionAppendConflict, isSessionEntryKind, isSessionMetadataConflict, isSessionSearchUnsupported, MAX_ACTION_CONSTRAINT_BYTES, MAX_ACTION_CONSTRAINTS, MAX_ATTRIBUTION_DEPTH, MAX_DECISION_REASON_BYTES, MAX_ELICITATION_BYTES, ModerationError, modelSupportsBatchJobs, modelSupportsEmbeddings, modelSupportsImageGeneration, modelSupportsModeration, modelSupportsSpeech, modelSupportsTranscription, modelSupportsVideoGeneration, pollBatch, resolveSessionSearchQuery, SESSION_APPEND_CONFLICT_CODE, SESSION_ENTRY_KINDS, SESSION_ENTRY_SCHEMA_VERSION, SESSION_METADATA_CONFLICT_CODE, SESSION_SEARCH_UNSUPPORTED_CODE, SESSION_SEARCH_WORKSPACE_METADATA_KEY, SessionAppendConflictError, SessionMetadataConflictError, SessionSearchUnsupportedError, SpeechError, TranscriptionError, VideoGenerationError, } from "./contracts.js";
|
|
29
31
|
export { parseAgentFile, parseSkillFile } from "./contribution-parsing.js";
|
|
30
32
|
export type { ContributionRegistries, ContributionRegistriesOptions, ContributionRegistry, ContributionRegistryOptions, } from "./contributions.js";
|
|
31
33
|
export { createContributionRegistries, createContributionRegistry, registerDiscoveredContributions } from "./contributions.js";
|
|
@@ -104,16 +106,18 @@ export type { ComposeSystemPromptOptions } from "./system-prompts.js";
|
|
|
104
106
|
export { composeSystemPrompt, mergeSystemPromptConfig } from "./system-prompts.js";
|
|
105
107
|
export { assertAgentEventSourceConforms } from "./testing/agent-event-source-conformance.js";
|
|
106
108
|
export type { ThinkingCompatFamily, ThinkingLevel } from "./thinking.js";
|
|
107
|
-
export { applyThinkingLevel, isThinkingLevel, normalizeThinkingLevel, THINKING_LEVELS, thinkingCompatFor, thinkingFamilyForModel, } from "./thinking.js";
|
|
109
|
+
export { applyThinkingLevel, applyThinkingLevelForModel, isSupportedThinkingLevel, isThinkingLevel, normalizeThinkingLevel, parseThinkingLevel, snapThinkingLevel, THINKING_LEVELS, thinkingCompatFor, thinkingFamilyForModel, thinkingLevelsForModel, } from "./thinking.js";
|
|
108
110
|
export type { ToolEffectErrorCode } from "./tool-effects.js";
|
|
109
111
|
export { createMemoryToolEffectStore, ToolEffectError } from "./tool-effects.js";
|
|
110
112
|
export type { FoldToolResultsContext, ResolvedToolResultFoldOptions, ToolResultFoldInput, ToolResultFoldOptions, } from "./tool-result-fold.js";
|
|
111
113
|
export { DEFAULT_TOOL_RESULT_FOLD_MAX_SUMMARY_BYTES, DEFAULT_TOOL_RESULT_FOLD_MIN_AGE_TURNS, DEFAULT_TOOL_RESULT_FOLD_MIN_BYTES, foldedToolResultHeader, foldToolResultHistory, foldToolResults, formatFoldedToolResult, HARD_TOOL_RESULT_FOLD_MAX_SUMMARY_BYTES, resolveToolResultFold, TOOL_RESULT_FOLD_TURN_METADATA_KEY, } from "./tool-result-fold.js";
|
|
114
|
+
export type { ActiveToolSet, ToolSearchIndex, ToolSearchMatch, ToolSearchState, ToolsDisclosure, ToolsSearchOptions, } from "./tool-search.js";
|
|
115
|
+
export { createActiveToolSet, createSearchToolsTool, createToolSearchIndex, createToolSearchState, DEFAULT_MAX_TOOLS_SEARCH_QUERY_BYTES, DEFAULT_TOOLS_SEARCH_TOP_K, HARD_MAX_TOOLS_INDEX, HARD_MAX_TOOLS_SEARCH_QUERY_BYTES, HARD_MAX_TOOLS_SEARCH_TOP_K, isToolDisclosureError, resolveToolsDisclosure, SEARCH_TOOLS_TOOL_NAME, scoreTools, selectDisclosedTools, TOOL_DISCLOSURE_ERROR_CODE, ToolDisclosureError, } from "./tool-search.js";
|
|
112
116
|
export type { DispatchToolCallOptions, ToolArgumentValidationError, ToolArgumentValidationResult, ToolArgumentValidator, ToolFilter, ToolFilterInput, ToolParameterValidatorOptions, ToolRegistryOptions, ToolValidator, } from "./tools.js";
|
|
113
117
|
export { createToolParameterValidator, createToolRegistry, dispatchToolCall, filterTools } from "./tools.js";
|
|
114
118
|
export { trimTrailingSlashes } from "./trim-trailing-slashes.js";
|
|
115
119
|
export type { ResolvedUseCaseModel, ResolveUseCaseModelInput, UseCaseModelBinding, } from "./use-case-model.js";
|
|
116
120
|
export { resolveUseCaseModel, resolveUseCaseModelBinding, useCaseCredentialProviderId, } from "./use-case-model.js";
|
|
117
121
|
export declare const name = "prism";
|
|
118
|
-
export declare const version = "0.
|
|
122
|
+
export declare const version = "0.5.0";
|
|
119
123
|
export declare const description = "Agent harness for AI providers, agents, sessions, and tools.";
|
package/dist/index.js
CHANGED
|
@@ -7,12 +7,13 @@ export { createAgent, createAgentSession, resumeAgentRun, resumeAgentRunStream }
|
|
|
7
7
|
export { ARTIFACT_BODY_ERROR_CODES, ARTIFACT_CHECKPOINT_NAMESPACE, ArtifactBodyStoreError, ArtifactError, artifactApprovalState, artifactCheckpointKey, } from "./artifacts.js";
|
|
8
8
|
export { applyCacheControl, cacheHitRate, cacheSavings, cacheUsageReport, mapCacheRetention, resolveBreakpoint, sanitizeCacheKey, systemCacheControlField, } from "./cache-helpers.js";
|
|
9
9
|
export { CACHE_TELEMETRY_OVERFLOW_KEY, CacheTelemetryError, createCacheTelemetry, DEFAULT_CACHE_TELEMETRY_CAP, } from "./cache-telemetry.js";
|
|
10
|
+
export { createProviderCapture } from "./capture.js";
|
|
10
11
|
export { CHECKPOINT_CONFLICT_CODE, CheckpointConflictError, createMemoryCheckpointStore } from "./checkpoints.js";
|
|
11
12
|
export { createDefaultCompactionStrategy, isCompactionEntryData } from "./compaction.js";
|
|
12
13
|
export { assertJsonObject, isJsonObject, loadConfigLayers, mergeConfigLayers } from "./config.js";
|
|
13
14
|
export { assertDeclaredMediaTypeMatches, assertMediaBlocksWithinBounds, assertMessagesSupportModelCapabilities, assertModelSupportsContentBlocks, assertSsrfAllowedUrl, collectMessageContentBlocks, contentBlockInputModality, DEFAULT_MAX_AUDIO_DURATION_MS, DEFAULT_MAX_MEDIA_ITEM_BYTES, DEFAULT_MAX_MEDIA_ITEMS_PER_REQUEST, DEFAULT_MAX_MEDIA_REQUEST_BYTES, DEFAULT_MEDIA_FETCH_TIMEOUT_MS, loadBoundedBinaryResource, MediaContentError, MODEL_INPUT_CAPABILITIES, resolveMediaContentBlock, resolveMediaContentBlocks, sniffMediaMimeType, UnsupportedModalityError, } from "./content.js";
|
|
14
15
|
export { applyContextBudget, CONTEXT_BUDGET_ERROR_CODE, CONTEXT_BUDGET_REPORT_METADATA_KEY, ContextBudgetError, DEFAULT_MAX_CONTEXT_BUDGET_OMISSIONS, estimateAssemblyTokens, estimateMessageBytes, estimateMessageTokens, estimateTextBytes, estimateTextTokens, getContextBudgetReport, HARD_MAX_CONTEXT_BUDGET_BYTES, HARD_MAX_CONTEXT_BUDGET_OMISSIONS, HARD_MAX_CONTEXT_BUDGET_TOKENS, isContextBudgetError, resolveContextBudget, } from "./context-budget.js";
|
|
15
|
-
export { AgentDecisionError, AgentDelegationSuspendedError, AgentLoopStateError, AgentRunError, AgentRunStateError, assertSessionMetadataKey, DEFAULT_MAX_PENDING_DECISIONS, DEFAULT_MAX_PENDING_STEER_BYTES, DEFAULT_MAX_PENDING_STEERS, DEFAULT_MAX_SESSION_SEARCH_CURSOR_BYTES, DEFAULT_MAX_SESSION_SEARCH_FTS_CANDIDATES, DEFAULT_MAX_SESSION_SEARCH_LINEAR_BYTES, DEFAULT_MAX_SESSION_SEARCH_LINEAR_ENTRIES, DEFAULT_MAX_SESSION_SEARCH_LINEAR_SESSIONS, DEFAULT_MAX_SESSION_SEARCH_QUERY_BYTES, DEFAULT_MAX_SESSION_SEARCH_SNIPPET_BYTES, DEFAULT_MAX_STICKY_DECISIONS, DEFAULT_SESSION_SEARCH_LIMIT, HARD_MAX_ACTION_CONSTRAINT_BYTES, HARD_MAX_ACTION_CONSTRAINTS, HARD_MAX_DECISION_REASON_BYTES, HARD_MAX_ELICITATION_BYTES, HARD_MAX_PENDING_DECISIONS, HARD_MAX_PENDING_STEER_BYTES, HARD_MAX_PENDING_STEERS, HARD_MAX_SESSION_SEARCH_CURSOR_BYTES, HARD_MAX_SESSION_SEARCH_FTS_CANDIDATES, HARD_MAX_SESSION_SEARCH_LIMIT, HARD_MAX_SESSION_SEARCH_LINEAR_BYTES, HARD_MAX_SESSION_SEARCH_LINEAR_ENTRIES, HARD_MAX_SESSION_SEARCH_LINEAR_SESSIONS, HARD_MAX_SESSION_SEARCH_QUERY_BYTES, HARD_MAX_SESSION_SEARCH_SNIPPET_BYTES, HARD_MAX_STICKY_DECISIONS, isSessionAppendConflict, isSessionEntryKind, isSessionMetadataConflict, isSessionSearchUnsupported, MAX_ACTION_CONSTRAINT_BYTES, MAX_ACTION_CONSTRAINTS, MAX_ATTRIBUTION_DEPTH, MAX_DECISION_REASON_BYTES, MAX_ELICITATION_BYTES, resolveSessionSearchQuery, SESSION_APPEND_CONFLICT_CODE, SESSION_ENTRY_KINDS, SESSION_ENTRY_SCHEMA_VERSION, SESSION_METADATA_CONFLICT_CODE, SESSION_SEARCH_UNSUPPORTED_CODE, SESSION_SEARCH_WORKSPACE_METADATA_KEY, SessionAppendConflictError, SessionMetadataConflictError, SessionSearchUnsupportedError, } from "./contracts.js";
|
|
16
|
+
export { AgentDecisionError, AgentDelegationSuspendedError, AgentLoopStateError, AgentRunError, AgentRunStateError, assertBatchJobsSupported, assertEmbeddingsSupported, assertImageGenerationSupported, assertModerationSupported, assertSessionMetadataKey, assertSpeechSupported, assertTranscriptionSupported, assertVideoGenerationSupported, BatchJobsError, DEFAULT_MAX_PENDING_DECISIONS, DEFAULT_MAX_PENDING_STEER_BYTES, DEFAULT_MAX_PENDING_STEERS, DEFAULT_MAX_SESSION_SEARCH_CURSOR_BYTES, DEFAULT_MAX_SESSION_SEARCH_FTS_CANDIDATES, DEFAULT_MAX_SESSION_SEARCH_LINEAR_BYTES, DEFAULT_MAX_SESSION_SEARCH_LINEAR_ENTRIES, DEFAULT_MAX_SESSION_SEARCH_LINEAR_SESSIONS, DEFAULT_MAX_SESSION_SEARCH_QUERY_BYTES, DEFAULT_MAX_SESSION_SEARCH_SNIPPET_BYTES, DEFAULT_MAX_STICKY_DECISIONS, DEFAULT_SESSION_SEARCH_LIMIT, EmbeddingsError, HARD_MAX_ACTION_CONSTRAINT_BYTES, HARD_MAX_ACTION_CONSTRAINTS, HARD_MAX_DECISION_REASON_BYTES, HARD_MAX_ELICITATION_BYTES, HARD_MAX_PENDING_DECISIONS, HARD_MAX_PENDING_STEER_BYTES, HARD_MAX_PENDING_STEERS, HARD_MAX_SESSION_SEARCH_CURSOR_BYTES, HARD_MAX_SESSION_SEARCH_FTS_CANDIDATES, HARD_MAX_SESSION_SEARCH_LIMIT, HARD_MAX_SESSION_SEARCH_LINEAR_BYTES, HARD_MAX_SESSION_SEARCH_LINEAR_ENTRIES, HARD_MAX_SESSION_SEARCH_LINEAR_SESSIONS, HARD_MAX_SESSION_SEARCH_QUERY_BYTES, HARD_MAX_SESSION_SEARCH_SNIPPET_BYTES, HARD_MAX_STICKY_DECISIONS, ImageGenerationError, isBatchJobTerminal, isSessionAppendConflict, isSessionEntryKind, isSessionMetadataConflict, isSessionSearchUnsupported, MAX_ACTION_CONSTRAINT_BYTES, MAX_ACTION_CONSTRAINTS, MAX_ATTRIBUTION_DEPTH, MAX_DECISION_REASON_BYTES, MAX_ELICITATION_BYTES, ModerationError, modelSupportsBatchJobs, modelSupportsEmbeddings, modelSupportsImageGeneration, modelSupportsModeration, modelSupportsSpeech, modelSupportsTranscription, modelSupportsVideoGeneration, pollBatch, resolveSessionSearchQuery, SESSION_APPEND_CONFLICT_CODE, SESSION_ENTRY_KINDS, SESSION_ENTRY_SCHEMA_VERSION, SESSION_METADATA_CONFLICT_CODE, SESSION_SEARCH_UNSUPPORTED_CODE, SESSION_SEARCH_WORKSPACE_METADATA_KEY, SessionAppendConflictError, SessionMetadataConflictError, SessionSearchUnsupportedError, SpeechError, TranscriptionError, VideoGenerationError, } from "./contracts.js";
|
|
16
17
|
export { parseAgentFile, parseSkillFile } from "./contribution-parsing.js";
|
|
17
18
|
export { createContributionRegistries, createContributionRegistry, registerDiscoveredContributions } from "./contributions.js";
|
|
18
19
|
export { CONVERSATION_METADATA_KEY, ConversationError, conversationMarkerMetadata, conversationThreadFromRecord, DEFAULT_MAX_CONVERSATION_CURSOR_BYTES, decodeConversationReplayCursor, encodeConversationReplayCursor, HARD_MAX_CONVERSATION_CURSOR_BYTES, } from "./conversations.js";
|
|
@@ -57,13 +58,14 @@ export { createSkillRegistry, resolveActiveSkills } from "./skills.js";
|
|
|
57
58
|
export { artifactStructuredOutputRequest, assertStructuredOutputRequestSupported, DEFAULT_MAX_STRUCTURED_OUTPUT_NAME_LENGTH, DEFAULT_MAX_STRUCTURED_OUTPUT_SCHEMA_BYTES, modelSupportsStructuredOutput, resolveRunProviderOptions, StructuredOutputError, validateStructuredOutputOptions, withoutStructuredOutput, } from "./structured-output.js";
|
|
58
59
|
export { composeSystemPrompt, mergeSystemPromptConfig } from "./system-prompts.js";
|
|
59
60
|
export { assertAgentEventSourceConforms } from "./testing/agent-event-source-conformance.js";
|
|
60
|
-
export { applyThinkingLevel, isThinkingLevel, normalizeThinkingLevel, THINKING_LEVELS, thinkingCompatFor, thinkingFamilyForModel, } from "./thinking.js";
|
|
61
|
+
export { applyThinkingLevel, applyThinkingLevelForModel, isSupportedThinkingLevel, isThinkingLevel, normalizeThinkingLevel, parseThinkingLevel, snapThinkingLevel, THINKING_LEVELS, thinkingCompatFor, thinkingFamilyForModel, thinkingLevelsForModel, } from "./thinking.js";
|
|
61
62
|
export { createMemoryToolEffectStore, ToolEffectError } from "./tool-effects.js";
|
|
62
63
|
export { DEFAULT_TOOL_RESULT_FOLD_MAX_SUMMARY_BYTES, DEFAULT_TOOL_RESULT_FOLD_MIN_AGE_TURNS, DEFAULT_TOOL_RESULT_FOLD_MIN_BYTES, foldedToolResultHeader, foldToolResultHistory, foldToolResults, formatFoldedToolResult, HARD_TOOL_RESULT_FOLD_MAX_SUMMARY_BYTES, resolveToolResultFold, TOOL_RESULT_FOLD_TURN_METADATA_KEY, } from "./tool-result-fold.js";
|
|
64
|
+
export { createActiveToolSet, createSearchToolsTool, createToolSearchIndex, createToolSearchState, DEFAULT_MAX_TOOLS_SEARCH_QUERY_BYTES, DEFAULT_TOOLS_SEARCH_TOP_K, HARD_MAX_TOOLS_INDEX, HARD_MAX_TOOLS_SEARCH_QUERY_BYTES, HARD_MAX_TOOLS_SEARCH_TOP_K, isToolDisclosureError, resolveToolsDisclosure, SEARCH_TOOLS_TOOL_NAME, scoreTools, selectDisclosedTools, TOOL_DISCLOSURE_ERROR_CODE, ToolDisclosureError, } from "./tool-search.js";
|
|
63
65
|
export { createToolParameterValidator, createToolRegistry, dispatchToolCall, filterTools } from "./tools.js";
|
|
64
66
|
export { trimTrailingSlashes } from "./trim-trailing-slashes.js";
|
|
65
67
|
export { resolveUseCaseModel, resolveUseCaseModelBinding, useCaseCredentialProviderId, } from "./use-case-model.js";
|
|
66
68
|
export const name = "prism";
|
|
67
|
-
export const version = "0.
|
|
69
|
+
export const version = "0.5.0";
|
|
68
70
|
export const description = "Agent harness for AI providers, agents, sessions, and tools.";
|
|
69
71
|
//# sourceMappingURL=index.js.map
|
package/dist/input.d.ts
CHANGED
|
@@ -4,6 +4,7 @@ import type { MiddlewareRegistry } from "./middleware.js";
|
|
|
4
4
|
import type { SecretRedactor } from "./redaction.js";
|
|
5
5
|
import { type LoadedSkillSet, type SkillsDisclosure } from "./skill-disclosure.js";
|
|
6
6
|
import { type ResolvedToolResultFoldOptions } from "./tool-result-fold.js";
|
|
7
|
+
import { type ToolsDisclosure, type ToolsSearchOptions } from "./tool-search.js";
|
|
7
8
|
export type AgentInput = string | Message | readonly Message[];
|
|
8
9
|
export interface PromptInstruction {
|
|
9
10
|
readonly text: string;
|
|
@@ -58,6 +59,13 @@ export interface AssembleProviderInputOptions extends DefaultInputBuildContext {
|
|
|
58
59
|
readonly skillsDisclosure?: SkillsDisclosure;
|
|
59
60
|
readonly loadedSkills?: LoadedSkillSet;
|
|
60
61
|
readonly tools?: readonly ToolDefinition[];
|
|
62
|
+
/** Tools disclosure: "search" narrows the disclosed tool list (activated ∪ top-k); default "all" is unchanged. */
|
|
63
|
+
readonly toolsDisclosure?: ToolsDisclosure;
|
|
64
|
+
readonly toolsSearch?: ToolsSearchOptions;
|
|
65
|
+
/** Per-run activated names from `search_tools`; intersected at disclosure only — dispatch re-checks. */
|
|
66
|
+
readonly activatedTools?: {
|
|
67
|
+
has(name: string): boolean;
|
|
68
|
+
};
|
|
61
69
|
readonly providerOptions?: ProviderRequestOptions;
|
|
62
70
|
/** Assembler-time eviction; does not delete session store history. */
|
|
63
71
|
readonly contextBudget?: ContextBudget;
|
package/dist/input.js
CHANGED
|
@@ -6,6 +6,7 @@ import { loadTextResource } from "./resources.js";
|
|
|
6
6
|
import { skillMessages as buildSkillMessages } from "./skill-disclosure.js";
|
|
7
7
|
import { composeSystemPrompt } from "./system-prompts.js";
|
|
8
8
|
import { foldToolResultHistory, foldToolResults } from "./tool-result-fold.js";
|
|
9
|
+
import { selectDisclosedTools } from "./tool-search.js";
|
|
9
10
|
export function createDefaultInputBuilder() {
|
|
10
11
|
return {
|
|
11
12
|
name: "default-input",
|
|
@@ -120,6 +121,9 @@ export async function assembleProviderInput(options) {
|
|
|
120
121
|
let context;
|
|
121
122
|
let skills = options.skills;
|
|
122
123
|
let tools = options.tools;
|
|
124
|
+
if (options.toolsDisclosure === "search" && tools?.length) {
|
|
125
|
+
tools = selectDisclosedTools({ tools, input: options.input, search: options.toolsSearch, activated: options.activatedTools });
|
|
126
|
+
}
|
|
123
127
|
let demotedSkillBodies;
|
|
124
128
|
let budgetReport;
|
|
125
129
|
if (options.contextBudget) {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { Agent, AgentDefinitionResolutionContext,
|
|
1
|
+
import type { Agent, AgentDefinitionResolutionContext, DiscoveredContribution, ProviderResolver } from "../contracts.js";
|
|
2
2
|
import type { PermissionPolicy, TrustPolicy } from "../security.js";
|
|
3
3
|
/** Options for {@link resolveAgentBundle}. */
|
|
4
4
|
export interface ResolveAgentBundleOptions {
|
|
@@ -89,10 +89,3 @@ export declare function discoverAgentBundles(options: DiscoverAgentBundlesOption
|
|
|
89
89
|
* most once per call; resolution is one-shot, so no cross-call cache is kept
|
|
90
90
|
* (ponytail: add memoization only if a host resolves the same bundle repeatedly). */
|
|
91
91
|
export declare function resolveAgentBundle(bundle: AgentBundle, options: ResolveAgentBundleOptions): Promise<Agent>;
|
|
92
|
-
/** Parse a `CONTEXT.md` into a static {@link ContextProvider}. The markdown
|
|
93
|
-
* body becomes the context block content; frontmatter `name` overrides the
|
|
94
|
-
* directory name. */
|
|
95
|
-
export declare function parseContextFile(text: string, path: string): ContextProvider;
|
|
96
|
-
/** Parse a `TOOL.md` into a descriptor-only {@link ToolDefinition}. The
|
|
97
|
-
* executable behavior is host-owned; calling `execute` throws. */
|
|
98
|
-
export declare function parseToolFile(text: string, path: string): ToolDefinition;
|
|
@@ -358,38 +358,4 @@ function parentDirName(path) {
|
|
|
358
358
|
const parts = path.split(/[/\\]+/).filter(Boolean);
|
|
359
359
|
return parts.length >= 2 ? parts[parts.length - 2] : (parts[parts.length - 1] ?? "");
|
|
360
360
|
}
|
|
361
|
-
/** Parse a `CONTEXT.md` into a static {@link ContextProvider}. The markdown
|
|
362
|
-
* body becomes the context block content; frontmatter `name` overrides the
|
|
363
|
-
* directory name. */
|
|
364
|
-
export function parseContextFile(text, path) {
|
|
365
|
-
const { front, body } = splitFrontmatter(text, path);
|
|
366
|
-
const rawName = String(front.get("name") ?? "").trim() || parentDirName(path);
|
|
367
|
-
if (!NAME_RE.test(rawName)) {
|
|
368
|
-
throw new Error(`Invalid context provider name in ${path}: ${JSON.stringify(rawName)}`);
|
|
369
|
-
}
|
|
370
|
-
const name = rawName.replace(/\s+/g, "-");
|
|
371
|
-
const title = String(front.get("title") ?? name);
|
|
372
|
-
return {
|
|
373
|
-
name,
|
|
374
|
-
resolve: () => [{ title, content: body.replace(/^\n+/, "").trimEnd() }],
|
|
375
|
-
};
|
|
376
|
-
}
|
|
377
|
-
/** Parse a `TOOL.md` into a descriptor-only {@link ToolDefinition}. The
|
|
378
|
-
* executable behavior is host-owned; calling `execute` throws. */
|
|
379
|
-
export function parseToolFile(text, path) {
|
|
380
|
-
const { front, body } = splitFrontmatter(text, path);
|
|
381
|
-
const rawName = String(front.get("name") ?? "").trim() || parentDirName(path);
|
|
382
|
-
if (!NAME_RE.test(rawName)) {
|
|
383
|
-
throw new Error(`Invalid tool name in ${path}: ${JSON.stringify(rawName)}`);
|
|
384
|
-
}
|
|
385
|
-
const name = rawName.replace(/\s+/g, "-");
|
|
386
|
-
const description = String(front.get("description") ?? "").trim() || body.replace(/^\n+/, "").slice(0, 80).trim();
|
|
387
|
-
return {
|
|
388
|
-
name,
|
|
389
|
-
...(description ? { description } : {}),
|
|
390
|
-
execute: () => {
|
|
391
|
-
throw new Error(`Discovered tool ${name} requires host execution`);
|
|
392
|
-
},
|
|
393
|
-
};
|
|
394
|
-
}
|
|
395
361
|
//# sourceMappingURL=agent-definitions.js.map
|
package/dist/node/settings.d.ts
CHANGED
|
@@ -2,6 +2,5 @@ import { type ConfigLayer } from "../config.js";
|
|
|
2
2
|
import type { SettingsProvider } from "../contracts.js";
|
|
3
3
|
import { type NodeConfigFile } from "./config.js";
|
|
4
4
|
export type NodeSettingsFile = NodeConfigFile;
|
|
5
|
-
export declare function defaultUserSettingsPath(appName?: string): string;
|
|
6
5
|
export declare function readSettingsFile(path: string): Promise<ConfigLayer["config"]>;
|
|
7
6
|
export declare function loadSettingsFiles(files: readonly NodeSettingsFile[]): Promise<SettingsProvider>;
|
package/dist/node/settings.js
CHANGED
|
@@ -1,11 +1,6 @@
|
|
|
1
|
-
import { homedir } from "node:os";
|
|
2
|
-
import { join } from "node:path";
|
|
3
1
|
import { mergeConfigLayers } from "../config.js";
|
|
4
2
|
import { createStaticSettingsProvider } from "../settings.js";
|
|
5
3
|
import { isNodeErrorCode, readConfigFile } from "./config.js";
|
|
6
|
-
export function defaultUserSettingsPath(appName = "prism") {
|
|
7
|
-
return join(homedir(), ".config", appName, "settings.json");
|
|
8
|
-
}
|
|
9
4
|
export function readSettingsFile(path) {
|
|
10
5
|
return readConfigFile(path);
|
|
11
6
|
}
|
package/dist/pinned-fetch.js
CHANGED
|
@@ -99,7 +99,11 @@ export async function requestPinned(url, address, init, errorPrefix = "Request")
|
|
|
99
99
|
const nodeRequest = request(url, {
|
|
100
100
|
method,
|
|
101
101
|
headers: Object.fromEntries(headers.entries()),
|
|
102
|
-
|
|
102
|
+
// NOTE: the caller signal is NOT passed as the http.request `signal` option:
|
|
103
|
+
// Node's internal abort wiring destroys the (possibly keep-alive, already
|
|
104
|
+
// completed) socket with the abort reason, surfacing it as an unhandled
|
|
105
|
+
// socket 'error' when the response resolved and nothing listens anymore.
|
|
106
|
+
// Abort is handled manually below with a reason-less destroy.
|
|
103
107
|
lookup: ((_hostname, options, callback) => {
|
|
104
108
|
if (options.all)
|
|
105
109
|
callback(null, [{ address: address.address, family: address.family }]);
|
|
@@ -132,8 +136,13 @@ export async function requestPinned(url, address, init, errorPrefix = "Request")
|
|
|
132
136
|
controller.error(error);
|
|
133
137
|
}
|
|
134
138
|
},
|
|
135
|
-
cancel(
|
|
136
|
-
|
|
139
|
+
cancel() {
|
|
140
|
+
// Destroy WITHOUT the abort reason: once the response resolved,
|
|
141
|
+
// nothing listens on the socket, and propagate-destroy(reason)
|
|
142
|
+
// surfaces the DOMException as an unhandled socket 'error'
|
|
143
|
+
// (SDK transports abort their controller on close()). Readers
|
|
144
|
+
// that still pull observe EOF via the iterator.
|
|
145
|
+
incoming.destroy();
|
|
137
146
|
},
|
|
138
147
|
});
|
|
139
148
|
resolve(new Response(stream, {
|
|
@@ -143,12 +152,29 @@ export async function requestPinned(url, address, init, errorPrefix = "Request")
|
|
|
143
152
|
}));
|
|
144
153
|
});
|
|
145
154
|
nodeRequest.on("error", reject);
|
|
155
|
+
if (init?.signal) {
|
|
156
|
+
const signal = init.signal;
|
|
157
|
+
if (signal.aborted) {
|
|
158
|
+
reject(abortReason(signal));
|
|
159
|
+
nodeRequest.destroy();
|
|
160
|
+
}
|
|
161
|
+
else {
|
|
162
|
+
signal.addEventListener("abort", () => {
|
|
163
|
+
nodeRequest.destroy();
|
|
164
|
+
reject(abortReason(signal));
|
|
165
|
+
}, { once: true });
|
|
166
|
+
}
|
|
167
|
+
}
|
|
146
168
|
if (body)
|
|
147
169
|
nodeRequest.end(body);
|
|
148
170
|
else
|
|
149
171
|
nodeRequest.end();
|
|
150
172
|
});
|
|
151
173
|
}
|
|
174
|
+
function abortReason(signal) {
|
|
175
|
+
const reason = signal.reason;
|
|
176
|
+
return reason instanceof Error ? reason : new Error(String(reason));
|
|
177
|
+
}
|
|
152
178
|
async function requestBody(body, errorPrefix) {
|
|
153
179
|
if (body === undefined || body === null)
|
|
154
180
|
return undefined;
|
package/dist/provider-events.js
CHANGED
|
@@ -27,10 +27,9 @@ export function reconstructToolCallDeltas(events) {
|
|
|
27
27
|
if (event.type !== "tool_call_delta")
|
|
28
28
|
continue;
|
|
29
29
|
const partial = partials.get(event.index) ?? { argumentsText: "" };
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
partial.name = event.name;
|
|
30
|
+
// Conformant OpenAI-compatible providers repeat identity as null on continuation chunks; coalesce like openai-compatible.js instead of clobbering.
|
|
31
|
+
partial.id = event.id ?? partial.id;
|
|
32
|
+
partial.name = event.name ?? partial.name;
|
|
34
33
|
if (event.argumentsText !== undefined)
|
|
35
34
|
partial.argumentsText += event.argumentsText;
|
|
36
35
|
partials.set(event.index, partial);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type MediaContentBlock, type ModelInputCapability, type ResolvedMediaContent, type ResolveMediaContentOptions } from "../content.js";
|
|
2
|
-
import type {
|
|
2
|
+
import type { ContentBlock, JsonObject, Message, ModelCapabilities, ModelConfig } from "../contracts.js";
|
|
3
3
|
/** Default upload-cache entry cap per provider media session. */
|
|
4
4
|
export declare const DEFAULT_PROVIDER_UPLOAD_CACHE_ENTRIES = 32;
|
|
5
5
|
/** Inline OpenAI file_data ceiling before preferring Files API upload. */
|
|
@@ -37,7 +37,6 @@ export declare function serializePdfDocumentWireBlock(options: {
|
|
|
37
37
|
readonly data: string;
|
|
38
38
|
readonly title?: string;
|
|
39
39
|
}): JsonObject;
|
|
40
|
-
export declare function resolveProviderMediaBlock(block: AudioContent | FileContent | DocumentContent, options?: ResolveMediaContentOptions): Promise<ResolvedMediaContent>;
|
|
41
40
|
/** Resolve every media block once and enforce aggregate request bounds before provider I/O. */
|
|
42
41
|
export declare function resolveProviderMediaMessages(messages: readonly Message[], model: ModelConfig, options?: ResolveMediaContentOptions): Promise<ReadonlyMap<MediaContentBlock, ResolvedMediaContent>>;
|
|
43
42
|
export declare function defaultProviderFilename(block: MediaContentBlock, fallback: string): string;
|
package/dist/providers/media.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { createHash } from "node:crypto";
|
|
2
|
-
import { assertMessagesSupportModelCapabilities, contentBlockInputModality, DEFAULT_MAX_MEDIA_ITEM_BYTES,
|
|
2
|
+
import { assertMessagesSupportModelCapabilities, contentBlockInputModality, DEFAULT_MAX_MEDIA_ITEM_BYTES, resolveMediaContentBlocks, UnsupportedModalityError, } from "../content.js";
|
|
3
3
|
/** Default upload-cache entry cap per provider media session. */
|
|
4
4
|
export const DEFAULT_PROVIDER_UPLOAD_CACHE_ENTRIES = 32;
|
|
5
5
|
/** Inline OpenAI file_data ceiling before preferring Files API upload. */
|
|
@@ -93,9 +93,6 @@ export function serializePdfDocumentWireBlock(options) {
|
|
|
93
93
|
...(options.title ? { title: options.title } : {}),
|
|
94
94
|
};
|
|
95
95
|
}
|
|
96
|
-
export async function resolveProviderMediaBlock(block, options = {}) {
|
|
97
|
-
return resolveMediaContentBlock(block, options);
|
|
98
|
-
}
|
|
99
96
|
/** Resolve every media block once and enforce aggregate request bounds before provider I/O. */
|
|
100
97
|
export async function resolveProviderMediaMessages(messages, model, options = {}) {
|
|
101
98
|
assertMessagesSupportModelCapabilities(model, messages);
|