@parcha/agentrun-client 0.1.0-beta.45 → 0.1.0-beta.47

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.
@@ -1,5 +1,5 @@
1
1
  import { AgentRun, type ClientOptions } from './client.js';
2
- export type BackendSdkRuntime = 'claude-agent-sdk' | 'codex-sdk';
2
+ export type BackendSdkRuntime = 'claude-agent-sdk' | 'codex-sdk' | 'eve';
3
3
  export interface BackendWorkflowToolManifest {
4
4
  name: string;
5
5
  description: string;
@@ -16,11 +16,20 @@ export interface BackendWorkflowBinding {
16
16
  /** Consume one actual bridge completion with identical arguments, status and result. No match keeps native evidence. */
17
17
  claimNativeEnvelope?(name: string, input: unknown, status: 'completed' | 'failed', output: unknown): boolean;
18
18
  }
19
+ /** The pinned run and evidence sink a workflow host must provide. Durable hosts can persist evidence in
20
+ * their native result instead of depending on an in-memory SDK session or HTTP connection. */
21
+ export interface BackendWorkflowSession {
22
+ readonly runId: string;
23
+ readonly workflows: NonNullable<BackendLearningSnapshot['workflows']>;
24
+ protect(values: readonly string[]): void;
25
+ event(event: SdkLearningEvent): Promise<void>;
26
+ markEvidenceIncomplete(reason: string): void;
27
+ }
19
28
  /** Structural seam: importing the base client does not load the optional workflow interpreter or MCP server. */
20
29
  export interface BackendWorkflowBridge {
21
30
  readonly catalog: readonly BackendWorkflowToolManifest[];
22
31
  readonly adapters: readonly ('runNode' | 'runJudge')[];
23
- bind(session: BackendLearningSession): BackendWorkflowBinding;
32
+ bind(session: BackendWorkflowSession): BackendWorkflowBinding;
24
33
  }
25
34
  /** The learning loop's numbers an agent definition may set (`learning: {...}`); each one left out is the server's default. */
26
35
  export interface BackendLearningLoop {
package/dist/learning.js CHANGED
@@ -88,7 +88,7 @@ export class BackendLearningClient {
88
88
  }
89
89
  async begin(source, signal) {
90
90
  signal?.throwIfAborted();
91
- if (source.runtime !== 'claude-agent-sdk' && source.runtime !== 'codex-sdk')
91
+ if (source.runtime !== 'claude-agent-sdk' && source.runtime !== 'codex-sdk' && source.runtime !== 'eve')
92
92
  throw new AgentRunUsage('Unsupported backend SDK runtime.');
93
93
  if (typeof source.input !== 'string' || typeof source.instructions !== 'string')
94
94
  throw new AgentRunUsage('SDK input and source instructions must be strings.');
@@ -65,10 +65,10 @@ export type Agent = {
65
65
  default_permission: "allow" | "ask" | "deny";
66
66
  permissions: Array<"allow" | "ask" | "deny">;
67
67
  }>;
68
- kind?: "agentic" | "workflow" | null;
69
- revision?: string | null;
70
- revisions?: number;
71
- archived_at?: string | null;
68
+ kind: "agentic" | "workflow" | null;
69
+ revision: string | null;
70
+ revisions: number;
71
+ archived_at: string | null;
72
72
  learning?: {
73
73
  pending: number;
74
74
  };
@@ -97,6 +97,10 @@ export type Agent = {
97
97
  version: string;
98
98
  sha: string | null;
99
99
  } | null;
100
+ run_blockers?: {
101
+ message: string;
102
+ fields: Array<InputIssue>;
103
+ } | null;
100
104
  warnings?: Array<InputIssue>;
101
105
  };
102
106
  export type Id = string;
@@ -114,7 +118,7 @@ export type DefinitionInput = {
114
118
  workflow?: JsonObject;
115
119
  max_cost_usd?: number;
116
120
  sdk?: {
117
- runtime: "claude-agent-sdk" | "codex-sdk";
121
+ runtime: "claude-agent-sdk" | "codex-sdk" | "eve";
118
122
  };
119
123
  native?: {
120
124
  runtime: "claude-code" | "codex";
@@ -256,6 +260,7 @@ export type DefinitionInput = {
256
260
  compile_after?: number;
257
261
  agree_min?: number;
258
262
  alone_min?: number;
263
+ agree_on?: Array<string>;
259
264
  audit_every?: number;
260
265
  audit_every_later?: number;
261
266
  audit_later_after?: number;
@@ -326,7 +331,7 @@ export type RunSummary = {
326
331
  ended_at: Timestamp | null;
327
332
  cost: Cost;
328
333
  sdk?: {
329
- runtime: "claude-agent-sdk" | "codex-sdk";
334
+ runtime: "claude-agent-sdk" | "codex-sdk" | "eve";
330
335
  model: string | null;
331
336
  session_id: string | null;
332
337
  learning_revision: string | null;
@@ -440,19 +445,35 @@ export type RunSummary = {
440
445
  id: string;
441
446
  firing_key: string;
442
447
  } | null;
448
+ path?: "agent" | "handed_back" | "workflow" | "replay" | "audit" | null;
449
+ workflow?: {
450
+ name: string | null;
451
+ digest: string | null;
452
+ repick: "found" | "missed" | null;
453
+ } | null;
443
454
  };
444
455
  export type RunStatus = "queued" | "working" | "paused" | "input_required" | "completed" | "failed" | "cancelled";
445
456
  export type RunState = "working" | "waiting" | "idle";
446
457
  export type Cost = {
447
458
  usd: number | null;
448
- basis: "charge" | "estimate";
459
+ basis: "charge" | "estimate" | "reported" | "unpriced";
449
460
  charge_state?: "held" | "settled" | "released" | null;
450
461
  cap_usd?: number | null;
451
462
  free?: true;
452
463
  so_far_usd?: number;
453
464
  unpriced?: number;
454
465
  upper_bound?: true;
466
+ unknown?: "booking_unread";
467
+ tokens?: {
468
+ input: number;
469
+ output: number;
470
+ cache_read: number;
471
+ cache_write: number;
472
+ requests?: number;
473
+ unmetered?: number;
474
+ };
455
475
  learning_usd?: number | null;
476
+ tools_usd?: number | null;
456
477
  all_in_usd?: number | null;
457
478
  plan?: {
458
479
  requests: number;
@@ -470,7 +491,7 @@ export type RunError = {
470
491
  reason: "server_lost_at_launch" | "server_lost_at_setup";
471
492
  };
472
493
  };
473
- export type RunErrorCode = "run_failed" | "moderated" | "agent_not_runnable" | "needs_connection" | "needs_reconnect" | "connection_revoked" | "output_invalid" | "spend_cap_reached" | "wall_clock_timeout" | "input_expired" | "internal";
494
+ export type RunErrorCode = "run_failed" | "moderated" | "agent_not_runnable" | "needs_connection" | "needs_reconnect" | "connection_revoked" | "output_invalid" | "spend_cap_reached" | "wall_clock_timeout" | "input_expired" | "internal" | "computer_unavailable" | "runner_refused";
474
495
  export type NextAction = RequestAction | PersonAction;
475
496
  export type RequestAction = {
476
497
  type: "request";
@@ -529,7 +550,7 @@ export type RunCreateInline = {
529
550
  model_key?: string;
530
551
  mcp_auth?: Record<string, {
531
552
  headers: Record<string, string>;
532
- }>;
553
+ } | ComposioRunBinding>;
533
554
  labels?: Record<string, string>;
534
555
  workflow_first?: boolean;
535
556
  learning?: "use";
@@ -546,6 +567,10 @@ export type ExternalRef = {
546
567
  id: string;
547
568
  version: string | number;
548
569
  };
570
+ export type ComposioRunBinding = {
571
+ composio_user_id: string;
572
+ connected_account_id?: string;
573
+ };
549
574
  export type Run = {
550
575
  run_id: Id;
551
576
  agent_id: Id;
@@ -563,7 +588,7 @@ export type Run = {
563
588
  cost: Cost;
564
589
  poll_after_ms: number;
565
590
  sdk?: {
566
- runtime: "claude-agent-sdk" | "codex-sdk";
591
+ runtime: "claude-agent-sdk" | "codex-sdk" | "eve";
567
592
  model: string | null;
568
593
  session_id: string | null;
569
594
  learning_revision: string | null;
@@ -712,6 +737,11 @@ export type Run = {
712
737
  } | null;
713
738
  audit_of?: string | null;
714
739
  path?: "agent" | "handed_back" | "workflow" | "replay" | "audit" | null;
740
+ workflow?: {
741
+ name: string | null;
742
+ digest: string | null;
743
+ repick: "found" | "missed" | null;
744
+ } | null;
715
745
  };
716
746
  export type RunResult = {
717
747
  output: unknown;
@@ -736,7 +766,7 @@ export type MessageCreate = {
736
766
  model_key?: string;
737
767
  mcp_auth?: Record<string, {
738
768
  headers: Record<string, string>;
739
- }>;
769
+ } | ComposioRunBinding>;
740
770
  };
741
771
  export type MessageResult = {
742
772
  run_id: Id;
@@ -755,7 +785,7 @@ export type RunCreate = {
755
785
  model_key?: string;
756
786
  mcp_auth?: Record<string, {
757
787
  headers: Record<string, string>;
758
- }>;
788
+ } | ComposioRunBinding>;
759
789
  labels?: Record<string, string>;
760
790
  workflow_first?: boolean;
761
791
  learning?: "use";
@@ -911,7 +941,7 @@ export type Capabilities = {
911
941
  default_reason?: string;
912
942
  allow: Array<string>;
913
943
  };
914
- harnesses?: Array<{
944
+ harnesses: Array<{
915
945
  id: string;
916
946
  label: string;
917
947
  promises: {
@@ -932,6 +962,7 @@ export type Capabilities = {
932
962
  reason?: string;
933
963
  needs?: Array<"key" | "chatgpt">;
934
964
  installs?: "on_first_use";
965
+ card?: string;
935
966
  }>;
936
967
  tools: Array<{
937
968
  name: string;
@@ -997,6 +1028,12 @@ export type Capabilities = {
997
1028
  limit: string;
998
1029
  };
999
1030
  run_isolation?: "uid" | "process";
1031
+ runner_refused?: string | null;
1032
+ switches: Record<string, {
1033
+ on: boolean;
1034
+ value: string | null;
1035
+ allows: string;
1036
+ }>;
1000
1037
  };
1001
1038
  export type Features = {
1002
1039
  agents: {
@@ -1080,6 +1117,11 @@ export type Features = {
1080
1117
  signing: "standard-webhooks/v1";
1081
1118
  at_rest: "sealed";
1082
1119
  };
1120
+ slack?: {
1121
+ routes: boolean;
1122
+ events: Array<"run.needs_input" | "run.ended" | "trigger.failed">;
1123
+ at_rest: "sealed";
1124
+ };
1083
1125
  triggers?: {
1084
1126
  routes: boolean;
1085
1127
  sources: Array<"schedule" | "webhook" | "github" | "composio" | "email" | "feed">;
@@ -1126,7 +1168,7 @@ export type Usage = {
1126
1168
  from: Timestamp;
1127
1169
  to: Timestamp;
1128
1170
  currency: "USD";
1129
- basis: "charge" | "estimate";
1171
+ basis: "charge" | "estimate" | "reported" | "unpriced";
1130
1172
  group_by: "meter" | "agent" | "key" | "day" | "region";
1131
1173
  total_usd: number | null;
1132
1174
  lines: Array<UsageLine>;
@@ -1408,6 +1450,8 @@ export type ListLearningPromotionsResponse = {
1408
1450
  agree_min: number;
1409
1451
  alone_min: number;
1410
1452
  attempt: 1 | 2;
1453
+ agree_on?: Array<string>;
1454
+ grader?: string;
1411
1455
  n?: number;
1412
1456
  agreed?: number;
1413
1457
  alone?: number;
@@ -1432,6 +1476,7 @@ export type ListLearningPromotionsResponse = {
1432
1476
  draft?: string;
1433
1477
  escalated?: string;
1434
1478
  failed?: true;
1479
+ differs_on?: string;
1435
1480
  }>;
1436
1481
  stopped?: true;
1437
1482
  };
@@ -1491,6 +1536,8 @@ export type ListLearningPromotionsResponse = {
1491
1536
  agree_min: number;
1492
1537
  alone_min: number;
1493
1538
  attempt: 1 | 2;
1539
+ agree_on?: Array<string>;
1540
+ grader?: string;
1494
1541
  n?: number;
1495
1542
  agreed?: number;
1496
1543
  alone?: number;
@@ -1515,6 +1562,7 @@ export type ListLearningPromotionsResponse = {
1515
1562
  draft?: string;
1516
1563
  escalated?: string;
1517
1564
  failed?: true;
1565
+ differs_on?: string;
1518
1566
  }>;
1519
1567
  stopped?: true;
1520
1568
  } | null;
@@ -1899,15 +1947,6 @@ export type GetLearningCostResponse = {
1899
1947
  } | null;
1900
1948
  };
1901
1949
  bill: {
1902
- baseline: {
1903
- runs: number;
1904
- mean_usd: number;
1905
- } | null;
1906
- promoted: {
1907
- n: number;
1908
- run_id: string;
1909
- at: string;
1910
- } | null;
1911
1950
  learning_usd: number;
1912
1951
  points: Array<{
1913
1952
  n: number;
@@ -2111,6 +2150,25 @@ export type DeleteComposioSubscriptionResponse = {
2111
2150
  };
2112
2151
  /** Remove a paired computer: its token ends and its socket closes (DELETE /computers/{computer_id}). */
2113
2152
  /** Forget this server's email account (DELETE /settings/email). */
2153
+ /** Stop using the saved model gateway: the provider keys are back in force (DELETE /settings/model-gateway). */
2154
+ export type DeleteModelGatewayResponse = {
2155
+ source: "env" | "console" | null;
2156
+ base_url: string | null;
2157
+ ids: "as_named" | "bare";
2158
+ models: {
2159
+ default: string | null;
2160
+ fast: string | null;
2161
+ strong: string | null;
2162
+ };
2163
+ set_at_start: Array<string>;
2164
+ secret: {
2165
+ name: string;
2166
+ set: boolean;
2167
+ source: "env" | "console" | "sign-in" | null;
2168
+ changed_at: string | null;
2169
+ };
2170
+ problem: string | null;
2171
+ };
2114
2172
  /** Turn Mode 2 off: run folders on this server's own disk (DELETE /workspace/archil). */
2115
2173
  export type DeleteWorkspaceArchilResponse = {
2116
2174
  on: boolean;
@@ -2201,6 +2259,25 @@ export type GetGitHubConnectionResponse = {
2201
2259
  account: string;
2202
2260
  }>;
2203
2261
  };
2262
+ /** The model gateway in force: the environment's, the one saved here, or none (GET /settings/model-gateway). */
2263
+ export type GetModelGatewayResponse = {
2264
+ source: "env" | "console" | null;
2265
+ base_url: string | null;
2266
+ ids: "as_named" | "bare";
2267
+ models: {
2268
+ default: string | null;
2269
+ fast: string | null;
2270
+ strong: string | null;
2271
+ };
2272
+ set_at_start: Array<string>;
2273
+ secret: {
2274
+ name: string;
2275
+ set: boolean;
2276
+ source: "env" | "console" | "sign-in" | null;
2277
+ changed_at: string | null;
2278
+ };
2279
+ problem: string | null;
2280
+ };
2204
2281
  /** Whether run folders are on Archil disks (Mode 2), the settings, and whether its keys are saved (GET /workspace/archil). */
2205
2282
  export type GetWorkspaceArchilResponse = {
2206
2283
  on: boolean;
@@ -2322,6 +2399,7 @@ export type ListComputersResponse = {
2322
2399
  offered: boolean;
2323
2400
  groups: Array<string>;
2324
2401
  tools: Array<string>;
2402
+ settings: Array<string>;
2325
2403
  providers: Array<{
2326
2404
  id: string;
2327
2405
  name: string;
@@ -2454,6 +2532,8 @@ export type SaveComposioServerBody = {
2454
2532
  toolkit: string;
2455
2533
  tools: Array<string>;
2456
2534
  user_id?: string;
2535
+ auth_config_id?: string;
2536
+ price_usd?: number;
2457
2537
  };
2458
2538
  export type SaveComposioServerResponse = {
2459
2539
  server: {
@@ -2577,6 +2657,35 @@ export type SaveEmailAccountResponse = {
2577
2657
  } | null;
2578
2658
  password_unreadable: boolean;
2579
2659
  };
2660
+ /** Use a model gateway for every model, saved here (PUT /settings/model-gateway). Its body's string values are secrets: each copy is cut from the answer, and a refusal keeps only its code. */
2661
+ export type SaveModelGatewayBody = {
2662
+ base_url: string;
2663
+ api_key?: string | null;
2664
+ ids?: "as_named" | "bare";
2665
+ models?: {
2666
+ default?: string;
2667
+ fast?: string | null;
2668
+ strong?: string | null;
2669
+ };
2670
+ };
2671
+ export type SaveModelGatewayResponse = {
2672
+ source: "env" | "console" | null;
2673
+ base_url: string | null;
2674
+ ids: "as_named" | "bare";
2675
+ models: {
2676
+ default: string | null;
2677
+ fast: string | null;
2678
+ strong: string | null;
2679
+ };
2680
+ set_at_start: Array<string>;
2681
+ secret: {
2682
+ name: string;
2683
+ set: boolean;
2684
+ source: "env" | "console" | "sign-in" | null;
2685
+ changed_at: string | null;
2686
+ };
2687
+ problem: string | null;
2688
+ };
2580
2689
  /** Sign out of ChatGPT: the session revoked at OpenAI, then forgotten here (DELETE /settings/chatgpt). */
2581
2690
  export type SignOutChatGPTResponse = {
2582
2691
  revoked: boolean;
@@ -2654,6 +2763,18 @@ export type TestEmailAccountResponse = {
2654
2763
  message: string;
2655
2764
  };
2656
2765
  };
2766
+ /** Ask a model gateway which models it serves (POST /settings/model-gateway/test). Its body's string values are secrets: each copy is cut from the answer, and a refusal keeps only its code. */
2767
+ export type TestModelGatewayBody = {
2768
+ base_url?: string;
2769
+ api_key?: string | null;
2770
+ };
2771
+ export type TestModelGatewayResponse = {
2772
+ ok: true;
2773
+ models: Array<string>;
2774
+ } | {
2775
+ ok: false;
2776
+ why: string;
2777
+ };
2657
2778
  /** Test the Archil account key at its region's control plane (POST /workspace/archil/test). */
2658
2779
  export type TestWorkspaceArchilResponse = {
2659
2780
  ok: true;
@@ -3410,7 +3531,7 @@ export type GetSdkRunResponse = {
3410
3531
  };
3411
3532
  /** Register a task executed by an existing backend SDK (POST /agents/{agent_id}/sdk-runs). */
3412
3533
  export type StartSdkRunBody = {
3413
- runtime: "claude-agent-sdk" | "codex-sdk";
3534
+ runtime: "claude-agent-sdk" | "codex-sdk" | "eve";
3414
3535
  input: string;
3415
3536
  instructions: string;
3416
3537
  model?: string;
@@ -3447,11 +3568,13 @@ export type StartSdkRunResponse = {
3447
3568
  export type GetCapabilitiesResponse = Capabilities;
3448
3569
  /** Whether this server can serve (GET /health). */
3449
3570
  export type GetHealthResponse = {
3450
- status: "ok" | "failing" | "warming";
3571
+ status: "ok" | "degraded" | "failing" | "warming";
3451
3572
  checks: {
3452
3573
  store: "ok" | "does_not_open" | "opening";
3453
3574
  disk: "ok" | "below_floor" | "cannot_check";
3575
+ runner?: "refused";
3454
3576
  };
3577
+ runner_refused?: string;
3455
3578
  };
3456
3579
  /** The MCP endpoint: this API's tools, for a coding agent (POST /mcp). */
3457
3580
  export type CallMcpBody = {
@@ -3471,6 +3594,92 @@ export type CallMcpResponse = {
3471
3594
  };
3472
3595
  /** This document (GET /openapi.json). */
3473
3596
  export type GetOpenapiResponse = Record<string, unknown>;
3597
+ /** Remove Slack; its pending messages are dropped, the log of attempts is kept (DELETE /settings/slack). */
3598
+ /** Slack's last 50 attempts, newest first (GET /settings/slack/deliveries). */
3599
+ export type ListSlackDeliveriesResponse = {
3600
+ attempts: Array<{
3601
+ webhook_id: string;
3602
+ type: "run.needs_input" | "run.ended" | "trigger.failed" | "slack.test";
3603
+ at: string;
3604
+ status_code: number | null;
3605
+ latency_ms: number;
3606
+ error: string | null;
3607
+ retry_at: string | null;
3608
+ redelivery: boolean;
3609
+ }>;
3610
+ };
3611
+ /** Where this server posts run notices in Slack, if it is set; never the URL (GET /settings/slack). */
3612
+ export type GetSlackResponse = {
3613
+ configured: false;
3614
+ secret: SecretMeta;
3615
+ events: {
3616
+ "run.needs_input": boolean;
3617
+ "run.ended": boolean;
3618
+ "trigger.failed": boolean;
3619
+ };
3620
+ } | {
3621
+ configured: true;
3622
+ url: string;
3623
+ url_state: "sealed" | "unreadable";
3624
+ secret: SecretMeta;
3625
+ events: {
3626
+ "run.needs_input": boolean;
3627
+ "run.ended": boolean;
3628
+ "trigger.failed": boolean;
3629
+ };
3630
+ disabled: {
3631
+ at: string;
3632
+ reason: string;
3633
+ } | null;
3634
+ updated_at: string;
3635
+ };
3636
+ /** Post a message of Slack's log again, once now, under the same id and body (POST /settings/slack/deliveries/{webhook_id}/redeliver). */
3637
+ export type RedeliverSlackResponse = {
3638
+ webhook_id: string;
3639
+ type: "run.needs_input" | "run.ended" | "trigger.failed" | "slack.test";
3640
+ at: string;
3641
+ status_code: number | null;
3642
+ latency_ms: number;
3643
+ error: string | null;
3644
+ retry_at: string | null;
3645
+ redelivery: boolean;
3646
+ };
3647
+ /** Set Slack's incoming-webhook URL, or which events it is sent (PUT /settings/slack). Its body's string values are secrets: each copy is cut from the answer, and a refusal keeps only its code. */
3648
+ export type SaveSlackBody = {
3649
+ url?: string;
3650
+ events?: {
3651
+ "run.needs_input"?: boolean;
3652
+ "run.ended"?: boolean;
3653
+ "trigger.failed"?: boolean;
3654
+ };
3655
+ };
3656
+ export type SaveSlackResponse = {
3657
+ configured: true;
3658
+ url: string;
3659
+ url_state: "sealed" | "unreadable";
3660
+ secret: SecretMeta;
3661
+ events: {
3662
+ "run.needs_input": boolean;
3663
+ "run.ended": boolean;
3664
+ "trigger.failed": boolean;
3665
+ };
3666
+ disabled: {
3667
+ at: string;
3668
+ reason: string;
3669
+ } | null;
3670
+ updated_at: string;
3671
+ };
3672
+ /** Post a test message to Slack now, once, and say how it went (POST /settings/slack/test). */
3673
+ export type TestSlackResponse = {
3674
+ webhook_id: string;
3675
+ type: "run.needs_input" | "run.ended" | "trigger.failed" | "slack.test";
3676
+ at: string;
3677
+ status_code: number | null;
3678
+ latency_ms: number;
3679
+ error: string | null;
3680
+ retry_at: string | null;
3681
+ redelivery: boolean;
3682
+ };
3474
3683
  /** Counts and cost over every agent and run (GET /stats). */
3475
3684
  export interface GetStatsParams {
3476
3685
  from?: string;
@@ -3494,7 +3703,7 @@ export type GetStatsResponse = {
3494
3703
  }>;
3495
3704
  cost: {
3496
3705
  usd: number | null;
3497
- basis: "estimate" | null;
3706
+ basis: "reported" | "estimate" | "unpriced" | null;
3498
3707
  unknown_runs: number;
3499
3708
  };
3500
3709
  archived: {
@@ -3691,7 +3900,7 @@ export type ImportTemplateResponse = {
3691
3900
  budget: {
3692
3901
  per_run_usd: number;
3693
3902
  } | null;
3694
- learning: boolean;
3903
+ learning: boolean | Record<string, unknown>;
3695
3904
  approvals_default: "ask" | "never";
3696
3905
  triggers: Array<Record<string, unknown>>;
3697
3906
  skills: Array<string>;
@@ -3782,7 +3991,7 @@ export type ListTemplatesResponse = {
3782
3991
  budget: {
3783
3992
  per_run_usd: number;
3784
3993
  } | null;
3785
- learning: boolean;
3994
+ learning: boolean | Record<string, unknown>;
3786
3995
  approvals_default: "ask" | "never";
3787
3996
  triggers: Array<Record<string, unknown>>;
3788
3997
  skills: Array<string>;
@@ -5019,6 +5228,19 @@ export type RedeliverWebhookResponse = {
5019
5228
  retry_at: string | null;
5020
5229
  redelivery: boolean;
5021
5230
  };
5231
+ /** The webhook's new signing secret, shown once; the old one signs nothing from now on (POST /settings/webhook/secret). Its body's string values are secrets: each copy is cut from the answer, and a refusal keeps only its code. */
5232
+ export type RotateWebhookSecretResponse = {
5233
+ configured: true;
5234
+ url: string;
5235
+ secret: SecretMeta;
5236
+ signing: "sealed" | "unreadable";
5237
+ disabled: {
5238
+ at: string;
5239
+ reason: string;
5240
+ } | null;
5241
+ updated_at: string;
5242
+ signing_secret: string;
5243
+ };
5022
5244
  /** Set the webhook's URL (PUT /settings/webhook). */
5023
5245
  export type SaveWebhookBody = {
5024
5246
  url: string;
@@ -5198,6 +5420,8 @@ export declare function resources(call: Call): {
5198
5420
  deleteComputer: (computerId: string, options?: RequestOptions) => Promise<void>;
5199
5421
  /** Forget this server's email account (DELETE /settings/email). */
5200
5422
  deleteEmailAccount: (options?: RequestOptions) => Promise<void>;
5423
+ /** Stop using the saved model gateway: the provider keys are back in force (DELETE /settings/model-gateway). */
5424
+ deleteModelGateway: (options?: RequestOptions) => Promise<DeleteModelGatewayResponse>;
5201
5425
  /** Turn Mode 2 off: run folders on this server's own disk (DELETE /workspace/archil). */
5202
5426
  deleteWorkspaceArchil: (options?: RequestOptions) => Promise<DeleteWorkspaceArchilResponse>;
5203
5427
  /** Disconnect GitHub: the App's credentials gone from this server, and every github trigger off (DELETE /integrations/github). */
@@ -5214,6 +5438,8 @@ export declare function resources(call: Call): {
5214
5438
  getEmailAccount: (options?: RequestOptions) => Promise<GetEmailAccountResponse>;
5215
5439
  /** Whether a GitHub App is connected, and if so its id, slug and installations, never a secret (GET /integrations/github). */
5216
5440
  getGitHubConnection: (options?: RequestOptions) => Promise<GetGitHubConnectionResponse>;
5441
+ /** The model gateway in force: the environment's, the one saved here, or none (GET /settings/model-gateway). */
5442
+ getModelGateway: (options?: RequestOptions) => Promise<GetModelGatewayResponse>;
5217
5443
  /** Whether run folders are on Archil disks (Mode 2), the settings, and whether its keys are saved (GET /workspace/archil). */
5218
5444
  getWorkspaceArchil: (options?: RequestOptions) => Promise<GetWorkspaceArchilResponse>;
5219
5445
  /** List a saved Composio server's toolkit's events, for a composio trigger (GET /settings/mcp-servers/{name}/composio/events). */
@@ -5240,6 +5466,8 @@ export declare function resources(call: Call): {
5240
5466
  saveComputerKeys: (provider: string, body: SaveComputerKeysBody, options?: RequestOptions) => Promise<SaveComputerKeysResponse>;
5241
5467
  /** Save this server's email account, its password sealed (PUT /settings/email). */
5242
5468
  saveEmailAccount: (body: SaveEmailAccountBody, options?: RequestOptions) => Promise<SaveEmailAccountResponse>;
5469
+ /** Use a model gateway for every model, saved here (PUT /settings/model-gateway). */
5470
+ saveModelGateway: (body: SaveModelGatewayBody, options?: RequestOptions) => Promise<SaveModelGatewayResponse>;
5243
5471
  /** Sign out of ChatGPT: the session revoked at OpenAI, then forgotten here (DELETE /settings/chatgpt). */
5244
5472
  signOutChatGpt: (options?: RequestOptions) => Promise<SignOutChatGPTResponse>;
5245
5473
  /** Start signing in with ChatGPT: the link to open (POST /settings/chatgpt/sign-in). */
@@ -5252,6 +5480,8 @@ export declare function resources(call: Call): {
5252
5480
  testComputer: (provider: string, options?: RequestOptions) => Promise<TestComputerResponse>;
5253
5481
  /** Sign in to the email account's IMAP and SMTP servers, sending nothing (POST /settings/email/test). */
5254
5482
  testEmailAccount: (body?: TestEmailAccountBody, options?: RequestOptions) => Promise<TestEmailAccountResponse>;
5483
+ /** Ask a model gateway which models it serves (POST /settings/model-gateway/test). */
5484
+ testModelGateway: (body?: TestModelGatewayBody, options?: RequestOptions) => Promise<TestModelGatewayResponse>;
5255
5485
  /** Test the Archil account key at its region's control plane (POST /workspace/archil/test). */
5256
5486
  testWorkspaceArchil: (options?: RequestOptions) => Promise<TestWorkspaceArchilResponse>;
5257
5487
  /** Turn off Claude Code's login on this machine (DELETE /settings/claude-login). */
@@ -5359,6 +5589,20 @@ export declare function resources(call: Call): {
5359
5589
  /** This document (GET /openapi.json). */
5360
5590
  openapi: (options?: RequestOptions) => Promise<GetOpenapiResponse>;
5361
5591
  };
5592
+ slack: {
5593
+ /** Remove Slack; its pending messages are dropped, the log of attempts is kept (DELETE /settings/slack). */
5594
+ delete: (options?: RequestOptions) => Promise<void>;
5595
+ /** Slack's last 50 attempts, newest first (GET /settings/slack/deliveries). */
5596
+ deliveries: (options?: RequestOptions) => Promise<ListSlackDeliveriesResponse>;
5597
+ /** Where this server posts run notices in Slack, if it is set; never the URL (GET /settings/slack). */
5598
+ get: (options?: RequestOptions) => Promise<GetSlackResponse>;
5599
+ /** Post a message of Slack's log again, once now, under the same id and body (POST /settings/slack/deliveries/{webhook_id}/redeliver). */
5600
+ redeliver: (webhookId: string, options?: RequestOptions) => Promise<RedeliverSlackResponse>;
5601
+ /** Set Slack's incoming-webhook URL, or which events it is sent (PUT /settings/slack). */
5602
+ save: (body: SaveSlackBody, options?: RequestOptions) => Promise<SaveSlackResponse>;
5603
+ /** Post a test message to Slack now, once, and say how it went (POST /settings/slack/test). */
5604
+ test: (options?: RequestOptions) => Promise<TestSlackResponse>;
5605
+ };
5362
5606
  /** Counts and cost over every agent and run (GET /stats). */
5363
5607
  stats: (params?: GetStatsParams, options?: RequestOptions) => Promise<GetStatsResponse>;
5364
5608
  /** Usage by meter over a period (GET /usage). */
@@ -5414,6 +5658,8 @@ export declare function resources(call: Call): {
5414
5658
  get: (options?: RequestOptions) => Promise<GetWebhookResponse>;
5415
5659
  /** Send a message of the log again, once now, under the same webhook-id and body (POST /settings/webhook/deliveries/{webhook_id}/redeliver). */
5416
5660
  redeliver: (webhookId: string, options?: RequestOptions) => Promise<RedeliverWebhookResponse>;
5661
+ /** The webhook's new signing secret, shown once; the old one signs nothing from now on (POST /settings/webhook/secret). */
5662
+ rotateSecret: (options?: RequestOptions) => Promise<RotateWebhookSecretResponse>;
5417
5663
  /** Set the webhook's URL (PUT /settings/webhook). */
5418
5664
  save: (body: SaveWebhookBody, options?: RequestOptions) => Promise<SaveWebhookResponse>;
5419
5665
  /** Send a `webhook.test` message now, once, and say how it went (POST /settings/webhook/test). */
@@ -52,6 +52,7 @@ export const OPERATIONS = {
52
52
  deleteComposioSubscription: { "method": "DELETE", "path": "/settings/mcp-servers/{name}/composio/subscription", "pathParams": ["name"], "multiSegment": [], "query": [], "headers": [], "body": null, "answer": "json", "secret": false, "publicFields": [], "tagged": false },
53
53
  deleteComputer: { "method": "DELETE", "path": "/computers/{computer_id}", "pathParams": ["computer_id"], "multiSegment": [], "query": [], "headers": [], "body": null, "answer": "none", "secret": false, "publicFields": [], "tagged": false },
54
54
  deleteEmailAccount: { "method": "DELETE", "path": "/settings/email", "pathParams": [], "multiSegment": [], "query": [], "headers": [], "body": null, "answer": "none", "secret": false, "publicFields": [], "tagged": false },
55
+ deleteModelGateway: { "method": "DELETE", "path": "/settings/model-gateway", "pathParams": [], "multiSegment": [], "query": [], "headers": [], "body": null, "answer": "json", "secret": false, "publicFields": [], "tagged": false },
55
56
  deleteWorkspaceArchil: { "method": "DELETE", "path": "/workspace/archil", "pathParams": [], "multiSegment": [], "query": [], "headers": [], "body": null, "answer": "json", "secret": false, "publicFields": [], "tagged": false },
56
57
  disconnectGitHub: { "method": "DELETE", "path": "/integrations/github", "pathParams": [], "multiSegment": [], "query": [], "headers": [], "body": null, "answer": "json", "secret": false, "publicFields": [], "tagged": false },
57
58
  finishChatGPTSignIn: { "method": "POST", "path": "/settings/chatgpt/sign-in/finish", "pathParams": [], "multiSegment": [], "query": [], "headers": [], "body": { "required": true, "types": ["application/json"] }, "answer": "json", "secret": false, "publicFields": [], "tagged": false },
@@ -60,6 +61,7 @@ export const OPERATIONS = {
60
61
  getClaudeLogin: { "method": "GET", "path": "/settings/claude-login", "pathParams": [], "multiSegment": [], "query": [], "headers": [], "body": null, "answer": "json", "secret": false, "publicFields": [], "tagged": false },
61
62
  getEmailAccount: { "method": "GET", "path": "/settings/email", "pathParams": [], "multiSegment": [], "query": [], "headers": [], "body": null, "answer": "json", "secret": false, "publicFields": [], "tagged": false },
62
63
  getGitHubConnection: { "method": "GET", "path": "/integrations/github", "pathParams": [], "multiSegment": [], "query": [], "headers": [], "body": null, "answer": "json", "secret": false, "publicFields": [], "tagged": false },
64
+ getModelGateway: { "method": "GET", "path": "/settings/model-gateway", "pathParams": [], "multiSegment": [], "query": [], "headers": [], "body": null, "answer": "json", "secret": false, "publicFields": [], "tagged": false },
63
65
  getWorkspaceArchil: { "method": "GET", "path": "/workspace/archil", "pathParams": [], "multiSegment": [], "query": [], "headers": [], "body": null, "answer": "json", "secret": false, "publicFields": [], "tagged": false },
64
66
  gitHubCallback: { "method": "GET", "path": "/integrations/github/callback", "pathParams": [], "multiSegment": [], "query": ["code", "state"], "headers": [], "body": null, "answer": "none", "secret": false, "publicFields": [], "tagged": false },
65
67
  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 },
@@ -75,6 +77,7 @@ export const OPERATIONS = {
75
77
  saveComposioServer: { "method": "PUT", "path": "/settings/mcp-servers/{name}/composio", "pathParams": ["name"], "multiSegment": [], "query": [], "headers": [], "body": { "required": true, "types": ["application/json"] }, "answer": "json", "secret": true, "publicFields": ["toolkit", "tools.[]", "user_id"], "tagged": false },
76
78
  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 },
77
79
  saveEmailAccount: { "method": "PUT", "path": "/settings/email", "pathParams": [], "multiSegment": [], "query": [], "headers": [], "body": { "required": true, "types": ["application/json"] }, "answer": "json", "secret": false, "publicFields": [], "tagged": false },
80
+ saveModelGateway: { "method": "PUT", "path": "/settings/model-gateway", "pathParams": [], "multiSegment": [], "query": [], "headers": [], "body": { "required": true, "types": ["application/json"] }, "answer": "json", "secret": true, "publicFields": ["base_url", "ids", "models.default", "models.fast", "models.strong"], "tagged": false },
78
81
  signOutChatGPT: { "method": "DELETE", "path": "/settings/chatgpt", "pathParams": [], "multiSegment": [], "query": [], "headers": [], "body": null, "answer": "json", "secret": false, "publicFields": [], "tagged": false },
79
82
  startChatGPTSignIn: { "method": "POST", "path": "/settings/chatgpt/sign-in", "pathParams": [], "multiSegment": [], "query": [], "headers": [], "body": null, "answer": "json", "secret": false, "publicFields": [], "tagged": false },
80
83
  startClaudeLogin: { "method": "POST", "path": "/settings/claude-login/login", "pathParams": [], "multiSegment": [], "query": [], "headers": [], "body": null, "answer": "json", "secret": false, "publicFields": [], "tagged": false },
@@ -82,6 +85,7 @@ export const OPERATIONS = {
82
85
  testCalendar: { "method": "POST", "path": "/settings/calendar/test", "pathParams": [], "multiSegment": [], "query": [], "headers": [], "body": { "required": false, "types": ["application/json"] }, "answer": "json", "secret": false, "publicFields": [], "tagged": false },
83
86
  testComputer: { "method": "POST", "path": "/computers/{provider}/test", "pathParams": ["provider"], "multiSegment": [], "query": [], "headers": [], "body": null, "answer": "json", "secret": false, "publicFields": [], "tagged": false },
84
87
  testEmailAccount: { "method": "POST", "path": "/settings/email/test", "pathParams": [], "multiSegment": [], "query": [], "headers": [], "body": { "required": false, "types": ["application/json"] }, "answer": "json", "secret": false, "publicFields": [], "tagged": false },
88
+ testModelGateway: { "method": "POST", "path": "/settings/model-gateway/test", "pathParams": [], "multiSegment": [], "query": [], "headers": [], "body": { "required": false, "types": ["application/json"] }, "answer": "json", "secret": true, "publicFields": ["base_url"], "tagged": false },
85
89
  testWorkspaceArchil: { "method": "POST", "path": "/workspace/archil/test", "pathParams": [], "multiSegment": [], "query": [], "headers": [], "body": null, "answer": "json", "secret": false, "publicFields": [], "tagged": false },
86
90
  turnOffClaudeLogin: { "method": "DELETE", "path": "/settings/claude-login", "pathParams": [], "multiSegment": [], "query": [], "headers": [], "body": null, "answer": "json", "secret": false, "publicFields": [], "tagged": false },
87
91
  turnOnClaudeLogin: { "method": "PUT", "path": "/settings/claude-login", "pathParams": [], "multiSegment": [], "query": [], "headers": [], "body": { "required": true, "types": ["application/json"] }, "answer": "json", "secret": false, "publicFields": [], "tagged": false },
@@ -129,6 +133,12 @@ export const OPERATIONS = {
129
133
  getHealth: { "method": "GET", "path": "/health", "pathParams": [], "multiSegment": [], "query": [], "headers": [], "body": null, "answer": "json", "secret": false, "publicFields": [], "tagged": false },
130
134
  callMcp: { "method": "POST", "path": "/mcp", "pathParams": [], "multiSegment": [], "query": [], "headers": [], "body": { "required": true, "types": ["application/json"] }, "answer": "json", "secret": false, "publicFields": [], "tagged": false },
131
135
  getOpenapi: { "method": "GET", "path": "/openapi.json", "pathParams": [], "multiSegment": [], "query": [], "headers": [], "body": null, "answer": "json", "secret": false, "publicFields": [], "tagged": false },
136
+ deleteSlack: { "method": "DELETE", "path": "/settings/slack", "pathParams": [], "multiSegment": [], "query": [], "headers": [], "body": null, "answer": "none", "secret": false, "publicFields": [], "tagged": false },
137
+ listSlackDeliveries: { "method": "GET", "path": "/settings/slack/deliveries", "pathParams": [], "multiSegment": [], "query": [], "headers": [], "body": null, "answer": "json", "secret": false, "publicFields": [], "tagged": false },
138
+ getSlack: { "method": "GET", "path": "/settings/slack", "pathParams": [], "multiSegment": [], "query": [], "headers": [], "body": null, "answer": "json", "secret": false, "publicFields": [], "tagged": false },
139
+ redeliverSlack: { "method": "POST", "path": "/settings/slack/deliveries/{webhook_id}/redeliver", "pathParams": ["webhook_id"], "multiSegment": [], "query": [], "headers": [], "body": null, "answer": "json", "secret": false, "publicFields": [], "tagged": false },
140
+ saveSlack: { "method": "PUT", "path": "/settings/slack", "pathParams": [], "multiSegment": [], "query": [], "headers": [], "body": { "required": true, "types": ["application/json"] }, "answer": "json", "secret": true, "publicFields": [], "tagged": false },
141
+ testSlack: { "method": "POST", "path": "/settings/slack/test", "pathParams": [], "multiSegment": [], "query": [], "headers": [], "body": null, "answer": "json", "secret": false, "publicFields": [], "tagged": false },
132
142
  getStats: { "method": "GET", "path": "/stats", "pathParams": [], "multiSegment": [], "query": ["from", "to", "agent"], "headers": [], "body": null, "answer": "json", "secret": false, "publicFields": [], "tagged": false },
133
143
  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 },
134
144
  deleteTemplate: { "method": "DELETE", "path": "/templates/{template}", "pathParams": ["template"], "multiSegment": [], "query": [], "headers": [], "body": null, "answer": "none", "secret": false, "publicFields": [], "tagged": false },
@@ -152,6 +162,7 @@ export const OPERATIONS = {
152
162
  listWebhookDeliveries: { "method": "GET", "path": "/settings/webhook/deliveries", "pathParams": [], "multiSegment": [], "query": [], "headers": [], "body": null, "answer": "json", "secret": false, "publicFields": [], "tagged": false },
153
163
  getWebhook: { "method": "GET", "path": "/settings/webhook", "pathParams": [], "multiSegment": [], "query": [], "headers": [], "body": null, "answer": "json", "secret": false, "publicFields": [], "tagged": false },
154
164
  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 },
165
+ rotateWebhookSecret: { "method": "POST", "path": "/settings/webhook/secret", "pathParams": [], "multiSegment": [], "query": [], "headers": [], "body": null, "answer": "json", "secret": true, "publicFields": [], "tagged": false },
155
166
  saveWebhook: { "method": "PUT", "path": "/settings/webhook", "pathParams": [], "multiSegment": [], "query": [], "headers": [], "body": { "required": true, "types": ["application/json"] }, "answer": "json", "secret": false, "publicFields": [], "tagged": false },
156
167
  testWebhook: { "method": "POST", "path": "/settings/webhook/test", "pathParams": [], "multiSegment": [], "query": [], "headers": [], "body": null, "answer": "json", "secret": false, "publicFields": [], "tagged": false },
157
168
  validateWorkflow: { "method": "POST", "path": "/workflows/validate", "pathParams": [], "multiSegment": [], "query": [], "headers": [], "body": { "required": true, "types": ["application/json"] }, "answer": "json", "secret": false, "publicFields": [], "tagged": false },
@@ -272,6 +283,8 @@ export function resources(call) {
272
283
  deleteComputer: (computerId, options) => call("deleteComputer", [computerId], undefined, undefined, options),
273
284
  /** Forget this server's email account (DELETE /settings/email). */
274
285
  deleteEmailAccount: (options) => call("deleteEmailAccount", [], undefined, undefined, options),
286
+ /** Stop using the saved model gateway: the provider keys are back in force (DELETE /settings/model-gateway). */
287
+ deleteModelGateway: (options) => call("deleteModelGateway", [], undefined, undefined, options),
275
288
  /** Turn Mode 2 off: run folders on this server's own disk (DELETE /workspace/archil). */
276
289
  deleteWorkspaceArchil: (options) => call("deleteWorkspaceArchil", [], undefined, undefined, options),
277
290
  /** Disconnect GitHub: the App's credentials gone from this server, and every github trigger off (DELETE /integrations/github). */
@@ -288,6 +301,8 @@ export function resources(call) {
288
301
  getEmailAccount: (options) => call("getEmailAccount", [], undefined, undefined, options),
289
302
  /** Whether a GitHub App is connected, and if so its id, slug and installations, never a secret (GET /integrations/github). */
290
303
  getGitHubConnection: (options) => call("getGitHubConnection", [], undefined, undefined, options),
304
+ /** The model gateway in force: the environment's, the one saved here, or none (GET /settings/model-gateway). */
305
+ getModelGateway: (options) => call("getModelGateway", [], undefined, undefined, options),
291
306
  /** Whether run folders are on Archil disks (Mode 2), the settings, and whether its keys are saved (GET /workspace/archil). */
292
307
  getWorkspaceArchil: (options) => call("getWorkspaceArchil", [], undefined, undefined, options),
293
308
  /** List a saved Composio server's toolkit's events, for a composio trigger (GET /settings/mcp-servers/{name}/composio/events). */
@@ -314,6 +329,8 @@ export function resources(call) {
314
329
  saveComputerKeys: (provider, body, options) => call("saveComputerKeys", [provider], body, undefined, options),
315
330
  /** Save this server's email account, its password sealed (PUT /settings/email). */
316
331
  saveEmailAccount: (body, options) => call("saveEmailAccount", [], body, undefined, options),
332
+ /** Use a model gateway for every model, saved here (PUT /settings/model-gateway). */
333
+ saveModelGateway: (body, options) => call("saveModelGateway", [], body, undefined, options),
317
334
  /** Sign out of ChatGPT: the session revoked at OpenAI, then forgotten here (DELETE /settings/chatgpt). */
318
335
  signOutChatGpt: (options) => call("signOutChatGPT", [], undefined, undefined, options),
319
336
  /** Start signing in with ChatGPT: the link to open (POST /settings/chatgpt/sign-in). */
@@ -326,6 +343,8 @@ export function resources(call) {
326
343
  testComputer: (provider, options) => call("testComputer", [provider], undefined, undefined, options),
327
344
  /** Sign in to the email account's IMAP and SMTP servers, sending nothing (POST /settings/email/test). */
328
345
  testEmailAccount: (body, options) => call("testEmailAccount", [], body, undefined, options),
346
+ /** Ask a model gateway which models it serves (POST /settings/model-gateway/test). */
347
+ testModelGateway: (body, options) => call("testModelGateway", [], body, undefined, options),
329
348
  /** Test the Archil account key at its region's control plane (POST /workspace/archil/test). */
330
349
  testWorkspaceArchil: (options) => call("testWorkspaceArchil", [], undefined, undefined, options),
331
350
  /** Turn off Claude Code's login on this machine (DELETE /settings/claude-login). */
@@ -433,6 +452,20 @@ export function resources(call) {
433
452
  /** This document (GET /openapi.json). */
434
453
  openapi: (options) => call("getOpenapi", [], undefined, undefined, options),
435
454
  },
455
+ slack: {
456
+ /** Remove Slack; its pending messages are dropped, the log of attempts is kept (DELETE /settings/slack). */
457
+ delete: (options) => call("deleteSlack", [], undefined, undefined, options),
458
+ /** Slack's last 50 attempts, newest first (GET /settings/slack/deliveries). */
459
+ deliveries: (options) => call("listSlackDeliveries", [], undefined, undefined, options),
460
+ /** Where this server posts run notices in Slack, if it is set; never the URL (GET /settings/slack). */
461
+ get: (options) => call("getSlack", [], undefined, undefined, options),
462
+ /** Post a message of Slack's log again, once now, under the same id and body (POST /settings/slack/deliveries/{webhook_id}/redeliver). */
463
+ redeliver: (webhookId, options) => call("redeliverSlack", [webhookId], undefined, undefined, options),
464
+ /** Set Slack's incoming-webhook URL, or which events it is sent (PUT /settings/slack). */
465
+ save: (body, options) => call("saveSlack", [], body, undefined, options),
466
+ /** Post a test message to Slack now, once, and say how it went (POST /settings/slack/test). */
467
+ test: (options) => call("testSlack", [], undefined, undefined, options),
468
+ },
436
469
  /** Counts and cost over every agent and run (GET /stats). */
437
470
  stats: (params, options) => call("getStats", [], undefined, params, options),
438
471
  /** Usage by meter over a period (GET /usage). */
@@ -488,6 +521,8 @@ export function resources(call) {
488
521
  get: (options) => call("getWebhook", [], undefined, undefined, options),
489
522
  /** Send a message of the log again, once now, under the same webhook-id and body (POST /settings/webhook/deliveries/{webhook_id}/redeliver). */
490
523
  redeliver: (webhookId, options) => call("redeliverWebhook", [webhookId], undefined, undefined, options),
524
+ /** The webhook's new signing secret, shown once; the old one signs nothing from now on (POST /settings/webhook/secret). */
525
+ rotateSecret: (options) => call("rotateWebhookSecret", [], undefined, undefined, options),
491
526
  /** Set the webhook's URL (PUT /settings/webhook). */
492
527
  save: (body, options) => call("saveWebhook", [], body, undefined, options),
493
528
  /** Send a `webhook.test` message now, once, and say how it went (POST /settings/webhook/test). */
@@ -1,4 +1,4 @@
1
- import type { BackendWorkflowBridge, BackendWorkflowToolManifest } from './learning.js';
1
+ import type { BackendWorkflowSession, BackendWorkflowBinding, BackendWorkflowBridge, BackendWorkflowToolManifest } from './learning.js';
2
2
  export interface WorkflowToolContext {
3
3
  signal: AbortSignal;
4
4
  runId: string;
@@ -95,7 +95,16 @@ export interface WorkflowMcpBridgeOptions<Document extends WorkflowEngineDocumen
95
95
  /** Local metadata only; callback inputs/results and capability tokens are never emitted. */
96
96
  onEvent?(event: WorkflowBridgeEvent): void;
97
97
  }
98
+ /** Private host handle. Never expose its arguments or capability in model-visible results or logs. */
99
+ export interface WorkflowMcpBinding extends BackendWorkflowBinding {
100
+ mcpArguments(name: string, input: Record<string, unknown>): {
101
+ capability: string;
102
+ name: string;
103
+ input: Record<string, unknown>;
104
+ };
105
+ }
98
106
  export interface WorkflowMcpBridge extends BackendWorkflowBridge {
107
+ bind(session: BackendWorkflowSession): WorkflowMcpBinding;
99
108
  readonly url: string;
100
109
  readonly headers: Readonly<Record<string, string>>;
101
110
  close(): Promise<void>;
package/dist/workflows.js CHANGED
@@ -336,7 +336,7 @@ export async function createWorkflowMcpBridge(options) {
336
336
  const timer = setTimeout(() => lease.close(), leaseDuration);
337
337
  timer.unref();
338
338
  leases.set(capability, lease);
339
- const context = lease.workflows.length ? `Approved workflows for this task (reference data):\n${JSON.stringify(lease.workflows.map(workflow => {
339
+ const context = lease.workflows.length ? `Compiled workflows for this task (not checked):\n${JSON.stringify(lease.workflows.map(workflow => {
340
340
  let input_schema;
341
341
  try {
342
342
  const doc = checked(workflow.workflow);
@@ -351,6 +351,13 @@ export async function createWorkflowMcpBridge(options) {
351
351
  object(input) && input.capability === capability && typeof input.name === 'string' && object(input.input) &&
352
352
  Object.keys(input).every(key => ['capability', 'name', 'input'].includes(key)) && lease.workflows.some(flow => flow.name === input.name);
353
353
  return { context, close: () => lease.close(),
354
+ mcpArguments(name, input) {
355
+ if (released || closed || lease.controller.signal.aborted)
356
+ throw new Error('The workflow binding has closed.');
357
+ if (!lease.workflows.some(flow => flow.name === name) || !object(input))
358
+ throw new TypeError('Name a pinned workflow and supply an input object.');
359
+ return { capability, name, input: copy(input) };
360
+ },
354
361
  matchesNativeEnvelope: matches,
355
362
  claimNativeEnvelope(name, input, status, output) {
356
363
  if (!matches(name, input))
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@parcha/agentrun-client",
3
- "version": "0.1.0-beta.45",
3
+ "version": "0.1.0-beta.47",
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",
@@ -75,6 +75,6 @@
75
75
  }
76
76
  },
77
77
  "devDependencies": {
78
- "@parcha/agentrun-dsl": "0.1.0-beta.45"
78
+ "@parcha/agentrun-dsl": "0.1.0-beta.47"
79
79
  }
80
80
  }