@parcha/agentrun-client 0.0.0-stage → 0.1.0-beta.33
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/LICENSE +202 -0
- package/NOTICE +2 -0
- package/README.md +88 -2
- package/dist/client.d.ts +35 -0
- package/dist/client.js +266 -0
- package/dist/errors.d.ts +61 -0
- package/dist/errors.js +88 -0
- package/dist/http.d.ts +35 -0
- package/dist/http.js +40 -0
- package/dist/index.d.ts +5 -0
- package/dist/index.js +3 -0
- package/dist/live.d.ts +26 -0
- package/dist/live.js +236 -0
- package/dist/operations.generated.d.ts +3058 -0
- package/dist/operations.generated.js +323 -0
- package/dist/scrub.d.ts +7 -0
- package/dist/scrub.js +55 -0
- package/dist/types.d.ts +51 -0
- package/dist/types.js +2 -0
- package/package.json +51 -4
|
@@ -0,0 +1,323 @@
|
|
|
1
|
+
/** Each operation as the runtime sends it, by operationId. */
|
|
2
|
+
export const OPERATIONS = {
|
|
3
|
+
archiveAgent: { "method": "POST", "path": "/agents/{agent_id}/archive", "pathParams": ["agent_id"], "multiSegment": [], "query": [], "headers": [], "body": null, "answer": "json", "secret": false, "publicFields": [], "tagged": false },
|
|
4
|
+
createAgent: { "method": "POST", "path": "/agents", "pathParams": [], "multiSegment": [], "query": [], "headers": ["Idempotency-Key"], "body": { "required": true, "types": ["application/json"] }, "answer": "json", "secret": false, "publicFields": [], "tagged": false },
|
|
5
|
+
forgetSignIn: { "method": "DELETE", "path": "/agents/{agent_id}/sign-ins/{key}", "pathParams": ["agent_id", "key"], "multiSegment": [], "query": [], "headers": [], "body": null, "answer": "json", "secret": false, "publicFields": [], "tagged": false },
|
|
6
|
+
getAgent: { "method": "GET", "path": "/agents/{agent_id}", "pathParams": ["agent_id"], "multiSegment": [], "query": [], "headers": [], "body": null, "answer": "json", "secret": false, "publicFields": [], "tagged": true },
|
|
7
|
+
listAgents: { "method": "GET", "path": "/agents", "pathParams": [], "multiSegment": [], "query": ["limit", "cursor", "archived"], "headers": [], "body": null, "answer": "json", "secret": false, "publicFields": [], "tagged": false },
|
|
8
|
+
listRuns: { "method": "GET", "path": "/agents/{agent_id}/runs", "pathParams": ["agent_id"], "multiSegment": [], "query": ["limit", "cursor", "status"], "headers": [], "body": null, "answer": "json", "secret": false, "publicFields": [], "tagged": false },
|
|
9
|
+
unarchiveAgent: { "method": "POST", "path": "/agents/{agent_id}/unarchive", "pathParams": ["agent_id"], "multiSegment": [], "query": [], "headers": [], "body": null, "answer": "json", "secret": false, "publicFields": [], "tagged": false },
|
|
10
|
+
updateDefinition: { "method": "PUT", "path": "/agents/{agent_id}/definition", "pathParams": ["agent_id"], "multiSegment": [], "query": [], "headers": ["If-Match"], "body": { "required": true, "types": ["application/json"] }, "answer": "json", "secret": false, "publicFields": [], "tagged": true },
|
|
11
|
+
createFile: { "method": "POST", "path": "/files", "pathParams": [], "multiSegment": [], "query": ["path", "content_type", "sha256"], "headers": ["Idempotency-Key"], "body": { "required": true, "types": ["application/json", "application/octet-stream", "*/*"] }, "answer": "json", "secret": false, "publicFields": [], "tagged": false },
|
|
12
|
+
deleteFile: { "method": "DELETE", "path": "/files/{file_id}", "pathParams": ["file_id"], "multiSegment": [], "query": [], "headers": [], "body": null, "answer": "none", "secret": false, "publicFields": [], "tagged": false },
|
|
13
|
+
getFile: { "method": "GET", "path": "/files/{file_id}", "pathParams": ["file_id"], "multiSegment": [], "query": [], "headers": [], "body": null, "answer": "json", "secret": false, "publicFields": [], "tagged": false },
|
|
14
|
+
listFiles: { "method": "GET", "path": "/files", "pathParams": [], "multiSegment": [], "query": ["limit", "cursor"], "headers": [], "body": null, "answer": "json", "secret": false, "publicFields": [], "tagged": false },
|
|
15
|
+
uploadFile: { "method": "PUT", "path": "/files/{file_id}", "pathParams": ["file_id"], "multiSegment": [], "query": [], "headers": [], "body": { "required": true, "types": ["application/octet-stream"] }, "answer": "json", "secret": false, "publicFields": [], "tagged": false },
|
|
16
|
+
deleteHomeFile: { "method": "DELETE", "path": "/agents/{agent_id}/home/files/{path}", "pathParams": ["agent_id", "path"], "multiSegment": ["path"], "query": [], "headers": [], "body": null, "answer": "none", "secret": false, "publicFields": [], "tagged": false },
|
|
17
|
+
listHomeFiles: { "method": "GET", "path": "/agents/{agent_id}/home/files", "pathParams": ["agent_id"], "multiSegment": [], "query": [], "headers": [], "body": null, "answer": "json", "secret": false, "publicFields": [], "tagged": false },
|
|
18
|
+
readHomeFile: { "method": "GET", "path": "/agents/{agent_id}/home/files/{path}", "pathParams": ["agent_id", "path"], "multiSegment": ["path"], "query": ["download"], "headers": [], "body": null, "answer": "bytes", "secret": false, "publicFields": [], "tagged": false },
|
|
19
|
+
writeHomeFile: { "method": "PUT", "path": "/agents/{agent_id}/home/files/{path}", "pathParams": ["agent_id", "path"], "multiSegment": ["path"], "query": [], "headers": [], "body": { "required": true, "types": ["application/octet-stream", "*/*"] }, "answer": "json", "secret": false, "publicFields": [], "tagged": false },
|
|
20
|
+
getAgentLearning: { "method": "GET", "path": "/agents/{agent_id}/learning", "pathParams": ["agent_id"], "multiSegment": [], "query": [], "headers": [], "body": null, "answer": "json", "secret": false, "publicFields": [], "tagged": false },
|
|
21
|
+
listLearningLog: { "method": "GET", "path": "/agents/{agent_id}/learning/log", "pathParams": ["agent_id"], "multiSegment": [], "query": ["cursor", "limit"], "headers": [], "body": null, "answer": "json", "secret": false, "publicFields": [], "tagged": false },
|
|
22
|
+
listLearningNotes: { "method": "GET", "path": "/agents/{agent_id}/learning/notes", "pathParams": ["agent_id"], "multiSegment": [], "query": ["cursor", "limit", "status"], "headers": [], "body": null, "answer": "json", "secret": false, "publicFields": [], "tagged": false },
|
|
23
|
+
readLearningFile: { "method": "GET", "path": "/agents/{agent_id}/learning/files/{file}", "pathParams": ["agent_id", "file"], "multiSegment": [], "query": [], "headers": [], "body": null, "answer": "json+text", "secret": false, "publicFields": [], "tagged": true },
|
|
24
|
+
retireLearningFile: { "method": "POST", "path": "/agents/{agent_id}/learning/files/{file}/retire", "pathParams": ["agent_id", "file"], "multiSegment": [], "query": [], "headers": ["If-Match"], "body": null, "answer": "text", "secret": false, "publicFields": [], "tagged": true },
|
|
25
|
+
writeLearningFile: { "method": "PUT", "path": "/agents/{agent_id}/learning/files/{file}", "pathParams": ["agent_id", "file"], "multiSegment": [], "query": [], "headers": ["If-Match", "If-None-Match"], "body": { "required": true, "types": ["text/markdown", "text/plain", "application/json"] }, "answer": "text", "secret": false, "publicFields": [], "tagged": true },
|
|
26
|
+
connectGitHub: { "method": "POST", "path": "/integrations/github/connect", "pathParams": [], "multiSegment": [], "query": [], "headers": [], "body": { "required": false, "types": ["application/json"] }, "answer": "json", "secret": false, "publicFields": [], "tagged": false },
|
|
27
|
+
deleteWorkspaceArchil: { "method": "DELETE", "path": "/workspace/archil", "pathParams": [], "multiSegment": [], "query": [], "headers": [], "body": null, "answer": "json", "secret": false, "publicFields": [], "tagged": false },
|
|
28
|
+
disconnectGitHub: { "method": "DELETE", "path": "/integrations/github", "pathParams": [], "multiSegment": [], "query": [], "headers": [], "body": null, "answer": "json", "secret": false, "publicFields": [], "tagged": false },
|
|
29
|
+
getGitHubConnection: { "method": "GET", "path": "/integrations/github", "pathParams": [], "multiSegment": [], "query": [], "headers": [], "body": null, "answer": "json", "secret": false, "publicFields": [], "tagged": false },
|
|
30
|
+
getWorkspaceArchil: { "method": "GET", "path": "/workspace/archil", "pathParams": [], "multiSegment": [], "query": [], "headers": [], "body": null, "answer": "json", "secret": false, "publicFields": [], "tagged": false },
|
|
31
|
+
gitHubCallback: { "method": "GET", "path": "/integrations/github/callback", "pathParams": [], "multiSegment": [], "query": ["code", "state"], "headers": [], "body": null, "answer": "none", "secret": false, "publicFields": [], "tagged": false },
|
|
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
|
+
listComputers: { "method": "GET", "path": "/computers", "pathParams": [], "multiSegment": [], "query": [], "headers": [], "body": null, "answer": "json", "secret": false, "publicFields": [], "tagged": false },
|
|
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
|
+
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
|
+
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
|
+
testComputer: { "method": "POST", "path": "/computers/{provider}/test", "pathParams": ["provider"], "multiSegment": [], "query": [], "headers": [], "body": null, "answer": "json", "secret": false, "publicFields": [], "tagged": false },
|
|
39
|
+
testWorkspaceArchil: { "method": "POST", "path": "/workspace/archil/test", "pathParams": [], "multiSegment": [], "query": [], "headers": [], "body": null, "answer": "json", "secret": false, "publicFields": [], "tagged": false },
|
|
40
|
+
deleteMcpServer: { "method": "DELETE", "path": "/settings/mcp-servers/{name}", "pathParams": ["name"], "multiSegment": [], "query": [], "headers": [], "body": null, "answer": "none", "secret": false, "publicFields": [], "tagged": false },
|
|
41
|
+
getMcpServer: { "method": "GET", "path": "/settings/mcp-servers/{name}", "pathParams": ["name"], "multiSegment": [], "query": [], "headers": [], "body": null, "answer": "json", "secret": false, "publicFields": [], "tagged": false },
|
|
42
|
+
listMcpServers: { "method": "GET", "path": "/settings/mcp-servers", "pathParams": [], "multiSegment": [], "query": [], "headers": [], "body": null, "answer": "json", "secret": false, "publicFields": [], "tagged": false },
|
|
43
|
+
mcpOAuthClient: { "method": "GET", "path": "/settings/mcp-servers/oauth/client.json", "pathParams": [], "multiSegment": [], "query": [], "headers": [], "body": null, "answer": "json", "secret": false, "publicFields": [], "tagged": false },
|
|
44
|
+
previewMcpServer: { "method": "POST", "path": "/settings/mcp-servers/preview", "pathParams": [], "multiSegment": [], "query": [], "headers": [], "body": { "required": true, "types": ["application/json"] }, "answer": "json", "secret": true, "publicFields": ["url", "auth.type", "name"], "tagged": false },
|
|
45
|
+
getMcpPrivateHosts: { "method": "GET", "path": "/settings/mcp-servers/oauth/private-hosts", "pathParams": [], "multiSegment": [], "query": [], "headers": [], "body": null, "answer": "json", "secret": false, "publicFields": [], "tagged": false },
|
|
46
|
+
refreshMcpServer: { "method": "POST", "path": "/settings/mcp-servers/{name}/refresh", "pathParams": ["name"], "multiSegment": [], "query": [], "headers": [], "body": null, "answer": "json", "secret": false, "publicFields": [], "tagged": false },
|
|
47
|
+
saveMcpServer: { "method": "PUT", "path": "/settings/mcp-servers/{name}", "pathParams": ["name"], "multiSegment": [], "query": [], "headers": [], "body": { "required": true, "types": ["application/json"] }, "answer": "json", "secret": true, "publicFields": ["url", "auth.type"], "tagged": false },
|
|
48
|
+
listRevisions: { "method": "GET", "path": "/agents/{agent_id}/revisions", "pathParams": ["agent_id"], "multiSegment": [], "query": ["limit", "cursor"], "headers": [], "body": null, "answer": "json", "secret": false, "publicFields": [], "tagged": false },
|
|
49
|
+
setCurrent: { "method": "POST", "path": "/agents/{agent_id}/current", "pathParams": ["agent_id"], "multiSegment": [], "query": [], "headers": [], "body": { "required": true, "types": ["application/json"] }, "answer": "json", "secret": false, "publicFields": [], "tagged": false },
|
|
50
|
+
archiveRun: { "method": "POST", "path": "/runs/{run_id}/archive", "pathParams": ["run_id"], "multiSegment": [], "query": [], "headers": [], "body": null, "answer": "json", "secret": false, "publicFields": [], "tagged": false },
|
|
51
|
+
cancelRun: { "method": "POST", "path": "/runs/{run_id}/cancel", "pathParams": ["run_id"], "multiSegment": [], "query": [], "headers": [], "body": null, "answer": "json", "secret": false, "publicFields": [], "tagged": false },
|
|
52
|
+
createInlineRun: { "method": "POST", "path": "/runs", "pathParams": [], "multiSegment": [], "query": [], "headers": ["Idempotency-Key"], "body": { "required": true, "types": ["application/json"] }, "answer": "json", "secret": false, "publicFields": [], "tagged": false },
|
|
53
|
+
listRunFiles: { "method": "GET", "path": "/runs/{run_id}/files", "pathParams": ["run_id"], "multiSegment": [], "query": [], "headers": [], "body": null, "answer": "json", "secret": false, "publicFields": [], "tagged": false },
|
|
54
|
+
getRun: { "method": "GET", "path": "/runs/{run_id}", "pathParams": ["run_id"], "multiSegment": [], "query": [], "headers": [], "body": null, "answer": "json", "secret": false, "publicFields": [], "tagged": false },
|
|
55
|
+
getRunGraph: { "method": "GET", "path": "/runs/{run_id}/graph", "pathParams": ["run_id"], "multiSegment": [], "query": [], "headers": [], "body": null, "answer": "json", "secret": false, "publicFields": [], "tagged": false },
|
|
56
|
+
handBackRunComputer: { "method": "POST", "path": "/runs/{run_id}/computer/hand-back", "pathParams": ["run_id"], "multiSegment": [], "query": [], "headers": [], "body": { "required": false, "types": ["application/json"] }, "answer": "json", "secret": false, "publicFields": [], "tagged": false },
|
|
57
|
+
getRunLearning: { "method": "GET", "path": "/runs/{run_id}/learning", "pathParams": ["run_id"], "multiSegment": [], "query": [], "headers": [], "body": null, "answer": "json", "secret": false, "publicFields": [], "tagged": false },
|
|
58
|
+
getRunLearningDiff: { "method": "GET", "path": "/runs/{run_id}/learning/diff", "pathParams": ["run_id"], "multiSegment": [], "query": [], "headers": [], "body": null, "answer": "json", "secret": false, "publicFields": [], "tagged": false },
|
|
59
|
+
listAllRuns: { "method": "GET", "path": "/runs", "pathParams": [], "multiSegment": [], "query": ["limit", "cursor", "agent", "revision", "status", "archived"], "headers": [], "body": null, "answer": "json", "secret": false, "publicFields": [], "tagged": false },
|
|
60
|
+
sendMessage: { "method": "POST", "path": "/runs/{run_id}/messages", "pathParams": ["run_id"], "multiSegment": [], "query": [], "headers": ["Idempotency-Key"], "body": { "required": true, "types": ["application/json"] }, "answer": "json", "secret": false, "publicFields": [], "tagged": false },
|
|
61
|
+
pauseRun: { "method": "POST", "path": "/runs/{run_id}/pause", "pathParams": ["run_id"], "multiSegment": [], "query": [], "headers": [], "body": null, "answer": "json", "secret": false, "publicFields": [], "tagged": false },
|
|
62
|
+
raiseRunCap: { "method": "PATCH", "path": "/runs/{run_id}", "pathParams": ["run_id"], "multiSegment": [], "query": [], "headers": [], "body": { "required": true, "types": ["application/json"] }, "answer": "json", "secret": false, "publicFields": [], "tagged": false },
|
|
63
|
+
readRunFile: { "method": "GET", "path": "/runs/{run_id}/files/{path}", "pathParams": ["run_id", "path"], "multiSegment": ["path"], "query": ["download"], "headers": ["Range"], "body": null, "answer": "bytes", "secret": false, "publicFields": [], "tagged": false },
|
|
64
|
+
resumeRun: { "method": "POST", "path": "/runs/{run_id}/resume", "pathParams": ["run_id"], "multiSegment": [], "query": [], "headers": [], "body": null, "answer": "json", "secret": false, "publicFields": [], "tagged": false },
|
|
65
|
+
createRun: { "method": "POST", "path": "/agents/{agent_id}/runs", "pathParams": ["agent_id"], "multiSegment": [], "query": [], "headers": ["Idempotency-Key"], "body": { "required": true, "types": ["application/json"] }, "answer": "json", "secret": false, "publicFields": [], "tagged": false },
|
|
66
|
+
stopRun: { "method": "POST", "path": "/runs/{run_id}/stop", "pathParams": ["run_id"], "multiSegment": [], "query": [], "headers": [], "body": null, "answer": "json", "secret": false, "publicFields": [], "tagged": false },
|
|
67
|
+
takeOverRunComputer: { "method": "POST", "path": "/runs/{run_id}/computer/take-over", "pathParams": ["run_id"], "multiSegment": [], "query": [], "headers": [], "body": { "required": false, "types": ["application/json"] }, "answer": "json", "secret": false, "publicFields": [], "tagged": false },
|
|
68
|
+
getTimeline: { "method": "GET", "path": "/runs/{run_id}/timeline", "pathParams": ["run_id"], "multiSegment": [], "query": ["after", "wait_ms", "limit"], "headers": ["Last-Event-ID"], "body": null, "answer": "json", "secret": false, "publicFields": [], "tagged": false },
|
|
69
|
+
unarchiveRun: { "method": "POST", "path": "/runs/{run_id}/unarchive", "pathParams": ["run_id"], "multiSegment": [], "query": [], "headers": [], "body": null, "answer": "json", "secret": false, "publicFields": [], "tagged": false },
|
|
70
|
+
getCapabilities: { "method": "GET", "path": "/capabilities", "pathParams": [], "multiSegment": [], "query": [], "headers": [], "body": null, "answer": "json", "secret": false, "publicFields": [], "tagged": false },
|
|
71
|
+
getHealth: { "method": "GET", "path": "/health", "pathParams": [], "multiSegment": [], "query": [], "headers": [], "body": null, "answer": "json", "secret": false, "publicFields": [], "tagged": false },
|
|
72
|
+
callMcp: { "method": "POST", "path": "/mcp", "pathParams": [], "multiSegment": [], "query": [], "headers": [], "body": { "required": true, "types": ["application/json"] }, "answer": "json", "secret": false, "publicFields": [], "tagged": false },
|
|
73
|
+
getOpenapi: { "method": "GET", "path": "/openapi.json", "pathParams": [], "multiSegment": [], "query": [], "headers": [], "body": null, "answer": "json", "secret": false, "publicFields": [], "tagged": false },
|
|
74
|
+
getStats: { "method": "GET", "path": "/stats", "pathParams": [], "multiSegment": [], "query": ["from", "to", "agent"], "headers": [], "body": null, "answer": "json", "secret": false, "publicFields": [], "tagged": false },
|
|
75
|
+
applyTemplate: { "method": "POST", "path": "/templates/{template}/apply", "pathParams": ["template"], "multiSegment": [], "query": [], "headers": ["Idempotency-Key"], "body": { "required": true, "types": ["application/json"] }, "answer": "json", "secret": false, "publicFields": [], "tagged": false },
|
|
76
|
+
listTemplates: { "method": "GET", "path": "/templates", "pathParams": [], "multiSegment": [], "query": [], "headers": [], "body": null, "answer": "json", "secret": false, "publicFields": [], "tagged": false },
|
|
77
|
+
deleteToolKey: { "method": "DELETE", "path": "/settings/tool-keys/{key_id}", "pathParams": ["key_id"], "multiSegment": [], "query": [], "headers": [], "body": null, "answer": "none", "secret": false, "publicFields": [], "tagged": false },
|
|
78
|
+
listToolKeys: { "method": "GET", "path": "/settings/tool-keys", "pathParams": [], "multiSegment": [], "query": [], "headers": [], "body": null, "answer": "json", "secret": false, "publicFields": [], "tagged": false },
|
|
79
|
+
saveToolKey: { "method": "PUT", "path": "/settings/tool-keys/{key_id}", "pathParams": ["key_id"], "multiSegment": [], "query": [], "headers": [], "body": { "required": true, "types": ["application/json"] }, "answer": "none", "secret": true, "publicFields": [], "tagged": false },
|
|
80
|
+
getToolSettings: { "method": "GET", "path": "/settings/tools", "pathParams": [], "multiSegment": [], "query": [], "headers": [], "body": null, "answer": "json", "secret": false, "publicFields": [], "tagged": false },
|
|
81
|
+
putToolSettings: { "method": "PUT", "path": "/settings/tools", "pathParams": [], "multiSegment": [], "query": [], "headers": [], "body": { "required": true, "types": ["application/json"] }, "answer": "json", "secret": false, "publicFields": [], "tagged": false },
|
|
82
|
+
createTrigger: { "method": "POST", "path": "/triggers", "pathParams": [], "multiSegment": [], "query": [], "headers": ["Idempotency-Key"], "body": { "required": true, "types": ["application/json"] }, "answer": "json", "secret": false, "publicFields": [], "tagged": false },
|
|
83
|
+
deleteTrigger: { "method": "DELETE", "path": "/triggers/{trigger_id}", "pathParams": ["trigger_id"], "multiSegment": [], "query": [], "headers": [], "body": null, "answer": "none", "secret": false, "publicFields": [], "tagged": false },
|
|
84
|
+
fireTrigger: { "method": "POST", "path": "/triggers/{trigger_id}/fire", "pathParams": ["trigger_id"], "multiSegment": [], "query": [], "headers": ["Idempotency-Key"], "body": null, "answer": "json", "secret": false, "publicFields": [], "tagged": false },
|
|
85
|
+
listTriggerFirings: { "method": "GET", "path": "/triggers/{trigger_id}/firings", "pathParams": ["trigger_id"], "multiSegment": [], "query": [], "headers": [], "body": null, "answer": "json", "secret": false, "publicFields": [], "tagged": false },
|
|
86
|
+
getTrigger: { "method": "GET", "path": "/triggers/{trigger_id}", "pathParams": ["trigger_id"], "multiSegment": [], "query": [], "headers": [], "body": null, "answer": "json", "secret": false, "publicFields": [], "tagged": false },
|
|
87
|
+
listTriggers: { "method": "GET", "path": "/triggers", "pathParams": [], "multiSegment": [], "query": [], "headers": [], "body": null, "answer": "json", "secret": false, "publicFields": [], "tagged": false },
|
|
88
|
+
rotateTriggerSecret: { "method": "POST", "path": "/triggers/{trigger_id}/secret", "pathParams": ["trigger_id"], "multiSegment": [], "query": [], "headers": [], "body": null, "answer": "json", "secret": false, "publicFields": [], "tagged": false },
|
|
89
|
+
updateTrigger: { "method": "PATCH", "path": "/triggers/{trigger_id}", "pathParams": ["trigger_id"], "multiSegment": [], "query": [], "headers": [], "body": { "required": true, "types": ["application/json"] }, "answer": "json", "secret": false, "publicFields": [], "tagged": false },
|
|
90
|
+
getUsage: { "method": "GET", "path": "/usage", "pathParams": [], "multiSegment": [], "query": ["from", "to", "group_by"], "headers": [], "body": null, "answer": "json", "secret": false, "publicFields": [], "tagged": false },
|
|
91
|
+
deleteWebhook: { "method": "DELETE", "path": "/settings/webhook", "pathParams": [], "multiSegment": [], "query": [], "headers": [], "body": null, "answer": "none", "secret": false, "publicFields": [], "tagged": false },
|
|
92
|
+
listWebhookDeliveries: { "method": "GET", "path": "/settings/webhook/deliveries", "pathParams": [], "multiSegment": [], "query": [], "headers": [], "body": null, "answer": "json", "secret": false, "publicFields": [], "tagged": false },
|
|
93
|
+
getWebhook: { "method": "GET", "path": "/settings/webhook", "pathParams": [], "multiSegment": [], "query": [], "headers": [], "body": null, "answer": "json", "secret": false, "publicFields": [], "tagged": false },
|
|
94
|
+
redeliverWebhook: { "method": "POST", "path": "/settings/webhook/deliveries/{webhook_id}/redeliver", "pathParams": ["webhook_id"], "multiSegment": [], "query": [], "headers": [], "body": null, "answer": "json", "secret": false, "publicFields": [], "tagged": false },
|
|
95
|
+
saveWebhook: { "method": "PUT", "path": "/settings/webhook", "pathParams": [], "multiSegment": [], "query": [], "headers": [], "body": { "required": true, "types": ["application/json"] }, "answer": "json", "secret": false, "publicFields": [], "tagged": false },
|
|
96
|
+
testWebhook: { "method": "POST", "path": "/settings/webhook/test", "pathParams": [], "multiSegment": [], "query": [], "headers": [], "body": null, "answer": "json", "secret": false, "publicFields": [], "tagged": false },
|
|
97
|
+
validateWorkflow: { "method": "POST", "path": "/workflows/validate", "pathParams": [], "multiSegment": [], "query": [], "headers": [], "body": { "required": true, "types": ["application/json"] }, "answer": "json", "secret": false, "publicFields": [], "tagged": false },
|
|
98
|
+
};
|
|
99
|
+
/** The resource groups, each operation a method that sends it through `call`. */
|
|
100
|
+
export function resources(call) {
|
|
101
|
+
return {
|
|
102
|
+
agents: {
|
|
103
|
+
/** Archive the agent: hidden from the lists, kept with its history (POST /agents/{agent_id}/archive). */
|
|
104
|
+
archive: (agentId, options) => call("archiveAgent", [agentId], undefined, undefined, options),
|
|
105
|
+
/** Create an agent home (POST /agents). */
|
|
106
|
+
create: (body, params, options) => call("createAgent", [], body, params, options),
|
|
107
|
+
/** Forget one of the agent's saved sign-ins (DELETE /agents/{agent_id}/sign-ins/{key}). */
|
|
108
|
+
forgetSignIn: (agentId, key, options) => call("forgetSignIn", [agentId, key], undefined, undefined, options),
|
|
109
|
+
/** One agent (GET /agents/{agent_id}). */
|
|
110
|
+
get: (agentId, options) => call("getAgent", [agentId], undefined, undefined, options),
|
|
111
|
+
/** List agents (GET /agents). */
|
|
112
|
+
list: (params, options) => call("listAgents", [], undefined, params, options),
|
|
113
|
+
/** The agent's runs index (GET /agents/{agent_id}/runs). */
|
|
114
|
+
runs: (agentId, params, options) => call("listRuns", [agentId], undefined, params, options),
|
|
115
|
+
/** Show the archived agent in the lists again (POST /agents/{agent_id}/unarchive). */
|
|
116
|
+
unarchive: (agentId, options) => call("unarchiveAgent", [agentId], undefined, undefined, options),
|
|
117
|
+
/** Replace the agent's definition (PUT /agents/{agent_id}/definition). */
|
|
118
|
+
update: (agentId, body, params, options) => call("updateDefinition", [agentId], body, params, options),
|
|
119
|
+
},
|
|
120
|
+
files: {
|
|
121
|
+
/** Reserve an upload (POST /files). */
|
|
122
|
+
create: (body, params, options) => call("createFile", [], body, params, options),
|
|
123
|
+
/** Delete an upload (DELETE /files/{file_id}). */
|
|
124
|
+
delete: (fileId, options) => call("deleteFile", [fileId], undefined, undefined, options),
|
|
125
|
+
/** An upload's record (GET /files/{file_id}). */
|
|
126
|
+
get: (fileId, options) => call("getFile", [fileId], undefined, undefined, options),
|
|
127
|
+
/** This server's uploads, newest first (GET /files). */
|
|
128
|
+
list: (params, options) => call("listFiles", [], undefined, params, options),
|
|
129
|
+
/** Send a reserved file's bytes (PUT /files/{file_id}). */
|
|
130
|
+
upload: (fileId, body, options) => call("uploadFile", [fileId], body, undefined, options),
|
|
131
|
+
},
|
|
132
|
+
home: {
|
|
133
|
+
/** Delete one file of the agent's home (DELETE /agents/{agent_id}/home/files/{path}). */
|
|
134
|
+
delete: (agentId, path, options) => call("deleteHomeFile", [agentId, path], undefined, undefined, options),
|
|
135
|
+
/** Every file in the agent's home (GET /agents/{agent_id}/home/files). */
|
|
136
|
+
list: (agentId, options) => call("listHomeFiles", [agentId], undefined, undefined, options),
|
|
137
|
+
/** One file of the agent's home, raw (GET /agents/{agent_id}/home/files/{path}). */
|
|
138
|
+
read: (agentId, path, params, options) => call("readHomeFile", [agentId, path], undefined, params, options),
|
|
139
|
+
/** Write one file of the agent's home (PUT /agents/{agent_id}/home/files/{path}). */
|
|
140
|
+
write: (agentId, path, body, options) => call("writeHomeFile", [agentId, path], body, undefined, options),
|
|
141
|
+
},
|
|
142
|
+
learning: {
|
|
143
|
+
/** What the agent has learned: its index, notes, log of changes and counts (GET /agents/{agent_id}/learning). */
|
|
144
|
+
get: (agentId, options) => call("getAgentLearning", [agentId], undefined, undefined, options),
|
|
145
|
+
/** A page of the changes on the agent's main, newest first (GET /agents/{agent_id}/learning/log). */
|
|
146
|
+
log: (agentId, params, options) => call("listLearningLog", [agentId], undefined, params, options),
|
|
147
|
+
/** A page of the agent's notes (GET /agents/{agent_id}/learning/notes). */
|
|
148
|
+
notes: (agentId, params, options) => call("listLearningNotes", [agentId], undefined, params, options),
|
|
149
|
+
/** One note (or MEMORY.md, a skill's SKILL.md or a draft's file) on main, as text, with its ETag (GET /agents/{agent_id}/learning/files/{file}). */
|
|
150
|
+
read: (agentId, file, options) => call("readLearningFile", [agentId, file], undefined, undefined, options),
|
|
151
|
+
/** Retire a note, a skill or a workflow draft: out of every later run, kept in history (POST /agents/{agent_id}/learning/files/{file}/retire). */
|
|
152
|
+
retire: (agentId, file, params, options) => call("retireLearningFile", [agentId, file], undefined, params, options),
|
|
153
|
+
/** Edit a note (If-Match) or create one (If-None-Match: *) (PUT /agents/{agent_id}/learning/files/{file}). */
|
|
154
|
+
write: (agentId, file, body, params, options) => call("writeLearningFile", [agentId, file], body, params, options),
|
|
155
|
+
},
|
|
156
|
+
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
|
+
/** Turn Mode 2 off: run folders on this server's own disk (DELETE /workspace/archil). */
|
|
160
|
+
deleteWorkspaceArchil: (options) => call("deleteWorkspaceArchil", [], undefined, undefined, options),
|
|
161
|
+
/** Disconnect GitHub: the App's credentials gone from this server, and every github trigger off (DELETE /integrations/github). */
|
|
162
|
+
disconnectGitHub: (options) => call("disconnectGitHub", [], undefined, undefined, options),
|
|
163
|
+
/** Whether a GitHub App is connected, and if so its id, slug and installations, never a secret (GET /integrations/github). */
|
|
164
|
+
getGitHubConnection: (options) => call("getGitHubConnection", [], undefined, undefined, options),
|
|
165
|
+
/** Whether run folders are on an Archil disk (Mode 2), its settings, and whether its keys are saved (GET /workspace/archil). */
|
|
166
|
+
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
|
+
/** Settings → Computers: the kinds of computer this server offers, each provider and whether its keys are saved (GET /computers). */
|
|
172
|
+
listComputers: (options) => call("listComputers", [], undefined, undefined, options),
|
|
173
|
+
/** Turn Mode 2 on: run folders on this Archil disk (PUT /workspace/archil). */
|
|
174
|
+
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
|
+
/** Save a computer provider's keys, sealed (PUT /computers/{provider}/keys). */
|
|
178
|
+
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
|
+
/** Test a computer provider's account with its saved keys (POST /computers/{provider}/test). */
|
|
182
|
+
testComputer: (provider, options) => call("testComputer", [provider], undefined, undefined, options),
|
|
183
|
+
/** Test the Archil disk with its saved account key (POST /workspace/archil/test). */
|
|
184
|
+
testWorkspaceArchil: (options) => call("testWorkspaceArchil", [], undefined, undefined, options),
|
|
185
|
+
},
|
|
186
|
+
mcpServers: {
|
|
187
|
+
/** Forget a saved MCP server and its credential (DELETE /settings/mcp-servers/{name}). */
|
|
188
|
+
delete: (name, options) => call("deleteMcpServer", [name], undefined, undefined, options),
|
|
189
|
+
/** One saved MCP server; never its credential (GET /settings/mcp-servers/{name}). */
|
|
190
|
+
get: (name, options) => call("getMcpServer", [name], undefined, undefined, options),
|
|
191
|
+
/** The remote MCP servers saved here, with their tools; never a credential (GET /settings/mcp-servers). */
|
|
192
|
+
list: (options) => call("listMcpServers", [], undefined, undefined, options),
|
|
193
|
+
/** This server's OAuth client metadata document (GET /settings/mcp-servers/oauth/client.json). */
|
|
194
|
+
oauthClient: (options) => call("mcpOAuthClient", [], undefined, undefined, options),
|
|
195
|
+
/** Connect to a remote MCP server and list its tools, storing nothing (POST /settings/mcp-servers/preview). */
|
|
196
|
+
preview: (body, options) => call("previewMcpServer", [], body, undefined, options),
|
|
197
|
+
/** The private-network hosts an MCP server's authorization server may be on (GET /settings/mcp-servers/oauth/private-hosts). */
|
|
198
|
+
privateHosts: (options) => call("getMcpPrivateHosts", [], undefined, undefined, options),
|
|
199
|
+
/** List a saved MCP server's tools again, keep them, and say what changed (POST /settings/mcp-servers/{name}/refresh). */
|
|
200
|
+
refresh: (name, options) => call("refreshMcpServer", [name], undefined, undefined, options),
|
|
201
|
+
/** Preview a remote MCP server, then save it with the tools listed and its credential sealed (PUT /settings/mcp-servers/{name}). */
|
|
202
|
+
save: (name, body, options) => call("saveMcpServer", [name], body, undefined, options),
|
|
203
|
+
},
|
|
204
|
+
revisions: {
|
|
205
|
+
/** The agent's revisions, newest first (GET /agents/{agent_id}/revisions). */
|
|
206
|
+
list: (agentId, params, options) => call("listRevisions", [agentId], undefined, params, options),
|
|
207
|
+
/** Make one of the agent's revisions current again (POST /agents/{agent_id}/current). */
|
|
208
|
+
setCurrent: (agentId, body, options) => call("setCurrent", [agentId], body, undefined, options),
|
|
209
|
+
},
|
|
210
|
+
runs: {
|
|
211
|
+
/** Archive the run: hidden from the lists, kept with its history (POST /runs/{run_id}/archive). */
|
|
212
|
+
archive: (runId, options) => call("archiveRun", [runId], undefined, undefined, options),
|
|
213
|
+
/** End the run (POST /runs/{run_id}/cancel). */
|
|
214
|
+
cancel: (runId, options) => call("cancelRun", [runId], undefined, undefined, options),
|
|
215
|
+
/** Start a run of an agent another system owns, given inline (POST /runs). */
|
|
216
|
+
createInlineRun: (body, params, options) => call("createInlineRun", [], body, params, options),
|
|
217
|
+
/** The files the run wrote (GET /runs/{run_id}/files). */
|
|
218
|
+
files: (runId, options) => call("listRunFiles", [runId], undefined, undefined, options),
|
|
219
|
+
/** One run (GET /runs/{run_id}). */
|
|
220
|
+
get: (runId, options) => call("getRun", [runId], undefined, undefined, options),
|
|
221
|
+
/** A workflow run's graph, live (GET /runs/{run_id}/graph). */
|
|
222
|
+
graph: (runId, options) => call("getRunGraph", [runId], undefined, undefined, options),
|
|
223
|
+
/** Hand the run's computer back to the agent, or answer its ask for the owner (POST /runs/{run_id}/computer/hand-back). */
|
|
224
|
+
handBackRunComputer: (runId, body, options) => call("handBackRunComputer", [runId], body, undefined, options),
|
|
225
|
+
/** The run's learning whole: its seed, merge, verdict, problems and cost (GET /runs/{run_id}/learning). */
|
|
226
|
+
learning: (runId, options) => call("getRunLearning", [runId], undefined, undefined, options),
|
|
227
|
+
/** What the run proposed, file by file (GET /runs/{run_id}/learning/diff). */
|
|
228
|
+
learningDiff: (runId, options) => call("getRunLearningDiff", [runId], undefined, undefined, options),
|
|
229
|
+
/** Every agent's runs, newest first (GET /runs). */
|
|
230
|
+
list: (params, options) => call("listAllRuns", [], undefined, params, options),
|
|
231
|
+
/** Send the run a message (POST /runs/{run_id}/messages). */
|
|
232
|
+
message: (runId, body, params, options) => call("sendMessage", [runId], body, params, options),
|
|
233
|
+
/** Pause a workflow run (POST /runs/{run_id}/pause). */
|
|
234
|
+
pause: (runId, options) => call("pauseRun", [runId], undefined, undefined, options),
|
|
235
|
+
/** Raise a run's spend cap (PATCH /runs/{run_id}). */
|
|
236
|
+
raiseCap: (runId, body, options) => call("raiseRunCap", [runId], body, undefined, options),
|
|
237
|
+
/** One file's raw bytes (GET /runs/{run_id}/files/{path}). */
|
|
238
|
+
readFile: (runId, path, params, options) => call("readRunFile", [runId, path], undefined, params, options),
|
|
239
|
+
/** Resume a paused workflow run (POST /runs/{run_id}/resume). */
|
|
240
|
+
resume: (runId, options) => call("resumeRun", [runId], undefined, undefined, options),
|
|
241
|
+
/** Start a run (POST /agents/{agent_id}/runs). */
|
|
242
|
+
start: (agentId, body, params, options) => call("createRun", [agentId], body, params, options),
|
|
243
|
+
/** End the current turn (POST /runs/{run_id}/stop). */
|
|
244
|
+
stop: (runId, options) => call("stopRun", [runId], undefined, undefined, options),
|
|
245
|
+
/** Take over the run's desktop or phone (POST /runs/{run_id}/computer/take-over). */
|
|
246
|
+
takeOverRunComputer: (runId, body, options) => call("takeOverRunComputer", [runId], body, undefined, options),
|
|
247
|
+
/** The run's timeline, as a page or a stream (GET /runs/{run_id}/timeline). */
|
|
248
|
+
timeline: (runId, params, options) => call("getTimeline", [runId], undefined, params, options),
|
|
249
|
+
/** Show the archived run in the lists again (POST /runs/{run_id}/unarchive). */
|
|
250
|
+
unarchive: (runId, options) => call("unarchiveRun", [runId], undefined, undefined, options),
|
|
251
|
+
},
|
|
252
|
+
server: {
|
|
253
|
+
/** What this backend offers (GET /capabilities). */
|
|
254
|
+
capabilities: (options) => call("getCapabilities", [], undefined, undefined, options),
|
|
255
|
+
/** Whether this server can serve (GET /health). */
|
|
256
|
+
health: (options) => call("getHealth", [], undefined, undefined, options),
|
|
257
|
+
/** The MCP endpoint: this API's tools, for a coding agent (POST /mcp). */
|
|
258
|
+
mcp: (body, options) => call("callMcp", [], body, undefined, options),
|
|
259
|
+
/** This document (GET /openapi.json). */
|
|
260
|
+
openapi: (options) => call("getOpenapi", [], undefined, undefined, options),
|
|
261
|
+
},
|
|
262
|
+
/** Counts and cost over every agent and run (GET /stats). */
|
|
263
|
+
stats: (params, options) => call("getStats", [], undefined, params, options),
|
|
264
|
+
/** Usage by meter over a period (GET /usage). */
|
|
265
|
+
usage: (params, options) => call("getUsage", [], undefined, params, options),
|
|
266
|
+
template: {
|
|
267
|
+
/** Apply a template package: make its agent, with its skills, then its triggers (POST /templates/{template}/apply). */
|
|
268
|
+
apply: (template, body, params, options) => call("applyTemplate", [template], body, params, options),
|
|
269
|
+
/** The template packages this server ships: each makes an agent, its skills and its triggers (GET /templates). */
|
|
270
|
+
list: (options) => call("listTemplates", [], undefined, undefined, options),
|
|
271
|
+
},
|
|
272
|
+
toolKeys: {
|
|
273
|
+
/** Forget a tool key's stored fields (DELETE /settings/tool-keys/{key_id}). */
|
|
274
|
+
delete: (keyId, options) => call("deleteToolKey", [keyId], undefined, undefined, options),
|
|
275
|
+
/** The tool keys a person may save, and which are set: names only, never a value (GET /settings/tool-keys). */
|
|
276
|
+
list: (options) => call("listToolKeys", [], undefined, undefined, options),
|
|
277
|
+
/** Save a tool key's fields, sealed (PUT /settings/tool-keys/{key_id}). */
|
|
278
|
+
save: (keyId, body, options) => call("saveToolKey", [keyId], body, undefined, options),
|
|
279
|
+
},
|
|
280
|
+
toolSettings: {
|
|
281
|
+
/** The server's tool settings (GET /settings/tools). */
|
|
282
|
+
get: (options) => call("getToolSettings", [], undefined, undefined, options),
|
|
283
|
+
/** Set the providers of web_search, web_fetch and browser, and each tool's permission (PUT /settings/tools). */
|
|
284
|
+
save: (body, options) => call("putToolSettings", [], body, undefined, options),
|
|
285
|
+
},
|
|
286
|
+
triggers: {
|
|
287
|
+
/** Make a trigger: a schedule or a signed webhook that starts a capped run of an agent, or messages a run (POST /triggers). */
|
|
288
|
+
create: (body, params, options) => call("createTrigger", [], body, params, options),
|
|
289
|
+
/** Delete a trigger and its firings; the runs it started stay (DELETE /triggers/{trigger_id}). */
|
|
290
|
+
delete: (triggerId, options) => call("deleteTrigger", [triggerId], undefined, undefined, options),
|
|
291
|
+
/** Run it now: one firing per Idempotency-Key (POST /triggers/{trigger_id}/fire). */
|
|
292
|
+
fire: (triggerId, params, options) => call("fireTrigger", [triggerId], undefined, params, options),
|
|
293
|
+
/** The trigger's last 200 firings, newest first (GET /triggers/{trigger_id}/firings). */
|
|
294
|
+
firings: (triggerId, options) => call("listTriggerFirings", [triggerId], undefined, undefined, options),
|
|
295
|
+
/** One trigger (GET /triggers/{trigger_id}). */
|
|
296
|
+
get: (triggerId, options) => call("getTrigger", [triggerId], undefined, undefined, options),
|
|
297
|
+
/** The triggers: schedules and signed webhooks that start an agent's capped runs or message a run (GET /triggers). */
|
|
298
|
+
list: (options) => call("listTriggers", [], undefined, undefined, options),
|
|
299
|
+
/** A webhook trigger's new secret, shown once; the old one signs nothing from now on (POST /triggers/{trigger_id}/secret). */
|
|
300
|
+
rotateSecret: (triggerId, options) => call("rotateTriggerSecret", [triggerId], undefined, undefined, options),
|
|
301
|
+
/** Change a trigger, or turn it off and on (PATCH /triggers/{trigger_id}). */
|
|
302
|
+
update: (triggerId, body, options) => call("updateTrigger", [triggerId], body, undefined, options),
|
|
303
|
+
},
|
|
304
|
+
webhook: {
|
|
305
|
+
/** Remove the webhook; its pending messages are dropped, the log of attempts is kept (DELETE /settings/webhook). */
|
|
306
|
+
delete: (options) => call("deleteWebhook", [], undefined, undefined, options),
|
|
307
|
+
/** The last 50 attempts, newest first (GET /settings/webhook/deliveries). */
|
|
308
|
+
deliveries: (options) => call("listWebhookDeliveries", [], undefined, undefined, options),
|
|
309
|
+
/** The webhook this server POSTs run notices to, if one is set; never its secret (GET /settings/webhook). */
|
|
310
|
+
get: (options) => call("getWebhook", [], undefined, undefined, options),
|
|
311
|
+
/** Send a message of the log again, once now, under the same webhook-id and body (POST /settings/webhook/deliveries/{webhook_id}/redeliver). */
|
|
312
|
+
redeliver: (webhookId, options) => call("redeliverWebhook", [webhookId], undefined, undefined, options),
|
|
313
|
+
/** Set the webhook's URL (PUT /settings/webhook). */
|
|
314
|
+
save: (body, options) => call("saveWebhook", [], body, undefined, options),
|
|
315
|
+
/** Send a `webhook.test` message now, once, and say how it went (POST /settings/webhook/test). */
|
|
316
|
+
test: (options) => call("testWebhook", [], undefined, undefined, options),
|
|
317
|
+
},
|
|
318
|
+
workflows: {
|
|
319
|
+
/** Check a workflow definition without saving it (POST /workflows/validate). */
|
|
320
|
+
validate: (body, options) => call("validateWorkflow", [], body, undefined, options),
|
|
321
|
+
},
|
|
322
|
+
};
|
|
323
|
+
}
|
package/dist/scrub.d.ts
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/** Cuts every copy of each secret, in any of its forms, from a JSON value's strings and keys. Two keys the cut makes one
|
|
2
|
+
* are kept apart. */
|
|
3
|
+
export declare function scrubberOf(secrets: readonly string[]): <T>(value: T) => T;
|
|
4
|
+
/** The string values of a secret body, but for its public fields (full paths such as `auth.type`, or `scopes.[]` for
|
|
5
|
+
* each item of a list, as the CLI reads them): the secrets to cut. A value under a map is never public, whatever its
|
|
6
|
+
* key. A body that is not JSON is one secret whole. */
|
|
7
|
+
export declare function secretsOf(body: string, publicFields: readonly string[]): string[];
|
package/dist/scrub.js
ADDED
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
// Cutting secrets from what the server answers: the API key from an error object, and a secret body's values from the
|
|
2
|
+
// answer to it. Always from a JSON value's strings and keys, never from its text, so what is left is still the same JSON
|
|
3
|
+
// with its structure and every other value kept.
|
|
4
|
+
/** The forms a server could quote a secret in: as it is, JSON-escaped and URL-encoded, longest first. */
|
|
5
|
+
const formsOf = (secret) => [...new Set([secret, JSON.stringify(secret).slice(1, -1), encodeURIComponent(secret)])];
|
|
6
|
+
/** Cuts every copy of each secret, in any of its forms, from a JSON value's strings and keys. Two keys the cut makes one
|
|
7
|
+
* are kept apart. */
|
|
8
|
+
export function scrubberOf(secrets) {
|
|
9
|
+
const forms = [...new Set(secrets.filter(Boolean).flatMap(formsOf))].sort((a, b) => b.length - a.length);
|
|
10
|
+
const text = (string) => forms.reduce((at, form) => at.split(form).join("[hidden]"), string);
|
|
11
|
+
const value = (node) => {
|
|
12
|
+
if (typeof node === "string")
|
|
13
|
+
return text(node);
|
|
14
|
+
if (Array.isArray(node))
|
|
15
|
+
return node.map(value);
|
|
16
|
+
if (node === null || typeof node !== "object")
|
|
17
|
+
return node;
|
|
18
|
+
const out = {};
|
|
19
|
+
for (const [key, child] of Object.entries(node)) {
|
|
20
|
+
let name = text(key);
|
|
21
|
+
for (let n = 2; Object.hasOwn(out, name); n++)
|
|
22
|
+
name = `${text(key)} (${n})`;
|
|
23
|
+
// Defined, not assigned: a key named __proto__ is the object's own, as JSON.parse made it.
|
|
24
|
+
Object.defineProperty(out, name, { value: value(child), enumerable: true, writable: true, configurable: true });
|
|
25
|
+
}
|
|
26
|
+
return out;
|
|
27
|
+
};
|
|
28
|
+
return (node) => (forms.length ? value(node) : node);
|
|
29
|
+
}
|
|
30
|
+
/** The string values of a secret body, but for its public fields (full paths such as `auth.type`, or `scopes.[]` for
|
|
31
|
+
* each item of a list, as the CLI reads them): the secrets to cut. A value under a map is never public, whatever its
|
|
32
|
+
* key. A body that is not JSON is one secret whole. */
|
|
33
|
+
export function secretsOf(body, publicFields) {
|
|
34
|
+
let value;
|
|
35
|
+
try {
|
|
36
|
+
value = JSON.parse(body);
|
|
37
|
+
}
|
|
38
|
+
catch {
|
|
39
|
+
return [body];
|
|
40
|
+
}
|
|
41
|
+
const open = new Set(publicFields.map((field) => JSON.stringify(field.split("."))));
|
|
42
|
+
const found = [];
|
|
43
|
+
const walk = (node, path) => {
|
|
44
|
+
if (typeof node === "string") {
|
|
45
|
+
if (!open.has(JSON.stringify(path)))
|
|
46
|
+
found.push(node);
|
|
47
|
+
}
|
|
48
|
+
else if (node && typeof node === "object") {
|
|
49
|
+
for (const [key, child] of Object.entries(node))
|
|
50
|
+
walk(child, Array.isArray(node) ? [...path, "[]"] : [...path, key]);
|
|
51
|
+
}
|
|
52
|
+
};
|
|
53
|
+
walk(value, []);
|
|
54
|
+
return found;
|
|
55
|
+
}
|
package/dist/types.d.ts
ADDED
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
/** Options every method takes. */
|
|
2
|
+
export interface RequestOptions {
|
|
3
|
+
/** Aborts the request; the promise rejects with the signal's reason. */
|
|
4
|
+
signal?: AbortSignal;
|
|
5
|
+
/** How long one try may take, its answer read included, in milliseconds (default: the client's `timeoutMs`). */
|
|
6
|
+
timeoutMs?: number;
|
|
7
|
+
}
|
|
8
|
+
/** Options of an operation whose body may be bytes or text as well as JSON. */
|
|
9
|
+
export interface BodyOptions extends RequestOptions {
|
|
10
|
+
/** The type of a body given as bytes or text (default: the operation's first type that is not JSON). */
|
|
11
|
+
contentType?: string;
|
|
12
|
+
}
|
|
13
|
+
/** Options of a download: with `stream: true` the method resolves to the `Response`, its body unread. */
|
|
14
|
+
export interface DownloadOptions<S extends boolean = false> extends RequestOptions {
|
|
15
|
+
stream?: S;
|
|
16
|
+
}
|
|
17
|
+
/** An answer and its version, the response's ETag: a later write's If-Match. */
|
|
18
|
+
export interface Tagged<T> {
|
|
19
|
+
body: T;
|
|
20
|
+
etag: string | null;
|
|
21
|
+
}
|
|
22
|
+
/** A body sent as it is, not as JSON. */
|
|
23
|
+
export type RawBody = Uint8Array | ArrayBuffer | Blob | string;
|
|
24
|
+
/** What an operation's answer is, by its media types: JSON, text, bytes, a mix decided by the answer's type, or nothing. */
|
|
25
|
+
export type AnswerKind = "none" | "json" | "text" | "bytes" | "json+text" | "json+bytes" | "text+bytes" | "json+text+bytes";
|
|
26
|
+
/** One operation, as the runtime sends it. */
|
|
27
|
+
export interface Operation {
|
|
28
|
+
readonly method: "GET" | "PUT" | "POST" | "PATCH" | "DELETE";
|
|
29
|
+
readonly path: string;
|
|
30
|
+
readonly pathParams: readonly string[];
|
|
31
|
+
/** The path parameters that are file paths: their slashes are kept. Every other one is encoded whole. */
|
|
32
|
+
readonly multiSegment: readonly string[];
|
|
33
|
+
readonly query: readonly string[];
|
|
34
|
+
readonly headers: readonly string[];
|
|
35
|
+
readonly body: null | {
|
|
36
|
+
readonly required: boolean;
|
|
37
|
+
readonly types: readonly string[];
|
|
38
|
+
};
|
|
39
|
+
readonly answer: AnswerKind;
|
|
40
|
+
/** The body carries secrets: each copy is cut from the answer, and a refusal keeps only its code. */
|
|
41
|
+
readonly secret: boolean;
|
|
42
|
+
/** A secret body's string fields that are no secret, by their full path. */
|
|
43
|
+
readonly publicFields: readonly string[];
|
|
44
|
+
/** The answer carries an ETag: it comes back as `{ body, etag }`. */
|
|
45
|
+
readonly tagged: boolean;
|
|
46
|
+
}
|
|
47
|
+
/** How a generated method sends its operation. */
|
|
48
|
+
export type Call = (operationId: string, args: readonly string[], body: unknown, params: object | undefined, options: (RequestOptions & {
|
|
49
|
+
contentType?: string;
|
|
50
|
+
stream?: boolean;
|
|
51
|
+
}) | undefined) => Promise<any>;
|
package/dist/types.js
ADDED
package/package.json
CHANGED
|
@@ -1,6 +1,53 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@parcha/agentrun-client",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"
|
|
5
|
-
"
|
|
6
|
-
|
|
3
|
+
"version": "0.1.0-beta.33",
|
|
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
|
+
"keywords": [
|
|
6
|
+
"agentrun",
|
|
7
|
+
"agent",
|
|
8
|
+
"client",
|
|
9
|
+
"sdk",
|
|
10
|
+
"api"
|
|
11
|
+
],
|
|
12
|
+
"type": "module",
|
|
13
|
+
"license": "Apache-2.0",
|
|
14
|
+
"author": "Parcha Labs, Inc.",
|
|
15
|
+
"engines": {
|
|
16
|
+
"node": ">=24.11.0"
|
|
17
|
+
},
|
|
18
|
+
"main": "./dist/index.js",
|
|
19
|
+
"types": "./dist/index.d.ts",
|
|
20
|
+
"exports": {
|
|
21
|
+
".": {
|
|
22
|
+
"types": "./dist/index.d.ts",
|
|
23
|
+
"default": "./dist/index.js"
|
|
24
|
+
},
|
|
25
|
+
"./package.json": "./package.json"
|
|
26
|
+
},
|
|
27
|
+
"files": [
|
|
28
|
+
"dist",
|
|
29
|
+
"README.md",
|
|
30
|
+
"LICENSE",
|
|
31
|
+
"NOTICE"
|
|
32
|
+
],
|
|
33
|
+
"sideEffects": false,
|
|
34
|
+
"scripts": {
|
|
35
|
+
"build": "rm -rf dist && tsc -p tsconfig.json",
|
|
36
|
+
"prepack": "npm run build",
|
|
37
|
+
"typecheck": "tsc -p tsconfig.json --noEmit",
|
|
38
|
+
"test": "node --test --test-concurrency=2 'test/*.test.mjs'"
|
|
39
|
+
},
|
|
40
|
+
"repository": {
|
|
41
|
+
"type": "git",
|
|
42
|
+
"url": "git+https://github.com/Parcha-ai/agentrun.git",
|
|
43
|
+
"directory": "packages/client"
|
|
44
|
+
},
|
|
45
|
+
"bugs": {
|
|
46
|
+
"url": "https://github.com/Parcha-ai/agentrun/issues"
|
|
47
|
+
},
|
|
48
|
+
"homepage": "https://agentrun.ai",
|
|
49
|
+
"publishConfig": {
|
|
50
|
+
"access": "public",
|
|
51
|
+
"tag": "beta"
|
|
52
|
+
}
|
|
53
|
+
}
|