@workit-dev/codex 1.5.0 → 1.6.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/launch-mcp.js
CHANGED
|
@@ -22385,12 +22385,11 @@ function checkVerdictsOnce(cwd, branch, ledgerRows) {
|
|
|
22385
22385
|
}
|
|
22386
22386
|
return reasons;
|
|
22387
22387
|
};
|
|
22388
|
-
const
|
|
22388
|
+
const voided = verdictVoids(rows, { chained: true });
|
|
22389
|
+
const retired = new Set(voided.keys());
|
|
22389
22390
|
for (const row of rows)
|
|
22390
|
-
if (row.type === "verdict" && row.supersedes && !row.supersedeIgnored && trustReasons(cwd, row).length === 0)
|
|
22391
|
+
if (row.type === "verdict" && row.supersedes && !row.supersedeIgnored && !voided.has(row.id) && trustReasons(cwd, row).length === 0)
|
|
22391
22392
|
retired.add(row.supersedes);
|
|
22392
|
-
for (const id of verdictVoids(rows, { chained: true }).keys())
|
|
22393
|
-
retired.add(id);
|
|
22394
22393
|
const byKind = new Map;
|
|
22395
22394
|
for (const row of rows.toSorted(byRank))
|
|
22396
22395
|
if (isLiveVerdict(row, retired) && scope(row)) {
|
|
@@ -30480,19 +30479,40 @@ if (false) {}
|
|
|
30480
30479
|
|
|
30481
30480
|
// packages/workit-core/src/hooks/skill-nudge.ts
|
|
30482
30481
|
var USER_INVOKED = new Set(["workit-retro", "workit-architecture"]);
|
|
30483
|
-
var
|
|
30484
|
-
|
|
30485
|
-
|
|
30486
|
-
|
|
30487
|
-
|
|
30488
|
-
|
|
30489
|
-
|
|
30490
|
-
|
|
30491
|
-
|
|
30492
|
-
|
|
30493
|
-
|
|
30494
|
-
|
|
30495
|
-
]
|
|
30482
|
+
var PROMPT_INTENTS = [
|
|
30483
|
+
[
|
|
30484
|
+
"debug",
|
|
30485
|
+
/\b(flaky|regressed|(is|introduced) a regression|regression (in|after|since|from)|(is|are|got|looks) broken|debug (this|it|the|why)|fix (the|this|a) bug)\b/i
|
|
30486
|
+
],
|
|
30487
|
+
[
|
|
30488
|
+
"continue",
|
|
30489
|
+
/\b(pick up where|where (were|did) we|resume (the|this|my|our|work|where)|hand ?off)\b/i
|
|
30490
|
+
],
|
|
30491
|
+
[
|
|
30492
|
+
"review",
|
|
30493
|
+
/\b(blast radius|code review|review (the|this|my|PR|pr|#\d+|branch|diff|changes))\b/i
|
|
30494
|
+
],
|
|
30495
|
+
[
|
|
30496
|
+
"ship",
|
|
30497
|
+
/\b(ship (it|this|the)|babysit|open (a|the) (PR|pr|MR|mr)(?=\s*$|\s+(for|to|on|with|and|against|into|from|after|once)\b|[.!,;])|merge (the|this|my) (PR|pr|MR|mr|branch)|(get|until|make) CI (is )?green)\b/i
|
|
30498
|
+
],
|
|
30499
|
+
["bdd", /\b(BDD|TDD|acceptance criteria|Given\/When\/Then)(?![\w/])/],
|
|
30500
|
+
["test-audit", /\b(test audit|audit the tests|tautolog\w*|weak tests)\b/i],
|
|
30501
|
+
["deslop", /\b(deslop|slop|dead code)\b/i],
|
|
30502
|
+
["fanout", /\b(fan( |-)?out|parallelize|parallel agents|agent swarm|swarm of agents)\b/i],
|
|
30503
|
+
["verify-app", /\b(verify the app|smoke test|prove it works)\b/i],
|
|
30504
|
+
["retro", /\b((a|the) retro(?![-\w]|\.\w)|retrospective)/i],
|
|
30505
|
+
["architecture", /\b(deepen (the )?modules|architecture (review|pass|audit))\b/i],
|
|
30506
|
+
[
|
|
30507
|
+
"shape",
|
|
30508
|
+
/\b(brainstorm\w*|grill me|should we|let'?s plan|plan (out|how|the|a|for)|(write|draft) (a|the) spec)\b/i
|
|
30509
|
+
],
|
|
30510
|
+
[
|
|
30511
|
+
"implement",
|
|
30512
|
+
/\b(implement (the|this|a|it)|add (a|the) feature|build (a|an|the) (new )?(feature|command|verb|page|endpoint|component|cli|tool))\b/i
|
|
30513
|
+
]
|
|
30514
|
+
].map(([name, pattern]) => [`workit-${name}`, pattern]);
|
|
30515
|
+
var READERS = new Set("cat sed head tail less more bat nl get-content gc type".split(" "));
|
|
30496
30516
|
// packages/workit-core/src/hooks/hosts/fields.ts
|
|
30497
30517
|
import { existsSync as existsSync13, realpathSync as realpathSync10, statSync as statSync4 } from "node:fs";
|
|
30498
30518
|
import path33 from "node:path";
|
|
@@ -30566,6 +30586,10 @@ var writeTargets = (input) => {
|
|
|
30566
30586
|
const paths = writePaths(input);
|
|
30567
30587
|
return paths.length > 0 ? paths : null;
|
|
30568
30588
|
};
|
|
30589
|
+
// packages/workit-core/src/approvals/store.ts
|
|
30590
|
+
var REQUEST_TTL_MS = 30 * 60000;
|
|
30591
|
+
var GRANT_TTL_MS = 15 * 60000;
|
|
30592
|
+
|
|
30569
30593
|
// packages/workit-core/src/hooks/hosts/claude-code.ts
|
|
30570
30594
|
var CLAUDE_CODE_DESCRIPTOR = {
|
|
30571
30595
|
host: "claude_code",
|
|
@@ -30607,7 +30631,11 @@ var CLAUDE_CODE_DESCRIPTOR = {
|
|
|
30607
30631
|
maxConcurrency: "undocumented",
|
|
30608
30632
|
agentPrefix: "workit:"
|
|
30609
30633
|
},
|
|
30610
|
-
provenance: {
|
|
30634
|
+
provenance: {
|
|
30635
|
+
sessionId: "native",
|
|
30636
|
+
agentIdOnTool: "native",
|
|
30637
|
+
postToolObserve: "native"
|
|
30638
|
+
},
|
|
30611
30639
|
interaction: { questions: "undocumented", writeBoundary: "partial" },
|
|
30612
30640
|
stopControl: "native",
|
|
30613
30641
|
shellAvailable: "native",
|
|
@@ -30669,6 +30697,7 @@ var CONTEXT_EVENTS = new Set([
|
|
|
30669
30697
|
"PreToolUse",
|
|
30670
30698
|
"PostToolUse"
|
|
30671
30699
|
]);
|
|
30700
|
+
var ASKING_MODES = new Set(["default", "acceptEdits", "plan"]);
|
|
30672
30701
|
|
|
30673
30702
|
// packages/workit-core/src/hooks/hosts/codex.ts
|
|
30674
30703
|
function detectCodexSurface(env) {
|
|
@@ -15298,12 +15298,11 @@ function checkVerdictsOnce(cwd, branch, ledgerRows) {
|
|
|
15298
15298
|
}
|
|
15299
15299
|
return reasons;
|
|
15300
15300
|
};
|
|
15301
|
-
const
|
|
15301
|
+
const voided = verdictVoids(rows, { chained: true });
|
|
15302
|
+
const retired = new Set(voided.keys());
|
|
15302
15303
|
for (const row of rows)
|
|
15303
|
-
if (row.type === "verdict" && row.supersedes && !row.supersedeIgnored && trustReasons(cwd, row).length === 0)
|
|
15304
|
+
if (row.type === "verdict" && row.supersedes && !row.supersedeIgnored && !voided.has(row.id) && trustReasons(cwd, row).length === 0)
|
|
15304
15305
|
retired.add(row.supersedes);
|
|
15305
|
-
for (const id of verdictVoids(rows, { chained: true }).keys())
|
|
15306
|
-
retired.add(id);
|
|
15307
15306
|
const byKind = new Map;
|
|
15308
15307
|
for (const row of rows.toSorted(byRank))
|
|
15309
15308
|
if (isLiveVerdict(row, retired) && scope(row)) {
|
|
@@ -19366,7 +19365,8 @@ var WORKIT_USER_ONLY = [
|
|
|
19366
19365
|
["release", "notes", "approve"],
|
|
19367
19366
|
["grant", "set"],
|
|
19368
19367
|
["grant", "raise"],
|
|
19369
|
-
["ledger", "void"]
|
|
19368
|
+
["ledger", "void"],
|
|
19369
|
+
["approve"]
|
|
19370
19370
|
];
|
|
19371
19371
|
var ALLOWED = new Set(WORKIT_ALLOWED_VERBS);
|
|
19372
19372
|
var hasWordsInOrder = (words, needle) => {
|
|
@@ -21138,7 +21138,12 @@ var segmentTargets = (cwd, command, dialect, depth = 0, strict = false, inherite
|
|
|
21138
21138
|
};
|
|
21139
21139
|
for (const segment of segments) {
|
|
21140
21140
|
if (segment.group === "open") {
|
|
21141
|
-
groups.push({
|
|
21141
|
+
groups.push({
|
|
21142
|
+
dir,
|
|
21143
|
+
stack: [...stack],
|
|
21144
|
+
vars: new Map(vars),
|
|
21145
|
+
loops: new Map(loops)
|
|
21146
|
+
});
|
|
21142
21147
|
continue;
|
|
21143
21148
|
}
|
|
21144
21149
|
if (segment.group === "close") {
|
|
@@ -21346,39 +21351,60 @@ var claimAll = (owner, targets, deps) => {
|
|
|
21346
21351
|
claimLiveSession(target, owner, deps);
|
|
21347
21352
|
};
|
|
21348
21353
|
var liveTargets = (cwd, paths) => paths?.length ? paths.map((file) => path28.resolve(cwd, file)) : [path28.join(cwd, DIR_TARGET)];
|
|
21349
|
-
var
|
|
21354
|
+
var registryTarget = (cwd, targets) => {
|
|
21350
21355
|
const state = resolveStateDir();
|
|
21351
|
-
const
|
|
21352
|
-
|
|
21356
|
+
for (const target of targets) {
|
|
21357
|
+
const registry = underRegistry(state, cwd, homeExpanded(target), process.platform, canonical3);
|
|
21358
|
+
if (registry)
|
|
21359
|
+
return { file: target, registry };
|
|
21360
|
+
}
|
|
21361
|
+
return null;
|
|
21353
21362
|
};
|
|
21354
|
-
var
|
|
21363
|
+
var underRegistry = (state, cwd, target, platform = process.platform, real = (file) => file) => {
|
|
21355
21364
|
const win = platform === "win32";
|
|
21356
21365
|
const p = win ? path28.win32 : path28.posix;
|
|
21357
21366
|
const fold = (value) => win || platform === "darwin" ? value.toLowerCase() : value;
|
|
21358
21367
|
const named = win ? target.replace(/^\/([a-zA-Z])(?=\/|$)/, "$1:") : target;
|
|
21359
21368
|
const relative = p.relative(fold(real(p.resolve(state))), fold(real(p.resolve(cwd, named))));
|
|
21360
21369
|
if (relative.startsWith("..") || p.isAbsolute(relative))
|
|
21361
|
-
return
|
|
21362
|
-
|
|
21370
|
+
return null;
|
|
21371
|
+
const first = relative.split(p.sep)[0];
|
|
21372
|
+
if (first.startsWith("issued"))
|
|
21373
|
+
return "issued";
|
|
21374
|
+
return first === "approvals" ? "approvals" : null;
|
|
21363
21375
|
};
|
|
21364
|
-
var
|
|
21376
|
+
var unquotedWindowsRegistry = (command) => {
|
|
21365
21377
|
if (process.platform !== "win32" || !command.includes("\\"))
|
|
21366
|
-
return
|
|
21378
|
+
return null;
|
|
21367
21379
|
const flat = (value) => value.replaceAll("\\", "/").toLowerCase();
|
|
21368
|
-
|
|
21380
|
+
const text = flat(command);
|
|
21381
|
+
const state = flat(resolveStateDir());
|
|
21382
|
+
const registry = text.includes(`${state}/issued`) ? "issued" : text.includes(`${state}/approvals`) ? "approvals" : null;
|
|
21383
|
+
return registry && shellWrites(command).writes ? registry : null;
|
|
21384
|
+
};
|
|
21385
|
+
var REGISTRY_DENY = {
|
|
21386
|
+
issued: {
|
|
21387
|
+
label: "issued-registry guard",
|
|
21388
|
+
unblock: "Issued ids and tokens are written only by Workit's SubagentStart hook. Run the verifier or reviewer agent so the host issues its own session; never edit the issued registries by hand."
|
|
21389
|
+
},
|
|
21390
|
+
approvals: {
|
|
21391
|
+
label: "approvals guard",
|
|
21392
|
+
unblock: "Approval requests and the user's yes are written only by Workit: run `workit approve <id>` as its own call so the host asks the user, or ask the user to run it in their own terminal; never edit the approvals registry by hand."
|
|
21393
|
+
}
|
|
21369
21394
|
};
|
|
21370
|
-
var
|
|
21371
|
-
const
|
|
21395
|
+
var registryDeny = ({ file, registry }) => {
|
|
21396
|
+
const { label, unblock } = REGISTRY_DENY[registry];
|
|
21397
|
+
const what = registry === "issued" ? "issued-session state" : "host-approval state";
|
|
21372
21398
|
return {
|
|
21373
21399
|
kind: "deny",
|
|
21374
|
-
reason: `workit
|
|
21400
|
+
reason: `workit ${label}: ${file} is under Workit's ${what}. ${unblock}`,
|
|
21375
21401
|
unblock
|
|
21376
21402
|
};
|
|
21377
21403
|
};
|
|
21378
21404
|
function writeGate(cwd, paths, owner, deps) {
|
|
21379
|
-
const forged = paths?.length ?
|
|
21405
|
+
const forged = paths?.length ? registryTarget(cwd, paths) : null;
|
|
21380
21406
|
if (forged)
|
|
21381
|
-
return
|
|
21407
|
+
return registryDeny(forged);
|
|
21382
21408
|
if (!owner)
|
|
21383
21409
|
return beforeWriteGate(cwd, paths);
|
|
21384
21410
|
const targets = liveTargets(cwd, paths);
|
|
@@ -21392,9 +21418,10 @@ function writeGate(cwd, paths, owner, deps) {
|
|
|
21392
21418
|
}
|
|
21393
21419
|
function shellGate(cwd, command, owner, dialect = "posix", deps) {
|
|
21394
21420
|
try {
|
|
21395
|
-
const
|
|
21421
|
+
const windows = unquotedWindowsRegistry(command);
|
|
21422
|
+
const forged = registryTarget(cwd, segmentTargets(cwd, command, dialect)) ?? (windows ? { file: `the ${windows} registry`, registry: windows } : null);
|
|
21396
21423
|
if (forged)
|
|
21397
|
-
return
|
|
21424
|
+
return registryDeny(forged);
|
|
21398
21425
|
} catch {}
|
|
21399
21426
|
const writes = shellWrites(command);
|
|
21400
21427
|
let targets = [];
|
|
@@ -21789,40 +21816,37 @@ var SKILL_HOST = {
|
|
|
21789
21816
|
};
|
|
21790
21817
|
var PROMPT_INTENTS = [
|
|
21791
21818
|
[
|
|
21792
|
-
"
|
|
21793
|
-
/\b(flaky|regressed|(
|
|
21819
|
+
"debug",
|
|
21820
|
+
/\b(flaky|regressed|(is|introduced) a regression|regression (in|after|since|from)|(is|are|got|looks) broken|debug (this|it|the|why)|fix (the|this|a) bug)\b/i
|
|
21794
21821
|
],
|
|
21795
21822
|
[
|
|
21796
|
-
"
|
|
21797
|
-
/\b(pick up where|where (
|
|
21823
|
+
"continue",
|
|
21824
|
+
/\b(pick up where|where (were|did) we|resume (the|this|my|our|work|where)|hand ?off)\b/i
|
|
21798
21825
|
],
|
|
21799
21826
|
[
|
|
21800
|
-
"
|
|
21801
|
-
/\b(blast radius|code review|review (
|
|
21827
|
+
"review",
|
|
21828
|
+
/\b(blast radius|code review|review (the|this|my|PR|pr|#\d+|branch|diff|changes))\b/i
|
|
21802
21829
|
],
|
|
21803
21830
|
[
|
|
21804
|
-
"
|
|
21805
|
-
/\b(ship (
|
|
21831
|
+
"ship",
|
|
21832
|
+
/\b(ship (it|this|the)|babysit|open (a|the) (PR|pr|MR|mr)(?=\s*$|\s+(for|to|on|with|and|against|into|from|after|once)\b|[.!,;])|merge (the|this|my) (PR|pr|MR|mr|branch)|(get|until|make) CI (is )?green)\b/i
|
|
21806
21833
|
],
|
|
21807
|
-
["
|
|
21808
|
-
["
|
|
21809
|
-
["
|
|
21834
|
+
["bdd", /\b(BDD|TDD|acceptance criteria|Given\/When\/Then)(?![\w/])/],
|
|
21835
|
+
["test-audit", /\b(test audit|audit the tests|tautolog\w*|weak tests)\b/i],
|
|
21836
|
+
["deslop", /\b(deslop|slop|dead code)\b/i],
|
|
21837
|
+
["fanout", /\b(fan( |-)?out|parallelize|parallel agents|agent swarm|swarm of agents)\b/i],
|
|
21838
|
+
["verify-app", /\b(verify the app|smoke test|prove it works)\b/i],
|
|
21839
|
+
["retro", /\b((a|the) retro(?![-\w]|\.\w)|retrospective)/i],
|
|
21840
|
+
["architecture", /\b(deepen (the )?modules|architecture (review|pass|audit))\b/i],
|
|
21810
21841
|
[
|
|
21811
|
-
"
|
|
21812
|
-
/\b(
|
|
21842
|
+
"shape",
|
|
21843
|
+
/\b(brainstorm\w*|grill me|should we|let'?s plan|plan (out|how|the|a|for)|(write|draft) (a|the) spec)\b/i
|
|
21813
21844
|
],
|
|
21814
|
-
["workit-verify-app", /\b(verify the app|smoke test|prove it works)\b/i],
|
|
21815
|
-
["workit-retro", /\b((?:a|the) retro(?![-\w]|\.\w)|retrospective)/i],
|
|
21816
|
-
["workit-architecture", /\b(deepen (?:the )?modules|architecture (?:review|pass|audit))\b/i],
|
|
21817
21845
|
[
|
|
21818
|
-
"
|
|
21819
|
-
/\b(
|
|
21820
|
-
],
|
|
21821
|
-
[
|
|
21822
|
-
"workit-implement",
|
|
21823
|
-
/\b(implement (?:the|this|a|it)|add (?:a|the) feature|build (?:a|an|the) (?:new )?(?:feature|command|verb|page|endpoint|component|cli|tool))\b/i
|
|
21846
|
+
"implement",
|
|
21847
|
+
/\b(implement (the|this|a|it)|add (a|the) feature|build (a|an|the) (new )?(feature|command|verb|page|endpoint|component|cli|tool))\b/i
|
|
21824
21848
|
]
|
|
21825
|
-
];
|
|
21849
|
+
].map(([name, pattern]) => [`workit-${name}`, pattern]);
|
|
21826
21850
|
var workitSkillOf = (name) => {
|
|
21827
21851
|
const bare = name.trim().replace(/^\//, "").toLowerCase();
|
|
21828
21852
|
const alias = WORKIT_SKILL_ALIASES[bare];
|
|
@@ -21831,10 +21855,13 @@ var workitSkillOf = (name) => {
|
|
|
21831
21855
|
const skill = bare.replace(/^workit:/, "workit-");
|
|
21832
21856
|
return WORKIT_METHOD_SKILLS.includes(skill) ? skill : null;
|
|
21833
21857
|
};
|
|
21858
|
+
var QUOTED = /```[\s\S]*?```|["`“][^"`”\n]*["`”]|\B'[^'\n]*'\B/g;
|
|
21859
|
+
var COMPLAINT = /\b(why \w+ you|you keep|stop \w+ing)\b.*?(?=\b(and|but)\b|[?.,;\n]|$)/gi;
|
|
21834
21860
|
var promptTrigger = (prompt) => {
|
|
21835
|
-
|
|
21861
|
+
let asking = false;
|
|
21862
|
+
const text = prompt.slice(0, 4000).replace(QUOTED, " ").replace(COMPLAINT, (clause) => (asking ||= /ask|quest/i.test(clause), " "));
|
|
21836
21863
|
for (const [skill, pattern] of PROMPT_INTENTS) {
|
|
21837
|
-
const match = pattern.exec(text);
|
|
21864
|
+
const match = !(asking && skill === "workit-shape") && pattern.exec(text);
|
|
21838
21865
|
if (match)
|
|
21839
21866
|
return { skill, trigger: match[1] ?? match[0] };
|
|
21840
21867
|
}
|
|
@@ -21852,24 +21879,12 @@ var loadedSkills = (cwd, session) => {
|
|
|
21852
21879
|
};
|
|
21853
21880
|
var SKILL_FILE = /(?:^|[\\/])(workit-[a-z-]+)[\\/]SKILL\.md$/;
|
|
21854
21881
|
var skillFileIn = (file) => SKILL_FILE.exec(file)?.[1] ?? null;
|
|
21855
|
-
var READERS = new Set(
|
|
21856
|
-
"cat",
|
|
21857
|
-
"sed",
|
|
21858
|
-
"head",
|
|
21859
|
-
"tail",
|
|
21860
|
-
"less",
|
|
21861
|
-
"more",
|
|
21862
|
-
"bat",
|
|
21863
|
-
"nl",
|
|
21864
|
-
"get-content",
|
|
21865
|
-
"gc",
|
|
21866
|
-
"type"
|
|
21867
|
-
]);
|
|
21882
|
+
var READERS = new Set("cat sed head tail less more bat nl get-content gc type".split(" "));
|
|
21868
21883
|
var skillReadIn = (command, dialect = "posix") => {
|
|
21869
21884
|
for (const { words } of segmentsOf(command, dialect)) {
|
|
21870
21885
|
if (!READERS.has((words[0]?.split(/[\\/]/).at(-1) ?? "").toLowerCase()))
|
|
21871
21886
|
continue;
|
|
21872
|
-
if (words.some((word) => /^(
|
|
21887
|
+
if (words.some((word) => /^(-i(\.\w+)?|--in-place(=.*)?)$/.test(word)))
|
|
21873
21888
|
continue;
|
|
21874
21889
|
for (const word of words.slice(1)) {
|
|
21875
21890
|
const skill = skillFileIn(word);
|
|
@@ -21916,9 +21931,9 @@ var nudgeOnce = (input, session, skill, line) => {
|
|
|
21916
21931
|
writeSessionMarker(file, { ...marker, nudged: [...marker.nudged, skill] });
|
|
21917
21932
|
return line;
|
|
21918
21933
|
};
|
|
21919
|
-
var nudgeText = (input, skill, why) =>
|
|
21934
|
+
var nudgeText = (input, skill, why) => `Workit: ${why} looks like ${skill} work${USER_INVOKED.has(skill) ? `, which the user starts; offer it (/${skill.replace(/^workit-/, "wk-")}) rather than loading it.` : `; if it is, ${skillLoadWording(SKILL_HOST[input.host], skill)} first.`}`;
|
|
21920
21935
|
var promptLoads = (prompt) => /^\s*\/(?:skill:)?([\w:-]+)/.exec(prompt)?.[1] ?? /^\s*<skill name="([\w:-]+)"/.exec(prompt)?.[1] ?? /^\s*Load the (workit-[a-z-]+) skill with the skill tool\b/.exec(prompt)?.[1] ?? null;
|
|
21921
|
-
var relayedMessage = (prompt) => /^\s*(
|
|
21936
|
+
var relayedMessage = (prompt) => /^\s*(Another Claude session sent a message\b|<agent-message\s+from=|\[SYSTEM NOTIFICATION\b|<task-notification>)/.test(prompt);
|
|
21922
21937
|
function promptNudge(input, prompt) {
|
|
21923
21938
|
try {
|
|
21924
21939
|
const session = input.session.id;
|
|
@@ -21937,7 +21952,7 @@ function promptNudge(input, prompt) {
|
|
|
21937
21952
|
return null;
|
|
21938
21953
|
}
|
|
21939
21954
|
}
|
|
21940
|
-
var WORKIT_DELIVERY = /^(
|
|
21955
|
+
var WORKIT_DELIVERY = /^(pr (create|merge)|ci wait|git push)\b/;
|
|
21941
21956
|
var runsWorkitDelivery = (command, dialect) => workitInvocations(command, dialect).some((args) => !args.some((arg) => arg === "--help" || arg === "-h" || arg === "--dry-run") && WORKIT_DELIVERY.test(args.join(" ")));
|
|
21942
21957
|
var isDeliveryCommand = (cwd, command, dialect = "posix") => rawDelivery(cwd, command, dialect) || runsWorkitDelivery(command, dialect) && inWorkitWorkspace(cwd);
|
|
21943
21958
|
function shipNudge(input, command) {
|
|
@@ -22040,6 +22055,10 @@ var writeTargets = (input) => {
|
|
|
22040
22055
|
import fs22 from "node:fs";
|
|
22041
22056
|
import path32 from "node:path";
|
|
22042
22057
|
|
|
22058
|
+
// packages/workit-core/src/approvals/store.ts
|
|
22059
|
+
var REQUEST_TTL_MS = 30 * 60000;
|
|
22060
|
+
var GRANT_TTL_MS = 15 * 60000;
|
|
22061
|
+
|
|
22043
22062
|
// packages/workit-core/src/hooks/hosts/claude-code.ts
|
|
22044
22063
|
var CLAUDE_CODE_DESCRIPTOR = {
|
|
22045
22064
|
host: "claude_code",
|
|
@@ -22081,7 +22100,11 @@ var CLAUDE_CODE_DESCRIPTOR = {
|
|
|
22081
22100
|
maxConcurrency: "undocumented",
|
|
22082
22101
|
agentPrefix: "workit:"
|
|
22083
22102
|
},
|
|
22084
|
-
provenance: {
|
|
22103
|
+
provenance: {
|
|
22104
|
+
sessionId: "native",
|
|
22105
|
+
agentIdOnTool: "native",
|
|
22106
|
+
postToolObserve: "native"
|
|
22107
|
+
},
|
|
22085
22108
|
interaction: { questions: "undocumented", writeBoundary: "partial" },
|
|
22086
22109
|
stopControl: "native",
|
|
22087
22110
|
shellAvailable: "native",
|
|
@@ -22143,6 +22166,7 @@ var CONTEXT_EVENTS = new Set([
|
|
|
22143
22166
|
"PreToolUse",
|
|
22144
22167
|
"PostToolUse"
|
|
22145
22168
|
]);
|
|
22169
|
+
var ASKING_MODES = new Set(["default", "acceptEdits", "plan"]);
|
|
22146
22170
|
|
|
22147
22171
|
// packages/workit-core/src/hooks/hosts/codex.ts
|
|
22148
22172
|
function detectCodexSurface(env) {
|
|
@@ -23362,7 +23386,7 @@ var cwdRewrite = (command) => {
|
|
|
23362
23386
|
const rest = match?.[2];
|
|
23363
23387
|
if (!dir || !rest || dir.startsWith("-"))
|
|
23364
23388
|
return null;
|
|
23365
|
-
if (/[&;<>`\n]/u.test(rest.replaceAll("2>&1", "").replaceAll(/'[^']*'|"(
|
|
23389
|
+
if (/[&;<>`\n]/u.test(rest.replaceAll("2>&1", "").replaceAll(/'[^']*'|"([^"\\]|\\.)*"/gu, "")))
|
|
23366
23390
|
return null;
|
|
23367
23391
|
const segments = segmentsOf(rest);
|
|
23368
23392
|
const [head, ...filters] = segments;
|
|
@@ -23375,8 +23399,10 @@ var cwdRewrite = (command) => {
|
|
|
23375
23399
|
if (!filters.every((s) => FILTERS.has(s.words[0] ?? "") && stdinOnly(s.words)))
|
|
23376
23400
|
return null;
|
|
23377
23401
|
const at = head.words.indexOf("--cwd");
|
|
23378
|
-
if (at >= 0)
|
|
23379
|
-
|
|
23402
|
+
if (at >= 0) {
|
|
23403
|
+
const bare = dir.replace(/^(['"])(.*)\1$/u, "$2");
|
|
23404
|
+
return bare[0] === "/" && head.words[at + 1] === bare ? rest : null;
|
|
23405
|
+
}
|
|
23380
23406
|
if (head.words.some((w) => w.startsWith("--cwd=")))
|
|
23381
23407
|
return null;
|
|
23382
23408
|
const args = rest.slice("workit".length).trimStart();
|
|
@@ -23396,7 +23422,7 @@ var verbFirst = (command) => {
|
|
|
23396
23422
|
return null;
|
|
23397
23423
|
return `${lead} ${verb}${globals}${command.slice(whole.length)}`;
|
|
23398
23424
|
};
|
|
23399
|
-
var MUTATING_GIT2 = /^git(
|
|
23425
|
+
var MUTATING_GIT2 = /^git( -\S+| -[Cc] \S+)* (commit|push|add|switch|checkout|merge|rebase|reset|cherry-pick|revert|branch .*(-[dDmM]|--delete|--move)\b|tag (?!-l\b|--list)|stash(?! (list|show)\b))/u;
|
|
23400
23426
|
var cdWorkitSplit = (command) => {
|
|
23401
23427
|
const match = COMPOUND2.exec(command);
|
|
23402
23428
|
const dir = match?.[1];
|
package/dist/workit-hook.js
CHANGED
|
@@ -84,7 +84,7 @@ if (quiet) {
|
|
|
84
84
|
`);
|
|
85
85
|
} else {
|
|
86
86
|
try {
|
|
87
|
-
const { runCodexHook } = await import("./workit-hook-
|
|
87
|
+
const { runCodexHook } = await import("./workit-hook-ecwds2tm.js");
|
|
88
88
|
await runCodexHook([payload]);
|
|
89
89
|
} catch (error) {
|
|
90
90
|
const { answerRuntimeFailure } = await import("./workit-hook-ehy7rps6.js");
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@workit-dev/codex",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.6.0",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "Workit Codex CLI/desktop plugin — shared MCP transport, hooks, method skills, and verifier/reviewer/implementer agents",
|
|
6
6
|
"keywords": [
|
|
@@ -41,8 +41,8 @@
|
|
|
41
41
|
"build": "bun scripts/build.ts"
|
|
42
42
|
},
|
|
43
43
|
"devDependencies": {
|
|
44
|
-
"@workit-dev/core": "^1.
|
|
45
|
-
"@workit-dev/mcp": "^1.
|
|
44
|
+
"@workit-dev/core": "^1.6.0",
|
|
45
|
+
"@workit-dev/mcp": "^1.6.0"
|
|
46
46
|
},
|
|
47
47
|
"engines": {
|
|
48
48
|
"node": ">=24"
|