@brainervirus/workit-mcp 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/dist/index.js +32 -2
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -18436,6 +18436,35 @@ function acquireFileLockSync(targetPath, options) {
|
|
|
18436
18436
|
}
|
|
18437
18437
|
}
|
|
18438
18438
|
}
|
|
18439
|
+
// packages/workit-core/src/host-session.ts
|
|
18440
|
+
var HOST_SESSION_VARS = [
|
|
18441
|
+
["OPENCODE_SESSION_ID", () => "opencode"],
|
|
18442
|
+
["PI_SESSION_ID", () => "pi"],
|
|
18443
|
+
[
|
|
18444
|
+
"CODEX_THREAD_ID",
|
|
18445
|
+
(env) => env.CODEX_INTERNAL_ORIGINATOR_OVERRIDE === "Codex Desktop" || env.CODEX_ELECTRON_RESOURCES_PATH ? "codex_desktop" : "codex_cli"
|
|
18446
|
+
]
|
|
18447
|
+
];
|
|
18448
|
+
var family = (host) => host?.replace(/_(?:cli|desktop)$/, "") ?? null;
|
|
18449
|
+
function hostSessionFromEnv(env) {
|
|
18450
|
+
const value = (key) => env[key]?.trim() || null;
|
|
18451
|
+
let inner = null;
|
|
18452
|
+
for (const [key, host] of HOST_SESSION_VARS) {
|
|
18453
|
+
const session = value(key);
|
|
18454
|
+
if (session) {
|
|
18455
|
+
inner = { host: host(env), session };
|
|
18456
|
+
break;
|
|
18457
|
+
}
|
|
18458
|
+
}
|
|
18459
|
+
const declared = value("WORKIT_HOST");
|
|
18460
|
+
if (env.WORKIT_SESSION_ID !== undefined) {
|
|
18461
|
+
const inherited = inner !== null && declared !== null && family(declared) !== family(inner.host);
|
|
18462
|
+
if (!inherited)
|
|
18463
|
+
return { host: declared, session: value("WORKIT_SESSION_ID") };
|
|
18464
|
+
}
|
|
18465
|
+
return inner ? { host: inner.host, session: inner.session } : { host: declared, session: null };
|
|
18466
|
+
}
|
|
18467
|
+
|
|
18439
18468
|
// packages/workit-core/src/core/package-root.ts
|
|
18440
18469
|
import { existsSync } from "node:fs";
|
|
18441
18470
|
import path3 from "node:path";
|
|
@@ -19400,9 +19429,10 @@ var drop = (lock) => {
|
|
|
19400
19429
|
};
|
|
19401
19430
|
var envActor = () => {
|
|
19402
19431
|
const value = (key) => process.env[key]?.trim() || null;
|
|
19432
|
+
const acting = hostSessionFromEnv(process.env);
|
|
19403
19433
|
return {
|
|
19404
|
-
host:
|
|
19405
|
-
session:
|
|
19434
|
+
host: acting.host ?? "runtime",
|
|
19435
|
+
session: acting.session,
|
|
19406
19436
|
agentId: value("WORKIT_AGENT_ID")
|
|
19407
19437
|
};
|
|
19408
19438
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@brainervirus/workit-mcp",
|
|
3
|
-
"version": "8.
|
|
3
|
+
"version": "8.3.0",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "Workit shared MCP transport for the eight task and policy operation families",
|
|
6
6
|
"keywords": [
|
|
@@ -42,7 +42,7 @@
|
|
|
42
42
|
"build": "bun scripts/build.ts"
|
|
43
43
|
},
|
|
44
44
|
"dependencies": {
|
|
45
|
-
"@brainervirus/workit-core": "^8.
|
|
45
|
+
"@brainervirus/workit-core": "^8.3.0",
|
|
46
46
|
"@modelcontextprotocol/sdk": "1.32.0",
|
|
47
47
|
"zod": "4.6.5"
|
|
48
48
|
},
|