@isaacthoman/pulpo 0.182.0 → 0.184.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 (2) hide show
  1. package/dist/index.js +166 -4
  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": {
@@ -24915,6 +25014,57 @@ var shelfMutationSchema = external_exports.object({
24915
25014
  ])
24916
25015
  });
24917
25016
 
25017
+ // ../../packages/contracts/dist/workspace-screen.js
25018
+ var WORKSPACE_SCREEN_WIDTH = 1280;
25019
+ var WORKSPACE_SCREEN_HEIGHT = 800;
25020
+ var WORKSPACE_SCREEN_FRAME_WAIT_MAX_MS = 1e4;
25021
+ var WORKSPACE_SCREEN_INPUT_MAX_EVENTS = 64;
25022
+ var WORKSPACE_SCREEN_INPUT_MAX_TEXT = 2e3;
25023
+ var workspaceScreenStatusSchema = external_exports.object({
25024
+ /**
25025
+ * `ready`: the chat has a running workspace with a screen. `none`: no workspace is running for
25026
+ * the chat (none was started yet, or it was deleted after sitting idle). `unavailable`: this
25027
+ * instance has the screen turned off, or its workspace image has none.
25028
+ */
25029
+ state: external_exports.enum(["ready", "none", "unavailable"]),
25030
+ width: external_exports.number().int().positive(),
25031
+ height: external_exports.number().int().positive(),
25032
+ /** A viewer holds control right now, in this tab or another. */
25033
+ controlled: external_exports.boolean()
25034
+ });
25035
+ var workspaceScreenFrameQuerySchema = external_exports.object({
25036
+ /** The frame the viewer already shows; the answer waits until the picture differs from it. */
25037
+ after: external_exports.string().regex(/^[a-f0-9]{8,64}$/).optional(),
25038
+ waitMs: external_exports.coerce.number().int().min(0).max(WORKSPACE_SCREEN_FRAME_WAIT_MAX_MS).optional()
25039
+ });
25040
+ var workspaceScreenControlSchema = external_exports.object({
25041
+ /** True takes control or renews it; false gives it back. */
25042
+ held: external_exports.boolean()
25043
+ });
25044
+ var screenX = external_exports.number().finite().min(0).max(WORKSPACE_SCREEN_WIDTH);
25045
+ var screenY = external_exports.number().finite().min(0).max(WORKSPACE_SCREEN_HEIGHT);
25046
+ var screenButton = external_exports.enum(["left", "middle", "right"]).default("left");
25047
+ var workspaceScreenInputEventSchema = external_exports.discriminatedUnion("type", [
25048
+ external_exports.object({ type: external_exports.literal("move"), x: screenX, y: screenY }),
25049
+ external_exports.object({ type: external_exports.literal("down"), x: screenX, y: screenY, button: screenButton }),
25050
+ external_exports.object({ type: external_exports.literal("up"), x: screenX, y: screenY, button: screenButton }),
25051
+ /** A whole click at once, for viewers that only know taps. */
25052
+ external_exports.object({ type: external_exports.literal("click"), x: screenX, y: screenY, button: screenButton, count: external_exports.union([external_exports.literal(1), external_exports.literal(2), external_exports.literal(3)]).default(1) }),
25053
+ /** Wheel notches at a point; positive `dy` moves down the page, positive `dx` to the right. */
25054
+ external_exports.object({
25055
+ type: external_exports.literal("scroll"),
25056
+ x: screenX,
25057
+ y: screenY,
25058
+ dx: external_exports.number().int().min(-20).max(20).default(0),
25059
+ dy: external_exports.number().int().min(-20).max(20).default(0)
25060
+ }).refine((value) => value.dx !== 0 || value.dy !== 0, "Scroll by at least one notch"),
25061
+ external_exports.object({ type: external_exports.literal("text"), text: external_exports.string().min(1).max(WORKSPACE_SCREEN_INPUT_MAX_TEXT) }),
25062
+ external_exports.object({ type: external_exports.literal("key"), keys: external_exports.string().min(1).max(100) })
25063
+ ]);
25064
+ var workspaceScreenInputSchema = external_exports.object({
25065
+ events: external_exports.array(workspaceScreenInputEventSchema).min(1).max(WORKSPACE_SCREEN_INPUT_MAX_EVENTS)
25066
+ });
25067
+
24918
25068
  // ../../packages/contracts/dist/message-reports.js
24919
25069
  var MESSAGE_REPORT_CONTEXT_MAX_LENGTH = 2e3;
24920
25070
  var messageReportInputSchema = external_exports.object({
@@ -25994,6 +26144,12 @@ var agentSettingsSchema = external_exports.object({
25994
26144
  billWorkspaces: external_exports.boolean().default(false),
25995
26145
  /** Lets desktop apps lend the agent the computer they run on ("This computer"). */
25996
26146
  computerAccess: external_exports.boolean().default(true),
26147
+ /**
26148
+ * Gives cloud workspaces a screen: the agent can open a browser and other apps there and work in
26149
+ * their windows with the app tools, and the chat's owner can watch and take over. Needs a
26150
+ * workspace image that includes the desktop; with an older image the tools fail and say so.
26151
+ */
26152
+ workspaceDesktop: external_exports.boolean().default(false),
25997
26153
  workspacePricePerMinuteMicros: external_exports.number().int().min(0).max(1e9).default(1e4)
25998
26154
  });
25999
26155
  var episodicMemoryProfileSchema = external_exports.enum(["embeddinggemma", "qwen3-embedding"]);
@@ -37109,7 +37265,7 @@ async function runModelTest(input2) {
37109
37265
  }
37110
37266
 
37111
37267
  // src/index.ts
37112
- var CLI_VERSION = true ? "0.182.0" : "0.1.0";
37268
+ var CLI_VERSION = true ? "0.184.0" : "0.1.0";
37113
37269
  var CLI_BUNDLED = true;
37114
37270
  var commandIo = /* @__PURE__ */ new WeakMap();
37115
37271
  var commandClientFactory = /* @__PURE__ */ new WeakMap();
@@ -37143,6 +37299,12 @@ var COMMAND_CAPABILITIES = {
37143
37299
  backup: "backups",
37144
37300
  job: "operations"
37145
37301
  };
37302
+ function parseModelCallCursor(cursor) {
37303
+ const [startedAt, id] = cursor.split("|", 2);
37304
+ if (Number.isNaN(Date.parse(startedAt ?? "")) || id !== void 0 && !external_exports.uuid().safeParse(id).success) {
37305
+ throw new Error("--cursor must be the nextCursor from the previous page");
37306
+ }
37307
+ }
37146
37308
  function globalOptions(command) {
37147
37309
  return command.optsWithGlobals();
37148
37310
  }
@@ -37752,9 +37914,9 @@ function createProgram(io = processIo, dependencies = {}) {
37752
37914
  const { client } = await clientFor(command);
37753
37915
  emit(io, command, await client.request("/api/management/v1/usage/summary"));
37754
37916
  });
37755
- usage.command("requests").description("List model calls with request-log IDs and a pagination cursor").addOption(new Option("--range <range>", "time range").choices(["24h", "7d", "30d", "90d", "all"]).default("24h")).option("--limit <count>", "page size (1-100)", "50").option("--cursor <timestamp>", "nextCursor from the previous page").option("--status <statuses>", "comma-separated model-call statuses").option("--origin <origin>", "call source").option("--model <id>", "catalog or upstream model ID").option("--identity <id>", "user or API key ID").action(async (options2, command) => {
37917
+ usage.command("requests").description("List model calls with request-log IDs and a pagination cursor").addOption(new Option("--range <range>", "time range").choices(["24h", "7d", "30d", "90d", "all"]).default("24h")).option("--limit <count>", "page size (1-100)", "50").option("--cursor <cursor>", "nextCursor from the previous page").option("--status <statuses>", "comma-separated model-call statuses").option("--origin <origin>", "call source").option("--model <id>", "catalog or upstream model ID").option("--identity <id>", "user or API key ID").action(async (options2, command) => {
37756
37918
  const limit = external_exports.coerce.number().int().min(1).max(100).parse(options2.limit);
37757
- if (options2.cursor) external_exports.iso.datetime({ offset: true }).parse(options2.cursor);
37919
+ if (options2.cursor) parseModelCallCursor(options2.cursor);
37758
37920
  const query = new URLSearchParams({ range: options2.range, limit: String(limit) });
37759
37921
  for (const key of ["cursor", "status", "origin", "model", "identity"]) {
37760
37922
  if (options2[key]) query.set(key, options2[key]);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@isaacthoman/pulpo",
3
- "version": "0.182.0",
3
+ "version": "0.184.0",
4
4
  "description": "Operator-first command-line client for Pulpo",
5
5
  "type": "module",
6
6
  "bin": {