@picassohq/cli 1.0.6 → 1.0.9
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/LICENSE +14 -0
- package/README.md +104 -0
- package/dist/build-info.json +1 -1
- package/dist/index.js +1955 -1530
- package/package.json +27 -5
- package/runtime/dsh/picasso-providers.patch.yml +49 -61
- package/runtime/dsh/picasso-runtime.cordis.yml +49 -61
- package/runtime/engine-manifest.json +18 -8
- package/runtime/packages/picasso-browser/cordis.patch.yml +4 -0
- package/runtime/packages/picasso-browser/index.js +915 -0
- package/runtime/packages/picasso-browser/package.json +29 -0
- package/runtime/packages/picasso-commands/index.js +51 -1
- package/runtime/packages/picasso-compaction/index.js +116 -1
- package/runtime/packages/picasso-computer/cordis.patch.yml +5 -0
- package/runtime/packages/picasso-computer/index.js +670 -0
- package/runtime/packages/picasso-computer/native-anthropic.js +212 -0
- package/runtime/packages/picasso-computer/package.json +30 -0
- package/runtime/packages/picasso-computer/support.js +95 -0
- package/runtime/packages/picasso-lean-context/index.js +751 -15
- package/runtime/packages/picasso-lean-context/timeline.js +3 -2
- package/runtime/packages/picasso-model-router/connections.js +1 -1
- package/runtime/packages/picasso-progress-reports/index.js +121 -3
- package/runtime/packages/picasso-sdk-server/browser-host.js +94 -0
- package/runtime/packages/picasso-sdk-server/index.js +23 -3
- package/runtime/plugins/picasso-browser/index.js +319 -22
- package/runtime/plugins/picasso-browser/package.json +1 -1
- package/runtime/plugins/picasso-commands/index.js +51 -1
- package/runtime/plugins/picasso-compaction/index.js +116 -1
- package/runtime/plugins/picasso-computer/index.js +670 -0
- package/runtime/plugins/picasso-computer/native-anthropic.js +212 -0
- package/runtime/plugins/picasso-computer/package.json +30 -0
- package/runtime/plugins/picasso-computer/support.js +95 -0
- package/runtime/plugins/picasso-lean-context/index.js +751 -15
- package/runtime/plugins/picasso-lean-context/timeline.js +3 -2
- package/runtime/plugins/picasso-model-router/connections.js +1 -1
- package/runtime/plugins/picasso-progress-reports/index.js +121 -3
- package/runtime/relay/main.mjs +5005 -2250
- package/runtime/relay/remote/index.html +10 -2
- package/runtime/relay/remote/remote.css +8 -1
- package/runtime/relay/remote/remote.js +78 -17
- package/runtime/relay/versions-routes.mjs +52 -37
- package/scripts/install-runtime.mjs +33 -7
|
@@ -0,0 +1,670 @@
|
|
|
1
|
+
// @picasso/computer — the agent's computer use tools (`computer_*`), executed by Picasso for Mac.
|
|
2
|
+
//
|
|
3
|
+
// The engine runs the model; only the Picasso Mac app may touch the screen, mouse and keyboard. A `computer_*` tool
|
|
4
|
+
// call queues an action on this plugin's Host Remote service (`picassoComputer/*`), which the helper relay long-polls
|
|
5
|
+
// and hands to the Mac app on the owner's host-wide stream:
|
|
6
|
+
// take(timeoutMs[, signal]) -> {actions:[{actionId, sessionId, callId, tool, args, issuedAt}], cancelled:[id…]}
|
|
7
|
+
// complete(actionId, ok, value, error, sessionId) -> {} (same rules as picassoBrowser/complete)
|
|
8
|
+
// The Mac app is authoritative for everything that touches the machine: the thread's opt-in, Accessibility and
|
|
9
|
+
// Screen Recording permission, the app deny-list, the locked-screen check, the Stop key and the audit log.
|
|
10
|
+
//
|
|
11
|
+
// What this plugin decides:
|
|
12
|
+
// * which sessions see the tools (support.js): by the step's route/model, fixed for a model, so Tier 1 never changes
|
|
13
|
+
// between turns or modes. Tools are deferred (off the wire, found through tool_search); on a model that can't use
|
|
14
|
+
// them tool_search hides them and a call fails with a plain reason. On an Anthropic-native route of a toolset
|
|
15
|
+
// Claude model the native `computer_toolset_20260801` entry is sent instead (native-anthropic.js), Mac host only.
|
|
16
|
+
// * where it runs: `config.host` is 'mac' on the Picasso for Mac relay; anything else (the CLI's own engine, a
|
|
17
|
+
// relay on Linux or Windows) answers every call with NEEDS_MAC.
|
|
18
|
+
// * approvals: every input action asks through `tools/pre-execute` -> {kind:'ask'}; the relay keys "Allow for this
|
|
19
|
+
// thread" on the whole computer_* family and never turns "Always allow" into a durable rule.
|
|
20
|
+
// * argument shapes (Anthropic toolset member shapes), checked before anything is queued.
|
|
21
|
+
import { createRequire } from 'node:module';
|
|
22
|
+
import { pathToFileURL } from 'node:url';
|
|
23
|
+
|
|
24
|
+
import { installAnthropicComputerBridge } from './native-anthropic.js';
|
|
25
|
+
import { computerUseSupport, modelLabel } from './support.js';
|
|
26
|
+
|
|
27
|
+
export { computerUseSupport, isToolsetModel, bareModelId, isNativeAnthropicUrl } from './support.js';
|
|
28
|
+
export {
|
|
29
|
+
TOOLSET_MEMBERS, TOOLSET_TYPE, installAnthropicComputerBridge, memberOf, rewriteRequestBody, rewriteSseData,
|
|
30
|
+
renameMemberBlock, sseRenameStream, stripFineGrainedBeta, rewriteJsonResponse, isNativeMessagesUrl,
|
|
31
|
+
} from './native-anthropic.js';
|
|
32
|
+
|
|
33
|
+
export const name = 'picasso-computer';
|
|
34
|
+
export const dshTarget = '0.2.2-rc.3';
|
|
35
|
+
export const inject = ['tools'];
|
|
36
|
+
|
|
37
|
+
export const SERVICE_KEY = 'picassoComputer';
|
|
38
|
+
const REMOTE_METHOD_DESCRIPTOR = '@deepseek-ai/dsh-typert-protocol/remote-methods';
|
|
39
|
+
/** The process-wide tool_search visibility map picasso-lean-context reads (tool name → predicate(agent)). */
|
|
40
|
+
export const TOOL_VISIBILITY_KEY = Symbol.for('picasso.toolVisibility');
|
|
41
|
+
|
|
42
|
+
export const NO_POLLER_MS = 30_000;
|
|
43
|
+
export const ACTION_TIMEOUT_MS = 60_000;
|
|
44
|
+
export const TAKE_DEFAULT_MS = 25_000;
|
|
45
|
+
export const WAIT_MAX_SECONDS = 300;
|
|
46
|
+
export const HOLD_MAX_SECONDS = 300;
|
|
47
|
+
export const SCROLL_MAX = 50;
|
|
48
|
+
export const REPEAT_MAX = 100;
|
|
49
|
+
export const TYPE_MAX_CHARS = 10_000;
|
|
50
|
+
export const COORDINATE_MAX = 20_000;
|
|
51
|
+
|
|
52
|
+
export const NEEDS_MAC = 'Computer use needs Picasso for Mac. It controls a Mac through the Picasso app, so it is not available from the terminal alone or on other systems.';
|
|
53
|
+
export const APP_CLOSED = 'Computer use needs Picasso for Mac open on this computer.';
|
|
54
|
+
export const ACTION_TIMEOUT = "Picasso for Mac didn't answer the computer action.";
|
|
55
|
+
export const unsupportedModel = (model) =>
|
|
56
|
+
`Computer use isn't available with ${modelLabel(model)}: it needs a model that reads screenshots and acts on them (for example Claude Opus 5.5 or Claude Sonnet 5.5). Switch this thread's model to use it.`;
|
|
57
|
+
|
|
58
|
+
/** Input actions: each asks the person (the relay keys "Allow for this thread" on the family). */
|
|
59
|
+
export const ASK_TOOLS = new Set([
|
|
60
|
+
'computer_left_click', 'computer_right_click', 'computer_middle_click', 'computer_double_click', 'computer_triple_click',
|
|
61
|
+
'computer_left_click_drag', 'computer_mouse_move', 'computer_left_mouse_down', 'computer_left_mouse_up',
|
|
62
|
+
'computer_scroll', 'computer_type', 'computer_key', 'computer_hold_key',
|
|
63
|
+
]);
|
|
64
|
+
/** Reads and waits: no ask (the Mac still requires the opt-in, permission and an unlocked screen). */
|
|
65
|
+
export const READ_TOOLS = new Set([
|
|
66
|
+
'computer_screenshot', 'computer_zoom', 'computer_cursor_position', 'computer_list_apps', 'computer_list_windows', 'computer_wait',
|
|
67
|
+
]);
|
|
68
|
+
export const TOOL_NAMES = [...ASK_TOOLS, ...READ_TOOLS].sort();
|
|
69
|
+
/** Tools the plugin answers itself (never queued to the Mac). */
|
|
70
|
+
const LOCAL_TOOLS = new Set(['computer_wait']);
|
|
71
|
+
export const CLICK_TOOLS = ['computer_left_click', 'computer_right_click', 'computer_middle_click', 'computer_double_click', 'computer_triple_click'];
|
|
72
|
+
export const SCROLL_DIRECTIONS = ['up', 'down', 'left', 'right'];
|
|
73
|
+
const MODIFIERS = new Set(['shift', 'ctrl', 'control', 'alt', 'option', 'super', 'cmd', 'command', 'meta', 'fn']);
|
|
74
|
+
|
|
75
|
+
export class ComputerError extends Error {
|
|
76
|
+
constructor(code, message, details = {}) {
|
|
77
|
+
super(message);
|
|
78
|
+
this.name = 'RemoteError';
|
|
79
|
+
this.code = `${SERVICE_KEY}/${code}`;
|
|
80
|
+
this.details = details;
|
|
81
|
+
this.isDSHRemoteError = true;
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
const isRecord = (value) => value !== null && typeof value === 'object' && !Array.isArray(value);
|
|
86
|
+
|
|
87
|
+
// ── Tool specs (the Anthropic toolset member shapes, so the native bridge only renames) ───────────────────────────
|
|
88
|
+
|
|
89
|
+
const GUIDE =
|
|
90
|
+
' This is computer use: it controls the person’s Mac through Picasso for Mac (other apps, the mouse, the keyboard and' +
|
|
91
|
+
' the screen), only after the person turns it on for this thread and approves the actions. Take computer_screenshot' +
|
|
92
|
+
' first: coordinates are pixels in the latest screenshot. Password managers, Keychain Access and System Settings ›' +
|
|
93
|
+
' Privacy are never controlled, and nothing runs while the Mac is locked.';
|
|
94
|
+
|
|
95
|
+
const point = (what) => ({
|
|
96
|
+
type: 'array', items: { type: 'integer' }, minItems: 2, maxItems: 2,
|
|
97
|
+
description: `${what} as [x, y] pixels in the latest screenshot.`,
|
|
98
|
+
});
|
|
99
|
+
const modifiers = { type: 'string', description: 'Modifier keys to hold: shift, ctrl, alt (option), super (cmd), or a "+"-joined combination such as "cmd+shift".' };
|
|
100
|
+
const NO_PARAMS = () => ({ type: 'object', properties: {}, additionalProperties: false });
|
|
101
|
+
const clickSpec = (tool, what) => ({
|
|
102
|
+
name: tool,
|
|
103
|
+
description: `${what} at a point (or where the pointer is).${GUIDE}`,
|
|
104
|
+
parameters: {
|
|
105
|
+
type: 'object',
|
|
106
|
+
properties: { coordinate: point('Where to click'), text: modifiers },
|
|
107
|
+
additionalProperties: false,
|
|
108
|
+
},
|
|
109
|
+
});
|
|
110
|
+
|
|
111
|
+
export const TOOL_SPECS = [
|
|
112
|
+
{
|
|
113
|
+
name: 'computer_cursor_position',
|
|
114
|
+
description: `Read where the mouse pointer is, in screenshot pixels.${GUIDE}`,
|
|
115
|
+
parameters: NO_PARAMS(),
|
|
116
|
+
},
|
|
117
|
+
clickSpec('computer_double_click', 'Double-click'),
|
|
118
|
+
{
|
|
119
|
+
name: 'computer_hold_key',
|
|
120
|
+
description: `Hold a key or key combination down for a number of seconds, then release it.${GUIDE}`,
|
|
121
|
+
parameters: {
|
|
122
|
+
type: 'object',
|
|
123
|
+
properties: {
|
|
124
|
+
text: { type: 'string', description: 'Key or "+"-joined combination (xdotool names, e.g. "shift" or "cmd+tab").' },
|
|
125
|
+
duration: { type: 'number', description: `Seconds to hold (up to ${HOLD_MAX_SECONDS}).` },
|
|
126
|
+
},
|
|
127
|
+
required: ['text', 'duration'],
|
|
128
|
+
additionalProperties: false,
|
|
129
|
+
},
|
|
130
|
+
},
|
|
131
|
+
{
|
|
132
|
+
name: 'computer_key',
|
|
133
|
+
description: `Press a key or key combination, e.g. "Return", "Escape", "cmd+s", "ctrl+shift+t".${GUIDE}`,
|
|
134
|
+
parameters: {
|
|
135
|
+
type: 'object',
|
|
136
|
+
properties: {
|
|
137
|
+
text: { type: 'string', description: 'Key or "+"-joined combination (xdotool names: Return, Tab, Escape, BackSpace, Up, Page_Down, F5, cmd+c …).' },
|
|
138
|
+
repeat: { type: 'integer', description: `How many times to press it (1 to ${REPEAT_MAX}, default 1).` },
|
|
139
|
+
},
|
|
140
|
+
required: ['text'],
|
|
141
|
+
additionalProperties: false,
|
|
142
|
+
},
|
|
143
|
+
},
|
|
144
|
+
clickSpec('computer_left_click', 'Left-click'),
|
|
145
|
+
{
|
|
146
|
+
name: 'computer_left_click_drag',
|
|
147
|
+
description: `Press the left button at one point, drag to another and release.${GUIDE}`,
|
|
148
|
+
parameters: {
|
|
149
|
+
type: 'object',
|
|
150
|
+
properties: { start_coordinate: point('Where the drag starts'), coordinate: point('Where the drag ends'), text: modifiers },
|
|
151
|
+
required: ['start_coordinate', 'coordinate'],
|
|
152
|
+
additionalProperties: false,
|
|
153
|
+
},
|
|
154
|
+
},
|
|
155
|
+
{
|
|
156
|
+
name: 'computer_left_mouse_down',
|
|
157
|
+
description: `Press the left mouse button where the pointer is and keep it down (pair with computer_left_mouse_up).${GUIDE}`,
|
|
158
|
+
parameters: NO_PARAMS(),
|
|
159
|
+
},
|
|
160
|
+
{
|
|
161
|
+
name: 'computer_left_mouse_up',
|
|
162
|
+
description: `Release the left mouse button where the pointer is.${GUIDE}`,
|
|
163
|
+
parameters: NO_PARAMS(),
|
|
164
|
+
},
|
|
165
|
+
{
|
|
166
|
+
name: 'computer_list_apps',
|
|
167
|
+
description: `List the apps running on the Mac: name, bundle id, whether it is frontmost or hidden, and whether Picasso may control it.${GUIDE}`,
|
|
168
|
+
parameters: NO_PARAMS(),
|
|
169
|
+
},
|
|
170
|
+
{
|
|
171
|
+
name: 'computer_list_windows',
|
|
172
|
+
description: `List the displays and the windows on screen: window id, app, title, frame and display. Pass a window id or display number to computer_screenshot to capture just that.${GUIDE}`,
|
|
173
|
+
parameters: {
|
|
174
|
+
type: 'object',
|
|
175
|
+
properties: { app: { type: 'string', description: 'Only windows of this app (name or bundle id).' } },
|
|
176
|
+
additionalProperties: false,
|
|
177
|
+
},
|
|
178
|
+
},
|
|
179
|
+
clickSpec('computer_middle_click', 'Middle-click'),
|
|
180
|
+
{
|
|
181
|
+
name: 'computer_mouse_move',
|
|
182
|
+
description: `Move the mouse pointer to a point.${GUIDE}`,
|
|
183
|
+
parameters: {
|
|
184
|
+
type: 'object',
|
|
185
|
+
properties: { coordinate: point('Where to move the pointer') },
|
|
186
|
+
required: ['coordinate'],
|
|
187
|
+
additionalProperties: false,
|
|
188
|
+
},
|
|
189
|
+
},
|
|
190
|
+
clickSpec('computer_right_click', 'Right-click'),
|
|
191
|
+
{
|
|
192
|
+
name: 'computer_screenshot',
|
|
193
|
+
description: `Capture the screen as an image. By default the main display; pass display (from computer_list_windows) or window_id to capture that instead, which also sets what later coordinates refer to.${GUIDE}`,
|
|
194
|
+
parameters: {
|
|
195
|
+
type: 'object',
|
|
196
|
+
properties: {
|
|
197
|
+
display: { type: 'integer', description: 'Display number from computer_list_windows (1 is the main display).' },
|
|
198
|
+
window_id: { type: 'integer', description: 'Window id from computer_list_windows: capture only that window.' },
|
|
199
|
+
},
|
|
200
|
+
additionalProperties: false,
|
|
201
|
+
},
|
|
202
|
+
},
|
|
203
|
+
{
|
|
204
|
+
name: 'computer_scroll',
|
|
205
|
+
description: `Scroll at a point (or where the pointer is) by a number of wheel clicks.${GUIDE}`,
|
|
206
|
+
parameters: {
|
|
207
|
+
type: 'object',
|
|
208
|
+
properties: {
|
|
209
|
+
scroll_direction: { type: 'string', enum: [...SCROLL_DIRECTIONS], description: 'up, down, left or right.' },
|
|
210
|
+
scroll_amount: { type: 'integer', description: `Wheel clicks (1 to ${SCROLL_MAX}).` },
|
|
211
|
+
coordinate: point('Where to scroll'),
|
|
212
|
+
text: modifiers,
|
|
213
|
+
},
|
|
214
|
+
required: ['scroll_direction', 'scroll_amount'],
|
|
215
|
+
additionalProperties: false,
|
|
216
|
+
},
|
|
217
|
+
},
|
|
218
|
+
clickSpec('computer_triple_click', 'Triple-click'),
|
|
219
|
+
{
|
|
220
|
+
name: 'computer_type',
|
|
221
|
+
description: `Type text with the keyboard into whatever has focus.${GUIDE}`,
|
|
222
|
+
parameters: {
|
|
223
|
+
type: 'object',
|
|
224
|
+
properties: { text: { type: 'string', description: 'Text to type.' } },
|
|
225
|
+
required: ['text'],
|
|
226
|
+
additionalProperties: false,
|
|
227
|
+
},
|
|
228
|
+
},
|
|
229
|
+
{
|
|
230
|
+
name: 'computer_wait',
|
|
231
|
+
description: `Wait a number of seconds (for an app to load or an animation to finish), then take a new screenshot.${GUIDE}`,
|
|
232
|
+
parameters: {
|
|
233
|
+
type: 'object',
|
|
234
|
+
properties: { duration: { type: 'number', description: `Seconds to wait (up to ${WAIT_MAX_SECONDS}).` } },
|
|
235
|
+
required: ['duration'],
|
|
236
|
+
additionalProperties: false,
|
|
237
|
+
},
|
|
238
|
+
},
|
|
239
|
+
{
|
|
240
|
+
name: 'computer_zoom',
|
|
241
|
+
description: `Look closer at one region of the latest screenshot, returned at a higher resolution. Coordinates stay those of the full screenshot.${GUIDE}`,
|
|
242
|
+
parameters: {
|
|
243
|
+
type: 'object',
|
|
244
|
+
properties: {
|
|
245
|
+
region: { type: 'array', items: { type: 'integer' }, minItems: 4, maxItems: 4, description: 'The region as [x0, y0, x1, y1] pixels in the latest screenshot.' },
|
|
246
|
+
},
|
|
247
|
+
required: ['region'],
|
|
248
|
+
additionalProperties: false,
|
|
249
|
+
},
|
|
250
|
+
},
|
|
251
|
+
];
|
|
252
|
+
|
|
253
|
+
// ── Argument checks (shapes only; the Mac re-checks and maps coordinates) ─────────────────────────────────────────
|
|
254
|
+
|
|
255
|
+
const isInt = (value) => Number.isInteger(value);
|
|
256
|
+
function pointProblem(value, key, required) {
|
|
257
|
+
if (value === undefined) return required ? `${key} is required as [x, y].` : undefined;
|
|
258
|
+
if (!Array.isArray(value) || value.length !== 2 || !value.every((n) => isInt(n) && n >= 0 && n <= COORDINATE_MAX)) {
|
|
259
|
+
return `${key} must be [x, y]: two whole numbers of screenshot pixels.`;
|
|
260
|
+
}
|
|
261
|
+
return undefined;
|
|
262
|
+
}
|
|
263
|
+
function modifierProblem(value) {
|
|
264
|
+
if (value === undefined) return undefined;
|
|
265
|
+
if (typeof value !== 'string' || value.trim() === '') return 'text (modifiers) must name keys such as "shift" or "cmd+shift".';
|
|
266
|
+
const keys = value.toLowerCase().split('+').map((k) => k.trim());
|
|
267
|
+
if (!keys.every((k) => MODIFIERS.has(k))) return 'text (modifiers) may only hold shift, ctrl, alt (option), super (cmd) or fn, joined with "+".';
|
|
268
|
+
return undefined;
|
|
269
|
+
}
|
|
270
|
+
function keyProblem(value, key = 'text') {
|
|
271
|
+
if (typeof value !== 'string' || value.trim() === '') return `${key} must name a key or combination, e.g. "Return" or "cmd+s".`;
|
|
272
|
+
if (value.length > 100) return `${key} is too long for a key combination.`;
|
|
273
|
+
return undefined;
|
|
274
|
+
}
|
|
275
|
+
function secondsProblem(value, key, max) {
|
|
276
|
+
if (typeof value !== 'number' || !Number.isFinite(value) || value <= 0 || value > max) return `${key} must be a number of seconds above 0 and at most ${max}.`;
|
|
277
|
+
return undefined;
|
|
278
|
+
}
|
|
279
|
+
|
|
280
|
+
/** The failure message for a call's arguments, or undefined when they are well-formed. */
|
|
281
|
+
export function argProblem(tool, args) {
|
|
282
|
+
if (CLICK_TOOLS.includes(tool)) return pointProblem(args.coordinate, 'coordinate', false) ?? modifierProblem(args.text);
|
|
283
|
+
switch (tool) {
|
|
284
|
+
case 'computer_screenshot': {
|
|
285
|
+
if (args.display !== undefined && args.window_id !== undefined) return 'Give display or window_id, not both.';
|
|
286
|
+
if (args.display !== undefined && !(isInt(args.display) && args.display >= 1)) return 'display must be a display number from computer_list_windows (1 or more).';
|
|
287
|
+
if (args.window_id !== undefined && !(isInt(args.window_id) && args.window_id >= 0)) return 'window_id must be a window id from computer_list_windows.';
|
|
288
|
+
return undefined;
|
|
289
|
+
}
|
|
290
|
+
case 'computer_zoom': {
|
|
291
|
+
const r = args.region;
|
|
292
|
+
if (!Array.isArray(r) || r.length !== 4 || !r.every((n) => isInt(n) && n >= 0 && n <= COORDINATE_MAX)) return 'region must be [x0, y0, x1, y1] in screenshot pixels.';
|
|
293
|
+
if (r[2] <= r[0] || r[3] <= r[1]) return 'region needs x1 > x0 and y1 > y0.';
|
|
294
|
+
return undefined;
|
|
295
|
+
}
|
|
296
|
+
case 'computer_left_click_drag':
|
|
297
|
+
return pointProblem(args.start_coordinate, 'start_coordinate', true) ?? pointProblem(args.coordinate, 'coordinate', true) ?? modifierProblem(args.text);
|
|
298
|
+
case 'computer_mouse_move':
|
|
299
|
+
return pointProblem(args.coordinate, 'coordinate', true);
|
|
300
|
+
case 'computer_scroll':
|
|
301
|
+
if (!SCROLL_DIRECTIONS.includes(args.scroll_direction)) return 'scroll_direction must be up, down, left or right.';
|
|
302
|
+
if (!(isInt(args.scroll_amount) && args.scroll_amount >= 1 && args.scroll_amount <= SCROLL_MAX)) return `scroll_amount must be a whole number from 1 to ${SCROLL_MAX}.`;
|
|
303
|
+
return pointProblem(args.coordinate, 'coordinate', false) ?? modifierProblem(args.text);
|
|
304
|
+
case 'computer_type':
|
|
305
|
+
if (typeof args.text !== 'string' || args.text.length === 0) return 'text must be the text to type.';
|
|
306
|
+
if (args.text.length > TYPE_MAX_CHARS) return `text is limited to ${TYPE_MAX_CHARS} characters per call.`;
|
|
307
|
+
return undefined;
|
|
308
|
+
case 'computer_key':
|
|
309
|
+
if (args.repeat !== undefined && !(isInt(args.repeat) && args.repeat >= 1 && args.repeat <= REPEAT_MAX)) return `repeat must be a whole number from 1 to ${REPEAT_MAX}.`;
|
|
310
|
+
return keyProblem(args.text);
|
|
311
|
+
case 'computer_hold_key':
|
|
312
|
+
return keyProblem(args.text) ?? secondsProblem(args.duration, 'duration', HOLD_MAX_SECONDS);
|
|
313
|
+
case 'computer_wait':
|
|
314
|
+
return secondsProblem(args.duration, 'duration', WAIT_MAX_SECONDS);
|
|
315
|
+
case 'computer_list_windows':
|
|
316
|
+
if (args.app !== undefined && (typeof args.app !== 'string' || args.app.trim() === '')) return 'app must be an app name or bundle id.';
|
|
317
|
+
return undefined;
|
|
318
|
+
default:
|
|
319
|
+
return undefined;
|
|
320
|
+
}
|
|
321
|
+
}
|
|
322
|
+
|
|
323
|
+
// ── Approvals ─────────────────────────────────────────────────────────────────────────────────────────────────────
|
|
324
|
+
|
|
325
|
+
const at = (p) => (Array.isArray(p) && p.length === 2 ? ` at (${p[0]}, ${p[1]})` : '');
|
|
326
|
+
const held = (text) => (typeof text === 'string' && text.trim() ? ` with ${text.trim()} held` : '');
|
|
327
|
+
|
|
328
|
+
/** The approval card's reason for one input action (never the typed text itself). */
|
|
329
|
+
export function askReason(exec) {
|
|
330
|
+
const args = isRecord(exec.arguments) ? exec.arguments : {};
|
|
331
|
+
switch (exec.name) {
|
|
332
|
+
case 'computer_left_click': return `Click${at(args.coordinate)}${held(args.text)} on your Mac`;
|
|
333
|
+
case 'computer_right_click': return `Right-click${at(args.coordinate)}${held(args.text)} on your Mac`;
|
|
334
|
+
case 'computer_middle_click': return `Middle-click${at(args.coordinate)}${held(args.text)} on your Mac`;
|
|
335
|
+
case 'computer_double_click': return `Double-click${at(args.coordinate)}${held(args.text)} on your Mac`;
|
|
336
|
+
case 'computer_triple_click': return `Triple-click${at(args.coordinate)}${held(args.text)} on your Mac`;
|
|
337
|
+
case 'computer_left_click_drag': return `Drag from${at(args.start_coordinate).replace(' at', '')} to${at(args.coordinate).replace(' at', '')} on your Mac`;
|
|
338
|
+
case 'computer_mouse_move': return `Move the pointer to${at(args.coordinate).replace(' at', '')} on your Mac`;
|
|
339
|
+
case 'computer_left_mouse_down': return 'Press the mouse button on your Mac';
|
|
340
|
+
case 'computer_left_mouse_up': return 'Release the mouse button on your Mac';
|
|
341
|
+
case 'computer_scroll': return `Scroll ${typeof args.scroll_direction === 'string' ? args.scroll_direction : ''}${at(args.coordinate)} on your Mac`.replace(' ', ' ');
|
|
342
|
+
case 'computer_type': {
|
|
343
|
+
const n = typeof args.text === 'string' ? [...args.text].length : 0;
|
|
344
|
+
return `Type ${n} character${n === 1 ? '' : 's'} on your Mac`;
|
|
345
|
+
}
|
|
346
|
+
case 'computer_key': return `Press ${typeof args.text === 'string' ? args.text : 'a key'}${isInt(args.repeat) && args.repeat > 1 ? ` ${args.repeat} times` : ''} on your Mac`;
|
|
347
|
+
case 'computer_hold_key': return `Hold ${typeof args.text === 'string' ? args.text : 'a key'} for ${typeof args.duration === 'number' ? args.duration : '?'} s on your Mac`;
|
|
348
|
+
default: return `Run ${exec.name} on your Mac`;
|
|
349
|
+
}
|
|
350
|
+
}
|
|
351
|
+
|
|
352
|
+
/**
|
|
353
|
+
* The per-session gate: `gateFor(agent)` → `{mode, reason?, model?}` | undefined (unknown yet). An unsupported or
|
|
354
|
+
* hostless session never asks; its call fails with the reason.
|
|
355
|
+
*/
|
|
356
|
+
export function makePreExecute(gate) {
|
|
357
|
+
return (exec, next) => {
|
|
358
|
+
if (!ASK_TOOLS.has(exec.name)) return next();
|
|
359
|
+
if (!gate.canRun(exec.agent)) return next();
|
|
360
|
+
const reason = askReason(exec);
|
|
361
|
+
return Promise.resolve({ kind: 'ask', reason, displayReason: { en: reason } });
|
|
362
|
+
};
|
|
363
|
+
}
|
|
364
|
+
|
|
365
|
+
// ── The action queue (`picassoComputer/*`) ────────────────────────────────────────────────────────────────────────
|
|
366
|
+
|
|
367
|
+
export class ComputerActions {
|
|
368
|
+
constructor(options = {}) {
|
|
369
|
+
this.now = options.now ?? Date.now;
|
|
370
|
+
this.noPollerMs = options.noPollerMs ?? NO_POLLER_MS;
|
|
371
|
+
this.actionTimeoutMs = options.actionTimeoutMs ?? ACTION_TIMEOUT_MS;
|
|
372
|
+
this.queue = [];
|
|
373
|
+
this.inflight = new Map();
|
|
374
|
+
this.cancelledIds = [];
|
|
375
|
+
this.waiters = new Set();
|
|
376
|
+
this.lastPollAt = 0;
|
|
377
|
+
this.seq = 0;
|
|
378
|
+
}
|
|
379
|
+
|
|
380
|
+
async take(timeoutMs, signal) {
|
|
381
|
+
this.lastPollAt = this.now();
|
|
382
|
+
const ms = typeof timeoutMs === 'number' && Number.isFinite(timeoutMs) && timeoutMs > 0 ? timeoutMs : TAKE_DEFAULT_MS;
|
|
383
|
+
const deadline = this.now() + ms;
|
|
384
|
+
const flush = () => {
|
|
385
|
+
const actions = this.queue.splice(0);
|
|
386
|
+
const cancelled = this.cancelledIds.splice(0);
|
|
387
|
+
for (const action of actions) this.inflight.set(action.actionId, action);
|
|
388
|
+
return { actions: actions.map(({ resolve: _r, reject: _j, timer: _t, onAbort: _a, signal: _s, result: _p, ...wire }) => wire), cancelled };
|
|
389
|
+
};
|
|
390
|
+
const out = flush();
|
|
391
|
+
if (out.actions.length > 0 || out.cancelled.length > 0) return out;
|
|
392
|
+
return await new Promise((resolve) => {
|
|
393
|
+
const settle = () => { clearTimeout(timer); signal?.removeEventListener('abort', onAbort); this.waiters.delete(entry); resolve(flush()); };
|
|
394
|
+
const timer = setTimeout(settle, Math.max(0, deadline - this.now()));
|
|
395
|
+
const onAbort = () => settle();
|
|
396
|
+
signal?.addEventListener('abort', onAbort, { once: true });
|
|
397
|
+
const entry = { settle };
|
|
398
|
+
this.waiters.add(entry);
|
|
399
|
+
});
|
|
400
|
+
}
|
|
401
|
+
|
|
402
|
+
complete(actionId, ok, value, error, sessionId) {
|
|
403
|
+
const action = this.inflight.get(actionId);
|
|
404
|
+
if (action === undefined) throw new ComputerError('unknown-action', `No pending computer action "${String(actionId)}".`, { actionId });
|
|
405
|
+
if (typeof sessionId !== 'string' || sessionId === '') {
|
|
406
|
+
throw new ComputerError('session-required', `Completing computer action "${String(actionId)}" requires the issuing sessionId.`, { actionId });
|
|
407
|
+
}
|
|
408
|
+
if (sessionId !== action.sessionId) {
|
|
409
|
+
throw new ComputerError('session-mismatch', `Computer action "${String(actionId)}" belongs to a different session.`, { actionId });
|
|
410
|
+
}
|
|
411
|
+
clearTimeout(action.timer);
|
|
412
|
+
action.onAbort && action.signal?.removeEventListener('abort', action.onAbort);
|
|
413
|
+
this.inflight.delete(actionId);
|
|
414
|
+
if (ok === true) action.resolve(normalizeValue(value));
|
|
415
|
+
else action.reject(new Error(typeof error === 'string' && error ? error : 'The computer action failed.'));
|
|
416
|
+
return {};
|
|
417
|
+
}
|
|
418
|
+
|
|
419
|
+
/** Whether a Mac poller took work recently (a host is attached). */
|
|
420
|
+
hasPoller() {
|
|
421
|
+
return this.now() - this.lastPollAt <= this.noPollerMs;
|
|
422
|
+
}
|
|
423
|
+
|
|
424
|
+
issue(sessionId, callId, tool, args, signal, timeoutMs = this.actionTimeoutMs) {
|
|
425
|
+
if (!this.hasPoller()) return { actionId: undefined, promise: Promise.reject(new Error(APP_CLOSED)) };
|
|
426
|
+
const actionId = `ca-${++this.seq}`;
|
|
427
|
+
const action = { actionId, sessionId, callId, tool, args: isRecord(args) ? args : {}, issuedAt: this.now() };
|
|
428
|
+
const promise = new Promise((resolve, reject) => {
|
|
429
|
+
action.resolve = resolve;
|
|
430
|
+
action.reject = reject;
|
|
431
|
+
action.timer = setTimeout(() => this.expire(actionId, new Error(ACTION_TIMEOUT)), timeoutMs);
|
|
432
|
+
action.timer.unref?.();
|
|
433
|
+
if (signal) {
|
|
434
|
+
action.signal = signal;
|
|
435
|
+
action.onAbort = () => this.expire(actionId, aborted(signal));
|
|
436
|
+
signal.addEventListener('abort', action.onAbort, { once: true });
|
|
437
|
+
}
|
|
438
|
+
});
|
|
439
|
+
action.result = promise;
|
|
440
|
+
this.queue.push(action);
|
|
441
|
+
for (const waiter of [...this.waiters]) waiter.settle();
|
|
442
|
+
return { actionId, promise };
|
|
443
|
+
}
|
|
444
|
+
|
|
445
|
+
expire(actionId, error) {
|
|
446
|
+
let action = this.inflight.get(actionId);
|
|
447
|
+
if (action !== undefined) this.inflight.delete(actionId);
|
|
448
|
+
else {
|
|
449
|
+
const index = this.queue.findIndex((entry) => entry.actionId === actionId);
|
|
450
|
+
if (index < 0) return;
|
|
451
|
+
action = this.queue.splice(index, 1)[0];
|
|
452
|
+
}
|
|
453
|
+
clearTimeout(action.timer);
|
|
454
|
+
action.onAbort && action.signal?.removeEventListener('abort', action.onAbort);
|
|
455
|
+
this.cancelledIds.push(actionId);
|
|
456
|
+
action.reject(error);
|
|
457
|
+
for (const waiter of [...this.waiters]) waiter.settle();
|
|
458
|
+
}
|
|
459
|
+
}
|
|
460
|
+
|
|
461
|
+
function aborted(signal) {
|
|
462
|
+
const reason = signal?.reason;
|
|
463
|
+
return reason instanceof Error ? reason : new Error('The tool call was cancelled.');
|
|
464
|
+
}
|
|
465
|
+
|
|
466
|
+
export function normalizeValue(value) {
|
|
467
|
+
if (!isRecord(value) || typeof value.text !== 'string') return { text: '' };
|
|
468
|
+
const image = isRecord(value.image) && typeof value.image.data === 'string' && typeof value.image.mimeType === 'string'
|
|
469
|
+
? { data: value.image.data, mimeType: value.image.mimeType }
|
|
470
|
+
: undefined;
|
|
471
|
+
return { text: value.text, ...(image ? { image } : {}) };
|
|
472
|
+
}
|
|
473
|
+
|
|
474
|
+
// ── Gate (which sessions may use the tools) ───────────────────────────────────────────────────────────────────────
|
|
475
|
+
|
|
476
|
+
/**
|
|
477
|
+
* Tracks each agent's step model and its support (`agent/pre-step`); `host` 'mac' or 'none'. `describe(provider,
|
|
478
|
+
* model)` → `{api?, baseUrl?, inputModalities?}` (the engine's model info), cached per route/model.
|
|
479
|
+
*/
|
|
480
|
+
export class ComputerGate {
|
|
481
|
+
constructor({ host = 'none', flagged = [], describe = async () => ({}) } = {}) {
|
|
482
|
+
this.host = host;
|
|
483
|
+
this.flagged = flagged;
|
|
484
|
+
this.describe = describe;
|
|
485
|
+
this.byAgent = new WeakMap();
|
|
486
|
+
this.byRoute = new Map();
|
|
487
|
+
}
|
|
488
|
+
|
|
489
|
+
async observe(agent, selection) {
|
|
490
|
+
if (agent === null || typeof agent !== 'object' || !isRecord(selection)) return;
|
|
491
|
+
const provider = typeof selection.provider === 'string' ? selection.provider : '';
|
|
492
|
+
const model = typeof selection.model === 'string' ? selection.model : '';
|
|
493
|
+
const key = `${provider}\u0000${model}`;
|
|
494
|
+
let support = this.byRoute.get(key);
|
|
495
|
+
if (support === undefined) {
|
|
496
|
+
let info = {};
|
|
497
|
+
try { info = (await this.describe(provider, model)) ?? {}; } catch { info = {}; }
|
|
498
|
+
support = { ...computerUseSupport({ provider, model, flagged: this.flagged, ...info }), model };
|
|
499
|
+
this.byRoute.set(key, support);
|
|
500
|
+
}
|
|
501
|
+
this.byAgent.set(agent, support);
|
|
502
|
+
}
|
|
503
|
+
|
|
504
|
+
supportFor(agent) {
|
|
505
|
+
if (agent === null || typeof agent !== 'object') return undefined;
|
|
506
|
+
return this.byAgent.get(agent);
|
|
507
|
+
}
|
|
508
|
+
|
|
509
|
+
/** Visible in tool_search for this agent: a capable model (an agent not seen yet counts as capable). */
|
|
510
|
+
visibleTo(agent) {
|
|
511
|
+
const support = this.supportFor(agent);
|
|
512
|
+
return support === undefined || support.mode !== 'none';
|
|
513
|
+
}
|
|
514
|
+
|
|
515
|
+
/** Whether a call would reach the Mac (so it is worth asking the person). */
|
|
516
|
+
canRun(agent) {
|
|
517
|
+
return this.host === 'mac' && this.visibleTo(agent);
|
|
518
|
+
}
|
|
519
|
+
|
|
520
|
+
/** The refusal for a call by this agent, or undefined. */
|
|
521
|
+
refusal(agent) {
|
|
522
|
+
const support = this.supportFor(agent);
|
|
523
|
+
if (support !== undefined && support.mode === 'none') return unsupportedModel(support.model);
|
|
524
|
+
if (this.host !== 'mac') return NEEDS_MAC;
|
|
525
|
+
return undefined;
|
|
526
|
+
}
|
|
527
|
+
}
|
|
528
|
+
|
|
529
|
+
/** `computer_wait`: sleep in the plugin, cancellable. */
|
|
530
|
+
function sleep(seconds, signal) {
|
|
531
|
+
return new Promise((resolve, reject) => {
|
|
532
|
+
if (signal?.aborted) return reject(aborted(signal));
|
|
533
|
+
const timer = setTimeout(() => { signal?.removeEventListener('abort', onAbort); resolve(); }, seconds * 1000);
|
|
534
|
+
const onAbort = () => { clearTimeout(timer); reject(aborted(signal)); };
|
|
535
|
+
signal?.addEventListener('abort', onAbort, { once: true });
|
|
536
|
+
});
|
|
537
|
+
}
|
|
538
|
+
|
|
539
|
+
/** Run one tool call: gate, validate, then queue for the Mac (or wait locally). Returns `{text, image?}`. */
|
|
540
|
+
export async function runAction(actions, gate, exec) {
|
|
541
|
+
const refusal = gate.refusal(exec.agent);
|
|
542
|
+
if (refusal) throw new Error(refusal);
|
|
543
|
+
const args = isRecord(exec.arguments) ? exec.arguments : {};
|
|
544
|
+
const problem = argProblem(exec.name, args);
|
|
545
|
+
if (problem) throw new Error(problem);
|
|
546
|
+
if (exec.name === 'computer_wait') {
|
|
547
|
+
await sleep(args.duration, exec.signal);
|
|
548
|
+
return { text: `Waited ${args.duration} s. Take a screenshot to see what changed.` };
|
|
549
|
+
}
|
|
550
|
+
const sessionId = exec.agent?.id;
|
|
551
|
+
if (typeof sessionId !== 'string' || !sessionId) throw new Error('computer actions need an agent session');
|
|
552
|
+
const timeout = exec.name === 'computer_hold_key' ? ACTION_TIMEOUT_MS + args.duration * 1000 : undefined;
|
|
553
|
+
const { promise } = actions.issue(sessionId, String(exec.callId ?? ''), exec.name, args, exec.signal, timeout);
|
|
554
|
+
return await promise;
|
|
555
|
+
}
|
|
556
|
+
|
|
557
|
+
export function buildTools(ctx, adapter, actions, gate) {
|
|
558
|
+
return TOOL_SPECS.map((spec) => {
|
|
559
|
+
let tool;
|
|
560
|
+
if (adapter !== undefined) {
|
|
561
|
+
tool = adapter(ctx, {
|
|
562
|
+
name: spec.name,
|
|
563
|
+
rawName: spec.name,
|
|
564
|
+
description: spec.description,
|
|
565
|
+
inputSchema: spec.parameters,
|
|
566
|
+
async call(_args, exec) {
|
|
567
|
+
const result = await runAction(actions, gate, exec);
|
|
568
|
+
return {
|
|
569
|
+
content: [
|
|
570
|
+
{ type: 'text', text: result.text },
|
|
571
|
+
...(result.image ? [{ type: 'image', data: result.image.data, mimeType: result.image.mimeType }] : []),
|
|
572
|
+
],
|
|
573
|
+
};
|
|
574
|
+
},
|
|
575
|
+
});
|
|
576
|
+
} else {
|
|
577
|
+
tool = {
|
|
578
|
+
name: spec.name,
|
|
579
|
+
description: spec.description,
|
|
580
|
+
parameters: spec.parameters,
|
|
581
|
+
output: {
|
|
582
|
+
schema: { type: 'object', properties: { text: { type: 'string' } }, required: ['text'] },
|
|
583
|
+
render: (_args, value) => [{ type: 'text', text: typeof value?.text === 'string' ? value.text : '' }],
|
|
584
|
+
},
|
|
585
|
+
async execute(_args, exec) {
|
|
586
|
+
if (spec.name === 'computer_screenshot' || spec.name === 'computer_zoom') {
|
|
587
|
+
const refusal = gate.refusal(exec.agent);
|
|
588
|
+
if (refusal) throw new Error(refusal);
|
|
589
|
+
throw new Error('Screenshots need image support in this engine build; computer use is unavailable without it.');
|
|
590
|
+
}
|
|
591
|
+
const result = await runAction(actions, gate, exec);
|
|
592
|
+
return { text: result.text };
|
|
593
|
+
},
|
|
594
|
+
};
|
|
595
|
+
}
|
|
596
|
+
// lean-context's tool_search reads this to hide the family from sessions whose model can't use it.
|
|
597
|
+
if (tool && typeof tool === 'object') {
|
|
598
|
+
try { tool.picassoVisibleTo = (agent) => gate.visibleTo(agent); } catch { /* frozen definition: stays listed */ }
|
|
599
|
+
}
|
|
600
|
+
return tool;
|
|
601
|
+
});
|
|
602
|
+
}
|
|
603
|
+
|
|
604
|
+
export async function dshModule(dshBin, specifier) {
|
|
605
|
+
const require = createRequire(dshBin);
|
|
606
|
+
return import(pathToFileURL(require.resolve(specifier)).href);
|
|
607
|
+
}
|
|
608
|
+
|
|
609
|
+
/** The engine's model info for one route/model (api, base URL, input modalities), best effort. */
|
|
610
|
+
function engineDescriber(ctx) {
|
|
611
|
+
const registry = () => {
|
|
612
|
+
try { return ctx.get?.('llm'); } catch { return undefined; }
|
|
613
|
+
};
|
|
614
|
+
return async (provider, model) => {
|
|
615
|
+
const llm = registry();
|
|
616
|
+
if (!llm || typeof llm.resolveModelInfo !== 'function') return {};
|
|
617
|
+
const info = await llm.resolveModelInfo(provider, model);
|
|
618
|
+
if (!isRecord(info)) return {};
|
|
619
|
+
return {
|
|
620
|
+
...(Array.isArray(info.inputModalities) ? { inputModalities: info.inputModalities } : {}),
|
|
621
|
+
...(typeof info.api === 'string' ? { api: info.api } : {}),
|
|
622
|
+
...(typeof info.baseUrl === 'string' ? { baseUrl: info.baseUrl } : {}),
|
|
623
|
+
};
|
|
624
|
+
};
|
|
625
|
+
}
|
|
626
|
+
|
|
627
|
+
export async function apply(ctx, config) {
|
|
628
|
+
const host = config?.host === 'mac' ? 'mac' : 'none';
|
|
629
|
+
const flagged = Array.isArray(config?.computerUseModels) ? config.computerUseModels : [];
|
|
630
|
+
const actions = new ComputerActions();
|
|
631
|
+
const gate = new ComputerGate({ host, flagged, describe: engineDescriber(ctx) });
|
|
632
|
+
const service = actions;
|
|
633
|
+
service.typertRemote = Object.freeze({ service, serviceKey: SERVICE_KEY, namespace: SERVICE_KEY });
|
|
634
|
+
service.gate = gate;
|
|
635
|
+
ctx.provide(SERVICE_KEY, service);
|
|
636
|
+
let adapter;
|
|
637
|
+
try {
|
|
638
|
+
const module = await dshModule(config?.dshBin ?? '/opt/homebrew/bin/dsh', '@deepseek-ai/dsh-mcp-client');
|
|
639
|
+
adapter = module.createMcpToolDefinition;
|
|
640
|
+
if (typeof adapter !== 'function') throw new Error('no export');
|
|
641
|
+
} catch (error) {
|
|
642
|
+
console.warn(`${name}: image projection unavailable (${error instanceof Error ? error.message : String(error)}); registering text-only computer tools`);
|
|
643
|
+
}
|
|
644
|
+
for (const tool of buildTools(ctx, adapter, actions, gate)) ctx.tools.register(tool);
|
|
645
|
+
// tool_search (picasso-lean-context) hides the family from sessions whose model can't use it.
|
|
646
|
+
const visibility = (globalThis[TOOL_VISIBILITY_KEY] ??= new Map());
|
|
647
|
+
for (const toolName of TOOL_NAMES) visibility.set(toolName, (agent) => gate.visibleTo(agent));
|
|
648
|
+
ctx.on?.('dispose', () => { for (const toolName of TOOL_NAMES) visibility.delete(toolName); });
|
|
649
|
+
ctx.on('agent/pre-step', async (args, next) => {
|
|
650
|
+
try { await gate.observe(args?.agent, args?.modelSelection); } catch { /* gate stays as it was */ }
|
|
651
|
+
return next();
|
|
652
|
+
});
|
|
653
|
+
ctx.on('tools/pre-execute', makePreExecute(gate));
|
|
654
|
+
// The native toolset only where the tools can run (the Mac relay), and only with image projection.
|
|
655
|
+
if (host === 'mac' && adapter !== undefined && config?.nativeToolset !== false) {
|
|
656
|
+
const uninstall = installAnthropicComputerBridge();
|
|
657
|
+
ctx.on?.('dispose', uninstall);
|
|
658
|
+
}
|
|
659
|
+
}
|
|
660
|
+
|
|
661
|
+
Object.defineProperty(ComputerActions.prototype, REMOTE_METHOD_DESCRIPTOR, {
|
|
662
|
+
configurable: true,
|
|
663
|
+
value: Object.freeze({
|
|
664
|
+
version: 1,
|
|
665
|
+
methods: Object.freeze([
|
|
666
|
+
Object.freeze({ method: 'take', invocation: Object.freeze({ kind: 'direct' }) }),
|
|
667
|
+
Object.freeze({ method: 'complete', invocation: Object.freeze({ kind: 'direct' }) }),
|
|
668
|
+
]),
|
|
669
|
+
}),
|
|
670
|
+
});
|