@deepstrike/sdk 0.2.52 → 0.2.61
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/README.md +28 -28
- package/dist/agent-ir.d.ts +103 -0
- package/dist/agent-ir.js +134 -0
- package/dist/agent.d.ts +67 -0
- package/dist/agent.js +36 -0
- package/dist/collaboration/harness.js +1 -1
- package/dist/collaboration/modes/creator-verifier.d.ts +2 -7
- package/dist/collaboration/modes/creator-verifier.js +4 -6
- package/dist/collaboration/pool.d.ts +8 -20
- package/dist/collaboration/pool.js +27 -97
- package/dist/compat/anthropic/mcp.d.ts +15 -0
- package/dist/compat/anthropic/mcp.js +10 -0
- package/dist/compat/openai/agent.d.ts +34 -0
- package/dist/compat/openai/agent.js +24 -0
- package/dist/governance.d.ts +1 -17
- package/dist/governance.js +1 -34
- package/dist/guardrail.d.ts +6 -0
- package/dist/guardrail.js +1 -0
- package/dist/handoff-target.d.ts +12 -0
- package/dist/handoff-target.js +1 -0
- package/dist/harness/manifest.js +0 -4
- package/dist/index.d.ts +19 -7
- package/dist/index.js +8 -5
- package/dist/kernel.d.ts +2 -20
- package/dist/knowledge/public.d.ts +29 -0
- package/dist/knowledge/public.js +1 -0
- package/dist/mcp-server.d.ts +28 -0
- package/dist/mcp-server.js +1 -0
- package/dist/memory/agent.d.ts +2 -2
- package/dist/memory/agent.js +2 -2
- package/dist/memory/durable.d.ts +16 -0
- package/dist/memory/durable.js +46 -0
- package/dist/memory/in-memory-store.d.ts +9 -7
- package/dist/memory/in-memory-store.js +8 -2
- package/dist/memory/protocols.d.ts +22 -4
- package/dist/memory/public.d.ts +4 -3
- package/dist/memory/public.js +3 -2
- package/dist/os/public.d.ts +1 -1
- package/dist/os/public.js +1 -1
- package/dist/providers/anthropic-adapter.d.ts +59 -0
- package/dist/providers/anthropic-adapter.js +530 -0
- package/dist/providers/anthropic-compatible.d.ts +2 -3
- package/dist/providers/anthropic-compatible.js +8 -5
- package/dist/providers/anthropic.d.ts +20 -23
- package/dist/providers/anthropic.js +176 -395
- package/dist/providers/base.d.ts +2 -2
- package/dist/providers/base.js +50 -8
- package/dist/providers/capability-router.d.ts +29 -0
- package/dist/providers/capability-router.js +43 -0
- package/dist/providers/catalog.d.ts +16 -4
- package/dist/providers/catalog.js +112 -36
- package/dist/providers/content-normalization.d.ts +57 -0
- package/dist/providers/content-normalization.js +238 -0
- package/dist/providers/content-policy.d.ts +16 -0
- package/dist/providers/content-policy.js +39 -0
- package/dist/providers/credentials.d.ts +83 -0
- package/dist/providers/credentials.js +190 -0
- package/dist/providers/endpoints.d.ts +137 -0
- package/dist/providers/endpoints.js +128 -0
- package/dist/providers/factories.js +25 -9
- package/dist/providers/gemini-adapter.d.ts +33 -0
- package/dist/providers/gemini-adapter.js +264 -0
- package/dist/providers/gemini.d.ts +16 -3
- package/dist/providers/gemini.js +97 -195
- package/dist/providers/model-catalog.d.ts +37 -0
- package/dist/providers/model-catalog.js +62 -0
- package/dist/providers/model-registry.d.ts +119 -0
- package/dist/providers/model-registry.js +379 -0
- package/dist/providers/ollama-adapter.d.ts +65 -0
- package/dist/providers/ollama-adapter.js +188 -0
- package/dist/providers/ollama.d.ts +9 -4
- package/dist/providers/ollama.js +96 -109
- package/dist/providers/openai-chat-dialects.d.ts +154 -0
- package/dist/providers/openai-chat-dialects.js +179 -0
- package/dist/providers/openai-chat.d.ts +46 -18
- package/dist/providers/openai-chat.js +416 -51
- package/dist/providers/openai-responses-adapter.d.ts +42 -0
- package/dist/providers/openai-responses-adapter.js +343 -0
- package/dist/providers/openai-responses.d.ts +19 -33
- package/dist/providers/openai-responses.js +164 -264
- package/dist/providers/openai.d.ts +29 -76
- package/dist/providers/openai.js +195 -292
- package/dist/providers/protocol-adapter.d.ts +39 -0
- package/dist/providers/protocol-adapter.js +13 -0
- package/dist/providers/protocol-capabilities.d.ts +34 -0
- package/dist/providers/protocol-capabilities.js +44 -0
- package/dist/providers/provider-error.d.ts +31 -0
- package/dist/providers/provider-error.js +153 -0
- package/dist/providers/public.d.ts +26 -3
- package/dist/providers/public.js +13 -1
- package/dist/providers/registry.d.ts +7 -6
- package/dist/providers/registry.js +47 -20
- package/dist/providers/request-plan.d.ts +89 -0
- package/dist/providers/request-plan.js +199 -0
- package/dist/providers/usage-normalizer.d.ts +48 -0
- package/dist/providers/usage-normalizer.js +139 -0
- package/dist/providers/vendor-profiles.d.ts +2 -15
- package/dist/providers/vendor-profiles.js +14 -60
- package/dist/runtime/canonical-kernel-step.d.ts +1 -2
- package/dist/runtime/canonical-kernel-step.js +47 -12
- package/dist/runtime/context-policy.d.ts +10 -12
- package/dist/runtime/context-policy.js +6 -8
- package/dist/runtime/durable-content.d.ts +50 -0
- package/dist/runtime/durable-content.js +159 -0
- package/dist/runtime/execution-plane.d.ts +2 -2
- package/dist/runtime/execution-plane.js +2 -2
- package/dist/runtime/kernel-event-log.js +0 -1
- package/dist/runtime/kernel-step.d.ts +0 -1
- package/dist/runtime/kernel-step.js +4 -2
- package/dist/runtime/mcp-proxy-plane.d.ts +25 -1
- package/dist/runtime/mcp-proxy-plane.js +44 -6
- package/dist/runtime/output-schema.d.ts +1 -2
- package/dist/runtime/provider-replay.d.ts +5 -1
- package/dist/runtime/provider-replay.js +26 -27
- package/dist/runtime/reactive-session.d.ts +1 -1
- package/dist/runtime/reactive-session.js +2 -3
- package/dist/runtime/run-group.d.ts +1 -1
- package/dist/runtime/runner.d.ts +31 -45
- package/dist/runtime/runner.js +178 -63
- package/dist/runtime/session-log.d.ts +8 -1
- package/dist/runtime/session-log.js +42 -2
- package/dist/runtime/session-repair.d.ts +1 -1
- package/dist/runtime/session-repair.js +1 -1
- package/dist/runtime/sub-agent-orchestrator.d.ts +1 -1
- package/dist/runtime/sub-agent-orchestrator.js +8 -11
- package/dist/runtime/workflow-control-flow.d.ts +0 -4
- package/dist/runtime/workflow-control-flow.js +0 -16
- package/dist/session.d.ts +11 -0
- package/dist/session.js +1 -0
- package/dist/skill.d.ts +17 -0
- package/dist/skill.js +16 -0
- package/dist/skills/loader.d.ts +3 -0
- package/dist/tools/errors.d.ts +1 -3
- package/dist/tools/errors.js +1 -3
- package/dist/tools/index.d.ts +3 -0
- package/dist/types/agent.d.ts +21 -9
- package/dist/types/agent.js +30 -4
- package/dist/types.d.ts +135 -17
- package/package.json +4 -4
- package/dist/providers/deepseek.d.ts +0 -46
- package/dist/providers/deepseek.js +0 -97
- package/dist/providers/glm.d.ts +0 -25
- package/dist/providers/glm.js +0 -48
- package/dist/providers/kimi.d.ts +0 -23
- package/dist/providers/kimi.js +0 -30
- package/dist/providers/minimax.d.ts +0 -49
- package/dist/providers/minimax.js +0 -98
- package/dist/providers/profiles.d.ts +0 -1992
- package/dist/providers/profiles.js +0 -796
- package/dist/providers/qwen.d.ts +0 -38
- package/dist/providers/qwen.js +0 -97
|
@@ -1,3 +1,11 @@
|
|
|
1
|
+
export class ProviderReplayProtocolMismatchError extends Error {
|
|
2
|
+
code = "provider_replay_protocol_mismatch";
|
|
3
|
+
constructor(provider, storedProtocol, resolvedProtocol) {
|
|
4
|
+
super(`Stored ${storedProtocol} tool replay is incompatible with resolved ${provider}/${resolvedProtocol}; `
|
|
5
|
+
+ `pin the previous ${storedProtocol} endpoint explicitly to resume this session`);
|
|
6
|
+
this.name = "ProviderReplayProtocolMismatchError";
|
|
7
|
+
}
|
|
8
|
+
}
|
|
1
9
|
function sortObjectKeys(val) {
|
|
2
10
|
if (val === null || typeof val !== "object") {
|
|
3
11
|
return val;
|
|
@@ -33,22 +41,6 @@ export function assistantReplayKey(message) {
|
|
|
33
41
|
toolCalls,
|
|
34
42
|
});
|
|
35
43
|
}
|
|
36
|
-
/**
|
|
37
|
-
* Infer the wire protocol a stored replay envelope belongs to.
|
|
38
|
-
*
|
|
39
|
-
* New envelopes carry an explicit `protocol`. Legacy envelopes are inferred
|
|
40
|
-
* from their shape: Anthropic persisted `native_blocks`, OpenAI-compatible
|
|
41
|
-
* persisted `reasoning_content` / `reasoning_details`.
|
|
42
|
-
*/
|
|
43
|
-
function replayProtocol(replay) {
|
|
44
|
-
if (replay.protocol)
|
|
45
|
-
return replay.protocol;
|
|
46
|
-
if (replay.native_blocks?.length)
|
|
47
|
-
return "anthropic-messages";
|
|
48
|
-
if (replay.reasoning_content != null || replay.reasoning_details !== undefined)
|
|
49
|
-
return "openai-chat";
|
|
50
|
-
return undefined;
|
|
51
|
-
}
|
|
52
44
|
/**
|
|
53
45
|
* A stored replay may only be seeded into a provider speaking the same wire
|
|
54
46
|
* protocol. On a cross-protocol fallback (provider A -> provider B) the
|
|
@@ -56,12 +48,16 @@ function replayProtocol(replay) {
|
|
|
56
48
|
* of replaying A's protocol-specific shape.
|
|
57
49
|
*/
|
|
58
50
|
export function isReplayCompatibleWithProvider(replay, descriptor) {
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
51
|
+
assertCanonicalReplay(replay);
|
|
52
|
+
return !descriptor || replay.protocol === descriptor.protocol;
|
|
53
|
+
}
|
|
54
|
+
const REPLAY_KEYS = new Set(["protocol", "provider", "model", "native_blocks", "reasoning_content", "reasoning_details", "native_message", "tool_calls"]);
|
|
55
|
+
function assertCanonicalReplay(replay) {
|
|
56
|
+
for (const key of Object.keys(replay))
|
|
57
|
+
if (!REPLAY_KEYS.has(key))
|
|
58
|
+
throw new Error(`provider replay has unknown field ${key}`);
|
|
59
|
+
if (typeof replay.protocol !== "string" || replay.protocol.length === 0)
|
|
60
|
+
throw new Error("provider replay protocol is required");
|
|
65
61
|
}
|
|
66
62
|
export function seedProviderReplayFromEvents(provider, events) {
|
|
67
63
|
if (!provider.seedProviderReplay)
|
|
@@ -72,12 +68,15 @@ export function seedProviderReplayFromEvents(provider, events) {
|
|
|
72
68
|
continue;
|
|
73
69
|
const toolCalls = event.tool_calls ?? [];
|
|
74
70
|
const stored = event.provider_replay;
|
|
75
|
-
if (
|
|
71
|
+
if (!stored)
|
|
76
72
|
continue;
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
73
|
+
if (!isReplayCompatibleWithProvider(stored, descriptor)) {
|
|
74
|
+
if (toolCalls.length > 0 && descriptor) {
|
|
75
|
+
throw new ProviderReplayProtocolMismatchError(descriptor.provider, stored.protocol, descriptor.protocol);
|
|
76
|
+
}
|
|
77
|
+
continue;
|
|
78
|
+
}
|
|
79
|
+
provider.seedProviderReplay({ content: event.content, toolCalls }, stored);
|
|
81
80
|
}
|
|
82
81
|
}
|
|
83
82
|
export function peekProviderReplay(provider, content, toolCalls) {
|
|
@@ -121,7 +121,7 @@ export declare class ReactiveSession {
|
|
|
121
121
|
* blackboard continuity comes from the (persistent) `EventStream`. Turn-policy cursor state is not
|
|
122
122
|
* restored. W-N5: vehicle members (workflow envelopes, `wf-node*` children, loop iterations) share
|
|
123
123
|
* the governance domain but are NOT personas — resuming them as peers would resurrect phantoms.
|
|
124
|
-
*
|
|
124
|
+
* Only explicitly tagged peer memberships are resumable.
|
|
125
125
|
*/
|
|
126
126
|
static resume(opts: ReactiveSessionOptions & {
|
|
127
127
|
peerSpecs?: Record<string, ReactivePeerSpec>;
|
|
@@ -135,14 +135,13 @@ export class ReactiveSession {
|
|
|
135
135
|
* blackboard continuity comes from the (persistent) `EventStream`. Turn-policy cursor state is not
|
|
136
136
|
* restored. W-N5: vehicle members (workflow envelopes, `wf-node*` children, loop iterations) share
|
|
137
137
|
* the governance domain but are NOT personas — resuming them as peers would resurrect phantoms.
|
|
138
|
-
*
|
|
138
|
+
* Only explicitly tagged peer memberships are resumable.
|
|
139
139
|
*/
|
|
140
140
|
static async resume(opts) {
|
|
141
141
|
const session = new ReactiveSession(opts);
|
|
142
142
|
const members = await opts.runGroup.budgetStore.members(opts.runGroup.id);
|
|
143
|
-
const anyTagged = members.some(m => m.kind !== undefined);
|
|
144
143
|
for (const member of members) {
|
|
145
|
-
if (
|
|
144
|
+
if (member.kind !== "peer")
|
|
146
145
|
continue;
|
|
147
146
|
session.peerSpecs.set(member.sessionId, opts.peerSpecs?.[member.sessionId] ?? { role: member.role });
|
|
148
147
|
}
|
|
@@ -34,7 +34,7 @@ export interface GroupMember {
|
|
|
34
34
|
/** W-N5: what this member IS in the lineage — a `"peer"` persona (ReactiveSession.addPeer) vs a
|
|
35
35
|
* `"vehicle"` session (run()/runWorkflow envelopes, workflow-node children, loop iterations).
|
|
36
36
|
* `ReactiveSession.resume()` rebuilds the peer set from `"peer"` members only, so DAG-in-Peer
|
|
37
|
-
* usage can't resurrect phantom `wf-node*` personas. Absent
|
|
37
|
+
* usage can't resurrect phantom `wf-node*` personas. Absent means unknown. */
|
|
38
38
|
kind?: "peer" | "vehicle";
|
|
39
39
|
}
|
|
40
40
|
export interface GroupBudgetStore {
|
package/dist/runtime/runner.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { LLMProvider, Message, ContentPart, ToolSchema, StreamEvent, ToolSuspendEvent, PermissionRequestEvent, PermissionResponse, AsyncSummarizer,
|
|
2
|
-
import type {
|
|
1
|
+
import type { LLMProvider, Message, ContentPart, ToolSchema, StreamEvent, ToolSuspendEvent, PermissionRequestEvent, PermissionResponse, AsyncSummarizer, MemorySummarizer, EntropySample, EntropyWatchOptions } from "../types.js";
|
|
2
|
+
import type { MemoryStore, MemoryRecord, MemoryRecall, MemoryScope, MemoryQuery } from "../memory/protocols.js";
|
|
3
3
|
import type { KnowledgeSource } from "../knowledge/source.js";
|
|
4
4
|
import type { RuntimeSignalUrgency, SignalSource } from "../signals/types.js";
|
|
5
5
|
import type { SessionLog, SessionEvent } from "./session-log.js";
|
|
@@ -15,15 +15,18 @@ import { type GovernancePolicy } from "../governance.js";
|
|
|
15
15
|
import { type NativeOsProfile, type OsProfileId, type SignalPolicy } from "./os-profile.js";
|
|
16
16
|
import { PayloadStore } from "./payload-store.js";
|
|
17
17
|
import type { BackgroundTaskErrorHandler } from "./reliability.js";
|
|
18
|
-
import { type
|
|
18
|
+
import { type ContextPolicyOverrides } from "./context-policy.js";
|
|
19
19
|
import { type InstructionProfile } from "../harness/manifest.js";
|
|
20
20
|
import { type NudgeRule } from "../harness/nudge.js";
|
|
21
21
|
export interface SchedulerPolicy {
|
|
22
|
-
version: 1;
|
|
23
22
|
criticalPathWeight: number;
|
|
24
23
|
fanoutWeight: number;
|
|
25
24
|
ageWeight: number;
|
|
26
25
|
tokenCostWeight: number;
|
|
26
|
+
deadlineWeight?: number;
|
|
27
|
+
processPriorityWeight?: number;
|
|
28
|
+
resourcePressureWeight?: number;
|
|
29
|
+
budgetPressureWeight?: number;
|
|
27
30
|
}
|
|
28
31
|
export declare function schedulerPolicyToKernel(policy: SchedulerPolicy): Record<string, number>;
|
|
29
32
|
/** Host-counted provider envelope and response reserves deducted from the model context window. */
|
|
@@ -53,11 +56,7 @@ export interface TurnMetrics {
|
|
|
53
56
|
inputTokens: number;
|
|
54
57
|
/** Tokens served from the prompt cache this turn (Anthropic `cache_read_input_tokens`). */
|
|
55
58
|
cacheReadTokens: number;
|
|
56
|
-
/**
|
|
57
|
-
* not a per-block breakdown — this field is a pro-rata estimate over the slots that actually
|
|
58
|
-
* carried a `cache_control` breakpoint on the request. Missing / empty when the provider does
|
|
59
|
-
* not honor `cache_control` (OpenAI-family auto-cache) or when no breakpoints were placed.
|
|
60
|
-
* Useful for diagnosing which slot is buying the cache hit when comparing strategies. */
|
|
59
|
+
/** Provider-authoritative per-slot attribution, when the endpoint reports one. */
|
|
61
60
|
cacheReadTokensBySlot?: {
|
|
62
61
|
system?: number;
|
|
63
62
|
tools?: number;
|
|
@@ -65,6 +64,10 @@ export interface TurnMetrics {
|
|
|
65
64
|
};
|
|
66
65
|
/** Tokens written to the prompt cache this turn (Anthropic `cache_creation_input_tokens`). */
|
|
67
66
|
cacheCreationTokens: number;
|
|
67
|
+
cacheTelemetryStatus?: "measured" | "unavailable";
|
|
68
|
+
cacheTelemetrySource?: "anthropic_usage" | "openai_prompt_details" | "deepseek_prompt_cache" | "gemini_usage";
|
|
69
|
+
requestFingerprint?: string;
|
|
70
|
+
stablePrefixFingerprint?: string;
|
|
68
71
|
}
|
|
69
72
|
/** O5: decision returned by `onToolCall` — `block: true` denies this call before it executes; the
|
|
70
73
|
* `reason` is fed back to the model as a governance-denied tool result (so it can redirect). */
|
|
@@ -117,10 +120,10 @@ export interface RuntimeOptions {
|
|
|
117
120
|
memoryScope?: MemoryScope;
|
|
118
121
|
/** I4: optional run-start memory pre-fetch hook. The runner calls this ONCE per run, before the
|
|
119
122
|
* first LLM turn, with the request's goal and (optional) run-spec. Each returned scoped query
|
|
120
|
-
* becomes a `
|
|
123
|
+
* becomes a `memoryStore.search(agentId, query)` and the resulting hits land in decaying
|
|
121
124
|
* HISTORY as an ordinary user turn before turn 1 (single-use retrieval content — never a
|
|
122
125
|
* permanent knowledge pin; `initialMemory` is the curated CLAUDE.md-analog seed). Returning
|
|
123
|
-
* `undefined` / empty array is a no-op. Requires `
|
|
126
|
+
* `undefined` / empty array is a no-op. Requires `memoryStore` + `agentId`; missing either ⇒
|
|
124
127
|
* silently skipped (errs-open). Default when unset: one query = the run goal (P10). Bench memory-recall shows -57% turns / -55% dollars when
|
|
125
128
|
* relevant memories land on turn 1 instead of being discovered via the meta-tool on turn 3+. */
|
|
126
129
|
preQueryMemory?: (ctx: {
|
|
@@ -150,7 +153,7 @@ export interface RuntimeOptions {
|
|
|
150
153
|
* scanned skills fed); empty array ⇒ no skills (a legitimate narrowing — unlike an empty
|
|
151
154
|
* `allowedToolIds`, which the runner reads as "no gating"). Only takes effect when `skillDir` is set. */
|
|
152
155
|
skillFilter?: string[];
|
|
153
|
-
|
|
156
|
+
memoryStore?: MemoryStore;
|
|
154
157
|
/** M4: advisory callback when a recalled record crosses the promotion threshold. The host/model
|
|
155
158
|
* decides whether to pin the record or promote its content into knowledge. */
|
|
156
159
|
onPromotionSuggested?: (info: {
|
|
@@ -168,13 +171,13 @@ export interface RuntimeOptions {
|
|
|
168
171
|
* AskUser calls surface as `tool_gated` and run through `onPermissionRequest`.
|
|
169
172
|
*/
|
|
170
173
|
governancePolicy?: GovernancePolicy;
|
|
171
|
-
/**
|
|
174
|
+
/** In-kernel signal admission, queue, and expiry policy. */
|
|
172
175
|
signalPolicy?: SignalPolicy;
|
|
173
176
|
/** Provider-envelope overhead plus output and safety reserves journaled before start. */
|
|
174
177
|
promptBudget?: PromptBudget;
|
|
175
178
|
/** Stable replayable context behavior; SDK ratios are normalized to integer ppm on the ABI wire. */
|
|
176
|
-
contextPolicy?:
|
|
177
|
-
/**
|
|
179
|
+
contextPolicy?: ContextPolicyOverrides;
|
|
180
|
+
/** Deterministic DAG scheduling policy installed atomically through ConfigureRun. */
|
|
178
181
|
schedulerPolicy?: SchedulerPolicy;
|
|
179
182
|
/**
|
|
180
183
|
* Optional declarative resource quotas (`set_resource_quota`). Bounds spawn concurrency /
|
|
@@ -231,15 +234,13 @@ export interface RuntimeOptions {
|
|
|
231
234
|
* executes. Return `{ block: true, reason }` to veto — the call never runs and the reason is fed
|
|
232
235
|
* back to the model as a denied tool result. This is the seam for STATEFUL host policy (count
|
|
233
236
|
* repeats, budget writes per resource, project-specific rules); keep static allow/deny in
|
|
234
|
-
* `governancePolicy`. A throwing decision hook fails closed
|
|
237
|
+
* `governancePolicy`. A throwing decision hook always fails closed.
|
|
235
238
|
*/
|
|
236
239
|
onToolCall?: (call: {
|
|
237
240
|
callId: string;
|
|
238
241
|
name: string;
|
|
239
242
|
arguments: string;
|
|
240
243
|
}) => Promise<ToolCallHookDecision | undefined | void> | ToolCallHookDecision | undefined | void;
|
|
241
|
-
/** Failure policy for `onToolCall`. Default `closed`; set `open` only for advisory hooks. */
|
|
242
|
-
onToolCallFailure?: "closed" | "open";
|
|
243
244
|
/**
|
|
244
245
|
* O5 (the PostToolUse-hook analog): called for each executed tool result before it reaches the
|
|
245
246
|
* kernel. Return `{ replaceOutput }` to swap the result the model sees (redact / annotate), and/or
|
|
@@ -271,7 +272,7 @@ export interface RuntimeOptions {
|
|
|
271
272
|
*/
|
|
272
273
|
nestedGroupVehicle?: boolean;
|
|
273
274
|
/**
|
|
274
|
-
* Optional canonical long-term memory policy. Enabling memory still requires `
|
|
275
|
+
* Optional canonical long-term memory policy. Enabling memory still requires `memoryStore` +
|
|
275
276
|
* `agentId`; storage location is configured on that host store, not in the kernel contract.
|
|
276
277
|
*/
|
|
277
278
|
memoryPolicy?: MemoryPolicy;
|
|
@@ -310,8 +311,7 @@ export interface RuntimeOptions {
|
|
|
310
311
|
* synthesizes a minimal run spec. Omitted **or empty** ⇒ no ceiling (all registered tools) — the
|
|
311
312
|
* empty array is NOT a minimal surface here; use `baselineToolIds: []` for that.
|
|
312
313
|
*
|
|
313
|
-
*
|
|
314
|
-
* tool outside the advertised set never executes.
|
|
314
|
+
* Dispatch is always fail-closed: a call outside the advertised set never executes.
|
|
315
315
|
*/
|
|
316
316
|
allowedToolIds?: string[];
|
|
317
317
|
/**
|
|
@@ -322,27 +322,13 @@ export interface RuntimeOptions {
|
|
|
322
322
|
*
|
|
323
323
|
* `exposed = meta ∪ ((baseline ∪ stableCore ∪ ⋃ activeSkills.allowed_tools) ∩ ceiling)`
|
|
324
324
|
*
|
|
325
|
-
* An active skill that declares no `allowed_tools` contributes nothing
|
|
326
|
-
* surface stays narrow (strict; the legacy errs-open widening is deliberately not inherited).
|
|
325
|
+
* An active skill that declares no `allowed_tools` contributes nothing and the surface stays narrow.
|
|
327
326
|
*
|
|
328
|
-
* `undefined`
|
|
329
|
-
* legitimate, distinct value: the minimal surface (meta-tools + `stableCoreToolIds` only) — the
|
|
327
|
+
* `undefined` and `[]` both mean the minimal surface (meta-tools + `stableCoreToolIds` only) — the
|
|
330
328
|
* `allowedToolIds` "empty means no gating" trap does NOT recur here. Entries outside the ceiling
|
|
331
329
|
* silently intersect away (no root-start error), the same fold every id-list surface uses.
|
|
332
330
|
*/
|
|
333
331
|
baselineToolIds?: string[];
|
|
334
|
-
/**
|
|
335
|
-
* Dispatch enforcement for the exposure surface. `"exposed"` (default) is fail-closed: a tool call
|
|
336
|
-
* the model was never advertised this turn never reaches the host — the kernel commits a
|
|
337
|
-
* model-visible `governance_denied` result instead ("Tool 'X' is not part of this run's toolset"),
|
|
338
|
-
* which feeds the repeat fuse like any other denial. Allowed siblings in the same batch still
|
|
339
|
-
* execute; `pace` and the meta-tool family always pass through.
|
|
340
|
-
*
|
|
341
|
-
* `"registered"` is the escape hatch restoring the pre-gate permissive behavior (any registered
|
|
342
|
-
* tool the model names executes, even if it was gated out of the tools schema). Set it only when a
|
|
343
|
-
* host deliberately relies on blind calls to unadvertised tools.
|
|
344
|
-
*/
|
|
345
|
-
toolDispatchGate?: "exposed" | "registered";
|
|
346
332
|
/** P0-C: optional per-turn metrics sink for tool-gating telemetry (see `TurnMetrics`). Pure
|
|
347
333
|
* observation; invoked once per LLM turn. Never throws into the run loop (errors are swallowed). */
|
|
348
334
|
onTurnMetrics?: (metrics: TurnMetrics) => void;
|
|
@@ -366,15 +352,15 @@ export interface RuntimeOptions {
|
|
|
366
352
|
/** G2: custom reducers for `NodeKind::Reduce` workflow nodes, merged over the built-ins
|
|
367
353
|
* (`concat` / `dedupe_lines` / `merge_json_arrays` / `count`). A reduce node runs no LLM. */
|
|
368
354
|
reducers?: ReducerRegistry;
|
|
369
|
-
/** Optional system prompt injected into
|
|
370
|
-
|
|
371
|
-
/** Custom LLM provider used for
|
|
372
|
-
|
|
355
|
+
/** Optional system prompt injected into durable-memory synthesis. */
|
|
356
|
+
memorySystemPrompt?: string;
|
|
357
|
+
/** Custom LLM provider used for durable-memory consolidation. */
|
|
358
|
+
memoryProvider?: LLMProvider;
|
|
373
359
|
/**
|
|
374
|
-
* Optional LLM summarizer for semantic page_out events. When unset, `
|
|
375
|
-
* (or the runtime provider) is used to produce long-term summaries for
|
|
360
|
+
* Optional LLM summarizer for semantic page_out events. When unset, `memoryProvider`
|
|
361
|
+
* (or the runtime provider) is used to produce long-term summaries for MemoryStore.
|
|
376
362
|
*/
|
|
377
|
-
|
|
363
|
+
memorySummarizer?: MemorySummarizer;
|
|
378
364
|
/**
|
|
379
365
|
* Optional async LLM summarizer. When provided, a background call is fired
|
|
380
366
|
* after each compression event to produce a richer semantic summary.
|
|
@@ -429,7 +415,7 @@ export declare class RuntimeRunner {
|
|
|
429
415
|
private retrieveMemoryFromStore;
|
|
430
416
|
/**
|
|
431
417
|
* Route a host-originated renewal prefetch into canonical knowledge commands. This is not an
|
|
432
|
-
* agent syscall: the host selects records from its store, then the kernel owns the
|
|
418
|
+
* agent syscall: the host selects records from its store, then the kernel owns the write
|
|
433
419
|
* of live semantic context. `seenRecordIds` is the prefetch's dedupe horizon.
|
|
434
420
|
*/
|
|
435
421
|
private prefetchMemoryIntoKnowledge;
|