@isaacthoman/pulpo 0.182.0 → 0.183.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/dist/index.js +101 -2
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -22318,7 +22318,15 @@ var computerDescriptionSchema = external_exports.object({
|
|
|
22318
22318
|
* `/workspace/files` is in a cloud workspace). Absent when the app cannot run `pulpo files`
|
|
22319
22319
|
* for the agent's commands, and then Files are not offered in a full-access reply.
|
|
22320
22320
|
*/
|
|
22321
|
-
filesDir: external_exports.string().max(COMPUTER_PATH_MAX_LENGTH).optional()
|
|
22321
|
+
filesDir: external_exports.string().max(COMPUTER_PATH_MAX_LENGTH).optional(),
|
|
22322
|
+
/**
|
|
22323
|
+
* Present when the app can show the agent other apps' windows and act in them (`app.list`,
|
|
22324
|
+
* `app.act`); absent from apps that cannot, and then the app tools are not offered.
|
|
22325
|
+
* `background`: what the agent does reaches an app without moving the user's pointer, taking
|
|
22326
|
+
* their keyboard or bringing the app forward (macOS). False where the app comes to the front and
|
|
22327
|
+
* the user's own pointer and keyboard are used (Windows).
|
|
22328
|
+
*/
|
|
22329
|
+
apps: external_exports.object({ version: external_exports.number().int(), background: external_exports.boolean() }).optional()
|
|
22322
22330
|
});
|
|
22323
22331
|
var COMPUTER_TRANSFER_PATH = "/api/computer/transfers/";
|
|
22324
22332
|
var computerTransferSchema = external_exports.object({
|
|
@@ -22377,6 +22385,83 @@ var computerFolderChangeResultSchema = external_exports.object({
|
|
|
22377
22385
|
/** The file's version after the change, or the one it now has on a conflict. */
|
|
22378
22386
|
version: external_exports.string().optional()
|
|
22379
22387
|
});
|
|
22388
|
+
var computerAppSchema = external_exports.object({
|
|
22389
|
+
/** As the user knows it: `TextEdit`, `Notepad`. The agent names an app by this. */
|
|
22390
|
+
name: external_exports.string().max(200),
|
|
22391
|
+
/** Whether the user already let the agent use it. Using any other app asks them first. */
|
|
22392
|
+
allowed: external_exports.boolean(),
|
|
22393
|
+
/** The app the user is working in. */
|
|
22394
|
+
frontmost: external_exports.boolean(),
|
|
22395
|
+
/** Its windows' titles, front to back. Left out for an app the user has not allowed. */
|
|
22396
|
+
windows: external_exports.array(external_exports.string().max(500)).max(50)
|
|
22397
|
+
});
|
|
22398
|
+
var COMPUTER_APP_TYPE_MAX_CHARACTERS = 2e3;
|
|
22399
|
+
var appCoordinate = external_exports.number().finite().min(0).max(1e5);
|
|
22400
|
+
var appElementIndex = external_exports.number().int().min(1).max(1e5);
|
|
22401
|
+
var computerAppActionSchema = external_exports.discriminatedUnion("type", [
|
|
22402
|
+
external_exports.object({ type: external_exports.literal("view") }),
|
|
22403
|
+
/** A click on an element, or at a point when no element is named. */
|
|
22404
|
+
external_exports.object({
|
|
22405
|
+
type: external_exports.literal("click"),
|
|
22406
|
+
element: appElementIndex.optional(),
|
|
22407
|
+
x: appCoordinate.optional(),
|
|
22408
|
+
y: appCoordinate.optional(),
|
|
22409
|
+
button: external_exports.enum(["left", "right", "middle"]).default("left"),
|
|
22410
|
+
count: external_exports.union([external_exports.literal(1), external_exports.literal(2), external_exports.literal(3)]).default(1)
|
|
22411
|
+
}).refine((value) => value.element !== void 0 || value.x !== void 0 && value.y !== void 0, "Name an element or give both x and y"),
|
|
22412
|
+
/** Types text into whatever has the keyboard focus in the window. Windows types a character at a time (about 60 a second), so the length is bounded by `COMPUTER_APP_ACT_TIMEOUT_MS`. */
|
|
22413
|
+
external_exports.object({ type: external_exports.literal("type"), text: external_exports.string().min(1).max(COMPUTER_APP_TYPE_MAX_CHARACTERS) }),
|
|
22414
|
+
/** One key or chord: `enter`, `escape`, `cmd+s`, `ctrl+shift+t`. */
|
|
22415
|
+
external_exports.object({ type: external_exports.literal("key"), keys: external_exports.string().min(1).max(100) }),
|
|
22416
|
+
/** Scrolls at an element, at a point, or in the middle of the window, by lines; positive `dy` moves down the page. */
|
|
22417
|
+
external_exports.object({
|
|
22418
|
+
type: external_exports.literal("scroll"),
|
|
22419
|
+
element: appElementIndex.optional(),
|
|
22420
|
+
x: appCoordinate.optional(),
|
|
22421
|
+
y: appCoordinate.optional(),
|
|
22422
|
+
dx: external_exports.number().int().min(-100).max(100).default(0),
|
|
22423
|
+
dy: external_exports.number().int().min(-100).max(100).default(0)
|
|
22424
|
+
}).refine((value) => value.dx !== 0 || value.dy !== 0, "Scroll by at least one line"),
|
|
22425
|
+
external_exports.object({ type: external_exports.literal("drag"), fromX: appCoordinate, fromY: appCoordinate, toX: appCoordinate, toY: appCoordinate }),
|
|
22426
|
+
/** Sets what an element holds without typing: a field's text, a slider's number. */
|
|
22427
|
+
external_exports.object({ type: external_exports.literal("set_value"), element: appElementIndex, value: external_exports.string().max(1e4) })
|
|
22428
|
+
]);
|
|
22429
|
+
var computerAppElementSchema = external_exports.object({
|
|
22430
|
+
/** What the agent names it by in its next action on this window. */
|
|
22431
|
+
index: appElementIndex,
|
|
22432
|
+
/** How deep it sits below the elements listed before it. */
|
|
22433
|
+
depth: external_exports.number().int().min(0).max(100),
|
|
22434
|
+
/** `button`, `textfield`, `checkbox`, `link`, `menuitem`, `text`, … */
|
|
22435
|
+
role: external_exports.string().max(40),
|
|
22436
|
+
label: external_exports.string().max(200).optional(),
|
|
22437
|
+
value: external_exports.string().max(200).optional(),
|
|
22438
|
+
x: external_exports.number().finite(),
|
|
22439
|
+
y: external_exports.number().finite(),
|
|
22440
|
+
width: external_exports.number().finite().nonnegative(),
|
|
22441
|
+
height: external_exports.number().finite().nonnegative(),
|
|
22442
|
+
focused: external_exports.boolean().optional(),
|
|
22443
|
+
enabled: external_exports.boolean().optional()
|
|
22444
|
+
});
|
|
22445
|
+
var computerAppStateSchema = external_exports.object({
|
|
22446
|
+
app: external_exports.string().max(200),
|
|
22447
|
+
/** The title of the window shown. After an action that opened a window (a dialog), that one. */
|
|
22448
|
+
window: external_exports.string().max(500),
|
|
22449
|
+
/** The titles of all the app's windows now, front to back, so one that opened or closed is noticed. */
|
|
22450
|
+
windows: external_exports.array(external_exports.string().max(500)).max(50).optional(),
|
|
22451
|
+
/** What the action did, when that is worth saying ("Pressed the Save button"). */
|
|
22452
|
+
note: external_exports.string().max(1e3).optional(),
|
|
22453
|
+
image: external_exports.object({
|
|
22454
|
+
mimeType: external_exports.enum(["image/jpeg", "image/png"]),
|
|
22455
|
+
width: external_exports.number().int().positive(),
|
|
22456
|
+
height: external_exports.number().int().positive(),
|
|
22457
|
+
sizeBytes: external_exports.number().int().nonnegative(),
|
|
22458
|
+
data: inlineData.optional(),
|
|
22459
|
+
path: external_exports.string().min(1).max(COMPUTER_PATH_MAX_LENGTH).optional()
|
|
22460
|
+
}).refine((value) => value.data === void 0 !== (value.path === void 0), "Send the picture inline or name its file, not both"),
|
|
22461
|
+
elements: external_exports.array(computerAppElementSchema).max(1e3),
|
|
22462
|
+
/** The window has more elements than were listed. */
|
|
22463
|
+
truncated: external_exports.boolean()
|
|
22464
|
+
});
|
|
22380
22465
|
var operationId = external_exports.string().min(1).max(200);
|
|
22381
22466
|
var absolutePath = external_exports.string().min(1).max(COMPUTER_PATH_MAX_LENGTH);
|
|
22382
22467
|
var computerMethods = {
|
|
@@ -22415,6 +22500,20 @@ var computerMethods = {
|
|
|
22415
22500
|
params: external_exports.object({ files: external_exports.array(external_exports.object({ path: absolutePath, sizeBytes: external_exports.number().int().nonnegative(), sha256: external_exports.string().nullable() })).max(500) }),
|
|
22416
22501
|
result: external_exports.object({ missing: external_exports.array(external_exports.string()) })
|
|
22417
22502
|
},
|
|
22503
|
+
/** The apps running with a window open (full access, on apps that describe `apps`). */
|
|
22504
|
+
"app.list": { params: external_exports.object({}), result: external_exports.object({ apps: external_exports.array(computerAppSchema).max(200) }) },
|
|
22505
|
+
/**
|
|
22506
|
+
* Does one thing in an app's window and answers with the window as it is afterwards. `app` is a
|
|
22507
|
+
* name from `app.list`; `window` picks one of its windows by part of its title, else the front
|
|
22508
|
+
* one for `view` and the one last shown for anything else (a click means something only in the
|
|
22509
|
+
* picture the agent saw). An app the user has not allowed yet is asked about first, in a native
|
|
22510
|
+
* dialog, and the request waits for the answer (`COMPUTER_APP_APPROVAL_TIMEOUT_MS`): refused, it
|
|
22511
|
+
* fails with `not_allowed`.
|
|
22512
|
+
*/
|
|
22513
|
+
"app.act": {
|
|
22514
|
+
params: external_exports.object({ app: external_exports.string().min(1).max(200), window: external_exports.string().min(1).max(500).optional(), action: computerAppActionSchema }),
|
|
22515
|
+
result: computerAppStateSchema
|
|
22516
|
+
},
|
|
22418
22517
|
// Folder modes only. Paths are relative to the session's folder.
|
|
22419
22518
|
/** Entries below `path`, depth-first in name order, `depth` levels deep (1: direct children). */
|
|
22420
22519
|
"folder.list": {
|
|
@@ -37109,7 +37208,7 @@ async function runModelTest(input2) {
|
|
|
37109
37208
|
}
|
|
37110
37209
|
|
|
37111
37210
|
// src/index.ts
|
|
37112
|
-
var CLI_VERSION = true ? "0.
|
|
37211
|
+
var CLI_VERSION = true ? "0.183.0" : "0.1.0";
|
|
37113
37212
|
var CLI_BUNDLED = true;
|
|
37114
37213
|
var commandIo = /* @__PURE__ */ new WeakMap();
|
|
37115
37214
|
var commandClientFactory = /* @__PURE__ */ new WeakMap();
|