@openagt/agent-runner 0.0.1 → 0.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.
@@ -0,0 +1,27 @@
1
+ import { type ProjectPackage } from '@openagt/agent-data';
2
+ import type { SkillLink } from '@openagt/skill-branches';
3
+ /**
4
+ * The basic skills (#2023): the ones every run gets, with nothing committed in the project. Each
5
+ * one's text is linked into the agent's checkout, hidden from git, beside the branches skill the
6
+ * checkout already carries, and with it the skill's package and command, so the text's
7
+ * `npx @openagt/skill-logs@0.1` runs this install's own copy. They are what an agent needs in any
8
+ * project to work at all: read what earlier agents did, ask the person a question, and hand its
9
+ * work over on the project's git host. A project that tracks its own copy of one keeps it: an
10
+ * entry already in the checkout is left alone.
11
+ *
12
+ * Dependencies of this tool, resolved from its own install; one that is not installed is skipped.
13
+ * This list is the one place the tool names a skill. A git host's skill is linked only where its
14
+ * package answers the project's page there (its `home` command): its text says the project's pull
15
+ * requests are on that host, which is wrong anywhere else.
16
+ */
17
+ export declare const BASIC_PACKAGES: readonly string[];
18
+ /** Every basic skill this install carries, whatever the project: what a cleanup takes the rules back for. */
19
+ export declare function everyBasicSkill(): Promise<SkillLink[]>;
20
+ /** The basic skills of the project at `repo`: all of them, a git host's only where it answers for the project. */
21
+ export declare function basicSkills(repo: string): Promise<SkillLink[]>;
22
+ /**
23
+ * The basic packages that answer as the git host of the project at `repo`: what a run reads its
24
+ * pull request back through in a project that installed no git host of its own.
25
+ */
26
+ export declare function basicGitHosts(repo: string): Promise<ProjectPackage[]>;
27
+ //# sourceMappingURL=basic-skills.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"basic-skills.d.ts","sourceRoot":"","sources":["../src/basic-skills.ts"],"names":[],"mappings":"AAGA,OAAO,EAA2D,KAAK,cAAc,EAAwB,MAAM,qBAAqB,CAAA;AACxI,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAA;AAExD;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,cAAc,EAAE,SAAS,MAAM,EAAgF,CAAA;AAuC5H,6GAA6G;AAC7G,wBAAsB,eAAe,IAAI,OAAO,CAAC,SAAS,EAAE,CAAC,CAE5D;AAED,kHAAkH;AAClH,wBAAsB,WAAW,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,SAAS,EAAE,CAAC,CAOpE;AAED;;;GAGG;AACH,wBAAsB,aAAa,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,cAAc,EAAE,CAAC,CAM3E"}
@@ -0,0 +1,75 @@
1
+ import { readFile, realpath } from 'node:fs/promises';
2
+ import { createRequire } from 'node:module';
3
+ import { dirname, join } from 'node:path';
4
+ import { declaring, packageBins, readManifest, runPackageCommand } from '@openagt/agent-data';
5
+ /**
6
+ * The basic skills (#2023): the ones every run gets, with nothing committed in the project. Each
7
+ * one's text is linked into the agent's checkout, hidden from git, beside the branches skill the
8
+ * checkout already carries, and with it the skill's package and command, so the text's
9
+ * `npx @openagt/skill-logs@0.1` runs this install's own copy. They are what an agent needs in any
10
+ * project to work at all: read what earlier agents did, ask the person a question, and hand its
11
+ * work over on the project's git host. A project that tracks its own copy of one keeps it: an
12
+ * entry already in the checkout is left alone.
13
+ *
14
+ * Dependencies of this tool, resolved from its own install; one that is not installed is skipped.
15
+ * This list is the one place the tool names a skill. A git host's skill is linked only where its
16
+ * package answers the project's page there (its `home` command): its text says the project's pull
17
+ * requests are on that host, which is wrong anywhere else.
18
+ */
19
+ export const BASIC_PACKAGES = ['@openagt/skill-logs', '@openagt/skill-question', '@openagt/skill-github'];
20
+ let resolved;
21
+ async function resolveBasic() {
22
+ const require = createRequire(import.meta.url);
23
+ const skills = [];
24
+ for (const name of BASIC_PACKAGES) {
25
+ let manifestPath;
26
+ try {
27
+ manifestPath = require.resolve(`${name}/package.json`);
28
+ }
29
+ catch {
30
+ continue;
31
+ }
32
+ const dir = await realpath(dirname(manifestPath)).catch(() => undefined);
33
+ const manifest = dir ? await readManifest(join(dir, 'package.json')) : undefined;
34
+ const skill = dir ? skillName(await readFile(join(dir, 'SKILL.md'), 'utf8').catch(() => '')) : undefined;
35
+ if (!dir || !manifest || !skill)
36
+ continue;
37
+ const bins = packageBins(name, manifest.bin, dir);
38
+ const gitHost = declaring([{ name, dir, manifest }], 'git-host')[0];
39
+ skills.push({ link: { name: skill, dir, ...(Object.keys(bins).length > 0 ? { package: { name, dir, bins } } : {}) }, pkg: { name, dir, manifest }, ...(gitHost ? { gitHost } : {}) });
40
+ }
41
+ return skills;
42
+ }
43
+ /** The `name` a skill's text gives in its front matter: the directory a harness lists it under. */
44
+ function skillName(text) {
45
+ const frontMatter = /^---\n([\s\S]*?)\n---/.exec(text)?.[1];
46
+ const name = frontMatter ? /^name:\s*([a-z0-9][a-z0-9-]*)\s*$/m.exec(frontMatter)?.[1] : undefined;
47
+ return name;
48
+ }
49
+ /** Every basic skill this install carries, whatever the project: what a cleanup takes the rules back for. */
50
+ export async function everyBasicSkill() {
51
+ return (await (resolved ??= resolveBasic())).map(skill => skill.link);
52
+ }
53
+ /** The basic skills of the project at `repo`: all of them, a git host's only where it answers for the project. */
54
+ export async function basicSkills(repo) {
55
+ const skills = [];
56
+ for (const { link, gitHost } of await (resolved ??= resolveBasic())) {
57
+ if (gitHost && !(await runPackageCommand(repo, gitHost, ['home'])).ok)
58
+ continue;
59
+ skills.push(link);
60
+ }
61
+ return skills;
62
+ }
63
+ /**
64
+ * The basic packages that answer as the git host of the project at `repo`: what a run reads its
65
+ * pull request back through in a project that installed no git host of its own.
66
+ */
67
+ export async function basicGitHosts(repo) {
68
+ const hosts = [];
69
+ for (const { pkg, gitHost } of await (resolved ??= resolveBasic())) {
70
+ if (gitHost && (await runPackageCommand(repo, gitHost, ['home'])).ok)
71
+ hosts.push(pkg);
72
+ }
73
+ return hosts;
74
+ }
75
+ //# sourceMappingURL=basic-skills.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"basic-skills.js","sourceRoot":"","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M,CAAC,QAAQ,KAAK,YAAY,EAAE,CAAC,CAAC,CAAC,GAAG,CAAC,KAAK,CAAC,EAAE,CAAC,KAAK,CAAC,IAAI,CAAC,CAAA;AACvE,CAAC;AAED,kHAAkH;AAClH,MAAM,CAAC,KAAK,UAAU,WAAW,CAAC,IAAY;IAC5C,MAAM,MAAM,GAAgB,EAAE,CAAA;IAC9B,KAAK,MAAM,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI,MAAM,CAAC,QAAQ,KAAK,YAAY,EAAE,CAAC,EAAE,CAAC;QACpE,IAAI,OAAO,IAAI,CAAC,CAAC,MAAM,iBAAiB,CAAC,IAAI,EAAE,OAAO,EAAE,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,EAAE;YAAE,SAAQ;QAC/E,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;IACnB,CAAC;IACD,OAAO,MAAM,CAAA;AACf,CAAC;AAED;;;GAGG;AACH,MAAM,CAAC,KAAK,UAAU,aAAa,CAAC,IAAY;IAC9C,MAAM,KAAK,GAAqB,EAAE,CAAA;IAClC,KAAK,MAAM,EAAE,GAAG,EAAE,OAAO,EAAE,IAAI,MAAM,CAAC,QAAQ,KAAK,YAAY,EAAE,CAAC,EAAE,CAAC;QACnE,IAAI,OAAO,IAAI,CAAC,MAAM,iBAAiB,CAAC,IAAI,EAAE,OAAO,EAAE,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,EAAE;YAAE,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,CAAA;IACvF,CAAC;IACD,OAAO,KAAK,CAAA;AACd,CAAC"}
@@ -0,0 +1,37 @@
1
+ import { type GitRunner } from '@openagt/agent-data';
2
+ /**
3
+ * `cleanup`: what this tool left in a project, removed, for a person who takes the project out of
4
+ * a dashboard and asks for the tool's files to go too. The tool removes its own and nothing else:
5
+ * a dashboard asks for it by the `cleanup` kind the package declares under `openagent` in its
6
+ * package.json, and holds no list of this tool's files.
7
+ *
8
+ * What goes is the runs' locks and stderr files, one by one, and then the directories they left
9
+ * empty. The settings file is the person's own writing and stays, and so does anything else
10
+ * found there, each named with the reason. A file git tracks is never removed. The rule that
11
+ * hides the directory from git goes only when this pass removed the directory and no other
12
+ * checkout of the repository holds one: every checkout reads the same exclude file. While a
13
+ * run's process is alive nothing is removed at all: its lock is what keeps a second process off
14
+ * the run.
15
+ */
16
+ /** One thing left where it was, by its path from the project's root, and why. */
17
+ export interface Kept {
18
+ path: string;
19
+ reason: string;
20
+ }
21
+ export type CleanupOutcome = {
22
+ ok: true;
23
+ removed: string[];
24
+ kept: Kept[];
25
+ }
26
+ /** Runs whose process is alive on this machine: stop them first. */
27
+ | {
28
+ ok: false;
29
+ reason: 'running';
30
+ runs: string[];
31
+ };
32
+ export interface CleanupDeps {
33
+ isAlive?: (pid: number) => boolean;
34
+ git?: GitRunner;
35
+ }
36
+ export declare function cleanup(repo: string, deps?: CleanupDeps): Promise<CleanupOutcome>;
37
+ //# sourceMappingURL=cleanup.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cleanup.d.ts","sourceRoot":"","sources":["../src/cleanup.ts"],"names":[],"mappings":"AAEA,OAAO,EAAwD,KAAK,SAAS,EAAE,MAAM,qBAAqB,CAAA;AAI1G;;;;;;;;;;;;;GAaG;AAEH,iFAAiF;AACjF,MAAM,WAAW,IAAI;IACnB,IAAI,EAAE,MAAM,CAAA;IACZ,MAAM,EAAE,MAAM,CAAA;CACf;AAED,MAAM,MAAM,cAAc,GACtB;IAAE,EAAE,EAAE,IAAI,CAAC;IAAC,OAAO,EAAE,MAAM,EAAE,CAAC;IAAC,IAAI,EAAE,IAAI,EAAE,CAAA;CAAE;AAC/C,oEAAoE;GAClE;IAAE,EAAE,EAAE,KAAK,CAAC;IAAC,MAAM,EAAE,SAAS,CAAC;IAAC,IAAI,EAAE,MAAM,EAAE,CAAA;CAAE,CAAA;AAEpD,MAAM,WAAW,WAAW;IAC1B,OAAO,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,OAAO,CAAA;IAClC,GAAG,CAAC,EAAE,SAAS,CAAA;CAChB;AAID,wBAAsB,OAAO,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,GAAE,WAAgB,GAAG,OAAO,CAAC,cAAc,CAAC,CA8C3F"}
@@ -0,0 +1,83 @@
1
+ import { lstat, readdir, rm, rmdir } from 'node:fs/promises';
2
+ import { join } from 'node:path';
3
+ import { nodeGitRunner, repositoryCheckouts, unexcludeFromGit } from '@openagt/agent-data';
4
+ import { RUNNER_CONFIG, RUNNER_DIR, RUNS_DIR } from './names.js';
5
+ import { isPidAlive, lockHolder } from './run-lock.js';
6
+ const NOT_OURS = 'not made by agent-runner';
7
+ export async function cleanup(repo, deps = {}) {
8
+ const isAlive = deps.isAlive ?? isPidAlive;
9
+ const git = deps.git ?? nodeGitRunner();
10
+ const dir = join(repo, RUNNER_DIR);
11
+ const runs = join(dir, RUNS_DIR);
12
+ const runsPath = `${RUNNER_DIR}/${RUNS_DIR}`;
13
+ const removed = [];
14
+ const kept = [];
15
+ // A link is followed nowhere: what it points at may lie outside the project.
16
+ const kind = await kindOf(dir);
17
+ if (kind === 'none')
18
+ return { ok: true, removed, kept };
19
+ if (kind !== 'directory')
20
+ return { ok: true, removed, kept: [{ path: RUNNER_DIR, reason: NOT_OURS }] };
21
+ const running = [];
22
+ for (const name of await names(runs)) {
23
+ if (!name.endsWith('.lock'))
24
+ continue;
25
+ const id = name.slice(0, -'.lock'.length);
26
+ if ((await lockHolder(repo, id, isAlive)) !== undefined)
27
+ running.push(id);
28
+ }
29
+ if (running.length > 0)
30
+ return { ok: false, reason: 'running', runs: running };
31
+ const runsKind = await kindOf(runs);
32
+ if (runsKind === 'directory') {
33
+ const tracked = new Set((await git(['ls-files', '-z', '--', runsPath], repo)).split('\0').filter(Boolean));
34
+ for (const name of await names(runs)) {
35
+ const path = `${runsPath}/${name}`;
36
+ if (tracked.has(path))
37
+ kept.push({ path, reason: 'git tracks it' });
38
+ else if ((name.endsWith('.lock') || name.endsWith('.stderr')) && (await kindOf(join(runs, name))) === 'file')
39
+ await rm(join(runs, name), { force: true });
40
+ else
41
+ kept.push({ path, reason: NOT_OURS });
42
+ }
43
+ // rmdir, never a recursive remove: whatever is left in it keeps it.
44
+ if (await rmdir(runs).then(() => true, () => false))
45
+ removed.push(runsPath);
46
+ else if (!kept.some(entry => entry.path.startsWith(`${runsPath}/`)))
47
+ kept.push({ path: runsPath, reason: 'not empty' });
48
+ }
49
+ else if (runsKind !== 'none')
50
+ kept.push({ path: runsPath, reason: NOT_OURS });
51
+ for (const name of await names(dir)) {
52
+ if (name !== RUNS_DIR)
53
+ kept.push({ path: `${RUNNER_DIR}/${name}`, reason: name === RUNNER_CONFIG ? 'your settings for agent-runner' : NOT_OURS });
54
+ }
55
+ if (kept.length > 0)
56
+ return { ok: true, removed, kept };
57
+ if (!(await rmdir(dir).then(() => true, () => false)))
58
+ return { ok: true, removed, kept: [{ path: RUNNER_DIR, reason: 'not empty' }] };
59
+ removed.push(RUNNER_DIR);
60
+ // The rule is the repository's, read by every checkout of it: it stays while one still has the directory.
61
+ const checkouts = await repositoryCheckouts(repo, git).catch(() => undefined);
62
+ if (checkouts && !(await anyHolds(checkouts, RUNNER_DIR)))
63
+ await unexcludeFromGit(repo, `/${RUNNER_DIR}`, undefined, git).catch(() => { });
64
+ return { ok: true, removed, kept };
65
+ }
66
+ /** The names in `dir`; a directory that is not there holds none. */
67
+ async function names(dir) {
68
+ return readdir(dir).catch(() => []);
69
+ }
70
+ /** What sits at `path`, a link read as a link and never followed. */
71
+ async function kindOf(path) {
72
+ const entry = await lstat(path).catch(() => undefined);
73
+ if (!entry)
74
+ return 'none';
75
+ return entry.isDirectory() ? 'directory' : entry.isFile() ? 'file' : 'other';
76
+ }
77
+ async function anyHolds(checkouts, name) {
78
+ for (const checkout of checkouts)
79
+ if ((await kindOf(join(checkout, name))) !== 'none')
80
+ return true;
81
+ return false;
82
+ }
83
+ //# sourceMappingURL=cleanup.js.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CAAC,CAAA;IACtD,IAAI,CAAC,KAAK;QAAE,OAAO,MAAM,CAAA;IACzB,OAAO,KAAK,CAAC,WAAW,EAAE,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,KAAK,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,OAAO,CAAA;AAC9E,CAAC;AAED,KAAK,UAAU,QAAQ,CAAC,SAA4B,EAAE,IAAY;IAChE,KAAK,MAAM,QAAQ,IAAI,SAAS;QAAE,IAAI,CAAC,MAAM,MAAM,CAAC,IAAI,CAAC,QAAQ,EAAE,IAAI,CAAC,CAAC,CAAC,KAAK,MAAM;YAAE,OAAO,IAAI,CAAA;IAClG,OAAO,KAAK,CAAA;AACd,CAAC"}
package/dist/cli.d.ts CHANGED
@@ -4,7 +4,7 @@ import { type GitRunner } from '@openagt/agent-data';
4
4
  * it went — 0 for a result, 1 for a refusal or a failure, 2 for a command that could not be read.
5
5
  * The same contract as the skills' commands, so a person and a dashboard read it the same way.
6
6
  */
7
- export declare const USAGE = "usage: agent-runner <command>\n\n run <prompt> [--model <id>] [--driver <claude-code|codex>] [--then <prompt>] [--publish <commit|branch|pr|merge>] [--parent <id>] [--base <ref>]\n one run of <prompt> in its own checkout, now, recorded; on Claude Code unless --driver says Codex,\n on the coding agent's own default model unless --model names one;\n with --then, once it ends done with a pull request, a fresh agent on its branch gets that prompt and the run's id, and the merge waits for it;\n with --publish, the agent is told, in one sentence after the prompt, how far to take its work when it finishes: commit it, and from there push its branch,\n open its pull request, or set the request to merge once its checks pass; without it the prompt goes as written, and nothing is committed or published unless the prompt asks;\n with --parent, the run <id> is told when this one ends: which run, how it ended, its last words, as its next prompt;\n with --base, the run's branch starts from <ref> instead of origin's default branch\n run --detach <prompt> the same run in its own process, answered at once with its id: what a dashboard's start hook runs\n run --resume <id> [<text>] [--answer <label>]\n continue an ended run: the same record, its session resumed; the text as the next prompt, or the answer to the question it ended on\n run --detach --resume <id> \u2026 the same continuing in its own process, answered at once: what a dashboard's resume hook runs\n check [--driver <claude-code|codex>]\n whether a run can start here: the coding agent's CLI installed and logged in, and its warnings; what a dashboard's check hook runs\n init this tool's lines in the dashboard's .the-framework/hooks.yml, so its Start works; a line already there is kept\n\nWhen a run ends waiting on a question, or ends done with a pull request it did not have, the `ended:` line in the\nproject's .agent-runner/config.yml runs, if there is one, in the project's root, with MESSAGE (one line for a person),\nRUN_ID, STATUS, QUESTION and PR_URL in its environment. The file is this machine's: keep it out of git (this tool hides\n.agent-runner/ from git once a run has started here). A run's coding agent loads the person's own setup, as when\nstarted by hand; in the same file, each part is left out with its own line under `personal:`, so a run does the same\njob on every machine:\n personal:\n memory: off Claude Code's auto-memory; Codex's memories\n connectors: off your claude.ai connectors; Codex's apps and plugins\n skills: off Claude Code: your user settings (effort, model, hooks, a login through apiKeyHelper or env), the skills\n synced from your claude.ai account, ~/.claude/CLAUDE.md, ~/.claude/skills.\n Codex: ~/.codex/AGENTS.md, ~/.codex/skills, ~/.codex/config.toml (with a model provider or\n login set there) and its memories, so Codex's memory stays on only with skills on too (`check` warns).\n Codex loads skills in ~/.agents/skills either way; with skills off, `check --driver codex` warns about them.\n\nJSON on stdout. Exit code 1 for a refusal or a failure (the reason on stderr), 2 for a usage error.";
7
+ export declare const USAGE = "usage: agent-runner <command>\n\n run <prompt> [--model <id>] [--driver <claude-code|codex>] [--then <prompt>] [--publish <commit|branch|pr|merge>] [--attach <text>] [--parent <id>] [--base <ref>]\n one run of <prompt> in its own checkout, now, recorded; on Claude Code unless --driver says Codex,\n on the coding agent's own default model unless --model names one;\n with --then, once it ends done with a pull request, a fresh agent on its branch gets that prompt and the run's id, and the merge waits for it;\n with --publish, the agent is told, in one sentence after the prompt, how far to take its work when it finishes: commit it, and from there push its branch,\n open its pull request, or set the request to merge once its checks pass; without it the prompt goes as written, and nothing is committed or published unless the prompt asks;\n with --attach, the agent is handed <text> with the prompt, after it and before the --publish sentence, and with no later message; the run's record keeps it apart from the prompt, which alone names the run;\n with --parent, the run <id> is told when this one ends: which run, how it ended, its last words, as its next prompt;\n with --base, the run's branch starts from <ref> instead of origin's default branch\n run --detach <prompt> the same run in its own process, answered at once with its id: what a dashboard's start hook runs\n run --resume <id> [<text>] [--answer <label>]\n continue an ended run: the same record, its session resumed; the text as the next prompt, or the answer to the question it ended on\n run --detach --resume <id> \u2026 the same continuing in its own process, answered at once: what a dashboard's resume hook runs\n check [--driver <claude-code|codex>]\n whether a run can start here: the coding agent's CLI installed and logged in, and its warnings; what a dashboard's check hook runs\n init this tool's lines in the dashboard's .openagent/hooks.yml, so its Start works; a line already there is kept\n cleanup remove what this tool left in the project: the runs' locks and stderr files, then .agent-runner/ and the rule hiding it from git once it is empty;\n config.yml is yours and stays; refused while a run's process is alive; the command a dashboard asks for when a project is removed with its files\n\nWhen a run ends waiting on a question, or ends done with a pull request it did not have, the `ended:` line in the\nproject's .agent-runner/config.yml runs, if there is one, in the project's root, with MESSAGE (one line for a person),\nRUN_ID, STATUS, QUESTION and PR_URL in its environment. The file is this machine's: keep it out of git (this tool hides\n.agent-runner/ from git once a run has started here). A run's coding agent loads the person's own setup, as when\nstarted by hand; in the same file, each part is left out with its own line under `personal:`, so a run does the same\njob on every machine:\n personal:\n memory: off Claude Code's auto-memory; Codex's memories\n connectors: off your claude.ai connectors; Codex's apps and plugins\n skills: off Claude Code: your user settings (effort, model, hooks, a login through apiKeyHelper or env), the skills\n synced from your claude.ai account, ~/.claude/CLAUDE.md, ~/.claude/skills.\n Codex: ~/.codex/AGENTS.md, ~/.codex/skills, ~/.codex/config.toml (with a model provider or\n login set there) and its memories, so Codex's memory stays on only with skills on too (`check` warns).\n Codex loads skills in ~/.agents/skills either way; with skills off, `check --driver codex` warns about them.\n\nJSON on stdout. Exit code 1 for a refusal or a failure (the reason on stderr), 2 for a usage error.";
8
8
  export interface CliIo {
9
9
  cwd: string;
10
10
  stdout: (line: string) => void;
@@ -16,4 +16,19 @@ export type CliRefusal = {
16
16
  [key: string]: unknown;
17
17
  };
18
18
  export declare function runCli(argv: string[], io: CliIo, git?: GitRunner): Promise<number>;
19
+ type Options = Record<string, {
20
+ type: 'string' | 'boolean';
21
+ }>;
22
+ /**
23
+ * The arguments with every text made safe for the reader of options: a text may open with a dash
24
+ * (`- fix the tests`, an answer that is a list), and a line of a project's hook file hands it
25
+ * over as it was typed. An argument that is one of the command's own flags, alone or with `=` and
26
+ * a value, is a flag; a flag that takes a text takes the next argument whole, whatever it opens
27
+ * with, unless that is another of the command's flags, which leaves it with no text for the
28
+ * reader to refuse. One word behind a dash that is no flag of the command (`--help`, a flag
29
+ * misspelled) is left for the reader to refuse too: nobody's prompt is that. Everything else is a
30
+ * text, handed over after `--`.
31
+ */
32
+ export declare function withTextsApart(args: readonly string[], options: Options): string[];
33
+ export {};
19
34
  //# sourceMappingURL=cli.d.ts.map
package/dist/cli.d.ts.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"cli.d.ts","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":"AACA,OAAO,EAAiB,KAAK,SAAS,EAAE,MAAM,qBAAqB,CAAA;AAOnE;;;;GAIG;AAEH,eAAO,MAAM,KAAK,09GAiCkF,CAAA;AAEpG,MAAM,WAAW,KAAK;IACpB,GAAG,EAAE,MAAM,CAAA;IACX,MAAM,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAA;IAC9B,MAAM,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAA;CAC/B;AAED,MAAM,MAAM,UAAU,GAAG;IAAE,EAAE,EAAE,KAAK,CAAC;IAAC,MAAM,EAAE,MAAM,CAAC;IAAC,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAA;CAAE,CAAA;AAU9E,wBAAsB,MAAM,CAAC,IAAI,EAAE,MAAM,EAAE,EAAE,EAAE,EAAE,KAAK,EAAE,GAAG,GAAE,SAA2B,GAAG,OAAO,CAAC,MAAM,CAAC,CA0BzG"}
1
+ {"version":3,"file":"cli.d.ts","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":"AACA,OAAO,EAAiB,KAAK,SAAS,EAAE,MAAM,qBAAqB,CAAA;AASnE;;;;GAIG;AAEH,eAAO,MAAM,KAAK,6jIAoCkF,CAAA;AAEpG,MAAM,WAAW,KAAK;IACpB,GAAG,EAAE,MAAM,CAAA;IACX,MAAM,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAA;IAC9B,MAAM,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAA;CAC/B;AAED,MAAM,MAAM,UAAU,GAAG;IAAE,EAAE,EAAE,KAAK,CAAC;IAAC,MAAM,EAAE,MAAM,CAAC;IAAC,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAA;CAAE,CAAA;AAU9E,wBAAsB,MAAM,CAAC,IAAI,EAAE,MAAM,EAAE,EAAE,EAAE,EAAE,KAAK,EAAE,GAAG,GAAE,SAA2B,GAAG,OAAO,CAAC,MAAM,CAAC,CA0BzG;AAqHD,KAAK,OAAO,GAAG,MAAM,CAAC,MAAM,EAAE;IAAE,IAAI,EAAE,QAAQ,GAAG,SAAS,CAAA;CAAE,CAAC,CAAA;AAE7D;;;;;;;;;GASG;AACH,wBAAgB,cAAc,CAAC,IAAI,EAAE,SAAS,MAAM,EAAE,EAAE,OAAO,EAAE,OAAO,GAAG,MAAM,EAAE,CAelF"}
package/dist/cli.js CHANGED
@@ -1,9 +1,11 @@
1
1
  import { parseArgs } from 'node:util';
2
2
  import { nodeGitRunner } from '@openagt/agent-data';
3
- import { projectRoot } from '@openagt/skill-branches';
3
+ import { liftSkillRules, projectRoot } from '@openagt/skill-branches';
4
4
  import { findRun } from '@openagt/skill-logs';
5
5
  import { DRIVER_NAMES, detachResume, detachRun, isDriverName, readyToRun, resumeProject, runProject } from './runner.js';
6
6
  import { initHooks } from './init.js';
7
+ import { cleanup } from './cleanup.js';
8
+ import { everyBasicSkill } from './basic-skills.js';
7
9
  import { isPublish, PUBLISH_LEVELS } from './records.js';
8
10
  /**
9
11
  * The command line: JSON on stdout, one line for a person on stderr, and the exit code says how
@@ -12,12 +14,13 @@ import { isPublish, PUBLISH_LEVELS } from './records.js';
12
14
  */
13
15
  export const USAGE = `usage: agent-runner <command>
14
16
 
15
- run <prompt> [--model <id>] [--driver <claude-code|codex>] [--then <prompt>] [--publish <commit|branch|pr|merge>] [--parent <id>] [--base <ref>]
17
+ run <prompt> [--model <id>] [--driver <claude-code|codex>] [--then <prompt>] [--publish <commit|branch|pr|merge>] [--attach <text>] [--parent <id>] [--base <ref>]
16
18
  one run of <prompt> in its own checkout, now, recorded; on Claude Code unless --driver says Codex,
17
19
  on the coding agent's own default model unless --model names one;
18
20
  with --then, once it ends done with a pull request, a fresh agent on its branch gets that prompt and the run's id, and the merge waits for it;
19
21
  with --publish, the agent is told, in one sentence after the prompt, how far to take its work when it finishes: commit it, and from there push its branch,
20
22
  open its pull request, or set the request to merge once its checks pass; without it the prompt goes as written, and nothing is committed or published unless the prompt asks;
23
+ with --attach, the agent is handed <text> with the prompt, after it and before the --publish sentence, and with no later message; the run's record keeps it apart from the prompt, which alone names the run;
21
24
  with --parent, the run <id> is told when this one ends: which run, how it ended, its last words, as its next prompt;
22
25
  with --base, the run's branch starts from <ref> instead of origin's default branch
23
26
  run --detach <prompt> the same run in its own process, answered at once with its id: what a dashboard's start hook runs
@@ -26,7 +29,9 @@ export const USAGE = `usage: agent-runner <command>
26
29
  run --detach --resume <id> … the same continuing in its own process, answered at once: what a dashboard's resume hook runs
27
30
  check [--driver <claude-code|codex>]
28
31
  whether a run can start here: the coding agent's CLI installed and logged in, and its warnings; what a dashboard's check hook runs
29
- init this tool's lines in the dashboard's .the-framework/hooks.yml, so its Start works; a line already there is kept
32
+ init this tool's lines in the dashboard's .openagent/hooks.yml, so its Start works; a line already there is kept
33
+ cleanup remove what this tool left in the project: the runs' locks and stderr files, then .agent-runner/ and the rule hiding it from git once it is empty;
34
+ config.yml is yours and stays; refused while a run's process is alive; the command a dashboard asks for when a project is removed with its files
30
35
 
31
36
  When a run ends waiting on a question, or ends done with a pull request it did not have, the \`ended:\` line in the
32
37
  project's .agent-runner/config.yml runs, if there is one, in the project's root, with MESSAGE (one line for a person),
@@ -85,7 +90,7 @@ export async function runCli(argv, io, git = nodeGitRunner()) {
85
90
  }
86
91
  const COMMANDS = {
87
92
  async run(args, io, git) {
88
- const { positionals, values } = parse(args, { id: { type: 'string' }, model: { type: 'string' }, resume: { type: 'string' }, answer: { type: 'string' }, detach: { type: 'boolean' }, mark: { type: 'boolean' }, driver: { type: 'string' }, then: { type: 'string' }, publish: { type: 'string' }, parent: { type: 'string' }, base: { type: 'string' } }, 0, 1);
93
+ const { positionals, values } = parse(args, { id: { type: 'string' }, model: { type: 'string' }, resume: { type: 'string' }, answer: { type: 'string' }, detach: { type: 'boolean' }, mark: { type: 'boolean' }, driver: { type: 'string' }, then: { type: 'string' }, publish: { type: 'string' }, attach: { type: 'string' }, started: { type: 'string' }, parent: { type: 'string' }, base: { type: 'string' } }, 0, 1);
89
94
  const repo = await project(io.cwd, git);
90
95
  const driver = values.driver;
91
96
  if (driver !== undefined && !isDriverName(driver))
@@ -102,6 +107,10 @@ const COMMANDS = {
102
107
  throw new Usage('--resume takes no --then: a run continues with the follow-up its record names');
103
108
  if (publish !== undefined)
104
109
  throw new Usage('--resume takes no --publish: a run continues at the publish level its record names');
110
+ if (values.attach !== undefined)
111
+ throw new Usage('--resume takes no --attach: a text is handed over with a run\'s first prompt only');
112
+ if (values.started !== undefined)
113
+ throw new Usage('--resume takes no --started: a run continues from the start its record names');
105
114
  if (values.parent !== undefined)
106
115
  throw new Usage('--resume takes no --parent: a run continues for the parent its record names');
107
116
  if (values.base !== undefined)
@@ -111,6 +120,10 @@ const COMMANDS = {
111
120
  }
112
121
  if (values.then !== undefined && !values.then.trim())
113
122
  throw new Usage('--then needs a prompt');
123
+ if (values.attach !== undefined && !values.attach.trim())
124
+ throw new Usage('--attach needs a text');
125
+ if (values.started !== undefined && (values.id === undefined || Number.isNaN(Date.parse(values.started))))
126
+ throw new Usage('--started is the time a run spawned with --id was asked for, like 2026-10-09T10:00:00.000Z');
114
127
  // A parent this project has no record of is refused while someone is still listening; a run
115
128
  // spawned with its id was asked about already.
116
129
  if (values.parent !== undefined && values.id === undefined && !(await findRun(repo, values.parent))) {
@@ -123,7 +136,7 @@ const COMMANDS = {
123
136
  if (ready.problems.length > 0)
124
137
  throw new Refused({ ok: false, reason: 'not-ready', ...ready }, ready.problems.join(' '));
125
138
  }
126
- const named = { ...(values.then !== undefined ? { then: values.then.trim() } : {}), ...(publish !== undefined ? { publish } : {}), ...(values.parent !== undefined ? { parent: values.parent } : {}), ...(values.base !== undefined ? { base: values.base } : {}) };
139
+ const named = { ...(values.then !== undefined ? { then: values.then.trim() } : {}), ...(publish !== undefined ? { publish } : {}), ...(values.attach !== undefined ? { attached: values.attach } : {}), ...(values.parent !== undefined ? { parent: values.parent } : {}), ...(values.base !== undefined ? { base: values.base } : {}) };
127
140
  if (values.detach && values.resume !== undefined) {
128
141
  const resumed = await detachResume(repo, {
129
142
  id: values.resume,
@@ -156,6 +169,7 @@ const COMMANDS = {
156
169
  const outcome = await runProject(repo, {
157
170
  prompt: positionals[0],
158
171
  ...(values.id !== undefined ? { id: values.id } : {}),
172
+ ...(values.started !== undefined ? { startedAt: new Date(values.started).toISOString() } : {}),
159
173
  ...(values.mark ? { mark: true } : {}),
160
174
  ...(values.model !== undefined ? { model: values.model } : {}),
161
175
  ...(driver !== undefined ? { driver } : {}),
@@ -178,9 +192,20 @@ const COMMANDS = {
178
192
  const outcome = await initHooks(repo);
179
193
  if (outcome.ok)
180
194
  return outcome;
181
- const line = outcome.reason === 'no-dashboard' ? 'no .the-framework/ here: add the project in the dashboard first' : `${outcome.file}: ${outcome.detail ?? 'unreadable'}`;
195
+ const line = outcome.reason === 'no-dashboard' ? 'no .openagent/ here: add the project in the dashboard first' : `${outcome.file}: ${outcome.detail ?? 'unreadable'}`;
182
196
  throw new Refused(outcome, line);
183
197
  },
198
+ async cleanup(args, io, git) {
199
+ parse(args, {}, 0);
200
+ const repo = await project(io.cwd, git);
201
+ const outcome = await cleanup(repo, { git });
202
+ if (outcome.ok) {
203
+ // The rules that hid the basic skills' links: this tool had them linked, so it takes them back.
204
+ await liftSkillRules(repo, await everyBasicSkill(), git);
205
+ return outcome;
206
+ }
207
+ throw new Refused(outcome, `a run is still working here (${outcome.runs.join(', ')}): stop it first`);
208
+ },
184
209
  };
185
210
  /** The project the working directory belongs to, even from inside a checkout under `.branches/`. */
186
211
  async function project(cwd, git) {
@@ -193,9 +218,43 @@ async function project(cwd, git) {
193
218
  throw new Refused({ ok: false, reason: 'not-a-repo' }, 'not inside a git repository');
194
219
  }
195
220
  }
221
+ /**
222
+ * The arguments with every text made safe for the reader of options: a text may open with a dash
223
+ * (`- fix the tests`, an answer that is a list), and a line of a project's hook file hands it
224
+ * over as it was typed. An argument that is one of the command's own flags, alone or with `=` and
225
+ * a value, is a flag; a flag that takes a text takes the next argument whole, whatever it opens
226
+ * with, unless that is another of the command's flags, which leaves it with no text for the
227
+ * reader to refuse. One word behind a dash that is no flag of the command (`--help`, a flag
228
+ * misspelled) is left for the reader to refuse too: nobody's prompt is that. Everything else is a
229
+ * text, handed over after `--`.
230
+ */
231
+ export function withTextsApart(args, options) {
232
+ const flags = [];
233
+ const texts = [];
234
+ for (let i = 0; i < args.length; i++) {
235
+ const arg = args[i];
236
+ if (arg === '--') {
237
+ texts.push(...args.slice(i + 1));
238
+ break;
239
+ }
240
+ const option = ownFlag(arg, options);
241
+ if (!option)
242
+ (/^--?[A-Za-z][\w-]*$/.test(arg) ? flags : texts).push(arg);
243
+ else if (option.type === 'string' && !arg.includes('=') && i + 1 < args.length && !ownFlag(args[i + 1], options))
244
+ flags.push(`${arg}=${args[++i]}`);
245
+ else
246
+ flags.push(arg);
247
+ }
248
+ return [...flags, '--', ...texts];
249
+ }
250
+ /** The command's own flag an argument is, alone (`--model`) or with `=` and a value; nothing for any other argument. */
251
+ function ownFlag(arg, options) {
252
+ const name = /^--([a-z][a-z-]*)(=[\s\S]*)?$/.exec(arg)?.[1];
253
+ return name !== undefined && Object.hasOwn(options, name) ? options[name] : undefined;
254
+ }
196
255
  function parse(args, options, min, max = min) {
197
256
  try {
198
- const parsed = parseArgs({ args, options, allowPositionals: true, strict: true });
257
+ const parsed = parseArgs({ args: withTextsApart(args, options), options, allowPositionals: true, strict: true });
199
258
  if (parsed.positionals.length < min || parsed.positionals.length > max) {
200
259
  throw new Usage(`expected ${max === min ? min : `${min} to ${max}`} argument(s), got ${parsed.positionals.length}`);
201
260
  }
package/dist/cli.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"cli.js","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAA;AACrC,OAAO,EAAE,aAAa,EAAkB,MAAM,qBAAqB,CAAA;AACnE,OAAO,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAA;AACrD,OAAO,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAA;AAC7C,OAAO,EAAE,YAAY,EAAE,YAAY,EAAE,SAAS,EAAE,YAAY,EAAE,UAAU,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,aAAa,CAAA;AACxH,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAA;AACrC,OAAO,EAAE,SAAS,EAAE,cAAc,EAAE,MAAM,cAAc,CAAA;AAExD;;;;GAIG;AAEH,MAAM,CAAC,MAAM,KAAK,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;oGAiC+E,CAAA;AAUpG,MAAM,OAAQ,SAAQ,KAAK;IACJ,OAAO;IAAuB,IAAI;IAAvD,YAAqB,OAAmB,EAAW,IAAY;QAC7D,KAAK,CAAC,IAAI,CAAC,CAAA;uBADQ,OAAO;oBAAuB,IAAI;IAEvD,CAAC;CACF;AAED,MAAM,KAAM,SAAQ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AI,MAAM,CAAC,WAAW,CAAC,MAAM,GAAG,GAAG,EAAE,CAAC;YACvE,MAAM,IAAI,KAAK,CAAC,YAAY,GAAG,KAAK,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,GAAG,OAAO,GAAG,EAAE,qBAAqB,MAAM,CAAC,WAAW,CAAC,MAAM,EAAE,CAAC,CAAA;QACrH,CAAC;QACD,OAAO,MAAM,CAAA;IACf,CAAC;IAAC,OAAO,GAAG,EAAE,CAAC;QACb,MAAM,GAAG,YAAY,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,KAAK,CAAC,GAAG,YAAY,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,CAAA;IAChG,CAAC;AACH,CAAC"}
@@ -1,8 +1,12 @@
1
+ import { type ProvidedCommand } from '@openagt/agent-data';
1
2
  /**
2
- * The project's git host (#1820), reached by declaration: whichever of the project's packages
3
- * declares `"framework": { "git-host": "<command>" }` answers the pull requests, and this tool runs
4
- * that command the way the dashboard runs any provided command. The tool names no git host and no
5
- * package: a project with none has no pull requests to read back and nothing to merge.
3
+ * The project's git host (#1820), reached by declaration: whichever package declares
4
+ * `"openagent": { "git-host": "<command>" }` answers the pull requests, and this tool runs that
5
+ * command the way the dashboard runs any provided command. A package the project installed for it
6
+ * comes first; else the git host among this tool's own basic skills, where it answers for the
7
+ * project (`basic-skills.ts`), so a project with nothing installed has one too. Nothing here names
8
+ * a git host or a package: a project with none has no pull requests to read back and nothing to
9
+ * merge.
6
10
  *
7
11
  * Two questions this tool asks of it: which pull request a branch has, for the run's record, and
8
12
  * the merge of one, once a follow-up is done (`run.ts`).
@@ -26,6 +30,8 @@ export interface GitHost {
26
30
  /** Land pull request `number`: armed to merge on green, or merged at once. */
27
31
  mergeRequest(repo: string, number: number): Promise<MergeOutcome>;
28
32
  }
33
+ /** The command of the project's git host: its own package's, else this tool's, the names this tool brings never read from the project. */
34
+ export declare function gitHostCommand(repo: string): Promise<ProvidedCommand | undefined>;
29
35
  /** The git host the project declares, run as a command. */
30
36
  export declare const projectGitHost: GitHost;
31
37
  //# sourceMappingURL=git-host.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"git-host.d.ts","sourceRoot":"","sources":["../src/git-host.ts"],"names":[],"mappings":"AAEA;;;;;;;;GAQG;AAEH,6DAA6D;AAC7D,MAAM,WAAW,aAAa;IAC5B,MAAM,EAAE,MAAM,CAAA;IACd,GAAG,EAAE,MAAM,CAAA;CACZ;AAED,uHAAuH;AACvH,MAAM,MAAM,YAAY,GAAG;IAAE,OAAO,EAAE,YAAY,GAAG,QAAQ,GAAG,UAAU,CAAA;CAAE,GAAG;IAAE,OAAO,EAAE,QAAQ,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,CAAA;AAEnH,mEAAmE;AACnE,MAAM,WAAW,OAAO;IACtB,4IAA4I;IAC5I,eAAe,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,aAAa,GAAG,SAAS,CAAC,CAAA;IACjF,8EAA8E;IAC9E,YAAY,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,YAAY,CAAC,CAAA;CAClE;AAID,2DAA2D;AAC3D,eAAO,MAAM,cAAc,EAAE,OAkB5B,CAAA"}
1
+ {"version":3,"file":"git-host.d.ts","sourceRoot":"","sources":["../src/git-host.ts"],"names":[],"mappings":"AAAA,OAAO,EAA0C,KAAK,eAAe,EAAE,MAAM,qBAAqB,CAAA;AAGlG;;;;;;;;;;;GAWG;AAEH,6DAA6D;AAC7D,MAAM,WAAW,aAAa;IAC5B,MAAM,EAAE,MAAM,CAAA;IACd,GAAG,EAAE,MAAM,CAAA;CACZ;AAED,uHAAuH;AACvH,MAAM,MAAM,YAAY,GAAG;IAAE,OAAO,EAAE,YAAY,GAAG,QAAQ,GAAG,UAAU,CAAA;CAAE,GAAG;IAAE,OAAO,EAAE,QAAQ,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,CAAA;AAEnH,mEAAmE;AACnE,MAAM,WAAW,OAAO;IACtB,4IAA4I;IAC5I,eAAe,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,aAAa,GAAG,SAAS,CAAC,CAAA;IACjF,8EAA8E;IAC9E,YAAY,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,YAAY,CAAC,CAAA;CAClE;AAID,0IAA0I;AAC1I,wBAAsB,cAAc,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,eAAe,GAAG,SAAS,CAAC,CAEvF;AAED,2DAA2D;AAC3D,eAAO,MAAM,cAAc,EAAE,OAkB5B,CAAA"}
package/dist/git-host.js CHANGED
@@ -1,9 +1,14 @@
1
1
  import { readProvidedCommand, runPackageCommand } from '@openagt/agent-data';
2
+ import { BASIC_PACKAGES, basicGitHosts } from './basic-skills.js';
2
3
  const NO_GIT_HOST = 'this project has no git host package';
4
+ /** The command of the project's git host: its own package's, else this tool's, the names this tool brings never read from the project. */
5
+ export async function gitHostCommand(repo) {
6
+ return readProvidedCommand(repo, 'git-host', await basicGitHosts(repo).catch(() => []), BASIC_PACKAGES).catch(() => undefined);
7
+ }
3
8
  /** The git host the project declares, run as a command. */
4
9
  export const projectGitHost = {
5
10
  async requestOfBranch(repo, branch) {
6
- const command = await readProvidedCommand(repo, 'git-host').catch(() => undefined);
11
+ const command = await gitHostCommand(repo);
7
12
  if (!command)
8
13
  return undefined;
9
14
  const result = await runPackageCommand(repo, command, ['requests', '--branch', branch]);
@@ -13,7 +18,7 @@ export const projectGitHost = {
13
18
  return first && typeof first.number === 'number' && typeof first.url === 'string' ? { number: first.number, url: first.url } : undefined;
14
19
  },
15
20
  async mergeRequest(repo, number) {
16
- const command = await readProvidedCommand(repo, 'git-host').catch(() => undefined);
21
+ const command = await gitHostCommand(repo);
17
22
  if (!command)
18
23
  return { outcome: 'failed', error: NO_GIT_HOST };
19
24
  const result = await runPackageCommand(repo, command, ['merge', String(number)]);
@@ -1 +1 @@
1
- {"version":3,"file":"git-host.js","sourceRoot":"","sources":["../src/git-host.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAA;AA6B5E,MAAM,WAAW,GAAG,sCAAsC,CAAA;AAE1D,2DAA2D;AAC3D,MAAM,CAAC,MAAM,cAAc,GAAY;IACrC,KAAK,CAAC,eAAe,CAAC,IAAI,EAAE,MAAM;QAChC,MAAM,OAAO,GAAG,MAAM,mBAAmB,CAAC,IAAI,EAAE,UAAU,CAAC,CAAC,KAAK,CAAC,GAAG,EAAE,CAAC,SAAS,CAAC,CAAA;QAClF,IAAI,CAAC,OAAO;YAAE,OAAO,SAAS,CAAA;QAC9B,MAAM,MAAM,GAAG,MAAM,iBAAiB,CAAC,IAAI,EAAE,OAAO,EAAE,CAAC,UAAU,EAAE,UAAU,EAAE,MAAM,CAAC,CAAC,CAAA;QACvF,IAAI,CAAC,MAAM,CAAC,EAAE,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,MAAM,CAAC;YAAE,OAAO,SAAS,CAAA;QACjE,MAAM,KAAK,GAAG,MAAM,CAAC,MAAM,CAAC,CAAC,CAAoD,CAAA;QACjF,OAAO,KAAK,IAAI,OAAO,KAAK,CAAC,MAAM,KAAK,QAAQ,IAAI,OAAO,KAAK,CAAC,GAAG,KAAK,QAAQ,CAAC,CAAC,CAAC,EAAE,MAAM,EAAE,KAAK,CAAC,MAAM,EAAE,GAAG,EAAE,KAAK,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC,SAAS,CAAA;IAC1I,CAAC;IAED,KAAK,CAAC,YAAY,CAAC,IAAI,EAAE,MAAM;QAC7B,MAAM,OAAO,GAAG,MAAM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AK,EAAE,CAAA;QACjE,MAAM,OAAO,GAAI,MAAM,CAAC,MAAuC,EAAE,OAAO,CAAA;QACxE,OAAO,OAAO,KAAK,YAAY,IAAI,OAAO,KAAK,QAAQ,IAAI,OAAO,KAAK,UAAU,CAAC,CAAC,CAAC,EAAE,OAAO,EAAE,CAAC,CAAC,CAAC,EAAE,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAE,qDAAqD,MAAM,EAAE,EAAE,CAAA;IAC/L,CAAC;CACF,CAAA"}
package/dist/init.d.ts CHANGED
@@ -2,7 +2,7 @@
2
2
  * `init`: this tool's lines written into a dashboard's hooks file, so a project added to the
3
3
  * dashboard can check, start and resume a run with nothing typed by hand. The tool writes its own
4
4
  * lines: the dashboard runs `init` when a project is added (the package declares it under
5
- * `framework.hooks` in its package.json) and holds no copy of them, and a project that wants
5
+ * `openagent.hooks` in its package.json) and holds no copy of them, and a project that wants
6
6
  * another tool writes that tool's lines. The writer takes any tool's lines, so
7
7
  * another tool's `init` (a scheduler's) writes its own through it.
8
8
  *
@@ -29,7 +29,7 @@ export type InitOutcome = {
29
29
  /** This tool's lines into the dashboard's hooks file. */
30
30
  export declare function initHooks(repo: string): Promise<InitOutcome>;
31
31
  /**
32
- * Write `lines` into `<repo>/.the-framework/hooks.yml`: a key is a one-line hook when its line is
32
+ * Write `lines` into `<repo>/.openagent/hooks.yml`: a key is a one-line hook when its line is
33
33
  * a string, a list (`open`, `close`) when it is an array. The dashboard's directory must be there
34
34
  * already (the dashboard makes it when the project is added, and hides it from git); without it
35
35
  * nothing is written. `added` names the keys that gained a line, `kept` the ones already set