@brainervirus/workit-core 0.8.6 → 0.8.7
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
|
@@ -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 --package=@brainervirus/workit-cursor@
|
|
6
|
+
exec npx -y --prefer-online --package=@brainervirus/workit-cursor@latest workit-cursor-mcp "$@"
|
package/src/core/doctor.ts
CHANGED
|
@@ -11,7 +11,7 @@ import path from "node:path";
|
|
|
11
11
|
import { SUPPORT_MATRIX } from "./support-matrix";
|
|
12
12
|
import { EVENT } from "./boundary";
|
|
13
13
|
import { getDiagnosticLogger, isConfigObject } from "./config";
|
|
14
|
-
import {
|
|
14
|
+
import { cursorHooksEntry, cursorMcpServerEntry, isWorkitPlugin } from "./registration";
|
|
15
15
|
import { resolveWorkspaceFrom } from "./workspaces";
|
|
16
16
|
import { validateCursorSkills } from "./skill-manifests";
|
|
17
17
|
|
|
@@ -418,12 +418,13 @@ const registeredCursorLauncher = (res: Resolved): CursorLauncher | null | "inval
|
|
|
418
418
|
const executable = path.basename(command).toLowerCase();
|
|
419
419
|
// CA-17: the canonical launcher runs the published package through npx; the
|
|
420
420
|
// offline doctor validates its shape (never the registry reachability).
|
|
421
|
+
// Exact positional tokens — a substring match would accept `@latest-alpha`
|
|
422
|
+
// or `workit-cursor-mcp-foo`, and any extra/missing token would weaken the
|
|
423
|
+
// freshness guarantee (`--prefer-online` is mandatory).
|
|
424
|
+
const canonical = cursorMcpServerEntry("").args;
|
|
421
425
|
if (executable === "npx" || executable === "npx.exe" || executable === "npx.cmd") {
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
if (args[0] !== "-y") return "invalid";
|
|
425
|
-
if (args[1] !== `--package=${CURSOR_RUNTIME_PACKAGE}`) return "invalid";
|
|
426
|
-
if (args[2] !== "workit-cursor-mcp") return "invalid";
|
|
426
|
+
if (args.length !== canonical.length || args.some((a, i) => a !== canonical[i]))
|
|
427
|
+
return "invalid";
|
|
427
428
|
return { kind: "npx" };
|
|
428
429
|
}
|
|
429
430
|
if (executable !== "node" && executable !== "node.exe") return "invalid";
|
package/src/core/flow-state.ts
CHANGED
|
@@ -696,7 +696,8 @@ const readCanonicalDigest = (root: string, rel: string): CanonicalDigestResult =
|
|
|
696
696
|
* Approval-integrity reconciliation (CA-02, CA-03): recompute approved
|
|
697
697
|
* document digests in spec-before-plan order and return the reset state plus
|
|
698
698
|
* the structured drift reasons. Spec drift resets the whole approval chain;
|
|
699
|
-
* plan drift (spec valid) preserves the spec approval and
|
|
699
|
+
* plan drift (spec valid) preserves the spec approval/digest and the execution
|
|
700
|
+
* lifecycle, resetting only the plan's approval digest.
|
|
700
701
|
*/
|
|
701
702
|
const resetForSpecDrift = (state: FlowState): FlowState => ({
|
|
702
703
|
...state,
|
|
@@ -711,9 +712,11 @@ const resetForSpecDrift = (state: FlowState): FlowState => ({
|
|
|
711
712
|
const resetForPlanDrift = (state: FlowState): FlowState => ({
|
|
712
713
|
...state,
|
|
713
714
|
plan: { ...state.plan, status: "draft", evidence: null, approved_digest: null },
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
715
|
+
// A plan edit resets only the plan's approval digest (fresh re-approval is
|
|
716
|
+
// required before any plan-gated transition). The execution lifecycle, the
|
|
717
|
+
// recorded menu choice, and the handoff context are lifecycle facts, not
|
|
718
|
+
// plan-approval facts: an in-progress or completed run must not be rewound
|
|
719
|
+
// to pending by a doc edit made during or after implementation.
|
|
717
720
|
updated_at: Date.now(),
|
|
718
721
|
});
|
|
719
722
|
|
package/src/core/registration.ts
CHANGED
|
@@ -180,11 +180,13 @@ export function mergeCursorHooks(
|
|
|
180
180
|
}
|
|
181
181
|
|
|
182
182
|
/**
|
|
183
|
-
* Canonical
|
|
184
|
-
* The single source for every source-derived Cursor
|
|
185
|
-
* committed manifests keep the literal (static data
|
|
183
|
+
* Canonical selector for the Cursor npm runtime: `@latest` with `--prefer-online`
|
|
184
|
+
* (README "Update review"). The single source for every source-derived Cursor
|
|
185
|
+
* runtime selector; the committed manifests keep the literal (static data
|
|
186
|
+
* cannot import TS). `--prefer-online` is mandatory — it forces npx to check
|
|
187
|
+
* the registry so a stale cached `latest` resolution is never reused.
|
|
186
188
|
*/
|
|
187
|
-
export const CURSOR_RUNTIME_PACKAGE = "@brainervirus/workit-cursor@
|
|
189
|
+
export const CURSOR_RUNTIME_PACKAGE = "@brainervirus/workit-cursor@latest";
|
|
188
190
|
|
|
189
191
|
/**
|
|
190
192
|
* Portable Cursor MCP server entry (CA-16/CA-17): launch the published package
|
|
@@ -197,7 +199,13 @@ export function cursorMcpServerEntry(_packageDir: string): {
|
|
|
197
199
|
} {
|
|
198
200
|
return {
|
|
199
201
|
command: "npx",
|
|
200
|
-
args: [
|
|
202
|
+
args: [
|
|
203
|
+
"-y",
|
|
204
|
+
"--prefer-online",
|
|
205
|
+
`--package=${CURSOR_RUNTIME_PACKAGE}`,
|
|
206
|
+
"workit-cursor-mcp",
|
|
207
|
+
"${workspaceFolder}",
|
|
208
|
+
],
|
|
201
209
|
};
|
|
202
210
|
}
|
|
203
211
|
|
|
@@ -210,7 +218,7 @@ export function cursorHooksEntry(_packageDir: string): {
|
|
|
210
218
|
args: string[];
|
|
211
219
|
} {
|
|
212
220
|
return {
|
|
213
|
-
command: `npx -y --package=${CURSOR_RUNTIME_PACKAGE} workit-cursor-session-start`,
|
|
221
|
+
command: `npx -y --prefer-online --package=${CURSOR_RUNTIME_PACKAGE} workit-cursor-session-start`,
|
|
214
222
|
args: [],
|
|
215
223
|
};
|
|
216
224
|
}
|