@staff0rd/assist 0.849.0 → 0.850.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -6,7 +6,7 @@ import { Command } from "commander";
6
6
  // package.json
7
7
  var package_default = {
8
8
  name: "@staff0rd/assist",
9
- version: "0.849.0",
9
+ version: "0.850.0",
10
10
  type: "module",
11
11
  main: "dist/index.js",
12
12
  bin: {
@@ -27402,6 +27402,7 @@ var persistedSessionSchema = z10.object({
27402
27402
  design: z10.boolean().optional(),
27403
27403
  auto: z10.boolean().optional(),
27404
27404
  autoAdvance: z10.boolean().optional(),
27405
+ autoStart: z10.boolean().optional(),
27405
27406
  reviewStarted: z10.boolean().optional(),
27406
27407
  launchedFrom: z10.string().optional(),
27407
27408
  interrupted: z10.object({ reason: z10.string(), at: z10.number() }).optional(),
@@ -27434,6 +27435,7 @@ function toPersistedSession(session) {
27434
27435
  design: session.design,
27435
27436
  auto: session.auto,
27436
27437
  autoAdvance: session.autoAdvance,
27438
+ autoStart: session.autoStart,
27437
27439
  reviewStarted: session.reviewStarted,
27438
27440
  launchedFrom: session.launchedFrom,
27439
27441
  interrupted: session.interrupted,
@@ -43620,6 +43622,7 @@ function toSessionInfo(session) {
43620
43622
  harnessSessionId,
43621
43623
  restored,
43622
43624
  autoAdvance,
43625
+ autoStart,
43623
43626
  starred,
43624
43627
  design,
43625
43628
  verifying,
@@ -43645,6 +43648,7 @@ function toSessionInfo(session) {
43645
43648
  repoGroup: repoGroupForCwd(cwd),
43646
43649
  restored,
43647
43650
  autoAdvance,
43651
+ autoStart,
43648
43652
  starred,
43649
43653
  design,
43650
43654
  verifying,
@@ -43889,6 +43893,13 @@ function setAutoAdvance(sessions, id, enabled) {
43889
43893
  daemonLog(`session ${id} autoadvance ${enabled ? "on" : "off"}`);
43890
43894
  return true;
43891
43895
  }
43896
+ function setAutoStart(sessions, id, enabled) {
43897
+ const s = sessions.get(id);
43898
+ if (!s) return false;
43899
+ s.autoStart = enabled;
43900
+ daemonLog(`session ${id} autostart ${enabled ? "on" : "off"}`);
43901
+ return true;
43902
+ }
43892
43903
 
43893
43904
  // src/commands/sessions/daemon/SessionIo.ts
43894
43905
  var SessionIo = class {
@@ -45349,6 +45360,22 @@ function decidePrPreview(sessions, waiters, notify2, d) {
45349
45360
  notify2();
45350
45361
  }
45351
45362
 
45363
+ // src/commands/sessions/daemon/autoStartPreview.ts
45364
+ function autoStartPreview(sessions, waiters, notify2, session) {
45365
+ const preview = session.pendingPrPreview;
45366
+ if (!session.autoStart || !preview?.canStart) return false;
45367
+ daemonLog(
45368
+ `pr-preview auto-start: id=${session.id} requestId=${preview.requestId} (approving with autostart)`
45369
+ );
45370
+ decidePrPreview(sessions, waiters, notify2, {
45371
+ sessionId: session.id,
45372
+ requestId: preview.requestId,
45373
+ decision: "approve",
45374
+ autostart: true
45375
+ });
45376
+ return true;
45377
+ }
45378
+
45352
45379
  // src/commands/sessions/daemon/parsePreviewMetadata.ts
45353
45380
  function parsePreviewMetadata(value) {
45354
45381
  if (!Array.isArray(value)) return void 0;
@@ -45468,6 +45495,7 @@ function setPrPreview(sessions, waiters, notify2, client, d) {
45468
45495
  daemonLog(
45469
45496
  `pr-preview set: id=${id} requestId=${d.requestId} kind=${kind} target=${target} screenshots=${session.pendingPrPreview.screenshots?.length ?? 0}`
45470
45497
  );
45498
+ if (autoStartPreview(sessions, waiters, notify2, session)) return;
45471
45499
  notify2();
45472
45500
  }
45473
45501
 
@@ -47257,6 +47285,7 @@ function restoreBase(id, persisted) {
47257
47285
  design: persisted.design,
47258
47286
  auto: persisted.auto,
47259
47287
  autoAdvance: restoredAutoAdvance(id, persisted),
47288
+ autoStart: persisted.autoStart,
47260
47289
  reviewStarted: persisted.reviewStarted,
47261
47290
  launchedFrom: persisted.launchedFrom
47262
47291
  };
@@ -49846,6 +49875,15 @@ var sessionSettingHandlers = {
49846
49875
  )
49847
49876
  )
49848
49877
  ),
49878
+ "set-autostart": routed(
49879
+ (_client, m, d) => m.update(
49880
+ (sessions) => setAutoStart(
49881
+ sessions,
49882
+ d.sessionId,
49883
+ d.enabled
49884
+ )
49885
+ )
49886
+ ),
49849
49887
  rename: routed(
49850
49888
  (_client, m, d) => m.setTitle(d.sessionId, d.title ?? "")
49851
49889
  ),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@staff0rd/assist",
3
- "version": "0.849.0",
3
+ "version": "0.850.0",
4
4
  "type": "module",
5
5
  "main": "dist/index.js",
6
6
  "bin": {