@deepstrike/sdk 0.2.71 → 0.2.72

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.
Files changed (77) hide show
  1. package/README.md +27 -3
  2. package/dist/advanced/public.d.ts +4 -0
  3. package/dist/advanced/public.js +2 -0
  4. package/dist/agent-facade.d.ts +19 -6
  5. package/dist/agent-facade.js +118 -20
  6. package/dist/agent-ir.d.ts +11 -5
  7. package/dist/agent-ir.js +42 -26
  8. package/dist/canonical-prefix-allowlist.d.ts +6 -0
  9. package/dist/canonical-prefix-allowlist.js +30 -0
  10. package/dist/evals/public.d.ts +50 -0
  11. package/dist/evals/public.js +25 -0
  12. package/dist/guardrail.d.ts +4 -1
  13. package/dist/handoff-target.d.ts +2 -0
  14. package/dist/handoff-target.js +7 -1
  15. package/dist/index.d.ts +10 -16
  16. package/dist/index.js +5 -7
  17. package/dist/kernel.d.ts +2 -2
  18. package/dist/knowledge/public.d.ts +2 -0
  19. package/dist/knowledge/public.js +1 -1
  20. package/dist/knowledge/source.d.ts +7 -0
  21. package/dist/knowledge/source.js +20 -1
  22. package/dist/memory/protocols.d.ts +2 -2
  23. package/dist/projection-pairs.d.ts +43 -0
  24. package/dist/projection-pairs.js +9 -0
  25. package/dist/providers/anthropic-adapter.d.ts +2 -2
  26. package/dist/providers/anthropic.d.ts +4 -4
  27. package/dist/providers/base.d.ts +5 -5
  28. package/dist/providers/content-normalization.d.ts +4 -4
  29. package/dist/providers/gemini-adapter.d.ts +2 -2
  30. package/dist/providers/gemini.d.ts +3 -3
  31. package/dist/providers/ollama-adapter.d.ts +2 -2
  32. package/dist/providers/ollama.d.ts +2 -2
  33. package/dist/providers/openai-chat.d.ts +4 -4
  34. package/dist/providers/openai-responses-adapter.d.ts +2 -2
  35. package/dist/providers/openai-responses.d.ts +2 -2
  36. package/dist/providers/openai.d.ts +4 -4
  37. package/dist/providers/protocol-adapter.d.ts +2 -2
  38. package/dist/providers/protocol-capabilities.d.ts +1 -0
  39. package/dist/providers/protocol-capabilities.js +3 -0
  40. package/dist/providers/public.d.ts +4 -2
  41. package/dist/providers/public.js +2 -1
  42. package/dist/providers/replay-validator.d.ts +3 -3
  43. package/dist/runtime/archive.d.ts +7 -7
  44. package/dist/runtime/canonical-kernel-step.d.ts +2 -2
  45. package/dist/runtime/context-manager.d.ts +56 -0
  46. package/dist/runtime/context-manager.js +112 -0
  47. package/dist/runtime/eval.d.ts +2 -2
  48. package/dist/runtime/kernel-step.d.ts +5 -5
  49. package/dist/runtime/provider-replay.d.ts +2 -2
  50. package/dist/runtime/public.d.ts +22 -0
  51. package/dist/runtime/public.js +11 -0
  52. package/dist/runtime/replay-fixture.d.ts +3 -3
  53. package/dist/runtime/replay-fixture.js +1 -1
  54. package/dist/runtime/replay-provider.d.ts +4 -4
  55. package/dist/runtime/replay-provider.js +1 -1
  56. package/dist/runtime/runner.d.ts +17 -5
  57. package/dist/runtime/runner.js +110 -37
  58. package/dist/runtime/session-log.d.ts +1 -1
  59. package/dist/runtime/session-repair.d.ts +2 -2
  60. package/dist/runtime/workflow-control-flow.d.ts +1 -1
  61. package/dist/runtime/workflow-control-flow.js +16 -2
  62. package/dist/runtime-classification.d.ts +161 -0
  63. package/dist/runtime-classification.js +66 -0
  64. package/dist/runtime-language.d.ts +32 -0
  65. package/dist/runtime-language.js +51 -0
  66. package/dist/skill.d.ts +31 -5
  67. package/dist/types/agent.d.ts +17 -4
  68. package/dist/types.d.ts +22 -12
  69. package/dist/workflow/definition.d.ts +19 -0
  70. package/dist/workflow/definition.js +29 -0
  71. package/dist/workflow/public.d.ts +3 -1
  72. package/dist/workflow/public.js +1 -0
  73. package/package.json +16 -2
  74. package/dist/compat/anthropic/mcp.d.ts +0 -15
  75. package/dist/compat/anthropic/mcp.js +0 -10
  76. package/dist/compat/openai/agent.d.ts +0 -34
  77. package/dist/compat/openai/agent.js +0 -24
@@ -0,0 +1,51 @@
1
+ /**
2
+ * SPC-028-01: the normative vocabulary for the four runtime language layers.
3
+ *
4
+ * Terms are names, not a second semantic authority. The registry is consumed by
5
+ * conformance tests and documentation tooling so each term has one primary layer.
6
+ */
7
+ export const RUNTIME_VOCABULARY = {
8
+ version: "0.2.72",
9
+ public: [
10
+ "Agent", "Model", "Run", "Session", "Tool", "Skill", "Memory", "Knowledge",
11
+ "MCPServer", "Handoff", "Workflow", "Guardrail", "Eval", "Dataset", "Evaluator",
12
+ "Output", "Usage",
13
+ ],
14
+ host: [
15
+ "AgentSpec", "Context", "ContextPlan", "Capability", "ModelRoute", "Invocation",
16
+ "ProviderAttempt", "Measurement", "Evidence", "Artifact", "Evaluation", "Promotion",
17
+ "ExecutionPlane",
18
+ ],
19
+ kernel: [
20
+ "Operation", "Intent", "Decision", "Effect", "Fact", "Settlement", "Task", "Capability",
21
+ "Budget", "Journal", "Checkpoint", "StateTransition",
22
+ ],
23
+ provider: [
24
+ "Model", "Provider", "Endpoint", "Protocol", "Route", "Adapter", "Request", "Response",
25
+ "Usage", "ReplayEvidence",
26
+ ],
27
+ primaryDomain: {
28
+ Model: "public",
29
+ Usage: "public",
30
+ Capability: "host",
31
+ Route: "host",
32
+ },
33
+ verbs: {
34
+ resolve: "select or answer a runtime object at a boundary",
35
+ render: "project semantic state into model-facing input",
36
+ encode: "map semantic input into a wire request",
37
+ execute: "perform one physical provider or external call",
38
+ decode: "extract semantic output and retained wire evidence",
39
+ normalize: "map vendor data into the controlled runtime vocabulary",
40
+ settle: "apply accounting policy to an observed measurement",
41
+ },
42
+ };
43
+ /** Returns all layer terms while preserving the registry's primary-domain order. */
44
+ export function runtimeVocabularyTerms() {
45
+ return [
46
+ ...RUNTIME_VOCABULARY.public,
47
+ ...RUNTIME_VOCABULARY.host,
48
+ ...RUNTIME_VOCABULARY.kernel,
49
+ ...RUNTIME_VOCABULARY.provider,
50
+ ];
51
+ }
package/dist/skill.d.ts CHANGED
@@ -1,13 +1,39 @@
1
+ export interface SkillResource {
2
+ name: string;
3
+ uri?: string;
4
+ content?: string;
5
+ metadata?: Record<string, unknown>;
6
+ }
7
+ export interface SkillScript {
8
+ name: string;
9
+ command: string;
10
+ description?: string;
11
+ metadata?: Record<string, unknown>;
12
+ }
13
+ export type SkillTool = string | {
14
+ name: string;
15
+ description?: string;
16
+ inputSchema?: Record<string, unknown>;
17
+ };
18
+ export type SkillMCPServer = string | {
19
+ name: string;
20
+ transport: Record<string, unknown>;
21
+ };
22
+ export type SkillKnowledge = string | {
23
+ name: string;
24
+ content?: string;
25
+ source?: unknown;
26
+ };
1
27
  /** spc_001 §2.4: public Skill contract, built directly on `SKILL.md`-style frontmatter files. */
2
28
  export interface Skill {
3
29
  name: string;
4
30
  description?: string;
5
31
  instructions?: string;
6
- resources?: unknown[];
7
- scripts?: unknown[];
8
- tools?: unknown[];
9
- mcpServers?: unknown[];
10
- knowledge?: unknown[];
32
+ resources?: SkillResource[];
33
+ scripts?: SkillScript[];
34
+ tools?: SkillTool[];
35
+ mcpServers?: SkillMCPServer[];
36
+ knowledge?: SkillKnowledge[];
11
37
  metadata?: Record<string, unknown>;
12
38
  providerOptions?: Record<string, unknown>;
13
39
  }
@@ -1,4 +1,4 @@
1
- import type { ProviderMessage, ToolSchema } from "../types.js";
1
+ import type { ModelMessage, ToolSchema } from "../types.js";
2
2
  export type KernelAgentRole = "explore" | "plan" | "implement" | "verify" | "custom";
3
3
  export type AgentIsolation = "shared" | "read_only" | "worktree" | "remote";
4
4
  export type ContextInheritance = "none" | "system_only" | "full";
@@ -86,7 +86,7 @@ export interface AgentProcessChangedObservation {
86
86
  }
87
87
  export interface LoopResult {
88
88
  termination: TerminationReason | string;
89
- finalMessage?: ProviderMessage;
89
+ finalMessage?: ModelMessage;
90
90
  turnsUsed: number;
91
91
  totalTokensUsed: number;
92
92
  /** loop-control loop stop signal: a loop iteration sets `false` to end the loop before `max_iters`.
@@ -163,6 +163,13 @@ export type WorkflowTaskSpec = {
163
163
  /** W3 trust level for a workflow node. */
164
164
  export type NodeTrust = "trusted" | "quarantined";
165
165
  export type WorkflowDependencyPolicy = "all_success" | "accept_partial" | "all_terminal" | "optional";
166
+ export type WorkflowContextInclude = "dependency_outputs" | "memory" | "knowledge";
167
+ export type WorkflowDependencyMode = "full" | "summary" | "reference";
168
+ export interface WorkflowContextPolicy {
169
+ include?: WorkflowContextInclude[];
170
+ dependencyMode?: WorkflowDependencyMode;
171
+ maxTokens?: number;
172
+ }
166
173
  export type WorkflowNodeStatus = "completed" | "completed_partial" | "failed" | "skipped_upstream_failed";
167
174
  /** Host-observed, deterministic scheduling inputs for one workflow node. They never originate
168
175
  * from model-authored workflow tools. */
@@ -175,8 +182,14 @@ export interface SchedulingFactors {
175
182
  export declare function workflowNodeStatusFromTermination(termination: TerminationReason | string): WorkflowNodeStatus;
176
183
  /** One node in a declarative workflow DAG (camelCase host shape). */
177
184
  export interface WorkflowNodeSpec {
185
+ /** Stable public workflow step key; host-only metadata for lowering and diagnostics. */
186
+ nodeId?: string;
178
187
  task: WorkflowTaskSpec;
179
188
  role: KernelAgentRole;
189
+ /** Public workflow binding retained by the host while lowering the node to a kernel agent run. */
190
+ agent?: string;
191
+ /** Host context contract; dependency data is narrowed before entering the child goal. */
192
+ context?: WorkflowContextPolicy;
180
193
  isolation?: AgentIsolation;
181
194
  contextInheritance?: ContextInheritance;
182
195
  modelHint?: string;
@@ -228,7 +241,7 @@ export interface KernelWorkflowNodeOutcome {
228
241
  status: WorkflowNodeStatus;
229
242
  termination?: TerminationReason;
230
243
  output?: {
231
- role: ProviderMessage["role"];
244
+ role: ModelMessage["role"];
232
245
  content: string;
233
246
  tool_calls?: Array<{
234
247
  id: string;
@@ -241,7 +254,7 @@ export interface WorkflowNodeOutcome {
241
254
  nodeId: string;
242
255
  status: WorkflowNodeStatus;
243
256
  termination?: TerminationReason;
244
- output?: ProviderMessage;
257
+ output?: ModelMessage;
245
258
  }
246
259
  /** A control-plane request rejected before any workflow effect started. */
247
260
  export interface ControlRequestRejection {
package/dist/types.d.ts CHANGED
@@ -84,7 +84,8 @@ export interface ContentBlockFile {
84
84
  /** Legal content returned by a tool. Deliberately excludes ToolExecutionResult, so nesting is
85
85
  * unrepresentable in the canonical type. */
86
86
  export type ToolOutputBlock = ContentBlockText | ContentBlockImage | ContentBlockAudio | ContentBlockVideo | ContentBlockFile;
87
- export interface ProviderMessage {
87
+ /** Semantic message consumed by the model invocation layer. Provider wire messages are adapter-local. */
88
+ export interface ModelMessage {
88
89
  role: "system" | "user" | "assistant" | "tool";
89
90
  /** Plain-text content. When `contentParts` is present, this holds only the text segments. */
90
91
  content: string;
@@ -92,6 +93,17 @@ export interface ProviderMessage {
92
93
  contentParts?: ContentPart[];
93
94
  toolCalls?: ToolCall[];
94
95
  }
96
+ /** Stored durable representation. It references the semantic message without becoming a second content authority. */
97
+ export interface StoredMessage extends ModelMessage {
98
+ readonly messageId?: string;
99
+ readonly createdAt?: number;
100
+ }
101
+ /** Host execution representation; contentParts remains the structured content authority. */
102
+ export interface RuntimeMessage extends ModelMessage {
103
+ readonly messageId?: string;
104
+ }
105
+ /** Provider wire representation is adapter-owned and intentionally opaque at the SDK boundary. */
106
+ export type WireMessage = Readonly<Record<string, unknown>>;
95
107
  export interface ToolCall {
96
108
  id: string;
97
109
  name: string;
@@ -478,7 +490,7 @@ export interface RenderedContext {
478
490
  /** Knowledge (memory retrievals, skill definitions, artifacts). Anthropic system[1] with cache_control. */
479
491
  systemKnowledge?: string;
480
492
  /** History turns only — the stable, cacheable message prefix. */
481
- turns: ProviderMessage[];
493
+ turns: ModelMessage[];
482
494
  /**
483
495
  * Volatile State turn (task_state + signals), rebuilt every call. Providers
484
496
  * render it after the cacheable history (Anthropic: after the cache breakpoint;
@@ -486,7 +498,7 @@ export interface RenderedContext {
486
498
  * older binding that has not been rebuilt — then the State turn is still inside
487
499
  * `turns[0]` and providers render `turns` as-is.
488
500
  */
489
- stateTurn?: ProviderMessage;
501
+ stateTurn?: ModelMessage;
490
502
  /**
491
503
  * P1-E: count of leading `turns` forming the frozen prefix — byte-stable until the next
492
504
  * compaction. The Anthropic provider pins a deep cache breakpoint at this boundary (a long-lived
@@ -531,7 +543,7 @@ export interface LLMProvider {
531
543
  */
532
544
  runtimePolicy?(): RuntimePolicy;
533
545
  /** Read provider-native replay fields captured after the most recent assistant turn. */
534
- peekProviderReplay?(message: Pick<ProviderMessage, "content" | "toolCalls">): ProviderReplay | undefined;
546
+ peekProviderReplay?(message: Pick<ModelMessage, "content" | "toolCalls">): ProviderReplay | undefined;
535
547
  /**
536
548
  * P4-S1: read the transport facts captured during the most recent execution (HTTP rung count,
537
549
  * wire response id). Optional — a provider without it simply omits the telemetry and the
@@ -540,7 +552,7 @@ export interface LLMProvider {
540
552
  */
541
553
  peekTransportTelemetry?(): ProviderTransportTelemetry | undefined;
542
554
  /** Restore provider-native replay fields when rebuilding history from SessionLog. */
543
- seedProviderReplay?(message: Pick<ProviderMessage, "content" | "toolCalls">, replay: ProviderReplay): void;
555
+ seedProviderReplay?(message: Pick<ModelMessage, "content" | "toolCalls">, replay: ProviderReplay): void;
544
556
  /**
545
557
  * Pre-flight query: would this history validate against this provider with the
546
558
  * given extensions, without sending the request? Returns the tool-call ids
@@ -554,13 +566,11 @@ export interface LLMProvider {
554
566
  * (Anthropic `messages.countTokens` and Gemini `countTokens`),
555
567
  * where the vendor offers one. Optional — providers without a native endpoint simply omit it,
556
568
  * and callers fall back to `FallbackEstimator` (Rust `context::token_engine`, spc_011-C-01) or
557
- * a local tokenizer. Not currently invoked by any dispatch loop (nothing in the Rust kernel
558
- * emits `EffectKind::MeasurePrompt` yet see its doc comment); this method exists so the
559
- * capability remains directly callable, but no dispatch trigger is enabled until request
560
- * fingerprinting and durable measurement semantics are defined.
569
+ * a local tokenizer. The host runner invokes this capability during provider request
570
+ * preparation and binds the resulting measurement to the prepared request fingerprint.
561
571
  */
562
572
  countTokens?(context: RenderedContext, tools: ToolSchema[], extensions?: Record<string, unknown>, state?: ProviderRunState): Promise<PromptMeasurement>;
563
- complete(context: RenderedContext, tools: ToolSchema[], extensions?: Record<string, unknown>): Promise<ProviderMessage>;
573
+ complete(context: RenderedContext, tools: ToolSchema[], extensions?: Record<string, unknown>): Promise<ModelMessage>;
564
574
  stream(context: RenderedContext, tools: ToolSchema[], extensions?: Record<string, unknown>, state?: ProviderRunState,
565
575
  /** #2-B-ii: when provided, a preempting `InterruptNow` (or `interrupt()`) aborts the in-flight
566
576
  * request. SDK-client providers should forward it to the client (`{ signal }`); the runner also
@@ -573,14 +583,14 @@ export interface LLMProvider {
573
583
  * Produces a richer LLM-generated summary that replaces the rule-based one on next wake.
574
584
  */
575
585
  export interface AsyncSummarizer {
576
- summarize(archived: ProviderMessage[], action: string): Promise<string>;
586
+ summarize(archived: ModelMessage[], action: string): Promise<string>;
577
587
  }
578
588
  /**
579
589
  * Durable-memory summarizer for semantic `page_out` events (Layer 5 contract).
580
590
  * The kernel emits `page_out { tier_hint: "semantic" }`; the SDK persists an LLM summary to MemoryStore.
581
591
  */
582
592
  export interface MemorySummarizer {
583
- summarize(archived: ProviderMessage[], context: {
593
+ summarize(archived: ModelMessage[], context: {
584
594
  action?: string;
585
595
  }): Promise<string>;
586
596
  }
@@ -0,0 +1,19 @@
1
+ import type { Agent } from "../agent.js";
2
+ import type { AgentRef } from "../handoff-target.js";
3
+ import type { WorkflowContextPolicy, WorkflowDependencyPolicy, WorkflowOutcome, WorkflowSpec } from "../types/agent.js";
4
+ export interface WorkflowStep {
5
+ agent: Agent | AgentRef;
6
+ input: string;
7
+ dependsOn?: string[];
8
+ dependencyPolicy?: WorkflowDependencyPolicy;
9
+ context?: WorkflowContextPolicy;
10
+ metadata?: Record<string, unknown>;
11
+ }
12
+ export interface WorkflowDefinition {
13
+ name?: string;
14
+ steps: Record<string, WorkflowStep>;
15
+ metadata?: Record<string, unknown>;
16
+ }
17
+ export declare function lowerWorkflowDefinition(definition: WorkflowDefinition): WorkflowSpec;
18
+ export type WorkflowResult = WorkflowOutcome;
19
+ export declare function createWorkflow(definition: WorkflowDefinition): WorkflowDefinition;
@@ -0,0 +1,29 @@
1
+ import { agentRefName } from "../handoff-target.js";
2
+ export function lowerWorkflowDefinition(definition) {
3
+ const entries = Object.entries(definition.steps);
4
+ const indexById = new Map(entries.map(([nodeId], index) => [nodeId, index]));
5
+ return {
6
+ nodes: entries.map(([nodeId, step]) => ({
7
+ ...(() => {
8
+ const dependsOn = step.dependsOn?.map(dependencyId => {
9
+ const index = indexById.get(dependencyId);
10
+ if (index === undefined)
11
+ throw new Error(`workflow step "${nodeId}" depends on unknown step "${dependencyId}"`);
12
+ return index;
13
+ });
14
+ return dependsOn ? { dependsOn } : {};
15
+ })(),
16
+ nodeId,
17
+ task: { goal: step.input },
18
+ role: "implement",
19
+ isolation: "read_only",
20
+ contextInheritance: "system_only",
21
+ dependencyPolicy: step.dependencyPolicy,
22
+ context: step.context,
23
+ agent: agentRefName(step.agent),
24
+ })),
25
+ };
26
+ }
27
+ export function createWorkflow(definition) {
28
+ return Object.freeze({ ...definition, steps: Object.freeze({ ...definition.steps }) });
29
+ }
@@ -3,8 +3,10 @@ export type { SubAgentRunContext } from "../runtime/sub-agent-orchestrator.js";
3
3
  export { builtinReducers, resolveReducer } from "../runtime/reducers.js";
4
4
  export type { Reducer, ReducerRegistry, ReducerInput } from "../runtime/reducers.js";
5
5
  export { FileWorkflowStore } from "../runtime/workflow-store.js";
6
+ export { createWorkflow, lowerWorkflowDefinition } from "./definition.js";
7
+ export type { WorkflowDefinition, WorkflowStep, WorkflowResult } from "./definition.js";
6
8
  export { submitWorkflowNodesTool, startWorkflowTool, generateAndFilter, verifyRules, genEval, milestoneCheckPass, milestoneCheckFail, MILESTONE_UNVERIFIED_REASON, } from "../types/agent.js";
7
- export type { AgentCapabilityFilter, AgentIdentity, AgentIsolation, AgentRunSpec, AgentProcessChangedObservation, ContextInheritance, KernelAgentRole, LoopResult, MilestoneCheckResult, MilestoneContract, MilestonePhase, MilestonePolicy, SubAgentResult, TerminationReason, WorkflowSpawnInfo, WorkflowTaskSpec, WorkflowDependencyPolicy, WorkflowNodeStatus, WorkflowNodeOutcome, WorkflowOutcome, } from "../types/agent.js";
9
+ export type { AgentCapabilityFilter, AgentIdentity, AgentIsolation, AgentRunSpec, AgentProcessChangedObservation, ContextInheritance, KernelAgentRole, LoopResult, MilestoneCheckResult, MilestoneContract, MilestonePhase, MilestonePolicy, SubAgentResult, TerminationReason, WorkflowSpawnInfo, WorkflowTaskSpec, WorkflowDependencyPolicy, WorkflowContextInclude, WorkflowDependencyMode, WorkflowContextPolicy, WorkflowNodeStatus, WorkflowNodeOutcome, WorkflowOutcome, } from "../types/agent.js";
8
10
  export type { AcceptanceCriterion, VerificationContract, ContractCheckResult } from "../collaboration/contract.js";
9
11
  export { ContractBuilder, formatContractForSystemPrompt, contractToCriteriaStrings } from "../collaboration/contract.js";
10
12
  export type { AgentRole, IsolatedVerifierContext, CoordinatorConfig } from "../collaboration/pool.js";
@@ -5,6 +5,7 @@
5
5
  export { SubAgentOrchestrator, defaultSubAgentOrchestrator, spawnStandalone } from "../runtime/sub-agent-orchestrator.js";
6
6
  export { builtinReducers, resolveReducer } from "../runtime/reducers.js";
7
7
  export { FileWorkflowStore } from "../runtime/workflow-store.js";
8
+ export { createWorkflow, lowerWorkflowDefinition } from "./definition.js";
8
9
  export { submitWorkflowNodesTool, startWorkflowTool, generateAndFilter, verifyRules, genEval, milestoneCheckPass, milestoneCheckFail, MILESTONE_UNVERIFIED_REASON, } from "../types/agent.js";
9
10
  export { ContractBuilder, formatContractForSystemPrompt, contractToCriteriaStrings } from "../collaboration/contract.js";
10
11
  export { HandoffBus } from "../collaboration/handoff.js";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@deepstrike/sdk",
3
- "version": "0.2.71",
3
+ "version": "0.2.72",
4
4
  "description": "DeepStrike Node.js SDK",
5
5
  "license": "SEE LICENSE IN LICENSE",
6
6
  "type": "module",
@@ -38,6 +38,14 @@
38
38
  "./advanced": {
39
39
  "types": "./dist/advanced/public.d.ts",
40
40
  "import": "./dist/advanced/public.js"
41
+ },
42
+ "./runtime": {
43
+ "types": "./dist/runtime/public.d.ts",
44
+ "import": "./dist/runtime/public.js"
45
+ },
46
+ "./evals": {
47
+ "types": "./dist/evals/public.d.ts",
48
+ "import": "./dist/evals/public.js"
41
49
  }
42
50
  },
43
51
  "typesVersions": {
@@ -62,6 +70,12 @@
62
70
  ],
63
71
  "advanced": [
64
72
  "./dist/advanced/public.d.ts"
73
+ ],
74
+ "runtime": [
75
+ "./dist/runtime/public.d.ts"
76
+ ],
77
+ "evals": [
78
+ "./dist/evals/public.d.ts"
65
79
  ]
66
80
  }
67
81
  },
@@ -80,7 +94,7 @@
80
94
  },
81
95
  "dependencies": {
82
96
  "@anthropic-ai/sdk": "^0.99.0",
83
- "@deepstrike/core": "0.2.71",
97
+ "@deepstrike/core": "0.2.72",
84
98
  "@google/generative-ai": "^0.24.1",
85
99
  "openai": "^7.5.0"
86
100
  },
@@ -1,15 +0,0 @@
1
- import type { MCPServer } from "../../mcp-server.js";
2
- /** spc_007 §3: minimal Anthropic/Claude-style MCP server config shape (the per-server object in
3
- * a Claude Desktop-style `mcpServers` map — `{ command, args, env }`), not a live SDK type
4
- * import — this adapter reads a serialized config (e.g.
5
- * `__fixtures__/anthropic-mcp-config.json`). */
6
- export interface AnthropicMcpConfigJson {
7
- name?: string;
8
- command: string;
9
- args?: string[];
10
- env?: Record<string, string>;
11
- }
12
- /** Anthropic MCP config → DeepStrike `MCPServer` (spc_001-07). Anthropic's config format is
13
- * always a subprocess launch (stdio transport) — there is no http/sse/custom variant to map
14
- * from. Pure Surface→Surface mapping, produces only `MCPServer`. */
15
- export declare function fromAnthropicMcpConfig(json: AnthropicMcpConfigJson): MCPServer;
@@ -1,10 +0,0 @@
1
- /** Anthropic MCP config → DeepStrike `MCPServer` (spc_001-07). Anthropic's config format is
2
- * always a subprocess launch (stdio transport) — there is no http/sse/custom variant to map
3
- * from. Pure Surface→Surface mapping, produces only `MCPServer`. */
4
- export function fromAnthropicMcpConfig(json) {
5
- return {
6
- name: json.name,
7
- transport: { kind: "stdio", command: json.command, args: json.args },
8
- ...(json.env ? { metadata: { env: json.env } } : {}),
9
- };
10
- }
@@ -1,34 +0,0 @@
1
- import { Agent } from "../../agent.js";
2
- /** spc_007 §2: minimal OpenAI Agents SDK agent-definition shape this adapter accepts. Field
3
- * names/shape mirror the doc's §2 table left column, not any live OpenAI SDK type import — this
4
- * adapter reads a serialized agent definition (e.g. `__fixtures__/openai-agent.json`), not a
5
- * running SDK object. */
6
- export interface OpenAiAgentJson {
7
- name: string;
8
- instructions?: string;
9
- model?: string;
10
- tools?: Array<{
11
- type?: string;
12
- name: string;
13
- description?: string;
14
- parameters?: Record<string, unknown>;
15
- }>;
16
- handoffs?: Array<{
17
- agent: string;
18
- description?: string;
19
- }>;
20
- /** OpenAI-specific: no common `Agent` field for this (spc_007 §2's "Guardrails" row lowers to
21
- * governance policy, not a Canonical IR field) — preserved under `providerOptions.openai`
22
- * rather than silently dropped (spc_001 §3: "Unknown fields → never silently discarded"). */
23
- guardrails?: unknown[];
24
- }
25
- /** spc_007 §2: OpenAI Agent → DeepStrike `Agent` (spc_001's Canonical Agent IR entry object).
26
- * Pure Surface→Surface mapping — produces only `Agent`, never a Kernel-internal type
27
- * (`Tcb`/`Capability`/etc.), matching this doc's own boundary ("Adapter 代码不得进入 Kernel
28
- * crate").
29
- *
30
- * A JSON tool definition carries no executable body, so each mapped tool's `execute` is a
31
- * placeholder that throws — this adapter only reconstructs declarative shape (name/description/
32
- * schema/count), never behavior; wiring a real implementation back onto an OpenAI-sourced tool
33
- * definition is a separate, later concern outside this card. */
34
- export declare function fromOpenAiAgent(json: OpenAiAgentJson): Agent;
@@ -1,24 +0,0 @@
1
- import { Agent } from "../../agent.js";
2
- import { tool } from "../../tools/index.js";
3
- /** spc_007 §2: OpenAI Agent → DeepStrike `Agent` (spc_001's Canonical Agent IR entry object).
4
- * Pure Surface→Surface mapping — produces only `Agent`, never a Kernel-internal type
5
- * (`Tcb`/`Capability`/etc.), matching this doc's own boundary ("Adapter 代码不得进入 Kernel
6
- * crate").
7
- *
8
- * A JSON tool definition carries no executable body, so each mapped tool's `execute` is a
9
- * placeholder that throws — this adapter only reconstructs declarative shape (name/description/
10
- * schema/count), never behavior; wiring a real implementation back onto an OpenAI-sourced tool
11
- * definition is a separate, later concern outside this card. */
12
- export function fromOpenAiAgent(json) {
13
- const tools = (json.tools ?? []).map(t => tool(t.name, t.description ?? "", t.parameters ?? { type: "object", properties: {} }, async () => {
14
- throw new Error(`tool "${t.name}" has no execution binding — fromOpenAiAgent only carries declarative shape`);
15
- }));
16
- return new Agent({
17
- name: json.name,
18
- instructions: json.instructions,
19
- model: json.model,
20
- tools,
21
- handoffs: json.handoffs,
22
- ...(json.guardrails ? { providerOptions: { openai: { guardrails: json.guardrails } } } : {}),
23
- });
24
- }