@staff0rd/assist 0.487.1 → 0.488.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.487.1",
9
+ version: "0.488.0",
10
10
  type: "module",
11
11
  main: "dist/index.js",
12
12
  bin: {
@@ -580,7 +580,8 @@ var assistConfigShape = {
580
580
  windowsVersionCheck: z2.enum(["block", "warn", "off"]).default("block"),
581
581
  includeCommittedChanges: z2.boolean().default(true),
582
582
  topBar: z2.boolean().default(true),
583
- floatWaiting: z2.boolean().default(true)
583
+ floatWaiting: z2.boolean().default(true),
584
+ floatWaitingAfterMs: z2.number().default(5e3)
584
585
  }).optional(),
585
586
  database: z2.strictObject({
586
587
  url: z2.string().optional()
@@ -10664,10 +10665,19 @@ function sessionLayout(_req, res) {
10664
10665
  respondJson(res, 200, { topBar });
10665
10666
  }
10666
10667
 
10668
+ // src/commands/sessions/shared/sessionViewDefaults.ts
10669
+ var sessionViewDefaults = {
10670
+ floatWaiting: true,
10671
+ floatWaitingAfterMs: 5e3
10672
+ };
10673
+
10667
10674
  // src/commands/sessions/web/sessionView.ts
10668
10675
  function sessionView(_req, res) {
10669
- const floatWaiting = loadConfig().sessions?.floatWaiting ?? true;
10670
- respondJson(res, 200, { floatWaiting });
10676
+ const sessions = loadConfig().sessions;
10677
+ respondJson(res, 200, {
10678
+ floatWaiting: sessions?.floatWaiting ?? sessionViewDefaults.floatWaiting,
10679
+ floatWaitingAfterMs: sessions?.floatWaitingAfterMs ?? sessionViewDefaults.floatWaitingAfterMs
10680
+ });
10671
10681
  }
10672
10682
 
10673
10683
  // src/commands/config/coerceConfigScalar.ts
@@ -19052,7 +19062,11 @@ function allocateTree(requestedCwd, boundTreeRoots2, options2 = {}) {
19052
19062
  return { cwd: requestedCwd, kind: "primary", created: false };
19053
19063
  const clone = mainWorktree(repoRoot) ?? repoRoot;
19054
19064
  const reuse = { ...options2, includeDrafts: cfg.includeDrafts };
19055
- if (reusesClone(clone, boundTreeRoots2, reuse))
19065
+ if (mustLeaveTrunk(cfg.trunk, options2))
19066
+ daemonLog(
19067
+ `committing session spilled out of the clone ${clone}: worktree.trunk is on, so a commit here would land on the local mainline`
19068
+ );
19069
+ else if (reusesClone(clone, boundTreeRoots2, reuse))
19056
19070
  return { cwd: clone, kind: "primary", created: false, clone };
19057
19071
  const path71 = createWorktree(
19058
19072
  clone,
@@ -19061,6 +19075,9 @@ function allocateTree(requestedCwd, boundTreeRoots2, options2 = {}) {
19061
19075
  );
19062
19076
  return { cwd: path71, kind: "worktree", created: true, clone };
19063
19077
  }
19078
+ function mustLeaveTrunk(trunk, options2) {
19079
+ return trunk === true && options2.commits === true;
19080
+ }
19064
19081
  function keptInPlace(cwd) {
19065
19082
  daemonLog(
19066
19083
  `session kept in ${cwd}: launched against work already checked out there`
@@ -31585,6 +31602,15 @@ function isPrCheckoutArgs(args) {
31585
31602
  return rest.some((arg) => /^[1-9]\d*$/.test(arg));
31586
31603
  }
31587
31604
 
31605
+ // src/commands/sessions/daemon/worktree/isCommittingArgs.ts
31606
+ var ITEM_ID = /^a?\d+$/;
31607
+ function isCommittingArgs(args) {
31608
+ if (isPrCheckoutArgs(args)) return true;
31609
+ const [command, subcommand, ...rest] = args;
31610
+ if (command !== "backlog" || subcommand !== "run") return false;
31611
+ return rest.some((arg) => ITEM_ID.test(arg));
31612
+ }
31613
+
31588
31614
  // src/commands/sessions/daemon/worktree/spawnInTree.ts
31589
31615
  function allocateAndBind(ctx, cwd, create, options2 = {}) {
31590
31616
  const alloc = allocateTree(cwd, boundTreeRoots(ctx.sessions), options2);
@@ -31607,6 +31633,7 @@ function spawnAssistInTree(ctx, assistArgs, cwd, meta) {
31607
31633
  (sid, resolvedCwd, holdUntilSeeded) => createAssistSession(sid, assistArgs, resolvedCwd, meta, holdUntilSeeded),
31608
31634
  {
31609
31635
  forCheckout: isPrCheckoutArgs(assistArgs),
31636
+ commits: isCommittingArgs(assistArgs),
31610
31637
  draftLike: isDraftCommand(assistArgs[0]),
31611
31638
  inPlace: meta?.inPlace
31612
31639
  }
@@ -32363,6 +32390,11 @@ var sessionsConfigHelp = [
32363
32390
  setter: "assist config set sessions.floatWaiting false -g",
32364
32391
  note: "set false to stop the sidebar floating sessions that have been waiting on input for a few seconds above the other unstarred cards (default on)"
32365
32392
  },
32393
+ {
32394
+ key: "sessions.floatWaitingAfterMs",
32395
+ setter: "assist config set sessions.floatWaitingAfterMs 15000 -g",
32396
+ note: "how long a session must have been waiting on input before it floats (default: 5000ms)"
32397
+ },
32366
32398
  {
32367
32399
  key: "worktree.enabled",
32368
32400
  setter: "assist config set worktree.enabled true -g --repo",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@staff0rd/assist",
3
- "version": "0.487.1",
3
+ "version": "0.488.0",
4
4
  "type": "module",
5
5
  "main": "dist/index.js",
6
6
  "bin": {