@staff0rd/assist 0.909.0 → 0.910.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.909.0",
9
+ version: "0.910.0",
10
10
  type: "module",
11
11
  main: "dist/index.js",
12
12
  bin: {
@@ -836,7 +836,7 @@ function stripLegacyConfigKeys(config) {
836
836
  }
837
837
 
838
838
  // src/shared/types.ts
839
- import { z as z5 } from "zod";
839
+ import { z as z6 } from "zod";
840
840
 
841
841
  // src/shared/adviceFragmentNames.ts
842
842
  var adviceFragmentTitles = {
@@ -885,9 +885,37 @@ var defaultCriticalPaths = [
885
885
  "**/CLAUDE.md"
886
886
  ];
887
887
 
888
- // src/shared/hotkeys/hotkeysSchema.ts
888
+ // src/shared/durationSchema.ts
889
889
  import { z } from "zod";
890
890
 
891
+ // src/shared/parseDuration.ts
892
+ var UNIT_MS = { s: 1e3, m: 6e4, h: 36e5 };
893
+ function parseDuration(value) {
894
+ const match = /^(\d+)(s|m|h)$/.exec(value.trim());
895
+ if (!match) {
896
+ throw new Error(
897
+ `Invalid duration "${value}". Use a whole number followed by s, m, or h (e.g. 30s, 60m, 2h).`
898
+ );
899
+ }
900
+ const amount = Number(match[1]);
901
+ if (amount === 0) {
902
+ throw new Error(`Invalid duration "${value}". Value must be at least 1.`);
903
+ }
904
+ return amount * UNIT_MS[match[2]];
905
+ }
906
+
907
+ // src/shared/durationSchema.ts
908
+ var durationSchema = z.string().superRefine((value, ctx) => {
909
+ try {
910
+ parseDuration(value);
911
+ } catch (error) {
912
+ ctx.addIssue({ code: "custom", message: error.message });
913
+ }
914
+ });
915
+
916
+ // src/shared/hotkeys/hotkeysSchema.ts
917
+ import { z as z2 } from "zod";
918
+
891
919
  // src/shared/hotkeys/hotkeyKeyCode.ts
892
920
  var PUNCTUATION_CODES = {
893
921
  "/": "Slash",
@@ -999,13 +1027,13 @@ function parseChord(text17, { modifiersOnly = false } = {}) {
999
1027
 
1000
1028
  // src/shared/hotkeys/hotkeysSchema.ts
1001
1029
  function chordSchema(modifiersOnly) {
1002
- return z.string().superRefine((value, ctx) => {
1030
+ return z2.string().superRefine((value, ctx) => {
1003
1031
  const parsed = parseChord(value, { modifiersOnly });
1004
1032
  if (!parsed.ok) ctx.addIssue({ code: "custom", message: parsed.error });
1005
1033
  });
1006
1034
  }
1007
1035
  var keyChord = chordSchema(false).optional();
1008
- var hotkeysSchema = z.strictObject({
1036
+ var hotkeysSchema = z2.strictObject({
1009
1037
  navTab: chordSchema(true).optional(),
1010
1038
  focusSidebar: keyChord,
1011
1039
  focusTerminal: keyChord,
@@ -1025,46 +1053,46 @@ var hotkeysSchema = z.strictObject({
1025
1053
  });
1026
1054
 
1027
1055
  // src/shared/runConfigSchema.ts
1028
- import { z as z2 } from "zod";
1029
- var runParamSchema = z2.strictObject({
1030
- name: z2.string(),
1031
- required: z2.boolean().optional(),
1032
- default: z2.string().optional(),
1033
- description: z2.string().optional()
1056
+ import { z as z3 } from "zod";
1057
+ var runParamSchema = z3.strictObject({
1058
+ name: z3.string(),
1059
+ required: z3.boolean().optional(),
1060
+ default: z3.string().optional(),
1061
+ description: z3.string().optional()
1034
1062
  });
1035
- var runConfigSchema = z2.strictObject({
1036
- name: z2.string(),
1037
- command: z2.string(),
1038
- args: z2.array(z2.string()).optional(),
1039
- params: z2.array(runParamSchema).optional(),
1040
- env: z2.record(z2.string(), z2.string()).optional(),
1041
- filter: z2.string().optional(),
1042
- pre: z2.array(z2.string()).optional(),
1043
- cwd: z2.string().optional(),
1044
- quiet: z2.boolean().optional(),
1045
- server: z2.union([z2.boolean(), z2.string().min(1)]).optional(),
1046
- port: z2.number().optional()
1063
+ var runConfigSchema = z3.strictObject({
1064
+ name: z3.string(),
1065
+ command: z3.string(),
1066
+ args: z3.array(z3.string()).optional(),
1067
+ params: z3.array(runParamSchema).optional(),
1068
+ env: z3.record(z3.string(), z3.string()).optional(),
1069
+ filter: z3.string().optional(),
1070
+ pre: z3.array(z3.string()).optional(),
1071
+ cwd: z3.string().optional(),
1072
+ quiet: z3.boolean().optional(),
1073
+ server: z3.union([z3.boolean(), z3.string().min(1)]).optional(),
1074
+ port: z3.number().optional()
1047
1075
  });
1048
- var runLinkSchema = z2.strictObject({
1049
- link: z2.string(),
1050
- prefix: z2.string()
1076
+ var runLinkSchema = z3.strictObject({
1077
+ link: z3.string(),
1078
+ prefix: z3.string()
1051
1079
  });
1052
1080
 
1053
1081
  // src/shared/secretConfigValue.ts
1054
- import { z as z3 } from "zod";
1082
+ import { z as z4 } from "zod";
1055
1083
  var SECRET_META_KEY = "assistSecret";
1056
1084
  function secretConfigValue(schema2) {
1057
1085
  return schema2.meta({ [SECRET_META_KEY]: true });
1058
1086
  }
1059
1087
  function isSecretSchemaNode(node) {
1060
- const meta = z3.globalRegistry.get(node);
1088
+ const meta = z4.globalRegistry.get(node);
1061
1089
  return meta?.[SECRET_META_KEY] === true;
1062
1090
  }
1063
1091
 
1064
1092
  // src/shared/sessionLinkSchema.ts
1065
- import { z as z4 } from "zod";
1093
+ import { z as z5 } from "zod";
1066
1094
  var SSH_LINK_RETIRED = "ssh links are no longer supported; relink with `assist sessions nodes link <name> --tailscale <host> --port <port>`";
1067
- var sessionLinkSchema = z4.preprocess(
1095
+ var sessionLinkSchema = z5.preprocess(
1068
1096
  (link3, ctx) => {
1069
1097
  if (link3 && typeof link3 === "object" && "ssh" in link3)
1070
1098
  ctx.issues.push({
@@ -1074,262 +1102,267 @@ var sessionLinkSchema = z4.preprocess(
1074
1102
  });
1075
1103
  return link3;
1076
1104
  },
1077
- z4.strictObject({ name: z4.string(), url: z4.string() })
1105
+ z5.strictObject({ name: z5.string(), url: z5.string() })
1078
1106
  );
1079
1107
 
1080
1108
  // src/shared/types.ts
1081
- var transcriptConfigSchema = z5.strictObject({
1082
- vttDir: z5.string(),
1083
- transcriptsDir: z5.string(),
1084
- summaryDir: z5.string()
1109
+ var transcriptConfigSchema = z6.strictObject({
1110
+ vttDir: z6.string(),
1111
+ transcriptsDir: z6.string(),
1112
+ summaryDir: z6.string()
1085
1113
  });
1086
- var miroExtractSchema = z5.strictObject({
1087
- board: z5.string().optional(),
1088
- frame: z5.string().optional(),
1089
- topLeft: z5.string(),
1090
- bottomRight: z5.string(),
1091
- items: z5.string(),
1092
- ignore: z5.string().optional(),
1093
- out: z5.string().optional()
1114
+ var miroExtractSchema = z6.strictObject({
1115
+ board: z6.string().optional(),
1116
+ frame: z6.string().optional(),
1117
+ topLeft: z6.string(),
1118
+ bottomRight: z6.string(),
1119
+ items: z6.string(),
1120
+ ignore: z6.string().optional(),
1121
+ out: z6.string().optional()
1094
1122
  });
1095
1123
  var DEFAULT_BACKUP_DIR = "~/.assist/backups";
1124
+ var DEFAULT_BACKUP_STALE_AFTER = "32h";
1096
1125
  var DEFAULT_CLONE_DIR = "~/git";
1097
1126
  var assistConfigShape = {
1098
- advice: z5.strictObject({
1099
- sections: z5.partialRecord(z5.enum(adviceFragmentNames), z5.boolean()).default({}),
1100
- extra: z5.string().optional(),
1101
- verify: z5.string().optional()
1127
+ advice: z6.strictObject({
1128
+ sections: z6.partialRecord(z6.enum(adviceFragmentNames), z6.boolean()).default({}),
1129
+ extra: z6.string().optional(),
1130
+ verify: z6.string().optional()
1102
1131
  }).optional(),
1103
- backup: z5.strictObject({
1104
- dir: z5.string().default(DEFAULT_BACKUP_DIR)
1105
- }).default({ dir: DEFAULT_BACKUP_DIR }),
1106
- clone: z5.strictObject({
1107
- baseDir: z5.string().default(DEFAULT_CLONE_DIR)
1132
+ backup: z6.strictObject({
1133
+ dir: z6.string().default(DEFAULT_BACKUP_DIR),
1134
+ staleAfter: durationSchema.default(DEFAULT_BACKUP_STALE_AFTER)
1135
+ }).default({
1136
+ dir: DEFAULT_BACKUP_DIR,
1137
+ staleAfter: DEFAULT_BACKUP_STALE_AFTER
1138
+ }),
1139
+ clone: z6.strictObject({
1140
+ baseDir: z6.string().default(DEFAULT_CLONE_DIR)
1108
1141
  }).default({ baseDir: DEFAULT_CLONE_DIR }),
1109
- commit: z5.strictObject({
1110
- conventional: z5.boolean().default(false),
1111
- pull: z5.boolean().default(false),
1112
- push: z5.boolean().default(false),
1113
- expectedBranch: z5.string().optional()
1142
+ commit: z6.strictObject({
1143
+ conventional: z6.boolean().default(false),
1144
+ pull: z6.boolean().default(false),
1145
+ push: z6.boolean().default(false),
1146
+ expectedBranch: z6.string().optional()
1114
1147
  }).default({ conventional: false, pull: false, push: false }),
1115
- branch: z5.strictObject({
1116
- prefix: z5.string().optional(),
1117
- defaultBranch: z5.string().optional()
1148
+ branch: z6.strictObject({
1149
+ prefix: z6.string().optional(),
1150
+ defaultBranch: z6.string().optional()
1118
1151
  }).optional(),
1119
- devlog: z5.strictObject({
1120
- name: z5.string().optional(),
1121
- ignore: z5.array(z5.string()).optional(),
1122
- skip: z5.record(z5.string(), z5.array(z5.string())).optional()
1152
+ devlog: z6.strictObject({
1153
+ name: z6.string().optional(),
1154
+ ignore: z6.array(z6.string()).optional(),
1155
+ skip: z6.record(z6.string(), z6.array(z6.string())).optional()
1123
1156
  }).optional(),
1124
- extension: z5.strictObject({
1125
- redirects: z5.record(z5.string(), z5.string()).optional()
1157
+ extension: z6.strictObject({
1158
+ redirects: z6.record(z6.string(), z6.string()).optional()
1126
1159
  }).optional(),
1127
- notify: z5.strictObject({
1128
- enabled: z5.boolean().default(true)
1160
+ notify: z6.strictObject({
1161
+ enabled: z6.boolean().default(true)
1129
1162
  }).default({ enabled: true }),
1130
- complexity: z5.strictObject({
1131
- ignore: z5.array(z5.string()).default(["**/*test.ts*"])
1163
+ complexity: z6.strictObject({
1164
+ ignore: z6.array(z6.string()).default(["**/*test.ts*"])
1132
1165
  }).default({ ignore: ["**/*test.ts*"] }),
1133
- hardcodedColors: z5.strictObject({
1134
- ignore: z5.array(z5.string()).default([])
1166
+ hardcodedColors: z6.strictObject({
1167
+ ignore: z6.array(z6.string()).default([])
1135
1168
  }).optional(),
1136
- blockCodeComments: z5.strictObject({
1137
- ignore: z5.array(z5.string()).default([])
1169
+ blockCodeComments: z6.strictObject({
1170
+ ignore: z6.array(z6.string()).default([])
1138
1171
  }).optional(),
1139
- verify: z5.strictObject({
1140
- roots: z5.array(z5.string()).default([])
1172
+ verify: z6.strictObject({
1173
+ roots: z6.array(z6.string()).default([])
1141
1174
  }).optional(),
1142
- restructure: z5.strictObject({
1143
- ignore: z5.array(z5.string()).default([]),
1144
- pin: z5.array(z5.string()).default([]),
1145
- maxDepth: z5.number().int().positive().default(10),
1146
- maxPathLength: z5.number().int().positive().default(200)
1175
+ restructure: z6.strictObject({
1176
+ ignore: z6.array(z6.string()).default([]),
1177
+ pin: z6.array(z6.string()).default([]),
1178
+ maxDepth: z6.number().int().positive().default(10),
1179
+ maxPathLength: z6.number().int().positive().default(200)
1147
1180
  }).optional(),
1148
- jira: z5.strictObject({
1149
- acField: z5.string().default("customfield_11937")
1181
+ jira: z6.strictObject({
1182
+ acField: z6.string().default("customfield_11937")
1150
1183
  }).optional(),
1151
- roam: z5.strictObject({
1152
- clientId: secretConfigValue(z5.string()),
1153
- clientSecret: secretConfigValue(z5.string()),
1154
- accessToken: secretConfigValue(z5.string()).optional(),
1155
- refreshToken: secretConfigValue(z5.string()).optional(),
1156
- tokenExpiresAt: z5.number().optional()
1184
+ roam: z6.strictObject({
1185
+ clientId: secretConfigValue(z6.string()),
1186
+ clientSecret: secretConfigValue(z6.string()),
1187
+ accessToken: secretConfigValue(z6.string()).optional(),
1188
+ refreshToken: secretConfigValue(z6.string()).optional(),
1189
+ tokenExpiresAt: z6.number().optional()
1157
1190
  }).optional(),
1158
- slack: z5.strictObject({
1159
- channel: z5.string().optional()
1191
+ slack: z6.strictObject({
1192
+ channel: z6.string().optional()
1160
1193
  }).optional(),
1161
- prs: z5.strictObject({
1162
- slack: z5.string().optional(),
1163
- required: z5.boolean().default(true),
1164
- promptJira: z5.boolean().default(false),
1165
- promptGithub: z5.boolean().default(false),
1166
- draft: z5.boolean().default(false),
1167
- readingWordsPerMinute: z5.number().int().positive().optional()
1194
+ prs: z6.strictObject({
1195
+ slack: z6.string().optional(),
1196
+ required: z6.boolean().default(true),
1197
+ promptJira: z6.boolean().default(false),
1198
+ promptGithub: z6.boolean().default(false),
1199
+ draft: z6.boolean().default(false),
1200
+ readingWordsPerMinute: z6.number().int().positive().optional()
1168
1201
  }).optional(),
1169
- review: z5.strictObject({
1170
- codexModel: z5.string().optional(),
1171
- highLevel: z5.strictObject({
1172
- criticalPaths: z5.array(z5.string()).default(defaultCriticalPaths),
1173
- uiPaths: z5.array(z5.string()).default([]),
1174
- descriptionWordCap: z5.number().int().positive().default(300),
1175
- testPaths: z5.array(z5.string()).default(["**/*.{test,spec}.{ts,tsx,js,jsx}"]),
1176
- collapsedPaths: z5.array(z5.string()).default(["**/*.test.*", "**/generated/**"])
1202
+ review: z6.strictObject({
1203
+ codexModel: z6.string().optional(),
1204
+ highLevel: z6.strictObject({
1205
+ criticalPaths: z6.array(z6.string()).default(defaultCriticalPaths),
1206
+ uiPaths: z6.array(z6.string()).default([]),
1207
+ descriptionWordCap: z6.number().int().positive().default(300),
1208
+ testPaths: z6.array(z6.string()).default(["**/*.{test,spec}.{ts,tsx,js,jsx}"]),
1209
+ collapsedPaths: z6.array(z6.string()).default(["**/*.test.*", "**/generated/**"])
1177
1210
  }).optional()
1178
1211
  }).optional(),
1179
- readTime: z5.strictObject({
1180
- wordsPerMinute: z5.number().int().positive().default(200)
1212
+ readTime: z6.strictObject({
1213
+ wordsPerMinute: z6.number().int().positive().default(200)
1181
1214
  }).optional(),
1182
- releases: z5.strictObject({
1183
- streams: z5.array(
1184
- z5.strictObject({
1185
- name: z5.string(),
1186
- repo: z5.string(),
1187
- workflow: z5.string(),
1188
- nodes: z5.array(
1189
- z5.strictObject({
1190
- id: z5.string(),
1191
- environment: z5.string().optional(),
1192
- kind: z5.enum(["build", "gate"]).optional(),
1193
- label: z5.string().optional()
1215
+ releases: z6.strictObject({
1216
+ streams: z6.array(
1217
+ z6.strictObject({
1218
+ name: z6.string(),
1219
+ repo: z6.string(),
1220
+ workflow: z6.string(),
1221
+ nodes: z6.array(
1222
+ z6.strictObject({
1223
+ id: z6.string(),
1224
+ environment: z6.string().optional(),
1225
+ kind: z6.enum(["build", "gate"]).optional(),
1226
+ label: z6.string().optional()
1194
1227
  })
1195
1228
  ),
1196
- edges: z5.array(z5.tuple([z5.string(), z5.string()])).default([])
1229
+ edges: z6.array(z6.tuple([z6.string(), z6.string()])).default([])
1197
1230
  })
1198
1231
  ).default([])
1199
1232
  }).optional(),
1200
- autoUpdate: z5.strictObject({
1201
- enabled: z5.boolean().default(true)
1233
+ autoUpdate: z6.strictObject({
1234
+ enabled: z6.boolean().default(true)
1202
1235
  }).optional(),
1203
- worktree: z5.strictObject({
1204
- enabled: z5.boolean().default(false),
1205
- trunk: z5.boolean().default(false),
1206
- root: z5.string().optional(),
1207
- install: z5.union([z5.boolean(), z5.string(), z5.array(z5.string())]).default(true),
1208
- commitBeforeManualChecks: z5.boolean().default(false),
1209
- commitBeforePhaseEnd: z5.boolean().optional(),
1210
- copy: z5.array(z5.string()).default([
1236
+ worktree: z6.strictObject({
1237
+ enabled: z6.boolean().default(false),
1238
+ trunk: z6.boolean().default(false),
1239
+ root: z6.string().optional(),
1240
+ install: z6.union([z6.boolean(), z6.string(), z6.array(z6.string())]).default(true),
1241
+ commitBeforeManualChecks: z6.boolean().default(false),
1242
+ commitBeforePhaseEnd: z6.boolean().optional(),
1243
+ copy: z6.array(z6.string()).default([
1211
1244
  ".env",
1212
1245
  "settings.local.json",
1213
1246
  ".claude/settings.local.json"
1214
1247
  ])
1215
1248
  }).optional(),
1216
- run: z5.array(z5.union([runConfigSchema, runLinkSchema])).optional(),
1249
+ run: z6.array(z6.union([runConfigSchema, runLinkSchema])).optional(),
1217
1250
  transcript: transcriptConfigSchema.optional(),
1218
- cliReadVerbs: z5.record(z5.string(), z5.array(z5.string())).optional(),
1219
- cliHook: z5.strictObject({
1220
- blockNpmRun: z5.boolean().default(true)
1251
+ cliReadVerbs: z6.record(z6.string(), z6.array(z6.string())).optional(),
1252
+ cliHook: z6.strictObject({
1253
+ blockNpmRun: z6.boolean().default(true)
1221
1254
  }).optional(),
1222
- dotnet: z5.strictObject({
1223
- inspect: z5.strictObject({
1224
- suppress: z5.array(z5.string()).default([])
1255
+ dotnet: z6.strictObject({
1256
+ inspect: z6.strictObject({
1257
+ suppress: z6.array(z6.string()).default([])
1225
1258
  }).default({ suppress: [] })
1226
1259
  }).optional(),
1227
- litellm: z5.strictObject({
1228
- baseUrl: z5.string().optional(),
1229
- apiKey: secretConfigValue(z5.string()).optional()
1260
+ litellm: z6.strictObject({
1261
+ baseUrl: z6.string().optional(),
1262
+ apiKey: secretConfigValue(z6.string()).optional()
1230
1263
  }).optional(),
1231
- ravendb: z5.strictObject({
1232
- connections: z5.array(
1233
- z5.strictObject({
1234
- name: z5.string(),
1235
- url: z5.string(),
1236
- database: z5.string(),
1237
- apiKeyRef: z5.string()
1264
+ ravendb: z6.strictObject({
1265
+ connections: z6.array(
1266
+ z6.strictObject({
1267
+ name: z6.string(),
1268
+ url: z6.string(),
1269
+ database: z6.string(),
1270
+ apiKeyRef: z6.string()
1238
1271
  })
1239
1272
  ).default([]),
1240
- defaultConnection: z5.string().optional()
1273
+ defaultConnection: z6.string().optional()
1241
1274
  }).optional(),
1242
- seq: z5.strictObject({
1243
- connections: z5.array(
1244
- z5.strictObject({
1245
- name: z5.string(),
1246
- url: z5.string(),
1247
- apiToken: secretConfigValue(z5.string())
1275
+ seq: z6.strictObject({
1276
+ connections: z6.array(
1277
+ z6.strictObject({
1278
+ name: z6.string(),
1279
+ url: z6.string(),
1280
+ apiToken: secretConfigValue(z6.string())
1248
1281
  })
1249
1282
  ).default([]),
1250
- defaultConnection: z5.string().optional()
1283
+ defaultConnection: z6.string().optional()
1251
1284
  }).optional(),
1252
- sql: z5.strictObject({
1253
- connections: z5.array(
1254
- z5.strictObject({
1255
- name: z5.string(),
1256
- server: z5.string(),
1257
- port: z5.number(),
1258
- user: z5.string(),
1259
- password: secretConfigValue(z5.string()),
1260
- database: z5.string()
1285
+ sql: z6.strictObject({
1286
+ connections: z6.array(
1287
+ z6.strictObject({
1288
+ name: z6.string(),
1289
+ server: z6.string(),
1290
+ port: z6.number(),
1291
+ user: z6.string(),
1292
+ password: secretConfigValue(z6.string()),
1293
+ database: z6.string()
1261
1294
  })
1262
1295
  ).default([]),
1263
- defaultConnection: z5.string().optional()
1296
+ defaultConnection: z6.string().optional()
1264
1297
  }).optional(),
1265
- screenshot: z5.strictObject({
1266
- outputDir: z5.string().default("./screenshots")
1298
+ screenshot: z6.strictObject({
1299
+ outputDir: z6.string().default("./screenshots")
1267
1300
  }).default({ outputDir: "./screenshots" }),
1268
- sessions: z5.strictObject({
1269
- nodeName: z5.string().optional(),
1270
- links: z5.array(sessionLinkSchema).optional(),
1271
- linkVersionCheck: z5.enum(["block", "warn", "off"]).default("block"),
1272
- tailscaleServe: z5.boolean().default(true),
1273
- includeCommittedChanges: z5.boolean().default(true),
1274
- floatWaiting: z5.boolean().default(true),
1275
- floatWaitingAfterMs: z5.number().default(5e3),
1276
- maxLive: z5.number().default(24),
1277
- newSessionMode: z5.enum(["draft", "bug", "prompt", "design"]).default("draft"),
1301
+ sessions: z6.strictObject({
1302
+ nodeName: z6.string().optional(),
1303
+ links: z6.array(sessionLinkSchema).optional(),
1304
+ linkVersionCheck: z6.enum(["block", "warn", "off"]).default("block"),
1305
+ tailscaleServe: z6.boolean().default(true),
1306
+ includeCommittedChanges: z6.boolean().default(true),
1307
+ floatWaiting: z6.boolean().default(true),
1308
+ floatWaitingAfterMs: z6.number().default(5e3),
1309
+ maxLive: z6.number().default(24),
1310
+ newSessionMode: z6.enum(["draft", "bug", "prompt", "design"]).default("draft"),
1278
1311
  hotkeys: hotkeysSchema.optional()
1279
1312
  }).optional(),
1280
- database: z5.strictObject({
1281
- url: secretConfigValue(z5.string()).optional()
1313
+ database: z6.strictObject({
1314
+ url: secretConfigValue(z6.string()).optional()
1282
1315
  }).default({}),
1283
- mermaid: z5.strictObject({
1284
- krokiUrl: z5.string().default("https://kroki.io")
1316
+ mermaid: z6.strictObject({
1317
+ krokiUrl: z6.string().default("https://kroki.io")
1285
1318
  }).default({ krokiUrl: "https://kroki.io" }),
1286
- miro: z5.strictObject({
1287
- extracts: z5.record(z5.string(), miroExtractSchema).optional()
1319
+ miro: z6.strictObject({
1320
+ extracts: z6.record(z6.string(), miroExtractSchema).optional()
1288
1321
  }).optional(),
1289
- news: z5.strictObject({
1290
- showInNav: z5.boolean().default(false),
1291
- feeds: z5.array(z5.string()).optional()
1322
+ news: z6.strictObject({
1323
+ showInNav: z6.boolean().default(false),
1324
+ feeds: z6.array(z6.string()).optional()
1292
1325
  }).optional(),
1293
- next: z5.strictObject({
1294
- peers: z5.array(z5.string()).optional(),
1295
- repos: z5.array(z5.string()).optional(),
1296
- projects: z5.array(
1297
- z5.string().regex(
1326
+ next: z6.strictObject({
1327
+ peers: z6.array(z6.string()).optional(),
1328
+ repos: z6.array(z6.string()).optional(),
1329
+ projects: z6.array(
1330
+ z6.string().regex(
1298
1331
  /^[^/\s]+\/\d+$/,
1299
1332
  "Use <owner>/<project number>, e.g. my-org/3"
1300
1333
  )
1301
1334
  ).optional(),
1302
- pickStatuses: z5.array(z5.string()).optional(),
1303
- excludeLabels: z5.array(z5.string()).optional(),
1304
- excludeTypes: z5.array(z5.string()).optional()
1335
+ pickStatuses: z6.array(z6.string()).optional(),
1336
+ excludeLabels: z6.array(z6.string()).optional(),
1337
+ excludeTypes: z6.array(z6.string()).optional()
1305
1338
  }).optional(),
1306
- deny: z5.array(
1307
- z5.strictObject({
1308
- pattern: z5.string(),
1309
- message: z5.string()
1339
+ deny: z6.array(
1340
+ z6.strictObject({
1341
+ pattern: z6.string(),
1342
+ message: z6.string()
1310
1343
  })
1311
1344
  ).optional(),
1312
- forbiddenStrings: z5.array(
1313
- z5.strictObject({
1314
- file: z5.string(),
1315
- paths: z5.array(z5.string()),
1316
- disallowed: z5.string()
1345
+ forbiddenStrings: z6.array(
1346
+ z6.strictObject({
1347
+ file: z6.string(),
1348
+ paths: z6.array(z6.string()),
1349
+ disallowed: z6.string()
1317
1350
  })
1318
1351
  ).optional(),
1319
- sync: z5.strictObject({
1320
- autoConfirm: z5.boolean().default(false)
1352
+ sync: z6.strictObject({
1353
+ autoConfirm: z6.boolean().default(false)
1321
1354
  }).default({ autoConfirm: false }),
1322
- harness: z5.strictObject({
1323
- engine: z5.enum(["claude", "codex", "pi"]).default("claude"),
1324
- exposeCodexActions: z5.boolean().optional(),
1325
- exposePiActions: z5.boolean().optional(),
1326
- codexModel: z5.string().optional()
1355
+ harness: z6.strictObject({
1356
+ engine: z6.enum(["claude", "codex", "pi"]).default("claude"),
1357
+ exposeCodexActions: z6.boolean().optional(),
1358
+ exposePiActions: z6.boolean().optional(),
1359
+ codexModel: z6.string().optional()
1327
1360
  }).default({ engine: "claude" })
1328
1361
  };
1329
- var repoConfigSchema = z5.strictObject(assistConfigShape).partial();
1330
- var assistConfigSchema = z5.strictObject({
1362
+ var repoConfigSchema = z6.strictObject(assistConfigShape).partial();
1363
+ var assistConfigSchema = z6.strictObject({
1331
1364
  ...assistConfigShape,
1332
- repos: z5.record(z5.string(), repoConfigSchema).optional()
1365
+ repos: z6.record(z6.string(), repoConfigSchema).optional()
1333
1366
  });
1334
1367
 
1335
1368
  // src/shared/loadConfigFrom.ts
@@ -2492,46 +2525,46 @@ async function loadAllItems(orm, origin) {
2492
2525
  import { readFileSync as readFileSync5 } from "fs";
2493
2526
 
2494
2527
  // src/commands/backlog/types.ts
2495
- import { z as z6 } from "zod";
2496
- var backlogStatusSchema = z6.enum(["todo", "in-progress", "done", "wontdo"]);
2497
- var backlogTypeSchema = z6.enum(["story", "bug"]);
2498
- var planTaskSchema = z6.object({
2499
- task: z6.string()
2528
+ import { z as z7 } from "zod";
2529
+ var backlogStatusSchema = z7.enum(["todo", "in-progress", "done", "wontdo"]);
2530
+ var backlogTypeSchema = z7.enum(["story", "bug"]);
2531
+ var planTaskSchema = z7.object({
2532
+ task: z7.string()
2500
2533
  }).strip();
2501
- var planPhaseSchema = z6.strictObject({
2502
- name: z6.string(),
2503
- tasks: z6.array(planTaskSchema),
2504
- manualChecks: z6.array(z6.string()).optional()
2534
+ var planPhaseSchema = z7.strictObject({
2535
+ name: z7.string(),
2536
+ tasks: z7.array(planTaskSchema),
2537
+ manualChecks: z7.array(z7.string()).optional()
2505
2538
  });
2506
- var phaseUsageSchema = z6.strictObject({
2507
- phaseIdx: z6.number(),
2508
- tokensUp: z6.number(),
2509
- tokensDown: z6.number(),
2510
- activeMs: z6.number(),
2511
- peakContextPct: z6.number()
2539
+ var phaseUsageSchema = z7.strictObject({
2540
+ phaseIdx: z7.number(),
2541
+ tokensUp: z7.number(),
2542
+ tokensDown: z7.number(),
2543
+ activeMs: z7.number(),
2544
+ peakContextPct: z7.number()
2512
2545
  });
2513
- var phaseSessionSchema = z6.strictObject({
2514
- phaseIdx: z6.number(),
2515
- claudeSessionId: z6.string(),
2516
- hostname: z6.string(),
2517
- osUser: z6.string(),
2518
- createdAt: z6.string().optional()
2546
+ var phaseSessionSchema = z7.strictObject({
2547
+ phaseIdx: z7.number(),
2548
+ claudeSessionId: z7.string(),
2549
+ hostname: z7.string(),
2550
+ osUser: z7.string(),
2551
+ createdAt: z7.string().optional()
2519
2552
  });
2520
- var phaseUsageTotalSchema = z6.strictObject({
2521
- tokensUp: z6.number(),
2522
- tokensDown: z6.number(),
2523
- activeMs: z6.number(),
2524
- peakContextPct: z6.number()
2553
+ var phaseUsageTotalSchema = z7.strictObject({
2554
+ tokensUp: z7.number(),
2555
+ tokensDown: z7.number(),
2556
+ activeMs: z7.number(),
2557
+ peakContextPct: z7.number()
2525
2558
  });
2526
- var backlogCommentTypeSchema = z6.enum(["comment", "summary"]);
2527
- var backlogCommentSchema = z6.strictObject({
2528
- id: z6.number().optional(),
2529
- text: z6.string(),
2530
- phase: z6.number().optional(),
2531
- timestamp: z6.string(),
2559
+ var backlogCommentTypeSchema = z7.enum(["comment", "summary"]);
2560
+ var backlogCommentSchema = z7.strictObject({
2561
+ id: z7.number().optional(),
2562
+ text: z7.string(),
2563
+ phase: z7.number().optional(),
2564
+ timestamp: z7.string(),
2532
2565
  type: backlogCommentTypeSchema
2533
2566
  });
2534
- var gitRefKindSchema = z6.enum([
2567
+ var gitRefKindSchema = z7.enum([
2535
2568
  "branch",
2536
2569
  "commit",
2537
2570
  "commit-parent",
@@ -2539,40 +2572,40 @@ var gitRefKindSchema = z6.enum([
2539
2572
  "slack",
2540
2573
  "session"
2541
2574
  ]);
2542
- var gitRefSchema = z6.strictObject({
2575
+ var gitRefSchema = z7.strictObject({
2543
2576
  kind: gitRefKindSchema,
2544
- ref: z6.string(),
2545
- title: z6.string().optional(),
2546
- url: z6.string().optional(),
2547
- state: z6.string().optional(),
2548
- createdAt: z6.string().optional()
2577
+ ref: z7.string(),
2578
+ title: z7.string().optional(),
2579
+ url: z7.string().optional(),
2580
+ state: z7.string().optional(),
2581
+ createdAt: z7.string().optional()
2549
2582
  });
2550
- var backlogLinkTypeSchema = z6.enum(["relates-to", "depends-on"]);
2551
- var backlogLinkSchema = z6.strictObject({
2583
+ var backlogLinkTypeSchema = z7.enum(["relates-to", "depends-on"]);
2584
+ var backlogLinkSchema = z7.strictObject({
2552
2585
  type: backlogLinkTypeSchema,
2553
- targetId: z6.number()
2586
+ targetId: z7.number()
2554
2587
  });
2555
- var backlogItemSchema = z6.strictObject({
2556
- id: z6.number(),
2588
+ var backlogItemSchema = z7.strictObject({
2589
+ id: z7.number(),
2557
2590
  type: backlogTypeSchema.default("story"),
2558
- name: z6.string(),
2559
- description: z6.string().optional(),
2560
- acceptanceCriteria: z6.array(z6.string()),
2561
- plan: z6.array(planPhaseSchema).optional(),
2562
- currentPhase: z6.number().optional(),
2563
- starred: z6.boolean().default(false),
2591
+ name: z7.string(),
2592
+ description: z7.string().optional(),
2593
+ acceptanceCriteria: z7.array(z7.string()),
2594
+ plan: z7.array(planPhaseSchema).optional(),
2595
+ currentPhase: z7.number().optional(),
2596
+ starred: z7.boolean().default(false),
2564
2597
  status: backlogStatusSchema,
2565
- comments: z6.array(backlogCommentSchema).optional(),
2566
- links: z6.array(backlogLinkSchema).optional(),
2567
- phaseUsage: z6.array(phaseUsageSchema).optional(),
2568
- phaseSessions: z6.array(phaseSessionSchema).optional(),
2598
+ comments: z7.array(backlogCommentSchema).optional(),
2599
+ links: z7.array(backlogLinkSchema).optional(),
2600
+ phaseUsage: z7.array(phaseUsageSchema).optional(),
2601
+ phaseSessions: z7.array(phaseSessionSchema).optional(),
2569
2602
  usageTotal: phaseUsageTotalSchema.optional(),
2570
- gitRefs: z6.array(gitRefSchema).optional(),
2571
- origin: z6.string().optional(),
2572
- jiraKey: z6.string().optional(),
2573
- githubIssue: z6.string().optional()
2603
+ gitRefs: z7.array(gitRefSchema).optional(),
2604
+ origin: z7.string().optional(),
2605
+ jiraKey: z7.string().optional(),
2606
+ githubIssue: z7.string().optional()
2574
2607
  });
2575
- var backlogFileSchema = z6.array(backlogItemSchema);
2608
+ var backlogFileSchema = z7.array(backlogItemSchema);
2576
2609
 
2577
2610
  // src/commands/backlog/parseBacklogJsonl.ts
2578
2611
  function parseBacklogJsonl(path108) {
@@ -4944,13 +4977,13 @@ function docsFeedbackPrompt({
4944
4977
  }
4945
4978
 
4946
4979
  // src/commands/sessions/web/docsFeedback/docsFeedbackSchema.ts
4947
- import { z as z7 } from "zod";
4948
- var docsFeedbackSchema = z7.object({
4949
- pageId: z7.string().min(1),
4950
- heading: z7.string().min(1),
4951
- source: z7.string().min(1),
4952
- selection: z7.string().min(1),
4953
- prompt: z7.string().trim().min(1)
4980
+ import { z as z8 } from "zod";
4981
+ var docsFeedbackSchema = z8.object({
4982
+ pageId: z8.string().min(1),
4983
+ heading: z8.string().min(1),
4984
+ source: z8.string().min(1),
4985
+ selection: z8.string().min(1),
4986
+ prompt: z8.string().trim().min(1)
4954
4987
  });
4955
4988
 
4956
4989
  // src/commands/sessions/web/docsFeedback/docsFeedback.ts
@@ -5304,6 +5337,12 @@ function sessionFromGithubPreflight(req, res) {
5304
5337
  res.end();
5305
5338
  }
5306
5339
 
5340
+ // src/commands/sessions/web/getBackupStatus.ts
5341
+ function getBackupStatus(_req, res) {
5342
+ const staleAfterMs = parseDuration(loadConfig().backup.staleAfter);
5343
+ respondJson(res, 200, { staleAfterMs });
5344
+ }
5345
+
5307
5346
  // src/shared/db/listBackups.ts
5308
5347
  import { desc } from "drizzle-orm";
5309
5348
  async function listBackups(db) {
@@ -5827,6 +5866,11 @@ var backupConfigHelp = [
5827
5866
  key: "backup.dir",
5828
5867
  setter: "assist config set backup.dir ~/.assist/backups",
5829
5868
  note: "directory dumps are written to (default: ~/.assist/backups)"
5869
+ },
5870
+ {
5871
+ key: "backup.staleAfter",
5872
+ setter: "assist config set backup.staleAfter 32h",
5873
+ note: "age (s, m or h) after which the web header warns the last backup is overdue (default: 32h)"
5830
5874
  }
5831
5875
  ];
5832
5876
 
@@ -6548,12 +6592,140 @@ function readConfigEntries(cwd, globalConfigPath = getGlobalConfigPath()) {
6548
6592
  return describeConfigLeaves(assistConfigSchema).filter((leaf) => !KEYS_STRIPPED_FROM_MERGED_CONFIG.has(leaf.key)).map((leaf) => configEntryFor(leaf, context));
6549
6593
  }
6550
6594
 
6595
+ // src/commands/backlog/replaceFeeds.ts
6596
+ async function replaceFeeds(db, urls) {
6597
+ const unique = [...new Set(urls)];
6598
+ await db.transaction(async (tx) => {
6599
+ await tx.delete(feeds);
6600
+ if (unique.length > 0)
6601
+ await tx.insert(feeds).values(unique.map((url) => ({ url })));
6602
+ });
6603
+ }
6604
+
6605
+ // src/commands/config/dbBackedConfigKeys.ts
6606
+ var newsFeeds = {
6607
+ read: async (db) => {
6608
+ const urls = await listFeeds(db);
6609
+ return urls.length > 0 ? urls : void 0;
6610
+ },
6611
+ write: (db, value) => replaceFeeds(db, value),
6612
+ unset: async (db) => {
6613
+ const had = (await listFeeds(db)).length > 0;
6614
+ await replaceFeeds(db, []);
6615
+ return had;
6616
+ }
6617
+ };
6618
+ var dbBackedConfigKeys = {
6619
+ "news.feeds": newsFeeds
6620
+ };
6621
+ function isDbBackedConfigKey(key) {
6622
+ return Object.hasOwn(dbBackedConfigKeys, key);
6623
+ }
6624
+ function dbBackedRepoError(key) {
6625
+ return `"${key}" is stored in the database and shared by every repo; drop --repo`;
6626
+ }
6627
+
6628
+ // src/commands/config/setNestedValue.ts
6629
+ function isPlainObject2(val) {
6630
+ return val !== null && typeof val === "object" && !Array.isArray(val);
6631
+ }
6632
+ function isNumericKey(key) {
6633
+ return /^\d+$/.test(key);
6634
+ }
6635
+ function resolveKey(key) {
6636
+ return isNumericKey(key) ? Number.parseInt(key, 10) : key;
6637
+ }
6638
+ function getItem(container, key) {
6639
+ if (Array.isArray(container)) return container[key];
6640
+ return container[key];
6641
+ }
6642
+ function setItem(container, key, value) {
6643
+ if (Array.isArray(container)) container[key] = value;
6644
+ else container[key] = value;
6645
+ }
6646
+ function ensureArray(container, key) {
6647
+ const existing = getItem(container, key);
6648
+ const arr = Array.isArray(existing) ? [...existing] : [];
6649
+ setItem(container, key, arr);
6650
+ return arr;
6651
+ }
6652
+ function ensureObject(container, key) {
6653
+ const existing = getItem(container, key);
6654
+ const obj = isPlainObject2(existing) ? { ...existing } : {};
6655
+ setItem(container, key, obj);
6656
+ return obj;
6657
+ }
6658
+ function stepIntoNested(container, key, nextKey) {
6659
+ const resolved = resolveKey(key);
6660
+ if (nextKey !== void 0 && isNumericKey(nextKey)) {
6661
+ return ensureArray(container, resolved);
6662
+ }
6663
+ return ensureObject(container, resolved);
6664
+ }
6665
+ function setNestedValue(obj, path108, value) {
6666
+ const keys = path108.split(".");
6667
+ const result = { ...obj };
6668
+ let current = result;
6669
+ for (let i = 0; i < keys.length - 1; i++) {
6670
+ current = stepIntoNested(current, keys[i], keys[i + 1]);
6671
+ }
6672
+ setItem(current, resolveKey(keys[keys.length - 1]), value);
6673
+ return result;
6674
+ }
6675
+
6676
+ // src/commands/config/withDbBackedConfigValues.ts
6677
+ function covers(scope, key) {
6678
+ return scope === void 0 || scope === key || key.startsWith(`${scope}.`) || scope.startsWith(`${key}.`);
6679
+ }
6680
+ function dbBackedKeysIn(scope) {
6681
+ if (!process.env.ASSIST_DATABASE_URL && !loadConfig().database.url) return [];
6682
+ return Object.keys(dbBackedConfigKeys).filter((key) => covers(scope, key));
6683
+ }
6684
+ async function withDbBackedConfigValues(config, keys) {
6685
+ if (keys.length === 0) return config;
6686
+ const db = await getDb();
6687
+ let merged = config;
6688
+ for (const key of keys) {
6689
+ const value = await dbBackedConfigKeys[key].read(db);
6690
+ if (value !== void 0) merged = setNestedValue(merged, key, value);
6691
+ }
6692
+ return merged;
6693
+ }
6694
+
6695
+ // src/commands/config/withDbBackedConfigEntries.ts
6696
+ var DB_BACKED_CONFIG_FILE = "the shared db (all nodes)";
6697
+ function dbBackedEntry(entry, value) {
6698
+ const set = value !== void 0;
6699
+ return {
6700
+ ...entry,
6701
+ value: set ? value : entry.defaultValue,
6702
+ source: set ? "global" : "default",
6703
+ sources: set ? ["global"] : [],
6704
+ layers: set ? { global: value } : {},
6705
+ globalConfigFile: DB_BACKED_CONFIG_FILE,
6706
+ globalOnly: true
6707
+ };
6708
+ }
6709
+ async function withDbBackedConfigEntries(entries) {
6710
+ if (dbBackedKeysIn().length === 0) return entries;
6711
+ const db = await getDb();
6712
+ return Promise.all(
6713
+ entries.map(
6714
+ async (entry) => isDbBackedConfigKey(entry.key) ? dbBackedEntry(entry, await dbBackedConfigKeys[entry.key].read(db)) : entry
6715
+ )
6716
+ );
6717
+ }
6718
+
6551
6719
  // src/commands/sessions/web/getConfig.ts
6552
- function getConfig(req, res) {
6720
+ async function getConfig(req, res) {
6553
6721
  const cwd = getCwdParam(req, res);
6554
6722
  if (!cwd) return;
6555
6723
  try {
6556
- respondJson(res, 200, readConfigEntries(cwd));
6724
+ respondJson(
6725
+ res,
6726
+ 200,
6727
+ await withDbBackedConfigEntries(readConfigEntries(cwd))
6728
+ );
6557
6729
  } catch (error) {
6558
6730
  respondJson(res, 500, {
6559
6731
  error: error instanceof Error ? error.message : "Failed to read config"
@@ -7382,17 +7554,21 @@ async function fetchFeeds(urls, onProgress) {
7382
7554
  }
7383
7555
 
7384
7556
  // src/commands/sessions/web/listNewsItems.ts
7385
- var cachedItems;
7386
- var inflight;
7557
+ var CACHE_TTL_MS4 = 15 * 6e4;
7558
+ var cache3;
7387
7559
  async function listNewsItems(_req, res) {
7388
- if (!cachedItems) {
7389
- if (!inflight)
7390
- inflight = getReady().then(
7391
- ({ orm }) => listFeeds(orm).then((urls) => fetchFeeds(urls))
7392
- );
7393
- cachedItems = await inflight;
7560
+ const { orm } = await getReady();
7561
+ const urls = await listFeeds(orm);
7562
+ const feedsKey = urls.join("\n");
7563
+ const now = Date.now();
7564
+ if (!cache3 || cache3.feedsKey !== feedsKey || cache3.expires <= now) {
7565
+ const items2 = fetchFeeds(urls);
7566
+ cache3 = { feedsKey, expires: now + CACHE_TTL_MS4, items: items2 };
7567
+ items2.catch(() => {
7568
+ if (cache3?.items === items2) cache3 = void 0;
7569
+ });
7394
7570
  }
7395
- respondJson(res, 200, cachedItems);
7571
+ respondJson(res, 200, await cache3.items);
7396
7572
  }
7397
7573
 
7398
7574
  // src/commands/sessions/web/newsNavConfig.ts
@@ -7405,8 +7581,8 @@ function newsNavConfig(_req, res) {
7405
7581
  import { execFile as execFile6 } from "child_process";
7406
7582
  import { promisify as promisify6 } from "util";
7407
7583
  var execFileAsync6 = promisify6(execFile6);
7408
- var CACHE_TTL_MS4 = 3e4;
7409
- var cache3 = /* @__PURE__ */ new Map();
7584
+ var CACHE_TTL_MS5 = 3e4;
7585
+ var cache4 = /* @__PURE__ */ new Map();
7410
7586
  function partialGraphqlData(error) {
7411
7587
  const stdout = error.stdout;
7412
7588
  if (typeof stdout !== "string") return null;
@@ -7434,12 +7610,12 @@ async function runGh(cwd, args) {
7434
7610
  }
7435
7611
  function ghJson(cwd, args) {
7436
7612
  const key = [cwd, ...args].join("\0");
7437
- const hit = cache3.get(key);
7438
- if (hit && Date.now() - hit.at < CACHE_TTL_MS4)
7613
+ const hit = cache4.get(key);
7614
+ if (hit && Date.now() - hit.at < CACHE_TTL_MS5)
7439
7615
  return hit.result;
7440
7616
  const result = runGh(cwd, args);
7441
- cache3.set(key, { at: Date.now(), result });
7442
- result.catch(() => cache3.delete(key));
7617
+ cache4.set(key, { at: Date.now(), result });
7618
+ result.catch(() => cache4.delete(key));
7443
7619
  return result;
7444
7620
  }
7445
7621
 
@@ -8567,14 +8743,14 @@ async function openInCode(req, res) {
8567
8743
  import { execFile as execFile7 } from "child_process";
8568
8744
  import { promisify as promisify8 } from "util";
8569
8745
  var execFileAsync7 = promisify8(execFile7);
8570
- var CACHE_TTL_MS5 = 3e4;
8746
+ var CACHE_TTL_MS6 = 3e4;
8571
8747
  function createCachedGhJson(args, parse5, fallback, options2 = {}) {
8572
8748
  const { cacheFallback = true } = options2;
8573
- const cache6 = /* @__PURE__ */ new Map();
8749
+ const cache7 = /* @__PURE__ */ new Map();
8574
8750
  return async (cwd, extraArgs = []) => {
8575
8751
  const key = extraArgs.length ? `${cwd}\0${extraArgs.join("\0")}` : cwd;
8576
8752
  const now = Date.now();
8577
- const cached = cache6.get(key);
8753
+ const cached = cache7.get(key);
8578
8754
  if (cached && cached.expires > now) return cached.value;
8579
8755
  let value = fallback;
8580
8756
  try {
@@ -8588,7 +8764,7 @@ function createCachedGhJson(args, parse5, fallback, options2 = {}) {
8588
8764
  value = fallback;
8589
8765
  }
8590
8766
  if (cacheFallback || value !== fallback)
8591
- cache6.set(key, { value, expires: now + CACHE_TTL_MS5 });
8767
+ cache7.set(key, { value, expires: now + CACHE_TTL_MS6 });
8592
8768
  return value;
8593
8769
  };
8594
8770
  }
@@ -10151,6 +10327,27 @@ function sessionView(_req, res) {
10151
10327
  });
10152
10328
  }
10153
10329
 
10330
+ // src/commands/config/applyDbBackedConfigWrite.ts
10331
+ async function applyDbBackedConfigWrite(key, scope, write) {
10332
+ if (scope !== "global")
10333
+ return {
10334
+ ok: false,
10335
+ errors: [`"${key}" is stored in the shared db; save it globally`]
10336
+ };
10337
+ const handler = dbBackedConfigKeys[key];
10338
+ const db = await getDb();
10339
+ if ("unset" in write)
10340
+ return {
10341
+ ok: true,
10342
+ payload: {
10343
+ target: DB_BACKED_CONFIG_FILE,
10344
+ removed: await handler.unset(db)
10345
+ }
10346
+ };
10347
+ await handler.write(db, write.value);
10348
+ return { ok: true, payload: { target: DB_BACKED_CONFIG_FILE } };
10349
+ }
10350
+
10154
10351
  // src/commands/config/coerceConfigScalar.ts
10155
10352
  function coerceConfigScalar(key, raw, type) {
10156
10353
  if (type === "boolean") return coerceBoolean(key, raw);
@@ -10347,54 +10544,6 @@ function restoreConfigWriteSecrets(key, value, cwd, globalConfigPath) {
10347
10544
  return restoreConfigSecrets(value, getNestedValue(stored, key), node);
10348
10545
  }
10349
10546
 
10350
- // src/commands/config/setNestedValue.ts
10351
- function isPlainObject2(val) {
10352
- return val !== null && typeof val === "object" && !Array.isArray(val);
10353
- }
10354
- function isNumericKey(key) {
10355
- return /^\d+$/.test(key);
10356
- }
10357
- function resolveKey(key) {
10358
- return isNumericKey(key) ? Number.parseInt(key, 10) : key;
10359
- }
10360
- function getItem(container, key) {
10361
- if (Array.isArray(container)) return container[key];
10362
- return container[key];
10363
- }
10364
- function setItem(container, key, value) {
10365
- if (Array.isArray(container)) container[key] = value;
10366
- else container[key] = value;
10367
- }
10368
- function ensureArray(container, key) {
10369
- const existing = getItem(container, key);
10370
- const arr = Array.isArray(existing) ? [...existing] : [];
10371
- setItem(container, key, arr);
10372
- return arr;
10373
- }
10374
- function ensureObject(container, key) {
10375
- const existing = getItem(container, key);
10376
- const obj = isPlainObject2(existing) ? { ...existing } : {};
10377
- setItem(container, key, obj);
10378
- return obj;
10379
- }
10380
- function stepIntoNested(container, key, nextKey) {
10381
- const resolved = resolveKey(key);
10382
- if (nextKey !== void 0 && isNumericKey(nextKey)) {
10383
- return ensureArray(container, resolved);
10384
- }
10385
- return ensureObject(container, resolved);
10386
- }
10387
- function setNestedValue(obj, path108, value) {
10388
- const keys = path108.split(".");
10389
- const result = { ...obj };
10390
- let current = result;
10391
- for (let i = 0; i < keys.length - 1; i++) {
10392
- current = stepIntoNested(current, keys[i], keys[i + 1]);
10393
- }
10394
- setItem(current, resolveKey(keys[keys.length - 1]), value);
10395
- return result;
10396
- }
10397
-
10398
10547
  // src/commands/config/validateConfig.ts
10399
10548
  function validateConfig(updated2, key, schema2 = assistConfigSchema) {
10400
10549
  const result = schema2.safeParse(stripLegacyConfigKeys(updated2));
@@ -10506,12 +10655,12 @@ import { dirname as dirname12 } from "path";
10506
10655
  function writeRepoConfigCache(repos2) {
10507
10656
  const path108 = repoConfigCachePath();
10508
10657
  mkdirSync6(dirname12(path108), { recursive: true });
10509
- const cache6 = {
10658
+ const cache7 = {
10510
10659
  refreshedAt: (/* @__PURE__ */ new Date()).toISOString(),
10511
10660
  repos: repos2
10512
10661
  };
10513
10662
  const tmp = `${path108}.${process.pid}.tmp`;
10514
- writeFileSync5(tmp, JSON.stringify(cache6, null, 2));
10663
+ writeFileSync5(tmp, JSON.stringify(cache7, null, 2));
10515
10664
  renameSync3(tmp, path108);
10516
10665
  }
10517
10666
 
@@ -10612,6 +10761,10 @@ function setConfig(req, res) {
10612
10761
  restoreConfigWriteSecrets(request.key, request.value, request.cwd)
10613
10762
  );
10614
10763
  if (!coerced.ok) return { ok: false, errors: [coerced.error] };
10764
+ if (isDbBackedConfigKey(request.key))
10765
+ return applyDbBackedConfigWrite(request.key, request.scope, {
10766
+ value: coerced.value
10767
+ });
10615
10768
  return applyScopedConfigSet(
10616
10769
  request.key,
10617
10770
  coerced.value,
@@ -10769,6 +10922,10 @@ function unsetConfig(req, res) {
10769
10922
  return handleConfigWrite(req, res, (request) => {
10770
10923
  if (!isKnownConfigKey(request.key))
10771
10924
  return { ok: false, errors: [`Unknown config key "${request.key}"`] };
10925
+ if (isDbBackedConfigKey(request.key))
10926
+ return applyDbBackedConfigWrite(request.key, request.scope, {
10927
+ unset: true
10928
+ });
10772
10929
  return applyScopedConfigUnset(request.key, request.cwd, request.scope);
10773
10930
  });
10774
10931
  }
@@ -11224,19 +11381,19 @@ import { dirname as dirname15, join as join28 } from "path";
11224
11381
  import { fileURLToPath as fileURLToPath2 } from "url";
11225
11382
  function createBundleHandler(importMetaUrl, bundlePath, contentType = "application/javascript") {
11226
11383
  const file = join28(dirname15(fileURLToPath2(importMetaUrl)), bundlePath);
11227
- let cache6;
11384
+ let cache7;
11228
11385
  return (req, res) => {
11229
11386
  const mtimeMs = statSync6(file).mtimeMs;
11230
- if (cache6?.mtimeMs !== mtimeMs) {
11387
+ if (cache7?.mtimeMs !== mtimeMs) {
11231
11388
  const body = readFileSync10(file);
11232
11389
  const etag = `"${createHash2("sha256").update(body).digest("hex").slice(0, 16)}"`;
11233
- cache6 = { body, etag, mtimeMs };
11390
+ cache7 = { body, etag, mtimeMs };
11234
11391
  }
11235
11392
  const headers = {
11236
- ETag: cache6.etag,
11393
+ ETag: cache7.etag,
11237
11394
  "Cache-Control": "no-cache"
11238
11395
  };
11239
- if (req.headers["if-none-match"] === cache6.etag) {
11396
+ if (req.headers["if-none-match"] === cache7.etag) {
11240
11397
  res.writeHead(304, headers);
11241
11398
  res.end();
11242
11399
  return;
@@ -11245,7 +11402,7 @@ function createBundleHandler(importMetaUrl, bundlePath, contentType = "applicati
11245
11402
  "Content-Type": contentType,
11246
11403
  ...headers
11247
11404
  });
11248
- res.end(cache6.body);
11405
+ res.end(cache7.body);
11249
11406
  };
11250
11407
  }
11251
11408
 
@@ -11255,22 +11412,22 @@ import { readFileSync as readFileSync11 } from "fs";
11255
11412
  import { createRequire } from "module";
11256
11413
  var require2 = createRequire(import.meta.url);
11257
11414
  function createCssHandler(packageEntry) {
11258
- let cache6;
11415
+ let cache7;
11259
11416
  return (req, res) => {
11260
- if (!cache6) {
11417
+ if (!cache7) {
11261
11418
  const resolved = require2.resolve(packageEntry);
11262
11419
  const body = readFileSync11(resolved, "utf8");
11263
11420
  const etag = `"${createHash3("sha256").update(body).digest("hex").slice(0, 16)}"`;
11264
- cache6 = { body, etag };
11421
+ cache7 = { body, etag };
11265
11422
  }
11266
- const headers = { ETag: cache6.etag, "Cache-Control": "no-cache" };
11267
- if (req.headers["if-none-match"] === cache6.etag) {
11423
+ const headers = { ETag: cache7.etag, "Cache-Control": "no-cache" };
11424
+ if (req.headers["if-none-match"] === cache7.etag) {
11268
11425
  res.writeHead(304, headers);
11269
11426
  res.end();
11270
11427
  return;
11271
11428
  }
11272
11429
  res.writeHead(200, { "Content-Type": "text/css", ...headers });
11273
- res.end(cache6.body);
11430
+ res.end(cache7.body);
11274
11431
  };
11275
11432
  }
11276
11433
 
@@ -11361,6 +11518,7 @@ var routes2 = {
11361
11518
  "GET /api/usage/history": listUsageHistory,
11362
11519
  "GET /api/usage/items": listUsageItems,
11363
11520
  "GET /api/backups/list": getBackups,
11521
+ "GET /api/backups/status": getBackupStatus,
11364
11522
  "GET /api/config": getConfig,
11365
11523
  "POST /api/config/set": setConfig,
11366
11524
  "POST /api/config/unset": unsetConfig,
@@ -11636,13 +11794,13 @@ function scheduleReconnect() {
11636
11794
  }
11637
11795
 
11638
11796
  // src/commands/sessions/daemon/originForCwd.ts
11639
- var cache4 = /* @__PURE__ */ new Map();
11797
+ var cache5 = /* @__PURE__ */ new Map();
11640
11798
  function originResolutionForCwd(cwd) {
11641
11799
  if (!cwd) return void 0;
11642
- const cached = cache4.get(cwd);
11800
+ const cached = cache5.get(cwd);
11643
11801
  if (cached !== void 0) return { origin: cached, stable: true };
11644
11802
  const resolved = resolveCurrentOrigin(cwd);
11645
- if (resolved.stable) cache4.set(cwd, resolved.origin);
11803
+ if (resolved.stable) cache5.set(cwd, resolved.origin);
11646
11804
  return resolved;
11647
11805
  }
11648
11806
  function originForCwd(cwd) {
@@ -11772,12 +11930,12 @@ function forgetWorktree(path108) {
11772
11930
  }
11773
11931
 
11774
11932
  // src/commands/sessions/daemon/repoGroupForCwd.ts
11775
- var cache5 = /* @__PURE__ */ new Map();
11933
+ var cache6 = /* @__PURE__ */ new Map();
11776
11934
  function repoGroupForCwd(cwd) {
11777
11935
  if (!cwd) return void 0;
11778
- if (cache5.has(cwd)) return cache5.get(cwd);
11936
+ if (cache6.has(cwd)) return cache6.get(cwd);
11779
11937
  const { group, stable } = resolveRepoGroup(cwd);
11780
- if (stable) cache5.set(cwd, group);
11938
+ if (stable) cache6.set(cwd, group);
11781
11939
  return group;
11782
11940
  }
11783
11941
  function resolveRepoGroup(cwd) {
@@ -15638,21 +15796,21 @@ ${issues}`);
15638
15796
  }
15639
15797
 
15640
15798
  // src/commands/backlog/propose/proposedItemSchema.ts
15641
- import { z as z8 } from "zod";
15642
- var proposedPhaseSchema = z8.strictObject({
15643
- name: z8.string().trim().min(1, "phase name is required").refine(
15799
+ import { z as z9 } from "zod";
15800
+ var proposedPhaseSchema = z9.strictObject({
15801
+ name: z9.string().trim().min(1, "phase name is required").refine(
15644
15802
  (name) => name.toLowerCase() !== REVIEW_PHASE_NAME.toLowerCase(),
15645
15803
  `"${REVIEW_PHASE_NAME}" is owned by the runner and appended to every plan automatically \u2014 remove this phase`
15646
15804
  ),
15647
- tasks: z8.array(z8.string().trim().min(1)).min(1, "a phase needs at least one task"),
15648
- manualChecks: z8.array(z8.string().trim().min(1)).default([])
15805
+ tasks: z9.array(z9.string().trim().min(1)).min(1, "a phase needs at least one task"),
15806
+ manualChecks: z9.array(z9.string().trim().min(1)).default([])
15649
15807
  });
15650
- var proposedItemSchema = z8.strictObject({
15651
- name: z8.string().trim().min(1, "name is required"),
15652
- type: z8.enum(["story", "bug"]),
15653
- description: z8.string().optional(),
15654
- acceptanceCriteria: z8.array(z8.string().trim().min(1)).default([]),
15655
- phases: z8.array(proposedPhaseSchema).default([])
15808
+ var proposedItemSchema = z9.strictObject({
15809
+ name: z9.string().trim().min(1, "name is required"),
15810
+ type: z9.enum(["story", "bug"]),
15811
+ description: z9.string().optional(),
15812
+ acceptanceCriteria: z9.array(z9.string().trim().min(1)).default([]),
15813
+ phases: z9.array(proposedPhaseSchema).default([])
15656
15814
  });
15657
15815
 
15658
15816
  // src/commands/backlog/propose/readProposedItem.ts
@@ -17119,19 +17277,19 @@ async function persistPhaseSessionId(itemId2, phaseIdx, claudeSessionId) {
17119
17277
  import { mkdirSync as mkdirSync13, readFileSync as readFileSync26, rmSync as rmSync4, writeFileSync as writeFileSync22 } from "fs";
17120
17278
  import { homedir as homedir16 } from "os";
17121
17279
  import { dirname as dirname26, join as join47 } from "path";
17122
- import { z as z9 } from "zod";
17123
- var activitySchema = z9.object({
17124
- kind: z9.enum(["command", "backlog"]),
17125
- harness: z9.enum(["claude", "codex", "pi"]).optional(),
17126
- name: z9.string().optional(),
17127
- itemId: z9.number().optional(),
17128
- itemName: z9.string().optional(),
17129
- phase: z9.number().optional(),
17130
- phaseName: z9.string().optional(),
17131
- totalPhases: z9.number().optional(),
17132
- claudeSessionId: z9.string().optional(),
17133
- watchState: z9.enum(["waiting", "updating"]).optional(),
17134
- startedAt: z9.number()
17280
+ import { z as z10 } from "zod";
17281
+ var activitySchema = z10.object({
17282
+ kind: z10.enum(["command", "backlog"]),
17283
+ harness: z10.enum(["claude", "codex", "pi"]).optional(),
17284
+ name: z10.string().optional(),
17285
+ itemId: z10.number().optional(),
17286
+ itemName: z10.string().optional(),
17287
+ phase: z10.number().optional(),
17288
+ phaseName: z10.string().optional(),
17289
+ totalPhases: z10.number().optional(),
17290
+ claudeSessionId: z10.string().optional(),
17291
+ watchState: z10.enum(["waiting", "updating"]).optional(),
17292
+ startedAt: z10.number()
17135
17293
  });
17136
17294
  function activityPath(sessionId) {
17137
17295
  return join47(homedir16(), ".assist", "activity", `activity-${sessionId}.json`);
@@ -18482,9 +18640,9 @@ function registerUpdateFieldCommand(cmd) {
18482
18640
  import chalk104 from "chalk";
18483
18641
 
18484
18642
  // src/commands/backlog/updatePlan/planUpdateSchema.ts
18485
- import { z as z10 } from "zod";
18486
- var planUpdateSchema = z10.strictObject({
18487
- phases: z10.array(proposedPhaseSchema).min(1, "a plan needs at least one phase")
18643
+ import { z as z11 } from "zod";
18644
+ var planUpdateSchema = z11.strictObject({
18645
+ phases: z11.array(proposedPhaseSchema).min(1, "a plan needs at least one phase")
18488
18646
  });
18489
18647
 
18490
18648
  // src/commands/backlog/updatePlan/readPlanUpdate.ts
@@ -22064,60 +22222,6 @@ function registerComplexity(program) {
22064
22222
  // src/commands/configList.ts
22065
22223
  import chalk126 from "chalk";
22066
22224
  import { stringify as stringifyYaml2 } from "yaml";
22067
-
22068
- // src/commands/backlog/replaceFeeds.ts
22069
- async function replaceFeeds(db, urls) {
22070
- const unique = [...new Set(urls)];
22071
- await db.transaction(async (tx) => {
22072
- await tx.delete(feeds);
22073
- if (unique.length > 0)
22074
- await tx.insert(feeds).values(unique.map((url) => ({ url })));
22075
- });
22076
- }
22077
-
22078
- // src/commands/config/dbBackedConfigKeys.ts
22079
- var newsFeeds = {
22080
- read: async (db) => {
22081
- const urls = await listFeeds(db);
22082
- return urls.length > 0 ? urls : void 0;
22083
- },
22084
- write: (db, value) => replaceFeeds(db, value),
22085
- unset: async (db) => {
22086
- const had = (await listFeeds(db)).length > 0;
22087
- await replaceFeeds(db, []);
22088
- return had;
22089
- }
22090
- };
22091
- var dbBackedConfigKeys = {
22092
- "news.feeds": newsFeeds
22093
- };
22094
- function isDbBackedConfigKey(key) {
22095
- return Object.hasOwn(dbBackedConfigKeys, key);
22096
- }
22097
- function dbBackedRepoError(key) {
22098
- return `"${key}" is stored in the database and shared by every repo; drop --repo`;
22099
- }
22100
-
22101
- // src/commands/config/withDbBackedConfigValues.ts
22102
- function covers(scope, key) {
22103
- return scope === void 0 || scope === key || key.startsWith(`${scope}.`) || scope.startsWith(`${key}.`);
22104
- }
22105
- function dbBackedKeysIn(scope) {
22106
- if (!process.env.ASSIST_DATABASE_URL && !loadConfig().database.url) return [];
22107
- return Object.keys(dbBackedConfigKeys).filter((key) => covers(scope, key));
22108
- }
22109
- async function withDbBackedConfigValues(config, keys) {
22110
- if (keys.length === 0) return config;
22111
- const db = await getDb();
22112
- let merged = config;
22113
- for (const key of keys) {
22114
- const value = await dbBackedConfigKeys[key].read(db);
22115
- if (value !== void 0) merged = setNestedValue(merged, key, value);
22116
- }
22117
- return merged;
22118
- }
22119
-
22120
- // src/commands/configList.ts
22121
22225
  async function configList() {
22122
22226
  const config = maskConfigSecrets(
22123
22227
  await withDbBackedConfigValues(loadConfig(), dbBackedKeysIn()),
@@ -27361,39 +27465,39 @@ function stringOrUndefined(value) {
27361
27465
  }
27362
27466
 
27363
27467
  // src/commands/sessions/daemon/persistedSessionSchema.ts
27364
- import { z as z11 } from "zod";
27365
- var persistedSessionSchema = z11.object({
27366
- id: z11.string().optional(),
27367
- name: z11.string(),
27368
- title: z11.string().optional(),
27369
- generatedTitle: z11.string().optional(),
27370
- subtitle: z11.string().optional(),
27371
- commandType: z11.enum(["claude", "run", "assist"]),
27372
- harness: z11.enum(["claude", "codex", "pi"]).optional(),
27373
- status: z11.enum(["running", "waiting", "done", "error", "stopped"]).optional(),
27374
- cwd: z11.string(),
27375
- startedAt: z11.number(),
27376
- runningMs: z11.number().optional(),
27377
- claudeSessionId: z11.string().optional(),
27378
- harnessSessionId: z11.string().optional(),
27379
- initialPrompt: z11.string().optional(),
27380
- runName: z11.string().optional(),
27381
- runArgs: z11.array(z11.string()).optional(),
27382
- assistArgs: z11.array(z11.string()).optional(),
27468
+ import { z as z12 } from "zod";
27469
+ var persistedSessionSchema = z12.object({
27470
+ id: z12.string().optional(),
27471
+ name: z12.string(),
27472
+ title: z12.string().optional(),
27473
+ generatedTitle: z12.string().optional(),
27474
+ subtitle: z12.string().optional(),
27475
+ commandType: z12.enum(["claude", "run", "assist"]),
27476
+ harness: z12.enum(["claude", "codex", "pi"]).optional(),
27477
+ status: z12.enum(["running", "waiting", "done", "error", "stopped"]).optional(),
27478
+ cwd: z12.string(),
27479
+ startedAt: z12.number(),
27480
+ runningMs: z12.number().optional(),
27481
+ claudeSessionId: z12.string().optional(),
27482
+ harnessSessionId: z12.string().optional(),
27483
+ initialPrompt: z12.string().optional(),
27484
+ runName: z12.string().optional(),
27485
+ runArgs: z12.array(z12.string()).optional(),
27486
+ assistArgs: z12.array(z12.string()).optional(),
27383
27487
  activity: activitySchema.optional(),
27384
- starred: z11.boolean().optional(),
27385
- watcher: z11.boolean().optional(),
27386
- divergenceEscalation: z11.boolean().optional(),
27387
- design: z11.boolean().optional(),
27388
- auto: z11.boolean().optional(),
27389
- autoAdvance: z11.boolean().optional(),
27390
- autoApprove: z11.boolean().optional(),
27391
- reviewStarted: z11.boolean().optional(),
27392
- launchedFrom: z11.string().optional(),
27393
- pendingPrompts: z11.array(z11.string()).optional(),
27394
- interrupted: z11.object({ reason: z11.string(), at: z11.number() }).optional(),
27395
- awaitingSeed: z11.boolean().optional(),
27396
- undurable: z11.object({ reason: z11.string(), removesTree: z11.boolean().optional() }).optional()
27488
+ starred: z12.boolean().optional(),
27489
+ watcher: z12.boolean().optional(),
27490
+ divergenceEscalation: z12.boolean().optional(),
27491
+ design: z12.boolean().optional(),
27492
+ auto: z12.boolean().optional(),
27493
+ autoAdvance: z12.boolean().optional(),
27494
+ autoApprove: z12.boolean().optional(),
27495
+ reviewStarted: z12.boolean().optional(),
27496
+ launchedFrom: z12.string().optional(),
27497
+ pendingPrompts: z12.array(z12.string()).optional(),
27498
+ interrupted: z12.object({ reason: z12.string(), at: z12.number() }).optional(),
27499
+ awaitingSeed: z12.boolean().optional(),
27500
+ undurable: z12.object({ reason: z12.string(), removesTree: z12.boolean().optional() }).optional()
27397
27501
  });
27398
27502
 
27399
27503
  // src/commands/sessions/daemon/toPersistedSession.ts
@@ -29774,20 +29878,20 @@ function resolveThread(threadId) {
29774
29878
  );
29775
29879
  }
29776
29880
  function requireCache(org, repo, prNumber) {
29777
- const cache6 = loadCommentsCache(org, repo, prNumber);
29778
- if (!cache6) {
29881
+ const cache7 = loadCommentsCache(org, repo, prNumber);
29882
+ if (!cache7) {
29779
29883
  console.error(
29780
29884
  `Error: No cached comments found for PR #${prNumber}. Run "assist prs list-comments" first.`
29781
29885
  );
29782
29886
  process.exit(1);
29783
29887
  }
29784
- return cache6;
29888
+ return cache7;
29785
29889
  }
29786
29890
  function findLineComment(comments3, commentId) {
29787
29891
  return comments3.find((c) => c.type === "line" && c.id === commentId);
29788
29892
  }
29789
- function requireLineComment(cache6, commentId) {
29790
- const comment3 = findLineComment(cache6.comments, commentId);
29893
+ function requireLineComment(cache7, commentId) {
29894
+ const comment3 = findLineComment(cache7.comments, commentId);
29791
29895
  if (!comment3 || comment3.type !== "line" || !comment3.threadId) {
29792
29896
  console.error(
29793
29897
  `Error: Comment #${commentId} not found or has no thread ID.`
@@ -29796,8 +29900,8 @@ function requireLineComment(cache6, commentId) {
29796
29900
  }
29797
29901
  return comment3;
29798
29902
  }
29799
- function cleanupCacheIfDone(cache6, org, repo, prNumber, commentId) {
29800
- const hasRemaining = cache6.comments.some(
29903
+ function cleanupCacheIfDone(cache7, org, repo, prNumber, commentId) {
29904
+ const hasRemaining = cache7.comments.some(
29801
29905
  (c) => c.type === "line" && c.id !== commentId
29802
29906
  );
29803
29907
  if (!hasRemaining) deleteCommentsCache(org, repo, prNumber);
@@ -29805,13 +29909,13 @@ function cleanupCacheIfDone(cache6, org, repo, prNumber, commentId) {
29805
29909
  function resolveCommentWithReply(commentId, message3) {
29806
29910
  const prNumber = getCurrentPrNumber();
29807
29911
  const { org, repo } = getRepoInfo();
29808
- const cache6 = requireCache(org, repo, prNumber);
29809
- const comment3 = requireLineComment(cache6, commentId);
29912
+ const cache7 = requireCache(org, repo, prNumber);
29913
+ const comment3 = requireLineComment(cache7, commentId);
29810
29914
  replyToComment(org, repo, prNumber, commentId, message3);
29811
29915
  console.log("Reply posted successfully.");
29812
29916
  resolveThread(comment3.threadId);
29813
29917
  console.log("Thread resolved successfully.");
29814
- cleanupCacheIfDone(cache6, org, repo, prNumber, commentId);
29918
+ cleanupCacheIfDone(cache7, org, repo, prNumber, commentId);
29815
29919
  }
29816
29920
 
29817
29921
  // src/commands/prs/fixed.ts
@@ -41393,16 +41497,16 @@ function selectPassages(sources, selection) {
41393
41497
  }
41394
41498
 
41395
41499
  // src/commands/transcript/selectionSchema.ts
41396
- import { z as z12 } from "zod";
41397
- var selectionSchema = z12.strictObject({
41398
- keep: z12.array(
41399
- z12.strictObject({
41400
- file: z12.string().trim().min(1, "file is required"),
41401
- from: z12.string().trim().min(1, "from is required"),
41402
- to: z12.string().trim().min(1, "to is required")
41500
+ import { z as z13 } from "zod";
41501
+ var selectionSchema = z13.strictObject({
41502
+ keep: z13.array(
41503
+ z13.strictObject({
41504
+ file: z13.string().trim().min(1, "file is required"),
41505
+ from: z13.string().trim().min(1, "from is required"),
41506
+ to: z13.string().trim().min(1, "to is required")
41403
41507
  })
41404
41508
  ).min(1, "a selection needs at least one keep range"),
41405
- removed: z12.array(z12.string().trim().min(1)).default([])
41509
+ removed: z13.array(z13.string().trim().min(1)).default([])
41406
41510
  });
41407
41511
 
41408
41512
  // src/commands/transcript/widenAudienceInText.ts
@@ -41932,9 +42036,9 @@ function forbiddenStrings() {
41932
42036
  console.log("No forbidden-strings rules configured.");
41933
42037
  process.exit(0);
41934
42038
  }
41935
- const cache6 = /* @__PURE__ */ new Map();
42039
+ const cache7 = /* @__PURE__ */ new Map();
41936
42040
  const readJson = (file) => {
41937
- if (cache6.has(file)) return cache6.get(file);
42041
+ if (cache7.has(file)) return cache7.get(file);
41938
42042
  if (!existsSync81(file)) {
41939
42043
  console.log(`Forbidden-strings file not found: ${file}`);
41940
42044
  process.exit(1);
@@ -41946,7 +42050,7 @@ function forbiddenStrings() {
41946
42050
  console.log(`Could not parse ${file}: ${error.message}`);
41947
42051
  process.exit(1);
41948
42052
  }
41949
- cache6.set(file, parsed);
42053
+ cache7.set(file, parsed);
41950
42054
  return parsed;
41951
42055
  };
41952
42056
  const violations = findForbiddenStrings(rules2, readJson);
@@ -42351,22 +42455,6 @@ function emitWatchState(watchState) {
42351
42455
  emitActivity({ kind: "command", name: "watch", watchState });
42352
42456
  }
42353
42457
 
42354
- // src/commands/watch/parseDuration.ts
42355
- var UNIT_MS = { s: 1e3, m: 6e4, h: 36e5 };
42356
- function parseDuration(value) {
42357
- const match = /^(\d+)(s|m|h)$/.exec(value.trim());
42358
- if (!match) {
42359
- throw new Error(
42360
- `Invalid duration "${value}". Use a whole number followed by s, m, or h (e.g. 30s, 60m, 2h).`
42361
- );
42362
- }
42363
- const amount = Number(match[1]);
42364
- if (amount === 0) {
42365
- throw new Error(`Invalid duration "${value}". Value must be at least 1.`);
42366
- }
42367
- return amount * UNIT_MS[match[2]];
42368
- }
42369
-
42370
42458
  // src/commands/watch/parseWatchDurations.ts
42371
42459
  function parseOrExit(value) {
42372
42460
  try {
@@ -44065,9 +44153,9 @@ async function refreshRepoConfigCacheOnStart() {
44065
44153
  }
44066
44154
 
44067
44155
  // src/commands/sessions/daemon/loadActiveSelection.ts
44068
- import { z as z13 } from "zod";
44156
+ import { z as z14 } from "zod";
44069
44157
  var ACTIVE_FILE = "active.json";
44070
- var activeSelectionSchema = z13.record(z13.string(), z13.string());
44158
+ var activeSelectionSchema = z14.record(z14.string(), z14.string());
44071
44159
  function loadActiveSelection() {
44072
44160
  const parsed = activeSelectionSchema.safeParse(
44073
44161
  loadJson(ACTIVE_FILE)
@@ -46491,9 +46579,9 @@ function buildPrompt5(prompt) {
46491
46579
  }
46492
46580
 
46493
46581
  // src/commands/sessions/shared/loadSessionTitles.ts
46494
- import { z as z14 } from "zod";
46582
+ import { z as z15 } from "zod";
46495
46583
  var TITLES_FILE = "session-titles.json";
46496
- var sessionTitlesSchema = z14.record(z14.string(), z14.string());
46584
+ var sessionTitlesSchema = z15.record(z15.string(), z15.string());
46497
46585
  function loadSessionTitles() {
46498
46586
  const parsed = sessionTitlesSchema.safeParse(
46499
46587
  loadJson(TITLES_FILE)