@parcha/agentrun-client 0.1.0-beta.46 → 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";
@@ -327,7 +331,7 @@ export type RunSummary = {
327
331
  ended_at: Timestamp | null;
328
332
  cost: Cost;
329
333
  sdk?: {
330
- runtime: "claude-agent-sdk" | "codex-sdk";
334
+ runtime: "claude-agent-sdk" | "codex-sdk" | "eve";
331
335
  model: string | null;
332
336
  session_id: string | null;
333
337
  learning_revision: string | null;
@@ -441,19 +445,35 @@ export type RunSummary = {
441
445
  id: string;
442
446
  firing_key: string;
443
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;
444
454
  };
445
455
  export type RunStatus = "queued" | "working" | "paused" | "input_required" | "completed" | "failed" | "cancelled";
446
456
  export type RunState = "working" | "waiting" | "idle";
447
457
  export type Cost = {
448
458
  usd: number | null;
449
- basis: "charge" | "estimate";
459
+ basis: "charge" | "estimate" | "reported" | "unpriced";
450
460
  charge_state?: "held" | "settled" | "released" | null;
451
461
  cap_usd?: number | null;
452
462
  free?: true;
453
463
  so_far_usd?: number;
454
464
  unpriced?: number;
455
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
+ };
456
475
  learning_usd?: number | null;
476
+ tools_usd?: number | null;
457
477
  all_in_usd?: number | null;
458
478
  plan?: {
459
479
  requests: number;
@@ -471,7 +491,7 @@ export type RunError = {
471
491
  reason: "server_lost_at_launch" | "server_lost_at_setup";
472
492
  };
473
493
  };
474
- 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";
475
495
  export type NextAction = RequestAction | PersonAction;
476
496
  export type RequestAction = {
477
497
  type: "request";
@@ -530,7 +550,7 @@ export type RunCreateInline = {
530
550
  model_key?: string;
531
551
  mcp_auth?: Record<string, {
532
552
  headers: Record<string, string>;
533
- }>;
553
+ } | ComposioRunBinding>;
534
554
  labels?: Record<string, string>;
535
555
  workflow_first?: boolean;
536
556
  learning?: "use";
@@ -547,6 +567,10 @@ export type ExternalRef = {
547
567
  id: string;
548
568
  version: string | number;
549
569
  };
570
+ export type ComposioRunBinding = {
571
+ composio_user_id: string;
572
+ connected_account_id?: string;
573
+ };
550
574
  export type Run = {
551
575
  run_id: Id;
552
576
  agent_id: Id;
@@ -564,7 +588,7 @@ export type Run = {
564
588
  cost: Cost;
565
589
  poll_after_ms: number;
566
590
  sdk?: {
567
- runtime: "claude-agent-sdk" | "codex-sdk";
591
+ runtime: "claude-agent-sdk" | "codex-sdk" | "eve";
568
592
  model: string | null;
569
593
  session_id: string | null;
570
594
  learning_revision: string | null;
@@ -713,6 +737,11 @@ export type Run = {
713
737
  } | null;
714
738
  audit_of?: string | null;
715
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;
716
745
  };
717
746
  export type RunResult = {
718
747
  output: unknown;
@@ -737,7 +766,7 @@ export type MessageCreate = {
737
766
  model_key?: string;
738
767
  mcp_auth?: Record<string, {
739
768
  headers: Record<string, string>;
740
- }>;
769
+ } | ComposioRunBinding>;
741
770
  };
742
771
  export type MessageResult = {
743
772
  run_id: Id;
@@ -756,7 +785,7 @@ export type RunCreate = {
756
785
  model_key?: string;
757
786
  mcp_auth?: Record<string, {
758
787
  headers: Record<string, string>;
759
- }>;
788
+ } | ComposioRunBinding>;
760
789
  labels?: Record<string, string>;
761
790
  workflow_first?: boolean;
762
791
  learning?: "use";
@@ -912,7 +941,7 @@ export type Capabilities = {
912
941
  default_reason?: string;
913
942
  allow: Array<string>;
914
943
  };
915
- harnesses?: Array<{
944
+ harnesses: Array<{
916
945
  id: string;
917
946
  label: string;
918
947
  promises: {
@@ -933,6 +962,7 @@ export type Capabilities = {
933
962
  reason?: string;
934
963
  needs?: Array<"key" | "chatgpt">;
935
964
  installs?: "on_first_use";
965
+ card?: string;
936
966
  }>;
937
967
  tools: Array<{
938
968
  name: string;
@@ -998,6 +1028,12 @@ export type Capabilities = {
998
1028
  limit: string;
999
1029
  };
1000
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
+ }>;
1001
1037
  };
1002
1038
  export type Features = {
1003
1039
  agents: {
@@ -1081,6 +1117,11 @@ export type Features = {
1081
1117
  signing: "standard-webhooks/v1";
1082
1118
  at_rest: "sealed";
1083
1119
  };
1120
+ slack?: {
1121
+ routes: boolean;
1122
+ events: Array<"run.needs_input" | "run.ended" | "trigger.failed">;
1123
+ at_rest: "sealed";
1124
+ };
1084
1125
  triggers?: {
1085
1126
  routes: boolean;
1086
1127
  sources: Array<"schedule" | "webhook" | "github" | "composio" | "email" | "feed">;
@@ -1127,7 +1168,7 @@ export type Usage = {
1127
1168
  from: Timestamp;
1128
1169
  to: Timestamp;
1129
1170
  currency: "USD";
1130
- basis: "charge" | "estimate";
1171
+ basis: "charge" | "estimate" | "reported" | "unpriced";
1131
1172
  group_by: "meter" | "agent" | "key" | "day" | "region";
1132
1173
  total_usd: number | null;
1133
1174
  lines: Array<UsageLine>;
@@ -1410,6 +1451,7 @@ export type ListLearningPromotionsResponse = {
1410
1451
  alone_min: number;
1411
1452
  attempt: 1 | 2;
1412
1453
  agree_on?: Array<string>;
1454
+ grader?: string;
1413
1455
  n?: number;
1414
1456
  agreed?: number;
1415
1457
  alone?: number;
@@ -1434,6 +1476,7 @@ export type ListLearningPromotionsResponse = {
1434
1476
  draft?: string;
1435
1477
  escalated?: string;
1436
1478
  failed?: true;
1479
+ differs_on?: string;
1437
1480
  }>;
1438
1481
  stopped?: true;
1439
1482
  };
@@ -1494,6 +1537,7 @@ export type ListLearningPromotionsResponse = {
1494
1537
  alone_min: number;
1495
1538
  attempt: 1 | 2;
1496
1539
  agree_on?: Array<string>;
1540
+ grader?: string;
1497
1541
  n?: number;
1498
1542
  agreed?: number;
1499
1543
  alone?: number;
@@ -1518,6 +1562,7 @@ export type ListLearningPromotionsResponse = {
1518
1562
  draft?: string;
1519
1563
  escalated?: string;
1520
1564
  failed?: true;
1565
+ differs_on?: string;
1521
1566
  }>;
1522
1567
  stopped?: true;
1523
1568
  } | null;
@@ -1902,15 +1947,6 @@ export type GetLearningCostResponse = {
1902
1947
  } | null;
1903
1948
  };
1904
1949
  bill: {
1905
- baseline: {
1906
- runs: number;
1907
- mean_usd: number;
1908
- } | null;
1909
- promoted: {
1910
- n: number;
1911
- run_id: string;
1912
- at: string;
1913
- } | null;
1914
1950
  learning_usd: number;
1915
1951
  points: Array<{
1916
1952
  n: number;
@@ -2114,6 +2150,25 @@ export type DeleteComposioSubscriptionResponse = {
2114
2150
  };
2115
2151
  /** Remove a paired computer: its token ends and its socket closes (DELETE /computers/{computer_id}). */
2116
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
+ };
2117
2172
  /** Turn Mode 2 off: run folders on this server's own disk (DELETE /workspace/archil). */
2118
2173
  export type DeleteWorkspaceArchilResponse = {
2119
2174
  on: boolean;
@@ -2204,6 +2259,25 @@ export type GetGitHubConnectionResponse = {
2204
2259
  account: string;
2205
2260
  }>;
2206
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
+ };
2207
2281
  /** Whether run folders are on Archil disks (Mode 2), the settings, and whether its keys are saved (GET /workspace/archil). */
2208
2282
  export type GetWorkspaceArchilResponse = {
2209
2283
  on: boolean;
@@ -2325,6 +2399,7 @@ export type ListComputersResponse = {
2325
2399
  offered: boolean;
2326
2400
  groups: Array<string>;
2327
2401
  tools: Array<string>;
2402
+ settings: Array<string>;
2328
2403
  providers: Array<{
2329
2404
  id: string;
2330
2405
  name: string;
@@ -2457,6 +2532,8 @@ export type SaveComposioServerBody = {
2457
2532
  toolkit: string;
2458
2533
  tools: Array<string>;
2459
2534
  user_id?: string;
2535
+ auth_config_id?: string;
2536
+ price_usd?: number;
2460
2537
  };
2461
2538
  export type SaveComposioServerResponse = {
2462
2539
  server: {
@@ -2580,6 +2657,35 @@ export type SaveEmailAccountResponse = {
2580
2657
  } | null;
2581
2658
  password_unreadable: boolean;
2582
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
+ };
2583
2689
  /** Sign out of ChatGPT: the session revoked at OpenAI, then forgotten here (DELETE /settings/chatgpt). */
2584
2690
  export type SignOutChatGPTResponse = {
2585
2691
  revoked: boolean;
@@ -2657,6 +2763,18 @@ export type TestEmailAccountResponse = {
2657
2763
  message: string;
2658
2764
  };
2659
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
+ };
2660
2778
  /** Test the Archil account key at its region's control plane (POST /workspace/archil/test). */
2661
2779
  export type TestWorkspaceArchilResponse = {
2662
2780
  ok: true;
@@ -3413,7 +3531,7 @@ export type GetSdkRunResponse = {
3413
3531
  };
3414
3532
  /** Register a task executed by an existing backend SDK (POST /agents/{agent_id}/sdk-runs). */
3415
3533
  export type StartSdkRunBody = {
3416
- runtime: "claude-agent-sdk" | "codex-sdk";
3534
+ runtime: "claude-agent-sdk" | "codex-sdk" | "eve";
3417
3535
  input: string;
3418
3536
  instructions: string;
3419
3537
  model?: string;
@@ -3450,11 +3568,13 @@ export type StartSdkRunResponse = {
3450
3568
  export type GetCapabilitiesResponse = Capabilities;
3451
3569
  /** Whether this server can serve (GET /health). */
3452
3570
  export type GetHealthResponse = {
3453
- status: "ok" | "failing" | "warming";
3571
+ status: "ok" | "degraded" | "failing" | "warming";
3454
3572
  checks: {
3455
3573
  store: "ok" | "does_not_open" | "opening";
3456
3574
  disk: "ok" | "below_floor" | "cannot_check";
3575
+ runner?: "refused";
3457
3576
  };
3577
+ runner_refused?: string;
3458
3578
  };
3459
3579
  /** The MCP endpoint: this API's tools, for a coding agent (POST /mcp). */
3460
3580
  export type CallMcpBody = {
@@ -3474,6 +3594,92 @@ export type CallMcpResponse = {
3474
3594
  };
3475
3595
  /** This document (GET /openapi.json). */
3476
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
+ };
3477
3683
  /** Counts and cost over every agent and run (GET /stats). */
3478
3684
  export interface GetStatsParams {
3479
3685
  from?: string;
@@ -3497,7 +3703,7 @@ export type GetStatsResponse = {
3497
3703
  }>;
3498
3704
  cost: {
3499
3705
  usd: number | null;
3500
- basis: "estimate" | null;
3706
+ basis: "reported" | "estimate" | "unpriced" | null;
3501
3707
  unknown_runs: number;
3502
3708
  };
3503
3709
  archived: {
@@ -5022,6 +5228,19 @@ export type RedeliverWebhookResponse = {
5022
5228
  retry_at: string | null;
5023
5229
  redelivery: boolean;
5024
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
+ };
5025
5244
  /** Set the webhook's URL (PUT /settings/webhook). */
5026
5245
  export type SaveWebhookBody = {
5027
5246
  url: string;
@@ -5201,6 +5420,8 @@ export declare function resources(call: Call): {
5201
5420
  deleteComputer: (computerId: string, options?: RequestOptions) => Promise<void>;
5202
5421
  /** Forget this server's email account (DELETE /settings/email). */
5203
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>;
5204
5425
  /** Turn Mode 2 off: run folders on this server's own disk (DELETE /workspace/archil). */
5205
5426
  deleteWorkspaceArchil: (options?: RequestOptions) => Promise<DeleteWorkspaceArchilResponse>;
5206
5427
  /** Disconnect GitHub: the App's credentials gone from this server, and every github trigger off (DELETE /integrations/github). */
@@ -5217,6 +5438,8 @@ export declare function resources(call: Call): {
5217
5438
  getEmailAccount: (options?: RequestOptions) => Promise<GetEmailAccountResponse>;
5218
5439
  /** Whether a GitHub App is connected, and if so its id, slug and installations, never a secret (GET /integrations/github). */
5219
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>;
5220
5443
  /** Whether run folders are on Archil disks (Mode 2), the settings, and whether its keys are saved (GET /workspace/archil). */
5221
5444
  getWorkspaceArchil: (options?: RequestOptions) => Promise<GetWorkspaceArchilResponse>;
5222
5445
  /** List a saved Composio server's toolkit's events, for a composio trigger (GET /settings/mcp-servers/{name}/composio/events). */
@@ -5243,6 +5466,8 @@ export declare function resources(call: Call): {
5243
5466
  saveComputerKeys: (provider: string, body: SaveComputerKeysBody, options?: RequestOptions) => Promise<SaveComputerKeysResponse>;
5244
5467
  /** Save this server's email account, its password sealed (PUT /settings/email). */
5245
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>;
5246
5471
  /** Sign out of ChatGPT: the session revoked at OpenAI, then forgotten here (DELETE /settings/chatgpt). */
5247
5472
  signOutChatGpt: (options?: RequestOptions) => Promise<SignOutChatGPTResponse>;
5248
5473
  /** Start signing in with ChatGPT: the link to open (POST /settings/chatgpt/sign-in). */
@@ -5255,6 +5480,8 @@ export declare function resources(call: Call): {
5255
5480
  testComputer: (provider: string, options?: RequestOptions) => Promise<TestComputerResponse>;
5256
5481
  /** Sign in to the email account's IMAP and SMTP servers, sending nothing (POST /settings/email/test). */
5257
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>;
5258
5485
  /** Test the Archil account key at its region's control plane (POST /workspace/archil/test). */
5259
5486
  testWorkspaceArchil: (options?: RequestOptions) => Promise<TestWorkspaceArchilResponse>;
5260
5487
  /** Turn off Claude Code's login on this machine (DELETE /settings/claude-login). */
@@ -5362,6 +5589,20 @@ export declare function resources(call: Call): {
5362
5589
  /** This document (GET /openapi.json). */
5363
5590
  openapi: (options?: RequestOptions) => Promise<GetOpenapiResponse>;
5364
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
+ };
5365
5606
  /** Counts and cost over every agent and run (GET /stats). */
5366
5607
  stats: (params?: GetStatsParams, options?: RequestOptions) => Promise<GetStatsResponse>;
5367
5608
  /** Usage by meter over a period (GET /usage). */
@@ -5417,6 +5658,8 @@ export declare function resources(call: Call): {
5417
5658
  get: (options?: RequestOptions) => Promise<GetWebhookResponse>;
5418
5659
  /** Send a message of the log again, once now, under the same webhook-id and body (POST /settings/webhook/deliveries/{webhook_id}/redeliver). */
5419
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>;
5420
5663
  /** Set the webhook's URL (PUT /settings/webhook). */
5421
5664
  save: (body: SaveWebhookBody, options?: RequestOptions) => Promise<SaveWebhookResponse>;
5422
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.46",
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.46"
78
+ "@parcha/agentrun-dsl": "0.1.0-beta.47"
79
79
  }
80
80
  }