@a-company/paradigm 5.6.0 → 5.6.1
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/mcp.js +59 -19
- package/package.json +1 -1
package/dist/mcp.js
CHANGED
|
@@ -6074,8 +6074,15 @@ async function handleOrchestrateInline(args, ctx) {
|
|
|
6074
6074
|
for (const stage of plan.stages) {
|
|
6075
6075
|
const agentPrompts = [];
|
|
6076
6076
|
for (const agentStep of stage.agents) {
|
|
6077
|
-
const agentDef = manifest.agents[agentStep.name]
|
|
6078
|
-
|
|
6077
|
+
const agentDef = manifest.agents[agentStep.name] || {
|
|
6078
|
+
name: agentStep.name,
|
|
6079
|
+
role: ROLE_PROMPTS[agentStep.name] || `${agentStep.name} agent`,
|
|
6080
|
+
focus: { reads: ["**/*"], writes: ["**/*"] },
|
|
6081
|
+
defaultModel: DEFAULT_MODELS[agentStep.name] || "sonnet"
|
|
6082
|
+
};
|
|
6083
|
+
if (!agentDef.focus) {
|
|
6084
|
+
agentDef.focus = { reads: ["**/*"], writes: ["**/*"] };
|
|
6085
|
+
}
|
|
6079
6086
|
const profileData = agentProfiles.get(agentStep.name);
|
|
6080
6087
|
const promptResult = buildAgentPromptInternal({
|
|
6081
6088
|
agent: agentDef,
|
|
@@ -6441,11 +6448,13 @@ function buildAgentPromptInternal(options) {
|
|
|
6441
6448
|
parts.push(handoffContext);
|
|
6442
6449
|
parts.push("");
|
|
6443
6450
|
}
|
|
6444
|
-
|
|
6445
|
-
|
|
6446
|
-
|
|
6447
|
-
|
|
6448
|
-
|
|
6451
|
+
if (agent.focus?.reads || agent.focus?.writes) {
|
|
6452
|
+
parts.push("## Focus Areas");
|
|
6453
|
+
parts.push("");
|
|
6454
|
+
parts.push(`**Read from:** ${agent.focus?.reads?.join(", ") || "**/*"}`);
|
|
6455
|
+
parts.push(`**Write to:** ${agent.focus?.writes?.join(", ") || "**/*"}`);
|
|
6456
|
+
parts.push("");
|
|
6457
|
+
}
|
|
6449
6458
|
parts.push(`## Output Format
|
|
6450
6459
|
|
|
6451
6460
|
When you complete your task, end with a structured summary block:
|
|
@@ -6475,7 +6484,7 @@ This structured output helps track progress and pass context between agents.`);
|
|
|
6475
6484
|
taskDescription: `${agent.name}: ${task.slice(0, 50)}${task.length > 50 ? "..." : ""}`,
|
|
6476
6485
|
subagentType: "general-purpose",
|
|
6477
6486
|
attribution,
|
|
6478
|
-
focusAreas: agent.focus
|
|
6487
|
+
focusAreas: agent.focus || { reads: ["**/*"], writes: ["**/*"] }
|
|
6479
6488
|
};
|
|
6480
6489
|
}
|
|
6481
6490
|
function extractSymbols(text) {
|
|
@@ -6569,7 +6578,24 @@ var SECURITY_KEYWORDS = [
|
|
|
6569
6578
|
"secret",
|
|
6570
6579
|
"key",
|
|
6571
6580
|
"encrypt",
|
|
6572
|
-
"decrypt"
|
|
6581
|
+
"decrypt",
|
|
6582
|
+
"ownership",
|
|
6583
|
+
"transfer",
|
|
6584
|
+
"privilege",
|
|
6585
|
+
"escalation",
|
|
6586
|
+
"impersonation",
|
|
6587
|
+
"takeover",
|
|
6588
|
+
"rbac",
|
|
6589
|
+
"acl",
|
|
6590
|
+
"role",
|
|
6591
|
+
"guard",
|
|
6592
|
+
"middleware",
|
|
6593
|
+
"session",
|
|
6594
|
+
"cookie",
|
|
6595
|
+
"csrf",
|
|
6596
|
+
"xss",
|
|
6597
|
+
"injection",
|
|
6598
|
+
"sanitize"
|
|
6573
6599
|
];
|
|
6574
6600
|
function classifyTaskLocal(task) {
|
|
6575
6601
|
const taskLower = task.toLowerCase();
|
|
@@ -20152,10 +20178,27 @@ function calculateRouteSimilarity(route1, route2) {
|
|
|
20152
20178
|
const r1 = normalize(route1);
|
|
20153
20179
|
const r2 = normalize(route2);
|
|
20154
20180
|
if (r1 === r2) return 1;
|
|
20155
|
-
const
|
|
20156
|
-
const
|
|
20181
|
+
const isDotNotation = (r) => !r.includes("/") && r.includes(".");
|
|
20182
|
+
const splitRoute = (r) => {
|
|
20183
|
+
if (isDotNotation(r)) return r.split(".");
|
|
20184
|
+
return r.split("/").filter(Boolean);
|
|
20185
|
+
};
|
|
20186
|
+
const seg1 = splitRoute(r1);
|
|
20187
|
+
const seg2 = splitRoute(r2);
|
|
20188
|
+
if (isDotNotation(r1) || isDotNotation(r2)) {
|
|
20189
|
+
const s1 = isDotNotation(r1) ? r1.split(".") : r1.split("/").filter(Boolean);
|
|
20190
|
+
const s2 = isDotNotation(r2) ? r2.split(".") : r2.split("/").filter(Boolean);
|
|
20191
|
+
let shared = 0;
|
|
20192
|
+
for (let i = 0; i < Math.min(s1.length, s2.length); i++) {
|
|
20193
|
+
if (s1[i] === s2[i]) shared++;
|
|
20194
|
+
else break;
|
|
20195
|
+
}
|
|
20196
|
+
if (shared > 0) {
|
|
20197
|
+
return Math.min(1, 0.5 + shared / Math.max(s1.length, s2.length) * 0.5);
|
|
20198
|
+
}
|
|
20199
|
+
return 0;
|
|
20200
|
+
}
|
|
20157
20201
|
let matches = 0;
|
|
20158
|
-
let paramMatches = 0;
|
|
20159
20202
|
const maxLen = Math.max(seg1.length, seg2.length);
|
|
20160
20203
|
for (let i = 0; i < maxLen; i++) {
|
|
20161
20204
|
const s1 = seg1[i] || "";
|
|
@@ -20164,14 +20207,9 @@ function calculateRouteSimilarity(route1, route2) {
|
|
|
20164
20207
|
matches++;
|
|
20165
20208
|
} else if (s1.startsWith(":") && s2.startsWith(":")) {
|
|
20166
20209
|
matches += 0.9;
|
|
20167
|
-
paramMatches++;
|
|
20168
20210
|
} else if (s1.startsWith(":") || s2.startsWith(":")) {
|
|
20169
20211
|
matches += 0.7;
|
|
20170
|
-
|
|
20171
|
-
} else if (
|
|
20172
|
-
// Check for resource plural/singular match (e.g., notes vs note)
|
|
20173
|
-
s1.replace(/s$/, "") === s2.replace(/s$/, "") || s2.replace(/s$/, "") === s1.replace(/s$/, "")
|
|
20174
|
-
) {
|
|
20212
|
+
} else if (s1.replace(/s$/, "") === s2.replace(/s$/, "") || s2.replace(/s$/, "") === s1.replace(/s$/, "")) {
|
|
20175
20213
|
matches += 0.8;
|
|
20176
20214
|
}
|
|
20177
20215
|
}
|
|
@@ -20904,7 +20942,9 @@ function registerTools(server, getContext2, reloadContext2) {
|
|
|
20904
20942
|
};
|
|
20905
20943
|
}
|
|
20906
20944
|
case "paradigm_gates_for_route": {
|
|
20907
|
-
const { route,
|
|
20945
|
+
const { route, response_format: gatesResponseFormat } = args;
|
|
20946
|
+
const isTrpc = typeof route === "string" && !route.includes("/") && route.includes(".");
|
|
20947
|
+
const method = isTrpc ? "POST" : args.method || "GET";
|
|
20908
20948
|
const gates = getSymbolsByType(ctx.index, "gate");
|
|
20909
20949
|
const suggestions = [];
|
|
20910
20950
|
const learnedPatterns = [];
|