mandala-computer-mcp 0.1.1 → 0.4.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.
- package/README.md +139 -24
- package/dist/api.d.ts +19 -6
- package/dist/api.d.ts.map +1 -1
- package/dist/api.js +355 -76
- package/dist/api.js.map +1 -1
- package/dist/cli.d.ts.map +1 -1
- package/dist/cli.js +113 -8
- package/dist/cli.js.map +1 -1
- package/dist/errors.d.ts +100 -12
- package/dist/errors.d.ts.map +1 -1
- package/dist/errors.js +169 -29
- package/dist/errors.js.map +1 -1
- package/dist/events.d.ts +45 -4
- package/dist/events.d.ts.map +1 -1
- package/dist/events.js +422 -114
- package/dist/events.js.map +1 -1
- package/dist/format.d.ts +48 -0
- package/dist/format.d.ts.map +1 -1
- package/dist/format.js +111 -4
- package/dist/format.js.map +1 -1
- package/dist/http-body.d.ts +17 -0
- package/dist/http-body.d.ts.map +1 -0
- package/dist/http-body.js +48 -0
- package/dist/http-body.js.map +1 -0
- package/dist/http.d.ts.map +1 -1
- package/dist/http.js +177 -51
- package/dist/http.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/limits.d.ts +17 -0
- package/dist/limits.d.ts.map +1 -0
- package/dist/limits.js +17 -0
- package/dist/limits.js.map +1 -0
- package/dist/paths.d.ts +30 -20
- package/dist/paths.d.ts.map +1 -1
- package/dist/paths.js +89 -25
- package/dist/paths.js.map +1 -1
- package/dist/poll.d.ts +107 -0
- package/dist/poll.d.ts.map +1 -0
- package/dist/poll.js +233 -0
- package/dist/poll.js.map +1 -0
- package/dist/server.d.ts +1 -1
- package/dist/server.d.ts.map +1 -1
- package/dist/server.js +2 -1
- package/dist/server.js.map +1 -1
- package/dist/tools/agent.d.ts.map +1 -1
- package/dist/tools/agent.js +72 -5
- package/dist/tools/agent.js.map +1 -1
- package/dist/tools/computers.d.ts.map +1 -1
- package/dist/tools/computers.js +559 -233
- package/dist/tools/computers.js.map +1 -1
- package/dist/tools/events.d.ts.map +1 -1
- package/dist/tools/events.js +359 -69
- package/dist/tools/events.js.map +1 -1
- package/dist/tools/guest.d.ts.map +1 -1
- package/dist/tools/guest.js +234 -33
- package/dist/tools/guest.js.map +1 -1
- package/dist/tools/input.d.ts.map +1 -1
- package/dist/tools/input.js +92 -8
- package/dist/tools/input.js.map +1 -1
- package/dist/tools/snapshots.d.ts.map +1 -1
- package/dist/tools/snapshots.js +501 -33
- package/dist/tools/snapshots.js.map +1 -1
- package/dist/tools/templates.d.ts.map +1 -1
- package/dist/tools/templates.js +61 -26
- package/dist/tools/templates.js.map +1 -1
- package/dist/tools/webhooks.d.ts.map +1 -1
- package/dist/tools/webhooks.js +116 -17
- package/dist/tools/webhooks.js.map +1 -1
- package/package.json +3 -2
package/dist/poll.js
ADDED
|
@@ -0,0 +1,233 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The machinery every wait loop in this server shares.
|
|
3
|
+
*
|
|
4
|
+
* Its own module rather than lines in computers.ts, because there are now poll
|
|
5
|
+
* loops in two tool files: `wait_for_computer` and `move_computer` watch a
|
|
6
|
+
* computer, and `create_snapshot` watches a capture the platform answers a 202
|
|
7
|
+
* for. A second copy of a two-second interval is not the problem — a second
|
|
8
|
+
* copy of the RULES around it is, and the one that matters is `pollDelay`:
|
|
9
|
+
* a loop that forgot it spends a rate limit discovering it is still rate
|
|
10
|
+
* limited, and nothing about the call site says so.
|
|
11
|
+
*/
|
|
12
|
+
import { RateLimitError } from './errors.js';
|
|
13
|
+
/**
|
|
14
|
+
* A pause that ends early when the caller gives up.
|
|
15
|
+
*
|
|
16
|
+
* The wait loops check the signal at the top of each turn, so a sleep that
|
|
17
|
+
* ignored it would still hold a cancelled call for its remaining seconds.
|
|
18
|
+
*/
|
|
19
|
+
export const sleep = (ms, signal) => new Promise((resolve) => {
|
|
20
|
+
if (signal?.aborted)
|
|
21
|
+
return resolve();
|
|
22
|
+
const t = setTimeout(done, ms);
|
|
23
|
+
function done() {
|
|
24
|
+
clearTimeout(t);
|
|
25
|
+
signal?.removeEventListener('abort', done);
|
|
26
|
+
resolve();
|
|
27
|
+
}
|
|
28
|
+
signal?.addEventListener('abort', done, { once: true });
|
|
29
|
+
});
|
|
30
|
+
/** How long these loops leave between polls. */
|
|
31
|
+
export const POLL_MS = 2_000;
|
|
32
|
+
/**
|
|
33
|
+
* The same interval, unless the platform asked for longer.
|
|
34
|
+
*
|
|
35
|
+
* A 429 is the one failure that says how long to wait, and
|
|
36
|
+
* {@link isTransientForPoll} now polls through it — so a loop that ignored
|
|
37
|
+
* `Retry-After` and asked again in two seconds would be spending a rate limit
|
|
38
|
+
* to discover it was still rate limited. The floor stays {@link POLL_MS}: the
|
|
39
|
+
* header can say zero, and a poll loop with no interval is a request storm.
|
|
40
|
+
*
|
|
41
|
+
* Only reached from a failed poll, which is why it takes the error rather than
|
|
42
|
+
* living in {@link sleep}: an ordinary turn has nothing to honour.
|
|
43
|
+
*/
|
|
44
|
+
export const pollDelay = (err) => err instanceof RateLimitError && err.retryAfterMs !== undefined
|
|
45
|
+
? Math.max(POLL_MS, err.retryAfterMs)
|
|
46
|
+
: POLL_MS;
|
|
47
|
+
/**
|
|
48
|
+
* How long a wait may go without saying anything.
|
|
49
|
+
*
|
|
50
|
+
* The loops here wake every {@link POLL_MS}, and a notification per turn would
|
|
51
|
+
* be 900 of them across a half-hour capture — the MCP spec asks implementations
|
|
52
|
+
* to rate-limit progress, and a client rendering every frame of "still
|
|
53
|
+
* capturing" is not better informed for it. So a turn that CHANGED something is
|
|
54
|
+
* always reported and an unchanged one is reported at this interval, which is
|
|
55
|
+
* well inside the 60s default that makes any of this necessary.
|
|
56
|
+
*/
|
|
57
|
+
export const HEARTBEAT_MS = 10_000;
|
|
58
|
+
/**
|
|
59
|
+
* The keepalive a wait longer than a minute owes the client it is keeping.
|
|
60
|
+
*
|
|
61
|
+
* WHY A TOOL THAT WAITS HAS TO SPEAK. `_onprogress` in the SDK's
|
|
62
|
+
* shared/protocol.js resets a pending request's timer; `notifications/message`
|
|
63
|
+
* — what `sendLoggingMessage` emits — never touches it. So a tool that only
|
|
64
|
+
* logs is, to the client's timer, a tool that has hung: the request is
|
|
65
|
+
* cancelled at the 60s default while the platform goes on copying a disk, and
|
|
66
|
+
* the model reads a transport error instead of the sentence the tool was
|
|
67
|
+
* written to give it. Observed, not theorised — a live capture took 107s and
|
|
68
|
+
* was cancelled at 60 (OPL-4579), and `run_agent` had the same defect before
|
|
69
|
+
* OPL-4419, where a twenty-step run was cancelled mid-way while still billing
|
|
70
|
+
* the caller's own Anthropic key.
|
|
71
|
+
*
|
|
72
|
+
* IT IS NOT SUFFICIENT ON ITS OWN and no description may claim it is.
|
|
73
|
+
* protocol.js reads `options?.resetTimeoutOnProgress ?? false`, so the reset
|
|
74
|
+
* happens only for a client that asked for it when it made the call. What this
|
|
75
|
+
* does is make the keepalive AVAILABLE — without it no client could hold the
|
|
76
|
+
* request open at all; with it, one that opts in can. The rest is the client's
|
|
77
|
+
* to set, and every tool using this has a `wait: false` or a second call for a
|
|
78
|
+
* client that cannot.
|
|
79
|
+
*
|
|
80
|
+
* Both channels on the same turns, because they answer different people. The
|
|
81
|
+
* progress notification is for the client's timer; the log line is what someone
|
|
82
|
+
* watching a terminal sees, and is the only channel when no token was sent.
|
|
83
|
+
*
|
|
84
|
+
* Failures are swallowed on purpose: a notification nobody could take delivery
|
|
85
|
+
* of must not end a wait that is otherwise going fine.
|
|
86
|
+
*/
|
|
87
|
+
export function heartbeat(extra, log, everyMs = HEARTBEAT_MS) {
|
|
88
|
+
const progressToken = extra._meta?.progressToken;
|
|
89
|
+
let sent = 0;
|
|
90
|
+
let spoken = false;
|
|
91
|
+
let last = '';
|
|
92
|
+
let at = 0;
|
|
93
|
+
let current;
|
|
94
|
+
let timer;
|
|
95
|
+
let stopped = false;
|
|
96
|
+
let notifying = false;
|
|
97
|
+
let pendingNotification;
|
|
98
|
+
let logging = false;
|
|
99
|
+
let pendingLog;
|
|
100
|
+
const schedule = () => {
|
|
101
|
+
if (timer !== undefined)
|
|
102
|
+
clearTimeout(timer);
|
|
103
|
+
timer = undefined;
|
|
104
|
+
if (stopped || !spoken)
|
|
105
|
+
return;
|
|
106
|
+
timer = setTimeout(() => {
|
|
107
|
+
timer = undefined;
|
|
108
|
+
if (current !== undefined)
|
|
109
|
+
emit(current);
|
|
110
|
+
}, Math.max(0, everyMs - (Date.now() - at)));
|
|
111
|
+
timer.unref?.();
|
|
112
|
+
};
|
|
113
|
+
const notify = (line) => {
|
|
114
|
+
if (stopped || progressToken === undefined)
|
|
115
|
+
return;
|
|
116
|
+
if (notifying) {
|
|
117
|
+
// One latest frame is enough to catch up after a slow receiver. Keeping
|
|
118
|
+
// every timer tick would make the queue grow for as long as it was slow.
|
|
119
|
+
pendingNotification = line;
|
|
120
|
+
return;
|
|
121
|
+
}
|
|
122
|
+
notifying = true;
|
|
123
|
+
sent += 1;
|
|
124
|
+
let delivery;
|
|
125
|
+
try {
|
|
126
|
+
delivery = extra.sendNotification({
|
|
127
|
+
method: 'notifications/progress',
|
|
128
|
+
// `progress` is the count of notifications, which the SDK's
|
|
129
|
+
// ProgressSchema asks to increase every time. No `total`: a wait does
|
|
130
|
+
// not know how many turns it will take, and a total of 0 renders as a
|
|
131
|
+
// finished bar.
|
|
132
|
+
params: { progressToken, progress: sent, message: line },
|
|
133
|
+
});
|
|
134
|
+
}
|
|
135
|
+
catch {
|
|
136
|
+
delivery = Promise.resolve();
|
|
137
|
+
}
|
|
138
|
+
const finished = () => {
|
|
139
|
+
notifying = false;
|
|
140
|
+
if (stopped) {
|
|
141
|
+
pendingNotification = undefined;
|
|
142
|
+
return;
|
|
143
|
+
}
|
|
144
|
+
const pending = pendingNotification;
|
|
145
|
+
pendingNotification = undefined;
|
|
146
|
+
if (pending !== undefined)
|
|
147
|
+
notify(pending);
|
|
148
|
+
};
|
|
149
|
+
void delivery.then(finished, finished);
|
|
150
|
+
};
|
|
151
|
+
const writeLog = (line) => {
|
|
152
|
+
if (stopped || !log)
|
|
153
|
+
return;
|
|
154
|
+
if (logging) {
|
|
155
|
+
// Logging is useful to a person but cannot keep the MCP request alive.
|
|
156
|
+
// Keep its backlog bounded and, above all, keep it out of progress's way.
|
|
157
|
+
pendingLog = line;
|
|
158
|
+
return;
|
|
159
|
+
}
|
|
160
|
+
logging = true;
|
|
161
|
+
let delivery;
|
|
162
|
+
try {
|
|
163
|
+
delivery = log.sendLoggingMessage({ level: 'info', data: line });
|
|
164
|
+
}
|
|
165
|
+
catch {
|
|
166
|
+
delivery = Promise.resolve();
|
|
167
|
+
}
|
|
168
|
+
const finished = () => {
|
|
169
|
+
logging = false;
|
|
170
|
+
if (stopped) {
|
|
171
|
+
pendingLog = undefined;
|
|
172
|
+
return;
|
|
173
|
+
}
|
|
174
|
+
const pending = pendingLog;
|
|
175
|
+
pendingLog = undefined;
|
|
176
|
+
if (pending !== undefined)
|
|
177
|
+
writeLog(pending);
|
|
178
|
+
};
|
|
179
|
+
void delivery.then(finished, finished);
|
|
180
|
+
};
|
|
181
|
+
const emit = (line) => {
|
|
182
|
+
if (stopped)
|
|
183
|
+
return;
|
|
184
|
+
const now = Date.now();
|
|
185
|
+
// A changed line is news and goes out at once; an unchanged one is a
|
|
186
|
+
// keepalive and goes out on the interval. `spoken` covers the first turn,
|
|
187
|
+
// which is the one that establishes the channel — a client that will not
|
|
188
|
+
// hear anything for ten seconds has already spent a sixth of its default
|
|
189
|
+
// budget.
|
|
190
|
+
//
|
|
191
|
+
// Its own flag rather than `sent > 0`, which is the notification COUNT and
|
|
192
|
+
// is therefore stuck at zero for the whole of a wait whose client minted no
|
|
193
|
+
// token (/code-review). The throttle then never applied to the one channel
|
|
194
|
+
// still running: ~900 identical "still copying" log lines across a
|
|
195
|
+
// half-hour capture, which is the flood the comment above says is avoided.
|
|
196
|
+
// The two are different questions — whether anything has been said, and how
|
|
197
|
+
// many progress frames have gone out — and only the first gates this.
|
|
198
|
+
// Rearmed rather than returned, because this is also the path a timer that
|
|
199
|
+
// fired early lands on. The timer callback has already cleared `timer`, and
|
|
200
|
+
// `schedule` is the only thing that sets another: returning here would end
|
|
201
|
+
// the keepalive for the rest of the operation on a wake that was a
|
|
202
|
+
// millisecond short of its own deadline, which libuv is entitled to deliver.
|
|
203
|
+
// That is the silence OPL-4743 repaired, reintroduced by the repair.
|
|
204
|
+
if (spoken && line === last && now - at < everyMs) {
|
|
205
|
+
schedule();
|
|
206
|
+
return;
|
|
207
|
+
}
|
|
208
|
+
spoken = true;
|
|
209
|
+
last = line;
|
|
210
|
+
at = now;
|
|
211
|
+
notify(line);
|
|
212
|
+
writeLog(line);
|
|
213
|
+
schedule();
|
|
214
|
+
};
|
|
215
|
+
const beat = ((line) => {
|
|
216
|
+
if (stopped)
|
|
217
|
+
return Promise.resolve();
|
|
218
|
+
current = line;
|
|
219
|
+
emit(line);
|
|
220
|
+
return Promise.resolve();
|
|
221
|
+
});
|
|
222
|
+
beat.stop = () => {
|
|
223
|
+
stopped = true;
|
|
224
|
+
if (timer !== undefined)
|
|
225
|
+
clearTimeout(timer);
|
|
226
|
+
timer = undefined;
|
|
227
|
+
pendingNotification = undefined;
|
|
228
|
+
pendingLog = undefined;
|
|
229
|
+
return Promise.resolve();
|
|
230
|
+
};
|
|
231
|
+
return beat;
|
|
232
|
+
}
|
|
233
|
+
//# sourceMappingURL=poll.js.map
|
package/dist/poll.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"poll.js","sourceRoot":"","sources":["../src/poll.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAE7C;;;;;GAKG;AACH,MAAM,CAAC,MAAM,KAAK,GAAG,CAAC,EAAU,EAAE,MAAoB,EAAE,EAAE,CACxD,IAAI,OAAO,CAAO,CAAC,OAAO,EAAE,EAAE;IAC5B,IAAI,MAAM,EAA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AAC;QAChC,UAAU,GAAG,SAAS,CAAC;QACvB,OAAO,OAAO,CAAC,OAAO,EAAE,CAAC;IAC3B,CAAC,CAAC;IACF,OAAO,IAAI,CAAC;AACd,CAAC"}
|
package/dist/server.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
|
|
|
2
2
|
import { type SessionConfig } from './session.js';
|
|
3
3
|
import type { ToolOptions } from './tools/types.js';
|
|
4
4
|
export declare const SERVER_NAME = "mandala-computer";
|
|
5
|
-
export declare const SERVER_VERSION = "0.
|
|
5
|
+
export declare const SERVER_VERSION = "0.4.0";
|
|
6
6
|
export type ServerConfig = SessionConfig & Partial<ToolOptions> & {
|
|
7
7
|
/** Internal HTTP hook: hold a session active for the real tool callback lifetime. */
|
|
8
8
|
activity?: () => () => void;
|
package/dist/server.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../src/server.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AACpE,OAAO,EAAW,KAAK,aAAa,EAAE,MAAM,cAAc,CAAC;AAQ3D,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAGpD,eAAO,MAAM,WAAW,qBAAqB,CAAC;AAC9C,eAAO,MAAM,cAAc,UAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../src/server.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AACpE,OAAO,EAAW,KAAK,aAAa,EAAE,MAAM,cAAc,CAAC;AAQ3D,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAGpD,eAAO,MAAM,WAAW,qBAAqB,CAAC;AAC9C,eAAO,MAAM,cAAc,UAAU,CAAC;AAqCtC,MAAM,MAAM,YAAY,GAAG,aAAa,GACtC,OAAO,CAAC,WAAW,CAAC,GAAG;IACrB,qFAAqF;IACrF,QAAQ,CAAC,EAAE,MAAM,MAAM,IAAI,CAAC;CAC7B,CAAC;AAEJ;;;;;;GAMG;AACH,wBAAgB,YAAY,CAAC,GAAG,EAAE,YAAY,GAAG,SAAS,CAmDzD"}
|
package/dist/server.js
CHANGED
|
@@ -9,7 +9,7 @@ import { registerSnapshots } from './tools/snapshots.js';
|
|
|
9
9
|
import { registerTemplates } from './tools/templates.js';
|
|
10
10
|
import { registerWebhooks } from './tools/webhooks.js';
|
|
11
11
|
export const SERVER_NAME = 'mandala-computer';
|
|
12
|
-
export const SERVER_VERSION = '0.
|
|
12
|
+
export const SERVER_VERSION = '0.4.0';
|
|
13
13
|
/**
|
|
14
14
|
* Told to the client on connect, and shown to the model before any tool is
|
|
15
15
|
* called. It is the only place to say the things that are true of the whole
|
|
@@ -40,6 +40,7 @@ Things that are true here and are not obvious:
|
|
|
40
40
|
- Waiting for a FILE is its own call, because a directory has to be nominated before the machine reports anything under it: wait_for_file_change takes an absolute directory in the guest, makes sure the guest is genuinely watching it, and then blocks until something under it is created, changed or deleted. Use it for a build's output or a download landing, in place of running ls in a loop. Nominate the narrowest directory you care about — a home directory under a build reports one "too much changed" marker instead of the changes — and read that marker as "list the directory again", not as a failure.
|
|
41
41
|
- list_windows tells you what is on the screen as data. It is how you distinguish an application that failed to start from one that has not painted yet, which a screenshot alone cannot do.
|
|
42
42
|
- A computer suspends itself when nobody uses it — 30 minutes by default. Input, exec and file transfers all count as use and resume it. Screenshots deliberately do not, so a loop that only watches can see its own machine go down.
|
|
43
|
+
- Who you are is checked again while a call is in flight, not only when it starts, so a long call can be refused after part of its work is already done. A 401 or a 403 means the credential or the role behind it stopped being accepted: re-authenticate, or say what was refused. Do not resend it, and never resend one that creates, starts, moves, writes or deletes without first checking what took effect. A 402 is the plan as it stands now rather than a fault on the computer, and waiting does not change it. Any of the three can arrive with completed work attached — read that before deciding what is left to do.
|
|
43
44
|
- A 409 is not one thing, and retrying blindly is how a turn gets burned. Most describe a passing state and clear on their own: a guest still booting, a guest agent busy with another call. Some describe a DECISION about what you asked for — a size the host cannot run, a computer that has to be stopped first — and those answer the same way forever; the message says which, and usually says what to do instead. A 400 never clears.
|
|
44
45
|
- Growing a computer past what its host can run is the refusal worth knowing by name: update_computer says a move is possible, and move_computer is how you take that up. It moves the machine to different hardware and copies its disk, so say what it costs before you call it.`;
|
|
45
46
|
/**
|
package/dist/server.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"server.js","sourceRoot":"","sources":["../src/server.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AACpE,OAAO,EAAE,OAAO,EAAsB,MAAM,cAAc,CAAC;AAC3D,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AACjD,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AACzD,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AACnD,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AACjD,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AACjD,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AACzD,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AAEzD,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAEvD,MAAM,CAAC,MAAM,WAAW,GAAG,kBAAkB,CAAC;AAC9C,MAAM,CAAC,MAAM,cAAc,GAAG,OAAO,CAAC;AAEtC;;;;;;;;;;;;GAYG;AACH,MAAM,YAAY,GAAG,CAAC,SAAkB,EAAE,EAAE,CAC1C;;;;KAIG,SAAS,CAAC,CAAC,CAAC,yCAAyC,CAAC,CAAC,CAAC,oBAAoB
|
|
1
|
+
{"version":3,"file":"server.js","sourceRoot":"","sources":["../src/server.ts"],"names":[],"mappings":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AC;IAErC,6EAA6E;IAC7E,sEAAsE;IACtE,yEAAyE;IACzE,yEAAyE;IACzE,kDAAkD;IAClD,MAAM,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC,OAAO,CAAC;IACrC,MAAM,CAAC,MAAM,CAAC,OAAO,GAAG,GAAG,EAAE;QAC3B,OAAO,CAAC,MAAM,CAAC,QAAQ,EAAE,CAAC;QAC1B,MAAM,EAAE,EAAE,CAAC;IACb,CAAC,CAAC;IAEF,OAAO,MAAM,CAAC;AAChB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"agent.d.ts","sourceRoot":"","sources":["../../src/tools/agent.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAE5C;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,aAAa,EAAE,
|
|
1
|
+
{"version":3,"file":"agent.d.ts","sourceRoot":"","sources":["../../src/tools/agent.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAE5C;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,aAAa,EAAE,SAiK3B,CAAC"}
|
package/dist/tools/agent.js
CHANGED
|
@@ -34,7 +34,7 @@ export const registerAgent = (server, session) => {
|
|
|
34
34
|
.min(1)
|
|
35
35
|
.max(100)
|
|
36
36
|
.default(20)
|
|
37
|
-
.describe('
|
|
37
|
+
.describe('How many ACTIONS the loop may take on the desktop. Not a count of model calls and not a proxy for what your key is billed: one model reply can ask for several actions and spends a step on each, a paused turn is resubmitted for tokens and no step, and a bash call or a cursor read takes no screenshot. So a run can make more model calls than steps AND more steps than screenshots — bound the work with this, and budget the bill on the key itself. Defaults to 20 and is capped at 100 here, so a larger value is refused before the call rather than after it.'),
|
|
38
38
|
},
|
|
39
39
|
annotations: { openWorldHint: true },
|
|
40
40
|
}, ({ computer_id, prompt, system, max_steps }, extra) => guarded(async () => {
|
|
@@ -60,7 +60,7 @@ export const registerAgent = (server, session) => {
|
|
|
60
60
|
// shared/protocol.js resets a pending request's timer, and
|
|
61
61
|
// `notifications/message` — what sendLoggingMessage emits — never
|
|
62
62
|
// touches it. This tool had only the logging half, so a run of the
|
|
63
|
-
// default 20 steps,
|
|
63
|
+
// default 20 steps, most of them a model call and a screenshot, sailed past
|
|
64
64
|
// the client's 60s default and was cancelled while the platform went
|
|
65
65
|
// on driving the desktop on the caller's own Anthropic key.
|
|
66
66
|
//
|
|
@@ -104,7 +104,7 @@ export const registerAgent = (server, session) => {
|
|
|
104
104
|
// Terminal means it SAYS SO, which is watch_build's discipline
|
|
105
105
|
// (OPL-3835) applied to this stream's own vocabulary: `stop` is the
|
|
106
106
|
// field the platform always sends on a result — the AgentResult type
|
|
107
|
-
//
|
|
107
|
+
// on the platform side requires it, and every `done` it yields carries
|
|
108
108
|
// one — and it is the field the verdict below reads. A record
|
|
109
109
|
// without it is not a result, so it is kept, in case nothing better
|
|
110
110
|
// arrives, but it does not end the loop and discard the frame that
|
|
@@ -122,7 +122,16 @@ export const registerAgent = (server, session) => {
|
|
|
122
122
|
// level from a run that worked — a caller checking whether the step
|
|
123
123
|
// succeeded would read this one as a success that happened to have
|
|
124
124
|
// a discouraging sentence in it.
|
|
125
|
-
|
|
125
|
+
//
|
|
126
|
+
// And it has to say WHY in words, because this is the one place a
|
|
127
|
+
// status cannot be read off the response: the platform answered 200
|
|
128
|
+
// before the first step, so a run stopped by the credential, the role
|
|
129
|
+
// or the plan arrives as a frame in a successful stream. A model
|
|
130
|
+
// handed "the run failed" and a JSON blob does the natural thing,
|
|
131
|
+
// which is to call this tool again with the same prompt — paying for
|
|
132
|
+
// every completed step a second time to be refused the same way.
|
|
133
|
+
return refused(`The run failed after ${steps.length} step(s).${stopReason(ev.data)}` +
|
|
134
|
+
(steps.length ? `\n\nWhat it did, and is billed for:\n${steps.join('\n')}` : ''), ev.data);
|
|
126
135
|
}
|
|
127
136
|
}
|
|
128
137
|
if (!done) {
|
|
@@ -139,9 +148,67 @@ export const registerAgent = (server, session) => {
|
|
|
139
148
|
: stop === 'refusal'
|
|
140
149
|
? 'the model declined the task'
|
|
141
150
|
: `ended: ${stop}`;
|
|
142
|
-
|
|
151
|
+
// Interpolated only when it IS a string, which is the same discipline
|
|
152
|
+
// `stop` gets three lines up. `String()` over a shape this build does
|
|
153
|
+
// not know — a content-block array is the plausible one — renders the
|
|
154
|
+
// run's whole output as `[object Object]` in the sentence that carries
|
|
155
|
+
// it, and a model reading that has lost the result while being told it
|
|
156
|
+
// finished. Serialized instead: unfamiliar but readable beats confident
|
|
157
|
+
// and empty.
|
|
158
|
+
const text = typeof done.text === 'string'
|
|
159
|
+
? done.text
|
|
160
|
+
: done.text === undefined || done.text === null
|
|
161
|
+
? ''
|
|
162
|
+
: JSON.stringify(done.text);
|
|
163
|
+
const result = `${verdict}\n\n${text}\n\nWhat it did:\n${steps.join('\n')}`;
|
|
143
164
|
return stop === 'end_turn' ? said(result, done) : refused(result, done);
|
|
144
165
|
}));
|
|
145
166
|
};
|
|
167
|
+
/**
|
|
168
|
+
* What an `error` frame says about whether calling this tool again can work.
|
|
169
|
+
*
|
|
170
|
+
* Three of the statuses a run can stop on are about the CALLER rather than the
|
|
171
|
+
* computer — the credential stopped being accepted, the role or the account
|
|
172
|
+
* changed, the plan does not cover the work — and every one of them answers a
|
|
173
|
+
* second run the same way. They are also the three that can arrive with steps
|
|
174
|
+
* already completed and billed, which is what makes a retry expensive as well as
|
|
175
|
+
* useless. Each gets its own clause rather than one shared "auth" sentence: only
|
|
176
|
+
* the first is fixed by authenticating again, and telling the other two to try
|
|
177
|
+
* that is telling them to spend another run finding out it did not help.
|
|
178
|
+
*
|
|
179
|
+
* Anything else is left as the platform's own sentence. A run can fail for
|
|
180
|
+
* reasons that are worth another attempt, and inventing a verdict for a status
|
|
181
|
+
* this version has not been told about would be the same mistake in the other
|
|
182
|
+
* direction: the leading space is part of the returned clause so that an
|
|
183
|
+
* unclassified stop reads as one sentence rather than as a missing one.
|
|
184
|
+
*/
|
|
185
|
+
function stopReason(data) {
|
|
186
|
+
const frame = isRecord(data) ? data : undefined;
|
|
187
|
+
const status = typeof frame?.status === 'number' ? frame.status : undefined;
|
|
188
|
+
const said = typeof frame?.error === 'string' && frame.error ? frame.error : undefined;
|
|
189
|
+
const why = said ? ` ${said}` : '';
|
|
190
|
+
// 401 and 403 are split, because the recovery is not the same one. A shared
|
|
191
|
+
// clause told a caller whose ROLE had been taken away to re-authenticate,
|
|
192
|
+
// which restores nothing and sends it round the same refusal with another
|
|
193
|
+
// prompt's worth of billed steps behind it (Codex review).
|
|
194
|
+
if (status === 401) {
|
|
195
|
+
return (` It was stopped because this server's credential is no longer accepted (HTTP ${status}) —` +
|
|
196
|
+
` not by anything wrong with the computer.${why} Do NOT call run_agent again with the same` +
|
|
197
|
+
` prompt: it is refused the same way until the credential is fixed. Once it is, read what` +
|
|
198
|
+
` the steps below already did before deciding what is left to do.`);
|
|
199
|
+
}
|
|
200
|
+
if (status === 403) {
|
|
201
|
+
return (` It was stopped because this account does not permit the run (HTTP ${status}) — a role that` +
|
|
202
|
+
` changed or an account suspended, not anything wrong with the computer.${why} Nothing you` +
|
|
203
|
+
` can send changes that, and a new credential does not either: say what was refused and` +
|
|
204
|
+
` stop, rather than calling run_agent again.`);
|
|
205
|
+
}
|
|
206
|
+
if (status === 402) {
|
|
207
|
+
return (` It was stopped by the plan on this account as it stands now (HTTP ${status}), not by` +
|
|
208
|
+
` anything wrong with the computer.${why} Calling run_agent again does not change that;` +
|
|
209
|
+
` say what was refused, and note that the steps below were still billed.`);
|
|
210
|
+
}
|
|
211
|
+
return why;
|
|
212
|
+
}
|
|
146
213
|
const isRecord = (value) => value !== null && typeof value === 'object' && !Array.isArray(value);
|
|
147
214
|
//# sourceMappingURL=agent.js.map
|
package/dist/tools/agent.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"agent.js","sourceRoot":"","sources":["../../src/tools/agent.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,CAC1E,CAAC;IACJ,CAAC;IACD,OAAO,GAAG,CAAC;AACb,CAAC;AAED,MAAM,QAAQ,GAAG,CAAC,KAAc,EAAoC,EAAE,CACpE,KAAK,KAAK,IAAI,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"computers.d.ts","sourceRoot":"","sources":["../../src/tools/computers.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"computers.d.ts","sourceRoot":"","sources":["../../src/tools/computers.ts"],"names":[],"mappings":"AAsBA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAiS5C,eAAO,MAAM,iBAAiB,EAAE,SAu3C/B,CAAC"}
|