chainlesschain 0.143.0 → 0.145.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.
Files changed (133) hide show
  1. package/package.json +1 -1
  2. package/src/commands/a2a.js +196 -28
  3. package/src/commands/activitypub.js +157 -27
  4. package/src/commands/agent.js +587 -103
  5. package/src/commands/audit.js +206 -0
  6. package/src/commands/bi.js +152 -27
  7. package/src/commands/bm25.js +111 -27
  8. package/src/commands/browse.js +190 -29
  9. package/src/commands/ccron.js +128 -28
  10. package/src/commands/chat.js +207 -0
  11. package/src/commands/compliance.js +414 -34
  12. package/src/commands/compt.js +127 -29
  13. package/src/commands/consol.js +8 -2
  14. package/src/commands/cowork.js +580 -34
  15. package/src/commands/crosschain.js +182 -28
  16. package/src/commands/dao.js +182 -28
  17. package/src/commands/dlp.js +172 -27
  18. package/src/commands/economy.js +205 -50
  19. package/src/commands/evolution.js +203 -50
  20. package/src/commands/evomap.js +182 -27
  21. package/src/commands/fflag.js +74 -22
  22. package/src/commands/git.js +177 -37
  23. package/src/commands/hardening.js +209 -0
  24. package/src/commands/hmemory.js +204 -50
  25. package/src/commands/incentive.js +209 -0
  26. package/src/commands/inference.js +170 -34
  27. package/src/commands/itbudget.js +149 -33
  28. package/src/commands/kg.js +206 -0
  29. package/src/commands/lowcode.js +195 -38
  30. package/src/commands/marketplace.js +206 -0
  31. package/src/commands/matrix.js +179 -27
  32. package/src/commands/mcpscaf.js +145 -33
  33. package/src/commands/meminj.js +145 -33
  34. package/src/commands/nostr.js +178 -27
  35. package/src/commands/orchestrate.js +217 -0
  36. package/src/commands/orchgov.js +144 -33
  37. package/src/commands/pdfp.js +109 -27
  38. package/src/commands/perf.js +169 -32
  39. package/src/commands/perm.js +144 -33
  40. package/src/commands/pipeline.js +207 -52
  41. package/src/commands/planmode.js +141 -32
  42. package/src/commands/privacy.js +203 -0
  43. package/src/commands/promcomp.js +111 -27
  44. package/src/commands/recommend.js +177 -34
  45. package/src/commands/reputation.js +208 -0
  46. package/src/commands/sandbox.js +206 -0
  47. package/src/commands/seshhook.js +145 -33
  48. package/src/commands/seshsearch.js +141 -33
  49. package/src/commands/seshtail.js +144 -33
  50. package/src/commands/seshu.js +152 -33
  51. package/src/commands/sganal.js +123 -29
  52. package/src/commands/siem.js +201 -34
  53. package/src/commands/sla.js +212 -0
  54. package/src/commands/slotfill.js +146 -33
  55. package/src/commands/social.js +157 -32
  56. package/src/commands/stress.js +206 -0
  57. package/src/commands/svccont.js +145 -33
  58. package/src/commands/terraform.js +206 -0
  59. package/src/commands/tms.js +171 -33
  60. package/src/commands/topiccls.js +146 -33
  61. package/src/commands/uprof.js +141 -32
  62. package/src/commands/vcheck.js +122 -28
  63. package/src/commands/webfetch.js +141 -32
  64. package/src/commands/zkp.js +184 -28
  65. package/src/index.js +40 -0
  66. package/src/lib/a2a-protocol.js +319 -51
  67. package/src/lib/activitypub-bridge.js +288 -50
  68. package/src/lib/agent-economy.js +304 -51
  69. package/src/lib/app-builder.js +279 -46
  70. package/src/lib/audit-logger.js +321 -0
  71. package/src/lib/autonomous-agent.js +284 -48
  72. package/src/lib/bi-engine.js +283 -49
  73. package/src/lib/bm25-search.js +301 -49
  74. package/src/lib/browser-automation.js +296 -49
  75. package/src/lib/chat-core.js +336 -0
  76. package/src/lib/claude-code-bridge.js +341 -0
  77. package/src/lib/compliance-framework-reporter.js +305 -51
  78. package/src/lib/compliance-manager.js +330 -0
  79. package/src/lib/compression-telemetry.js +301 -49
  80. package/src/lib/content-recommender.js +317 -52
  81. package/src/lib/cowork-cron.js +298 -49
  82. package/src/lib/cowork-learning.js +333 -0
  83. package/src/lib/cowork-task-runner.js +308 -51
  84. package/src/lib/cowork-workflow.js +327 -0
  85. package/src/lib/cross-chain.js +311 -51
  86. package/src/lib/dao-governance.js +280 -46
  87. package/src/lib/dlp-engine.js +287 -49
  88. package/src/lib/evolution-system.js +278 -47
  89. package/src/lib/evomap-manager.js +280 -46
  90. package/src/lib/execution-backend.js +294 -48
  91. package/src/lib/feature-flags.js +294 -49
  92. package/src/lib/git-integration.js +285 -47
  93. package/src/lib/hardening-manager.js +341 -0
  94. package/src/lib/hierarchical-memory.js +284 -48
  95. package/src/lib/inference-network.js +308 -51
  96. package/src/lib/iteration-budget.js +302 -50
  97. package/src/lib/knowledge-graph.js +333 -0
  98. package/src/lib/matrix-bridge.js +281 -47
  99. package/src/lib/mcp-scaffold.js +318 -54
  100. package/src/lib/memory-injection.js +288 -49
  101. package/src/lib/nostr-bridge.js +286 -49
  102. package/src/lib/orchestrator.js +293 -48
  103. package/src/lib/pdf-parser.js +298 -49
  104. package/src/lib/perf-tuning.js +309 -50
  105. package/src/lib/permission-engine.js +287 -49
  106. package/src/lib/pipeline-orchestrator.js +289 -49
  107. package/src/lib/plan-mode.js +298 -51
  108. package/src/lib/privacy-computing.js +335 -0
  109. package/src/lib/reputation-optimizer.js +340 -0
  110. package/src/lib/sandbox-v2.js +327 -0
  111. package/src/lib/service-container.js +313 -52
  112. package/src/lib/session-consolidator.js +296 -49
  113. package/src/lib/session-hooks.js +312 -53
  114. package/src/lib/session-search.js +304 -51
  115. package/src/lib/session-tail.js +288 -49
  116. package/src/lib/session-usage.js +298 -52
  117. package/src/lib/siem-exporter.js +298 -51
  118. package/src/lib/skill-marketplace.js +345 -0
  119. package/src/lib/sla-manager.js +341 -0
  120. package/src/lib/slot-filler.js +303 -51
  121. package/src/lib/social-graph-analytics.js +295 -49
  122. package/src/lib/social-graph.js +272 -49
  123. package/src/lib/stress-tester.js +342 -0
  124. package/src/lib/sub-agent-registry.js +302 -53
  125. package/src/lib/task-model-selector.js +302 -50
  126. package/src/lib/terraform-manager.js +333 -0
  127. package/src/lib/todo-manager.js +281 -47
  128. package/src/lib/token-incentive.js +341 -0
  129. package/src/lib/topic-classifier.js +297 -49
  130. package/src/lib/user-profile.js +294 -50
  131. package/src/lib/version-checker.js +304 -50
  132. package/src/lib/web-fetch.js +292 -51
  133. package/src/lib/zkp-engine.js +286 -49
@@ -6,40 +6,149 @@
6
6
  */
7
7
 
8
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,
9
+ USER_PROFILE_MATURITY_V2,
10
+ USER_PREF_LIFECYCLE_V2,
11
+ setMaxActiveUserProfilesPerOwnerV2,
12
+ getMaxActiveUserProfilesPerOwnerV2,
13
+ setMaxPendingUserPrefsPerProfileV2,
14
+ getMaxPendingUserPrefsPerProfileV2,
15
+ setUserProfileIdleMsV2,
16
+ getUserProfileIdleMsV2,
17
+ setUserPrefStuckMsV2,
18
+ getUserPrefStuckMsV2,
19
+ registerUserProfileV2,
20
+ activateUserProfileV2,
21
+ dormantUserProfileV2,
22
+ archiveUserProfileV2,
23
+ touchUserProfileV2,
24
+ getUserProfileV2,
25
+ listUserProfilesV2,
26
+ createUserPrefV2,
27
+ applyUserPrefV2,
28
+ rejectUserPrefV2,
29
+ supersedeUserPrefV2,
30
+ cancelUserPrefV2,
31
+ getUserPrefV2,
32
+ listUserPrefsV2,
33
+ autoDormantIdleUserProfilesV2,
34
+ autoCancelStaleUserPrefsV2,
35
+ getUserProfileGovStatsV2,
36
+ _resetStateUserProfileV2,
17
37
  } from "../lib/user-profile.js";
18
38
 
19
39
  export function registerUprofCommand(program) {
20
40
  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)); });
41
+ up.command("enums-v2").action(() =>
42
+ console.log(
43
+ JSON.stringify(
44
+ {
45
+ profileMaturity: USER_PROFILE_MATURITY_V2,
46
+ prefLifecycle: USER_PREF_LIFECYCLE_V2,
47
+ },
48
+ null,
49
+ 2,
50
+ ),
51
+ ),
52
+ );
53
+ up.command("config-v2").action(() =>
54
+ console.log(
55
+ JSON.stringify(
56
+ {
57
+ maxActiveUserProfilesPerOwner: getMaxActiveUserProfilesPerOwnerV2(),
58
+ maxPendingUserPrefsPerProfile: getMaxPendingUserPrefsPerProfileV2(),
59
+ userProfileIdleMs: getUserProfileIdleMsV2(),
60
+ userPrefStuckMs: getUserPrefStuckMsV2(),
61
+ },
62
+ null,
63
+ 2,
64
+ ),
65
+ ),
66
+ );
67
+ up.command("set-max-active-v2 <n>").action((n) => {
68
+ setMaxActiveUserProfilesPerOwnerV2(Number(n));
69
+ console.log("ok");
70
+ });
71
+ up.command("set-max-pending-v2 <n>").action((n) => {
72
+ setMaxPendingUserPrefsPerProfileV2(Number(n));
73
+ console.log("ok");
74
+ });
75
+ up.command("set-idle-ms-v2 <n>").action((n) => {
76
+ setUserProfileIdleMsV2(Number(n));
77
+ console.log("ok");
78
+ });
79
+ up.command("set-stuck-ms-v2 <n>").action((n) => {
80
+ setUserPrefStuckMsV2(Number(n));
81
+ console.log("ok");
82
+ });
83
+ up.command("register-profile-v2 <id> <owner>")
84
+ .option("--handle <h>", "handle")
85
+ .action((id, owner, o) =>
86
+ console.log(
87
+ JSON.stringify(
88
+ registerUserProfileV2({ id, owner, handle: o.handle }),
89
+ null,
90
+ 2,
91
+ ),
92
+ ),
93
+ );
94
+ up.command("activate-profile-v2 <id>").action((id) =>
95
+ console.log(JSON.stringify(activateUserProfileV2(id), null, 2)),
96
+ );
97
+ up.command("dormant-profile-v2 <id>").action((id) =>
98
+ console.log(JSON.stringify(dormantUserProfileV2(id), null, 2)),
99
+ );
100
+ up.command("archive-profile-v2 <id>").action((id) =>
101
+ console.log(JSON.stringify(archiveUserProfileV2(id), null, 2)),
102
+ );
103
+ up.command("touch-profile-v2 <id>").action((id) =>
104
+ console.log(JSON.stringify(touchUserProfileV2(id), null, 2)),
105
+ );
106
+ up.command("get-profile-v2 <id>").action((id) =>
107
+ console.log(JSON.stringify(getUserProfileV2(id), null, 2)),
108
+ );
109
+ up.command("list-profiles-v2").action(() =>
110
+ console.log(JSON.stringify(listUserProfilesV2(), null, 2)),
111
+ );
112
+ up.command("create-pref-v2 <id> <profileId>")
113
+ .option("--key <k>", "key")
114
+ .action((id, profileId, o) =>
115
+ console.log(
116
+ JSON.stringify(
117
+ createUserPrefV2({ id, profileId, key: o.key }),
118
+ null,
119
+ 2,
120
+ ),
121
+ ),
122
+ );
123
+ up.command("apply-pref-v2 <id>").action((id) =>
124
+ console.log(JSON.stringify(applyUserPrefV2(id), null, 2)),
125
+ );
126
+ up.command("reject-pref-v2 <id> [reason]").action((id, reason) =>
127
+ console.log(JSON.stringify(rejectUserPrefV2(id, reason), null, 2)),
128
+ );
129
+ up.command("supersede-pref-v2 <id>").action((id) =>
130
+ console.log(JSON.stringify(supersedeUserPrefV2(id), null, 2)),
131
+ );
132
+ up.command("cancel-pref-v2 <id> [reason]").action((id, reason) =>
133
+ console.log(JSON.stringify(cancelUserPrefV2(id, reason), null, 2)),
134
+ );
135
+ up.command("get-pref-v2 <id>").action((id) =>
136
+ console.log(JSON.stringify(getUserPrefV2(id), null, 2)),
137
+ );
138
+ up.command("list-prefs-v2").action(() =>
139
+ console.log(JSON.stringify(listUserPrefsV2(), null, 2)),
140
+ );
141
+ up.command("auto-dormant-idle-v2").action(() =>
142
+ console.log(JSON.stringify(autoDormantIdleUserProfilesV2(), null, 2)),
143
+ );
144
+ up.command("auto-cancel-stale-v2").action(() =>
145
+ console.log(JSON.stringify(autoCancelStaleUserPrefsV2(), null, 2)),
146
+ );
147
+ up.command("gov-stats-v2").action(() =>
148
+ console.log(JSON.stringify(getUserProfileGovStatsV2(), null, 2)),
149
+ );
150
+ up.command("reset-state-v2").action(() => {
151
+ _resetStateUserProfileV2();
152
+ console.log(JSON.stringify({ ok: true }, null, 2));
153
+ });
45
154
  }
@@ -37,42 +37,136 @@ export function registerVcheckCommand(program) {
37
37
  .command("vcheck")
38
38
  .description("Version Checker V2 governance (in-memory, CLI v0.143.0)");
39
39
 
40
- v.command("enums-v2").action(() => console.log(JSON.stringify({ VCHK_PROFILE_MATURITY_V2, VCHK_CHECK_LIFECYCLE_V2 }, null, 2)));
40
+ v.command("enums-v2").action(() =>
41
+ console.log(
42
+ JSON.stringify(
43
+ { VCHK_PROFILE_MATURITY_V2, VCHK_CHECK_LIFECYCLE_V2 },
44
+ null,
45
+ 2,
46
+ ),
47
+ ),
48
+ );
41
49
  v.command("register-profile-v2")
42
50
  .requiredOption("--id <id>")
43
51
  .requiredOption("--owner <owner>")
44
52
  .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)));
53
+ .action((o) =>
54
+ console.log(JSON.stringify(registerVchkProfileV2(o), null, 2)),
55
+ );
56
+ v.command("activate-profile-v2 <id>").action((id) =>
57
+ console.log(JSON.stringify(activateVchkProfileV2(id), null, 2)),
58
+ );
59
+ v.command("stale-profile-v2 <id>").action((id) =>
60
+ console.log(JSON.stringify(staleVchkProfileV2(id), null, 2)),
61
+ );
62
+ v.command("archive-profile-v2 <id>").action((id) =>
63
+ console.log(JSON.stringify(archiveVchkProfileV2(id), null, 2)),
64
+ );
65
+ v.command("touch-profile-v2 <id>").action((id) =>
66
+ console.log(JSON.stringify(touchVchkProfileV2(id), null, 2)),
67
+ );
68
+ v.command("get-profile-v2 <id>").action((id) =>
69
+ console.log(JSON.stringify(getVchkProfileV2(id), null, 2)),
70
+ );
71
+ v.command("list-profiles-v2").action(() =>
72
+ console.log(JSON.stringify(listVchkProfilesV2(), null, 2)),
73
+ );
52
74
 
53
75
  v.command("create-check-v2")
54
76
  .requiredOption("--id <id>")
55
77
  .requiredOption("--profile-id <profileId>")
56
78
  .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)));
79
+ .action((o) =>
80
+ console.log(
81
+ JSON.stringify(
82
+ createVchkCheckV2({
83
+ id: o.id,
84
+ profileId: o.profileId,
85
+ currentVersion: o.currentVersion,
86
+ }),
87
+ null,
88
+ 2,
89
+ ),
90
+ ),
91
+ );
92
+ v.command("checking-check-v2 <id>").action((id) =>
93
+ console.log(JSON.stringify(checkingVchkCheckV2(id), null, 2)),
94
+ );
95
+ v.command("complete-check-v2 <id>").action((id) =>
96
+ console.log(JSON.stringify(completeVchkCheckV2(id), null, 2)),
97
+ );
98
+ v.command("fail-check-v2 <id>")
99
+ .option("--reason <r>")
100
+ .action((id, o) =>
101
+ console.log(JSON.stringify(failVchkCheckV2(id, o.reason), null, 2)),
102
+ );
103
+ v.command("cancel-check-v2 <id>")
104
+ .option("--reason <r>")
105
+ .action((id, o) =>
106
+ console.log(JSON.stringify(cancelVchkCheckV2(id, o.reason), null, 2)),
107
+ );
108
+ v.command("get-check-v2 <id>").action((id) =>
109
+ console.log(JSON.stringify(getVchkCheckV2(id), null, 2)),
110
+ );
111
+ v.command("list-checks-v2").action(() =>
112
+ console.log(JSON.stringify(listVchkChecksV2(), null, 2)),
113
+ );
64
114
 
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)));
115
+ v.command("config-v2").action(() =>
116
+ console.log(
117
+ JSON.stringify(
118
+ {
119
+ maxActiveVchkProfilesPerOwner: getMaxActiveVchkProfilesPerOwnerV2(),
120
+ maxPendingVchkChecksPerProfile: getMaxPendingVchkChecksPerProfileV2(),
121
+ vchkProfileIdleMs: getVchkProfileIdleMsV2(),
122
+ vchkCheckStuckMs: getVchkCheckStuckMsV2(),
123
+ },
124
+ null,
125
+ 2,
126
+ ),
127
+ ),
128
+ );
129
+ v.command("set-max-active-profiles-v2 <n>").action((n) => {
130
+ setMaxActiveVchkProfilesPerOwnerV2(Number(n));
131
+ console.log(
132
+ JSON.stringify(
133
+ { maxActiveVchkProfilesPerOwner: getMaxActiveVchkProfilesPerOwnerV2() },
134
+ null,
135
+ 2,
136
+ ),
137
+ );
138
+ });
139
+ v.command("set-max-pending-checks-v2 <n>").action((n) => {
140
+ setMaxPendingVchkChecksPerProfileV2(Number(n));
141
+ console.log(
142
+ JSON.stringify(
143
+ {
144
+ maxPendingVchkChecksPerProfile: getMaxPendingVchkChecksPerProfileV2(),
145
+ },
146
+ null,
147
+ 2,
148
+ ),
149
+ );
150
+ });
151
+ v.command("set-profile-idle-ms-v2 <ms>").action((ms) => {
152
+ setVchkProfileIdleMsV2(Number(ms));
153
+ console.log(
154
+ JSON.stringify({ vchkProfileIdleMs: getVchkProfileIdleMsV2() }, null, 2),
155
+ );
156
+ });
157
+ v.command("set-check-stuck-ms-v2 <ms>").action((ms) => {
158
+ setVchkCheckStuckMsV2(Number(ms));
159
+ console.log(
160
+ JSON.stringify({ vchkCheckStuckMs: getVchkCheckStuckMsV2() }, null, 2),
161
+ );
162
+ });
163
+ v.command("auto-stale-idle-v2").action(() =>
164
+ console.log(JSON.stringify(autoStaleIdleVchkProfilesV2(), null, 2)),
165
+ );
166
+ v.command("auto-fail-stuck-v2").action(() =>
167
+ console.log(JSON.stringify(autoFailStuckVchkChecksV2(), null, 2)),
168
+ );
169
+ v.command("gov-stats-v2").action(() =>
170
+ console.log(JSON.stringify(getVersionCheckerGovStatsV2(), null, 2)),
171
+ );
78
172
  }
@@ -2,40 +2,149 @@
2
2
  * `cc webfetch` — Web Fetch V2 governance overlay (in-memory, atop lib/web-fetch.js).
3
3
  */
4
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,
5
+ WFET_TARGET_MATURITY_V2,
6
+ WFET_JOB_LIFECYCLE_V2,
7
+ setMaxActiveWfetTargetsPerOwnerV2,
8
+ getMaxActiveWfetTargetsPerOwnerV2,
9
+ setMaxPendingWfetJobsPerTargetV2,
10
+ getMaxPendingWfetJobsPerTargetV2,
11
+ setWfetTargetIdleMsV2,
12
+ getWfetTargetIdleMsV2,
13
+ setWfetJobStuckMsV2,
14
+ getWfetJobStuckMsV2,
15
+ registerWfetTargetV2,
16
+ activateWfetTargetV2,
17
+ degradeWfetTargetV2,
18
+ retireWfetTargetV2,
19
+ touchWfetTargetV2,
20
+ getWfetTargetV2,
21
+ listWfetTargetsV2,
22
+ createWfetJobV2,
23
+ fetchingWfetJobV2,
24
+ succeedWfetJobV2,
25
+ failWfetJobV2,
26
+ cancelWfetJobV2,
27
+ getWfetJobV2,
28
+ listWfetJobsV2,
29
+ autoDegradeIdleWfetTargetsV2,
30
+ autoFailStuckWfetJobsV2,
31
+ getWebFetchGovStatsV2,
32
+ _resetStateWebFetchV2,
13
33
  } from "../lib/web-fetch.js";
14
34
 
15
35
  export function registerWebfetchCommand(program) {
16
36
  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)); });
37
+ wf.command("enums-v2").action(() =>
38
+ console.log(
39
+ JSON.stringify(
40
+ {
41
+ targetMaturity: WFET_TARGET_MATURITY_V2,
42
+ jobLifecycle: WFET_JOB_LIFECYCLE_V2,
43
+ },
44
+ null,
45
+ 2,
46
+ ),
47
+ ),
48
+ );
49
+ wf.command("config-v2").action(() =>
50
+ console.log(
51
+ JSON.stringify(
52
+ {
53
+ maxActiveWfetTargetsPerOwner: getMaxActiveWfetTargetsPerOwnerV2(),
54
+ maxPendingWfetJobsPerTarget: getMaxPendingWfetJobsPerTargetV2(),
55
+ wfetTargetIdleMs: getWfetTargetIdleMsV2(),
56
+ wfetJobStuckMs: getWfetJobStuckMsV2(),
57
+ },
58
+ null,
59
+ 2,
60
+ ),
61
+ ),
62
+ );
63
+ wf.command("set-max-active-v2 <n>").action((n) => {
64
+ setMaxActiveWfetTargetsPerOwnerV2(Number(n));
65
+ console.log("ok");
66
+ });
67
+ wf.command("set-max-pending-v2 <n>").action((n) => {
68
+ setMaxPendingWfetJobsPerTargetV2(Number(n));
69
+ console.log("ok");
70
+ });
71
+ wf.command("set-idle-ms-v2 <n>").action((n) => {
72
+ setWfetTargetIdleMsV2(Number(n));
73
+ console.log("ok");
74
+ });
75
+ wf.command("set-stuck-ms-v2 <n>").action((n) => {
76
+ setWfetJobStuckMsV2(Number(n));
77
+ console.log("ok");
78
+ });
79
+ wf.command("register-target-v2 <id> <owner>")
80
+ .option("--baseUrl <u>", "baseUrl")
81
+ .action((id, owner, o) =>
82
+ console.log(
83
+ JSON.stringify(
84
+ registerWfetTargetV2({ id, owner, baseUrl: o.baseUrl }),
85
+ null,
86
+ 2,
87
+ ),
88
+ ),
89
+ );
90
+ wf.command("activate-target-v2 <id>").action((id) =>
91
+ console.log(JSON.stringify(activateWfetTargetV2(id), null, 2)),
92
+ );
93
+ wf.command("degrade-target-v2 <id>").action((id) =>
94
+ console.log(JSON.stringify(degradeWfetTargetV2(id), null, 2)),
95
+ );
96
+ wf.command("retire-target-v2 <id>").action((id) =>
97
+ console.log(JSON.stringify(retireWfetTargetV2(id), null, 2)),
98
+ );
99
+ wf.command("touch-target-v2 <id>").action((id) =>
100
+ console.log(JSON.stringify(touchWfetTargetV2(id), null, 2)),
101
+ );
102
+ wf.command("get-target-v2 <id>").action((id) =>
103
+ console.log(JSON.stringify(getWfetTargetV2(id), null, 2)),
104
+ );
105
+ wf.command("list-targets-v2").action(() =>
106
+ console.log(JSON.stringify(listWfetTargetsV2(), null, 2)),
107
+ );
108
+ wf.command("create-job-v2 <id> <targetId>")
109
+ .option("--kind <k>", "kind", "GET")
110
+ .action((id, targetId, o) =>
111
+ console.log(
112
+ JSON.stringify(
113
+ createWfetJobV2({ id, targetId, kind: o.kind }),
114
+ null,
115
+ 2,
116
+ ),
117
+ ),
118
+ );
119
+ wf.command("fetching-job-v2 <id>").action((id) =>
120
+ console.log(JSON.stringify(fetchingWfetJobV2(id), null, 2)),
121
+ );
122
+ wf.command("succeed-job-v2 <id>").action((id) =>
123
+ console.log(JSON.stringify(succeedWfetJobV2(id), null, 2)),
124
+ );
125
+ wf.command("fail-job-v2 <id> [reason]").action((id, reason) =>
126
+ console.log(JSON.stringify(failWfetJobV2(id, reason), null, 2)),
127
+ );
128
+ wf.command("cancel-job-v2 <id> [reason]").action((id, reason) =>
129
+ console.log(JSON.stringify(cancelWfetJobV2(id, reason), null, 2)),
130
+ );
131
+ wf.command("get-job-v2 <id>").action((id) =>
132
+ console.log(JSON.stringify(getWfetJobV2(id), null, 2)),
133
+ );
134
+ wf.command("list-jobs-v2").action(() =>
135
+ console.log(JSON.stringify(listWfetJobsV2(), null, 2)),
136
+ );
137
+ wf.command("auto-degrade-idle-v2").action(() =>
138
+ console.log(JSON.stringify(autoDegradeIdleWfetTargetsV2(), null, 2)),
139
+ );
140
+ wf.command("auto-fail-stuck-v2").action(() =>
141
+ console.log(JSON.stringify(autoFailStuckWfetJobsV2(), null, 2)),
142
+ );
143
+ wf.command("gov-stats-v2").action(() =>
144
+ console.log(JSON.stringify(getWebFetchGovStatsV2(), null, 2)),
145
+ );
146
+ wf.command("reset-state-v2").action(() => {
147
+ _resetStateWebFetchV2();
148
+ console.log(JSON.stringify({ ok: true }, null, 2));
149
+ });
41
150
  }