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/slotfill.js
CHANGED
|
@@ -2,40 +2,153 @@
|
|
|
2
2
|
* `cc slotfill` — Slot Filler V2 governance overlay (in-memory, atop lib/slot-filler.js).
|
|
3
3
|
*/
|
|
4
4
|
import {
|
|
5
|
-
SLOTF_PROFILE_MATURITY_V2,
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
5
|
+
SLOTF_PROFILE_MATURITY_V2,
|
|
6
|
+
SLOTF_FILL_LIFECYCLE_V2,
|
|
7
|
+
setMaxActiveSlotfTemplatesPerOwnerV2,
|
|
8
|
+
getMaxActiveSlotfTemplatesPerOwnerV2,
|
|
9
|
+
setMaxPendingSlotfFillsPerTemplateV2,
|
|
10
|
+
getMaxPendingSlotfFillsPerTemplateV2,
|
|
11
|
+
setSlotfTemplateIdleMsV2,
|
|
12
|
+
getSlotfTemplateIdleMsV2,
|
|
13
|
+
setSlotfFillStuckMsV2,
|
|
14
|
+
getSlotfFillStuckMsV2,
|
|
15
|
+
registerSlotfTemplateV2,
|
|
16
|
+
activateSlotfTemplateV2,
|
|
17
|
+
staleSlotfTemplateV2,
|
|
18
|
+
archiveSlotfTemplateV2,
|
|
19
|
+
touchSlotfTemplateV2,
|
|
20
|
+
getSlotfTemplateV2,
|
|
21
|
+
listSlotfTemplatesV2,
|
|
22
|
+
createSlotfFillV2,
|
|
23
|
+
fillingSlotfFillV2,
|
|
24
|
+
fillSlotfFillV2,
|
|
25
|
+
failSlotfFillV2,
|
|
26
|
+
cancelSlotfFillV2,
|
|
27
|
+
getSlotfFillV2,
|
|
28
|
+
listSlotfFillsV2,
|
|
29
|
+
autoStaleIdleSlotfTemplatesV2,
|
|
30
|
+
autoFailStuckSlotfFillsV2,
|
|
31
|
+
getSlotFillerGovStatsV2,
|
|
32
|
+
_resetStateSlotFillerV2,
|
|
13
33
|
} from "../lib/slot-filler.js";
|
|
14
34
|
|
|
15
35
|
export function registerSlotfillCommand(program) {
|
|
16
|
-
const sf = program
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
sf.command("
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
sf.command("
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
36
|
+
const sf = program
|
|
37
|
+
.command("slotfill")
|
|
38
|
+
.description("Slot Filler V2 governance");
|
|
39
|
+
sf.command("enums-v2").action(() =>
|
|
40
|
+
console.log(
|
|
41
|
+
JSON.stringify(
|
|
42
|
+
{
|
|
43
|
+
profileMaturity: SLOTF_PROFILE_MATURITY_V2,
|
|
44
|
+
fillLifecycle: SLOTF_FILL_LIFECYCLE_V2,
|
|
45
|
+
},
|
|
46
|
+
null,
|
|
47
|
+
2,
|
|
48
|
+
),
|
|
49
|
+
),
|
|
50
|
+
);
|
|
51
|
+
sf.command("config-v2").action(() =>
|
|
52
|
+
console.log(
|
|
53
|
+
JSON.stringify(
|
|
54
|
+
{
|
|
55
|
+
maxActiveSlotfTemplatesPerOwner:
|
|
56
|
+
getMaxActiveSlotfTemplatesPerOwnerV2(),
|
|
57
|
+
maxPendingSlotfFillsPerTemplate:
|
|
58
|
+
getMaxPendingSlotfFillsPerTemplateV2(),
|
|
59
|
+
slotfTemplateIdleMs: getSlotfTemplateIdleMsV2(),
|
|
60
|
+
slotfFillStuckMs: getSlotfFillStuckMsV2(),
|
|
61
|
+
},
|
|
62
|
+
null,
|
|
63
|
+
2,
|
|
64
|
+
),
|
|
65
|
+
),
|
|
66
|
+
);
|
|
67
|
+
sf.command("set-max-active-v2 <n>").action((n) => {
|
|
68
|
+
setMaxActiveSlotfTemplatesPerOwnerV2(Number(n));
|
|
69
|
+
console.log("ok");
|
|
70
|
+
});
|
|
71
|
+
sf.command("set-max-pending-v2 <n>").action((n) => {
|
|
72
|
+
setMaxPendingSlotfFillsPerTemplateV2(Number(n));
|
|
73
|
+
console.log("ok");
|
|
74
|
+
});
|
|
75
|
+
sf.command("set-idle-ms-v2 <n>").action((n) => {
|
|
76
|
+
setSlotfTemplateIdleMsV2(Number(n));
|
|
77
|
+
console.log("ok");
|
|
78
|
+
});
|
|
79
|
+
sf.command("set-stuck-ms-v2 <n>").action((n) => {
|
|
80
|
+
setSlotfFillStuckMsV2(Number(n));
|
|
81
|
+
console.log("ok");
|
|
82
|
+
});
|
|
83
|
+
sf.command("register-template-v2 <id> <owner>")
|
|
84
|
+
.option("--schema <s>", "schema")
|
|
85
|
+
.action((id, owner, o) =>
|
|
86
|
+
console.log(
|
|
87
|
+
JSON.stringify(
|
|
88
|
+
registerSlotfTemplateV2({ id, owner, schema: o.schema }),
|
|
89
|
+
null,
|
|
90
|
+
2,
|
|
91
|
+
),
|
|
92
|
+
),
|
|
93
|
+
);
|
|
94
|
+
sf.command("activate-template-v2 <id>").action((id) =>
|
|
95
|
+
console.log(JSON.stringify(activateSlotfTemplateV2(id), null, 2)),
|
|
96
|
+
);
|
|
97
|
+
sf.command("stale-template-v2 <id>").action((id) =>
|
|
98
|
+
console.log(JSON.stringify(staleSlotfTemplateV2(id), null, 2)),
|
|
99
|
+
);
|
|
100
|
+
sf.command("archive-template-v2 <id>").action((id) =>
|
|
101
|
+
console.log(JSON.stringify(archiveSlotfTemplateV2(id), null, 2)),
|
|
102
|
+
);
|
|
103
|
+
sf.command("touch-template-v2 <id>").action((id) =>
|
|
104
|
+
console.log(JSON.stringify(touchSlotfTemplateV2(id), null, 2)),
|
|
105
|
+
);
|
|
106
|
+
sf.command("get-template-v2 <id>").action((id) =>
|
|
107
|
+
console.log(JSON.stringify(getSlotfTemplateV2(id), null, 2)),
|
|
108
|
+
);
|
|
109
|
+
sf.command("list-templates-v2").action(() =>
|
|
110
|
+
console.log(JSON.stringify(listSlotfTemplatesV2(), null, 2)),
|
|
111
|
+
);
|
|
112
|
+
sf.command("create-fill-v2 <id> <templateId>")
|
|
113
|
+
.option("--input <s>", "input")
|
|
114
|
+
.action((id, templateId, o) =>
|
|
115
|
+
console.log(
|
|
116
|
+
JSON.stringify(
|
|
117
|
+
createSlotfFillV2({ id, templateId, input: o.input }),
|
|
118
|
+
null,
|
|
119
|
+
2,
|
|
120
|
+
),
|
|
121
|
+
),
|
|
122
|
+
);
|
|
123
|
+
sf.command("filling-fill-v2 <id>").action((id) =>
|
|
124
|
+
console.log(JSON.stringify(fillingSlotfFillV2(id), null, 2)),
|
|
125
|
+
);
|
|
126
|
+
sf.command("fill-fill-v2 <id>").action((id) =>
|
|
127
|
+
console.log(JSON.stringify(fillSlotfFillV2(id), null, 2)),
|
|
128
|
+
);
|
|
129
|
+
sf.command("fail-fill-v2 <id> [reason]").action((id, reason) =>
|
|
130
|
+
console.log(JSON.stringify(failSlotfFillV2(id, reason), null, 2)),
|
|
131
|
+
);
|
|
132
|
+
sf.command("cancel-fill-v2 <id> [reason]").action((id, reason) =>
|
|
133
|
+
console.log(JSON.stringify(cancelSlotfFillV2(id, reason), null, 2)),
|
|
134
|
+
);
|
|
135
|
+
sf.command("get-fill-v2 <id>").action((id) =>
|
|
136
|
+
console.log(JSON.stringify(getSlotfFillV2(id), null, 2)),
|
|
137
|
+
);
|
|
138
|
+
sf.command("list-fills-v2").action(() =>
|
|
139
|
+
console.log(JSON.stringify(listSlotfFillsV2(), null, 2)),
|
|
140
|
+
);
|
|
141
|
+
sf.command("auto-stale-idle-v2").action(() =>
|
|
142
|
+
console.log(JSON.stringify(autoStaleIdleSlotfTemplatesV2(), null, 2)),
|
|
143
|
+
);
|
|
144
|
+
sf.command("auto-fail-stuck-v2").action(() =>
|
|
145
|
+
console.log(JSON.stringify(autoFailStuckSlotfFillsV2(), null, 2)),
|
|
146
|
+
);
|
|
147
|
+
sf.command("gov-stats-v2").action(() =>
|
|
148
|
+
console.log(JSON.stringify(getSlotFillerGovStatsV2(), null, 2)),
|
|
149
|
+
);
|
|
150
|
+
sf.command("reset-state-v2").action(() => {
|
|
151
|
+
_resetStateSlotFillerV2();
|
|
152
|
+
console.log(JSON.stringify({ ok: true }, null, 2));
|
|
153
|
+
});
|
|
41
154
|
}
|
package/src/commands/social.js
CHANGED
|
@@ -63,14 +63,34 @@ import {
|
|
|
63
63
|
loadFromDb as graphLoadFromDb,
|
|
64
64
|
subscribe as graphSubscribe,
|
|
65
65
|
EDGE_TYPES,
|
|
66
|
-
SG_NODE_MATURITY_V2,
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
66
|
+
SG_NODE_MATURITY_V2,
|
|
67
|
+
SG_EDGE_LIFECYCLE_V2,
|
|
68
|
+
setMaxActiveSgNodesPerOwnerV2,
|
|
69
|
+
getMaxActiveSgNodesPerOwnerV2,
|
|
70
|
+
setMaxPendingSgEdgesPerNodeV2,
|
|
71
|
+
getMaxPendingSgEdgesPerNodeV2,
|
|
72
|
+
setSgNodeIdleMsV2,
|
|
73
|
+
getSgNodeIdleMsV2,
|
|
74
|
+
setSgEdgeStuckMsV2,
|
|
75
|
+
getSgEdgeStuckMsV2,
|
|
76
|
+
registerSgNodeV2,
|
|
77
|
+
activateSgNodeV2,
|
|
78
|
+
deactivateSgNodeV2,
|
|
79
|
+
removeSgNodeV2,
|
|
80
|
+
touchSgNodeV2,
|
|
81
|
+
getSgNodeV2,
|
|
82
|
+
listSgNodesV2,
|
|
83
|
+
createSgEdgeV2,
|
|
84
|
+
establishSgEdgeV2,
|
|
85
|
+
severSgEdgeV2,
|
|
86
|
+
expireSgEdgeV2,
|
|
87
|
+
cancelSgEdgeV2,
|
|
88
|
+
getSgEdgeV2,
|
|
89
|
+
listSgEdgesV2,
|
|
90
|
+
autoDeactivateIdleSgNodesV2,
|
|
91
|
+
autoExpireStaleSgEdgesV2,
|
|
92
|
+
getSocialGraphGovStatsV2,
|
|
93
|
+
_resetStateSocialGraphV2,
|
|
74
94
|
} from "../lib/social-graph.js";
|
|
75
95
|
import {
|
|
76
96
|
METRICS as ANALYTICS_METRICS,
|
|
@@ -1319,28 +1339,334 @@ export function registerSocialCommand(program) {
|
|
|
1319
1339
|
});
|
|
1320
1340
|
|
|
1321
1341
|
// ===== Social Graph V2 governance overlay (sg-*-v2 prefix) =====
|
|
1322
|
-
social.command("sg-enums-v2").action(() =>
|
|
1323
|
-
|
|
1324
|
-
|
|
1325
|
-
|
|
1326
|
-
|
|
1327
|
-
|
|
1328
|
-
|
|
1329
|
-
|
|
1330
|
-
|
|
1331
|
-
|
|
1332
|
-
|
|
1333
|
-
|
|
1334
|
-
social.command("sg-
|
|
1335
|
-
|
|
1336
|
-
|
|
1337
|
-
|
|
1338
|
-
|
|
1339
|
-
|
|
1340
|
-
|
|
1341
|
-
|
|
1342
|
-
|
|
1343
|
-
|
|
1344
|
-
|
|
1345
|
-
|
|
1342
|
+
social.command("sg-enums-v2").action(() =>
|
|
1343
|
+
console.log(
|
|
1344
|
+
JSON.stringify(
|
|
1345
|
+
{
|
|
1346
|
+
nodeMaturity: SG_NODE_MATURITY_V2,
|
|
1347
|
+
edgeLifecycle: SG_EDGE_LIFECYCLE_V2,
|
|
1348
|
+
},
|
|
1349
|
+
null,
|
|
1350
|
+
2,
|
|
1351
|
+
),
|
|
1352
|
+
),
|
|
1353
|
+
);
|
|
1354
|
+
social.command("sg-config-v2").action(() =>
|
|
1355
|
+
console.log(
|
|
1356
|
+
JSON.stringify(
|
|
1357
|
+
{
|
|
1358
|
+
maxActiveSgNodesPerOwner: getMaxActiveSgNodesPerOwnerV2(),
|
|
1359
|
+
maxPendingSgEdgesPerNode: getMaxPendingSgEdgesPerNodeV2(),
|
|
1360
|
+
sgNodeIdleMs: getSgNodeIdleMsV2(),
|
|
1361
|
+
sgEdgeStuckMs: getSgEdgeStuckMsV2(),
|
|
1362
|
+
},
|
|
1363
|
+
null,
|
|
1364
|
+
2,
|
|
1365
|
+
),
|
|
1366
|
+
),
|
|
1367
|
+
);
|
|
1368
|
+
social.command("sg-set-max-active-v2 <n>").action((n) => {
|
|
1369
|
+
setMaxActiveSgNodesPerOwnerV2(Number(n));
|
|
1370
|
+
console.log("ok");
|
|
1371
|
+
});
|
|
1372
|
+
social.command("sg-set-max-pending-v2 <n>").action((n) => {
|
|
1373
|
+
setMaxPendingSgEdgesPerNodeV2(Number(n));
|
|
1374
|
+
console.log("ok");
|
|
1375
|
+
});
|
|
1376
|
+
social.command("sg-set-idle-ms-v2 <n>").action((n) => {
|
|
1377
|
+
setSgNodeIdleMsV2(Number(n));
|
|
1378
|
+
console.log("ok");
|
|
1379
|
+
});
|
|
1380
|
+
social.command("sg-set-stuck-ms-v2 <n>").action((n) => {
|
|
1381
|
+
setSgEdgeStuckMsV2(Number(n));
|
|
1382
|
+
console.log("ok");
|
|
1383
|
+
});
|
|
1384
|
+
social
|
|
1385
|
+
.command("sg-register-node-v2 <id> <owner>")
|
|
1386
|
+
.option("--handle <h>", "handle")
|
|
1387
|
+
.action((id, owner, o) =>
|
|
1388
|
+
console.log(
|
|
1389
|
+
JSON.stringify(
|
|
1390
|
+
registerSgNodeV2({ id, owner, handle: o.handle }),
|
|
1391
|
+
null,
|
|
1392
|
+
2,
|
|
1393
|
+
),
|
|
1394
|
+
),
|
|
1395
|
+
);
|
|
1396
|
+
social
|
|
1397
|
+
.command("sg-activate-node-v2 <id>")
|
|
1398
|
+
.action((id) => console.log(JSON.stringify(activateSgNodeV2(id), null, 2)));
|
|
1399
|
+
social
|
|
1400
|
+
.command("sg-deactivate-node-v2 <id>")
|
|
1401
|
+
.action((id) =>
|
|
1402
|
+
console.log(JSON.stringify(deactivateSgNodeV2(id), null, 2)),
|
|
1403
|
+
);
|
|
1404
|
+
social
|
|
1405
|
+
.command("sg-remove-node-v2 <id>")
|
|
1406
|
+
.action((id) => console.log(JSON.stringify(removeSgNodeV2(id), null, 2)));
|
|
1407
|
+
social
|
|
1408
|
+
.command("sg-touch-node-v2 <id>")
|
|
1409
|
+
.action((id) => console.log(JSON.stringify(touchSgNodeV2(id), null, 2)));
|
|
1410
|
+
social
|
|
1411
|
+
.command("sg-get-node-v2 <id>")
|
|
1412
|
+
.action((id) => console.log(JSON.stringify(getSgNodeV2(id), null, 2)));
|
|
1413
|
+
social
|
|
1414
|
+
.command("sg-list-nodes-v2")
|
|
1415
|
+
.action(() => console.log(JSON.stringify(listSgNodesV2(), null, 2)));
|
|
1416
|
+
social
|
|
1417
|
+
.command("sg-create-edge-v2 <id> <nodeId>")
|
|
1418
|
+
.option("--target <t>", "targetId")
|
|
1419
|
+
.action((id, nodeId, o) =>
|
|
1420
|
+
console.log(
|
|
1421
|
+
JSON.stringify(
|
|
1422
|
+
createSgEdgeV2({ id, nodeId, targetId: o.target }),
|
|
1423
|
+
null,
|
|
1424
|
+
2,
|
|
1425
|
+
),
|
|
1426
|
+
),
|
|
1427
|
+
);
|
|
1428
|
+
social
|
|
1429
|
+
.command("sg-establish-edge-v2 <id>")
|
|
1430
|
+
.action((id) =>
|
|
1431
|
+
console.log(JSON.stringify(establishSgEdgeV2(id), null, 2)),
|
|
1432
|
+
);
|
|
1433
|
+
social
|
|
1434
|
+
.command("sg-sever-edge-v2 <id> [reason]")
|
|
1435
|
+
.action((id, reason) =>
|
|
1436
|
+
console.log(JSON.stringify(severSgEdgeV2(id, reason), null, 2)),
|
|
1437
|
+
);
|
|
1438
|
+
social
|
|
1439
|
+
.command("sg-expire-edge-v2 <id>")
|
|
1440
|
+
.action((id) => console.log(JSON.stringify(expireSgEdgeV2(id), null, 2)));
|
|
1441
|
+
social
|
|
1442
|
+
.command("sg-cancel-edge-v2 <id> [reason]")
|
|
1443
|
+
.action((id, reason) =>
|
|
1444
|
+
console.log(JSON.stringify(cancelSgEdgeV2(id, reason), null, 2)),
|
|
1445
|
+
);
|
|
1446
|
+
social
|
|
1447
|
+
.command("sg-get-edge-v2 <id>")
|
|
1448
|
+
.action((id) => console.log(JSON.stringify(getSgEdgeV2(id), null, 2)));
|
|
1449
|
+
social
|
|
1450
|
+
.command("sg-list-edges-v2")
|
|
1451
|
+
.action(() => console.log(JSON.stringify(listSgEdgesV2(), null, 2)));
|
|
1452
|
+
social
|
|
1453
|
+
.command("sg-auto-deactivate-idle-v2")
|
|
1454
|
+
.action(() =>
|
|
1455
|
+
console.log(JSON.stringify(autoDeactivateIdleSgNodesV2(), null, 2)),
|
|
1456
|
+
);
|
|
1457
|
+
social
|
|
1458
|
+
.command("sg-auto-expire-stale-v2")
|
|
1459
|
+
.action(() =>
|
|
1460
|
+
console.log(JSON.stringify(autoExpireStaleSgEdgesV2(), null, 2)),
|
|
1461
|
+
);
|
|
1462
|
+
social
|
|
1463
|
+
.command("sg-gov-stats-v2")
|
|
1464
|
+
.action(() =>
|
|
1465
|
+
console.log(JSON.stringify(getSocialGraphGovStatsV2(), null, 2)),
|
|
1466
|
+
);
|
|
1467
|
+
social.command("sg-reset-state-v2").action(() => {
|
|
1468
|
+
_resetStateSocialGraphV2();
|
|
1469
|
+
console.log(JSON.stringify({ ok: true }, null, 2));
|
|
1470
|
+
});
|
|
1471
|
+
}
|
|
1472
|
+
|
|
1473
|
+
// === Iter22 V2 governance overlay ===
|
|
1474
|
+
export function registerSmgovV2Commands(program) {
|
|
1475
|
+
const parent = program.commands.find((c) => c.name() === "social");
|
|
1476
|
+
if (!parent) return;
|
|
1477
|
+
const L = async () => await import("../lib/social-manager.js");
|
|
1478
|
+
parent
|
|
1479
|
+
.command("smgov-enums-v2")
|
|
1480
|
+
.description("Show V2 enums")
|
|
1481
|
+
.action(async () => {
|
|
1482
|
+
const m = await L();
|
|
1483
|
+
console.log(
|
|
1484
|
+
JSON.stringify(
|
|
1485
|
+
{
|
|
1486
|
+
profileMaturity: m.SMGOV_PROFILE_MATURITY_V2,
|
|
1487
|
+
postLifecycle: m.SMGOV_POST_LIFECYCLE_V2,
|
|
1488
|
+
},
|
|
1489
|
+
null,
|
|
1490
|
+
2,
|
|
1491
|
+
),
|
|
1492
|
+
);
|
|
1493
|
+
});
|
|
1494
|
+
parent
|
|
1495
|
+
.command("smgov-config-v2")
|
|
1496
|
+
.description("Show V2 config")
|
|
1497
|
+
.action(async () => {
|
|
1498
|
+
const m = await L();
|
|
1499
|
+
console.log(
|
|
1500
|
+
JSON.stringify(
|
|
1501
|
+
{
|
|
1502
|
+
maxActive: m.getMaxActiveSmgovProfilesPerOwnerV2(),
|
|
1503
|
+
maxPending: m.getMaxPendingSmgovPostsPerProfileV2(),
|
|
1504
|
+
idleMs: m.getSmgovProfileIdleMsV2(),
|
|
1505
|
+
stuckMs: m.getSmgovPostStuckMsV2(),
|
|
1506
|
+
},
|
|
1507
|
+
null,
|
|
1508
|
+
2,
|
|
1509
|
+
),
|
|
1510
|
+
);
|
|
1511
|
+
});
|
|
1512
|
+
parent
|
|
1513
|
+
.command("smgov-set-max-active-v2 <n>")
|
|
1514
|
+
.description("Set max active")
|
|
1515
|
+
.action(async (n) => {
|
|
1516
|
+
(await L()).setMaxActiveSmgovProfilesPerOwnerV2(Number(n));
|
|
1517
|
+
console.log("ok");
|
|
1518
|
+
});
|
|
1519
|
+
parent
|
|
1520
|
+
.command("smgov-set-max-pending-v2 <n>")
|
|
1521
|
+
.description("Set max pending")
|
|
1522
|
+
.action(async (n) => {
|
|
1523
|
+
(await L()).setMaxPendingSmgovPostsPerProfileV2(Number(n));
|
|
1524
|
+
console.log("ok");
|
|
1525
|
+
});
|
|
1526
|
+
parent
|
|
1527
|
+
.command("smgov-set-idle-ms-v2 <n>")
|
|
1528
|
+
.description("Set idle threshold ms")
|
|
1529
|
+
.action(async (n) => {
|
|
1530
|
+
(await L()).setSmgovProfileIdleMsV2(Number(n));
|
|
1531
|
+
console.log("ok");
|
|
1532
|
+
});
|
|
1533
|
+
parent
|
|
1534
|
+
.command("smgov-set-stuck-ms-v2 <n>")
|
|
1535
|
+
.description("Set stuck threshold ms")
|
|
1536
|
+
.action(async (n) => {
|
|
1537
|
+
(await L()).setSmgovPostStuckMsV2(Number(n));
|
|
1538
|
+
console.log("ok");
|
|
1539
|
+
});
|
|
1540
|
+
parent
|
|
1541
|
+
.command("smgov-register-v2 <id> <owner>")
|
|
1542
|
+
.description("Register V2 profile")
|
|
1543
|
+
.option("--channel <v>", "channel")
|
|
1544
|
+
.action(async (id, owner, o) => {
|
|
1545
|
+
const m = await L();
|
|
1546
|
+
console.log(
|
|
1547
|
+
JSON.stringify(
|
|
1548
|
+
m.registerSmgovProfileV2({ id, owner, channel: o.channel }),
|
|
1549
|
+
null,
|
|
1550
|
+
2,
|
|
1551
|
+
),
|
|
1552
|
+
);
|
|
1553
|
+
});
|
|
1554
|
+
parent
|
|
1555
|
+
.command("smgov-activate-v2 <id>")
|
|
1556
|
+
.description("Activate profile")
|
|
1557
|
+
.action(async (id) => {
|
|
1558
|
+
console.log(
|
|
1559
|
+
JSON.stringify((await L()).activateSmgovProfileV2(id), null, 2),
|
|
1560
|
+
);
|
|
1561
|
+
});
|
|
1562
|
+
parent
|
|
1563
|
+
.command("smgov-mute-v2 <id>")
|
|
1564
|
+
.description("Mute profile")
|
|
1565
|
+
.action(async (id) => {
|
|
1566
|
+
console.log(JSON.stringify((await L()).muteSmgovProfileV2(id), null, 2));
|
|
1567
|
+
});
|
|
1568
|
+
parent
|
|
1569
|
+
.command("smgov-archive-v2 <id>")
|
|
1570
|
+
.description("Archive profile")
|
|
1571
|
+
.action(async (id) => {
|
|
1572
|
+
console.log(
|
|
1573
|
+
JSON.stringify((await L()).archiveSmgovProfileV2(id), null, 2),
|
|
1574
|
+
);
|
|
1575
|
+
});
|
|
1576
|
+
parent
|
|
1577
|
+
.command("smgov-touch-v2 <id>")
|
|
1578
|
+
.description("Touch profile")
|
|
1579
|
+
.action(async (id) => {
|
|
1580
|
+
console.log(JSON.stringify((await L()).touchSmgovProfileV2(id), null, 2));
|
|
1581
|
+
});
|
|
1582
|
+
parent
|
|
1583
|
+
.command("smgov-get-v2 <id>")
|
|
1584
|
+
.description("Get profile")
|
|
1585
|
+
.action(async (id) => {
|
|
1586
|
+
console.log(JSON.stringify((await L()).getSmgovProfileV2(id), null, 2));
|
|
1587
|
+
});
|
|
1588
|
+
parent
|
|
1589
|
+
.command("smgov-list-v2")
|
|
1590
|
+
.description("List profiles")
|
|
1591
|
+
.action(async () => {
|
|
1592
|
+
console.log(JSON.stringify((await L()).listSmgovProfilesV2(), null, 2));
|
|
1593
|
+
});
|
|
1594
|
+
parent
|
|
1595
|
+
.command("smgov-create-post-v2 <id> <profileId>")
|
|
1596
|
+
.description("Create post")
|
|
1597
|
+
.option("--author <v>", "author")
|
|
1598
|
+
.action(async (id, profileId, o) => {
|
|
1599
|
+
const m = await L();
|
|
1600
|
+
console.log(
|
|
1601
|
+
JSON.stringify(
|
|
1602
|
+
m.createSmgovPostV2({ id, profileId, author: o.author }),
|
|
1603
|
+
null,
|
|
1604
|
+
2,
|
|
1605
|
+
),
|
|
1606
|
+
);
|
|
1607
|
+
});
|
|
1608
|
+
parent
|
|
1609
|
+
.command("smgov-posting-post-v2 <id>")
|
|
1610
|
+
.description("Mark post as posting")
|
|
1611
|
+
.action(async (id) => {
|
|
1612
|
+
console.log(JSON.stringify((await L()).postingSmgovPostV2(id), null, 2));
|
|
1613
|
+
});
|
|
1614
|
+
parent
|
|
1615
|
+
.command("smgov-complete-post-v2 <id>")
|
|
1616
|
+
.description("Complete post")
|
|
1617
|
+
.action(async (id) => {
|
|
1618
|
+
console.log(JSON.stringify((await L()).completePostSmgovV2(id), null, 2));
|
|
1619
|
+
});
|
|
1620
|
+
parent
|
|
1621
|
+
.command("smgov-fail-post-v2 <id> [reason]")
|
|
1622
|
+
.description("Fail post")
|
|
1623
|
+
.action(async (id, reason) => {
|
|
1624
|
+
console.log(
|
|
1625
|
+
JSON.stringify((await L()).failSmgovPostV2(id, reason), null, 2),
|
|
1626
|
+
);
|
|
1627
|
+
});
|
|
1628
|
+
parent
|
|
1629
|
+
.command("smgov-cancel-post-v2 <id> [reason]")
|
|
1630
|
+
.description("Cancel post")
|
|
1631
|
+
.action(async (id, reason) => {
|
|
1632
|
+
console.log(
|
|
1633
|
+
JSON.stringify((await L()).cancelSmgovPostV2(id, reason), null, 2),
|
|
1634
|
+
);
|
|
1635
|
+
});
|
|
1636
|
+
parent
|
|
1637
|
+
.command("smgov-get-post-v2 <id>")
|
|
1638
|
+
.description("Get post")
|
|
1639
|
+
.action(async (id) => {
|
|
1640
|
+
console.log(JSON.stringify((await L()).getSmgovPostV2(id), null, 2));
|
|
1641
|
+
});
|
|
1642
|
+
parent
|
|
1643
|
+
.command("smgov-list-posts-v2")
|
|
1644
|
+
.description("List posts")
|
|
1645
|
+
.action(async () => {
|
|
1646
|
+
console.log(JSON.stringify((await L()).listSmgovPostsV2(), null, 2));
|
|
1647
|
+
});
|
|
1648
|
+
parent
|
|
1649
|
+
.command("smgov-auto-mute-idle-v2")
|
|
1650
|
+
.description("Auto-mute idle")
|
|
1651
|
+
.action(async () => {
|
|
1652
|
+
console.log(
|
|
1653
|
+
JSON.stringify((await L()).autoMuteIdleSmgovProfilesV2(), null, 2),
|
|
1654
|
+
);
|
|
1655
|
+
});
|
|
1656
|
+
parent
|
|
1657
|
+
.command("smgov-auto-fail-stuck-v2")
|
|
1658
|
+
.description("Auto-fail stuck posts")
|
|
1659
|
+
.action(async () => {
|
|
1660
|
+
console.log(
|
|
1661
|
+
JSON.stringify((await L()).autoFailStuckSmgovPostsV2(), null, 2),
|
|
1662
|
+
);
|
|
1663
|
+
});
|
|
1664
|
+
parent
|
|
1665
|
+
.command("smgov-gov-stats-v2")
|
|
1666
|
+
.description("V2 gov stats")
|
|
1667
|
+
.action(async () => {
|
|
1668
|
+
console.log(
|
|
1669
|
+
JSON.stringify((await L()).getSocialManagerGovStatsV2(), null, 2),
|
|
1670
|
+
);
|
|
1671
|
+
});
|
|
1346
1672
|
}
|