@deepstrike/sdk 0.2.72 → 0.2.73
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 +5 -4
- package/dist/agent-facade.d.ts +20 -8
- package/dist/agent-facade.js +23 -10
- package/dist/conformance.d.ts +5 -0
- package/dist/conformance.js +7 -0
- package/dist/evals/public.d.ts +8 -1
- package/dist/evals/public.js +4 -5
- package/dist/index.d.ts +8 -36
- package/dist/index.js +3 -22
- package/dist/reactions.d.ts +2 -0
- package/dist/reactions.js +3 -0
- package/dist/runtime-language.d.ts +1 -1
- package/dist/runtime-language.js +1 -1
- package/dist/session-events.d.ts +3 -0
- package/dist/session-events.js +1 -0
- package/dist/types.d.ts +3 -3
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
</a>
|
|
5
5
|
</p>
|
|
6
6
|
|
|
7
|
-
# DeepStrike Node.js SDK (0.2.
|
|
7
|
+
# DeepStrike Node.js SDK (0.2.73)
|
|
8
8
|
|
|
9
9
|
Build Node.js Agents with providers, typed tools, memory, Skills, delegation, workflows, and durable sessions. The SDK keeps the Agent's long-running work explicit through stream events, SessionLog evidence, tool policies, and host-provided integrations.
|
|
10
10
|
|
|
@@ -55,7 +55,8 @@ const add = tool("add", "Add two numbers.", {
|
|
|
55
55
|
|
|
56
56
|
const agent = createAgent({
|
|
57
57
|
name: "math",
|
|
58
|
-
|
|
58
|
+
model: "openai/gpt-5-mini",
|
|
59
|
+
runtimeBinding: { provider },
|
|
59
60
|
tools: [add],
|
|
60
61
|
})
|
|
61
62
|
|
|
@@ -91,7 +92,7 @@ The root export is the **Agent intent layer** — what you reach for to define a
|
|
|
91
92
|
| `@deepstrike/sdk/evals` | Public evaluation language: `judge`, criteria, verdicts, and schemas |
|
|
92
93
|
| `@deepstrike/sdk/advanced` | Kernel diagnostics and low-level orchestration escape hatches |
|
|
93
94
|
|
|
94
|
-
> **Migration from 0.2.71:** see [`MIGRATION-v0.2.71-to-v0.2.
|
|
95
|
+
> **Migration from 0.2.71:** see [`MIGRATION-v0.2.71-to-v0.2.73.md`](../MIGRATION-v0.2.71-to-v0.2.73.md) for the AgentDefinition, message, runtime binding, workflow and package changes.
|
|
95
96
|
|
|
96
97
|
The recipes below the Agent section that mention `RuntimeRunner` are advanced implementation examples. Import it from `@deepstrike/sdk/advanced`; application code should use the Agent and Session methods shown above.
|
|
97
98
|
|
|
@@ -102,7 +103,7 @@ Most apps start with one executable Agent. Streaming, sessions, memory, delegati
|
|
|
102
103
|
```typescript
|
|
103
104
|
import { createAgent } from "@deepstrike/sdk"
|
|
104
105
|
|
|
105
|
-
const agent = createAgent({ name: "researcher", provider, tools: [add] })
|
|
106
|
+
const agent = createAgent({ name: "researcher", model: "openai/gpt-5-mini", runtimeBinding: { provider }, tools: [add] })
|
|
106
107
|
const answer = await agent.run("What is 17 + 28?")
|
|
107
108
|
console.log(answer.output)
|
|
108
109
|
|
package/dist/agent-facade.d.ts
CHANGED
|
@@ -10,15 +10,18 @@ export interface AgentDefinition extends Omit<AgentOptions, "model" | "name"> {
|
|
|
10
10
|
name?: string;
|
|
11
11
|
/** Public model identity. Runtime resolves this through a provider binding. */
|
|
12
12
|
model?: ModelRef;
|
|
13
|
-
/** Optional host binding retained for local/custom execution. */
|
|
14
|
-
provider?: LLMProvider;
|
|
15
13
|
tools?: RegisteredTool[];
|
|
16
|
-
executionPlane?: ExecutionPlane;
|
|
17
|
-
sessionLog?: SessionLog;
|
|
18
14
|
maxTokens?: number;
|
|
19
15
|
memoryStore?: MemoryStore;
|
|
20
16
|
memoryScope?: MemoryScope;
|
|
21
|
-
|
|
17
|
+
runtimeBinding?: RuntimeBinding;
|
|
18
|
+
}
|
|
19
|
+
export interface RuntimeBinding {
|
|
20
|
+
provider?: LLMProvider;
|
|
21
|
+
providerFor?: RuntimeOptions["providerFor"];
|
|
22
|
+
executionPlane?: ExecutionPlane;
|
|
23
|
+
sessionLog?: SessionLog;
|
|
24
|
+
runtimeOptions?: Pick<RuntimeOptions, "memoryPolicy" | "governancePolicy" | "signalSource" | "signalPolicy" | "resourceQuota" | "onPermissionRequest" | "payloadStore" | "runGroup" | "subAgentOrchestrator" | "reducers" | "initialMemory" | "skillCatalog" | "knowledgeSource" | "contextManager" | "artifactSetDigest">;
|
|
22
25
|
}
|
|
23
26
|
export interface AgentRunOptions {
|
|
24
27
|
session?: SessionRef;
|
|
@@ -42,6 +45,13 @@ export interface RunResult<T = string> {
|
|
|
42
45
|
ok: boolean;
|
|
43
46
|
errors: string[];
|
|
44
47
|
};
|
|
48
|
+
/** Host-owned execution evidence captured for evaluation and replay. */
|
|
49
|
+
evidence?: {
|
|
50
|
+
contextBinding?: unknown;
|
|
51
|
+
route?: unknown;
|
|
52
|
+
measurement?: unknown;
|
|
53
|
+
artifactSet?: unknown;
|
|
54
|
+
};
|
|
45
55
|
}
|
|
46
56
|
export interface AgentSession extends SessionRef {
|
|
47
57
|
run(goal: string, options?: Omit<AgentRunOptions, "session">): Promise<RunResult>;
|
|
@@ -74,8 +84,8 @@ export interface DelegationResult {
|
|
|
74
84
|
status: "completed" | "partial" | "failed";
|
|
75
85
|
nodeId?: string;
|
|
76
86
|
}
|
|
77
|
-
/** The executable
|
|
78
|
-
export interface
|
|
87
|
+
/** The executable public Agent handle created from an AgentDefinition. */
|
|
88
|
+
export interface Agent {
|
|
79
89
|
readonly name: string;
|
|
80
90
|
readonly definition: Readonly<AgentDefinition>;
|
|
81
91
|
run(goal: string, options?: AgentRunOptions): Promise<RunResult>;
|
|
@@ -93,4 +103,6 @@ export interface AgentRuntime {
|
|
|
93
103
|
}): Promise<RunResult | null>;
|
|
94
104
|
close(): Promise<void>;
|
|
95
105
|
}
|
|
96
|
-
|
|
106
|
+
/** @internal Compatibility alias; public code should use `Agent`. */
|
|
107
|
+
export type AgentRuntime = Agent;
|
|
108
|
+
export declare function createAgent(definition: AgentDefinition): Agent;
|
package/dist/agent-facade.js
CHANGED
|
@@ -62,7 +62,7 @@ class AgentRuntimeImpl {
|
|
|
62
62
|
constructor(definition) {
|
|
63
63
|
this.definition = Object.freeze({ ...definition });
|
|
64
64
|
this.name = normalizeAgent(definition).name;
|
|
65
|
-
this.sessionLog = definition.sessionLog ?? new InMemorySessionLog();
|
|
65
|
+
this.sessionLog = definition.runtimeBinding?.sessionLog ?? new InMemorySessionLog();
|
|
66
66
|
}
|
|
67
67
|
session(id = `session-${crypto.randomUUID()}`) {
|
|
68
68
|
return new AgentSessionImpl(this, id);
|
|
@@ -147,7 +147,7 @@ class AgentRuntimeImpl {
|
|
|
147
147
|
}
|
|
148
148
|
}
|
|
149
149
|
async listen(options = {}) {
|
|
150
|
-
const source = this.definition.runtimeOptions?.signalSource;
|
|
150
|
+
const source = this.definition.runtimeBinding?.runtimeOptions?.signalSource;
|
|
151
151
|
if (!source)
|
|
152
152
|
throw new Error("agent signals require runtimeOptions.signalSource");
|
|
153
153
|
const claim = await source.claimSignal(this.name, options.leaseMs);
|
|
@@ -198,6 +198,17 @@ class AgentRuntimeImpl {
|
|
|
198
198
|
const started = [...persisted].reverse().find(entry => entry.event.kind === "run_started");
|
|
199
199
|
const usageEvent = [...events].reverse().find(event => event.type === "usage");
|
|
200
200
|
const output = events.filter(event => event.type === "text_delta").map(event => String(event.delta ?? "")).join("");
|
|
201
|
+
const prepared = [...persisted].reverse().find(entry => entry.event.kind === "context_prepared");
|
|
202
|
+
const measured = [...persisted].reverse().find(entry => entry.event.kind === "prompt_measured");
|
|
203
|
+
const attempt = [...persisted].reverse().find(entry => entry.event.kind === "provider_attempt");
|
|
204
|
+
const runStarted = [...persisted].reverse().find(entry => entry.event.kind === "run_started");
|
|
205
|
+
const binding = this.definition.runtimeBinding;
|
|
206
|
+
const evidence = {
|
|
207
|
+
...(prepared?.event.kind === "context_prepared" ? { contextBinding: prepared.event.preparation.binding } : {}),
|
|
208
|
+
...(attempt?.event.kind === "provider_attempt" ? { route: attempt.event.route } : runStarted?.event.kind === "run_started" && runStarted.event.route ? { route: runStarted.event.route } : {}),
|
|
209
|
+
...(measured?.event.kind === "prompt_measured" ? { measurement: measured.event.measurement } : {}),
|
|
210
|
+
...(binding?.runtimeOptions?.artifactSetDigest ? { artifactSet: { digest: binding.runtimeOptions.artifactSetDigest } } : {}),
|
|
211
|
+
};
|
|
201
212
|
const outputValidation = this.definition.outputSchema
|
|
202
213
|
? validateAgainstSchema(extractJsonValue(output), this.definition.outputSchema)
|
|
203
214
|
: undefined;
|
|
@@ -214,6 +225,7 @@ class AgentRuntimeImpl {
|
|
|
214
225
|
totalTokens: usageEvent.totalTokens,
|
|
215
226
|
},
|
|
216
227
|
} : {}),
|
|
228
|
+
...(Object.keys(evidence).length ? { evidence } : {}),
|
|
217
229
|
};
|
|
218
230
|
}
|
|
219
231
|
async *resume(id, options = {}) {
|
|
@@ -241,15 +253,16 @@ class AgentRuntimeImpl {
|
|
|
241
253
|
}
|
|
242
254
|
createRunner(options) {
|
|
243
255
|
const model = this.definition.model;
|
|
244
|
-
const
|
|
245
|
-
|
|
256
|
+
const binding = this.definition.runtimeBinding;
|
|
257
|
+
const provider = binding?.provider
|
|
258
|
+
?? (typeof model === "string" ? binding?.providerFor?.(model) : undefined);
|
|
246
259
|
if (!provider) {
|
|
247
260
|
throw new Error(`agent "${this.name}" has no runtime provider binding for model ${typeof this.definition.model === "string" ? this.definition.model : "(unresolved)"}`);
|
|
248
261
|
}
|
|
249
|
-
if (
|
|
262
|
+
if (binding?.executionPlane && this.definition.mcpServers?.length) {
|
|
250
263
|
throw new Error("agent mcpServers cannot be combined with a custom executionPlane");
|
|
251
264
|
}
|
|
252
|
-
const plane =
|
|
265
|
+
const plane = binding?.executionPlane
|
|
253
266
|
?? (this.definition.mcpServers?.length
|
|
254
267
|
? (() => {
|
|
255
268
|
const servers = Object.fromEntries(this.definition.mcpServers.map(server => {
|
|
@@ -273,8 +286,8 @@ class AgentRuntimeImpl {
|
|
|
273
286
|
}
|
|
274
287
|
const runtime = {
|
|
275
288
|
provider,
|
|
276
|
-
...(mergeGuardrailPolicies(
|
|
277
|
-
? { governancePolicy: mergeGuardrailPolicies(
|
|
289
|
+
...(mergeGuardrailPolicies(binding?.runtimeOptions?.governancePolicy, this.definition.guardrails)
|
|
290
|
+
? { governancePolicy: mergeGuardrailPolicies(binding?.runtimeOptions?.governancePolicy, this.definition.guardrails) }
|
|
278
291
|
: {}),
|
|
279
292
|
...(this.definition.capabilityFilter ? { capabilityFilter: this.definition.capabilityFilter } : {}),
|
|
280
293
|
executionPlane: plane,
|
|
@@ -290,13 +303,13 @@ class AgentRuntimeImpl {
|
|
|
290
303
|
...(this.definition.memoryStore ? { memoryStore: this.definition.memoryStore } : {}),
|
|
291
304
|
...(this.definition.memoryScope ? { memoryScope: this.definition.memoryScope } : {}),
|
|
292
305
|
...(this.definition.skills?.length ? { skillCatalog: this.definition.skills } : {}),
|
|
293
|
-
...(!
|
|
306
|
+
...(!binding?.runtimeOptions?.knowledgeSource && this.definition.knowledge?.some(item => item.source.kind === "text") ? {
|
|
294
307
|
knowledgeSource: createTextKnowledgeSource(this.definition.knowledge
|
|
295
308
|
.filter((item) => item.source.kind === "text")
|
|
296
309
|
.map(item => ({ id: item.id, name: item.name, content: item.source.content }))),
|
|
297
310
|
} : {}),
|
|
298
311
|
agentId: this.name,
|
|
299
|
-
...(
|
|
312
|
+
...(binding?.runtimeOptions ?? {}),
|
|
300
313
|
...(options.onPermissionRequest ? { onPermissionRequest: options.onPermissionRequest } : {}),
|
|
301
314
|
};
|
|
302
315
|
return new RuntimeRunner(runtime);
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export { decodeDurableContent, decodeDurableToolResult } from "./runtime/durable-content.js";
|
|
2
|
+
export { decodeCanonicalContentParts, encodeCanonicalContentParts } from "./runtime/kernel-step.js";
|
|
3
|
+
export { lowerAgent, normalizeAgent } from "./agent-ir.js";
|
|
4
|
+
export { SESSION_EVENT_KINDS } from "./runtime/session-log.js";
|
|
5
|
+
export { providerAttemptToRecord } from "./runtime/execution-evidence.js";
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
// SDK conformance harness surface. Kept separate from the public root so the
|
|
2
|
+
// executable SDK contract does not accidentally grow internal protocol exports.
|
|
3
|
+
export { decodeDurableContent, decodeDurableToolResult } from "./runtime/durable-content.js";
|
|
4
|
+
export { decodeCanonicalContentParts, encodeCanonicalContentParts } from "./runtime/kernel-step.js";
|
|
5
|
+
export { lowerAgent, normalizeAgent } from "./agent-ir.js";
|
|
6
|
+
export { SESSION_EVENT_KINDS } from "./runtime/session-log.js";
|
|
7
|
+
export { providerAttemptToRecord } from "./runtime/execution-evidence.js";
|
package/dist/evals/public.d.ts
CHANGED
|
@@ -23,11 +23,17 @@ export interface EvalResult {
|
|
|
23
23
|
output: string;
|
|
24
24
|
scores: Record<string, number>;
|
|
25
25
|
}
|
|
26
|
+
export interface ExecutionEvidence {
|
|
27
|
+
contextBinding?: unknown;
|
|
28
|
+
route?: unknown;
|
|
29
|
+
measurement?: unknown;
|
|
30
|
+
artifactSet?: unknown;
|
|
31
|
+
}
|
|
26
32
|
/** Optional execution evidence kept separate from the stable score/result contract. */
|
|
27
33
|
export interface EvalTrace {
|
|
28
34
|
caseId: string;
|
|
29
35
|
executedInput: string;
|
|
30
|
-
contextBinding?:
|
|
36
|
+
contextBinding?: unknown;
|
|
31
37
|
route?: unknown;
|
|
32
38
|
measurement?: unknown;
|
|
33
39
|
artifactSet?: unknown;
|
|
@@ -41,6 +47,7 @@ export interface EvalRun {
|
|
|
41
47
|
export declare function evaluate(agent: {
|
|
42
48
|
run(input: string): Promise<{
|
|
43
49
|
output: string;
|
|
50
|
+
evidence?: ExecutionEvidence;
|
|
44
51
|
}>;
|
|
45
52
|
}, options: {
|
|
46
53
|
dataset: Dataset;
|
package/dist/evals/public.js
CHANGED
|
@@ -10,14 +10,13 @@ export async function evaluate(agent, options) {
|
|
|
10
10
|
scores[evaluator.name] = await evaluator.evaluate({ testCase, output: output.output });
|
|
11
11
|
results.push({ caseId: testCase.id, output: output.output, scores });
|
|
12
12
|
if (options.includeTrace) {
|
|
13
|
-
const evidence = output;
|
|
14
13
|
traces.push({
|
|
15
14
|
caseId: testCase.id,
|
|
16
15
|
executedInput: testCase.input,
|
|
17
|
-
...(
|
|
18
|
-
...(evidence
|
|
19
|
-
...(evidence
|
|
20
|
-
...(evidence
|
|
16
|
+
...(output.evidence?.contextBinding !== undefined ? { contextBinding: output.evidence.contextBinding } : {}),
|
|
17
|
+
...(output.evidence?.route !== undefined ? { route: output.evidence.route } : {}),
|
|
18
|
+
...(output.evidence?.measurement !== undefined ? { measurement: output.evidence.measurement } : {}),
|
|
19
|
+
...(output.evidence?.artifactSet !== undefined ? { artifactSet: output.evidence.artifactSet } : {}),
|
|
21
20
|
});
|
|
22
21
|
}
|
|
23
22
|
}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,25 +1,6 @@
|
|
|
1
1
|
export { createAgent } from "./agent-facade.js";
|
|
2
|
-
export type {
|
|
3
|
-
export {
|
|
4
|
-
export type { InstructionProfile, NudgeRule, NudgeTrigger } from "./harness/public.js";
|
|
5
|
-
export type { SignalPolicy } from "./runtime/os-profile.js";
|
|
6
|
-
export { DEFAULT_CONTEXT_POLICY, PPM_SCALE, contextPolicy, normalizeContextPolicy, ratioToPpm, } from "./runtime/context-policy.js";
|
|
7
|
-
export type { ContextPolicyOverrides, ContextPolicy, ContextPolicyWire, ContextPressureThresholds, } from "./runtime/context-policy.js";
|
|
8
|
-
export type { SessionEvent, SessionEventKind } from "./runtime/session-log.js";
|
|
9
|
-
export { SESSION_EVENT_KINDS } from "./runtime/session-log.js";
|
|
10
|
-
export { CANONICAL_CONTENT_PARTS_PREFIX, encodeCanonicalContentParts, decodeCanonicalContentParts, } from "./runtime/kernel-step.js";
|
|
11
|
-
export { InMemoryGroupBudgetStore, GroupBudgetScope } from "./runtime/run-group.js";
|
|
12
|
-
export type { RunGroup, GroupBudgetStore, GroupLedger, GroupCharge, GroupMember, GroupBudgetRequest, GroupBudgetReservation, } from "./runtime/run-group.js";
|
|
13
|
-
export { InMemoryEventStream, isVisibleTo } from "./runtime/event-stream.js";
|
|
14
|
-
export type { EventStream, EventStreamOptions, BlackboardEvent, EventViewer } from "./runtime/event-stream.js";
|
|
15
|
-
export type { ObserverFailure, ObserverErrorHandler } from "./runtime/reliability.js";
|
|
16
|
-
export type { OperationContext, BackgroundTaskFailure, BackgroundTaskErrorHandler } from "./runtime/reliability.js";
|
|
17
|
-
export { reactByMention, directorDriven, roundRobin, firstNonEmpty, union } from "./runtime/turn-policy.js";
|
|
18
|
-
export type { TurnPolicy, PeerView } from "./runtime/turn-policy.js";
|
|
19
|
-
export { ReactiveSession, readRecentTool } from "./runtime/reactive-session.js";
|
|
20
|
-
export type { ReactiveSessionOptions, ReactivePeerSpec, EmitEvent, Reaction, ReactorTurn, ReactorContext } from "./runtime/reactive-session.js";
|
|
21
|
-
export { InMemoryReactionCheckpointStore, ReactionInProgressError } from "./runtime/reaction-checkpoint.js";
|
|
22
|
-
export type { ReactionCheckpointClaim, ReactionCheckpointClaimResult, ReactionCheckpointReceipt, ReactionCheckpointStore, ReactionRecord, } from "./runtime/reaction-checkpoint.js";
|
|
2
|
+
export type { AgentRunOptions, AgentSession, DelegationRequest, DelegationResult, MemoryInput, RecallOptions, RunResult, SessionRef, } from "./agent-facade.js";
|
|
3
|
+
export type { Agent } from "./agent-facade.js";
|
|
23
4
|
export { tool, streamingTool } from "./tools/index.js";
|
|
24
5
|
export type { RegisteredTool, ToolExecContext } from "./tools/index.js";
|
|
25
6
|
export { safeTool, ok, fail, ToolError, formatToolError } from "./tools/errors.js";
|
|
@@ -32,27 +13,18 @@ export { OpenAIResponsesProvider } from "./providers/openai-responses.js";
|
|
|
32
13
|
export { createProvider, createProviderAsync, resolveProviderRuntime, resolveProviderRuntimeAsync } from "./providers/catalog.js";
|
|
33
14
|
export { UnsupportedModalityError } from "./providers/base.js";
|
|
34
15
|
export type { CreateProviderOptions, EndpointProfileId } from "./providers/catalog.js";
|
|
35
|
-
export { VERIFIABLE_REPORT_SCHEMA, VERIFIABLE_FORK_SCHEMA, assertVerifiableReportSchema, createVerifiableRuntimeAdapter, createNativeVerifiableRuntimeAdapter, VerifiableOperation, } from "./runtime/verifiable-report.js";
|
|
36
|
-
export type { VerifiableCommand, CheckVerdict, VerifiableForkManifest, ForkPlan, VerifiableEvidence, VerifyOptions, ReplayOptions, VerifiableRuntimeAdapter, VerifiableReport, VerifiableOperationJson, } from "./runtime/verifiable-report.js";
|
|
37
16
|
export type { GovernancePolicy, GovernanceConstraint } from "./governance.js";
|
|
38
|
-
export {
|
|
39
|
-
export
|
|
40
|
-
export {
|
|
41
|
-
export type {
|
|
17
|
+
export type { SessionEvent, SessionEventKind } from "./session-events.js";
|
|
18
|
+
export { SESSION_EVENT_KINDS } from "./session-events.js";
|
|
19
|
+
export { InMemoryReactionCheckpointStore } from "./reactions.js";
|
|
20
|
+
export type { ReactionCheckpointClaim, ReactionCheckpointClaimResult, ReactionCheckpointReceipt, ReactionCheckpointStore, InMemoryReactionCheckpointStoreOptions, } from "./reactions.js";
|
|
21
|
+
export type { ModelRef, ModelRequirement } from "./agent.js";
|
|
42
22
|
export type { Guardrail } from "./guardrail.js";
|
|
43
23
|
export type { MCPServer, McpTransport } from "./mcp-server.js";
|
|
44
24
|
export type { Knowledge, KnowledgeSourceRef } from "./knowledge/public.js";
|
|
45
|
-
export { createTextKnowledgeSource } from "./knowledge/public.js";
|
|
46
|
-
export type { TextKnowledgeDocument } from "./knowledge/public.js";
|
|
47
|
-
export { agentRefName } from "./handoff-target.js";
|
|
48
25
|
export type { AgentRef, Handoff } from "./handoff-target.js";
|
|
49
|
-
export type { Session } from "./session.js";
|
|
50
26
|
export { createWorkflow } from "./workflow/definition.js";
|
|
51
27
|
export type { WorkflowDefinition, WorkflowStep, WorkflowResult } from "./workflow/definition.js";
|
|
52
28
|
export { evaluate } from "./evals/public.js";
|
|
53
|
-
export type { Dataset, DatasetCase, Evaluator, EvalResult, EvalRun, EvalTrace } from "./evals/public.js";
|
|
54
|
-
export type { RuntimeSignal, SignalClaim, SignalDeliveryReceipt, SignalSource, } from "./signals/types.js";
|
|
29
|
+
export type { Dataset, DatasetCase, Evaluator, EvalResult, EvalRun, EvalTrace, ExecutionEvidence } from "./evals/public.js";
|
|
55
30
|
export type { ModelMessage, RuntimeMessage, StoredMessage, WireMessage, ToolCall, ToolExecutionResult, ToolSchema, ContentPart, TextPart, ImagePart, AudioPart, MediaSource, ContentBlockText, ContentBlockImage, ContentBlockAudio, ContentBlockVideo, ContentBlockFile, StreamEvent, TextDelta, ThinkingDelta, ToolCallEvent, ToolChunk, ToolDeltaEvent, ToolSuspendEvent, ToolResultEvent, ToolAuditFailedEvent, DoneEvent, ErrorEvent, PermissionRequestEvent, PermissionResolvedEvent, PermissionResponse, EntropySample, EntropySampleEvent, EntropyAlertEvent, EntropyWatchOptions, LLMProvider, RetryConfig, TokenUsage, ProviderWireEvidence, ProviderTransportTelemetry, } from "./types.js";
|
|
56
|
-
export { DurableContentError, decodeDurableContent, decodeDurableToolResult, encodeDurableContent, encodeDurableToolResult, toolOutputBlocksToDurable, durableBlocksToToolOutput, } from "./runtime/durable-content.js";
|
|
57
|
-
export type { DurableContent, DurableContentBlock, DurableSource, DurableToolResult } from "./runtime/durable-content.js";
|
|
58
|
-
export type { WorkflowSpec, WorkflowNodeSpec, SchedulingFactors, WorkflowDependencyPolicy, WorkflowContextInclude, WorkflowDependencyMode, WorkflowContextPolicy, WorkflowNodeStatus, WorkflowNodeOutcome, WorkflowOutcome, } from "./types/agent.js";
|
package/dist/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// ╔══════════════════════════════════════════════════════════════════════════╗
|
|
2
|
-
// ║ @deepstrike/sdk — root surface (v0.2.
|
|
2
|
+
// ║ @deepstrike/sdk — root surface (v0.2.73). ║
|
|
3
3
|
// ║ ║
|
|
4
4
|
// ║ This is the intent layer: run an agent, run a workflow, author a tool, ║
|
|
5
5
|
// ║ pick a provider. Advanced machinery lives behind subpaths: ║
|
|
@@ -13,18 +13,6 @@
|
|
|
13
13
|
// ── Start here: the canonical entry points ─────────────────────────────────
|
|
14
14
|
// ③ dynamic loop agents: self-pacing rounds over the kernel pacing trap.
|
|
15
15
|
export { createAgent } from "./agent-facade.js";
|
|
16
|
-
export { collectText } from "./runtime/runner.js";
|
|
17
|
-
export { DEFAULT_CONTEXT_POLICY, PPM_SCALE, contextPolicy, normalizeContextPolicy, ratioToPpm, } from "./runtime/context-policy.js";
|
|
18
|
-
// Registered session-event vocabulary (F9/S3; manifest-pinned by sdk-conformance, P7-S4)
|
|
19
|
-
export { SESSION_EVENT_KINDS } from "./runtime/session-log.js";
|
|
20
|
-
// ── content-parts-v1 registered encoding (F14/B5; byte-pinned by sdk-conformance) ──
|
|
21
|
-
export { CANONICAL_CONTENT_PARTS_PREFIX, encodeCanonicalContentParts, decodeCanonicalContentParts, } from "./runtime/kernel-step.js";
|
|
22
|
-
// ── Durable transaction capability (Canonical Kernel ABI §9.1) ──────────────
|
|
23
|
-
export { InMemoryGroupBudgetStore, GroupBudgetScope } from "./runtime/run-group.js";
|
|
24
|
-
export { InMemoryEventStream, isVisibleTo } from "./runtime/event-stream.js";
|
|
25
|
-
export { reactByMention, directorDriven, roundRobin, firstNonEmpty, union } from "./runtime/turn-policy.js";
|
|
26
|
-
export { ReactiveSession, readRecentTool } from "./runtime/reactive-session.js";
|
|
27
|
-
export { InMemoryReactionCheckpointStore, ReactionInProgressError } from "./runtime/reaction-checkpoint.js";
|
|
28
16
|
// ── Tool authoring ──────────────────────────────────────────────────────────
|
|
29
17
|
export { tool, streamingTool } from "./tools/index.js";
|
|
30
18
|
export { safeTool, ok, fail, ToolError, formatToolError } from "./tools/errors.js";
|
|
@@ -36,14 +24,7 @@ export { OpenAIProvider } from "./providers/openai.js";
|
|
|
36
24
|
export { OpenAIResponsesProvider } from "./providers/openai-responses.js";
|
|
37
25
|
export { createProvider, createProviderAsync, resolveProviderRuntime, resolveProviderRuntimeAsync } from "./providers/catalog.js";
|
|
38
26
|
export { UnsupportedModalityError } from "./providers/base.js";
|
|
39
|
-
export {
|
|
40
|
-
|
|
41
|
-
// Parallel fan-out / sub-agent delegation. The full orchestration layer is in `@deepstrike/sdk/workflow`.
|
|
42
|
-
// ── Ecosystem Surface Contract (spc_001) ────────────────────────────────────
|
|
43
|
-
export { Agent } from "./agent.js";
|
|
44
|
-
export { lowerAgent, normalizeAgent } from "./agent-ir.js";
|
|
45
|
-
export { createTextKnowledgeSource } from "./knowledge/public.js";
|
|
46
|
-
export { agentRefName } from "./handoff-target.js";
|
|
27
|
+
export { SESSION_EVENT_KINDS } from "./session-events.js";
|
|
28
|
+
export { InMemoryReactionCheckpointStore } from "./reactions.js";
|
|
47
29
|
export { createWorkflow } from "./workflow/definition.js";
|
|
48
30
|
export { evaluate } from "./evals/public.js";
|
|
49
|
-
export { DurableContentError, decodeDurableContent, decodeDurableToolResult, encodeDurableContent, encodeDurableToolResult, toolOutputBlocksToDurable, durableBlocksToToolOutput, } from "./runtime/durable-content.js";
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
export { InMemoryReactionCheckpointStore, } from "./runtime/reaction-checkpoint.js";
|
|
2
|
+
export type { ReactionCheckpointClaim, ReactionCheckpointClaimResult, ReactionCheckpointReceipt, ReactionCheckpointStore, InMemoryReactionCheckpointStoreOptions, } from "./runtime/reaction-checkpoint.js";
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* conformance tests and documentation tooling so each term has one primary layer.
|
|
6
6
|
*/
|
|
7
7
|
export declare const RUNTIME_VOCABULARY: {
|
|
8
|
-
readonly version: "0.2.
|
|
8
|
+
readonly version: "0.2.73";
|
|
9
9
|
readonly public: readonly ["Agent", "Model", "Run", "Session", "Tool", "Skill", "Memory", "Knowledge", "MCPServer", "Handoff", "Workflow", "Guardrail", "Eval", "Dataset", "Evaluator", "Output", "Usage"];
|
|
10
10
|
readonly host: readonly ["AgentSpec", "Context", "ContextPlan", "Capability", "ModelRoute", "Invocation", "ProviderAttempt", "Measurement", "Evidence", "Artifact", "Evaluation", "Promotion", "ExecutionPlane"];
|
|
11
11
|
readonly kernel: readonly ["Operation", "Intent", "Decision", "Effect", "Fact", "Settlement", "Task", "Capability", "Budget", "Journal", "Checkpoint", "StateTransition"];
|
package/dist/runtime-language.js
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* conformance tests and documentation tooling so each term has one primary layer.
|
|
6
6
|
*/
|
|
7
7
|
export const RUNTIME_VOCABULARY = {
|
|
8
|
-
version: "0.2.
|
|
8
|
+
version: "0.2.73",
|
|
9
9
|
public: [
|
|
10
10
|
"Agent", "Model", "Run", "Session", "Tool", "Skill", "Memory", "Knowledge",
|
|
11
11
|
"MCPServer", "Handoff", "Workflow", "Guardrail", "Eval", "Dataset", "Evaluator",
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { SESSION_EVENT_KINDS } from "./runtime/session-log.js";
|
package/dist/types.d.ts
CHANGED
|
@@ -393,7 +393,7 @@ export interface RetryConfig {
|
|
|
393
393
|
* Responses `previous_response_id` without leaking those semantics into the kernel.
|
|
394
394
|
*/
|
|
395
395
|
export type ProviderRunState = Record<string, unknown>;
|
|
396
|
-
export type
|
|
396
|
+
export type GenerationProtocol = "anthropic-messages" | "openai-chat" | "openai-responses" | "gemini";
|
|
397
397
|
/**
|
|
398
398
|
* Strategy for placing Anthropic-protocol `cache_control` breakpoints across a request's
|
|
399
399
|
* static prefix (tools + system blocks) and rolling history (messages). Pass via the
|
|
@@ -424,7 +424,7 @@ export type ProviderProtocol = "anthropic-messages" | "openai-chat" | "openai-re
|
|
|
424
424
|
export type CacheBreakpointStrategy = "default" | "tools-only" | "system-only" | "frozen-prefix" | "none";
|
|
425
425
|
export interface ProviderDescriptor {
|
|
426
426
|
provider: string;
|
|
427
|
-
protocol:
|
|
427
|
+
protocol: GenerationProtocol;
|
|
428
428
|
model: string;
|
|
429
429
|
reasoning: {
|
|
430
430
|
supported: boolean;
|
|
@@ -439,7 +439,7 @@ export interface ProviderDescriptor {
|
|
|
439
439
|
/** Provider-native fields required to replay a turn across requests (thinking blocks, reasoning_content, etc.). */
|
|
440
440
|
export interface ProviderReplay {
|
|
441
441
|
provider?: string;
|
|
442
|
-
protocol:
|
|
442
|
+
protocol: GenerationProtocol;
|
|
443
443
|
model?: string;
|
|
444
444
|
/** Anthropic-style assistant content blocks (thinking, text, tool_use). */
|
|
445
445
|
native_blocks?: Array<Record<string, unknown>>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@deepstrike/sdk",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.73",
|
|
4
4
|
"description": "DeepStrike Node.js SDK",
|
|
5
5
|
"license": "SEE LICENSE IN LICENSE",
|
|
6
6
|
"type": "module",
|
|
@@ -94,7 +94,7 @@
|
|
|
94
94
|
},
|
|
95
95
|
"dependencies": {
|
|
96
96
|
"@anthropic-ai/sdk": "^0.99.0",
|
|
97
|
-
"@deepstrike/core": "0.2.
|
|
97
|
+
"@deepstrike/core": "0.2.73",
|
|
98
98
|
"@google/generative-ai": "^0.24.1",
|
|
99
99
|
"openai": "^7.5.0"
|
|
100
100
|
},
|