@interchained/portal-cli 0.1.10 → 0.1.11
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/commands/agent-cmd.d.ts +9 -0
- package/dist/commands/agent-cmd.d.ts.map +1 -1
- package/dist/commands/agent-cmd.js +150 -69
- package/dist/commands/agent-cmd.js.map +1 -1
- package/dist/utils/agents.d.ts +20 -0
- package/dist/utils/agents.d.ts.map +1 -0
- package/dist/utils/agents.js +80 -0
- package/dist/utils/agents.js.map +1 -0
- package/package.json +1 -1
|
@@ -1,6 +1,15 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* portal agent list — list configured agents and their permissions
|
|
3
3
|
* portal agent run — run a specific agent task manually
|
|
4
|
+
*
|
|
5
|
+
* Agents are real defineAgent({ ... }) definitions loaded from agents/*.agent.ts.
|
|
6
|
+
* Their declared permissions are enforced:
|
|
7
|
+
* - canPatch: false → read-only; the agent analyzes and reports, never writes
|
|
8
|
+
* - canPatch: true → may produce patches
|
|
9
|
+
* - requiresApproval: true → patches stay pending for `portal patch`
|
|
10
|
+
* - requiresApproval: false→ clean patches are applied automatically
|
|
11
|
+
* When requiresApproval is unset it falls back to the contract's publishing policy,
|
|
12
|
+
* defaulting to "requires approval" unless publishing is explicitly "immediate".
|
|
4
13
|
*/
|
|
5
14
|
export declare function agentListCommand(): Promise<void>;
|
|
6
15
|
export declare function agentRunCommand(name: string): Promise<void>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"agent-cmd.d.ts","sourceRoot":"","sources":["../../src/commands/agent-cmd.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"agent-cmd.d.ts","sourceRoot":"","sources":["../../src/commands/agent-cmd.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAiEH,wBAAsB,gBAAgB,IAAI,OAAO,CAAC,IAAI,CAAC,CA0BtD;AAID,wBAAsB,eAAe,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAyKjE"}
|
|
@@ -1,21 +1,58 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* portal agent list — list configured agents and their permissions
|
|
3
3
|
* portal agent run — run a specific agent task manually
|
|
4
|
+
*
|
|
5
|
+
* Agents are real defineAgent({ ... }) definitions loaded from agents/*.agent.ts.
|
|
6
|
+
* Their declared permissions are enforced:
|
|
7
|
+
* - canPatch: false → read-only; the agent analyzes and reports, never writes
|
|
8
|
+
* - canPatch: true → may produce patches
|
|
9
|
+
* - requiresApproval: true → patches stay pending for `portal patch`
|
|
10
|
+
* - requiresApproval: false→ clean patches are applied automatically
|
|
11
|
+
* When requiresApproval is unset it falls back to the contract's publishing policy,
|
|
12
|
+
* defaulting to "requires approval" unless publishing is explicitly "immediate".
|
|
4
13
|
*/
|
|
5
|
-
import { readFile, readdir
|
|
6
|
-
import { join
|
|
14
|
+
import { readFile, readdir } from "node:fs/promises";
|
|
15
|
+
import { join } from "node:path";
|
|
7
16
|
import pc from "picocolors";
|
|
8
17
|
import ora from "ora";
|
|
9
|
-
import { Runner, Sentinel, PatchStore, createPatch } from "@interchained/portal-agent";
|
|
18
|
+
import { Runner, Sentinel, PatchStore, createPatch, applyPatch, } from "@interchained/portal-agent";
|
|
10
19
|
import { banner, header, success, fail, info, step, blank } from "../utils/print.js";
|
|
11
20
|
import { loadContract } from "../utils/contract.js";
|
|
12
|
-
|
|
21
|
+
import { findAgentFiles, matchAgentFile, loadAgent } from "../utils/agents.js";
|
|
22
|
+
// ── helpers ─────────────────────────────────────────────────────────────────
|
|
23
|
+
/**
|
|
24
|
+
* Resolve whether an agent's patches require approval.
|
|
25
|
+
* Fail-safe: defaults to true unless the contract explicitly publishes immediately.
|
|
26
|
+
*/
|
|
27
|
+
function resolveRequiresApproval(def, contract) {
|
|
28
|
+
return def.requiresApproval ?? contract.policies?.publishing !== "immediate";
|
|
29
|
+
}
|
|
30
|
+
function permsLabel(def, contract) {
|
|
31
|
+
const canPatch = def.canPatch === true;
|
|
32
|
+
const parts = [
|
|
33
|
+
canPatch ? pc.yellow("can patch") : pc.dim("read-only"),
|
|
34
|
+
canPatch
|
|
35
|
+
? resolveRequiresApproval(def, contract)
|
|
36
|
+
? pc.cyan("requires approval")
|
|
37
|
+
: pc.dim("auto-apply")
|
|
38
|
+
: null,
|
|
39
|
+
def.model ? pc.dim(`model: ${def.model}`) : null,
|
|
40
|
+
].filter(Boolean);
|
|
41
|
+
return parts.join(" ");
|
|
42
|
+
}
|
|
43
|
+
/** Extract a JSON findings array from a model response that may include prose/fences. */
|
|
44
|
+
function parseFindings(raw) {
|
|
45
|
+
const match = raw.match(/\[[\s\S]*\]/);
|
|
46
|
+
if (!match)
|
|
47
|
+
return [];
|
|
13
48
|
try {
|
|
14
|
-
|
|
15
|
-
|
|
49
|
+
const arr = JSON.parse(match[0]);
|
|
50
|
+
if (!Array.isArray(arr))
|
|
51
|
+
return [];
|
|
52
|
+
return arr.filter((f) => typeof f === "object" && f !== null);
|
|
16
53
|
}
|
|
17
54
|
catch {
|
|
18
|
-
return
|
|
55
|
+
return [];
|
|
19
56
|
}
|
|
20
57
|
}
|
|
21
58
|
// ── portal agent list ─────────────────────────────────────────────────────────
|
|
@@ -23,34 +60,21 @@ export async function agentListCommand() {
|
|
|
23
60
|
banner();
|
|
24
61
|
const root = process.cwd();
|
|
25
62
|
const agentsDir = join(root, "agents");
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
info("
|
|
29
|
-
|
|
30
|
-
return;
|
|
31
|
-
}
|
|
32
|
-
const entries = await readdir(agentsDir);
|
|
33
|
-
const agentFiles = entries.filter((f) => f.endsWith(".agent.ts") || f.endsWith(".agent.js"));
|
|
34
|
-
if (agentFiles.length === 0) {
|
|
35
|
-
info("agents/ directory is empty — no agents configured.");
|
|
63
|
+
const files = await findAgentFiles(agentsDir);
|
|
64
|
+
if (files.length === 0) {
|
|
65
|
+
info("No agents configured.");
|
|
66
|
+
info("Create agents/seo.agent.ts with defineAgent({ ... }) to get started.");
|
|
36
67
|
blank();
|
|
37
68
|
return;
|
|
38
69
|
}
|
|
70
|
+
const contract = await loadContract(root);
|
|
39
71
|
header("Configured Agents");
|
|
40
72
|
blank();
|
|
41
|
-
for (const file of
|
|
42
|
-
const
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
const canPatch = src.includes("canPatch: true");
|
|
47
|
-
const needsApproval = src.includes("requiresApproval: true");
|
|
48
|
-
const name = nameMatch?.[1] ?? basename(file, extname(file));
|
|
49
|
-
const task = taskMatch?.[1] ?? "No task description";
|
|
50
|
-
console.log(`${pc.bold(pc.cyan(name))} ${pc.dim("·")} ${pc.dim(file)}`);
|
|
51
|
-
console.log(` ${task}`);
|
|
52
|
-
console.log(` ${canPatch ? pc.yellow("can patch") : pc.dim("read-only")} ` +
|
|
53
|
-
`${needsApproval ? pc.cyan("requires approval") : pc.dim("auto-apply")}`);
|
|
73
|
+
for (const file of files) {
|
|
74
|
+
const def = await loadAgent(join(agentsDir, file));
|
|
75
|
+
console.log(`${pc.bold(pc.cyan(def.name))} ${pc.dim("·")} ${pc.dim(file)}`);
|
|
76
|
+
console.log(` ${def.task || pc.dim("No task description")}`);
|
|
77
|
+
console.log(` ${permsLabel(def, contract)}`);
|
|
54
78
|
blank();
|
|
55
79
|
}
|
|
56
80
|
}
|
|
@@ -60,48 +84,44 @@ export async function agentRunCommand(name) {
|
|
|
60
84
|
const root = process.cwd();
|
|
61
85
|
const agentsDir = join(root, "agents");
|
|
62
86
|
const contract = await loadContract(root);
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
const entries = await readdir(agentsDir);
|
|
67
|
-
agentFile =
|
|
68
|
-
entries.find((f) => f === `${name}.agent.ts` || f === `${name}.agent.js`) ?? null;
|
|
69
|
-
if (!agentFile) {
|
|
70
|
-
agentFile = entries.find((f) => f.includes(name)) ?? null;
|
|
71
|
-
}
|
|
72
|
-
}
|
|
73
|
-
catch {
|
|
74
|
-
fail("agents/ directory not found. Create an agent first.");
|
|
87
|
+
const files = await findAgentFiles(agentsDir);
|
|
88
|
+
if (files.length === 0) {
|
|
89
|
+
fail("No agents configured. Create agents/<name>.agent.ts first.");
|
|
75
90
|
process.exit(1);
|
|
76
91
|
}
|
|
92
|
+
const agentFile = matchAgentFile(files, name);
|
|
77
93
|
if (!agentFile) {
|
|
78
94
|
fail(`Agent not found: "${name}"`);
|
|
79
|
-
info(
|
|
95
|
+
info("Run portal agent list to see available agents.");
|
|
80
96
|
process.exit(1);
|
|
81
97
|
}
|
|
82
|
-
const
|
|
83
|
-
const
|
|
84
|
-
const
|
|
85
|
-
const task =
|
|
86
|
-
|
|
98
|
+
const def = await loadAgent(join(agentsDir, agentFile));
|
|
99
|
+
const canPatch = def.canPatch === true;
|
|
100
|
+
const requiresApproval = resolveRequiresApproval(def, contract);
|
|
101
|
+
const task = def.task || def.name;
|
|
102
|
+
const mode = !canPatch
|
|
103
|
+
? "read-only (analyze & report)"
|
|
104
|
+
: requiresApproval
|
|
105
|
+
? "propose patches (requires approval)"
|
|
106
|
+
: "auto-apply clean patches";
|
|
107
|
+
header(`Running agent: ${pc.bold(def.name)}`);
|
|
87
108
|
console.log(pc.dim(` Task: ${task}`));
|
|
88
109
|
console.log(pc.dim(` App: ${contract.name}`));
|
|
110
|
+
console.log(pc.dim(` Mode: ${mode}`));
|
|
89
111
|
blank();
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
}
|
|
94
|
-
catch {
|
|
95
|
-
fail("AIASSIST_API_KEY not set.");
|
|
112
|
+
// Agents need a model key to do any work — fail early and clearly.
|
|
113
|
+
if (!process.env["AIASSIST_API_KEY"] && !process.env["VITE_AIAS_API_KEY"]) {
|
|
114
|
+
fail("AIASSIST_API_KEY not set — agents need it to run.");
|
|
96
115
|
process.exit(1);
|
|
97
116
|
}
|
|
98
|
-
const
|
|
117
|
+
const runner = new Runner(def.model ? { model: def.model } : {});
|
|
118
|
+
const sentinel = new Sentinel(def.sentinel ? { model: def.sentinel } : {});
|
|
99
119
|
const store = new PatchStore(root);
|
|
100
|
-
//
|
|
120
|
+
// Gather route files to run the task against.
|
|
101
121
|
const routesDir = join(root, "routes");
|
|
102
122
|
let routeFiles = [];
|
|
103
123
|
try {
|
|
104
|
-
const entries = await readdir(routesDir, { recursive: true });
|
|
124
|
+
const entries = (await readdir(routesDir, { recursive: true }));
|
|
105
125
|
routeFiles = entries
|
|
106
126
|
.filter((f) => f.endsWith(".page.tsx") || f.endsWith(".page.jsx"))
|
|
107
127
|
.map((f) => join(routesDir, f));
|
|
@@ -110,52 +130,113 @@ export async function agentRunCommand(name) {
|
|
|
110
130
|
fail("No routes/ directory found.");
|
|
111
131
|
process.exit(1);
|
|
112
132
|
}
|
|
133
|
+
if (routeFiles.length === 0) {
|
|
134
|
+
info("No route files found under routes/.");
|
|
135
|
+
blank();
|
|
136
|
+
return;
|
|
137
|
+
}
|
|
113
138
|
const contractSummary = `App: ${contract.name}\nGoals: ${contract.goals.join("; ")}`;
|
|
114
|
-
let
|
|
139
|
+
let proposed = 0;
|
|
140
|
+
let applied = 0;
|
|
141
|
+
let reviewed = 0;
|
|
142
|
+
let findings = 0;
|
|
143
|
+
let firstError = null;
|
|
115
144
|
for (const filePath of routeFiles) {
|
|
116
145
|
const content = await readFile(filePath, "utf-8");
|
|
117
146
|
const rel = filePath.replace(root + "/", "");
|
|
118
147
|
const spinner = ora(` Processing ${rel}…`).start();
|
|
119
148
|
try {
|
|
120
|
-
|
|
149
|
+
// ── Read-only agent: analyze and report, never write. ───────────────────
|
|
150
|
+
if (!canPatch) {
|
|
151
|
+
const raw = await runner.analyzeFile({
|
|
152
|
+
filePath: rel,
|
|
153
|
+
content,
|
|
154
|
+
checks: [task],
|
|
155
|
+
contract: contractSummary,
|
|
156
|
+
});
|
|
157
|
+
spinner.stop();
|
|
158
|
+
reviewed++;
|
|
159
|
+
const notable = parseFindings(raw).filter((f) => f.status !== "pass");
|
|
160
|
+
if (notable.length === 0) {
|
|
161
|
+
step(`${rel} ${pc.dim("·")} ${pc.green("ok")}`);
|
|
162
|
+
}
|
|
163
|
+
else {
|
|
164
|
+
for (const f of notable) {
|
|
165
|
+
findings++;
|
|
166
|
+
const tag = f.status === "fail" ? pc.red("fail") : pc.yellow("warn");
|
|
167
|
+
step(`${rel} ${pc.dim("·")} ${tag} ${f.message ?? "issue found"}`);
|
|
168
|
+
if (f.suggestion)
|
|
169
|
+
console.log(pc.dim(` → ${f.suggestion}`));
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
continue;
|
|
173
|
+
}
|
|
174
|
+
// ── Patch-capable agent: generate, review, save / apply. ─────────────────
|
|
175
|
+
const next = await runner.generatePatch({
|
|
121
176
|
filePath: rel,
|
|
122
177
|
originalContent: content,
|
|
123
178
|
finding: task,
|
|
124
179
|
contract: contractSummary,
|
|
125
180
|
});
|
|
126
181
|
spinner.stop();
|
|
182
|
+
if (next.trim() === content.trim())
|
|
183
|
+
continue; // no meaningful change
|
|
127
184
|
const review = await sentinel.review({
|
|
128
185
|
contract,
|
|
129
186
|
filePath: rel,
|
|
130
187
|
original: content,
|
|
131
|
-
proposed,
|
|
188
|
+
proposed: next,
|
|
132
189
|
agentTask: task,
|
|
133
190
|
});
|
|
134
191
|
const patch = createPatch({
|
|
135
|
-
agent: name,
|
|
192
|
+
agent: def.name,
|
|
136
193
|
file: rel,
|
|
137
194
|
original: content,
|
|
138
|
-
proposed,
|
|
195
|
+
proposed: next,
|
|
139
196
|
reason: task,
|
|
140
|
-
requiresApproval
|
|
197
|
+
requiresApproval,
|
|
141
198
|
sentinelApproved: review.approved,
|
|
142
199
|
sentinelSummary: review.summary,
|
|
143
200
|
sentinelViolations: review.violations,
|
|
144
201
|
});
|
|
145
202
|
await store.save(patch);
|
|
146
|
-
|
|
147
|
-
|
|
203
|
+
proposed++;
|
|
204
|
+
// Auto-apply only when the agent permits it and the review is clean.
|
|
205
|
+
if (!requiresApproval && review.approved) {
|
|
206
|
+
await store.update(patch.id, { status: "approved" });
|
|
207
|
+
await applyPatch({ ...patch, status: "approved" }, root, store);
|
|
208
|
+
applied++;
|
|
209
|
+
step(`${rel} ${pc.dim("·")} ${pc.green("applied")} ${review.summary}`);
|
|
210
|
+
}
|
|
211
|
+
else {
|
|
212
|
+
step(`${rel} ${pc.dim("·")} ${pc.cyan("patch saved")} run portal patch to review`);
|
|
213
|
+
}
|
|
148
214
|
}
|
|
149
|
-
catch {
|
|
215
|
+
catch (err) {
|
|
150
216
|
spinner.stop();
|
|
217
|
+
if (!firstError)
|
|
218
|
+
firstError = err instanceof Error ? err.message : String(err);
|
|
151
219
|
}
|
|
152
220
|
}
|
|
153
221
|
blank();
|
|
154
|
-
if (
|
|
155
|
-
|
|
222
|
+
if (firstError)
|
|
223
|
+
fail(`Some files could not be processed: ${firstError}`);
|
|
224
|
+
if (!canPatch) {
|
|
225
|
+
if (findings > 0) {
|
|
226
|
+
info(`Read-only run complete — ${reviewed} file${reviewed !== 1 ? "s" : ""} reviewed, ${findings} finding${findings !== 1 ? "s" : ""} reported.`);
|
|
227
|
+
}
|
|
228
|
+
else {
|
|
229
|
+
success(`Read-only run complete — ${reviewed} file${reviewed !== 1 ? "s" : ""} reviewed, no issues found.`);
|
|
230
|
+
}
|
|
231
|
+
}
|
|
232
|
+
else if (proposed === 0) {
|
|
233
|
+
info("No changes proposed.");
|
|
234
|
+
}
|
|
235
|
+
else if (applied > 0) {
|
|
236
|
+
success(`${applied} applied, ${proposed - applied} pending — run portal patch to review the rest.`);
|
|
156
237
|
}
|
|
157
238
|
else {
|
|
158
|
-
|
|
239
|
+
success(`${proposed} patch${proposed !== 1 ? "es" : ""} queued — run portal patch to review and apply.`);
|
|
159
240
|
}
|
|
160
241
|
blank();
|
|
161
242
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"agent-cmd.js","sourceRoot":"","sources":["../../src/commands/agent-cmd.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version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AE,IAAI,CAAC,sCAAsC,UAAU,EAAE,CAAC,CAAC;IAEzE,IAAI,CAAC,QAAQ,EAAE,CAAC;QACd,IAAI,QAAQ,GAAG,CAAC,EAAE,CAAC;YACjB,IAAI,CAAC,4BAA4B,QAAQ,QAAQ,QAAQ,KAAK,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,cAAc,QAAQ,WAAW,QAAQ,KAAK,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,YAAY,CAAC,CAAC;QACpJ,CAAC;aAAM,CAAC;YACN,OAAO,CAAC,4BAA4B,QAAQ,QAAQ,QAAQ,KAAK,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,6BAA6B,CAAC,CAAC;QAC9G,CAAC;IACH,CAAC;SAAM,IAAI,QAAQ,KAAK,CAAC,EAAE,CAAC;QAC1B,IAAI,CAAC,sBAAsB,CAAC,CAAC;IAC/B,CAAC;SAAM,IAAI,OAAO,GAAG,CAAC,EAAE,CAAC;QACvB,OAAO,CAAC,GAAG,OAAO,aAAa,QAAQ,GAAG,OAAO,iDAAiD,CAAC,CAAC;IACtG,CAAC;SAAM,CAAC;QACN,OAAO,CAAC,GAAG,QAAQ,SAAS,QAAQ,KAAK,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,iDAAiD,CAAC,CAAC;IAC3G,CAAC;IACD,KAAK,EAAE,CAAC;AACV,CAAC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Load agent definitions from a Portal project's agents/ directory.
|
|
3
|
+
*
|
|
4
|
+
* Mirrors the contract loader's philosophy (see utils/contract.ts): we extract
|
|
5
|
+
* the `defineAgent({ ... })` object literal and evaluate just that object rather
|
|
6
|
+
* than executing the whole module. AgentDefinition is a flat object, so this is
|
|
7
|
+
* safe and predictable.
|
|
8
|
+
*/
|
|
9
|
+
import type { AgentDefinition } from "@interchained/portal-contract";
|
|
10
|
+
export declare function agentsDirExists(agentsDir: string): Promise<boolean>;
|
|
11
|
+
/** List the *.agent.ts / *.agent.js files in agents/. */
|
|
12
|
+
export declare function findAgentFiles(agentsDir: string): Promise<string[]>;
|
|
13
|
+
/**
|
|
14
|
+
* Resolve a user-supplied name to an agent file.
|
|
15
|
+
* Prefers an exact `<name>.agent.{ts,js}` match, then a substring match.
|
|
16
|
+
*/
|
|
17
|
+
export declare function matchAgentFile(files: string[], name: string): string | null;
|
|
18
|
+
/** Load and parse a single agent definition file. */
|
|
19
|
+
export declare function loadAgent(filePath: string): Promise<AgentDefinition>;
|
|
20
|
+
//# sourceMappingURL=agents.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"agents.d.ts","sourceRoot":"","sources":["../../src/utils/agents.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAIH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAC;AAErE,wBAAsB,eAAe,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAEzE;AAED,yDAAyD;AACzD,wBAAsB,cAAc,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC,CASzE;AAED;;;GAGG;AACH,wBAAgB,cAAc,CAAC,KAAK,EAAE,MAAM,EAAE,EAAE,IAAI,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAM3E;AAED,qDAAqD;AACrD,wBAAsB,SAAS,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,eAAe,CAAC,CA2B1E"}
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Load agent definitions from a Portal project's agents/ directory.
|
|
3
|
+
*
|
|
4
|
+
* Mirrors the contract loader's philosophy (see utils/contract.ts): we extract
|
|
5
|
+
* the `defineAgent({ ... })` object literal and evaluate just that object rather
|
|
6
|
+
* than executing the whole module. AgentDefinition is a flat object, so this is
|
|
7
|
+
* safe and predictable.
|
|
8
|
+
*/
|
|
9
|
+
import { readFile, readdir, access } from "node:fs/promises";
|
|
10
|
+
import { basename, extname } from "node:path";
|
|
11
|
+
export async function agentsDirExists(agentsDir) {
|
|
12
|
+
try {
|
|
13
|
+
await access(agentsDir);
|
|
14
|
+
return true;
|
|
15
|
+
}
|
|
16
|
+
catch {
|
|
17
|
+
return false;
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
/** List the *.agent.ts / *.agent.js files in agents/. */
|
|
21
|
+
export async function findAgentFiles(agentsDir) {
|
|
22
|
+
try {
|
|
23
|
+
const entries = await readdir(agentsDir);
|
|
24
|
+
return entries
|
|
25
|
+
.filter((f) => f.endsWith(".agent.ts") || f.endsWith(".agent.js"))
|
|
26
|
+
.sort();
|
|
27
|
+
}
|
|
28
|
+
catch {
|
|
29
|
+
return [];
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* Resolve a user-supplied name to an agent file.
|
|
34
|
+
* Prefers an exact `<name>.agent.{ts,js}` match, then a substring match.
|
|
35
|
+
*/
|
|
36
|
+
export function matchAgentFile(files, name) {
|
|
37
|
+
return (files.find((f) => f === `${name}.agent.ts` || f === `${name}.agent.js`) ??
|
|
38
|
+
files.find((f) => f.includes(name)) ??
|
|
39
|
+
null);
|
|
40
|
+
}
|
|
41
|
+
/** Load and parse a single agent definition file. */
|
|
42
|
+
export async function loadAgent(filePath) {
|
|
43
|
+
const fallbackName = basename(filePath, extname(filePath)).replace(/\.agent$/, "");
|
|
44
|
+
let src;
|
|
45
|
+
try {
|
|
46
|
+
src = await readFile(filePath, "utf-8");
|
|
47
|
+
}
|
|
48
|
+
catch {
|
|
49
|
+
return { name: fallbackName, task: "" };
|
|
50
|
+
}
|
|
51
|
+
// Extraction patterns, most specific first.
|
|
52
|
+
const objSrc = src.match(/defineAgent\s*\(\s*(\{[\s\S]*?\})\s*\)/)?.[1] ??
|
|
53
|
+
src.match(/export\s+default\s+(\{[\s\S]*\})\s*;?\s*$/)?.[1] ??
|
|
54
|
+
src.match(/const\s+\w+\s*(?::\s*AgentDefinition)?\s*=\s*(\{[\s\S]*?\})\s*;?\s*$/m)?.[1];
|
|
55
|
+
if (!objSrc)
|
|
56
|
+
return { name: fallbackName, task: "" };
|
|
57
|
+
try {
|
|
58
|
+
const def = evalAgentObject(objSrc);
|
|
59
|
+
return {
|
|
60
|
+
...def,
|
|
61
|
+
name: typeof def.name === "string" && def.name.trim() ? def.name : fallbackName,
|
|
62
|
+
task: typeof def.task === "string" ? def.task : "",
|
|
63
|
+
};
|
|
64
|
+
}
|
|
65
|
+
catch {
|
|
66
|
+
return { name: fallbackName, task: "" };
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
function evalAgentObject(src) {
|
|
70
|
+
const cleaned = src
|
|
71
|
+
.replace(/\s+as\s+\w[\w.]*(\[\])?/g, "")
|
|
72
|
+
.replace(/\s+satisfies\s+\w[\w.]*/g, "");
|
|
73
|
+
const fn = new Function(`return (${cleaned})`);
|
|
74
|
+
const raw = fn();
|
|
75
|
+
if (typeof raw !== "object" || raw === null) {
|
|
76
|
+
throw new Error("agent file must export a defineAgent({ ... }) object");
|
|
77
|
+
}
|
|
78
|
+
return raw;
|
|
79
|
+
}
|
|
80
|
+
//# sourceMappingURL=agents.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"agents.js","sourceRoot":"","sources":["../../src/utils/agents.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAC7D,OAAO,EAAQ,QAAQ,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAGpD,MAAM,CAAC,KAAK,UAAU,eAAe,CAAC,SAAiB;IACrD,IAAI,CAAC;QAAC,MAAM,MAAM,CAAC,SAAS,CAAC,CAAC;QAAC,OAAO,IAAI,CAAC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