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.
- package/package.json +1 -1
- package/src/commands/a2a.js +196 -28
- package/src/commands/activitypub.js +364 -27
- package/src/commands/agent-network.js +217 -0
- package/src/commands/agent.js +587 -103
- package/src/commands/audit.js +206 -0
- package/src/commands/automation.js +201 -0
- package/src/commands/bi.js +355 -27
- package/src/commands/bm25.js +111 -27
- package/src/commands/browse.js +403 -29
- package/src/commands/ccron.js +128 -28
- package/src/commands/chat.js +207 -0
- package/src/commands/codegen.js +207 -0
- package/src/commands/collab.js +211 -0
- package/src/commands/compliance.js +824 -34
- package/src/commands/compt.js +127 -29
- package/src/commands/consol.js +8 -2
- package/src/commands/cowork.js +783 -34
- package/src/commands/crosschain.js +182 -28
- package/src/commands/dao.js +182 -28
- package/src/commands/dbevo.js +227 -0
- package/src/commands/dev.js +207 -0
- package/src/commands/did-v2.js +217 -0
- package/src/commands/did.js +221 -0
- package/src/commands/dlp.js +385 -27
- package/src/commands/economy.js +205 -50
- package/src/commands/evolution.js +203 -50
- package/src/commands/evomap.js +387 -27
- package/src/commands/export.js +213 -0
- package/src/commands/federation.js +209 -0
- package/src/commands/fflag.js +74 -22
- package/src/commands/fusion.js +205 -0
- package/src/commands/git.js +177 -37
- package/src/commands/governance.js +209 -0
- package/src/commands/hardening.js +209 -0
- package/src/commands/hmemory.js +204 -50
- package/src/commands/hook.js +209 -0
- package/src/commands/import.js +209 -0
- package/src/commands/incentive.js +209 -0
- package/src/commands/inference.js +170 -34
- package/src/commands/infra.js +203 -0
- package/src/commands/instinct.js +209 -0
- package/src/commands/ipfs.js +207 -0
- package/src/commands/itbudget.js +149 -33
- package/src/commands/kg.js +206 -0
- package/src/commands/llm.js +217 -0
- package/src/commands/lowcode.js +195 -38
- package/src/commands/marketplace.js +206 -0
- package/src/commands/matrix.js +386 -27
- package/src/commands/mcp.js +217 -0
- package/src/commands/mcpscaf.js +145 -33
- package/src/commands/meminj.js +145 -33
- package/src/commands/memory.js +209 -0
- package/src/commands/multimodal.js +203 -0
- package/src/commands/nlprog.js +225 -0
- package/src/commands/nostr.js +387 -27
- package/src/commands/note.js +205 -0
- package/src/commands/ops.js +219 -0
- package/src/commands/orchestrate.js +217 -0
- package/src/commands/orchgov.js +144 -33
- package/src/commands/org.js +209 -0
- package/src/commands/p2p.js +209 -0
- package/src/commands/pdfp.js +109 -27
- package/src/commands/perception.js +209 -0
- package/src/commands/perf.js +169 -32
- package/src/commands/perm.js +144 -33
- package/src/commands/permmem.js +203 -0
- package/src/commands/pipeline.js +207 -52
- package/src/commands/planmode.js +141 -32
- package/src/commands/plugin-ecosystem.js +209 -0
- package/src/commands/pqc.js +213 -0
- package/src/commands/privacy.js +203 -0
- package/src/commands/promcomp.js +111 -27
- package/src/commands/quantization.js +207 -0
- package/src/commands/rcache.js +205 -0
- package/src/commands/recommend.js +410 -34
- package/src/commands/reputation.js +208 -0
- package/src/commands/runtime.js +205 -0
- package/src/commands/sandbox.js +206 -0
- package/src/commands/scim.js +209 -0
- package/src/commands/seshhook.js +145 -33
- package/src/commands/seshsearch.js +141 -33
- package/src/commands/seshtail.js +144 -33
- package/src/commands/seshu.js +152 -33
- package/src/commands/session.js +209 -0
- package/src/commands/sganal.js +123 -29
- package/src/commands/siem.js +201 -34
- package/src/commands/skill.js +207 -0
- package/src/commands/sla.js +212 -0
- package/src/commands/slotfill.js +146 -33
- package/src/commands/social.js +358 -32
- package/src/commands/sso.js +209 -0
- package/src/commands/stress.js +206 -0
- package/src/commands/svccont.js +145 -33
- package/src/commands/sync.js +209 -0
- package/src/commands/tech.js +209 -0
- package/src/commands/tenant.js +217 -0
- package/src/commands/terraform.js +206 -0
- package/src/commands/tms.js +171 -33
- package/src/commands/tokens.js +209 -0
- package/src/commands/topiccls.js +146 -33
- package/src/commands/trust.js +217 -0
- package/src/commands/uprof.js +141 -32
- package/src/commands/vcheck.js +122 -28
- package/src/commands/wallet.js +209 -0
- package/src/commands/webfetch.js +141 -32
- package/src/commands/workflow.js +203 -0
- package/src/commands/zkp.js +184 -28
- package/src/index.js +180 -0
- package/src/lib/a2a-protocol.js +319 -51
- package/src/lib/activitypub-bridge.js +622 -50
- package/src/lib/agent-economy.js +304 -51
- package/src/lib/agent-network.js +341 -0
- package/src/lib/aiops.js +346 -0
- package/src/lib/app-builder.js +279 -46
- package/src/lib/audit-logger.js +321 -0
- package/src/lib/automation-engine.js +335 -0
- package/src/lib/autonomous-agent.js +284 -48
- package/src/lib/autonomous-developer.js +332 -0
- package/src/lib/bi-engine.js +616 -49
- package/src/lib/bm25-search.js +301 -49
- package/src/lib/browser-automation.js +630 -49
- package/src/lib/chat-core.js +336 -0
- package/src/lib/claude-code-bridge.js +341 -0
- package/src/lib/code-agent.js +339 -0
- package/src/lib/collaboration-governance.js +334 -0
- package/src/lib/community-governance.js +346 -0
- package/src/lib/compliance-framework-reporter.js +305 -51
- package/src/lib/compliance-manager.js +330 -0
- package/src/lib/compression-telemetry.js +301 -49
- package/src/lib/content-recommendation.js +351 -0
- package/src/lib/content-recommender.js +317 -52
- package/src/lib/cowork-cron.js +298 -49
- package/src/lib/cowork-learning.js +333 -0
- package/src/lib/cowork-share.js +338 -0
- package/src/lib/cowork-task-runner.js +308 -51
- package/src/lib/cowork-workflow.js +327 -0
- package/src/lib/cross-chain.js +311 -51
- package/src/lib/dao-governance.js +280 -46
- package/src/lib/dbevo.js +351 -0
- package/src/lib/decentral-infra.js +330 -0
- package/src/lib/did-manager.js +341 -0
- package/src/lib/did-v2-manager.js +341 -0
- package/src/lib/dlp-engine.js +626 -49
- package/src/lib/evolution-system.js +278 -47
- package/src/lib/evomap-governance.js +334 -0
- package/src/lib/evomap-manager.js +280 -46
- package/src/lib/execution-backend.js +294 -48
- package/src/lib/feature-flags.js +294 -49
- package/src/lib/federation-hardening.js +340 -0
- package/src/lib/git-integration.js +285 -47
- package/src/lib/hardening-manager.js +341 -0
- package/src/lib/hierarchical-memory.js +284 -48
- package/src/lib/hook-manager.js +341 -0
- package/src/lib/inference-network.js +308 -51
- package/src/lib/instinct-manager.js +346 -0
- package/src/lib/ipfs-storage.js +334 -0
- package/src/lib/iteration-budget.js +302 -50
- package/src/lib/knowledge-exporter.js +341 -0
- package/src/lib/knowledge-graph.js +333 -0
- package/src/lib/knowledge-importer.js +341 -0
- package/src/lib/llm-providers.js +346 -0
- package/src/lib/matrix-bridge.js +620 -47
- package/src/lib/mcp-registry.js +346 -0
- package/src/lib/mcp-scaffold.js +318 -54
- package/src/lib/memory-injection.js +288 -49
- package/src/lib/memory-manager.js +336 -0
- package/src/lib/multimodal.js +330 -0
- package/src/lib/nl-programming.js +341 -0
- package/src/lib/nostr-bridge.js +622 -49
- package/src/lib/note-versioning.js +339 -0
- package/src/lib/orchestrator.js +293 -48
- package/src/lib/org-manager.js +336 -0
- package/src/lib/p2p-manager.js +341 -0
- package/src/lib/pdf-parser.js +298 -49
- package/src/lib/perception.js +346 -0
- package/src/lib/perf-tuning.js +309 -50
- package/src/lib/permanent-memory.js +327 -0
- package/src/lib/permission-engine.js +287 -49
- package/src/lib/pipeline-orchestrator.js +289 -49
- package/src/lib/plan-mode.js +298 -51
- package/src/lib/plugin-ecosystem.js +346 -0
- package/src/lib/pqc-manager.js +346 -0
- package/src/lib/privacy-computing.js +335 -0
- package/src/lib/protocol-fusion.js +338 -0
- package/src/lib/quantization.js +337 -0
- package/src/lib/reputation-optimizer.js +340 -0
- package/src/lib/response-cache.js +333 -0
- package/src/lib/sandbox-v2.js +327 -0
- package/src/lib/scim-manager.js +346 -0
- package/src/lib/service-container.js +313 -52
- package/src/lib/session-consolidator.js +296 -49
- package/src/lib/session-hooks.js +312 -53
- package/src/lib/session-manager.js +334 -0
- package/src/lib/session-search.js +304 -51
- package/src/lib/session-tail.js +288 -49
- package/src/lib/session-usage.js +298 -52
- package/src/lib/siem-exporter.js +298 -51
- package/src/lib/skill-loader.js +334 -0
- package/src/lib/skill-marketplace.js +345 -0
- package/src/lib/sla-manager.js +341 -0
- package/src/lib/slot-filler.js +303 -51
- package/src/lib/social-graph-analytics.js +295 -49
- package/src/lib/social-graph.js +272 -49
- package/src/lib/social-manager.js +330 -0
- package/src/lib/sso-manager.js +340 -0
- package/src/lib/stress-tester.js +342 -0
- package/src/lib/sub-agent-registry.js +302 -53
- package/src/lib/sync-manager.js +336 -0
- package/src/lib/task-model-selector.js +302 -50
- package/src/lib/tech-learning-engine.js +341 -0
- package/src/lib/tenant-saas.js +341 -0
- package/src/lib/terraform-manager.js +333 -0
- package/src/lib/threat-intel.js +330 -0
- package/src/lib/todo-manager.js +281 -47
- package/src/lib/token-incentive.js +341 -0
- package/src/lib/token-tracker.js +336 -0
- package/src/lib/topic-classifier.js +297 -49
- package/src/lib/trust-security.js +343 -0
- package/src/lib/ueba.js +340 -0
- package/src/lib/universal-runtime.js +330 -0
- package/src/lib/user-profile.js +294 -50
- package/src/lib/version-checker.js +304 -50
- package/src/lib/wallet-manager.js +336 -0
- package/src/lib/web-fetch.js +292 -51
- package/src/lib/workflow-engine.js +330 -0
- package/src/lib/zkp-engine.js +286 -49
package/src/commands/seshhook.js
CHANGED
|
@@ -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,
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
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
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
sh.command("
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
sh.command("
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
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,
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
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
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
ss.command("
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
ss.command("
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
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
|
}
|
package/src/commands/seshtail.js
CHANGED
|
@@ -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,
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
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
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
st.command("
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
st.command("
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
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
|
}
|