chainlesschain 0.81.0 → 0.132.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/bin/chainlesschain.js +0 -0
- package/package.json +1 -1
- package/src/commands/agent-network.js +254 -1
- package/src/commands/audit.js +302 -0
- package/src/commands/automation.js +271 -1
- package/src/commands/codegen.js +224 -0
- package/src/commands/collab.js +341 -0
- package/src/commands/compliance.js +1035 -0
- package/src/commands/cowork.js +221 -0
- package/src/commands/dbevo.js +284 -0
- package/src/commands/dev.js +252 -0
- package/src/commands/did.js +358 -0
- package/src/commands/encrypt.js +341 -0
- package/src/commands/export.js +256 -1
- package/src/commands/fusion.js +258 -0
- package/src/commands/governance.js +325 -0
- package/src/commands/hardening.js +411 -0
- package/src/commands/hook.js +148 -0
- package/src/commands/import.js +252 -0
- package/src/commands/incentive.js +322 -0
- package/src/commands/infra.js +244 -0
- package/src/commands/instinct.js +260 -0
- package/src/commands/ipfs.js +318 -0
- package/src/commands/kg.js +387 -0
- package/src/commands/llm.js +263 -0
- package/src/commands/mcp.js +221 -0
- package/src/commands/memory.js +248 -0
- package/src/commands/multimodal.js +296 -0
- package/src/commands/nlprog.js +356 -0
- package/src/commands/note.js +244 -0
- package/src/commands/ops.js +354 -0
- package/src/commands/orchestrate.js +166 -0
- package/src/commands/org.js +277 -0
- package/src/commands/p2p.js +390 -0
- package/src/commands/perception.js +290 -0
- package/src/commands/permmem.js +251 -0
- package/src/commands/plugin-ecosystem.js +273 -0
- package/src/commands/pqc.js +393 -0
- package/src/commands/quantization.js +351 -0
- package/src/commands/rcache.js +271 -0
- package/src/commands/recommend.js +340 -0
- package/src/commands/runtime.js +307 -0
- package/src/commands/scim.js +262 -0
- package/src/commands/session.js +258 -0
- package/src/commands/skill.js +267 -1
- package/src/commands/social.js +256 -0
- package/src/commands/sso.js +186 -1
- package/src/commands/sync.js +256 -0
- package/src/commands/tech.js +338 -0
- package/src/commands/tenant.js +351 -0
- package/src/commands/tokens.js +269 -0
- package/src/commands/trust.js +249 -0
- package/src/commands/wallet.js +277 -0
- package/src/commands/workflow.js +171 -0
- package/src/index.js +4 -0
- package/src/lib/agent-coordinator.js +325 -0
- package/src/lib/agent-network.js +387 -0
- package/src/lib/agent-router.js +395 -0
- package/src/lib/aiops.js +478 -0
- package/src/lib/audit-logger.js +379 -0
- package/src/lib/automation-engine.js +330 -0
- package/src/lib/autonomous-developer.js +350 -0
- package/src/lib/code-agent.js +323 -0
- package/src/lib/collaboration-governance.js +364 -0
- package/src/lib/community-governance.js +436 -0
- package/src/lib/compliance-manager.js +434 -0
- package/src/lib/content-recommendation.js +469 -0
- package/src/lib/crypto-manager.js +350 -0
- package/src/lib/dbevo.js +338 -0
- package/src/lib/decentral-infra.js +340 -0
- package/src/lib/did-manager.js +367 -0
- package/src/lib/hardening-manager.js +348 -0
- package/src/lib/hook-manager.js +380 -0
- package/src/lib/instinct-manager.js +332 -0
- package/src/lib/ipfs-storage.js +334 -0
- package/src/lib/knowledge-exporter.js +381 -0
- package/src/lib/knowledge-graph.js +432 -0
- package/src/lib/knowledge-importer.js +379 -0
- package/src/lib/llm-providers.js +391 -0
- package/src/lib/mcp-registry.js +333 -0
- package/src/lib/memory-manager.js +330 -0
- package/src/lib/multimodal.js +346 -0
- package/src/lib/nl-programming.js +343 -0
- package/src/lib/note-versioning.js +327 -0
- package/src/lib/org-manager.js +323 -0
- package/src/lib/p2p-manager.js +387 -0
- package/src/lib/perception.js +346 -0
- package/src/lib/perf-tuning.js +4 -1
- package/src/lib/permanent-memory.js +320 -0
- package/src/lib/plugin-ecosystem.js +377 -0
- package/src/lib/pqc-manager.js +368 -0
- package/src/lib/protocol-fusion.js +417 -0
- package/src/lib/quantization.js +325 -0
- package/src/lib/response-cache.js +327 -0
- package/src/lib/scim-manager.js +329 -0
- package/src/lib/session-manager.js +329 -0
- package/src/lib/skill-loader.js +377 -0
- package/src/lib/social-manager.js +326 -0
- package/src/lib/sso-manager.js +332 -0
- package/src/lib/sync-manager.js +326 -0
- package/src/lib/tech-learning-engine.js +369 -0
- package/src/lib/tenant-saas.js +460 -0
- package/src/lib/threat-intel.js +335 -0
- package/src/lib/token-incentive.js +293 -0
- package/src/lib/token-tracker.js +329 -0
- package/src/lib/trust-security.js +390 -0
- package/src/lib/ueba.js +389 -0
- package/src/lib/universal-runtime.js +325 -0
- package/src/lib/wallet-manager.js +326 -0
- package/src/lib/workflow-engine.js +322 -0
|
@@ -0,0 +1,251 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Permanent Memory V2 commands
|
|
3
|
+
* `cc permmem ...` — in-memory governance layer for cross-session
|
|
4
|
+
* pinned knowledge entries + retention jobs.
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
import { logger } from "../lib/logger.js";
|
|
8
|
+
import {
|
|
9
|
+
PIN_MATURITY_V2,
|
|
10
|
+
RETENTION_JOB_LIFECYCLE_V2,
|
|
11
|
+
getMaxActivePinsPerOwnerV2,
|
|
12
|
+
setMaxActivePinsPerOwnerV2,
|
|
13
|
+
getMaxPendingJobsPerPinV2,
|
|
14
|
+
setMaxPendingJobsPerPinV2,
|
|
15
|
+
getPinIdleMsV2,
|
|
16
|
+
setPinIdleMsV2,
|
|
17
|
+
getJobStuckMsV2,
|
|
18
|
+
setJobStuckMsV2,
|
|
19
|
+
registerPinV2,
|
|
20
|
+
getPinV2,
|
|
21
|
+
listPinsV2,
|
|
22
|
+
setPinStatusV2,
|
|
23
|
+
activatePinV2,
|
|
24
|
+
dormantPinV2,
|
|
25
|
+
archivePinV2,
|
|
26
|
+
touchPinV2,
|
|
27
|
+
getActivePinCountV2,
|
|
28
|
+
createRetentionJobV2,
|
|
29
|
+
getRetentionJobV2,
|
|
30
|
+
listRetentionJobsV2,
|
|
31
|
+
setRetentionJobStatusV2,
|
|
32
|
+
startRetentionJobV2,
|
|
33
|
+
completeRetentionJobV2,
|
|
34
|
+
failRetentionJobV2,
|
|
35
|
+
cancelRetentionJobV2,
|
|
36
|
+
getPendingJobCountV2,
|
|
37
|
+
autoDormantIdlePinsV2,
|
|
38
|
+
autoFailStuckJobsV2,
|
|
39
|
+
getPermanentMemoryStatsV2,
|
|
40
|
+
} from "../lib/permanent-memory.js";
|
|
41
|
+
|
|
42
|
+
const out = (obj) => console.log(JSON.stringify(obj, null, 2));
|
|
43
|
+
const tryRun = (fn) => {
|
|
44
|
+
try {
|
|
45
|
+
fn();
|
|
46
|
+
} catch (err) {
|
|
47
|
+
logger.error(err.message);
|
|
48
|
+
process.exit(1);
|
|
49
|
+
}
|
|
50
|
+
};
|
|
51
|
+
|
|
52
|
+
export function registerPermMemCommand(program) {
|
|
53
|
+
const root = program
|
|
54
|
+
.command("permmem")
|
|
55
|
+
.description("Permanent memory V2 — pin maturity + retention jobs");
|
|
56
|
+
|
|
57
|
+
root
|
|
58
|
+
.command("pin-maturities-v2")
|
|
59
|
+
.description("List V2 pin maturity states")
|
|
60
|
+
.action(() => out(Object.values(PIN_MATURITY_V2)));
|
|
61
|
+
|
|
62
|
+
root
|
|
63
|
+
.command("retention-job-lifecycles-v2")
|
|
64
|
+
.description("List V2 retention job lifecycle states")
|
|
65
|
+
.action(() => out(Object.values(RETENTION_JOB_LIFECYCLE_V2)));
|
|
66
|
+
|
|
67
|
+
root
|
|
68
|
+
.command("stats-v2")
|
|
69
|
+
.description("V2 permanent memory stats")
|
|
70
|
+
.action(() => out(getPermanentMemoryStatsV2()));
|
|
71
|
+
|
|
72
|
+
root
|
|
73
|
+
.command("get-max-active-pins-v2")
|
|
74
|
+
.description("Get max active pins per owner (V2)")
|
|
75
|
+
.action(() => out({ maxActivePinsPerOwner: getMaxActivePinsPerOwnerV2() }));
|
|
76
|
+
|
|
77
|
+
root
|
|
78
|
+
.command("set-max-active-pins-v2 <n>")
|
|
79
|
+
.description("Set max active pins per owner (V2)")
|
|
80
|
+
.action((n) =>
|
|
81
|
+
tryRun(() => {
|
|
82
|
+
setMaxActivePinsPerOwnerV2(Number(n));
|
|
83
|
+
out({ maxActivePinsPerOwner: getMaxActivePinsPerOwnerV2() });
|
|
84
|
+
}),
|
|
85
|
+
);
|
|
86
|
+
|
|
87
|
+
root
|
|
88
|
+
.command("get-max-pending-jobs-v2")
|
|
89
|
+
.description("Get max pending jobs per pin (V2)")
|
|
90
|
+
.action(() => out({ maxPendingJobsPerPin: getMaxPendingJobsPerPinV2() }));
|
|
91
|
+
|
|
92
|
+
root
|
|
93
|
+
.command("set-max-pending-jobs-v2 <n>")
|
|
94
|
+
.description("Set max pending jobs per pin (V2)")
|
|
95
|
+
.action((n) =>
|
|
96
|
+
tryRun(() => {
|
|
97
|
+
setMaxPendingJobsPerPinV2(Number(n));
|
|
98
|
+
out({ maxPendingJobsPerPin: getMaxPendingJobsPerPinV2() });
|
|
99
|
+
}),
|
|
100
|
+
);
|
|
101
|
+
|
|
102
|
+
root
|
|
103
|
+
.command("get-pin-idle-ms-v2")
|
|
104
|
+
.description("Get pin idle threshold (V2)")
|
|
105
|
+
.action(() => out({ pinIdleMs: getPinIdleMsV2() }));
|
|
106
|
+
|
|
107
|
+
root
|
|
108
|
+
.command("set-pin-idle-ms-v2 <ms>")
|
|
109
|
+
.description("Set pin idle threshold (V2)")
|
|
110
|
+
.action((ms) =>
|
|
111
|
+
tryRun(() => {
|
|
112
|
+
setPinIdleMsV2(Number(ms));
|
|
113
|
+
out({ pinIdleMs: getPinIdleMsV2() });
|
|
114
|
+
}),
|
|
115
|
+
);
|
|
116
|
+
|
|
117
|
+
root
|
|
118
|
+
.command("get-job-stuck-ms-v2")
|
|
119
|
+
.description("Get retention-job stuck threshold (V2)")
|
|
120
|
+
.action(() => out({ jobStuckMs: getJobStuckMsV2() }));
|
|
121
|
+
|
|
122
|
+
root
|
|
123
|
+
.command("set-job-stuck-ms-v2 <ms>")
|
|
124
|
+
.description("Set retention-job stuck threshold (V2)")
|
|
125
|
+
.action((ms) =>
|
|
126
|
+
tryRun(() => {
|
|
127
|
+
setJobStuckMsV2(Number(ms));
|
|
128
|
+
out({ jobStuckMs: getJobStuckMsV2() });
|
|
129
|
+
}),
|
|
130
|
+
);
|
|
131
|
+
|
|
132
|
+
root
|
|
133
|
+
.command("active-pin-count-v2 <ownerId>")
|
|
134
|
+
.description("Active pin count for owner (V2)")
|
|
135
|
+
.action((ownerId) => out({ ownerId, count: getActivePinCountV2(ownerId) }));
|
|
136
|
+
|
|
137
|
+
root
|
|
138
|
+
.command("pending-job-count-v2 <pinId>")
|
|
139
|
+
.description("Pending retention-job count for pin (V2)")
|
|
140
|
+
.action((pinId) => out({ pinId, count: getPendingJobCountV2(pinId) }));
|
|
141
|
+
|
|
142
|
+
root
|
|
143
|
+
.command("register-pin-v2 <id>")
|
|
144
|
+
.description("Register a V2 pin")
|
|
145
|
+
.requiredOption("-o, --owner <id>", "owner id")
|
|
146
|
+
.requiredOption("-l, --label <label>", "pin label")
|
|
147
|
+
.action((id, opts) =>
|
|
148
|
+
tryRun(() =>
|
|
149
|
+
out(registerPinV2(id, { ownerId: opts.owner, label: opts.label })),
|
|
150
|
+
),
|
|
151
|
+
);
|
|
152
|
+
|
|
153
|
+
root
|
|
154
|
+
.command("get-pin-v2 <id>")
|
|
155
|
+
.description("Get a V2 pin")
|
|
156
|
+
.action((id) => out(getPinV2(id)));
|
|
157
|
+
|
|
158
|
+
root
|
|
159
|
+
.command("list-pins-v2")
|
|
160
|
+
.description("List V2 pins")
|
|
161
|
+
.option("-o, --owner <id>", "filter by owner")
|
|
162
|
+
.option("-s, --status <status>", "filter by status")
|
|
163
|
+
.action((opts) =>
|
|
164
|
+
out(listPinsV2({ ownerId: opts.owner, status: opts.status })),
|
|
165
|
+
);
|
|
166
|
+
|
|
167
|
+
root
|
|
168
|
+
.command("set-pin-status-v2 <id> <next>")
|
|
169
|
+
.description("Set V2 pin status")
|
|
170
|
+
.action((id, next) => tryRun(() => out(setPinStatusV2(id, next))));
|
|
171
|
+
|
|
172
|
+
root
|
|
173
|
+
.command("activate-pin-v2 <id>")
|
|
174
|
+
.description("Activate a V2 pin")
|
|
175
|
+
.action((id) => tryRun(() => out(activatePinV2(id))));
|
|
176
|
+
|
|
177
|
+
root
|
|
178
|
+
.command("dormant-pin-v2 <id>")
|
|
179
|
+
.description("Mark V2 pin dormant")
|
|
180
|
+
.action((id) => tryRun(() => out(dormantPinV2(id))));
|
|
181
|
+
|
|
182
|
+
root
|
|
183
|
+
.command("archive-pin-v2 <id>")
|
|
184
|
+
.description("Archive a V2 pin")
|
|
185
|
+
.action((id) => tryRun(() => out(archivePinV2(id))));
|
|
186
|
+
|
|
187
|
+
root
|
|
188
|
+
.command("touch-pin-v2 <id>")
|
|
189
|
+
.description("Touch a V2 pin")
|
|
190
|
+
.action((id) => tryRun(() => out(touchPinV2(id))));
|
|
191
|
+
|
|
192
|
+
root
|
|
193
|
+
.command("create-retention-job-v2 <id>")
|
|
194
|
+
.description("Create a V2 retention job")
|
|
195
|
+
.requiredOption("-p, --pin <id>", "pin id")
|
|
196
|
+
.option("-k, --kind <kind>", "job kind", "review")
|
|
197
|
+
.action((id, opts) =>
|
|
198
|
+
tryRun(() =>
|
|
199
|
+
out(createRetentionJobV2(id, { pinId: opts.pin, kind: opts.kind })),
|
|
200
|
+
),
|
|
201
|
+
);
|
|
202
|
+
|
|
203
|
+
root
|
|
204
|
+
.command("get-retention-job-v2 <id>")
|
|
205
|
+
.description("Get a V2 retention job")
|
|
206
|
+
.action((id) => out(getRetentionJobV2(id)));
|
|
207
|
+
|
|
208
|
+
root
|
|
209
|
+
.command("list-retention-jobs-v2")
|
|
210
|
+
.description("List V2 retention jobs")
|
|
211
|
+
.option("-p, --pin <id>", "filter by pin")
|
|
212
|
+
.option("-s, --status <status>", "filter by status")
|
|
213
|
+
.action((opts) =>
|
|
214
|
+
out(listRetentionJobsV2({ pinId: opts.pin, status: opts.status })),
|
|
215
|
+
);
|
|
216
|
+
|
|
217
|
+
root
|
|
218
|
+
.command("set-retention-job-status-v2 <id> <next>")
|
|
219
|
+
.description("Set V2 retention job status")
|
|
220
|
+
.action((id, next) => tryRun(() => out(setRetentionJobStatusV2(id, next))));
|
|
221
|
+
|
|
222
|
+
root
|
|
223
|
+
.command("start-retention-job-v2 <id>")
|
|
224
|
+
.description("Start a V2 retention job")
|
|
225
|
+
.action((id) => tryRun(() => out(startRetentionJobV2(id))));
|
|
226
|
+
|
|
227
|
+
root
|
|
228
|
+
.command("complete-retention-job-v2 <id>")
|
|
229
|
+
.description("Complete a V2 retention job")
|
|
230
|
+
.action((id) => tryRun(() => out(completeRetentionJobV2(id))));
|
|
231
|
+
|
|
232
|
+
root
|
|
233
|
+
.command("fail-retention-job-v2 <id>")
|
|
234
|
+
.description("Fail a V2 retention job")
|
|
235
|
+
.action((id) => tryRun(() => out(failRetentionJobV2(id))));
|
|
236
|
+
|
|
237
|
+
root
|
|
238
|
+
.command("cancel-retention-job-v2 <id>")
|
|
239
|
+
.description("Cancel a V2 retention job")
|
|
240
|
+
.action((id) => tryRun(() => out(cancelRetentionJobV2(id))));
|
|
241
|
+
|
|
242
|
+
root
|
|
243
|
+
.command("auto-dormant-idle-pins-v2")
|
|
244
|
+
.description("Auto-mark dormant idle V2 pins")
|
|
245
|
+
.action(() => out(autoDormantIdlePinsV2()));
|
|
246
|
+
|
|
247
|
+
root
|
|
248
|
+
.command("auto-fail-stuck-jobs-v2")
|
|
249
|
+
.description("Auto-fail stuck V2 retention jobs")
|
|
250
|
+
.action(() => out(autoFailStuckJobsV2()));
|
|
251
|
+
}
|
|
@@ -40,6 +40,41 @@ import {
|
|
|
40
40
|
recommend,
|
|
41
41
|
getConfig,
|
|
42
42
|
getStats,
|
|
43
|
+
// V2
|
|
44
|
+
PLUGIN_MATURITY_V2,
|
|
45
|
+
INSTALL_LIFECYCLE_V2,
|
|
46
|
+
PLUGIN_DEFAULT_MAX_ACTIVE_PER_DEVELOPER,
|
|
47
|
+
PLUGIN_DEFAULT_MAX_PENDING_INSTALLS_PER_USER,
|
|
48
|
+
PLUGIN_DEFAULT_AUTO_DEPRECATE_AFTER_MS,
|
|
49
|
+
PLUGIN_DEFAULT_AUTO_ARCHIVE_AFTER_MS,
|
|
50
|
+
setMaxActivePluginsPerDeveloper,
|
|
51
|
+
setMaxPendingInstallsPerUser,
|
|
52
|
+
setAutoDeprecateAfterMs,
|
|
53
|
+
setAutoArchiveAfterMs,
|
|
54
|
+
getMaxActivePluginsPerDeveloper,
|
|
55
|
+
getMaxPendingInstallsPerUser,
|
|
56
|
+
getAutoDeprecateAfterMs,
|
|
57
|
+
getAutoArchiveAfterMs,
|
|
58
|
+
getActivePluginCount,
|
|
59
|
+
getPendingInstallCount,
|
|
60
|
+
registerPluginV2,
|
|
61
|
+
getMaturityV2,
|
|
62
|
+
setPluginMaturityV2,
|
|
63
|
+
deprecatePlugin,
|
|
64
|
+
archivePluginV2,
|
|
65
|
+
removePluginV2,
|
|
66
|
+
touchPluginActivity,
|
|
67
|
+
submitInstallV2,
|
|
68
|
+
getInstallStatusV2,
|
|
69
|
+
setInstallStatusV2,
|
|
70
|
+
resolveInstall,
|
|
71
|
+
completeInstall,
|
|
72
|
+
failInstall,
|
|
73
|
+
uninstallInstallV2,
|
|
74
|
+
retryFailedInstall,
|
|
75
|
+
autoDeprecateStalePlugins,
|
|
76
|
+
autoArchiveLongDeprecated,
|
|
77
|
+
getEcosystemStatsV2,
|
|
43
78
|
} from "../lib/plugin-ecosystem.js";
|
|
44
79
|
|
|
45
80
|
function _dbFromCtx(cmd) {
|
|
@@ -512,6 +547,244 @@ export function registerPluginEcosystemCommand(program) {
|
|
|
512
547
|
_json(getStats(db));
|
|
513
548
|
});
|
|
514
549
|
|
|
550
|
+
/* ── Phase 64 V2 ──────────────────────────────────── */
|
|
551
|
+
|
|
552
|
+
eco
|
|
553
|
+
.command("maturity-statuses-v2")
|
|
554
|
+
.description("List V2 plugin maturity statuses")
|
|
555
|
+
.action(() => _json(Object.values(PLUGIN_MATURITY_V2)));
|
|
556
|
+
|
|
557
|
+
eco
|
|
558
|
+
.command("install-lifecycle-v2")
|
|
559
|
+
.description("List V2 install lifecycle statuses")
|
|
560
|
+
.action(() => _json(Object.values(INSTALL_LIFECYCLE_V2)));
|
|
561
|
+
|
|
562
|
+
eco
|
|
563
|
+
.command("default-max-active-plugins-per-developer")
|
|
564
|
+
.description("Show V2 default max active plugins per developer")
|
|
565
|
+
.action(() => _json(PLUGIN_DEFAULT_MAX_ACTIVE_PER_DEVELOPER));
|
|
566
|
+
|
|
567
|
+
eco
|
|
568
|
+
.command("max-active-plugins-per-developer")
|
|
569
|
+
.description("Show current V2 max active plugins per developer")
|
|
570
|
+
.action(() => _json(getMaxActivePluginsPerDeveloper()));
|
|
571
|
+
|
|
572
|
+
eco
|
|
573
|
+
.command("set-max-active-plugins-per-developer <n>")
|
|
574
|
+
.description("Set V2 max active plugins per developer")
|
|
575
|
+
.action((n) => _json(setMaxActivePluginsPerDeveloper(Number(n))));
|
|
576
|
+
|
|
577
|
+
eco
|
|
578
|
+
.command("default-max-pending-installs-per-user")
|
|
579
|
+
.description("Show V2 default max pending installs per user")
|
|
580
|
+
.action(() => _json(PLUGIN_DEFAULT_MAX_PENDING_INSTALLS_PER_USER));
|
|
581
|
+
|
|
582
|
+
eco
|
|
583
|
+
.command("max-pending-installs-per-user")
|
|
584
|
+
.description("Show current V2 max pending installs per user")
|
|
585
|
+
.action(() => _json(getMaxPendingInstallsPerUser()));
|
|
586
|
+
|
|
587
|
+
eco
|
|
588
|
+
.command("set-max-pending-installs-per-user <n>")
|
|
589
|
+
.description("Set V2 max pending installs per user")
|
|
590
|
+
.action((n) => _json(setMaxPendingInstallsPerUser(Number(n))));
|
|
591
|
+
|
|
592
|
+
eco
|
|
593
|
+
.command("default-auto-deprecate-after-ms")
|
|
594
|
+
.description("Show V2 default auto-deprecate threshold (ms)")
|
|
595
|
+
.action(() => _json(PLUGIN_DEFAULT_AUTO_DEPRECATE_AFTER_MS));
|
|
596
|
+
|
|
597
|
+
eco
|
|
598
|
+
.command("auto-deprecate-after-ms")
|
|
599
|
+
.description("Show current V2 auto-deprecate threshold (ms)")
|
|
600
|
+
.action(() => _json(getAutoDeprecateAfterMs()));
|
|
601
|
+
|
|
602
|
+
eco
|
|
603
|
+
.command("set-auto-deprecate-after-ms <ms>")
|
|
604
|
+
.description("Set V2 auto-deprecate threshold (ms)")
|
|
605
|
+
.action((ms) => _json(setAutoDeprecateAfterMs(Number(ms))));
|
|
606
|
+
|
|
607
|
+
eco
|
|
608
|
+
.command("default-auto-archive-after-ms")
|
|
609
|
+
.description("Show V2 default auto-archive threshold (ms)")
|
|
610
|
+
.action(() => _json(PLUGIN_DEFAULT_AUTO_ARCHIVE_AFTER_MS));
|
|
611
|
+
|
|
612
|
+
eco
|
|
613
|
+
.command("auto-archive-after-ms")
|
|
614
|
+
.description("Show current V2 auto-archive threshold (ms)")
|
|
615
|
+
.action(() => _json(getAutoArchiveAfterMs()));
|
|
616
|
+
|
|
617
|
+
eco
|
|
618
|
+
.command("set-auto-archive-after-ms <ms>")
|
|
619
|
+
.description("Set V2 auto-archive threshold (ms)")
|
|
620
|
+
.action((ms) => _json(setAutoArchiveAfterMs(Number(ms))));
|
|
621
|
+
|
|
622
|
+
eco
|
|
623
|
+
.command("active-plugin-count")
|
|
624
|
+
.description("Count V2 active plugins (optionally scoped)")
|
|
625
|
+
.option("-d, --developer <id>", "Filter by developer ID")
|
|
626
|
+
.action((opts) => _json(getActivePluginCount(opts.developer)));
|
|
627
|
+
|
|
628
|
+
eco
|
|
629
|
+
.command("pending-install-count")
|
|
630
|
+
.description("Count V2 pending+resolving installs (optionally scoped)")
|
|
631
|
+
.option("-u, --user <id>", "Filter by user ID")
|
|
632
|
+
.action((opts) => _json(getPendingInstallCount(opts.user)));
|
|
633
|
+
|
|
634
|
+
eco
|
|
635
|
+
.command("register-plugin-v2 <plugin-id>")
|
|
636
|
+
.description("Register V2 plugin (status=active)")
|
|
637
|
+
.requiredOption("-d, --developer <id>", "Developer ID")
|
|
638
|
+
.option("-m, --metadata <json>", "Metadata JSON")
|
|
639
|
+
.action((pluginId, opts) => {
|
|
640
|
+
_json(
|
|
641
|
+
registerPluginV2(null, {
|
|
642
|
+
pluginId,
|
|
643
|
+
developerId: opts.developer,
|
|
644
|
+
metadata: _parseJsonArg(opts.metadata, undefined),
|
|
645
|
+
}),
|
|
646
|
+
);
|
|
647
|
+
});
|
|
648
|
+
|
|
649
|
+
eco
|
|
650
|
+
.command("maturity-v2 <plugin-id>")
|
|
651
|
+
.description("Show V2 plugin maturity")
|
|
652
|
+
.action((pluginId) => _json(getMaturityV2(pluginId)));
|
|
653
|
+
|
|
654
|
+
eco
|
|
655
|
+
.command("set-maturity-v2 <plugin-id> <status>")
|
|
656
|
+
.description("Transition V2 plugin maturity")
|
|
657
|
+
.option("-r, --reason <text>", "Reason")
|
|
658
|
+
.option("-m, --metadata <json>", "Metadata JSON to merge")
|
|
659
|
+
.action((pluginId, status, opts) => {
|
|
660
|
+
_json(
|
|
661
|
+
setPluginMaturityV2(null, pluginId, status, {
|
|
662
|
+
reason: opts.reason,
|
|
663
|
+
metadata: _parseJsonArg(opts.metadata, undefined),
|
|
664
|
+
}),
|
|
665
|
+
);
|
|
666
|
+
});
|
|
667
|
+
|
|
668
|
+
eco
|
|
669
|
+
.command("deprecate-plugin <plugin-id>")
|
|
670
|
+
.description("Deprecate V2 plugin")
|
|
671
|
+
.option("-r, --reason <text>", "Reason")
|
|
672
|
+
.action((pluginId, opts) =>
|
|
673
|
+
_json(deprecatePlugin(null, pluginId, opts.reason)),
|
|
674
|
+
);
|
|
675
|
+
|
|
676
|
+
eco
|
|
677
|
+
.command("archive-plugin-v2 <plugin-id>")
|
|
678
|
+
.description("Archive V2 plugin")
|
|
679
|
+
.option("-r, --reason <text>", "Reason")
|
|
680
|
+
.action((pluginId, opts) =>
|
|
681
|
+
_json(archivePluginV2(null, pluginId, opts.reason)),
|
|
682
|
+
);
|
|
683
|
+
|
|
684
|
+
eco
|
|
685
|
+
.command("remove-plugin-v2 <plugin-id>")
|
|
686
|
+
.description("Remove V2 plugin (terminal)")
|
|
687
|
+
.option("-r, --reason <text>", "Reason")
|
|
688
|
+
.action((pluginId, opts) =>
|
|
689
|
+
_json(removePluginV2(null, pluginId, opts.reason)),
|
|
690
|
+
);
|
|
691
|
+
|
|
692
|
+
eco
|
|
693
|
+
.command("touch-plugin-activity <plugin-id>")
|
|
694
|
+
.description("Bump lastActivityAt for V2 plugin")
|
|
695
|
+
.action((pluginId) => _json(touchPluginActivity(pluginId)));
|
|
696
|
+
|
|
697
|
+
eco
|
|
698
|
+
.command("submit-install-v2 <install-id>")
|
|
699
|
+
.description("Submit V2 install (status=pending)")
|
|
700
|
+
.requiredOption("-u, --user <id>", "User ID")
|
|
701
|
+
.requiredOption("-p, --plugin <id>", "Plugin ID")
|
|
702
|
+
.option("-m, --metadata <json>", "Metadata JSON")
|
|
703
|
+
.action((installId, opts) => {
|
|
704
|
+
_json(
|
|
705
|
+
submitInstallV2(null, {
|
|
706
|
+
installId,
|
|
707
|
+
userId: opts.user,
|
|
708
|
+
pluginId: opts.plugin,
|
|
709
|
+
metadata: _parseJsonArg(opts.metadata, undefined),
|
|
710
|
+
}),
|
|
711
|
+
);
|
|
712
|
+
});
|
|
713
|
+
|
|
714
|
+
eco
|
|
715
|
+
.command("install-status-v2 <install-id>")
|
|
716
|
+
.description("Show V2 install status")
|
|
717
|
+
.action((installId) => _json(getInstallStatusV2(installId)));
|
|
718
|
+
|
|
719
|
+
eco
|
|
720
|
+
.command("set-install-status-v2 <install-id> <status>")
|
|
721
|
+
.description("Transition V2 install status")
|
|
722
|
+
.option("-r, --reason <text>", "Reason")
|
|
723
|
+
.option("-m, --metadata <json>", "Metadata JSON to merge")
|
|
724
|
+
.action((installId, status, opts) => {
|
|
725
|
+
_json(
|
|
726
|
+
setInstallStatusV2(null, installId, status, {
|
|
727
|
+
reason: opts.reason,
|
|
728
|
+
metadata: _parseJsonArg(opts.metadata, undefined),
|
|
729
|
+
}),
|
|
730
|
+
);
|
|
731
|
+
});
|
|
732
|
+
|
|
733
|
+
eco
|
|
734
|
+
.command("resolve-install <install-id>")
|
|
735
|
+
.description("Mark V2 install as resolving")
|
|
736
|
+
.option("-r, --reason <text>", "Reason")
|
|
737
|
+
.action((installId, opts) =>
|
|
738
|
+
_json(resolveInstall(null, installId, opts.reason)),
|
|
739
|
+
);
|
|
740
|
+
|
|
741
|
+
eco
|
|
742
|
+
.command("complete-install <install-id>")
|
|
743
|
+
.description("Mark V2 install as installed")
|
|
744
|
+
.option("-r, --reason <text>", "Reason")
|
|
745
|
+
.action((installId, opts) =>
|
|
746
|
+
_json(completeInstall(null, installId, opts.reason)),
|
|
747
|
+
);
|
|
748
|
+
|
|
749
|
+
eco
|
|
750
|
+
.command("fail-install <install-id>")
|
|
751
|
+
.description("Mark V2 install as failed")
|
|
752
|
+
.option("-r, --reason <text>", "Reason")
|
|
753
|
+
.action((installId, opts) =>
|
|
754
|
+
_json(failInstall(null, installId, opts.reason)),
|
|
755
|
+
);
|
|
756
|
+
|
|
757
|
+
eco
|
|
758
|
+
.command("uninstall-install-v2 <install-id>")
|
|
759
|
+
.description("Mark V2 install as uninstalled (terminal)")
|
|
760
|
+
.option("-r, --reason <text>", "Reason")
|
|
761
|
+
.action((installId, opts) =>
|
|
762
|
+
_json(uninstallInstallV2(null, installId, opts.reason)),
|
|
763
|
+
);
|
|
764
|
+
|
|
765
|
+
eco
|
|
766
|
+
.command("retry-failed-install <install-id>")
|
|
767
|
+
.description("Retry a failed V2 install (failed → pending)")
|
|
768
|
+
.option("-r, --reason <text>", "Reason")
|
|
769
|
+
.action((installId, opts) =>
|
|
770
|
+
_json(retryFailedInstall(null, installId, opts.reason)),
|
|
771
|
+
);
|
|
772
|
+
|
|
773
|
+
eco
|
|
774
|
+
.command("auto-deprecate-stale-plugins")
|
|
775
|
+
.description("Bulk-flip stale V2 ACTIVE plugins to DEPRECATED")
|
|
776
|
+
.action(() => _json(autoDeprecateStalePlugins(null)));
|
|
777
|
+
|
|
778
|
+
eco
|
|
779
|
+
.command("auto-archive-long-deprecated")
|
|
780
|
+
.description("Bulk-flip long-deprecated V2 plugins to ARCHIVED")
|
|
781
|
+
.action(() => _json(autoArchiveLongDeprecated(null)));
|
|
782
|
+
|
|
783
|
+
eco
|
|
784
|
+
.command("stats-v2")
|
|
785
|
+
.description("Show V2 ecosystem stats (maturity + install)")
|
|
786
|
+
.action(() => _json(getEcosystemStatsV2()));
|
|
787
|
+
|
|
515
788
|
program.addCommand(eco);
|
|
516
789
|
return eco;
|
|
517
790
|
}
|