@deepstrike/wasm 0.2.62 → 0.2.63
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/LICENSE +106 -0
- package/dist/index.d.ts +7 -4
- package/dist/index.js +4 -1
- package/dist/providers/request-plan.d.ts +10 -0
- package/dist/runtime/execution-evidence.d.ts +118 -0
- package/dist/runtime/execution-evidence.js +45 -0
- package/dist/runtime/index.d.ts +2 -1
- package/dist/runtime/index.js +2 -0
- package/dist/runtime/kernel-step.d.ts +5 -0
- package/dist/runtime/kernel-step.js +11 -2
- package/dist/runtime/session-log.d.ts +85 -3
- package/dist/runtime/session-log.js +59 -0
- package/dist/types.d.ts +17 -0
- package/package.json +4 -3
package/LICENSE
ADDED
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
DeepStrike License (Dual License)
|
|
2
|
+
Version 1.0 — 2026-09-01
|
|
3
|
+
|
|
4
|
+
Copyright (c) 2025-2026 DeepStrike Contributors
|
|
5
|
+
Project: https://github.com/kongusen/deepstrike
|
|
6
|
+
|
|
7
|
+
======================================================================
|
|
8
|
+
中文摘要(便于理解,不具有法律效力;以下英文条款为准)
|
|
9
|
+
======================================================================
|
|
10
|
+
|
|
11
|
+
本软件采用双授权模式:
|
|
12
|
+
|
|
13
|
+
1. 个人,以及上一财年总营收低于 1,000,000 美元的组织(含其关联方),
|
|
14
|
+
可按 MIT 条款免费使用本软件(见第 2 节),包括使用、复制、修改、
|
|
15
|
+
合并、发布、分发、再授权及销售的权利。
|
|
16
|
+
2. 上一财年总营收达到或超过 1,000,000 美元的组织(含其关联方),
|
|
17
|
+
在使用本软件之前(包括内部使用、基于本软件开发的项目、以及对外
|
|
18
|
+
分发此类产品或服务)须向作者获取商业授权(见第 3 节)。
|
|
19
|
+
获取方式:发送邮件至 wanghaishan0210@gmail.com,或通过
|
|
20
|
+
https://github.com/kongusen/deepstrike 提交 Issue / Discussion
|
|
21
|
+
联系作者。出于评估目的的试用不超过 30 天除外。
|
|
22
|
+
3. 当组织的年营收增长至达到或超过该阈值时,自该时点起第 2 节的免费
|
|
23
|
+
授权终止,须获取商业授权后方可继续使用。
|
|
24
|
+
4. v0.2.62 及之前已经以 MIT 协议发布的版本继续适用 MIT 协议,不受
|
|
25
|
+
本协议影响。本协议仅适用于随其一同分发的版本。
|
|
26
|
+
|
|
27
|
+
======================================================================
|
|
28
|
+
TERMS AND CONDITIONS
|
|
29
|
+
======================================================================
|
|
30
|
+
|
|
31
|
+
1. DEFINITIONS
|
|
32
|
+
|
|
33
|
+
"Software" means the DeepStrike software and associated documentation
|
|
34
|
+
files distributed by the Licensor, including all copies and substantial
|
|
35
|
+
portions thereof.
|
|
36
|
+
|
|
37
|
+
"Licensor" means the copyright holders of the Software (the DeepStrike
|
|
38
|
+
Contributors), represented by the project maintainer at
|
|
39
|
+
https://github.com/kongusen/deepstrike.
|
|
40
|
+
|
|
41
|
+
"You" (or "Licensee") means the individual or legal entity exercising
|
|
42
|
+
permissions granted by this License, including, where that entity is an
|
|
43
|
+
organization, all entities that control, are controlled by, or are under
|
|
44
|
+
common control with that entity ("Affiliates"). "Control" means ownership
|
|
45
|
+
of more than fifty percent (50%) of the equity or voting interests, or
|
|
46
|
+
the power to direct management and policies.
|
|
47
|
+
|
|
48
|
+
"Annual Revenue" means the total gross revenue of You and Your Affiliates
|
|
49
|
+
for the most recently completed fiscal year, expressed in US dollars or
|
|
50
|
+
converted into US dollars at prevailing exchange rates.
|
|
51
|
+
|
|
52
|
+
2. FREE LICENSE FOR INDIVIDUALS AND SMALL ORGANIZATIONS
|
|
53
|
+
|
|
54
|
+
If You are an individual, or a legal entity whose Annual Revenue is less
|
|
55
|
+
than one million US dollars (USD 1,000,000), the Licensor hereby grants
|
|
56
|
+
You, free of charge, permission to deal in the Software without
|
|
57
|
+
restriction, including without limitation the rights to use, copy, modify,
|
|
58
|
+
merge, publish, distribute, sublicense, and/or sell copies of the
|
|
59
|
+
Software, and to permit persons to whom the Software is furnished to do
|
|
60
|
+
so, subject to the following conditions:
|
|
61
|
+
|
|
62
|
+
(a) The above copyright notice and this License shall be included in all
|
|
63
|
+
copies or substantial portions of the Software.
|
|
64
|
+
|
|
65
|
+
(b) If Your Annual Revenue reaches or exceeds USD 1,000,000, the grant in
|
|
66
|
+
this Section 2 terminates for You, and Section 3 applies from that
|
|
67
|
+
point on.
|
|
68
|
+
|
|
69
|
+
3. COMMERCIAL LICENSE REQUIRED (ANNUAL REVENUE >= USD 1,000,000)
|
|
70
|
+
|
|
71
|
+
If Your Annual Revenue equals or exceeds one million US dollars
|
|
72
|
+
(USD 1,000,000), You must obtain a commercial license from the Licensor
|
|
73
|
+
before using the Software. This applies to every form of use, including
|
|
74
|
+
internal use, use within products or services developed based on the
|
|
75
|
+
Software, and distribution or provision of such products or services to
|
|
76
|
+
third parties.
|
|
77
|
+
|
|
78
|
+
Exception: You may use the Software without a commercial license solely
|
|
79
|
+
for evaluation purposes, for a period of up to thirty (30) days.
|
|
80
|
+
|
|
81
|
+
To obtain a commercial license, contact the Licensor at
|
|
82
|
+
wanghaishan0210@gmail.com, or via the project repository at
|
|
83
|
+
https://github.com/kongusen/deepstrike (open an issue or discussion).
|
|
84
|
+
Commercial terms, including fees, are set by individual agreement with
|
|
85
|
+
the Licensor.
|
|
86
|
+
|
|
87
|
+
Any use of the Software requiring a commercial license under this
|
|
88
|
+
Section 3 without one is unlicensed use and constitutes copyright
|
|
89
|
+
infringement.
|
|
90
|
+
|
|
91
|
+
4. PRIOR VERSIONS
|
|
92
|
+
|
|
93
|
+
Versions of the Software released before this License took effect (up to
|
|
94
|
+
and including version 0.2.62) were released under the MIT License and
|
|
95
|
+
remain available under the terms of the MIT License. This License applies
|
|
96
|
+
only to versions of the Software distributed together with it.
|
|
97
|
+
|
|
98
|
+
5. NO WARRANTY
|
|
99
|
+
|
|
100
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
101
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
102
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
|
103
|
+
THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
104
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
|
105
|
+
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
|
106
|
+
DEALINGS IN THE SOFTWARE.
|
package/dist/index.d.ts
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
export { RuntimeRunner, collectText, runAgent, runFanout, InMemorySessionLog, LocalExecutionPlane, DEFAULT_NATIVE_SIGNAL_POLICY, DEFAULT_NATIVE_GOVERNANCE_POLICY, DEFAULT_SANDBOX_POLICY, assertNativeProfile, osProfile, validateDeclarativePolicy, ReplayProvider, extractRecordedMessages, judge, buildEvalMessages, parseVerdict, verdictOutputSchema, } from "./runtime/index.js";
|
|
1
|
+
export { RuntimeRunner, collectText, runAgent, runFanout, InMemorySessionLog, SESSION_EVENT_KINDS, LocalExecutionPlane, DEFAULT_NATIVE_SIGNAL_POLICY, DEFAULT_NATIVE_GOVERNANCE_POLICY, DEFAULT_SANDBOX_POLICY, assertNativeProfile, osProfile, validateDeclarativePolicy, ReplayProvider, extractRecordedMessages, judge, buildEvalMessages, parseVerdict, verdictOutputSchema, } from "./runtime/index.js";
|
|
2
2
|
export { DriverKernelJournal, InMemoryJournalDriver, InMemoryKernelJournal, JournalCasConflictError, JournalIntegrityError, JournalIoError, } from "./runtime/kernel-journal.js";
|
|
3
3
|
export type { CheckpointCandidate, InstalledCheckpoint, JournalAppendReceipt, JournalEntry, JournalHead, JournalPruneReceipt, JournalRecordInput, JournalStorageDriver, KernelJournal, } from "./runtime/kernel-journal.js";
|
|
4
|
+
export { CANONICAL_CONTENT_PARTS_PREFIX, encodeCanonicalContentParts, decodeCanonicalContentParts, } from "./runtime/kernel-step.js";
|
|
4
5
|
export type { ReplayProviderOpts, Criterion, Verdict, VerdictDetail, JudgeArgs, } from "./runtime/index.js";
|
|
5
|
-
export type { NativeOsProfile, OsProfileId, MemoryPolicy, MemoryWriteRateLimit, ResourceQuota, RuntimeOptions, PromptBudget, SchedulerPolicy, SignalPolicy, SessionEvent, SessionLog, RunContext, ExecutionPlane, KernelEventCategory, KernelPrimitive, } from "./runtime/index.js";
|
|
6
|
+
export type { NativeOsProfile, OsProfileId, MemoryPolicy, MemoryWriteRateLimit, ResourceQuota, RuntimeOptions, PromptBudget, SchedulerPolicy, SignalPolicy, SessionEvent, SessionEventKind, SessionLog, RunContext, ExecutionPlane, KernelEventCategory, KernelPrimitive, } from "./runtime/index.js";
|
|
6
7
|
export { primitiveForCategory, primitiveForKind } from "./runtime/index.js";
|
|
7
8
|
export { FilteredExecutionPlane } from "./runtime/filtered-plane.js";
|
|
8
9
|
export { SubAgentOrchestrator, defaultSubAgentOrchestrator, spawnStandalone } from "./runtime/sub-agent-orchestrator.js";
|
|
@@ -40,12 +41,14 @@ export { ScheduledPrompt } from "./signals/index.js";
|
|
|
40
41
|
export type { RuntimeSignal, SignalSource } from "./signals/index.js";
|
|
41
42
|
export { PermissionManager, PermissionMode } from "./safety/index.js";
|
|
42
43
|
export { createProviderRequestPlan, createProviderRequestPlanForProvider, estimateProviderPromptTokens, measurementForPlan, normalizeProviderUsage, priceProviderUsage, recordPromptMeasurement } from "./providers/request-plan.js";
|
|
43
|
-
export type { CostObservation, NormalizedProviderUsage, PricingSnapshot, ProviderRequestEndpoint, ProviderRequestPlan, ProviderUsage, RecordedPromptMeasurement } from "./providers/request-plan.js";
|
|
44
|
+
export type { CostObservation, NormalizedProviderUsage, PricingSnapshot, ProviderRequestEndpoint, ProviderRequestPlan, ProviderUsage, RecordedPromptMeasurement, ResolvedProviderRoute } from "./providers/request-plan.js";
|
|
45
|
+
export type { ProviderAttempt, ProviderAttemptRecord, ProviderAttemptStatus, ModelInvocation, InvocationOutcome, UsageSettlement, UsageAccountingPolicy, } from "./runtime/execution-evidence.js";
|
|
46
|
+
export { FULL_FOOTPRINT_USAGE_ACCOUNTING_POLICY, providerAttemptToRecord, tryNormalizeProviderUsage } from "./runtime/execution-evidence.js";
|
|
44
47
|
export { decodeCanonicalStopReason, normalizeProviderStopReason } from "./providers/stop-reason.js";
|
|
45
48
|
export type { CanonicalStopReason } from "./providers/stop-reason.js";
|
|
46
49
|
export { ContentPolicyError, contentDispositionFor, requireContentDisposition } from "./providers/content-policy.js";
|
|
47
50
|
export type { ContentDisposition, ContentPlacement, InputModality } from "./providers/content-policy.js";
|
|
48
51
|
export type { PermissionDecision } from "./safety/index.js";
|
|
49
|
-
export type { Message, ToolCall, ToolResult, ToolSchema, RenderedContext, ProviderRunState, StreamEvent, TextDelta, ThinkingDelta, ToolCallEvent, ToolResultEvent, ToolAuditFailedEvent, DoneEvent, ErrorEvent, PermissionRequestEvent, PermissionResolvedEvent, PermissionResponse, EntropySample, EntropySampleEvent, EntropyAlertEvent, EntropyWatchOptions, LLMProvider, CacheBreakpointStrategy, } from "./types.js";
|
|
52
|
+
export type { Message, ToolCall, ToolResult, 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";
|
|
50
53
|
export { DurableContentError, decodeDurableContent, decodeDurableToolResult, encodeDurableContent, encodeDurableToolResult, toolOutputBlocksToDurable, durableBlocksToToolOutput } from "./runtime/durable-content.js";
|
|
51
54
|
export type { DurableContent, DurableContentBlock, DurableSource, DurableToolResult } from "./runtime/durable-content.js";
|
package/dist/index.js
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
|
-
export { RuntimeRunner, collectText, runAgent, runFanout, InMemorySessionLog, LocalExecutionPlane, DEFAULT_NATIVE_SIGNAL_POLICY, DEFAULT_NATIVE_GOVERNANCE_POLICY, DEFAULT_SANDBOX_POLICY, assertNativeProfile, osProfile, validateDeclarativePolicy, ReplayProvider, extractRecordedMessages, judge, buildEvalMessages, parseVerdict, verdictOutputSchema, } from "./runtime/index.js";
|
|
1
|
+
export { RuntimeRunner, collectText, runAgent, runFanout, InMemorySessionLog, SESSION_EVENT_KINDS, LocalExecutionPlane, DEFAULT_NATIVE_SIGNAL_POLICY, DEFAULT_NATIVE_GOVERNANCE_POLICY, DEFAULT_SANDBOX_POLICY, assertNativeProfile, osProfile, validateDeclarativePolicy, ReplayProvider, extractRecordedMessages, judge, buildEvalMessages, parseVerdict, verdictOutputSchema, } from "./runtime/index.js";
|
|
2
2
|
// ── Durable transaction capability (Canonical Kernel ABI §9.1) ──────────────
|
|
3
3
|
export { DriverKernelJournal, InMemoryJournalDriver, InMemoryKernelJournal, JournalCasConflictError, JournalIntegrityError, JournalIoError, } from "./runtime/kernel-journal.js";
|
|
4
|
+
// ── content-parts-v1 registered encoding (F14/B5; byte-pinned by sdk-conformance) ──
|
|
5
|
+
export { CANONICAL_CONTENT_PARTS_PREFIX, encodeCanonicalContentParts, decodeCanonicalContentParts, } from "./runtime/kernel-step.js";
|
|
4
6
|
export { primitiveForCategory, primitiveForKind } from "./runtime/index.js";
|
|
5
7
|
export { FilteredExecutionPlane } from "./runtime/filtered-plane.js";
|
|
6
8
|
export { SubAgentOrchestrator, defaultSubAgentOrchestrator, spawnStandalone } from "./runtime/sub-agent-orchestrator.js";
|
|
@@ -23,6 +25,7 @@ export { AttemptLoop, RuntimeAttemptBody, VerdictFnJudge, LlmEvalJudge, HybridJu
|
|
|
23
25
|
export { ScheduledPrompt } from "./signals/index.js";
|
|
24
26
|
export { PermissionManager, PermissionMode } from "./safety/index.js";
|
|
25
27
|
export { createProviderRequestPlan, createProviderRequestPlanForProvider, estimateProviderPromptTokens, measurementForPlan, normalizeProviderUsage, priceProviderUsage, recordPromptMeasurement } from "./providers/request-plan.js";
|
|
28
|
+
export { FULL_FOOTPRINT_USAGE_ACCOUNTING_POLICY, providerAttemptToRecord, tryNormalizeProviderUsage } from "./runtime/execution-evidence.js";
|
|
26
29
|
export { decodeCanonicalStopReason, normalizeProviderStopReason } from "./providers/stop-reason.js";
|
|
27
30
|
export { ContentPolicyError, contentDispositionFor, requireContentDisposition } from "./providers/content-policy.js";
|
|
28
31
|
export { DurableContentError, decodeDurableContent, decodeDurableToolResult, encodeDurableContent, encodeDurableToolResult, toolOutputBlocksToDurable, durableBlocksToToolOutput } from "./runtime/durable-content.js";
|
|
@@ -36,6 +36,16 @@ export interface ProviderUsage {
|
|
|
36
36
|
cacheCreationInputTokens?: number;
|
|
37
37
|
reasoningTokens?: number;
|
|
38
38
|
}
|
|
39
|
+
/** P4 §1.3 mirror of the node ResolvedProviderRoute (content-addressed route evidence). */
|
|
40
|
+
export interface ResolvedProviderRoute {
|
|
41
|
+
routeId: string;
|
|
42
|
+
provider: string;
|
|
43
|
+
protocol: string;
|
|
44
|
+
model: string;
|
|
45
|
+
endpoint: ProviderRequestEndpoint;
|
|
46
|
+
adapterVersion: string;
|
|
47
|
+
capabilitiesRef: string;
|
|
48
|
+
}
|
|
39
49
|
export interface NormalizedProviderUsage extends ProviderUsage {
|
|
40
50
|
uncachedInputTokens: number;
|
|
41
51
|
}
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* P4 (0.2.64 Execution Evidence Plane): wasm mirror of the host-side object model connecting
|
|
3
|
+
* kernel-minted effects to real provider execution — ModelInvocation / ProviderAttempt /
|
|
4
|
+
* ResolvedProviderRoute / UsageAccountingPolicy. Everything here is L2 host evidence (B7):
|
|
5
|
+
* it lands in SessionLog for cross-verification against the journal (C6/C8) and is NEVER
|
|
6
|
+
* fed back as kernel input (B4/DEC-2 discipline: wall-clock and wire facts stay host-side).
|
|
7
|
+
*/
|
|
8
|
+
import type { ProviderWireEvidence } from "../types.js";
|
|
9
|
+
import type { NormalizedProviderUsage, ResolvedProviderRoute } from "../providers/request-plan.js";
|
|
10
|
+
/** Canonical stop-reason vocabulary already carried on the wire usage frame (types.ts). */
|
|
11
|
+
export type CanonicalStopReason = "end_turn" | "max_tokens" | "stop_sequence" | "tool_use" | "content_filtered";
|
|
12
|
+
/**
|
|
13
|
+
* P4 §1.1: one logical model call = the fact-connected chain of CallProvider effects the
|
|
14
|
+
* kernel walked to obtain one turn of model output. Derived identity, zero minting:
|
|
15
|
+
* `invocationId` IS the first effect's effect_id. Authority = journal; the SessionLog
|
|
16
|
+
* projection (`llm_completed.invocation_id`) is evidence only.
|
|
17
|
+
*/
|
|
18
|
+
export interface ModelInvocation {
|
|
19
|
+
invocationId: string;
|
|
20
|
+
turn: number;
|
|
21
|
+
/** Every effect_id on the chain, in order. Length 1 = first attempt succeeded. */
|
|
22
|
+
effectChain: string[];
|
|
23
|
+
outcome?: InvocationOutcome;
|
|
24
|
+
}
|
|
25
|
+
/** P4 §1.4: the invocation's terminal projection. */
|
|
26
|
+
export interface InvocationOutcome {
|
|
27
|
+
invocationId: string;
|
|
28
|
+
/** The effect the kernel adopted as the outcome (the successful one). */
|
|
29
|
+
selectedEffectId: string;
|
|
30
|
+
stopReason?: CanonicalStopReason;
|
|
31
|
+
/** Absent on a failed chain (nothing settled). */
|
|
32
|
+
settlement?: UsageSettlement;
|
|
33
|
+
}
|
|
34
|
+
export type ProviderAttemptStatus = "success" | "transport_exhausted" | "aborted" | "rejected";
|
|
35
|
+
/**
|
|
36
|
+
* P4 §1.2: one effect's execution against one route, one physical attempt. The kernel-minted
|
|
37
|
+
* `effectId` is the primary key (H7 — no parallel id minting). Transport-ladder rungs are
|
|
38
|
+
* summarized as a count plus the final error class; rung-level evidence belongs to adapter
|
|
39
|
+
* debug logs, not SessionLog.
|
|
40
|
+
*/
|
|
41
|
+
export interface ProviderAttempt {
|
|
42
|
+
effectId: string;
|
|
43
|
+
/** Failover sequence within one effect execution (1-based). Always 1 today (P4 §0.2). */
|
|
44
|
+
attemptSeq: number;
|
|
45
|
+
route: ResolvedProviderRoute;
|
|
46
|
+
/** → ProviderRequestPlan.fingerprint (G2). */
|
|
47
|
+
requestFingerprint: string;
|
|
48
|
+
status: ProviderAttemptStatus;
|
|
49
|
+
transportRungs: number;
|
|
50
|
+
/** classifyProviderError's class, never the raw vendor text (B1 spirit). */
|
|
51
|
+
lastErrorClass?: string;
|
|
52
|
+
/** Host wall-clock, pure evidence, never kernel input (DEC-2 discipline). */
|
|
53
|
+
startedAtMs: number;
|
|
54
|
+
finishedAtMs: number;
|
|
55
|
+
/** Full measurement fields (P4 §2); only the settlement crosses the kernel boundary (B4). */
|
|
56
|
+
usage?: NormalizedProviderUsage;
|
|
57
|
+
wireEvidence?: ProviderWireEvidence;
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* The SessionLog wire payload of a ProviderAttempt (P4 §3): the §1.2 fields flattened into
|
|
61
|
+
* the event, snake_case per SessionLog convention. Nested objects keep their native shape
|
|
62
|
+
* (same convention as `prompt_measured.measurement`).
|
|
63
|
+
*/
|
|
64
|
+
export interface ProviderAttemptRecord {
|
|
65
|
+
effect_id: string;
|
|
66
|
+
attempt_seq: number;
|
|
67
|
+
route: ResolvedProviderRoute;
|
|
68
|
+
request_fingerprint: string;
|
|
69
|
+
status: ProviderAttemptStatus;
|
|
70
|
+
transport_rungs: number;
|
|
71
|
+
last_error_class?: string;
|
|
72
|
+
started_at_ms: number;
|
|
73
|
+
finished_at_ms: number;
|
|
74
|
+
usage?: NormalizedProviderUsage;
|
|
75
|
+
wire_evidence?: ProviderWireEvidence;
|
|
76
|
+
/** P4 §2.1: the accounting policy this attempt's settlement was/will be derived with —
|
|
77
|
+
* pinned on the attempt so settlement is deterministically recomputable from
|
|
78
|
+
* (measurement, policy_id). */
|
|
79
|
+
accounting_policy_id?: string;
|
|
80
|
+
}
|
|
81
|
+
export declare function providerAttemptToRecord(attempt: ProviderAttempt, accountingPolicyId?: string): ProviderAttemptRecord;
|
|
82
|
+
/**
|
|
83
|
+
* P4 §2: the only two numbers that cross the kernel boundary (B4). Field names match the
|
|
84
|
+
* existing ResolveEffect wire shape — this is what the runner already feeds the kernel as
|
|
85
|
+
* `observed_input_tokens` / `observed_output_tokens`.
|
|
86
|
+
*/
|
|
87
|
+
export interface UsageSettlement {
|
|
88
|
+
observed_input_tokens: number;
|
|
89
|
+
observed_output_tokens: number;
|
|
90
|
+
}
|
|
91
|
+
/**
|
|
92
|
+
* P4 §2.1: the named, pinnable, replayable policy turning a measurement into a settlement.
|
|
93
|
+
* `settle` must be a pure function of the measurement — given (usage, policyId) any auditor
|
|
94
|
+
* recomputes the identical settlement.
|
|
95
|
+
*/
|
|
96
|
+
export interface UsageAccountingPolicy {
|
|
97
|
+
policyId: string;
|
|
98
|
+
settle(usage: NormalizedProviderUsage): UsageSettlement;
|
|
99
|
+
}
|
|
100
|
+
/**
|
|
101
|
+
* The default policy = today's implicit runner behavior exactly (full input footprint + full
|
|
102
|
+
* output footprint — the two numbers the runner has always fed `observed_*`). P4 changes no
|
|
103
|
+
* default numbers; it only makes the conversion a named object. The date stamp is the
|
|
104
|
+
* policy's identity: any future semantics change MUST ship under a new policyId.
|
|
105
|
+
*/
|
|
106
|
+
export declare const FULL_FOOTPRINT_USAGE_ACCOUNTING_POLICY: UsageAccountingPolicy;
|
|
107
|
+
/**
|
|
108
|
+
* Defensive measurement assembly for the attempt evidence path: an invalid frame (cache
|
|
109
|
+
* subsets exceeding input, etc.) degrades to NO measurement instead of breaking the run —
|
|
110
|
+
* evidence is never worth a run failure, and the settlement falls back to the raw counts.
|
|
111
|
+
*/
|
|
112
|
+
export declare function tryNormalizeProviderUsage(usage: {
|
|
113
|
+
inputTokens: number;
|
|
114
|
+
outputTokens: number;
|
|
115
|
+
cacheReadInputTokens?: number;
|
|
116
|
+
cacheCreationInputTokens?: number;
|
|
117
|
+
reasoningTokens?: number;
|
|
118
|
+
}): NormalizedProviderUsage | undefined;
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { normalizeProviderUsage } from "../providers/request-plan.js";
|
|
2
|
+
export function providerAttemptToRecord(attempt, accountingPolicyId) {
|
|
3
|
+
return {
|
|
4
|
+
effect_id: attempt.effectId,
|
|
5
|
+
attempt_seq: attempt.attemptSeq,
|
|
6
|
+
route: attempt.route,
|
|
7
|
+
request_fingerprint: attempt.requestFingerprint,
|
|
8
|
+
status: attempt.status,
|
|
9
|
+
transport_rungs: attempt.transportRungs,
|
|
10
|
+
...(attempt.lastErrorClass !== undefined ? { last_error_class: attempt.lastErrorClass } : {}),
|
|
11
|
+
started_at_ms: attempt.startedAtMs,
|
|
12
|
+
finished_at_ms: attempt.finishedAtMs,
|
|
13
|
+
...(attempt.usage !== undefined ? { usage: attempt.usage } : {}),
|
|
14
|
+
...(attempt.wireEvidence !== undefined ? { wire_evidence: attempt.wireEvidence } : {}),
|
|
15
|
+
...(accountingPolicyId !== undefined ? { accounting_policy_id: accountingPolicyId } : {}),
|
|
16
|
+
};
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* The default policy = today's implicit runner behavior exactly (full input footprint + full
|
|
20
|
+
* output footprint — the two numbers the runner has always fed `observed_*`). P4 changes no
|
|
21
|
+
* default numbers; it only makes the conversion a named object. The date stamp is the
|
|
22
|
+
* policy's identity: any future semantics change MUST ship under a new policyId.
|
|
23
|
+
*/
|
|
24
|
+
export const FULL_FOOTPRINT_USAGE_ACCOUNTING_POLICY = {
|
|
25
|
+
policyId: "deepstrike.full-footprint@2026-09-15",
|
|
26
|
+
settle(usage) {
|
|
27
|
+
return {
|
|
28
|
+
observed_input_tokens: usage.inputTokens,
|
|
29
|
+
observed_output_tokens: usage.outputTokens,
|
|
30
|
+
};
|
|
31
|
+
},
|
|
32
|
+
};
|
|
33
|
+
/**
|
|
34
|
+
* Defensive measurement assembly for the attempt evidence path: an invalid frame (cache
|
|
35
|
+
* subsets exceeding input, etc.) degrades to NO measurement instead of breaking the run —
|
|
36
|
+
* evidence is never worth a run failure, and the settlement falls back to the raw counts.
|
|
37
|
+
*/
|
|
38
|
+
export function tryNormalizeProviderUsage(usage) {
|
|
39
|
+
try {
|
|
40
|
+
return normalizeProviderUsage(usage);
|
|
41
|
+
}
|
|
42
|
+
catch {
|
|
43
|
+
return undefined;
|
|
44
|
+
}
|
|
45
|
+
}
|
package/dist/runtime/index.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
export type { SessionEvent, SessionLog } from "./session-log.js";
|
|
1
|
+
export type { SessionEvent, SessionEventKind, SessionLog } from "./session-log.js";
|
|
2
2
|
export { InMemorySessionLog } from "./session-log.js";
|
|
3
|
+
export { SESSION_EVENT_KINDS } from "./session-log.js";
|
|
3
4
|
export { DriverKernelJournal, InMemoryJournalDriver, InMemoryKernelJournal, JournalCasConflictError, JournalIntegrityError, JournalIoError, } from "./kernel-journal.js";
|
|
4
5
|
export type { CheckpointCandidate, InstalledCheckpoint, JournalAppendReceipt, JournalEntry, JournalHead, JournalPruneReceipt, JournalRecordInput, JournalStorageDriver, KernelJournal, } from "./kernel-journal.js";
|
|
5
6
|
export * from "./context-policy.js";
|
package/dist/runtime/index.js
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
export { InMemorySessionLog } from "./session-log.js";
|
|
2
|
+
// Registered session-event vocabulary (F9/S3; manifest-pinned by sdk-conformance, P7-S4)
|
|
3
|
+
export { SESSION_EVENT_KINDS } from "./session-log.js";
|
|
2
4
|
// Durable transaction capability (Canonical Kernel ABI §9.1)
|
|
3
5
|
export { DriverKernelJournal, InMemoryJournalDriver, InMemoryKernelJournal, JournalCasConflictError, JournalIntegrityError, JournalIoError, } from "./kernel-journal.js";
|
|
4
6
|
export * from "./context-policy.js";
|
|
@@ -22,6 +22,11 @@ export declare const CANONICAL_CONTENT_PARTS_PREFIX = "[[deepstrike-content-part
|
|
|
22
22
|
/**
|
|
23
23
|
* Browser/worker-safe transport for typed content. `btoa` and `atob` operate on
|
|
24
24
|
* binary strings, so explicitly bridge UTF-8 bytes rather than assuming Latin-1.
|
|
25
|
+
*
|
|
26
|
+
* Byte contract (content-parts-v1, F14/B5): compact JSON with literal UTF-8, insertion key
|
|
27
|
+
* order, **base64url alphabet, no padding** — identical bytes to the Node and Python SDKs.
|
|
28
|
+
* Decode stays lenient (both alphabets, optional padding) so payloads written before the
|
|
29
|
+
* url-alphabet alignment remain readable.
|
|
25
30
|
*/
|
|
26
31
|
export declare function encodeCanonicalContentParts(parts: unknown[]): string;
|
|
27
32
|
export declare function decodeCanonicalContentParts(content: string): Array<Record<string, unknown>> | undefined;
|
|
@@ -2,19 +2,28 @@ export const CANONICAL_CONTENT_PARTS_PREFIX = "[[deepstrike-content-parts]]";
|
|
|
2
2
|
/**
|
|
3
3
|
* Browser/worker-safe transport for typed content. `btoa` and `atob` operate on
|
|
4
4
|
* binary strings, so explicitly bridge UTF-8 bytes rather than assuming Latin-1.
|
|
5
|
+
*
|
|
6
|
+
* Byte contract (content-parts-v1, F14/B5): compact JSON with literal UTF-8, insertion key
|
|
7
|
+
* order, **base64url alphabet, no padding** — identical bytes to the Node and Python SDKs.
|
|
8
|
+
* Decode stays lenient (both alphabets, optional padding) so payloads written before the
|
|
9
|
+
* url-alphabet alignment remain readable.
|
|
5
10
|
*/
|
|
6
11
|
export function encodeCanonicalContentParts(parts) {
|
|
7
12
|
const bytes = new TextEncoder().encode(JSON.stringify(parts));
|
|
8
13
|
let binary = "";
|
|
9
14
|
for (const byte of bytes)
|
|
10
15
|
binary += String.fromCharCode(byte);
|
|
11
|
-
|
|
16
|
+
const payload = btoa(binary).replaceAll("+", "-").replaceAll("/", "_").replace(/=+$/, "");
|
|
17
|
+
return `${CANONICAL_CONTENT_PARTS_PREFIX}${payload}`;
|
|
12
18
|
}
|
|
13
19
|
export function decodeCanonicalContentParts(content) {
|
|
14
20
|
if (!content.startsWith(CANONICAL_CONTENT_PARTS_PREFIX))
|
|
15
21
|
return undefined;
|
|
16
22
|
try {
|
|
17
|
-
const
|
|
23
|
+
const raw = content.slice(CANONICAL_CONTENT_PARTS_PREFIX.length);
|
|
24
|
+
const standard = raw.replaceAll("-", "+").replaceAll("_", "/");
|
|
25
|
+
const padded = standard + "=".repeat((4 - (standard.length % 4)) % 4);
|
|
26
|
+
const binary = atob(padded);
|
|
18
27
|
const bytes = Uint8Array.from(binary, character => character.charCodeAt(0));
|
|
19
28
|
const decoded = JSON.parse(new TextDecoder().decode(bytes));
|
|
20
29
|
return Array.isArray(decoded)
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import type { ProviderReplay, ToolCall, ToolErrorKind } from "../types.js";
|
|
1
|
+
import type { ProviderReplay, ProviderWireEvidence, ToolCall, ToolErrorKind } from "../types.js";
|
|
2
2
|
import type { MemoryRecall, MemoryScope } from "../memory/index.js";
|
|
3
3
|
import type { KernelPrimitive } from "./kernel-event-log.js";
|
|
4
4
|
import type { KernelJournal } from "./kernel-journal.js";
|
|
5
|
-
import type { RecordedPromptMeasurement } from "../providers/request-plan.js";
|
|
5
|
+
import type { NormalizedProviderUsage, RecordedPromptMeasurement, ResolvedProviderRoute } from "../providers/request-plan.js";
|
|
6
6
|
export type RollbackReason = {
|
|
7
7
|
kind: "fatal_tool_error";
|
|
8
8
|
tool_name: string;
|
|
@@ -22,6 +22,25 @@ export type RollbackReason = {
|
|
|
22
22
|
kind: "malformed_replay";
|
|
23
23
|
reason: string;
|
|
24
24
|
};
|
|
25
|
+
/**
|
|
26
|
+
* P4 §3 mirror: the SessionLog wire payload of a ProviderAttempt (P4 §1.2 fields, flattened,
|
|
27
|
+
* snake_case). Nested objects keep their native shape. The kernel-minted effect_id joins this
|
|
28
|
+
* host evidence to the journal effect chain 1:1 (C6); step_seq NEVER enters SessionLog (P2 §4).
|
|
29
|
+
*/
|
|
30
|
+
export interface ProviderAttemptRecord {
|
|
31
|
+
effect_id: string;
|
|
32
|
+
attempt_seq: number;
|
|
33
|
+
route: ResolvedProviderRoute;
|
|
34
|
+
request_fingerprint: string;
|
|
35
|
+
status: "success" | "transport_exhausted" | "aborted" | "rejected";
|
|
36
|
+
transport_rungs: number;
|
|
37
|
+
last_error_class?: string;
|
|
38
|
+
started_at_ms: number;
|
|
39
|
+
finished_at_ms: number;
|
|
40
|
+
usage?: NormalizedProviderUsage;
|
|
41
|
+
wire_evidence?: ProviderWireEvidence;
|
|
42
|
+
accounting_policy_id?: string;
|
|
43
|
+
}
|
|
25
44
|
export type SessionEvent = {
|
|
26
45
|
kind: "run_started";
|
|
27
46
|
run_id: string;
|
|
@@ -30,6 +49,7 @@ export type SessionEvent = {
|
|
|
30
49
|
agent_id?: string;
|
|
31
50
|
system_prompt?: string;
|
|
32
51
|
attachments?: import("../types.js").ContentPart[];
|
|
52
|
+
route?: ResolvedProviderRoute;
|
|
33
53
|
} | {
|
|
34
54
|
kind: "llm_completed";
|
|
35
55
|
turn: number;
|
|
@@ -37,11 +57,17 @@ export type SessionEvent = {
|
|
|
37
57
|
token_count?: number;
|
|
38
58
|
tool_calls: ToolCall[];
|
|
39
59
|
provider_replay?: ProviderReplay;
|
|
60
|
+
effect_id?: string;
|
|
61
|
+
invocation_id?: string;
|
|
62
|
+
wire_evidence?: ProviderWireEvidence;
|
|
40
63
|
} | {
|
|
41
64
|
kind: "prompt_measured";
|
|
42
65
|
turn: number;
|
|
43
66
|
measurement: RecordedPromptMeasurement;
|
|
44
|
-
|
|
67
|
+
effect_id?: string;
|
|
68
|
+
} | ({
|
|
69
|
+
kind: "provider_attempt";
|
|
70
|
+
} & ProviderAttemptRecord) | {
|
|
45
71
|
kind: "tool_requested";
|
|
46
72
|
turn: number;
|
|
47
73
|
calls: ToolCall[];
|
|
@@ -59,6 +85,7 @@ export type SessionEvent = {
|
|
|
59
85
|
blocks: Record<string, unknown>[];
|
|
60
86
|
};
|
|
61
87
|
}>;
|
|
88
|
+
effect_id?: string;
|
|
62
89
|
} | {
|
|
63
90
|
kind: "tool_argument_repaired";
|
|
64
91
|
turn: number;
|
|
@@ -98,6 +125,18 @@ export type SessionEvent = {
|
|
|
98
125
|
tier_hint?: string;
|
|
99
126
|
message_count?: number;
|
|
100
127
|
archive_ref?: string;
|
|
128
|
+
} | {
|
|
129
|
+
kind: "semantic_archive_pending";
|
|
130
|
+
effect_id: string;
|
|
131
|
+
action?: string;
|
|
132
|
+
} | {
|
|
133
|
+
kind: "semantic_archive_completed";
|
|
134
|
+
effect_id: string;
|
|
135
|
+
record_id: string;
|
|
136
|
+
} | {
|
|
137
|
+
kind: "semantic_archive_failed";
|
|
138
|
+
effect_id: string;
|
|
139
|
+
error: string;
|
|
101
140
|
} | {
|
|
102
141
|
kind: "page_in";
|
|
103
142
|
turn: number;
|
|
@@ -228,6 +267,17 @@ export type SessionEvent = {
|
|
|
228
267
|
turn: number;
|
|
229
268
|
record_id: string;
|
|
230
269
|
error: string;
|
|
270
|
+
} | {
|
|
271
|
+
kind: "memory_write_failed";
|
|
272
|
+
turn: number;
|
|
273
|
+
record_id: string;
|
|
274
|
+
error: string;
|
|
275
|
+
} | {
|
|
276
|
+
kind: "memory_query_failed";
|
|
277
|
+
turn: number;
|
|
278
|
+
scope: MemoryScope;
|
|
279
|
+
query: string;
|
|
280
|
+
error: string;
|
|
231
281
|
} | {
|
|
232
282
|
kind: "memory_retrieval_result";
|
|
233
283
|
hits: MemoryRecall[];
|
|
@@ -278,7 +328,39 @@ export type SessionEvent = {
|
|
|
278
328
|
kind: "summary_upgraded";
|
|
279
329
|
compressed_seq: number;
|
|
280
330
|
summary: string;
|
|
331
|
+
} | {
|
|
332
|
+
kind: "group_member_joined";
|
|
333
|
+
session_id: string;
|
|
334
|
+
role?: string;
|
|
335
|
+
member_kind?: "peer" | "vehicle";
|
|
336
|
+
} | {
|
|
337
|
+
kind: "group_budget_charged";
|
|
338
|
+
tokens: number;
|
|
339
|
+
subagents: number;
|
|
340
|
+
rounds?: number;
|
|
341
|
+
} | {
|
|
342
|
+
kind: "round_started";
|
|
343
|
+
/** 1-based round number within the loop. */
|
|
344
|
+
round: number;
|
|
345
|
+
goal: string;
|
|
346
|
+
} | {
|
|
347
|
+
kind: "round_paced";
|
|
348
|
+
round: number;
|
|
349
|
+
action: "continue" | "sleep" | "stop";
|
|
350
|
+
delay_ms?: number;
|
|
351
|
+
/** Absolute wake time for sleep — lets a stateless host re-arm from the log alone. */
|
|
352
|
+
wake_at_ms?: number;
|
|
353
|
+
reason: string;
|
|
354
|
+
coerced_from?: string;
|
|
281
355
|
};
|
|
356
|
+
export type SessionEventKind = SessionEvent["kind"];
|
|
357
|
+
/**
|
|
358
|
+
* The registered session-event vocabulary (F9 / S3, P7-S4). This list must equal the Node SDK's
|
|
359
|
+
* `SESSION_EVENT_KINDS` — the cross-SDK manifest fixture
|
|
360
|
+
* `tests/fixtures/sdk-conformance/canonical/session-event-vocabulary.json` pins both, and any
|
|
361
|
+
* same-commit desync turns conformance red. Declared in `SessionEvent` union order.
|
|
362
|
+
*/
|
|
363
|
+
export declare const SESSION_EVENT_KINDS: readonly ["run_started", "llm_completed", "prompt_measured", "provider_attempt", "tool_requested", "tool_completed", "tool_argument_repaired", "tool_denied", "permission_requested", "permission_resolved", "compressed", "page_out", "semantic_archive_pending", "semantic_archive_completed", "semantic_archive_failed", "page_in", "rollbacked", "capability_changed", "context_renewed", "suspended", "resumed", "tool_gated", "signal_delivery_disposed", "budget_exceeded", "budget_usage_reported", "operation_cancelled", "milestone_advanced", "milestone_blocked", "checkpoint_taken", "entropy_sample", "entropy_alert", "agent_process_changed", "memory_written", "memory_queried", "memory_validation_failed", "memory_write_failed", "memory_query_failed", "memory_retrieval_result", "workflow_node_completed", "workflow_nodes_submitted", "workflow_batch_spawned", "workflow_completed", "kernel_observation", "run_terminal", "summary_upgraded", "group_member_joined", "group_budget_charged", "round_started", "round_paced"];
|
|
282
364
|
/**
|
|
283
365
|
* The business-projection log (spec §9.2): run started/terminal, stream events, observations,
|
|
284
366
|
* provider/tool presentation, and audit metadata. Canonical durable records live exclusively in
|
|
@@ -1,5 +1,64 @@
|
|
|
1
1
|
import { primitiveForKind } from "./kernel-event-log.js";
|
|
2
2
|
import { InMemoryKernelJournal } from "./kernel-journal.js";
|
|
3
|
+
/**
|
|
4
|
+
* The registered session-event vocabulary (F9 / S3, P7-S4). This list must equal the Node SDK's
|
|
5
|
+
* `SESSION_EVENT_KINDS` — the cross-SDK manifest fixture
|
|
6
|
+
* `tests/fixtures/sdk-conformance/canonical/session-event-vocabulary.json` pins both, and any
|
|
7
|
+
* same-commit desync turns conformance red. Declared in `SessionEvent` union order.
|
|
8
|
+
*/
|
|
9
|
+
export const SESSION_EVENT_KINDS = [
|
|
10
|
+
"run_started",
|
|
11
|
+
"llm_completed",
|
|
12
|
+
"prompt_measured",
|
|
13
|
+
"provider_attempt",
|
|
14
|
+
"tool_requested",
|
|
15
|
+
"tool_completed",
|
|
16
|
+
"tool_argument_repaired",
|
|
17
|
+
"tool_denied",
|
|
18
|
+
"permission_requested",
|
|
19
|
+
"permission_resolved",
|
|
20
|
+
"compressed",
|
|
21
|
+
"page_out",
|
|
22
|
+
"semantic_archive_pending",
|
|
23
|
+
"semantic_archive_completed",
|
|
24
|
+
"semantic_archive_failed",
|
|
25
|
+
"page_in",
|
|
26
|
+
"rollbacked",
|
|
27
|
+
"capability_changed",
|
|
28
|
+
"context_renewed",
|
|
29
|
+
"suspended",
|
|
30
|
+
"resumed",
|
|
31
|
+
"tool_gated",
|
|
32
|
+
"signal_delivery_disposed",
|
|
33
|
+
"budget_exceeded",
|
|
34
|
+
"budget_usage_reported",
|
|
35
|
+
"operation_cancelled",
|
|
36
|
+
"milestone_advanced",
|
|
37
|
+
"milestone_blocked",
|
|
38
|
+
"checkpoint_taken",
|
|
39
|
+
"entropy_sample",
|
|
40
|
+
"entropy_alert",
|
|
41
|
+
"agent_process_changed",
|
|
42
|
+
"memory_written",
|
|
43
|
+
"memory_queried",
|
|
44
|
+
"memory_validation_failed",
|
|
45
|
+
"memory_write_failed",
|
|
46
|
+
"memory_query_failed",
|
|
47
|
+
"memory_retrieval_result",
|
|
48
|
+
"workflow_node_completed",
|
|
49
|
+
"workflow_nodes_submitted",
|
|
50
|
+
"workflow_batch_spawned",
|
|
51
|
+
"workflow_completed",
|
|
52
|
+
"kernel_observation",
|
|
53
|
+
"run_terminal",
|
|
54
|
+
"summary_upgraded",
|
|
55
|
+
"group_member_joined",
|
|
56
|
+
"group_budget_charged",
|
|
57
|
+
"round_started",
|
|
58
|
+
"round_paced",
|
|
59
|
+
];
|
|
60
|
+
const _vocabularyCoversUnion = true;
|
|
61
|
+
void _vocabularyCoversUnion;
|
|
3
62
|
/**
|
|
4
63
|
* **Single-isolate dev/test implementation** of both capabilities (spec §9.4: one class may
|
|
5
64
|
* implement several capabilities; the *interfaces* stay separate). Its `KernelJournal` half is
|
package/dist/types.d.ts
CHANGED
|
@@ -273,6 +273,21 @@ export interface ProviderReplay {
|
|
|
273
273
|
native_message?: unknown;
|
|
274
274
|
tool_calls?: unknown[];
|
|
275
275
|
}
|
|
276
|
+
/** P3 §3.3 (D1) mirror of the node ProviderWireEvidence — SessionLog wire evidence bundle. */
|
|
277
|
+
export interface ProviderWireEvidence {
|
|
278
|
+
protocol: ProviderProtocol;
|
|
279
|
+
/** → ProviderRequestPlan.fingerprint. Mandatory non-empty (G2). */
|
|
280
|
+
request_fingerprint: string;
|
|
281
|
+
response_id?: string;
|
|
282
|
+
/** BoundedJson semantics: producers truncate to ≤4KB. */
|
|
283
|
+
raw_usage?: unknown;
|
|
284
|
+
replay_state?: ProviderReplay;
|
|
285
|
+
}
|
|
286
|
+
/** P4 §1.2 mirror: host-observed transport facts for one provider execution. */
|
|
287
|
+
export interface ProviderTransportTelemetry {
|
|
288
|
+
rungs: number;
|
|
289
|
+
responseId?: string;
|
|
290
|
+
}
|
|
276
291
|
export interface LLMProvider {
|
|
277
292
|
createRunState?(): ProviderRunState;
|
|
278
293
|
runtimePolicy?(): {
|
|
@@ -291,6 +306,8 @@ export interface LLMProvider {
|
|
|
291
306
|
};
|
|
292
307
|
peekProviderReplay?(message: Pick<Message, "content" | "toolCalls">): ProviderReplay | undefined;
|
|
293
308
|
seedProviderReplay?(message: Pick<Message, "content" | "toolCalls">, replay: ProviderReplay): void;
|
|
309
|
+
/** P4-S1 mirror: transport facts of the most recent execution (host evidence only, B7). */
|
|
310
|
+
peekTransportTelemetry?(): ProviderTransportTelemetry | undefined;
|
|
294
311
|
countTokens?(context: RenderedContext, tools: ToolSchema[], extensions?: Record<string, unknown>): Promise<PromptMeasurement>;
|
|
295
312
|
complete(context: RenderedContext, tools: ToolSchema[], extensions?: Record<string, unknown>): Promise<Message>;
|
|
296
313
|
stream(context: RenderedContext, tools: ToolSchema[], extensions?: Record<string, unknown>, state?: ProviderRunState,
|
package/package.json
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@deepstrike/wasm",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.63",
|
|
4
4
|
"description": "DeepStrike WASM SDK — browser, Cloudflare Workers, Deno Deploy",
|
|
5
|
+
"license": "SEE LICENSE IN LICENSE",
|
|
5
6
|
"type": "module",
|
|
6
7
|
"main": "dist/index.js",
|
|
7
8
|
"types": "dist/index.d.ts",
|
|
@@ -13,10 +14,10 @@
|
|
|
13
14
|
"build:wasm": "wasm-pack build ../crates/deepstrike-wasm --target bundler --out-dir ../../wasm/pkg",
|
|
14
15
|
"build": "tsc",
|
|
15
16
|
"test": "node --experimental-vm-modules node_modules/.bin/jest",
|
|
16
|
-
"test:canonical-binding": "wasm-pack build ../crates/deepstrike-wasm --target nodejs --dev --out-dir ../../wasm/pkg-node && node tests/canonical-binding.node.cjs"
|
|
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"
|
|
17
18
|
},
|
|
18
19
|
"dependencies": {
|
|
19
|
-
"@deepstrike/wasm-kernel": "0.2.
|
|
20
|
+
"@deepstrike/wasm-kernel": "0.2.63"
|
|
20
21
|
},
|
|
21
22
|
"devDependencies": {
|
|
22
23
|
"@types/jest": "^30.0.0",
|