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/topiccls.js
CHANGED
|
@@ -6,40 +6,153 @@
|
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
8
|
import {
|
|
9
|
-
TOPIC_CLS_PROFILE_MATURITY_V2,
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
9
|
+
TOPIC_CLS_PROFILE_MATURITY_V2,
|
|
10
|
+
TOPIC_CLS_JOB_LIFECYCLE_V2,
|
|
11
|
+
setMaxActiveTopicClsProfilesPerOwnerV2,
|
|
12
|
+
getMaxActiveTopicClsProfilesPerOwnerV2,
|
|
13
|
+
setMaxPendingTopicClsJobsPerProfileV2,
|
|
14
|
+
getMaxPendingTopicClsJobsPerProfileV2,
|
|
15
|
+
setTopicClsProfileIdleMsV2,
|
|
16
|
+
getTopicClsProfileIdleMsV2,
|
|
17
|
+
setTopicClsJobStuckMsV2,
|
|
18
|
+
getTopicClsJobStuckMsV2,
|
|
19
|
+
registerTopicClsProfileV2,
|
|
20
|
+
activateTopicClsProfileV2,
|
|
21
|
+
staleTopicClsProfileV2,
|
|
22
|
+
archiveTopicClsProfileV2,
|
|
23
|
+
touchTopicClsProfileV2,
|
|
24
|
+
getTopicClsProfileV2,
|
|
25
|
+
listTopicClsProfilesV2,
|
|
26
|
+
createTopicClsJobV2,
|
|
27
|
+
startTopicClsJobV2,
|
|
28
|
+
completeTopicClsJobV2,
|
|
29
|
+
failTopicClsJobV2,
|
|
30
|
+
cancelTopicClsJobV2,
|
|
31
|
+
getTopicClsJobV2,
|
|
32
|
+
listTopicClsJobsV2,
|
|
33
|
+
autoStaleIdleTopicClsProfilesV2,
|
|
34
|
+
autoFailStuckTopicClsJobsV2,
|
|
35
|
+
getTopicClassifierGovStatsV2,
|
|
36
|
+
_resetStateTopicClsV2,
|
|
17
37
|
} from "../lib/topic-classifier.js";
|
|
18
38
|
|
|
19
39
|
export function registerTopicClsCommand(program) {
|
|
20
|
-
const tc = program
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
tc.command("
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
tc.command("
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
40
|
+
const tc = program
|
|
41
|
+
.command("topiccls")
|
|
42
|
+
.description("Topic Classifier V2 governance");
|
|
43
|
+
tc.command("enums-v2").action(() =>
|
|
44
|
+
console.log(
|
|
45
|
+
JSON.stringify(
|
|
46
|
+
{
|
|
47
|
+
profileMaturity: TOPIC_CLS_PROFILE_MATURITY_V2,
|
|
48
|
+
jobLifecycle: TOPIC_CLS_JOB_LIFECYCLE_V2,
|
|
49
|
+
},
|
|
50
|
+
null,
|
|
51
|
+
2,
|
|
52
|
+
),
|
|
53
|
+
),
|
|
54
|
+
);
|
|
55
|
+
tc.command("config-v2").action(() =>
|
|
56
|
+
console.log(
|
|
57
|
+
JSON.stringify(
|
|
58
|
+
{
|
|
59
|
+
maxActiveTopicClsProfilesPerOwner:
|
|
60
|
+
getMaxActiveTopicClsProfilesPerOwnerV2(),
|
|
61
|
+
maxPendingTopicClsJobsPerProfile:
|
|
62
|
+
getMaxPendingTopicClsJobsPerProfileV2(),
|
|
63
|
+
topicClsProfileIdleMs: getTopicClsProfileIdleMsV2(),
|
|
64
|
+
topicClsJobStuckMs: getTopicClsJobStuckMsV2(),
|
|
65
|
+
},
|
|
66
|
+
null,
|
|
67
|
+
2,
|
|
68
|
+
),
|
|
69
|
+
),
|
|
70
|
+
);
|
|
71
|
+
tc.command("set-max-active-v2 <n>").action((n) => {
|
|
72
|
+
setMaxActiveTopicClsProfilesPerOwnerV2(Number(n));
|
|
73
|
+
console.log("ok");
|
|
74
|
+
});
|
|
75
|
+
tc.command("set-max-pending-v2 <n>").action((n) => {
|
|
76
|
+
setMaxPendingTopicClsJobsPerProfileV2(Number(n));
|
|
77
|
+
console.log("ok");
|
|
78
|
+
});
|
|
79
|
+
tc.command("set-idle-ms-v2 <n>").action((n) => {
|
|
80
|
+
setTopicClsProfileIdleMsV2(Number(n));
|
|
81
|
+
console.log("ok");
|
|
82
|
+
});
|
|
83
|
+
tc.command("set-stuck-ms-v2 <n>").action((n) => {
|
|
84
|
+
setTopicClsJobStuckMsV2(Number(n));
|
|
85
|
+
console.log("ok");
|
|
86
|
+
});
|
|
87
|
+
tc.command("register-profile-v2 <id> <owner>")
|
|
88
|
+
.option("--model <m>", "model")
|
|
89
|
+
.action((id, owner, o) =>
|
|
90
|
+
console.log(
|
|
91
|
+
JSON.stringify(
|
|
92
|
+
registerTopicClsProfileV2({ id, owner, model: o.model }),
|
|
93
|
+
null,
|
|
94
|
+
2,
|
|
95
|
+
),
|
|
96
|
+
),
|
|
97
|
+
);
|
|
98
|
+
tc.command("activate-profile-v2 <id>").action((id) =>
|
|
99
|
+
console.log(JSON.stringify(activateTopicClsProfileV2(id), null, 2)),
|
|
100
|
+
);
|
|
101
|
+
tc.command("stale-profile-v2 <id>").action((id) =>
|
|
102
|
+
console.log(JSON.stringify(staleTopicClsProfileV2(id), null, 2)),
|
|
103
|
+
);
|
|
104
|
+
tc.command("archive-profile-v2 <id>").action((id) =>
|
|
105
|
+
console.log(JSON.stringify(archiveTopicClsProfileV2(id), null, 2)),
|
|
106
|
+
);
|
|
107
|
+
tc.command("touch-profile-v2 <id>").action((id) =>
|
|
108
|
+
console.log(JSON.stringify(touchTopicClsProfileV2(id), null, 2)),
|
|
109
|
+
);
|
|
110
|
+
tc.command("get-profile-v2 <id>").action((id) =>
|
|
111
|
+
console.log(JSON.stringify(getTopicClsProfileV2(id), null, 2)),
|
|
112
|
+
);
|
|
113
|
+
tc.command("list-profiles-v2").action(() =>
|
|
114
|
+
console.log(JSON.stringify(listTopicClsProfilesV2(), null, 2)),
|
|
115
|
+
);
|
|
116
|
+
tc.command("create-job-v2 <id> <profileId>")
|
|
117
|
+
.option("--text <t>", "text")
|
|
118
|
+
.action((id, profileId, o) =>
|
|
119
|
+
console.log(
|
|
120
|
+
JSON.stringify(
|
|
121
|
+
createTopicClsJobV2({ id, profileId, text: o.text }),
|
|
122
|
+
null,
|
|
123
|
+
2,
|
|
124
|
+
),
|
|
125
|
+
),
|
|
126
|
+
);
|
|
127
|
+
tc.command("start-job-v2 <id>").action((id) =>
|
|
128
|
+
console.log(JSON.stringify(startTopicClsJobV2(id), null, 2)),
|
|
129
|
+
);
|
|
130
|
+
tc.command("complete-job-v2 <id>").action((id) =>
|
|
131
|
+
console.log(JSON.stringify(completeTopicClsJobV2(id), null, 2)),
|
|
132
|
+
);
|
|
133
|
+
tc.command("fail-job-v2 <id> [reason]").action((id, reason) =>
|
|
134
|
+
console.log(JSON.stringify(failTopicClsJobV2(id, reason), null, 2)),
|
|
135
|
+
);
|
|
136
|
+
tc.command("cancel-job-v2 <id> [reason]").action((id, reason) =>
|
|
137
|
+
console.log(JSON.stringify(cancelTopicClsJobV2(id, reason), null, 2)),
|
|
138
|
+
);
|
|
139
|
+
tc.command("get-job-v2 <id>").action((id) =>
|
|
140
|
+
console.log(JSON.stringify(getTopicClsJobV2(id), null, 2)),
|
|
141
|
+
);
|
|
142
|
+
tc.command("list-jobs-v2").action(() =>
|
|
143
|
+
console.log(JSON.stringify(listTopicClsJobsV2(), null, 2)),
|
|
144
|
+
);
|
|
145
|
+
tc.command("auto-stale-idle-v2").action(() =>
|
|
146
|
+
console.log(JSON.stringify(autoStaleIdleTopicClsProfilesV2(), null, 2)),
|
|
147
|
+
);
|
|
148
|
+
tc.command("auto-fail-stuck-v2").action(() =>
|
|
149
|
+
console.log(JSON.stringify(autoFailStuckTopicClsJobsV2(), null, 2)),
|
|
150
|
+
);
|
|
151
|
+
tc.command("gov-stats-v2").action(() =>
|
|
152
|
+
console.log(JSON.stringify(getTopicClassifierGovStatsV2(), null, 2)),
|
|
153
|
+
);
|
|
154
|
+
tc.command("reset-state-v2").action(() => {
|
|
155
|
+
_resetStateTopicClsV2();
|
|
156
|
+
console.log(JSON.stringify({ ok: true }, null, 2));
|
|
157
|
+
});
|
|
45
158
|
}
|
package/src/commands/trust.js
CHANGED
|
@@ -613,3 +613,220 @@ export function registerTrustCommand(program) {
|
|
|
613
613
|
|
|
614
614
|
program.addCommand(tr);
|
|
615
615
|
}
|
|
616
|
+
|
|
617
|
+
// === Iter18 V2 governance overlay ===
|
|
618
|
+
export function registerTrustgovV2Commands(program) {
|
|
619
|
+
const parent = program.commands.find((c) => c.name() === "trust");
|
|
620
|
+
if (!parent) return;
|
|
621
|
+
const L = async () => await import("../lib/trust-security.js");
|
|
622
|
+
parent
|
|
623
|
+
.command("trustgov-enums-v2")
|
|
624
|
+
.description("Show V2 enums")
|
|
625
|
+
.action(async () => {
|
|
626
|
+
const m = await L();
|
|
627
|
+
console.log(
|
|
628
|
+
JSON.stringify(
|
|
629
|
+
{
|
|
630
|
+
profileMaturity: m.TRUSTGOV_PROFILE_MATURITY_V2,
|
|
631
|
+
checkLifecycle: m.TRUSTGOV_CHECK_LIFECYCLE_V2,
|
|
632
|
+
},
|
|
633
|
+
null,
|
|
634
|
+
2,
|
|
635
|
+
),
|
|
636
|
+
);
|
|
637
|
+
});
|
|
638
|
+
parent
|
|
639
|
+
.command("trustgov-config-v2")
|
|
640
|
+
.description("Show V2 config")
|
|
641
|
+
.action(async () => {
|
|
642
|
+
const m = await L();
|
|
643
|
+
console.log(
|
|
644
|
+
JSON.stringify(
|
|
645
|
+
{
|
|
646
|
+
maxActive: m.getMaxActiveTrustgovProfilesPerOwnerV2(),
|
|
647
|
+
maxPending: m.getMaxPendingTrustgovChecksPerProfileV2(),
|
|
648
|
+
idleMs: m.getTrustgovProfileIdleMsV2(),
|
|
649
|
+
stuckMs: m.getTrustgovCheckStuckMsV2(),
|
|
650
|
+
},
|
|
651
|
+
null,
|
|
652
|
+
2,
|
|
653
|
+
),
|
|
654
|
+
);
|
|
655
|
+
});
|
|
656
|
+
parent
|
|
657
|
+
.command("trustgov-set-max-active-v2 <n>")
|
|
658
|
+
.description("Set max active")
|
|
659
|
+
.action(async (n) => {
|
|
660
|
+
(await L()).setMaxActiveTrustgovProfilesPerOwnerV2(Number(n));
|
|
661
|
+
console.log("ok");
|
|
662
|
+
});
|
|
663
|
+
parent
|
|
664
|
+
.command("trustgov-set-max-pending-v2 <n>")
|
|
665
|
+
.description("Set max pending")
|
|
666
|
+
.action(async (n) => {
|
|
667
|
+
(await L()).setMaxPendingTrustgovChecksPerProfileV2(Number(n));
|
|
668
|
+
console.log("ok");
|
|
669
|
+
});
|
|
670
|
+
parent
|
|
671
|
+
.command("trustgov-set-idle-ms-v2 <n>")
|
|
672
|
+
.description("Set idle threshold ms")
|
|
673
|
+
.action(async (n) => {
|
|
674
|
+
(await L()).setTrustgovProfileIdleMsV2(Number(n));
|
|
675
|
+
console.log("ok");
|
|
676
|
+
});
|
|
677
|
+
parent
|
|
678
|
+
.command("trustgov-set-stuck-ms-v2 <n>")
|
|
679
|
+
.description("Set stuck threshold ms")
|
|
680
|
+
.action(async (n) => {
|
|
681
|
+
(await L()).setTrustgovCheckStuckMsV2(Number(n));
|
|
682
|
+
console.log("ok");
|
|
683
|
+
});
|
|
684
|
+
parent
|
|
685
|
+
.command("trustgov-register-v2 <id> <owner>")
|
|
686
|
+
.description("Register V2 profile")
|
|
687
|
+
.option("--level <v>", "level")
|
|
688
|
+
.action(async (id, owner, o) => {
|
|
689
|
+
const m = await L();
|
|
690
|
+
console.log(
|
|
691
|
+
JSON.stringify(
|
|
692
|
+
m.registerTrustgovProfileV2({ id, owner, level: o.level }),
|
|
693
|
+
null,
|
|
694
|
+
2,
|
|
695
|
+
),
|
|
696
|
+
);
|
|
697
|
+
});
|
|
698
|
+
parent
|
|
699
|
+
.command("trustgov-activate-v2 <id>")
|
|
700
|
+
.description("Activate profile")
|
|
701
|
+
.action(async (id) => {
|
|
702
|
+
console.log(
|
|
703
|
+
JSON.stringify((await L()).activateTrustgovProfileV2(id), null, 2),
|
|
704
|
+
);
|
|
705
|
+
});
|
|
706
|
+
parent
|
|
707
|
+
.command("trustgov-suspend-v2 <id>")
|
|
708
|
+
.description("Suspend profile")
|
|
709
|
+
.action(async (id) => {
|
|
710
|
+
console.log(
|
|
711
|
+
JSON.stringify((await L()).suspendTrustgovProfileV2(id), null, 2),
|
|
712
|
+
);
|
|
713
|
+
});
|
|
714
|
+
parent
|
|
715
|
+
.command("trustgov-archive-v2 <id>")
|
|
716
|
+
.description("Archive profile")
|
|
717
|
+
.action(async (id) => {
|
|
718
|
+
console.log(
|
|
719
|
+
JSON.stringify((await L()).archiveTrustgovProfileV2(id), null, 2),
|
|
720
|
+
);
|
|
721
|
+
});
|
|
722
|
+
parent
|
|
723
|
+
.command("trustgov-touch-v2 <id>")
|
|
724
|
+
.description("Touch profile")
|
|
725
|
+
.action(async (id) => {
|
|
726
|
+
console.log(
|
|
727
|
+
JSON.stringify((await L()).touchTrustgovProfileV2(id), null, 2),
|
|
728
|
+
);
|
|
729
|
+
});
|
|
730
|
+
parent
|
|
731
|
+
.command("trustgov-get-v2 <id>")
|
|
732
|
+
.description("Get profile")
|
|
733
|
+
.action(async (id) => {
|
|
734
|
+
console.log(
|
|
735
|
+
JSON.stringify((await L()).getTrustgovProfileV2(id), null, 2),
|
|
736
|
+
);
|
|
737
|
+
});
|
|
738
|
+
parent
|
|
739
|
+
.command("trustgov-list-v2")
|
|
740
|
+
.description("List profiles")
|
|
741
|
+
.action(async () => {
|
|
742
|
+
console.log(
|
|
743
|
+
JSON.stringify((await L()).listTrustgovProfilesV2(), null, 2),
|
|
744
|
+
);
|
|
745
|
+
});
|
|
746
|
+
parent
|
|
747
|
+
.command("trustgov-create-check-v2 <id> <profileId>")
|
|
748
|
+
.description("Create check")
|
|
749
|
+
.option("--subject <v>", "subject")
|
|
750
|
+
.action(async (id, profileId, o) => {
|
|
751
|
+
const m = await L();
|
|
752
|
+
console.log(
|
|
753
|
+
JSON.stringify(
|
|
754
|
+
m.createTrustgovCheckV2({ id, profileId, subject: o.subject }),
|
|
755
|
+
null,
|
|
756
|
+
2,
|
|
757
|
+
),
|
|
758
|
+
);
|
|
759
|
+
});
|
|
760
|
+
parent
|
|
761
|
+
.command("trustgov-verifying-check-v2 <id>")
|
|
762
|
+
.description("Mark check as verifying")
|
|
763
|
+
.action(async (id) => {
|
|
764
|
+
console.log(
|
|
765
|
+
JSON.stringify((await L()).verifyingTrustgovCheckV2(id), null, 2),
|
|
766
|
+
);
|
|
767
|
+
});
|
|
768
|
+
parent
|
|
769
|
+
.command("trustgov-complete-check-v2 <id>")
|
|
770
|
+
.description("Complete check")
|
|
771
|
+
.action(async (id) => {
|
|
772
|
+
console.log(
|
|
773
|
+
JSON.stringify((await L()).completeCheckTrustgovV2(id), null, 2),
|
|
774
|
+
);
|
|
775
|
+
});
|
|
776
|
+
parent
|
|
777
|
+
.command("trustgov-fail-check-v2 <id> [reason]")
|
|
778
|
+
.description("Fail check")
|
|
779
|
+
.action(async (id, reason) => {
|
|
780
|
+
console.log(
|
|
781
|
+
JSON.stringify((await L()).failTrustgovCheckV2(id, reason), null, 2),
|
|
782
|
+
);
|
|
783
|
+
});
|
|
784
|
+
parent
|
|
785
|
+
.command("trustgov-cancel-check-v2 <id> [reason]")
|
|
786
|
+
.description("Cancel check")
|
|
787
|
+
.action(async (id, reason) => {
|
|
788
|
+
console.log(
|
|
789
|
+
JSON.stringify((await L()).cancelTrustgovCheckV2(id, reason), null, 2),
|
|
790
|
+
);
|
|
791
|
+
});
|
|
792
|
+
parent
|
|
793
|
+
.command("trustgov-get-check-v2 <id>")
|
|
794
|
+
.description("Get check")
|
|
795
|
+
.action(async (id) => {
|
|
796
|
+
console.log(JSON.stringify((await L()).getTrustgovCheckV2(id), null, 2));
|
|
797
|
+
});
|
|
798
|
+
parent
|
|
799
|
+
.command("trustgov-list-checks-v2")
|
|
800
|
+
.description("List checks")
|
|
801
|
+
.action(async () => {
|
|
802
|
+
console.log(JSON.stringify((await L()).listTrustgovChecksV2(), null, 2));
|
|
803
|
+
});
|
|
804
|
+
parent
|
|
805
|
+
.command("trustgov-auto-suspend-idle-v2")
|
|
806
|
+
.description("Auto-suspend idle")
|
|
807
|
+
.action(async () => {
|
|
808
|
+
console.log(
|
|
809
|
+
JSON.stringify(
|
|
810
|
+
(await L()).autoSuspendIdleTrustgovProfilesV2(),
|
|
811
|
+
null,
|
|
812
|
+
2,
|
|
813
|
+
),
|
|
814
|
+
);
|
|
815
|
+
});
|
|
816
|
+
parent
|
|
817
|
+
.command("trustgov-auto-fail-stuck-v2")
|
|
818
|
+
.description("Auto-fail stuck checks")
|
|
819
|
+
.action(async () => {
|
|
820
|
+
console.log(
|
|
821
|
+
JSON.stringify((await L()).autoFailStuckTrustgovChecksV2(), null, 2),
|
|
822
|
+
);
|
|
823
|
+
});
|
|
824
|
+
parent
|
|
825
|
+
.command("trustgov-gov-stats-v2")
|
|
826
|
+
.description("V2 gov stats")
|
|
827
|
+
.action(async () => {
|
|
828
|
+
console.log(
|
|
829
|
+
JSON.stringify((await L()).getTrustSecurityGovStatsV2(), null, 2),
|
|
830
|
+
);
|
|
831
|
+
});
|
|
832
|
+
}
|
package/src/commands/uprof.js
CHANGED
|
@@ -6,40 +6,149 @@
|
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
8
|
import {
|
|
9
|
-
USER_PROFILE_MATURITY_V2,
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
9
|
+
USER_PROFILE_MATURITY_V2,
|
|
10
|
+
USER_PREF_LIFECYCLE_V2,
|
|
11
|
+
setMaxActiveUserProfilesPerOwnerV2,
|
|
12
|
+
getMaxActiveUserProfilesPerOwnerV2,
|
|
13
|
+
setMaxPendingUserPrefsPerProfileV2,
|
|
14
|
+
getMaxPendingUserPrefsPerProfileV2,
|
|
15
|
+
setUserProfileIdleMsV2,
|
|
16
|
+
getUserProfileIdleMsV2,
|
|
17
|
+
setUserPrefStuckMsV2,
|
|
18
|
+
getUserPrefStuckMsV2,
|
|
19
|
+
registerUserProfileV2,
|
|
20
|
+
activateUserProfileV2,
|
|
21
|
+
dormantUserProfileV2,
|
|
22
|
+
archiveUserProfileV2,
|
|
23
|
+
touchUserProfileV2,
|
|
24
|
+
getUserProfileV2,
|
|
25
|
+
listUserProfilesV2,
|
|
26
|
+
createUserPrefV2,
|
|
27
|
+
applyUserPrefV2,
|
|
28
|
+
rejectUserPrefV2,
|
|
29
|
+
supersedeUserPrefV2,
|
|
30
|
+
cancelUserPrefV2,
|
|
31
|
+
getUserPrefV2,
|
|
32
|
+
listUserPrefsV2,
|
|
33
|
+
autoDormantIdleUserProfilesV2,
|
|
34
|
+
autoCancelStaleUserPrefsV2,
|
|
35
|
+
getUserProfileGovStatsV2,
|
|
36
|
+
_resetStateUserProfileV2,
|
|
17
37
|
} from "../lib/user-profile.js";
|
|
18
38
|
|
|
19
39
|
export function registerUprofCommand(program) {
|
|
20
40
|
const up = program.command("uprof").description("User Profile V2 governance");
|
|
21
|
-
up.command("enums-v2").action(() =>
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
up.command("
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
41
|
+
up.command("enums-v2").action(() =>
|
|
42
|
+
console.log(
|
|
43
|
+
JSON.stringify(
|
|
44
|
+
{
|
|
45
|
+
profileMaturity: USER_PROFILE_MATURITY_V2,
|
|
46
|
+
prefLifecycle: USER_PREF_LIFECYCLE_V2,
|
|
47
|
+
},
|
|
48
|
+
null,
|
|
49
|
+
2,
|
|
50
|
+
),
|
|
51
|
+
),
|
|
52
|
+
);
|
|
53
|
+
up.command("config-v2").action(() =>
|
|
54
|
+
console.log(
|
|
55
|
+
JSON.stringify(
|
|
56
|
+
{
|
|
57
|
+
maxActiveUserProfilesPerOwner: getMaxActiveUserProfilesPerOwnerV2(),
|
|
58
|
+
maxPendingUserPrefsPerProfile: getMaxPendingUserPrefsPerProfileV2(),
|
|
59
|
+
userProfileIdleMs: getUserProfileIdleMsV2(),
|
|
60
|
+
userPrefStuckMs: getUserPrefStuckMsV2(),
|
|
61
|
+
},
|
|
62
|
+
null,
|
|
63
|
+
2,
|
|
64
|
+
),
|
|
65
|
+
),
|
|
66
|
+
);
|
|
67
|
+
up.command("set-max-active-v2 <n>").action((n) => {
|
|
68
|
+
setMaxActiveUserProfilesPerOwnerV2(Number(n));
|
|
69
|
+
console.log("ok");
|
|
70
|
+
});
|
|
71
|
+
up.command("set-max-pending-v2 <n>").action((n) => {
|
|
72
|
+
setMaxPendingUserPrefsPerProfileV2(Number(n));
|
|
73
|
+
console.log("ok");
|
|
74
|
+
});
|
|
75
|
+
up.command("set-idle-ms-v2 <n>").action((n) => {
|
|
76
|
+
setUserProfileIdleMsV2(Number(n));
|
|
77
|
+
console.log("ok");
|
|
78
|
+
});
|
|
79
|
+
up.command("set-stuck-ms-v2 <n>").action((n) => {
|
|
80
|
+
setUserPrefStuckMsV2(Number(n));
|
|
81
|
+
console.log("ok");
|
|
82
|
+
});
|
|
83
|
+
up.command("register-profile-v2 <id> <owner>")
|
|
84
|
+
.option("--handle <h>", "handle")
|
|
85
|
+
.action((id, owner, o) =>
|
|
86
|
+
console.log(
|
|
87
|
+
JSON.stringify(
|
|
88
|
+
registerUserProfileV2({ id, owner, handle: o.handle }),
|
|
89
|
+
null,
|
|
90
|
+
2,
|
|
91
|
+
),
|
|
92
|
+
),
|
|
93
|
+
);
|
|
94
|
+
up.command("activate-profile-v2 <id>").action((id) =>
|
|
95
|
+
console.log(JSON.stringify(activateUserProfileV2(id), null, 2)),
|
|
96
|
+
);
|
|
97
|
+
up.command("dormant-profile-v2 <id>").action((id) =>
|
|
98
|
+
console.log(JSON.stringify(dormantUserProfileV2(id), null, 2)),
|
|
99
|
+
);
|
|
100
|
+
up.command("archive-profile-v2 <id>").action((id) =>
|
|
101
|
+
console.log(JSON.stringify(archiveUserProfileV2(id), null, 2)),
|
|
102
|
+
);
|
|
103
|
+
up.command("touch-profile-v2 <id>").action((id) =>
|
|
104
|
+
console.log(JSON.stringify(touchUserProfileV2(id), null, 2)),
|
|
105
|
+
);
|
|
106
|
+
up.command("get-profile-v2 <id>").action((id) =>
|
|
107
|
+
console.log(JSON.stringify(getUserProfileV2(id), null, 2)),
|
|
108
|
+
);
|
|
109
|
+
up.command("list-profiles-v2").action(() =>
|
|
110
|
+
console.log(JSON.stringify(listUserProfilesV2(), null, 2)),
|
|
111
|
+
);
|
|
112
|
+
up.command("create-pref-v2 <id> <profileId>")
|
|
113
|
+
.option("--key <k>", "key")
|
|
114
|
+
.action((id, profileId, o) =>
|
|
115
|
+
console.log(
|
|
116
|
+
JSON.stringify(
|
|
117
|
+
createUserPrefV2({ id, profileId, key: o.key }),
|
|
118
|
+
null,
|
|
119
|
+
2,
|
|
120
|
+
),
|
|
121
|
+
),
|
|
122
|
+
);
|
|
123
|
+
up.command("apply-pref-v2 <id>").action((id) =>
|
|
124
|
+
console.log(JSON.stringify(applyUserPrefV2(id), null, 2)),
|
|
125
|
+
);
|
|
126
|
+
up.command("reject-pref-v2 <id> [reason]").action((id, reason) =>
|
|
127
|
+
console.log(JSON.stringify(rejectUserPrefV2(id, reason), null, 2)),
|
|
128
|
+
);
|
|
129
|
+
up.command("supersede-pref-v2 <id>").action((id) =>
|
|
130
|
+
console.log(JSON.stringify(supersedeUserPrefV2(id), null, 2)),
|
|
131
|
+
);
|
|
132
|
+
up.command("cancel-pref-v2 <id> [reason]").action((id, reason) =>
|
|
133
|
+
console.log(JSON.stringify(cancelUserPrefV2(id, reason), null, 2)),
|
|
134
|
+
);
|
|
135
|
+
up.command("get-pref-v2 <id>").action((id) =>
|
|
136
|
+
console.log(JSON.stringify(getUserPrefV2(id), null, 2)),
|
|
137
|
+
);
|
|
138
|
+
up.command("list-prefs-v2").action(() =>
|
|
139
|
+
console.log(JSON.stringify(listUserPrefsV2(), null, 2)),
|
|
140
|
+
);
|
|
141
|
+
up.command("auto-dormant-idle-v2").action(() =>
|
|
142
|
+
console.log(JSON.stringify(autoDormantIdleUserProfilesV2(), null, 2)),
|
|
143
|
+
);
|
|
144
|
+
up.command("auto-cancel-stale-v2").action(() =>
|
|
145
|
+
console.log(JSON.stringify(autoCancelStaleUserPrefsV2(), null, 2)),
|
|
146
|
+
);
|
|
147
|
+
up.command("gov-stats-v2").action(() =>
|
|
148
|
+
console.log(JSON.stringify(getUserProfileGovStatsV2(), null, 2)),
|
|
149
|
+
);
|
|
150
|
+
up.command("reset-state-v2").action(() => {
|
|
151
|
+
_resetStateUserProfileV2();
|
|
152
|
+
console.log(JSON.stringify({ ok: true }, null, 2));
|
|
153
|
+
});
|
|
45
154
|
}
|