@brainervirus/workit-codex 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.
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "workit",
3
- "version": "8.1.1",
3
+ "version": "8.3.0",
4
4
  "description": "Adaptive engineering workflow rails for Codex",
5
5
  "author": {
6
6
  "name": "BrainerVirus"
@@ -16060,6 +16060,35 @@ function acquireFileLockSync(targetPath, options) {
16060
16060
  }
16061
16061
  }
16062
16062
  }
16063
+ // packages/workit-core/src/host-session.ts
16064
+ var HOST_SESSION_VARS = [
16065
+ ["OPENCODE_SESSION_ID", () => "opencode"],
16066
+ ["PI_SESSION_ID", () => "pi"],
16067
+ [
16068
+ "CODEX_THREAD_ID",
16069
+ (env) => env.CODEX_INTERNAL_ORIGINATOR_OVERRIDE === "Codex Desktop" || env.CODEX_ELECTRON_RESOURCES_PATH ? "codex_desktop" : "codex_cli"
16070
+ ]
16071
+ ];
16072
+ var family = (host) => host?.replace(/_(?:cli|desktop)$/, "") ?? null;
16073
+ function hostSessionFromEnv(env) {
16074
+ const value = (key) => env[key]?.trim() || null;
16075
+ let inner = null;
16076
+ for (const [key, host] of HOST_SESSION_VARS) {
16077
+ const session = value(key);
16078
+ if (session) {
16079
+ inner = { host: host(env), session };
16080
+ break;
16081
+ }
16082
+ }
16083
+ const declared = value("WORKIT_HOST");
16084
+ if (env.WORKIT_SESSION_ID !== undefined) {
16085
+ const inherited = inner !== null && declared !== null && family(declared) !== family(inner.host);
16086
+ if (!inherited)
16087
+ return { host: declared, session: value("WORKIT_SESSION_ID") };
16088
+ }
16089
+ return inner ? { host: inner.host, session: inner.session } : { host: declared, session: null };
16090
+ }
16091
+
16063
16092
  // packages/workit-core/src/core/package-root.ts
16064
16093
  import { existsSync } from "node:fs";
16065
16094
  import path3 from "node:path";
@@ -17024,9 +17053,10 @@ var drop = (lock) => {
17024
17053
  };
17025
17054
  var envActor = () => {
17026
17055
  const value = (key) => process.env[key]?.trim() || null;
17056
+ const acting = hostSessionFromEnv(process.env);
17027
17057
  return {
17028
- host: value("WORKIT_HOST") ?? "runtime",
17029
- session: value("WORKIT_SESSION_ID"),
17058
+ host: acting.host ?? "runtime",
17059
+ session: acting.session,
17030
17060
  agentId: value("WORKIT_AGENT_ID")
17031
17061
  };
17032
17062
  };
@@ -27505,8 +27535,51 @@ var cache = new Map;
27505
27535
  var CASE_INSENSITIVE = process.platform === "darwin" || process.platform === "win32";
27506
27536
  var PREFIXES2 = new Set(["sudo", "command", "env", "nohup", "time", "exec", "xargs"]);
27507
27537
  var cache2 = new Map;
27538
+ // packages/workit-core/src/hooks/raw-git.ts
27539
+ var SHELLS = new Set(["sh", "bash", "zsh", "dash", "ksh"]);
27540
+ var PREFIXES3 = new Set(["sudo", "command", "env", "nohup", "time", "exec", "nice", "&"]);
27541
+ var CD = new Set(["cd", "chdir", "set-location", "sl"]);
27542
+ var PUSHD = new Set(["pushd", "push-location"]);
27543
+ var POPD = new Set(["popd", "pop-location"]);
27544
+ var GIT_VALUE_OPTIONS = new Set([
27545
+ "-c",
27546
+ "--git-dir",
27547
+ "--work-tree",
27548
+ "--namespace",
27549
+ "--exec-path",
27550
+ "--config-env",
27551
+ "--super-prefix"
27552
+ ]);
27553
+ var PUSH_VALUE_OPTIONS = new Set(["-o", "--push-option", "--receive-pack", "--exec", "--repo"]);
27554
+ var VALUE_OPTIONS = {
27555
+ git: new Set([
27556
+ "-m",
27557
+ "--message",
27558
+ "-F",
27559
+ "--file",
27560
+ "-C",
27561
+ "-c",
27562
+ "--reuse-message",
27563
+ "--reedit-message",
27564
+ "--author",
27565
+ "--date",
27566
+ "--trailer",
27567
+ "-t",
27568
+ "--template",
27569
+ "--cleanup",
27570
+ "--fixup",
27571
+ "--squash",
27572
+ "-o",
27573
+ "--push-option",
27574
+ "--repo",
27575
+ "--receive-pack",
27576
+ "--exec"
27577
+ ]),
27578
+ 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"])),
27579
+ 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"]))
27580
+ };
27508
27581
  // packages/workit-core/src/hooks/hosts/fields.ts
27509
- var SHELLS = new Set(["sh", "bash", "zsh", "dash", "pwsh", "powershell", "cmd"]);
27582
+ var SHELLS2 = new Set(["sh", "bash", "zsh", "dash", "pwsh", "powershell", "cmd"]);
27510
27583
  var WRITE_TOOLS = new Set([
27511
27584
  "write",
27512
27585
  "edit",
@@ -27532,7 +27605,13 @@ var CLAUDE_JUDGES = new Set(["workit:verifier", "workit:reviewer"]);
27532
27605
  // packages/workit-core/src/hooks/hosts/claude-code.ts
27533
27606
  var SOURCES = new Set(["startup", "resume", "clear", "compact", "fork"]);
27534
27607
  var SHELL_TOOLS = new Set(["Bash", "PowerShell"]);
27535
- var CONTEXT_EVENTS = new Set(["SessionStart", "UserPromptSubmit", "SubagentStart"]);
27608
+ var CONTEXT_EVENTS = new Set([
27609
+ "SessionStart",
27610
+ "UserPromptSubmit",
27611
+ "SubagentStart",
27612
+ "PreToolUse",
27613
+ "PostToolUse"
27614
+ ]);
27536
27615
 
27537
27616
  // packages/workit-core/src/hooks/hosts/codex.ts
27538
27617
  function detectCodexSurface(env) {
@@ -27551,7 +27630,7 @@ var CODEX_DESCRIPTOR = {
27551
27630
  "shell.pre": { support: "native", native: "PreToolUse" },
27552
27631
  "tool.pre": { support: "native", native: "PreToolUse" },
27553
27632
  "write.pre": { support: "undocumented", native: null },
27554
- "shell.post": undocumented,
27633
+ "shell.post": { support: "native", native: "PostToolUse" },
27555
27634
  "subagent.start": { support: "native", native: "SubagentStart" },
27556
27635
  "subagent.stop": { support: "native", native: "SubagentStop" },
27557
27636
  "prompt.submit": undocumented,
@@ -27572,7 +27651,7 @@ var CODEX_DESCRIPTOR = {
27572
27651
  worktreeIsolation: "undocumented",
27573
27652
  maxConcurrency: "undocumented"
27574
27653
  },
27575
- provenance: { sessionId: "native", agentIdOnTool: "partial", postToolObserve: "undocumented" },
27654
+ provenance: { sessionId: "native", agentIdOnTool: "partial", postToolObserve: "native" },
27576
27655
  interaction: { questions: "none", writeBoundary: "partial" },
27577
27656
  stopControl: "undocumented",
27578
27657
  shellAvailable: "native",