@a-company/paradigm 3.46.0 → 5.4.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/dist/{accept-orchestration-ZUWQUHSK.js → accept-orchestration-GX2YRWM4.js} +5 -5
- package/dist/{add-VSPZ6FM4.js → add-FZRKEGH4.js} +1 -1
- package/dist/agent-WERIO2XV.js +523 -0
- package/dist/agent-loader-SJPJJS33.js +36 -0
- package/dist/{agents-suggest-65SER5IS.js → agents-suggest-DNSYJ6IA.js} +1 -1
- package/dist/{aggregate-SV3VGEIL.js → aggregate-H57K7PNV.js} +1 -1
- package/dist/{assess-UHBDYIK7.js → assess-4WVXZLZQ.js} +2 -2
- package/dist/{auto-24ICVUH4.js → auto-QFS5NHQU.js} +1 -1
- package/dist/{beacon-3SJV4DAP.js → beacon-KXZXYQHX.js} +1 -1
- package/dist/{calibration-WWHK73WU.js → calibration-V46G7JTY.js} +2 -2
- package/dist/{check-OLI6AUS6.js → check-OWAIWV23.js} +1 -1
- package/dist/{chunk-RP6TZYGE.js → chunk-2IO7JAG2.js} +1 -1
- package/dist/chunk-2T6BTYBN.js +712 -0
- package/dist/{chunk-CDMAMDSG.js → chunk-5VKJBNJL.js} +13 -5
- package/dist/{chunk-KB4XJWE3.js → chunk-6N3JTACN.js} +98 -437
- package/dist/{chunk-ZMQA6SCO.js → chunk-7HRBT23N.js} +631 -231
- package/dist/chunk-7N7GSU6K.js +34 -0
- package/dist/chunk-A2L4TSLZ.js +526 -0
- package/dist/{chunk-P7XSBJE3.js → chunk-ABVQGRF7.js} +1 -1
- package/dist/{chunk-HIKKOCXY.js → chunk-EI32ZBE6.js} +1 -1
- package/dist/{chunk-QIOCFXDQ.js → chunk-EKGMAM62.js} +1 -1
- package/dist/chunk-EZ3GOCYC.js +132 -0
- package/dist/{chunk-DS5QY37M.js → chunk-GTR2TBIJ.js} +247 -15
- package/dist/chunk-ICSLIPUS.js +1128 -0
- package/dist/{chunk-QDXI2DHR.js → chunk-J2JEQRT3.js} +1 -1
- package/dist/{chunk-AKIMFN6I.js → chunk-JASGXLK3.js} +2 -2
- package/dist/{chunk-J4E6K5MG.js → chunk-LSRABQIY.js} +25 -1
- package/dist/chunk-MCMOGQMU.js +145 -0
- package/dist/{chunk-ZXMDA7VB.js → chunk-PDX44BCA.js} +1 -6
- package/dist/{chunk-2SKXFXIT.js → chunk-S3ORKP3V.js} +10 -15
- package/dist/chunk-TAIJOFOE.js +124 -0
- package/dist/{chunk-FS3WTUHY.js → chunk-TXESEO7Y.js} +6 -6
- package/dist/{chunk-7COU5S2Z.js → chunk-VL67H5IC.js} +1 -1
- package/dist/{chunk-QWA26UNO.js → chunk-WQITYKHM.js} +7 -7
- package/dist/{chunk-MW5DMGBB.js → chunk-YMDLDELF.js} +114 -55
- package/dist/{claude-63ISJAZK.js → claude-FRRWJSTJ.js} +1 -1
- package/dist/{claude-cli-ABML5RHX.js → claude-cli-XJLK2X4L.js} +1 -1
- package/dist/{claude-code-JRLMRPTO.js → claude-code-HTBA4XRB.js} +1 -1
- package/dist/{claude-code-teams-CAJBEFIZ.js → claude-code-teams-T4SP24MD.js} +1 -1
- package/dist/{conductor-HLWYWUVH.js → conductor-PGPDVIVE.js} +1 -1
- package/dist/{config-schema-3YNIFJCJ.js → config-schema-EA4XALGG.js} +4 -2
- package/dist/{constellation-FAGT45TU.js → constellation-A26CCGQS.js} +1 -1
- package/dist/{context-audit-557EO6PK.js → context-audit-RLO3ETRP.js} +8 -5
- package/dist/{cost-XEBADYFT.js → cost-BGM32XJU.js} +1 -1
- package/dist/{cost-UD3WPEKZ.js → cost-VI46A4XL.js} +1 -1
- package/dist/{cursor-cli-QUOOF2N4.js → cursor-cli-JVEZGHWQ.js} +1 -1
- package/dist/{cursorrules-3TKZ4E4R.js → cursorrules-HLIKJJZT.js} +1 -1
- package/dist/decision-loader-WWCLIQPJ.js +20 -0
- package/dist/{delete-RRK4RL6Y.js → delete-KBRPQLPC.js} +2 -2
- package/dist/{diff-IP5CIARP.js → diff-RQLLNAFI.js} +5 -5
- package/dist/{discipline-5F5OVTXB.js → discipline-FA4OZXIS.js} +1 -1
- package/dist/{dist-UXWV4OKX.js → dist-34NA5RS5.js} +1 -1
- package/dist/{dist-5QE2BB2B-X6DYVSUL.js → dist-5QE2BB2B-5S3T6Y3T.js} +1 -1
- package/dist/{dist-CM3MVWWW.js → dist-77JDTVAY.js} +1 -0
- package/dist/{dist-POMVY6WP.js → dist-QK4SQAK7.js} +1 -1
- package/dist/{dist-3RVKEJRT.js → dist-TA6LSC2Q.js} +1 -1
- package/dist/docs-J2BTKRVU.js +155 -0
- package/dist/docs-PBZB7LYP.js +89 -0
- package/dist/{doctor-GKZJU7QG.js → doctor-ULBOHEIC.js} +3 -3
- package/dist/{drift-YGT4LJ7Q.js → drift-R5NRKFHI.js} +1 -1
- package/dist/{echo-A6HD5UP7.js → echo-O2LY7CC2.js} +1 -1
- package/dist/{edit-4CLNN5JG.js → edit-R2HNLMOG.js} +2 -2
- package/dist/event-25OJKDCE.js +31 -0
- package/dist/{export-T7CMMJIB.js → export-IWVL7XLF.js} +1 -1
- package/dist/{flow-UFMPVOEM.js → flow-CRRVV3O3.js} +2 -2
- package/dist/{global-HHUJSBG5.js → global-3NG5JXUB.js} +1 -1
- package/dist/graduate-USAWGBJM.js +160 -0
- package/dist/{graph-YYUXI3F7.js → graph-VHUMAAS6.js} +2 -2
- package/dist/{graph-server-ZPXRSGCW.js → graph-server-YL22VBBN.js} +1 -1
- package/dist/{habits-RG5SVKXP.js → habits-OL5NGPXO.js} +3 -3
- package/dist/{history-CETCSUCP.js → history-WOWC573W.js} +1 -1
- package/dist/{hooks-TCUHQMPF.js → hooks-HFWSCGPV.js} +2 -2
- package/dist/index.js +302 -188
- package/dist/{integrity-MK2OP5TA.js → integrity-IHO4FZTS.js} +1 -1
- package/dist/{integrity-checker-J7YXRTBT.js → integrity-checker-PSKJA5SB.js} +1 -0
- package/dist/journal-loader-5EYSBFFY.js +18 -0
- package/dist/{lint-HYWGS3JJ.js → lint-K6CJGGPH.js} +1 -1
- package/dist/{list-IUCYPGMK.js → list-4YK7QKFF.js} +1 -1
- package/dist/{list-BTLFHSRC.js → list-ENR7Q4CR.js} +2 -2
- package/dist/{lore-loader-VTEEZDX3.js → lore-loader-7NO6N6FT.js} +4 -1
- package/dist/{lore-server-NOOAHKJX.js → lore-server-UNJY5KC3.js} +1 -1
- package/dist/{manual-AFJ2J2V3.js → manual-G6FISID5.js} +1 -1
- package/dist/mcp.js +3917 -356
- package/dist/{migrate-FQVGQNXZ.js → migrate-LS45DNEV.js} +2 -2
- package/dist/{migrate-assessments-JP6Q5KME.js → migrate-assessments-RGH4O6IX.js} +2 -2
- package/dist/nomination-engine-HDWMN4IO.js +42 -0
- package/dist/notebook-YWIYGEHV.js +155 -0
- package/dist/{orchestrate-A226N6FC.js → orchestrate-XZA33TJC.js} +5 -5
- package/dist/{peers-RFQCWVLV.js → peers-DEOUIZM6.js} +1 -1
- package/dist/persona-UHAHIVST.js +390 -0
- package/dist/{pipeline-3G2FRAKM.js → pipeline-L4HCSBGN.js} +1 -1
- package/dist/{platform-server-H7Y6Q7O4.js → platform-server-2D6S6YTK.js} +412 -18
- package/dist/{plugin-update-checker-HMRPGY5Z.js → plugin-update-checker-ELOEEQYS.js} +1 -0
- package/dist/{portal-check-FF5EKZE5.js → portal-check-NPYGII2D.js} +2 -2
- package/dist/{portal-compliance-VU4NIFEN.js → portal-compliance-J7DGAPFX.js} +2 -2
- package/dist/{probe-7JK7IDNI.js → probe-MHL5HQZ2.js} +3 -3
- package/dist/{promote-XO63XMAN.js → promote-F6ZYZZAL.js} +2 -2
- package/dist/{providers-YNFSL6HK.js → providers-GK7PB2OL.js} +2 -2
- package/dist/{quiz-I75NU2QQ.js → quiz-M66SC7F7.js} +1 -1
- package/dist/{record-46CLR4OG.js → record-RA4WR2BO.js} +2 -2
- package/dist/{reindex-WIJMCJ4A.js → reindex-65H4WULU.js} +3 -2
- package/dist/{remember-4EUZKIIB.js → remember-HBWJ655S.js} +1 -1
- package/dist/{retag-KC4JVRLE.js → retag-3OLCVDEQ.js} +2 -2
- package/dist/{review-Q7M4CRB5.js → review-27ATYTD2.js} +2 -2
- package/dist/review-57QMURZV.js +334 -0
- package/dist/{ripple-RI3LOT6R.js → ripple-JPBXP5I3.js} +1 -1
- package/dist/{sentinel-UOIGJWHH.js → sentinel-4XIG4STA.js} +2 -2
- package/dist/{sentinel-bridge-APDXYAZS.js → sentinel-bridge-MDUXTQRL.js} +2 -2
- package/dist/{serve-KKEHE44G.js → serve-EFVRS4GA.js} +2 -2
- package/dist/{serve-22A4XOIG.js → serve-INL7SNBK.js} +2 -2
- package/dist/{serve-2YJ6D2Y6.js → serve-KBSE36PL.js} +4 -4
- package/dist/{server-JV6UFGWZ.js → server-54SKYFFY.js} +2 -2
- package/dist/{server-RDLQ3DK7.js → server-XUOIO7E6.js} +1 -1
- package/dist/{setup-YNZJQLW7.js → setup-EDS27WUR.js} +1 -1
- package/dist/{setup-M2ZKLKNN.js → setup-KO5AFC4K.js} +2 -2
- package/dist/{shift-LNMKFYLR.js → shift-VFG23DLA.js} +16 -16
- package/dist/{show-P7GYO43X.js → show-5PV5KFJE.js} +2 -2
- package/dist/{show-PKZMYKRN.js → show-NQKYX6WQ.js} +1 -1
- package/dist/{snapshot-Y3COXK4T.js → snapshot-BK4RBPCG.js} +1 -1
- package/dist/{spawn-SSXZX45U.js → spawn-AW6GDECS.js} +3 -3
- package/dist/{status-KLHALGW4.js → status-WGIAQODY.js} +1 -1
- package/dist/{summary-5NQNOD3F.js → summary-NIRABMF5.js} +2 -2
- package/dist/{sweep-EZU3GU6S.js → sweep-QMHNSIY5.js} +2 -2
- package/dist/{switch-WYUMVNA5.js → switch-6EJPZDIA.js} +1 -1
- package/dist/{symphony-6K3HD7AW.js → symphony-4OCY36AI.js} +5 -5
- package/dist/{symphony-YCHBYN3E.js → symphony-B75X2MME.js} +2 -2
- package/dist/{symphony-peers-HSY3RI3S.js → symphony-peers-2ZQYLRNI.js} +1 -1
- package/dist/{symphony-peers-APOGJPF4.js → symphony-peers-OL7F6M5S.js} +1 -0
- package/dist/{symphony-relay-GTAJRCVF.js → symphony-relay-UJYUXN65.js} +28 -1
- package/dist/{sync-ZM4Q3R4U.js → sync-VEHUH4OA.js} +3 -3
- package/dist/{sync-llms-JIPP3XX4.js → sync-llms-YHCFIE6X.js} +2 -2
- package/dist/{task-loader-7M2FCBX6.js → task-loader-LDYWQSLM.js} +1 -0
- package/dist/{team-HGLJXWQG.js → team-7HG7XK5C.js} +6 -6
- package/dist/{test-WTR5Q33E.js → test-566CP5KC.js} +1 -1
- package/dist/{thread-3WM7KKID.js → thread-N754I4D5.js} +1 -1
- package/dist/{timeline-ANC7LVDL.js → timeline-M3CICQFE.js} +2 -2
- package/dist/{triage-IZ4MDYNB.js → triage-HHYGT3HY.js} +1 -1
- package/dist/{tutorial-GC6QL4US.js → tutorial-KD22SUNO.js} +1 -1
- package/dist/university-content/courses/.purpose +66 -0
- package/dist/university-content/courses/para-401.json +146 -0
- package/dist/university-content/courses/para-501.json +67 -0
- package/dist/university-content/courses/para-601.json +690 -0
- package/dist/university-content/plsat/.purpose +6 -0
- package/dist/university-content/plsat/v2.0.json +2 -2
- package/dist/university-content/plsat/v3.0.json +563 -3
- package/dist/university-content/reference.json +91 -0
- package/dist/university-ui/assets/{index-tfi5xN4Q.js → index-C6bH_6xu.js} +2 -2
- package/dist/university-ui/assets/{index-tfi5xN4Q.js.map → index-C6bH_6xu.js.map} +1 -1
- package/dist/university-ui/index.html +1 -1
- package/dist/{upgrade-ANX3LVSA.js → upgrade-H5PF32BW.js} +2 -2
- package/dist/{validate-GD5XWILV.js → validate-CNKEKO6A.js} +1 -1
- package/dist/{validate-ITC5D6QG.js → validate-MB5ULIHS.js} +1 -1
- package/dist/{validate-ZVPNN4FL.js → validate-QH3LADM6.js} +1 -1
- package/dist/{watch-X64UK7K4.js → watch-2TKP5PVL.js} +3 -3
- package/dist/{watch-ERBEJUJW.js → watch-ZF4ML6CD.js} +2 -2
- package/dist/{wisdom-L2WC7J62.js → wisdom-AATMGNFA.js} +1 -1
- package/dist/work-log-loader-5L45XNYZ.js +14 -0
- package/dist/{workspace-UIUTHZTD.js → workspace-6E6OSRNU.js} +4 -4
- package/package.json +1 -1
- package/platform-ui/dist/assets/DocsSection-ByAgPzWV.js +1 -0
- package/platform-ui/dist/assets/DocsSection-CjdO6R-u.css +1 -0
- package/platform-ui/dist/assets/{GitSection-BD3Ze06e.js → GitSection-BLovj9yT.js} +1 -1
- package/platform-ui/dist/assets/{GraphSection-SglITfSs.js → GraphSection-C5PCPUFl.js} +1 -1
- package/platform-ui/dist/assets/{LoreSection-bR5Km4Fd.js → LoreSection-BftejTla.js} +1 -1
- package/platform-ui/dist/assets/{SentinelSection-QSpAZArG.js → SentinelSection-CnYcasN7.js} +1 -1
- package/platform-ui/dist/assets/{SymphonySection-CobYJgvg.js → SymphonySection-BpmqCHeK.js} +1 -1
- package/platform-ui/dist/assets/{index-DbxeSMkV.js → index-G9JnWEs_.js} +10 -10
- package/platform-ui/dist/index.html +1 -1
- package/dist/dist-PSF5CP4I.js +0 -7294
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import {
|
|
3
3
|
BackgroundOrchestrator
|
|
4
|
-
} from "./chunk-
|
|
5
|
-
import "./chunk-
|
|
4
|
+
} from "./chunk-WQITYKHM.js";
|
|
5
|
+
import "./chunk-LSRABQIY.js";
|
|
6
6
|
import "./chunk-PBHIFAL4.js";
|
|
7
|
-
import "./chunk-
|
|
7
|
+
import "./chunk-TXESEO7Y.js";
|
|
8
8
|
import "./chunk-6QC3YGB6.js";
|
|
9
9
|
import "./chunk-PMXRGPRQ.js";
|
|
10
|
-
import "./chunk-MW5DMGBB.js";
|
|
11
10
|
import "./chunk-5JGJACDU.js";
|
|
12
11
|
import "./chunk-ZGUAAVMA.js";
|
|
13
12
|
import "./chunk-EDOAWN7J.js";
|
|
14
13
|
import "./chunk-IRKUEJVW.js";
|
|
15
|
-
import "./chunk-
|
|
14
|
+
import "./chunk-YMDLDELF.js";
|
|
15
|
+
import "./chunk-PDX44BCA.js";
|
|
16
16
|
|
|
17
17
|
// src/commands/team/accept-orchestration.ts
|
|
18
18
|
import * as path from "path";
|
|
@@ -0,0 +1,523 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import {
|
|
3
|
+
log
|
|
4
|
+
} from "./chunk-4NCFWYGG.js";
|
|
5
|
+
import "./chunk-PDX44BCA.js";
|
|
6
|
+
|
|
7
|
+
// src/commands/agent/index.ts
|
|
8
|
+
import * as fs from "fs";
|
|
9
|
+
import * as path from "path";
|
|
10
|
+
import * as os from "os";
|
|
11
|
+
import chalk from "chalk";
|
|
12
|
+
import * as yaml from "js-yaml";
|
|
13
|
+
var GLOBAL_AGENTS_DIR = path.join(os.homedir(), ".paradigm", "agents");
|
|
14
|
+
var PROJECT_AGENTS_DIR = ".paradigm/agents";
|
|
15
|
+
var AGENT_EXT = ".agent";
|
|
16
|
+
var DEFAULT_PERSONALITIES = {
|
|
17
|
+
architect: { style: "deliberate", risk: "conservative", verbosity: "detailed" },
|
|
18
|
+
builder: { style: "rapid", risk: "balanced", verbosity: "concise" },
|
|
19
|
+
tester: { style: "methodical", risk: "conservative", verbosity: "concise" },
|
|
20
|
+
reviewer: { style: "deliberate", risk: "conservative", verbosity: "detailed" },
|
|
21
|
+
security: { style: "methodical", risk: "conservative", verbosity: "detailed" }
|
|
22
|
+
};
|
|
23
|
+
async function agentListCommand(options = {}) {
|
|
24
|
+
const cwd = process.cwd();
|
|
25
|
+
const tracker = log.command("agent-list").start("Listing agent profiles", { cwd });
|
|
26
|
+
const profiles = [];
|
|
27
|
+
if (!options.project && fs.existsSync(GLOBAL_AGENTS_DIR)) {
|
|
28
|
+
try {
|
|
29
|
+
const files = fs.readdirSync(GLOBAL_AGENTS_DIR).filter((f) => f.endsWith(AGENT_EXT));
|
|
30
|
+
for (const file of files) {
|
|
31
|
+
try {
|
|
32
|
+
const content = fs.readFileSync(path.join(GLOBAL_AGENTS_DIR, file), "utf-8");
|
|
33
|
+
const p = yaml.load(content);
|
|
34
|
+
if (p?.id) profiles.push(p);
|
|
35
|
+
} catch {
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
} catch {
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
const projectDir = path.join(cwd, PROJECT_AGENTS_DIR);
|
|
42
|
+
if (!options.global && fs.existsSync(projectDir)) {
|
|
43
|
+
try {
|
|
44
|
+
const files = fs.readdirSync(projectDir).filter((f) => f.endsWith(AGENT_EXT));
|
|
45
|
+
for (const file of files) {
|
|
46
|
+
try {
|
|
47
|
+
const content = fs.readFileSync(path.join(projectDir, file), "utf-8");
|
|
48
|
+
const p = yaml.load(content);
|
|
49
|
+
if (p?.id) {
|
|
50
|
+
const idx = profiles.findIndex((e) => e.id === p.id);
|
|
51
|
+
if (idx >= 0) profiles[idx] = p;
|
|
52
|
+
else profiles.push(p);
|
|
53
|
+
}
|
|
54
|
+
} catch {
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
} catch {
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
if (options.json) {
|
|
61
|
+
console.log(JSON.stringify({ count: profiles.length, agents: profiles.map(summarize) }, null, 2));
|
|
62
|
+
tracker.success(`Found ${profiles.length} agents`);
|
|
63
|
+
return;
|
|
64
|
+
}
|
|
65
|
+
console.log(chalk.blue("\n\u250C\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510"));
|
|
66
|
+
console.log(chalk.blue("\u2502") + chalk.white.bold(" paradigm agent list ") + chalk.blue("\u2502"));
|
|
67
|
+
console.log(chalk.blue("\u2502") + chalk.gray(" Persistent agent identity profiles ") + chalk.blue("\u2502"));
|
|
68
|
+
console.log(chalk.blue("\u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518\n"));
|
|
69
|
+
if (profiles.length === 0) {
|
|
70
|
+
console.log(chalk.yellow(" No .agent profiles found."));
|
|
71
|
+
console.log(chalk.gray(" Create one: paradigm agent create <id> --global\n"));
|
|
72
|
+
tracker.success("No agents found");
|
|
73
|
+
return;
|
|
74
|
+
}
|
|
75
|
+
for (const p of profiles) {
|
|
76
|
+
const expertise = (p.expertise || []).sort((a, b) => b.confidence - a.confidence);
|
|
77
|
+
const topSymbols = expertise.slice(0, 3).map(
|
|
78
|
+
(e) => `${e.symbol} (${(e.confidence * 100).toFixed(0)}%)`
|
|
79
|
+
).join(", ") || chalk.gray("none yet");
|
|
80
|
+
console.log(` ${chalk.white.bold(p.id)} \u2014 ${chalk.gray(p.role)}`);
|
|
81
|
+
console.log(` Style: ${p.personality?.style || "?"} | Risk: ${p.personality?.risk || "?"} | Verbosity: ${p.personality?.verbosity || "?"}`);
|
|
82
|
+
console.log(` Top expertise: ${topSymbols}`);
|
|
83
|
+
console.log(` Projects: ${Object.keys(p.contexts || {}).join(", ") || chalk.gray("none")}`);
|
|
84
|
+
console.log("");
|
|
85
|
+
}
|
|
86
|
+
tracker.success(`Listed ${profiles.length} agents`);
|
|
87
|
+
}
|
|
88
|
+
async function agentShowCommand(id, options = {}) {
|
|
89
|
+
const cwd = process.cwd();
|
|
90
|
+
const tracker = log.command("agent-show").start(`Showing agent ${id}`, { cwd });
|
|
91
|
+
const profile = loadProfile(cwd, id);
|
|
92
|
+
if (!profile) {
|
|
93
|
+
if (options.json) {
|
|
94
|
+
console.log(JSON.stringify({ error: `Agent "${id}" not found` }));
|
|
95
|
+
} else {
|
|
96
|
+
console.log(chalk.red(`
|
|
97
|
+
Agent "${id}" not found.`));
|
|
98
|
+
console.log(chalk.gray(` Create: paradigm agent create ${id} --global
|
|
99
|
+
`));
|
|
100
|
+
}
|
|
101
|
+
tracker.error(`Agent ${id} not found`);
|
|
102
|
+
return;
|
|
103
|
+
}
|
|
104
|
+
if (options.json) {
|
|
105
|
+
console.log(JSON.stringify(profile, null, 2));
|
|
106
|
+
tracker.success(`Showed agent ${id}`);
|
|
107
|
+
return;
|
|
108
|
+
}
|
|
109
|
+
console.log(chalk.blue("\n\u250C\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510"));
|
|
110
|
+
console.log(chalk.blue("\u2502") + chalk.white.bold(` Agent: ${id}`.padEnd(50)) + chalk.blue("\u2502"));
|
|
111
|
+
console.log(chalk.blue("\u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518\n"));
|
|
112
|
+
console.log(` ${chalk.white.bold("Role:")} ${profile.role}`);
|
|
113
|
+
console.log(` ${chalk.white.bold("Description:")} ${profile.description}`);
|
|
114
|
+
console.log(` ${chalk.white.bold("Version:")} ${profile.version}`);
|
|
115
|
+
console.log(` ${chalk.white.bold("Created:")} ${profile.created}`);
|
|
116
|
+
console.log(` ${chalk.white.bold("Updated:")} ${profile.updated}`);
|
|
117
|
+
console.log("");
|
|
118
|
+
if (profile.personality) {
|
|
119
|
+
const p = profile.personality;
|
|
120
|
+
console.log(` ${chalk.white.bold("Personality")}`);
|
|
121
|
+
console.log(` Style: ${p.style} | Risk: ${p.risk} | Verbosity: ${p.verbosity}`);
|
|
122
|
+
console.log("");
|
|
123
|
+
}
|
|
124
|
+
const expertise = (profile.expertise || []).sort((a, b) => b.confidence - a.confidence);
|
|
125
|
+
if (expertise.length > 0) {
|
|
126
|
+
console.log(` ${chalk.white.bold("Expertise")} (${expertise.length} symbols)`);
|
|
127
|
+
console.log(` ${"Symbol".padEnd(30)} ${"Confidence".padEnd(12)} ${"Sessions".padEnd(10)} Last Touch`);
|
|
128
|
+
console.log(` ${"-".repeat(70)}`);
|
|
129
|
+
for (const e of expertise.slice(0, 20)) {
|
|
130
|
+
const conf = `${(e.confidence * 100).toFixed(0)}%`.padEnd(12);
|
|
131
|
+
const sessions = String(e.sessions).padEnd(10);
|
|
132
|
+
const date = e.lastTouch ? e.lastTouch.split("T")[0] : "\u2014";
|
|
133
|
+
console.log(` ${e.symbol.padEnd(30)} ${conf} ${sessions} ${date}`);
|
|
134
|
+
}
|
|
135
|
+
if (expertise.length > 20) {
|
|
136
|
+
console.log(chalk.gray(` ... and ${expertise.length - 20} more`));
|
|
137
|
+
}
|
|
138
|
+
console.log("");
|
|
139
|
+
} else {
|
|
140
|
+
console.log(chalk.gray(" No expertise recorded. Run `paradigm agent sync` to bootstrap from lore.\n"));
|
|
141
|
+
}
|
|
142
|
+
const patterns = profile.transferable || [];
|
|
143
|
+
if (patterns.length > 0) {
|
|
144
|
+
console.log(` ${chalk.white.bold("Transferable Patterns")} (${patterns.length})`);
|
|
145
|
+
for (const p of patterns) {
|
|
146
|
+
console.log(` ${p.id}: ${(p.successRate * 100).toFixed(0)}% success \u2014 ${p.description}`);
|
|
147
|
+
console.log(chalk.gray(` Learned in: ${p.learnedIn} | Applied in: ${p.appliedIn.join(", ") || "none"}`));
|
|
148
|
+
}
|
|
149
|
+
console.log("");
|
|
150
|
+
}
|
|
151
|
+
const contexts = Object.entries(profile.contexts || {});
|
|
152
|
+
if (contexts.length > 0) {
|
|
153
|
+
console.log(` ${chalk.white.bold("Project Contexts")} (${contexts.length})`);
|
|
154
|
+
for (const [name, ctx] of contexts) {
|
|
155
|
+
console.log(` ${chalk.white(name)}: ${ctx.sessionsInProject || 0} sessions, last active ${ctx.lastActive?.split("T")[0] || "\u2014"}`);
|
|
156
|
+
if (ctx.defaultModel) console.log(` Model: ${ctx.defaultModel}`);
|
|
157
|
+
if (ctx.focus?.length) console.log(` Focus: ${ctx.focus.join(", ")}`);
|
|
158
|
+
}
|
|
159
|
+
console.log("");
|
|
160
|
+
}
|
|
161
|
+
const perms = profile.permissions;
|
|
162
|
+
if (perms) {
|
|
163
|
+
console.log(` ${chalk.white.bold("Permissions")}`);
|
|
164
|
+
if (perms.paths?.read?.length) console.log(` Read: ${perms.paths.read.join(", ")}`);
|
|
165
|
+
if (perms.paths?.write?.length) console.log(` Write: ${perms.paths.write.join(", ")}`);
|
|
166
|
+
if (perms.paths?.deny?.length) console.log(` Deny: ${chalk.red(perms.paths.deny.join(", "))}`);
|
|
167
|
+
if (perms.tools?.allow?.length) console.log(` Tools allow: ${perms.tools.allow.join(", ")}`);
|
|
168
|
+
if (perms.tools?.deny?.length) console.log(` Tools deny: ${chalk.red(perms.tools.deny.join(", "))}`);
|
|
169
|
+
if (perms.dangerous_actions?.length) console.log(` Requires approval: ${perms.dangerous_actions.join(", ")}`);
|
|
170
|
+
console.log("");
|
|
171
|
+
}
|
|
172
|
+
tracker.success(`Showed agent ${id}`);
|
|
173
|
+
}
|
|
174
|
+
async function agentCreateCommand(id, options = {}) {
|
|
175
|
+
const cwd = process.cwd();
|
|
176
|
+
const scope = options.global ? "global" : "project";
|
|
177
|
+
const tracker = log.command("agent-create").start(`Creating agent ${id} (${scope})`, { cwd });
|
|
178
|
+
const dir = scope === "global" ? GLOBAL_AGENTS_DIR : path.join(cwd, PROJECT_AGENTS_DIR);
|
|
179
|
+
if (!fs.existsSync(dir)) {
|
|
180
|
+
fs.mkdirSync(dir, { recursive: true });
|
|
181
|
+
}
|
|
182
|
+
const filePath = path.join(dir, `${id}${AGENT_EXT}`);
|
|
183
|
+
if (fs.existsSync(filePath)) {
|
|
184
|
+
console.log(chalk.yellow(`
|
|
185
|
+
Agent "${id}" already exists at ${filePath}`));
|
|
186
|
+
console.log(chalk.gray(" Use `paradigm agent show` to view.\n"));
|
|
187
|
+
tracker.error("Agent already exists");
|
|
188
|
+
return;
|
|
189
|
+
}
|
|
190
|
+
const now = (/* @__PURE__ */ new Date()).toISOString();
|
|
191
|
+
const personality = DEFAULT_PERSONALITIES[id] || { style: "deliberate", risk: "balanced", verbosity: "concise" };
|
|
192
|
+
const profile = {
|
|
193
|
+
id,
|
|
194
|
+
role: options.role || `${id.charAt(0).toUpperCase() + id.slice(1)} agent`,
|
|
195
|
+
description: options.description || `Persistent identity for the ${id} agent role`,
|
|
196
|
+
version: "1.0.0",
|
|
197
|
+
personality,
|
|
198
|
+
expertise: [],
|
|
199
|
+
transferable: [],
|
|
200
|
+
contexts: {},
|
|
201
|
+
created: now,
|
|
202
|
+
updated: now
|
|
203
|
+
};
|
|
204
|
+
if (options.denyPaths) {
|
|
205
|
+
const denyPatterns = options.denyPaths.split(",").map((p) => p.trim());
|
|
206
|
+
profile.permissions = {
|
|
207
|
+
paths: { deny: denyPatterns }
|
|
208
|
+
};
|
|
209
|
+
}
|
|
210
|
+
const content = yaml.dump(profile, { lineWidth: 120, noRefs: true, sortKeys: false });
|
|
211
|
+
fs.writeFileSync(filePath, content, "utf-8");
|
|
212
|
+
console.log(chalk.green(`
|
|
213
|
+
\u2713 Created agent "${id}" at ${filePath}`));
|
|
214
|
+
console.log(chalk.gray(` Run \`paradigm agent sync\` to bootstrap expertise from lore.
|
|
215
|
+
`));
|
|
216
|
+
tracker.success(`Created agent ${id}`);
|
|
217
|
+
}
|
|
218
|
+
async function agentSyncCommand(id, options = {}) {
|
|
219
|
+
const cwd = process.cwd();
|
|
220
|
+
const tracker = log.command("agent-sync").start(`Syncing expertise for ${id}`, { cwd });
|
|
221
|
+
const lorePath = path.join(cwd, ".paradigm", "lore", "entries");
|
|
222
|
+
if (!fs.existsSync(lorePath)) {
|
|
223
|
+
console.log(chalk.yellow("\n No lore directory found. Nothing to sync from.\n"));
|
|
224
|
+
tracker.error("No lore found");
|
|
225
|
+
return;
|
|
226
|
+
}
|
|
227
|
+
let profile = loadProfile(cwd, id);
|
|
228
|
+
if (!profile) {
|
|
229
|
+
if (options.dryRun) {
|
|
230
|
+
console.log(chalk.yellow(`
|
|
231
|
+
Agent "${id}" not found. Would create with --no-dry-run.
|
|
232
|
+
`));
|
|
233
|
+
tracker.success("Dry run \u2014 would create");
|
|
234
|
+
return;
|
|
235
|
+
}
|
|
236
|
+
const scope = fs.existsSync(path.join(GLOBAL_AGENTS_DIR, `${id}${AGENT_EXT}`)) ? "global" : "project";
|
|
237
|
+
const dir = scope === "global" ? GLOBAL_AGENTS_DIR : path.join(cwd, PROJECT_AGENTS_DIR);
|
|
238
|
+
if (!fs.existsSync(dir)) fs.mkdirSync(dir, { recursive: true });
|
|
239
|
+
const now = (/* @__PURE__ */ new Date()).toISOString();
|
|
240
|
+
const personality = DEFAULT_PERSONALITIES[id] || { style: "deliberate", risk: "balanced", verbosity: "concise" };
|
|
241
|
+
profile = {
|
|
242
|
+
id,
|
|
243
|
+
role: `${id.charAt(0).toUpperCase() + id.slice(1)} agent`,
|
|
244
|
+
description: `Persistent identity for the ${id} agent role`,
|
|
245
|
+
version: "1.0.0",
|
|
246
|
+
personality,
|
|
247
|
+
expertise: [],
|
|
248
|
+
transferable: [],
|
|
249
|
+
contexts: {},
|
|
250
|
+
created: now,
|
|
251
|
+
updated: now
|
|
252
|
+
};
|
|
253
|
+
}
|
|
254
|
+
const expertise = profile.expertise || [];
|
|
255
|
+
let entriesProcessed = 0;
|
|
256
|
+
const symbolsUpdated = /* @__PURE__ */ new Set();
|
|
257
|
+
const loreEntries = scanLoreDir(lorePath);
|
|
258
|
+
for (const entry of loreEntries) {
|
|
259
|
+
if (!entry.symbols_touched || entry.symbols_touched.length === 0) continue;
|
|
260
|
+
entriesProcessed++;
|
|
261
|
+
for (const symbol of entry.symbols_touched) {
|
|
262
|
+
symbolsUpdated.add(symbol);
|
|
263
|
+
const existing = expertise.find((e) => e.symbol === symbol);
|
|
264
|
+
if (existing) {
|
|
265
|
+
existing.sessions++;
|
|
266
|
+
existing.lastTouch = entry.timestamp || existing.lastTouch;
|
|
267
|
+
if (entry.confidence != null) {
|
|
268
|
+
existing.confidence = 0.7 * existing.confidence + 0.3 * entry.confidence;
|
|
269
|
+
}
|
|
270
|
+
} else {
|
|
271
|
+
expertise.push({
|
|
272
|
+
symbol,
|
|
273
|
+
confidence: entry.confidence ?? 0.5,
|
|
274
|
+
sessions: 1,
|
|
275
|
+
lastTouch: entry.timestamp || (/* @__PURE__ */ new Date()).toISOString()
|
|
276
|
+
});
|
|
277
|
+
}
|
|
278
|
+
}
|
|
279
|
+
}
|
|
280
|
+
profile.expertise = expertise;
|
|
281
|
+
if (options.json) {
|
|
282
|
+
console.log(JSON.stringify({
|
|
283
|
+
agentId: id,
|
|
284
|
+
entriesProcessed,
|
|
285
|
+
symbolsUpdated: symbolsUpdated.size,
|
|
286
|
+
dryRun: !!options.dryRun,
|
|
287
|
+
topExpertise: expertise.sort((a, b) => b.confidence - a.confidence).slice(0, 10)
|
|
288
|
+
}, null, 2));
|
|
289
|
+
} else {
|
|
290
|
+
console.log(chalk.blue(`
|
|
291
|
+
Syncing expertise for "${id}" from ${entriesProcessed} lore entries...`));
|
|
292
|
+
console.log(` ${chalk.green("\u2713")} ${symbolsUpdated.size} symbols updated`);
|
|
293
|
+
console.log(` ${chalk.green("\u2713")} ${entriesProcessed} entries processed`);
|
|
294
|
+
if (expertise.length > 0) {
|
|
295
|
+
console.log(`
|
|
296
|
+
Top expertise:`);
|
|
297
|
+
for (const e of expertise.sort((a, b) => b.confidence - a.confidence).slice(0, 5)) {
|
|
298
|
+
console.log(` ${e.symbol}: ${(e.confidence * 100).toFixed(0)}% (${e.sessions} sessions)`);
|
|
299
|
+
}
|
|
300
|
+
}
|
|
301
|
+
}
|
|
302
|
+
if (!options.dryRun) {
|
|
303
|
+
profile.updated = (/* @__PURE__ */ new Date()).toISOString();
|
|
304
|
+
const projectPath = path.join(cwd, PROJECT_AGENTS_DIR, `${id}${AGENT_EXT}`);
|
|
305
|
+
const globalPath = path.join(GLOBAL_AGENTS_DIR, `${id}${AGENT_EXT}`);
|
|
306
|
+
const scope = fs.existsSync(projectPath) ? "project" : "global";
|
|
307
|
+
const dir = scope === "global" ? GLOBAL_AGENTS_DIR : path.join(cwd, PROJECT_AGENTS_DIR);
|
|
308
|
+
if (!fs.existsSync(dir)) fs.mkdirSync(dir, { recursive: true });
|
|
309
|
+
const filePath = scope === "global" ? globalPath : projectPath;
|
|
310
|
+
fs.writeFileSync(filePath, yaml.dump(profile, { lineWidth: 120, noRefs: true, sortKeys: false }), "utf-8");
|
|
311
|
+
if (!options.json) {
|
|
312
|
+
console.log(chalk.green(`
|
|
313
|
+
\u2713 Saved to ${filePath}
|
|
314
|
+
`));
|
|
315
|
+
}
|
|
316
|
+
} else if (!options.json) {
|
|
317
|
+
console.log(chalk.yellow("\n Dry run \u2014 no changes written.\n"));
|
|
318
|
+
}
|
|
319
|
+
tracker.success(`Synced ${symbolsUpdated.size} symbols from ${entriesProcessed} entries`);
|
|
320
|
+
}
|
|
321
|
+
async function agentRosterCommand(options = {}) {
|
|
322
|
+
const cwd = process.cwd();
|
|
323
|
+
const tracker = log.command("agent-roster").start("Agent roster", { cwd });
|
|
324
|
+
const profiles = [];
|
|
325
|
+
if (fs.existsSync(GLOBAL_AGENTS_DIR)) {
|
|
326
|
+
for (const file of fs.readdirSync(GLOBAL_AGENTS_DIR).filter((f) => f.endsWith(AGENT_EXT))) {
|
|
327
|
+
try {
|
|
328
|
+
const p = yaml.load(fs.readFileSync(path.join(GLOBAL_AGENTS_DIR, file), "utf-8"));
|
|
329
|
+
if (p?.id) profiles.push(p);
|
|
330
|
+
} catch {
|
|
331
|
+
}
|
|
332
|
+
}
|
|
333
|
+
}
|
|
334
|
+
const projectDir = path.join(cwd, PROJECT_AGENTS_DIR);
|
|
335
|
+
if (fs.existsSync(projectDir)) {
|
|
336
|
+
for (const file of fs.readdirSync(projectDir).filter((f) => f.endsWith(AGENT_EXT))) {
|
|
337
|
+
try {
|
|
338
|
+
const p = yaml.load(fs.readFileSync(path.join(projectDir, file), "utf-8"));
|
|
339
|
+
if (p?.id) {
|
|
340
|
+
const idx = profiles.findIndex((e) => e.id === p.id);
|
|
341
|
+
if (idx >= 0) profiles[idx] = p;
|
|
342
|
+
else profiles.push(p);
|
|
343
|
+
}
|
|
344
|
+
} catch {
|
|
345
|
+
}
|
|
346
|
+
}
|
|
347
|
+
}
|
|
348
|
+
const active = profiles.filter((p) => !p.benched);
|
|
349
|
+
const benched = profiles.filter((p) => p.benched);
|
|
350
|
+
if (options.json) {
|
|
351
|
+
console.log(JSON.stringify({
|
|
352
|
+
active: active.map(rosterSummarize),
|
|
353
|
+
benched: benched.map(rosterSummarize)
|
|
354
|
+
}, null, 2));
|
|
355
|
+
tracker.success(`${active.length} active, ${benched.length} benched`);
|
|
356
|
+
return;
|
|
357
|
+
}
|
|
358
|
+
console.log(chalk.blue("\n\u250C\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510"));
|
|
359
|
+
console.log(chalk.blue("\u2502") + chalk.white.bold(" Agent Roster ") + chalk.blue("\u2502"));
|
|
360
|
+
console.log(chalk.blue("\u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518\n"));
|
|
361
|
+
if (active.length > 0) {
|
|
362
|
+
console.log(chalk.green.bold(" Active"));
|
|
363
|
+
for (const p of active) {
|
|
364
|
+
printRosterRow(p);
|
|
365
|
+
}
|
|
366
|
+
}
|
|
367
|
+
if (benched.length > 0) {
|
|
368
|
+
console.log(chalk.gray.bold("\n Benched"));
|
|
369
|
+
for (const p of benched) {
|
|
370
|
+
printRosterRow(p, true);
|
|
371
|
+
}
|
|
372
|
+
}
|
|
373
|
+
if (profiles.length === 0) {
|
|
374
|
+
console.log(chalk.yellow(" No agents found.\n"));
|
|
375
|
+
} else {
|
|
376
|
+
console.log("");
|
|
377
|
+
}
|
|
378
|
+
tracker.success(`${active.length} active, ${benched.length} benched`);
|
|
379
|
+
}
|
|
380
|
+
function printRosterRow(p, dimmed = false) {
|
|
381
|
+
const expertise = (p.expertise || []).sort((a, b) => b.confidence - a.confidence);
|
|
382
|
+
const topSymbol = expertise[0] ? `${expertise[0].symbol} (${(expertise[0].confidence * 100).toFixed(0)}%)` : chalk.gray("\u2014");
|
|
383
|
+
const color = dimmed ? chalk.gray : chalk.white;
|
|
384
|
+
const nickname = p.nickname ? ` (${p.nickname})` : "";
|
|
385
|
+
const threshold = p.attention?.threshold;
|
|
386
|
+
const thresholdStr = threshold != null ? ` | thr: ${threshold.toFixed(2)}` : "";
|
|
387
|
+
console.log(` ${color.bold(p.id)}${chalk.gray(nickname)} \u2014 ${chalk.gray(p.role)}`);
|
|
388
|
+
console.log(` Top: ${topSymbol} | ${expertise.length} symbols${thresholdStr}`);
|
|
389
|
+
}
|
|
390
|
+
function rosterSummarize(p) {
|
|
391
|
+
const expertise = (p.expertise || []).sort((a, b) => b.confidence - a.confidence);
|
|
392
|
+
return {
|
|
393
|
+
id: p.id,
|
|
394
|
+
role: p.role,
|
|
395
|
+
nickname: p.nickname,
|
|
396
|
+
benched: p.benched || false,
|
|
397
|
+
expertiseCount: expertise.length,
|
|
398
|
+
topExpertise: expertise.slice(0, 3).map((e) => ({
|
|
399
|
+
symbol: e.symbol,
|
|
400
|
+
confidence: parseFloat(e.confidence.toFixed(2))
|
|
401
|
+
})),
|
|
402
|
+
threshold: p.attention?.threshold
|
|
403
|
+
};
|
|
404
|
+
}
|
|
405
|
+
async function agentBenchCommand(id) {
|
|
406
|
+
const cwd = process.cwd();
|
|
407
|
+
const tracker = log.command("agent-bench").start(`Benching agent ${id}`, { cwd });
|
|
408
|
+
const profile = loadProfile(cwd, id);
|
|
409
|
+
if (!profile) {
|
|
410
|
+
console.log(chalk.red(`
|
|
411
|
+
Agent "${id}" not found.
|
|
412
|
+
`));
|
|
413
|
+
tracker.error("Not found");
|
|
414
|
+
return;
|
|
415
|
+
}
|
|
416
|
+
profile.benched = true;
|
|
417
|
+
profile.updated = (/* @__PURE__ */ new Date()).toISOString();
|
|
418
|
+
saveProfile(cwd, id, profile);
|
|
419
|
+
console.log(chalk.yellow(`
|
|
420
|
+
\u23F8 Agent "${id}" is now benched.`));
|
|
421
|
+
console.log(chalk.gray(" Maestro will skip this agent during orchestration.\n"));
|
|
422
|
+
tracker.success(`Benched ${id}`);
|
|
423
|
+
}
|
|
424
|
+
async function agentActivateCommand(id) {
|
|
425
|
+
const cwd = process.cwd();
|
|
426
|
+
const tracker = log.command("agent-activate").start(`Activating agent ${id}`, { cwd });
|
|
427
|
+
const profile = loadProfile(cwd, id);
|
|
428
|
+
if (!profile) {
|
|
429
|
+
console.log(chalk.red(`
|
|
430
|
+
Agent "${id}" not found.
|
|
431
|
+
`));
|
|
432
|
+
tracker.error("Not found");
|
|
433
|
+
return;
|
|
434
|
+
}
|
|
435
|
+
profile.benched = false;
|
|
436
|
+
profile.updated = (/* @__PURE__ */ new Date()).toISOString();
|
|
437
|
+
saveProfile(cwd, id, profile);
|
|
438
|
+
console.log(chalk.green(`
|
|
439
|
+
\u25B6 Agent "${id}" is now active.`));
|
|
440
|
+
console.log(chalk.gray(" Maestro will include this agent in orchestration.\n"));
|
|
441
|
+
tracker.success(`Activated ${id}`);
|
|
442
|
+
}
|
|
443
|
+
function saveProfile(rootDir, id, profile) {
|
|
444
|
+
const projectPath = path.join(rootDir, PROJECT_AGENTS_DIR, `${id}${AGENT_EXT}`);
|
|
445
|
+
if (fs.existsSync(projectPath)) {
|
|
446
|
+
fs.writeFileSync(projectPath, yaml.dump(profile, { lineWidth: 120, noRefs: true, sortKeys: false }), "utf-8");
|
|
447
|
+
return;
|
|
448
|
+
}
|
|
449
|
+
const globalPath = path.join(GLOBAL_AGENTS_DIR, `${id}${AGENT_EXT}`);
|
|
450
|
+
const dir = GLOBAL_AGENTS_DIR;
|
|
451
|
+
if (!fs.existsSync(dir)) fs.mkdirSync(dir, { recursive: true });
|
|
452
|
+
fs.writeFileSync(globalPath, yaml.dump(profile, { lineWidth: 120, noRefs: true, sortKeys: false }), "utf-8");
|
|
453
|
+
}
|
|
454
|
+
function loadProfile(rootDir, id) {
|
|
455
|
+
const projectPath = path.join(rootDir, PROJECT_AGENTS_DIR, `${id}${AGENT_EXT}`);
|
|
456
|
+
if (fs.existsSync(projectPath)) {
|
|
457
|
+
try {
|
|
458
|
+
return yaml.load(fs.readFileSync(projectPath, "utf-8"));
|
|
459
|
+
} catch {
|
|
460
|
+
}
|
|
461
|
+
}
|
|
462
|
+
const globalPath = path.join(GLOBAL_AGENTS_DIR, `${id}${AGENT_EXT}`);
|
|
463
|
+
if (fs.existsSync(globalPath)) {
|
|
464
|
+
try {
|
|
465
|
+
return yaml.load(fs.readFileSync(globalPath, "utf-8"));
|
|
466
|
+
} catch {
|
|
467
|
+
}
|
|
468
|
+
}
|
|
469
|
+
return null;
|
|
470
|
+
}
|
|
471
|
+
function summarize(p) {
|
|
472
|
+
return {
|
|
473
|
+
id: p.id,
|
|
474
|
+
role: p.role,
|
|
475
|
+
personality: p.personality,
|
|
476
|
+
expertiseCount: (p.expertise || []).length,
|
|
477
|
+
topExpertise: (p.expertise || []).sort((a, b) => b.confidence - a.confidence).slice(0, 3).map((e) => ({
|
|
478
|
+
symbol: e.symbol,
|
|
479
|
+
confidence: parseFloat(e.confidence.toFixed(2))
|
|
480
|
+
})),
|
|
481
|
+
projectContexts: Object.keys(p.contexts || {}),
|
|
482
|
+
transferableCount: (p.transferable || []).length
|
|
483
|
+
};
|
|
484
|
+
}
|
|
485
|
+
function scanLoreDir(lorePath) {
|
|
486
|
+
const entries = [];
|
|
487
|
+
try {
|
|
488
|
+
const items = fs.readdirSync(lorePath, { withFileTypes: true });
|
|
489
|
+
for (const item of items) {
|
|
490
|
+
if (!item.isDirectory()) continue;
|
|
491
|
+
const dayDir = path.join(lorePath, item.name);
|
|
492
|
+
try {
|
|
493
|
+
const files = fs.readdirSync(dayDir).filter((f) => f.endsWith(".yaml") || f.endsWith(".yml"));
|
|
494
|
+
for (const file of files) {
|
|
495
|
+
try {
|
|
496
|
+
const content = fs.readFileSync(path.join(dayDir, file), "utf-8");
|
|
497
|
+
const data = yaml.load(content);
|
|
498
|
+
if (data?.symbols_touched && Array.isArray(data.symbols_touched)) {
|
|
499
|
+
entries.push({
|
|
500
|
+
symbols_touched: data.symbols_touched,
|
|
501
|
+
confidence: typeof data.confidence === "number" ? data.confidence : void 0,
|
|
502
|
+
timestamp: data.timestamp || item.name
|
|
503
|
+
});
|
|
504
|
+
}
|
|
505
|
+
} catch {
|
|
506
|
+
}
|
|
507
|
+
}
|
|
508
|
+
} catch {
|
|
509
|
+
}
|
|
510
|
+
}
|
|
511
|
+
} catch {
|
|
512
|
+
}
|
|
513
|
+
return entries;
|
|
514
|
+
}
|
|
515
|
+
export {
|
|
516
|
+
agentActivateCommand,
|
|
517
|
+
agentBenchCommand,
|
|
518
|
+
agentCreateCommand,
|
|
519
|
+
agentListCommand,
|
|
520
|
+
agentRosterCommand,
|
|
521
|
+
agentShowCommand,
|
|
522
|
+
agentSyncCommand
|
|
523
|
+
};
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import {
|
|
3
|
+
buildProfileEnrichment,
|
|
4
|
+
checkPathPermission,
|
|
5
|
+
checkToolPermission,
|
|
6
|
+
computeIntegrityHash,
|
|
7
|
+
createAgentProfile,
|
|
8
|
+
init_agent_loader,
|
|
9
|
+
loadAgentProfile,
|
|
10
|
+
loadAllAgentProfiles,
|
|
11
|
+
mergeAgentProfileWithManifest,
|
|
12
|
+
queryExpertise,
|
|
13
|
+
saveAgentProfile,
|
|
14
|
+
syncExpertiseFromLore,
|
|
15
|
+
updateExpertiseFromAssessment,
|
|
16
|
+
updateExpertiseFromLore,
|
|
17
|
+
verifyIntegrity
|
|
18
|
+
} from "./chunk-A2L4TSLZ.js";
|
|
19
|
+
import "./chunk-7N7GSU6K.js";
|
|
20
|
+
init_agent_loader();
|
|
21
|
+
export {
|
|
22
|
+
buildProfileEnrichment,
|
|
23
|
+
checkPathPermission,
|
|
24
|
+
checkToolPermission,
|
|
25
|
+
computeIntegrityHash,
|
|
26
|
+
createAgentProfile,
|
|
27
|
+
loadAgentProfile,
|
|
28
|
+
loadAllAgentProfiles,
|
|
29
|
+
mergeAgentProfileWithManifest,
|
|
30
|
+
queryExpertise,
|
|
31
|
+
saveAgentProfile,
|
|
32
|
+
syncExpertiseFromLore,
|
|
33
|
+
updateExpertiseFromAssessment,
|
|
34
|
+
updateExpertiseFromLore,
|
|
35
|
+
verifyIntegrity
|
|
36
|
+
};
|