pushary 1.9.46 → 1.9.47

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.
Files changed (103) hide show
  1. package/CHANGELOG.md +7 -0
  2. package/dist/bin/pushary-bell-hook.js +25 -25
  3. package/dist/bin/pushary-bell.js +9 -9
  4. package/dist/bin/pushary-claude.js +24 -24
  5. package/dist/bin/pushary-clean.js +142 -76
  6. package/dist/bin/pushary-codex-bridge.js +18 -18
  7. package/dist/bin/pushary-codex-hook.js +30 -30
  8. package/dist/bin/pushary-codex-session.js +22 -19
  9. package/dist/bin/pushary-codex.js +12 -12
  10. package/dist/bin/pushary-connect.js +24 -24
  11. package/dist/bin/pushary-cowork.js +5 -5
  12. package/dist/bin/pushary-daemon.js +32 -32
  13. package/dist/bin/pushary-disconnect.js +37 -30
  14. package/dist/bin/pushary-doctor.js +34 -34
  15. package/dist/bin/pushary-elicitation-hook.js +25 -25
  16. package/dist/bin/pushary-gemini-bridge.js +13 -13
  17. package/dist/bin/pushary-gemini-hook.js +27 -27
  18. package/dist/bin/pushary-hook.js +29 -29
  19. package/dist/bin/pushary-login.js +12 -12
  20. package/dist/bin/pushary-logout.js +24 -24
  21. package/dist/bin/pushary-mcp.js +9 -9
  22. package/dist/bin/pushary-mode.js +12 -12
  23. package/dist/bin/pushary-notification-hook.js +24 -24
  24. package/dist/bin/pushary-opencode-hook.js +26 -26
  25. package/dist/bin/pushary-permission-denied-hook.js +29 -29
  26. package/dist/bin/pushary-permission-hook.js +28 -28
  27. package/dist/bin/pushary-post-hook.js +24 -24
  28. package/dist/bin/pushary-prompt-hook.js +24 -24
  29. package/dist/bin/pushary-session-end-hook.js +24 -24
  30. package/dist/bin/pushary-session-start-hook.js +28 -28
  31. package/dist/bin/pushary-setup.js +36 -36
  32. package/dist/bin/pushary-stats.js +5 -5
  33. package/dist/bin/pushary-status.js +26 -26
  34. package/dist/bin/pushary-stop-hook.js +24 -24
  35. package/dist/bin/pushary-stopfailure-hook.js +24 -24
  36. package/dist/bin/pushary-suggestions.js +12 -12
  37. package/dist/bin/pushary-transcript-register.js +17 -17
  38. package/dist/bin/pushary-transcripts.js +7 -7
  39. package/dist/bin/pushary-upgrade.js +30 -30
  40. package/dist/bin/pushary-wait.js +12 -12
  41. package/dist/bin/pushary.js +6 -6
  42. package/dist/{chunk-VTF7LKDB.js → chunk-3F3JHJPS.js} +5 -5
  43. package/dist/{chunk-NO3ADUD4.js → chunk-3KSN65VJ.js} +1 -1
  44. package/dist/{chunk-SEKQAYVP.js → chunk-3RAWTKWW.js} +2 -2
  45. package/dist/{chunk-ZGGSQTCO.js → chunk-4MJ46JA7.js} +1 -1
  46. package/dist/{chunk-FQW7AV6U.js → chunk-6VFP72GX.js} +3 -3
  47. package/dist/{chunk-NWZZTHWF.js → chunk-6W64IVG3.js} +1 -1
  48. package/dist/{chunk-5O6GB64K.js → chunk-6WFJCUWO.js} +2 -2
  49. package/dist/{chunk-GG6C4CHH.js → chunk-7JUISFZ7.js} +2 -2
  50. package/dist/{chunk-MOUUDZOZ.js → chunk-7VLY6RHG.js} +1 -1
  51. package/dist/{chunk-W7MXYDGP.js → chunk-ADKWE35P.js} +2 -2
  52. package/dist/{chunk-ON2WCBIN.js → chunk-AIDH46DC.js} +10 -10
  53. package/dist/{chunk-FQWI6XQG.js → chunk-BS457P5Z.js} +1 -1
  54. package/dist/{chunk-I5EQ5NJD.js → chunk-CVCOZWSB.js} +8 -8
  55. package/dist/{chunk-UCRG5QGN.js → chunk-DDS472RO.js} +1 -1
  56. package/dist/{chunk-HTQPDODV.js → chunk-DPF6WDCX.js} +4 -4
  57. package/dist/{chunk-EKDSF3IX.js → chunk-DRQVZHWE.js} +1 -1
  58. package/dist/{chunk-EDSXF7NV.js → chunk-DY5PQSQB.js} +109 -30
  59. package/dist/{chunk-EP4MD6TH.js → chunk-FDDZEYGM.js} +5 -5
  60. package/dist/{chunk-UP2RNIHL.js → chunk-FWQ2O5BI.js} +4 -4
  61. package/dist/{chunk-KJNWVAS6.js → chunk-FY6ZTTDQ.js} +3 -3
  62. package/dist/{chunk-UGXRDY3O.js → chunk-GLVPA4EK.js} +5 -5
  63. package/dist/{chunk-MBB4XJIN.js → chunk-GOTCSFLS.js} +7 -7
  64. package/dist/{chunk-NULG2ZUG.js → chunk-J3CYUXGX.js} +4 -4
  65. package/dist/{chunk-JPGY5LSF.js → chunk-K2KGB7TK.js} +5 -5
  66. package/dist/{chunk-5NXD6ZHQ.js → chunk-K2YVKKYV.js} +2 -2
  67. package/dist/{chunk-2X3PPRNC.js → chunk-KQDHOQRG.js} +3 -3
  68. package/dist/{chunk-PZPYL65I.js → chunk-LFMC5AE2.js} +1 -1
  69. package/dist/{chunk-P2FHZ65U.js → chunk-LQRPQXAG.js} +1 -1
  70. package/dist/{chunk-2PTJHEX4.js → chunk-M47U54AO.js} +2 -2
  71. package/dist/{chunk-EW52AGOV.js → chunk-MCL5IS6A.js} +4 -4
  72. package/dist/{chunk-2IFTZZ5K.js → chunk-MM472M4O.js} +1 -1
  73. package/dist/{chunk-CJKEU4EZ.js → chunk-MZQ5M6F6.js} +4 -4
  74. package/dist/{chunk-LEMQA4HM.js → chunk-N6JNKOKJ.js} +5 -5
  75. package/dist/{chunk-T623UG5T.js → chunk-OL7QCMQK.js} +3 -3
  76. package/dist/{chunk-UI3WDOV3.js → chunk-P4RKBBHE.js} +2 -2
  77. package/dist/{chunk-35TUEZ5E.js → chunk-PHKISQPB.js} +3 -3
  78. package/dist/{chunk-7XSIUY5F.js → chunk-PRQMACC7.js} +1 -1
  79. package/dist/{chunk-GQZF6DPL.js → chunk-R7AMICLS.js} +1 -1
  80. package/dist/{chunk-CA6F44OF.js → chunk-RDVDW3WK.js} +5 -5
  81. package/dist/{chunk-BKJP2MQN.js → chunk-ROQSYB3T.js} +6 -6
  82. package/dist/{chunk-LA4S2KIM.js → chunk-S3657KK2.js} +3 -3
  83. package/dist/{chunk-2VNHP2OE.js → chunk-T3QKLW3M.js} +1 -1
  84. package/dist/{chunk-OI6YNNI5.js → chunk-TP5SLM2I.js} +8 -4
  85. package/dist/{chunk-2ZD53EQW.js → chunk-TSI25WVW.js} +2 -2
  86. package/dist/{chunk-XAMFOUXA.js → chunk-UFTPB3LZ.js} +2 -2
  87. package/dist/{chunk-ELLN4XAF.js → chunk-UIPZSSBC.js} +2 -2
  88. package/dist/{chunk-WN3MDHAM.js → chunk-VE4LQ23C.js} +1 -1
  89. package/dist/{chunk-ULEX43F7.js → chunk-VQZ4FP6Z.js} +1 -1
  90. package/dist/{chunk-G227SH2O.js → chunk-VVJUH4SV.js} +2 -2
  91. package/dist/{chunk-FMDGUCER.js → chunk-WHHNQA4C.js} +19 -10
  92. package/dist/{chunk-ZYS4UHEC.js → chunk-WOE46HSM.js} +4 -4
  93. package/dist/{chunk-HX34VBPE.js → chunk-X6ILS4XE.js} +4 -4
  94. package/dist/{chunk-LNO25UX4.js → chunk-YCKGZOKV.js} +6 -6
  95. package/dist/{chunk-2UABJ75E.js → chunk-YENJWLN4.js} +2 -2
  96. package/dist/{chunk-PGULTXDJ.js → chunk-ZHZTFA76.js} +5 -5
  97. package/dist/{chunk-WYD4PYTL.js → chunk-ZR2EPWW4.js} +9 -9
  98. package/dist/{global-upgrade-A7EADTOL.js → global-upgrade-KHP36X27.js} +6 -6
  99. package/dist/{paths-UIPHTZH4.js → paths-63XAPFWJ.js} +2 -2
  100. package/dist/{reapply-JAT4DS6G.js → reapply-Y2EXWAWE.js} +20 -20
  101. package/dist/src/index.js +19 -19
  102. package/dist/{upgrade-lock-YUSXU5I5.js → upgrade-lock-RF3LR2HC.js} +3 -3
  103. package/package.json +1 -1
@@ -1043,6 +1043,23 @@ var shellWordsOf = (command) => {
1043
1043
  finishWord();
1044
1044
  return words;
1045
1045
  };
1046
+ var basenameOf = (token) => {
1047
+ const slash = Math.max(token.lastIndexOf("/"), token.lastIndexOf("\\"));
1048
+ return slash === -1 ? token : token.slice(slash + 1);
1049
+ };
1050
+ var TRUSTED_EXE_PREFIXES = [
1051
+ "/bin/",
1052
+ "/sbin/",
1053
+ "/usr/bin/",
1054
+ "/usr/sbin/",
1055
+ "/usr/local/bin/",
1056
+ "/opt/homebrew/bin/"
1057
+ ];
1058
+ var isTrustedExecutable = (first) => {
1059
+ if (!first.includes("/")) return true;
1060
+ if (first.includes("..")) return false;
1061
+ return TRUSTED_EXE_PREFIXES.some((prefix) => first.startsWith(prefix));
1062
+ };
1046
1063
 
1047
1064
  // ../contracts/src/powershell-analysis.ts
1048
1065
  var SINGLE_QUOTES = /* @__PURE__ */ new Set(["'", "\u2018", "\u2019", "\u201A", "\u201B"]);
@@ -2643,10 +2660,62 @@ var record = (value) => value !== null && typeof value === "object" && !Array.is
2643
2660
  var identifier = (value) => typeof value === "string" && value.length > 0 && value.length <= 200;
2644
2661
  var isQuestionOwner = (value) => record(value) && value.capability === PERSONAL_QUESTION_CAPABILITY && identifier(value.machineId) && identifier(value.generation) && identifier(value.threadId) && identifier(value.turnId) && identifier(value.itemId) && (identifier(value.requestId) || typeof value.requestId === "number" && Number.isSafeInteger(value.requestId)) && value.method === "item/tool/requestUserInput" && typeof value.subjectHash === "string" && /^[a-f0-9]{64}$/.test(value.subjectHash) && Object.keys(value).length === 9;
2645
2662
 
2663
+ // ../contracts/src/codex-shell-script.ts
2664
+ var CODEX_SHELL_COMMAND_FLAGS = ["-lc", "-c"];
2665
+ var SHELLS_CODEX_RUNS_A_SCRIPT_IN = ["sh", "bash", "zsh"];
2666
+ var WORDS_IN_A_SHELL_SCRIPT_COMMAND = 3;
2667
+ var WORD_SEPARATOR = " ";
2668
+ var ABSOLUTE_PATH_START = "/";
2669
+ var BARE_WORD_PART = /^[A-Za-z0-9_@+:./\]-]+/;
2670
+ var SINGLE_QUOTED_WORD_PART = /^'([^']*)'/;
2671
+ var DOUBLE_QUOTED_WORD_PART = /^"((?:[^"$`\\!]|\\["$`\\])*)"/;
2672
+ var ESCAPED_INSIDE_DOUBLE_QUOTES = /\\(["$`\\])/g;
2673
+ var leadingWordPart = (rest) => {
2674
+ const bare = BARE_WORD_PART.exec(rest);
2675
+ if (bare) return { text: bare[0], length: bare[0].length };
2676
+ const single = SINGLE_QUOTED_WORD_PART.exec(rest);
2677
+ if (single) return { text: single[1] ?? "", length: single[0].length };
2678
+ const double = DOUBLE_QUOTED_WORD_PART.exec(rest);
2679
+ return double ? { text: (double[1] ?? "").replace(ESCAPED_INSIDE_DOUBLE_QUOTES, "$1"), length: double[0].length } : null;
2680
+ };
2681
+ var leadingWord = (rest) => {
2682
+ let text2 = "";
2683
+ let length = 0;
2684
+ for (let part = leadingWordPart(rest); part !== null; part = leadingWordPart(rest.slice(length))) {
2685
+ text2 += part.text;
2686
+ length += part.length;
2687
+ }
2688
+ return length === 0 ? null : { text: text2, length };
2689
+ };
2690
+ var wordsOfAJoinedCommand = (joined) => {
2691
+ const words = [];
2692
+ let rest = joined;
2693
+ while (rest.length > 0) {
2694
+ const word = leadingWord(rest);
2695
+ if (word === null) return null;
2696
+ words.push(word.text);
2697
+ rest = rest.slice(word.length);
2698
+ if (rest.length === 0) break;
2699
+ if (!rest.startsWith(WORD_SEPARATOR) || rest.length === WORD_SEPARATOR.length) return null;
2700
+ rest = rest.slice(WORD_SEPARATOR.length);
2701
+ }
2702
+ return words;
2703
+ };
2704
+ var isASystemShell = (program) => program.startsWith(ABSOLUTE_PATH_START) && isTrustedExecutable(program) && SHELLS_CODEX_RUNS_A_SCRIPT_IN.includes(basenameOf(program));
2705
+ var scriptACodexShellCommandRuns = (command) => {
2706
+ const words = wordsOfAJoinedCommand(command);
2707
+ if (words === null || words.length !== WORDS_IN_A_SHELL_SCRIPT_COMMAND) return null;
2708
+ const [shell, flag, script] = words;
2709
+ if (shell === void 0 || flag === void 0 || script === void 0) return null;
2710
+ if (!isASystemShell(shell) || !CODEX_SHELL_COMMAND_FLAGS.includes(flag)) return null;
2711
+ return script.trim().length === 0 ? null : script;
2712
+ };
2713
+
2646
2714
  // ../contracts/src/codex-native-approval.ts
2647
2715
  var CODEX_NATIVE_APPROVAL_CAPABILITY = "codex-native-approval-v1";
2648
2716
  var CODEX_NATIVE_APPROVAL_METHODS = ["item/commandExecution/requestApproval", "item/fileChange/requestApproval", "mcpServer/elicitation/request"];
2649
2717
  var CODEX_NATIVE_APPROVAL_CHOICES = { once: "Allow once", session: "Allow this conversation", deny: "Deny" };
2718
+ var CODEX_NATIVE_APPROVAL_REPLIES = { ask: "ask", deny: "deny", native: "native", allow: "allow" };
2650
2719
  var record2 = (v) => v !== null && typeof v === "object" && !Array.isArray(v);
2651
2720
  var identifier2 = (v) => typeof v === "string" && v.length > 0 && v.length <= 200;
2652
2721
  var text = (v) => typeof v === "string" && v.trim().length > 0 && v.length <= 16384;
@@ -2662,6 +2731,7 @@ var boundedJson = (value) => {
2662
2731
  };
2663
2732
  var BASE_KEYS = ["threadId", "turnId", "itemId", "startedAtMs", "reason"];
2664
2733
  var MCP_META_KEYS = ["codex_approval_kind", "codex_requires_user_input", "codex_request_type", "codex_strict_auto_review", "codex_sensitive_action", "approvals_reviewer", "persist", "source", "connector_id", "connector_name", "connector_description", "tool_name", "tool_title", "tool_description", "tool_params", "tool_params_display"];
2734
+ var MCP_FLAGS_THAT_ASK_FOR_A_PERSON = ["codex_requires_user_input", "codex_strict_auto_review", "codex_sensitive_action"];
2665
2735
  var COMPUTER_USE_META_KEYS = [...MCP_META_KEYS, "riskLevel", "subtitle", "tool_call_id"];
2666
2736
  var computerUseDisplay = (value) => Array.isArray(value) && value.length <= 16 && value.every((item) => record2(item) && keys(item, ["name", "display_name", "value"]) && text(item.name) && text(item.display_name) && text(item.value));
2667
2737
  var isExecpolicyAmendment = (value) => Array.isArray(value) && value.length > 0 && value.length <= 128 && value.every((token) => typeof token === "string" && token.length <= 16384);
@@ -2670,6 +2740,22 @@ var isCommandDecision = (value) => {
2670
2740
  if (!record2(value) || !keys(value, ["acceptWithExecpolicyAmendment"]) || !record2(value.acceptWithExecpolicyAmendment)) return false;
2671
2741
  return keys(value.acceptWithExecpolicyAmendment, ["execpolicy_amendment"]) && isExecpolicyAmendment(value.acceptWithExecpolicyAmendment.execpolicy_amendment);
2672
2742
  };
2743
+ var FILE_CHANGE_KINDS = ["add", "delete", "update"];
2744
+ var FILE_CHANGE_VERB = { add: "adding", delete: "deleting", update: "editing" };
2745
+ var FILE_CHANGE_LABEL = { add: "Add", delete: "Delete", update: "Edit" };
2746
+ var FILE_CHANGES_NAMED_IN_A_QUESTION = 3;
2747
+ var isFileChangeKind = (v) => FILE_CHANGE_KINDS.some((kind) => kind === v);
2748
+ var labelledFileChange = ({ kind, path }) => `${FILE_CHANGE_LABEL[kind]} ${path}`;
2749
+ var fileChangeQuestion = (changes) => {
2750
+ const [only] = changes;
2751
+ if (only && changes.length === 1) return `Allow ${FILE_CHANGE_VERB[only.kind]} ${only.path} once?`;
2752
+ const named = changes.slice(0, FILE_CHANGES_NAMED_IN_A_QUESTION).map(labelledFileChange).join(", ");
2753
+ const unnamed = changes.length - FILE_CHANGES_NAMED_IN_A_QUESTION;
2754
+ return `Allow these ${changes.length} file changes once? ${named}${unnamed > 0 ? ` and ${unnamed} more` : ""}`;
2755
+ };
2756
+ var withCodexReason = (detail, reason) => text(reason) ? `${detail}
2757
+
2758
+ Codex's reason: ${redactSecrets(reason)}` : detail;
2673
2759
  var parseCodexNativeApproval = (value) => {
2674
2760
  if (!record2(value) || !keys(value, ["method", "params", "changes"]) || !isMethod(value.method) || !record2(value.params) || !boundedJson(value)) return null;
2675
2761
  const p = value.params;
@@ -2681,7 +2767,8 @@ var parseCodexNativeApproval = (value) => {
2681
2767
  turnId: typeof p.turnId === "string" ? p.turnId : null,
2682
2768
  itemId: typeof p.itemId === "string" ? p.itemId : null,
2683
2769
  options: [CODEX_NATIVE_APPROVAL_CHOICES.once, CODEX_NATIVE_APPROVAL_CHOICES.deny],
2684
- negativeDecision: "decline"
2770
+ negativeDecision: "decline",
2771
+ codexAsksForAPerson: false
2685
2772
  };
2686
2773
  if (value.method === "mcpServer/elicitation/request") {
2687
2774
  const meta = p._meta;
@@ -2689,29 +2776,32 @@ var parseCodexNativeApproval = (value) => {
2689
2776
  if (value.changes !== void 0 || !keys(p, ["threadId", "turnId", "serverName", "mode", "message", "requestedSchema", "_meta"]) || !(p.mode === "form" || computerUse && (p.mode === "openai/form" || p.mode === "openaiForm")) || !identifier2(p.serverName) || !text(p.message) || p.message.length > 500 || !record2(p.requestedSchema) || !keys(p.requestedSchema, ["type", "properties", "required", "$schema"]) || p.requestedSchema.type !== "object" || !record2(p.requestedSchema.properties) || Object.keys(p.requestedSchema.properties).length !== 0 || p.requestedSchema.required != null && (!Array.isArray(p.requestedSchema.required) || p.requestedSchema.required.length !== 0)) return null;
2690
2777
  if (!record2(meta) || !keys(meta, computerUse ? COMPUTER_USE_META_KEYS : MCP_META_KEYS) || meta.codex_approval_kind !== "mcp_tool_call" || !identifier2(meta.tool_name) || !record2(meta.tool_params) || meta.tool_params_display != null && !(computerUse ? computerUseDisplay(meta.tool_params_display) : record2(meta.tool_params_display))) return null;
2691
2778
  if (computerUse && (meta.riskLevel !== "low" && meta.riskLevel !== "high" || meta.subtitle != null && !text(meta.subtitle) || !optionalIdentifier(meta.tool_call_id))) return null;
2692
- if (["codex_requires_user_input", "codex_strict_auto_review", "codex_sensitive_action"].some((key) => meta[key] != null && typeof meta[key] !== "boolean")) return null;
2779
+ if (MCP_FLAGS_THAT_ASK_FOR_A_PERSON.some((key) => meta[key] != null && typeof meta[key] !== "boolean")) return null;
2693
2780
  if (meta.approvals_reviewer != null && meta.approvals_reviewer !== "user") return null;
2694
2781
  if (meta.codex_request_type != null && meta.codex_request_type !== "approval_request") return null;
2695
2782
  if (["source", "connector_id", "connector_name", "connector_description", "tool_title", "tool_description"].some((key) => meta[key] != null && !text(meta[key]))) return null;
2696
2783
  const persistence = meta.persist == null ? [] : typeof meta.persist === "string" ? [meta.persist] : meta.persist;
2784
+ const codexAsksForAPerson = MCP_FLAGS_THAT_ASK_FOR_A_PERSON.some((key) => meta[key] === true);
2697
2785
  if (!Array.isArray(persistence) || persistence.some((v) => v !== "session" && v !== "always")) return null;
2698
2786
  if (computerUse) {
2699
2787
  if (!persistence.includes("session")) return null;
2700
2788
  return {
2701
2789
  ...base,
2790
+ codexAsksForAPerson,
2702
2791
  toolName: `mcp__${p.serverName}__${meta.tool_name}`,
2703
2792
  toolInputs: [meta.tool_params],
2704
2793
  question: p.message,
2705
- detail: [`Risk: ${meta.riskLevel}`, meta.subtitle, JSON.stringify(meta.tool_params)].filter(Boolean).join("\n"),
2794
+ detail: redactSecrets([`Risk: ${meta.riskLevel}`, meta.subtitle, JSON.stringify(meta.tool_params)].filter(Boolean).join("\n")),
2706
2795
  options: [CODEX_NATIVE_APPROVAL_CHOICES.session, CODEX_NATIVE_APPROVAL_CHOICES.deny]
2707
2796
  };
2708
2797
  }
2709
2798
  return {
2710
2799
  ...base,
2800
+ codexAsksForAPerson,
2711
2801
  toolName: `mcp__${p.serverName}__${meta.tool_name}`,
2712
2802
  toolInputs: [meta.tool_params],
2713
2803
  question: p.message,
2714
- detail: JSON.stringify(meta.tool_params),
2804
+ detail: redactSecrets(JSON.stringify(meta.tool_params)),
2715
2805
  options: persistence.includes("session") ? [CODEX_NATIVE_APPROVAL_CHOICES.once, CODEX_NATIVE_APPROVAL_CHOICES.session, CODEX_NATIVE_APPROVAL_CHOICES.deny] : base.options
2716
2806
  };
2717
2807
  }
@@ -2720,31 +2810,34 @@ var parseCodexNativeApproval = (value) => {
2720
2810
  if (value.changes !== void 0 || !keys(p, [...BASE_KEYS, "approvalId", "kind", "environmentId", "command", "cwd", "commandActions", "networkApprovalContext", "proposedExecpolicyAmendment", "proposedNetworkPolicyAmendments", "availableDecisions"]) || !optionalIdentifier(p.approvalId) || p.kind != null && p.kind !== "command" || p.environmentId != null && p.environmentId !== "local" || p.networkApprovalContext != null || p.proposedNetworkPolicyAmendments != null || p.proposedExecpolicyAmendment != null && !isExecpolicyAmendment(p.proposedExecpolicyAmendment) || !text(p.command) || !text(p.cwd)) return null;
2721
2811
  const decisions = p.availableDecisions ?? ["accept", "decline", "cancel"];
2722
2812
  if (!Array.isArray(decisions) || !decisions.includes("accept") || !decisions.some((v) => v === "decline" || v === "cancel") || !decisions.every(isCommandDecision)) return null;
2813
+ const command = scriptACodexShellCommandRuns(p.command) ?? p.command;
2723
2814
  return {
2724
2815
  ...base,
2725
2816
  toolName: "Bash",
2726
- toolInputs: [{ command: p.command }],
2817
+ toolInputs: [{ command }],
2727
2818
  cwd: p.cwd,
2728
2819
  question: "Allow this command once?",
2729
- detail: p.command,
2820
+ detail: withCodexReason(`${redactSecrets(command)}
2821
+
2822
+ Directory: ${redactSecrets(p.cwd)}`, p.reason),
2730
2823
  negativeDecision: decisions.includes("decline") ? "decline" : "cancel"
2731
2824
  };
2732
2825
  }
2733
2826
  if (!keys(p, [...BASE_KEYS, "grantRoot"]) || p.grantRoot != null || !Array.isArray(value.changes) || value.changes.length === 0 || value.changes.length > 32) return null;
2734
- const paths = [], diffs = [];
2827
+ const changes = [];
2735
2828
  for (const change of value.changes) {
2736
- if (!record2(change) || !keys(change, ["path", "kind", "diff"]) || !text(change.path) || typeof change.diff !== "string" || !record2(change.kind) || !keys(change.kind, ["type", "move_path"]) || !["add", "delete", "update"].includes(String(change.kind.type)) || change.kind.move_path != null) return null;
2737
- paths.push(change.path);
2738
- diffs.push(`${change.path}
2739
- ${change.diff}`);
2829
+ if (!record2(change) || !keys(change, ["path", "kind", "diff"]) || !text(change.path) || typeof change.diff !== "string" || !record2(change.kind) || !keys(change.kind, ["type", "move_path"]) || !isFileChangeKind(change.kind.type) || change.kind.move_path != null) return null;
2830
+ changes.push({ kind: change.kind.type, path: change.path, diff: change.diff });
2740
2831
  }
2832
+ const paths = changes.map((change) => change.path);
2741
2833
  return {
2742
2834
  ...base,
2743
2835
  toolName: "Edit",
2744
2836
  toolInputs: paths.map((file_path) => ({ file_path })),
2745
2837
  scopePaths: paths,
2746
- question: `Allow these ${paths.length} file changes once?`,
2747
- detail: diffs.join("\n\n")
2838
+ question: fileChangeQuestion(changes),
2839
+ detail: withCodexReason(changes.map((change) => `${redactSecrets(labelledFileChange(change))}
2840
+ ${redactSecretsDeep(change.diff)}`).join("\n\n"), p.reason)
2748
2841
  };
2749
2842
  };
2750
2843
  var codexNativeApprovalResponse = (approval, answer) => {
@@ -3326,23 +3419,6 @@ var SAFE_FIND_TOKENS = /* @__PURE__ */ new Set([
3326
3419
  "-O"
3327
3420
  ]);
3328
3421
  var SAFE_REDIRECTION = /\s*(?:[0-9]*>&[0-9-]+|(?:[0-9]*|&)>>?\s*\/dev\/null)/g;
3329
- var basenameOf = (token) => {
3330
- const slash = Math.max(token.lastIndexOf("/"), token.lastIndexOf("\\"));
3331
- return slash === -1 ? token : token.slice(slash + 1);
3332
- };
3333
- var TRUSTED_EXE_PREFIXES = [
3334
- "/bin/",
3335
- "/sbin/",
3336
- "/usr/bin/",
3337
- "/usr/sbin/",
3338
- "/usr/local/bin/",
3339
- "/opt/homebrew/bin/"
3340
- ];
3341
- var isTrustedExecutable = (first) => {
3342
- if (!first.includes("/")) return true;
3343
- if (first.includes("..")) return false;
3344
- return TRUSTED_EXE_PREFIXES.some((prefix) => first.startsWith(prefix));
3345
- };
3346
3422
  var isSafeSimpleCommand = (segment) => {
3347
3423
  const tokens = shellWordsOf(segment)?.map((word) => word.text);
3348
3424
  if (!tokens || tokens.length === 0) return false;
@@ -6283,8 +6359,11 @@ export {
6283
6359
  isAutoUpdateResult,
6284
6360
  PERSONAL_QUESTION_CAPABILITY,
6285
6361
  isQuestionOwner,
6362
+ CODEX_SHELL_COMMAND_FLAGS,
6286
6363
  CODEX_NATIVE_APPROVAL_CAPABILITY,
6287
6364
  CODEX_NATIVE_APPROVAL_METHODS,
6365
+ CODEX_NATIVE_APPROVAL_CHOICES,
6366
+ CODEX_NATIVE_APPROVAL_REPLIES,
6288
6367
  parseCodexNativeApproval,
6289
6368
  codexNativeApprovalResponse,
6290
6369
  normalizeKeyScope,
@@ -2,23 +2,23 @@ import {
2
2
  CLAUDE_HOOK_EVENTS,
3
3
  GEMINI_HOOK_EVENTS,
4
4
  hasGeminiHooks
5
- } from "./chunk-35TUEZ5E.js";
5
+ } from "./chunk-PHKISQPB.js";
6
6
  import {
7
7
  AGENT_CHOICES
8
- } from "./chunk-NO3ADUD4.js";
8
+ } from "./chunk-3KSN65VJ.js";
9
9
  import {
10
10
  BELL_HOOK_BINARY
11
- } from "./chunk-UCRG5QGN.js";
11
+ } from "./chunk-DDS472RO.js";
12
12
  import {
13
13
  CODEX_HOOK_EVENTS,
14
14
  hasCodexHooks,
15
15
  holdBudgetOf
16
- } from "./chunk-EW52AGOV.js";
16
+ } from "./chunk-MCL5IS6A.js";
17
17
  import {
18
18
  CURSOR_GATE_EVENTS,
19
19
  HOOK_LOCATOR_BINARY,
20
20
  hookCommandHoldBudget
21
- } from "./chunk-EDSXF7NV.js";
21
+ } from "./chunk-DY5PQSQB.js";
22
22
 
23
23
  // src/diagnostics/bridge.ts
24
24
  import { execFileSync } from "child_process";
@@ -1,18 +1,18 @@
1
1
  import {
2
2
  macAppBridgeAvailable
3
- } from "./chunk-VTF7LKDB.js";
3
+ } from "./chunk-3F3JHJPS.js";
4
4
  import {
5
5
  keyPrefix
6
- } from "./chunk-LA4S2KIM.js";
6
+ } from "./chunk-S3657KK2.js";
7
7
  import {
8
8
  bridgeAgentKey
9
- } from "./chunk-EW52AGOV.js";
9
+ } from "./chunk-MCL5IS6A.js";
10
10
  import {
11
11
  readJsonSafe
12
12
  } from "./chunk-AQFEP65J.js";
13
13
  import {
14
14
  isValidApiKey
15
- } from "./chunk-EDSXF7NV.js";
15
+ } from "./chunk-DY5PQSQB.js";
16
16
 
17
17
  // src/shared-mcp-key.ts
18
18
  var asRecord = (value) => value !== null && typeof value === "object" && !Array.isArray(value) ? value : void 0;
@@ -1,16 +1,16 @@
1
1
  import {
2
2
  readExistingMachineId
3
- } from "./chunk-ULEX43F7.js";
3
+ } from "./chunk-VQZ4FP6Z.js";
4
4
  import {
5
5
  NetworkError
6
6
  } from "./chunk-7QLSKOSU.js";
7
7
  import {
8
8
  getBaseUrl
9
- } from "./chunk-7XSIUY5F.js";
9
+ } from "./chunk-PRQMACC7.js";
10
10
  import {
11
11
  clientContextHeaders,
12
12
  getPackageVersion
13
- } from "./chunk-EDSXF7NV.js";
13
+ } from "./chunk-DY5PQSQB.js";
14
14
 
15
15
  // src/cli/net.ts
16
16
  import { createRequire } from "module";
@@ -5,18 +5,18 @@ import {
5
5
  import {
6
6
  SubscriptionRequiredError,
7
7
  callMcpTool
8
- } from "./chunk-FQW7AV6U.js";
8
+ } from "./chunk-6VFP72GX.js";
9
9
  import {
10
10
  installNetworkDefaults,
11
11
  isNetworkFailure
12
- } from "./chunk-KJNWVAS6.js";
12
+ } from "./chunk-FY6ZTTDQ.js";
13
13
  import {
14
14
  clientReportClaims
15
- } from "./chunk-EW52AGOV.js";
15
+ } from "./chunk-MCL5IS6A.js";
16
16
  import {
17
17
  getApiKey,
18
18
  getBaseUrl
19
- } from "./chunk-7XSIUY5F.js";
19
+ } from "./chunk-PRQMACC7.js";
20
20
  import {
21
21
  ASK_AGENT_NAME_MAX,
22
22
  CLIENT_REPORT_PATH,
@@ -26,7 +26,7 @@ import {
26
26
  localRepoKey,
27
27
  normalizeRepoRemote,
28
28
  truncateLine
29
- } from "./chunk-EDSXF7NV.js";
29
+ } from "./chunk-DY5PQSQB.js";
30
30
 
31
31
  // src/client-report-claim.ts
32
32
  import { createHash } from "crypto";
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  ensureCodexTrustsPusharyHooks
3
- } from "./chunk-2ZD53EQW.js";
3
+ } from "./chunk-TSI25WVW.js";
4
4
  import {
5
5
  OPENCODE_HOOK_BINARY,
6
6
  agentHookOwner,
@@ -9,7 +9,7 @@ import {
9
9
  openCodeHookArgv,
10
10
  openCodePluginDir,
11
11
  openCodeWired
12
- } from "./chunk-VTF7LKDB.js";
12
+ } from "./chunk-3F3JHJPS.js";
13
13
  import {
14
14
  addClaudeMcpServer,
15
15
  addCompatibleHooks,
@@ -17,7 +17,7 @@ import {
17
17
  addPusharyToolPermissions,
18
18
  compatibleConfigFile,
19
19
  hasCompatibleHooks
20
- } from "./chunk-OI6YNNI5.js";
20
+ } from "./chunk-TP5SLM2I.js";
21
21
  import {
22
22
  claudeUnprovenHolds,
23
23
  claudeWired,
@@ -25,7 +25,7 @@ import {
25
25
  codexWired,
26
26
  geminiWired,
27
27
  planHooks
28
- } from "./chunk-EP4MD6TH.js";
28
+ } from "./chunk-FDDZEYGM.js";
29
29
  import {
30
30
  CLAUDE_HOOK_BINARY,
31
31
  CLAUDE_HOOK_EVENTS,
@@ -36,7 +36,7 @@ import {
36
36
  needsReregistration,
37
37
  registrationSignatures,
38
38
  supportedClaudeEvents
39
- } from "./chunk-35TUEZ5E.js";
39
+ } from "./chunk-PHKISQPB.js";
40
40
  import {
41
41
  detectClaudeVersion
42
42
  } from "./chunk-RIVNNBEK.js";
@@ -63,7 +63,7 @@ import {
63
63
  resolveGlobalBinDir,
64
64
  resolveGlobalBinary,
65
65
  vscodePluginMcp
66
- } from "./chunk-EW52AGOV.js";
66
+ } from "./chunk-MCL5IS6A.js";
67
67
  import {
68
68
  readJsonSafe,
69
69
  writeFileAtomic,
@@ -73,7 +73,7 @@ import {
73
73
  HOOK_COMPATIBLE_PROFILES,
74
74
  isCompatibleAgentType,
75
75
  isRecord
76
- } from "./chunk-EDSXF7NV.js";
76
+ } from "./chunk-DY5PQSQB.js";
77
77
 
78
78
  // src/reapply.ts
79
79
  import { dirname, join } from "path";
@@ -14,19 +14,19 @@ import {
14
14
  } from "./chunk-FO3MDD26.js";
15
15
  import {
16
16
  reportedInstallSource
17
- } from "./chunk-W7MXYDGP.js";
17
+ } from "./chunk-ADKWE35P.js";
18
18
  import {
19
19
  callMcpTool
20
- } from "./chunk-FQW7AV6U.js";
20
+ } from "./chunk-6VFP72GX.js";
21
21
  import {
22
22
  NPX_LATEST_COMMAND
23
- } from "./chunk-WN3MDHAM.js";
23
+ } from "./chunk-VE4LQ23C.js";
24
24
  import {
25
25
  NO_PAIRING_COMPUTER,
26
26
  PAIR_TTL_SECONDS,
27
27
  classifyConfirmResponse,
28
28
  isAnswerSource
29
- } from "./chunk-EDSXF7NV.js";
29
+ } from "./chunk-DY5PQSQB.js";
30
30
 
31
31
  // src/reach.ts
32
32
  var reachVerdict = (channels) => {
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  APPROVAL_SETTINGS_PATH
3
- } from "./chunk-HX34VBPE.js";
3
+ } from "./chunk-X6ILS4XE.js";
4
4
  import {
5
5
  readMacAppAgentKey
6
- } from "./chunk-UP2RNIHL.js";
6
+ } from "./chunk-FWQ2O5BI.js";
7
7
  import {
8
8
  findExportedKeyLines,
9
9
  isAdoptedMacAppKey,
@@ -13,13 +13,13 @@ import {
13
13
  readConfigFileKey,
14
14
  readKeySource,
15
15
  readMacAppKeyPrefix
16
- } from "./chunk-LA4S2KIM.js";
16
+ } from "./chunk-S3657KK2.js";
17
17
  import {
18
18
  absoluteUrl
19
- } from "./chunk-2X3PPRNC.js";
19
+ } from "./chunk-KQDHOQRG.js";
20
20
  import {
21
21
  isValidApiKey
22
- } from "./chunk-EDSXF7NV.js";
22
+ } from "./chunk-DY5PQSQB.js";
23
23
 
24
24
  // src/key-revocation.ts
25
25
  var SELF_REVOKE_PATH = "/api/v1/server/keys/self/revoke";
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  pusharyDir
3
- } from "./chunk-EW52AGOV.js";
3
+ } from "./chunk-MCL5IS6A.js";
4
4
  import {
5
5
  readJsonSafe,
6
6
  writeFileAtomic
@@ -13,7 +13,7 @@ import {
13
13
  serializeDeclinedAgents,
14
14
  withDeclinedAgent,
15
15
  withoutDeclinedAgent
16
- } from "./chunk-EDSXF7NV.js";
16
+ } from "./chunk-DY5PQSQB.js";
17
17
 
18
18
  // src/declined-agents-file.ts
19
19
  import { join } from "path";
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  pusharyFetch
3
- } from "./chunk-KJNWVAS6.js";
3
+ } from "./chunk-FY6ZTTDQ.js";
4
4
  import {
5
5
  NetworkError
6
6
  } from "./chunk-7QLSKOSU.js";
@@ -9,11 +9,11 @@ import {
9
9
  } from "./chunk-KZERVKTD.js";
10
10
  import {
11
11
  getBaseUrl
12
- } from "./chunk-7XSIUY5F.js";
12
+ } from "./chunk-PRQMACC7.js";
13
13
  import {
14
14
  isValidApiKey,
15
15
  normalizeKeyScope
16
- } from "./chunk-EDSXF7NV.js";
16
+ } from "./chunk-DY5PQSQB.js";
17
17
 
18
18
  // src/session.ts
19
19
  var samePusharyAccount = (left, right) => left.kind === "ok" && right.kind === "ok" && left.identity.workspaceId !== "" && left.identity.workspaceId === right.identity.workspaceId && left.identity.siteId === right.identity.siteId;
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  isSafeReadOnlyCommand
3
- } from "./chunk-EDSXF7NV.js";
3
+ } from "./chunk-DY5PQSQB.js";
4
4
 
5
5
  // src/ledger.ts
6
6
  import { appendFileSync, existsSync, mkdirSync, readFileSync, renameSync, rmSync, statSync } from "fs";
@@ -9,7 +9,7 @@ import {
9
9
  } from "./chunk-3EGEA4KH.js";
10
10
  import {
11
11
  getBaseUrl
12
- } from "./chunk-7XSIUY5F.js";
12
+ } from "./chunk-PRQMACC7.js";
13
13
 
14
14
  // src/cli/login-ui.ts
15
15
  import { hostname } from "os";
@@ -10,10 +10,10 @@ import {
10
10
  resolvePackageVersionFromBinary,
11
11
  resolvePathBinary,
12
12
  resolvePathBinaryAsync
13
- } from "./chunk-EW52AGOV.js";
13
+ } from "./chunk-MCL5IS6A.js";
14
14
  import {
15
15
  MANAGED_PROVIDERS
16
- } from "./chunk-EDSXF7NV.js";
16
+ } from "./chunk-DY5PQSQB.js";
17
17
 
18
18
  // src/setup/codex-install.ts
19
19
  var NATIVE_BINARY_MIN_BYTES = 20 * 1024 * 1024;
@@ -14,7 +14,7 @@ import {
14
14
  isReleaseVersion,
15
15
  ownPackageName,
16
16
  withHookHoldBudget
17
- } from "./chunk-EDSXF7NV.js";
17
+ } from "./chunk-DY5PQSQB.js";
18
18
 
19
19
  // src/setup/paths.ts
20
20
  import { homedir as homedir2 } from "os";
@@ -402,9 +402,9 @@ var installGlobally = (options) => {
402
402
  }
403
403
  const started = (async () => {
404
404
  if (!npmIsOnPath()) throw new NpmMissingError();
405
- const { withUpgradeLock } = await import("./global-upgrade-A7EADTOL.js");
406
- const { installWithUpgradeLock, ownsUpgradeLock } = await import("./upgrade-lock-YUSXU5I5.js");
407
- const { autoUpdateLock: autoUpdateLock2 } = await import("./paths-UIPHTZH4.js");
405
+ const { withUpgradeLock } = await import("./global-upgrade-KHP36X27.js");
406
+ const { installWithUpgradeLock, ownsUpgradeLock } = await import("./upgrade-lock-RF3LR2HC.js");
407
+ const { autoUpdateLock: autoUpdateLock2 } = await import("./paths-63XAPFWJ.js");
408
408
  let result = "skipped";
409
409
  const install = async () => {
410
410
  const platform = process.platform;
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  HOOK_HOLD_BUDGET_ENV,
3
3
  hookHoldBudgetProof
4
- } from "./chunk-EDSXF7NV.js";
4
+ } from "./chunk-DY5PQSQB.js";
5
5
 
6
6
  // src/hold-budget.ts
7
7
  var takeHookHoldBudget = (args = process.argv.slice(2), env = process.env) => {
@@ -1,18 +1,18 @@
1
1
  import {
2
2
  registerTranscript
3
- } from "./chunk-I5EQ5NJD.js";
3
+ } from "./chunk-CVCOZWSB.js";
4
4
  import {
5
5
  namedEvent
6
- } from "./chunk-OI6YNNI5.js";
6
+ } from "./chunk-TP5SLM2I.js";
7
7
  import {
8
8
  writeDegraded
9
- } from "./chunk-UGXRDY3O.js";
9
+ } from "./chunk-GLVPA4EK.js";
10
10
  import {
11
11
  claudeShapedHookInput,
12
12
  hookCompatibleProfileBySource,
13
13
  isGrokHookPayload,
14
14
  isGrokSessionEndStop
15
- } from "./chunk-EDSXF7NV.js";
15
+ } from "./chunk-DY5PQSQB.js";
16
16
 
17
17
  // src/tool-hook-input.ts
18
18
  var OPTIONAL_TEXT_FIELDS = ["hook_event_name", "session_id", "cwd", "transcript_path", "tool_use_id", "permission_mode"];
@@ -1,14 +1,14 @@
1
1
  import {
2
2
  MCP_BRIDGE_BINARY
3
- } from "./chunk-XAMFOUXA.js";
3
+ } from "./chunk-UFTPB3LZ.js";
4
4
  import {
5
5
  KEY_FILE_MODE
6
- } from "./chunk-LA4S2KIM.js";
6
+ } from "./chunk-S3657KK2.js";
7
7
  import {
8
8
  NpmInstallError,
9
9
  NpmMissingError,
10
10
  NpmPermissionError
11
- } from "./chunk-EW52AGOV.js";
11
+ } from "./chunk-MCL5IS6A.js";
12
12
  import {
13
13
  readJsonSafe,
14
14
  writeFileAtomic,
@@ -16,10 +16,10 @@ import {
16
16
  } from "./chunk-AQFEP65J.js";
17
17
  import {
18
18
  NPX_LATEST_COMMAND
19
- } from "./chunk-WN3MDHAM.js";
19
+ } from "./chunk-VE4LQ23C.js";
20
20
  import {
21
21
  readSetupAgentFailures
22
- } from "./chunk-EDSXF7NV.js";
22
+ } from "./chunk-DY5PQSQB.js";
23
23
 
24
24
  // src/instruction-file.ts
25
25
  import { existsSync, readFileSync, writeFileSync, mkdirSync, rmSync } from "fs";
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  SETUP_FLAGS
3
- } from "./chunk-NO3ADUD4.js";
3
+ } from "./chunk-3KSN65VJ.js";
4
4
  import {
5
5
  parseFlags
6
6
  } from "./chunk-GMXKITVA.js";
@@ -9,7 +9,7 @@ import {
9
9
  } from "./chunk-7QLSKOSU.js";
10
10
  import {
11
11
  NPX_LATEST_COMMAND
12
- } from "./chunk-WN3MDHAM.js";
12
+ } from "./chunk-VE4LQ23C.js";
13
13
  import {
14
14
  CLAUDE_CONNECTOR_GUIDE,
15
15
  CLAUDE_CONNECTOR_STEPS,
@@ -17,7 +17,7 @@ import {
17
17
  CLAUDE_CONNECTOR_URL,
18
18
  COWORK_CONNECTOR_LIMIT,
19
19
  COWORK_STANDING_INSTRUCTIONS
20
- } from "./chunk-EDSXF7NV.js";
20
+ } from "./chunk-DY5PQSQB.js";
21
21
 
22
22
  // src/cli/cowork.ts
23
23
  import { readFileSync } from "fs";