chainlesschain 0.143.0 → 0.152.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 (227) hide show
  1. package/package.json +1 -1
  2. package/src/commands/a2a.js +196 -28
  3. package/src/commands/activitypub.js +364 -27
  4. package/src/commands/agent-network.js +217 -0
  5. package/src/commands/agent.js +587 -103
  6. package/src/commands/audit.js +206 -0
  7. package/src/commands/automation.js +201 -0
  8. package/src/commands/bi.js +355 -27
  9. package/src/commands/bm25.js +111 -27
  10. package/src/commands/browse.js +403 -29
  11. package/src/commands/ccron.js +128 -28
  12. package/src/commands/chat.js +207 -0
  13. package/src/commands/codegen.js +207 -0
  14. package/src/commands/collab.js +211 -0
  15. package/src/commands/compliance.js +824 -34
  16. package/src/commands/compt.js +127 -29
  17. package/src/commands/consol.js +8 -2
  18. package/src/commands/cowork.js +783 -34
  19. package/src/commands/crosschain.js +182 -28
  20. package/src/commands/dao.js +182 -28
  21. package/src/commands/dbevo.js +227 -0
  22. package/src/commands/dev.js +207 -0
  23. package/src/commands/did-v2.js +217 -0
  24. package/src/commands/did.js +221 -0
  25. package/src/commands/dlp.js +385 -27
  26. package/src/commands/economy.js +205 -50
  27. package/src/commands/evolution.js +203 -50
  28. package/src/commands/evomap.js +387 -27
  29. package/src/commands/export.js +213 -0
  30. package/src/commands/federation.js +209 -0
  31. package/src/commands/fflag.js +74 -22
  32. package/src/commands/fusion.js +205 -0
  33. package/src/commands/git.js +177 -37
  34. package/src/commands/governance.js +209 -0
  35. package/src/commands/hardening.js +209 -0
  36. package/src/commands/hmemory.js +204 -50
  37. package/src/commands/hook.js +209 -0
  38. package/src/commands/import.js +209 -0
  39. package/src/commands/incentive.js +209 -0
  40. package/src/commands/inference.js +170 -34
  41. package/src/commands/infra.js +203 -0
  42. package/src/commands/instinct.js +209 -0
  43. package/src/commands/ipfs.js +207 -0
  44. package/src/commands/itbudget.js +149 -33
  45. package/src/commands/kg.js +206 -0
  46. package/src/commands/llm.js +217 -0
  47. package/src/commands/lowcode.js +195 -38
  48. package/src/commands/marketplace.js +206 -0
  49. package/src/commands/matrix.js +386 -27
  50. package/src/commands/mcp.js +217 -0
  51. package/src/commands/mcpscaf.js +145 -33
  52. package/src/commands/meminj.js +145 -33
  53. package/src/commands/memory.js +209 -0
  54. package/src/commands/multimodal.js +203 -0
  55. package/src/commands/nlprog.js +225 -0
  56. package/src/commands/nostr.js +387 -27
  57. package/src/commands/note.js +205 -0
  58. package/src/commands/ops.js +219 -0
  59. package/src/commands/orchestrate.js +217 -0
  60. package/src/commands/orchgov.js +144 -33
  61. package/src/commands/org.js +209 -0
  62. package/src/commands/p2p.js +209 -0
  63. package/src/commands/pdfp.js +109 -27
  64. package/src/commands/perception.js +209 -0
  65. package/src/commands/perf.js +169 -32
  66. package/src/commands/perm.js +144 -33
  67. package/src/commands/permmem.js +203 -0
  68. package/src/commands/pipeline.js +207 -52
  69. package/src/commands/planmode.js +141 -32
  70. package/src/commands/plugin-ecosystem.js +209 -0
  71. package/src/commands/pqc.js +213 -0
  72. package/src/commands/privacy.js +203 -0
  73. package/src/commands/promcomp.js +111 -27
  74. package/src/commands/quantization.js +207 -0
  75. package/src/commands/rcache.js +205 -0
  76. package/src/commands/recommend.js +410 -34
  77. package/src/commands/reputation.js +208 -0
  78. package/src/commands/runtime.js +205 -0
  79. package/src/commands/sandbox.js +206 -0
  80. package/src/commands/scim.js +209 -0
  81. package/src/commands/seshhook.js +145 -33
  82. package/src/commands/seshsearch.js +141 -33
  83. package/src/commands/seshtail.js +144 -33
  84. package/src/commands/seshu.js +152 -33
  85. package/src/commands/session.js +209 -0
  86. package/src/commands/sganal.js +123 -29
  87. package/src/commands/siem.js +201 -34
  88. package/src/commands/skill.js +207 -0
  89. package/src/commands/sla.js +212 -0
  90. package/src/commands/slotfill.js +146 -33
  91. package/src/commands/social.js +358 -32
  92. package/src/commands/sso.js +209 -0
  93. package/src/commands/stress.js +206 -0
  94. package/src/commands/svccont.js +145 -33
  95. package/src/commands/sync.js +209 -0
  96. package/src/commands/tech.js +209 -0
  97. package/src/commands/tenant.js +217 -0
  98. package/src/commands/terraform.js +206 -0
  99. package/src/commands/tms.js +171 -33
  100. package/src/commands/tokens.js +209 -0
  101. package/src/commands/topiccls.js +146 -33
  102. package/src/commands/trust.js +217 -0
  103. package/src/commands/uprof.js +141 -32
  104. package/src/commands/vcheck.js +122 -28
  105. package/src/commands/wallet.js +209 -0
  106. package/src/commands/webfetch.js +141 -32
  107. package/src/commands/workflow.js +203 -0
  108. package/src/commands/zkp.js +184 -28
  109. package/src/index.js +180 -0
  110. package/src/lib/a2a-protocol.js +319 -51
  111. package/src/lib/activitypub-bridge.js +622 -50
  112. package/src/lib/agent-economy.js +304 -51
  113. package/src/lib/agent-network.js +341 -0
  114. package/src/lib/aiops.js +346 -0
  115. package/src/lib/app-builder.js +279 -46
  116. package/src/lib/audit-logger.js +321 -0
  117. package/src/lib/automation-engine.js +335 -0
  118. package/src/lib/autonomous-agent.js +284 -48
  119. package/src/lib/autonomous-developer.js +332 -0
  120. package/src/lib/bi-engine.js +616 -49
  121. package/src/lib/bm25-search.js +301 -49
  122. package/src/lib/browser-automation.js +630 -49
  123. package/src/lib/chat-core.js +336 -0
  124. package/src/lib/claude-code-bridge.js +341 -0
  125. package/src/lib/code-agent.js +339 -0
  126. package/src/lib/collaboration-governance.js +334 -0
  127. package/src/lib/community-governance.js +346 -0
  128. package/src/lib/compliance-framework-reporter.js +305 -51
  129. package/src/lib/compliance-manager.js +330 -0
  130. package/src/lib/compression-telemetry.js +301 -49
  131. package/src/lib/content-recommendation.js +351 -0
  132. package/src/lib/content-recommender.js +317 -52
  133. package/src/lib/cowork-cron.js +298 -49
  134. package/src/lib/cowork-learning.js +333 -0
  135. package/src/lib/cowork-share.js +338 -0
  136. package/src/lib/cowork-task-runner.js +308 -51
  137. package/src/lib/cowork-workflow.js +327 -0
  138. package/src/lib/cross-chain.js +311 -51
  139. package/src/lib/dao-governance.js +280 -46
  140. package/src/lib/dbevo.js +351 -0
  141. package/src/lib/decentral-infra.js +330 -0
  142. package/src/lib/did-manager.js +341 -0
  143. package/src/lib/did-v2-manager.js +341 -0
  144. package/src/lib/dlp-engine.js +626 -49
  145. package/src/lib/evolution-system.js +278 -47
  146. package/src/lib/evomap-governance.js +334 -0
  147. package/src/lib/evomap-manager.js +280 -46
  148. package/src/lib/execution-backend.js +294 -48
  149. package/src/lib/feature-flags.js +294 -49
  150. package/src/lib/federation-hardening.js +340 -0
  151. package/src/lib/git-integration.js +285 -47
  152. package/src/lib/hardening-manager.js +341 -0
  153. package/src/lib/hierarchical-memory.js +284 -48
  154. package/src/lib/hook-manager.js +341 -0
  155. package/src/lib/inference-network.js +308 -51
  156. package/src/lib/instinct-manager.js +346 -0
  157. package/src/lib/ipfs-storage.js +334 -0
  158. package/src/lib/iteration-budget.js +302 -50
  159. package/src/lib/knowledge-exporter.js +341 -0
  160. package/src/lib/knowledge-graph.js +333 -0
  161. package/src/lib/knowledge-importer.js +341 -0
  162. package/src/lib/llm-providers.js +346 -0
  163. package/src/lib/matrix-bridge.js +620 -47
  164. package/src/lib/mcp-registry.js +346 -0
  165. package/src/lib/mcp-scaffold.js +318 -54
  166. package/src/lib/memory-injection.js +288 -49
  167. package/src/lib/memory-manager.js +336 -0
  168. package/src/lib/multimodal.js +330 -0
  169. package/src/lib/nl-programming.js +341 -0
  170. package/src/lib/nostr-bridge.js +622 -49
  171. package/src/lib/note-versioning.js +339 -0
  172. package/src/lib/orchestrator.js +293 -48
  173. package/src/lib/org-manager.js +336 -0
  174. package/src/lib/p2p-manager.js +341 -0
  175. package/src/lib/pdf-parser.js +298 -49
  176. package/src/lib/perception.js +346 -0
  177. package/src/lib/perf-tuning.js +309 -50
  178. package/src/lib/permanent-memory.js +327 -0
  179. package/src/lib/permission-engine.js +287 -49
  180. package/src/lib/pipeline-orchestrator.js +289 -49
  181. package/src/lib/plan-mode.js +298 -51
  182. package/src/lib/plugin-ecosystem.js +346 -0
  183. package/src/lib/pqc-manager.js +346 -0
  184. package/src/lib/privacy-computing.js +335 -0
  185. package/src/lib/protocol-fusion.js +338 -0
  186. package/src/lib/quantization.js +337 -0
  187. package/src/lib/reputation-optimizer.js +340 -0
  188. package/src/lib/response-cache.js +333 -0
  189. package/src/lib/sandbox-v2.js +327 -0
  190. package/src/lib/scim-manager.js +346 -0
  191. package/src/lib/service-container.js +313 -52
  192. package/src/lib/session-consolidator.js +296 -49
  193. package/src/lib/session-hooks.js +312 -53
  194. package/src/lib/session-manager.js +334 -0
  195. package/src/lib/session-search.js +304 -51
  196. package/src/lib/session-tail.js +288 -49
  197. package/src/lib/session-usage.js +298 -52
  198. package/src/lib/siem-exporter.js +298 -51
  199. package/src/lib/skill-loader.js +334 -0
  200. package/src/lib/skill-marketplace.js +345 -0
  201. package/src/lib/sla-manager.js +341 -0
  202. package/src/lib/slot-filler.js +303 -51
  203. package/src/lib/social-graph-analytics.js +295 -49
  204. package/src/lib/social-graph.js +272 -49
  205. package/src/lib/social-manager.js +330 -0
  206. package/src/lib/sso-manager.js +340 -0
  207. package/src/lib/stress-tester.js +342 -0
  208. package/src/lib/sub-agent-registry.js +302 -53
  209. package/src/lib/sync-manager.js +336 -0
  210. package/src/lib/task-model-selector.js +302 -50
  211. package/src/lib/tech-learning-engine.js +341 -0
  212. package/src/lib/tenant-saas.js +341 -0
  213. package/src/lib/terraform-manager.js +333 -0
  214. package/src/lib/threat-intel.js +330 -0
  215. package/src/lib/todo-manager.js +281 -47
  216. package/src/lib/token-incentive.js +341 -0
  217. package/src/lib/token-tracker.js +336 -0
  218. package/src/lib/topic-classifier.js +297 -49
  219. package/src/lib/trust-security.js +343 -0
  220. package/src/lib/ueba.js +340 -0
  221. package/src/lib/universal-runtime.js +330 -0
  222. package/src/lib/user-profile.js +294 -50
  223. package/src/lib/version-checker.js +304 -50
  224. package/src/lib/wallet-manager.js +336 -0
  225. package/src/lib/web-fetch.js +292 -51
  226. package/src/lib/workflow-engine.js +330 -0
  227. package/src/lib/zkp-engine.js +286 -49
@@ -2,40 +2,152 @@
2
2
  * `cc seshhook` — Session Hooks V2 governance overlay (in-memory, atop lib/session-hooks.js).
3
3
  */
4
4
  import {
5
- SHOK_PROFILE_MATURITY_V2, SHOK_INVOCATION_LIFECYCLE_V2,
6
- setMaxActiveShokProfilesPerOwnerV2, getMaxActiveShokProfilesPerOwnerV2,
7
- setMaxPendingShokInvocationsPerProfileV2, getMaxPendingShokInvocationsPerProfileV2,
8
- setShokProfileIdleMsV2, getShokProfileIdleMsV2,
9
- setShokInvocationStuckMsV2, getShokInvocationStuckMsV2,
10
- registerShokProfileV2, activateShokProfileV2, disableShokProfileV2, retireShokProfileV2, touchShokProfileV2, getShokProfileV2, listShokProfilesV2,
11
- createShokInvocationV2, runningShokInvocationV2, completeShokInvocationV2, failShokInvocationV2, cancelShokInvocationV2, getShokInvocationV2, listShokInvocationsV2,
12
- autoDisableIdleShokProfilesV2, autoFailStuckShokInvocationsV2, getSessionHooksGovStatsV2, _resetStateSessionHooksV2,
5
+ SHOK_PROFILE_MATURITY_V2,
6
+ SHOK_INVOCATION_LIFECYCLE_V2,
7
+ setMaxActiveShokProfilesPerOwnerV2,
8
+ getMaxActiveShokProfilesPerOwnerV2,
9
+ setMaxPendingShokInvocationsPerProfileV2,
10
+ getMaxPendingShokInvocationsPerProfileV2,
11
+ setShokProfileIdleMsV2,
12
+ getShokProfileIdleMsV2,
13
+ setShokInvocationStuckMsV2,
14
+ getShokInvocationStuckMsV2,
15
+ registerShokProfileV2,
16
+ activateShokProfileV2,
17
+ disableShokProfileV2,
18
+ retireShokProfileV2,
19
+ touchShokProfileV2,
20
+ getShokProfileV2,
21
+ listShokProfilesV2,
22
+ createShokInvocationV2,
23
+ runningShokInvocationV2,
24
+ completeShokInvocationV2,
25
+ failShokInvocationV2,
26
+ cancelShokInvocationV2,
27
+ getShokInvocationV2,
28
+ listShokInvocationsV2,
29
+ autoDisableIdleShokProfilesV2,
30
+ autoFailStuckShokInvocationsV2,
31
+ getSessionHooksGovStatsV2,
32
+ _resetStateSessionHooksV2,
13
33
  } from "../lib/session-hooks.js";
14
34
 
15
35
  export function registerSeshhookCommand(program) {
16
- const sh = program.command("seshhook").description("Session Hooks V2 governance");
17
- sh.command("enums-v2").action(() => console.log(JSON.stringify({ profileMaturity: SHOK_PROFILE_MATURITY_V2, invocationLifecycle: SHOK_INVOCATION_LIFECYCLE_V2 }, null, 2)));
18
- sh.command("config-v2").action(() => console.log(JSON.stringify({ maxActiveShokProfilesPerOwner: getMaxActiveShokProfilesPerOwnerV2(), maxPendingShokInvocationsPerProfile: getMaxPendingShokInvocationsPerProfileV2(), shokProfileIdleMs: getShokProfileIdleMsV2(), shokInvocationStuckMs: getShokInvocationStuckMsV2() }, null, 2)));
19
- sh.command("set-max-active-v2 <n>").action((n) => { setMaxActiveShokProfilesPerOwnerV2(Number(n)); console.log("ok"); });
20
- sh.command("set-max-pending-v2 <n>").action((n) => { setMaxPendingShokInvocationsPerProfileV2(Number(n)); console.log("ok"); });
21
- sh.command("set-idle-ms-v2 <n>").action((n) => { setShokProfileIdleMsV2(Number(n)); console.log("ok"); });
22
- sh.command("set-stuck-ms-v2 <n>").action((n) => { setShokInvocationStuckMsV2(Number(n)); console.log("ok"); });
23
- sh.command("register-profile-v2 <id> <owner>").option("--event <e>", "event").action((id, owner, o) => console.log(JSON.stringify(registerShokProfileV2({ id, owner, event: o.event }), null, 2)));
24
- sh.command("activate-profile-v2 <id>").action((id) => console.log(JSON.stringify(activateShokProfileV2(id), null, 2)));
25
- sh.command("disable-profile-v2 <id>").action((id) => console.log(JSON.stringify(disableShokProfileV2(id), null, 2)));
26
- sh.command("retire-profile-v2 <id>").action((id) => console.log(JSON.stringify(retireShokProfileV2(id), null, 2)));
27
- sh.command("touch-profile-v2 <id>").action((id) => console.log(JSON.stringify(touchShokProfileV2(id), null, 2)));
28
- sh.command("get-profile-v2 <id>").action((id) => console.log(JSON.stringify(getShokProfileV2(id), null, 2)));
29
- sh.command("list-profiles-v2").action(() => console.log(JSON.stringify(listShokProfilesV2(), null, 2)));
30
- sh.command("create-invocation-v2 <id> <profileId>").option("--payload <p>", "payload").action((id, profileId, o) => console.log(JSON.stringify(createShokInvocationV2({ id, profileId, payload: o.payload }), null, 2)));
31
- sh.command("running-invocation-v2 <id>").action((id) => console.log(JSON.stringify(runningShokInvocationV2(id), null, 2)));
32
- sh.command("complete-invocation-v2 <id>").action((id) => console.log(JSON.stringify(completeShokInvocationV2(id), null, 2)));
33
- sh.command("fail-invocation-v2 <id> [reason]").action((id, reason) => console.log(JSON.stringify(failShokInvocationV2(id, reason), null, 2)));
34
- sh.command("cancel-invocation-v2 <id> [reason]").action((id, reason) => console.log(JSON.stringify(cancelShokInvocationV2(id, reason), null, 2)));
35
- sh.command("get-invocation-v2 <id>").action((id) => console.log(JSON.stringify(getShokInvocationV2(id), null, 2)));
36
- sh.command("list-invocations-v2").action(() => console.log(JSON.stringify(listShokInvocationsV2(), null, 2)));
37
- sh.command("auto-disable-idle-v2").action(() => console.log(JSON.stringify(autoDisableIdleShokProfilesV2(), null, 2)));
38
- sh.command("auto-fail-stuck-v2").action(() => console.log(JSON.stringify(autoFailStuckShokInvocationsV2(), null, 2)));
39
- sh.command("gov-stats-v2").action(() => console.log(JSON.stringify(getSessionHooksGovStatsV2(), null, 2)));
40
- sh.command("reset-state-v2").action(() => { _resetStateSessionHooksV2(); console.log(JSON.stringify({ ok: true }, null, 2)); });
36
+ const sh = program
37
+ .command("seshhook")
38
+ .description("Session Hooks V2 governance");
39
+ sh.command("enums-v2").action(() =>
40
+ console.log(
41
+ JSON.stringify(
42
+ {
43
+ profileMaturity: SHOK_PROFILE_MATURITY_V2,
44
+ invocationLifecycle: SHOK_INVOCATION_LIFECYCLE_V2,
45
+ },
46
+ null,
47
+ 2,
48
+ ),
49
+ ),
50
+ );
51
+ sh.command("config-v2").action(() =>
52
+ console.log(
53
+ JSON.stringify(
54
+ {
55
+ maxActiveShokProfilesPerOwner: getMaxActiveShokProfilesPerOwnerV2(),
56
+ maxPendingShokInvocationsPerProfile:
57
+ getMaxPendingShokInvocationsPerProfileV2(),
58
+ shokProfileIdleMs: getShokProfileIdleMsV2(),
59
+ shokInvocationStuckMs: getShokInvocationStuckMsV2(),
60
+ },
61
+ null,
62
+ 2,
63
+ ),
64
+ ),
65
+ );
66
+ sh.command("set-max-active-v2 <n>").action((n) => {
67
+ setMaxActiveShokProfilesPerOwnerV2(Number(n));
68
+ console.log("ok");
69
+ });
70
+ sh.command("set-max-pending-v2 <n>").action((n) => {
71
+ setMaxPendingShokInvocationsPerProfileV2(Number(n));
72
+ console.log("ok");
73
+ });
74
+ sh.command("set-idle-ms-v2 <n>").action((n) => {
75
+ setShokProfileIdleMsV2(Number(n));
76
+ console.log("ok");
77
+ });
78
+ sh.command("set-stuck-ms-v2 <n>").action((n) => {
79
+ setShokInvocationStuckMsV2(Number(n));
80
+ console.log("ok");
81
+ });
82
+ sh.command("register-profile-v2 <id> <owner>")
83
+ .option("--event <e>", "event")
84
+ .action((id, owner, o) =>
85
+ console.log(
86
+ JSON.stringify(
87
+ registerShokProfileV2({ id, owner, event: o.event }),
88
+ null,
89
+ 2,
90
+ ),
91
+ ),
92
+ );
93
+ sh.command("activate-profile-v2 <id>").action((id) =>
94
+ console.log(JSON.stringify(activateShokProfileV2(id), null, 2)),
95
+ );
96
+ sh.command("disable-profile-v2 <id>").action((id) =>
97
+ console.log(JSON.stringify(disableShokProfileV2(id), null, 2)),
98
+ );
99
+ sh.command("retire-profile-v2 <id>").action((id) =>
100
+ console.log(JSON.stringify(retireShokProfileV2(id), null, 2)),
101
+ );
102
+ sh.command("touch-profile-v2 <id>").action((id) =>
103
+ console.log(JSON.stringify(touchShokProfileV2(id), null, 2)),
104
+ );
105
+ sh.command("get-profile-v2 <id>").action((id) =>
106
+ console.log(JSON.stringify(getShokProfileV2(id), null, 2)),
107
+ );
108
+ sh.command("list-profiles-v2").action(() =>
109
+ console.log(JSON.stringify(listShokProfilesV2(), null, 2)),
110
+ );
111
+ sh.command("create-invocation-v2 <id> <profileId>")
112
+ .option("--payload <p>", "payload")
113
+ .action((id, profileId, o) =>
114
+ console.log(
115
+ JSON.stringify(
116
+ createShokInvocationV2({ id, profileId, payload: o.payload }),
117
+ null,
118
+ 2,
119
+ ),
120
+ ),
121
+ );
122
+ sh.command("running-invocation-v2 <id>").action((id) =>
123
+ console.log(JSON.stringify(runningShokInvocationV2(id), null, 2)),
124
+ );
125
+ sh.command("complete-invocation-v2 <id>").action((id) =>
126
+ console.log(JSON.stringify(completeShokInvocationV2(id), null, 2)),
127
+ );
128
+ sh.command("fail-invocation-v2 <id> [reason]").action((id, reason) =>
129
+ console.log(JSON.stringify(failShokInvocationV2(id, reason), null, 2)),
130
+ );
131
+ sh.command("cancel-invocation-v2 <id> [reason]").action((id, reason) =>
132
+ console.log(JSON.stringify(cancelShokInvocationV2(id, reason), null, 2)),
133
+ );
134
+ sh.command("get-invocation-v2 <id>").action((id) =>
135
+ console.log(JSON.stringify(getShokInvocationV2(id), null, 2)),
136
+ );
137
+ sh.command("list-invocations-v2").action(() =>
138
+ console.log(JSON.stringify(listShokInvocationsV2(), null, 2)),
139
+ );
140
+ sh.command("auto-disable-idle-v2").action(() =>
141
+ console.log(JSON.stringify(autoDisableIdleShokProfilesV2(), null, 2)),
142
+ );
143
+ sh.command("auto-fail-stuck-v2").action(() =>
144
+ console.log(JSON.stringify(autoFailStuckShokInvocationsV2(), null, 2)),
145
+ );
146
+ sh.command("gov-stats-v2").action(() =>
147
+ console.log(JSON.stringify(getSessionHooksGovStatsV2(), null, 2)),
148
+ );
149
+ sh.command("reset-state-v2").action(() => {
150
+ _resetStateSessionHooksV2();
151
+ console.log(JSON.stringify({ ok: true }, null, 2));
152
+ });
41
153
  }
@@ -2,40 +2,148 @@
2
2
  * `cc seshsearch` — Session Search V2 governance overlay (in-memory, atop lib/session-search.js).
3
3
  */
4
4
  import {
5
- SSCH_PROFILE_MATURITY_V2, SSCH_QUERY_LIFECYCLE_V2,
6
- setMaxActiveSschProfilesPerOwnerV2, getMaxActiveSschProfilesPerOwnerV2,
7
- setMaxPendingSschQueriesPerProfileV2, getMaxPendingSschQueriesPerProfileV2,
8
- setSschProfileIdleMsV2, getSschProfileIdleMsV2,
9
- setSschQueryStuckMsV2, getSschQueryStuckMsV2,
10
- registerSschProfileV2, activateSschProfileV2, staleSschProfileV2, archiveSschProfileV2, touchSschProfileV2, getSschProfileV2, listSschProfilesV2,
11
- createSschQueryV2, searchingSschQueryV2, completeSschQueryV2, failSschQueryV2, cancelSschQueryV2, getSschQueryV2, listSschQueriesV2,
12
- autoStaleIdleSschProfilesV2, autoFailStuckSschQueriesV2, getSessionSearchGovStatsV2, _resetStateSessionSearchV2,
5
+ SSCH_PROFILE_MATURITY_V2,
6
+ SSCH_QUERY_LIFECYCLE_V2,
7
+ setMaxActiveSschProfilesPerOwnerV2,
8
+ getMaxActiveSschProfilesPerOwnerV2,
9
+ setMaxPendingSschQueriesPerProfileV2,
10
+ getMaxPendingSschQueriesPerProfileV2,
11
+ setSschProfileIdleMsV2,
12
+ getSschProfileIdleMsV2,
13
+ setSschQueryStuckMsV2,
14
+ getSschQueryStuckMsV2,
15
+ registerSschProfileV2,
16
+ activateSschProfileV2,
17
+ staleSschProfileV2,
18
+ archiveSschProfileV2,
19
+ touchSschProfileV2,
20
+ getSschProfileV2,
21
+ listSschProfilesV2,
22
+ createSschQueryV2,
23
+ searchingSschQueryV2,
24
+ completeSschQueryV2,
25
+ failSschQueryV2,
26
+ cancelSschQueryV2,
27
+ getSschQueryV2,
28
+ listSschQueriesV2,
29
+ autoStaleIdleSschProfilesV2,
30
+ autoFailStuckSschQueriesV2,
31
+ getSessionSearchGovStatsV2,
32
+ _resetStateSessionSearchV2,
13
33
  } from "../lib/session-search.js";
14
34
 
15
35
  export function registerSeshsearchCommand(program) {
16
- const ss = program.command("seshsearch").description("Session Search V2 governance");
17
- ss.command("enums-v2").action(() => console.log(JSON.stringify({ profileMaturity: SSCH_PROFILE_MATURITY_V2, queryLifecycle: SSCH_QUERY_LIFECYCLE_V2 }, null, 2)));
18
- ss.command("config-v2").action(() => console.log(JSON.stringify({ maxActiveSschProfilesPerOwner: getMaxActiveSschProfilesPerOwnerV2(), maxPendingSschQueriesPerProfile: getMaxPendingSschQueriesPerProfileV2(), sschProfileIdleMs: getSschProfileIdleMsV2(), sschQueryStuckMs: getSschQueryStuckMsV2() }, null, 2)));
19
- ss.command("set-max-active-v2 <n>").action((n) => { setMaxActiveSschProfilesPerOwnerV2(Number(n)); console.log("ok"); });
20
- ss.command("set-max-pending-v2 <n>").action((n) => { setMaxPendingSschQueriesPerProfileV2(Number(n)); console.log("ok"); });
21
- ss.command("set-idle-ms-v2 <n>").action((n) => { setSschProfileIdleMsV2(Number(n)); console.log("ok"); });
22
- ss.command("set-stuck-ms-v2 <n>").action((n) => { setSschQueryStuckMsV2(Number(n)); console.log("ok"); });
23
- ss.command("register-profile-v2 <id> <owner>").option("--scope <s>", "scope").action((id, owner, o) => console.log(JSON.stringify(registerSschProfileV2({ id, owner, scope: o.scope }), null, 2)));
24
- ss.command("activate-profile-v2 <id>").action((id) => console.log(JSON.stringify(activateSschProfileV2(id), null, 2)));
25
- ss.command("stale-profile-v2 <id>").action((id) => console.log(JSON.stringify(staleSschProfileV2(id), null, 2)));
26
- ss.command("archive-profile-v2 <id>").action((id) => console.log(JSON.stringify(archiveSschProfileV2(id), null, 2)));
27
- ss.command("touch-profile-v2 <id>").action((id) => console.log(JSON.stringify(touchSschProfileV2(id), null, 2)));
28
- ss.command("get-profile-v2 <id>").action((id) => console.log(JSON.stringify(getSschProfileV2(id), null, 2)));
29
- ss.command("list-profiles-v2").action(() => console.log(JSON.stringify(listSschProfilesV2(), null, 2)));
30
- ss.command("create-query-v2 <id> <profileId>").option("--q <q>", "query string").action((id, profileId, o) => console.log(JSON.stringify(createSschQueryV2({ id, profileId, q: o.q }), null, 2)));
31
- ss.command("searching-query-v2 <id>").action((id) => console.log(JSON.stringify(searchingSschQueryV2(id), null, 2)));
32
- ss.command("complete-query-v2 <id>").action((id) => console.log(JSON.stringify(completeSschQueryV2(id), null, 2)));
33
- ss.command("fail-query-v2 <id> [reason]").action((id, reason) => console.log(JSON.stringify(failSschQueryV2(id, reason), null, 2)));
34
- ss.command("cancel-query-v2 <id> [reason]").action((id, reason) => console.log(JSON.stringify(cancelSschQueryV2(id, reason), null, 2)));
35
- ss.command("get-query-v2 <id>").action((id) => console.log(JSON.stringify(getSschQueryV2(id), null, 2)));
36
- ss.command("list-queries-v2").action(() => console.log(JSON.stringify(listSschQueriesV2(), null, 2)));
37
- ss.command("auto-stale-idle-v2").action(() => console.log(JSON.stringify(autoStaleIdleSschProfilesV2(), null, 2)));
38
- ss.command("auto-fail-stuck-v2").action(() => console.log(JSON.stringify(autoFailStuckSschQueriesV2(), null, 2)));
39
- ss.command("gov-stats-v2").action(() => console.log(JSON.stringify(getSessionSearchGovStatsV2(), null, 2)));
40
- ss.command("reset-state-v2").action(() => { _resetStateSessionSearchV2(); console.log(JSON.stringify({ ok: true }, null, 2)); });
36
+ const ss = program
37
+ .command("seshsearch")
38
+ .description("Session Search V2 governance");
39
+ ss.command("enums-v2").action(() =>
40
+ console.log(
41
+ JSON.stringify(
42
+ {
43
+ profileMaturity: SSCH_PROFILE_MATURITY_V2,
44
+ queryLifecycle: SSCH_QUERY_LIFECYCLE_V2,
45
+ },
46
+ null,
47
+ 2,
48
+ ),
49
+ ),
50
+ );
51
+ ss.command("config-v2").action(() =>
52
+ console.log(
53
+ JSON.stringify(
54
+ {
55
+ maxActiveSschProfilesPerOwner: getMaxActiveSschProfilesPerOwnerV2(),
56
+ maxPendingSschQueriesPerProfile:
57
+ getMaxPendingSschQueriesPerProfileV2(),
58
+ sschProfileIdleMs: getSschProfileIdleMsV2(),
59
+ sschQueryStuckMs: getSschQueryStuckMsV2(),
60
+ },
61
+ null,
62
+ 2,
63
+ ),
64
+ ),
65
+ );
66
+ ss.command("set-max-active-v2 <n>").action((n) => {
67
+ setMaxActiveSschProfilesPerOwnerV2(Number(n));
68
+ console.log("ok");
69
+ });
70
+ ss.command("set-max-pending-v2 <n>").action((n) => {
71
+ setMaxPendingSschQueriesPerProfileV2(Number(n));
72
+ console.log("ok");
73
+ });
74
+ ss.command("set-idle-ms-v2 <n>").action((n) => {
75
+ setSschProfileIdleMsV2(Number(n));
76
+ console.log("ok");
77
+ });
78
+ ss.command("set-stuck-ms-v2 <n>").action((n) => {
79
+ setSschQueryStuckMsV2(Number(n));
80
+ console.log("ok");
81
+ });
82
+ ss.command("register-profile-v2 <id> <owner>")
83
+ .option("--scope <s>", "scope")
84
+ .action((id, owner, o) =>
85
+ console.log(
86
+ JSON.stringify(
87
+ registerSschProfileV2({ id, owner, scope: o.scope }),
88
+ null,
89
+ 2,
90
+ ),
91
+ ),
92
+ );
93
+ ss.command("activate-profile-v2 <id>").action((id) =>
94
+ console.log(JSON.stringify(activateSschProfileV2(id), null, 2)),
95
+ );
96
+ ss.command("stale-profile-v2 <id>").action((id) =>
97
+ console.log(JSON.stringify(staleSschProfileV2(id), null, 2)),
98
+ );
99
+ ss.command("archive-profile-v2 <id>").action((id) =>
100
+ console.log(JSON.stringify(archiveSschProfileV2(id), null, 2)),
101
+ );
102
+ ss.command("touch-profile-v2 <id>").action((id) =>
103
+ console.log(JSON.stringify(touchSschProfileV2(id), null, 2)),
104
+ );
105
+ ss.command("get-profile-v2 <id>").action((id) =>
106
+ console.log(JSON.stringify(getSschProfileV2(id), null, 2)),
107
+ );
108
+ ss.command("list-profiles-v2").action(() =>
109
+ console.log(JSON.stringify(listSschProfilesV2(), null, 2)),
110
+ );
111
+ ss.command("create-query-v2 <id> <profileId>")
112
+ .option("--q <q>", "query string")
113
+ .action((id, profileId, o) =>
114
+ console.log(
115
+ JSON.stringify(createSschQueryV2({ id, profileId, q: o.q }), null, 2),
116
+ ),
117
+ );
118
+ ss.command("searching-query-v2 <id>").action((id) =>
119
+ console.log(JSON.stringify(searchingSschQueryV2(id), null, 2)),
120
+ );
121
+ ss.command("complete-query-v2 <id>").action((id) =>
122
+ console.log(JSON.stringify(completeSschQueryV2(id), null, 2)),
123
+ );
124
+ ss.command("fail-query-v2 <id> [reason]").action((id, reason) =>
125
+ console.log(JSON.stringify(failSschQueryV2(id, reason), null, 2)),
126
+ );
127
+ ss.command("cancel-query-v2 <id> [reason]").action((id, reason) =>
128
+ console.log(JSON.stringify(cancelSschQueryV2(id, reason), null, 2)),
129
+ );
130
+ ss.command("get-query-v2 <id>").action((id) =>
131
+ console.log(JSON.stringify(getSschQueryV2(id), null, 2)),
132
+ );
133
+ ss.command("list-queries-v2").action(() =>
134
+ console.log(JSON.stringify(listSschQueriesV2(), null, 2)),
135
+ );
136
+ ss.command("auto-stale-idle-v2").action(() =>
137
+ console.log(JSON.stringify(autoStaleIdleSschProfilesV2(), null, 2)),
138
+ );
139
+ ss.command("auto-fail-stuck-v2").action(() =>
140
+ console.log(JSON.stringify(autoFailStuckSschQueriesV2(), null, 2)),
141
+ );
142
+ ss.command("gov-stats-v2").action(() =>
143
+ console.log(JSON.stringify(getSessionSearchGovStatsV2(), null, 2)),
144
+ );
145
+ ss.command("reset-state-v2").action(() => {
146
+ _resetStateSessionSearchV2();
147
+ console.log(JSON.stringify({ ok: true }, null, 2));
148
+ });
41
149
  }
@@ -2,40 +2,151 @@
2
2
  * `cc seshtail` — Session Tail V2 governance overlay (in-memory, atop lib/session-tail.js).
3
3
  */
4
4
  import {
5
- STAIL_SUB_MATURITY_V2, STAIL_EVENT_LIFECYCLE_V2,
6
- setMaxActiveStailSubsPerOwnerV2, getMaxActiveStailSubsPerOwnerV2,
7
- setMaxPendingStailEventsPerSubV2, getMaxPendingStailEventsPerSubV2,
8
- setStailSubIdleMsV2, getStailSubIdleMsV2,
9
- setStailEventStuckMsV2, getStailEventStuckMsV2,
10
- registerStailSubV2, activateStailSubV2, pauseStailSubV2, closeStailSubV2, touchStailSubV2, getStailSubV2, listStailSubsV2,
11
- createStailEventV2, tailingStailEventV2, completeStailEventV2, failStailEventV2, cancelStailEventV2, getStailEventV2, listStailEventsV2,
12
- autoPauseIdleStailSubsV2, autoFailStuckStailEventsV2, getSessionTailGovStatsV2, _resetStateSessionTailV2,
5
+ STAIL_SUB_MATURITY_V2,
6
+ STAIL_EVENT_LIFECYCLE_V2,
7
+ setMaxActiveStailSubsPerOwnerV2,
8
+ getMaxActiveStailSubsPerOwnerV2,
9
+ setMaxPendingStailEventsPerSubV2,
10
+ getMaxPendingStailEventsPerSubV2,
11
+ setStailSubIdleMsV2,
12
+ getStailSubIdleMsV2,
13
+ setStailEventStuckMsV2,
14
+ getStailEventStuckMsV2,
15
+ registerStailSubV2,
16
+ activateStailSubV2,
17
+ pauseStailSubV2,
18
+ closeStailSubV2,
19
+ touchStailSubV2,
20
+ getStailSubV2,
21
+ listStailSubsV2,
22
+ createStailEventV2,
23
+ tailingStailEventV2,
24
+ completeStailEventV2,
25
+ failStailEventV2,
26
+ cancelStailEventV2,
27
+ getStailEventV2,
28
+ listStailEventsV2,
29
+ autoPauseIdleStailSubsV2,
30
+ autoFailStuckStailEventsV2,
31
+ getSessionTailGovStatsV2,
32
+ _resetStateSessionTailV2,
13
33
  } from "../lib/session-tail.js";
14
34
 
15
35
  export function registerSeshtailCommand(program) {
16
- const st = program.command("seshtail").description("Session Tail V2 governance");
17
- st.command("enums-v2").action(() => console.log(JSON.stringify({ subMaturity: STAIL_SUB_MATURITY_V2, eventLifecycle: STAIL_EVENT_LIFECYCLE_V2 }, null, 2)));
18
- st.command("config-v2").action(() => console.log(JSON.stringify({ maxActiveStailSubsPerOwner: getMaxActiveStailSubsPerOwnerV2(), maxPendingStailEventsPerSub: getMaxPendingStailEventsPerSubV2(), stailSubIdleMs: getStailSubIdleMsV2(), stailEventStuckMs: getStailEventStuckMsV2() }, null, 2)));
19
- st.command("set-max-active-v2 <n>").action((n) => { setMaxActiveStailSubsPerOwnerV2(Number(n)); console.log("ok"); });
20
- st.command("set-max-pending-v2 <n>").action((n) => { setMaxPendingStailEventsPerSubV2(Number(n)); console.log("ok"); });
21
- st.command("set-idle-ms-v2 <n>").action((n) => { setStailSubIdleMsV2(Number(n)); console.log("ok"); });
22
- st.command("set-stuck-ms-v2 <n>").action((n) => { setStailEventStuckMsV2(Number(n)); console.log("ok"); });
23
- st.command("register-sub-v2 <id> <owner>").option("--sessionId <s>", "sessionId").action((id, owner, o) => console.log(JSON.stringify(registerStailSubV2({ id, owner, sessionId: o.sessionId }), null, 2)));
24
- st.command("activate-sub-v2 <id>").action((id) => console.log(JSON.stringify(activateStailSubV2(id), null, 2)));
25
- st.command("pause-sub-v2 <id>").action((id) => console.log(JSON.stringify(pauseStailSubV2(id), null, 2)));
26
- st.command("close-sub-v2 <id>").action((id) => console.log(JSON.stringify(closeStailSubV2(id), null, 2)));
27
- st.command("touch-sub-v2 <id>").action((id) => console.log(JSON.stringify(touchStailSubV2(id), null, 2)));
28
- st.command("get-sub-v2 <id>").action((id) => console.log(JSON.stringify(getStailSubV2(id), null, 2)));
29
- st.command("list-subs-v2").action(() => console.log(JSON.stringify(listStailSubsV2(), null, 2)));
30
- st.command("create-event-v2 <id> <subId>").option("--cursor <c>", "cursor").action((id, subId, o) => console.log(JSON.stringify(createStailEventV2({ id, subId, cursor: o.cursor }), null, 2)));
31
- st.command("tailing-event-v2 <id>").action((id) => console.log(JSON.stringify(tailingStailEventV2(id), null, 2)));
32
- st.command("complete-event-v2 <id>").action((id) => console.log(JSON.stringify(completeStailEventV2(id), null, 2)));
33
- st.command("fail-event-v2 <id> [reason]").action((id, reason) => console.log(JSON.stringify(failStailEventV2(id, reason), null, 2)));
34
- st.command("cancel-event-v2 <id> [reason]").action((id, reason) => console.log(JSON.stringify(cancelStailEventV2(id, reason), null, 2)));
35
- st.command("get-event-v2 <id>").action((id) => console.log(JSON.stringify(getStailEventV2(id), null, 2)));
36
- st.command("list-events-v2").action(() => console.log(JSON.stringify(listStailEventsV2(), null, 2)));
37
- st.command("auto-pause-idle-v2").action(() => console.log(JSON.stringify(autoPauseIdleStailSubsV2(), null, 2)));
38
- st.command("auto-fail-stuck-v2").action(() => console.log(JSON.stringify(autoFailStuckStailEventsV2(), null, 2)));
39
- st.command("gov-stats-v2").action(() => console.log(JSON.stringify(getSessionTailGovStatsV2(), null, 2)));
40
- st.command("reset-state-v2").action(() => { _resetStateSessionTailV2(); console.log(JSON.stringify({ ok: true }, null, 2)); });
36
+ const st = program
37
+ .command("seshtail")
38
+ .description("Session Tail V2 governance");
39
+ st.command("enums-v2").action(() =>
40
+ console.log(
41
+ JSON.stringify(
42
+ {
43
+ subMaturity: STAIL_SUB_MATURITY_V2,
44
+ eventLifecycle: STAIL_EVENT_LIFECYCLE_V2,
45
+ },
46
+ null,
47
+ 2,
48
+ ),
49
+ ),
50
+ );
51
+ st.command("config-v2").action(() =>
52
+ console.log(
53
+ JSON.stringify(
54
+ {
55
+ maxActiveStailSubsPerOwner: getMaxActiveStailSubsPerOwnerV2(),
56
+ maxPendingStailEventsPerSub: getMaxPendingStailEventsPerSubV2(),
57
+ stailSubIdleMs: getStailSubIdleMsV2(),
58
+ stailEventStuckMs: getStailEventStuckMsV2(),
59
+ },
60
+ null,
61
+ 2,
62
+ ),
63
+ ),
64
+ );
65
+ st.command("set-max-active-v2 <n>").action((n) => {
66
+ setMaxActiveStailSubsPerOwnerV2(Number(n));
67
+ console.log("ok");
68
+ });
69
+ st.command("set-max-pending-v2 <n>").action((n) => {
70
+ setMaxPendingStailEventsPerSubV2(Number(n));
71
+ console.log("ok");
72
+ });
73
+ st.command("set-idle-ms-v2 <n>").action((n) => {
74
+ setStailSubIdleMsV2(Number(n));
75
+ console.log("ok");
76
+ });
77
+ st.command("set-stuck-ms-v2 <n>").action((n) => {
78
+ setStailEventStuckMsV2(Number(n));
79
+ console.log("ok");
80
+ });
81
+ st.command("register-sub-v2 <id> <owner>")
82
+ .option("--sessionId <s>", "sessionId")
83
+ .action((id, owner, o) =>
84
+ console.log(
85
+ JSON.stringify(
86
+ registerStailSubV2({ id, owner, sessionId: o.sessionId }),
87
+ null,
88
+ 2,
89
+ ),
90
+ ),
91
+ );
92
+ st.command("activate-sub-v2 <id>").action((id) =>
93
+ console.log(JSON.stringify(activateStailSubV2(id), null, 2)),
94
+ );
95
+ st.command("pause-sub-v2 <id>").action((id) =>
96
+ console.log(JSON.stringify(pauseStailSubV2(id), null, 2)),
97
+ );
98
+ st.command("close-sub-v2 <id>").action((id) =>
99
+ console.log(JSON.stringify(closeStailSubV2(id), null, 2)),
100
+ );
101
+ st.command("touch-sub-v2 <id>").action((id) =>
102
+ console.log(JSON.stringify(touchStailSubV2(id), null, 2)),
103
+ );
104
+ st.command("get-sub-v2 <id>").action((id) =>
105
+ console.log(JSON.stringify(getStailSubV2(id), null, 2)),
106
+ );
107
+ st.command("list-subs-v2").action(() =>
108
+ console.log(JSON.stringify(listStailSubsV2(), null, 2)),
109
+ );
110
+ st.command("create-event-v2 <id> <subId>")
111
+ .option("--cursor <c>", "cursor")
112
+ .action((id, subId, o) =>
113
+ console.log(
114
+ JSON.stringify(
115
+ createStailEventV2({ id, subId, cursor: o.cursor }),
116
+ null,
117
+ 2,
118
+ ),
119
+ ),
120
+ );
121
+ st.command("tailing-event-v2 <id>").action((id) =>
122
+ console.log(JSON.stringify(tailingStailEventV2(id), null, 2)),
123
+ );
124
+ st.command("complete-event-v2 <id>").action((id) =>
125
+ console.log(JSON.stringify(completeStailEventV2(id), null, 2)),
126
+ );
127
+ st.command("fail-event-v2 <id> [reason]").action((id, reason) =>
128
+ console.log(JSON.stringify(failStailEventV2(id, reason), null, 2)),
129
+ );
130
+ st.command("cancel-event-v2 <id> [reason]").action((id, reason) =>
131
+ console.log(JSON.stringify(cancelStailEventV2(id, reason), null, 2)),
132
+ );
133
+ st.command("get-event-v2 <id>").action((id) =>
134
+ console.log(JSON.stringify(getStailEventV2(id), null, 2)),
135
+ );
136
+ st.command("list-events-v2").action(() =>
137
+ console.log(JSON.stringify(listStailEventsV2(), null, 2)),
138
+ );
139
+ st.command("auto-pause-idle-v2").action(() =>
140
+ console.log(JSON.stringify(autoPauseIdleStailSubsV2(), null, 2)),
141
+ );
142
+ st.command("auto-fail-stuck-v2").action(() =>
143
+ console.log(JSON.stringify(autoFailStuckStailEventsV2(), null, 2)),
144
+ );
145
+ st.command("gov-stats-v2").action(() =>
146
+ console.log(JSON.stringify(getSessionTailGovStatsV2(), null, 2)),
147
+ );
148
+ st.command("reset-state-v2").action(() => {
149
+ _resetStateSessionTailV2();
150
+ console.log(JSON.stringify({ ok: true }, null, 2));
151
+ });
41
152
  }