@narumitw/pi-subagents 2.0.1 → 2.0.3
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/README.md +20 -7
- package/dist/chunks/auto-transport-SY2VHUFH.ts +109 -0
- package/dist/chunks/auto-transport-SY2VHUFH.ts.map +7 -0
- package/dist/chunks/capability-grant-CGEWOEKE.ts +19 -0
- package/dist/chunks/capability-grant-CGEWOEKE.ts.map +7 -0
- package/dist/chunks/chunk-434NII74.ts +282 -0
- package/dist/chunks/chunk-434NII74.ts.map +7 -0
- package/dist/chunks/chunk-47SK2QYC.ts +56 -0
- package/dist/chunks/chunk-47SK2QYC.ts.map +7 -0
- package/dist/chunks/chunk-6KJ34M6S.ts +159 -0
- package/dist/chunks/chunk-6KJ34M6S.ts.map +7 -0
- package/dist/chunks/chunk-7OBINKFM.ts +80 -0
- package/dist/chunks/chunk-7OBINKFM.ts.map +7 -0
- package/dist/chunks/chunk-7QPPBBXZ.ts +335 -0
- package/dist/chunks/chunk-7QPPBBXZ.ts.map +7 -0
- package/dist/chunks/chunk-AEUYS7JC.ts +73 -0
- package/dist/chunks/chunk-AEUYS7JC.ts.map +7 -0
- package/dist/chunks/chunk-BFK2Z4ZF.ts +189 -0
- package/dist/chunks/chunk-BFK2Z4ZF.ts.map +7 -0
- package/dist/chunks/chunk-BOAXY55Y.ts +153 -0
- package/dist/chunks/chunk-BOAXY55Y.ts.map +7 -0
- package/dist/chunks/chunk-C4L6P266.ts +22 -0
- package/dist/chunks/chunk-C4L6P266.ts.map +7 -0
- package/dist/chunks/chunk-DPPVEQAM.ts +29 -0
- package/dist/chunks/chunk-DPPVEQAM.ts.map +7 -0
- package/dist/chunks/chunk-DQMN4OYM.ts +913 -0
- package/dist/chunks/chunk-DQMN4OYM.ts.map +7 -0
- package/dist/chunks/chunk-DSOOH73Y.ts +238 -0
- package/dist/chunks/chunk-DSOOH73Y.ts.map +7 -0
- package/dist/chunks/chunk-EFBPISNT.ts +421 -0
- package/dist/chunks/chunk-EFBPISNT.ts.map +7 -0
- package/dist/chunks/chunk-EWWXFU7N.ts +150 -0
- package/dist/chunks/chunk-EWWXFU7N.ts.map +7 -0
- package/dist/chunks/chunk-F4L2UVSK.ts +380 -0
- package/dist/chunks/chunk-F4L2UVSK.ts.map +7 -0
- package/dist/chunks/chunk-F5YWVHQX.ts +1543 -0
- package/dist/chunks/chunk-F5YWVHQX.ts.map +7 -0
- package/dist/chunks/chunk-G3RSMSXJ.ts +63 -0
- package/dist/chunks/chunk-G3RSMSXJ.ts.map +7 -0
- package/dist/chunks/chunk-G6VZTCFH.ts +70 -0
- package/dist/chunks/chunk-G6VZTCFH.ts.map +7 -0
- package/dist/chunks/chunk-H3FP6DLR.ts +160 -0
- package/dist/chunks/chunk-H3FP6DLR.ts.map +7 -0
- package/dist/chunks/chunk-HA36LPCO.ts +130 -0
- package/dist/chunks/chunk-HA36LPCO.ts.map +7 -0
- package/dist/chunks/chunk-HKC4ES4B.ts +65 -0
- package/dist/chunks/chunk-HKC4ES4B.ts.map +7 -0
- package/dist/chunks/chunk-HOP5FXDT.ts +27 -0
- package/dist/chunks/chunk-HOP5FXDT.ts.map +7 -0
- package/dist/chunks/chunk-I2FAK44T.ts +324 -0
- package/dist/chunks/chunk-I2FAK44T.ts.map +7 -0
- package/dist/chunks/chunk-IGAMVWFN.ts +139 -0
- package/dist/chunks/chunk-IGAMVWFN.ts.map +7 -0
- package/dist/chunks/chunk-KMGKCEO4.ts +38 -0
- package/dist/chunks/chunk-KMGKCEO4.ts.map +7 -0
- package/dist/chunks/chunk-N7BLVXKK.ts +73 -0
- package/dist/chunks/chunk-N7BLVXKK.ts.map +7 -0
- package/dist/chunks/chunk-NIF42QMF.ts +297 -0
- package/dist/chunks/chunk-NIF42QMF.ts.map +7 -0
- package/dist/chunks/chunk-O4VO6JUJ.ts +52 -0
- package/dist/chunks/chunk-O4VO6JUJ.ts.map +7 -0
- package/dist/chunks/chunk-ONDTY4EL.ts +91 -0
- package/dist/chunks/chunk-ONDTY4EL.ts.map +7 -0
- package/dist/chunks/chunk-OVPHFGKO.ts +1769 -0
- package/dist/chunks/chunk-OVPHFGKO.ts.map +7 -0
- package/dist/chunks/chunk-P7OH4XMF.ts +60 -0
- package/dist/chunks/chunk-P7OH4XMF.ts.map +7 -0
- package/dist/chunks/chunk-PSK43Y6A.ts +339 -0
- package/dist/chunks/chunk-PSK43Y6A.ts.map +7 -0
- package/dist/chunks/chunk-QBORTI4W.ts +468 -0
- package/dist/chunks/chunk-QBORTI4W.ts.map +7 -0
- package/dist/chunks/chunk-QDVGH2X7.ts +171 -0
- package/dist/chunks/chunk-QDVGH2X7.ts.map +7 -0
- package/dist/chunks/chunk-RHRQMT7Q.ts +490 -0
- package/dist/chunks/chunk-RHRQMT7Q.ts.map +7 -0
- package/dist/chunks/chunk-RRR66UWR.ts +28 -0
- package/dist/chunks/chunk-RRR66UWR.ts.map +7 -0
- package/dist/chunks/chunk-RSUXZD6S.ts +275 -0
- package/dist/chunks/chunk-RSUXZD6S.ts.map +7 -0
- package/dist/chunks/chunk-RTCVYIZA.ts +221 -0
- package/dist/chunks/chunk-RTCVYIZA.ts.map +7 -0
- package/dist/chunks/chunk-S2IWVK3J.ts +44 -0
- package/dist/chunks/chunk-S2IWVK3J.ts.map +7 -0
- package/dist/chunks/chunk-SCZ33MYW.ts +52 -0
- package/dist/chunks/chunk-SCZ33MYW.ts.map +7 -0
- package/dist/chunks/chunk-SWGQLFSD.ts +60 -0
- package/dist/chunks/chunk-SWGQLFSD.ts.map +7 -0
- package/dist/chunks/chunk-UMBPMVJW.ts +22 -0
- package/dist/chunks/chunk-UMBPMVJW.ts.map +7 -0
- package/dist/chunks/chunk-UVFVHIOP.ts +735 -0
- package/dist/chunks/chunk-UVFVHIOP.ts.map +7 -0
- package/dist/chunks/completion-delivery-YPOWSSV3.ts +16 -0
- package/dist/chunks/completion-delivery-YPOWSSV3.ts.map +7 -0
- package/dist/chunks/config-status-J4GPWP46.ts +34 -0
- package/dist/chunks/config-status-J4GPWP46.ts.map +7 -0
- package/dist/chunks/config-ui-3IBMHTQB.ts +1146 -0
- package/dist/chunks/config-ui-3IBMHTQB.ts.map +7 -0
- package/dist/chunks/consult-NYXVDN5G.ts +518 -0
- package/dist/chunks/consult-NYXVDN5G.ts.map +7 -0
- package/dist/chunks/context-QDKLVQXE.ts +11 -0
- package/dist/chunks/context-QDKLVQXE.ts.map +7 -0
- package/dist/chunks/create-stateful-transport-4WKZHRSI.ts +130 -0
- package/dist/chunks/create-stateful-transport-4WKZHRSI.ts.map +7 -0
- package/dist/chunks/cwd-policy-NB6XZ5GF.ts +17 -0
- package/dist/chunks/cwd-policy-NB6XZ5GF.ts.map +7 -0
- package/dist/chunks/delegation-contract-WJPT4FVS.ts +24 -0
- package/dist/chunks/delegation-contract-WJPT4FVS.ts.map +7 -0
- package/dist/chunks/discovery-K25T3SH4.ts +12 -0
- package/dist/chunks/discovery-K25T3SH4.ts.map +7 -0
- package/dist/chunks/execution-DS2DEIQZ.ts +4034 -0
- package/dist/chunks/execution-DS2DEIQZ.ts.map +7 -0
- package/dist/chunks/in-process-transport-TEYAWSEC.ts +38 -0
- package/dist/chunks/in-process-transport-TEYAWSEC.ts.map +7 -0
- package/dist/chunks/inspect-UOQQ3KNL.ts +619 -0
- package/dist/chunks/inspect-UOQQ3KNL.ts.map +7 -0
- package/dist/chunks/peer-communication-KL36Z6CO.ts +294 -0
- package/dist/chunks/peer-communication-KL36Z6CO.ts.map +7 -0
- package/dist/chunks/persistence-VSGXAW4P.ts +344 -0
- package/dist/chunks/persistence-VSGXAW4P.ts.map +7 -0
- package/dist/chunks/registry-E6XPJB7L.ts +1324 -0
- package/dist/chunks/registry-E6XPJB7L.ts.map +7 -0
- package/dist/chunks/retained-semantic-state-7WXSGRJU.ts +81 -0
- package/dist/chunks/retained-semantic-state-7WXSGRJU.ts.map +7 -0
- package/dist/chunks/rpc-transport-Y6LA5BOP.ts +1154 -0
- package/dist/chunks/rpc-transport-Y6LA5BOP.ts.map +7 -0
- package/dist/chunks/runtime-policy-5YELCOVC.ts +15 -0
- package/dist/chunks/runtime-policy-5YELCOVC.ts.map +7 -0
- package/dist/chunks/semantic-snapshot-WPJ3UAFW.ts +19 -0
- package/dist/chunks/semantic-snapshot-WPJ3UAFW.ts.map +7 -0
- package/dist/chunks/spawn-idempotency-QGHO2WKC.ts +13 -0
- package/dist/chunks/spawn-idempotency-QGHO2WKC.ts.map +7 -0
- package/dist/chunks/stateful-lifecycle-JAR6K55H.ts +15 -0
- package/dist/chunks/stateful-lifecycle-JAR6K55H.ts.map +7 -0
- package/dist/chunks/subprocess-transport-C2XVR25R.ts +158 -0
- package/dist/chunks/subprocess-transport-C2XVR25R.ts.map +7 -0
- package/dist/chunks/workspace-WDKLN72J.ts +11 -0
- package/dist/chunks/workspace-WDKLN72J.ts.map +7 -0
- package/dist/index.ts +1057 -0
- package/dist/index.ts.map +7 -0
- package/package.json +9 -5
- package/src/index.ts +1 -1
- package/src/settings-reader.ts +208 -0
- package/src/settings.ts +22 -187
- package/src/stateful-registration.ts +1230 -0
- package/src/stateful-safety.ts +1 -1
- package/src/stateful.ts +2 -1234
- package/src/subagents-extension.ts +307 -0
- package/src/subagents.ts +1 -308
|
@@ -0,0 +1,339 @@
|
|
|
1
|
+
// @generated by scripts/build-runtime.mjs; do not edit.
|
|
2
|
+
// @ts-nocheck -- generated JavaScript uses a .ts extension for Pi's Jiti loader.
|
|
3
|
+
import {
|
|
4
|
+
SUBAGENT_RESULT_FORMATS
|
|
5
|
+
} from "./chunk-RSUXZD6S.ts";
|
|
6
|
+
import {
|
|
7
|
+
isThinkingLevel
|
|
8
|
+
} from "./chunk-DPPVEQAM.ts";
|
|
9
|
+
|
|
10
|
+
// src/agents/discovery.ts
|
|
11
|
+
import * as fs from "node:fs";
|
|
12
|
+
import * as path from "node:path";
|
|
13
|
+
import { CONFIG_DIR_NAME, getAgentDir, parseFrontmatter } from "@earendil-works/pi-coding-agent";
|
|
14
|
+
|
|
15
|
+
// src/capabilities.ts
|
|
16
|
+
var CAPABILITY_MANIFEST_VERSION = "pi-subagents:capabilities:v1";
|
|
17
|
+
var CAPABILITY_MODALITIES = ["text", "image", "audio"];
|
|
18
|
+
var FILESYSTEM_AUTHORITY = ["none", "read", "write"];
|
|
19
|
+
var EXTERNAL_AUTHORITY = ["none", "required"];
|
|
20
|
+
var CAPABILITY_HINTS = ["low", "medium", "high"];
|
|
21
|
+
var MAX_ITEMS = 50;
|
|
22
|
+
var MAX_ITEM_LENGTH = 256;
|
|
23
|
+
var MAX_LIMITATION_LENGTH = 1024;
|
|
24
|
+
function normalizeCapabilityManifest(value) {
|
|
25
|
+
if (value === void 0) return void 0;
|
|
26
|
+
if (!isPlainObject(value) || value.version !== CAPABILITY_MANIFEST_VERSION) return void 0;
|
|
27
|
+
const capabilities = identifiers(value.capabilities, false);
|
|
28
|
+
const modalities = enumArray(value.modalities, CAPABILITY_MODALITIES);
|
|
29
|
+
const resultFormats = enumArray(value.resultFormats, SUBAGENT_RESULT_FORMATS);
|
|
30
|
+
const verificationRoles = identifiers(value.verificationRoles, false);
|
|
31
|
+
const contextStrengths = value.contextStrengths === void 0 ? void 0 : identifiers(value.contextStrengths, false);
|
|
32
|
+
const costHint = optionalEnum(value.costHint, CAPABILITY_HINTS);
|
|
33
|
+
const latencyHint = optionalEnum(value.latencyHint, CAPABILITY_HINTS);
|
|
34
|
+
const limitations = strings(value.limitations, MAX_LIMITATION_LENGTH);
|
|
35
|
+
if (!capabilities || !modalities || !resultFormats || !verificationRoles || contextStrengths === void 0 && value.contextStrengths !== void 0 || costHint === false || latencyHint === false || !limitations) {
|
|
36
|
+
return void 0;
|
|
37
|
+
}
|
|
38
|
+
const authority = normalizeAuthority(value.authority);
|
|
39
|
+
if (authority === false) return void 0;
|
|
40
|
+
return {
|
|
41
|
+
version: CAPABILITY_MANIFEST_VERSION,
|
|
42
|
+
capabilities,
|
|
43
|
+
modalities,
|
|
44
|
+
resultFormats,
|
|
45
|
+
...authority === void 0 ? {} : { authority },
|
|
46
|
+
verificationRoles,
|
|
47
|
+
...contextStrengths === void 0 ? {} : { contextStrengths },
|
|
48
|
+
...costHint === void 0 ? {} : { costHint },
|
|
49
|
+
...latencyHint === void 0 ? {} : { latencyHint },
|
|
50
|
+
limitations
|
|
51
|
+
};
|
|
52
|
+
}
|
|
53
|
+
function projectCapabilityManifest(manifest) {
|
|
54
|
+
return manifest ? structuredClone(manifest) : void 0;
|
|
55
|
+
}
|
|
56
|
+
function normalizeAuthority(value) {
|
|
57
|
+
if (value === void 0) return void 0;
|
|
58
|
+
if (!isPlainObject(value)) return false;
|
|
59
|
+
const filesystem = optionalEnum(value.filesystem, FILESYSTEM_AUTHORITY);
|
|
60
|
+
const network = optionalEnum(value.network, EXTERNAL_AUTHORITY);
|
|
61
|
+
const secrets = optionalEnum(value.secrets, EXTERNAL_AUTHORITY);
|
|
62
|
+
if (filesystem === false || network === false || secrets === false) return false;
|
|
63
|
+
return {
|
|
64
|
+
...filesystem === void 0 ? {} : { filesystem },
|
|
65
|
+
...network === void 0 ? {} : { network },
|
|
66
|
+
...secrets === void 0 ? {} : { secrets }
|
|
67
|
+
};
|
|
68
|
+
}
|
|
69
|
+
function identifiers(value, required) {
|
|
70
|
+
if (value === void 0) return required ? void 0 : [];
|
|
71
|
+
return strings(value, MAX_ITEM_LENGTH, /^[a-z0-9]+(?:-[a-z0-9]+)*$/u);
|
|
72
|
+
}
|
|
73
|
+
function strings(value, maxLength, pattern) {
|
|
74
|
+
if (value === void 0) return [];
|
|
75
|
+
if (!Array.isArray(value) || value.length > MAX_ITEMS) return void 0;
|
|
76
|
+
const result = [];
|
|
77
|
+
const seen = /* @__PURE__ */ new Set();
|
|
78
|
+
for (const item of value) {
|
|
79
|
+
if (typeof item !== "string") return void 0;
|
|
80
|
+
const normalized = item.trim();
|
|
81
|
+
if (!normalized || normalized.length > maxLength || pattern && !pattern.test(normalized)) {
|
|
82
|
+
return void 0;
|
|
83
|
+
}
|
|
84
|
+
if (seen.has(normalized)) continue;
|
|
85
|
+
seen.add(normalized);
|
|
86
|
+
result.push(normalized);
|
|
87
|
+
}
|
|
88
|
+
return result;
|
|
89
|
+
}
|
|
90
|
+
function enumArray(value, allowed) {
|
|
91
|
+
if (value === void 0) return [];
|
|
92
|
+
if (!Array.isArray(value) || value.length > MAX_ITEMS) return void 0;
|
|
93
|
+
const result = [];
|
|
94
|
+
const seen = /* @__PURE__ */ new Set();
|
|
95
|
+
for (const item of value) {
|
|
96
|
+
if (typeof item !== "string" || !allowed.includes(item)) return void 0;
|
|
97
|
+
if (seen.has(item)) continue;
|
|
98
|
+
seen.add(item);
|
|
99
|
+
result.push(item);
|
|
100
|
+
}
|
|
101
|
+
return result;
|
|
102
|
+
}
|
|
103
|
+
function optionalEnum(value, allowed) {
|
|
104
|
+
if (value === void 0) return void 0;
|
|
105
|
+
if (typeof value !== "string" || !allowed.includes(value)) return false;
|
|
106
|
+
return value;
|
|
107
|
+
}
|
|
108
|
+
function isPlainObject(value) {
|
|
109
|
+
return Boolean(value) && typeof value === "object" && !Array.isArray(value);
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
// src/agents/built-ins.ts
|
|
113
|
+
var BUILT_IN_AGENTS = [
|
|
114
|
+
{
|
|
115
|
+
name: "explorer",
|
|
116
|
+
description: "Read-only codebase exploration for specific questions; returns concise findings with paths and evidence.",
|
|
117
|
+
tools: ["read", "grep", "find", "ls"],
|
|
118
|
+
capabilityManifest: builtInManifest(["repository-search", "code-evidence"], "read", [
|
|
119
|
+
"evidence-gathering"
|
|
120
|
+
]),
|
|
121
|
+
thinkingLevel: "low",
|
|
122
|
+
source: "built-in",
|
|
123
|
+
filePath: "built-in:explorer",
|
|
124
|
+
systemPrompt: [
|
|
125
|
+
"You are an explorer subagent. Explore the codebase for specific, well-scoped questions and report grounded findings.",
|
|
126
|
+
"Do not edit files, run shell commands, or use any tool outside the read-only inspection set.",
|
|
127
|
+
"Do not install dependencies, run formatters, start servers, run tests, or execute long-running commands.",
|
|
128
|
+
"Return concise bullets with exact file paths, symbols, and open questions."
|
|
129
|
+
].join("\n")
|
|
130
|
+
},
|
|
131
|
+
{
|
|
132
|
+
name: "worker",
|
|
133
|
+
description: "Bounded implementation and command-execution worker with clear ownership.",
|
|
134
|
+
capabilityManifest: builtInManifest(
|
|
135
|
+
["implementation", "command-execution", "repository-modification"],
|
|
136
|
+
"write"
|
|
137
|
+
),
|
|
138
|
+
source: "built-in",
|
|
139
|
+
filePath: "built-in:worker",
|
|
140
|
+
systemPrompt: workerSystemPrompt()
|
|
141
|
+
}
|
|
142
|
+
];
|
|
143
|
+
function builtInManifest(capabilities, filesystem, verificationRoles = []) {
|
|
144
|
+
return {
|
|
145
|
+
version: CAPABILITY_MANIFEST_VERSION,
|
|
146
|
+
capabilities,
|
|
147
|
+
modalities: ["text"],
|
|
148
|
+
resultFormats: ["text", "structured-v1", "structured-v2"],
|
|
149
|
+
authority: { filesystem },
|
|
150
|
+
verificationRoles,
|
|
151
|
+
contextStrengths: ["repository"],
|
|
152
|
+
costHint: filesystem === "read" ? "low" : "medium",
|
|
153
|
+
latencyHint: filesystem === "read" ? "low" : "medium",
|
|
154
|
+
limitations: []
|
|
155
|
+
};
|
|
156
|
+
}
|
|
157
|
+
function workerSystemPrompt() {
|
|
158
|
+
return [
|
|
159
|
+
"You are a focused worker subagent running in an isolated Pi child context.",
|
|
160
|
+
"Complete only the bounded delegated implementation slice and respect its assigned file or responsibility ownership.",
|
|
161
|
+
"Keep scope tight, avoid unrelated changes, and do not overwrite concurrent work outside your ownership.",
|
|
162
|
+
"The main agent owns integration and final verification; report changed files, commands run, and remaining risks for that handoff."
|
|
163
|
+
].join("\n");
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
// src/agents/discovery.ts
|
|
167
|
+
function readFileBoundedSync(filePath, maxBytes) {
|
|
168
|
+
if (maxBytes === void 0) {
|
|
169
|
+
try {
|
|
170
|
+
const content = fs.readFileSync(filePath, "utf-8");
|
|
171
|
+
return { content, bytes: Buffer.byteLength(content), limited: false };
|
|
172
|
+
} catch {
|
|
173
|
+
return { bytes: 0, limited: false };
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
const readLimit = Math.max(0, maxBytes);
|
|
177
|
+
let fd;
|
|
178
|
+
try {
|
|
179
|
+
fd = fs.openSync(filePath, fs.constants.O_RDONLY | fs.constants.O_NONBLOCK);
|
|
180
|
+
if (!fs.fstatSync(fd).isFile()) return { bytes: 0, limited: false };
|
|
181
|
+
const buffer = Buffer.allocUnsafe(readLimit + 1);
|
|
182
|
+
let offset = 0;
|
|
183
|
+
while (offset < buffer.length) {
|
|
184
|
+
const bytesRead = fs.readSync(fd, buffer, offset, buffer.length - offset, null);
|
|
185
|
+
if (bytesRead === 0) break;
|
|
186
|
+
offset += bytesRead;
|
|
187
|
+
}
|
|
188
|
+
if (offset > readLimit) return { bytes: offset, limited: true };
|
|
189
|
+
return { content: buffer.subarray(0, offset).toString("utf-8"), bytes: offset, limited: false };
|
|
190
|
+
} catch {
|
|
191
|
+
return { bytes: 0, limited: false };
|
|
192
|
+
} finally {
|
|
193
|
+
if (fd !== void 0) fs.closeSync(fd);
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
function loadAgentsFromDir(dir, source, options = {}) {
|
|
197
|
+
const agents = [];
|
|
198
|
+
let omittedAgentDefinitions = 0;
|
|
199
|
+
let entries;
|
|
200
|
+
try {
|
|
201
|
+
entries = fs.readdirSync(dir, { withFileTypes: true });
|
|
202
|
+
} catch (error) {
|
|
203
|
+
return {
|
|
204
|
+
agents,
|
|
205
|
+
omittedAgentDefinitions,
|
|
206
|
+
metadataDiscoveryIncomplete: error.code !== "ENOENT"
|
|
207
|
+
};
|
|
208
|
+
}
|
|
209
|
+
const agentEntries = entries.filter((entry) => entry.name.endsWith(".md")).filter((entry) => entry.isFile() || entry.isSymbolicLink());
|
|
210
|
+
let totalBytes = 0;
|
|
211
|
+
for (const [index, entry] of agentEntries.entries()) {
|
|
212
|
+
if (options.maxFiles !== void 0 && index >= options.maxFiles) {
|
|
213
|
+
omittedAgentDefinitions += agentEntries.length - index;
|
|
214
|
+
break;
|
|
215
|
+
}
|
|
216
|
+
const filePath = path.join(dir, entry.name);
|
|
217
|
+
const remainingBytes = options.maxTotalBytes === void 0 ? void 0 : options.maxTotalBytes - totalBytes;
|
|
218
|
+
if (remainingBytes !== void 0 && remainingBytes <= 0) {
|
|
219
|
+
omittedAgentDefinitions++;
|
|
220
|
+
continue;
|
|
221
|
+
}
|
|
222
|
+
const maxBytes = options.maxFileBytes === void 0 ? remainingBytes : remainingBytes === void 0 ? options.maxFileBytes : Math.min(options.maxFileBytes, remainingBytes);
|
|
223
|
+
const loaded = readFileBoundedSync(filePath, maxBytes);
|
|
224
|
+
totalBytes += Math.min(loaded.bytes, maxBytes ?? loaded.bytes);
|
|
225
|
+
if (loaded.limited || loaded.content === void 0) {
|
|
226
|
+
if (loaded.limited) omittedAgentDefinitions++;
|
|
227
|
+
continue;
|
|
228
|
+
}
|
|
229
|
+
const { frontmatter, body } = parseFrontmatter(loaded.content);
|
|
230
|
+
if (typeof frontmatter.name !== "string" || typeof frontmatter.description !== "string") {
|
|
231
|
+
continue;
|
|
232
|
+
}
|
|
233
|
+
const hasTools = hasOwn(frontmatter, "tools");
|
|
234
|
+
const rawTools = frontmatter.tools;
|
|
235
|
+
let tools;
|
|
236
|
+
if (hasTools) {
|
|
237
|
+
if (rawTools === null) {
|
|
238
|
+
tools = [];
|
|
239
|
+
} else if (Array.isArray(rawTools)) {
|
|
240
|
+
if (!rawTools.every((tool) => typeof tool === "string")) continue;
|
|
241
|
+
tools = rawTools.map((tool) => tool.trim()).filter(Boolean);
|
|
242
|
+
} else if (typeof rawTools === "string") {
|
|
243
|
+
tools = rawTools.split(",").map((tool) => tool.trim()).filter(Boolean);
|
|
244
|
+
} else {
|
|
245
|
+
continue;
|
|
246
|
+
}
|
|
247
|
+
}
|
|
248
|
+
agents.push({
|
|
249
|
+
name: frontmatter.name,
|
|
250
|
+
description: frontmatter.description,
|
|
251
|
+
...hasTools ? { tools: tools ?? [] } : {},
|
|
252
|
+
model: typeof frontmatter.model === "string" ? frontmatter.model : void 0,
|
|
253
|
+
thinkingLevel: isThinkingLevel(frontmatter.thinkingLevel) ? frontmatter.thinkingLevel : void 0,
|
|
254
|
+
capabilityManifest: normalizeCapabilityManifest(frontmatter.capabilityManifest),
|
|
255
|
+
systemPrompt: body,
|
|
256
|
+
source,
|
|
257
|
+
filePath
|
|
258
|
+
});
|
|
259
|
+
}
|
|
260
|
+
return { agents, omittedAgentDefinitions, metadataDiscoveryIncomplete: false };
|
|
261
|
+
}
|
|
262
|
+
function isDirectory(p) {
|
|
263
|
+
try {
|
|
264
|
+
return fs.statSync(p).isDirectory();
|
|
265
|
+
} catch {
|
|
266
|
+
return false;
|
|
267
|
+
}
|
|
268
|
+
}
|
|
269
|
+
function findNearestProjectAgentsDir(cwd) {
|
|
270
|
+
let currentDir = cwd;
|
|
271
|
+
while (true) {
|
|
272
|
+
const candidate = path.join(currentDir, CONFIG_DIR_NAME, "agents");
|
|
273
|
+
if (isDirectory(candidate)) return candidate;
|
|
274
|
+
const parentDir = path.dirname(currentDir);
|
|
275
|
+
if (parentDir === currentDir) return null;
|
|
276
|
+
currentDir = parentDir;
|
|
277
|
+
}
|
|
278
|
+
}
|
|
279
|
+
function hasOwn(obj, key) {
|
|
280
|
+
return Object.hasOwn(obj, key);
|
|
281
|
+
}
|
|
282
|
+
function applyAgentOverride(agent, override) {
|
|
283
|
+
const nextAgent = { ...agent };
|
|
284
|
+
if (hasOwn(override, "tools")) nextAgent.tools = override.tools;
|
|
285
|
+
if (hasOwn(override, "model")) {
|
|
286
|
+
nextAgent.model = override.model === null ? void 0 : override.model;
|
|
287
|
+
}
|
|
288
|
+
if (hasOwn(override, "thinkingLevel")) {
|
|
289
|
+
nextAgent.thinkingLevel = override.thinkingLevel === null ? void 0 : override.thinkingLevel;
|
|
290
|
+
}
|
|
291
|
+
if (hasOwn(override, "timeoutMs")) {
|
|
292
|
+
nextAgent.timeoutMs = override.timeoutMs === null ? void 0 : override.timeoutMs;
|
|
293
|
+
}
|
|
294
|
+
return nextAgent;
|
|
295
|
+
}
|
|
296
|
+
function discoverAgents(cwd, scope, config, options = {}) {
|
|
297
|
+
const userDir = path.join(getAgentDir(), "agents");
|
|
298
|
+
const projectAgentsDir = findNearestProjectAgentsDir(cwd);
|
|
299
|
+
const userLoaded = scope === "project" ? { agents: [], omittedAgentDefinitions: 0, metadataDiscoveryIncomplete: false } : loadAgentsFromDir(userDir, "user", options);
|
|
300
|
+
const projectLoaded = scope === "user" || !projectAgentsDir ? { agents: [], omittedAgentDefinitions: 0, metadataDiscoveryIncomplete: false } : loadAgentsFromDir(projectAgentsDir, "project", options);
|
|
301
|
+
const userAgents = userLoaded.agents;
|
|
302
|
+
const projectAgents = projectLoaded.agents;
|
|
303
|
+
const agentMap = /* @__PURE__ */ new Map();
|
|
304
|
+
for (const agent of BUILT_IN_AGENTS) agentMap.set(agent.name, agent);
|
|
305
|
+
if (scope === "both") {
|
|
306
|
+
for (const agent of userAgents) agentMap.set(agent.name, agent);
|
|
307
|
+
for (const agent of projectAgents) agentMap.set(agent.name, agent);
|
|
308
|
+
} else if (scope === "user") {
|
|
309
|
+
for (const agent of userAgents) agentMap.set(agent.name, agent);
|
|
310
|
+
} else {
|
|
311
|
+
for (const agent of projectAgents) agentMap.set(agent.name, agent);
|
|
312
|
+
}
|
|
313
|
+
const configuredAgents = config?.agents ?? {};
|
|
314
|
+
for (const [name, override] of Object.entries(configuredAgents)) {
|
|
315
|
+
const agent = agentMap.get(name);
|
|
316
|
+
if (!agent) continue;
|
|
317
|
+
agentMap.set(name, applyAgentOverride(agent, override));
|
|
318
|
+
}
|
|
319
|
+
const legacyScoutOverride = configuredAgents.scout;
|
|
320
|
+
const explorerAgent = agentMap.get("explorer");
|
|
321
|
+
if (legacyScoutOverride && explorerAgent && !hasOwn(configuredAgents, "explorer") && !agentMap.has("scout")) {
|
|
322
|
+
agentMap.set("explorer", applyAgentOverride(explorerAgent, legacyScoutOverride));
|
|
323
|
+
}
|
|
324
|
+
const omittedAgentDefinitions = userLoaded.omittedAgentDefinitions + projectLoaded.omittedAgentDefinitions;
|
|
325
|
+
const metadataDiscoveryIncomplete = userLoaded.metadataDiscoveryIncomplete || projectLoaded.metadataDiscoveryIncomplete;
|
|
326
|
+
return {
|
|
327
|
+
agents: Array.from(agentMap.values()),
|
|
328
|
+
projectAgentsDir,
|
|
329
|
+
...omittedAgentDefinitions > 0 ? { omittedAgentDefinitions } : {},
|
|
330
|
+
...metadataDiscoveryIncomplete ? { metadataDiscoveryIncomplete } : {}
|
|
331
|
+
};
|
|
332
|
+
}
|
|
333
|
+
|
|
334
|
+
export {
|
|
335
|
+
projectCapabilityManifest,
|
|
336
|
+
BUILT_IN_AGENTS,
|
|
337
|
+
discoverAgents
|
|
338
|
+
};
|
|
339
|
+
//# sourceMappingURL=chunk-PSK43Y6A.ts.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/agents/discovery.ts", "../../src/capabilities.ts", "../../src/agents/built-ins.ts"],
|
|
4
|
+
"sourcesContent": ["/**\n * Filesystem and frontmatter discovery for user and trusted project agents.\n */\n\nimport * as fs from \"node:fs\";\nimport * as path from \"node:path\";\nimport { CONFIG_DIR_NAME, getAgentDir, parseFrontmatter } from \"@earendil-works/pi-coding-agent\";\nimport { normalizeCapabilityManifest } from \"../capabilities.js\";\nimport { BUILT_IN_AGENTS } from \"./built-ins.js\";\nimport type { AgentConfig, AgentScope, SubagentSettings } from \"./types.js\";\nimport { isThinkingLevel } from \"./types.js\";\n\nexport interface AgentDiscoveryResult {\n\tagents: AgentConfig[];\n\tprojectAgentsDir: string | null;\n\tomittedAgentDefinitions?: number;\n\tmetadataDiscoveryIncomplete?: boolean;\n}\n\nexport interface AgentDiscoveryOptions {\n\tmaxFiles?: number;\n\tmaxFileBytes?: number;\n\tmaxTotalBytes?: number;\n}\n\ninterface LoadedAgents {\n\tagents: AgentConfig[];\n\tomittedAgentDefinitions: number;\n\tmetadataDiscoveryIncomplete: boolean;\n}\n\nfunction readFileBoundedSync(\n\tfilePath: string,\n\tmaxBytes: number | undefined,\n): { content?: string; bytes: number; limited: boolean } {\n\tif (maxBytes === undefined) {\n\t\ttry {\n\t\t\tconst content = fs.readFileSync(filePath, \"utf-8\");\n\t\t\treturn { content, bytes: Buffer.byteLength(content), limited: false };\n\t\t} catch {\n\t\t\treturn { bytes: 0, limited: false };\n\t\t}\n\t}\n\n\tconst readLimit = Math.max(0, maxBytes);\n\tlet fd: number | undefined;\n\ttry {\n\t\tfd = fs.openSync(filePath, fs.constants.O_RDONLY | fs.constants.O_NONBLOCK);\n\t\tif (!fs.fstatSync(fd).isFile()) return { bytes: 0, limited: false };\n\t\tconst buffer = Buffer.allocUnsafe(readLimit + 1);\n\t\tlet offset = 0;\n\t\twhile (offset < buffer.length) {\n\t\t\tconst bytesRead = fs.readSync(fd, buffer, offset, buffer.length - offset, null);\n\t\t\tif (bytesRead === 0) break;\n\t\t\toffset += bytesRead;\n\t\t}\n\t\tif (offset > readLimit) return { bytes: offset, limited: true };\n\t\treturn { content: buffer.subarray(0, offset).toString(\"utf-8\"), bytes: offset, limited: false };\n\t} catch {\n\t\treturn { bytes: 0, limited: false };\n\t} finally {\n\t\tif (fd !== undefined) fs.closeSync(fd);\n\t}\n}\n\nfunction loadAgentsFromDir(\n\tdir: string,\n\tsource: \"user\" | \"project\",\n\toptions: AgentDiscoveryOptions = {},\n): LoadedAgents {\n\tconst agents: AgentConfig[] = [];\n\tlet omittedAgentDefinitions = 0;\n\n\tlet entries: fs.Dirent[];\n\ttry {\n\t\tentries = fs.readdirSync(dir, { withFileTypes: true });\n\t} catch (error) {\n\t\treturn {\n\t\t\tagents,\n\t\t\tomittedAgentDefinitions,\n\t\t\tmetadataDiscoveryIncomplete: (error as NodeJS.ErrnoException).code !== \"ENOENT\",\n\t\t};\n\t}\n\n\tconst agentEntries = entries\n\t\t.filter((entry) => entry.name.endsWith(\".md\"))\n\t\t.filter((entry) => entry.isFile() || entry.isSymbolicLink());\n\tlet totalBytes = 0;\n\n\tfor (const [index, entry] of agentEntries.entries()) {\n\t\tif (options.maxFiles !== undefined && index >= options.maxFiles) {\n\t\t\tomittedAgentDefinitions += agentEntries.length - index;\n\t\t\tbreak;\n\t\t}\n\t\tconst filePath = path.join(dir, entry.name);\n\t\tconst remainingBytes =\n\t\t\toptions.maxTotalBytes === undefined ? undefined : options.maxTotalBytes - totalBytes;\n\t\tif (remainingBytes !== undefined && remainingBytes <= 0) {\n\t\t\tomittedAgentDefinitions++;\n\t\t\tcontinue;\n\t\t}\n\t\tconst maxBytes =\n\t\t\toptions.maxFileBytes === undefined\n\t\t\t\t? remainingBytes\n\t\t\t\t: remainingBytes === undefined\n\t\t\t\t\t? options.maxFileBytes\n\t\t\t\t\t: Math.min(options.maxFileBytes, remainingBytes);\n\t\tconst loaded = readFileBoundedSync(filePath, maxBytes);\n\t\ttotalBytes += Math.min(loaded.bytes, maxBytes ?? loaded.bytes);\n\t\tif (loaded.limited || loaded.content === undefined) {\n\t\t\tif (loaded.limited) omittedAgentDefinitions++;\n\t\t\tcontinue;\n\t\t}\n\n\t\tconst { frontmatter, body } = parseFrontmatter<Record<string, unknown>>(loaded.content);\n\n\t\tif (typeof frontmatter.name !== \"string\" || typeof frontmatter.description !== \"string\") {\n\t\t\tcontinue;\n\t\t}\n\n\t\tconst hasTools = hasOwn(frontmatter, \"tools\");\n\t\tconst rawTools = frontmatter.tools;\n\t\tlet tools: string[] | undefined;\n\t\tif (hasTools) {\n\t\t\tif (rawTools === null) {\n\t\t\t\ttools = [];\n\t\t\t} else if (Array.isArray(rawTools)) {\n\t\t\t\tif (!rawTools.every((tool): tool is string => typeof tool === \"string\")) continue;\n\t\t\t\ttools = rawTools.map((tool) => tool.trim()).filter(Boolean);\n\t\t\t} else if (typeof rawTools === \"string\") {\n\t\t\t\ttools = rawTools\n\t\t\t\t\t.split(\",\")\n\t\t\t\t\t.map((tool) => tool.trim())\n\t\t\t\t\t.filter(Boolean);\n\t\t\t} else {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t}\n\n\t\tagents.push({\n\t\t\tname: frontmatter.name,\n\t\t\tdescription: frontmatter.description,\n\t\t\t...(hasTools ? { tools: tools ?? [] } : {}),\n\t\t\tmodel: typeof frontmatter.model === \"string\" ? frontmatter.model : undefined,\n\t\t\tthinkingLevel: isThinkingLevel(frontmatter.thinkingLevel)\n\t\t\t\t? frontmatter.thinkingLevel\n\t\t\t\t: undefined,\n\t\t\tcapabilityManifest: normalizeCapabilityManifest(frontmatter.capabilityManifest),\n\t\t\tsystemPrompt: body,\n\t\t\tsource,\n\t\t\tfilePath,\n\t\t});\n\t}\n\n\treturn { agents, omittedAgentDefinitions, metadataDiscoveryIncomplete: false };\n}\n\nfunction isDirectory(p: string): boolean {\n\ttry {\n\t\treturn fs.statSync(p).isDirectory();\n\t} catch {\n\t\treturn false;\n\t}\n}\n\nfunction findNearestProjectAgentsDir(cwd: string): string | null {\n\tlet currentDir = cwd;\n\twhile (true) {\n\t\tconst candidate = path.join(currentDir, CONFIG_DIR_NAME, \"agents\");\n\t\tif (isDirectory(candidate)) return candidate;\n\n\t\tconst parentDir = path.dirname(currentDir);\n\t\tif (parentDir === currentDir) return null;\n\t\tcurrentDir = parentDir;\n\t}\n}\n\nfunction hasOwn(obj: object, key: PropertyKey): boolean {\n\treturn Object.hasOwn(obj, key);\n}\n\nfunction applyAgentOverride(\n\tagent: AgentConfig,\n\toverride: NonNullable<SubagentSettings[\"agents\"]>[string],\n): AgentConfig {\n\tconst nextAgent: AgentConfig = { ...agent };\n\tif (hasOwn(override, \"tools\")) nextAgent.tools = override.tools;\n\tif (hasOwn(override, \"model\")) {\n\t\tnextAgent.model = override.model === null ? undefined : override.model;\n\t}\n\tif (hasOwn(override, \"thinkingLevel\")) {\n\t\tnextAgent.thinkingLevel = override.thinkingLevel === null ? undefined : override.thinkingLevel;\n\t}\n\tif (hasOwn(override, \"timeoutMs\")) {\n\t\tnextAgent.timeoutMs = override.timeoutMs === null ? undefined : override.timeoutMs;\n\t}\n\treturn nextAgent;\n}\n\nexport function discoverAgents(\n\tcwd: string,\n\tscope: AgentScope,\n\tconfig?: SubagentSettings,\n\toptions: AgentDiscoveryOptions = {},\n): AgentDiscoveryResult {\n\tconst userDir = path.join(getAgentDir(), \"agents\");\n\tconst projectAgentsDir = findNearestProjectAgentsDir(cwd);\n\n\tconst userLoaded =\n\t\tscope === \"project\"\n\t\t\t? { agents: [], omittedAgentDefinitions: 0, metadataDiscoveryIncomplete: false }\n\t\t\t: loadAgentsFromDir(userDir, \"user\", options);\n\tconst projectLoaded =\n\t\tscope === \"user\" || !projectAgentsDir\n\t\t\t? { agents: [], omittedAgentDefinitions: 0, metadataDiscoveryIncomplete: false }\n\t\t\t: loadAgentsFromDir(projectAgentsDir, \"project\", options);\n\tconst userAgents = userLoaded.agents;\n\tconst projectAgents = projectLoaded.agents;\n\n\tconst agentMap = new Map<string, AgentConfig>();\n\n\t// Lowest priority: built-ins are always available, then user agents, then\n\t// trusted project agents if requested. This mirrors the subagent boundary\n\t// pattern in ./src: stable built-ins plus overridable local definitions.\n\tfor (const agent of BUILT_IN_AGENTS) agentMap.set(agent.name, agent);\n\n\tif (scope === \"both\") {\n\t\tfor (const agent of userAgents) agentMap.set(agent.name, agent);\n\t\tfor (const agent of projectAgents) agentMap.set(agent.name, agent);\n\t} else if (scope === \"user\") {\n\t\tfor (const agent of userAgents) agentMap.set(agent.name, agent);\n\t} else {\n\t\tfor (const agent of projectAgents) agentMap.set(agent.name, agent);\n\t}\n\n\t// Apply user-configured overrides (from /subagents \u2192 Agent tool settings) on top of\n\t// the final resolved agent map, regardless of agent source.\n\tconst configuredAgents = config?.agents ?? {};\n\tfor (const [name, override] of Object.entries(configuredAgents)) {\n\t\tconst agent = agentMap.get(name);\n\t\tif (!agent) continue;\n\t\tagentMap.set(name, applyAgentOverride(agent, override));\n\t}\n\tconst legacyScoutOverride = configuredAgents.scout;\n\tconst explorerAgent = agentMap.get(\"explorer\");\n\tif (\n\t\tlegacyScoutOverride &&\n\t\texplorerAgent &&\n\t\t!hasOwn(configuredAgents, \"explorer\") &&\n\t\t!agentMap.has(\"scout\")\n\t) {\n\t\tagentMap.set(\"explorer\", applyAgentOverride(explorerAgent, legacyScoutOverride));\n\t}\n\n\tconst omittedAgentDefinitions =\n\t\tuserLoaded.omittedAgentDefinitions + projectLoaded.omittedAgentDefinitions;\n\tconst metadataDiscoveryIncomplete =\n\t\tuserLoaded.metadataDiscoveryIncomplete || projectLoaded.metadataDiscoveryIncomplete;\n\treturn {\n\t\tagents: Array.from(agentMap.values()),\n\t\tprojectAgentsDir,\n\t\t...(omittedAgentDefinitions > 0 ? { omittedAgentDefinitions } : {}),\n\t\t...(metadataDiscoveryIncomplete ? { metadataDiscoveryIncomplete } : {}),\n\t};\n}\n", "import type { SubagentResultFormat } from \"./result-contract.js\";\nimport { SUBAGENT_RESULT_FORMATS } from \"./result-contract.js\";\n\nexport const CAPABILITY_MANIFEST_VERSION = \"pi-subagents:capabilities:v1\" as const;\nexport const CAPABILITY_MODALITIES = [\"text\", \"image\", \"audio\"] as const;\nexport const FILESYSTEM_AUTHORITY = [\"none\", \"read\", \"write\"] as const;\nexport const EXTERNAL_AUTHORITY = [\"none\", \"required\"] as const;\nexport const CAPABILITY_HINTS = [\"low\", \"medium\", \"high\"] as const;\nexport type CapabilityHint = (typeof CAPABILITY_HINTS)[number];\n\nconst MAX_ITEMS = 50;\nconst MAX_ITEM_LENGTH = 256;\nconst MAX_LIMITATION_LENGTH = 1024;\n\nexport interface AgentAuthorityManifest {\n\tfilesystem?: (typeof FILESYSTEM_AUTHORITY)[number];\n\tnetwork?: (typeof EXTERNAL_AUTHORITY)[number];\n\tsecrets?: (typeof EXTERNAL_AUTHORITY)[number];\n}\n\nexport interface AgentCapabilityManifest {\n\tversion: typeof CAPABILITY_MANIFEST_VERSION;\n\tcapabilities: string[];\n\tmodalities: Array<(typeof CAPABILITY_MODALITIES)[number]>;\n\tresultFormats: SubagentResultFormat[];\n\tauthority?: AgentAuthorityManifest;\n\tverificationRoles: string[];\n\tcontextStrengths?: string[];\n\tcostHint?: CapabilityHint;\n\tlatencyHint?: CapabilityHint;\n\tlimitations: string[];\n}\n\nexport function normalizeCapabilityManifest(value: unknown): AgentCapabilityManifest | undefined {\n\tif (value === undefined) return undefined;\n\tif (!isPlainObject(value) || value.version !== CAPABILITY_MANIFEST_VERSION) return undefined;\n\tconst capabilities = identifiers(value.capabilities, false);\n\tconst modalities = enumArray(value.modalities, CAPABILITY_MODALITIES);\n\tconst resultFormats = enumArray(value.resultFormats, SUBAGENT_RESULT_FORMATS);\n\tconst verificationRoles = identifiers(value.verificationRoles, false);\n\tconst contextStrengths =\n\t\tvalue.contextStrengths === undefined ? undefined : identifiers(value.contextStrengths, false);\n\tconst costHint = optionalEnum(value.costHint, CAPABILITY_HINTS);\n\tconst latencyHint = optionalEnum(value.latencyHint, CAPABILITY_HINTS);\n\tconst limitations = strings(value.limitations, MAX_LIMITATION_LENGTH);\n\tif (\n\t\t!capabilities ||\n\t\t!modalities ||\n\t\t!resultFormats ||\n\t\t!verificationRoles ||\n\t\t(contextStrengths === undefined && value.contextStrengths !== undefined) ||\n\t\tcostHint === false ||\n\t\tlatencyHint === false ||\n\t\t!limitations\n\t) {\n\t\treturn undefined;\n\t}\n\tconst authority = normalizeAuthority(value.authority);\n\tif (authority === false) return undefined;\n\treturn {\n\t\tversion: CAPABILITY_MANIFEST_VERSION,\n\t\tcapabilities,\n\t\tmodalities,\n\t\tresultFormats,\n\t\t...(authority === undefined ? {} : { authority }),\n\t\tverificationRoles,\n\t\t...(contextStrengths === undefined ? {} : { contextStrengths }),\n\t\t...(costHint === undefined ? {} : { costHint }),\n\t\t...(latencyHint === undefined ? {} : { latencyHint }),\n\t\tlimitations,\n\t};\n}\n\nexport function projectCapabilityManifest(\n\tmanifest: AgentCapabilityManifest | undefined,\n): AgentCapabilityManifest | undefined {\n\treturn manifest ? structuredClone(manifest) : undefined;\n}\n\nfunction normalizeAuthority(value: unknown): AgentAuthorityManifest | undefined | false {\n\tif (value === undefined) return undefined;\n\tif (!isPlainObject(value)) return false;\n\tconst filesystem = optionalEnum(value.filesystem, FILESYSTEM_AUTHORITY);\n\tconst network = optionalEnum(value.network, EXTERNAL_AUTHORITY);\n\tconst secrets = optionalEnum(value.secrets, EXTERNAL_AUTHORITY);\n\tif (filesystem === false || network === false || secrets === false) return false;\n\treturn {\n\t\t...(filesystem === undefined ? {} : { filesystem }),\n\t\t...(network === undefined ? {} : { network }),\n\t\t...(secrets === undefined ? {} : { secrets }),\n\t};\n}\n\nfunction identifiers(value: unknown, required: boolean): string[] | undefined {\n\tif (value === undefined) return required ? undefined : [];\n\treturn strings(value, MAX_ITEM_LENGTH, /^[a-z0-9]+(?:-[a-z0-9]+)*$/u);\n}\n\nfunction strings(value: unknown, maxLength: number, pattern?: RegExp): string[] | undefined {\n\tif (value === undefined) return [];\n\tif (!Array.isArray(value) || value.length > MAX_ITEMS) return undefined;\n\tconst result: string[] = [];\n\tconst seen = new Set<string>();\n\tfor (const item of value) {\n\t\tif (typeof item !== \"string\") return undefined;\n\t\tconst normalized = item.trim();\n\t\tif (!normalized || normalized.length > maxLength || (pattern && !pattern.test(normalized))) {\n\t\t\treturn undefined;\n\t\t}\n\t\tif (seen.has(normalized)) continue;\n\t\tseen.add(normalized);\n\t\tresult.push(normalized);\n\t}\n\treturn result;\n}\n\nfunction enumArray<const T extends readonly string[]>(\n\tvalue: unknown,\n\tallowed: T,\n): Array<T[number]> | undefined {\n\tif (value === undefined) return [];\n\tif (!Array.isArray(value) || value.length > MAX_ITEMS) return undefined;\n\tconst result: Array<T[number]> = [];\n\tconst seen = new Set<string>();\n\tfor (const item of value) {\n\t\tif (typeof item !== \"string\" || !allowed.includes(item)) return undefined;\n\t\tif (seen.has(item)) continue;\n\t\tseen.add(item);\n\t\tresult.push(item as T[number]);\n\t}\n\treturn result;\n}\n\nfunction optionalEnum<const T extends readonly string[]>(\n\tvalue: unknown,\n\tallowed: T,\n): T[number] | undefined | false {\n\tif (value === undefined) return undefined;\n\tif (typeof value !== \"string\" || !allowed.includes(value)) return false;\n\treturn value as T[number];\n}\n\nfunction isPlainObject(value: unknown): value is Record<string, unknown> {\n\treturn Boolean(value) && typeof value === \"object\" && !Array.isArray(value);\n}\n", "/**\n * Built-in agent definitions and prompt construction.\n */\n\nimport { type AgentCapabilityManifest, CAPABILITY_MANIFEST_VERSION } from \"../capabilities.js\";\nimport type { AgentConfig } from \"./types.js\";\n\nexport const BUILT_IN_AGENTS: AgentConfig[] = [\n\t{\n\t\tname: \"explorer\",\n\t\tdescription:\n\t\t\t\"Read-only codebase exploration for specific questions; returns concise findings with paths and evidence.\",\n\t\ttools: [\"read\", \"grep\", \"find\", \"ls\"],\n\t\tcapabilityManifest: builtInManifest([\"repository-search\", \"code-evidence\"], \"read\", [\n\t\t\t\"evidence-gathering\",\n\t\t]),\n\t\tthinkingLevel: \"low\",\n\t\tsource: \"built-in\",\n\t\tfilePath: \"built-in:explorer\",\n\t\tsystemPrompt: [\n\t\t\t\"You are an explorer subagent. Explore the codebase for specific, well-scoped questions and report grounded findings.\",\n\t\t\t\"Do not edit files, run shell commands, or use any tool outside the read-only inspection set.\",\n\t\t\t\"Do not install dependencies, run formatters, start servers, run tests, or execute long-running commands.\",\n\t\t\t\"Return concise bullets with exact file paths, symbols, and open questions.\",\n\t\t].join(\"\\n\"),\n\t},\n\t{\n\t\tname: \"worker\",\n\t\tdescription: \"Bounded implementation and command-execution worker with clear ownership.\",\n\t\tcapabilityManifest: builtInManifest(\n\t\t\t[\"implementation\", \"command-execution\", \"repository-modification\"],\n\t\t\t\"write\",\n\t\t),\n\t\tsource: \"built-in\",\n\t\tfilePath: \"built-in:worker\",\n\t\tsystemPrompt: workerSystemPrompt(),\n\t},\n];\n\nexport function getBuiltInAgent(name: string): AgentConfig | undefined {\n\tconst agent = BUILT_IN_AGENTS.find((candidate) => candidate.name === name);\n\treturn agent ? structuredClone(agent) : undefined;\n}\n\nfunction builtInManifest(\n\tcapabilities: string[],\n\tfilesystem: \"read\" | \"write\",\n\tverificationRoles: string[] = [],\n): AgentCapabilityManifest {\n\treturn {\n\t\tversion: CAPABILITY_MANIFEST_VERSION,\n\t\tcapabilities,\n\t\tmodalities: [\"text\"],\n\t\tresultFormats: [\"text\", \"structured-v1\", \"structured-v2\"],\n\t\tauthority: { filesystem },\n\t\tverificationRoles,\n\t\tcontextStrengths: [\"repository\"],\n\t\tcostHint: filesystem === \"read\" ? \"low\" : \"medium\",\n\t\tlatencyHint: filesystem === \"read\" ? \"low\" : \"medium\",\n\t\tlimitations: [],\n\t};\n}\n\nfunction workerSystemPrompt(): string {\n\treturn [\n\t\t\"You are a focused worker subagent running in an isolated Pi child context.\",\n\t\t\"Complete only the bounded delegated implementation slice and respect its assigned file or responsibility ownership.\",\n\t\t\"Keep scope tight, avoid unrelated changes, and do not overwrite concurrent work outside your ownership.\",\n\t\t\"The main agent owns integration and final verification; report changed files, commands run, and remaining risks for that handoff.\",\n\t].join(\"\\n\");\n}\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;AAIA,YAAY,QAAQ;AACpB,YAAY,UAAU;AACtB,SAAS,iBAAiB,aAAa,wBAAwB;;;ACHxD,IAAM,8BAA8B;AACpC,IAAM,wBAAwB,CAAC,QAAQ,SAAS,OAAO;AACvD,IAAM,uBAAuB,CAAC,QAAQ,QAAQ,OAAO;AACrD,IAAM,qBAAqB,CAAC,QAAQ,UAAU;AAC9C,IAAM,mBAAmB,CAAC,OAAO,UAAU,MAAM;AAGxD,IAAM,YAAY;AAClB,IAAM,kBAAkB;AACxB,IAAM,wBAAwB;AAqBvB,SAAS,4BAA4B,OAAqD;AAChG,MAAI,UAAU,OAAW,QAAO;AAChC,MA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