@workit-dev/codex 2.1.1 → 2.4.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
|
@@ -15539,7 +15539,8 @@ var workspaceConfigSchema = object({
|
|
|
15539
15539
|
commitPolicy: workspaceCommitPolicySchema.optional().describe("The commit message rules."),
|
|
15540
15540
|
defaultProfile: nonBlank.optional().describe("The profile used when none is named; must be a key of `profiles`."),
|
|
15541
15541
|
profiles: record(nonBlank, workspaceProfileSchema).optional().describe("Named branch/commit policy variants of this workspace."),
|
|
15542
|
-
releaseTracks: record(nonBlank, releaseTrackSchema).optional().describe("Named release tracks: production and integration branches, naming and versioning.")
|
|
15542
|
+
releaseTracks: record(nonBlank, releaseTrackSchema).optional().describe("Named release tracks: production and integration branches, naming and versioning."),
|
|
15543
|
+
releasePackages: unknown().optional().describe("Packages released from this repository's own release line under their own tag namespace (`pkg-a@0.1.0`): keyed by package name, each `{ tagNamespace?, changelogPath? }` (default namespace `<name>@`). `workit release package <name> <version>` tags and publishes one.")
|
|
15543
15544
|
}).passthrough().superRefine((workspace, context) => {
|
|
15544
15545
|
if (workspace.defaultProfile !== undefined && !Object.hasOwn(workspace.profiles ?? {}, workspace.defaultProfile)) {
|
|
15545
15546
|
context.addIssue({
|
|
@@ -24458,6 +24459,9 @@ var SCOPE_FIELDS = new Set([
|
|
|
24458
24459
|
"youtrack"
|
|
24459
24460
|
]);
|
|
24460
24461
|
|
|
24462
|
+
// packages/workit-core/src/core/release-packages.ts
|
|
24463
|
+
var KNOWN_FIELDS2 = new Set(["tagNamespace", "changelogPath"]);
|
|
24464
|
+
|
|
24461
24465
|
// packages/workit-core/src/hooks/raw-git.ts
|
|
24462
24466
|
var SHELLS = new Set(["sh", "bash", "zsh", "dash", "ksh", "ash", "mksh", "yash", "fish"]);
|
|
24463
24467
|
var POWERSHELLS = new Set(["pwsh", "powershell"]);
|
|
@@ -7377,7 +7377,8 @@ var workspaceConfigSchema = object({
|
|
|
7377
7377
|
commitPolicy: workspaceCommitPolicySchema.optional().describe("The commit message rules."),
|
|
7378
7378
|
defaultProfile: nonBlank.optional().describe("The profile used when none is named; must be a key of `profiles`."),
|
|
7379
7379
|
profiles: record(nonBlank, workspaceProfileSchema).optional().describe("Named branch/commit policy variants of this workspace."),
|
|
7380
|
-
releaseTracks: record(nonBlank, releaseTrackSchema).optional().describe("Named release tracks: production and integration branches, naming and versioning.")
|
|
7380
|
+
releaseTracks: record(nonBlank, releaseTrackSchema).optional().describe("Named release tracks: production and integration branches, naming and versioning."),
|
|
7381
|
+
releasePackages: unknown().optional().describe("Packages released from this repository's own release line under their own tag namespace (`pkg-a@0.1.0`): keyed by package name, each `{ tagNamespace?, changelogPath? }` (default namespace `<name>@`). `workit release package <name> <version>` tags and publishes one.")
|
|
7381
7382
|
}).passthrough().superRefine((workspace, context) => {
|
|
7382
7383
|
if (workspace.defaultProfile !== undefined && !Object.hasOwn(workspace.profiles ?? {}, workspace.defaultProfile)) {
|
|
7383
7384
|
context.addIssue({
|
|
@@ -7821,6 +7822,10 @@ var inheritedSetting = (cwd, dir, has) => {
|
|
|
7821
7822
|
source: [selected, ...enclosing].find(has) ?? null
|
|
7822
7823
|
};
|
|
7823
7824
|
};
|
|
7825
|
+
var resolveRuntimeReleasePackages = (cwd, dir) => {
|
|
7826
|
+
const found = inheritedSetting(cwd, dir, (entry) => entry.releasePackages !== undefined);
|
|
7827
|
+
return found?.source ? { workspace: found.source.name, releasePackages: found.source.releasePackages } : null;
|
|
7828
|
+
};
|
|
7824
7829
|
var workspaceTrailers = (cwd, dir) => {
|
|
7825
7830
|
const found = inheritedSetting(cwd, dir, (entry) => typeof entry.trailers === "boolean");
|
|
7826
7831
|
return {
|
|
@@ -7830,6 +7835,14 @@ var workspaceTrailers = (cwd, dir) => {
|
|
|
7830
7835
|
};
|
|
7831
7836
|
};
|
|
7832
7837
|
var workspaceLiveSessionGuard = (cwd, dir) => inheritedSetting(cwd, dir, (entry) => typeof entry.liveSessionGuard === "boolean")?.source?.liveSessionGuard !== false;
|
|
7838
|
+
var changelogPathOf = (value) => {
|
|
7839
|
+
if (typeof value !== "string")
|
|
7840
|
+
return null;
|
|
7841
|
+
const parts = value.trim().replaceAll("\\", "/").split("/").filter((part) => part && part !== ".");
|
|
7842
|
+
if (!parts.length || value.trim().startsWith("/") || /^[A-Za-z]:/u.test(value.trim()))
|
|
7843
|
+
return null;
|
|
7844
|
+
return parts.includes("..") ? null : parts.join("/");
|
|
7845
|
+
};
|
|
7833
7846
|
var modelSources = (cwd, dir) => {
|
|
7834
7847
|
const out = [];
|
|
7835
7848
|
try {
|
|
@@ -16012,6 +16025,69 @@ var SCOPE_FIELDS = new Set([
|
|
|
16012
16025
|
"youtrack"
|
|
16013
16026
|
]);
|
|
16014
16027
|
|
|
16028
|
+
// packages/workit-core/src/core/release-packages.ts
|
|
16029
|
+
var KNOWN_FIELDS2 = new Set(["tagNamespace", "changelogPath"]);
|
|
16030
|
+
var isRecord3 = (value) => typeof value === "object" && value !== null && !Array.isArray(value);
|
|
16031
|
+
var NAMESPACE = /^[A-Za-z@][\w.@/+-]*$/u;
|
|
16032
|
+
var validTagNamespace = (value) => NAMESPACE.test(value) && !value.includes("..") && !value.includes("@{") && !value.includes("//") && !value.endsWith(".lock") && !/\d$/u.test(value);
|
|
16033
|
+
function readReleasePackages(raw) {
|
|
16034
|
+
const out = { packages: [], issues: [] };
|
|
16035
|
+
if (raw === undefined || raw === null)
|
|
16036
|
+
return out;
|
|
16037
|
+
if (!isRecord3(raw)) {
|
|
16038
|
+
out.issues.push("releasePackages is not an object; ignored");
|
|
16039
|
+
return out;
|
|
16040
|
+
}
|
|
16041
|
+
const seen = new Map;
|
|
16042
|
+
for (const [name, entry] of Object.entries(raw).toSorted(([a], [b]) => a < b ? -1 : 1)) {
|
|
16043
|
+
const label = `release package ${JSON.stringify(name)}`;
|
|
16044
|
+
if (!name.trim() || name.trim() !== name) {
|
|
16045
|
+
out.issues.push(`${label}: a blank or padded name; ignored`);
|
|
16046
|
+
continue;
|
|
16047
|
+
}
|
|
16048
|
+
if (!isRecord3(entry)) {
|
|
16049
|
+
out.issues.push(`${label} is not an object; ignored`);
|
|
16050
|
+
continue;
|
|
16051
|
+
}
|
|
16052
|
+
for (const key of Object.keys(entry))
|
|
16053
|
+
if (!KNOWN_FIELDS2.has(key))
|
|
16054
|
+
out.issues.push(`${label} ${key}: unknown field, ignored`);
|
|
16055
|
+
const tagNamespace = typeof entry.tagNamespace === "string" ? entry.tagNamespace.trim() : `${name}@`;
|
|
16056
|
+
if (!validTagNamespace(tagNamespace)) {
|
|
16057
|
+
out.issues.push(`${label} tagNamespace ${JSON.stringify(tagNamespace)}: not a tag prefix (a letter first, no trailing digit); the package is ignored`);
|
|
16058
|
+
continue;
|
|
16059
|
+
}
|
|
16060
|
+
const owner = seen.get(tagNamespace);
|
|
16061
|
+
if (owner) {
|
|
16062
|
+
out.issues.push(`${label} tagNamespace ${tagNamespace}: already ${owner}'s; ignored`);
|
|
16063
|
+
continue;
|
|
16064
|
+
}
|
|
16065
|
+
let changelogPath = null;
|
|
16066
|
+
if (entry.changelogPath !== undefined) {
|
|
16067
|
+
changelogPath = changelogPathOf(entry.changelogPath);
|
|
16068
|
+
if (!changelogPath)
|
|
16069
|
+
out.issues.push(`${label} changelogPath: not a repo-relative path; ignored`);
|
|
16070
|
+
}
|
|
16071
|
+
seen.set(tagNamespace, name);
|
|
16072
|
+
out.packages.push({ name, tagNamespace, changelogPath });
|
|
16073
|
+
}
|
|
16074
|
+
return out;
|
|
16075
|
+
}
|
|
16076
|
+
function workspaceReleasePackages(cwd, dir) {
|
|
16077
|
+
let raw;
|
|
16078
|
+
try {
|
|
16079
|
+
raw = resolveRuntimeReleasePackages(cwd, dir)?.releasePackages;
|
|
16080
|
+
} catch {
|
|
16081
|
+
return { packages: [], issues: [] };
|
|
16082
|
+
}
|
|
16083
|
+
return readReleasePackages(raw);
|
|
16084
|
+
}
|
|
16085
|
+
function packageOfTag(tag, packages) {
|
|
16086
|
+
const pkg = packages.filter((entry) => tag.startsWith(entry.tagNamespace) && /^\d/u.test(tag.slice(entry.tagNamespace.length))).toSorted((a, b) => b.tagNamespace.length - a.tagNamespace.length)[0];
|
|
16087
|
+
return pkg ? { pkg, version: tag.slice(pkg.tagNamespace.length) } : null;
|
|
16088
|
+
}
|
|
16089
|
+
var packageTagShapes = (packages) => packages.map((entry) => `${entry.tagNamespace}<version>`);
|
|
16090
|
+
|
|
16015
16091
|
// packages/workit-core/src/hooks/session-marker.ts
|
|
16016
16092
|
import { createHash as createHash13 } from "node:crypto";
|
|
16017
16093
|
import fs15 from "node:fs";
|
|
@@ -17854,15 +17930,20 @@ var guardedTarget = (dir, target) => {
|
|
|
17854
17930
|
};
|
|
17855
17931
|
var isTag = (facts, name) => facts.tags.has(name) && !facts.heads.has(name);
|
|
17856
17932
|
var tagRefusal = (action, facts, dir) => {
|
|
17933
|
+
let packages;
|
|
17934
|
+
const unmade = action.targets.filter((name) => name !== null && /\d/u.test(name) && !facts.tags.has(name) && !facts.heads.has(name) && packageOfTag(name, packages ??= workspaceReleasePackages(dir).packages) !== null);
|
|
17857
17935
|
const tags = [
|
|
17858
17936
|
...action.tags ?? [],
|
|
17859
|
-
...action.targets.filter((name) => name !== null && isTag(facts, name))
|
|
17937
|
+
...action.targets.filter((name) => name !== null && isTag(facts, name)),
|
|
17938
|
+
...unmade
|
|
17860
17939
|
];
|
|
17861
17940
|
if (!tags.length && !action.allTags)
|
|
17862
17941
|
return null;
|
|
17863
17942
|
const shape = `${releaseTagPrefixOf(dir)}<version>`;
|
|
17943
|
+
const shapes = [shape, ...packageTagShapes(packages ?? workspaceReleasePackages(dir).packages)];
|
|
17864
17944
|
const named = tags.length ? tags.join(" --release ") : shape;
|
|
17865
|
-
|
|
17945
|
+
const create = unmade.length ? ` ${unmade.join(", ")} is not a tag here yet: create it first with ${quote(`git tag -a ${unmade[0]} -m '<notes>' <release commit>`)}, or let ${quote("workit release package <name> <version>")} tag, push and publish it.` : "";
|
|
17946
|
+
return `workit: raw ${quote(`git push${action.allTags ? " --tags" : ""}`)} of ${tags.length ? `tag ${tags.join(", ")}` : "tags"} bypasses the release grant. Push a release tag with ${quote(`workit git push --release ${named}`)} (${shapes.join(", ")} tags whose commit the production branch already has; a tag never moves), under the ${quote("release")} grant (if refused, ask the user to run ${quote("workit grant set <workspace> release=true")}).${create}`;
|
|
17866
17947
|
};
|
|
17867
17948
|
var remoteHeads = (repo, remote) => {
|
|
17868
17949
|
const listed = spawnSync13("git", ["ls-remote", "--heads", remote], {
|
|
@@ -18628,7 +18709,7 @@ var readText3 = (file) => {
|
|
|
18628
18709
|
throw error;
|
|
18629
18710
|
}
|
|
18630
18711
|
};
|
|
18631
|
-
var
|
|
18712
|
+
var isRecord4 = (value) => typeof value === "object" && value !== null && !Array.isArray(value);
|
|
18632
18713
|
function parseJsonc(text) {
|
|
18633
18714
|
let out = "";
|
|
18634
18715
|
for (let index = 0;index < text.length; index += 1) {
|
|
@@ -18702,12 +18783,12 @@ function claudeRules(cwd, env = process.env) {
|
|
|
18702
18783
|
if (text === null)
|
|
18703
18784
|
continue;
|
|
18704
18785
|
const value = JSON.parse(text);
|
|
18705
|
-
if (!
|
|
18786
|
+
if (!isRecord4(value))
|
|
18706
18787
|
return "unreadable";
|
|
18707
18788
|
const permissions = value.permissions;
|
|
18708
18789
|
if (permissions === undefined)
|
|
18709
18790
|
continue;
|
|
18710
|
-
if (!
|
|
18791
|
+
if (!isRecord4(permissions))
|
|
18711
18792
|
return "unreadable";
|
|
18712
18793
|
for (const [key, bucket] of [
|
|
18713
18794
|
["deny", rules.deny],
|
|
@@ -18741,7 +18822,7 @@ var opencodePermission = (permission, rules) => {
|
|
|
18741
18822
|
(permission === "allow" ? rules.allow : rules.deny).push("");
|
|
18742
18823
|
return ["allow", "ask", "deny"].includes(permission);
|
|
18743
18824
|
}
|
|
18744
|
-
if (!
|
|
18825
|
+
if (!isRecord4(permission))
|
|
18745
18826
|
return false;
|
|
18746
18827
|
for (const key of ["bash", "shell"]) {
|
|
18747
18828
|
const value = permission[key];
|
|
@@ -18753,7 +18834,7 @@ var opencodePermission = (permission, rules) => {
|
|
|
18753
18834
|
(value === "allow" ? rules.allow : rules.deny).push("");
|
|
18754
18835
|
continue;
|
|
18755
18836
|
}
|
|
18756
|
-
if (!
|
|
18837
|
+
if (!isRecord4(value))
|
|
18757
18838
|
return false;
|
|
18758
18839
|
for (const [pattern, action] of Object.entries(value)) {
|
|
18759
18840
|
if (action !== "allow" && action !== "ask" && action !== "deny")
|
|
@@ -18764,15 +18845,15 @@ var opencodePermission = (permission, rules) => {
|
|
|
18764
18845
|
return true;
|
|
18765
18846
|
};
|
|
18766
18847
|
var opencodeConfig = (value, rules) => {
|
|
18767
|
-
if (!
|
|
18848
|
+
if (!isRecord4(value))
|
|
18768
18849
|
return false;
|
|
18769
18850
|
if (!opencodePermission(value.permission, rules))
|
|
18770
18851
|
return false;
|
|
18771
18852
|
if (value.agent === undefined)
|
|
18772
18853
|
return true;
|
|
18773
|
-
if (!
|
|
18854
|
+
if (!isRecord4(value.agent))
|
|
18774
18855
|
return false;
|
|
18775
|
-
return Object.values(value.agent).every((agent) =>
|
|
18856
|
+
return Object.values(value.agent).every((agent) => isRecord4(agent) && opencodePermission(agent.permission, rules));
|
|
18776
18857
|
};
|
|
18777
18858
|
function opencodeRules(cwd, env = process.env) {
|
|
18778
18859
|
const rules = EMPTY2();
|
|
@@ -18862,11 +18943,11 @@ function cursorRules(cwd, env = process.env) {
|
|
|
18862
18943
|
if (text === null)
|
|
18863
18944
|
continue;
|
|
18864
18945
|
const value = JSON.parse(text);
|
|
18865
|
-
if (!
|
|
18946
|
+
if (!isRecord4(value))
|
|
18866
18947
|
return "unreadable";
|
|
18867
18948
|
if (value.permissions === undefined)
|
|
18868
18949
|
continue;
|
|
18869
|
-
if (!
|
|
18950
|
+
if (!isRecord4(value.permissions))
|
|
18870
18951
|
return "unreadable";
|
|
18871
18952
|
for (const [key, bucket] of [
|
|
18872
18953
|
["deny", rules.deny],
|
|
@@ -19202,11 +19283,11 @@ var readJson = (file) => {
|
|
|
19202
19283
|
return;
|
|
19203
19284
|
}
|
|
19204
19285
|
};
|
|
19205
|
-
var
|
|
19286
|
+
var isRecord5 = (value) => typeof value === "object" && value !== null && !Array.isArray(value);
|
|
19206
19287
|
var stringList = (value) => Array.isArray(value) ? value.filter((item) => typeof item === "string") : [];
|
|
19207
19288
|
function machinePatterns(env) {
|
|
19208
19289
|
const value = readJson(heavyCommandsFile(env));
|
|
19209
|
-
return
|
|
19290
|
+
return isRecord5(value) ? stringList(value.patterns) : [];
|
|
19210
19291
|
}
|
|
19211
19292
|
function repoPatterns(cwd) {
|
|
19212
19293
|
return repoHeavyCommands(gitTop(cwd) ?? path27.resolve(cwd));
|
|
@@ -21491,7 +21572,7 @@ ${line}` };
|
|
|
21491
21572
|
// packages/workit-core/src/hooks/hosts/fields.ts
|
|
21492
21573
|
import { existsSync as existsSync11, realpathSync as realpathSync8, statSync as statSync4 } from "node:fs";
|
|
21493
21574
|
import path31 from "node:path";
|
|
21494
|
-
var
|
|
21575
|
+
var isRecord6 = (value) => value !== null && typeof value === "object" && !Array.isArray(value);
|
|
21495
21576
|
var nonEmpty2 = (value) => typeof value === "string" && value.trim() !== "";
|
|
21496
21577
|
var optionalText = (value) => typeof value === "string" ? value : null;
|
|
21497
21578
|
var existingDirectory = (value) => {
|
|
@@ -21548,7 +21629,7 @@ var isWriteTool = (name) => typeof name === "string" && WRITE_TOOLS.has(name.toL
|
|
|
21548
21629
|
var PATH_KEYS = ["file_path", "filePath", "notebook_path", "path", "target_file", "file"];
|
|
21549
21630
|
var PATCH_HEADER = /^[ \t]*\*\*\* (?:(?:Add|Update|Delete) File|Move to): (.+)$/gm;
|
|
21550
21631
|
var writePaths = (input) => {
|
|
21551
|
-
if (!
|
|
21632
|
+
if (!isRecord6(input))
|
|
21552
21633
|
return [];
|
|
21553
21634
|
const paths = PATH_KEYS.map((key) => input[key]).filter(nonEmpty2);
|
|
21554
21635
|
for (const value of Object.values(input))
|
|
@@ -21843,7 +21924,7 @@ var SHELL_TOOLS2 = new Set(["bash", "unified-exec"]);
|
|
|
21843
21924
|
var isShellTool = (name) => SHELL_TOOLS2.has(String(name).toLowerCase());
|
|
21844
21925
|
var SOURCES2 = new Set(["startup", "resume", "clear", "compact", "fork"]);
|
|
21845
21926
|
var parseCodexHookInput = (value) => {
|
|
21846
|
-
if (!
|
|
21927
|
+
if (!isRecord6(value) || !Object.hasOwn(EVENTS, String(value.hook_event_name)))
|
|
21847
21928
|
return { ok: false, error: "hook_event_name is required" };
|
|
21848
21929
|
const event = value.hook_event_name;
|
|
21849
21930
|
const cwd = existingDirectory(value.cwd);
|
|
@@ -21852,7 +21933,7 @@ var parseCodexHookInput = (value) => {
|
|
|
21852
21933
|
const toolEvent = event === "PreToolUse" || event === "PostToolUse";
|
|
21853
21934
|
if (toolEvent && !nonEmpty2(value.tool_name))
|
|
21854
21935
|
return { ok: false, error: "tool_name is required" };
|
|
21855
|
-
const command =
|
|
21936
|
+
const command = isRecord6(value.tool_input) ? commandText(value.tool_input.command) : null;
|
|
21856
21937
|
if (toolEvent && isShellTool(value.tool_name) && !command)
|
|
21857
21938
|
return { ok: false, error: "tool_input.command is required for shell tools" };
|
|
21858
21939
|
if (event === "SubagentStart" && !nonEmpty2(value.agent_id))
|
|
@@ -21966,7 +22047,7 @@ var codexAdapter = {
|
|
|
21966
22047
|
const host = detectCodexSurface(env);
|
|
21967
22048
|
const parsed = parseCodexHookInput(raw);
|
|
21968
22049
|
if (!parsed.ok) {
|
|
21969
|
-
const native =
|
|
22050
|
+
const native = isRecord6(raw) && Object.hasOwn(EVENTS, String(raw.hook_event_name)) ? raw.hook_event_name : null;
|
|
21970
22051
|
return { ok: false, error: parsed.error, native, event: native ? EVENTS[native] : null };
|
|
21971
22052
|
}
|
|
21972
22053
|
const input = parsed.data;
|
package/dist/workit-hook.js
CHANGED
|
@@ -98,7 +98,7 @@ if (quiet) {
|
|
|
98
98
|
`);
|
|
99
99
|
} else {
|
|
100
100
|
try {
|
|
101
|
-
const { runCodexHook } = await import("./workit-hook-
|
|
101
|
+
const { runCodexHook } = await import("./workit-hook-475yp2qr.js");
|
|
102
102
|
await runCodexHook([payload]);
|
|
103
103
|
} catch (error) {
|
|
104
104
|
const { answerRuntimeFailure } = await import("./workit-hook-9k8dtngs.js");
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@workit-dev/codex",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.4.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": "^2.
|
|
45
|
-
"@workit-dev/mcp": "^2.
|
|
44
|
+
"@workit-dev/core": "^2.4.0",
|
|
45
|
+
"@workit-dev/mcp": "^2.4.0"
|
|
46
46
|
},
|
|
47
47
|
"engines": {
|
|
48
48
|
"node": ">=24"
|
|
@@ -37,3 +37,11 @@ into the trunk instead, its body the release notes (draft and approve them
|
|
|
37
37
|
first, as in step 3). Once it merges, tag the merge and run
|
|
38
38
|
`workit git push --release <tag>`: it publishes the forge release with the
|
|
39
39
|
same notes (under `review`, only the approved draft).
|
|
40
|
+
|
|
41
|
+
## Release package
|
|
42
|
+
|
|
43
|
+
A workspace `releasePackages` entry, after the workspace release finished:
|
|
44
|
+
`workit release package <name> <version>` tags `<name>@<version>` on the
|
|
45
|
+
release commit (`--at <ref>`), pushes it, creates its forge release (not
|
|
46
|
+
Latest; `--latest` only when asked) and verifies it. Notes:
|
|
47
|
+
`workit release notes draft <name>@<version>`.
|