@deepstrike/wasm 0.2.70 → 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.
- package/dist/index.d.ts +1 -1
- package/dist/providers/anthropic.d.ts +4 -4
- package/dist/providers/base.d.ts +5 -5
- package/dist/providers/base.js +1 -1
- package/dist/providers/openai.d.ts +2 -2
- package/dist/runtime/canonical-kernel-step.d.ts +2 -2
- package/dist/runtime/eval.d.ts +2 -2
- package/dist/runtime/kernel-step.d.ts +5 -5
- package/dist/runtime/provider-replay.d.ts +2 -2
- package/dist/runtime/replay-fixture.d.ts +4 -4
- package/dist/runtime/replay-fixture.js +2 -2
- package/dist/runtime/replay-provider.d.ts +3 -3
- package/dist/runtime/runner.d.ts +5 -5
- package/dist/runtime/session-log.d.ts +1 -1
- package/dist/runtime/session-repair.d.ts +2 -2
- package/dist/runtime/types/agent.d.ts +4 -4
- package/dist/types.d.ts +8 -8
- package/package.json +2 -2
package/dist/index.d.ts
CHANGED
|
@@ -53,7 +53,7 @@ export type { CanonicalStopReason } from "./providers/stop-reason.js";
|
|
|
53
53
|
export { ContentPolicyError, contentDispositionFor, requireContentDisposition } from "./providers/content-policy.js";
|
|
54
54
|
export type { ContentDisposition, ContentPlacement, InputModality } from "./providers/content-policy.js";
|
|
55
55
|
export type { PermissionDecision } from "./safety/index.js";
|
|
56
|
-
export type {
|
|
56
|
+
export type { ModelMessage, ToolCall, ToolExecutionResult, ToolSchema, RenderedContext, ProviderRunState, StreamEvent, TextDelta, ThinkingDelta, ToolCallEvent, ToolResultEvent, ToolAuditFailedEvent, DoneEvent, ErrorEvent, PermissionRequestEvent, PermissionResolvedEvent, PermissionResponse, EntropySample, EntropySampleEvent, EntropyAlertEvent, EntropyWatchOptions, LLMProvider, CacheBreakpointStrategy, ProviderWireEvidence, ProviderTransportTelemetry, } from "./types.js";
|
|
57
57
|
export { DurableContentError, decodeDurableContent, decodeDurableToolResult, encodeDurableContent, encodeDurableToolResult, toolOutputBlocksToDurable, durableBlocksToToolOutput } from "./runtime/durable-content.js";
|
|
58
58
|
export type { DurableContent, DurableContentBlock, DurableSource, DurableToolResult } from "./runtime/durable-content.js";
|
|
59
59
|
export { createContextPreparationAdapter, createNativeContextPreparationAdapter } from "./runtime/context.js";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { PreparedProviderRequest, ProviderRunState } from "../types.js";
|
|
2
|
-
import type { RenderedContext, ToolSchema, StreamEvent, LLMProvider,
|
|
2
|
+
import type { RenderedContext, ToolSchema, StreamEvent, LLMProvider, ModelMessage, ProviderDescriptor, ProviderReplay } from "../types.js";
|
|
3
3
|
export declare class AnthropicProvider implements LLMProvider {
|
|
4
4
|
private readonly apiKey;
|
|
5
5
|
private readonly model;
|
|
@@ -16,9 +16,9 @@ export declare class AnthropicProvider implements LLMProvider {
|
|
|
16
16
|
baseURL: string;
|
|
17
17
|
};
|
|
18
18
|
};
|
|
19
|
-
peekProviderReplay(message: Pick<
|
|
20
|
-
seedProviderReplay(message: Pick<
|
|
21
|
-
complete(context: RenderedContext, tools: ToolSchema[], extensions?: Record<string, unknown>): Promise<
|
|
19
|
+
peekProviderReplay(message: Pick<ModelMessage, "content" | "toolCalls">): ProviderReplay | undefined;
|
|
20
|
+
seedProviderReplay(message: Pick<ModelMessage, "content" | "toolCalls">, replay: ProviderReplay): void;
|
|
21
|
+
complete(context: RenderedContext, tools: ToolSchema[], extensions?: Record<string, unknown>): Promise<ModelMessage>;
|
|
22
22
|
prepareRequest(context: RenderedContext, tools: ToolSchema[], extensions?: Record<string, unknown>, state?: ProviderRunState): PreparedProviderRequest;
|
|
23
23
|
stream(context: RenderedContext, tools: ToolSchema[], extensions?: Record<string, unknown>, state?: ProviderRunState, signal?: AbortSignal): AsyncIterable<StreamEvent>;
|
|
24
24
|
private streamBody;
|
package/dist/providers/base.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { ModelMessage, RenderedContext } from "../types.js";
|
|
2
2
|
import { assistantReplayKey } from "../runtime/provider-replay.js";
|
|
3
3
|
export declare class UnsupportedModalityError extends Error {
|
|
4
4
|
readonly modality: string;
|
|
@@ -9,16 +9,16 @@ export declare class UnsupportedModalityError extends Error {
|
|
|
9
9
|
* (OpenAI), keeping the history a stable cacheable prefix. Anthropic appends it
|
|
10
10
|
* after the cache breakpoint. Absent on un-rebuilt bindings — then the state is
|
|
11
11
|
* already inside `turns`. */
|
|
12
|
-
export declare function turnsWithStateAppended(context: RenderedContext):
|
|
12
|
+
export declare function turnsWithStateAppended(context: RenderedContext): ModelMessage[];
|
|
13
13
|
/** Build OpenAI-compatible chat messages from a RenderedContext. */
|
|
14
14
|
export declare function toOpenAIMessages(context: RenderedContext): Array<Record<string, unknown>>;
|
|
15
|
-
export declare function toAnthropicMessages(context: RenderedContext, nativeReplay?: (message:
|
|
16
|
-
/** Collect a non-streaming assistant
|
|
15
|
+
export declare function toAnthropicMessages(context: RenderedContext, nativeReplay?: (message: ModelMessage) => Array<Record<string, unknown>> | undefined): Array<Record<string, unknown>>;
|
|
16
|
+
/** Collect a non-streaming assistant ModelMessage from stream events. */
|
|
17
17
|
export declare function collectStreamMessage(stream: AsyncIterable<{
|
|
18
18
|
type: string;
|
|
19
19
|
delta?: string;
|
|
20
20
|
id?: string;
|
|
21
21
|
name?: string;
|
|
22
22
|
arguments?: Record<string, unknown>;
|
|
23
|
-
}>): Promise<
|
|
23
|
+
}>): Promise<ModelMessage>;
|
|
24
24
|
export { assistantReplayKey };
|
package/dist/providers/base.js
CHANGED
|
@@ -135,7 +135,7 @@ export function toAnthropicMessages(context, nativeReplay) {
|
|
|
135
135
|
}
|
|
136
136
|
return result;
|
|
137
137
|
}
|
|
138
|
-
/** Collect a non-streaming assistant
|
|
138
|
+
/** Collect a non-streaming assistant ModelMessage from stream events. */
|
|
139
139
|
export async function collectStreamMessage(stream) {
|
|
140
140
|
let content = "";
|
|
141
141
|
const toolCalls = [];
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { PreparedProviderRequest, ProviderRunState } from "../types.js";
|
|
2
|
-
import type { RenderedContext, ToolSchema, StreamEvent, LLMProvider,
|
|
2
|
+
import type { RenderedContext, ToolSchema, StreamEvent, LLMProvider, ModelMessage, ProviderDescriptor } from "../types.js";
|
|
3
3
|
type OpenAIProviderDialect = "openai" | "qwen" | "deepseek" | "minimax";
|
|
4
4
|
export interface OpenAIProviderOptions {
|
|
5
5
|
apiKey: string;
|
|
@@ -42,7 +42,7 @@ export declare class OpenAIProvider implements LLMProvider {
|
|
|
42
42
|
parameters: any;
|
|
43
43
|
};
|
|
44
44
|
}[];
|
|
45
|
-
complete(context: RenderedContext, tools: ToolSchema[], extensions?: Record<string, unknown>): Promise<
|
|
45
|
+
complete(context: RenderedContext, tools: ToolSchema[], extensions?: Record<string, unknown>): Promise<ModelMessage>;
|
|
46
46
|
private streamBody;
|
|
47
47
|
prepareRequest(context: RenderedContext, tools: ToolSchema[], extensions?: Record<string, unknown>, state?: ProviderRunState): PreparedProviderRequest;
|
|
48
48
|
stream(context: RenderedContext, tools: ToolSchema[], extensions?: Record<string, unknown>, state?: ProviderRunState, signal?: AbortSignal): AsyncIterable<StreamEvent>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { CanonicalKernel as CanonicalKernelInstance, CanonicalRestoreCost } from "@deepstrike/wasm-kernel";
|
|
2
|
-
import type {
|
|
2
|
+
import type { ModelMessage } from "../types.js";
|
|
3
3
|
import { type InstalledCheckpoint, type KernelJournal } from "./kernel-journal.js";
|
|
4
4
|
import { type KernelObservation, type KernelRunnerAction } from "./kernel-step.js";
|
|
5
5
|
export declare const MAX_CHAIN_POSITION = 1000000000000;
|
|
@@ -121,7 +121,7 @@ export declare class CanonicalRunnerRuntime {
|
|
|
121
121
|
isTerminal(): boolean;
|
|
122
122
|
recoveryContentBytes(): number;
|
|
123
123
|
preservedRefs(): string[];
|
|
124
|
-
drainNewMessages():
|
|
124
|
+
drainNewMessages(): ModelMessage[];
|
|
125
125
|
drainHostObservations(): KernelObservationLike[];
|
|
126
126
|
terminal(): Record<string, unknown> | undefined;
|
|
127
127
|
localSubagentsSpawned(): number;
|
package/dist/runtime/eval.d.ts
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
*
|
|
8
8
|
* See node/src/runtime/eval.ts for the full design rationale.
|
|
9
9
|
*/
|
|
10
|
-
import type { LLMProvider,
|
|
10
|
+
import type { LLMProvider, ModelMessage } from "../types.js";
|
|
11
11
|
export interface Criterion {
|
|
12
12
|
text: string;
|
|
13
13
|
required?: boolean;
|
|
@@ -35,7 +35,7 @@ export interface JudgeArgs {
|
|
|
35
35
|
signal?: AbortSignal;
|
|
36
36
|
}
|
|
37
37
|
/** Build the kernel's eval prompt for (goal, criteria, result). Async — the WASM kernel loads lazily. */
|
|
38
|
-
export declare function buildEvalMessages(goal: string, criteria: Criterion[], result: string): Promise<
|
|
38
|
+
export declare function buildEvalMessages(goal: string, criteria: Criterion[], result: string): Promise<ModelMessage[]>;
|
|
39
39
|
/** Parse a Verdict from raw judge-LLM text. */
|
|
40
40
|
export declare function parseVerdict(text: string): Promise<Verdict>;
|
|
41
41
|
/** The JSON Schema the kernel expects judge output to conform to. */
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { ModelMessage, RenderedContext, ToolCall, ToolExecutionResult, ToolSchema } from "../types.js";
|
|
2
2
|
import type { RollbackReason } from "./session-log.js";
|
|
3
3
|
interface TaskUpdate {
|
|
4
4
|
plan?: string[];
|
|
@@ -41,7 +41,7 @@ export interface KernelLoopResult {
|
|
|
41
41
|
termination: string;
|
|
42
42
|
turnsUsed: number;
|
|
43
43
|
totalTokensUsed: number;
|
|
44
|
-
finalMessage?:
|
|
44
|
+
finalMessage?: ModelMessage;
|
|
45
45
|
/** ③ loop-agent: the kernel-adjudicated after-round decision (absent on non-loop runs). */
|
|
46
46
|
paceDecision?: PaceDecision;
|
|
47
47
|
}
|
|
@@ -90,7 +90,7 @@ export type KernelRunnerAction = {
|
|
|
90
90
|
} | {
|
|
91
91
|
kind: "archive_page_out";
|
|
92
92
|
effectId: string;
|
|
93
|
-
archived:
|
|
93
|
+
archived: ModelMessage[];
|
|
94
94
|
handleId?: string;
|
|
95
95
|
payload?: {
|
|
96
96
|
content: string;
|
|
@@ -219,12 +219,12 @@ export declare function archivePresentationFromObservations(observations: readon
|
|
|
219
219
|
};
|
|
220
220
|
export declare function toolSchemaToKernel(schema: ToolSchema): Record<string, unknown>;
|
|
221
221
|
export declare function skillMetadataToKernel(skill: SkillMetadata): Record<string, unknown>;
|
|
222
|
-
export declare function messageToKernelMessage(message:
|
|
222
|
+
export declare function messageToKernelMessage(message: ModelMessage): Record<string, unknown>;
|
|
223
223
|
export declare function toolResultToKernel(result: ToolExecutionResult): Record<string, unknown>;
|
|
224
224
|
export declare function taskUpdateToKernel(update: TaskUpdate): Record<string, unknown>;
|
|
225
225
|
export declare function capabilityTool(schema: ToolSchema): Record<string, unknown>;
|
|
226
226
|
export declare function capabilitySkill(skill: SkillMetadata): Record<string, unknown>;
|
|
227
227
|
export declare function capabilityMarker(kind: string, id: string, description: string): Record<string, unknown>;
|
|
228
|
-
export declare function kernelMessageToSdk(raw: Record<string, unknown>):
|
|
228
|
+
export declare function kernelMessageToSdk(raw: Record<string, unknown>): ModelMessage;
|
|
229
229
|
export declare function renderedContextToSdk(raw: Record<string, unknown>): RenderedContext;
|
|
230
230
|
export {};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import type { LLMProvider,
|
|
1
|
+
import type { LLMProvider, ModelMessage, ProviderDescriptor, ProviderReplay, ToolCall } from "../types.js";
|
|
2
2
|
import type { SessionEvent } from "./session-log.js";
|
|
3
|
-
export declare function assistantReplayKey(message: Pick<
|
|
3
|
+
export declare function assistantReplayKey(message: Pick<ModelMessage, "content" | "toolCalls">): string;
|
|
4
4
|
/**
|
|
5
5
|
* A stored replay may only be seeded into a provider speaking the same wire
|
|
6
6
|
* protocol; on a cross-protocol fallback the incompatible envelope is skipped so
|
|
@@ -6,20 +6,20 @@
|
|
|
6
6
|
* pulls the assistant turns in order, so the fixture is just "a prior session log + the messages
|
|
7
7
|
* the LLM produced". No new on-disk format.
|
|
8
8
|
*/
|
|
9
|
-
import type {
|
|
9
|
+
import type { ModelMessage } from "../types.js";
|
|
10
10
|
import type { SessionEvent } from "./session-log.js";
|
|
11
11
|
/**
|
|
12
12
|
* Extract the ordered list of assistant Messages from a recorded session log.
|
|
13
13
|
*
|
|
14
14
|
* Walks `llm_completed` events (which is what the runner appends for every LLM call) and produces
|
|
15
|
-
* one
|
|
15
|
+
* one ModelMessage per event. Pass the result directly to `new ReplayProvider(messages)`.
|
|
16
16
|
*
|
|
17
17
|
* Accepts both camelCase and snake_case tool-call wire shapes. Token usage remains session
|
|
18
|
-
* evidence; the returned public
|
|
18
|
+
* evidence; the returned public ModelMessage mirror carries no token projection.
|
|
19
19
|
*
|
|
20
20
|
* @param events Session events, in original order. Accepts both `{ event, seq }` (the shape
|
|
21
21
|
* `SessionLog.read()` returns) and a bare `SessionEvent[]`.
|
|
22
22
|
*/
|
|
23
23
|
export declare function extractRecordedMessages(events: Array<{
|
|
24
24
|
event: SessionEvent;
|
|
25
|
-
} | SessionEvent>):
|
|
25
|
+
} | SessionEvent>): ModelMessage[];
|
|
@@ -10,10 +10,10 @@
|
|
|
10
10
|
* Extract the ordered list of assistant Messages from a recorded session log.
|
|
11
11
|
*
|
|
12
12
|
* Walks `llm_completed` events (which is what the runner appends for every LLM call) and produces
|
|
13
|
-
* one
|
|
13
|
+
* one ModelMessage per event. Pass the result directly to `new ReplayProvider(messages)`.
|
|
14
14
|
*
|
|
15
15
|
* Accepts both camelCase and snake_case tool-call wire shapes. Token usage remains session
|
|
16
|
-
* evidence; the returned public
|
|
16
|
+
* evidence; the returned public ModelMessage mirror carries no token projection.
|
|
17
17
|
*
|
|
18
18
|
* @param events Session events, in original order. Accepts both `{ event, seq }` (the shape
|
|
19
19
|
* `SessionLog.read()` returns) and a bare `SessionEvent[]`.
|
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
* Tokenizer: by default a `chars/4` estimator (±20% for English; worse for code/JSON). For tighter
|
|
24
24
|
* numbers plug `opts.tokenizer = tiktokenEncoder` or similar.
|
|
25
25
|
*/
|
|
26
|
-
import type { LLMProvider,
|
|
26
|
+
import type { LLMProvider, ModelMessage, ProviderDescriptor, ProviderRunState, RenderedContext, StreamEvent, ToolSchema } from "../types.js";
|
|
27
27
|
export interface ReplayProviderOpts {
|
|
28
28
|
/**
|
|
29
29
|
* Maps a rendered-context text payload to a token count. Defaults to `chars / 4`.
|
|
@@ -53,7 +53,7 @@ export declare class ReplayProvider implements LLMProvider {
|
|
|
53
53
|
* @param messages Ordered list of assistant messages to replay (one per LLM call).
|
|
54
54
|
* @param opts Optional tokenizer / descriptor / wrap-around behavior.
|
|
55
55
|
*/
|
|
56
|
-
constructor(messages: ReadonlyArray<
|
|
56
|
+
constructor(messages: ReadonlyArray<ModelMessage>, opts?: ReplayProviderOpts);
|
|
57
57
|
descriptor(): ProviderDescriptor;
|
|
58
58
|
/** Number of messages consumed so far. */
|
|
59
59
|
consumed(): number;
|
|
@@ -61,7 +61,7 @@ export declare class ReplayProvider implements LLMProvider {
|
|
|
61
61
|
remaining(): number;
|
|
62
62
|
/** Reset the cursor — useful for re-running the same fixture in a fresh session. */
|
|
63
63
|
reset(): void;
|
|
64
|
-
complete(_context: RenderedContext, _tools: ToolSchema[]): Promise<
|
|
64
|
+
complete(_context: RenderedContext, _tools: ToolSchema[]): Promise<ModelMessage>;
|
|
65
65
|
stream(context: RenderedContext, tools: ToolSchema[], _extensions?: Record<string, unknown>, _state?: ProviderRunState, _signal?: AbortSignal): AsyncIterable<StreamEvent>;
|
|
66
66
|
private pull;
|
|
67
67
|
private estimateInputTokens;
|
package/dist/runtime/runner.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { LLMProvider,
|
|
1
|
+
import type { LLMProvider, ModelMessage, StreamEvent, PermissionRequestEvent, PermissionResponse, EntropySample, EntropyWatchOptions, MemorySummarizer } from "../types.js";
|
|
2
2
|
import type { ToolSuspendEvent } from "./execution-plane.js";
|
|
3
3
|
import type { MemoryStore, MemoryQuery, MemoryRecord, MemoryScope } from "../memory/index.js";
|
|
4
4
|
import type { KnowledgeSource } from "../knowledge/index.js";
|
|
@@ -65,8 +65,8 @@ export interface KernelReliabilityOptions {
|
|
|
65
65
|
maxInputBytes?: number;
|
|
66
66
|
}
|
|
67
67
|
export interface ArchiveStore {
|
|
68
|
-
write(sessionId: string, startSeq: number, messages:
|
|
69
|
-
read?(archiveRef: string): Promise<
|
|
68
|
+
write(sessionId: string, startSeq: number, messages: ModelMessage[]): Promise<string | undefined>;
|
|
69
|
+
read?(archiveRef: string): Promise<ModelMessage[]>;
|
|
70
70
|
}
|
|
71
71
|
/** P0-C tool-gating telemetry: per-LLM-turn metrics, emitted via `RuntimeOptions.onTurnMetrics`.
|
|
72
72
|
* Pure observation — no behavior change. `toolsExposed` vs `toolsCalled` quantifies over-exposure;
|
|
@@ -344,7 +344,7 @@ export declare class RuntimeRunner {
|
|
|
344
344
|
* K1: `opts.key` gives the entry identity — a same-key push upserts (applied at the next
|
|
345
345
|
* compaction/renewal boundary) instead of appending a duplicate. `opts.pinned` exempts the
|
|
346
346
|
* entry from the knowledge-budget sweep. */
|
|
347
|
-
pushKnowledge(message:
|
|
347
|
+
pushKnowledge(message: ModelMessage, tokens?: number, opts?: {
|
|
348
348
|
key?: string;
|
|
349
349
|
pinned?: boolean;
|
|
350
350
|
}): Promise<void>;
|
|
@@ -416,5 +416,5 @@ export declare class RuntimeRunner {
|
|
|
416
416
|
export declare function replayMessages(events: Array<{
|
|
417
417
|
seq: number;
|
|
418
418
|
event: SessionEvent;
|
|
419
|
-
}>, maxBytes?: number, archiveStore?: ArchiveStore): Promise<
|
|
419
|
+
}>, maxBytes?: number, archiveStore?: ArchiveStore): Promise<ModelMessage[]>;
|
|
420
420
|
export declare function collectText(stream: AsyncIterable<StreamEvent>): Promise<string>;
|
|
@@ -297,7 +297,7 @@ export type SessionEvent = {
|
|
|
297
297
|
classify_branch?: string;
|
|
298
298
|
tournament_winner?: string;
|
|
299
299
|
loop_continue?: boolean;
|
|
300
|
-
output?: import("../types.js").
|
|
300
|
+
output?: import("../types.js").ModelMessage;
|
|
301
301
|
} | {
|
|
302
302
|
kind: "workflow_nodes_submitted";
|
|
303
303
|
turn: number;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { ModelMessage, ProviderWireEvidence, ToolCall } from "../types.js";
|
|
2
2
|
import type { SessionEvent } from "./session-log.js";
|
|
3
3
|
import type { WorkflowNodeStatus } from "./types/agent.js";
|
|
4
4
|
export { REPLAY_CONTENT_MAX_BYTES as RECOVERY_CONTENT_MAX_BYTES } from "./replay-sanitize.js";
|
|
@@ -48,7 +48,7 @@ export declare function buildWorkflowNodeCompletedEvent(input: {
|
|
|
48
48
|
classifyBranch?: string;
|
|
49
49
|
tournamentWinner?: string;
|
|
50
50
|
loopContinue?: boolean;
|
|
51
|
-
output?:
|
|
51
|
+
output?: ModelMessage;
|
|
52
52
|
}): Extract<SessionEvent, {
|
|
53
53
|
kind: "workflow_node_completed";
|
|
54
54
|
}>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type {
|
|
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";
|
|
@@ -81,7 +81,7 @@ export interface AgentProcessChangedObservation {
|
|
|
81
81
|
}
|
|
82
82
|
export interface LoopResult {
|
|
83
83
|
termination: TerminationReason | string;
|
|
84
|
-
finalMessage?:
|
|
84
|
+
finalMessage?: ModelMessage;
|
|
85
85
|
turnsUsed: number;
|
|
86
86
|
totalTokensUsed: number;
|
|
87
87
|
/** loop-control loop stop signal: a loop iteration sets `false` to end the loop before `max_iters`.
|
|
@@ -211,7 +211,7 @@ export interface KernelWorkflowNodeOutcome {
|
|
|
211
211
|
status: WorkflowNodeStatus;
|
|
212
212
|
termination?: TerminationReason;
|
|
213
213
|
output?: {
|
|
214
|
-
role:
|
|
214
|
+
role: ModelMessage["role"];
|
|
215
215
|
content: string;
|
|
216
216
|
tool_calls?: Array<{
|
|
217
217
|
id: string;
|
|
@@ -224,7 +224,7 @@ export interface WorkflowNodeOutcome {
|
|
|
224
224
|
nodeId: string;
|
|
225
225
|
status: WorkflowNodeStatus;
|
|
226
226
|
termination?: TerminationReason;
|
|
227
|
-
output?:
|
|
227
|
+
output?: ModelMessage;
|
|
228
228
|
}
|
|
229
229
|
export interface ControlRequestRejection {
|
|
230
230
|
operation: string;
|
package/dist/types.d.ts
CHANGED
|
@@ -39,7 +39,7 @@ export type ToolOutputBlock = {
|
|
|
39
39
|
mediaType?: string;
|
|
40
40
|
providerOptions?: Record<string, unknown>;
|
|
41
41
|
};
|
|
42
|
-
export interface
|
|
42
|
+
export interface ModelMessage {
|
|
43
43
|
role: "system" | "user" | "assistant" | "tool";
|
|
44
44
|
content: string;
|
|
45
45
|
toolCalls?: ToolCall[];
|
|
@@ -71,11 +71,11 @@ export interface RenderedContext {
|
|
|
71
71
|
systemText: string;
|
|
72
72
|
systemStable?: string;
|
|
73
73
|
systemKnowledge?: string;
|
|
74
|
-
turns:
|
|
74
|
+
turns: ModelMessage[];
|
|
75
75
|
/** Volatile State turn (task_state + signals), rendered after the cacheable
|
|
76
76
|
* history. Absent on un-rebuilt bindings — then it's still inside turns[0]. */
|
|
77
|
-
stateTurn?:
|
|
78
|
-
/**
|
|
77
|
+
stateTurn?: ModelMessage;
|
|
78
|
+
/** ModelMessage count of the frozen history prefix (compaction boundary). When set,
|
|
79
79
|
* Anthropic pins a deep cache breakpoint here instead of the rolling pair. */
|
|
80
80
|
frozenPrefixLen?: number;
|
|
81
81
|
budgetOverflow?: ContextBudgetOverflow;
|
|
@@ -308,12 +308,12 @@ export interface LLMProvider {
|
|
|
308
308
|
baseURL?: string;
|
|
309
309
|
};
|
|
310
310
|
};
|
|
311
|
-
peekProviderReplay?(message: Pick<
|
|
312
|
-
seedProviderReplay?(message: Pick<
|
|
311
|
+
peekProviderReplay?(message: Pick<ModelMessage, "content" | "toolCalls">): ProviderReplay | undefined;
|
|
312
|
+
seedProviderReplay?(message: Pick<ModelMessage, "content" | "toolCalls">, replay: ProviderReplay): void;
|
|
313
313
|
/** P4-S1 mirror: transport facts of the most recent execution (host evidence only, B7). */
|
|
314
314
|
peekTransportTelemetry?(): ProviderTransportTelemetry | undefined;
|
|
315
315
|
countTokens?(context: RenderedContext, tools: ToolSchema[], extensions?: Record<string, unknown>, state?: ProviderRunState): Promise<PromptMeasurement>;
|
|
316
|
-
complete(context: RenderedContext, tools: ToolSchema[], extensions?: Record<string, unknown>): Promise<
|
|
316
|
+
complete(context: RenderedContext, tools: ToolSchema[], extensions?: Record<string, unknown>): Promise<ModelMessage>;
|
|
317
317
|
stream(context: RenderedContext, tools: ToolSchema[], extensions?: Record<string, unknown>, state?: ProviderRunState,
|
|
318
318
|
/** #2-B-ii: when provided, a preempt (`interrupt()`) aborts the in-flight request. SDK-client
|
|
319
319
|
* providers forward it via `{ signal }`; the runner also breaks the consume loop on abort, so
|
|
@@ -321,7 +321,7 @@ export interface LLMProvider {
|
|
|
321
321
|
signal?: AbortSignal): AsyncIterable<StreamEvent>;
|
|
322
322
|
}
|
|
323
323
|
export interface MemorySummarizer {
|
|
324
|
-
summarize(archived:
|
|
324
|
+
summarize(archived: ModelMessage[], context: {
|
|
325
325
|
action?: string;
|
|
326
326
|
}): Promise<string>;
|
|
327
327
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@deepstrike/wasm",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.72",
|
|
4
4
|
"description": "DeepStrike WASM SDK — browser, Cloudflare Workers, Deno Deploy",
|
|
5
5
|
"license": "SEE LICENSE IN LICENSE",
|
|
6
6
|
"type": "module",
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
"test:canonical-binding": "wasm-pack build ../crates/deepstrike-wasm --target nodejs --dev --out-dir ../../wasm/pkg-node && node tests/canonical-binding.node.cjs && node tests/golden-fixtures-sweep.node.cjs"
|
|
18
18
|
},
|
|
19
19
|
"dependencies": {
|
|
20
|
-
"@deepstrike/wasm-kernel": "0.2.
|
|
20
|
+
"@deepstrike/wasm-kernel": "0.2.72"
|
|
21
21
|
},
|
|
22
22
|
"devDependencies": {
|
|
23
23
|
"@types/jest": "^30.0.0",
|