@miosa/sdk 1.2.13 → 1.2.15

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
@@ -608,6 +608,11 @@ function unwrap(payload) {
608
608
  }
609
609
  return payload;
610
610
  }
611
+ function artifactRows(raw) {
612
+ const data = unwrap(raw);
613
+ if (Array.isArray(data)) return data;
614
+ return data.artifacts ?? data.items ?? [];
615
+ }
611
616
  function stripUndefined(input) {
612
617
  return Object.fromEntries(
613
618
  Object.entries(input).filter(([, value]) => value !== void 0)
@@ -643,9 +648,20 @@ function runBody(entry) {
643
648
  parent_agent_run_id: entry.parentAgentRunId,
644
649
  orchestration_role: entry.orchestrationRole,
645
650
  skip_agent_runtime_profile: entry.skipAgentRuntimeProfile,
651
+ execution_packet: entry.executionPacket,
652
+ output_contract: entry.outputContract,
653
+ approval_policy: entry.approvalPolicy,
654
+ capability_requirements: entry.capabilityRequirements,
646
655
  metadata: entry.metadata
647
656
  });
648
657
  }
658
+ function isTerminalStatus(status, terminalStatuses) {
659
+ return typeof status === "string" && terminalStatuses.includes(status.toLowerCase());
660
+ }
661
+ function sleep2(ms) {
662
+ if (ms <= 0) return Promise.resolve();
663
+ return new Promise((resolve) => setTimeout(resolve, ms));
664
+ }
649
665
  var AgentRunGroups = class {
650
666
  constructor(http) {
651
667
  this.http = http;
@@ -708,6 +724,46 @@ var AgentRunGroups = class {
708
724
  `/agent-run-groups/${encodeURIComponent(id)}/events`
709
725
  );
710
726
  }
727
+ async artifacts(id) {
728
+ const group = await this.get(id, { includeRuns: true });
729
+ const runs = (group.runs ?? []).filter((run) => Boolean(run.id));
730
+ const nested = await Promise.all(
731
+ runs.map(async (run) => {
732
+ const artifacts = artifactRows(
733
+ await this.http.get(
734
+ `/agent-runs/${encodeURIComponent(run.id)}/artifacts`
735
+ )
736
+ );
737
+ return artifacts.map((artifact) => ({
738
+ ...artifact,
739
+ agent_run_id: artifact.agent_run_id ?? run.id
740
+ }));
741
+ })
742
+ );
743
+ return nested.flat();
744
+ }
745
+ async waitForCompletion(id, options = {}) {
746
+ const timeoutMs = options.timeoutMs ?? 15 * 60 * 1e3;
747
+ const pollIntervalMs = options.pollIntervalMs ?? 2e3;
748
+ const terminalStatuses = options.terminalStatuses ?? [
749
+ "succeeded",
750
+ "failed",
751
+ "canceled",
752
+ "cancelled"
753
+ ];
754
+ const deadline = Date.now() + timeoutMs;
755
+ while (true) {
756
+ const group = await this.get(
757
+ id,
758
+ options.includeRuns === void 0 ? {} : { includeRuns: options.includeRuns }
759
+ );
760
+ if (isTerminalStatus(group.status, terminalStatuses)) return group;
761
+ if (Date.now() >= deadline) {
762
+ throw new Error(`Timed out waiting for agent run group ${id}`);
763
+ }
764
+ await sleep2(Math.min(pollIntervalMs, Math.max(0, deadline - Date.now())));
765
+ }
766
+ }
711
767
  };
712
768
 
713
769
  // src/resources/agent-runtime-profiles.ts
@@ -818,6 +874,13 @@ function stripUndefined2(input) {
818
874
  Object.entries(input).filter(([, value]) => value !== void 0)
819
875
  );
820
876
  }
877
+ function isTerminalStatus2(status, terminalStatuses) {
878
+ return typeof status === "string" && terminalStatuses.includes(status.toLowerCase());
879
+ }
880
+ function sleep3(ms) {
881
+ if (ms <= 0) return Promise.resolve();
882
+ return new Promise((resolve) => setTimeout(resolve, ms));
883
+ }
821
884
  var AgentRuns = class {
822
885
  constructor(http) {
823
886
  this.http = http;
@@ -832,6 +895,9 @@ var AgentRuns = class {
832
895
  sandbox_id: params.sandboxId,
833
896
  computer_id: params.computerId,
834
897
  agent_run_group_id: params.agentRunGroupId,
898
+ external_workspace_id: params.externalWorkspaceId ?? params.external_workspace_id,
899
+ external_user_id: params.externalUserId ?? params.external_user_id,
900
+ external_project_id: params.externalProjectId ?? params.external_project_id,
835
901
  status: params.status
836
902
  })
837
903
  );
@@ -863,6 +929,37 @@ var AgentRuns = class {
863
929
  )}/download${query2}`
864
930
  );
865
931
  }
932
+ async events(id) {
933
+ const data = unwrap3(
934
+ await this.http.get(`/agent-runs/${encodeURIComponent(id)}/events`)
935
+ );
936
+ if (Array.isArray(data)) return data;
937
+ return data.events ?? data.items ?? [];
938
+ }
939
+ streamEvents(id) {
940
+ return this.http.stream(
941
+ `/agent-runs/${encodeURIComponent(id)}/events`
942
+ );
943
+ }
944
+ async waitForCompletion(id, options = {}) {
945
+ const timeoutMs = options.timeoutMs ?? 15 * 60 * 1e3;
946
+ const pollIntervalMs = options.pollIntervalMs ?? 2e3;
947
+ const terminalStatuses = options.terminalStatuses ?? [
948
+ "succeeded",
949
+ "failed",
950
+ "canceled",
951
+ "cancelled"
952
+ ];
953
+ const deadline = Date.now() + timeoutMs;
954
+ while (true) {
955
+ const run = await this.get(id);
956
+ if (isTerminalStatus2(run.status, terminalStatuses)) return run;
957
+ if (Date.now() >= deadline) {
958
+ throw new Error(`Timed out waiting for agent run ${id}`);
959
+ }
960
+ await sleep3(Math.min(pollIntervalMs, Math.max(0, deadline - Date.now())));
961
+ }
962
+ }
866
963
  async run(params) {
867
964
  const body4 = stripUndefined2({
868
965
  prompt: params.prompt,
@@ -882,7 +979,14 @@ var AgentRuns = class {
882
979
  agent_run_group_id: params.agentRunGroupId,
883
980
  parent_agent_run_id: params.parentAgentRunId,
884
981
  orchestration_role: params.orchestrationRole,
982
+ external_workspace_id: params.externalWorkspaceId ?? params.external_workspace_id,
983
+ external_user_id: params.externalUserId ?? params.external_user_id,
984
+ external_project_id: params.externalProjectId ?? params.external_project_id,
885
985
  skip_agent_runtime_profile: params.skipAgentRuntimeProfile,
986
+ execution_packet: params.executionPacket,
987
+ output_contract: params.outputContract,
988
+ approval_policy: params.approvalPolicy,
989
+ capability_requirements: params.capabilityRequirements,
886
990
  metadata: params.metadata
887
991
  });
888
992
  return unwrap3(await this.http.post("/agent-runs", body4));
@@ -2056,7 +2160,7 @@ function listQuery(params) {
2056
2160
  )
2057
2161
  });
2058
2162
  }
2059
- function sleep2(ms) {
2163
+ function sleep4(ms) {
2060
2164
  return new Promise((resolve) => setTimeout(resolve, ms));
2061
2165
  }
2062
2166
  var EgressAudit = class {
@@ -2105,7 +2209,7 @@ var EgressAudit = class {
2105
2209
  const ts = event.inserted_at ?? event.timestamp;
2106
2210
  if (typeof ts === "string") since = ts;
2107
2211
  }
2108
- await sleep2(pollMs);
2212
+ await sleep4(pollMs);
2109
2213
  }
2110
2214
  }
2111
2215
  };
@@ -2498,7 +2602,7 @@ function oauthBody(params) {
2498
2602
  redirect_uri: pickFirst3(params.redirectUri, params.redirect_uri)
2499
2603
  });
2500
2604
  }
2501
- function sleep3(ms) {
2605
+ function sleep5(ms) {
2502
2606
  return new Promise((resolve) => setTimeout(resolve, ms));
2503
2607
  }
2504
2608
  var OAuthFlow = class {
@@ -2542,7 +2646,7 @@ var OAuthFlow = class {
2542
2646
  `OAuth flow ${this.state} ended in status=${status}: ${payload.error ?? payload.message ?? "no detail"}`
2543
2647
  );
2544
2648
  }
2545
- await sleep3(pollMs);
2649
+ await sleep5(pollMs);
2546
2650
  }
2547
2651
  throw new Error(
2548
2652
  `OAuth flow ${this.state} did not complete within ${timeoutSec}s`
@@ -6099,6 +6203,25 @@ var RuntimeEnv = class {
6099
6203
  }
6100
6204
  };
6101
6205
 
6206
+ // src/resources/runtime-capabilities.ts
6207
+ function unwrap40(payload) {
6208
+ if (payload && typeof payload === "object" && "data" in payload) {
6209
+ return payload.data;
6210
+ }
6211
+ return payload;
6212
+ }
6213
+ var RuntimeCapabilitiesResource = class {
6214
+ constructor(http) {
6215
+ this.http = http;
6216
+ }
6217
+ http;
6218
+ async get() {
6219
+ return unwrap40(
6220
+ await this.http.get("/runtime-capabilities")
6221
+ );
6222
+ }
6223
+ };
6224
+
6102
6225
  // src/resources/sandboxes.ts
6103
6226
  function encodeContent(content) {
6104
6227
  const bytes = typeof content === "string" ? new TextEncoder().encode(content) : content;
@@ -6113,7 +6236,7 @@ var AGENT_WORKSPACE_TIMEOUT_SEC = 86400;
6113
6236
  var AGENT_WORKSPACE_IDLE_TIMEOUT_SEC = 1800;
6114
6237
  var AGENT_WORKSPACE_SNAPSHOT_EXPIRATION_DAYS = 30;
6115
6238
  var AGENT_WORKSPACE_KEEP_LAST_SNAPSHOTS = 1;
6116
- function unwrap40(payload) {
6239
+ function unwrap41(payload) {
6117
6240
  if (payload !== null && typeof payload === "object" && "data" in payload && payload.data !== void 0) {
6118
6241
  return payload.data;
6119
6242
  }
@@ -6339,7 +6462,7 @@ var SandboxTerminal = class {
6339
6462
  const body4 = Object.fromEntries(
6340
6463
  Object.entries(params).filter(([, v]) => v !== void 0)
6341
6464
  );
6342
- const response = unwrap40(
6465
+ const response = unwrap41(
6343
6466
  await this.sandbox.http.post(`/sandboxes/${this.sandbox.id}/terminal`, body4)
6344
6467
  );
6345
6468
  return response;
@@ -6388,7 +6511,7 @@ var SandboxPreviews = class {
6388
6511
  Object.entries(opts).filter(([, v]) => v !== void 0)
6389
6512
  )
6390
6513
  };
6391
- return unwrap40(
6514
+ return unwrap41(
6392
6515
  await this.http.post(
6393
6516
  `/sandboxes/${this.sandbox.id}/previews`,
6394
6517
  body4
@@ -6396,7 +6519,7 @@ var SandboxPreviews = class {
6396
6519
  );
6397
6520
  }
6398
6521
  async get(previewId) {
6399
- return unwrap40(
6522
+ return unwrap41(
6400
6523
  await this.http.get(
6401
6524
  `/sandboxes/${this.sandbox.id}/previews/${previewId}`
6402
6525
  )
@@ -6409,7 +6532,7 @@ var SandboxPreviews = class {
6409
6532
  }
6410
6533
  /** Mint a share token for previewId. */
6411
6534
  async share(previewId, opts = {}) {
6412
- return unwrap40(
6535
+ return unwrap41(
6413
6536
  await this.http.post(
6414
6537
  `/sandboxes/${this.sandbox.id}/previews/${previewId}/share`,
6415
6538
  { ttl_seconds: opts.ttl_seconds ?? opts.expires_in_sec ?? 3600 }
@@ -6478,7 +6601,7 @@ var SandboxTags = class {
6478
6601
  sandbox;
6479
6602
  /** Replace the full tag list with tags. */
6480
6603
  async set(tags) {
6481
- return unwrap40(
6604
+ return unwrap41(
6482
6605
  await this.sandbox.http.patch(`/sandboxes/${this.sandbox.id}/tags`, { tags })
6483
6606
  );
6484
6607
  }
@@ -6546,14 +6669,14 @@ var Sandbox = class _Sandbox {
6546
6669
  return this.data.template_id ?? this.data.image_id ?? "";
6547
6670
  }
6548
6671
  async refresh() {
6549
- this.data = unwrap40(
6672
+ this.data = unwrap41(
6550
6673
  await this.http.get(`/sandboxes/${this.id}`)
6551
6674
  );
6552
6675
  return this;
6553
6676
  }
6554
6677
  async runExec(command, options) {
6555
6678
  this.assertRunning("exec");
6556
- const response = unwrap40(
6679
+ const response = unwrap41(
6557
6680
  await this.http.post(
6558
6681
  `/sandboxes/${this.id}/exec`,
6559
6682
  execBody(command, options)
@@ -6598,7 +6721,7 @@ var Sandbox = class _Sandbox {
6598
6721
  }
6599
6722
  async createExport(params) {
6600
6723
  const body4 = typeof params === "string" ? { path: params } : Array.isArray(params) ? { paths: params } : params;
6601
- const response = unwrap40(
6724
+ const response = unwrap41(
6602
6725
  await this.http.post(
6603
6726
  `/sandboxes/${this.id}/exports`,
6604
6727
  body4
@@ -6623,7 +6746,7 @@ var Sandbox = class _Sandbox {
6623
6746
  }
6624
6747
  async listFiles(path = "/workspace") {
6625
6748
  this.assertRunning("files.list");
6626
- const response = unwrap40(
6749
+ const response = unwrap41(
6627
6750
  await this.http.get(
6628
6751
  `/sandboxes/${this.id}/files`,
6629
6752
  { path }
@@ -6633,7 +6756,7 @@ var Sandbox = class _Sandbox {
6633
6756
  }
6634
6757
  async statFile(path) {
6635
6758
  this.assertRunning("files.stat");
6636
- return unwrap40(
6759
+ return unwrap41(
6637
6760
  await this.http.post(
6638
6761
  `/sandboxes/${this.id}/files/stat`,
6639
6762
  { path }
@@ -6642,7 +6765,7 @@ var Sandbox = class _Sandbox {
6642
6765
  }
6643
6766
  async expose(port) {
6644
6767
  this.assertRunning("expose");
6645
- const response = unwrap40(
6768
+ const response = unwrap41(
6646
6769
  await this.http.post(
6647
6770
  `/sandboxes/${this.id}/expose`,
6648
6771
  port === void 0 ? {} : { port }
@@ -6652,7 +6775,7 @@ var Sandbox = class _Sandbox {
6652
6775
  }
6653
6776
  async startTemplate(options = {}) {
6654
6777
  this.assertRunning("startTemplate");
6655
- return unwrap40(
6778
+ return unwrap41(
6656
6779
  await this.http.post(
6657
6780
  `/sandboxes/${this.id}/template/start`,
6658
6781
  options
@@ -6660,7 +6783,7 @@ var Sandbox = class _Sandbox {
6660
6783
  );
6661
6784
  }
6662
6785
  async getArtifacts() {
6663
- return unwrap40(
6786
+ return unwrap41(
6664
6787
  await this.http.get(
6665
6788
  `/sandboxes/${this.id}/artifacts`
6666
6789
  )
@@ -6671,7 +6794,7 @@ var Sandbox = class _Sandbox {
6671
6794
  `/sandboxes/${this.id}/logs`,
6672
6795
  { lines }
6673
6796
  );
6674
- return unwrap40(response);
6797
+ return unwrap41(response);
6675
6798
  }
6676
6799
  streamLogs() {
6677
6800
  return this.http.stream(
@@ -6680,7 +6803,7 @@ var Sandbox = class _Sandbox {
6680
6803
  }
6681
6804
  async createSnapshot(comment) {
6682
6805
  this.assertRunning("snapshots.create");
6683
- return unwrap40(
6806
+ return unwrap41(
6684
6807
  await this.http.post(
6685
6808
  `/sandboxes/${this.id}/snapshots`,
6686
6809
  comment ? { comment } : {}
@@ -6688,14 +6811,14 @@ var Sandbox = class _Sandbox {
6688
6811
  );
6689
6812
  }
6690
6813
  async listSnapshots() {
6691
- return unwrap40(
6814
+ return unwrap41(
6692
6815
  await this.http.get(
6693
6816
  `/sandboxes/${this.id}/snapshots`
6694
6817
  )
6695
6818
  );
6696
6819
  }
6697
6820
  async restoreSnapshot(snapshotId) {
6698
- const data = unwrap40(
6821
+ const data = unwrap41(
6699
6822
  await this.http.post(
6700
6823
  `/sandboxes/${this.id}/restore/${snapshotId}`,
6701
6824
  {}
@@ -6715,7 +6838,7 @@ var Sandbox = class _Sandbox {
6715
6838
  const body4 = {};
6716
6839
  if (opts.name !== void 0) body4.name = opts.name;
6717
6840
  if (opts.metadata !== void 0) body4.metadata = opts.metadata;
6718
- const data = unwrap40(
6841
+ const data = unwrap41(
6719
6842
  await this.http.post(
6720
6843
  `/sandboxes/${this.id}/fork`,
6721
6844
  body4
@@ -6746,7 +6869,7 @@ var Sandbox = class _Sandbox {
6746
6869
  timeout_sec: params.timeout_sec ?? params.timeoutSec,
6747
6870
  idle_timeout_sec: params.idle_timeout_sec ?? params.idleTimeoutSec
6748
6871
  });
6749
- const data = unwrap40(
6872
+ const data = unwrap41(
6750
6873
  await this.http.patch(
6751
6874
  `/sandboxes/${this.id}`,
6752
6875
  body4
@@ -6756,7 +6879,7 @@ var Sandbox = class _Sandbox {
6756
6879
  return this;
6757
6880
  }
6758
6881
  async extend(timeoutSec) {
6759
- const data = unwrap40(
6882
+ const data = unwrap41(
6760
6883
  await this.http.post(
6761
6884
  `/sandboxes/${this.id}/extend`,
6762
6885
  { timeout_sec: timeoutSec }
@@ -6779,7 +6902,7 @@ var Sandbox = class _Sandbox {
6779
6902
  return raw;
6780
6903
  }
6781
6904
  async pause() {
6782
- const data = unwrap40(
6905
+ const data = unwrap41(
6783
6906
  await this.http.post(
6784
6907
  `/sandboxes/${this.id}/pause`,
6785
6908
  {}
@@ -6789,7 +6912,7 @@ var Sandbox = class _Sandbox {
6789
6912
  return this;
6790
6913
  }
6791
6914
  async resume() {
6792
- const data = unwrap40(
6915
+ const data = unwrap41(
6793
6916
  await this.http.post(
6794
6917
  `/sandboxes/${this.id}/resume`,
6795
6918
  {}
@@ -6825,7 +6948,7 @@ var Sandbox = class _Sandbox {
6825
6948
  if (idempotencyKey11) {
6826
6949
  requestOptions.headers = { "Idempotency-Key": idempotencyKey11 };
6827
6950
  }
6828
- return unwrap40(
6951
+ return unwrap41(
6829
6952
  await this.http.request(
6830
6953
  `/sandboxes/${this.id}/deploy`,
6831
6954
  requestOptions
@@ -6837,7 +6960,7 @@ var Sandbox = class _Sandbox {
6837
6960
  }
6838
6961
  /** Check readiness of the sandbox (GET /sandboxes/:id/readiness). */
6839
6962
  async readiness() {
6840
- return unwrap40(
6963
+ return unwrap41(
6841
6964
  await this.http.get(
6842
6965
  `/sandboxes/${this.id}/readiness`
6843
6966
  )
@@ -7005,7 +7128,7 @@ var Sandboxes = class {
7005
7128
  if (idempotencyKey11) {
7006
7129
  requestOptions.headers = { "Idempotency-Key": idempotencyKey11 };
7007
7130
  }
7008
- const data = unwrap40(
7131
+ const data = unwrap41(
7009
7132
  await this.http.request(
7010
7133
  "/sandboxes",
7011
7134
  requestOptions
@@ -7024,7 +7147,7 @@ var Sandboxes = class {
7024
7147
  return listItems11(data).map((item) => new Sandbox(this.http, item));
7025
7148
  }
7026
7149
  async get(id) {
7027
- const data = unwrap40(
7150
+ const data = unwrap41(
7028
7151
  await this.http.get(`/sandboxes/${id}`)
7029
7152
  );
7030
7153
  return new Sandbox(this.http, data);
@@ -7033,7 +7156,7 @@ var Sandboxes = class {
7033
7156
  return this.get(id);
7034
7157
  }
7035
7158
  async getByName(name) {
7036
- const data = unwrap40(
7159
+ const data = unwrap41(
7037
7160
  await this.http.get(
7038
7161
  `/sandboxes/by-name/${encodeURIComponent(name)}`
7039
7162
  )
@@ -7098,7 +7221,7 @@ var Sandboxes = class {
7098
7221
  metadata: params.metadata
7099
7222
  })
7100
7223
  );
7101
- return unwrap40(response);
7224
+ return unwrap41(response);
7102
7225
  }
7103
7226
  async createTemplateBuild(templateId, params = {}) {
7104
7227
  const response = await this.http.post(
@@ -7108,19 +7231,19 @@ var Sandboxes = class {
7108
7231
  metadata: params.metadata
7109
7232
  })
7110
7233
  );
7111
- return unwrap40(response);
7234
+ return unwrap41(response);
7112
7235
  }
7113
7236
  async listTemplateBuilds(templateId) {
7114
7237
  const response = await this.http.get(
7115
7238
  `/sandbox-templates/${templateId}/builds`
7116
7239
  );
7117
- return unwrap40(response);
7240
+ return unwrap41(response);
7118
7241
  }
7119
7242
  async getTemplateBuild(buildId) {
7120
7243
  const response = await this.http.get(
7121
7244
  `/sandbox-template-builds/${buildId}`
7122
7245
  );
7123
- return unwrap40(response);
7246
+ return unwrap41(response);
7124
7247
  }
7125
7248
  };
7126
7249
  function toBase642(bytes) {
@@ -7132,7 +7255,7 @@ function toBase642(bytes) {
7132
7255
  }
7133
7256
  return btoa(binary);
7134
7257
  }
7135
- function unwrap41(payload) {
7258
+ function unwrap42(payload) {
7136
7259
  if (payload && typeof payload === "object" && "data" in payload) {
7137
7260
  return payload.data;
7138
7261
  }
@@ -7175,7 +7298,7 @@ var SandboxTemplates = class {
7175
7298
  const data = await this.http.get(
7176
7299
  `/sandbox-templates/${templateId}`
7177
7300
  );
7178
- return unwrap41(data);
7301
+ return unwrap42(data);
7179
7302
  }
7180
7303
  async create(params) {
7181
7304
  const {
@@ -7195,7 +7318,7 @@ var SandboxTemplates = class {
7195
7318
  body: body4,
7196
7319
  headers: { "Idempotency-Key": idempotencyKey8(ikey) }
7197
7320
  });
7198
- return unwrap41(data);
7321
+ return unwrap42(data);
7199
7322
  }
7200
7323
  async buildSpecSchema() {
7201
7324
  const data = await this.http.get("/sandbox-templates/build-spec");
@@ -7228,12 +7351,12 @@ var SandboxTemplates = class {
7228
7351
  headers: { "Idempotency-Key": idempotencyKey8(ikey) }
7229
7352
  }
7230
7353
  );
7231
- return unwrap41(data);
7354
+ return unwrap42(data);
7232
7355
  }
7233
7356
  };
7234
7357
 
7235
7358
  // src/resources/settings.ts
7236
- function unwrap42(payload) {
7359
+ function unwrap43(payload) {
7237
7360
  if (payload && typeof payload === "object") {
7238
7361
  const p = payload;
7239
7362
  for (const k of [
@@ -7249,7 +7372,7 @@ function unwrap42(payload) {
7249
7372
  return payload;
7250
7373
  }
7251
7374
  function listItems13(payload) {
7252
- const result = unwrap42(payload);
7375
+ const result = unwrap43(payload);
7253
7376
  if (Array.isArray(result)) return result;
7254
7377
  return [];
7255
7378
  }
@@ -7266,46 +7389,46 @@ var Settings = class {
7266
7389
  /** Get the current tenant settings. */
7267
7390
  async get() {
7268
7391
  const data = await this.http.get("/settings");
7269
- return unwrap42(data);
7392
+ return unwrap43(data);
7270
7393
  }
7271
7394
  /** Update tenant settings. */
7272
7395
  async update(params) {
7273
7396
  const body4 = stripUndefined23(params);
7274
7397
  const data = await this.http.put("/settings", body4);
7275
- return unwrap42(data);
7398
+ return unwrap43(data);
7276
7399
  }
7277
7400
  // ── Branding ──────────────────────────────────────────────────────────────
7278
7401
  /** Get tenant branding (logo, colors, custom wordmark). */
7279
7402
  async getBranding() {
7280
7403
  const data = await this.http.get("/settings/branding");
7281
- return unwrap42(data);
7404
+ return unwrap43(data);
7282
7405
  }
7283
7406
  /** Update tenant branding. */
7284
7407
  async updateBranding(params) {
7285
7408
  const body4 = stripUndefined23(params);
7286
7409
  const data = await this.http.put("/settings/branding", body4);
7287
- return unwrap42(data);
7410
+ return unwrap43(data);
7288
7411
  }
7289
7412
  // ── Read-only reference data ───────────────────────────────────────────────
7290
7413
  /** Get tenant-scoped compute pricing. */
7291
7414
  async computePricing() {
7292
7415
  const data = await this.http.get("/settings/compute-pricing");
7293
- return unwrap42(data);
7416
+ return unwrap43(data);
7294
7417
  }
7295
7418
  /** Get tenant-scoped GPU pricing. */
7296
7419
  async gpuPricing() {
7297
7420
  const data = await this.http.get("/settings/gpu-pricing");
7298
- return unwrap42(data);
7421
+ return unwrap43(data);
7299
7422
  }
7300
7423
  /** List models available to this tenant. */
7301
7424
  async availableModels() {
7302
7425
  const data = await this.http.get("/settings/available-models");
7303
- return unwrap42(data);
7426
+ return unwrap43(data);
7304
7427
  }
7305
7428
  /** List regions enabled for this tenant. */
7306
7429
  async regions() {
7307
7430
  const data = await this.http.get("/settings/regions");
7308
- return unwrap42(data);
7431
+ return unwrap43(data);
7309
7432
  }
7310
7433
  // ── BYOK provider keys ────────────────────────────────────────────────────
7311
7434
  /** List tenant-level BYOK provider keys (Anthropic, OpenAI, etc.). */
@@ -7320,7 +7443,7 @@ var Settings = class {
7320
7443
  `/settings/provider-keys/${provider}`,
7321
7444
  body4
7322
7445
  );
7323
- return unwrap42(data);
7446
+ return unwrap43(data);
7324
7447
  }
7325
7448
  /** Delete a BYOK provider key. */
7326
7449
  async deleteProviderKey(provider) {
@@ -7329,7 +7452,7 @@ var Settings = class {
7329
7452
  };
7330
7453
 
7331
7454
  // src/resources/snapshots-standalone.ts
7332
- function unwrap43(data) {
7455
+ function unwrap44(data) {
7333
7456
  if (data && typeof data === "object") {
7334
7457
  const d = data;
7335
7458
  for (const k of ["data", "snapshots", "items"]) {
@@ -7360,14 +7483,14 @@ var SnapshotsStandalone = class {
7360
7483
  return unwrapList12(await this.http.get("/admin/snapshots", query2));
7361
7484
  }
7362
7485
  async get(snapshotId) {
7363
- return unwrap43(
7486
+ return unwrap44(
7364
7487
  await this.http.get(`/admin/snapshots/${snapshotId}`)
7365
7488
  );
7366
7489
  }
7367
7490
  };
7368
7491
 
7369
7492
  // src/resources/storage.ts
7370
- function unwrap44(payload) {
7493
+ function unwrap45(payload) {
7371
7494
  if (payload && typeof payload === "object" && "data" in payload) {
7372
7495
  return payload.data;
7373
7496
  }
@@ -7406,11 +7529,11 @@ var Storage = class {
7406
7529
  ...rest
7407
7530
  });
7408
7531
  const data = await this.http.post("/storage/buckets", body4);
7409
- return unwrap44(data);
7532
+ return unwrap45(data);
7410
7533
  }
7411
7534
  async getBucket(bucketId) {
7412
7535
  const data = await this.http.get(`/storage/buckets/${bucketId}`);
7413
- return unwrap44(data);
7536
+ return unwrap45(data);
7414
7537
  }
7415
7538
  async deleteBucket(bucketId) {
7416
7539
  await this.http.delete(`/storage/buckets/${bucketId}`);
@@ -7460,7 +7583,7 @@ var Storage = class {
7460
7583
  `/storage/buckets/${bucketId}/presign`,
7461
7584
  body4
7462
7585
  );
7463
- return unwrap44(data);
7586
+ return unwrap45(data);
7464
7587
  }
7465
7588
  };
7466
7589
 
@@ -7550,7 +7673,7 @@ var OrgInvites = class {
7550
7673
  };
7551
7674
 
7552
7675
  // src/resources/tenant.ts
7553
- function unwrap45(payload) {
7676
+ function unwrap46(payload) {
7554
7677
  if (payload && typeof payload === "object") {
7555
7678
  const p = payload;
7556
7679
  for (const k of ["data", "tenant", "branding", "items"]) {
@@ -7572,14 +7695,14 @@ var PreviewDomain = class {
7572
7695
  /** Get the tenant's white-label preview domain settings. */
7573
7696
  async get() {
7574
7697
  const data = await this.http.get("/tenant/preview-domain");
7575
- return unwrap45(data);
7698
+ return unwrap46(data);
7576
7699
  }
7577
7700
  /** Set the tenant's white-label preview domain. */
7578
7701
  async set(domain) {
7579
7702
  const data = await this.http.put("/tenant/preview-domain", {
7580
7703
  preview_domain: domain
7581
7704
  });
7582
- return unwrap45(data);
7705
+ return unwrap46(data);
7583
7706
  }
7584
7707
  /** Re-run DNS verification for the configured preview domain. */
7585
7708
  async verify() {
@@ -7587,7 +7710,7 @@ var PreviewDomain = class {
7587
7710
  "/tenant/preview-domain/verify",
7588
7711
  {}
7589
7712
  );
7590
- return unwrap45(data);
7713
+ return unwrap46(data);
7591
7714
  }
7592
7715
  /** Remove the tenant's custom preview domain. */
7593
7716
  async delete() {
@@ -7602,14 +7725,14 @@ var Branding = class {
7602
7725
  /** Get tenant branding used by white-label hosted surfaces. */
7603
7726
  async get() {
7604
7727
  const data = await this.http.get("/tenant/branding");
7605
- return unwrap45(data);
7728
+ return unwrap46(data);
7606
7729
  }
7607
7730
  /** Update tenant branding used by white-label hosted surfaces. */
7608
7731
  async set(params) {
7609
7732
  const data = await this.http.put("/tenant/branding", {
7610
7733
  branding: stripUndefined25(params)
7611
7734
  });
7612
- return unwrap45(data);
7735
+ return unwrap46(data);
7613
7736
  }
7614
7737
  /** Reset tenant branding to platform defaults. */
7615
7738
  async delete() {
@@ -7631,7 +7754,7 @@ var Tenant = class {
7631
7754
  /** Get the current tenant's plan, limits, and live usage counters. */
7632
7755
  async current() {
7633
7756
  const data = await this.http.get("/tenant/plan");
7634
- return unwrap45(data);
7757
+ return unwrap46(data);
7635
7758
  }
7636
7759
  /** Convenience alias for `tenant.branding.get()`. */
7637
7760
  async getBranding() {
@@ -7648,7 +7771,7 @@ var Tenant = class {
7648
7771
  };
7649
7772
 
7650
7773
  // src/resources/usage.ts
7651
- function unwrap46(payload) {
7774
+ function unwrap47(payload) {
7652
7775
  if (payload && typeof payload === "object") {
7653
7776
  const p = payload;
7654
7777
  for (const k of ["data", "usage", "sessions", "summary", "items"]) {
@@ -7670,13 +7793,13 @@ var Usage = class {
7670
7793
  /** Get the current period usage summary. */
7671
7794
  async current() {
7672
7795
  const data = await this.http.get("/usage/summary");
7673
- return unwrap46(data);
7796
+ return unwrap47(data);
7674
7797
  }
7675
7798
  /** List per-session metering events. */
7676
7799
  async sessions(params = {}) {
7677
7800
  const query2 = stripUndefined26(params);
7678
7801
  const data = await this.http.get("/usage/sessions", query2);
7679
- const result = unwrap46(data);
7802
+ const result = unwrap47(data);
7680
7803
  if (Array.isArray(result)) return result;
7681
7804
  return [];
7682
7805
  }
@@ -7684,10 +7807,10 @@ var Usage = class {
7684
7807
  async report(params = {}) {
7685
7808
  const query2 = stripUndefined26(params);
7686
7809
  const data = await this.http.get("/usage/summary", query2);
7687
- return unwrap46(data);
7810
+ return unwrap47(data);
7688
7811
  }
7689
7812
  };
7690
- function unwrap47(payload) {
7813
+ function unwrap48(payload) {
7691
7814
  if (payload && typeof payload === "object" && "data" in payload) {
7692
7815
  return payload.data;
7693
7816
  }
@@ -7723,7 +7846,7 @@ var Volumes = class {
7723
7846
  }
7724
7847
  async get(volumeId) {
7725
7848
  const data = await this.http.get(`/volumes/${volumeId}`);
7726
- return unwrap47(data);
7849
+ return unwrap48(data);
7727
7850
  }
7728
7851
  async create(params) {
7729
7852
  const { idempotencyKey: ikey, sizeGb, ...rest } = params;
@@ -7736,13 +7859,13 @@ var Volumes = class {
7736
7859
  body: body4,
7737
7860
  headers: { "Idempotency-Key": idempotencyKey9(ikey) }
7738
7861
  });
7739
- return unwrap47(data);
7862
+ return unwrap48(data);
7740
7863
  }
7741
7864
  async delete(volumeId) {
7742
7865
  await this.http.delete(`/volumes/${volumeId}`);
7743
7866
  }
7744
7867
  };
7745
- function unwrap48(payload) {
7868
+ function unwrap49(payload) {
7746
7869
  if (payload && typeof payload === "object" && "data" in payload) {
7747
7870
  return payload.data;
7748
7871
  }
@@ -7809,7 +7932,7 @@ var Webhooks = class {
7809
7932
  }
7810
7933
  async get(webhookId) {
7811
7934
  const data = await this.http.get(`/webhooks/${webhookId}`);
7812
- return unwrap48(data);
7935
+ return unwrap49(data);
7813
7936
  }
7814
7937
  async create(params) {
7815
7938
  const { idempotencyKey: ikey, ...rest } = params;
@@ -7819,12 +7942,12 @@ var Webhooks = class {
7819
7942
  body: body4,
7820
7943
  headers: { "Idempotency-Key": idempotencyKey10(ikey) }
7821
7944
  });
7822
- return unwrap48(data);
7945
+ return unwrap49(data);
7823
7946
  }
7824
7947
  async update(webhookId, params) {
7825
7948
  const body4 = stripUndefined28(params);
7826
7949
  const data = await this.http.patch(`/webhooks/${webhookId}`, body4);
7827
- return unwrap48(data);
7950
+ return unwrap49(data);
7828
7951
  }
7829
7952
  async delete(webhookId) {
7830
7953
  await this.http.delete(`/webhooks/${webhookId}`);
@@ -7837,7 +7960,7 @@ var Webhooks = class {
7837
7960
  headers: { "Idempotency-Key": idempotencyKey10(opts.idempotencyKey) }
7838
7961
  }
7839
7962
  );
7840
- return unwrap48(data);
7963
+ return unwrap49(data);
7841
7964
  }
7842
7965
  async deliveries(webhookId) {
7843
7966
  const data = await this.http.get(
@@ -8052,6 +8175,8 @@ var Miosa = class {
8052
8175
  agentRuntimeProfiles;
8053
8176
  /** Inherited runtime env — tenant/workspace/project defaults for agent runtimes. */
8054
8177
  runtimeEnv;
8178
+ /** Runtime capabilities — live backend feature and contract discovery. */
8179
+ runtimeCapabilities;
8055
8180
  /** Computer management — create, list, get, delete. */
8056
8181
  computers;
8057
8182
  /** Sandboxes — native code-execution environments under `/sandboxes`. */
@@ -8158,6 +8283,7 @@ var Miosa = class {
8158
8283
  this.agentRunGroups = new AgentRunGroups(this.http);
8159
8284
  this.agentRuntimeProfiles = new AgentRuntimeProfiles(this.http);
8160
8285
  this.runtimeEnv = new RuntimeEnv(this.http);
8286
+ this.runtimeCapabilities = new RuntimeCapabilitiesResource(this.http);
8161
8287
  this.computers = new Computers(this.http);
8162
8288
  this.sandboxes = new Sandboxes(this.http);
8163
8289
  this.deployments = new Deployments(this.http);
@@ -8347,6 +8473,6 @@ var AppAuth = class {
8347
8473
  }
8348
8474
  };
8349
8475
 
8350
- export { Admin, AgentRunGroups, AgentRuns, AgentRuntimeProfiles, Analytics, ApiKeys, AppAuth, AuditLog, AuthError, Benchmarks, BuilderSessions, Channels, Checkpoints, CommandCenter, Community, Completions, Computer, ComputerAudit, ComputerAutoStop, ComputerEnv, ComputerInbox, ComputerLogs, ComputerNetwork, ComputerOsa, ComputerPorts, ComputerSecrets, ComputerTerminal, ComputerVolumes, Computers, Credits, CronJobs, Dashboard, Databases, DeploymentDomains, DeploymentReleases, DeploymentRuntimeInstances, DeploymentVersions, Deployments, Desktop, DockerDeploy, EgressAudit, EgressNetwork, EgressSecrets, Email, EmailCampaigns, EmailInbox, EmailTemplates, Embeddings, Exec, ExternalKeys, Files, FlatCustomDomains, Functions, HealthChecks, InsufficientCreditsError, Integrations, Mcp, Miosa, MiosaError, Models, NetworkError, NetworkPolicy, NotFoundError, OAuthFlow, OpenComputers, OrgInvites, ProjectAuth, ProjectIntegrations, ProviderDefaults, RateLimitError, Regions, RuntimeEnv, SANDBOX_TEMPLATE, Sandbox, SandboxArtifacts, SandboxAudit, SandboxCommands, SandboxEnv, SandboxEvents, SandboxFiles, SandboxNetwork, SandboxPreview, SandboxPreviews, SandboxSecrets, SandboxTags, SandboxTemplates, SandboxTerminal, Sandboxes, ScopedFs, Settings, SnapshotsStandalone, Storage, Tenant, TimeoutError, Usage, ValidationError, Volumes, Webhooks, WorkspaceInvites, WorkspaceMembers, verifySignature };
8476
+ export { Admin, AgentRunGroups, AgentRuns, AgentRuntimeProfiles, Analytics, ApiKeys, AppAuth, AuditLog, AuthError, Benchmarks, BuilderSessions, Channels, Checkpoints, CommandCenter, Community, Completions, Computer, ComputerAudit, ComputerAutoStop, ComputerEnv, ComputerInbox, ComputerLogs, ComputerNetwork, ComputerOsa, ComputerPorts, ComputerSecrets, ComputerTerminal, ComputerVolumes, Computers, Credits, CronJobs, Dashboard, Databases, DeploymentDomains, DeploymentReleases, DeploymentRuntimeInstances, DeploymentVersions, Deployments, Desktop, DockerDeploy, EgressAudit, EgressNetwork, EgressSecrets, Email, EmailCampaigns, EmailInbox, EmailTemplates, Embeddings, Exec, ExternalKeys, Files, FlatCustomDomains, Functions, HealthChecks, InsufficientCreditsError, Integrations, Mcp, Miosa, MiosaError, Models, NetworkError, NetworkPolicy, NotFoundError, OAuthFlow, OpenComputers, OrgInvites, ProjectAuth, ProjectIntegrations, ProviderDefaults, RateLimitError, Regions, RuntimeCapabilitiesResource, RuntimeEnv, SANDBOX_TEMPLATE, Sandbox, SandboxArtifacts, SandboxAudit, SandboxCommands, SandboxEnv, SandboxEvents, SandboxFiles, SandboxNetwork, SandboxPreview, SandboxPreviews, SandboxSecrets, SandboxTags, SandboxTemplates, SandboxTerminal, Sandboxes, ScopedFs, Settings, SnapshotsStandalone, Storage, Tenant, TimeoutError, Usage, ValidationError, Volumes, Webhooks, WorkspaceInvites, WorkspaceMembers, verifySignature };
8351
8477
  //# sourceMappingURL=index.js.map
8352
8478
  //# sourceMappingURL=index.js.map