@brainervirus/workit-claude-code 8.26.1 → 8.28.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/workit.js CHANGED
@@ -9240,7 +9240,7 @@ var package_default;
9240
9240
  var init_package = __esm(() => {
9241
9241
  package_default = {
9242
9242
  name: "@brainervirus/workit-cli",
9243
- version: "8.26.1",
9243
+ version: "8.28.0",
9244
9244
  private: false,
9245
9245
  description: "Workit CLI — setup wizard, doctor, and task control for agentic coding workflows",
9246
9246
  keywords: [
@@ -9278,13 +9278,13 @@ var init_package = __esm(() => {
9278
9278
  },
9279
9279
  dependencies: {
9280
9280
  "@babel/parser": "7.29.9",
9281
- "@brainervirus/workit-cursor": "^8.26.1",
9281
+ "@brainervirus/workit-cursor": "^8.28.0",
9282
9282
  "@inkjs/ui": "2.0.0",
9283
9283
  ink: "7.1.1",
9284
9284
  react: "19.2.8"
9285
9285
  },
9286
9286
  devDependencies: {
9287
- "@brainervirus/workit-core": "^8.26.1"
9287
+ "@brainervirus/workit-core": "^8.28.0"
9288
9288
  },
9289
9289
  engines: {
9290
9290
  node: ">=24"
@@ -58217,7 +58217,7 @@ var init_cli_boxes = __esm(() => {
58217
58217
  cli_boxes_default = boxes_default;
58218
58218
  });
58219
58219
 
58220
- // node_modules/chalk/source/vendor/ansi-styles/index.js
58220
+ // node_modules/ink/node_modules/chalk/source/vendor/ansi-styles/index.js
58221
58221
  function assembleStyles2() {
58222
58222
  const codes = new Map;
58223
58223
  for (const [groupName, group] of Object.entries(styles3)) {
@@ -58393,7 +58393,7 @@ var init_ansi_styles2 = __esm(() => {
58393
58393
  ansi_styles_default2 = ansiStyles2;
58394
58394
  });
58395
58395
 
58396
- // node_modules/chalk/source/vendor/supports-color/index.js
58396
+ // node_modules/ink/node_modules/chalk/source/vendor/supports-color/index.js
58397
58397
  import process5 from "node:process";
58398
58398
  import os7 from "node:os";
58399
58399
  import tty2 from "node:tty";
@@ -58527,7 +58527,7 @@ var init_supports_color = __esm(() => {
58527
58527
  supports_color_default = supportsColor;
58528
58528
  });
58529
58529
 
58530
- // node_modules/chalk/source/utilities.js
58530
+ // node_modules/ink/node_modules/chalk/source/utilities.js
58531
58531
  function stringReplaceAll(string, substring, replacer) {
58532
58532
  let index = string.indexOf(substring);
58533
58533
  if (index === -1) {
@@ -58560,7 +58560,7 @@ function stringEncaseCRLFWithFirstIndex(string, prefix, postfix, index) {
58560
58560
  return returnValue;
58561
58561
  }
58562
58562
 
58563
- // node_modules/chalk/source/index.js
58563
+ // node_modules/ink/node_modules/chalk/source/index.js
58564
58564
  function createChalk(options) {
58565
58565
  return chalkFactory(options);
58566
58566
  }
@@ -63983,13 +63983,502 @@ var init_use_text_input_state = __esm(() => {
63983
63983
  import_react50 = __toESM(require_react(), 1);
63984
63984
  });
63985
63985
 
63986
+ // node_modules/@inkjs/ui/node_modules/chalk/source/vendor/ansi-styles/index.js
63987
+ function assembleStyles3() {
63988
+ const codes = new Map;
63989
+ for (const [groupName, group] of Object.entries(styles5)) {
63990
+ for (const [styleName, style] of Object.entries(group)) {
63991
+ styles5[styleName] = {
63992
+ open: `\x1B[${style[0]}m`,
63993
+ close: `\x1B[${style[1]}m`
63994
+ };
63995
+ group[styleName] = styles5[styleName];
63996
+ codes.set(style[0], style[1]);
63997
+ }
63998
+ Object.defineProperty(styles5, groupName, {
63999
+ value: group,
64000
+ enumerable: false
64001
+ });
64002
+ }
64003
+ Object.defineProperty(styles5, "codes", {
64004
+ value: codes,
64005
+ enumerable: false
64006
+ });
64007
+ styles5.color.close = "\x1B[39m";
64008
+ styles5.bgColor.close = "\x1B[49m";
64009
+ styles5.color.ansi = wrapAnsi163();
64010
+ styles5.color.ansi256 = wrapAnsi2563();
64011
+ styles5.color.ansi16m = wrapAnsi16m3();
64012
+ styles5.bgColor.ansi = wrapAnsi163(ANSI_BACKGROUND_OFFSET3);
64013
+ styles5.bgColor.ansi256 = wrapAnsi2563(ANSI_BACKGROUND_OFFSET3);
64014
+ styles5.bgColor.ansi16m = wrapAnsi16m3(ANSI_BACKGROUND_OFFSET3);
64015
+ Object.defineProperties(styles5, {
64016
+ rgbToAnsi256: {
64017
+ value(red, green, blue) {
64018
+ if (red === green && green === blue) {
64019
+ if (red < 8) {
64020
+ return 16;
64021
+ }
64022
+ if (red > 248) {
64023
+ return 231;
64024
+ }
64025
+ return Math.round((red - 8) / 247 * 24) + 232;
64026
+ }
64027
+ return 16 + 36 * Math.round(red / 255 * 5) + 6 * Math.round(green / 255 * 5) + Math.round(blue / 255 * 5);
64028
+ },
64029
+ enumerable: false
64030
+ },
64031
+ hexToRgb: {
64032
+ value(hex) {
64033
+ const matches = /[a-f\d]{6}|[a-f\d]{3}/i.exec(hex.toString(16));
64034
+ if (!matches) {
64035
+ return [0, 0, 0];
64036
+ }
64037
+ let [colorString] = matches;
64038
+ if (colorString.length === 3) {
64039
+ colorString = [...colorString].map((character) => character + character).join("");
64040
+ }
64041
+ const integer = Number.parseInt(colorString, 16);
64042
+ return [
64043
+ integer >> 16 & 255,
64044
+ integer >> 8 & 255,
64045
+ integer & 255
64046
+ ];
64047
+ },
64048
+ enumerable: false
64049
+ },
64050
+ hexToAnsi256: {
64051
+ value: (hex) => styles5.rgbToAnsi256(...styles5.hexToRgb(hex)),
64052
+ enumerable: false
64053
+ },
64054
+ ansi256ToAnsi: {
64055
+ value(code) {
64056
+ if (code < 8) {
64057
+ return 30 + code;
64058
+ }
64059
+ if (code < 16) {
64060
+ return 90 + (code - 8);
64061
+ }
64062
+ let red;
64063
+ let green;
64064
+ let blue;
64065
+ if (code >= 232) {
64066
+ red = ((code - 232) * 10 + 8) / 255;
64067
+ green = red;
64068
+ blue = red;
64069
+ } else {
64070
+ code -= 16;
64071
+ const remainder = code % 36;
64072
+ red = Math.floor(code / 36) / 5;
64073
+ green = Math.floor(remainder / 6) / 5;
64074
+ blue = remainder % 6 / 5;
64075
+ }
64076
+ const value = Math.max(red, green, blue) * 2;
64077
+ if (value === 0) {
64078
+ return 30;
64079
+ }
64080
+ let result = 30 + (Math.round(blue) << 2 | Math.round(green) << 1 | Math.round(red));
64081
+ if (value === 2) {
64082
+ result += 60;
64083
+ }
64084
+ return result;
64085
+ },
64086
+ enumerable: false
64087
+ },
64088
+ rgbToAnsi: {
64089
+ value: (red, green, blue) => styles5.ansi256ToAnsi(styles5.rgbToAnsi256(red, green, blue)),
64090
+ enumerable: false
64091
+ },
64092
+ hexToAnsi: {
64093
+ value: (hex) => styles5.ansi256ToAnsi(styles5.hexToAnsi256(hex)),
64094
+ enumerable: false
64095
+ }
64096
+ });
64097
+ return styles5;
64098
+ }
64099
+ var ANSI_BACKGROUND_OFFSET3 = 10, wrapAnsi163 = (offset = 0) => (code) => `\x1B[${code + offset}m`, wrapAnsi2563 = (offset = 0) => (code) => `\x1B[${38 + offset};5;${code}m`, wrapAnsi16m3 = (offset = 0) => (red, green, blue) => `\x1B[${38 + offset};2;${red};${green};${blue}m`, styles5, modifierNames3, foregroundColorNames3, backgroundColorNames3, colorNames3, ansiStyles3, ansi_styles_default3;
64100
+ var init_ansi_styles3 = __esm(() => {
64101
+ styles5 = {
64102
+ modifier: {
64103
+ reset: [0, 0],
64104
+ bold: [1, 22],
64105
+ dim: [2, 22],
64106
+ italic: [3, 23],
64107
+ underline: [4, 24],
64108
+ overline: [53, 55],
64109
+ inverse: [7, 27],
64110
+ hidden: [8, 28],
64111
+ strikethrough: [9, 29]
64112
+ },
64113
+ color: {
64114
+ black: [30, 39],
64115
+ red: [31, 39],
64116
+ green: [32, 39],
64117
+ yellow: [33, 39],
64118
+ blue: [34, 39],
64119
+ magenta: [35, 39],
64120
+ cyan: [36, 39],
64121
+ white: [37, 39],
64122
+ blackBright: [90, 39],
64123
+ gray: [90, 39],
64124
+ grey: [90, 39],
64125
+ redBright: [91, 39],
64126
+ greenBright: [92, 39],
64127
+ yellowBright: [93, 39],
64128
+ blueBright: [94, 39],
64129
+ magentaBright: [95, 39],
64130
+ cyanBright: [96, 39],
64131
+ whiteBright: [97, 39]
64132
+ },
64133
+ bgColor: {
64134
+ bgBlack: [40, 49],
64135
+ bgRed: [41, 49],
64136
+ bgGreen: [42, 49],
64137
+ bgYellow: [43, 49],
64138
+ bgBlue: [44, 49],
64139
+ bgMagenta: [45, 49],
64140
+ bgCyan: [46, 49],
64141
+ bgWhite: [47, 49],
64142
+ bgBlackBright: [100, 49],
64143
+ bgGray: [100, 49],
64144
+ bgGrey: [100, 49],
64145
+ bgRedBright: [101, 49],
64146
+ bgGreenBright: [102, 49],
64147
+ bgYellowBright: [103, 49],
64148
+ bgBlueBright: [104, 49],
64149
+ bgMagentaBright: [105, 49],
64150
+ bgCyanBright: [106, 49],
64151
+ bgWhiteBright: [107, 49]
64152
+ }
64153
+ };
64154
+ modifierNames3 = Object.keys(styles5.modifier);
64155
+ foregroundColorNames3 = Object.keys(styles5.color);
64156
+ backgroundColorNames3 = Object.keys(styles5.bgColor);
64157
+ colorNames3 = [...foregroundColorNames3, ...backgroundColorNames3];
64158
+ ansiStyles3 = assembleStyles3();
64159
+ ansi_styles_default3 = ansiStyles3;
64160
+ });
64161
+
64162
+ // node_modules/@inkjs/ui/node_modules/chalk/source/vendor/supports-color/index.js
64163
+ import process15 from "node:process";
64164
+ import os8 from "node:os";
64165
+ import tty3 from "node:tty";
64166
+ function hasFlag2(flag, argv = globalThis.Deno ? globalThis.Deno.args : process15.argv) {
64167
+ const prefix = flag.startsWith("-") ? "" : flag.length === 1 ? "-" : "--";
64168
+ const position = argv.indexOf(prefix + flag);
64169
+ const terminatorPosition = argv.indexOf("--");
64170
+ return position !== -1 && (terminatorPosition === -1 || position < terminatorPosition);
64171
+ }
64172
+ function envForceColor2() {
64173
+ if ("FORCE_COLOR" in env3) {
64174
+ if (env3.FORCE_COLOR === "true") {
64175
+ return 1;
64176
+ }
64177
+ if (env3.FORCE_COLOR === "false") {
64178
+ return 0;
64179
+ }
64180
+ return env3.FORCE_COLOR.length === 0 ? 1 : Math.min(Number.parseInt(env3.FORCE_COLOR, 10), 3);
64181
+ }
64182
+ }
64183
+ function translateLevel2(level) {
64184
+ if (level === 0) {
64185
+ return false;
64186
+ }
64187
+ return {
64188
+ level,
64189
+ hasBasic: true,
64190
+ has256: level >= 2,
64191
+ has16m: level >= 3
64192
+ };
64193
+ }
64194
+ function _supportsColor2(haveStream, { streamIsTTY, sniffFlags = true } = {}) {
64195
+ const noFlagForceColor = envForceColor2();
64196
+ if (noFlagForceColor !== undefined) {
64197
+ flagForceColor2 = noFlagForceColor;
64198
+ }
64199
+ const forceColor = sniffFlags ? flagForceColor2 : noFlagForceColor;
64200
+ if (forceColor === 0) {
64201
+ return 0;
64202
+ }
64203
+ if (sniffFlags) {
64204
+ if (hasFlag2("color=16m") || hasFlag2("color=full") || hasFlag2("color=truecolor")) {
64205
+ return 3;
64206
+ }
64207
+ if (hasFlag2("color=256")) {
64208
+ return 2;
64209
+ }
64210
+ }
64211
+ if ("TF_BUILD" in env3 && "AGENT_NAME" in env3) {
64212
+ return 1;
64213
+ }
64214
+ if (haveStream && !streamIsTTY && forceColor === undefined) {
64215
+ return 0;
64216
+ }
64217
+ const min = forceColor || 0;
64218
+ if (env3.TERM === "dumb") {
64219
+ return min;
64220
+ }
64221
+ if (process15.platform === "win32") {
64222
+ const osRelease = os8.release().split(".");
64223
+ if (Number(osRelease[0]) >= 10 && Number(osRelease[2]) >= 10586) {
64224
+ return Number(osRelease[2]) >= 14931 ? 3 : 2;
64225
+ }
64226
+ return 1;
64227
+ }
64228
+ if ("CI" in env3) {
64229
+ if (["GITHUB_ACTIONS", "GITEA_ACTIONS", "CIRCLECI"].some((key) => (key in env3))) {
64230
+ return 3;
64231
+ }
64232
+ if (["TRAVIS", "APPVEYOR", "GITLAB_CI", "BUILDKITE", "DRONE"].some((sign) => (sign in env3)) || env3.CI_NAME === "codeship") {
64233
+ return 1;
64234
+ }
64235
+ return min;
64236
+ }
64237
+ if ("TEAMCITY_VERSION" in env3) {
64238
+ return /^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(env3.TEAMCITY_VERSION) ? 1 : 0;
64239
+ }
64240
+ if (env3.COLORTERM === "truecolor") {
64241
+ return 3;
64242
+ }
64243
+ if (env3.TERM === "xterm-kitty") {
64244
+ return 3;
64245
+ }
64246
+ if (env3.TERM === "xterm-ghostty") {
64247
+ return 3;
64248
+ }
64249
+ if (env3.TERM === "wezterm") {
64250
+ return 3;
64251
+ }
64252
+ if ("TERM_PROGRAM" in env3) {
64253
+ const version = Number.parseInt((env3.TERM_PROGRAM_VERSION || "").split(".")[0], 10);
64254
+ switch (env3.TERM_PROGRAM) {
64255
+ case "iTerm.app": {
64256
+ return version >= 3 ? 3 : 2;
64257
+ }
64258
+ case "Apple_Terminal": {
64259
+ return 2;
64260
+ }
64261
+ }
64262
+ }
64263
+ if (/-256(color)?$/i.test(env3.TERM)) {
64264
+ return 2;
64265
+ }
64266
+ if (/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(env3.TERM)) {
64267
+ return 1;
64268
+ }
64269
+ if ("COLORTERM" in env3) {
64270
+ return 1;
64271
+ }
64272
+ return min;
64273
+ }
64274
+ function createSupportsColor2(stream, options = {}) {
64275
+ const level = _supportsColor2(stream, {
64276
+ streamIsTTY: stream && stream.isTTY,
64277
+ ...options
64278
+ });
64279
+ return translateLevel2(level);
64280
+ }
64281
+ var env3, flagForceColor2, supportsColor2, supports_color_default2;
64282
+ var init_supports_color2 = __esm(() => {
64283
+ ({ env: env3 } = process15);
64284
+ if (hasFlag2("no-color") || hasFlag2("no-colors") || hasFlag2("color=false") || hasFlag2("color=never")) {
64285
+ flagForceColor2 = 0;
64286
+ } else if (hasFlag2("color") || hasFlag2("colors") || hasFlag2("color=true") || hasFlag2("color=always")) {
64287
+ flagForceColor2 = 1;
64288
+ }
64289
+ supportsColor2 = {
64290
+ stdout: createSupportsColor2({ isTTY: tty3.isatty(1) }),
64291
+ stderr: createSupportsColor2({ isTTY: tty3.isatty(2) })
64292
+ };
64293
+ supports_color_default2 = supportsColor2;
64294
+ });
64295
+
64296
+ // node_modules/@inkjs/ui/node_modules/chalk/source/utilities.js
64297
+ function stringReplaceAll2(string, substring, replacer) {
64298
+ let index = string.indexOf(substring);
64299
+ if (index === -1) {
64300
+ return string;
64301
+ }
64302
+ const substringLength = substring.length;
64303
+ let endIndex = 0;
64304
+ let returnValue = "";
64305
+ do {
64306
+ returnValue += string.slice(endIndex, index) + substring + replacer;
64307
+ endIndex = index + substringLength;
64308
+ index = string.indexOf(substring, endIndex);
64309
+ } while (index !== -1);
64310
+ returnValue += string.slice(endIndex);
64311
+ return returnValue;
64312
+ }
64313
+ function stringEncaseCRLFWithFirstIndex2(string, prefix, postfix, index) {
64314
+ let endIndex = 0;
64315
+ let returnValue = "";
64316
+ do {
64317
+ const gotCR = string[index - 1] === "\r";
64318
+ returnValue += string.slice(endIndex, gotCR ? index - 1 : index) + prefix + (gotCR ? `\r
64319
+ ` : `
64320
+ `) + postfix;
64321
+ endIndex = index + 1;
64322
+ index = string.indexOf(`
64323
+ `, endIndex);
64324
+ } while (index !== -1);
64325
+ returnValue += string.slice(endIndex);
64326
+ return returnValue;
64327
+ }
64328
+
64329
+ // node_modules/@inkjs/ui/node_modules/chalk/source/index.js
64330
+ function createChalk2(options) {
64331
+ return chalkFactory2(options);
64332
+ }
64333
+ var stdoutColor2, stderrColor2, GENERATOR2, STYLER2, IS_EMPTY2, levelMapping2, styles6, applyOptions2 = (object, options = {}) => {
64334
+ if (options.level && !(Number.isInteger(options.level) && options.level >= 0 && options.level <= 3)) {
64335
+ throw new Error("The `level` option should be an integer from 0 to 3");
64336
+ }
64337
+ const colorLevel = stdoutColor2 ? stdoutColor2.level : 0;
64338
+ object.level = options.level === undefined ? colorLevel : options.level;
64339
+ }, chalkFactory2 = (options) => {
64340
+ const chalk = (...strings) => strings.join(" ");
64341
+ applyOptions2(chalk, options);
64342
+ Object.setPrototypeOf(chalk, createChalk2.prototype);
64343
+ return chalk;
64344
+ }, getModelAnsi2 = (model, level, type, ...arguments_) => {
64345
+ if (model === "rgb") {
64346
+ if (level === "ansi16m") {
64347
+ return ansi_styles_default3[type].ansi16m(...arguments_);
64348
+ }
64349
+ if (level === "ansi256") {
64350
+ return ansi_styles_default3[type].ansi256(ansi_styles_default3.rgbToAnsi256(...arguments_));
64351
+ }
64352
+ return ansi_styles_default3[type].ansi(ansi_styles_default3.rgbToAnsi(...arguments_));
64353
+ }
64354
+ if (model === "hex") {
64355
+ return getModelAnsi2("rgb", level, type, ...ansi_styles_default3.hexToRgb(...arguments_));
64356
+ }
64357
+ return ansi_styles_default3[type][model](...arguments_);
64358
+ }, usedModels2, proto2, createStyler2 = (open, close, parent) => {
64359
+ let openAll;
64360
+ let closeAll;
64361
+ if (parent === undefined) {
64362
+ openAll = open;
64363
+ closeAll = close;
64364
+ } else {
64365
+ openAll = parent.openAll + open;
64366
+ closeAll = close + parent.closeAll;
64367
+ }
64368
+ return {
64369
+ open,
64370
+ close,
64371
+ openAll,
64372
+ closeAll,
64373
+ parent
64374
+ };
64375
+ }, createBuilder2 = (self2, _styler, _isEmpty) => {
64376
+ const builder = (...arguments_) => applyStyle2(builder, arguments_.length === 1 ? "" + arguments_[0] : arguments_.join(" "));
64377
+ Object.setPrototypeOf(builder, proto2);
64378
+ builder[GENERATOR2] = self2;
64379
+ builder[STYLER2] = _styler;
64380
+ builder[IS_EMPTY2] = _isEmpty;
64381
+ return builder;
64382
+ }, applyStyle2 = (self2, string) => {
64383
+ if (self2.level <= 0 || !string) {
64384
+ return self2[IS_EMPTY2] ? "" : string;
64385
+ }
64386
+ let styler = self2[STYLER2];
64387
+ if (styler === undefined) {
64388
+ return string;
64389
+ }
64390
+ const { openAll, closeAll } = styler;
64391
+ if (string.includes("\x1B")) {
64392
+ while (styler !== undefined) {
64393
+ string = stringReplaceAll2(string, styler.close, styler.open);
64394
+ styler = styler.parent;
64395
+ }
64396
+ }
64397
+ const lfIndex = string.indexOf(`
64398
+ `);
64399
+ if (lfIndex !== -1) {
64400
+ string = stringEncaseCRLFWithFirstIndex2(string, closeAll, openAll, lfIndex);
64401
+ }
64402
+ return openAll + string + closeAll;
64403
+ }, chalk2, chalkStderr2, source_default2;
64404
+ var init_source2 = __esm(() => {
64405
+ init_ansi_styles3();
64406
+ init_supports_color2();
64407
+ ({ stdout: stdoutColor2, stderr: stderrColor2 } = supports_color_default2);
64408
+ GENERATOR2 = Symbol("GENERATOR");
64409
+ STYLER2 = Symbol("STYLER");
64410
+ IS_EMPTY2 = Symbol("IS_EMPTY");
64411
+ levelMapping2 = [
64412
+ "ansi",
64413
+ "ansi",
64414
+ "ansi256",
64415
+ "ansi16m"
64416
+ ];
64417
+ styles6 = Object.create(null);
64418
+ Object.setPrototypeOf(createChalk2.prototype, Function.prototype);
64419
+ for (const [styleName, style] of Object.entries(ansi_styles_default3)) {
64420
+ styles6[styleName] = {
64421
+ get() {
64422
+ const builder = createBuilder2(this, createStyler2(style.open, style.close, this[STYLER2]), this[IS_EMPTY2]);
64423
+ Object.defineProperty(this, styleName, { value: builder });
64424
+ return builder;
64425
+ }
64426
+ };
64427
+ }
64428
+ styles6.visible = {
64429
+ get() {
64430
+ const builder = createBuilder2(this, this[STYLER2], true);
64431
+ Object.defineProperty(this, "visible", { value: builder });
64432
+ return builder;
64433
+ }
64434
+ };
64435
+ usedModels2 = ["rgb", "hex", "ansi256"];
64436
+ for (const model of usedModels2) {
64437
+ styles6[model] = {
64438
+ get() {
64439
+ const { level } = this;
64440
+ return function(...arguments_) {
64441
+ const styler = createStyler2(getModelAnsi2(model, levelMapping2[level], "color", ...arguments_), ansi_styles_default3.color.close, this[STYLER2]);
64442
+ return createBuilder2(this, styler, this[IS_EMPTY2]);
64443
+ };
64444
+ }
64445
+ };
64446
+ const bgModel = "bg" + model[0].toUpperCase() + model.slice(1);
64447
+ styles6[bgModel] = {
64448
+ get() {
64449
+ const { level } = this;
64450
+ return function(...arguments_) {
64451
+ const styler = createStyler2(getModelAnsi2(model, levelMapping2[level], "bgColor", ...arguments_), ansi_styles_default3.bgColor.close, this[STYLER2]);
64452
+ return createBuilder2(this, styler, this[IS_EMPTY2]);
64453
+ };
64454
+ }
64455
+ };
64456
+ }
64457
+ proto2 = Object.defineProperties(() => {}, {
64458
+ ...styles6,
64459
+ level: {
64460
+ enumerable: true,
64461
+ get() {
64462
+ return this[GENERATOR2].level;
64463
+ },
64464
+ set(level) {
64465
+ this[GENERATOR2].level = level;
64466
+ }
64467
+ }
64468
+ });
64469
+ Object.defineProperties(createChalk2.prototype, styles6);
64470
+ chalk2 = createChalk2();
64471
+ chalkStderr2 = createChalk2({ level: stderrColor2 ? stderrColor2.level : 0 });
64472
+ source_default2 = chalk2;
64473
+ });
64474
+
63986
64475
  // node_modules/@inkjs/ui/build/components/text-input/use-text-input.js
63987
64476
  var import_react51, cursor, useTextInput = ({ isDisabled = false, state, placeholder = "" }) => {
63988
64477
  const renderedPlaceholder = import_react51.useMemo(() => {
63989
64478
  if (isDisabled) {
63990
- return placeholder ? source_default.dim(placeholder) : "";
64479
+ return placeholder ? source_default2.dim(placeholder) : "";
63991
64480
  }
63992
- return placeholder && placeholder.length > 0 ? source_default.inverse(placeholder[0]) + source_default.dim(placeholder.slice(1)) : cursor;
64481
+ return placeholder && placeholder.length > 0 ? source_default2.inverse(placeholder[0]) + source_default2.dim(placeholder.slice(1)) : cursor;
63993
64482
  }, [isDisabled, placeholder]);
63994
64483
  const renderedValue = import_react51.useMemo(() => {
63995
64484
  if (isDisabled) {
@@ -63998,14 +64487,14 @@ var import_react51, cursor, useTextInput = ({ isDisabled = false, state, placeho
63998
64487
  let index = 0;
63999
64488
  let result = state.value.length > 0 ? "" : cursor;
64000
64489
  for (const char of state.value) {
64001
- result += index === state.cursorOffset ? source_default.inverse(char) : char;
64490
+ result += index === state.cursorOffset ? source_default2.inverse(char) : char;
64002
64491
  index++;
64003
64492
  }
64004
64493
  if (state.suggestion) {
64005
64494
  if (state.cursorOffset === state.value.length) {
64006
- result += source_default.inverse(state.suggestion[0]) + source_default.dim(state.suggestion.slice(1));
64495
+ result += source_default2.inverse(state.suggestion[0]) + source_default2.dim(state.suggestion.slice(1));
64007
64496
  } else {
64008
- result += source_default.dim(state.suggestion);
64497
+ result += source_default2.dim(state.suggestion);
64009
64498
  }
64010
64499
  return result;
64011
64500
  }
@@ -64037,10 +64526,10 @@ var import_react51, cursor, useTextInput = ({ isDisabled = false, state, placeho
64037
64526
  };
64038
64527
  };
64039
64528
  var init_use_text_input = __esm(async () => {
64040
- init_source();
64529
+ init_source2();
64041
64530
  await init_build2();
64042
64531
  import_react51 = __toESM(require_react(), 1);
64043
- cursor = source_default.inverse(" ");
64532
+ cursor = source_default2.inverse(" ");
64044
64533
  });
64045
64534
 
64046
64535
  // node_modules/@inkjs/ui/build/components/text-input/text-input.js
@@ -64156,10 +64645,10 @@ var init_use_password_input_state = __esm(() => {
64156
64645
  // node_modules/@inkjs/ui/build/components/password-input/use-password-input.js
64157
64646
  var import_react58, cursor2;
64158
64647
  var init_use_password_input = __esm(async () => {
64159
- init_source();
64648
+ init_source2();
64160
64649
  await init_build2();
64161
64650
  import_react58 = __toESM(require_react(), 1);
64162
- cursor2 = source_default.inverse(" ");
64651
+ cursor2 = source_default2.inverse(" ");
64163
64652
  });
64164
64653
 
64165
64654
  // node_modules/@inkjs/ui/build/components/password-input/password-input.js
@@ -64214,10 +64703,10 @@ var init_use_email_input_state = __esm(() => {
64214
64703
  // node_modules/@inkjs/ui/build/components/email-input/use-email-input.js
64215
64704
  var import_react63, cursor3;
64216
64705
  var init_use_email_input = __esm(async () => {
64217
- init_source();
64706
+ init_source2();
64218
64707
  await init_build2();
64219
64708
  import_react63 = __toESM(require_react(), 1);
64220
- cursor3 = source_default.inverse(" ");
64709
+ cursor3 = source_default2.inverse(" ");
64221
64710
  });
64222
64711
 
64223
64712
  // node_modules/@inkjs/ui/build/components/email-input/email-input.js
@@ -65062,6 +65551,21 @@ var MODEL_ROLES, MODEL_TIERS, HOST_KEYS, BUILT_IN_CLAUDE_CODE, isObject9 = (valu
65062
65551
  }
65063
65552
  }
65064
65553
  return issues;
65554
+ }, roleForAgentType = (agentType, prompt) => {
65555
+ switch (agentType) {
65556
+ case "workit:implementer": {
65557
+ const tier = typeof prompt === "string" ? /^[ \t]*TIER:[ \t]*(mundane|standard|hard)\b/im.exec(prompt)?.[1] : undefined;
65558
+ return { role: "implementer", tier: tier?.toLowerCase() ?? "standard" };
65559
+ }
65560
+ case "workit:verifier":
65561
+ return { role: "verifier" };
65562
+ case "workit:reviewer":
65563
+ return { role: "reviewer" };
65564
+ case "Explore":
65565
+ return { role: "explore" };
65566
+ default:
65567
+ return null;
65568
+ }
65065
65569
  };
65066
65570
  var init_role_models = __esm(() => {
65067
65571
  init_workspaces();
@@ -65108,7 +65612,7 @@ import {
65108
65612
  realpathSync as realpathSync6,
65109
65613
  statSync as statSync2
65110
65614
  } from "node:fs";
65111
- import os8 from "node:os";
65615
+ import os9 from "node:os";
65112
65616
  import path33 from "node:path";
65113
65617
  function hostCommand(name, args, options = {}) {
65114
65618
  const executable = findHostExecutable(name, options);
@@ -65138,7 +65642,7 @@ function resolveWindowsShimEntry(contents, shim, exists = existsSync12) {
65138
65642
  }
65139
65643
  function findHostExecutable(name, options = {}) {
65140
65644
  const env = options.env ?? process.env;
65141
- const home = options.home ?? env.HOME ?? os8.homedir();
65645
+ const home = options.home ?? env.HOME ?? os9.homedir();
65142
65646
  const suffixes = process.platform === "win32" ? ["", ".exe", ".cmd", ".bat"] : [""];
65143
65647
  const dirs = (env.PATH ?? "").split(path33.delimiter).filter(Boolean);
65144
65648
  dirs.push(path33.join(home, ".local", "bin"), path33.join(home, ".asdf", "shims"));
@@ -65188,7 +65692,7 @@ function installedHostApp(host, home, env = process.env, platform = process.plat
65188
65692
  }
65189
65693
  function planHostInstall(host, options = {}) {
65190
65694
  const env = options.env ?? process.env;
65191
- const home = options.home ?? env.HOME ?? os8.homedir();
65695
+ const home = options.home ?? env.HOME ?? os9.homedir();
65192
65696
  const cwd = options.cwd ?? process.cwd();
65193
65697
  const version = options.packageVersion ?? "latest";
65194
65698
  if (!validPackageVersion(version))
@@ -65372,7 +65876,7 @@ function runHostCommand(step, context = {}) {
65372
65876
  const result = spawnSync14(step.command, step.args, {
65373
65877
  cwd: step.cwd,
65374
65878
  env: (() => {
65375
- const home = context.home ?? context.env?.HOME ?? os8.homedir();
65879
+ const home = context.home ?? context.env?.HOME ?? os9.homedir();
65376
65880
  const env = { ...process.env, ...context.env, HOME: home };
65377
65881
  env.CODEX_HOME = context.env?.CODEX_HOME ?? path33.join(home, ".codex");
65378
65882
  env.PI_CODING_AGENT_DIR = context.env?.PI_CODING_AGENT_DIR ?? path33.join(home, ".pi", "agent");
@@ -65964,14 +66468,14 @@ ${manualTrailerLine()}
65964
66468
  });
65965
66469
 
65966
66470
  // packages/workit-core/src/core/heavy-words.ts
65967
- import os9 from "node:os";
66471
+ import os10 from "node:os";
65968
66472
  import path36 from "node:path";
65969
66473
  var HEAVY_WORDS, stateDir = (env) => {
65970
66474
  if (env.WORKFLOW_TOOLKIT_STATE)
65971
66475
  return env.WORKFLOW_TOOLKIT_STATE;
65972
66476
  if (env.XDG_STATE_HOME)
65973
66477
  return path36.join(env.XDG_STATE_HOME, "workit");
65974
- const home = env.HOME || os9.homedir();
66478
+ const home = env.HOME || os10.homedir();
65975
66479
  if (process.platform === "darwin")
65976
66480
  return path36.join(home, "Library", "Application Support", "workit");
65977
66481
  if (process.platform === "win32")
@@ -66017,7 +66521,7 @@ import {
66017
66521
  rmSync as rmSync3,
66018
66522
  statSync as statSync5
66019
66523
  } from "node:fs";
66020
- import os10 from "node:os";
66524
+ import os11 from "node:os";
66021
66525
  import path37 from "node:path";
66022
66526
  function mergeClaudeSettings(settings, shell, skip = {}) {
66023
66527
  const config = clone4(settings);
@@ -66376,7 +66880,7 @@ ${[...rules, grant].join(`
66376
66880
  };
66377
66881
  }, resolvePaths = (options) => {
66378
66882
  const env = options.env ?? process.env;
66379
- const home = options.home ?? env.HOME ?? os10.homedir();
66883
+ const home = options.home ?? env.HOME ?? os11.homedir();
66380
66884
  return { home, env, stateDir: options.stateDir ?? stateDir({ ...env, HOME: home }) };
66381
66885
  }, permissionTarget = (host, options = {}) => {
66382
66886
  const { home, env } = resolvePaths(options);
@@ -66524,7 +67028,7 @@ import {
66524
67028
  unlinkSync as unlinkSync3,
66525
67029
  writeFileSync as writeFileSync7
66526
67030
  } from "node:fs";
66527
- import os11 from "node:os";
67031
+ import os12 from "node:os";
66528
67032
  import path38 from "node:path";
66529
67033
  var TOKEN_PLACEHOLDER2 = "YOUR_TOKEN_HERE", findDevFromCwd = (cwd) => {
66530
67034
  let dir = path38.resolve(cwd);
@@ -66536,9 +67040,24 @@ var TOKEN_PLACEHOLDER2 = "YOUR_TOKEN_HERE", findDevFromCwd = (cwd) => {
66536
67040
  return null;
66537
67041
  dir = parent;
66538
67042
  }
67043
+ }, listClaudeProcesses = () => {
67044
+ const r = spawnSync16("ps", ["-eo", "pid=,lstart=,args="], { encoding: "utf8", timeout: 5000 });
67045
+ if (r.status !== 0 || typeof r.stdout !== "string")
67046
+ return null;
67047
+ const found = [];
67048
+ for (const row of r.stdout.split(`
67049
+ `)) {
67050
+ const m = /^\s*(\d+)\s+(\w{3}\s+\w{3}\s+\d+\s+[\d:]+\s+\d{4})\s+(.*)$/.exec(row);
67051
+ if (!m || !/^(\S*\/)?claude(\s|$)/.test(m[3]))
67052
+ continue;
67053
+ const startedMs = Date.parse(m[2]);
67054
+ if (Number.isFinite(startedMs))
67055
+ found.push({ pid: Number(m[1]), startedMs, args: m[3] });
67056
+ }
67057
+ return found;
66539
67058
  }, resolve = (options) => {
66540
67059
  const env = options.env ?? process.env;
66541
- const home = options.home ?? env.HOME ?? os11.homedir();
67060
+ const home = options.home ?? env.HOME ?? os12.homedir();
66542
67061
  const configDir = options.configDir ?? env.WORKFLOW_TOOLKIT_CONFIG ?? env.WORKFLOW_TOOLKIT_CONFIG_DIR ?? path38.join(home, ".config", "workit");
66543
67062
  const stateDir = options.stateDir ?? env.WORKFLOW_TOOLKIT_STATE ?? path38.join(home, ".local", "state", "workit");
66544
67063
  const cwd = options.cwd ?? process.cwd();
@@ -66563,7 +67082,8 @@ var TOKEN_PLACEHOLDER2 = "YOUR_TOKEN_HERE", findDevFromCwd = (cwd) => {
66563
67082
  env,
66564
67083
  installer: options.installer ?? false,
66565
67084
  cliVersion: options.cliVersion ?? null,
66566
- scopeProbe: options.scopeProbe ?? probeScope
67085
+ scopeProbe: options.scopeProbe ?? probeScope,
67086
+ claudeProcesses: options.claudeProcesses ?? listClaudeProcesses
66567
67087
  };
66568
67088
  }, readJson = (p) => {
66569
67089
  try {
@@ -66618,7 +67138,7 @@ var TOKEN_PLACEHOLDER2 = "YOUR_TOKEN_HERE", findDevFromCwd = (cwd) => {
66618
67138
  if (env.BUN && existsSync16(env.BUN))
66619
67139
  return env.BUN;
66620
67140
  for (const candidate of [
66621
- path38.join(env.HOME || os11.homedir(), ".bun/bin/bun"),
67141
+ path38.join(env.HOME || os12.homedir(), ".bun/bin/bun"),
66622
67142
  "/usr/local/bin/bun",
66623
67143
  "/usr/bin/bun"
66624
67144
  ]) {
@@ -66726,7 +67246,7 @@ var TOKEN_PLACEHOLDER2 = "YOUR_TOKEN_HERE", findDevFromCwd = (cwd) => {
66726
67246
  status: "pass",
66727
67247
  detail: "opencode CLI not on PATH — skipping version check"
66728
67248
  };
66729
- const scratch = mkdtempSync(path38.join(os11.tmpdir(), "workit-doctor-opencode-"));
67249
+ const scratch = mkdtempSync(path38.join(os12.tmpdir(), "workit-doctor-opencode-"));
66730
67250
  let raw;
66731
67251
  try {
66732
67252
  raw = versionOf("opencode", {
@@ -68403,6 +68923,68 @@ var TOKEN_PLACEHOLDER2 = "YOUR_TOKEN_HERE", findDevFromCwd = (cwd) => {
68403
68923
  fix: repair,
68404
68924
  registryProbed
68405
68925
  };
68926
+ }, checkClaudeSessionPlugin = (res) => {
68927
+ const id = "claude_session_plugin";
68928
+ if (process.platform === "win32")
68929
+ return {
68930
+ id,
68931
+ status: "info",
68932
+ detail: "running Claude Code sessions are not checked on Windows"
68933
+ };
68934
+ const installs = claudeWorkitInstalls(res.home, res.env, res.cwd).filter((install) => install.version);
68935
+ if (installs.length === 0)
68936
+ return {
68937
+ id,
68938
+ status: "info",
68939
+ detail: "no Workit Claude Code plugin install recorded — skipping"
68940
+ };
68941
+ const registry = readJson(path38.join(claudeConfigDir(res.home, res.env), "plugins", "installed_plugins.json"));
68942
+ const recorded = (install) => {
68943
+ const entries = registry?.plugins?.[install.id];
68944
+ const entry = Array.isArray(entries) ? entries.find((e) => e?.installPath === install.installPath) : null;
68945
+ for (const stamp of [entry?.lastUpdated, entry?.installedAt]) {
68946
+ const ms = typeof stamp === "string" ? Date.parse(stamp) : NaN;
68947
+ if (Number.isFinite(ms))
68948
+ return ms;
68949
+ }
68950
+ try {
68951
+ return statSync6(install.installPath).mtimeMs;
68952
+ } catch {
68953
+ return null;
68954
+ }
68955
+ };
68956
+ const latest = installs.map((install) => ({ install, at: recorded(install) })).filter((one) => one.at !== null).toSorted((a, b) => b.at - a.at)[0];
68957
+ if (!latest)
68958
+ return {
68959
+ id,
68960
+ status: "info",
68961
+ detail: "no install time recorded for the Workit plugin — skipping"
68962
+ };
68963
+ const running = res.claudeProcesses();
68964
+ if (running === null)
68965
+ return {
68966
+ id,
68967
+ status: "info",
68968
+ detail: "could not list running claude processes (ps) — skipping"
68969
+ };
68970
+ const stale = running.filter((proc) => proc.startedMs < latest.at);
68971
+ if (stale.length === 0)
68972
+ return {
68973
+ id,
68974
+ status: "info",
68975
+ detail: `${running.length} running claude process(es), none started before Workit ${latest.install.version} was installed`
68976
+ };
68977
+ const sessionOf = (args) => /(?:--resume|--session-id|-r)[ =]([0-9a-f]{8}-[0-9a-f-]{27})/i.exec(args)?.[1] ?? null;
68978
+ const rows = stale.map((proc) => {
68979
+ const session = sessionOf(proc.args);
68980
+ return `pid ${proc.pid} started ${new Date(proc.startedMs).toISOString()}${session ? ` (session ${session})` : ""}`;
68981
+ });
68982
+ const first = stale.map((proc) => sessionOf(proc.args)).find((one) => one);
68983
+ return {
68984
+ id,
68985
+ status: "warn",
68986
+ detail: `started before Workit ${latest.install.version} was installed: ${rows.join("; ")}; quit and start \`claude --resume ${first ?? "<session id>"}\` to load it (\`/resume\` keeps the old plugin)`
68987
+ };
68406
68988
  }, HOOK_ISSUED_MARKER = "workit-issued-sessions/3", hookRecordsIssued = (root) => {
68407
68989
  let files;
68408
68990
  try {
@@ -68604,6 +69186,7 @@ var init_doctor = __esm(() => {
68604
69186
  checkPiExtension,
68605
69187
  checkOpencodeVersion,
68606
69188
  checkClaudePlugin,
69189
+ checkClaudeSessionPlugin,
68607
69190
  checkHookIssuedSessions,
68608
69191
  checkWorkitOnPath,
68609
69192
  checkAssets,
@@ -68658,7 +69241,7 @@ import {
68658
69241
  writeFileSync as writeFileSync8
68659
69242
  } from "node:fs";
68660
69243
  import { createRequire as createRequire2 } from "node:module";
68661
- import os12 from "node:os";
69244
+ import os13 from "node:os";
68662
69245
  import path39 from "node:path";
68663
69246
  import { isDeepStrictEqual as isDeepStrictEqual2 } from "node:util";
68664
69247
  function parseList(raw) {
@@ -69483,7 +70066,7 @@ var TOKEN_PLACEHOLDER3 = "YOUR_TOKEN_HERE", YT_OVERRIDES, VCS_OVERRIDES, SETUP_O
69483
70066
  }
69484
70067
  }, claudeInstallRecord = (home, env) => path39.join(claudeConfigDir(home, env), "plugins", "installed_plugins.json"), resolveSetupPaths = (options, resolvedConfigDir) => {
69485
70068
  const env = options.env ?? process.env;
69486
- const home = options.home ?? env.HOME ?? os12.homedir();
70069
+ const home = options.home ?? env.HOME ?? os13.homedir();
69487
70070
  return {
69488
70071
  home,
69489
70072
  configDir: resolvedConfigDir,
@@ -70601,7 +71184,7 @@ var init_wizard_state = __esm(() => {
70601
71184
 
70602
71185
  // packages/workit-cli/src/admin/uninstall.ts
70603
71186
  import { existsSync as existsSync19, readFileSync as readFileSync19, realpathSync as realpathSync9, rmSync as rmSync7, writeFileSync as writeFileSync10 } from "node:fs";
70604
- import os13 from "node:os";
71187
+ import os14 from "node:os";
70605
71188
  import path42 from "node:path";
70606
71189
  function cleanCursorSettings(settings, pluginDir) {
70607
71190
  const next = { ...settings };
@@ -70749,7 +71332,7 @@ function planUninstall(paths = {}) {
70749
71332
  }
70750
71333
  ] : []
70751
71334
  };
70752
- const home = paths.home ?? paths.env?.HOME ?? os13.homedir();
71335
+ const home = paths.home ?? paths.env?.HOME ?? os14.homedir();
70753
71336
  const claudeInstalls = claudeWorkitInstalls(home, paths.env ?? process.env, paths.cwd ?? process.cwd());
70754
71337
  const claude = {
70755
71338
  host: "claude-code",
@@ -70846,7 +71429,7 @@ function applyUninstall(plan, paths = {}) {
70846
71429
  return { ok: entries.every((e) => e.status !== "failed"), entries };
70847
71430
  }
70848
71431
  var resolveUninstallPaths = (options = {}) => {
70849
- const home = options.home ?? options.env?.HOME ?? os13.homedir();
71432
+ const home = options.home ?? options.env?.HOME ?? os14.homedir();
70850
71433
  const permissionPaths = { home, env: options.env ?? process.env };
70851
71434
  return {
70852
71435
  claudeSettings: permissionTarget("claude-code", permissionPaths).file,
@@ -70880,7 +71463,7 @@ var resolveUninstallPaths = (options = {}) => {
70880
71463
  }, CURSOR_LEGACY_IDENTITIES, permissionPathsOf = (paths) => {
70881
71464
  const env = paths.env ?? process.env;
70882
71465
  return {
70883
- home: paths.home ?? env.HOME ?? os13.homedir(),
71466
+ home: paths.home ?? env.HOME ?? os14.homedir(),
70884
71467
  env,
70885
71468
  ...paths.stateDir ? { stateDir: paths.stateDir } : {}
70886
71469
  };
@@ -70954,7 +71537,7 @@ var resolveUninstallPaths = (options = {}) => {
70954
71537
  status: "failed",
70955
71538
  detail: `refusing unreviewed host command: ${action.args.join(" ")}`
70956
71539
  };
70957
- const home = paths.home ?? paths.env?.HOME ?? os13.homedir();
71540
+ const home = paths.home ?? paths.env?.HOME ?? os14.homedir();
70958
71541
  const env = paths.env ?? process.env;
70959
71542
  const recorded = claudeWorkitInstalls(home, env, action.cwd).some((install) => install.id === id && install.scope === scope && (install.projectPath === null ? action.cwd === null : path42.resolve(install.projectPath) === path42.resolve(action.cwd ?? "")));
70960
71543
  if (!recorded)
@@ -70980,7 +71563,7 @@ var init_uninstall = __esm(() => {
70980
71563
  });
70981
71564
 
70982
71565
  // packages/workit-cli/src/admin/detect-hosts.ts
70983
- import os14 from "node:os";
71566
+ import os15 from "node:os";
70984
71567
  function preselectedPlatforms(detection) {
70985
71568
  return WIZARD_HOSTS.filter((host) => detection[host].detected);
70986
71569
  }
@@ -70995,7 +71578,7 @@ function emptyDetection() {
70995
71578
  }
70996
71579
  function detectHosts(options = {}) {
70997
71580
  const env = options.env ?? process.env;
70998
- const home = options.home ?? env.HOME ?? os14.homedir();
71581
+ const home = options.home ?? env.HOME ?? os15.homedir();
70999
71582
  const plan = planUninstall({ ...options, home, env });
71000
71583
  const configuredByHost = new Map(plan.hosts.map((h) => [h.host, h.installed]));
71001
71584
  const found = emptyDetection();
@@ -73726,7 +74309,7 @@ import {
73726
74309
  lstatSync as lstatSync7
73727
74310
  } from "node:fs";
73728
74311
  import path43 from "node:path";
73729
- import os15 from "node:os";
74312
+ import os16 from "node:os";
73730
74313
  import { createHash as createHash15 } from "node:crypto";
73731
74314
  function previewUpgrade(hosts = HOSTS2, deps = {}) {
73732
74315
  const paths = upgradePaths(deps);
@@ -73766,7 +74349,7 @@ function previewUpgrade(hosts = HOSTS2, deps = {}) {
73766
74349
  });
73767
74350
  const installedSources = sources(paths, run, hosts);
73768
74351
  if (installedSources.some((source) => source.host === "opencode")) {
73769
- const scratch = mkdtempSync3(path43.join(os15.tmpdir(), "workit-upgrade-opencode-"));
74352
+ const scratch = mkdtempSync3(path43.join(os16.tmpdir(), "workit-upgrade-opencode-"));
73770
74353
  let probe;
73771
74354
  try {
73772
74355
  probe = runner({
@@ -74107,7 +74690,7 @@ async function runLaunchCommand(argv, deps = {}) {
74107
74690
  }).status ?? 1;
74108
74691
  }
74109
74692
  var HOSTS2, upgradePaths = (deps) => {
74110
- const home = deps.home ?? deps.env?.HOME ?? os15.homedir();
74693
+ const home = deps.home ?? deps.env?.HOME ?? os16.homedir();
74111
74694
  const env = {
74112
74695
  ...process.env,
74113
74696
  ...deps.home || deps.env?.HOME ? {
@@ -74787,7 +75370,7 @@ var init_redact = __esm(() => {
74787
75370
  import { spawn, spawnSync as spawnSync19 } from "node:child_process";
74788
75371
  import { createHash as createHash16 } from "node:crypto";
74789
75372
  import fs21 from "node:fs";
74790
- import os16 from "node:os";
75373
+ import os17 from "node:os";
74791
75374
  import path45 from "node:path";
74792
75375
  import { StringDecoder } from "node:string_decoder";
74793
75376
  function tailLines(text, lines = TAIL_LINES) {
@@ -74993,7 +75576,7 @@ function runCheckCommand(argv, options) {
74993
75576
  `);
74994
75577
  redactor.end();
74995
75578
  resolve({
74996
- exitCode: spawnError ? 127 : code !== null ? code : 128 + (signal ? os16.constants.signals[signal] ?? 1 : 1),
75579
+ exitCode: spawnError ? 127 : code !== null ? code : 128 + (signal ? os17.constants.signals[signal] ?? 1 : 1),
74997
75580
  signal: signal ?? null,
74998
75581
  timedOut,
74999
75582
  durationMs: Date.now() - started,
@@ -75425,14 +76008,14 @@ var init_heavy_rules = () => {};
75425
76008
 
75426
76009
  // packages/workit-core/src/core/heavy.ts
75427
76010
  import fs23 from "node:fs";
75428
- import os17 from "node:os";
76011
+ import os18 from "node:os";
75429
76012
  import path47 from "node:path";
75430
76013
  function stateDir2(env, platform = process.platform) {
75431
76014
  if (env.WORKFLOW_TOOLKIT_STATE)
75432
76015
  return env.WORKFLOW_TOOLKIT_STATE;
75433
76016
  if (env.XDG_STATE_HOME)
75434
76017
  return path47.join(env.XDG_STATE_HOME, "workit");
75435
- const home = env.HOME || os17.homedir();
76018
+ const home = env.HOME || os18.homedir();
75436
76019
  if (platform === "darwin")
75437
76020
  return path47.join(home, "Library", "Application Support", "workit");
75438
76021
  if (platform === "win32")
@@ -75802,7 +76385,7 @@ var init_heavy = __esm(() => {
75802
76385
  // packages/workit-core/src/core/resources.ts
75803
76386
  import { randomUUID as randomUUID5 } from "node:crypto";
75804
76387
  import fs24 from "node:fs";
75805
- import os18 from "node:os";
76388
+ import os19 from "node:os";
75806
76389
  import path48 from "node:path";
75807
76390
  function memoryValue(value, host) {
75808
76391
  const text = typeof value === "number" ? String(value) : typeof value === "string" ? value : "";
@@ -76197,15 +76780,15 @@ function leaseSlots(dir, slots, probe = {}) {
76197
76780
  return states;
76198
76781
  }
76199
76782
  var DEFAULT_HEAVY_CHECKS, DEFAULT_SLOTS = 1, DEFAULT_WAIT_S = 600, DEFAULT_MEMORY_SHARE = 0.4, DEFAULT_CPU_SHARE = 0.7, MAX_SLOTS = 64, UNREADABLE_TTL_MS = 30000, GUARD_TTL_MS = 30000, hostShape = () => ({
76200
- totalMemBytes: os18.totalmem(),
76201
- cpus: Math.max(1, os18.availableParallelism?.() ?? os18.cpus().length)
76783
+ totalMemBytes: os19.totalmem(),
76784
+ cpus: Math.max(1, os19.availableParallelism?.() ?? os19.cpus().length)
76202
76785
  }), isRecord9 = (value) => typeof value === "object" && value !== null && !Array.isArray(value), SIZE, PERCENT, UNITS, leaseDir = (env) => path48.join(stateDir2(env), "leases"), readText5 = (file) => {
76203
76786
  try {
76204
76787
  return fs24.readFileSync(file, "utf8");
76205
76788
  } catch {
76206
76789
  return null;
76207
76790
  }
76208
- }, bootId = () => readText5("/proc/sys/kernel/random/boot_id")?.trim() || null, bootTime = () => Math.round((Date.now() - os18.uptime() * 1000) / 1000) * 1000, BOOT_SLACK_MS = 120000, statFields = (pid) => {
76791
+ }, bootId = () => readText5("/proc/sys/kernel/random/boot_id")?.trim() || null, bootTime = () => Math.round((Date.now() - os19.uptime() * 1000) / 1000) * 1000, BOOT_SLACK_MS = 120000, statFields = (pid) => {
76209
76792
  const stat = readText5(`/proc/${pid}/stat`);
76210
76793
  return stat ? stat.slice(stat.lastIndexOf(")") + 2).split(" ") : null;
76211
76794
  }, processStart = (pid) => statFields(pid)?.[19] ?? null, pidAlive2 = (pid) => {
@@ -76251,7 +76834,7 @@ __export(exports_check, {
76251
76834
  run: () => run11,
76252
76835
  workspaceResources: () => workspaceResources
76253
76836
  });
76254
- import os19 from "node:os";
76837
+ import os20 from "node:os";
76255
76838
  import path49 from "node:path";
76256
76839
  function parse6(argv) {
76257
76840
  const split = argv.indexOf("--");
@@ -76435,7 +77018,7 @@ function hostToolWaitCapMs(env) {
76435
77018
  }
76436
77019
  async function workspaceResources(io) {
76437
77020
  const env = io.env;
76438
- const dir = env.WORKFLOW_TOOLKIT_CONFIG ?? env.WORKFLOW_TOOLKIT_CONFIG_DIR ?? path49.join(env.XDG_CONFIG_HOME || path49.join(env.HOME || os19.homedir(), ".config"), "workit");
77021
+ const dir = env.WORKFLOW_TOOLKIT_CONFIG ?? env.WORKFLOW_TOOLKIT_CONFIG_DIR ?? path49.join(env.XDG_CONFIG_HOME || path49.join(env.HOME || os20.homedir(), ".config"), "workit");
76439
77022
  try {
76440
77023
  await Promise.resolve().then(() => init_workspaces());
76441
77024
  const workspace = resolveWorkspaceFrom(io.cwd, dir, env.WORKFLOW_WORKSPACE_NAME?.trim() || undefined);
@@ -76914,6 +77497,9 @@ var exports_models = {};
76914
77497
  __export(exports_models, {
76915
77498
  run: () => run13
76916
77499
  });
77500
+ import { existsSync as existsSync21, readdirSync as readdirSync10, readFileSync as readFileSync21, statSync as statSync9 } from "node:fs";
77501
+ import os21 from "node:os";
77502
+ import path51 from "node:path";
76917
77503
  async function run13(argv, io) {
76918
77504
  const [sub, ...args] = argv.filter((arg) => arg !== "--json");
76919
77505
  if (sub !== "show")
@@ -76921,13 +77507,27 @@ async function run13(argv, io) {
76921
77507
  const role = flag3(args, "--role");
76922
77508
  const tier = flag3(args, "--tier");
76923
77509
  const hostFlag = flag3(args, "--host");
76924
- for (const value of [role, tier, hostFlag])
77510
+ const daysFlag = flag3(args, "--days");
77511
+ for (const value of [role, tier, hostFlag, daysFlag])
76925
77512
  if (value instanceof Error)
76926
77513
  return emit(io, fail2("invalid_input", value.message));
76927
77514
  if (role && !MODEL_ROLES.includes(role))
76928
77515
  return emit(io, fail2("invalid_input", `unknown role ${role}: ${MODEL_ROLES.join(", ")}`));
76929
77516
  if (tier && !MODEL_TIERS.includes(tier))
76930
77517
  return emit(io, fail2("invalid_input", `unknown tier ${tier}: ${MODEL_TIERS.join(", ")}`));
77518
+ const days = daysFlag === null ? 7 : Number(daysFlag);
77519
+ if (!Number.isFinite(days) || days <= 0)
77520
+ return emit(io, fail2("invalid_input", "--days needs a positive number"));
77521
+ if (args.includes("--report")) {
77522
+ const report = usageReport(io.cwd, io.env, days);
77523
+ return emit(io, ok2(report), (data) => [
77524
+ `subagent models over the last ${data.days} days (${data.agents} agents)`,
77525
+ ...Object.entries(data.types).flatMap(([type, use]) => [
77526
+ ` ${type}${use.role ? ` (role ${use.role}, default ${use.defaults.join("/") || "host default"})` : ""}: ${Object.entries(use.models).map(([model, count]) => `${model} x${count}`).join(", ")}`,
77527
+ ...use.flagged.map((model) => ` flag: ran on ${model}, not the role default`)
77528
+ ])
77529
+ ]);
77530
+ }
76931
77531
  const envHost = actorFromEnv(io.env).host;
76932
77532
  const host = hostFlag ?? (envHost === "cli" ? "claude_code" : envHost);
76933
77533
  const row = (selector) => resolveRoleModel(io.cwd, selector, host) ?? { model: null, effort: null, source: "none" };
@@ -76950,13 +77550,73 @@ async function run13(argv, io) {
76950
77550
  ...(data.issues ?? []).map((issue) => `note: ${issue}`)
76951
77551
  ]);
76952
77552
  }
76953
- var USAGE6 = "workit models show [--role <role>] [--tier <tier>] [--host <host>] [--json]", flag3 = (argv, name) => {
77553
+ var USAGE6 = "workit models show [--role <role>] [--tier <tier>] [--host <host>] [--report [--days <n>]] [--json]", flag3 = (argv, name) => {
76954
77554
  const at = argv.findIndex((arg) => arg === name || arg.startsWith(`${name}=`));
76955
77555
  if (at < 0)
76956
77556
  return null;
76957
77557
  const value = argv[at].includes("=") ? argv[at].slice(name.length + 1) : argv[at + 1];
76958
77558
  return value && !value.startsWith("--") ? value : new Error(`${name} needs a value`);
76959
- }, line2 = (label, entry) => ` ${label}: ${entry.model ? `${entry.model}${entry.effort ? ` (effort ${entry.effort})` : ""} [${entry.source}]` : "host default (nothing configured)"}`;
77559
+ }, line2 = (label, entry) => ` ${label}: ${entry.model ? `${entry.model}${entry.effort ? ` (effort ${entry.effort})` : ""} [${entry.source}]` : "host default (nothing configured)"}`, modelsOf = (file) => {
77560
+ const found = new Set;
77561
+ let text = "";
77562
+ try {
77563
+ text = readFileSync21(file, "utf8");
77564
+ } catch {
77565
+ return found;
77566
+ }
77567
+ for (const row of text.split(`
77568
+ `))
77569
+ if (row.includes('"type":"assistant"'))
77570
+ try {
77571
+ const model = JSON.parse(row).message?.model;
77572
+ if (typeof model === "string" && model && !model.startsWith("<"))
77573
+ found.add(model);
77574
+ } catch {}
77575
+ return found;
77576
+ }, matches3 = (ran, configured) => ran.toLowerCase().includes(configured.toLowerCase()), usageReport = (cwd, env, days) => {
77577
+ const projects = path51.join(env.CLAUDE_CONFIG_DIR || path51.join(env.HOME || os21.homedir(), ".claude"), "projects");
77578
+ const since = Date.now() - days * 86400000;
77579
+ const types = {};
77580
+ let agents = 0;
77581
+ const dirs = (dir) => {
77582
+ try {
77583
+ return readdirSync10(dir).map((name) => path51.join(dir, name));
77584
+ } catch {
77585
+ return [];
77586
+ }
77587
+ };
77588
+ for (const project of dirs(projects))
77589
+ for (const session of dirs(project))
77590
+ for (const meta of dirs(path51.join(session, "subagents")).filter((f) => f.endsWith(".meta.json"))) {
77591
+ try {
77592
+ if (statSync9(meta).mtimeMs < since)
77593
+ continue;
77594
+ const agentType = JSON.parse(readFileSync21(meta, "utf8")).agentType;
77595
+ const transcript = meta.replace(/\.meta\.json$/, ".jsonl");
77596
+ if (typeof agentType !== "string" || !existsSync21(transcript))
77597
+ continue;
77598
+ const ran = modelsOf(transcript);
77599
+ if (!ran.size)
77600
+ continue;
77601
+ agents += 1;
77602
+ const selector = roleForAgentType(agentType);
77603
+ const entry = types[agentType] ??= {
77604
+ role: selector?.role ?? null,
77605
+ defaults: selector ? [
77606
+ ...new Set((selector.role === "implementer" ? MODEL_TIERS.map((tier) => ({ ...selector, tier })) : [selector]).flatMap((one) => resolveRoleModel(cwd, one, "claude_code")?.model ?? []))
77607
+ ] : [],
77608
+ models: {},
77609
+ flagged: []
77610
+ };
77611
+ for (const model of ran) {
77612
+ entry.models[model] = (entry.models[model] ?? 0) + 1;
77613
+ if (entry.models[model] === 1 && entry.defaults.length && !entry.defaults.some((d) => matches3(model, d)))
77614
+ entry.flagged.push(model);
77615
+ }
77616
+ } catch {}
77617
+ }
77618
+ return { days, agents, types };
77619
+ };
76960
77620
  var init_models = __esm(() => {
76961
77621
  init_role_models();
76962
77622
  init_ledger();
@@ -77072,8 +77732,8 @@ var success2 = (data) => ({ ok: true, data }), failure3 = (code, error, unblock)
77072
77732
 
77073
77733
  // packages/workit-core/src/git/ops.ts
77074
77734
  import { spawnSync as spawnSync20 } from "node:child_process";
77075
- import { existsSync as existsSync21, readFileSync as readFileSync21 } from "node:fs";
77076
- import path51 from "node:path";
77735
+ import { existsSync as existsSync22, readFileSync as readFileSync22 } from "node:fs";
77736
+ import path52 from "node:path";
77077
77737
  function operationInProgress(cwd) {
77078
77738
  const markers = [
77079
77739
  ["rebase-merge", "rebase"],
@@ -77086,18 +77746,18 @@ function operationInProgress(cwd) {
77086
77746
  if (!run.ok)
77087
77747
  return null;
77088
77748
  const found = run.stdout.split(`
77089
- `).map((line) => path51.resolve(cwd, line.trim()));
77749
+ `).map((line) => path52.resolve(cwd, line.trim()));
77090
77750
  const conflicted = () => git5(cwd, ["ls-files", "-u"]).stdout.trim() !== "";
77091
77751
  for (const [index, [, operation]] of markers.entries()) {
77092
77752
  const marker = found[index];
77093
- if (!marker || !existsSync21(marker))
77753
+ if (!marker || !existsSync22(marker))
77094
77754
  continue;
77095
- if (index === 1 && existsSync21(path51.join(marker, "applying")))
77755
+ if (index === 1 && existsSync22(path52.join(marker, "applying")))
77096
77756
  return { operation: "am", commitAllowed: false, branch: null };
77097
- if (index === 0 && existsSync21(path51.join(marker, "amend")) && !conflicted()) {
77757
+ if (index === 0 && existsSync22(path52.join(marker, "amend")) && !conflicted()) {
77098
77758
  let headName = "";
77099
77759
  try {
77100
- headName = readFileSync21(path51.join(marker, "head-name"), "utf8").trim();
77760
+ headName = readFileSync22(path52.join(marker, "head-name"), "utf8").trim();
77101
77761
  } catch {}
77102
77762
  const branch = headName.startsWith("refs/heads/") ? headName.slice("refs/heads/".length) : null;
77103
77763
  return { operation, commitAllowed: branch !== null, branch };
@@ -77425,7 +78085,7 @@ function gitCommit(cwd, input) {
77425
78085
  if (paths.some((value) => value.startsWith("-") || !value.trim()))
77426
78086
  return failure3("invalid_input", "paths must not be empty or start with -");
77427
78087
  const tracked = new Set(nulList(git5(cwd, ["ls-files", "-z", "--", ...paths]).stdout));
77428
- const addable = paths.filter((value) => existsSync21(path51.resolve(cwd, value)) || [...tracked].some((file) => file === value || file.startsWith(`${value}/`)));
78088
+ const addable = paths.filter((value) => existsSync22(path52.resolve(cwd, value)) || [...tracked].some((file) => file === value || file.startsWith(`${value}/`)));
77429
78089
  if (addable.length) {
77430
78090
  const added = git5(cwd, ["add", "-A", "--", ...addable]);
77431
78091
  if (!added.ok)
@@ -77952,12 +78612,12 @@ var init_ops = __esm(() => {
77952
78612
 
77953
78613
  // packages/workit-core/src/verdict-cover.ts
77954
78614
  import fs26 from "node:fs";
77955
- import path52 from "node:path";
78615
+ import path53 from "node:path";
77956
78616
  function chainsAbove(cwd, branch) {
77957
78617
  const root = storeRoot(cwd);
77958
78618
  if (!root.ok)
77959
78619
  return [];
77960
- const dir = path52.join(root.value.root, "stacks");
78620
+ const dir = path53.join(root.value.root, "stacks");
77961
78621
  let names = [];
77962
78622
  try {
77963
78623
  names = fs26.readdirSync(dir).filter((name) => name.endsWith(".json"));
@@ -77968,7 +78628,7 @@ function chainsAbove(cwd, branch) {
77968
78628
  for (const name of names.toSorted()) {
77969
78629
  let parsed;
77970
78630
  try {
77971
- parsed = JSON.parse(fs26.readFileSync(path52.join(dir, name), "utf8"));
78631
+ parsed = JSON.parse(fs26.readFileSync(path53.join(dir, name), "utf8"));
77972
78632
  } catch {
77973
78633
  continue;
77974
78634
  }
@@ -78063,10 +78723,10 @@ var init_pr_lane = __esm(() => {
78063
78723
 
78064
78724
  // packages/workit-core/src/forge/reruns.ts
78065
78725
  import fs27 from "node:fs";
78066
- import path53 from "node:path";
78726
+ import path54 from "node:path";
78067
78727
  function rerunLogPath(cwd) {
78068
78728
  const common = gitCommonDir(cwd);
78069
- return common ? path53.join(common, "workit", "ci-reruns.jsonl") : null;
78729
+ return common ? path54.join(common, "workit", "ci-reruns.jsonl") : null;
78070
78730
  }
78071
78731
  function rerunCounts(cwd, key) {
78072
78732
  const counts = new Map;
@@ -78101,7 +78761,7 @@ function recordReruns(cwd, rows) {
78101
78761
  if (!file)
78102
78762
  return false;
78103
78763
  try {
78104
- fs27.mkdirSync(path53.dirname(file), { recursive: true });
78764
+ fs27.mkdirSync(path54.dirname(file), { recursive: true });
78105
78765
  fs27.appendFileSync(file, rows.map((row) => `${JSON.stringify(row)}
78106
78766
  `).join(""));
78107
78767
  return true;
@@ -78114,7 +78774,7 @@ function withRerunLock(cwd, fn) {
78114
78774
  if (!file)
78115
78775
  return fn();
78116
78776
  const lock = `${file.slice(0, -".jsonl".length)}.lock`;
78117
- fs27.mkdirSync(path53.dirname(lock), { recursive: true });
78777
+ fs27.mkdirSync(path54.dirname(lock), { recursive: true });
78118
78778
  const until = Date.now() + LOCK_WAIT_MS2;
78119
78779
  for (;; ) {
78120
78780
  try {
@@ -79029,7 +79689,7 @@ var init_pr_ops = __esm(() => {
79029
79689
  import { spawnSync as spawnSync22 } from "node:child_process";
79030
79690
  import { createHash as createHash17, randomBytes as randomBytes4 } from "node:crypto";
79031
79691
  import fs28 from "node:fs";
79032
- import path54 from "node:path";
79692
+ import path55 from "node:path";
79033
79693
  function worktreeOf(cwd, branch) {
79034
79694
  const list = gitRun3(cwd, ["worktree", "list", "--porcelain"]);
79035
79695
  if (!list.ok)
@@ -79073,7 +79733,7 @@ function gitRestack(cwd, input) {
79073
79733
  if (!scratch)
79074
79734
  return { ok: false, conflict: false, worktree: cwd, error: "no store root" };
79075
79735
  fs28.mkdirSync(scratch, { recursive: true });
79076
- dir = path54.join(scratch, `${input.branch.replace(/[^A-Za-z0-9._-]+/gu, "_").slice(0, 40)}-${randomBytes4(4).toString("hex")}`);
79736
+ dir = path55.join(scratch, `${input.branch.replace(/[^A-Za-z0-9._-]+/gu, "_").slice(0, 40)}-${randomBytes4(4).toString("hex")}`);
79077
79737
  const added = gitRun3(cwd, ["worktree", "add", "-q", dir, input.branch], GIT_TIMEOUTS.worktree);
79078
79738
  if (!added.ok)
79079
79739
  return { ok: false, conflict: false, worktree: cwd, error: firstLine(added) };
@@ -79114,7 +79774,7 @@ function pruneScratch(cwd) {
79114
79774
  if (!scratch || !fs28.existsSync(scratch))
79115
79775
  return;
79116
79776
  for (const name of fs28.readdirSync(scratch)) {
79117
- const dir = path54.join(scratch, name);
79777
+ const dir = path55.join(scratch, name);
79118
79778
  if (!rebaseInProgress(dir) && !trackedDirt(dir))
79119
79779
  gitRun3(cwd, ["worktree", "remove", "--force", dir]);
79120
79780
  }
@@ -79124,7 +79784,7 @@ function stacksDir(cwd) {
79124
79784
  const root = storeRoot(cwd);
79125
79785
  if (!root.ok)
79126
79786
  return stackFail(root.code, root.error, root.unblock);
79127
- return { ok: true, data: path54.join(root.value.root, "stacks") };
79787
+ return { ok: true, data: path55.join(root.value.root, "stacks") };
79128
79788
  }
79129
79789
  function parseStack(raw) {
79130
79790
  if (!isRecord12(raw) || !Array.isArray(raw.branches))
@@ -79176,7 +79836,7 @@ function readStack(cwd, name) {
79176
79836
  const dir = stacksDir(cwd);
79177
79837
  if (!dir.ok)
79178
79838
  return dir;
79179
- const file = path54.join(dir.data, fileFor(name));
79839
+ const file = path55.join(dir.data, fileFor(name));
79180
79840
  let text;
79181
79841
  try {
79182
79842
  text = fs28.readFileSync(file, "utf8");
@@ -79197,7 +79857,7 @@ function writeStack(cwd, stack, now = new Date) {
79197
79857
  const dir = stacksDir(cwd);
79198
79858
  if (!dir.ok)
79199
79859
  return dir;
79200
- const file = path54.join(dir.data, fileFor(stack.name));
79860
+ const file = path55.join(dir.data, fileFor(stack.name));
79201
79861
  const temp = `${file}.${process.pid}.tmp`;
79202
79862
  try {
79203
79863
  fs28.mkdirSync(dir.data, { recursive: true });
@@ -79225,7 +79885,7 @@ function listStacks(cwd) {
79225
79885
  for (const name of names) {
79226
79886
  let parsed = null;
79227
79887
  try {
79228
- parsed = parseStack(JSON.parse(fs28.readFileSync(path54.join(dir.data, name), "utf8")));
79888
+ parsed = parseStack(JSON.parse(fs28.readFileSync(path55.join(dir.data, name), "utf8")));
79229
79889
  } catch {
79230
79890
  parsed = null;
79231
79891
  }
@@ -79284,7 +79944,7 @@ function takeLock(lock) {
79284
79944
  host: localLockHost(),
79285
79945
  nonce: randomBytes4(8).toString("hex")
79286
79946
  };
79287
- fs28.writeFileSync(path54.join(lock, OWNER), JSON.stringify(owner));
79947
+ fs28.writeFileSync(path55.join(lock, OWNER), JSON.stringify(owner));
79288
79948
  return owner;
79289
79949
  }
79290
79950
  function reapLock(lock, observed) {
@@ -79321,7 +79981,7 @@ async function withStackLock(cwd, name, fn, waitMs = LOCK_WAIT_MS3) {
79321
79981
  return dir;
79322
79982
  if (!validName(name))
79323
79983
  return stackFail("invalid_input", "a stack name must be 1-200 printable characters");
79324
- const lock = path54.join(dir.data, `${fileFor(name)}.lock`);
79984
+ const lock = path55.join(dir.data, `${fileFor(name)}.lock`);
79325
79985
  try {
79326
79986
  fs28.mkdirSync(dir.data, { recursive: true });
79327
79987
  } catch (error) {
@@ -79351,7 +80011,7 @@ async function withStackLock(cwd, name, fn, waitMs = LOCK_WAIT_MS3) {
79351
80011
  const touch = () => {
79352
80012
  try {
79353
80013
  const now = new Date;
79354
- fs28.utimesSync(path54.join(lock, OWNER), now, now);
80014
+ fs28.utimesSync(path55.join(lock, OWNER), now, now);
79355
80015
  } catch {}
79356
80016
  };
79357
80017
  const beat = setInterval(touch, HEARTBEAT_MS);
@@ -80202,7 +80862,7 @@ var STACK_VERSION = 1, stackFail = (code, error, unblock, data) => ({
80202
80862
  return !status.ok || status.stdout.trim() !== "";
80203
80863
  }, scratchDir = (cwd) => {
80204
80864
  const dir = stacksDir(cwd);
80205
- return dir.ok ? path54.join(dir.data, "worktrees") : null;
80865
+ return dir.ok ? path55.join(dir.data, "worktrees") : null;
80206
80866
  }, firstLine = (run) => (`${run.stderr}
80207
80867
  ${run.stdout}`.split(`
80208
80868
  `).find((line) => line.trim()) ?? "git failed").trim().slice(0, 300), stackFileName = (name) => `${name.replace(/[^A-Za-z0-9._-]+/gu, "_").replace(/^[._]+/u, "").slice(0, 48).toLowerCase()}-${createHash17("sha256").update(name).digest("hex").slice(0, 12)}.json`, fileFor, validName = (name) => {
@@ -80217,12 +80877,12 @@ ${run.stdout}`.split(`
80217
80877
  }, isRecord12 = (value) => typeof value === "object" && value !== null && !Array.isArray(value), str3 = (value) => typeof value === "string" && value ? value : null, LOCK_WAIT_MS3 = 2000, HEARTBEAT_MS = 20000, HEARTBEAT_STALE_MS, OWNERLESS_STALE_MS = 30000, OWNER = "owner", readOwner = (lock) => {
80218
80878
  let raw = null;
80219
80879
  try {
80220
- raw = fs28.readFileSync(path54.join(lock, OWNER), "utf8");
80880
+ raw = fs28.readFileSync(path55.join(lock, OWNER), "utf8");
80221
80881
  } catch {
80222
80882
  raw = null;
80223
80883
  }
80224
80884
  let age = null;
80225
- for (const target of [path54.join(lock, OWNER), lock])
80885
+ for (const target of [path55.join(lock, OWNER), lock])
80226
80886
  try {
80227
80887
  age = Date.now() - fs28.statSync(target).mtimeMs;
80228
80888
  break;
@@ -80265,7 +80925,7 @@ var init_stack = __esm(() => {
80265
80925
  import { spawnSync as spawnSync23 } from "node:child_process";
80266
80926
  import { createHash as createHash18 } from "node:crypto";
80267
80927
  import fs29 from "node:fs";
80268
- import path55 from "node:path";
80928
+ import path56 from "node:path";
80269
80929
  function expandBraces2(pattern, limit = 64) {
80270
80930
  for (let index = 0;index < pattern.length; index += 1) {
80271
80931
  if (pattern[index] === "\\") {
@@ -80511,7 +81171,7 @@ function parsePlan(raw, defaults, name) {
80511
81171
  id,
80512
81172
  branch,
80513
81173
  base: optional("base") ?? "",
80514
- worktree: path55.resolve(defaults.root, optional("worktree") ?? path55.join(defaults.worktreeRoot, id)),
81174
+ worktree: path56.resolve(defaults.root, optional("worktree") ?? path56.join(defaults.worktreeRoot, id)),
80515
81175
  tier,
80516
81176
  reason,
80517
81177
  dependsOn: [...new Set(dependsOn ?? [])],
@@ -80742,11 +81402,11 @@ function defaultTrunk(cwd) {
80742
81402
  }
80743
81403
  function mainCheckout(cwd) {
80744
81404
  const common = gitCommonDir(cwd);
80745
- return common && path55.basename(common) === ".git" ? path55.dirname(common) : path55.resolve(cwd);
81405
+ return common && path56.basename(common) === ".git" ? path56.dirname(common) : path56.resolve(cwd);
80746
81406
  }
80747
81407
  function worktreeRoot(cwd) {
80748
81408
  const main = mainCheckout(cwd);
80749
- return path55.join(path55.dirname(main), `${path55.basename(main)}-wt`);
81409
+ return path56.join(path56.dirname(main), `${path56.basename(main)}-wt`);
80750
81410
  }
80751
81411
  function sliceHash(slice) {
80752
81412
  const {
@@ -80766,7 +81426,7 @@ function fanoutsDir(cwd) {
80766
81426
  const root = storeRoot(cwd);
80767
81427
  if (!root.ok)
80768
81428
  return fanoutFail(root.code, root.error, root.unblock);
80769
- return { ok: true, data: path55.join(root.value.root, "fanouts") };
81429
+ return { ok: true, data: path56.join(root.value.root, "fanouts") };
80770
81430
  }
80771
81431
  function parseStored(raw) {
80772
81432
  if (!isRecord13(raw) || typeof raw.name !== "string" || typeof raw.trunk !== "string")
@@ -80834,7 +81494,7 @@ function readFanout(cwd, name) {
80834
81494
  const dir = fanoutsDir(cwd);
80835
81495
  if (!dir.ok)
80836
81496
  return dir;
80837
- const file = path55.join(dir.data, stackFileName(name));
81497
+ const file = path56.join(dir.data, stackFileName(name));
80838
81498
  let parsed = null;
80839
81499
  try {
80840
81500
  parsed = parseStored(JSON.parse(fs29.readFileSync(file, "utf8")));
@@ -80859,7 +81519,7 @@ function listFanouts(cwd) {
80859
81519
  for (const entry of names) {
80860
81520
  let parsed = null;
80861
81521
  try {
80862
- parsed = parseStored(JSON.parse(fs29.readFileSync(path55.join(dir.data, entry), "utf8")));
81522
+ parsed = parseStored(JSON.parse(fs29.readFileSync(path56.join(dir.data, entry), "utf8")));
80863
81523
  } catch {
80864
81524
  parsed = null;
80865
81525
  }
@@ -80898,7 +81558,7 @@ function writeFanout(cwd, plan) {
80898
81558
  const dir = fanoutsDir(cwd);
80899
81559
  if (!dir.ok)
80900
81560
  return dir;
80901
- const file = path55.join(dir.data, stackFileName(plan.name));
81561
+ const file = path56.join(dir.data, stackFileName(plan.name));
80902
81562
  const temp = `${file}.${process.pid}.tmp`;
80903
81563
  try {
80904
81564
  fs29.mkdirSync(dir.data, { recursive: true });
@@ -81105,13 +81765,13 @@ var init_fanout = __esm(() => {
81105
81765
  // packages/workit-core/src/forge/exec.ts
81106
81766
  import { spawnSync as spawnSync24 } from "node:child_process";
81107
81767
  import fs30 from "node:fs";
81108
- import path56 from "node:path";
81768
+ import path57 from "node:path";
81109
81769
  function findExecutable(bin, env) {
81110
- const dirs = (env.PATH ?? env.Path ?? "").split(path56.delimiter).filter(Boolean);
81770
+ const dirs = (env.PATH ?? env.Path ?? "").split(path57.delimiter).filter(Boolean);
81111
81771
  const exts = process.platform === "win32" ? [".exe"] : [""];
81112
81772
  for (const dir of dirs)
81113
81773
  for (const ext of exts) {
81114
- const candidate = path56.join(dir, `${bin}${ext}`);
81774
+ const candidate = path57.join(dir, `${bin}${ext}`);
81115
81775
  try {
81116
81776
  const stat = fs30.statSync(candidate);
81117
81777
  if (stat.isFile())
@@ -82855,7 +83515,7 @@ var init_duration = __esm(() => {
82855
83515
  });
82856
83516
 
82857
83517
  // packages/workit-cli/src/verbs/forge-common.ts
82858
- import { readFileSync as readFileSync22 } from "node:fs";
83518
+ import { readFileSync as readFileSync23 } from "node:fs";
82859
83519
  function parseFlags(argv, spec) {
82860
83520
  const parsed = { values: {}, booleans: new Set, lists: {}, positionals: [] };
82861
83521
  for (let index = 0;index < argv.length; index += 1) {
@@ -82999,7 +83659,7 @@ var init_forge_common = __esm(() => {
82999
83659
  forgeDeps = {
83000
83660
  runner: undefined,
83001
83661
  npm: undefined,
83002
- readStdin: () => readFileSync22(0, "utf8"),
83662
+ readStdin: () => readFileSync23(0, "utf8"),
83003
83663
  sleep: (ms) => new Promise((resolve) => setTimeout(resolve, ms)),
83004
83664
  now: () => Date.now()
83005
83665
  };
@@ -83010,12 +83670,12 @@ var exports_pr = {};
83010
83670
  __export(exports_pr, {
83011
83671
  run: () => run14
83012
83672
  });
83013
- import { readFileSync as readFileSync23 } from "node:fs";
83014
- import path57 from "node:path";
83673
+ import { readFileSync as readFileSync24 } from "node:fs";
83674
+ import path58 from "node:path";
83015
83675
  function readBodyFile(io, file) {
83016
83676
  try {
83017
83677
  return {
83018
- body: file === "-" ? forgeDeps.readStdin() : readFileSync23(path57.resolve(io.cwd, file), "utf8")
83678
+ body: file === "-" ? forgeDeps.readStdin() : readFileSync24(path58.resolve(io.cwd, file), "utf8")
83019
83679
  };
83020
83680
  } catch {
83021
83681
  return `cannot read --body-file ${file}`;
@@ -83720,8 +84380,8 @@ var exports_git = {};
83720
84380
  __export(exports_git, {
83721
84381
  run: () => run16
83722
84382
  });
83723
- import { readFileSync as readFileSync24 } from "node:fs";
83724
- import path58 from "node:path";
84383
+ import { readFileSync as readFileSync25 } from "node:fs";
84384
+ import path59 from "node:path";
83725
84385
  function kindHint(cwd, kind) {
83726
84386
  let kinds = [...BRANCH_KINDS];
83727
84387
  try {
@@ -83825,7 +84485,7 @@ function commitMessage(parsed, io) {
83825
84485
 
83826
84486
  `);
83827
84487
  try {
83828
- return file === "-" ? readFileSync24(0, "utf8") : readFileSync24(path58.resolve(io.cwd, file), "utf8");
84488
+ return file === "-" ? readFileSync25(0, "utf8") : readFileSync25(path59.resolve(io.cwd, file), "utf8");
83829
84489
  } catch (error) {
83830
84490
  return {
83831
84491
  error: `cannot read -F ${file}: ${error instanceof Error ? error.message : String(error)}`
@@ -85246,7 +85906,7 @@ var init_live_session = __esm(() => {
85246
85906
  });
85247
85907
 
85248
85908
  // packages/workit-core/src/hooks/write-gate.ts
85249
- import path59 from "node:path";
85909
+ import path60 from "node:path";
85250
85910
  var CASE_INSENSITIVE, PREFIXES2, SCRIPT_SHELLS, cache3, MUTATING_GIT, DRY_N, MUTATING_WORKIT_GIT, CD2, PUSHD2, POPD2, UNKNOWN_DIR;
85251
85911
  var init_write_gate = __esm(() => {
85252
85912
  init_task_store();
@@ -85286,7 +85946,7 @@ var init_write_gate = __esm(() => {
85286
85946
  CD2 = new Set(["cd", "chdir", "set-location", "sl"]);
85287
85947
  PUSHD2 = new Set(["pushd", "push-location"]);
85288
85948
  POPD2 = new Set(["popd", "pop-location"]);
85289
- UNKNOWN_DIR = path59.resolve(path59.parse(process.cwd()).root, ".workit-unknown-dir");
85949
+ UNKNOWN_DIR = path60.resolve(path60.parse(process.cwd()).root, ".workit-unknown-dir");
85290
85950
  });
85291
85951
 
85292
85952
  // packages/workit-core/src/hooks/worktree-confine.ts
@@ -85311,20 +85971,20 @@ var init_worktree_confine = __esm(() => {
85311
85971
 
85312
85972
  // packages/workit-core/src/worktree-deps.ts
85313
85973
  import fs32 from "node:fs";
85314
- import path60 from "node:path";
85974
+ import path61 from "node:path";
85315
85975
  function moduleDirs(main) {
85316
85976
  const out = [];
85317
85977
  const walk = (relative, depth) => {
85318
85978
  let entries;
85319
85979
  try {
85320
- entries = fs32.readdirSync(path60.join(main, relative), { withFileTypes: true });
85980
+ entries = fs32.readdirSync(path61.join(main, relative), { withFileTypes: true });
85321
85981
  } catch {
85322
85982
  return;
85323
85983
  }
85324
85984
  for (const entry of entries) {
85325
85985
  if (!entry.isDirectory())
85326
85986
  continue;
85327
- const child = path60.join(relative, entry.name);
85987
+ const child = path61.join(relative, entry.name);
85328
85988
  if (entry.name === MODULES)
85329
85989
  out.push(child);
85330
85990
  else if (depth < MAX_DEPTH2 && !entry.name.startsWith("."))
@@ -85338,8 +85998,8 @@ function linkEntry(main, worktree, source, target) {
85338
85998
  const stat = fs32.lstatSync(source);
85339
85999
  if (stat.isSymbolicLink()) {
85340
86000
  const link = fs32.readlinkSync(source);
85341
- const outside = path60.isAbsolute(link) && within(link, main) && !path60.relative(main, link).split(path60.sep).includes(MODULES);
85342
- const to = outside ? path60.join(worktree, path60.relative(main, link)) : link;
86001
+ const outside = path61.isAbsolute(link) && within(link, main) && !path61.relative(main, link).split(path61.sep).includes(MODULES);
86002
+ const to = outside ? path61.join(worktree, path61.relative(main, link)) : link;
85343
86003
  fs32.symlinkSync(to, target, process.platform === "win32" ? "junction" : undefined);
85344
86004
  return;
85345
86005
  }
@@ -85349,8 +86009,8 @@ function mirror(main, worktree, source, target, top) {
85349
86009
  fs32.mkdirSync(target);
85350
86010
  let count = 0;
85351
86011
  for (const entry of fs32.readdirSync(source, { withFileTypes: true })) {
85352
- const from = path60.join(source, entry.name);
85353
- const to = path60.join(target, entry.name);
86012
+ const from = path61.join(source, entry.name);
86013
+ const to = path61.join(target, entry.name);
85354
86014
  if (top && entry.isDirectory() && (entry.name.startsWith("@") || entry.name === ".bin"))
85355
86015
  count += mirror(main, worktree, from, to, false);
85356
86016
  else {
@@ -85366,16 +86026,16 @@ function linkWorktreeDependencies(main, worktree) {
85366
86026
  const dirs = [];
85367
86027
  let entries = 0;
85368
86028
  for (const relative of moduleDirs(main)) {
85369
- const target = path60.join(worktree, relative);
85370
- if (!fs32.existsSync(path60.dirname(target)) || fs32.existsSync(target))
86029
+ const target = path61.join(worktree, relative);
86030
+ if (!fs32.existsSync(path61.dirname(target)) || fs32.existsSync(target))
85371
86031
  continue;
85372
- if (!gitRun4(worktree, ["check-ignore", "-q", `${relative.split(path60.sep).join("/")}/`]).ok) {
85373
- notes.push(`${relative.split(path60.sep).join("/")} is not ignored by git, so it was not linked from ${main}; install dependencies in the worktree yourself`);
86032
+ if (!gitRun4(worktree, ["check-ignore", "-q", `${relative.split(path61.sep).join("/")}/`]).ok) {
86033
+ notes.push(`${relative.split(path61.sep).join("/")} is not ignored by git, so it was not linked from ${main}; install dependencies in the worktree yourself`);
85374
86034
  continue;
85375
86035
  }
85376
86036
  try {
85377
- entries += mirror(main, worktree, path60.join(main, relative), target, true);
85378
- dirs.push(relative.split(path60.sep).join("/"));
86037
+ entries += mirror(main, worktree, path61.join(main, relative), target, true);
86038
+ dirs.push(relative.split(path61.sep).join("/"));
85379
86039
  } catch (error) {
85380
86040
  fs32.rmSync(target, { recursive: true, force: true });
85381
86041
  notes.push(`could not link ${relative} from ${main} (${error.message}); install dependencies in the worktree yourself`);
@@ -85388,8 +86048,8 @@ function linkWorktreeDependencies(main, worktree) {
85388
86048
  return { linked: { from: main, dirs, entries, ms }, notes };
85389
86049
  }
85390
86050
  var MODULES = "node_modules", MAX_DEPTH2 = 2, within = (child, parent) => {
85391
- const relative = path60.relative(parent, child);
85392
- return relative === "" || !relative.startsWith("..") && !path60.isAbsolute(relative);
86051
+ const relative = path61.relative(parent, child);
86052
+ return relative === "" || !relative.startsWith("..") && !path61.isAbsolute(relative);
85393
86053
  };
85394
86054
  var init_worktree_deps = __esm(() => {
85395
86055
  init_fanout();
@@ -85398,7 +86058,7 @@ var init_worktree_deps = __esm(() => {
85398
86058
  // packages/workit-core/src/fanout-worktree.ts
85399
86059
  import { randomBytes as randomBytes5 } from "node:crypto";
85400
86060
  import fs33 from "node:fs";
85401
- import path61 from "node:path";
86061
+ import path62 from "node:path";
85402
86062
  function rowSample(lines) {
85403
86063
  const out = [];
85404
86064
  let bytes = 0;
@@ -85458,7 +86118,7 @@ function adminDir(worktree) {
85458
86118
  const file = dir.stdout.trim();
85459
86119
  let token = null;
85460
86120
  try {
85461
- token = fs33.readFileSync(path61.join(file, FANOUT_TOKEN_FILE), "utf8").trim() || null;
86121
+ token = fs33.readFileSync(path62.join(file, FANOUT_TOKEN_FILE), "utf8").trim() || null;
85462
86122
  } catch {
85463
86123
  token = null;
85464
86124
  }
@@ -85466,7 +86126,7 @@ function adminDir(worktree) {
85466
86126
  const stat = worktreeDeps.stat(file);
85467
86127
  return {
85468
86128
  path: file,
85469
- id: path61.basename(file),
86129
+ id: path62.basename(file),
85470
86130
  ino: stat.ino.toString(),
85471
86131
  token,
85472
86132
  birthMs: stat.birthtimeNs > 0n ? Number(stat.birthtimeMs) : null,
@@ -85482,7 +86142,7 @@ function markAdminDir(worktree) {
85482
86142
  return null;
85483
86143
  const token = randomBytes5(16).toString("hex");
85484
86144
  try {
85485
- fs33.writeFileSync(path61.join(admin.path, FANOUT_TOKEN_FILE), `${token}
86145
+ fs33.writeFileSync(path62.join(admin.path, FANOUT_TOKEN_FILE), `${token}
85486
86146
  `);
85487
86147
  } catch {
85488
86148
  return null;
@@ -85497,7 +86157,7 @@ function excludeScratch(cwd) {
85497
86157
  const common = gitCommonDir(cwd);
85498
86158
  if (!common)
85499
86159
  return;
85500
- const file = path61.join(common, "info", "exclude");
86160
+ const file = path62.join(common, "info", "exclude");
85501
86161
  let text = "";
85502
86162
  try {
85503
86163
  text = fs33.readFileSync(file, "utf8");
@@ -85506,7 +86166,7 @@ function excludeScratch(cwd) {
85506
86166
  }
85507
86167
  if (text.split(/\r?\n/u).includes(EXCLUDE_LINE))
85508
86168
  return;
85509
- fs33.mkdirSync(path61.dirname(file), { recursive: true });
86169
+ fs33.mkdirSync(path62.dirname(file), { recursive: true });
85510
86170
  fs33.appendFileSync(file, `${text && !text.endsWith(`
85511
86171
  `) ? `
85512
86172
  ` : ""}# workit fanout: per-worker scratch dirs
@@ -85514,7 +86174,7 @@ ${EXCLUDE_LINE}
85514
86174
  `);
85515
86175
  }
85516
86176
  function ensureScratch(worktree) {
85517
- const scratch = path61.join(worktree, SCRATCH_DIR);
86177
+ const scratch = path62.join(worktree, SCRATCH_DIR);
85518
86178
  fs33.mkdirSync(scratch, { recursive: true });
85519
86179
  return scratch;
85520
86180
  }
@@ -85742,7 +86402,7 @@ function unpushedCount(cwd, branch) {
85742
86402
  return count.ok ? Number(count.stdout.trim()) : null;
85743
86403
  }
85744
86404
  function removeScratch(worktree) {
85745
- const scratch = path61.join(worktree, SCRATCH_DIR);
86405
+ const scratch = path62.join(worktree, SCRATCH_DIR);
85746
86406
  let stat;
85747
86407
  try {
85748
86408
  stat = fs33.lstatSync(scratch);
@@ -85758,16 +86418,16 @@ var SLOW, SCRATCH_DIR = ".workit-scratch", EXCLUDE_LINE, DIRTY_ROW_BYTES = 2000,
85758
86418
  try {
85759
86419
  return fs33.realpathSync.native(target);
85760
86420
  } catch {
85761
- return path61.resolve(target);
86421
+ return path62.resolve(target);
85762
86422
  }
85763
86423
  }, samePath = (a, b) => {
85764
86424
  const left = canonical2(a);
85765
86425
  const right = canonical2(b);
85766
86426
  return process.platform === "win32" || process.platform === "darwin" ? left.toLowerCase() === right.toLowerCase() : left === right;
85767
86427
  }, inside3 = (child, parent) => {
85768
- const relative = path61.relative(canonical2(parent), canonical2(child));
85769
- return relative === "" || !relative.startsWith("..") && !path61.isAbsolute(relative);
85770
- }, slicePath = (cwd, slice) => path61.isAbsolute(slice.worktree) ? slice.worktree : path61.resolve(mainCheckout(cwd), slice.worktree), CLOCK_SLACK_MS = 2000, worktreeDeps, worktreeFailed = (stderr) => fanoutFail("failed", `git worktree add failed: ${stderr.trim().split(`
86428
+ const relative = path62.relative(canonical2(parent), canonical2(child));
86429
+ return relative === "" || !relative.startsWith("..") && !path62.isAbsolute(relative);
86430
+ }, slicePath = (cwd, slice) => path62.isAbsolute(slice.worktree) ? slice.worktree : path62.resolve(mainCheckout(cwd), slice.worktree), CLOCK_SLACK_MS = 2000, worktreeDeps, worktreeFailed = (stderr) => fanoutFail("failed", `git worktree add failed: ${stderr.trim().split(`
85771
86431
  `)[0] || "unknown error"}`);
85772
86432
  var init_fanout_worktree = __esm(() => {
85773
86433
  init_ops();
@@ -86603,7 +87263,7 @@ __export(exports_fanout, {
86603
87263
  run: () => run20
86604
87264
  });
86605
87265
  import fs34 from "node:fs";
86606
- import path62 from "node:path";
87266
+ import path63 from "node:path";
86607
87267
  function forgeFor(io, offline) {
86608
87268
  if (offline)
86609
87269
  return { forge: null, error: "--offline" };
@@ -86664,7 +87324,7 @@ function plan2(argv, io) {
86664
87324
  return usage3(io, "pass --trunk or --track, not both (--track picks the trunk)", PLAN_USAGE2);
86665
87325
  if (flags.positionals.length !== 1)
86666
87326
  return usage3(io, flags.positionals.length ? `unexpected argument ${flags.positionals[1]}` : "missing <plan.json>", PLAN_USAGE2);
86667
- const file = path62.resolve(io.cwd, flags.positionals[0]);
87327
+ const file = path63.resolve(io.cwd, flags.positionals[0]);
86668
87328
  let raw;
86669
87329
  try {
86670
87330
  raw = JSON.parse(fs34.readFileSync(file, "utf8"));
@@ -102203,7 +102863,7 @@ var init_ast = __esm(() => {
102203
102863
 
102204
102864
  // packages/workit-cli/src/test-audit/rules.ts
102205
102865
  import { builtinModules } from "node:module";
102206
- import path63 from "node:path";
102866
+ import path64 from "node:path";
102207
102867
  function testCallee(call) {
102208
102868
  let callee = call.callee;
102209
102869
  if (callee.type === "CallExpression")
@@ -102696,12 +103356,12 @@ function checkConstantsOnly(ctx, emit) {
102696
103356
  }
102697
103357
  function checkOverMocking(ctx, emit) {
102698
103358
  const { program } = ctx.parsed;
102699
- const unit = path63.basename(ctx.file).replace(/\.(?:[cm]?[jt]sx?)$/, "").replace(/\.(?:test|spec)$/, "");
103359
+ const unit = path64.basename(ctx.file).replace(/\.(?:[cm]?[jt]sx?)$/, "").replace(/\.(?:test|spec)$/, "");
102700
103360
  const mocked = find2(program, (node) => node.type === "CallExpression" && MODULE_MOCK.test(calleeName(node.callee) ?? "") && node.arguments[0]?.type === "StringLiteral");
102701
103361
  const internal = mocked.filter((call) => /^(?:\.|@\/|~\/)/.test(call.arguments[0].value));
102702
103362
  for (const call of mocked) {
102703
103363
  const spec = call.arguments[0].value;
102704
- const base = path63.basename(spec.replace(/\/index(?:\.[cm]?[jt]sx?)?$/, "")).replace(/\.(?:[cm]?[jt]sx?)$/, "");
103364
+ const base = path64.basename(spec.replace(/\/index(?:\.[cm]?[jt]sx?)?$/, "")).replace(/\.(?:[cm]?[jt]sx?)$/, "");
102705
103365
  if (base === unit)
102706
103366
  emit({
102707
103367
  rule: "over-mocking",
@@ -103090,8 +103750,8 @@ var init_rules = __esm(() => {
103090
103750
 
103091
103751
  // packages/workit-cli/src/test-audit/audit.ts
103092
103752
  import { spawnSync as spawnSync29 } from "node:child_process";
103093
- import { existsSync as existsSync22, readdirSync as readdirSync10, readFileSync as readFileSync25, statSync as statSync9 } from "node:fs";
103094
- import path64 from "node:path";
103753
+ import { existsSync as existsSync23, readdirSync as readdirSync11, readFileSync as readFileSync26, statSync as statSync10 } from "node:fs";
103754
+ import path65 from "node:path";
103095
103755
  function git7(cwd, args) {
103096
103756
  const run = spawnSync29("git", ["-c", "core.quotepath=off", ...args], {
103097
103757
  cwd,
@@ -103101,10 +103761,10 @@ function git7(cwd, args) {
103101
103761
  return { ok: run.status === 0, stdout: run.stdout ?? "" };
103102
103762
  }
103103
103763
  function walkTests(dir, out) {
103104
- for (const entry of readdirSync10(dir, { withFileTypes: true })) {
103764
+ for (const entry of readdirSync11(dir, { withFileTypes: true })) {
103105
103765
  if (entry.name.startsWith(".") && entry.name !== "." && entry.isDirectory())
103106
103766
  continue;
103107
- const full = path64.join(dir, entry.name);
103767
+ const full = path65.join(dir, entry.name);
103108
103768
  if (entry.isDirectory()) {
103109
103769
  if (!SKIP_DIRS.has(entry.name))
103110
103770
  walkTests(full, out);
@@ -103116,10 +103776,10 @@ function expandPaths(cwd, inputs) {
103116
103776
  const files = [];
103117
103777
  const missing = [];
103118
103778
  for (const input of inputs.length > 0 ? inputs : ["."]) {
103119
- const full = path64.resolve(cwd, input);
103120
- if (!existsSync22(full))
103779
+ const full = path65.resolve(cwd, input);
103780
+ if (!existsSync23(full))
103121
103781
  missing.push(input);
103122
- else if (statSync9(full).isDirectory())
103782
+ else if (statSync10(full).isDirectory())
103123
103783
  walkTests(full, files);
103124
103784
  else
103125
103785
  files.push(full);
@@ -103153,11 +103813,11 @@ function changedLines(cwd, base) {
103153
103813
  for (let offset = 0;offset < count; offset += 1)
103154
103814
  lines.add(start + offset);
103155
103815
  }
103156
- changed.set(path64.join(root, file), lines);
103816
+ changed.set(path65.join(root, file), lines);
103157
103817
  }
103158
103818
  const untracked = git7(root, ["ls-files", "--others", "--exclude-standard", "-z"]);
103159
103819
  for (const file of untracked.stdout.split("\x00").filter(Boolean))
103160
- changed.set(path64.join(root, file), "all");
103820
+ changed.set(path65.join(root, file), "all");
103161
103821
  return changed;
103162
103822
  }
103163
103823
  function auditFiles(files, display) {
@@ -103170,7 +103830,7 @@ function auditFiles(files, display) {
103170
103830
  const shown = display(file);
103171
103831
  let parsed;
103172
103832
  try {
103173
- parsed = parseSource(readFileSync25(file, "utf8"), file);
103833
+ parsed = parseSource(readFileSync26(file, "utf8"), file);
103174
103834
  } catch (error) {
103175
103835
  parseErrors.push({
103176
103836
  file: shown,
@@ -103219,7 +103879,7 @@ function auditFiles(files, display) {
103219
103879
  durationMs: Math.round(performance.now() - started)
103220
103880
  };
103221
103881
  }
103222
- var TEST_FILE, CODE_FILE, SKIP_DIRS, toPosix = (file) => file.split(path64.sep).join("/"), SEVERITY_ORDER, ruleIds;
103882
+ var TEST_FILE, CODE_FILE, SKIP_DIRS, toPosix = (file) => file.split(path65.sep).join("/"), SEVERITY_ORDER, ruleIds;
103223
103883
  var init_audit = __esm(() => {
103224
103884
  init_ast();
103225
103885
  init_rules();
@@ -103233,23 +103893,23 @@ var init_audit = __esm(() => {
103233
103893
  // packages/workit-cli/src/test-audit/mutate.ts
103234
103894
  import { spawn as spawn2 } from "node:child_process";
103235
103895
  import {
103236
- existsSync as existsSync23,
103896
+ existsSync as existsSync24,
103237
103897
  lstatSync as lstatSync8,
103238
103898
  mkdirSync as mkdirSync11,
103239
103899
  mkdtempSync as mkdtempSync4,
103240
- readdirSync as readdirSync11,
103241
- readFileSync as readFileSync26,
103900
+ readdirSync as readdirSync12,
103901
+ readFileSync as readFileSync27,
103242
103902
  readlinkSync as readlinkSync3,
103243
103903
  realpathSync as realpathSync10,
103244
103904
  renameSync as renameSync7,
103245
103905
  rmSync as rmSync9,
103246
- statSync as statSync10,
103906
+ statSync as statSync11,
103247
103907
  symlinkSync,
103248
103908
  writeFileSync as writeFileSync11,
103249
103909
  copyFileSync as copyFileSync7
103250
103910
  } from "node:fs";
103251
- import os20 from "node:os";
103252
- import path65 from "node:path";
103911
+ import os22 from "node:os";
103912
+ import path66 from "node:path";
103253
103913
  function mutantsFor(source, file, lines) {
103254
103914
  const parsed = parseSource(source, file);
103255
103915
  const out = [];
@@ -103322,7 +103982,7 @@ function relatedTests(source, testFiles) {
103322
103982
  for (const match of text.matchAll(SPECIFIER)) {
103323
103983
  const spec = match[1];
103324
103984
  if (spec.startsWith(".")) {
103325
- if (stripExt(path65.posix.join(path65.posix.dirname(file), spec)) === target)
103985
+ if (stripExt(path66.posix.join(path66.posix.dirname(file), spec)) === target)
103326
103986
  return true;
103327
103987
  } else if (spec.includes("/") && stripExt(spec).split("/").slice(-2).join("/") === tail)
103328
103988
  return true;
@@ -103330,11 +103990,11 @@ function relatedTests(source, testFiles) {
103330
103990
  return false;
103331
103991
  }).map((entry) => entry.file);
103332
103992
  }
103333
- function removeStaleCopies(tmp = os20.tmpdir()) {
103993
+ function removeStaleCopies(tmp = os22.tmpdir()) {
103334
103994
  let removed = 0;
103335
103995
  let names = [];
103336
103996
  try {
103337
- names = readdirSync11(tmp);
103997
+ names = readdirSync12(tmp);
103338
103998
  } catch {
103339
103999
  return 0;
103340
104000
  }
@@ -103342,12 +104002,12 @@ function removeStaleCopies(tmp = os20.tmpdir()) {
103342
104002
  for (const name of names) {
103343
104003
  if (!name.startsWith(TEMP_PREFIX))
103344
104004
  continue;
103345
- const dir = path65.join(tmp, name);
104005
+ const dir = path66.join(tmp, name);
103346
104006
  try {
103347
104007
  const stat = lstatSync8(dir);
103348
104008
  if (!stat.isDirectory() || uid !== undefined && stat.uid !== uid)
103349
104009
  continue;
103350
- const pid = Number(readFileSync26(path65.join(dir, PID_FILE), "utf8"));
104010
+ const pid = Number(readFileSync27(path66.join(dir, PID_FILE), "utf8"));
103351
104011
  if (Number.isInteger(pid) && pid > 0 && alive(pid))
103352
104012
  continue;
103353
104013
  } catch (error) {
@@ -103363,9 +104023,9 @@ function removeStaleCopies(tmp = os20.tmpdir()) {
103363
104023
  }
103364
104024
  function linkNodeModules(origin, target, repo, copy) {
103365
104025
  mkdirSync11(target, { recursive: true });
103366
- for (const entry of readdirSync11(origin, { withFileTypes: true })) {
103367
- const from = path65.join(origin, entry.name);
103368
- const to = path65.join(target, entry.name);
104026
+ for (const entry of readdirSync12(origin, { withFileTypes: true })) {
104027
+ const from = path66.join(origin, entry.name);
104028
+ const to = path66.join(target, entry.name);
103369
104029
  if (entry.name.startsWith("@") && entry.isDirectory()) {
103370
104030
  linkNodeModules(from, to, repo, copy);
103371
104031
  continue;
@@ -103381,9 +104041,9 @@ function linkNodeModules(origin, target, repo, copy) {
103381
104041
  } catch {
103382
104042
  continue;
103383
104043
  }
103384
- const relative = path65.relative(repo, real);
103385
- if (!relative.startsWith("..") && !path65.isAbsolute(relative) && !relative.split(path65.sep).includes("node_modules")) {
103386
- symlinkSync(path65.join(copy, relative), to, "junction");
104044
+ const relative = path66.relative(repo, real);
104045
+ if (!relative.startsWith("..") && !path66.isAbsolute(relative) && !relative.split(path66.sep).includes("node_modules")) {
104046
+ symlinkSync(path66.join(copy, relative), to, "junction");
103387
104047
  continue;
103388
104048
  }
103389
104049
  }
@@ -103399,19 +104059,19 @@ function copySymlink(repo, tree, from, to) {
103399
104059
  }
103400
104060
  const realRepo = realpathSync10(repo);
103401
104061
  if (real && inside4(realRepo, real)) {
103402
- symlinkSync(path65.relative(path65.dirname(to), path65.join(tree, path65.relative(realRepo, real))), to);
104062
+ symlinkSync(path66.relative(path66.dirname(to), path66.join(tree, path66.relative(realRepo, real))), to);
103403
104063
  return;
103404
104064
  }
103405
- if (real && statSync10(real).isFile())
104065
+ if (real && statSync11(real).isFile())
103406
104066
  copyFileSync7(real, to);
103407
104067
  else
103408
104068
  symlinkSync(readlinkSync3(from), to);
103409
104069
  }
103410
104070
  function writeInside(copy, file, content) {
103411
- const target = path65.join(copy, file);
104071
+ const target = path66.join(copy, file);
103412
104072
  try {
103413
104073
  const stat = lstatSync8(target);
103414
- if (!stat.isFile() || !inside4(realpathSync10(copy), realpathSync10(path65.dirname(target))))
104074
+ if (!stat.isFile() || !inside4(realpathSync10(copy), realpathSync10(path66.dirname(target))))
103415
104075
  return false;
103416
104076
  } catch {
103417
104077
  return false;
@@ -103422,9 +104082,9 @@ function writeInside(copy, file, content) {
103422
104082
  return true;
103423
104083
  }
103424
104084
  function copyWorkingTree(repo) {
103425
- const dir = mkdtempSync4(path65.join(os20.tmpdir(), TEMP_PREFIX));
103426
- writeFileSync11(path65.join(dir, PID_FILE), String(process.pid));
103427
- const tree = path65.join(dir, "tree");
104085
+ const dir = mkdtempSync4(path66.join(os22.tmpdir(), TEMP_PREFIX));
104086
+ writeFileSync11(path66.join(dir, PID_FILE), String(process.pid));
104087
+ const tree = path66.join(dir, "tree");
103428
104088
  const head = git7(repo, ["rev-parse", "--verify", "--quiet", "HEAD"]).stdout.trim();
103429
104089
  if (head && git7(dir, ["clone", "-q", "--shared", "--no-checkout", repo, tree]).ok) {
103430
104090
  const branch = git7(repo, ["symbolic-ref", "--quiet", "--short", "HEAD"]).stdout.trim();
@@ -103441,29 +104101,29 @@ function copyWorkingTree(repo) {
103441
104101
  for (const relative of listed) {
103442
104102
  if (!relative)
103443
104103
  continue;
103444
- const from = path65.join(repo, relative);
104104
+ const from = path66.join(repo, relative);
103445
104105
  let stat;
103446
104106
  try {
103447
104107
  stat = lstatSync8(from);
103448
104108
  } catch {
103449
104109
  continue;
103450
104110
  }
103451
- const to = path65.join(tree, relative);
103452
- mkdirSync11(path65.dirname(to), { recursive: true });
104111
+ const to = path66.join(tree, relative);
104112
+ mkdirSync11(path66.dirname(to), { recursive: true });
103453
104113
  if (stat.isSymbolicLink())
103454
104114
  copySymlink(repo, tree, from, to);
103455
104115
  else if (stat.isFile())
103456
104116
  copyFileSync7(from, to);
103457
- let parent = path65.dirname(relative);
104117
+ let parent = path66.dirname(relative);
103458
104118
  while (parent !== "." && !dirs.has(parent)) {
103459
104119
  dirs.add(parent);
103460
- parent = path65.dirname(parent);
104120
+ parent = path66.dirname(parent);
103461
104121
  }
103462
104122
  }
103463
104123
  for (const parent of dirs) {
103464
- const modules = path65.join(repo, parent, "node_modules");
103465
- if (existsSync23(modules) && !existsSync23(path65.join(tree, parent, "node_modules")))
103466
- linkNodeModules(modules, path65.join(tree, parent, "node_modules"), repo, tree);
104124
+ const modules = path66.join(repo, parent, "node_modules");
104125
+ if (existsSync24(modules) && !existsSync24(path66.join(tree, parent, "node_modules")))
104126
+ linkNodeModules(modules, path66.join(tree, parent, "node_modules"), repo, tree);
103467
104127
  }
103468
104128
  return { dir, tree };
103469
104129
  }
@@ -103502,20 +104162,20 @@ async function runMutation(options) {
103502
104162
  const tracked = git7(repo, ["ls-files", "-co", "--exclude-standard", "-z"]).stdout.split("\x00").filter(Boolean);
103503
104163
  const testFiles = tracked.filter((file) => TEST_FILE.test(file)).map((file) => {
103504
104164
  try {
103505
- return { file, text: readFileSync26(path65.join(repo, file), "utf8") };
104165
+ return { file, text: readFileSync27(path66.join(repo, file), "utf8") };
103506
104166
  } catch {
103507
104167
  return { file, text: "" };
103508
104168
  }
103509
104169
  });
103510
104170
  const candidates = [];
103511
104171
  for (const [absolute, lines] of [...options.changed].toSorted(([a], [b]) => a.localeCompare(b))) {
103512
- const relative = toPosix(path65.relative(repo, absolute));
104172
+ const relative = toPosix(path66.relative(repo, absolute));
103513
104173
  if (!CODE_FILE.test(relative) || TEST_FILE.test(relative) || relative.endsWith(".d.ts"))
103514
104174
  continue;
103515
- if (NOT_SOURCE.test(relative) || !existsSync23(absolute))
104175
+ if (NOT_SOURCE.test(relative) || !existsSync24(absolute))
103516
104176
  continue;
103517
104177
  try {
103518
- candidates.push(...mutantsFor(readFileSync26(absolute, "utf8"), relative, lines));
104178
+ candidates.push(...mutantsFor(readFileSync27(absolute, "utf8"), relative, lines));
103519
104179
  } catch {}
103520
104180
  }
103521
104181
  const mutants = candidates.map((mutant, index) => ({ ...mutant, id: index + 1 }));
@@ -103523,9 +104183,9 @@ async function runMutation(options) {
103523
104183
  for (const mutant of mutants)
103524
104184
  if (!related.has(mutant.file))
103525
104185
  related.set(mutant.file, relatedTests(mutant.file, testFiles));
103526
- const cwdRelative = path65.relative(repo, options.cwd);
104186
+ const cwdRelative = path66.relative(repo, options.cwd);
103527
104187
  const asArg = (file) => {
103528
- const relative = toPosix(path65.relative(cwdRelative, file));
104188
+ const relative = toPosix(path66.relative(cwdRelative, file));
103529
104189
  return shellQuote(relative.startsWith(".") ? relative : `./${relative}`);
103530
104190
  };
103531
104191
  const commandFor = (tests) => options.command.replaceAll("{files}", () => tests.map(asArg).join(" "));
@@ -103561,7 +104221,7 @@ async function runMutation(options) {
103561
104221
  return finish3(options, 0, results, counts, started);
103562
104222
  removeStaleCopies();
103563
104223
  const { dir: copyDir, tree: copy } = copyWorkingTree(repo);
103564
- const copyCwd = path65.join(copy, cwdRelative);
104224
+ const copyCwd = path66.join(copy, cwdRelative);
103565
104225
  let current = null;
103566
104226
  const restore = () => {
103567
104227
  if (current)
@@ -103596,7 +104256,7 @@ async function runMutation(options) {
103596
104256
  record({ ...mutant, status: "skipped", durationMs: 0, tests, reason: "budget" });
103597
104257
  continue;
103598
104258
  }
103599
- const original = readFileSync26(path65.join(copy, mutant.file), "utf8");
104259
+ const original = readFileSync27(path66.join(copy, mutant.file), "utf8");
103600
104260
  const mutated = original.slice(0, mutant.start) + mutant.replacement + original.slice(mutant.end);
103601
104261
  current = { file: mutant.file, original };
103602
104262
  if (!writeInside(copy, mutant.file, mutated)) {
@@ -103653,8 +104313,8 @@ var NOT_SOURCE, FLIPS, isStringy = (node) => node.type === "StringLiteral" || no
103653
104313
  return error.code === "EPERM";
103654
104314
  }
103655
104315
  }, inside4 = (root, file) => {
103656
- const relative = path65.relative(root, file);
103657
- return relative === "" || !relative.startsWith("..") && !path65.isAbsolute(relative);
104316
+ const relative = path66.relative(root, file);
104317
+ return relative === "" || !relative.startsWith("..") && !path66.isAbsolute(relative);
103658
104318
  }, active, killTree = (child) => {
103659
104319
  try {
103660
104320
  if (child.pid && process.platform !== "win32")
@@ -103702,8 +104362,8 @@ var exports_test_audit = {};
103702
104362
  __export(exports_test_audit, {
103703
104363
  run: () => run22
103704
104364
  });
103705
- import { existsSync as existsSync24 } from "node:fs";
103706
- import path66 from "node:path";
104365
+ import { existsSync as existsSync25 } from "node:fs";
104366
+ import path67 from "node:path";
103707
104367
  function parse8(argv) {
103708
104368
  const options = {
103709
104369
  paths: [],
@@ -103808,8 +104468,8 @@ async function run22(argv, io) {
103808
104468
  return emit(io, fail2("invalid_input", `${options}
103809
104469
  usage: ${USAGE14}`));
103810
104470
  const top = git7(io.cwd, ["rev-parse", "--show-toplevel"]);
103811
- const repo = top.ok ? path66.resolve(top.stdout.trim()) : null;
103812
- const display = (file) => toPosix(path66.relative(io.cwd, file) || file);
104471
+ const repo = top.ok ? path67.resolve(top.stdout.trim()) : null;
104472
+ const display = (file) => toPosix(path67.relative(io.cwd, file) || file);
103813
104473
  let base = null;
103814
104474
  let changed = null;
103815
104475
  if (options.diff || options.mutate) {
@@ -103826,7 +104486,7 @@ usage: ${USAGE14}`));
103826
104486
  }
103827
104487
  let files;
103828
104488
  if (options.diff && changed)
103829
- files = [...changed.keys()].filter((file) => TEST_FILE.test(toPosix(file)) && existsSync24(file)).toSorted();
104489
+ files = [...changed.keys()].filter((file) => TEST_FILE.test(toPosix(file)) && existsSync25(file)).toSorted();
103830
104490
  else {
103831
104491
  const expanded = expandPaths(io.cwd, options.paths);
103832
104492
  if (expanded.missing.length > 0)
@@ -103947,8 +104607,8 @@ var exports_youtrack = {};
103947
104607
  __export(exports_youtrack, {
103948
104608
  run: () => run24
103949
104609
  });
103950
- import { readFileSync as readFileSync27 } from "node:fs";
103951
- import path67 from "node:path";
104610
+ import { readFileSync as readFileSync28 } from "node:fs";
104611
+ import path68 from "node:path";
103952
104612
  async function run24(argv, io) {
103953
104613
  const [sub, ...rest] = argv;
103954
104614
  if (sub !== "note" && sub !== "time" && sub !== "meeting")
@@ -103994,7 +104654,7 @@ async function run24(argv, io) {
103994
104654
  let markdown = flags.values.markdown ?? "";
103995
104655
  if (flags.values.file)
103996
104656
  try {
103997
- markdown = readFileSync27(path67.resolve(io.cwd, flags.values.file), "utf8");
104657
+ markdown = readFileSync28(path68.resolve(io.cwd, flags.values.file), "utf8");
103998
104658
  } catch (error) {
103999
104659
  return usage3(io, `cannot read ${flags.values.file}: ${String(error)}`, USAGE16);
104000
104660
  }
@@ -104062,8 +104722,8 @@ var exports_changelog = {};
104062
104722
  __export(exports_changelog, {
104063
104723
  run: () => run25
104064
104724
  });
104065
- import { readFileSync as readFileSync28 } from "node:fs";
104066
- import path68 from "node:path";
104725
+ import { readFileSync as readFileSync29 } from "node:fs";
104726
+ import path69 from "node:path";
104067
104727
  async function run25(argv, io) {
104068
104728
  const [sub, ...rest] = argv;
104069
104729
  if (sub !== "apply")
@@ -104109,7 +104769,7 @@ async function run25(argv, io) {
104109
104769
  ]);
104110
104770
  }
104111
104771
  var USAGE17 = "workit changelog apply (--entries <JSON|@file|-> | --normalize-only) [--path CHANGELOG.md] [--preview]", readEntries = (raw, cwd) => {
104112
- const text = raw === "-" ? readFileSync28(0, "utf8") : raw.startsWith("@") ? readFileSync28(path68.resolve(cwd, raw.slice(1)), "utf8") : raw;
104772
+ const text = raw === "-" ? readFileSync29(0, "utf8") : raw.startsWith("@") ? readFileSync29(path69.resolve(cwd, raw.slice(1)), "utf8") : raw;
104113
104773
  return JSON.parse(text);
104114
104774
  };
104115
104775
  var init_changelog2 = __esm(() => {
@@ -104206,7 +104866,7 @@ var init_handoff = __esm(() => {
104206
104866
  // packages/workit-cli/src/main.ts
104207
104867
  init_host_session();
104208
104868
  init_package();
104209
- import path69 from "node:path";
104869
+ import path70 from "node:path";
104210
104870
 
104211
104871
  // packages/workit-cli/src/verbs/registry.ts
104212
104872
  var TASK_FAMILY_NAMES = [
@@ -104451,7 +105111,7 @@ var VERBS = [
104451
105111
  subcommands: [
104452
105112
  {
104453
105113
  name: "show",
104454
- usage: "workit models show [--role <role>] [--tier <mundane|standard|hard>] [--host <host>] [--json]",
105114
+ usage: "workit models show [--role <role>] [--tier <mundane|standard|hard>] [--host <host>] [--report [--days <n>]] [--json]",
104455
105115
  summary: "Print the resolved model and effort per role for a host (default: the lead's host, else claude_code) and where each came from"
104456
105116
  }
104457
105117
  ],
@@ -105068,7 +105728,7 @@ var defaultIo = (json) => ({
105068
105728
  });
105069
105729
  async function main(argv, overrides = {}, options = {}) {
105070
105730
  const parsed = parseGlobals(argv);
105071
- const cwd = path69.resolve(overrides.cwd ?? process.cwd(), parsed.cwd ?? ".");
105731
+ const cwd = path70.resolve(overrides.cwd ?? process.cwd(), parsed.cwd ?? ".");
105072
105732
  const io = { ...defaultIo(parsed.json), ...overrides, json: parsed.json, cwd };
105073
105733
  if (parsed.error)
105074
105734
  return emit(io, fail2("invalid_input", parsed.error));