@parcha/agentrun 0.4.17 → 0.4.19

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/install.sh CHANGED
@@ -207,6 +207,9 @@ It installs AgentRun, with a Node.js of its own, in ~/.agentrun, and starts it a
207
207
  macOS, systemd --user on Linux), which keeps running after the terminal closes. Where there is no service manager, it
208
208
  starts AgentRun in the background until the machine stops; `agentrun stop` stops it. It returns once AgentRun answers.
209
209
 
210
+ AgentRun counts itself anonymously (a random id, version and platform; never prompts, files or keys). To turn that
211
+ off, put AGENTRUN_TELEMETRY=0 before sh: https://github.com/Parcha-ai/agentrun/blob/main/docs/telemetry.md
212
+
210
213
  Options:
211
214
  --version V the @parcha/agentrun version or npm tag to install (default: latest)
212
215
  --package FILE install the launcher from FILE, a tarball `npm pack` made, in place of the registry's
@@ -538,6 +538,333 @@ export const COMMANDS = [
538
538
  "raw": false,
539
539
  "summary": "Check native CLI and sign-in without a paid model call"
540
540
  },
541
+ {
542
+ "command": [
543
+ "capabilities",
544
+ "get-capacity"
545
+ ],
546
+ "operationId": "getCapacity",
547
+ "method": "GET",
548
+ "path": "/capacity",
549
+ "pathParams": [],
550
+ "multiSegment": [],
551
+ "query": [
552
+ {
553
+ "name": "window",
554
+ "type": "integer",
555
+ "required": false,
556
+ "description": "The hand-back window in minutes, from 1 to 1440. Default 15."
557
+ }
558
+ ],
559
+ "headers": [],
560
+ "bodyFlags": [],
561
+ "hasBody": false,
562
+ "bodyRequired": false,
563
+ "bodyTypes": [],
564
+ "secretBody": false,
565
+ "raw": false,
566
+ "summary": "The runs waiting and held, the live runners and the recent hand-backs"
567
+ },
568
+ {
569
+ "command": [
570
+ "cli-learning",
571
+ "complete"
572
+ ],
573
+ "operationId": "completeCliLearningRun",
574
+ "method": "POST",
575
+ "path": "/cli-learning/runs/{run_id}/complete",
576
+ "pathParams": [
577
+ "run_id"
578
+ ],
579
+ "multiSegment": [],
580
+ "query": [],
581
+ "headers": [
582
+ {
583
+ "name": "Idempotency-Key",
584
+ "type": "string",
585
+ "required": false,
586
+ "description": ""
587
+ }
588
+ ],
589
+ "bodyFlags": [
590
+ {
591
+ "name": "status",
592
+ "type": "string",
593
+ "enum": [
594
+ "completed",
595
+ "failed",
596
+ "cancelled"
597
+ ],
598
+ "required": true,
599
+ "description": ""
600
+ },
601
+ {
602
+ "name": "answer",
603
+ "type": "string",
604
+ "required": true,
605
+ "description": ""
606
+ },
607
+ {
608
+ "name": "error",
609
+ "type": "string",
610
+ "required": false,
611
+ "description": ""
612
+ },
613
+ {
614
+ "name": "model",
615
+ "type": "string",
616
+ "required": false,
617
+ "description": ""
618
+ },
619
+ {
620
+ "name": "session_id",
621
+ "type": "string",
622
+ "required": false,
623
+ "description": ""
624
+ },
625
+ {
626
+ "name": "evidence_complete",
627
+ "type": "boolean",
628
+ "required": false,
629
+ "description": ""
630
+ },
631
+ {
632
+ "name": "seed_observed",
633
+ "type": "boolean",
634
+ "required": false,
635
+ "description": ""
636
+ },
637
+ {
638
+ "name": "seed_revision",
639
+ "type": "string",
640
+ "required": false,
641
+ "description": ""
642
+ }
643
+ ],
644
+ "hasBody": true,
645
+ "bodyRequired": true,
646
+ "bodyTypes": [
647
+ "application/json"
648
+ ],
649
+ "secretBody": false,
650
+ "raw": false,
651
+ "summary": "Close an existing CLI prompt window exactly once"
652
+ },
653
+ {
654
+ "command": [
655
+ "cli-learning",
656
+ "enroll"
657
+ ],
658
+ "operationId": "enrollCliLearning",
659
+ "method": "POST",
660
+ "path": "/cli-learning/connections",
661
+ "pathParams": [],
662
+ "multiSegment": [],
663
+ "query": [],
664
+ "headers": [],
665
+ "bodyFlags": [
666
+ {
667
+ "name": "runtime",
668
+ "type": "string",
669
+ "enum": [
670
+ "codex",
671
+ "claude-code"
672
+ ],
673
+ "required": true,
674
+ "description": ""
675
+ },
676
+ {
677
+ "name": "project",
678
+ "type": "string",
679
+ "required": true,
680
+ "description": ""
681
+ },
682
+ {
683
+ "name": "name",
684
+ "type": "string",
685
+ "required": false,
686
+ "description": ""
687
+ }
688
+ ],
689
+ "hasBody": true,
690
+ "bodyRequired": true,
691
+ "bodyTypes": [
692
+ "application/json"
693
+ ],
694
+ "secretBody": false,
695
+ "raw": false,
696
+ "summary": "Enable learning for an existing local CLI without launching it"
697
+ },
698
+ {
699
+ "command": [
700
+ "cli-learning",
701
+ "events"
702
+ ],
703
+ "operationId": "cliLearningEvents",
704
+ "method": "POST",
705
+ "path": "/cli-learning/runs/{run_id}/events",
706
+ "pathParams": [
707
+ "run_id"
708
+ ],
709
+ "multiSegment": [],
710
+ "query": [],
711
+ "headers": [
712
+ {
713
+ "name": "Idempotency-Key",
714
+ "type": "string",
715
+ "required": false,
716
+ "description": ""
717
+ }
718
+ ],
719
+ "bodyFlags": [
720
+ {
721
+ "name": "sequence",
722
+ "type": "integer",
723
+ "required": true,
724
+ "description": ""
725
+ }
726
+ ],
727
+ "hasBody": true,
728
+ "bodyRequired": true,
729
+ "bodyTypes": [
730
+ "application/json"
731
+ ],
732
+ "secretBody": false,
733
+ "raw": false,
734
+ "summary": "Upload bounded role-preserving CLI dialogue and tool evidence"
735
+ },
736
+ {
737
+ "command": [
738
+ "cli-learning",
739
+ "get"
740
+ ],
741
+ "operationId": "getCliLearningRun",
742
+ "method": "GET",
743
+ "path": "/cli-learning/runs/{run_id}",
744
+ "pathParams": [
745
+ "run_id"
746
+ ],
747
+ "multiSegment": [],
748
+ "query": [],
749
+ "headers": [],
750
+ "bodyFlags": [],
751
+ "hasBody": false,
752
+ "bodyRequired": false,
753
+ "bodyTypes": [],
754
+ "secretBody": false,
755
+ "raw": false,
756
+ "summary": "Read CLI prompt-window learning progress"
757
+ },
758
+ {
759
+ "command": [
760
+ "cli-learning",
761
+ "list"
762
+ ],
763
+ "operationId": "listCliLearning",
764
+ "method": "GET",
765
+ "path": "/cli-learning/connections",
766
+ "pathParams": [],
767
+ "multiSegment": [],
768
+ "query": [],
769
+ "headers": [],
770
+ "bodyFlags": [],
771
+ "hasBody": false,
772
+ "bodyRequired": false,
773
+ "bodyTypes": [],
774
+ "secretBody": false,
775
+ "raw": false,
776
+ "summary": "Read enrolled CLI learning connections"
777
+ },
778
+ {
779
+ "command": [
780
+ "cli-learning",
781
+ "revoke"
782
+ ],
783
+ "operationId": "revokeCliLearning",
784
+ "method": "DELETE",
785
+ "path": "/cli-learning/connections/{connection_id}",
786
+ "pathParams": [
787
+ "connection_id"
788
+ ],
789
+ "multiSegment": [],
790
+ "query": [],
791
+ "headers": [],
792
+ "bodyFlags": [],
793
+ "hasBody": false,
794
+ "bodyRequired": false,
795
+ "bodyTypes": [],
796
+ "secretBody": false,
797
+ "raw": false,
798
+ "summary": "Revoke CLI capture and guidance delivery, retaining history and learned files"
799
+ },
800
+ {
801
+ "command": [
802
+ "cli-learning",
803
+ "start"
804
+ ],
805
+ "operationId": "startCliLearningRun",
806
+ "method": "POST",
807
+ "path": "/cli-learning/connections/{connection_id}/runs",
808
+ "pathParams": [
809
+ "connection_id"
810
+ ],
811
+ "multiSegment": [],
812
+ "query": [],
813
+ "headers": [
814
+ {
815
+ "name": "Idempotency-Key",
816
+ "type": "string",
817
+ "required": true,
818
+ "description": ""
819
+ }
820
+ ],
821
+ "bodyFlags": [
822
+ {
823
+ "name": "session_id",
824
+ "type": "string",
825
+ "required": true,
826
+ "description": ""
827
+ },
828
+ {
829
+ "name": "turn_id",
830
+ "type": "string",
831
+ "required": true,
832
+ "description": ""
833
+ },
834
+ {
835
+ "name": "input",
836
+ "type": "string",
837
+ "required": true,
838
+ "description": ""
839
+ },
840
+ {
841
+ "name": "instructions",
842
+ "type": "string",
843
+ "required": true,
844
+ "description": ""
845
+ },
846
+ {
847
+ "name": "policy_complete",
848
+ "type": "boolean",
849
+ "required": true,
850
+ "description": ""
851
+ },
852
+ {
853
+ "name": "model",
854
+ "type": "string",
855
+ "required": false,
856
+ "description": ""
857
+ }
858
+ ],
859
+ "hasBody": true,
860
+ "bodyRequired": true,
861
+ "bodyTypes": [
862
+ "application/json"
863
+ ],
864
+ "secretBody": false,
865
+ "raw": false,
866
+ "summary": "Register one prompt window from an existing CLI session"
867
+ },
541
868
  {
542
869
  "command": [
543
870
  "connectors",
@@ -3095,7 +3422,8 @@ export const COMMANDS = [
3095
3422
  "enum": [
3096
3423
  "claude-agent-sdk",
3097
3424
  "codex-sdk",
3098
- "eve"
3425
+ "eve",
3426
+ "external"
3099
3427
  ],
3100
3428
  "required": true,
3101
3429
  "description": ""
@@ -3117,6 +3445,12 @@ export const COMMANDS = [
3117
3445
  "type": "string",
3118
3446
  "required": false,
3119
3447
  "description": ""
3448
+ },
3449
+ {
3450
+ "name": "platform",
3451
+ "type": "string",
3452
+ "required": false,
3453
+ "description": "External source's display label, such as openclaw or capy. Preserved exactly; no surrounding whitespace, controls or lone surrogates. Never selects a managed harness or workflow capability."
3120
3454
  }
3121
3455
  ],
3122
3456
  "hasBody": true,
@@ -3329,7 +3663,7 @@ export const COMMANDS = [
3329
3663
  "name": "agent",
3330
3664
  "type": "string",
3331
3665
  "required": false,
3332
- "description": "One agent's runs."
3666
+ "description": "One agent's runs and associated source usage, or a connected session id to select that session's usage (with no recorded runs)."
3333
3667
  }
3334
3668
  ],
3335
3669
  "headers": [],
package/lib/start.mjs CHANGED
@@ -233,7 +233,7 @@ export function npmExecOf(env, from = process.ppid) {
233
233
 
234
234
  export const USAGE = `Usage: npx @parcha/agentrun [--port N] [--data DIR] [--no-open] [--public-url URL] start the server
235
235
  (--public-url: the https address people open it at, through a proxy such as tailscale serve)
236
- npx @parcha/agentrun import|reset-password|runner|native [--data DIR] a server command (native: discover/connect an existing project)
236
+ npx @parcha/agentrun import|reset-password|runner|native|learning [--data DIR] a server command (native: discover/connect an existing project)
237
237
  npx @parcha/agentrun <command> [args] the server's API: agents, runs, triggers, ..., api (npx @parcha/agentrun help)`;
238
238
 
239
239
  /** The server's launcher, installed with this package (its dependency), or undefined. */
@@ -265,7 +265,7 @@ const inCi = (env) => Boolean(env.CI) && env.CI !== "false" && env.CI !== "0";
265
265
 
266
266
  /** The server's own commands (its CLI's first word), which this command runs on its store: every other first word is
267
267
  * the CLI's, which names a command it has or says it has none. */
268
- export const SERVER_COMMANDS = ["check-harness", "eval-template", "import", "install-harness", "native", "remote-bridge", "reset-password", "runner", "validate-template"];
268
+ export const SERVER_COMMANDS = ["check-harness", "eval-template", "import", "install-harness", "learning", "native", "remote-bridge", "reset-password", "runner", "store-schema", "validate-template"];
269
269
 
270
270
  /** How many of the server's refusals and ignored deliveries a start says, each route and reason once, before one line
271
271
  * that says the rest are not: under this command the server's log goes nowhere else (its stdout is read here and dropped). */
@@ -317,7 +317,10 @@ export async function main(argv, env = process.env) {
317
317
  // The first argument, past --data and its value: a word there names a command (the server's own, or else the CLI's),
318
318
  // and a flag starts the server, whose flags with values (--listen ADDR) follow.
319
319
  const first = argv.find((arg, i) => arg !== "--data" && !arg.startsWith("--data=") && argv[i - 1] !== "--data");
320
- if (NOUNS.has(words(argv)[0]) || (first !== undefined && !first.startsWith("-") && !SERVER_COMMANDS.includes(first))) return cli(argv, env);
320
+ const commandWords = words(argv);
321
+ // Learning also names API verbs. Only project-hook lifecycle verbs belong to the local server CLI.
322
+ const localLearning = commandWords[0] === "learning" && ["connect", "status", "disconnect", "retry", "hook"].includes(commandWords[1]);
323
+ if ((!localLearning && NOUNS.has(commandWords[0])) || (first !== undefined && !first.startsWith("-") && !SERVER_COMMANDS.includes(first))) return cli(argv, env);
321
324
  // --help is this command's usage when it starts the server; a server command's --help is that command's, which the
322
325
  // server prints (import --help names --from and --dry-run). remote-bridge, the connector's own process, has no usage of
323
326
  // its own to print and never reads --help, so it keeps this one.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@parcha/agentrun",
3
- "version": "0.4.17",
3
+ "version": "0.4.19",
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",
@@ -17,7 +17,7 @@
17
17
  "NOTICE"
18
18
  ],
19
19
  "dependencies": {
20
- "@parcha/agentrun-serve": "0.1.0-beta.49"
20
+ "@parcha/agentrun-serve": "0.1.0-beta.51"
21
21
  },
22
22
  "scripts": {
23
23
  "test": "node --test 'test/*.test.mjs'"
@@ -132,6 +132,8 @@ Two clients call the same API from code, with the same server and token. `@parch
132
132
  ## Commands
133
133
 
134
134
  - `agentrun agents`: archive, connect-native, create, delete-agent, delete-agent-archil, disconnect-native, discover-native, forget-sign-in, get, get-agent-archil, get-learning-loop, get-native, list, list-learning-audits, list-learning-promotions, runs, unarchive, update, verify-native
135
+ - `agentrun capabilities`: get-capacity
136
+ - `agentrun cli-learning`: complete, enroll, events, get, list, revoke, start
135
137
  - `agentrun connectors`: complete-remote-command, enroll-remote-connector, import-remote-history, import-remote-target, list-remote-connectors, poll-remote-connector, register-remote-connector, remote-command-events, revoke-remote-connector
136
138
  - `agentrun doctor`: Check how this AgentRun is set up (Node, the server, its service, address, password, models, switches, Docker) and print what to change; read-only (exit 0 ok or warnings, 1 a check failed, 3 no server answering)
137
139
  - `agentrun files`: create, delete, get, list, upload
@@ -150,6 +150,93 @@ Check native CLI and sign-in without a paid model call.
150
150
 
151
151
  Route: `POST /agents/{agent_id}/native/verify`.
152
152
 
153
+ ## capabilities
154
+
155
+ ### `agentrun capabilities get-capacity`
156
+
157
+ The runs waiting and held, the live runners and the recent hand-backs.
158
+
159
+ Route: `GET /capacity`.
160
+
161
+ - `--window INTEGER` (integer): The hand-back window in minutes, from 1 to 1440. Default 15.
162
+
163
+ ## cli-learning
164
+
165
+ ### `agentrun cli-learning complete RUN_ID`
166
+
167
+ Close an existing CLI prompt window exactly once.
168
+
169
+ Route: `POST /cli-learning/runs/{run_id}/complete`.
170
+
171
+ - `--idempotency-key STRING` (string)
172
+ - `--status completed|failed|cancelled` (string, one of these, required)
173
+ - `--answer STRING` (string, required)
174
+ - `--error STRING` (string)
175
+ - `--model STRING` (string)
176
+ - `--session-id STRING` (string)
177
+ - `--evidence-complete` (boolean)
178
+ - `--seed-observed` (boolean)
179
+ - `--seed-revision STRING` (string)
180
+ - `--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.
181
+ - `--body-type TYPE` (string): The body's type, one of application/json; any other than JSON is sent as given.
182
+
183
+ ### `agentrun cli-learning enroll`
184
+
185
+ Enable learning for an existing local CLI without launching it.
186
+
187
+ Route: `POST /cli-learning/connections`.
188
+
189
+ - `--runtime codex|claude-code` (string, one of these, required)
190
+ - `--project STRING` (string, required)
191
+ - `--name STRING` (string)
192
+ - `--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.
193
+ - `--body-type TYPE` (string): The body's type, one of application/json; any other than JSON is sent as given.
194
+
195
+ ### `agentrun cli-learning events RUN_ID`
196
+
197
+ Upload bounded role-preserving CLI dialogue and tool evidence.
198
+
199
+ Route: `POST /cli-learning/runs/{run_id}/events`.
200
+
201
+ - `--idempotency-key STRING` (string)
202
+ - `--sequence INTEGER` (integer, required)
203
+ - `--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.
204
+ - `--body-type TYPE` (string): The body's type, one of application/json; any other than JSON is sent as given.
205
+
206
+ ### `agentrun cli-learning get RUN_ID`
207
+
208
+ Read CLI prompt-window learning progress.
209
+
210
+ Route: `GET /cli-learning/runs/{run_id}`.
211
+
212
+ ### `agentrun cli-learning list`
213
+
214
+ Read enrolled CLI learning connections.
215
+
216
+ Route: `GET /cli-learning/connections`.
217
+
218
+ ### `agentrun cli-learning revoke CONNECTION_ID`
219
+
220
+ Revoke CLI capture and guidance delivery, retaining history and learned files.
221
+
222
+ Route: `DELETE /cli-learning/connections/{connection_id}`.
223
+
224
+ ### `agentrun cli-learning start CONNECTION_ID`
225
+
226
+ Register one prompt window from an existing CLI session.
227
+
228
+ Route: `POST /cli-learning/connections/{connection_id}/runs`.
229
+
230
+ - `--idempotency-key STRING` (string, required)
231
+ - `--session-id STRING` (string, required)
232
+ - `--turn-id STRING` (string, required)
233
+ - `--input STRING` (string, required)
234
+ - `--instructions STRING` (string, required)
235
+ - `--policy-complete` (boolean, required)
236
+ - `--model STRING` (string)
237
+ - `--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.
238
+ - `--body-type TYPE` (string): The body's type, one of application/json; any other than JSON is sent as given.
239
+
153
240
  ## connectors
154
241
 
155
242
  ### `agentrun connectors complete-remote-command CONNECTOR_ID COMMAND_ID`
@@ -930,10 +1017,11 @@ Register a task executed by an existing backend SDK.
930
1017
  Route: `POST /agents/{agent_id}/sdk-runs`.
931
1018
 
932
1019
  - `--idempotency-key STRING` (string, required)
933
- - `--runtime claude-agent-sdk|codex-sdk|eve` (string, one of these, required)
1020
+ - `--runtime claude-agent-sdk|codex-sdk|eve|external` (string, one of these, required)
934
1021
  - `--input STRING` (string, required)
935
1022
  - `--instructions STRING` (string, required)
936
1023
  - `--model STRING` (string)
1024
+ - `--platform STRING` (string): External source's display label, such as openclaw or capy. Preserved exactly; no surrounding whitespace, controls or lone surrogates. Never selects a managed harness or workflow capability.
937
1025
  - `--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.
938
1026
  - `--body-type TYPE` (string): The body's type, one of application/json; any other than JSON is sent as given.
939
1027
 
@@ -1078,7 +1166,7 @@ Route: `GET /stats`.
1078
1166
 
1079
1167
  - `--from STRING` (string): Runs started at or after this RFC 3339 date-time, to the millisecond (a finer fraction is a 400). Default no bound.
1080
1168
  - `--to STRING` (string): Runs started before this RFC 3339 date-time, to the millisecond (a finer fraction is a 400). Default no bound.
1081
- - `--agent STRING` (string): One agent's runs.
1169
+ - `--agent STRING` (string): One agent's runs and associated source usage, or a connected session id to select that session's usage (with no recorded runs).
1082
1170
 
1083
1171
  ## stop
1084
1172