@parcha/agentrun-serve 0.1.0-beta.53 → 0.1.0-beta.54
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/CHANGELOG.md +29 -2
- package/README.md +82 -13
- package/dist/agent-package.js +1 -1
- package/dist/agent-rows.d.ts +1 -1
- package/dist/agents-store.js +1 -1
- package/dist/api-only.d.ts +1 -2
- package/dist/api-only.js +1 -2
- package/dist/cli.js +6 -1
- package/dist/composio-preset.d.ts +3 -2
- package/dist/composio-preset.js +4 -3
- package/dist/computer-needs.d.ts +1 -1
- package/dist/computer-needs.js +1 -1
- package/dist/computer-setting.d.ts +4 -2
- package/dist/computers.d.ts +0 -2
- package/dist/computers.js +1 -1
- package/dist/console/assets/index-B_85An2t.js +745 -0
- package/dist/console/assets/index-n1YsbnYh.css +1 -0
- package/dist/console/index.html +2 -2
- package/dist/errors.d.ts +4 -0
- package/dist/errors.js +7 -0
- package/dist/github-connection.d.ts +50 -1
- package/dist/github-connection.js +96 -3
- package/dist/github-faux.d.ts +11 -2
- package/dist/github-faux.js +138 -7
- package/dist/github-pull-request.d.ts +37 -0
- package/dist/github-pull-request.js +110 -0
- package/dist/live-reach.d.ts +34 -7
- package/dist/live-reach.js +76 -11
- package/dist/mcp-probe.js +2 -2
- package/dist/openapi.js +108 -4
- package/dist/runner/adapter-run-spec.js +1 -1
- package/dist/runner/cli-run-spec.js +1 -1
- package/dist/runner/metrics.d.ts +4 -2
- package/dist/runner/metrics.js +15 -3
- package/dist/runner/pr-checkout.d.ts +21 -4
- package/dist/runner/pr-checkout.js +103 -4
- package/dist/runner/run-child-host.js +7 -4
- package/dist/runner/runner-check.d.ts +3 -0
- package/dist/runner/runner-check.js +23 -0
- package/dist/server.d.ts +11 -0
- package/dist/server.js +80 -10
- package/dist/store/agent-body.d.ts +2 -2
- package/dist/store/agent-body.js +2 -2
- package/dist/suggestions.d.ts +282 -0
- package/dist/suggestions.js +919 -0
- package/dist/telemetry.d.ts +8 -1
- package/dist/telemetry.js +12 -4
- package/dist/template-import.d.ts +17 -0
- package/dist/template-import.js +32 -0
- package/dist/templates.d.ts +78 -73
- package/dist/templates.js +10 -8
- package/dist/trigger-launch-hook.d.ts +5 -3
- package/dist/trigger-launch-hook.js +5 -4
- package/dist/triggers.js +1 -1
- package/dist/validate.d.ts +1 -1
- package/dist/validate.js +2 -2
- package/dist/workspace/synced-folder.d.ts +1 -1
- package/dist/workspace/synced-folder.js +11 -14
- package/launcher/agentrun-serve +1 -1
- package/package.json +10 -10
- package/templates/README.md +3 -2
- package/templates/agent-scout/agent.md +46 -0
- package/templates/agent-scout/skills/scout/SKILL.md +88 -0
- package/templates/agent-scout/skills/scout/suggestions.schema.json +112 -0
- package/dist/console/assets/index-BFgyZzF_.js +0 -734
- package/dist/console/assets/index-DbilxljH.css +0 -1
package/dist/telemetry.d.ts
CHANGED
|
@@ -7,7 +7,11 @@ export declare const TELEMETRY_FILE = ".telemetry.json";
|
|
|
7
7
|
/** How often a running server says it still runs. */
|
|
8
8
|
export declare const HEARTBEAT_MS: number;
|
|
9
9
|
export declare const TELEMETRY_NOTICE = "AgentRun sends anonymous usage counts (a random id, the version, the platform, how many runs as a range): never prompts, files, keys or names. Nothing was sent at this start. Turn it off with AGENTRUN_TELEMETRY=0 or DO_NOT_TRACK=1. Every field: https://github.com/Parcha-ai/agentrun/blob/main/docs/telemetry.md";
|
|
10
|
-
|
|
10
|
+
/** What someone did with suggested agents (suggestions.ts), said as the name alone: never which repository, suggestion
|
|
11
|
+
* or agent. */
|
|
12
|
+
export type UsageEventName = "suggestions_scanned" | "suggestion_discarded" | "suggested_agent_created";
|
|
13
|
+
export declare const USAGE_EVENTS: readonly UsageEventName[];
|
|
14
|
+
export type TelemetryEventName = "server_started" | "heartbeat" | "first_run_completed" | UsageEventName;
|
|
11
15
|
/** One event, as sent (and as debug prints it). `runs` is a range, never a count. */
|
|
12
16
|
export interface TelemetryEvent {
|
|
13
17
|
api_key: string;
|
|
@@ -39,6 +43,9 @@ export interface Telemetry {
|
|
|
39
43
|
notice?: string;
|
|
40
44
|
/** A run reached its end here. `status` is the runner's (`ended` is a completed run). */
|
|
41
45
|
runEnded(status: string): void;
|
|
46
|
+
/** Someone used a feature the counts name: said at once, except during the start that printed the notice, until its
|
|
47
|
+
* first heartbeat, when it is dropped (never held for later). A name not in USAGE_EVENTS is never sent. */
|
|
48
|
+
used(event: UsageEventName): void;
|
|
42
49
|
/** Stops the heartbeat and waits for the count's last write. Sends nothing. */
|
|
43
50
|
close(): Promise<void>;
|
|
44
51
|
}
|
package/dist/telemetry.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
// Anonymous usage counts (docs/telemetry.md): that a server started, that it is still running a day later,
|
|
2
|
-
// first run completed
|
|
3
|
-
//
|
|
1
|
+
// Anonymous usage counts (docs/telemetry.md): that a server started, that it is still running a day later, that its
|
|
2
|
+
// first run completed, and that someone used suggested agents (a scan started, a suggestion discarded, a suggested
|
|
3
|
+
// agent's pull request opened). Each event holds a random id made for this data directory, the server's version, the
|
|
4
|
+
// platform, and how many runs ended here as a range. It never holds a prompt, a workflow, a key, a name, a path or an address.
|
|
4
5
|
//
|
|
5
6
|
// Off with AGENTRUN_TELEMETRY=0 or DO_NOT_TRACK=1, in CI, under a test runner, and under --faux. The start that first could send prints one
|
|
6
7
|
// notice and sends nothing at its start, so a person reads how to turn it off before anything leaves the machine.
|
|
@@ -24,6 +25,7 @@ export const HEARTBEAT_MS = 24 * 60 * 60 * 1000;
|
|
|
24
25
|
const SEND_TIMEOUT_MS = 3_000;
|
|
25
26
|
const ownVersion = () => JSON.parse(readFileSync(new URL("../package.json", import.meta.url), "utf8")).version;
|
|
26
27
|
export const TELEMETRY_NOTICE = "AgentRun sends anonymous usage counts (a random id, the version, the platform, how many runs as a range): never prompts, files, keys or names. Nothing was sent at this start. Turn it off with AGENTRUN_TELEMETRY=0 or DO_NOT_TRACK=1. Every field: https://github.com/Parcha-ai/agentrun/blob/main/docs/telemetry.md";
|
|
28
|
+
export const USAGE_EVENTS = ["suggestions_scanned", "suggestion_discarded", "suggested_agent_created"];
|
|
27
29
|
const OFF = new Set(["0", "false", "off", "no"]);
|
|
28
30
|
/** What this start does, from its environment (docs/telemetry.md). */
|
|
29
31
|
export function telemetryMode(env, o = {}) {
|
|
@@ -68,7 +70,7 @@ export function startTelemetry(o) {
|
|
|
68
70
|
const env = o.env ?? process.env;
|
|
69
71
|
const key = o.key ?? TELEMETRY_KEY;
|
|
70
72
|
const mode = telemetryMode(env, { ...(o.faux ? { faux: true } : {}), key });
|
|
71
|
-
const idle = { mode, runEnded: () => { }, close: () => Promise.resolve() };
|
|
73
|
+
const idle = { mode, runEnded: () => { }, used: () => { }, close: () => Promise.resolve() };
|
|
72
74
|
if (mode !== "on" && mode !== "debug")
|
|
73
75
|
return idle;
|
|
74
76
|
const file = join(o.data, TELEMETRY_FILE);
|
|
@@ -171,6 +173,12 @@ export function startTelemetry(o) {
|
|
|
171
173
|
if (completed && !holding)
|
|
172
174
|
emit("first_run_completed");
|
|
173
175
|
},
|
|
176
|
+
used(event) {
|
|
177
|
+
// The notice's start sends nothing before its first heartbeat; a feature used then is not counted at all.
|
|
178
|
+
if (holding || !USAGE_EVENTS.includes(event))
|
|
179
|
+
return;
|
|
180
|
+
emit(event);
|
|
181
|
+
},
|
|
174
182
|
close: () => (clearInterval(beat), writing ?? Promise.resolve()),
|
|
175
183
|
};
|
|
176
184
|
}
|
|
@@ -34,6 +34,23 @@ export declare function importTemplate(deps: TemplateImportDeps, raw: unknown, s
|
|
|
34
34
|
trusted: boolean;
|
|
35
35
|
replaced: string | null;
|
|
36
36
|
}>;
|
|
37
|
+
/** A package made into an agent here as an imported template, from files this server wrote itself (a suggested agent's,
|
|
38
|
+
* suggestions.ts): checked, kept, then applied. Once `apply` has made the agent nothing after it can fail (the registry
|
|
39
|
+
* is in memory), so a thrown error always means no agent was made, which is what Suggestions.create reads it as. An
|
|
40
|
+
* apply refused (a missing model key, say) takes the kept package back as it was before (removed, or the earlier one),
|
|
41
|
+
* but only while the row is still the one this call kept: an import of the same id meanwhile (POST /v2/templates/import)
|
|
42
|
+
* stands. */
|
|
43
|
+
export declare function applyImported<T>(deps: {
|
|
44
|
+
registry: Pick<TemplateRegistry, "put">;
|
|
45
|
+
store: {
|
|
46
|
+
importedTemplates: Pick<Store["importedTemplates"], "list" | "put" | "remove">;
|
|
47
|
+
};
|
|
48
|
+
apply: (pkg: Package) => Promise<T>;
|
|
49
|
+
}, id: string, origin: {
|
|
50
|
+
source: string;
|
|
51
|
+
sha: string;
|
|
52
|
+
publisher: string;
|
|
53
|
+
}, files: ReadonlyMap<string, Buffer>): Promise<T>;
|
|
37
54
|
/** DELETE /v2/templates/{id}: an imported package removed from the store and the registry. A bundled one is 403; none of
|
|
38
55
|
* that id, 404. Agents applied from it stay. */
|
|
39
56
|
export declare function deleteTemplate(deps: Pick<TemplateImportDeps, "registry" | "store">, id: string): Promise<void>;
|
package/dist/template-import.js
CHANGED
|
@@ -211,6 +211,38 @@ export async function importTemplate(deps, raw, signal) {
|
|
|
211
211
|
deps.registry.put(pkg);
|
|
212
212
|
return { status: 201, pkg, trusted: true, replaced };
|
|
213
213
|
}
|
|
214
|
+
/** A package made into an agent here as an imported template, from files this server wrote itself (a suggested agent's,
|
|
215
|
+
* suggestions.ts): checked, kept, then applied. Once `apply` has made the agent nothing after it can fail (the registry
|
|
216
|
+
* is in memory), so a thrown error always means no agent was made, which is what Suggestions.create reads it as. An
|
|
217
|
+
* apply refused (a missing model key, say) takes the kept package back as it was before (removed, or the earlier one),
|
|
218
|
+
* but only while the row is still the one this call kept: an import of the same id meanwhile (POST /v2/templates/import)
|
|
219
|
+
* stands. */
|
|
220
|
+
export async function applyImported(deps, id, origin, files) {
|
|
221
|
+
const pkg = importedPackage(id, origin, files);
|
|
222
|
+
const templates = deps.store.importedTemplates;
|
|
223
|
+
const row = async () => (await templates.list()).find((one) => one.id === pkg.id);
|
|
224
|
+
const before = await row();
|
|
225
|
+
await templates.put({ id: pkg.id, source: origin.source, sha: origin.sha, publisher: origin.publisher, files: Object.fromEntries([...files].map(([path, data]) => [path, data.toString("base64")])) });
|
|
226
|
+
// The row as this call kept it, stamped by the store: the undo below touches it only while it is still this one.
|
|
227
|
+
const kept = await row();
|
|
228
|
+
let made;
|
|
229
|
+
try {
|
|
230
|
+
made = await deps.apply(pkg);
|
|
231
|
+
}
|
|
232
|
+
catch (error) {
|
|
233
|
+
const now = await row().catch(() => undefined);
|
|
234
|
+
const ours = kept !== undefined && now !== undefined && now.importedAt === kept.importedAt && now.sha === kept.sha && now.source === kept.source;
|
|
235
|
+
if (ours) {
|
|
236
|
+
const undo = before
|
|
237
|
+
? templates.put({ id: before.id, source: before.source, sha: before.sha, publisher: before.publisher, files: before.files })
|
|
238
|
+
: templates.remove(pkg.id).then(() => undefined);
|
|
239
|
+
await undo.catch(() => { });
|
|
240
|
+
}
|
|
241
|
+
throw error;
|
|
242
|
+
}
|
|
243
|
+
deps.registry.put(pkg);
|
|
244
|
+
return made;
|
|
245
|
+
}
|
|
214
246
|
/** DELETE /v2/templates/{id}: an imported package removed from the store and the registry. A bundled one is 403; none of
|
|
215
247
|
* that id, 404. Agents applied from it stay. */
|
|
216
248
|
export async function deleteTemplate(deps, id) {
|
package/dist/templates.d.ts
CHANGED
|
@@ -137,8 +137,9 @@ export type Package = {
|
|
|
137
137
|
bash: BashPolicy;
|
|
138
138
|
};
|
|
139
139
|
/** What the server checks out in each run's folder before its first turn (the definition's `checkout`,
|
|
140
|
-
* runner/pr-checkout.ts): the pull request the run's GitHub event names
|
|
141
|
-
|
|
140
|
+
* runner/pr-checkout.ts): the pull request the run's GitHub event names, or the default branch of the repository the
|
|
141
|
+
* run names. */
|
|
142
|
+
checkout?: "pull_request" | "repository";
|
|
142
143
|
/** The setup an apply takes (manifest `parameters`), compiled as `inputs` are (fieldsSchema): a closed object schema,
|
|
143
144
|
* with no properties when the package names none. */
|
|
144
145
|
parameters: Json;
|
|
@@ -286,7 +287,7 @@ export declare function packageView(p: Package): {
|
|
|
286
287
|
} | null;
|
|
287
288
|
computer: ("none" | "shell")[] | null;
|
|
288
289
|
needs: string[] | null;
|
|
289
|
-
checkout: "pull_request" | null;
|
|
290
|
+
checkout: "pull_request" | "repository" | null;
|
|
290
291
|
mcp: {
|
|
291
292
|
source: "url" | "github" | "composio";
|
|
292
293
|
toolkit: string;
|
|
@@ -312,80 +313,84 @@ export declare function packageView(p: Package): {
|
|
|
312
313
|
skills: string[];
|
|
313
314
|
evals: string[];
|
|
314
315
|
};
|
|
315
|
-
/** A package as an import
|
|
316
|
-
*
|
|
317
|
-
*
|
|
318
|
-
|
|
316
|
+
/** A package whole, as an import and a read of one answer it: its listing with the computer it would get here
|
|
317
|
+
* (`computerHere`), and every text its agent would be given, the instructions and each skill file by path (a rule and
|
|
318
|
+
* the answer's schema beside each SKILL.md among them), so a person reads what a package would tell their agent before
|
|
319
|
+
* it is applied. */
|
|
320
|
+
export declare function packageDetail<Pick>(p: Package, computerHere: (p: Package) => Pick): {
|
|
321
|
+
template: {
|
|
322
|
+
computer_here: Pick;
|
|
323
|
+
id: string;
|
|
324
|
+
bundled: boolean;
|
|
325
|
+
source: string | null;
|
|
326
|
+
sha: string | null;
|
|
327
|
+
publisher: string | null;
|
|
328
|
+
name: string;
|
|
329
|
+
display_name: string | null;
|
|
330
|
+
version: string;
|
|
331
|
+
description: string;
|
|
332
|
+
license: string | null;
|
|
333
|
+
author: Json | null;
|
|
334
|
+
repository: string | null;
|
|
335
|
+
category: "engineering" | "security" | "sales" | "marketing" | "research" | "finance" | "operations" | "compliance" | "personal" | null;
|
|
336
|
+
tags: string[];
|
|
337
|
+
output: {
|
|
338
|
+
schema: string;
|
|
339
|
+
json_schema: Json | null;
|
|
340
|
+
} | null;
|
|
341
|
+
harness: string[] | null;
|
|
342
|
+
model: {
|
|
343
|
+
choices?: {
|
|
344
|
+
id: string;
|
|
345
|
+
label: string;
|
|
346
|
+
model: string;
|
|
347
|
+
harness: string;
|
|
348
|
+
warning: string | null;
|
|
349
|
+
note: string | null;
|
|
350
|
+
secrets: string[];
|
|
351
|
+
}[] | undefined;
|
|
352
|
+
tier: string;
|
|
353
|
+
prefer?: string;
|
|
354
|
+
fast?: string;
|
|
355
|
+
strong?: string;
|
|
356
|
+
} | null;
|
|
357
|
+
effort: string | null;
|
|
358
|
+
tools: string[] | null;
|
|
359
|
+
tool_policy: {
|
|
360
|
+
bash: BashPolicy;
|
|
361
|
+
} | null;
|
|
362
|
+
computer: ("none" | "shell")[] | null;
|
|
363
|
+
needs: string[] | null;
|
|
364
|
+
checkout: "pull_request" | "repository" | null;
|
|
365
|
+
mcp: {
|
|
366
|
+
source: "url" | "github" | "composio";
|
|
367
|
+
toolkit: string;
|
|
368
|
+
required: boolean;
|
|
369
|
+
reason: string | null;
|
|
370
|
+
tools: {
|
|
371
|
+
pin?: Record<string, PinValue> | undefined;
|
|
372
|
+
name: string;
|
|
373
|
+
tool: string;
|
|
374
|
+
asks: string;
|
|
375
|
+
}[];
|
|
376
|
+
}[];
|
|
377
|
+
parameters: Json;
|
|
378
|
+
input_schema: Json | null;
|
|
379
|
+
secrets: string[];
|
|
380
|
+
budget: {
|
|
381
|
+
per_run_usd: number;
|
|
382
|
+
max_requests?: number;
|
|
383
|
+
} | null;
|
|
384
|
+
learning: LearningSetting;
|
|
385
|
+
approvals_default: "ask" | "never";
|
|
386
|
+
triggers: Json[];
|
|
387
|
+
skills: string[];
|
|
388
|
+
evals: string[];
|
|
389
|
+
};
|
|
319
390
|
instructions: string;
|
|
320
391
|
skill_files: {
|
|
321
392
|
[x: string]: string;
|
|
322
393
|
};
|
|
323
|
-
id: string;
|
|
324
|
-
bundled: boolean;
|
|
325
|
-
source: string | null;
|
|
326
|
-
sha: string | null;
|
|
327
|
-
publisher: string | null;
|
|
328
|
-
name: string;
|
|
329
|
-
display_name: string | null;
|
|
330
|
-
version: string;
|
|
331
|
-
description: string;
|
|
332
|
-
license: string | null;
|
|
333
|
-
author: Json | null;
|
|
334
|
-
repository: string | null;
|
|
335
|
-
category: "engineering" | "security" | "sales" | "marketing" | "research" | "finance" | "operations" | "compliance" | "personal" | null;
|
|
336
|
-
tags: string[];
|
|
337
|
-
output: {
|
|
338
|
-
schema: string;
|
|
339
|
-
json_schema: Json | null;
|
|
340
|
-
} | null;
|
|
341
|
-
harness: string[] | null;
|
|
342
|
-
model: {
|
|
343
|
-
choices?: {
|
|
344
|
-
id: string;
|
|
345
|
-
label: string;
|
|
346
|
-
model: string;
|
|
347
|
-
harness: string;
|
|
348
|
-
warning: string | null;
|
|
349
|
-
note: string | null;
|
|
350
|
-
secrets: string[];
|
|
351
|
-
}[] | undefined;
|
|
352
|
-
tier: string;
|
|
353
|
-
prefer?: string;
|
|
354
|
-
fast?: string;
|
|
355
|
-
strong?: string;
|
|
356
|
-
} | null;
|
|
357
|
-
effort: string | null;
|
|
358
|
-
tools: string[] | null;
|
|
359
|
-
tool_policy: {
|
|
360
|
-
bash: BashPolicy;
|
|
361
|
-
} | null;
|
|
362
|
-
computer: ("none" | "shell")[] | null;
|
|
363
|
-
needs: string[] | null;
|
|
364
|
-
checkout: "pull_request" | null;
|
|
365
|
-
mcp: {
|
|
366
|
-
source: "url" | "github" | "composio";
|
|
367
|
-
toolkit: string;
|
|
368
|
-
required: boolean;
|
|
369
|
-
reason: string | null;
|
|
370
|
-
tools: {
|
|
371
|
-
pin?: Record<string, PinValue> | undefined;
|
|
372
|
-
name: string;
|
|
373
|
-
tool: string;
|
|
374
|
-
asks: string;
|
|
375
|
-
}[];
|
|
376
|
-
}[];
|
|
377
|
-
parameters: Json;
|
|
378
|
-
input_schema: Json | null;
|
|
379
|
-
secrets: string[];
|
|
380
|
-
budget: {
|
|
381
|
-
per_run_usd: number;
|
|
382
|
-
max_requests?: number;
|
|
383
|
-
} | null;
|
|
384
|
-
learning: LearningSetting;
|
|
385
|
-
approvals_default: "ask" | "never";
|
|
386
|
-
triggers: Json[];
|
|
387
|
-
skills: string[];
|
|
388
|
-
evals: string[];
|
|
389
394
|
};
|
|
390
395
|
/** The packages this server serves: the ones it ships, read at its start, and the ones imported here (the store keeps
|
|
391
396
|
* them; the server loads them beside the bundled ones at its start). An id is one package; a bundled one is never
|
package/dist/templates.js
CHANGED
|
@@ -712,8 +712,9 @@ export function readPackage(from, { evalFixtures = true } = {}) {
|
|
|
712
712
|
needs = [...f.needs];
|
|
713
713
|
}
|
|
714
714
|
// The server's checkout before each run's first turn: the pull request the run's GitHub event names, at its head.
|
|
715
|
-
|
|
716
|
-
|
|
715
|
+
// Or the head of the default branch of the repository the run names.
|
|
716
|
+
if (f.checkout !== undefined && f.checkout !== "pull_request" && f.checkout !== "repository")
|
|
717
|
+
bad(MANIFEST, "checkout is pull_request or repository: the server checks out, in repo/ before the first turn, the pull request the run's GitHub event names (at its head), or the head of the default branch of the repository the run names");
|
|
717
718
|
// The setup an apply takes, in the inputs' grammar, by the same compiler; none, a schema of no fields.
|
|
718
719
|
const parameters = fieldsSchema(f.parameters, "parameters", (message) => bad(MANIFEST, message)) ?? { type: "object", additionalProperties: false, properties: {} };
|
|
719
720
|
const fields = fieldsOf(parameters);
|
|
@@ -974,7 +975,7 @@ export function readPackage(from, { evalFixtures = true } = {}) {
|
|
|
974
975
|
...(typeof f.license === "string" ? { license: f.license } : {}), ...(isObject(f.author) ? { author: f.author } : {}), ...(typeof f.repository === "string" ? { repository: f.repository } : {}),
|
|
975
976
|
...(typeof f.category === "string" ? { category: f.category } : {}), tags,
|
|
976
977
|
...(harness ? { harness } : {}), ...(isObject(f.model) ? { model: { ...f.model, ...(choices ? { choices } : {}) } } : {}), ...(typeof f.effort === "string" ? { effort: f.effort } : {}),
|
|
977
|
-
...(tools ? { tools } : {}), mcp, ...(computer ? { computer } : {}), ...(needs ? { needs } : {}), ...(toolPolicy ? { toolPolicy } : {}), ...(f.checkout === "pull_request" ? { checkout:
|
|
978
|
+
...(tools ? { tools } : {}), mcp, ...(computer ? { computer } : {}), ...(needs ? { needs } : {}), ...(toolPolicy ? { toolPolicy } : {}), ...(f.checkout === "pull_request" || f.checkout === "repository" ? { checkout: f.checkout } : {}), parameters, ...(inputSchema ? { inputSchema } : {}), secrets, ...(isObject(f.budget) ? { budget: { per_run_usd: f.budget.per_run_usd, ...(f.budget.max_requests !== undefined ? { max_requests: f.budget.max_requests } : {}) } } : {}), ...(f.learning !== undefined ? { learning: learningSettingOf(f.learning) } : {}), ...(f.approvals === "ask" || f.approvals === "never" ? { approvals: f.approvals } : {}),
|
|
978
979
|
triggers: triggers, ...(isObject(f.output) ? { output: { schema: f.output.schema } } : {}), ...(isObject(outputSchema) ? { outputSchema } : {}), instructions, skills, ...(ruleNames.length ? { rules: ruleNames.sort() } : {}), evals,
|
|
979
980
|
};
|
|
980
981
|
// What an apply makes, made here with each parameter's default, else a sample of its type, and checked as POST
|
|
@@ -1065,11 +1066,12 @@ function modelView(model) {
|
|
|
1065
1066
|
const { choices, ...rest } = model;
|
|
1066
1067
|
return { ...rest, ...(choices ? { choices: choices.map(({ id, label, model: ref, harness, warning, note, secrets }) => ({ id, label, model: ref, harness, warning: warning ?? null, note: note ?? null, secrets })) } : {}) };
|
|
1067
1068
|
}
|
|
1068
|
-
/** A package as an import
|
|
1069
|
-
*
|
|
1070
|
-
*
|
|
1071
|
-
|
|
1072
|
-
|
|
1069
|
+
/** A package whole, as an import and a read of one answer it: its listing with the computer it would get here
|
|
1070
|
+
* (`computerHere`), and every text its agent would be given, the instructions and each skill file by path (a rule and
|
|
1071
|
+
* the answer's schema beside each SKILL.md among them), so a person reads what a package would tell their agent before
|
|
1072
|
+
* it is applied. */
|
|
1073
|
+
export function packageDetail(p, computerHere) {
|
|
1074
|
+
return { template: { ...packageView(p), computer_here: computerHere(p) }, instructions: p.instructions, skill_files: { ...p.skills } };
|
|
1073
1075
|
}
|
|
1074
1076
|
/** The packages this server serves: the ones it ships, read at its start, and the ones imported here (the store keeps
|
|
1075
1077
|
* them; the server loads them beside the bundled ones at its start). An id is one package; a bundled one is never
|
|
@@ -9,11 +9,12 @@ export declare const LAUNCH_HOOK_TIMEOUT_MS = 10000;
|
|
|
9
9
|
* host gets the same 10 minutes as any. */
|
|
10
10
|
export declare const LAUNCH_HOOK_LATE_START_MS: number;
|
|
11
11
|
/** The hook a server hands its firings to: where, and the secret it signs with. `timeoutMs`: a test's bound, else
|
|
12
|
-
* LAUNCH_HOOK_TIMEOUT_MS. */
|
|
12
|
+
* LAUNCH_HOOK_TIMEOUT_MS. `bound`: a test's seam, the signal for a POST's bound in place of AbortSignal.timeout. */
|
|
13
13
|
export type LaunchHook = {
|
|
14
14
|
readonly url: string;
|
|
15
15
|
readonly secret: string;
|
|
16
16
|
readonly timeoutMs?: number;
|
|
17
|
+
readonly bound?: (ms: number) => AbortSignal;
|
|
17
18
|
};
|
|
18
19
|
/** What the host is sent for a firing: its id (the message's webhook-id too), its trigger, the agent and the revision a
|
|
19
20
|
* run would start on now, the run's input as the trigger gives it, and the firing's time. */
|
|
@@ -43,5 +44,6 @@ export declare function launchHookFrom(given: {
|
|
|
43
44
|
}): LaunchHook | undefined;
|
|
44
45
|
/** Where `hook` sends, for the start's banner: its origin alone, never a path or query that may hold a token. */
|
|
45
46
|
export declare const hookOrigin: (hook: LaunchHook) => string;
|
|
46
|
-
/** `firing` handed to `hook`: one signed POST of it, within the hook's bound and
|
|
47
|
-
|
|
47
|
+
/** `firing` handed to `hook`: one signed POST of it, stamped at `now` (the triggers' clock), within the hook's bound and
|
|
48
|
+
* cut by `stop`. A redirect is not followed. */
|
|
49
|
+
export declare function handToHost(hook: LaunchHook, firing: HookFiring, stop: AbortSignal, now?: () => number): Promise<Handed>;
|
|
@@ -57,11 +57,12 @@ export function launchHookFrom(given) {
|
|
|
57
57
|
}
|
|
58
58
|
/** Where `hook` sends, for the start's banner: its origin alone, never a path or query that may hold a token. */
|
|
59
59
|
export const hookOrigin = (hook) => new URL(hook.url).origin;
|
|
60
|
-
/** `firing` handed to `hook`: one signed POST of it, within the hook's bound and
|
|
61
|
-
|
|
60
|
+
/** `firing` handed to `hook`: one signed POST of it, stamped at `now` (the triggers' clock), within the hook's bound and
|
|
61
|
+
* cut by `stop`. A redirect is not followed. */
|
|
62
|
+
export async function handToHost(hook, firing, stop, now = Date.now) {
|
|
62
63
|
const timeoutMs = hook.timeoutMs ?? LAUNCH_HOOK_TIMEOUT_MS;
|
|
63
64
|
const body = JSON.stringify(firing);
|
|
64
|
-
const timestamp = String(Math.floor(
|
|
65
|
+
const timestamp = String(Math.floor(now() / 1000));
|
|
65
66
|
const headers = {
|
|
66
67
|
"content-type": "application/json",
|
|
67
68
|
"user-agent": "agentrun-serve-launch-hook/1",
|
|
@@ -69,7 +70,7 @@ export async function handToHost(hook, firing, stop) {
|
|
|
69
70
|
"webhook-timestamp": timestamp,
|
|
70
71
|
"webhook-signature": signatureOf(hook.secret, firing.firing_id, timestamp, body),
|
|
71
72
|
};
|
|
72
|
-
const signal = AbortSignal.any([AbortSignal.timeout(timeoutMs), stop]);
|
|
73
|
+
const signal = AbortSignal.any([hook.bound ? hook.bound(timeoutMs) : AbortSignal.timeout(timeoutMs), stop]);
|
|
73
74
|
try {
|
|
74
75
|
const res = await undiciFetch(hook.url, { method: "POST", redirect: "manual", signal, headers, body });
|
|
75
76
|
// The answer's body is not read: the run the host started is found by the firing's key, never by what it says.
|
package/dist/triggers.js
CHANGED
|
@@ -1145,7 +1145,7 @@ export class Triggers {
|
|
|
1145
1145
|
firing_id: firing.key, trigger_id: trigger.id, agent_id: agentId, revision_id: (await this.store.agents.get(agentId))?.currentRevision ?? null,
|
|
1146
1146
|
input: this.inputOf(trigger, firing), fired_at: second(firing.nominalAt),
|
|
1147
1147
|
};
|
|
1148
|
-
const handed = await handToHost(hook, sent, this.stopping.signal);
|
|
1148
|
+
const handed = await handToHost(hook, sent, this.stopping.signal, () => this.clock.now());
|
|
1149
1149
|
if (this.closed || "stopped" in handed)
|
|
1150
1150
|
return;
|
|
1151
1151
|
const linked = await this.deps.runOf(firing.key);
|
package/dist/validate.d.ts
CHANGED
|
@@ -12,7 +12,7 @@ export declare const DEFINITION_FIELDS: string[];
|
|
|
12
12
|
/** What an agentic definition may ask the server to check out in each run's folder before its first turn
|
|
13
13
|
* (runner/pr-checkout.ts): `pull_request`, the pull request the run's GitHub event names, at its head, read-only, in
|
|
14
14
|
* `repo/`; `none` clears it on an edit. */
|
|
15
|
-
export declare const CHECKOUTS: readonly ["pull_request", "none"];
|
|
15
|
+
export declare const CHECKOUTS: readonly ["pull_request", "repository", "none"];
|
|
16
16
|
/** The most bytes an agent's output_schema takes, as JSON. */
|
|
17
17
|
export declare const MAX_OUTPUT_SCHEMA_BYTES: number;
|
|
18
18
|
/** The most bytes an agent's input_schema takes, as JSON. */
|
package/dist/validate.js
CHANGED
|
@@ -22,7 +22,7 @@ export const DEFINITION_FIELDS = ["id", "version", "name", "description", "instr
|
|
|
22
22
|
/** What an agentic definition may ask the server to check out in each run's folder before its first turn
|
|
23
23
|
* (runner/pr-checkout.ts): `pull_request`, the pull request the run's GitHub event names, at its head, read-only, in
|
|
24
24
|
* `repo/`; `none` clears it on an edit. */
|
|
25
|
-
export const CHECKOUTS = ["pull_request", "none"];
|
|
25
|
+
export const CHECKOUTS = ["pull_request", "repository", "none"];
|
|
26
26
|
/** The most bytes an agent's output_schema takes, as JSON. */
|
|
27
27
|
export const MAX_OUTPUT_SCHEMA_BYTES = 64 * 1024;
|
|
28
28
|
/** The most bytes an agent's input_schema takes, as JSON. */
|
|
@@ -183,7 +183,7 @@ export function definitionIssues(definition, { at = "definition", creating = tru
|
|
|
183
183
|
if (d.workflow !== undefined)
|
|
184
184
|
out.push(issue(`${at}.checkout`, "not_allowed", "A workflow revision keeps no checkout: only an agentic run starts in a checkout.", `Remove ${at}.checkout.`));
|
|
185
185
|
else if (!CHECKOUTS.includes(d.checkout))
|
|
186
|
-
out.push(issue(`${at}.checkout`, "not_an_option", `${at}.checkout is one of ${CHECKOUTS.join(", ")}: pull_request checks out the pull request the run's GitHub event names, at its head, in repo/ before the first turn; none clears it`));
|
|
186
|
+
out.push(issue(`${at}.checkout`, "not_an_option", `${at}.checkout is one of ${CHECKOUTS.join(", ")}: pull_request checks out the pull request the run's GitHub event names, at its head, in repo/ before the first turn; repository checks out the head of the default branch of the repository the run names (https://github.com/<owner>/<repo> in its first message, or its start's repo); none clears it`));
|
|
187
187
|
}
|
|
188
188
|
return out;
|
|
189
189
|
}
|
|
@@ -38,7 +38,7 @@ export type HeldFolder = {
|
|
|
38
38
|
};
|
|
39
39
|
/**
|
|
40
40
|
* The stored folder pushed into the computer's empty /workspace through `client` (the computer's own, under no sync),
|
|
41
|
-
* one streaming tar
|
|
41
|
+
* one streaming tar (FolderSync.push), then the computer's listing read as the manifest: the sync the claim
|
|
42
42
|
* holds from then on (the caller sets HeldFolder.folder to it), at the claim's start and for a new sandbox in place of a
|
|
43
43
|
* lost one, whose files the old manifest does not describe. The links an exec made on the disk (linkObjects), now links
|
|
44
44
|
* in the computer, are then removed from the disk. Throws in words where the push, the listing or a remove fails.
|
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
// the disk (storedFolder, holdSynced).
|
|
24
24
|
// - Every write of a claim's goes through fencedStore: once a later claim has taken the run (the run's epoch and runner
|
|
25
25
|
// say so, held or not), it is refused, never sent.
|
|
26
|
-
import { fail, folderPathProblem, FolderSync, ok,
|
|
26
|
+
import { fail, folderPathProblem, FolderSync, ok, SYNC_MAX_BYTES, SYNC_MAX_ENTRIES } from "@parcha/agentrun-computer";
|
|
27
27
|
/** How many files a push reads ahead of the one the tar is writing. */
|
|
28
28
|
const AHEAD = 4;
|
|
29
29
|
const FILE_MODE = 0o644;
|
|
@@ -66,8 +66,8 @@ const quiet = (promise) => {
|
|
|
66
66
|
return promise;
|
|
67
67
|
};
|
|
68
68
|
/** The folder's entries as tar entries, by path (a directory before what is in it), then its links: each file read
|
|
69
|
-
* AHEAD ahead of the one written, so what is held is those few, never the folder
|
|
70
|
-
*
|
|
69
|
+
* AHEAD ahead of the one written, so what is held is those few, never the folder (FolderSync.push gives each file its
|
|
70
|
+
* mtime). */
|
|
71
71
|
async function* tarEntries(store, { entries, meta }) {
|
|
72
72
|
const modeOf = (path, fallback) => (Object.hasOwn(meta.modes, path) ? meta.modes[path] : fallback);
|
|
73
73
|
const sorted = [...entries].sort(byPath);
|
|
@@ -86,29 +86,26 @@ async function* tarEntries(store, { entries, meta }) {
|
|
|
86
86
|
}
|
|
87
87
|
const body = await reads.shift();
|
|
88
88
|
ahead();
|
|
89
|
-
yield { name: entry.path, type: "file", mode: modeOf(entry.path, FILE_MODE), body
|
|
89
|
+
yield { name: entry.path, type: "file", mode: modeOf(entry.path, FILE_MODE), body };
|
|
90
90
|
}
|
|
91
91
|
for (const [path, target] of Object.entries(meta.links))
|
|
92
92
|
yield { name: path, type: "symlink", mode: 0o777, link: target };
|
|
93
93
|
}
|
|
94
94
|
/**
|
|
95
95
|
* The stored folder pushed into the computer's empty /workspace through `client` (the computer's own, under no sync),
|
|
96
|
-
* one streaming tar
|
|
96
|
+
* one streaming tar (FolderSync.push), then the computer's listing read as the manifest: the sync the claim
|
|
97
97
|
* holds from then on (the caller sets HeldFolder.folder to it), at the claim's start and for a new sandbox in place of a
|
|
98
98
|
* lost one, whose files the old manifest does not describe. The links an exec made on the disk (linkObjects), now links
|
|
99
99
|
* in the computer, are then removed from the disk. Throws in words where the push, the listing or a remove fails.
|
|
100
100
|
*/
|
|
101
101
|
export async function holdSynced(store, client, stored, signal) {
|
|
102
|
-
const options = signal ? { signal } : {};
|
|
103
|
-
if (stored.entries.length > 0 || Object.keys(stored.meta.links).length > 0) {
|
|
104
|
-
const pushed = await pushTar(client, WORKSPACE, tarStream(tarEntries(store, stored)), options);
|
|
105
|
-
if (!pushed.ok)
|
|
106
|
-
throw new Error(`the run's folder could not be pushed into the computer: ${pushed.error.message}`);
|
|
107
|
-
}
|
|
108
102
|
const folder = new FolderSync(client, store);
|
|
109
|
-
const
|
|
110
|
-
|
|
111
|
-
|
|
103
|
+
const options = signal ? { signal } : {};
|
|
104
|
+
// An empty folder has nothing to push (no tar), its listing is the baseline all the same.
|
|
105
|
+
const empty = stored.entries.length === 0 && Object.keys(stored.meta.links).length === 0;
|
|
106
|
+
const held = empty ? await folder.baseline(options) : await folder.push(tarEntries(store, stored), options);
|
|
107
|
+
if (!held.ok)
|
|
108
|
+
throw new Error(empty ? `the run's folder pushed into the computer could not be listed: ${held.error.message}` : `the run's folder ${held.error.message}`);
|
|
112
109
|
for (const path of stored.linkObjects) {
|
|
113
110
|
const removed = await store.remove(path, "file");
|
|
114
111
|
if (!removed.ok)
|
package/launcher/agentrun-serve
CHANGED
|
@@ -39,7 +39,7 @@
|
|
|
39
39
|
# here. Any other variable named like a key (a KEY, TOKEN, SECRET, PASSWORD, PASSWD, PASS, PAT, CREDENTIAL, CREDENTIALS or
|
|
40
40
|
# DSN segment, or a last PWD after another) stays in the server's environment, as this list does not take it, and in no
|
|
41
41
|
# run's: name it here to keep it from the server's too.
|
|
42
|
-
SECRETS='AGENTRUN_TOKEN AGENTRUN_TOKENS AGENTRUN_API_KEY AGENTRUN_STORE_URL AGENT_MODEL_API_KEY OPENAI_API_KEY ANTHROPIC_API_KEY BROWSERBASE_API_KEY BROWSERBASE_PROJECT_ID KERNEL_API_KEY OPENROUTER_API_KEY PARTICLE_API_KEY TYPESAFE_API_KEY PARALLEL_API_KEY MONID_API_KEY CURSOR_API_KEY AGENTRUN_SEAL_KEY AGENTRUN_LAUNCH_HOOK_SECRET ARCHIL_API_KEY E2B_API_KEY ORGO_API_KEY PHONE_HARNESS_API_KEY AGENT37_API_KEY AGENT37_SSH_KEY DAYTONA_API_KEY BOXD_API_KEY MORPH_API_KEY SMOLCLOUD_API_KEY CLOUDFLARE_RELAY_TOKEN FLY_API_TOKEN MODAL_TOKEN_ID MODAL_TOKEN_SECRET ANTHROPIC_AUTH_TOKEN ANTHROPIC_OAUTH_TOKEN AI_GATEWAY_API_KEY ANT_LING_API_KEY AWS_ACCESS_KEY_ID AWS_BEARER_TOKEN_BEDROCK AWS_SECRET_ACCESS_KEY AWS_SESSION_TOKEN AZURE_OPENAI_API_KEY BASETEN_API_KEY CEREBRAS_API_KEY CLOUDFLARE_API_KEY COPILOT_GITHUB_TOKEN DEEPSEEK_API_KEY FIREWORKS_API_KEY GEMINI_API_KEY GOOGLE_CLOUD_API_KEY GROQ_API_KEY HF_TOKEN KIMI_API_KEY META_API_KEY MINIMAX_API_KEY MINIMAX_CN_API_KEY MISTRAL_API_KEY MOONSHOT_API_KEY NVIDIA_API_KEY OPENCODE_API_KEY QWEN_TOKEN_PLAN_API_KEY QWEN_TOKEN_PLAN_CN_API_KEY RADIUS_API_KEY TOGETHER_API_KEY XAI_API_KEY XIAOMI_API_KEY XIAOMI_TOKEN_PLAN_AMS_API_KEY XIAOMI_TOKEN_PLAN_CN_API_KEY XIAOMI_TOKEN_PLAN_SGP_API_KEY ZAI_API_KEY ZAI_CODING_CN_API_KEY'
|
|
42
|
+
SECRETS='AGENTRUN_TOKEN AGENTRUN_TOKENS AGENTRUN_API_KEY AGENTRUN_STORE_URL AGENT_MODEL_API_KEY OPENAI_API_KEY ANTHROPIC_API_KEY BROWSERBASE_API_KEY BROWSERBASE_PROJECT_ID KERNEL_API_KEY OPENROUTER_API_KEY PARTICLE_API_KEY TYPESAFE_API_KEY PARALLEL_API_KEY MONID_API_KEY CURSOR_API_KEY AGENTRUN_SEAL_KEY AGENTRUN_LAUNCH_HOOK_SECRET ARCHIL_API_KEY E2B_API_KEY ORGO_API_KEY PHONE_HARNESS_API_KEY AGENT37_API_KEY AGENT37_SSH_KEY DAYTONA_API_KEY BOXD_API_KEY MORPH_API_KEY SMOLCLOUD_API_KEY GROUNDBOX_API_KEY CLOUDFLARE_RELAY_TOKEN FLY_API_TOKEN MODAL_TOKEN_ID MODAL_TOKEN_SECRET ANTHROPIC_AUTH_TOKEN ANTHROPIC_OAUTH_TOKEN AI_GATEWAY_API_KEY ANT_LING_API_KEY AWS_ACCESS_KEY_ID AWS_BEARER_TOKEN_BEDROCK AWS_SECRET_ACCESS_KEY AWS_SESSION_TOKEN AZURE_OPENAI_API_KEY BASETEN_API_KEY CEREBRAS_API_KEY CLOUDFLARE_API_KEY COPILOT_GITHUB_TOKEN DEEPSEEK_API_KEY FIREWORKS_API_KEY GEMINI_API_KEY GOOGLE_CLOUD_API_KEY GROQ_API_KEY HF_TOKEN KIMI_API_KEY META_API_KEY MINIMAX_API_KEY MINIMAX_CN_API_KEY MISTRAL_API_KEY MOONSHOT_API_KEY NVIDIA_API_KEY OPENCODE_API_KEY QWEN_TOKEN_PLAN_API_KEY QWEN_TOKEN_PLAN_CN_API_KEY RADIUS_API_KEY TOGETHER_API_KEY XAI_API_KEY XIAOMI_API_KEY XIAOMI_TOKEN_PLAN_AMS_API_KEY XIAOMI_TOKEN_PLAN_CN_API_KEY XIAOMI_TOKEN_PLAN_SGP_API_KEY ZAI_API_KEY ZAI_CODING_CN_API_KEY'
|
|
43
43
|
set -eu
|
|
44
44
|
# Each secret out of the environment and into an unexported variable of this shell (agentrun_secret_<NAME>).
|
|
45
45
|
for name in $SECRETS; do
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@parcha/agentrun-serve",
|
|
3
|
-
"version": "0.1.0-beta.
|
|
3
|
+
"version": "0.1.0-beta.54",
|
|
4
4
|
"description": "The AgentRun server: the /v2 API and console over one store, with runners that run your agents; the deployable process of the AgentRun platform.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"agentrun",
|
|
@@ -62,15 +62,15 @@
|
|
|
62
62
|
"@earendil-works/pi-coding-agent": "1.5.2",
|
|
63
63
|
"@modelcontextprotocol/client": "2.4.0",
|
|
64
64
|
"@modelcontextprotocol/server": "2.4.0",
|
|
65
|
-
"@parcha/agentrun-computer": "0.1.0-beta.
|
|
66
|
-
"@parcha/agentrun-decisions": "0.1.0-beta.
|
|
67
|
-
"@parcha/agentrun-dsl": "0.1.0-beta.
|
|
68
|
-
"@parcha/agentrun-harness-acp": "0.1.0-beta.
|
|
69
|
-
"@parcha/agentrun-harness-claude": "0.1.0-beta.
|
|
70
|
-
"@parcha/agentrun-harness-codex": "0.1.0-beta.
|
|
71
|
-
"@parcha/agentrun-jev": "0.1.0-beta.
|
|
72
|
-
"@parcha/agentrun-kernel": "0.1.0-beta.
|
|
73
|
-
"@parcha/pi-browser": "0.1.0-beta.
|
|
65
|
+
"@parcha/agentrun-computer": "0.1.0-beta.54",
|
|
66
|
+
"@parcha/agentrun-decisions": "0.1.0-beta.54",
|
|
67
|
+
"@parcha/agentrun-dsl": "0.1.0-beta.54",
|
|
68
|
+
"@parcha/agentrun-harness-acp": "0.1.0-beta.54",
|
|
69
|
+
"@parcha/agentrun-harness-claude": "0.1.0-beta.54",
|
|
70
|
+
"@parcha/agentrun-harness-codex": "0.1.0-beta.54",
|
|
71
|
+
"@parcha/agentrun-jev": "0.1.0-beta.54",
|
|
72
|
+
"@parcha/agentrun-kernel": "0.1.0-beta.54",
|
|
73
|
+
"@parcha/pi-browser": "0.1.0-beta.54",
|
|
74
74
|
"@secretlint/core": "13.1.0",
|
|
75
75
|
"@secretlint/profiler": "13.1.0",
|
|
76
76
|
"@secretlint/secretlint-rule-preset-recommend": "13.1.0",
|
package/templates/README.md
CHANGED
|
@@ -27,7 +27,7 @@ Links and other special files are refused anywhere in the folder, and its only f
|
|
|
27
27
|
|
|
28
28
|
## The packages this server ships
|
|
29
29
|
|
|
30
|
-
None needs a sandbox (code-review
|
|
30
|
+
None needs a sandbox (code-review and agent-scout prefer a shell and run without one): each reads and writes through web tools and MCP
|
|
31
31
|
servers the owner saves.
|
|
32
32
|
|
|
33
33
|
**Writes are bounded.** Every package reads content someone else wrote (web pages, pull requests, form submissions),
|
|
@@ -82,6 +82,7 @@ the owner grants a write, text the agent read could try to copy what that read r
|
|
|
82
82
|
|
|
83
83
|
| Package | What it does | Started by | Needs |
|
|
84
84
|
|---|---|---|---|
|
|
85
|
+
| `agent-scout` | Reads a repository on a read-only checkout of its default branch (`checkout: repository`, in `repo/`) and answers at most five places its app needs an AI agent, each with the lines that show it, the typed input the app already has there, the typed answer it would use and where it would call it. The server reads its answer into the console's Suggested agents page, where a person creates (a pull request adds the agent and a client) or discards each ([Suggested agents](../README.md#suggested-agents)). It writes nothing | a scan from the Suggested agents page (`POST /v2/suggestions/scans`), or a run naming `https://github.com/<owner>/<repo>` | a shell where there is one (read-only bash, as code-review's), else `read` alone over the checkout's file list; the GitHub App for a private repository |
|
|
85
86
|
| `code-review` | Reviews a pull request for real bugs on a read-only checkout AgentRun makes of the PR (`checkout: pull_request`, in `repo/`): one `subagent` turn starts five quick and three deep reviewers, each with read-only bash (`git diff`, `git grep`, `nl -ba`; none builds or runs the code), against the repository's `CODEREVIEW.md` (on top of its own `rules/CODEREVIEW.md`, the baseline and the starter); the agent merges and verifies their findings and posts one comment review with P0/P1/P2 findings, each quoting the line behind it, and a 1-5 risk score, never an approval (its write is pinned to COMMENT). A fork's PR is reviewed when a writer comments `@<bot> review` | a run naming a PR, or a GitHub webhook trigger the owner adds | a shell (`computer: [shell, none]`: with none, it is made without bash and its reviewers read through the GitHub tools); a saved GitHub MCP server (source `github`, on the GitHub App) to read the PR and post, every call pinned to its `owner` and `repo`; with neither, a diff in the message |
|
|
86
87
|
| `kyb` | Business due diligence: identity, owners, sanctions against the lists themselves, adverse media, a verdict, every claim cited | a run with the company as typed input (`company`, and optionally `website`, `country`, `registration_number`, `reason`) | nothing; web tools only |
|
|
87
88
|
| `market-monitor` | A weekly digest of what changed at the companies you watch, posted to one Slack channel or address | a weekly schedule (its `cron` and `timezone` parameters, Monday 08:00 UTC by default), or a run | optional: a saved Composio Slack or Gmail MCP server (toolkit `slack` or `gmail`), to send |
|
|
@@ -373,7 +374,7 @@ package}`, and a line in the markdown).
|
|
|
373
374
|
| `tool_policy` | `{bash: read-only}`: a policy on the agent's bash, the one tool that takes one. Apply writes it as `policy` on bash in the agent's `tool_settings` (`definition.tool_settings.bash.policy`), whatever bash's permission, and the tool gate reads each shell call's command before it runs or anyone is asked. Under `read-only` it refuses, in words the model reads, any command that could write, run code or read outside the run's folder: a program outside the read list (git's read subcommands `diff`, `show`, `log`, `blame`, `grep`, `ls-files`, `ls-tree`, `rev-parse`, `cat-file`, `merge-base`, `status`, `shortlog`, `rev-list`, `diff-tree`, `name-rev`, `describe`; `grep`, `egrep`, `fgrep`, `rg`, `sed -n 'N,Mp'`, `cat`, `head`, `tail`, `wc`, `nl`, `ls`, `find` without `-exec` or `-delete`, `sort`, `uniq`, `cut`, `tr`, `diff`, `basename`, `dirname`, `echo`, `true`), a redirection other than `2>/dev/null` and `2>&1`, `$` and backticks, a subshell, `\|\|` or a lone `&`, a pipe into anything but a filter (`head`, `tail`, `sed -n`, `grep`, `wc`, `sort`, `uniq`, `cut`, `tr`, `nl`), an unquoted glob (a glob is quoted, and only in a grep pattern, an `--include=` value or a `find -name` value), a path outside the run's folder, or one on the never-open list (`.env*`, `.ssh/`, `id_rsa*`, `*.pem`, `*.key`, `.npmrc`, `.netrc`, `.git-credentials`, `credentials`), which refuses a command that names such a file but is no fence around the folder: a recursive search reads all it holds, the run's own files and never a key of the server's. `git -C <dir>` is allowed to a directory inside the folder. A line with a `cd` joins its commands with `&&` only. `bash_background` and `bash_input` are refused under it. The check reads the command, never the folder, so a symbolic link in the folder reaches what the computer lets it; and it holds bash alone, so a read-only agent's tools are `read` and `bash` (one that may write can change what git obeys). Approvals `never` lifts none of it. A package with `tools` grants `bash` among them. |
|
|
374
375
|
| `computer` | `default` (or absent): the agent runs where this server puts a new one. Or a preference list, `[shell, none]`, read like `harness`: apply takes the first entry this server meets now and saves it as the agent's `computer`. `shell` is a computer that gives the agent a shell here: Archil's serverless exec on the runner when Archil is on (Settings → Workspace; `bash` alone, so `bash_background` and the other background tools are not granted), else the Docker sandbox where Docker answers. `none` is no shell, and is always met: the shell tools in `tools` (`bash` and the background tools) are not granted, and neither is `tool_policy`'s bash. A package with no `tools` is given the chosen shell's tools, as a new agent in a box is given the box's. A fallback, or a tool not granted, is said in a `computer` warning on the apply. A list with `shell` alone, where there is none, refuses the apply (`409`, nothing made). A list without `shell` grants no shell tool, so one in `tools` is refused, and so is an entry after `none`, which would never be picked. The choice is made at apply: a server that gains a shell later gives it to an agent applied again. `GET /v2/templates` shows the list as `computer`, and as `computer_here` what an apply here would pick now: the entry, the agent's `computer`, the shell in words, the tools it would not grant, and the warning or refusal. |
|
|
375
376
|
| `needs` | A list of 1 to 32 program names its agent's sandbox must have on its `PATH` (`[chrome, ffmpeg, ffprobe, hyperframes]` to render video), each once, a name a shell finds (letters, digits, `.`, `_`, `+`, `-`, no path), or a library the agent's code loads, by its pip or npm name (`[python-pptx, pptxgenjs]` to make decks; the [documents image](../README.md#the-boxs-image) has those). Read only beside `computer: [shell]`, so a template that needs them runs in a sandbox or not at all: never a fallback to no computer. It names no image: the image stays the server's, a Docker box's `AGENTRUN_DOCKER_IMAGE` (the [media image](../README.md#the-boxs-image) has those four). Apply writes them onto the sandbox it picks, as the agent's `computer.needs`, which each run checks in its box before its first model request: a box that lacks one ends the run failed, naming it and the image fix, with nothing spent. Where no sandbox answers (Archil's serverless exec is none, and in Mode 2 the Docker box can't mount Archil's workspaces, so none answers there; or no shell at all), apply refuses (`409`, nothing made) in words naming the programs and `AGENTRUN_DOCKER_IMAGE`. `GET /v2/templates` shows it as `needs`, and on `computer_here.computer`. A server older than the release that reads `needs` refuses a package that names it as an unknown field. |
|
|
376
|
-
| `checkout` | `pull_request`
|
|
377
|
+
| `checkout` | `pull_request` or `repository`. `repository`: the server checks out, before each run's first turn, the head of the default branch of the repository the run names (its start's `repo`, else the first `https://github.com/<owner>/<repo>` in its first message), one commit deep, detached in `repo/` (ref `repo/head`), its files listed one a line in `repo/.git/agentrun-files`, fetched as below. `pull_request`: apply sets the agent definition's `checkout`, and the server checks out the pull request each run's GitHub event names before its first turn, in `repo/` of the run's folder, detached at the head, with its base and their merge base (refs `pr/head`, `pr/base`, `pr/merge-base`: `git diff pr/merge-base pr/head` reads the change). The server fetches it with its GitHub App's token, narrowed to that one repository and `contents: read` and revoked after the fetch, or anonymously with no App; the agent never holds a token, and nothing of it is left in the folder or the checkout's git config. The run's system prompt says what was checked out, or why nothing was, so the package's instructions can fall back to the GitHub MCP. It is removed when the run's claim ends. With `tool_policy: {bash: read-only}` the agent reads it with git's read subcommands and never fetches itself. |
|
|
377
378
|
| `parameters` | The setup an owner fills once, at apply. Written exactly as `inputs` are (the same keys, the same rule: required unless `required: false`, a `default` only on one that is not) and compiled by the same code; `GET /v2/templates` shows them as a JSON Schema like `input_schema`, and the console's Apply form is the run form. The one difference is where they are filled: apply takes them in `parameters` (a blank one takes its `default`; they are checked as a run's input is, with the same `422` words under `parameters.<name>`), and puts them where the package writes `${parameters.<name>}`: `display_name`, the body, a trigger's `target.input`, a schedule's `cron` and `timezone`, the `in` values of a github, webhook, composio or feed trigger's `accept` where conditions, a composio trigger's `config` values, a feed trigger's `urls`, a trigger's `enabled`, and an `mcp` entry's `pin` values, nowhere else. Text takes the value as text (a list as its items joined by `, `). A `target.input` value, a composio trigger's `config` value or a pin value that is one placeholder alone takes the value with its type (a list pinned is a one-of); in `target.input` one given no value is dropped, so the input schema sees the field absent. A trigger's `enabled` takes only one placeholder alone, naming a boolean parameter with a default: the trigger is made on or off by its value. A feed trigger's `urls` that are one placeholder alone take an array-of-strings parameter whole. A parameter a where, a composio `config` or a feed's `urls` take is required or has a default, so none fills empty; one a schedule uses has a default, which the package's own schedule is checked with, and apply checks every trigger with the values given before it makes anything (`422` under `triggers.<i>`). |
|
|
378
379
|
| `inputs` | By name: each run's typed input, which apply compiles into the agent's `input_schema` (a closed JSON Schema object). Each is `{type: string \| number \| integer \| boolean \| array, required?, title?, description?, examples?, default?, enum?, pattern? and format? (strings), minLength?/maxLength? (strings), minimum?/maximum? (numbers), items? (an array's scalar, with that scalar's keys)}`, nothing else; an input is required unless it says `required: false`, and a `default` is for one that is not. `format` is `uri`, `email`, `hostname`, `date`, `date-time` or `uuid`, which the server checks, or `cron` or `timezone`, which a form reads. A default and each example are checked against their own input. `content` is the run's message: named, it is a string. Every path that starts a run (the API, the CLI, a trigger, the console) checks the input against it and refuses one that does not meet it with `422 input_invalid`, a path per field (`input.country`). The model is sent the input's `content`, then the other fields as one fenced `json` block under the line `Input:`, so the instructions read each field by its name. `GET /v2/templates` shows it as `input_schema`, and the console's run form is drawn from it. A trigger's `target.input` and an eval case's `input` are checked against it too. Absent: a run takes `{content}`, as before. |
|
|
379
380
|
| `secrets` | Variable names (never values) the server must hold: a model or tool key Settings saves (`OPENROUTER_API_KEY`, `PARALLEL_API_KEY`, ...), set where it starts or saved there. Any other name is refused: the server could neither save it nor hand it to a run. Apply refuses with `409 agent_not_runnable`, making nothing, when one is missing. |
|