@staff0rd/assist 0.958.0 → 0.959.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.958.0",
9
+ version: "0.959.0",
10
10
  type: "module",
11
11
  main: "dist/index.js",
12
12
  bin: {
@@ -1366,7 +1366,8 @@ var assistConfigShape = {
1366
1366
  includeCommittedChanges: z6.boolean().default(true),
1367
1367
  maxLive: z6.number().default(24),
1368
1368
  newSessionMode: z6.enum(["draft", "bug", "prompt", "design"]).default("draft"),
1369
- hotkeys: hotkeysSchema.optional()
1369
+ hotkeys: hotkeysSchema.optional(),
1370
+ askQuestion: z6.boolean().default(false)
1370
1371
  }).optional(),
1371
1372
  database: z6.strictObject({
1372
1373
  url: secretConfigValue(z6.string()).optional()
@@ -6182,6 +6183,15 @@ var adviceConfigHelp = [
6182
6183
  }
6183
6184
  ];
6184
6185
 
6186
+ // src/commands/askQuestion/askQuestionConfigHelp.ts
6187
+ var askQuestionConfigHelp = [
6188
+ {
6189
+ key: "sessions.askQuestion",
6190
+ setter: "assist config set sessions.askQuestion true -g",
6191
+ note: "opt in: assist ask-question answers AskUserQuestion questions from the session's web preview pane; when off it exits non-zero so Claude uses the built-in tool (default off)"
6192
+ }
6193
+ ];
6194
+
6185
6195
  // src/commands/backlog/backlogConfigHelp.ts
6186
6196
  var backlogConfigHelp = [
6187
6197
  {
@@ -6820,6 +6830,7 @@ var verifyConfigHelp = [
6820
6830
  var configHelpEntries = [
6821
6831
  ...Object.values(rootConfigHelp).flat(),
6822
6832
  ...adviceConfigHelp,
6833
+ ...askQuestionConfigHelp,
6823
6834
  ...autoUpdateConfigHelp,
6824
6835
  ...backlogConfigHelp,
6825
6836
  ...backupConfigHelp,
@@ -14667,6 +14678,17 @@ The reviewer left ${comments3.length} comment${comments3.length === 1 ? "" : "s"
14667
14678
  process.exit(1);
14668
14679
  }
14669
14680
 
14681
+ // src/commands/sessions/shared/toAnswers.ts
14682
+ function toAnswers(value) {
14683
+ if (typeof value !== "object" || value === null || Array.isArray(value))
14684
+ return void 0;
14685
+ return Object.fromEntries(
14686
+ Object.entries(value).filter(
14687
+ (entry) => typeof entry[1] === "string"
14688
+ )
14689
+ );
14690
+ }
14691
+
14670
14692
  // src/commands/sessions/shared/toAttachments.ts
14671
14693
  function toAttachments(value) {
14672
14694
  if (!Array.isArray(value)) return void 0;
@@ -14746,7 +14768,8 @@ function toPreviewDecision(msg) {
14746
14768
  checklist: toChecklist(msg.checklist),
14747
14769
  reviewEvent: REVIEW_EVENTS.find((event) => event === msg.reviewEvent),
14748
14770
  reviewComments: toReviewComments(msg.reviewComments),
14749
- dismissed: msg.dismissed === true
14771
+ dismissed: msg.dismissed === true,
14772
+ answers: toAnswers(msg.answers)
14750
14773
  };
14751
14774
  }
14752
14775
 
@@ -14871,10 +14894,133 @@ function registerAsk(program) {
14871
14894
  );
14872
14895
  }
14873
14896
 
14897
+ // src/commands/askQuestion.ts
14898
+ import { randomUUID as randomUUID4 } from "crypto";
14899
+
14900
+ // src/commands/askQuestion/formatAskQuestionAnswers.ts
14901
+ function formatAskQuestionAnswers(questions, answers) {
14902
+ const pairs = questions.map(({ question }) => `"${question}"="${answers[question] ?? ""}"`).join(", ");
14903
+ return `User has answered your questions: ${pairs}. You can now continue with the user's answers in mind.`;
14904
+ }
14905
+
14906
+ // src/commands/backlog/readJsonPayload.ts
14907
+ import { readFileSync as readFileSync21 } from "fs";
14908
+ import chalk36 from "chalk";
14909
+ function fail(message3) {
14910
+ console.error(chalk36.red(message3));
14911
+ process.exit(1);
14912
+ }
14913
+ function describe(error) {
14914
+ return error instanceof Error ? error.message : String(error);
14915
+ }
14916
+ async function readSource(source) {
14917
+ try {
14918
+ if (source === "-") return (await readStdinBuffer()).toString("utf8");
14919
+ return readFileSync21(source, "utf8");
14920
+ } catch (error) {
14921
+ return fail(
14922
+ `Cannot read the payload from ${source === "-" ? "stdin" : source}: ${describe(error)}`
14923
+ );
14924
+ }
14925
+ }
14926
+ async function readJsonPayload(source, schema2, subject) {
14927
+ const raw = await readSource(source);
14928
+ let json;
14929
+ try {
14930
+ json = JSON.parse(raw);
14931
+ } catch (error) {
14932
+ return fail(`The payload is not valid JSON: ${describe(error)}`);
14933
+ }
14934
+ const parsed = schema2.safeParse(json);
14935
+ if (!parsed.success) {
14936
+ const issues = parsed.error.issues.map((i) => ` ${i.path.join(".") || "(root)"}: ${i.message}`).join("\n");
14937
+ return fail(`The payload is not a valid ${subject}:
14938
+ ${issues}`);
14939
+ }
14940
+ return parsed.data;
14941
+ }
14942
+
14943
+ // src/commands/sessions/shared/askQuestionInputSchema.ts
14944
+ import { z as z9 } from "zod";
14945
+ var askQuestionOptionSchema = z9.object({
14946
+ label: z9.string().min(1),
14947
+ description: z9.string(),
14948
+ preview: z9.string().optional()
14949
+ });
14950
+ var askQuestionSchema = z9.object({
14951
+ question: z9.string().min(1),
14952
+ header: z9.string().min(1),
14953
+ multiSelect: z9.boolean(),
14954
+ options: z9.array(askQuestionOptionSchema).min(2, "Each question needs at least 2 options").max(4, "Each question allows at most 4 options").refine(
14955
+ (options2) => new Set(options2.map((option) => option.label)).size === options2.length,
14956
+ "Option labels must be unique within a question"
14957
+ )
14958
+ });
14959
+ var askQuestionInputSchema = z9.object({
14960
+ questions: z9.array(askQuestionSchema).min(1, "Ask at least 1 question").max(4, "Ask at most 4 questions").refine(
14961
+ (questions) => new Set(questions.map((q) => q.question)).size === questions.length,
14962
+ "Question texts must be unique"
14963
+ )
14964
+ });
14965
+
14966
+ // src/commands/askQuestion.ts
14967
+ function useBuiltIn(reason4) {
14968
+ console.error(`Error: ${reason4}; use the built-in AskUserQuestion tool.`);
14969
+ process.exit(1);
14970
+ }
14971
+ async function askQuestion(options2) {
14972
+ const { questions } = await readJsonPayload(
14973
+ options2.json,
14974
+ askQuestionInputSchema,
14975
+ "AskUserQuestion input"
14976
+ );
14977
+ const sessionId = process.env.ASSIST_SESSION_ID;
14978
+ if (process.env.ASSIST_SESSION !== "1" || !sessionId)
14979
+ useBuiltIn("not running in an assist session");
14980
+ if (!loadConfig().sessions?.askQuestion)
14981
+ useBuiltIn("assist ask-question is disabled (sessions.askQuestion)");
14982
+ const title = questions.length === 1 ? "Claude is asking a question" : `Claude is asking ${questions.length} questions`;
14983
+ const decision = await awaitPreviewApproval(
14984
+ title,
14985
+ {
14986
+ sessionId,
14987
+ requestId: randomUUID4(),
14988
+ title,
14989
+ body: JSON.stringify({ questions }),
14990
+ prNumber: null,
14991
+ kind: "question"
14992
+ },
14993
+ { rejectIsOutcome: true }
14994
+ );
14995
+ if (decision.decision === "reject") {
14996
+ console.error(
14997
+ "The user declined to answer the questions. Do not assume answers; continue without them or ask again in chat if they are essential."
14998
+ );
14999
+ process.exit(1);
15000
+ }
15001
+ console.log(formatAskQuestionAnswers(questions, decision.answers ?? {}));
15002
+ }
15003
+
15004
+ // src/commands/registerAskQuestion.ts
15005
+ function registerAskQuestion(program) {
15006
+ internalCommand(
15007
+ configHelp(
15008
+ program.command("ask-question").description(
15009
+ "Ask the AskUserQuestion questions in the session's web preview pane and wait for the answers; prints the same result text as the built-in tool"
15010
+ ).requiredOption(
15011
+ "--json <file|->",
15012
+ "AskUserQuestion input JSON ({questions: [...]}), or - for stdin"
15013
+ ).action(askQuestion),
15014
+ askQuestionConfigHelp
15015
+ ),
15016
+ "Claude in place of AskUserQuestion"
15017
+ );
15018
+ }
15019
+
14874
15020
  // src/commands/registerBackup.ts
14875
15021
  import { mkdir as mkdir3, stat as stat4 } from "fs/promises";
14876
15022
  import { join as join42, resolve as resolve15 } from "path";
14877
- import chalk38 from "chalk";
15023
+ import chalk39 from "chalk";
14878
15024
 
14879
15025
  // src/shared/db/recordBackup.ts
14880
15026
  async function recordBackup(db, {
@@ -14888,7 +15034,7 @@ async function recordBackup(db, {
14888
15034
  // src/commands/backup/scheduleBackup.ts
14889
15035
  import { mkdir as mkdir2 } from "fs/promises";
14890
15036
  import { join as join41 } from "path";
14891
- import chalk36 from "chalk";
15037
+ import chalk37 from "chalk";
14892
15038
 
14893
15039
  // src/commands/backup/readCrontab.ts
14894
15040
  import { execSync as execSync15 } from "child_process";
@@ -15013,15 +15159,15 @@ function readScheduleBlock(crontab) {
15013
15159
  }
15014
15160
 
15015
15161
  // src/commands/backup/scheduleBackup.ts
15016
- function fail(message3) {
15017
- console.error(chalk36.red(message3));
15162
+ function fail2(message3) {
15163
+ console.error(chalk37.red(message3));
15018
15164
  process.exit(1);
15019
15165
  }
15020
15166
  async function scheduleBackup({
15021
15167
  every
15022
15168
  }) {
15023
15169
  if (!every) {
15024
- fail(
15170
+ fail2(
15025
15171
  "Missing --every <duration>. Run `assist backup schedule --every 6h`, or `assist backup schedule status` to inspect the current schedule."
15026
15172
  );
15027
15173
  }
@@ -15033,12 +15179,12 @@ async function scheduleBackup({
15033
15179
  const cronLine = `${cronExpr} ${resolveAssistCommand()} backup >> ${logPath2} 2>&1`;
15034
15180
  writeCrontab(upsertScheduleBlock(readCrontab(), every, cronLine));
15035
15181
  console.error(
15036
- chalk36.green(
15182
+ chalk37.green(
15037
15183
  `Scheduled assist backup every ${every} (${cronExpr}). Output is appended to ${logPath2}.`
15038
15184
  )
15039
15185
  );
15040
15186
  } catch (error) {
15041
- fail(error.message);
15187
+ fail2(error.message);
15042
15188
  }
15043
15189
  }
15044
15190
  function scheduleStatus() {
@@ -15060,14 +15206,14 @@ function scheduleRemove() {
15060
15206
  try {
15061
15207
  writeCrontab(removeScheduleBlock(current));
15062
15208
  } catch (error) {
15063
- fail(error.message);
15209
+ fail2(error.message);
15064
15210
  }
15065
- console.error(chalk36.green("Removed the assist backup schedule."));
15211
+ console.error(chalk37.green("Removed the assist backup schedule."));
15066
15212
  }
15067
15213
 
15068
15214
  // src/commands/backlog/exportBacklog.ts
15069
15215
  import { writeFile as writeFile3 } from "fs/promises";
15070
- import chalk37 from "chalk";
15216
+ import chalk38 from "chalk";
15071
15217
 
15072
15218
  // src/commands/backlog/dump/DumpTable.ts
15073
15219
  var DUMP_FORMAT = "assist-backlog-dump";
@@ -15195,7 +15341,7 @@ async function exportBacklog(file) {
15195
15341
  if (file) {
15196
15342
  await writeFile3(file, dump);
15197
15343
  console.error(
15198
- chalk37.green(`Exported backlog to ${file} (${dump.length} bytes).`)
15344
+ chalk38.green(`Exported backlog to ${file} (${dump.length} bytes).`)
15199
15345
  );
15200
15346
  return;
15201
15347
  }
@@ -15216,7 +15362,7 @@ async function backup({ out }) {
15216
15362
  await recordBackup(db, { filePath, sizeBytes: size, durationMs });
15217
15363
  const elapsed = (durationMs / 1e3).toFixed(1);
15218
15364
  console.error(
15219
- chalk38.green(`Recorded backup ${filePath} (${size} bytes) in ${elapsed}s.`)
15365
+ chalk39.green(`Recorded backup ${filePath} (${size} bytes) in ${elapsed}s.`)
15220
15366
  );
15221
15367
  }
15222
15368
  function registerBackup(program) {
@@ -15349,7 +15495,7 @@ function markAgentCommands(cmd) {
15349
15495
  }
15350
15496
 
15351
15497
  // src/commands/backlog/addActivity.ts
15352
- import chalk39 from "chalk";
15498
+ import chalk40 from "chalk";
15353
15499
 
15354
15500
  // src/shared/db/recordGitRef.ts
15355
15501
  async function recordGitRef(db, itemId2, ref) {
@@ -15444,7 +15590,7 @@ async function addActivity(id, kind, ref, options2) {
15444
15590
  const parsedKind = gitRefKindSchema.safeParse(kind);
15445
15591
  if (!parsedKind.success) {
15446
15592
  console.log(
15447
- chalk39.red(
15593
+ chalk40.red(
15448
15594
  `Invalid kind "${kind}". Expected one of: ${gitRefKindSchema.options.join(", ")}.`
15449
15595
  )
15450
15596
  );
@@ -15467,14 +15613,14 @@ async function addActivity(id, kind, ref, options2) {
15467
15613
  state: options2.state
15468
15614
  });
15469
15615
  console.log(
15470
- chalk39.green(
15616
+ chalk40.green(
15471
15617
  `Attached ${parsedKind.data} "${ref}" to item ${formatItemId(item.id)}.`
15472
15618
  )
15473
15619
  );
15474
15620
  }
15475
15621
 
15476
15622
  // src/commands/backlog/recordSlack.ts
15477
- import chalk40 from "chalk";
15623
+ import chalk41 from "chalk";
15478
15624
 
15479
15625
  // src/shared/resolveSessionItemId.ts
15480
15626
  var ITEM_ID_ENV = "ASSIST_BACKLOG_ITEM_ID";
@@ -15523,14 +15669,14 @@ async function recordSlack(url, options2) {
15523
15669
  return;
15524
15670
  case "recorded":
15525
15671
  console.log(
15526
- chalk40.green(
15672
+ chalk41.green(
15527
15673
  `Attached Slack link to item ${formatItemId(result.itemId)}.`
15528
15674
  )
15529
15675
  );
15530
15676
  return;
15531
15677
  case "failed":
15532
15678
  console.error(
15533
- chalk40.red(
15679
+ chalk41.red(
15534
15680
  `Failed to record Slack link against item ${formatItemId(result.itemId)}: ${errorMessage2(result.error)}`
15535
15681
  )
15536
15682
  );
@@ -15558,11 +15704,11 @@ function registerActivityCommands(cmd) {
15558
15704
  }
15559
15705
 
15560
15706
  // src/commands/backlog/associateGithub.ts
15561
- import chalk42 from "chalk";
15707
+ import chalk43 from "chalk";
15562
15708
  import { eq as eq26 } from "drizzle-orm";
15563
15709
 
15564
15710
  // src/commands/backlog/beginAssociation.ts
15565
- import chalk41 from "chalk";
15711
+ import chalk42 from "chalk";
15566
15712
  import { eq as eq25 } from "drizzle-orm";
15567
15713
  async function beginAssociation(id, options2, clearPatch, label) {
15568
15714
  const found = await findOneItem(id);
@@ -15575,7 +15721,7 @@ async function beginAssociation(id, options2, clearPatch, label) {
15575
15721
  if (options2.clear) {
15576
15722
  await orm.update(items).set(clearPatch).where(eq25(items.id, itemId2));
15577
15723
  console.log(
15578
- chalk41.green(
15724
+ chalk42.green(
15579
15725
  `Cleared ${label} association on item ${formatItemId(itemId2)}.`
15580
15726
  )
15581
15727
  );
@@ -15625,7 +15771,7 @@ async function associateGithub(id, issue, options2) {
15625
15771
  const { orm, itemId: itemId2 } = target;
15626
15772
  if (!issue) {
15627
15773
  console.log(
15628
- chalk42.red("Provide a GitHub issue, or use --clear to remove one.")
15774
+ chalk43.red("Provide a GitHub issue, or use --clear to remove one.")
15629
15775
  );
15630
15776
  process.exitCode = 1;
15631
15777
  return;
@@ -15633,7 +15779,7 @@ async function associateGithub(id, issue, options2) {
15633
15779
  const normalized = normalizeGithubIssue(issue);
15634
15780
  if (!normalized) {
15635
15781
  console.log(
15636
- chalk42.red(
15782
+ chalk43.red(
15637
15783
  `Malformed GitHub issue "${issue}". Expected owner/repo#number or a github.com issue URL.`
15638
15784
  )
15639
15785
  );
@@ -15643,8 +15789,8 @@ async function associateGithub(id, issue, options2) {
15643
15789
  const title = fetchGithubIssueTitle(normalized);
15644
15790
  await orm.update(items).set({ githubIssue: normalized, jiraKey: null }).where(eq26(items.id, itemId2));
15645
15791
  console.log(
15646
- chalk42.green(`Associated ${normalized} with item ${formatItemId(itemId2)}.`),
15647
- title ? chalk42.dim(`(${title})`) : ""
15792
+ chalk43.green(`Associated ${normalized} with item ${formatItemId(itemId2)}.`),
15793
+ title ? chalk43.dim(`(${title})`) : ""
15648
15794
  );
15649
15795
  }
15650
15796
 
@@ -15654,12 +15800,12 @@ function registerAssociateGithubCommand(cmd) {
15654
15800
  }
15655
15801
 
15656
15802
  // src/commands/backlog/associateJira.ts
15657
- import chalk44 from "chalk";
15803
+ import chalk45 from "chalk";
15658
15804
  import { eq as eq27 } from "drizzle-orm";
15659
15805
 
15660
15806
  // src/commands/jira/fetchIssue.ts
15661
15807
  import { execSync as execSync17 } from "child_process";
15662
- import chalk43 from "chalk";
15808
+ import chalk44 from "chalk";
15663
15809
  function fetchIssue(issueKey, fields) {
15664
15810
  let result;
15665
15811
  try {
@@ -15672,15 +15818,15 @@ function fetchIssue(issueKey, fields) {
15672
15818
  const stderr = error.stderr;
15673
15819
  if (stderr.includes("unauthorized")) {
15674
15820
  console.error(
15675
- chalk43.red("Jira authentication expired."),
15821
+ chalk44.red("Jira authentication expired."),
15676
15822
  "Run",
15677
- chalk43.cyan("assist jira auth"),
15823
+ chalk44.cyan("assist jira auth"),
15678
15824
  "to re-authenticate."
15679
15825
  );
15680
15826
  process.exit(1);
15681
15827
  }
15682
15828
  }
15683
- console.error(chalk43.red(`Failed to fetch ${issueKey}.`));
15829
+ console.error(chalk44.red(`Failed to fetch ${issueKey}.`));
15684
15830
  process.exit(1);
15685
15831
  }
15686
15832
  return JSON.parse(result);
@@ -15703,14 +15849,14 @@ async function associateJira(id, key, options2) {
15703
15849
  if (!target) return;
15704
15850
  const { orm, itemId: itemId2 } = target;
15705
15851
  if (!key) {
15706
- console.log(chalk44.red("Provide a Jira key, or use --clear to remove one."));
15852
+ console.log(chalk45.red("Provide a Jira key, or use --clear to remove one."));
15707
15853
  process.exitCode = 1;
15708
15854
  return;
15709
15855
  }
15710
15856
  const normalized = normalizeJiraKey(key);
15711
15857
  if (!normalized) {
15712
15858
  console.log(
15713
- chalk44.red(
15859
+ chalk45.red(
15714
15860
  `Malformed Jira key "${key}". Expected a key like PROJ-123 or a browse URL.`
15715
15861
  )
15716
15862
  );
@@ -15722,8 +15868,8 @@ async function associateJira(id, key, options2) {
15722
15868
  const summary = fields?.summary;
15723
15869
  await orm.update(items).set({ jiraKey: normalized, githubIssue: null }).where(eq27(items.id, itemId2));
15724
15870
  console.log(
15725
- chalk44.green(`Associated ${normalized} with item ${formatItemId(itemId2)}.`),
15726
- summary ? chalk44.dim(`(${summary})`) : ""
15871
+ chalk45.green(`Associated ${normalized} with item ${formatItemId(itemId2)}.`),
15872
+ summary ? chalk45.dim(`(${summary})`) : ""
15727
15873
  );
15728
15874
  }
15729
15875
 
@@ -15736,7 +15882,7 @@ function registerAssociateJiraCommand(cmd) {
15736
15882
  import { spawnSync as spawnSync4 } from "child_process";
15737
15883
  import { existsSync as existsSync38 } from "fs";
15738
15884
  import { mkdir as mkdir4 } from "fs/promises";
15739
- import chalk45 from "chalk";
15885
+ import chalk46 from "chalk";
15740
15886
 
15741
15887
  // src/commands/backlog/originToSshUrl.ts
15742
15888
  function originToSshUrl(origin) {
@@ -15750,43 +15896,43 @@ function originToSshUrl(origin) {
15750
15896
  }
15751
15897
 
15752
15898
  // src/commands/backlog/cloneRepo.ts
15753
- function fail2(message3) {
15754
- console.log(chalk45.red(message3));
15899
+ function fail3(message3) {
15900
+ console.log(chalk46.red(message3));
15755
15901
  process.exitCode = 1;
15756
15902
  }
15757
15903
  async function cloneRepo(originRaw) {
15758
15904
  if (originRaw.trim().startsWith("local:")) {
15759
- return fail2(
15905
+ return fail3(
15760
15906
  `"${originRaw.trim()}" has no remote and cannot be cloned (local: origins are not clonable).`
15761
15907
  );
15762
15908
  }
15763
15909
  const origin = normalizeOrigin(originRaw);
15764
15910
  const sshUrl = originToSshUrl(origin);
15765
15911
  if (!sshUrl) {
15766
- return fail2(`Could not derive an SSH remote from "${origin}".`);
15912
+ return fail3(`Could not derive an SSH remote from "${origin}".`);
15767
15913
  }
15768
15914
  const baseDir = expandTilde(loadConfig().clone.baseDir);
15769
15915
  const target = cloneTargetDir(origin, baseDir);
15770
15916
  if (!target) {
15771
- return fail2(`Could not derive a repository name from "${origin}".`);
15917
+ return fail3(`Could not derive a repository name from "${origin}".`);
15772
15918
  }
15773
15919
  if (existsSync38(target)) {
15774
- return fail2(`Clone target already exists: ${target}`);
15920
+ return fail3(`Clone target already exists: ${target}`);
15775
15921
  }
15776
15922
  await mkdir4(baseDir, { recursive: true });
15777
- console.error(chalk45.dim(`Cloning ${sshUrl} into ${target}`));
15923
+ console.error(chalk46.dim(`Cloning ${sshUrl} into ${target}`));
15778
15924
  const result = spawnSync4("git", ["clone", sshUrl, target], {
15779
15925
  stdio: "inherit"
15780
15926
  });
15781
15927
  if (result.error) {
15782
- return fail2(`Failed to run git clone: ${result.error.message}`);
15928
+ return fail3(`Failed to run git clone: ${result.error.message}`);
15783
15929
  }
15784
15930
  if (result.status !== 0) {
15785
- return fail2(
15931
+ return fail3(
15786
15932
  `git clone failed with exit code ${result.status ?? "unknown"}.`
15787
15933
  );
15788
15934
  }
15789
- console.error(chalk45.green(`Cloned ${origin} into ${target}`));
15935
+ console.error(chalk46.green(`Cloned ${origin} into ${target}`));
15790
15936
  }
15791
15937
 
15792
15938
  // src/commands/backlog/registerCloneCommand.ts
@@ -15797,26 +15943,26 @@ function registerCloneCommand(cmd) {
15797
15943
  }
15798
15944
 
15799
15945
  // src/commands/backlog/comment.ts
15800
- import chalk46 from "chalk";
15946
+ import chalk47 from "chalk";
15801
15947
  async function comment(id, text18) {
15802
15948
  const found = await findOneItem(id);
15803
15949
  if (!found) process.exit(1);
15804
15950
  await appendComment(found.orm, found.item.id, text18);
15805
15951
  console.log(
15806
- chalk46.green(`Comment added to item ${formatItemId(found.item.id)}.`)
15952
+ chalk47.green(`Comment added to item ${formatItemId(found.item.id)}.`)
15807
15953
  );
15808
15954
  }
15809
15955
 
15810
15956
  // src/commands/backlog/comments.ts
15811
- import chalk48 from "chalk";
15957
+ import chalk49 from "chalk";
15812
15958
 
15813
15959
  // src/commands/backlog/formatComment.ts
15814
- import chalk47 from "chalk";
15960
+ import chalk48 from "chalk";
15815
15961
  function formatComment(entry) {
15816
- const id = entry.id !== void 0 ? chalk47.dim(`#${entry.id} `) : "";
15817
- const tag = entry.type === "summary" ? chalk47.magenta("[summary]") : chalk47.cyan("[comment]");
15818
- const phase = entry.phase !== void 0 ? chalk47.dim(` (phase ${entry.phase})`) : "";
15819
- const time = chalk47.dim(entry.timestamp);
15962
+ const id = entry.id !== void 0 ? chalk48.dim(`#${entry.id} `) : "";
15963
+ const tag = entry.type === "summary" ? chalk48.magenta("[summary]") : chalk48.cyan("[comment]");
15964
+ const phase = entry.phase !== void 0 ? chalk48.dim(` (phase ${entry.phase})`) : "";
15965
+ const time = chalk48.dim(entry.timestamp);
15820
15966
  return `${id}${tag}${phase} ${time}
15821
15967
  ${entry.text}`;
15822
15968
  }
@@ -15828,11 +15974,11 @@ async function comments2(id) {
15828
15974
  const { item } = found;
15829
15975
  const entries = item.comments ?? [];
15830
15976
  if (entries.length === 0) {
15831
- console.log(chalk48.dim(`No comments on item ${formatItemId(item.id)}.`));
15977
+ console.log(chalk49.dim(`No comments on item ${formatItemId(item.id)}.`));
15832
15978
  return;
15833
15979
  }
15834
15980
  console.log(
15835
- chalk48.bold(`Comments for ${formatItemId(item.id)}: ${item.name}
15981
+ chalk49.bold(`Comments for ${formatItemId(item.id)}: ${item.name}
15836
15982
  `)
15837
15983
  );
15838
15984
  for (const entry of entries) {
@@ -15842,7 +15988,7 @@ async function comments2(id) {
15842
15988
  }
15843
15989
 
15844
15990
  // src/commands/backlog/deleteCommentCmd.ts
15845
- import chalk49 from "chalk";
15991
+ import chalk50 from "chalk";
15846
15992
  async function deleteCommentCmd(id, commentId) {
15847
15993
  const found = await findOneItem(id);
15848
15994
  if (!found) process.exit(1);
@@ -15855,14 +16001,14 @@ async function deleteCommentCmd(id, commentId) {
15855
16001
  switch (outcome) {
15856
16002
  case "deleted":
15857
16003
  console.log(
15858
- chalk49.green(
16004
+ chalk50.green(
15859
16005
  `Comment #${commentId} deleted from item ${formatItemId(itemId2)}.`
15860
16006
  )
15861
16007
  );
15862
16008
  break;
15863
16009
  case "not-found":
15864
16010
  console.log(
15865
- chalk49.red(
16011
+ chalk50.red(
15866
16012
  `Comment #${commentId} not found on item ${formatItemId(itemId2)}.`
15867
16013
  )
15868
16014
  );
@@ -15870,7 +16016,7 @@ async function deleteCommentCmd(id, commentId) {
15870
16016
  break;
15871
16017
  case "is-summary":
15872
16018
  console.log(
15873
- chalk49.red(
16019
+ chalk50.red(
15874
16020
  `Comment #${commentId} is a phase summary and cannot be deleted.`
15875
16021
  )
15876
16022
  );
@@ -15898,7 +16044,7 @@ function registerExportCommand(cmd) {
15898
16044
 
15899
16045
  // src/commands/backlog/importBacklog.ts
15900
16046
  import { readFile as readFile3 } from "fs/promises";
15901
- import chalk51 from "chalk";
16047
+ import chalk52 from "chalk";
15902
16048
 
15903
16049
  // src/commands/backlog/dump/countCopyRows.ts
15904
16050
  function countCopyRows(data) {
@@ -15970,7 +16116,7 @@ function validateDump({ header, sections }) {
15970
16116
  }
15971
16117
 
15972
16118
  // src/commands/backlog/import/confirmReplace.ts
15973
- import chalk50 from "chalk";
16119
+ import chalk51 from "chalk";
15974
16120
  async function countRows(client, table) {
15975
16121
  const { rows } = await client.query(
15976
16122
  `SELECT count(*)::int AS n FROM ${table}`
@@ -15981,7 +16127,7 @@ function printSummary(tables, current, incoming) {
15981
16127
  const lines2 = tables.map(
15982
16128
  (t, i) => ` ${t.name}: ${current[i]} \u2192 ${incoming[i]} rows`
15983
16129
  );
15984
- console.error(chalk50.bold("\nThis will REPLACE all backlog data:"));
16130
+ console.error(chalk51.bold("\nThis will REPLACE all backlog data:"));
15985
16131
  console.error(`${lines2.join("\n")}
15986
16132
  `);
15987
16133
  }
@@ -16074,13 +16220,13 @@ async function importBacklog(file, options2 = {}) {
16074
16220
  );
16075
16221
  await withDbClient(async (client) => {
16076
16222
  if (!options2.yes && !await confirmReplace(client, tables, incoming, !file)) {
16077
- console.error(chalk51.yellow("Import cancelled; no changes made."));
16223
+ console.error(chalk52.yellow("Import cancelled; no changes made."));
16078
16224
  return;
16079
16225
  }
16080
16226
  await restore(client, parsed);
16081
16227
  const total2 = incoming.reduce((sum3, n) => sum3 + n, 0);
16082
16228
  console.error(
16083
- chalk51.green(
16229
+ chalk52.green(
16084
16230
  `Imported backlog: ${total2} rows restored across ${tables.length} tables.`
16085
16231
  )
16086
16232
  );
@@ -16097,7 +16243,7 @@ function registerImportCommand(cmd) {
16097
16243
  }
16098
16244
 
16099
16245
  // src/commands/backlog/add.ts
16100
- import chalk53 from "chalk";
16246
+ import chalk54 from "chalk";
16101
16247
 
16102
16248
  // src/lib/isClaudeCode.ts
16103
16249
  function isClaudeCode() {
@@ -16171,11 +16317,11 @@ async function createItemWithDefaults(fields) {
16171
16317
  }
16172
16318
 
16173
16319
  // src/commands/backlog/ensureRemoteOrigin.ts
16174
- import chalk52 from "chalk";
16320
+ import chalk53 from "chalk";
16175
16321
  function ensureRemoteOrigin() {
16176
16322
  if (getRemoteOriginUrl(getBacklogDir())) return true;
16177
16323
  console.log(
16178
- chalk52.red(
16324
+ chalk53.red(
16179
16325
  "Backlog requires a git remote so items get a stable origin.\nAdd one with: git remote add origin <url>"
16180
16326
  )
16181
16327
  );
@@ -16185,7 +16331,7 @@ function ensureRemoteOrigin() {
16185
16331
 
16186
16332
  // src/commands/backlog/add/shared.ts
16187
16333
  import { spawnSync as spawnSync5 } from "child_process";
16188
- import { mkdtempSync, readFileSync as readFileSync21, unlinkSync as unlinkSync3, writeFileSync as writeFileSync18 } from "fs";
16334
+ import { mkdtempSync, readFileSync as readFileSync22, unlinkSync as unlinkSync3, writeFileSync as writeFileSync18 } from "fs";
16189
16335
  import { tmpdir } from "os";
16190
16336
  import { join as join45 } from "path";
16191
16337
  import enquirer4 from "enquirer";
@@ -16235,7 +16381,7 @@ function openEditor() {
16235
16381
  unlinkSync3(filePath);
16236
16382
  return void 0;
16237
16383
  }
16238
- const content = readFileSync21(filePath, "utf8").trim();
16384
+ const content = readFileSync22(filePath, "utf8").trim();
16239
16385
  unlinkSync3(filePath);
16240
16386
  return content || void 0;
16241
16387
  }
@@ -16257,7 +16403,7 @@ async function promptAcceptanceCriteria() {
16257
16403
  async function add(options2) {
16258
16404
  if (isClaudeCode()) {
16259
16405
  console.error(
16260
- chalk53.red(
16406
+ chalk54.red(
16261
16407
  "Error: 'assist backlog add' is for human use. Compose the whole item \u2014 name, type, description, acceptance criteria and every phase \u2014 and run 'assist backlog propose --json <file|->' so it is previewed and approved before anything is written."
16262
16408
  )
16263
16409
  );
@@ -16275,14 +16421,14 @@ async function add(options2) {
16275
16421
  description,
16276
16422
  acceptanceCriteria: acceptanceCriteria2
16277
16423
  });
16278
- console.log(chalk53.green(`Added item ${formatItemId(id)}: ${name}`));
16424
+ console.log(chalk54.green(`Added item ${formatItemId(id)}: ${name}`));
16279
16425
  }
16280
16426
 
16281
16427
  // src/commands/backlog/addPhase.ts
16282
- import chalk55 from "chalk";
16428
+ import chalk56 from "chalk";
16283
16429
 
16284
16430
  // src/commands/backlog/resolveInsertPosition.ts
16285
- import chalk54 from "chalk";
16431
+ import chalk55 from "chalk";
16286
16432
  import { count as count3, eq as eq30 } from "drizzle-orm";
16287
16433
  async function resolveInsertPosition(orm, itemId2, position) {
16288
16434
  const [row3] = await orm.select({ cnt: count3() }).from(planPhases).where(eq30(planPhases.itemId, itemId2));
@@ -16291,7 +16437,7 @@ async function resolveInsertPosition(orm, itemId2, position) {
16291
16437
  const pos = Number.parseInt(position, 10);
16292
16438
  if (pos < 1 || pos > phaseCount + 1) {
16293
16439
  console.log(
16294
- chalk54.red(
16440
+ chalk55.red(
16295
16441
  `Position ${pos} is out of range. Must be between 1 and ${phaseCount + 1}.`
16296
16442
  )
16297
16443
  );
@@ -16302,7 +16448,7 @@ async function resolveInsertPosition(orm, itemId2, position) {
16302
16448
  }
16303
16449
 
16304
16450
  // src/commands/backlog/addPhase/reviewProposedPhase.ts
16305
- import { randomUUID as randomUUID4 } from "crypto";
16451
+ import { randomUUID as randomUUID5 } from "crypto";
16306
16452
 
16307
16453
  // src/commands/backlog/renderPhaseSection.ts
16308
16454
  function renderPhaseSection(phase, idx) {
@@ -16326,7 +16472,7 @@ async function reviewProposedPhase(item, phaseIdx, phase) {
16326
16472
  return;
16327
16473
  await awaitPreviewApproval("Backlog phase preview", {
16328
16474
  sessionId,
16329
- requestId: randomUUID4(),
16475
+ requestId: randomUUID5(),
16330
16476
  title: `Add a phase to ${formatItemId(item.id)}: ${item.name}`,
16331
16477
  body: renderPhaseSection(phase, phaseIdx),
16332
16478
  prNumber: null,
@@ -16342,7 +16488,7 @@ async function addPhase(id, name, options2) {
16342
16488
  if (!found) return;
16343
16489
  const tasks = options2.task ?? [];
16344
16490
  if (tasks.length === 0) {
16345
- console.log(chalk55.red("At least one --task is required."));
16491
+ console.log(chalk56.red("At least one --task is required."));
16346
16492
  process.exitCode = 1;
16347
16493
  return;
16348
16494
  }
@@ -16366,43 +16512,43 @@ async function addPhase(id, name, options2) {
16366
16512
  );
16367
16513
  const verb = options2.position !== void 0 ? "Inserted" : "Added";
16368
16514
  console.log(
16369
- chalk55.green(
16515
+ chalk56.green(
16370
16516
  `${verb} phase ${phaseIdx + 1} "${name}" to item ${formatItemId(itemId2)} with ${tasks.length} task(s).`
16371
16517
  )
16372
16518
  );
16373
16519
  }
16374
16520
 
16375
16521
  // src/commands/backlog/list.ts
16376
- import chalk57 from "chalk";
16522
+ import chalk58 from "chalk";
16377
16523
 
16378
16524
  // src/commands/backlog/list/shared.ts
16379
- import chalk56 from "chalk";
16525
+ import chalk57 from "chalk";
16380
16526
  function statusIcon(status2) {
16381
16527
  switch (status2) {
16382
16528
  case "todo":
16383
- return chalk56.dim("[ ]");
16529
+ return chalk57.dim("[ ]");
16384
16530
  case "in-progress":
16385
- return chalk56.yellow("[~]");
16531
+ return chalk57.yellow("[~]");
16386
16532
  case "done":
16387
- return chalk56.green("[x]");
16533
+ return chalk57.green("[x]");
16388
16534
  case "wontdo":
16389
- return chalk56.dim("[-]");
16535
+ return chalk57.dim("[-]");
16390
16536
  }
16391
16537
  }
16392
16538
  function starMarker(item) {
16393
- return item.starred ? `${chalk56.yellow("\u2605")} ` : "";
16539
+ return item.starred ? `${chalk57.yellow("\u2605")} ` : "";
16394
16540
  }
16395
16541
  function typeLabel(type) {
16396
16542
  switch (type) {
16397
16543
  case "bug":
16398
- return chalk56.magenta("Bug");
16544
+ return chalk57.magenta("Bug");
16399
16545
  case "story":
16400
- return chalk56.cyan("Story");
16546
+ return chalk57.cyan("Story");
16401
16547
  }
16402
16548
  }
16403
16549
  function phaseLabel(item) {
16404
16550
  if (!item.plan) return "";
16405
- return chalk56.dim(` (phase ${item.currentPhase ?? 1}/${item.plan.length})`);
16551
+ return chalk57.dim(` (phase ${item.currentPhase ?? 1}/${item.plan.length})`);
16406
16552
  }
16407
16553
  function isBlocked(item, items2) {
16408
16554
  const deps2 = (item.links ?? []).filter((l) => l.type === "depends-on");
@@ -16414,15 +16560,15 @@ function isBlocked(item, items2) {
16414
16560
  function dependencyLabel(item, items2) {
16415
16561
  const deps2 = (item.links ?? []).filter((l) => l.type === "depends-on");
16416
16562
  if (deps2.length === 0) return "";
16417
- if (isBlocked(item, items2)) return chalk56.red(" [blocked]");
16418
- return chalk56.dim(` [${deps2.length} dep${deps2.length > 1 ? "s" : ""}]`);
16563
+ if (isBlocked(item, items2)) return chalk57.red(" [blocked]");
16564
+ return chalk57.dim(` [${deps2.length} dep${deps2.length > 1 ? "s" : ""}]`);
16419
16565
  }
16420
16566
  function printVerboseDetails(item) {
16421
16567
  if (item.description) {
16422
- console.log(` ${chalk56.dim("Description:")} ${item.description}`);
16568
+ console.log(` ${chalk57.dim("Description:")} ${item.description}`);
16423
16569
  }
16424
16570
  if (item.acceptanceCriteria.length > 0) {
16425
- console.log(` ${chalk56.dim("Acceptance criteria:")}`);
16571
+ console.log(` ${chalk57.dim("Acceptance criteria:")}`);
16426
16572
  for (const [i, criterion] of item.acceptanceCriteria.entries()) {
16427
16573
  console.log(` ${i + 1}. ${criterion}`);
16428
16574
  }
@@ -16444,19 +16590,19 @@ function repoPrefixer(items2, allRepos) {
16444
16590
  );
16445
16591
  const repoNameOf = (item) => item.origin ? labels.get(item.origin) ?? "" : "";
16446
16592
  const width2 = Math.max(0, ...items2.map((i) => repoNameOf(i).length));
16447
- return (item) => `${chalk57.dim(repoNameOf(item).padEnd(width2))} `;
16593
+ return (item) => `${chalk58.dim(repoNameOf(item).padEnd(width2))} `;
16448
16594
  }
16449
16595
  async function list(options2) {
16450
16596
  const allItems = await loadBacklog(options2.allRepos);
16451
16597
  const items2 = filterItems(allItems, options2);
16452
16598
  if (items2.length === 0) {
16453
- console.log(chalk57.dim("Backlog is empty."));
16599
+ console.log(chalk58.dim("Backlog is empty."));
16454
16600
  return;
16455
16601
  }
16456
16602
  const prefixOf = repoPrefixer(items2, !!options2.allRepos);
16457
16603
  for (const item of items2) {
16458
16604
  console.log(
16459
- `${prefixOf(item)}${statusIcon(item.status)} ${typeLabel(item.type)} ${chalk57.dim(formatItemId(item.id))} ${starMarker(item)}${item.name}${phaseLabel(item)}${dependencyLabel(item, allItems)}`
16605
+ `${prefixOf(item)}${statusIcon(item.status)} ${typeLabel(item.type)} ${chalk58.dim(formatItemId(item.id))} ${starMarker(item)}${item.name}${phaseLabel(item)}${dependencyLabel(item, allItems)}`
16460
16606
  );
16461
16607
  if (options2.verbose) {
16462
16608
  printVerboseDetails(item);
@@ -16467,59 +16613,22 @@ async function list(options2) {
16467
16613
  // src/commands/backlog/propose.ts
16468
16614
  import chalk60 from "chalk";
16469
16615
 
16470
- // src/commands/backlog/readJsonPayload.ts
16471
- import { readFileSync as readFileSync22 } from "fs";
16472
- import chalk58 from "chalk";
16473
- function fail3(message3) {
16474
- console.error(chalk58.red(message3));
16475
- process.exit(1);
16476
- }
16477
- function describe(error) {
16478
- return error instanceof Error ? error.message : String(error);
16479
- }
16480
- async function readSource(source) {
16481
- try {
16482
- if (source === "-") return (await readStdinBuffer()).toString("utf8");
16483
- return readFileSync22(source, "utf8");
16484
- } catch (error) {
16485
- return fail3(
16486
- `Cannot read the payload from ${source === "-" ? "stdin" : source}: ${describe(error)}`
16487
- );
16488
- }
16489
- }
16490
- async function readJsonPayload(source, schema2, subject) {
16491
- const raw = await readSource(source);
16492
- let json;
16493
- try {
16494
- json = JSON.parse(raw);
16495
- } catch (error) {
16496
- return fail3(`The payload is not valid JSON: ${describe(error)}`);
16497
- }
16498
- const parsed = schema2.safeParse(json);
16499
- if (!parsed.success) {
16500
- const issues = parsed.error.issues.map((i) => ` ${i.path.join(".") || "(root)"}: ${i.message}`).join("\n");
16501
- return fail3(`The payload is not a valid ${subject}:
16502
- ${issues}`);
16503
- }
16504
- return parsed.data;
16505
- }
16506
-
16507
16616
  // src/commands/backlog/propose/proposedItemSchema.ts
16508
- import { z as z9 } from "zod";
16509
- var proposedPhaseSchema = z9.strictObject({
16510
- name: z9.string().trim().min(1, "phase name is required").refine(
16617
+ import { z as z10 } from "zod";
16618
+ var proposedPhaseSchema = z10.strictObject({
16619
+ name: z10.string().trim().min(1, "phase name is required").refine(
16511
16620
  (name) => name.toLowerCase() !== REVIEW_PHASE_NAME.toLowerCase(),
16512
16621
  `"${REVIEW_PHASE_NAME}" is owned by the runner and appended to every plan automatically \u2014 remove this phase`
16513
16622
  ),
16514
- tasks: z9.array(z9.string().trim().min(1)).min(1, "a phase needs at least one task"),
16515
- manualChecks: z9.array(z9.string().trim().min(1)).default([])
16623
+ tasks: z10.array(z10.string().trim().min(1)).min(1, "a phase needs at least one task"),
16624
+ manualChecks: z10.array(z10.string().trim().min(1)).default([])
16516
16625
  });
16517
- var proposedItemSchema = z9.strictObject({
16518
- name: z9.string().trim().min(1, "name is required"),
16519
- type: z9.enum(["story", "bug"]),
16520
- description: z9.string().optional(),
16521
- acceptanceCriteria: z9.array(z9.string().trim().min(1)).default([]),
16522
- phases: z9.array(proposedPhaseSchema).default([])
16626
+ var proposedItemSchema = z10.strictObject({
16627
+ name: z10.string().trim().min(1, "name is required"),
16628
+ type: z10.enum(["story", "bug"]),
16629
+ description: z10.string().optional(),
16630
+ acceptanceCriteria: z10.array(z10.string().trim().min(1)).default([]),
16631
+ phases: z10.array(proposedPhaseSchema).default([])
16523
16632
  });
16524
16633
 
16525
16634
  // src/commands/backlog/propose/readProposedItem.ts
@@ -16528,7 +16637,7 @@ function readProposedItem(source) {
16528
16637
  }
16529
16638
 
16530
16639
  // src/commands/backlog/propose/reviewProposal.ts
16531
- import { randomUUID as randomUUID5 } from "crypto";
16640
+ import { randomUUID as randomUUID6 } from "crypto";
16532
16641
  import chalk59 from "chalk";
16533
16642
 
16534
16643
  // src/shared/renderMarkdownTerminal.ts
@@ -16570,7 +16679,7 @@ async function reviewProposal(item, sessionId, confirmed) {
16570
16679
  if (sessionId) {
16571
16680
  const decision = await awaitPreviewApproval("Backlog item preview", {
16572
16681
  sessionId,
16573
- requestId: randomUUID5(),
16682
+ requestId: randomUUID6(),
16574
16683
  title: item.name,
16575
16684
  body,
16576
16685
  prNumber: null,
@@ -17959,7 +18068,7 @@ Phase ${phaseNumber} completed.`));
17959
18068
  }
17960
18069
 
17961
18070
  // src/commands/backlog/preparePhaseSession.ts
17962
- import { randomUUID as randomUUID6 } from "crypto";
18071
+ import { randomUUID as randomUUID7 } from "crypto";
17963
18072
 
17964
18073
  // src/commands/backlog/persistPhaseSession.ts
17965
18074
  import os4 from "os";
@@ -18019,19 +18128,19 @@ async function persistPhaseSessionId(itemId2, phaseIdx, claudeSessionId) {
18019
18128
  import { mkdirSync as mkdirSync13, readFileSync as readFileSync26, rmSync as rmSync4, writeFileSync as writeFileSync22 } from "fs";
18020
18129
  import { homedir as homedir16 } from "os";
18021
18130
  import { dirname as dirname26, join as join48 } from "path";
18022
- import { z as z10 } from "zod";
18023
- var activitySchema = z10.object({
18024
- kind: z10.enum(["command", "backlog"]),
18025
- harness: z10.enum(["claude", "codex", "pi"]).optional(),
18026
- name: z10.string().optional(),
18027
- itemId: z10.number().optional(),
18028
- itemName: z10.string().optional(),
18029
- phase: z10.number().optional(),
18030
- phaseName: z10.string().optional(),
18031
- totalPhases: z10.number().optional(),
18032
- claudeSessionId: z10.string().optional(),
18033
- watchState: z10.enum(["waiting", "updating"]).optional(),
18034
- startedAt: z10.number()
18131
+ import { z as z11 } from "zod";
18132
+ var activitySchema = z11.object({
18133
+ kind: z11.enum(["command", "backlog"]),
18134
+ harness: z11.enum(["claude", "codex", "pi"]).optional(),
18135
+ name: z11.string().optional(),
18136
+ itemId: z11.number().optional(),
18137
+ itemName: z11.string().optional(),
18138
+ phase: z11.number().optional(),
18139
+ phaseName: z11.string().optional(),
18140
+ totalPhases: z11.number().optional(),
18141
+ claudeSessionId: z11.string().optional(),
18142
+ watchState: z11.enum(["waiting", "updating"]).optional(),
18143
+ startedAt: z11.number()
18035
18144
  });
18036
18145
  function activityPath(sessionId) {
18037
18146
  return join48(homedir16(), ".assist", "activity", `activity-${sessionId}.json`);
@@ -18130,7 +18239,7 @@ async function verifyPhaseResume(itemId2, resumeSessionId, phaseLabel2) {
18130
18239
  // src/commands/backlog/preparePhaseSession.ts
18131
18240
  async function preparePhaseSession(item, phase, phaseIndex, phaseNumber, totalPhases, phaseLabel2, spawnOptions) {
18132
18241
  const resumeSessionId = spawnOptions?.resumeSessionId;
18133
- const claudeSessionId = resumeSessionId ?? randomUUID6();
18242
+ const claudeSessionId = resumeSessionId ?? randomUUID7();
18134
18243
  if (resumeSessionId && !await verifyPhaseResume(item.id, resumeSessionId, phaseLabel2)) {
18135
18244
  return void 0;
18136
18245
  }
@@ -18474,7 +18583,7 @@ import chalk83 from "chalk";
18474
18583
  import enquirer7 from "enquirer";
18475
18584
 
18476
18585
  // src/commands/backlog/launchMode.ts
18477
- import { randomUUID as randomUUID7 } from "crypto";
18586
+ import { randomUUID as randomUUID8 } from "crypto";
18478
18587
 
18479
18588
  // src/commands/backlog/handleLaunchSignal.ts
18480
18589
  import chalk82 from "chalk";
@@ -18579,7 +18688,7 @@ async function launchMode(slashCommand, options2) {
18579
18688
  const resumeSessionId = options2?.resumeSessionId;
18580
18689
  if (!resumeSessionId) pullIfConfigured();
18581
18690
  process.env.ASSIST_SESSION_ID ??= String(process.pid);
18582
- const claudeSessionId = resumeSessionId ?? randomUUID7();
18691
+ const claudeSessionId = resumeSessionId ?? randomUUID8();
18583
18692
  const harness = options2?.harness ?? "claude";
18584
18693
  reportLaunchActivity(slashCommand, claudeSessionId, harness, options2);
18585
18694
  const prompt = resumeSessionId ? resumeNudge() : buildSlashCommand(slashCommand, options2?.description);
@@ -19372,9 +19481,9 @@ function registerUpdateFieldCommand(cmd) {
19372
19481
  import chalk104 from "chalk";
19373
19482
 
19374
19483
  // src/commands/backlog/updatePlan/planUpdateSchema.ts
19375
- import { z as z11 } from "zod";
19376
- var planUpdateSchema = z11.strictObject({
19377
- phases: z11.array(proposedPhaseSchema).min(1, "a plan needs at least one phase")
19484
+ import { z as z12 } from "zod";
19485
+ var planUpdateSchema = z12.strictObject({
19486
+ phases: z12.array(proposedPhaseSchema).min(1, "a plan needs at least one phase")
19378
19487
  });
19379
19488
 
19380
19489
  // src/commands/backlog/updatePlan/readPlanUpdate.ts
@@ -19418,7 +19527,7 @@ async function replacePlan(orm, itemId2, phases, currentPhase) {
19418
19527
  }
19419
19528
 
19420
19529
  // src/commands/backlog/updatePlan/reviewPlanUpdate.ts
19421
- import { randomUUID as randomUUID8 } from "crypto";
19530
+ import { randomUUID as randomUUID9 } from "crypto";
19422
19531
  import chalk103 from "chalk";
19423
19532
 
19424
19533
  // src/commands/backlog/updatePlan/isCompleted.ts
@@ -19575,7 +19684,7 @@ async function reviewPlanUpdate(item, phases) {
19575
19684
  if (process.env.ASSIST_SESSION === "1" && sessionId) {
19576
19685
  const decision = await awaitPreviewApproval("Plan update preview", {
19577
19686
  sessionId,
19578
- requestId: randomUUID8(),
19687
+ requestId: randomUUID9(),
19579
19688
  title: `Update the plan for ${formatItemId(item.id)}: ${item.name}`,
19580
19689
  body,
19581
19690
  prNumber: null,
@@ -26652,13 +26761,13 @@ function validateProposedContent(labels, title, body) {
26652
26761
  }
26653
26762
 
26654
26763
  // src/commands/github/issue/reviewProposedIssueComment.ts
26655
- import { randomUUID as randomUUID9 } from "crypto";
26764
+ import { randomUUID as randomUUID10 } from "crypto";
26656
26765
  async function reviewProposedIssueComment(title, body) {
26657
26766
  const sessionId = process.env.ASSIST_SESSION_ID;
26658
26767
  if (process.env.ASSIST_SESSION !== "1" || !sessionId) return;
26659
26768
  await awaitPreviewApproval("GitHub issue comment preview", {
26660
26769
  sessionId,
26661
- requestId: randomUUID9(),
26770
+ requestId: randomUUID10(),
26662
26771
  title,
26663
26772
  body,
26664
26773
  prNumber: null,
@@ -27176,13 +27285,13 @@ function resolveCreateIssueMetadata(options2) {
27176
27285
  }
27177
27286
 
27178
27287
  // src/commands/github/issue/reviewProposedIssue.ts
27179
- import { randomUUID as randomUUID10 } from "crypto";
27288
+ import { randomUUID as randomUUID11 } from "crypto";
27180
27289
  async function reviewProposedIssue(title, body, metadata2 = []) {
27181
27290
  const sessionId = process.env.ASSIST_SESSION_ID;
27182
27291
  if (process.env.ASSIST_SESSION !== "1" || !sessionId) return void 0;
27183
27292
  return await awaitPreviewApproval("GitHub issue preview", {
27184
27293
  sessionId,
27185
- requestId: randomUUID10(),
27294
+ requestId: randomUUID11(),
27186
27295
  title,
27187
27296
  body,
27188
27297
  prNumber: null,
@@ -27487,7 +27596,7 @@ function pushUnchangedIssue(number, repo, target, fetchedAt, bodyPath) {
27487
27596
  }
27488
27597
 
27489
27598
  // src/commands/github/issue/reviewProposedIssueEdit.ts
27490
- import { randomUUID as randomUUID11 } from "crypto";
27599
+ import { randomUUID as randomUUID12 } from "crypto";
27491
27600
  async function reviewProposedIssueEdit(title, body, working) {
27492
27601
  const sessionId = process.env.ASSIST_SESSION_ID;
27493
27602
  if (process.env.ASSIST_SESSION !== "1" || !sessionId) return body;
@@ -27495,7 +27604,7 @@ async function reviewProposedIssueEdit(title, body, working) {
27495
27604
  "GitHub issue edit preview",
27496
27605
  {
27497
27606
  sessionId,
27498
- requestId: randomUUID11(),
27607
+ requestId: randomUUID12(),
27499
27608
  title,
27500
27609
  body,
27501
27610
  prNumber: null,
@@ -27924,7 +28033,7 @@ async function writeInboxLastScan(orm, at2) {
27924
28033
  // src/commands/inbox/runInboxScanClaude.ts
27925
28034
  import { execFile as execFile12 } from "child_process";
27926
28035
  import { promisify as promisify12 } from "util";
27927
- import { z as z13 } from "zod";
28036
+ import { z as z14 } from "zod";
27928
28037
 
27929
28038
  // src/commands/inbox/buildInboxScanPrompt.ts
27930
28039
  function buildInboxScanPrompt(since) {
@@ -27960,17 +28069,17 @@ function buildInboxScanPrompt(since) {
27960
28069
  }
27961
28070
 
27962
28071
  // src/commands/inbox/inboxScanSchema.ts
27963
- import { z as z12 } from "zod";
27964
- var flaggedMessageSchema = z12.object({
27965
- source: z12.enum(["gmail", "slack"]),
27966
- messageId: z12.string().min(1),
27967
- sender: z12.string().min(1),
27968
- summary: z12.string().min(1),
27969
- link: z12.string().min(1),
27970
- receivedAt: z12.string().optional()
28072
+ import { z as z13 } from "zod";
28073
+ var flaggedMessageSchema = z13.object({
28074
+ source: z13.enum(["gmail", "slack"]),
28075
+ messageId: z13.string().min(1),
28076
+ sender: z13.string().min(1),
28077
+ summary: z13.string().min(1),
28078
+ link: z13.string().min(1),
28079
+ receivedAt: z13.string().optional()
27971
28080
  });
27972
- var inboxScanSchema = z12.object({
27973
- messages: z12.array(flaggedMessageSchema)
28081
+ var inboxScanSchema = z13.object({
28082
+ messages: z13.array(flaggedMessageSchema)
27974
28083
  });
27975
28084
 
27976
28085
  // src/commands/inbox/inboxScanTools.ts
@@ -28039,7 +28148,7 @@ function buildInboxScanArgs(since) {
28039
28148
  "--output-format",
28040
28149
  "json",
28041
28150
  "--json-schema",
28042
- JSON.stringify(z13.toJSONSchema(inboxScanSchema, { target: "draft-07" })),
28151
+ JSON.stringify(z14.toJSONSchema(inboxScanSchema, { target: "draft-07" })),
28043
28152
  "--",
28044
28153
  buildInboxScanPrompt(since)
28045
28154
  ];
@@ -28285,7 +28394,7 @@ function registerRefineLaunch(program, resumeFlag) {
28285
28394
  }
28286
28395
 
28287
28396
  // src/commands/fixConflict.ts
28288
- import { randomUUID as randomUUID12 } from "crypto";
28397
+ import { randomUUID as randomUUID13 } from "crypto";
28289
28398
 
28290
28399
  // src/commands/review/checkoutPr.ts
28291
28400
  import { execFileSync as execFileSync18 } from "child_process";
@@ -28481,39 +28590,39 @@ function stringOrUndefined(value) {
28481
28590
  }
28482
28591
 
28483
28592
  // src/commands/sessions/daemon/persistedSessionSchema.ts
28484
- import { z as z14 } from "zod";
28485
- var persistedSessionSchema = z14.object({
28486
- id: z14.string().optional(),
28487
- name: z14.string(),
28488
- title: z14.string().optional(),
28489
- generatedTitle: z14.string().optional(),
28490
- subtitle: z14.string().optional(),
28491
- commandType: z14.enum(["claude", "run", "assist"]),
28492
- harness: z14.enum(["claude", "codex", "pi"]).optional(),
28493
- status: z14.enum(["running", "waiting", "done", "error", "stopped"]).optional(),
28494
- cwd: z14.string(),
28495
- startedAt: z14.number(),
28496
- runningMs: z14.number().optional(),
28497
- claudeSessionId: z14.string().optional(),
28498
- harnessSessionId: z14.string().optional(),
28499
- initialPrompt: z14.string().optional(),
28500
- runName: z14.string().optional(),
28501
- runArgs: z14.array(z14.string()).optional(),
28502
- assistArgs: z14.array(z14.string()).optional(),
28593
+ import { z as z15 } from "zod";
28594
+ var persistedSessionSchema = z15.object({
28595
+ id: z15.string().optional(),
28596
+ name: z15.string(),
28597
+ title: z15.string().optional(),
28598
+ generatedTitle: z15.string().optional(),
28599
+ subtitle: z15.string().optional(),
28600
+ commandType: z15.enum(["claude", "run", "assist"]),
28601
+ harness: z15.enum(["claude", "codex", "pi"]).optional(),
28602
+ status: z15.enum(["running", "waiting", "done", "error", "stopped"]).optional(),
28603
+ cwd: z15.string(),
28604
+ startedAt: z15.number(),
28605
+ runningMs: z15.number().optional(),
28606
+ claudeSessionId: z15.string().optional(),
28607
+ harnessSessionId: z15.string().optional(),
28608
+ initialPrompt: z15.string().optional(),
28609
+ runName: z15.string().optional(),
28610
+ runArgs: z15.array(z15.string()).optional(),
28611
+ assistArgs: z15.array(z15.string()).optional(),
28503
28612
  activity: activitySchema.optional(),
28504
- starred: z14.boolean().optional(),
28505
- watcher: z14.boolean().optional(),
28506
- divergenceEscalation: z14.boolean().optional(),
28507
- design: z14.boolean().optional(),
28508
- auto: z14.boolean().optional(),
28509
- autoAdvance: z14.boolean().optional(),
28510
- autoApprove: z14.boolean().optional(),
28511
- reviewStarted: z14.boolean().optional(),
28512
- launchedFrom: z14.string().optional(),
28513
- pendingPrompts: z14.array(z14.string()).optional(),
28514
- interrupted: z14.object({ reason: z14.string(), at: z14.number() }).optional(),
28515
- awaitingSeed: z14.boolean().optional(),
28516
- undurable: z14.object({ reason: z14.string(), removesTree: z14.boolean().optional() }).optional()
28613
+ starred: z15.boolean().optional(),
28614
+ watcher: z15.boolean().optional(),
28615
+ divergenceEscalation: z15.boolean().optional(),
28616
+ design: z15.boolean().optional(),
28617
+ auto: z15.boolean().optional(),
28618
+ autoAdvance: z15.boolean().optional(),
28619
+ autoApprove: z15.boolean().optional(),
28620
+ reviewStarted: z15.boolean().optional(),
28621
+ launchedFrom: z15.string().optional(),
28622
+ pendingPrompts: z15.array(z15.string()).optional(),
28623
+ interrupted: z15.object({ reason: z15.string(), at: z15.number() }).optional(),
28624
+ awaitingSeed: z15.boolean().optional(),
28625
+ undurable: z15.object({ reason: z15.string(), removesTree: z15.boolean().optional() }).optional()
28517
28626
  });
28518
28627
 
28519
28628
  // src/commands/sessions/daemon/toPersistedSession.ts
@@ -29070,7 +29179,7 @@ function buildPrompt2(rebase) {
29070
29179
  async function fixConflict(number, options2 = {}) {
29071
29180
  const { resumeSessionId } = options2;
29072
29181
  if (number && !resumeSessionId) await checkoutPr(number);
29073
- const claudeSessionId = resumeSessionId ?? randomUUID12();
29182
+ const claudeSessionId = resumeSessionId ?? randomUUID13();
29074
29183
  emitActivity({
29075
29184
  kind: "command",
29076
29185
  name: "fix-conflict",
@@ -29098,7 +29207,7 @@ function registerFixConflict(program, resumeFlag) {
29098
29207
  }
29099
29208
 
29100
29209
  // src/commands/reviewPrComments.ts
29101
- import { randomUUID as randomUUID13 } from "crypto";
29210
+ import { randomUUID as randomUUID14 } from "crypto";
29102
29211
  function buildPrompt3(number, announce, options2) {
29103
29212
  const args = [
29104
29213
  "/review-pr-comments",
@@ -29124,7 +29233,7 @@ async function reviewPrComments(number, options2 = {}) {
29124
29233
  validateAnnounce(number, announce);
29125
29234
  validateMode(options2);
29126
29235
  if (number && !resumeSessionId) await checkoutPr(number);
29127
- const claudeSessionId = resumeSessionId ?? randomUUID13();
29236
+ const claudeSessionId = resumeSessionId ?? randomUUID14();
29128
29237
  emitActivity({
29129
29238
  kind: "command",
29130
29239
  name: "review-pr-comments",
@@ -29666,7 +29775,7 @@ async function offerSaveExtract(extract2, options2, paths = {}) {
29666
29775
  }
29667
29776
 
29668
29777
  // src/commands/miro/pickAnchors.ts
29669
- import { randomUUID as randomUUID14 } from "crypto";
29778
+ import { randomUUID as randomUUID15 } from "crypto";
29670
29779
 
29671
29780
  // src/commands/miro/isBox.ts
29672
29781
  var boxTypes = /* @__PURE__ */ new Set(["shape", "sticky_note"]);
@@ -29687,7 +29796,7 @@ async function pickAnchors(sessionId, items2) {
29687
29796
  "Miro anchor selection",
29688
29797
  {
29689
29798
  sessionId,
29690
- requestId: randomUUID14(),
29799
+ requestId: randomUUID15(),
29691
29800
  title: "Pick the top-left then the bottom-right box",
29692
29801
  body: encodeMiroBoardPreview(items2),
29693
29802
  prNumber: null,
@@ -30915,13 +31024,13 @@ function postReviewComment(vars) {
30915
31024
  }
30916
31025
 
30917
31026
  // src/commands/prs/reviewProposedPrComment.ts
30918
- import { randomUUID as randomUUID15 } from "crypto";
31027
+ import { randomUUID as randomUUID16 } from "crypto";
30919
31028
  async function reviewProposedPrComment(title, body, prNumber) {
30920
31029
  const sessionId = process.env.ASSIST_SESSION_ID;
30921
31030
  if (process.env.ASSIST_SESSION !== "1" || !sessionId) return;
30922
31031
  await awaitPreviewApproval("PR comment preview", {
30923
31032
  sessionId,
30924
- requestId: randomUUID15(),
31033
+ requestId: randomUUID16(),
30925
31034
  title,
30926
31035
  body,
30927
31036
  prNumber,
@@ -31956,7 +32065,7 @@ function parseScreenshotSpecs(specs) {
31956
32065
  }
31957
32066
 
31958
32067
  // src/commands/prs/previewAndApplyEdit.ts
31959
- import { randomUUID as randomUUID16 } from "crypto";
32068
+ import { randomUUID as randomUUID17 } from "crypto";
31960
32069
 
31961
32070
  // src/commands/prs/stageScreenshots.ts
31962
32071
  import { readFile as readFile8 } from "fs/promises";
@@ -31978,7 +32087,7 @@ function stageScreenshots(screenshots = []) {
31978
32087
  async function previewAndApplyEdit(args) {
31979
32088
  const decision = await awaitPreviewApproval("PR preview", {
31980
32089
  sessionId: args.sessionId,
31981
- requestId: randomUUID16(),
32090
+ requestId: randomUUID17(),
31982
32091
  title: args.title ?? args.currentTitle,
31983
32092
  body: args.body,
31984
32093
  prNumber: args.number,
@@ -32313,7 +32422,7 @@ async function placePr(prNumber, title, body, options2, attachments = []) {
32313
32422
  }
32314
32423
 
32315
32424
  // src/commands/prs/previewAndPlace.ts
32316
- import { randomUUID as randomUUID17 } from "crypto";
32425
+ import { randomUUID as randomUUID18 } from "crypto";
32317
32426
 
32318
32427
  // src/commands/review/announcePr.ts
32319
32428
  function announcePr(prNumber) {
@@ -32389,7 +32498,7 @@ function enableAutoMerge() {
32389
32498
  async function previewAndPlace(args) {
32390
32499
  const decision = await awaitPreviewApproval("PR preview", {
32391
32500
  sessionId: args.sessionId,
32392
- requestId: randomUUID17(),
32501
+ requestId: randomUUID18(),
32393
32502
  title: args.title,
32394
32503
  body: args.body,
32395
32504
  prNumber: args.prNumber,
@@ -36803,10 +36912,10 @@ function registerRefactor(program) {
36803
36912
  }
36804
36913
 
36805
36914
  // src/commands/review/checkoutPrSession.ts
36806
- import { randomUUID as randomUUID18 } from "crypto";
36915
+ import { randomUUID as randomUUID19 } from "crypto";
36807
36916
  async function checkoutPrSession(number, prompt = "") {
36808
36917
  await checkoutPr(number);
36809
- const claudeSessionId = randomUUID18();
36918
+ const claudeSessionId = randomUUID19();
36810
36919
  emitActivity({ kind: "command", name: "review", claudeSessionId });
36811
36920
  const { done: done2 } = spawnClaude(prompt, {
36812
36921
  permissionMode: "auto",
@@ -37917,7 +38026,7 @@ function gatherHighLevelSubject(prNumber, force) {
37917
38026
  }
37918
38027
 
37919
38028
  // src/commands/review/highLevel/openHighLevelOverlay.ts
37920
- import { randomUUID as randomUUID20 } from "crypto";
38029
+ import { randomUUID as randomUUID21 } from "crypto";
37921
38030
 
37922
38031
  // src/commands/review/highLevel/highLevelProgress.ts
37923
38032
  function toItem2(check2, decision) {
@@ -38176,7 +38285,7 @@ function splitQueuedComments(record) {
38176
38285
  }
38177
38286
 
38178
38287
  // src/commands/review/highLevel/previewHighLevelReview.ts
38179
- import { randomUUID as randomUUID19 } from "crypto";
38288
+ import { randomUUID as randomUUID20 } from "crypto";
38180
38289
 
38181
38290
  // src/commands/review/highLevel/formatHighLevelReviewPreview.ts
38182
38291
  function formatHighLevelReviewPreview(lineLevel, body) {
@@ -38203,7 +38312,7 @@ async function previewHighLevelReview(sessionId, record, submission) {
38203
38312
  "Review",
38204
38313
  {
38205
38314
  sessionId,
38206
- requestId: randomUUID19(),
38315
+ requestId: randomUUID20(),
38207
38316
  title: `${LABELS[submission.event]} ${record.repo}#${record.prNumber}`,
38208
38317
  body: formatHighLevelReviewPreview(submission.comments, submission.body),
38209
38318
  prNumber: record.prNumber,
@@ -38254,7 +38363,7 @@ async function openHighLevelOverlay(sessionId, subject) {
38254
38363
  "High-level review",
38255
38364
  {
38256
38365
  sessionId,
38257
- requestId: randomUUID20(),
38366
+ requestId: randomUUID21(),
38258
38367
  title: `${subject.repo}#${subject.prNumber} \u2014 ${subject.title}`,
38259
38368
  body: JSON.stringify(highLevelPreviewPayload(subject)),
38260
38369
  prNumber: subject.prNumber,
@@ -41529,7 +41638,7 @@ function registerSeq(program) {
41529
41638
  }
41530
41639
 
41531
41640
  // src/commands/show.ts
41532
- import { randomUUID as randomUUID21 } from "crypto";
41641
+ import { randomUUID as randomUUID22 } from "crypto";
41533
41642
 
41534
41643
  // src/commands/sessions/shared/sendShowPreview.ts
41535
41644
  async function sendShowPreview(request) {
@@ -41581,7 +41690,7 @@ async function show3(options2) {
41581
41690
  try {
41582
41691
  await sendShowPreview({
41583
41692
  sessionId,
41584
- requestId: randomUUID21(),
41693
+ requestId: randomUUID22(),
41585
41694
  title: options2.title ?? "Show",
41586
41695
  body
41587
41696
  });
@@ -41665,7 +41774,7 @@ function readSlackParts(files) {
41665
41774
  }
41666
41775
 
41667
41776
  // src/commands/slack/reviewProposedSlackMessage.ts
41668
- import { randomUUID as randomUUID22 } from "crypto";
41777
+ import { randomUUID as randomUUID23 } from "crypto";
41669
41778
  async function reviewProposedSlackMessage(target, body, workingPath) {
41670
41779
  const sessionId = process.env.ASSIST_SESSION_ID;
41671
41780
  if (process.env.ASSIST_SESSION !== "1" || !sessionId) return;
@@ -41675,7 +41784,7 @@ async function reviewProposedSlackMessage(target, body, workingPath) {
41675
41784
  part ? `Slack message ${part.index} of ${part.total}` : "Slack message preview",
41676
41785
  {
41677
41786
  sessionId,
41678
- requestId: randomUUID22(),
41787
+ requestId: randomUUID23(),
41679
41788
  title: part ? `${destination} (${part.index}/${part.total})` : destination,
41680
41789
  body,
41681
41790
  prNumber: null,
@@ -42812,7 +42921,7 @@ function createReadlineInterface() {
42812
42921
  output: process.stdout
42813
42922
  });
42814
42923
  }
42815
- function askQuestion(rl, question) {
42924
+ function askQuestion2(rl, question) {
42816
42925
  return new Promise((resolve31) => {
42817
42926
  rl.question(question, (answer) => {
42818
42927
  resolve31(answer.trim());
@@ -42832,15 +42941,15 @@ function printExisting(existing) {
42832
42941
  console.log();
42833
42942
  }
42834
42943
  async function promptDirectories(rl, existing) {
42835
- const vttDir = await askQuestion(
42944
+ const vttDir = await askQuestion2(
42836
42945
  rl,
42837
42946
  buildPrompt4("VTT directory", existing?.vttDir)
42838
42947
  );
42839
- const transcriptsDir = await askQuestion(
42948
+ const transcriptsDir = await askQuestion2(
42840
42949
  rl,
42841
42950
  buildPrompt4("Transcripts directory", existing?.transcriptsDir)
42842
42951
  );
42843
- const summaryDir = await askQuestion(
42952
+ const summaryDir = await askQuestion2(
42844
42953
  rl,
42845
42954
  buildPrompt4("Summary directory", existing?.summaryDir)
42846
42955
  );
@@ -43039,16 +43148,16 @@ function selectPassages(sources, selection) {
43039
43148
  }
43040
43149
 
43041
43150
  // src/commands/transcript/selectionSchema.ts
43042
- import { z as z15 } from "zod";
43043
- var selectionSchema = z15.strictObject({
43044
- keep: z15.array(
43045
- z15.strictObject({
43046
- file: z15.string().trim().min(1, "file is required"),
43047
- from: z15.string().trim().min(1, "from is required"),
43048
- to: z15.string().trim().min(1, "to is required")
43151
+ import { z as z16 } from "zod";
43152
+ var selectionSchema = z16.strictObject({
43153
+ keep: z16.array(
43154
+ z16.strictObject({
43155
+ file: z16.string().trim().min(1, "file is required"),
43156
+ from: z16.string().trim().min(1, "from is required"),
43157
+ to: z16.string().trim().min(1, "to is required")
43049
43158
  })
43050
43159
  ).min(1, "a selection needs at least one keep range"),
43051
- removed: z15.array(z15.string().trim().min(1)).default([])
43160
+ removed: z16.array(z16.string().trim().min(1)).default([])
43052
43161
  });
43053
43162
 
43054
43163
  // src/commands/transcript/widenAudienceInText.ts
@@ -45559,9 +45668,9 @@ async function refreshRepoConfigCacheOnStart() {
45559
45668
  }
45560
45669
 
45561
45670
  // src/commands/sessions/daemon/loadActiveSelection.ts
45562
- import { z as z16 } from "zod";
45671
+ import { z as z17 } from "zod";
45563
45672
  var ACTIVE_FILE = "active.json";
45564
- var activeSelectionSchema = z16.record(z16.string(), z16.string());
45673
+ var activeSelectionSchema = z17.record(z17.string(), z17.string());
45565
45674
  function loadActiveSelection() {
45566
45675
  const parsed = activeSelectionSchema.safeParse(
45567
45676
  loadJson(ACTIVE_FILE)
@@ -46361,7 +46470,7 @@ var ClientHub = class extends Set {
46361
46470
  };
46362
46471
 
46363
46472
  // src/commands/sessions/daemon/createSession.ts
46364
- import { randomUUID as randomUUID23 } from "crypto";
46473
+ import { randomUUID as randomUUID24 } from "crypto";
46365
46474
 
46366
46475
  // src/commands/sessions/daemon/sessionBase.ts
46367
46476
  function sessionBase(id, status2) {
@@ -46584,7 +46693,7 @@ function spawnRun(opts) {
46584
46693
  function createSession(id, { prompt, cwd, design, auto, harness, holdPty } = {}) {
46585
46694
  if (harness && harness !== "claude")
46586
46695
  return createHarnessSession(id, harness, prompt, cwd, holdPty);
46587
- const claudeSessionId = randomUUID23();
46696
+ const claudeSessionId = randomUUID24();
46588
46697
  return {
46589
46698
  ...sessionBase(id, prompt ? "running" : "waiting"),
46590
46699
  name: `Session ${id}`,
@@ -47723,7 +47832,7 @@ function count9(value) {
47723
47832
  }
47724
47833
  function logPrDecision(id, requestId, d) {
47725
47834
  daemonLog(
47726
- `pr-decision received: id=${id} requestId=${requestId} decision=${d.decision} comments=${count9(d.comments)} screenshots=${count9(d.screenshots)} checklist=${count9(d.checklist)} reviewEvent=${d.reviewEvent} reviewComments=${count9(d.reviewComments)} reviewAfter=${d.reviewAfter === true} announceAfter=${d.announceAfter === true} draft=${d.draft} autoMerge=${d.autoMerge === true} autostart=${d.autostart === true}`
47835
+ `pr-decision received: id=${id} requestId=${requestId} decision=${d.decision} comments=${count9(d.comments)} screenshots=${count9(d.screenshots)} checklist=${count9(d.checklist)} reviewEvent=${d.reviewEvent} reviewComments=${count9(d.reviewComments)} reviewAfter=${d.reviewAfter === true} announceAfter=${d.announceAfter === true} draft=${d.draft} autoMerge=${d.autoMerge === true} autostart=${d.autostart === true} answers=${d.answers && typeof d.answers === "object" ? Object.keys(d.answers).length : 0}`
47727
47836
  );
47728
47837
  }
47729
47838
 
@@ -47765,7 +47874,8 @@ function decidePrPreview(sessions, waiters, notify2, d) {
47765
47874
  checklist: d.checklist,
47766
47875
  reviewEvent: d.reviewEvent,
47767
47876
  reviewComments: d.reviewComments,
47768
- dismissed: d.dismissed
47877
+ dismissed: d.dismissed,
47878
+ answers: d.answers
47769
47879
  });
47770
47880
  waiters.delete(id);
47771
47881
  session.pendingPrPreview = void 0;
@@ -47834,7 +47944,8 @@ var PREVIEW_KINDS = [
47834
47944
  "slack-post",
47835
47945
  "high-level-review",
47836
47946
  "show",
47837
- "ask"
47947
+ "ask",
47948
+ "question"
47838
47949
  ];
47839
47950
  function isPreviewKind(value) {
47840
47951
  return PREVIEW_KINDS.includes(value);
@@ -47851,6 +47962,7 @@ function previewTargetLabel(kind, itemType, prNumber, draft) {
47851
47962
  if (kind === "high-level-review") return "high-level review";
47852
47963
  if (kind === "show") return "show";
47853
47964
  if (kind === "ask") return "ask";
47965
+ if (kind === "question") return "question";
47854
47966
  if (kind === "backlog-item") return `backlog ${itemType}`;
47855
47967
  if (prNumber !== null) return `edit #${prNumber}`;
47856
47968
  return draft ? "create draft" : "create";
@@ -48056,9 +48168,9 @@ function buildPrompt5(prompt) {
48056
48168
  }
48057
48169
 
48058
48170
  // src/commands/sessions/shared/loadSessionTitles.ts
48059
- import { z as z17 } from "zod";
48171
+ import { z as z18 } from "zod";
48060
48172
  var TITLES_FILE = "session-titles.json";
48061
- var sessionTitlesSchema = z17.record(z17.string(), z17.string());
48173
+ var sessionTitlesSchema = z18.record(z18.string(), z18.string());
48062
48174
  function loadSessionTitles() {
48063
48175
  const parsed = sessionTitlesSchema.safeParse(
48064
48176
  loadJson(TITLES_FILE)
@@ -49449,7 +49561,7 @@ function codexRespawnPlan(session) {
49449
49561
  }
49450
49562
 
49451
49563
  // src/commands/sessions/daemon/interactiveRespawnPlan.ts
49452
- import { randomUUID as randomUUID24 } from "crypto";
49564
+ import { randomUUID as randomUUID25 } from "crypto";
49453
49565
 
49454
49566
  // src/commands/sessions/daemon/hasTranscriptOnDisk.ts
49455
49567
  function hasTranscriptOnDisk(session) {
@@ -49476,7 +49588,7 @@ function interactiveRespawnPlan(session, resumes) {
49476
49588
  return null;
49477
49589
  }
49478
49590
  function freshClaudePlan(session, prompt, cwd) {
49479
- const claudeSessionId = randomUUID24();
49591
+ const claudeSessionId = randomUUID25();
49480
49592
  return {
49481
49593
  spawn: () => {
49482
49594
  session.claudeSessionId = claudeSessionId;
@@ -53693,6 +53805,7 @@ var programRegistrars = [
53693
53805
  registerSeq,
53694
53806
  registerShow,
53695
53807
  registerAsk,
53808
+ registerAskQuestion,
53696
53809
  registerSlack,
53697
53810
  registerSql,
53698
53811
  registerTranscript,