@deepstrike/sdk 0.2.68 → 0.2.70
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/dist/index.d.ts +8 -1
- package/dist/index.js +3 -0
- package/dist/kernel.d.ts +8 -4
- package/dist/memory/protocols.d.ts +2 -2
- package/dist/os/public.d.ts +2 -0
- package/dist/os/public.js +1 -0
- package/dist/providers/anthropic-adapter.d.ts +2 -2
- package/dist/providers/anthropic.d.ts +9 -5
- package/dist/providers/anthropic.js +20 -5
- package/dist/providers/base.d.ts +5 -5
- package/dist/providers/content-normalization.d.ts +4 -4
- package/dist/providers/gemini-adapter.d.ts +2 -2
- package/dist/providers/gemini.d.ts +8 -4
- package/dist/providers/gemini.js +20 -7
- package/dist/providers/ollama-adapter.d.ts +2 -2
- package/dist/providers/ollama.d.ts +6 -3
- package/dist/providers/ollama.js +14 -3
- package/dist/providers/openai-chat.d.ts +4 -4
- package/dist/providers/openai-responses-adapter.d.ts +2 -2
- package/dist/providers/openai-responses-adapter.js +1 -1
- package/dist/providers/openai-responses.d.ts +7 -3
- package/dist/providers/openai-responses.js +19 -6
- package/dist/providers/openai.d.ts +8 -5
- package/dist/providers/openai.js +14 -3
- package/dist/providers/prepared-request.d.ts +4 -0
- package/dist/providers/prepared-request.js +78 -0
- package/dist/providers/protocol-adapter.d.ts +2 -2
- package/dist/providers/replay-validator.d.ts +3 -3
- package/dist/providers/request-plan.d.ts +8 -1
- package/dist/providers/request-plan.js +4 -3
- package/dist/runtime/archive.d.ts +7 -7
- package/dist/runtime/canonical-kernel-step.d.ts +4 -3
- package/dist/runtime/canonical-kernel-step.js +17 -8
- package/dist/runtime/context.d.ts +28 -0
- package/dist/runtime/context.js +16 -0
- package/dist/runtime/eval.d.ts +2 -2
- package/dist/runtime/evolution.d.ts +195 -0
- package/dist/runtime/evolution.js +34 -0
- package/dist/runtime/execution-plane.d.ts +1 -1
- package/dist/runtime/kernel-step.d.ts +7 -6
- package/dist/runtime/provider-replay.d.ts +2 -2
- package/dist/runtime/provider-replay.js +1 -1
- package/dist/runtime/replay-fixture.d.ts +5 -5
- package/dist/runtime/replay-fixture.js +3 -3
- package/dist/runtime/replay-provider.d.ts +4 -4
- package/dist/runtime/replay-provider.js +1 -1
- package/dist/runtime/runner.d.ts +8 -6
- package/dist/runtime/runner.js +23 -6
- package/dist/runtime/session-log.d.ts +9 -4
- package/dist/runtime/session-log.js +3 -2
- package/dist/runtime/session-repair.d.ts +3 -4
- package/dist/runtime/session-repair.js +1 -4
- package/dist/runtime/verifiable-report.d.ts +64 -0
- package/dist/runtime/verifiable-report.js +66 -0
- package/dist/skills/loader.d.ts +1 -1
- package/dist/tools/index.d.ts +2 -2
- package/dist/types/agent.d.ts +5 -5
- package/dist/types.d.ts +20 -11
- package/package.json +2 -2
package/dist/types.d.ts
CHANGED
|
@@ -81,10 +81,10 @@ export interface ContentBlockFile {
|
|
|
81
81
|
mediaType?: string;
|
|
82
82
|
providerOptions?: Record<string, unknown>;
|
|
83
83
|
}
|
|
84
|
-
/** Legal content returned by a tool. Deliberately excludes
|
|
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
|
|
87
|
+
export interface ProviderMessage {
|
|
88
88
|
role: "system" | "user" | "assistant" | "tool";
|
|
89
89
|
/** Plain-text content. When `contentParts` is present, this holds only the text segments. */
|
|
90
90
|
content: string;
|
|
@@ -98,7 +98,7 @@ export interface ToolCall {
|
|
|
98
98
|
arguments: string;
|
|
99
99
|
}
|
|
100
100
|
export type ToolErrorKind = "recoverable" | "fatal" | "governance_denied" | "provider_failure" | "timeout" | "user_interrupt";
|
|
101
|
-
export interface
|
|
101
|
+
export interface ToolExecutionResult {
|
|
102
102
|
callId: string;
|
|
103
103
|
output: string;
|
|
104
104
|
isError: boolean;
|
|
@@ -450,7 +450,7 @@ export interface ProviderWireEvidence {
|
|
|
450
450
|
response_id?: string;
|
|
451
451
|
/** BoundedJson semantics: producers truncate to ≤4KB before landing it here. */
|
|
452
452
|
raw_usage?: unknown;
|
|
453
|
-
/**
|
|
453
|
+
/** Provider-native replay state carried inside the wire evidence bundle. */
|
|
454
454
|
replay_state?: ProviderReplay;
|
|
455
455
|
}
|
|
456
456
|
/**
|
|
@@ -478,7 +478,7 @@ export interface RenderedContext {
|
|
|
478
478
|
/** Knowledge (memory retrievals, skill definitions, artifacts). Anthropic system[1] with cache_control. */
|
|
479
479
|
systemKnowledge?: string;
|
|
480
480
|
/** History turns only — the stable, cacheable message prefix. */
|
|
481
|
-
turns:
|
|
481
|
+
turns: ProviderMessage[];
|
|
482
482
|
/**
|
|
483
483
|
* Volatile State turn (task_state + signals), rebuilt every call. Providers
|
|
484
484
|
* render it after the cacheable history (Anthropic: after the cache breakpoint;
|
|
@@ -486,7 +486,7 @@ export interface RenderedContext {
|
|
|
486
486
|
* older binding that has not been rebuilt — then the State turn is still inside
|
|
487
487
|
* `turns[0]` and providers render `turns` as-is.
|
|
488
488
|
*/
|
|
489
|
-
stateTurn?:
|
|
489
|
+
stateTurn?: ProviderMessage;
|
|
490
490
|
/**
|
|
491
491
|
* P1-E: count of leading `turns` forming the frozen prefix — byte-stable until the next
|
|
492
492
|
* compaction. The Anthropic provider pins a deep cache breakpoint at this boundary (a long-lived
|
|
@@ -512,7 +512,16 @@ export interface RuntimePolicy {
|
|
|
512
512
|
/** Per-run wall-clock timeout in ms. */
|
|
513
513
|
timeoutMs?: number;
|
|
514
514
|
}
|
|
515
|
+
/** Frozen host request; scope distinguishes encoded body from a custom adapter input. */
|
|
516
|
+
export interface PreparedProviderRequest {
|
|
517
|
+
readonly scope: "encoded_body" | "adapter_input";
|
|
518
|
+
readonly request: unknown;
|
|
519
|
+
readonly state: unknown;
|
|
520
|
+
stream(signal?: AbortSignal): AsyncIterable<StreamEvent>;
|
|
521
|
+
countTokens?(): Promise<PromptMeasurement>;
|
|
522
|
+
}
|
|
515
523
|
export interface LLMProvider {
|
|
524
|
+
prepareRequest?(context: RenderedContext, tools: ToolSchema[], extensions?: Record<string, unknown>, state?: ProviderRunState): PreparedProviderRequest;
|
|
516
525
|
createRunState?(): ProviderRunState;
|
|
517
526
|
descriptor?(): ProviderDescriptor;
|
|
518
527
|
/**
|
|
@@ -522,7 +531,7 @@ export interface LLMProvider {
|
|
|
522
531
|
*/
|
|
523
532
|
runtimePolicy?(): RuntimePolicy;
|
|
524
533
|
/** Read provider-native replay fields captured after the most recent assistant turn. */
|
|
525
|
-
peekProviderReplay?(message: Pick<
|
|
534
|
+
peekProviderReplay?(message: Pick<ProviderMessage, "content" | "toolCalls">): ProviderReplay | undefined;
|
|
526
535
|
/**
|
|
527
536
|
* P4-S1: read the transport facts captured during the most recent execution (HTTP rung count,
|
|
528
537
|
* wire response id). Optional — a provider without it simply omits the telemetry and the
|
|
@@ -531,7 +540,7 @@ export interface LLMProvider {
|
|
|
531
540
|
*/
|
|
532
541
|
peekTransportTelemetry?(): ProviderTransportTelemetry | undefined;
|
|
533
542
|
/** Restore provider-native replay fields when rebuilding history from SessionLog. */
|
|
534
|
-
seedProviderReplay?(message: Pick<
|
|
543
|
+
seedProviderReplay?(message: Pick<ProviderMessage, "content" | "toolCalls">, replay: ProviderReplay): void;
|
|
535
544
|
/**
|
|
536
545
|
* Pre-flight query: would this history validate against this provider with the
|
|
537
546
|
* given extensions, without sending the request? Returns the tool-call ids
|
|
@@ -551,7 +560,7 @@ export interface LLMProvider {
|
|
|
551
560
|
* fingerprinting and durable measurement semantics are defined.
|
|
552
561
|
*/
|
|
553
562
|
countTokens?(context: RenderedContext, tools: ToolSchema[], extensions?: Record<string, unknown>, state?: ProviderRunState): Promise<PromptMeasurement>;
|
|
554
|
-
complete(context: RenderedContext, tools: ToolSchema[], extensions?: Record<string, unknown>): Promise<
|
|
563
|
+
complete(context: RenderedContext, tools: ToolSchema[], extensions?: Record<string, unknown>): Promise<ProviderMessage>;
|
|
555
564
|
stream(context: RenderedContext, tools: ToolSchema[], extensions?: Record<string, unknown>, state?: ProviderRunState,
|
|
556
565
|
/** #2-B-ii: when provided, a preempting `InterruptNow` (or `interrupt()`) aborts the in-flight
|
|
557
566
|
* request. SDK-client providers should forward it to the client (`{ signal }`); the runner also
|
|
@@ -564,14 +573,14 @@ export interface LLMProvider {
|
|
|
564
573
|
* Produces a richer LLM-generated summary that replaces the rule-based one on next wake.
|
|
565
574
|
*/
|
|
566
575
|
export interface AsyncSummarizer {
|
|
567
|
-
summarize(archived:
|
|
576
|
+
summarize(archived: ProviderMessage[], action: string): Promise<string>;
|
|
568
577
|
}
|
|
569
578
|
/**
|
|
570
579
|
* Durable-memory summarizer for semantic `page_out` events (Layer 5 contract).
|
|
571
580
|
* The kernel emits `page_out { tier_hint: "semantic" }`; the SDK persists an LLM summary to MemoryStore.
|
|
572
581
|
*/
|
|
573
582
|
export interface MemorySummarizer {
|
|
574
|
-
summarize(archived:
|
|
583
|
+
summarize(archived: ProviderMessage[], context: {
|
|
575
584
|
action?: string;
|
|
576
585
|
}): Promise<string>;
|
|
577
586
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@deepstrike/sdk",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.70",
|
|
4
4
|
"description": "DeepStrike Node.js SDK",
|
|
5
5
|
"license": "SEE LICENSE IN LICENSE",
|
|
6
6
|
"type": "module",
|
|
@@ -73,7 +73,7 @@
|
|
|
73
73
|
},
|
|
74
74
|
"dependencies": {
|
|
75
75
|
"@anthropic-ai/sdk": "^0.99.0",
|
|
76
|
-
"@deepstrike/core": "0.2.
|
|
76
|
+
"@deepstrike/core": "0.2.70",
|
|
77
77
|
"@google/generative-ai": "^0.24.1",
|
|
78
78
|
"openai": "^7.5.0"
|
|
79
79
|
},
|