@cmdop/sdk 3.3.0 → 3.5.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 CHANGED
@@ -27,6 +27,11 @@ The tools the server answers itself are methods of the client, with no machine:
27
27
  `cmdop.tasks_list()`, `cmdop.history_search({ text })`, `cmdop.docs_read({ path })` (the docs, contents first) and
28
28
  `cmdop.showtime_guide({ language })`, the guide for a short live demo of what your machines can do.
29
29
 
30
+ A machine also lets you ask the AI agent programs installed on it (Claude Code, Codex), the same way for each:
31
+ `box.agent.list({})` names them, `box.agent.prompt({ prompt, session? })` returns the answer and a `session` to
32
+ continue, `box.agent.sessions({})` and `box.agent.cancel({ task })`. The agents answer in words or read files, never
33
+ run commands; the token needs the `agent` class and the machine's `ceiling.json` its `agents` key.
34
+
30
35
  ## The same tools over MCP
31
36
 
32
37
  CMDOP is an MCP server too: an agent reaches these tools at `$CMDOP_URL/mcp` (streamable HTTP) with an agent token
@@ -6,6 +6,7 @@
6
6
  */
7
7
  import { CarrierError } from "./carrier.js";
8
8
  import { readNdjson } from "./ndjson.js";
9
+ import { VERSION } from "../version.js";
9
10
  function isAnswer(v) {
10
11
  return typeof v === "object" && v !== null && !Array.isArray(v) && ("ok" in v || "error" in v || "sealed" in v);
11
12
  }
@@ -21,6 +22,8 @@ export function httpCarrier(opts) {
21
22
  "content-type": "application/json",
22
23
  // The server takes writes under /api only with this header (a browser form cannot send it).
23
24
  "x-cmdop": "1",
25
+ // Which SDK and version made the call: the server keeps `node` and a semver only, never this text.
26
+ "x-cmdop-client": `node/${VERSION}`,
24
27
  };
25
28
  const fail = (m) => new CarrierError("http", m);
26
29
  async function request(method, path, body, o) {
@@ -1,4 +1,4 @@
1
- export type ErrorCode = "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";
1
+ export type ErrorCode = "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";
2
2
  /**
3
3
  * One piece of a running command's output, as a streaming `exec_run` sends it (the payload of
4
4
  * a `CallChunk`). The machine writes it and every client reads it, so it is defined here once.
@@ -70,7 +70,7 @@ export type ToolError = {
70
70
  message: string;
71
71
  };
72
72
  /** Every error code, in the order Rust declares them. */
73
- export declare const ERROR_CODES: readonly ["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"];
73
+ export declare const ERROR_CODES: readonly ["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"];
74
74
  /** The size limits every carrier keeps. */
75
75
  export declare const LIMITS: {
76
76
  readonly envelopeMaxBytes: 16777216;
@@ -1,5 +1,5 @@
1
- // Generated from cmdop/crates/tools/tools.schema.json (sha256 53ac9daa3bb73c83, cmdop 0.1.11) by exports/sdk/gen/gen.ts. Do not edit.
1
+ // Generated from cmdop/crates/tools/tools.schema.json (sha256 6e1a72817fe1ae37, cmdop 0.1.15) by exports/sdk/gen/gen.ts. Do not edit.
2
2
  /** Every error code, in the order Rust declares them. */
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"];
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. */
5
5
  export const LIMITS = { envelopeMaxBytes: 16777216, pieceMaxBytes: 65536 };
@@ -1,4 +1,4 @@
1
- // Generated from cmdop/crates/tools/tools.schema.json (sha256 53ac9daa3bb73c83, cmdop 0.1.11) by exports/sdk/gen/gen.ts. Do not edit.
1
+ // Generated from cmdop/crates/tools/tools.schema.json (sha256 6e1a72817fe1ae37, cmdop 0.1.15) 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." },
@@ -4,12 +4,22 @@ import type { Screenshot } from "../screen.ts";
4
4
  import type { ToolMap, ToolName } from "./tools.gen.ts";
5
5
  /** Group, then method, then the tool it calls. */
6
6
  export declare const GROUPS: {
7
+ readonly agent: {
8
+ readonly cancel: "agent_cancel";
9
+ readonly list: "agent_list";
10
+ readonly prompt: "agent_prompt";
11
+ readonly sessions: "agent_sessions";
12
+ };
7
13
  readonly app: {
8
14
  readonly open: "app_open";
9
15
  };
10
16
  readonly control: {
11
17
  readonly release: "control_release";
12
18
  };
19
+ readonly disk: {
20
+ readonly clean: "disk_clean";
21
+ readonly usage: "disk_usage";
22
+ };
13
23
  readonly exec: {
14
24
  readonly run: "exec_run";
15
25
  };
@@ -1,8 +1,10 @@
1
- // Generated from cmdop/crates/tools/tools.schema.json (sha256 53ac9daa3bb73c83, cmdop 0.1.11) by exports/sdk/gen/gen.ts. Do not edit.
1
+ // Generated from cmdop/crates/tools/tools.schema.json (sha256 6e1a72817fe1ae37, cmdop 0.1.15) 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
+ agent: { cancel: "agent_cancel", list: "agent_list", prompt: "agent_prompt", sessions: "agent_sessions" },
4
5
  app: { open: "app_open" },
5
6
  control: { release: "control_release" },
7
+ disk: { clean: "disk_clean", usage: "disk_usage" },
6
8
  exec: { run: "exec_run" },
7
9
  fs: { delete: "fs_delete", edit: "fs_edit", list: "fs_list", read: "fs_read", search: "fs_search", stat: "fs_stat", write: "fs_write" },
8
10
  journal: { search: "journal_search" },
@@ -1,3 +1,71 @@
1
+ /** Arguments of `agent_cancel`. */
2
+ export type AgentCancelArgs = {
3
+ /** The `task` of an `agent_prompt` answer. */
4
+ task: number;
5
+ };
6
+ /** What `agent_cancel` returns. */
7
+ export type AgentCancelOut = {
8
+ /** The run was asked to stop; `task_output` shows when it has. */
9
+ stopping: boolean;
10
+ task: number;
11
+ };
12
+ /** Arguments of `agent_list`. No arguments. */
13
+ export type AgentListArgs = Record<string, never>;
14
+ /** What `agent_list` returns. */
15
+ export type AgentListOut = {
16
+ /** The agents this machine's owner lets be prompted, in catalog order. */
17
+ agents: AgentRow[];
18
+ /** The agent a prompt without `agent` goes to; absent when none is installed. */
19
+ default?: string | null;
20
+ };
21
+ /** Arguments of `agent_prompt`. */
22
+ export type AgentPromptArgs = {
23
+ /** Catalog id from `agent_list`. Absent: the machine's default agent. */
24
+ agent?: string | null;
25
+ /**
26
+ * Folder the agent works in. Absent: the agent's own folder on the machine, the same for
27
+ * every prompt, so a `session` continues there.
28
+ */
29
+ cwd?: string | null;
30
+ /** What to ask, at most 16 KiB. The agent reads it as an instruction. */
31
+ prompt: string;
32
+ /** A `session` from an earlier answer, to continue that conversation. */
33
+ session?: string | null;
34
+ /** Ask for less than the machine allows; never more. */
35
+ tier?: Tier | null;
36
+ /**
37
+ * Seconds to wait for the answer (default 50, at most 240). A run still going then keeps
38
+ * going: follow it with `task_output` on `task`.
39
+ */
40
+ wait_secs?: number | null;
41
+ };
42
+ /** What `agent_prompt` returns. */
43
+ export type AgentPromptOut = {
44
+ /** The agent that answered. */
45
+ agent: string;
46
+ /** Why there is no answer, when `state` is `failed`. */
47
+ error?: string | null;
48
+ /** Pass it back as `session` to continue. */
49
+ session?: string | null;
50
+ state: RunState;
51
+ /** The run's task: `task_output` reads it, `agent_cancel` stops it. */
52
+ task: number;
53
+ /** The agent's final answer. */
54
+ text?: string | null;
55
+ /** The tier the run had. */
56
+ tier: Tier;
57
+ };
58
+ /** Arguments of `agent_sessions`. */
59
+ export type AgentSessionsArgs = {
60
+ /** Catalog id. Absent: every agent `agent_list` shows. */
61
+ agent?: string | null;
62
+ /** At most this many, newest first (default 20, at most 200). */
63
+ limit?: number | null;
64
+ };
65
+ /** What `agent_sessions` returns. */
66
+ export type AgentSessionsOut = {
67
+ sessions: AgentSession[];
68
+ };
1
69
  /** Arguments of `app_open`. */
2
70
  export type AppOpenArgs = {
3
71
  /** App name or bundle id. Must be allowed for `control`. */
@@ -26,6 +94,50 @@ export type ControlReleaseOut = {
26
94
  /** A lease was held and is given back. */
27
95
  released: boolean;
28
96
  };
97
+ /** Arguments of `disk_clean`. */
98
+ export type DiskCleanArgs = {
99
+ /** Say what would be removed and remove nothing. */
100
+ dry_run?: boolean;
101
+ /**
102
+ * Remove only files unchanged for at least this many days. It can only raise an item's own
103
+ * age.
104
+ */
105
+ older_than_days?: number | null;
106
+ /** As in `disk_usage`: `agent:<id>` or `cache:<id>`. Absent: every one known. */
107
+ targets?: string[] | null;
108
+ };
109
+ /** What `disk_clean` returns. */
110
+ export type DiskCleanOut = {
111
+ dry_run: boolean;
112
+ /** Bytes removed, or that would be on a dry run. */
113
+ freed_bytes: number;
114
+ targets: DiskCleaned[];
115
+ /** The walk stopped at its limit: run it again to go further. */
116
+ truncated: boolean;
117
+ };
118
+ /** Arguments of `disk_usage`. */
119
+ export type DiskUsageArgs = {
120
+ /**
121
+ * Count only files unchanged for at least this many days. It can only raise an item's own
122
+ * age.
123
+ */
124
+ older_than_days?: number | null;
125
+ /**
126
+ * `agent:<id>` for one agent's own files (`agent:claude-code`), `cache:<id>` for a developer
127
+ * cache no agent owns (`cache:cargo`, `cache:npm`, `cache:pnpm`). Absent: every one known.
128
+ */
129
+ targets?: string[] | null;
130
+ };
131
+ /** What `disk_usage` returns. */
132
+ export type DiskUsageOut = {
133
+ /** Bytes on disk of every item measured. */
134
+ bytes: number;
135
+ /** Of those, what a clean would free. */
136
+ cleanable_bytes: number;
137
+ targets: DiskTarget[];
138
+ /** The walk stopped at its limit of files or time: the numbers are a lower bound. */
139
+ truncated: boolean;
140
+ };
29
141
  /** Arguments of `exec_run`. */
30
142
  export type ExecRunArgs = {
31
143
  /** Program and arguments, run directly without a shell. Give this or `command`. */
@@ -651,12 +763,57 @@ export type WindowListOut = {
651
763
  truncated: boolean;
652
764
  windows: WindowInfo[];
653
765
  };
766
+ export type AgentRow = {
767
+ /** A run of it is going on; another prompt answers `busy` until it ends. */
768
+ busy: boolean;
769
+ /** Catalog id: pass it as `agent`. */
770
+ id: string;
771
+ /** Its program is installed on this machine. */
772
+ installed: boolean;
773
+ /** The product name. */
774
+ name: string;
775
+ protocol: Protocol;
776
+ /** A run can be continued by passing back its `session`. */
777
+ resume: boolean;
778
+ /** The most a prompt to it may do here. */
779
+ tier: Tier;
780
+ };
781
+ export type AgentSession = {
782
+ agent: string;
783
+ /** The folder it ran in, when known. */
784
+ cwd?: string | null;
785
+ /** Pass it as `session` to `agent_prompt`. */
786
+ session: string;
787
+ /** Last activity, unix seconds. */
788
+ updated: number;
789
+ };
654
790
  export type Button = "left" | "right" | "middle";
655
791
  export type Disk = {
656
792
  available: number;
657
793
  mount: string;
658
794
  total: number;
659
795
  };
796
+ export type DiskCleaned = {
797
+ /** Files removed: caches deleted, sessions moved to the Trash. */
798
+ files: number;
799
+ freed_bytes: number;
800
+ /** Why the whole target was left, when it was: its program is running. */
801
+ left?: string | null;
802
+ /** Files left because they changed since the count, or could not be removed. */
803
+ skipped: number;
804
+ /** `agent:<id>` or `cache:<id>`. */
805
+ target: string;
806
+ };
807
+ export type DiskTarget = {
808
+ bytes: number;
809
+ cleanable_bytes: number;
810
+ /** The items found on this machine; one that does not exist is left out. */
811
+ items: DiskItem[];
812
+ /** The agent's or the tool's name. */
813
+ label: string;
814
+ /** `agent:<id>` or `cache:<id>`. */
815
+ target: string;
816
+ };
660
817
  export type DisplayInfo = {
661
818
  height: number;
662
819
  id: number;
@@ -742,6 +899,8 @@ export type Region = {
742
899
  x: number;
743
900
  y: number;
744
901
  };
902
+ /** How a run stands when `agent_prompt` returns. */
903
+ export type RunState = "running" | "done" | "failed" | "stopped" | "paused";
745
904
  export type SearchMatch = {
746
905
  kind: EntryKind;
747
906
  /** With `content`: the first matching line's number, from 1. */
@@ -752,6 +911,15 @@ export type SearchMatch = {
752
911
  /** With `content`: that line, cut to 300 characters. */
753
912
  text?: string | null;
754
913
  };
914
+ /**
915
+ * How far a prompted agent may act on the machine, lowest first. The ceiling's `agents.tier` is
916
+ * the most; a call may ask for less.
917
+ *
918
+ * There is no tier that writes or runs commands (owner, 2026-11-25: "No, text only"): a shell
919
+ * can read the agent's own sign-in, and a written file in a project (`.claude/settings.json`,
920
+ * `.git/hooks`, `.mcp.json`) runs code in the owner's next session of their own.
921
+ */
922
+ export type Tier = "text_only" | "read_only";
755
923
  export type TypeMethod = "auto" | "keys" | "paste";
756
924
  export type UiAction = ("focus" | "toggle" | "expand" | "collapse") | "invoke" | "set_value" | "select_text";
757
925
  export type WaitFor = ("element_gone" | "text_gone") | "element_appears" | "text_appears" | "window_appears" | "screen_stable";
@@ -770,8 +938,41 @@ export type WindowInfo = {
770
938
  x: number;
771
939
  y: number;
772
940
  };
941
+ export type DiskItem = {
942
+ /** Bytes on disk (blocks, a hard-linked file once). */
943
+ bytes: number;
944
+ class: DiskClass;
945
+ /**
946
+ * What a clean would free: old enough, not among the newest kept, not protected; 0
947
+ * for `user-data` and `secret`. Links are not followed and other volumes are not entered.
948
+ */
949
+ cleanable_bytes: number;
950
+ cleanable_files: number;
951
+ files: number;
952
+ path: string;
953
+ };
954
+ /** How the machine talks to an agent program (the manifest's `bridge.protocol`). */
955
+ export type Protocol = "headless_json" | "acp" | "pty_only";
956
+ /** What removing an item costs. */
957
+ export type DiskClass = "cache" | "regenerable" | "feature" | "user-data" | "secret";
773
958
  /** Every machine tool: its arguments and its result. */
774
959
  export interface ToolMap {
960
+ agent_cancel: {
961
+ args: AgentCancelArgs;
962
+ out: AgentCancelOut;
963
+ };
964
+ agent_list: {
965
+ args: AgentListArgs;
966
+ out: AgentListOut;
967
+ };
968
+ agent_prompt: {
969
+ args: AgentPromptArgs;
970
+ out: AgentPromptOut;
971
+ };
972
+ agent_sessions: {
973
+ args: AgentSessionsArgs;
974
+ out: AgentSessionsOut;
975
+ };
775
976
  app_open: {
776
977
  args: AppOpenArgs;
777
978
  out: AppOpenOut;
@@ -780,6 +981,14 @@ export interface ToolMap {
780
981
  args: ControlReleaseArgs;
781
982
  out: ControlReleaseOut;
782
983
  };
984
+ disk_clean: {
985
+ args: DiskCleanArgs;
986
+ out: DiskCleanOut;
987
+ };
988
+ disk_usage: {
989
+ args: DiskUsageArgs;
990
+ out: DiskUsageOut;
991
+ };
783
992
  exec_run: {
784
993
  args: ExecRunArgs;
785
994
  out: ExecRunOut;
@@ -892,6 +1101,30 @@ export interface ToolMap {
892
1101
  export type ToolName = keyof ToolMap;
893
1102
  /** Risk class, version and description of every tool, as the server lists them. */
894
1103
  export declare const TOOLS: {
1104
+ readonly agent_cancel: {
1105
+ readonly risk: "agent";
1106
+ readonly added: "0.1.13";
1107
+ readonly timeoutSecs: 15;
1108
+ readonly description: "Stops a running agent_prompt by its task. What the agent did until then stays done.";
1109
+ };
1110
+ readonly agent_list: {
1111
+ readonly risk: "read";
1112
+ readonly added: "0.1.13";
1113
+ readonly timeoutSecs: 30;
1114
+ readonly description: "The AI agent programs (Claude Code, Codex) installed on the machine that may be prompted, each with its id, how far it may act, and whether it is busy.";
1115
+ };
1116
+ readonly agent_prompt: {
1117
+ readonly risk: "agent";
1118
+ readonly added: "0.1.13";
1119
+ readonly timeoutSecs: 260;
1120
+ readonly description: "Sends a prompt to an AI agent program on the machine and returns its answer and a session id to continue. Long runs return a task to follow.";
1121
+ };
1122
+ readonly agent_sessions: {
1123
+ readonly risk: "read";
1124
+ readonly added: "0.1.13";
1125
+ readonly timeoutSecs: 30;
1126
+ readonly description: "Recent sessions of the AI agent programs on the machine, newest first, with the id agent_prompt takes to continue one.";
1127
+ };
895
1128
  readonly app_open: {
896
1129
  readonly risk: "control";
897
1130
  readonly added: "0.0.2";
@@ -904,6 +1137,18 @@ export declare const TOOLS: {
904
1137
  readonly timeoutSecs: 10;
905
1138
  readonly 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.";
906
1139
  };
1140
+ readonly disk_clean: {
1141
+ readonly risk: "destructive";
1142
+ readonly added: "0.1.13";
1143
+ readonly timeoutSecs: 120;
1144
+ readonly 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.";
1145
+ };
1146
+ readonly disk_usage: {
1147
+ readonly risk: "read";
1148
+ readonly added: "0.1.13";
1149
+ readonly timeoutSecs: 90;
1150
+ readonly 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.";
1151
+ };
907
1152
  readonly exec_run: {
908
1153
  readonly risk: "exec";
909
1154
  readonly added: "0.0.1";
@@ -1067,4 +1312,4 @@ export declare const TOOLS: {
1067
1312
  readonly description: "Windows of the apps on screen, front to back: id, app, title, bounds in screen points, focus, whether visible, and whether `control` is allowed for the app.";
1068
1313
  };
1069
1314
  };
1070
- export declare const TOOL_NAMES: readonly ["app_open", "control_release", "exec_run", "fs_delete", "fs_edit", "fs_list", "fs_read", "fs_search", "fs_stat", "fs_write", "journal_search", "key_press", "pointer_click", "pointer_drag", "pointer_move", "pointer_scroll", "proc_kill", "proc_list", "screen_capture", "screen_info", "sys_info", "task_output", "task_start", "task_stop", "text_type", "ui_act", "ui_snapshot", "ui_wait", "window_list"];
1315
+ export declare const TOOL_NAMES: readonly ["agent_cancel", "agent_list", "agent_prompt", "agent_sessions", "app_open", "control_release", "disk_clean", "disk_usage", "exec_run", "fs_delete", "fs_edit", "fs_list", "fs_read", "fs_search", "fs_stat", "fs_write", "journal_search", "key_press", "pointer_click", "pointer_drag", "pointer_move", "pointer_scroll", "proc_kill", "proc_list", "screen_capture", "screen_info", "sys_info", "task_output", "task_start", "task_stop", "text_type", "ui_act", "ui_snapshot", "ui_wait", "window_list"];
@@ -1,8 +1,14 @@
1
- // Generated from cmdop/crates/tools/tools.schema.json (sha256 53ac9daa3bb73c83, cmdop 0.1.11) by exports/sdk/gen/gen.ts. Do not edit.
1
+ // Generated from cmdop/crates/tools/tools.schema.json (sha256 6e1a72817fe1ae37, cmdop 0.1.15) 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
+ 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." },
5
+ agent_list: { risk: "read", added: "0.1.13", timeoutSecs: 30, description: "The AI agent programs (Claude Code, Codex) installed on the machine that may be prompted, each with its id, how far it may act, and whether it is busy." },
6
+ agent_prompt: { risk: "agent", added: "0.1.13", timeoutSecs: 260, description: "Sends a prompt to an AI agent program on the machine and returns its answer and a session id to continue. Long runs return a task to follow." },
7
+ agent_sessions: { risk: "read", added: "0.1.13", timeoutSecs: 30, description: "Recent sessions of the AI agent programs on the machine, newest first, with the id agent_prompt takes to continue one." },
4
8
  app_open: { risk: "control", added: "0.0.2", timeoutSecs: 30, description: "Launch or focus an app, or open a file in it. The app has to be allowed for `control` on this machine. Opens in the background unless `background` is false." },
5
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
+ 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
+ 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." },
6
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." },
7
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." },
8
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." },
@@ -31,4 +37,4 @@ export const TOOLS = {
31
37
  ui_wait: { risk: "screen", added: "0.0.2", timeoutSecs: 35, description: "Wait until an element, text or window appears or is gone, or the screen is stable, for at most 30 s. A timeout is an answer (`met: false`), not an error." },
32
38
  window_list: { risk: "screen", added: "0.0.2", timeoutSecs: 10, description: "Windows of the apps on screen, front to back: id, app, title, bounds in screen points, focus, whether visible, and whether `control` is allowed for the app." },
33
39
  };
34
- export const TOOL_NAMES = ["app_open", "control_release", "exec_run", "fs_delete", "fs_edit", "fs_list", "fs_read", "fs_search", "fs_stat", "fs_write", "journal_search", "key_press", "pointer_click", "pointer_drag", "pointer_move", "pointer_scroll", "proc_kill", "proc_list", "screen_capture", "screen_info", "sys_info", "task_output", "task_start", "task_stop", "text_type", "ui_act", "ui_snapshot", "ui_wait", "window_list"];
40
+ export const TOOL_NAMES = ["agent_cancel", "agent_list", "agent_prompt", "agent_sessions", "app_open", "control_release", "disk_clean", "disk_usage", "exec_run", "fs_delete", "fs_edit", "fs_list", "fs_read", "fs_search", "fs_stat", "fs_write", "journal_search", "key_press", "pointer_click", "pointer_drag", "pointer_move", "pointer_scroll", "proc_kill", "proc_list", "screen_capture", "screen_info", "sys_info", "task_output", "task_start", "task_stop", "text_type", "ui_act", "ui_snapshot", "ui_wait", "window_list"];
@@ -0,0 +1,6 @@
1
+ /**
2
+ * This package's version. The SDK names itself to the server as `x-cmdop-client: node/<version>`, and the call
3
+ * record shows which SDK made a call. The release tool rewrites it together with `package.json`; a test keeps the two
4
+ * equal.
5
+ */
6
+ export declare const VERSION = "3.4.0";
@@ -0,0 +1,6 @@
1
+ /**
2
+ * This package's version. The SDK names itself to the server as `x-cmdop-client: node/<version>`, and the call
3
+ * record shows which SDK made a call. The release tool rewrites it together with `package.json`; a test keeps the two
4
+ * equal.
5
+ */
6
+ export const VERSION = "3.4.0";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cmdop/sdk",
3
- "version": "3.3.0",
3
+ "version": "3.5.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",