@miosa/sdk 1.2.13 → 1.2.14

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;
@@ -863,6 +926,37 @@ var AgentRuns = class {
863
926
  )}/download${query2}`
864
927
  );
865
928
  }
929
+ async events(id) {
930
+ const data = unwrap3(
931
+ await this.http.get(`/agent-runs/${encodeURIComponent(id)}/events`)
932
+ );
933
+ if (Array.isArray(data)) return data;
934
+ return data.events ?? data.items ?? [];
935
+ }
936
+ streamEvents(id) {
937
+ return this.http.stream(
938
+ `/agent-runs/${encodeURIComponent(id)}/events`
939
+ );
940
+ }
941
+ async waitForCompletion(id, options = {}) {
942
+ const timeoutMs = options.timeoutMs ?? 15 * 60 * 1e3;
943
+ const pollIntervalMs = options.pollIntervalMs ?? 2e3;
944
+ const terminalStatuses = options.terminalStatuses ?? [
945
+ "succeeded",
946
+ "failed",
947
+ "canceled",
948
+ "cancelled"
949
+ ];
950
+ const deadline = Date.now() + timeoutMs;
951
+ while (true) {
952
+ const run = await this.get(id);
953
+ if (isTerminalStatus2(run.status, terminalStatuses)) return run;
954
+ if (Date.now() >= deadline) {
955
+ throw new Error(`Timed out waiting for agent run ${id}`);
956
+ }
957
+ await sleep3(Math.min(pollIntervalMs, Math.max(0, deadline - Date.now())));
958
+ }
959
+ }
866
960
  async run(params) {
867
961
  const body4 = stripUndefined2({
868
962
  prompt: params.prompt,
@@ -883,6 +977,10 @@ var AgentRuns = class {
883
977
  parent_agent_run_id: params.parentAgentRunId,
884
978
  orchestration_role: params.orchestrationRole,
885
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,
886
984
  metadata: params.metadata
887
985
  });
888
986
  return unwrap3(await this.http.post("/agent-runs", body4));
@@ -2056,7 +2154,7 @@ function listQuery(params) {
2056
2154
  )
2057
2155
  });
2058
2156
  }
2059
- function sleep2(ms) {
2157
+ function sleep4(ms) {
2060
2158
  return new Promise((resolve) => setTimeout(resolve, ms));
2061
2159
  }
2062
2160
  var EgressAudit = class {
@@ -2105,7 +2203,7 @@ var EgressAudit = class {
2105
2203
  const ts = event.inserted_at ?? event.timestamp;
2106
2204
  if (typeof ts === "string") since = ts;
2107
2205
  }
2108
- await sleep2(pollMs);
2206
+ await sleep4(pollMs);
2109
2207
  }
2110
2208
  }
2111
2209
  };
@@ -2498,7 +2596,7 @@ function oauthBody(params) {
2498
2596
  redirect_uri: pickFirst3(params.redirectUri, params.redirect_uri)
2499
2597
  });
2500
2598
  }
2501
- function sleep3(ms) {
2599
+ function sleep5(ms) {
2502
2600
  return new Promise((resolve) => setTimeout(resolve, ms));
2503
2601
  }
2504
2602
  var OAuthFlow = class {
@@ -2542,7 +2640,7 @@ var OAuthFlow = class {
2542
2640
  `OAuth flow ${this.state} ended in status=${status}: ${payload.error ?? payload.message ?? "no detail"}`
2543
2641
  );
2544
2642
  }
2545
- await sleep3(pollMs);
2643
+ await sleep5(pollMs);
2546
2644
  }
2547
2645
  throw new Error(
2548
2646
  `OAuth flow ${this.state} did not complete within ${timeoutSec}s`
@@ -6099,6 +6197,25 @@ var RuntimeEnv = class {
6099
6197
  }
6100
6198
  };
6101
6199
 
6200
+ // src/resources/runtime-capabilities.ts
6201
+ function unwrap40(payload) {
6202
+ if (payload && typeof payload === "object" && "data" in payload) {
6203
+ return payload.data;
6204
+ }
6205
+ return payload;
6206
+ }
6207
+ var RuntimeCapabilitiesResource = class {
6208
+ constructor(http) {
6209
+ this.http = http;
6210
+ }
6211
+ http;
6212
+ async get() {
6213
+ return unwrap40(
6214
+ await this.http.get("/runtime-capabilities")
6215
+ );
6216
+ }
6217
+ };
6218
+
6102
6219
  // src/resources/sandboxes.ts
6103
6220
  function encodeContent(content) {
6104
6221
  const bytes = typeof content === "string" ? new TextEncoder().encode(content) : content;
@@ -6113,7 +6230,7 @@ var AGENT_WORKSPACE_TIMEOUT_SEC = 86400;
6113
6230
  var AGENT_WORKSPACE_IDLE_TIMEOUT_SEC = 1800;
6114
6231
  var AGENT_WORKSPACE_SNAPSHOT_EXPIRATION_DAYS = 30;
6115
6232
  var AGENT_WORKSPACE_KEEP_LAST_SNAPSHOTS = 1;
6116
- function unwrap40(payload) {
6233
+ function unwrap41(payload) {
6117
6234
  if (payload !== null && typeof payload === "object" && "data" in payload && payload.data !== void 0) {
6118
6235
  return payload.data;
6119
6236
  }
@@ -6339,7 +6456,7 @@ var SandboxTerminal = class {
6339
6456
  const body4 = Object.fromEntries(
6340
6457
  Object.entries(params).filter(([, v]) => v !== void 0)
6341
6458
  );
6342
- const response = unwrap40(
6459
+ const response = unwrap41(
6343
6460
  await this.sandbox.http.post(`/sandboxes/${this.sandbox.id}/terminal`, body4)
6344
6461
  );
6345
6462
  return response;
@@ -6388,7 +6505,7 @@ var SandboxPreviews = class {
6388
6505
  Object.entries(opts).filter(([, v]) => v !== void 0)
6389
6506
  )
6390
6507
  };
6391
- return unwrap40(
6508
+ return unwrap41(
6392
6509
  await this.http.post(
6393
6510
  `/sandboxes/${this.sandbox.id}/previews`,
6394
6511
  body4
@@ -6396,7 +6513,7 @@ var SandboxPreviews = class {
6396
6513
  );
6397
6514
  }
6398
6515
  async get(previewId) {
6399
- return unwrap40(
6516
+ return unwrap41(
6400
6517
  await this.http.get(
6401
6518
  `/sandboxes/${this.sandbox.id}/previews/${previewId}`
6402
6519
  )
@@ -6409,7 +6526,7 @@ var SandboxPreviews = class {
6409
6526
  }
6410
6527
  /** Mint a share token for previewId. */
6411
6528
  async share(previewId, opts = {}) {
6412
- return unwrap40(
6529
+ return unwrap41(
6413
6530
  await this.http.post(
6414
6531
  `/sandboxes/${this.sandbox.id}/previews/${previewId}/share`,
6415
6532
  { ttl_seconds: opts.ttl_seconds ?? opts.expires_in_sec ?? 3600 }
@@ -6478,7 +6595,7 @@ var SandboxTags = class {
6478
6595
  sandbox;
6479
6596
  /** Replace the full tag list with tags. */
6480
6597
  async set(tags) {
6481
- return unwrap40(
6598
+ return unwrap41(
6482
6599
  await this.sandbox.http.patch(`/sandboxes/${this.sandbox.id}/tags`, { tags })
6483
6600
  );
6484
6601
  }
@@ -6546,14 +6663,14 @@ var Sandbox = class _Sandbox {
6546
6663
  return this.data.template_id ?? this.data.image_id ?? "";
6547
6664
  }
6548
6665
  async refresh() {
6549
- this.data = unwrap40(
6666
+ this.data = unwrap41(
6550
6667
  await this.http.get(`/sandboxes/${this.id}`)
6551
6668
  );
6552
6669
  return this;
6553
6670
  }
6554
6671
  async runExec(command, options) {
6555
6672
  this.assertRunning("exec");
6556
- const response = unwrap40(
6673
+ const response = unwrap41(
6557
6674
  await this.http.post(
6558
6675
  `/sandboxes/${this.id}/exec`,
6559
6676
  execBody(command, options)
@@ -6598,7 +6715,7 @@ var Sandbox = class _Sandbox {
6598
6715
  }
6599
6716
  async createExport(params) {
6600
6717
  const body4 = typeof params === "string" ? { path: params } : Array.isArray(params) ? { paths: params } : params;
6601
- const response = unwrap40(
6718
+ const response = unwrap41(
6602
6719
  await this.http.post(
6603
6720
  `/sandboxes/${this.id}/exports`,
6604
6721
  body4
@@ -6623,7 +6740,7 @@ var Sandbox = class _Sandbox {
6623
6740
  }
6624
6741
  async listFiles(path = "/workspace") {
6625
6742
  this.assertRunning("files.list");
6626
- const response = unwrap40(
6743
+ const response = unwrap41(
6627
6744
  await this.http.get(
6628
6745
  `/sandboxes/${this.id}/files`,
6629
6746
  { path }
@@ -6633,7 +6750,7 @@ var Sandbox = class _Sandbox {
6633
6750
  }
6634
6751
  async statFile(path) {
6635
6752
  this.assertRunning("files.stat");
6636
- return unwrap40(
6753
+ return unwrap41(
6637
6754
  await this.http.post(
6638
6755
  `/sandboxes/${this.id}/files/stat`,
6639
6756
  { path }
@@ -6642,7 +6759,7 @@ var Sandbox = class _Sandbox {
6642
6759
  }
6643
6760
  async expose(port) {
6644
6761
  this.assertRunning("expose");
6645
- const response = unwrap40(
6762
+ const response = unwrap41(
6646
6763
  await this.http.post(
6647
6764
  `/sandboxes/${this.id}/expose`,
6648
6765
  port === void 0 ? {} : { port }
@@ -6652,7 +6769,7 @@ var Sandbox = class _Sandbox {
6652
6769
  }
6653
6770
  async startTemplate(options = {}) {
6654
6771
  this.assertRunning("startTemplate");
6655
- return unwrap40(
6772
+ return unwrap41(
6656
6773
  await this.http.post(
6657
6774
  `/sandboxes/${this.id}/template/start`,
6658
6775
  options
@@ -6660,7 +6777,7 @@ var Sandbox = class _Sandbox {
6660
6777
  );
6661
6778
  }
6662
6779
  async getArtifacts() {
6663
- return unwrap40(
6780
+ return unwrap41(
6664
6781
  await this.http.get(
6665
6782
  `/sandboxes/${this.id}/artifacts`
6666
6783
  )
@@ -6671,7 +6788,7 @@ var Sandbox = class _Sandbox {
6671
6788
  `/sandboxes/${this.id}/logs`,
6672
6789
  { lines }
6673
6790
  );
6674
- return unwrap40(response);
6791
+ return unwrap41(response);
6675
6792
  }
6676
6793
  streamLogs() {
6677
6794
  return this.http.stream(
@@ -6680,7 +6797,7 @@ var Sandbox = class _Sandbox {
6680
6797
  }
6681
6798
  async createSnapshot(comment) {
6682
6799
  this.assertRunning("snapshots.create");
6683
- return unwrap40(
6800
+ return unwrap41(
6684
6801
  await this.http.post(
6685
6802
  `/sandboxes/${this.id}/snapshots`,
6686
6803
  comment ? { comment } : {}
@@ -6688,14 +6805,14 @@ var Sandbox = class _Sandbox {
6688
6805
  );
6689
6806
  }
6690
6807
  async listSnapshots() {
6691
- return unwrap40(
6808
+ return unwrap41(
6692
6809
  await this.http.get(
6693
6810
  `/sandboxes/${this.id}/snapshots`
6694
6811
  )
6695
6812
  );
6696
6813
  }
6697
6814
  async restoreSnapshot(snapshotId) {
6698
- const data = unwrap40(
6815
+ const data = unwrap41(
6699
6816
  await this.http.post(
6700
6817
  `/sandboxes/${this.id}/restore/${snapshotId}`,
6701
6818
  {}
@@ -6715,7 +6832,7 @@ var Sandbox = class _Sandbox {
6715
6832
  const body4 = {};
6716
6833
  if (opts.name !== void 0) body4.name = opts.name;
6717
6834
  if (opts.metadata !== void 0) body4.metadata = opts.metadata;
6718
- const data = unwrap40(
6835
+ const data = unwrap41(
6719
6836
  await this.http.post(
6720
6837
  `/sandboxes/${this.id}/fork`,
6721
6838
  body4
@@ -6746,7 +6863,7 @@ var Sandbox = class _Sandbox {
6746
6863
  timeout_sec: params.timeout_sec ?? params.timeoutSec,
6747
6864
  idle_timeout_sec: params.idle_timeout_sec ?? params.idleTimeoutSec
6748
6865
  });
6749
- const data = unwrap40(
6866
+ const data = unwrap41(
6750
6867
  await this.http.patch(
6751
6868
  `/sandboxes/${this.id}`,
6752
6869
  body4
@@ -6756,7 +6873,7 @@ var Sandbox = class _Sandbox {
6756
6873
  return this;
6757
6874
  }
6758
6875
  async extend(timeoutSec) {
6759
- const data = unwrap40(
6876
+ const data = unwrap41(
6760
6877
  await this.http.post(
6761
6878
  `/sandboxes/${this.id}/extend`,
6762
6879
  { timeout_sec: timeoutSec }
@@ -6779,7 +6896,7 @@ var Sandbox = class _Sandbox {
6779
6896
  return raw;
6780
6897
  }
6781
6898
  async pause() {
6782
- const data = unwrap40(
6899
+ const data = unwrap41(
6783
6900
  await this.http.post(
6784
6901
  `/sandboxes/${this.id}/pause`,
6785
6902
  {}
@@ -6789,7 +6906,7 @@ var Sandbox = class _Sandbox {
6789
6906
  return this;
6790
6907
  }
6791
6908
  async resume() {
6792
- const data = unwrap40(
6909
+ const data = unwrap41(
6793
6910
  await this.http.post(
6794
6911
  `/sandboxes/${this.id}/resume`,
6795
6912
  {}
@@ -6825,7 +6942,7 @@ var Sandbox = class _Sandbox {
6825
6942
  if (idempotencyKey11) {
6826
6943
  requestOptions.headers = { "Idempotency-Key": idempotencyKey11 };
6827
6944
  }
6828
- return unwrap40(
6945
+ return unwrap41(
6829
6946
  await this.http.request(
6830
6947
  `/sandboxes/${this.id}/deploy`,
6831
6948
  requestOptions
@@ -6837,7 +6954,7 @@ var Sandbox = class _Sandbox {
6837
6954
  }
6838
6955
  /** Check readiness of the sandbox (GET /sandboxes/:id/readiness). */
6839
6956
  async readiness() {
6840
- return unwrap40(
6957
+ return unwrap41(
6841
6958
  await this.http.get(
6842
6959
  `/sandboxes/${this.id}/readiness`
6843
6960
  )
@@ -7005,7 +7122,7 @@ var Sandboxes = class {
7005
7122
  if (idempotencyKey11) {
7006
7123
  requestOptions.headers = { "Idempotency-Key": idempotencyKey11 };
7007
7124
  }
7008
- const data = unwrap40(
7125
+ const data = unwrap41(
7009
7126
  await this.http.request(
7010
7127
  "/sandboxes",
7011
7128
  requestOptions
@@ -7024,7 +7141,7 @@ var Sandboxes = class {
7024
7141
  return listItems11(data).map((item) => new Sandbox(this.http, item));
7025
7142
  }
7026
7143
  async get(id) {
7027
- const data = unwrap40(
7144
+ const data = unwrap41(
7028
7145
  await this.http.get(`/sandboxes/${id}`)
7029
7146
  );
7030
7147
  return new Sandbox(this.http, data);
@@ -7033,7 +7150,7 @@ var Sandboxes = class {
7033
7150
  return this.get(id);
7034
7151
  }
7035
7152
  async getByName(name) {
7036
- const data = unwrap40(
7153
+ const data = unwrap41(
7037
7154
  await this.http.get(
7038
7155
  `/sandboxes/by-name/${encodeURIComponent(name)}`
7039
7156
  )
@@ -7098,7 +7215,7 @@ var Sandboxes = class {
7098
7215
  metadata: params.metadata
7099
7216
  })
7100
7217
  );
7101
- return unwrap40(response);
7218
+ return unwrap41(response);
7102
7219
  }
7103
7220
  async createTemplateBuild(templateId, params = {}) {
7104
7221
  const response = await this.http.post(
@@ -7108,19 +7225,19 @@ var Sandboxes = class {
7108
7225
  metadata: params.metadata
7109
7226
  })
7110
7227
  );
7111
- return unwrap40(response);
7228
+ return unwrap41(response);
7112
7229
  }
7113
7230
  async listTemplateBuilds(templateId) {
7114
7231
  const response = await this.http.get(
7115
7232
  `/sandbox-templates/${templateId}/builds`
7116
7233
  );
7117
- return unwrap40(response);
7234
+ return unwrap41(response);
7118
7235
  }
7119
7236
  async getTemplateBuild(buildId) {
7120
7237
  const response = await this.http.get(
7121
7238
  `/sandbox-template-builds/${buildId}`
7122
7239
  );
7123
- return unwrap40(response);
7240
+ return unwrap41(response);
7124
7241
  }
7125
7242
  };
7126
7243
  function toBase642(bytes) {
@@ -7132,7 +7249,7 @@ function toBase642(bytes) {
7132
7249
  }
7133
7250
  return btoa(binary);
7134
7251
  }
7135
- function unwrap41(payload) {
7252
+ function unwrap42(payload) {
7136
7253
  if (payload && typeof payload === "object" && "data" in payload) {
7137
7254
  return payload.data;
7138
7255
  }
@@ -7175,7 +7292,7 @@ var SandboxTemplates = class {
7175
7292
  const data = await this.http.get(
7176
7293
  `/sandbox-templates/${templateId}`
7177
7294
  );
7178
- return unwrap41(data);
7295
+ return unwrap42(data);
7179
7296
  }
7180
7297
  async create(params) {
7181
7298
  const {
@@ -7195,7 +7312,7 @@ var SandboxTemplates = class {
7195
7312
  body: body4,
7196
7313
  headers: { "Idempotency-Key": idempotencyKey8(ikey) }
7197
7314
  });
7198
- return unwrap41(data);
7315
+ return unwrap42(data);
7199
7316
  }
7200
7317
  async buildSpecSchema() {
7201
7318
  const data = await this.http.get("/sandbox-templates/build-spec");
@@ -7228,12 +7345,12 @@ var SandboxTemplates = class {
7228
7345
  headers: { "Idempotency-Key": idempotencyKey8(ikey) }
7229
7346
  }
7230
7347
  );
7231
- return unwrap41(data);
7348
+ return unwrap42(data);
7232
7349
  }
7233
7350
  };
7234
7351
 
7235
7352
  // src/resources/settings.ts
7236
- function unwrap42(payload) {
7353
+ function unwrap43(payload) {
7237
7354
  if (payload && typeof payload === "object") {
7238
7355
  const p = payload;
7239
7356
  for (const k of [
@@ -7249,7 +7366,7 @@ function unwrap42(payload) {
7249
7366
  return payload;
7250
7367
  }
7251
7368
  function listItems13(payload) {
7252
- const result = unwrap42(payload);
7369
+ const result = unwrap43(payload);
7253
7370
  if (Array.isArray(result)) return result;
7254
7371
  return [];
7255
7372
  }
@@ -7266,46 +7383,46 @@ var Settings = class {
7266
7383
  /** Get the current tenant settings. */
7267
7384
  async get() {
7268
7385
  const data = await this.http.get("/settings");
7269
- return unwrap42(data);
7386
+ return unwrap43(data);
7270
7387
  }
7271
7388
  /** Update tenant settings. */
7272
7389
  async update(params) {
7273
7390
  const body4 = stripUndefined23(params);
7274
7391
  const data = await this.http.put("/settings", body4);
7275
- return unwrap42(data);
7392
+ return unwrap43(data);
7276
7393
  }
7277
7394
  // ── Branding ──────────────────────────────────────────────────────────────
7278
7395
  /** Get tenant branding (logo, colors, custom wordmark). */
7279
7396
  async getBranding() {
7280
7397
  const data = await this.http.get("/settings/branding");
7281
- return unwrap42(data);
7398
+ return unwrap43(data);
7282
7399
  }
7283
7400
  /** Update tenant branding. */
7284
7401
  async updateBranding(params) {
7285
7402
  const body4 = stripUndefined23(params);
7286
7403
  const data = await this.http.put("/settings/branding", body4);
7287
- return unwrap42(data);
7404
+ return unwrap43(data);
7288
7405
  }
7289
7406
  // ── Read-only reference data ───────────────────────────────────────────────
7290
7407
  /** Get tenant-scoped compute pricing. */
7291
7408
  async computePricing() {
7292
7409
  const data = await this.http.get("/settings/compute-pricing");
7293
- return unwrap42(data);
7410
+ return unwrap43(data);
7294
7411
  }
7295
7412
  /** Get tenant-scoped GPU pricing. */
7296
7413
  async gpuPricing() {
7297
7414
  const data = await this.http.get("/settings/gpu-pricing");
7298
- return unwrap42(data);
7415
+ return unwrap43(data);
7299
7416
  }
7300
7417
  /** List models available to this tenant. */
7301
7418
  async availableModels() {
7302
7419
  const data = await this.http.get("/settings/available-models");
7303
- return unwrap42(data);
7420
+ return unwrap43(data);
7304
7421
  }
7305
7422
  /** List regions enabled for this tenant. */
7306
7423
  async regions() {
7307
7424
  const data = await this.http.get("/settings/regions");
7308
- return unwrap42(data);
7425
+ return unwrap43(data);
7309
7426
  }
7310
7427
  // ── BYOK provider keys ────────────────────────────────────────────────────
7311
7428
  /** List tenant-level BYOK provider keys (Anthropic, OpenAI, etc.). */
@@ -7320,7 +7437,7 @@ var Settings = class {
7320
7437
  `/settings/provider-keys/${provider}`,
7321
7438
  body4
7322
7439
  );
7323
- return unwrap42(data);
7440
+ return unwrap43(data);
7324
7441
  }
7325
7442
  /** Delete a BYOK provider key. */
7326
7443
  async deleteProviderKey(provider) {
@@ -7329,7 +7446,7 @@ var Settings = class {
7329
7446
  };
7330
7447
 
7331
7448
  // src/resources/snapshots-standalone.ts
7332
- function unwrap43(data) {
7449
+ function unwrap44(data) {
7333
7450
  if (data && typeof data === "object") {
7334
7451
  const d = data;
7335
7452
  for (const k of ["data", "snapshots", "items"]) {
@@ -7360,14 +7477,14 @@ var SnapshotsStandalone = class {
7360
7477
  return unwrapList12(await this.http.get("/admin/snapshots", query2));
7361
7478
  }
7362
7479
  async get(snapshotId) {
7363
- return unwrap43(
7480
+ return unwrap44(
7364
7481
  await this.http.get(`/admin/snapshots/${snapshotId}`)
7365
7482
  );
7366
7483
  }
7367
7484
  };
7368
7485
 
7369
7486
  // src/resources/storage.ts
7370
- function unwrap44(payload) {
7487
+ function unwrap45(payload) {
7371
7488
  if (payload && typeof payload === "object" && "data" in payload) {
7372
7489
  return payload.data;
7373
7490
  }
@@ -7406,11 +7523,11 @@ var Storage = class {
7406
7523
  ...rest
7407
7524
  });
7408
7525
  const data = await this.http.post("/storage/buckets", body4);
7409
- return unwrap44(data);
7526
+ return unwrap45(data);
7410
7527
  }
7411
7528
  async getBucket(bucketId) {
7412
7529
  const data = await this.http.get(`/storage/buckets/${bucketId}`);
7413
- return unwrap44(data);
7530
+ return unwrap45(data);
7414
7531
  }
7415
7532
  async deleteBucket(bucketId) {
7416
7533
  await this.http.delete(`/storage/buckets/${bucketId}`);
@@ -7460,7 +7577,7 @@ var Storage = class {
7460
7577
  `/storage/buckets/${bucketId}/presign`,
7461
7578
  body4
7462
7579
  );
7463
- return unwrap44(data);
7580
+ return unwrap45(data);
7464
7581
  }
7465
7582
  };
7466
7583
 
@@ -7550,7 +7667,7 @@ var OrgInvites = class {
7550
7667
  };
7551
7668
 
7552
7669
  // src/resources/tenant.ts
7553
- function unwrap45(payload) {
7670
+ function unwrap46(payload) {
7554
7671
  if (payload && typeof payload === "object") {
7555
7672
  const p = payload;
7556
7673
  for (const k of ["data", "tenant", "branding", "items"]) {
@@ -7572,14 +7689,14 @@ var PreviewDomain = class {
7572
7689
  /** Get the tenant's white-label preview domain settings. */
7573
7690
  async get() {
7574
7691
  const data = await this.http.get("/tenant/preview-domain");
7575
- return unwrap45(data);
7692
+ return unwrap46(data);
7576
7693
  }
7577
7694
  /** Set the tenant's white-label preview domain. */
7578
7695
  async set(domain) {
7579
7696
  const data = await this.http.put("/tenant/preview-domain", {
7580
7697
  preview_domain: domain
7581
7698
  });
7582
- return unwrap45(data);
7699
+ return unwrap46(data);
7583
7700
  }
7584
7701
  /** Re-run DNS verification for the configured preview domain. */
7585
7702
  async verify() {
@@ -7587,7 +7704,7 @@ var PreviewDomain = class {
7587
7704
  "/tenant/preview-domain/verify",
7588
7705
  {}
7589
7706
  );
7590
- return unwrap45(data);
7707
+ return unwrap46(data);
7591
7708
  }
7592
7709
  /** Remove the tenant's custom preview domain. */
7593
7710
  async delete() {
@@ -7602,14 +7719,14 @@ var Branding = class {
7602
7719
  /** Get tenant branding used by white-label hosted surfaces. */
7603
7720
  async get() {
7604
7721
  const data = await this.http.get("/tenant/branding");
7605
- return unwrap45(data);
7722
+ return unwrap46(data);
7606
7723
  }
7607
7724
  /** Update tenant branding used by white-label hosted surfaces. */
7608
7725
  async set(params) {
7609
7726
  const data = await this.http.put("/tenant/branding", {
7610
7727
  branding: stripUndefined25(params)
7611
7728
  });
7612
- return unwrap45(data);
7729
+ return unwrap46(data);
7613
7730
  }
7614
7731
  /** Reset tenant branding to platform defaults. */
7615
7732
  async delete() {
@@ -7631,7 +7748,7 @@ var Tenant = class {
7631
7748
  /** Get the current tenant's plan, limits, and live usage counters. */
7632
7749
  async current() {
7633
7750
  const data = await this.http.get("/tenant/plan");
7634
- return unwrap45(data);
7751
+ return unwrap46(data);
7635
7752
  }
7636
7753
  /** Convenience alias for `tenant.branding.get()`. */
7637
7754
  async getBranding() {
@@ -7648,7 +7765,7 @@ var Tenant = class {
7648
7765
  };
7649
7766
 
7650
7767
  // src/resources/usage.ts
7651
- function unwrap46(payload) {
7768
+ function unwrap47(payload) {
7652
7769
  if (payload && typeof payload === "object") {
7653
7770
  const p = payload;
7654
7771
  for (const k of ["data", "usage", "sessions", "summary", "items"]) {
@@ -7670,13 +7787,13 @@ var Usage = class {
7670
7787
  /** Get the current period usage summary. */
7671
7788
  async current() {
7672
7789
  const data = await this.http.get("/usage/summary");
7673
- return unwrap46(data);
7790
+ return unwrap47(data);
7674
7791
  }
7675
7792
  /** List per-session metering events. */
7676
7793
  async sessions(params = {}) {
7677
7794
  const query2 = stripUndefined26(params);
7678
7795
  const data = await this.http.get("/usage/sessions", query2);
7679
- const result = unwrap46(data);
7796
+ const result = unwrap47(data);
7680
7797
  if (Array.isArray(result)) return result;
7681
7798
  return [];
7682
7799
  }
@@ -7684,10 +7801,10 @@ var Usage = class {
7684
7801
  async report(params = {}) {
7685
7802
  const query2 = stripUndefined26(params);
7686
7803
  const data = await this.http.get("/usage/summary", query2);
7687
- return unwrap46(data);
7804
+ return unwrap47(data);
7688
7805
  }
7689
7806
  };
7690
- function unwrap47(payload) {
7807
+ function unwrap48(payload) {
7691
7808
  if (payload && typeof payload === "object" && "data" in payload) {
7692
7809
  return payload.data;
7693
7810
  }
@@ -7723,7 +7840,7 @@ var Volumes = class {
7723
7840
  }
7724
7841
  async get(volumeId) {
7725
7842
  const data = await this.http.get(`/volumes/${volumeId}`);
7726
- return unwrap47(data);
7843
+ return unwrap48(data);
7727
7844
  }
7728
7845
  async create(params) {
7729
7846
  const { idempotencyKey: ikey, sizeGb, ...rest } = params;
@@ -7736,13 +7853,13 @@ var Volumes = class {
7736
7853
  body: body4,
7737
7854
  headers: { "Idempotency-Key": idempotencyKey9(ikey) }
7738
7855
  });
7739
- return unwrap47(data);
7856
+ return unwrap48(data);
7740
7857
  }
7741
7858
  async delete(volumeId) {
7742
7859
  await this.http.delete(`/volumes/${volumeId}`);
7743
7860
  }
7744
7861
  };
7745
- function unwrap48(payload) {
7862
+ function unwrap49(payload) {
7746
7863
  if (payload && typeof payload === "object" && "data" in payload) {
7747
7864
  return payload.data;
7748
7865
  }
@@ -7809,7 +7926,7 @@ var Webhooks = class {
7809
7926
  }
7810
7927
  async get(webhookId) {
7811
7928
  const data = await this.http.get(`/webhooks/${webhookId}`);
7812
- return unwrap48(data);
7929
+ return unwrap49(data);
7813
7930
  }
7814
7931
  async create(params) {
7815
7932
  const { idempotencyKey: ikey, ...rest } = params;
@@ -7819,12 +7936,12 @@ var Webhooks = class {
7819
7936
  body: body4,
7820
7937
  headers: { "Idempotency-Key": idempotencyKey10(ikey) }
7821
7938
  });
7822
- return unwrap48(data);
7939
+ return unwrap49(data);
7823
7940
  }
7824
7941
  async update(webhookId, params) {
7825
7942
  const body4 = stripUndefined28(params);
7826
7943
  const data = await this.http.patch(`/webhooks/${webhookId}`, body4);
7827
- return unwrap48(data);
7944
+ return unwrap49(data);
7828
7945
  }
7829
7946
  async delete(webhookId) {
7830
7947
  await this.http.delete(`/webhooks/${webhookId}`);
@@ -7837,7 +7954,7 @@ var Webhooks = class {
7837
7954
  headers: { "Idempotency-Key": idempotencyKey10(opts.idempotencyKey) }
7838
7955
  }
7839
7956
  );
7840
- return unwrap48(data);
7957
+ return unwrap49(data);
7841
7958
  }
7842
7959
  async deliveries(webhookId) {
7843
7960
  const data = await this.http.get(
@@ -8052,6 +8169,8 @@ var Miosa = class {
8052
8169
  agentRuntimeProfiles;
8053
8170
  /** Inherited runtime env — tenant/workspace/project defaults for agent runtimes. */
8054
8171
  runtimeEnv;
8172
+ /** Runtime capabilities — live backend feature and contract discovery. */
8173
+ runtimeCapabilities;
8055
8174
  /** Computer management — create, list, get, delete. */
8056
8175
  computers;
8057
8176
  /** Sandboxes — native code-execution environments under `/sandboxes`. */
@@ -8158,6 +8277,7 @@ var Miosa = class {
8158
8277
  this.agentRunGroups = new AgentRunGroups(this.http);
8159
8278
  this.agentRuntimeProfiles = new AgentRuntimeProfiles(this.http);
8160
8279
  this.runtimeEnv = new RuntimeEnv(this.http);
8280
+ this.runtimeCapabilities = new RuntimeCapabilitiesResource(this.http);
8161
8281
  this.computers = new Computers(this.http);
8162
8282
  this.sandboxes = new Sandboxes(this.http);
8163
8283
  this.deployments = new Deployments(this.http);
@@ -8347,6 +8467,6 @@ var AppAuth = class {
8347
8467
  }
8348
8468
  };
8349
8469
 
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 };
8470
+ 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
8471
  //# sourceMappingURL=index.js.map
8352
8472
  //# sourceMappingURL=index.js.map