@deepstrike/sdk 0.2.51 → 0.2.60
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/providers/anthropic-adapter.d.ts +47 -0
- package/dist/providers/anthropic-adapter.js +444 -0
- package/dist/providers/anthropic-compatible.d.ts +2 -3
- package/dist/providers/anthropic-compatible.js +8 -5
- package/dist/providers/anthropic.d.ts +19 -23
- package/dist/providers/anthropic.js +169 -395
- package/dist/providers/base.js +43 -3
- 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 -21
- 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 +9 -3
- package/dist/providers/gemini-adapter.d.ts +33 -0
- package/dist/providers/gemini-adapter.js +272 -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 +98 -0
- package/dist/providers/model-registry.js +315 -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 +418 -51
- package/dist/providers/openai-responses-adapter.d.ts +42 -0
- package/dist/providers/openai-responses-adapter.js +341 -0
- package/dist/providers/openai-responses.d.ts +14 -33
- package/dist/providers/openai-responses.js +131 -264
- package/dist/providers/openai.d.ts +29 -76
- package/dist/providers/openai.js +195 -292
- package/dist/providers/protocol-adapter.d.ts +34 -0
- package/dist/providers/protocol-adapter.js +9 -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 +149 -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 +86 -0
- package/dist/providers/request-plan.js +175 -0
- package/dist/providers/usage-normalizer.d.ts +48 -0
- package/dist/providers/usage-normalizer.js +96 -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 +10 -2
- package/dist/runtime/canonical-kernel-step.js +106 -32
- 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 +1 -1
- package/dist/runtime/provider-replay.js +12 -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 +26 -40
- package/dist/runtime/runner.js +145 -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 +128 -13
- package/package.json +3 -3
- 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
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. */
|
|
@@ -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;
|