@parcha/agentrun-client 0.1.0-beta.34 → 0.1.0-beta.36

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
@@ -2,7 +2,7 @@
2
2
 
3
3
  A typed TypeScript client for an AgentRun server you host yourself, the open platform's server: one method per operation of
4
4
  its API, typed from the OpenAPI document it serves, plus waiting for a run and following its timeline. No dependencies: it
5
- uses `fetch`, on Node.js 22.19 or newer.
5
+ uses `fetch`, on Node.js 24.22.3 or newer.
6
6
 
7
7
  ## Install
8
8
 
@@ -17,6 +17,10 @@ export type DefinitionInput = {
17
17
  workflow?: JsonObject;
18
18
  max_cost_usd?: number;
19
19
  model?: string;
20
+ model_tiers?: {
21
+ fast?: string;
22
+ strong?: string;
23
+ };
20
24
  thinking?: "low" | "medium" | "high" | "xhigh" | "max";
21
25
  harness?: "pi" | "claude-agent" | "codex" | "opencode";
22
26
  place?: {
@@ -28,10 +32,12 @@ export type DefinitionInput = {
28
32
  computer?: {
29
33
  kind: "none" | "sandbox" | "desktop" | "phone" | "browser";
30
34
  provider?: string;
35
+ image?: string;
31
36
  gpu?: {
32
37
  type: string;
33
38
  count: number;
34
39
  };
40
+ persistent?: boolean;
35
41
  };
36
42
  tool_settings?: {
37
43
  read?: {
@@ -62,6 +68,9 @@ export type DefinitionInput = {
62
68
  provider?: "auto" | "browserbase" | "kernel" | "chrome";
63
69
  permission?: "allow" | "deny";
64
70
  };
71
+ subagent?: {
72
+ permission?: "allow" | "deny";
73
+ };
65
74
  pdf_pages?: {
66
75
  permission?: "allow" | "deny";
67
76
  };
@@ -77,7 +86,9 @@ export type DefinitionInput = {
77
86
  [key: string]: unknown;
78
87
  };
79
88
  approvals?: "ask" | "never";
80
- learning?: boolean;
89
+ learning?: true | false | "notes";
90
+ checkout?: "pull_request" | "none";
91
+ max_tool_calls?: number;
81
92
  cap_mode?: "expected" | "strict";
82
93
  };
83
94
  export type Id = string;
@@ -123,6 +134,16 @@ export type Agent = {
123
134
  learning?: {
124
135
  pending: number;
125
136
  };
137
+ own_computer?: {
138
+ provider: string;
139
+ id: string;
140
+ name: string;
141
+ state: "held" | "detached" | "deleting";
142
+ since: string;
143
+ image?: string;
144
+ run_id?: string;
145
+ why?: string;
146
+ } | null;
126
147
  warnings?: Array<InputIssue>;
127
148
  };
128
149
  export type Definition = DefinitionInput;
@@ -346,7 +367,13 @@ export type RunCreateInline = {
346
367
  effort?: Effort;
347
368
  max_cost_usd?: number;
348
369
  quote_id?: string;
370
+ mcp_auth?: Record<string, {
371
+ headers: Record<string, string>;
372
+ }>;
349
373
  cap_mode?: "expected" | "strict";
374
+ archil_disk?: {
375
+ disk_id: string;
376
+ };
350
377
  };
351
378
  export type ExternalRef = {
352
379
  source: string;
@@ -498,6 +525,9 @@ export type RunFile = {
498
525
  };
499
526
  export type MessageCreate = {
500
527
  content: string;
528
+ mcp_auth?: Record<string, {
529
+ headers: Record<string, string>;
530
+ }>;
501
531
  };
502
532
  export type MessageResult = {
503
533
  run_id: Id;
@@ -513,7 +543,13 @@ export type RunCreate = {
513
543
  effort?: Effort;
514
544
  max_cost_usd?: number;
515
545
  quote_id?: string;
546
+ mcp_auth?: Record<string, {
547
+ headers: Record<string, string>;
548
+ }>;
516
549
  cap_mode?: "expected" | "strict";
550
+ archil_disk?: {
551
+ disk_id: string;
552
+ };
517
553
  };
518
554
  export type StopResult = {
519
555
  run_id: Id;
@@ -564,6 +600,14 @@ export type TimelineRow = {
564
600
  owner: boolean;
565
601
  name?: string;
566
602
  };
603
+ learned_nodes?: Array<{
604
+ label: string;
605
+ kind: string;
606
+ status: string;
607
+ duration_ms: number;
608
+ model?: string;
609
+ tier?: string;
610
+ }>;
567
611
  learning?: {
568
612
  state: "seeded" | "reflecting" | "proposed" | "merged" | "dropped";
569
613
  reason: "seed_failed" | "no_budget" | "unknown_cost" | "cancelled" | "crashed" | "reflect_timeout" | "reflect_failed" | "empty" | "unparsed" | "propose_failed" | "checker" | "grader" | "grade_failed" | null;
@@ -611,7 +655,7 @@ export type Capabilities = {
611
655
  boxes: Array<{
612
656
  id: "bwrap" | "docker" | "modal" | "daytona";
613
657
  available: boolean;
614
- state: "ready" | "preparing" | "unavailable";
658
+ state: "ready" | "unavailable";
615
659
  reason?: string;
616
660
  network?: "allowlist" | "none";
617
661
  network_reason?: string;
@@ -770,7 +814,7 @@ export type Features = {
770
814
  };
771
815
  mcp_client?: {
772
816
  transports: Array<"streamable-http">;
773
- auth: Array<"none" | "bearer" | "headers" | "oauth" | "github_app">;
817
+ auth: Array<"none" | "bearer" | "headers" | "oauth" | "github_app" | "per_run">;
774
818
  at_rest: "sealed";
775
819
  harnesses: Array<string>;
776
820
  };
@@ -854,6 +898,16 @@ export interface CreateAgentParams {
854
898
  "Idempotency-Key"?: string;
855
899
  }
856
900
  export type CreateAgentResponse = Agent;
901
+ /** Remove an agent's own Archil disk, and everything on it (DELETE /agents/{agent_id}/archil). */
902
+ export type DeleteAgentArchilResponse = {
903
+ on: boolean;
904
+ archil_disk: {
905
+ disk_id: string;
906
+ } | null;
907
+ removed: {
908
+ disk_id: string;
909
+ } | null;
910
+ };
857
911
  /** Forget one of the agent's saved sign-ins (DELETE /agents/{agent_id}/sign-ins/{key}). */
858
912
  export type ForgetSignInResponse = {
859
913
  key: string;
@@ -878,6 +932,13 @@ export type GetAgentResponse = Agent & ({
878
932
  permissions: Array<"allow" | "ask" | "deny">;
879
933
  }>;
880
934
  });
935
+ /** The agent's own Archil disk, once its first run made it (GET /agents/{agent_id}/archil). */
936
+ export type GetAgentArchilResponse = {
937
+ on: boolean;
938
+ archil_disk: {
939
+ disk_id: string;
940
+ } | null;
941
+ };
881
942
  /** List agents (GET /agents). */
882
943
  export interface ListAgentsParams {
883
944
  limit?: number;
@@ -952,6 +1013,42 @@ export type WriteHomeFileResponse = {
952
1013
  content_type?: string | null;
953
1014
  unreadable?: true;
954
1015
  };
1016
+ /** The agent's cost per run, run after run: its own cost, what learning added and the path it took (GET /agents/{agent_id}/learning/cost). */
1017
+ export interface GetLearningCostParams {
1018
+ limit?: number;
1019
+ format?: "json" | "csv";
1020
+ }
1021
+ export type GetLearningCostResponse = {
1022
+ agent: string;
1023
+ runs: Array<{
1024
+ n: number;
1025
+ run_id: string;
1026
+ started_at: string;
1027
+ path: "agent" | "handed_back" | "workflow";
1028
+ workflow: string | null;
1029
+ learned_revision: string | null;
1030
+ cost_usd: number | null;
1031
+ learning_usd: number | null;
1032
+ total_usd: number | null;
1033
+ }>;
1034
+ total_runs: number;
1035
+ unknown_cost_runs: number;
1036
+ summary: {
1037
+ takeover: {
1038
+ n: number;
1039
+ run_id: string;
1040
+ } | null;
1041
+ before: {
1042
+ runs: number;
1043
+ mean_usd: number;
1044
+ } | null;
1045
+ after: {
1046
+ runs: number;
1047
+ mean_usd: number;
1048
+ } | null;
1049
+ times_cheaper: number | null;
1050
+ };
1051
+ };
955
1052
  /** What the agent has learned: its index, notes, log of changes and counts (GET /agents/{agent_id}/learning). */
956
1053
  export type GetAgentLearningResponse = {
957
1054
  agent: string;
@@ -974,7 +1071,9 @@ export type GetAgentLearningResponse = {
974
1071
  };
975
1072
  retired?: {
976
1073
  at: string;
977
- by: "person" | "run";
1074
+ by: "person" | "run" | "host";
1075
+ from?: "active" | "pending";
1076
+ why?: "unreadable";
978
1077
  };
979
1078
  last_change?: {
980
1079
  kind: "approved" | "edited" | "created" | "retired" | "restored" | "learned" | "superseded";
@@ -995,7 +1094,9 @@ export type GetAgentLearningResponse = {
995
1094
  etag: string;
996
1095
  retired?: {
997
1096
  at: string;
998
- by: "person" | "run";
1097
+ by: "person" | "run" | "host";
1098
+ from?: "active" | "pending";
1099
+ why?: "unreadable";
999
1100
  };
1000
1101
  last_change?: {
1001
1102
  kind: "approved" | "edited" | "created" | "retired" | "restored" | "learned" | "superseded";
@@ -1014,7 +1115,9 @@ export type GetAgentLearningResponse = {
1014
1115
  etag: string;
1015
1116
  retired?: {
1016
1117
  at: string;
1017
- by: "person" | "run";
1118
+ by: "person" | "run" | "host";
1119
+ from?: "active" | "pending";
1120
+ why?: "unreadable";
1018
1121
  };
1019
1122
  last_change?: {
1020
1123
  kind: "approved" | "edited" | "created" | "retired" | "restored" | "learned" | "superseded";
@@ -1104,7 +1207,9 @@ export type ListLearningNotesResponse = {
1104
1207
  };
1105
1208
  retired?: {
1106
1209
  at: string;
1107
- by: "person" | "run";
1210
+ by: "person" | "run" | "host";
1211
+ from?: "active" | "pending";
1212
+ why?: "unreadable";
1108
1213
  };
1109
1214
  last_change?: {
1110
1215
  kind: "approved" | "edited" | "created" | "retired" | "restored" | "learned" | "superseded";
@@ -1147,7 +1252,7 @@ export type DeleteWorkspaceArchilResponse = {
1147
1252
  source: "env" | "console" | "sign-in" | null;
1148
1253
  changed_at: string | null;
1149
1254
  };
1150
- diskId?: string;
1255
+ source?: "env" | "console";
1151
1256
  region?: string;
1152
1257
  s3Url?: string;
1153
1258
  image?: string;
@@ -1170,7 +1275,7 @@ export type GetGitHubConnectionResponse = {
1170
1275
  account: string;
1171
1276
  }>;
1172
1277
  };
1173
- /** Whether run folders are on an Archil disk (Mode 2), its settings, and whether its keys are saved (GET /workspace/archil). */
1278
+ /** Whether run folders are on Archil disks (Mode 2), the settings, and whether its keys are saved (GET /workspace/archil). */
1174
1279
  export type GetWorkspaceArchilResponse = {
1175
1280
  on: boolean;
1176
1281
  secret: {
@@ -1179,7 +1284,7 @@ export type GetWorkspaceArchilResponse = {
1179
1284
  source: "env" | "console" | "sign-in" | null;
1180
1285
  changed_at: string | null;
1181
1286
  };
1182
- diskId?: string;
1287
+ source?: "env" | "console";
1183
1288
  region?: string;
1184
1289
  s3Url?: string;
1185
1290
  image?: string;
@@ -1214,7 +1319,10 @@ export type ListComputersResponse = {
1214
1319
  }>;
1215
1320
  required: Array<string>;
1216
1321
  ready: boolean;
1322
+ shell: "computer" | "local" | "none";
1323
+ host_tools: Array<string>;
1217
1324
  why?: string;
1325
+ shell_note?: string;
1218
1326
  gpu?: {
1219
1327
  types: Array<string>;
1220
1328
  max: number;
@@ -1232,13 +1340,19 @@ export type ListComputersResponse = {
1232
1340
  why?: string;
1233
1341
  };
1234
1342
  network?: string;
1343
+ images?: Array<string>;
1344
+ persistent?: {
1345
+ images?: Array<string>;
1346
+ };
1235
1347
  }>;
1236
1348
  why?: string;
1349
+ shell?: "computer" | "local" | "none";
1350
+ host_tools?: Array<string>;
1351
+ shell_note?: string;
1237
1352
  }>;
1238
1353
  };
1239
- /** Turn Mode 2 on: run folders on this Archil disk (PUT /workspace/archil). */
1354
+ /** Turn Mode 2 on: run folders on Archil disks, one per agent (PUT /workspace/archil). */
1240
1355
  export type PutWorkspaceArchilBody = {
1241
- diskId: string;
1242
1356
  region: string;
1243
1357
  s3Url: string;
1244
1358
  image?: string;
@@ -1254,7 +1368,7 @@ export type PutWorkspaceArchilResponse = {
1254
1368
  source: "env" | "console" | "sign-in" | null;
1255
1369
  changed_at: string | null;
1256
1370
  };
1257
- diskId?: string;
1371
+ source?: "env" | "console";
1258
1372
  region?: string;
1259
1373
  s3Url?: string;
1260
1374
  image?: string;
@@ -1273,7 +1387,10 @@ export type SaveComputerKeysResponse = {
1273
1387
  }>;
1274
1388
  required: Array<string>;
1275
1389
  ready: boolean;
1390
+ shell: "computer" | "local" | "none";
1391
+ host_tools: Array<string>;
1276
1392
  why?: string;
1393
+ shell_note?: string;
1277
1394
  gpu?: {
1278
1395
  types: Array<string>;
1279
1396
  max: number;
@@ -1291,6 +1408,10 @@ export type SaveComputerKeysResponse = {
1291
1408
  why?: string;
1292
1409
  };
1293
1410
  network?: string;
1411
+ images?: Array<string>;
1412
+ persistent?: {
1413
+ images?: Array<string>;
1414
+ };
1294
1415
  };
1295
1416
  /** Start signing in to an MCP server with OAuth: the page the owner opens (POST /settings/mcp-servers/{name}/oauth/start). Its body's string values are secrets: each copy is cut from the answer, and a refusal keeps only its code. */
1296
1417
  export type StartMcpOAuthBody = {
@@ -1310,7 +1431,7 @@ export type TestComputerResponse = {
1310
1431
  ok: false;
1311
1432
  why: string;
1312
1433
  };
1313
- /** Test the Archil disk with its saved account key (POST /workspace/archil/test). */
1434
+ /** Test the Archil account key at its region's control plane (POST /workspace/archil/test). */
1314
1435
  export type TestWorkspaceArchilResponse = {
1315
1436
  ok: true;
1316
1437
  detail: string;
@@ -1324,7 +1445,7 @@ export type GetMcpServerResponse = {
1324
1445
  name: string;
1325
1446
  url: string;
1326
1447
  auth: {
1327
- type: "none" | "bearer" | "headers" | "oauth" | "github_app";
1448
+ type: "none" | "bearer" | "headers" | "oauth" | "github_app" | "per_run";
1328
1449
  headers?: Array<string>;
1329
1450
  };
1330
1451
  credential: "sealed" | "unreadable" | "expired" | null;
@@ -1362,7 +1483,7 @@ export type ListMcpServersResponse = {
1362
1483
  name: string;
1363
1484
  url: string;
1364
1485
  auth: {
1365
- type: "none" | "bearer" | "headers" | "oauth" | "github_app";
1486
+ type: "none" | "bearer" | "headers" | "oauth" | "github_app" | "per_run";
1366
1487
  headers?: Array<string>;
1367
1488
  };
1368
1489
  credential: "sealed" | "unreadable" | "expired" | null;
@@ -1401,7 +1522,7 @@ export type McpOAuthClientResponse = Record<string, unknown>;
1401
1522
  export type PreviewMcpServerBody = {
1402
1523
  url: string;
1403
1524
  auth?: {
1404
- type: "none" | "bearer" | "headers" | "oauth" | "github_app";
1525
+ type: "none" | "bearer" | "headers" | "oauth" | "github_app" | "per_run";
1405
1526
  token?: string;
1406
1527
  headers?: Record<string, string>;
1407
1528
  };
@@ -1439,7 +1560,7 @@ export type RefreshMcpServerResponse = {
1439
1560
  name: string;
1440
1561
  url: string;
1441
1562
  auth: {
1442
- type: "none" | "bearer" | "headers" | "oauth" | "github_app";
1563
+ type: "none" | "bearer" | "headers" | "oauth" | "github_app" | "per_run";
1443
1564
  headers?: Array<string>;
1444
1565
  };
1445
1566
  credential: "sealed" | "unreadable" | "expired" | null;
@@ -1476,7 +1597,7 @@ export type RefreshMcpServerResponse = {
1476
1597
  export type SaveMcpServerBody = {
1477
1598
  url: string;
1478
1599
  auth?: {
1479
- type: "none" | "bearer" | "headers" | "oauth" | "github_app";
1600
+ type: "none" | "bearer" | "headers" | "oauth" | "github_app" | "per_run";
1480
1601
  token?: string;
1481
1602
  headers?: Record<string, string>;
1482
1603
  };
@@ -1486,7 +1607,7 @@ export type SaveMcpServerResponse = {
1486
1607
  name: string;
1487
1608
  url: string;
1488
1609
  auth: {
1489
- type: "none" | "bearer" | "headers" | "oauth" | "github_app";
1610
+ type: "none" | "bearer" | "headers" | "oauth" | "github_app" | "per_run";
1490
1611
  headers?: Array<string>;
1491
1612
  };
1492
1613
  credential: "sealed" | "unreadable" | "expired" | null;
@@ -1574,6 +1695,8 @@ export type GetRunGraphResponse = {
1574
1695
  startedAt?: string;
1575
1696
  endedAt?: string;
1576
1697
  branch?: string;
1698
+ model?: string;
1699
+ tier?: string;
1577
1700
  items?: Array<{
1578
1701
  index: number;
1579
1702
  status: "pending" | "working" | "done" | "failed" | "stopped" | "escalated" | "not_run" | "needs_review";
@@ -1676,6 +1799,17 @@ export type GetRunLearningResponse = {
1676
1799
  output: number;
1677
1800
  } | null;
1678
1801
  };
1802
+ used: {
1803
+ skills: Array<{
1804
+ name: string;
1805
+ read: boolean;
1806
+ }>;
1807
+ workflows: Array<{
1808
+ name: string;
1809
+ calls: number;
1810
+ failed: number;
1811
+ }>;
1812
+ };
1679
1813
  given?: Array<{
1680
1814
  file: string;
1681
1815
  name: string;
@@ -1966,9 +2100,21 @@ export type ListTemplatesResponse = {
1966
2100
  } | null;
1967
2101
  effort: string | null;
1968
2102
  tools: Array<string> | null;
2103
+ checkout: "pull_request" | null;
1969
2104
  tool_policy: {
1970
2105
  bash: "read-only";
1971
2106
  } | null;
2107
+ computer: Array<"shell" | "none"> | null;
2108
+ computer_here: {
2109
+ entry: "shell" | "none" | null;
2110
+ computer: {
2111
+ kind: string;
2112
+ provider?: string;
2113
+ } | null;
2114
+ shell: string | null;
2115
+ dropped: Array<string>;
2116
+ note: string | null;
2117
+ } | null;
1972
2118
  mcp: Array<{
1973
2119
  server: string;
1974
2120
  required: boolean;
@@ -1990,7 +2136,8 @@ export type ListTemplatesResponse = {
1990
2136
  }>;
1991
2137
  secrets: Array<string>;
1992
2138
  budget: {
1993
- per_run_usd: number;
2139
+ per_run_usd?: number;
2140
+ tool_calls?: number;
1994
2141
  } | null;
1995
2142
  learning: boolean;
1996
2143
  approvals_default: "ask" | "never";
@@ -2082,6 +2229,9 @@ export type PutToolSettingsBody = {
2082
2229
  provider?: "auto" | "browserbase" | "kernel" | "chrome";
2083
2230
  permission?: "allow" | "deny";
2084
2231
  };
2232
+ subagent?: {
2233
+ permission?: "allow" | "deny";
2234
+ };
2085
2235
  pdf_pages?: {
2086
2236
  permission?: "allow" | "deny";
2087
2237
  };
@@ -2837,10 +2987,14 @@ export declare function resources(call: Call): {
2837
2987
  archive: (agentId: string, options?: RequestOptions) => Promise<ArchiveAgentResponse>;
2838
2988
  /** Create an agent home (POST /agents). */
2839
2989
  create: (body: CreateAgentBody, params?: CreateAgentParams, options?: RequestOptions) => Promise<CreateAgentResponse>;
2990
+ /** Remove an agent's own Archil disk, and everything on it (DELETE /agents/{agent_id}/archil). */
2991
+ deleteAgentArchil: (agentId: string, options?: RequestOptions) => Promise<DeleteAgentArchilResponse>;
2840
2992
  /** Forget one of the agent's saved sign-ins (DELETE /agents/{agent_id}/sign-ins/{key}). */
2841
2993
  forgetSignIn: (agentId: string, key: string, options?: RequestOptions) => Promise<ForgetSignInResponse>;
2842
2994
  /** One agent (GET /agents/{agent_id}). */
2843
2995
  get: (agentId: string, options?: RequestOptions) => Promise<Tagged<GetAgentResponse>>;
2996
+ /** The agent's own Archil disk, once its first run made it (GET /agents/{agent_id}/archil). */
2997
+ getAgentArchil: (agentId: string, options?: RequestOptions) => Promise<GetAgentArchilResponse>;
2844
2998
  /** List agents (GET /agents). */
2845
2999
  list: (params?: ListAgentsParams, options?: RequestOptions) => Promise<ListAgentsResponse>;
2846
3000
  /** The agent's runs index (GET /agents/{agent_id}/runs). */
@@ -2873,6 +3027,8 @@ export declare function resources(call: Call): {
2873
3027
  write: (agentId: string, path: string, body: RawBody, options?: BodyOptions) => Promise<WriteHomeFileResponse>;
2874
3028
  };
2875
3029
  learning: {
3030
+ /** The agent's cost per run, run after run: its own cost, what learning added and the path it took (GET /agents/{agent_id}/learning/cost). */
3031
+ cost: (agentId: string, params?: GetLearningCostParams, options?: RequestOptions) => Promise<GetLearningCostResponse | string>;
2876
3032
  /** What the agent has learned: its index, notes, log of changes and counts (GET /agents/{agent_id}/learning). */
2877
3033
  get: (agentId: string, options?: RequestOptions) => Promise<GetAgentLearningResponse>;
2878
3034
  /** A page of the changes on the agent's main, newest first (GET /agents/{agent_id}/learning/log). */
@@ -2893,17 +3049,17 @@ export declare function resources(call: Call): {
2893
3049
  disconnectGitHub: (options?: RequestOptions) => Promise<DisconnectGitHubResponse>;
2894
3050
  /** Whether a GitHub App is connected, and if so its id, slug and installations, never a secret (GET /integrations/github). */
2895
3051
  getGitHubConnection: (options?: RequestOptions) => Promise<GetGitHubConnectionResponse>;
2896
- /** Whether run folders are on an Archil disk (Mode 2), its settings, and whether its keys are saved (GET /workspace/archil). */
3052
+ /** Whether run folders are on Archil disks (Mode 2), the settings, and whether its keys are saved (GET /workspace/archil). */
2897
3053
  getWorkspaceArchil: (options?: RequestOptions) => Promise<GetWorkspaceArchilResponse>;
2898
3054
  /** Settings → Computers: the kinds of computer this server offers, each provider and whether its keys are saved (GET /computers). */
2899
3055
  listComputers: (options?: RequestOptions) => Promise<ListComputersResponse>;
2900
- /** Turn Mode 2 on: run folders on this Archil disk (PUT /workspace/archil). */
3056
+ /** Turn Mode 2 on: run folders on Archil disks, one per agent (PUT /workspace/archil). */
2901
3057
  putWorkspaceArchil: (body: PutWorkspaceArchilBody, options?: RequestOptions) => Promise<PutWorkspaceArchilResponse>;
2902
3058
  /** Save a computer provider's keys, sealed (PUT /computers/{provider}/keys). */
2903
3059
  saveComputerKeys: (provider: string, body: SaveComputerKeysBody, options?: RequestOptions) => Promise<SaveComputerKeysResponse>;
2904
3060
  /** Test a computer provider's account with its saved keys (POST /computers/{provider}/test). */
2905
3061
  testComputer: (provider: string, options?: RequestOptions) => Promise<TestComputerResponse>;
2906
- /** Test the Archil disk with its saved account key (POST /workspace/archil/test). */
3062
+ /** Test the Archil account key at its region's control plane (POST /workspace/archil/test). */
2907
3063
  testWorkspaceArchil: (options?: RequestOptions) => Promise<TestWorkspaceArchilResponse>;
2908
3064
  };
2909
3065
  mcpServers: {
@@ -2,8 +2,10 @@
2
2
  export const OPERATIONS = {
3
3
  archiveAgent: { "method": "POST", "path": "/agents/{agent_id}/archive", "pathParams": ["agent_id"], "multiSegment": [], "query": [], "headers": [], "body": null, "answer": "json", "secret": false, "publicFields": [], "tagged": false },
4
4
  createAgent: { "method": "POST", "path": "/agents", "pathParams": [], "multiSegment": [], "query": [], "headers": ["Idempotency-Key"], "body": { "required": true, "types": ["application/json"] }, "answer": "json", "secret": false, "publicFields": [], "tagged": false },
5
+ deleteAgentArchil: { "method": "DELETE", "path": "/agents/{agent_id}/archil", "pathParams": ["agent_id"], "multiSegment": [], "query": [], "headers": [], "body": null, "answer": "json", "secret": false, "publicFields": [], "tagged": false },
5
6
  forgetSignIn: { "method": "DELETE", "path": "/agents/{agent_id}/sign-ins/{key}", "pathParams": ["agent_id", "key"], "multiSegment": [], "query": [], "headers": [], "body": null, "answer": "json", "secret": false, "publicFields": [], "tagged": false },
6
7
  getAgent: { "method": "GET", "path": "/agents/{agent_id}", "pathParams": ["agent_id"], "multiSegment": [], "query": [], "headers": [], "body": null, "answer": "json", "secret": false, "publicFields": [], "tagged": true },
8
+ getAgentArchil: { "method": "GET", "path": "/agents/{agent_id}/archil", "pathParams": ["agent_id"], "multiSegment": [], "query": [], "headers": [], "body": null, "answer": "json", "secret": false, "publicFields": [], "tagged": false },
7
9
  listAgents: { "method": "GET", "path": "/agents", "pathParams": [], "multiSegment": [], "query": ["limit", "cursor", "archived"], "headers": [], "body": null, "answer": "json", "secret": false, "publicFields": [], "tagged": false },
8
10
  listRuns: { "method": "GET", "path": "/agents/{agent_id}/runs", "pathParams": ["agent_id"], "multiSegment": [], "query": ["limit", "cursor", "status"], "headers": [], "body": null, "answer": "json", "secret": false, "publicFields": [], "tagged": false },
9
11
  unarchiveAgent: { "method": "POST", "path": "/agents/{agent_id}/unarchive", "pathParams": ["agent_id"], "multiSegment": [], "query": [], "headers": [], "body": null, "answer": "json", "secret": false, "publicFields": [], "tagged": false },
@@ -17,6 +19,7 @@ export const OPERATIONS = {
17
19
  listHomeFiles: { "method": "GET", "path": "/agents/{agent_id}/home/files", "pathParams": ["agent_id"], "multiSegment": [], "query": [], "headers": [], "body": null, "answer": "json", "secret": false, "publicFields": [], "tagged": false },
18
20
  readHomeFile: { "method": "GET", "path": "/agents/{agent_id}/home/files/{path}", "pathParams": ["agent_id", "path"], "multiSegment": ["path"], "query": ["download"], "headers": [], "body": null, "answer": "bytes", "secret": false, "publicFields": [], "tagged": false },
19
21
  writeHomeFile: { "method": "PUT", "path": "/agents/{agent_id}/home/files/{path}", "pathParams": ["agent_id", "path"], "multiSegment": ["path"], "query": [], "headers": [], "body": { "required": true, "types": ["application/octet-stream", "*/*"] }, "answer": "json", "secret": false, "publicFields": [], "tagged": false },
22
+ getLearningCost: { "method": "GET", "path": "/agents/{agent_id}/learning/cost", "pathParams": ["agent_id"], "multiSegment": [], "query": ["limit", "format"], "headers": [], "body": null, "answer": "json+text", "secret": false, "publicFields": [], "tagged": false },
20
23
  getAgentLearning: { "method": "GET", "path": "/agents/{agent_id}/learning", "pathParams": ["agent_id"], "multiSegment": [], "query": [], "headers": [], "body": null, "answer": "json", "secret": false, "publicFields": [], "tagged": false },
21
24
  listLearningLog: { "method": "GET", "path": "/agents/{agent_id}/learning/log", "pathParams": ["agent_id"], "multiSegment": [], "query": ["cursor", "limit"], "headers": [], "body": null, "answer": "json", "secret": false, "publicFields": [], "tagged": false },
22
25
  listLearningNotes: { "method": "GET", "path": "/agents/{agent_id}/learning/notes", "pathParams": ["agent_id"], "multiSegment": [], "query": ["cursor", "limit", "status"], "headers": [], "body": null, "answer": "json", "secret": false, "publicFields": [], "tagged": false },
@@ -103,10 +106,14 @@ export function resources(call) {
103
106
  archive: (agentId, options) => call("archiveAgent", [agentId], undefined, undefined, options),
104
107
  /** Create an agent home (POST /agents). */
105
108
  create: (body, params, options) => call("createAgent", [], body, params, options),
109
+ /** Remove an agent's own Archil disk, and everything on it (DELETE /agents/{agent_id}/archil). */
110
+ deleteAgentArchil: (agentId, options) => call("deleteAgentArchil", [agentId], undefined, undefined, options),
106
111
  /** Forget one of the agent's saved sign-ins (DELETE /agents/{agent_id}/sign-ins/{key}). */
107
112
  forgetSignIn: (agentId, key, options) => call("forgetSignIn", [agentId, key], undefined, undefined, options),
108
113
  /** One agent (GET /agents/{agent_id}). */
109
114
  get: (agentId, options) => call("getAgent", [agentId], undefined, undefined, options),
115
+ /** The agent's own Archil disk, once its first run made it (GET /agents/{agent_id}/archil). */
116
+ getAgentArchil: (agentId, options) => call("getAgentArchil", [agentId], undefined, undefined, options),
110
117
  /** List agents (GET /agents). */
111
118
  list: (params, options) => call("listAgents", [], undefined, params, options),
112
119
  /** The agent's runs index (GET /agents/{agent_id}/runs). */
@@ -139,6 +146,8 @@ export function resources(call) {
139
146
  write: (agentId, path, body, options) => call("writeHomeFile", [agentId, path], body, undefined, options),
140
147
  },
141
148
  learning: {
149
+ /** The agent's cost per run, run after run: its own cost, what learning added and the path it took (GET /agents/{agent_id}/learning/cost). */
150
+ cost: (agentId, params, options) => call("getLearningCost", [agentId], undefined, params, options),
142
151
  /** What the agent has learned: its index, notes, log of changes and counts (GET /agents/{agent_id}/learning). */
143
152
  get: (agentId, options) => call("getAgentLearning", [agentId], undefined, undefined, options),
144
153
  /** A page of the changes on the agent's main, newest first (GET /agents/{agent_id}/learning/log). */
@@ -159,17 +168,17 @@ export function resources(call) {
159
168
  disconnectGitHub: (options) => call("disconnectGitHub", [], undefined, undefined, options),
160
169
  /** Whether a GitHub App is connected, and if so its id, slug and installations, never a secret (GET /integrations/github). */
161
170
  getGitHubConnection: (options) => call("getGitHubConnection", [], undefined, undefined, options),
162
- /** Whether run folders are on an Archil disk (Mode 2), its settings, and whether its keys are saved (GET /workspace/archil). */
171
+ /** Whether run folders are on Archil disks (Mode 2), the settings, and whether its keys are saved (GET /workspace/archil). */
163
172
  getWorkspaceArchil: (options) => call("getWorkspaceArchil", [], undefined, undefined, options),
164
173
  /** Settings → Computers: the kinds of computer this server offers, each provider and whether its keys are saved (GET /computers). */
165
174
  listComputers: (options) => call("listComputers", [], undefined, undefined, options),
166
- /** Turn Mode 2 on: run folders on this Archil disk (PUT /workspace/archil). */
175
+ /** Turn Mode 2 on: run folders on Archil disks, one per agent (PUT /workspace/archil). */
167
176
  putWorkspaceArchil: (body, options) => call("putWorkspaceArchil", [], body, undefined, options),
168
177
  /** Save a computer provider's keys, sealed (PUT /computers/{provider}/keys). */
169
178
  saveComputerKeys: (provider, body, options) => call("saveComputerKeys", [provider], body, undefined, options),
170
179
  /** Test a computer provider's account with its saved keys (POST /computers/{provider}/test). */
171
180
  testComputer: (provider, options) => call("testComputer", [provider], undefined, undefined, options),
172
- /** Test the Archil disk with its saved account key (POST /workspace/archil/test). */
181
+ /** Test the Archil account key at its region's control plane (POST /workspace/archil/test). */
173
182
  testWorkspaceArchil: (options) => call("testWorkspaceArchil", [], undefined, undefined, options),
174
183
  },
175
184
  mcpServers: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@parcha/agentrun-client",
3
- "version": "0.1.0-beta.34",
3
+ "version": "0.1.0-beta.36",
4
4
  "description": "A typed TypeScript client for a self-hosted AgentRun server: a method per operation of its API, typed from its OpenAPI document, with waiting for a run and following its timeline. No dependencies; fetch only.",
5
5
  "keywords": [
6
6
  "agentrun",
@@ -13,7 +13,7 @@
13
13
  "license": "Apache-2.0",
14
14
  "author": "Parcha Labs, Inc.",
15
15
  "engines": {
16
- "node": ">=24.11.0"
16
+ "node": ">=24.22.3"
17
17
  },
18
18
  "main": "./dist/index.js",
19
19
  "types": "./dist/index.d.ts",