@workit-dev/codex 2.11.1 → 2.13.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
|
@@ -6621,13 +6621,13 @@ var require_dist = __commonJS(function(exports, module) {
|
|
|
6621
6621
|
});
|
|
6622
6622
|
|
|
6623
6623
|
// packages/workit-codex/scripts/launch-mcp.ts
|
|
6624
|
-
import { existsSync as
|
|
6624
|
+
import { existsSync as existsSync18, realpathSync as realpathSync12, statSync as statSync6 } from "node:fs";
|
|
6625
6625
|
import path38 from "node:path";
|
|
6626
6626
|
import { fileURLToPath as fileURLToPath3 } from "node:url";
|
|
6627
6627
|
|
|
6628
6628
|
// packages/workit-core/src/core.ts
|
|
6629
6629
|
import { spawnSync as spawnSync20 } from "node:child_process";
|
|
6630
|
-
import { existsSync as
|
|
6630
|
+
import { existsSync as existsSync13, realpathSync as realpathSync9 } from "node:fs";
|
|
6631
6631
|
import path31 from "node:path";
|
|
6632
6632
|
|
|
6633
6633
|
// packages/workit-core/src/core/task-contract.ts
|
|
@@ -15510,6 +15510,7 @@ var workspaceConfigSchema = object({
|
|
|
15510
15510
|
releaseNotes: unknown().optional().describe("The release notes `workit release finish` publishes on the forge release: `auto` (default: the draft when there is one, else the notes built from the version's changelog section), `off` (no forge release) or `review` (finish refuses until `workit release notes approve`). A release track overrides it."),
|
|
15511
15511
|
trailers: boolean2().optional().describe("Whether commits get the `Workit-Session:` trailer (default true). With false, authorship lives in the ledger only."),
|
|
15512
15512
|
deleteBranch: boolean2().optional().describe("Whether `workit pr merge` deletes the head branch after a merge (default true); `--keep-branch` opts out for one merge."),
|
|
15513
|
+
cleanup: unknown().optional().describe("What happens when work finishes: `auto` (default) removes the delivered branch's clean Workit worktree and local branch, switches a clean checkout on it back to the trunk, and stops the processes registered inside them; `keep` removes and stops nothing. A value Workit does not know reads as `keep`."),
|
|
15513
15514
|
liveSessionGuard: boolean2().optional().describe("Whether the live-session guard denies edits in a checkout another live agent session owns (default true)."),
|
|
15514
15515
|
fanout: object({
|
|
15515
15516
|
tierModels: unknown().optional().describe("The model per slice TIER (mundane, standard, hard), as one name or per host.")
|
|
@@ -24034,6 +24035,7 @@ var exportDigest = (bundle) => sha256({
|
|
|
24034
24035
|
task: bundle.task
|
|
24035
24036
|
});
|
|
24036
24037
|
// packages/workit-core/src/autonomy.ts
|
|
24038
|
+
import { closeSync as closeSync2, copyFileSync as copyFileSync2, existsSync as existsSync11, openSync as openSync2 } from "node:fs";
|
|
24037
24039
|
import path26 from "node:path";
|
|
24038
24040
|
|
|
24039
24041
|
// packages/workit-core/src/core/eval-world.ts
|
|
@@ -24130,12 +24132,36 @@ function checkSeal(dir) {
|
|
|
24130
24132
|
}
|
|
24131
24133
|
|
|
24132
24134
|
// packages/workit-core/src/autonomy.ts
|
|
24133
|
-
var
|
|
24135
|
+
var accountHomeDir = () => {
|
|
24134
24136
|
const home = grantsHome.resolve();
|
|
24135
24137
|
return home === null ? null : configDir({ HOME: home });
|
|
24136
24138
|
};
|
|
24137
|
-
var
|
|
24139
|
+
var deniedFile = (dir) => {
|
|
24140
|
+
for (const name of ["workspaces.json", SEAL_FILE]) {
|
|
24141
|
+
const file = path26.join(dir, name);
|
|
24142
|
+
try {
|
|
24143
|
+
closeSync2(openSync2(file, "r"));
|
|
24144
|
+
} catch (error) {
|
|
24145
|
+
const code = error.code;
|
|
24146
|
+
if (code === "EACCES" || code === "EPERM")
|
|
24147
|
+
return file;
|
|
24148
|
+
}
|
|
24149
|
+
}
|
|
24150
|
+
return null;
|
|
24151
|
+
};
|
|
24152
|
+
var accountDir = () => {
|
|
24153
|
+
const dir = accountHomeDir();
|
|
24154
|
+
return dir === null || deniedFile(dir) !== null ? null : dir;
|
|
24155
|
+
};
|
|
24156
|
+
var grantsDir = () => accountHomeDir() ?? resolveConfigDir();
|
|
24138
24157
|
var NO_ACCOUNT = "no OS account record answered (core/account-home.ts), so no grants are read: the D4 defaults apply";
|
|
24158
|
+
var accountUnread = () => {
|
|
24159
|
+
const dir = accountHomeDir();
|
|
24160
|
+
if (dir === null)
|
|
24161
|
+
return NO_ACCOUNT;
|
|
24162
|
+
const file = deniedFile(dir);
|
|
24163
|
+
return file === null ? null : `the account's ${path26.basename(file)} cannot be read (permission denied), so it reads as no workspace entries: no grants, no models, the D4 defaults apply`;
|
|
24164
|
+
};
|
|
24139
24165
|
var entriesIn = (dir) => dir === null ? [] : loadWorkspacesFrom(dir);
|
|
24140
24166
|
var fileSource = (dir = accountDir()) => ({
|
|
24141
24167
|
resolve: (cwd, name) => dir === null ? null : resolveWorkspaceFrom(cwd, dir, name),
|
|
@@ -24178,7 +24204,7 @@ var benchWorld = (cwd) => {
|
|
|
24178
24204
|
var grantsOverride = () => {
|
|
24179
24205
|
const shown = shownGrantsDir();
|
|
24180
24206
|
if (shown === null)
|
|
24181
|
-
return NO_ACCOUNT;
|
|
24207
|
+
return accountUnread() ?? NO_ACCOUNT;
|
|
24182
24208
|
const configured = path26.resolve(resolveConfigDir());
|
|
24183
24209
|
return configured === path26.resolve(shown) ? null : `the config directory is redirected to ${configured} (WORKIT_CONFIG, WORKIT_CONFIG_DIR or XDG_CONFIG_HOME), but that override does not apply to grants: grants are read only from ${path26.join(grantsDir(), "workspaces.json")}, and under a redirect they never exceed the D4 defaults`;
|
|
24184
24210
|
};
|
|
@@ -24347,9 +24373,10 @@ function capAt(source, named, where, by, why, main = false) {
|
|
|
24347
24373
|
}
|
|
24348
24374
|
function resolveAutonomy(cwd, target) {
|
|
24349
24375
|
const world = benchWorld(cwd);
|
|
24376
|
+
const unread = world ? null : accountUnread();
|
|
24377
|
+
if (unread !== null)
|
|
24378
|
+
return { ...autonomyOf(null), note: unread };
|
|
24350
24379
|
const override = world ? null : grantsOverride();
|
|
24351
|
-
if (override === NO_ACCOUNT)
|
|
24352
|
-
return { ...autonomyOf(null), note: override };
|
|
24353
24380
|
let resolved;
|
|
24354
24381
|
const once = typeof target === "function" ? () => resolved ??= target() : target;
|
|
24355
24382
|
const account = accountAuthority(cwd, world, once);
|
|
@@ -26557,7 +26584,7 @@ class WorkitCore {
|
|
|
26557
26584
|
}
|
|
26558
26585
|
// packages/workit-core/src/core/repo-context.ts
|
|
26559
26586
|
import { spawnSync as spawnSync16 } from "node:child_process";
|
|
26560
|
-
import { existsSync as
|
|
26587
|
+
import { existsSync as existsSync12, readFileSync as readFileSync11, readdirSync as readdirSync4 } from "node:fs";
|
|
26561
26588
|
import path27 from "node:path";
|
|
26562
26589
|
var isSafeContextRange = (value) => value.length <= 4096 && (() => {
|
|
26563
26590
|
try {
|
|
@@ -26739,7 +26766,7 @@ var diffStatForRange = (cwd, range) => {
|
|
|
26739
26766
|
};
|
|
26740
26767
|
var packageScripts = (cwd, keys) => {
|
|
26741
26768
|
const pkgPath = path27.join(cwd, "package.json");
|
|
26742
|
-
if (!
|
|
26769
|
+
if (!existsSync12(pkgPath))
|
|
26743
26770
|
return [];
|
|
26744
26771
|
try {
|
|
26745
26772
|
const pkg = JSON.parse(readFileSync11(pkgPath, "utf8"));
|
|
@@ -26774,7 +26801,7 @@ var documentationFiles = (cwd) => {
|
|
|
26774
26801
|
return matches.toSorted().slice(0, 200);
|
|
26775
26802
|
};
|
|
26776
26803
|
var readTrimmed2 = (file, maxLines) => {
|
|
26777
|
-
if (!
|
|
26804
|
+
if (!existsSync12(file))
|
|
26778
26805
|
return "";
|
|
26779
26806
|
const lines = readFileSync11(file, "utf8").split(`
|
|
26780
26807
|
`);
|
|
@@ -26850,7 +26877,7 @@ ${status.stderr}` : "");
|
|
|
26850
26877
|
stdout += `
|
|
26851
26878
|
`;
|
|
26852
26879
|
stdout += printSection("Recent Validation Signals");
|
|
26853
|
-
if (
|
|
26880
|
+
if (existsSync12(path27.join(cwd, "package.json"))) {
|
|
26854
26881
|
stdout += `package.json detected. Common scripts:
|
|
26855
26882
|
`;
|
|
26856
26883
|
const found = packageScripts(cwd, ["lint", "format:check", "test", "build"]);
|
|
@@ -26859,7 +26886,7 @@ ${status.stderr}` : "");
|
|
|
26859
26886
|
`) + `
|
|
26860
26887
|
`;
|
|
26861
26888
|
}
|
|
26862
|
-
if (
|
|
26889
|
+
if (existsSync12(path27.join(cwd, "Cargo.toml")) || existsSync12(path27.join(cwd, "src-tauri/Cargo.toml"))) {
|
|
26863
26890
|
stdout += `Rust project detected.
|
|
26864
26891
|
`;
|
|
26865
26892
|
}
|
|
@@ -26911,7 +26938,7 @@ function changelogContext(root, range) {
|
|
|
26911
26938
|
`;
|
|
26912
26939
|
stdout += printSection("Existing CHANGELOG.md");
|
|
26913
26940
|
const changelogPath = path27.join(cwd, "CHANGELOG.md");
|
|
26914
|
-
if (
|
|
26941
|
+
if (existsSync12(changelogPath)) {
|
|
26915
26942
|
stdout += readTrimmed2(changelogPath, 260) + `
|
|
26916
26943
|
`;
|
|
26917
26944
|
} else {
|
|
@@ -26953,7 +26980,7 @@ function docsRefreshContext(root, range) {
|
|
|
26953
26980
|
`;
|
|
26954
26981
|
stdout += printSection("README Preview");
|
|
26955
26982
|
const readme = path27.join(cwd, "README.md");
|
|
26956
|
-
if (
|
|
26983
|
+
if (existsSync12(readme)) {
|
|
26957
26984
|
stdout += readTrimmed2(readme, 220) + `
|
|
26958
26985
|
`;
|
|
26959
26986
|
} else {
|
|
@@ -26962,7 +26989,7 @@ function docsRefreshContext(root, range) {
|
|
|
26962
26989
|
}
|
|
26963
26990
|
stdout += printSection("Package Scripts");
|
|
26964
26991
|
const pkgPath = path27.join(cwd, "package.json");
|
|
26965
|
-
if (
|
|
26992
|
+
if (existsSync12(pkgPath)) {
|
|
26966
26993
|
try {
|
|
26967
26994
|
const pkg = JSON.parse(readFileSync11(pkgPath, "utf8"));
|
|
26968
26995
|
stdout += JSON.stringify({ name: pkg.name, version: pkg.version, scripts: pkg.scripts }, null, 2) + `
|
|
@@ -27018,7 +27045,7 @@ function releaseNotesContext(root, rangeOrTag) {
|
|
|
27018
27045
|
`;
|
|
27019
27046
|
stdout += printSection("Existing Release Files");
|
|
27020
27047
|
for (const rel of ["CHANGELOG.md", "RELEASE_NOTES.md", ".github/releases.md"]) {
|
|
27021
|
-
if (
|
|
27048
|
+
if (existsSync12(path27.join(cwd, rel)))
|
|
27022
27049
|
stdout += rel + `
|
|
27023
27050
|
`;
|
|
27024
27051
|
}
|
|
@@ -27626,7 +27653,7 @@ function resolveInside(root, candidate) {
|
|
|
27626
27653
|
throw new Error("path must stay inside repository root");
|
|
27627
27654
|
}
|
|
27628
27655
|
let ancestor = target;
|
|
27629
|
-
while (!
|
|
27656
|
+
while (!existsSync13(ancestor))
|
|
27630
27657
|
ancestor = path31.dirname(ancestor);
|
|
27631
27658
|
const canonicalAncestor = realpathSync9(ancestor);
|
|
27632
27659
|
if (canonicalAncestor !== base && !canonicalAncestor.startsWith(base + path31.sep)) {
|
|
@@ -27650,7 +27677,7 @@ function run2(root, executable, args, env = {}) {
|
|
|
27650
27677
|
}
|
|
27651
27678
|
|
|
27652
27679
|
// packages/workit-core/src/core/cli-locate.ts
|
|
27653
|
-
import { closeSync as
|
|
27680
|
+
import { closeSync as closeSync3, existsSync as existsSync14, openSync as openSync3, readSync } from "node:fs";
|
|
27654
27681
|
import path32 from "node:path";
|
|
27655
27682
|
var LAUNCHER_MARKER = "workit-owned-launcher";
|
|
27656
27683
|
var CLI_PACKAGE_PATH = ["node_modules", "@workit-dev", "cli"];
|
|
@@ -27665,7 +27692,7 @@ var ownedCurrentEntry = (env, platform = process.platform) => path32.join(instal
|
|
|
27665
27692
|
var head = (file) => {
|
|
27666
27693
|
let fd;
|
|
27667
27694
|
try {
|
|
27668
|
-
fd =
|
|
27695
|
+
fd = openSync3(file, "r");
|
|
27669
27696
|
const buffer = Buffer.alloc(256);
|
|
27670
27697
|
const read = readSync(fd, buffer, 0, buffer.length, 0);
|
|
27671
27698
|
return buffer.subarray(0, read).toString("utf8");
|
|
@@ -27673,13 +27700,13 @@ var head = (file) => {
|
|
|
27673
27700
|
return "";
|
|
27674
27701
|
} finally {
|
|
27675
27702
|
if (fd !== undefined)
|
|
27676
|
-
|
|
27703
|
+
closeSync3(fd);
|
|
27677
27704
|
}
|
|
27678
27705
|
};
|
|
27679
27706
|
var locateWorkitCli = (options = {}) => {
|
|
27680
27707
|
const env = options.env ?? process.env;
|
|
27681
27708
|
const platform = options.platform ?? process.platform;
|
|
27682
|
-
const exists = options.exists ??
|
|
27709
|
+
const exists = options.exists ?? existsSync14;
|
|
27683
27710
|
const read = options.read ?? head;
|
|
27684
27711
|
const node = options.node ?? process.execPath;
|
|
27685
27712
|
const launcher = ownedLauncherPath(env, platform);
|
|
@@ -27741,7 +27768,7 @@ var SUPPORT_MATRIX = {
|
|
|
27741
27768
|
};
|
|
27742
27769
|
|
|
27743
27770
|
// packages/workit-mcp/src/server.ts
|
|
27744
|
-
import { existsSync as
|
|
27771
|
+
import { existsSync as existsSync15, readFileSync as readFileSync12, realpathSync as realpathSync10 } from "node:fs";
|
|
27745
27772
|
import path33 from "node:path";
|
|
27746
27773
|
// node_modules/@modelcontextprotocol/sdk/dist/esm/server/zod-compat.js
|
|
27747
27774
|
function isZ4Schema(s) {
|
|
@@ -30300,7 +30327,7 @@ function createMcpServer(host, contextProvider) {
|
|
|
30300
30327
|
path33.join(here, "server.ts"),
|
|
30301
30328
|
path33.join(here, "..", "..", "workit-core", "src", "core", "task-contract.ts"),
|
|
30302
30329
|
path33.join(here, "..", "..", "workit-core", "src", "core", "task-engine.ts")
|
|
30303
|
-
].filter((file) =>
|
|
30330
|
+
].filter((file) => existsSync15(file)));
|
|
30304
30331
|
let staleWarned = false;
|
|
30305
30332
|
const failures = new Map;
|
|
30306
30333
|
const server = new Server({ name: "workit", version: VERSION }, { capabilities: { tools: {}, resources: {} } });
|
|
@@ -30817,13 +30844,13 @@ var PROMPT_INTENTS = [
|
|
|
30817
30844
|
].map(([name, pattern]) => [`workit-${name}`, pattern]);
|
|
30818
30845
|
var READERS = new Set("cat sed head tail less more bat nl get-content gc type".split(" "));
|
|
30819
30846
|
// packages/workit-core/src/hooks/hosts/fields.ts
|
|
30820
|
-
import { existsSync as
|
|
30847
|
+
import { existsSync as existsSync16, realpathSync as realpathSync11, statSync as statSync5 } from "node:fs";
|
|
30821
30848
|
import path35 from "node:path";
|
|
30822
30849
|
var isRecord4 = (value) => value !== null && typeof value === "object" && !Array.isArray(value);
|
|
30823
30850
|
var nonEmpty2 = (value) => typeof value === "string" && value.trim() !== "";
|
|
30824
30851
|
var optionalText = (value) => typeof value === "string" ? value : null;
|
|
30825
30852
|
var existingDirectory = (value) => {
|
|
30826
|
-
if (!nonEmpty2(value) || !path35.isAbsolute(value) || !
|
|
30853
|
+
if (!nonEmpty2(value) || !path35.isAbsolute(value) || !existsSync16(value))
|
|
30827
30854
|
return null;
|
|
30828
30855
|
try {
|
|
30829
30856
|
return statSync5(value).isDirectory() ? realpathSync11(value) : null;
|
|
@@ -31724,7 +31751,7 @@ if (false)
|
|
|
31724
31751
|
|
|
31725
31752
|
// packages/workit-codex/scripts/agents.ts
|
|
31726
31753
|
import {
|
|
31727
|
-
existsSync as
|
|
31754
|
+
existsSync as existsSync17,
|
|
31728
31755
|
lstatSync as lstatSync6,
|
|
31729
31756
|
mkdirSync as mkdirSync5,
|
|
31730
31757
|
readdirSync as readdirSync5,
|
|
@@ -31783,7 +31810,7 @@ var lstatOrNull = (file) => {
|
|
|
31783
31810
|
};
|
|
31784
31811
|
var installCodexAgents = (pluginRoot, codexHome, models = {}) => {
|
|
31785
31812
|
const source = path37.join(pluginRoot, "agents");
|
|
31786
|
-
if (!
|
|
31813
|
+
if (!existsSync17(source))
|
|
31787
31814
|
return [];
|
|
31788
31815
|
const version = pluginVersion(pluginRoot);
|
|
31789
31816
|
const target = path37.join(codexHome, "agents");
|
|
@@ -31849,7 +31876,7 @@ var resolveCodexWorkspaceRoot = (pluginRoot, env) => {
|
|
|
31849
31876
|
const explicit = env.WORKIT_WORKSPACE_ROOT;
|
|
31850
31877
|
const inherited = env.PWD;
|
|
31851
31878
|
const candidate = explicit ?? (inherited && path38.resolve(inherited) !== path38.resolve(pluginRoot) ? inherited : undefined);
|
|
31852
|
-
if (!candidate || !path38.isAbsolute(candidate) || !
|
|
31879
|
+
if (!candidate || !path38.isAbsolute(candidate) || !existsSync18(candidate))
|
|
31853
31880
|
return null;
|
|
31854
31881
|
try {
|
|
31855
31882
|
if (!statSync6(candidate).isDirectory())
|
|
@@ -7351,6 +7351,7 @@ var workspaceConfigSchema = object({
|
|
|
7351
7351
|
releaseNotes: unknown().optional().describe("The release notes `workit release finish` publishes on the forge release: `auto` (default: the draft when there is one, else the notes built from the version's changelog section), `off` (no forge release) or `review` (finish refuses until `workit release notes approve`). A release track overrides it."),
|
|
7352
7352
|
trailers: boolean2().optional().describe("Whether commits get the `Workit-Session:` trailer (default true). With false, authorship lives in the ledger only."),
|
|
7353
7353
|
deleteBranch: boolean2().optional().describe("Whether `workit pr merge` deletes the head branch after a merge (default true); `--keep-branch` opts out for one merge."),
|
|
7354
|
+
cleanup: unknown().optional().describe("What happens when work finishes: `auto` (default) removes the delivered branch's clean Workit worktree and local branch, switches a clean checkout on it back to the trunk, and stops the processes registered inside them; `keep` removes and stops nothing. A value Workit does not know reads as `keep`."),
|
|
7354
7355
|
liveSessionGuard: boolean2().optional().describe("Whether the live-session guard denies edits in a checkout another live agent session owns (default true)."),
|
|
7355
7356
|
fanout: object({
|
|
7356
7357
|
tierModels: unknown().optional().describe("The model per slice TIER (mundane, standard, hard), as one name or per host.")
|
|
@@ -15513,7 +15514,7 @@ var seedTurnContext = (input, descriptor, text = turnContextText(input, descript
|
|
|
15513
15514
|
};
|
|
15514
15515
|
// packages/workit-core/src/core/route-intent.ts
|
|
15515
15516
|
import { spawnSync as spawnSync14 } from "node:child_process";
|
|
15516
|
-
import { existsSync as
|
|
15517
|
+
import { existsSync as existsSync11 } from "node:fs";
|
|
15517
15518
|
import path25 from "node:path";
|
|
15518
15519
|
|
|
15519
15520
|
// packages/workit-core/src/hooks/raw-git.ts
|
|
@@ -15524,6 +15525,7 @@ import os5 from "node:os";
|
|
|
15524
15525
|
import path24 from "node:path";
|
|
15525
15526
|
|
|
15526
15527
|
// packages/workit-core/src/autonomy.ts
|
|
15528
|
+
import { closeSync as closeSync2, copyFileSync, existsSync as existsSync10, openSync as openSync2 } from "node:fs";
|
|
15527
15529
|
import path22 from "node:path";
|
|
15528
15530
|
|
|
15529
15531
|
// packages/workit-core/src/core/eval-world.ts
|
|
@@ -15620,12 +15622,36 @@ function checkSeal(dir) {
|
|
|
15620
15622
|
}
|
|
15621
15623
|
|
|
15622
15624
|
// packages/workit-core/src/autonomy.ts
|
|
15623
|
-
var
|
|
15625
|
+
var accountHomeDir = () => {
|
|
15624
15626
|
const home = grantsHome.resolve();
|
|
15625
15627
|
return home === null ? null : configDir2({ HOME: home });
|
|
15626
15628
|
};
|
|
15627
|
-
var
|
|
15629
|
+
var deniedFile = (dir) => {
|
|
15630
|
+
for (const name of ["workspaces.json", SEAL_FILE]) {
|
|
15631
|
+
const file = path22.join(dir, name);
|
|
15632
|
+
try {
|
|
15633
|
+
closeSync2(openSync2(file, "r"));
|
|
15634
|
+
} catch (error) {
|
|
15635
|
+
const code = error.code;
|
|
15636
|
+
if (code === "EACCES" || code === "EPERM")
|
|
15637
|
+
return file;
|
|
15638
|
+
}
|
|
15639
|
+
}
|
|
15640
|
+
return null;
|
|
15641
|
+
};
|
|
15642
|
+
var accountDir = () => {
|
|
15643
|
+
const dir = accountHomeDir();
|
|
15644
|
+
return dir === null || deniedFile(dir) !== null ? null : dir;
|
|
15645
|
+
};
|
|
15646
|
+
var grantsDir = () => accountHomeDir() ?? resolveConfigDir();
|
|
15628
15647
|
var NO_ACCOUNT = "no OS account record answered (core/account-home.ts), so no grants are read: the D4 defaults apply";
|
|
15648
|
+
var accountUnread = () => {
|
|
15649
|
+
const dir = accountHomeDir();
|
|
15650
|
+
if (dir === null)
|
|
15651
|
+
return NO_ACCOUNT;
|
|
15652
|
+
const file = deniedFile(dir);
|
|
15653
|
+
return file === null ? null : `the account's ${path22.basename(file)} cannot be read (permission denied), so it reads as no workspace entries: no grants, no models, the D4 defaults apply`;
|
|
15654
|
+
};
|
|
15629
15655
|
var entriesIn = (dir) => dir === null ? [] : loadWorkspacesFrom(dir);
|
|
15630
15656
|
var fileSource = (dir = accountDir()) => ({
|
|
15631
15657
|
resolve: (cwd, name) => dir === null ? null : resolveWorkspaceFrom(cwd, dir, name),
|
|
@@ -15685,7 +15711,7 @@ var benchWorld = (cwd) => {
|
|
|
15685
15711
|
var grantsOverride = () => {
|
|
15686
15712
|
const shown = shownGrantsDir();
|
|
15687
15713
|
if (shown === null)
|
|
15688
|
-
return NO_ACCOUNT;
|
|
15714
|
+
return accountUnread() ?? NO_ACCOUNT;
|
|
15689
15715
|
const configured = path22.resolve(resolveConfigDir());
|
|
15690
15716
|
return configured === path22.resolve(shown) ? null : `the config directory is redirected to ${configured} (WORKIT_CONFIG, WORKIT_CONFIG_DIR or XDG_CONFIG_HOME), but that override does not apply to grants: grants are read only from ${path22.join(grantsDir(), "workspaces.json")}, and under a redirect they never exceed the D4 defaults`;
|
|
15691
15717
|
};
|
|
@@ -15854,9 +15880,10 @@ function capAt(source, named, where, by, why, main = false) {
|
|
|
15854
15880
|
}
|
|
15855
15881
|
function resolveAutonomy(cwd, target) {
|
|
15856
15882
|
const world = benchWorld(cwd);
|
|
15883
|
+
const unread = world ? null : accountUnread();
|
|
15884
|
+
if (unread !== null)
|
|
15885
|
+
return { ...autonomyOf(null), note: unread };
|
|
15857
15886
|
const override = world ? null : grantsOverride();
|
|
15858
|
-
if (override === NO_ACCOUNT)
|
|
15859
|
-
return { ...autonomyOf(null), note: override };
|
|
15860
15887
|
let resolved;
|
|
15861
15888
|
const once = typeof target === "function" ? () => resolved ??= target() : target;
|
|
15862
15889
|
const account = accountAuthority(cwd, world, once);
|
|
@@ -15955,9 +15982,9 @@ function capAtRemotes(source, autonomy, cwd, target) {
|
|
|
15955
15982
|
return capped;
|
|
15956
15983
|
}
|
|
15957
15984
|
var grantsMatter = (kind) => {
|
|
15958
|
-
|
|
15959
|
-
if (override === NO_ACCOUNT)
|
|
15985
|
+
if (accountUnread() !== null)
|
|
15960
15986
|
return false;
|
|
15987
|
+
const override = grantsOverride();
|
|
15961
15988
|
const entries = entriesIn(accountDir());
|
|
15962
15989
|
const matters = entries.some((entry) => {
|
|
15963
15990
|
const autonomy = autonomyOf(entry);
|
|
@@ -18570,7 +18597,7 @@ var judgedDir = (root, dir) => {
|
|
|
18570
18597
|
if (dir === null)
|
|
18571
18598
|
return root;
|
|
18572
18599
|
const resolved = path25.resolve(root, dir);
|
|
18573
|
-
return
|
|
18600
|
+
return existsSync11(resolved) && inWorkitWorkspace(resolved) ? resolved : null;
|
|
18574
18601
|
};
|
|
18575
18602
|
var shellBranchPolicyViolation = (root, command, dialect = "posix") => {
|
|
18576
18603
|
let judged = false;
|
|
@@ -19579,7 +19606,7 @@ var splitDenial = (plan) => ({
|
|
|
19579
19606
|
});
|
|
19580
19607
|
// packages/workit-core/src/hooks/write-gate.ts
|
|
19581
19608
|
import {
|
|
19582
|
-
existsSync as
|
|
19609
|
+
existsSync as existsSync12,
|
|
19583
19610
|
readdirSync as readdirSync3,
|
|
19584
19611
|
readFileSync as readFileSync10,
|
|
19585
19612
|
readlinkSync as readlinkSync3,
|
|
@@ -20291,7 +20318,7 @@ var linkSources = (args, at) => {
|
|
|
20291
20318
|
const sources = names.filter((name, index) => into >= 0 ? name !== dest : index < names.length - 1 || names.length === 1);
|
|
20292
20319
|
const target = dest === undefined ? null : at(dest);
|
|
20293
20320
|
const symbolic = args.some((arg) => /^-[a-zA-Z]*s|^--symbolic$/.test(arg));
|
|
20294
|
-
const base = target === null ? null : into >= 0 || sources.length > 1 ||
|
|
20321
|
+
const base = target === null ? null : into >= 0 || sources.length > 1 || existsSync12(target) || /[\\/]$/.test(dest ?? "") ? target : path29.dirname(target);
|
|
20295
20322
|
return sources.flatMap((source) => {
|
|
20296
20323
|
if (symbolic && base !== null && !path29.isAbsolute(homeExpanded(source)))
|
|
20297
20324
|
return [path29.resolve(base, source)];
|
|
@@ -21762,13 +21789,13 @@ ${line}` };
|
|
|
21762
21789
|
return decision;
|
|
21763
21790
|
};
|
|
21764
21791
|
// packages/workit-core/src/hooks/hosts/fields.ts
|
|
21765
|
-
import { existsSync as
|
|
21792
|
+
import { existsSync as existsSync13, realpathSync as realpathSync9, statSync as statSync4 } from "node:fs";
|
|
21766
21793
|
import path31 from "node:path";
|
|
21767
21794
|
var isRecord6 = (value) => value !== null && typeof value === "object" && !Array.isArray(value);
|
|
21768
21795
|
var nonEmpty2 = (value) => typeof value === "string" && value.trim() !== "";
|
|
21769
21796
|
var optionalText = (value) => typeof value === "string" ? value : null;
|
|
21770
21797
|
var existingDirectory = (value) => {
|
|
21771
|
-
if (!nonEmpty2(value) || !path31.isAbsolute(value) || !
|
|
21798
|
+
if (!nonEmpty2(value) || !path31.isAbsolute(value) || !existsSync13(value))
|
|
21772
21799
|
return null;
|
|
21773
21800
|
try {
|
|
21774
21801
|
return statSync4(value).isDirectory() ? realpathSync9(value) : null;
|
|
@@ -23632,7 +23659,7 @@ var cdWorkitSplit = (command) => {
|
|
|
23632
23659
|
};
|
|
23633
23660
|
|
|
23634
23661
|
// packages/workit-core/src/hooks/model-limit.ts
|
|
23635
|
-
import { closeSync as
|
|
23662
|
+
import { closeSync as closeSync3, openSync as openSync3, readdirSync as readdirSync4, readSync, statSync as statSync5 } from "node:fs";
|
|
23636
23663
|
import os10 from "node:os";
|
|
23637
23664
|
import path34 from "node:path";
|
|
23638
23665
|
var MONTHS = ["jan", "feb", "mar", "apr", "may", "jun", "jul", "aug", "sep", "oct", "nov", "dec"];
|
|
@@ -23773,21 +23800,21 @@ var TAIL_BYTES2 = 16384;
|
|
|
23773
23800
|
var tail = (file, size) => {
|
|
23774
23801
|
const length = Math.min(size, TAIL_BYTES2);
|
|
23775
23802
|
const buffer = Buffer.alloc(length);
|
|
23776
|
-
const fd =
|
|
23803
|
+
const fd = openSync3(file, "r");
|
|
23777
23804
|
try {
|
|
23778
23805
|
readSync(fd, buffer, 0, length, size - length);
|
|
23779
23806
|
} finally {
|
|
23780
|
-
|
|
23807
|
+
closeSync3(fd);
|
|
23781
23808
|
}
|
|
23782
23809
|
return buffer.toString("utf8");
|
|
23783
23810
|
};
|
|
23784
23811
|
var start = (file) => {
|
|
23785
23812
|
const buffer = Buffer.alloc(TAIL_BYTES2);
|
|
23786
|
-
const fd =
|
|
23813
|
+
const fd = openSync3(file, "r");
|
|
23787
23814
|
try {
|
|
23788
23815
|
return buffer.subarray(0, readSync(fd, buffer, 0, TAIL_BYTES2, 0)).toString("utf8");
|
|
23789
23816
|
} finally {
|
|
23790
|
-
|
|
23817
|
+
closeSync3(fd);
|
|
23791
23818
|
}
|
|
23792
23819
|
};
|
|
23793
23820
|
var parse4 = (line) => {
|
package/dist/workit-hook.js
CHANGED
|
@@ -101,7 +101,7 @@ if (quiet) {
|
|
|
101
101
|
`);
|
|
102
102
|
} else {
|
|
103
103
|
try {
|
|
104
|
-
const { runCodexHook } = await import("./workit-hook-
|
|
104
|
+
const { runCodexHook } = await import("./workit-hook-4wfr9txp.js");
|
|
105
105
|
await runCodexHook([payload]);
|
|
106
106
|
} catch (error) {
|
|
107
107
|
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.13.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.13.0",
|
|
45
|
+
"@workit-dev/mcp": "^2.13.0"
|
|
46
46
|
},
|
|
47
47
|
"engines": {
|
|
48
48
|
"node": ">=24"
|