@hardkas/sdk 0.9.0-alpha → 0.9.1-alpha

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.
Files changed (4) hide show
  1. package/README.md +51 -51
  2. package/dist/index.d.ts +492 -7
  3. package/dist/index.js +2101 -106
  4. package/package.json +13 -13
package/README.md CHANGED
@@ -1,51 +1,51 @@
1
- # `@hardkas/sdk`
2
-
3
- The HardKas SDK is the programmatic API for local-first transaction workflows. It exposes the same core model as the CLI: plan, sign, simulate or send, then inspect artifacts and lineage.
4
-
5
- ## 1. Create A Local SDK
6
-
7
- ```typescript
8
- import { Hardkas } from "@hardkas/sdk";
9
-
10
- const sdk = await Hardkas.create({
11
- cwd: process.cwd(),
12
- autoBootstrap: true,
13
- network: "simulated"
14
- });
15
- ```
16
-
17
- `autoBootstrap: true` is the easiest local path. It creates or loads the workspace data needed for simulated accounts, artifacts, and local execution.
18
-
19
- ## 2. Transaction Flow
20
-
21
- ```typescript
22
- const plan = await sdk.tx.plan({
23
- from: "alice",
24
- to: "bob",
25
- amount: "1",
26
- network: "simulated"
27
- });
28
-
29
- const signed = await sdk.tx.sign(plan, {
30
- account: "alice"
31
- });
32
-
33
- const receipt = await sdk.tx.simulate(signed);
34
- ```
35
-
36
- For a real RPC-backed node, create the SDK with an explicit network/provider configuration and treat the send step as network-state dependent. Mainnet should remain outside the default local development flow.
37
-
38
- ## 3. Artifacts And Queries
39
-
40
- The SDK can read artifacts, trace lineage, replay local records, and query the local projection:
41
-
42
- ```typescript
43
- const artifacts = await sdk.query.artifacts.list();
44
- const trace = await sdk.lineage.trace(receipt.txId);
45
- ```
46
-
47
- The SQLite query store is rebuildable. The durable source of truth is the workspace artifact and event data.
48
-
49
- ## 4. Boundary
50
-
51
- The SDK should be used from Node.js. Browser applications should talk to the dev server through `@hardkas/client`, not import `@hardkas/sdk` directly.
1
+ # `@hardkas/sdk`
2
+
3
+ The HardKas SDK is the programmatic API for local-first transaction workflows. It exposes the same core model as the CLI: plan, sign, simulate or send, then inspect artifacts and lineage.
4
+
5
+ ## 1. Create A Local SDK
6
+
7
+ ```typescript
8
+ import { Hardkas } from "@hardkas/sdk";
9
+
10
+ const sdk = await Hardkas.create({
11
+ cwd: process.cwd(),
12
+ autoBootstrap: true,
13
+ network: "simulated"
14
+ });
15
+ ```
16
+
17
+ `autoBootstrap: true` is the easiest local path. It creates or loads the workspace data needed for simulated accounts, artifacts, and local execution.
18
+
19
+ ## 2. Transaction Flow
20
+
21
+ ```typescript
22
+ const plan = await sdk.tx.plan({
23
+ from: "alice",
24
+ to: "bob",
25
+ amount: "1",
26
+ network: "simulated"
27
+ });
28
+
29
+ const signed = await sdk.tx.sign(plan, {
30
+ account: "alice"
31
+ });
32
+
33
+ const receipt = await sdk.tx.simulate(signed);
34
+ ```
35
+
36
+ For a real RPC-backed node, create the SDK with an explicit network/provider configuration and treat the send step as network-state dependent. Mainnet should remain outside the default local development flow.
37
+
38
+ ## 3. Artifacts And Queries
39
+
40
+ The SDK can read artifacts, trace lineage, replay local records, and query the local projection:
41
+
42
+ ```typescript
43
+ const artifacts = await sdk.query.artifacts.list();
44
+ const trace = await sdk.lineage.trace(receipt.txId);
45
+ ```
46
+
47
+ The SQLite query store is rebuildable. The durable source of truth is the workspace artifact and event data.
48
+
49
+ ## 4. Boundary
50
+
51
+ The SDK should be used from Node.js. Browser applications should talk to the dev server through `@hardkas/client`, not import `@hardkas/sdk` directly.
package/dist/index.d.ts CHANGED
@@ -1,17 +1,65 @@
1
1
  import * as _hardkas_config from '@hardkas/config';
2
2
  import { LoadedHardkasConfig } from '@hardkas/config';
3
3
  export { defineHardkasConfig } from '@hardkas/config';
4
- import { TxPlanArtifact, SignedTxArtifact, TxReceiptArtifact, HardkasArtifactBase, WorkflowArtifact, ExternalHardkasSigner } from '@hardkas/artifacts';
4
+ import { TxPlanArtifact, SignedTxArtifact, TxReceiptArtifact, HardkasSchemas, HardkasArtifactBase, WorkflowArtifact, ExternalHardkasSigner } from '@hardkas/artifacts';
5
5
  export { ARTIFACT_SCHEMAS, HARDKAS_VERSION, SignedTxArtifact, TxPlanArtifact, TxReceiptArtifact, TxTraceArtifact, createTxPlanArtifact, writeArtifact } from '@hardkas/artifacts';
6
6
  import { KaspaRpcClient } from '@hardkas/kaspa-rpc';
7
7
  import { EventEnvelope, NetworkId } from '@hardkas/core';
8
- export { ArtifactId, HardkasError, KaspaAddress, LineageId, NetworkId, SOMPI_PER_KAS, TxId, formatSompi, parseKasToSompi } from '@hardkas/core';
8
+ export { ArtifactId, HardkasError, KaspaAddress, LineageId, NetworkId, SOMPI_PER_KAS, TxId, formatSompiToKas, parseKasToSompi } from '@hardkas/core';
9
9
  import { HardkasAccount } from '@hardkas/accounts';
10
10
  export { signTxPlanArtifact } from '@hardkas/accounts';
11
11
  import { L2NetworkProfile } from '@hardkas/l2';
12
+ import { SilverSimulationState } from '@hardkas/simulator';
12
13
  export { buildPaymentPlan } from '@hardkas/tx-builder';
13
14
  export { ClientEnvelope, HardkasClientOptions, createHardkasClient } from './client.js';
14
15
 
16
+ interface HardkasCapabilities {
17
+ version: string;
18
+ maturity: "alpha" | "hardened-alpha" | "beta" | "stable";
19
+ proofVersion: string;
20
+ hashVersion: number;
21
+ capabilities: {
22
+ artifacts: boolean;
23
+ lineageVerification: boolean;
24
+ deterministicHashing: boolean;
25
+ atomicPersistence: boolean;
26
+ workspaceLocks: boolean;
27
+ corruptionDetection: boolean;
28
+ secretRedaction: boolean;
29
+ mainnetGuards: boolean;
30
+ localnetSimulation: boolean;
31
+ ghostdagSimulation: boolean;
32
+ dagConflictResolution: boolean;
33
+ massProfiler: boolean;
34
+ simulationScenarios: boolean;
35
+ queryStore: boolean;
36
+ replayVerification: boolean;
37
+ schemaMigrations: boolean;
38
+ dockerNode: boolean;
39
+ scriptRunner: boolean;
40
+ testingFramework: boolean;
41
+ l2Profiles: boolean;
42
+ l2BridgeAssumptions: boolean;
43
+ consensusValidation: boolean;
44
+ productionWallet: boolean;
45
+ silverScript: boolean;
46
+ covenants: boolean;
47
+ trustlessExit: boolean;
48
+ differentialDagValidation: boolean;
49
+ };
50
+ trustBoundaries: {
51
+ replay: "local-workflow-only";
52
+ artifacts: "internal-integrity-only";
53
+ simulator: "research-experimental";
54
+ queryStore: "rebuildable-read-model";
55
+ l2Bridge: "pre-zk-assumptions";
56
+ };
57
+ }
58
+ declare class HardkasCapabilitiesApi {
59
+ get(): Promise<HardkasCapabilities>;
60
+ }
61
+ declare function createHardkasCapabilities(): HardkasCapabilities;
62
+
15
63
  /**
16
64
  * HardKAS Accounts Module
17
65
  * @alpha
@@ -38,9 +86,9 @@ declare class HardkasAccounts {
38
86
  formatted: string;
39
87
  }>;
40
88
  /**
41
- * Lists all configured account names.
89
+ * Lists all available HardKAS accounts.
42
90
  */
43
- list(): Promise<string[]>;
91
+ list(): Promise<Record<string, unknown>[]>;
44
92
  /**
45
93
  * Funds an account from another account (defaults to 'default' account).
46
94
  */
@@ -172,6 +220,48 @@ declare class HardkasQuery {
172
220
  }): Promise<readonly EventEnvelope[]>;
173
221
  }
174
222
 
223
+ interface LocalnetProfileOptions {
224
+ profile?: "simulated" | "toccata-v2" | string;
225
+ }
226
+ interface LocalnetStatusResult {
227
+ schema: typeof HardkasSchemas.LocalnetStatusV1;
228
+ profile: string;
229
+ node: {
230
+ ready: boolean;
231
+ rpcUrl: string;
232
+ networkId?: string;
233
+ serverVersion?: string;
234
+ isSynced?: boolean;
235
+ virtualDaaScore?: string;
236
+ lastError?: string;
237
+ };
238
+ miner: {
239
+ exists: boolean;
240
+ running: boolean;
241
+ status: string;
242
+ image: string;
243
+ name: string;
244
+ };
245
+ simulationLevels: {
246
+ artifactCoherence: "READY";
247
+ runtimeOutcome: "PARTIAL";
248
+ vmConsensusEquivalence: "NOT_CLAIMED";
249
+ };
250
+ }
251
+ interface LocalnetControlResult {
252
+ schema: typeof HardkasSchemas.LocalnetControlV1;
253
+ profile: string;
254
+ status: "SIMULATED_LOCALNET_READY" | "SDK_LOCALNET_CONTROL_UNSUPPORTED";
255
+ message: string;
256
+ }
257
+ interface LocalnetFundingResult {
258
+ schema: typeof HardkasSchemas.LocalnetFundingV1;
259
+ profile: string;
260
+ identifier: string;
261
+ status: "SIMULATED_ACCOUNT_FUNDED" | "SDK_TOCCATA_FUNDING_UNSUPPORTED";
262
+ receipt?: unknown;
263
+ message: string;
264
+ }
175
265
  /**
176
266
  * HardKAS Localnet Simulation Module
177
267
  */
@@ -183,13 +273,32 @@ declare class HardkasLocalnet {
183
273
  */
184
274
  isAlive(): Promise<boolean>;
185
275
  /**
186
- * Future: control localnet process/container from here.
276
+ * Status check with the same claim boundaries as `hardkas localnet status --json`.
277
+ */
278
+ status(options?: LocalnetProfileOptions): Promise<LocalnetStatusResult>;
279
+ /**
280
+ * Initializes the in-memory simulated workspace.
281
+ *
282
+ * Docker Toccata process control remains a CLI/localnet responsibility in
283
+ * 0.9.1-alpha; the SDK reports that boundary instead of silently shelling out.
284
+ */
285
+ start(options?: LocalnetProfileOptions): Promise<LocalnetControlResult>;
286
+ /**
287
+ * Funds a simulated account through the SDK transaction flow.
288
+ *
289
+ * Toccata Docker mining/funding remains CLI-only in 0.9.1-alpha because it
290
+ * depends on a local stratum/miner companion and host Docker state.
187
291
  */
188
- start(): Promise<void>;
292
+ fund(identifier: string, options?: LocalnetProfileOptions & {
293
+ from?: string;
294
+ amount?: string | bigint;
295
+ }): Promise<LocalnetFundingResult>;
189
296
  /**
190
297
  * Resets the localnet state (simulated or node).
191
298
  */
192
299
  reset(): Promise<void>;
300
+ private detectToccataNode;
301
+ private inspectDockerContainer;
193
302
  }
194
303
 
195
304
  interface ReplayVerifyOptions {
@@ -357,6 +466,375 @@ declare class HardkasWorkflow {
357
466
  run(options: WorkflowRunOptions): Promise<WorkflowArtifact>;
358
467
  }
359
468
 
469
+ interface CorpusIssue {
470
+ code: string;
471
+ message: string;
472
+ file?: string;
473
+ }
474
+ interface CorpusVerifyResult {
475
+ ok: boolean;
476
+ schema: typeof HardkasSchemas.ToccataCorpusV1;
477
+ path: string;
478
+ summary: {
479
+ happyPathFixtures: number;
480
+ failureFixtures: number;
481
+ artifactsChecked: number;
482
+ contentHashes: "PASS" | "FAIL";
483
+ compareMode: string;
484
+ simulationStatus: string;
485
+ knownLimitations: string[];
486
+ };
487
+ claims: {
488
+ artifactCoherence: "READY_MATCH" | "INVALID";
489
+ runtimeOutcome: "PARTIAL" | "INVALID";
490
+ vmConsensusEquivalence: "NOT_CLAIMED" | "INVALID";
491
+ mainnet: "BLOCKED_BY_POLICY" | "INVALID";
492
+ };
493
+ issues: CorpusIssue[];
494
+ }
495
+ declare class HardkasCorpus {
496
+ private sdk;
497
+ constructor(sdk: Hardkas);
498
+ verify(targetPath: string): Promise<CorpusVerifyResult>;
499
+ }
500
+ declare function verifyToccataCorpus(targetPath: string, workspaceRoot?: string): CorpusVerifyResult;
501
+
502
+ interface SilverSdkWriteOptions {
503
+ write?: boolean;
504
+ outputPath?: string;
505
+ }
506
+ interface SilverCompileOptions extends SilverSdkWriteOptions {
507
+ file: string;
508
+ network?: "simnet" | string;
509
+ compilerPath?: string;
510
+ }
511
+ interface SilverDeployPlanOptions extends SilverSdkWriteOptions {
512
+ artifact: string | any;
513
+ from: string;
514
+ amount?: string | number | bigint;
515
+ network?: "simnet" | string;
516
+ }
517
+ interface SilverSpendPlanOptions extends SilverSdkWriteOptions {
518
+ receipt: string | any;
519
+ args?: Array<{
520
+ type: "hex";
521
+ value: string;
522
+ }>;
523
+ argsPath?: string;
524
+ to: string;
525
+ }
526
+ interface SilverCompareOptions {
527
+ simulated: string | any;
528
+ docker: string | any;
529
+ mode?: SilverCompareMode;
530
+ }
531
+ interface SilverSdkArtifactResult<T> {
532
+ artifact: T;
533
+ artifactPath?: string;
534
+ }
535
+ type SilverCompareMode = "artifact-coherence" | "runtime-outcome" | "strict";
536
+ interface SilverCompareEntry {
537
+ field: string;
538
+ reason: string;
539
+ classification: "MATCH" | "MISSING_IN_SIM" | "MISSING_IN_REAL" | "SEMANTIC_MISMATCH" | "SEMANTICALLY_DERIVED" | "IGNORED_NON_CONSENSUS";
540
+ }
541
+ interface SilverCompareReport {
542
+ status: "SILVERSCRIPT_SIMULATION_MATCH" | "SILVERSCRIPT_SIMULATION_DRIFT";
543
+ mode: SilverCompareMode;
544
+ drift: SilverCompareEntry[];
545
+ notes: SilverCompareEntry[];
546
+ expectedKnownLimitations: ["PARTIAL_VM_SIMULATION"];
547
+ }
548
+ declare class HardkasSilver {
549
+ private sdk;
550
+ readonly simulate: {
551
+ deploy: (deployPlan: string | any, options?: SilverSdkWriteOptions) => Promise<SilverSdkArtifactResult<any>>;
552
+ spend: (spendPlan: string | any, state?: SilverSimulationState, options?: SilverSdkWriteOptions) => Promise<SilverSdkArtifactResult<any>>;
553
+ compare: (options: SilverCompareOptions) => Promise<SilverCompareReport>;
554
+ };
555
+ constructor(sdk: Hardkas);
556
+ compile(options: SilverCompileOptions): Promise<SilverSdkArtifactResult<any>>;
557
+ deployPlan(options: SilverDeployPlanOptions): Promise<SilverSdkArtifactResult<any>>;
558
+ deploy(options: {
559
+ artifact: string | any;
560
+ mode?: "simulate" | "real";
561
+ } & SilverSdkWriteOptions): Promise<SilverSdkArtifactResult<any>>;
562
+ spendPlan(options: SilverSpendPlanOptions): Promise<SilverSdkArtifactResult<any>>;
563
+ spend(options: {
564
+ artifact: string | any;
565
+ state?: SilverSimulationState;
566
+ mode?: "simulate" | "real";
567
+ } & SilverSdkWriteOptions): Promise<SilverSdkArtifactResult<any>>;
568
+ simulateDeploy(deployPlan: string | any, options?: SilverSdkWriteOptions): Promise<SilverSdkArtifactResult<any>>;
569
+ simulateSpend(spendPlan: string | any, state?: SilverSimulationState, options?: SilverSdkWriteOptions): Promise<SilverSdkArtifactResult<any>>;
570
+ compare(options: SilverCompareOptions): Promise<SilverCompareReport>;
571
+ private resolveArtifact;
572
+ private writeSdkArtifact;
573
+ private simulationStatePath;
574
+ private loadSimulationState;
575
+ private saveSimulationState;
576
+ }
577
+
578
+ type ZkProofSystem = "groth16" | "risc0" | "unknown";
579
+ interface ZkIssue {
580
+ code: string;
581
+ message: string;
582
+ file?: string;
583
+ }
584
+ interface ZkCapabilities {
585
+ schema: typeof HardkasSchemas.ZkCapabilitiesV1;
586
+ experimental: true;
587
+ proofSystems: {
588
+ groth16: {
589
+ inspect: true;
590
+ verifyLocal: "FIXTURE_COHERENCE_ONLY";
591
+ proofGeneration: "NOT_CLAIMED";
592
+ };
593
+ risc0: {
594
+ inspect: true;
595
+ verifyLocal: "RISC0_LOCAL_VERIFICATION_NOT_IMPLEMENTED";
596
+ proofGeneration: "NOT_CLAIMED";
597
+ };
598
+ };
599
+ claims: {
600
+ zkArtifactCoherence: "EXPERIMENTAL";
601
+ zkLocalVerification: "EXPERIMENTAL_FIXTURE_ONLY";
602
+ zkOnchainVerification: "NOT_CLAIMED";
603
+ vmConsensusEquivalence: "NOT_CLAIMED";
604
+ mainnet: "BLOCKED_BY_POLICY";
605
+ };
606
+ errors: string[];
607
+ }
608
+ interface ZkProofInspectResult {
609
+ ok: boolean;
610
+ schema: typeof HardkasSchemas.ZkProofInspectV1;
611
+ path: string;
612
+ proofSystem: ZkProofSystem;
613
+ status: "ZK_PROOF_INSPECTED" | "ZK_PROOF_INSPECT_FAILED";
614
+ experimental: true;
615
+ summary: {
616
+ files: string[];
617
+ contentHashes: Record<string, string>;
618
+ verifierAdapter?: string;
619
+ expectedStatus?: string;
620
+ };
621
+ claims: ZkCapabilities["claims"];
622
+ issues: ZkIssue[];
623
+ }
624
+ interface ZkProofVerifyResult {
625
+ ok: boolean;
626
+ schema: typeof HardkasSchemas.ZkProofVerificationV1;
627
+ path: string;
628
+ proofSystem: ZkProofSystem;
629
+ status: "ZK_FIXTURE_COHERENCE_PASS" | "ZK_FIXTURE_COHERENCE_FAIL" | "RISC0_LOCAL_VERIFICATION_NOT_IMPLEMENTED" | "ZK_VERIFIER_UNSUPPORTED" | "ZK_VERIFIER_UNAVAILABLE";
630
+ experimental: true;
631
+ summary: {
632
+ verifierAdapter?: string;
633
+ contentHashes: "PASS" | "FAIL";
634
+ localVerification: "PASS" | "FAIL" | "NOT_IMPLEMENTED";
635
+ };
636
+ claims: ZkCapabilities["claims"];
637
+ issues: ZkIssue[];
638
+ }
639
+ interface ZkCorpusVerifyResult {
640
+ ok: boolean;
641
+ schema: typeof HardkasSchemas.ZkCorpusVerificationV1;
642
+ path: string;
643
+ experimental: true;
644
+ status: "ZK_CORPUS_VERIFICATION_PASS" | "ZK_CORPUS_VERIFICATION_FAIL";
645
+ summary: {
646
+ proofSystems: string[];
647
+ fixturesChecked: number;
648
+ artifactsChecked: number;
649
+ contentHashes: "PASS" | "FAIL";
650
+ localVerification: "PASS" | "FAIL" | "PARTIAL";
651
+ knownLimitations: string[];
652
+ };
653
+ claims: {
654
+ zkArtifactCoherence: "READY_MATCH" | "INVALID";
655
+ zkLocalVerification: "READY_GROTH16_FIXTURE_COHERENCE" | "INVALID";
656
+ zkOnchainVerification: "NOT_CLAIMED" | "INVALID";
657
+ runtimeOutcome: "PARTIAL" | "INVALID";
658
+ vmConsensusEquivalence: "NOT_CLAIMED" | "INVALID";
659
+ mainnet: "BLOCKED_BY_POLICY" | "INVALID";
660
+ };
661
+ issues: ZkIssue[];
662
+ }
663
+ declare class HardkasZk {
664
+ private sdk;
665
+ readonly proof: {
666
+ inspect: (targetPath: string) => Promise<ZkProofInspectResult>;
667
+ verifyLocal: (targetPath: string) => Promise<ZkProofVerifyResult>;
668
+ };
669
+ readonly corpus: {
670
+ verify: (targetPath: string) => Promise<ZkCorpusVerifyResult>;
671
+ };
672
+ constructor(sdk: Hardkas);
673
+ capabilities(): Promise<ZkCapabilities>;
674
+ }
675
+ declare function createZkCapabilities(): ZkCapabilities;
676
+ declare function inspectZkProof(targetPath: string, workspaceRoot?: string): Promise<ZkProofInspectResult>;
677
+ declare function verifyZkProofLocal(targetPath: string, workspaceRoot?: string): Promise<ZkProofVerifyResult>;
678
+ declare function verifyZkCorpus(targetPath: string, workspaceRoot?: string): Promise<ZkCorpusVerifyResult>;
679
+
680
+ interface VprogsClaims {
681
+ vProgsArtifactInspection: "READY";
682
+ vProgsRuntime: "NOT_CLAIMED";
683
+ vProgsStableApi: "NOT_CLAIMED";
684
+ zkOnchainVerification: "NOT_CLAIMED";
685
+ vmConsensusEquivalence: "NOT_CLAIMED";
686
+ mainnet: "BLOCKED_BY_POLICY";
687
+ }
688
+ interface VprogsCapabilitiesResult {
689
+ ok: boolean;
690
+ schema: typeof HardkasSchemas.VProgsCapabilitiesV1;
691
+ status: "VPROGS_INSPECT_SURFACE_READY";
692
+ claims: VprogsClaims;
693
+ errors: string[];
694
+ }
695
+ interface VprogsStatusResult {
696
+ ok: boolean;
697
+ schema: typeof HardkasSchemas.VProgsStatusV1;
698
+ status: "VPROGS_INSPECT_SURFACE_READY";
699
+ claims: VprogsClaims;
700
+ }
701
+ interface VprogsInspectResult {
702
+ ok: boolean;
703
+ schema: typeof HardkasSchemas.VProgsInspectV1;
704
+ status: "VPROGS_ARTIFACT_INSPECTED" | "VPROGS_ARTIFACT_INVALID";
705
+ path: string;
706
+ artifactHash?: string;
707
+ artifactSchema?: string;
708
+ claims: VprogsClaims;
709
+ issues: Array<{
710
+ code: string;
711
+ message: string;
712
+ file?: string;
713
+ }>;
714
+ }
715
+ declare class HardkasVprogs {
716
+ private sdk;
717
+ constructor(sdk: Hardkas);
718
+ capabilities(): Promise<VprogsCapabilitiesResult>;
719
+ status(): Promise<VprogsStatusResult>;
720
+ inspect(targetPath: string): Promise<VprogsInspectResult>;
721
+ }
722
+ declare function createVprogsCapabilities(): VprogsCapabilitiesResult;
723
+ declare function createVprogsStatus(): VprogsStatusResult;
724
+ declare function inspectVprogsArtifact(targetPath: string, workspaceRoot?: string): Promise<VprogsInspectResult>;
725
+
726
+ type ProgrammabilityKind = "silver" | "zk" | "vprog" | "full-lab";
727
+ interface ProgrammabilityClaims {
728
+ artifactCoherence: "READY_MATCH";
729
+ silverScriptBuilder: "SILVERSCRIPT_BUILDER_READY";
730
+ zkCorpusSurface: "ZK_CORPUS_SURFACE_READY";
731
+ zkLocalVerification: "READY_GROTH16_FIXTURE_COHERENCE";
732
+ risc0InspectSurface: "RISC0_INSPECT_SURFACE_READY";
733
+ vProgsInspectSurface: "VPROGS_INSPECT_SURFACE_READY";
734
+ runtimeOutcome: "PARTIAL";
735
+ vmConsensusEquivalence: "NOT_CLAIMED";
736
+ zkOnchainVerification: "NOT_CLAIMED";
737
+ vProgsRuntime: "NOT_CLAIMED";
738
+ vProgsStableApi: "NOT_CLAIMED";
739
+ mainnet: "BLOCKED_BY_POLICY";
740
+ }
741
+ interface ProgrammabilityIssue {
742
+ code: string;
743
+ message: string;
744
+ file?: string;
745
+ }
746
+ interface ProgrammabilityCapabilitiesResult {
747
+ ok: boolean;
748
+ schema: typeof HardkasSchemas.ProgrammabilityCapabilitiesV1;
749
+ status: "PROGRAMMABILITY_SURFACE_READY";
750
+ surfaces: {
751
+ silverScript: "SILVERSCRIPT_BUILDER_READY";
752
+ zkCorpus: "ZK_CORPUS_SURFACE_READY";
753
+ groth16FixtureCoherence: "READY_GROTH16_FIXTURE_COHERENCE";
754
+ risc0Inspect: "RISC0_INSPECT_SURFACE_READY";
755
+ vProgsInspect: "VPROGS_INSPECT_SURFACE_READY";
756
+ };
757
+ claims: ProgrammabilityClaims;
758
+ nonClaims: string[];
759
+ }
760
+ interface ProgrammabilityInspectResult {
761
+ ok: boolean;
762
+ schema: typeof HardkasSchemas.ProgrammabilityInspectV1;
763
+ status: "PROGRAMMABILITY_ARTIFACT_INSPECTED" | "PROGRAMMABILITY_ARTIFACT_INVALID";
764
+ kind: Exclude<ProgrammabilityKind, "full-lab">;
765
+ path: string;
766
+ artifactSchema?: string;
767
+ contentHash?: string;
768
+ sourceStatus?: string;
769
+ claims: ProgrammabilityClaims;
770
+ issues: ProgrammabilityIssue[];
771
+ }
772
+ interface ProgrammabilityVerifyResult {
773
+ ok: boolean;
774
+ schema: typeof HardkasSchemas.ProgrammabilityVerifyV1;
775
+ status: "PROGRAMMABILITY_VERIFY_PASS" | "PROGRAMMABILITY_VERIFY_FAIL" | "PROGRAMMABILITY_VERIFY_PARTIAL";
776
+ kind: Exclude<ProgrammabilityKind, "full-lab">;
777
+ path: string;
778
+ sourceStatus?: string;
779
+ claims: ProgrammabilityClaims;
780
+ issues: ProgrammabilityIssue[];
781
+ }
782
+ interface ProgrammabilityCorpusReport {
783
+ ok: boolean;
784
+ schema: typeof HardkasSchemas.ProgrammabilityCorpusReportV1;
785
+ path: string;
786
+ status: "PROGRAMMABILITY_CORPUS_PASS" | "PROGRAMMABILITY_CORPUS_FAIL";
787
+ summary: {
788
+ silver: "PASS" | "FAIL" | "SKIPPED";
789
+ zk: "PASS" | "FAIL" | "SKIPPED";
790
+ vprogs: "PASS" | "FAIL" | "SKIPPED";
791
+ rootManifest: "PASS" | "FAIL";
792
+ knownLimitations: string[];
793
+ };
794
+ claims: ProgrammabilityClaims;
795
+ issues: ProgrammabilityIssue[];
796
+ }
797
+ interface ProgrammabilityAppPlan {
798
+ ok: boolean;
799
+ schema: typeof HardkasSchemas.ProgrammabilityAppPlanV1;
800
+ status: "PROGRAMMABILITY_APP_PLAN_READY";
801
+ kind: ProgrammabilityKind;
802
+ template: string;
803
+ commands: string[];
804
+ sdkSurfaces: string[];
805
+ claims: ProgrammabilityClaims;
806
+ nonClaims: string[];
807
+ }
808
+ declare class HardkasProgrammability {
809
+ private sdk;
810
+ readonly corpus: {
811
+ verify: (options?: {
812
+ path?: string;
813
+ include?: Array<"silver" | "zk" | "vprogs">;
814
+ }) => Promise<ProgrammabilityCorpusReport>;
815
+ };
816
+ readonly app: {
817
+ plan: (options?: {
818
+ kind?: ProgrammabilityKind;
819
+ template?: string;
820
+ }) => ProgrammabilityAppPlan;
821
+ };
822
+ constructor(sdk: Hardkas);
823
+ capabilities(): Promise<ProgrammabilityCapabilitiesResult>;
824
+ inspect(options: {
825
+ kind: Exclude<ProgrammabilityKind, "full-lab">;
826
+ path: string;
827
+ }): Promise<ProgrammabilityInspectResult>;
828
+ verify(options: {
829
+ kind: Exclude<ProgrammabilityKind, "full-lab">;
830
+ path: string;
831
+ }): Promise<ProgrammabilityVerifyResult>;
832
+ private verifyCorpus;
833
+ private planApp;
834
+ }
835
+ declare function createProgrammabilityCapabilities(): ProgrammabilityCapabilitiesResult;
836
+ declare function programmabilityClaims(): ProgrammabilityClaims;
837
+
360
838
  interface TaskArgs {
361
839
  [key: string]: string | boolean | undefined;
362
840
  }
@@ -413,6 +891,12 @@ declare class Hardkas {
413
891
  readonly replay: HardkasReplay;
414
892
  readonly lineage: HardkasLineage;
415
893
  readonly workflow: HardkasWorkflow;
894
+ readonly capabilitiesApi: HardkasCapabilitiesApi;
895
+ readonly corpus: HardkasCorpus;
896
+ readonly silver: HardkasSilver;
897
+ readonly zk: HardkasZk;
898
+ readonly vprogs: HardkasVprogs;
899
+ readonly programmability: HardkasProgrammability;
416
900
  readonly signer?: ExternalHardkasSigner | undefined;
417
901
  readonly mode: "developer" | "agent";
418
902
  readonly policy: Required<NonNullable<HardkasOptions["policy"]>>;
@@ -433,6 +917,7 @@ declare class Hardkas {
433
917
  get network(): NetworkId;
434
918
  get sdkConfig(): _hardkas_config.HardkasConfig;
435
919
  get cwd(): string;
920
+ capabilities(): Promise<HardkasCapabilities>;
436
921
  /**
437
922
  * Validates an action against the active security policy.
438
923
  * Throws HardkasError if the policy is violated.
@@ -440,4 +925,4 @@ declare class Hardkas {
440
925
  enforcePolicy(action: "network" | "mainnet" | "external-wallet" | "mutation", context?: string): void;
441
926
  }
442
927
 
443
- export { Hardkas, HardkasAccounts, HardkasArtifactsManager, HardkasL2, HardkasLineage, HardkasLocalnet, type HardkasOptions, HardkasQuery, HardkasReplay, HardkasTx, HardkasWorkspace, type TaskArgs, type TaskContext, defineTask };
928
+ export { type CorpusIssue, type CorpusVerifyResult, Hardkas, HardkasAccounts, HardkasArtifactsManager, type HardkasCapabilities, HardkasCapabilitiesApi, HardkasCorpus, HardkasL2, HardkasLineage, HardkasLocalnet, type HardkasOptions, HardkasProgrammability, HardkasQuery, HardkasReplay, HardkasSilver, HardkasTx, HardkasVprogs, HardkasWorkspace, HardkasZk, type ProgrammabilityAppPlan, type ProgrammabilityCapabilitiesResult, type ProgrammabilityClaims, type ProgrammabilityCorpusReport, type ProgrammabilityInspectResult, type ProgrammabilityKind, type ProgrammabilityVerifyResult, type SilverCompareMode, type SilverCompareOptions, type SilverCompareReport, type SilverCompileOptions, type SilverDeployPlanOptions, type SilverSdkArtifactResult, type SilverSdkWriteOptions, type SilverSpendPlanOptions, type TaskArgs, type TaskContext, type VprogsCapabilitiesResult, type VprogsClaims, type VprogsInspectResult, type VprogsStatusResult, type ZkCapabilities, type ZkCorpusVerifyResult, type ZkIssue, type ZkProofInspectResult, type ZkProofSystem, type ZkProofVerifyResult, createHardkasCapabilities, createProgrammabilityCapabilities, createVprogsCapabilities, createVprogsStatus, createZkCapabilities, defineTask, inspectVprogsArtifact, inspectZkProof, programmabilityClaims, verifyToccataCorpus, verifyZkCorpus, verifyZkProofLocal };