palbase 0.65.0 → 0.68.0

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.
Files changed (111) hide show
  1. package/README.md +3 -2
  2. package/dist/ai/index.js +2 -2
  3. package/dist/ai-sdk/index.js +4 -0
  4. package/dist/backend/engine.js +2 -2
  5. package/dist/backend/env.js +1 -1
  6. package/dist/backend/index.js +8 -8
  7. package/dist/backend/stack.js +1 -1
  8. package/dist/backend/test.js +2 -2
  9. package/dist/chunks/{YP3QTS4L.js → 22GRHCVI.js} +1 -1
  10. package/dist/chunks/{CZGZTOK7.js → 2ZHSNWVZ.js} +2 -2
  11. package/dist/chunks/3OP3YJ63.js +22 -0
  12. package/dist/chunks/{5HMDOBEH.js → 4YV35XDP.js} +2 -2
  13. package/dist/chunks/5ZXXBM6L.js +18 -0
  14. package/dist/chunks/{KZZ3Y3DC.js → 622BI7EV.js} +1 -1
  15. package/dist/chunks/65QZXK2S.js +2 -0
  16. package/dist/chunks/{ZF3WKPVM.js → 7SGTDHXJ.js} +2 -2
  17. package/dist/chunks/D6EUPFUR.js +2 -0
  18. package/dist/chunks/EGWQ3EJE.js +21 -0
  19. package/dist/chunks/{ARRJICH3.js → EJAGO6ZV.js} +2 -2
  20. package/dist/chunks/{6GRY63N6.js → F4B6ELAN.js} +2 -2
  21. package/dist/chunks/IZWB7FGX.js +6 -0
  22. package/dist/chunks/{G2JBUBZO.js → J7WJF7F4.js} +2 -2
  23. package/dist/chunks/{DFX37NU3.js → LUUXXMXH.js} +1 -1
  24. package/dist/chunks/MVY4K43S.js +13 -0
  25. package/dist/chunks/{JHM7GTPD.js → OWLXCD3D.js} +1 -1
  26. package/dist/chunks/PP7MW4OT.js +2 -0
  27. package/dist/chunks/{DLMWZYLL.js → QFZ4GCJH.js} +2 -2
  28. package/dist/chunks/QQUIM4VK.js +2 -0
  29. package/dist/chunks/UJLFALKX.js +2 -0
  30. package/dist/chunks/{TEF7WS37.js → XJLAH42O.js} +1 -1
  31. package/dist/chunks/{XSOQNHZ5.js → XU4G5W72.js} +1 -1
  32. package/dist/chunks/YCDAV3WO.js +2 -0
  33. package/dist/cli.js +351 -364
  34. package/dist/cloud/index.js +2 -2
  35. package/dist/refuse/ai-sdk.js +2 -0
  36. package/dist/refuse/ai.js +1 -1
  37. package/dist/refuse/backend.js +1 -1
  38. package/dist/refuse/cloud.js +1 -1
  39. package/dist/refuse/server.js +1 -1
  40. package/dist/server/index.js +2 -2
  41. package/dist/server/testing.js +2 -2
  42. package/dist/web/index.js +2 -2
  43. package/dist/web/message.js +2 -2
  44. package/dist/web/palbe.js +2 -2
  45. package/dist/web/payments-ui.js +264 -0
  46. package/dist/web/paywall.js +2 -2
  47. package/dist/web/push-sw.js +1 -1
  48. package/dist/web/ssr.js +2 -2
  49. package/dist/web/vite.js +4 -3
  50. package/package.json +19 -2
  51. package/types/ai/src/ai.d.ts +55 -29
  52. package/types/ai/src/chats.d.ts +163 -171
  53. package/types/ai/src/index.d.ts +5 -5
  54. package/types/ai/src/pools.d.ts +17 -7
  55. package/types/ai/src/tools.d.ts +6 -64
  56. package/types/ai-sdk/src/index.d.ts +166 -0
  57. package/types/backend/src/decorators.d.ts +3 -9
  58. package/types/backend/src/idempotency.d.ts +18 -0
  59. package/types/backend/src/index.d.ts +1 -1
  60. package/types/backend/src/services.d.ts +2 -2
  61. package/types/backend/src/stack.d.ts +2 -4
  62. package/types/backend/src/strings-files.d.ts +5 -6
  63. package/types/backend/src/upload.d.ts +2 -1
  64. package/types/cloud/src/generated/project.d.ts +3 -2
  65. package/types/cloud/src/generated/studio.d.ts +3 -3
  66. package/types/internal/src/chat.d.ts +56 -2
  67. package/types/internal/src/event.d.ts +1 -1
  68. package/types/internal/src/modules/ai.d.ts +939 -1133
  69. package/types/internal/src/modules/analytics.d.ts +1 -1
  70. package/types/internal/src/modules/events.d.ts +5 -4
  71. package/types/internal/src/modules/{purchases.d.ts → iap.d.ts} +2183 -2438
  72. package/types/internal/src/modules/index.d.ts +2 -1
  73. package/types/internal/src/modules/journeys.d.ts +1 -1
  74. package/types/internal/src/modules/notify.d.ts +3 -3
  75. package/types/internal/src/modules/payments.d.ts +3286 -0
  76. package/types/internal/src/modules/stores.d.ts +7 -7
  77. package/types/internal/src/modules/workspaces.d.ts +22 -0
  78. package/types/server/src/{purchases.d.ts → iap.d.ts} +7 -7
  79. package/types/server/src/index.d.ts +2 -1
  80. package/types/server/src/payments.d.ts +65 -0
  81. package/types/server/src/server.d.ts +4 -1
  82. package/types/web/src/chat.d.ts +30 -4
  83. package/types/web/src/client.d.ts +13 -10
  84. package/types/web/src/{purchases.d.ts → iap.d.ts} +46 -56
  85. package/types/web/src/inapp.d.ts +5 -5
  86. package/types/web/src/index.d.ts +4 -2
  87. package/types/web/src/messaging.d.ts +1 -0
  88. package/types/web/src/notify.d.ts +2 -2
  89. package/types/web/src/payments-ui/index.d.ts +7 -0
  90. package/types/web/src/payments-ui/payment-sheet.d.ts +13 -0
  91. package/types/web/src/payments-ui/qr.d.ts +9 -0
  92. package/types/web/src/payments-ui/saved-cards-view.d.ts +7 -0
  93. package/types/web/src/payments-ui/spend-qr-view.d.ts +8 -0
  94. package/types/web/src/payments-ui/theme.d.ts +16 -0
  95. package/types/web/src/payments-ui/types.d.ts +149 -0
  96. package/types/web/src/payments-ui/wallet-topup-sheet.d.ts +7 -0
  97. package/types/web/src/payments.d.ts +281 -0
  98. package/types/web/src/paywall/placement.d.ts +6 -8
  99. package/types/web/src/screen/assets.d.ts +1 -1
  100. package/types/web/src/screen/resolve.d.ts +3 -3
  101. package/types/web/src/vite.d.ts +8 -0
  102. package/dist/chunks/2HJQSGOO.js +0 -13
  103. package/dist/chunks/3TXOVBZP.js +0 -22
  104. package/dist/chunks/4NHRUBEF.js +0 -2
  105. package/dist/chunks/63TUW6P7.js +0 -18
  106. package/dist/chunks/BYXX373R.js +0 -21
  107. package/dist/chunks/CTWUVLVE.js +0 -2
  108. package/dist/chunks/GFG7WVN2.js +0 -2
  109. package/dist/chunks/KU6B2OXP.js +0 -2
  110. package/dist/chunks/X6JMSZBD.js +0 -6
  111. package/dist/chunks/ZZRRJOEP.js +0 -2
@@ -147,6 +147,43 @@ export type AgentDraftRequest = {
147
147
  */
148
148
  name?: string;
149
149
  };
150
+ /**
151
+ * A variable's value and what the secret says of itself. A value kept from the definition written over ("") keeps what it said there unless a person changes it (403 person_required); a sealed value given is held to the value rules of PUT /ai/env/{key}, and a kept value made sealed (open or no secret before) is given with it (400 value_required). A write that gives any value is a change: the draft's revision moves.
152
+ */
153
+ export type AgentEnvEntry = {
154
+ /**
155
+ * Said with open: true where the secret becomes open, and with secret: false where a secret becomes none (it was not so in the definition written over): you read that the agent reads it as it is.
156
+ */
157
+ acknowledge_open?: boolean;
158
+ /**
159
+ * The hosts a request may carry it to, as PUT /ai/env/{key} takes them.
160
+ */
161
+ hosts?: string[];
162
+ /**
163
+ * Where in such a request it may be put: header (the default), query, body.
164
+ */
165
+ inject?: ("header" | "query" | "body")[];
166
+ /**
167
+ * The agent reads it as it is: no hosts, no inject.
168
+ */
169
+ open?: boolean;
170
+ /**
171
+ * Its value ("": keep the value it has).
172
+ */
173
+ value?: string;
174
+ /**
175
+ * Said with a sealed value a person may have chosen (fewer than 16 characters, or one kind of character only).
176
+ */
177
+ acknowledge_guessable?: boolean;
178
+ /**
179
+ * Whether it is a secret (the default); false: a plain variable the agent reads as it is, with no hosts and no class.
180
+ */
181
+ secret?: boolean;
182
+ };
183
+ /**
184
+ * A variable's value alone ("" read back, and written to keep the value it has).
185
+ */
186
+ export type AgentEnvValue = string;
150
187
  /**
151
188
  * The project's agents.
152
189
  */
@@ -223,6 +260,17 @@ export type AgentVersionList = {
223
260
  */
224
261
  versions: AgentVersion[];
225
262
  };
263
+ export type AutoFailoverPolicy = ({
264
+ /**
265
+ * Seconds a target machine must stay offline before automatic handoff triggers.
266
+ */
267
+ after_offline_seconds: number;
268
+ to: ExecutionTarget;
269
+ /**
270
+ * Wait for a clean workspace publish before cutting over.
271
+ */
272
+ require_workspace_clean_before_cut?: boolean;
273
+ }) | null;
226
274
  /**
227
275
  * A conversation of the project's users with one of its agents.
228
276
  */
@@ -271,7 +319,33 @@ export type Chat = {
271
319
  */
272
320
  title: string;
273
321
  voice?: VoiceSession;
274
- workspace?: ChatWorkspace;
322
+ /**
323
+ * Standalone workspaces module id (ws_<24hex>).
324
+ */
325
+ workspace_id?: string;
326
+ target?: ExecutionTarget;
327
+ target_generation?: number;
328
+ auto_failover?: AutoFailoverPolicy;
329
+ /**
330
+ * Realtime channel topic streaming this chat live.
331
+ */
332
+ topic?: string;
333
+ run_status?: "idle" | "running" | "awaiting_approval" | "awaiting_tool" | "offline_parked";
334
+ active_run_id?: string;
335
+ target_summary?: TargetSummary;
336
+ };
337
+ export type ChatExecution = {
338
+ chat_id: string;
339
+ target: ExecutionTarget;
340
+ target_generation: number;
341
+ workspace_id?: string;
342
+ workspace_seq: number;
343
+ machine_status?: "online" | "offline" | "waking";
344
+ machine_name?: string;
345
+ harnesses?: MachineHarness[];
346
+ auto_failover?: AutoFailoverPolicy;
347
+ failover_at?: string | null;
348
+ pending_handoff?: PendingHandoff;
275
349
  };
276
350
  /**
277
351
  * Where a forked chat came from.
@@ -484,7 +558,7 @@ export type ChatPartPage = {
484
558
  */
485
559
  export type ChatPipe = {
486
560
  /**
487
- * A channel of the project's realtime (not one of the platform's: roles:, flags:, purchases:, messaging:, debug:, nor phoenix, realtime's heartbeat).
561
+ * A channel of the project's realtime (not one of the platform's: roles:, flags:, iap:, payments:, payment_intent:, messaging:, calls:, consents:, debug:, nor phoenix, realtime's heartbeat).
488
562
  */
489
563
  topic: string;
490
564
  };
@@ -501,19 +575,6 @@ export type ChatPipeResult = {
501
575
  */
502
576
  topic: string;
503
577
  };
504
- /**
505
- * One repository of a chat's workspace.
506
- */
507
- export type ChatRepo = {
508
- /**
509
- * The branch it is checked out at and pushed to (the repository's default unless said).
510
- */
511
- branch?: string;
512
- /**
513
- * The project's name for the repository (PUT /ai/repos/{name}).
514
- */
515
- repo: string;
516
- };
517
578
  /**
518
579
  * A chat to start: the project's server's alone.
519
580
  */
@@ -541,7 +602,16 @@ export type ChatRequest = {
541
602
  * Its title (256 bytes at most).
542
603
  */
543
604
  title?: string;
544
- workspace?: ChatWorkspace;
605
+ /**
606
+ * Standalone workspaces module id (ws_<24hex>).
607
+ */
608
+ workspace_id?: string;
609
+ target?: ExecutionTarget;
610
+ auto_failover?: AutoFailoverPolicy;
611
+ /**
612
+ * Attach a Realtime pipe automatically at creation (defaults to settings.auto_pipe_chats).
613
+ */
614
+ live?: boolean;
545
615
  };
546
616
  /**
547
617
  * Stops the chat's turn.
@@ -597,35 +667,23 @@ export type ChatToolCall = {
597
667
  */
598
668
  status: string;
599
669
  };
600
- /**
601
- * The project's repositories a chat works in, each at a branch: its turns run on a machine of the platform's with them checked out, and what its agent commits is pushed to that branch.
602
- */
603
- export type ChatWorkspace = {
604
- /**
605
- * Lets the agent push its commits to the branches without a person's yes — the server's choice for the chat: its members' messages then reach the repository. Without it a push waits for a member's approval.
606
- */
607
- auto_push?: boolean;
670
+ export type ComputeTarget = {
608
671
  /**
609
- * 1 to 8 of the project's repositories, each once.
672
+ * Where the session runs.
610
673
  */
611
- repos: ChatRepo[];
674
+ kind: "serverless" | "cloud" | "pool" | "machine";
612
675
  /**
613
- * What each of its commits carries at its message's end (16 at most): a task, a link back to the conversation, a co-author. The engine writes each commit as the member its turn is for — their name and address — with these trailers; a turn of no member's commits as the platform.
676
+ * Runner pool id or name when kind is pool or machine.
614
677
  */
615
- trailers?: CommitTrailer[];
616
- };
617
- /**
618
- * A git trailer each of the chat's commits carries at its message's end.
619
- */
620
- export type CommitTrailer = {
678
+ pool_id?: string;
621
679
  /**
622
- * Its token, as git takes one: letters, digits and -, at most 64 (Co-authored-by, PalCore-Task).
680
+ * Specific enrolled runner machine id when kind is machine.
623
681
  */
624
- key: string;
682
+ machine_id?: string;
625
683
  /**
626
- * One line of at most 512 bytes.
684
+ * Optional hosted cloud environment profile name.
627
685
  */
628
- value: string;
686
+ environment?: string;
629
687
  };
630
688
  /**
631
689
  * A decision made.
@@ -807,6 +865,15 @@ export type EndpointRequest = {
807
865
  */
808
866
  workspace?: boolean;
809
867
  };
868
+ /**
869
+ * A host the secret may go to: the owner's Allow.
870
+ */
871
+ export type EnvHostRequest = {
872
+ /**
873
+ * An exact DNS name or *. and one, as hosts takes them.
874
+ */
875
+ host: string;
876
+ };
810
877
  /**
811
878
  * The project's variables.
812
879
  */
@@ -878,6 +945,182 @@ export type EnvVar = {
878
945
  */
879
946
  updated_at: string;
880
947
  };
948
+ /**
949
+ * A first-class project runtime environment for AI agents.
950
+ */
951
+ export type Environment = {
952
+ /**
953
+ * Unique environment name within the project.
954
+ */
955
+ name: string;
956
+ runtime: EnvironmentRuntime;
957
+ /**
958
+ * Lifecycle mode: ephemeral (auto-parks when idle) or always_on (pinned warm, never auto-parked).
959
+ */
960
+ mode: "ephemeral" | "always_on";
961
+ /**
962
+ * Minimum sandbox isolation posture.
963
+ */
964
+ isolation: "strict" | "relaxed";
965
+ resources: EnvironmentResources;
966
+ scaling: EnvironmentScaling;
967
+ network: EnvironmentNetwork;
968
+ /**
969
+ * Creation timestamp (RFC 3339).
970
+ */
971
+ created_at: string;
972
+ /**
973
+ * Last update timestamp (RFC 3339).
974
+ */
975
+ updated_at: string;
976
+ };
977
+ /**
978
+ * An immutable pre-bake build record for a runtime environment.
979
+ */
980
+ export type EnvironmentBuild = {
981
+ /**
982
+ * Unique build identifier (envb_...).
983
+ */
984
+ build_id: string;
985
+ /**
986
+ * Name of the environment being built.
987
+ */
988
+ environment_name: string;
989
+ /**
990
+ * Current build state.
991
+ */
992
+ status: "queued" | "building" | "ready" | "failed";
993
+ /**
994
+ * Resulting immutable OCI image digest when ready.
995
+ */
996
+ image_digest?: string;
997
+ /**
998
+ * SHA-256 digest of the runtime specification.
999
+ */
1000
+ setup_digest: string;
1001
+ /**
1002
+ * Tail of build logs, if available.
1003
+ */
1004
+ log_excerpt?: string;
1005
+ /**
1006
+ * Failure detail if status is failed.
1007
+ */
1008
+ error_message?: string;
1009
+ /**
1010
+ * Creation timestamp (RFC 3339).
1011
+ */
1012
+ created_at: string;
1013
+ /**
1014
+ * Last update timestamp (RFC 3339).
1015
+ */
1016
+ updated_at: string;
1017
+ /**
1018
+ * Completion timestamp (RFC 3339), if finished.
1019
+ */
1020
+ completed_at?: string | null;
1021
+ };
1022
+ /**
1023
+ * The project's runtime environments.
1024
+ */
1025
+ export type EnvironmentList = {
1026
+ /**
1027
+ * Environments ordered by name.
1028
+ */
1029
+ environments: Environment[];
1030
+ };
1031
+ /**
1032
+ * Outbound network egress policy and Palbase DB connectivity.
1033
+ */
1034
+ export type EnvironmentNetwork = {
1035
+ /**
1036
+ * Outbound network policy.
1037
+ */
1038
+ egress?: "default" | "restricted" | "none";
1039
+ /**
1040
+ * Whether sandboxes in this environment may reach project Palbase Postgres databases via the TLS/SSLRequest egress proxy.
1041
+ */
1042
+ allow_palbase_db?: boolean;
1043
+ /**
1044
+ * Additional allowlisted hostnames when egress is restricted.
1045
+ */
1046
+ allow_hosts?: string[];
1047
+ };
1048
+ /**
1049
+ * Configuration for creating or updating a project runtime environment.
1050
+ */
1051
+ export type EnvironmentRequest = {
1052
+ /**
1053
+ * Environment name (required on POST /ai/environments; ignored when provided in the path on PUT).
1054
+ */
1055
+ name?: string;
1056
+ runtime?: EnvironmentRuntime;
1057
+ /**
1058
+ * Lifecycle mode: ephemeral or always_on.
1059
+ */
1060
+ mode?: "ephemeral" | "always_on";
1061
+ /**
1062
+ * Sandbox isolation posture.
1063
+ */
1064
+ isolation?: "strict" | "relaxed";
1065
+ resources?: EnvironmentResources;
1066
+ scaling?: EnvironmentScaling;
1067
+ network?: EnvironmentNetwork;
1068
+ };
1069
+ /**
1070
+ * Compute and idle lifecycle limits for an environment.
1071
+ */
1072
+ export type EnvironmentResources = {
1073
+ /**
1074
+ * Virtual CPU count.
1075
+ */
1076
+ cpu?: number;
1077
+ /**
1078
+ * Memory limit in MiB.
1079
+ */
1080
+ memory_mb?: number;
1081
+ /**
1082
+ * Encrypted workspace disk budget in MiB.
1083
+ */
1084
+ disk_mb?: number;
1085
+ /**
1086
+ * Idle timeout before parking in seconds (always 0 for always_on environments).
1087
+ */
1088
+ idle_timeout_seconds?: number;
1089
+ };
1090
+ /**
1091
+ * Container image, Dockerfile, Mac VM profile, and pre-install setup commands for an environment.
1092
+ */
1093
+ export type EnvironmentRuntime = {
1094
+ /**
1095
+ * Base OCI container image (defaults to ubuntu:24.04 when dockerfile and vm_profile are omitted).
1096
+ */
1097
+ image?: string;
1098
+ /**
1099
+ * Optional inline Dockerfile content for custom environment builds.
1100
+ */
1101
+ dockerfile?: string;
1102
+ /**
1103
+ * Optional Virtualization.framework VM profile for native Xcode or Linux microVM execution.
1104
+ */
1105
+ vm_profile?: "macos-xcode" | "linux-vm";
1106
+ /**
1107
+ * Shell setup commands executed when baking or initializing the environment.
1108
+ */
1109
+ setup?: string[];
1110
+ };
1111
+ /**
1112
+ * Warm pool and concurrency scaling bounds.
1113
+ */
1114
+ export type EnvironmentScaling = {
1115
+ /**
1116
+ * Minimum number of pre-warmed instances.
1117
+ */
1118
+ min_warm?: number;
1119
+ /**
1120
+ * Maximum concurrent instances.
1121
+ */
1122
+ max_instances?: number;
1123
+ };
881
1124
  export type ErrorResponse = {
882
1125
  /**
883
1126
  * Machine-readable error code (snake_case)
@@ -900,6 +1143,28 @@ export type ErrorResponse = {
900
1143
  */
901
1144
  status: number;
902
1145
  };
1146
+ export type ExecutionTarget = {
1147
+ compute: ComputeTarget;
1148
+ executor: ExecutorTarget;
1149
+ };
1150
+ export type ExecutorTarget = {
1151
+ /**
1152
+ * Execution runtime: Palbase single engine or local ACP CLI adapter.
1153
+ */
1154
+ kind: "palbase" | "acp";
1155
+ /**
1156
+ * Official local ACP CLI harness when kind is acp.
1157
+ */
1158
+ harness?: "claude-code" | "codex" | "gemini-cli";
1159
+ /**
1160
+ * Optional default model override.
1161
+ */
1162
+ model?: string;
1163
+ /**
1164
+ * Optional default reasoning effort override.
1165
+ */
1166
+ effort?: string;
1167
+ };
903
1168
  /**
904
1169
  * Where to fork a chat.
905
1170
  */
@@ -917,6 +1182,12 @@ export type ForkRequest = {
917
1182
  */
918
1183
  title?: string;
919
1184
  };
1185
+ /**
1186
+ * OpenAI or Anthropic wire-compatible JSON payload.
1187
+ */
1188
+ export type GatewayJSON = {
1189
+ [key: string]: unknown;
1190
+ };
920
1191
  /**
921
1192
  * A chat's goal.
922
1193
  */
@@ -1101,6 +1372,29 @@ export type GoalUsage = {
1101
1372
  */
1102
1373
  verifications: number;
1103
1374
  };
1375
+ export type HandoffRequest = {
1376
+ to: ExecutionTarget;
1377
+ /**
1378
+ * When to cut over: idle (default), after_turn, or now.
1379
+ */
1380
+ when?: "idle" | "after_turn" | "now";
1381
+ /**
1382
+ * Grace window in seconds for parking an active turn when when=now.
1383
+ */
1384
+ grace_seconds?: number;
1385
+ /**
1386
+ * Caller idempotency key so retries return the same generation without double-teleporting.
1387
+ */
1388
+ idempotency_key?: string;
1389
+ };
1390
+ export type HandoffResponse = {
1391
+ chat_id: string;
1392
+ target_generation: number;
1393
+ target: ExecutionTarget;
1394
+ workspace_seq: number;
1395
+ active_run_action: "none" | "queued_after_turn" | "parked_and_resumed";
1396
+ resumed_response_id?: string;
1397
+ };
1104
1398
  /**
1105
1399
  * A picture job.
1106
1400
  */
@@ -1309,6 +1603,34 @@ export type LongContextPrice = {
1309
1603
  */
1310
1604
  output_usd_per_mtok: number;
1311
1605
  };
1606
+ export type MachineHarness = {
1607
+ name: "claude-code" | "codex" | "gemini-cli";
1608
+ acp_version?: string;
1609
+ cli_version?: string;
1610
+ status: "ready" | "unauthenticated" | "not_installed";
1611
+ };
1612
+ /**
1613
+ * A machine's seal key, as the engine keeps it: the key a secret is sealed to on this machine (null: it never stated one — an agent before seal keys, or a key Palbase did not mint). A machine re-states at its certificate renewal while it is not registered, with no restart.
1614
+ */
1615
+ export type MachineSealKey = ({
1616
+ /**
1617
+ * Why it is not registered: the module's closed reason for refused (refused_stale, refused_future, refused_retired, refused_elsewhere, refused_pinned, refused_statement, refused_shape), what failed for pending.
1618
+ */
1619
+ reason?: string;
1620
+ /**
1621
+ * registered (secrets may be sealed to it), pending (being registered; retried), refused (see reason), stale (a statement too old to register: the machine states again at its next renewal), or held (a hosted machine's, waiting for its first lease).
1622
+ */
1623
+ state: "registered" | "pending" | "refused" | "stale" | "held";
1624
+ }) | null;
1625
+ export type MediaModel = {
1626
+ id: string;
1627
+ name: string;
1628
+ provider: string;
1629
+ modality: string;
1630
+ default: boolean;
1631
+ price_usd: number;
1632
+ unit: string;
1633
+ };
1312
1634
  /**
1313
1635
  * A user in a chat.
1314
1636
  */
@@ -1530,6 +1852,9 @@ export type Models = {
1530
1852
  * The providers whose models could not be listed just now: their models are missing from chat until they answer.
1531
1853
  */
1532
1854
  unavailable: string[];
1855
+ videos?: MediaModel[];
1856
+ stt?: MediaModel[];
1857
+ tts?: MediaModel[];
1533
1858
  };
1534
1859
  /**
1535
1860
  * A user to put in a chat as it starts.
@@ -1552,6 +1877,17 @@ export type NewMember = {
1552
1877
  */
1553
1878
  user_id: string;
1554
1879
  };
1880
+ export type PatchExecutionRequest = {
1881
+ auto_failover?: AutoFailoverPolicy;
1882
+ model?: string;
1883
+ effort?: string;
1884
+ };
1885
+ export type PendingHandoff = {
1886
+ to: ExecutionTarget;
1887
+ reason: string;
1888
+ idempotency_key?: string;
1889
+ requested_at: string;
1890
+ };
1555
1891
  /**
1556
1892
  * A runner pool of the project's.
1557
1893
  */
@@ -1675,19 +2011,6 @@ export type PoolList = {
1675
2011
  */
1676
2012
  pools: Pool[];
1677
2013
  };
1678
- /**
1679
- * A machine's seal key, as the engine keeps it: the key a secret is sealed to on this machine (null: it never stated one — an agent before seal keys, or a key Palbase did not mint). A machine re-states at its certificate renewal while it is not registered, with no restart.
1680
- */
1681
- export type MachineSealKey = ({
1682
- /**
1683
- * Why it is not registered: the module's closed reason for refused (refused_stale, refused_future, refused_retired, refused_elsewhere, refused_pinned, refused_statement, refused_shape), what failed for pending.
1684
- */
1685
- reason?: string;
1686
- /**
1687
- * registered (secrets may be sealed to it), pending (being registered; retried), refused (see reason), stale (a statement too old to register: the machine states again at its next renewal), or held (a hosted machine's, waiting for its first lease).
1688
- */
1689
- state: "registered" | "pending" | "refused" | "stale" | "held";
1690
- }) | null;
1691
2014
  /**
1692
2015
  * A machine of a pool.
1693
2016
  */
@@ -1733,6 +2056,10 @@ export type PoolMachine = {
1733
2056
  * How many it holds now.
1734
2057
  */
1735
2058
  used: number;
2059
+ /**
2060
+ * Locally probed official ACP CLI harnesses reported by palbase-agent (no credentials).
2061
+ */
2062
+ harnesses?: MachineHarness[];
1736
2063
  };
1737
2064
  /**
1738
2065
  * A runner pool to make: of one type.
@@ -1830,111 +2157,38 @@ export type ProviderList = {
1830
2157
  providers: Provider[];
1831
2158
  };
1832
2159
  /**
1833
- * A commit a push brought to its branch.
2160
+ * A response.
1834
2161
  */
1835
- export type PushedCommit = {
1836
- /**
1837
- * Its author's address.
1838
- */
1839
- author_email: string;
2162
+ export type Response = {
1840
2163
  /**
1841
- * Its author: the member the turn was for, when the server said who they are.
2164
+ * When it was admitted.
1842
2165
  */
1843
- author_name: string;
2166
+ created_at: string;
2167
+ error: ResponseError;
1844
2168
  /**
1845
- * The commit.
2169
+ * The response's id.
1846
2170
  */
1847
- sha: string;
2171
+ id: string;
1848
2172
  /**
1849
- * Its message's first line.
2173
+ * The caller's own labels (16 at most, snake_case keys): returned with the response and its event.
1850
2174
  */
1851
- subject: string;
1852
- };
1853
- /**
1854
- * A GitHub repository the project's chats work in, by the project's name for it; the project's backend gives its tokens (the framework's ai.repo), asked at each clone and each push.
1855
- */
1856
- export type Repo = {
2175
+ metadata: {
2176
+ [key: string]: string;
2177
+ };
1857
2178
  /**
1858
- * The project's machine that gives its tokens.
2179
+ * The model that answered.
1859
2180
  */
1860
- backend: string;
2181
+ model: string;
1861
2182
  /**
1862
- * When it was put first.
2183
+ * The parsed document of an answer to a schema; null otherwise.
1863
2184
  */
1864
- created_at: string;
2185
+ output: unknown;
1865
2186
  /**
1866
- * The branch a workspace takes when it names none.
2187
+ * Where it is: queued, in_progress, then completed, failed, canceled, timed_out or budget_exceeded.
1867
2188
  */
1868
- default_branch: string;
2189
+ status: string;
1869
2190
  /**
1870
- * The project's name for it.
1871
- */
1872
- name: string;
1873
- /**
1874
- * The GitHub repository, owner/name.
1875
- */
1876
- repository: string;
1877
- };
1878
- /**
1879
- * The project's repositories, by name, a page at a time.
1880
- */
1881
- export type RepoPage = {
1882
- /**
1883
- * The next page's cursor; absent on the last page.
1884
- */
1885
- next_cursor?: string;
1886
- repos: Repo[];
1887
- };
1888
- /**
1889
- * A repository the project's chats work in.
1890
- */
1891
- export type RepoRequest = {
1892
- /**
1893
- * The project's machine whose framework gives the repository's tokens (backend unless said).
1894
- */
1895
- backend?: string;
1896
- /**
1897
- * The branch a workspace takes when it names none (main unless said).
1898
- */
1899
- default_branch?: string;
1900
- /**
1901
- * The GitHub repository, owner/name.
1902
- */
1903
- repository: string;
1904
- };
1905
- /**
1906
- * A response.
1907
- */
1908
- export type Response = {
1909
- /**
1910
- * When it was admitted.
1911
- */
1912
- created_at: string;
1913
- error: ResponseError;
1914
- /**
1915
- * The response's id.
1916
- */
1917
- id: string;
1918
- /**
1919
- * The caller's own labels (16 at most, snake_case keys): returned with the response and its event.
1920
- */
1921
- metadata: {
1922
- [key: string]: string;
1923
- };
1924
- /**
1925
- * The model that answered.
1926
- */
1927
- model: string;
1928
- /**
1929
- * The parsed document of an answer to a schema; null otherwise.
1930
- */
1931
- output: unknown;
1932
- /**
1933
- * Where it is: queued, in_progress, then completed, failed, canceled, timed_out or budget_exceeded.
1934
- */
1935
- status: string;
1936
- /**
1937
- * The answer as the model wrote it; for a schema's answer, the JSON document.
2191
+ * The answer as the model wrote it; for a schema's answer, the JSON document.
1938
2192
  */
1939
2193
  text: string | null;
1940
2194
  usage: ResponseUsage;
@@ -2153,6 +2407,139 @@ export type RunStopped = {
2153
2407
  */
2154
2408
  run_id: string;
2155
2409
  };
2410
+ /**
2411
+ * A host an agent's own secret may go to beside its definition's: an owner's Allow.
2412
+ */
2413
+ export type SecretHostAllowance = {
2414
+ /**
2415
+ * The agent whose own secret it is.
2416
+ */
2417
+ agent: string;
2418
+ /**
2419
+ * The allowance (sha_…).
2420
+ */
2421
+ allowance_id: string;
2422
+ /**
2423
+ * When it was allowed.
2424
+ */
2425
+ allowed_at: string;
2426
+ /**
2427
+ * The person who allowed it (their user id).
2428
+ */
2429
+ allowed_by: string;
2430
+ /**
2431
+ * The registrable domain the host is under — its public suffix and one label more (evil.io for api.stripe.com.evil.io); under palbase.studio or palbase.app, the name itself. What an Allow hands over: whoever holds the domain runs every name under it.
2432
+ */
2433
+ domain: string;
2434
+ /**
2435
+ * The host.
2436
+ */
2437
+ host: string;
2438
+ /**
2439
+ * The secret's name.
2440
+ */
2441
+ key: string;
2442
+ /**
2443
+ * Whose definition the agent's is: kept (an agent the project keeps), chat (a chat's own definition), backend (its backend's, at each turn). An ask and an Allow are the agent's of that origin alone: a chat's own definition under a kept agent's name is another's.
2444
+ */
2445
+ origin: "kept" | "chat" | "backend";
2446
+ };
2447
+ /**
2448
+ * The project's allowances, newest first.
2449
+ */
2450
+ export type SecretHostAllowanceList = {
2451
+ /**
2452
+ * The allowances.
2453
+ */
2454
+ allowances: SecretHostAllowance[];
2455
+ };
2456
+ /**
2457
+ * A sealed secret an agent sent to a host it is not allowed for: the placeholder went as it is, and its owner is asked.
2458
+ */
2459
+ export type SecretHostRequest = {
2460
+ /**
2461
+ * The agent whose own secret it is (its definition's env); null: one of the project's variables.
2462
+ */
2463
+ agent: string | null;
2464
+ /**
2465
+ * How many times it was sent there.
2466
+ */
2467
+ asks: number;
2468
+ /**
2469
+ * When it was allowed or dismissed; null: not yet.
2470
+ */
2471
+ decided_at: string | null;
2472
+ /**
2473
+ * The registrable domain the host is under — its public suffix and one label more (evil.io for api.stripe.com.evil.io); under palbase.studio or palbase.app, the name itself. What an Allow hands over: whoever holds the domain runs every name under it.
2474
+ */
2475
+ domain: string;
2476
+ /**
2477
+ * When it was first sent there.
2478
+ */
2479
+ first_asked_at: string;
2480
+ /**
2481
+ * The host it was sent to. Nobody has checked who runs it.
2482
+ */
2483
+ host: string;
2484
+ /**
2485
+ * The secret's name.
2486
+ */
2487
+ key: string;
2488
+ /**
2489
+ * When it was last sent there.
2490
+ */
2491
+ last_asked_at: string;
2492
+ /**
2493
+ * Whose definition the agent's is: kept (an agent the project keeps), chat (a chat's own definition), backend (its backend's, at each turn). An ask and an Allow are the agent's of that origin alone: a chat's own definition under a kept agent's name is another's. Null: one of the project's variables.
2494
+ */
2495
+ origin: string | null;
2496
+ /**
2497
+ * The ask (shr_…).
2498
+ */
2499
+ request_id: string;
2500
+ /**
2501
+ * asked, allowed or dismissed.
2502
+ */
2503
+ status: string;
2504
+ };
2505
+ /**
2506
+ * The asks of one status, newest first (500 at most: all a project keeps of it).
2507
+ */
2508
+ export type SecretHostRequestList = {
2509
+ /**
2510
+ * The asks.
2511
+ */
2512
+ requests: SecretHostRequest[];
2513
+ };
2514
+ /**
2515
+ * ai.secret_host_requested: an agent sent a sealed secret to a host it is not allowed for.
2516
+ */
2517
+ export type SecretHostRequested = {
2518
+ /**
2519
+ * The agent whose own secret it is; null: one of the project's variables.
2520
+ */
2521
+ agent: string | null;
2522
+ /**
2523
+ * When it was sent there.
2524
+ */
2525
+ asked_at: string;
2526
+ /**
2527
+ * The host it was sent to. Nobody has checked who runs it.
2528
+ */
2529
+ host: string;
2530
+ /**
2531
+ * The secret's name.
2532
+ */
2533
+ key: string;
2534
+ /**
2535
+ * The project whose secret it is: Palbase's own copy names the customer's.
2536
+ */
2537
+ project_id: string;
2538
+ /**
2539
+ * The ask: allow or dismiss it (GET /ai/env/host-requests).
2540
+ */
2541
+ request_id: string;
2542
+ };
2156
2543
  /**
2157
2544
  * What the project allows its chats.
2158
2545
  */
@@ -2181,6 +2568,14 @@ export type Settings = {
2181
2568
  * Whether the work an app's user starts (a member's message, goal or voice) has the project's open secrets. Off (the default), only the work the project's developers and its server start does.
2182
2569
  */
2183
2570
  open_secrets_for_app_users: boolean;
2571
+ /**
2572
+ * Allow signed-in app users to trigger POST /ai/chats/{chat_id}/handoff directly (default false).
2573
+ */
2574
+ allow_client_handoff?: boolean;
2575
+ /**
2576
+ * Automatically attach a live Realtime pipe (chat:<chat_id>) when creating a new chat (default true).
2577
+ */
2578
+ auto_pipe_chats?: boolean;
2184
2579
  };
2185
2580
  /**
2186
2581
  * A change of what the project allows its chats; a field left out is left as it is.
@@ -2206,6 +2601,22 @@ export type SettingsRequest = {
2206
2601
  * Let the work an app's user starts have the project's open secrets: anyone who signs in to the app can then drive an agent to read them. A person's alone: an owner or an admin of the organization signed in, never a key or a token, the secret key included (403 person_required; an environment's token, token_out_of_scope).
2207
2602
  */
2208
2603
  open_secrets_for_app_users?: boolean;
2604
+ /**
2605
+ * Allow signed-in app users to trigger session handoffs (default false).
2606
+ */
2607
+ allow_client_handoff?: boolean;
2608
+ /**
2609
+ * Default automatic Realtime piping on new chats (default true).
2610
+ */
2611
+ auto_pipe_chats?: boolean;
2612
+ };
2613
+ export type SpeechRequest = {
2614
+ model?: string;
2615
+ input: string;
2616
+ voice?: string;
2617
+ response_format?: "mp3" | "opus" | "wav" | "pcm" | "aac" | "flac";
2618
+ format?: "mp3" | "opus" | "wav" | "pcm" | "aac" | "flac";
2619
+ speed?: number;
2209
2620
  };
2210
2621
  /**
2211
2622
  * What the project's use of Palbase's models (the platform's provider keys) has cost this month, and what it may still spend. A month brings every project a dollar of it free. Past it a Free project uses its own provider keys; a Pay as you go one is charged for it, at the provider's price and 10%.
@@ -2299,336 +2710,97 @@ export type Subagent = {
2299
2710
  tools?: ToolRef[];
2300
2711
  };
2301
2712
  /**
2302
- * One path as a writer changed it.
2303
- */
2304
- export type SyncChange = {
2305
- now?: SyncEntry;
2306
- /**
2307
- * The path.
2308
- */
2309
- path: string;
2310
- previous?: SyncEntry;
2311
- };
2312
- /**
2313
- * A writer's changes.
2713
+ * The support line's answer: what to do, and whether it was logged as something Palbase lacks — then with the case it was logged under.
2314
2714
  */
2315
- export type SyncChangeSet = {
2715
+ export type SupportAnswer = {
2316
2716
  /**
2317
- * Its changes, each with what it last knew of its path.
2717
+ * The answer, in the question's language, naming the documentation it is taken from.
2318
2718
  */
2319
- changes: SyncChange[];
2719
+ answer: string;
2320
2720
  /**
2321
- * The head the writer last applied in full.
2721
+ * The case's id (sup_…), given only when the question was logged: what the asker holds of it, and what the mail sent when it is closed names. An answer that logged nothing has no case.
2322
2722
  */
2323
- known_seq: number;
2723
+ case?: string;
2324
2724
  /**
2325
- * Why it publishes.
2725
+ * Whether the question was logged as something Palbase lacks: the asker is mailed when it is closed.
2326
2726
  */
2327
- reason?: string;
2727
+ logged: boolean;
2328
2728
  };
2329
2729
  /**
2330
- * The store's answer to a publish.
2730
+ * A question to Palbase's support line.
2331
2731
  */
2332
- export type SyncChangeSetResult = {
2732
+ export type SupportQuestion = {
2333
2733
  /**
2334
- * The paths applied.
2734
+ * What the asker's project shows (at most 32768 characters): its machines, their last builds, a failed build's log. Credential-shaped values are masked before the model or anyone else reads it.
2335
2735
  */
2336
- applied?: string[];
2736
+ context?: string;
2337
2737
  /**
2338
- * What changed since known_seq that the writer has not seen.
2738
+ * The question, in any language. Credential-shaped values are masked before the model or anyone else reads it.
2339
2739
  */
2340
- catch_up?: SyncPathState[];
2740
+ question: string;
2741
+ };
2742
+ export type TargetSummary = {
2743
+ compute: "mac" | "cloud" | "linux" | "serverless";
2744
+ machine_id?: string;
2745
+ machine_name?: string;
2746
+ machine_online?: boolean;
2747
+ executor: "palbase" | "acp";
2748
+ harness?: string;
2749
+ };
2750
+ /**
2751
+ * A tool an agent of the project's may be given, as a ToolRef names it.
2752
+ */
2753
+ export type Tool = {
2341
2754
  /**
2342
- * known_seq is older than the kept history: catch_up is the whole tree.
2755
+ * Every call waits for a person's yes.
2343
2756
  */
2344
- catch_up_full?: boolean;
2757
+ approval: boolean;
2345
2758
  /**
2346
- * The changes that lost.
2759
+ * What it does.
2347
2760
  */
2348
- conflicts?: SyncConflict[];
2761
+ description: string;
2349
2762
  /**
2350
- * The head the history holds at known_seq, which catch_up (or its absence) starts from. Absent only when catch_up is the whole tree (catch_up_full), or from a plane of a release before it. A writer whose own head at known_seq is another one has a history the store no longer has (restored from a backup): it takes neither and syncs again from scratch.
2763
+ * backend, client: the machine whose build declares it.
2351
2764
  */
2352
- known_manifest_id?: string;
2765
+ machine?: string;
2353
2766
  /**
2354
- * The head's tree now.
2767
+ * Its name.
2355
2768
  */
2356
- manifest_id: string;
2769
+ name: string;
2357
2770
  /**
2358
- * The head's sequence now.
2771
+ * What it takes, as a JSON Schema (an MCP server says its own when it is called).
2359
2772
  */
2360
- seq: number;
2773
+ parameters?: {
2774
+ [key: string]: unknown;
2775
+ };
2361
2776
  /**
2362
- * Its checksum.
2777
+ * backend: the backend's function; client: the app answers it; https, mcp: an endpoint of the project's; platform: the platform's.
2363
2778
  */
2364
- tree_checksum?: string;
2779
+ source: "backend" | "client" | "https" | "mcp" | "platform";
2365
2780
  };
2366
2781
  /**
2367
- * What changed since a sequence, as it is at the head (none: the head alone).
2782
+ * A part of what a tool returned.
2368
2783
  */
2369
- export type SyncChanges = {
2370
- /**
2371
- * Each changed path, as it is at the head.
2372
- */
2373
- changes?: SyncPathState[];
2374
- /**
2375
- * since is older than the kept history (or 0): changes is the whole tree.
2376
- */
2377
- full?: boolean;
2378
- /**
2379
- * The head's tree.
2380
- */
2381
- manifest_id: string;
2784
+ export type ToolContent = {
2382
2785
  /**
2383
- * The head's sequence.
2786
+ * An image as base64 (5 MiB at most).
2384
2787
  */
2385
- seq: number;
2788
+ data?: string;
2386
2789
  /**
2387
- * The sequence asked from.
2790
+ * An image's type: image/png, image/jpeg, image/webp or image/gif.
2388
2791
  */
2389
- since?: number;
2792
+ media_type?: string;
2390
2793
  /**
2391
- * The head the history holds at since, which changes starts from. Absent only with full, or from a plane of a release before it. A writer whose own head at since is another one has a history the store no longer has (restored from a backup): it syncs again from scratch instead of taking changes.
2794
+ * The text.
2392
2795
  */
2393
- since_manifest_id?: string;
2796
+ text?: string;
2394
2797
  /**
2395
- * The head's tree's checksum.
2798
+ * text or image.
2396
2799
  */
2397
- tree_checksum?: string;
2800
+ type: "text" | "image";
2398
2801
  };
2399
2802
  /**
2400
- * A change that lost: the path had changed in the store since the writer saw it.
2401
- */
2402
- export type SyncConflict = {
2403
- /**
2404
- * The conflict: read it by it (GET /ai/workspace-sync/conflicts/{conflict_id}).
2405
- */
2406
- id: string;
2407
- lost?: SyncEntry;
2408
- /**
2409
- * The path.
2410
- */
2411
- path: string;
2412
- winner?: SyncEntry;
2413
- };
2414
- /**
2415
- * A conflict as the workspace's history keeps it.
2416
- */
2417
- export type SyncConflictDetail = {
2418
- /**
2419
- * When it lost.
2420
- */
2421
- created_at?: string;
2422
- /**
2423
- * The conflict.
2424
- */
2425
- id: string;
2426
- lost?: SyncEntry;
2427
- /**
2428
- * The tree the store was at.
2429
- */
2430
- manifest_id?: string;
2431
- /**
2432
- * The path.
2433
- */
2434
- path: string;
2435
- read?: SyncGrant;
2436
- winner?: SyncEntry;
2437
- /**
2438
- * Who wrote the version that lost.
2439
- */
2440
- writer?: string;
2441
- };
2442
- /**
2443
- * What a path is in a tree: a file (its digest, size and mode) or a directory.
2444
- */
2445
- export type SyncEntry = {
2446
- /**
2447
- * A file's bytes' digest: sha256:<hex>.
2448
- */
2449
- digest?: string;
2450
- /**
2451
- * file or dir.
2452
- */
2453
- kind: "file" | "dir";
2454
- /**
2455
- * A file's mode.
2456
- */
2457
- mode?: number;
2458
- /**
2459
- * A file's size in bytes.
2460
- */
2461
- size?: number;
2462
- };
2463
- /**
2464
- * One presigned request.
2465
- */
2466
- export type SyncGrant = {
2467
- /**
2468
- * The headers it is made with.
2469
- */
2470
- headers?: {
2471
- [key: string]: string;
2472
- };
2473
- /**
2474
- * Its method.
2475
- */
2476
- method: string;
2477
- /**
2478
- * Its address, signed.
2479
- */
2480
- url: string;
2481
- };
2482
- /**
2483
- * The blobs to transfer, by their digests.
2484
- */
2485
- export type SyncGrantRequest = {
2486
- /**
2487
- * Blobs it will read.
2488
- */
2489
- get?: string[];
2490
- /**
2491
- * Blobs the writer will upload.
2492
- */
2493
- put?: string[];
2494
- };
2495
- /**
2496
- * Each digest asked for, and its grant (a put the store holds already is absent).
2497
- */
2498
- export type SyncGrants = {
2499
- /**
2500
- * Reads, by digest.
2501
- */
2502
- get?: {
2503
- [key: string]: SyncGrant;
2504
- };
2505
- /**
2506
- * Uploads, by digest.
2507
- */
2508
- put?: {
2509
- [key: string]: SyncGrant;
2510
- };
2511
- };
2512
- /**
2513
- * A path as it is at a head (state null: absent).
2514
- */
2515
- export type SyncPathState = {
2516
- /**
2517
- * The path, relative to the workspace's root.
2518
- */
2519
- path: string;
2520
- state: SyncEntry;
2521
- };
2522
- /**
2523
- * The store's refusal (RFC 9457).
2524
- */
2525
- export type SyncProblem = {
2526
- /**
2527
- * Its stable code.
2528
- */
2529
- code?: string;
2530
- /**
2531
- * Its sentence.
2532
- */
2533
- detail?: string;
2534
- /**
2535
- * Its status.
2536
- */
2537
- status?: number;
2538
- /**
2539
- * Its title.
2540
- */
2541
- title?: string;
2542
- /**
2543
- * Its type.
2544
- */
2545
- type?: string;
2546
- [key: string]: unknown;
2547
- };
2548
- /**
2549
- * The support line's answer: what to do, and whether it was logged as something Palbase lacks — then with the case it was logged under.
2550
- */
2551
- export type SupportAnswer = {
2552
- /**
2553
- * The answer, in the question's language, naming the documentation it is taken from.
2554
- */
2555
- answer: string;
2556
- /**
2557
- * The case's id (sup_…), given only when the question was logged: what the asker holds of it, and what the mail sent when it is closed names. An answer that logged nothing has no case.
2558
- */
2559
- case?: string;
2560
- /**
2561
- * Whether the question was logged as something Palbase lacks: the asker is mailed when it is closed.
2562
- */
2563
- logged: boolean;
2564
- };
2565
- /**
2566
- * A question to Palbase's support line.
2567
- */
2568
- export type SupportQuestion = {
2569
- /**
2570
- * What the asker's project shows (at most 32768 characters): its machines, their last builds, a failed build's log. Credential-shaped values are masked before the model or anyone else reads it.
2571
- */
2572
- context?: string;
2573
- /**
2574
- * The question, in any language. Credential-shaped values are masked before the model or anyone else reads it.
2575
- */
2576
- question: string;
2577
- };
2578
- /**
2579
- * A tool an agent of the project's may be given, as a ToolRef names it.
2580
- */
2581
- export type Tool = {
2582
- /**
2583
- * Every call waits for a person's yes.
2584
- */
2585
- approval: boolean;
2586
- /**
2587
- * What it does.
2588
- */
2589
- description: string;
2590
- /**
2591
- * backend, client: the machine whose build declares it.
2592
- */
2593
- machine?: string;
2594
- /**
2595
- * Its name.
2596
- */
2597
- name: string;
2598
- /**
2599
- * What it takes, as a JSON Schema (an MCP server says its own when it is called).
2600
- */
2601
- parameters?: {
2602
- [key: string]: unknown;
2603
- };
2604
- /**
2605
- * backend: the backend's function; client: the app answers it; https, mcp: an endpoint of the project's; platform: the platform's.
2606
- */
2607
- source: "backend" | "client" | "https" | "mcp" | "platform";
2608
- };
2609
- /**
2610
- * A part of what a tool returned.
2611
- */
2612
- export type ToolContent = {
2613
- /**
2614
- * An image as base64 (5 MiB at most).
2615
- */
2616
- data?: string;
2617
- /**
2618
- * An image's type: image/png, image/jpeg, image/webp or image/gif.
2619
- */
2620
- media_type?: string;
2621
- /**
2622
- * The text.
2623
- */
2624
- text?: string;
2625
- /**
2626
- * text or image.
2627
- */
2628
- type: "text" | "image";
2629
- };
2630
- /**
2631
- * The tools the project's agents may be given.
2803
+ * The tools the project's agents may be given.
2632
2804
  */
2633
2805
  export type ToolList = {
2634
2806
  /**
@@ -2698,6 +2870,49 @@ export type ToolRef = {
2698
2870
  */
2699
2871
  source: "backend" | "https" | "mcp" | "client" | "platform";
2700
2872
  };
2873
+ export type TranscriptionRequest = {
2874
+ model?: string;
2875
+ storage_bucket?: string;
2876
+ storage_path?: string;
2877
+ language?: string;
2878
+ diarization?: boolean;
2879
+ media_type?: string;
2880
+ };
2881
+ export type TranscriptionResponse = {
2882
+ model: string;
2883
+ text: string;
2884
+ language?: string;
2885
+ duration_seconds: number;
2886
+ segments?: TranscriptionSegment[];
2887
+ cost_nano_usd: number;
2888
+ };
2889
+ export type TranscriptionSegment = {
2890
+ speaker?: string;
2891
+ start: number;
2892
+ end: number;
2893
+ text: string;
2894
+ };
2895
+ /**
2896
+ * What the agent's advisor spent reading the turn so far: inside the turn's totals and its run's, said apart. Absent when the agent has no advisor, or it has spent nothing yet.
2897
+ */
2898
+ export type TurnAdvisorCost = {
2899
+ cache_read_tokens: number;
2900
+ cache_write_tokens: number;
2901
+ /**
2902
+ * What its calls cost, in billionths of a US dollar.
2903
+ */
2904
+ cost_nano_usd: number;
2905
+ input_tokens: number;
2906
+ output_tokens: number;
2907
+ /**
2908
+ * Its model has no price: the cost is a lower bound.
2909
+ */
2910
+ unpriced: boolean;
2911
+ /**
2912
+ * cost_nano_usd in dollars.
2913
+ */
2914
+ usd: number;
2915
+ };
2701
2916
  /**
2702
2917
  * One artifact a turn's agent published.
2703
2918
  */
@@ -2742,27 +2957,6 @@ export type TurnBudget = {
2742
2957
  */
2743
2958
  max_cost_usd: number;
2744
2959
  };
2745
- /**
2746
- * What the agent's advisor spent reading the turn so far: inside the turn's totals and its run's, said apart. Absent when the agent has no advisor, or it has spent nothing yet.
2747
- */
2748
- export type TurnAdvisorCost = {
2749
- cache_read_tokens: number;
2750
- cache_write_tokens: number;
2751
- /**
2752
- * What its calls cost, in billionths of a US dollar.
2753
- */
2754
- cost_nano_usd: number;
2755
- input_tokens: number;
2756
- output_tokens: number;
2757
- /**
2758
- * Its model has no price: the cost is a lower bound.
2759
- */
2760
- unpriced: boolean;
2761
- /**
2762
- * cost_nano_usd in dollars.
2763
- */
2764
- usd: number;
2765
- };
2766
2960
  /**
2767
2961
  * What one turn of a chat cost so far: its model calls and its subagents', at the engine's frozen rates.
2768
2962
  */
@@ -2980,6 +3174,38 @@ export type Use = {
2980
3174
  */
2981
3175
  response_id: string | null;
2982
3176
  };
3177
+ export type VideoCancelResult = {
3178
+ id: string;
3179
+ status: "canceled";
3180
+ };
3181
+ export type VideoJob = {
3182
+ id: string;
3183
+ model: string;
3184
+ vendor: string;
3185
+ status: "queued" | "running" | "completed" | "failed" | "canceled";
3186
+ output_url?: string;
3187
+ output_storage_path?: string;
3188
+ result?: {
3189
+ [key: string]: unknown;
3190
+ };
3191
+ error?: ResponseError;
3192
+ cost_nano_usd: number;
3193
+ created_at: string;
3194
+ completed_at?: string | null;
3195
+ };
3196
+ export type VideoRequest = {
3197
+ model?: string;
3198
+ prompt: string;
3199
+ image_url?: string;
3200
+ duration_seconds?: number;
3201
+ resolution?: "720p" | "1080p";
3202
+ aspect_ratio?: string;
3203
+ save_to_storage?: VideoSaveTarget;
3204
+ };
3205
+ export type VideoSaveTarget = {
3206
+ bucket: string;
3207
+ path: string;
3208
+ };
2983
3209
  /**
2984
3210
  * Text for the voice.
2985
3211
  */
@@ -3167,486 +3393,26 @@ export type VoiceSession = {
3167
3393
  user_id: string | null;
3168
3394
  };
3169
3395
  /**
3170
- * A file a published tree changed against the tree it replaced.
3396
+ * The tree the tool's writes left the chat's workspace at, as a write of it answered them (PUT /ai/chats/{chat_id}/workspace/files): its manifest, its place in the workspace's history, either or both. A call that answered later names it as one answered at once does (workspace_tree): the agent's next command waits for the session's machine to have it. Left out: the tool wrote nothing there.
3171
3397
  */
3172
- export type WorkspaceChange = {
3173
- /**
3174
- * added, modified (its bytes or its mode) or removed.
3175
- */
3176
- change: string;
3398
+ export type WorkspaceTree = {
3177
3399
  /**
3178
- * The file, as the tree names it (repo/output/app/App.zip).
3400
+ * The tree's manifest (a write's manifest_id).
3179
3401
  */
3180
- path: string;
3402
+ manifest_id?: string;
3181
3403
  /**
3182
- * Its size in the tree; 0 for one removed.
3404
+ * Its place in the workspace's history (a write's seq).
3183
3405
  */
3184
- size_bytes: number;
3406
+ seq?: number;
3185
3407
  };
3186
- /**
3187
- * The path both wrote.
3188
- */
3189
- export type WorkspaceConflict = {
3408
+ /** The events this module sends the project's webhooks (x-palbase-events), by type: each one's payload, the event's data. */
3409
+ export interface Events {
3190
3410
  /**
3191
- * The conflict: the version that lost is kept in the workspace's history 30 days, read by it (GET /ai/workspace-sync/conflicts/{conflict_id}).
3411
+ * ai.goal.updated: a chat's goal was set, its status changed (paused, resumed, blocked, out of budget or turns, achieved), or it was cleared.
3192
3412
  */
3193
- id: string;
3194
- lost: WorkspaceEntry;
3413
+ "ai.goal.updated": GoalEvent;
3195
3414
  /**
3196
- * The path.
3197
- */
3198
- path: string;
3199
- winner: WorkspaceEntry;
3200
- };
3201
- /**
3202
- * A writer's change of the chat's workspace that lost: the path had changed in the store since the writer saw it — the first to reach the store wins.
3203
- */
3204
- export type WorkspaceConflictEvent = {
3205
- /**
3206
- * The chat.
3207
- */
3208
- chat_id: string;
3209
- conflict: WorkspaceConflict;
3210
- /**
3211
- * The tree the store was at when it kept the change aside.
3212
- */
3213
- manifest_id: string;
3214
- /**
3215
- * The chat's labels.
3216
- */
3217
- metadata: {
3218
- [key: string]: string;
3219
- };
3220
- /**
3221
- * Its sequence.
3222
- */
3223
- seq: number;
3224
- /**
3225
- * Who wrote the version that lost: the session's machine, a machine syncing the workspace (its token's label), the project's backend.
3226
- */
3227
- writer: string;
3228
- };
3229
- /**
3230
- * What a path is in a tree: a file or a directory (null: absent).
3231
- */
3232
- export type WorkspaceEntry = {
3233
- /**
3234
- * A file's digest (sha256:<hex>).
3235
- */
3236
- digest?: string;
3237
- /**
3238
- * file or dir.
3239
- */
3240
- kind: string;
3241
- /**
3242
- * A file's mode.
3243
- */
3244
- mode?: number;
3245
- /**
3246
- * A file's size in bytes.
3247
- */
3248
- size?: number;
3249
- };
3250
- /**
3251
- * A file's bytes.
3252
- */
3253
- export type WorkspaceFileBytes = Blob;
3254
- /**
3255
- * What a write of a workspace's file left.
3256
- */
3257
- export type WorkspaceFileWritten = {
3258
- /**
3259
- * The tree the workspace is at now: read a file of it by it (GET …/workspace/files?manifest=).
3260
- */
3261
- manifest_id: string;
3262
- /**
3263
- * The file.
3264
- */
3265
- path: string;
3266
- /**
3267
- * Its place in the workspace's history.
3268
- */
3269
- seq: number;
3270
- };
3271
- /**
3272
- * A tree the chat's workspace published: its machine publishes whenever the files are quiet for a moment — mid-turn, as a build writes its product — and once more as it lets the workspace go.
3273
- */
3274
- export type WorkspacePublishedEvent = {
3275
- /**
3276
- * What changed against the tree it replaced, sorted by path: 1000 at most (changed_truncated).
3277
- */
3278
- changed: WorkspaceChange[];
3279
- /**
3280
- * How many files changed.
3281
- */
3282
- changed_count: number;
3283
- /**
3284
- * More changed than changed names.
3285
- */
3286
- changed_truncated: boolean;
3287
- /**
3288
- * The chat.
3289
- */
3290
- chat_id: string;
3291
- /**
3292
- * The tree: a file of it is read by it (GET /ai/chats/{chat_id}/workspace/files?manifest=), whatever the workspace published after it.
3293
- */
3294
- manifest_id: string;
3295
- /**
3296
- * The chat's labels.
3297
- */
3298
- metadata: {
3299
- [key: string]: string;
3300
- };
3301
- /**
3302
- * The tree it replaced; absent for none.
3303
- */
3304
- previous_manifest_id?: string;
3305
- };
3306
- /**
3307
- * A push the chat's agent made: to the chat's branch, the only one a turn's work is pushed to.
3308
- */
3309
- export type WorkspacePushedEvent = {
3310
- /**
3311
- * The branch it was pushed to.
3312
- */
3313
- branch: string;
3314
- /**
3315
- * The chat.
3316
- */
3317
- chat_id: string;
3318
- /**
3319
- * What the push brought to the branch, the oldest first: 100 at most (commits_truncated); none when the branch was there already.
3320
- */
3321
- commits: PushedCommit[];
3322
- /**
3323
- * It brought more than commits names.
3324
- */
3325
- commits_truncated: boolean;
3326
- /**
3327
- * The commit the branch is at now.
3328
- */
3329
- head_sha: string;
3330
- /**
3331
- * The chat's labels.
3332
- */
3333
- metadata: {
3334
- [key: string]: string;
3335
- };
3336
- /**
3337
- * The project's name of the repository (PUT /ai/repos/{name}).
3338
- */
3339
- repo: string;
3340
- /**
3341
- * The GitHub repository, owner/name.
3342
- */
3343
- repository: string;
3344
- /**
3345
- * The turn — or a subagent's work in it — that pushed.
3346
- */
3347
- response_id: string;
3348
- /**
3349
- * The member the turn was for; null: the server's.
3350
- */
3351
- user_id: string | null;
3352
- };
3353
- /**
3354
- * A repository put in an open chat's workspace.
3355
- */
3356
- export type WorkspaceRepoRequest = {
3357
- /**
3358
- * The branch it is checked out at and pushed to (the repository's default unless said).
3359
- */
3360
- branch?: string;
3361
- /**
3362
- * The project's name for the repository (PUT /ai/repos/{name}): one put at work's moment too.
3363
- */
3364
- repo: string;
3365
- };
3366
- /**
3367
- * A workspace token, not said.
3368
- */
3369
- export type WorkspaceToken = {
3370
- /**
3371
- * read or write.
3372
- */
3373
- access: string;
3374
- /**
3375
- * When it expires.
3376
- */
3377
- expires_at: string;
3378
- /**
3379
- * Its id: revoke it by it.
3380
- */
3381
- id: string;
3382
- /**
3383
- * What it is for.
3384
- */
3385
- label?: string;
3386
- /**
3387
- * The workspace's id in the store.
3388
- */
3389
- workspace_id: string;
3390
- };
3391
- /**
3392
- * A chat's workspace's tokens.
3393
- */
3394
- export type WorkspaceTokenList = {
3395
- /**
3396
- * The tokens, none said.
3397
- */
3398
- tokens: WorkspaceToken[];
3399
- };
3400
- /**
3401
- * A workspace token as it is minted: said once.
3402
- */
3403
- export type WorkspaceTokenMinted = {
3404
- /**
3405
- * read or write.
3406
- */
3407
- access: string;
3408
- /**
3409
- * When it expires.
3410
- */
3411
- expires_at: string;
3412
- /**
3413
- * Its id: revoke it by it.
3414
- */
3415
- id: string;
3416
- /**
3417
- * What it is for.
3418
- */
3419
- label?: string;
3420
- /**
3421
- * Where the workspace's token routes are, at the project's own address: `palbase-agent workspace sync --url <sync_url> <dir>`.
3422
- */
3423
- sync_url: string;
3424
- /**
3425
- * The token, said once: given `palbase-agent workspace sync` in its environment (PALBASE_WORKSPACE_TOKEN) or on its standard input (--token-file -), never on its command line.
3426
- */
3427
- token: string;
3428
- /**
3429
- * The workspace's id in the store.
3430
- */
3431
- workspace_id: string;
3432
- };
3433
- /**
3434
- * A workspace token to mint.
3435
- */
3436
- export type WorkspaceTokenRequest = {
3437
- /**
3438
- * read: the workspace followed; write: followed and written, both ways.
3439
- */
3440
- access: "read" | "write";
3441
- /**
3442
- * What it is for — the machine's name, say: a conflict names its writer by it. 128 bytes of UTF-8 at most (maxLength counts characters, so a label of fewer may still be too long), with no control character, no format character (a bidi override or isolate, a zero-width space or joiner, a byte order mark) and no line or paragraph separator — a label is shown as it was written.
3443
- */
3444
- label?: string;
3445
- /**
3446
- * How long it lives: 1 to 604800 (none: an hour) — a member's 1 to 3600; no longer than an environment's token it is minted with.
3447
- */
3448
- ttl_seconds?: number;
3449
- };
3450
- /**
3451
- * The tree the tool's writes left the chat's workspace at, as a write of it answered them (PUT /ai/chats/{chat_id}/workspace/files): its manifest, its place in the workspace's history, either or both. A call that answered later names it as one answered at once does (workspace_tree): the agent's next command waits for the session's machine to have it. Left out: the tool wrote nothing there.
3452
- */
3453
- export type WorkspaceTree = {
3454
- /**
3455
- * The tree's manifest (a write's manifest_id).
3456
- */
3457
- manifest_id?: string;
3458
- /**
3459
- * Its place in the workspace's history (a write's seq).
3460
- */
3461
- seq?: number;
3462
- };
3463
- /**
3464
- * A host the secret may go to: the owner's Allow.
3465
- */
3466
- export type EnvHostRequest = {
3467
- /**
3468
- * An exact DNS name or *. and one, as hosts takes them.
3469
- */
3470
- host: string;
3471
- };
3472
- /**
3473
- * A sealed secret an agent sent to a host it is not allowed for: the placeholder went as it is, and its owner is asked.
3474
- */
3475
- export type SecretHostRequest = {
3476
- /**
3477
- * The agent whose own secret it is (its definition's env); null: one of the project's variables.
3478
- */
3479
- agent: string | null;
3480
- /**
3481
- * How many times it was sent there.
3482
- */
3483
- asks: number;
3484
- /**
3485
- * When it was allowed or dismissed; null: not yet.
3486
- */
3487
- decided_at: string | null;
3488
- /**
3489
- * The registrable domain the host is under — its public suffix and one label more (evil.io for api.stripe.com.evil.io); under palbase.studio or palbase.app, the name itself. What an Allow hands over: whoever holds the domain runs every name under it.
3490
- */
3491
- domain: string;
3492
- /**
3493
- * When it was first sent there.
3494
- */
3495
- first_asked_at: string;
3496
- /**
3497
- * The host it was sent to. Nobody has checked who runs it.
3498
- */
3499
- host: string;
3500
- /**
3501
- * The secret's name.
3502
- */
3503
- key: string;
3504
- /**
3505
- * When it was last sent there.
3506
- */
3507
- last_asked_at: string;
3508
- /**
3509
- * Whose definition the agent's is: kept (an agent the project keeps), chat (a chat's own definition), backend (its backend's, at each turn). An ask and an Allow are the agent's of that origin alone: a chat's own definition under a kept agent's name is another's. Null: one of the project's variables.
3510
- */
3511
- origin: string | null;
3512
- /**
3513
- * The ask (shr_…).
3514
- */
3515
- request_id: string;
3516
- /**
3517
- * asked, allowed or dismissed.
3518
- */
3519
- status: string;
3520
- };
3521
- /**
3522
- * The asks of one status, newest first (500 at most: all a project keeps of it).
3523
- */
3524
- export type SecretHostRequestList = {
3525
- /**
3526
- * The asks.
3527
- */
3528
- requests: SecretHostRequest[];
3529
- };
3530
- /**
3531
- * ai.secret_host_requested: an agent sent a sealed secret to a host it is not allowed for.
3532
- */
3533
- export type SecretHostRequested = {
3534
- /**
3535
- * The agent whose own secret it is; null: one of the project's variables.
3536
- */
3537
- agent: string | null;
3538
- /**
3539
- * When it was sent there.
3540
- */
3541
- asked_at: string;
3542
- /**
3543
- * The host it was sent to. Nobody has checked who runs it.
3544
- */
3545
- host: string;
3546
- /**
3547
- * The secret's name.
3548
- */
3549
- key: string;
3550
- /**
3551
- * The project whose secret it is: Palbase's own copy names the customer's.
3552
- */
3553
- project_id: string;
3554
- /**
3555
- * The ask: allow or dismiss it (GET /ai/env/host-requests).
3556
- */
3557
- request_id: string;
3558
- };
3559
- /**
3560
- * A variable's value alone ("" read back, and written to keep the value it has).
3561
- */
3562
- export type AgentEnvValue = string;
3563
- /**
3564
- * A variable's value and what the secret says of itself. A value kept from the definition written over ("") keeps what it said there unless a person changes it (403 person_required); a sealed value given is held to the value rules of PUT /ai/env/{key}, and a kept value made sealed (open or no secret before) is given with it (400 value_required). A write that gives any value is a change: the draft's revision moves.
3565
- */
3566
- export type AgentEnvEntry = {
3567
- /**
3568
- * Said with open: true where the secret becomes open, and with secret: false where a secret becomes none (it was not so in the definition written over): you read that the agent reads it as it is.
3569
- */
3570
- acknowledge_open?: boolean;
3571
- /**
3572
- * The hosts a request may carry it to, as PUT /ai/env/{key} takes them.
3573
- */
3574
- hosts?: string[];
3575
- /**
3576
- * Where in such a request it may be put: header (the default), query, body.
3577
- */
3578
- inject?: ("header" | "query" | "body")[];
3579
- /**
3580
- * The agent reads it as it is: no hosts, no inject.
3581
- */
3582
- open?: boolean;
3583
- /**
3584
- * Its value ("": keep the value it has).
3585
- */
3586
- value?: string;
3587
- /**
3588
- * Said with a sealed value a person may have chosen (fewer than 16 characters, or one kind of character only).
3589
- */
3590
- acknowledge_guessable?: boolean;
3591
- /**
3592
- * Whether it is a secret (the default); false: a plain variable the agent reads as it is, with no hosts and no class.
3593
- */
3594
- secret?: boolean;
3595
- };
3596
- /**
3597
- * A host an agent's own secret may go to beside its definition's: an owner's Allow.
3598
- */
3599
- export type SecretHostAllowance = {
3600
- /**
3601
- * The agent whose own secret it is.
3602
- */
3603
- agent: string;
3604
- /**
3605
- * The allowance (sha_…).
3606
- */
3607
- allowance_id: string;
3608
- /**
3609
- * When it was allowed.
3610
- */
3611
- allowed_at: string;
3612
- /**
3613
- * The person who allowed it (their user id).
3614
- */
3615
- allowed_by: string;
3616
- /**
3617
- * The registrable domain the host is under — its public suffix and one label more (evil.io for api.stripe.com.evil.io); under palbase.studio or palbase.app, the name itself. What an Allow hands over: whoever holds the domain runs every name under it.
3618
- */
3619
- domain: string;
3620
- /**
3621
- * The host.
3622
- */
3623
- host: string;
3624
- /**
3625
- * The secret's name.
3626
- */
3627
- key: string;
3628
- /**
3629
- * Whose definition the agent's is: kept (an agent the project keeps), chat (a chat's own definition), backend (its backend's, at each turn). An ask and an Allow are the agent's of that origin alone: a chat's own definition under a kept agent's name is another's.
3630
- */
3631
- origin: "kept" | "chat" | "backend";
3632
- };
3633
- /**
3634
- * The project's allowances, newest first.
3635
- */
3636
- export type SecretHostAllowanceList = {
3637
- /**
3638
- * The allowances.
3639
- */
3640
- allowances: SecretHostAllowance[];
3641
- };
3642
- /** The events this module sends the project's webhooks (x-palbase-events), by type: each one's payload, the event's data. */
3643
- export interface Events {
3644
- /**
3645
- * ai.goal.updated: a chat's goal was set, its status changed (paused, resumed, blocked, out of budget or turns, achieved), or it was cleared.
3646
- */
3647
- "ai.goal.updated": GoalEvent;
3648
- /**
3649
- * ai.response.completed: a response started with background: true completed — read its answer by its id — or a chat's turn completed.
3415
+ * ai.response.completed: a response started with background: true completed — read its answer by its id — or a chat's turn completed.
3650
3416
  */
3651
3417
  "ai.response.completed": ResponseEvent;
3652
3418
  /**
@@ -3668,19 +3434,7 @@ export interface Events {
3668
3434
  /**
3669
3435
  * ai.voice.started: a chat's voice began.
3670
3436
  */
3671
- "ai.voice.started": VoiceEvent;
3672
- /**
3673
- * ai.workspace.conflict: a writer's change of a chat's workspace lost — the path had changed since the writer saw it; the version that lost is kept 30 days in the workspace's history.
3674
- */
3675
- "ai.workspace.conflict": WorkspaceConflictEvent;
3676
- /**
3677
- * ai.workspace.published: a chat's workspace published a tree — what its files are now, with the files it changed; read one of them by the tree (GET /ai/chats/{chat_id}/workspace/files?manifest=).
3678
- */
3679
- "ai.workspace.published": WorkspacePublishedEvent;
3680
- /**
3681
- * ai.workspace.pushed: a chat's agent pushed its work to the chat's branch, with the commits it brought.
3682
- */
3683
- "ai.workspace.pushed": WorkspacePushedEvent;
3437
+ "ai.voice.started": VoiceEvent;
3684
3438
  /**
3685
3439
  * ai.secret_host_requested: an agent sent a sealed secret to a host it is not allowed for — the placeholder went as it is, and the owners are asked to allow or dismiss it. Told to the project and to Palbase's own (whose Studio emails the organization's owners), at most once a day a secret and host, and at most 10 a project a day.
3686
3440
  */
@@ -3781,6 +3535,24 @@ export declare function client(t: Transport): {
3781
3535
  }; /** Stops the call: the request in flight, a wait before a retry, a proof-of-work being solved. */
3782
3536
  signal?: AbortSignal;
3783
3537
  }): Promise<Reply<200, AgentVersionList>>;
3538
+ /**
3539
+ * Synthesize speech from text
3540
+ *
3541
+ * Streams synthesized audio from OpenAI or ElevenLabs.
3542
+ */
3543
+ createAudioSpeech(input: {
3544
+ body: SpeechRequest; /** Stops the call: the request in flight, a wait before a retry, a proof-of-work being solved. */
3545
+ signal?: AbortSignal;
3546
+ }): Promise<Reply<200, Response>>;
3547
+ /**
3548
+ * Transcribe audio to text
3549
+ *
3550
+ * Transcribes uploaded audio or a stored audio file via Deepgram or OpenAI with optional timestamps and diarization.
3551
+ */
3552
+ createAudioTranscription(input: {
3553
+ body: TranscriptionRequest; /** Stops the call: the request in flight, a wait before a retry, a proof-of-work being solved. */
3554
+ signal?: AbortSignal;
3555
+ }): Promise<Reply<200, TranscriptionResponse>>;
3784
3556
  /**
3785
3557
  * The chats
3786
3558
  *
@@ -3791,7 +3563,8 @@ export declare function client(t: Transport): {
3791
3563
  member?: string; /** How many (1 to 100, default 100). */
3792
3564
  limit?: number; /** next_cursor of the page before. */
3793
3565
  cursor?: string; /** A label the chats have, key:value (its metadata); given again, every label named: metadata=project_id:p_123. */
3794
- metadata?: string[];
3566
+ metadata?: string[]; /** Filter chats by live execution status (active returns only chats with a running or waiting turn). */
3567
+ status?: "active" | "all";
3795
3568
  }; /** Stops the call: the request in flight, a wait before a retry, a proof-of-work being solved. */
3796
3569
  signal?: AbortSignal;
3797
3570
  }): Promise<Reply<200, ChatList>>;
@@ -3839,6 +3612,29 @@ export declare function client(t: Transport): {
3839
3612
  body: DecisionRequest; /** Stops the call: the request in flight, a wait before a retry, a proof-of-work being solved. */
3840
3613
  signal?: AbortSignal;
3841
3614
  }): Promise<Reply<200, Decision>>;
3615
+ /**
3616
+ * Read a chat session's live execution target and machine state
3617
+ *
3618
+ * Returns the chat's active execution target, target_generation, workspace_seq, target machine online/offline state, probed ACP harnesses, and auto_failover status.
3619
+ */
3620
+ getChatExecution(input: {
3621
+ path: {
3622
+ chat_id: string;
3623
+ }; /** Stops the call: the request in flight, a wait before a retry, a proof-of-work being solved. */
3624
+ signal?: AbortSignal;
3625
+ }): Promise<Reply<200, ChatExecution>>;
3626
+ /**
3627
+ * Update a chat session's auto-failover policy or default model/effort
3628
+ *
3629
+ * Server-only update for auto_failover policy or default model/effort without incrementing target_generation or triggering a teleport.
3630
+ */
3631
+ patchChatExecution(input: {
3632
+ path: {
3633
+ chat_id: string;
3634
+ };
3635
+ body: PatchExecutionRequest; /** Stops the call: the request in flight, a wait before a retry, a proof-of-work being solved. */
3636
+ signal?: AbortSignal;
3637
+ }): Promise<Reply<200, ChatExecution>>;
3842
3638
  /**
3843
3639
  * Fork a chat before a message
3844
3640
  *
@@ -3903,6 +3699,18 @@ export declare function client(t: Transport): {
3903
3699
  body: GoalPatch; /** Stops the call: the request in flight, a wait before a retry, a proof-of-work being solved. */
3904
3700
  signal?: AbortSignal;
3905
3701
  }): Promise<Reply<200, Goal>>;
3702
+ /**
3703
+ * Teleport a chat session to a new execution target
3704
+ *
3705
+ * Atomically moves the chat session to a new compute/executor target (serverless, cloud, pool, or machine; palbase or acp), increments target_generation to fence superseded runners, and broadcasts session.handed_off.
3706
+ */
3707
+ handoffChat(input: {
3708
+ path: {
3709
+ chat_id: string;
3710
+ };
3711
+ body: HandoffRequest; /** Stops the call: the request in flight, a wait before a retry, a proof-of-work being solved. */
3712
+ signal?: AbortSignal;
3713
+ }): Promise<Reply<200, HandoffResponse>>;
3906
3714
  /**
3907
3715
  * Put a user in a chat
3908
3716
  *
@@ -4180,168 +3988,214 @@ export declare function client(t: Transport): {
4180
3988
  signal?: AbortSignal;
4181
3989
  }): Promise<Reply<202, VoiceSession>>;
4182
3990
  /**
4183
- * A file of the chat's workspace
3991
+ * Turn texts into vectors
3992
+ *
3993
+ * One vector per text, in the order of the input. Up to 1,024 texts per request — a longer list is several requests, and the SDK cuts it; the platform splits a request over the provider's own limits.
3994
+ */
3995
+ createEmbeddings(input: {
3996
+ body: EmbeddingsRequest; /** Stops the call: the request in flight, a wait before a retry, a proof-of-work being solved. */
3997
+ signal?: AbortSignal;
3998
+ }): Promise<Reply<200, Embeddings>>;
3999
+ /**
4000
+ * The project's tool endpoints
4001
+ *
4002
+ * Its HTTPS tools and MCP servers, by name (their secrets are not said again). To an environment's token each url is shown only where it is — its scheme, its host and its path's first segment — and the rest of its path, its query and its fragment each as ***: an MCP server's or a tool's key may be anywhere after the host, and an agent is not shown again a secret it did not just set (the answer to its own PUT shows it so too). A person and the project's key see each url whole.
4003
+ */
4004
+ listEndpoints(input?: {
4005
+ signal?: AbortSignal;
4006
+ }): Promise<Reply<200, EndpointList>>;
4007
+ /**
4008
+ * Put a tool endpoint
4184
4009
  *
4185
- * A file of the chat's workspace, its bytes (an attachment, never a page): from the tree the workspace is at now, or from the one an ai.workspace.published event named (manifest) — a build's product as that publish left it. Read by the chat's members and the project's server, as they read the chat. Served up to 64 MiB (413 file_too_large past it: publish a larger one as the turn's artifact); its digest is Content-Digest. Each of the module's servers reads 4 of a project's files at once (429 too_many_reads, Retry-After), and a file is written for no longer than its bytes take at 256 KiB/s and a minute more. A chat that works in no workspace yet, a tree of another workspace, a path its tree does not name: 404 file_not_found.
4010
+ * A tool at an HTTPS address of the project's — called with a signed POST {tool, call_id, input, context: {chat_id, agent, user, metadata, turn_id, run_id, subagent, workspace} — the turn, the run that called: the agent's own, or a subagent's at work (subagent names which, null for the agent), and, in a chat that works in a workspace, the workspace as the session last wrote it, flushed before the call: workspace {chat_id, manifest_id, seq} (read its files at that tree, GET /ai/chats/{chat_id}/workspace/files?manifest=)} — and answered {output, is_error, workspace_tree?} or plain text: a tool that wrote the workspace (PUT /ai/chats/{chat_id}/workspace/files) answers workspace_tree {manifest_id, seq} — the tree its writes left, either or both — and the agent's next command sees it — or an MCP server, whose tools an agent may use: when the project says it is its own (workspace: true), told the same tree in its tools/call's _meta (palbase/workspace), answering it in its result's _meta (palbase/workspace_tree); a third party's server is told nothing of a chat or its workspace. The answer says an https tool's signing secret, once.
4186
4011
  */
4187
- getChatWorkspaceFile(input: {
4012
+ putEndpoint(input: {
4188
4013
  path: {
4189
- chat_id: string;
4014
+ name: string;
4190
4015
  };
4191
- query: {
4192
- path: string; /** The tree to read it from: an ai.workspace.published event's manifest_id (none: the tree the workspace is at now). */
4193
- manifest?: string;
4194
- }; /** Stops the call: the request in flight, a wait before a retry, a proof-of-work being solved. */
4016
+ body: EndpointRequest; /** Stops the call: the request in flight, a wait before a retry, a proof-of-work being solved. */
4195
4017
  signal?: AbortSignal;
4196
- }): Promise<Reply<200, Response>>;
4018
+ }): Promise<Reply<200, Endpoint>>;
4197
4019
  /**
4198
- * Write a file of the chat's workspace
4020
+ * Forget a tool endpoint
4199
4021
  *
4200
- * The customer's backend writes one file of the chat's workspace, its bytes the body (64 MiB at most: 413 file_too_large; each of the module's servers writes 2 of a project's at once, more are told to ask again: 429 too_many_reads): published over whatever the workspace's head holds — the write is deliberate, no conflict is made of it — and synced from there to every machine that holds the workspace, the session's own before the agent's next command. A body that says its length (Content-Length) is forwarded as it arrives; one sent in chunks is read whole first, to the same 64 MiB. What it published is told as ai.workspace.published. A chat whose first turn has not opened its workspace has it opened now. The project's server's, and a member's who may write the chat; a chat that works in no workspace: 409 no_workspace.
4022
+ * An agent naming it can no longer start a turn until it is put again.
4201
4023
  */
4202
- putChatWorkspaceFile(input: {
4024
+ deleteEndpoint(input: {
4203
4025
  path: {
4204
- chat_id: string;
4205
- };
4206
- query: {
4207
- path: string;
4208
- };
4209
- body: BodyInit;
4210
- contentType?: string; /** Stops the call: the request in flight, a wait before a retry, a proof-of-work being solved. */
4026
+ name: string;
4027
+ }; /** Stops the call: the request in flight, a wait before a retry, a proof-of-work being solved. */
4028
+ signal?: AbortSignal;
4029
+ }): Promise<Reply<204, undefined>>;
4030
+ /**
4031
+ * The project's variables
4032
+ *
4033
+ * Their names, whether each is a secret, the hosts a secret may go to, where it may be put, whether it is open, and when each was set: never a value.
4034
+ */
4035
+ listEnv(input?: {
4036
+ signal?: AbortSignal;
4037
+ }): Promise<Reply<200, EnvList>>;
4038
+ /**
4039
+ * The agents' secrets' allowances
4040
+ *
4041
+ * The hosts the project's agents' own secrets are allowed beside their definitions': each an owner's Allow of an ask, newest first (500 at most), with whose agent (origin) and the host's registrable domain. A new value keeps them. One goes with its key: an agent the project keeps, once neither its draft nor its version published has the key (deleted, every one); a chat's own definition, with the last chat whose definition has it; a backend's agent, after 30 days with no turn.
4042
+ */
4043
+ listEnvAllowances(input?: {
4211
4044
  signal?: AbortSignal;
4212
- }): Promise<Reply<200, WorkspaceFileWritten>>;
4045
+ }): Promise<Reply<200, SecretHostAllowanceList>>;
4213
4046
  /**
4214
- * Remove a file of the chat's workspace
4047
+ * Take an allowance away
4215
4048
  *
4216
- * The customer's backend removes one file of the chat's workspace, as a write is (PUT): synced to every machine that holds it. The project's server's, and a member's who may write the chat.
4049
+ * The host taken away from the agent's secret: an ask for it is asked again. A person's alone: an owner or an admin of the organization signed in, never a key or a token, the secret key included (403 person_required; an environment's token, token_out_of_scope).
4217
4050
  */
4218
- deleteChatWorkspaceFile(input: {
4051
+ deleteEnvAllowance(input: {
4219
4052
  path: {
4220
- chat_id: string;
4221
- };
4222
- query: {
4223
- path: string;
4053
+ allowance_id: string;
4054
+ }; /** Stops the call: the request in flight, a wait before a retry, a proof-of-work being solved. */
4055
+ signal?: AbortSignal;
4056
+ }): Promise<Reply<204, undefined>>;
4057
+ /**
4058
+ * The hosts the project's secrets asked for
4059
+ *
4060
+ * The hosts the project's sealed secrets were sent to that they are not allowed for: each secret and host once, with how many times, newest first — its host and the registrable domain it is under (an Allow hands the secret to whoever holds that domain), and whose secret it is (a project variable, or an agent's own of an origin). The project's owners are emailed a link at most once a day for each, at most 3 a day for one secret and 10 a project a day, counted where no ask lowers the count. A project keeps 500 asked, 50 of them a secret and 100 an agent's own secrets: an ask past one forgets an asked one alone — the secret's own oldest, else the oldest of the secret that holds the most, the one asked last among equals — never a dismissed or an allowed one; it keeps 500 dismissed and 500 allowed, a decision past them forgetting the oldest of its kind. A variable removed takes its asks with it, and a key that leaves an agent its own.
4061
+ */
4062
+ listEnvHostRequests(input?: {
4063
+ query?: {
4064
+ status?: "asked" | "allowed" | "dismissed";
4224
4065
  }; /** Stops the call: the request in flight, a wait before a retry, a proof-of-work being solved. */
4225
4066
  signal?: AbortSignal;
4226
- }): Promise<Reply<200, WorkspaceFileWritten>>;
4067
+ }): Promise<Reply<200, SecretHostRequestList>>;
4227
4068
  /**
4228
- * Put a repository in the chat's workspace
4069
+ * Allow an ask
4229
4070
  *
4230
- * Puts one more of the project's repositories in the chat's workspace, at a branch, under its name beside the others: the engine clones it and merges it into the workspace's tree before the chat's next turn takes a machine; a chat whose first turn has not opened its workspace has it from that turn. Every chat working in the workspace (a fork works in its chat's) has it. Put again, the same. The project's server's alone; a chat that works in no workspace is refused (409 no_workspace).
4071
+ * The owner's Allow, for any ask: its host is added to the variable's hosts (one of the project's), or to the agent's allowances (an agent's own secret: GET /ai/env/allowances), and the asks it now allows are marked allowed. A person's alone: an owner or an admin of the organization signed in, never a key or a token, the secret key included (403 person_required; an environment's token, token_out_of_scope).
4231
4072
  */
4232
- addChatWorkspaceRepo(input: {
4073
+ allowEnvHostRequest(input: {
4233
4074
  path: {
4234
- chat_id: string;
4235
- };
4236
- body: WorkspaceRepoRequest; /** Stops the call: the request in flight, a wait before a retry, a proof-of-work being solved. */
4075
+ request_id: string;
4076
+ }; /** Stops the call: the request in flight, a wait before a retry, a proof-of-work being solved. */
4237
4077
  signal?: AbortSignal;
4238
- }): Promise<Reply<200, Chat>>;
4078
+ }): Promise<Reply<200, SecretHostRequest>>;
4239
4079
  /**
4240
- * The workspace's tokens
4080
+ * Dismiss an ask
4241
4081
  *
4242
- * Its tokens — access, label, when each expires — none of them said again: the project's server's answer is every token of the workspace, a member's the ones they minted.
4082
+ * The owner's Dismiss: the ask is never told again (it is still counted). One allowed is not undone here: its host is the secret's (PUT /ai/env/{key} with hosts, or DELETE /ai/env/allowances/{allowance_id}, takes it away) — 409 already_allowed. A person's alone: an owner or an admin of the organization signed in, never a key or a token, the secret key included (403 person_required; an environment's token, token_out_of_scope).
4243
4083
  */
4244
- listChatWorkspaceTokens(input: {
4084
+ dismissEnvHostRequest(input: {
4245
4085
  path: {
4246
- chat_id: string;
4086
+ request_id: string;
4247
4087
  }; /** Stops the call: the request in flight, a wait before a retry, a proof-of-work being solved. */
4248
4088
  signal?: AbortSignal;
4249
- }): Promise<Reply<200, WorkspaceTokenList>>;
4089
+ }): Promise<Reply<200, SecretHostRequest>>;
4250
4090
  /**
4251
- * Mint a workspace token
4091
+ * Set a variable
4252
4092
  *
4253
- * A token of the chat's workspace for a machine of the customer's to sync it with — `PALBASE_WORKSPACE_TOKEN=<token> palbase-agent workspace sync --url <sync_url> <dir>` (or the token on standard input: `--token-file -`; never on the command line): live and always both ways (write), or followed (read) — said once, here. It lives ttl_seconds (an hour when none, 7 days at most) — no longer than an environment's token it is minted with — and answers at the project's own address alone (sync_url, the workspace's token routes). While one lives the chat's workspace events are told (ai.workspace.published, ai.workspace.conflict). A chat whose first turn has not opened its workspace has it opened now. The project's server's, and a member's who may write the chat: a member's token lives an hour at most, is theirs alone to list and revoke, and answers only while they are in the chat and the project lets its users talk to its agents (settings.clients) — taking them out, or turning clients off, revokes it. A chat that works in no workspace: 409 no_workspace.
4093
+ * One of the project's variables or secrets, set or set anew: every command of every session of its agents begun from now has it — on the platform's Linux machines and on the project's own pools, Linux and Mac — beside the agent's own (its definition's env), masked wherever a transcript would show it. The value is sealed where the sessions run and never answered, nor logged; a refusal never repeats it. A secret also says where it may go (hosts), where in a request it may be put (inject) and whether the agent reads it as it is (open); a field left out keeps what the variable has. A write that carries the value says them as its caller's role allows. A variable set before may leave out its value to change them alone (404 for one never set): a person's change only — an owner or an admin of the organization signed in, never a key or a token, the secret key included (403 person_required). open: true, and a secret made no secret, need acknowledge_open: true (400 open_not_acknowledged); a variable that stays no secret is refused hosts, inject and open (409 not_a_secret). A sealed value is at least 8 bytes with no line break or NUL (400 secret_unusable), and one a person may have chosen (fewer than 16 characters, or one kind of character only) needs acknowledge_guessable: true (400 secret_guessable) — the request's own value is judged, never one kept: an open secret or a variable that is no secret made sealed takes its value in the same request (400 value_required). A sealed secret is a placeholder in a session: the proxy beside the machine puts the value in only on a request to one of its hosts, and a machine with no proxy beside it (a Mac, or a Linux machine whose agent does not run it) gets no sealed secret.
4254
4094
  */
4255
- createChatWorkspaceToken(input: {
4095
+ putEnv(input: {
4256
4096
  path: {
4257
- chat_id: string;
4097
+ key: string;
4258
4098
  };
4259
- body: WorkspaceTokenRequest; /** Stops the call: the request in flight, a wait before a retry, a proof-of-work being solved. */
4099
+ body: EnvRequest; /** Stops the call: the request in flight, a wait before a retry, a proof-of-work being solved. */
4260
4100
  signal?: AbortSignal;
4261
- }): Promise<Reply<201, WorkspaceTokenMinted>>;
4101
+ }): Promise<Reply<200, EnvVar>>;
4262
4102
  /**
4263
- * Revoke a workspace token
4103
+ * Remove a variable
4264
4104
  *
4265
- * Revoked at once: every token route refuses it from then, an open event stream with it ends. The project's server revokes any token of the workspace; a member, one they minted (another's is not found).
4105
+ * Sessions begun from now no longer have it.
4266
4106
  */
4267
- revokeChatWorkspaceToken(input: {
4107
+ deleteEnv(input: {
4268
4108
  path: {
4269
- chat_id: string; /** The token's id. */
4270
- token: string;
4109
+ key: string;
4271
4110
  }; /** Stops the call: the request in flight, a wait before a retry, a proof-of-work being solved. */
4272
4111
  signal?: AbortSignal;
4273
4112
  }): Promise<Reply<204, undefined>>;
4274
4113
  /**
4275
- * Turn texts into vectors
4114
+ * Allow a secret a host
4276
4115
  *
4277
- * One vector per text, in the order of the input. Up to 1,024 texts per request — a longer list is several requests, and the SDK cuts it; the platform splits a request over the provider's own limits.
4116
+ * The owner's Allow, for one of the project's variables: the host is added to a sealed secret's hosts (32 at most), and the asks it now allows are marked allowed. A sealed secret sent to it from the proxy's next renewal carries the value. Allow only a host you know the secret belongs to: an agent can be led to send a secret anywhere. A person's alone: an owner or an admin of the organization signed in, never a key or a token, the secret key included (403 person_required; an environment's token, token_out_of_scope).
4278
4117
  */
4279
- createEmbeddings(input: {
4280
- body: EmbeddingsRequest; /** Stops the call: the request in flight, a wait before a retry, a proof-of-work being solved. */
4118
+ allowEnvHost(input: {
4119
+ path: {
4120
+ key: string;
4121
+ };
4122
+ body: EnvHostRequest; /** Stops the call: the request in flight, a wait before a retry, a proof-of-work being solved. */
4281
4123
  signal?: AbortSignal;
4282
- }): Promise<Reply<200, Embeddings>>;
4124
+ }): Promise<Reply<200, EnvVar>>;
4283
4125
  /**
4284
- * The project's tool endpoints
4126
+ * List runtime environments
4285
4127
  *
4286
- * Its HTTPS tools and MCP servers, by name (their secrets are not said again). To an environment's token each url is shown only where it is — its scheme, its host and its path's first segment — and the rest of its path, its query and its fragment each as ***: an MCP server's or a tool's key may be anywhere after the host, and an agent is not shown again a secret it did not just set (the answer to its own PUT shows it so too). A person and the project's key see each url whole.
4128
+ * Lists the project's configured runtime environments ordered by name.
4287
4129
  */
4288
- listEndpoints(input?: {
4130
+ listEnvironments(input?: {
4289
4131
  signal?: AbortSignal;
4290
- }): Promise<Reply<200, EndpointList>>;
4132
+ }): Promise<Reply<200, EnvironmentList>>;
4291
4133
  /**
4292
- * Put a tool endpoint
4134
+ * Create a runtime environment
4293
4135
  *
4294
- * A tool at an HTTPS address of the project's — called with a signed POST {tool, call_id, input, context: {chat_id, agent, user, metadata, turn_id, run_id, subagent, workspace} — the turn, the run that called: the agent's own, or a subagent's at work (subagent names which, null for the agent), and, in a chat that works in a workspace, the workspace as the session last wrote it, flushed before the call: workspace {chat_id, manifest_id, seq} (read its files at that tree, GET /ai/chats/{chat_id}/workspace/files?manifest=)} — and answered {output, is_error, workspace_tree?} or plain text: a tool that wrote the workspace (PUT /ai/chats/{chat_id}/workspace/files) answers workspace_tree {manifest_id, seq} — the tree its writes left, either or both — and the agent's next command sees it — or an MCP server, whose tools an agent may use: when the project says it is its own (workspace: true), told the same tree in its tools/call's _meta (palbase/workspace), answering it in its result's _meta (palbase/workspace_tree); a third party's server is told nothing of a chat or its workspace. The answer says an https tool's signing secret, once.
4136
+ * Creates a new runtime environment (ephemeral or always_on) for the project.
4295
4137
  */
4296
- putEndpoint(input: {
4138
+ createEnvironment(input: {
4139
+ body: EnvironmentRequest; /** Stops the call: the request in flight, a wait before a retry, a proof-of-work being solved. */
4140
+ signal?: AbortSignal;
4141
+ }): Promise<Reply<201, Environment>>;
4142
+ /**
4143
+ * Get a runtime environment
4144
+ *
4145
+ * Returns a single runtime environment by name.
4146
+ */
4147
+ getEnvironment(input: {
4297
4148
  path: {
4298
4149
  name: string;
4299
- };
4300
- body: EndpointRequest; /** Stops the call: the request in flight, a wait before a retry, a proof-of-work being solved. */
4150
+ }; /** Stops the call: the request in flight, a wait before a retry, a proof-of-work being solved. */
4301
4151
  signal?: AbortSignal;
4302
- }): Promise<Reply<200, Endpoint>>;
4152
+ }): Promise<Reply<200, Environment>>;
4303
4153
  /**
4304
- * Forget a tool endpoint
4154
+ * Create or update a runtime environment
4305
4155
  *
4306
- * An agent naming it can no longer start a turn until it is put again.
4156
+ * Upserts a runtime environment by name.
4307
4157
  */
4308
- deleteEndpoint(input: {
4158
+ putEnvironment(input: {
4309
4159
  path: {
4310
4160
  name: string;
4311
- }; /** Stops the call: the request in flight, a wait before a retry, a proof-of-work being solved. */
4161
+ };
4162
+ body: EnvironmentRequest; /** Stops the call: the request in flight, a wait before a retry, a proof-of-work being solved. */
4312
4163
  signal?: AbortSignal;
4313
- }): Promise<Reply<204, undefined>>;
4164
+ }): Promise<Reply<200, Environment>>;
4314
4165
  /**
4315
- * The project's variables
4166
+ * Delete a runtime environment
4316
4167
  *
4317
- * Their names, whether each is a secret, the hosts a secret may go to, where it may be put, whether it is open, and when each was set: never a value.
4168
+ * Deletes a runtime environment and its build records.
4318
4169
  */
4319
- listEnv(input?: {
4170
+ deleteEnvironment(input: {
4171
+ path: {
4172
+ name: string;
4173
+ }; /** Stops the call: the request in flight, a wait before a retry, a proof-of-work being solved. */
4320
4174
  signal?: AbortSignal;
4321
- }): Promise<Reply<200, EnvList>>;
4175
+ }): Promise<Reply<204, undefined>>;
4322
4176
  /**
4323
- * Set a variable
4177
+ * Queue an environment build
4324
4178
  *
4325
- * One of the project's variables or secrets, set or set anew: every command of every session of its agents begun from now has it — on the platform's Linux machines and on the project's own pools, Linux and Mac — beside the agent's own (its definition's env), masked wherever a transcript would show it. The value is sealed where the sessions run and never answered, nor logged; a refusal never repeats it. A secret also says where it may go (hosts), where in a request it may be put (inject) and whether the agent reads it as it is (open); a field left out keeps what the variable has. A write that carries the value says them as its caller's role allows. A variable set before may leave out its value to change them alone (404 for one never set): a person's change only — an owner or an admin of the organization signed in, never a key or a token, the secret key included (403 person_required). open: true, and a secret made no secret, need acknowledge_open: true (400 open_not_acknowledged); a variable that stays no secret is refused hosts, inject and open (409 not_a_secret). A sealed value is at least 8 bytes with no line break or NUL (400 secret_unusable), and one a person may have chosen (fewer than 16 characters, or one kind of character only) needs acknowledge_guessable: true (400 secret_guessable) — the request's own value is judged, never one kept: an open secret or a variable that is no secret made sealed takes its value in the same request (400 value_required). A sealed secret is a placeholder in a session: the proxy beside the machine puts the value in only on a request to one of its hosts, and a machine with no proxy beside it (a Mac, or a Linux machine whose agent does not run it) gets no sealed secret.
4179
+ * Queues a new immutable pre-bake build for the named environment.
4326
4180
  */
4327
- putEnv(input: {
4181
+ createEnvironmentBuild(input: {
4328
4182
  path: {
4329
- key: string;
4330
- };
4331
- body: EnvRequest; /** Stops the call: the request in flight, a wait before a retry, a proof-of-work being solved. */
4183
+ name: string;
4184
+ }; /** Stops the call: the request in flight, a wait before a retry, a proof-of-work being solved. */
4332
4185
  signal?: AbortSignal;
4333
- }): Promise<Reply<200, EnvVar>>;
4186
+ }): Promise<Reply<201, EnvironmentBuild>>;
4334
4187
  /**
4335
- * Remove a variable
4188
+ * Get an environment build
4336
4189
  *
4337
- * Sessions begun from now no longer have it.
4190
+ * Returns the status and metadata of a specific environment build.
4338
4191
  */
4339
- deleteEnv(input: {
4192
+ getEnvironmentBuild(input: {
4340
4193
  path: {
4341
- key: string;
4194
+ name: string; /** The build's identifier. */
4195
+ build_id: string;
4342
4196
  }; /** Stops the call: the request in flight, a wait before a retry, a proof-of-work being solved. */
4343
4197
  signal?: AbortSignal;
4344
- }): Promise<Reply<204, undefined>>;
4198
+ }): Promise<Reply<200, EnvironmentBuild>>;
4345
4199
  /**
4346
4200
  * Make pictures
4347
4201
  *
@@ -4522,41 +4376,6 @@ export declare function client(t: Transport): {
4522
4376
  }; /** Stops the call: the request in flight, a wait before a retry, a proof-of-work being solved. */
4523
4377
  signal?: AbortSignal;
4524
4378
  }): Promise<Reply<204, undefined>>;
4525
- /**
4526
- * The project's repositories
4527
- *
4528
- * The repositories the project's chats work in, by name, a page at a time (a project puts 10000 at most).
4529
- */
4530
- listRepos(input?: {
4531
- query?: {
4532
- limit?: number; /** next_cursor of the page before. */
4533
- cursor?: string;
4534
- }; /** Stops the call: the request in flight, a wait before a retry, a proof-of-work being solved. */
4535
- signal?: AbortSignal;
4536
- }): Promise<Reply<200, RepoPage>>;
4537
- /**
4538
- * Put a repository
4539
- *
4540
- * Puts a GitHub repository the project's chats work in. Its tokens come from the project's backend (the framework's ai.repo), asked at each clone and each push — none is kept.
4541
- */
4542
- putRepo(input: {
4543
- path: {
4544
- name: string;
4545
- };
4546
- body: RepoRequest; /** Stops the call: the request in flight, a wait before a retry, a proof-of-work being solved. */
4547
- signal?: AbortSignal;
4548
- }): Promise<Reply<200, Repo>>;
4549
- /**
4550
- * Delete a repository
4551
- *
4552
- * A chat's workspace checks it out no more.
4553
- */
4554
- deleteRepo(input: {
4555
- path: {
4556
- name: string;
4557
- }; /** Stops the call: the request in flight, a wait before a retry, a proof-of-work being solved. */
4558
- signal?: AbortSignal;
4559
- }): Promise<Reply<204, undefined>>;
4560
4379
  /**
4561
4380
  * Ask a model
4562
4381
  *
@@ -4656,130 +4475,117 @@ export declare function client(t: Transport): {
4656
4475
  query?: {
4657
4476
  limit?: number; /** The next_cursor of the previous page. */
4658
4477
  cursor?: string; /** Only uses of this kind: text, embedding or image. */
4659
- kind?: "text" | "embedding" | "image"; /** Labels each use listed carries, as a JSON object ({"product":"p1"}): a product's spend, a task's. */
4478
+ kind?: "text" | "embedding" | "image" | "video" | "stt" | "tts" | "voice" | "web_search" | "machine"; /** Labels each use listed carries, as a JSON object ({"product":"p1"}): a product's spend, a task's. */
4660
4479
  metadata?: string;
4661
4480
  }; /** Stops the call: the request in flight, a wait before a retry, a proof-of-work being solved. */
4662
4481
  signal?: AbortSignal;
4663
4482
  }): Promise<Reply<200, UsagePage>>;
4664
4483
  /**
4665
- * What changed since a sequence
4484
+ * OpenAI-compatible text-to-speech
4666
4485
  *
4667
- * Every path whose state at the head differs from its state at since, as it is at the head (since 0, or older than the kept history: the whole tree, full). Called with the workspace token alone (Authorization: Bearer), at the project's own address — forwarded as it came to the workspace's store, whose answer it is (its refusals are its own problem documents, application/problem+json); a token this project did not mint, revoked or expired is refused here (401 invalid_token). This is the wire `palbase-agent workspace sync` speaks: its shapes are the store's.
4486
+ * Streams synthesized audio via OpenAI or ElevenLabs.
4668
4487
  */
4669
- getWorkspaceSyncChanges(input?: {
4670
- query?: {
4671
- since?: number;
4672
- }; /** Stops the call: the request in flight, a wait before a retry, a proof-of-work being solved. */
4673
- signal?: AbortSignal;
4674
- }): Promise<Reply<200, SyncChanges>>;
4675
- /**
4676
- * Publish the writer's changes
4677
- *
4678
- * The writer's changes, each with what it last knew of its path (previous): applied only while the path still is that — the first to reach the store wins; a change that lost is kept aside as a conflict, in the workspace's history for 30 days (ai.workspace.conflict) — answered with the head, what was applied, what lost, and what changed since known_seq that the writer has not seen (catch_up). A write token's alone. Called with the workspace token alone (Authorization: Bearer), at the project's own address — forwarded as it came to the workspace's store, whose answer it is (its refusals are its own problem documents, application/problem+json); a token this project did not mint, revoked or expired is refused here (401 invalid_token). This is the wire `palbase-agent workspace sync` speaks: its shapes are the store's.
4679
- */
4680
- createWorkspaceSyncChangeSet(input: {
4681
- body: SyncChangeSet; /** Stops the call: the request in flight, a wait before a retry, a proof-of-work being solved. */
4488
+ gatewayAudioSpeech(input: {
4489
+ body: SpeechRequest; /** Stops the call: the request in flight, a wait before a retry, a proof-of-work being solved. */
4682
4490
  signal?: AbortSignal;
4683
- }): Promise<Reply<200, SyncChangeSetResult>>;
4491
+ }): Promise<Reply<200, Response>>;
4684
4492
  /**
4685
- * A conflict, and the version that lost
4493
+ * OpenAI-compatible audio transcription
4686
4494
  *
4687
- * A conflict as the workspace's history keeps it (30 days): the path, the version that lost with a signed request to read its bytes (read), the one that won, the tree and the writer. Called with the workspace token alone (Authorization: Bearer), at the project's own address — forwarded as it came to the workspace's store, whose answer it is (its refusals are its own problem documents, application/problem+json); a token this project did not mint, revoked or expired is refused here (401 invalid_token). This is the wire `palbase-agent workspace sync` speaks: its shapes are the store's.
4495
+ * Transcribes audio via OpenAI or Deepgram.
4688
4496
  */
4689
- getWorkspaceSyncConflict(input: {
4690
- path: {
4691
- conflict_id: string;
4692
- }; /** Stops the call: the request in flight, a wait before a retry, a proof-of-work being solved. */
4497
+ gatewayAudioTranscriptions(input: {
4498
+ body: GatewayJSON; /** Stops the call: the request in flight, a wait before a retry, a proof-of-work being solved. */
4693
4499
  signal?: AbortSignal;
4694
- }): Promise<Reply<200, SyncConflictDetail>>;
4500
+ }): Promise<Reply<200, GatewayJSON>>;
4695
4501
  /**
4696
- * The workspace's events, as they happen
4502
+ * OpenAI-compatible chat completions
4697
4503
  *
4698
- * An event stream (text/event-stream), passed on unbuffered: `event: head` when the head moves ({workspace_id, manifest_id, seq}) and `event: conflict` when a writer's change lost ({id, path, lost, winner}), with a comment line every 15 seconds. Each of the module's servers that answer the project's address holds 4 streams of a token open at once, 16 of a workspace, 64 of a project's tokens together — apart from the project's response streams (429 too_many_streams): the bounds are a server's, not the project's whole; a stream ends when its token is revoked, expires, or is a member's whose member left the chat. Called with the workspace token alone (Authorization: Bearer), at the project's own address — forwarded as it came to the workspace's store, whose answer it is (its refusals are its own problem documents, application/problem+json); a token this project did not mint, revoked or expired is refused here (401 invalid_token). This is the wire `palbase-agent workspace sync` speaks: its shapes are the store's.
4504
+ * Routes to any direct-to-source text model in fast stateless mode or stateful single-engine mode when X-Palbase-Session-Id is provided.
4699
4505
  */
4700
- getWorkspaceSyncEvents(input?: {
4506
+ gatewayChatCompletions(input: {
4507
+ body: GatewayJSON; /** Stops the call: the request in flight, a wait before a retry, a proof-of-work being solved. */
4701
4508
  signal?: AbortSignal;
4702
- }): Promise<Reply<200, Response>>;
4509
+ }): Promise<Reply<200, GatewayJSON>>;
4703
4510
  /**
4704
- * Signed transfers of the workspace's blobs
4511
+ * OpenAI-compatible embeddings
4705
4512
  *
4706
- * Presigned requests for the blobs the writer will upload (put) and read (get), by their digests: a blob the store holds already is not in put — nothing to upload. Called with the workspace token alone (Authorization: Bearer), at the project's own address — forwarded as it came to the workspace's store, whose answer it is (its refusals are its own problem documents, application/problem+json); a token this project did not mint, revoked or expired is refused here (401 invalid_token). This is the wire `palbase-agent workspace sync` speaks: its shapes are the store's.
4513
+ * Generates text embeddings across OpenAI, Google Gemini, Mistral, and Fireworks.
4707
4514
  */
4708
- createWorkspaceSyncGrants(input: {
4709
- body: SyncGrantRequest; /** Stops the call: the request in flight, a wait before a retry, a proof-of-work being solved. */
4515
+ gatewayEmbeddings(input: {
4516
+ body: GatewayJSON; /** Stops the call: the request in flight, a wait before a retry, a proof-of-work being solved. */
4710
4517
  signal?: AbortSignal;
4711
- }): Promise<Reply<200, SyncGrants>>;
4518
+ }): Promise<Reply<200, GatewayJSON>>;
4712
4519
  /**
4713
- * Where the workspace's head is
4520
+ * OpenAI-compatible image generation
4714
4521
  *
4715
- * The tree the workspace is at: its manifest, its sequence and its checksum. Called with the workspace token alone (Authorization: Bearer), at the project's own address — forwarded as it came to the workspace's store, whose answer it is (its refusals are its own problem documents, application/problem+json); a token this project did not mint, revoked or expired is refused here (401 invalid_token). This is the wire `palbase-agent workspace sync` speaks: its shapes are the store's.
4522
+ * Generates images across OpenAI, Google Imagen, and Black Forest Labs Flux.
4716
4523
  */
4717
- getWorkspaceSyncHead(input?: {
4524
+ gatewayImagesGenerations(input: {
4525
+ body: GatewayJSON; /** Stops the call: the request in flight, a wait before a retry, a proof-of-work being solved. */
4718
4526
  signal?: AbortSignal;
4719
- }): Promise<Reply<200, SyncChanges>>;
4527
+ }): Promise<Reply<200, GatewayJSON>>;
4720
4528
  /**
4721
- * Allow a secret a host
4529
+ * Anthropic-compatible messages
4722
4530
  *
4723
- * The owner's Allow, for one of the project's variables: the host is added to a sealed secret's hosts (32 at most), and the asks it now allows are marked allowed. A sealed secret sent to it from the proxy's next renewal carries the value. Allow only a host you know the secret belongs to: an agent can be led to send a secret anywhere. A person's alone: an owner or an admin of the organization signed in, never a key or a token, the secret key included (403 person_required; an environment's token, token_out_of_scope).
4531
+ * Anthropic Messages wire routing to any direct-to-source text model in fast stateless mode or stateful single-engine mode.
4724
4532
  */
4725
- allowEnvHost(input: {
4726
- path: {
4727
- key: string;
4728
- };
4729
- body: EnvHostRequest; /** Stops the call: the request in flight, a wait before a retry, a proof-of-work being solved. */
4533
+ gatewayAnthropicMessages(input: {
4534
+ body: GatewayJSON; /** Stops the call: the request in flight, a wait before a retry, a proof-of-work being solved. */
4730
4535
  signal?: AbortSignal;
4731
- }): Promise<Reply<200, EnvVar>>;
4536
+ }): Promise<Reply<200, GatewayJSON>>;
4732
4537
  /**
4733
- * The hosts the project's secrets asked for
4538
+ * List live models (OpenAI-compatible)
4734
4539
  *
4735
- * The hosts the project's sealed secrets were sent to that they are not allowed for: each secret and host once, with how many times, newest first — its host and the registrable domain it is under (an Allow hands the secret to whoever holds that domain), and whose secret it is (a project variable, or an agent's own of an origin). The project's owners are emailed a link at most once a day for each, at most 3 a day for one secret and 10 a project a day, counted where no ask lowers the count. A project keeps 500 asked, 50 of them a secret and 100 an agent's own secrets: an ask past one forgets an asked one alone — the secret's own oldest, else the oldest of the secret that holds the most, the one asked last among equals — never a dismissed or an allowed one; it keeps 500 dismissed and 500 allowed, a decision past them forgetting the oldest of its kind. A variable removed takes its asks with it, and a key that leaves an agent its own.
4540
+ * Returns the live DB-backed model catalog in OpenAI-compatible list format.
4736
4541
  */
4737
- listEnvHostRequests(input?: {
4542
+ gatewayListModels(input?: {
4738
4543
  query?: {
4739
- status?: "asked" | "allowed" | "dismissed";
4544
+ modality?: "text" | "embedding" | "image" | "video" | "stt" | "tts" | "voice_live";
4545
+ vendor?: string;
4546
+ include_deprecated?: boolean;
4740
4547
  }; /** Stops the call: the request in flight, a wait before a retry, a proof-of-work being solved. */
4741
4548
  signal?: AbortSignal;
4742
- }): Promise<Reply<200, SecretHostRequestList>>;
4549
+ }): Promise<Reply<200, GatewayJSON>>;
4743
4550
  /**
4744
- * Dismiss an ask
4551
+ * OpenAI Responses wire
4745
4552
  *
4746
- * The owner's Dismiss: the ask is never told again (it is still counted). One allowed is not undone here: its host is the secret's (PUT /ai/env/{key} with hosts, or DELETE /ai/env/allowances/{allowance_id}, takes it away) — 409 already_allowed. A person's alone: an owner or an admin of the organization signed in, never a key or a token, the secret key included (403 person_required; an environment's token, token_out_of_scope).
4553
+ * Routes OpenAI Responses requests directly through Palbase single engine.
4747
4554
  */
4748
- dismissEnvHostRequest(input: {
4749
- path: {
4750
- request_id: string;
4751
- }; /** Stops the call: the request in flight, a wait before a retry, a proof-of-work being solved. */
4555
+ gatewayResponses(input: {
4556
+ body: GatewayJSON; /** Stops the call: the request in flight, a wait before a retry, a proof-of-work being solved. */
4752
4557
  signal?: AbortSignal;
4753
- }): Promise<Reply<200, SecretHostRequest>>;
4558
+ }): Promise<Reply<200, GatewayJSON>>;
4754
4559
  /**
4755
- * Allow an ask
4560
+ * Start an asynchronous video generation job
4756
4561
  *
4757
- * The owner's Allow, for any ask: its host is added to the variable's hosts (one of the project's), or to the agent's allowances (an agent's own secret: GET /ai/env/allowances), and the asks it now allows are marked allowed. A person's alone: an owner or an admin of the organization signed in, never a key or a token, the secret key included (403 person_required; an environment's token, token_out_of_scope).
4562
+ * Starts a durable asynchronous video generation job on Google Veo or Kling.
4758
4563
  */
4759
- allowEnvHostRequest(input: {
4760
- path: {
4761
- request_id: string;
4762
- }; /** Stops the call: the request in flight, a wait before a retry, a proof-of-work being solved. */
4564
+ createVideo(input: {
4565
+ body: VideoRequest; /** Stops the call: the request in flight, a wait before a retry, a proof-of-work being solved. */
4763
4566
  signal?: AbortSignal;
4764
- }): Promise<Reply<200, SecretHostRequest>>;
4567
+ }): Promise<Reply<202, VideoJob>>;
4765
4568
  /**
4766
- * The agents' secrets' allowances
4569
+ * Read a video generation job
4767
4570
  *
4768
- * The hosts the project's agents' own secrets are allowed beside their definitions': each an owner's Allow of an ask, newest first (500 at most), with whose agent (origin) and the host's registrable domain. A new value keeps them. One goes with its key: an agent the project keeps, once neither its draft nor its version published has the key (deleted, every one); a chat's own definition, with the last chat whose definition has it; a backend's agent, after 30 days with no turn.
4571
+ * Returns the status, output URL, storage path, and billed cost of a video job.
4769
4572
  */
4770
- listEnvAllowances(input?: {
4573
+ getVideo(input: {
4574
+ path: {
4575
+ video_id: string;
4576
+ }; /** Stops the call: the request in flight, a wait before a retry, a proof-of-work being solved. */
4771
4577
  signal?: AbortSignal;
4772
- }): Promise<Reply<200, SecretHostAllowanceList>>;
4578
+ }): Promise<Reply<200, VideoJob>>;
4773
4579
  /**
4774
- * Take an allowance away
4580
+ * Cancel a running video generation job
4775
4581
  *
4776
- * The host taken away from the agent's secret: an ask for it is asked again. A person's alone: an owner or an admin of the organization signed in, never a key or a token, the secret key included (403 person_required; an environment's token, token_out_of_scope).
4582
+ * Cancels a queued or running video job.
4777
4583
  */
4778
- deleteEnvAllowance(input: {
4584
+ cancelVideo(input: {
4779
4585
  path: {
4780
- allowance_id: string;
4586
+ video_id: string;
4781
4587
  }; /** Stops the call: the request in flight, a wait before a retry, a proof-of-work being solved. */
4782
4588
  signal?: AbortSignal;
4783
- }): Promise<Reply<204, undefined>>;
4589
+ }): Promise<Reply<200, VideoCancelResult>>;
4784
4590
  };
4785
4591
  export type Client = ReturnType<typeof client>;