@brainervirus/workit-core 1.0.6 → 1.0.8

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@brainervirus/workit-core",
3
- "version": "1.0.6",
3
+ "version": "1.0.8",
4
4
  "private": false,
5
5
  "description": "Workit shared core — task, policy, evidence, review, decision, worker, and writer state for agentic coding workflows",
6
6
  "keywords": [
@@ -3,4 +3,4 @@
3
3
  # Launch the published package's MCP bin through npx, never a repo-relative
4
4
  # dist or share clone; a startup/network failure surfaces via npx's nonzero exit.
5
5
  set -euo pipefail
6
- exec npx -y --prefer-online --package=@brainervirus/workit-cursor@latest workit-cursor-mcp "$@"
6
+ exec npx -y --prefer-online --min-release-age=0 --package=@brainervirus/workit-cursor@latest workit-cursor-mcp "$@"
@@ -1,11 +1,11 @@
1
1
  ---
2
2
  name: workit-babysit
3
- description: Use when a PR needs driving to merge-ready, CI is red, or the user says babysit
3
+ description: Use after creating a PR (auto-starts, drive default), when a PR needs driving to merge-ready, CI is red, or the user says babysit
4
4
  ---
5
5
 
6
6
  # Babysit a PR to merge-ready
7
7
 
8
- Babysit starts automatically on PR creation unless declined (`--no-babysit`).
8
+ Babysit starts automatically on PR creation unless declined (`babysit:false`).
9
9
  One babysitter per PR; never mutate PR topology (no rebase strategy changes,
10
10
  no force-push).
11
11
 
@@ -17,8 +17,11 @@ selects requirements; do not wait for a rule that can only exist after assess.
17
17
 
18
18
  ## Method
19
19
 
20
- 1. Declare mode: drive (fix + merge), watch (report only), or threads-only.
20
+ 1. Declare mode in the same turn as the PR URL: drive (fix + merge, the
21
+ default), watch (report only), or threads-only.
21
22
  2. Work the merge frontier in order: conflicts → review threads → CI.
23
+ Record a frontier brief (frontier state, next action) in task progress
24
+ per pass so the steps stay visible.
22
25
  3. Classify CI before retry: flake (rerun once) vs stale base (verify with
23
26
  `git merge-base --is-ancestor` before updating) vs real failure (fix).
24
27
  4. Triage bot findings skeptically: reproduce or quote code before acting;
@@ -235,8 +235,9 @@ export const detectCursorLatest = (cursorMcp: string): boolean => {
235
235
  return (
236
236
  server.args[0] === "-y" &&
237
237
  server.args[1] === "--prefer-online" &&
238
- server.args[2] === `--package=${CURSOR_RUNTIME_PACKAGE}` &&
239
- server.args[3] === "workit-cursor-mcp"
238
+ server.args[2] === "--min-release-age=0" &&
239
+ server.args[3] === `--package=${CURSOR_RUNTIME_PACKAGE}` &&
240
+ server.args[4] === "workit-cursor-mcp"
240
241
  );
241
242
  } catch {
242
243
  return false;
@@ -531,7 +531,8 @@ const registeredCursorLauncher = (res: Resolved): CursorLauncher | null | "inval
531
531
  // offline doctor validates its shape (never the registry reachability).
532
532
  // Exact positional tokens — a substring match would accept `@latest-alpha`
533
533
  // or `workit-cursor-mcp-foo`, and any extra/missing token would weaken the
534
- // freshness guarantee (`--prefer-online` is mandatory).
534
+ // freshness guarantee (`--prefer-online` and the npm release-age workaround
535
+ // are mandatory).
535
536
  const canonical = cursorMcpServerEntry("").args;
536
537
  if (executable === "npx" || executable === "npx.exe" || executable === "npx.cmd") {
537
538
  if (args.length !== canonical.length || args.some((a, i) => a !== canonical[i]))
@@ -820,7 +820,7 @@ export const resolveExternalActionRequest = (
820
820
  if (preview.error) return failure("invalid_input", preview.error);
821
821
  const target = String(preview.path);
822
822
  const relative =
823
- path.relative(path.resolve(root), target).replaceAll(path.sep, "/") || "CHANGELOG.md";
823
+ path.relative(fs.realpathSync(root), target).replaceAll(path.sep, "/") || "CHANGELOG.md";
824
824
  const normalized = {
825
825
  operation: request.operation,
826
826
  payload: {
@@ -937,6 +937,9 @@ export const resolveExternalActionRequest = (
937
937
  }
938
938
  };
939
939
 
940
+ export const prBabysitNext = (output: string): string =>
941
+ `Babysit ${output} to merge-ready (drive mode default). Follow skill workit-babysit: declare mode in this turn, work conflicts, review threads, then CI, and record a frontier brief in task progress per pass. Opt out with babysit:false.`;
942
+
940
943
  export const executeConcreteExternalAction = async (
941
944
  request: ExternalActionRequest,
942
945
  root: string,
@@ -1015,6 +1018,9 @@ export const executeConcreteExternalAction = async (
1015
1018
  ...result,
1016
1019
  babysit: request.payload.babysit ?? true,
1017
1020
  babysitSkill: "workit-babysit",
1021
+ ...((request.payload.babysit ?? true)
1022
+ ? { next: prBabysitNext(String((result as { output?: unknown }).output ?? "")) }
1023
+ : {}),
1018
1024
  });
1019
1025
  }
1020
1026
  case "changelog.apply": {
@@ -524,7 +524,7 @@ export async function runAuthorizedExternalAction<T>(
524
524
  (contract.details as Record<string, unknown>).outcome === "not_started";
525
525
  const outcome = input.failureOutcome ?? (preflight ? "not_started" : "unknown");
526
526
  const settled = settleWithRefresh(outcome, settle(outcome));
527
- if (!settled.ok && outcome === "unknown") return settled as ExternalActionResult<T>;
527
+ if (!settled.ok) return settled as ExternalActionResult<T>;
528
528
  return contract;
529
529
  }
530
530
  effectValue = contract.data;
@@ -206,8 +206,8 @@ export function mergeCursorHooks(
206
206
  * Canonical selector for the Cursor npm runtime: `@latest` with `--prefer-online`
207
207
  * (README "Update review"). The single source for every source-derived Cursor
208
208
  * runtime selector; the committed manifests keep the literal (static data
209
- * cannot import TS). `--prefer-online` is mandatory — it forces npx to check
210
- * the registry so a stale cached `latest` resolution is never reused.
209
+ * cannot import TS). `--min-release-age=0` works around npm/cli#9765, where
210
+ * npx ignores the user's scoped release-age exclusion.
211
211
  */
212
212
  export const CURSOR_RUNTIME_PACKAGE = "@brainervirus/workit-cursor@latest";
213
213
 
@@ -215,7 +215,7 @@ export const CURSOR_RUNTIME_PACKAGE = "@brainervirus/workit-cursor@latest";
215
215
  * Canonical Cursor hook launcher (single source of truth for the shipped
216
216
  * hooks-cursor.json, the installer merge, and the doctor drift check).
217
217
  */
218
- export const CURSOR_HOOK_RUN_COMMAND = `npx -y --prefer-online --package=${CURSOR_RUNTIME_PACKAGE} workit-cursor-hook`;
218
+ export const CURSOR_HOOK_RUN_COMMAND = `npx -y --prefer-online --min-release-age=0 --package=${CURSOR_RUNTIME_PACKAGE} workit-cursor-hook`;
219
219
 
220
220
  /**
221
221
  * preToolUse matcher covering every name the hook's write-tool guard treats
@@ -270,6 +270,7 @@ export function cursorMcpServerEntry(_packageDir: string): {
270
270
  args: [
271
271
  "-y",
272
272
  "--prefer-online",
273
+ "--min-release-age=0",
273
274
  `--package=${CURSOR_RUNTIME_PACKAGE}`,
274
275
  "workit-cursor-mcp",
275
276
  "${workspaceFolder}",
@@ -286,7 +287,7 @@ export function cursorHooksEntry(_packageDir: string): {
286
287
  args: string[];
287
288
  } {
288
289
  return {
289
- command: `npx -y --prefer-online --package=${CURSOR_RUNTIME_PACKAGE} workit-cursor-session-start`,
290
+ command: `npx -y --prefer-online --min-release-age=0 --package=${CURSOR_RUNTIME_PACKAGE} workit-cursor-session-start`,
290
291
  args: [],
291
292
  };
292
293
  }