@parcha/agentrun 0.4.12 → 0.4.13
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 +20 -5
- package/install.sh +314 -7
- package/lib/cli.mjs +4 -2
- package/lib/commands.generated.mjs +82 -276
- package/lib/harness.mjs +37 -0
- package/lib/service.mjs +34 -6
- package/lib/start.mjs +1 -1
- package/lib/tailscale.mjs +13 -10
- package/package.json +2 -2
- package/skills/agentrun-cli/SKILL.md +6 -5
- package/skills/agentrun-cli/references/commands.md +55 -91
|
@@ -77,7 +77,7 @@ export const COMMANDS = [
|
|
|
77
77
|
"name": "Idempotency-Key",
|
|
78
78
|
"type": "string",
|
|
79
79
|
"required": false,
|
|
80
|
-
"description": "Makes a create safe to retry. The same key and body within `limits.idempotency_ttl_s` replays the first"
|
|
80
|
+
"description": "Makes a create safe to retry. The same key and body within `limits.idempotency_ttl_s` replays the first answer with `Idempotent-Replayed: true`; another body is `409 idempotency_mismatch`; a retry while the first is in flight is `409 idempotency_in_progress`. Keys are scoped to the credential's account and the route."
|
|
81
81
|
}
|
|
82
82
|
],
|
|
83
83
|
"bodyFlags": [
|
|
@@ -108,6 +108,28 @@ export const COMMANDS = [
|
|
|
108
108
|
"raw": false,
|
|
109
109
|
"summary": "Create an agent home"
|
|
110
110
|
},
|
|
111
|
+
{
|
|
112
|
+
"command": [
|
|
113
|
+
"agents",
|
|
114
|
+
"delete-agent"
|
|
115
|
+
],
|
|
116
|
+
"operationId": "deleteAgent",
|
|
117
|
+
"method": "DELETE",
|
|
118
|
+
"path": "/agents/{agent_id}",
|
|
119
|
+
"pathParams": [
|
|
120
|
+
"agent_id"
|
|
121
|
+
],
|
|
122
|
+
"multiSegment": [],
|
|
123
|
+
"query": [],
|
|
124
|
+
"headers": [],
|
|
125
|
+
"bodyFlags": [],
|
|
126
|
+
"hasBody": false,
|
|
127
|
+
"bodyRequired": false,
|
|
128
|
+
"bodyTypes": [],
|
|
129
|
+
"secretBody": false,
|
|
130
|
+
"raw": false,
|
|
131
|
+
"summary": "Delete an agent another system owns"
|
|
132
|
+
},
|
|
111
133
|
{
|
|
112
134
|
"command": [
|
|
113
135
|
"agents",
|
|
@@ -838,7 +860,7 @@ export const COMMANDS = [
|
|
|
838
860
|
"name": "Idempotency-Key",
|
|
839
861
|
"type": "string",
|
|
840
862
|
"required": false,
|
|
841
|
-
"description": "Makes a create safe to retry. The same key and body within `limits.idempotency_ttl_s` replays the first"
|
|
863
|
+
"description": "Makes a create safe to retry. The same key and body within `limits.idempotency_ttl_s` replays the first answer with `Idempotent-Replayed: true`; another body is `409 idempotency_mismatch`; a retry while the first is in flight is `409 idempotency_in_progress`. Keys are scoped to the credential's account and the route."
|
|
842
864
|
}
|
|
843
865
|
],
|
|
844
866
|
"bodyFlags": [
|
|
@@ -1071,106 +1093,11 @@ export const COMMANDS = [
|
|
|
1071
1093
|
{
|
|
1072
1094
|
"command": [
|
|
1073
1095
|
"learning",
|
|
1074
|
-
"
|
|
1096
|
+
"corrections"
|
|
1075
1097
|
],
|
|
1076
|
-
"operationId": "
|
|
1098
|
+
"operationId": "getLearningCorrections",
|
|
1077
1099
|
"method": "GET",
|
|
1078
|
-
"path": "/agents/{agent_id}/learning/
|
|
1079
|
-
"pathParams": [
|
|
1080
|
-
"agent_id",
|
|
1081
|
-
"batch_id"
|
|
1082
|
-
],
|
|
1083
|
-
"multiSegment": [],
|
|
1084
|
-
"query": [],
|
|
1085
|
-
"headers": [],
|
|
1086
|
-
"bodyFlags": [],
|
|
1087
|
-
"hasBody": false,
|
|
1088
|
-
"bodyRequired": false,
|
|
1089
|
-
"bodyTypes": [],
|
|
1090
|
-
"secretBody": false,
|
|
1091
|
-
"raw": false,
|
|
1092
|
-
"summary": "A learning batch's progress: rows done, right or wrong, lessons, workflow revisions, cost, the path each run took"
|
|
1093
|
-
},
|
|
1094
|
-
{
|
|
1095
|
-
"command": [
|
|
1096
|
-
"learning",
|
|
1097
|
-
"batch-cancel"
|
|
1098
|
-
],
|
|
1099
|
-
"operationId": "cancelLearningBatch",
|
|
1100
|
-
"method": "POST",
|
|
1101
|
-
"path": "/agents/{agent_id}/learning/batches/{batch_id}/cancel",
|
|
1102
|
-
"pathParams": [
|
|
1103
|
-
"agent_id",
|
|
1104
|
-
"batch_id"
|
|
1105
|
-
],
|
|
1106
|
-
"multiSegment": [],
|
|
1107
|
-
"query": [],
|
|
1108
|
-
"headers": [],
|
|
1109
|
-
"bodyFlags": [],
|
|
1110
|
-
"hasBody": false,
|
|
1111
|
-
"bodyRequired": false,
|
|
1112
|
-
"bodyTypes": [],
|
|
1113
|
-
"secretBody": false,
|
|
1114
|
-
"raw": false,
|
|
1115
|
-
"summary": "Cancel a running learning batch"
|
|
1116
|
-
},
|
|
1117
|
-
{
|
|
1118
|
-
"command": [
|
|
1119
|
-
"learning",
|
|
1120
|
-
"batch-start"
|
|
1121
|
-
],
|
|
1122
|
-
"operationId": "createLearningBatch",
|
|
1123
|
-
"method": "POST",
|
|
1124
|
-
"path": "/agents/{agent_id}/learning/batches",
|
|
1125
|
-
"pathParams": [
|
|
1126
|
-
"agent_id"
|
|
1127
|
-
],
|
|
1128
|
-
"multiSegment": [],
|
|
1129
|
-
"query": [],
|
|
1130
|
-
"headers": [],
|
|
1131
|
-
"bodyFlags": [
|
|
1132
|
-
{
|
|
1133
|
-
"name": "answer",
|
|
1134
|
-
"type": "string",
|
|
1135
|
-
"required": true,
|
|
1136
|
-
"description": "The column holding the reference answer."
|
|
1137
|
-
},
|
|
1138
|
-
{
|
|
1139
|
-
"name": "max_cost_usd",
|
|
1140
|
-
"type": "number",
|
|
1141
|
-
"required": true,
|
|
1142
|
-
"description": "Caps what the batch's runs spend (job, look-back, review turn); grades are booked and shown, uncapped."
|
|
1143
|
-
},
|
|
1144
|
-
{
|
|
1145
|
-
"name": "answer_field",
|
|
1146
|
-
"type": "string",
|
|
1147
|
-
"required": false,
|
|
1148
|
-
"description": "A dotted path into a JSON answer to compare, such as result.code; absent: the whole answer."
|
|
1149
|
-
},
|
|
1150
|
-
{
|
|
1151
|
-
"name": "effort",
|
|
1152
|
-
"type": "string",
|
|
1153
|
-
"required": false,
|
|
1154
|
-
"description": "The runs' effort, as a run's."
|
|
1155
|
-
}
|
|
1156
|
-
],
|
|
1157
|
-
"hasBody": true,
|
|
1158
|
-
"bodyRequired": true,
|
|
1159
|
-
"bodyTypes": [
|
|
1160
|
-
"application/json"
|
|
1161
|
-
],
|
|
1162
|
-
"secretBody": false,
|
|
1163
|
-
"raw": false,
|
|
1164
|
-
"summary": "Learn from rows: run the agent on each in order, with learning on, and tell it the reference answer after each"
|
|
1165
|
-
},
|
|
1166
|
-
{
|
|
1167
|
-
"command": [
|
|
1168
|
-
"learning",
|
|
1169
|
-
"batches"
|
|
1170
|
-
],
|
|
1171
|
-
"operationId": "listLearningBatches",
|
|
1172
|
-
"method": "GET",
|
|
1173
|
-
"path": "/agents/{agent_id}/learning/batches",
|
|
1100
|
+
"path": "/agents/{agent_id}/learning/corrections",
|
|
1174
1101
|
"pathParams": [
|
|
1175
1102
|
"agent_id"
|
|
1176
1103
|
],
|
|
@@ -1183,7 +1110,7 @@ export const COMMANDS = [
|
|
|
1183
1110
|
"bodyTypes": [],
|
|
1184
1111
|
"secretBody": false,
|
|
1185
1112
|
"raw": false,
|
|
1186
|
-
"summary": "The agent's
|
|
1113
|
+
"summary": "The agent's corrections.md on main, with its ETag"
|
|
1187
1114
|
},
|
|
1188
1115
|
{
|
|
1189
1116
|
"command": [
|
|
@@ -1212,7 +1139,7 @@ export const COMMANDS = [
|
|
|
1212
1139
|
"csv"
|
|
1213
1140
|
],
|
|
1214
1141
|
"required": false,
|
|
1215
|
-
"description": "`csv`: the runs as CSV, columns n, run_id, started_at, path, workflow,
|
|
1142
|
+
"description": "`csv`: the runs as CSV, columns n, run_id, started_at, path, workflow, digest, audited, cost_usd, cost_upper_bound, learning_usd, total_usd."
|
|
1216
1143
|
}
|
|
1217
1144
|
],
|
|
1218
1145
|
"headers": [],
|
|
@@ -1224,28 +1151,6 @@ export const COMMANDS = [
|
|
|
1224
1151
|
"raw": false,
|
|
1225
1152
|
"summary": "The agent's cost per run, run after run: its own cost, what learning added and the path it took"
|
|
1226
1153
|
},
|
|
1227
|
-
{
|
|
1228
|
-
"command": [
|
|
1229
|
-
"learning",
|
|
1230
|
-
"evals"
|
|
1231
|
-
],
|
|
1232
|
-
"operationId": "listLearningEvals",
|
|
1233
|
-
"method": "GET",
|
|
1234
|
-
"path": "/agents/{agent_id}/learning/evals",
|
|
1235
|
-
"pathParams": [
|
|
1236
|
-
"agent_id"
|
|
1237
|
-
],
|
|
1238
|
-
"multiSegment": [],
|
|
1239
|
-
"query": [],
|
|
1240
|
-
"headers": [],
|
|
1241
|
-
"bodyFlags": [],
|
|
1242
|
-
"hasBody": false,
|
|
1243
|
-
"bodyRequired": false,
|
|
1244
|
-
"bodyTypes": [],
|
|
1245
|
-
"secretBody": false,
|
|
1246
|
-
"raw": false,
|
|
1247
|
-
"summary": "The agent's eval records: the latest, and every one kept, newest first"
|
|
1248
|
-
},
|
|
1249
1154
|
{
|
|
1250
1155
|
"command": [
|
|
1251
1156
|
"learning",
|
|
@@ -1266,7 +1171,7 @@ export const COMMANDS = [
|
|
|
1266
1171
|
"bodyTypes": [],
|
|
1267
1172
|
"secretBody": false,
|
|
1268
1173
|
"raw": false,
|
|
1269
|
-
"summary": "What the agent has learned: its
|
|
1174
|
+
"summary": "What the agent has learned: its corrections, workflow drafts, log of changes and counts"
|
|
1270
1175
|
},
|
|
1271
1176
|
{
|
|
1272
1177
|
"command": [
|
|
@@ -1303,53 +1208,6 @@ export const COMMANDS = [
|
|
|
1303
1208
|
"raw": false,
|
|
1304
1209
|
"summary": "A page of the changes on the agent's main, newest first"
|
|
1305
1210
|
},
|
|
1306
|
-
{
|
|
1307
|
-
"command": [
|
|
1308
|
-
"learning",
|
|
1309
|
-
"notes"
|
|
1310
|
-
],
|
|
1311
|
-
"operationId": "listLearningNotes",
|
|
1312
|
-
"method": "GET",
|
|
1313
|
-
"path": "/agents/{agent_id}/learning/notes",
|
|
1314
|
-
"pathParams": [
|
|
1315
|
-
"agent_id"
|
|
1316
|
-
],
|
|
1317
|
-
"multiSegment": [],
|
|
1318
|
-
"query": [
|
|
1319
|
-
{
|
|
1320
|
-
"name": "cursor",
|
|
1321
|
-
"type": "string",
|
|
1322
|
-
"required": false,
|
|
1323
|
-
"description": "`next_cursor` from the previous page: opaque, read at the commit the first page was."
|
|
1324
|
-
},
|
|
1325
|
-
{
|
|
1326
|
-
"name": "limit",
|
|
1327
|
-
"type": "integer",
|
|
1328
|
-
"required": false,
|
|
1329
|
-
"description": "At most 200."
|
|
1330
|
-
},
|
|
1331
|
-
{
|
|
1332
|
-
"name": "status",
|
|
1333
|
-
"type": "string",
|
|
1334
|
-
"enum": [
|
|
1335
|
-
"active",
|
|
1336
|
-
"superseded",
|
|
1337
|
-
"retired",
|
|
1338
|
-
"pending"
|
|
1339
|
-
],
|
|
1340
|
-
"required": false,
|
|
1341
|
-
"description": "Only notes with this status."
|
|
1342
|
-
}
|
|
1343
|
-
],
|
|
1344
|
-
"headers": [],
|
|
1345
|
-
"bodyFlags": [],
|
|
1346
|
-
"hasBody": false,
|
|
1347
|
-
"bodyRequired": false,
|
|
1348
|
-
"bodyTypes": [],
|
|
1349
|
-
"secretBody": false,
|
|
1350
|
-
"raw": false,
|
|
1351
|
-
"summary": "A page of the agent's notes"
|
|
1352
|
-
},
|
|
1353
1211
|
{
|
|
1354
1212
|
"command": [
|
|
1355
1213
|
"learning",
|
|
@@ -1371,81 +1229,7 @@ export const COMMANDS = [
|
|
|
1371
1229
|
"bodyTypes": [],
|
|
1372
1230
|
"secretBody": false,
|
|
1373
1231
|
"raw": false,
|
|
1374
|
-
"summary": "One
|
|
1375
|
-
},
|
|
1376
|
-
{
|
|
1377
|
-
"command": [
|
|
1378
|
-
"learning",
|
|
1379
|
-
"record-eval"
|
|
1380
|
-
],
|
|
1381
|
-
"operationId": "recordLearningEval",
|
|
1382
|
-
"method": "POST",
|
|
1383
|
-
"path": "/agents/{agent_id}/learning/evals",
|
|
1384
|
-
"pathParams": [
|
|
1385
|
-
"agent_id"
|
|
1386
|
-
],
|
|
1387
|
-
"multiSegment": [],
|
|
1388
|
-
"query": [],
|
|
1389
|
-
"headers": [
|
|
1390
|
-
{
|
|
1391
|
-
"name": "Idempotency-Key",
|
|
1392
|
-
"type": "string",
|
|
1393
|
-
"required": false,
|
|
1394
|
-
"description": "Makes a create safe to retry. The same key and body within `limits.idempotency_ttl_s` replays the first"
|
|
1395
|
-
}
|
|
1396
|
-
],
|
|
1397
|
-
"bodyFlags": [
|
|
1398
|
-
{
|
|
1399
|
-
"name": "name",
|
|
1400
|
-
"type": "string",
|
|
1401
|
-
"required": true,
|
|
1402
|
-
"description": "What ran the test, one line: a bench's name and set, a script's."
|
|
1403
|
-
},
|
|
1404
|
-
{
|
|
1405
|
-
"name": "n",
|
|
1406
|
-
"type": "integer",
|
|
1407
|
-
"required": true,
|
|
1408
|
-
"description": "The held-out jobs the test counted: jobs the agent never learned from."
|
|
1409
|
-
},
|
|
1410
|
-
{
|
|
1411
|
-
"name": "correct",
|
|
1412
|
-
"type": "integer",
|
|
1413
|
-
"required": true,
|
|
1414
|
-
"description": "How many of the `n` jobs the agent with what it learned got right: 0 to `n`."
|
|
1415
|
-
},
|
|
1416
|
-
{
|
|
1417
|
-
"name": "label_source",
|
|
1418
|
-
"type": "string",
|
|
1419
|
-
"required": false,
|
|
1420
|
-
"description": "Where the right answers came from, one line; null (or absent) when not said."
|
|
1421
|
-
},
|
|
1422
|
-
{
|
|
1423
|
-
"name": "cost_per_task_usd",
|
|
1424
|
-
"type": "number",
|
|
1425
|
-
"required": false,
|
|
1426
|
-
"description": "The agent with what it learned: its mean cost a task, in USD; null (or absent) when not counted."
|
|
1427
|
-
},
|
|
1428
|
-
{
|
|
1429
|
-
"name": "baseline_cost_per_task_usd",
|
|
1430
|
-
"type": "number",
|
|
1431
|
-
"required": false,
|
|
1432
|
-
"description": "The agent by hand (learning off): its mean cost a task, in USD; null (or absent) when not counted."
|
|
1433
|
-
},
|
|
1434
|
-
{
|
|
1435
|
-
"name": "learned_revision",
|
|
1436
|
-
"type": "string",
|
|
1437
|
-
"required": false,
|
|
1438
|
-
"description": "The learning folder's commit the test ran from; null (or absent) when not said."
|
|
1439
|
-
}
|
|
1440
|
-
],
|
|
1441
|
-
"hasBody": true,
|
|
1442
|
-
"bodyRequired": true,
|
|
1443
|
-
"bodyTypes": [
|
|
1444
|
-
"application/json"
|
|
1445
|
-
],
|
|
1446
|
-
"secretBody": false,
|
|
1447
|
-
"raw": false,
|
|
1448
|
-
"summary": "Record a held-out test of the agent: its counts and the cost a task, with learning and by hand"
|
|
1232
|
+
"summary": "One file of a learned workflow on main (its workflow.json or README.md), as text, with its ETag"
|
|
1449
1233
|
},
|
|
1450
1234
|
{
|
|
1451
1235
|
"command": [
|
|
@@ -1491,7 +1275,7 @@ export const COMMANDS = [
|
|
|
1491
1275
|
"name": "If-Match",
|
|
1492
1276
|
"type": "string",
|
|
1493
1277
|
"required": false,
|
|
1494
|
-
"description": "The
|
|
1278
|
+
"description": "The file's ETag, as a GET answered it: the write lands only on that version, else 412."
|
|
1495
1279
|
}
|
|
1496
1280
|
],
|
|
1497
1281
|
"bodyFlags": [],
|
|
@@ -1500,7 +1284,7 @@ export const COMMANDS = [
|
|
|
1500
1284
|
"bodyTypes": [],
|
|
1501
1285
|
"secretBody": false,
|
|
1502
1286
|
"raw": true,
|
|
1503
|
-
"summary": "Retire a
|
|
1287
|
+
"summary": "Retire a workflow draft: out of every later run, kept in history"
|
|
1504
1288
|
},
|
|
1505
1289
|
{
|
|
1506
1290
|
"command": [
|
|
@@ -1535,14 +1319,13 @@ export const COMMANDS = [
|
|
|
1535
1319
|
{
|
|
1536
1320
|
"command": [
|
|
1537
1321
|
"learning",
|
|
1538
|
-
"write"
|
|
1322
|
+
"write-corrections"
|
|
1539
1323
|
],
|
|
1540
|
-
"operationId": "
|
|
1324
|
+
"operationId": "putLearningCorrections",
|
|
1541
1325
|
"method": "PUT",
|
|
1542
|
-
"path": "/agents/{agent_id}/learning/
|
|
1326
|
+
"path": "/agents/{agent_id}/learning/corrections",
|
|
1543
1327
|
"pathParams": [
|
|
1544
|
-
"agent_id"
|
|
1545
|
-
"file"
|
|
1328
|
+
"agent_id"
|
|
1546
1329
|
],
|
|
1547
1330
|
"multiSegment": [],
|
|
1548
1331
|
"query": [],
|
|
@@ -1550,14 +1333,8 @@ export const COMMANDS = [
|
|
|
1550
1333
|
{
|
|
1551
1334
|
"name": "If-Match",
|
|
1552
1335
|
"type": "string",
|
|
1553
|
-
"required":
|
|
1554
|
-
"description": "The
|
|
1555
|
-
},
|
|
1556
|
-
{
|
|
1557
|
-
"name": "If-None-Match",
|
|
1558
|
-
"type": "string",
|
|
1559
|
-
"required": false,
|
|
1560
|
-
"description": "`*`: create the note, only if the name is not taken, else 412."
|
|
1336
|
+
"required": true,
|
|
1337
|
+
"description": "The file's ETag, as a GET answered it: the write lands only on that version, else 412."
|
|
1561
1338
|
}
|
|
1562
1339
|
],
|
|
1563
1340
|
"bodyFlags": [
|
|
@@ -1565,7 +1342,7 @@ export const COMMANDS = [
|
|
|
1565
1342
|
"name": "text",
|
|
1566
1343
|
"type": "string",
|
|
1567
1344
|
"required": true,
|
|
1568
|
-
"description": "
|
|
1345
|
+
"description": "corrections.md's whole text."
|
|
1569
1346
|
}
|
|
1570
1347
|
],
|
|
1571
1348
|
"hasBody": true,
|
|
@@ -1576,8 +1353,8 @@ export const COMMANDS = [
|
|
|
1576
1353
|
"application/json"
|
|
1577
1354
|
],
|
|
1578
1355
|
"secretBody": false,
|
|
1579
|
-
"raw":
|
|
1580
|
-
"summary": "
|
|
1356
|
+
"raw": false,
|
|
1357
|
+
"summary": "Replace the agent's corrections.md (If-Match)"
|
|
1581
1358
|
},
|
|
1582
1359
|
{
|
|
1583
1360
|
"command": [
|
|
@@ -2274,7 +2051,7 @@ export const COMMANDS = [
|
|
|
2274
2051
|
"name": "Idempotency-Key",
|
|
2275
2052
|
"type": "string",
|
|
2276
2053
|
"required": false,
|
|
2277
|
-
"description": "Makes a create safe to retry. The same key and body within `limits.idempotency_ttl_s` replays the first"
|
|
2054
|
+
"description": "Makes a create safe to retry. The same key and body within `limits.idempotency_ttl_s` replays the first answer with `Idempotent-Replayed: true`; another body is `409 idempotency_mismatch`; a retry while the first is in flight is `409 idempotency_in_progress`. Keys are scoped to the credential's account and the route."
|
|
2278
2055
|
}
|
|
2279
2056
|
],
|
|
2280
2057
|
"bodyFlags": [
|
|
@@ -2311,7 +2088,7 @@ export const COMMANDS = [
|
|
|
2311
2088
|
"name": "model_key",
|
|
2312
2089
|
"type": "string",
|
|
2313
2090
|
"required": false,
|
|
2314
|
-
"description": "The run's own model key: a key for the model gateway at AGENT_MODEL_BASE_URL, such as a LiteLLM virtual key minted for this run, which every model request tied to the run carries in place of the server's own key (its turns, its subagents, its learned workflows' nodes, a workflow's model nodes, its end-of-run
|
|
2091
|
+
"description": "The run's own model key: a key for the model gateway at AGENT_MODEL_BASE_URL, such as a LiteLLM virtual key minted for this run, which every model request tied to the run carries in place of the server's own key (its turns, its subagents, its learned workflows' nodes, a workflow's model nodes, its end-of-run compile turn). AgentRun never mints, lists or revokes it. Sealed into the run's launch bound to the gateway's origin, read at each claim (a reclaim after a crash among them), erased by the write that ends the run's turn; never in its saved body, its timeline, its view, a log or an Idempotency-Key's fingerprint (a retry with a new key answers the first request's run, its first key kept). The harness, its tools and its sandbox never see it. 422 at `model_key` when the run's model never goes to that gateway (no AGENT_MODEL_BASE_URL here, a native run, or a model routed elsewhere). Absent, the run spends on the server's key for its route; where the server holds none (no AGENT_MODEL_API_KEY, none saved in Settings), a start without it is 422 `model_key_required`, never a failure at its first model call."
|
|
2315
2092
|
},
|
|
2316
2093
|
{
|
|
2317
2094
|
"name": "workflow_first",
|
|
@@ -2326,7 +2103,7 @@ export const COMMANDS = [
|
|
|
2326
2103
|
"use"
|
|
2327
2104
|
],
|
|
2328
2105
|
"required": false,
|
|
2329
|
-
"description": "`use`: the run starts from what its agent learned (its
|
|
2106
|
+
"description": "`use`: the run starts from what its agent learned (its corrections and learned workflows, as a run that learns is given them), whatever its agent's `learning` says, and keeps nothing: no compile turn, no correction and no merge, at its end or after a follow-up. Its `learning` reads `seeded` while it runs, then `dropped` with reason `use`. So many runs of one agent read one learned state, frozen (a held-out evaluation). On a server whose learning is off it is given nothing, as every run there. Absent: the agent's own (`learning: true` learns). 422 not_an_option for anything else."
|
|
2330
2107
|
},
|
|
2331
2108
|
{
|
|
2332
2109
|
"name": "repo",
|
|
@@ -2658,7 +2435,7 @@ export const COMMANDS = [
|
|
|
2658
2435
|
"name": "Idempotency-Key",
|
|
2659
2436
|
"type": "string",
|
|
2660
2437
|
"required": false,
|
|
2661
|
-
"description": "Makes a create safe to retry. The same key and body within `limits.idempotency_ttl_s` replays the first"
|
|
2438
|
+
"description": "Makes a create safe to retry. The same key and body within `limits.idempotency_ttl_s` replays the first answer with `Idempotent-Replayed: true`; another body is `409 idempotency_mismatch`; a retry while the first is in flight is `409 idempotency_in_progress`. Keys are scoped to the credential's account and the route."
|
|
2662
2439
|
}
|
|
2663
2440
|
],
|
|
2664
2441
|
"bodyFlags": [
|
|
@@ -2672,7 +2449,7 @@ export const COMMANDS = [
|
|
|
2672
2449
|
"name": "model_key",
|
|
2673
2450
|
"type": "string",
|
|
2674
2451
|
"required": false,
|
|
2675
|
-
"description": "The run's own model key: a key for the model gateway at AGENT_MODEL_BASE_URL, such as a LiteLLM virtual key minted for this run, which every model request tied to the run carries in place of the server's own key (its turns, its subagents, its learned workflows' nodes, a workflow's model nodes, its end-of-run
|
|
2452
|
+
"description": "The run's own model key: a key for the model gateway at AGENT_MODEL_BASE_URL, such as a LiteLLM virtual key minted for this run, which every model request tied to the run carries in place of the server's own key (its turns, its subagents, its learned workflows' nodes, a workflow's model nodes, its end-of-run compile turn). AgentRun never mints, lists or revokes it. Sealed into the run's launch bound to the gateway's origin, read at each claim (a reclaim after a crash among them), erased by the write that ends the run's turn; never in its saved body, its timeline, its view, a log or an Idempotency-Key's fingerprint (a retry with a new key answers the first request's run, its first key kept). The harness, its tools and its sandbox never see it. 422 at `model_key` when the run's model never goes to that gateway (no AGENT_MODEL_BASE_URL here, a native run, or a model routed elsewhere). Absent, the run spends on the server's key for its route; where the server holds none (no AGENT_MODEL_API_KEY, none saved in Settings), a start without it is 422 `model_key_required`, never a failure at its first model call. On a message it replaces the run's key from the run's next model request on, a turn still going included, and it is the first key of a run that started on the server's (mint one per turn); a message without one keeps the key the run holds, which is none once its last turn ended: then, where the server holds no key for the run's model, the message is 422 `model_key_required` and nothing is written."
|
|
2676
2453
|
}
|
|
2677
2454
|
],
|
|
2678
2455
|
"hasBody": true,
|
|
@@ -2816,7 +2593,7 @@ export const COMMANDS = [
|
|
|
2816
2593
|
"name": "Idempotency-Key",
|
|
2817
2594
|
"type": "string",
|
|
2818
2595
|
"required": false,
|
|
2819
|
-
"description": "Makes a create safe to retry. The same key and body within `limits.idempotency_ttl_s` replays the first"
|
|
2596
|
+
"description": "Makes a create safe to retry. The same key and body within `limits.idempotency_ttl_s` replays the first answer with `Idempotent-Replayed: true`; another body is `409 idempotency_mismatch`; a retry while the first is in flight is `409 idempotency_in_progress`. Keys are scoped to the credential's account and the route."
|
|
2820
2597
|
}
|
|
2821
2598
|
],
|
|
2822
2599
|
"bodyFlags": [
|
|
@@ -2847,7 +2624,7 @@ export const COMMANDS = [
|
|
|
2847
2624
|
"name": "model_key",
|
|
2848
2625
|
"type": "string",
|
|
2849
2626
|
"required": false,
|
|
2850
|
-
"description": "The run's own model key: a key for the model gateway at AGENT_MODEL_BASE_URL, such as a LiteLLM virtual key minted for this run, which every model request tied to the run carries in place of the server's own key (its turns, its subagents, its learned workflows' nodes, a workflow's model nodes, its end-of-run
|
|
2627
|
+
"description": "The run's own model key: a key for the model gateway at AGENT_MODEL_BASE_URL, such as a LiteLLM virtual key minted for this run, which every model request tied to the run carries in place of the server's own key (its turns, its subagents, its learned workflows' nodes, a workflow's model nodes, its end-of-run compile turn). AgentRun never mints, lists or revokes it. Sealed into the run's launch bound to the gateway's origin, read at each claim (a reclaim after a crash among them), erased by the write that ends the run's turn; never in its saved body, its timeline, its view, a log or an Idempotency-Key's fingerprint (a retry with a new key answers the first request's run, its first key kept). The harness, its tools and its sandbox never see it. 422 at `model_key` when the run's model never goes to that gateway (no AGENT_MODEL_BASE_URL here, a native run, or a model routed elsewhere). Absent, the run spends on the server's key for its route; where the server holds none (no AGENT_MODEL_API_KEY, none saved in Settings), a start without it is 422 `model_key_required`, never a failure at its first model call."
|
|
2851
2628
|
},
|
|
2852
2629
|
{
|
|
2853
2630
|
"name": "workflow_first",
|
|
@@ -2862,7 +2639,7 @@ export const COMMANDS = [
|
|
|
2862
2639
|
"use"
|
|
2863
2640
|
],
|
|
2864
2641
|
"required": false,
|
|
2865
|
-
"description": "`use`: the run starts from what its agent learned (its
|
|
2642
|
+
"description": "`use`: the run starts from what its agent learned (its corrections and learned workflows, as a run that learns is given them), whatever its agent's `learning` says, and keeps nothing: no compile turn, no correction and no merge, at its end or after a follow-up. Its `learning` reads `seeded` while it runs, then `dropped` with reason `use`. So many runs of one agent read one learned state, frozen (a held-out evaluation). On a server whose learning is off it is given nothing, as every run there. Absent: the agent's own (`learning: true` learns). 422 not_an_option for anything else."
|
|
2866
2643
|
},
|
|
2867
2644
|
{
|
|
2868
2645
|
"name": "repo",
|
|
@@ -3025,6 +2802,28 @@ export const COMMANDS = [
|
|
|
3025
2802
|
"raw": false,
|
|
3026
2803
|
"summary": "The run's timeline, as a page or a stream"
|
|
3027
2804
|
},
|
|
2805
|
+
{
|
|
2806
|
+
"command": [
|
|
2807
|
+
"runs",
|
|
2808
|
+
"trace"
|
|
2809
|
+
],
|
|
2810
|
+
"operationId": "getRunTrace",
|
|
2811
|
+
"method": "GET",
|
|
2812
|
+
"path": "/runs/{run_id}/trace",
|
|
2813
|
+
"pathParams": [
|
|
2814
|
+
"run_id"
|
|
2815
|
+
],
|
|
2816
|
+
"multiSegment": [],
|
|
2817
|
+
"query": [],
|
|
2818
|
+
"headers": [],
|
|
2819
|
+
"bodyFlags": [],
|
|
2820
|
+
"hasBody": false,
|
|
2821
|
+
"bodyRequired": false,
|
|
2822
|
+
"bodyTypes": [],
|
|
2823
|
+
"secretBody": false,
|
|
2824
|
+
"raw": false,
|
|
2825
|
+
"summary": "A run's trace: each model request and tool call, with its time, tokens and cost"
|
|
2826
|
+
},
|
|
3028
2827
|
{
|
|
3029
2828
|
"command": [
|
|
3030
2829
|
"runs",
|
|
@@ -3389,10 +3188,17 @@ export const COMMANDS = [
|
|
|
3389
3188
|
"name": "Idempotency-Key",
|
|
3390
3189
|
"type": "string",
|
|
3391
3190
|
"required": false,
|
|
3392
|
-
"description": "Makes a create safe to retry. The same key and body within `limits.idempotency_ttl_s` replays the first"
|
|
3191
|
+
"description": "Makes a create safe to retry. The same key and body within `limits.idempotency_ttl_s` replays the first answer with `Idempotent-Replayed: true`; another body is `409 idempotency_mismatch`; a retry while the first is in flight is `409 idempotency_in_progress`. Keys are scoped to the credential's account and the route."
|
|
3192
|
+
}
|
|
3193
|
+
],
|
|
3194
|
+
"bodyFlags": [
|
|
3195
|
+
{
|
|
3196
|
+
"name": "agent_id",
|
|
3197
|
+
"type": "string",
|
|
3198
|
+
"required": false,
|
|
3199
|
+
"description": "An agent this package made here (GET /agents `template.id` is the package's id): the apply writes a new revision of it in place of making another, answered 200 with the same id. Its runs and its learning (corrections and workflows) stay. The parameters and grants are checked as a fresh apply checks them. Its triggers are reconciled by name: one of a name it has is changed in place (its id, a feed trigger's seen items, a webhook trigger's secret and whether it is on are kept; a `catchup_window_s` or `max_active_runs` the package leaves out goes back to its default, as a fresh apply makes it; a source the package leaves as it was is not rewritten, so a schedule keeps its next time, and an `every_s` one with no `start_at` the grid its first apply set), a new name is made, and one this package's apply made or kept that the package no longer lists is removed (a feed trigger whose feeds are left empty is not listed). Which triggers are the package's is kept on each trigger, never in an API body: one the owner made, one moved to the agent from another (or away and back), and one made before this was kept are never removed. A Composio trigger it removes (the package dropped it, or makes it again) goes at Composio first: one whose instance Composio does not delete is kept here as it was (on or off, the package's, its config sealed), and the next apply removes it; a dropped one is said in `warnings` under `triggers`, naming it and what is left at Composio. Such an unmarked trigger with a package trigger's name is adopted only when it can be changed in place (the same kind, and for a Composio trigger the same server, event and config), and is the package's from then on; one that would have to be made again, or one another package made, is 409 name_taken under `triggers.<i>.name` before anything is written: rename or delete it, then apply again. A trigger moved to another agent while the update runs is neither changed nor removed; its name is made anew. A Composio trigger it keeps keeps its sealed config when the package sends the same values; one whose server, event or config the package changes (another key too) is made again, as one whose source kind changed is: the old trigger and its Composio instance are removed first, and the new one is off where the owner turned the old one off. When Composio does not delete the old instance, the new one is not made, and the apply is 424 upstream_failed with the new revision standing and the old trigger kept as it was (remove the instance at Composio, or wait, and apply again: the old trigger's off carries to the new one). What the package owns and its new version leaves out (an input or answer schema, a checkout, a default cap, learning) is gone from the agent; what the host set (its harness, computer, sdk and native references) is kept. Updates of one agent run one after the other on a server, and each writes only onto the revision it read: one whose read went stale meanwhile (an edit, or an update elsewhere) is 412 precondition_failed, with nothing changed. An agent made otherwise, or from another package, is 422 under `agent_id`, saying which; an unknown id is 404; an archived agent is 409 agent_archived."
|
|
3393
3200
|
}
|
|
3394
3201
|
],
|
|
3395
|
-
"bodyFlags": [],
|
|
3396
3202
|
"hasBody": true,
|
|
3397
3203
|
"bodyRequired": true,
|
|
3398
3204
|
"bodyTypes": [
|
|
@@ -3563,7 +3369,7 @@ export const COMMANDS = [
|
|
|
3563
3369
|
"name": "Idempotency-Key",
|
|
3564
3370
|
"type": "string",
|
|
3565
3371
|
"required": false,
|
|
3566
|
-
"description": "Makes a create safe to retry. The same key and body within `limits.idempotency_ttl_s` replays the first"
|
|
3372
|
+
"description": "Makes a create safe to retry. The same key and body within `limits.idempotency_ttl_s` replays the first answer with `Idempotent-Replayed: true`; another body is `409 idempotency_mismatch`; a retry while the first is in flight is `409 idempotency_in_progress`. Keys are scoped to the credential's account and the route."
|
|
3567
3373
|
}
|
|
3568
3374
|
],
|
|
3569
3375
|
"bodyFlags": [
|
package/lib/harness.mjs
ADDED
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
// `agentrun harness install goose`: the harness its owner installs, never a run (Goose, the one there is). The server
|
|
2
|
+
// installed with this command does it (agentrun-serve install-harness), as it runs validate-template: the pinned archive
|
|
3
|
+
// downloaded, its sha256 checked, unpacked into DATA/harnesses/goose, the binary's sha256 checked, then put in place
|
|
4
|
+
// read-only. DATA is this command's (~/.agentrun unless --data names one), the store `npx @parcha/agentrun` starts the
|
|
5
|
+
// server on. Run again with the pinned binary in place, it downloads nothing. No provider key goes near it.
|
|
6
|
+
import { spawnSync } from "node:child_process";
|
|
7
|
+
import { homedir } from "node:os";
|
|
8
|
+
import { join, resolve } from "node:path";
|
|
9
|
+
|
|
10
|
+
/** The harnesses this command installs. */
|
|
11
|
+
const INSTALLABLE = ["goose"];
|
|
12
|
+
|
|
13
|
+
/** A variable named like a credential (a KEY, TOKEN, SECRET, PASSWORD or CREDENTIAL(S) segment). */
|
|
14
|
+
const KEY_NAMED = /(?:^|_)(?:KEY|TOKEN|TOKENS|SECRET|PASSWORD|CREDENTIALS?)(?:_|$)/i;
|
|
15
|
+
|
|
16
|
+
export const HARNESS_INSTALL = {
|
|
17
|
+
command: ["harness", "install"],
|
|
18
|
+
pathParams: ["harness"],
|
|
19
|
+
summary: "Install a harness AgentRun runs only once its owner installs it (goose), then restart AgentRun",
|
|
20
|
+
help: [
|
|
21
|
+
["HARNESS", `the harness: ${INSTALLABLE.join(", ")}. Its pinned release is downloaded and checked by sha256 into DATA/harnesses/HARNESS; run again, it downloads nothing`],
|
|
22
|
+
["--data DIR", "the data directory of the AgentRun it is for (default ~/.agentrun, where npx @parcha/agentrun keeps it)"],
|
|
23
|
+
],
|
|
24
|
+
options: {},
|
|
25
|
+
async run({ values, args, env, cli }) {
|
|
26
|
+
const [name] = args;
|
|
27
|
+
if (!INSTALLABLE.includes(name)) throw cli.fail(2, `agentrun harness install installs ${INSTALLABLE.join(", ")}, not ${name}: claude-agent and codex install on first use, and pi and opencode come with AgentRun.`);
|
|
28
|
+
// Loaded here: start.mjs loads cli.mjs, which loads this module.
|
|
29
|
+
const { installedServer } = await import("./start.mjs");
|
|
30
|
+
const launcher = installedServer();
|
|
31
|
+
if (launcher === undefined) throw cli.fail(2, "AgentRun's server is not installed beside this command, and it is the server that installs a harness.");
|
|
32
|
+
const data = resolve(values.data ?? join(env.HOME || homedir(), ".agentrun"));
|
|
33
|
+
// No key reaches the install: every variable named like one is left out of its environment.
|
|
34
|
+
const keyless = Object.fromEntries(Object.entries(env).filter(([key]) => !KEY_NAMED.test(key)));
|
|
35
|
+
return spawnSync(launcher, ["install-harness", name, "--data", data], { stdio: "inherit", env: keyless }).status ?? 1;
|
|
36
|
+
},
|
|
37
|
+
};
|