chainlesschain 0.51.0 → 0.81.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/package.json +1 -1
- package/src/assets/web-panel/.build-hash +1 -1
- package/src/assets/web-panel/assets/{AppLayout-Rvi759IS.js → AppLayout-6SPt_8Y_.js} +1 -1
- package/src/assets/web-panel/assets/{Dashboard-DBhFxXYQ.js → Dashboard-Br7kCwKJ.js} +2 -2
- package/src/assets/web-panel/assets/Dashboard-CKeMmCoT.css +1 -0
- package/src/assets/web-panel/assets/{index-uL0cZ8N_.js → index-tN-8TosE.js} +2 -2
- package/src/assets/web-panel/index.html +2 -2
- package/src/commands/a2a.js +380 -0
- package/src/commands/agent-network.js +785 -0
- package/src/commands/automation.js +654 -0
- package/src/commands/bi.js +348 -0
- package/src/commands/crosschain.js +218 -0
- package/src/commands/dao.js +565 -0
- package/src/commands/did-v2.js +620 -0
- package/src/commands/dlp.js +341 -0
- package/src/commands/economy.js +578 -0
- package/src/commands/evolution.js +391 -0
- package/src/commands/evomap.js +394 -0
- package/src/commands/federation.js +283 -0
- package/src/commands/hmemory.js +442 -0
- package/src/commands/inference.js +318 -0
- package/src/commands/lowcode.js +356 -0
- package/src/commands/marketplace.js +256 -0
- package/src/commands/perf.js +433 -0
- package/src/commands/pipeline.js +449 -0
- package/src/commands/plugin-ecosystem.js +517 -0
- package/src/commands/privacy.js +321 -0
- package/src/commands/reputation.js +261 -0
- package/src/commands/sandbox.js +401 -0
- package/src/commands/siem.js +246 -0
- package/src/commands/sla.js +259 -0
- package/src/commands/social.js +311 -0
- package/src/commands/sso.js +798 -0
- package/src/commands/stress.js +230 -0
- package/src/commands/terraform.js +245 -0
- package/src/commands/workflow.js +320 -0
- package/src/commands/zkp.js +562 -1
- package/src/index.js +21 -0
- package/src/lib/a2a-protocol.js +451 -0
- package/src/lib/agent-economy.js +479 -0
- package/src/lib/agent-network.js +1121 -0
- package/src/lib/app-builder.js +239 -0
- package/src/lib/automation-engine.js +948 -0
- package/src/lib/bi-engine.js +338 -0
- package/src/lib/cross-chain.js +345 -0
- package/src/lib/dao-governance.js +569 -0
- package/src/lib/did-v2-manager.js +1127 -0
- package/src/lib/dlp-engine.js +389 -0
- package/src/lib/evolution-system.js +453 -0
- package/src/lib/evomap-federation.js +177 -0
- package/src/lib/evomap-governance.js +276 -0
- package/src/lib/federation-hardening.js +259 -0
- package/src/lib/hierarchical-memory.js +481 -0
- package/src/lib/inference-network.js +330 -0
- package/src/lib/perf-tuning.js +734 -0
- package/src/lib/pipeline-orchestrator.js +928 -0
- package/src/lib/plugin-ecosystem.js +1109 -0
- package/src/lib/privacy-computing.js +427 -0
- package/src/lib/reputation-optimizer.js +299 -0
- package/src/lib/sandbox-v2.js +306 -0
- package/src/lib/siem-exporter.js +333 -0
- package/src/lib/skill-marketplace.js +325 -0
- package/src/lib/sla-manager.js +275 -0
- package/src/lib/social-graph-analytics.js +707 -0
- package/src/lib/sso-manager.js +841 -0
- package/src/lib/stress-tester.js +330 -0
- package/src/lib/terraform-manager.js +363 -0
- package/src/lib/workflow-engine.js +454 -1
- package/src/lib/zkp-engine.js +523 -20
- package/src/assets/web-panel/assets/Dashboard-BS-tzGNj.css +0 -1
package/src/commands/zkp.js
CHANGED
|
@@ -15,6 +15,33 @@ import {
|
|
|
15
15
|
getZKPStats,
|
|
16
16
|
listCircuits,
|
|
17
17
|
listProofs,
|
|
18
|
+
PROOF_SCHEME,
|
|
19
|
+
CIRCUIT_STATUS,
|
|
20
|
+
SUPPORTED_SCHEMES,
|
|
21
|
+
setCircuitStatus,
|
|
22
|
+
registerCredential,
|
|
23
|
+
selectiveDisclose,
|
|
24
|
+
listCredentials,
|
|
25
|
+
// V2 — Phase 88
|
|
26
|
+
PROOF_SCHEME_V2,
|
|
27
|
+
CIRCUIT_STATUS_V2,
|
|
28
|
+
PROOF_STATUS_V2,
|
|
29
|
+
ZKP_DEFAULT_MAX_CIRCUITS_PER_CREATOR,
|
|
30
|
+
ZKP_DEFAULT_PROOF_EXPIRY_MS,
|
|
31
|
+
setMaxCircuitsPerCreator,
|
|
32
|
+
getMaxCircuitsPerCreator,
|
|
33
|
+
getCircuitCountByCreator,
|
|
34
|
+
setProofExpiryMs,
|
|
35
|
+
getProofExpiryMs,
|
|
36
|
+
compileCircuitV2,
|
|
37
|
+
setCircuitStatusV2,
|
|
38
|
+
generateProofV2,
|
|
39
|
+
verifyProofV2,
|
|
40
|
+
failProof,
|
|
41
|
+
setProofStatus,
|
|
42
|
+
autoExpireProofs,
|
|
43
|
+
selectiveDiscloseV2,
|
|
44
|
+
getZKPStatsV2,
|
|
18
45
|
} from "../lib/zkp-engine.js";
|
|
19
46
|
|
|
20
47
|
export function registerZkpCommand(program) {
|
|
@@ -61,6 +88,7 @@ export function registerZkpCommand(program) {
|
|
|
61
88
|
.description("Generate a zero-knowledge proof")
|
|
62
89
|
.option("--private <json>", "Private inputs as JSON")
|
|
63
90
|
.option("--public <json>", "Public inputs as JSON")
|
|
91
|
+
.option("--scheme <scheme>", "Proof scheme (groth16|plonk|bulletproofs)")
|
|
64
92
|
.option("--json", "Output as JSON")
|
|
65
93
|
.action(async (circuitId, options) => {
|
|
66
94
|
try {
|
|
@@ -76,7 +104,14 @@ export function registerZkpCommand(program) {
|
|
|
76
104
|
? JSON.parse(options.private)
|
|
77
105
|
: {};
|
|
78
106
|
const publicInputs = options.public ? JSON.parse(options.public) : [];
|
|
79
|
-
const
|
|
107
|
+
const proveOpts = options.scheme ? { scheme: options.scheme } : {};
|
|
108
|
+
const proof = generateProof(
|
|
109
|
+
db,
|
|
110
|
+
circuitId,
|
|
111
|
+
privateInputs,
|
|
112
|
+
publicInputs,
|
|
113
|
+
proveOpts,
|
|
114
|
+
);
|
|
80
115
|
|
|
81
116
|
if (options.json) {
|
|
82
117
|
console.log(JSON.stringify(proof, null, 2));
|
|
@@ -188,6 +223,27 @@ export function registerZkpCommand(program) {
|
|
|
188
223
|
logger.log(
|
|
189
224
|
` ${chalk.bold("Verified:")} ${stats.verifiedProofs}`,
|
|
190
225
|
);
|
|
226
|
+
if (stats.credentials !== undefined) {
|
|
227
|
+
logger.log(
|
|
228
|
+
` ${chalk.bold("Credentials:")} ${stats.credentials}`,
|
|
229
|
+
);
|
|
230
|
+
}
|
|
231
|
+
if (stats.proofsByScheme) {
|
|
232
|
+
logger.log(` ${chalk.bold("By scheme:")}`);
|
|
233
|
+
for (const [scheme, count] of Object.entries(
|
|
234
|
+
stats.proofsByScheme,
|
|
235
|
+
)) {
|
|
236
|
+
logger.log(` ${scheme}: ${count}`);
|
|
237
|
+
}
|
|
238
|
+
}
|
|
239
|
+
if (stats.circuitsByStatus) {
|
|
240
|
+
logger.log(` ${chalk.bold("Circuit status:")}`);
|
|
241
|
+
for (const [status, count] of Object.entries(
|
|
242
|
+
stats.circuitsByStatus,
|
|
243
|
+
)) {
|
|
244
|
+
logger.log(` ${status}: ${count}`);
|
|
245
|
+
}
|
|
246
|
+
}
|
|
191
247
|
}
|
|
192
248
|
|
|
193
249
|
await shutdown();
|
|
@@ -274,4 +330,509 @@ export function registerZkpCommand(program) {
|
|
|
274
330
|
process.exit(1);
|
|
275
331
|
}
|
|
276
332
|
});
|
|
333
|
+
|
|
334
|
+
// zkp schemes
|
|
335
|
+
zkp
|
|
336
|
+
.command("schemes")
|
|
337
|
+
.description("List supported proof schemes and circuit statuses")
|
|
338
|
+
.option("--json", "Output as JSON")
|
|
339
|
+
.action((options) => {
|
|
340
|
+
try {
|
|
341
|
+
const payload = {
|
|
342
|
+
schemes: Array.from(SUPPORTED_SCHEMES),
|
|
343
|
+
proofSchemes: { ...PROOF_SCHEME },
|
|
344
|
+
circuitStatuses: { ...CIRCUIT_STATUS },
|
|
345
|
+
};
|
|
346
|
+
if (options.json) {
|
|
347
|
+
console.log(JSON.stringify(payload, null, 2));
|
|
348
|
+
} else {
|
|
349
|
+
logger.log(chalk.bold("Proof schemes:"));
|
|
350
|
+
for (const [key, val] of Object.entries(PROOF_SCHEME)) {
|
|
351
|
+
logger.log(` ${chalk.cyan(key)} → ${val}`);
|
|
352
|
+
}
|
|
353
|
+
logger.log(chalk.bold("Circuit statuses:"));
|
|
354
|
+
for (const [key, val] of Object.entries(CIRCUIT_STATUS)) {
|
|
355
|
+
logger.log(` ${chalk.cyan(key)} → ${val}`);
|
|
356
|
+
}
|
|
357
|
+
}
|
|
358
|
+
} catch (err) {
|
|
359
|
+
logger.error(`Failed: ${err.message}`);
|
|
360
|
+
process.exit(1);
|
|
361
|
+
}
|
|
362
|
+
});
|
|
363
|
+
|
|
364
|
+
// zkp set-status
|
|
365
|
+
zkp
|
|
366
|
+
.command("set-status <circuit-id> <status>")
|
|
367
|
+
.description("Update circuit status (draft|compiled|verified|failed)")
|
|
368
|
+
.action(async (circuitId, status) => {
|
|
369
|
+
try {
|
|
370
|
+
const ctx = await bootstrap({ verbose: program.opts().verbose });
|
|
371
|
+
if (!ctx.db) {
|
|
372
|
+
logger.error("Database not available");
|
|
373
|
+
process.exit(1);
|
|
374
|
+
}
|
|
375
|
+
const db = ctx.db.getDatabase();
|
|
376
|
+
ensureZKPTables(db);
|
|
377
|
+
|
|
378
|
+
const result = setCircuitStatus(db, circuitId, status);
|
|
379
|
+
logger.success(
|
|
380
|
+
`Circuit ${chalk.cyan(circuitId.slice(0, 8))} → ${chalk.bold(result.status)}`,
|
|
381
|
+
);
|
|
382
|
+
|
|
383
|
+
await shutdown();
|
|
384
|
+
} catch (err) {
|
|
385
|
+
logger.error(`Failed: ${err.message}`);
|
|
386
|
+
process.exit(1);
|
|
387
|
+
}
|
|
388
|
+
});
|
|
389
|
+
|
|
390
|
+
// zkp register-credential
|
|
391
|
+
zkp
|
|
392
|
+
.command("register-credential")
|
|
393
|
+
.description("Register a credential with selective-disclosure merkle root")
|
|
394
|
+
.option("--did <did>", "Subject DID")
|
|
395
|
+
.option("--claims <json>", "Credential claims as JSON")
|
|
396
|
+
.option("--json", "Output as JSON")
|
|
397
|
+
.action(async (options) => {
|
|
398
|
+
try {
|
|
399
|
+
const ctx = await bootstrap({ verbose: program.opts().verbose });
|
|
400
|
+
if (!ctx.db) {
|
|
401
|
+
logger.error("Database not available");
|
|
402
|
+
process.exit(1);
|
|
403
|
+
}
|
|
404
|
+
const db = ctx.db.getDatabase();
|
|
405
|
+
ensureZKPTables(db);
|
|
406
|
+
|
|
407
|
+
const claims = options.claims ? JSON.parse(options.claims) : {};
|
|
408
|
+
const cred = registerCredential(db, {
|
|
409
|
+
did: options.did,
|
|
410
|
+
claims,
|
|
411
|
+
});
|
|
412
|
+
|
|
413
|
+
if (options.json) {
|
|
414
|
+
console.log(JSON.stringify(cred, null, 2));
|
|
415
|
+
} else {
|
|
416
|
+
logger.success("Credential registered");
|
|
417
|
+
logger.log(` ${chalk.bold("ID:")} ${chalk.cyan(cred.id)}`);
|
|
418
|
+
logger.log(` ${chalk.bold("DID:")} ${cred.did || "-"}`);
|
|
419
|
+
logger.log(
|
|
420
|
+
` ${chalk.bold("MerkleRoot:")} ${cred.merkleRoot.slice(0, 16)}...`,
|
|
421
|
+
);
|
|
422
|
+
}
|
|
423
|
+
|
|
424
|
+
await shutdown();
|
|
425
|
+
} catch (err) {
|
|
426
|
+
logger.error(`Failed: ${err.message}`);
|
|
427
|
+
process.exit(1);
|
|
428
|
+
}
|
|
429
|
+
});
|
|
430
|
+
|
|
431
|
+
// zkp disclose
|
|
432
|
+
zkp
|
|
433
|
+
.command("disclose <credential-id> <fields>")
|
|
434
|
+
.description(
|
|
435
|
+
"Selectively disclose credential fields (comma-separated field list)",
|
|
436
|
+
)
|
|
437
|
+
.option("--to <did>", "Recipient DID")
|
|
438
|
+
.option("--json", "Output as JSON")
|
|
439
|
+
.action(async (credentialId, fields, options) => {
|
|
440
|
+
try {
|
|
441
|
+
const ctx = await bootstrap({ verbose: program.opts().verbose });
|
|
442
|
+
if (!ctx.db) {
|
|
443
|
+
logger.error("Database not available");
|
|
444
|
+
process.exit(1);
|
|
445
|
+
}
|
|
446
|
+
const db = ctx.db.getDatabase();
|
|
447
|
+
ensureZKPTables(db);
|
|
448
|
+
|
|
449
|
+
const disclosed = fields
|
|
450
|
+
.split(",")
|
|
451
|
+
.map((s) => s.trim())
|
|
452
|
+
.filter(Boolean);
|
|
453
|
+
const result = selectiveDisclose(
|
|
454
|
+
db,
|
|
455
|
+
credentialId,
|
|
456
|
+
disclosed,
|
|
457
|
+
options.to,
|
|
458
|
+
);
|
|
459
|
+
|
|
460
|
+
if (options.json) {
|
|
461
|
+
console.log(JSON.stringify(result, null, 2));
|
|
462
|
+
} else {
|
|
463
|
+
logger.success("Selective disclosure created");
|
|
464
|
+
logger.log(
|
|
465
|
+
` ${chalk.bold("ID:")} ${chalk.cyan(result.id)}`,
|
|
466
|
+
);
|
|
467
|
+
logger.log(` ${chalk.bold("Credential:")} ${result.credentialId}`);
|
|
468
|
+
logger.log(
|
|
469
|
+
` ${chalk.bold("Disclosed:")} ${JSON.stringify(result.disclosed)}`,
|
|
470
|
+
);
|
|
471
|
+
logger.log(
|
|
472
|
+
` ${chalk.bold("Hidden:")} ${result.hiddenCount} field(s)`,
|
|
473
|
+
);
|
|
474
|
+
logger.log(
|
|
475
|
+
` ${chalk.bold("MerkleRoot:")} ${result.merkleRoot.slice(0, 16)}...`,
|
|
476
|
+
);
|
|
477
|
+
}
|
|
478
|
+
|
|
479
|
+
await shutdown();
|
|
480
|
+
} catch (err) {
|
|
481
|
+
logger.error(`Failed: ${err.message}`);
|
|
482
|
+
process.exit(1);
|
|
483
|
+
}
|
|
484
|
+
});
|
|
485
|
+
|
|
486
|
+
// zkp credentials
|
|
487
|
+
zkp
|
|
488
|
+
.command("credentials")
|
|
489
|
+
.description("List registered credentials")
|
|
490
|
+
.option("--did <did>", "Filter by subject DID")
|
|
491
|
+
.option("--json", "Output as JSON")
|
|
492
|
+
.action(async (options) => {
|
|
493
|
+
try {
|
|
494
|
+
const ctx = await bootstrap({ verbose: program.opts().verbose });
|
|
495
|
+
if (!ctx.db) {
|
|
496
|
+
logger.error("Database not available");
|
|
497
|
+
process.exit(1);
|
|
498
|
+
}
|
|
499
|
+
const db = ctx.db.getDatabase();
|
|
500
|
+
ensureZKPTables(db);
|
|
501
|
+
|
|
502
|
+
const creds = listCredentials(db, { did: options.did });
|
|
503
|
+
if (options.json) {
|
|
504
|
+
console.log(JSON.stringify(creds, null, 2));
|
|
505
|
+
} else {
|
|
506
|
+
if (creds.length === 0) {
|
|
507
|
+
logger.log("No credentials registered");
|
|
508
|
+
} else {
|
|
509
|
+
for (const c of creds) {
|
|
510
|
+
logger.log(
|
|
511
|
+
` ${chalk.cyan(c.id.slice(0, 8))} ${c.did || "(no-did)"} — root ${c.merkleRoot.slice(0, 12)}...`,
|
|
512
|
+
);
|
|
513
|
+
}
|
|
514
|
+
}
|
|
515
|
+
}
|
|
516
|
+
|
|
517
|
+
await shutdown();
|
|
518
|
+
} catch (err) {
|
|
519
|
+
logger.error(`Failed: ${err.message}`);
|
|
520
|
+
process.exit(1);
|
|
521
|
+
}
|
|
522
|
+
});
|
|
523
|
+
|
|
524
|
+
/* ── V2 — Phase 88 ──────────────────────────────────────── */
|
|
525
|
+
|
|
526
|
+
// Enum dumps
|
|
527
|
+
zkp
|
|
528
|
+
.command("proof-schemes-v2")
|
|
529
|
+
.description("List V2 proof schemes")
|
|
530
|
+
.action(() => {
|
|
531
|
+
console.log(JSON.stringify(PROOF_SCHEME_V2, null, 2));
|
|
532
|
+
});
|
|
533
|
+
|
|
534
|
+
zkp
|
|
535
|
+
.command("circuit-statuses-v2")
|
|
536
|
+
.description("List V2 circuit statuses")
|
|
537
|
+
.action(() => {
|
|
538
|
+
console.log(JSON.stringify(CIRCUIT_STATUS_V2, null, 2));
|
|
539
|
+
});
|
|
540
|
+
|
|
541
|
+
zkp
|
|
542
|
+
.command("proof-statuses-v2")
|
|
543
|
+
.description("List V2 proof statuses (pending/verified/invalid/expired)")
|
|
544
|
+
.action(() => {
|
|
545
|
+
console.log(JSON.stringify(PROOF_STATUS_V2, null, 2));
|
|
546
|
+
});
|
|
547
|
+
|
|
548
|
+
zkp
|
|
549
|
+
.command("default-max-circuits-per-creator")
|
|
550
|
+
.description("Show default max circuits per creator")
|
|
551
|
+
.action(() => {
|
|
552
|
+
console.log(ZKP_DEFAULT_MAX_CIRCUITS_PER_CREATOR);
|
|
553
|
+
});
|
|
554
|
+
|
|
555
|
+
zkp
|
|
556
|
+
.command("max-circuits-per-creator")
|
|
557
|
+
.description("Show current max circuits per creator")
|
|
558
|
+
.action(() => {
|
|
559
|
+
console.log(getMaxCircuitsPerCreator());
|
|
560
|
+
});
|
|
561
|
+
|
|
562
|
+
zkp
|
|
563
|
+
.command("set-max-circuits-per-creator <n>")
|
|
564
|
+
.description("Set max circuits per creator (positive integer)")
|
|
565
|
+
.action((n) => {
|
|
566
|
+
try {
|
|
567
|
+
setMaxCircuitsPerCreator(Number(n));
|
|
568
|
+
logger.success(
|
|
569
|
+
`Max circuits per creator = ${getMaxCircuitsPerCreator()}`,
|
|
570
|
+
);
|
|
571
|
+
} catch (err) {
|
|
572
|
+
logger.error(`Failed: ${err.message}`);
|
|
573
|
+
process.exit(1);
|
|
574
|
+
}
|
|
575
|
+
});
|
|
576
|
+
|
|
577
|
+
zkp
|
|
578
|
+
.command("circuit-count-by-creator <creator>")
|
|
579
|
+
.description("Count circuits owned by a creator")
|
|
580
|
+
.action((creator) => {
|
|
581
|
+
console.log(getCircuitCountByCreator(creator));
|
|
582
|
+
});
|
|
583
|
+
|
|
584
|
+
zkp
|
|
585
|
+
.command("default-proof-expiry-ms")
|
|
586
|
+
.description("Show default proof expiry (ms)")
|
|
587
|
+
.action(() => {
|
|
588
|
+
console.log(ZKP_DEFAULT_PROOF_EXPIRY_MS);
|
|
589
|
+
});
|
|
590
|
+
|
|
591
|
+
zkp
|
|
592
|
+
.command("proof-expiry-ms")
|
|
593
|
+
.description("Show current proof expiry (ms)")
|
|
594
|
+
.action(() => {
|
|
595
|
+
console.log(getProofExpiryMs());
|
|
596
|
+
});
|
|
597
|
+
|
|
598
|
+
zkp
|
|
599
|
+
.command("set-proof-expiry-ms <ms>")
|
|
600
|
+
.description("Set proof expiry in ms")
|
|
601
|
+
.action((ms) => {
|
|
602
|
+
try {
|
|
603
|
+
setProofExpiryMs(Number(ms));
|
|
604
|
+
logger.success(`Proof expiry = ${getProofExpiryMs()}ms`);
|
|
605
|
+
} catch (err) {
|
|
606
|
+
logger.error(`Failed: ${err.message}`);
|
|
607
|
+
process.exit(1);
|
|
608
|
+
}
|
|
609
|
+
});
|
|
610
|
+
|
|
611
|
+
zkp
|
|
612
|
+
.command("compile-v2 <name>")
|
|
613
|
+
.description("Compile circuit (V2 — creator cap enforced)")
|
|
614
|
+
.option("-d, --definition <json>", "Circuit definition as JSON")
|
|
615
|
+
.option("-c, --creator <did>", "Creator DID")
|
|
616
|
+
.action(async (name, options) => {
|
|
617
|
+
try {
|
|
618
|
+
const ctx = await bootstrap({ verbose: program.opts().verbose });
|
|
619
|
+
if (!ctx.db) {
|
|
620
|
+
logger.error("Database not available");
|
|
621
|
+
process.exit(1);
|
|
622
|
+
}
|
|
623
|
+
const db = ctx.db.getDatabase();
|
|
624
|
+
ensureZKPTables(db);
|
|
625
|
+
const def = options.definition ? JSON.parse(options.definition) : {};
|
|
626
|
+
const circuit = compileCircuitV2(db, {
|
|
627
|
+
name,
|
|
628
|
+
definition: def,
|
|
629
|
+
creator: options.creator,
|
|
630
|
+
});
|
|
631
|
+
logger.success(`Circuit compiled (V2): ${chalk.cyan(name)}`);
|
|
632
|
+
logger.log(` ${chalk.bold("ID:")} ${chalk.cyan(circuit.id)}`);
|
|
633
|
+
if (circuit.creator) {
|
|
634
|
+
logger.log(` ${chalk.bold("Creator:")} ${circuit.creator}`);
|
|
635
|
+
}
|
|
636
|
+
await shutdown();
|
|
637
|
+
} catch (err) {
|
|
638
|
+
logger.error(`Failed: ${err.message}`);
|
|
639
|
+
process.exit(1);
|
|
640
|
+
}
|
|
641
|
+
});
|
|
642
|
+
|
|
643
|
+
zkp
|
|
644
|
+
.command("set-circuit-status-v2 <circuit-id> <status>")
|
|
645
|
+
.description("Set circuit status (state-machine guarded)")
|
|
646
|
+
.option("-e, --error-message <msg>", "Error message (for failed status)")
|
|
647
|
+
.action(async (circuitId, status, options) => {
|
|
648
|
+
try {
|
|
649
|
+
const ctx = await bootstrap({ verbose: program.opts().verbose });
|
|
650
|
+
const db = ctx.db.getDatabase();
|
|
651
|
+
ensureZKPTables(db);
|
|
652
|
+
const patch = {};
|
|
653
|
+
if (options.errorMessage !== undefined) {
|
|
654
|
+
patch.errorMessage = options.errorMessage;
|
|
655
|
+
}
|
|
656
|
+
const updated = setCircuitStatusV2(db, circuitId, status, patch);
|
|
657
|
+
logger.success(`Circuit ${circuitId} → ${updated.status}`);
|
|
658
|
+
await shutdown();
|
|
659
|
+
} catch (err) {
|
|
660
|
+
logger.error(`Failed: ${err.message}`);
|
|
661
|
+
process.exit(1);
|
|
662
|
+
}
|
|
663
|
+
});
|
|
664
|
+
|
|
665
|
+
zkp
|
|
666
|
+
.command("prove-v2 <circuit-id>")
|
|
667
|
+
.description("Generate proof (V2 — stamps pending + expiresAt)")
|
|
668
|
+
.option("--private <json>", "Private inputs JSON", "{}")
|
|
669
|
+
.option("--public <json>", "Public inputs JSON", "[]")
|
|
670
|
+
.option("-s, --scheme <scheme>", "Proof scheme")
|
|
671
|
+
.action(async (circuitId, options) => {
|
|
672
|
+
try {
|
|
673
|
+
const ctx = await bootstrap({ verbose: program.opts().verbose });
|
|
674
|
+
const db = ctx.db.getDatabase();
|
|
675
|
+
ensureZKPTables(db);
|
|
676
|
+
const proof = generateProofV2(db, {
|
|
677
|
+
circuitId,
|
|
678
|
+
privateInputs: JSON.parse(options.private),
|
|
679
|
+
publicInputs: JSON.parse(options.public),
|
|
680
|
+
scheme: options.scheme,
|
|
681
|
+
});
|
|
682
|
+
logger.success("Proof generated (V2)");
|
|
683
|
+
logger.log(` ${chalk.bold("ID:")} ${chalk.cyan(proof.id)}`);
|
|
684
|
+
logger.log(` ${chalk.bold("Status:")} ${proof.status}`);
|
|
685
|
+
logger.log(
|
|
686
|
+
` ${chalk.bold("ExpiresAt:")} ${new Date(proof.expiresAt).toISOString()}`,
|
|
687
|
+
);
|
|
688
|
+
await shutdown();
|
|
689
|
+
} catch (err) {
|
|
690
|
+
logger.error(`Failed: ${err.message}`);
|
|
691
|
+
process.exit(1);
|
|
692
|
+
}
|
|
693
|
+
});
|
|
694
|
+
|
|
695
|
+
zkp
|
|
696
|
+
.command("verify-v2 <proof-id>")
|
|
697
|
+
.description("Verify proof (V2 — auto-expire past deadline)")
|
|
698
|
+
.action(async (proofId) => {
|
|
699
|
+
try {
|
|
700
|
+
const ctx = await bootstrap({ verbose: program.opts().verbose });
|
|
701
|
+
const db = ctx.db.getDatabase();
|
|
702
|
+
ensureZKPTables(db);
|
|
703
|
+
const result = verifyProofV2(db, proofId);
|
|
704
|
+
if (result.valid) {
|
|
705
|
+
logger.success(`Proof ${proofId} VERIFIED`);
|
|
706
|
+
} else {
|
|
707
|
+
logger.error(
|
|
708
|
+
`Proof ${proofId} INVALID (reason: ${result.reason || result.status})`,
|
|
709
|
+
);
|
|
710
|
+
}
|
|
711
|
+
await shutdown();
|
|
712
|
+
} catch (err) {
|
|
713
|
+
logger.error(`Failed: ${err.message}`);
|
|
714
|
+
process.exit(1);
|
|
715
|
+
}
|
|
716
|
+
});
|
|
717
|
+
|
|
718
|
+
zkp
|
|
719
|
+
.command("fail-proof <proof-id>")
|
|
720
|
+
.description("Mark proof as invalid")
|
|
721
|
+
.option("-r, --reason <reason>", "Failure reason")
|
|
722
|
+
.action(async (proofId, options) => {
|
|
723
|
+
try {
|
|
724
|
+
const ctx = await bootstrap({ verbose: program.opts().verbose });
|
|
725
|
+
const db = ctx.db.getDatabase();
|
|
726
|
+
ensureZKPTables(db);
|
|
727
|
+
failProof(db, proofId, { reason: options.reason });
|
|
728
|
+
logger.success(`Proof ${proofId} → invalid`);
|
|
729
|
+
await shutdown();
|
|
730
|
+
} catch (err) {
|
|
731
|
+
logger.error(`Failed: ${err.message}`);
|
|
732
|
+
process.exit(1);
|
|
733
|
+
}
|
|
734
|
+
});
|
|
735
|
+
|
|
736
|
+
zkp
|
|
737
|
+
.command("set-proof-status <proof-id> <status>")
|
|
738
|
+
.description("Set proof status (state-machine guarded)")
|
|
739
|
+
.option("-e, --error-message <msg>", "Error message")
|
|
740
|
+
.action(async (proofId, status, options) => {
|
|
741
|
+
try {
|
|
742
|
+
const ctx = await bootstrap({ verbose: program.opts().verbose });
|
|
743
|
+
const db = ctx.db.getDatabase();
|
|
744
|
+
ensureZKPTables(db);
|
|
745
|
+
const patch = {};
|
|
746
|
+
if (options.errorMessage !== undefined) {
|
|
747
|
+
patch.errorMessage = options.errorMessage;
|
|
748
|
+
}
|
|
749
|
+
const updated = setProofStatus(db, proofId, status, patch);
|
|
750
|
+
logger.success(`Proof ${proofId} → ${updated.status}`);
|
|
751
|
+
await shutdown();
|
|
752
|
+
} catch (err) {
|
|
753
|
+
logger.error(`Failed: ${err.message}`);
|
|
754
|
+
process.exit(1);
|
|
755
|
+
}
|
|
756
|
+
});
|
|
757
|
+
|
|
758
|
+
zkp
|
|
759
|
+
.command("auto-expire-proofs")
|
|
760
|
+
.description("Bulk-expire proofs past their deadline")
|
|
761
|
+
.action(async () => {
|
|
762
|
+
try {
|
|
763
|
+
const ctx = await bootstrap({ verbose: program.opts().verbose });
|
|
764
|
+
const db = ctx.db.getDatabase();
|
|
765
|
+
ensureZKPTables(db);
|
|
766
|
+
const expired = autoExpireProofs(db);
|
|
767
|
+
logger.success(`Expired ${expired.length} proofs`);
|
|
768
|
+
await shutdown();
|
|
769
|
+
} catch (err) {
|
|
770
|
+
logger.error(`Failed: ${err.message}`);
|
|
771
|
+
process.exit(1);
|
|
772
|
+
}
|
|
773
|
+
});
|
|
774
|
+
|
|
775
|
+
zkp
|
|
776
|
+
.command("selective-disclose-v2 <credential-id>")
|
|
777
|
+
.description(
|
|
778
|
+
"Selectively disclose credential fields (requiredFields enforced)",
|
|
779
|
+
)
|
|
780
|
+
.option(
|
|
781
|
+
"-d, --disclosed <fields>",
|
|
782
|
+
"Comma-separated fields to disclose",
|
|
783
|
+
"",
|
|
784
|
+
)
|
|
785
|
+
.option(
|
|
786
|
+
"-r, --required <fields>",
|
|
787
|
+
"Comma-separated fields REQUIRED in disclosure",
|
|
788
|
+
"",
|
|
789
|
+
)
|
|
790
|
+
.option("--recipient <did>", "Recipient DID")
|
|
791
|
+
.action(async (credentialId, options) => {
|
|
792
|
+
try {
|
|
793
|
+
const ctx = await bootstrap({ verbose: program.opts().verbose });
|
|
794
|
+
const db = ctx.db.getDatabase();
|
|
795
|
+
ensureZKPTables(db);
|
|
796
|
+
const disclosedFields = options.disclosed
|
|
797
|
+
? options.disclosed
|
|
798
|
+
.split(",")
|
|
799
|
+
.map((s) => s.trim())
|
|
800
|
+
.filter(Boolean)
|
|
801
|
+
: [];
|
|
802
|
+
const requiredFields = options.required
|
|
803
|
+
? options.required
|
|
804
|
+
.split(",")
|
|
805
|
+
.map((s) => s.trim())
|
|
806
|
+
.filter(Boolean)
|
|
807
|
+
: undefined;
|
|
808
|
+
const result = selectiveDiscloseV2(db, {
|
|
809
|
+
credentialId,
|
|
810
|
+
disclosedFields,
|
|
811
|
+
requiredFields,
|
|
812
|
+
recipientDid: options.recipient,
|
|
813
|
+
});
|
|
814
|
+
console.log(JSON.stringify(result, null, 2));
|
|
815
|
+
await shutdown();
|
|
816
|
+
} catch (err) {
|
|
817
|
+
logger.error(`Failed: ${err.message}`);
|
|
818
|
+
process.exit(1);
|
|
819
|
+
}
|
|
820
|
+
});
|
|
821
|
+
|
|
822
|
+
zkp
|
|
823
|
+
.command("stats-v2")
|
|
824
|
+
.description("V2 stats (all-enum-key zero init)")
|
|
825
|
+
.action(async () => {
|
|
826
|
+
try {
|
|
827
|
+
const ctx = await bootstrap({ verbose: program.opts().verbose });
|
|
828
|
+
const db = ctx.db.getDatabase();
|
|
829
|
+
ensureZKPTables(db);
|
|
830
|
+
const stats = getZKPStatsV2();
|
|
831
|
+
console.log(JSON.stringify(stats, null, 2));
|
|
832
|
+
await shutdown();
|
|
833
|
+
} catch (err) {
|
|
834
|
+
logger.error(`Failed: ${err.message}`);
|
|
835
|
+
process.exit(1);
|
|
836
|
+
}
|
|
837
|
+
});
|
|
277
838
|
}
|
package/src/index.js
CHANGED
|
@@ -161,6 +161,20 @@ import { registerRuntimeCommand } from "./commands/runtime.js";
|
|
|
161
161
|
import { registerIpfsCommand } from "./commands/ipfs.js";
|
|
162
162
|
// Phase 27: Multimodal Collaboration
|
|
163
163
|
import { registerMultimodalCommand } from "./commands/multimodal.js";
|
|
164
|
+
// Phase 22: Performance auto-tuning
|
|
165
|
+
import { registerPerfCommand } from "./commands/perf.js";
|
|
166
|
+
// Phase 24: Decentralized Agent Network
|
|
167
|
+
import { registerAgentNetworkCommand } from "./commands/agent-network.js";
|
|
168
|
+
// Phase 55: DID v2.0 — W3C DID + Verifiable Presentations + social recovery
|
|
169
|
+
import { registerDIDv2Command } from "./commands/did-v2.js";
|
|
170
|
+
// Phase 26: Development Pipeline Orchestration (7-stage AI pipeline + gates)
|
|
171
|
+
import { registerPipelineCommand } from "./commands/pipeline.js";
|
|
172
|
+
// Phase 64: Plugin Ecosystem 2.0 (registry + deps + install + AI review + publish + revenue)
|
|
173
|
+
import { registerPluginEcosystemCommand } from "./commands/plugin-ecosystem.js";
|
|
174
|
+
// Phase 96: Workflow Automation Engine (12 SaaS connectors + 5 triggers + DAG execution)
|
|
175
|
+
import { registerAutomationCommand } from "./commands/automation.js";
|
|
176
|
+
// Phase 14: SSO Enterprise Authentication (SAML / OAuth2 / OIDC + session lifecycle + DID bridge)
|
|
177
|
+
import { registerSsoCommand } from "./commands/sso.js";
|
|
164
178
|
|
|
165
179
|
export function createProgram() {
|
|
166
180
|
const program = new Command();
|
|
@@ -342,6 +356,13 @@ export function createProgram() {
|
|
|
342
356
|
registerRuntimeCommand(program);
|
|
343
357
|
registerIpfsCommand(program);
|
|
344
358
|
registerMultimodalCommand(program);
|
|
359
|
+
registerPerfCommand(program);
|
|
360
|
+
registerAgentNetworkCommand(program);
|
|
361
|
+
registerDIDv2Command(program);
|
|
362
|
+
registerPipelineCommand(program);
|
|
363
|
+
registerPluginEcosystemCommand(program);
|
|
364
|
+
registerAutomationCommand(program);
|
|
365
|
+
registerSsoCommand(program);
|
|
345
366
|
|
|
346
367
|
return program;
|
|
347
368
|
}
|