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
package/src/commands/dao.js
CHANGED
|
@@ -874,4 +874,66 @@ export function registerDaoCommand(program) {
|
|
|
874
874
|
}
|
|
875
875
|
}
|
|
876
876
|
});
|
|
877
|
+
registerDaoV2Command(dao);
|
|
877
878
|
}
|
|
879
|
+
|
|
880
|
+
|
|
881
|
+
import {
|
|
882
|
+
DAO_ORG_MATURITY_V2,
|
|
883
|
+
DAO_PROPOSAL_LIFECYCLE_V2,
|
|
884
|
+
registerDaoOrgV2,
|
|
885
|
+
activateDaoOrgV2,
|
|
886
|
+
pauseDaoOrgV2,
|
|
887
|
+
dissolveDaoOrgV2,
|
|
888
|
+
touchDaoOrgV2,
|
|
889
|
+
getDaoOrgV2,
|
|
890
|
+
listDaoOrgsV2,
|
|
891
|
+
createDaoProposalV2,
|
|
892
|
+
startDaoProposalV2,
|
|
893
|
+
passDaoProposalV2,
|
|
894
|
+
failDaoProposalV2,
|
|
895
|
+
cancelDaoProposalV2,
|
|
896
|
+
getDaoProposalV2,
|
|
897
|
+
listDaoProposalsV2,
|
|
898
|
+
setMaxActiveDaoOrgsPerOwnerV2,
|
|
899
|
+
getMaxActiveDaoOrgsPerOwnerV2,
|
|
900
|
+
setMaxPendingDaoProposalsPerOrgV2,
|
|
901
|
+
getMaxPendingDaoProposalsPerOrgV2,
|
|
902
|
+
setDaoOrgIdleMsV2,
|
|
903
|
+
getDaoOrgIdleMsV2,
|
|
904
|
+
setDaoProposalStuckMsV2,
|
|
905
|
+
getDaoProposalStuckMsV2,
|
|
906
|
+
autoPauseIdleDaoOrgsV2,
|
|
907
|
+
autoFailStuckDaoProposalsV2,
|
|
908
|
+
getDaoGovernanceGovStatsV2,
|
|
909
|
+
} from "../lib/dao-governance.js";
|
|
910
|
+
|
|
911
|
+
export function registerDaoV2Command(dao) {
|
|
912
|
+
dao.command("enums-v2").description("Show V2 governance enums").action(() => { console.log(JSON.stringify({ DAO_ORG_MATURITY_V2, DAO_PROPOSAL_LIFECYCLE_V2 }, null, 2)); });
|
|
913
|
+
dao.command("register-org-v2").description("Register a dao org profile (pending)")
|
|
914
|
+
.requiredOption("--id <id>").requiredOption("--owner <owner>").option("--name <name>")
|
|
915
|
+
.action((o) => { console.log(JSON.stringify(registerDaoOrgV2({ id: o.id, owner: o.owner, name: o.name }), null, 2)); });
|
|
916
|
+
dao.command("activate-org-v2 <id>").description("Activate org").action((id) => { console.log(JSON.stringify(activateDaoOrgV2(id), null, 2)); });
|
|
917
|
+
dao.command("pause-org-v2 <id>").description("Pause org").action((id) => { console.log(JSON.stringify(pauseDaoOrgV2(id), null, 2)); });
|
|
918
|
+
dao.command("dissolve-org-v2 <id>").description("Dissolve org (terminal)").action((id) => { console.log(JSON.stringify(dissolveDaoOrgV2(id), null, 2)); });
|
|
919
|
+
dao.command("touch-org-v2 <id>").description("Refresh lastTouchedAt").action((id) => { console.log(JSON.stringify(touchDaoOrgV2(id), null, 2)); });
|
|
920
|
+
dao.command("get-org-v2 <id>").description("Get org").action((id) => { console.log(JSON.stringify(getDaoOrgV2(id), null, 2)); });
|
|
921
|
+
dao.command("list-orgs-v2").description("List orgs").action(() => { console.log(JSON.stringify(listDaoOrgsV2(), null, 2)); });
|
|
922
|
+
dao.command("create-proposal-v2").description("Create a dao proposal (queued)")
|
|
923
|
+
.requiredOption("--id <id>").requiredOption("--org-id <orgId>").option("--title <title>")
|
|
924
|
+
.action((o) => { console.log(JSON.stringify(createDaoProposalV2({ id: o.id, orgId: o.orgId, title: o.title }), null, 2)); });
|
|
925
|
+
dao.command("start-proposal-v2 <id>").description("Transition proposal to voting").action((id) => { console.log(JSON.stringify(startDaoProposalV2(id), null, 2)); });
|
|
926
|
+
dao.command("pass-proposal-v2 <id>").description("Transition proposal to passed").action((id) => { console.log(JSON.stringify(passDaoProposalV2(id), null, 2)); });
|
|
927
|
+
dao.command("fail-proposal-v2 <id>").description("Fail proposal").option("--reason <r>").action((id, o) => { console.log(JSON.stringify(failDaoProposalV2(id, o.reason), null, 2)); });
|
|
928
|
+
dao.command("cancel-proposal-v2 <id>").description("Cancel proposal").option("--reason <r>").action((id, o) => { console.log(JSON.stringify(cancelDaoProposalV2(id, o.reason), null, 2)); });
|
|
929
|
+
dao.command("get-proposal-v2 <id>").description("Get proposal").action((id) => { console.log(JSON.stringify(getDaoProposalV2(id), null, 2)); });
|
|
930
|
+
dao.command("list-proposals-v2").description("List proposals").action(() => { console.log(JSON.stringify(listDaoProposalsV2(), null, 2)); });
|
|
931
|
+
dao.command("set-max-active-orgs-v2 <n>").description("Set per-owner active cap").action((n) => { setMaxActiveDaoOrgsPerOwnerV2(Number(n)); console.log(JSON.stringify({ maxActiveDaoOrgsPerOwner: getMaxActiveDaoOrgsPerOwnerV2() }, null, 2)); });
|
|
932
|
+
dao.command("set-max-pending-proposals-v2 <n>").description("Set per-org pending cap").action((n) => { setMaxPendingDaoProposalsPerOrgV2(Number(n)); console.log(JSON.stringify({ maxPendingDaoProposalsPerOrg: getMaxPendingDaoProposalsPerOrgV2() }, null, 2)); });
|
|
933
|
+
dao.command("set-org-idle-ms-v2 <n>").description("Set idle threshold").action((n) => { setDaoOrgIdleMsV2(Number(n)); console.log(JSON.stringify({ daoOrgIdleMs: getDaoOrgIdleMsV2() }, null, 2)); });
|
|
934
|
+
dao.command("set-proposal-stuck-ms-v2 <n>").description("Set stuck threshold").action((n) => { setDaoProposalStuckMsV2(Number(n)); console.log(JSON.stringify({ daoProposalStuckMs: getDaoProposalStuckMsV2() }, null, 2)); });
|
|
935
|
+
dao.command("auto-pause-idle-orgs-v2").description("Auto-pause idle orgs").action(() => { console.log(JSON.stringify(autoPauseIdleDaoOrgsV2(), null, 2)); });
|
|
936
|
+
dao.command("auto-fail-stuck-proposals-v2").description("Auto-fail stuck voting proposals").action(() => { console.log(JSON.stringify(autoFailStuckDaoProposalsV2(), null, 2)); });
|
|
937
|
+
dao.command("gov-stats-v2").description("V2 governance aggregate stats").action(() => { console.log(JSON.stringify(getDaoGovernanceGovStatsV2(), null, 2)); });
|
|
938
|
+
}
|
|
939
|
+
|
package/src/commands/dbevo.js
CHANGED
|
@@ -27,8 +27,53 @@ import {
|
|
|
27
27
|
getSuggestion,
|
|
28
28
|
applySuggestion,
|
|
29
29
|
getDbEvoStats,
|
|
30
|
+
|
|
31
|
+
// Phase 80 V2
|
|
32
|
+
SCHEMA_BASELINE_V2,
|
|
33
|
+
MIGRATION_RUN_V2,
|
|
34
|
+
getDefaultMaxActiveBaselinesPerDbV2,
|
|
35
|
+
getMaxActiveBaselinesPerDbV2,
|
|
36
|
+
setMaxActiveBaselinesPerDbV2,
|
|
37
|
+
getDefaultMaxRunningMigrationsPerDbV2,
|
|
38
|
+
getMaxRunningMigrationsPerDbV2,
|
|
39
|
+
setMaxRunningMigrationsPerDbV2,
|
|
40
|
+
getDefaultBaselineIdleMsV2,
|
|
41
|
+
getBaselineIdleMsV2,
|
|
42
|
+
setBaselineIdleMsV2,
|
|
43
|
+
getDefaultMigrationStuckMsV2,
|
|
44
|
+
getMigrationStuckMsV2,
|
|
45
|
+
setMigrationStuckMsV2,
|
|
46
|
+
registerBaselineV2,
|
|
47
|
+
getBaselineV2,
|
|
48
|
+
setBaselineStatusV2,
|
|
49
|
+
validateBaseline,
|
|
50
|
+
activateBaseline,
|
|
51
|
+
deprecateBaseline,
|
|
52
|
+
retireBaseline,
|
|
53
|
+
touchBaselineActivity,
|
|
54
|
+
enqueueMigrationRunV2,
|
|
55
|
+
getMigrationRunV2,
|
|
56
|
+
setMigrationRunStatusV2,
|
|
57
|
+
startMigrationRun,
|
|
58
|
+
applyMigrationRun,
|
|
59
|
+
failMigrationRun,
|
|
60
|
+
rollbackMigrationRun,
|
|
61
|
+
getActiveBaselineCount,
|
|
62
|
+
getRunningMigrationCount,
|
|
63
|
+
autoRetireIdleBaselines,
|
|
64
|
+
autoFailStuckMigrationRuns,
|
|
65
|
+
getDbEvoStatsV2,
|
|
30
66
|
} from "../lib/dbevo.js";
|
|
31
67
|
|
|
68
|
+
function _parseMetaV2(raw) {
|
|
69
|
+
if (!raw) return undefined;
|
|
70
|
+
try {
|
|
71
|
+
return JSON.parse(raw);
|
|
72
|
+
} catch {
|
|
73
|
+
throw new Error("--metadata must be valid JSON");
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
|
|
32
77
|
function _dbFromCtx(cmd) {
|
|
33
78
|
const root = cmd?.parent?.parent ?? cmd?.parent;
|
|
34
79
|
return root?._db;
|
|
@@ -384,5 +429,244 @@ export function registerDbEvoCommand(program) {
|
|
|
384
429
|
);
|
|
385
430
|
});
|
|
386
431
|
|
|
432
|
+
/* ═══════════════════════════════════════════════════ *
|
|
433
|
+
* Phase 80 V2 — Schema Baseline + Migration Run
|
|
434
|
+
* ═══════════════════════════════════════════════════ */
|
|
435
|
+
|
|
436
|
+
dbevo
|
|
437
|
+
.command("schema-baselines-v2")
|
|
438
|
+
.description("List V2 baseline states")
|
|
439
|
+
.option("--json", "JSON output")
|
|
440
|
+
.action((opts) => {
|
|
441
|
+
const xs = Object.values(SCHEMA_BASELINE_V2);
|
|
442
|
+
if (opts.json) return console.log(JSON.stringify(xs, null, 2));
|
|
443
|
+
for (const x of xs) console.log(` ${x}`);
|
|
444
|
+
});
|
|
445
|
+
|
|
446
|
+
dbevo
|
|
447
|
+
.command("migration-runs-v2")
|
|
448
|
+
.description("List V2 migration-run states")
|
|
449
|
+
.option("--json", "JSON output")
|
|
450
|
+
.action((opts) => {
|
|
451
|
+
const xs = Object.values(MIGRATION_RUN_V2);
|
|
452
|
+
if (opts.json) return console.log(JSON.stringify(xs, null, 2));
|
|
453
|
+
for (const x of xs) console.log(` ${x}`);
|
|
454
|
+
});
|
|
455
|
+
|
|
456
|
+
dbevo
|
|
457
|
+
.command("default-max-active-baselines-per-db")
|
|
458
|
+
.description("Default active-baseline cap")
|
|
459
|
+
.action(() => console.log(getDefaultMaxActiveBaselinesPerDbV2()));
|
|
460
|
+
dbevo
|
|
461
|
+
.command("max-active-baselines-per-db")
|
|
462
|
+
.description("Current active-baseline cap")
|
|
463
|
+
.action(() => console.log(getMaxActiveBaselinesPerDbV2()));
|
|
464
|
+
dbevo
|
|
465
|
+
.command("set-max-active-baselines-per-db <n>")
|
|
466
|
+
.description("Set active-baseline cap")
|
|
467
|
+
.action((n) => console.log(setMaxActiveBaselinesPerDbV2(n)));
|
|
468
|
+
|
|
469
|
+
dbevo
|
|
470
|
+
.command("default-max-running-migrations-per-db")
|
|
471
|
+
.description("Default running-migration cap")
|
|
472
|
+
.action(() => console.log(getDefaultMaxRunningMigrationsPerDbV2()));
|
|
473
|
+
dbevo
|
|
474
|
+
.command("max-running-migrations-per-db")
|
|
475
|
+
.description("Current running-migration cap")
|
|
476
|
+
.action(() => console.log(getMaxRunningMigrationsPerDbV2()));
|
|
477
|
+
dbevo
|
|
478
|
+
.command("set-max-running-migrations-per-db <n>")
|
|
479
|
+
.description("Set running-migration cap")
|
|
480
|
+
.action((n) => console.log(setMaxRunningMigrationsPerDbV2(n)));
|
|
481
|
+
|
|
482
|
+
dbevo
|
|
483
|
+
.command("default-baseline-idle-ms")
|
|
484
|
+
.description("Default baseline idle ms")
|
|
485
|
+
.action(() => console.log(getDefaultBaselineIdleMsV2()));
|
|
486
|
+
dbevo
|
|
487
|
+
.command("baseline-idle-ms")
|
|
488
|
+
.description("Current baseline idle ms")
|
|
489
|
+
.action(() => console.log(getBaselineIdleMsV2()));
|
|
490
|
+
dbevo
|
|
491
|
+
.command("set-baseline-idle-ms <ms>")
|
|
492
|
+
.description("Set baseline idle ms")
|
|
493
|
+
.action((ms) => console.log(setBaselineIdleMsV2(ms)));
|
|
494
|
+
|
|
495
|
+
dbevo
|
|
496
|
+
.command("default-migration-stuck-ms")
|
|
497
|
+
.description("Default migration stuck ms")
|
|
498
|
+
.action(() => console.log(getDefaultMigrationStuckMsV2()));
|
|
499
|
+
dbevo
|
|
500
|
+
.command("migration-stuck-ms")
|
|
501
|
+
.description("Current migration stuck ms")
|
|
502
|
+
.action(() => console.log(getMigrationStuckMsV2()));
|
|
503
|
+
dbevo
|
|
504
|
+
.command("set-migration-stuck-ms <ms>")
|
|
505
|
+
.description("Set migration stuck ms")
|
|
506
|
+
.action((ms) => console.log(setMigrationStuckMsV2(ms)));
|
|
507
|
+
|
|
508
|
+
dbevo
|
|
509
|
+
.command("active-baseline-count")
|
|
510
|
+
.description("Count of ACTIVE baselines")
|
|
511
|
+
.option("-d, --database <id>", "filter by database")
|
|
512
|
+
.action((opts) => console.log(getActiveBaselineCount(opts.database)));
|
|
513
|
+
|
|
514
|
+
dbevo
|
|
515
|
+
.command("running-migration-count")
|
|
516
|
+
.description("Count of RUNNING migration runs")
|
|
517
|
+
.option("-d, --database <id>", "filter by database")
|
|
518
|
+
.action((opts) => console.log(getRunningMigrationCount(opts.database)));
|
|
519
|
+
|
|
520
|
+
// ── Baseline CRUD ──────────────────────────────────
|
|
521
|
+
|
|
522
|
+
dbevo
|
|
523
|
+
.command("register-baseline-v2 <baseline-id>")
|
|
524
|
+
.description("Register a V2 baseline")
|
|
525
|
+
.requiredOption("-d, --database <id>", "database id")
|
|
526
|
+
.requiredOption("-v, --version <ver>", "schema version")
|
|
527
|
+
.option("-i, --initial-status <s>", "initial status")
|
|
528
|
+
.option("--metadata <json>", "metadata JSON")
|
|
529
|
+
.action((id, opts) => {
|
|
530
|
+
const r = registerBaselineV2(null, {
|
|
531
|
+
baselineId: id,
|
|
532
|
+
databaseId: opts.database,
|
|
533
|
+
version: opts.version,
|
|
534
|
+
initialStatus: opts.initialStatus,
|
|
535
|
+
metadata: _parseMetaV2(opts.metadata),
|
|
536
|
+
});
|
|
537
|
+
console.log(JSON.stringify(r, null, 2));
|
|
538
|
+
});
|
|
539
|
+
|
|
540
|
+
dbevo
|
|
541
|
+
.command("baseline-v2 <baseline-id>")
|
|
542
|
+
.description("Get a V2 baseline")
|
|
543
|
+
.action((id) => {
|
|
544
|
+
const r = getBaselineV2(id);
|
|
545
|
+
if (!r) {
|
|
546
|
+
console.error(`Unknown baseline: ${id}`);
|
|
547
|
+
process.exitCode = 1;
|
|
548
|
+
return;
|
|
549
|
+
}
|
|
550
|
+
console.log(JSON.stringify(r, null, 2));
|
|
551
|
+
});
|
|
552
|
+
|
|
553
|
+
dbevo
|
|
554
|
+
.command("set-baseline-status-v2 <baseline-id> <status>")
|
|
555
|
+
.description("Transition baseline status")
|
|
556
|
+
.option("-r, --reason <text>", "reason")
|
|
557
|
+
.option("--metadata <json>", "metadata JSON")
|
|
558
|
+
.action((id, status, opts) => {
|
|
559
|
+
const r = setBaselineStatusV2(null, id, status, {
|
|
560
|
+
reason: opts.reason,
|
|
561
|
+
metadata: _parseMetaV2(opts.metadata),
|
|
562
|
+
});
|
|
563
|
+
console.log(JSON.stringify(r, null, 2));
|
|
564
|
+
});
|
|
565
|
+
|
|
566
|
+
for (const [name, fn] of [
|
|
567
|
+
["validate-baseline", validateBaseline],
|
|
568
|
+
["activate-baseline", activateBaseline],
|
|
569
|
+
["deprecate-baseline", deprecateBaseline],
|
|
570
|
+
["retire-baseline", retireBaseline],
|
|
571
|
+
]) {
|
|
572
|
+
dbevo
|
|
573
|
+
.command(`${name} <baseline-id>`)
|
|
574
|
+
.description(`Transition baseline (${name})`)
|
|
575
|
+
.option("-r, --reason <text>", "reason")
|
|
576
|
+
.action((id, opts) => {
|
|
577
|
+
const r = fn(null, id, opts.reason);
|
|
578
|
+
console.log(JSON.stringify(r, null, 2));
|
|
579
|
+
});
|
|
580
|
+
}
|
|
581
|
+
|
|
582
|
+
dbevo
|
|
583
|
+
.command("touch-baseline-activity <baseline-id>")
|
|
584
|
+
.description("Bump lastTouchedAt")
|
|
585
|
+
.action((id) => {
|
|
586
|
+
const r = touchBaselineActivity(id);
|
|
587
|
+
console.log(JSON.stringify(r, null, 2));
|
|
588
|
+
});
|
|
589
|
+
|
|
590
|
+
// ── Migration Run CRUD ─────────────────────────────
|
|
591
|
+
|
|
592
|
+
dbevo
|
|
593
|
+
.command("enqueue-migration-run-v2 <run-id>")
|
|
594
|
+
.description("Enqueue a V2 migration run")
|
|
595
|
+
.requiredOption("-d, --database <id>", "database id")
|
|
596
|
+
.requiredOption("-m, --migration <id>", "migration id")
|
|
597
|
+
.requiredOption("--direction <up|down>", "direction")
|
|
598
|
+
.option("--metadata <json>", "metadata JSON")
|
|
599
|
+
.action((id, opts) => {
|
|
600
|
+
const r = enqueueMigrationRunV2(null, {
|
|
601
|
+
runId: id,
|
|
602
|
+
databaseId: opts.database,
|
|
603
|
+
migrationId: opts.migration,
|
|
604
|
+
direction: opts.direction,
|
|
605
|
+
metadata: _parseMetaV2(opts.metadata),
|
|
606
|
+
});
|
|
607
|
+
console.log(JSON.stringify(r, null, 2));
|
|
608
|
+
});
|
|
609
|
+
|
|
610
|
+
dbevo
|
|
611
|
+
.command("migration-run-v2 <run-id>")
|
|
612
|
+
.description("Get a V2 migration run")
|
|
613
|
+
.action((id) => {
|
|
614
|
+
const r = getMigrationRunV2(id);
|
|
615
|
+
if (!r) {
|
|
616
|
+
console.error(`Unknown run: ${id}`);
|
|
617
|
+
process.exitCode = 1;
|
|
618
|
+
return;
|
|
619
|
+
}
|
|
620
|
+
console.log(JSON.stringify(r, null, 2));
|
|
621
|
+
});
|
|
622
|
+
|
|
623
|
+
dbevo
|
|
624
|
+
.command("set-migration-run-status-v2 <run-id> <status>")
|
|
625
|
+
.description("Transition migration-run status")
|
|
626
|
+
.option("-r, --reason <text>", "reason")
|
|
627
|
+
.option("--metadata <json>", "metadata JSON")
|
|
628
|
+
.action((id, status, opts) => {
|
|
629
|
+
const r = setMigrationRunStatusV2(null, id, status, {
|
|
630
|
+
reason: opts.reason,
|
|
631
|
+
metadata: _parseMetaV2(opts.metadata),
|
|
632
|
+
});
|
|
633
|
+
console.log(JSON.stringify(r, null, 2));
|
|
634
|
+
});
|
|
635
|
+
|
|
636
|
+
for (const [name, fn] of [
|
|
637
|
+
["start-migration-run", startMigrationRun],
|
|
638
|
+
["apply-migration-run", applyMigrationRun],
|
|
639
|
+
["fail-migration-run", failMigrationRun],
|
|
640
|
+
["rollback-migration-run", rollbackMigrationRun],
|
|
641
|
+
]) {
|
|
642
|
+
dbevo
|
|
643
|
+
.command(`${name} <run-id>`)
|
|
644
|
+
.description(`Transition migration run (${name})`)
|
|
645
|
+
.option("-r, --reason <text>", "reason")
|
|
646
|
+
.action((id, opts) => {
|
|
647
|
+
const r = fn(null, id, opts.reason);
|
|
648
|
+
console.log(JSON.stringify(r, null, 2));
|
|
649
|
+
});
|
|
650
|
+
}
|
|
651
|
+
|
|
652
|
+
dbevo
|
|
653
|
+
.command("auto-retire-idle-baselines")
|
|
654
|
+
.description("Flip idle draft/validated/deprecated → RETIRED")
|
|
655
|
+
.action(() =>
|
|
656
|
+
console.log(JSON.stringify(autoRetireIdleBaselines(null), null, 2)),
|
|
657
|
+
);
|
|
658
|
+
|
|
659
|
+
dbevo
|
|
660
|
+
.command("auto-fail-stuck-migration-runs")
|
|
661
|
+
.description("Flip stuck RUNNING → FAILED")
|
|
662
|
+
.action(() =>
|
|
663
|
+
console.log(JSON.stringify(autoFailStuckMigrationRuns(null), null, 2)),
|
|
664
|
+
);
|
|
665
|
+
|
|
666
|
+
dbevo
|
|
667
|
+
.command("stats-v2")
|
|
668
|
+
.description("V2 stats snapshot")
|
|
669
|
+
.action(() => console.log(JSON.stringify(getDbEvoStatsV2(), null, 2)));
|
|
670
|
+
|
|
387
671
|
program.addCommand(dbevo);
|
|
388
672
|
}
|
package/src/commands/dev.js
CHANGED
|
@@ -25,8 +25,47 @@ import {
|
|
|
25
25
|
listADRs,
|
|
26
26
|
renderADR,
|
|
27
27
|
AUTONOMY_LEVELS,
|
|
28
|
+
ADR_MATURITY_V2,
|
|
29
|
+
DEV_SESSION_V2,
|
|
30
|
+
getMaxActiveAdrsPerAuthor,
|
|
31
|
+
setMaxActiveAdrsPerAuthor,
|
|
32
|
+
getMaxRunningSessionsPerDeveloper,
|
|
33
|
+
setMaxRunningSessionsPerDeveloper,
|
|
34
|
+
getAdrStaleMs,
|
|
35
|
+
setAdrStaleMs,
|
|
36
|
+
getSessionStuckMs,
|
|
37
|
+
setSessionStuckMs,
|
|
38
|
+
getActiveAdrCount,
|
|
39
|
+
getRunningSessionCount,
|
|
40
|
+
createAdrV2,
|
|
41
|
+
getAdrV2,
|
|
42
|
+
listAdrsV2,
|
|
43
|
+
setAdrMaturityV2,
|
|
44
|
+
acceptAdr,
|
|
45
|
+
deprecateAdr,
|
|
46
|
+
supersedeAdr,
|
|
47
|
+
enqueueSessionV2,
|
|
48
|
+
getSessionV2,
|
|
49
|
+
listSessionsV2,
|
|
50
|
+
setSessionStatusV2,
|
|
51
|
+
startSessionV2,
|
|
52
|
+
completeSessionV2,
|
|
53
|
+
failSessionV2,
|
|
54
|
+
cancelSessionV2,
|
|
55
|
+
autoSupersedeStaleDrafts,
|
|
56
|
+
autoFailStuckSessions,
|
|
57
|
+
getAutonomousDeveloperStatsV2,
|
|
28
58
|
} from "../lib/autonomous-developer.js";
|
|
29
59
|
|
|
60
|
+
function _parseJsonV2(s) {
|
|
61
|
+
if (!s) return undefined;
|
|
62
|
+
try {
|
|
63
|
+
return JSON.parse(s);
|
|
64
|
+
} catch {
|
|
65
|
+
throw new Error(`invalid JSON: ${s}`);
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
|
|
30
69
|
function _dbFromCtx(ctx) {
|
|
31
70
|
if (!ctx.db) {
|
|
32
71
|
logger.error("Database not available");
|
|
@@ -408,4 +447,217 @@ export function registerDevCommand(program) {
|
|
|
408
447
|
|
|
409
448
|
// silence unused import lints (AUTONOMY_LEVELS re-exported for consumers)
|
|
410
449
|
void AUTONOMY_LEVELS;
|
|
450
|
+
|
|
451
|
+
/* ── V2 Surface (Autonomous Developer) ─────────────────── */
|
|
452
|
+
|
|
453
|
+
dev
|
|
454
|
+
.command("adr-maturities-v2")
|
|
455
|
+
.description("List ADR_MATURITY_V2 enum")
|
|
456
|
+
.action(() => {
|
|
457
|
+
for (const v of Object.values(ADR_MATURITY_V2)) console.log(` ${v}`);
|
|
458
|
+
});
|
|
459
|
+
|
|
460
|
+
dev
|
|
461
|
+
.command("dev-sessions-v2")
|
|
462
|
+
.description("List DEV_SESSION_V2 enum")
|
|
463
|
+
.action(() => {
|
|
464
|
+
for (const v of Object.values(DEV_SESSION_V2)) console.log(` ${v}`);
|
|
465
|
+
});
|
|
466
|
+
|
|
467
|
+
dev
|
|
468
|
+
.command("max-active-adrs-per-author")
|
|
469
|
+
.description("Get max-active-adrs-per-author cap")
|
|
470
|
+
.action(() => console.log(getMaxActiveAdrsPerAuthor()));
|
|
471
|
+
dev
|
|
472
|
+
.command("set-max-active-adrs-per-author <n>")
|
|
473
|
+
.action((n) => console.log(setMaxActiveAdrsPerAuthor(Number(n))));
|
|
474
|
+
|
|
475
|
+
dev
|
|
476
|
+
.command("max-running-sessions-per-developer")
|
|
477
|
+
.description("Get max-running-sessions-per-developer cap")
|
|
478
|
+
.action(() => console.log(getMaxRunningSessionsPerDeveloper()));
|
|
479
|
+
dev
|
|
480
|
+
.command("set-max-running-sessions-per-developer <n>")
|
|
481
|
+
.action((n) => console.log(setMaxRunningSessionsPerDeveloper(Number(n))));
|
|
482
|
+
|
|
483
|
+
dev
|
|
484
|
+
.command("adr-stale-ms")
|
|
485
|
+
.description("Get adr-stale-ms threshold")
|
|
486
|
+
.action(() => console.log(getAdrStaleMs()));
|
|
487
|
+
dev
|
|
488
|
+
.command("set-adr-stale-ms <n>")
|
|
489
|
+
.action((n) => console.log(setAdrStaleMs(Number(n))));
|
|
490
|
+
|
|
491
|
+
dev
|
|
492
|
+
.command("session-stuck-ms")
|
|
493
|
+
.description("Get session-stuck-ms threshold")
|
|
494
|
+
.action(() => console.log(getSessionStuckMs()));
|
|
495
|
+
dev
|
|
496
|
+
.command("set-session-stuck-ms <n>")
|
|
497
|
+
.action((n) => console.log(setSessionStuckMs(Number(n))));
|
|
498
|
+
|
|
499
|
+
dev
|
|
500
|
+
.command("active-adr-count")
|
|
501
|
+
.description("Count non-superseded ADRs (optionally by author)")
|
|
502
|
+
.option("-a, --author <author>")
|
|
503
|
+
.action((opts) => console.log(getActiveAdrCount(opts.author)));
|
|
504
|
+
|
|
505
|
+
dev
|
|
506
|
+
.command("running-session-count")
|
|
507
|
+
.description("Count RUNNING sessions (optionally by developer)")
|
|
508
|
+
.option("-d, --developer <developer>")
|
|
509
|
+
.action((opts) => console.log(getRunningSessionCount(opts.developer)));
|
|
510
|
+
|
|
511
|
+
dev
|
|
512
|
+
.command("create-adr-v2 <adr-id>")
|
|
513
|
+
.description("Create V2 ADR")
|
|
514
|
+
.requiredOption("-a, --author <author>", "author")
|
|
515
|
+
.requiredOption("-t, --title <title>", "title")
|
|
516
|
+
.option("-i, --initial <status>", "initial status", ADR_MATURITY_V2.DRAFT)
|
|
517
|
+
.option("--metadata <json>", "metadata JSON")
|
|
518
|
+
.action((id, opts) => {
|
|
519
|
+
const a = createAdrV2({
|
|
520
|
+
id,
|
|
521
|
+
author: opts.author,
|
|
522
|
+
title: opts.title,
|
|
523
|
+
initialStatus: opts.initial,
|
|
524
|
+
metadata: _parseJsonV2(opts.metadata),
|
|
525
|
+
});
|
|
526
|
+
console.log(JSON.stringify(a, null, 2));
|
|
527
|
+
});
|
|
528
|
+
|
|
529
|
+
dev
|
|
530
|
+
.command("adr-v2 <adr-id>")
|
|
531
|
+
.description("Show V2 ADR")
|
|
532
|
+
.action((id) => {
|
|
533
|
+
const a = getAdrV2(id);
|
|
534
|
+
if (!a) return console.error(`ADR ${id} not found`);
|
|
535
|
+
console.log(JSON.stringify(a, null, 2));
|
|
536
|
+
});
|
|
537
|
+
|
|
538
|
+
dev
|
|
539
|
+
.command("list-adrs-v2")
|
|
540
|
+
.description("List V2 ADRs")
|
|
541
|
+
.option("-a, --author <author>")
|
|
542
|
+
.option("-s, --status <status>")
|
|
543
|
+
.action((opts) => console.log(JSON.stringify(listAdrsV2(opts), null, 2)));
|
|
544
|
+
|
|
545
|
+
dev
|
|
546
|
+
.command("set-adr-maturity-v2 <adr-id> <status>")
|
|
547
|
+
.description("Transition V2 ADR maturity")
|
|
548
|
+
.option("-r, --reason <reason>")
|
|
549
|
+
.option("--metadata <json>")
|
|
550
|
+
.action((id, status, opts) => {
|
|
551
|
+
const a = setAdrMaturityV2(id, status, {
|
|
552
|
+
reason: opts.reason,
|
|
553
|
+
metadata: _parseJsonV2(opts.metadata),
|
|
554
|
+
});
|
|
555
|
+
console.log(JSON.stringify(a, null, 2));
|
|
556
|
+
});
|
|
557
|
+
|
|
558
|
+
for (const [name, fn] of [
|
|
559
|
+
["accept-adr", acceptAdr],
|
|
560
|
+
["deprecate-adr", deprecateAdr],
|
|
561
|
+
["supersede-adr", supersedeAdr],
|
|
562
|
+
]) {
|
|
563
|
+
dev
|
|
564
|
+
.command(`${name} <adr-id>`)
|
|
565
|
+
.description(`Shortcut for ${name.replace("-adr", "")} transition`)
|
|
566
|
+
.option("-r, --reason <reason>")
|
|
567
|
+
.action((id, opts) => {
|
|
568
|
+
const a = fn(id, { reason: opts.reason });
|
|
569
|
+
console.log(JSON.stringify(a, null, 2));
|
|
570
|
+
});
|
|
571
|
+
}
|
|
572
|
+
|
|
573
|
+
dev
|
|
574
|
+
.command("enqueue-session-v2 <session-id>")
|
|
575
|
+
.description("Enqueue V2 dev session")
|
|
576
|
+
.requiredOption("-d, --developer <developer>")
|
|
577
|
+
.requiredOption("-g, --goal <goal>")
|
|
578
|
+
.option("--metadata <json>")
|
|
579
|
+
.action((id, opts) => {
|
|
580
|
+
const s = enqueueSessionV2({
|
|
581
|
+
id,
|
|
582
|
+
developer: opts.developer,
|
|
583
|
+
goal: opts.goal,
|
|
584
|
+
metadata: _parseJsonV2(opts.metadata),
|
|
585
|
+
});
|
|
586
|
+
console.log(JSON.stringify(s, null, 2));
|
|
587
|
+
});
|
|
588
|
+
|
|
589
|
+
dev
|
|
590
|
+
.command("session-v2 <session-id>")
|
|
591
|
+
.description("Show V2 session")
|
|
592
|
+
.action((id) => {
|
|
593
|
+
const s = getSessionV2(id);
|
|
594
|
+
if (!s) return console.error(`session ${id} not found`);
|
|
595
|
+
console.log(JSON.stringify(s, null, 2));
|
|
596
|
+
});
|
|
597
|
+
|
|
598
|
+
dev
|
|
599
|
+
.command("list-sessions-v2")
|
|
600
|
+
.description("List V2 sessions")
|
|
601
|
+
.option("-d, --developer <developer>")
|
|
602
|
+
.option("-s, --status <status>")
|
|
603
|
+
.action((opts) =>
|
|
604
|
+
console.log(JSON.stringify(listSessionsV2(opts), null, 2)),
|
|
605
|
+
);
|
|
606
|
+
|
|
607
|
+
dev
|
|
608
|
+
.command("set-session-status-v2 <session-id> <status>")
|
|
609
|
+
.option("-r, --reason <reason>")
|
|
610
|
+
.option("--metadata <json>")
|
|
611
|
+
.action((id, status, opts) => {
|
|
612
|
+
const s = setSessionStatusV2(id, status, {
|
|
613
|
+
reason: opts.reason,
|
|
614
|
+
metadata: _parseJsonV2(opts.metadata),
|
|
615
|
+
});
|
|
616
|
+
console.log(JSON.stringify(s, null, 2));
|
|
617
|
+
});
|
|
618
|
+
|
|
619
|
+
for (const [name, fn] of [
|
|
620
|
+
["start-session-v2", startSessionV2],
|
|
621
|
+
["complete-session-v2", completeSessionV2],
|
|
622
|
+
["fail-session-v2", failSessionV2],
|
|
623
|
+
["cancel-session-v2", cancelSessionV2],
|
|
624
|
+
]) {
|
|
625
|
+
dev
|
|
626
|
+
.command(`${name} <session-id>`)
|
|
627
|
+
.description(`Shortcut for ${name.replace("-session-v2", "")} transition`)
|
|
628
|
+
.option("-r, --reason <reason>")
|
|
629
|
+
.action((id, opts) => {
|
|
630
|
+
const s = fn(id, { reason: opts.reason });
|
|
631
|
+
console.log(JSON.stringify(s, null, 2));
|
|
632
|
+
});
|
|
633
|
+
}
|
|
634
|
+
|
|
635
|
+
dev
|
|
636
|
+
.command("auto-supersede-stale-drafts")
|
|
637
|
+
.description(
|
|
638
|
+
"Bulk-supersede DRAFT ADRs whose updatedAt is older than adrStaleMs",
|
|
639
|
+
)
|
|
640
|
+
.action(() =>
|
|
641
|
+
console.log(
|
|
642
|
+
JSON.stringify({ flipped: autoSupersedeStaleDrafts() }, null, 2),
|
|
643
|
+
),
|
|
644
|
+
);
|
|
645
|
+
|
|
646
|
+
dev
|
|
647
|
+
.command("auto-fail-stuck-sessions")
|
|
648
|
+
.description(
|
|
649
|
+
"Bulk-fail RUNNING sessions whose startedAt is older than sessionStuckMs",
|
|
650
|
+
)
|
|
651
|
+
.action(() =>
|
|
652
|
+
console.log(
|
|
653
|
+
JSON.stringify({ flipped: autoFailStuckSessions() }, null, 2),
|
|
654
|
+
),
|
|
655
|
+
);
|
|
656
|
+
|
|
657
|
+
dev
|
|
658
|
+
.command("stats-v2")
|
|
659
|
+
.description("Show V2 autonomous-developer stats")
|
|
660
|
+
.action(() =>
|
|
661
|
+
console.log(JSON.stringify(getAutonomousDeveloperStatsV2(), null, 2)),
|
|
662
|
+
);
|
|
411
663
|
}
|