@boxes-dev/dvb-runtime 1.0.1075 → 1.0.1077

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/bin/dvb.mjs CHANGED
@@ -1,6 +1,6 @@
1
1
  #!/usr/bin/env node
2
2
 
3
- !function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="86100a09-93c6-5205-b9f2-11ad102e2ba9")}catch(e){}}();
3
+ !function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="f6d3678f-166c-58fc-bc7a-4fc93a5b76cd")}catch(e){}}();
4
4
  import { createRequire as __dvbCreateRequire } from "node:module";
5
5
  import { dirname as __dvbDirname } from "node:path";
6
6
  import { fileURLToPath as __dvbFileURLToPath } from "node:url";
@@ -2301,7 +2301,7 @@ var require_websocket = __commonJS({
2301
2301
  var http11 = __require("http");
2302
2302
  var net6 = __require("net");
2303
2303
  var tls2 = __require("tls");
2304
- var { randomBytes: randomBytes15, createHash: createHash28 } = __require("crypto");
2304
+ var { randomBytes: randomBytes15, createHash: createHash29 } = __require("crypto");
2305
2305
  var { Duplex, Readable: Readable3 } = __require("stream");
2306
2306
  var { URL: URL3 } = __require("url");
2307
2307
  var PerMessageDeflate3 = require_permessage_deflate();
@@ -2969,7 +2969,7 @@ var require_websocket = __commonJS({
2969
2969
  abortHandshake(websocket, socket, "Invalid Upgrade header");
2970
2970
  return;
2971
2971
  }
2972
- const digest = createHash28("sha1").update(key + GUID).digest("base64");
2972
+ const digest = createHash29("sha1").update(key + GUID).digest("base64");
2973
2973
  if (res.headers["sec-websocket-accept"] !== digest) {
2974
2974
  abortHandshake(websocket, socket, "Invalid Sec-WebSocket-Accept header");
2975
2975
  return;
@@ -3338,7 +3338,7 @@ var require_websocket_server = __commonJS({
3338
3338
  var EventEmitter6 = __require("events");
3339
3339
  var http11 = __require("http");
3340
3340
  var { Duplex } = __require("stream");
3341
- var { createHash: createHash28 } = __require("crypto");
3341
+ var { createHash: createHash29 } = __require("crypto");
3342
3342
  var extension3 = require_extension();
3343
3343
  var PerMessageDeflate3 = require_permessage_deflate();
3344
3344
  var subprotocol3 = require_subprotocol();
@@ -3645,7 +3645,7 @@ var require_websocket_server = __commonJS({
3645
3645
  );
3646
3646
  }
3647
3647
  if (this._state > RUNNING) return abortHandshake(socket, 503);
3648
- const digest = createHash28("sha1").update(key + GUID).digest("base64");
3648
+ const digest = createHash29("sha1").update(key + GUID).digest("base64");
3649
3649
  const headers = [
3650
3650
  "HTTP/1.1 101 Switching Protocols",
3651
3651
  "Upgrade: websocket",
@@ -31770,9 +31770,9 @@ function spanTimeInputToSeconds(input) {
31770
31770
  }
31771
31771
  return timestampInSeconds();
31772
31772
  }
31773
- function ensureTimestampInSeconds(timestamp) {
31774
- const isMs = timestamp > 9999999999;
31775
- return isMs ? timestamp / 1e3 : timestamp;
31773
+ function ensureTimestampInSeconds(timestamp2) {
31774
+ const isMs = timestamp2 > 9999999999;
31775
+ return isMs ? timestamp2 / 1e3 : timestamp2;
31776
31776
  }
31777
31777
  function spanToJSON(span) {
31778
31778
  if (spanIsSentrySpan(span)) {
@@ -34676,10 +34676,10 @@ function _INTERNAL_captureLog(beforeLog, currentScope = getCurrentScope(), captu
34676
34676
  return;
34677
34677
  }
34678
34678
  const { level, message, attributes: logAttributes = {}, severityNumber } = log3;
34679
- const timestamp = timestampInSeconds();
34680
- const sequenceAttr = getSequenceAttribute(timestamp);
34679
+ const timestamp2 = timestampInSeconds();
34680
+ const sequenceAttr = getSequenceAttribute(timestamp2);
34681
34681
  const serializedLog = {
34682
- timestamp,
34682
+ timestamp: timestamp2,
34683
34683
  level,
34684
34684
  body: _removeLoneSurrogates(String(message)),
34685
34685
  trace_id: traceContext?.trace_id,
@@ -35090,11 +35090,11 @@ var init_base = __esm({
35090
35090
  });
35091
35091
 
35092
35092
  // ../../../../node_modules/@sentry/core/build/esm/utils/clientreport.js
35093
- function createClientReportEnvelope(discarded_events, dsn, timestamp) {
35093
+ function createClientReportEnvelope(discarded_events, dsn, timestamp2) {
35094
35094
  const clientReportItem = [
35095
35095
  { type: "client_report" },
35096
35096
  {
35097
- timestamp: timestamp || dateTimestampInSeconds(),
35097
+ timestamp: timestamp2 || dateTimestampInSeconds(),
35098
35098
  discarded_events
35099
35099
  }
35100
35100
  ];
@@ -36614,8 +36614,8 @@ function addBreadcrumb(breadcrumb, hint) {
36614
36614
  if (!client) return;
36615
36615
  const { beforeBreadcrumb = null, maxBreadcrumbs = DEFAULT_BREADCRUMBS } = client.getOptions();
36616
36616
  if (maxBreadcrumbs <= 0) return;
36617
- const timestamp = dateTimestampInSeconds();
36618
- const mergedBreadcrumb = { timestamp, ...breadcrumb };
36617
+ const timestamp2 = dateTimestampInSeconds();
36618
+ const mergedBreadcrumb = { timestamp: timestamp2, ...breadcrumb };
36619
36619
  const finalBreadcrumb = beforeBreadcrumb ? consoleSandbox(() => beforeBreadcrumb(mergedBreadcrumb, hint)) : mergedBreadcrumb;
36620
36620
  if (finalBreadcrumb === null) return;
36621
36621
  if (client.emit) {
@@ -42696,8 +42696,8 @@ function recordRequestSession(client, {
42696
42696
  unregisterClientFlushHook();
42697
42697
  clientToRequestSessionAggregatesMap.delete(client);
42698
42698
  const aggregatePayload = Object.entries(newClientAggregate).map(
42699
- ([timestamp, value]) => ({
42700
- started: timestamp,
42699
+ ([timestamp2, value]) => ({
42700
+ started: timestamp2,
42701
42701
  exited: value.exited,
42702
42702
  errored: value.errored,
42703
42703
  crashed: value.crashed
@@ -54382,9 +54382,9 @@ function getSpanOptions(options) {
54382
54382
  startTime: fixedStartTime
54383
54383
  };
54384
54384
  }
54385
- function ensureTimestampInMilliseconds(timestamp) {
54386
- const isMs = timestamp < 9999999999;
54387
- return isMs ? timestamp * 1e3 : timestamp;
54385
+ function ensureTimestampInMilliseconds(timestamp2) {
54386
+ const isMs = timestamp2 < 9999999999;
54387
+ return isMs ? timestamp2 * 1e3 : timestamp2;
54388
54388
  }
54389
54389
  function patchSpanEnd(span) {
54390
54390
  const originalEnd = span.end.bind(span);
@@ -69730,9 +69730,9 @@ var init_sentry = __esm({
69730
69730
  uncaughtExceptionMonitorInstalled = false;
69731
69731
  currentDevboxSentryUser = null;
69732
69732
  readBuildMetadata = () => {
69733
- const rawPackageVersion = "1.0.1075";
69734
- const rawGitSha = "99e2a805b0c429e48af747f0f0c6d6dc71956f7b";
69735
- const rawSentryRelease = "boxes-dev-dvb@1.0.1075+99e2a805b0c429e48af747f0f0c6d6dc71956f7b";
69733
+ const rawPackageVersion = "1.0.1077";
69734
+ const rawGitSha = "8b1aec823d1569de8d7eba6b9f55b50c500f38de";
69735
+ const rawSentryRelease = "boxes-dev-dvb@1.0.1077+8b1aec823d1569de8d7eba6b9f55b50c500f38de";
69736
69736
  const packageVersion = typeof rawPackageVersion === "string" ? rawPackageVersion : void 0;
69737
69737
  const gitSha = typeof rawGitSha === "string" ? rawGitSha : void 0;
69738
69738
  const sentryRelease = typeof rawSentryRelease === "string" ? rawSentryRelease : void 0;
@@ -75116,7 +75116,7 @@ var init_packageVersion = __esm({
75116
75116
  return path18.join(process.cwd(), "dvb");
75117
75117
  };
75118
75118
  readEmbeddedPackageVersion = () => {
75119
- const raw = "1.0.1075";
75119
+ const raw = "1.0.1077";
75120
75120
  return trimVersion(raw);
75121
75121
  };
75122
75122
  readNearestPackageMetadata = (basePath) => {
@@ -80585,7 +80585,7 @@ var require_websocket2 = __commonJS({
80585
80585
  var http11 = __require("http");
80586
80586
  var net6 = __require("net");
80587
80587
  var tls2 = __require("tls");
80588
- var { randomBytes: randomBytes15, createHash: createHash28 } = __require("crypto");
80588
+ var { randomBytes: randomBytes15, createHash: createHash29 } = __require("crypto");
80589
80589
  var { Duplex, Readable: Readable3 } = __require("stream");
80590
80590
  var { URL: URL3 } = __require("url");
80591
80591
  var PerMessageDeflate3 = require_permessage_deflate2();
@@ -81253,7 +81253,7 @@ var require_websocket2 = __commonJS({
81253
81253
  abortHandshake(websocket, socket, "Invalid Upgrade header");
81254
81254
  return;
81255
81255
  }
81256
- const digest = createHash28("sha1").update(key + GUID).digest("base64");
81256
+ const digest = createHash29("sha1").update(key + GUID).digest("base64");
81257
81257
  if (res.headers["sec-websocket-accept"] !== digest) {
81258
81258
  abortHandshake(websocket, socket, "Invalid Sec-WebSocket-Accept header");
81259
81259
  return;
@@ -81622,7 +81622,7 @@ var require_websocket_server2 = __commonJS({
81622
81622
  var EventEmitter6 = __require("events");
81623
81623
  var http11 = __require("http");
81624
81624
  var { Duplex } = __require("stream");
81625
- var { createHash: createHash28 } = __require("crypto");
81625
+ var { createHash: createHash29 } = __require("crypto");
81626
81626
  var extension3 = require_extension2();
81627
81627
  var PerMessageDeflate3 = require_permessage_deflate2();
81628
81628
  var subprotocol3 = require_subprotocol2();
@@ -81929,7 +81929,7 @@ var require_websocket_server2 = __commonJS({
81929
81929
  );
81930
81930
  }
81931
81931
  if (this._state > RUNNING) return abortHandshake(socket, 503);
81932
- const digest = createHash28("sha1").update(key + GUID).digest("base64");
81932
+ const digest = createHash29("sha1").update(key + GUID).digest("base64");
81933
81933
  const headers = [
81934
81934
  "HTTP/1.1 101 Switching Protocols",
81935
81935
  "Upgrade: websocket",
@@ -85274,14 +85274,14 @@ var init_http_client = __esm({
85274
85274
  headers["Authorization"] = `Bearer ${this.auth}`;
85275
85275
  }
85276
85276
  const localFetch = this.fetch || specifiedFetch || fetch;
85277
- const timestamp = options.timestampPromise ? await options.timestampPromise : void 0;
85277
+ const timestamp2 = options.timestampPromise ? await options.timestampPromise : void 0;
85278
85278
  const body = JSON.stringify({
85279
85279
  path: name,
85280
85280
  format: "convex_encoded_json",
85281
85281
  args,
85282
- ...timestamp ? { ts: timestamp } : {}
85282
+ ...timestamp2 ? { ts: timestamp2 } : {}
85283
85283
  });
85284
- const endpoint = timestamp ? `${this.address}/api/query_at_ts` : `${this.address}/api/query`;
85284
+ const endpoint = timestamp2 ? `${this.address}/api/query_at_ts` : `${this.address}/api/query`;
85285
85285
  const response = await localFetch(endpoint, {
85286
85286
  ...this.fetchOptions,
85287
85287
  body,
@@ -88827,7 +88827,7 @@ var init_simple_client_node = __esm({
88827
88827
  var http11 = __require2("http");
88828
88828
  var net6 = __require2("net");
88829
88829
  var tls2 = __require2("tls");
88830
- var { randomBytes: randomBytes15, createHash: createHash28 } = __require2("crypto");
88830
+ var { randomBytes: randomBytes15, createHash: createHash29 } = __require2("crypto");
88831
88831
  var { Duplex, Readable: Readable3 } = __require2("stream");
88832
88832
  var { URL: URL3 } = __require2("url");
88833
88833
  var PerMessageDeflate3 = require_permessage_deflate3();
@@ -89484,7 +89484,7 @@ var init_simple_client_node = __esm({
89484
89484
  abortHandshake(websocket, socket, "Invalid Upgrade header");
89485
89485
  return;
89486
89486
  }
89487
- const digest = createHash28("sha1").update(key + GUID).digest("base64");
89487
+ const digest = createHash29("sha1").update(key + GUID).digest("base64");
89488
89488
  if (res.headers["sec-websocket-accept"] !== digest) {
89489
89489
  abortHandshake(websocket, socket, "Invalid Sec-WebSocket-Accept header");
89490
89490
  return;
@@ -89749,7 +89749,7 @@ var init_simple_client_node = __esm({
89749
89749
  var EventEmitter6 = __require2("events");
89750
89750
  var http11 = __require2("http");
89751
89751
  var { Duplex } = __require2("stream");
89752
- var { createHash: createHash28 } = __require2("crypto");
89752
+ var { createHash: createHash29 } = __require2("crypto");
89753
89753
  var extension3 = require_extension3();
89754
89754
  var PerMessageDeflate3 = require_permessage_deflate3();
89755
89755
  var subprotocol3 = require_subprotocol3();
@@ -90044,7 +90044,7 @@ var init_simple_client_node = __esm({
90044
90044
  );
90045
90045
  }
90046
90046
  if (this._state > RUNNING) return abortHandshake(socket, 503);
90047
- const digest = createHash28("sha1").update(key + GUID).digest("base64");
90047
+ const digest = createHash29("sha1").update(key + GUID).digest("base64");
90048
90048
  const headers = [
90049
90049
  "HTTP/1.1 101 Switching Protocols",
90050
90050
  "Upgrade: websocket",
@@ -98681,13 +98681,42 @@ var init_catalog = __esm({
98681
98681
  },
98682
98682
  {
98683
98683
  name: "maintenance",
98684
- summary: "Inspect or edit Template maintenance",
98684
+ summary: "Inspect Template maintenance, run history, and output",
98685
98685
  usage: ["dvb projects maintenance <command>"],
98686
98686
  notes: [
98687
98687
  "Author the maintenance script and GitHub watches together.",
98688
98688
  "Use boxes.dev managed environment files for credentials instead of putting secrets in scripts."
98689
98689
  ],
98690
98690
  children: [
98691
+ {
98692
+ name: "runs",
98693
+ summary: "Show active and recent maintenance runs",
98694
+ usage: [
98695
+ "dvb projects maintenance runs [--project <project>] [--json]"
98696
+ ],
98697
+ options: [
98698
+ flag("project", "Project name or fingerprint", {
98699
+ valueName: "project"
98700
+ }),
98701
+ flag("json", "Output the versioned JSON envelope")
98702
+ ]
98703
+ },
98704
+ {
98705
+ name: "logs",
98706
+ summary: "Show a maintenance run's recorded stdout/stderr tail",
98707
+ usage: [
98708
+ "dvb projects maintenance logs --run <run-id> [--project <project>] [--json]"
98709
+ ],
98710
+ options: [
98711
+ flag("run", "Recorded run ID from maintenance runs", {
98712
+ valueName: "run-id"
98713
+ }),
98714
+ flag("project", "Project name or fingerprint", {
98715
+ valueName: "project"
98716
+ }),
98717
+ flag("json", "Output the versioned JSON envelope")
98718
+ ]
98719
+ },
98691
98720
  {
98692
98721
  name: "get",
98693
98722
  summary: "Show the maintenance script and GitHub watches",
@@ -100037,9 +100066,9 @@ var init_completions = __esm({
100037
100066
  }
100038
100067
  return true;
100039
100068
  };
100040
- isStale = (timestamp, ttlMs) => {
100041
- if (!timestamp) return true;
100042
- const parsed = Date.parse(timestamp);
100069
+ isStale = (timestamp2, ttlMs) => {
100070
+ if (!timestamp2) return true;
100071
+ const parsed = Date.parse(timestamp2);
100043
100072
  if (!Number.isFinite(parsed)) return true;
100044
100073
  return Date.now() - parsed > ttlMs;
100045
100074
  };
@@ -106366,9 +106395,9 @@ var init_listFormatting = __esm({
106366
106395
  return parsed.getTime();
106367
106396
  };
106368
106397
  formatRelativeTime = (value, now = Date.now()) => {
106369
- const timestamp = parseIsoTimestamp(value);
106370
- if (timestamp === null) return { text: "-", isNow: false };
106371
- const deltaMs = now - timestamp;
106398
+ const timestamp2 = parseIsoTimestamp(value);
106399
+ if (timestamp2 === null) return { text: "-", isNow: false };
106400
+ const deltaMs = now - timestamp2;
106372
106401
  if (deltaMs <= 6e4) return { text: "now", isNow: true };
106373
106402
  const minutes = Math.floor(deltaMs / 6e4);
106374
106403
  if (minutes < 60) return { text: `${minutes}m`, isNow: false };
@@ -112743,8 +112772,8 @@ var require_timestamp = __commonJS({
112743
112772
  function timestampFromDate(date9) {
112744
112773
  return timestampFromMs(date9.getTime());
112745
112774
  }
112746
- function timestampDate(timestamp) {
112747
- return new Date(timestampMs(timestamp));
112775
+ function timestampDate(timestamp2) {
112776
+ return new Date(timestampMs(timestamp2));
112748
112777
  }
112749
112778
  function timestampFromMs(timestampMs2) {
112750
112779
  const seconds = Math.floor(timestampMs2 / 1e3);
@@ -112753,8 +112782,8 @@ var require_timestamp = __commonJS({
112753
112782
  nanos: (timestampMs2 - seconds * 1e3) * 1e6
112754
112783
  });
112755
112784
  }
112756
- function timestampMs(timestamp) {
112757
- return Number(timestamp.seconds) * 1e3 + Math.round(timestamp.nanos / 1e6);
112785
+ function timestampMs(timestamp2) {
112786
+ return Number(timestamp2.seconds) * 1e3 + Math.round(timestamp2.nanos / 1e6);
112758
112787
  }
112759
112788
  }
112760
112789
  });
@@ -114650,28 +114679,28 @@ var require_from_json = __commonJS({
114650
114679
  }
114651
114680
  (0, index_js_1.anyPack)(msg.desc, msg.message, any3);
114652
114681
  }
114653
- function timestampFromJson(timestamp, json3) {
114682
+ function timestampFromJson(timestamp2, json3) {
114654
114683
  if (typeof json3 !== "string") {
114655
- throw new Error(`cannot decode message ${timestamp.$typeName} from JSON: ${(0, reflect_check_js_1.formatVal)(json3)}`);
114684
+ throw new Error(`cannot decode message ${timestamp2.$typeName} from JSON: ${(0, reflect_check_js_1.formatVal)(json3)}`);
114656
114685
  }
114657
114686
  const matches2 = json3.match(/^([0-9]{4})-([0-9]{2})-([0-9]{2})T([0-9]{2}):([0-9]{2}):([0-9]{2})(?:\.([0-9]{1,9}))?(?:Z|([+-][0-9][0-9]:[0-9][0-9]))$/);
114658
114687
  if (!matches2) {
114659
- throw new Error(`cannot decode message ${timestamp.$typeName} from JSON: invalid RFC 3339 string`);
114688
+ throw new Error(`cannot decode message ${timestamp2.$typeName} from JSON: invalid RFC 3339 string`);
114660
114689
  }
114661
114690
  const ms = Date.parse(
114662
114691
  // biome-ignore format: want this to read well
114663
114692
  matches2[1] + "-" + matches2[2] + "-" + matches2[3] + "T" + matches2[4] + ":" + matches2[5] + ":" + matches2[6] + (matches2[8] ? matches2[8] : "Z")
114664
114693
  );
114665
114694
  if (Number.isNaN(ms)) {
114666
- throw new Error(`cannot decode message ${timestamp.$typeName} from JSON: invalid RFC 3339 string`);
114695
+ throw new Error(`cannot decode message ${timestamp2.$typeName} from JSON: invalid RFC 3339 string`);
114667
114696
  }
114668
114697
  if (ms < Date.parse("0001-01-01T00:00:00Z") || ms > Date.parse("9999-12-31T23:59:59Z")) {
114669
- throw new Error(`cannot decode message ${timestamp.$typeName} from JSON: must be from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59Z inclusive`);
114698
+ throw new Error(`cannot decode message ${timestamp2.$typeName} from JSON: must be from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59Z inclusive`);
114670
114699
  }
114671
- timestamp.seconds = proto_int64_js_1.protoInt64.parse(ms / 1e3);
114672
- timestamp.nanos = 0;
114700
+ timestamp2.seconds = proto_int64_js_1.protoInt64.parse(ms / 1e3);
114701
+ timestamp2.nanos = 0;
114673
114702
  if (matches2[7]) {
114674
- timestamp.nanos = parseInt("1" + matches2[7] + "0".repeat(9 - matches2[7].length)) - 1e9;
114703
+ timestamp2.nanos = parseInt("1" + matches2[7] + "0".repeat(9 - matches2[7].length)) - 1e9;
114675
114704
  }
114676
114705
  }
114677
114706
  function durationFromJson(duration5, json3) {
@@ -127230,8 +127259,8 @@ var require_dist3 = __commonJS({
127230
127259
  const hashArray = new Uint8Array(hashBuffer);
127231
127260
  return btoa(String.fromCharCode(...hashArray));
127232
127261
  }
127233
- const { createHash: createHash28 } = __require("crypto");
127234
- const hash3 = createHash28("sha256").update(data, "utf8").digest();
127262
+ const { createHash: createHash29 } = __require("crypto");
127263
+ const hash3 = createHash29("sha256").update(data, "utf8").digest();
127235
127264
  return hash3.toString("base64");
127236
127265
  }
127237
127266
  function timeoutToSeconds(timeout) {
@@ -131294,8 +131323,8 @@ ${err.stdout}`.toLowerCase();
131294
131323
  Sandbox2.defaultSandboxTimeoutMs = DEFAULT_SANDBOX_TIMEOUT_MS;
131295
131324
  var import_chalk6 = __toESM4((init_source(), __toCommonJS(source_exports)));
131296
131325
  var LogEntry = class {
131297
- constructor(timestamp, level, message) {
131298
- this.timestamp = timestamp;
131326
+ constructor(timestamp2, level, message) {
131327
+ this.timestamp = timestamp2;
131299
131328
  this.level = level;
131300
131329
  this.message = message;
131301
131330
  }
@@ -131306,13 +131335,13 @@ ${err.stdout}`.toLowerCase();
131306
131335
  }
131307
131336
  };
131308
131337
  var LogEntryStart = class extends LogEntry {
131309
- constructor(timestamp, message) {
131310
- super(timestamp, "debug", message);
131338
+ constructor(timestamp2, message) {
131339
+ super(timestamp2, "debug", message);
131311
131340
  }
131312
131341
  };
131313
131342
  var LogEntryEnd = class extends LogEntry {
131314
- constructor(timestamp, message) {
131315
- super(timestamp, "debug", message);
131343
+ constructor(timestamp2, message) {
131344
+ super(timestamp2, "debug", message);
131316
131345
  }
131317
131346
  };
131318
131347
  var TIMER_UPDATE_INTERVAL_MS = 150;
@@ -131371,7 +131400,7 @@ ${err.stdout}`.toLowerCase();
131371
131400
  }
131372
131401
  formatLogLine(line) {
131373
131402
  const timer = this.formatTimerLine().padEnd(5);
131374
- const timestamp = import_chalk6.default.dim(
131403
+ const timestamp2 = import_chalk6.default.dim(
131375
131404
  line.timestamp.toLocaleTimeString(void 0, {
131376
131405
  hour: "2-digit",
131377
131406
  minute: "2-digit",
@@ -131380,7 +131409,7 @@ ${err.stdout}`.toLowerCase();
131380
131409
  );
131381
131410
  const level = levels[line.level] || levels[DEFAULT_LEVEL];
131382
131411
  const msg = line.message;
131383
- return `${timer} | ${timestamp} ${level} ${msg}`;
131412
+ return `${timer} | ${timestamp2} ${level} ${msg}`;
131384
131413
  }
131385
131414
  startTimer() {
131386
131415
  if (!process.stdout.isTTY) {
@@ -131408,7 +131437,7 @@ ${err.stdout}`.toLowerCase();
131408
131437
  const buildLogger = new DefaultBuildLogger(options == null ? void 0 : options.minLevel);
131409
131438
  return buildLogger.logger.bind(buildLogger);
131410
131439
  }
131411
- var import_node_crypto63 = __toESM4(__require("crypto"));
131440
+ var import_node_crypto64 = __toESM4(__require("crypto"));
131412
131441
  var import_node_fs27 = __toESM4(__require("fs"));
131413
131442
  var import_node_path112 = __toESM4(__require("path"));
131414
131443
  var FINALIZE_STEP_NAME = "finalize";
@@ -131496,7 +131525,7 @@ ${err.stdout}`.toLowerCase();
131496
131525
  }
131497
131526
  async function calculateFilesHash(src, dest, contextPath, ignorePatterns, resolveSymlinks, stackTrace) {
131498
131527
  const srcPath = import_node_path112.default.join(contextPath, src);
131499
- const hash3 = import_node_crypto63.default.createHash("sha256");
131528
+ const hash3 = import_node_crypto64.default.createHash("sha256");
131500
131529
  const content = `COPY ${src} ${dest}`;
131501
131530
  hash3.update(content);
131502
131531
  const files = await getAllFilesInPath(src, contextPath, ignorePatterns, true);
@@ -141947,7 +141976,7 @@ var init_threadStartProgress = __esm({
141947
141976
  case "copying_state":
141948
141977
  return {
141949
141978
  stage,
141950
- label: "Copying machine state",
141979
+ label: "Copying box state",
141951
141980
  currentStep: 2,
141952
141981
  totalSteps: TOTAL_STEPS
141953
141982
  };
@@ -142532,6 +142561,34 @@ var init_projectLifecycleMaintenance = __esm({
142532
142561
  }
142533
142562
  });
142534
142563
 
142564
+ // ../../../../shared/projectConfiguration/maintenanceHistory.ts
142565
+ var timestamp, renderMaintenanceRun, renderMaintenanceRunHistory, renderMaintenanceRunLogs;
142566
+ var init_maintenanceHistory = __esm({
142567
+ "../../../../shared/projectConfiguration/maintenanceHistory.ts"() {
142568
+ "use strict";
142569
+ timestamp = (value) => value === null ? "not recorded" : new Date(value).toISOString();
142570
+ renderMaintenanceRun = (run2) => [
142571
+ `Run: ${run2.publicRunId}`,
142572
+ `Status: ${run2.status}${run2.phase ? ` (${run2.phase})` : ""}`,
142573
+ `Triggers: ${run2.triggerSources.join(", ")}`,
142574
+ `Requested: ${timestamp(run2.requestedAt)}`,
142575
+ `Due: ${timestamp(run2.dueAt)}`,
142576
+ `Started: ${timestamp(run2.startedAt)}`,
142577
+ `Finished: ${timestamp(run2.finishedAt)}`,
142578
+ `Script: ${run2.scriptStatus}; exit code: ${run2.scriptExitCode ?? "not recorded"}`,
142579
+ ...run2.failureDetail ? [`Failure: ${run2.failureCode}: ${run2.failureDetail}`] : [],
142580
+ ...run2.cleanupDetail ? [`Cleanup: ${run2.cleanupDetail}`] : [],
142581
+ ...run2.snapshotDetail ? [`Snapshot: ${run2.snapshotDetail}`] : [],
142582
+ ...run2.indeterminate ? ["The final script result is unknown."] : []
142583
+ ].join("\n");
142584
+ renderMaintenanceRunHistory = (history) => history.runs.length === 0 ? "No recorded maintenance runs." : history.runs.map(renderMaintenanceRun).join("\n\n");
142585
+ renderMaintenanceRunLogs = (logs) => `${renderMaintenanceRun(logs.run)}
142586
+
142587
+ Combined stdout/stderr tail (up to ${String(logs.outputLimitCharacters)} characters):
142588
+ ${logs.outputTail || "(no recorded output)"}`;
142589
+ }
142590
+ });
142591
+
142535
142592
  // ../../../../shared/threadRuntime/threadInventory.ts
142536
142593
  var init_threadInventory = __esm({
142537
142594
  "../../../../shared/threadRuntime/threadInventory.ts"() {
@@ -142557,6 +142614,7 @@ var init_threadInventory = __esm({
142557
142614
  init_threadListPresentation();
142558
142615
  init_threadListWindowData();
142559
142616
  init_projectLifecycleMaintenance();
142617
+ init_maintenanceHistory();
142560
142618
  }
142561
142619
  });
142562
142620
 
@@ -142862,6 +142920,7 @@ var init_errors5 = __esm({
142862
142920
  "watch_removal_confirmation_required",
142863
142921
  "github_connection_required",
142864
142922
  "github_repository_access_required",
142923
+ "maintenance_run_not_found",
142865
142924
  "service_update_required",
142866
142925
  "invalid_delivery_policy",
142867
142926
  "port_not_eligible",
@@ -238487,18 +238546,116 @@ var init_scanOutputs = __esm({
238487
238546
  }
238488
238547
  });
238489
238548
 
238549
+ // ../../../../shared/initPrep/src/gitSigningProfiles.mjs
238550
+ import { createHash as createHash16 } from "node:crypto";
238551
+ var normalizeGitSigningFormat, buildIdentityWarnings, buildProfileId, createManagedGitSigningRepoPlan;
238552
+ var init_gitSigningProfiles = __esm({
238553
+ "../../../../shared/initPrep/src/gitSigningProfiles.mjs"() {
238554
+ "use strict";
238555
+ init_devboxCore2();
238556
+ normalizeGitSigningFormat = (rawFormat) => {
238557
+ if (!rawFormat || rawFormat.trim().length === 0) {
238558
+ return { format: "openpgp", unsupportedFormat: null };
238559
+ }
238560
+ const normalized = rawFormat.trim().toLowerCase();
238561
+ if (normalized === "openpgp" || normalized === "ssh") {
238562
+ return { format: normalized, unsupportedFormat: null };
238563
+ }
238564
+ return { format: null, unsupportedFormat: rawFormat.trim() };
238565
+ };
238566
+ buildIdentityWarnings = (email5) => email5.toLowerCase().endsWith("@users.noreply.github.com") ? ["noreply_email"] : [];
238567
+ buildProfileId = ({
238568
+ fingerprint,
238569
+ format: format2,
238570
+ signingKey,
238571
+ userEmail,
238572
+ userName
238573
+ }) => createHash16("sha256").update(
238574
+ JSON.stringify({ fingerprint, format: format2, signingKey, userEmail, userName })
238575
+ ).digest("hex").slice(0, 16);
238576
+ createManagedGitSigningRepoPlan = async ({
238577
+ accountScope,
238578
+ env: env3,
238579
+ format: format2,
238580
+ homeDir: homeDir2,
238581
+ repo
238582
+ }) => {
238583
+ for (const [key2, value] of [
238584
+ ["user.name", repo.userName],
238585
+ ["user.email", repo.userEmail]
238586
+ ]) {
238587
+ if (!value) {
238588
+ throw new Error(
238589
+ `Git signing requires ${key2} in ${repo.repoDisplayName}. Set your Git name and email in that repository, then retry. Or skip Git signing setup.`
238590
+ );
238591
+ }
238592
+ }
238593
+ const key = format2 === "openpgp" ? await ensureGitSigningOpenPgpKey({
238594
+ accountScope,
238595
+ env: env3,
238596
+ homeDir: homeDir2,
238597
+ userName: repo.userName,
238598
+ userEmail: repo.userEmail
238599
+ }) : await ensureGitRemoteSshKey({ accountScope, homeDir: homeDir2 });
238600
+ const fingerprint = format2 === "openpgp" ? key.fingerprint : key.publicKeyFingerprint;
238601
+ const signingKey = format2 === "openpgp" ? key.fingerprint : key.publicKeyPath;
238602
+ const profile = {
238603
+ id: buildProfileId({
238604
+ fingerprint,
238605
+ format: format2,
238606
+ signingKey,
238607
+ userName: repo.userName,
238608
+ userEmail: repo.userEmail
238609
+ }),
238610
+ format: format2,
238611
+ userName: repo.userName,
238612
+ userEmail: repo.userEmail,
238613
+ signingKey,
238614
+ publicKeyFingerprint: fingerprint,
238615
+ publicKeyBlock: format2 === "openpgp" ? key.publicKeyBlock : key.publicKey,
238616
+ publicKeyPaths: format2 === "openpgp" ? [] : [key.publicKeyPath],
238617
+ privateKeyPath: format2 === "openpgp" ? null : key.privateKeyPath,
238618
+ gnupgHome: format2 === "openpgp" ? key.gpgHome : null,
238619
+ keyType: format2 === "openpgp" ? null : "ed25519",
238620
+ // A generated boxes.dev key does not establish a personal profile to copy.
238621
+ copyAvailability: {
238622
+ available: false,
238623
+ material: null,
238624
+ sourcePaths: [],
238625
+ passphraseProtected: null,
238626
+ reason: format2 === "openpgp" ? "missing_openpgp_secret_key" : "missing_ssh_private_key",
238627
+ detail: "No complete local Git signing profile was found to copy."
238628
+ },
238629
+ identityWarnings: buildIdentityWarnings(repo.userEmail)
238630
+ };
238631
+ return {
238632
+ ...repo,
238633
+ format: format2,
238634
+ signingKey,
238635
+ status: "ready",
238636
+ profileId: profile.id,
238637
+ reason: null,
238638
+ incompleteReason: null,
238639
+ outOfScopeReason: null,
238640
+ profile
238641
+ };
238642
+ };
238643
+ }
238644
+ });
238645
+
238490
238646
  // ../../../../shared/initPrep/src/gitSigning.mjs
238491
238647
  import { execFile as execFile6, spawn as spawn18 } from "node:child_process";
238492
- import { createHash as createHash16, randomUUID as randomUUID23 } from "node:crypto";
238648
+ import { createHash as createHash17, randomUUID as randomUUID23 } from "node:crypto";
238493
238649
  import fs43 from "node:fs/promises";
238494
238650
  import os22 from "node:os";
238495
238651
  import path52 from "node:path";
238496
- var uniqueStrings2, trim9, buildSpawnEnv2, runLocalCommand2, runCommandOrThrow, isMissingCommandError, readEffectiveGitConfig, normalizeGitSigningFormat, buildIdentityWarnings, buildProfileId, normalizeOpenPgpSelector, openPgpKeyMatchesSelector, openPgpKeyMatchesEmail, parseGpgSecretKeyListing, detectOpenPgpPassphraseProtected, inspectOpenPgpKeys, getOpenPgpCopyAvailability, expandUserPath, resolveSigningKeyPath, readFileIfExists3, isPublicSshKeyLine, parseSshPublicKey, missingSshPrivateKeyCopyAvailability, inspectLiteralSshPublicKey, inspectPublicSshKeyFile, inspectPrivateSshKeyFile, inspectSshSigningKey, buildIncompleteRepoPlan, detectOpenPgpRepoPlan, detectSshRepoPlan, detectGitSigningRepoPlan, profileKey, collectProfiles, computeRemoteConfigScope, deriveSetupStatus, collectCopyUnavailableReasons, collectWarnings, detectDesktopGitSigningSetup, parseGitRemoteHost2, hostsByProfile, dedupePublicKeys, registrationStatusFor, buildProfilePublicKey, buildSigningPublicKeys, createDesktopGitSigningDecisionFromPlan, assertOpenPgpToolsAvailable, validateModeSelection, buildSelectedDesktopGitSigningDecision, ensureFreshDir, throwSourceMissing, normalizeArchivePath, shouldExcludeGpgEntry, copyFileStrict, copyGpgHome, hashFile, assertCopyAvailable, prepareOpenPgpProfile, prepareSshProfile, prepareGitSigningPayload, relativeFromStagingRoot, stageDesktopGitSigningPayload;
238652
+ var uniqueStrings2, trim9, buildSpawnEnv2, runLocalCommand2, runCommandOrThrow, isMissingCommandError, readEffectiveGitConfig, normalizeOpenPgpSelector, openPgpKeyMatchesSelector, openPgpKeyMatchesEmail, parseGpgSecretKeyListing, detectOpenPgpPassphraseProtected, inspectOpenPgpKeys, getOpenPgpCopyAvailability, expandUserPath, resolveSigningKeyPath, readFileIfExists3, isPublicSshKeyLine, parseSshPublicKey, missingSshPrivateKeyCopyAvailability, inspectLiteralSshPublicKey, inspectPublicSshKeyFile, inspectPrivateSshKeyFile, inspectSshSigningKey, buildIncompleteRepoPlan, detectOpenPgpRepoPlan, detectSshRepoPlan, detectGitSigningRepoPlan, profileKey, collectProfiles, computeRemoteConfigScope, deriveSetupStatus, collectCopyUnavailableReasons, collectWarnings, buildGitSigningSetupPlan, detectDesktopGitSigningSetup, parseGitRemoteHost2, hostsByProfile, dedupePublicKeys, registrationStatusFor, buildProfilePublicKey, buildSigningPublicKeys, createDesktopGitSigningDecisionFromPlan, assertOpenPgpToolsAvailable, validateModeSelection, buildCreateGitSigningPlan, buildSelectedDesktopGitSigningDecision, ensureFreshDir, throwSourceMissing, normalizeArchivePath, shouldExcludeGpgEntry, copyFileStrict, copyGpgHome, hashFile, assertCopyAvailable, prepareOpenPgpProfile, prepareSshProfile, prepareGitSigningPayload, relativeFromStagingRoot, stageDesktopGitSigningPayload;
238497
238653
  var init_gitSigning2 = __esm({
238498
238654
  "../../../../shared/initPrep/src/gitSigning.mjs"() {
238499
238655
  "use strict";
238500
238656
  init_devboxCore2();
238501
238657
  init_gitPathStream();
238658
+ init_gitSigningProfiles();
238502
238659
  uniqueStrings2 = (values) => [...new Set(values)];
238503
238660
  trim9 = (value) => typeof value === "string" ? value.trim() : "";
238504
238661
  buildSpawnEnv2 = (env3) => env3 ? { ...process.env, ...env3 } : process.env;
@@ -238566,29 +238723,6 @@ var init_gitSigning2 = __esm({
238566
238723
  const value = result.stdout.trim();
238567
238724
  return value.length > 0 ? value : null;
238568
238725
  };
238569
- normalizeGitSigningFormat = (rawFormat) => {
238570
- if (!rawFormat || rawFormat.trim().length === 0) {
238571
- return { format: "openpgp", unsupportedFormat: null };
238572
- }
238573
- const normalized = rawFormat.trim().toLowerCase();
238574
- if (normalized === "openpgp") {
238575
- return { format: "openpgp", unsupportedFormat: null };
238576
- }
238577
- if (normalized === "ssh") {
238578
- return { format: "ssh", unsupportedFormat: null };
238579
- }
238580
- return { format: null, unsupportedFormat: rawFormat.trim() };
238581
- };
238582
- buildIdentityWarnings = (email5) => email5.toLowerCase().endsWith("@users.noreply.github.com") ? ["noreply_email"] : [];
238583
- buildProfileId = ({
238584
- fingerprint,
238585
- format: format2,
238586
- signingKey,
238587
- userEmail,
238588
- userName
238589
- }) => createHash16("sha256").update(
238590
- JSON.stringify({ fingerprint, format: format2, signingKey, userEmail, userName })
238591
- ).digest("hex").slice(0, 16);
238592
238726
  normalizeOpenPgpSelector = (value) => value.trim().replace(/^0x/iu, "").replace(/!$/u, "").toUpperCase();
238593
238727
  openPgpKeyMatchesSelector = (key, selector) => {
238594
238728
  const normalized = normalizeOpenPgpSelector(selector);
@@ -238835,7 +238969,7 @@ var init_gitSigning2 = __esm({
238835
238969
  try {
238836
238970
  const blob = Buffer.from(keyBlob, "base64");
238837
238971
  if (blob.length === 0) return null;
238838
- const fingerprint = createHash16("sha256").update(blob).digest("base64").replace(/=+$/u, "");
238972
+ const fingerprint = createHash17("sha256").update(blob).digest("base64").replace(/=+$/u, "");
238839
238973
  return {
238840
238974
  keyType,
238841
238975
  publicKey: value.trim(),
@@ -239427,16 +239561,7 @@ var init_gitSigning2 = __esm({
239427
239561
  }
239428
239562
  return warnings;
239429
239563
  };
239430
- detectDesktopGitSigningSetup = async ({
239431
- env: env3,
239432
- homeDir: homeDir2 = os22.homedir(),
239433
- projectLayout
239434
- }) => {
239435
- const repos = await Promise.all(
239436
- projectLayout.repos.map(
239437
- (repo) => detectGitSigningRepoPlan({ env: env3, homeDir: homeDir2, repo })
239438
- )
239439
- );
239564
+ buildGitSigningSetupPlan = (repos) => {
239440
239565
  const profiles = collectProfiles(repos);
239441
239566
  const readyRepos = repos.filter((repo) => repo.status === "ready");
239442
239567
  const formats = uniqueStrings2(
@@ -239461,6 +239586,17 @@ var init_gitSigning2 = __esm({
239461
239586
  }
239462
239587
  };
239463
239588
  };
239589
+ detectDesktopGitSigningSetup = async ({
239590
+ env: env3,
239591
+ homeDir: homeDir2 = os22.homedir(),
239592
+ projectLayout
239593
+ }) => buildGitSigningSetupPlan(
239594
+ await Promise.all(
239595
+ projectLayout.repos.map(
239596
+ (repo) => detectGitSigningRepoPlan({ env: env3, homeDir: homeDir2, repo })
239597
+ )
239598
+ )
239599
+ );
239464
239600
  parseGitRemoteHost2 = (origin) => {
239465
239601
  const value = trim9(origin);
239466
239602
  if (!value) return null;
@@ -239642,7 +239778,7 @@ var init_gitSigning2 = __esm({
239642
239778
  const formats = plan ? plan.profiles.length > 0 ? plan.profiles.map((profile) => profile.format) : plan.repos.map(
239643
239779
  (repo) => normalizeGitSigningFormat(repo.rawFormat).format
239644
239780
  ) : [];
239645
- if (formats.includes("openpgp")) {
239781
+ if (mode === "copy" && formats.includes("openpgp")) {
239646
239782
  await assertOpenPgpToolsAvailable({ env: env3, projectLayout });
239647
239783
  }
239648
239784
  if (!plan || plan.status !== "ready" || plan.profiles.length === 0) {
@@ -239666,6 +239802,41 @@ var init_gitSigning2 = __esm({
239666
239802
  }
239667
239803
  }
239668
239804
  };
239805
+ buildCreateGitSigningPlan = async ({
239806
+ accountScope,
239807
+ env: env3,
239808
+ homeDir: homeDir2,
239809
+ plan,
239810
+ projectLayout
239811
+ }) => {
239812
+ const signingEnabled = plan.repos.some((repo) => repo.commitGpgSign);
239813
+ const targets = plan.repos.filter(
239814
+ (repo) => !signingEnabled || repo.commitGpgSign
239815
+ );
239816
+ if (targets.some(
239817
+ (repo) => normalizeGitSigningFormat(repo.rawFormat).format === "openpgp"
239818
+ )) {
239819
+ await assertOpenPgpToolsAvailable({ env: env3, projectLayout });
239820
+ }
239821
+ const profilesById = new Map(
239822
+ plan.profiles.map((profile) => [profile.id, profile])
239823
+ );
239824
+ const repos = [];
239825
+ for (const repo of plan.repos) {
239826
+ const profile = profilesById.get(repo.profileId);
239827
+ const { format: format2 } = normalizeGitSigningFormat(repo.rawFormat);
239828
+ repos.push(
239829
+ profile || !targets.includes(repo) || !format2 ? { ...repo, profile } : await createManagedGitSigningRepoPlan({
239830
+ accountScope,
239831
+ env: env3,
239832
+ format: format2,
239833
+ homeDir: homeDir2,
239834
+ repo
239835
+ })
239836
+ );
239837
+ }
239838
+ return buildGitSigningSetupPlan(repos);
239839
+ };
239669
239840
  buildSelectedDesktopGitSigningDecision = async ({
239670
239841
  accountScope,
239671
239842
  copyConfirmed,
@@ -239676,13 +239847,22 @@ var init_gitSigning2 = __esm({
239676
239847
  projectLayout
239677
239848
  }) => {
239678
239849
  let plan = previousDecision?.plan ?? null;
239679
- if (mode !== "skip" && plan && plan.profiles.length === 0) {
239850
+ if (mode === "copy" || mode !== "skip" && (!plan || plan.profiles.length === 0)) {
239680
239851
  plan = await detectDesktopGitSigningSetup({
239681
239852
  env: env3,
239682
239853
  homeDir: homeDir2,
239683
239854
  projectLayout
239684
239855
  });
239685
239856
  }
239857
+ if (mode === "create") {
239858
+ plan = await buildCreateGitSigningPlan({
239859
+ accountScope,
239860
+ env: env3,
239861
+ homeDir: homeDir2,
239862
+ plan,
239863
+ projectLayout
239864
+ });
239865
+ }
239686
239866
  await validateModeSelection({
239687
239867
  copyConfirmed,
239688
239868
  env: env3,
@@ -239780,7 +239960,7 @@ var init_gitSigning2 = __esm({
239780
239960
  }
239781
239961
  };
239782
239962
  hashFile = async (filePath) => {
239783
- const hash3 = createHash16("sha256");
239963
+ const hash3 = createHash17("sha256");
239784
239964
  const bytes = await fs43.readFile(filePath);
239785
239965
  hash3.update(bytes);
239786
239966
  return { bytes: bytes.length, sha256: hash3.digest("hex") };
@@ -240460,7 +240640,7 @@ var init_untrackedFileTree = __esm({
240460
240640
  });
240461
240641
 
240462
240642
  // ../../../../shared/initPrep/src/editableSetupFileStaging.mjs
240463
- import { createHash as createHash17 } from "node:crypto";
240643
+ import { createHash as createHash18 } from "node:crypto";
240464
240644
  import fs46 from "node:fs/promises";
240465
240645
  import path55 from "node:path";
240466
240646
  var EDITABLE_SETUP_FILE_MAX_BYTES, STAGING_FILE_SUFFIXES, resolveStagingFileSuffix, deriveEditableSetupFileStagingId, resolveEditableSetupFileStagingPath, ensurePrivateStagingDir, readEligibleSourceFile, snapshotEditableSetupFile, readEditableSetupFileContents, writeEditableSetupFileContents, deleteEditableSetupFile, pruneEditableSetupFilesByKind;
@@ -240481,7 +240661,7 @@ var init_editableSetupFileStaging = __esm({
240481
240661
  }
240482
240662
  return suffix;
240483
240663
  };
240484
- deriveEditableSetupFileStagingId = ({ namespace, sourcePath }) => createHash17("sha256").update(`${namespace}\0${sourcePath}`, "utf8").digest("hex").slice(0, 32);
240664
+ deriveEditableSetupFileStagingId = ({ namespace, sourcePath }) => createHash18("sha256").update(`${namespace}\0${sourcePath}`, "utf8").digest("hex").slice(0, 32);
240485
240665
  resolveEditableSetupFileStagingPath = ({
240486
240666
  id: id2,
240487
240667
  kind,
@@ -240741,7 +240921,7 @@ var init_untrackedFileRules = __esm({
240741
240921
  import { execFile as execFile7, spawn as spawn19 } from "node:child_process";
240742
240922
  import {
240743
240923
  createCipheriv,
240744
- createHash as createHash18,
240924
+ createHash as createHash19,
240745
240925
  createPublicKey,
240746
240926
  diffieHellman,
240747
240927
  generateKeyPairSync,
@@ -242374,7 +242554,7 @@ var init_localPrepService = __esm({
242374
242554
  upload: state.upload,
242375
242555
  bundleOptions: state.bundleOptions ?? createBundleOptions(),
242376
242556
  forkStartupScript: state.forkStartupScript ?? createForkStartupScriptSetup({ repo: state.repo }),
242377
- initialProjectConfigurationHash: state.initialProjectConfiguration ? createHash18("sha256").update(JSON.stringify(state.initialProjectConfiguration), "utf8").digest("hex") : null,
242557
+ initialProjectConfigurationHash: state.initialProjectConfiguration ? createHash19("sha256").update(JSON.stringify(state.initialProjectConfiguration), "utf8").digest("hex") : null,
242378
242558
  gitSigningSetup: state.gitSigningSetup ?? null,
242379
242559
  setupReviewState: state.setupReviewState ?? null,
242380
242560
  githubAccessMode: state.githubAccessMode ?? null,
@@ -244535,7 +244715,7 @@ var init_localPrepService = __esm({
244535
244715
  return (await fs48.stat(outputPath)).size;
244536
244716
  };
244537
244717
  sha256File3 = async (filePath) => {
244538
- const hash3 = createHash18("sha256");
244718
+ const hash3 = createHash19("sha256");
244539
244719
  const handle = await fs48.open(filePath, "r");
244540
244720
  try {
244541
244721
  for await (const chunk2 of handle.createReadStream()) {
@@ -244558,7 +244738,7 @@ var init_localPrepService = __esm({
244558
244738
  const authTag = cipher.getAuthTag();
244559
244739
  const encryptedSizeBytes = (await fs48.stat(outputPath)).size;
244560
244740
  const ciphertextSha256 = await sha256File3(outputPath);
244561
- const dataKeySha256 = createHash18("sha256").update(dataKey).digest("hex");
244741
+ const dataKeySha256 = createHash19("sha256").update(dataKey).digest("hex");
244562
244742
  return {
244563
244743
  dataKey,
244564
244744
  dataKeySha256,
@@ -244619,7 +244799,7 @@ var init_localPrepService = __esm({
244619
244799
  remotePublicKeyId: remotePublicKey.id,
244620
244800
  algorithm: "x25519-aes-256-gcm",
244621
244801
  envelopeCiphertextBase64: envelopePayload.toString("base64"),
244622
- envelopeSha256: createHash18("sha256").update(envelopePayload).digest("hex"),
244802
+ envelopeSha256: createHash19("sha256").update(envelopePayload).digest("hex"),
244623
244803
  createdAt: nowIso7()
244624
244804
  };
244625
244805
  };
@@ -244644,8 +244824,8 @@ var init_localPrepService = __esm({
244644
244824
  completedParts: []
244645
244825
  } : null;
244646
244826
  shouldRefreshMultipartUploadUrlsBeforeUpload = (expiresAt) => {
244647
- const timestamp = Date.parse(trim10(expiresAt));
244648
- return !Number.isFinite(timestamp) || timestamp - Date.now() <= MULTIPART_UPLOAD_URL_REFRESH_SKEW_MS;
244827
+ const timestamp2 = Date.parse(trim10(expiresAt));
244828
+ return !Number.isFinite(timestamp2) || timestamp2 - Date.now() <= MULTIPART_UPLOAD_URL_REFRESH_SKEW_MS;
244649
244829
  };
244650
244830
  normalizeRepo = (repo) => {
244651
244831
  if (!repo || typeof repo !== "object" || Array.isArray(repo)) {
@@ -250461,7 +250641,7 @@ var init_codingAgents2 = __esm({
250461
250641
  });
250462
250642
 
250463
250643
  // src/devbox/commands/claudeSetupOauth.ts
250464
- import { createHash as createHash19, randomBytes as randomBytes14, randomUUID as randomUUID25 } from "node:crypto";
250644
+ import { createHash as createHash20, randomBytes as randomBytes14, randomUUID as randomUUID25 } from "node:crypto";
250465
250645
  import http10 from "node:http";
250466
250646
  import https3 from "node:https";
250467
250647
  import { brotliDecompressSync, gunzipSync, inflateSync } from "node:zlib";
@@ -250519,7 +250699,7 @@ var init_claudeSetupOauth = __esm({
250519
250699
  };
250520
250700
  base64UrlEncode = (buffer) => buffer.toString("base64").replace(/\+/g, "-").replace(/\//g, "_").replace(/=/g, "");
250521
250701
  generateClaudeSetupCodeVerifier = () => base64UrlEncode(randomBytes14(32));
250522
- generateClaudeSetupCodeChallenge = (verifier) => base64UrlEncode(createHash19("sha256").update(verifier).digest());
250702
+ generateClaudeSetupCodeChallenge = (verifier) => base64UrlEncode(createHash20("sha256").update(verifier).digest());
250523
250703
  generateClaudeSetupState = () => base64UrlEncode(randomBytes14(32));
250524
250704
  buildClaudeSetupAuthorizeUrls = ({
250525
250705
  discovery,
@@ -254799,7 +254979,7 @@ var require_timestamp2 = __commonJS({
254799
254979
  resolve: (str) => parseSexagesimal(str, false),
254800
254980
  stringify: stringifySexagesimal
254801
254981
  };
254802
- var timestamp = {
254982
+ var timestamp2 = {
254803
254983
  identify: (value) => value instanceof Date,
254804
254984
  default: true,
254805
254985
  tag: "tag:yaml.org,2002:timestamp",
@@ -254808,7 +254988,7 @@ var require_timestamp2 = __commonJS({
254808
254988
  // assumed to be 00:00:00Z (start of day, UTC).
254809
254989
  test: RegExp("^([0-9]{4})-([0-9]{1,2})-([0-9]{1,2})(?:(?:t|T|[ \\t]+)([0-9]{1,2}):([0-9]{1,2}):([0-9]{1,2}(\\.[0-9]+)?)(?:[ \\t]*(Z|[-+][012]?[0-9](?::[0-9]{2})?))?)?$"),
254810
254990
  resolve(str) {
254811
- const match = str.match(timestamp.test);
254991
+ const match = str.match(timestamp2.test);
254812
254992
  if (!match)
254813
254993
  throw new Error("!!timestamp expects a date, starting with yyyy-mm-dd");
254814
254994
  const [, year, month, day, hour, minute, second] = match.map(Number);
@@ -254827,7 +255007,7 @@ var require_timestamp2 = __commonJS({
254827
255007
  };
254828
255008
  exports.floatTime = floatTime;
254829
255009
  exports.intTime = intTime;
254830
- exports.timestamp = timestamp;
255010
+ exports.timestamp = timestamp2;
254831
255011
  }
254832
255012
  });
254833
255013
 
@@ -254847,7 +255027,7 @@ var require_schema4 = __commonJS({
254847
255027
  var omap = require_omap();
254848
255028
  var pairs = require_pairs();
254849
255029
  var set3 = require_set();
254850
- var timestamp = require_timestamp2();
255030
+ var timestamp2 = require_timestamp2();
254851
255031
  var schema = [
254852
255032
  map3.map,
254853
255033
  seq.seq,
@@ -254867,9 +255047,9 @@ var require_schema4 = __commonJS({
254867
255047
  omap.omap,
254868
255048
  pairs.pairs,
254869
255049
  set3.set,
254870
- timestamp.intTime,
254871
- timestamp.floatTime,
254872
- timestamp.timestamp
255050
+ timestamp2.intTime,
255051
+ timestamp2.floatTime,
255052
+ timestamp2.timestamp
254873
255053
  ];
254874
255054
  exports.schema = schema;
254875
255055
  }
@@ -254894,7 +255074,7 @@ var require_tags = __commonJS({
254894
255074
  var pairs = require_pairs();
254895
255075
  var schema$2 = require_schema4();
254896
255076
  var set3 = require_set();
254897
- var timestamp = require_timestamp2();
255077
+ var timestamp2 = require_timestamp2();
254898
255078
  var schemas = /* @__PURE__ */ new Map([
254899
255079
  ["core", schema.schema],
254900
255080
  ["failsafe", [map3.map, seq.seq, string7.string]],
@@ -254908,11 +255088,11 @@ var require_tags = __commonJS({
254908
255088
  float: float.float,
254909
255089
  floatExp: float.floatExp,
254910
255090
  floatNaN: float.floatNaN,
254911
- floatTime: timestamp.floatTime,
255091
+ floatTime: timestamp2.floatTime,
254912
255092
  int: int3.int,
254913
255093
  intHex: int3.intHex,
254914
255094
  intOct: int3.intOct,
254915
- intTime: timestamp.intTime,
255095
+ intTime: timestamp2.intTime,
254916
255096
  map: map3.map,
254917
255097
  merge: merge4.merge,
254918
255098
  null: _null7.nullTag,
@@ -254920,7 +255100,7 @@ var require_tags = __commonJS({
254920
255100
  pairs: pairs.pairs,
254921
255101
  seq: seq.seq,
254922
255102
  set: set3.set,
254923
- timestamp: timestamp.timestamp
255103
+ timestamp: timestamp2.timestamp
254924
255104
  };
254925
255105
  var coreKnownTags = {
254926
255106
  "tag:yaml.org,2002:binary": binary.binary,
@@ -254928,7 +255108,7 @@ var require_tags = __commonJS({
254928
255108
  "tag:yaml.org,2002:omap": omap.omap,
254929
255109
  "tag:yaml.org,2002:pairs": pairs.pairs,
254930
255110
  "tag:yaml.org,2002:set": set3.set,
254931
- "tag:yaml.org,2002:timestamp": timestamp.timestamp
255111
+ "tag:yaml.org,2002:timestamp": timestamp2.timestamp
254932
255112
  };
254933
255113
  function getTags(customTags, schemaName, addMergeTag) {
254934
255114
  const schemaTags = schemas.get(schemaName);
@@ -260751,7 +260931,7 @@ var init_commandCore = __esm({
260751
260931
  });
260752
260932
 
260753
260933
  // src/devbox/agentInit/manifest/check.ts
260754
- import { createHash as createHash20 } from "node:crypto";
260934
+ import { createHash as createHash21 } from "node:crypto";
260755
260935
  import fs52 from "node:fs/promises";
260756
260936
  import os25 from "node:os";
260757
260937
  import path63 from "node:path";
@@ -260761,7 +260941,7 @@ var init_check = __esm({
260761
260941
  "use strict";
260762
260942
  init_initPrep();
260763
260943
  init_parse6();
260764
- hashManifestText = (rawText) => createHash20("sha256").update(rawText, "utf8").digest("hex");
260944
+ hashManifestText = (rawText) => createHash21("sha256").update(rawText, "utf8").digest("hex");
260765
260945
  expandHomePath = (value, homeDir2) => value === "~" || value.startsWith("~/") ? path63.join(homeDir2, value.slice(1)) : value;
260766
260946
  pathExists6 = async (target) => {
260767
260947
  try {
@@ -262707,16 +262887,28 @@ var init_detect = __esm({
262707
262887
  });
262708
262888
 
262709
262889
  // src/devbox/commands/desktopApp.ts
262710
- import { spawn as spawn20 } from "node:child_process";
262890
+ import { execFile as execFile8, spawn as spawn20 } from "node:child_process";
262711
262891
  import { constants as fsConstants3 } from "node:fs";
262712
262892
  import { access as access3 } from "node:fs/promises";
262713
262893
  import os26 from "node:os";
262714
262894
  import path65 from "node:path";
262715
- var trim12, createDesktopThreadQueryValue, DESKTOP_APP_BUNDLE_NAME, DESKTOP_APP_TARGET_PATH, resolveDesktopAppInstallPaths, pathExists7, findInstalledDesktopAppPath, setDesktopAppSelection, buildDesktopAppWorkbenchUrl, buildDesktopAppLink, buildDesktopAppOpenArgs, runOpen, openDesktopApp, openDesktopAppLink;
262895
+ import { promisify as promisify5 } from "node:util";
262896
+ var execFileAsync4, resolveDesktopAppOs, DESKTOP_APP_NAMES, buildDesktopAppDownloadUrl, trim12, createDesktopThreadQueryValue, DESKTOP_APP_BUNDLE_NAME, DESKTOP_APP_TARGET_PATH, resolveDesktopAppInstallPaths, pathExists7, findInstalledDesktopAppPath, LINUX_DESKTOP_APP_SCHEME_MIME_TYPE, findLinuxDesktopAppEntry, findInstalledDesktopApp, setDesktopAppSelection, buildDesktopAppWorkbenchUrl, buildDesktopAppLink, buildDesktopAppOpenArgs, runDetached, openDesktopApp, openDesktopAppLink;
262716
262897
  var init_desktopApp = __esm({
262717
262898
  "src/devbox/commands/desktopApp.ts"() {
262718
262899
  "use strict";
262719
262900
  init_siteUrl();
262901
+ execFileAsync4 = promisify5(execFile8);
262902
+ resolveDesktopAppOs = (platform3) => {
262903
+ if (platform3 === "darwin") return "mac";
262904
+ if (platform3 === "linux") return "linux";
262905
+ return null;
262906
+ };
262907
+ DESKTOP_APP_NAMES = {
262908
+ linux: "Linux app",
262909
+ mac: "Mac app"
262910
+ };
262911
+ buildDesktopAppDownloadUrl = (desktopOs, siteUrl) => new URL(`/${desktopOs}`, siteUrl).toString();
262720
262912
  trim12 = (value) => value.trim().replace(/\r/g, "");
262721
262913
  createDesktopThreadQueryValue = (threadId2) => `thread:${threadId2}`;
262722
262914
  DESKTOP_APP_BUNDLE_NAME = "Boxes.dev.app";
@@ -262751,6 +262943,37 @@ var init_desktopApp = __esm({
262751
262943
  }
262752
262944
  return null;
262753
262945
  };
262946
+ LINUX_DESKTOP_APP_SCHEME_MIME_TYPE = "x-scheme-handler/boxesdesktop";
262947
+ findLinuxDesktopAppEntry = async ({
262948
+ execFileImpl = execFileAsync4
262949
+ } = {}) => {
262950
+ try {
262951
+ const { stdout } = await execFileImpl("xdg-mime", [
262952
+ "query",
262953
+ "default",
262954
+ LINUX_DESKTOP_APP_SCHEME_MIME_TYPE
262955
+ ]);
262956
+ return trim12(stdout.toString()) || null;
262957
+ } catch {
262958
+ return null;
262959
+ }
262960
+ };
262961
+ findInstalledDesktopApp = async ({
262962
+ platform: platform3 = process.platform,
262963
+ findMacAppPath = findInstalledDesktopAppPath,
262964
+ findLinuxEntry = findLinuxDesktopAppEntry
262965
+ } = {}) => {
262966
+ const desktopOs = resolveDesktopAppOs(platform3);
262967
+ if (desktopOs === "mac") {
262968
+ const appPath = await findMacAppPath();
262969
+ return appPath === null ? null : { os: "mac", appPath };
262970
+ }
262971
+ if (desktopOs === "linux") {
262972
+ const desktopEntry = await findLinuxEntry();
262973
+ return desktopEntry === null ? null : { os: "linux", desktopEntry };
262974
+ }
262975
+ return null;
262976
+ };
262754
262977
  setDesktopAppSelection = (url3, { alias, clientThreadId }) => {
262755
262978
  url3.searchParams.set("box", trim12(alias));
262756
262979
  const trimmedThreadId = trim12(clientThreadId ?? "");
@@ -262774,9 +262997,9 @@ var init_desktopApp = __esm({
262774
262997
  }
262775
262998
  return ["-a", appPath, "--args", "--start-url", trimmedStartUrl];
262776
262999
  };
262777
- runOpen = (args, spawnImpl) => {
263000
+ runDetached = (command, args, spawnImpl) => {
262778
263001
  try {
262779
- const child = spawnImpl("open", args, {
263002
+ const child = spawnImpl(command, args, {
262780
263003
  detached: true,
262781
263004
  stdio: "ignore"
262782
263005
  });
@@ -262790,12 +263013,16 @@ var init_desktopApp = __esm({
262790
263013
  appPath,
262791
263014
  startUrl,
262792
263015
  spawnImpl = spawn20
262793
- }) => runOpen(buildDesktopAppOpenArgs({ appPath, startUrl }), spawnImpl);
263016
+ }) => runDetached(
263017
+ "open",
263018
+ buildDesktopAppOpenArgs({ appPath, startUrl }),
263019
+ spawnImpl
263020
+ );
262794
263021
  openDesktopAppLink = ({
262795
- appPath,
263022
+ app,
262796
263023
  link: link2,
262797
263024
  spawnImpl = spawn20
262798
- }) => runOpen(["-a", appPath, link2], spawnImpl);
263025
+ }) => app.os === "mac" ? runDetached("open", ["-a", app.appPath, link2], spawnImpl) : runDetached("xdg-open", [link2], spawnImpl);
262799
263026
  }
262800
263027
  });
262801
263028
 
@@ -262809,25 +263036,26 @@ var init_desktopHandoff = __esm({
262809
263036
  init_siteUrl();
262810
263037
  init_remoteSession();
262811
263038
  resolveDesktopHandoff = ({
262812
- installedAppPath,
263039
+ installedApp,
262813
263040
  platform: platform3,
262814
263041
  remote
262815
263042
  }) => {
262816
- if (remote || platform3 !== "darwin") return "mobile_app";
262817
- return installedAppPath === null ? "download_mac_app" : "open_mac_app";
263043
+ const desktopOs = resolveDesktopAppOs(platform3);
263044
+ if (remote || desktopOs === null) return { kind: "mobile_app" };
263045
+ return installedApp === null ? { kind: "download_desktop_app", os: desktopOs } : { kind: "open_desktop_app", app: installedApp };
262818
263046
  };
262819
263047
  detectDesktopHandoff = async () => resolveDesktopHandoff({
262820
- installedAppPath: await findInstalledDesktopAppPath(),
263048
+ installedApp: await findInstalledDesktopApp(),
262821
263049
  platform: process.platform,
262822
263050
  remote: isRemoteShellSession()
262823
263051
  });
262824
263052
  buildSetupThreadHandoffMessage = (handoff, siteUrl) => {
262825
263053
  const started = "The setup thread has started on the Template box, and this command will keep running.";
262826
- switch (handoff) {
262827
- case "open_mac_app":
262828
- return `${started} Offer to open it in the boxes.dev Mac app. If the user agrees, run \`dvb agent-init open-desktop\`. When setup finishes, this command will open the app on the setup thread.`;
262829
- case "download_mac_app":
262830
- return `${started} Tell the user they can follow it in the boxes.dev Mac app and give them the download link: ${siteUrl}/mac`;
263054
+ switch (handoff.kind) {
263055
+ case "open_desktop_app":
263056
+ return `${started} Offer to open it in the boxes.dev ${DESKTOP_APP_NAMES[handoff.app.os]}. If the user agrees, run \`dvb agent-init open-desktop\`. When setup finishes, this command will open the app on the setup thread.`;
263057
+ case "download_desktop_app":
263058
+ return `${started} Tell the user they can follow it in the boxes.dev ${DESKTOP_APP_NAMES[handoff.os]} and give them the download link: ${buildDesktopAppDownloadUrl(handoff.os, siteUrl)}`;
262831
263059
  case "mobile_app":
262832
263060
  return `${started} Tell the user they can follow it in the boxes.dev mobile app: ${siteUrl}/m`;
262833
263061
  }
@@ -262849,15 +263077,15 @@ var init_desktopHandoff = __esm({
262849
263077
  siteUrl
262850
263078
  }) => {
262851
263079
  const otherOptions = buildTerminalAndMobileOptions({ alias, siteUrl });
262852
- switch (handoff) {
262853
- case "open_mac_app":
263080
+ switch (handoff.kind) {
263081
+ case "open_desktop_app":
262854
263082
  return [
262855
- "open it in the boxes.dev Mac app (run `dvb agent-init open-desktop`)",
263083
+ `open it in the boxes.dev ${DESKTOP_APP_NAMES[handoff.app.os]} (run \`dvb agent-init open-desktop\`)`,
262856
263084
  ...otherOptions
262857
263085
  ];
262858
- case "download_mac_app":
263086
+ case "download_desktop_app":
262859
263087
  return [
262860
- `open it in the boxes.dev Mac app, which they can download from ${siteUrl}/mac`,
263088
+ `open it in the boxes.dev ${DESKTOP_APP_NAMES[handoff.os]}, which they can download from ${buildDesktopAppDownloadUrl(handoff.os, siteUrl)}`,
262861
263089
  ...otherOptions
262862
263090
  ];
262863
263091
  case "mobile_app":
@@ -262866,7 +263094,7 @@ var init_desktopHandoff = __esm({
262866
263094
  };
262867
263095
  readSetupThreadId = (job) => typeof job?.["setupThreadId"] === "string" && job["setupThreadId"] !== "" ? job["setupThreadId"] : null;
262868
263096
  openSetupInDesktopApp = async ({
262869
- appPath,
263097
+ app,
262870
263098
  context: context34,
262871
263099
  repo,
262872
263100
  setupThreadId
@@ -262877,13 +263105,14 @@ var init_desktopHandoff = __esm({
262877
263105
  setupThreadId
262878
263106
  );
262879
263107
  const link2 = buildDesktopAppLink({ alias: repo.alias, clientThreadId });
262880
- if (!openDesktopAppLink({ appPath, link: link2 })) {
263108
+ const appName = DESKTOP_APP_NAMES[app.os];
263109
+ if (!openDesktopAppLink({ app, link: link2 })) {
262881
263110
  throw new Error(
262882
- `Couldn't open the boxes.dev Mac app. Ask the user to open it from ${appPath}.`
263111
+ app.os === "mac" ? `Couldn't open the boxes.dev ${appName}. Ask the user to open it from ${app.appPath}.` : `Couldn't open the boxes.dev ${appName}. Ask the user to open boxes.dev from their applications menu.`
262883
263112
  );
262884
263113
  }
262885
263114
  console.log(
262886
- setupThreadId === null ? `Opened the boxes.dev Mac app on ${repo.alias}.` : `Opened the boxes.dev Mac app on the setup thread for ${repo.alias}.`
263115
+ setupThreadId === null ? `Opened the boxes.dev ${appName} on ${repo.alias}.` : `Opened the boxes.dev ${appName} on the setup thread for ${repo.alias}.`
262887
263116
  );
262888
263117
  };
262889
263118
  reportCompletedSetup = async ({
@@ -262895,21 +263124,16 @@ var init_desktopHandoff = __esm({
262895
263124
  console.log(`Template box setup is complete: ${repo.alias}`);
262896
263125
  console.log("");
262897
263126
  const siteUrl = resolveSiteUrl();
262898
- const appPath = await findInstalledDesktopAppPath();
262899
- const handoff = resolveDesktopHandoff({
262900
- installedAppPath: appPath,
262901
- platform: process.platform,
262902
- remote: isRemoteShellSession()
262903
- });
262904
- if (handoff === "open_mac_app" && appPath !== null) {
263127
+ const handoff = await detectDesktopHandoff();
263128
+ if (handoff.kind === "open_desktop_app") {
262905
263129
  await openSetupInDesktopApp({
262906
- appPath,
263130
+ app: handoff.app,
262907
263131
  context: context34,
262908
263132
  repo,
262909
263133
  setupThreadId: readSetupThreadId(job)
262910
263134
  });
262911
263135
  console.log(
262912
- "Tell the user their Template box is ready and the setup thread is open in the boxes.dev Mac app. They can also:"
263136
+ `Tell the user their Template box is ready and the setup thread is open in the boxes.dev ${DESKTOP_APP_NAMES[handoff.app.os]}. They can also:`
262913
263137
  );
262914
263138
  for (const option of buildTerminalAndMobileOptions({
262915
263139
  alias: repo.alias,
@@ -263736,22 +263960,23 @@ var init_openDesktop = __esm({
263736
263960
  };
263737
263961
  runAgentInitOpenDesktop = async (args) => {
263738
263962
  const { projectPath } = parseOpenDesktopArgs(args);
263739
- if (process.platform !== "darwin") {
263963
+ const desktopOs = resolveDesktopAppOs(process.platform);
263964
+ if (desktopOs === null) {
263740
263965
  throw new Error(
263741
- `The boxes.dev desktop app is only available for macOS. The user can follow setup in the mobile app instead: ${resolveSiteUrl()}/m`
263966
+ `The boxes.dev desktop app is only available for macOS and Linux. The user can follow setup in the mobile app instead: ${resolveSiteUrl()}/m`
263742
263967
  );
263743
263968
  }
263744
- const appPath = await findInstalledDesktopAppPath();
263745
- if (appPath === null) {
263969
+ const app = await findInstalledDesktopApp();
263970
+ if (app === null) {
263746
263971
  throw new Error(
263747
- `The boxes.dev Mac app isn't installed. Give the user the download link: ${resolveSiteUrl()}/mac`
263972
+ `The boxes.dev ${DESKTOP_APP_NAMES[desktopOs]} isn't installed. Give the user the download link: ${buildDesktopAppDownloadUrl(desktopOs, resolveSiteUrl())}`
263748
263973
  );
263749
263974
  }
263750
263975
  const { context: context34, repo } = await resolveAgentInitProject({ projectPath });
263751
263976
  const progress = await fetchJobProgress({ context: context34, jobId: null, repo });
263752
263977
  const job = progress && isRecord15(progress["job"]) ? progress["job"] : null;
263753
263978
  await openSetupInDesktopApp({
263754
- appPath,
263979
+ app,
263755
263980
  context: context34,
263756
263981
  repo,
263757
263982
  setupThreadId: readSetupThreadId(job)
@@ -265313,7 +265538,7 @@ var init_agentInit = __esm({
265313
265538
  " run Execute the approved manifest end to end",
265314
265539
  " status Current state and next action (poll-safe, supports --json)",
265315
265540
  " watch Attach to a running setup and stream progress",
265316
- " open-desktop Open the boxes.dev Mac app on the setup thread",
265541
+ " open-desktop Open the boxes.dev desktop app on the setup thread",
265317
265542
  " retry Retry a recoverable remote failure",
265318
265543
  " destroy Destroy the incomplete setup and start over (keeps the manifest)",
265319
265544
  " diagnostics Redacted local+remote state dump for debugging"
@@ -271703,7 +271928,7 @@ ${usageText}`;
271703
271928
  });
271704
271929
 
271705
271930
  // src/devbox/commands/init/codex/artifacts.ts
271706
- import { createHash as createHash21, randomUUID as randomUUID29 } from "node:crypto";
271931
+ import { createHash as createHash22, randomUUID as randomUUID29 } from "node:crypto";
271707
271932
  import { createReadStream as createReadStream2 } from "node:fs";
271708
271933
  import fsSync from "node:fs";
271709
271934
  import fs63 from "node:fs/promises";
@@ -271924,7 +272149,7 @@ var init_artifacts = __esm({
271924
272149
  return totalBytes;
271925
272150
  };
271926
272151
  sha256File4 = async (filePath) => await new Promise((resolve3, reject) => {
271927
- const hash3 = createHash21("sha256");
272152
+ const hash3 = createHash22("sha256");
271928
272153
  const stream = createReadStream2(filePath);
271929
272154
  stream.on("data", (chunk2) => hash3.update(chunk2));
271930
272155
  stream.on("error", reject);
@@ -274947,7 +275172,7 @@ var init_setupArtifactsValidation = __esm({
274947
275172
  });
274948
275173
 
274949
275174
  // src/devbox/commands/init/databaseCopy.ts
274950
- import { createHash as createHash22 } from "node:crypto";
275175
+ import { createHash as createHash23 } from "node:crypto";
274951
275176
  import { parseEnv } from "node:util";
274952
275177
  import path80 from "node:path";
274953
275178
  import fs66 from "node:fs/promises";
@@ -275040,7 +275265,7 @@ var init_databaseCopy = __esm({
275040
275265
  const { statePath } = resolveDatabaseCopyPaths(projectDir);
275041
275266
  await writeSecureJson(statePath, state);
275042
275267
  };
275043
- buildDatabaseSelectionFingerprint = (databaseCopies) => createHash22("sha256").update(JSON.stringify(databaseCopies)).digest("hex");
275268
+ buildDatabaseSelectionFingerprint = (databaseCopies) => createHash23("sha256").update(JSON.stringify(databaseCopies)).digest("hex");
275044
275269
  DATABASE_SOURCE_FINGERPRINT_ROLES = [
275045
275270
  "url",
275046
275271
  "host",
@@ -275104,7 +275329,7 @@ var init_databaseCopy = __esm({
275104
275329
  repoRoot,
275105
275330
  homeDir: homeDir2
275106
275331
  });
275107
- const credentialsFingerprint = credentialsPath ? createHash22("sha256").update(await fs66.readFile(credentialsPath)).digest("hex") : null;
275332
+ const credentialsFingerprint = credentialsPath ? createHash23("sha256").update(await fs66.readFile(credentialsPath)).digest("hex") : null;
275108
275333
  return {
275109
275334
  id: candidate.id,
275110
275335
  engine: candidate.engine,
@@ -275115,7 +275340,7 @@ var init_databaseCopy = __esm({
275115
275340
  };
275116
275341
  })
275117
275342
  );
275118
- return createHash22("sha256").update(JSON.stringify(resolvedInputs)).digest("hex");
275343
+ return createHash23("sha256").update(JSON.stringify(resolvedInputs)).digest("hex");
275119
275344
  };
275120
275345
  getRefValuesForRole = (candidate, role) => candidate.source.refs.filter(
275121
275346
  (ref) => (ref.kind === "env_var" || ref.kind === "env_file") && ref.role === role
@@ -277783,7 +278008,7 @@ var init_projectLayout = __esm({
277783
278008
  });
277784
278009
 
277785
278010
  // src/devbox/commands/init/provisionFlow.ts
277786
- import { createHash as createHash23, randomUUID as randomUUID31 } from "node:crypto";
278011
+ import { createHash as createHash24, randomUUID as randomUUID31 } from "node:crypto";
277787
278012
  import path85 from "node:path";
277788
278013
  import fs70 from "node:fs/promises";
277789
278014
  import os33 from "node:os";
@@ -277963,7 +278188,7 @@ var init_provisionFlow = __esm({
277963
278188
  );
277964
278189
  }
277965
278190
  try {
277966
- const hash3 = createHash23("sha256");
278191
+ const hash3 = createHash24("sha256");
277967
278192
  for (const partPath of plan.partPaths) {
277968
278193
  if (uploadedBytes >= sizeBytes) break;
277969
278194
  const bytesRemaining = sizeBytes - uploadedBytes;
@@ -278489,12 +278714,10 @@ var init_provisionFlow = __esm({
278489
278714
  if (process.stdin.isTTY && !parsed.json) {
278490
278715
  status.stage("Inspecting project repos");
278491
278716
  }
278492
- return repoStates.map(
278493
- (entry) => ({
278494
- ...entry,
278495
- copyWorktree: Boolean(entry.headState.commit) && hasWorktreeChanges(entry.worktreeState) && copyWorktree
278496
- })
278497
- );
278717
+ return repoStates.map((entry) => ({
278718
+ ...entry,
278719
+ copyWorktree: Boolean(entry.headState.commit) && hasWorktreeChanges(entry.worktreeState) && copyWorktree
278720
+ }));
278498
278721
  }
278499
278722
  });
278500
278723
  const packaged = await runInitStep({
@@ -281469,7 +281692,7 @@ var init_setupAgents = __esm({
281469
281692
 
281470
281693
  // src/devbox/commands/setup.ts
281471
281694
  import { spawn as spawn24 } from "node:child_process";
281472
- import { createHash as createHash24 } from "node:crypto";
281695
+ import { createHash as createHash25 } from "node:crypto";
281473
281696
  import {
281474
281697
  createReadStream as createReadStream3,
281475
281698
  createWriteStream as createWriteStream2,
@@ -281480,7 +281703,7 @@ import os35 from "node:os";
281480
281703
  import path87 from "node:path";
281481
281704
  import { Readable as Readable2 } from "node:stream";
281482
281705
  import { pipeline as pipeline2 } from "node:stream/promises";
281483
- var trim15, readManagedCodexAuthCache, resolveE2bAuthMode, MOBILE_DOWNLOAD_LINK, MAC_DESKTOP_DOWNLOAD_MANIFEST_URL, MAC_DESKTOP_DOWNLOAD_LINK, SHA256_PATTERN, requireManifestString, requireManifestNumber, parseDesktopDownloadManifest, parseSetupArgs2, splitQrLines, hasMobileAppInstallAcknowledgement, shouldOfferMobileAppInstall, mobileAppInstallPrompt, printMobileDownloadQr, saveMobileAppInstallAcknowledgement, maybeConfirmMobileAppInstalled, shouldOfferDesktopAppInstall, shellEscape4, appleScriptEscape, formatCommandFailure2, runCommand8, downloadFile, fetchDesktopDownloadManifest, calculateFileSha256, verifyDesktopDmgDownload, attachDmg, detachDmg, isWritable, buildInstallScript, installDesktopAppToApplications, printDesktopDownloadOffer, firstSetupCompleteMessage, desktopAppInstallPrompt, desktopAppLaunchPrompt, shouldOfferDesktopAppLaunch, installDesktopAppFromDownload, ensureDesktopAppInstalledForInit, maybeOfferDesktopAppInstall, maybeOfferDesktopAppLaunch, printFirstSetupCompleteMessage, runSetupWithParsedArgs, runSetup, buildSetupArgsForInit, runSetupForInit;
281706
+ var trim15, readManagedCodexAuthCache, resolveE2bAuthMode, MOBILE_DOWNLOAD_LINK, MAC_DESKTOP_DOWNLOAD_MANIFEST_URL, MAC_DESKTOP_DOWNLOAD_LINK, LINUX_DESKTOP_DOWNLOAD_LINK, SHA256_PATTERN, requireManifestString, requireManifestNumber, parseDesktopDownloadManifest, parseSetupArgs2, splitQrLines, hasMobileAppInstallAcknowledgement, shouldOfferMobileAppInstall, mobileAppInstallPrompt, printMobileDownloadQr, saveMobileAppInstallAcknowledgement, maybeConfirmMobileAppInstalled, shouldOfferDesktopAppInstall, shellEscape4, appleScriptEscape, formatCommandFailure2, runCommand8, downloadFile, fetchDesktopDownloadManifest, calculateFileSha256, verifyDesktopDmgDownload, attachDmg, detachDmg, isWritable, buildInstallScript, installDesktopAppToApplications, printDesktopDownloadOffer, shouldShowLinuxDesktopAppDownload, firstSetupCompleteMessage, desktopAppInstallPrompt, desktopAppLaunchPrompt, shouldOfferDesktopAppLaunch, installDesktopAppFromDownload, ensureDesktopAppInstalledForInit, printLinuxDesktopAppDownload, maybeOfferDesktopAppInstall, maybeOfferDesktopAppLaunch, linuxDesktopAppLaunchPrompt, maybeOfferLinuxDesktopAppLaunch, printFirstSetupCompleteMessage, runSetupWithParsedArgs, runSetup, buildSetupArgsForInit, runSetupForInit;
281484
281707
  var init_setup = __esm({
281485
281708
  "src/devbox/commands/setup.ts"() {
281486
281709
  "use strict";
@@ -281504,6 +281727,7 @@ var init_setup = __esm({
281504
281727
  init_managedCodex();
281505
281728
  init_setupAgents();
281506
281729
  init_desktopApp();
281730
+ init_remoteSession();
281507
281731
  init_managedCodexAuth();
281508
281732
  trim15 = (value) => value.trim().replace(/\r/g, "");
281509
281733
  readManagedCodexAuthCache = async (homeDir2, accountScope) => {
@@ -281528,6 +281752,10 @@ var init_setup = __esm({
281528
281752
  label: "Desktop (macOS)",
281529
281753
  url: new URL("/mac", resolveSiteUrl()).toString()
281530
281754
  };
281755
+ LINUX_DESKTOP_DOWNLOAD_LINK = {
281756
+ label: "Desktop (Linux)",
281757
+ url: new URL("/linux", resolveSiteUrl()).toString()
281758
+ };
281531
281759
  SHA256_PATTERN = /^[a-f0-9]{64}$/u;
281532
281760
  requireManifestString = (value, label) => {
281533
281761
  if (typeof value !== "string" || value.trim() === "") {
@@ -281750,7 +281978,7 @@ var init_setup = __esm({
281750
281978
  return parseDesktopDownloadManifest(payload);
281751
281979
  };
281752
281980
  calculateFileSha256 = async (filePath) => await new Promise((resolve3, reject) => {
281753
- const hash3 = createHash24("sha256");
281981
+ const hash3 = createHash25("sha256");
281754
281982
  const stream = createReadStream3(filePath);
281755
281983
  stream.on("data", (chunk2) => hash3.update(chunk2));
281756
281984
  stream.on("error", reject);
@@ -281824,12 +282052,21 @@ var init_setup = __esm({
281824
282052
  )}" with administrator privileges`
281825
282053
  ]);
281826
282054
  };
281827
- printDesktopDownloadOffer = () => {
281828
- console.log(colors.boldWhite("Install the boxes.dev desktop app for macOS:"));
282055
+ printDesktopDownloadOffer = ({
282056
+ link: link2,
282057
+ osName
282058
+ }) => {
281829
282059
  console.log(
281830
- `${colors.style(MAC_DESKTOP_DOWNLOAD_LINK.label, ["bold", "cyan"])}: ${MAC_DESKTOP_DOWNLOAD_LINK.url}`
282060
+ colors.boldWhite(`Install the boxes.dev desktop app for ${osName}:`)
281831
282061
  );
282062
+ console.log(`${colors.style(link2.label, ["bold", "cyan"])}: ${link2.url}`);
281832
282063
  };
282064
+ shouldShowLinuxDesktopAppDownload = ({
282065
+ platform: platform3 = process.platform,
282066
+ stdoutIsTTY = Boolean(process.stdout.isTTY),
282067
+ remote = isRemoteShellSession(),
282068
+ installed
282069
+ }) => platform3 === "linux" && stdoutIsTTY && !remote && !installed;
281833
282070
  firstSetupCompleteMessage = {
281834
282071
  heading: "boxes.dev setup complete!",
281835
282072
  nextStep: "Next step: in your project's folder, ask Claude Code or Codex to run `dvb agent-init` and follow its instructions."
@@ -281969,21 +282206,37 @@ var init_setup = __esm({
281969
282206
  const spinner = Ie();
281970
282207
  return await installDesktopAppFromDownload({ spinner });
281971
282208
  };
282209
+ printLinuxDesktopAppDownload = () => {
282210
+ printDesktopDownloadOffer({
282211
+ link: LINUX_DESKTOP_DOWNLOAD_LINK,
282212
+ osName: "Linux"
282213
+ });
282214
+ console.log("");
282215
+ };
281972
282216
  maybeOfferDesktopAppInstall = async () => {
282217
+ if (process.platform === "linux") {
282218
+ const installed = await findLinuxDesktopAppEntry() !== null;
282219
+ if (shouldShowLinuxDesktopAppDownload({ installed })) {
282220
+ printLinuxDesktopAppDownload();
282221
+ }
282222
+ return;
282223
+ }
281973
282224
  const installedAppPath = await findInstalledDesktopAppPath();
281974
282225
  if (!shouldOfferDesktopAppInstall({ installedAppPath })) {
281975
- return installedAppPath;
282226
+ return;
281976
282227
  }
281977
- printDesktopDownloadOffer();
282228
+ printDesktopDownloadOffer({
282229
+ link: MAC_DESKTOP_DOWNLOAD_LINK,
282230
+ osName: "macOS"
282231
+ });
281978
282232
  const decision = await qt(desktopAppInstallPrompt);
281979
282233
  if (Ct(decision) || decision === "skip") {
281980
282234
  console.log("");
281981
- return null;
282235
+ return;
281982
282236
  }
281983
- const outcome = await installDesktopAppFromDownload({
282237
+ await installDesktopAppFromDownload({
281984
282238
  spinner: Ie()
281985
282239
  });
281986
- return outcome.appPath;
281987
282240
  };
281988
282241
  maybeOfferDesktopAppLaunch = async ({
281989
282242
  installedAppPath,
@@ -282009,6 +282262,28 @@ var init_setup = __esm({
282009
282262
  console.log("");
282010
282263
  return opened;
282011
282264
  };
282265
+ linuxDesktopAppLaunchPrompt = {
282266
+ ...desktopAppLaunchPrompt,
282267
+ message: "Open the boxes.dev desktop app now?"
282268
+ };
282269
+ maybeOfferLinuxDesktopAppLaunch = async ({
282270
+ app,
282271
+ link: link2
282272
+ }) => {
282273
+ const decision = await qt(linuxDesktopAppLaunchPrompt);
282274
+ if (Ct(decision) || decision === "skip") {
282275
+ console.log("");
282276
+ return false;
282277
+ }
282278
+ const opened = openDesktopAppLink({ app, link: link2 });
282279
+ if (!opened) {
282280
+ console.warn(
282281
+ `Unable to open the boxes.dev desktop app automatically. Run: xdg-open "${link2}"`
282282
+ );
282283
+ }
282284
+ console.log("");
282285
+ return opened;
282286
+ };
282012
282287
  printFirstSetupCompleteMessage = () => {
282013
282288
  const isTty = process.stdout.isTTY;
282014
282289
  const heading = isTty ? `${colors.style("boxes.dev", ["bold", "cyan"])} ${colors.style(
@@ -282510,7 +282785,7 @@ var init_gitSigningOpenPgp = __esm({
282510
282785
  });
282511
282786
 
282512
282787
  // src/devbox/commands/init/gitSigningSsh.ts
282513
- import { createHash as createHash25 } from "node:crypto";
282788
+ import { createHash as createHash26 } from "node:crypto";
282514
282789
  import fs72 from "node:fs/promises";
282515
282790
  import path89 from "node:path";
282516
282791
  var expandUserPath2, resolveSigningKeyPath2, readFileIfExists4, isPublicSshKeyLine2, parseSshPublicKey2, missingSshPrivateKeyCopyAvailability2, inspectLiteralSshPublicKey2, inspectPublicSshKeyFile2, inspectPrivateSshKeyFile2, inspectSshSigningKey2;
@@ -282552,7 +282827,7 @@ var init_gitSigningSsh = __esm({
282552
282827
  try {
282553
282828
  const blob = Buffer.from(keyBlob, "base64");
282554
282829
  if (blob.length === 0) return null;
282555
- const fingerprint = createHash25("sha256").update(blob).digest("base64").replace(/=+$/u, "");
282830
+ const fingerprint = createHash26("sha256").update(blob).digest("base64").replace(/=+$/u, "");
282556
282831
  return {
282557
282832
  keyType,
282558
282833
  publicKey: value.trim(),
@@ -282773,7 +283048,7 @@ var init_gitSigningSsh = __esm({
282773
283048
  });
282774
283049
 
282775
283050
  // src/devbox/commands/init/gitSigning.ts
282776
- import { createHash as createHash26 } from "node:crypto";
283051
+ import { createHash as createHash27 } from "node:crypto";
282777
283052
  import { spawn as spawn25 } from "node:child_process";
282778
283053
  import os36 from "node:os";
282779
283054
  var uniqueStrings3, buildSpawnEnv3, runLocalCommand3, readEffectiveGitConfig2, normalizeGitSigningFormat2, buildIdentityWarnings2, buildProfileId2, buildIncompleteRepoPlan2, detectOpenPgpRepoPlan2, detectSshRepoPlan2, detectGitSigningRepoPlan2, profileKey2, computeRemoteConfigScope2, deriveSetupStatus2, collectProfiles2, collectCopyUnavailableReasons2, collectWarnings2, detectGitSigningSetup;
@@ -282855,7 +283130,7 @@ var init_gitSigning3 = __esm({
282855
283130
  signingKey,
282856
283131
  fingerprint
282857
283132
  });
282858
- return createHash26("sha256").update(stable).digest("hex").slice(0, 16);
283133
+ return createHash27("sha256").update(stable).digest("hex").slice(0, 16);
282859
283134
  };
282860
283135
  buildIncompleteRepoPlan2 = ({
282861
283136
  repo,
@@ -283322,7 +283597,7 @@ var init_gitSigning3 = __esm({
283322
283597
  });
283323
283598
 
283324
283599
  // src/devbox/commands/init/gitSigningPackage.ts
283325
- import { createHash as createHash27, randomUUID as randomUUID33 } from "node:crypto";
283600
+ import { createHash as createHash28, randomUUID as randomUUID33 } from "node:crypto";
283326
283601
  import fs73 from "node:fs/promises";
283327
283602
  import path90 from "node:path";
283328
283603
  var GitSigningPackagingError, macCopyfileDisabledEnv4, runTar3, ensureFreshDir2, throwSourceMissing2, normalizeArchivePath2, shouldExcludeGpgEntry2, copyFileStrict2, copyGpgHome2, hashFile2, assertCopyAvailable2, prepareOpenPgpProfile2, prepareSshProfile2, prepareGitSigningPayload2;
@@ -283427,7 +283702,7 @@ var init_gitSigningPackage = __esm({
283427
283702
  }
283428
283703
  };
283429
283704
  hashFile2 = async (filePath) => {
283430
- const hash3 = createHash27("sha256");
283705
+ const hash3 = createHash28("sha256");
283431
283706
  const bytes = await fs73.readFile(filePath);
283432
283707
  hash3.update(bytes);
283433
283708
  return {
@@ -284934,6 +285209,7 @@ var init_finalizeFlow = __esm({
284934
285209
  init_servicesToml();
284935
285210
  init_servicesConfig();
284936
285211
  init_desktopApp();
285212
+ init_remoteSession();
284937
285213
  init_setup();
284938
285214
  init_progress();
284939
285215
  init_projectLayout();
@@ -285672,22 +285948,25 @@ var init_finalizeFlow = __esm({
285672
285948
  runCompanionAppOnboardingDuringInit = async ({
285673
285949
  getInitState,
285674
285950
  updateInitState,
285675
- desktopAppLaunchUrl = null,
285951
+ desktopAppSelection = null,
285676
285952
  loadConfigFn = loadConfig,
285677
285953
  maybeConfirmMobileAppInstalledFn = maybeConfirmMobileAppInstalled,
285678
285954
  maybeOfferDesktopAppLaunchFn = maybeOfferDesktopAppLaunch,
285679
285955
  ensureDesktopAppInstalledForInitFn = ensureDesktopAppInstalledForInit,
285680
285956
  findInstalledDesktopAppPathFn = findInstalledDesktopAppPath,
285957
+ findLinuxDesktopAppEntryFn = findLinuxDesktopAppEntry,
285958
+ maybeOfferLinuxDesktopAppLaunchFn = maybeOfferLinuxDesktopAppLaunch,
285681
285959
  platform: platform3 = process.platform,
285960
+ remote = isRemoteShellSession(),
285682
285961
  stdinIsTTY = Boolean(process.stdin.isTTY),
285683
285962
  stdoutIsTTY = Boolean(process.stdout.isTTY)
285684
285963
  }) => {
285685
285964
  const currentSteps = getInitState()?.steps;
285686
285965
  const homeDir2 = process.env.HOME;
285687
285966
  const config5 = await loadConfigFn(homeDir2 ? { homeDir: homeDir2 } : void 0);
285688
- const installedDesktopAppPath = await findInstalledDesktopAppPathFn(
285689
- homeDir2 ? { homeDir: homeDir2 } : void 0
285690
- );
285967
+ const desktopOs = resolveDesktopAppOs(platform3);
285968
+ const installedDesktopAppPath = desktopOs === "mac" ? await findInstalledDesktopAppPathFn(homeDir2 ? { homeDir: homeDir2 } : void 0) : null;
285969
+ const linuxDesktopAppEntry = desktopOs === "linux" && !remote ? await findLinuxDesktopAppEntryFn() : null;
285691
285970
  const mobileAlreadyAcknowledged = hasMobileAppInstallAcknowledgement2(
285692
285971
  config5?.mobileAppInstalledAt
285693
285972
  );
@@ -285697,7 +285976,8 @@ var init_finalizeFlow = __esm({
285697
285976
  config: config5
285698
285977
  });
285699
285978
  const shouldMarkMobileInstalled = !currentSteps?.mobileAppInstalled && mobileAlreadyAcknowledged;
285700
- const shouldHandleDesktop = !currentSteps?.desktopAppInstalled && (shouldOfferDesktopAppInstall({
285979
+ const shouldHandleLinuxDesktop = desktopOs === "linux" && !remote && stdinIsTTY && stdoutIsTTY;
285980
+ const shouldHandleDesktop = !currentSteps?.desktopAppInstalled && (shouldHandleLinuxDesktop || shouldOfferDesktopAppInstall({
285701
285981
  platform: platform3,
285702
285982
  stdinIsTTY,
285703
285983
  stdoutIsTTY,
@@ -285718,9 +285998,10 @@ var init_finalizeFlow = __esm({
285718
285998
  if (!shouldPromptMobile && !shouldHandleDesktop) {
285719
285999
  return;
285720
286000
  }
286001
+ const desktopAppName = DESKTOP_APP_NAMES[desktopOs === "linux" ? "linux" : "mac"];
285721
286002
  console.log("");
285722
286003
  console.log(
285723
- shouldPromptMobile && shouldHandleDesktop ? "While remote setup runs, set up the Mac app and mobile app." : shouldHandleDesktop ? "While remote setup runs, set up the Mac app." : "While remote setup runs, set up the mobile app."
286004
+ shouldPromptMobile && shouldHandleDesktop ? `While remote setup runs, set up the ${desktopAppName} and mobile app.` : shouldHandleDesktop ? `While remote setup runs, set up the ${desktopAppName}.` : "While remote setup runs, set up the mobile app."
285724
286005
  );
285725
286006
  console.log("");
285726
286007
  if (shouldPromptMobile) {
@@ -285742,6 +286023,26 @@ var init_finalizeFlow = __esm({
285742
286023
  if (!shouldHandleDesktop) {
285743
286024
  return;
285744
286025
  }
286026
+ if (desktopOs === "linux") {
286027
+ if (linuxDesktopAppEntry === null) {
286028
+ printLinuxDesktopAppDownload();
286029
+ return;
286030
+ }
286031
+ await updateInitState({
286032
+ steps: {
286033
+ desktopAppInstalled: true
286034
+ }
286035
+ });
286036
+ const launchedDesktopApp = desktopAppSelection !== null && await maybeOfferLinuxDesktopAppLaunchFn({
286037
+ app: { os: "linux", desktopEntry: linuxDesktopAppEntry },
286038
+ link: buildDesktopAppLink(desktopAppSelection)
286039
+ });
286040
+ console.log(
286041
+ launchedDesktopApp ? "Follow the remote setup thread in the `Boxes.dev` desktop app." : "Open `Boxes.dev` desktop app to follow the remote setup thread."
286042
+ );
286043
+ console.log("");
286044
+ return;
286045
+ }
285745
286046
  const desktopOutcome = await ensureDesktopAppInstalledForInitFn({
285746
286047
  platform: platform3,
285747
286048
  stdinIsTTY,
@@ -285755,7 +286056,7 @@ var init_finalizeFlow = __esm({
285755
286056
  });
285756
286057
  const launchedDesktopApp = await maybeOfferDesktopAppLaunchFn({
285757
286058
  installedAppPath: desktopOutcome.appPath,
285758
- startUrl: desktopAppLaunchUrl
286059
+ startUrl: desktopAppSelection === null ? null : buildDesktopAppWorkbenchUrl(desktopAppSelection)
285759
286060
  });
285760
286061
  console.log(
285761
286062
  launchedDesktopApp ? "Follow the remote setup thread in the `Boxes.dev` desktop app." : "Open `Boxes.dev` desktop app to follow the remote setup thread."
@@ -286291,10 +286592,7 @@ var init_finalizeFlow = __esm({
286291
286592
  await runCompanionAppOnboardingDuringInit({
286292
286593
  getInitState,
286293
286594
  updateInitState,
286294
- desktopAppLaunchUrl: buildDesktopAppWorkbenchUrl({
286295
- alias,
286296
- clientThreadId
286297
- })
286595
+ desktopAppSelection: { alias, clientThreadId }
286298
286596
  });
286299
286597
  }
286300
286598
  });
@@ -286365,10 +286663,10 @@ var init_finalizeFlow = __esm({
286365
286663
  await runCompanionAppOnboardingDuringInit({
286366
286664
  getInitState,
286367
286665
  updateInitState,
286368
- desktopAppLaunchUrl: buildDesktopAppWorkbenchUrl({
286666
+ desktopAppSelection: {
286369
286667
  alias,
286370
286668
  clientThreadId: await resolveDesktopSetupClientThreadId(threadId2)
286371
- })
286669
+ }
286372
286670
  });
286373
286671
  } finally {
286374
286672
  statusPaused = false;
@@ -292087,6 +292385,73 @@ var init_projectUrls = __esm({
292087
292385
  }
292088
292386
  });
292089
292387
 
292388
+ // src/devbox/commands/projectMaintenanceHistory.ts
292389
+ var readHistory, parseProjectMaintenanceHistoryArgs, runProjectMaintenanceHistory;
292390
+ var init_projectMaintenanceHistory = __esm({
292391
+ "src/devbox/commands/projectMaintenanceHistory.ts"() {
292392
+ "use strict";
292393
+ init_server();
292394
+ init_threadInventory();
292395
+ init_args();
292396
+ init_errors4();
292397
+ init_projects2();
292398
+ init_resourceOutput();
292399
+ readHistory = makeFunctionReference("maintenanceHistory:readForViewer");
292400
+ parseProjectMaintenanceHistoryArgs = (args) => {
292401
+ const command = args[0];
292402
+ const commandPath = ["projects", "maintenance", command ?? ""];
292403
+ if (command !== "runs" && command !== "logs") {
292404
+ throw usageError(
292405
+ commandPath,
292406
+ "Choose runs or logs for maintenance history."
292407
+ );
292408
+ }
292409
+ const { flags, positionals } = parseCommandArgs({
292410
+ args: args.slice(1),
292411
+ commandPath,
292412
+ flagLabel: "Maintenance history",
292413
+ boolean: ["json"],
292414
+ string: command === "logs" ? ["project", "run"] : ["project"]
292415
+ });
292416
+ if (positionals.length)
292417
+ throw usageError(commandPath, "This command does not accept arguments.");
292418
+ const runId = readStringFlag(flags, "run")?.trim() || null;
292419
+ if (command === "logs" && !runId) {
292420
+ throw usageError(
292421
+ commandPath,
292422
+ "Logs requires --run <run-id>. List recent runs to choose an ID."
292423
+ );
292424
+ }
292425
+ return {
292426
+ command,
292427
+ project: readStringFlag(flags, "project")?.trim() || null,
292428
+ json: readBooleanFlag(flags, "json"),
292429
+ runId
292430
+ };
292431
+ };
292432
+ runProjectMaintenanceHistory = async (args, dependencies) => {
292433
+ const parsed = parseProjectMaintenanceHistoryArgs(args);
292434
+ await runResourceCommand({
292435
+ json: parsed.json,
292436
+ dependencies,
292437
+ load: async ({ client }, requestId2) => {
292438
+ const project = await resolveCliAgentToolProjectSelection(
292439
+ client,
292440
+ parsed.project
292441
+ );
292442
+ const result = await client.query(readHistory, {
292443
+ projectFingerprint: project.fingerprint,
292444
+ runId: parsed.runId,
292445
+ requestId: requestId2
292446
+ });
292447
+ return { operation: parsed.command, project, result };
292448
+ },
292449
+ render: (data) => "runs" in data.result ? renderMaintenanceRunHistory(data.result) : renderMaintenanceRunLogs(data.result)
292450
+ });
292451
+ };
292452
+ }
292453
+ });
292454
+
292090
292455
  // src/devbox/commands/projectLifecycleMaintenance.ts
292091
292456
  import fs80 from "node:fs/promises";
292092
292457
  import path102 from "node:path";
@@ -292094,6 +292459,7 @@ var LIFECYCLE_SCRIPT_MAX_BYTES, WATCH_FILE_MAX_BYTES, getLifecycle, patchLifecyc
292094
292459
  var init_projectLifecycleMaintenance2 = __esm({
292095
292460
  "src/devbox/commands/projectLifecycleMaintenance.ts"() {
292096
292461
  "use strict";
292462
+ init_projectMaintenanceHistory();
292097
292463
  init_server();
292098
292464
  init_threadInventory();
292099
292465
  init_args();
@@ -292198,7 +292564,7 @@ var init_projectLifecycleMaintenance2 = __esm({
292198
292564
  if (command !== "get" && command !== "apply") {
292199
292565
  throw usageError(
292200
292566
  ["projects", "maintenance"],
292201
- "Choose get or apply for Template maintenance."
292567
+ "Choose get, apply, runs, or logs for Template maintenance."
292202
292568
  );
292203
292569
  }
292204
292570
  const commandPath = ["projects", "maintenance", command];
@@ -292379,6 +292745,9 @@ ${watchLines.join("\n")}` : "GitHub watches: none",
292379
292745
  });
292380
292746
  };
292381
292747
  runProjectMaintenanceWithDependencies = async (args, dependencies) => {
292748
+ if (args[0] === "runs" || args[0] === "logs") {
292749
+ return await runProjectMaintenanceHistory(args, dependencies);
292750
+ }
292382
292751
  const parsed = parseProjectMaintenanceArgs(args);
292383
292752
  await runResourceCommand({
292384
292753
  json: parsed.json,
@@ -297973,4 +298342,4 @@ react/cjs/react-jsx-runtime.development.js:
297973
298342
  *)
297974
298343
  */
297975
298344
 
297976
- //# debugId=86100a09-93c6-5205-b9f2-11ad102e2ba9
298345
+ //# debugId=f6d3678f-166c-58fc-bc7a-4fc93a5b76cd