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
|
@@ -391,3 +391,209 @@ export function registerTerraformCommand(program) {
|
|
|
391
391
|
});
|
|
392
392
|
});
|
|
393
393
|
}
|
|
394
|
+
|
|
395
|
+
// === Iter16 V2 governance overlay ===
|
|
396
|
+
export function registerTfgovV2Commands(program) {
|
|
397
|
+
const parent = program.commands.find((c) => c.name() === "terraform");
|
|
398
|
+
if (!parent) return;
|
|
399
|
+
const L = async () => await import("../lib/terraform-manager.js");
|
|
400
|
+
parent
|
|
401
|
+
.command("tfgov-enums-v2")
|
|
402
|
+
.description("Show V2 enums (tfgov maturity + apply lifecycle)")
|
|
403
|
+
.action(async () => {
|
|
404
|
+
const m = await L();
|
|
405
|
+
console.log(
|
|
406
|
+
JSON.stringify(
|
|
407
|
+
{
|
|
408
|
+
profileMaturity: m.TFGOV_PROFILE_MATURITY_V2,
|
|
409
|
+
applyLifecycle: m.TFGOV_APPLY_LIFECYCLE_V2,
|
|
410
|
+
},
|
|
411
|
+
null,
|
|
412
|
+
2,
|
|
413
|
+
),
|
|
414
|
+
);
|
|
415
|
+
});
|
|
416
|
+
parent
|
|
417
|
+
.command("tfgov-config-v2")
|
|
418
|
+
.description("Show V2 config thresholds")
|
|
419
|
+
.action(async () => {
|
|
420
|
+
const m = await L();
|
|
421
|
+
console.log(
|
|
422
|
+
JSON.stringify(
|
|
423
|
+
{
|
|
424
|
+
maxActive: m.getMaxActiveTfgovProfilesPerOwnerV2(),
|
|
425
|
+
maxPending: m.getMaxPendingTfgovApplysPerProfileV2(),
|
|
426
|
+
idleMs: m.getTfgovProfileIdleMsV2(),
|
|
427
|
+
stuckMs: m.getTfgovApplyStuckMsV2(),
|
|
428
|
+
},
|
|
429
|
+
null,
|
|
430
|
+
2,
|
|
431
|
+
),
|
|
432
|
+
);
|
|
433
|
+
});
|
|
434
|
+
parent
|
|
435
|
+
.command("tfgov-set-max-active-v2 <n>")
|
|
436
|
+
.description("Set max active profiles per owner")
|
|
437
|
+
.action(async (n) => {
|
|
438
|
+
const m = await L();
|
|
439
|
+
m.setMaxActiveTfgovProfilesPerOwnerV2(Number(n));
|
|
440
|
+
console.log("ok");
|
|
441
|
+
});
|
|
442
|
+
parent
|
|
443
|
+
.command("tfgov-set-max-pending-v2 <n>")
|
|
444
|
+
.description("Set max pending applys per profile")
|
|
445
|
+
.action(async (n) => {
|
|
446
|
+
const m = await L();
|
|
447
|
+
m.setMaxPendingTfgovApplysPerProfileV2(Number(n));
|
|
448
|
+
console.log("ok");
|
|
449
|
+
});
|
|
450
|
+
parent
|
|
451
|
+
.command("tfgov-set-idle-ms-v2 <n>")
|
|
452
|
+
.description("Set profile idle threshold (ms)")
|
|
453
|
+
.action(async (n) => {
|
|
454
|
+
const m = await L();
|
|
455
|
+
m.setTfgovProfileIdleMsV2(Number(n));
|
|
456
|
+
console.log("ok");
|
|
457
|
+
});
|
|
458
|
+
parent
|
|
459
|
+
.command("tfgov-set-stuck-ms-v2 <n>")
|
|
460
|
+
.description("Set apply stuck threshold (ms)")
|
|
461
|
+
.action(async (n) => {
|
|
462
|
+
const m = await L();
|
|
463
|
+
m.setTfgovApplyStuckMsV2(Number(n));
|
|
464
|
+
console.log("ok");
|
|
465
|
+
});
|
|
466
|
+
parent
|
|
467
|
+
.command("tfgov-register-v2 <id> <owner>")
|
|
468
|
+
.description("Register V2 tfgov profile")
|
|
469
|
+
.option("--provider <v>", "provider")
|
|
470
|
+
.action(async (id, owner, o) => {
|
|
471
|
+
const m = await L();
|
|
472
|
+
console.log(
|
|
473
|
+
JSON.stringify(
|
|
474
|
+
m.registerTfgovProfileV2({ id, owner, provider: o.provider }),
|
|
475
|
+
null,
|
|
476
|
+
2,
|
|
477
|
+
),
|
|
478
|
+
);
|
|
479
|
+
});
|
|
480
|
+
parent
|
|
481
|
+
.command("tfgov-activate-v2 <id>")
|
|
482
|
+
.description("Activate profile")
|
|
483
|
+
.action(async (id) => {
|
|
484
|
+
const m = await L();
|
|
485
|
+
console.log(JSON.stringify(m.activateTfgovProfileV2(id), null, 2));
|
|
486
|
+
});
|
|
487
|
+
parent
|
|
488
|
+
.command("tfgov-drift-v2 <id>")
|
|
489
|
+
.description("Drift profile")
|
|
490
|
+
.action(async (id) => {
|
|
491
|
+
const m = await L();
|
|
492
|
+
console.log(JSON.stringify(m.driftTfgovProfileV2(id), null, 2));
|
|
493
|
+
});
|
|
494
|
+
parent
|
|
495
|
+
.command("tfgov-archive-v2 <id>")
|
|
496
|
+
.description("Archive profile (terminal)")
|
|
497
|
+
.action(async (id) => {
|
|
498
|
+
const m = await L();
|
|
499
|
+
console.log(JSON.stringify(m.archiveTfgovProfileV2(id), null, 2));
|
|
500
|
+
});
|
|
501
|
+
parent
|
|
502
|
+
.command("tfgov-touch-v2 <id>")
|
|
503
|
+
.description("Touch profile")
|
|
504
|
+
.action(async (id) => {
|
|
505
|
+
const m = await L();
|
|
506
|
+
console.log(JSON.stringify(m.touchTfgovProfileV2(id), null, 2));
|
|
507
|
+
});
|
|
508
|
+
parent
|
|
509
|
+
.command("tfgov-get-v2 <id>")
|
|
510
|
+
.description("Get profile")
|
|
511
|
+
.action(async (id) => {
|
|
512
|
+
const m = await L();
|
|
513
|
+
console.log(JSON.stringify(m.getTfgovProfileV2(id), null, 2));
|
|
514
|
+
});
|
|
515
|
+
parent
|
|
516
|
+
.command("tfgov-list-v2")
|
|
517
|
+
.description("List profiles")
|
|
518
|
+
.action(async () => {
|
|
519
|
+
const m = await L();
|
|
520
|
+
console.log(JSON.stringify(m.listTfgovProfilesV2(), null, 2));
|
|
521
|
+
});
|
|
522
|
+
parent
|
|
523
|
+
.command("tfgov-create-apply-v2 <id> <profileId>")
|
|
524
|
+
.description("Create apply (queued)")
|
|
525
|
+
.option("--resource <v>", "resource")
|
|
526
|
+
.action(async (id, profileId, o) => {
|
|
527
|
+
const m = await L();
|
|
528
|
+
console.log(
|
|
529
|
+
JSON.stringify(
|
|
530
|
+
m.createTfgovApplyV2({ id, profileId, resource: o.resource }),
|
|
531
|
+
null,
|
|
532
|
+
2,
|
|
533
|
+
),
|
|
534
|
+
);
|
|
535
|
+
});
|
|
536
|
+
parent
|
|
537
|
+
.command("tfgov-applying-apply-v2 <id>")
|
|
538
|
+
.description("Mark apply as applying")
|
|
539
|
+
.action(async (id) => {
|
|
540
|
+
const m = await L();
|
|
541
|
+
console.log(JSON.stringify(m.applyingTfgovApplyV2(id), null, 2));
|
|
542
|
+
});
|
|
543
|
+
parent
|
|
544
|
+
.command("tfgov-complete-apply-v2 <id>")
|
|
545
|
+
.description("Complete apply")
|
|
546
|
+
.action(async (id) => {
|
|
547
|
+
const m = await L();
|
|
548
|
+
console.log(JSON.stringify(m.completeApplyTfgovV2(id), null, 2));
|
|
549
|
+
});
|
|
550
|
+
parent
|
|
551
|
+
.command("tfgov-fail-apply-v2 <id> [reason]")
|
|
552
|
+
.description("Fail apply")
|
|
553
|
+
.action(async (id, reason) => {
|
|
554
|
+
const m = await L();
|
|
555
|
+
console.log(JSON.stringify(m.failTfgovApplyV2(id, reason), null, 2));
|
|
556
|
+
});
|
|
557
|
+
parent
|
|
558
|
+
.command("tfgov-cancel-apply-v2 <id> [reason]")
|
|
559
|
+
.description("Cancel apply")
|
|
560
|
+
.action(async (id, reason) => {
|
|
561
|
+
const m = await L();
|
|
562
|
+
console.log(JSON.stringify(m.cancelTfgovApplyV2(id, reason), null, 2));
|
|
563
|
+
});
|
|
564
|
+
parent
|
|
565
|
+
.command("tfgov-get-apply-v2 <id>")
|
|
566
|
+
.description("Get apply")
|
|
567
|
+
.action(async (id) => {
|
|
568
|
+
const m = await L();
|
|
569
|
+
console.log(JSON.stringify(m.getTfgovApplyV2(id), null, 2));
|
|
570
|
+
});
|
|
571
|
+
parent
|
|
572
|
+
.command("tfgov-list-applys-v2")
|
|
573
|
+
.description("List applys")
|
|
574
|
+
.action(async () => {
|
|
575
|
+
const m = await L();
|
|
576
|
+
console.log(JSON.stringify(m.listTfgovApplysV2(), null, 2));
|
|
577
|
+
});
|
|
578
|
+
parent
|
|
579
|
+
.command("tfgov-auto-drift-idle-v2")
|
|
580
|
+
.description("Auto-drift idle profiles")
|
|
581
|
+
.action(async () => {
|
|
582
|
+
const m = await L();
|
|
583
|
+
console.log(JSON.stringify(m.autoDriftIdleTfgovProfilesV2(), null, 2));
|
|
584
|
+
});
|
|
585
|
+
parent
|
|
586
|
+
.command("tfgov-auto-fail-stuck-v2")
|
|
587
|
+
.description("Auto-fail stuck applys")
|
|
588
|
+
.action(async () => {
|
|
589
|
+
const m = await L();
|
|
590
|
+
console.log(JSON.stringify(m.autoFailStuckTfgovApplysV2(), null, 2));
|
|
591
|
+
});
|
|
592
|
+
parent
|
|
593
|
+
.command("tfgov-gov-stats-v2")
|
|
594
|
+
.description("V2 gov aggregate stats")
|
|
595
|
+
.action(async () => {
|
|
596
|
+
const m = await L();
|
|
597
|
+
console.log(JSON.stringify(m.getTerraformManagerGovStatsV2(), null, 2));
|
|
598
|
+
});
|
|
599
|
+
}
|
package/src/commands/tms.js
CHANGED
|
@@ -6,40 +6,178 @@
|
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
8
|
import {
|
|
9
|
-
TMS_PROFILE_MATURITY_V2,
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
9
|
+
TMS_PROFILE_MATURITY_V2,
|
|
10
|
+
TMS_SELECTION_LIFECYCLE_V2,
|
|
11
|
+
setMaxActiveTmsProfilesPerOwnerV2,
|
|
12
|
+
getMaxActiveTmsProfilesPerOwnerV2,
|
|
13
|
+
setMaxPendingTmsSelectionsPerProfileV2,
|
|
14
|
+
getMaxPendingTmsSelectionsPerProfileV2,
|
|
15
|
+
setTmsProfileIdleMsV2,
|
|
16
|
+
getTmsProfileIdleMsV2,
|
|
17
|
+
setTmsSelectionStuckMsV2,
|
|
18
|
+
getTmsSelectionStuckMsV2,
|
|
19
|
+
registerTmsProfileV2,
|
|
20
|
+
activateTmsProfileV2,
|
|
21
|
+
staleTmsProfileV2,
|
|
22
|
+
decommissionTmsProfileV2,
|
|
23
|
+
touchTmsProfileV2,
|
|
24
|
+
getTmsProfileV2,
|
|
25
|
+
listTmsProfilesV2,
|
|
26
|
+
createTmsSelectionV2,
|
|
27
|
+
scoreTmsSelectionV2,
|
|
28
|
+
completeTmsSelectionV2,
|
|
29
|
+
failTmsSelectionV2,
|
|
30
|
+
cancelTmsSelectionV2,
|
|
31
|
+
getTmsSelectionV2,
|
|
32
|
+
listTmsSelectionsV2,
|
|
33
|
+
autoStaleIdleTmsProfilesV2,
|
|
34
|
+
autoFailStuckTmsSelectionsV2,
|
|
35
|
+
getTaskModelSelectorGovStatsV2,
|
|
36
|
+
_resetStateTaskModelSelectorV2,
|
|
17
37
|
} from "../lib/task-model-selector.js";
|
|
18
38
|
|
|
19
39
|
export function registerTmsCommand(program) {
|
|
20
|
-
const tms = program
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
tms.command("
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
tms.command("
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
40
|
+
const tms = program
|
|
41
|
+
.command("tms")
|
|
42
|
+
.description("Task Model Selector V2 governance");
|
|
43
|
+
tms.command("enums-v2").action(() =>
|
|
44
|
+
console.log(
|
|
45
|
+
JSON.stringify(
|
|
46
|
+
{
|
|
47
|
+
profileMaturity: TMS_PROFILE_MATURITY_V2,
|
|
48
|
+
selectionLifecycle: TMS_SELECTION_LIFECYCLE_V2,
|
|
49
|
+
},
|
|
50
|
+
null,
|
|
51
|
+
2,
|
|
52
|
+
),
|
|
53
|
+
),
|
|
54
|
+
);
|
|
55
|
+
tms.command("config-v2").action(() =>
|
|
56
|
+
console.log(
|
|
57
|
+
JSON.stringify(
|
|
58
|
+
{
|
|
59
|
+
maxActiveTmsProfilesPerOwner: getMaxActiveTmsProfilesPerOwnerV2(),
|
|
60
|
+
maxPendingTmsSelectionsPerProfile:
|
|
61
|
+
getMaxPendingTmsSelectionsPerProfileV2(),
|
|
62
|
+
tmsProfileIdleMs: getTmsProfileIdleMsV2(),
|
|
63
|
+
tmsSelectionStuckMs: getTmsSelectionStuckMsV2(),
|
|
64
|
+
},
|
|
65
|
+
null,
|
|
66
|
+
2,
|
|
67
|
+
),
|
|
68
|
+
),
|
|
69
|
+
);
|
|
70
|
+
tms.command("set-max-active-v2 <n>").action((n) => {
|
|
71
|
+
setMaxActiveTmsProfilesPerOwnerV2(Number(n));
|
|
72
|
+
console.log("ok");
|
|
73
|
+
});
|
|
74
|
+
tms.command("set-max-pending-v2 <n>").action((n) => {
|
|
75
|
+
setMaxPendingTmsSelectionsPerProfileV2(Number(n));
|
|
76
|
+
console.log("ok");
|
|
77
|
+
});
|
|
78
|
+
tms.command("set-idle-ms-v2 <n>").action((n) => {
|
|
79
|
+
setTmsProfileIdleMsV2(Number(n));
|
|
80
|
+
console.log("ok");
|
|
81
|
+
});
|
|
82
|
+
tms.command("set-stuck-ms-v2 <n>").action((n) => {
|
|
83
|
+
setTmsSelectionStuckMsV2(Number(n));
|
|
84
|
+
console.log("ok");
|
|
85
|
+
});
|
|
86
|
+
tms
|
|
87
|
+
.command("register-profile-v2 <id> <owner>")
|
|
88
|
+
.option("--strategy <s>", "strategy")
|
|
89
|
+
.action((id, owner, o) =>
|
|
90
|
+
console.log(
|
|
91
|
+
JSON.stringify(
|
|
92
|
+
registerTmsProfileV2({ id, owner, strategy: o.strategy }),
|
|
93
|
+
null,
|
|
94
|
+
2,
|
|
95
|
+
),
|
|
96
|
+
),
|
|
97
|
+
);
|
|
98
|
+
tms
|
|
99
|
+
.command("activate-profile-v2 <id>")
|
|
100
|
+
.action((id) =>
|
|
101
|
+
console.log(JSON.stringify(activateTmsProfileV2(id), null, 2)),
|
|
102
|
+
);
|
|
103
|
+
tms
|
|
104
|
+
.command("stale-profile-v2 <id>")
|
|
105
|
+
.action((id) =>
|
|
106
|
+
console.log(JSON.stringify(staleTmsProfileV2(id), null, 2)),
|
|
107
|
+
);
|
|
108
|
+
tms
|
|
109
|
+
.command("decommission-profile-v2 <id>")
|
|
110
|
+
.action((id) =>
|
|
111
|
+
console.log(JSON.stringify(decommissionTmsProfileV2(id), null, 2)),
|
|
112
|
+
);
|
|
113
|
+
tms
|
|
114
|
+
.command("touch-profile-v2 <id>")
|
|
115
|
+
.action((id) =>
|
|
116
|
+
console.log(JSON.stringify(touchTmsProfileV2(id), null, 2)),
|
|
117
|
+
);
|
|
118
|
+
tms
|
|
119
|
+
.command("get-profile-v2 <id>")
|
|
120
|
+
.action((id) => console.log(JSON.stringify(getTmsProfileV2(id), null, 2)));
|
|
121
|
+
tms
|
|
122
|
+
.command("list-profiles-v2")
|
|
123
|
+
.action(() => console.log(JSON.stringify(listTmsProfilesV2(), null, 2)));
|
|
124
|
+
tms
|
|
125
|
+
.command("create-selection-v2 <id> <profileId>")
|
|
126
|
+
.option("--task <t>", "task")
|
|
127
|
+
.action((id, profileId, o) =>
|
|
128
|
+
console.log(
|
|
129
|
+
JSON.stringify(
|
|
130
|
+
createTmsSelectionV2({ id, profileId, task: o.task }),
|
|
131
|
+
null,
|
|
132
|
+
2,
|
|
133
|
+
),
|
|
134
|
+
),
|
|
135
|
+
);
|
|
136
|
+
tms
|
|
137
|
+
.command("score-selection-v2 <id>")
|
|
138
|
+
.action((id) =>
|
|
139
|
+
console.log(JSON.stringify(scoreTmsSelectionV2(id), null, 2)),
|
|
140
|
+
);
|
|
141
|
+
tms
|
|
142
|
+
.command("complete-selection-v2 <id>")
|
|
143
|
+
.action((id) =>
|
|
144
|
+
console.log(JSON.stringify(completeTmsSelectionV2(id), null, 2)),
|
|
145
|
+
);
|
|
146
|
+
tms
|
|
147
|
+
.command("fail-selection-v2 <id> [reason]")
|
|
148
|
+
.action((id, reason) =>
|
|
149
|
+
console.log(JSON.stringify(failTmsSelectionV2(id, reason), null, 2)),
|
|
150
|
+
);
|
|
151
|
+
tms
|
|
152
|
+
.command("cancel-selection-v2 <id> [reason]")
|
|
153
|
+
.action((id, reason) =>
|
|
154
|
+
console.log(JSON.stringify(cancelTmsSelectionV2(id, reason), null, 2)),
|
|
155
|
+
);
|
|
156
|
+
tms
|
|
157
|
+
.command("get-selection-v2 <id>")
|
|
158
|
+
.action((id) =>
|
|
159
|
+
console.log(JSON.stringify(getTmsSelectionV2(id), null, 2)),
|
|
160
|
+
);
|
|
161
|
+
tms
|
|
162
|
+
.command("list-selections-v2")
|
|
163
|
+
.action(() => console.log(JSON.stringify(listTmsSelectionsV2(), null, 2)));
|
|
164
|
+
tms
|
|
165
|
+
.command("auto-stale-idle-v2")
|
|
166
|
+
.action(() =>
|
|
167
|
+
console.log(JSON.stringify(autoStaleIdleTmsProfilesV2(), null, 2)),
|
|
168
|
+
);
|
|
169
|
+
tms
|
|
170
|
+
.command("auto-fail-stuck-v2")
|
|
171
|
+
.action(() =>
|
|
172
|
+
console.log(JSON.stringify(autoFailStuckTmsSelectionsV2(), null, 2)),
|
|
173
|
+
);
|
|
174
|
+
tms
|
|
175
|
+
.command("gov-stats-v2")
|
|
176
|
+
.action(() =>
|
|
177
|
+
console.log(JSON.stringify(getTaskModelSelectorGovStatsV2(), null, 2)),
|
|
178
|
+
);
|
|
179
|
+
tms.command("reset-state-v2").action(() => {
|
|
180
|
+
_resetStateTaskModelSelectorV2();
|
|
181
|
+
console.log(JSON.stringify({ ok: true }, null, 2));
|
|
182
|
+
});
|
|
45
183
|
}
|
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
|
}
|