@parcha/agentrun-client 0.1.0-beta.48 → 0.1.0-beta.49

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.
@@ -267,6 +267,8 @@ export type DefinitionInput = {
267
267
  hold_window?: number;
268
268
  hold_disagree?: number;
269
269
  stop_window?: number;
270
+ repick?: boolean;
271
+ repick_max_chars?: number;
270
272
  };
271
273
  checkout?: "pull_request" | "none";
272
274
  };
@@ -1249,7 +1251,7 @@ export interface CreateAgentParams {
1249
1251
  "Idempotency-Key"?: string;
1250
1252
  }
1251
1253
  export type CreateAgentResponse = Agent;
1252
- /** Delete an agent another system owns (DELETE /agents/{agent_id}). */
1254
+ /** Delete an agent another system owns, or purge an archived agent made here (DELETE /agents/{agent_id}). */
1253
1255
  /** Remove an agent's own Archil disk, and everything on it (DELETE /agents/{agent_id}/archil). */
1254
1256
  export type DeleteAgentArchilResponse = {
1255
1257
  on: boolean;
@@ -3227,6 +3229,7 @@ export type CreateRunComputerViewerResponse = {
3227
3229
  url: string;
3228
3230
  expires_at: string;
3229
3231
  };
3232
+ /** Purge a run's content and keep its cost (DELETE /runs/{run_id}). */
3230
3233
  /** The files the run wrote (GET /runs/{run_id}/files). */
3231
3234
  export type ListRunFilesResponse = RunFileList;
3232
3235
  /** One run (GET /runs/{run_id}). */
@@ -3502,6 +3505,70 @@ export type GetRunTraceResponse = {
3502
3505
  };
3503
3506
  /** Show the archived run in the lists again (POST /runs/{run_id}/unarchive). */
3504
3507
  export type UnarchiveRunResponse = Record<string, unknown>;
3508
+ /** What a run cost, by model, by who charged for its tools, and by browser provider (GET /runs/{run_id}/usage). */
3509
+ export type GetRunUsageResponse = {
3510
+ run_id: Id;
3511
+ ended_at: string | null;
3512
+ currency: "USD";
3513
+ total: {
3514
+ usd: number | null;
3515
+ so_far_usd?: number;
3516
+ unpriced?: number;
3517
+ upper_bound?: true;
3518
+ } | null;
3519
+ lines: Array<{
3520
+ meter: "tokens" | "tools" | "browser_time";
3521
+ model: string | null;
3522
+ provider: string | null;
3523
+ charged_by: string | null;
3524
+ quantity: number | null;
3525
+ unit: "token" | "call" | "second";
3526
+ basis: "reported" | "estimate" | "unpriced";
3527
+ usd: number | null;
3528
+ so_far_usd?: number;
3529
+ unpriced?: number;
3530
+ upper_bound?: true;
3531
+ requests?: number;
3532
+ tokens?: {
3533
+ input: number;
3534
+ output: number;
3535
+ cache_read: number;
3536
+ cache_write: number;
3537
+ };
3538
+ unmetered_requests?: number;
3539
+ not_metered_calls?: number;
3540
+ }> | null;
3541
+ browser_sessions: Array<{
3542
+ provider: string;
3543
+ tag: string;
3544
+ provider_session_id: string | null;
3545
+ started_at: string | null;
3546
+ ended_at: string | null;
3547
+ release_reason: string | null;
3548
+ charged_seconds: number | null;
3549
+ provider_record: {
3550
+ started_at: string | null;
3551
+ ended_at: string | null;
3552
+ proxy_bytes: number | null;
3553
+ } | null;
3554
+ provider_record_status: "read" | "not_offered" | "not_found" | "failed" | "no_session" | null;
3555
+ }> | null;
3556
+ computer_intervals: Array<{
3557
+ provider: string;
3558
+ provider_id: string;
3559
+ kind: string | null;
3560
+ gpu: {
3561
+ type: string | null;
3562
+ count: number | null;
3563
+ } | null;
3564
+ cpus: number | null;
3565
+ memory_mb: number | null;
3566
+ started_at: string;
3567
+ ended_at: string | null;
3568
+ kept: boolean;
3569
+ }> | null;
3570
+ reason: "running" | "not_booked" | "reopened" | null;
3571
+ };
3505
3572
  /** Complete a backend SDK task (POST /sdk-runs/{run_id}/complete). */
3506
3573
  export type CompleteSdkRunBody = {
3507
3574
  status: "completed" | "failed" | "cancelled";
@@ -5363,7 +5430,7 @@ export declare function resources(call: Call): {
5363
5430
  connectNative: (body: ConnectNativeBody, options?: RequestOptions) => Promise<ConnectNativeResponse>;
5364
5431
  /** Create an agent home (POST /agents). */
5365
5432
  create: (body: CreateAgentBody, params?: CreateAgentParams, options?: RequestOptions) => Promise<CreateAgentResponse>;
5366
- /** Delete an agent another system owns (DELETE /agents/{agent_id}). */
5433
+ /** Delete an agent another system owns, or purge an archived agent made here (DELETE /agents/{agent_id}). */
5367
5434
  deleteAgent: (agentId: string, options?: RequestOptions) => Promise<void>;
5368
5435
  /** Remove an agent's own Archil disk, and everything on it (DELETE /agents/{agent_id}/archil). */
5369
5436
  deleteAgentArchil: (agentId: string, options?: RequestOptions) => Promise<DeleteAgentArchilResponse>;
@@ -5579,6 +5646,8 @@ export declare function resources(call: Call): {
5579
5646
  createInlineRun: (body: CreateInlineRunBody, params?: CreateInlineRunParams, options?: RequestOptions) => Promise<CreateInlineRunResponse>;
5580
5647
  /** Mint a link to the run's live view for the backend's user (POST /runs/{run_id}/computer/viewer). */
5581
5648
  createRunComputerViewer: (runId: string, body?: CreateRunComputerViewerBody, options?: RequestOptions) => Promise<CreateRunComputerViewerResponse>;
5649
+ /** Purge a run's content and keep its cost (DELETE /runs/{run_id}). */
5650
+ delete: (runId: string, options?: RequestOptions) => Promise<void>;
5582
5651
  /** The files the run wrote (GET /runs/{run_id}/files). */
5583
5652
  files: (runId: string, options?: RequestOptions) => Promise<ListRunFilesResponse>;
5584
5653
  /** One run (GET /runs/{run_id}). */
@@ -5619,6 +5688,8 @@ export declare function resources(call: Call): {
5619
5688
  trace: (runId: string, options?: RequestOptions) => Promise<GetRunTraceResponse>;
5620
5689
  /** Show the archived run in the lists again (POST /runs/{run_id}/unarchive). */
5621
5690
  unarchive: (runId: string, options?: RequestOptions) => Promise<UnarchiveRunResponse>;
5691
+ /** What a run cost, by model, by who charged for its tools, and by browser provider (GET /runs/{run_id}/usage). */
5692
+ usage: (runId: string, options?: RequestOptions) => Promise<GetRunUsageResponse>;
5622
5693
  };
5623
5694
  sdkRuns: {
5624
5695
  /** Complete a backend SDK task (POST /sdk-runs/{run_id}/complete). */
@@ -106,6 +106,7 @@ export const OPERATIONS = {
106
106
  releaseRunComputer: { "method": "POST", "path": "/runs/{run_id}/computer/release", "pathParams": ["run_id"], "multiSegment": [], "query": [], "headers": [], "body": { "required": false, "types": ["application/json"] }, "answer": "json", "secret": false, "publicFields": [], "tagged": false },
107
107
  createInlineRun: { "method": "POST", "path": "/runs", "pathParams": [], "multiSegment": [], "query": [], "headers": ["Idempotency-Key"], "body": { "required": true, "types": ["application/json"] }, "answer": "json", "secret": false, "publicFields": [], "tagged": false },
108
108
  createRunComputerViewer: { "method": "POST", "path": "/runs/{run_id}/computer/viewer", "pathParams": ["run_id"], "multiSegment": [], "query": [], "headers": [], "body": { "required": false, "types": ["application/json"] }, "answer": "json", "secret": false, "publicFields": [], "tagged": false },
109
+ deleteRun: { "method": "DELETE", "path": "/runs/{run_id}", "pathParams": ["run_id"], "multiSegment": [], "query": [], "headers": [], "body": null, "answer": "none", "secret": false, "publicFields": [], "tagged": false },
109
110
  listRunFiles: { "method": "GET", "path": "/runs/{run_id}/files", "pathParams": ["run_id"], "multiSegment": [], "query": [], "headers": [], "body": null, "answer": "json", "secret": false, "publicFields": [], "tagged": false },
110
111
  getRun: { "method": "GET", "path": "/runs/{run_id}", "pathParams": ["run_id"], "multiSegment": [], "query": [], "headers": [], "body": null, "answer": "json", "secret": false, "publicFields": [], "tagged": false },
111
112
  gradeRun: { "method": "PUT", "path": "/runs/{run_id}/grade", "pathParams": ["run_id"], "multiSegment": [], "query": [], "headers": [], "body": { "required": true, "types": ["application/json"] }, "answer": "json", "secret": false, "publicFields": [], "tagged": false },
@@ -126,6 +127,7 @@ export const OPERATIONS = {
126
127
  getTimeline: { "method": "GET", "path": "/runs/{run_id}/timeline", "pathParams": ["run_id"], "multiSegment": [], "query": ["after", "wait_ms", "limit", "calls"], "headers": ["Last-Event-ID"], "body": null, "answer": "json", "secret": false, "publicFields": [], "tagged": false },
127
128
  getRunTrace: { "method": "GET", "path": "/runs/{run_id}/trace", "pathParams": ["run_id"], "multiSegment": [], "query": [], "headers": [], "body": null, "answer": "json", "secret": false, "publicFields": [], "tagged": false },
128
129
  unarchiveRun: { "method": "POST", "path": "/runs/{run_id}/unarchive", "pathParams": ["run_id"], "multiSegment": [], "query": [], "headers": [], "body": null, "answer": "json", "secret": false, "publicFields": [], "tagged": false },
130
+ getRunUsage: { "method": "GET", "path": "/runs/{run_id}/usage", "pathParams": ["run_id"], "multiSegment": [], "query": [], "headers": [], "body": null, "answer": "json", "secret": false, "publicFields": [], "tagged": false },
129
131
  completeSdkRun: { "method": "POST", "path": "/sdk-runs/{run_id}/complete", "pathParams": ["run_id"], "multiSegment": [], "query": [], "headers": ["Idempotency-Key"], "body": { "required": true, "types": ["application/json"] }, "answer": "json", "secret": false, "publicFields": [], "tagged": false },
130
132
  sdkRunEvents: { "method": "POST", "path": "/sdk-runs/{run_id}/events", "pathParams": ["run_id"], "multiSegment": [], "query": [], "headers": ["Idempotency-Key"], "body": { "required": true, "types": ["application/json"] }, "answer": "json", "secret": false, "publicFields": [], "tagged": false },
131
133
  getSdkRun: { "method": "GET", "path": "/sdk-runs/{run_id}", "pathParams": ["run_id"], "multiSegment": [], "query": [], "headers": [], "body": null, "answer": "json", "secret": false, "publicFields": [], "tagged": false },
@@ -178,7 +180,7 @@ export function resources(call) {
178
180
  connectNative: (body, options) => call("connectNative", [], body, undefined, options),
179
181
  /** Create an agent home (POST /agents). */
180
182
  create: (body, params, options) => call("createAgent", [], body, params, options),
181
- /** Delete an agent another system owns (DELETE /agents/{agent_id}). */
183
+ /** Delete an agent another system owns, or purge an archived agent made here (DELETE /agents/{agent_id}). */
182
184
  deleteAgent: (agentId, options) => call("deleteAgent", [agentId], undefined, undefined, options),
183
185
  /** Remove an agent's own Archil disk, and everything on it (DELETE /agents/{agent_id}/archil). */
184
186
  deleteAgentArchil: (agentId, options) => call("deleteAgentArchil", [agentId], undefined, undefined, options),
@@ -394,6 +396,8 @@ export function resources(call) {
394
396
  createInlineRun: (body, params, options) => call("createInlineRun", [], body, params, options),
395
397
  /** Mint a link to the run's live view for the backend's user (POST /runs/{run_id}/computer/viewer). */
396
398
  createRunComputerViewer: (runId, body, options) => call("createRunComputerViewer", [runId], body, undefined, options),
399
+ /** Purge a run's content and keep its cost (DELETE /runs/{run_id}). */
400
+ delete: (runId, options) => call("deleteRun", [runId], undefined, undefined, options),
397
401
  /** The files the run wrote (GET /runs/{run_id}/files). */
398
402
  files: (runId, options) => call("listRunFiles", [runId], undefined, undefined, options),
399
403
  /** One run (GET /runs/{run_id}). */
@@ -434,6 +438,8 @@ export function resources(call) {
434
438
  trace: (runId, options) => call("getRunTrace", [runId], undefined, undefined, options),
435
439
  /** Show the archived run in the lists again (POST /runs/{run_id}/unarchive). */
436
440
  unarchive: (runId, options) => call("unarchiveRun", [runId], undefined, undefined, options),
441
+ /** What a run cost, by model, by who charged for its tools, and by browser provider (GET /runs/{run_id}/usage). */
442
+ usage: (runId, options) => call("getRunUsage", [runId], undefined, undefined, options),
437
443
  },
438
444
  sdkRuns: {
439
445
  /** Complete a backend SDK task (POST /sdk-runs/{run_id}/complete). */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@parcha/agentrun-client",
3
- "version": "0.1.0-beta.48",
3
+ "version": "0.1.0-beta.49",
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",
@@ -83,6 +83,6 @@
83
83
  }
84
84
  },
85
85
  "devDependencies": {
86
- "@parcha/agentrun-dsl": "0.1.0-beta.48"
86
+ "@parcha/agentrun-dsl": "0.1.0-beta.49"
87
87
  }
88
88
  }