@deepstrike/wasm 0.2.68 → 0.2.69

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 CHANGED
@@ -5,6 +5,8 @@ export { CANONICAL_CONTENT_PARTS_PREFIX, encodeCanonicalContentParts, decodeCano
5
5
  export type { ReplayProviderOpts, Criterion, Verdict, VerdictDetail, JudgeArgs, } from "./runtime/index.js";
6
6
  export type { NativeOsProfile, OsProfileId, MemoryPolicy, MemoryWriteRateLimit, ResourceQuota, RuntimeOptions, PromptBudget, SchedulerPolicy, SignalPolicy, SessionEvent, SessionEventKind, SessionLog, RunContext, ExecutionPlane, KernelEventCategory, KernelPrimitive, } from "./runtime/index.js";
7
7
  export { primitiveForCategory, primitiveForKind } from "./runtime/index.js";
8
+ export { VERIFIABLE_REPORT_SCHEMA, VERIFIABLE_FORK_SCHEMA, assertVerifiableReportSchema, createVerifiableRuntimeAdapter, createNativeVerifiableRuntimeAdapter, VerifiableOperation, } from "./runtime/verifiable-report.js";
9
+ export type { VerifiableCommand, CheckVerdict, VerifiableForkManifest, ForkPlan, VerifiableEvidence, VerifyOptions, ReplayOptions, VerifiableRuntimeAdapter, VerifiableReport, VerifiableOperationJson, } from "./runtime/verifiable-report.js";
8
10
  export { FilteredExecutionPlane } from "./runtime/filtered-plane.js";
9
11
  export { SubAgentOrchestrator, defaultSubAgentOrchestrator, spawnStandalone } from "./runtime/sub-agent-orchestrator.js";
10
12
  export type { SubAgentRunContext } from "./runtime/sub-agent-orchestrator.js";
package/dist/index.js CHANGED
@@ -4,6 +4,7 @@ export { DriverKernelJournal, InMemoryJournalDriver, InMemoryKernelJournal, Jour
4
4
  // ── content-parts-v1 registered encoding (F14/B5; byte-pinned by sdk-conformance) ──
5
5
  export { CANONICAL_CONTENT_PARTS_PREFIX, encodeCanonicalContentParts, decodeCanonicalContentParts, } from "./runtime/kernel-step.js";
6
6
  export { primitiveForCategory, primitiveForKind } from "./runtime/index.js";
7
+ export { VERIFIABLE_REPORT_SCHEMA, VERIFIABLE_FORK_SCHEMA, assertVerifiableReportSchema, createVerifiableRuntimeAdapter, createNativeVerifiableRuntimeAdapter, VerifiableOperation, } from "./runtime/verifiable-report.js";
7
8
  export { FilteredExecutionPlane } from "./runtime/filtered-plane.js";
8
9
  export { SubAgentOrchestrator, defaultSubAgentOrchestrator, spawnStandalone } from "./runtime/sub-agent-orchestrator.js";
9
10
  export { workflowSpecToKernel, workflowNodeSpecToKernel, submitWorkflowNodesTool, startWorkflowTool, fanoutSynthesize, generateAndFilter, genEval, verifyRules } from "./runtime/types/agent.js";
@@ -0,0 +1,59 @@
1
+ /** Framework-facing API plus the Rust verifiable-runtime report ABI. */
2
+ export declare const VERIFIABLE_REPORT_SCHEMA: "verifiable-report/v1";
3
+ export declare const VERIFIABLE_FORK_SCHEMA: "verifiable-fork/v1";
4
+ export type VerifiableCommand = "inspect" | "verify" | "replay" | "fork";
5
+ export type CheckVerdict = "pass" | "degraded" | "fail" | "unavailable";
6
+ export type ReplayVerdict = "pass" | "fail" | "unavailable";
7
+ export type VerifiableReport = {
8
+ readonly schema: typeof VERIFIABLE_REPORT_SCHEMA;
9
+ readonly command: VerifiableCommand;
10
+ readonly operation_id: string;
11
+ readonly [key: string]: unknown;
12
+ };
13
+ export interface VerifiableEvidence {
14
+ readonly journal: ReadonlyArray<Uint8Array>;
15
+ readonly sessionLogs?: ReadonlyArray<ReadonlyArray<Uint8Array>>;
16
+ readonly checkpoints?: ReadonlyArray<Uint8Array>;
17
+ }
18
+ export interface VerifyOptions {
19
+ readonly strict?: boolean;
20
+ readonly requireComplete?: boolean;
21
+ }
22
+ export interface ReplayOptions {
23
+ readonly strict?: boolean;
24
+ readonly atStep?: number;
25
+ }
26
+ export interface VerifiableForkManifest {
27
+ schema: typeof VERIFIABLE_FORK_SCHEMA;
28
+ operation_id: string;
29
+ at_step: string;
30
+ parent_record_digest: string;
31
+ parent_input_id: string;
32
+ source_records: number;
33
+ }
34
+ export type ForkPlan = VerifiableForkManifest;
35
+ export interface VerifiableRuntimeAdapter {
36
+ inspect(operationId: string, evidence: VerifiableEvidence, strict: boolean): VerifiableReport;
37
+ verify(operationId: string, evidence: VerifiableEvidence, options: VerifyOptions): VerifiableReport;
38
+ replay(operationId: string, evidence: VerifiableEvidence, options: ReplayOptions): VerifiableReport;
39
+ prepareFork(operationId: string, evidence: VerifiableEvidence, atStep: number, strict: boolean): ForkPlan;
40
+ }
41
+ export type VerifiableOperationJson = (request: string) => string;
42
+ /** Create the SDK adapter backed by the Rust core JSON bridge. */
43
+ export declare function createVerifiableRuntimeAdapter(operationJson: VerifiableOperationJson): VerifiableRuntimeAdapter;
44
+ /** Create the adapter from the lazily loaded WASM binding. */
45
+ export declare function createNativeVerifiableRuntimeAdapter(): Promise<VerifiableRuntimeAdapter>;
46
+ /** Storage-neutral framework handle. Store access remains in the host adapter. */
47
+ export declare class VerifiableOperation {
48
+ readonly operationId: string;
49
+ readonly evidence: VerifiableEvidence;
50
+ private readonly adapter;
51
+ constructor(operationId: string, evidence: VerifiableEvidence, adapter: VerifiableRuntimeAdapter);
52
+ inspect(strict?: boolean): VerifiableReport;
53
+ verify(options?: VerifyOptions): VerifiableReport;
54
+ replay(options?: ReplayOptions): VerifiableReport;
55
+ prepareFork(atStep: number, strict?: boolean): ForkPlan;
56
+ }
57
+ export declare function assertVerifiableReportSchema(value: {
58
+ schema?: unknown;
59
+ }): void;
@@ -0,0 +1,64 @@
1
+ import { getKernel } from "./kernel.js";
2
+ /** Framework-facing API plus the Rust verifiable-runtime report ABI. */
3
+ export const VERIFIABLE_REPORT_SCHEMA = "verifiable-report/v1";
4
+ export const VERIFIABLE_FORK_SCHEMA = "verifiable-fork/v1";
5
+ /** Create the SDK adapter backed by the Rust core JSON bridge. */
6
+ export function createVerifiableRuntimeAdapter(operationJson) {
7
+ const call = (operationId, evidence, command, options = {}) => {
8
+ const result = JSON.parse(operationJson(JSON.stringify({
9
+ operation_id: operationId,
10
+ command,
11
+ evidence: {
12
+ journal: evidence.journal.map((bytes) => Array.from(bytes)),
13
+ session_logs: (evidence.sessionLogs ?? []).map((stream) => stream.map((bytes) => Array.from(bytes))),
14
+ checkpoints: (evidence.checkpoints ?? []).map((bytes) => Array.from(bytes)),
15
+ },
16
+ strict: options.strict ?? false,
17
+ require_complete: "requireComplete" in options ? options.requireComplete ?? false : false,
18
+ at_step: "atStep" in options ? options.atStep : undefined,
19
+ })));
20
+ if (command === "fork")
21
+ return result;
22
+ assertVerifiableReportSchema(result);
23
+ return result;
24
+ };
25
+ return {
26
+ inspect: (operationId, evidence, strict) => call(operationId, evidence, "inspect", { strict }),
27
+ verify: (operationId, evidence, options) => call(operationId, evidence, "verify", options),
28
+ replay: (operationId, evidence, options) => call(operationId, evidence, "replay", options),
29
+ prepareFork: (operationId, evidence, atStep, strict) => call(operationId, evidence, "fork", { atStep, strict }),
30
+ };
31
+ }
32
+ /** Create the adapter from the lazily loaded WASM binding. */
33
+ export async function createNativeVerifiableRuntimeAdapter() {
34
+ const kernel = await getKernel();
35
+ return createVerifiableRuntimeAdapter(kernel.verifiableOperationJson);
36
+ }
37
+ /** Storage-neutral framework handle. Store access remains in the host adapter. */
38
+ export class VerifiableOperation {
39
+ operationId;
40
+ evidence;
41
+ adapter;
42
+ constructor(operationId, evidence, adapter) {
43
+ this.operationId = operationId;
44
+ this.evidence = evidence;
45
+ this.adapter = adapter;
46
+ }
47
+ inspect(strict = false) {
48
+ return this.adapter.inspect(this.operationId, this.evidence, strict);
49
+ }
50
+ verify(options = {}) {
51
+ return this.adapter.verify(this.operationId, this.evidence, options);
52
+ }
53
+ replay(options = {}) {
54
+ return this.adapter.replay(this.operationId, this.evidence, options);
55
+ }
56
+ prepareFork(atStep, strict = false) {
57
+ return this.adapter.prepareFork(this.operationId, this.evidence, atStep, strict);
58
+ }
59
+ }
60
+ export function assertVerifiableReportSchema(value) {
61
+ if (value.schema !== VERIFIABLE_REPORT_SCHEMA) {
62
+ throw new Error(`unsupported verifiable report schema: ${String(value.schema)}`);
63
+ }
64
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@deepstrike/wasm",
3
- "version": "0.2.68",
3
+ "version": "0.2.69",
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.68"
20
+ "@deepstrike/wasm-kernel": "0.2.69"
21
21
  },
22
22
  "devDependencies": {
23
23
  "@types/jest": "^30.0.0",