oh-my-codex 0.22.0 → 0.22.2
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/Cargo.lock +6 -6
- package/Cargo.toml +1 -1
- package/dist/cli/__tests__/plugin-cache-live-pin-3790.test.js +104 -3
- package/dist/cli/__tests__/plugin-cache-live-pin-3790.test.js.map +1 -1
- package/dist/cli/__tests__/question.test.js +33 -0
- package/dist/cli/__tests__/question.test.js.map +1 -1
- package/dist/cli/plugin-marketplace.d.ts.map +1 -1
- package/dist/cli/plugin-marketplace.js +11 -4
- package/dist/cli/plugin-marketplace.js.map +1 -1
- package/dist/cli/question.d.ts.map +1 -1
- package/dist/cli/question.js +8 -1
- package/dist/cli/question.js.map +1 -1
- package/dist/question/__tests__/ui.test.js +40 -1
- package/dist/question/__tests__/ui.test.js.map +1 -1
- package/dist/question/ui.d.ts.map +1 -1
- package/dist/question/ui.js +37 -7
- package/dist/question/ui.js.map +1 -1
- package/dist/team/__tests__/completion-evidence.test.js +31 -1
- package/dist/team/__tests__/completion-evidence.test.js.map +1 -1
- package/dist/team/__tests__/hook-primary-e2e-contract.test.js +9 -3
- package/dist/team/__tests__/hook-primary-e2e-contract.test.js.map +1 -1
- package/dist/team/__tests__/mcp-comm.test.js +25 -1
- package/dist/team/__tests__/mcp-comm.test.js.map +1 -1
- package/dist/team/__tests__/p1-safety.test.d.ts +2 -0
- package/dist/team/__tests__/p1-safety.test.d.ts.map +1 -0
- package/dist/team/__tests__/p1-safety.test.js +553 -0
- package/dist/team/__tests__/p1-safety.test.js.map +1 -0
- package/dist/team/__tests__/runtime.test.js +607 -53
- package/dist/team/__tests__/runtime.test.js.map +1 -1
- package/dist/team/__tests__/scaling.test.js +355 -4
- package/dist/team/__tests__/scaling.test.js.map +1 -1
- package/dist/team/__tests__/state.test.js +127 -5
- package/dist/team/__tests__/state.test.js.map +1 -1
- package/dist/team/completion-evidence.d.ts +2 -1
- package/dist/team/completion-evidence.d.ts.map +1 -1
- package/dist/team/completion-evidence.js +30 -7
- package/dist/team/completion-evidence.js.map +1 -1
- package/dist/team/mcp-comm.d.ts +5 -3
- package/dist/team/mcp-comm.d.ts.map +1 -1
- package/dist/team/mcp-comm.js +4 -0
- package/dist/team/mcp-comm.js.map +1 -1
- package/dist/team/runtime.d.ts.map +1 -1
- package/dist/team/runtime.js +244 -146
- package/dist/team/runtime.js.map +1 -1
- package/dist/team/scaling.d.ts +3 -3
- package/dist/team/scaling.d.ts.map +1 -1
- package/dist/team/scaling.js +73 -67
- package/dist/team/scaling.js.map +1 -1
- package/dist/team/state/tasks.d.ts +2 -0
- package/dist/team/state/tasks.d.ts.map +1 -1
- package/dist/team/state/tasks.js +28 -22
- package/dist/team/state/tasks.js.map +1 -1
- package/dist/team/state/types.d.ts +1 -0
- package/dist/team/state/types.d.ts.map +1 -1
- package/dist/team/state/types.js.map +1 -1
- package/dist/team/state.d.ts +1 -0
- package/dist/team/state.d.ts.map +1 -1
- package/dist/team/state.js +60 -11
- package/dist/team/state.js.map +1 -1
- package/dist/team/worker-bootstrap.js +2 -2
- package/dist/team/worktree.d.ts +1 -0
- package/dist/team/worktree.d.ts.map +1 -1
- package/dist/team/worktree.js +64 -11
- package/dist/team/worktree.js.map +1 -1
- package/package.json +1 -1
- package/plugins/oh-my-codex/.codex-plugin/plugin.json +1 -1
- package/plugins/oh-my-codex/hooks/codex-native-hook.mjs +4 -1
package/Cargo.lock
CHANGED
|
@@ -32,7 +32,7 @@ checksum = "cf8baf1c55e62ffcace7a9f06f4bd9cd3f0c4beb022d3b367256b91b87513d98"
|
|
|
32
32
|
|
|
33
33
|
[[package]]
|
|
34
34
|
name = "omx-api"
|
|
35
|
-
version = "0.
|
|
35
|
+
version = "0.22.2"
|
|
36
36
|
dependencies = [
|
|
37
37
|
"serde",
|
|
38
38
|
"serde_json",
|
|
@@ -40,14 +40,14 @@ dependencies = [
|
|
|
40
40
|
|
|
41
41
|
[[package]]
|
|
42
42
|
name = "omx-explore-harness"
|
|
43
|
-
version = "0.
|
|
43
|
+
version = "0.22.2"
|
|
44
44
|
dependencies = [
|
|
45
45
|
"libc",
|
|
46
46
|
]
|
|
47
47
|
|
|
48
48
|
[[package]]
|
|
49
49
|
name = "omx-mux"
|
|
50
|
-
version = "0.
|
|
50
|
+
version = "0.22.2"
|
|
51
51
|
dependencies = [
|
|
52
52
|
"serde",
|
|
53
53
|
"serde_json",
|
|
@@ -55,7 +55,7 @@ dependencies = [
|
|
|
55
55
|
|
|
56
56
|
[[package]]
|
|
57
57
|
name = "omx-runtime"
|
|
58
|
-
version = "0.
|
|
58
|
+
version = "0.22.2"
|
|
59
59
|
dependencies = [
|
|
60
60
|
"fs2",
|
|
61
61
|
"libc",
|
|
@@ -67,7 +67,7 @@ dependencies = [
|
|
|
67
67
|
|
|
68
68
|
[[package]]
|
|
69
69
|
name = "omx-runtime-core"
|
|
70
|
-
version = "0.
|
|
70
|
+
version = "0.22.2"
|
|
71
71
|
dependencies = [
|
|
72
72
|
"fs2",
|
|
73
73
|
"serde",
|
|
@@ -76,7 +76,7 @@ dependencies = [
|
|
|
76
76
|
|
|
77
77
|
[[package]]
|
|
78
78
|
name = "omx-sparkshell"
|
|
79
|
-
version = "0.
|
|
79
|
+
version = "0.22.2"
|
|
80
80
|
dependencies = [
|
|
81
81
|
"omx-mux",
|
|
82
82
|
]
|
package/Cargo.toml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import assert from "node:assert/strict";
|
|
2
2
|
import { createHash } from "node:crypto";
|
|
3
3
|
import { spawn, spawnSync } from "node:child_process";
|
|
4
|
-
import { chmod, cp, link, lstat, mkdir, mkdtemp, readFile, readdir, rm, utimes, writeFile } from "node:fs/promises";
|
|
4
|
+
import { chmod, cp, link, lstat, mkdir, mkdtemp, readFile, readdir, realpath, rename, rm, symlink, utimes, writeFile } from "node:fs/promises";
|
|
5
5
|
import { readFileSync } from "node:fs";
|
|
6
6
|
import { tmpdir } from "node:os";
|
|
7
7
|
import { delimiter, dirname, join } from "node:path";
|
|
@@ -197,6 +197,106 @@ setTimeout(waitForDelegate, 10);
|
|
|
197
197
|
return pinPath;
|
|
198
198
|
}
|
|
199
199
|
describe("issue 3790 live plugin cache pins", () => {
|
|
200
|
+
it("pins a managed snapshot externally through an explicitly configured Codex-home alias", async () => {
|
|
201
|
+
const wd = await mkdtemp(join(tmpdir(), "omx-live-pin-home-alias-"));
|
|
202
|
+
try {
|
|
203
|
+
await withIsolatedUserHome(wd, async (codexHomeDir) => {
|
|
204
|
+
const alias = join(wd, "codex-home-alias");
|
|
205
|
+
await symlink(codexHomeDir, alias, process.platform === "win32" ? "junction" : "dir");
|
|
206
|
+
process.env.CODEX_HOME = alias;
|
|
207
|
+
const packaged = await resolvePackagedOmxMarketplace(packageRoot);
|
|
208
|
+
assert.ok(packaged);
|
|
209
|
+
const materialized = await materializePackagedOmxPluginCache(alias, packaged);
|
|
210
|
+
assert.equal(materialized.status, "materialized");
|
|
211
|
+
const cacheDir = materialized.cacheDir;
|
|
212
|
+
const pinDir = livePinDirectoryPath(alias, materialized.version);
|
|
213
|
+
const before = await computeOmxPluginCacheClaimDigest(cacheDir);
|
|
214
|
+
await assert.rejects(lstat(pinDir), { code: "ENOENT" });
|
|
215
|
+
const result = spawnSync(process.execPath, [join(cacheDir, "hooks", "codex-native-hook.mjs")], {
|
|
216
|
+
cwd: wd,
|
|
217
|
+
input: JSON.stringify({ hook_event_name: "SessionStart", session_id: "home-alias", codex_pid: process.pid, cwd: wd }),
|
|
218
|
+
encoding: "utf-8",
|
|
219
|
+
env: { ...process.env, CODEX_HOME: alias },
|
|
220
|
+
});
|
|
221
|
+
assert.equal(result.status, 0, result.stderr || result.stdout);
|
|
222
|
+
const entries = await readdir(pinDir);
|
|
223
|
+
assert.equal(entries.length, 1);
|
|
224
|
+
const pin = JSON.parse(await readFile(join(pinDir, entries[0]), "utf-8"));
|
|
225
|
+
assert.equal(pin.pid, process.pid);
|
|
226
|
+
assert.equal(pin.sessionHash, createHash("sha256").update("home-alias").digest("hex"));
|
|
227
|
+
await assert.rejects(lstat(join(cacheDir, ".omx-live-pin")), { code: "ENOENT" });
|
|
228
|
+
assert.equal(await computeOmxPluginCacheClaimDigest(cacheDir), before);
|
|
229
|
+
});
|
|
230
|
+
}
|
|
231
|
+
finally {
|
|
232
|
+
await rm(wd, { recursive: true, force: true });
|
|
233
|
+
}
|
|
234
|
+
});
|
|
235
|
+
it("registers external pins for canonical and aliased cache roots under an aliased Codex home", async () => {
|
|
236
|
+
const wd = await mkdtemp(join(tmpdir(), "omx-live-pin-direct-home-alias-"));
|
|
237
|
+
try {
|
|
238
|
+
await withIsolatedUserHome(wd, async (codexHomeDir) => {
|
|
239
|
+
const alias = join(wd, "codex-home-alias");
|
|
240
|
+
await symlink(codexHomeDir, alias, process.platform === "win32" ? "junction" : "dir");
|
|
241
|
+
process.env.CODEX_HOME = alias;
|
|
242
|
+
const packaged = await resolvePackagedOmxMarketplace(packageRoot);
|
|
243
|
+
assert.ok(packaged);
|
|
244
|
+
const materialized = await materializePackagedOmxPluginCache(alias, packaged);
|
|
245
|
+
assert.equal(materialized.status, "materialized");
|
|
246
|
+
const cacheDir = materialized.cacheDir;
|
|
247
|
+
const pinDir = livePinDirectoryPath(alias, materialized.version);
|
|
248
|
+
const before = await computeOmxPluginCacheClaimDigest(cacheDir);
|
|
249
|
+
for (const [name, pluginRoot] of [
|
|
250
|
+
["canonical", await realpath(cacheDir)],
|
|
251
|
+
["aliased", join(omxPluginCacheBase(alias), materialized.version)],
|
|
252
|
+
]) {
|
|
253
|
+
const sessionId = `direct-home-${name}`;
|
|
254
|
+
assert.equal(await registerOmxPluginCacheLivePin(pluginRoot, sessionId, process.pid), true, name);
|
|
255
|
+
const entries = await readdir(pinDir);
|
|
256
|
+
const pins = await Promise.all(entries.map(async (entry) => JSON.parse(await readFile(join(pinDir, entry), "utf-8"))));
|
|
257
|
+
assert.ok(pins.some(pin => pin.pid === process.pid && pin.sessionHash === createHash("sha256").update(sessionId).digest("hex")), name);
|
|
258
|
+
}
|
|
259
|
+
assert.equal((await readdir(pinDir)).length, 2);
|
|
260
|
+
await assert.rejects(lstat(join(cacheDir, ".omx-live-pin")), { code: "ENOENT" });
|
|
261
|
+
assert.equal(await computeOmxPluginCacheClaimDigest(cacheDir), before);
|
|
262
|
+
});
|
|
263
|
+
}
|
|
264
|
+
finally {
|
|
265
|
+
await rm(wd, { recursive: true, force: true });
|
|
266
|
+
}
|
|
267
|
+
});
|
|
268
|
+
it("rejects a redirected cache version below an aliased Codex home", async () => {
|
|
269
|
+
const wd = await mkdtemp(join(tmpdir(), "omx-live-pin-redirected-version-"));
|
|
270
|
+
try {
|
|
271
|
+
await withIsolatedUserHome(wd, async (codexHomeDir) => {
|
|
272
|
+
const alias = join(wd, "codex-home-alias");
|
|
273
|
+
await symlink(codexHomeDir, alias, process.platform === "win32" ? "junction" : "dir");
|
|
274
|
+
process.env.CODEX_HOME = alias;
|
|
275
|
+
const cacheDir = await seedManagedSnapshot(codexHomeDir, packageVersion.version);
|
|
276
|
+
const outsideBase = join(wd, "outside-cache");
|
|
277
|
+
const outside = join(outsideBase, packageVersion.version);
|
|
278
|
+
await mkdir(outsideBase);
|
|
279
|
+
await rename(cacheDir, outside);
|
|
280
|
+
await symlink(outside, cacheDir, process.platform === "win32" ? "junction" : "dir");
|
|
281
|
+
const before = await computeOmxPluginCacheClaimDigest(outside);
|
|
282
|
+
const result = spawnSync(process.execPath, [join(cacheDir, "hooks", "codex-native-hook.mjs")], {
|
|
283
|
+
cwd: wd,
|
|
284
|
+
input: JSON.stringify({ hook_event_name: "SessionStart", session_id: "redirected-version", codex_pid: process.pid, cwd: wd }),
|
|
285
|
+
encoding: "utf-8",
|
|
286
|
+
env: { ...process.env, CODEX_HOME: alias },
|
|
287
|
+
});
|
|
288
|
+
assert.equal(result.status, 0, result.stderr || result.stdout);
|
|
289
|
+
await assert.rejects(registerOmxPluginCacheLivePin(join(omxPluginCacheBase(alias), packageVersion.version), "direct-redirected-version", process.pid), /symbolic link|non-directory namespace/);
|
|
290
|
+
await assert.rejects(lstat(join(outside, ".omx-live-pin")), { code: "ENOENT" });
|
|
291
|
+
await assert.rejects(lstat(livePinDirectoryPath(alias, packageVersion.version)), { code: "ENOENT" });
|
|
292
|
+
assert.equal(await computeOmxPluginCacheClaimDigest(outside), before);
|
|
293
|
+
assert.deepEqual((await readdir(dirname(cacheDir))).filter(name => name.startsWith(".omx-live-pin")), []);
|
|
294
|
+
});
|
|
295
|
+
}
|
|
296
|
+
finally {
|
|
297
|
+
await rm(wd, { recursive: true, force: true });
|
|
298
|
+
}
|
|
299
|
+
});
|
|
200
300
|
it("writes a live pin from an uncorrelated SessionStart hook, not during publication", async () => {
|
|
201
301
|
const wd = await mkdtemp(join(tmpdir(), "omx-3790-session-pin-"));
|
|
202
302
|
try {
|
|
@@ -1624,7 +1724,8 @@ setTimeout(waitForDelegate, 10);
|
|
|
1624
1724
|
try {
|
|
1625
1725
|
await withIsolatedUserHome(wd, async (codexHomeDir) => {
|
|
1626
1726
|
const pluginRoot = await seedManagedSnapshot(codexHomeDir, "0.20.0");
|
|
1627
|
-
|
|
1727
|
+
// Pin refusal must not depend on whether this test has a real Codex ancestor.
|
|
1728
|
+
const payload = { hook_event_name: "UserPromptSubmit", session_id: "required-session-pin", codex_pid: 99_999_999, cwd: wd };
|
|
1628
1729
|
const env = {
|
|
1629
1730
|
...process.env,
|
|
1630
1731
|
CODEX_HOME: codexHomeDir,
|
|
@@ -1689,7 +1790,7 @@ syncBuiltinESMExports();
|
|
|
1689
1790
|
...process.env,
|
|
1690
1791
|
CODEX_HOME: codexHomeDir,
|
|
1691
1792
|
OMX_NATIVE_HOOK_COMMAND: process.execPath,
|
|
1692
|
-
OMX_TEST_CACHE_BASE: omxPluginCacheBase(codexHomeDir),
|
|
1793
|
+
OMX_TEST_CACHE_BASE: await realpath(omxPluginCacheBase(codexHomeDir)),
|
|
1693
1794
|
OMX_TEST_LAUNCHER_INVOKED: launcherInvokedPath,
|
|
1694
1795
|
},
|
|
1695
1796
|
});
|