negotium 0.18.2 → 0.19.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/bin/codex-sdk-window-hide.mjs +40 -0
- package/bin/negotium.mjs +4 -0
- package/dist/agent-helpers.js +432 -152
- package/dist/agent-helpers.js.map +7 -6
- package/dist/canonical-mcp-bridge.js +3 -2
- package/dist/canonical-mcp-bridge.js.map +1 -1
- package/dist/chunk-22mtr8np.js +200 -0
- package/dist/chunk-22mtr8np.js.map +9 -0
- package/dist/chunk-2mx7fq49.js +6 -0
- package/dist/chunk-2mx7fq49.js.map +9 -0
- package/dist/{chunk-44ajn328.js → chunk-4bzehg8t.js} +2 -2
- package/dist/chunk-4bzehg8t.js.map +12 -0
- package/dist/{chunk-r0xs3t81.js → chunk-f7p0h1gs.js} +2 -4
- package/dist/{chunk-r0xs3t81.js.map → chunk-f7p0h1gs.js.map} +2 -2
- package/dist/chunk-y8rtedjb.js +374 -0
- package/dist/chunk-y8rtedjb.js.map +13 -0
- package/dist/hosted-agent.js +355 -476
- package/dist/hosted-agent.js.map +7 -10
- package/dist/main.js +773 -473
- package/dist/main.js.map +8 -7
- package/dist/mcp-factories.js +407 -127
- package/dist/mcp-factories.js.map +7 -6
- package/dist/registry.js +1 -1
- package/dist/runtime/src/agents/codex-native-multi-agent.ts +45 -3
- package/dist/runtime/src/agents/codex-vault-hook-bridge.ts +36 -23
- package/dist/runtime/src/agents/codex-windows-wrapper.ts +174 -0
- package/dist/runtime/src/prompts/sessions/_shared-tools.md +19 -0
- package/dist/runtime/src/version.ts +1 -1
- package/dist/types/packages/core/src/agents/codex-windows-wrapper.d.ts +30 -0
- package/dist/types/packages/core/src/version.d.ts +1 -1
- package/package.json +1 -1
- package/dist/chunk-44ajn328.js.map +0 -12
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
// Keep the Codex SDK's child process from flashing a console window on Windows.
|
|
2
|
+
//
|
|
3
|
+
// `@openai/codex-sdk` starts codex with `spawn(executablePath, args, { env,
|
|
4
|
+
// signal })` and no `windowsHide`, and it exposes no way to pass one. On Windows
|
|
5
|
+
// that pops a console window for every Codex turn. Patching `child_process.spawn`
|
|
6
|
+
// does not help under Bun: the SDK's `import { spawn }` binds to the native
|
|
7
|
+
// builtin, so reassigning the export is never seen. What does work is rewriting
|
|
8
|
+
// the SDK's source as Bun loads it, so this registers a load hook that adds the
|
|
9
|
+
// option to that one call.
|
|
10
|
+
//
|
|
11
|
+
// This has to run before anything imports the SDK, which is why it is called
|
|
12
|
+
// from the bin shim ahead of the dynamic `import("../dist/main.js")`.
|
|
13
|
+
//
|
|
14
|
+
// The rewrite is anchored on the exact call shape. If a future SDK changes it the
|
|
15
|
+
// pattern simply does not match and the SDK loads unmodified: the window comes
|
|
16
|
+
// back, nothing breaks.
|
|
17
|
+
|
|
18
|
+
const SPAWN_CALL = /(spawn\(this\.executablePath, commandArgs, \{\s*env,)(?![^}]*windowsHide)/;
|
|
19
|
+
|
|
20
|
+
/** Returns the patched source, or `undefined` when the call shape is not found. */
|
|
21
|
+
export function patchCodexSdkSource(source) {
|
|
22
|
+
if (!SPAWN_CALL.test(source)) return undefined;
|
|
23
|
+
return source.replace(SPAWN_CALL, "$1 windowsHide: true,");
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
export async function hideCodexSdkWindowOnWindows() {
|
|
27
|
+
if (process.platform !== "win32") return;
|
|
28
|
+
const { plugin } = await import("bun");
|
|
29
|
+
plugin({
|
|
30
|
+
name: "codex-sdk-windows-hide",
|
|
31
|
+
setup(build) {
|
|
32
|
+
// `.` rather than `[\\/]` for the separators: Bun's plugin filter did not
|
|
33
|
+
// match a separator character class against this Windows path.
|
|
34
|
+
build.onLoad({ filter: /@openai.codex-sdk.dist.index\.js$/ }, async ({ path }) => {
|
|
35
|
+
const source = await Bun.file(path).text();
|
|
36
|
+
return { contents: patchCodexSdkSource(source) ?? source, loader: "js" };
|
|
37
|
+
});
|
|
38
|
+
},
|
|
39
|
+
});
|
|
40
|
+
}
|
package/bin/negotium.mjs
CHANGED
|
@@ -15,4 +15,8 @@
|
|
|
15
15
|
// a plain statement, then a dynamic import, which is ordered.
|
|
16
16
|
process.env.MAESTRO_SDK_SILENT_BOOTSTRAP ??= "1";
|
|
17
17
|
|
|
18
|
+
// Same reason: must be registered before the bundle imports the Codex SDK.
|
|
19
|
+
const { hideCodexSdkWindowOnWindows } = await import("./codex-sdk-window-hide.mjs");
|
|
20
|
+
await hideCodexSdkWindowOnWindows();
|
|
21
|
+
|
|
18
22
|
await import("../dist/main.js");
|