@isaacthoman/pulpo 0.181.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/README.md +20 -0
- package/dist/index.js +445 -5
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -16,6 +16,26 @@ pulpo model test acme-model "Reply with a short greeting" --no-agent --preset re
|
|
|
16
16
|
|
|
17
17
|
Use `pulpo help` or `pulpo <command> --help` for the complete command reference.
|
|
18
18
|
|
|
19
|
+
### Instance color themes
|
|
20
|
+
|
|
21
|
+
Admins can publish palettes from **Admin → Settings → Color themes** or through
|
|
22
|
+
the settings CLI. Published themes appear in the web and desktop appearance
|
|
23
|
+
picker for everyone on the instance.
|
|
24
|
+
|
|
25
|
+
```bash
|
|
26
|
+
pulpo --json settings get instance.colorThemes
|
|
27
|
+
pulpo settings set instance.colorThemes '[{"id":"lagoon","name":"Lagoon","light":{"colors":{"button.background":"#0e7490"}},"dark":{"colors":{"button.background":"#22d3ee"}}}]'
|
|
28
|
+
pulpo settings set account.colorTheme instance:lagoon
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
Setting `instance.colorThemes` replaces the catalog. To edit a larger catalog,
|
|
32
|
+
export the settings document, update its `instance.colorThemes` array, and use
|
|
33
|
+
`pulpo settings diff --file pulpo-settings.json` and
|
|
34
|
+
`pulpo settings apply --file pulpo-settings.json`. Set the catalog to `[]` to
|
|
35
|
+
remove all shared themes. Each theme can include VS Code workbench colors and
|
|
36
|
+
TextMate token rules for light and dark appearances. Custom CSS is available in
|
|
37
|
+
personal themes.
|
|
38
|
+
|
|
19
39
|
Rebuild a restorable archive from an encrypted offsite snapshot with
|
|
20
40
|
`pulpo backup assemble`. It runs entirely on your machine, using the age identity
|
|
21
41
|
that Pulpo never sees, and needs no Pulpo context:
|
package/dist/index.js
CHANGED
|
@@ -22288,6 +22288,315 @@ var imageGenerationInputSchema = external_exports.object({
|
|
|
22288
22288
|
filename: external_exports.string().trim().min(1).max(255).optional()
|
|
22289
22289
|
}).strict();
|
|
22290
22290
|
|
|
22291
|
+
// ../../packages/contracts/dist/computer.js
|
|
22292
|
+
var COMPUTER_ACCESS_MODES = ["full", "read", "suggest", "write"];
|
|
22293
|
+
var computerAccessSchema = external_exports.enum(COMPUTER_ACCESS_MODES);
|
|
22294
|
+
var COMPUTER_PATH_MAX_LENGTH = 4096;
|
|
22295
|
+
var computerSelectionSchema = external_exports.object({
|
|
22296
|
+
sessionId: external_exports.uuid(),
|
|
22297
|
+
access: computerAccessSchema,
|
|
22298
|
+
/** Absolute path of the chosen folder. Null only with full access, which then starts in the default folder. */
|
|
22299
|
+
folder: external_exports.string().min(1).max(COMPUTER_PATH_MAX_LENGTH).nullable()
|
|
22300
|
+
}).refine((value) => value.access === "full" || value.folder !== null, {
|
|
22301
|
+
message: "Choose a folder to use this access mode",
|
|
22302
|
+
path: ["folder"]
|
|
22303
|
+
});
|
|
22304
|
+
var computerDescriptionSchema = external_exports.object({
|
|
22305
|
+
os: external_exports.enum(["macos", "windows", "linux"]),
|
|
22306
|
+
/** Readable, with the system's name: `macOS 15.2`, `Windows 11 (10.0.26100)`, `Linux 6.8.0`. */
|
|
22307
|
+
osVersion: external_exports.string().max(100),
|
|
22308
|
+
arch: external_exports.string().max(40),
|
|
22309
|
+
/** The shell that runs commands, e.g. `zsh`, `bash`, `pwsh`, `powershell`. */
|
|
22310
|
+
shell: external_exports.string().max(40),
|
|
22311
|
+
home: external_exports.string().max(COMPUTER_PATH_MAX_LENGTH),
|
|
22312
|
+
/** Where commands start: the chosen folder, or the default one. */
|
|
22313
|
+
cwd: external_exports.string().max(COMPUTER_PATH_MAX_LENGTH),
|
|
22314
|
+
/** Where files the user sent in the chat are saved for the agent. */
|
|
22315
|
+
attachmentsDir: external_exports.string().max(COMPUTER_PATH_MAX_LENGTH),
|
|
22316
|
+
/**
|
|
22317
|
+
* Where `pulpo files` keeps its copies of the user's Files on this computer (what
|
|
22318
|
+
* `/workspace/files` is in a cloud workspace). Absent when the app cannot run `pulpo files`
|
|
22319
|
+
* for the agent's commands, and then Files are not offered in a full-access reply.
|
|
22320
|
+
*/
|
|
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()
|
|
22330
|
+
});
|
|
22331
|
+
var COMPUTER_TRANSFER_PATH = "/api/computer/transfers/";
|
|
22332
|
+
var computerTransferSchema = external_exports.object({
|
|
22333
|
+
url: external_exports.string().max(2048).refine((url2) => url2.startsWith(COMPUTER_TRANSFER_PATH) && !url2.includes(".."), "Invalid transfer URL")
|
|
22334
|
+
});
|
|
22335
|
+
var COMPUTER_INLINE_MAX_BYTES = 256 * 1024;
|
|
22336
|
+
var inlineData = external_exports.string().max(Math.ceil(COMPUTER_INLINE_MAX_BYTES / 3) * 4 + 4);
|
|
22337
|
+
var incomingBytes = { data: inlineData.optional(), transfer: computerTransferSchema.optional() };
|
|
22338
|
+
var oneSource = (value) => value.data === void 0 !== (value.transfer === void 0);
|
|
22339
|
+
var oneSourceMessage = "Send the bytes inline or through a transfer, not both";
|
|
22340
|
+
var COMPUTER_OPERATION_TYPES = ["bash", "read", "write", "edit", "list", "find", "grep"];
|
|
22341
|
+
var computerRelayRequestSchema = external_exports.object({
|
|
22342
|
+
id: external_exports.string().min(1).max(200),
|
|
22343
|
+
command: external_exports.string().max(200),
|
|
22344
|
+
args: external_exports.unknown()
|
|
22345
|
+
});
|
|
22346
|
+
var computerRelayResultSchema = external_exports.discriminatedUnion("ok", [
|
|
22347
|
+
external_exports.object({ ok: external_exports.literal(true), output: external_exports.string(), data: external_exports.unknown().optional() }),
|
|
22348
|
+
external_exports.object({ ok: external_exports.literal(false), error: external_exports.string() })
|
|
22349
|
+
]);
|
|
22350
|
+
var computerOperationSchema = external_exports.object({
|
|
22351
|
+
id: external_exports.string().min(1).max(200),
|
|
22352
|
+
status: external_exports.enum(["running", "completed", "failed", "cancelled"]),
|
|
22353
|
+
output: external_exports.string(),
|
|
22354
|
+
exitCode: external_exports.number().int().nullable(),
|
|
22355
|
+
error: external_exports.string().optional(),
|
|
22356
|
+
details: external_exports.record(external_exports.string(), external_exports.unknown()).optional(),
|
|
22357
|
+
/** Relay requests waiting for an answer. Present (version 1) on apps that relay `pulpo files`; a long-poll returns at once when one arrives. */
|
|
22358
|
+
relay: external_exports.object({ version: external_exports.number().int(), pending: external_exports.array(computerRelayRequestSchema).max(100) }).optional()
|
|
22359
|
+
});
|
|
22360
|
+
var computerFolderPathSchema = external_exports.string().max(COMPUTER_PATH_MAX_LENGTH);
|
|
22361
|
+
var computerFolderEntrySchema = external_exports.object({
|
|
22362
|
+
path: computerFolderPathSchema,
|
|
22363
|
+
kind: external_exports.enum(["file", "folder"]),
|
|
22364
|
+
sizeBytes: external_exports.number().int().nonnegative(),
|
|
22365
|
+
modifiedAt: external_exports.string()
|
|
22366
|
+
});
|
|
22367
|
+
var computerFolderChangeSchema = external_exports.discriminatedUnion("kind", [
|
|
22368
|
+
external_exports.object({
|
|
22369
|
+
kind: external_exports.literal("put"),
|
|
22370
|
+
path: computerFolderPathSchema.min(1),
|
|
22371
|
+
...incomingBytes,
|
|
22372
|
+
sizeBytes: external_exports.number().int().nonnegative(),
|
|
22373
|
+
/** The version the agent pulled, or null when it believes the file is new. */
|
|
22374
|
+
base: external_exports.string().max(200).nullable(),
|
|
22375
|
+
force: external_exports.boolean().optional()
|
|
22376
|
+
}).refine(oneSource, oneSourceMessage),
|
|
22377
|
+
external_exports.object({ kind: external_exports.literal("mkdir"), path: computerFolderPathSchema.min(1), parents: external_exports.boolean().optional() }),
|
|
22378
|
+
external_exports.object({ kind: external_exports.literal("move"), from: computerFolderPathSchema.min(1), to: computerFolderPathSchema.min(1) }),
|
|
22379
|
+
external_exports.object({ kind: external_exports.literal("remove"), path: computerFolderPathSchema.min(1), recursive: external_exports.boolean().optional() })
|
|
22380
|
+
]);
|
|
22381
|
+
var computerFolderChangeResultSchema = external_exports.object({
|
|
22382
|
+
status: external_exports.enum(["created", "updated", "suggested", "unchanged", "conflict", "denied", "error"]),
|
|
22383
|
+
/** For the agent; empty when the status says it all. */
|
|
22384
|
+
message: external_exports.string(),
|
|
22385
|
+
/** The file's version after the change, or the one it now has on a conflict. */
|
|
22386
|
+
version: external_exports.string().optional()
|
|
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
|
+
});
|
|
22465
|
+
var operationId = external_exports.string().min(1).max(200);
|
|
22466
|
+
var absolutePath = external_exports.string().min(1).max(COMPUTER_PATH_MAX_LENGTH);
|
|
22467
|
+
var computerMethods = {
|
|
22468
|
+
describe: { params: external_exports.object({}), result: computerDescriptionSchema },
|
|
22469
|
+
// Full access only.
|
|
22470
|
+
"operation.start": {
|
|
22471
|
+
params: external_exports.object({ id: operationId, type: external_exports.enum(COMPUTER_OPERATION_TYPES), args: external_exports.record(external_exports.string(), external_exports.unknown()) }),
|
|
22472
|
+
result: computerOperationSchema
|
|
22473
|
+
},
|
|
22474
|
+
/** Returns early when the operation stops or prints something new; otherwise after `waitMs`. */
|
|
22475
|
+
"operation.get": { params: external_exports.object({ id: operationId, waitMs: external_exports.number().int().min(0).max(25e3).optional() }), result: computerOperationSchema },
|
|
22476
|
+
"operation.cancel": { params: external_exports.object({ id: operationId }), result: computerOperationSchema },
|
|
22477
|
+
/** Answers one pending relay request of a running operation. `delivered` is false when the command no longer waits for it. */
|
|
22478
|
+
"operation.relay": {
|
|
22479
|
+
params: external_exports.object({ requestId: external_exports.string().min(1).max(200), result: computerRelayResultSchema }),
|
|
22480
|
+
result: external_exports.object({ delivered: external_exports.boolean() })
|
|
22481
|
+
},
|
|
22482
|
+
/** Sends a file on the computer to the server (attach_file, view_image): inline when it is small, else through the transfer. */
|
|
22483
|
+
"file.send": {
|
|
22484
|
+
params: external_exports.object({ path: absolutePath, transfer: computerTransferSchema, maxBytes: external_exports.number().int().positive() }),
|
|
22485
|
+
result: external_exports.object({ sizeBytes: external_exports.number().int().nonnegative(), data: inlineData.optional() })
|
|
22486
|
+
},
|
|
22487
|
+
/** Saves a file from the server on the computer (chat attachments, generated images). */
|
|
22488
|
+
"file.receive": {
|
|
22489
|
+
params: external_exports.object({
|
|
22490
|
+
path: absolutePath,
|
|
22491
|
+
...incomingBytes,
|
|
22492
|
+
sizeBytes: external_exports.number().int().nonnegative(),
|
|
22493
|
+
/** Hex SHA-256 of the bytes, when known; the desktop app rejects a mismatch. */
|
|
22494
|
+
sha256: external_exports.string().regex(/^[a-f0-9]{64}$/).optional()
|
|
22495
|
+
}).refine(oneSource, oneSourceMessage),
|
|
22496
|
+
result: external_exports.object({ path: external_exports.string() })
|
|
22497
|
+
},
|
|
22498
|
+
/** Which of these files are absent or differ, so only those are sent. */
|
|
22499
|
+
"file.missing": {
|
|
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) }),
|
|
22501
|
+
result: external_exports.object({ missing: external_exports.array(external_exports.string()) })
|
|
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
|
+
},
|
|
22517
|
+
// Folder modes only. Paths are relative to the session's folder.
|
|
22518
|
+
/** Entries below `path`, depth-first in name order, `depth` levels deep (1: direct children). */
|
|
22519
|
+
"folder.list": {
|
|
22520
|
+
params: external_exports.object({
|
|
22521
|
+
path: computerFolderPathSchema,
|
|
22522
|
+
depth: external_exports.number().int().min(1).max(64),
|
|
22523
|
+
limit: external_exports.number().int().min(1).max(1e4),
|
|
22524
|
+
/** Leave out folders (pull planning). */
|
|
22525
|
+
filesOnly: external_exports.boolean().optional()
|
|
22526
|
+
}),
|
|
22527
|
+
result: external_exports.object({
|
|
22528
|
+
/** When `path` is a file, just that file. */
|
|
22529
|
+
entries: external_exports.array(computerFolderEntrySchema),
|
|
22530
|
+
truncated: external_exports.boolean(),
|
|
22531
|
+
/** Folders left out by name (`.git`, `node_modules`), relative to the session's folder. */
|
|
22532
|
+
skipped: external_exports.array(external_exports.string()).optional()
|
|
22533
|
+
})
|
|
22534
|
+
},
|
|
22535
|
+
/** A UTF-8 text file's contents. Fails for anything else. */
|
|
22536
|
+
"folder.read": {
|
|
22537
|
+
params: external_exports.object({ path: computerFolderPathSchema.min(1), maxBytes: external_exports.number().int().positive() }),
|
|
22538
|
+
result: external_exports.object({ text: external_exports.string(), sizeBytes: external_exports.number().int().nonnegative(), truncated: external_exports.boolean() })
|
|
22539
|
+
},
|
|
22540
|
+
"folder.search": {
|
|
22541
|
+
params: external_exports.object({
|
|
22542
|
+
pattern: external_exports.string().min(1).max(1e3),
|
|
22543
|
+
path: computerFolderPathSchema,
|
|
22544
|
+
ignoreCase: external_exports.boolean().optional(),
|
|
22545
|
+
/** Match the pattern as plain text, not a regular expression. */
|
|
22546
|
+
fixed: external_exports.boolean().optional(),
|
|
22547
|
+
limit: external_exports.number().int().min(1).max(5e3)
|
|
22548
|
+
}),
|
|
22549
|
+
result: external_exports.object({
|
|
22550
|
+
matches: external_exports.array(external_exports.object({ path: computerFolderPathSchema, line: external_exports.number().int().positive(), text: external_exports.string() })),
|
|
22551
|
+
truncated: external_exports.boolean()
|
|
22552
|
+
})
|
|
22553
|
+
},
|
|
22554
|
+
/**
|
|
22555
|
+
* Sends one file in the folder to the server (pull): inline when it is small, else through the
|
|
22556
|
+
* transfer. `version` identifies these exact bytes; a later `put` names it as its `base`.
|
|
22557
|
+
*/
|
|
22558
|
+
"folder.send": {
|
|
22559
|
+
params: external_exports.object({ path: computerFolderPathSchema.min(1), transfer: computerTransferSchema, maxBytes: external_exports.number().int().positive() }),
|
|
22560
|
+
result: external_exports.object({ sizeBytes: external_exports.number().int().nonnegative(), version: external_exports.string().max(200), data: inlineData.optional() })
|
|
22561
|
+
},
|
|
22562
|
+
/** Applies a change, or stages it as a suggestion, by the session's mode. `responseId` groups a reply's changes. */
|
|
22563
|
+
"folder.change": {
|
|
22564
|
+
params: external_exports.object({ change: computerFolderChangeSchema, responseId: external_exports.uuid() }),
|
|
22565
|
+
result: computerFolderChangeResultSchema
|
|
22566
|
+
}
|
|
22567
|
+
};
|
|
22568
|
+
var COMPUTER_METHODS = Object.keys(computerMethods);
|
|
22569
|
+
var COMPUTER_ERROR_CODES = [
|
|
22570
|
+
/** The app does not know the session: it was restarted, or the message came from elsewhere. */
|
|
22571
|
+
"unknown_session",
|
|
22572
|
+
/** The session's access mode does not allow the method. */
|
|
22573
|
+
"not_allowed",
|
|
22574
|
+
/** A path left the session's folder. */
|
|
22575
|
+
"outside_folder",
|
|
22576
|
+
"not_found",
|
|
22577
|
+
/** Not UTF-8 text, where text was needed. */
|
|
22578
|
+
"not_text",
|
|
22579
|
+
"too_large",
|
|
22580
|
+
"invalid_request",
|
|
22581
|
+
"failed"
|
|
22582
|
+
];
|
|
22583
|
+
var computerRequestSchema = external_exports.object({
|
|
22584
|
+
id: external_exports.uuid(),
|
|
22585
|
+
sessionId: external_exports.uuid(),
|
|
22586
|
+
method: external_exports.enum(COMPUTER_METHODS),
|
|
22587
|
+
params: external_exports.unknown(),
|
|
22588
|
+
/** How long the server waits for the answer. */
|
|
22589
|
+
timeoutMs: external_exports.number().int().positive()
|
|
22590
|
+
});
|
|
22591
|
+
var computerResponseSchema = external_exports.discriminatedUnion("ok", [
|
|
22592
|
+
external_exports.object({ id: external_exports.uuid(), sessionId: external_exports.uuid(), ok: external_exports.literal(true), result: external_exports.unknown() }),
|
|
22593
|
+
external_exports.object({ id: external_exports.uuid(), sessionId: external_exports.uuid(), ok: external_exports.literal(false), code: external_exports.enum(COMPUTER_ERROR_CODES), message: external_exports.string().max(4e3) })
|
|
22594
|
+
]);
|
|
22595
|
+
var computerHostSchema = external_exports.object({ sessionIds: external_exports.array(external_exports.uuid()).max(200) });
|
|
22596
|
+
var COMPUTER_PULL_MAX_FILE_BYTES = 1e3 * 1024 * 1024;
|
|
22597
|
+
var COMPUTER_PULL_MAX_BYTES = 500 * 1024 * 1024;
|
|
22598
|
+
var COMPUTER_PUSH_MAX_FILE_BYTES = 25 * 1024 * 1024;
|
|
22599
|
+
|
|
22291
22600
|
// ../../packages/contracts/dist/speech.js
|
|
22292
22601
|
var SPEECH_REQUEST_MAX_INPUT_LENGTH = 16384;
|
|
22293
22602
|
var SPEECH_MAX_INSTRUCTIONS_LENGTH = 4096;
|
|
@@ -22400,6 +22709,120 @@ var VOXTRAL_SPEECH_PRESET = {
|
|
|
22400
22709
|
outputPriceMicros: 0
|
|
22401
22710
|
};
|
|
22402
22711
|
|
|
22712
|
+
// ../../packages/contracts/dist/color-themes.js
|
|
22713
|
+
var THEME_COLOR_KEYS = [
|
|
22714
|
+
"editor.background",
|
|
22715
|
+
"editorWidget.background",
|
|
22716
|
+
"button.secondaryBackground",
|
|
22717
|
+
"list.hoverBackground",
|
|
22718
|
+
"foreground",
|
|
22719
|
+
"descriptionForeground",
|
|
22720
|
+
"panel.border",
|
|
22721
|
+
"input.border",
|
|
22722
|
+
"button.background",
|
|
22723
|
+
"button.foreground",
|
|
22724
|
+
"focusBorder",
|
|
22725
|
+
"chat.requestBackground",
|
|
22726
|
+
"textCodeBlock.background",
|
|
22727
|
+
"sideBar.background",
|
|
22728
|
+
"list.activeSelectionBackground",
|
|
22729
|
+
"sideBar.border",
|
|
22730
|
+
"errorForeground",
|
|
22731
|
+
"diffEditor.insertedTextBackground",
|
|
22732
|
+
"diffEditor.removedTextBackground",
|
|
22733
|
+
"pulpo.temporaryChatBackground",
|
|
22734
|
+
"pulpo.temporaryChatSurface",
|
|
22735
|
+
"pulpo.temporaryChatBorder",
|
|
22736
|
+
"pulpo.temporaryChatForeground",
|
|
22737
|
+
"pulpo.temporaryChatToggleForeground",
|
|
22738
|
+
"pulpo.expiringChatForeground",
|
|
22739
|
+
"pulpo.planForeground"
|
|
22740
|
+
];
|
|
22741
|
+
var THEME_NAME_MAX_LENGTH = 60;
|
|
22742
|
+
var THEME_CSS_MAX_LENGTH = 16e3;
|
|
22743
|
+
var THEME_TOKEN_RULES_MAX = 40;
|
|
22744
|
+
var CUSTOM_THEMES_MAX = 20;
|
|
22745
|
+
var DEFAULT_COLOR_THEME_ID = "pulpo";
|
|
22746
|
+
var themeIdSchema = external_exports.string().regex(/^[a-z0-9][a-z0-9-]{0,63}$/);
|
|
22747
|
+
var themeColorValueSchema = external_exports.string().regex(/^#([0-9a-fA-F]{6}|[0-9a-fA-F]{8})$/).transform((value) => value.toLowerCase());
|
|
22748
|
+
var themeColorKeySchema = external_exports.enum(THEME_COLOR_KEYS);
|
|
22749
|
+
var themeColorsSchema = external_exports.preprocess((value) => value && typeof value === "object" && !Array.isArray(value) ? Object.fromEntries(Object.entries(value).filter(([key]) => themeColorKeySchema.safeParse(key).success)) : value, external_exports.partialRecord(themeColorKeySchema, themeColorValueSchema));
|
|
22750
|
+
var scopeSchema = external_exports.string().trim().min(1).max(200);
|
|
22751
|
+
var themeTokenRuleSchema = external_exports.object({
|
|
22752
|
+
name: external_exports.string().max(100).optional(),
|
|
22753
|
+
scope: external_exports.union([scopeSchema, external_exports.array(scopeSchema).min(1).max(30)]),
|
|
22754
|
+
settings: external_exports.object({
|
|
22755
|
+
foreground: themeColorValueSchema.optional(),
|
|
22756
|
+
fontStyle: external_exports.string().max(40).optional()
|
|
22757
|
+
})
|
|
22758
|
+
});
|
|
22759
|
+
var themeVariantSchema = external_exports.object({
|
|
22760
|
+
colors: themeColorsSchema.default({}),
|
|
22761
|
+
tokenColors: external_exports.array(themeTokenRuleSchema).max(THEME_TOKEN_RULES_MAX).default([])
|
|
22762
|
+
});
|
|
22763
|
+
function decodeCss(css) {
|
|
22764
|
+
return css.replace(/\r\n|[\r\f]/g, "\n").replaceAll("\0", "\uFFFD").replace(/\\(?:([0-9a-fA-F]{1,6})[ \t\n]?|([^\n]))/g, (_, code, char) => {
|
|
22765
|
+
if (char !== void 0)
|
|
22766
|
+
return char;
|
|
22767
|
+
const point = parseInt(code, 16);
|
|
22768
|
+
return point > 0 && point <= 1114111 && (point < 55296 || point > 57343) ? String.fromCodePoint(point) : "\uFFFD";
|
|
22769
|
+
});
|
|
22770
|
+
}
|
|
22771
|
+
function unsafeCssRule(source) {
|
|
22772
|
+
if (/@import\b/.test(source))
|
|
22773
|
+
return "Theme CSS cannot use @import.";
|
|
22774
|
+
if (/(^|[^\w-])(-webkit-)?image-set\s*\(|(^|[^\w-])(image|src)\s*\(/.test(source)) {
|
|
22775
|
+
return "Theme CSS cannot use image(), image-set(), or src().";
|
|
22776
|
+
}
|
|
22777
|
+
for (const match of source.matchAll(/url\s*\(/g)) {
|
|
22778
|
+
const target = source.slice(match.index + match[0].length).replace(/^\s*['"]?\s*/, "");
|
|
22779
|
+
if (!target.startsWith("data:") && !target.startsWith("#")) {
|
|
22780
|
+
return "Theme CSS can only use url() with data: or #id targets.";
|
|
22781
|
+
}
|
|
22782
|
+
}
|
|
22783
|
+
return null;
|
|
22784
|
+
}
|
|
22785
|
+
function unsafeThemeCssReason(css) {
|
|
22786
|
+
const source = decodeCss(css).toLowerCase();
|
|
22787
|
+
return unsafeCssRule(source) ?? unsafeCssRule(source.replace(/[\s\\]/g, ""));
|
|
22788
|
+
}
|
|
22789
|
+
var themeCssSchema = external_exports.string().max(THEME_CSS_MAX_LENGTH).default("").superRefine((css, context) => {
|
|
22790
|
+
const reason = unsafeThemeCssReason(css);
|
|
22791
|
+
if (reason)
|
|
22792
|
+
context.addIssue({ code: "custom", message: reason });
|
|
22793
|
+
});
|
|
22794
|
+
var customThemeSchema = external_exports.object({
|
|
22795
|
+
id: themeIdSchema,
|
|
22796
|
+
name: external_exports.string().trim().min(1).max(THEME_NAME_MAX_LENGTH),
|
|
22797
|
+
light: themeVariantSchema.default(() => ({ colors: {}, tokenColors: [] })),
|
|
22798
|
+
dark: themeVariantSchema.default(() => ({ colors: {}, tokenColors: [] })),
|
|
22799
|
+
css: themeCssSchema
|
|
22800
|
+
});
|
|
22801
|
+
function uniqueThemeIds(themes, context) {
|
|
22802
|
+
const seen = /* @__PURE__ */ new Set();
|
|
22803
|
+
themes.forEach((theme, index) => {
|
|
22804
|
+
if (seen.has(theme.id))
|
|
22805
|
+
context.addIssue({ code: "custom", message: "Theme ids must be unique", path: [index, "id"] });
|
|
22806
|
+
seen.add(theme.id);
|
|
22807
|
+
});
|
|
22808
|
+
}
|
|
22809
|
+
var customThemesSchema = external_exports.array(customThemeSchema).max(CUSTOM_THEMES_MAX).superRefine(uniqueThemeIds);
|
|
22810
|
+
var instanceColorThemeSchema = customThemeSchema.extend({
|
|
22811
|
+
css: external_exports.literal("", { error: "Instance themes cannot include custom CSS." }).default("")
|
|
22812
|
+
});
|
|
22813
|
+
var instanceColorThemesSchema = external_exports.array(instanceColorThemeSchema).max(CUSTOM_THEMES_MAX).superRefine(uniqueThemeIds);
|
|
22814
|
+
var instanceColorThemesSnapshotSchema = external_exports.object({
|
|
22815
|
+
themes: instanceColorThemesSchema,
|
|
22816
|
+
revision: external_exports.string().min(1)
|
|
22817
|
+
});
|
|
22818
|
+
var colorThemeIdSchema = external_exports.string().regex(/^(?:instance:)?[a-z0-9][a-z0-9-]{0,63}$/);
|
|
22819
|
+
var pulpoThemeExtensionSchema = external_exports.object({
|
|
22820
|
+
version: external_exports.literal(1),
|
|
22821
|
+
light: themeVariantSchema.optional(),
|
|
22822
|
+
dark: themeVariantSchema.optional(),
|
|
22823
|
+
css: themeCssSchema.optional()
|
|
22824
|
+
});
|
|
22825
|
+
|
|
22403
22826
|
// ../../packages/contracts/dist/response-timing.js
|
|
22404
22827
|
function record2(value) {
|
|
22405
22828
|
return value !== null && typeof value === "object" ? value : void 0;
|
|
@@ -22445,8 +22868,8 @@ var PROFILE_AVATAR_MAX_BYTES = 5 * 1024 * 1024;
|
|
|
22445
22868
|
|
|
22446
22869
|
// ../../packages/contracts/dist/admin-analytics.js
|
|
22447
22870
|
var clientPlatformSchema = external_exports.enum(["web", "desktop", "ios", "android", "cli", "api", "unknown"]);
|
|
22448
|
-
var
|
|
22449
|
-
var CLIENT_FEATURES_HEADER_VALUE =
|
|
22871
|
+
var COMMON_CLIENT_FEATURES = ["files-permission"];
|
|
22872
|
+
var CLIENT_FEATURES_HEADER_VALUE = COMMON_CLIENT_FEATURES.join(",");
|
|
22450
22873
|
var analyticsRangeSchema = external_exports.enum(["1h", "24h", "7d", "30d", "90d", "all", "custom"]);
|
|
22451
22874
|
var analyticsBucketSchema = external_exports.enum(["hour", "day"]);
|
|
22452
22875
|
function validTimeZone(value) {
|
|
@@ -25315,6 +25738,9 @@ function applyAgentEventOutput(output2, event) {
|
|
|
25315
25738
|
if (event.type === "pulpo.agent.files.changed") {
|
|
25316
25739
|
return upsertOutputItem(output2, (item) => item.type === "pulpo_file_changes", payload);
|
|
25317
25740
|
}
|
|
25741
|
+
if (event.type === "pulpo.agent.computer.changed") {
|
|
25742
|
+
return upsertOutputItem(output2, (item) => item.type === "pulpo_computer_changes", payload);
|
|
25743
|
+
}
|
|
25318
25744
|
if (event.type === "pulpo.agent.attachment.created" && typeof payload.attachment_id === "string") {
|
|
25319
25745
|
return upsertOutputItem(output2, (item) => item.type === "pulpo_attachment" && item.attachment_id === payload.attachment_id, payload);
|
|
25320
25746
|
}
|
|
@@ -25665,6 +26091,8 @@ var agentSettingsSchema = external_exports.object({
|
|
|
25665
26091
|
commandTimeoutSeconds: external_exports.number().int().min(1).max(3600).default(600),
|
|
25666
26092
|
maxToolOutputBytes: external_exports.number().int().min(1024).max(1e7).default(1e5),
|
|
25667
26093
|
billWorkspaces: external_exports.boolean().default(false),
|
|
26094
|
+
/** Lets desktop apps lend the agent the computer they run on ("This computer"). */
|
|
26095
|
+
computerAccess: external_exports.boolean().default(true),
|
|
25668
26096
|
workspacePricePerMinuteMicros: external_exports.number().int().min(0).max(1e9).default(1e4)
|
|
25669
26097
|
});
|
|
25670
26098
|
var episodicMemoryProfileSchema = external_exports.enum(["embeddinggemma", "qwen3-embedding"]);
|
|
@@ -25982,6 +26410,9 @@ var managementAccountSettingsSchema = external_exports.object({
|
|
|
25982
26410
|
imageGeneration: imageGenerationPreferencesSchema,
|
|
25983
26411
|
speech: speechPreferencesSchema,
|
|
25984
26412
|
theme: external_exports.enum(["light", "dark", "system"]).default("system"),
|
|
26413
|
+
/** The selected color theme: a built-in theme id or one of `customThemes`. */
|
|
26414
|
+
colorTheme: colorThemeIdSchema.default(DEFAULT_COLOR_THEME_ID),
|
|
26415
|
+
customThemes: customThemesSchema.default([]),
|
|
25985
26416
|
language: external_exports.string().min(1).max(32).default("en-US"),
|
|
25986
26417
|
composerSyncEnabled: external_exports.boolean().default(true),
|
|
25987
26418
|
sendWithEnter: external_exports.boolean().default(true),
|
|
@@ -26040,6 +26471,7 @@ var managementWebToolsSettingsSchema = webToolsSettingsSchema.extend({
|
|
|
26040
26471
|
]).optional()
|
|
26041
26472
|
});
|
|
26042
26473
|
var managementInstanceSettingsSchema = external_exports.object({
|
|
26474
|
+
colorThemes: instanceColorThemesSchema.optional(),
|
|
26043
26475
|
auth: authSettingsSchema.default(() => authSettingsSchema.parse({})),
|
|
26044
26476
|
interface: interfaceSettingsSchema.default(() => interfaceSettingsSchema.parse({})),
|
|
26045
26477
|
personalization: personalizationSettingsSchema.default(() => personalizationSettingsSchema.parse({})),
|
|
@@ -26282,6 +26714,8 @@ var createChatResponseSchema = external_exports.object({
|
|
|
26282
26714
|
presetSelections: external_exports.record(external_exports.string(), external_exports.string()).default({}),
|
|
26283
26715
|
attachmentIds: attachmentIdListSchema.default([]),
|
|
26284
26716
|
agentMode: external_exports.boolean().default(false),
|
|
26717
|
+
/** The sender's computer, when the desktop app lends it to the agent for this message. */
|
|
26718
|
+
computer: computerSelectionSchema.optional(),
|
|
26285
26719
|
/** Analytics only: whether dictation produced any of the message text. */
|
|
26286
26720
|
usedDictation: external_exports.boolean().optional()
|
|
26287
26721
|
}).refine((value) => value.input.length > 0 || value.attachmentIds.length > 0, {
|
|
@@ -26295,7 +26729,8 @@ var editMessageSchema = external_exports.object({
|
|
|
26295
26729
|
modelId: external_exports.string().trim().min(1).optional(),
|
|
26296
26730
|
presetSelections: external_exports.record(external_exports.string(), external_exports.string()).optional(),
|
|
26297
26731
|
attachmentIds: attachmentIdListSchema.optional(),
|
|
26298
|
-
agentMode: external_exports.boolean().optional()
|
|
26732
|
+
agentMode: external_exports.boolean().optional(),
|
|
26733
|
+
computer: computerSelectionSchema.optional()
|
|
26299
26734
|
});
|
|
26300
26735
|
var queuedMessageStatusSchema = external_exports.enum(["pending", "editing", "dispatching", "failed"]);
|
|
26301
26736
|
var queuedMessageAttachmentSchema = external_exports.object({
|
|
@@ -26311,6 +26746,8 @@ var queuedMessageSchema = external_exports.object({
|
|
|
26311
26746
|
modelId: external_exports.string(),
|
|
26312
26747
|
presetSelections: external_exports.record(external_exports.string(), external_exports.string()),
|
|
26313
26748
|
agentMode: external_exports.boolean(),
|
|
26749
|
+
/** Absent from servers that predate it. */
|
|
26750
|
+
computer: computerSelectionSchema.nullable().optional(),
|
|
26314
26751
|
position: external_exports.number().int().nonnegative(),
|
|
26315
26752
|
status: queuedMessageStatusSchema,
|
|
26316
26753
|
error: external_exports.string().nullable(),
|
|
@@ -26326,6 +26763,8 @@ var createQueuedMessageSchema = external_exports.object({
|
|
|
26326
26763
|
presetSelections: external_exports.record(external_exports.string(), external_exports.string()).default({}),
|
|
26327
26764
|
attachmentIds: attachmentIdListSchema.default([]),
|
|
26328
26765
|
agentMode: external_exports.boolean().default(false),
|
|
26766
|
+
/** The sender's computer, when the desktop app lends it to the agent for this message. */
|
|
26767
|
+
computer: computerSelectionSchema.optional(),
|
|
26329
26768
|
/** Analytics only: whether dictation produced any of the message text. */
|
|
26330
26769
|
usedDictation: external_exports.boolean().optional()
|
|
26331
26770
|
}).refine((value) => value.input.length > 0 || value.attachmentIds.length > 0, {
|
|
@@ -26342,7 +26781,8 @@ var updateQueuedMessageSchema = external_exports.discriminatedUnion("action", [
|
|
|
26342
26781
|
modelId: external_exports.string().min(1),
|
|
26343
26782
|
presetSelections: external_exports.record(external_exports.string(), external_exports.string()).default({}),
|
|
26344
26783
|
attachmentIds: attachmentIdListSchema.default([]),
|
|
26345
|
-
agentMode: external_exports.boolean().default(false)
|
|
26784
|
+
agentMode: external_exports.boolean().default(false),
|
|
26785
|
+
computer: computerSelectionSchema.optional()
|
|
26346
26786
|
}).refine((value) => value.input.length > 0 || value.attachmentIds.length > 0, {
|
|
26347
26787
|
message: "Message must include text or attachments",
|
|
26348
26788
|
path: ["input"]
|
|
@@ -36768,7 +37208,7 @@ async function runModelTest(input2) {
|
|
|
36768
37208
|
}
|
|
36769
37209
|
|
|
36770
37210
|
// src/index.ts
|
|
36771
|
-
var CLI_VERSION = true ? "0.
|
|
37211
|
+
var CLI_VERSION = true ? "0.183.0" : "0.1.0";
|
|
36772
37212
|
var CLI_BUNDLED = true;
|
|
36773
37213
|
var commandIo = /* @__PURE__ */ new WeakMap();
|
|
36774
37214
|
var commandClientFactory = /* @__PURE__ */ new WeakMap();
|