@koalaauto/agentchannel 3.97.0 → 3.97.1

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,299 @@
1
+ // What a runner tells the hub about itself, apart from the work it does: what keeps it from working, the repositories it knows,
2
+ // how it runs tasks and what it can reach, the models its runtime offers, a first profile, the index of its project memory.
3
+ // Each is sent when it changed (or once), tried again while the hub does not have it, and left alone on an older hub (404).
4
+ // The runner calls them from its poll loop (runner.ts); nothing here takes or runs a task.
5
+ import { tmpdir } from 'node:os';
6
+ import { join } from 'node:path';
7
+ import { isRuntime, runRefusal } from '../adapters/spec.js';
8
+ import { capsPath, loadCaps } from '../caps.js';
9
+ import { HubError } from '../client.js';
10
+ import { inheritedEnv } from '../env.js';
11
+ import { summarizeRuntimeError } from '../envcheck.js';
12
+ import { memoryIndex, ownerMemoryDir } from './context.js';
13
+ import { prepareAgentHome, realHomeOf, secretPaths } from './home.js';
14
+ /** How often the runner asks its runtime which models it offers. */
15
+ export const MODELS_EVERY_MS = 24 * 60 * 60_000;
16
+ /** How often the runner looks whether the project's memory index changed (it reports it to the hub when it did). */
17
+ const PROJECT_MEMORY_EVERY_MS = 5 * 60_000;
18
+ const is401 = (e) => e instanceof HubError && e.status === 401;
19
+ export class RunnerReports {
20
+ o;
21
+ h;
22
+ constructor(o, h) {
23
+ this.o = o;
24
+ this.h = h;
25
+ }
26
+ /** what the hub was last told keeps this runner from working (a JSON key) */
27
+ setupReported;
28
+ /** Tell the hub what keeps this runner from working, when that changed: a failed check first, else an account that cannot run. */
29
+ async reportSetup(st) {
30
+ const report = !st ? null : { tool: st.tool, problem: st.problem ?? 'failed', ...(st.detail ? { detail: st.detail } : {}), ...(st.fix ? { fix: st.fix } : {}) };
31
+ const key = JSON.stringify(report);
32
+ if (key !== this.setupReported && this.o.client.reportSetup) {
33
+ try {
34
+ await this.o.client.reportSetup(report);
35
+ this.setupReported = key;
36
+ }
37
+ catch (e) {
38
+ if (is401(e))
39
+ this.h.authFailed('setup', e);
40
+ // an older hub without /me/setup: the log above is all there is
41
+ else if (e instanceof HubError && e.status === 404)
42
+ this.setupReported = key;
43
+ else
44
+ this.h.log(`setup report: ${e?.message ?? e}`);
45
+ }
46
+ }
47
+ }
48
+ /** Tell the hub which repo names this runner knows, so a task for another repo is refused when it is sent. Tried on every
49
+ * poll until the hub has it: a hub that was unreachable at start would otherwise keep the previous list until a restart. */
50
+ reposReported = false;
51
+ async reportRepos() {
52
+ if (this.reposReported)
53
+ return;
54
+ // an empty list is reported too: the hub then refuses a task that names a repo, and forgets names an earlier start gave
55
+ const names = await this.o.workspace.repoNames?.();
56
+ if (!names || !this.o.client.reportRepos) {
57
+ this.reposReported = true;
58
+ return;
59
+ }
60
+ try {
61
+ await this.o.client.reportRepos(names, await this.o.workspace.repoRemotes?.().catch(() => undefined));
62
+ this.reposReported = true;
63
+ }
64
+ catch (e) {
65
+ // an older hub without /me/repos: nothing is checked there, which is how it was
66
+ if (e instanceof HubError && e.status === 404)
67
+ this.reposReported = true;
68
+ else if (!this.reposLogged) {
69
+ this.reposLogged = true;
70
+ this.h.log(`repos report: ${e?.message ?? e} (trying again with the next poll)`);
71
+ }
72
+ }
73
+ }
74
+ reposLogged = false;
75
+ /** An agent with no profile yet gets a first one, once: a short read-only run on a light model reads the repositories it works in
76
+ * and writes a sentence or two. The hub keeps it only while the profile is empty; the weekly refresh (the system agent, from what the
77
+ * agent did) rewrites it after. The description is the owner's and is never written here. Tried again at the next start when it
78
+ * could not be had. */
79
+ describeDone = false;
80
+ describeBusy = false;
81
+ describeTries = 0;
82
+ describeNextAt = 0;
83
+ async describeAgent() {
84
+ const { adapter, client, workspace } = this.o;
85
+ if (this.describeDone || this.describeBusy || Date.now() < this.describeNextAt || this.h.cloud || !client.reportProfile || !workspace.repoDirs)
86
+ return;
87
+ this.describeBusy = true;
88
+ try {
89
+ const me = await this.h.ensureMe();
90
+ if (me.role === 'system' || String(me.profile ?? '').trim()) {
91
+ this.describeDone = true;
92
+ return;
93
+ }
94
+ const dirs = Object.entries(await workspace.repoDirs()).slice(0, 4);
95
+ if (!dirs.length)
96
+ return;
97
+ const baseEnv = this.o.baseEnv ?? process.env;
98
+ const realHome = realHomeOf(baseEnv);
99
+ const { env } = prepareAgentHome(this.o.agentHomesDir ?? join(tmpdir(), 'ach-homes'), me.name, 'describe', realHome, baseEnv.CODEX_HOME || undefined);
100
+ const run = async (pick) => {
101
+ const ctl = new AbortController();
102
+ const timer = setTimeout(() => ctl.abort(), 3 * 60_000);
103
+ try {
104
+ const refused = runRefusal(adapter.spec, { perm: 'read', ...(Array.isArray(me.net_allow) ? { netAllow: me.net_allow } : {}) });
105
+ if (refused)
106
+ return { ok: false, finalText: '', error: `not run: ${refused}` };
107
+ return await adapter.run({
108
+ ...(pick ? { model: pick.model, effort: pick.effort } : {}),
109
+ prompt: describePrompt(me.name, dirs, me.lang),
110
+ cwd: dirs[0][1],
111
+ perm: 'read',
112
+ mode: 'answer',
113
+ env: { ...inheritedEnv(baseEnv, this.o.passEnv), ...env },
114
+ signal: ctl.signal,
115
+ hub: this.o.hub,
116
+ denyReadPaths: secretPaths(this.o.home),
117
+ ...(realHome ? { realHome } : {}),
118
+ readRoots: dirs.map(([, d]) => d),
119
+ ...(env.TMPDIR ? { tmpDir: env.TMPDIR } : {}),
120
+ ...(Array.isArray(me.net_allow) ? { netAllow: me.net_allow } : {}),
121
+ ...(adapter.spec.budget ? { maxBudgetUsd: 0.05 } : {}),
122
+ ...(this.h.structured ? { outputSchema: DESCRIBE_SCHEMA } : {}),
123
+ onEvent: () => { },
124
+ });
125
+ }
126
+ finally {
127
+ clearTimeout(timer);
128
+ }
129
+ };
130
+ // the light model where the runtime has one; a model the account cannot use falls back to the runtime's default
131
+ const light = adapter.spec.lightModel;
132
+ let r = await run(light);
133
+ if (!r.ok && light)
134
+ r = await run(undefined);
135
+ const text = cleanDescription(r.finalText);
136
+ if (!r.ok || !text)
137
+ throw new Error(r.error ? summarizeRuntimeError(r.error).slice(0, 160) : 'no profile came back');
138
+ await client.reportProfile(text);
139
+ this.describeDone = true;
140
+ this.h.log(`profile: ${text.slice(0, 120)}`);
141
+ }
142
+ catch (e) {
143
+ // an older hub without /me/profile (404) says nothing and is left alone; any other failure (a hub or network that was not
144
+ // reachable while many runners restarted at once, a model that said nothing) is tried again, three times in all per start
145
+ if (e instanceof HubError && e.status === 404)
146
+ this.describeDone = true;
147
+ else if (++this.describeTries >= 3) {
148
+ this.describeDone = true;
149
+ this.h.log(`profile: ${String(e?.message ?? e).slice(0, 200)} (gave up until the next start)`);
150
+ }
151
+ else {
152
+ this.describeNextAt = Date.now() + (this.o.describeRetryMs ?? 5 * 60_000);
153
+ this.h.log(`profile: ${String(e?.message ?? e).slice(0, 200)} (trying again in ${Math.round((this.o.describeRetryMs ?? 5 * 60_000) / 60_000)} min)`);
154
+ }
155
+ }
156
+ finally {
157
+ this.describeBusy = false;
158
+ }
159
+ }
160
+ /** Tell the hub how this runner runs tasks (its --perm, the tool, the names it passes with --pass-env), once, so the agent's
161
+ * owner sees on its page what a task sent to it can reach. Tried on every poll until the hub has it; an older hub (404) is left alone. */
162
+ runnerReported = false;
163
+ /** the capabilities last told to the hub (decisions §34, §38): an edit of the file is reported again on the next poll */
164
+ capsReported = '';
165
+ async reportRunner() {
166
+ if (!this.o.client.reportRunner)
167
+ return;
168
+ // the names and descriptions only, never the commands: teammates see them in the agent directory
169
+ // decisions §38: MCP servers with their tool names, skills by name; never a URL, a command or a credential
170
+ const decl = this.h.cloud ? undefined : loadCaps(this.o.capsFile ?? capsPath(this.o.home));
171
+ const capabilities = decl
172
+ ? [
173
+ ...decl.caps.map((c) => ({ kind: 'command', name: c.name, description: c.description.slice(0, 300) })),
174
+ ...decl.mcp.map((m) => ({ kind: 'mcp', name: m.name, description: m.description.slice(0, 300), tools: m.tools.slice(0, 50) })),
175
+ ...decl.skills.map((k) => ({ kind: 'skill', name: k.name, description: k.description.slice(0, 300) })),
176
+ ].slice(0, 50)
177
+ : [];
178
+ const sig = JSON.stringify(capabilities);
179
+ if (this.runnerReported && sig === this.capsReported)
180
+ return;
181
+ const runtime = this.o.adapter.name;
182
+ if (!isRuntime(runtime)) {
183
+ this.runnerReported = true;
184
+ this.capsReported = sig;
185
+ return;
186
+ }
187
+ try {
188
+ // review: this runner knows the owner's review step (a task it finishes may wait in awaiting_review, decisions §36)
189
+ await this.o.client.reportRunner({ perm: this.o.perm, runtime, pass_env: [...new Set(this.o.passEnv ?? [])], capabilities, review: true, ...(this.o.startInfo ?? {}) });
190
+ this.runnerReported = true;
191
+ this.capsReported = sig;
192
+ }
193
+ catch (e) {
194
+ if (e instanceof HubError && e.status === 404) {
195
+ this.runnerReported = true;
196
+ this.capsReported = sig;
197
+ }
198
+ }
199
+ }
200
+ /**
201
+ * Tell the hub which models the runtime offers here and which one a run uses when none is picked (the agent's settings
202
+ * page lists them): when the runner starts, again a day later (a login or the tool's catalog changes), and at once after
203
+ * a run's model was rejected. Asked with the environment a run gets, so the list is what this agent's login can use.
204
+ */
205
+ modelsAt = 0;
206
+ modelsBusy = false;
207
+ /** set when a run's model was rejected: the list on the hub is out of date */
208
+ modelsStale = false;
209
+ /** an older hub without /me/models, or a runtime that cannot list: asked no more */
210
+ modelsOff = false;
211
+ modelsLogged = '';
212
+ async reportModels() {
213
+ const adapter = this.o.adapter;
214
+ if (this.modelsOff || this.modelsBusy || !adapter.listModels || !this.o.client.reportModels)
215
+ return;
216
+ if (this.modelsAt && !this.modelsStale && Date.now() - this.modelsAt < MODELS_EVERY_MS)
217
+ return;
218
+ this.modelsBusy = true;
219
+ this.modelsAt = Date.now();
220
+ this.modelsStale = false;
221
+ try {
222
+ const me = await this.h.ensureMe();
223
+ const baseEnv = this.o.baseEnv ?? process.env;
224
+ const realHome = realHomeOf(baseEnv);
225
+ const { home, env } = prepareAgentHome(this.o.agentHomesDir ?? join(tmpdir(), 'ach-homes'), me.name, 'model-list', realHome, baseEnv.CODEX_HOME || undefined);
226
+ const list = await adapter.listModels({ env: { ...inheritedEnv(baseEnv, this.o.passEnv), ...env }, cwd: home, ...(realHome ? { realHome } : {}) });
227
+ await this.o.client.reportModels({ runtime: adapter.name, ...list });
228
+ this.modelsLogged = '';
229
+ }
230
+ catch (e) {
231
+ if (e instanceof HubError && e.status === 404)
232
+ this.modelsOff = true;
233
+ const msg = String(e?.message ?? e).slice(0, 300);
234
+ // a list that cannot be had is not worth a line every day: said once until it changes
235
+ if (!this.modelsOff && msg !== this.modelsLogged) {
236
+ this.modelsLogged = msg;
237
+ this.h.log(`model list: ${msg} (trying again in a day)`);
238
+ }
239
+ }
240
+ finally {
241
+ this.modelsBusy = false;
242
+ }
243
+ }
244
+ /** the project memory index last told to the hub, and when the file was last looked at */
245
+ projectMemoryReported;
246
+ projectMemoryCheckedAt = 0;
247
+ /**
248
+ * Tell the hub what this agent knows about its project: the index of the owner's memory for it on this machine (one line per
249
+ * note, never the notes). The owner's Yoda reads it, so it knows what each of its parts knows (primary-agent-design §11.15).
250
+ * Looked at every few minutes, sent when it changed. Not for a team agent (no person) or a cloud run (no machine).
251
+ */
252
+ async reportProjectMemory(now = Date.now()) {
253
+ if (!this.o.client.reportProjectMemory || this.h.cloud || !this.h.me() || this.h.me()?.kind === 'team')
254
+ return;
255
+ if (now - this.projectMemoryCheckedAt < PROJECT_MEMORY_EVERY_MS)
256
+ return;
257
+ this.projectMemoryCheckedAt = now;
258
+ const dir = ownerMemoryDir(this.o.dir, realHomeOf(this.o.baseEnv ?? process.env));
259
+ const index = dir ? memoryIndex(dir) : '';
260
+ if (index === this.projectMemoryReported || (!index && this.projectMemoryReported === undefined))
261
+ return;
262
+ try {
263
+ await this.o.client.reportProjectMemory(index);
264
+ this.projectMemoryReported = index;
265
+ }
266
+ catch (e) {
267
+ // an older hub has no such route: say nothing more
268
+ if (e instanceof HubError && (e.status === 404 || e.status === 400))
269
+ this.projectMemoryReported = index;
270
+ }
271
+ }
272
+ }
273
+ /** The light model that writes an agent's first profile, per runtime (none listed: the runtime's default). A runtime that does not
274
+ * take it runs the default instead. */
275
+ const DESCRIBE_SCHEMA = { type: 'object', properties: { profile: { type: 'string' } }, required: ['profile'], additionalProperties: false };
276
+ function describePrompt(name, dirs, lang) {
277
+ const where = dirs.map(([n, d]) => `- ${n}: ${d}`).join('\n');
278
+ return [
279
+ `You are writing the one-paragraph profile of the agent "${name}" for the team directory. Teammates and other agents read it to decide whether to send this agent a piece of work.`,
280
+ `The agent works in these repositories (read-only for you; start with README, CLAUDE.md, AGENTS.md and the top-level layout, do not read everything):`,
281
+ where,
282
+ `Write one or two sentences in ${lang === 'en' ? 'English' : 'Chinese'}: what the repository is for and what kind of work belongs with this agent. Be specific (name the main parts or systems), not generic. At most 160 characters. Plain text only: no markdown, no quotes, no list, no preface.`,
283
+ 'Answer with the profile text only.',
284
+ ].filter(Boolean).join('\n\n');
285
+ }
286
+ /** The model's text as a profile: its first paragraph, without markdown marks or wrapping quotes, at most 300 characters. */
287
+ export function cleanDescription(raw) {
288
+ let t = String(raw ?? '').trim();
289
+ try {
290
+ const j = JSON.parse(t);
291
+ if (j && typeof j.profile === 'string')
292
+ t = j.profile;
293
+ }
294
+ catch {
295
+ /* plain text */
296
+ }
297
+ t = t.split(/\n\s*\n/)[0].replace(/\*\*|__|[`*]|^\s*[#>]+\s*/gm, '').replace(/\s+/g, ' ').trim().replace(/^["'“”「」]+|["'“”「」]+$/g, '').trim();
298
+ return t.slice(0, 300);
299
+ }
@@ -1,12 +1,15 @@
1
- import { type AdapterResult, type RuntimeAdapter } from '../adapters/types.js';
2
- import { type Agent, type Client, type MentionItem, type MentionOutcome, type Message } from '../client.js';
1
+ import { type RuntimeAdapter } from '../adapters/types.js';
2
+ import { type Agent, type Client } from '../client.js';
3
3
  import { type Perm } from '../perm.js';
4
- import { RunnerState, type RunRecord } from './state.js';
4
+ import { RunnerState } from './state.js';
5
5
  import { type Workspace } from './workspace.js';
6
- import { TraceRecorder } from '../trace.js';
7
6
  import { type SandboxStatus } from '../sandboxcheck.js';
7
+ import { RunnerReports } from './reports.js';
8
+ import { type Active, type Job } from './jobs.js';
8
9
  export * from './home.js';
9
10
  export * from './structured.js';
11
+ export { cleanDescription, MODELS_EVERY_MS } from './reports.js';
12
+ export { approves, isHumanNoteTo, jobKey, mentionOutcome, newRunId, nothingGoing, openRequests, refusedReply, takenOver, unseenReplies, type Job } from './jobs.js';
10
13
  export type RunnerClient = Pick<Client, 'me' | 'inbox' | 'claim' | 'getTask' | 'postMessage' | 'complete' | 'fail' | 'usage' | 'heartbeat' | 'answerRun' | 'endRun'> & Partial<Pick<Client, 'readOnly' | 'download' | 'githubToken' | 'channelPosts' | 'mentionRun' | 'mentionEnd' | 'mentionHeartbeat' | 'mentionUsage' | 'promptSize' | 'ruleFile' | 'reportSetup' | 'reportRepos' | 'reportProfile' | 'reportProjectMemory' | 'yodaRemember' | 'reportRunner' | 'reportModels' | 'release' | 'putTrace' | 'putMentionTrace' | 'pushToken' | 'taskPr' | 'prepareRun' | 'prepared' | 'readDoc'>>;
11
14
  export interface RunnerOptions {
12
15
  client: RunnerClient;
@@ -95,68 +98,6 @@ export interface RunnerStartInfo {
95
98
  /** Linux service whose user does not linger: it stops when that user's last login ends (an SSH session). */
96
99
  linger?: boolean;
97
100
  }
98
- export type Job = {
99
- kind: 'work';
100
- taskId: string;
101
- }
102
- /** nudge: the agent stopped without finishing; ask it once to complete, fail or ask. */
103
- | {
104
- kind: 'resume';
105
- taskId: string;
106
- replies: Message[];
107
- nudge?: boolean;
108
- } | {
109
- kind: 'answer';
110
- taskId: string;
111
- question: Message;
112
- } | {
113
- kind: 'mention';
114
- item: MentionItem;
115
- }
116
- /** read a new task ahead before anyone works it (owner-pulls-tasks.md) */
117
- | {
118
- kind: 'prepare';
119
- taskId: string;
120
- };
121
- export declare function jobKey(j: Job): string;
122
- /** Is no run going or queued? Parked runs do not count: they wait for an event, they do not need the hub asked every few seconds. */
123
- export declare const nothingGoing: (active: number, queued: number, runs: Pick<RunRecord, "phase">[]) => boolean;
124
- /** What the hub is told about a mention run that ended: whether it worked, why not, its last words, the commands that failed. */
125
- /**
126
- * The flags of an `ach reply` that failed (refused, or the hub said no): `--escalate`, `--to`, `--ask`, `--evidence`, read from the
127
- * command's first line as a shell would split it. Undefined when it had none of them. 2026-11-19: a reply with `--escalate --to owner`
128
- * was refused, its text was posted from the last message, and the owner never saw the decision in their Inbox.
129
- */
130
- export declare function refusedReply(commands: string[]): MentionOutcome['reply'];
131
- export declare function mentionOutcome(result: AdapterResult, reason: Active['reason'], recorder?: TraceRecorder, secrets?: readonly string[]): MentionOutcome;
132
- interface Active {
133
- job: Job;
134
- controller: AbortController;
135
- /** lost: the hub says this run no longer owns the task (heartbeat 409, C3). */
136
- reason?: 'cancel' | 'idle' | 'stop' | 'lost' | 'auth';
137
- done: Promise<void>;
138
- /** Job to start right after this one frees its slot (e.g. resume on replies that arrived mid-run). */
139
- followUp?: Job;
140
- }
141
- /** A gate decision that lets the run go ahead (S1). Anything else rejects. */
142
- export declare function approves(decision: string): boolean;
143
- export declare function newRunId(): string;
144
- /**
145
- * What the worker is still waiting on: its own open questions, blocking decision
146
- * requests, and (non-blocking) decision requests that replace one of its questions.
147
- */
148
- export declare function openRequests(messages: Message[], myId: string): Message[];
149
- /** The agent's own session claimed the task from this run (claim_task takeover): the run has nothing left to do on it. */
150
- export declare const takenOver: (task: {
151
- claim_mode?: string;
152
- run_id?: string;
153
- }, runId: string) => boolean;
154
- /** A human note addressed to me (panel composer / `ach admin note`): wakes a parked run. */
155
- export declare function isHumanNoteTo(m: Message, myId: string): boolean;
156
- /** Answers / decisions replying to something I asked, and human notes to me, that the worker has not been shown yet. */
157
- export declare function unseenReplies(messages: Message[], myId: string, seen: string[]): Message[];
158
- /** How often the runner lists the runtime's models again (besides at start and after a rejected model). */
159
- export declare const MODELS_EVERY_MS: number;
160
101
  export declare class Runner {
161
102
  readonly state: RunnerState;
162
103
  readonly queue: Job[];
@@ -198,10 +139,11 @@ export declare class Runner {
198
139
  st: SandboxStatus;
199
140
  at: number;
200
141
  };
201
- private setupReported?;
202
142
  private sandboxRecheck;
203
143
  /** Execution traces the hub has not taken yet (kept on disk too), and the last trace of each task (a commit joins it). */
204
144
  private traces;
145
+ /** what this runner tells the hub about itself (reports.ts) */
146
+ readonly reports: RunnerReports;
205
147
  constructor(opts: RunnerOptions);
206
148
  private log;
207
149
  private taskLog;
@@ -218,49 +160,14 @@ export declare class Runner {
218
160
  tick(): Promise<void>;
219
161
  /** decisions §27: probe the sandbox when due, tell the hub when the answer changes; true = take nothing new. */
220
162
  private sandboxBlocked;
221
- /** Tell the hub what keeps this runner from working, when that changed: a failed check first, else an account that cannot run. */
222
- private reportSetup;
223
163
  /**
224
164
  * What a run says about the account behind the runtime: a limit or a plan that is not usable pauses new work (whatever the run
225
165
  * was for: a task, an answer, a mention), and the plan problem is the owner's to fix, so it is reported like a broken sandbox.
226
166
  * A run that works clears it.
227
167
  */
228
168
  private noteAccount;
229
- /** Tell the hub which repo names this runner knows, so a task for another repo is refused when it is sent. Tried on every
230
- * poll until the hub has it: a hub that was unreachable at start would otherwise keep the previous list until a restart. */
231
- private reposReported;
232
- private reportRepos;
233
- private reposLogged;
234
- /** An agent with no profile yet gets a first one, once: a short read-only run on a light model reads the repositories it works in
235
- * and writes a sentence or two. The hub keeps it only while the profile is empty; the weekly refresh (the system agent, from what the
236
- * agent did) rewrites it after. The description is the owner's and is never written here. Tried again at the next start when it
237
- * could not be had. */
238
- private describeDone;
239
- private describeBusy;
240
- private describeTries;
241
- private describeNextAt;
242
- private describeAgent;
243
- /** Tell the hub how this runner runs tasks (its --perm, the tool, the names it passes with --pass-env), once, so the agent's
244
- * owner sees on its page what a task sent to it can reach. Tried on every poll until the hub has it; an older hub (404) is left alone. */
245
- private runnerReported;
246
169
  /** the capabilities file problems last logged (logged again only when they change) */
247
170
  private capsProblems;
248
- /** the capabilities last told to the hub (decisions §34, §38): an edit of the file is reported again on the next poll */
249
- private capsReported;
250
- private reportRunner;
251
- /**
252
- * Tell the hub which models the runtime offers here and which one a run uses when none is picked (the agent's settings
253
- * page lists them): when the runner starts, again a day later (a login or the tool's catalog changes), and at once after
254
- * a run's model was rejected. Asked with the environment a run gets, so the list is what this agent's login can use.
255
- */
256
- private modelsAt;
257
- private modelsBusy;
258
- /** set when a run's model was rejected: the list on the hub is out of date */
259
- private modelsStale;
260
- /** an older hub without /me/models, or a runtime that cannot list: asked no more */
261
- private modelsOff;
262
- private modelsLogged;
263
- private reportModels;
264
171
  /**
265
172
  * Cancel running jobs whose task went terminal; forget parked runs of
266
173
  * terminal tasks; keep parked leases alive; and (C1) resume a parked run
@@ -350,15 +257,6 @@ export declare class Runner {
350
257
  private get cloud();
351
258
  /** Short runs return JSON by a schema and the runner posts it: the runtime's way, and the only way without `ach` in the run. */
352
259
  private get structured();
353
- /** the project memory index last told to the hub, and when the file was last looked at */
354
- private projectMemoryReported;
355
- private projectMemoryCheckedAt;
356
- /**
357
- * Tell the hub what this agent knows about its project: the index of the owner's memory for it on this machine (one line per
358
- * note, never the notes). The owner's Yoda reads it, so it knows what each of its parts knows (primary-agent-design §11.15).
359
- * Looked at every few minutes, sent when it changed. Not for a team agent (no person) or a cloud run (no machine).
360
- */
361
- private reportProjectMemory;
362
260
  /** Owned by no one person (the system agent, or a team agent such as one that does a channel mechanism for the team). */
363
261
  private teamOwned;
364
262
  /** What a full task prompt carries besides the task: the owner's memory for this project and the project's instructions. */
@@ -400,5 +298,3 @@ export declare function gcWorktrees(client: Pick<Client, 'getTask'>, ws: Workspa
400
298
  log?: (s: string) => void;
401
299
  keepFailed?: boolean;
402
300
  }): Promise<string[]>;
403
- /** The model's text as a profile: its first paragraph, without markdown marks or wrapping quotes, at most 300 characters. */
404
- export declare function cleanDescription(raw: string): string;