@koalaauto/agentchannel 3.45.2 → 3.45.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.
Files changed (40) hide show
  1. package/dist/src/adapters/codex.js +4 -0
  2. package/dist/src/args.d.ts +1 -1
  3. package/dist/src/args.js +7 -60
  4. package/dist/src/cli-admin.d.ts +3 -0
  5. package/dist/src/cli-admin.js +307 -0
  6. package/dist/src/cli-memory.d.ts +3 -0
  7. package/dist/src/cli-memory.js +138 -0
  8. package/dist/src/cli-run.d.ts +28 -0
  9. package/dist/src/cli-run.js +429 -0
  10. package/dist/src/cli-shared.d.ts +73 -0
  11. package/dist/src/cli-shared.js +159 -0
  12. package/dist/src/cli.d.ts +9 -38
  13. package/dist/src/cli.js +21 -1181
  14. package/dist/src/client.d.ts +0 -22
  15. package/dist/src/client.js +0 -29
  16. package/dist/src/codexdaemon.d.ts +22 -0
  17. package/dist/src/codexdaemon.js +68 -0
  18. package/dist/src/invite_people.d.ts +31 -0
  19. package/dist/src/invite_people.js +238 -0
  20. package/dist/src/invite_person.d.ts +1 -1
  21. package/dist/src/invite_person.js +1 -1
  22. package/dist/src/mcp.d.ts +1 -1
  23. package/dist/src/mcp.js +7 -47
  24. package/dist/src/prompts.d.ts +2 -2
  25. package/dist/src/prompts.js +6 -17
  26. package/dist/src/runner/home.d.ts +45 -0
  27. package/dist/src/runner/home.js +150 -0
  28. package/dist/src/runner/runner.d.ts +3 -76
  29. package/dist/src/runner/runner.js +24 -326
  30. package/dist/src/runner/structured.d.ts +20 -0
  31. package/dist/src/runner/structured.js +64 -0
  32. package/dist/src/runner/traces.d.ts +29 -0
  33. package/dist/src/runner/traces.js +119 -0
  34. package/dist/src/sandboxcheck.d.ts +3 -0
  35. package/dist/src/sandboxcheck.js +16 -1
  36. package/dist/src/version.d.ts +1 -1
  37. package/dist/src/version.js +1 -1
  38. package/package.json +1 -1
  39. package/dist/src/import.d.ts +0 -244
  40. package/dist/src/import.js +0 -998
@@ -13,8 +13,8 @@ export function conventionsText(j, ownerName) {
13
13
  }
14
14
  /**
15
15
  * How an agent decides between doing it, asking another agent and asking a person (docs/specs/agent-autonomy.md). The same for
16
- * every agent; the owner's notes and the project's instructions below refine it, the system's limits (sandbox, branch-only push,
17
- * grants) hold whatever any text says.
16
+ * every agent; the owner's notes and the project's instructions below refine it, the system's limits (sandbox, branch-only push)
17
+ * hold whatever any text says.
18
18
  */
19
19
  export const JUDGMENT = [
20
20
  'How to decide (AgentChannel\'s default for every agent):',
@@ -59,17 +59,7 @@ export function refOf(t) {
59
59
  }
60
60
  /** §19: agents speak in links. Trusted rule text. */
61
61
  export const LINK_RULE = '- Refer to tasks, posts and commits by link or ID (TASK-128, a post link, a commit URL), never "the one above" or "that task".';
62
- /** An imported GitHub item: attributed to its GitHub author, not to the hub person it maps to. */
63
- function externalAuthor(p) {
64
- const x = p.external;
65
- if (!x || typeof x !== 'object')
66
- return '';
67
- return `GitHub: ${String(x.author || x.author_name || '?')}`;
68
- }
69
62
  function postAuthor(p) {
70
- const ext = externalAuthor(p);
71
- if (ext)
72
- return ext;
73
63
  if (p.author_type === 'human')
74
64
  return 'human';
75
65
  if (p.author_type === 'system')
@@ -133,7 +123,7 @@ export function channelLines(posts, w, max = CHANNEL_PROMPT_CHARS) {
133
123
  let used = 0;
134
124
  const sorted = [...posts].sort((a, b) => String(b.created ?? '').localeCompare(String(a.created ?? '')));
135
125
  for (const p of sorted) {
136
- const human = p.author_type === 'human' && !externalAuthor(p);
126
+ const human = p.author_type === 'human';
137
127
  const ti = p.kind === 'task' && p.task_info ? p.task_info : null;
138
128
  const item = ti
139
129
  ? { id: p.id, from: postAuthor(p), human, task: { ref: ti.ref, title: ti.title, status: ti.status } }
@@ -150,7 +140,7 @@ export function channelLines(posts, w, max = CHANNEL_PROMPT_CHARS) {
150
140
  }
151
141
  /** Human posts, outside the untrusted block (author_type is set by the hub). */
152
142
  export function formatHumanPosts(posts) {
153
- const hs = posts.filter((p) => p.author_type === 'human' && !externalAuthor(p));
143
+ const hs = posts.filter((p) => p.author_type === 'human');
154
144
  if (!hs.length)
155
145
  return '(none)';
156
146
  return hs.map((p) => `- post id=${p.id} by human ${JSON.stringify(String(p.author_name || 'person'))}: ${JSON.stringify(p.body)}`).join('\n');
@@ -218,8 +208,7 @@ export function formatHumanDecisions(msgs) {
218
208
  return ds
219
209
  .map((m) => {
220
210
  const via = m.via_agent_name ? ` via agent ${JSON.stringify(String(m.via_agent_name))}` : '';
221
- const behalf = m.on_behalf_of_name ? ` on behalf of ${JSON.stringify(String(m.on_behalf_of_name))} per authorization #${String(m.grant || '?')}` : '';
222
- const who = `by human ${JSON.stringify(String(m.author_name || 'owner'))}${via}${behalf}`;
211
+ const who = `by human ${JSON.stringify(String(m.author_name || 'owner'))}${via}`;
223
212
  const files = attachmentList(m);
224
213
  const att = files.length ? ` (attached: ${files.map((f) => JSON.stringify(f.name)).join(', ')}; see files)` : '';
225
214
  return m.kind === 'note'
@@ -300,7 +289,7 @@ function rules(review) {
300
289
  '- Talk through the `ach` CLI (the task id is already set):',
301
290
  ' - `ach progress "<text>"` for short status updates.',
302
291
  ' - `ach ask "<question>"` asks the sender a factual question. Then stop and end your turn; you will be resumed with the answer.',
303
- ' - `ach ask-human "<one question>" --option "A|<detail>|<money>" --option "B|<detail>|<money>" [--recommend 0]` for anything about money, product direction or irreversible actions (your owner decides; add `--to both` when the choice also affects the sender\'s side (never for a fact only your owner knows, such as whether a rerun finished: they answer it, the sender\'s owner cannot), or `--to <name|email>` when the call belongs to a specific person in the task\'s channel, e.g. an ops decision to the ops owner; your owner is cc\'d). One question per request; 2–3 options, recommended first; state the money/impact of each option. Never ask what you can verify yourself (files, commands, Memory) or what resolves itself. The person replies by picking an option or typing; that reply is the decision. Then stop. If it says an authorization grant covers some options, pick one that fits and answer it with the printed `ach decide ... --grant <id> --option <n>`; never claim a person decided anything they did not reply.',
292
+ ' - `ach ask-human "<one question>" --option "A|<detail>|<money>" --option "B|<detail>|<money>" [--recommend 0]` for anything about money, product direction or irreversible actions (your owner decides; add `--to both` when the choice also affects the sender\'s side (never for a fact only your owner knows, such as whether a rerun finished: they answer it, the sender\'s owner cannot), or `--to <name|email>` when the call belongs to a specific person in the task\'s channel, e.g. an ops decision to the ops owner; your owner is cc\'d). One question per request; 2–3 options, recommended first; state the money/impact of each option. Never ask what you can verify yourself (files, commands, Memory) or what resolves itself. The person replies by picking an option or typing; that reply is the decision. Then stop. Never claim a person decided anything they did not reply.',
304
293
  ' - `ach complete --result-file .ach/<file>` (or `ach complete "<text>"`) when done: summary, how it was verified. It becomes the pull request\'s description; the runner links the pull request on the task.',
305
294
  ' - `ach fail "<reason>" --cause <secret|network|permission|workspace|quota|task|other> [--needs "<what is missing>"]` if it cannot be done. The cause tells your owner what to fix: secret, network, permission, workspace and quota only they can (say exactly what is missing in --needs: a variable name, a host, a repo); task when the task itself is wrong (name the agent or repository that should do it).',
306
295
  completeRule(review),
@@ -0,0 +1,45 @@
1
+ /**
2
+ * Runner files a spawned agent must never read: the agent key (config.json), other
3
+ * runs' tokens (runs.json), session ids and logs. Not the whole home: the per-task
4
+ * worktrees live in <home>/work and must stay readable.
5
+ */
6
+ export declare function secretPaths(home: string): string[];
7
+ /**
8
+ * Runtime config a spawned agent's CLI needs from the real home: linked into the
9
+ * scratch home. Claude only: its user settings, hooks and MCP servers are not
10
+ * loaded anyway (settingSources [], strictMcpConfig). Codex is NOT linked: it
11
+ * gets its own CODEX_HOME (see prepareCodexHome).
12
+ */
13
+ export declare const RUNTIME_HOME_LINKS: string[];
14
+ /**
15
+ * macOS (live test): Claude Code keeps its login in the login keychain, which
16
+ * `security` finds through $HOME/Library/Keychains. Without this link a worker
17
+ * with a scratch HOME reports "Not logged in". Only the folder is linked; the
18
+ * sandbox still denies the worker's tools every path under the real home.
19
+ */
20
+ export declare function runtimeHomeLinks(platform?: NodeJS.Platform): string[];
21
+ /** The config.toml of a worker's own CODEX_HOME: nothing from the user's global config (no mcp_servers, profiles, notify hooks). */
22
+ export declare const CODEX_WORKER_CONFIG: string;
23
+ /**
24
+ * Codex isolation (live test): a worker run must not load the user's global
25
+ * Codex config (~/.codex/config.toml: MCP servers with their own credentials,
26
+ * profiles, notify hooks, AGENTS.md). The run gets its own CODEX_HOME holding
27
+ * only a generated config.toml and a symlink to the login file (auth.json) of
28
+ * the user's Codex home. The login file is placed by path only: it is never
29
+ * opened or copied here. Codex rewrites it in place through the link, so a
30
+ * refreshed login stays the user's. Sessions of the run stay in this home, so
31
+ * a resumed run of the same task finds its thread.
32
+ */
33
+ export declare function prepareCodexHome(home: string, realCodexHome?: string, platform?: NodeJS.Platform): string;
34
+ /** The user's real home: HOME, or USERPROFILE on Windows, where HOME is usually not set. */
35
+ export declare function realHomeOf(env: NodeJS.ProcessEnv | Record<string, string | undefined>, platform?: NodeJS.Platform): string | undefined;
36
+ /**
37
+ * B1: a per-task scratch HOME for spawned agents, so `~/.config/agentchannel`
38
+ * (agent key file, admin session, runner state) is not reachable through
39
+ * $HOME. Runtime config (.claude, .codex) is linked, the git identity
40
+ * (.gitconfig) copied; npm keeps the real cache via npm_config_cache.
41
+ */
42
+ export declare function prepareAgentHome(root: string, agentName: string, key: string, realHome?: string, realCodexHome?: string, platform?: NodeJS.Platform): {
43
+ home: string;
44
+ env: Record<string, string>;
45
+ };
@@ -0,0 +1,150 @@
1
+ // The scratch HOME a spawned agent runs in (B1): the runner's own files out of reach, the runtime's config linked or copied in,
2
+ // Codex given a home of its own. Pure filesystem work, no hub.
3
+ import { copyFileSync, existsSync, linkSync, lstatSync, mkdirSync, rmSync, symlinkSync, writeFileSync } from 'node:fs';
4
+ import { dirname, join } from 'node:path';
5
+ import { linkWindowsSandbox, WINDOWS_ELEVATED_CONFIG } from '../codexhome.js';
6
+ /**
7
+ * Runner files a spawned agent must never read: the agent key (config.json), other
8
+ * runs' tokens (runs.json), session ids and logs. Not the whole home: the per-task
9
+ * worktrees live in <home>/work and must stay readable.
10
+ */
11
+ export function secretPaths(home) {
12
+ return ['config.json', 'agent-key', 'admin-session', 'cf-secret', 'runs.json', 'sessions.json', 'logs'].map((f) => join(home, f));
13
+ }
14
+ /**
15
+ * Runtime config a spawned agent's CLI needs from the real home: linked into the
16
+ * scratch home. Claude only: its user settings, hooks and MCP servers are not
17
+ * loaded anyway (settingSources [], strictMcpConfig). Codex is NOT linked: it
18
+ * gets its own CODEX_HOME (see prepareCodexHome).
19
+ */
20
+ export const RUNTIME_HOME_LINKS = ['.claude', '.claude.json'];
21
+ /**
22
+ * macOS (live test): Claude Code keeps its login in the login keychain, which
23
+ * `security` finds through $HOME/Library/Keychains. Without this link a worker
24
+ * with a scratch HOME reports "Not logged in". Only the folder is linked; the
25
+ * sandbox still denies the worker's tools every path under the real home.
26
+ */
27
+ export function runtimeHomeLinks(platform = process.platform) {
28
+ return platform === 'darwin' ? [...RUNTIME_HOME_LINKS, 'Library/Keychains'] : RUNTIME_HOME_LINKS;
29
+ }
30
+ /** The config.toml of a worker's own CODEX_HOME: nothing from the user's global config (no mcp_servers, profiles, notify hooks). */
31
+ export const CODEX_WORKER_CONFIG = [
32
+ '# Written by agentchannel for background worker runs. The user\'s global Codex',
33
+ '# config (MCP servers, profiles, hooks, AGENTS.md) is deliberately not used here.',
34
+ '# Model and sandbox are set per run by the runner.',
35
+ '',
36
+ ].join('\n');
37
+ /**
38
+ * Codex isolation (live test): a worker run must not load the user's global
39
+ * Codex config (~/.codex/config.toml: MCP servers with their own credentials,
40
+ * profiles, notify hooks, AGENTS.md). The run gets its own CODEX_HOME holding
41
+ * only a generated config.toml and a symlink to the login file (auth.json) of
42
+ * the user's Codex home. The login file is placed by path only: it is never
43
+ * opened or copied here. Codex rewrites it in place through the link, so a
44
+ * refreshed login stays the user's. Sessions of the run stay in this home, so
45
+ * a resumed run of the same task finds its thread.
46
+ */
47
+ export function prepareCodexHome(home, realCodexHome, platform = process.platform) {
48
+ const dir = join(home, '.codex');
49
+ try {
50
+ // an older scratch home linked the whole ~/.codex: replace the link
51
+ if (lstatSync(dir).isSymbolicLink())
52
+ rmSync(dir);
53
+ }
54
+ catch {
55
+ /* not there */
56
+ }
57
+ mkdirSync(dir, { recursive: true, mode: 0o700 });
58
+ // Windows: the elevated sandbox, once its one-time setup is done (codexhome.ts)
59
+ const elevated = platform === 'win32' && linkWindowsSandbox(dir, realCodexHome);
60
+ writeFileSync(join(dir, 'config.toml'), CODEX_WORKER_CONFIG + (elevated ? WINDOWS_ELEVATED_CONFIG : ''), { mode: 0o600 });
61
+ if (realCodexHome) {
62
+ const src = join(realCodexHome, 'auth.json');
63
+ const dst = join(dir, 'auth.json');
64
+ let have = false;
65
+ try {
66
+ lstatSync(dst);
67
+ have = true;
68
+ }
69
+ catch {
70
+ /* not there */
71
+ }
72
+ if (!have && existsSync(src)) {
73
+ try {
74
+ symlinkSync(src, dst);
75
+ }
76
+ catch {
77
+ // Windows makes file symlinks only with developer mode or admin; a hard link needs neither
78
+ if (platform === 'win32') {
79
+ try {
80
+ linkSync(src, dst);
81
+ }
82
+ catch {
83
+ /* best effort: codex then reports "not logged in" */
84
+ }
85
+ }
86
+ }
87
+ }
88
+ }
89
+ return dir;
90
+ }
91
+ /** The user's real home: HOME, or USERPROFILE on Windows, where HOME is usually not set. */
92
+ export function realHomeOf(env, platform = process.platform) {
93
+ return env.HOME || (platform === 'win32' ? env.USERPROFILE : undefined) || undefined;
94
+ }
95
+ /**
96
+ * B1: a per-task scratch HOME for spawned agents, so `~/.config/agentchannel`
97
+ * (agent key file, admin session, runner state) is not reachable through
98
+ * $HOME. Runtime config (.claude, .codex) is linked, the git identity
99
+ * (.gitconfig) copied; npm keeps the real cache via npm_config_cache.
100
+ */
101
+ export function prepareAgentHome(root, agentName, key, realHome, realCodexHome, platform = process.platform) {
102
+ const safe = (x) => x.replace(/[^A-Za-z0-9_.-]/g, '_').slice(0, 80);
103
+ const home = join(root, safe(agentName), safe(key));
104
+ mkdirSync(home, { recursive: true, mode: 0o700 });
105
+ // the run's own temporary directory, the one place besides its task directory a sandboxed run writes: tools need one, and
106
+ // Claude Code keeps its sandbox's network bridge there (a sandbox that reads only its own paths cannot reach /tmp)
107
+ const tmp = join(home, 'tmp');
108
+ mkdirSync(tmp, { recursive: true, mode: 0o700 });
109
+ const env = { HOME: home, TMPDIR: tmp };
110
+ // Windows programs find the home in USERPROFILE and the temporary directory in TEMP/TMP
111
+ if (platform === 'win32')
112
+ Object.assign(env, { USERPROFILE: home, TEMP: tmp, TMP: tmp });
113
+ if (!realHome) {
114
+ env.CODEX_HOME = prepareCodexHome(home, realCodexHome, platform);
115
+ return { home, env };
116
+ }
117
+ for (const name of runtimeHomeLinks(platform)) {
118
+ const src = join(realHome, name);
119
+ const dst = join(home, name);
120
+ if (!existsSync(src))
121
+ continue;
122
+ try {
123
+ lstatSync(dst);
124
+ }
125
+ catch {
126
+ try {
127
+ mkdirSync(dirname(dst), { recursive: true, mode: 0o700 });
128
+ // a junction links a Windows directory without developer mode or admin
129
+ symlinkSync(src, dst, platform === 'win32' && lstatSync(src).isDirectory() ? 'junction' : undefined);
130
+ }
131
+ catch {
132
+ /* best effort */
133
+ }
134
+ }
135
+ }
136
+ const git = join(realHome, '.gitconfig');
137
+ if (existsSync(git)) {
138
+ try {
139
+ copyFileSync(git, join(home, '.gitconfig'));
140
+ }
141
+ catch {
142
+ /* best effort */
143
+ }
144
+ }
145
+ const npmCache = join(realHome, '.npm');
146
+ if (existsSync(npmCache))
147
+ env.npm_config_cache = npmCache;
148
+ env.CODEX_HOME = prepareCodexHome(home, realCodexHome || join(realHome, '.codex'), platform);
149
+ return { home, env };
150
+ }
@@ -5,6 +5,8 @@ import { RunnerState } from './state.js';
5
5
  import { type Workspace } from './workspace.js';
6
6
  import { TraceRecorder } from '../trace.js';
7
7
  import { type SandboxStatus } from '../sandboxcheck.js';
8
+ export * from './home.js';
9
+ export * from './structured.js';
8
10
  export type RunnerClient = Pick<Client, 'me' | 'inbox' | 'claim' | 'getTask' | 'postMessage' | 'complete' | 'fail' | 'usage' | 'heartbeat' | 'answerRun' | 'endRun'> & Partial<Pick<Client, 'download' | 'githubToken' | 'channelPosts' | 'mentionRun' | 'mentionEnd' | 'mentionUsage' | 'promptSize' | 'reportSetup' | 'reportRepos' | 'reportRunner' | 'release' | 'putTrace' | 'pushToken' | 'taskPr' | 'prepareRun' | 'prepared'>>;
9
11
  export interface RunnerOptions {
10
12
  client: RunnerClient;
@@ -127,51 +129,6 @@ export declare function openRequests(messages: Message[], myId: string): Message
127
129
  export declare function isHumanNoteTo(m: Message, myId: string): boolean;
128
130
  /** Answers / decisions replying to something I asked, and human notes to me, that the worker has not been shown yet. */
129
131
  export declare function unseenReplies(messages: Message[], myId: string, seen: string[]): Message[];
130
- /**
131
- * Runner files a spawned agent must never read: the agent key (config.json), other
132
- * runs' tokens (runs.json), session ids and logs. Not the whole home: the per-task
133
- * worktrees live in <home>/work and must stay readable.
134
- */
135
- export declare function secretPaths(home: string): string[];
136
- /**
137
- * Runtime config a spawned agent's CLI needs from the real home: linked into the
138
- * scratch home. Claude only: its user settings, hooks and MCP servers are not
139
- * loaded anyway (settingSources [], strictMcpConfig). Codex is NOT linked: it
140
- * gets its own CODEX_HOME (see prepareCodexHome).
141
- */
142
- export declare const RUNTIME_HOME_LINKS: string[];
143
- /**
144
- * macOS (live test): Claude Code keeps its login in the login keychain, which
145
- * `security` finds through $HOME/Library/Keychains. Without this link a worker
146
- * with a scratch HOME reports "Not logged in". Only the folder is linked; the
147
- * sandbox still denies the worker's tools every path under the real home.
148
- */
149
- export declare function runtimeHomeLinks(platform?: NodeJS.Platform): string[];
150
- /** The config.toml of a worker's own CODEX_HOME: nothing from the user's global config (no mcp_servers, profiles, notify hooks). */
151
- export declare const CODEX_WORKER_CONFIG: string;
152
- /**
153
- * Codex isolation (live test): a worker run must not load the user's global
154
- * Codex config (~/.codex/config.toml: MCP servers with their own credentials,
155
- * profiles, notify hooks, AGENTS.md). The run gets its own CODEX_HOME holding
156
- * only a generated config.toml and a symlink to the login file (auth.json) of
157
- * the user's Codex home. The login file is placed by path only: it is never
158
- * opened or copied here. Codex rewrites it in place through the link, so a
159
- * refreshed login stays the user's. Sessions of the run stay in this home, so
160
- * a resumed run of the same task finds its thread.
161
- */
162
- export declare function prepareCodexHome(home: string, realCodexHome?: string, platform?: NodeJS.Platform): string;
163
- /** The user's real home: HOME, or USERPROFILE on Windows, where HOME is usually not set. */
164
- export declare function realHomeOf(env: NodeJS.ProcessEnv | Record<string, string | undefined>, platform?: NodeJS.Platform): string | undefined;
165
- /**
166
- * B1: a per-task scratch HOME for spawned agents, so `~/.config/agentchannel`
167
- * (agent key file, admin session, runner state) is not reachable through
168
- * $HOME. Runtime config (.claude, .codex) is linked, the git identity
169
- * (.gitconfig) copied; npm keeps the real cache via npm_config_cache.
170
- */
171
- export declare function prepareAgentHome(root: string, agentName: string, key: string, realHome?: string, realCodexHome?: string, platform?: NodeJS.Platform): {
172
- home: string;
173
- env: Record<string, string>;
174
- };
175
132
  export declare function budgetBlocked(me: Agent): boolean;
176
133
  export declare class Runner {
177
134
  readonly state: RunnerState;
@@ -210,8 +167,7 @@ export declare class Runner {
210
167
  private sandboxReported?;
211
168
  private sandboxRecheck;
212
169
  /** Execution traces the hub has not taken yet (kept on disk too), and the last trace of each task (a commit joins it). */
213
- private traceQueue;
214
- private lastTrace;
170
+ private traces;
215
171
  constructor(opts: RunnerOptions);
216
172
  private log;
217
173
  private taskLog;
@@ -338,14 +294,6 @@ export declare class Runner {
338
294
  private execute;
339
295
  /** decisions §34: the capabilities server of one run, or undefined when nothing is declared (or the run is in the cloud). */
340
296
  private capsFor;
341
- private traceDir;
342
- /** Traces an earlier process could not upload are tried again. */
343
- private loadPendingTraces;
344
- /** Build and send the trace of the run that just ended. Never throws; a failed upload is kept and retried. */
345
- private uploadTrace;
346
- private persistTrace;
347
- /** Send what is waiting (a few at a time). A trace never holds up a task: failures are logged and tried again on the next poll. */
348
- private flushTraces;
349
297
  /** Polls until stop() or a 401 (B7: resolves 'unauthorized' after aborting every job). */
350
298
  start(): Promise<'stopped' | 'unauthorized'>;
351
299
  /** Stop polling; abort running jobs without failing their tasks (they resume on restart). */
@@ -358,24 +306,3 @@ export declare function gcWorktrees(client: Pick<Client, 'getTask'>, ws: Workspa
358
306
  log?: (s: string) => void;
359
307
  keepFailed?: boolean;
360
308
  }): Promise<string[]>;
361
- /**
362
- * The JSON object a structured run ended with. Codex returns it bare (outputSchema); a remote run's final message may
363
- * wrap it in a ```json fence or a sentence, so the last {...} in the text is taken. Throws when there is none.
364
- */
365
- export declare function parseStructured(text: string): {
366
- action?: string;
367
- text?: string;
368
- evidence?: string;
369
- };
370
- /** What a read-ahead found (its final JSON object). */
371
- export interface PrepareOut {
372
- code: boolean;
373
- files: string[];
374
- plan: string;
375
- questions: string[];
376
- }
377
- /** The read-ahead's final JSON object: the last one in its message (bare, fenced, or after a sentence). Throws when there is none. */
378
- export declare function parsePrepared(text: string): PrepareOut;
379
- /** The draft as the owner reads it on the task: the plan, the files, the questions, and the small-job rule it fell inside. */
380
- export declare function draftText(o: PrepareOut, rule: string): string;
381
- export {};