@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
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, {
|
|
7
|
+
get: (a, b) => (typeof require !== "undefined" ? require : a)[b]
|
|
8
|
+
}) : x)(function(x) {
|
|
9
|
+
if (typeof require !== "undefined") return require.apply(this, arguments);
|
|
10
|
+
throw Error('Dynamic require of "' + x + '" is not supported');
|
|
11
|
+
});
|
|
12
|
+
var __esm = (fn, res) => function __init() {
|
|
13
|
+
return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res;
|
|
14
|
+
};
|
|
15
|
+
var __export = (target, all) => {
|
|
16
|
+
for (var name in all)
|
|
17
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
18
|
+
};
|
|
19
|
+
var __copyProps = (to, from, except, desc) => {
|
|
20
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
21
|
+
for (let key of __getOwnPropNames(from))
|
|
22
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
23
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
24
|
+
}
|
|
25
|
+
return to;
|
|
26
|
+
};
|
|
27
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
28
|
+
|
|
29
|
+
export {
|
|
30
|
+
__require,
|
|
31
|
+
__esm,
|
|
32
|
+
__export,
|
|
33
|
+
__toCommonJS
|
|
34
|
+
};
|
|
@@ -0,0 +1,526 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import {
|
|
3
|
+
__esm
|
|
4
|
+
} from "./chunk-7N7GSU6K.js";
|
|
5
|
+
|
|
6
|
+
// ../paradigm-mcp/src/types/agents.ts
|
|
7
|
+
var DEFAULT_PERSONALITIES, DEFAULT_ATTENTION, DEFAULT_COLLABORATION;
|
|
8
|
+
var init_agents = __esm({
|
|
9
|
+
"../paradigm-mcp/src/types/agents.ts"() {
|
|
10
|
+
"use strict";
|
|
11
|
+
DEFAULT_PERSONALITIES = {
|
|
12
|
+
architect: { style: "deliberate", risk: "conservative", verbosity: "detailed" },
|
|
13
|
+
builder: { style: "rapid", risk: "balanced", verbosity: "concise" },
|
|
14
|
+
tester: { style: "methodical", risk: "conservative", verbosity: "concise" },
|
|
15
|
+
reviewer: { style: "deliberate", risk: "conservative", verbosity: "detailed" },
|
|
16
|
+
security: { style: "methodical", risk: "conservative", verbosity: "detailed" }
|
|
17
|
+
};
|
|
18
|
+
DEFAULT_ATTENTION = {
|
|
19
|
+
architect: { symbols: ["$*", "#*"], concepts: ["architecture", "design", "pattern", "refactor"], signals: [{ type: "flow-modified" }, { type: "compliance-violation" }], threshold: 0.5 },
|
|
20
|
+
builder: { paths: ["src/**", "lib/**", "packages/**"], signals: [{ type: "file-modified" }, { type: "error-encountered" }], threshold: 0.7 },
|
|
21
|
+
reviewer: { concepts: ["code quality", "bug", "smell", "convention"], signals: [{ type: "compliance-violation" }], threshold: 0.6 },
|
|
22
|
+
tester: { paths: ["**/*.test.*", "**/*.spec.*"], concepts: ["test", "coverage", "assertion"], signals: [{ type: "error-encountered" }, { type: "test-result" }], threshold: 0.5 },
|
|
23
|
+
security: { symbols: ["^*", "#*-auth", "#*-middleware"], paths: ["auth/**", "middleware/**", "guards/**"], concepts: ["permission", "JWT", "session", "RBAC", "XSS", "injection"], signals: [{ type: "gate-added" }, { type: "route-created" }, { type: "gate-checked" }, { type: "compliance-violation" }], threshold: 0.4 }
|
|
24
|
+
};
|
|
25
|
+
DEFAULT_COLLABORATION = {
|
|
26
|
+
architect: { stance: "lead", debate: { will_challenge: true, evidence_required: true, escalate_to_human: true } },
|
|
27
|
+
builder: { stance: "supportive", with: { architect: { stance: "supportive", can_contradict: false } } },
|
|
28
|
+
reviewer: { stance: "advisory", debate: { will_challenge: true, evidence_required: true, escalate_to_human: true } },
|
|
29
|
+
tester: { stance: "supportive", debate: { will_challenge: false, evidence_required: true, escalate_to_human: false } },
|
|
30
|
+
security: { stance: "advisory", with: { architect: { stance: "peer", can_contradict: true }, builder: { stance: "advisory", review_output: true } }, debate: { will_challenge: true, evidence_required: true, escalate_to_human: true } }
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
});
|
|
34
|
+
|
|
35
|
+
// ../paradigm-mcp/src/utils/agent-loader.ts
|
|
36
|
+
import * as fs from "fs";
|
|
37
|
+
import * as path from "path";
|
|
38
|
+
import * as os from "os";
|
|
39
|
+
import * as crypto from "crypto";
|
|
40
|
+
import * as yaml from "js-yaml";
|
|
41
|
+
function loadAgentProfile(rootDir, agentId) {
|
|
42
|
+
const projectPath = path.join(rootDir, PROJECT_AGENTS_DIR, `${agentId}${AGENT_EXT}`);
|
|
43
|
+
if (fs.existsSync(projectPath)) {
|
|
44
|
+
try {
|
|
45
|
+
const content = fs.readFileSync(projectPath, "utf-8");
|
|
46
|
+
return yaml.load(content);
|
|
47
|
+
} catch {
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
const globalPath = path.join(GLOBAL_AGENTS_DIR, `${agentId}${AGENT_EXT}`);
|
|
51
|
+
if (fs.existsSync(globalPath)) {
|
|
52
|
+
try {
|
|
53
|
+
const content = fs.readFileSync(globalPath, "utf-8");
|
|
54
|
+
const globalProfile = yaml.load(content);
|
|
55
|
+
if (fs.existsSync(projectPath)) {
|
|
56
|
+
try {
|
|
57
|
+
const projectContent = fs.readFileSync(projectPath, "utf-8");
|
|
58
|
+
const projectProfile = yaml.load(projectContent);
|
|
59
|
+
return deepMergeProfiles(globalProfile, projectProfile);
|
|
60
|
+
} catch {
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
return globalProfile;
|
|
64
|
+
} catch {
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
return null;
|
|
68
|
+
}
|
|
69
|
+
function loadAllAgentProfiles(rootDir) {
|
|
70
|
+
const profiles = /* @__PURE__ */ new Map();
|
|
71
|
+
if (fs.existsSync(GLOBAL_AGENTS_DIR)) {
|
|
72
|
+
try {
|
|
73
|
+
const files = fs.readdirSync(GLOBAL_AGENTS_DIR).filter((f) => f.endsWith(AGENT_EXT));
|
|
74
|
+
for (const file of files) {
|
|
75
|
+
try {
|
|
76
|
+
const content = fs.readFileSync(path.join(GLOBAL_AGENTS_DIR, file), "utf-8");
|
|
77
|
+
const profile = yaml.load(content);
|
|
78
|
+
if (profile?.id) {
|
|
79
|
+
profiles.set(profile.id, profile);
|
|
80
|
+
}
|
|
81
|
+
} catch {
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
} catch {
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
const projectDir = path.join(rootDir, PROJECT_AGENTS_DIR);
|
|
88
|
+
if (fs.existsSync(projectDir)) {
|
|
89
|
+
try {
|
|
90
|
+
const files = fs.readdirSync(projectDir).filter((f) => f.endsWith(AGENT_EXT));
|
|
91
|
+
for (const file of files) {
|
|
92
|
+
try {
|
|
93
|
+
const content = fs.readFileSync(path.join(projectDir, file), "utf-8");
|
|
94
|
+
const projectProfile = yaml.load(content);
|
|
95
|
+
if (!projectProfile?.id) continue;
|
|
96
|
+
const existing = profiles.get(projectProfile.id);
|
|
97
|
+
if (existing) {
|
|
98
|
+
profiles.set(projectProfile.id, deepMergeProfiles(existing, projectProfile));
|
|
99
|
+
} else {
|
|
100
|
+
profiles.set(projectProfile.id, projectProfile);
|
|
101
|
+
}
|
|
102
|
+
} catch {
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
} catch {
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
return Array.from(profiles.values());
|
|
109
|
+
}
|
|
110
|
+
function saveAgentProfile(agentId, profile, scope, rootDir) {
|
|
111
|
+
const dir = scope === "global" ? GLOBAL_AGENTS_DIR : path.join(rootDir || process.cwd(), PROJECT_AGENTS_DIR);
|
|
112
|
+
if (!fs.existsSync(dir)) {
|
|
113
|
+
fs.mkdirSync(dir, { recursive: true });
|
|
114
|
+
}
|
|
115
|
+
const filePath = path.join(dir, `${agentId}${AGENT_EXT}`);
|
|
116
|
+
if (profile.permissions) {
|
|
117
|
+
profile.integrityHash = computeIntegrityHash(profile);
|
|
118
|
+
}
|
|
119
|
+
profile.updated = (/* @__PURE__ */ new Date()).toISOString();
|
|
120
|
+
const content = yaml.dump(profile, {
|
|
121
|
+
lineWidth: 120,
|
|
122
|
+
noRefs: true,
|
|
123
|
+
sortKeys: false
|
|
124
|
+
});
|
|
125
|
+
fs.writeFileSync(filePath, content, "utf-8");
|
|
126
|
+
return filePath;
|
|
127
|
+
}
|
|
128
|
+
function createAgentProfile(agentId, opts = {}) {
|
|
129
|
+
const now = (/* @__PURE__ */ new Date()).toISOString();
|
|
130
|
+
const profile = {
|
|
131
|
+
id: agentId,
|
|
132
|
+
role: opts.role || `${agentId.charAt(0).toUpperCase() + agentId.slice(1)} agent`,
|
|
133
|
+
description: opts.description || `Persistent identity for the ${agentId} agent role`,
|
|
134
|
+
version: "1.0.0",
|
|
135
|
+
personality: DEFAULT_PERSONALITIES[agentId] || {
|
|
136
|
+
style: "balanced",
|
|
137
|
+
risk: "balanced",
|
|
138
|
+
verbosity: "concise"
|
|
139
|
+
},
|
|
140
|
+
expertise: [],
|
|
141
|
+
transferable: [],
|
|
142
|
+
contexts: {},
|
|
143
|
+
created: now,
|
|
144
|
+
updated: now
|
|
145
|
+
};
|
|
146
|
+
if (!DEFAULT_PERSONALITIES[agentId]) {
|
|
147
|
+
profile.personality = { style: "deliberate", risk: "balanced", verbosity: "concise" };
|
|
148
|
+
}
|
|
149
|
+
if (DEFAULT_ATTENTION[agentId]) {
|
|
150
|
+
profile.attention = { ...DEFAULT_ATTENTION[agentId] };
|
|
151
|
+
}
|
|
152
|
+
if (DEFAULT_COLLABORATION[agentId]) {
|
|
153
|
+
profile.collaboration = { ...DEFAULT_COLLABORATION[agentId] };
|
|
154
|
+
}
|
|
155
|
+
const scope = opts.scope || "global";
|
|
156
|
+
const filePath = saveAgentProfile(agentId, profile, scope, opts.rootDir);
|
|
157
|
+
return { profile, filePath };
|
|
158
|
+
}
|
|
159
|
+
function queryExpertise(rootDir, symbol) {
|
|
160
|
+
const profiles = loadAllAgentProfiles(rootDir);
|
|
161
|
+
const results = [];
|
|
162
|
+
for (const profile of profiles) {
|
|
163
|
+
const entry = (profile.expertise || []).find((e) => e.symbol === symbol);
|
|
164
|
+
if (entry) {
|
|
165
|
+
results.push({ agentId: profile.id, entry });
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
return results.sort((a, b) => b.entry.confidence - a.entry.confidence);
|
|
169
|
+
}
|
|
170
|
+
function updateExpertiseFromLore(rootDir, agentId, loreData) {
|
|
171
|
+
const profile = loadAgentProfile(rootDir, agentId);
|
|
172
|
+
if (!profile) return false;
|
|
173
|
+
const now = (/* @__PURE__ */ new Date()).toISOString();
|
|
174
|
+
const expertise = profile.expertise || [];
|
|
175
|
+
for (const symbol of loreData.symbols_touched) {
|
|
176
|
+
const existing = expertise.find((e) => e.symbol === symbol);
|
|
177
|
+
if (existing) {
|
|
178
|
+
existing.sessions++;
|
|
179
|
+
existing.lastTouch = now;
|
|
180
|
+
if (loreData.confidence != null) {
|
|
181
|
+
existing.confidence = (1 - EMA_ALPHA) * existing.confidence + EMA_ALPHA * loreData.confidence;
|
|
182
|
+
}
|
|
183
|
+
} else {
|
|
184
|
+
expertise.push({
|
|
185
|
+
symbol,
|
|
186
|
+
confidence: loreData.confidence ?? 0.5,
|
|
187
|
+
sessions: 1,
|
|
188
|
+
lastTouch: now
|
|
189
|
+
});
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
profile.expertise = expertise;
|
|
193
|
+
const projectName = detectProjectName(rootDir);
|
|
194
|
+
if (projectName) {
|
|
195
|
+
const ctx = profile.contexts[projectName] || { focus: [], sessionsInProject: 0 };
|
|
196
|
+
ctx.lastActive = now;
|
|
197
|
+
ctx.sessionsInProject = (ctx.sessionsInProject || 0) + 1;
|
|
198
|
+
profile.contexts[projectName] = ctx;
|
|
199
|
+
}
|
|
200
|
+
const projectPath = path.join(rootDir, PROJECT_AGENTS_DIR, `${agentId}${AGENT_EXT}`);
|
|
201
|
+
const scope = fs.existsSync(projectPath) ? "project" : "global";
|
|
202
|
+
saveAgentProfile(agentId, profile, scope, rootDir);
|
|
203
|
+
return true;
|
|
204
|
+
}
|
|
205
|
+
function updateExpertiseFromAssessment(rootDir, agentId, data) {
|
|
206
|
+
const profile = loadAgentProfile(rootDir, agentId);
|
|
207
|
+
if (!profile) return false;
|
|
208
|
+
const verdictScore = { correct: 1, partial: 0.5, incorrect: 0 };
|
|
209
|
+
const score = verdictScore[data.verdict];
|
|
210
|
+
for (const symbol of data.symbols_touched) {
|
|
211
|
+
const existing = (profile.expertise || []).find((e) => e.symbol === symbol);
|
|
212
|
+
if (existing) {
|
|
213
|
+
existing.confidence = (1 - EMA_ALPHA) * existing.confidence + EMA_ALPHA * score;
|
|
214
|
+
}
|
|
215
|
+
}
|
|
216
|
+
const projectPath = path.join(rootDir, PROJECT_AGENTS_DIR, `${agentId}${AGENT_EXT}`);
|
|
217
|
+
const scope = fs.existsSync(projectPath) ? "project" : "global";
|
|
218
|
+
saveAgentProfile(agentId, profile, scope, rootDir);
|
|
219
|
+
return true;
|
|
220
|
+
}
|
|
221
|
+
function mergeAgentProfileWithManifest(agentDef, profile, projectName) {
|
|
222
|
+
if (!profile) {
|
|
223
|
+
return {
|
|
224
|
+
personality: null,
|
|
225
|
+
topExpertise: [],
|
|
226
|
+
projectContext: null,
|
|
227
|
+
transferablePatterns: []
|
|
228
|
+
};
|
|
229
|
+
}
|
|
230
|
+
return {
|
|
231
|
+
personality: profile.personality || null,
|
|
232
|
+
topExpertise: (profile.expertise || []).sort((a, b) => b.confidence - a.confidence).slice(0, 10),
|
|
233
|
+
projectContext: profile.contexts?.[projectName] || null,
|
|
234
|
+
transferablePatterns: (profile.transferable || []).filter((p) => p.successRate >= 0.7).map((p) => ({ id: p.id, description: p.description, successRate: p.successRate }))
|
|
235
|
+
};
|
|
236
|
+
}
|
|
237
|
+
function buildProfileEnrichment(profile, relevantSymbols, notebookEntries, ambientContext) {
|
|
238
|
+
const parts = [];
|
|
239
|
+
if (profile.personality) {
|
|
240
|
+
const p = profile.personality;
|
|
241
|
+
parts.push(`## Agent Identity: ${profile.id}`);
|
|
242
|
+
parts.push(`**Style:** ${p.style} | **Risk:** ${p.risk} | **Verbosity:** ${p.verbosity}`);
|
|
243
|
+
parts.push("");
|
|
244
|
+
}
|
|
245
|
+
const relevant = (profile.expertise || []).filter((e) => relevantSymbols.length === 0 || relevantSymbols.includes(e.symbol)).sort((a, b) => b.confidence - a.confidence).slice(0, 8);
|
|
246
|
+
if (relevant.length > 0) {
|
|
247
|
+
parts.push("## Your Expertise on Relevant Symbols");
|
|
248
|
+
for (const e of relevant) {
|
|
249
|
+
parts.push(`- \`${e.symbol}\`: confidence ${e.confidence.toFixed(2)} (${e.sessions} sessions)`);
|
|
250
|
+
}
|
|
251
|
+
parts.push("");
|
|
252
|
+
}
|
|
253
|
+
const patterns = (profile.transferable || []).filter((p) => p.successRate >= 0.7);
|
|
254
|
+
if (patterns.length > 0) {
|
|
255
|
+
parts.push("## Transferable Patterns");
|
|
256
|
+
for (const p of patterns) {
|
|
257
|
+
const appliedCount = p.appliedIn?.length || 0;
|
|
258
|
+
parts.push(`- ${p.id}: ${(p.successRate * 100).toFixed(0)}% success (learned in ${p.learnedIn}${appliedCount > 0 ? `, applied in ${appliedCount} projects` : ""})`);
|
|
259
|
+
}
|
|
260
|
+
parts.push("");
|
|
261
|
+
}
|
|
262
|
+
if (notebookEntries && notebookEntries.length > 0) {
|
|
263
|
+
parts.push("## Relevant Notebook Entries");
|
|
264
|
+
for (const nb of notebookEntries.slice(0, 5)) {
|
|
265
|
+
parts.push(`### ${nb.context}`);
|
|
266
|
+
parts.push(`Concepts: ${nb.concepts.join(", ")}`);
|
|
267
|
+
parts.push("```");
|
|
268
|
+
const snippet = nb.snippet.length > 300 ? nb.snippet.slice(0, 300) + "..." : nb.snippet;
|
|
269
|
+
parts.push(snippet);
|
|
270
|
+
parts.push("```");
|
|
271
|
+
parts.push("");
|
|
272
|
+
}
|
|
273
|
+
}
|
|
274
|
+
if (profile.attention) {
|
|
275
|
+
const att = profile.attention;
|
|
276
|
+
const attParts = [];
|
|
277
|
+
if (att.symbols?.length) attParts.push(`Symbols: ${att.symbols.join(", ")}`);
|
|
278
|
+
if (att.paths?.length) attParts.push(`Paths: ${att.paths.join(", ")}`);
|
|
279
|
+
if (att.concepts?.length) attParts.push(`Concepts: ${att.concepts.join(", ")}`);
|
|
280
|
+
if (att.signals?.length) attParts.push(`Signals: ${att.signals.map((s) => s.type).join(", ")}`);
|
|
281
|
+
if (attParts.length > 0) {
|
|
282
|
+
parts.push("");
|
|
283
|
+
parts.push("### Attention");
|
|
284
|
+
parts.push(`Threshold: ${att.threshold ?? 0.6}`);
|
|
285
|
+
parts.push(attParts.join(" | "));
|
|
286
|
+
}
|
|
287
|
+
}
|
|
288
|
+
if (profile.collaboration) {
|
|
289
|
+
const collab = profile.collaboration;
|
|
290
|
+
parts.push("");
|
|
291
|
+
parts.push("### Collaboration");
|
|
292
|
+
parts.push(`Default stance: ${collab.stance || "supportive"}`);
|
|
293
|
+
if (collab.with) {
|
|
294
|
+
for (const [agent, rel] of Object.entries(collab.with)) {
|
|
295
|
+
const relParts = [`${agent}: ${rel.stance || "peer"}`];
|
|
296
|
+
if (rel.can_contradict) relParts.push("can contradict");
|
|
297
|
+
if (rel.review_output) relParts.push("reviews output");
|
|
298
|
+
parts.push(`- ${relParts.join(", ")}`);
|
|
299
|
+
}
|
|
300
|
+
}
|
|
301
|
+
if (collab.debate) {
|
|
302
|
+
const d = collab.debate;
|
|
303
|
+
const traits = [];
|
|
304
|
+
if (d.will_challenge) traits.push("challenges");
|
|
305
|
+
if (d.evidence_required) traits.push("evidence-based");
|
|
306
|
+
if (d.escalate_to_human) traits.push("escalates to human");
|
|
307
|
+
if (traits.length) parts.push(`Debate: ${traits.join(", ")}`);
|
|
308
|
+
}
|
|
309
|
+
}
|
|
310
|
+
if (profile.nomination) {
|
|
311
|
+
const nom = profile.nomination;
|
|
312
|
+
parts.push("");
|
|
313
|
+
parts.push("### Nomination");
|
|
314
|
+
if (nom.speak_when?.urgency?.length) {
|
|
315
|
+
parts.push(`Always speaks on: ${nom.speak_when.urgency.join(", ")}`);
|
|
316
|
+
}
|
|
317
|
+
if (nom.contribution_style) {
|
|
318
|
+
const style = [];
|
|
319
|
+
if (nom.contribution_style.brief_first) style.push("brief first");
|
|
320
|
+
if (nom.contribution_style.cite_sources) style.push("cites sources");
|
|
321
|
+
if (nom.contribution_style.offer_action) style.push("offers action");
|
|
322
|
+
if (style.length) parts.push(`Style: ${style.join(", ")}`);
|
|
323
|
+
}
|
|
324
|
+
}
|
|
325
|
+
if (ambientContext) {
|
|
326
|
+
if (ambientContext.recentDecisions?.length) {
|
|
327
|
+
parts.push("");
|
|
328
|
+
parts.push("## Recent Team Decisions");
|
|
329
|
+
for (const d of ambientContext.recentDecisions.slice(0, 5)) {
|
|
330
|
+
parts.push(`- **${d.title}**: ${d.decision.slice(0, 150)}${d.decision.length > 150 ? "..." : ""}`);
|
|
331
|
+
}
|
|
332
|
+
}
|
|
333
|
+
if (ambientContext.journalInsights?.length) {
|
|
334
|
+
parts.push("");
|
|
335
|
+
parts.push("## Transferable Insights");
|
|
336
|
+
for (const j of ambientContext.journalInsights.slice(0, 5)) {
|
|
337
|
+
parts.push(`- [${j.trigger}] ${j.insight.slice(0, 150)}${j.insight.length > 150 ? "..." : ""}`);
|
|
338
|
+
}
|
|
339
|
+
}
|
|
340
|
+
if (ambientContext.pendingNominations?.length) {
|
|
341
|
+
parts.push("");
|
|
342
|
+
parts.push("## Pending Nominations");
|
|
343
|
+
for (const n of ambientContext.pendingNominations.slice(0, 10)) {
|
|
344
|
+
parts.push(`- [${n.urgency}] ${n.brief}`);
|
|
345
|
+
}
|
|
346
|
+
}
|
|
347
|
+
}
|
|
348
|
+
return parts.join("\n");
|
|
349
|
+
}
|
|
350
|
+
async function syncExpertiseFromLore(rootDir, agentId, dryRun = false) {
|
|
351
|
+
const { loadLoreEntries } = await import("./lore-loader-7NO6N6FT.js");
|
|
352
|
+
const entries = await loadLoreEntries(rootDir, { limit: 500 });
|
|
353
|
+
let entriesProcessed = 0;
|
|
354
|
+
let symbolsUpdated = /* @__PURE__ */ new Set();
|
|
355
|
+
const profile = loadAgentProfile(rootDir, agentId) || createAgentProfile(agentId, { rootDir }).profile;
|
|
356
|
+
const expertise = profile.expertise || [];
|
|
357
|
+
for (const entry of entries) {
|
|
358
|
+
if (!entry.symbols_touched || entry.symbols_touched.length === 0) continue;
|
|
359
|
+
entriesProcessed++;
|
|
360
|
+
for (const symbol of entry.symbols_touched) {
|
|
361
|
+
symbolsUpdated.add(symbol);
|
|
362
|
+
const existing = expertise.find((e) => e.symbol === symbol);
|
|
363
|
+
if (existing) {
|
|
364
|
+
existing.sessions++;
|
|
365
|
+
existing.lastTouch = entry.timestamp;
|
|
366
|
+
if (entry.confidence != null) {
|
|
367
|
+
existing.confidence = (1 - EMA_ALPHA) * existing.confidence + EMA_ALPHA * entry.confidence;
|
|
368
|
+
}
|
|
369
|
+
} else {
|
|
370
|
+
expertise.push({
|
|
371
|
+
symbol,
|
|
372
|
+
confidence: entry.confidence ?? 0.5,
|
|
373
|
+
sessions: 1,
|
|
374
|
+
lastTouch: entry.timestamp
|
|
375
|
+
});
|
|
376
|
+
}
|
|
377
|
+
}
|
|
378
|
+
}
|
|
379
|
+
profile.expertise = expertise;
|
|
380
|
+
if (!dryRun) {
|
|
381
|
+
const projectPath = path.join(rootDir, PROJECT_AGENTS_DIR, `${agentId}${AGENT_EXT}`);
|
|
382
|
+
const scope = fs.existsSync(projectPath) ? "project" : "global";
|
|
383
|
+
saveAgentProfile(agentId, profile, scope, rootDir);
|
|
384
|
+
}
|
|
385
|
+
return { entriesProcessed, symbolsUpdated: symbolsUpdated.size };
|
|
386
|
+
}
|
|
387
|
+
function checkPathPermission(profile, filePath, mode) {
|
|
388
|
+
if (!profile.permissions?.paths) {
|
|
389
|
+
return { allowed: true };
|
|
390
|
+
}
|
|
391
|
+
const { read, write, deny } = profile.permissions.paths;
|
|
392
|
+
if (deny && deny.length > 0) {
|
|
393
|
+
for (const pattern of deny) {
|
|
394
|
+
if (matchGlob(pattern, filePath)) {
|
|
395
|
+
return { allowed: false, reason: `Path denied by pattern: ${pattern}` };
|
|
396
|
+
}
|
|
397
|
+
}
|
|
398
|
+
}
|
|
399
|
+
const allowPatterns = mode === "read" ? read : write;
|
|
400
|
+
if (allowPatterns && allowPatterns.length > 0) {
|
|
401
|
+
for (const pattern of allowPatterns) {
|
|
402
|
+
if (matchGlob(pattern, filePath)) {
|
|
403
|
+
return { allowed: true };
|
|
404
|
+
}
|
|
405
|
+
}
|
|
406
|
+
return { allowed: false, reason: `No ${mode} pattern matches: ${filePath}` };
|
|
407
|
+
}
|
|
408
|
+
return { allowed: true };
|
|
409
|
+
}
|
|
410
|
+
function checkToolPermission(profile, toolName) {
|
|
411
|
+
if (!profile.permissions?.tools) {
|
|
412
|
+
return { allowed: true };
|
|
413
|
+
}
|
|
414
|
+
const { allow, deny } = profile.permissions.tools;
|
|
415
|
+
if (deny && deny.length > 0) {
|
|
416
|
+
for (const pattern of deny) {
|
|
417
|
+
if (matchGlob(pattern, toolName)) {
|
|
418
|
+
return { allowed: false, reason: `Tool denied by pattern: ${pattern}` };
|
|
419
|
+
}
|
|
420
|
+
}
|
|
421
|
+
}
|
|
422
|
+
if (allow && allow.length > 0) {
|
|
423
|
+
for (const pattern of allow) {
|
|
424
|
+
if (matchGlob(pattern, toolName)) {
|
|
425
|
+
return { allowed: true };
|
|
426
|
+
}
|
|
427
|
+
}
|
|
428
|
+
return { allowed: false, reason: `Tool not in allow list: ${toolName}` };
|
|
429
|
+
}
|
|
430
|
+
return { allowed: true };
|
|
431
|
+
}
|
|
432
|
+
function computeIntegrityHash(profile) {
|
|
433
|
+
const payload = JSON.stringify({
|
|
434
|
+
id: profile.id,
|
|
435
|
+
role: profile.role,
|
|
436
|
+
permissions: profile.permissions || null
|
|
437
|
+
});
|
|
438
|
+
return crypto.createHash("sha256").update(payload).digest("hex");
|
|
439
|
+
}
|
|
440
|
+
function verifyIntegrity(profile) {
|
|
441
|
+
if (!profile.integrityHash) {
|
|
442
|
+
return { valid: true, reason: "No integrity hash stored (pre-4.0 profile)" };
|
|
443
|
+
}
|
|
444
|
+
const computed = computeIntegrityHash(profile);
|
|
445
|
+
if (computed === profile.integrityHash) {
|
|
446
|
+
return { valid: true };
|
|
447
|
+
}
|
|
448
|
+
return {
|
|
449
|
+
valid: false,
|
|
450
|
+
reason: "Integrity hash mismatch \u2014 profile may have been tampered with"
|
|
451
|
+
};
|
|
452
|
+
}
|
|
453
|
+
function matchGlob(pattern, value) {
|
|
454
|
+
const escaped = pattern.replace(/[.+^${}()|[\]\\]/g, "\\$&").replace(/\*/g, ".*");
|
|
455
|
+
return new RegExp(`^${escaped}$`).test(value);
|
|
456
|
+
}
|
|
457
|
+
function deepMergeProfiles(base, override) {
|
|
458
|
+
const merged = { ...base };
|
|
459
|
+
if (override.role) merged.role = override.role;
|
|
460
|
+
if (override.description) merged.description = override.description;
|
|
461
|
+
if (override.version) merged.version = override.version;
|
|
462
|
+
if (override.personality) {
|
|
463
|
+
merged.personality = { ...base.personality, ...override.personality };
|
|
464
|
+
}
|
|
465
|
+
if (override.expertise) {
|
|
466
|
+
const expertiseMap = new Map(base.expertise.map((e) => [e.symbol, e]));
|
|
467
|
+
for (const entry of override.expertise) {
|
|
468
|
+
expertiseMap.set(entry.symbol, entry);
|
|
469
|
+
}
|
|
470
|
+
merged.expertise = Array.from(expertiseMap.values());
|
|
471
|
+
}
|
|
472
|
+
if (override.transferable) {
|
|
473
|
+
const patternMap = new Map(base.transferable.map((p) => [p.id, p]));
|
|
474
|
+
for (const pattern of override.transferable) {
|
|
475
|
+
patternMap.set(pattern.id, pattern);
|
|
476
|
+
}
|
|
477
|
+
merged.transferable = Array.from(patternMap.values());
|
|
478
|
+
}
|
|
479
|
+
if (override.contexts) {
|
|
480
|
+
merged.contexts = { ...base.contexts };
|
|
481
|
+
for (const [project, ctx] of Object.entries(override.contexts)) {
|
|
482
|
+
merged.contexts[project] = { ...merged.contexts[project], ...ctx };
|
|
483
|
+
}
|
|
484
|
+
}
|
|
485
|
+
return merged;
|
|
486
|
+
}
|
|
487
|
+
function detectProjectName(rootDir) {
|
|
488
|
+
try {
|
|
489
|
+
const configPath = path.join(rootDir, ".paradigm", "config.yaml");
|
|
490
|
+
if (fs.existsSync(configPath)) {
|
|
491
|
+
const content = fs.readFileSync(configPath, "utf-8");
|
|
492
|
+
const config = yaml.load(content);
|
|
493
|
+
if (config?.project && typeof config.project === "string") return config.project;
|
|
494
|
+
}
|
|
495
|
+
} catch {
|
|
496
|
+
}
|
|
497
|
+
return path.basename(rootDir);
|
|
498
|
+
}
|
|
499
|
+
var GLOBAL_AGENTS_DIR, PROJECT_AGENTS_DIR, AGENT_EXT, EMA_ALPHA;
|
|
500
|
+
var init_agent_loader = __esm({
|
|
501
|
+
"../paradigm-mcp/src/utils/agent-loader.ts"() {
|
|
502
|
+
init_agents();
|
|
503
|
+
GLOBAL_AGENTS_DIR = path.join(os.homedir(), ".paradigm", "agents");
|
|
504
|
+
PROJECT_AGENTS_DIR = ".paradigm/agents";
|
|
505
|
+
AGENT_EXT = ".agent";
|
|
506
|
+
EMA_ALPHA = 0.3;
|
|
507
|
+
}
|
|
508
|
+
});
|
|
509
|
+
|
|
510
|
+
export {
|
|
511
|
+
loadAgentProfile,
|
|
512
|
+
loadAllAgentProfiles,
|
|
513
|
+
saveAgentProfile,
|
|
514
|
+
createAgentProfile,
|
|
515
|
+
queryExpertise,
|
|
516
|
+
updateExpertiseFromLore,
|
|
517
|
+
updateExpertiseFromAssessment,
|
|
518
|
+
mergeAgentProfileWithManifest,
|
|
519
|
+
buildProfileEnrichment,
|
|
520
|
+
syncExpertiseFromLore,
|
|
521
|
+
checkPathPermission,
|
|
522
|
+
checkToolPermission,
|
|
523
|
+
computeIntegrityHash,
|
|
524
|
+
verifyIntegrity,
|
|
525
|
+
init_agent_loader
|
|
526
|
+
};
|