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.
- package/package.json +1 -1
- package/src/commands/a2a.js +196 -28
- package/src/commands/activitypub.js +157 -27
- package/src/commands/agent.js +587 -103
- package/src/commands/audit.js +206 -0
- package/src/commands/bi.js +152 -27
- package/src/commands/bm25.js +111 -27
- package/src/commands/browse.js +190 -29
- package/src/commands/ccron.js +128 -28
- package/src/commands/chat.js +207 -0
- package/src/commands/compliance.js +414 -34
- package/src/commands/compt.js +127 -29
- package/src/commands/consol.js +8 -2
- package/src/commands/cowork.js +580 -34
- package/src/commands/crosschain.js +182 -28
- package/src/commands/dao.js +182 -28
- package/src/commands/dlp.js +172 -27
- package/src/commands/economy.js +205 -50
- package/src/commands/evolution.js +203 -50
- package/src/commands/evomap.js +182 -27
- package/src/commands/fflag.js +74 -22
- package/src/commands/git.js +177 -37
- package/src/commands/hardening.js +209 -0
- package/src/commands/hmemory.js +204 -50
- package/src/commands/incentive.js +209 -0
- package/src/commands/inference.js +170 -34
- package/src/commands/itbudget.js +149 -33
- package/src/commands/kg.js +206 -0
- package/src/commands/lowcode.js +195 -38
- package/src/commands/marketplace.js +206 -0
- package/src/commands/matrix.js +179 -27
- package/src/commands/mcpscaf.js +145 -33
- package/src/commands/meminj.js +145 -33
- package/src/commands/nostr.js +178 -27
- package/src/commands/orchestrate.js +217 -0
- package/src/commands/orchgov.js +144 -33
- package/src/commands/pdfp.js +109 -27
- package/src/commands/perf.js +169 -32
- package/src/commands/perm.js +144 -33
- package/src/commands/pipeline.js +207 -52
- package/src/commands/planmode.js +141 -32
- package/src/commands/privacy.js +203 -0
- package/src/commands/promcomp.js +111 -27
- package/src/commands/recommend.js +177 -34
- package/src/commands/reputation.js +208 -0
- package/src/commands/sandbox.js +206 -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/sganal.js +123 -29
- package/src/commands/siem.js +201 -34
- package/src/commands/sla.js +212 -0
- package/src/commands/slotfill.js +146 -33
- package/src/commands/social.js +157 -32
- package/src/commands/stress.js +206 -0
- package/src/commands/svccont.js +145 -33
- package/src/commands/terraform.js +206 -0
- package/src/commands/tms.js +171 -33
- package/src/commands/topiccls.js +146 -33
- package/src/commands/uprof.js +141 -32
- package/src/commands/vcheck.js +122 -28
- package/src/commands/webfetch.js +141 -32
- package/src/commands/zkp.js +184 -28
- package/src/index.js +40 -0
- package/src/lib/a2a-protocol.js +319 -51
- package/src/lib/activitypub-bridge.js +288 -50
- package/src/lib/agent-economy.js +304 -51
- package/src/lib/app-builder.js +279 -46
- package/src/lib/audit-logger.js +321 -0
- package/src/lib/autonomous-agent.js +284 -48
- package/src/lib/bi-engine.js +283 -49
- package/src/lib/bm25-search.js +301 -49
- package/src/lib/browser-automation.js +296 -49
- package/src/lib/chat-core.js +336 -0
- package/src/lib/claude-code-bridge.js +341 -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-recommender.js +317 -52
- package/src/lib/cowork-cron.js +298 -49
- package/src/lib/cowork-learning.js +333 -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/dlp-engine.js +287 -49
- package/src/lib/evolution-system.js +278 -47
- 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/git-integration.js +285 -47
- package/src/lib/hardening-manager.js +341 -0
- package/src/lib/hierarchical-memory.js +284 -48
- package/src/lib/inference-network.js +308 -51
- package/src/lib/iteration-budget.js +302 -50
- package/src/lib/knowledge-graph.js +333 -0
- package/src/lib/matrix-bridge.js +281 -47
- package/src/lib/mcp-scaffold.js +318 -54
- package/src/lib/memory-injection.js +288 -49
- package/src/lib/nostr-bridge.js +286 -49
- package/src/lib/orchestrator.js +293 -48
- package/src/lib/pdf-parser.js +298 -49
- package/src/lib/perf-tuning.js +309 -50
- 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/privacy-computing.js +335 -0
- package/src/lib/reputation-optimizer.js +340 -0
- package/src/lib/sandbox-v2.js +327 -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-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-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/stress-tester.js +342 -0
- package/src/lib/sub-agent-registry.js +302 -53
- package/src/lib/task-model-selector.js +302 -50
- package/src/lib/terraform-manager.js +333 -0
- package/src/lib/todo-manager.js +281 -47
- package/src/lib/token-incentive.js +341 -0
- package/src/lib/topic-classifier.js +297 -49
- package/src/lib/user-profile.js +294 -50
- package/src/lib/version-checker.js +304 -50
- package/src/lib/web-fetch.js +292 -51
- package/src/lib/zkp-engine.js +286 -49
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
|
}
|
package/src/commands/seshu.js
CHANGED
|
@@ -2,40 +2,159 @@
|
|
|
2
2
|
* `cc seshu` — Session Usage V2 governance overlay (in-memory, atop lib/session-usage.js).
|
|
3
3
|
*/
|
|
4
4
|
import {
|
|
5
|
-
SUSE_BUDGET_MATURITY_V2,
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
5
|
+
SUSE_BUDGET_MATURITY_V2,
|
|
6
|
+
SUSE_RECORD_LIFECYCLE_V2,
|
|
7
|
+
setMaxActiveSuseBudgetsPerOwnerV2,
|
|
8
|
+
getMaxActiveSuseBudgetsPerOwnerV2,
|
|
9
|
+
setMaxPendingSuseRecordsPerBudgetV2,
|
|
10
|
+
getMaxPendingSuseRecordsPerBudgetV2,
|
|
11
|
+
setSuseBudgetIdleMsV2,
|
|
12
|
+
getSuseBudgetIdleMsV2,
|
|
13
|
+
setSuseRecordStuckMsV2,
|
|
14
|
+
getSuseRecordStuckMsV2,
|
|
15
|
+
registerSuseBudgetV2,
|
|
16
|
+
activateSuseBudgetV2,
|
|
17
|
+
exhaustSuseBudgetV2,
|
|
18
|
+
archiveSuseBudgetV2,
|
|
19
|
+
touchSuseBudgetV2,
|
|
20
|
+
getSuseBudgetV2,
|
|
21
|
+
listSuseBudgetsV2,
|
|
22
|
+
createSuseRecordV2,
|
|
23
|
+
recordingSuseRecordV2,
|
|
24
|
+
recordSuseRecordV2,
|
|
25
|
+
rejectSuseRecordV2,
|
|
26
|
+
cancelSuseRecordV2,
|
|
27
|
+
getSuseRecordV2,
|
|
28
|
+
listSuseRecordsV2,
|
|
29
|
+
autoExhaustIdleSuseBudgetsV2,
|
|
30
|
+
autoRejectStuckSuseRecordsV2,
|
|
31
|
+
getSessionUsageGovStatsV2,
|
|
32
|
+
_resetStateSessionUsageV2,
|
|
13
33
|
} from "../lib/session-usage.js";
|
|
14
34
|
|
|
15
35
|
export function registerSeshuCommand(program) {
|
|
16
|
-
const su = program
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
su.command("
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
su.command("
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
36
|
+
const su = program
|
|
37
|
+
.command("seshu")
|
|
38
|
+
.description("Session Usage V2 governance");
|
|
39
|
+
su.command("enums-v2").action(() =>
|
|
40
|
+
console.log(
|
|
41
|
+
JSON.stringify(
|
|
42
|
+
{
|
|
43
|
+
budgetMaturity: SUSE_BUDGET_MATURITY_V2,
|
|
44
|
+
recordLifecycle: SUSE_RECORD_LIFECYCLE_V2,
|
|
45
|
+
},
|
|
46
|
+
null,
|
|
47
|
+
2,
|
|
48
|
+
),
|
|
49
|
+
),
|
|
50
|
+
);
|
|
51
|
+
su.command("config-v2").action(() =>
|
|
52
|
+
console.log(
|
|
53
|
+
JSON.stringify(
|
|
54
|
+
{
|
|
55
|
+
maxActiveSuseBudgetsPerOwner: getMaxActiveSuseBudgetsPerOwnerV2(),
|
|
56
|
+
maxPendingSuseRecordsPerBudget: getMaxPendingSuseRecordsPerBudgetV2(),
|
|
57
|
+
suseBudgetIdleMs: getSuseBudgetIdleMsV2(),
|
|
58
|
+
suseRecordStuckMs: getSuseRecordStuckMsV2(),
|
|
59
|
+
},
|
|
60
|
+
null,
|
|
61
|
+
2,
|
|
62
|
+
),
|
|
63
|
+
),
|
|
64
|
+
);
|
|
65
|
+
su.command("set-max-active-v2 <n>").action((n) => {
|
|
66
|
+
setMaxActiveSuseBudgetsPerOwnerV2(Number(n));
|
|
67
|
+
console.log("ok");
|
|
68
|
+
});
|
|
69
|
+
su.command("set-max-pending-v2 <n>").action((n) => {
|
|
70
|
+
setMaxPendingSuseRecordsPerBudgetV2(Number(n));
|
|
71
|
+
console.log("ok");
|
|
72
|
+
});
|
|
73
|
+
su.command("set-idle-ms-v2 <n>").action((n) => {
|
|
74
|
+
setSuseBudgetIdleMsV2(Number(n));
|
|
75
|
+
console.log("ok");
|
|
76
|
+
});
|
|
77
|
+
su.command("set-stuck-ms-v2 <n>").action((n) => {
|
|
78
|
+
setSuseRecordStuckMsV2(Number(n));
|
|
79
|
+
console.log("ok");
|
|
80
|
+
});
|
|
81
|
+
su.command("register-budget-v2 <id> <owner>")
|
|
82
|
+
.option("--limit <n>", "limit")
|
|
83
|
+
.action((id, owner, o) =>
|
|
84
|
+
console.log(
|
|
85
|
+
JSON.stringify(
|
|
86
|
+
registerSuseBudgetV2({
|
|
87
|
+
id,
|
|
88
|
+
owner,
|
|
89
|
+
limit: o.limit ? Number(o.limit) : undefined,
|
|
90
|
+
}),
|
|
91
|
+
null,
|
|
92
|
+
2,
|
|
93
|
+
),
|
|
94
|
+
),
|
|
95
|
+
);
|
|
96
|
+
su.command("activate-budget-v2 <id>").action((id) =>
|
|
97
|
+
console.log(JSON.stringify(activateSuseBudgetV2(id), null, 2)),
|
|
98
|
+
);
|
|
99
|
+
su.command("exhaust-budget-v2 <id>").action((id) =>
|
|
100
|
+
console.log(JSON.stringify(exhaustSuseBudgetV2(id), null, 2)),
|
|
101
|
+
);
|
|
102
|
+
su.command("archive-budget-v2 <id>").action((id) =>
|
|
103
|
+
console.log(JSON.stringify(archiveSuseBudgetV2(id), null, 2)),
|
|
104
|
+
);
|
|
105
|
+
su.command("touch-budget-v2 <id>").action((id) =>
|
|
106
|
+
console.log(JSON.stringify(touchSuseBudgetV2(id), null, 2)),
|
|
107
|
+
);
|
|
108
|
+
su.command("get-budget-v2 <id>").action((id) =>
|
|
109
|
+
console.log(JSON.stringify(getSuseBudgetV2(id), null, 2)),
|
|
110
|
+
);
|
|
111
|
+
su.command("list-budgets-v2").action(() =>
|
|
112
|
+
console.log(JSON.stringify(listSuseBudgetsV2(), null, 2)),
|
|
113
|
+
);
|
|
114
|
+
su.command("create-record-v2 <id> <budgetId>")
|
|
115
|
+
.option("--amount <n>", "amount")
|
|
116
|
+
.action((id, budgetId, o) =>
|
|
117
|
+
console.log(
|
|
118
|
+
JSON.stringify(
|
|
119
|
+
createSuseRecordV2({
|
|
120
|
+
id,
|
|
121
|
+
budgetId,
|
|
122
|
+
amount: o.amount ? Number(o.amount) : undefined,
|
|
123
|
+
}),
|
|
124
|
+
null,
|
|
125
|
+
2,
|
|
126
|
+
),
|
|
127
|
+
),
|
|
128
|
+
);
|
|
129
|
+
su.command("recording-record-v2 <id>").action((id) =>
|
|
130
|
+
console.log(JSON.stringify(recordingSuseRecordV2(id), null, 2)),
|
|
131
|
+
);
|
|
132
|
+
su.command("record-record-v2 <id>").action((id) =>
|
|
133
|
+
console.log(JSON.stringify(recordSuseRecordV2(id), null, 2)),
|
|
134
|
+
);
|
|
135
|
+
su.command("reject-record-v2 <id> [reason]").action((id, reason) =>
|
|
136
|
+
console.log(JSON.stringify(rejectSuseRecordV2(id, reason), null, 2)),
|
|
137
|
+
);
|
|
138
|
+
su.command("cancel-record-v2 <id> [reason]").action((id, reason) =>
|
|
139
|
+
console.log(JSON.stringify(cancelSuseRecordV2(id, reason), null, 2)),
|
|
140
|
+
);
|
|
141
|
+
su.command("get-record-v2 <id>").action((id) =>
|
|
142
|
+
console.log(JSON.stringify(getSuseRecordV2(id), null, 2)),
|
|
143
|
+
);
|
|
144
|
+
su.command("list-records-v2").action(() =>
|
|
145
|
+
console.log(JSON.stringify(listSuseRecordsV2(), null, 2)),
|
|
146
|
+
);
|
|
147
|
+
su.command("auto-exhaust-idle-v2").action(() =>
|
|
148
|
+
console.log(JSON.stringify(autoExhaustIdleSuseBudgetsV2(), null, 2)),
|
|
149
|
+
);
|
|
150
|
+
su.command("auto-reject-stuck-v2").action(() =>
|
|
151
|
+
console.log(JSON.stringify(autoRejectStuckSuseRecordsV2(), null, 2)),
|
|
152
|
+
);
|
|
153
|
+
su.command("gov-stats-v2").action(() =>
|
|
154
|
+
console.log(JSON.stringify(getSessionUsageGovStatsV2(), null, 2)),
|
|
155
|
+
);
|
|
156
|
+
su.command("reset-state-v2").action(() => {
|
|
157
|
+
_resetStateSessionUsageV2();
|
|
158
|
+
console.log(JSON.stringify({ ok: true }, null, 2));
|
|
159
|
+
});
|
|
41
160
|
}
|
package/src/commands/sganal.js
CHANGED
|
@@ -35,44 +35,138 @@ import {
|
|
|
35
35
|
export function registerSganalCommand(program) {
|
|
36
36
|
const s = program
|
|
37
37
|
.command("sganal")
|
|
38
|
-
.description(
|
|
38
|
+
.description(
|
|
39
|
+
"Social Graph Analytics V2 governance (in-memory, CLI v0.143.0)",
|
|
40
|
+
);
|
|
39
41
|
|
|
40
|
-
s.command("enums-v2").action(() =>
|
|
42
|
+
s.command("enums-v2").action(() =>
|
|
43
|
+
console.log(
|
|
44
|
+
JSON.stringify(
|
|
45
|
+
{ SGAN_PROFILE_MATURITY_V2, SGAN_RUN_LIFECYCLE_V2 },
|
|
46
|
+
null,
|
|
47
|
+
2,
|
|
48
|
+
),
|
|
49
|
+
),
|
|
50
|
+
);
|
|
41
51
|
s.command("register-profile-v2")
|
|
42
52
|
.requiredOption("--id <id>")
|
|
43
53
|
.requiredOption("--owner <owner>")
|
|
44
54
|
.option("--algorithm <algorithm>", "graph algorithm", "centrality")
|
|
45
|
-
.action((o) =>
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
s.command("
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
s.command("
|
|
55
|
+
.action((o) =>
|
|
56
|
+
console.log(JSON.stringify(registerSganProfileV2(o), null, 2)),
|
|
57
|
+
);
|
|
58
|
+
s.command("activate-profile-v2 <id>").action((id) =>
|
|
59
|
+
console.log(JSON.stringify(activateSganProfileV2(id), null, 2)),
|
|
60
|
+
);
|
|
61
|
+
s.command("stale-profile-v2 <id>").action((id) =>
|
|
62
|
+
console.log(JSON.stringify(staleSganProfileV2(id), null, 2)),
|
|
63
|
+
);
|
|
64
|
+
s.command("archive-profile-v2 <id>").action((id) =>
|
|
65
|
+
console.log(JSON.stringify(archiveSganProfileV2(id), null, 2)),
|
|
66
|
+
);
|
|
67
|
+
s.command("touch-profile-v2 <id>").action((id) =>
|
|
68
|
+
console.log(JSON.stringify(touchSganProfileV2(id), null, 2)),
|
|
69
|
+
);
|
|
70
|
+
s.command("get-profile-v2 <id>").action((id) =>
|
|
71
|
+
console.log(JSON.stringify(getSganProfileV2(id), null, 2)),
|
|
72
|
+
);
|
|
73
|
+
s.command("list-profiles-v2").action(() =>
|
|
74
|
+
console.log(JSON.stringify(listSganProfilesV2(), null, 2)),
|
|
75
|
+
);
|
|
52
76
|
|
|
53
77
|
s.command("create-run-v2")
|
|
54
78
|
.requiredOption("--id <id>")
|
|
55
79
|
.requiredOption("--profile-id <profileId>")
|
|
56
80
|
.option("--snapshot-id <sid>", "graph snapshot id", "")
|
|
57
|
-
.action((o) =>
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
81
|
+
.action((o) =>
|
|
82
|
+
console.log(
|
|
83
|
+
JSON.stringify(
|
|
84
|
+
createSganRunV2({
|
|
85
|
+
id: o.id,
|
|
86
|
+
profileId: o.profileId,
|
|
87
|
+
snapshotId: o.snapshotId,
|
|
88
|
+
}),
|
|
89
|
+
null,
|
|
90
|
+
2,
|
|
91
|
+
),
|
|
92
|
+
),
|
|
93
|
+
);
|
|
94
|
+
s.command("running-run-v2 <id>").action((id) =>
|
|
95
|
+
console.log(JSON.stringify(runningSganRunV2(id), null, 2)),
|
|
96
|
+
);
|
|
97
|
+
s.command("complete-run-v2 <id>").action((id) =>
|
|
98
|
+
console.log(JSON.stringify(completeSganRunV2(id), null, 2)),
|
|
99
|
+
);
|
|
100
|
+
s.command("fail-run-v2 <id>")
|
|
101
|
+
.option("--reason <r>")
|
|
102
|
+
.action((id, o) =>
|
|
103
|
+
console.log(JSON.stringify(failSganRunV2(id, o.reason), null, 2)),
|
|
104
|
+
);
|
|
105
|
+
s.command("cancel-run-v2 <id>")
|
|
106
|
+
.option("--reason <r>")
|
|
107
|
+
.action((id, o) =>
|
|
108
|
+
console.log(JSON.stringify(cancelSganRunV2(id, o.reason), null, 2)),
|
|
109
|
+
);
|
|
110
|
+
s.command("get-run-v2 <id>").action((id) =>
|
|
111
|
+
console.log(JSON.stringify(getSganRunV2(id), null, 2)),
|
|
112
|
+
);
|
|
113
|
+
s.command("list-runs-v2").action(() =>
|
|
114
|
+
console.log(JSON.stringify(listSganRunsV2(), null, 2)),
|
|
115
|
+
);
|
|
64
116
|
|
|
65
|
-
s.command("config-v2").action(() =>
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
117
|
+
s.command("config-v2").action(() =>
|
|
118
|
+
console.log(
|
|
119
|
+
JSON.stringify(
|
|
120
|
+
{
|
|
121
|
+
maxActiveSganProfilesPerOwner: getMaxActiveSganProfilesPerOwnerV2(),
|
|
122
|
+
maxPendingSganRunsPerProfile: getMaxPendingSganRunsPerProfileV2(),
|
|
123
|
+
sganProfileIdleMs: getSganProfileIdleMsV2(),
|
|
124
|
+
sganRunStuckMs: getSganRunStuckMsV2(),
|
|
125
|
+
},
|
|
126
|
+
null,
|
|
127
|
+
2,
|
|
128
|
+
),
|
|
129
|
+
),
|
|
130
|
+
);
|
|
131
|
+
s.command("set-max-active-profiles-v2 <n>").action((n) => {
|
|
132
|
+
setMaxActiveSganProfilesPerOwnerV2(Number(n));
|
|
133
|
+
console.log(
|
|
134
|
+
JSON.stringify(
|
|
135
|
+
{ maxActiveSganProfilesPerOwner: getMaxActiveSganProfilesPerOwnerV2() },
|
|
136
|
+
null,
|
|
137
|
+
2,
|
|
138
|
+
),
|
|
139
|
+
);
|
|
140
|
+
});
|
|
141
|
+
s.command("set-max-pending-runs-v2 <n>").action((n) => {
|
|
142
|
+
setMaxPendingSganRunsPerProfileV2(Number(n));
|
|
143
|
+
console.log(
|
|
144
|
+
JSON.stringify(
|
|
145
|
+
{ maxPendingSganRunsPerProfile: getMaxPendingSganRunsPerProfileV2() },
|
|
146
|
+
null,
|
|
147
|
+
2,
|
|
148
|
+
),
|
|
149
|
+
);
|
|
150
|
+
});
|
|
151
|
+
s.command("set-profile-idle-ms-v2 <ms>").action((ms) => {
|
|
152
|
+
setSganProfileIdleMsV2(Number(ms));
|
|
153
|
+
console.log(
|
|
154
|
+
JSON.stringify({ sganProfileIdleMs: getSganProfileIdleMsV2() }, null, 2),
|
|
155
|
+
);
|
|
156
|
+
});
|
|
157
|
+
s.command("set-run-stuck-ms-v2 <ms>").action((ms) => {
|
|
158
|
+
setSganRunStuckMsV2(Number(ms));
|
|
159
|
+
console.log(
|
|
160
|
+
JSON.stringify({ sganRunStuckMs: getSganRunStuckMsV2() }, null, 2),
|
|
161
|
+
);
|
|
162
|
+
});
|
|
163
|
+
s.command("auto-stale-idle-v2").action(() =>
|
|
164
|
+
console.log(JSON.stringify(autoStaleIdleSganProfilesV2(), null, 2)),
|
|
165
|
+
);
|
|
166
|
+
s.command("auto-fail-stuck-v2").action(() =>
|
|
167
|
+
console.log(JSON.stringify(autoFailStuckSganRunsV2(), null, 2)),
|
|
168
|
+
);
|
|
169
|
+
s.command("gov-stats-v2").action(() =>
|
|
170
|
+
console.log(JSON.stringify(getSocialGraphAnalyticsGovStatsV2(), null, 2)),
|
|
171
|
+
);
|
|
78
172
|
}
|