@parcha/agentrun-client 0.1.0-beta.33 → 0.1.0-beta.35
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 +6 -1
- package/dist/client.js +28 -0
- package/dist/http.d.ts +5 -1
- package/dist/http.js +17 -2
- package/dist/operations.generated.d.ts +81 -67
- package/dist/operations.generated.js +0 -11
- package/package.json +2 -2
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.
|
|
5
|
+
uses `fetch`, on Node.js 24.22.3 or newer.
|
|
6
6
|
|
|
7
7
|
## Install
|
|
8
8
|
|
|
@@ -59,6 +59,11 @@ const bytes = await client.runs.readFile(done.run_id, "notes.md"); // a Uint8Arr
|
|
|
59
59
|
const response = await client.runs.readFile(done.run_id, "notes.md", undefined, { stream: true }); // the Response, unread
|
|
60
60
|
```
|
|
61
61
|
|
|
62
|
+
With `{ stream: true }` a download resolves to a `Response` of the client's own: the server's status and headers on it
|
|
63
|
+
(its `url` is empty), its body unread. A read of that body that fails (the call's `timeoutMs` passes before the body
|
|
64
|
+
ends, or the body is cut before its length) rejects with `AgentRunUnreachable` and the failure's code, or with your
|
|
65
|
+
`signal`'s reason once you aborted, never the platform's own error. Nothing is tried again: what was read is yours.
|
|
66
|
+
|
|
62
67
|
`runs.follow` reads the route's event stream and resumes a dropped connection with `Last-Event-ID`, so no page comes twice.
|
|
63
68
|
Only the server's silence counts as a dropped connection (`idleMs`, default 45000), never the time your loop spends on a
|
|
64
69
|
page.
|
package/dist/client.js
CHANGED
|
@@ -123,6 +123,8 @@ export class AgentRun {
|
|
|
123
123
|
streamed: op.answer === "bytes" && options?.stream === true,
|
|
124
124
|
});
|
|
125
125
|
const answer = await readAnswer(op, route, response, options?.stream === true, secretOp ? scrubberOf(secrets) : undefined);
|
|
126
|
+
if (answer instanceof Response)
|
|
127
|
+
return guarded(answer, this.baseUrl, options?.signal);
|
|
126
128
|
return op.tagged ? { body: answer, etag: response.headers.get("etag") } : answer;
|
|
127
129
|
}
|
|
128
130
|
/** One request to the server with the key: tried again when it may be, its redirects followed only within the base
|
|
@@ -237,6 +239,32 @@ async function refusal(x, response, apiKey, late) {
|
|
|
237
239
|
return new AgentRunRefused(x.route, response.status, code, error, undefined, wait > 0 ? wait : undefined);
|
|
238
240
|
}
|
|
239
241
|
const badAnswer = (route, status, what) => new AgentRunRefused(route, status, "bad_answer", undefined, `The server's answer to ${route} is not ${what}.`);
|
|
242
|
+
/** A download's Response, asked to stream, with its body guarded: a read that fails (the call's timeout passes before
|
|
243
|
+
* the body ends, the body is cut before its length) rejects with AgentRunUnreachable and the failure's code, or with the
|
|
244
|
+
* caller's own reason once its signal aborted, never the platform's error. It is a Response of the client's own, the
|
|
245
|
+
* server's status and headers on it (its `url` is empty); nothing is tried again, since what was read is the caller's. */
|
|
246
|
+
function guarded(response, baseUrl, signal) {
|
|
247
|
+
const source = response.body;
|
|
248
|
+
if (source === null)
|
|
249
|
+
return response;
|
|
250
|
+
const reader = source.getReader();
|
|
251
|
+
const body = new ReadableStream({
|
|
252
|
+
async pull(controller) {
|
|
253
|
+
try {
|
|
254
|
+
const { done, value } = await reader.read();
|
|
255
|
+
if (done)
|
|
256
|
+
controller.close();
|
|
257
|
+
else
|
|
258
|
+
controller.enqueue(value);
|
|
259
|
+
}
|
|
260
|
+
catch (error) {
|
|
261
|
+
controller.error(signal?.aborted ? signal.reason : new AgentRunUnreachable(baseUrl, causeOf(error)));
|
|
262
|
+
}
|
|
263
|
+
},
|
|
264
|
+
cancel: (reason) => reader.cancel(reason),
|
|
265
|
+
});
|
|
266
|
+
return new Response(body, { status: response.status, statusText: response.statusText, headers: response.headers });
|
|
267
|
+
}
|
|
240
268
|
/** A success's body as the operation answers: JSON parsed (a secret body's values cut from it), text as a string, a
|
|
241
269
|
* file's bytes as they came, or the Response itself for a download asked to stream. */
|
|
242
270
|
async function readAnswer(op, route, response, stream, scrub) {
|
package/dist/http.d.ts
CHANGED
|
@@ -28,7 +28,11 @@ export declare const MAX_RETRY_AFTER_MS = 60000;
|
|
|
28
28
|
export declare const wholeMs: (ms: number) => number;
|
|
29
29
|
/** The wait before try `tries + 1`: doubling up to its cap, and never under the server's own (`floor`). */
|
|
30
30
|
export declare const backoff: (tries: number, floor?: number) => number;
|
|
31
|
-
/**
|
|
31
|
+
/**
|
|
32
|
+
* Waits `ms` by the wall clock (Date.now), or rejects with the signal's reason once it aborts. A timer can fire up to a
|
|
33
|
+
* millisecond before the wall clock says `ms` have passed (its loop clock counts whole milliseconds), so the rest is
|
|
34
|
+
* waited out: a server's Retry-After is never cut short.
|
|
35
|
+
*/
|
|
32
36
|
export declare function pause(ms: number, signal?: AbortSignal): Promise<void>;
|
|
33
37
|
/** A path argument checked and encoded: whole, or, for a file path, segment by segment. One that fetch or the server
|
|
34
38
|
* would read as another route (empty, `.`, `..`, plain or encoded, or an encoded slash in a file path) is refused. */
|
package/dist/http.js
CHANGED
|
@@ -14,13 +14,28 @@ const MAX_BACKOFF_MS = 30_000;
|
|
|
14
14
|
export const wholeMs = (ms) => Math.max(1, Math.ceil(ms));
|
|
15
15
|
/** The wait before try `tries + 1`: doubling up to its cap, and never under the server's own (`floor`). */
|
|
16
16
|
export const backoff = (tries, floor = 0) => Math.max(floor, Math.min(MAX_BACKOFF_MS, BACKOFF_MS * 2 ** (tries - 1)));
|
|
17
|
-
/**
|
|
17
|
+
/**
|
|
18
|
+
* Waits `ms` by the wall clock (Date.now), or rejects with the signal's reason once it aborts. A timer can fire up to a
|
|
19
|
+
* millisecond before the wall clock says `ms` have passed (its loop clock counts whole milliseconds), so the rest is
|
|
20
|
+
* waited out: a server's Retry-After is never cut short.
|
|
21
|
+
*/
|
|
18
22
|
export function pause(ms, signal) {
|
|
19
23
|
return new Promise((resolve, reject) => {
|
|
20
24
|
if (signal?.aborted)
|
|
21
25
|
return reject(signal.reason);
|
|
22
|
-
const
|
|
26
|
+
const until = Date.now() + wholeMs(ms);
|
|
27
|
+
let timer;
|
|
28
|
+
const arm = (left) => {
|
|
29
|
+
timer = setTimeout(() => {
|
|
30
|
+
const rest = until - Date.now();
|
|
31
|
+
if (rest > 0)
|
|
32
|
+
return arm(rest);
|
|
33
|
+
signal?.removeEventListener("abort", stop);
|
|
34
|
+
resolve();
|
|
35
|
+
}, left);
|
|
36
|
+
};
|
|
23
37
|
const stop = () => (clearTimeout(timer), reject(signal.reason));
|
|
38
|
+
arm(wholeMs(ms));
|
|
24
39
|
signal?.addEventListener("abort", stop, { once: true });
|
|
25
40
|
});
|
|
26
41
|
}
|
|
@@ -28,6 +28,11 @@ export type DefinitionInput = {
|
|
|
28
28
|
computer?: {
|
|
29
29
|
kind: "none" | "sandbox" | "desktop" | "phone" | "browser";
|
|
30
30
|
provider?: string;
|
|
31
|
+
image?: string;
|
|
32
|
+
gpu?: {
|
|
33
|
+
type: string;
|
|
34
|
+
count: number;
|
|
35
|
+
};
|
|
31
36
|
};
|
|
32
37
|
tool_settings?: {
|
|
33
38
|
read?: {
|
|
@@ -41,6 +46,7 @@ export type DefinitionInput = {
|
|
|
41
46
|
};
|
|
42
47
|
bash?: {
|
|
43
48
|
permission?: "allow" | "ask" | "deny";
|
|
49
|
+
policy?: "read-only";
|
|
44
50
|
};
|
|
45
51
|
ask_person?: {
|
|
46
52
|
permission?: "allow" | "deny";
|
|
@@ -73,6 +79,7 @@ export type DefinitionInput = {
|
|
|
73
79
|
};
|
|
74
80
|
approvals?: "ask" | "never";
|
|
75
81
|
learning?: boolean;
|
|
82
|
+
max_tool_calls?: number;
|
|
76
83
|
cap_mode?: "expected" | "strict";
|
|
77
84
|
};
|
|
78
85
|
export type Id = string;
|
|
@@ -377,7 +384,7 @@ export type Run = {
|
|
|
377
384
|
epoch: number;
|
|
378
385
|
until: string;
|
|
379
386
|
} | null;
|
|
380
|
-
place
|
|
387
|
+
place: {
|
|
381
388
|
mode: "runner";
|
|
382
389
|
} | {
|
|
383
390
|
mode: "sandbox";
|
|
@@ -559,6 +566,12 @@ export type TimelineRow = {
|
|
|
559
566
|
owner: boolean;
|
|
560
567
|
name?: string;
|
|
561
568
|
};
|
|
569
|
+
learned_nodes?: Array<{
|
|
570
|
+
label: string;
|
|
571
|
+
kind: string;
|
|
572
|
+
status: string;
|
|
573
|
+
duration_ms: number;
|
|
574
|
+
}>;
|
|
562
575
|
learning?: {
|
|
563
576
|
state: "seeded" | "reflecting" | "proposed" | "merged" | "dropped";
|
|
564
577
|
reason: "seed_failed" | "no_budget" | "unknown_cost" | "cancelled" | "crashed" | "reflect_timeout" | "reflect_failed" | "empty" | "unparsed" | "propose_failed" | "checker" | "grader" | "grade_failed" | null;
|
|
@@ -582,7 +595,7 @@ export type Capabilities = {
|
|
|
582
595
|
platform?: string;
|
|
583
596
|
};
|
|
584
597
|
runtimes: Array<string>;
|
|
585
|
-
models
|
|
598
|
+
models: {
|
|
586
599
|
source: "managed" | "chatgpt" | "env" | "faux" | "gateway" | "providers";
|
|
587
600
|
default?: string | null;
|
|
588
601
|
fast?: string | null;
|
|
@@ -595,13 +608,13 @@ export type Capabilities = {
|
|
|
595
608
|
features: Features;
|
|
596
609
|
regions: Array<Region>;
|
|
597
610
|
limits: Limits;
|
|
598
|
-
learning
|
|
611
|
+
learning: {
|
|
599
612
|
grade_model: string | null;
|
|
600
613
|
pending: true;
|
|
601
614
|
approve: boolean;
|
|
602
615
|
approve_needs?: "password";
|
|
603
616
|
};
|
|
604
|
-
places
|
|
617
|
+
places: {
|
|
605
618
|
modes: Array<"runner" | "sandbox">;
|
|
606
619
|
boxes: Array<{
|
|
607
620
|
id: "bwrap" | "docker" | "modal" | "daytona";
|
|
@@ -612,7 +625,7 @@ export type Capabilities = {
|
|
|
612
625
|
network_reason?: string;
|
|
613
626
|
host_addresses?: Array<string>;
|
|
614
627
|
}>;
|
|
615
|
-
default_place
|
|
628
|
+
default_place: {
|
|
616
629
|
mode: "runner";
|
|
617
630
|
} | {
|
|
618
631
|
mode: "sandbox";
|
|
@@ -631,7 +644,7 @@ export type Capabilities = {
|
|
|
631
644
|
reason?: string;
|
|
632
645
|
installs?: "on_first_use";
|
|
633
646
|
}>;
|
|
634
|
-
tools
|
|
647
|
+
tools: Array<{
|
|
635
648
|
name: string;
|
|
636
649
|
summary: string;
|
|
637
650
|
blurb?: string;
|
|
@@ -970,6 +983,7 @@ export type GetAgentLearningResponse = {
|
|
|
970
983
|
retired?: {
|
|
971
984
|
at: string;
|
|
972
985
|
by: "person" | "run";
|
|
986
|
+
from: "active" | "pending";
|
|
973
987
|
};
|
|
974
988
|
last_change?: {
|
|
975
989
|
kind: "approved" | "edited" | "created" | "retired" | "restored" | "learned" | "superseded";
|
|
@@ -991,6 +1005,7 @@ export type GetAgentLearningResponse = {
|
|
|
991
1005
|
retired?: {
|
|
992
1006
|
at: string;
|
|
993
1007
|
by: "person" | "run";
|
|
1008
|
+
from: "active" | "pending";
|
|
994
1009
|
};
|
|
995
1010
|
last_change?: {
|
|
996
1011
|
kind: "approved" | "edited" | "created" | "retired" | "restored" | "learned" | "superseded";
|
|
@@ -1010,6 +1025,7 @@ export type GetAgentLearningResponse = {
|
|
|
1010
1025
|
retired?: {
|
|
1011
1026
|
at: string;
|
|
1012
1027
|
by: "person" | "run";
|
|
1028
|
+
from: "active" | "pending";
|
|
1013
1029
|
};
|
|
1014
1030
|
last_change?: {
|
|
1015
1031
|
kind: "approved" | "edited" | "created" | "retired" | "restored" | "learned" | "superseded";
|
|
@@ -1100,6 +1116,7 @@ export type ListLearningNotesResponse = {
|
|
|
1100
1116
|
retired?: {
|
|
1101
1117
|
at: string;
|
|
1102
1118
|
by: "person" | "run";
|
|
1119
|
+
from: "active" | "pending";
|
|
1103
1120
|
};
|
|
1104
1121
|
last_change?: {
|
|
1105
1122
|
kind: "approved" | "edited" | "created" | "retired" | "restored" | "learned" | "superseded";
|
|
@@ -1210,6 +1227,24 @@ export type ListComputersResponse = {
|
|
|
1210
1227
|
required: Array<string>;
|
|
1211
1228
|
ready: boolean;
|
|
1212
1229
|
why?: string;
|
|
1230
|
+
gpu?: {
|
|
1231
|
+
types: Array<string>;
|
|
1232
|
+
max: number;
|
|
1233
|
+
isolation?: "container" | "gvisor" | "microvm" | "vm" | "machine";
|
|
1234
|
+
preemptible?: boolean;
|
|
1235
|
+
stopDeletes?: boolean;
|
|
1236
|
+
region?: string;
|
|
1237
|
+
perGpu?: {
|
|
1238
|
+
cpus: number;
|
|
1239
|
+
memoryMb: number;
|
|
1240
|
+
diskMb: number;
|
|
1241
|
+
};
|
|
1242
|
+
mounts?: Array<string>;
|
|
1243
|
+
fence?: "netns" | "userns-netns";
|
|
1244
|
+
why?: string;
|
|
1245
|
+
};
|
|
1246
|
+
network?: string;
|
|
1247
|
+
images?: Array<string>;
|
|
1213
1248
|
}>;
|
|
1214
1249
|
why?: string;
|
|
1215
1250
|
}>;
|
|
@@ -1237,50 +1272,6 @@ export type PutWorkspaceArchilResponse = {
|
|
|
1237
1272
|
s3Url?: string;
|
|
1238
1273
|
image?: string;
|
|
1239
1274
|
};
|
|
1240
|
-
/** Fire a GitHub trigger: a request it checks, no token (POST /hooks/github). */
|
|
1241
|
-
export type ReceiveHookGithubResponse = {
|
|
1242
|
-
firings: Array<{
|
|
1243
|
-
key: string;
|
|
1244
|
-
by: "schedule" | "manual" | "webhook" | "github";
|
|
1245
|
-
nominal_at: string;
|
|
1246
|
-
status: "due" | "started" | "sent" | "skipped" | "failed" | "missed";
|
|
1247
|
-
at: string;
|
|
1248
|
-
run_id: string | null;
|
|
1249
|
-
reason: string | null;
|
|
1250
|
-
error: {
|
|
1251
|
-
code: string;
|
|
1252
|
-
message: string;
|
|
1253
|
-
} | null;
|
|
1254
|
-
count?: number;
|
|
1255
|
-
attempts?: number;
|
|
1256
|
-
retry_at?: string;
|
|
1257
|
-
catch_up?: true;
|
|
1258
|
-
} | {
|
|
1259
|
-
ok: "duplicate";
|
|
1260
|
-
}>;
|
|
1261
|
-
} | {
|
|
1262
|
-
ok: "ignored";
|
|
1263
|
-
} | Record<string, unknown> | {
|
|
1264
|
-
firings: Array<{
|
|
1265
|
-
key: string;
|
|
1266
|
-
by: "schedule" | "manual" | "webhook" | "github";
|
|
1267
|
-
nominal_at: string;
|
|
1268
|
-
status: "due" | "started" | "sent" | "skipped" | "failed" | "missed";
|
|
1269
|
-
at: string;
|
|
1270
|
-
run_id: string | null;
|
|
1271
|
-
reason: string | null;
|
|
1272
|
-
error: {
|
|
1273
|
-
code: string;
|
|
1274
|
-
message: string;
|
|
1275
|
-
} | null;
|
|
1276
|
-
count?: number;
|
|
1277
|
-
attempts?: number;
|
|
1278
|
-
retry_at?: string;
|
|
1279
|
-
catch_up?: true;
|
|
1280
|
-
} | {
|
|
1281
|
-
ok: "duplicate";
|
|
1282
|
-
}>;
|
|
1283
|
-
};
|
|
1284
1275
|
/** Save a computer provider's keys, sealed (PUT /computers/{provider}/keys). */
|
|
1285
1276
|
export type SaveComputerKeysBody = Record<string, string | null>;
|
|
1286
1277
|
export type SaveComputerKeysResponse = {
|
|
@@ -1296,6 +1287,24 @@ export type SaveComputerKeysResponse = {
|
|
|
1296
1287
|
required: Array<string>;
|
|
1297
1288
|
ready: boolean;
|
|
1298
1289
|
why?: string;
|
|
1290
|
+
gpu?: {
|
|
1291
|
+
types: Array<string>;
|
|
1292
|
+
max: number;
|
|
1293
|
+
isolation?: "container" | "gvisor" | "microvm" | "vm" | "machine";
|
|
1294
|
+
preemptible?: boolean;
|
|
1295
|
+
stopDeletes?: boolean;
|
|
1296
|
+
region?: string;
|
|
1297
|
+
perGpu?: {
|
|
1298
|
+
cpus: number;
|
|
1299
|
+
memoryMb: number;
|
|
1300
|
+
diskMb: number;
|
|
1301
|
+
};
|
|
1302
|
+
mounts?: Array<string>;
|
|
1303
|
+
fence?: "netns" | "userns-netns";
|
|
1304
|
+
why?: string;
|
|
1305
|
+
};
|
|
1306
|
+
network?: string;
|
|
1307
|
+
images?: Array<string>;
|
|
1299
1308
|
};
|
|
1300
1309
|
/** 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. */
|
|
1301
1310
|
export type StartMcpOAuthBody = {
|
|
@@ -1399,7 +1408,6 @@ export type ListMcpServersResponse = {
|
|
|
1399
1408
|
updated_at: string;
|
|
1400
1409
|
secret?: SecretMeta;
|
|
1401
1410
|
}>;
|
|
1402
|
-
file_unreadable?: true;
|
|
1403
1411
|
};
|
|
1404
1412
|
/** This server's OAuth client metadata document (GET /settings/mcp-servers/oauth/client.json). */
|
|
1405
1413
|
export type McpOAuthClientResponse = Record<string, unknown>;
|
|
@@ -1682,6 +1690,17 @@ export type GetRunLearningResponse = {
|
|
|
1682
1690
|
output: number;
|
|
1683
1691
|
} | null;
|
|
1684
1692
|
};
|
|
1693
|
+
used: {
|
|
1694
|
+
skills: Array<{
|
|
1695
|
+
name: string;
|
|
1696
|
+
read: boolean;
|
|
1697
|
+
}>;
|
|
1698
|
+
workflows: Array<{
|
|
1699
|
+
name: string;
|
|
1700
|
+
calls: number;
|
|
1701
|
+
failed: number;
|
|
1702
|
+
}>;
|
|
1703
|
+
};
|
|
1685
1704
|
given?: Array<{
|
|
1686
1705
|
file: string;
|
|
1687
1706
|
name: string;
|
|
@@ -1972,6 +1991,9 @@ export type ListTemplatesResponse = {
|
|
|
1972
1991
|
} | null;
|
|
1973
1992
|
effort: string | null;
|
|
1974
1993
|
tools: Array<string> | null;
|
|
1994
|
+
tool_policy: {
|
|
1995
|
+
bash: "read-only";
|
|
1996
|
+
} | null;
|
|
1975
1997
|
mcp: Array<{
|
|
1976
1998
|
server: string;
|
|
1977
1999
|
required: boolean;
|
|
@@ -1988,11 +2010,13 @@ export type ListTemplatesResponse = {
|
|
|
1988
2010
|
description: string;
|
|
1989
2011
|
pattern?: string;
|
|
1990
2012
|
enum?: Array<string | number | boolean>;
|
|
2013
|
+
format?: "cron" | "timezone";
|
|
1991
2014
|
default?: string | number | boolean;
|
|
1992
2015
|
}>;
|
|
1993
2016
|
secrets: Array<string>;
|
|
1994
2017
|
budget: {
|
|
1995
|
-
per_run_usd
|
|
2018
|
+
per_run_usd?: number;
|
|
2019
|
+
tool_calls?: number;
|
|
1996
2020
|
} | null;
|
|
1997
2021
|
learning: boolean;
|
|
1998
2022
|
approvals_default: "ask" | "never";
|
|
@@ -2031,7 +2055,7 @@ export type ListToolKeysResponse = {
|
|
|
2031
2055
|
} | null;
|
|
2032
2056
|
}>;
|
|
2033
2057
|
reenter: {
|
|
2034
|
-
reason: "
|
|
2058
|
+
reason: "seal_key_changed" | "file_unreadable";
|
|
2035
2059
|
fields: Array<string>;
|
|
2036
2060
|
} | null;
|
|
2037
2061
|
};
|
|
@@ -2750,7 +2774,7 @@ export type GetWebhookResponse = {
|
|
|
2750
2774
|
configured: true;
|
|
2751
2775
|
url: string;
|
|
2752
2776
|
secret: SecretMeta;
|
|
2753
|
-
signing: "sealed" | "
|
|
2777
|
+
signing: "sealed" | "unreadable";
|
|
2754
2778
|
disabled: {
|
|
2755
2779
|
at: string;
|
|
2756
2780
|
reason: string;
|
|
@@ -2776,7 +2800,7 @@ export type SaveWebhookResponse = {
|
|
|
2776
2800
|
configured: true;
|
|
2777
2801
|
url: string;
|
|
2778
2802
|
secret: SecretMeta;
|
|
2779
|
-
signing: "sealed" | "
|
|
2803
|
+
signing: "sealed" | "unreadable";
|
|
2780
2804
|
disabled: {
|
|
2781
2805
|
at: string;
|
|
2782
2806
|
reason: string;
|
|
@@ -2786,7 +2810,7 @@ export type SaveWebhookResponse = {
|
|
|
2786
2810
|
configured: true;
|
|
2787
2811
|
url: string;
|
|
2788
2812
|
secret: SecretMeta;
|
|
2789
|
-
signing: "sealed" | "
|
|
2813
|
+
signing: "sealed" | "unreadable";
|
|
2790
2814
|
disabled: {
|
|
2791
2815
|
at: string;
|
|
2792
2816
|
reason: string;
|
|
@@ -2797,7 +2821,7 @@ export type SaveWebhookResponse = {
|
|
|
2797
2821
|
configured: true;
|
|
2798
2822
|
url: string;
|
|
2799
2823
|
secret: SecretMeta;
|
|
2800
|
-
signing: "sealed" | "
|
|
2824
|
+
signing: "sealed" | "unreadable";
|
|
2801
2825
|
disabled: {
|
|
2802
2826
|
at: string;
|
|
2803
2827
|
reason: string;
|
|
@@ -2889,8 +2913,6 @@ export declare function resources(call: Call): {
|
|
|
2889
2913
|
write: (agentId: string, file: string, body: WriteLearningFileBody | RawBody, params?: WriteLearningFileParams, options?: BodyOptions) => Promise<Tagged<string>>;
|
|
2890
2914
|
};
|
|
2891
2915
|
local: {
|
|
2892
|
-
/** Start Connect GitHub: the app-manifest form the console posts to GitHub (POST /integrations/github/connect). */
|
|
2893
|
-
connectGitHub: (body?: ConnectGitHubBody, options?: RequestOptions) => Promise<ConnectGitHubResponse>;
|
|
2894
2916
|
/** Turn Mode 2 off: run folders on this server's own disk (DELETE /workspace/archil). */
|
|
2895
2917
|
deleteWorkspaceArchil: (options?: RequestOptions) => Promise<DeleteWorkspaceArchilResponse>;
|
|
2896
2918
|
/** Disconnect GitHub: the App's credentials gone from this server, and every github trigger off (DELETE /integrations/github). */
|
|
@@ -2899,20 +2921,12 @@ export declare function resources(call: Call): {
|
|
|
2899
2921
|
getGitHubConnection: (options?: RequestOptions) => Promise<GetGitHubConnectionResponse>;
|
|
2900
2922
|
/** Whether run folders are on an Archil disk (Mode 2), its settings, and whether its keys are saved (GET /workspace/archil). */
|
|
2901
2923
|
getWorkspaceArchil: (options?: RequestOptions) => Promise<GetWorkspaceArchilResponse>;
|
|
2902
|
-
/** Where GitHub sends the owner's browser back with the new App's code (GET /integrations/github/callback). */
|
|
2903
|
-
gitHubCallback: (params?: GitHubCallbackParams, options?: RequestOptions) => Promise<void>;
|
|
2904
|
-
/** Where GitHub sends the browser once the App is installed (GET /integrations/github/installed). */
|
|
2905
|
-
gitHubInstalled: (params?: GitHubInstalledParams, options?: RequestOptions) => Promise<void>;
|
|
2906
2924
|
/** Settings → Computers: the kinds of computer this server offers, each provider and whether its keys are saved (GET /computers). */
|
|
2907
2925
|
listComputers: (options?: RequestOptions) => Promise<ListComputersResponse>;
|
|
2908
2926
|
/** Turn Mode 2 on: run folders on this Archil disk (PUT /workspace/archil). */
|
|
2909
2927
|
putWorkspaceArchil: (body: PutWorkspaceArchilBody, options?: RequestOptions) => Promise<PutWorkspaceArchilResponse>;
|
|
2910
|
-
/** Fire a GitHub trigger: a request it checks, no token (POST /hooks/github). */
|
|
2911
|
-
receiveHookGithub: (body: RawBody, options?: BodyOptions) => Promise<ReceiveHookGithubResponse>;
|
|
2912
2928
|
/** Save a computer provider's keys, sealed (PUT /computers/{provider}/keys). */
|
|
2913
2929
|
saveComputerKeys: (provider: string, body: SaveComputerKeysBody, options?: RequestOptions) => Promise<SaveComputerKeysResponse>;
|
|
2914
|
-
/** Start signing in to an MCP server with OAuth: the page the owner opens (POST /settings/mcp-servers/{name}/oauth/start). */
|
|
2915
|
-
startMcpOauth: (name: string, body: StartMcpOAuthBody, options?: RequestOptions) => Promise<StartMcpOAuthResponse>;
|
|
2916
2930
|
/** Test a computer provider's account with its saved keys (POST /computers/{provider}/test). */
|
|
2917
2931
|
testComputer: (provider: string, options?: RequestOptions) => Promise<TestComputerResponse>;
|
|
2918
2932
|
/** Test the Archil disk with its saved account key (POST /workspace/archil/test). */
|
|
@@ -32,7 +32,6 @@ export const OPERATIONS = {
|
|
|
32
32
|
gitHubInstalled: { "method": "GET", "path": "/integrations/github/installed", "pathParams": [], "multiSegment": [], "query": ["installation_id", "setup_action", "state"], "headers": [], "body": null, "answer": "none", "secret": false, "publicFields": [], "tagged": false },
|
|
33
33
|
listComputers: { "method": "GET", "path": "/computers", "pathParams": [], "multiSegment": [], "query": [], "headers": [], "body": null, "answer": "json", "secret": false, "publicFields": [], "tagged": false },
|
|
34
34
|
putWorkspaceArchil: { "method": "PUT", "path": "/workspace/archil", "pathParams": [], "multiSegment": [], "query": [], "headers": [], "body": { "required": true, "types": ["application/json"] }, "answer": "json", "secret": false, "publicFields": [], "tagged": false },
|
|
35
|
-
receiveHook_github: { "method": "POST", "path": "/hooks/github", "pathParams": [], "multiSegment": [], "query": [], "headers": [], "body": { "required": true, "types": ["*/*"] }, "answer": "json", "secret": false, "publicFields": [], "tagged": false },
|
|
36
35
|
saveComputerKeys: { "method": "PUT", "path": "/computers/{provider}/keys", "pathParams": ["provider"], "multiSegment": [], "query": [], "headers": [], "body": { "required": true, "types": ["application/json"] }, "answer": "json", "secret": false, "publicFields": [], "tagged": false },
|
|
37
36
|
startMcpOAuth: { "method": "POST", "path": "/settings/mcp-servers/{name}/oauth/start", "pathParams": ["name"], "multiSegment": [], "query": [], "headers": [], "body": { "required": true, "types": ["application/json"] }, "answer": "json", "secret": true, "publicFields": ["url", "scopes.[]", "client_id"], "tagged": false },
|
|
38
37
|
testComputer: { "method": "POST", "path": "/computers/{provider}/test", "pathParams": ["provider"], "multiSegment": [], "query": [], "headers": [], "body": null, "answer": "json", "secret": false, "publicFields": [], "tagged": false },
|
|
@@ -154,8 +153,6 @@ export function resources(call) {
|
|
|
154
153
|
write: (agentId, file, body, params, options) => call("writeLearningFile", [agentId, file], body, params, options),
|
|
155
154
|
},
|
|
156
155
|
local: {
|
|
157
|
-
/** Start Connect GitHub: the app-manifest form the console posts to GitHub (POST /integrations/github/connect). */
|
|
158
|
-
connectGitHub: (body, options) => call("connectGitHub", [], body, undefined, options),
|
|
159
156
|
/** Turn Mode 2 off: run folders on this server's own disk (DELETE /workspace/archil). */
|
|
160
157
|
deleteWorkspaceArchil: (options) => call("deleteWorkspaceArchil", [], undefined, undefined, options),
|
|
161
158
|
/** Disconnect GitHub: the App's credentials gone from this server, and every github trigger off (DELETE /integrations/github). */
|
|
@@ -164,20 +161,12 @@ export function resources(call) {
|
|
|
164
161
|
getGitHubConnection: (options) => call("getGitHubConnection", [], undefined, undefined, options),
|
|
165
162
|
/** Whether run folders are on an Archil disk (Mode 2), its settings, and whether its keys are saved (GET /workspace/archil). */
|
|
166
163
|
getWorkspaceArchil: (options) => call("getWorkspaceArchil", [], undefined, undefined, options),
|
|
167
|
-
/** Where GitHub sends the owner's browser back with the new App's code (GET /integrations/github/callback). */
|
|
168
|
-
gitHubCallback: (params, options) => call("gitHubCallback", [], undefined, params, options),
|
|
169
|
-
/** Where GitHub sends the browser once the App is installed (GET /integrations/github/installed). */
|
|
170
|
-
gitHubInstalled: (params, options) => call("gitHubInstalled", [], undefined, params, options),
|
|
171
164
|
/** Settings → Computers: the kinds of computer this server offers, each provider and whether its keys are saved (GET /computers). */
|
|
172
165
|
listComputers: (options) => call("listComputers", [], undefined, undefined, options),
|
|
173
166
|
/** Turn Mode 2 on: run folders on this Archil disk (PUT /workspace/archil). */
|
|
174
167
|
putWorkspaceArchil: (body, options) => call("putWorkspaceArchil", [], body, undefined, options),
|
|
175
|
-
/** Fire a GitHub trigger: a request it checks, no token (POST /hooks/github). */
|
|
176
|
-
receiveHookGithub: (body, options) => call("receiveHook_github", [], body, undefined, options),
|
|
177
168
|
/** Save a computer provider's keys, sealed (PUT /computers/{provider}/keys). */
|
|
178
169
|
saveComputerKeys: (provider, body, options) => call("saveComputerKeys", [provider], body, undefined, options),
|
|
179
|
-
/** Start signing in to an MCP server with OAuth: the page the owner opens (POST /settings/mcp-servers/{name}/oauth/start). */
|
|
180
|
-
startMcpOauth: (name, body, options) => call("startMcpOAuth", [name], body, undefined, options),
|
|
181
170
|
/** Test a computer provider's account with its saved keys (POST /computers/{provider}/test). */
|
|
182
171
|
testComputer: (provider, options) => call("testComputer", [provider], undefined, undefined, options),
|
|
183
172
|
/** Test the Archil disk with its saved account key (POST /workspace/archil/test). */
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@parcha/agentrun-client",
|
|
3
|
-
"version": "0.1.0-beta.
|
|
3
|
+
"version": "0.1.0-beta.35",
|
|
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.
|
|
16
|
+
"node": ">=24.22.3"
|
|
17
17
|
},
|
|
18
18
|
"main": "./dist/index.js",
|
|
19
19
|
"types": "./dist/index.d.ts",
|