@parcha/agentrun 0.4.3 → 0.4.4

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
@@ -17,9 +17,8 @@ Node gets one line naming that floor.
17
17
 
18
18
  Where Docker answers on this machine, a new agent runs in a Docker box of its own with a shell, and a line on stderr,
19
19
  after the address, says so: `Boxes: docker (on by default; set AGENTRUN_BOXES to change).` Where it does not, that line says why
20
- and that new agents run on the runner. The box image's first build takes a few minutes, said as it starts (`Preparing
21
- the Docker box image (first start only, a few minutes); agents can be made now, and their first run waits for it.`)
22
- and as it ends (`The Docker box image is ready.`). `AGENTRUN_BOXES=none` turns boxes off.
20
+ and that new agents run on the runner. A Docker box's image is built on its first run, which shows that on its
21
+ timeline. `AGENTRUN_BOXES=none` turns boxes off.
23
22
 
24
23
  pi runs every agent out of the box. The Claude Code and Codex harnesses need their own packages beside the server; when
25
24
  one is missing, AgentRun says so with the one command to paste: `npx` with this package, the server and that harness's
package/lib/cli.mjs CHANGED
@@ -502,14 +502,14 @@ async function command(entry, argv, env, io) {
502
502
  }
503
503
 
504
504
  /** A hand-written command of LOCAL: its flags and arguments checked, then its `run`, with this module's custody of the
505
- * token (targetOf, BAD_HEADER), its requests (clientOf, request, send) and its secret-route guard (secretAt). */
505
+ * token (targetOf, BAD_HEADER) and its requests (clientOf, request). */
506
506
  async function local(entry, argv, env, io) {
507
507
  const { values, positionals } = parse(argv, { ...GLOBAL, ...entry.options });
508
508
  if (values.help) return io.stdout.write(`${helpOf(entry, entry.help)}\n`), 0;
509
509
  const args = positionals.slice(entry.command.length);
510
510
  const count = entry.pathParams.length;
511
511
  if (args.length !== count) throw usageError(`${helpOf(entry, entry.help)}\n\n${usageOf(entry)} takes ${count || "no"} argument${count === 1 ? "" : "s"}, given ${args.length}.`);
512
- const cli = { fail: (code, message) => new Exit(code, message), baseOf, targetOf, clientOf, request, send, secretAt, BAD_HEADER };
512
+ const cli = { fail: (code, message) => new Exit(code, message), baseOf, targetOf, clientOf, request, BAD_HEADER };
513
513
  return entry.run({ values, args, env, io, cli });
514
514
  }
515
515
 
@@ -1,5 +1,5 @@
1
1
  // Generated by scripts/generate-clients.mjs from the server's OpenAPI document. Do not edit: run node scripts/generate-clients.mjs.
2
- // SHA-256 of what the table is made of (operationsOf in scripts/generate-clients.mjs): eb56df6f12cf742401981db05758a2cd4cc46ae46f71574560de499c8525ed54
2
+ // SHA-256 of what the table is made of (operationsOf in scripts/generate-clients.mjs): 09519c5624ed997f877a703e7489c4c502d0320c2072a7bc9127282984b9a8c8
3
3
  export const COMMANDS = [
4
4
  {
5
5
  "command": [
@@ -70,6 +70,28 @@ export const COMMANDS = [
70
70
  "raw": false,
71
71
  "summary": "Create an agent home"
72
72
  },
73
+ {
74
+ "command": [
75
+ "agents",
76
+ "delete-agent-archil"
77
+ ],
78
+ "operationId": "deleteAgentArchil",
79
+ "method": "DELETE",
80
+ "path": "/agents/{agent_id}/archil",
81
+ "pathParams": [
82
+ "agent_id"
83
+ ],
84
+ "multiSegment": [],
85
+ "query": [],
86
+ "headers": [],
87
+ "bodyFlags": [],
88
+ "hasBody": false,
89
+ "bodyRequired": false,
90
+ "bodyTypes": [],
91
+ "secretBody": false,
92
+ "raw": false,
93
+ "summary": "Remove an agent's own Archil disk, and everything on it"
94
+ },
73
95
  {
74
96
  "command": [
75
97
  "agents",
@@ -115,6 +137,28 @@ export const COMMANDS = [
115
137
  "raw": false,
116
138
  "summary": "One agent"
117
139
  },
140
+ {
141
+ "command": [
142
+ "agents",
143
+ "get-agent-archil"
144
+ ],
145
+ "operationId": "getAgentArchil",
146
+ "method": "GET",
147
+ "path": "/agents/{agent_id}/archil",
148
+ "pathParams": [
149
+ "agent_id"
150
+ ],
151
+ "multiSegment": [],
152
+ "query": [],
153
+ "headers": [],
154
+ "bodyFlags": [],
155
+ "hasBody": false,
156
+ "bodyRequired": false,
157
+ "bodyTypes": [],
158
+ "secretBody": false,
159
+ "raw": false,
160
+ "summary": "The agent's own Archil disk, once its first run made it"
161
+ },
118
162
  {
119
163
  "command": [
120
164
  "agents",
@@ -522,6 +566,45 @@ export const COMMANDS = [
522
566
  "raw": false,
523
567
  "summary": "Write one file of the agent's home"
524
568
  },
569
+ {
570
+ "command": [
571
+ "learning",
572
+ "cost"
573
+ ],
574
+ "operationId": "getLearningCost",
575
+ "method": "GET",
576
+ "path": "/agents/{agent_id}/learning/cost",
577
+ "pathParams": [
578
+ "agent_id"
579
+ ],
580
+ "multiSegment": [],
581
+ "query": [
582
+ {
583
+ "name": "limit",
584
+ "type": "integer",
585
+ "required": false,
586
+ "description": "The latest runs to answer, each keeping its number. At most 10000."
587
+ },
588
+ {
589
+ "name": "format",
590
+ "type": "string",
591
+ "enum": [
592
+ "json",
593
+ "csv"
594
+ ],
595
+ "required": false,
596
+ "description": "`csv`: the runs as CSV, columns n, run_id, started_at, path, workflow, learned_revision, cost_usd, learning_usd, total_usd."
597
+ }
598
+ ],
599
+ "headers": [],
600
+ "bodyFlags": [],
601
+ "hasBody": false,
602
+ "bodyRequired": false,
603
+ "bodyTypes": [],
604
+ "secretBody": false,
605
+ "raw": false,
606
+ "summary": "The agent's cost per run, run after run: its own cost, what learning added and the path it took"
607
+ },
525
608
  {
526
609
  "command": [
527
610
  "learning",
@@ -804,7 +887,7 @@ export const COMMANDS = [
804
887
  "bodyTypes": [],
805
888
  "secretBody": false,
806
889
  "raw": false,
807
- "summary": "Whether run folders are on an Archil disk (Mode 2), its settings, and whether its keys are saved"
890
+ "summary": "Whether run folders are on Archil disks (Mode 2), the settings, and whether its keys are saved"
808
891
  },
809
892
  {
810
893
  "command": [
@@ -866,7 +949,7 @@ export const COMMANDS = [
866
949
  "bodyTypes": [],
867
950
  "secretBody": false,
868
951
  "raw": false,
869
- "summary": "Test the Archil disk with its saved account key"
952
+ "summary": "Test the Archil account key at its region's control plane"
870
953
  },
871
954
  {
872
955
  "command": [
package/lib/login.mjs CHANGED
@@ -3,7 +3,7 @@
3
3
  // the console, signed in, and the server refuses the token on them (secret-writes.ts). A secret is never in argv, so
4
4
  // never in shell history or `ps`, and never in any output or error. Each command is `{ command, pathParams, summary,
5
5
  // route?, help, options, run }`; cli.mjs runs it with `{ values, args, env, io, cli }`, where `cli` is its own
6
- // `{ fail, targetOf, clientOf, request, send, secretAt, BAD_HEADER }`: the token's custody and the requests are its.
6
+ // `{ fail, baseOf, targetOf, clientOf, request, BAD_HEADER }`: the token's custody and the requests are its.
7
7
  import { randomBytes } from "node:crypto";
8
8
  import { chmodSync, closeSync, constants, existsSync, fsyncSync, mkdirSync, openSync, renameSync, rmSync, writeSync } from "node:fs";
9
9
  import { homedir } from "node:os";
package/lib/start.mjs CHANGED
@@ -35,9 +35,9 @@ export const API_ONLY_LINE = /^API only \(AGENTRUN_API_ONLY=1\)/;
35
35
  export const TAIL_LINES = 20;
36
36
 
37
37
  /** The server's lines this command says too, as they come: its banner's boxes line (whether new agents get the Docker
38
- * box, or why not), the Docker box image's first build, as it starts and ends, and, on a server with a public address
39
- * and no password yet, the setup link with its code, which setup at that address asks for. */
40
- export const SAID = /^(Boxes: |Preparing the Docker box image |The Docker box image |Set up this server: )/;
38
+ * box, or why not), and, on a server with a public address and no password yet, the setup link with its code, which
39
+ * setup at that address asks for. */
40
+ export const SAID = /^(Boxes: |Set up this server: )/;
41
41
 
42
42
  /** The address a person opens first, as the server says it: the URL of the first "Open " line of its output that names
43
43
  * one (openLineUrl). That line is the server's interface for it (the plain address today, a single-use sign-in link
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@parcha/agentrun",
3
- "version": "0.4.3",
3
+ "version": "0.4.4",
4
4
  "description": "AgentRun, the open-source platform that supercharges your agents (self-improvement, durable execution and a control plane on top of your favorite agent harness), on this machine with one command: npx @parcha/agentrun",
5
5
  "type": "module",
6
6
  "license": "Apache-2.0",
@@ -16,7 +16,7 @@
16
16
  "NOTICE"
17
17
  ],
18
18
  "dependencies": {
19
- "@parcha/agentrun-serve": "0.1.0-beta.35"
19
+ "@parcha/agentrun-serve": "0.1.0-beta.36"
20
20
  },
21
21
  "scripts": {
22
22
  "test": "node --test 'test/*.test.mjs'"
@@ -3,7 +3,7 @@ name: agentrun-cli
3
3
  description: Drive an AgentRun server from a shell with the agentrun CLI. Make an agent from a definition file, start a run with a spend cap and wait for it, answer a run that asks a question, read the files it wrote and what it cost, save tool keys, and call any other route of the server. Use when asked to run or manage AgentRun agents from the terminal or a script, or for anything the server's MCP tools do not cover (files, tool keys, triggers, webhooks, revisions, learning).
4
4
  ---
5
5
  <!-- Generated by scripts/generate-clients.mjs from the server's OpenAPI document and its skill template. Do not edit: run node scripts/generate-clients.mjs. -->
6
- <!-- SHA-256 of what the command table is made of (operationsOf in scripts/generate-clients.mjs): eb56df6f12cf742401981db05758a2cd4cc46ae46f71574560de499c8525ed54 -->
6
+ <!-- SHA-256 of what the command table is made of (operationsOf in scripts/generate-clients.mjs): 09519c5624ed997f877a703e7489c4c502d0320c2072a7bc9127282984b9a8c8 -->
7
7
 
8
8
  # AgentRun CLI
9
9
 
@@ -118,10 +118,10 @@ Two clients call the same API from code, with the same server and token. `@parch
118
118
 
119
119
  ## Commands
120
120
 
121
- - `agentrun agents`: archive, create, forget-sign-in, get, list, runs, unarchive, update
121
+ - `agentrun agents`: archive, create, delete-agent-archil, forget-sign-in, get, get-agent-archil, list, runs, unarchive, update
122
122
  - `agentrun files`: create, delete, get, list, upload
123
123
  - `agentrun home`: delete, list, read, write
124
- - `agentrun learning`: get, log, notes, read, retire, write
124
+ - `agentrun learning`: cost, get, log, notes, read, retire, write
125
125
  - `agentrun local`: delete-workspace-archil, disconnect-git-hub, get-git-hub-connection, get-workspace-archil, list-computers, test-computer, test-workspace-archil
126
126
  - `agentrun login`: Check a server's token, read from stdin, and keep it with the server's address in the config file
127
127
  - `agentrun logout`: Remove the config file login wrote, its address and token
@@ -1,7 +1,7 @@
1
1
  # agentrun commands
2
2
 
3
3
  <!-- Generated by scripts/generate-clients.mjs from the server's OpenAPI document. Do not edit: run node scripts/generate-clients.mjs. -->
4
- <!-- SHA-256 of what the command table is made of (operationsOf in scripts/generate-clients.mjs): eb56df6f12cf742401981db05758a2cd4cc46ae46f71574560de499c8525ed54 -->
4
+ <!-- SHA-256 of what the command table is made of (operationsOf in scripts/generate-clients.mjs): 09519c5624ed997f877a703e7489c4c502d0320c2072a7bc9127282984b9a8c8 -->
5
5
 
6
6
  Every command of the agentrun CLI, by group. Arguments in capitals are positional; every command also takes `--base-url URL`, `--data DIR` and `--help`. A body field with one value (a string, number or boolean) is a flag of its own, and `--body` gives the whole body. A positional argument is refused when it is or holds a `.` or `..` path segment; a file's PATH keeps its slashes, and no segment of it may be empty.
7
7
 
@@ -24,6 +24,12 @@ Route: `POST /agents`.
24
24
  - `--body JSON|@FILE|-` (application/json, required): The whole body: inline, from a file or from stdin. The flags above win over a JSON body's fields.
25
25
  - `--body-type TYPE` (string): The body's type, one of application/json; any other than JSON is sent as given.
26
26
 
27
+ ### `agentrun agents delete-agent-archil AGENT_ID`
28
+
29
+ Remove an agent's own Archil disk, and everything on it.
30
+
31
+ Route: `DELETE /agents/{agent_id}/archil`.
32
+
27
33
  ### `agentrun agents forget-sign-in AGENT_ID KEY`
28
34
 
29
35
  Forget one of the agent's saved sign-ins.
@@ -36,6 +42,12 @@ One agent.
36
42
 
37
43
  Route: `GET /agents/{agent_id}`.
38
44
 
45
+ ### `agentrun agents get-agent-archil AGENT_ID`
46
+
47
+ The agent's own Archil disk, once its first run made it.
48
+
49
+ Route: `GET /agents/{agent_id}/archil`.
50
+
39
51
  ### `agentrun agents list`
40
52
 
41
53
  List agents.
@@ -154,6 +166,15 @@ Route: `PUT /agents/{agent_id}/home/files/{path}`. PATH keeps its slashes.
154
166
 
155
167
  ## learning
156
168
 
169
+ ### `agentrun learning cost AGENT_ID`
170
+
171
+ The agent's cost per run, run after run: its own cost, what learning added and the path it took.
172
+
173
+ Route: `GET /agents/{agent_id}/learning/cost`.
174
+
175
+ - `--limit INTEGER` (integer): The latest runs to answer, each keeping its number. At most 10000.
176
+ - `--format json|csv` (string, one of these): `csv`: the runs as CSV, columns n, run_id, started_at, path, workflow, learned_revision, cost_usd, learning_usd, total_usd.
177
+
157
178
  ### `agentrun learning get AGENT_ID`
158
179
 
159
180
  What the agent has learned: its index, notes, log of changes and counts.
@@ -229,7 +250,7 @@ Route: `GET /integrations/github`.
229
250
 
230
251
  ### `agentrun local get-workspace-archil`
231
252
 
232
- Whether run folders are on an Archil disk (Mode 2), its settings, and whether its keys are saved.
253
+ Whether run folders are on Archil disks (Mode 2), the settings, and whether its keys are saved.
233
254
 
234
255
  Route: `GET /workspace/archil`.
235
256
 
@@ -247,7 +268,7 @@ Route: `POST /computers/{provider}/test`.
247
268
 
248
269
  ### `agentrun local test-workspace-archil`
249
270
 
250
- Test the Archil disk with its saved account key.
271
+ Test the Archil account key at its region's control plane.
251
272
 
252
273
  Route: `POST /workspace/archil/test`.
253
274