negotium 0.4.0 → 0.4.1

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.
@@ -2382,7 +2382,7 @@ import { tmpdir } from "os";
2382
2382
  import { dirname as dirname5, join as join4 } from "path";
2383
2383
 
2384
2384
  // ../../packages/core/src/version.ts
2385
- var NEGOTIUM_VERSION = "0.4.0";
2385
+ var NEGOTIUM_VERSION = "0.4.1";
2386
2386
 
2387
2387
  // ../../packages/core/src/agents/codex-native-multi-agent.ts
2388
2388
  var moduleRequire = createRequire2(import.meta.url);
@@ -2820,6 +2820,8 @@ import { dirname as dirname6, join as join5, resolve as resolve5 } from "path";
2820
2820
  import { fileURLToPath as fileURLToPath2 } from "url";
2821
2821
  var MAX_HOOK_REQUEST_BYTES = 1024 * 1024;
2822
2822
  var SENSITIVE_STORAGE_DENIAL = "Runtime secret storage access is not permitted";
2823
+ var HOOK_SOCKET_ENV = "NEGOTIUM_CODEX_VAULT_HOOK_SOCKET";
2824
+ var HOOK_TOKEN_ENV = "NEGOTIUM_CODEX_VAULT_HOOK_TOKEN";
2823
2825
  function evaluateCodexVaultPreToolUse(input, userId, operations) {
2824
2826
  if (operations.referencesSensitiveStorage(input.tool_input)) {
2825
2827
  return {
@@ -2856,9 +2858,11 @@ function hookClientPath() {
2856
2858
  return packaged;
2857
2859
  throw new Error("Codex Vault hook client is missing from this installation");
2858
2860
  }
2859
- function privateCodexWrapper(codexScript) {
2861
+ function privateCodexWrapper(codexScript, socketPath, token) {
2860
2862
  return [
2861
2863
  "#!/bin/sh",
2864
+ `export ${HOOK_SOCKET_ENV}=${shellQuote(socketPath)}`,
2865
+ `export ${HOOK_TOKEN_ENV}=${shellQuote(token)}`,
2862
2866
  'if [ "$1" = "exec" ]; then',
2863
2867
  " shift",
2864
2868
  ` exec ${shellQuote(process.execPath)} ${shellQuote(codexScript)} exec --dangerously-bypass-hook-trust "$@"`,
@@ -2921,15 +2925,13 @@ async function createCodexVaultHookBridge(userId) {
2921
2925
  });
2922
2926
  });
2923
2927
  await chmod(socketPath, 384);
2924
- await writeFile(wrapperPath, privateCodexWrapper(codexCliScriptPath()), { mode: 448 });
2925
- const command = [
2926
- shellQuote(process.execPath),
2927
- shellQuote(hookClientPath()),
2928
- shellQuote(socketPath),
2929
- shellQuote(token)
2930
- ].join(" ");
2928
+ await writeFile(wrapperPath, privateCodexWrapper(codexCliScriptPath(), socketPath, token), {
2929
+ mode: 448
2930
+ });
2931
+ const command = [shellQuote(process.execPath), shellQuote(hookClientPath())].join(" ");
2931
2932
  return {
2932
2933
  codexPathOverride: wrapperPath,
2934
+ environment: { [HOOK_SOCKET_ENV]: socketPath, [HOOK_TOKEN_ENV]: token },
2933
2935
  hooks: {
2934
2936
  PreToolUse: [
2935
2937
  {
@@ -3336,6 +3338,7 @@ function buildNumberedDiffSummary(before, after, startLine = 1) {
3336
3338
  }
3337
3339
 
3338
3340
  // ../../packages/core/src/agents/codex-provider.ts
3341
+ var CODEX_HOOK_TRUST_BYPASS_NOTICE = "`--dangerously-bypass-hook-trust` is enabled. Enabled hooks may run without review for this invocation.";
3339
3342
  function sameCodexUsage(usage, total) {
3340
3343
  return usage.input_tokens === total.inputTokens && usage.output_tokens === total.outputTokens && (usage.cached_input_tokens ?? 0) === total.cachedInputTokens && (usage.cache_write_input_tokens ?? 0) === total.cacheWriteInputTokens;
3341
3344
  }
@@ -3921,7 +3924,10 @@ async function* codexProvider(opts) {
3921
3924
  yield fileEvent;
3922
3925
  }
3923
3926
  } else if (item.type === "error") {
3924
- yield { type: "error", content: String(item.message ?? "") };
3927
+ const message = String(item.message ?? "");
3928
+ if (message !== CODEX_HOOK_TRUST_BYPASS_NOTICE) {
3929
+ yield { type: "error", content: message };
3930
+ }
3925
3931
  }
3926
3932
  break;
3927
3933
  }
@@ -4233,4 +4239,4 @@ export {
4233
4239
  buildClaudeDisallowedTools
4234
4240
  };
4235
4241
 
4236
- //# debugId=5CF9F07311E89AE364756E2164756E21
4242
+ //# debugId=08FB62E75535D71964756E2164756E21