chainlesschain 0.132.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/package.json +1 -1
- package/src/commands/a2a.js +62 -0
- package/src/commands/activitypub.js +61 -0
- package/src/commands/agent.js +117 -0
- 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/compliance.js +40 -0
- package/src/commands/compt.js +78 -0
- package/src/commands/consol.js +231 -0
- package/src/commands/cowork.js +42 -0
- package/src/commands/crosschain.js +62 -0
- package/src/commands/dao.js +62 -0
- package/src/commands/dlp.js +61 -0
- package/src/commands/economy.js +56 -0
- package/src/commands/evolution.js +56 -0
- package/src/commands/evomap.js +61 -0
- package/src/commands/fflag.js +178 -0
- package/src/commands/git.js +45 -0
- package/src/commands/hmemory.js +56 -0
- package/src/commands/inference.js +42 -0
- package/src/commands/itbudget.js +45 -0
- package/src/commands/lowcode.js +44 -0
- package/src/commands/matrix.js +62 -0
- package/src/commands/mcpscaf.js +41 -0
- package/src/commands/meminj.js +41 -0
- package/src/commands/nostr.js +62 -0
- package/src/commands/orchgov.js +45 -0
- package/src/commands/pdfp.js +78 -0
- package/src/commands/perf.js +39 -0
- package/src/commands/perm.js +45 -0
- package/src/commands/pipeline.js +57 -1
- package/src/commands/planmode.js +45 -0
- package/src/commands/promcomp.js +82 -0
- package/src/commands/recommend.js +42 -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/sganal.js +78 -0
- package/src/commands/siem.js +40 -0
- package/src/commands/slotfill.js +41 -0
- package/src/commands/social.js +34 -0
- package/src/commands/svccont.js +45 -0
- package/src/commands/tms.js +45 -0
- package/src/commands/topiccls.js +45 -0
- package/src/commands/uprof.js +45 -0
- package/src/commands/vcheck.js +78 -0
- package/src/commands/webfetch.js +41 -0
- package/src/commands/zkp.js +62 -0
- package/src/harness/prompt-compressor.js +331 -0
- package/src/index.js +61 -1
- package/src/lib/a2a-protocol.js +105 -0
- package/src/lib/activitypub-bridge.js +105 -0
- package/src/lib/agent-economy.js +105 -0
- package/src/lib/app-builder.js +105 -0
- package/src/lib/autonomous-agent.js +105 -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/compliance-framework-reporter.js +105 -0
- package/src/lib/compression-telemetry.js +81 -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/dao-governance.js +105 -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/hierarchical-memory.js +105 -0
- package/src/lib/inference-network.js +105 -0
- package/src/lib/iteration-budget.js +105 -0
- package/src/lib/matrix-bridge.js +105 -0
- package/src/lib/mcp-scaffold.js +81 -0
- package/src/lib/memory-injection.js +81 -0
- package/src/lib/nostr-bridge.js +105 -0
- package/src/lib/orchestrator.js +105 -0
- package/src/lib/pdf-parser.js +81 -0
- package/src/lib/perf-tuning.js +105 -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/prompt-compressor.js +1 -10
- 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-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/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/sub-agent-registry.js +110 -0
- package/src/lib/task-model-selector.js +81 -0
- package/src/lib/todo-manager.js +105 -0
- package/src/lib/topic-classifier.js +105 -0
- package/src/lib/user-profile.js +81 -0
- package/src/lib/version-checker.js +81 -0
- package/src/lib/web-fetch.js +81 -0
- package/src/lib/zkp-engine.js +105 -0
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `cc tms` — Task Model Selector V2 governance overlay.
|
|
3
|
+
*
|
|
4
|
+
* In-memory governance for selector profiles + selection lifecycle, layered atop
|
|
5
|
+
* `lib/task-model-selector.js`. Independent of legacy heuristic selector helpers.
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
import {
|
|
9
|
+
TMS_PROFILE_MATURITY_V2, TMS_SELECTION_LIFECYCLE_V2,
|
|
10
|
+
setMaxActiveTmsProfilesPerOwnerV2, getMaxActiveTmsProfilesPerOwnerV2,
|
|
11
|
+
setMaxPendingTmsSelectionsPerProfileV2, getMaxPendingTmsSelectionsPerProfileV2,
|
|
12
|
+
setTmsProfileIdleMsV2, getTmsProfileIdleMsV2,
|
|
13
|
+
setTmsSelectionStuckMsV2, getTmsSelectionStuckMsV2,
|
|
14
|
+
registerTmsProfileV2, activateTmsProfileV2, staleTmsProfileV2, decommissionTmsProfileV2, touchTmsProfileV2, getTmsProfileV2, listTmsProfilesV2,
|
|
15
|
+
createTmsSelectionV2, scoreTmsSelectionV2, completeTmsSelectionV2, failTmsSelectionV2, cancelTmsSelectionV2, getTmsSelectionV2, listTmsSelectionsV2,
|
|
16
|
+
autoStaleIdleTmsProfilesV2, autoFailStuckTmsSelectionsV2, getTaskModelSelectorGovStatsV2, _resetStateTaskModelSelectorV2,
|
|
17
|
+
} from "../lib/task-model-selector.js";
|
|
18
|
+
|
|
19
|
+
export function registerTmsCommand(program) {
|
|
20
|
+
const tms = program.command("tms").description("Task Model Selector V2 governance");
|
|
21
|
+
tms.command("enums-v2").action(() => console.log(JSON.stringify({ profileMaturity: TMS_PROFILE_MATURITY_V2, selectionLifecycle: TMS_SELECTION_LIFECYCLE_V2 }, null, 2)));
|
|
22
|
+
tms.command("config-v2").action(() => console.log(JSON.stringify({ maxActiveTmsProfilesPerOwner: getMaxActiveTmsProfilesPerOwnerV2(), maxPendingTmsSelectionsPerProfile: getMaxPendingTmsSelectionsPerProfileV2(), tmsProfileIdleMs: getTmsProfileIdleMsV2(), tmsSelectionStuckMs: getTmsSelectionStuckMsV2() }, null, 2)));
|
|
23
|
+
tms.command("set-max-active-v2 <n>").action((n) => { setMaxActiveTmsProfilesPerOwnerV2(Number(n)); console.log("ok"); });
|
|
24
|
+
tms.command("set-max-pending-v2 <n>").action((n) => { setMaxPendingTmsSelectionsPerProfileV2(Number(n)); console.log("ok"); });
|
|
25
|
+
tms.command("set-idle-ms-v2 <n>").action((n) => { setTmsProfileIdleMsV2(Number(n)); console.log("ok"); });
|
|
26
|
+
tms.command("set-stuck-ms-v2 <n>").action((n) => { setTmsSelectionStuckMsV2(Number(n)); console.log("ok"); });
|
|
27
|
+
tms.command("register-profile-v2 <id> <owner>").option("--strategy <s>", "strategy").action((id, owner, o) => console.log(JSON.stringify(registerTmsProfileV2({ id, owner, strategy: o.strategy }), null, 2)));
|
|
28
|
+
tms.command("activate-profile-v2 <id>").action((id) => console.log(JSON.stringify(activateTmsProfileV2(id), null, 2)));
|
|
29
|
+
tms.command("stale-profile-v2 <id>").action((id) => console.log(JSON.stringify(staleTmsProfileV2(id), null, 2)));
|
|
30
|
+
tms.command("decommission-profile-v2 <id>").action((id) => console.log(JSON.stringify(decommissionTmsProfileV2(id), null, 2)));
|
|
31
|
+
tms.command("touch-profile-v2 <id>").action((id) => console.log(JSON.stringify(touchTmsProfileV2(id), null, 2)));
|
|
32
|
+
tms.command("get-profile-v2 <id>").action((id) => console.log(JSON.stringify(getTmsProfileV2(id), null, 2)));
|
|
33
|
+
tms.command("list-profiles-v2").action(() => console.log(JSON.stringify(listTmsProfilesV2(), null, 2)));
|
|
34
|
+
tms.command("create-selection-v2 <id> <profileId>").option("--task <t>", "task").action((id, profileId, o) => console.log(JSON.stringify(createTmsSelectionV2({ id, profileId, task: o.task }), null, 2)));
|
|
35
|
+
tms.command("score-selection-v2 <id>").action((id) => console.log(JSON.stringify(scoreTmsSelectionV2(id), null, 2)));
|
|
36
|
+
tms.command("complete-selection-v2 <id>").action((id) => console.log(JSON.stringify(completeTmsSelectionV2(id), null, 2)));
|
|
37
|
+
tms.command("fail-selection-v2 <id> [reason]").action((id, reason) => console.log(JSON.stringify(failTmsSelectionV2(id, reason), null, 2)));
|
|
38
|
+
tms.command("cancel-selection-v2 <id> [reason]").action((id, reason) => console.log(JSON.stringify(cancelTmsSelectionV2(id, reason), null, 2)));
|
|
39
|
+
tms.command("get-selection-v2 <id>").action((id) => console.log(JSON.stringify(getTmsSelectionV2(id), null, 2)));
|
|
40
|
+
tms.command("list-selections-v2").action(() => console.log(JSON.stringify(listTmsSelectionsV2(), null, 2)));
|
|
41
|
+
tms.command("auto-stale-idle-v2").action(() => console.log(JSON.stringify(autoStaleIdleTmsProfilesV2(), null, 2)));
|
|
42
|
+
tms.command("auto-fail-stuck-v2").action(() => console.log(JSON.stringify(autoFailStuckTmsSelectionsV2(), null, 2)));
|
|
43
|
+
tms.command("gov-stats-v2").action(() => console.log(JSON.stringify(getTaskModelSelectorGovStatsV2(), null, 2)));
|
|
44
|
+
tms.command("reset-state-v2").action(() => { _resetStateTaskModelSelectorV2(); console.log(JSON.stringify({ ok: true }, null, 2)); });
|
|
45
|
+
}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `cc topiccls` — Topic Classifier V2 governance overlay.
|
|
3
|
+
*
|
|
4
|
+
* In-memory governance for classifier profiles + job lifecycle, layered atop
|
|
5
|
+
* `lib/topic-classifier.js`.
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
import {
|
|
9
|
+
TOPIC_CLS_PROFILE_MATURITY_V2, TOPIC_CLS_JOB_LIFECYCLE_V2,
|
|
10
|
+
setMaxActiveTopicClsProfilesPerOwnerV2, getMaxActiveTopicClsProfilesPerOwnerV2,
|
|
11
|
+
setMaxPendingTopicClsJobsPerProfileV2, getMaxPendingTopicClsJobsPerProfileV2,
|
|
12
|
+
setTopicClsProfileIdleMsV2, getTopicClsProfileIdleMsV2,
|
|
13
|
+
setTopicClsJobStuckMsV2, getTopicClsJobStuckMsV2,
|
|
14
|
+
registerTopicClsProfileV2, activateTopicClsProfileV2, staleTopicClsProfileV2, archiveTopicClsProfileV2, touchTopicClsProfileV2, getTopicClsProfileV2, listTopicClsProfilesV2,
|
|
15
|
+
createTopicClsJobV2, startTopicClsJobV2, completeTopicClsJobV2, failTopicClsJobV2, cancelTopicClsJobV2, getTopicClsJobV2, listTopicClsJobsV2,
|
|
16
|
+
autoStaleIdleTopicClsProfilesV2, autoFailStuckTopicClsJobsV2, getTopicClassifierGovStatsV2, _resetStateTopicClsV2,
|
|
17
|
+
} from "../lib/topic-classifier.js";
|
|
18
|
+
|
|
19
|
+
export function registerTopicClsCommand(program) {
|
|
20
|
+
const tc = program.command("topiccls").description("Topic Classifier V2 governance");
|
|
21
|
+
tc.command("enums-v2").action(() => console.log(JSON.stringify({ profileMaturity: TOPIC_CLS_PROFILE_MATURITY_V2, jobLifecycle: TOPIC_CLS_JOB_LIFECYCLE_V2 }, null, 2)));
|
|
22
|
+
tc.command("config-v2").action(() => console.log(JSON.stringify({ maxActiveTopicClsProfilesPerOwner: getMaxActiveTopicClsProfilesPerOwnerV2(), maxPendingTopicClsJobsPerProfile: getMaxPendingTopicClsJobsPerProfileV2(), topicClsProfileIdleMs: getTopicClsProfileIdleMsV2(), topicClsJobStuckMs: getTopicClsJobStuckMsV2() }, null, 2)));
|
|
23
|
+
tc.command("set-max-active-v2 <n>").action((n) => { setMaxActiveTopicClsProfilesPerOwnerV2(Number(n)); console.log("ok"); });
|
|
24
|
+
tc.command("set-max-pending-v2 <n>").action((n) => { setMaxPendingTopicClsJobsPerProfileV2(Number(n)); console.log("ok"); });
|
|
25
|
+
tc.command("set-idle-ms-v2 <n>").action((n) => { setTopicClsProfileIdleMsV2(Number(n)); console.log("ok"); });
|
|
26
|
+
tc.command("set-stuck-ms-v2 <n>").action((n) => { setTopicClsJobStuckMsV2(Number(n)); console.log("ok"); });
|
|
27
|
+
tc.command("register-profile-v2 <id> <owner>").option("--model <m>", "model").action((id, owner, o) => console.log(JSON.stringify(registerTopicClsProfileV2({ id, owner, model: o.model }), null, 2)));
|
|
28
|
+
tc.command("activate-profile-v2 <id>").action((id) => console.log(JSON.stringify(activateTopicClsProfileV2(id), null, 2)));
|
|
29
|
+
tc.command("stale-profile-v2 <id>").action((id) => console.log(JSON.stringify(staleTopicClsProfileV2(id), null, 2)));
|
|
30
|
+
tc.command("archive-profile-v2 <id>").action((id) => console.log(JSON.stringify(archiveTopicClsProfileV2(id), null, 2)));
|
|
31
|
+
tc.command("touch-profile-v2 <id>").action((id) => console.log(JSON.stringify(touchTopicClsProfileV2(id), null, 2)));
|
|
32
|
+
tc.command("get-profile-v2 <id>").action((id) => console.log(JSON.stringify(getTopicClsProfileV2(id), null, 2)));
|
|
33
|
+
tc.command("list-profiles-v2").action(() => console.log(JSON.stringify(listTopicClsProfilesV2(), null, 2)));
|
|
34
|
+
tc.command("create-job-v2 <id> <profileId>").option("--text <t>", "text").action((id, profileId, o) => console.log(JSON.stringify(createTopicClsJobV2({ id, profileId, text: o.text }), null, 2)));
|
|
35
|
+
tc.command("start-job-v2 <id>").action((id) => console.log(JSON.stringify(startTopicClsJobV2(id), null, 2)));
|
|
36
|
+
tc.command("complete-job-v2 <id>").action((id) => console.log(JSON.stringify(completeTopicClsJobV2(id), null, 2)));
|
|
37
|
+
tc.command("fail-job-v2 <id> [reason]").action((id, reason) => console.log(JSON.stringify(failTopicClsJobV2(id, reason), null, 2)));
|
|
38
|
+
tc.command("cancel-job-v2 <id> [reason]").action((id, reason) => console.log(JSON.stringify(cancelTopicClsJobV2(id, reason), null, 2)));
|
|
39
|
+
tc.command("get-job-v2 <id>").action((id) => console.log(JSON.stringify(getTopicClsJobV2(id), null, 2)));
|
|
40
|
+
tc.command("list-jobs-v2").action(() => console.log(JSON.stringify(listTopicClsJobsV2(), null, 2)));
|
|
41
|
+
tc.command("auto-stale-idle-v2").action(() => console.log(JSON.stringify(autoStaleIdleTopicClsProfilesV2(), null, 2)));
|
|
42
|
+
tc.command("auto-fail-stuck-v2").action(() => console.log(JSON.stringify(autoFailStuckTopicClsJobsV2(), null, 2)));
|
|
43
|
+
tc.command("gov-stats-v2").action(() => console.log(JSON.stringify(getTopicClassifierGovStatsV2(), null, 2)));
|
|
44
|
+
tc.command("reset-state-v2").action(() => { _resetStateTopicClsV2(); console.log(JSON.stringify({ ok: true }, null, 2)); });
|
|
45
|
+
}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `cc uprof` — User Profile V2 governance overlay.
|
|
3
|
+
*
|
|
4
|
+
* In-memory governance for user profile maturity + preference lifecycle, layered
|
|
5
|
+
* atop `lib/user-profile.js`. Independent of legacy SQLite/file profile storage.
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
import {
|
|
9
|
+
USER_PROFILE_MATURITY_V2, USER_PREF_LIFECYCLE_V2,
|
|
10
|
+
setMaxActiveUserProfilesPerOwnerV2, getMaxActiveUserProfilesPerOwnerV2,
|
|
11
|
+
setMaxPendingUserPrefsPerProfileV2, getMaxPendingUserPrefsPerProfileV2,
|
|
12
|
+
setUserProfileIdleMsV2, getUserProfileIdleMsV2,
|
|
13
|
+
setUserPrefStuckMsV2, getUserPrefStuckMsV2,
|
|
14
|
+
registerUserProfileV2, activateUserProfileV2, dormantUserProfileV2, archiveUserProfileV2, touchUserProfileV2, getUserProfileV2, listUserProfilesV2,
|
|
15
|
+
createUserPrefV2, applyUserPrefV2, rejectUserPrefV2, supersedeUserPrefV2, cancelUserPrefV2, getUserPrefV2, listUserPrefsV2,
|
|
16
|
+
autoDormantIdleUserProfilesV2, autoCancelStaleUserPrefsV2, getUserProfileGovStatsV2, _resetStateUserProfileV2,
|
|
17
|
+
} from "../lib/user-profile.js";
|
|
18
|
+
|
|
19
|
+
export function registerUprofCommand(program) {
|
|
20
|
+
const up = program.command("uprof").description("User Profile V2 governance");
|
|
21
|
+
up.command("enums-v2").action(() => console.log(JSON.stringify({ profileMaturity: USER_PROFILE_MATURITY_V2, prefLifecycle: USER_PREF_LIFECYCLE_V2 }, null, 2)));
|
|
22
|
+
up.command("config-v2").action(() => console.log(JSON.stringify({ maxActiveUserProfilesPerOwner: getMaxActiveUserProfilesPerOwnerV2(), maxPendingUserPrefsPerProfile: getMaxPendingUserPrefsPerProfileV2(), userProfileIdleMs: getUserProfileIdleMsV2(), userPrefStuckMs: getUserPrefStuckMsV2() }, null, 2)));
|
|
23
|
+
up.command("set-max-active-v2 <n>").action((n) => { setMaxActiveUserProfilesPerOwnerV2(Number(n)); console.log("ok"); });
|
|
24
|
+
up.command("set-max-pending-v2 <n>").action((n) => { setMaxPendingUserPrefsPerProfileV2(Number(n)); console.log("ok"); });
|
|
25
|
+
up.command("set-idle-ms-v2 <n>").action((n) => { setUserProfileIdleMsV2(Number(n)); console.log("ok"); });
|
|
26
|
+
up.command("set-stuck-ms-v2 <n>").action((n) => { setUserPrefStuckMsV2(Number(n)); console.log("ok"); });
|
|
27
|
+
up.command("register-profile-v2 <id> <owner>").option("--handle <h>", "handle").action((id, owner, o) => console.log(JSON.stringify(registerUserProfileV2({ id, owner, handle: o.handle }), null, 2)));
|
|
28
|
+
up.command("activate-profile-v2 <id>").action((id) => console.log(JSON.stringify(activateUserProfileV2(id), null, 2)));
|
|
29
|
+
up.command("dormant-profile-v2 <id>").action((id) => console.log(JSON.stringify(dormantUserProfileV2(id), null, 2)));
|
|
30
|
+
up.command("archive-profile-v2 <id>").action((id) => console.log(JSON.stringify(archiveUserProfileV2(id), null, 2)));
|
|
31
|
+
up.command("touch-profile-v2 <id>").action((id) => console.log(JSON.stringify(touchUserProfileV2(id), null, 2)));
|
|
32
|
+
up.command("get-profile-v2 <id>").action((id) => console.log(JSON.stringify(getUserProfileV2(id), null, 2)));
|
|
33
|
+
up.command("list-profiles-v2").action(() => console.log(JSON.stringify(listUserProfilesV2(), null, 2)));
|
|
34
|
+
up.command("create-pref-v2 <id> <profileId>").option("--key <k>", "key").action((id, profileId, o) => console.log(JSON.stringify(createUserPrefV2({ id, profileId, key: o.key }), null, 2)));
|
|
35
|
+
up.command("apply-pref-v2 <id>").action((id) => console.log(JSON.stringify(applyUserPrefV2(id), null, 2)));
|
|
36
|
+
up.command("reject-pref-v2 <id> [reason]").action((id, reason) => console.log(JSON.stringify(rejectUserPrefV2(id, reason), null, 2)));
|
|
37
|
+
up.command("supersede-pref-v2 <id>").action((id) => console.log(JSON.stringify(supersedeUserPrefV2(id), null, 2)));
|
|
38
|
+
up.command("cancel-pref-v2 <id> [reason]").action((id, reason) => console.log(JSON.stringify(cancelUserPrefV2(id, reason), null, 2)));
|
|
39
|
+
up.command("get-pref-v2 <id>").action((id) => console.log(JSON.stringify(getUserPrefV2(id), null, 2)));
|
|
40
|
+
up.command("list-prefs-v2").action(() => console.log(JSON.stringify(listUserPrefsV2(), null, 2)));
|
|
41
|
+
up.command("auto-dormant-idle-v2").action(() => console.log(JSON.stringify(autoDormantIdleUserProfilesV2(), null, 2)));
|
|
42
|
+
up.command("auto-cancel-stale-v2").action(() => console.log(JSON.stringify(autoCancelStaleUserPrefsV2(), null, 2)));
|
|
43
|
+
up.command("gov-stats-v2").action(() => console.log(JSON.stringify(getUserProfileGovStatsV2(), null, 2)));
|
|
44
|
+
up.command("reset-state-v2").action(() => { _resetStateUserProfileV2(); console.log(JSON.stringify({ ok: true }, null, 2)); });
|
|
45
|
+
}
|
|
@@ -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
|
+
}
|
|
@@ -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/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
|
+
|