@remnic/plugin-codex 9.63.5 → 9.63.7
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.
|
@@ -15,6 +15,9 @@ const path = require("node:path");
|
|
|
15
15
|
const { spawn } = require("node:child_process");
|
|
16
16
|
|
|
17
17
|
const RUNNER = path.join(__dirname, "remnic-codex-hook.cjs");
|
|
18
|
+
// Shared runner source (issue #2483): implementation-detail assertions read
|
|
19
|
+
// the core, while behavioral tests spawn the wrapper entry (RUNNER).
|
|
20
|
+
const CORE = path.join(__dirname, "remnic-hook-core.cjs");
|
|
18
21
|
|
|
19
22
|
function startServer(handler) {
|
|
20
23
|
const calls = [];
|
|
@@ -396,7 +399,7 @@ test(
|
|
|
396
399
|
const pluginRoot = path.join(home, "plugin root");
|
|
397
400
|
const binDir = path.join(pluginRoot, "hooks", "bin");
|
|
398
401
|
fs.mkdirSync(binDir, { recursive: true });
|
|
399
|
-
for (const file of ["remnic-codex-hook.sh", "remnic-codex-hook.cjs"]) {
|
|
402
|
+
for (const file of ["remnic-codex-hook.sh", "remnic-codex-hook.cjs", "remnic-hook-core.cjs"]) {
|
|
400
403
|
fs.copyFileSync(path.join(__dirname, file), path.join(binDir, file));
|
|
401
404
|
}
|
|
402
405
|
fs.chmodSync(path.join(binDir, "remnic-codex-hook.sh"), 0o644);
|
|
@@ -449,7 +452,7 @@ test(
|
|
|
449
452
|
);
|
|
450
453
|
|
|
451
454
|
test("runner source: remnic→engram fallthrough is PATH-gated and Windows-shim aware (#1443 review)", () => {
|
|
452
|
-
const src = fs.readFileSync(
|
|
455
|
+
const src = fs.readFileSync(CORE, "utf8");
|
|
453
456
|
// Both the migration and daemon-start loops pre-check PATH with onPath()
|
|
454
457
|
// (.cmd/.exe-aware) so the remnic→engram fallthrough happens, and launch
|
|
455
458
|
// through a shell on Windows so `.cmd` npm shims actually run.
|
|
@@ -463,7 +466,7 @@ test("runner source: remnic→engram fallthrough is PATH-gated and Windows-shim
|
|
|
463
466
|
});
|
|
464
467
|
|
|
465
468
|
test("runner source: materialize child receives an explicit HOME (#1443 review)", () => {
|
|
466
|
-
const src = fs.readFileSync(
|
|
469
|
+
const src = fs.readFileSync(CORE, "utf8");
|
|
467
470
|
// The spawned materializer must get the runner's resolved HOME so Windows
|
|
468
471
|
// (HOME usually unset) resolves the same config home as the hook.
|
|
469
472
|
assert.match(
|
|
@@ -475,7 +478,7 @@ test("runner source: materialize child receives an explicit HOME (#1443 review)"
|
|
|
475
478
|
});
|
|
476
479
|
|
|
477
480
|
test("runner source: stdin is the single payload source — no env-var override (#1443 review)", () => {
|
|
478
|
-
const src = fs.readFileSync(
|
|
481
|
+
const src = fs.readFileSync(CORE, "utf8");
|
|
479
482
|
// An inherited REMNIC_HOOK_INPUT must NOT be able to override the piped
|
|
480
483
|
// stdin payload, so readStdin must not read it.
|
|
481
484
|
assert.doesNotMatch(
|
|
@@ -490,7 +493,7 @@ test("post-tool-observe: worker payload travels via STDIN, not the environment (
|
|
|
490
493
|
// (big file edits, big command output) would E2BIG; the worker now reads
|
|
491
494
|
// stdin instead. We assert the source rather than running an E2BIG payload
|
|
492
495
|
// because reproducing the limit cross-platform is impractical.
|
|
493
|
-
const src = fs.readFileSync(
|
|
496
|
+
const src = fs.readFileSync(CORE, "utf8");
|
|
494
497
|
assert.doesNotMatch(
|
|
495
498
|
src,
|
|
496
499
|
/REMNIC_HOOK_INPUT:\s*rawInput/,
|
|
@@ -766,7 +769,7 @@ test("pre-compact: REMNIC_DAEMON_URL routes the flush to the remote base URL (#1
|
|
|
766
769
|
});
|
|
767
770
|
|
|
768
771
|
test("runner source: DAEMON_URL honors https:// remotes and falls back to HOST/PORT (#1571)", () => {
|
|
769
|
-
const src = fs.readFileSync(
|
|
772
|
+
const src = fs.readFileSync(CORE, "utf8");
|
|
770
773
|
// Both transports are wired so a TLS remote daemon is reachable.
|
|
771
774
|
assert.match(src, /const https = require\("https"\)/, "https transport is required");
|
|
772
775
|
assert.match(
|