@deepstrike/sdk 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 +2 -0
- package/dist/index.js +1 -0
- package/dist/kernel.d.ts +1 -0
- package/dist/os/public.d.ts +2 -0
- package/dist/os/public.js +1 -0
- package/dist/runtime/verifiable-report.d.ts +64 -0
- package/dist/runtime/verifiable-report.js +66 -0
- package/package.json +2 -2
package/dist/index.d.ts
CHANGED
|
@@ -49,6 +49,8 @@ export { createProviderRequestPlan, createProviderRequestPlanForProvider, estima
|
|
|
49
49
|
export type { CostObservation, NormalizedProviderUsage, PricingSnapshot, ProviderRequestEndpoint, ProviderRequestPlan, RecordedPromptMeasurement, ResolvedProviderRoute } from "./providers/request-plan.js";
|
|
50
50
|
export { FULL_FOOTPRINT_USAGE_ACCOUNTING_POLICY, providerAttemptToRecord } from "./runtime/execution-evidence.js";
|
|
51
51
|
export type { InvocationOutcome, ModelInvocation, ProviderAttempt, ProviderAttemptRecord, ProviderAttemptStatus, UsageAccountingPolicy, ModelUsageSettlement } from "./runtime/execution-evidence.js";
|
|
52
|
+
export { VERIFIABLE_REPORT_SCHEMA, VERIFIABLE_FORK_SCHEMA, assertVerifiableReportSchema, createVerifiableRuntimeAdapter, createNativeVerifiableRuntimeAdapter, VerifiableOperation, } from "./runtime/verifiable-report.js";
|
|
53
|
+
export type { VerifiableCommand, CheckVerdict, VerifiableForkManifest, ForkPlan, VerifiableEvidence, VerifyOptions, ReplayOptions, VerifiableRuntimeAdapter, VerifiableReport, VerifiableOperationJson, } from "./runtime/verifiable-report.js";
|
|
52
54
|
export type { GovernancePolicy, GovernanceConstraint } from "./governance.js";
|
|
53
55
|
export { AgentPool } from "./collaboration/pool.js";
|
|
54
56
|
export { Agent } from "./agent.js";
|
package/dist/index.js
CHANGED
|
@@ -46,6 +46,7 @@ export { createProvider, createProviderAsync, resolveProviderRuntime, resolvePro
|
|
|
46
46
|
export { UnsupportedModalityError } from "./providers/base.js";
|
|
47
47
|
export { createProviderRequestPlan, createProviderRequestPlanForProvider, estimateProviderPromptTokens, measurementForPlan, normalizeProviderUsage, priceProviderUsage, recordPromptMeasurement, resolveProviderRoute } from "./providers/request-plan.js";
|
|
48
48
|
export { FULL_FOOTPRINT_USAGE_ACCOUNTING_POLICY, providerAttemptToRecord } from "./runtime/execution-evidence.js";
|
|
49
|
+
export { VERIFIABLE_REPORT_SCHEMA, VERIFIABLE_FORK_SCHEMA, assertVerifiableReportSchema, createVerifiableRuntimeAdapter, createNativeVerifiableRuntimeAdapter, VerifiableOperation, } from "./runtime/verifiable-report.js";
|
|
49
50
|
// ── Multi-agent primitive ───────────────────────────────────────────────────
|
|
50
51
|
// Parallel fan-out / sub-agent delegation. The full orchestration layer is in `@deepstrike/sdk/workflow`.
|
|
51
52
|
export { AgentPool } from "./collaboration/pool.js";
|
package/dist/kernel.d.ts
CHANGED
|
@@ -153,6 +153,7 @@ interface KernelModule {
|
|
|
153
153
|
buildEvalMessages(goal: string, criteria: NativeCriterion[], result: string, attempt: number, extractSkillOnPass: boolean): Message[];
|
|
154
154
|
parseVerdict(content: string): Verdict;
|
|
155
155
|
verdictOutputSchema(extractSkillOnPass: boolean): string;
|
|
156
|
+
verifiableOperationJson(request: string): string;
|
|
156
157
|
}
|
|
157
158
|
export declare function getKernel(): KernelModule;
|
|
158
159
|
export {};
|
package/dist/os/public.d.ts
CHANGED
|
@@ -17,3 +17,5 @@ export { extractRecordedMessages } from "../runtime/replay-fixture.js";
|
|
|
17
17
|
export { ProviderReplayValidationError, DEGRADED_REASONING_PLACEHOLDER } from "../providers/replay-validator.js";
|
|
18
18
|
export { ProviderReplayProtocolMismatchError, assessProviderReplayability, peekProviderReplay, seedProviderReplayFromEvents, isReplayCompatibleWithProvider, } from "../runtime/provider-replay.js";
|
|
19
19
|
export type { ReplayabilityAssessment } from "../types.js";
|
|
20
|
+
export { VERIFIABLE_REPORT_SCHEMA, VERIFIABLE_FORK_SCHEMA, assertVerifiableReportSchema, createVerifiableRuntimeAdapter, createNativeVerifiableRuntimeAdapter, VerifiableOperation, } from "../runtime/verifiable-report.js";
|
|
21
|
+
export type { VerifiableCommand, CheckVerdict, VerifiableForkManifest, ForkPlan, VerifiableEvidence, VerifyOptions, ReplayOptions, VerifiableRuntimeAdapter, VerifiableReport, VerifiableOperationJson, } from "../runtime/verifiable-report.js";
|
package/dist/os/public.js
CHANGED
|
@@ -13,3 +13,4 @@ export { ReplayProvider } from "../runtime/replay-provider.js";
|
|
|
13
13
|
export { extractRecordedMessages } from "../runtime/replay-fixture.js";
|
|
14
14
|
export { ProviderReplayValidationError, DEGRADED_REASONING_PLACEHOLDER } from "../providers/replay-validator.js";
|
|
15
15
|
export { ProviderReplayProtocolMismatchError, assessProviderReplayability, peekProviderReplay, seedProviderReplayFromEvents, isReplayCompatibleWithProvider, } from "../runtime/provider-replay.js";
|
|
16
|
+
export { VERIFIABLE_REPORT_SCHEMA, VERIFIABLE_FORK_SCHEMA, assertVerifiableReportSchema, createVerifiableRuntimeAdapter, createNativeVerifiableRuntimeAdapter, VerifiableOperation, } from "../runtime/verifiable-report.js";
|
|
@@ -0,0 +1,64 @@
|
|
|
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 ForkPlan extends VerifiableForkManifest {
|
|
27
|
+
readonly at_step: string;
|
|
28
|
+
}
|
|
29
|
+
export interface VerifiableRuntimeAdapter {
|
|
30
|
+
inspect(operationId: string, evidence: VerifiableEvidence, strict: boolean): VerifiableReport;
|
|
31
|
+
verify(operationId: string, evidence: VerifiableEvidence, options: VerifyOptions): VerifiableReport;
|
|
32
|
+
replay(operationId: string, evidence: VerifiableEvidence, options: ReplayOptions): VerifiableReport;
|
|
33
|
+
prepareFork(operationId: string, evidence: VerifiableEvidence, atStep: number, strict: boolean): ForkPlan;
|
|
34
|
+
}
|
|
35
|
+
export type VerifiableOperationJson = (request: string) => string;
|
|
36
|
+
/** Create the SDK adapter backed by the Rust core JSON bridge. */
|
|
37
|
+
export declare function createVerifiableRuntimeAdapter(operationJson: VerifiableOperationJson): VerifiableRuntimeAdapter;
|
|
38
|
+
/** Create the adapter from the installed native Node binding. */
|
|
39
|
+
export declare function createNativeVerifiableRuntimeAdapter(): VerifiableRuntimeAdapter;
|
|
40
|
+
/**
|
|
41
|
+
* Storage-neutral framework handle. The adapter is the single semantic bridge to Rust core;
|
|
42
|
+
* filesystem, database, and browser stores implement evidence loading outside this class.
|
|
43
|
+
*/
|
|
44
|
+
export declare class VerifiableOperation {
|
|
45
|
+
readonly operationId: string;
|
|
46
|
+
readonly evidence: VerifiableEvidence;
|
|
47
|
+
private readonly adapter;
|
|
48
|
+
constructor(operationId: string, evidence: VerifiableEvidence, adapter: VerifiableRuntimeAdapter);
|
|
49
|
+
inspect(strict?: boolean): VerifiableReport;
|
|
50
|
+
verify(options?: VerifyOptions): VerifiableReport;
|
|
51
|
+
replay(options?: ReplayOptions): VerifiableReport;
|
|
52
|
+
prepareFork(atStep: number, strict?: boolean): ForkPlan;
|
|
53
|
+
}
|
|
54
|
+
export interface VerifiableForkManifest {
|
|
55
|
+
schema: typeof VERIFIABLE_FORK_SCHEMA;
|
|
56
|
+
operation_id: string;
|
|
57
|
+
at_step: string;
|
|
58
|
+
parent_record_digest: string;
|
|
59
|
+
parent_input_id: string;
|
|
60
|
+
source_records: number;
|
|
61
|
+
}
|
|
62
|
+
export declare function assertVerifiableReportSchema(value: {
|
|
63
|
+
schema?: unknown;
|
|
64
|
+
}): void;
|
|
@@ -0,0 +1,66 @@
|
|
|
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 installed native Node binding. */
|
|
33
|
+
export function createNativeVerifiableRuntimeAdapter() {
|
|
34
|
+
return createVerifiableRuntimeAdapter(getKernel().verifiableOperationJson);
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* Storage-neutral framework handle. The adapter is the single semantic bridge to Rust core;
|
|
38
|
+
* filesystem, database, and browser stores implement evidence loading outside this class.
|
|
39
|
+
*/
|
|
40
|
+
export class VerifiableOperation {
|
|
41
|
+
operationId;
|
|
42
|
+
evidence;
|
|
43
|
+
adapter;
|
|
44
|
+
constructor(operationId, evidence, adapter) {
|
|
45
|
+
this.operationId = operationId;
|
|
46
|
+
this.evidence = evidence;
|
|
47
|
+
this.adapter = adapter;
|
|
48
|
+
}
|
|
49
|
+
inspect(strict = false) {
|
|
50
|
+
return this.adapter.inspect(this.operationId, this.evidence, strict);
|
|
51
|
+
}
|
|
52
|
+
verify(options = {}) {
|
|
53
|
+
return this.adapter.verify(this.operationId, this.evidence, options);
|
|
54
|
+
}
|
|
55
|
+
replay(options = {}) {
|
|
56
|
+
return this.adapter.replay(this.operationId, this.evidence, options);
|
|
57
|
+
}
|
|
58
|
+
prepareFork(atStep, strict = false) {
|
|
59
|
+
return this.adapter.prepareFork(this.operationId, this.evidence, atStep, strict);
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
export function assertVerifiableReportSchema(value) {
|
|
63
|
+
if (value.schema !== VERIFIABLE_REPORT_SCHEMA) {
|
|
64
|
+
throw new Error(`unsupported verifiable report schema: ${String(value.schema)}`);
|
|
65
|
+
}
|
|
66
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@deepstrike/sdk",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.69",
|
|
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.69",
|
|
77
77
|
"@google/generative-ai": "^0.24.1",
|
|
78
78
|
"openai": "^7.5.0"
|
|
79
79
|
},
|