chainlesschain 0.81.0 → 0.143.0
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/bin/chainlesschain.js +0 -0
- package/package.json +1 -1
- package/src/commands/a2a.js +62 -0
- package/src/commands/activitypub.js +61 -0
- package/src/commands/agent-network.js +254 -1
- package/src/commands/agent.js +117 -0
- package/src/commands/audit.js +302 -0
- package/src/commands/automation.js +271 -1
- package/src/commands/bi.js +61 -0
- package/src/commands/bm25.js +78 -0
- package/src/commands/browse.js +64 -0
- package/src/commands/ccron.js +78 -0
- package/src/commands/codegen.js +224 -0
- package/src/commands/collab.js +341 -0
- package/src/commands/compliance.js +1075 -0
- package/src/commands/compt.js +78 -0
- package/src/commands/consol.js +231 -0
- package/src/commands/cowork.js +263 -0
- package/src/commands/crosschain.js +62 -0
- package/src/commands/dao.js +62 -0
- package/src/commands/dbevo.js +284 -0
- package/src/commands/dev.js +252 -0
- package/src/commands/did.js +358 -0
- package/src/commands/dlp.js +61 -0
- package/src/commands/economy.js +56 -0
- package/src/commands/encrypt.js +341 -0
- package/src/commands/evolution.js +56 -0
- package/src/commands/evomap.js +61 -0
- package/src/commands/export.js +256 -1
- package/src/commands/fflag.js +178 -0
- package/src/commands/fusion.js +258 -0
- package/src/commands/git.js +45 -0
- package/src/commands/governance.js +325 -0
- package/src/commands/hardening.js +411 -0
- package/src/commands/hmemory.js +56 -0
- package/src/commands/hook.js +148 -0
- package/src/commands/import.js +252 -0
- package/src/commands/incentive.js +322 -0
- package/src/commands/inference.js +42 -0
- package/src/commands/infra.js +244 -0
- package/src/commands/instinct.js +260 -0
- package/src/commands/ipfs.js +318 -0
- package/src/commands/itbudget.js +45 -0
- package/src/commands/kg.js +387 -0
- package/src/commands/llm.js +263 -0
- package/src/commands/lowcode.js +44 -0
- package/src/commands/matrix.js +62 -0
- package/src/commands/mcp.js +221 -0
- package/src/commands/mcpscaf.js +41 -0
- package/src/commands/meminj.js +41 -0
- package/src/commands/memory.js +248 -0
- package/src/commands/multimodal.js +296 -0
- package/src/commands/nlprog.js +356 -0
- package/src/commands/nostr.js +62 -0
- package/src/commands/note.js +244 -0
- package/src/commands/ops.js +354 -0
- package/src/commands/orchestrate.js +166 -0
- package/src/commands/orchgov.js +45 -0
- package/src/commands/org.js +277 -0
- package/src/commands/p2p.js +390 -0
- package/src/commands/pdfp.js +78 -0
- package/src/commands/perception.js +290 -0
- package/src/commands/perf.js +39 -0
- package/src/commands/perm.js +45 -0
- package/src/commands/permmem.js +251 -0
- package/src/commands/pipeline.js +57 -1
- package/src/commands/planmode.js +45 -0
- package/src/commands/plugin-ecosystem.js +273 -0
- package/src/commands/pqc.js +393 -0
- package/src/commands/promcomp.js +82 -0
- package/src/commands/quantization.js +351 -0
- package/src/commands/rcache.js +271 -0
- package/src/commands/recommend.js +382 -0
- package/src/commands/runtime.js +307 -0
- package/src/commands/scim.js +262 -0
- package/src/commands/seshhook.js +41 -0
- package/src/commands/seshsearch.js +41 -0
- package/src/commands/seshtail.js +41 -0
- package/src/commands/seshu.js +41 -0
- package/src/commands/session.js +258 -0
- package/src/commands/sganal.js +78 -0
- package/src/commands/siem.js +40 -0
- package/src/commands/skill.js +267 -1
- package/src/commands/slotfill.js +41 -0
- package/src/commands/social.js +290 -0
- package/src/commands/sso.js +186 -1
- package/src/commands/svccont.js +45 -0
- package/src/commands/sync.js +256 -0
- package/src/commands/tech.js +338 -0
- package/src/commands/tenant.js +351 -0
- package/src/commands/tms.js +45 -0
- package/src/commands/tokens.js +269 -0
- package/src/commands/topiccls.js +45 -0
- package/src/commands/trust.js +249 -0
- package/src/commands/uprof.js +45 -0
- package/src/commands/vcheck.js +78 -0
- package/src/commands/wallet.js +277 -0
- package/src/commands/webfetch.js +41 -0
- package/src/commands/workflow.js +171 -0
- package/src/commands/zkp.js +62 -0
- package/src/harness/prompt-compressor.js +331 -0
- package/src/index.js +65 -1
- package/src/lib/a2a-protocol.js +105 -0
- package/src/lib/activitypub-bridge.js +105 -0
- package/src/lib/agent-coordinator.js +325 -0
- package/src/lib/agent-economy.js +105 -0
- package/src/lib/agent-network.js +387 -0
- package/src/lib/agent-router.js +395 -0
- package/src/lib/aiops.js +478 -0
- package/src/lib/app-builder.js +105 -0
- package/src/lib/audit-logger.js +379 -0
- package/src/lib/automation-engine.js +330 -0
- package/src/lib/autonomous-agent.js +105 -0
- package/src/lib/autonomous-developer.js +350 -0
- package/src/lib/bi-engine.js +105 -0
- package/src/lib/bm25-search.js +81 -0
- package/src/lib/browser-automation.js +105 -0
- package/src/lib/code-agent.js +323 -0
- package/src/lib/collaboration-governance.js +364 -0
- package/src/lib/community-governance.js +436 -0
- package/src/lib/compliance-framework-reporter.js +105 -0
- package/src/lib/compliance-manager.js +434 -0
- package/src/lib/compression-telemetry.js +81 -0
- package/src/lib/content-recommendation.js +469 -0
- package/src/lib/content-recommender.js +105 -0
- package/src/lib/cowork-cron.js +81 -0
- package/src/lib/cowork-task-runner.js +105 -0
- package/src/lib/cross-chain.js +105 -0
- package/src/lib/crypto-manager.js +350 -0
- package/src/lib/dao-governance.js +105 -0
- package/src/lib/dbevo.js +338 -0
- package/src/lib/decentral-infra.js +340 -0
- package/src/lib/did-manager.js +367 -0
- package/src/lib/dlp-engine.js +105 -0
- package/src/lib/evolution-system.js +105 -0
- package/src/lib/evomap-manager.js +105 -0
- package/src/lib/execution-backend.js +105 -0
- package/src/lib/feature-flags.js +85 -0
- package/src/lib/git-integration.js +105 -0
- package/src/lib/hardening-manager.js +348 -0
- package/src/lib/hierarchical-memory.js +105 -0
- package/src/lib/hook-manager.js +380 -0
- package/src/lib/inference-network.js +105 -0
- package/src/lib/instinct-manager.js +332 -0
- package/src/lib/ipfs-storage.js +334 -0
- package/src/lib/iteration-budget.js +105 -0
- package/src/lib/knowledge-exporter.js +381 -0
- package/src/lib/knowledge-graph.js +432 -0
- package/src/lib/knowledge-importer.js +379 -0
- package/src/lib/llm-providers.js +391 -0
- package/src/lib/matrix-bridge.js +105 -0
- package/src/lib/mcp-registry.js +333 -0
- package/src/lib/mcp-scaffold.js +81 -0
- package/src/lib/memory-injection.js +81 -0
- package/src/lib/memory-manager.js +330 -0
- package/src/lib/multimodal.js +346 -0
- package/src/lib/nl-programming.js +343 -0
- package/src/lib/nostr-bridge.js +105 -0
- package/src/lib/note-versioning.js +327 -0
- package/src/lib/orchestrator.js +105 -0
- package/src/lib/org-manager.js +323 -0
- package/src/lib/p2p-manager.js +387 -0
- package/src/lib/pdf-parser.js +81 -0
- package/src/lib/perception.js +346 -0
- package/src/lib/perf-tuning.js +109 -1
- package/src/lib/permanent-memory.js +320 -0
- package/src/lib/permission-engine.js +81 -0
- package/src/lib/pipeline-orchestrator.js +105 -0
- package/src/lib/plan-mode.js +81 -0
- package/src/lib/plugin-ecosystem.js +377 -0
- package/src/lib/pqc-manager.js +368 -0
- package/src/lib/prompt-compressor.js +1 -10
- package/src/lib/protocol-fusion.js +417 -0
- package/src/lib/quantization.js +325 -0
- package/src/lib/response-cache.js +327 -0
- package/src/lib/scim-manager.js +329 -0
- package/src/lib/service-container.js +81 -0
- package/src/lib/session-consolidator.js +105 -0
- package/src/lib/session-hooks.js +81 -0
- package/src/lib/session-manager.js +329 -0
- package/src/lib/session-search.js +81 -0
- package/src/lib/session-tail.js +81 -0
- package/src/lib/session-usage.js +83 -0
- package/src/lib/siem-exporter.js +105 -0
- package/src/lib/skill-loader.js +377 -0
- package/src/lib/slot-filler.js +81 -0
- package/src/lib/social-graph-analytics.js +81 -0
- package/src/lib/social-graph.js +81 -0
- package/src/lib/social-manager.js +326 -0
- package/src/lib/sso-manager.js +332 -0
- package/src/lib/sub-agent-registry.js +110 -0
- package/src/lib/sync-manager.js +326 -0
- package/src/lib/task-model-selector.js +81 -0
- package/src/lib/tech-learning-engine.js +369 -0
- package/src/lib/tenant-saas.js +460 -0
- package/src/lib/threat-intel.js +335 -0
- package/src/lib/todo-manager.js +105 -0
- package/src/lib/token-incentive.js +293 -0
- package/src/lib/token-tracker.js +329 -0
- package/src/lib/topic-classifier.js +105 -0
- package/src/lib/trust-security.js +390 -0
- package/src/lib/ueba.js +389 -0
- package/src/lib/universal-runtime.js +325 -0
- package/src/lib/user-profile.js +81 -0
- package/src/lib/version-checker.js +81 -0
- package/src/lib/wallet-manager.js +326 -0
- package/src/lib/web-fetch.js +81 -0
- package/src/lib/workflow-engine.js +322 -0
- package/src/lib/zkp-engine.js +105 -0
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Version Checker V2 governance commands — `cc vcheck ...`
|
|
3
|
+
* 在内存中治理 VCHK profile (pending/active/stale/archived) + check 生命周期。
|
|
4
|
+
*/
|
|
5
|
+
import {
|
|
6
|
+
VCHK_PROFILE_MATURITY_V2,
|
|
7
|
+
VCHK_CHECK_LIFECYCLE_V2,
|
|
8
|
+
registerVchkProfileV2,
|
|
9
|
+
activateVchkProfileV2,
|
|
10
|
+
staleVchkProfileV2,
|
|
11
|
+
archiveVchkProfileV2,
|
|
12
|
+
touchVchkProfileV2,
|
|
13
|
+
getVchkProfileV2,
|
|
14
|
+
listVchkProfilesV2,
|
|
15
|
+
createVchkCheckV2,
|
|
16
|
+
checkingVchkCheckV2,
|
|
17
|
+
completeVchkCheckV2,
|
|
18
|
+
failVchkCheckV2,
|
|
19
|
+
cancelVchkCheckV2,
|
|
20
|
+
getVchkCheckV2,
|
|
21
|
+
listVchkChecksV2,
|
|
22
|
+
setMaxActiveVchkProfilesPerOwnerV2,
|
|
23
|
+
getMaxActiveVchkProfilesPerOwnerV2,
|
|
24
|
+
setMaxPendingVchkChecksPerProfileV2,
|
|
25
|
+
getMaxPendingVchkChecksPerProfileV2,
|
|
26
|
+
setVchkProfileIdleMsV2,
|
|
27
|
+
getVchkProfileIdleMsV2,
|
|
28
|
+
setVchkCheckStuckMsV2,
|
|
29
|
+
getVchkCheckStuckMsV2,
|
|
30
|
+
autoStaleIdleVchkProfilesV2,
|
|
31
|
+
autoFailStuckVchkChecksV2,
|
|
32
|
+
getVersionCheckerGovStatsV2,
|
|
33
|
+
} from "../lib/version-checker.js";
|
|
34
|
+
|
|
35
|
+
export function registerVcheckCommand(program) {
|
|
36
|
+
const v = program
|
|
37
|
+
.command("vcheck")
|
|
38
|
+
.description("Version Checker V2 governance (in-memory, CLI v0.143.0)");
|
|
39
|
+
|
|
40
|
+
v.command("enums-v2").action(() => console.log(JSON.stringify({ VCHK_PROFILE_MATURITY_V2, VCHK_CHECK_LIFECYCLE_V2 }, null, 2)));
|
|
41
|
+
v.command("register-profile-v2")
|
|
42
|
+
.requiredOption("--id <id>")
|
|
43
|
+
.requiredOption("--owner <owner>")
|
|
44
|
+
.option("--channel <channel>", "release channel", "stable")
|
|
45
|
+
.action((o) => console.log(JSON.stringify(registerVchkProfileV2(o), null, 2)));
|
|
46
|
+
v.command("activate-profile-v2 <id>").action((id) => console.log(JSON.stringify(activateVchkProfileV2(id), null, 2)));
|
|
47
|
+
v.command("stale-profile-v2 <id>").action((id) => console.log(JSON.stringify(staleVchkProfileV2(id), null, 2)));
|
|
48
|
+
v.command("archive-profile-v2 <id>").action((id) => console.log(JSON.stringify(archiveVchkProfileV2(id), null, 2)));
|
|
49
|
+
v.command("touch-profile-v2 <id>").action((id) => console.log(JSON.stringify(touchVchkProfileV2(id), null, 2)));
|
|
50
|
+
v.command("get-profile-v2 <id>").action((id) => console.log(JSON.stringify(getVchkProfileV2(id), null, 2)));
|
|
51
|
+
v.command("list-profiles-v2").action(() => console.log(JSON.stringify(listVchkProfilesV2(), null, 2)));
|
|
52
|
+
|
|
53
|
+
v.command("create-check-v2")
|
|
54
|
+
.requiredOption("--id <id>")
|
|
55
|
+
.requiredOption("--profile-id <profileId>")
|
|
56
|
+
.option("--current-version <ver>", "current version", "")
|
|
57
|
+
.action((o) => console.log(JSON.stringify(createVchkCheckV2({ id: o.id, profileId: o.profileId, currentVersion: o.currentVersion }), null, 2)));
|
|
58
|
+
v.command("checking-check-v2 <id>").action((id) => console.log(JSON.stringify(checkingVchkCheckV2(id), null, 2)));
|
|
59
|
+
v.command("complete-check-v2 <id>").action((id) => console.log(JSON.stringify(completeVchkCheckV2(id), null, 2)));
|
|
60
|
+
v.command("fail-check-v2 <id>").option("--reason <r>").action((id, o) => console.log(JSON.stringify(failVchkCheckV2(id, o.reason), null, 2)));
|
|
61
|
+
v.command("cancel-check-v2 <id>").option("--reason <r>").action((id, o) => console.log(JSON.stringify(cancelVchkCheckV2(id, o.reason), null, 2)));
|
|
62
|
+
v.command("get-check-v2 <id>").action((id) => console.log(JSON.stringify(getVchkCheckV2(id), null, 2)));
|
|
63
|
+
v.command("list-checks-v2").action(() => console.log(JSON.stringify(listVchkChecksV2(), null, 2)));
|
|
64
|
+
|
|
65
|
+
v.command("config-v2").action(() => console.log(JSON.stringify({
|
|
66
|
+
maxActiveVchkProfilesPerOwner: getMaxActiveVchkProfilesPerOwnerV2(),
|
|
67
|
+
maxPendingVchkChecksPerProfile: getMaxPendingVchkChecksPerProfileV2(),
|
|
68
|
+
vchkProfileIdleMs: getVchkProfileIdleMsV2(),
|
|
69
|
+
vchkCheckStuckMs: getVchkCheckStuckMsV2(),
|
|
70
|
+
}, null, 2)));
|
|
71
|
+
v.command("set-max-active-profiles-v2 <n>").action((n) => { setMaxActiveVchkProfilesPerOwnerV2(Number(n)); console.log(JSON.stringify({ maxActiveVchkProfilesPerOwner: getMaxActiveVchkProfilesPerOwnerV2() }, null, 2)); });
|
|
72
|
+
v.command("set-max-pending-checks-v2 <n>").action((n) => { setMaxPendingVchkChecksPerProfileV2(Number(n)); console.log(JSON.stringify({ maxPendingVchkChecksPerProfile: getMaxPendingVchkChecksPerProfileV2() }, null, 2)); });
|
|
73
|
+
v.command("set-profile-idle-ms-v2 <ms>").action((ms) => { setVchkProfileIdleMsV2(Number(ms)); console.log(JSON.stringify({ vchkProfileIdleMs: getVchkProfileIdleMsV2() }, null, 2)); });
|
|
74
|
+
v.command("set-check-stuck-ms-v2 <ms>").action((ms) => { setVchkCheckStuckMsV2(Number(ms)); console.log(JSON.stringify({ vchkCheckStuckMs: getVchkCheckStuckMsV2() }, null, 2)); });
|
|
75
|
+
v.command("auto-stale-idle-v2").action(() => console.log(JSON.stringify(autoStaleIdleVchkProfilesV2(), null, 2)));
|
|
76
|
+
v.command("auto-fail-stuck-v2").action(() => console.log(JSON.stringify(autoFailStuckVchkChecksV2(), null, 2)));
|
|
77
|
+
v.command("gov-stats-v2").action(() => console.log(JSON.stringify(getVersionCheckerGovStatsV2(), null, 2)));
|
|
78
|
+
}
|
package/src/commands/wallet.js
CHANGED
|
@@ -18,6 +18,37 @@ import {
|
|
|
18
18
|
transferAsset,
|
|
19
19
|
getTransactions,
|
|
20
20
|
getWalletSummary,
|
|
21
|
+
WALLET_MATURITY_V2,
|
|
22
|
+
TX_LIFECYCLE_V2,
|
|
23
|
+
getMaxActiveWalletsPerOwnerV2,
|
|
24
|
+
setMaxActiveWalletsPerOwnerV2,
|
|
25
|
+
getMaxPendingTxPerWalletV2,
|
|
26
|
+
setMaxPendingTxPerWalletV2,
|
|
27
|
+
getWalletIdleMsV2,
|
|
28
|
+
setWalletIdleMsV2,
|
|
29
|
+
getTxStuckMsV2,
|
|
30
|
+
setTxStuckMsV2,
|
|
31
|
+
getActiveWalletCountV2,
|
|
32
|
+
getPendingTxCountV2,
|
|
33
|
+
registerWalletV2,
|
|
34
|
+
getWalletV2,
|
|
35
|
+
listWalletsV2,
|
|
36
|
+
setWalletMaturityV2,
|
|
37
|
+
activateWalletV2,
|
|
38
|
+
freezeWalletV2,
|
|
39
|
+
retireWalletV2,
|
|
40
|
+
touchWalletV2,
|
|
41
|
+
createTxV2,
|
|
42
|
+
getTxV2,
|
|
43
|
+
listTxsV2,
|
|
44
|
+
setTxStatusV2,
|
|
45
|
+
submitTxV2,
|
|
46
|
+
confirmTxV2,
|
|
47
|
+
failTxV2,
|
|
48
|
+
rejectTxV2,
|
|
49
|
+
autoRetireIdleWalletsV2,
|
|
50
|
+
autoFailStuckTxV2,
|
|
51
|
+
getWalletManagerStatsV2,
|
|
21
52
|
} from "../lib/wallet-manager.js";
|
|
22
53
|
|
|
23
54
|
export function registerWalletCommand(program) {
|
|
@@ -413,4 +444,250 @@ export function registerWalletCommand(program) {
|
|
|
413
444
|
process.exit(1);
|
|
414
445
|
}
|
|
415
446
|
});
|
|
447
|
+
|
|
448
|
+
/* ═══ Wallet V2 — in-memory maturity + tx lifecycle ═══ */
|
|
449
|
+
|
|
450
|
+
wallet
|
|
451
|
+
.command("maturities-v2")
|
|
452
|
+
.description("List wallet maturity states (V2)")
|
|
453
|
+
.action(() => {
|
|
454
|
+
for (const v of Object.values(WALLET_MATURITY_V2)) console.log(` ${v}`);
|
|
455
|
+
});
|
|
456
|
+
|
|
457
|
+
wallet
|
|
458
|
+
.command("tx-lifecycles-v2")
|
|
459
|
+
.description("List tx lifecycle states (V2)")
|
|
460
|
+
.action(() => {
|
|
461
|
+
for (const v of Object.values(TX_LIFECYCLE_V2)) console.log(` ${v}`);
|
|
462
|
+
});
|
|
463
|
+
|
|
464
|
+
wallet
|
|
465
|
+
.command("stats-v2")
|
|
466
|
+
.description("Show V2 wallet/tx stats")
|
|
467
|
+
.action(() => {
|
|
468
|
+
console.log(JSON.stringify(getWalletManagerStatsV2(), null, 2));
|
|
469
|
+
});
|
|
470
|
+
|
|
471
|
+
wallet
|
|
472
|
+
.command("max-active-wallets-per-owner")
|
|
473
|
+
.argument("[n]", "New cap")
|
|
474
|
+
.description("Get/set max active wallets per owner (V2)")
|
|
475
|
+
.action((n) => {
|
|
476
|
+
if (n !== undefined) setMaxActiveWalletsPerOwnerV2(n);
|
|
477
|
+
console.log(getMaxActiveWalletsPerOwnerV2());
|
|
478
|
+
});
|
|
479
|
+
|
|
480
|
+
wallet
|
|
481
|
+
.command("max-pending-tx-per-wallet")
|
|
482
|
+
.argument("[n]", "New cap")
|
|
483
|
+
.description("Get/set max pending+submitted tx per wallet (V2)")
|
|
484
|
+
.action((n) => {
|
|
485
|
+
if (n !== undefined) setMaxPendingTxPerWalletV2(n);
|
|
486
|
+
console.log(getMaxPendingTxPerWalletV2());
|
|
487
|
+
});
|
|
488
|
+
|
|
489
|
+
wallet
|
|
490
|
+
.command("wallet-idle-ms")
|
|
491
|
+
.argument("[ms]", "New idle window")
|
|
492
|
+
.description("Get/set wallet idle window ms (V2)")
|
|
493
|
+
.action((ms) => {
|
|
494
|
+
if (ms !== undefined) setWalletIdleMsV2(ms);
|
|
495
|
+
console.log(getWalletIdleMsV2());
|
|
496
|
+
});
|
|
497
|
+
|
|
498
|
+
wallet
|
|
499
|
+
.command("tx-stuck-ms")
|
|
500
|
+
.argument("[ms]", "New stuck window")
|
|
501
|
+
.description("Get/set tx stuck window ms (V2)")
|
|
502
|
+
.action((ms) => {
|
|
503
|
+
if (ms !== undefined) setTxStuckMsV2(ms);
|
|
504
|
+
console.log(getTxStuckMsV2());
|
|
505
|
+
});
|
|
506
|
+
|
|
507
|
+
wallet
|
|
508
|
+
.command("active-wallet-count-v2 <owner>")
|
|
509
|
+
.description("Count active wallets for owner (V2)")
|
|
510
|
+
.action((owner) => {
|
|
511
|
+
console.log(getActiveWalletCountV2(owner));
|
|
512
|
+
});
|
|
513
|
+
|
|
514
|
+
wallet
|
|
515
|
+
.command("pending-tx-count-v2 <walletId>")
|
|
516
|
+
.description("Count pending+submitted tx for wallet (V2)")
|
|
517
|
+
.action((walletId) => {
|
|
518
|
+
console.log(getPendingTxCountV2(walletId));
|
|
519
|
+
});
|
|
520
|
+
|
|
521
|
+
wallet
|
|
522
|
+
.command("register-wallet-v2 <id>")
|
|
523
|
+
.requiredOption("-o, --owner <owner>", "Owner")
|
|
524
|
+
.requiredOption("-a, --address <address>", "Wallet address")
|
|
525
|
+
.description("Register a new provisional wallet (V2)")
|
|
526
|
+
.action((id, opts) => {
|
|
527
|
+
console.log(
|
|
528
|
+
JSON.stringify(
|
|
529
|
+
registerWalletV2(id, { owner: opts.owner, address: opts.address }),
|
|
530
|
+
null,
|
|
531
|
+
2,
|
|
532
|
+
),
|
|
533
|
+
);
|
|
534
|
+
});
|
|
535
|
+
|
|
536
|
+
wallet
|
|
537
|
+
.command("wallet-v2 <id>")
|
|
538
|
+
.description("Show wallet by id (V2)")
|
|
539
|
+
.action((id) => {
|
|
540
|
+
const w = getWalletV2(id);
|
|
541
|
+
if (!w) {
|
|
542
|
+
console.error(`wallet ${id} not found`);
|
|
543
|
+
process.exit(1);
|
|
544
|
+
}
|
|
545
|
+
console.log(JSON.stringify(w, null, 2));
|
|
546
|
+
});
|
|
547
|
+
|
|
548
|
+
wallet
|
|
549
|
+
.command("list-wallets-v2")
|
|
550
|
+
.option("-o, --owner <owner>", "Filter by owner")
|
|
551
|
+
.option("-m, --maturity <m>", "Filter by maturity")
|
|
552
|
+
.description("List wallets (V2)")
|
|
553
|
+
.action((opts) => {
|
|
554
|
+
console.log(
|
|
555
|
+
JSON.stringify(
|
|
556
|
+
listWalletsV2({ owner: opts.owner, maturity: opts.maturity }),
|
|
557
|
+
null,
|
|
558
|
+
2,
|
|
559
|
+
),
|
|
560
|
+
);
|
|
561
|
+
});
|
|
562
|
+
|
|
563
|
+
wallet
|
|
564
|
+
.command("set-wallet-maturity-v2 <id> <next>")
|
|
565
|
+
.description("Transition wallet maturity (V2)")
|
|
566
|
+
.action((id, next) => {
|
|
567
|
+
console.log(JSON.stringify(setWalletMaturityV2(id, next), null, 2));
|
|
568
|
+
});
|
|
569
|
+
|
|
570
|
+
wallet
|
|
571
|
+
.command("activate-wallet-v2 <id>")
|
|
572
|
+
.description("Activate wallet (V2)")
|
|
573
|
+
.action((id) => {
|
|
574
|
+
console.log(JSON.stringify(activateWalletV2(id), null, 2));
|
|
575
|
+
});
|
|
576
|
+
|
|
577
|
+
wallet
|
|
578
|
+
.command("freeze-wallet-v2 <id>")
|
|
579
|
+
.description("Freeze wallet (V2)")
|
|
580
|
+
.action((id) => {
|
|
581
|
+
console.log(JSON.stringify(freezeWalletV2(id), null, 2));
|
|
582
|
+
});
|
|
583
|
+
|
|
584
|
+
wallet
|
|
585
|
+
.command("retire-wallet-v2 <id>")
|
|
586
|
+
.description("Retire wallet terminally (V2)")
|
|
587
|
+
.action((id) => {
|
|
588
|
+
console.log(JSON.stringify(retireWalletV2(id), null, 2));
|
|
589
|
+
});
|
|
590
|
+
|
|
591
|
+
wallet
|
|
592
|
+
.command("touch-wallet-v2 <id>")
|
|
593
|
+
.description("Update wallet lastSeenAt (V2)")
|
|
594
|
+
.action((id) => {
|
|
595
|
+
console.log(JSON.stringify(touchWalletV2(id), null, 2));
|
|
596
|
+
});
|
|
597
|
+
|
|
598
|
+
wallet
|
|
599
|
+
.command("create-tx-v2 <id>")
|
|
600
|
+
.requiredOption("-w, --wallet <walletId>", "Wallet id")
|
|
601
|
+
.requiredOption("-k, --kind <kind>", "Tx kind")
|
|
602
|
+
.option("-a, --amount <n>", "Amount")
|
|
603
|
+
.description("Create a pending tx (V2)")
|
|
604
|
+
.action((id, opts) => {
|
|
605
|
+
console.log(
|
|
606
|
+
JSON.stringify(
|
|
607
|
+
createTxV2(id, {
|
|
608
|
+
walletId: opts.wallet,
|
|
609
|
+
kind: opts.kind,
|
|
610
|
+
amount: opts.amount,
|
|
611
|
+
}),
|
|
612
|
+
null,
|
|
613
|
+
2,
|
|
614
|
+
),
|
|
615
|
+
);
|
|
616
|
+
});
|
|
617
|
+
|
|
618
|
+
wallet
|
|
619
|
+
.command("tx-v2 <id>")
|
|
620
|
+
.description("Show tx by id (V2)")
|
|
621
|
+
.action((id) => {
|
|
622
|
+
const t = getTxV2(id);
|
|
623
|
+
if (!t) {
|
|
624
|
+
console.error(`tx ${id} not found`);
|
|
625
|
+
process.exit(1);
|
|
626
|
+
}
|
|
627
|
+
console.log(JSON.stringify(t, null, 2));
|
|
628
|
+
});
|
|
629
|
+
|
|
630
|
+
wallet
|
|
631
|
+
.command("list-txs-v2")
|
|
632
|
+
.option("-w, --wallet <walletId>", "Filter by walletId")
|
|
633
|
+
.option("-s, --status <s>", "Filter by status")
|
|
634
|
+
.description("List txs (V2)")
|
|
635
|
+
.action((opts) => {
|
|
636
|
+
console.log(
|
|
637
|
+
JSON.stringify(
|
|
638
|
+
listTxsV2({ walletId: opts.wallet, status: opts.status }),
|
|
639
|
+
null,
|
|
640
|
+
2,
|
|
641
|
+
),
|
|
642
|
+
);
|
|
643
|
+
});
|
|
644
|
+
|
|
645
|
+
wallet
|
|
646
|
+
.command("set-tx-status-v2 <id> <next>")
|
|
647
|
+
.description("Transition tx status (V2)")
|
|
648
|
+
.action((id, next) => {
|
|
649
|
+
console.log(JSON.stringify(setTxStatusV2(id, next), null, 2));
|
|
650
|
+
});
|
|
651
|
+
|
|
652
|
+
wallet
|
|
653
|
+
.command("submit-tx-v2 <id>")
|
|
654
|
+
.description("Submit tx (V2)")
|
|
655
|
+
.action((id) => {
|
|
656
|
+
console.log(JSON.stringify(submitTxV2(id), null, 2));
|
|
657
|
+
});
|
|
658
|
+
|
|
659
|
+
wallet
|
|
660
|
+
.command("confirm-tx-v2 <id>")
|
|
661
|
+
.description("Confirm tx terminally (V2)")
|
|
662
|
+
.action((id) => {
|
|
663
|
+
console.log(JSON.stringify(confirmTxV2(id), null, 2));
|
|
664
|
+
});
|
|
665
|
+
|
|
666
|
+
wallet
|
|
667
|
+
.command("fail-tx-v2 <id>")
|
|
668
|
+
.description("Fail tx terminally (V2)")
|
|
669
|
+
.action((id) => {
|
|
670
|
+
console.log(JSON.stringify(failTxV2(id), null, 2));
|
|
671
|
+
});
|
|
672
|
+
|
|
673
|
+
wallet
|
|
674
|
+
.command("reject-tx-v2 <id>")
|
|
675
|
+
.description("Reject tx terminally (V2)")
|
|
676
|
+
.action((id) => {
|
|
677
|
+
console.log(JSON.stringify(rejectTxV2(id), null, 2));
|
|
678
|
+
});
|
|
679
|
+
|
|
680
|
+
wallet
|
|
681
|
+
.command("auto-retire-idle-wallets")
|
|
682
|
+
.description("Auto-retire non-provisional wallets idle past window (V2)")
|
|
683
|
+
.action(() => {
|
|
684
|
+
console.log(JSON.stringify(autoRetireIdleWalletsV2(), null, 2));
|
|
685
|
+
});
|
|
686
|
+
|
|
687
|
+
wallet
|
|
688
|
+
.command("auto-fail-stuck-tx")
|
|
689
|
+
.description("Auto-fail submitted tx stuck past window (V2)")
|
|
690
|
+
.action(() => {
|
|
691
|
+
console.log(JSON.stringify(autoFailStuckTxV2(), null, 2));
|
|
692
|
+
});
|
|
416
693
|
}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `cc webfetch` — Web Fetch V2 governance overlay (in-memory, atop lib/web-fetch.js).
|
|
3
|
+
*/
|
|
4
|
+
import {
|
|
5
|
+
WFET_TARGET_MATURITY_V2, WFET_JOB_LIFECYCLE_V2,
|
|
6
|
+
setMaxActiveWfetTargetsPerOwnerV2, getMaxActiveWfetTargetsPerOwnerV2,
|
|
7
|
+
setMaxPendingWfetJobsPerTargetV2, getMaxPendingWfetJobsPerTargetV2,
|
|
8
|
+
setWfetTargetIdleMsV2, getWfetTargetIdleMsV2,
|
|
9
|
+
setWfetJobStuckMsV2, getWfetJobStuckMsV2,
|
|
10
|
+
registerWfetTargetV2, activateWfetTargetV2, degradeWfetTargetV2, retireWfetTargetV2, touchWfetTargetV2, getWfetTargetV2, listWfetTargetsV2,
|
|
11
|
+
createWfetJobV2, fetchingWfetJobV2, succeedWfetJobV2, failWfetJobV2, cancelWfetJobV2, getWfetJobV2, listWfetJobsV2,
|
|
12
|
+
autoDegradeIdleWfetTargetsV2, autoFailStuckWfetJobsV2, getWebFetchGovStatsV2, _resetStateWebFetchV2,
|
|
13
|
+
} from "../lib/web-fetch.js";
|
|
14
|
+
|
|
15
|
+
export function registerWebfetchCommand(program) {
|
|
16
|
+
const wf = program.command("webfetch").description("Web Fetch V2 governance");
|
|
17
|
+
wf.command("enums-v2").action(() => console.log(JSON.stringify({ targetMaturity: WFET_TARGET_MATURITY_V2, jobLifecycle: WFET_JOB_LIFECYCLE_V2 }, null, 2)));
|
|
18
|
+
wf.command("config-v2").action(() => console.log(JSON.stringify({ maxActiveWfetTargetsPerOwner: getMaxActiveWfetTargetsPerOwnerV2(), maxPendingWfetJobsPerTarget: getMaxPendingWfetJobsPerTargetV2(), wfetTargetIdleMs: getWfetTargetIdleMsV2(), wfetJobStuckMs: getWfetJobStuckMsV2() }, null, 2)));
|
|
19
|
+
wf.command("set-max-active-v2 <n>").action((n) => { setMaxActiveWfetTargetsPerOwnerV2(Number(n)); console.log("ok"); });
|
|
20
|
+
wf.command("set-max-pending-v2 <n>").action((n) => { setMaxPendingWfetJobsPerTargetV2(Number(n)); console.log("ok"); });
|
|
21
|
+
wf.command("set-idle-ms-v2 <n>").action((n) => { setWfetTargetIdleMsV2(Number(n)); console.log("ok"); });
|
|
22
|
+
wf.command("set-stuck-ms-v2 <n>").action((n) => { setWfetJobStuckMsV2(Number(n)); console.log("ok"); });
|
|
23
|
+
wf.command("register-target-v2 <id> <owner>").option("--baseUrl <u>", "baseUrl").action((id, owner, o) => console.log(JSON.stringify(registerWfetTargetV2({ id, owner, baseUrl: o.baseUrl }), null, 2)));
|
|
24
|
+
wf.command("activate-target-v2 <id>").action((id) => console.log(JSON.stringify(activateWfetTargetV2(id), null, 2)));
|
|
25
|
+
wf.command("degrade-target-v2 <id>").action((id) => console.log(JSON.stringify(degradeWfetTargetV2(id), null, 2)));
|
|
26
|
+
wf.command("retire-target-v2 <id>").action((id) => console.log(JSON.stringify(retireWfetTargetV2(id), null, 2)));
|
|
27
|
+
wf.command("touch-target-v2 <id>").action((id) => console.log(JSON.stringify(touchWfetTargetV2(id), null, 2)));
|
|
28
|
+
wf.command("get-target-v2 <id>").action((id) => console.log(JSON.stringify(getWfetTargetV2(id), null, 2)));
|
|
29
|
+
wf.command("list-targets-v2").action(() => console.log(JSON.stringify(listWfetTargetsV2(), null, 2)));
|
|
30
|
+
wf.command("create-job-v2 <id> <targetId>").option("--kind <k>", "kind", "GET").action((id, targetId, o) => console.log(JSON.stringify(createWfetJobV2({ id, targetId, kind: o.kind }), null, 2)));
|
|
31
|
+
wf.command("fetching-job-v2 <id>").action((id) => console.log(JSON.stringify(fetchingWfetJobV2(id), null, 2)));
|
|
32
|
+
wf.command("succeed-job-v2 <id>").action((id) => console.log(JSON.stringify(succeedWfetJobV2(id), null, 2)));
|
|
33
|
+
wf.command("fail-job-v2 <id> [reason]").action((id, reason) => console.log(JSON.stringify(failWfetJobV2(id, reason), null, 2)));
|
|
34
|
+
wf.command("cancel-job-v2 <id> [reason]").action((id, reason) => console.log(JSON.stringify(cancelWfetJobV2(id, reason), null, 2)));
|
|
35
|
+
wf.command("get-job-v2 <id>").action((id) => console.log(JSON.stringify(getWfetJobV2(id), null, 2)));
|
|
36
|
+
wf.command("list-jobs-v2").action(() => console.log(JSON.stringify(listWfetJobsV2(), null, 2)));
|
|
37
|
+
wf.command("auto-degrade-idle-v2").action(() => console.log(JSON.stringify(autoDegradeIdleWfetTargetsV2(), null, 2)));
|
|
38
|
+
wf.command("auto-fail-stuck-v2").action(() => console.log(JSON.stringify(autoFailStuckWfetJobsV2(), null, 2)));
|
|
39
|
+
wf.command("gov-stats-v2").action(() => console.log(JSON.stringify(getWebFetchGovStatsV2(), null, 2)));
|
|
40
|
+
wf.command("reset-state-v2").action(() => { _resetStateWebFetchV2(); console.log(JSON.stringify({ ok: true }, null, 2)); });
|
|
41
|
+
}
|
package/src/commands/workflow.js
CHANGED
|
@@ -28,6 +28,33 @@ import {
|
|
|
28
28
|
removeBreakpoint,
|
|
29
29
|
exportWorkflow,
|
|
30
30
|
importWorkflow,
|
|
31
|
+
WORKFLOW_MATURITY_V2 as WMV2,
|
|
32
|
+
RUN_LIFECYCLE_V2 as RLV2,
|
|
33
|
+
registerWorkflowV2,
|
|
34
|
+
activateWorkflowV2,
|
|
35
|
+
pauseWorkflowV2,
|
|
36
|
+
retireWorkflowV2,
|
|
37
|
+
touchWorkflowV2,
|
|
38
|
+
getWorkflowV2,
|
|
39
|
+
listWorkflowsV2,
|
|
40
|
+
createRunV2,
|
|
41
|
+
startRunV2,
|
|
42
|
+
completeRunV2,
|
|
43
|
+
failRunV2,
|
|
44
|
+
cancelRunV2,
|
|
45
|
+
getRunV2,
|
|
46
|
+
listRunsV2,
|
|
47
|
+
autoPauseIdleWorkflowsV2,
|
|
48
|
+
autoFailStuckRunsV2,
|
|
49
|
+
getWorkflowEngineStatsV2,
|
|
50
|
+
setMaxActiveWorkflowsPerOwnerV2,
|
|
51
|
+
setMaxPendingRunsPerWorkflowV2,
|
|
52
|
+
setWorkflowIdleMsV2,
|
|
53
|
+
setRunStuckMsV2,
|
|
54
|
+
getMaxActiveWorkflowsPerOwnerV2,
|
|
55
|
+
getMaxPendingRunsPerWorkflowV2,
|
|
56
|
+
getWorkflowIdleMsV2,
|
|
57
|
+
getRunStuckMsV2,
|
|
31
58
|
} from "../lib/workflow-engine.js";
|
|
32
59
|
import fs from "fs";
|
|
33
60
|
|
|
@@ -676,4 +703,148 @@ export function registerWorkflowCommand(program) {
|
|
|
676
703
|
process.exit(1);
|
|
677
704
|
}
|
|
678
705
|
});
|
|
706
|
+
|
|
707
|
+
// ===== V2 Commands (cli 0.130.0) =====
|
|
708
|
+
const _v2json = (o) => console.log(JSON.stringify(o, null, 2));
|
|
709
|
+
workflow
|
|
710
|
+
.command("workflow-maturities-v2")
|
|
711
|
+
.description("List V2 workflow maturity states")
|
|
712
|
+
.action(() => Object.values(WMV2).forEach((s) => console.log(s)));
|
|
713
|
+
workflow
|
|
714
|
+
.command("run-lifecycles-v2")
|
|
715
|
+
.description("List V2 run lifecycle states")
|
|
716
|
+
.action(() => Object.values(RLV2).forEach((s) => console.log(s)));
|
|
717
|
+
workflow
|
|
718
|
+
.command("stats-v2")
|
|
719
|
+
.description("V2 stats")
|
|
720
|
+
.action(() => _v2json(getWorkflowEngineStatsV2()));
|
|
721
|
+
workflow
|
|
722
|
+
.command("config-v2")
|
|
723
|
+
.description("V2 config")
|
|
724
|
+
.action(() => {
|
|
725
|
+
console.log(
|
|
726
|
+
`maxActiveWorkflowsPerOwner: ${getMaxActiveWorkflowsPerOwnerV2()}`,
|
|
727
|
+
);
|
|
728
|
+
console.log(
|
|
729
|
+
`maxPendingRunsPerWorkflow: ${getMaxPendingRunsPerWorkflowV2()}`,
|
|
730
|
+
);
|
|
731
|
+
console.log(`workflowIdleMs: ${getWorkflowIdleMsV2()}`);
|
|
732
|
+
console.log(`runStuckMs: ${getRunStuckMsV2()}`);
|
|
733
|
+
});
|
|
734
|
+
workflow
|
|
735
|
+
.command("set-max-active-workflows-v2 <n>")
|
|
736
|
+
.description("Set V2 active workflow cap")
|
|
737
|
+
.action((n) => {
|
|
738
|
+
setMaxActiveWorkflowsPerOwnerV2(Number(n));
|
|
739
|
+
console.log("ok");
|
|
740
|
+
});
|
|
741
|
+
workflow
|
|
742
|
+
.command("set-max-pending-runs-v2 <n>")
|
|
743
|
+
.description("Set V2 pending run cap")
|
|
744
|
+
.action((n) => {
|
|
745
|
+
setMaxPendingRunsPerWorkflowV2(Number(n));
|
|
746
|
+
console.log("ok");
|
|
747
|
+
});
|
|
748
|
+
workflow
|
|
749
|
+
.command("set-workflow-idle-ms-v2 <n>")
|
|
750
|
+
.description("Set V2 workflow idle ms")
|
|
751
|
+
.action((n) => {
|
|
752
|
+
setWorkflowIdleMsV2(Number(n));
|
|
753
|
+
console.log("ok");
|
|
754
|
+
});
|
|
755
|
+
workflow
|
|
756
|
+
.command("set-run-stuck-ms-v2 <n>")
|
|
757
|
+
.description("Set V2 run stuck ms")
|
|
758
|
+
.action((n) => {
|
|
759
|
+
setRunStuckMsV2(Number(n));
|
|
760
|
+
console.log("ok");
|
|
761
|
+
});
|
|
762
|
+
workflow
|
|
763
|
+
.command("register-workflow-v2 <id>")
|
|
764
|
+
.description("V2 register workflow")
|
|
765
|
+
.requiredOption("-o, --owner <o>")
|
|
766
|
+
.option("-n, --name <n>")
|
|
767
|
+
.action((id, opts) =>
|
|
768
|
+
_v2json(registerWorkflowV2({ id, owner: opts.owner, name: opts.name })),
|
|
769
|
+
);
|
|
770
|
+
workflow
|
|
771
|
+
.command("activate-workflow-v2 <id>")
|
|
772
|
+
.description("V2 activate")
|
|
773
|
+
.action((id) => _v2json(activateWorkflowV2(id)));
|
|
774
|
+
workflow
|
|
775
|
+
.command("pause-workflow-v2 <id>")
|
|
776
|
+
.description("V2 pause")
|
|
777
|
+
.action((id) => _v2json(pauseWorkflowV2(id)));
|
|
778
|
+
workflow
|
|
779
|
+
.command("retire-workflow-v2 <id>")
|
|
780
|
+
.description("V2 retire")
|
|
781
|
+
.action((id) => _v2json(retireWorkflowV2(id)));
|
|
782
|
+
workflow
|
|
783
|
+
.command("touch-workflow-v2 <id>")
|
|
784
|
+
.description("V2 touch")
|
|
785
|
+
.action((id) => _v2json(touchWorkflowV2(id)));
|
|
786
|
+
workflow
|
|
787
|
+
.command("get-workflow-v2 <id>")
|
|
788
|
+
.description("V2 get")
|
|
789
|
+
.action((id) => _v2json(getWorkflowV2(id)));
|
|
790
|
+
workflow
|
|
791
|
+
.command("list-workflows-v2")
|
|
792
|
+
.description("V2 list")
|
|
793
|
+
.option("-o, --owner <o>")
|
|
794
|
+
.option("-s, --status <s>")
|
|
795
|
+
.action((opts) => _v2json(listWorkflowsV2(opts)));
|
|
796
|
+
workflow
|
|
797
|
+
.command("create-run-v2 <id>")
|
|
798
|
+
.description("V2 create run")
|
|
799
|
+
.requiredOption("-w, --workflow-id <w>")
|
|
800
|
+
.option("-t, --trigger <t>")
|
|
801
|
+
.action((id, opts) =>
|
|
802
|
+
_v2json(
|
|
803
|
+
createRunV2({ id, workflowId: opts.workflowId, trigger: opts.trigger }),
|
|
804
|
+
),
|
|
805
|
+
);
|
|
806
|
+
workflow
|
|
807
|
+
.command("start-run-v2 <id>")
|
|
808
|
+
.description("V2 start run")
|
|
809
|
+
.action((id) => _v2json(startRunV2(id)));
|
|
810
|
+
workflow
|
|
811
|
+
.command("complete-run-v2 <id>")
|
|
812
|
+
.description("V2 complete run")
|
|
813
|
+
.action((id) => _v2json(completeRunV2(id)));
|
|
814
|
+
workflow
|
|
815
|
+
.command("fail-run-v2 <id>")
|
|
816
|
+
.description("V2 fail run")
|
|
817
|
+
.option("-e, --error <e>")
|
|
818
|
+
.action((id, opts) => _v2json(failRunV2(id, opts.error)));
|
|
819
|
+
workflow
|
|
820
|
+
.command("cancel-run-v2 <id>")
|
|
821
|
+
.description("V2 cancel run")
|
|
822
|
+
.action((id) => _v2json(cancelRunV2(id)));
|
|
823
|
+
workflow
|
|
824
|
+
.command("get-run-v2 <id>")
|
|
825
|
+
.description("V2 get run")
|
|
826
|
+
.action((id) => _v2json(getRunV2(id)));
|
|
827
|
+
workflow
|
|
828
|
+
.command("list-runs-v2")
|
|
829
|
+
.description("V2 list runs")
|
|
830
|
+
.option("-w, --workflow-id <w>")
|
|
831
|
+
.option("-s, --status <s>")
|
|
832
|
+
.option("-t, --trigger <t>")
|
|
833
|
+
.action((opts) =>
|
|
834
|
+
_v2json(
|
|
835
|
+
listRunsV2({
|
|
836
|
+
workflowId: opts.workflowId,
|
|
837
|
+
status: opts.status,
|
|
838
|
+
trigger: opts.trigger,
|
|
839
|
+
}),
|
|
840
|
+
),
|
|
841
|
+
);
|
|
842
|
+
workflow
|
|
843
|
+
.command("auto-pause-idle-workflows-v2")
|
|
844
|
+
.description("V2 auto-pause idle")
|
|
845
|
+
.action(() => _v2json(autoPauseIdleWorkflowsV2()));
|
|
846
|
+
workflow
|
|
847
|
+
.command("auto-fail-stuck-runs-v2")
|
|
848
|
+
.description("V2 auto-fail stuck")
|
|
849
|
+
.action(() => _v2json(autoFailStuckRunsV2()));
|
|
679
850
|
}
|
package/src/commands/zkp.js
CHANGED
|
@@ -835,4 +835,66 @@ export function registerZkpCommand(program) {
|
|
|
835
835
|
process.exit(1);
|
|
836
836
|
}
|
|
837
837
|
});
|
|
838
|
+
registerZkpV2Command(zkp);
|
|
838
839
|
}
|
|
840
|
+
|
|
841
|
+
|
|
842
|
+
import {
|
|
843
|
+
ZKP_CIRCUIT_MATURITY_V2,
|
|
844
|
+
ZKP_PROOF_LIFECYCLE_V2,
|
|
845
|
+
registerZkpCircuitV2,
|
|
846
|
+
activateZkpCircuitV2,
|
|
847
|
+
deprecateZkpCircuitV2,
|
|
848
|
+
archiveZkpCircuitV2,
|
|
849
|
+
touchZkpCircuitV2,
|
|
850
|
+
getZkpCircuitV2,
|
|
851
|
+
listZkpCircuitsV2,
|
|
852
|
+
createZkpProofV2,
|
|
853
|
+
startZkpProofV2,
|
|
854
|
+
verifyZkpProofV2,
|
|
855
|
+
failZkpProofV2,
|
|
856
|
+
cancelZkpProofV2,
|
|
857
|
+
getZkpProofV2,
|
|
858
|
+
listZkpProofsV2,
|
|
859
|
+
setMaxActiveZkpCircuitsPerOwnerV2,
|
|
860
|
+
getMaxActiveZkpCircuitsPerOwnerV2,
|
|
861
|
+
setMaxPendingZkpProofsPerCircuitV2,
|
|
862
|
+
getMaxPendingZkpProofsPerCircuitV2,
|
|
863
|
+
setZkpCircuitIdleMsV2,
|
|
864
|
+
getZkpCircuitIdleMsV2,
|
|
865
|
+
setZkpProofStuckMsV2,
|
|
866
|
+
getZkpProofStuckMsV2,
|
|
867
|
+
autoDeprecateIdleZkpCircuitsV2,
|
|
868
|
+
autoFailStuckZkpProofsV2,
|
|
869
|
+
getZkpEngineGovStatsV2,
|
|
870
|
+
} from "../lib/zkp-engine.js";
|
|
871
|
+
|
|
872
|
+
export function registerZkpV2Command(zkp) {
|
|
873
|
+
zkp.command("enums-v2").description("Show V2 governance enums").action(() => { console.log(JSON.stringify({ ZKP_CIRCUIT_MATURITY_V2, ZKP_PROOF_LIFECYCLE_V2 }, null, 2)); });
|
|
874
|
+
zkp.command("register-circuit-v2").description("Register a zkp circuit profile (pending)")
|
|
875
|
+
.requiredOption("--id <id>").requiredOption("--owner <owner>").option("--scheme <scheme>")
|
|
876
|
+
.action((o) => { console.log(JSON.stringify(registerZkpCircuitV2({ id: o.id, owner: o.owner, scheme: o.scheme }), null, 2)); });
|
|
877
|
+
zkp.command("activate-circuit-v2 <id>").description("Activate circuit").action((id) => { console.log(JSON.stringify(activateZkpCircuitV2(id), null, 2)); });
|
|
878
|
+
zkp.command("deprecate-circuit-v2 <id>").description("Deprecate circuit").action((id) => { console.log(JSON.stringify(deprecateZkpCircuitV2(id), null, 2)); });
|
|
879
|
+
zkp.command("archive-circuit-v2 <id>").description("Archive circuit (terminal)").action((id) => { console.log(JSON.stringify(archiveZkpCircuitV2(id), null, 2)); });
|
|
880
|
+
zkp.command("touch-circuit-v2 <id>").description("Refresh lastTouchedAt").action((id) => { console.log(JSON.stringify(touchZkpCircuitV2(id), null, 2)); });
|
|
881
|
+
zkp.command("get-circuit-v2 <id>").description("Get circuit").action((id) => { console.log(JSON.stringify(getZkpCircuitV2(id), null, 2)); });
|
|
882
|
+
zkp.command("list-circuits-v2").description("List circuits").action(() => { console.log(JSON.stringify(listZkpCircuitsV2(), null, 2)); });
|
|
883
|
+
zkp.command("create-proof-v2").description("Create a zkp proof (queued)")
|
|
884
|
+
.requiredOption("--id <id>").requiredOption("--circuit-id <circuitId>").option("--inputs <inputs>")
|
|
885
|
+
.action((o) => { console.log(JSON.stringify(createZkpProofV2({ id: o.id, circuitId: o.circuitId, inputs: o.inputs }), null, 2)); });
|
|
886
|
+
zkp.command("start-proof-v2 <id>").description("Transition proof to proving").action((id) => { console.log(JSON.stringify(startZkpProofV2(id), null, 2)); });
|
|
887
|
+
zkp.command("verify-proof-v2 <id>").description("Transition proof to verified").action((id) => { console.log(JSON.stringify(verifyZkpProofV2(id), null, 2)); });
|
|
888
|
+
zkp.command("fail-proof-v2 <id>").description("Fail proof").option("--reason <r>").action((id, o) => { console.log(JSON.stringify(failZkpProofV2(id, o.reason), null, 2)); });
|
|
889
|
+
zkp.command("cancel-proof-v2 <id>").description("Cancel proof").option("--reason <r>").action((id, o) => { console.log(JSON.stringify(cancelZkpProofV2(id, o.reason), null, 2)); });
|
|
890
|
+
zkp.command("get-proof-v2 <id>").description("Get proof").action((id) => { console.log(JSON.stringify(getZkpProofV2(id), null, 2)); });
|
|
891
|
+
zkp.command("list-proofs-v2").description("List proofs").action(() => { console.log(JSON.stringify(listZkpProofsV2(), null, 2)); });
|
|
892
|
+
zkp.command("set-max-active-circuits-v2 <n>").description("Set per-owner active cap").action((n) => { setMaxActiveZkpCircuitsPerOwnerV2(Number(n)); console.log(JSON.stringify({ maxActiveZkpCircuitsPerOwner: getMaxActiveZkpCircuitsPerOwnerV2() }, null, 2)); });
|
|
893
|
+
zkp.command("set-max-pending-proofs-v2 <n>").description("Set per-circuit pending cap").action((n) => { setMaxPendingZkpProofsPerCircuitV2(Number(n)); console.log(JSON.stringify({ maxPendingZkpProofsPerCircuit: getMaxPendingZkpProofsPerCircuitV2() }, null, 2)); });
|
|
894
|
+
zkp.command("set-circuit-idle-ms-v2 <n>").description("Set idle threshold").action((n) => { setZkpCircuitIdleMsV2(Number(n)); console.log(JSON.stringify({ zkpCircuitIdleMs: getZkpCircuitIdleMsV2() }, null, 2)); });
|
|
895
|
+
zkp.command("set-proof-stuck-ms-v2 <n>").description("Set stuck threshold").action((n) => { setZkpProofStuckMsV2(Number(n)); console.log(JSON.stringify({ zkpProofStuckMs: getZkpProofStuckMsV2() }, null, 2)); });
|
|
896
|
+
zkp.command("auto-deprecate-idle-circuits-v2").description("Auto-deprecate idle circuits").action(() => { console.log(JSON.stringify(autoDeprecateIdleZkpCircuitsV2(), null, 2)); });
|
|
897
|
+
zkp.command("auto-fail-stuck-proofs-v2").description("Auto-fail stuck proving proofs").action(() => { console.log(JSON.stringify(autoFailStuckZkpProofsV2(), null, 2)); });
|
|
898
|
+
zkp.command("gov-stats-v2").description("V2 governance aggregate stats").action(() => { console.log(JSON.stringify(getZkpEngineGovStatsV2(), null, 2)); });
|
|
899
|
+
}
|
|
900
|
+
|