@miosa/sdk 1.2.28 → 2.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -22,10 +22,14 @@ var MiosaError = class _MiosaError extends Error {
22
22
  this.details = details;
23
23
  this.requestId = requestId;
24
24
  }
25
- static fromResponse(status, body4, requestId) {
26
- const message = body4.error?.message ?? body4.message ?? `HTTP ${status}`;
27
- const code = body4.error?.code ?? body4.code ?? "UNKNOWN_ERROR";
28
- const details = body4.error?.details;
25
+ static fromResponse(status, body5, requestId) {
26
+ const nested = typeof body5.error === "object" ? body5.error : void 0;
27
+ const flatError = typeof body5.error === "string" ? body5.error : void 0;
28
+ const flatErrorIsCode = !!flatError && /^[A-Z][A-Z0-9_]+$/.test(flatError);
29
+ const message = nested?.message ?? body5.message ?? body5.detail ?? body5.reason ?? flatError ?? `HTTP ${status}`;
30
+ const code = nested?.code ?? body5.code ?? (flatErrorIsCode ? flatError : "UNKNOWN_ERROR");
31
+ const details = nested?.details ?? body5.details ?? (body5.detail || body5.reason ? { detail: body5.detail, reason: body5.reason } : void 0);
32
+ requestId ??= body5.request_id;
29
33
  const connectError = connectErrorFromCode(code, message, status, details, requestId);
30
34
  if (connectError) return connectError;
31
35
  if (status === 401 || status === 403) {
@@ -163,6 +167,10 @@ var TokenRefreshFailedError = class extends MiosaError {
163
167
  }
164
168
  };
165
169
 
170
+ // src/version.ts
171
+ var SDK_VERSION = "2.0.1";
172
+ var SDK_USER_AGENT = `@miosa/sdk/${SDK_VERSION}`;
173
+
166
174
  // src/http.ts
167
175
  var _h2Configured = false;
168
176
  var _h2Available = false;
@@ -209,11 +217,13 @@ var HttpClient = class {
209
217
  baseUrl;
210
218
  /** Public for WebSocket clients that need to send the same auth. */
211
219
  apiKey;
220
+ tenant;
212
221
  timeout;
213
222
  maxRetries;
214
223
  constructor(config) {
215
224
  this.baseUrl = config.baseUrl.replace(/\/$/, "");
216
225
  this.apiKey = config.apiKey;
226
+ this.tenant = config.tenant;
217
227
  this.timeout = config.timeout ?? DEFAULT_TIMEOUT;
218
228
  this.maxRetries = config.maxRetries ?? DEFAULT_MAX_RETRIES;
219
229
  }
@@ -229,17 +239,19 @@ var HttpClient = class {
229
239
  return url.toString();
230
240
  }
231
241
  baseHeaders(extra) {
232
- return {
242
+ const headers = {
233
243
  Authorization: `Bearer ${this.apiKey}`,
234
244
  Accept: "application/json",
235
- "User-Agent": "@miosa/sdk/1.0.0",
245
+ "User-Agent": SDK_USER_AGENT,
236
246
  ...extra
237
247
  };
248
+ if (this.tenant) headers["X-MIOSA-Tenant"] = this.tenant;
249
+ return headers;
238
250
  }
239
251
  async request(path, options = {}) {
240
252
  const {
241
253
  method = "GET",
242
- body: body4,
254
+ body: body5,
243
255
  formData,
244
256
  binary = false,
245
257
  timeout = this.timeout
@@ -248,9 +260,9 @@ var HttpClient = class {
248
260
  let fetchBody;
249
261
  if (formData) {
250
262
  fetchBody = formData;
251
- } else if (body4 !== void 0) {
263
+ } else if (body5 !== void 0) {
252
264
  headers = { ...headers, "Content-Type": "application/json" };
253
- fetchBody = JSON.stringify(body4);
265
+ fetchBody = JSON.stringify(body5);
254
266
  }
255
267
  let lastError;
256
268
  for (let attempt = 0; attempt <= this.maxRetries; attempt++) {
@@ -332,17 +344,17 @@ var HttpClient = class {
332
344
  }
333
345
  return this.request(fullPath, { method: "GET" });
334
346
  }
335
- async post(path, body4) {
336
- return this.request(path, { method: "POST", body: body4 });
347
+ async post(path, body5) {
348
+ return this.request(path, { method: "POST", body: body5 });
337
349
  }
338
- async patch(path, body4) {
339
- return this.request(path, { method: "PATCH", body: body4 });
350
+ async patch(path, body5) {
351
+ return this.request(path, { method: "PATCH", body: body5 });
340
352
  }
341
- async put(path, body4) {
342
- return this.request(path, { method: "PUT", body: body4 });
353
+ async put(path, body5) {
354
+ return this.request(path, { method: "PUT", body: body5 });
343
355
  }
344
- async delete(path, body4) {
345
- return this.request(path, { method: "DELETE", body: body4 });
356
+ async delete(path, body5) {
357
+ return this.request(path, { method: "DELETE", body: body5 });
346
358
  }
347
359
  async getBinary(path) {
348
360
  return this.request(path, { method: "GET", binary: true });
@@ -360,10 +372,10 @@ var HttpClient = class {
360
372
  Accept: "text/event-stream",
361
373
  ...options.headers
362
374
  });
363
- let body4 = null;
375
+ let body5 = null;
364
376
  if (options.body !== void 0) {
365
377
  headers = { ...headers, "Content-Type": "application/json" };
366
- body4 = JSON.stringify(options.body);
378
+ body5 = JSON.stringify(options.body);
367
379
  }
368
380
  const controller = new AbortController();
369
381
  let response;
@@ -371,7 +383,7 @@ var HttpClient = class {
371
383
  response = await fetch(`${this.baseUrl}${path}`, {
372
384
  method,
373
385
  headers,
374
- body: body4,
386
+ body: body5,
375
387
  signal: controller.signal
376
388
  });
377
389
  } catch (err) {
@@ -440,7 +452,7 @@ var Admin = class {
440
452
  this.http = http;
441
453
  }
442
454
  /** Escape hatch — call any admin endpoint by method + path. */
443
- async request(method, path, body4, query3) {
455
+ async request(method, path, body5, query3) {
444
456
  const fullPath = query3 ? (() => {
445
457
  const qs = new URLSearchParams();
446
458
  for (const [k, v] of Object.entries(query3)) {
@@ -453,13 +465,13 @@ var Admin = class {
453
465
  case "GET":
454
466
  return this.http.get(fullPath);
455
467
  case "POST":
456
- return this.http.post(fullPath, body4);
468
+ return this.http.post(fullPath, body5);
457
469
  case "PUT":
458
- return this.http.put(fullPath, body4);
470
+ return this.http.put(fullPath, body5);
459
471
  case "PATCH":
460
- return this.http.patch(fullPath, body4);
472
+ return this.http.patch(fullPath, body5);
461
473
  case "DELETE":
462
- return this.http.delete(fullPath, body4);
474
+ return this.http.delete(fullPath, body5);
463
475
  }
464
476
  }
465
477
  // ── Overview ────────────────────────────────────────────────
@@ -673,17 +685,17 @@ var Admin = class {
673
685
  }
674
686
  };
675
687
 
676
- // src/resources/run-groups.ts
688
+ // src/resources/agent-run-groups.ts
677
689
  function unwrap(payload) {
678
690
  if (payload && typeof payload === "object" && "data" in payload) {
679
691
  return payload.data;
680
692
  }
681
693
  return payload;
682
694
  }
683
- function fileRows(raw) {
695
+ function artifactRows(raw) {
684
696
  const data = unwrap(raw);
685
697
  if (Array.isArray(data)) return data;
686
- return data.files ?? data.items ?? [];
698
+ return data.artifacts ?? data.items ?? [];
687
699
  }
688
700
  function stripUndefined(input) {
689
701
  return Object.fromEntries(
@@ -703,6 +715,316 @@ function body(params) {
703
715
  }
704
716
  function runBody(entry) {
705
717
  return stripUndefined({
718
+ prompt: entry.prompt,
719
+ target_kind: entry.targetKind,
720
+ target_id: entry.targetId,
721
+ sandbox_id: entry.sandboxId,
722
+ computer_id: entry.computerId,
723
+ provider: entry.provider,
724
+ model: entry.model,
725
+ command: entry.command,
726
+ runtime_command: entry.runtimeCommand,
727
+ cwd: entry.cwd,
728
+ timeout: entry.timeout,
729
+ env: entry.env,
730
+ agent_runtime_profile_id: entry.agentRuntimeProfileId,
731
+ agent_profile_id: entry.agentProfileId,
732
+ parent_agent_run_id: entry.parentAgentRunId,
733
+ orchestration_role: entry.orchestrationRole,
734
+ skip_agent_runtime_profile: entry.skipAgentRuntimeProfile,
735
+ execution_packet: entry.executionPacket,
736
+ output_contract: entry.outputContract,
737
+ approval_policy: entry.approvalPolicy,
738
+ capability_requirements: entry.capabilityRequirements,
739
+ metadata: entry.metadata
740
+ });
741
+ }
742
+ function isTerminalStatus(status, terminalStatuses) {
743
+ return typeof status === "string" && terminalStatuses.includes(status.toLowerCase());
744
+ }
745
+ function sleep2(ms) {
746
+ if (ms <= 0) return Promise.resolve();
747
+ return new Promise((resolve) => setTimeout(resolve, ms));
748
+ }
749
+ var AgentRunGroups = class {
750
+ constructor(http) {
751
+ this.http = http;
752
+ }
753
+ http;
754
+ async list(params = {}) {
755
+ const response = await this.http.get(
756
+ "/agent-run-groups",
757
+ stripUndefined({
758
+ workspace_id: params.workspaceId,
759
+ project_id: params.projectId,
760
+ status: params.status,
761
+ limit: params.limit
762
+ })
763
+ );
764
+ const data = unwrap(
765
+ response
766
+ );
767
+ if (Array.isArray(data)) return data;
768
+ return data.groups ?? data.items ?? [];
769
+ }
770
+ async create(params) {
771
+ return unwrap(
772
+ await this.http.post("/agent-run-groups", body(params))
773
+ );
774
+ }
775
+ async get(id, options = {}) {
776
+ const query3 = options.includeRuns ? "?include=runs" : "";
777
+ return unwrap(
778
+ await this.http.get(`/agent-run-groups/${encodeURIComponent(id)}${query3}`)
779
+ );
780
+ }
781
+ async dispatch(id, runs, options = {}) {
782
+ return unwrap(
783
+ await this.http.post(
784
+ `/agent-run-groups/${encodeURIComponent(id)}/dispatch`,
785
+ stripUndefined({ runs: runs.map(runBody), async: options.async })
786
+ )
787
+ );
788
+ }
789
+ async cancel(id) {
790
+ return unwrap(
791
+ await this.http.post(
792
+ `/agent-run-groups/${encodeURIComponent(id)}/cancel`,
793
+ {}
794
+ )
795
+ );
796
+ }
797
+ async events(id) {
798
+ const data = unwrap(
799
+ await this.http.get(
800
+ `/agent-run-groups/${encodeURIComponent(id)}/events`
801
+ )
802
+ );
803
+ if (Array.isArray(data)) return data;
804
+ return data.events ?? data.items ?? [];
805
+ }
806
+ streamEvents(id) {
807
+ return this.http.stream(
808
+ `/agent-run-groups/${encodeURIComponent(id)}/events`
809
+ );
810
+ }
811
+ async artifacts(id) {
812
+ const group = await this.get(id, { includeRuns: true });
813
+ const runs = (group.runs ?? []).filter((run) => Boolean(run.id));
814
+ const nested = await Promise.all(
815
+ runs.map(async (run) => {
816
+ const artifacts = artifactRows(
817
+ await this.http.get(
818
+ `/agent-runs/${encodeURIComponent(run.id)}/artifacts`
819
+ )
820
+ );
821
+ return artifacts.map((artifact) => ({
822
+ ...artifact,
823
+ agent_run_id: artifact.agent_run_id ?? run.id
824
+ }));
825
+ })
826
+ );
827
+ return nested.flat();
828
+ }
829
+ async waitForCompletion(id, options = {}) {
830
+ const timeoutMs = options.timeoutMs ?? 15 * 60 * 1e3;
831
+ const pollIntervalMs = options.pollIntervalMs ?? 2e3;
832
+ const terminalStatuses = options.terminalStatuses ?? [
833
+ "succeeded",
834
+ "failed",
835
+ "canceled",
836
+ "cancelled"
837
+ ];
838
+ const deadline = Date.now() + timeoutMs;
839
+ while (true) {
840
+ const group = await this.get(
841
+ id,
842
+ options.includeRuns === void 0 ? {} : { includeRuns: options.includeRuns }
843
+ );
844
+ if (isTerminalStatus(group.status, terminalStatuses)) return group;
845
+ if (Date.now() >= deadline) {
846
+ throw new Error(`Timed out waiting for agent run group ${id}`);
847
+ }
848
+ await sleep2(Math.min(pollIntervalMs, Math.max(0, deadline - Date.now())));
849
+ }
850
+ }
851
+ };
852
+
853
+ // src/resources/agent-runs.ts
854
+ function unwrap2(payload) {
855
+ if (payload && typeof payload === "object" && "data" in payload) {
856
+ return payload.data;
857
+ }
858
+ return payload;
859
+ }
860
+ function stripUndefined2(input) {
861
+ return Object.fromEntries(
862
+ Object.entries(input).filter(([, value]) => value !== void 0)
863
+ );
864
+ }
865
+ function isTerminalStatus2(status, terminalStatuses) {
866
+ return typeof status === "string" && terminalStatuses.includes(status.toLowerCase());
867
+ }
868
+ function sleep3(ms) {
869
+ if (ms <= 0) return Promise.resolve();
870
+ return new Promise((resolve) => setTimeout(resolve, ms));
871
+ }
872
+ var AgentRuns = class {
873
+ constructor(http) {
874
+ this.http = http;
875
+ }
876
+ http;
877
+ async list(params = {}) {
878
+ const response = await this.http.get(
879
+ "/agent-runs",
880
+ stripUndefined2({
881
+ target_kind: params.targetKind,
882
+ target_id: params.targetId,
883
+ sandbox_id: params.sandboxId,
884
+ computer_id: params.computerId,
885
+ agent_run_group_id: params.agentRunGroupId,
886
+ external_workspace_id: params.externalWorkspaceId ?? params.external_workspace_id,
887
+ external_user_id: params.externalUserId ?? params.external_user_id,
888
+ external_project_id: params.externalProjectId ?? params.external_project_id,
889
+ status: params.status
890
+ })
891
+ );
892
+ const data = unwrap2(
893
+ response
894
+ );
895
+ if (Array.isArray(data)) return data;
896
+ return data.runs ?? data.items ?? [];
897
+ }
898
+ async get(id) {
899
+ return unwrap2(
900
+ await this.http.get(`/agent-runs/${encodeURIComponent(id)}`)
901
+ );
902
+ }
903
+ async artifacts(id) {
904
+ const data = unwrap2(
905
+ await this.http.get(
906
+ `/agent-runs/${encodeURIComponent(id)}/artifacts`
907
+ )
908
+ );
909
+ if (Array.isArray(data)) return data;
910
+ return data.artifacts ?? data.items ?? [];
911
+ }
912
+ async downloadArtifact(id, artifactId, options = {}) {
913
+ const query3 = options.inline ? "?disposition=inline" : "";
914
+ return this.http.getBinary(
915
+ `/agent-runs/${encodeURIComponent(id)}/artifacts/${encodeURIComponent(
916
+ artifactId
917
+ )}/download${query3}`
918
+ );
919
+ }
920
+ async events(id) {
921
+ const data = unwrap2(
922
+ await this.http.get(`/agent-runs/${encodeURIComponent(id)}/events`)
923
+ );
924
+ if (Array.isArray(data)) return data;
925
+ return data.events ?? data.items ?? [];
926
+ }
927
+ streamEvents(id) {
928
+ return this.http.stream(
929
+ `/agent-runs/${encodeURIComponent(id)}/events`
930
+ );
931
+ }
932
+ async waitForCompletion(id, options = {}) {
933
+ const timeoutMs = options.timeoutMs ?? 15 * 60 * 1e3;
934
+ const pollIntervalMs = options.pollIntervalMs ?? 2e3;
935
+ const terminalStatuses = options.terminalStatuses ?? [
936
+ "succeeded",
937
+ "failed",
938
+ "canceled",
939
+ "cancelled"
940
+ ];
941
+ const deadline = Date.now() + timeoutMs;
942
+ while (true) {
943
+ const run = await this.get(id);
944
+ if (isTerminalStatus2(run.status, terminalStatuses)) return run;
945
+ if (Date.now() >= deadline) {
946
+ throw new Error(`Timed out waiting for agent run ${id}`);
947
+ }
948
+ await sleep3(Math.min(pollIntervalMs, Math.max(0, deadline - Date.now())));
949
+ }
950
+ }
951
+ async run(params) {
952
+ const body5 = stripUndefined2({
953
+ prompt: params.prompt,
954
+ target_kind: params.targetKind,
955
+ target_id: params.targetId,
956
+ sandbox_id: params.sandboxId,
957
+ computer_id: params.computerId,
958
+ provider: params.provider,
959
+ model: params.model,
960
+ command: params.command,
961
+ runtime_command: params.runtimeCommand,
962
+ cwd: params.cwd,
963
+ timeout: params.timeout,
964
+ wait: params.wait,
965
+ env: params.env,
966
+ output_format: params.outputFormat ?? params.output_format,
967
+ resume_session_id: params.resumeSessionId ?? params.resume_session_id,
968
+ json: params.json,
969
+ output_schema: params.outputSchema ?? params.output_schema,
970
+ image: params.image,
971
+ agent_runtime_profile_id: params.agentRuntimeProfileId,
972
+ agent_profile_id: params.agentProfileId,
973
+ agent_run_group_id: params.agentRunGroupId,
974
+ parent_agent_run_id: params.parentAgentRunId,
975
+ orchestration_role: params.orchestrationRole,
976
+ external_workspace_id: params.externalWorkspaceId ?? params.external_workspace_id,
977
+ external_user_id: params.externalUserId ?? params.external_user_id,
978
+ external_project_id: params.externalProjectId ?? params.external_project_id,
979
+ skip_agent_runtime_profile: params.skipAgentRuntimeProfile,
980
+ execution_packet: params.executionPacket,
981
+ output_contract: params.outputContract,
982
+ approval_policy: params.approvalPolicy,
983
+ capability_requirements: params.capabilityRequirements,
984
+ metadata: params.metadata
985
+ });
986
+ return unwrap2(await this.http.post("/agent-runs", body5));
987
+ }
988
+ async cancel(id) {
989
+ return unwrap2(
990
+ await this.http.post(
991
+ `/agent-runs/${encodeURIComponent(id)}/cancel`,
992
+ {}
993
+ )
994
+ );
995
+ }
996
+ };
997
+
998
+ // src/resources/run-groups.ts
999
+ function unwrap3(payload) {
1000
+ if (payload && typeof payload === "object" && "data" in payload) {
1001
+ return payload.data;
1002
+ }
1003
+ return payload;
1004
+ }
1005
+ function fileRows(raw) {
1006
+ const data = unwrap3(raw);
1007
+ if (Array.isArray(data)) return data;
1008
+ return data.files ?? data.items ?? [];
1009
+ }
1010
+ function stripUndefined3(input) {
1011
+ return Object.fromEntries(
1012
+ Object.entries(input).filter(([, value]) => value !== void 0)
1013
+ );
1014
+ }
1015
+ function body2(params) {
1016
+ return stripUndefined3({
1017
+ name: params.name,
1018
+ description: params.description,
1019
+ workspace_id: params.workspaceId,
1020
+ project_id: params.projectId,
1021
+ concurrency_limit: params.concurrencyLimit,
1022
+ expected_runs: params.expectedRuns,
1023
+ metadata: params.metadata
1024
+ });
1025
+ }
1026
+ function runBody2(entry) {
1027
+ return stripUndefined3({
706
1028
  instruction: entry.instruction,
707
1029
  target_kind: entry.targetKind,
708
1030
  target_id: entry.targetId,
@@ -729,10 +1051,10 @@ function runBody(entry) {
729
1051
  metadata: entry.metadata
730
1052
  });
731
1053
  }
732
- function isTerminalStatus(status, terminalStatuses) {
1054
+ function isTerminalStatus3(status, terminalStatuses) {
733
1055
  return typeof status === "string" && terminalStatuses.includes(status.toLowerCase());
734
1056
  }
735
- function sleep2(ms) {
1057
+ function sleep4(ms) {
736
1058
  if (ms <= 0) return Promise.resolve();
737
1059
  return new Promise((resolve) => setTimeout(resolve, ms));
738
1060
  }
@@ -744,40 +1066,40 @@ var RunGroups = class {
744
1066
  async list(params = {}) {
745
1067
  const response = await this.http.get(
746
1068
  "/run-groups",
747
- stripUndefined({
1069
+ stripUndefined3({
748
1070
  workspace_id: params.workspaceId,
749
1071
  project_id: params.projectId,
750
1072
  status: params.status,
751
1073
  limit: params.limit
752
1074
  })
753
1075
  );
754
- const data = unwrap(
1076
+ const data = unwrap3(
755
1077
  response
756
1078
  );
757
1079
  if (Array.isArray(data)) return data;
758
1080
  return data.groups ?? data.items ?? [];
759
1081
  }
760
1082
  async create(params) {
761
- return unwrap(
762
- await this.http.post("/run-groups", body(params))
1083
+ return unwrap3(
1084
+ await this.http.post("/run-groups", body2(params))
763
1085
  );
764
1086
  }
765
1087
  async get(id, options = {}) {
766
1088
  const query3 = options.includeRuns ? "?include=runs" : "";
767
- return unwrap(
1089
+ return unwrap3(
768
1090
  await this.http.get(`/run-groups/${encodeURIComponent(id)}${query3}`)
769
1091
  );
770
1092
  }
771
1093
  async dispatch(id, runs, options = {}) {
772
- return unwrap(
1094
+ return unwrap3(
773
1095
  await this.http.post(
774
1096
  `/run-groups/${encodeURIComponent(id)}/dispatch`,
775
- stripUndefined({ runs: runs.map(runBody), async: options.async })
1097
+ stripUndefined3({ runs: runs.map(runBody2), async: options.async })
776
1098
  )
777
1099
  );
778
1100
  }
779
1101
  async cancel(id) {
780
- return unwrap(
1102
+ return unwrap3(
781
1103
  await this.http.post(
782
1104
  `/run-groups/${encodeURIComponent(id)}/cancel`,
783
1105
  {}
@@ -785,7 +1107,7 @@ var RunGroups = class {
785
1107
  );
786
1108
  }
787
1109
  async activity(id) {
788
- const data = unwrap(
1110
+ const data = unwrap3(
789
1111
  await this.http.get(
790
1112
  `/run-groups/${encodeURIComponent(id)}/activity`
791
1113
  )
@@ -831,23 +1153,23 @@ var RunGroups = class {
831
1153
  id,
832
1154
  options.includeRuns === void 0 ? {} : { includeRuns: options.includeRuns }
833
1155
  );
834
- if (isTerminalStatus(group.status, terminalStatuses)) return group;
1156
+ if (isTerminalStatus3(group.status, terminalStatuses)) return group;
835
1157
  if (Date.now() >= deadline) {
836
1158
  throw new Error(`Timed out waiting for run group ${id}`);
837
1159
  }
838
- await sleep2(Math.min(pollIntervalMs, Math.max(0, deadline - Date.now())));
1160
+ await sleep4(Math.min(pollIntervalMs, Math.max(0, deadline - Date.now())));
839
1161
  }
840
1162
  }
841
1163
  };
842
1164
 
843
1165
  // src/resources/agent-runtime-profiles.ts
844
- function unwrap2(payload) {
1166
+ function unwrap4(payload) {
845
1167
  if (payload !== null && typeof payload === "object" && "data" in payload && payload.data !== void 0) {
846
1168
  return payload.data;
847
1169
  }
848
1170
  return payload;
849
1171
  }
850
- function body2(params) {
1172
+ function body3(params) {
851
1173
  return Object.fromEntries(
852
1174
  Object.entries({
853
1175
  workspace_id: params.workspaceId ?? params.workspace_id,
@@ -898,11 +1220,11 @@ var AgentRuntimeProfiles = class {
898
1220
  project_id: params.projectId ?? params.project_id
899
1221
  }
900
1222
  );
901
- return unwrap2(response).map(normalize);
1223
+ return unwrap4(response).map(normalize);
902
1224
  }
903
1225
  async get(id) {
904
1226
  return normalize(
905
- unwrap2(
1227
+ unwrap4(
906
1228
  await this.http.get(
907
1229
  `/agent-runtime-profiles/${encodeURIComponent(id)}`
908
1230
  )
@@ -911,20 +1233,20 @@ var AgentRuntimeProfiles = class {
911
1233
  }
912
1234
  async create(params) {
913
1235
  return normalize(
914
- unwrap2(
1236
+ unwrap4(
915
1237
  await this.http.post(
916
1238
  "/agent-runtime-profiles",
917
- body2(params)
1239
+ body3(params)
918
1240
  )
919
1241
  )
920
1242
  );
921
1243
  }
922
1244
  async update(id, params) {
923
1245
  return normalize(
924
- unwrap2(
1246
+ unwrap4(
925
1247
  await this.http.put(
926
1248
  `/agent-runtime-profiles/${encodeURIComponent(id)}`,
927
- body2(params)
1249
+ body3(params)
928
1250
  )
929
1251
  )
930
1252
  );
@@ -937,21 +1259,21 @@ var AgentRuntimeProfiles = class {
937
1259
  };
938
1260
 
939
1261
  // src/resources/runs.ts
940
- function unwrap3(payload) {
1262
+ function unwrap5(payload) {
941
1263
  if (payload && typeof payload === "object" && "data" in payload) {
942
1264
  return payload.data;
943
1265
  }
944
1266
  return payload;
945
1267
  }
946
- function stripUndefined2(input) {
1268
+ function stripUndefined4(input) {
947
1269
  return Object.fromEntries(
948
1270
  Object.entries(input).filter(([, value]) => value !== void 0)
949
1271
  );
950
1272
  }
951
- function isTerminalStatus2(status, terminalStatuses) {
1273
+ function isTerminalStatus4(status, terminalStatuses) {
952
1274
  return typeof status === "string" && terminalStatuses.includes(status.toLowerCase());
953
1275
  }
954
- function sleep3(ms) {
1276
+ function sleep5(ms) {
955
1277
  if (ms <= 0) return Promise.resolve();
956
1278
  return new Promise((resolve) => setTimeout(resolve, ms));
957
1279
  }
@@ -963,7 +1285,7 @@ var Runs = class {
963
1285
  async list(params = {}) {
964
1286
  const response = await this.http.get(
965
1287
  "/runs",
966
- stripUndefined2({
1288
+ stripUndefined4({
967
1289
  target_kind: params.targetKind,
968
1290
  target_id: params.targetId,
969
1291
  runtime_id: params.runtimeId,
@@ -976,24 +1298,24 @@ var Runs = class {
976
1298
  status: params.status
977
1299
  })
978
1300
  );
979
- const data = unwrap3(
1301
+ const data = unwrap5(
980
1302
  response
981
1303
  );
982
1304
  if (Array.isArray(data)) return data;
983
1305
  return data.runs ?? data.items ?? [];
984
1306
  }
985
1307
  async get(id) {
986
- return unwrap3(
1308
+ return unwrap5(
987
1309
  await this.http.get(`/runs/${encodeURIComponent(id)}`)
988
1310
  );
989
1311
  }
990
1312
  async outputs(id) {
991
- return unwrap3(
1313
+ return unwrap5(
992
1314
  await this.http.get(`/runs/${encodeURIComponent(id)}/outputs`)
993
1315
  );
994
1316
  }
995
1317
  async files(id) {
996
- const data = unwrap3(
1318
+ const data = unwrap5(
997
1319
  await this.http.get(`/runs/${encodeURIComponent(id)}/files`)
998
1320
  );
999
1321
  if (Array.isArray(data)) return data;
@@ -1008,33 +1330,33 @@ var Runs = class {
1008
1330
  );
1009
1331
  }
1010
1332
  async messages(id) {
1011
- const data = unwrap3(
1333
+ const data = unwrap5(
1012
1334
  await this.http.get(`/runs/${encodeURIComponent(id)}/messages`)
1013
1335
  );
1014
1336
  if (Array.isArray(data)) return data;
1015
1337
  return data.messages ?? data.items ?? [];
1016
1338
  }
1017
1339
  async commandOutput(id) {
1018
- return unwrap3(
1340
+ return unwrap5(
1019
1341
  await this.http.get(`/runs/${encodeURIComponent(id)}/command-output`)
1020
1342
  );
1021
1343
  }
1022
1344
  async activity(id) {
1023
- const data = unwrap3(
1345
+ const data = unwrap5(
1024
1346
  await this.http.get(`/runs/${encodeURIComponent(id)}/activity`)
1025
1347
  );
1026
1348
  if (Array.isArray(data)) return data;
1027
1349
  return data.activity ?? data.items ?? [];
1028
1350
  }
1029
1351
  async previews(id) {
1030
- const data = unwrap3(
1352
+ const data = unwrap5(
1031
1353
  await this.http.get(`/runs/${encodeURIComponent(id)}/previews`)
1032
1354
  );
1033
1355
  if (Array.isArray(data)) return data;
1034
1356
  return data.previews ?? data.items ?? [];
1035
1357
  }
1036
1358
  async diagnostics(id) {
1037
- const data = unwrap3(await this.http.get(`/runs/${encodeURIComponent(id)}/diagnostics`));
1359
+ const data = unwrap5(await this.http.get(`/runs/${encodeURIComponent(id)}/diagnostics`));
1038
1360
  if (Array.isArray(data)) return data;
1039
1361
  return data.diagnostics ?? data.items ?? [];
1040
1362
  }
@@ -1055,15 +1377,15 @@ var Runs = class {
1055
1377
  const deadline = Date.now() + timeoutMs;
1056
1378
  while (true) {
1057
1379
  const run = await this.get(id);
1058
- if (isTerminalStatus2(run.status, terminalStatuses)) return run;
1380
+ if (isTerminalStatus4(run.status, terminalStatuses)) return run;
1059
1381
  if (Date.now() >= deadline) {
1060
1382
  throw new Error(`Timed out waiting for run ${id}`);
1061
1383
  }
1062
- await sleep3(Math.min(pollIntervalMs, Math.max(0, deadline - Date.now())));
1384
+ await sleep5(Math.min(pollIntervalMs, Math.max(0, deadline - Date.now())));
1063
1385
  }
1064
1386
  }
1065
1387
  async run(params) {
1066
- const body4 = stripUndefined2({
1388
+ const body5 = stripUndefined4({
1067
1389
  instruction: params.instruction,
1068
1390
  target_kind: params.targetKind,
1069
1391
  target_id: params.targetId,
@@ -1094,10 +1416,10 @@ var Runs = class {
1094
1416
  capability_requirements: params.capabilityRequirements,
1095
1417
  metadata: params.metadata
1096
1418
  });
1097
- return unwrap3(await this.http.post("/runs", body4));
1419
+ return unwrap5(await this.http.post("/runs", body5));
1098
1420
  }
1099
1421
  async cancel(id) {
1100
- return unwrap3(
1422
+ return unwrap5(
1101
1423
  await this.http.post(
1102
1424
  `/runs/${encodeURIComponent(id)}/cancel`,
1103
1425
  {}
@@ -1107,7 +1429,7 @@ var Runs = class {
1107
1429
  };
1108
1430
 
1109
1431
  // src/resources/analytics.ts
1110
- function unwrap4(payload) {
1432
+ function unwrap6(payload) {
1111
1433
  if (payload && typeof payload === "object") {
1112
1434
  const p = payload;
1113
1435
  for (const k of ["data", "analytics", "series", "items"]) {
@@ -1116,7 +1438,7 @@ function unwrap4(payload) {
1116
1438
  }
1117
1439
  return payload;
1118
1440
  }
1119
- function stripUndefined3(input) {
1441
+ function stripUndefined5(input) {
1120
1442
  return Object.fromEntries(
1121
1443
  Object.entries(input).filter(([, v]) => v !== void 0)
1122
1444
  );
@@ -1128,18 +1450,18 @@ var Analytics = class {
1128
1450
  http;
1129
1451
  /** Get the platform analytics overview. */
1130
1452
  async overview(filters = {}) {
1131
- const query3 = stripUndefined3(filters);
1453
+ const query3 = stripUndefined5(filters);
1132
1454
  const data = await this.http.get("/analytics/overview", query3);
1133
- return unwrap4(data);
1455
+ return unwrap6(data);
1134
1456
  }
1135
1457
  /** Get a timeseries for a metric over a period. */
1136
1458
  async timeseries(params = {}) {
1137
- const query3 = stripUndefined3(params);
1459
+ const query3 = stripUndefined5(params);
1138
1460
  const data = await this.http.get("/analytics/timeseries", query3);
1139
- return unwrap4(data);
1461
+ return unwrap6(data);
1140
1462
  }
1141
1463
  };
1142
- function unwrap5(payload) {
1464
+ function unwrap7(payload) {
1143
1465
  if (payload && typeof payload === "object" && "data" in payload) {
1144
1466
  return payload.data;
1145
1467
  }
@@ -1155,7 +1477,7 @@ function listItems(payload, candidateKeys = ["data", "keys", "api_keys", "items"
1155
1477
  }
1156
1478
  return [];
1157
1479
  }
1158
- function stripUndefined4(input) {
1480
+ function stripUndefined6(input) {
1159
1481
  return Object.fromEntries(
1160
1482
  Object.entries(input).filter(([, v]) => v !== void 0)
1161
1483
  );
@@ -1169,32 +1491,32 @@ var ApiKeys = class {
1169
1491
  }
1170
1492
  http;
1171
1493
  async list(params = {}) {
1172
- const query3 = stripUndefined4({ ...params });
1494
+ const query3 = stripUndefined6({ ...params });
1173
1495
  const data = await this.http.get("/api-keys", query3);
1174
1496
  return listItems(data);
1175
1497
  }
1176
1498
  async create(params) {
1177
1499
  const { idempotencyKey: ikey, expiresAt, ...rest } = params;
1178
- const body4 = stripUndefined4({
1500
+ const body5 = stripUndefined6({
1179
1501
  ...rest,
1180
1502
  expires_at: expiresAt ?? rest.expires_at
1181
1503
  });
1182
1504
  const data = await this.http.request("/api-keys", {
1183
1505
  method: "POST",
1184
- body: body4,
1506
+ body: body5,
1185
1507
  headers: { "Idempotency-Key": idempotencyKey(ikey) }
1186
1508
  });
1187
- return unwrap5(data);
1509
+ return unwrap7(data);
1188
1510
  }
1189
1511
  /** POST /api/v1/api-keys/scoped — L2 delegation token bound to one external user. */
1190
1512
  async createScoped(params) {
1191
- const body4 = stripUndefined4({
1513
+ const body5 = stripUndefined6({
1192
1514
  external_user_id: params.externalUserId,
1193
1515
  scopes: params.scopes,
1194
1516
  expires_at: params.expiresAt
1195
1517
  });
1196
- return unwrap5(
1197
- await this.http.post("/api-keys/scoped", body4)
1518
+ return unwrap7(
1519
+ await this.http.post("/api-keys/scoped", body5)
1198
1520
  );
1199
1521
  }
1200
1522
  async delete(keyId) {
@@ -1203,7 +1525,7 @@ var ApiKeys = class {
1203
1525
  };
1204
1526
 
1205
1527
  // src/resources/audit-log.ts
1206
- function unwrap6(payload) {
1528
+ function unwrap8(payload) {
1207
1529
  if (payload && typeof payload === "object") {
1208
1530
  const p = payload;
1209
1531
  for (const k of ["data", "audit_log", "events", "items"]) {
@@ -1212,7 +1534,7 @@ function unwrap6(payload) {
1212
1534
  }
1213
1535
  return payload;
1214
1536
  }
1215
- function stripUndefined5(input) {
1537
+ function stripUndefined7(input) {
1216
1538
  return Object.fromEntries(
1217
1539
  Object.entries(input).filter(([, v]) => v !== void 0)
1218
1540
  );
@@ -1224,16 +1546,16 @@ var AuditLog = class {
1224
1546
  http;
1225
1547
  /** List audit-log events with optional filters. */
1226
1548
  async list(params = {}) {
1227
- const query3 = stripUndefined5(params);
1549
+ const query3 = stripUndefined7(params);
1228
1550
  const data = await this.http.get("/audit-log", query3);
1229
- const result = unwrap6(data);
1551
+ const result = unwrap8(data);
1230
1552
  if (Array.isArray(result)) return result;
1231
1553
  return [];
1232
1554
  }
1233
1555
  };
1234
1556
 
1235
1557
  // src/resources/benchmarks.ts
1236
- function unwrap7(data) {
1558
+ function unwrap9(data) {
1237
1559
  if (data && typeof data === "object") {
1238
1560
  const d = data;
1239
1561
  for (const k of ["data", "benchmarks", "samples", "items"]) {
@@ -1265,19 +1587,19 @@ var Benchmarks = class {
1265
1587
  return unwrapList(data);
1266
1588
  }
1267
1589
  async get(benchmarkId) {
1268
- return unwrap7(
1590
+ return unwrap9(
1269
1591
  await this.http.get(`/admin/benchmarks/${benchmarkId}`)
1270
1592
  );
1271
1593
  }
1272
1594
  /** Start a new benchmark run — pass kind and run-specific options. */
1273
1595
  async create(params) {
1274
- const body4 = Object.fromEntries(
1596
+ const body5 = Object.fromEntries(
1275
1597
  Object.entries(params).filter(([, v]) => v !== void 0)
1276
1598
  );
1277
- return unwrap7(await this.http.post("/admin/benchmarks", body4));
1599
+ return unwrap9(await this.http.post("/admin/benchmarks", body5));
1278
1600
  }
1279
1601
  async cancel(benchmarkId) {
1280
- return unwrap7(
1602
+ return unwrap9(
1281
1603
  await this.http.post(`/admin/benchmarks/${benchmarkId}/cancel`)
1282
1604
  );
1283
1605
  }
@@ -1294,17 +1616,17 @@ var Benchmarks = class {
1294
1616
  }
1295
1617
  /** Compare two benchmark runs. */
1296
1618
  async compare(params) {
1297
- const body4 = Object.fromEntries(
1619
+ const body5 = Object.fromEntries(
1298
1620
  Object.entries(params).filter(([, v]) => v !== void 0)
1299
1621
  );
1300
- return unwrap7(
1301
- await this.http.post("/admin/benchmarks/compare", body4)
1622
+ return unwrap9(
1623
+ await this.http.post("/admin/benchmarks/compare", body5)
1302
1624
  );
1303
1625
  }
1304
1626
  };
1305
1627
 
1306
1628
  // src/resources/builder-sessions.ts
1307
- function unwrap8(data) {
1629
+ function unwrap10(data) {
1308
1630
  if (data && typeof data === "object") {
1309
1631
  const d = data;
1310
1632
  for (const k of ["data", "sessions", "items"]) {
@@ -1341,7 +1663,7 @@ var BuilderSessions = class {
1341
1663
  return all.find((s) => s.id === sessionId) ?? {};
1342
1664
  }
1343
1665
  async updateTitle(sessionId, title) {
1344
- return unwrap8(
1666
+ return unwrap10(
1345
1667
  await this.http.patch(`/builder/sessions/${sessionId}/title`, {
1346
1668
  title
1347
1669
  })
@@ -1353,7 +1675,7 @@ var BuilderSessions = class {
1353
1675
  };
1354
1676
 
1355
1677
  // src/resources/channels.ts
1356
- function unwrap9(payload) {
1678
+ function unwrap11(payload) {
1357
1679
  if (payload && typeof payload === "object") {
1358
1680
  const p = payload;
1359
1681
  for (const k of ["data", "channels", "notifications", "items"]) {
@@ -1362,7 +1684,7 @@ function unwrap9(payload) {
1362
1684
  }
1363
1685
  return payload;
1364
1686
  }
1365
- function stripUndefined6(input) {
1687
+ function stripUndefined8(input) {
1366
1688
  return Object.fromEntries(
1367
1689
  Object.entries(input).filter(([, v]) => v !== void 0)
1368
1690
  );
@@ -1379,28 +1701,28 @@ var Channels = class {
1379
1701
  http;
1380
1702
  /** List all channels for the tenant. */
1381
1703
  async list(params = {}) {
1382
- const query3 = stripUndefined6(params);
1704
+ const query3 = stripUndefined8(params);
1383
1705
  const data = await this.http.get("/channels", query3);
1384
- const result = unwrap9(data);
1706
+ const result = unwrap11(data);
1385
1707
  if (Array.isArray(result)) return result;
1386
1708
  return [];
1387
1709
  }
1388
1710
  /** Get a single channel. */
1389
1711
  async get(channelId) {
1390
1712
  const data = await this.http.get(`/channels/${channelId}`);
1391
- return unwrap9(data);
1713
+ return unwrap11(data);
1392
1714
  }
1393
1715
  /** Create a new channel. */
1394
1716
  async create(params) {
1395
- const body4 = stripUndefObj(params);
1396
- const data = await this.http.post("/channels", body4);
1397
- return unwrap9(data);
1717
+ const body5 = stripUndefObj(params);
1718
+ const data = await this.http.post("/channels", body5);
1719
+ return unwrap11(data);
1398
1720
  }
1399
1721
  /** Update a channel. */
1400
1722
  async update(channelId, params) {
1401
- const body4 = stripUndefObj(params);
1402
- const data = await this.http.patch(`/channels/${channelId}`, body4);
1403
- return unwrap9(data);
1723
+ const body5 = stripUndefObj(params);
1724
+ const data = await this.http.patch(`/channels/${channelId}`, body5);
1725
+ return unwrap11(data);
1404
1726
  }
1405
1727
  /** Delete a channel. */
1406
1728
  async delete(channelId) {
@@ -1410,42 +1732,42 @@ var Channels = class {
1410
1732
  /** Get notification preferences across all channels. */
1411
1733
  async listNotifications() {
1412
1734
  const data = await this.http.get("/channels/notifications");
1413
- return unwrap9(data);
1735
+ return unwrap11(data);
1414
1736
  }
1415
1737
  /** Update notification preferences. */
1416
1738
  async updateNotifications(params) {
1417
- const body4 = stripUndefObj(params);
1418
- const data = await this.http.put("/channels/notifications", body4);
1419
- return unwrap9(data);
1739
+ const body5 = stripUndefObj(params);
1740
+ const data = await this.http.put("/channels/notifications", body5);
1741
+ return unwrap11(data);
1420
1742
  }
1421
1743
  /** Enable a channel. */
1422
1744
  async enable(channelId) {
1423
1745
  const data = await this.http.post(`/channels/${channelId}/enable`);
1424
- return unwrap9(data);
1746
+ return unwrap11(data);
1425
1747
  }
1426
1748
  /** Disable a channel. */
1427
1749
  async disable(channelId) {
1428
1750
  const data = await this.http.post(
1429
1751
  `/channels/${channelId}/disable`
1430
1752
  );
1431
- return unwrap9(data);
1753
+ return unwrap11(data);
1432
1754
  }
1433
1755
  };
1434
1756
 
1435
1757
  // src/resources/cloud.ts
1436
- function unwrap10(payload) {
1758
+ function unwrap12(payload) {
1437
1759
  if (payload !== null && typeof payload === "object" && "data" in payload && payload.data !== void 0) {
1438
1760
  return payload.data;
1439
1761
  }
1440
1762
  return payload;
1441
1763
  }
1442
- function stripUndefined7(input) {
1764
+ function stripUndefined9(input) {
1443
1765
  return Object.fromEntries(
1444
1766
  Object.entries(input).filter(([, value]) => value !== void 0)
1445
1767
  );
1446
1768
  }
1447
1769
  function accountBody(params) {
1448
- return stripUndefined7({
1770
+ return stripUndefined9({
1449
1771
  provider: params.provider,
1450
1772
  mode: params.mode,
1451
1773
  display_name: params.displayName ?? params.display_name,
@@ -1456,7 +1778,7 @@ function accountBody(params) {
1456
1778
  });
1457
1779
  }
1458
1780
  function regionBody(params) {
1459
- return stripUndefined7({
1781
+ return stripUndefined9({
1460
1782
  cloud_account_id: params.cloudAccountId ?? params.cloud_account_id,
1461
1783
  provider_region: params.providerRegion ?? params.provider_region,
1462
1784
  provider_zone: params.providerZone ?? params.provider_zone,
@@ -1471,7 +1793,7 @@ function regionBody(params) {
1471
1793
  });
1472
1794
  }
1473
1795
  function poolBody(params) {
1474
- return stripUndefined7({
1796
+ return stripUndefined9({
1475
1797
  cloud_region_id: params.cloudRegionId ?? params.cloud_region_id,
1476
1798
  pool_kind: params.poolKind ?? params.pool_kind,
1477
1799
  node_type: params.nodeType ?? params.node_type,
@@ -1485,7 +1807,7 @@ function poolBody(params) {
1485
1807
  });
1486
1808
  }
1487
1809
  function preflightBody(params) {
1488
- return stripUndefined7({
1810
+ return stripUndefined9({
1489
1811
  cloud_account_id: params.cloudAccountId ?? params.cloud_account_id,
1490
1812
  cloud_region_id: params.cloudRegionId ?? params.cloud_region_id,
1491
1813
  provider: params.provider,
@@ -1496,7 +1818,7 @@ function preflightBody(params) {
1496
1818
  });
1497
1819
  }
1498
1820
  function query(params = {}) {
1499
- return stripUndefined7({
1821
+ return stripUndefined9({
1500
1822
  cloud_account_id: params.cloudAccountId ?? params.cloud_account_id,
1501
1823
  cloud_region_id: params.cloudRegionId ?? params.cloud_region_id,
1502
1824
  limit: params.limit
@@ -1508,12 +1830,12 @@ var Cloud = class {
1508
1830
  }
1509
1831
  http;
1510
1832
  async listAccounts() {
1511
- return unwrap10(
1833
+ return unwrap12(
1512
1834
  await this.http.get("/cloud/accounts")
1513
1835
  );
1514
1836
  }
1515
1837
  async createAccount(params) {
1516
- return unwrap10(
1838
+ return unwrap12(
1517
1839
  await this.http.post(
1518
1840
  "/cloud/accounts",
1519
1841
  accountBody(params)
@@ -1521,10 +1843,10 @@ var Cloud = class {
1521
1843
  );
1522
1844
  }
1523
1845
  async attachAwsRole(id, params) {
1524
- return unwrap10(
1846
+ return unwrap12(
1525
1847
  await this.http.post(
1526
1848
  `/cloud/accounts/${encodeURIComponent(id)}/aws/role`,
1527
- stripUndefined7({
1849
+ stripUndefined9({
1528
1850
  role_arn: params.roleArn ?? params.role_arn,
1529
1851
  default_region: params.defaultRegion ?? params.default_region
1530
1852
  })
@@ -1532,7 +1854,7 @@ var Cloud = class {
1532
1854
  );
1533
1855
  }
1534
1856
  async listRegions(params = {}) {
1535
- return unwrap10(
1857
+ return unwrap12(
1536
1858
  await this.http.get(
1537
1859
  "/cloud/regions",
1538
1860
  query(params)
@@ -1540,7 +1862,7 @@ var Cloud = class {
1540
1862
  );
1541
1863
  }
1542
1864
  async createRegion(params) {
1543
- return unwrap10(
1865
+ return unwrap12(
1544
1866
  await this.http.post(
1545
1867
  "/cloud/regions",
1546
1868
  regionBody(params)
@@ -1548,12 +1870,12 @@ var Cloud = class {
1548
1870
  );
1549
1871
  }
1550
1872
  async listPools(params = {}) {
1551
- return unwrap10(
1873
+ return unwrap12(
1552
1874
  await this.http.get("/cloud/pools", query(params))
1553
1875
  );
1554
1876
  }
1555
1877
  async createPool(params) {
1556
- return unwrap10(
1878
+ return unwrap12(
1557
1879
  await this.http.post(
1558
1880
  "/cloud/pools",
1559
1881
  poolBody(params)
@@ -1561,7 +1883,7 @@ var Cloud = class {
1561
1883
  );
1562
1884
  }
1563
1885
  async listPreflights(params = {}) {
1564
- return unwrap10(
1886
+ return unwrap12(
1565
1887
  await this.http.get(
1566
1888
  "/cloud/preflights",
1567
1889
  query(params)
@@ -1569,7 +1891,7 @@ var Cloud = class {
1569
1891
  );
1570
1892
  }
1571
1893
  async recordPreflight(params) {
1572
- return unwrap10(
1894
+ return unwrap12(
1573
1895
  await this.http.post(
1574
1896
  "/cloud/preflights",
1575
1897
  preflightBody(params)
@@ -1579,7 +1901,7 @@ var Cloud = class {
1579
1901
  };
1580
1902
 
1581
1903
  // src/resources/command-center.ts
1582
- function unwrap11(data) {
1904
+ function unwrap13(data) {
1583
1905
  if (data && typeof data === "object") {
1584
1906
  const d = data;
1585
1907
  for (const k of [
@@ -1613,7 +1935,7 @@ var CommandCenter = class {
1613
1935
  http;
1614
1936
  /** Top-level snapshot (GET /command-center). */
1615
1937
  async overview() {
1616
- return unwrap11(await this.http.get("/command-center"));
1938
+ return unwrap13(await this.http.get("/command-center"));
1617
1939
  }
1618
1940
  async agents() {
1619
1941
  return unwrapList3(await this.http.get("/command-center/agents"));
@@ -1624,13 +1946,13 @@ var CommandCenter = class {
1624
1946
  );
1625
1947
  }
1626
1948
  async metrics() {
1627
- return unwrap11(await this.http.get("/command-center/metrics"));
1949
+ return unwrap13(await this.http.get("/command-center/metrics"));
1628
1950
  }
1629
1951
  async presets() {
1630
1952
  return unwrapList3(await this.http.get("/command-center/presets"));
1631
1953
  }
1632
1954
  async tiers() {
1633
- return unwrap11(await this.http.get("/command-center/tiers"));
1955
+ return unwrap13(await this.http.get("/command-center/tiers"));
1634
1956
  }
1635
1957
  /** Stream live command-center events via SSE. */
1636
1958
  events() {
@@ -1639,7 +1961,7 @@ var CommandCenter = class {
1639
1961
  };
1640
1962
 
1641
1963
  // src/resources/community.ts
1642
- function unwrap12(data) {
1964
+ function unwrap14(data) {
1643
1965
  if (data && typeof data === "object") {
1644
1966
  const d = data;
1645
1967
  for (const k of ["data", "templates", "agents", "items"]) {
@@ -1671,7 +1993,7 @@ var Community = class {
1671
1993
  return unwrapList4(await this.http.get("/community/agents", query3));
1672
1994
  }
1673
1995
  async getAgent(agentId) {
1674
- return unwrap12(await this.http.get(`/community/agents/${agentId}`));
1996
+ return unwrap14(await this.http.get(`/community/agents/${agentId}`));
1675
1997
  }
1676
1998
  // ── Templates ─────────────────────────────────────────────────────────
1677
1999
  async listTemplates(filters = {}) {
@@ -1683,41 +2005,41 @@ var Community = class {
1683
2005
  );
1684
2006
  }
1685
2007
  async getTemplate(templateId) {
1686
- return unwrap12(
2008
+ return unwrap14(
1687
2009
  await this.http.get(`/community/templates/${templateId}`)
1688
2010
  );
1689
2011
  }
1690
2012
  /** Install a community template into the caller's tenant. */
1691
2013
  async installTemplate(templateId, opts = {}) {
1692
- const body4 = Object.fromEntries(
2014
+ const body5 = Object.fromEntries(
1693
2015
  Object.entries(opts).filter(([, v]) => v !== void 0)
1694
2016
  );
1695
- return unwrap12(
2017
+ return unwrap14(
1696
2018
  await this.http.post(
1697
2019
  `/community/templates/${templateId}/install`,
1698
- body4
2020
+ body5
1699
2021
  )
1700
2022
  );
1701
2023
  }
1702
2024
  /** Rate a community template (1–5). */
1703
2025
  async rateTemplate(templateId, rating, opts = {}) {
1704
- const body4 = {
2026
+ const body5 = {
1705
2027
  rating,
1706
2028
  ...Object.fromEntries(
1707
2029
  Object.entries(opts).filter(([, v]) => v !== void 0)
1708
2030
  )
1709
2031
  };
1710
- return unwrap12(
2032
+ return unwrap14(
1711
2033
  await this.http.post(
1712
2034
  `/community/templates/${templateId}/rate`,
1713
- body4
2035
+ body5
1714
2036
  )
1715
2037
  );
1716
2038
  }
1717
2039
  };
1718
2040
 
1719
2041
  // src/resources/completions.ts
1720
- function unwrap13(data) {
2042
+ function unwrap15(data) {
1721
2043
  if (data && typeof data === "object") {
1722
2044
  const d = data;
1723
2045
  if (Array.isArray(d.choices)) return d;
@@ -1736,24 +2058,24 @@ var Completions = class {
1736
2058
  }
1737
2059
  http;
1738
2060
  create(params) {
1739
- const body4 = buildBody(params);
2061
+ const body5 = buildBody(params);
1740
2062
  if (params.stream === true) {
1741
2063
  return this.http.stream(
1742
2064
  "/intelligence/completions",
1743
- { method: "POST", body: body4 }
2065
+ { method: "POST", body: body5 }
1744
2066
  );
1745
2067
  }
1746
- return this.http.post("/intelligence/completions", body4).then(unwrap13);
2068
+ return this.http.post("/intelligence/completions", body5).then(unwrap15);
1747
2069
  }
1748
2070
  chat(params) {
1749
- const body4 = buildBody(params);
2071
+ const body5 = buildBody(params);
1750
2072
  if (params.stream === true) {
1751
2073
  return this.http.stream(
1752
2074
  "/intelligence/chat/completions",
1753
- { method: "POST", body: body4 }
2075
+ { method: "POST", body: body5 }
1754
2076
  );
1755
2077
  }
1756
- return this.http.post("/intelligence/chat/completions", body4).then(unwrap13);
2078
+ return this.http.post("/intelligence/chat/completions", body5).then(unwrap15);
1757
2079
  }
1758
2080
  };
1759
2081
 
@@ -1876,7 +2198,7 @@ var Checkpoints = class {
1876
2198
  };
1877
2199
 
1878
2200
  // src/resources/computer-auto-stop.ts
1879
- function unwrap14(data) {
2201
+ function unwrap16(data) {
1880
2202
  if (data && typeof data === "object") {
1881
2203
  const d = data;
1882
2204
  if ("data" in d && Object.keys(d).length <= 2) {
@@ -1894,13 +2216,13 @@ var ComputerAutoStop = class {
1894
2216
  computerId;
1895
2217
  /** Return the current auto-stop configuration. */
1896
2218
  async get() {
1897
- return unwrap14(
2219
+ return unwrap16(
1898
2220
  await this.http.get(`/computers/${this.computerId}/auto-stop`)
1899
2221
  );
1900
2222
  }
1901
2223
  /** Set the idle timeout in seconds (0 disables auto-stop). */
1902
2224
  async update(seconds) {
1903
- return unwrap14(
2225
+ return unwrap16(
1904
2226
  await this.http.patch(
1905
2227
  `/computers/${this.computerId}/auto-stop`,
1906
2228
  { seconds }
@@ -1910,7 +2232,7 @@ var ComputerAutoStop = class {
1910
2232
  };
1911
2233
 
1912
2234
  // src/resources/computer-env.ts
1913
- function unwrap15(data) {
2235
+ function unwrap17(data) {
1914
2236
  if (data && typeof data === "object") {
1915
2237
  const d = data;
1916
2238
  if ("data" in d && Object.keys(d).length <= 2) {
@@ -1945,11 +2267,11 @@ var ComputerEnv = class {
1945
2267
  }
1946
2268
  /** Create a new env var. Use update() to change an existing one. */
1947
2269
  async set(name, value) {
1948
- return unwrap15(await this.http.post(this.base(), { name, value }));
2270
+ return unwrap17(await this.http.post(this.base(), { name, value }));
1949
2271
  }
1950
2272
  /** Patch the value of an existing env var by name. */
1951
2273
  async update(name, value) {
1952
- return unwrap15(
2274
+ return unwrap17(
1953
2275
  await this.http.patch(`${this.base()}/${name}`, { value })
1954
2276
  );
1955
2277
  }
@@ -1966,7 +2288,7 @@ var ComputerEnv = class {
1966
2288
  };
1967
2289
 
1968
2290
  // src/resources/computer-logs.ts
1969
- function unwrap16(data) {
2291
+ function unwrap18(data) {
1970
2292
  if (data && typeof data === "object") {
1971
2293
  const d = data;
1972
2294
  if ("data" in d && Object.keys(d).length <= 2) {
@@ -1987,7 +2309,7 @@ var ComputerLogs = class {
1987
2309
  const query3 = Object.fromEntries(
1988
2310
  Object.entries(params).filter(([, v]) => v !== void 0)
1989
2311
  );
1990
- return unwrap16(
2312
+ return unwrap18(
1991
2313
  await this.http.get(`/computers/${this.computerId}/logs`, query3)
1992
2314
  );
1993
2315
  }
@@ -2000,7 +2322,7 @@ var ComputerLogs = class {
2000
2322
  };
2001
2323
 
2002
2324
  // src/resources/computer-osa.ts
2003
- function unwrap17(data) {
2325
+ function unwrap19(data) {
2004
2326
  if (data && typeof data === "object") {
2005
2327
  const d = data;
2006
2328
  if ("data" in d && Object.keys(d).length <= 2) {
@@ -2018,47 +2340,47 @@ var ComputerOsa = class {
2018
2340
  computerId;
2019
2341
  /** Submit a free-form task to the in-VM OSA agent. */
2020
2342
  async submitTask(task, params = {}) {
2021
- const body4 = {
2343
+ const body5 = {
2022
2344
  task,
2023
2345
  ...Object.fromEntries(
2024
2346
  Object.entries(params).filter(([, v]) => v !== void 0)
2025
2347
  )
2026
2348
  };
2027
- return unwrap17(
2349
+ return unwrap19(
2028
2350
  await this.http.post(
2029
2351
  `/computers/${this.computerId}/osa/task`,
2030
- body4
2352
+ body5
2031
2353
  )
2032
2354
  );
2033
2355
  }
2034
2356
  /** Cancel the currently-running OSA task, if any. */
2035
2357
  async cancelTask() {
2036
- return unwrap17(
2358
+ return unwrap19(
2037
2359
  await this.http.delete(`/computers/${this.computerId}/osa/task`)
2038
2360
  );
2039
2361
  }
2040
2362
  /** Return OSA's current task / configuration / health snapshot. */
2041
2363
  async status() {
2042
- return unwrap17(
2364
+ return unwrap19(
2043
2365
  await this.http.get(`/computers/${this.computerId}/osa/status`)
2044
2366
  );
2045
2367
  }
2046
2368
  /** Update OSA runtime configuration (model, tools, secrets, etc.). */
2047
2369
  async configure(config) {
2048
- const body4 = Object.fromEntries(
2370
+ const body5 = Object.fromEntries(
2049
2371
  Object.entries(config).filter(([, v]) => v !== void 0)
2050
2372
  );
2051
- return unwrap17(
2373
+ return unwrap19(
2052
2374
  await this.http.post(
2053
2375
  `/computers/${this.computerId}/osa/configure`,
2054
- body4
2376
+ body5
2055
2377
  )
2056
2378
  );
2057
2379
  }
2058
2380
  };
2059
2381
 
2060
2382
  // src/resources/computer-ports.ts
2061
- function unwrap18(data) {
2383
+ function unwrap20(data) {
2062
2384
  if (data && typeof data === "object") {
2063
2385
  const d = data;
2064
2386
  if ("data" in d && Object.keys(d).length <= 2) {
@@ -2097,21 +2419,21 @@ var ComputerPorts = class {
2097
2419
  }
2098
2420
  /** Expose port with the given visibility options. */
2099
2421
  async create(port, opts = {}) {
2100
- const body4 = {
2422
+ const body5 = {
2101
2423
  port,
2102
2424
  ...Object.fromEntries(
2103
2425
  Object.entries(opts).filter(([, v]) => v !== void 0)
2104
2426
  )
2105
2427
  };
2106
- return unwrap18(await this.http.post(this.base(), body4));
2428
+ return unwrap20(await this.http.post(this.base(), body5));
2107
2429
  }
2108
2430
  /** Patch visibility / auth options for port. */
2109
2431
  async update(port, opts) {
2110
- const body4 = Object.fromEntries(
2432
+ const body5 = Object.fromEntries(
2111
2433
  Object.entries(opts).filter(([, v]) => v !== void 0)
2112
2434
  );
2113
- return unwrap18(
2114
- await this.http.patch(`${this.base()}/${port}`, body4)
2435
+ return unwrap20(
2436
+ await this.http.patch(`${this.base()}/${port}`, body5)
2115
2437
  );
2116
2438
  }
2117
2439
  /** Stop exposing port. */
@@ -2130,14 +2452,14 @@ var ComputerTerminal = class {
2130
2452
  computerId;
2131
2453
  /** Open a new PTY session. Returns the server payload (session id, etc.). */
2132
2454
  async create(params = {}) {
2133
- const body4 = Object.fromEntries(
2455
+ const body5 = Object.fromEntries(
2134
2456
  Object.entries(params).filter(([, v]) => v !== void 0)
2135
2457
  );
2136
2458
  const raw = await this.http.post(
2137
2459
  `/computers/${this.computerId}/terminal`,
2138
- body4
2460
+ body5
2139
2461
  );
2140
- return unwrap19(raw);
2462
+ return unwrap21(raw);
2141
2463
  }
2142
2464
  /** Resize an existing PTY session. */
2143
2465
  async resize(sessionId, cols, rows) {
@@ -2145,10 +2467,10 @@ var ComputerTerminal = class {
2145
2467
  `/computers/${this.computerId}/pty/${sessionId}/resize`,
2146
2468
  { cols, rows }
2147
2469
  );
2148
- return unwrap19(raw);
2470
+ return unwrap21(raw);
2149
2471
  }
2150
2472
  };
2151
- function unwrap19(data) {
2473
+ function unwrap21(data) {
2152
2474
  if (data && typeof data === "object") {
2153
2475
  const d = data;
2154
2476
  if ("data" in d && Object.keys(d).length <= 2) {
@@ -2159,7 +2481,7 @@ function unwrap19(data) {
2159
2481
  }
2160
2482
 
2161
2483
  // src/resources/computer-volumes.ts
2162
- function unwrap20(data) {
2484
+ function unwrap22(data) {
2163
2485
  if (data && typeof data === "object") {
2164
2486
  const d = data;
2165
2487
  if ("data" in d && Object.keys(d).length <= 2) {
@@ -2193,7 +2515,7 @@ var ComputerVolumes = class {
2193
2515
  }
2194
2516
  /** Attach volumeId at mountPath inside the VM. */
2195
2517
  async attach(volumeId, mountPath) {
2196
- return unwrap20(
2518
+ return unwrap22(
2197
2519
  await this.http.post(this.base(), {
2198
2520
  volume_id: volumeId,
2199
2521
  mount_path: mountPath
@@ -2207,7 +2529,7 @@ var ComputerVolumes = class {
2207
2529
  };
2208
2530
 
2209
2531
  // src/resources/connectors.ts
2210
- function unwrap21(payload) {
2532
+ function unwrap23(payload) {
2211
2533
  if (payload && typeof payload === "object") {
2212
2534
  const p = payload;
2213
2535
  for (const key of ["data", "binding"]) {
@@ -2226,7 +2548,7 @@ function unwrapList8(payload) {
2226
2548
  }
2227
2549
  return [];
2228
2550
  }
2229
- function stripUndefined8(input) {
2551
+ function stripUndefined10(input) {
2230
2552
  return Object.fromEntries(
2231
2553
  Object.entries(input).filter(([, value]) => value !== void 0)
2232
2554
  );
@@ -2249,7 +2571,7 @@ function externalAttributionParams(params = {}) {
2249
2571
  };
2250
2572
  }
2251
2573
  function queryFromListParams(params) {
2252
- return stripUndefined8({
2574
+ return stripUndefined10({
2253
2575
  scope: params.scope,
2254
2576
  workspace_id: pickFirst(params.workspaceId, params.workspace_id),
2255
2577
  owner_user_id: pickFirst(params.ownerUserId, params.owner_user_id),
@@ -2265,7 +2587,7 @@ function bodyFromCreateParams(provider, params) {
2265
2587
  params.api_key,
2266
2588
  credential?.value
2267
2589
  );
2268
- return stripUndefined8({
2590
+ return stripUndefined10({
2269
2591
  provider,
2270
2592
  type: String(params.type ?? "api_key").replaceAll("-", "_"),
2271
2593
  name: params.name,
@@ -2286,7 +2608,7 @@ function bodyFromCreateParams(provider, params) {
2286
2608
  });
2287
2609
  }
2288
2610
  function tokenBody(params = {}) {
2289
- return stripUndefined8({
2611
+ return stripUndefined10({
2290
2612
  subject: params.subject ?? { type: "app" },
2291
2613
  installation_id: pickFirst(params.installationId, params.installation_id),
2292
2614
  project_id: pickFirst(params.projectId, params.project_id),
@@ -2303,7 +2625,7 @@ function tokenBody(params = {}) {
2303
2625
  });
2304
2626
  }
2305
2627
  function queryFromLinkParams(params = {}) {
2306
- return stripUndefined8({
2628
+ return stripUndefined10({
2307
2629
  workspace_id: pickFirst(params.workspaceId, params.workspace_id),
2308
2630
  project_id: pickFirst(params.projectId, params.project_id),
2309
2631
  connector_id: pickFirst(params.connectorId, params.connector_id),
@@ -2313,14 +2635,14 @@ function queryFromLinkParams(params = {}) {
2313
2635
  });
2314
2636
  }
2315
2637
  function queryFromDefaultParams(params = {}) {
2316
- return stripUndefined8({
2638
+ return stripUndefined10({
2317
2639
  ...queryFromLinkParams(params),
2318
2640
  default_scope: pickFirst(params.defaultScope, params.default_scope),
2319
2641
  target: params.target
2320
2642
  });
2321
2643
  }
2322
2644
  function queryFromApplicableDefaultParams(params = {}) {
2323
- return stripUndefined8({
2645
+ return stripUndefined10({
2324
2646
  workspace_id: pickFirst(params.workspaceId, params.workspace_id),
2325
2647
  project_id: pickFirst(params.projectId, params.project_id),
2326
2648
  environment: params.environment,
@@ -2331,7 +2653,7 @@ function queryFromApplicableDefaultParams(params = {}) {
2331
2653
  });
2332
2654
  }
2333
2655
  function materializeDefaultsBody(params = {}) {
2334
- return stripUndefined8({
2656
+ return stripUndefined10({
2335
2657
  workspace_id: pickFirst(params.workspaceId, params.workspace_id),
2336
2658
  project_id: pickFirst(params.projectId, params.project_id),
2337
2659
  environment: params.environment,
@@ -2343,7 +2665,7 @@ function materializeDefaultsBody(params = {}) {
2343
2665
  });
2344
2666
  }
2345
2667
  function projectLinkBody(params) {
2346
- return stripUndefined8({
2668
+ return stripUndefined10({
2347
2669
  connector: params.connector,
2348
2670
  connector_id: pickFirst(params.connectorId, params.connector_id),
2349
2671
  installation_id: pickFirst(params.installationId, params.installation_id),
@@ -2364,14 +2686,14 @@ function projectLinkBody(params) {
2364
2686
  });
2365
2687
  }
2366
2688
  function defaultBody(params) {
2367
- return stripUndefined8({
2689
+ return stripUndefined10({
2368
2690
  ...projectLinkBody(params),
2369
2691
  default_scope: pickFirst(params.defaultScope, params.default_scope),
2370
2692
  target: params.target
2371
2693
  });
2372
2694
  }
2373
2695
  function triggerBody(params) {
2374
- return stripUndefined8({
2696
+ return stripUndefined10({
2375
2697
  connector: params.connector,
2376
2698
  connector_id: pickFirst(params.connectorId, params.connector_id),
2377
2699
  workspace_id: pickFirst(params.workspaceId, params.workspace_id),
@@ -2391,7 +2713,7 @@ function triggerBody(params) {
2391
2713
  });
2392
2714
  }
2393
2715
  function queryFromTriggerDeliveryParams(params = {}) {
2394
- return stripUndefined8({
2716
+ return stripUndefined10({
2395
2717
  ...queryFromLinkParams(params),
2396
2718
  trigger_id: pickFirst(params.triggerId, params.trigger_id),
2397
2719
  event_type: pickFirst(params.eventType, params.event_type)
@@ -2418,7 +2740,7 @@ var Connectors = class {
2418
2740
  const data = await this.http.get(
2419
2741
  `/connect/connectors/${connectorPath(connector)}`
2420
2742
  );
2421
- return unwrap21(data);
2743
+ return unwrap23(data);
2422
2744
  }
2423
2745
  show(connector) {
2424
2746
  return this.get(connector);
@@ -2429,7 +2751,7 @@ var Connectors = class {
2429
2751
  "/connect/connectors",
2430
2752
  bodyFromCreateParams(provider, params)
2431
2753
  );
2432
- return unwrap21(data);
2754
+ return unwrap23(data);
2433
2755
  }
2434
2756
  /** Request a runtime provider token for a connector. */
2435
2757
  async getToken(connector, params = {}) {
@@ -2437,7 +2759,7 @@ var Connectors = class {
2437
2759
  `/connect/token/${connectorPath(connector)}`,
2438
2760
  tokenBody(params)
2439
2761
  );
2440
- return unwrap21(data);
2762
+ return unwrap23(data);
2441
2763
  }
2442
2764
  token(connector, params = {}) {
2443
2765
  return this.getToken(connector, params);
@@ -2451,7 +2773,7 @@ var Connectors = class {
2451
2773
  async startOauth(params) {
2452
2774
  const data = await this.http.post(
2453
2775
  "/connect/oauth/start",
2454
- stripUndefined8({
2776
+ stripUndefined10({
2455
2777
  provider: params.provider,
2456
2778
  scope: params.scope,
2457
2779
  expose_as_env: pickFirst(params.exposeAsEnv, params.expose_as_env),
@@ -2459,7 +2781,7 @@ var Connectors = class {
2459
2781
  ...externalAttributionParams(params)
2460
2782
  })
2461
2783
  );
2462
- return unwrap21(data);
2784
+ return unwrap23(data);
2463
2785
  }
2464
2786
  /** List connector installations/grants. */
2465
2787
  async installations(params = {}) {
@@ -2499,7 +2821,7 @@ var Connectors = class {
2499
2821
  "/connect/defaults/materialize",
2500
2822
  materializeDefaultsBody(params)
2501
2823
  );
2502
- return unwrap21(data);
2824
+ return unwrap23(data);
2503
2825
  }
2504
2826
  /** Create an inherited connector default for future runtime resources. */
2505
2827
  async createDefault(params) {
@@ -2507,7 +2829,7 @@ var Connectors = class {
2507
2829
  "/connect/defaults",
2508
2830
  defaultBody(params)
2509
2831
  );
2510
- return unwrap21(data);
2832
+ return unwrap23(data);
2511
2833
  }
2512
2834
  /** Delete an inherited connector default. */
2513
2835
  async deleteDefault(id) {
@@ -2527,7 +2849,7 @@ var Connectors = class {
2527
2849
  "/connect/triggers",
2528
2850
  triggerBody(params)
2529
2851
  );
2530
- return unwrap21(data);
2852
+ return unwrap23(data);
2531
2853
  }
2532
2854
  /** List inbound provider trigger delivery attempts. */
2533
2855
  async triggerDeliveries(params = {}) {
@@ -2554,7 +2876,7 @@ var Connectors = class {
2554
2876
  "/connect/project-links",
2555
2877
  projectLinkBody(params)
2556
2878
  );
2557
- return unwrap21(data);
2879
+ return unwrap23(data);
2558
2880
  }
2559
2881
  /** Delete a project connector link. */
2560
2882
  async deleteProjectLink(id) {
@@ -2577,7 +2899,7 @@ var RuntimeConnectors = class {
2577
2899
  async attach(params) {
2578
2900
  const data = await this.http.post(
2579
2901
  this.basePath,
2580
- stripUndefined8({
2902
+ stripUndefined10({
2581
2903
  connector: params.connector,
2582
2904
  env_name: params.env,
2583
2905
  mode: params.mode?.replaceAll("-", "_"),
@@ -2590,7 +2912,7 @@ var RuntimeConnectors = class {
2590
2912
  ...externalAttributionParams(params)
2591
2913
  })
2592
2914
  );
2593
- return unwrap21(data);
2915
+ return unwrap23(data);
2594
2916
  }
2595
2917
  /** Detach a connector binding by binding id or connector UID. */
2596
2918
  async detach(bindingOrConnector) {
@@ -2599,15 +2921,15 @@ var RuntimeConnectors = class {
2599
2921
  /** Sync or materialize connector placeholder env vars for this runtime resource. */
2600
2922
  async sync() {
2601
2923
  const data = await this.http.post(`${this.basePath}/sync`, {});
2602
- return unwrap21(data);
2924
+ return unwrap23(data);
2603
2925
  }
2604
2926
  /** Verify a required connector is attached before agent work begins. */
2605
2927
  async preflight(params = {}) {
2606
2928
  const data = await this.http.post(
2607
2929
  `${this.basePath}/preflight`,
2608
- stripUndefined8(params)
2930
+ stripUndefined10(params)
2609
2931
  );
2610
- return unwrap21(data);
2932
+ return unwrap23(data);
2611
2933
  }
2612
2934
  };
2613
2935
  var SandboxConnectors = class extends RuntimeConnectors {
@@ -2716,6 +3038,18 @@ var Desktop = class {
2716
3038
  button
2717
3039
  });
2718
3040
  }
3041
+ /** Explicit left-button click. Alias for click(x, y, "left"). */
3042
+ async leftClick(x, y) {
3043
+ return this.click(x, y, "left");
3044
+ }
3045
+ /** Right-button click. Alias for click(x, y, "right"). */
3046
+ async rightClick(x, y) {
3047
+ return this.click(x, y, "right");
3048
+ }
3049
+ /** Middle-button click. Alias for click(x, y, "middle"). */
3050
+ async middleClick(x, y) {
3051
+ return this.click(x, y, "middle");
3052
+ }
2719
3053
  /** Double-click at the given coordinates. */
2720
3054
  async doubleClick(x, y) {
2721
3055
  const params = { x, y };
@@ -2724,16 +3058,28 @@ var Desktop = class {
2724
3058
  params
2725
3059
  );
2726
3060
  }
3061
+ /** Move the mouse pointer without clicking. */
3062
+ async moveMouse(x, y) {
3063
+ return this.http.post(`${this.base()}/move`, { x, y });
3064
+ }
2727
3065
  /** Type text into the currently focused element. */
2728
3066
  async type(text, delay) {
2729
3067
  const params = { text, ...delay !== void 0 && { delay } };
2730
3068
  return this.http.post(`${this.base()}/type`, params);
2731
3069
  }
3070
+ /** Alias for `type(text)` used by simple computer-control loops. */
3071
+ async write(text, delay) {
3072
+ return this.type(text, delay);
3073
+ }
2732
3074
  /** Send a key or key combination (e.g. "Enter", "ctrl+c"). */
2733
3075
  async key(key) {
2734
3076
  const params = { key };
2735
3077
  return this.http.post(`${this.base()}/key`, params);
2736
3078
  }
3079
+ /** Alias for `key(key)` used by simple computer-control loops. */
3080
+ async press(key) {
3081
+ return this.key(key);
3082
+ }
2737
3083
  /** Scroll in a direction at an optional position. */
2738
3084
  async scroll(direction, clicks = 3, x, y) {
2739
3085
  const params = {
@@ -2786,7 +3132,7 @@ var Desktop = class {
2786
3132
  };
2787
3133
 
2788
3134
  // src/resources/egressAudit.ts
2789
- function unwrap22(payload) {
3135
+ function unwrap24(payload) {
2790
3136
  if (payload && typeof payload === "object") {
2791
3137
  const p = payload;
2792
3138
  for (const k of ["data", "event", "items"]) {
@@ -2805,7 +3151,7 @@ function unwrapList9(payload) {
2805
3151
  }
2806
3152
  return [];
2807
3153
  }
2808
- function stripUndefined9(input) {
3154
+ function stripUndefined11(input) {
2809
3155
  return Object.fromEntries(
2810
3156
  Object.entries(input).filter(([, v]) => v !== void 0)
2811
3157
  );
@@ -2815,7 +3161,7 @@ function pickFirst2(...values) {
2815
3161
  return void 0;
2816
3162
  }
2817
3163
  function listQuery(params) {
2818
- return stripUndefined9({
3164
+ return stripUndefined11({
2819
3165
  resource_id: pickFirst2(params.resourceId, params.resource_id),
2820
3166
  resource_type: pickFirst2(params.resourceType, params.resource_type),
2821
3167
  host: params.host,
@@ -2831,7 +3177,7 @@ function listQuery(params) {
2831
3177
  )
2832
3178
  });
2833
3179
  }
2834
- function sleep4(ms) {
3180
+ function sleep6(ms) {
2835
3181
  return new Promise((resolve) => setTimeout(resolve, ms));
2836
3182
  }
2837
3183
  var EgressAudit = class {
@@ -2852,7 +3198,7 @@ var EgressAudit = class {
2852
3198
  const data = await this.http.get(
2853
3199
  `/egress/audit/${id}`
2854
3200
  );
2855
- return unwrap22(data);
3201
+ return unwrap24(data);
2856
3202
  }
2857
3203
  /**
2858
3204
  * Long-poll the audit endpoint and yield new events as they appear.
@@ -2880,7 +3226,7 @@ var EgressAudit = class {
2880
3226
  const ts = event.inserted_at ?? event.timestamp;
2881
3227
  if (typeof ts === "string") since = ts;
2882
3228
  }
2883
- await sleep4(pollMs);
3229
+ await sleep6(pollMs);
2884
3230
  }
2885
3231
  }
2886
3232
  };
@@ -2928,7 +3274,7 @@ var ComputerAudit = class extends SandboxAudit {
2928
3274
  };
2929
3275
 
2930
3276
  // src/resources/egressNetwork.ts
2931
- function unwrap23(payload) {
3277
+ function unwrap25(payload) {
2932
3278
  if (payload && typeof payload === "object") {
2933
3279
  const p = payload;
2934
3280
  for (const k of ["data", "policy", "rule", "items"]) {
@@ -2954,7 +3300,7 @@ function unwrapList10(payload) {
2954
3300
  }
2955
3301
  return [];
2956
3302
  }
2957
- function stripUndefined10(input) {
3303
+ function stripUndefined12(input) {
2958
3304
  return Object.fromEntries(
2959
3305
  Object.entries(input).filter(([, v]) => v !== void 0)
2960
3306
  );
@@ -2964,7 +3310,7 @@ function pickFirst3(...values) {
2964
3310
  return void 0;
2965
3311
  }
2966
3312
  function ruleBody(host, params, effect) {
2967
- return stripUndefined10({
3313
+ return stripUndefined12({
2968
3314
  host,
2969
3315
  effect,
2970
3316
  methods: params.methods,
@@ -2987,7 +3333,7 @@ var EgressNetwork = class {
2987
3333
  "/egress/allowlist",
2988
3334
  ruleBody(host, params, "allow")
2989
3335
  );
2990
- return unwrap23(data);
3336
+ return unwrap25(data);
2991
3337
  }
2992
3338
  /** Add a `deny` rule for `host` to the allowlist. */
2993
3339
  async deny(host, params = {}) {
@@ -2995,11 +3341,11 @@ var EgressNetwork = class {
2995
3341
  "/egress/allowlist",
2996
3342
  ruleBody(host, params, "deny")
2997
3343
  );
2998
- return unwrap23(data);
3344
+ return unwrap25(data);
2999
3345
  }
3000
3346
  /** List allowlist rules. */
3001
3347
  async rules(params = {}) {
3002
- const query3 = stripUndefined10({
3348
+ const query3 = stripUndefined12({
3003
3349
  policy_id: pickFirst3(params.policyId, params.policy_id),
3004
3350
  resource_id: pickFirst3(params.resourceId, params.resource_id),
3005
3351
  resource_type: pickFirst3(params.resourceType, params.resource_type)
@@ -3014,7 +3360,7 @@ var EgressNetwork = class {
3014
3360
  // ── policies ──────────────────────────────────────────────────────────────
3015
3361
  /** List egress policies. */
3016
3362
  async policies(params = {}) {
3017
- const query3 = stripUndefined10({
3363
+ const query3 = stripUndefined12({
3018
3364
  resource_id: pickFirst3(params.resourceId, params.resource_id),
3019
3365
  resource_type: pickFirst3(params.resourceType, params.resource_type)
3020
3366
  });
@@ -3023,7 +3369,7 @@ var EgressNetwork = class {
3023
3369
  }
3024
3370
  /** Create an egress policy. */
3025
3371
  async createPolicy(params) {
3026
- const body4 = stripUndefined10({
3372
+ const body5 = stripUndefined12({
3027
3373
  name: params.name,
3028
3374
  mode: params.mode ?? "enforce",
3029
3375
  default_effect: pickFirst3(
@@ -3037,13 +3383,13 @@ var EgressNetwork = class {
3037
3383
  });
3038
3384
  const data = await this.http.post(
3039
3385
  "/egress/policies",
3040
- body4
3386
+ body5
3041
3387
  );
3042
- return unwrap23(data);
3388
+ return unwrap25(data);
3043
3389
  }
3044
3390
  /** Update an egress policy by id. */
3045
3391
  async updatePolicy(policyId, params) {
3046
- const body4 = stripUndefined10({
3392
+ const body5 = stripUndefined12({
3047
3393
  mode: params.mode,
3048
3394
  default_effect: pickFirst3(params.defaultEffect, params.default_effect),
3049
3395
  name: params.name,
@@ -3051,9 +3397,9 @@ var EgressNetwork = class {
3051
3397
  });
3052
3398
  const data = await this.http.patch(
3053
3399
  `/egress/policies/${policyId}`,
3054
- body4
3400
+ body5
3055
3401
  );
3056
- return unwrap23(data);
3402
+ return unwrap25(data);
3057
3403
  }
3058
3404
  // ── mode helpers ──────────────────────────────────────────────────────────
3059
3405
  /** Set the policy to `mode="enforce"` — denied egress is blocked. */
@@ -3071,21 +3417,21 @@ var EgressNetwork = class {
3071
3417
  if (policyId) {
3072
3418
  return this.updatePolicy(policyId, { mode });
3073
3419
  }
3074
- const body4 = resourceId !== void 0 && resourceType !== void 0 ? stripUndefined10({
3420
+ const body5 = resourceId !== void 0 && resourceType !== void 0 ? stripUndefined12({
3075
3421
  mode,
3076
3422
  resource_id: resourceId,
3077
3423
  resource_type: resourceType
3078
3424
  }) : { mode };
3079
3425
  const data = await this.http.patch(
3080
3426
  "/egress/policies",
3081
- body4
3427
+ body5
3082
3428
  );
3083
- return unwrap23(data);
3429
+ return unwrap25(data);
3084
3430
  }
3085
3431
  // ── suggestions ───────────────────────────────────────────────────────────
3086
3432
  /** AI-generated allowlist suggestions from recent denied egress. */
3087
3433
  async suggestions(params = {}) {
3088
- const query3 = stripUndefined10({
3434
+ const query3 = stripUndefined12({
3089
3435
  resource_id: pickFirst3(params.resourceId, params.resource_id),
3090
3436
  resource_type: pickFirst3(params.resourceType, params.resource_type),
3091
3437
  since: params.since ?? "7d"
@@ -3136,28 +3482,28 @@ var SandboxNetwork = class {
3136
3482
  return this.delegate.removeRule(ruleId);
3137
3483
  }
3138
3484
  lockdown(params = {}) {
3139
- const body4 = {
3485
+ const body5 = {
3140
3486
  resource_id: this.resourceId,
3141
3487
  resource_type: this.resourceType
3142
3488
  };
3143
- if (params.policyId !== void 0) body4.policyId = params.policyId;
3144
- return this.delegate.lockdown(body4);
3489
+ if (params.policyId !== void 0) body5.policyId = params.policyId;
3490
+ return this.delegate.lockdown(body5);
3145
3491
  }
3146
3492
  observe(params = {}) {
3147
- const body4 = {
3493
+ const body5 = {
3148
3494
  resource_id: this.resourceId,
3149
3495
  resource_type: this.resourceType
3150
3496
  };
3151
- if (params.policyId !== void 0) body4.policyId = params.policyId;
3152
- return this.delegate.observe(body4);
3497
+ if (params.policyId !== void 0) body5.policyId = params.policyId;
3498
+ return this.delegate.observe(body5);
3153
3499
  }
3154
3500
  suggestions(params = {}) {
3155
- const body4 = {
3501
+ const body5 = {
3156
3502
  resource_id: this.resourceId,
3157
3503
  resource_type: this.resourceType
3158
3504
  };
3159
- if (params.since !== void 0) body4.since = params.since;
3160
- return this.delegate.suggestions(body4);
3505
+ if (params.since !== void 0) body5.since = params.since;
3506
+ return this.delegate.suggestions(body5);
3161
3507
  }
3162
3508
  policies() {
3163
3509
  return this.delegate.policies({
@@ -3171,7 +3517,7 @@ var ComputerNetwork = class extends SandboxNetwork {
3171
3517
  };
3172
3518
 
3173
3519
  // src/resources/egressSecrets.ts
3174
- function unwrap24(payload) {
3520
+ function unwrap26(payload) {
3175
3521
  if (payload && typeof payload === "object") {
3176
3522
  const p = payload;
3177
3523
  for (const k of ["data", "secret", "binding", "items"]) {
@@ -3190,7 +3536,7 @@ function unwrapList11(payload) {
3190
3536
  }
3191
3537
  return [];
3192
3538
  }
3193
- function stripUndefined11(input) {
3539
+ function stripUndefined13(input) {
3194
3540
  return Object.fromEntries(
3195
3541
  Object.entries(input).filter(([, v]) => v !== void 0)
3196
3542
  );
@@ -3200,7 +3546,7 @@ function pickFirst4(...values) {
3200
3546
  return void 0;
3201
3547
  }
3202
3548
  function setBody(params) {
3203
- return stripUndefined11({
3549
+ return stripUndefined13({
3204
3550
  name: params.name,
3205
3551
  value: params.value,
3206
3552
  type: params.type ?? "api_key",
@@ -3221,7 +3567,7 @@ function setBody(params) {
3221
3567
  });
3222
3568
  }
3223
3569
  function listQuery2(params) {
3224
- return stripUndefined11({
3570
+ return stripUndefined13({
3225
3571
  scope: params.scope,
3226
3572
  type: params.type,
3227
3573
  workspace_id: pickFirst4(params.workspaceId, params.workspace_id),
@@ -3236,14 +3582,14 @@ function listQuery2(params) {
3236
3582
  });
3237
3583
  }
3238
3584
  function rotateBody(params) {
3239
- return stripUndefined11({
3585
+ return stripUndefined13({
3240
3586
  value: pickFirst4(params.newValue, params.new_value, params.value),
3241
3587
  refresh_token: pickFirst4(params.refreshToken, params.refresh_token),
3242
3588
  expires_at: pickFirst4(params.expiresAt, params.expires_at)
3243
3589
  });
3244
3590
  }
3245
3591
  function bindingBody(params) {
3246
- return stripUndefined11({
3592
+ return stripUndefined13({
3247
3593
  secret_id: pickFirst4(params.secretId, params.secret_id),
3248
3594
  resource_id: pickFirst4(params.resourceId, params.resource_id),
3249
3595
  resource_type: pickFirst4(params.resourceType, params.resource_type),
@@ -3251,14 +3597,14 @@ function bindingBody(params) {
3251
3597
  });
3252
3598
  }
3253
3599
  function bindingQuery(params) {
3254
- return stripUndefined11({
3600
+ return stripUndefined13({
3255
3601
  resource_id: pickFirst4(params.resourceId, params.resource_id),
3256
3602
  resource_type: pickFirst4(params.resourceType, params.resource_type),
3257
3603
  secret_id: pickFirst4(params.secretId, params.secret_id)
3258
3604
  });
3259
3605
  }
3260
3606
  function oauthBody(params) {
3261
- return stripUndefined11({
3607
+ return stripUndefined13({
3262
3608
  provider: params.provider,
3263
3609
  expose_as_env: pickFirst4(params.exposeAsEnv, params.expose_as_env),
3264
3610
  scope: params.scope,
@@ -3273,7 +3619,7 @@ function oauthBody(params) {
3273
3619
  redirect_uri: pickFirst4(params.redirectUri, params.redirect_uri)
3274
3620
  });
3275
3621
  }
3276
- function sleep5(ms) {
3622
+ function sleep7(ms) {
3277
3623
  return new Promise((resolve) => setTimeout(resolve, ms));
3278
3624
  }
3279
3625
  var OAuthFlow = class {
@@ -3307,7 +3653,7 @@ var OAuthFlow = class {
3307
3653
  const data = await this.http.get("/egress/oauth/status", {
3308
3654
  state: this.state
3309
3655
  });
3310
- const payload = unwrap24(data) ?? {};
3656
+ const payload = unwrap26(data) ?? {};
3311
3657
  const status = payload.status;
3312
3658
  if (status === "completed" || status === "ready" || status === "succeeded") {
3313
3659
  return payload;
@@ -3317,7 +3663,7 @@ var OAuthFlow = class {
3317
3663
  `OAuth flow ${this.state} ended in status=${status}: ${payload.error ?? payload.message ?? "no detail"}`
3318
3664
  );
3319
3665
  }
3320
- await sleep5(pollMs);
3666
+ await sleep7(pollMs);
3321
3667
  }
3322
3668
  throw new Error(
3323
3669
  `OAuth flow ${this.state} did not complete within ${timeoutSec}s`
@@ -3339,7 +3685,7 @@ var EgressSecrets = class {
3339
3685
  "/egress/secrets",
3340
3686
  setBody(params)
3341
3687
  );
3342
- return unwrap24(data);
3688
+ return unwrap26(data);
3343
3689
  }
3344
3690
  /** List secrets. */
3345
3691
  async list(params = {}) {
@@ -3354,16 +3700,16 @@ var EgressSecrets = class {
3354
3700
  const data = await this.http.get(
3355
3701
  `/egress/secrets/${id}`
3356
3702
  );
3357
- return unwrap24(data);
3703
+ return unwrap26(data);
3358
3704
  }
3359
3705
  /** Rotate the secret's value. */
3360
3706
  async rotate(id, params) {
3361
- const body4 = typeof params === "string" ? rotateBody({ newValue: params }) : rotateBody(params);
3707
+ const body5 = typeof params === "string" ? rotateBody({ newValue: params }) : rotateBody(params);
3362
3708
  const data = await this.http.patch(
3363
3709
  `/egress/secrets/${id}`,
3364
- body4
3710
+ body5
3365
3711
  );
3366
- return unwrap24(data);
3712
+ return unwrap26(data);
3367
3713
  }
3368
3714
  /** Delete a secret. */
3369
3715
  async delete(id) {
@@ -3376,7 +3722,7 @@ var EgressSecrets = class {
3376
3722
  "/egress/bindings",
3377
3723
  bindingBody(params)
3378
3724
  );
3379
- return unwrap24(data);
3725
+ return unwrap26(data);
3380
3726
  }
3381
3727
  /** List secret bindings. */
3382
3728
  async listBindings(params = {}) {
@@ -3409,7 +3755,7 @@ var EgressSecrets = class {
3409
3755
  "/egress/oauth/start",
3410
3756
  oauthBody(params)
3411
3757
  );
3412
- const payload = unwrap24(data) ?? {};
3758
+ const payload = unwrap26(data) ?? {};
3413
3759
  return new OAuthFlow(this.http, payload, params.provider);
3414
3760
  }
3415
3761
  };
@@ -3973,12 +4319,12 @@ var ComputerInbox = class {
3973
4319
  return unwrapData(raw);
3974
4320
  }
3975
4321
  async update(fields) {
3976
- const body4 = Object.fromEntries(
4322
+ const body5 = Object.fromEntries(
3977
4323
  Object.entries(fields).filter(([, v]) => v !== void 0)
3978
4324
  );
3979
4325
  const raw = await this.http.patch(
3980
4326
  `/computers/${this.computerId}/inbox`,
3981
- body4
4327
+ body5
3982
4328
  );
3983
4329
  return unwrapData(raw);
3984
4330
  }
@@ -4151,6 +4497,21 @@ var Computer = class _Computer {
4151
4497
  wait: options.wait ?? true
4152
4498
  });
4153
4499
  }
4500
+ /**
4501
+ * Dispatch a prompt into this Computer through the Agent Runs API.
4502
+ */
4503
+ async prompt(prompt, options = {}) {
4504
+ return new AgentRuns(this.http).run({
4505
+ ...options,
4506
+ prompt,
4507
+ targetKind: "computer",
4508
+ targetId: this.id,
4509
+ computerId: this.id,
4510
+ provider: options.provider ?? "claude",
4511
+ cwd: options.cwd ?? "/workspace",
4512
+ wait: options.wait ?? true
4513
+ });
4514
+ }
4154
4515
  // ─── Desktop shortcuts ─────────────────────────────────────────────────────
4155
4516
  /**
4156
4517
  * Capture a desktop screenshot as PNG bytes.
@@ -4190,6 +4551,14 @@ var Computer = class _Computer {
4190
4551
  async doubleClick(x, y) {
4191
4552
  await this.desktop.doubleClick(x, y);
4192
4553
  }
4554
+ /** Middle-button click. */
4555
+ async middleClick(x, y) {
4556
+ await this.desktop.click(x, y, "middle");
4557
+ }
4558
+ /** Move the pointer without clicking. */
4559
+ async moveMouse(x, y) {
4560
+ await this.desktop.moveMouse(x, y);
4561
+ }
4193
4562
  /**
4194
4563
  * Type text into the focused element.
4195
4564
  * Shortcut for `computer.desktop.type(text)`.
@@ -4197,6 +4566,10 @@ var Computer = class _Computer {
4197
4566
  async type(text) {
4198
4567
  await this.desktop.type(text);
4199
4568
  }
4569
+ /** Alias for `type(text)`. */
4570
+ async write(text) {
4571
+ await this.desktop.write(text);
4572
+ }
4200
4573
  /**
4201
4574
  * Send a key or key combo.
4202
4575
  * Shortcut for `computer.desktop.key(key)`.
@@ -4204,6 +4577,10 @@ var Computer = class _Computer {
4204
4577
  async key(key) {
4205
4578
  await this.desktop.key(key);
4206
4579
  }
4580
+ /** Alias for `key(key)`. */
4581
+ async press(key) {
4582
+ await this.desktop.press(key);
4583
+ }
4207
4584
  /**
4208
4585
  * Scroll in a direction.
4209
4586
  * Shortcut for `computer.desktop.scroll(direction, clicks)`.
@@ -4319,14 +4696,25 @@ var Computer = class _Computer {
4319
4696
  await this.http.post(`/computers/${this.id}/stream-token`)
4320
4697
  );
4321
4698
  }
4699
+ /**
4700
+ * Mint a passwordless browser embed URL for authenticated platform sessions.
4701
+ *
4702
+ * Use this inside MIOSA or tenant apps. Raw shared desktop URLs can still use
4703
+ * the viewer password flow when opened outside an authenticated platform.
4704
+ */
4705
+ async embed() {
4706
+ return unwrapData(
4707
+ await this.http.get(`/computers/${this.id}/embed`)
4708
+ );
4709
+ }
4322
4710
  /** Clone this computer into a new one. */
4323
4711
  async clone(opts = {}) {
4324
- const body4 = Object.fromEntries(
4712
+ const body5 = Object.fromEntries(
4325
4713
  Object.entries(opts).filter(([, v]) => v !== void 0)
4326
4714
  );
4327
4715
  const raw = await this.http.post(
4328
4716
  `/computers/${this.id}/clone`,
4329
- body4
4717
+ body5
4330
4718
  );
4331
4719
  const data = unwrapData(raw);
4332
4720
  return new _Computer(this.http, data);
@@ -4342,12 +4730,12 @@ var Computer = class _Computer {
4342
4730
  }
4343
4731
  /** Move the computer to a different region or host. */
4344
4732
  async move(opts) {
4345
- const body4 = Object.fromEntries(
4733
+ const body5 = Object.fromEntries(
4346
4734
  Object.entries(opts).filter(([, v]) => v !== void 0)
4347
4735
  );
4348
4736
  const updated = await this.http.post(
4349
4737
  `/computers/${this.id}/move`,
4350
- body4
4738
+ body5
4351
4739
  );
4352
4740
  this.data = updated;
4353
4741
  return this;
@@ -4430,12 +4818,12 @@ var Computers = class {
4430
4818
  agentProfileId,
4431
4819
  skipAgentRuntimeProfile,
4432
4820
  skipRuntimeProfile,
4433
- ...body4
4821
+ ...body5
4434
4822
  } = params;
4435
4823
  const data = await this.http.post("/computers", {
4436
4824
  template_type: "miosa-desktop",
4437
- ...body4,
4438
- size: normalizeComputerSize(body4.size ?? "small"),
4825
+ ...body5,
4826
+ size: normalizeComputerSize(body5.size ?? "small"),
4439
4827
  agent_runtime_profile_id: agentRuntimeProfileId ?? params.agent_runtime_profile_id ?? agentProfileId ?? params.agent_profile_id,
4440
4828
  skip_agent_runtime_profile: skipAgentRuntimeProfile ?? skipRuntimeProfile ?? params.skip_agent_runtime_profile
4441
4829
  });
@@ -4531,7 +4919,7 @@ var Credits = class {
4531
4919
  return this.http.get("/credits/usage");
4532
4920
  }
4533
4921
  };
4534
- function unwrap25(payload) {
4922
+ function unwrap27(payload) {
4535
4923
  if (payload && typeof payload === "object" && "data" in payload) {
4536
4924
  return payload.data;
4537
4925
  }
@@ -4547,7 +4935,7 @@ function listItems2(payload, candidateKeys = ["data", "cron_jobs", "executions",
4547
4935
  }
4548
4936
  return [];
4549
4937
  }
4550
- function stripUndefined12(input) {
4938
+ function stripUndefined14(input) {
4551
4939
  return Object.fromEntries(
4552
4940
  Object.entries(input).filter(([, v]) => v !== void 0)
4553
4941
  );
@@ -4561,28 +4949,28 @@ var CronJobs = class {
4561
4949
  }
4562
4950
  http;
4563
4951
  async list(params = {}) {
4564
- const query3 = stripUndefined12({ ...params });
4952
+ const query3 = stripUndefined14({ ...params });
4565
4953
  const data = await this.http.get("/cron-jobs", query3);
4566
4954
  return listItems2(data);
4567
4955
  }
4568
4956
  async get(jobId) {
4569
4957
  const data = await this.http.get(`/cron-jobs/${jobId}`);
4570
- return unwrap25(data);
4958
+ return unwrap27(data);
4571
4959
  }
4572
4960
  async create(params) {
4573
4961
  const { idempotencyKey: ikey, ...rest } = params;
4574
- const body4 = stripUndefined12(rest);
4962
+ const body5 = stripUndefined14(rest);
4575
4963
  const data = await this.http.request("/cron-jobs", {
4576
4964
  method: "POST",
4577
- body: body4,
4965
+ body: body5,
4578
4966
  headers: { "Idempotency-Key": idempotencyKey2(ikey) }
4579
4967
  });
4580
- return unwrap25(data);
4968
+ return unwrap27(data);
4581
4969
  }
4582
4970
  async update(jobId, params) {
4583
- const body4 = stripUndefined12(params);
4584
- const data = await this.http.patch(`/cron-jobs/${jobId}`, body4);
4585
- return unwrap25(data);
4971
+ const body5 = stripUndefined14(params);
4972
+ const data = await this.http.patch(`/cron-jobs/${jobId}`, body5);
4973
+ return unwrap27(data);
4586
4974
  }
4587
4975
  async delete(jobId) {
4588
4976
  await this.http.delete(`/cron-jobs/${jobId}`);
@@ -4590,11 +4978,11 @@ var CronJobs = class {
4590
4978
  // ── Control ────────────────────────────────────────────────────────────────
4591
4979
  async pause(jobId) {
4592
4980
  const data = await this.http.post(`/cron-jobs/${jobId}/pause`);
4593
- return unwrap25(data);
4981
+ return unwrap27(data);
4594
4982
  }
4595
4983
  async resume(jobId) {
4596
4984
  const data = await this.http.post(`/cron-jobs/${jobId}/resume`);
4597
- return unwrap25(data);
4985
+ return unwrap27(data);
4598
4986
  }
4599
4987
  async runNow(jobId, opts = {}) {
4600
4988
  const data = await this.http.request(
@@ -4604,7 +4992,7 @@ var CronJobs = class {
4604
4992
  headers: { "Idempotency-Key": idempotencyKey2(opts.idempotencyKey) }
4605
4993
  }
4606
4994
  );
4607
- return unwrap25(data);
4995
+ return unwrap27(data);
4608
4996
  }
4609
4997
  // ── Execution history ──────────────────────────────────────────────────────
4610
4998
  async listExecutions(jobId) {
@@ -4619,12 +5007,12 @@ var CronJobs = class {
4619
5007
  const data = await this.http.get(
4620
5008
  `/cron-jobs/${jobId}/executions/${executionId}`
4621
5009
  );
4622
- return unwrap25(data);
5010
+ return unwrap27(data);
4623
5011
  }
4624
5012
  };
4625
5013
 
4626
5014
  // src/resources/dashboard.ts
4627
- function unwrap26(payload) {
5015
+ function unwrap28(payload) {
4628
5016
  if (payload && typeof payload === "object") {
4629
5017
  const p = payload;
4630
5018
  for (const k of ["data", "dashboard", "overview", "items"]) {
@@ -4641,15 +5029,15 @@ var Dashboard = class {
4641
5029
  /** Aggregated user dashboard payload. */
4642
5030
  async summary() {
4643
5031
  const data = await this.http.get("/dashboard");
4644
- return unwrap26(data);
5032
+ return unwrap28(data);
4645
5033
  }
4646
5034
  /** Status / health overview (public endpoint). */
4647
5035
  async overview() {
4648
5036
  const data = await this.http.get("/overview");
4649
- return unwrap26(data);
5037
+ return unwrap28(data);
4650
5038
  }
4651
5039
  };
4652
- function unwrap27(payload) {
5040
+ function unwrap29(payload) {
4653
5041
  if (payload && typeof payload === "object" && "data" in payload) {
4654
5042
  return payload.data;
4655
5043
  }
@@ -4665,7 +5053,7 @@ function listItems3(payload, candidateKeys = ["data", "databases", "items"]) {
4665
5053
  }
4666
5054
  return [];
4667
5055
  }
4668
- function stripUndefined13(input) {
5056
+ function stripUndefined15(input) {
4669
5057
  return Object.fromEntries(
4670
5058
  Object.entries(input).filter(([, v]) => v !== void 0)
4671
5059
  );
@@ -4679,13 +5067,13 @@ var Databases = class {
4679
5067
  }
4680
5068
  http;
4681
5069
  async list(params = {}) {
4682
- const query3 = stripUndefined13({ ...params });
5070
+ const query3 = stripUndefined15({ ...params });
4683
5071
  const data = await this.http.get("/databases", query3);
4684
5072
  return listItems3(data);
4685
5073
  }
4686
5074
  async get(databaseId) {
4687
5075
  const data = await this.http.get(`/databases/${databaseId}`);
4688
- return unwrap27(data);
5076
+ return unwrap29(data);
4689
5077
  }
4690
5078
  async create(params) {
4691
5079
  const {
@@ -4696,20 +5084,20 @@ var Databases = class {
4696
5084
  size: _deprecatedSize,
4697
5085
  ...rest
4698
5086
  } = params;
4699
- const body4 = stripUndefined13({
5087
+ const body5 = stripUndefined15({
4700
5088
  ...rest,
4701
5089
  engine_version: engine_version ?? version
4702
5090
  });
4703
5091
  const data = await this.http.request("/databases", {
4704
5092
  method: "POST",
4705
- body: body4,
5093
+ body: body5,
4706
5094
  headers: {
4707
5095
  "Idempotency-Key": idempotencyKey3(
4708
5096
  camelIdempotencyKey ?? snakeIdempotencyKey
4709
5097
  )
4710
5098
  }
4711
5099
  });
4712
- return unwrap27(data);
5100
+ return unwrap29(data);
4713
5101
  }
4714
5102
  async delete(databaseId) {
4715
5103
  await this.http.delete(`/databases/${databaseId}`);
@@ -4719,27 +5107,27 @@ var Databases = class {
4719
5107
  const data = await this.http.post(
4720
5108
  `/databases/${databaseId}/start`
4721
5109
  );
4722
- return unwrap27(data);
5110
+ return unwrap29(data);
4723
5111
  }
4724
5112
  async stop(databaseId) {
4725
5113
  const data = await this.http.post(`/databases/${databaseId}/stop`);
4726
- return unwrap27(data);
5114
+ return unwrap29(data);
4727
5115
  }
4728
5116
  async restart(databaseId) {
4729
5117
  const data = await this.http.post(
4730
5118
  `/databases/${databaseId}/restart`
4731
5119
  );
4732
- return unwrap27(data);
5120
+ return unwrap29(data);
4733
5121
  }
4734
5122
  // ── Credentials + logs ────────────────────────────────────────────────────
4735
5123
  async credentials(databaseId) {
4736
5124
  const data = await this.http.get(
4737
5125
  `/databases/${databaseId}/credentials`
4738
5126
  );
4739
- return unwrap27(data);
5127
+ return unwrap29(data);
4740
5128
  }
4741
5129
  async logs(databaseId, params = {}) {
4742
- const query3 = stripUndefined13({
5130
+ const query3 = stripUndefined15({
4743
5131
  lines: params.lines,
4744
5132
  since: params.since
4745
5133
  });
@@ -4766,7 +5154,7 @@ function attributionBody(p) {
4766
5154
  function idempotencyKey4(key) {
4767
5155
  return key ?? randomUUID();
4768
5156
  }
4769
- function unwrap28(payload) {
5157
+ function unwrap30(payload) {
4770
5158
  if (payload && typeof payload === "object" && "data" in payload) {
4771
5159
  return payload.data;
4772
5160
  }
@@ -4782,7 +5170,7 @@ function listItems4(payload, candidateKeys = ["items", "deployments", "versions"
4782
5170
  }
4783
5171
  return [];
4784
5172
  }
4785
- function stripUndefined14(input) {
5173
+ function stripUndefined16(input) {
4786
5174
  return Object.fromEntries(
4787
5175
  Object.entries(input).filter(([, v]) => v !== void 0)
4788
5176
  );
@@ -4859,7 +5247,7 @@ var DeploymentVersions = class {
4859
5247
  http;
4860
5248
  deploymentId;
4861
5249
  async list(params = {}) {
4862
- const query3 = stripUndefined14({
5250
+ const query3 = stripUndefined16({
4863
5251
  state: params.state,
4864
5252
  limit: params.limit,
4865
5253
  cursor: params.cursor,
@@ -4875,19 +5263,26 @@ var DeploymentVersions = class {
4875
5263
  const data = await this.http.get(
4876
5264
  `/deployments/${this.deploymentId}/versions/${versionId}`
4877
5265
  );
4878
- return unwrap28(data);
5266
+ return unwrap30(data);
4879
5267
  }
4880
5268
  async promote(versionId, opts = {}) {
4881
- const body4 = stripUndefined14({ environment: opts.environment });
5269
+ const body5 = stripUndefined16({ environment: opts.environment });
4882
5270
  const data = await this.http.request(
4883
5271
  `/deployments/${this.deploymentId}/versions/${versionId}/promote`,
4884
5272
  {
4885
5273
  method: "POST",
4886
- body: body4,
5274
+ body: body5,
4887
5275
  headers: { "Idempotency-Key": idempotencyKey4(opts.idempotencyKey) }
4888
5276
  }
4889
5277
  );
4890
- return unwrap28(data);
5278
+ return unwrap30(data);
5279
+ }
5280
+ async prepareMigrationBackup(versionId) {
5281
+ const data = await this.http.request(
5282
+ `/deployments/${this.deploymentId}/versions/${versionId}/migration-backup`,
5283
+ { method: "POST", body: {} }
5284
+ );
5285
+ return unwrap30(data);
4891
5286
  }
4892
5287
  };
4893
5288
  var DeploymentReleases = class {
@@ -4907,7 +5302,19 @@ var DeploymentReleases = class {
4907
5302
  const data = await this.http.get(
4908
5303
  `/deployments/${this.deploymentId}/releases/${releaseId}`
4909
5304
  );
4910
- return unwrap28(data);
5305
+ return unwrap30(data);
5306
+ }
5307
+ async promote(releaseId, idempotencyKey11) {
5308
+ const key = idempotencyKey11 ?? `promote:${this.deploymentId}:${releaseId}`;
5309
+ const data = await this.http.request(
5310
+ `/deployments/${this.deploymentId}/releases/${releaseId}/promote`,
5311
+ {
5312
+ method: "POST",
5313
+ body: {},
5314
+ headers: { "Idempotency-Key": key }
5315
+ }
5316
+ );
5317
+ return unwrap30(data);
4911
5318
  }
4912
5319
  };
4913
5320
  var DeploymentRuntimeInstances = class {
@@ -4927,14 +5334,14 @@ var DeploymentRuntimeInstances = class {
4927
5334
  const data = await this.http.get(
4928
5335
  `/deployments/${this.deploymentId}/runtime-instances/${instanceId}`
4929
5336
  );
4930
- return unwrap28(data);
5337
+ return unwrap30(data);
4931
5338
  }
4932
5339
  async logs(instanceId, lines = 100) {
4933
5340
  const data = await this.http.get(
4934
5341
  `/deployments/${this.deploymentId}/runtime-instances/${instanceId}/logs`,
4935
5342
  { lines }
4936
5343
  );
4937
- const unwrapped = unwrap28(data);
5344
+ const unwrapped = unwrap30(data);
4938
5345
  const result = { logs: String(unwrapped.logs ?? "") };
4939
5346
  if (typeof unwrapped.runtime_instance_id === "string") {
4940
5347
  result.runtime_instance_id = unwrapped.runtime_instance_id;
@@ -4956,7 +5363,7 @@ var DeploymentDomains = class {
4956
5363
  http;
4957
5364
  deploymentId;
4958
5365
  async add(domain, params = {}) {
4959
- const body4 = {
5366
+ const body5 = {
4960
5367
  domain,
4961
5368
  redirect_policy: params.redirectPolicy ?? params.redirect_policy,
4962
5369
  ...attributionBody(params)
@@ -4965,11 +5372,11 @@ var DeploymentDomains = class {
4965
5372
  `/deployments/${this.deploymentId}/domains`,
4966
5373
  {
4967
5374
  method: "POST",
4968
- body: stripUndefined14(body4),
5375
+ body: stripUndefined16(body5),
4969
5376
  headers: { "Idempotency-Key": idempotencyKey4(params.idempotencyKey) }
4970
5377
  }
4971
5378
  );
4972
- return unwrap28(data);
5379
+ return unwrap30(data);
4973
5380
  }
4974
5381
  async list(filters = {}) {
4975
5382
  const data = await this.http.get(
@@ -4982,7 +5389,7 @@ var DeploymentDomains = class {
4982
5389
  const data = await this.http.post(
4983
5390
  `/deployments/${this.deploymentId}/domains/${domainId}/verify`
4984
5391
  );
4985
- return unwrap28(data);
5392
+ return unwrap30(data);
4986
5393
  }
4987
5394
  async delete(domainId) {
4988
5395
  await this.http.delete(
@@ -4997,7 +5404,7 @@ var Deployments = class {
4997
5404
  http;
4998
5405
  async list(params = {}) {
4999
5406
  const projectId = params.projectId ?? params.project_id;
5000
- const query3 = stripUndefined14({
5407
+ const query3 = stripUndefined16({
5001
5408
  project_id: projectId,
5002
5409
  state: params.state,
5003
5410
  limit: params.limit,
@@ -5012,10 +5419,10 @@ var Deployments = class {
5012
5419
  }
5013
5420
  async get(deploymentId) {
5014
5421
  const data = await this.http.get(`/deployments/${deploymentId}`);
5015
- return unwrap28(data);
5422
+ return unwrap30(data);
5016
5423
  }
5017
5424
  async create(params) {
5018
- const body4 = stripUndefined14({
5425
+ const body5 = stripUndefined16({
5019
5426
  name: params.name,
5020
5427
  repo_url: params.repoUrl ?? params.repo_url,
5021
5428
  branch: params.branch,
@@ -5028,10 +5435,10 @@ var Deployments = class {
5028
5435
  });
5029
5436
  const data = await this.http.request("/deployments", {
5030
5437
  method: "POST",
5031
- body: body4,
5438
+ body: body5,
5032
5439
  headers: { "Idempotency-Key": idempotencyKey4(params.idempotencyKey) }
5033
5440
  });
5034
- return unwrap28(data);
5441
+ return unwrap30(data);
5035
5442
  }
5036
5443
  /**
5037
5444
  * Create a deployment that runs on the workspace's dedicated App Engine
@@ -5075,7 +5482,7 @@ var Deployments = class {
5075
5482
  const rawHost = await this.http.get(
5076
5483
  `/docker-deploy/hosts/${hostId}`
5077
5484
  );
5078
- host = unwrap28(
5485
+ host = unwrap30(
5079
5486
  rawHost
5080
5487
  );
5081
5488
  addDoctorCheck(
@@ -5226,7 +5633,7 @@ var Deployments = class {
5226
5633
  const rawHost = await this.http.get(
5227
5634
  `/docker-deploy/hosts/${hostId}`
5228
5635
  );
5229
- const host = unwrap28(
5636
+ const host = unwrap30(
5230
5637
  rawHost
5231
5638
  );
5232
5639
  addProofCheck(
@@ -5322,7 +5729,7 @@ var Deployments = class {
5322
5729
  };
5323
5730
  }
5324
5731
  async update(deploymentId, params) {
5325
- const body4 = stripUndefined14({
5732
+ const body5 = stripUndefined16({
5326
5733
  name: params.name,
5327
5734
  branch: params.branch,
5328
5735
  build_command: params.buildCommand ?? params.build_command,
@@ -5331,15 +5738,15 @@ var Deployments = class {
5331
5738
  });
5332
5739
  const data = await this.http.patch(
5333
5740
  `/deployments/${deploymentId}`,
5334
- body4
5741
+ body5
5335
5742
  );
5336
- return unwrap28(data);
5743
+ return unwrap30(data);
5337
5744
  }
5338
5745
  async delete(deploymentId) {
5339
5746
  await this.http.delete(`/deployments/${deploymentId}`);
5340
5747
  }
5341
5748
  async publish(deploymentId, params) {
5342
- const body4 = stripUndefined14({
5749
+ const body5 = stripUndefined16({
5343
5750
  source_sandbox_id: params.sourceSandboxId ?? params.source_sandbox_id,
5344
5751
  output_path: params.outputPath ?? params.output_path,
5345
5752
  entrypoint: params.entrypoint,
@@ -5349,11 +5756,11 @@ var Deployments = class {
5349
5756
  `/deployments/${deploymentId}/publish`,
5350
5757
  {
5351
5758
  method: "POST",
5352
- body: body4,
5759
+ body: body5,
5353
5760
  headers: { "Idempotency-Key": idempotencyKey4(params.idempotencyKey) }
5354
5761
  }
5355
5762
  );
5356
- return unwrap28(data);
5763
+ return unwrap30(data);
5357
5764
  }
5358
5765
  /**
5359
5766
  * Backward-compatible bridge: POST /sandboxes/:id/deploy. Works today;
@@ -5361,7 +5768,7 @@ var Deployments = class {
5361
5768
  * phase. Prefer `publish()` once Phase 2B/3 lands.
5362
5769
  */
5363
5770
  async publishFromSandbox(sandboxId, params = {}) {
5364
- const body4 = stripUndefined14({
5771
+ const body5 = stripUndefined16({
5365
5772
  name: params.name,
5366
5773
  deployment_id: params.deploymentId ?? params.deployment_id,
5367
5774
  output_path: params.outputPath ?? params.output_path,
@@ -5374,25 +5781,25 @@ var Deployments = class {
5374
5781
  `/sandboxes/${sandboxId}/deploy`,
5375
5782
  {
5376
5783
  method: "POST",
5377
- body: body4,
5784
+ body: body5,
5378
5785
  headers: { "Idempotency-Key": idempotencyKey4(params.idempotencyKey) }
5379
5786
  }
5380
5787
  );
5381
- return unwrap28(data);
5788
+ return unwrap30(data);
5382
5789
  }
5383
5790
  async rollback(deploymentId, params = {}) {
5384
- const body4 = stripUndefined14({
5791
+ const body5 = stripUndefined16({
5385
5792
  version_id: params.versionId ?? params.version_id
5386
5793
  });
5387
5794
  const data = await this.http.request(
5388
5795
  `/deployments/${deploymentId}/rollback`,
5389
5796
  {
5390
5797
  method: "POST",
5391
- body: body4,
5798
+ body: body5,
5392
5799
  headers: { "Idempotency-Key": idempotencyKey4(params.idempotencyKey) }
5393
5800
  }
5394
5801
  );
5395
- return unwrap28(data);
5802
+ return unwrap30(data);
5396
5803
  }
5397
5804
  async listBuilds(deploymentId) {
5398
5805
  const data = await this.http.get(
@@ -5404,7 +5811,7 @@ var Deployments = class {
5404
5811
  const data = await this.http.get(
5405
5812
  `/deployments/${deploymentId}/builds/${buildId}`
5406
5813
  );
5407
- return unwrap28(data);
5814
+ return unwrap30(data);
5408
5815
  }
5409
5816
  async listEnv(deploymentId) {
5410
5817
  const data = await this.http.get(
@@ -5413,10 +5820,10 @@ var Deployments = class {
5413
5820
  return listItems4(data);
5414
5821
  }
5415
5822
  async setEnv(deploymentId, vars, opts = {}) {
5416
- const body4 = stripUndefined14({ env: vars, environment: opts.environment });
5823
+ const body5 = stripUndefined16({ env: vars, environment: opts.environment });
5417
5824
  const data = await this.http.post(
5418
5825
  `/deployments/${deploymentId}/env`,
5419
- body4
5826
+ body5
5420
5827
  );
5421
5828
  return listItems4(data);
5422
5829
  }
@@ -5450,7 +5857,7 @@ var RUNTIME_BINARIES = {
5450
5857
  pi: ["pi"],
5451
5858
  custom: []
5452
5859
  };
5453
- function unwrap29(payload, keys = ["data"]) {
5860
+ function unwrap31(payload, keys = ["data"]) {
5454
5861
  if (payload && typeof payload === "object") {
5455
5862
  const p = payload;
5456
5863
  for (const key of keys) {
@@ -5469,7 +5876,7 @@ function unwrapList12(payload) {
5469
5876
  }
5470
5877
  return [];
5471
5878
  }
5472
- function stripUndefined15(input) {
5879
+ function stripUndefined17(input) {
5473
5880
  return Object.fromEntries(
5474
5881
  Object.entries(input).filter(([, value]) => value !== void 0)
5475
5882
  );
@@ -5479,14 +5886,14 @@ function pickFirst5(...values) {
5479
5886
  return void 0;
5480
5887
  }
5481
5888
  function queryFromListParams2(params = {}) {
5482
- return stripUndefined15({
5889
+ return stripUndefined17({
5483
5890
  kind: pickFirst5(params.kind, params.type),
5484
5891
  workspace_id: pickFirst5(params.workspaceId, params.workspace_id),
5485
5892
  project_id: pickFirst5(params.projectId, params.project_id)
5486
5893
  });
5487
5894
  }
5488
5895
  function queryFromFileParams(params = {}) {
5489
- return stripUndefined15({
5896
+ return stripUndefined17({
5490
5897
  path: params.path
5491
5898
  });
5492
5899
  }
@@ -5509,7 +5916,7 @@ var Devices = class {
5509
5916
  /** Show one unified device by id. */
5510
5917
  async get(id) {
5511
5918
  const data = await this.http.get(`/devices/${devicePath(id)}`);
5512
- return unwrap29(data);
5919
+ return unwrap31(data);
5513
5920
  }
5514
5921
  show(id) {
5515
5922
  return this.get(id);
@@ -5519,20 +5926,20 @@ var Devices = class {
5519
5926
  const data = await this.http.get(
5520
5927
  `/devices/${devicePath(id)}/capabilities`
5521
5928
  );
5522
- return unwrap29(data);
5929
+ return unwrap31(data);
5523
5930
  }
5524
5931
  /** Execute a command inside the device. */
5525
5932
  async exec(id, params) {
5526
5933
  const data = await this.http.post(
5527
5934
  `/devices/${devicePath(id)}/exec`,
5528
- stripUndefined15({
5935
+ stripUndefined17({
5529
5936
  command: params.command,
5530
5937
  timeout_ms: pickFirst5(params.timeoutMs, params.timeout_ms),
5531
5938
  cwd: params.cwd,
5532
5939
  env: params.env
5533
5940
  })
5534
5941
  );
5535
- return unwrap29(data);
5942
+ return unwrap31(data);
5536
5943
  }
5537
5944
  /** List files inside the device filesystem. */
5538
5945
  async listFiles(id, params = {}) {
@@ -5548,19 +5955,19 @@ var Devices = class {
5548
5955
  `/devices/${devicePath(id)}/files/read`,
5549
5956
  queryFromFileParams(params)
5550
5957
  );
5551
- return unwrap29(data);
5958
+ return unwrap31(data);
5552
5959
  }
5553
5960
  /** Write a text or base64 payload into the device filesystem. */
5554
5961
  async writeFile(id, params) {
5555
5962
  const data = await this.http.post(
5556
5963
  `/devices/${devicePath(id)}/files/write`,
5557
- stripUndefined15({
5964
+ stripUndefined17({
5558
5965
  path: params.path,
5559
5966
  content: params.content,
5560
5967
  content_base64: pickFirst5(params.contentBase64, params.content_base64)
5561
5968
  })
5562
5969
  );
5563
- return unwrap29(data);
5970
+ return unwrap31(data);
5564
5971
  }
5565
5972
  /** Expose a device port through MIOSA routing. */
5566
5973
  async expose(id, params) {
@@ -5568,44 +5975,44 @@ var Devices = class {
5568
5975
  `/devices/${devicePath(id)}/expose`,
5569
5976
  { port: params.port }
5570
5977
  );
5571
- return unwrap29(data);
5978
+ return unwrap31(data);
5572
5979
  }
5573
5980
  /** Return browser/desktop connection details for a computer-backed device. */
5574
5981
  async browser(id) {
5575
5982
  const data = await this.http.get(`/devices/${devicePath(id)}/browser`);
5576
- return unwrap29(data);
5983
+ return unwrap31(data);
5577
5984
  }
5578
5985
  async pause(id) {
5579
5986
  const data = await this.http.post(
5580
5987
  `/devices/${devicePath(id)}/pause`,
5581
5988
  {}
5582
5989
  );
5583
- return unwrap29(data);
5990
+ return unwrap31(data);
5584
5991
  }
5585
5992
  async stop(id) {
5586
5993
  const data = await this.http.post(
5587
5994
  `/devices/${devicePath(id)}/stop`,
5588
5995
  {}
5589
5996
  );
5590
- return unwrap29(data);
5997
+ return unwrap31(data);
5591
5998
  }
5592
5999
  async resume(id) {
5593
6000
  const data = await this.http.post(
5594
6001
  `/devices/${devicePath(id)}/resume`,
5595
6002
  {}
5596
6003
  );
5597
- return unwrap29(data);
6004
+ return unwrap31(data);
5598
6005
  }
5599
6006
  async extend(id, params) {
5600
6007
  const data = await this.http.post(
5601
6008
  `/devices/${devicePath(id)}/extend`,
5602
6009
  { timeout_sec: pickFirst5(params.timeoutSec, params.timeout_sec) }
5603
6010
  );
5604
- return unwrap29(data);
6011
+ return unwrap31(data);
5605
6012
  }
5606
6013
  async destroy(id) {
5607
6014
  const data = await this.http.delete(`/devices/${devicePath(id)}`);
5608
- return unwrap29(data);
6015
+ return unwrap31(data);
5609
6016
  }
5610
6017
  /**
5611
6018
  * Write a MIOSA runtime bootstrap manifest and optionally install/probe
@@ -5695,12 +6102,12 @@ function workspaceId(params) {
5695
6102
  return params?.workspace_id ?? params?.workspaceId;
5696
6103
  }
5697
6104
  function ensureBody(params) {
5698
- const body4 = {};
6105
+ const body5 = {};
5699
6106
  const id = params.workspace_id ?? params.workspaceId;
5700
6107
  const externalId = params.external_workspace_id ?? params.externalWorkspaceId;
5701
- if (id) body4.workspace_id = id;
5702
- if (externalId) body4.external_workspace_id = externalId;
5703
- return body4;
6108
+ if (id) body5.workspace_id = id;
6109
+ if (externalId) body5.external_workspace_id = externalId;
6110
+ return body5;
5704
6111
  }
5705
6112
  function unwrapHost(response) {
5706
6113
  const host = response.data ?? response.host;
@@ -5775,7 +6182,7 @@ var DockerDeploy = class {
5775
6182
  };
5776
6183
 
5777
6184
  // src/resources/email.ts
5778
- function unwrap30(data) {
6185
+ function unwrap32(data) {
5779
6186
  if (data && typeof data === "object") {
5780
6187
  const d = data;
5781
6188
  for (const k of [
@@ -5827,12 +6234,12 @@ var EmailCampaigns = class {
5827
6234
  );
5828
6235
  }
5829
6236
  async create(attrs) {
5830
- return unwrap30(
6237
+ return unwrap32(
5831
6238
  await this.http.post("/admin/email-campaigns", strip(attrs))
5832
6239
  );
5833
6240
  }
5834
6241
  async recipientCount(filters = {}) {
5835
- return unwrap30(
6242
+ return unwrap32(
5836
6243
  await this.http.get(
5837
6244
  "/admin/email-campaigns/recipient-count",
5838
6245
  filters
@@ -5840,7 +6247,7 @@ var EmailCampaigns = class {
5840
6247
  );
5841
6248
  }
5842
6249
  async send(campaignId, opts = {}) {
5843
- return unwrap30(
6250
+ return unwrap32(
5844
6251
  await this.http.post(
5845
6252
  `/admin/email-campaigns/${campaignId}/send`,
5846
6253
  strip(opts)
@@ -5848,7 +6255,7 @@ var EmailCampaigns = class {
5848
6255
  );
5849
6256
  }
5850
6257
  async cancel(campaignId) {
5851
- return unwrap30(
6258
+ return unwrap32(
5852
6259
  await this.http.post(
5853
6260
  `/admin/email-campaigns/${campaignId}/cancel`
5854
6261
  )
@@ -5874,7 +6281,7 @@ var EmailTemplates = class {
5874
6281
  );
5875
6282
  }
5876
6283
  async create(key, attrs = {}) {
5877
- return unwrap30(
6284
+ return unwrap32(
5878
6285
  await this.http.post("/admin/email-templates", {
5879
6286
  key,
5880
6287
  ...strip(attrs)
@@ -5882,7 +6289,7 @@ var EmailTemplates = class {
5882
6289
  );
5883
6290
  }
5884
6291
  async update(key, attrs) {
5885
- return unwrap30(
6292
+ return unwrap32(
5886
6293
  await this.http.put(
5887
6294
  `/admin/email-templates/${key}`,
5888
6295
  strip(attrs)
@@ -5890,7 +6297,7 @@ var EmailTemplates = class {
5890
6297
  );
5891
6298
  }
5892
6299
  async reset(key) {
5893
- return unwrap30(
6300
+ return unwrap32(
5894
6301
  await this.http.post(`/admin/email-templates/${key}/reset`)
5895
6302
  );
5896
6303
  }
@@ -5906,17 +6313,17 @@ var EmailInbox = class {
5906
6313
  );
5907
6314
  }
5908
6315
  async send(attrs) {
5909
- return unwrap30(
6316
+ return unwrap32(
5910
6317
  await this.http.post("/admin/email-inbox/send", strip(attrs))
5911
6318
  );
5912
6319
  }
5913
6320
  async markRead(messageId) {
5914
- return unwrap30(
6321
+ return unwrap32(
5915
6322
  await this.http.post(`/admin/email-inbox/${messageId}/read`)
5916
6323
  );
5917
6324
  }
5918
6325
  async archive(messageId) {
5919
- return unwrap30(
6326
+ return unwrap32(
5920
6327
  await this.http.post(`/admin/email-inbox/${messageId}/archive`)
5921
6328
  );
5922
6329
  }
@@ -5945,18 +6352,18 @@ var Embeddings = class {
5945
6352
  * `{ object: "list", data: [...], model, usage }`.
5946
6353
  */
5947
6354
  async create(params) {
5948
- const body4 = Object.fromEntries(
6355
+ const body5 = Object.fromEntries(
5949
6356
  Object.entries(params).filter(([, v]) => v !== void 0)
5950
6357
  );
5951
6358
  return this.http.post(
5952
6359
  "/intelligence/embeddings",
5953
- body4
6360
+ body5
5954
6361
  );
5955
6362
  }
5956
6363
  };
5957
6364
 
5958
6365
  // src/resources/external-keys.ts
5959
- function unwrap31(payload) {
6366
+ function unwrap33(payload) {
5960
6367
  if (payload && typeof payload === "object") {
5961
6368
  const p = payload;
5962
6369
  for (const k of ["data", "external_keys", "items"]) {
@@ -5965,7 +6372,7 @@ function unwrap31(payload) {
5965
6372
  }
5966
6373
  return payload;
5967
6374
  }
5968
- function stripUndefined16(input) {
6375
+ function stripUndefined18(input) {
5969
6376
  return Object.fromEntries(
5970
6377
  Object.entries(input).filter(([, v]) => v !== void 0)
5971
6378
  );
@@ -5978,22 +6385,22 @@ var ExternalKeys = class {
5978
6385
  /** List configured external keys. */
5979
6386
  async list() {
5980
6387
  const data = await this.http.get("/external-keys");
5981
- const result = unwrap31(data);
6388
+ const result = unwrap33(data);
5982
6389
  if (Array.isArray(result)) return result;
5983
6390
  return [];
5984
6391
  }
5985
6392
  /** Create / register an external provider key. */
5986
6393
  async create(params) {
5987
- const body4 = stripUndefined16(params);
5988
- const data = await this.http.post("/external-keys", body4);
5989
- return unwrap31(data);
6394
+ const body5 = stripUndefined18(params);
6395
+ const data = await this.http.post("/external-keys", body5);
6396
+ return unwrap33(data);
5990
6397
  }
5991
6398
  /** Resolve (preview) the stored key for a provider. */
5992
6399
  async resolve(provider) {
5993
6400
  const data = await this.http.get(
5994
6401
  `/external-keys/${provider}/resolve`
5995
6402
  );
5996
- return unwrap31(data);
6403
+ return unwrap33(data);
5997
6404
  }
5998
6405
  /**
5999
6406
  * Delete the stored key for a provider.
@@ -6003,7 +6410,7 @@ var ExternalKeys = class {
6003
6410
  await this.http.delete(`/external-keys/${provider}`);
6004
6411
  }
6005
6412
  };
6006
- function unwrap32(payload) {
6413
+ function unwrap34(payload) {
6007
6414
  if (payload && typeof payload === "object" && "data" in payload) {
6008
6415
  return payload.data;
6009
6416
  }
@@ -6019,7 +6426,7 @@ function listItems5(payload, candidateKeys = ["data", "domains", "items"]) {
6019
6426
  }
6020
6427
  return [];
6021
6428
  }
6022
- function stripUndefined17(input) {
6429
+ function stripUndefined19(input) {
6023
6430
  return Object.fromEntries(
6024
6431
  Object.entries(input).filter(([, v]) => v !== void 0)
6025
6432
  );
@@ -6033,7 +6440,7 @@ var FlatCustomDomains = class {
6033
6440
  }
6034
6441
  http;
6035
6442
  async list(params = {}) {
6036
- const query3 = stripUndefined17({ ...params });
6443
+ const query3 = stripUndefined19({ ...params });
6037
6444
  const data = await this.http.get("/custom-domains", query3);
6038
6445
  return listItems5(data);
6039
6446
  }
@@ -6045,7 +6452,7 @@ var FlatCustomDomains = class {
6045
6452
  redirectPolicy,
6046
6453
  ...rest
6047
6454
  } = params;
6048
- const body4 = stripUndefined17({
6455
+ const body5 = stripUndefined19({
6049
6456
  ...rest,
6050
6457
  resource_type: resourceType ?? rest.resource_type,
6051
6458
  resource_id: resourceId ?? rest.resource_id,
@@ -6053,16 +6460,16 @@ var FlatCustomDomains = class {
6053
6460
  });
6054
6461
  const data = await this.http.request("/custom-domains", {
6055
6462
  method: "POST",
6056
- body: body4,
6463
+ body: body5,
6057
6464
  headers: { "Idempotency-Key": idempotencyKey5(ikey) }
6058
6465
  });
6059
- return unwrap32(data);
6466
+ return unwrap34(data);
6060
6467
  }
6061
6468
  async delete(domainId) {
6062
6469
  await this.http.delete(`/custom-domains/${domainId}`);
6063
6470
  }
6064
6471
  };
6065
- function unwrap33(payload) {
6472
+ function unwrap35(payload) {
6066
6473
  if (payload && typeof payload === "object" && "data" in payload) {
6067
6474
  return payload.data;
6068
6475
  }
@@ -6078,7 +6485,7 @@ function listItems6(payload, candidateKeys = ["data", "functions", "items"]) {
6078
6485
  }
6079
6486
  return [];
6080
6487
  }
6081
- function stripUndefined18(input) {
6488
+ function stripUndefined20(input) {
6082
6489
  return Object.fromEntries(
6083
6490
  Object.entries(input).filter(([, v]) => v !== void 0)
6084
6491
  );
@@ -6092,40 +6499,40 @@ var Functions = class {
6092
6499
  }
6093
6500
  http;
6094
6501
  async list(params = {}) {
6095
- const query3 = stripUndefined18({ ...params });
6502
+ const query3 = stripUndefined20({ ...params });
6096
6503
  const data = await this.http.get("/functions", query3);
6097
6504
  return listItems6(data);
6098
6505
  }
6099
6506
  async get(functionId) {
6100
6507
  const data = await this.http.get(`/functions/${functionId}`);
6101
- return unwrap33(data);
6508
+ return unwrap35(data);
6102
6509
  }
6103
6510
  async create(params) {
6104
6511
  const { idempotencyKey: ikey, memoryMb, timeoutSec, ...rest } = params;
6105
- const body4 = stripUndefined18({
6512
+ const body5 = stripUndefined20({
6106
6513
  ...rest,
6107
6514
  memory_mb: memoryMb ?? rest.memory_mb,
6108
6515
  timeout_sec: timeoutSec ?? rest.timeout_sec
6109
6516
  });
6110
6517
  const data = await this.http.request("/functions", {
6111
6518
  method: "POST",
6112
- body: body4,
6519
+ body: body5,
6113
6520
  headers: { "Idempotency-Key": idempotencyKey6(ikey) }
6114
6521
  });
6115
- return unwrap33(data);
6522
+ return unwrap35(data);
6116
6523
  }
6117
6524
  async update(functionId, params) {
6118
6525
  const { memoryMb, timeoutSec, ...rest } = params;
6119
- const body4 = stripUndefined18({
6526
+ const body5 = stripUndefined20({
6120
6527
  ...rest,
6121
6528
  memory_mb: memoryMb ?? rest.memory_mb,
6122
6529
  timeout_sec: timeoutSec ?? rest.timeout_sec
6123
6530
  });
6124
6531
  const data = await this.http.patch(
6125
6532
  `/functions/${functionId}`,
6126
- body4
6533
+ body5
6127
6534
  );
6128
- return unwrap33(data);
6535
+ return unwrap35(data);
6129
6536
  }
6130
6537
  async delete(functionId) {
6131
6538
  await this.http.delete(`/functions/${functionId}`);
@@ -6146,7 +6553,7 @@ var Functions = class {
6146
6553
  return data ?? {};
6147
6554
  }
6148
6555
  };
6149
- function unwrap34(payload) {
6556
+ function unwrap36(payload) {
6150
6557
  if (payload && typeof payload === "object" && "data" in payload) {
6151
6558
  return payload.data;
6152
6559
  }
@@ -6162,7 +6569,7 @@ function listItems7(payload, candidateKeys = ["data", "health_checks", "items"])
6162
6569
  }
6163
6570
  return [];
6164
6571
  }
6165
- function stripUndefined19(input) {
6572
+ function stripUndefined21(input) {
6166
6573
  return Object.fromEntries(
6167
6574
  Object.entries(input).filter(([, v]) => v !== void 0)
6168
6575
  );
@@ -6176,13 +6583,13 @@ var HealthChecks = class {
6176
6583
  }
6177
6584
  http;
6178
6585
  async list(params = {}) {
6179
- const query3 = stripUndefined19({ ...params });
6586
+ const query3 = stripUndefined21({ ...params });
6180
6587
  const data = await this.http.get("/health-checks", query3);
6181
6588
  return listItems7(data);
6182
6589
  }
6183
6590
  async get(checkId) {
6184
6591
  const data = await this.http.get(`/health-checks/${checkId}`);
6185
- return unwrap34(data);
6592
+ return unwrap36(data);
6186
6593
  }
6187
6594
  async create(params) {
6188
6595
  const {
@@ -6192,7 +6599,7 @@ var HealthChecks = class {
6192
6599
  expectedStatus,
6193
6600
  ...rest
6194
6601
  } = params;
6195
- const body4 = stripUndefined19({
6602
+ const body5 = stripUndefined21({
6196
6603
  ...rest,
6197
6604
  interval_sec: intervalSec ?? rest.interval_sec,
6198
6605
  timeout_sec: timeoutSec ?? rest.timeout_sec,
@@ -6200,14 +6607,14 @@ var HealthChecks = class {
6200
6607
  });
6201
6608
  const data = await this.http.request("/health-checks", {
6202
6609
  method: "POST",
6203
- body: body4,
6610
+ body: body5,
6204
6611
  headers: { "Idempotency-Key": idempotencyKey7(ikey) }
6205
6612
  });
6206
- return unwrap34(data);
6613
+ return unwrap36(data);
6207
6614
  }
6208
6615
  async update(checkId, params) {
6209
6616
  const { intervalSec, timeoutSec, expectedStatus, ...rest } = params;
6210
- const body4 = stripUndefined19({
6617
+ const body5 = stripUndefined21({
6211
6618
  ...rest,
6212
6619
  interval_sec: intervalSec ?? rest.interval_sec,
6213
6620
  timeout_sec: timeoutSec ?? rest.timeout_sec,
@@ -6215,9 +6622,9 @@ var HealthChecks = class {
6215
6622
  });
6216
6623
  const data = await this.http.patch(
6217
6624
  `/health-checks/${checkId}`,
6218
- body4
6625
+ body5
6219
6626
  );
6220
- return unwrap34(data);
6627
+ return unwrap36(data);
6221
6628
  }
6222
6629
  async delete(checkId) {
6223
6630
  await this.http.delete(`/health-checks/${checkId}`);
@@ -6225,7 +6632,7 @@ var HealthChecks = class {
6225
6632
  };
6226
6633
 
6227
6634
  // src/resources/integrations.ts
6228
- function unwrap35(payload) {
6635
+ function unwrap37(payload) {
6229
6636
  if (payload && typeof payload === "object") {
6230
6637
  const p = payload;
6231
6638
  for (const k of ["data", "integrations", "catalog", "items"]) {
@@ -6235,11 +6642,11 @@ function unwrap35(payload) {
6235
6642
  return payload;
6236
6643
  }
6237
6644
  function listItems8(payload) {
6238
- const result = unwrap35(payload);
6645
+ const result = unwrap37(payload);
6239
6646
  if (Array.isArray(result)) return result;
6240
6647
  return [];
6241
6648
  }
6242
- function stripUndefined20(input) {
6649
+ function stripUndefined22(input) {
6243
6650
  return Object.fromEntries(
6244
6651
  Object.entries(input).filter(([, v]) => v !== void 0)
6245
6652
  );
@@ -6264,14 +6671,14 @@ var Integrations = class {
6264
6671
  const data = await this.http.get(
6265
6672
  `/integrations/${provider}/start`
6266
6673
  );
6267
- return unwrap35(data);
6674
+ return unwrap37(data);
6268
6675
  }
6269
6676
  /** Force-refresh the access token for a provider. */
6270
6677
  async refresh(provider) {
6271
6678
  const data = await this.http.post(
6272
6679
  `/integrations/${provider}/refresh`
6273
6680
  );
6274
- return unwrap35(data);
6681
+ return unwrap37(data);
6275
6682
  }
6276
6683
  /** Disconnect (revoke) an integration. */
6277
6684
  async disconnect(provider) {
@@ -6291,41 +6698,41 @@ var Integrations = class {
6291
6698
  // ── Test hooks ─────────────────────────────────────────────────────────────
6292
6699
  /** Send a test message to the connected Slack channel. */
6293
6700
  async slackSendTest(params = {}) {
6294
- const body4 = stripUndefined20(params);
6701
+ const body5 = stripUndefined22(params);
6295
6702
  const data = await this.http.post(
6296
6703
  "/integrations/slack/send-test",
6297
- body4
6704
+ body5
6298
6705
  );
6299
- return unwrap35(data);
6706
+ return unwrap37(data);
6300
6707
  }
6301
6708
  /** Send a test message to the connected Discord channel. */
6302
6709
  async discordSendTest(params = {}) {
6303
- const body4 = stripUndefined20(params);
6710
+ const body5 = stripUndefined22(params);
6304
6711
  const data = await this.http.post(
6305
6712
  "/integrations/discord/send-test",
6306
- body4
6713
+ body5
6307
6714
  );
6308
- return unwrap35(data);
6715
+ return unwrap37(data);
6309
6716
  }
6310
6717
  // ── Linear dedicated controller ────────────────────────────────────────────
6311
6718
  /** Begin Linear OAuth — Linear has provider-specific error shapes. */
6312
6719
  async linearStart() {
6313
6720
  const data = await this.http.get("/integrations/linear/start");
6314
- return unwrap35(data);
6721
+ return unwrap37(data);
6315
6722
  }
6316
6723
  /** Create a Linear issue via the connected workspace. */
6317
6724
  async linearCreateIssue(params = {}) {
6318
- const body4 = stripUndefined20(params);
6725
+ const body5 = stripUndefined22(params);
6319
6726
  const data = await this.http.post(
6320
6727
  "/integrations/linear/create-issue",
6321
- body4
6728
+ body5
6322
6729
  );
6323
- return unwrap35(data);
6730
+ return unwrap37(data);
6324
6731
  }
6325
6732
  };
6326
6733
 
6327
6734
  // src/resources/mcp.ts
6328
- function unwrap36(payload) {
6735
+ function unwrap38(payload) {
6329
6736
  if (payload && typeof payload === "object") {
6330
6737
  const p = payload;
6331
6738
  for (const k of ["data", "mcp", "result", "items"]) {
@@ -6334,7 +6741,7 @@ function unwrap36(payload) {
6334
6741
  }
6335
6742
  return payload;
6336
6743
  }
6337
- function stripUndefined21(input) {
6744
+ function stripUndefined23(input) {
6338
6745
  return Object.fromEntries(
6339
6746
  Object.entries(input).filter(([, v]) => v !== void 0)
6340
6747
  );
@@ -6346,12 +6753,12 @@ var Mcp = class {
6346
6753
  http;
6347
6754
  /** Send a JSON-RPC request to the MCP endpoint. */
6348
6755
  async dispatch(params = {}) {
6349
- const body4 = stripUndefined21(params);
6756
+ const body5 = stripUndefined23(params);
6350
6757
  const data = await this.http.post(
6351
6758
  "/mcp",
6352
- Object.keys(body4).length > 0 ? body4 : void 0
6759
+ Object.keys(body5).length > 0 ? body5 : void 0
6353
6760
  );
6354
- return unwrap36(data);
6761
+ return unwrap38(data);
6355
6762
  }
6356
6763
  /**
6357
6764
  * Open the MCP listen channel (GET).
@@ -6361,7 +6768,7 @@ var Mcp = class {
6361
6768
  */
6362
6769
  async listen() {
6363
6770
  const data = await this.http.get("/mcp");
6364
- return unwrap36(data);
6771
+ return unwrap38(data);
6365
6772
  }
6366
6773
  /** Close (terminate) the MCP session. */
6367
6774
  async close() {
@@ -6370,7 +6777,7 @@ var Mcp = class {
6370
6777
  };
6371
6778
 
6372
6779
  // src/resources/models.ts
6373
- function unwrap37(data) {
6780
+ function unwrap39(data) {
6374
6781
  if (Array.isArray(data)) return data;
6375
6782
  if (data && typeof data === "object") {
6376
6783
  const d = data;
@@ -6391,7 +6798,7 @@ var Models = class {
6391
6798
  Object.entries(filters).filter(([, v]) => v !== void 0)
6392
6799
  );
6393
6800
  const data = await this.http.get("/intelligence/models", query3);
6394
- return unwrap37(data);
6801
+ return unwrap39(data);
6395
6802
  }
6396
6803
  /**
6397
6804
  * Get a single model by id.
@@ -7034,7 +7441,7 @@ function resourcePayload(params) {
7034
7441
  return { resource_type, resource_id };
7035
7442
  }
7036
7443
  function authConfig(params) {
7037
- return stripUndefined22({
7444
+ return stripUndefined24({
7038
7445
  ...params.config ?? {},
7039
7446
  signup_enabled: params.signup_enabled ?? params.signupEnabled,
7040
7447
  email_confirm_required: params.email_confirm_required ?? params.emailConfirmRequired,
@@ -7042,12 +7449,12 @@ function authConfig(params) {
7042
7449
  });
7043
7450
  }
7044
7451
  function requestBody(params) {
7045
- return stripUndefined22({
7452
+ return stripUndefined24({
7046
7453
  ...resourcePayload(params),
7047
7454
  config: authConfig(params)
7048
7455
  });
7049
7456
  }
7050
- function unwrap38(payload) {
7457
+ function unwrap40(payload) {
7051
7458
  if (payload && typeof payload === "object") {
7052
7459
  const p = payload;
7053
7460
  for (const k of ["data", "project_auth", "config", "items"]) {
@@ -7056,7 +7463,7 @@ function unwrap38(payload) {
7056
7463
  }
7057
7464
  return payload;
7058
7465
  }
7059
- function stripUndefined22(input) {
7466
+ function stripUndefined24(input) {
7060
7467
  return Object.fromEntries(
7061
7468
  Object.entries(input).filter(([, v]) => v !== void 0)
7062
7469
  );
@@ -7072,13 +7479,13 @@ var ProjectAuth = class {
7072
7479
  "/project-auth/status",
7073
7480
  resourcePayload(params)
7074
7481
  );
7075
- return unwrap38(data);
7482
+ return unwrap40(data);
7076
7483
  }
7077
7484
  /** Enable project auth. */
7078
7485
  async enable(params) {
7079
- const body4 = requestBody(params);
7080
- const data = await this.http.post("/project-auth/enable", body4);
7081
- return unwrap38(data);
7486
+ const body5 = requestBody(params);
7487
+ const data = await this.http.post("/project-auth/enable", body5);
7488
+ return unwrap40(data);
7082
7489
  }
7083
7490
  /** Disable project auth. */
7084
7491
  async disable(params) {
@@ -7086,18 +7493,18 @@ var ProjectAuth = class {
7086
7493
  "/project-auth/disable",
7087
7494
  resourcePayload(params)
7088
7495
  );
7089
- return unwrap38(data);
7496
+ return unwrap40(data);
7090
7497
  }
7091
7498
  /** Update project-auth configuration. */
7092
7499
  async update(params) {
7093
- const body4 = requestBody(params);
7094
- const data = await this.http.patch("/project-auth/config", body4);
7095
- return unwrap38(data);
7500
+ const body5 = requestBody(params);
7501
+ const data = await this.http.patch("/project-auth/config", body5);
7502
+ return unwrap40(data);
7096
7503
  }
7097
7504
  };
7098
7505
 
7099
7506
  // src/resources/project-integrations.ts
7100
- function unwrap39(payload) {
7507
+ function unwrap41(payload) {
7101
7508
  if (payload && typeof payload === "object") {
7102
7509
  const p = payload;
7103
7510
  for (const k of ["data", "project_integrations", "catalog", "items"]) {
@@ -7107,11 +7514,11 @@ function unwrap39(payload) {
7107
7514
  return payload;
7108
7515
  }
7109
7516
  function listItems9(payload) {
7110
- const result = unwrap39(payload);
7517
+ const result = unwrap41(payload);
7111
7518
  if (Array.isArray(result)) return result;
7112
7519
  return [];
7113
7520
  }
7114
- function stripUndefined23(input) {
7521
+ function stripUndefined25(input) {
7115
7522
  return Object.fromEntries(
7116
7523
  Object.entries(input).filter(([, v]) => v !== void 0)
7117
7524
  );
@@ -7128,7 +7535,7 @@ var ProjectIntegrations = class {
7128
7535
  http;
7129
7536
  /** List project integrations. */
7130
7537
  async list(params = {}) {
7131
- const query3 = stripUndefined23(params);
7538
+ const query3 = stripUndefined25(params);
7132
7539
  const data = await this.http.get("/project-integrations", query3);
7133
7540
  return listItems9(data);
7134
7541
  }
@@ -7142,22 +7549,22 @@ var ProjectIntegrations = class {
7142
7549
  const data = await this.http.get(
7143
7550
  `/project-integrations/${integrationId}`
7144
7551
  );
7145
- return unwrap39(data);
7552
+ return unwrap41(data);
7146
7553
  }
7147
7554
  /** Create a project integration. */
7148
7555
  async create(params) {
7149
- const body4 = stripUndefObj2(params);
7150
- const data = await this.http.post("/project-integrations", body4);
7151
- return unwrap39(data);
7556
+ const body5 = stripUndefObj2(params);
7557
+ const data = await this.http.post("/project-integrations", body5);
7558
+ return unwrap41(data);
7152
7559
  }
7153
7560
  /** Update a project integration. */
7154
7561
  async update(integrationId, params) {
7155
- const body4 = stripUndefObj2(params);
7562
+ const body5 = stripUndefObj2(params);
7156
7563
  const data = await this.http.patch(
7157
7564
  `/project-integrations/${integrationId}`,
7158
- body4
7565
+ body5
7159
7566
  );
7160
- return unwrap39(data);
7567
+ return unwrap41(data);
7161
7568
  }
7162
7569
  /** Delete a project integration. */
7163
7570
  async delete(integrationId) {
@@ -7166,7 +7573,7 @@ var ProjectIntegrations = class {
7166
7573
  };
7167
7574
 
7168
7575
  // src/resources/provider-defaults.ts
7169
- function unwrap40(data) {
7576
+ function unwrap42(data) {
7170
7577
  if (data && typeof data === "object") {
7171
7578
  const d = data;
7172
7579
  for (const k of ["data", "defaults", "provider_defaults", "config"]) {
@@ -7182,7 +7589,7 @@ var ProviderDefaults = class {
7182
7589
  http;
7183
7590
  /** Get the current fleet-wide provider defaults. */
7184
7591
  async list() {
7185
- return unwrap40(await this.http.get("/admin/provider-defaults"));
7592
+ return unwrap42(await this.http.get("/admin/provider-defaults"));
7186
7593
  }
7187
7594
  /** Return the defaults entry for a single provider, or {} if missing. */
7188
7595
  async get(provider) {
@@ -7195,29 +7602,29 @@ var ProviderDefaults = class {
7195
7602
  }
7196
7603
  /** Replace the fleet-wide defaults (PUT /admin/provider-defaults). */
7197
7604
  async update(opts) {
7198
- const body4 = Object.fromEntries(
7605
+ const body5 = Object.fromEntries(
7199
7606
  Object.entries(opts).filter(([, v]) => v !== void 0)
7200
7607
  );
7201
- return unwrap40(
7202
- await this.http.put("/admin/provider-defaults", body4)
7608
+ return unwrap42(
7609
+ await this.http.put("/admin/provider-defaults", body5)
7203
7610
  );
7204
7611
  }
7205
7612
  // ── Per-tenant overrides ────────────────────────────────────────────────
7206
7613
  async getTenant(tenantId) {
7207
- return unwrap40(
7614
+ return unwrap42(
7208
7615
  await this.http.get(
7209
7616
  `/admin/tenants/${tenantId}/provider-config`
7210
7617
  )
7211
7618
  );
7212
7619
  }
7213
7620
  async setTenant(tenantId, opts) {
7214
- const body4 = Object.fromEntries(
7621
+ const body5 = Object.fromEntries(
7215
7622
  Object.entries(opts).filter(([, v]) => v !== void 0)
7216
7623
  );
7217
- return unwrap40(
7624
+ return unwrap42(
7218
7625
  await this.http.put(
7219
7626
  `/admin/tenants/${tenantId}/provider-config`,
7220
- body4
7627
+ body5
7221
7628
  )
7222
7629
  );
7223
7630
  }
@@ -7227,7 +7634,7 @@ var ProviderDefaults = class {
7227
7634
  };
7228
7635
 
7229
7636
  // src/resources/regions.ts
7230
- function unwrap41(payload) {
7637
+ function unwrap43(payload) {
7231
7638
  if (payload && typeof payload === "object") {
7232
7639
  const p = payload;
7233
7640
  for (const k of [
@@ -7244,7 +7651,7 @@ function unwrap41(payload) {
7244
7651
  return payload;
7245
7652
  }
7246
7653
  function listItems10(payload) {
7247
- const result = unwrap41(payload);
7654
+ const result = unwrap43(payload);
7248
7655
  if (Array.isArray(result)) return result;
7249
7656
  return [];
7250
7657
  }
@@ -7258,6 +7665,11 @@ var Regions = class {
7258
7665
  const data = await this.http.get("/compute/regions");
7259
7666
  return listItems10(data);
7260
7667
  }
7668
+ /** Get canonical compute catalog, including product templates and readiness. */
7669
+ async catalog() {
7670
+ const data = await this.http.get("/compute/catalog");
7671
+ return unwrap43(data);
7672
+ }
7261
7673
  /** List available compute sizes. */
7262
7674
  async listSizes() {
7263
7675
  const data = await this.http.get("/compute/sizes");
@@ -7266,7 +7678,7 @@ var Regions = class {
7266
7678
  /** Get static compute pricing data. */
7267
7679
  async pricing() {
7268
7680
  const data = await this.http.get("/compute/pricing");
7269
- return unwrap41(data);
7681
+ return unwrap43(data);
7270
7682
  }
7271
7683
  /** List community computer templates. */
7272
7684
  async listTemplates() {
@@ -7278,18 +7690,18 @@ var Regions = class {
7278
7690
  const data = await this.http.get(
7279
7691
  `/compute/templates/${templateId}`
7280
7692
  );
7281
- return unwrap41(data);
7693
+ return unwrap43(data);
7282
7694
  }
7283
7695
  };
7284
7696
 
7285
7697
  // src/resources/runtime-env.ts
7286
- function unwrap42(payload) {
7698
+ function unwrap44(payload) {
7287
7699
  if (payload !== null && typeof payload === "object" && "data" in payload && payload.data !== void 0) {
7288
7700
  return payload.data;
7289
7701
  }
7290
7702
  return payload;
7291
7703
  }
7292
- function body3(params) {
7704
+ function body4(params) {
7293
7705
  return Object.fromEntries(
7294
7706
  Object.entries({
7295
7707
  scope: params.scope,
@@ -7336,11 +7748,11 @@ var RuntimeEnv = class {
7336
7748
  "/runtime-env",
7337
7749
  query2(params)
7338
7750
  );
7339
- return unwrap42(response).map(normalize2);
7751
+ return unwrap44(response).map(normalize2);
7340
7752
  }
7341
7753
  async get(id) {
7342
7754
  return normalize2(
7343
- unwrap42(
7755
+ unwrap44(
7344
7756
  await this.http.get(
7345
7757
  `/runtime-env/${encodeURIComponent(id)}`
7346
7758
  )
@@ -7349,10 +7761,10 @@ var RuntimeEnv = class {
7349
7761
  }
7350
7762
  async set(params) {
7351
7763
  return normalize2(
7352
- unwrap42(
7764
+ unwrap44(
7353
7765
  await this.http.post(
7354
7766
  "/runtime-env",
7355
- body3(params)
7767
+ body4(params)
7356
7768
  )
7357
7769
  )
7358
7770
  );
@@ -7363,7 +7775,7 @@ var RuntimeEnv = class {
7363
7775
  };
7364
7776
 
7365
7777
  // src/resources/runtime-capabilities.ts
7366
- function unwrap43(payload) {
7778
+ function unwrap45(payload) {
7367
7779
  if (payload && typeof payload === "object" && "data" in payload) {
7368
7780
  return payload.data;
7369
7781
  }
@@ -7375,7 +7787,7 @@ var RuntimeCapabilitiesResource = class {
7375
7787
  }
7376
7788
  http;
7377
7789
  async get() {
7378
- return unwrap43(
7790
+ return unwrap45(
7379
7791
  await this.http.get("/runtime-capabilities")
7380
7792
  );
7381
7793
  }
@@ -7391,11 +7803,21 @@ function encodeContent(content) {
7391
7803
  return btoa(bin);
7392
7804
  }
7393
7805
  var SANDBOX_TEMPLATE = "miosa-sandbox";
7806
+ var SANDBOX_SHAPE_CONTRACTS = {
7807
+ xs: { cpuCount: 1, memoryMb: 2048, diskSizeMb: 10240 },
7808
+ small: { cpuCount: 2, memoryMb: 4096, diskSizeMb: 10240 },
7809
+ medium: { cpuCount: 4, memoryMb: 8192, diskSizeMb: 20480 },
7810
+ large: { cpuCount: 8, memoryMb: 16384, diskSizeMb: 40960 },
7811
+ xl: { cpuCount: 16, memoryMb: 32768, diskSizeMb: 81920 }
7812
+ };
7394
7813
  var AGENT_WORKSPACE_TIMEOUT_SEC = 86400;
7395
7814
  var AGENT_WORKSPACE_IDLE_TIMEOUT_SEC = 1800;
7396
7815
  var AGENT_WORKSPACE_SNAPSHOT_EXPIRATION_DAYS = 30;
7397
7816
  var AGENT_WORKSPACE_KEEP_LAST_SNAPSHOTS = 1;
7398
- function unwrap44(payload) {
7817
+ function isLegacyForkParams(opts) {
7818
+ return "name" in opts || "metadata" in opts;
7819
+ }
7820
+ function unwrap46(payload) {
7399
7821
  if (payload !== null && typeof payload === "object" && "data" in payload && payload.data !== void 0) {
7400
7822
  return payload.data;
7401
7823
  }
@@ -7434,23 +7856,55 @@ function createBody(params = {}) {
7434
7856
  const persistent = params.persistent;
7435
7857
  const snapshotExpirationSec = snapshotExpirationSeconds(params);
7436
7858
  const keepLastSnapshots = params.keepLastSnapshots ?? params.keep_last_snapshots;
7859
+ const legacyPersistencePolicy = persistent !== void 0 && (snapshotExpirationSec !== void 0 || keepLastSnapshots !== void 0);
7437
7860
  const metadata = { ...params.metadata ?? {} };
7438
- if (persistent !== void 0) metadata.miosa_persistent = persistent;
7861
+ if (legacyPersistencePolicy) metadata.miosa_persistent = persistent;
7862
+ const cpuCount = params.cpuCount ?? params.cpu_count;
7863
+ const memoryMb = params.memoryMb ?? params.memory_mb;
7864
+ const diskMb = params.diskMb ?? params.disk_mb ?? params.diskSizeMb ?? params.disk_size_mb;
7865
+ const suppliedResources = [cpuCount, memoryMb, diskMb].filter(
7866
+ (value) => value !== void 0
7867
+ ).length;
7868
+ if (suppliedResources !== 0 && suppliedResources !== 3) {
7869
+ throw new TypeError(
7870
+ "Raw sandbox resources require cpuCount, memoryMb, and diskSizeMb together. Prefer size."
7871
+ );
7872
+ }
7873
+ let resolvedSize = params.size;
7874
+ if (suppliedResources === 3) {
7875
+ const matchingSize = Object.entries(SANDBOX_SHAPE_CONTRACTS).find(
7876
+ ([, contract]) => contract.cpuCount === cpuCount && contract.memoryMb === memoryMb && contract.diskSizeMb === diskMb
7877
+ )?.[0];
7878
+ if (!matchingSize) {
7879
+ throw new TypeError(
7880
+ "Raw sandbox resources must exactly match a named size contract."
7881
+ );
7882
+ }
7883
+ if (resolvedSize && resolvedSize !== matchingSize) {
7884
+ throw new TypeError(
7885
+ `Raw sandbox resources match ${matchingSize}, not requested size ${resolvedSize}.`
7886
+ );
7887
+ }
7888
+ resolvedSize = matchingSize;
7889
+ }
7439
7890
  if (snapshotExpirationSec !== void 0) {
7440
7891
  metadata.snapshot_expiration_sec = snapshotExpirationSec;
7441
7892
  }
7442
7893
  if (keepLastSnapshots !== void 0) {
7443
7894
  metadata.keep_last_snapshots = keepLastSnapshots;
7444
7895
  }
7445
- return stripUndefined24({
7896
+ return stripUndefined26({
7446
7897
  template_id: templateId,
7447
- cpu_count: params.cpuCount ?? params.cpu_count,
7448
- memory_mb: params.memoryMb ?? params.memory_mb,
7898
+ size: resolvedSize,
7899
+ persistent,
7900
+ cpu_count: cpuCount,
7901
+ memory_mb: memoryMb,
7449
7902
  disk_mb: params.diskMb ?? params.disk_mb,
7450
7903
  disk_size_mb: params.diskSizeMb ?? params.disk_size_mb,
7451
- timeout_sec: params.timeoutSec ?? params.timeout_sec ?? (persistent === true ? 86400 : void 0),
7452
- idle_timeout_sec: params.idleTimeoutSec ?? params.idle_timeout_sec ?? (persistent === true ? 1800 : void 0),
7904
+ timeout_sec: params.timeoutSec ?? params.timeout_sec ?? (legacyPersistencePolicy && persistent === true ? 86400 : void 0),
7905
+ idle_timeout_sec: params.idleTimeoutSec ?? params.idle_timeout_sec ?? (legacyPersistencePolicy && persistent === true ? 1800 : void 0),
7453
7906
  always_on: params.alwaysOn ?? params.always_on,
7907
+ allow_provision: params.allowProvision ?? params.allow_provision,
7454
7908
  env: params.env,
7455
7909
  metadata: Object.keys(metadata).length > 0 ? metadata : void 0,
7456
7910
  services: params.services,
@@ -7472,14 +7926,14 @@ function createBody(params = {}) {
7472
7926
  });
7473
7927
  }
7474
7928
  function execBody(command, options = {}) {
7475
- return stripUndefined24({
7929
+ return stripUndefined26({
7476
7930
  command,
7477
7931
  cwd: options.cwd ?? options.workingDir ?? options.working_dir,
7478
7932
  env: options.env,
7479
7933
  timeout: options.timeout ?? options.timeoutSec ?? options.timeout_sec
7480
7934
  });
7481
7935
  }
7482
- function stripUndefined24(input) {
7936
+ function stripUndefined26(input) {
7483
7937
  return Object.fromEntries(
7484
7938
  Object.entries(input).filter(([, value]) => value !== void 0)
7485
7939
  );
@@ -7621,11 +8075,11 @@ var SandboxTerminal = class {
7621
8075
  }
7622
8076
  sandbox;
7623
8077
  async create(params = {}) {
7624
- const body4 = Object.fromEntries(
8078
+ const body5 = Object.fromEntries(
7625
8079
  Object.entries(params).filter(([, v]) => v !== void 0)
7626
8080
  );
7627
- const response = unwrap44(
7628
- await this.sandbox.http.post(`/sandboxes/${this.sandbox.id}/terminal`, body4)
8081
+ const response = unwrap46(
8082
+ await this.sandbox.http.post(`/sandboxes/${this.sandbox.id}/terminal`, body5)
7629
8083
  );
7630
8084
  return response;
7631
8085
  }
@@ -7645,6 +8099,15 @@ var SandboxEvents = class {
7645
8099
  return this.sandbox.http.stream(`/sandboxes/${this.sandbox.id}/events`);
7646
8100
  }
7647
8101
  };
8102
+ var SandboxMetrics = class {
8103
+ constructor(sandbox) {
8104
+ this.sandbox = sandbox;
8105
+ }
8106
+ sandbox;
8107
+ get(window2 = "1h") {
8108
+ return this.sandbox.metrics(window2);
8109
+ }
8110
+ };
7648
8111
  var SandboxPreviews = class {
7649
8112
  constructor(sandbox) {
7650
8113
  this.sandbox = sandbox;
@@ -7667,21 +8130,21 @@ var SandboxPreviews = class {
7667
8130
  return [];
7668
8131
  }
7669
8132
  async create(port, opts = {}) {
7670
- const body4 = {
8133
+ const body5 = {
7671
8134
  port,
7672
8135
  ...Object.fromEntries(
7673
8136
  Object.entries(opts).filter(([, v]) => v !== void 0)
7674
8137
  )
7675
8138
  };
7676
- return unwrap44(
8139
+ return unwrap46(
7677
8140
  await this.http.post(
7678
8141
  `/sandboxes/${this.sandbox.id}/previews`,
7679
- body4
8142
+ body5
7680
8143
  )
7681
8144
  );
7682
8145
  }
7683
8146
  async get(previewId) {
7684
- return unwrap44(
8147
+ return unwrap46(
7685
8148
  await this.http.get(
7686
8149
  `/sandboxes/${this.sandbox.id}/previews/${previewId}`
7687
8150
  )
@@ -7694,7 +8157,7 @@ var SandboxPreviews = class {
7694
8157
  }
7695
8158
  /** Mint a share token for previewId. */
7696
8159
  async share(previewId, opts = {}) {
7697
- return unwrap44(
8160
+ return unwrap46(
7698
8161
  await this.http.post(
7699
8162
  `/sandboxes/${this.sandbox.id}/previews/${previewId}/share`,
7700
8163
  { ttl_seconds: opts.ttl_seconds ?? opts.expires_in_sec ?? 3600 }
@@ -7763,7 +8226,7 @@ var SandboxTags = class {
7763
8226
  sandbox;
7764
8227
  /** Replace the full tag list with tags. */
7765
8228
  async set(tags) {
7766
- return unwrap44(
8229
+ return unwrap46(
7767
8230
  await this.sandbox.http.patch(`/sandboxes/${this.sandbox.id}/tags`, { tags })
7768
8231
  );
7769
8232
  }
@@ -7785,6 +8248,7 @@ var Sandbox = class _Sandbox {
7785
8248
  this.snapshots = new SandboxSnapshots(this);
7786
8249
  this.terminal = new SandboxTerminal(this);
7787
8250
  this.events = new SandboxEvents(this);
8251
+ this.metricsResource = new SandboxMetrics(this);
7788
8252
  this.previews = new SandboxPreviews(this);
7789
8253
  this.env = new SandboxEnv(this);
7790
8254
  this.tags = new SandboxTags(this);
@@ -7807,6 +8271,8 @@ var Sandbox = class _Sandbox {
7807
8271
  terminal;
7808
8272
  /** SSE event stream. */
7809
8273
  events;
8274
+ /** Operational metrics and current resource state. */
8275
+ metricsResource;
7810
8276
  /** Preview CRUD + share/revokeShare. */
7811
8277
  previews;
7812
8278
  /** Read-only env var listing. */
@@ -7834,7 +8300,7 @@ var Sandbox = class _Sandbox {
7834
8300
  return this.data.template_id ?? this.data.image_id ?? "";
7835
8301
  }
7836
8302
  async refresh() {
7837
- this.data = unwrap44(
8303
+ this.data = unwrap46(
7838
8304
  await this.http.get(`/sandboxes/${this.id}`)
7839
8305
  );
7840
8306
  return this;
@@ -7859,9 +8325,24 @@ var Sandbox = class _Sandbox {
7859
8325
  wait: options.wait ?? true
7860
8326
  });
7861
8327
  }
8328
+ /**
8329
+ * Dispatch a prompt into this Sandbox through the Agent Runs API.
8330
+ */
8331
+ async prompt(prompt, options = {}) {
8332
+ return new AgentRuns(this.http).run({
8333
+ ...options,
8334
+ prompt,
8335
+ targetKind: "sandbox",
8336
+ targetId: this.id,
8337
+ sandboxId: this.id,
8338
+ provider: options.provider ?? "claude",
8339
+ cwd: options.cwd ?? "/workspace",
8340
+ wait: options.wait ?? true
8341
+ });
8342
+ }
7862
8343
  async runExec(command, options) {
7863
8344
  this.assertRunning("exec");
7864
- const response = unwrap44(
8345
+ const response = unwrap46(
7865
8346
  await this.http.post(
7866
8347
  `/sandboxes/${this.id}/exec`,
7867
8348
  execBody(command, options)
@@ -7905,11 +8386,11 @@ var Sandbox = class _Sandbox {
7905
8386
  );
7906
8387
  }
7907
8388
  async createExport(params) {
7908
- const body4 = typeof params === "string" ? { path: params } : Array.isArray(params) ? { paths: params } : params;
7909
- const response = unwrap44(
8389
+ const body5 = typeof params === "string" ? { path: params } : Array.isArray(params) ? { paths: params } : params;
8390
+ const response = unwrap46(
7910
8391
  await this.http.post(
7911
8392
  `/sandboxes/${this.id}/exports`,
7912
- body4
8393
+ body5
7913
8394
  )
7914
8395
  );
7915
8396
  return normalizeExport(response);
@@ -7931,7 +8412,7 @@ var Sandbox = class _Sandbox {
7931
8412
  }
7932
8413
  async listFiles(path = "/workspace") {
7933
8414
  this.assertRunning("files.list");
7934
- const response = unwrap44(
8415
+ const response = unwrap46(
7935
8416
  await this.http.get(
7936
8417
  `/sandboxes/${this.id}/files`,
7937
8418
  { path }
@@ -7941,7 +8422,7 @@ var Sandbox = class _Sandbox {
7941
8422
  }
7942
8423
  async statFile(path) {
7943
8424
  this.assertRunning("files.stat");
7944
- return unwrap44(
8425
+ return unwrap46(
7945
8426
  await this.http.post(
7946
8427
  `/sandboxes/${this.id}/files/stat`,
7947
8428
  { path }
@@ -7951,9 +8432,17 @@ var Sandbox = class _Sandbox {
7951
8432
  async expose(port) {
7952
8433
  return (await this.exposeInfo(port)).url;
7953
8434
  }
8435
+ async getUrl(port, path = "/") {
8436
+ const url = new URL((await this.exposeInfo(port)).url);
8437
+ url.pathname = path.startsWith("/") ? path : `/${path}`;
8438
+ return url.toString();
8439
+ }
8440
+ async getHost(port) {
8441
+ return new URL((await this.exposeInfo(port)).url).host;
8442
+ }
7954
8443
  async exposeInfo(port) {
7955
8444
  this.assertRunning("expose");
7956
- const response = unwrap44(
8445
+ const response = unwrap46(
7957
8446
  await this.http.post(
7958
8447
  `/sandboxes/${this.id}/expose`,
7959
8448
  port === void 0 ? {} : { port }
@@ -7963,7 +8452,7 @@ var Sandbox = class _Sandbox {
7963
8452
  }
7964
8453
  async startTemplate(options = {}) {
7965
8454
  this.assertRunning("startTemplate");
7966
- return unwrap44(
8455
+ return unwrap46(
7967
8456
  await this.http.post(
7968
8457
  `/sandboxes/${this.id}/template/start`,
7969
8458
  options
@@ -7971,7 +8460,7 @@ var Sandbox = class _Sandbox {
7971
8460
  );
7972
8461
  }
7973
8462
  async getArtifacts() {
7974
- return unwrap44(
8463
+ return unwrap46(
7975
8464
  await this.http.get(
7976
8465
  `/sandboxes/${this.id}/artifacts`
7977
8466
  )
@@ -7982,16 +8471,27 @@ var Sandbox = class _Sandbox {
7982
8471
  `/sandboxes/${this.id}/logs`,
7983
8472
  { lines }
7984
8473
  );
7985
- return unwrap44(response);
8474
+ return unwrap46(response);
7986
8475
  }
7987
8476
  streamLogs() {
7988
8477
  return this.http.stream(
7989
8478
  `/sandboxes/${this.id}/logs/stream`
7990
8479
  );
7991
8480
  }
8481
+ async metrics(window2 = "1h") {
8482
+ return unwrap46(
8483
+ await this.http.get(
8484
+ `/sandboxes/${this.id}/metrics`,
8485
+ { window: window2 }
8486
+ )
8487
+ );
8488
+ }
8489
+ async getMetrics(window2 = "1h") {
8490
+ return this.metrics(window2);
8491
+ }
7992
8492
  async createSnapshot(comment) {
7993
8493
  this.assertRunning("snapshots.create");
7994
- return unwrap44(
8494
+ return unwrap46(
7995
8495
  await this.http.post(
7996
8496
  `/sandboxes/${this.id}/snapshots`,
7997
8497
  comment ? { comment } : {}
@@ -7999,14 +8499,14 @@ var Sandbox = class _Sandbox {
7999
8499
  );
8000
8500
  }
8001
8501
  async listSnapshots() {
8002
- return unwrap44(
8502
+ return unwrap46(
8003
8503
  await this.http.get(
8004
8504
  `/sandboxes/${this.id}/snapshots`
8005
8505
  )
8006
8506
  );
8007
8507
  }
8008
8508
  async restoreSnapshot(snapshotId) {
8009
- const data = unwrap44(
8509
+ const data = unwrap46(
8010
8510
  await this.http.post(
8011
8511
  `/sandboxes/${this.id}/restore/${snapshotId}`,
8012
8512
  {}
@@ -8017,19 +8517,46 @@ var Sandbox = class _Sandbox {
8017
8517
  async deleteSnapshot(snapshotId) {
8018
8518
  await this.http.delete(`/sandboxes/${this.id}/snapshots/${snapshotId}`);
8019
8519
  }
8020
- /**
8021
- * Fork (clone) this sandbox into a new sandbox via copy-on-write snapshot.
8022
- * The original sandbox continues running unchanged.
8023
- */
8024
8520
  async fork(opts = {}) {
8521
+ if (isLegacyForkParams(opts)) {
8522
+ return this.forkLegacy(opts);
8523
+ }
8025
8524
  this.assertRunning("fork");
8026
- const body4 = {};
8027
- if (opts.name !== void 0) body4.name = opts.name;
8028
- if (opts.metadata !== void 0) body4.metadata = opts.metadata;
8029
- const data = unwrap44(
8030
- await this.http.post(
8525
+ const body5 = stripUndefined26({
8526
+ timeout_sec: opts.timeoutSec ?? opts.timeout_sec,
8527
+ template_id: opts.templateId ?? opts.template_id
8528
+ });
8529
+ const idempotencyKey11 = opts.idempotencyKey ?? opts.idempotency_key;
8530
+ const data = unwrap46(
8531
+ await this.http.request(
8532
+ `/sandboxes/${this.id}/fork`,
8533
+ {
8534
+ method: "POST",
8535
+ body: body5,
8536
+ ...idempotencyKey11 ? { headers: { "Idempotency-Key": idempotencyKey11 } } : {}
8537
+ }
8538
+ )
8539
+ );
8540
+ return new _Sandbox(this.http, data);
8541
+ }
8542
+ /** Fork using private compatibility fields excluded from the public V1 contract. */
8543
+ async forkLegacy(opts = {}) {
8544
+ this.assertRunning("fork");
8545
+ const body5 = stripUndefined26({
8546
+ timeout_sec: opts.timeoutSec ?? opts.timeout_sec,
8547
+ template_id: opts.templateId ?? opts.template_id,
8548
+ name: opts.name,
8549
+ metadata: opts.metadata
8550
+ });
8551
+ const idempotencyKey11 = opts.idempotencyKey ?? opts.idempotency_key;
8552
+ const data = unwrap46(
8553
+ await this.http.request(
8031
8554
  `/sandboxes/${this.id}/fork`,
8032
- body4
8555
+ {
8556
+ method: "POST",
8557
+ body: body5,
8558
+ ...idempotencyKey11 ? { headers: { "Idempotency-Key": idempotencyKey11 } } : {}
8559
+ }
8033
8560
  )
8034
8561
  );
8035
8562
  return new _Sandbox(this.http, data);
@@ -8040,7 +8567,8 @@ var Sandbox = class _Sandbox {
8040
8567
  async update(params) {
8041
8568
  const snapshotExpirationSec = snapshotExpirationSeconds(params);
8042
8569
  const metadata = { ...params.metadata ?? {} };
8043
- if (params.persistent !== void 0) metadata.miosa_persistent = params.persistent;
8570
+ if (params.persistent !== void 0)
8571
+ metadata.miosa_persistent = params.persistent;
8044
8572
  if (snapshotExpirationSec !== void 0) {
8045
8573
  metadata.snapshot_expiration_sec = snapshotExpirationSec;
8046
8574
  }
@@ -8048,7 +8576,7 @@ var Sandbox = class _Sandbox {
8048
8576
  if (keepLastSnapshots !== void 0) {
8049
8577
  metadata.keep_last_snapshots = keepLastSnapshots;
8050
8578
  }
8051
- const body4 = stripUndefined24({
8579
+ const body5 = stripUndefined26({
8052
8580
  name: params.name,
8053
8581
  slug: params.slug,
8054
8582
  tags: params.tags,
@@ -8057,25 +8585,32 @@ var Sandbox = class _Sandbox {
8057
8585
  timeout_sec: params.timeout_sec ?? params.timeoutSec,
8058
8586
  idle_timeout_sec: params.idle_timeout_sec ?? params.idleTimeoutSec
8059
8587
  });
8060
- const data = unwrap44(
8588
+ const data = unwrap46(
8061
8589
  await this.http.patch(
8062
8590
  `/sandboxes/${this.id}`,
8063
- body4
8591
+ body5
8064
8592
  )
8065
8593
  );
8066
8594
  this.data = data;
8067
8595
  return this;
8068
8596
  }
8069
8597
  async extend(timeoutSec) {
8070
- const data = unwrap44(
8598
+ const data = unwrap46(
8071
8599
  await this.http.post(
8072
8600
  `/sandboxes/${this.id}/extend`,
8073
- { timeout_sec: timeoutSec }
8601
+ timeoutSec === void 0 ? {} : { timeout_sec: timeoutSec }
8074
8602
  )
8075
8603
  );
8076
- this.data = data;
8604
+ this.data = { ...this.data, ...data };
8077
8605
  return this;
8078
8606
  }
8607
+ async usage() {
8608
+ return unwrap46(
8609
+ await this.http.get(
8610
+ `/sandboxes/${this.id}/usage`
8611
+ )
8612
+ );
8613
+ }
8079
8614
  /**
8080
8615
  * POST /api/v1/sandboxes/{id}/preview-token → {token, url, expires_at, scope}
8081
8616
  */
@@ -8090,30 +8625,36 @@ var Sandbox = class _Sandbox {
8090
8625
  return raw;
8091
8626
  }
8092
8627
  async pause() {
8093
- const data = unwrap44(
8628
+ const data = unwrap46(
8094
8629
  await this.http.post(
8095
8630
  `/sandboxes/${this.id}/pause`,
8096
8631
  {}
8097
8632
  )
8098
8633
  );
8099
- this.data = data;
8634
+ this.data = { ...this.data, ...data };
8100
8635
  return this;
8101
8636
  }
8102
- async resume() {
8103
- const data = unwrap44(
8104
- await this.http.post(
8105
- `/sandboxes/${this.id}/resume`,
8106
- {}
8107
- )
8637
+ async resume(idempotencyKey11) {
8638
+ const response = idempotencyKey11 ? await this.http.request(
8639
+ `/sandboxes/${this.id}/resume`,
8640
+ {
8641
+ method: "POST",
8642
+ body: {},
8643
+ headers: { "Idempotency-Key": idempotencyKey11 }
8644
+ }
8645
+ ) : await this.http.post(
8646
+ `/sandboxes/${this.id}/resume`,
8647
+ {}
8108
8648
  );
8109
- this.data = data;
8649
+ const data = unwrap46(response);
8650
+ this.data = { ...this.data, ...data };
8110
8651
  return this;
8111
8652
  }
8112
8653
  async deploy(params = {}) {
8113
8654
  const idempotencyKey11 = params.idempotencyKey ?? params.idempotency_key;
8114
8655
  const requestOptions = {
8115
8656
  method: "POST",
8116
- body: stripUndefined24({
8657
+ body: stripUndefined26({
8117
8658
  name: params.name,
8118
8659
  deployment_id: params.deploymentId ?? params.deployment_id,
8119
8660
  output_path: params.outputPath ?? params.output_path ?? params.path ?? params.sourcePath ?? params.source_path,
@@ -8136,7 +8677,7 @@ var Sandbox = class _Sandbox {
8136
8677
  if (idempotencyKey11) {
8137
8678
  requestOptions.headers = { "Idempotency-Key": idempotencyKey11 };
8138
8679
  }
8139
- return unwrap44(
8680
+ return unwrap46(
8140
8681
  await this.http.request(
8141
8682
  `/sandboxes/${this.id}/deploy`,
8142
8683
  requestOptions
@@ -8148,7 +8689,7 @@ var Sandbox = class _Sandbox {
8148
8689
  }
8149
8690
  /** Check readiness of the sandbox (GET /sandboxes/:id/readiness). */
8150
8691
  async readiness() {
8151
- return unwrap44(
8692
+ return unwrap46(
8152
8693
  await this.http.get(
8153
8694
  `/sandboxes/${this.id}/readiness`
8154
8695
  )
@@ -8200,7 +8741,7 @@ var Sandbox = class _Sandbox {
8200
8741
  const headers = {
8201
8742
  Authorization: `Bearer ${this.http.apiKey}`,
8202
8743
  Accept: "text/event-stream",
8203
- "User-Agent": "@miosa/sdk/1.0.0"
8744
+ "User-Agent": SDK_USER_AGENT
8204
8745
  };
8205
8746
  const response = await fetch(
8206
8747
  `${this.http.baseUrl}/sandboxes/${this.id}/readiness/stream`,
@@ -8316,7 +8857,7 @@ var Sandboxes = class {
8316
8857
  if (idempotencyKey11) {
8317
8858
  requestOptions.headers = { "Idempotency-Key": idempotencyKey11 };
8318
8859
  }
8319
- const data = unwrap44(
8860
+ const data = unwrap46(
8320
8861
  await this.http.request(
8321
8862
  "/sandboxes",
8322
8863
  requestOptions
@@ -8335,16 +8876,35 @@ var Sandboxes = class {
8335
8876
  return listItems11(data).map((item) => new Sandbox(this.http, item));
8336
8877
  }
8337
8878
  async get(id) {
8338
- const data = unwrap44(
8879
+ const data = unwrap46(
8339
8880
  await this.http.get(`/sandboxes/${id}`)
8340
8881
  );
8341
8882
  return new Sandbox(this.http, data);
8342
8883
  }
8884
+ async extend(id, timeoutSec) {
8885
+ return (await this.get(id)).extend(timeoutSec);
8886
+ }
8887
+ async usage(id) {
8888
+ return (await this.get(id)).usage();
8889
+ }
8890
+ async pause(id) {
8891
+ return (await this.get(id)).pause();
8892
+ }
8893
+ async resume(id, idempotencyKey11) {
8894
+ return (await this.get(id)).resume(idempotencyKey11);
8895
+ }
8896
+ async fork(id, params = {}) {
8897
+ const sandbox = await this.get(id);
8898
+ return isLegacyForkParams(params) ? sandbox.forkLegacy(params) : sandbox.fork(params);
8899
+ }
8900
+ async forkLegacy(id, params = {}) {
8901
+ return (await this.get(id)).forkLegacy(params);
8902
+ }
8343
8903
  connect(id) {
8344
8904
  return this.get(id);
8345
8905
  }
8346
8906
  async getByName(name) {
8347
- const data = unwrap44(
8907
+ const data = unwrap46(
8348
8908
  await this.http.get(
8349
8909
  `/sandboxes/by-name/${encodeURIComponent(name)}`
8350
8910
  )
@@ -8391,17 +8951,19 @@ var Sandboxes = class {
8391
8951
  );
8392
8952
  }
8393
8953
  async validateBuildSpec(buildSpec) {
8394
- return this.http.post(
8395
- "/sandbox-templates/validate",
8396
- {
8397
- build_spec: buildSpec
8398
- }
8954
+ return unwrap46(
8955
+ await this.http.post(
8956
+ "/sandbox-templates/validate",
8957
+ {
8958
+ build_spec: buildSpec
8959
+ }
8960
+ )
8399
8961
  );
8400
8962
  }
8401
8963
  async createTemplate(params) {
8402
8964
  const response = await this.http.post(
8403
8965
  "/sandbox-templates",
8404
- stripUndefined24({
8966
+ stripUndefined26({
8405
8967
  name: params.name,
8406
8968
  slug: params.slug,
8407
8969
  description: params.description,
@@ -8409,29 +8971,29 @@ var Sandboxes = class {
8409
8971
  metadata: params.metadata
8410
8972
  })
8411
8973
  );
8412
- return unwrap44(response);
8974
+ return unwrap46(response);
8413
8975
  }
8414
8976
  async createTemplateBuild(templateId, params = {}) {
8415
8977
  const response = await this.http.post(
8416
8978
  `/sandbox-templates/${templateId}/builds`,
8417
- stripUndefined24({
8979
+ stripUndefined26({
8418
8980
  build_spec: params.buildSpec ?? params.build_spec,
8419
8981
  metadata: params.metadata
8420
8982
  })
8421
8983
  );
8422
- return unwrap44(response);
8984
+ return unwrap46(response);
8423
8985
  }
8424
8986
  async listTemplateBuilds(templateId) {
8425
8987
  const response = await this.http.get(
8426
8988
  `/sandbox-templates/${templateId}/builds`
8427
8989
  );
8428
- return unwrap44(response);
8990
+ return unwrap46(response);
8429
8991
  }
8430
8992
  async getTemplateBuild(buildId) {
8431
8993
  const response = await this.http.get(
8432
8994
  `/sandbox-template-builds/${buildId}`
8433
8995
  );
8434
- return unwrap44(response);
8996
+ return unwrap46(response);
8435
8997
  }
8436
8998
  };
8437
8999
  function toBase642(bytes) {
@@ -8463,7 +9025,7 @@ function previewInfoFromResponse(response) {
8463
9025
  )
8464
9026
  };
8465
9027
  }
8466
- function unwrap45(payload) {
9028
+ function unwrap47(payload) {
8467
9029
  if (payload && typeof payload === "object" && "data" in payload) {
8468
9030
  return payload.data;
8469
9031
  }
@@ -8479,7 +9041,7 @@ function listItems12(payload, candidateKeys = ["data", "templates", "builds", "i
8479
9041
  }
8480
9042
  return [];
8481
9043
  }
8482
- function stripUndefined25(input) {
9044
+ function stripUndefined27(input) {
8483
9045
  return Object.fromEntries(
8484
9046
  Object.entries(input).filter(([, v]) => v !== void 0)
8485
9047
  );
@@ -8506,7 +9068,7 @@ var SandboxTemplates = class {
8506
9068
  const data = await this.http.get(
8507
9069
  `/sandbox-templates/${templateId}`
8508
9070
  );
8509
- return unwrap45(data);
9071
+ return unwrap47(data);
8510
9072
  }
8511
9073
  async create(params) {
8512
9074
  const {
@@ -8516,17 +9078,17 @@ var SandboxTemplates = class {
8516
9078
  name,
8517
9079
  ...rest
8518
9080
  } = params;
8519
- const body4 = stripUndefined25({
9081
+ const body5 = stripUndefined27({
8520
9082
  name,
8521
9083
  build_spec: buildSpec ?? build_spec,
8522
9084
  ...rest
8523
9085
  });
8524
9086
  const data = await this.http.request("/sandbox-templates", {
8525
9087
  method: "POST",
8526
- body: body4,
9088
+ body: body5,
8527
9089
  headers: { "Idempotency-Key": idempotencyKey8(ikey) }
8528
9090
  });
8529
- return unwrap45(data);
9091
+ return unwrap47(data);
8530
9092
  }
8531
9093
  async buildSpecSchema() {
8532
9094
  const data = await this.http.get("/sandbox-templates/build-spec");
@@ -8550,21 +9112,21 @@ var SandboxTemplates = class {
8550
9112
  }
8551
9113
  async createBuild(templateId, params = {}) {
8552
9114
  const { idempotencyKey: ikey, ...rest } = params;
8553
- const body4 = stripUndefined25(rest);
9115
+ const body5 = stripUndefined27(rest);
8554
9116
  const data = await this.http.request(
8555
9117
  `/sandbox-templates/${templateId}/builds`,
8556
9118
  {
8557
9119
  method: "POST",
8558
- body: body4,
9120
+ body: body5,
8559
9121
  headers: { "Idempotency-Key": idempotencyKey8(ikey) }
8560
9122
  }
8561
9123
  );
8562
- return unwrap45(data);
9124
+ return unwrap47(data);
8563
9125
  }
8564
9126
  };
8565
9127
 
8566
9128
  // src/resources/settings.ts
8567
- function unwrap46(payload) {
9129
+ function unwrap48(payload) {
8568
9130
  if (payload && typeof payload === "object") {
8569
9131
  const p = payload;
8570
9132
  for (const k of [
@@ -8580,11 +9142,11 @@ function unwrap46(payload) {
8580
9142
  return payload;
8581
9143
  }
8582
9144
  function listItems13(payload) {
8583
- const result = unwrap46(payload);
9145
+ const result = unwrap48(payload);
8584
9146
  if (Array.isArray(result)) return result;
8585
9147
  return [];
8586
9148
  }
8587
- function stripUndefined26(input) {
9149
+ function stripUndefined28(input) {
8588
9150
  return Object.fromEntries(
8589
9151
  Object.entries(input).filter(([, v]) => v !== void 0)
8590
9152
  );
@@ -8597,46 +9159,46 @@ var Settings = class {
8597
9159
  /** Get the current tenant settings. */
8598
9160
  async get() {
8599
9161
  const data = await this.http.get("/settings");
8600
- return unwrap46(data);
9162
+ return unwrap48(data);
8601
9163
  }
8602
9164
  /** Update tenant settings. */
8603
9165
  async update(params) {
8604
- const body4 = stripUndefined26(params);
8605
- const data = await this.http.put("/settings", body4);
8606
- return unwrap46(data);
9166
+ const body5 = stripUndefined28(params);
9167
+ const data = await this.http.put("/settings", body5);
9168
+ return unwrap48(data);
8607
9169
  }
8608
9170
  // ── Branding ──────────────────────────────────────────────────────────────
8609
9171
  /** Get tenant branding (logo, colors, custom wordmark). */
8610
9172
  async getBranding() {
8611
9173
  const data = await this.http.get("/settings/branding");
8612
- return unwrap46(data);
9174
+ return unwrap48(data);
8613
9175
  }
8614
9176
  /** Update tenant branding. */
8615
9177
  async updateBranding(params) {
8616
- const body4 = stripUndefined26(params);
8617
- const data = await this.http.put("/settings/branding", body4);
8618
- return unwrap46(data);
9178
+ const body5 = stripUndefined28(params);
9179
+ const data = await this.http.put("/settings/branding", body5);
9180
+ return unwrap48(data);
8619
9181
  }
8620
9182
  // ── Read-only reference data ───────────────────────────────────────────────
8621
9183
  /** Get tenant-scoped compute pricing. */
8622
9184
  async computePricing() {
8623
9185
  const data = await this.http.get("/settings/compute-pricing");
8624
- return unwrap46(data);
9186
+ return unwrap48(data);
8625
9187
  }
8626
9188
  /** Get tenant-scoped GPU pricing. */
8627
9189
  async gpuPricing() {
8628
9190
  const data = await this.http.get("/settings/gpu-pricing");
8629
- return unwrap46(data);
9191
+ return unwrap48(data);
8630
9192
  }
8631
9193
  /** List models available to this tenant. */
8632
9194
  async availableModels() {
8633
9195
  const data = await this.http.get("/settings/available-models");
8634
- return unwrap46(data);
9196
+ return unwrap48(data);
8635
9197
  }
8636
9198
  /** List regions enabled for this tenant. */
8637
9199
  async regions() {
8638
9200
  const data = await this.http.get("/settings/regions");
8639
- return unwrap46(data);
9201
+ return unwrap48(data);
8640
9202
  }
8641
9203
  // ── BYOK provider keys ────────────────────────────────────────────────────
8642
9204
  /** List tenant-level BYOK provider keys (Anthropic, OpenAI, etc.). */
@@ -8646,12 +9208,12 @@ var Settings = class {
8646
9208
  }
8647
9209
  /** Create or update a BYOK provider key. */
8648
9210
  async upsertProviderKey(provider, params) {
8649
- const body4 = stripUndefined26(params);
9211
+ const body5 = stripUndefined28(params);
8650
9212
  const data = await this.http.put(
8651
9213
  `/settings/provider-keys/${provider}`,
8652
- body4
9214
+ body5
8653
9215
  );
8654
- return unwrap46(data);
9216
+ return unwrap48(data);
8655
9217
  }
8656
9218
  /** Delete a BYOK provider key. */
8657
9219
  async deleteProviderKey(provider) {
@@ -8660,7 +9222,7 @@ var Settings = class {
8660
9222
  };
8661
9223
 
8662
9224
  // src/resources/snapshots-standalone.ts
8663
- function unwrap47(data) {
9225
+ function unwrap49(data) {
8664
9226
  if (data && typeof data === "object") {
8665
9227
  const d = data;
8666
9228
  for (const k of ["data", "snapshots", "items"]) {
@@ -8691,14 +9253,14 @@ var SnapshotsStandalone = class {
8691
9253
  return unwrapList14(await this.http.get("/admin/snapshots", query3));
8692
9254
  }
8693
9255
  async get(snapshotId) {
8694
- return unwrap47(
9256
+ return unwrap49(
8695
9257
  await this.http.get(`/admin/snapshots/${snapshotId}`)
8696
9258
  );
8697
9259
  }
8698
9260
  };
8699
9261
 
8700
9262
  // src/resources/storage.ts
8701
- function unwrap48(payload) {
9263
+ function unwrap50(payload) {
8702
9264
  if (payload && typeof payload === "object" && "data" in payload) {
8703
9265
  return payload.data;
8704
9266
  }
@@ -8714,7 +9276,7 @@ function listItems14(payload, candidateKeys = ["data", "buckets", "objects", "it
8714
9276
  }
8715
9277
  return [];
8716
9278
  }
8717
- function stripUndefined27(input) {
9279
+ function stripUndefined29(input) {
8718
9280
  return Object.fromEntries(
8719
9281
  Object.entries(input).filter(([, v]) => v !== void 0)
8720
9282
  );
@@ -8731,24 +9293,24 @@ var Storage = class {
8731
9293
  }
8732
9294
  async createBucket(params) {
8733
9295
  const { name, public: isPublic, visibility, ...rest } = params;
8734
- const body4 = stripUndefined27({
9296
+ const body5 = stripUndefined29({
8735
9297
  name,
8736
9298
  visibility: visibility ?? (isPublic === void 0 ? void 0 : isPublic ? "public" : "private"),
8737
9299
  ...rest
8738
9300
  });
8739
- const data = await this.http.post("/storage/buckets", body4);
8740
- return unwrap48(data);
9301
+ const data = await this.http.post("/storage/buckets", body5);
9302
+ return unwrap50(data);
8741
9303
  }
8742
9304
  async getBucket(bucketId) {
8743
9305
  const data = await this.http.get(`/storage/buckets/${bucketId}`);
8744
- return unwrap48(data);
9306
+ return unwrap50(data);
8745
9307
  }
8746
9308
  async deleteBucket(bucketId) {
8747
9309
  await this.http.delete(`/storage/buckets/${bucketId}`);
8748
9310
  }
8749
9311
  // ── Objects ────────────────────────────────────────────────────────────────
8750
9312
  async listObjects(bucketId, params = {}) {
8751
- const query3 = stripUndefined27({
9313
+ const query3 = stripUndefined29({
8752
9314
  prefix: params.prefix,
8753
9315
  max_keys: params.max_keys ?? params.maxKeys ?? params.limit,
8754
9316
  marker: params.marker ?? params.cursor
@@ -8782,16 +9344,16 @@ var Storage = class {
8782
9344
  // ── Presigned URLs ─────────────────────────────────────────────────────────
8783
9345
  async presign(bucketId, params) {
8784
9346
  const operationMethod = params.operation === "put" ? "PUT" : params.operation === "get" ? "GET" : void 0;
8785
- const body4 = stripUndefined27({
9347
+ const body5 = stripUndefined29({
8786
9348
  key: params.key,
8787
9349
  method: params.method ?? operationMethod ?? "GET",
8788
9350
  expires_in: params.expiresIn ?? params.expires_in ?? params.expiresInSec ?? params.expires_in_sec ?? 3600
8789
9351
  });
8790
9352
  const data = await this.http.post(
8791
9353
  `/storage/buckets/${bucketId}/presign`,
8792
- body4
9354
+ body5
8793
9355
  );
8794
- return unwrap48(data);
9356
+ return unwrap50(data);
8795
9357
  }
8796
9358
  };
8797
9359
 
@@ -8880,8 +9442,58 @@ var OrgInvites = class {
8880
9442
  }
8881
9443
  };
8882
9444
 
9445
+ // src/resources/organizations.ts
9446
+ var OrganizationMembers = class {
9447
+ constructor(http) {
9448
+ this.http = http;
9449
+ }
9450
+ http;
9451
+ async list(organizationId) {
9452
+ return this.http.get(
9453
+ `/tenants/${encodeURIComponent(organizationId)}/members`
9454
+ );
9455
+ }
9456
+ async add(organizationId, userId, role = "member") {
9457
+ return this.http.post(
9458
+ `/tenants/${encodeURIComponent(organizationId)}/members`,
9459
+ { user_id: userId, role }
9460
+ );
9461
+ }
9462
+ async remove(organizationId, userId) {
9463
+ return this.http.delete(
9464
+ `/tenants/${encodeURIComponent(organizationId)}/members/${encodeURIComponent(userId)}`
9465
+ );
9466
+ }
9467
+ };
9468
+ var Organizations = class {
9469
+ constructor(http) {
9470
+ this.http = http;
9471
+ this.members = new OrganizationMembers(http);
9472
+ this.invites = new OrgInvites(http);
9473
+ }
9474
+ http;
9475
+ members;
9476
+ invites;
9477
+ async list() {
9478
+ const response = await this.http.get(
9479
+ "/platform/tenants"
9480
+ );
9481
+ return response.data ?? [];
9482
+ }
9483
+ async current() {
9484
+ return this.http.get("/platform/tenants/current");
9485
+ }
9486
+ /** Requires a user JWT. API keys are pinned to their organization. */
9487
+ async switch(idOrSlug) {
9488
+ return this.http.post(
9489
+ `/platform/tenants/${encodeURIComponent(idOrSlug)}/switch`,
9490
+ {}
9491
+ );
9492
+ }
9493
+ };
9494
+
8883
9495
  // src/resources/tenant.ts
8884
- function unwrap49(payload) {
9496
+ function unwrap51(payload) {
8885
9497
  if (payload && typeof payload === "object") {
8886
9498
  const p = payload;
8887
9499
  for (const k of ["data", "tenant", "branding", "items"]) {
@@ -8890,7 +9502,7 @@ function unwrap49(payload) {
8890
9502
  }
8891
9503
  return payload;
8892
9504
  }
8893
- function stripUndefined28(input) {
9505
+ function stripUndefined30(input) {
8894
9506
  return Object.fromEntries(
8895
9507
  Object.entries(input).filter(([, v]) => v !== void 0)
8896
9508
  );
@@ -8903,14 +9515,14 @@ var PreviewDomain = class {
8903
9515
  /** Get the tenant's white-label preview domain settings. */
8904
9516
  async get() {
8905
9517
  const data = await this.http.get("/tenant/preview-domain");
8906
- return unwrap49(data);
9518
+ return unwrap51(data);
8907
9519
  }
8908
9520
  /** Set the tenant's white-label preview domain. */
8909
9521
  async set(domain) {
8910
9522
  const data = await this.http.put("/tenant/preview-domain", {
8911
9523
  preview_domain: domain
8912
9524
  });
8913
- return unwrap49(data);
9525
+ return unwrap51(data);
8914
9526
  }
8915
9527
  /** Re-run DNS verification for the configured preview domain. */
8916
9528
  async verify() {
@@ -8918,7 +9530,7 @@ var PreviewDomain = class {
8918
9530
  "/tenant/preview-domain/verify",
8919
9531
  {}
8920
9532
  );
8921
- return unwrap49(data);
9533
+ return unwrap51(data);
8922
9534
  }
8923
9535
  /** Remove the tenant's custom preview domain. */
8924
9536
  async delete() {
@@ -8933,14 +9545,14 @@ var Branding = class {
8933
9545
  /** Get tenant branding used by white-label hosted surfaces. */
8934
9546
  async get() {
8935
9547
  const data = await this.http.get("/tenant/branding");
8936
- return unwrap49(data);
9548
+ return unwrap51(data);
8937
9549
  }
8938
9550
  /** Update tenant branding used by white-label hosted surfaces. */
8939
9551
  async set(params) {
8940
9552
  const data = await this.http.put("/tenant/branding", {
8941
- branding: stripUndefined28(params)
9553
+ branding: stripUndefined30(params)
8942
9554
  });
8943
- return unwrap49(data);
9555
+ return unwrap51(data);
8944
9556
  }
8945
9557
  /** Reset tenant branding to platform defaults. */
8946
9558
  async delete() {
@@ -8962,7 +9574,7 @@ var Tenant = class {
8962
9574
  /** Get the current tenant's plan, limits, and live usage counters. */
8963
9575
  async current() {
8964
9576
  const data = await this.http.get("/tenant/plan");
8965
- return unwrap49(data);
9577
+ return unwrap51(data);
8966
9578
  }
8967
9579
  /** Convenience alias for `tenant.branding.get()`. */
8968
9580
  async getBranding() {
@@ -8981,8 +9593,8 @@ var Tenant = class {
8981
9593
  // src/resources/templates.ts
8982
9594
  function unwrapCatalog(payload) {
8983
9595
  if (!payload || typeof payload !== "object") return { templates: [] };
8984
- const data = "data" in payload && typeof payload.data === "object" ? payload.data : payload;
8985
- const templates = Array.isArray(data.templates) ? data.templates : [];
9596
+ const data = "data" in payload && typeof payload.data === "object" && !Array.isArray(payload.data) ? payload.data : payload;
9597
+ const templates = Array.isArray(data.templates) ? data.templates : Array.isArray(data.data) ? data.data : [];
8986
9598
  return {
8987
9599
  ...data,
8988
9600
  templates
@@ -9023,7 +9635,7 @@ var Templates = class {
9023
9635
  };
9024
9636
 
9025
9637
  // src/resources/usage.ts
9026
- function unwrap50(payload) {
9638
+ function unwrap52(payload) {
9027
9639
  if (payload && typeof payload === "object") {
9028
9640
  const p = payload;
9029
9641
  for (const k of ["data", "usage", "sessions", "summary", "items"]) {
@@ -9032,7 +9644,7 @@ function unwrap50(payload) {
9032
9644
  }
9033
9645
  return payload;
9034
9646
  }
9035
- function stripUndefined29(input) {
9647
+ function stripUndefined31(input) {
9036
9648
  return Object.fromEntries(
9037
9649
  Object.entries(input).filter(([, v]) => v !== void 0)
9038
9650
  );
@@ -9045,24 +9657,24 @@ var Usage = class {
9045
9657
  /** Get the current period usage summary. */
9046
9658
  async current() {
9047
9659
  const data = await this.http.get("/usage/summary");
9048
- return unwrap50(data);
9660
+ return unwrap52(data);
9049
9661
  }
9050
9662
  /** List per-session metering events. */
9051
9663
  async sessions(params = {}) {
9052
- const query3 = stripUndefined29(params);
9664
+ const query3 = stripUndefined31(params);
9053
9665
  const data = await this.http.get("/usage/sessions", query3);
9054
- const result = unwrap50(data);
9666
+ const result = unwrap52(data);
9055
9667
  if (Array.isArray(result)) return result;
9056
9668
  return [];
9057
9669
  }
9058
9670
  /** Get a usage report for a period. */
9059
9671
  async report(params = {}) {
9060
- const query3 = stripUndefined29(params);
9672
+ const query3 = stripUndefined31(params);
9061
9673
  const data = await this.http.get("/usage/summary", query3);
9062
- return unwrap50(data);
9674
+ return unwrap52(data);
9063
9675
  }
9064
9676
  };
9065
- function unwrap51(payload) {
9677
+ function unwrap53(payload) {
9066
9678
  if (payload && typeof payload === "object" && "data" in payload) {
9067
9679
  return payload.data;
9068
9680
  }
@@ -9078,7 +9690,7 @@ function listItems15(payload, candidateKeys = ["data", "volumes", "items"]) {
9078
9690
  }
9079
9691
  return [];
9080
9692
  }
9081
- function stripUndefined30(input) {
9693
+ function stripUndefined32(input) {
9082
9694
  return Object.fromEntries(
9083
9695
  Object.entries(input).filter(([, v]) => v !== void 0)
9084
9696
  );
@@ -9092,32 +9704,65 @@ var Volumes = class {
9092
9704
  }
9093
9705
  http;
9094
9706
  async list(params = {}) {
9095
- const query3 = stripUndefined30({ ...params });
9707
+ const query3 = stripUndefined32({ ...params });
9096
9708
  const data = await this.http.get("/volumes", query3);
9097
9709
  return listItems15(data);
9098
9710
  }
9099
9711
  async get(volumeId) {
9100
9712
  const data = await this.http.get(`/volumes/${volumeId}`);
9101
- return unwrap51(data);
9713
+ return unwrap53(data);
9102
9714
  }
9103
9715
  async create(params) {
9104
9716
  const { idempotencyKey: ikey, sizeGb, ...rest } = params;
9105
- const body4 = stripUndefined30({
9717
+ const body5 = stripUndefined32({
9106
9718
  ...rest,
9107
9719
  size_gb: sizeGb ?? rest.size_gb
9108
9720
  });
9109
9721
  const data = await this.http.request("/volumes", {
9110
9722
  method: "POST",
9111
- body: body4,
9723
+ body: body5,
9112
9724
  headers: { "Idempotency-Key": idempotencyKey9(ikey) }
9113
9725
  });
9114
- return unwrap51(data);
9726
+ return unwrap53(data);
9115
9727
  }
9116
9728
  async delete(volumeId) {
9117
9729
  await this.http.delete(`/volumes/${volumeId}`);
9118
9730
  }
9731
+ async listAttachments(computerId) {
9732
+ const data = await this.http.get(`/computers/${computerId}/volumes`);
9733
+ return listItems15(data, [
9734
+ "data",
9735
+ "attachments",
9736
+ "volumes",
9737
+ "items"
9738
+ ]);
9739
+ }
9740
+ async attach(computerId, params) {
9741
+ const volumeId = params.volumeId ?? params.volume_id;
9742
+ const mountPath = params.mountPath ?? params.mount_path;
9743
+ const readOnly = params.readOnly ?? params.read_only;
9744
+ const body5 = stripUndefined32({
9745
+ ...params,
9746
+ volumeId: void 0,
9747
+ mountPath: void 0,
9748
+ readOnly: void 0,
9749
+ volume_id: volumeId,
9750
+ mount_path: mountPath,
9751
+ read_only: readOnly
9752
+ });
9753
+ const data = await this.http.post(
9754
+ `/computers/${computerId}/volumes`,
9755
+ body5
9756
+ );
9757
+ return unwrap53(data);
9758
+ }
9759
+ async detach(computerId, attachmentId) {
9760
+ await this.http.delete(
9761
+ `/computers/${computerId}/volumes/${attachmentId}`
9762
+ );
9763
+ }
9119
9764
  };
9120
- function unwrap52(payload) {
9765
+ function unwrap54(payload) {
9121
9766
  if (payload && typeof payload === "object" && "data" in payload) {
9122
9767
  return payload.data;
9123
9768
  }
@@ -9133,7 +9778,7 @@ function listItems16(payload, candidateKeys = ["data", "webhooks", "deliveries",
9133
9778
  }
9134
9779
  return [];
9135
9780
  }
9136
- function stripUndefined31(input) {
9781
+ function stripUndefined33(input) {
9137
9782
  return Object.fromEntries(
9138
9783
  Object.entries(input).filter(([, v]) => v !== void 0)
9139
9784
  );
@@ -9141,12 +9786,12 @@ function stripUndefined31(input) {
9141
9786
  function idempotencyKey10(key) {
9142
9787
  return key ?? randomUUID();
9143
9788
  }
9144
- function bodyBuffer(body4) {
9145
- if (Buffer.isBuffer(body4)) return body4;
9146
- if (typeof body4 === "string") return Buffer.from(body4, "utf8");
9147
- return Buffer.from(body4);
9789
+ function bodyBuffer(body5) {
9790
+ if (Buffer.isBuffer(body5)) return body5;
9791
+ if (typeof body5 === "string") return Buffer.from(body5, "utf8");
9792
+ return Buffer.from(body5);
9148
9793
  }
9149
- function verifySignature(body4, header, secret, toleranceSec = 300) {
9794
+ function verifySignature(body5, header, secret, toleranceSec = 300) {
9150
9795
  const parts = Object.fromEntries(
9151
9796
  header.split(",").map((chunk) => chunk.split("=", 2)).filter(([key, value]) => key && value)
9152
9797
  );
@@ -9159,7 +9804,7 @@ function verifySignature(body4, header, secret, toleranceSec = 300) {
9159
9804
  if (ageSec > toleranceSec) {
9160
9805
  throw new Error("webhook timestamp too old");
9161
9806
  }
9162
- const rawBody = bodyBuffer(body4);
9807
+ const rawBody = bodyBuffer(body5);
9163
9808
  const signed = Buffer.concat([Buffer.from(`${timestamp}.`), rawBody]);
9164
9809
  const expected = createHmac("sha256", secret).update(signed).digest("hex");
9165
9810
  try {
@@ -9178,28 +9823,28 @@ var Webhooks = class {
9178
9823
  http;
9179
9824
  static verifySignature = verifySignature;
9180
9825
  async list(params = {}) {
9181
- const query3 = stripUndefined31({ ...params });
9826
+ const query3 = stripUndefined33({ ...params });
9182
9827
  const data = await this.http.get("/webhooks", query3);
9183
9828
  return listItems16(data);
9184
9829
  }
9185
9830
  async get(webhookId) {
9186
9831
  const data = await this.http.get(`/webhooks/${webhookId}`);
9187
- return unwrap52(data);
9832
+ return unwrap54(data);
9188
9833
  }
9189
9834
  async create(params) {
9190
9835
  const { idempotencyKey: ikey, ...rest } = params;
9191
- const body4 = stripUndefined31(rest);
9836
+ const body5 = stripUndefined33(rest);
9192
9837
  const data = await this.http.request("/webhooks", {
9193
9838
  method: "POST",
9194
- body: body4,
9839
+ body: body5,
9195
9840
  headers: { "Idempotency-Key": idempotencyKey10(ikey) }
9196
9841
  });
9197
- return unwrap52(data);
9842
+ return unwrap54(data);
9198
9843
  }
9199
9844
  async update(webhookId, params) {
9200
- const body4 = stripUndefined31(params);
9201
- const data = await this.http.patch(`/webhooks/${webhookId}`, body4);
9202
- return unwrap52(data);
9845
+ const body5 = stripUndefined33(params);
9846
+ const data = await this.http.patch(`/webhooks/${webhookId}`, body5);
9847
+ return unwrap54(data);
9203
9848
  }
9204
9849
  async delete(webhookId) {
9205
9850
  await this.http.delete(`/webhooks/${webhookId}`);
@@ -9212,7 +9857,7 @@ var Webhooks = class {
9212
9857
  headers: { "Idempotency-Key": idempotencyKey10(opts.idempotencyKey) }
9213
9858
  }
9214
9859
  );
9215
- return unwrap52(data);
9860
+ return unwrap54(data);
9216
9861
  }
9217
9862
  async deliveries(webhookId) {
9218
9863
  const data = await this.http.get(
@@ -9393,6 +10038,8 @@ var Miosa = class {
9393
10038
  * Requires admin/owner role for write operations.
9394
10039
  */
9395
10040
  orgInvites;
10041
+ /** Organizations available to the user session, membership, invites, and switching. */
10042
+ organizations;
9396
10043
  /** Current tenant plan, limits, and live usage counters. */
9397
10044
  tenant;
9398
10045
  /** Datacenter regions, compute sizes, pricing, community templates. */
@@ -9425,6 +10072,10 @@ var Miosa = class {
9425
10072
  runs;
9426
10073
  /** Run groups - durable multi-run orchestration groups. */
9427
10074
  runGroups;
10075
+ /** Agent runs - compatibility API for prompt dispatch. */
10076
+ agentRuns;
10077
+ /** Agent run groups - compatibility API for multi-agent orchestration. */
10078
+ agentRunGroups;
9428
10079
  /** Agent runtime profiles — tenant/workspace defaults for sandbox/computer agents. */
9429
10080
  agentRuntimeProfiles;
9430
10081
  /** MIOSA Connect — provider connectors and runtime tokens. */
@@ -9507,25 +10158,31 @@ var Miosa = class {
9507
10158
  audit;
9508
10159
  http;
9509
10160
  constructor(config) {
9510
- if (!config.apiKey) {
10161
+ if (config.apiKey && config.accessToken) {
10162
+ throw new Error("Miosa: pass either apiKey or accessToken, not both.");
10163
+ }
10164
+ const credential = config.accessToken ?? config.apiKey;
10165
+ if (!credential) {
9511
10166
  throw new Error(
9512
- 'Miosa: apiKey is required. Pass { apiKey: "msk_u_..." } or set MIOSA_API_KEY.'
10167
+ "Miosa: apiKey or accessToken is required."
9513
10168
  );
9514
10169
  }
9515
- if (!config.apiKey.startsWith("msk_")) {
10170
+ if (config.apiKey && !config.apiKey.startsWith("msk_")) {
9516
10171
  console.warn(
9517
10172
  '[miosa] Warning: API key does not start with "msk_". Double-check your key.'
9518
10173
  );
9519
10174
  }
9520
10175
  this.http = new HttpClient({
9521
10176
  baseUrl: config.baseUrl ?? DEFAULT_BASE_URL,
9522
- apiKey: config.apiKey,
10177
+ apiKey: credential,
10178
+ ...config.tenant ? { tenant: config.tenant } : {},
9523
10179
  timeout: config.timeout ?? DEFAULT_TIMEOUT2,
9524
10180
  maxRetries: config.maxRetries ?? DEFAULT_MAX_RETRIES2
9525
10181
  });
9526
10182
  this.workspaceMembers = new WorkspaceMembers(this.http);
9527
10183
  this.workspaceInvites = new WorkspaceInvites(this.http);
9528
10184
  this.orgInvites = new OrgInvites(this.http);
10185
+ this.organizations = new Organizations(this.http);
9529
10186
  this.tenant = new Tenant(this.http);
9530
10187
  this.regions = new Regions(this.http);
9531
10188
  this.settings = new Settings(this.http);
@@ -9542,6 +10199,8 @@ var Miosa = class {
9542
10199
  this.mcp = new Mcp(this.http);
9543
10200
  this.runs = new Runs(this.http);
9544
10201
  this.runGroups = new RunGroups(this.http);
10202
+ this.agentRuns = new AgentRuns(this.http);
10203
+ this.agentRunGroups = new AgentRunGroups(this.http);
9545
10204
  this.agentRuntimeProfiles = new AgentRuntimeProfiles(this.http);
9546
10205
  this.connectors = new Connectors(this.http);
9547
10206
  this.runtimeEnv = new RuntimeEnv(this.http);
@@ -10001,8 +10660,8 @@ var AppAuth = class {
10001
10660
  }
10002
10661
  });
10003
10662
  if (!resp.ok) {
10004
- const body4 = await resp.text();
10005
- throw new Error(`AppAuth me failed (${resp.status}): ${body4}`);
10663
+ const body5 = await resp.text();
10664
+ throw new Error(`AppAuth me failed (${resp.status}): ${body5}`);
10006
10665
  }
10007
10666
  return unwrapSession(await resp.json());
10008
10667
  }
@@ -10054,12 +10713,12 @@ var AppAuth = class {
10054
10713
  return payload;
10055
10714
  }
10056
10715
  // ── Private ──────────────────────────────────────────────────────────────────
10057
- async _post(action, body4) {
10716
+ async _post(action, body5) {
10058
10717
  const url = `${this.baseUrl}/app-auth/${this.resourceType}/${this.resourceId}/${action}`;
10059
10718
  const resp = await fetch(url, {
10060
10719
  method: "POST",
10061
10720
  headers: { "Content-Type": "application/json" },
10062
- body: JSON.stringify(body4)
10721
+ body: JSON.stringify(body5)
10063
10722
  });
10064
10723
  if (!resp.ok) {
10065
10724
  const text = await resp.text();
@@ -10069,6 +10728,6 @@ var AppAuth = class {
10069
10728
  }
10070
10729
  };
10071
10730
 
10072
- export { AGENT_BUILD_KIND_SPECS, Admin, AgentRuntimeProfiles, Analytics, ApiKeys, AppAuth, AuditLog, AuthError, Benchmarks, BuilderSessions, Channels, Checkpoints, Cloud, CommandCenter, Community, Completions, Computer, ComputerAudit, ComputerAutoStop, ComputerConnectors, ComputerEnv, ComputerInbox, ComputerLogs, ComputerNetwork, ComputerOsa, ComputerPorts, ComputerSecrets, ComputerTerminal, ComputerVolumes, Computers, Connectors, Credits, CronJobs, DEFAULT_AGENT_BUILD_OUTPUT_ROOT, DEFAULT_AGENT_BUILD_PACKET_VERSION, Dashboard, Databases, DeploymentConnectors, DeploymentDomains, DeploymentReleases, DeploymentRuntimeInstances, DeploymentVersions, Deployments, Desktop, Devices, DockerDeploy, EgressAudit, EgressHostNotAllowedError, EgressNetwork, EgressSecrets, Email, EmailCampaigns, EmailInbox, EmailTemplates, Embeddings, Exec, ExternalKeys, Files, FlatCustomDomains, Functions, HealthChecks, InstallationRequiredError, InsufficientCreditsError, Integrations, ManagedProviderBindingOnlyError, Mcp, Miosa, MiosaError, Models, NetworkError, NetworkPolicy, NotFoundError, OAuthFlow, OpenComputers, OrgInvites, ProjectAuth, ProjectIntegrations, ProjectNotLinkedError, ProviderDefaults, RateLimitError, Regions, RunGroups, Runs, RuntimeCapabilitiesResource, RuntimeEnv, SANDBOX_TEMPLATE, Sandbox, SandboxAudit, SandboxCommands, SandboxConnectors, SandboxEnv, SandboxEvents, SandboxFiles, SandboxNetwork, SandboxPreview, SandboxPreviews, SandboxSecrets, SandboxTags, SandboxTemplates, SandboxTerminal, Sandboxes, ScopeNotAllowedError, ScopedFs, Settings, SnapshotsStandalone, Storage, SubjectNotAllowedError, Templates, Tenant, TimeoutError, TokenRefreshFailedError, Usage, UserAuthorizationRequiredError, ValidationError, Volumes, Webhooks, WorkspaceInvites, WorkspaceMembers, createAgentBuildExecutionPacket, createAgentBuildExpectedOutputs, createAgentBuildPrompt, createBuildRunParams, getAgentBuildKindSpec, resolveAgentBuildKind, verifySignature };
10731
+ export { AGENT_BUILD_KIND_SPECS, Admin, AgentRuntimeProfiles, Analytics, ApiKeys, AppAuth, AuditLog, AuthError, Benchmarks, BuilderSessions, Channels, Checkpoints, Cloud, CommandCenter, Community, Completions, Computer, ComputerAudit, ComputerAutoStop, ComputerConnectors, ComputerEnv, ComputerInbox, ComputerLogs, ComputerNetwork, ComputerOsa, ComputerPorts, ComputerSecrets, ComputerTerminal, ComputerVolumes, Computers, Connectors, Credits, CronJobs, DEFAULT_AGENT_BUILD_OUTPUT_ROOT, DEFAULT_AGENT_BUILD_PACKET_VERSION, Dashboard, Databases, DeploymentConnectors, DeploymentDomains, DeploymentReleases, DeploymentRuntimeInstances, DeploymentVersions, Deployments, Desktop, Devices, DockerDeploy, EgressAudit, EgressHostNotAllowedError, EgressNetwork, EgressSecrets, Email, EmailCampaigns, EmailInbox, EmailTemplates, Embeddings, Exec, ExternalKeys, Files, FlatCustomDomains, Functions, HealthChecks, InstallationRequiredError, InsufficientCreditsError, Integrations, ManagedProviderBindingOnlyError, Mcp, Miosa, MiosaError, Models, NetworkError, NetworkPolicy, NotFoundError, OAuthFlow, OpenComputers, OrgInvites, OrganizationMembers, Organizations, ProjectAuth, ProjectIntegrations, ProjectNotLinkedError, ProviderDefaults, RateLimitError, Regions, RunGroups, Runs, RuntimeCapabilitiesResource, RuntimeEnv, SANDBOX_TEMPLATE, Sandbox, SandboxAudit, SandboxCommands, SandboxConnectors, SandboxEnv, SandboxEvents, SandboxFiles, SandboxNetwork, SandboxPreview, SandboxPreviews, SandboxSecrets, SandboxTags, SandboxTemplates, SandboxTerminal, Sandboxes, ScopeNotAllowedError, ScopedFs, Settings, SnapshotsStandalone, Storage, SubjectNotAllowedError, Templates, Tenant, TimeoutError, TokenRefreshFailedError, Usage, UserAuthorizationRequiredError, ValidationError, Volumes, Webhooks, WorkspaceInvites, WorkspaceMembers, createAgentBuildExecutionPacket, createAgentBuildExpectedOutputs, createAgentBuildPrompt, createBuildRunParams, getAgentBuildKindSpec, resolveAgentBuildKind, verifySignature };
10073
10732
  //# sourceMappingURL=index.js.map
10074
10733
  //# sourceMappingURL=index.js.map