@cmdop/sdk 3.8.0 → 3.10.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.
@@ -1,4 +1,4 @@
1
- // Generated from cmdop/crates/tools/tools.schema.json (sha256 74d267a7b8e73b08, cmdop 0.1.23) by exports/sdk/gen/gen.ts. Do not edit.
1
+ // Generated from cmdop/crates/tools/tools.schema.json (sha256 b3559937cabc371b, cmdop 0.1.31) by exports/sdk/gen/gen.ts. Do not edit.
2
2
  /** Every error code, in the order Rust declares them. */
3
3
  export const ERROR_CODES = ["other", "denied", "unknown_tool", "bad_args", "not_found", "busy", "permission_missing", "screen_locked", "stale_capture", "element_gone", "app_not_allowed", "lease_paused", "paused", "offline", "rate_limited", "quota_exceeded", "not_dispatched", "display_gone", "timed_out", "cancelled", "too_large", "hash_required", "failed", "needs_presence", "unauthorized", "tool_refused", "sandbox_unavailable"];
4
4
  /** The size limits every carrier keeps. */
@@ -45,6 +45,25 @@ export type HistorySearchOut = {
45
45
  export type MachinesListArgs = Record<string, never>;
46
46
  /** What `machines_list` returns. */
47
47
  export type MachinesListOut = MachineRow[];
48
+ /** Arguments of `preview_open`. `preview_open`'s argument. */
49
+ export type PreviewOpenArgs = {
50
+ /** The preview's name, as `previews_list` shows it. */
51
+ name: string;
52
+ };
53
+ /** What `preview_open` returns. */
54
+ export type PreviewOpenOut = {
55
+ /** When the link stops opening (unix seconds); absent for a public preview's own address. */
56
+ expires?: number | null;
57
+ /**
58
+ * Open it in your own browser. A private preview's link is one-time: it signs that browser
59
+ * in to this preview as you, works up to 3 times within 10 minutes, and is a secret.
60
+ */
61
+ url: string;
62
+ };
63
+ /** Arguments of `previews_list`. No arguments. */
64
+ export type PreviewsListArgs = Record<string, never>;
65
+ /** What `previews_list` returns. */
66
+ export type PreviewsListOut = PreviewRow[];
48
67
  /** Arguments of `showtime_guide`. */
49
68
  export type ShowtimeGuideArgs = {
50
69
  /** The language to speak to the user in, e.g. "Russian" or "de". Default: the user's. */
@@ -137,6 +156,12 @@ export type MachineRow = {
137
156
  label?: string | null;
138
157
  /** Unix seconds of the last message from the machine. */
139
158
  last_seen: number;
159
+ /**
160
+ * How good its link is, as the machine measured its keepalive round trips (machine presence
161
+ * P6). Left out while it is offline, before its first measurement on this link, when the last
162
+ * one is older than three minutes, and from a program that does not measure (before 0.1.32).
163
+ */
164
+ link?: LinkView | null;
140
165
  /** What to call it: the name its owner gave it on the page, else the machine's own. */
141
166
  name: string;
142
167
  /**
@@ -185,6 +210,29 @@ export type Picture = {
185
210
  others: number;
186
211
  procs: ProcView[];
187
212
  };
213
+ /**
214
+ * One preview with its share links, as the server tool `previews_list` gives it to an agent
215
+ * (http-gate G5g): a link's note, expiry, state and browsers, never its address or code.
216
+ */
217
+ export type PreviewRow = {
218
+ /** Close works now: its machine is online with a program that closes on the owner's word. */
219
+ closable: boolean;
220
+ id: number;
221
+ machine: PreviewMachine;
222
+ name: string;
223
+ /** Unix seconds. */
224
+ opened_at: number;
225
+ port: number;
226
+ /** Its share links, newest first: the live ones and those that ended within a week. */
227
+ shares: ShareView[];
228
+ /** Browsers signed in now (the owner's, guests' through links, agents'). */
229
+ signed_in: number;
230
+ /** Of `signed_in`, the browsers signed in as an agent (http-gate G5j). */
231
+ signed_in_agents: number;
232
+ /** `https://<name>-<address>.<gate zone>`. */
233
+ url: string;
234
+ visibility: Visibility;
235
+ };
188
236
  /** A kept vendor session file, or a run of the agent dock (`dock` set), as history shows it. */
189
237
  export type SessionView = {
190
238
  author: string;
@@ -246,6 +294,22 @@ export type DockRunView = {
246
294
  /** Unix milliseconds. */
247
295
  started: number;
248
296
  };
297
+ /** One measurement of a machine's link, as the server last received it. */
298
+ export type LinkView = {
299
+ /** Unix seconds when the server received it. */
300
+ at: number;
301
+ /**
302
+ * `measuring`, `good`, `fair` or `poor`; the machine worsens it at once and improves it only
303
+ * after it held.
304
+ */
305
+ grade: Grade;
306
+ /** How much the round trip varies, milliseconds. */
307
+ jitter_ms: number;
308
+ /** Share of the machine's last 20 pings that got no answer in time, 0–100. */
309
+ loss_pct: number;
310
+ /** The smoothed round trip from the machine to this server and back, milliseconds. */
311
+ rtt_ms: number;
312
+ };
249
313
  /** The kind of computer a machine runs on. */
250
314
  export type MachineKind = ("laptop" | "desktop") | "container" | "vm" | "server";
251
315
  /**
@@ -255,6 +319,12 @@ export type MachineKind = ("laptop" | "desktop") | "container" | "vm" | "server"
255
319
  * machine looking alive.
256
320
  */
257
321
  export type Presence = "online" | "stale" | "offline" | "paused";
322
+ /** A preview's machine. */
323
+ export type PreviewMachine = {
324
+ id: string;
325
+ name: string;
326
+ online: boolean;
327
+ };
258
328
  /** A process cmdop did not start, with who did. */
259
329
  export type ProcView = {
260
330
  argv: string[];
@@ -265,8 +335,26 @@ export type ProcView = {
265
335
  pid: number;
266
336
  started: number;
267
337
  };
338
+ /** One share link, as listed: never its address, which was shown once. */
339
+ export type ShareView = {
340
+ /** Browsers signed in through it now. */
341
+ browsers: number;
342
+ created_at: number;
343
+ expires_at: number;
344
+ id: number;
345
+ last_used_at?: number | null;
346
+ note: string;
347
+ revoked_at?: number | null;
348
+ state: ShareState;
349
+ };
268
350
  /** Where a task is in its life. The store keeps it as text (`cmdop-store` writes only these five). */
269
351
  export type TaskState = "running" | "starting" | "ended" | "failed" | "lost";
352
+ /** Who may open a preview. */
353
+ export type Visibility = "private" | "public";
354
+ /** The link in one word. `measuring` until the machine has enough round trips to say. */
355
+ export type Grade = ("measuring" | "good" | "fair" | "poor") | "unknown";
356
+ /** Where a share link stands. */
357
+ export type ShareState = "live" | "expired" | "revoked";
270
358
  /** Every tool the server answers itself: its arguments and its result. */
271
359
  export interface ServerToolMap {
272
360
  docs_read: {
@@ -281,6 +369,14 @@ export interface ServerToolMap {
281
369
  args: MachinesListArgs;
282
370
  out: MachinesListOut;
283
371
  };
372
+ preview_open: {
373
+ args: PreviewOpenArgs;
374
+ out: PreviewOpenOut;
375
+ };
376
+ previews_list: {
377
+ args: PreviewsListArgs;
378
+ out: PreviewsListOut;
379
+ };
284
380
  showtime_guide: {
285
381
  args: ShowtimeGuideArgs;
286
382
  out: ShowtimeGuideOut;
@@ -305,6 +401,14 @@ export declare const SERVER_TOOLS: {
305
401
  readonly title: "List machines";
306
402
  readonly description: "The owner's machines: name, id, `state` (online; stale = not answering; paused; offline), `last_seen`, `activity`, `tools` (screen and control are here), build, `behind`. Only online ones take calls.";
307
403
  };
404
+ readonly preview_open: {
405
+ readonly title: "Open a preview in your browser";
406
+ readonly description: "Needs http. A secret 10-minute link to see a preview in your own browser.";
407
+ };
408
+ readonly previews_list: {
409
+ readonly title: "List previews";
410
+ readonly description: "Needs http. Previews: address, port, visibility, share links (never the link).";
411
+ };
308
412
  readonly showtime_guide: {
309
413
  readonly title: "Showtime guide";
310
414
  readonly description: "Call when the user asks to see what CMDOP can do (a demo or a show), or offer it to a user new to CMDOP: returns a guide for a short live demonstration on their machines.";
@@ -314,7 +418,7 @@ export declare const SERVER_TOOLS: {
314
418
  readonly description: "Everything running now, by author. `tasks`: started through cmdop. `outside`: other processes per machine, by agent:claude-code, agent:codex or user. Ended ones: history_search.";
315
419
  };
316
420
  };
317
- export declare const SERVER_TOOL_NAMES: readonly ["docs_read", "history_search", "machines_list", "showtime_guide", "tasks_list"];
421
+ export declare const SERVER_TOOL_NAMES: readonly ["docs_read", "history_search", "machines_list", "preview_open", "previews_list", "showtime_guide", "tasks_list"];
318
422
  /** The server tools as client methods (`cmdop.showtime_guide()`): no machine, never sealed. */
319
423
  export interface ServerMethods<O> {
320
424
  /** Call before answering how CMDOP works, is set up or is priced: no `path` lists every page of docs.cmdop.ai (path and title); a `path` returns that page as Markdown. */
@@ -323,6 +427,10 @@ export interface ServerMethods<O> {
323
427
  history_search(args?: HistorySearchArgs, opts?: O): Promise<HistorySearchOut>;
324
428
  /** The owner's machines: name, id, `state` (online; stale = not answering; paused; offline), `last_seen`, `activity`, `tools` (screen and control are here), build, `behind`. Only online ones take calls. */
325
429
  machines_list(args?: MachinesListArgs, opts?: O): Promise<MachinesListOut>;
430
+ /** Needs http. A secret 10-minute link to see a preview in your own browser. */
431
+ preview_open(args: PreviewOpenArgs, opts?: O): Promise<PreviewOpenOut>;
432
+ /** Needs http. Previews: address, port, visibility, share links (never the link). */
433
+ previews_list(args?: PreviewsListArgs, opts?: O): Promise<PreviewsListOut>;
326
434
  /** Call when the user asks to see what CMDOP can do (a demo or a show), or offer it to a user new to CMDOP: returns a guide for a short live demonstration on their machines. */
327
435
  showtime_guide(args?: ShowtimeGuideArgs, opts?: O): Promise<ShowtimeGuideOut>;
328
436
  /** Everything running now, by author. `tasks`: started through cmdop. `outside`: other processes per machine, by agent:claude-code, agent:codex or user. Ended ones: history_search. */
@@ -1,10 +1,12 @@
1
- // Generated from cmdop/crates/tools/tools.schema.json (sha256 74d267a7b8e73b08, cmdop 0.1.23) by exports/sdk/gen/gen.ts. Do not edit.
1
+ // Generated from cmdop/crates/tools/tools.schema.json (sha256 b3559937cabc371b, cmdop 0.1.31) by exports/sdk/gen/gen.ts. Do not edit.
2
2
  /** Title and description of every server tool, as the server lists them. */
3
3
  export const SERVER_TOOLS = {
4
4
  docs_read: { title: "Read the docs", description: "Call before answering how CMDOP works, is set up or is priced: no `path` lists every page of docs.cmdop.ai (path and title); a `path` returns that page as Markdown." },
5
5
  history_search: { title: "Search history", description: "Past tasks, tool calls and agent sessions by machine, author, task, time and text, newest first. Calls carry no arguments; journal_search on the machine has them." },
6
6
  machines_list: { title: "List machines", description: "The owner's machines: name, id, `state` (online; stale = not answering; paused; offline), `last_seen`, `activity`, `tools` (screen and control are here), build, `behind`. Only online ones take calls." },
7
+ preview_open: { title: "Open a preview in your browser", description: "Needs http. A secret 10-minute link to see a preview in your own browser." },
8
+ previews_list: { title: "List previews", description: "Needs http. Previews: address, port, visibility, share links (never the link)." },
7
9
  showtime_guide: { title: "Showtime guide", description: "Call when the user asks to see what CMDOP can do (a demo or a show), or offer it to a user new to CMDOP: returns a guide for a short live demonstration on their machines." },
8
10
  tasks_list: { title: "List running work", description: "Everything running now, by author. `tasks`: started through cmdop. `outside`: other processes per machine, by agent:claude-code, agent:codex or user. Ended ones: history_search." },
9
11
  };
10
- export const SERVER_TOOL_NAMES = ["docs_read", "history_search", "machines_list", "showtime_guide", "tasks_list"];
12
+ export const SERVER_TOOL_NAMES = ["docs_read", "history_search", "machines_list", "preview_open", "previews_list", "showtime_guide", "tasks_list"];
@@ -1,4 +1,4 @@
1
- // Generated from cmdop/crates/tools/tools.schema.json (sha256 74d267a7b8e73b08, cmdop 0.1.23) by exports/sdk/gen/gen.ts. Do not edit.
1
+ // Generated from cmdop/crates/tools/tools.schema.json (sha256 b3559937cabc371b, cmdop 0.1.31) by exports/sdk/gen/gen.ts. Do not edit.
2
2
  /** Group, then method, then the tool it calls. */
3
3
  export const GROUPS = {
4
4
  agent: { cancel: "agent_cancel", list: "agent_list", prompt: "agent_prompt", sessions: "agent_sessions" },
@@ -161,6 +161,11 @@ export type ExecRunArgs = {
161
161
  * 600). Long work goes to `task_start`.
162
162
  */
163
163
  timeout_secs?: number | null;
164
+ /**
165
+ * Answer after this many seconds even if the command still runs: it then goes on as a task
166
+ * (`running`, `task`), still bounded by `timeout_secs`. Default: wait for its end.
167
+ */
168
+ wait_secs?: number | null;
164
169
  };
165
170
  /** What `exec_run` returns. */
166
171
  export type ExecRunOut = {
@@ -169,6 +174,11 @@ export type ExecRunOut = {
169
174
  duration_ms: number;
170
175
  /** Exit code; absent when the command was ended by a signal. */
171
176
  exit_code?: number | null;
177
+ /**
178
+ * Still running after `wait_secs`: it goes on as `task`; `task_output` reads the rest and,
179
+ * once it has ended, its exit code. Absent when the command has ended.
180
+ */
181
+ running?: boolean;
172
182
  /** The signal that ended it (Unix). */
173
183
  signal?: number | null;
174
184
  /** The end of standard error, at most 64 KiB. */
@@ -185,6 +195,8 @@ export type ExecRunOut = {
185
195
  * readable with `fs_read`.
186
196
  */
187
197
  stdout_file?: string | null;
198
+ /** The task it goes on as, when `running`. */
199
+ task?: number | null;
188
200
  /** Stopped because it ran longer than `timeout_secs`. */
189
201
  timed_out: boolean;
190
202
  /** Output was longer than what is returned; the whole of it is in the files below. */
@@ -848,8 +860,12 @@ export type TaskOutputArgs = {
848
860
  };
849
861
  /** What `task_output` returns. */
850
862
  export type TaskOutputOut = {
863
+ /** Once the task has ended: its exit code, absent when a signal ended it. */
864
+ exit_code?: number | null;
851
865
  /** False once the task has ended. */
852
866
  running: boolean;
867
+ /** Once the task has ended: the signal that ended it (Unix). */
868
+ signal?: number | null;
853
869
  task: number;
854
870
  /** The terminal's screen and recent scrollback as text, terminal codes applied. */
855
871
  text: string;
@@ -1432,7 +1448,7 @@ export declare const TOOLS: {
1432
1448
  readonly risk: "exec";
1433
1449
  readonly added: "0.0.1";
1434
1450
  readonly timeoutSecs: 620;
1435
- readonly description: "Run one command and wait for its exit code, stdout and stderr; a non-zero exit is a result, not an error. At most 600 s; long or interactive work goes to task_start. Output keeps its last 64 KiB.";
1451
+ readonly description: "Run one command and wait for its exit code, stdout and stderr (non-zero is a result, not an error). At most 600 s; past wait_secs it goes on as a task (task_output). Keeps 64 KiB of output.";
1436
1452
  };
1437
1453
  readonly fs_delete: {
1438
1454
  readonly risk: "destructive";
@@ -1,4 +1,4 @@
1
- // Generated from cmdop/crates/tools/tools.schema.json (sha256 74d267a7b8e73b08, cmdop 0.1.23) by exports/sdk/gen/gen.ts. Do not edit.
1
+ // Generated from cmdop/crates/tools/tools.schema.json (sha256 b3559937cabc371b, cmdop 0.1.31) by exports/sdk/gen/gen.ts. Do not edit.
2
2
  /** Risk class, version and description of every tool, as the server lists them. */
3
3
  export const TOOLS = {
4
4
  agent_cancel: { risk: "agent", added: "0.1.13", timeoutSecs: 15, description: "Stops a running agent_prompt by its task. What the agent did until then stays done." },
@@ -9,7 +9,7 @@ export const TOOLS = {
9
9
  control_release: { risk: "control", added: "0.0.2", timeoutSecs: 10, description: "Give control back: release held keys and buttons and end the lease, so the owner can use the machine at once. The lease also ends after 60 s without an input call." },
10
10
  disk_clean: { risk: "destructive", added: "0.1.13", timeoutSecs: 120, description: "Frees what disk_usage counts as cleanable: old caches deleted, old sessions moved to the Trash. Settings and credentials stay. dry_run lists first." },
11
11
  disk_usage: { risk: "read", added: "0.1.13", timeoutSecs: 90, description: "How much disk the AI agents and developer caches use, per folder, and how much a clean would free. Reads sizes and times only; changes nothing." },
12
- exec_run: { risk: "exec", added: "0.0.1", timeoutSecs: 620, description: "Run one command and wait for its exit code, stdout and stderr; a non-zero exit is a result, not an error. At most 600 s; long or interactive work goes to task_start. Output keeps its last 64 KiB." },
12
+ exec_run: { risk: "exec", added: "0.0.1", timeoutSecs: 620, description: "Run one command and wait for its exit code, stdout and stderr (non-zero is a result, not an error). At most 600 s; past wait_secs it goes on as a task (task_output). Keeps 64 KiB of output." },
13
13
  fs_delete: { risk: "destructive", added: "0.0.1", timeoutSecs: 120, description: "Move a file or folder to the user's trash, where the owner can restore it; a non-empty one needs recursive=true. permanent=true cannot be undone. Home, the roots and credential paths are refused." },
14
14
  fs_edit: { risk: "write", added: "0.0.1", timeoutSecs: 60, description: "Replace exact text in a text file (up to 4 MiB), atomically: `old` must occur once, or set replace_all. Otherwise nothing changes and the error says how many times it occurs." },
15
15
  fs_list: { risk: "read", added: "0.0.1", timeoutSecs: 15, description: "List a folder: name, kind, size and change time of each entry, sorted by name. Hidden names only with hidden=true. Paths holding keys and credentials (~/.ssh, ~/.aws and the like) are refused." },
package/dist/version.d.ts CHANGED
@@ -3,4 +3,4 @@
3
3
  * record shows which SDK made a call. The release tool rewrites it together with `package.json`; a test keeps the two
4
4
  * equal.
5
5
  */
6
- export declare const VERSION = "3.8.0";
6
+ export declare const VERSION = "3.10.0";
package/dist/version.js CHANGED
@@ -3,4 +3,4 @@
3
3
  * record shows which SDK made a call. The release tool rewrites it together with `package.json`; a test keeps the two
4
4
  * equal.
5
5
  */
6
- export const VERSION = "3.8.0";
6
+ export const VERSION = "3.10.0";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cmdop/sdk",
3
- "version": "3.8.0",
3
+ "version": "3.10.0",
4
4
  "description": "Your machines' tools from a program: the same tools agents use through MCP, typed from Rust.",
5
5
  "license": "MIT",
6
6
  "homepage": "https://cmdop.ai",