@brainervirus/workit-cli 0.8.0 → 0.8.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +31 -7
- package/package.json +4 -4
package/dist/index.js
CHANGED
|
@@ -42954,15 +42954,17 @@ function mergeCursorMcp(mcp, serverName, server) {
|
|
|
42954
42954
|
base2.mcpServers = servers;
|
|
42955
42955
|
return { config: base2, changed };
|
|
42956
42956
|
}
|
|
42957
|
+
var CURSOR_RUNTIME_PACKAGE = "@brainervirus/workit-cursor@0.8.0";
|
|
42957
42958
|
function cursorMcpServerEntry(_packageDir) {
|
|
42958
42959
|
return {
|
|
42959
42960
|
command: "npx",
|
|
42960
|
-
args: [
|
|
42961
|
-
|
|
42962
|
-
|
|
42963
|
-
|
|
42964
|
-
|
|
42965
|
-
|
|
42961
|
+
args: ["-y", `--package=${CURSOR_RUNTIME_PACKAGE}`, "workit-cursor-mcp", "${workspaceFolder}"]
|
|
42962
|
+
};
|
|
42963
|
+
}
|
|
42964
|
+
function cursorHooksEntry(_packageDir) {
|
|
42965
|
+
return {
|
|
42966
|
+
command: `npx -y --package=${CURSOR_RUNTIME_PACKAGE} workit-cursor-session-start`,
|
|
42967
|
+
args: []
|
|
42966
42968
|
};
|
|
42967
42969
|
}
|
|
42968
42970
|
|
|
@@ -43334,7 +43336,7 @@ var registeredCursorLauncher = (res) => {
|
|
|
43334
43336
|
if (executable === "npx" || executable === "npx.exe" || executable === "npx.cmd") {
|
|
43335
43337
|
if (args[0] !== "-y")
|
|
43336
43338
|
return "invalid";
|
|
43337
|
-
if (args[1] !==
|
|
43339
|
+
if (args[1] !== `--package=${CURSOR_RUNTIME_PACKAGE}`)
|
|
43338
43340
|
return "invalid";
|
|
43339
43341
|
if (args[2] !== "workit-cursor-mcp")
|
|
43340
43342
|
return "invalid";
|
|
@@ -43348,6 +43350,22 @@ var registeredCursorLauncher = (res) => {
|
|
|
43348
43350
|
entry: path8.isAbsolute(args[0]) ? args[0] : path8.resolve(path8.dirname(res.cursorMcp), args[0])
|
|
43349
43351
|
};
|
|
43350
43352
|
};
|
|
43353
|
+
var canonicalCursorHook = cursorHooksEntry("").command;
|
|
43354
|
+
var registeredCursorHook = (res) => {
|
|
43355
|
+
const hooksFile = path8.join(res.cursorPluginDir, "hooks", "hooks-cursor.json");
|
|
43356
|
+
if (!existsSync7(hooksFile))
|
|
43357
|
+
return "invalid";
|
|
43358
|
+
const config = readJson(hooksFile);
|
|
43359
|
+
if (!config)
|
|
43360
|
+
return "invalid";
|
|
43361
|
+
const sessionStart = config.hooks?.sessionStart;
|
|
43362
|
+
if (!Array.isArray(sessionStart) || sessionStart.length !== 1)
|
|
43363
|
+
return "invalid";
|
|
43364
|
+
const entry = sessionStart[0];
|
|
43365
|
+
if (typeof entry !== "object" || entry === null || Array.isArray(entry))
|
|
43366
|
+
return "invalid";
|
|
43367
|
+
return typeof entry.command === "string" ? entry.command : "invalid";
|
|
43368
|
+
};
|
|
43351
43369
|
var checkLauncher = (res) => {
|
|
43352
43370
|
const dev = res.dev;
|
|
43353
43371
|
const hosts = hostsFor(res.host);
|
|
@@ -43360,6 +43378,12 @@ var checkLauncher = (res) => {
|
|
|
43360
43378
|
} else if (registered && registered.kind === "node" && !validNodeEntry(registered.entry, registered.runtime, res.env)) {
|
|
43361
43379
|
missing.push(`cursor: registered ${registered.entry}`);
|
|
43362
43380
|
}
|
|
43381
|
+
const hook = registeredCursorHook(res);
|
|
43382
|
+
if (hook === "invalid") {
|
|
43383
|
+
missing.push(`cursor: canonical session-start hook in ${path8.join(res.cursorPluginDir, "hooks", "hooks-cursor.json")}`);
|
|
43384
|
+
} else if (hook !== null && hook !== canonicalCursorHook) {
|
|
43385
|
+
missing.push(`cursor: canonical session-start hook in ${path8.join(res.cursorPluginDir, "hooks", "hooks-cursor.json")} (registered ${hook})`);
|
|
43386
|
+
}
|
|
43363
43387
|
}
|
|
43364
43388
|
if (dev) {
|
|
43365
43389
|
missing.push(...hosts.filter((h) => h !== "cursor").flatMap((h) => launcherSlotsFor(h, dev).filter((slot) => !slot.some((p) => existsSync7(p))).map((slot) => `${h}: ${slot.join(" or ")}`)));
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@brainervirus/workit-cli",
|
|
3
|
-
"version": "0.8.
|
|
3
|
+
"version": "0.8.1",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "Workit interactive setup wizard (Ink TUI)",
|
|
6
6
|
"keywords": [
|
|
@@ -34,9 +34,9 @@
|
|
|
34
34
|
"typecheck": "tsc --noEmit"
|
|
35
35
|
},
|
|
36
36
|
"dependencies": {
|
|
37
|
-
"@brainervirus/workit-core": "^0.8.
|
|
38
|
-
"@brainervirus/workit-cursor": "^0.8.
|
|
39
|
-
"@brainervirus/workit-opencode": "^0.8.
|
|
37
|
+
"@brainervirus/workit-core": "^0.8.1",
|
|
38
|
+
"@brainervirus/workit-cursor": "^0.8.1",
|
|
39
|
+
"@brainervirus/workit-opencode": "^0.8.1",
|
|
40
40
|
"@inkjs/ui": "2.0.0",
|
|
41
41
|
"ink": "7.1.1",
|
|
42
42
|
"react": "19.2.8"
|