@brainervirus/workit-cursor 8.1.1 → 8.3.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/.cursor-plugin/plugin.json +1 -1
- package/dist/cursor-session-start.js +798 -84
- package/dist/mcp-server.js +83 -4
- package/dist/workit-hook.js +799 -58
- package/package.json +3 -3
- package/skills/workit-ship/SKILL.md +14 -14
package/dist/mcp-server.js
CHANGED
|
@@ -18438,6 +18438,35 @@ function acquireFileLockSync(targetPath, options) {
|
|
|
18438
18438
|
}
|
|
18439
18439
|
}
|
|
18440
18440
|
}
|
|
18441
|
+
// packages/workit-core/src/host-session.ts
|
|
18442
|
+
var HOST_SESSION_VARS = [
|
|
18443
|
+
["OPENCODE_SESSION_ID", () => "opencode"],
|
|
18444
|
+
["PI_SESSION_ID", () => "pi"],
|
|
18445
|
+
[
|
|
18446
|
+
"CODEX_THREAD_ID",
|
|
18447
|
+
(env) => env.CODEX_INTERNAL_ORIGINATOR_OVERRIDE === "Codex Desktop" || env.CODEX_ELECTRON_RESOURCES_PATH ? "codex_desktop" : "codex_cli"
|
|
18448
|
+
]
|
|
18449
|
+
];
|
|
18450
|
+
var family = (host) => host?.replace(/_(?:cli|desktop)$/, "") ?? null;
|
|
18451
|
+
function hostSessionFromEnv(env) {
|
|
18452
|
+
const value = (key) => env[key]?.trim() || null;
|
|
18453
|
+
let inner = null;
|
|
18454
|
+
for (const [key, host] of HOST_SESSION_VARS) {
|
|
18455
|
+
const session = value(key);
|
|
18456
|
+
if (session) {
|
|
18457
|
+
inner = { host: host(env), session };
|
|
18458
|
+
break;
|
|
18459
|
+
}
|
|
18460
|
+
}
|
|
18461
|
+
const declared = value("WORKIT_HOST");
|
|
18462
|
+
if (env.WORKIT_SESSION_ID !== undefined) {
|
|
18463
|
+
const inherited = inner !== null && declared !== null && family(declared) !== family(inner.host);
|
|
18464
|
+
if (!inherited)
|
|
18465
|
+
return { host: declared, session: value("WORKIT_SESSION_ID") };
|
|
18466
|
+
}
|
|
18467
|
+
return inner ? { host: inner.host, session: inner.session } : { host: declared, session: null };
|
|
18468
|
+
}
|
|
18469
|
+
|
|
18441
18470
|
// packages/workit-core/src/core/package-root.ts
|
|
18442
18471
|
import { existsSync } from "node:fs";
|
|
18443
18472
|
import path3 from "node:path";
|
|
@@ -19402,9 +19431,10 @@ var drop = (lock) => {
|
|
|
19402
19431
|
};
|
|
19403
19432
|
var envActor = () => {
|
|
19404
19433
|
const value = (key) => process.env[key]?.trim() || null;
|
|
19434
|
+
const acting = hostSessionFromEnv(process.env);
|
|
19405
19435
|
return {
|
|
19406
|
-
host:
|
|
19407
|
-
session:
|
|
19436
|
+
host: acting.host ?? "runtime",
|
|
19437
|
+
session: acting.session,
|
|
19408
19438
|
agentId: value("WORKIT_AGENT_ID")
|
|
19409
19439
|
};
|
|
19410
19440
|
};
|
|
@@ -27511,8 +27541,51 @@ var cache = new Map;
|
|
|
27511
27541
|
var CASE_INSENSITIVE = process.platform === "darwin" || process.platform === "win32";
|
|
27512
27542
|
var PREFIXES2 = new Set(["sudo", "command", "env", "nohup", "time", "exec", "xargs"]);
|
|
27513
27543
|
var cache2 = new Map;
|
|
27544
|
+
// packages/workit-core/src/hooks/raw-git.ts
|
|
27545
|
+
var SHELLS = new Set(["sh", "bash", "zsh", "dash", "ksh"]);
|
|
27546
|
+
var PREFIXES3 = new Set(["sudo", "command", "env", "nohup", "time", "exec", "nice", "&"]);
|
|
27547
|
+
var CD = new Set(["cd", "chdir", "set-location", "sl"]);
|
|
27548
|
+
var PUSHD = new Set(["pushd", "push-location"]);
|
|
27549
|
+
var POPD = new Set(["popd", "pop-location"]);
|
|
27550
|
+
var GIT_VALUE_OPTIONS = new Set([
|
|
27551
|
+
"-c",
|
|
27552
|
+
"--git-dir",
|
|
27553
|
+
"--work-tree",
|
|
27554
|
+
"--namespace",
|
|
27555
|
+
"--exec-path",
|
|
27556
|
+
"--config-env",
|
|
27557
|
+
"--super-prefix"
|
|
27558
|
+
]);
|
|
27559
|
+
var PUSH_VALUE_OPTIONS = new Set(["-o", "--push-option", "--receive-pack", "--exec", "--repo"]);
|
|
27560
|
+
var VALUE_OPTIONS = {
|
|
27561
|
+
git: new Set([
|
|
27562
|
+
"-m",
|
|
27563
|
+
"--message",
|
|
27564
|
+
"-F",
|
|
27565
|
+
"--file",
|
|
27566
|
+
"-C",
|
|
27567
|
+
"-c",
|
|
27568
|
+
"--reuse-message",
|
|
27569
|
+
"--reedit-message",
|
|
27570
|
+
"--author",
|
|
27571
|
+
"--date",
|
|
27572
|
+
"--trailer",
|
|
27573
|
+
"-t",
|
|
27574
|
+
"--template",
|
|
27575
|
+
"--cleanup",
|
|
27576
|
+
"--fixup",
|
|
27577
|
+
"--squash",
|
|
27578
|
+
"-o",
|
|
27579
|
+
"--push-option",
|
|
27580
|
+
"--repo",
|
|
27581
|
+
"--receive-pack",
|
|
27582
|
+
"--exec"
|
|
27583
|
+
]),
|
|
27584
|
+
gh: new Set(["-b", "--body", "-F", "--body-file", "-t", "--title", "--subject", "-A", "--author-email"].concat(["-B", "--base", "-H", "--head", "-l", "--label", "-a", "--assignee"]).concat(["-r", "--reviewer", "-m", "--milestone", "-p", "--project", "-T", "--template"]).concat(["--match-head-commit", "-R", "--repo"])),
|
|
27585
|
+
glab: new Set(["-m", "--message", "--squash-message", "--sha", "-t", "--title", "-d", "--description"].concat(["-b", "--target-branch", "-s", "--source-branch", "-l", "--label"]).concat(["-a", "--assignee", "--reviewer", "-R", "--repo"]))
|
|
27586
|
+
};
|
|
27514
27587
|
// packages/workit-core/src/hooks/hosts/fields.ts
|
|
27515
|
-
var
|
|
27588
|
+
var SHELLS2 = new Set(["sh", "bash", "zsh", "dash", "pwsh", "powershell", "cmd"]);
|
|
27516
27589
|
var WRITE_TOOLS = new Set([
|
|
27517
27590
|
"write",
|
|
27518
27591
|
"edit",
|
|
@@ -27538,7 +27611,13 @@ var CLAUDE_JUDGES = new Set(["workit:verifier", "workit:reviewer"]);
|
|
|
27538
27611
|
// packages/workit-core/src/hooks/hosts/claude-code.ts
|
|
27539
27612
|
var SOURCES = new Set(["startup", "resume", "clear", "compact", "fork"]);
|
|
27540
27613
|
var SHELL_TOOLS = new Set(["Bash", "PowerShell"]);
|
|
27541
|
-
var CONTEXT_EVENTS = new Set([
|
|
27614
|
+
var CONTEXT_EVENTS = new Set([
|
|
27615
|
+
"SessionStart",
|
|
27616
|
+
"UserPromptSubmit",
|
|
27617
|
+
"SubagentStart",
|
|
27618
|
+
"PreToolUse",
|
|
27619
|
+
"PostToolUse"
|
|
27620
|
+
]);
|
|
27542
27621
|
|
|
27543
27622
|
// packages/workit-core/src/hooks/hosts/codex.ts
|
|
27544
27623
|
var SHELL_TOOLS2 = new Set(["bash", "unified-exec"]);
|