@clipboard-health/groundcrew 3.0.2 → 3.0.3

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.
@@ -1 +1 @@
1
- {"version":3,"file":"doctor.d.ts","sourceRoot":"","sources":["../../src/commands/doctor.ts"],"names":[],"mappings":"AAAA;;;GAGG;AA2BH,MAAM,WAAW,aAAa;IAC5B,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,mFAAmF;IACnF,UAAU,CAAC,EAAE,MAAM,EAAE,CAAC;CACvB;AAsHD,wBAAsB,MAAM,CAAC,OAAO,GAAE,aAAkB,GAAG,OAAO,CAAC,OAAO,CAAC,CAK1E"}
1
+ {"version":3,"file":"doctor.d.ts","sourceRoot":"","sources":["../../src/commands/doctor.ts"],"names":[],"mappings":"AAAA;;;GAGG;AA4BH,MAAM,WAAW,aAAa;IAC5B,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,mFAAmF;IACnF,UAAU,CAAC,EAAE,MAAM,EAAE,CAAC;CACvB;AAgHD,wBAAsB,MAAM,CAAC,OAAO,GAAE,aAAkB,GAAG,OAAO,CAAC,OAAO,CAAC,CAK1E"}
@@ -6,6 +6,7 @@ import { existsSync, statSync } from "node:fs";
6
6
  import { loadConfig, } from "../lib/config.js";
7
7
  import { detectHostCapabilities, which } from "../lib/host.js";
8
8
  import { resolveLocalRunner } from "../lib/localRunner.js";
9
+ import { gatedModels } from "../lib/usage.js";
9
10
  import { errorMessage, resolveLinearApiKey, writeOutput } from "../lib/util.js";
10
11
  import { resolveWorkspaceKind } from "../lib/workspaces.js";
11
12
  import { parseTicketDoctorFlags, runTicketDoctor } from "./ticketDoctor.js";
@@ -104,9 +105,6 @@ function gatherToolTokens(config) {
104
105
  }
105
106
  return [...all];
106
107
  }
107
- function anyModelUsesUsage(config) {
108
- return Object.values(config.models.definitions).some((definition) => definition.usage !== undefined);
109
- }
110
108
  function format(check) {
111
109
  let tag;
112
110
  if (check.ok) {
@@ -189,8 +187,21 @@ async function doctorHost() {
189
187
  const check = await checkCmd(token, required, required ? undefined : "required for local runs");
190
188
  checks.push(check);
191
189
  }
192
- if (anyModelUsesUsage(config)) {
193
- checks.push(await checkCmd("codexbar", false, "optional — only used for usage gating"));
190
+ const usageGatedModels = gatedModels(config);
191
+ if (usageGatedModels.length > 0) {
192
+ const codexbarPath = await which("codexbar");
193
+ if (codexbarPath === undefined) {
194
+ const modelList = usageGatedModels.map((name) => `\`${name}\``).join(", ");
195
+ checks.push({
196
+ name: "codexbar",
197
+ ok: false,
198
+ required: true,
199
+ hint: `required for usage gating on ${modelList} — install codexbar, or set \`models.definitions.<name>.usage\` to disable gating`,
200
+ });
201
+ }
202
+ else {
203
+ checks.push({ name: "codexbar", ok: true, required: true, hint: codexbarPath });
204
+ }
194
205
  }
195
206
  for (const check of checks) {
196
207
  if (check === localCapability) {
@@ -22,6 +22,7 @@ export type UsageByModel = Record<string, NormalizedUsage>;
22
22
  * exists to close.
23
23
  */
24
24
  export declare const EXHAUSTED_USAGE: NormalizedUsage;
25
+ export declare function gatedModels(config: ResolvedConfig): string[];
25
26
  export declare function getUsageByModel(config: ResolvedConfig, signal?: AbortSignal): Promise<UsageByModel>;
26
27
  export {};
27
28
  //# sourceMappingURL=usage.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"usage.d.ts","sourceRoot":"","sources":["../../src/lib/usage.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAGH,OAAO,KAAK,EAAmB,cAAc,EAAE,MAAM,aAAa,CAAC;AA+BnE,UAAU,eAAe;IACvB,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;IACvB,kBAAkB,EAAE,MAAM,GAAG,IAAI,CAAC;IAClC,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;IACtB,eAAe,EAAE,MAAM,GAAG,IAAI,CAAC;CAChC;AAED,MAAM,MAAM,YAAY,GAAG,MAAM,CAAC,MAAM,EAAE,eAAe,CAAC,CAAC;AAE3D;;;;;;;GAOG;AACH,eAAO,MAAM,eAAe,EAAE,eAK7B,CAAC;AAiHF,wBAAsB,eAAe,CACnC,MAAM,EAAE,cAAc,EACtB,MAAM,CAAC,EAAE,WAAW,GACnB,OAAO,CAAC,YAAY,CAAC,CA6BvB"}
1
+ {"version":3,"file":"usage.d.ts","sourceRoot":"","sources":["../../src/lib/usage.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAGH,OAAO,KAAK,EAAmB,cAAc,EAAE,MAAM,aAAa,CAAC;AA+BnE,UAAU,eAAe;IACvB,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;IACvB,kBAAkB,EAAE,MAAM,GAAG,IAAI,CAAC;IAClC,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;IACtB,eAAe,EAAE,MAAM,GAAG,IAAI,CAAC;CAChC;AAED,MAAM,MAAM,YAAY,GAAG,MAAM,CAAC,MAAM,EAAE,eAAe,CAAC,CAAC;AAE3D;;;;;;;GAOG;AACH,eAAO,MAAM,eAAe,EAAE,eAK7B,CAAC;AA2GF,wBAAgB,WAAW,CAAC,MAAM,EAAE,cAAc,GAAG,MAAM,EAAE,CAI5D;AAED,wBAAsB,eAAe,CACnC,MAAM,EAAE,cAAc,EACtB,MAAM,CAAC,EAAE,WAAW,GACnB,OAAO,CAAC,YAAY,CAAC,CA6BvB"}
package/dist/lib/usage.js CHANGED
@@ -111,7 +111,7 @@ function normalize(usage) {
111
111
  weekEndDuration: minutesUntil(usage.secondary?.resetsAt),
112
112
  };
113
113
  }
114
- function gatedModels(config) {
114
+ export function gatedModels(config) {
115
115
  return Object.entries(config.models.definitions)
116
116
  .filter(([, definition]) => definition.usage !== undefined)
117
117
  .map(([name]) => name);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@clipboard-health/groundcrew",
3
- "version": "3.0.2",
3
+ "version": "3.0.3",
4
4
  "description": "Linear-driven orchestrator that launches AI coding agents in git worktrees, with workspace lifecycle and usage tracking.",
5
5
  "keywords": [
6
6
  "agent",