@temps-sdk/cli 0.1.31 → 0.1.32

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/dist/index.js +929 -214
  2. package/package.json +2 -1
package/dist/index.js CHANGED
@@ -5347,6 +5347,11 @@ function keyValue(key, value) {
5347
5347
  const displayValue = value === null || value === undefined ? colors.muted("not set") : String(value);
5348
5348
  console.log(` ${colors.muted(key + ":")} ${displayValue}`);
5349
5349
  }
5350
+ function list(items, prefix = icons.bullet) {
5351
+ if (isQuietMode())
5352
+ return;
5353
+ items.forEach((item) => console.log(` ${prefix} ${item}`));
5354
+ }
5350
5355
  function box(content, title) {
5351
5356
  if (isQuietMode())
5352
5357
  return;
@@ -12629,8 +12634,8 @@ var require_dist = __commonJS((exports, module) => {
12629
12634
  return ajv;
12630
12635
  }
12631
12636
  const [formats, exportName] = opts.mode === "fast" ? [formats_1.fastFormats, fastName] : [formats_1.fullFormats, fullName];
12632
- const list = opts.formats || formats_1.formatNames;
12633
- addFormats(ajv, list, formats, exportName);
12637
+ const list2 = opts.formats || formats_1.formatNames;
12638
+ addFormats(ajv, list2, formats, exportName);
12634
12639
  if (opts.keywords)
12635
12640
  (0, limit_1.default)(ajv);
12636
12641
  return ajv;
@@ -12642,11 +12647,11 @@ var require_dist = __commonJS((exports, module) => {
12642
12647
  throw new Error(`Unknown format "${name}"`);
12643
12648
  return f;
12644
12649
  };
12645
- function addFormats(ajv, list, fs2, exportName) {
12650
+ function addFormats(ajv, list2, fs2, exportName) {
12646
12651
  var _a;
12647
12652
  var _b;
12648
12653
  (_a = (_b = ajv.opts.code).formats) !== null && _a !== undefined || (_b.formats = (0, codegen_1._)`require("ajv-formats/dist/formats").${exportName}`);
12649
- for (const f of list)
12654
+ for (const f of list2)
12650
12655
  ajv.addFormat(f, fs2[f]);
12651
12656
  }
12652
12657
  module.exports = exports = formatsPlugin;
@@ -13244,14 +13249,14 @@ var require_compare_build = __commonJS((exports, module) => {
13244
13249
  // node_modules/semver/functions/sort.js
13245
13250
  var require_sort = __commonJS((exports, module) => {
13246
13251
  var compareBuild = require_compare_build();
13247
- var sort = (list, loose) => list.sort((a, b) => compareBuild(a, b, loose));
13252
+ var sort = (list2, loose) => list2.sort((a, b) => compareBuild(a, b, loose));
13248
13253
  module.exports = sort;
13249
13254
  });
13250
13255
 
13251
13256
  // node_modules/semver/functions/rsort.js
13252
13257
  var require_rsort = __commonJS((exports, module) => {
13253
13258
  var compareBuild = require_compare_build();
13254
- var rsort = (list, loose) => list.sort((a, b) => compareBuild(b, a, loose));
13259
+ var rsort = (list2, loose) => list2.sort((a, b) => compareBuild(b, a, loose));
13255
13260
  module.exports = rsort;
13256
13261
  });
13257
13262
 
@@ -15727,15 +15732,15 @@ class Emitter2 {
15727
15732
  this.listeners[ev].push(fn);
15728
15733
  }
15729
15734
  removeListener(ev, fn) {
15730
- const list = this.listeners[ev];
15731
- const i = list.indexOf(fn);
15735
+ const list2 = this.listeners[ev];
15736
+ const i = list2.indexOf(fn);
15732
15737
  if (i === -1) {
15733
15738
  return;
15734
15739
  }
15735
- if (i === 0 && list.length === 1) {
15736
- list.length = 0;
15740
+ if (i === 0 && list2.length === 1) {
15741
+ list2.length = 0;
15737
15742
  } else {
15738
- list.splice(i, 1);
15743
+ list2.splice(i, 1);
15739
15744
  }
15740
15745
  }
15741
15746
  emit(ev, code, signal) {
@@ -26457,15 +26462,15 @@ class Emitter3 {
26457
26462
  this.listeners[ev].push(fn);
26458
26463
  }
26459
26464
  removeListener(ev, fn) {
26460
- const list = this.listeners[ev];
26461
- const i = list.indexOf(fn);
26465
+ const list2 = this.listeners[ev];
26466
+ const i = list2.indexOf(fn);
26462
26467
  if (i === -1) {
26463
26468
  return;
26464
26469
  }
26465
- if (i === 0 && list.length === 1) {
26466
- list.length = 0;
26470
+ if (i === 0 && list2.length === 1) {
26471
+ list2.length = 0;
26467
26472
  } else {
26468
- list.splice(i, 1);
26473
+ list2.splice(i, 1);
26469
26474
  }
26470
26475
  }
26471
26476
  emit(ev, code, signal) {
@@ -27544,15 +27549,15 @@ class Emitter4 {
27544
27549
  this.listeners[ev].push(fn);
27545
27550
  }
27546
27551
  removeListener(ev, fn) {
27547
- const list = this.listeners[ev];
27548
- const i = list.indexOf(fn);
27552
+ const list2 = this.listeners[ev];
27553
+ const i = list2.indexOf(fn);
27549
27554
  if (i === -1) {
27550
27555
  return;
27551
27556
  }
27552
- if (i === 0 && list.length === 1) {
27553
- list.length = 0;
27557
+ if (i === 0 && list2.length === 1) {
27558
+ list2.length = 0;
27554
27559
  } else {
27555
- list.splice(i, 1);
27560
+ list2.splice(i, 1);
27556
27561
  }
27557
27562
  }
27558
27563
  emit(ev, code, signal) {
@@ -28606,15 +28611,15 @@ class Emitter5 {
28606
28611
  this.listeners[ev].push(fn);
28607
28612
  }
28608
28613
  removeListener(ev, fn) {
28609
- const list = this.listeners[ev];
28610
- const i = list.indexOf(fn);
28614
+ const list2 = this.listeners[ev];
28615
+ const i = list2.indexOf(fn);
28611
28616
  if (i === -1) {
28612
28617
  return;
28613
28618
  }
28614
- if (i === 0 && list.length === 1) {
28615
- list.length = 0;
28619
+ if (i === 0 && list2.length === 1) {
28620
+ list2.length = 0;
28616
28621
  } else {
28617
- list.splice(i, 1);
28622
+ list2.splice(i, 1);
28618
28623
  }
28619
28624
  }
28620
28625
  emit(ev, code, signal) {
@@ -29708,15 +29713,15 @@ class Emitter6 {
29708
29713
  this.listeners[ev].push(fn);
29709
29714
  }
29710
29715
  removeListener(ev, fn) {
29711
- const list = this.listeners[ev];
29712
- const i = list.indexOf(fn);
29716
+ const list2 = this.listeners[ev];
29717
+ const i = list2.indexOf(fn);
29713
29718
  if (i === -1) {
29714
29719
  return;
29715
29720
  }
29716
- if (i === 0 && list.length === 1) {
29717
- list.length = 0;
29721
+ if (i === 0 && list2.length === 1) {
29722
+ list2.length = 0;
29718
29723
  } else {
29719
- list.splice(i, 1);
29724
+ list2.splice(i, 1);
29720
29725
  }
29721
29726
  }
29722
29727
  emit(ev, code, signal) {
@@ -30878,15 +30883,15 @@ class Emitter7 {
30878
30883
  this.listeners[ev].push(fn);
30879
30884
  }
30880
30885
  removeListener(ev, fn) {
30881
- const list = this.listeners[ev];
30882
- const i = list.indexOf(fn);
30886
+ const list2 = this.listeners[ev];
30887
+ const i = list2.indexOf(fn);
30883
30888
  if (i === -1) {
30884
30889
  return;
30885
30890
  }
30886
- if (i === 0 && list.length === 1) {
30887
- list.length = 0;
30891
+ if (i === 0 && list2.length === 1) {
30892
+ list2.length = 0;
30888
30893
  } else {
30889
- list.splice(i, 1);
30894
+ list2.splice(i, 1);
30890
30895
  }
30891
30896
  }
30892
30897
  emit(ev, code, signal) {
@@ -32173,15 +32178,15 @@ class Emitter8 {
32173
32178
  this.listeners[ev].push(fn);
32174
32179
  }
32175
32180
  removeListener(ev, fn) {
32176
- const list = this.listeners[ev];
32177
- const i = list.indexOf(fn);
32181
+ const list2 = this.listeners[ev];
32182
+ const i = list2.indexOf(fn);
32178
32183
  if (i === -1) {
32179
32184
  return;
32180
32185
  }
32181
- if (i === 0 && list.length === 1) {
32182
- list.length = 0;
32186
+ if (i === 0 && list2.length === 1) {
32187
+ list2.length = 0;
32183
32188
  } else {
32184
- list.splice(i, 1);
32189
+ list2.splice(i, 1);
32185
32190
  }
32186
32191
  }
32187
32192
  emit(ev, code, signal) {
@@ -33795,6 +33800,7 @@ __export(exports_sdk_gen, {
33795
33800
  updateApiKey: () => updateApiKey,
33796
33801
  updateAlertRule: () => updateAlertRule,
33797
33802
  updateAlert: () => updateAlert,
33803
+ updateAiProviderPreference: () => updateAiProviderPreference,
33798
33804
  updateAiProvider: () => updateAiProvider,
33799
33805
  updateAgent: () => updateAgent,
33800
33806
  unlinkServiceFromProject: () => unlinkServiceFromProject,
@@ -33822,6 +33828,7 @@ __export(exports_sdk_gen, {
33822
33828
  streamRunEvents: () => streamRunEvents,
33823
33829
  streamEvents: () => streamEvents,
33824
33830
  streamContainerMetrics: () => streamContainerMetrics,
33831
+ storageSummary: () => storageSummary,
33825
33832
  stopService: () => stopService,
33826
33833
  stopSandbox: () => stopSandbox,
33827
33834
  stopContainer: () => stopContainer,
@@ -33898,6 +33905,7 @@ __export(exports_sdk_gen, {
33898
33905
  restartSandbox: () => restartSandbox,
33899
33906
  restartPreviewGateway: () => restartPreviewGateway,
33900
33907
  restartContainer: () => restartContainer,
33908
+ resolvePermission: () => resolvePermission,
33901
33909
  resolveAlarm: () => resolveAlarm,
33902
33910
  resizeSandbox: () => resizeSandbox,
33903
33911
  resetPassword: () => resetPassword,
@@ -33915,6 +33923,7 @@ __export(exports_sdk_gen, {
33915
33923
  registerExternalImage: () => registerExternalImage,
33916
33924
  regenerateDsn: () => regenerateDsn,
33917
33925
  refreshRouteTable: () => refreshRouteTable,
33926
+ refreshAiProviderStatus: () => refreshAiProviderStatus,
33918
33927
  recordSpeedMetrics: () => recordSpeedMetrics,
33919
33928
  recordFlagExposure: () => recordFlagExposure,
33920
33929
  recordEventMetrics: () => recordEventMetrics,
@@ -33965,6 +33974,7 @@ __export(exports_sdk_gen, {
33965
33974
  listSourceMaps: () => listSourceMaps,
33966
33975
  listSourceFiles: () => listSourceFiles,
33967
33976
  listSourceBackups: () => listSourceBackups,
33977
+ listSnapshots: () => listSnapshots,
33968
33978
  listSkills: () => listSkills,
33969
33979
  listServices: () => listServices,
33970
33980
  listServiceSchedules: () => listServiceSchedules,
@@ -34091,6 +34101,7 @@ __export(exports_sdk_gen, {
34091
34101
  ingestLogsByPath: () => ingestLogsByPath,
34092
34102
  ingestLogs: () => ingestLogs,
34093
34103
  importExternalService: () => importExternalService,
34104
+ hasTraces: () => hasTraces,
34094
34105
  hasPerformanceMetrics: () => hasPerformanceMetrics,
34095
34106
  hasErrorGroups: () => hasErrorGroups,
34096
34107
  hasAnalyticsEvents: () => hasAnalyticsEvents,
@@ -34124,6 +34135,7 @@ __export(exports_sdk_gen, {
34124
34135
  getTagsByRepositoryId: () => getTagsByRepositoryId,
34125
34136
  getStatusOverview: () => getStatusOverview,
34126
34137
  getStaticBundle: () => getStaticBundle,
34138
+ getSnapshot: () => getSnapshot,
34127
34139
  getSlowQueries: () => getSlowQueries,
34128
34140
  getSkill: () => getSkill,
34129
34141
  getSettings: () => getSettings,
@@ -34327,6 +34339,7 @@ __export(exports_sdk_gen, {
34327
34339
  getAlertRule: () => getAlertRule,
34328
34340
  getAlert: () => getAlert,
34329
34341
  getAiStatusBreakdown: () => getAiStatusBreakdown,
34342
+ getAiProviderStatus: () => getAiProviderStatus,
34330
34343
  getAiPageBreakdown: () => getAiPageBreakdown,
34331
34344
  getAiDataAccess: () => getAiDataAccess,
34332
34345
  getAiAgentTimeline: () => getAiAgentTimeline,
@@ -34386,6 +34399,7 @@ __export(exports_sdk_gen, {
34386
34399
  deleteTeam: () => deleteTeam,
34387
34400
  deleteStaticBundle: () => deleteStaticBundle,
34388
34401
  deleteSourceMap: () => deleteSourceMap,
34402
+ deleteSnapshot: () => deleteSnapshot,
34389
34403
  deleteSkill: () => deleteSkill,
34390
34404
  deleteSessionReplay: () => deleteSessionReplay,
34391
34405
  deleteService: () => deleteService,
@@ -34435,6 +34449,7 @@ __export(exports_sdk_gen, {
34435
34449
  createWebhook: () => createWebhook,
34436
34450
  createUser: () => createUser,
34437
34451
  createTeam: () => createTeam,
34452
+ createSnapshot: () => createSnapshot,
34438
34453
  createSlackProvider: () => createSlackProvider,
34439
34454
  createSkill: () => createSkill,
34440
34455
  createService: () => createService,
@@ -34689,6 +34704,22 @@ var getPlatformInfo = (options) => (options?.client ?? client).get({
34689
34704
  security: [{ scheme: "bearer", type: "http" }],
34690
34705
  url: "/ai/pricing",
34691
34706
  ...options
34707
+ }), updateAiProviderPreference = (options) => (options.client ?? client).put({
34708
+ security: [{ scheme: "bearer", type: "http" }],
34709
+ url: "/ai/provider-preference",
34710
+ ...options,
34711
+ headers: {
34712
+ "Content-Type": "application/json",
34713
+ ...options.headers
34714
+ }
34715
+ }), getAiProviderStatus = (options) => (options?.client ?? client).get({
34716
+ security: [{ scheme: "bearer", type: "http" }],
34717
+ url: "/ai/provider-status",
34718
+ ...options
34719
+ }), refreshAiProviderStatus = (options) => (options?.client ?? client).post({
34720
+ security: [{ scheme: "bearer", type: "http" }],
34721
+ url: "/ai/provider-status/refresh",
34722
+ ...options
34692
34723
  }), listProviderKeys = (options) => (options?.client ?? client).get({
34693
34724
  security: [{ scheme: "bearer", type: "http" }],
34694
34725
  url: "/ai/providers",
@@ -36454,6 +36485,10 @@ var getPlatformInfo = (options) => (options?.client ?? client).get({
36454
36485
  security: [{ scheme: "bearer", type: "http" }],
36455
36486
  url: "/otel/global/traces/{trace_id}",
36456
36487
  ...options
36488
+ }), hasTraces = (options) => (options.client ?? client).get({
36489
+ security: [{ scheme: "bearer", type: "http" }],
36490
+ url: "/otel/has-traces/{project_id}",
36491
+ ...options
36457
36492
  }), getHealth = (options) => (options.client ?? client).get({
36458
36493
  security: [{ scheme: "bearer", type: "http" }],
36459
36494
  url: "/otel/health/{project_id}",
@@ -36827,6 +36862,14 @@ var getPlatformInfo = (options) => (options?.client ?? client).get({
36827
36862
  security: [{ scheme: "bearer", type: "http" }],
36828
36863
  url: "/projects/{project_id}/ai/conversations/{public_id}/pending-actions",
36829
36864
  ...options
36865
+ }), resolvePermission = (options) => (options.client ?? client).post({
36866
+ security: [{ scheme: "bearer", type: "http" }],
36867
+ url: "/projects/{project_id}/ai/conversations/{public_id}/permissions/{permission_id}/resolve",
36868
+ ...options,
36869
+ headers: {
36870
+ "Content-Type": "application/json",
36871
+ ...options.headers
36872
+ }
36830
36873
  }), getPendingAction = (options) => (options.client ?? client).get({
36831
36874
  security: [{ scheme: "bearer", type: "http" }],
36832
36875
  url: "/projects/{project_id}/ai/pending-actions/{action_public_id}",
@@ -38123,6 +38166,22 @@ var getPlatformInfo = (options) => (options?.client ?? client).get({
38123
38166
  security: [{ scheme: "bearer", type: "http" }],
38124
38167
  url: "/users/{user_id}/roles/{role_type}",
38125
38168
  ...options
38169
+ }), listSnapshots = (options) => (options?.client ?? client).get({
38170
+ security: [{ scheme: "bearer", type: "http" }],
38171
+ url: "/v1/sandbox-snapshots",
38172
+ ...options
38173
+ }), storageSummary = (options) => (options?.client ?? client).get({
38174
+ security: [{ scheme: "bearer", type: "http" }],
38175
+ url: "/v1/sandbox-snapshots/storage-summary",
38176
+ ...options
38177
+ }), deleteSnapshot = (options) => (options.client ?? client).delete({
38178
+ security: [{ scheme: "bearer", type: "http" }],
38179
+ url: "/v1/sandbox-snapshots/{snap_id}",
38180
+ ...options
38181
+ }), getSnapshot = (options) => (options.client ?? client).get({
38182
+ security: [{ scheme: "bearer", type: "http" }],
38183
+ url: "/v1/sandbox-snapshots/{snap_id}",
38184
+ ...options
38126
38185
  }), listSandboxes = (options) => (options?.client ?? client).get({
38127
38186
  security: [{ scheme: "bearer", type: "http" }],
38128
38187
  url: "/v1/sandboxes",
@@ -38291,6 +38350,14 @@ var getPlatformInfo = (options) => (options?.client ?? client).get({
38291
38350
  security: [{ scheme: "bearer", type: "http" }],
38292
38351
  url: "/v1/sandboxes/{id}/resume",
38293
38352
  ...options
38353
+ }), createSnapshot = (options) => (options.client ?? client).post({
38354
+ security: [{ scheme: "bearer", type: "http" }],
38355
+ url: "/v1/sandboxes/{id}/snapshots",
38356
+ ...options,
38357
+ headers: {
38358
+ "Content-Type": "application/json",
38359
+ ...options.headers
38360
+ }
38294
38361
  }), sourceSandbox = (options) => (options.client ?? client).post({
38295
38362
  security: [{ scheme: "bearer", type: "http" }],
38296
38363
  url: "/v1/sandboxes/{id}/source",
@@ -40887,8 +40954,8 @@ See https://react.dev/link/invalid-hook-call for tips about how to debug and fix
40887
40954
  exports.useState = function(initialState) {
40888
40955
  return resolveDispatcher().useState(initialState);
40889
40956
  };
40890
- exports.useSyncExternalStore = function(subscribe, getSnapshot, getServerSnapshot) {
40891
- return resolveDispatcher().useSyncExternalStore(subscribe, getSnapshot, getServerSnapshot);
40957
+ exports.useSyncExternalStore = function(subscribe, getSnapshot2, getServerSnapshot) {
40958
+ return resolveDispatcher().useSyncExternalStore(subscribe, getSnapshot2, getServerSnapshot);
40892
40959
  };
40893
40960
  exports.useTransition = function() {
40894
40961
  return resolveDispatcher().useTransition();
@@ -43100,32 +43167,32 @@ It can also happen if the client has a browser extension installed which messes
43100
43167
  var fiber = workInProgress2.child;
43101
43168
  fiber !== null && (fiber.return = workInProgress2);
43102
43169
  for (;fiber !== null; ) {
43103
- var list2 = fiber.dependencies;
43104
- if (list2 !== null) {
43170
+ var list3 = fiber.dependencies;
43171
+ if (list3 !== null) {
43105
43172
  var nextFiber = fiber.child;
43106
- list2 = list2.firstContext;
43173
+ list3 = list3.firstContext;
43107
43174
  a:
43108
- for (;list2 !== null; ) {
43109
- var dependency = list2;
43110
- list2 = fiber;
43175
+ for (;list3 !== null; ) {
43176
+ var dependency = list3;
43177
+ list3 = fiber;
43111
43178
  for (var i = 0;i < contexts.length; i++)
43112
43179
  if (dependency.context === contexts[i]) {
43113
- list2.lanes |= renderLanes2;
43114
- dependency = list2.alternate;
43180
+ list3.lanes |= renderLanes2;
43181
+ dependency = list3.alternate;
43115
43182
  dependency !== null && (dependency.lanes |= renderLanes2);
43116
- scheduleContextWorkOnParentPath(list2.return, renderLanes2, workInProgress2);
43183
+ scheduleContextWorkOnParentPath(list3.return, renderLanes2, workInProgress2);
43117
43184
  forcePropagateEntireTree || (nextFiber = null);
43118
43185
  break a;
43119
43186
  }
43120
- list2 = dependency.next;
43187
+ list3 = dependency.next;
43121
43188
  }
43122
43189
  } else if (fiber.tag === 18) {
43123
43190
  nextFiber = fiber.return;
43124
43191
  if (nextFiber === null)
43125
43192
  throw Error("We just came from a parent so we must have had a parent. This is a bug in React.");
43126
43193
  nextFiber.lanes |= renderLanes2;
43127
- list2 = nextFiber.alternate;
43128
- list2 !== null && (list2.lanes |= renderLanes2);
43194
+ list3 = nextFiber.alternate;
43195
+ list3 !== null && (list3.lanes |= renderLanes2);
43129
43196
  scheduleContextWorkOnParentPath(nextFiber, renderLanes2, workInProgress2);
43130
43197
  nextFiber = null;
43131
43198
  } else
@@ -44832,7 +44899,7 @@ Incoming: %s`, currentHookNameInDev, "[" + prevDeps.join(", ") + "]", "[" + next
44832
44899
  }
44833
44900
  return [newState, dispatch];
44834
44901
  }
44835
- function mountSyncExternalStore(subscribe, getSnapshot, getServerSnapshot) {
44902
+ function mountSyncExternalStore(subscribe, getSnapshot2, getServerSnapshot) {
44836
44903
  var fiber = currentlyRenderingFiber, hook = mountWorkInProgressHook();
44837
44904
  if (isHydrating) {
44838
44905
  if (getServerSnapshot === undefined)
@@ -44840,28 +44907,28 @@ Incoming: %s`, currentHookNameInDev, "[" + prevDeps.join(", ") + "]", "[" + next
44840
44907
  var nextSnapshot = getServerSnapshot();
44841
44908
  didWarnUncachedGetSnapshot || nextSnapshot === getServerSnapshot() || (console.error("The result of getServerSnapshot should be cached to avoid an infinite loop"), didWarnUncachedGetSnapshot = true);
44842
44909
  } else {
44843
- nextSnapshot = getSnapshot();
44844
- didWarnUncachedGetSnapshot || (getServerSnapshot = getSnapshot(), objectIs(nextSnapshot, getServerSnapshot) || (console.error("The result of getSnapshot should be cached to avoid an infinite loop"), didWarnUncachedGetSnapshot = true));
44910
+ nextSnapshot = getSnapshot2();
44911
+ didWarnUncachedGetSnapshot || (getServerSnapshot = getSnapshot2(), objectIs(nextSnapshot, getServerSnapshot) || (console.error("The result of getSnapshot should be cached to avoid an infinite loop"), didWarnUncachedGetSnapshot = true));
44845
44912
  if (workInProgressRoot === null)
44846
44913
  throw Error("Expected a work-in-progress root. This is a bug in React. Please file an issue.");
44847
- (workInProgressRootRenderLanes & 127) !== 0 || pushStoreConsistencyCheck(fiber, getSnapshot, nextSnapshot);
44914
+ (workInProgressRootRenderLanes & 127) !== 0 || pushStoreConsistencyCheck(fiber, getSnapshot2, nextSnapshot);
44848
44915
  }
44849
44916
  hook.memoizedState = nextSnapshot;
44850
- getServerSnapshot = { value: nextSnapshot, getSnapshot };
44917
+ getServerSnapshot = { value: nextSnapshot, getSnapshot: getSnapshot2 };
44851
44918
  hook.queue = getServerSnapshot;
44852
44919
  mountEffect(subscribeToStore.bind(null, fiber, getServerSnapshot, subscribe), [subscribe]);
44853
44920
  fiber.flags |= 2048;
44854
- pushSimpleEffect(HasEffect | Passive, { destroy: undefined }, updateStoreInstance.bind(null, fiber, getServerSnapshot, nextSnapshot, getSnapshot), null);
44921
+ pushSimpleEffect(HasEffect | Passive, { destroy: undefined }, updateStoreInstance.bind(null, fiber, getServerSnapshot, nextSnapshot, getSnapshot2), null);
44855
44922
  return nextSnapshot;
44856
44923
  }
44857
- function updateSyncExternalStore(subscribe, getSnapshot, getServerSnapshot) {
44924
+ function updateSyncExternalStore(subscribe, getSnapshot2, getServerSnapshot) {
44858
44925
  var fiber = currentlyRenderingFiber, hook = updateWorkInProgressHook(), isHydrating$jscomp$0 = isHydrating;
44859
44926
  if (isHydrating$jscomp$0) {
44860
44927
  if (getServerSnapshot === undefined)
44861
44928
  throw Error("Missing getServerSnapshot, which is required for server-rendered content. Will revert to client rendering.");
44862
44929
  getServerSnapshot = getServerSnapshot();
44863
- } else if (getServerSnapshot = getSnapshot(), !didWarnUncachedGetSnapshot) {
44864
- var cachedSnapshot = getSnapshot();
44930
+ } else if (getServerSnapshot = getSnapshot2(), !didWarnUncachedGetSnapshot) {
44931
+ var cachedSnapshot = getSnapshot2();
44865
44932
  objectIs(getServerSnapshot, cachedSnapshot) || (console.error("The result of getSnapshot should be cached to avoid an infinite loop"), didWarnUncachedGetSnapshot = true);
44866
44933
  }
44867
44934
  if (cachedSnapshot = !objectIs((currentHook || hook).memoizedState, getServerSnapshot))
@@ -44869,24 +44936,24 @@ Incoming: %s`, currentHookNameInDev, "[" + prevDeps.join(", ") + "]", "[" + next
44869
44936
  hook = hook.queue;
44870
44937
  var create3 = subscribeToStore.bind(null, fiber, hook, subscribe);
44871
44938
  updateEffectImpl(2048, Passive, create3, [subscribe]);
44872
- if (hook.getSnapshot !== getSnapshot || cachedSnapshot || workInProgressHook !== null && workInProgressHook.memoizedState.tag & HasEffect) {
44939
+ if (hook.getSnapshot !== getSnapshot2 || cachedSnapshot || workInProgressHook !== null && workInProgressHook.memoizedState.tag & HasEffect) {
44873
44940
  fiber.flags |= 2048;
44874
- pushSimpleEffect(HasEffect | Passive, { destroy: undefined }, updateStoreInstance.bind(null, fiber, hook, getServerSnapshot, getSnapshot), null);
44941
+ pushSimpleEffect(HasEffect | Passive, { destroy: undefined }, updateStoreInstance.bind(null, fiber, hook, getServerSnapshot, getSnapshot2), null);
44875
44942
  if (workInProgressRoot === null)
44876
44943
  throw Error("Expected a work-in-progress root. This is a bug in React. Please file an issue.");
44877
- isHydrating$jscomp$0 || (renderLanes & 127) !== 0 || pushStoreConsistencyCheck(fiber, getSnapshot, getServerSnapshot);
44944
+ isHydrating$jscomp$0 || (renderLanes & 127) !== 0 || pushStoreConsistencyCheck(fiber, getSnapshot2, getServerSnapshot);
44878
44945
  }
44879
44946
  return getServerSnapshot;
44880
44947
  }
44881
- function pushStoreConsistencyCheck(fiber, getSnapshot, renderedSnapshot) {
44948
+ function pushStoreConsistencyCheck(fiber, getSnapshot2, renderedSnapshot) {
44882
44949
  fiber.flags |= 16384;
44883
- fiber = { getSnapshot, value: renderedSnapshot };
44884
- getSnapshot = currentlyRenderingFiber.updateQueue;
44885
- getSnapshot === null ? (getSnapshot = createFunctionComponentUpdateQueue(), currentlyRenderingFiber.updateQueue = getSnapshot, getSnapshot.stores = [fiber]) : (renderedSnapshot = getSnapshot.stores, renderedSnapshot === null ? getSnapshot.stores = [fiber] : renderedSnapshot.push(fiber));
44950
+ fiber = { getSnapshot: getSnapshot2, value: renderedSnapshot };
44951
+ getSnapshot2 = currentlyRenderingFiber.updateQueue;
44952
+ getSnapshot2 === null ? (getSnapshot2 = createFunctionComponentUpdateQueue(), currentlyRenderingFiber.updateQueue = getSnapshot2, getSnapshot2.stores = [fiber]) : (renderedSnapshot = getSnapshot2.stores, renderedSnapshot === null ? getSnapshot2.stores = [fiber] : renderedSnapshot.push(fiber));
44886
44953
  }
44887
- function updateStoreInstance(fiber, inst, nextSnapshot, getSnapshot) {
44954
+ function updateStoreInstance(fiber, inst, nextSnapshot, getSnapshot2) {
44888
44955
  inst.value = nextSnapshot;
44889
- inst.getSnapshot = getSnapshot;
44956
+ inst.getSnapshot = getSnapshot2;
44890
44957
  checkIfSnapshotChanged(inst) && forceStoreRerender(fiber);
44891
44958
  }
44892
44959
  function subscribeToStore(fiber, inst, subscribe) {
@@ -48728,10 +48795,10 @@ Learn more about data fetching with Hooks: https://react.dev/link/hooks-data-fet
48728
48795
  var tag = node.tag;
48729
48796
  if ((tag === 0 || tag === 11 || tag === 15) && node.flags & 16384 && (tag = node.updateQueue, tag !== null && (tag = tag.stores, tag !== null)))
48730
48797
  for (var i = 0;i < tag.length; i++) {
48731
- var check3 = tag[i], getSnapshot = check3.getSnapshot;
48798
+ var check3 = tag[i], getSnapshot2 = check3.getSnapshot;
48732
48799
  check3 = check3.value;
48733
48800
  try {
48734
- if (!objectIs(getSnapshot(), check3))
48801
+ if (!objectIs(getSnapshot2(), check3))
48735
48802
  return false;
48736
48803
  } catch (error3) {
48737
48804
  return false;
@@ -50455,10 +50522,10 @@ Check the top-level render call using <` + componentName2 + ">.");
50455
50522
  mountHookTypesDev();
50456
50523
  return mountTransition();
50457
50524
  },
50458
- useSyncExternalStore: function(subscribe, getSnapshot, getServerSnapshot) {
50525
+ useSyncExternalStore: function(subscribe, getSnapshot2, getServerSnapshot) {
50459
50526
  currentHookNameInDev = "useSyncExternalStore";
50460
50527
  mountHookTypesDev();
50461
- return mountSyncExternalStore(subscribe, getSnapshot, getServerSnapshot);
50528
+ return mountSyncExternalStore(subscribe, getSnapshot2, getServerSnapshot);
50462
50529
  },
50463
50530
  useId: function() {
50464
50531
  currentHookNameInDev = "useId";
@@ -50581,10 +50648,10 @@ Check the top-level render call using <` + componentName2 + ">.");
50581
50648
  updateHookTypesDev();
50582
50649
  return mountTransition();
50583
50650
  },
50584
- useSyncExternalStore: function(subscribe, getSnapshot, getServerSnapshot) {
50651
+ useSyncExternalStore: function(subscribe, getSnapshot2, getServerSnapshot) {
50585
50652
  currentHookNameInDev = "useSyncExternalStore";
50586
50653
  updateHookTypesDev();
50587
- return mountSyncExternalStore(subscribe, getSnapshot, getServerSnapshot);
50654
+ return mountSyncExternalStore(subscribe, getSnapshot2, getServerSnapshot);
50588
50655
  },
50589
50656
  useId: function() {
50590
50657
  currentHookNameInDev = "useId";
@@ -50707,10 +50774,10 @@ Check the top-level render call using <` + componentName2 + ">.");
50707
50774
  updateHookTypesDev();
50708
50775
  return updateTransition();
50709
50776
  },
50710
- useSyncExternalStore: function(subscribe, getSnapshot, getServerSnapshot) {
50777
+ useSyncExternalStore: function(subscribe, getSnapshot2, getServerSnapshot) {
50711
50778
  currentHookNameInDev = "useSyncExternalStore";
50712
50779
  updateHookTypesDev();
50713
- return updateSyncExternalStore(subscribe, getSnapshot, getServerSnapshot);
50780
+ return updateSyncExternalStore(subscribe, getSnapshot2, getServerSnapshot);
50714
50781
  },
50715
50782
  useId: function() {
50716
50783
  currentHookNameInDev = "useId";
@@ -50833,10 +50900,10 @@ Check the top-level render call using <` + componentName2 + ">.");
50833
50900
  updateHookTypesDev();
50834
50901
  return rerenderTransition();
50835
50902
  },
50836
- useSyncExternalStore: function(subscribe, getSnapshot, getServerSnapshot) {
50903
+ useSyncExternalStore: function(subscribe, getSnapshot2, getServerSnapshot) {
50837
50904
  currentHookNameInDev = "useSyncExternalStore";
50838
50905
  updateHookTypesDev();
50839
- return updateSyncExternalStore(subscribe, getSnapshot, getServerSnapshot);
50906
+ return updateSyncExternalStore(subscribe, getSnapshot2, getServerSnapshot);
50840
50907
  },
50841
50908
  useId: function() {
50842
50909
  currentHookNameInDev = "useId";
@@ -50976,11 +51043,11 @@ Check the top-level render call using <` + componentName2 + ">.");
50976
51043
  mountHookTypesDev();
50977
51044
  return mountTransition();
50978
51045
  },
50979
- useSyncExternalStore: function(subscribe, getSnapshot, getServerSnapshot) {
51046
+ useSyncExternalStore: function(subscribe, getSnapshot2, getServerSnapshot) {
50980
51047
  currentHookNameInDev = "useSyncExternalStore";
50981
51048
  warnInvalidHookAccess();
50982
51049
  mountHookTypesDev();
50983
- return mountSyncExternalStore(subscribe, getSnapshot, getServerSnapshot);
51050
+ return mountSyncExternalStore(subscribe, getSnapshot2, getServerSnapshot);
50984
51051
  },
50985
51052
  useId: function() {
50986
51053
  currentHookNameInDev = "useId";
@@ -51127,11 +51194,11 @@ Check the top-level render call using <` + componentName2 + ">.");
51127
51194
  updateHookTypesDev();
51128
51195
  return updateTransition();
51129
51196
  },
51130
- useSyncExternalStore: function(subscribe, getSnapshot, getServerSnapshot) {
51197
+ useSyncExternalStore: function(subscribe, getSnapshot2, getServerSnapshot) {
51131
51198
  currentHookNameInDev = "useSyncExternalStore";
51132
51199
  warnInvalidHookAccess();
51133
51200
  updateHookTypesDev();
51134
- return updateSyncExternalStore(subscribe, getSnapshot, getServerSnapshot);
51201
+ return updateSyncExternalStore(subscribe, getSnapshot2, getServerSnapshot);
51135
51202
  },
51136
51203
  useId: function() {
51137
51204
  currentHookNameInDev = "useId";
@@ -51278,11 +51345,11 @@ Check the top-level render call using <` + componentName2 + ">.");
51278
51345
  updateHookTypesDev();
51279
51346
  return rerenderTransition();
51280
51347
  },
51281
- useSyncExternalStore: function(subscribe, getSnapshot, getServerSnapshot) {
51348
+ useSyncExternalStore: function(subscribe, getSnapshot2, getServerSnapshot) {
51282
51349
  currentHookNameInDev = "useSyncExternalStore";
51283
51350
  warnInvalidHookAccess();
51284
51351
  updateHookTypesDev();
51285
- return updateSyncExternalStore(subscribe, getSnapshot, getServerSnapshot);
51352
+ return updateSyncExternalStore(subscribe, getSnapshot2, getServerSnapshot);
51286
51353
  },
51287
51354
  useId: function() {
51288
51355
  currentHookNameInDev = "useId";
@@ -51840,15 +51907,15 @@ var require_constants3 = __commonJS((exports, module) => {
51840
51907
  var require_buffer_util = __commonJS((exports, module) => {
51841
51908
  var { EMPTY_BUFFER } = require_constants3();
51842
51909
  var FastBuffer = Buffer[Symbol.species];
51843
- function concat2(list2, totalLength) {
51844
- if (list2.length === 0)
51910
+ function concat2(list3, totalLength) {
51911
+ if (list3.length === 0)
51845
51912
  return EMPTY_BUFFER;
51846
- if (list2.length === 1)
51847
- return list2[0];
51913
+ if (list3.length === 1)
51914
+ return list3[0];
51848
51915
  const target = Buffer.allocUnsafe(totalLength);
51849
51916
  let offset = 0;
51850
- for (let i = 0;i < list2.length; i++) {
51851
- const buf = list2[i];
51917
+ for (let i = 0;i < list3.length; i++) {
51918
+ const buf = list3[i];
51852
51919
  target.set(buf, offset);
51853
51920
  offset += buf.length;
51854
51921
  }
@@ -53104,14 +53171,14 @@ var require_sender = __commonJS((exports, module) => {
53104
53171
  this._bufferedBytes += params[3][kByteLength];
53105
53172
  this._queue.push(params);
53106
53173
  }
53107
- sendFrame(list2, cb) {
53108
- if (list2.length === 2) {
53174
+ sendFrame(list3, cb) {
53175
+ if (list3.length === 2) {
53109
53176
  this._socket.cork();
53110
- this._socket.write(list2[0]);
53111
- this._socket.write(list2[1], cb);
53177
+ this._socket.write(list3[0]);
53178
+ this._socket.write(list3[1], cb);
53112
53179
  this._socket.uncork();
53113
53180
  } else {
53114
- this._socket.write(list2[0], cb);
53181
+ this._socket.write(list3[0], cb);
53115
53182
  }
53116
53183
  }
53117
53184
  }
@@ -55041,10 +55108,10 @@ var require_backend = __commonJS((exports, module) => {
55041
55108
  });
55042
55109
  return [stateHook, function() {}];
55043
55110
  },
55044
- useSyncExternalStore: function useSyncExternalStore(subscribe, getSnapshot) {
55111
+ useSyncExternalStore: function useSyncExternalStore(subscribe, getSnapshot2) {
55045
55112
  nextHook();
55046
55113
  nextHook();
55047
- subscribe = getSnapshot();
55114
+ subscribe = getSnapshot2();
55048
55115
  hookLog.push({
55049
55116
  displayName: null,
55050
55117
  primitive: "SyncExternalStore",
@@ -55884,8 +55951,8 @@ var require_backend = __commonJS((exports, module) => {
55884
55951
  exports2.useState = function(initialState) {
55885
55952
  return ReactSharedInternals.H.useState(initialState);
55886
55953
  };
55887
- exports2.useSyncExternalStore = function(subscribe, getSnapshot, getServerSnapshot) {
55888
- return ReactSharedInternals.H.useSyncExternalStore(subscribe, getSnapshot, getServerSnapshot);
55954
+ exports2.useSyncExternalStore = function(subscribe, getSnapshot2, getServerSnapshot) {
55955
+ return ReactSharedInternals.H.useSyncExternalStore(subscribe, getSnapshot2, getServerSnapshot);
55889
55956
  };
55890
55957
  exports2.useTransition = function() {
55891
55958
  return ReactSharedInternals.H.useTransition();
@@ -57024,7 +57091,7 @@ var require_backend = __commonJS((exports, module) => {
57024
57091
  module2.exports = Yallist;
57025
57092
  Yallist.Node = Node2;
57026
57093
  Yallist.create = Yallist;
57027
- function Yallist(list2) {
57094
+ function Yallist(list3) {
57028
57095
  var self2 = this;
57029
57096
  if (!(self2 instanceof Yallist)) {
57030
57097
  self2 = new Yallist;
@@ -57032,8 +57099,8 @@ var require_backend = __commonJS((exports, module) => {
57032
57099
  self2.tail = null;
57033
57100
  self2.head = null;
57034
57101
  self2.length = 0;
57035
- if (list2 && typeof list2.forEach === "function") {
57036
- list2.forEach(function(item) {
57102
+ if (list3 && typeof list3.forEach === "function") {
57103
+ list3.forEach(function(item) {
57037
57104
  self2.push(item);
57038
57105
  });
57039
57106
  } else if (arguments.length > 0) {
@@ -57360,11 +57427,11 @@ var require_backend = __commonJS((exports, module) => {
57360
57427
  }
57361
57428
  self2.length++;
57362
57429
  }
57363
- function Node2(value, prev, next, list2) {
57430
+ function Node2(value, prev, next, list3) {
57364
57431
  if (!(this instanceof Node2)) {
57365
- return new Node2(value, prev, next, list2);
57432
+ return new Node2(value, prev, next, list3);
57366
57433
  }
57367
- this.list = list2;
57434
+ this.list = list3;
57368
57435
  this.value = value;
57369
57436
  if (prev) {
57370
57437
  prev.next = this;
@@ -73804,15 +73871,15 @@ var require_constants4 = __commonJS((exports, module) => {
73804
73871
  var require_buffer_util2 = __commonJS((exports, module) => {
73805
73872
  var { EMPTY_BUFFER } = require_constants4();
73806
73873
  var FastBuffer = Buffer[Symbol.species];
73807
- function concat2(list3, totalLength) {
73808
- if (list3.length === 0)
73874
+ function concat2(list4, totalLength) {
73875
+ if (list4.length === 0)
73809
73876
  return EMPTY_BUFFER;
73810
- if (list3.length === 1)
73811
- return list3[0];
73877
+ if (list4.length === 1)
73878
+ return list4[0];
73812
73879
  const target = Buffer.allocUnsafe(totalLength);
73813
73880
  let offset = 0;
73814
- for (let i = 0;i < list3.length; i++) {
73815
- const buf = list3[i];
73881
+ for (let i = 0;i < list4.length; i++) {
73882
+ const buf = list4[i];
73816
73883
  target.set(buf, offset);
73817
73884
  offset += buf.length;
73818
73885
  }
@@ -75086,14 +75153,14 @@ var require_sender2 = __commonJS((exports, module) => {
75086
75153
  this._bufferedBytes += params[3][kByteLength];
75087
75154
  this._queue.push(params);
75088
75155
  }
75089
- sendFrame(list3, cb) {
75090
- if (list3.length === 2) {
75156
+ sendFrame(list4, cb) {
75157
+ if (list4.length === 2) {
75091
75158
  this._socket.cork();
75092
- this._socket.write(list3[0]);
75093
- this._socket.write(list3[1], cb);
75159
+ this._socket.write(list4[0]);
75160
+ this._socket.write(list4[1], cb);
75094
75161
  this._socket.uncork();
75095
75162
  } else {
75096
- this._socket.write(list3[0], cb);
75163
+ this._socket.write(list4[0], cb);
75097
75164
  }
75098
75165
  }
75099
75166
  }
@@ -79781,7 +79848,7 @@ async function validateAndSaveToken(apiToken, apiUrl) {
79781
79848
  init_spinner();
79782
79849
  init_output();
79783
79850
  init_sdk_gen();
79784
- async function list(options) {
79851
+ async function list2(options) {
79785
79852
  await requireAuth();
79786
79853
  await setupClient();
79787
79854
  const page = options.page ? parseInt(options.page, 10) : undefined;
@@ -81183,7 +81250,10 @@ async function updateConfigAction(options) {
81183
81250
  let cpuLimit = options.cpuLimit ? parseFloat(options.cpuLimit) : undefined;
81184
81251
  let memoryLimit = options.memoryLimit ? parseInt(options.memoryLimit, 10) : undefined;
81185
81252
  let autoDeploy = options.autoDeploy;
81186
- if (replicas === undefined && cpuLimit === undefined && memoryLimit === undefined && autoDeploy === undefined && !options.yes) {
81253
+ const requestTimeoutSeconds = options.requestTimeout ? parseInt(options.requestTimeout, 10) : undefined;
81254
+ const sseIdleTimeoutSeconds = options.sseIdleTimeout ? parseInt(options.sseIdleTimeout, 10) : undefined;
81255
+ const websocketIdleTimeoutSeconds = options.websocketIdleTimeout ? parseInt(options.websocketIdleTimeout, 10) : undefined;
81256
+ if (replicas === undefined && cpuLimit === undefined && memoryLimit === undefined && autoDeploy === undefined && requestTimeoutSeconds === undefined && sseIdleTimeoutSeconds === undefined && websocketIdleTimeoutSeconds === undefined && !options.yes) {
81187
81257
  newline();
81188
81258
  header("Update Deployment Configuration");
81189
81259
  info2(`Deployment config for "${project.name}"`);
@@ -81216,7 +81286,10 @@ async function updateConfigAction(options) {
81216
81286
  replicas: replicas ?? undefined,
81217
81287
  cpuLimit: cpuLimit ?? undefined,
81218
81288
  memoryLimit: memoryLimit ?? undefined,
81219
- automaticDeploy: autoDeploy ?? undefined
81289
+ automaticDeploy: autoDeploy ?? undefined,
81290
+ requestTimeoutSeconds: requestTimeoutSeconds ?? undefined,
81291
+ sseIdleTimeoutSeconds: sseIdleTimeoutSeconds ?? undefined,
81292
+ websocketIdleTimeoutSeconds: websocketIdleTimeoutSeconds ?? undefined
81220
81293
  }
81221
81294
  });
81222
81295
  if (error3) {
@@ -81237,6 +81310,12 @@ async function updateConfigAction(options) {
81237
81310
  keyValue("Memory Limit", `${memoryLimit} MB`);
81238
81311
  if (autoDeploy !== undefined)
81239
81312
  keyValue("Auto Deploy", autoDeploy ? colors.success("Enabled") : colors.muted("Disabled"));
81313
+ if (requestTimeoutSeconds !== undefined)
81314
+ keyValue("Request Timeout", `${requestTimeoutSeconds}s`);
81315
+ if (sseIdleTimeoutSeconds !== undefined)
81316
+ keyValue("SSE Idle Timeout", `${sseIdleTimeoutSeconds}s`);
81317
+ if (websocketIdleTimeoutSeconds !== undefined)
81318
+ keyValue("WebSocket Idle Timeout", `${websocketIdleTimeoutSeconds}s`);
81240
81319
  }
81241
81320
 
81242
81321
  // src/commands/projects/secrets.ts
@@ -81432,13 +81511,13 @@ async function deleteAction(key, options) {
81432
81511
  function registerProjectsCommands(program2) {
81433
81512
  const projects = program2.command("projects").alias("project").alias("p").description("Manage projects");
81434
81513
  registerProjectSecretsCommands(projects);
81435
- projects.command("list").alias("ls").description("List all projects").option("--json", "Output in JSON format").option("--page <n>", "Page number").option("--per-page <n>", "Items per page").action(list);
81514
+ projects.command("list").alias("ls").description("List all projects").option("--json", "Output in JSON format").option("--page <n>", "Page number").option("--per-page <n>", "Items per page").action(list2);
81436
81515
  projects.command("create").alias("new").description("Create a new project (git-based or manual deployment)").option("-n, --name <name>", "Project name").option("-d, --description <description>", "Project description").option("--repo <repository>", "Repository in owner/name format (nested groups supported: group/subgroup/name)").option("--branch <branch>", "Git branch").option("--directory <directory>", "Root directory (relative to repo)").option("--preset <preset>", "Build preset (e.g., nextjs, nodejs, static, docker)").option("--connection <id>", "Git connection ID").option("--manual", "Create a manual (non-git) project - deploy via Docker image or static files").option("--source-type <type>", "Manual deployment method: manual (flexible), docker_image, or static_files").option("--image <image>", "Docker image for the first deployment (manual mode)").option("--port <port>", "Application/container port (manual mode, default: 3000)").option("-y, --yes", "Skip optional prompts (services, env vars, set-default)").action(create);
81437
81516
  projects.command("show").alias("get").description("Show project details").option("-p, --project <project>", "Project slug or ID").option("--json", "Output in JSON format").action(show);
81438
81517
  projects.command("update").alias("edit").description("Update project name and description").option("-p, --project <project>", "Project slug or ID").option("-n, --name <name>", "New project name").option("-d, --description <description>", "New project description").option("--json", "Output in JSON format").option("-y, --yes", "Skip prompts, use provided values (for automation)").action(updateProjectAction);
81439
81518
  projects.command("settings").description("Update project settings (slug, attack mode, preview environments)").option("-p, --project <project>", "Project slug or ID").option("--slug <slug>", "Project URL slug").option("--attack-mode", "Enable attack mode (CAPTCHA protection)").option("--no-attack-mode", "Disable attack mode").option("--preview-envs", "Enable preview environments").option("--no-preview-envs", "Disable preview environments").option("--json", "Output in JSON format").option("-y, --yes", "Skip prompts (for automation)").action(updateSettingsAction);
81440
81519
  projects.command("git").description("Update git repository settings").option("-p, --project <project>", "Project slug or ID").option("--owner <owner>", "Repository owner").option("--repo <repo>", "Repository name").option("--branch <branch>", "Main branch").option("--directory <directory>", "App directory path").option("--preset <preset>", "Build preset (auto, nextjs, nodejs, static, docker, rust, go, python)").option("--connection <id>", "Git connection ID (links the project to an actual clone-access connection; omit to leave the existing connection unchanged)").option("--json", "Output in JSON format").option("-y, --yes", "Skip prompts, use provided/existing values (for automation)").action(updateGitAction);
81441
- projects.command("config").description("Update deployment configuration (resources, replicas)").option("-p, --project <project>", "Project slug or ID").option("--replicas <n>", "Number of container replicas").option("--cpu-limit <limit>", "CPU limit in cores (e.g., 0.5, 1, 2)").option("--memory-limit <limit>", "Memory limit in MB").option("--auto-deploy", "Enable automatic deployments").option("--no-auto-deploy", "Disable automatic deployments").option("--json", "Output in JSON format").option("-y, --yes", "Skip prompts (for automation)").action(updateConfigAction);
81520
+ projects.command("config").description("Update deployment configuration (resources, replicas)").option("-p, --project <project>", "Project slug or ID").option("--replicas <n>", "Number of container replicas").option("--cpu-limit <limit>", "CPU limit in cores (e.g., 0.5, 1, 2)").option("--memory-limit <limit>", "Memory limit in MB").option("--auto-deploy", "Enable automatic deployments").option("--no-auto-deploy", "Disable automatic deployments").option("--request-timeout <seconds>", "Default timeout for regular HTTP requests, in seconds").option("--sse-idle-timeout <seconds>", "Default idle timeout for SSE streams, in seconds").option("--websocket-idle-timeout <seconds>", "Default idle timeout for WebSocket connections, in seconds").option("--json", "Output in JSON format").option("-y, --yes", "Skip prompts (for automation)").action(updateConfigAction);
81442
81521
  projects.command("delete").alias("rm").description("Delete a project").option("-p, --project <project>", "Project slug or ID").option("-f, --force", "Skip confirmation").option("-y, --yes", "Skip confirmation (alias for --force)").action(remove);
81443
81522
  }
81444
81523
 
@@ -88248,7 +88327,7 @@ async function deployImage(options) {
88248
88327
  init_sdk_gen();
88249
88328
  init_spinner();
88250
88329
  init_output();
88251
- async function list2(options) {
88330
+ async function list3(options) {
88252
88331
  await requireAuth();
88253
88332
  await setupClient();
88254
88333
  const resolved = await resolveProjectSlug(options.project);
@@ -88755,7 +88834,8 @@ async function drop2(path6, options) {
88755
88834
  preset: candidate.preset,
88756
88835
  source_type: candidate.isStatic ? "static_files" : "uploaded_source",
88757
88836
  automatic_deploy: false,
88758
- storage_service_ids: []
88837
+ storage_service_ids: [],
88838
+ preset_config: candidate.preset === "docker-compose" && candidate.composePath ? { composePath: candidate.composePath } : undefined
88759
88839
  }
88760
88840
  });
88761
88841
  if (created.error || !created.data)
@@ -88973,7 +89053,7 @@ function registerDeployCommands(program2) {
88973
89053
  program2.command("deploy:image").alias("deploy-image").description("Deploy a pre-built Docker image").requiredOption("--image <image>", "Docker image reference (e.g., ghcr.io/org/app:v1.0)").option("-p, --project <project>", "Project slug or ID").option("-e, --environment <env>", "Target environment name", "production").option("--environment-id <id>", "Target environment ID").option("--no-wait", "Do not wait for deployment to complete").option("-y, --yes", "Skip confirmation prompts (for automation)").option("--metadata <json>", "Additional metadata (JSON format)").option("--health-check-path <path>", 'HTTP health-check path (must start with "/", e.g. /api/healthz). Overrides .temps.yaml; also updates the uptime monitor.').option("--timeout <seconds>", "Timeout in seconds for --wait", "300").action(deployImage);
88974
89054
  program2.command("deploy:local-image").alias("deploy-local-image").description("Build and deploy a local Docker image (or deploy existing image with --image)").option("--image <image>", "Use existing local image instead of building (skips build)").option("-f, --dockerfile <path>", "Path to Dockerfile", "Dockerfile").option("-c, --context <path>", "Build context directory", ".").option("--build-arg <arg...>", "Build arguments (can be specified multiple times)").option("--no-build", "Skip building, requires --image").option("-p, --project <project>", "Project slug or ID").option("-e, --environment <env>", "Target environment name", "production").option("--environment-id <id>", "Target environment ID").option("-t, --tag <tag>", "Tag for the built/uploaded image").option("--no-wait", "Do not wait for deployment to complete").option("-y, --yes", "Skip confirmation prompts (for automation)").option("--metadata <json>", "Additional metadata (JSON format)").option("--health-check-path <path>", 'HTTP health-check path (must start with "/", e.g. /api/healthz). Overrides .temps.yaml; also updates the uptime monitor.').option("--timeout <seconds>", "Timeout in seconds for --wait", "600").action(deployLocalImage);
88975
89055
  const deployments = program2.command("deployments").alias("deploys").description("Manage deployments");
88976
- deployments.command("list").alias("ls").description("List deployments").option("-p, --project <project>", "Project slug or ID").option("-e, --environment <env>", "Filter by environment name (client-side)").option("--environment-id <id>", "Filter by environment ID (server-side)").option("-n, --limit <number>", "Limit results", "10").option("--page <n>", "Page number").option("--per-page <n>", "Items per page").option("--json", "Output in JSON format").action(list2);
89056
+ deployments.command("list").alias("ls").description("List deployments").option("-p, --project <project>", "Project slug or ID").option("-e, --environment <env>", "Filter by environment name (client-side)").option("--environment-id <id>", "Filter by environment ID (server-side)").option("-n, --limit <number>", "Limit results", "10").option("--page <n>", "Page number").option("--per-page <n>", "Items per page").option("--json", "Output in JSON format").action(list3);
88977
89057
  deployments.command("status").description("Show deployment status").option("-p, --project <project>", "Project slug or ID (required)").option("-d, --deployment-id <id>", "Deployment ID (required)").option("--json", "Output in JSON format").action(status);
88978
89058
  deployments.command("rollback").description("Rollback to previous deployment").option("-p, --project <project>", "Project slug or ID (required)").option("-e, --environment <env>", "Target environment", "production").option("--to <deployment>", "Rollback to specific deployment ID").action(rollback);
88979
89059
  deployments.command("cancel").description("Cancel a running deployment").requiredOption("-p, --project-id <id>", "Project ID").requiredOption("-d, --deployment-id <id>", "Deployment ID").option("-f, --force", "Skip confirmation").action(cancelDeploymentAction);
@@ -89650,6 +89730,7 @@ function registerEnvironmentsCommands(program2) {
89650
89730
  return exportEnvVars(projectSlug, options);
89651
89731
  });
89652
89732
  environments.command("resources <environment>").description("View or set CPU/memory resources for an environment").option("-p, --project <project>", "Project slug or ID").option("--cpu <millicores>", "CPU limit in millicores (e.g., 500 = 0.5 CPU)").option("--memory <mb>", "Memory limit in MB (e.g., 512)").option("--cpu-request <millicores>", "CPU request in millicores (guaranteed minimum)").option("--memory-request <mb>", "Memory request in MB (guaranteed minimum)").option("--json", "Output in JSON format").action(resourcesCmd);
89733
+ environments.command("timeouts <environment>").description("View or set upstream request/idle timeouts for an environment").option("-p, --project <project>", "Project slug or ID").option("--request <seconds>", "Timeout for regular (non-streaming) HTTP requests, in seconds").option("--sse-idle <seconds>", "Idle timeout for Server-Sent Events streams, in seconds").option("--websocket-idle <seconds>", "Idle timeout for WebSocket connections, in seconds").option("--inherit", "Clear all three overrides (inherit the project/global defaults)").option("--json", "Output in JSON format").action(timeoutsCmd);
89653
89734
  environments.command("force-https <environment>").description("View or set the HTTP to HTTPS redirect override for an environment").option("-p, --project <project>", "Project slug or ID").option("--enable", "Always redirect plain HTTP to HTTPS, even without a local certificate").option("--disable", "Never redirect: keep serving this environment over plain HTTP").option("--inherit", "Clear the override and follow the proxy default").option("--json", "Output in JSON format").action(forceHttpsCmd);
89654
89735
  environments.command("scale").description("View or set the number of replicas for an environment").option("-p, --project <project>", "Project slug or ID").option("-e, --environment <env>", "Environment name or slug", "production").option("-r, --replicas <count>", "Number of replicas to set").option("--json", "Output in JSON format").action(scaleCmd);
89655
89736
  const crons = environments.command("crons").description("Manage cron jobs").option("-p, --project <project>", "Project slug or ID").requiredOption("-e, --environment <env>", "Environment name or slug");
@@ -90427,6 +90508,123 @@ function displayResources(env4) {
90427
90508
  newline();
90428
90509
  info2(`Example: ${colors.muted("temps env resources my-project production --cpu 1000 --memory 512")}`);
90429
90510
  }
90511
+ function formatTimeout(seconds) {
90512
+ if (seconds == null)
90513
+ return colors.muted("inherit (project/global default)");
90514
+ if (seconds === 0)
90515
+ return colors.muted("no timeout (explicit override)");
90516
+ return `${seconds}s`;
90517
+ }
90518
+ async function timeoutsCmd(environment, options) {
90519
+ await requireAuth();
90520
+ await setupClient();
90521
+ const resolved = await requireProjectSlug(options.project);
90522
+ const projectId = await getProjectId2(resolved.slug);
90523
+ const envs = await withSpinner("Fetching environments...", async () => {
90524
+ const { data, error: error3 } = await getEnvironments({
90525
+ client,
90526
+ path: { project_id: projectId }
90527
+ });
90528
+ if (error3)
90529
+ throw new Error(getErrorMessage(error3));
90530
+ return data ?? [];
90531
+ });
90532
+ const targetEnv = envs.find((e) => e.slug === environment || e.name.toLowerCase() === environment.toLowerCase());
90533
+ if (!targetEnv) {
90534
+ error2(`Environment "${environment}" not found`);
90535
+ info2(`Available environments: ${envs.map((e) => e.slug).join(", ")}`);
90536
+ return;
90537
+ }
90538
+ const hasSetOptions = options.request || options.sseIdle || options.websocketIdle;
90539
+ if (hasSetOptions && options.inherit) {
90540
+ error2("Pass either --inherit or one of --request/--sse-idle/--websocket-idle, not both");
90541
+ return;
90542
+ }
90543
+ if (hasSetOptions || options.inherit) {
90544
+ const updateBody = {};
90545
+ if (options.inherit) {
90546
+ updateBody.request_timeout_seconds = null;
90547
+ updateBody.sse_idle_timeout_seconds = null;
90548
+ updateBody.websocket_idle_timeout_seconds = null;
90549
+ } else {
90550
+ if (options.request) {
90551
+ const seconds = parseInt(options.request, 10);
90552
+ if (isNaN(seconds) || seconds < 0) {
90553
+ error2("--request must be 0 (no timeout) or a positive number of seconds");
90554
+ return;
90555
+ }
90556
+ updateBody.request_timeout_seconds = seconds;
90557
+ }
90558
+ if (options.sseIdle) {
90559
+ const seconds = parseInt(options.sseIdle, 10);
90560
+ if (isNaN(seconds) || seconds < 0) {
90561
+ error2("--sse-idle must be 0 (no timeout) or a positive number of seconds");
90562
+ return;
90563
+ }
90564
+ updateBody.sse_idle_timeout_seconds = seconds;
90565
+ }
90566
+ if (options.websocketIdle) {
90567
+ const seconds = parseInt(options.websocketIdle, 10);
90568
+ if (isNaN(seconds) || seconds < 0) {
90569
+ error2("--websocket-idle must be 0 (no timeout) or a positive number of seconds");
90570
+ return;
90571
+ }
90572
+ updateBody.websocket_idle_timeout_seconds = seconds;
90573
+ }
90574
+ }
90575
+ const updatedEnv = await withSpinner("Updating timeouts...", async () => {
90576
+ const { data, error: error3 } = await updateEnvironmentSettings({
90577
+ client,
90578
+ path: { project_id: projectId, env_id: targetEnv.id },
90579
+ body: updateBody
90580
+ });
90581
+ if (error3)
90582
+ throw new Error(getErrorMessage(error3));
90583
+ return data;
90584
+ });
90585
+ const config2 = updatedEnv?.deployment_config;
90586
+ if (options.json) {
90587
+ json({
90588
+ environment: updatedEnv?.slug,
90589
+ request_timeout_seconds: config2?.requestTimeoutSeconds ?? null,
90590
+ sse_idle_timeout_seconds: config2?.sseIdleTimeoutSeconds ?? null,
90591
+ websocket_idle_timeout_seconds: config2?.websocketIdleTimeoutSeconds ?? null
90592
+ });
90593
+ return;
90594
+ }
90595
+ newline();
90596
+ success2(`Timeouts updated for ${resolved.slug}/${environment}`);
90597
+ newline();
90598
+ keyValue("HTTP request timeout", formatTimeout(config2?.requestTimeoutSeconds));
90599
+ keyValue("SSE idle timeout", formatTimeout(config2?.sseIdleTimeoutSeconds));
90600
+ keyValue("WebSocket idle timeout", formatTimeout(config2?.websocketIdleTimeoutSeconds));
90601
+ } else {
90602
+ const config2 = targetEnv.deployment_config;
90603
+ if (options.json) {
90604
+ json({
90605
+ environment: targetEnv.slug,
90606
+ request_timeout_seconds: config2?.requestTimeoutSeconds ?? null,
90607
+ sse_idle_timeout_seconds: config2?.sseIdleTimeoutSeconds ?? null,
90608
+ websocket_idle_timeout_seconds: config2?.websocketIdleTimeoutSeconds ?? null
90609
+ });
90610
+ return;
90611
+ }
90612
+ newline();
90613
+ header(`${icons.folder} Request timeouts for ${resolved.slug}/${environment}`);
90614
+ newline();
90615
+ keyValue("HTTP request timeout", formatTimeout(config2?.requestTimeoutSeconds));
90616
+ keyValue("SSE idle timeout", formatTimeout(config2?.sseIdleTimeoutSeconds));
90617
+ keyValue("WebSocket idle timeout", formatTimeout(config2?.websocketIdleTimeoutSeconds));
90618
+ newline();
90619
+ info2("An unset value inherits the project default, then the operator's global default —");
90620
+ info2('which is "no timeout" unless an operator has configured one. Nonzero values are');
90621
+ info2("always clamped to the global hard ceiling regardless of what's configured here.");
90622
+ newline();
90623
+ info2(`Set it with: ${colors.muted("temps env timeouts " + environment + " --request 30 --sse-idle 900")}`);
90624
+ info2(`Force no timeout: ${colors.muted("temps env timeouts " + environment + " --request 0")}`);
90625
+ info2(`Clear overrides: ${colors.muted("temps env timeouts " + environment + " --inherit")}`);
90626
+ }
90627
+ }
90430
90628
  function describeForceHttps(value) {
90431
90629
  if (value === true)
90432
90630
  return colors.success("always redirect");
@@ -94918,6 +95116,33 @@ function buildAutomationSettingsUpdate(options, currentSettings) {
94918
95116
  enabled
94919
95117
  };
94920
95118
  }
95119
+ if (options.maxRequestTimeout || options.defaultHttpTimeout || options.defaultSseIdleTimeout || options.defaultWebsocketIdleTimeout) {
95120
+ const current = currentSettings?.request_timeouts;
95121
+ const fields = [
95122
+ ["--max-request-timeout", options.maxRequestTimeout, current?.max_request_timeout_seconds ?? 600],
95123
+ ["--default-http-timeout", options.defaultHttpTimeout, current?.default_http_timeout_seconds ?? 0],
95124
+ ["--default-sse-idle-timeout", options.defaultSseIdleTimeout, current?.default_sse_idle_timeout_seconds ?? 0],
95125
+ ["--default-websocket-idle-timeout", options.defaultWebsocketIdleTimeout, current?.default_websocket_idle_timeout_seconds ?? 0]
95126
+ ];
95127
+ const parsed = [];
95128
+ for (const [flag, raw, fallback] of fields) {
95129
+ if (raw === undefined) {
95130
+ parsed.push(fallback);
95131
+ continue;
95132
+ }
95133
+ const value = parseInt(raw, 10);
95134
+ if (Number.isNaN(value)) {
95135
+ return { error: `${flag} must be a number, got "${raw}"` };
95136
+ }
95137
+ parsed.push(value);
95138
+ }
95139
+ updates.request_timeouts = {
95140
+ max_request_timeout_seconds: parsed[0],
95141
+ default_http_timeout_seconds: parsed[1],
95142
+ default_sse_idle_timeout_seconds: parsed[2],
95143
+ default_websocket_idle_timeout_seconds: parsed[3]
95144
+ };
95145
+ }
94921
95146
  if (options.setting && options.value) {
94922
95147
  switch (options.setting) {
94923
95148
  case "external_url":
@@ -94938,7 +95163,7 @@ function buildAutomationSettingsUpdate(options, currentSettings) {
94938
95163
  function registerSettingsCommands(program2) {
94939
95164
  const settings = program2.command("settings").description("Manage platform settings");
94940
95165
  settings.command("show").alias("get").description("Show current platform settings").option("--json", "Output in JSON format").action(showSettings);
94941
- settings.command("update").alias("set").description("Update platform settings").option("-s, --setting <setting>", "Setting to update (external_url, preview_domain, letsencrypt, rate_limiting, security_headers, screenshots)").option("-v, --value <value>", "Value for the setting").option("--external-url <url>", "External URL for the platform").option("--preview-domain <domain>", "Preview domain pattern").option("--letsencrypt-email <email>", "Let's Encrypt email").option("--letsencrypt-mode <mode>", "Let's Encrypt mode (staging, production)").option("--rate-limiting-enabled <enabled>", "Enable rate limiting (true/false)").option("--rate-limiting-rpm <rpm>", "Requests per minute").option("--screenshots-enabled <enabled>", "Enable screenshots (true/false)").option("-y, --yes", "Skip confirmation prompts (for automation)").action(updateSettingsAction2);
95166
+ settings.command("update").alias("set").description("Update platform settings").option("-s, --setting <setting>", "Setting to update (external_url, preview_domain, letsencrypt, rate_limiting, security_headers, screenshots)").option("-v, --value <value>", "Value for the setting").option("--external-url <url>", "External URL for the platform").option("--preview-domain <domain>", "Preview domain pattern").option("--letsencrypt-email <email>", "Let's Encrypt email").option("--letsencrypt-mode <mode>", "Let's Encrypt mode (staging, production)").option("--rate-limiting-enabled <enabled>", "Enable rate limiting (true/false)").option("--rate-limiting-rpm <rpm>", "Requests per minute").option("--screenshots-enabled <enabled>", "Enable screenshots (true/false)").option("--max-request-timeout <seconds>", "Hard ceiling for all upstream request/idle timeouts, in seconds").option("--default-http-timeout <seconds>", "Default timeout for regular HTTP requests, in seconds").option("--default-sse-idle-timeout <seconds>", "Default idle timeout for SSE streams, in seconds").option("--default-websocket-idle-timeout <seconds>", "Default idle timeout for WebSocket connections, in seconds").option("-y, --yes", "Skip confirmation prompts (for automation)").action(updateSettingsAction2);
94942
95167
  settings.command("set-external-url").description("Set the external URL for the platform").requiredOption("--url <url>", "External URL").action(setExternalUrl);
94943
95168
  settings.command("set-preview-domain").description("Set the preview domain pattern").requiredOption("--domain <domain>", "Preview domain pattern").action(setPreviewDomain);
94944
95169
  }
@@ -95026,7 +95251,7 @@ async function updateSettingsAction2(options) {
95026
95251
  throw new Error(getErrorMessage(getError));
95027
95252
  }
95028
95253
  const updates = {};
95029
- const isAutomation = options.yes && (options.externalUrl || options.previewDomain || options.letsencryptEmail || options.letsencryptMode || options.rateLimitingEnabled || options.screenshotsEnabled || options.setting && options.value);
95254
+ const isAutomation = options.yes && (options.externalUrl || options.previewDomain || options.letsencryptEmail || options.letsencryptMode || options.rateLimitingEnabled || options.screenshotsEnabled || options.maxRequestTimeout || options.defaultHttpTimeout || options.defaultSseIdleTimeout || options.defaultWebsocketIdleTimeout || options.setting && options.value);
95030
95255
  if (isAutomation) {
95031
95256
  const result2 = buildAutomationSettingsUpdate(options, currentSettings ?? undefined);
95032
95257
  if ("error" in result2) {
@@ -95043,7 +95268,8 @@ async function updateSettingsAction2(options) {
95043
95268
  { name: "Let's Encrypt Settings", value: "letsencrypt" },
95044
95269
  { name: "Rate Limiting", value: "rate_limiting" },
95045
95270
  { name: "Security Headers", value: "security_headers" },
95046
- { name: "Screenshots", value: "screenshots" }
95271
+ { name: "Screenshots", value: "screenshots" },
95272
+ { name: "Request Timeouts", value: "request_timeouts" }
95047
95273
  ]
95048
95274
  });
95049
95275
  switch (settingToUpdate) {
@@ -95131,12 +95357,28 @@ async function updateSettingsAction2(options) {
95131
95357
  };
95132
95358
  break;
95133
95359
  }
95360
+ case "request_timeouts": {
95361
+ info2("0 means no timeout. Timeouts are opt-in — existing apps are unaffected until you set a nonzero default here.");
95362
+ info2("The hard ceiling only applies once a timeout is actually configured; it never creates one on its own.");
95363
+ newline();
95364
+ const maxRequestTimeout = await promptNumber("Hard ceiling for all request/idle timeouts (seconds)", { default: currentSettings?.request_timeouts?.max_request_timeout_seconds ?? 600, min: 5 });
95365
+ const defaultHttpTimeout = await promptNumber("Default timeout for regular HTTP requests (seconds, 0 = no timeout)", { default: currentSettings?.request_timeouts?.default_http_timeout_seconds ?? 0, min: 0 });
95366
+ const defaultSseIdleTimeout = await promptNumber("Default idle timeout for SSE streams (seconds, 0 = no timeout)", { default: currentSettings?.request_timeouts?.default_sse_idle_timeout_seconds ?? 0, min: 0 });
95367
+ const defaultWebsocketIdleTimeout = await promptNumber("Default idle timeout for WebSocket connections (seconds, 0 = no timeout)", { default: currentSettings?.request_timeouts?.default_websocket_idle_timeout_seconds ?? 0, min: 0 });
95368
+ updates.request_timeouts = {
95369
+ max_request_timeout_seconds: maxRequestTimeout,
95370
+ default_http_timeout_seconds: defaultHttpTimeout,
95371
+ default_sse_idle_timeout_seconds: defaultSseIdleTimeout,
95372
+ default_websocket_idle_timeout_seconds: defaultWebsocketIdleTimeout
95373
+ };
95374
+ break;
95375
+ }
95134
95376
  }
95135
95377
  }
95136
95378
  await withSpinner("Updating settings...", async () => {
95137
95379
  const { error: error3 } = await updateSettings({
95138
95380
  client,
95139
- body: updates
95381
+ body: { ...currentSettings, ...updates }
95140
95382
  });
95141
95383
  if (error3) {
95142
95384
  throw new Error(getErrorMessage(error3));
@@ -95148,11 +95390,13 @@ async function setExternalUrl(options) {
95148
95390
  await requireAuth();
95149
95391
  await setupClient();
95150
95392
  await withSpinner("Updating external URL...", async () => {
95393
+ const { data: currentSettings, error: getError } = await getSettings({ client });
95394
+ if (getError) {
95395
+ throw new Error(getErrorMessage(getError));
95396
+ }
95151
95397
  const { error: error3 } = await updateSettings({
95152
95398
  client,
95153
- body: {
95154
- external_url: options.url
95155
- }
95399
+ body: { ...currentSettings, external_url: options.url }
95156
95400
  });
95157
95401
  if (error3) {
95158
95402
  throw new Error(getErrorMessage(error3));
@@ -95164,11 +95408,13 @@ async function setPreviewDomain(options) {
95164
95408
  await requireAuth();
95165
95409
  await setupClient();
95166
95410
  await withSpinner("Updating preview domain...", async () => {
95411
+ const { data: currentSettings, error: getError } = await getSettings({ client });
95412
+ if (getError) {
95413
+ throw new Error(getErrorMessage(getError));
95414
+ }
95167
95415
  const { error: error3 } = await updateSettings({
95168
95416
  client,
95169
- body: {
95170
- preview_domain: options.domain
95171
- }
95417
+ body: { ...currentSettings, preview_domain: options.domain }
95172
95418
  });
95173
95419
  if (error3) {
95174
95420
  throw new Error(getErrorMessage(error3));
@@ -97593,6 +97839,9 @@ async function watchMetrics(projectId, environmentId, containerIds, intervalMs)
97593
97839
  console.log("\x1B[?25h");
97594
97840
  }
97595
97841
 
97842
+ // src/commands/docs.ts
97843
+ import { writeFile as writeFile6 } from "node:fs/promises";
97844
+
97596
97845
  // src/cli.ts
97597
97846
  init_source();
97598
97847
  init_output();
@@ -98679,6 +98928,307 @@ async function getErrorDashboardAction(options) {
98679
98928
  newline();
98680
98929
  }
98681
98930
 
98931
+ // src/commands/metrics/query.ts
98932
+ init_sdk_gen();
98933
+ init_spinner();
98934
+ init_output();
98935
+
98936
+ // src/commands/analytics/period.ts
98937
+ function parsePeriod(period) {
98938
+ const now2 = new Date;
98939
+ const endDate = now2.toISOString();
98940
+ if (period === "today") {
98941
+ const start2 = new Date(now2.getFullYear(), now2.getMonth(), now2.getDate());
98942
+ return { startDate: start2.toISOString(), endDate, label: "today" };
98943
+ }
98944
+ const match = period.match(/^(\d+)(h|d|m)$/);
98945
+ if (!match) {
98946
+ throw new Error(`Invalid period "${period}". Use: today, <n>h (hours), <n>d (days), <n>m (months). Examples: 1h, 6h, 24h, 7d, 30d, 3m`);
98947
+ }
98948
+ const n = parseInt(match[1], 10);
98949
+ const unit = match[2];
98950
+ let start;
98951
+ let label;
98952
+ switch (unit) {
98953
+ case "h":
98954
+ start = new Date(now2.getTime() - n * 60 * 60 * 1000);
98955
+ label = n === 1 ? "last hour" : `last ${n} hours`;
98956
+ break;
98957
+ case "d":
98958
+ start = new Date(now2.getTime() - n * 24 * 60 * 60 * 1000);
98959
+ label = n === 1 ? "last day" : `last ${n} days`;
98960
+ break;
98961
+ case "m":
98962
+ start = new Date(now2);
98963
+ start.setMonth(start.getMonth() - n);
98964
+ label = n === 1 ? "last month" : `last ${n} months`;
98965
+ break;
98966
+ default:
98967
+ throw new Error(`Unknown unit "${unit}"`);
98968
+ }
98969
+ return { startDate: start.toISOString(), endDate, label };
98970
+ }
98971
+
98972
+ // src/commands/metrics/query.ts
98973
+ function seriesLabel(bucket) {
98974
+ if (!bucket.series_key || bucket.series_key.length === 0)
98975
+ return "";
98976
+ return bucket.series_key.map(([k, v]) => `${k}=${v}`).join(",");
98977
+ }
98978
+ async function metricsQuery(options) {
98979
+ await requireAuth();
98980
+ await setupClient();
98981
+ const resolved = await requireProjectSlug(options.project);
98982
+ if (resolved.source !== "flag") {
98983
+ info2(`Using project ${colors.bold(resolved.slug)} (from ${resolved.source})`);
98984
+ }
98985
+ const { data: projectData, error: projectError } = await getProjectBySlug({
98986
+ client,
98987
+ path: { slug: resolved.slug }
98988
+ });
98989
+ if (projectError || !projectData) {
98990
+ throw new Error(`Project "${resolved.slug}" not found`);
98991
+ }
98992
+ const projectId = projectData.id;
98993
+ let startTime = options.startTime;
98994
+ let endTime = options.endTime;
98995
+ let periodLabel = "custom range";
98996
+ if (!startTime && !endTime) {
98997
+ const period = options.period ?? "24h";
98998
+ const parsed = parsePeriod(period);
98999
+ startTime = parsed.startDate;
99000
+ endTime = parsed.endDate;
99001
+ periodLabel = parsed.label;
99002
+ }
99003
+ if (!options.metricName) {
99004
+ warning2('No --metric-name given — this returns every metric bucketed together. Run "temps metrics names" to discover available names.');
99005
+ }
99006
+ const limit = options.limit ? parseInt(options.limit, 10) : 500;
99007
+ const data = await withSpinner("Querying metrics...", async () => {
99008
+ const { data: data2, error: error3 } = await queryMetrics({
99009
+ client,
99010
+ query: {
99011
+ project_id: projectId,
99012
+ metric_name: options.metricName,
99013
+ service_name: options.serviceName,
99014
+ environment: options.environment,
99015
+ start_time: startTime,
99016
+ end_time: endTime,
99017
+ bucket_interval: options.bucketInterval,
99018
+ aggregation: options.aggregation,
99019
+ metric_type: options.metricType,
99020
+ label_filters: options.labelFilters,
99021
+ group_by: options.groupBy,
99022
+ limit
99023
+ }
99024
+ });
99025
+ if (error3)
99026
+ throw new Error(getErrorMessage(error3));
99027
+ return data2;
99028
+ });
99029
+ const buckets = data?.data ?? [];
99030
+ if (options.json) {
99031
+ json({
99032
+ project: resolved.slug,
99033
+ metric_name: options.metricName,
99034
+ start_time: startTime,
99035
+ end_time: endTime,
99036
+ aggregation: options.aggregation ?? "avg",
99037
+ count: data?.count ?? 0,
99038
+ data: buckets
99039
+ });
99040
+ return;
99041
+ }
99042
+ header(`Metrics${options.metricName ? `: ${options.metricName}` : ""} — ${resolved.slug} (${periodLabel})`);
99043
+ if (buckets.length === 0) {
99044
+ newline();
99045
+ console.log(colors.muted(" No metric data in this window."));
99046
+ console.log(colors.muted(' Check the metric name with "temps metrics names -p ' + resolved.slug + '", or widen --period.'));
99047
+ newline();
99048
+ return;
99049
+ }
99050
+ const hasSeries = buckets.some((b) => b.series_key && b.series_key.length > 0);
99051
+ const columns = [
99052
+ { header: "Bucket", accessor: (b) => new Date(b.bucket).toLocaleString(), align: "left" },
99053
+ ...hasSeries ? [{ header: "Series", accessor: seriesLabel, align: "left" }] : [],
99054
+ { header: "Avg", accessor: (b) => b.avg_value.toFixed(4), align: "right" },
99055
+ { header: "Min", accessor: (b) => b.min_value.toFixed(4), align: "right" },
99056
+ { header: "Max", accessor: (b) => b.max_value.toFixed(4), align: "right" },
99057
+ { header: "Count", accessor: (b) => b.count, align: "right" }
99058
+ ];
99059
+ printTable(buckets, columns, { style: "minimal" });
99060
+ newline();
99061
+ console.log(colors.muted(` ${buckets.length} bucket(s)`));
99062
+ newline();
99063
+ }
99064
+
99065
+ // src/commands/metrics/names.ts
99066
+ init_sdk_gen();
99067
+ init_spinner();
99068
+ init_output();
99069
+ async function metricsNames(options) {
99070
+ await requireAuth();
99071
+ await setupClient();
99072
+ const resolved = await requireProjectSlug(options.project);
99073
+ if (resolved.source !== "flag") {
99074
+ info2(`Using project ${colors.bold(resolved.slug)} (from ${resolved.source})`);
99075
+ }
99076
+ const { data: projectData, error: projectError } = await getProjectBySlug({
99077
+ client,
99078
+ path: { slug: resolved.slug }
99079
+ });
99080
+ if (projectError || !projectData) {
99081
+ throw new Error(`Project "${resolved.slug}" not found`);
99082
+ }
99083
+ const names = await withSpinner("Fetching metric names...", async () => {
99084
+ const { data, error: error3 } = await listMetricNames({
99085
+ client,
99086
+ path: { project_id: projectData.id }
99087
+ });
99088
+ if (error3)
99089
+ throw new Error(getErrorMessage(error3));
99090
+ return data?.names ?? [];
99091
+ });
99092
+ if (options.json) {
99093
+ json({ project: resolved.slug, names });
99094
+ return;
99095
+ }
99096
+ header(`Metric Names — ${resolved.slug}`);
99097
+ newline();
99098
+ if (names.length === 0) {
99099
+ console.log(colors.muted(" No metrics have been ingested for this project yet."));
99100
+ newline();
99101
+ return;
99102
+ }
99103
+ list(names);
99104
+ newline();
99105
+ console.log(colors.muted(` ${names.length} metric(s). Query one with: temps metrics query -p ${resolved.slug} --metric-name <name>`));
99106
+ newline();
99107
+ }
99108
+
99109
+ // src/commands/metrics/label-keys.ts
99110
+ init_sdk_gen();
99111
+ init_spinner();
99112
+ init_output();
99113
+ async function metricsLabelKeys(options) {
99114
+ await requireAuth();
99115
+ await setupClient();
99116
+ const resolved = await requireProjectSlug(options.project);
99117
+ if (resolved.source !== "flag") {
99118
+ info2(`Using project ${colors.bold(resolved.slug)} (from ${resolved.source})`);
99119
+ }
99120
+ const { data: projectData, error: projectError } = await getProjectBySlug({
99121
+ client,
99122
+ path: { slug: resolved.slug }
99123
+ });
99124
+ if (projectError || !projectData) {
99125
+ throw new Error(`Project "${resolved.slug}" not found`);
99126
+ }
99127
+ const keys2 = await withSpinner("Fetching label keys...", async () => {
99128
+ const { data, error: error3 } = await listMetricLabelKeys({
99129
+ client,
99130
+ query: {
99131
+ project_id: projectData.id,
99132
+ metric_name: options.metricName,
99133
+ start_time: options.startTime,
99134
+ end_time: options.endTime
99135
+ }
99136
+ });
99137
+ if (error3)
99138
+ throw new Error(getErrorMessage(error3));
99139
+ return data?.keys ?? [];
99140
+ });
99141
+ if (options.json) {
99142
+ json({ project: resolved.slug, metric_name: options.metricName, keys: keys2 });
99143
+ return;
99144
+ }
99145
+ header(`Label Keys — ${options.metricName} (${resolved.slug})`);
99146
+ newline();
99147
+ if (keys2.length === 0) {
99148
+ console.log(colors.muted(" No labels observed on this metric in the window."));
99149
+ newline();
99150
+ return;
99151
+ }
99152
+ list(keys2);
99153
+ newline();
99154
+ }
99155
+
99156
+ // src/commands/metrics/label-values.ts
99157
+ init_sdk_gen();
99158
+ init_spinner();
99159
+ init_output();
99160
+ async function metricsLabelValues(options) {
99161
+ await requireAuth();
99162
+ await setupClient();
99163
+ const resolved = await requireProjectSlug(options.project);
99164
+ if (resolved.source !== "flag") {
99165
+ info2(`Using project ${colors.bold(resolved.slug)} (from ${resolved.source})`);
99166
+ }
99167
+ const { data: projectData, error: projectError } = await getProjectBySlug({
99168
+ client,
99169
+ path: { slug: resolved.slug }
99170
+ });
99171
+ if (projectError || !projectData) {
99172
+ throw new Error(`Project "${resolved.slug}" not found`);
99173
+ }
99174
+ const values2 = await withSpinner("Fetching label values...", async () => {
99175
+ const { data, error: error3 } = await listMetricLabelValues({
99176
+ client,
99177
+ query: {
99178
+ project_id: projectData.id,
99179
+ metric_name: options.metricName,
99180
+ label_key: options.labelKey,
99181
+ start_time: options.startTime,
99182
+ end_time: options.endTime
99183
+ }
99184
+ });
99185
+ if (error3)
99186
+ throw new Error(getErrorMessage(error3));
99187
+ return data?.values ?? [];
99188
+ });
99189
+ if (options.json) {
99190
+ json({
99191
+ project: resolved.slug,
99192
+ metric_name: options.metricName,
99193
+ label_key: options.labelKey,
99194
+ values: values2
99195
+ });
99196
+ return;
99197
+ }
99198
+ header(`Label Values — ${options.labelKey} on ${options.metricName} (${resolved.slug})`);
99199
+ newline();
99200
+ if (values2.length === 0) {
99201
+ console.log(colors.muted(" No values observed for this label in the window."));
99202
+ newline();
99203
+ return;
99204
+ }
99205
+ list(values2);
99206
+ newline();
99207
+ }
99208
+
99209
+ // src/commands/metrics/index.ts
99210
+ function registerMetricsCommands(program2) {
99211
+ const metrics = program2.command("metrics").alias("metric").description('Query OTel application metrics for debugging (not container/docker stats — see "temps containers metrics" for those)');
99212
+ metrics.command("names").description("List distinct metric names ingested for a project — start here if you don't know what to query").option("-p, --project <project>", "Project slug or ID").option("--json", "Output in JSON format").action(metricsNames);
99213
+ metrics.command("query").description("Query a metric with time bucketing and aggregation").option("-p, --project <project>", "Project slug or ID").option("--metric-name <name>", 'Metric to query (see "temps metrics names")').option("--service-name <name>", "Filter by service name").option("--environment <name>", "Filter by deployment environment name").option("--period <period>", "Time period: today, <n>h, <n>d, <n>m (e.g. 1h, 24h, 7d)", "24h").option("--start-time <iso>", "Explicit window start (RFC 3339) — overrides --period").option("--end-time <iso>", "Explicit window end (RFC 3339) — overrides --period").option("--bucket-interval <interval>", 'Bucket size, e.g. "5 minutes", "1 hour"').option("--aggregation <mode>", "Per-bucket aggregation: avg (default), sum, min, max, count, rate, p50/p95/p99, quantile:0.95").option("--metric-type <type>", "Filter by metric type: gauge, sum, histogram, exponential_histogram, summary").option("--label-filters <pairs>", "Comma-separated key=value data-point label filters, e.g. http.method=GET,http.status_code=200").option("--group-by <keys>", "Comma-separated label keys to group series by, e.g. http.method,http.route").option("--limit <n>", "Max buckets to return (default: 500, server cap: 1000)").option("--json", "Output in JSON format").action(metricsQuery);
99214
+ metrics.command("label-keys").description("List the label keys observed on a metric — powers filter/group-by discovery").option("-p, --project <project>", "Project slug or ID").requiredOption("--metric-name <name>", "Metric to inspect").option("--start-time <iso>", "Window start (RFC 3339); defaults to 24h before end").option("--end-time <iso>", "Window end (RFC 3339); defaults to now").option("--json", "Output in JSON format").action(metricsLabelKeys);
99215
+ metrics.command("label-values").description("List the distinct values seen for a label key on a metric").option("-p, --project <project>", "Project slug or ID").requiredOption("--metric-name <name>", "Metric to inspect").requiredOption("--label-key <key>", "Label key whose values to list").option("--start-time <iso>", "Window start (RFC 3339); defaults to 24h before end").option("--end-time <iso>", "Window end (RFC 3339); defaults to now").option("--json", "Output in JSON format").action(metricsLabelValues);
99216
+ metrics.addHelpText("after", `
99217
+ Discovery workflow — find a metric, then narrow it down:
99218
+ $ temps metrics names -p my-app
99219
+ $ temps metrics label-keys -p my-app --metric-name go.goroutine.count
99220
+ $ temps metrics label-values -p my-app --metric-name go.goroutine.count --label-key http.method
99221
+
99222
+ Examples:
99223
+ $ temps metrics query -p my-app --metric-name go.goroutine.count --period 24h
99224
+ $ temps metrics query -p my-app --metric-name http.server.duration --aggregation p95 --period 7d
99225
+ $ temps metrics query -p my-app --metric-name http.server.duration \\
99226
+ --label-filters http.method=GET,http.status_code=200 --group-by http.route
99227
+ $ temps metrics query -p my-app --metric-name go.goroutine.count \\
99228
+ --start-time 2026-08-12T10:01:12.053Z --end-time 2026-08-13T10:01:12.053Z \\
99229
+ --bucket-interval "15 minutes" --aggregation avg --limit 500 --json`);
99230
+ }
99231
+
98682
99232
  // src/commands/traces/index.ts
98683
99233
  init_sdk_gen();
98684
99234
  init_spinner();
@@ -107074,44 +107624,6 @@ init_source();
107074
107624
  init_sdk_gen();
107075
107625
  init_spinner();
107076
107626
  init_output();
107077
-
107078
- // src/commands/analytics/period.ts
107079
- function parsePeriod(period) {
107080
- const now2 = new Date;
107081
- const endDate = now2.toISOString();
107082
- if (period === "today") {
107083
- const start2 = new Date(now2.getFullYear(), now2.getMonth(), now2.getDate());
107084
- return { startDate: start2.toISOString(), endDate, label: "today" };
107085
- }
107086
- const match = period.match(/^(\d+)(h|d|m)$/);
107087
- if (!match) {
107088
- throw new Error(`Invalid period "${period}". Use: today, <n>h (hours), <n>d (days), <n>m (months). Examples: 1h, 6h, 24h, 7d, 30d, 3m`);
107089
- }
107090
- const n = parseInt(match[1], 10);
107091
- const unit = match[2];
107092
- let start;
107093
- let label;
107094
- switch (unit) {
107095
- case "h":
107096
- start = new Date(now2.getTime() - n * 60 * 60 * 1000);
107097
- label = n === 1 ? "last hour" : `last ${n} hours`;
107098
- break;
107099
- case "d":
107100
- start = new Date(now2.getTime() - n * 24 * 60 * 60 * 1000);
107101
- label = n === 1 ? "last day" : `last ${n} days`;
107102
- break;
107103
- case "m":
107104
- start = new Date(now2);
107105
- start.setMonth(start.getMonth() - n);
107106
- label = n === 1 ? "last month" : `last ${n} months`;
107107
- break;
107108
- default:
107109
- throw new Error(`Unknown unit "${unit}"`);
107110
- }
107111
- return { startDate: start.toISOString(), endDate, label };
107112
- }
107113
-
107114
- // src/commands/analytics/overview.ts
107115
107627
  var SPARKLINE_WIDTH = 48;
107116
107628
  function bucketSizeForRange(startDate, endDate) {
107117
107629
  const hours = (Date.parse(endDate) - Date.parse(startDate)) / 3600000;
@@ -109264,8 +109776,8 @@ async function updateAction5(options) {
109264
109776
  const { data, error: error3 } = await client.get({ url: "/settings/secrets" });
109265
109777
  if (error3)
109266
109778
  throw new Error(getErrorMessage(error3));
109267
- const list3 = data;
109268
- const found = list3.items.find((s) => s.name === options.name);
109779
+ const list4 = data;
109780
+ const found = list4.items.find((s) => s.name === options.name);
109269
109781
  if (!found)
109270
109782
  throw new Error(`Secret '${options.name}' not found`);
109271
109783
  return found;
@@ -110035,7 +110547,7 @@ function base64Decode(b64) {
110035
110547
  }
110036
110548
  function registerSandboxCommands(program2) {
110037
110549
  const sandbox = program2.command("sandbox").description("Manage standalone sandboxes (/v1/sandbox API)");
110038
- sandbox.command("create").description("Create a new sandbox").option("--image <image>", "Docker image override (uses platform default when omitted)").option("--name <name>", "Display name for the sandbox").option("--timeout <seconds>", "Idle timeout in seconds (clamped to [60, 86400])").option("-e, --env <KEY=VAL>", "Env var baked into the container (repeatable)", (val, prev) => prev ? [...prev, val] : [val]).option("--cpu-limit <cpu>", "CPU limit (e.g., 0.5 for half a core)").option("--memory-mb <mb>", "Memory limit in megabytes").option("--git-url <url>", "Git repo URL to clone into the work dir").option("--git-rev <revision>", "Git revision to check out (requires --git-url)").option("--git-depth <n>", "Shallow clone depth (requires --git-url)").option("--git-connection <id>", "ID of a stored git provider connection; temps injects the token server-side").option("--git-username <user>", "HTTP Basic username for private repo clone (requires --git-password)").option("--git-password <token>", "HTTP Basic password/token (paired with --git-username; injected via GIT_ASKPASS)").option("--tarball-url <url>", "Tarball URL to download and extract").option("--workspace", "Create a persistent workspace: suspends when idle, wakes automatically on the next command, and is never destroyed for you").option("--project <slug>", "Seed from a temps project's connected repo (and attribute the sandbox to it). Defaults to the linked project in .temps/config.json").option("--repo <owner/name>", "Seed from a repo on one of your git connections that has no temps project").option("--branch <ref>", "Branch, tag, or SHA to check out (alias of --git-rev)").option("--new-branch <name>", "Create and switch to a new branch after cloning, based on whatever was checked out").option("--preview-password", "Generate a random preview-URL password and print it once on stdout").option("--preview-password-length <n>", "Length of the generated preview password (8..=256, default 24)").option("--json", "Output as JSON").action(createAction6);
110550
+ sandbox.command("create").description("Create a new sandbox").option("--image <image>", "Docker image override (uses platform default when omitted)").option("--name <name>", "Display name for the sandbox").option("--timeout <seconds>", "Idle timeout in seconds (clamped to [60, 86400])").option("-e, --env <KEY=VAL>", "Env var baked into the container (repeatable)", (val, prev) => prev ? [...prev, val] : [val]).option("--cpu-limit <cpu>", "CPU limit (e.g., 0.5 for half a core)").option("--memory-mb <mb>", "Memory limit in megabytes").option("--git-url <url>", "Git repo URL to clone into the work dir").option("--git-rev <revision>", "Git revision to check out (requires --git-url)").option("--git-depth <n>", "Shallow clone depth (requires --git-url)").option("--git-connection <id>", "ID of a stored git provider connection; temps injects the token server-side").option("--git-username <user>", "HTTP Basic username for private repo clone (requires --git-password)").option("--git-password <token>", "HTTP Basic password/token (paired with --git-username; injected via GIT_ASKPASS)").option("--tarball-url <url>", "Tarball URL to download and extract").option("--workspace", "Create a persistent workspace: suspends when idle, wakes automatically on the next command, and is never destroyed for you").option("--project <slug>", "Seed from a temps project's connected repo (and attribute the sandbox to it). Defaults to the linked project in .temps/config.json").option("--repo <owner/name>", "Seed from a repo on one of your git connections that has no temps project").option("--branch <ref>", "Branch, tag, or SHA to check out (alias of --git-rev)").option("--new-branch <name>", "Create and switch to a new branch after cloning, based on whatever was checked out").option("--preview-password", "Generate a random preview-URL password and print it once on stdout").option("--preview-password-length <n>", "Length of the generated preview password (8..=256, default 24)").option("--from-snapshot <snap-id>", "Create sandbox from a snapshot (mutually exclusive with --image)").option("--json", "Output as JSON").action(createAction6);
110039
110551
  sandbox.command("list").alias("ls").description("List your sandboxes").option("--page <n>", "Page (1-indexed)").option("--page-size <n>", "Items per page (default 20, max 100)").option("--workspace", "Show only persistent workspaces").option("--lifecycle <class>", "Filter by lifecycle class: ephemeral | workspace").option("--project <slug>", "Show only sandboxes created from this project").option("--json", "Output as JSON").action(listAction7);
110040
110552
  sandbox.command("show <id>").description("Show details for a sandbox").option("--json", "Output as JSON").action(showAction2);
110041
110553
  sandbox.command("rm <id>").aliases(["stop", "destroy"]).description("Remove a sandbox permanently (aliases: stop, destroy)").option("-f, --force", "Skip confirmation prompt").action(rmAction);
@@ -110054,6 +110566,12 @@ function registerSandboxCommands(program2) {
110054
110566
  fs5.command("write <id>").description("Write a file to the sandbox").requiredOption("--path <path>", "Absolute target path inside the sandbox").option("--file <localPath>", "Local source file to upload (mutually exclusive with --content)").option("--content <string>", "Inline string content to write").option("--mode <octal>", "Unix permission mask (default: 0644)").action(fsWriteAction);
110055
110567
  fs5.command("stat <id>").description("Stat a path inside the sandbox").requiredOption("--path <path>", "Absolute path inside the sandbox").option("--json", "Output as JSON").action(fsStatAction);
110056
110568
  fs5.command("mkdir <id>").description("Create a directory inside the sandbox (mkdir -p)").requiredOption("--path <path>", "Absolute path inside the sandbox").action(fsMkdirAction);
110569
+ const snaps = sandbox.command("snapshots").description("Manage sandbox snapshots (ADR-037)");
110570
+ sandbox.command("snapshot <id>").description("Take a snapshot of a sandbox").option("--label <label>", "Human-readable label for the snapshot").option("--wait", "Wait until the snapshot reaches ready or failed status").option("--json", "Output as JSON").action(snapshotCreateAction);
110571
+ snaps.command("list").alias("ls").description("List your snapshots").option("--project <id>", "Filter by project ID").option("--status <status>", "Filter by status: creating | ready | failed | deleted").option("--page <n>", "Page number (1-indexed)").option("--page-size <n>", "Items per page (default 20, max 100)").option("--json", "Output as JSON").action(snapshotListAction);
110572
+ snaps.command("show <snapId>").description("Show details for a snapshot").option("--json", "Output as JSON").action(snapshotShowAction);
110573
+ snaps.command("delete <snapId>").alias("rm").description("Delete a snapshot permanently").option("-f, --force", "Skip confirmation prompt").action(snapshotDeleteAction);
110574
+ snaps.command("storage").description("Show snapshot storage usage and quota").option("--json", "Output as JSON").action(snapshotStorageAction);
110057
110575
  }
110058
110576
  function buildSource(options) {
110059
110577
  const gitFlags = [
@@ -110107,7 +110625,12 @@ function buildSource(options) {
110107
110625
  async function createAction6(options) {
110108
110626
  const api = await auth();
110109
110627
  const env4 = parseEnvPairs(options.env);
110628
+ if (options.fromSnapshot && options.image) {
110629
+ throw new Error("--from-snapshot and --image are mutually exclusive");
110630
+ }
110110
110631
  const body = {};
110632
+ if (options.fromSnapshot)
110633
+ body.from_snapshot = options.fromSnapshot;
110111
110634
  if (options.image)
110112
110635
  body.image = options.image;
110113
110636
  if (options.name)
@@ -110550,6 +111073,171 @@ async function fsMkdirAction(id, options) {
110550
111073
  }));
110551
111074
  success2(`Directory ${colors.primary(options.path)} created`);
110552
111075
  }
111076
+ function snapshotUrl(baseUrl, path7) {
111077
+ return `${baseUrl.replace(/\/+$/, "")}/v1/sandbox-snapshots${path7}`;
111078
+ }
111079
+ async function snapshotApiRequest(api, path7, init = {}) {
111080
+ const headers = new Headers(init.headers);
111081
+ headers.set("Authorization", `Bearer ${api.apiKey}`);
111082
+ if (init.body && !headers.has("Content-Type")) {
111083
+ headers.set("Content-Type", "application/json");
111084
+ }
111085
+ const response = await fetch(snapshotUrl(api.baseUrl, path7), { ...init, headers });
111086
+ if (!response.ok) {
111087
+ throw await readApiError(response);
111088
+ }
111089
+ if (response.status === 204) {
111090
+ return;
111091
+ }
111092
+ return await response.json();
111093
+ }
111094
+ function formatBytes7(bytes) {
111095
+ if (bytes < 1024)
111096
+ return `${bytes} B`;
111097
+ if (bytes < 1024 * 1024)
111098
+ return `${(bytes / 1024).toFixed(1)} KiB`;
111099
+ if (bytes < 1024 * 1024 * 1024)
111100
+ return `${(bytes / 1024 / 1024).toFixed(1)} MiB`;
111101
+ return `${(bytes / 1024 / 1024 / 1024).toFixed(2)} GiB`;
111102
+ }
111103
+ function snapshotStatusColor(status2) {
111104
+ if (status2 === "ready")
111105
+ return colors.success(status2);
111106
+ if (status2 === "failed" || status2 === "deleted")
111107
+ return colors.error(status2);
111108
+ if (status2 === "creating")
111109
+ return colors.warning(status2);
111110
+ return status2;
111111
+ }
111112
+ async function snapshotCreateAction(sandboxId, options) {
111113
+ const api = await auth();
111114
+ const body = {};
111115
+ if (options.label)
111116
+ body.label = options.label;
111117
+ const snap = await withSpinner("Creating snapshot…", () => apiRequest(api, `/${encodeURIComponent(sandboxId)}/snapshots`, { method: "POST", body: JSON.stringify(body) }));
111118
+ let finalSnap = snap;
111119
+ if (options.wait && snap.status === "creating") {
111120
+ finalSnap = await withSpinner("Waiting for snapshot to be ready…", async () => {
111121
+ let current = snap;
111122
+ let attempts = 0;
111123
+ const maxAttempts = 120;
111124
+ while (current.status === "creating" && attempts < maxAttempts) {
111125
+ await new Promise((r) => setTimeout(r, 5000));
111126
+ current = await snapshotApiRequest(api, `/${encodeURIComponent(current.id)}`);
111127
+ attempts++;
111128
+ }
111129
+ return current;
111130
+ });
111131
+ }
111132
+ if (options.json) {
111133
+ json(finalSnap);
111134
+ return;
111135
+ }
111136
+ if (finalSnap.status === "creating") {
111137
+ info2(`Snapshot ${colors.primary(finalSnap.id)} is still being created.`);
111138
+ info2(`Poll with: temps sandbox snapshots show ${finalSnap.id}`);
111139
+ info2(`Create sandbox from it with: temps sandbox create --from-snapshot ${finalSnap.id}`);
111140
+ } else if (finalSnap.status === "ready") {
111141
+ success2(`Snapshot ${colors.primary(finalSnap.id)} is ready`);
111142
+ } else {
111143
+ warning2(`Snapshot ${colors.primary(finalSnap.id)} is in status: ${finalSnap.status}`);
111144
+ }
111145
+ keyValue("ID", finalSnap.id);
111146
+ keyValue("Status", snapshotStatusColor(finalSnap.status));
111147
+ keyValue("Size", formatBytes7(finalSnap.size_bytes));
111148
+ if (finalSnap.label)
111149
+ keyValue("Label", finalSnap.label);
111150
+ keyValue("Backend", finalSnap.backend);
111151
+ keyValue("Created", finalSnap.created_at);
111152
+ }
111153
+ async function snapshotListAction(options) {
111154
+ const api = await auth();
111155
+ const params = new URLSearchParams;
111156
+ if (options.project)
111157
+ params.set("project_id", options.project);
111158
+ if (options.status)
111159
+ params.set("status", options.status);
111160
+ if (options.page)
111161
+ params.set("page", options.page);
111162
+ if (options.pageSize)
111163
+ params.set("page_size", options.pageSize);
111164
+ const qs = params.toString() ? `?${params.toString()}` : "";
111165
+ const res = await withSpinner("Fetching snapshots…", () => snapshotApiRequest(api, `${qs}`));
111166
+ if (options.json) {
111167
+ json(res);
111168
+ return;
111169
+ }
111170
+ if (res.snapshots.length === 0) {
111171
+ info2("No snapshots found.");
111172
+ return;
111173
+ }
111174
+ const columns = [
111175
+ { header: "ID", accessor: (s) => colors.primary(s.id) },
111176
+ { header: "Status", accessor: (s) => snapshotStatusColor(s.status) },
111177
+ { header: "Backend", key: "backend" },
111178
+ { header: "Label", accessor: (s) => s.label ?? "-" },
111179
+ { header: "Size", accessor: (s) => formatBytes7(s.size_bytes) },
111180
+ { header: "Created", key: "created_at" }
111181
+ ];
111182
+ newline();
111183
+ printTable(res.snapshots, columns);
111184
+ newline();
111185
+ info2(`Page ${res.page} of ${Math.ceil(res.total / res.page_size)} — ${res.total} total`);
111186
+ }
111187
+ async function snapshotShowAction(snapId, options) {
111188
+ const api = await auth();
111189
+ const snap = await withSpinner("Fetching snapshot…", () => snapshotApiRequest(api, `/${encodeURIComponent(snapId)}`));
111190
+ if (options.json) {
111191
+ json(snap);
111192
+ return;
111193
+ }
111194
+ newline();
111195
+ keyValue("ID", snap.id);
111196
+ keyValue("Status", snapshotStatusColor(snap.status));
111197
+ keyValue("Backend", snap.backend);
111198
+ if (snap.label)
111199
+ keyValue("Label", snap.label);
111200
+ keyValue("Size", formatBytes7(snap.size_bytes));
111201
+ keyValue("Digest", snap.content_digest);
111202
+ if (snap.image_ref)
111203
+ keyValue("Image ref", snap.image_ref);
111204
+ keyValue("Created", snap.created_at);
111205
+ keyValue("Updated", snap.updated_at);
111206
+ newline();
111207
+ if (snap.status === "ready") {
111208
+ info2(`Restore with: temps sandbox create --from-snapshot ${snap.id}`);
111209
+ }
111210
+ }
111211
+ async function snapshotDeleteAction(snapId, options) {
111212
+ if (!options.force) {
111213
+ const confirmed = await promptConfirm({
111214
+ message: `Delete snapshot ${snapId}? This cannot be undone.`,
111215
+ default: false
111216
+ });
111217
+ if (!confirmed) {
111218
+ info2("Aborted.");
111219
+ return;
111220
+ }
111221
+ }
111222
+ const api = await auth();
111223
+ await withSpinner("Deleting snapshot…", () => snapshotApiRequest(api, `/${encodeURIComponent(snapId)}`, { method: "DELETE" }));
111224
+ success2(`Snapshot ${colors.primary(snapId)} deleted`);
111225
+ }
111226
+ async function snapshotStorageAction(options) {
111227
+ const api = await auth();
111228
+ const summary = await withSpinner("Fetching storage summary…", () => snapshotApiRequest(api, "/storage-summary"));
111229
+ if (options.json) {
111230
+ json(summary);
111231
+ return;
111232
+ }
111233
+ newline();
111234
+ keyValue("Snapshots", String(summary.snapshot_count));
111235
+ keyValue("Used", `${formatBytes7(summary.total_bytes)} / ${formatBytes7(summary.quota_bytes)}`);
111236
+ keyValue("Available on disk", summary.available_disk_bytes !== null ? formatBytes7(summary.available_disk_bytes) : "unknown");
111237
+ const pct = summary.quota_bytes > 0 ? (summary.total_bytes / summary.quota_bytes * 100).toFixed(1) : "0.0";
111238
+ keyValue("Quota used", `${pct}%`);
111239
+ newline();
111240
+ }
110553
111241
 
110554
111242
  // src/commands/workflow/index.ts
110555
111243
  init_sdk_gen();
@@ -114158,6 +114846,7 @@ function createProgram() {
114158
114846
  registerContainersCommands(program2);
114159
114847
  registerTokensCommands(program2);
114160
114848
  registerErrorsCommands(program2);
114849
+ registerMetricsCommands(program2);
114161
114850
  registerTracesCommands(program2);
114162
114851
  registerOtelForwardCommands(program2);
114163
114852
  registerKvCommands(program2);
@@ -114241,7 +114930,7 @@ function extractCommandInfo(cmd2, parentName = "") {
114241
114930
  flags: opt.flags,
114242
114931
  description: opt.description || "",
114243
114932
  defaultValue: opt.defaultValue !== undefined ? String(opt.defaultValue) : undefined,
114244
- required: opt.required || opt.flags.includes("<")
114933
+ required: opt.mandatory === true
114245
114934
  }));
114246
114935
  const subcommands = cmd2.commands.filter((sub) => sub.name() !== "docs").map((sub) => extractCommandInfo(sub, name));
114247
114936
  return {
@@ -114306,8 +114995,26 @@ function generateMarkdown(commands, level = 2, format2 = "markdown") {
114306
114995
  }
114307
114996
  return md;
114308
114997
  }
114309
- function generateHeader(format2 = "markdown") {
114310
- const date = new Date().toISOString().split("T")[0];
114998
+ function markdownAnchor(name) {
114999
+ return name.toLowerCase().replace(/[^a-z0-9\s-]/g, "").trim().replace(/\s+/g, "-");
115000
+ }
115001
+ function generateCommandIndex(commands) {
115002
+ let index = `## Command index
115003
+
115004
+ `;
115005
+ index += `Use this index or search for a top-level command heading to load only the relevant group.
115006
+
115007
+ `;
115008
+ for (const command of commands) {
115009
+ index += `- [\`${command.name}\`](#${markdownAnchor(command.name)}) - ${command.description}
115010
+ `;
115011
+ }
115012
+ return `${index}
115013
+ ## Commands
115014
+
115015
+ `;
115016
+ }
115017
+ function generateHeader(format2 = "markdown", version) {
114311
115018
  const mdxMetadata = `export const metadata = {
114312
115019
  title: 'CLI Reference',
114313
115020
  description: 'Complete reference for the Temps CLI - all commands, options, and usage examples.',
@@ -114318,12 +115025,18 @@ function generateHeader(format2 = "markdown") {
114318
115025
 
114319
115026
  > Auto-generated documentation for the Temps CLI.
114320
115027
  >
114321
- > Generated on: ${date}
115028
+ > Generated from: \`@temps-sdk/cli@${version}\`
115029
+ >
115030
+ > Apply the authorization, target-context, and secret-handling rules in
115031
+ > [the Temps CLI skill](../SKILL.md) before executing a command.
114322
115032
 
114323
115033
  ## Installation
114324
115034
 
114325
115035
  \`\`\`bash
114326
- bunx @temps-sdk/cli [command]
115036
+ bunx @temps-sdk/cli@${version} [command]
115037
+
115038
+ # Fallback when Bun is unavailable
115039
+ npx @temps-sdk/cli@${version} [command]
114327
115040
  \`\`\`
114328
115041
 
114329
115042
  ## Authentication
@@ -114331,27 +115044,26 @@ bunx @temps-sdk/cli [command]
114331
115044
  Before using most commands, you need to authenticate:
114332
115045
 
114333
115046
  \`\`\`bash
114334
- # Login with API key
114335
- bunx @temps-sdk/cli login
115047
+ # Login interactively
115048
+ bunx @temps-sdk/cli@${version} login
114336
115049
 
114337
115050
  # Or configure with wizard
114338
- bunx @temps-sdk/cli configure
115051
+ bunx @temps-sdk/cli@${version} configure
114339
115052
  \`\`\`
114340
115053
 
114341
115054
  ## Global Options
114342
115055
 
114343
115056
  | Flag | Description |
114344
115057
  |------|-------------|
114345
- | \`-v, --version\` | Display version number |
115058
+ | \`-V, --version\` | Display version number |
115059
+ | \`--target-context <name>\` | Target one configured server for this invocation |
114346
115060
  | \`--no-color\` | Disable colored output |
114347
115061
  | \`--debug\` | Enable debug output |
114348
115062
  | \`-h, --help\` | Display help for command |
114349
115063
 
114350
- ## Commands
114351
-
114352
115064
  `;
114353
115065
  }
114354
- function generateFooter() {
115066
+ function generateFooter(version) {
114355
115067
  return `
114356
115068
  ---
114357
115069
 
@@ -114361,48 +115073,48 @@ function generateFooter() {
114361
115073
 
114362
115074
  \`\`\`bash
114363
115075
  # Login to Temps
114364
- bunx @temps-sdk/cli login
115076
+ bunx @temps-sdk/cli@${version} login
114365
115077
 
114366
- # Create a new project
114367
- bunx @temps-sdk/cli projects create --name my-app
115078
+ # Create a new project on the intended server
115079
+ bunx @temps-sdk/cli@${version} --target-context production projects create --name my-app
114368
115080
 
114369
115081
  # Deploy to production
114370
- bunx @temps-sdk/cli deploy --project my-app --environment production
115082
+ bunx @temps-sdk/cli@${version} --target-context production deploy --project my-app --environment production
114371
115083
 
114372
115084
  # View deployment logs
114373
- bunx @temps-sdk/cli logs --project my-app --follow
115085
+ bunx @temps-sdk/cli@${version} deployments logs --project my-app --follow
114374
115086
 
114375
115087
  # Stream runtime container logs
114376
- bunx @temps-sdk/cli runtime-logs --project my-app
115088
+ bunx @temps-sdk/cli@${version} runtime-logs --project my-app
114377
115089
 
114378
115090
  # List containers
114379
- bunx @temps-sdk/cli containers list --project-id 1 --environment-id 1
115091
+ bunx @temps-sdk/cli@${version} containers list --project-id 1 --environment-id 1
114380
115092
  \`\`\`
114381
115093
 
114382
115094
  ### Managing Environments
114383
115095
 
114384
115096
  \`\`\`bash
114385
115097
  # List environments
114386
- bunx @temps-sdk/cli environments list --project my-app
115098
+ bunx @temps-sdk/cli@${version} environments list --project my-app
114387
115099
 
114388
- # Set environment variables
114389
- bunx @temps-sdk/cli environments vars set --project my-app --key DATABASE_URL --value "postgres://..."
115100
+ # Set environment variables on the intended server
115101
+ bunx @temps-sdk/cli@${version} --target-context production environments vars set --project my-app --key DATABASE_URL
114390
115102
 
114391
115103
  # View environment variables
114392
- bunx @temps-sdk/cli environments vars list --project my-app
115104
+ bunx @temps-sdk/cli@${version} environments vars list --project my-app
114393
115105
  \`\`\`
114394
115106
 
114395
115107
  ### Managing Domains
114396
115108
 
114397
115109
  \`\`\`bash
114398
- # Add a custom domain
114399
- bunx @temps-sdk/cli domains add --project my-app --domain app.example.com
115110
+ # Add a custom domain on the intended server
115111
+ bunx @temps-sdk/cli@${version} --target-context production domains add --project my-app --domain app.example.com
114400
115112
 
114401
115113
  # List domains
114402
- bunx @temps-sdk/cli domains list --project my-app
115114
+ bunx @temps-sdk/cli@${version} domains list --project my-app
114403
115115
 
114404
- # Remove a domain
114405
- bunx @temps-sdk/cli domains remove --project my-app --domain app.example.com
115116
+ # Remove a domain from the intended server
115117
+ bunx @temps-sdk/cli@${version} --target-context production domains remove --project my-app --domain app.example.com
114406
115118
  \`\`\`
114407
115119
 
114408
115120
  ## Environment Variables
@@ -114422,12 +115134,12 @@ Configuration is stored in:
114422
115134
  - **Config file**: \`~/.temps/config.json\`
114423
115135
  - **Credentials**: Stored securely in \`~/.temps/\` with restricted file permissions
114424
115136
 
114425
- Use \`bunx @temps-sdk/cli configure show\` to view current configuration.
115137
+ Use \`bunx @temps-sdk/cli@${version} configure show\` to view current configuration.
114426
115138
 
114427
115139
  ## Support
114428
115140
 
114429
- - Documentation: https://temps.dev/docs
114430
- - Issues: https://github.com/kfs/temps/issues
115141
+ - Documentation: https://temps.sh/docs
115142
+ - Issues: https://github.com/gotempsh/temps/issues
114431
115143
  `;
114432
115144
  }
114433
115145
  async function generateDocs(options) {
@@ -114438,12 +115150,14 @@ async function generateDocs(options) {
114438
115150
  output = JSON.stringify(commands, null, 2);
114439
115151
  } else {
114440
115152
  const format2 = options.format === "mdx" ? "mdx" : "markdown";
114441
- output = generateHeader(format2);
115153
+ const version = program2.version() ?? "unknown";
115154
+ output = generateHeader(format2, version);
115155
+ output += generateCommandIndex(commands);
114442
115156
  output += generateMarkdown(commands, 2, format2);
114443
- output += generateFooter();
115157
+ output += generateFooter(version);
114444
115158
  }
114445
115159
  if (options.output) {
114446
- await Bun.write(options.output, output);
115160
+ await writeFile6(options.output, output, "utf8");
114447
115161
  newline();
114448
115162
  header("Documentation Generated");
114449
115163
  console.log(`${colors.success("Written to:")} ${options.output}`);
@@ -114513,6 +115227,7 @@ function createProgram2() {
114513
115227
  registerContainersCommands(program2);
114514
115228
  registerTokensCommands(program2);
114515
115229
  registerErrorsCommands(program2);
115230
+ registerMetricsCommands(program2);
114516
115231
  registerTracesCommands(program2);
114517
115232
  registerOtelForwardCommands(program2);
114518
115233
  registerKvCommands(program2);