Skip to content
Myr

amp.ts

This file

Path

scripts/lib/swarm/harnesses/amp.ts

42 lines · 1.1 KiB · TypeScript

Last changed by

Merge build/comments-ops into mainoscabrielbefore adoptione4c407e

History of this file

Take it

Merge build/comments-ops into mainoscabrielbefore adoptione4c407e

lines 1–3why, one step back
1// Amp asks before running a command unless its settings say `amp.dangerouslyAllowAll`,
2// so the workspace gets a settings file of its own. An archived thread cannot be3// continued, so every run passes `--no-archive-after-execute`.

Merge branch 'build/711-swarm-drivers-and-verdict-loop'oscabrielbefore adoption3210514

lines 4–42why, one step back
4import { streamJsonEvents } from "./claude-code.ts";
5import type { HarnessDriver } from "./event.ts";67export const ampSettingsFile = (dir: string) => `${dir}/amp-settings.json`;89const headless = (model: string, dir: string) => [10 "--stream-json",11 "-m",12 model,13 "--settings-file",14 ampSettingsFile(dir),15 "--no-archive-after-execute",16];1718export const amp: HarnessDriver = {19 files: ({ dir }) => [20 {21 content: `${JSON.stringify({ "amp.dangerouslyAllowAll": true }, null, 2)}\n`,22 path: ampSettingsFile(dir),23 },24 ],25 harness: "amp",26 parse: streamJsonEvents("assistant"),27 resume: ({ model, prompt, session, workspace }) => [28 "amp",29 "threads",30 "continue",31 session,32 "-x",33 prompt,34 ...headless(model, workspace.dir),35 ],36 start: ({ brief, model, workspace }) => [37 "amp",38 "-x",39 brief,40 ...headless(model, workspace.dir),41 ],42};