@miosa/sdk 1.2.12 → 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;
@@ -694,6 +710,60 @@ var AgentRunGroups = class {
694
710
  )
695
711
  );
696
712
  }
713
+ async events(id) {
714
+ const data = unwrap(
715
+ await this.http.get(
716
+ `/agent-run-groups/${encodeURIComponent(id)}/events`
717
+ )
718
+ );
719
+ if (Array.isArray(data)) return data;
720
+ return data.events ?? data.items ?? [];
721
+ }
722
+ streamEvents(id) {
723
+ return this.http.stream(
724
+ `/agent-run-groups/${encodeURIComponent(id)}/events`
725
+ );
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
+ }
697
767
  };
698
768
 
699
769
  // src/resources/agent-runtime-profiles.ts
@@ -804,6 +874,13 @@ function stripUndefined2(input) {
804
874
  Object.entries(input).filter(([, value]) => value !== void 0)
805
875
  );
806
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
+ }
807
884
  var AgentRuns = class {
808
885
  constructor(http) {
809
886
  this.http = http;
@@ -849,6 +926,37 @@ var AgentRuns = class {
849
926
  )}/download${query2}`
850
927
  );
851
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
+ }
852
960
  async run(params) {
853
961
  const body4 = stripUndefined2({
854
962
  prompt: params.prompt,
@@ -869,6 +977,10 @@ var AgentRuns = class {
869
977
  parent_agent_run_id: params.parentAgentRunId,
870
978
  orchestration_role: params.orchestrationRole,
871
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,
872
984
  metadata: params.metadata
873
985
  });
874
986
  return unwrap3(await this.http.post("/agent-runs", body4));
@@ -2042,7 +2154,7 @@ function listQuery(params) {
2042
2154
  )
2043
2155
  });
2044
2156
  }
2045
- function sleep2(ms) {
2157
+ function sleep4(ms) {
2046
2158
  return new Promise((resolve) => setTimeout(resolve, ms));
2047
2159
  }
2048
2160
  var EgressAudit = class {
@@ -2091,7 +2203,7 @@ var EgressAudit = class {
2091
2203
  const ts = event.inserted_at ?? event.timestamp;
2092
2204
  if (typeof ts === "string") since = ts;
2093
2205
  }
2094
- await sleep2(pollMs);
2206
+ await sleep4(pollMs);
2095
2207
  }
2096
2208
  }
2097
2209
  };
@@ -2484,7 +2596,7 @@ function oauthBody(params) {
2484
2596
  redirect_uri: pickFirst3(params.redirectUri, params.redirect_uri)
2485
2597
  });
2486
2598
  }
2487
- function sleep3(ms) {
2599
+ function sleep5(ms) {
2488
2600
  return new Promise((resolve) => setTimeout(resolve, ms));
2489
2601
  }
2490
2602
  var OAuthFlow = class {
@@ -2528,7 +2640,7 @@ var OAuthFlow = class {
2528
2640
  `OAuth flow ${this.state} ended in status=${status}: ${payload.error ?? payload.message ?? "no detail"}`
2529
2641
  );
2530
2642
  }
2531
- await sleep3(pollMs);
2643
+ await sleep5(pollMs);
2532
2644
  }
2533
2645
  throw new Error(
2534
2646
  `OAuth flow ${this.state} did not complete within ${timeoutSec}s`
@@ -6085,6 +6197,25 @@ var RuntimeEnv = class {
6085
6197
  }
6086
6198
  };
6087
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
+
6088
6219
  // src/resources/sandboxes.ts
6089
6220
  function encodeContent(content) {
6090
6221
  const bytes = typeof content === "string" ? new TextEncoder().encode(content) : content;
@@ -6099,7 +6230,7 @@ var AGENT_WORKSPACE_TIMEOUT_SEC = 86400;
6099
6230
  var AGENT_WORKSPACE_IDLE_TIMEOUT_SEC = 1800;
6100
6231
  var AGENT_WORKSPACE_SNAPSHOT_EXPIRATION_DAYS = 30;
6101
6232
  var AGENT_WORKSPACE_KEEP_LAST_SNAPSHOTS = 1;
6102
- function unwrap40(payload) {
6233
+ function unwrap41(payload) {
6103
6234
  if (payload !== null && typeof payload === "object" && "data" in payload && payload.data !== void 0) {
6104
6235
  return payload.data;
6105
6236
  }
@@ -6325,7 +6456,7 @@ var SandboxTerminal = class {
6325
6456
  const body4 = Object.fromEntries(
6326
6457
  Object.entries(params).filter(([, v]) => v !== void 0)
6327
6458
  );
6328
- const response = unwrap40(
6459
+ const response = unwrap41(
6329
6460
  await this.sandbox.http.post(`/sandboxes/${this.sandbox.id}/terminal`, body4)
6330
6461
  );
6331
6462
  return response;
@@ -6374,7 +6505,7 @@ var SandboxPreviews = class {
6374
6505
  Object.entries(opts).filter(([, v]) => v !== void 0)
6375
6506
  )
6376
6507
  };
6377
- return unwrap40(
6508
+ return unwrap41(
6378
6509
  await this.http.post(
6379
6510
  `/sandboxes/${this.sandbox.id}/previews`,
6380
6511
  body4
@@ -6382,7 +6513,7 @@ var SandboxPreviews = class {
6382
6513
  );
6383
6514
  }
6384
6515
  async get(previewId) {
6385
- return unwrap40(
6516
+ return unwrap41(
6386
6517
  await this.http.get(
6387
6518
  `/sandboxes/${this.sandbox.id}/previews/${previewId}`
6388
6519
  )
@@ -6395,7 +6526,7 @@ var SandboxPreviews = class {
6395
6526
  }
6396
6527
  /** Mint a share token for previewId. */
6397
6528
  async share(previewId, opts = {}) {
6398
- return unwrap40(
6529
+ return unwrap41(
6399
6530
  await this.http.post(
6400
6531
  `/sandboxes/${this.sandbox.id}/previews/${previewId}/share`,
6401
6532
  { ttl_seconds: opts.ttl_seconds ?? opts.expires_in_sec ?? 3600 }
@@ -6464,7 +6595,7 @@ var SandboxTags = class {
6464
6595
  sandbox;
6465
6596
  /** Replace the full tag list with tags. */
6466
6597
  async set(tags) {
6467
- return unwrap40(
6598
+ return unwrap41(
6468
6599
  await this.sandbox.http.patch(`/sandboxes/${this.sandbox.id}/tags`, { tags })
6469
6600
  );
6470
6601
  }
@@ -6532,14 +6663,14 @@ var Sandbox = class _Sandbox {
6532
6663
  return this.data.template_id ?? this.data.image_id ?? "";
6533
6664
  }
6534
6665
  async refresh() {
6535
- this.data = unwrap40(
6666
+ this.data = unwrap41(
6536
6667
  await this.http.get(`/sandboxes/${this.id}`)
6537
6668
  );
6538
6669
  return this;
6539
6670
  }
6540
6671
  async runExec(command, options) {
6541
6672
  this.assertRunning("exec");
6542
- const response = unwrap40(
6673
+ const response = unwrap41(
6543
6674
  await this.http.post(
6544
6675
  `/sandboxes/${this.id}/exec`,
6545
6676
  execBody(command, options)
@@ -6584,7 +6715,7 @@ var Sandbox = class _Sandbox {
6584
6715
  }
6585
6716
  async createExport(params) {
6586
6717
  const body4 = typeof params === "string" ? { path: params } : Array.isArray(params) ? { paths: params } : params;
6587
- const response = unwrap40(
6718
+ const response = unwrap41(
6588
6719
  await this.http.post(
6589
6720
  `/sandboxes/${this.id}/exports`,
6590
6721
  body4
@@ -6609,7 +6740,7 @@ var Sandbox = class _Sandbox {
6609
6740
  }
6610
6741
  async listFiles(path = "/workspace") {
6611
6742
  this.assertRunning("files.list");
6612
- const response = unwrap40(
6743
+ const response = unwrap41(
6613
6744
  await this.http.get(
6614
6745
  `/sandboxes/${this.id}/files`,
6615
6746
  { path }
@@ -6619,7 +6750,7 @@ var Sandbox = class _Sandbox {
6619
6750
  }
6620
6751
  async statFile(path) {
6621
6752
  this.assertRunning("files.stat");
6622
- return unwrap40(
6753
+ return unwrap41(
6623
6754
  await this.http.post(
6624
6755
  `/sandboxes/${this.id}/files/stat`,
6625
6756
  { path }
@@ -6628,7 +6759,7 @@ var Sandbox = class _Sandbox {
6628
6759
  }
6629
6760
  async expose(port) {
6630
6761
  this.assertRunning("expose");
6631
- const response = unwrap40(
6762
+ const response = unwrap41(
6632
6763
  await this.http.post(
6633
6764
  `/sandboxes/${this.id}/expose`,
6634
6765
  port === void 0 ? {} : { port }
@@ -6638,7 +6769,7 @@ var Sandbox = class _Sandbox {
6638
6769
  }
6639
6770
  async startTemplate(options = {}) {
6640
6771
  this.assertRunning("startTemplate");
6641
- return unwrap40(
6772
+ return unwrap41(
6642
6773
  await this.http.post(
6643
6774
  `/sandboxes/${this.id}/template/start`,
6644
6775
  options
@@ -6646,7 +6777,7 @@ var Sandbox = class _Sandbox {
6646
6777
  );
6647
6778
  }
6648
6779
  async getArtifacts() {
6649
- return unwrap40(
6780
+ return unwrap41(
6650
6781
  await this.http.get(
6651
6782
  `/sandboxes/${this.id}/artifacts`
6652
6783
  )
@@ -6657,7 +6788,7 @@ var Sandbox = class _Sandbox {
6657
6788
  `/sandboxes/${this.id}/logs`,
6658
6789
  { lines }
6659
6790
  );
6660
- return unwrap40(response);
6791
+ return unwrap41(response);
6661
6792
  }
6662
6793
  streamLogs() {
6663
6794
  return this.http.stream(
@@ -6666,7 +6797,7 @@ var Sandbox = class _Sandbox {
6666
6797
  }
6667
6798
  async createSnapshot(comment) {
6668
6799
  this.assertRunning("snapshots.create");
6669
- return unwrap40(
6800
+ return unwrap41(
6670
6801
  await this.http.post(
6671
6802
  `/sandboxes/${this.id}/snapshots`,
6672
6803
  comment ? { comment } : {}
@@ -6674,14 +6805,14 @@ var Sandbox = class _Sandbox {
6674
6805
  );
6675
6806
  }
6676
6807
  async listSnapshots() {
6677
- return unwrap40(
6808
+ return unwrap41(
6678
6809
  await this.http.get(
6679
6810
  `/sandboxes/${this.id}/snapshots`
6680
6811
  )
6681
6812
  );
6682
6813
  }
6683
6814
  async restoreSnapshot(snapshotId) {
6684
- const data = unwrap40(
6815
+ const data = unwrap41(
6685
6816
  await this.http.post(
6686
6817
  `/sandboxes/${this.id}/restore/${snapshotId}`,
6687
6818
  {}
@@ -6701,7 +6832,7 @@ var Sandbox = class _Sandbox {
6701
6832
  const body4 = {};
6702
6833
  if (opts.name !== void 0) body4.name = opts.name;
6703
6834
  if (opts.metadata !== void 0) body4.metadata = opts.metadata;
6704
- const data = unwrap40(
6835
+ const data = unwrap41(
6705
6836
  await this.http.post(
6706
6837
  `/sandboxes/${this.id}/fork`,
6707
6838
  body4
@@ -6732,7 +6863,7 @@ var Sandbox = class _Sandbox {
6732
6863
  timeout_sec: params.timeout_sec ?? params.timeoutSec,
6733
6864
  idle_timeout_sec: params.idle_timeout_sec ?? params.idleTimeoutSec
6734
6865
  });
6735
- const data = unwrap40(
6866
+ const data = unwrap41(
6736
6867
  await this.http.patch(
6737
6868
  `/sandboxes/${this.id}`,
6738
6869
  body4
@@ -6742,7 +6873,7 @@ var Sandbox = class _Sandbox {
6742
6873
  return this;
6743
6874
  }
6744
6875
  async extend(timeoutSec) {
6745
- const data = unwrap40(
6876
+ const data = unwrap41(
6746
6877
  await this.http.post(
6747
6878
  `/sandboxes/${this.id}/extend`,
6748
6879
  { timeout_sec: timeoutSec }
@@ -6765,7 +6896,7 @@ var Sandbox = class _Sandbox {
6765
6896
  return raw;
6766
6897
  }
6767
6898
  async pause() {
6768
- const data = unwrap40(
6899
+ const data = unwrap41(
6769
6900
  await this.http.post(
6770
6901
  `/sandboxes/${this.id}/pause`,
6771
6902
  {}
@@ -6775,7 +6906,7 @@ var Sandbox = class _Sandbox {
6775
6906
  return this;
6776
6907
  }
6777
6908
  async resume() {
6778
- const data = unwrap40(
6909
+ const data = unwrap41(
6779
6910
  await this.http.post(
6780
6911
  `/sandboxes/${this.id}/resume`,
6781
6912
  {}
@@ -6811,7 +6942,7 @@ var Sandbox = class _Sandbox {
6811
6942
  if (idempotencyKey11) {
6812
6943
  requestOptions.headers = { "Idempotency-Key": idempotencyKey11 };
6813
6944
  }
6814
- return unwrap40(
6945
+ return unwrap41(
6815
6946
  await this.http.request(
6816
6947
  `/sandboxes/${this.id}/deploy`,
6817
6948
  requestOptions
@@ -6823,7 +6954,7 @@ var Sandbox = class _Sandbox {
6823
6954
  }
6824
6955
  /** Check readiness of the sandbox (GET /sandboxes/:id/readiness). */
6825
6956
  async readiness() {
6826
- return unwrap40(
6957
+ return unwrap41(
6827
6958
  await this.http.get(
6828
6959
  `/sandboxes/${this.id}/readiness`
6829
6960
  )
@@ -6991,7 +7122,7 @@ var Sandboxes = class {
6991
7122
  if (idempotencyKey11) {
6992
7123
  requestOptions.headers = { "Idempotency-Key": idempotencyKey11 };
6993
7124
  }
6994
- const data = unwrap40(
7125
+ const data = unwrap41(
6995
7126
  await this.http.request(
6996
7127
  "/sandboxes",
6997
7128
  requestOptions
@@ -7010,7 +7141,7 @@ var Sandboxes = class {
7010
7141
  return listItems11(data).map((item) => new Sandbox(this.http, item));
7011
7142
  }
7012
7143
  async get(id) {
7013
- const data = unwrap40(
7144
+ const data = unwrap41(
7014
7145
  await this.http.get(`/sandboxes/${id}`)
7015
7146
  );
7016
7147
  return new Sandbox(this.http, data);
@@ -7019,7 +7150,7 @@ var Sandboxes = class {
7019
7150
  return this.get(id);
7020
7151
  }
7021
7152
  async getByName(name) {
7022
- const data = unwrap40(
7153
+ const data = unwrap41(
7023
7154
  await this.http.get(
7024
7155
  `/sandboxes/by-name/${encodeURIComponent(name)}`
7025
7156
  )
@@ -7084,7 +7215,7 @@ var Sandboxes = class {
7084
7215
  metadata: params.metadata
7085
7216
  })
7086
7217
  );
7087
- return unwrap40(response);
7218
+ return unwrap41(response);
7088
7219
  }
7089
7220
  async createTemplateBuild(templateId, params = {}) {
7090
7221
  const response = await this.http.post(
@@ -7094,19 +7225,19 @@ var Sandboxes = class {
7094
7225
  metadata: params.metadata
7095
7226
  })
7096
7227
  );
7097
- return unwrap40(response);
7228
+ return unwrap41(response);
7098
7229
  }
7099
7230
  async listTemplateBuilds(templateId) {
7100
7231
  const response = await this.http.get(
7101
7232
  `/sandbox-templates/${templateId}/builds`
7102
7233
  );
7103
- return unwrap40(response);
7234
+ return unwrap41(response);
7104
7235
  }
7105
7236
  async getTemplateBuild(buildId) {
7106
7237
  const response = await this.http.get(
7107
7238
  `/sandbox-template-builds/${buildId}`
7108
7239
  );
7109
- return unwrap40(response);
7240
+ return unwrap41(response);
7110
7241
  }
7111
7242
  };
7112
7243
  function toBase642(bytes) {
@@ -7118,7 +7249,7 @@ function toBase642(bytes) {
7118
7249
  }
7119
7250
  return btoa(binary);
7120
7251
  }
7121
- function unwrap41(payload) {
7252
+ function unwrap42(payload) {
7122
7253
  if (payload && typeof payload === "object" && "data" in payload) {
7123
7254
  return payload.data;
7124
7255
  }
@@ -7161,7 +7292,7 @@ var SandboxTemplates = class {
7161
7292
  const data = await this.http.get(
7162
7293
  `/sandbox-templates/${templateId}`
7163
7294
  );
7164
- return unwrap41(data);
7295
+ return unwrap42(data);
7165
7296
  }
7166
7297
  async create(params) {
7167
7298
  const {
@@ -7181,7 +7312,7 @@ var SandboxTemplates = class {
7181
7312
  body: body4,
7182
7313
  headers: { "Idempotency-Key": idempotencyKey8(ikey) }
7183
7314
  });
7184
- return unwrap41(data);
7315
+ return unwrap42(data);
7185
7316
  }
7186
7317
  async buildSpecSchema() {
7187
7318
  const data = await this.http.get("/sandbox-templates/build-spec");
@@ -7214,12 +7345,12 @@ var SandboxTemplates = class {
7214
7345
  headers: { "Idempotency-Key": idempotencyKey8(ikey) }
7215
7346
  }
7216
7347
  );
7217
- return unwrap41(data);
7348
+ return unwrap42(data);
7218
7349
  }
7219
7350
  };
7220
7351
 
7221
7352
  // src/resources/settings.ts
7222
- function unwrap42(payload) {
7353
+ function unwrap43(payload) {
7223
7354
  if (payload && typeof payload === "object") {
7224
7355
  const p = payload;
7225
7356
  for (const k of [
@@ -7235,7 +7366,7 @@ function unwrap42(payload) {
7235
7366
  return payload;
7236
7367
  }
7237
7368
  function listItems13(payload) {
7238
- const result = unwrap42(payload);
7369
+ const result = unwrap43(payload);
7239
7370
  if (Array.isArray(result)) return result;
7240
7371
  return [];
7241
7372
  }
@@ -7252,46 +7383,46 @@ var Settings = class {
7252
7383
  /** Get the current tenant settings. */
7253
7384
  async get() {
7254
7385
  const data = await this.http.get("/settings");
7255
- return unwrap42(data);
7386
+ return unwrap43(data);
7256
7387
  }
7257
7388
  /** Update tenant settings. */
7258
7389
  async update(params) {
7259
7390
  const body4 = stripUndefined23(params);
7260
7391
  const data = await this.http.put("/settings", body4);
7261
- return unwrap42(data);
7392
+ return unwrap43(data);
7262
7393
  }
7263
7394
  // ── Branding ──────────────────────────────────────────────────────────────
7264
7395
  /** Get tenant branding (logo, colors, custom wordmark). */
7265
7396
  async getBranding() {
7266
7397
  const data = await this.http.get("/settings/branding");
7267
- return unwrap42(data);
7398
+ return unwrap43(data);
7268
7399
  }
7269
7400
  /** Update tenant branding. */
7270
7401
  async updateBranding(params) {
7271
7402
  const body4 = stripUndefined23(params);
7272
7403
  const data = await this.http.put("/settings/branding", body4);
7273
- return unwrap42(data);
7404
+ return unwrap43(data);
7274
7405
  }
7275
7406
  // ── Read-only reference data ───────────────────────────────────────────────
7276
7407
  /** Get tenant-scoped compute pricing. */
7277
7408
  async computePricing() {
7278
7409
  const data = await this.http.get("/settings/compute-pricing");
7279
- return unwrap42(data);
7410
+ return unwrap43(data);
7280
7411
  }
7281
7412
  /** Get tenant-scoped GPU pricing. */
7282
7413
  async gpuPricing() {
7283
7414
  const data = await this.http.get("/settings/gpu-pricing");
7284
- return unwrap42(data);
7415
+ return unwrap43(data);
7285
7416
  }
7286
7417
  /** List models available to this tenant. */
7287
7418
  async availableModels() {
7288
7419
  const data = await this.http.get("/settings/available-models");
7289
- return unwrap42(data);
7420
+ return unwrap43(data);
7290
7421
  }
7291
7422
  /** List regions enabled for this tenant. */
7292
7423
  async regions() {
7293
7424
  const data = await this.http.get("/settings/regions");
7294
- return unwrap42(data);
7425
+ return unwrap43(data);
7295
7426
  }
7296
7427
  // ── BYOK provider keys ────────────────────────────────────────────────────
7297
7428
  /** List tenant-level BYOK provider keys (Anthropic, OpenAI, etc.). */
@@ -7306,7 +7437,7 @@ var Settings = class {
7306
7437
  `/settings/provider-keys/${provider}`,
7307
7438
  body4
7308
7439
  );
7309
- return unwrap42(data);
7440
+ return unwrap43(data);
7310
7441
  }
7311
7442
  /** Delete a BYOK provider key. */
7312
7443
  async deleteProviderKey(provider) {
@@ -7315,7 +7446,7 @@ var Settings = class {
7315
7446
  };
7316
7447
 
7317
7448
  // src/resources/snapshots-standalone.ts
7318
- function unwrap43(data) {
7449
+ function unwrap44(data) {
7319
7450
  if (data && typeof data === "object") {
7320
7451
  const d = data;
7321
7452
  for (const k of ["data", "snapshots", "items"]) {
@@ -7346,14 +7477,14 @@ var SnapshotsStandalone = class {
7346
7477
  return unwrapList12(await this.http.get("/admin/snapshots", query2));
7347
7478
  }
7348
7479
  async get(snapshotId) {
7349
- return unwrap43(
7480
+ return unwrap44(
7350
7481
  await this.http.get(`/admin/snapshots/${snapshotId}`)
7351
7482
  );
7352
7483
  }
7353
7484
  };
7354
7485
 
7355
7486
  // src/resources/storage.ts
7356
- function unwrap44(payload) {
7487
+ function unwrap45(payload) {
7357
7488
  if (payload && typeof payload === "object" && "data" in payload) {
7358
7489
  return payload.data;
7359
7490
  }
@@ -7392,11 +7523,11 @@ var Storage = class {
7392
7523
  ...rest
7393
7524
  });
7394
7525
  const data = await this.http.post("/storage/buckets", body4);
7395
- return unwrap44(data);
7526
+ return unwrap45(data);
7396
7527
  }
7397
7528
  async getBucket(bucketId) {
7398
7529
  const data = await this.http.get(`/storage/buckets/${bucketId}`);
7399
- return unwrap44(data);
7530
+ return unwrap45(data);
7400
7531
  }
7401
7532
  async deleteBucket(bucketId) {
7402
7533
  await this.http.delete(`/storage/buckets/${bucketId}`);
@@ -7446,7 +7577,7 @@ var Storage = class {
7446
7577
  `/storage/buckets/${bucketId}/presign`,
7447
7578
  body4
7448
7579
  );
7449
- return unwrap44(data);
7580
+ return unwrap45(data);
7450
7581
  }
7451
7582
  };
7452
7583
 
@@ -7536,7 +7667,7 @@ var OrgInvites = class {
7536
7667
  };
7537
7668
 
7538
7669
  // src/resources/tenant.ts
7539
- function unwrap45(payload) {
7670
+ function unwrap46(payload) {
7540
7671
  if (payload && typeof payload === "object") {
7541
7672
  const p = payload;
7542
7673
  for (const k of ["data", "tenant", "branding", "items"]) {
@@ -7558,14 +7689,14 @@ var PreviewDomain = class {
7558
7689
  /** Get the tenant's white-label preview domain settings. */
7559
7690
  async get() {
7560
7691
  const data = await this.http.get("/tenant/preview-domain");
7561
- return unwrap45(data);
7692
+ return unwrap46(data);
7562
7693
  }
7563
7694
  /** Set the tenant's white-label preview domain. */
7564
7695
  async set(domain) {
7565
7696
  const data = await this.http.put("/tenant/preview-domain", {
7566
7697
  preview_domain: domain
7567
7698
  });
7568
- return unwrap45(data);
7699
+ return unwrap46(data);
7569
7700
  }
7570
7701
  /** Re-run DNS verification for the configured preview domain. */
7571
7702
  async verify() {
@@ -7573,7 +7704,7 @@ var PreviewDomain = class {
7573
7704
  "/tenant/preview-domain/verify",
7574
7705
  {}
7575
7706
  );
7576
- return unwrap45(data);
7707
+ return unwrap46(data);
7577
7708
  }
7578
7709
  /** Remove the tenant's custom preview domain. */
7579
7710
  async delete() {
@@ -7588,14 +7719,14 @@ var Branding = class {
7588
7719
  /** Get tenant branding used by white-label hosted surfaces. */
7589
7720
  async get() {
7590
7721
  const data = await this.http.get("/tenant/branding");
7591
- return unwrap45(data);
7722
+ return unwrap46(data);
7592
7723
  }
7593
7724
  /** Update tenant branding used by white-label hosted surfaces. */
7594
7725
  async set(params) {
7595
7726
  const data = await this.http.put("/tenant/branding", {
7596
7727
  branding: stripUndefined25(params)
7597
7728
  });
7598
- return unwrap45(data);
7729
+ return unwrap46(data);
7599
7730
  }
7600
7731
  /** Reset tenant branding to platform defaults. */
7601
7732
  async delete() {
@@ -7617,7 +7748,7 @@ var Tenant = class {
7617
7748
  /** Get the current tenant's plan, limits, and live usage counters. */
7618
7749
  async current() {
7619
7750
  const data = await this.http.get("/tenant/plan");
7620
- return unwrap45(data);
7751
+ return unwrap46(data);
7621
7752
  }
7622
7753
  /** Convenience alias for `tenant.branding.get()`. */
7623
7754
  async getBranding() {
@@ -7634,7 +7765,7 @@ var Tenant = class {
7634
7765
  };
7635
7766
 
7636
7767
  // src/resources/usage.ts
7637
- function unwrap46(payload) {
7768
+ function unwrap47(payload) {
7638
7769
  if (payload && typeof payload === "object") {
7639
7770
  const p = payload;
7640
7771
  for (const k of ["data", "usage", "sessions", "summary", "items"]) {
@@ -7656,13 +7787,13 @@ var Usage = class {
7656
7787
  /** Get the current period usage summary. */
7657
7788
  async current() {
7658
7789
  const data = await this.http.get("/usage/summary");
7659
- return unwrap46(data);
7790
+ return unwrap47(data);
7660
7791
  }
7661
7792
  /** List per-session metering events. */
7662
7793
  async sessions(params = {}) {
7663
7794
  const query2 = stripUndefined26(params);
7664
7795
  const data = await this.http.get("/usage/sessions", query2);
7665
- const result = unwrap46(data);
7796
+ const result = unwrap47(data);
7666
7797
  if (Array.isArray(result)) return result;
7667
7798
  return [];
7668
7799
  }
@@ -7670,10 +7801,10 @@ var Usage = class {
7670
7801
  async report(params = {}) {
7671
7802
  const query2 = stripUndefined26(params);
7672
7803
  const data = await this.http.get("/usage/summary", query2);
7673
- return unwrap46(data);
7804
+ return unwrap47(data);
7674
7805
  }
7675
7806
  };
7676
- function unwrap47(payload) {
7807
+ function unwrap48(payload) {
7677
7808
  if (payload && typeof payload === "object" && "data" in payload) {
7678
7809
  return payload.data;
7679
7810
  }
@@ -7709,7 +7840,7 @@ var Volumes = class {
7709
7840
  }
7710
7841
  async get(volumeId) {
7711
7842
  const data = await this.http.get(`/volumes/${volumeId}`);
7712
- return unwrap47(data);
7843
+ return unwrap48(data);
7713
7844
  }
7714
7845
  async create(params) {
7715
7846
  const { idempotencyKey: ikey, sizeGb, ...rest } = params;
@@ -7722,13 +7853,13 @@ var Volumes = class {
7722
7853
  body: body4,
7723
7854
  headers: { "Idempotency-Key": idempotencyKey9(ikey) }
7724
7855
  });
7725
- return unwrap47(data);
7856
+ return unwrap48(data);
7726
7857
  }
7727
7858
  async delete(volumeId) {
7728
7859
  await this.http.delete(`/volumes/${volumeId}`);
7729
7860
  }
7730
7861
  };
7731
- function unwrap48(payload) {
7862
+ function unwrap49(payload) {
7732
7863
  if (payload && typeof payload === "object" && "data" in payload) {
7733
7864
  return payload.data;
7734
7865
  }
@@ -7795,7 +7926,7 @@ var Webhooks = class {
7795
7926
  }
7796
7927
  async get(webhookId) {
7797
7928
  const data = await this.http.get(`/webhooks/${webhookId}`);
7798
- return unwrap48(data);
7929
+ return unwrap49(data);
7799
7930
  }
7800
7931
  async create(params) {
7801
7932
  const { idempotencyKey: ikey, ...rest } = params;
@@ -7805,12 +7936,12 @@ var Webhooks = class {
7805
7936
  body: body4,
7806
7937
  headers: { "Idempotency-Key": idempotencyKey10(ikey) }
7807
7938
  });
7808
- return unwrap48(data);
7939
+ return unwrap49(data);
7809
7940
  }
7810
7941
  async update(webhookId, params) {
7811
7942
  const body4 = stripUndefined28(params);
7812
7943
  const data = await this.http.patch(`/webhooks/${webhookId}`, body4);
7813
- return unwrap48(data);
7944
+ return unwrap49(data);
7814
7945
  }
7815
7946
  async delete(webhookId) {
7816
7947
  await this.http.delete(`/webhooks/${webhookId}`);
@@ -7823,7 +7954,7 @@ var Webhooks = class {
7823
7954
  headers: { "Idempotency-Key": idempotencyKey10(opts.idempotencyKey) }
7824
7955
  }
7825
7956
  );
7826
- return unwrap48(data);
7957
+ return unwrap49(data);
7827
7958
  }
7828
7959
  async deliveries(webhookId) {
7829
7960
  const data = await this.http.get(
@@ -8038,6 +8169,8 @@ var Miosa = class {
8038
8169
  agentRuntimeProfiles;
8039
8170
  /** Inherited runtime env — tenant/workspace/project defaults for agent runtimes. */
8040
8171
  runtimeEnv;
8172
+ /** Runtime capabilities — live backend feature and contract discovery. */
8173
+ runtimeCapabilities;
8041
8174
  /** Computer management — create, list, get, delete. */
8042
8175
  computers;
8043
8176
  /** Sandboxes — native code-execution environments under `/sandboxes`. */
@@ -8144,6 +8277,7 @@ var Miosa = class {
8144
8277
  this.agentRunGroups = new AgentRunGroups(this.http);
8145
8278
  this.agentRuntimeProfiles = new AgentRuntimeProfiles(this.http);
8146
8279
  this.runtimeEnv = new RuntimeEnv(this.http);
8280
+ this.runtimeCapabilities = new RuntimeCapabilitiesResource(this.http);
8147
8281
  this.computers = new Computers(this.http);
8148
8282
  this.sandboxes = new Sandboxes(this.http);
8149
8283
  this.deployments = new Deployments(this.http);
@@ -8333,6 +8467,6 @@ var AppAuth = class {
8333
8467
  }
8334
8468
  };
8335
8469
 
8336
- 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 };
8337
8471
  //# sourceMappingURL=index.js.map
8338
8472
  //# sourceMappingURL=index.js.map