mandala-computer-mcp 0.15.0 → 0.17.0

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 (48) hide show
  1. package/README.md +97 -15
  2. package/dist/api.d.ts.map +1 -1
  3. package/dist/api.js +2 -2
  4. package/dist/api.js.map +1 -1
  5. package/dist/cli.d.ts.map +1 -1
  6. package/dist/cli.js +3 -2
  7. package/dist/cli.js.map +1 -1
  8. package/dist/errors.d.ts +64 -3
  9. package/dist/errors.d.ts.map +1 -1
  10. package/dist/errors.js +96 -4
  11. package/dist/errors.js.map +1 -1
  12. package/dist/format.d.ts +3 -0
  13. package/dist/format.d.ts.map +1 -1
  14. package/dist/format.js +9 -2
  15. package/dist/format.js.map +1 -1
  16. package/dist/paths.d.ts +36 -1
  17. package/dist/paths.d.ts.map +1 -1
  18. package/dist/paths.js +35 -0
  19. package/dist/paths.js.map +1 -1
  20. package/dist/server.d.ts.map +1 -1
  21. package/dist/server.js +4 -0
  22. package/dist/server.js.map +1 -1
  23. package/dist/tool-filters.d.ts +1 -1
  24. package/dist/tool-filters.d.ts.map +1 -1
  25. package/dist/tool-filters.js +11 -1
  26. package/dist/tool-filters.js.map +1 -1
  27. package/dist/tools/agent.d.ts +65 -0
  28. package/dist/tools/agent.d.ts.map +1 -1
  29. package/dist/tools/agent.js +103 -72
  30. package/dist/tools/agent.js.map +1 -1
  31. package/dist/tools/chat.d.ts.map +1 -1
  32. package/dist/tools/chat.js +51 -9
  33. package/dist/tools/chat.js.map +1 -1
  34. package/dist/tools/conversation.d.ts +51 -0
  35. package/dist/tools/conversation.d.ts.map +1 -0
  36. package/dist/tools/conversation.js +81 -0
  37. package/dist/tools/conversation.js.map +1 -0
  38. package/dist/tools/runs.d.ts +3 -0
  39. package/dist/tools/runs.d.ts.map +1 -0
  40. package/dist/tools/runs.js +346 -0
  41. package/dist/tools/runs.js.map +1 -0
  42. package/dist/tools/threads.d.ts +3 -0
  43. package/dist/tools/threads.d.ts.map +1 -0
  44. package/dist/tools/threads.js +214 -0
  45. package/dist/tools/threads.js.map +1 -0
  46. package/dist/version.d.ts +1 -1
  47. package/dist/version.js +1 -1
  48. package/package.json +1 -1
@@ -0,0 +1,346 @@
1
+ import { z } from 'zod';
2
+ import { MODEL_KEY_HEADER } from '../api.js';
3
+ import { topUpUrl } from '../credits.js';
4
+ import { APIError, FUNDED_UNAVAILABLE, neverSent } from '../errors.js';
5
+ import { failed, guarded, refused, said } from '../format.js';
6
+ import * as P from '../paths.js';
7
+ import { BYOK_BILLING, BYOK_RUN_ARGS, FUNDED_BILLING, FUNDED_RUN_ARGS, preRunRefusal, RUN_AGENT_ANNOTATIONS, stopReason, usd, } from './agent.js';
8
+ import { safeResult } from './chat.js';
9
+ import { keptThread, PAUSED_FOR_UPDATE, stopVerdict, threadIdArg, threadLine, } from './conversation.js';
10
+ import { count, label, metadata, metadataCall } from './directory.js';
11
+ import { readAnnotations } from './results.js';
12
+ // Background agent runs (OPL-6085). Which tools, and why:
13
+ //
14
+ // - start_agent_run: registered exactly when run_agent is, for run_agent's
15
+ // reason: something has to pay for the run, and a tool refused on every call
16
+ // for want of a key costs a turn to discover. It takes what run_agent takes
17
+ // on the same payer, less `store` — a background run is kept so it can be
18
+ // read back, and the platform refuses `store: false` on it.
19
+ // - get_agent_run, list_agent_runs and cancel_agent_run: always, filters
20
+ // permitting. A run can be started from anywhere — an SDK, the CLI, the
21
+ // dashboard, another session — and reading or stopping one needs only the
22
+ // member role, not anything to pay with.
23
+ //
24
+ // A client driving a long task is the reason these exist: run_agent holds one
25
+ // tool call open for the whole run, which is minutes, and a client that cannot
26
+ // keep a call open that long watched its own timeout cancel a run it was paying
27
+ // for. Here the call that starts a run answers at once and the run goes on.
28
+ const money = z.number().finite().nonnegative();
29
+ /** One action, as a run records it. Display fields: lenient, but each typed. */
30
+ const step = z.object({
31
+ n: count,
32
+ tool: z.string().optional(),
33
+ action: z.string().optional(),
34
+ detail: z.string().optional(),
35
+ error: z.string().optional(),
36
+ });
37
+ /**
38
+ * How a completed run ended. `stop` is the field the verdict reads, so it is
39
+ * required; a `result` without one is not a result.
40
+ */
41
+ const result = z.object({
42
+ stop: label,
43
+ steps: count.optional(),
44
+ text: z.string().optional(),
45
+ usage: z
46
+ .object({
47
+ input_tokens: count,
48
+ output_tokens: count,
49
+ cache_read_tokens: count,
50
+ cache_write_tokens: count,
51
+ })
52
+ .partial()
53
+ .optional(),
54
+ cost_usd: money.optional(),
55
+ });
56
+ /** Why a failed or interrupted run ended: the status the agent route would have answered. */
57
+ const runError = z.object({
58
+ error: z.string(),
59
+ status: z.number().int(),
60
+ reason: z.string().optional(),
61
+ top_up_url: z.string().optional(),
62
+ });
63
+ /**
64
+ * One background run, projected to its public fields.
65
+ *
66
+ * `status` is an open string, as an operation's state is: a status this
67
+ * server does not know is a status, and is read as not finished rather than
68
+ * as a malformed answer. The id is held to its documented shape, because it
69
+ * is what every later call names.
70
+ */
71
+ const agentRun = z.object({
72
+ id: z.string().regex(P.RUN_ID),
73
+ computer_id: label,
74
+ // Null until the run is kept in a thread. Read through keptThread wherever
75
+ // it is shown, so anything but a thread id reads as not kept.
76
+ thread_id: z.string().nullable().optional(),
77
+ status: label,
78
+ prompt: z.string(),
79
+ model: z.string(),
80
+ max_steps: count,
81
+ steps: count,
82
+ cost_usd: money.optional(),
83
+ result: result.optional(),
84
+ error: runError.optional(),
85
+ steps_taken: z.array(step),
86
+ created_at: z.string(),
87
+ updated_at: z.string(),
88
+ ended_at: z.string().nullable(),
89
+ });
90
+ const runPage = z.object({ runs: z.array(agentRun), has_more: z.boolean() });
91
+ const STATUSES = ['running', 'completed', 'failed', 'cancelled', 'interrupted'];
92
+ /** The statuses a run ends in. */
93
+ const ENDED = new Set(['completed', 'failed', 'cancelled', 'interrupted']);
94
+ /**
95
+ * What to read before starting another run, when one may have started: every
96
+ * run on the computer, newest first, NOT only the running ones — a short run
97
+ * can have ended before the lookup, and filtering on running would hide it.
98
+ */
99
+ const RECOVER = (id) => `Before starting another, call list_agent_runs with computer_id ${id} and no status filter: a run still going shows as running, and one that already ended is the newest on the list — a filter on running would hide that one.`;
100
+ const isRecord = (value) => value !== null && typeof value === 'object' && !Array.isArray(value);
101
+ const runIdArg = z
102
+ .string()
103
+ .regex(P.RUN_ID, 'run_id is run_ followed by 24 lowercase hex characters')
104
+ .describe('The run_id start_agent_run or list_agent_runs answered: run_ and 24 hex characters.');
105
+ /** Whether a run's record says the task was done: completed, and stopped at end_turn. */
106
+ const finishedRun = (run) => run.status === 'completed' && run.result?.stop === 'end_turn';
107
+ /**
108
+ * The first thing said about a run: whether it is going, finished, or ended
109
+ * without finishing, and what to do next. Only `completed` with `end_turn` is
110
+ * finished, and that is said in as many words, because every other ending is a
111
+ * run whose steps stand on a task that is not done.
112
+ */
113
+ function verdict(run, session) {
114
+ switch (run.status) {
115
+ case 'running':
116
+ return 'STILL RUNNING — not finished. Read it again with get_agent_run in a few seconds (a step takes at least that long); cancel_agent_run stops it.';
117
+ case 'completed': {
118
+ if (!run.result)
119
+ return 'completed, but its record carries no result, so whether the task was finished is unknown — take a screenshot before relying on it.';
120
+ const stop = run.result.stop;
121
+ return stop === 'end_turn'
122
+ ? 'FINISHED: completed with stop end_turn.'
123
+ : `completed WITHOUT FINISHING (stop ${stop}): ${stopVerdict(stop, run.result.steps ?? run.steps)}. The steps it took stand: take a screenshot before deciding what is left.`;
124
+ }
125
+ case 'failed': {
126
+ const err = run.error;
127
+ if (!err)
128
+ return 'FAILED, and its record does not say why. The steps it took stand: take a screenshot before deciding what is left.';
129
+ const topUp = topUpUrl(err.status, err, session.api.baseUrl);
130
+ // A run on credits reports its charge; the platform's fixed sentence for
131
+ // its AI service failing marks one that has none yet.
132
+ const funded = run.cost_usd !== undefined || err.error === FUNDED_UNAVAILABLE;
133
+ return `FAILED after ${run.steps} step(s).${stopReason(err, topUp, funded, 'start_agent_run')} The steps it took stand: take a screenshot before deciding what is left.`;
134
+ }
135
+ case 'cancelled':
136
+ return 'CANCELLED: stopped where it was by a cancel, so the task is not finished. What it did stands: take a screenshot before deciding what is left.';
137
+ case 'interrupted':
138
+ return `INTERRUPTED: the platform restarted while it was going, or it stopped without its ending being recorded${run.error ? ` (${run.error.error})` : ''}. It was not resumed, and IT MAY HAVE DONE MORE THAN IT RECORDED: take a screenshot before starting another.`;
139
+ default:
140
+ return `status ${run.status}, which this server does not know: treat the task as not finished, and read the run again with get_agent_run.`;
141
+ }
142
+ }
143
+ const stepLine = (s) => `${s.n}. ${s.detail ?? s.action ?? s.tool ?? 'step'}${s.error ? ` — refused or failed: ${s.error}` : ''}`;
144
+ /** A run told in full: the verdict, then what it did, then its closing text. */
145
+ function describe(run, session) {
146
+ const parts = [`${run.id} on ${run.computer_id}: ${verdict(run, session)}`];
147
+ parts.push(`${run.steps} of at most ${run.max_steps} step(s), model ${run.model}; started ${run.created_at}` +
148
+ (run.ended_at ? `, ended ${run.ended_at}.` : '.') +
149
+ (run.cost_usd !== undefined ? ` Cost so far: ${usd(run.cost_usd)} of AI credits.` : ''));
150
+ const thread = keptThread(run.thread_id);
151
+ if (thread)
152
+ parts.push(threadLine(thread));
153
+ else if (run.status === 'running')
154
+ parts.push('No thread yet: a run is kept in one once it has acted, and its id appears here.');
155
+ if (run.result?.text)
156
+ parts.push(`Its closing text:\n${run.result.text}`);
157
+ if (run.steps_taken.length)
158
+ parts.push(`What it did${run.status === 'running' ? ' so far' : ''}:\n${run.steps_taken.map(stepLine).join('\n')}`);
159
+ return parts.join('\n\n');
160
+ }
161
+ /**
162
+ * The record beside the prose: everything but the steps, which the prose
163
+ * lists, and the thread as the prose reads it — a value that is not a thread
164
+ * id is not handed on to be sent back and refused.
165
+ */
166
+ const record = ({ steps_taken: _steps, thread_id, ...rest }) => ({
167
+ ...rest,
168
+ thread_id: keptThread(thread_id) ?? null,
169
+ });
170
+ /** A prompt's first line, short enough for a listing. */
171
+ function title(prompt) {
172
+ const first = prompt.split('\n', 1)[0].trim();
173
+ return first.length > 120 ? `${first.slice(0, 119)}…` : first;
174
+ }
175
+ /** One run in a listing: no steps and no closing text, and a shortened prompt. */
176
+ function summary(run) {
177
+ const { steps_taken: _steps, result: done, prompt, thread_id, ...rest } = run;
178
+ return {
179
+ ...rest,
180
+ thread_id: keptThread(thread_id) ?? null,
181
+ prompt: title(prompt),
182
+ ...(done ? { stop: done.stop } : {}),
183
+ finished: finishedRun(run),
184
+ };
185
+ }
186
+ const listLine = (run) => `${run.id}: ${run.status}${run.result ? ` (stop ${run.result.stop})` : ''}${finishedRun(run) ? ', finished' : run.status === 'running' ? '' : ', NOT finished'} on ${run.computer_id} — ${run.steps} step(s), started ${run.created_at}: ${JSON.stringify(title(run.prompt))}`;
187
+ const POLL = 'Only status completed with stop end_turn means the task was finished. completed with any other stop (max_steps, max_cost, credits_exhausted, rate_limited, refusal, …) stopped without finishing; failed carries the error that ended it; cancelled was stopped by cancel_agent_run; interrupted means the platform restarted while it was going, or its ending was not recorded, and it was not resumed — it MAY HAVE DONE MORE THAN IT RECORDED. Whatever the ending, the steps a run took stand: take a screenshot before deciding what is left, and continue with its thread_id rather than running the whole task again.';
188
+ const START = "Start the platform's agent loop on a computer in the BACKGROUND and answer at once with the run's id: the same loop run_agent drives — screenshot, decide, click, type, repeat — but this call does not wait for it.";
189
+ const WHEN = 'Prefer it to run_agent when the task may take longer than your client holds one tool call open (a run is minutes), or when you have other work to do meanwhile; use run_agent when you can wait and want the answer in one call. Then read it with get_agent_run every few seconds — a step takes at least that long — until its status is no longer running; cancel_agent_run stops it.';
190
+ const RULES = `The computer must already be running, and one run drives a computer at a time: a computer another run is driving is refused with 409 (contention) — wait for that run or cancel it (list_agent_runs with status running finds it). thread_id continues an earlier run's conversation; the run's own thread_id, once it has one, continues this one. ${PAUSED_FOR_UPDATE} If this call's answer is lost, or it fails with any other 5xx, a run may have started: list_agent_runs with computer_id and no status filter before starting another, since a short run may already have ended. Cancelling this call does not stop a run that has started; cancel_agent_run does.`;
191
+ export const registerRuns = (server, session) => {
192
+ const out = (result) => safeResult(result, session.modelKey);
193
+ const start = ({ computer_id, prompt, system, provider, model, max_steps, max_cost_usd, thread_id }, extra) => guarded(async () => {
194
+ const id = session.resolve(computer_id);
195
+ // Built before the request, so a path refused here is not mistaken for
196
+ // a request whose answer was lost.
197
+ const path = P.agentRuns(id);
198
+ const body = P.agentBody({
199
+ prompt,
200
+ system,
201
+ provider,
202
+ model,
203
+ max_steps,
204
+ max_cost_usd,
205
+ thread_id,
206
+ });
207
+ let raw;
208
+ try {
209
+ raw = await session.api.json('POST', path, {
210
+ body,
211
+ // No header at all on a run that credits pay for, as on run_agent:
212
+ // its absence is what tells the platform to use them.
213
+ ...(session.modelKey ? { headers: { [MODEL_KEY_HEADER]: session.modelKey } } : {}),
214
+ signal: extra.signal,
215
+ });
216
+ }
217
+ catch (err) {
218
+ // A start refused while the platform updates is answered here too:
219
+ // a 503 that started nothing, and says when to send it again.
220
+ const refusal = preRunRefusal(err, session, 'start_agent_run');
221
+ if (refusal)
222
+ return refusal;
223
+ // A 4xx is a refusal given before any run was recorded, and a request
224
+ // that never left started nothing. Anything else — a 5xx, an answer
225
+ // that never arrived — leaves open whether a run started, and starting
226
+ // another once the first has ended would do the task twice. The
227
+ // lookup that settles it is named here, where it is needed, and not
228
+ // only in the description.
229
+ if ((err instanceof APIError && err.status < 500) || neverSent(err))
230
+ throw err;
231
+ const result = failed(err);
232
+ result.content.push({
233
+ type: 'text',
234
+ text: `A RUN MAY HAVE STARTED on ${id}. ${RECOVER(id)}`,
235
+ });
236
+ return result;
237
+ }
238
+ // Accepted is a run that holds the computer. An answer that cannot be
239
+ // read is still that, and the one thing a model must not do then is
240
+ // start another run blind.
241
+ const parsed = agentRun.safeParse(raw);
242
+ if (!parsed.success) {
243
+ // The id alone, when the answer carries a usable one, is enough to
244
+ // follow the run; the rest of the record is not needed for that.
245
+ const runId = isRecord(raw) && typeof raw.id === 'string' && P.RUN_ID.test(raw.id) ? raw.id : undefined;
246
+ return refused(runId
247
+ ? `The platform accepted the run on ${id} as ${runId}, but the rest of its answer could not be read. A RUN IS GOING: read it with get_agent_run (run_id ${runId}) rather than starting another.`
248
+ : `The platform accepted the run on ${id}, but its answer could not be read, so the run id is unknown and A RUN MAY BE GOING. ${RECOVER(id)}`);
249
+ }
250
+ const run = parsed.data;
251
+ return said(`Started ${run.id} in the background; it goes on without this call. Read it with get_agent_run (run_id ${run.id}) every few seconds until its status is no longer running.\n\n${describe(run, session)}`, record(run));
252
+ }).then(out);
253
+ if (session.modelKey) {
254
+ server.registerTool('start_agent_run', {
255
+ title: 'Start a background agent run',
256
+ description: `${START} ${BYOK_BILLING} ${WHEN} ${POLL} ${RULES}`,
257
+ inputSchema: { ...BYOK_RUN_ARGS, thread_id: threadIdArg },
258
+ annotations: RUN_AGENT_ANNOTATIONS,
259
+ }, start);
260
+ }
261
+ else if (session.funded) {
262
+ server.registerTool('start_agent_run', {
263
+ title: 'Start a background agent run',
264
+ description: `${START} ${FUNDED_BILLING} ${WHEN} ${POLL} ${RULES}`,
265
+ inputSchema: { ...FUNDED_RUN_ARGS, thread_id: threadIdArg },
266
+ annotations: RUN_AGENT_ANNOTATIONS,
267
+ }, start);
268
+ }
269
+ server.registerTool('get_agent_run', {
270
+ title: 'Read a background agent run',
271
+ description: `A background agent run as it stands: its status, every step so far, its cost on AI credits, and once it has ended, how. Poll it every few seconds while its status is running; a step takes at least that long, so polling faster only spends rate budget. ${POLL} A run this key cannot see is not found.`,
272
+ inputSchema: { run_id: runIdArg },
273
+ annotations: readAnnotations,
274
+ }, ({ run_id }, extra) => metadataCall(async () => {
275
+ const run = metadata(agentRun, await session.api.json('GET', P.agentRun(run_id), { signal: extra.signal }));
276
+ return said(describe(run, session), record(run));
277
+ }).then(out));
278
+ server.registerTool('list_agent_runs', {
279
+ title: 'List background agent runs',
280
+ description: "Background agent runs on this account, newest first, a page at a time: each run's id, computer, status (running, completed, failed, cancelled or interrupted), how it stopped, its steps and cost. Only completed with stop end_turn is finished. computer_id keeps one computer's runs — it is not defaulted to the selected computer — and status keeps one status: status running finds a run still going, which is the one to wait for or cancel before starting another on that computer. Steps and closing text are not listed, and long prompts are shortened; get_agent_run reads one whole. Pass before with the last run's id for the next page. A key confined to a workspace sees that workspace's runs. The account keeps its 1000 newest ended runs and every run still going.",
281
+ inputSchema: {
282
+ computer_id: z
283
+ .string()
284
+ .min(1)
285
+ .optional()
286
+ .describe("Only this computer's runs. Not defaulted to the selected computer."),
287
+ status: z.enum(STATUSES).optional().describe('Only runs in this status.'),
288
+ limit: z.number().int().min(1).max(100).optional().describe('Page size; default 20.'),
289
+ before: z
290
+ .string()
291
+ .regex(P.RUN_ID, 'before is a run_id: run_ followed by 24 lowercase hex characters')
292
+ .optional()
293
+ .describe('The id of the last run on the previous page, for the page after it.'),
294
+ },
295
+ annotations: readAnnotations,
296
+ }, ({ computer_id, status, limit, before }, extra) => metadataCall(async () => {
297
+ const page = metadata(runPage, await session.api.json('GET', P.AGENT_RUNS, {
298
+ query: { computer_id, status, limit, before },
299
+ signal: extra.signal,
300
+ }));
301
+ const more = page.has_more && page.runs.length;
302
+ const data = { runs: page.runs.map(summary), has_more: page.has_more };
303
+ if (!page.runs.length)
304
+ return said('No background runs.', data);
305
+ return said(page.runs.map(listLine).join('\n') +
306
+ (more
307
+ ? `\n\nMore: pass before=${page.runs[page.runs.length - 1].id} for the next page.`
308
+ : ''), data);
309
+ }).then(out));
310
+ server.registerTool('cancel_agent_run', {
311
+ title: 'Cancel a background agent run',
312
+ description: 'Stop a background agent run where it is: the model call in flight is abandoned and no further action is taken. What it already did to the desktop stands, and so does what it cost: take a screenshot before deciding what is left. Cancelling a run that has already ended changes nothing and answers it as it is. A run this key cannot see is not found.',
313
+ inputSchema: { run_id: runIdArg },
314
+ annotations: { destructiveHint: true, idempotentHint: true },
315
+ }, ({ run_id }, extra) => guarded(async () => {
316
+ const path = P.agentRunCancel(run_id);
317
+ // Whether a cancel that failed or answered unreadably took effect is
318
+ // what a model needs next, and get_agent_run is how it finds out; a
319
+ // cancel is safe to send again either way.
320
+ const settle = `Whether ${run_id} stopped is unknown: get_agent_run reads it, and cancel_agent_run can be sent again safely.`;
321
+ let raw;
322
+ try {
323
+ raw = await session.api.json('POST', path, { signal: extra.signal });
324
+ }
325
+ catch (err) {
326
+ if ((err instanceof APIError && err.status < 500) || neverSent(err))
327
+ throw err;
328
+ const result = failed(err);
329
+ result.content.push({ type: 'text', text: settle });
330
+ return result;
331
+ }
332
+ const parsed = agentRun.safeParse(raw);
333
+ if (!parsed.success)
334
+ return refused(`The cancel of ${run_id} was answered, but the answer could not be read. ${settle}`);
335
+ const run = parsed.data;
336
+ const head = run.status === 'cancelled'
337
+ ? `Cancelled ${run.id}: it stopped where it was.`
338
+ : run.status === 'running'
339
+ ? `The cancel of ${run.id} was answered, but the run still reads running: read it again with get_agent_run before relying on it having stopped.`
340
+ : ENDED.has(run.status)
341
+ ? `${run.id} had already ended (${run.status}), so nothing was cancelled.`
342
+ : `The cancel of ${run.id} was answered with status ${run.status}, which this server does not know, so whether it stopped is unknown: read it again with get_agent_run before relying on it.`;
343
+ return said(`${head}\n\n${describe(run, session)}`, record(run));
344
+ }).then(out));
345
+ };
346
+ //# sourceMappingURL=runs.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"runs.js","sourceRoot":"","sources":["../../src/tools/runs.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,gBAAgB,EAAE,MAAM,WAAW,CAAC;AAC7C,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACzC,OAAO,EAAE,QAAQ,EAAE,kBAAkB,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACvE,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AAC9D,OAAO,KAAK,CAAC,MAAM,aAAa,CAAC;AAEjC,OAAO,EACL,YAAY,EACZ,aAAa,EACb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C,IAAI,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC,CAAC;YACpD,OAAO,MAAM,CAAC;QAChB,CAAC;QACD,MAAM,MAAM,GAAG,QAAQ,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC;QACvC,IAAI,CAAC,MAAM,CAAC,OAAO;YACjB,OAAO,OAAO,CACZ,iBAAiB,MAAM,oDAAoD,MAAM,EAAE,CACpF,CAAC;QACJ,MAAM,GAAG,GAAG,MAAM,CAAC,IAAI,CAAC;QACxB,MAAM,IAAI,GACR,GAAG,CAAC,MAAM,KAAK,WAAW;YACxB,CAAC,CAAC,aAAa,GAAG,CAAC,EAAE,4BAA4B;YACjD,CAAC,CAAC,GAAG,CAAC,MAAM,KAAK,SAAS;gBACxB,CAAC,CAAC,iBAAiB,GAAG,CAAC,EAAE,uHAAuH;gBAChJ,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,GAAG,CAAC,MAAM,CAAC;oBACrB,CAAC,CAAC,GAAG,GAAG,CAAC,EAAE,uBAAuB,GAAG,CAAC,MAAM,8BAA8B;oBAC1E,CAAC,CAAC,iBAAiB,GAAG,CAAC,EAAE,6BAA6B,GAAG,CAAC,MAAM,6HAA6H,CAAC;QACtM,OAAO,IAAI,CAAC,GAAG,IAAI,OAAO,QAAQ,CAAC,GAAG,EAAE,OAAO,CAAC,EAAE,EAAE,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC;IACnE,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CACf,CAAC;AACJ,CAAC,CAAC"}
@@ -0,0 +1,3 @@
1
+ import type { Registrar } from './types.js';
2
+ export declare const registerThreads: Registrar;
3
+ //# sourceMappingURL=threads.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"threads.d.ts","sourceRoot":"","sources":["../../src/tools/threads.ts"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AA2G5C,eAAO,MAAM,eAAe,EAAE,SA6J7B,CAAC"}
@@ -0,0 +1,214 @@
1
+ import { z } from 'zod';
2
+ import { APIError, NotFoundError, neverSent } from '../errors.js';
3
+ import { guarded, refused, said } from '../format.js';
4
+ import * as P from '../paths.js';
5
+ import { usd } from './agent.js';
6
+ import { safeResult } from './chat.js';
7
+ import { stopVerdict } from './conversation.js';
8
+ import { count, label, metadata, metadataCall } from './directory.js';
9
+ import { readAnnotations } from './results.js';
10
+ // Agent threads (OPL-6085): the conversations agent runs keep. Which tools,
11
+ // and why:
12
+ //
13
+ // - list_agent_threads and get_agent_thread: yes. A thread is how an earlier
14
+ // run's work is found again — what it was asked, what it answered, how it
15
+ // ended — and its id is what continues it. Reading one needs the member role
16
+ // and nothing to pay with, so they are offered whether or not this session
17
+ // can start a run.
18
+ // - delete_agent_thread: yes, behind `confirm: true`, for the reason
19
+ // delete_secret is offered: cleaning up what a task made is part of the task.
20
+ // A prompt is where private text ends up, and a thread keeps every prompt and
21
+ // answer until it is deleted or displaced; and an account keeps 1000, past
22
+ // which a key that can delete none of them (a workspace key whose workspace
23
+ // holds none) gets runs that are not kept at all. What it removes is history
24
+ // only: no run is stopped and nothing on a desktop changes. It is not
25
+ // undoable, and every thread on the account is visible to this key, so the
26
+ // description limits it to threads this conversation made or the user named.
27
+ // Unlike minting or revoking an API key, which stay out of a model's hands,
28
+ // nothing here hands a model a credential or cuts anyone off.
29
+ const money = z.number().finite().nonnegative();
30
+ const threadSummary = z.object({
31
+ id: z.string().regex(P.THREAD_ID),
32
+ computer_id: label,
33
+ title: z.string(),
34
+ turns: count,
35
+ created_at: z.string(),
36
+ updated_at: z.string(),
37
+ });
38
+ /**
39
+ * One turn. `role` and `stop` are open strings: a role or an ending this
40
+ * server does not know is shown as it came, and an ending it does not know is
41
+ * read as not finished.
42
+ */
43
+ const turn = z.object({
44
+ role: label,
45
+ text: z.string(),
46
+ stop: z.string().optional(),
47
+ error: z.string().optional(),
48
+ steps: count.optional(),
49
+ cost_usd: money.optional(),
50
+ created_at: z.string(),
51
+ });
52
+ const thread = threadSummary.extend({ messages: z.array(turn) });
53
+ const threadPage = z.object({ threads: z.array(threadSummary), has_more: z.boolean() });
54
+ const threadIdArg = z
55
+ .string()
56
+ .regex(P.THREAD_ID, 'thread_id is thr_ followed by 24 lowercase hex characters')
57
+ .describe('The thread: thr_ and 24 hex characters, from an agent run or list_agent_threads.');
58
+ /**
59
+ * How much turn text one get_agent_thread answer carries, in characters.
60
+ *
61
+ * A thread holds up to 100 turns of up to 32,000 characters each, and one
62
+ * answer holding all of them is past what a client will put in a model's
63
+ * context — or is cut by the client, which drops the newest turns, the ones a
64
+ * continuation needs. So an answer holds the newest turns that fit, at least
65
+ * one whatever its size, and says which turn to read back from for the rest.
66
+ */
67
+ const THREAD_CHARS = 48_000;
68
+ /** The endings that leave a turn's run doing, or having done, more than it says. */
69
+ const UNSETTLED = new Set(['running', 'aborted', 'interrupted']);
70
+ /** How an assistant turn's run ended, in words. Only end_turn is finished. */
71
+ function ending(t) {
72
+ switch (t.stop) {
73
+ case undefined:
74
+ return 'no ending recorded';
75
+ case 'running':
76
+ return 'STILL RUNNING: its run is going, and MAY DO MORE THAN THIS SAYS';
77
+ case 'aborted':
78
+ return 'ABORTED part way: it MAY HAVE DONE MORE THAN IT REPORTED';
79
+ case 'interrupted':
80
+ return 'INTERRUPTED: the platform restarted before it finished, and it MAY HAVE DONE MORE THAN IT REPORTED';
81
+ case 'error':
82
+ return `FAILED${t.error ? `: ${t.error}` : ''}`;
83
+ default:
84
+ return `${stopVerdict(t.stop, t.steps)} (stop ${t.stop})`;
85
+ }
86
+ }
87
+ function turnLine(t, n) {
88
+ if (t.role !== 'assistant')
89
+ return `${n}. ${t.role}, ${t.created_at}:\n${t.text}`;
90
+ const facts = [
91
+ ending(t),
92
+ ...(t.steps !== undefined ? [`${t.steps} step(s)`] : []),
93
+ ...(t.cost_usd !== undefined ? [`${usd(t.cost_usd)} of AI credits`] : []),
94
+ ];
95
+ return `${n}. assistant, ${t.created_at} — ${facts.join('; ')}:\n${t.text}`;
96
+ }
97
+ /** `Turn 4 is` or `Turns 1 to 3 are`: a run of turn numbers, with its verb. */
98
+ const span = (from, to, one, many) => from === to ? `Turn ${from} ${one}` : `Turns ${from} to ${to} ${many}`;
99
+ const summaryLine = (t) => `${t.id} on ${t.computer_id}: ${JSON.stringify(t.title)} — ${t.turns} turn(s), last used ${t.updated_at}`;
100
+ export const registerThreads = (server, session) => {
101
+ const out = (result) => safeResult(result, session.modelKey);
102
+ server.registerTool('list_agent_threads', {
103
+ title: 'List kept agent conversations',
104
+ description: "The conversations agent runs have kept on this account, most recently used first: each thread's id, the computer it belongs to, a title (the first line of its first prompt) and how many turns it holds. Runs from run_agent, run_agent_chat and start_agent_run are kept unless they sent store: false. To continue one, send its id as thread_id on the next run, on the same computer. computer_id keeps one computer's threads — it is not defaulted to the selected computer. Pass before with the last thread's id for the next page. A key confined to a workspace sees that workspace's threads; viewers are refused, since a prompt is where private text ends up.",
105
+ inputSchema: {
106
+ computer_id: z
107
+ .string()
108
+ .min(1)
109
+ .optional()
110
+ .describe("Only this computer's threads. Not defaulted to the selected computer."),
111
+ limit: z.number().int().min(1).max(100).optional().describe('Page size; default 20.'),
112
+ before: z
113
+ .string()
114
+ .regex(P.THREAD_ID, 'before is a thread_id: thr_ followed by 24 lowercase hex characters')
115
+ .optional()
116
+ .describe('The id of the last thread on the previous page, for the page after it.'),
117
+ },
118
+ annotations: readAnnotations,
119
+ }, ({ computer_id, limit, before }, extra) => metadataCall(async () => {
120
+ const page = metadata(threadPage, await session.api.json('GET', P.AGENT_THREADS, {
121
+ query: { computer_id, limit, before },
122
+ signal: extra.signal,
123
+ }));
124
+ if (!page.threads.length)
125
+ return said('No kept agent conversations.', page);
126
+ return said(page.threads.map(summaryLine).join('\n') +
127
+ (page.has_more
128
+ ? `\n\nMore: pass before=${page.threads[page.threads.length - 1].id} for the next page.`
129
+ : ''), page);
130
+ }).then(out));
131
+ server.registerTool('get_agent_thread', {
132
+ title: 'Read a kept agent conversation',
133
+ description: 'One kept conversation, oldest turn first: each user turn is a prompt, and each assistant turn is how that run answered — its closing text, how it ended, its steps, and its cost on AI credits. Read it to see what earlier runs on a computer were asked and did before continuing it with thread_id. An answer holds the newest turns that fit in about 48,000 characters; when earlier turns did not fit it says so, and before_turn reads the ones before. Only an assistant turn that ended end_turn finished its task. One that is running (its run is still going), aborted (stopped part way) or interrupted (the platform restarted mid-run) MAY HAVE DONE MORE THAN IT REPORTED: look at the desktop before relying on it. A thread this key cannot see is not found.',
134
+ inputSchema: {
135
+ thread_id: threadIdArg,
136
+ before_turn: z
137
+ .number()
138
+ .int()
139
+ .min(2)
140
+ .optional()
141
+ .describe('Only turns numbered below this one, for the turns an earlier answer said did not fit. Leave it out for the newest turns.'),
142
+ },
143
+ annotations: readAnnotations,
144
+ }, ({ thread_id, before_turn }, extra) => metadataCall(async () => {
145
+ const data = metadata(thread, await session.api.json('GET', P.agentThread(thread_id), { signal: extra.signal }));
146
+ const { messages, ...meta } = data;
147
+ // Over every turn, not only the ones shown: a run that may have done
148
+ // more than it said is worth knowing about wherever it sits.
149
+ const unsettled = messages.flatMap((t, i) => t.role === 'assistant' && t.stop !== undefined && UNSETTLED.has(t.stop) ? [i + 1] : []);
150
+ const last = Math.min(messages.length, (before_turn ?? messages.length + 1) - 1);
151
+ const shown = [];
152
+ let first = last + 1;
153
+ let used = 0;
154
+ for (let n = last; n >= 1; n--) {
155
+ const line = turnLine(messages[n - 1], n);
156
+ if (shown.length && used + line.length > THREAD_CHARS)
157
+ break;
158
+ shown.unshift(line);
159
+ used += line.length;
160
+ first = n;
161
+ }
162
+ const head = `${summaryLine(data)}. Continue it with thread_id ${data.id} on ${data.computer_id}.` +
163
+ (unsettled.length
164
+ ? `\n\nTurn ${unsettled.join(', ')} ended running, aborted or interrupted: ${unsettled.length === 1 ? 'that run' : 'those runs'} may have done more than reported. Take a screenshot before continuing, and do not assume what was or was not done.`
165
+ : '');
166
+ const earlier = first > 1
167
+ ? `\n\n${span(1, first - 1, 'is not', 'are not')} shown, to keep this answer bounded: call get_agent_thread again with before_turn ${first} for ${first > 2 ? 'them' : 'it'}.`
168
+ : '';
169
+ const later = last < messages.length
170
+ ? `\n\n${span(last + 1, messages.length, 'comes', 'come')} after these: leave before_turn out for the newest.`
171
+ : '';
172
+ return said(`${head}${earlier}${later}\n\n${shown.length ? shown.join('\n\n') : 'No turns.'}`, { ...meta, ...(shown.length ? { shown_turns: { first, last } } : {}) });
173
+ }).then(out));
174
+ server.registerTool('delete_agent_thread', {
175
+ title: 'Delete a kept agent conversation',
176
+ description: "Permanently delete a kept conversation: its turns are gone and its id can no longer be continued. Nothing else changes — no run is stopped (cancel_agent_run stops a background run), and what its runs did to the desktop stands. Delete only a thread this conversation started or one the user asked to remove: every thread on the account is visible to this key, including other people's. It is for removing a prompt that held private text, or making room: the account keeps 1000 threads, replacing the least recently used, and a key that can delete none of them gets runs that are not kept. Needs confirm: true.",
177
+ inputSchema: z
178
+ .object({
179
+ thread_id: threadIdArg,
180
+ confirm: z
181
+ .literal(true)
182
+ .describe('Must be true. The conversation is gone for good and cannot be continued.'),
183
+ })
184
+ .strict(),
185
+ annotations: { destructiveHint: true, idempotentHint: true },
186
+ }, ({ thread_id }, extra) => guarded(async () => {
187
+ const path = P.agentThread(thread_id);
188
+ let res;
189
+ try {
190
+ res = await session.api.with(extra.signal).send('DELETE', path);
191
+ }
192
+ catch (err) {
193
+ if (!(err instanceof APIError)) {
194
+ // A request that never left deleted nothing.
195
+ if (neverSent(err))
196
+ throw err;
197
+ const why = err instanceof Error ? err.message : String(err);
198
+ return refused(`The delete of ${thread_id} could not be read back (${why}). IT MAY OR MAY NOT HAVE BEEN DELETED — get_agent_thread says whether it is still there.`);
199
+ }
200
+ // A 404 is the state this call asked for, and the tool is annotated
201
+ // idempotent, so the retry after a lost answer is one a client may
202
+ // make. Said as a success but not as "Deleted": the same 404 answers
203
+ // an id that was never there.
204
+ if (!(err instanceof NotFoundError))
205
+ throw err;
206
+ return said(`Nothing was deleted: there is no thread ${thread_id} this key can see. Either it was already deleted — if this is a retry, the first call did it — or the id is wrong. list_agent_threads says which.`);
207
+ }
208
+ if (!z.object({ ok: z.literal(true) }).safeParse(res).success) {
209
+ return refused(`The delete of ${thread_id} answered without the platform's acknowledgment. IT MAY OR MAY NOT HAVE BEEN DELETED — get_agent_thread says whether it is still there.`);
210
+ }
211
+ return said(`Deleted ${thread_id}: its turns are gone and it can no longer be continued. What its runs did to the desktop stands.`, res);
212
+ }).then(out));
213
+ };
214
+ //# sourceMappingURL=threads.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"threads.js","sourceRoot":"","sources":["../../src/tools/threads.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,QAAQ,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAClE,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AACtD,OAAO,KAAK,CAAC,MAAM,aAAa,CAAC;AACjC,OAAO,EAAE,GAAG,EAAE,MAAM,YAAY,CAAC;AACjC,OAAO,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AACvC,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,QAAQ,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AACtE,OAAO,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAG/C,4EAA4E;AAC5E,WAAW;AACX,EAAE;AACF,6EAA6E;AAC7E,4EAA4E;AAC5E,+EAA+E;AAC/E,6EAA6E;AAC7E,qBAAqB;AACrB,qEAAqE;AACrE,gFAAgF;AAChF,gFAAgF;AAChF,6EAA6E;AAC7E,8EAA8E;AAC9E,+EAA+E;AAC/E,wEAAwE;AACxE,6EAA6E;AAC7E,+EAA+E;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AAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;gBAC7D,OAAO,OAAO,CACZ,iBAAiB,SAAS,4BAA4B,GAAG,2FAA2F,CACrJ,CAAC;YACJ,CAAC;YACD,oEAAoE;YACpE,mEAAmE;YACnE,qEAAqE;YACrE,8BAA8B;YAC9B,IAAI,CAAC,CAAC,GAAG,YAAY,aAAa,CAAC;gBAAE,MAAM,GAAG,CAAC;YAC/C,OAAO,IAAI,CACT,2CAA2C,SAAS,mJAAmJ,CACxM,CAAC;QACJ,CAAC;QACD,IAAI,CAAC,CAAC,CAAC,MAAM,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC,OAAO,EAAE,CAAC;YAC9D,OAAO,OAAO,CACZ,iBAAiB,SAAS,yIAAyI,CACpK,CAAC;QACJ,CAAC;QACD,OAAO,IAAI,CACT,WAAW,SAAS,kGAAkG,EACtH,GAAG,CACJ,CAAC;IACJ,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CACf,CAAC;AACJ,CAAC,CAAC"}
package/dist/version.d.ts CHANGED
@@ -4,5 +4,5 @@
4
4
  * client. The release workflow checks a tag against this line and
5
5
  * `package.json`.
6
6
  */
7
- export declare const SERVER_VERSION = "0.15.0";
7
+ export declare const SERVER_VERSION = "0.17.0";
8
8
  //# sourceMappingURL=version.d.ts.map
package/dist/version.js CHANGED
@@ -4,5 +4,5 @@
4
4
  * client. The release workflow checks a tag against this line and
5
5
  * `package.json`.
6
6
  */
7
- export const SERVER_VERSION = '0.15.0';
7
+ export const SERVER_VERSION = '0.17.0';
8
8
  //# sourceMappingURL=version.js.map