@workit-dev/codex 1.0.4 → 1.1.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.
|
@@ -22724,36 +22724,54 @@ var DESCRIPTORS = {
|
|
|
22724
22724
|
pi: PI_DESCRIPTOR
|
|
22725
22725
|
};
|
|
22726
22726
|
var workerOfLead = (input) => input.session.agentType === null || workitRole(DESCRIPTORS[input.host], input.session.agentType) !== null;
|
|
22727
|
-
var worksFor = (plan, input,
|
|
22727
|
+
var worksFor = (plan, input, branches) => {
|
|
22728
22728
|
const session = input.session.id;
|
|
22729
22729
|
if (plan.leads.includes(session) && !input.session.agentId)
|
|
22730
|
-
return
|
|
22730
|
+
return null;
|
|
22731
|
+
if (branches.some((branch) => plan.branches.includes(branch)))
|
|
22732
|
+
return "slice";
|
|
22731
22733
|
const lead = leadOf2(input);
|
|
22732
22734
|
if (lead && plan.leads.includes(lead) && workerOfLead(input))
|
|
22733
|
-
return
|
|
22734
|
-
|
|
22735
|
-
|
|
22736
|
-
|
|
22737
|
-
|
|
22735
|
+
return "lead";
|
|
22736
|
+
return plan.leads.some((each) => session.startsWith(`${each}-w-`)) ? "lead" : null;
|
|
22737
|
+
};
|
|
22738
|
+
var agentBranches = (input, rows) => {
|
|
22739
|
+
const { id, agentId } = input.session;
|
|
22740
|
+
const bound = agentId ? rows.findLast((row) => row.type === "worktree.bound" && row.actor.session === id && row.actor.agentId === agentId && typeof row.worktree === "string")?.worktree : undefined;
|
|
22741
|
+
const dirs = typeof bound === "string" ? [input.cwd, bound] : [input.cwd];
|
|
22742
|
+
return dirs.map((dir) => currentBranch(dir)).filter((branch) => !!branch);
|
|
22738
22743
|
};
|
|
22739
22744
|
var standingFor = (input, store, rev) => {
|
|
22740
22745
|
const orders = new Map;
|
|
22741
22746
|
const ledger = readLedger(input.cwd);
|
|
22742
22747
|
const rows = ledger.ok ? ledger.value.rows : [];
|
|
22743
|
-
|
|
22744
|
-
const
|
|
22745
|
-
|
|
22746
|
-
|
|
22747
|
-
|
|
22748
|
-
|
|
22749
|
-
|
|
22748
|
+
const branches = agentBranches(input, rows);
|
|
22749
|
+
const matched = readPlans(store).map((plan) => ({
|
|
22750
|
+
plan,
|
|
22751
|
+
how: worksFor(plan, input, branches)
|
|
22752
|
+
}));
|
|
22753
|
+
const tied = matched.some(({ how }) => how === "slice");
|
|
22754
|
+
const plans = matched.filter(({ how }) => tied ? how === "slice" : how !== null);
|
|
22755
|
+
for (const { plan } of plans)
|
|
22756
|
+
for (const row of activeStanding(rows, plan.name, plan.leads.length ? plan.leads : null))
|
|
22757
|
+
orders.set(row.id, row);
|
|
22758
|
+
return {
|
|
22759
|
+
rev,
|
|
22760
|
+
orders,
|
|
22761
|
+
rows,
|
|
22762
|
+
fanouts: new Set(plans.map(({ plan }) => plan.name))
|
|
22763
|
+
};
|
|
22750
22764
|
};
|
|
22751
22765
|
var located = (input) => {
|
|
22752
22766
|
const store = input.session.id ? gitStoreDir2(input.cwd) : null;
|
|
22753
22767
|
const rev = store ? readStandingRev2(store) : null;
|
|
22754
22768
|
if (!store || rev === null)
|
|
22755
22769
|
return null;
|
|
22756
|
-
return {
|
|
22770
|
+
return {
|
|
22771
|
+
store,
|
|
22772
|
+
rev,
|
|
22773
|
+
file: standingSeenFile2(store, input.session.id, input.session.agentId)
|
|
22774
|
+
};
|
|
22757
22775
|
};
|
|
22758
22776
|
var seedStanding = (input) => {
|
|
22759
22777
|
try {
|
|
@@ -22761,7 +22779,10 @@ var seedStanding = (input) => {
|
|
|
22761
22779
|
if (!where)
|
|
22762
22780
|
return;
|
|
22763
22781
|
const now = standingFor(input, where.store, where.rev);
|
|
22764
|
-
writeStandingSeen2(where.file, {
|
|
22782
|
+
writeStandingSeen2(where.file, {
|
|
22783
|
+
rev: where.rev,
|
|
22784
|
+
ids: [...now.orders.keys()]
|
|
22785
|
+
});
|
|
22765
22786
|
} catch {}
|
|
22766
22787
|
};
|
|
22767
22788
|
var fanoutOf = (row) => typeof row.fanout === "string" ? row.fanout : "?";
|
|
@@ -22769,7 +22790,7 @@ var changedSince = (now, ids) => {
|
|
|
22769
22790
|
const known = new Set(ids);
|
|
22770
22791
|
const added = [...now.orders.values()].filter((row) => !known.has(row.id));
|
|
22771
22792
|
const byId = new Map(now.rows.map((row) => [row.id, row]));
|
|
22772
|
-
const dropped = ids.filter((id) => !now.orders.has(id)).map((id) => byId.get(id)).filter((row) => row !== undefined);
|
|
22793
|
+
const dropped = ids.filter((id) => !now.orders.has(id)).map((id) => byId.get(id)).filter((row) => row !== undefined && now.fanouts.has(fanoutOf(row)));
|
|
22773
22794
|
if (!added.length && !dropped.length)
|
|
22774
22795
|
return null;
|
|
22775
22796
|
const fanouts = [...new Set([...added, ...dropped].map(fanoutOf))].join(", ");
|
|
@@ -22792,7 +22813,10 @@ var standingDelta = (input) => {
|
|
|
22792
22813
|
if (seen.rev === where.rev)
|
|
22793
22814
|
return null;
|
|
22794
22815
|
const now = standingFor(input, where.store, where.rev);
|
|
22795
|
-
writeStandingSeen2(where.file, {
|
|
22816
|
+
writeStandingSeen2(where.file, {
|
|
22817
|
+
rev: where.rev,
|
|
22818
|
+
ids: [...now.orders.keys()]
|
|
22819
|
+
});
|
|
22796
22820
|
return changedSince(now, seen.ids);
|
|
22797
22821
|
} catch {
|
|
22798
22822
|
return null;
|
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-p3rqtsq1.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.0
|
|
3
|
+
"version": "1.1.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.0
|
|
45
|
-
"@workit-dev/mcp": "^1.0
|
|
44
|
+
"@workit-dev/core": "^1.1.0",
|
|
45
|
+
"@workit-dev/mcp": "^1.1.0"
|
|
46
46
|
},
|
|
47
47
|
"engines": {
|
|
48
48
|
"node": ">=24"
|
|
@@ -41,7 +41,7 @@ the same check. Fix round and recheck both failed: a decider (read the `workit-f
|
|
|
41
41
|
and the stop point unless merge is granted.
|
|
42
42
|
3. **Conflicts or a required rebase.** Rewrite only a branch this session or
|
|
43
43
|
its stack created (yours in `workit ledger list --type commit.recorded` or
|
|
44
|
-
`workit stack status`):
|
|
44
|
+
`workit stack status`): `workit git rebase`, then `workit git push
|
|
45
45
|
--force-with-lease` (`workit stack sync` in a stack). Anyone else's branch:
|
|
46
46
|
report that a rebase is needed and stop.
|
|
47
47
|
4. **Review threads** (`workit pr threads`). Check each claim in the code; fix
|