@arnilo/prism 0.6.0 → 0.8.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 +79 -5
- package/README.md +12 -11
- package/dist/agent-approval.d.ts +4 -0
- package/dist/agent-approval.js +5 -1
- package/dist/agent-definitions.js +1 -0
- package/dist/agent-run-lifecycle.js +39 -4
- package/dist/agent-run-state.d.ts +18 -0
- package/dist/agent-run-state.js +39 -9
- package/dist/agent-session/helpers.js +6 -1
- package/dist/agent-session/session/assemble.js +159 -7
- package/dist/agent-session/session/persist.d.ts +16 -0
- package/dist/agent-session/session/persist.js +64 -4
- package/dist/agent-session/session/provider-round.d.ts +3 -3
- package/dist/agent-session/session/provider-round.js +12 -6
- package/dist/agent-session/session/tool-round.js +5 -1
- package/dist/agent-session/session/types.d.ts +22 -1
- package/dist/agent-session/session.d.ts +16 -0
- package/dist/agent-session/session.js +42 -3
- package/dist/artifacts.d.ts +39 -1
- package/dist/artifacts.js +73 -0
- package/dist/attention-compiler.d.ts +121 -0
- package/dist/attention-compiler.js +479 -0
- package/dist/checkpoints.js +7 -11
- package/dist/cli-init.js +20 -6
- package/dist/context-budget.d.ts +20 -1
- package/dist/context-budget.js +10 -1
- package/dist/contracts-core/agent.d.ts +7 -0
- package/dist/contracts-core/attention.d.ts +66 -0
- package/dist/contracts-core/attention.js +2 -0
- package/dist/contracts-core/compaction.d.ts +59 -0
- package/dist/contracts-core/compaction.js +77 -1
- package/dist/contracts-core/content.d.ts +5 -0
- package/dist/contracts-core/loop.d.ts +42 -0
- package/dist/contracts-core/provider.d.ts +4 -0
- package/dist/contracts-core/run-limits.d.ts +2 -0
- package/dist/contracts-core.d.ts +1 -0
- package/dist/contracts-core.js +1 -0
- package/dist/contracts-protocol.d.ts +44 -3
- package/dist/contracts-run-state.d.ts +32 -5
- package/dist/evidence-grounding.d.ts +29 -0
- package/dist/evidence-grounding.js +162 -0
- package/dist/host-composition.d.ts +91 -0
- package/dist/host-composition.js +279 -0
- package/dist/index.d.ts +13 -6
- package/dist/index.js +7 -4
- package/dist/input.d.ts +13 -1
- package/dist/input.js +40 -1
- package/dist/provider-events.d.ts +3 -1
- package/dist/provider-events.js +2 -2
- package/dist/providers/transport.d.ts +3 -1
- package/dist/providers/transport.js +36 -0
- package/dist/redaction.js +18 -2
- package/dist/run-bundle.d.ts +89 -0
- package/dist/run-bundle.js +149 -0
- package/dist/secure-agent.d.ts +2 -0
- package/dist/secure-agent.js +6 -1
- package/dist/testing/state-concurrency-conformance.js +5 -12
- package/dist/tool-result-fold.d.ts +12 -0
- package/dist/tool-result-fold.js +13 -6
- package/dist/tools.d.ts +10 -0
- package/dist/tools.js +41 -0
- package/docs/acp-agent.md +42 -11
- package/docs/acp.md +2 -1
- package/docs/ag-ui.md +10 -3
- package/docs/agent-definitions.md +9 -1
- package/docs/agent-events.md +4 -1
- package/docs/agent-loops.md +33 -0
- package/docs/agent-session-runtime.md +8 -7
- package/docs/attention-compiler.md +272 -0
- package/docs/cli-rpc.md +4 -2
- package/docs/coding-agent-tools.md +1 -1
- package/docs/coding-security.md +6 -3
- package/docs/coding-tools.md +0 -1
- package/docs/coding-workspaces.md +22 -0
- package/docs/compaction-and-retry.md +36 -4
- package/docs/compaction-observational-memory.md +63 -10
- package/docs/connected-apps.md +116 -0
- package/docs/context-and-skills.md +17 -2
- package/docs/conversations.md +1 -1
- package/docs/core.md +1 -1
- package/docs/dev-inspector.md +4 -0
- package/docs/device-adapters.md +1 -0
- package/docs/diagrams.md +6 -6
- package/docs/document-reader.md +18 -10
- package/docs/documents.md +40 -11
- package/docs/durable-runs.md +87 -0
- package/docs/enterprise-postgres-state.md +6 -2
- package/docs/evaluations.md +168 -4
- package/docs/execution-timeline.md +186 -0
- package/docs/guardrails.md +33 -0
- package/docs/history/0.7.0-primitive-review.md +254 -0
- package/docs/history/079-messaging-primitive-review.md +391 -0
- package/docs/history/080-messaging-followon-primitive-review.md +234 -0
- package/docs/history/081-connected-apps-primitive-review.md +74 -0
- package/docs/history/083-prism-work-primitive-review.md +84 -0
- package/docs/history/084-primitive-review.md +96 -0
- package/docs/history/085-honesty-and-cut-primitive-review.md +91 -0
- package/docs/history/README.md +5 -0
- package/docs/history/migration-0.0.md +2 -2
- package/docs/history/release-handoffs.md +75 -1
- package/docs/host-compositions.md +149 -0
- package/docs/host-security.md +2 -2
- package/docs/hosted-sandboxes.md +94 -0
- package/docs/index.md +82 -45
- package/docs/input-and-prompt-assembly.md +1 -0
- package/docs/knowledge-sync.md +84 -0
- package/docs/language-intelligence.md +1 -1
- package/docs/live-testing.md +8 -3
- package/docs/mcp-tools.md +3 -1
- package/docs/memory-fabric.md +416 -0
- package/docs/messaging-channel-operations.md +166 -0
- package/docs/messaging-channels.md +150 -0
- package/docs/migrate-to-0.5.md +1 -1
- package/docs/migrate-to-0.6.md +1 -0
- package/docs/migrate-to-0.7.md +345 -0
- package/docs/migrate-to-0.8.md +124 -0
- package/docs/migration.md +43 -1
- package/docs/model-registry.md +12 -2
- package/docs/model-routing.md +79 -4
- package/docs/multi-agent-patterns.md +20 -6
- package/docs/observability.md +52 -1
- package/docs/openapi-tools.md +1 -1
- package/docs/operations.md +14 -4
- package/docs/options-index.md +47 -3
- package/docs/peer-dependencies.md +12 -10
- package/docs/postgres-persistence.md +1 -1
- package/docs/process-sessions.md +3 -1
- package/docs/prompt-registry.md +1 -1
- package/docs/provider-caching.md +4 -2
- package/docs/provider-conformance.md +1 -1
- package/docs/provider-layer.md +2 -2
- package/docs/provider-packages.md +22 -22
- package/docs/providers/bedrock.md +71 -7
- package/docs/providers/neuralwatt.md +5 -1
- package/docs/providers/openai.md +1 -1
- package/docs/rag.md +24 -8
- package/docs/realtime-voice.md +87 -0
- package/docs/release-and-install.md +53 -45
- package/docs/run-bundle.md +92 -0
- package/docs/runs-and-usage.md +17 -2
- package/docs/server.md +7 -3
- package/docs/sheets.md +9 -9
- package/docs/signal-channel.md +112 -0
- package/docs/speech.md +7 -1
- package/docs/sqlite-persistence.md +1 -1
- package/docs/supervisors.md +33 -5
- package/docs/telegram-channel.md +157 -0
- package/docs/testing.md +2 -2
- package/docs/thinking-and-reasoning.md +3 -1
- package/docs/tools.md +6 -5
- package/docs/web-tools.md +2 -1
- package/docs/wiki.md +1 -1
- package/docs/work-artifacts-and-review.md +14 -4
- package/docs/work-connectors.md +12 -10
- package/docs/work-sandbox.md +115 -0
- package/docs/work-tools.md +50 -18
- package/docs/workflows.md +69 -1
- package/docs/working-and-semantic-memory.md +25 -14
- package/package.json +5 -3
- package/templates/README.md +2 -0
- package/templates/business-worker/README.md.tmpl +19 -0
- package/templates/business-worker/env.example.tmpl +1 -0
- package/templates/business-worker/gitignore.tmpl +11 -0
- package/templates/business-worker/manifest.json +12 -0
- package/templates/business-worker/package.json.tmpl +23 -0
- package/templates/business-worker/src/agent.ts.tmpl +92 -0
- package/templates/business-worker/src/index.ts.tmpl +13 -0
- package/templates/business-worker/src/tests/agent.test.ts.tmpl +77 -0
- package/templates/business-worker/tsconfig.json.tmpl +15 -0
- package/templates/personal-assistant/README.md.tmpl +18 -0
- package/templates/personal-assistant/env.example.tmpl +1 -0
- package/templates/personal-assistant/gitignore.tmpl +11 -0
- package/templates/personal-assistant/manifest.json +11 -0
- package/templates/personal-assistant/package.json.tmpl +23 -0
- package/templates/personal-assistant/src/agent.ts.tmpl +65 -0
- package/templates/personal-assistant/src/index.ts.tmpl +13 -0
- package/templates/personal-assistant/src/tests/agent.test.ts.tmpl +28 -0
- package/templates/personal-assistant/tsconfig.json.tmpl +15 -0
|
@@ -0,0 +1,162 @@
|
|
|
1
|
+
const MAX_EVIDENCE_FIGURES = 4096;
|
|
2
|
+
const MAX_EVIDENCE_DEPTH = 16;
|
|
3
|
+
const MAX_EVIDENCE_NODES = 16 * 1024;
|
|
4
|
+
const MAX_EVIDENCE_TEXT_CHARS = 128 * 1024;
|
|
5
|
+
const MAX_CLAIM_CHARS = 128;
|
|
6
|
+
const MAX_CITATION_DISTANCE = 96;
|
|
7
|
+
const EVIDENCE_CITATION = /\[evidence:([a-zA-Z0-9._:-]{1,128})\]/g;
|
|
8
|
+
const NUMERIC_CLAIM = /(?<![\p{L}\p{N}_])~?[$€£¥]?[-+]?(?:\d{1,3}(?:,\d{3})+|\d+)(?:\.\d+)?[kKmMbB]?%?(?![\p{L}\p{N}_])/gu;
|
|
9
|
+
/**
|
|
10
|
+
* Deterministic output guardrail for figures that must be grounded in same-run tool results
|
|
11
|
+
* or host-governed evidence. It never calls a provider, store, or extractor asynchronously.
|
|
12
|
+
*/
|
|
13
|
+
export function createClaimGroundingGuardrail(options) {
|
|
14
|
+
const resolved = resolveOptions(options);
|
|
15
|
+
return {
|
|
16
|
+
name: "claim-grounding",
|
|
17
|
+
stage: "output",
|
|
18
|
+
revision: "1",
|
|
19
|
+
evaluate(context) {
|
|
20
|
+
if (!resolved.requireEvidenceForNumbers)
|
|
21
|
+
return { action: "allow" };
|
|
22
|
+
const figures = evidenceFigures(resolved.evidenceSources, context);
|
|
23
|
+
const refs = new Set(figures.flatMap((figure) => (figure.ref === undefined ? [] : [figure.ref])));
|
|
24
|
+
for (const claim of outputClaims(context.value.content)) {
|
|
25
|
+
const block = context.value.content[claim.contentIndex];
|
|
26
|
+
if (matchesEvidence(claim, figures, resolved.tolerance) || (block?.type === "text" && citesEvidence(block.text, claim.end, refs)))
|
|
27
|
+
continue;
|
|
28
|
+
const metadata = {
|
|
29
|
+
violation: true,
|
|
30
|
+
claim: claim.text.slice(0, MAX_CLAIM_CHARS),
|
|
31
|
+
contentIndex: claim.contentIndex,
|
|
32
|
+
start: claim.end - claim.text.length,
|
|
33
|
+
end: claim.end,
|
|
34
|
+
};
|
|
35
|
+
return resolved.onViolation === "block"
|
|
36
|
+
? { action: "block", reason: "claim_ungrounded", metadata }
|
|
37
|
+
: { action: "allow", reason: "claim_ungrounded", metadata };
|
|
38
|
+
}
|
|
39
|
+
return { action: "allow" };
|
|
40
|
+
},
|
|
41
|
+
};
|
|
42
|
+
}
|
|
43
|
+
function resolveOptions(options) {
|
|
44
|
+
if (!options || typeof options.requireEvidenceForNumbers !== "boolean")
|
|
45
|
+
throw new TypeError("Claim grounding requireEvidenceForNumbers must be boolean");
|
|
46
|
+
const evidenceSources = options.evidenceSources ?? "tool_results";
|
|
47
|
+
if (evidenceSources !== "tool_results" && typeof evidenceSources !== "function")
|
|
48
|
+
throw new TypeError('Claim grounding evidenceSources must be "tool_results" or an extractor');
|
|
49
|
+
const onViolation = options.onViolation ?? "block";
|
|
50
|
+
if (onViolation !== "block" && onViolation !== "flag")
|
|
51
|
+
throw new TypeError('Claim grounding onViolation must be "block" or "flag"');
|
|
52
|
+
const tolerance = options.tolerance ?? "exact";
|
|
53
|
+
if (tolerance !== "exact" && tolerance !== "rounded")
|
|
54
|
+
throw new TypeError('Claim grounding tolerance must be "exact" or "rounded"');
|
|
55
|
+
return { requireEvidenceForNumbers: options.requireEvidenceForNumbers, evidenceSources, onViolation, tolerance };
|
|
56
|
+
}
|
|
57
|
+
function evidenceFigures(source, context) {
|
|
58
|
+
if (source !== "tool_results")
|
|
59
|
+
return source({
|
|
60
|
+
sessionId: context.sessionId,
|
|
61
|
+
runId: context.runId,
|
|
62
|
+
metadata: context.metadata,
|
|
63
|
+
toolResults: context.toolResults ?? [],
|
|
64
|
+
})
|
|
65
|
+
.filter(validFigure)
|
|
66
|
+
.slice(0, MAX_EVIDENCE_FIGURES);
|
|
67
|
+
const figures = [];
|
|
68
|
+
const budget = { chars: MAX_EVIDENCE_TEXT_CHARS, nodes: MAX_EVIDENCE_NODES };
|
|
69
|
+
for (const result of context.toolResults ?? []) {
|
|
70
|
+
if (result.error)
|
|
71
|
+
continue;
|
|
72
|
+
const ref = `tool:${result.toolCallId}`;
|
|
73
|
+
collectFigures(result.value, figures, ref, new WeakSet(), 0, budget);
|
|
74
|
+
for (const block of result.content ?? [])
|
|
75
|
+
if (block.type === "text")
|
|
76
|
+
collectTextFigures(block.text, figures, ref, budget);
|
|
77
|
+
}
|
|
78
|
+
return figures;
|
|
79
|
+
}
|
|
80
|
+
function validFigure(value) {
|
|
81
|
+
return typeof value?.value === "number" && Number.isFinite(value.value) && (value.ref === undefined || citationRef(value.ref));
|
|
82
|
+
}
|
|
83
|
+
function collectFigures(value, figures, ref, seen = new WeakSet(), depth = 0, budget = { chars: MAX_EVIDENCE_TEXT_CHARS, nodes: MAX_EVIDENCE_NODES }) {
|
|
84
|
+
if (figures.length >= MAX_EVIDENCE_FIGURES || depth > MAX_EVIDENCE_DEPTH || budget.nodes-- < 1)
|
|
85
|
+
return;
|
|
86
|
+
if (typeof value === "number") {
|
|
87
|
+
if (Number.isFinite(value))
|
|
88
|
+
figures.push({ value, ref });
|
|
89
|
+
return;
|
|
90
|
+
}
|
|
91
|
+
if (typeof value === "string") {
|
|
92
|
+
collectTextFigures(value, figures, ref, budget);
|
|
93
|
+
return;
|
|
94
|
+
}
|
|
95
|
+
if (!value || typeof value !== "object" || seen.has(value))
|
|
96
|
+
return;
|
|
97
|
+
seen.add(value);
|
|
98
|
+
if (Array.isArray(value)) {
|
|
99
|
+
for (const item of value)
|
|
100
|
+
collectFigures(item, figures, ref, seen, depth + 1, budget);
|
|
101
|
+
return;
|
|
102
|
+
}
|
|
103
|
+
for (const item of Object.values(value))
|
|
104
|
+
collectFigures(item, figures, ref, seen, depth + 1, budget);
|
|
105
|
+
}
|
|
106
|
+
function collectTextFigures(text, figures, ref, budget) {
|
|
107
|
+
const bounded = text.slice(0, budget.chars);
|
|
108
|
+
budget.chars -= bounded.length;
|
|
109
|
+
for (const claim of claims(bounded, 0)) {
|
|
110
|
+
if (figures.length >= MAX_EVIDENCE_FIGURES)
|
|
111
|
+
return;
|
|
112
|
+
figures.push({ value: claim.value, ref });
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
function outputClaims(content) {
|
|
116
|
+
const out = [];
|
|
117
|
+
for (let index = 0; index < content.length; index += 1) {
|
|
118
|
+
const block = content[index];
|
|
119
|
+
if (block?.type !== "text")
|
|
120
|
+
continue;
|
|
121
|
+
out.push(...claims(block.text, index));
|
|
122
|
+
}
|
|
123
|
+
return out;
|
|
124
|
+
}
|
|
125
|
+
function claims(text, contentIndex) {
|
|
126
|
+
const out = [];
|
|
127
|
+
NUMERIC_CLAIM.lastIndex = 0;
|
|
128
|
+
for (let match = NUMERIC_CLAIM.exec(text); match; match = NUMERIC_CLAIM.exec(text)) {
|
|
129
|
+
const token = match[0];
|
|
130
|
+
const parsed = parseNumber(token);
|
|
131
|
+
if (parsed === undefined)
|
|
132
|
+
continue;
|
|
133
|
+
out.push({ text: token, value: parsed.value, tolerance: parsed.tolerance, end: match.index + token.length, contentIndex });
|
|
134
|
+
}
|
|
135
|
+
return out;
|
|
136
|
+
}
|
|
137
|
+
function parseNumber(token) {
|
|
138
|
+
const compact = token.replace(/^~?[$€£¥]?[-+]?/, "").replace(/%$/, "");
|
|
139
|
+
const suffix = compact.at(-1)?.toLowerCase();
|
|
140
|
+
const multiplier = suffix === "k" ? 1_000 : suffix === "m" ? 1_000_000 : suffix === "b" ? 1_000_000_000 : 1;
|
|
141
|
+
const numberText = (multiplier === 1 ? compact : compact.slice(0, -1)).replace(/,/g, "");
|
|
142
|
+
const value = Number(numberText) * multiplier;
|
|
143
|
+
if (!Number.isFinite(value))
|
|
144
|
+
return undefined;
|
|
145
|
+
const fraction = numberText.split(".")[1]?.length ?? 0;
|
|
146
|
+
return { value, tolerance: 0.5 * multiplier * 10 ** -fraction };
|
|
147
|
+
}
|
|
148
|
+
function matchesEvidence(claim, figures, tolerance) {
|
|
149
|
+
return figures.some((figure) => Math.abs(figure.value - claim.value) <= (tolerance === "rounded" ? claim.tolerance : 0));
|
|
150
|
+
}
|
|
151
|
+
function citesEvidence(text, end, refs) {
|
|
152
|
+
const nearby = text.slice(end, end + MAX_CITATION_DISTANCE);
|
|
153
|
+
EVIDENCE_CITATION.lastIndex = 0;
|
|
154
|
+
for (let match = EVIDENCE_CITATION.exec(nearby); match; match = EVIDENCE_CITATION.exec(nearby))
|
|
155
|
+
if (refs.has(match[1] ?? ""))
|
|
156
|
+
return true;
|
|
157
|
+
return false;
|
|
158
|
+
}
|
|
159
|
+
function citationRef(value) {
|
|
160
|
+
return /^[a-zA-Z0-9._:-]{1,128}$/.test(value);
|
|
161
|
+
}
|
|
162
|
+
//# sourceMappingURL=evidence-grounding.js.map
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
import type { Agent, AgentConfig, CheckpointStore, SecureAgentOptions, SessionStore } from "./contracts.js";
|
|
2
|
+
import type { SecretRedactor } from "./redaction.js";
|
|
3
|
+
export type HostCompositionProfile = "personal" | "local-personal" | "business" | "business-worker" | "multi-tenant-worker";
|
|
4
|
+
export declare class HostCompositionError extends Error {
|
|
5
|
+
readonly code: string;
|
|
6
|
+
constructor(message: string, code?: string);
|
|
7
|
+
}
|
|
8
|
+
export interface HostCompositionGovernance {
|
|
9
|
+
readonly modelRouter?: unknown;
|
|
10
|
+
readonly budgetPolicy?: unknown;
|
|
11
|
+
readonly rateLimitPolicy?: unknown;
|
|
12
|
+
readonly supported?: boolean;
|
|
13
|
+
readonly [key: string]: unknown;
|
|
14
|
+
}
|
|
15
|
+
export interface HostCompositionOptions {
|
|
16
|
+
readonly profile?: HostCompositionProfile;
|
|
17
|
+
readonly agent?: Agent | AgentConfig | SecureAgentOptions | Partial<AgentConfig>;
|
|
18
|
+
readonly store?: SessionStore | CheckpointStore | {
|
|
19
|
+
readonly kind?: string;
|
|
20
|
+
readonly durable?: boolean;
|
|
21
|
+
[key: string]: unknown;
|
|
22
|
+
};
|
|
23
|
+
readonly checkpoints?: CheckpointStore;
|
|
24
|
+
readonly workspaceRoot?: string;
|
|
25
|
+
readonly sandboxRoots?: readonly string[];
|
|
26
|
+
readonly credentialRefs?: readonly string[];
|
|
27
|
+
readonly connectedApps?: {
|
|
28
|
+
readonly appIds: readonly string[];
|
|
29
|
+
readonly serverIds: readonly string[];
|
|
30
|
+
};
|
|
31
|
+
readonly governance?: HostCompositionGovernance;
|
|
32
|
+
readonly redactor?: SecretRedactor;
|
|
33
|
+
/** Explicit opt-in for live network checks; inert by default. */
|
|
34
|
+
readonly liveChecks?: boolean;
|
|
35
|
+
}
|
|
36
|
+
export interface HostCompositionToolReport {
|
|
37
|
+
readonly name: string;
|
|
38
|
+
readonly description?: string;
|
|
39
|
+
readonly hasParameters: boolean;
|
|
40
|
+
}
|
|
41
|
+
export interface HostCompositionReport {
|
|
42
|
+
readonly profile: "personal" | "business";
|
|
43
|
+
readonly effectiveTools: readonly HostCompositionToolReport[];
|
|
44
|
+
readonly credentialReferences: readonly string[];
|
|
45
|
+
readonly connectedApps?: {
|
|
46
|
+
readonly appIds: readonly string[];
|
|
47
|
+
readonly serverIds: readonly string[];
|
|
48
|
+
};
|
|
49
|
+
readonly ownership: {
|
|
50
|
+
readonly tenantId?: string;
|
|
51
|
+
readonly accountId?: string;
|
|
52
|
+
readonly userId?: string;
|
|
53
|
+
};
|
|
54
|
+
readonly storage: {
|
|
55
|
+
readonly kind: string;
|
|
56
|
+
readonly durable: boolean;
|
|
57
|
+
};
|
|
58
|
+
readonly sandbox: {
|
|
59
|
+
readonly workspaceRoot?: string;
|
|
60
|
+
readonly roots: readonly string[];
|
|
61
|
+
readonly isolated: boolean;
|
|
62
|
+
};
|
|
63
|
+
readonly governance: {
|
|
64
|
+
readonly permission: boolean;
|
|
65
|
+
readonly trust: boolean;
|
|
66
|
+
readonly redactor: boolean;
|
|
67
|
+
readonly validator: boolean;
|
|
68
|
+
readonly modelRouting: boolean;
|
|
69
|
+
readonly secure: boolean;
|
|
70
|
+
};
|
|
71
|
+
readonly readiness: {
|
|
72
|
+
readonly ok: boolean;
|
|
73
|
+
readonly errors: readonly string[];
|
|
74
|
+
readonly warnings: readonly string[];
|
|
75
|
+
};
|
|
76
|
+
}
|
|
77
|
+
/** Classifies a store by declared kind/durability and constructor name — never reads contents or connection strings (plan 084 Task 4 reuses it for run-bundle snapshots). */
|
|
78
|
+
export declare function describeStorage(store: unknown, checkpoints: unknown): {
|
|
79
|
+
kind: string;
|
|
80
|
+
durable: boolean;
|
|
81
|
+
};
|
|
82
|
+
/**
|
|
83
|
+
* Inspects a host composition in an inert, bounded, and secret-redacting manner.
|
|
84
|
+
* Performs zero network calls by default.
|
|
85
|
+
*/
|
|
86
|
+
export declare function inspectHostComposition(options: HostCompositionOptions): HostCompositionReport;
|
|
87
|
+
/**
|
|
88
|
+
* Asserts that a host composition meets all readiness requirements for its profile.
|
|
89
|
+
* Throws HostCompositionError on failure.
|
|
90
|
+
*/
|
|
91
|
+
export declare function assertHostCompositionReadiness(options: HostCompositionOptions): HostCompositionReport;
|
|
@@ -0,0 +1,279 @@
|
|
|
1
|
+
import { isAbsolute, relative } from "node:path";
|
|
2
|
+
import { assertIdentityActive, assertIdentityMatchesOwnership } from "./identity.js";
|
|
3
|
+
export class HostCompositionError extends Error {
|
|
4
|
+
code;
|
|
5
|
+
constructor(message, code = "ERR_PRISM_HOST_COMPOSITION") {
|
|
6
|
+
super(message);
|
|
7
|
+
this.code = code;
|
|
8
|
+
this.name = "HostCompositionError";
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
function resolveAgentConfig(input) {
|
|
12
|
+
if (!input)
|
|
13
|
+
return undefined;
|
|
14
|
+
if ("config" in input && typeof input.config === "object" && input.config !== null) {
|
|
15
|
+
return input.config;
|
|
16
|
+
}
|
|
17
|
+
return input;
|
|
18
|
+
}
|
|
19
|
+
function normalizeProfile(profile) {
|
|
20
|
+
if (!profile)
|
|
21
|
+
return "personal";
|
|
22
|
+
if (profile === "business" || profile === "business-worker" || profile === "multi-tenant-worker") {
|
|
23
|
+
return "business";
|
|
24
|
+
}
|
|
25
|
+
return "personal";
|
|
26
|
+
}
|
|
27
|
+
function extractTools(toolsConfig) {
|
|
28
|
+
if (!toolsConfig)
|
|
29
|
+
return [];
|
|
30
|
+
if (Array.isArray(toolsConfig))
|
|
31
|
+
return toolsConfig;
|
|
32
|
+
if (typeof toolsConfig.list === "function") {
|
|
33
|
+
return toolsConfig.list();
|
|
34
|
+
}
|
|
35
|
+
return [];
|
|
36
|
+
}
|
|
37
|
+
function sanitizeCredentialRefs(refs = [], redactor) {
|
|
38
|
+
const sanitized = [];
|
|
39
|
+
for (const ref of refs) {
|
|
40
|
+
if (!ref || typeof ref !== "string")
|
|
41
|
+
continue;
|
|
42
|
+
const trimmed = ref.trim();
|
|
43
|
+
if (!trimmed)
|
|
44
|
+
continue;
|
|
45
|
+
// Credential references must be identifier names (env vars or vault keys), never raw secrets.
|
|
46
|
+
if (/^(?:sk-|ghp_|ey|Bearer\s+)/i.test(trimmed)) {
|
|
47
|
+
sanitized.push("[REDACTED_SECRET_VALUE]");
|
|
48
|
+
continue;
|
|
49
|
+
}
|
|
50
|
+
if (redactor && typeof redactor.redact === "function") {
|
|
51
|
+
sanitized.push(redactor.redact(trimmed));
|
|
52
|
+
}
|
|
53
|
+
else {
|
|
54
|
+
sanitized.push(trimmed);
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
return Object.freeze(sanitized);
|
|
58
|
+
}
|
|
59
|
+
const HARD_MAX_CONNECTED_APPS = 32;
|
|
60
|
+
const MAX_CONNECTED_APP_IDENTIFIER_BYTES = 128;
|
|
61
|
+
function copyConnectedApps(value) {
|
|
62
|
+
if (value === undefined)
|
|
63
|
+
return undefined;
|
|
64
|
+
if (!value || typeof value !== "object")
|
|
65
|
+
throw new HostCompositionError("Connected apps must provide identifier arrays");
|
|
66
|
+
return Object.freeze({
|
|
67
|
+
appIds: copyConnectedAppIdentifiers(value.appIds, "appIds"),
|
|
68
|
+
serverIds: copyConnectedAppIdentifiers(value.serverIds, "serverIds"),
|
|
69
|
+
});
|
|
70
|
+
}
|
|
71
|
+
function copyConnectedAppIdentifiers(value, name) {
|
|
72
|
+
if (!Array.isArray(value) || value.length > HARD_MAX_CONNECTED_APPS) {
|
|
73
|
+
throw new HostCompositionError(`Connected app ${name} must contain at most ${HARD_MAX_CONNECTED_APPS} identifiers`);
|
|
74
|
+
}
|
|
75
|
+
return Object.freeze(value.map((identifier) => {
|
|
76
|
+
if (typeof identifier !== "string" ||
|
|
77
|
+
!identifier.trim() ||
|
|
78
|
+
Buffer.byteLength(identifier, "utf8") > MAX_CONNECTED_APP_IDENTIFIER_BYTES) {
|
|
79
|
+
throw new HostCompositionError(`Connected app ${name} must contain 1..${MAX_CONNECTED_APP_IDENTIFIER_BYTES} byte identifiers`);
|
|
80
|
+
}
|
|
81
|
+
return identifier;
|
|
82
|
+
}));
|
|
83
|
+
}
|
|
84
|
+
function isContainedPath(parent, child) {
|
|
85
|
+
const rel = relative(parent, child);
|
|
86
|
+
return !rel.startsWith("..") && !isAbsolute(rel);
|
|
87
|
+
}
|
|
88
|
+
/** Classifies a store by declared kind/durability and constructor name — never reads contents or connection strings (plan 084 Task 4 reuses it for run-bundle snapshots). */
|
|
89
|
+
export function describeStorage(store, checkpoints) {
|
|
90
|
+
const target = store ?? checkpoints;
|
|
91
|
+
if (!target || typeof target !== "object") {
|
|
92
|
+
return { kind: "none", durable: false };
|
|
93
|
+
}
|
|
94
|
+
const record = target;
|
|
95
|
+
const constructorName = target.constructor?.name ?? "";
|
|
96
|
+
const declaredKind = typeof record.kind === "string" ? record.kind.toLowerCase() : "";
|
|
97
|
+
// Explicit in-memory implementations are NEVER durable.
|
|
98
|
+
if (constructorName.includes("Memory") ||
|
|
99
|
+
declaredKind.includes("memory") ||
|
|
100
|
+
record.durable === false ||
|
|
101
|
+
record.durability === "ephemeral") {
|
|
102
|
+
return { kind: declaredKind || "memory", durable: false };
|
|
103
|
+
}
|
|
104
|
+
// Postgres, SQLite, or explicitly durable stores
|
|
105
|
+
if (record.durable === true ||
|
|
106
|
+
record.durability === "durable" ||
|
|
107
|
+
constructorName.includes("Postgres") ||
|
|
108
|
+
constructorName.includes("Sqlite") ||
|
|
109
|
+
declaredKind.includes("postgres") ||
|
|
110
|
+
declaredKind.includes("sqlite")) {
|
|
111
|
+
return { kind: declaredKind || constructorName.toLowerCase() || "durable", durable: true };
|
|
112
|
+
}
|
|
113
|
+
// Any store with saveCheckpoint / appendEntry / queryEntries without explicit durable: true is in-memory
|
|
114
|
+
if (typeof record.saveCheckpoint === "function" ||
|
|
115
|
+
typeof record.appendEntry === "function" ||
|
|
116
|
+
typeof record.queryEntries === "function" ||
|
|
117
|
+
typeof record.append === "function") {
|
|
118
|
+
return { kind: declaredKind || "memory", durable: false };
|
|
119
|
+
}
|
|
120
|
+
// Unknown store without explicit durable flag is treated as non-durable memory
|
|
121
|
+
return { kind: declaredKind || "memory", durable: false };
|
|
122
|
+
}
|
|
123
|
+
/**
|
|
124
|
+
* Inspects a host composition in an inert, bounded, and secret-redacting manner.
|
|
125
|
+
* Performs zero network calls by default.
|
|
126
|
+
*/
|
|
127
|
+
export function inspectHostComposition(options) {
|
|
128
|
+
const normalizedProfile = normalizeProfile(options.profile);
|
|
129
|
+
const config = resolveAgentConfig(options.agent);
|
|
130
|
+
const redactor = options.redactor ?? config?.redactor;
|
|
131
|
+
// 1. Effective tools
|
|
132
|
+
const rawTools = extractTools(config?.tools);
|
|
133
|
+
const effectiveTools = rawTools.map((tool) => ({
|
|
134
|
+
name: tool.name,
|
|
135
|
+
description: tool.description,
|
|
136
|
+
hasParameters: Boolean(tool.parameters && Object.keys(tool.parameters).length > 0),
|
|
137
|
+
}));
|
|
138
|
+
// 2. Credential references (identifier references only, raw values redacted)
|
|
139
|
+
const credRefs = sanitizeCredentialRefs(options.credentialRefs, redactor);
|
|
140
|
+
const connectedApps = copyConnectedApps(options.connectedApps);
|
|
141
|
+
// 3. Ownership
|
|
142
|
+
const rawOwnership = config?.ownership;
|
|
143
|
+
const ownership = {
|
|
144
|
+
tenantId: typeof rawOwnership?.tenantId === "string" ? rawOwnership.tenantId.trim() : undefined,
|
|
145
|
+
accountId: typeof rawOwnership?.accountId === "string" ? rawOwnership.accountId.trim() : undefined,
|
|
146
|
+
userId: typeof rawOwnership?.userId === "string" ? rawOwnership.userId.trim() : undefined,
|
|
147
|
+
};
|
|
148
|
+
// 4. Storage durability
|
|
149
|
+
const storage = describeStorage(options.store, options.checkpoints ?? config?.runState?.checkpoints);
|
|
150
|
+
// 5. Sandbox capabilities
|
|
151
|
+
const workspaceRoot = options.workspaceRoot;
|
|
152
|
+
const sandboxRoots = options.sandboxRoots ?? [];
|
|
153
|
+
let isolated = true;
|
|
154
|
+
if (workspaceRoot && sandboxRoots.length > 0) {
|
|
155
|
+
for (const root of sandboxRoots) {
|
|
156
|
+
if (!isContainedPath(workspaceRoot, root)) {
|
|
157
|
+
isolated = false;
|
|
158
|
+
break;
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
// 6. Governance coverage
|
|
163
|
+
const hasValidator = Boolean((config && "validator" in config && typeof config.validator === "function") ||
|
|
164
|
+
(config &&
|
|
165
|
+
"toolArgumentValidator" in config &&
|
|
166
|
+
typeof config.toolArgumentValidator?.validate === "function"));
|
|
167
|
+
const isSecure = Boolean(config?.secure);
|
|
168
|
+
const governance = {
|
|
169
|
+
permission: Boolean(config?.permission && typeof config.permission.check === "function"),
|
|
170
|
+
trust: Boolean(config?.trust && typeof config.trust.check === "function"),
|
|
171
|
+
redactor: Boolean(redactor && typeof redactor.redact === "function"),
|
|
172
|
+
validator: hasValidator,
|
|
173
|
+
modelRouting: Boolean(options.governance?.modelRouter || config?.modelRouter),
|
|
174
|
+
secure: isSecure,
|
|
175
|
+
};
|
|
176
|
+
// 7. Readiness analysis
|
|
177
|
+
const errors = [];
|
|
178
|
+
const warnings = [];
|
|
179
|
+
// Required redactor check
|
|
180
|
+
if (!governance.redactor) {
|
|
181
|
+
errors.push("Missing required secret redactor");
|
|
182
|
+
}
|
|
183
|
+
// Required provider or model configuration
|
|
184
|
+
const hasProvider = Boolean(config?.provider);
|
|
185
|
+
const hasModel = Boolean(config?.model);
|
|
186
|
+
if (!hasProvider && !hasModel) {
|
|
187
|
+
errors.push("Missing required provider or model configuration");
|
|
188
|
+
}
|
|
189
|
+
// Ownership presence
|
|
190
|
+
const hasAnyOwner = Boolean(ownership.tenantId || ownership.userId || ownership.accountId);
|
|
191
|
+
if (!hasAnyOwner) {
|
|
192
|
+
errors.push("Ownership scope is required");
|
|
193
|
+
}
|
|
194
|
+
// Profile-specific readiness
|
|
195
|
+
if (normalizedProfile === "personal") {
|
|
196
|
+
if (!ownership.userId) {
|
|
197
|
+
errors.push("Personal composition requires userId in ownership");
|
|
198
|
+
}
|
|
199
|
+
if (!isolated) {
|
|
200
|
+
errors.push("Sandbox roots must be contained within workspaceRoot");
|
|
201
|
+
}
|
|
202
|
+
}
|
|
203
|
+
else {
|
|
204
|
+
// business composition
|
|
205
|
+
if (!ownership.tenantId) {
|
|
206
|
+
errors.push("Business worker requires non-empty tenantId in ownership");
|
|
207
|
+
}
|
|
208
|
+
// Verified identity verification
|
|
209
|
+
const identity = config?.identity;
|
|
210
|
+
if (connectedApps !== undefined && identity?.verified !== true) {
|
|
211
|
+
errors.push("Business connected apps require a verified identity");
|
|
212
|
+
}
|
|
213
|
+
if (identity) {
|
|
214
|
+
if (!identity.principal?.id || !identity.tenantId) {
|
|
215
|
+
errors.push("Business worker identity cannot be empty or fabricated");
|
|
216
|
+
}
|
|
217
|
+
else {
|
|
218
|
+
try {
|
|
219
|
+
assertIdentityActive(identity);
|
|
220
|
+
if (rawOwnership) {
|
|
221
|
+
assertIdentityMatchesOwnership(identity, rawOwnership);
|
|
222
|
+
}
|
|
223
|
+
}
|
|
224
|
+
catch (error) {
|
|
225
|
+
errors.push(error instanceof Error ? error.message : String(error));
|
|
226
|
+
}
|
|
227
|
+
}
|
|
228
|
+
}
|
|
229
|
+
// Storage durability verification (memory-only persistence is NOT permitted in business readiness)
|
|
230
|
+
if (!storage.durable) {
|
|
231
|
+
errors.push("Business composition requires durable storage; in-memory storage is not permitted in production readiness");
|
|
232
|
+
}
|
|
233
|
+
// Sandbox isolation verification
|
|
234
|
+
if (!isolated || (sandboxRoots.length > 0 && !workspaceRoot)) {
|
|
235
|
+
errors.push("Mixed sandbox workspace detected; business worker requires strict workspace containment");
|
|
236
|
+
}
|
|
237
|
+
// Governance coverage
|
|
238
|
+
if (options.governance?.supported === false) {
|
|
239
|
+
errors.push("Unsupported governance configuration");
|
|
240
|
+
}
|
|
241
|
+
if (!governance.permission) {
|
|
242
|
+
errors.push("Business composition requires a permission policy");
|
|
243
|
+
}
|
|
244
|
+
if (!governance.trust) {
|
|
245
|
+
errors.push("Business composition requires a trust policy");
|
|
246
|
+
}
|
|
247
|
+
}
|
|
248
|
+
return {
|
|
249
|
+
profile: normalizedProfile,
|
|
250
|
+
effectiveTools: Object.freeze(effectiveTools),
|
|
251
|
+
credentialReferences: credRefs,
|
|
252
|
+
...(connectedApps === undefined ? {} : { connectedApps }),
|
|
253
|
+
ownership: Object.freeze(ownership),
|
|
254
|
+
storage: Object.freeze(storage),
|
|
255
|
+
sandbox: Object.freeze({
|
|
256
|
+
...(workspaceRoot ? { workspaceRoot } : {}),
|
|
257
|
+
roots: Object.freeze([...sandboxRoots]),
|
|
258
|
+
isolated,
|
|
259
|
+
}),
|
|
260
|
+
governance: Object.freeze(governance),
|
|
261
|
+
readiness: Object.freeze({
|
|
262
|
+
ok: errors.length === 0,
|
|
263
|
+
errors: Object.freeze(errors),
|
|
264
|
+
warnings: Object.freeze(warnings),
|
|
265
|
+
}),
|
|
266
|
+
};
|
|
267
|
+
}
|
|
268
|
+
/**
|
|
269
|
+
* Asserts that a host composition meets all readiness requirements for its profile.
|
|
270
|
+
* Throws HostCompositionError on failure.
|
|
271
|
+
*/
|
|
272
|
+
export function assertHostCompositionReadiness(options) {
|
|
273
|
+
const report = inspectHostComposition(options);
|
|
274
|
+
if (!report.readiness.ok) {
|
|
275
|
+
throw new HostCompositionError(report.readiness.errors.join("; "));
|
|
276
|
+
}
|
|
277
|
+
return report;
|
|
278
|
+
}
|
|
279
|
+
//# sourceMappingURL=host-composition.js.map
|
package/dist/index.d.ts
CHANGED
|
@@ -7,8 +7,10 @@ export { createAgentRunLifecycle } from "./agent-run-lifecycle.js";
|
|
|
7
7
|
export type { PendingToolCall, StoredAgentRunState } from "./agent-run-state.js";
|
|
8
8
|
export { AGENT_RUN_STATE_NAMESPACE, AGENT_RUN_STATE_SCHEMA_VERSION, agentFingerprint, DEFAULT_MAX_AGENT_RUN_STATE_BYTES, HARD_MAX_AGENT_RUN_STATE_BYTES, loadAgentRunState, } from "./agent-run-state.js";
|
|
9
9
|
export { createAgent, createAgentSession, resumeAgentRun, resumeAgentRunStream } from "./agents.js";
|
|
10
|
-
export type { ArtifactApproval, ArtifactApprovalState, ArtifactBodyErrorCode, ArtifactBodyPresignOptions, ArtifactBodyRef, ArtifactBodyStore, ArtifactBodyTransferOptions, ArtifactCitation, ArtifactDecisionState, ArtifactDeliveryToken, ArtifactRecord, ArtifactRevision, } from "./artifacts.js";
|
|
11
|
-
export { ARTIFACT_BODY_ERROR_CODES, ARTIFACT_CHECKPOINT_NAMESPACE, ArtifactBodyStoreError, ArtifactError, artifactApprovalState, artifactCheckpointKey, } from "./artifacts.js";
|
|
10
|
+
export type { ArtifactApproval, ArtifactApprovalState, ArtifactBodyErrorCode, ArtifactBodyPresignOptions, ArtifactBodyRef, ArtifactBodyStore, ArtifactBodyTransferOptions, ArtifactCitation, ArtifactDecisionState, ArtifactDeliveryToken, ArtifactRecord, ArtifactRevision, CitationIntegrityReason, CitationIntegrityResult, CitationLiveSource, CitationSupport, } from "./artifacts.js";
|
|
11
|
+
export { ARTIFACT_BODY_ERROR_CODES, ARTIFACT_CHECKPOINT_NAMESPACE, ArtifactBodyStoreError, ArtifactError, approvalEvidenceIntact, artifactApprovalState, artifactCheckpointKey, checkCitationIntegrity, citationBindingDigest, HARD_CITATION_EXCERPT_BYTES, } from "./artifacts.js";
|
|
12
|
+
export type { AttentionTruncationTrigger, AttentionTruncationTriggerOptions, PersistedAttentionStickyFrontier, } from "./attention-compiler.js";
|
|
13
|
+
export { ATTENTION_BUDGET_ERROR_CODE, AttentionBudgetError, createAttentionCompiler, createAttentionTruncationTrigger, DEFAULT_ATTENTION_COMPACT_RATIO, DEFAULT_ATTENTION_KEEP_LAST, DEFAULT_ATTENTION_RESERVE_TOKENS, DEFAULT_ATTENTION_THINKING_KEEP_TURNS, DEFAULT_ATTENTION_TRIGGER_RATIO, DEFAULT_ATTENTION_TRUNCATION_THRESHOLD, isAttentionBudgetError, resolveAttentionReserveTokens, resolveInputCap, resolveRunAttentionCompiler, } from "./attention-compiler.js";
|
|
12
14
|
export type { ApplyCacheControlOptions, CacheControlledContentBlock, CacheControlledMessage, CacheControlValue, CacheUsageReport, } from "./cache-helpers.js";
|
|
13
15
|
export { applyCacheControl, cacheHitRate, cacheSavings, cacheUsageReport, mapCacheRetention, resolveBreakpoint, sanitizeCacheKey, systemCacheControlField, } from "./cache-helpers.js";
|
|
14
16
|
export type { CacheTelemetry, CacheTelemetryOptions, CacheTelemetryReport, CacheTelemetrySample, } from "./cache-telemetry.js";
|
|
@@ -26,8 +28,8 @@ export { assertDeclaredMediaTypeMatches, assertMediaBlocksWithinBounds, assertMe
|
|
|
26
28
|
export type { ContextBudget, ContextBudgetMessageGroups, ContextBudgetOmission, ContextBudgetOmissionKind, ContextBudgetReport, TokenEstimator, } from "./context-budget.js";
|
|
27
29
|
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";
|
|
28
30
|
export type * from "./contracts.js";
|
|
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";
|
|
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, DEFAULT_SNAPSHOT_CACHE_TTL_MS, 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_SNAPSHOT_CACHE_TTL_MS, 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";
|
|
31
|
+
export type { ApprovalOutcome, AttentionCompiler, AttentionCompilerContext, AttentionCompilerOptions, AttentionCompilerSetting, AttentionInputCapOptions, AttentionReport, CompactionTrigger, CompactionTriggerContext, DecisionScope, NestedRunApproval, NestedRunOutcome, NestedRunRef, PendingDecision, PendingDecisionKind, ProviderResolver, RealtimeCaps, RealtimeEvent, RealtimeSession, RealtimeSessionFactory, RealtimeSessionOptions, ResolveShouldCompactInput, ResolveShouldCompactOptions, ResumeNestedRun, RunDecision, RunLimitCounters, RunLimitName, SecureAgentOptions, StickyDecision, ToolCallAuthority, ToolEffectClassifier, ToolEffectDeclaration, ToolEffectIdempotency, ToolEffectKey, ToolEffectKind, ToolEffectRecord, ToolEffectStatus, ToolEffectStore, ToolEffectTransition, ToolElicitationRequest, } from "./contracts.js";
|
|
32
|
+
export { AgentDecisionError, AgentDelegationSuspendedError, AgentLoopStateError, AgentRunError, AgentRunStateError, assertBatchJobsSupported, assertCompactionTrigger, 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, DEFAULT_SNAPSHOT_CACHE_TTL_MS, 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_SNAPSHOT_CACHE_TTL_MS, 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, resolveShouldCompact, 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";
|
|
31
33
|
export { parseAgentFile, parseSkillFile } from "./contribution-parsing.js";
|
|
32
34
|
export type { ContributionRegistries, ContributionRegistriesOptions, ContributionRegistry, ContributionRegistryOptions, } from "./contributions.js";
|
|
33
35
|
export { createContributionRegistries, createContributionRegistry, registerDiscoveredContributions } from "./contributions.js";
|
|
@@ -41,6 +43,8 @@ export type { DeviceAdapter, DeviceAdmitRequest, DeviceChunkResult, DeviceConfor
|
|
|
41
43
|
export { acceptDeviceChunk, assertDeviceAdmit, DEFAULT_DEVICE_MAX_CHUNK_BYTES, DEFAULT_DEVICE_MAX_CONCURRENT_SESSIONS, DevicePolicyError, HARD_DEVICE_MAX_CHUNK_BYTES, HARD_DEVICE_MAX_CONCURRENT_SESSIONS, redactDeviceTelemetry, resolveDevicePolicy, runDevicePolicyConformance, } from "./devices.js";
|
|
42
44
|
export type { EventMultiplexer, EventMultiplexerOptions, EventOverflowInfo, EventOverflowPolicy } from "./event-multiplexer.js";
|
|
43
45
|
export { createEventMultiplexer, EVENT_MULTIPLEXER_SINGLE_CONSUMER_CODE, EventMultiplexerError } from "./event-multiplexer.js";
|
|
46
|
+
export type { ClaimGroundingEvidence, ClaimGroundingEvidenceExtractor, ClaimGroundingEvidenceExtractorContext, ClaimGroundingGuardrailOptions, } from "./evidence-grounding.js";
|
|
47
|
+
export { createClaimGroundingGuardrail } from "./evidence-grounding.js";
|
|
44
48
|
export type { ExecutionAction, ExecutionDecision, ExecutionPolicy, ExecutionRisk } from "./execution-policy.js";
|
|
45
49
|
export { applyExecutionDecision, assertExecutionAllowed, checkExecution, ExecutionDeniedError } from "./execution-policy.js";
|
|
46
50
|
export type { ActivatedKernelConfig, ExtensionErrorPolicy, ExtensionEventBus, ExtensionEventHandler, ExtensionKernel, ExtensionKernelOptions, ExtensionLoadPolicy, LoadedExtension, } from "./extensions.js";
|
|
@@ -85,11 +89,14 @@ export type { LoadBinaryResourceOptions } from "./resources.js";
|
|
|
85
89
|
export { loadBinaryResource, loadJsonResource, loadManifestResource, loadTextResource } from "./resources.js";
|
|
86
90
|
export type { DefaultRetryPolicyOptions } from "./retry.js";
|
|
87
91
|
export { createDefaultRetryPolicy, isTransientErrorInfo, waitForRetry } from "./retry.js";
|
|
92
|
+
export type { RunBundleSnapshot, RunBundleSnapshotInput } from "./run-bundle.js";
|
|
93
|
+
export { RUN_BUNDLE_SCHEMA_VERSION, snapshotRunBundle } from "./run-bundle.js";
|
|
88
94
|
export type { BatchedRunLedgerOptions } from "./run-ledger.js";
|
|
89
95
|
export { createBatchedRunLedger, DEFAULT_LEDGER_BATCH_BYTES, DEFAULT_LEDGER_BATCH_DELAY_MS, DEFAULT_LEDGER_BATCH_ENTRIES, HARD_LEDGER_BATCH_BYTES, HARD_LEDGER_BATCH_DELAY_MS, HARD_LEDGER_BATCH_ENTRIES, isFlushableRunLedger, } from "./run-ledger.js";
|
|
90
96
|
export type { RunLimitTrackerOptions } from "./run-limits.js";
|
|
91
97
|
export { createRunLimitTracker, DEFAULT_RUN_LIMITS, HARD_RUN_LIMITS, RunLimitError, RunLimitTracker, resolveRunLimits, } from "./run-limits.js";
|
|
92
|
-
export {
|
|
98
|
+
export type { HostCompositionGovernance, HostCompositionOptions, HostCompositionProfile, HostCompositionReport, HostCompositionToolReport, } from "./secure-agent.js";
|
|
99
|
+
export { assertHostCompositionReadiness, createSecureAgent, HostCompositionError, inspectHostComposition, } from "./secure-agent.js";
|
|
93
100
|
export type { PermissionDecision, PermissionPolicy, PermissionRequest, TrustDecision, TrustPolicy, TrustRequest } from "./security.js";
|
|
94
101
|
export { assertPermission, assertTrusted, checkPermission, createStaticPermissionPolicy, createStaticTrustPolicy, denialToErrorInfo, isTrusted, PermissionDeniedError, TrustDeniedError, } from "./security.js";
|
|
95
102
|
export type { CreateMemorySessionStoreOptions, CreateSessionEntryOptions, MemorySessionSearchMode, SessionBranch, SessionBranchOptions, SessionContextSnapshot, } from "./session-stores.js";
|
|
@@ -119,5 +126,5 @@ export { trimTrailingSlashes } from "./trim-trailing-slashes.js";
|
|
|
119
126
|
export type { ResolvedUseCaseModel, ResolveUseCaseModelInput, UseCaseModelBinding, } from "./use-case-model.js";
|
|
120
127
|
export { resolveUseCaseModel, resolveUseCaseModelBinding, useCaseCredentialProviderId, } from "./use-case-model.js";
|
|
121
128
|
export declare const name = "prism";
|
|
122
|
-
export declare const version = "0.
|
|
129
|
+
export declare const version = "0.8.0";
|
|
123
130
|
export declare const description = "Agent harness for AI providers, agents, sessions, and tools.";
|