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/mcpscaf.js
CHANGED
|
@@ -2,40 +2,152 @@
|
|
|
2
2
|
* `cc mcpscaf` — MCP Scaffold V2 governance overlay (in-memory, atop lib/mcp-scaffold.js).
|
|
3
3
|
*/
|
|
4
4
|
import {
|
|
5
|
-
MSCAF_PROFILE_MATURITY_V2,
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
5
|
+
MSCAF_PROFILE_MATURITY_V2,
|
|
6
|
+
MSCAF_GENERATION_LIFECYCLE_V2,
|
|
7
|
+
setMaxActiveMscafProfilesPerOwnerV2,
|
|
8
|
+
getMaxActiveMscafProfilesPerOwnerV2,
|
|
9
|
+
setMaxPendingMscafGenerationsPerProfileV2,
|
|
10
|
+
getMaxPendingMscafGenerationsPerProfileV2,
|
|
11
|
+
setMscafProfileIdleMsV2,
|
|
12
|
+
getMscafProfileIdleMsV2,
|
|
13
|
+
setMscafGenerationStuckMsV2,
|
|
14
|
+
getMscafGenerationStuckMsV2,
|
|
15
|
+
registerMscafProfileV2,
|
|
16
|
+
activateMscafProfileV2,
|
|
17
|
+
staleMscafProfileV2,
|
|
18
|
+
archiveMscafProfileV2,
|
|
19
|
+
touchMscafProfileV2,
|
|
20
|
+
getMscafProfileV2,
|
|
21
|
+
listMscafProfilesV2,
|
|
22
|
+
createMscafGenerationV2,
|
|
23
|
+
generatingMscafGenerationV2,
|
|
24
|
+
generateMscafGenerationV2,
|
|
25
|
+
failMscafGenerationV2,
|
|
26
|
+
cancelMscafGenerationV2,
|
|
27
|
+
getMscafGenerationV2,
|
|
28
|
+
listMscafGenerationsV2,
|
|
29
|
+
autoStaleIdleMscafProfilesV2,
|
|
30
|
+
autoFailStuckMscafGenerationsV2,
|
|
31
|
+
getMcpScaffoldGovStatsV2,
|
|
32
|
+
_resetStateMcpScaffoldV2,
|
|
13
33
|
} from "../lib/mcp-scaffold.js";
|
|
14
34
|
|
|
15
35
|
export function registerMcpscafCommand(program) {
|
|
16
|
-
const ms = program
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
ms.command("
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
ms.command("
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
36
|
+
const ms = program
|
|
37
|
+
.command("mcpscaf")
|
|
38
|
+
.description("MCP Scaffold V2 governance");
|
|
39
|
+
ms.command("enums-v2").action(() =>
|
|
40
|
+
console.log(
|
|
41
|
+
JSON.stringify(
|
|
42
|
+
{
|
|
43
|
+
profileMaturity: MSCAF_PROFILE_MATURITY_V2,
|
|
44
|
+
generationLifecycle: MSCAF_GENERATION_LIFECYCLE_V2,
|
|
45
|
+
},
|
|
46
|
+
null,
|
|
47
|
+
2,
|
|
48
|
+
),
|
|
49
|
+
),
|
|
50
|
+
);
|
|
51
|
+
ms.command("config-v2").action(() =>
|
|
52
|
+
console.log(
|
|
53
|
+
JSON.stringify(
|
|
54
|
+
{
|
|
55
|
+
maxActiveMscafProfilesPerOwner: getMaxActiveMscafProfilesPerOwnerV2(),
|
|
56
|
+
maxPendingMscafGenerationsPerProfile:
|
|
57
|
+
getMaxPendingMscafGenerationsPerProfileV2(),
|
|
58
|
+
mscafProfileIdleMs: getMscafProfileIdleMsV2(),
|
|
59
|
+
mscafGenerationStuckMs: getMscafGenerationStuckMsV2(),
|
|
60
|
+
},
|
|
61
|
+
null,
|
|
62
|
+
2,
|
|
63
|
+
),
|
|
64
|
+
),
|
|
65
|
+
);
|
|
66
|
+
ms.command("set-max-active-v2 <n>").action((n) => {
|
|
67
|
+
setMaxActiveMscafProfilesPerOwnerV2(Number(n));
|
|
68
|
+
console.log("ok");
|
|
69
|
+
});
|
|
70
|
+
ms.command("set-max-pending-v2 <n>").action((n) => {
|
|
71
|
+
setMaxPendingMscafGenerationsPerProfileV2(Number(n));
|
|
72
|
+
console.log("ok");
|
|
73
|
+
});
|
|
74
|
+
ms.command("set-idle-ms-v2 <n>").action((n) => {
|
|
75
|
+
setMscafProfileIdleMsV2(Number(n));
|
|
76
|
+
console.log("ok");
|
|
77
|
+
});
|
|
78
|
+
ms.command("set-stuck-ms-v2 <n>").action((n) => {
|
|
79
|
+
setMscafGenerationStuckMsV2(Number(n));
|
|
80
|
+
console.log("ok");
|
|
81
|
+
});
|
|
82
|
+
ms.command("register-profile-v2 <id> <owner>")
|
|
83
|
+
.option("--transport <t>", "transport")
|
|
84
|
+
.action((id, owner, o) =>
|
|
85
|
+
console.log(
|
|
86
|
+
JSON.stringify(
|
|
87
|
+
registerMscafProfileV2({ id, owner, transport: o.transport }),
|
|
88
|
+
null,
|
|
89
|
+
2,
|
|
90
|
+
),
|
|
91
|
+
),
|
|
92
|
+
);
|
|
93
|
+
ms.command("activate-profile-v2 <id>").action((id) =>
|
|
94
|
+
console.log(JSON.stringify(activateMscafProfileV2(id), null, 2)),
|
|
95
|
+
);
|
|
96
|
+
ms.command("stale-profile-v2 <id>").action((id) =>
|
|
97
|
+
console.log(JSON.stringify(staleMscafProfileV2(id), null, 2)),
|
|
98
|
+
);
|
|
99
|
+
ms.command("archive-profile-v2 <id>").action((id) =>
|
|
100
|
+
console.log(JSON.stringify(archiveMscafProfileV2(id), null, 2)),
|
|
101
|
+
);
|
|
102
|
+
ms.command("touch-profile-v2 <id>").action((id) =>
|
|
103
|
+
console.log(JSON.stringify(touchMscafProfileV2(id), null, 2)),
|
|
104
|
+
);
|
|
105
|
+
ms.command("get-profile-v2 <id>").action((id) =>
|
|
106
|
+
console.log(JSON.stringify(getMscafProfileV2(id), null, 2)),
|
|
107
|
+
);
|
|
108
|
+
ms.command("list-profiles-v2").action(() =>
|
|
109
|
+
console.log(JSON.stringify(listMscafProfilesV2(), null, 2)),
|
|
110
|
+
);
|
|
111
|
+
ms.command("create-generation-v2 <id> <profileId>")
|
|
112
|
+
.option("--target <t>", "target")
|
|
113
|
+
.action((id, profileId, o) =>
|
|
114
|
+
console.log(
|
|
115
|
+
JSON.stringify(
|
|
116
|
+
createMscafGenerationV2({ id, profileId, target: o.target }),
|
|
117
|
+
null,
|
|
118
|
+
2,
|
|
119
|
+
),
|
|
120
|
+
),
|
|
121
|
+
);
|
|
122
|
+
ms.command("generating-generation-v2 <id>").action((id) =>
|
|
123
|
+
console.log(JSON.stringify(generatingMscafGenerationV2(id), null, 2)),
|
|
124
|
+
);
|
|
125
|
+
ms.command("generate-generation-v2 <id>").action((id) =>
|
|
126
|
+
console.log(JSON.stringify(generateMscafGenerationV2(id), null, 2)),
|
|
127
|
+
);
|
|
128
|
+
ms.command("fail-generation-v2 <id> [reason]").action((id, reason) =>
|
|
129
|
+
console.log(JSON.stringify(failMscafGenerationV2(id, reason), null, 2)),
|
|
130
|
+
);
|
|
131
|
+
ms.command("cancel-generation-v2 <id> [reason]").action((id, reason) =>
|
|
132
|
+
console.log(JSON.stringify(cancelMscafGenerationV2(id, reason), null, 2)),
|
|
133
|
+
);
|
|
134
|
+
ms.command("get-generation-v2 <id>").action((id) =>
|
|
135
|
+
console.log(JSON.stringify(getMscafGenerationV2(id), null, 2)),
|
|
136
|
+
);
|
|
137
|
+
ms.command("list-generations-v2").action(() =>
|
|
138
|
+
console.log(JSON.stringify(listMscafGenerationsV2(), null, 2)),
|
|
139
|
+
);
|
|
140
|
+
ms.command("auto-stale-idle-v2").action(() =>
|
|
141
|
+
console.log(JSON.stringify(autoStaleIdleMscafProfilesV2(), null, 2)),
|
|
142
|
+
);
|
|
143
|
+
ms.command("auto-fail-stuck-v2").action(() =>
|
|
144
|
+
console.log(JSON.stringify(autoFailStuckMscafGenerationsV2(), null, 2)),
|
|
145
|
+
);
|
|
146
|
+
ms.command("gov-stats-v2").action(() =>
|
|
147
|
+
console.log(JSON.stringify(getMcpScaffoldGovStatsV2(), null, 2)),
|
|
148
|
+
);
|
|
149
|
+
ms.command("reset-state-v2").action(() => {
|
|
150
|
+
_resetStateMcpScaffoldV2();
|
|
151
|
+
console.log(JSON.stringify({ ok: true }, null, 2));
|
|
152
|
+
});
|
|
41
153
|
}
|
package/src/commands/meminj.js
CHANGED
|
@@ -2,40 +2,152 @@
|
|
|
2
2
|
* `cc meminj` — Memory Injection V2 governance overlay (in-memory, atop lib/memory-injection.js).
|
|
3
3
|
*/
|
|
4
4
|
import {
|
|
5
|
-
MINJ_RULE_MATURITY_V2,
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
5
|
+
MINJ_RULE_MATURITY_V2,
|
|
6
|
+
MINJ_INJECTION_LIFECYCLE_V2,
|
|
7
|
+
setMaxActiveMinjRulesPerOwnerV2,
|
|
8
|
+
getMaxActiveMinjRulesPerOwnerV2,
|
|
9
|
+
setMaxPendingMinjInjectionsPerRuleV2,
|
|
10
|
+
getMaxPendingMinjInjectionsPerRuleV2,
|
|
11
|
+
setMinjRuleIdleMsV2,
|
|
12
|
+
getMinjRuleIdleMsV2,
|
|
13
|
+
setMinjInjectionStuckMsV2,
|
|
14
|
+
getMinjInjectionStuckMsV2,
|
|
15
|
+
registerMinjRuleV2,
|
|
16
|
+
activateMinjRuleV2,
|
|
17
|
+
pauseMinjRuleV2,
|
|
18
|
+
archiveMinjRuleV2,
|
|
19
|
+
touchMinjRuleV2,
|
|
20
|
+
getMinjRuleV2,
|
|
21
|
+
listMinjRulesV2,
|
|
22
|
+
createMinjInjectionV2,
|
|
23
|
+
injectingMinjInjectionV2,
|
|
24
|
+
applyMinjInjectionV2,
|
|
25
|
+
failMinjInjectionV2,
|
|
26
|
+
cancelMinjInjectionV2,
|
|
27
|
+
getMinjInjectionV2,
|
|
28
|
+
listMinjInjectionsV2,
|
|
29
|
+
autoPauseIdleMinjRulesV2,
|
|
30
|
+
autoFailStuckMinjInjectionsV2,
|
|
31
|
+
getMemoryInjectionGovStatsV2,
|
|
32
|
+
_resetStateMemoryInjectionV2,
|
|
13
33
|
} from "../lib/memory-injection.js";
|
|
14
34
|
|
|
15
35
|
export function registerMeminjCommand(program) {
|
|
16
|
-
const mi = program
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
mi.command("
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
mi.command("
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
36
|
+
const mi = program
|
|
37
|
+
.command("meminj")
|
|
38
|
+
.description("Memory Injection V2 governance");
|
|
39
|
+
mi.command("enums-v2").action(() =>
|
|
40
|
+
console.log(
|
|
41
|
+
JSON.stringify(
|
|
42
|
+
{
|
|
43
|
+
ruleMaturity: MINJ_RULE_MATURITY_V2,
|
|
44
|
+
injectionLifecycle: MINJ_INJECTION_LIFECYCLE_V2,
|
|
45
|
+
},
|
|
46
|
+
null,
|
|
47
|
+
2,
|
|
48
|
+
),
|
|
49
|
+
),
|
|
50
|
+
);
|
|
51
|
+
mi.command("config-v2").action(() =>
|
|
52
|
+
console.log(
|
|
53
|
+
JSON.stringify(
|
|
54
|
+
{
|
|
55
|
+
maxActiveMinjRulesPerOwner: getMaxActiveMinjRulesPerOwnerV2(),
|
|
56
|
+
maxPendingMinjInjectionsPerRule:
|
|
57
|
+
getMaxPendingMinjInjectionsPerRuleV2(),
|
|
58
|
+
minjRuleIdleMs: getMinjRuleIdleMsV2(),
|
|
59
|
+
minjInjectionStuckMs: getMinjInjectionStuckMsV2(),
|
|
60
|
+
},
|
|
61
|
+
null,
|
|
62
|
+
2,
|
|
63
|
+
),
|
|
64
|
+
),
|
|
65
|
+
);
|
|
66
|
+
mi.command("set-max-active-v2 <n>").action((n) => {
|
|
67
|
+
setMaxActiveMinjRulesPerOwnerV2(Number(n));
|
|
68
|
+
console.log("ok");
|
|
69
|
+
});
|
|
70
|
+
mi.command("set-max-pending-v2 <n>").action((n) => {
|
|
71
|
+
setMaxPendingMinjInjectionsPerRuleV2(Number(n));
|
|
72
|
+
console.log("ok");
|
|
73
|
+
});
|
|
74
|
+
mi.command("set-idle-ms-v2 <n>").action((n) => {
|
|
75
|
+
setMinjRuleIdleMsV2(Number(n));
|
|
76
|
+
console.log("ok");
|
|
77
|
+
});
|
|
78
|
+
mi.command("set-stuck-ms-v2 <n>").action((n) => {
|
|
79
|
+
setMinjInjectionStuckMsV2(Number(n));
|
|
80
|
+
console.log("ok");
|
|
81
|
+
});
|
|
82
|
+
mi.command("register-rule-v2 <id> <owner>")
|
|
83
|
+
.option("--scope <s>", "scope")
|
|
84
|
+
.action((id, owner, o) =>
|
|
85
|
+
console.log(
|
|
86
|
+
JSON.stringify(
|
|
87
|
+
registerMinjRuleV2({ id, owner, scope: o.scope }),
|
|
88
|
+
null,
|
|
89
|
+
2,
|
|
90
|
+
),
|
|
91
|
+
),
|
|
92
|
+
);
|
|
93
|
+
mi.command("activate-rule-v2 <id>").action((id) =>
|
|
94
|
+
console.log(JSON.stringify(activateMinjRuleV2(id), null, 2)),
|
|
95
|
+
);
|
|
96
|
+
mi.command("pause-rule-v2 <id>").action((id) =>
|
|
97
|
+
console.log(JSON.stringify(pauseMinjRuleV2(id), null, 2)),
|
|
98
|
+
);
|
|
99
|
+
mi.command("archive-rule-v2 <id>").action((id) =>
|
|
100
|
+
console.log(JSON.stringify(archiveMinjRuleV2(id), null, 2)),
|
|
101
|
+
);
|
|
102
|
+
mi.command("touch-rule-v2 <id>").action((id) =>
|
|
103
|
+
console.log(JSON.stringify(touchMinjRuleV2(id), null, 2)),
|
|
104
|
+
);
|
|
105
|
+
mi.command("get-rule-v2 <id>").action((id) =>
|
|
106
|
+
console.log(JSON.stringify(getMinjRuleV2(id), null, 2)),
|
|
107
|
+
);
|
|
108
|
+
mi.command("list-rules-v2").action(() =>
|
|
109
|
+
console.log(JSON.stringify(listMinjRulesV2(), null, 2)),
|
|
110
|
+
);
|
|
111
|
+
mi.command("create-injection-v2 <id> <ruleId>")
|
|
112
|
+
.option("--payload <p>", "payload")
|
|
113
|
+
.action((id, ruleId, o) =>
|
|
114
|
+
console.log(
|
|
115
|
+
JSON.stringify(
|
|
116
|
+
createMinjInjectionV2({ id, ruleId, payload: o.payload }),
|
|
117
|
+
null,
|
|
118
|
+
2,
|
|
119
|
+
),
|
|
120
|
+
),
|
|
121
|
+
);
|
|
122
|
+
mi.command("injecting-injection-v2 <id>").action((id) =>
|
|
123
|
+
console.log(JSON.stringify(injectingMinjInjectionV2(id), null, 2)),
|
|
124
|
+
);
|
|
125
|
+
mi.command("apply-injection-v2 <id>").action((id) =>
|
|
126
|
+
console.log(JSON.stringify(applyMinjInjectionV2(id), null, 2)),
|
|
127
|
+
);
|
|
128
|
+
mi.command("fail-injection-v2 <id> [reason]").action((id, reason) =>
|
|
129
|
+
console.log(JSON.stringify(failMinjInjectionV2(id, reason), null, 2)),
|
|
130
|
+
);
|
|
131
|
+
mi.command("cancel-injection-v2 <id> [reason]").action((id, reason) =>
|
|
132
|
+
console.log(JSON.stringify(cancelMinjInjectionV2(id, reason), null, 2)),
|
|
133
|
+
);
|
|
134
|
+
mi.command("get-injection-v2 <id>").action((id) =>
|
|
135
|
+
console.log(JSON.stringify(getMinjInjectionV2(id), null, 2)),
|
|
136
|
+
);
|
|
137
|
+
mi.command("list-injections-v2").action(() =>
|
|
138
|
+
console.log(JSON.stringify(listMinjInjectionsV2(), null, 2)),
|
|
139
|
+
);
|
|
140
|
+
mi.command("auto-pause-idle-v2").action(() =>
|
|
141
|
+
console.log(JSON.stringify(autoPauseIdleMinjRulesV2(), null, 2)),
|
|
142
|
+
);
|
|
143
|
+
mi.command("auto-fail-stuck-v2").action(() =>
|
|
144
|
+
console.log(JSON.stringify(autoFailStuckMinjInjectionsV2(), null, 2)),
|
|
145
|
+
);
|
|
146
|
+
mi.command("gov-stats-v2").action(() =>
|
|
147
|
+
console.log(JSON.stringify(getMemoryInjectionGovStatsV2(), null, 2)),
|
|
148
|
+
);
|
|
149
|
+
mi.command("reset-state-v2").action(() => {
|
|
150
|
+
_resetStateMemoryInjectionV2();
|
|
151
|
+
console.log(JSON.stringify({ ok: true }, null, 2));
|
|
152
|
+
});
|
|
41
153
|
}
|
package/src/commands/nostr.js
CHANGED
|
@@ -375,7 +375,6 @@ export function registerNostrCommand(program) {
|
|
|
375
375
|
registerNostrV2Command(nostr);
|
|
376
376
|
}
|
|
377
377
|
|
|
378
|
-
|
|
379
378
|
import {
|
|
380
379
|
NOSTR_RELAY_MATURITY_V2,
|
|
381
380
|
NOSTR_EVENT_LIFECYCLE_V2,
|
|
@@ -407,30 +406,182 @@ import {
|
|
|
407
406
|
} from "../lib/nostr-bridge.js";
|
|
408
407
|
|
|
409
408
|
export function registerNostrV2Command(nostr) {
|
|
410
|
-
nostr
|
|
411
|
-
|
|
412
|
-
.
|
|
413
|
-
.action((
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
nostr
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
409
|
+
nostr
|
|
410
|
+
.command("enums-v2")
|
|
411
|
+
.description("Show V2 enums")
|
|
412
|
+
.action(() => {
|
|
413
|
+
console.log(
|
|
414
|
+
JSON.stringify(
|
|
415
|
+
{ NOSTR_RELAY_MATURITY_V2, NOSTR_EVENT_LIFECYCLE_V2 },
|
|
416
|
+
null,
|
|
417
|
+
2,
|
|
418
|
+
),
|
|
419
|
+
);
|
|
420
|
+
});
|
|
421
|
+
nostr
|
|
422
|
+
.command("register-relay-v2")
|
|
423
|
+
.description("Register a nostr relay profile (pending)")
|
|
424
|
+
.requiredOption("--id <id>")
|
|
425
|
+
.requiredOption("--owner <owner>")
|
|
426
|
+
.option("--url <url>")
|
|
427
|
+
.action((o) => {
|
|
428
|
+
console.log(JSON.stringify(registerNostrRelayV2(o), null, 2));
|
|
429
|
+
});
|
|
430
|
+
nostr
|
|
431
|
+
.command("activate-relay-v2 <id>")
|
|
432
|
+
.description("Activate relay")
|
|
433
|
+
.action((id) => {
|
|
434
|
+
console.log(JSON.stringify(activateNostrRelayV2(id), null, 2));
|
|
435
|
+
});
|
|
436
|
+
nostr
|
|
437
|
+
.command("offline-relay-v2 <id>")
|
|
438
|
+
.description("Mark relay offline")
|
|
439
|
+
.action((id) => {
|
|
440
|
+
console.log(JSON.stringify(offlineNostrRelayV2(id), null, 2));
|
|
441
|
+
});
|
|
442
|
+
nostr
|
|
443
|
+
.command("retire-relay-v2 <id>")
|
|
444
|
+
.description("Retire relay (terminal)")
|
|
445
|
+
.action((id) => {
|
|
446
|
+
console.log(JSON.stringify(retireNostrRelayV2(id), null, 2));
|
|
447
|
+
});
|
|
448
|
+
nostr
|
|
449
|
+
.command("touch-relay-v2 <id>")
|
|
450
|
+
.description("Refresh lastTouchedAt")
|
|
451
|
+
.action((id) => {
|
|
452
|
+
console.log(JSON.stringify(touchNostrRelayV2(id), null, 2));
|
|
453
|
+
});
|
|
454
|
+
nostr
|
|
455
|
+
.command("get-relay-v2 <id>")
|
|
456
|
+
.description("Get a relay")
|
|
457
|
+
.action((id) => {
|
|
458
|
+
console.log(JSON.stringify(getNostrRelayV2(id), null, 2));
|
|
459
|
+
});
|
|
460
|
+
nostr
|
|
461
|
+
.command("list-relays-v2")
|
|
462
|
+
.description("List relays")
|
|
463
|
+
.action(() => {
|
|
464
|
+
console.log(JSON.stringify(listNostrRelaysV2(), null, 2));
|
|
465
|
+
});
|
|
466
|
+
nostr
|
|
467
|
+
.command("create-event-v2")
|
|
468
|
+
.description("Create a nostr event (queued)")
|
|
469
|
+
.requiredOption("--id <id>")
|
|
470
|
+
.requiredOption("--relay-id <relayId>")
|
|
471
|
+
.option("--kind <kind>", "event kind", (v) => Number(v))
|
|
472
|
+
.action((o) => {
|
|
473
|
+
console.log(
|
|
474
|
+
JSON.stringify(
|
|
475
|
+
createNostrEventV2({ id: o.id, relayId: o.relayId, kind: o.kind }),
|
|
476
|
+
null,
|
|
477
|
+
2,
|
|
478
|
+
),
|
|
479
|
+
);
|
|
480
|
+
});
|
|
481
|
+
nostr
|
|
482
|
+
.command("start-event-v2 <id>")
|
|
483
|
+
.description("Transition event to publishing")
|
|
484
|
+
.action((id) => {
|
|
485
|
+
console.log(JSON.stringify(startNostrEventV2(id), null, 2));
|
|
486
|
+
});
|
|
487
|
+
nostr
|
|
488
|
+
.command("publish-event-v2 <id>")
|
|
489
|
+
.description("Transition event to published")
|
|
490
|
+
.action((id) => {
|
|
491
|
+
console.log(JSON.stringify(publishNostrEventV2(id), null, 2));
|
|
492
|
+
});
|
|
493
|
+
nostr
|
|
494
|
+
.command("fail-event-v2 <id>")
|
|
495
|
+
.description("Fail event")
|
|
496
|
+
.option("--reason <r>")
|
|
497
|
+
.action((id, o) => {
|
|
498
|
+
console.log(JSON.stringify(failNostrEventV2(id, o.reason), null, 2));
|
|
499
|
+
});
|
|
500
|
+
nostr
|
|
501
|
+
.command("cancel-event-v2 <id>")
|
|
502
|
+
.description("Cancel event")
|
|
503
|
+
.option("--reason <r>")
|
|
504
|
+
.action((id, o) => {
|
|
505
|
+
console.log(JSON.stringify(cancelNostrEventV2(id, o.reason), null, 2));
|
|
506
|
+
});
|
|
507
|
+
nostr
|
|
508
|
+
.command("get-event-v2 <id>")
|
|
509
|
+
.description("Get event")
|
|
510
|
+
.action((id) => {
|
|
511
|
+
console.log(JSON.stringify(getNostrEventV2(id), null, 2));
|
|
512
|
+
});
|
|
513
|
+
nostr
|
|
514
|
+
.command("list-events-v2")
|
|
515
|
+
.description("List events")
|
|
516
|
+
.action(() => {
|
|
517
|
+
console.log(JSON.stringify(listNostrEventsV2(), null, 2));
|
|
518
|
+
});
|
|
519
|
+
nostr
|
|
520
|
+
.command("set-max-active-relays-v2 <n>")
|
|
521
|
+
.description("Set per-owner active cap")
|
|
522
|
+
.action((n) => {
|
|
523
|
+
setMaxActiveNostrRelaysPerOwnerV2(Number(n));
|
|
524
|
+
console.log(
|
|
525
|
+
JSON.stringify(
|
|
526
|
+
{ maxActiveNostrRelaysPerOwner: getMaxActiveNostrRelaysPerOwnerV2() },
|
|
527
|
+
null,
|
|
528
|
+
2,
|
|
529
|
+
),
|
|
530
|
+
);
|
|
531
|
+
});
|
|
532
|
+
nostr
|
|
533
|
+
.command("set-max-pending-events-v2 <n>")
|
|
534
|
+
.description("Set per-relay pending cap")
|
|
535
|
+
.action((n) => {
|
|
536
|
+
setMaxPendingNostrEventsPerRelayV2(Number(n));
|
|
537
|
+
console.log(
|
|
538
|
+
JSON.stringify(
|
|
539
|
+
{
|
|
540
|
+
maxPendingNostrEventsPerRelay: getMaxPendingNostrEventsPerRelayV2(),
|
|
541
|
+
},
|
|
542
|
+
null,
|
|
543
|
+
2,
|
|
544
|
+
),
|
|
545
|
+
);
|
|
546
|
+
});
|
|
547
|
+
nostr
|
|
548
|
+
.command("set-relay-idle-ms-v2 <n>")
|
|
549
|
+
.description("Set idle threshold")
|
|
550
|
+
.action((n) => {
|
|
551
|
+
setNostrRelayIdleMsV2(Number(n));
|
|
552
|
+
console.log(
|
|
553
|
+
JSON.stringify({ nostrRelayIdleMs: getNostrRelayIdleMsV2() }, null, 2),
|
|
554
|
+
);
|
|
555
|
+
});
|
|
556
|
+
nostr
|
|
557
|
+
.command("set-event-stuck-ms-v2 <n>")
|
|
558
|
+
.description("Set stuck threshold")
|
|
559
|
+
.action((n) => {
|
|
560
|
+
setNostrEventStuckMsV2(Number(n));
|
|
561
|
+
console.log(
|
|
562
|
+
JSON.stringify(
|
|
563
|
+
{ nostrEventStuckMs: getNostrEventStuckMsV2() },
|
|
564
|
+
null,
|
|
565
|
+
2,
|
|
566
|
+
),
|
|
567
|
+
);
|
|
568
|
+
});
|
|
569
|
+
nostr
|
|
570
|
+
.command("auto-offline-idle-relays-v2")
|
|
571
|
+
.description("Auto-offline idle relays")
|
|
572
|
+
.action(() => {
|
|
573
|
+
console.log(JSON.stringify(autoOfflineIdleNostrRelaysV2(), null, 2));
|
|
574
|
+
});
|
|
575
|
+
nostr
|
|
576
|
+
.command("auto-fail-stuck-events-v2")
|
|
577
|
+
.description("Auto-fail stuck publishing events")
|
|
578
|
+
.action(() => {
|
|
579
|
+
console.log(JSON.stringify(autoFailStuckNostrEventsV2(), null, 2));
|
|
580
|
+
});
|
|
581
|
+
nostr
|
|
582
|
+
.command("stats-v2")
|
|
583
|
+
.description("V2 aggregate stats")
|
|
584
|
+
.action(() => {
|
|
585
|
+
console.log(JSON.stringify(getNostrBridgeStatsV2(), null, 2));
|
|
586
|
+
});
|
|
436
587
|
}
|