pushary 1.9.55 → 1.9.57

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 (120) hide show
  1. package/CHANGELOG.md +19 -0
  2. package/dist/{api-K6ZROHYB.js → api-RQAY3A5V.js} +11 -11
  3. package/dist/bin/pushary-bell-hook.js +29 -29
  4. package/dist/bin/pushary-bell.js +11 -11
  5. package/dist/bin/pushary-claude.js +31 -30
  6. package/dist/bin/pushary-clean.js +35 -34
  7. package/dist/bin/pushary-codex-bridge.js +23 -22
  8. package/dist/bin/pushary-codex-hook.js +34 -34
  9. package/dist/bin/pushary-codex-session.js +8 -8
  10. package/dist/bin/pushary-codex.js +15 -15
  11. package/dist/bin/pushary-connect.js +27 -27
  12. package/dist/bin/pushary-cowork.js +5 -5
  13. package/dist/bin/pushary-daemon.js +40 -39
  14. package/dist/bin/pushary-disconnect.js +27 -27
  15. package/dist/bin/pushary-doctor.js +41 -39
  16. package/dist/bin/pushary-elicitation-hook.js +29 -29
  17. package/dist/bin/pushary-gemini-bridge.js +17 -16
  18. package/dist/bin/pushary-gemini-hook.js +31 -31
  19. package/dist/bin/pushary-hook.js +33 -33
  20. package/dist/bin/pushary-login.js +14 -14
  21. package/dist/bin/pushary-logout.js +27 -27
  22. package/dist/bin/pushary-mcp.js +12 -12
  23. package/dist/bin/pushary-mode.js +14 -14
  24. package/dist/bin/pushary-notification-hook.js +28 -28
  25. package/dist/bin/pushary-opencode-hook.js +30 -30
  26. package/dist/bin/pushary-permission-denied-hook.js +33 -33
  27. package/dist/bin/pushary-permission-hook.js +32 -32
  28. package/dist/bin/pushary-post-hook.js +28 -28
  29. package/dist/bin/pushary-prompt-hook.js +28 -28
  30. package/dist/bin/pushary-session-end-hook.js +30 -29
  31. package/dist/bin/pushary-session-start-hook.js +36 -35
  32. package/dist/bin/pushary-setup.js +46 -43
  33. package/dist/bin/pushary-stats.js +5 -5
  34. package/dist/bin/pushary-status.js +31 -30
  35. package/dist/bin/pushary-stop-hook.js +28 -28
  36. package/dist/bin/pushary-stopfailure-hook.js +28 -28
  37. package/dist/bin/pushary-suggestions.js +14 -14
  38. package/dist/bin/pushary-transcript-register.js +20 -20
  39. package/dist/bin/pushary-transcripts.js +9 -9
  40. package/dist/bin/pushary-upgrade.js +37 -36
  41. package/dist/bin/pushary-wait.js +14 -14
  42. package/dist/bin/pushary.js +8 -8
  43. package/dist/{chunk-FCMWUYIE.js → chunk-2NIRYGTK.js} +2 -2
  44. package/dist/{chunk-ZWOWEXCV.js → chunk-2PJENKRJ.js} +10 -7
  45. package/dist/{chunk-ALZZVC3E.js → chunk-3IBUZQKM.js} +3 -3
  46. package/dist/{chunk-ZOP3I2GQ.js → chunk-3TJLPABQ.js} +3 -3
  47. package/dist/{chunk-NHVEQLQC.js → chunk-4QD7VE4E.js} +2 -2
  48. package/dist/{chunk-6SWMKF5E.js → chunk-4YNNAF53.js} +2 -2
  49. package/dist/{chunk-U2L42GVI.js → chunk-4YTFYILS.js} +10 -10
  50. package/dist/{chunk-MC4VY5LK.js → chunk-5SFM6XB4.js} +1 -1
  51. package/dist/{chunk-ZMPR436Z.js → chunk-6QM54CSJ.js} +5 -5
  52. package/dist/{chunk-H57DXSHR.js → chunk-7OQ4AJC7.js} +3 -3
  53. package/dist/{chunk-4QQEUJL4.js → chunk-7RZO6VWD.js} +2 -2
  54. package/dist/{chunk-P2546BBI.js → chunk-A54W5A74.js} +3 -3
  55. package/dist/{chunk-XUW2DRAQ.js → chunk-AEXACKDR.js} +3 -3
  56. package/dist/{chunk-XDCXTDHH.js → chunk-AN6TVB2H.js} +5 -5
  57. package/dist/{chunk-QKU46TK5.js → chunk-BAJ3A3BU.js} +3 -3
  58. package/dist/{chunk-FV34HT35.js → chunk-C3IWX6KU.js} +1 -1
  59. package/dist/{chunk-56ZTIY6D.js → chunk-CB565EVO.js} +3 -3
  60. package/dist/{chunk-Q7OXI6VS.js → chunk-CUEUANIU.js} +5 -5
  61. package/dist/{chunk-LGTF7AZX.js → chunk-D2EETYAL.js} +4 -4
  62. package/dist/{chunk-2LEH5IGX.js → chunk-DDQRYX2L.js} +28 -14
  63. package/dist/{chunk-LD4MWJMD.js → chunk-DS6OR5OS.js} +6 -6
  64. package/dist/{chunk-BUXDR6US.js → chunk-ECJJKDP7.js} +1 -1
  65. package/dist/{chunk-L5YTS2BP.js → chunk-FBKVCODG.js} +3 -3
  66. package/dist/{chunk-PQ4K74WL.js → chunk-FVERRWDP.js} +15 -12
  67. package/dist/{chunk-LF3TLC7B.js → chunk-GZL3KEPC.js} +51 -25
  68. package/dist/{chunk-EK7SZJ4K.js → chunk-HCIB4YNB.js} +3 -3
  69. package/dist/{chunk-NSY2V7XU.js → chunk-I43PY5G3.js} +1 -1
  70. package/dist/{chunk-RL7EOD6I.js → chunk-IBSRULIY.js} +11 -11
  71. package/dist/{chunk-VYBH6D4X.js → chunk-IRZ5FVWG.js} +4 -4
  72. package/dist/{chunk-UVT6B6XN.js → chunk-IUOUNRLH.js} +2 -2
  73. package/dist/{chunk-46TC24ET.js → chunk-JCMSISCC.js} +2 -2
  74. package/dist/{chunk-5463UUO2.js → chunk-JSQOHMNJ.js} +1 -1
  75. package/dist/{chunk-7CLLWDCP.js → chunk-JYXIARGW.js} +1 -1
  76. package/dist/{chunk-JOWF4Y4P.js → chunk-K45CFSYV.js} +4 -4
  77. package/dist/{chunk-NELH25J7.js → chunk-K5SDLOFS.js} +11 -11
  78. package/dist/{chunk-CQ5JGRML.js → chunk-LVDC3RUE.js} +1 -1
  79. package/dist/{chunk-RIVNNBEK.js → chunk-LVWXRXT7.js} +27 -12
  80. package/dist/{chunk-DHJSBK63.js → chunk-LVZYIUSR.js} +1 -1
  81. package/dist/{chunk-EPOD7QHT.js → chunk-LW7IWGSV.js} +12 -9
  82. package/dist/{chunk-S6RNS4UL.js → chunk-M7NX25ZA.js} +1 -1
  83. package/dist/{chunk-GCN73COS.js → chunk-N3NSWWNU.js} +1 -1
  84. package/dist/{chunk-MTKV4RUQ.js → chunk-NQDEMRAS.js} +6 -6
  85. package/dist/{chunk-MHQB62K5.js → chunk-OLNBYAPI.js} +5 -5
  86. package/dist/{chunk-T5L5NWT3.js → chunk-OZSP4RIQ.js} +2 -2
  87. package/dist/{chunk-K23WMLPY.js → chunk-PZDMZ7LM.js} +6 -6
  88. package/dist/{chunk-AQFEP65J.js → chunk-QENTGE75.js} +10 -1
  89. package/dist/{chunk-JPABKXK6.js → chunk-QLDTBZBP.js} +36 -28
  90. package/dist/{chunk-6C4S3QYD.js → chunk-QQYUWTYS.js} +3 -3
  91. package/dist/{chunk-3RPN7AAT.js → chunk-QTCFEKLJ.js} +1 -1
  92. package/dist/{chunk-DWQYCOPI.js → chunk-QW3FRUFB.js} +1 -1
  93. package/dist/{chunk-NECZKPJN.js → chunk-RFAF3TOX.js} +5 -5
  94. package/dist/{chunk-FI73DGNB.js → chunk-S5LX25XE.js} +1 -1
  95. package/dist/{chunk-T6RIKJUO.js → chunk-SQ5G6A6K.js} +2 -2
  96. package/dist/{chunk-RH6KR6EH.js → chunk-T45PAPOG.js} +5 -5
  97. package/dist/{chunk-OML4YFBN.js → chunk-TWLWDIFB.js} +2 -2
  98. package/dist/{chunk-N77BH7H2.js → chunk-UPFFO4F6.js} +4 -4
  99. package/dist/chunk-VUFHYMSP.js +32 -0
  100. package/dist/{chunk-VQPSWD3A.js → chunk-W6363YYZ.js} +10 -10
  101. package/dist/{chunk-XSUJ2PQY.js → chunk-WXZN5CS3.js} +3 -3
  102. package/dist/{chunk-ONCWYACA.js → chunk-XTZHUIGJ.js} +1 -1
  103. package/dist/{chunk-JBT3ZSJS.js → chunk-XXNT4FGA.js} +1 -1
  104. package/dist/{chunk-LIESRXK5.js → chunk-YKYVDHIY.js} +1 -1
  105. package/dist/{chunk-BL3WAGIK.js → chunk-Z7Q36I4K.js} +7 -7
  106. package/dist/{chunk-63IQRYVP.js → chunk-ZU6L34DQ.js} +4 -4
  107. package/dist/{chunk-IHUFRAHB.js → chunk-ZZB4J6CX.js} +4 -4
  108. package/dist/{codex-app-cards-switch-P4RVJNRV.js → codex-app-cards-switch-SVGTZ2UN.js} +12 -12
  109. package/dist/{codex-desktop-launch-RIBIFXSF.js → codex-desktop-launch-SH7OUEEC.js} +1 -1
  110. package/dist/{codex-session-launch-KLH2FSSJ.js → codex-session-launch-IQ57OL3N.js} +20 -19
  111. package/dist/{config-HX6ZNOIL.js → config-SYLUYZQE.js} +3 -3
  112. package/dist/{global-upgrade-AZN3BPI3.js → global-upgrade-SRCWQE7N.js} +8 -8
  113. package/dist/{identity-AQIMUWYN.js → identity-6KRUO2YO.js} +5 -5
  114. package/dist/{live-capabilities-4IIFAMHU.js → live-capabilities-RKUHAWT6.js} +8 -4
  115. package/dist/{paths-X4IPV2WJ.js → paths-MUPQZNLG.js} +3 -3
  116. package/dist/{reapply-CXODG53B.js → reapply-YZXZCWCI.js} +28 -27
  117. package/dist/src/index.js +22 -22
  118. package/dist/{upgrade-lock-AHISGKER.js → upgrade-lock-JXP27UKI.js} +5 -5
  119. package/dist/{usage-ZC6BKIE3.js → usage-OUV76AIY.js} +3 -3
  120. package/package.json +1 -1
@@ -2885,30 +2885,32 @@ var timeoutActionWithoutLocalPrompt = ({ mode, timeoutAction }) => mode !== "pus
2885
2885
  var TIMEOUT_ACTIONS = ["approve", "deny", "escalate", "wait"];
2886
2886
  var isTimeoutAction = (value) => typeof value === "string" && TIMEOUT_ACTIONS.includes(value);
2887
2887
  var MAX_AGENT_QUESTIONS = 4;
2888
+ var MIN_AGENT_QUESTION_OPTIONS = 2;
2889
+ var MAX_AGENT_QUESTION_OPTIONS = 4;
2888
2890
  var AGENT_QUESTION_HEADER_MAX = 40;
2889
2891
  var AGENT_QUESTION_OPTION_MAX = 100;
2890
2892
  var AGENT_QUESTION_DESCRIPTION_MAX = 500;
2891
- var parseAgentQuestion = (raw) => {
2892
- const q = raw;
2893
- if (!q || typeof q.question !== "string") return void 0;
2894
- const options = Array.isArray(q.options) ? q.options.flatMap((option) => {
2895
- if (!option || typeof option !== "object") return [];
2896
- const value = option;
2897
- if (typeof value.label !== "string" || value.label.length === 0) return [];
2898
- return [{
2899
- label: value.label,
2900
- ...typeof value.description === "string" ? { description: value.description } : {}
2901
- }];
2902
- }) : [];
2903
- if (options.length < 2) return void 0;
2893
+ var agentQuestionOptionIn = (raw) => {
2894
+ if (!isRecord(raw) || typeof raw.label !== "string" || raw.label.length === 0) return [];
2895
+ return [{
2896
+ label: raw.label,
2897
+ ...typeof raw.description === "string" ? { description: raw.description } : {}
2898
+ }];
2899
+ };
2900
+ var agentQuestionFieldsIn = (raw) => {
2901
+ if (!isRecord(raw) || typeof raw.question !== "string") return void 0;
2904
2902
  return {
2905
- question: q.question,
2906
- ...typeof q.header === "string" ? { header: q.header } : {},
2907
- multiSelect: q.multiSelect === true,
2908
- ...typeof q.allowOther === "boolean" ? { allowOther: q.allowOther } : {},
2909
- options
2903
+ question: raw.question,
2904
+ ...typeof raw.header === "string" ? { header: raw.header } : {},
2905
+ multiSelect: raw.multiSelect === true,
2906
+ ...typeof raw.allowOther === "boolean" ? { allowOther: raw.allowOther } : {},
2907
+ options: Array.isArray(raw.options) ? raw.options.flatMap(agentQuestionOptionIn) : []
2910
2908
  };
2911
2909
  };
2910
+ var parseAgentQuestion = (raw) => {
2911
+ const question = agentQuestionFieldsIn(raw);
2912
+ return question && question.options.length >= MIN_AGENT_QUESTION_OPTIONS ? question : void 0;
2913
+ };
2912
2914
  var parseAgentQuestions = (toolInput) => {
2913
2915
  const questions = toolInput.questions;
2914
2916
  if (!Array.isArray(questions) || questions.length === 0) return void 0;
@@ -2921,13 +2923,16 @@ var parseAgentQuestions = (toolInput) => {
2921
2923
  }
2922
2924
  return parsed;
2923
2925
  };
2926
+ var isTypedAnswerQuestion = (question) => question.options.length === 0;
2927
+ var typingCanAnswer = (question) => question.multiSelect === false && question.allowOther !== false;
2928
+ var optionCountCanBeAnswered = (question, optionCount) => optionCount === 0 ? typingCanAnswer(question) : optionCount >= MIN_AGENT_QUESTION_OPTIONS && optionCount <= MAX_AGENT_QUESTION_OPTIONS;
2924
2929
  var isAgentQuestionSet = (value) => {
2925
2930
  if (!Array.isArray(value) || value.length === 0 || value.length > 4) return false;
2926
2931
  const questions = /* @__PURE__ */ new Set();
2927
2932
  for (const item of value) {
2928
- if (!item || typeof item !== "object" || Array.isArray(item)) return false;
2933
+ if (!isRecord(item)) return false;
2929
2934
  const question = item;
2930
- if (typeof question.question !== "string" || question.question.length === 0 || questions.has(question.question) || question.header !== void 0 && typeof question.header !== "string" || typeof question.multiSelect !== "boolean" || question.allowOther !== void 0 && typeof question.allowOther !== "boolean" || !Array.isArray(question.options) || question.options.length < 2 || question.options.length > 4) return false;
2935
+ if (typeof question.question !== "string" || question.question.length === 0 || questions.has(question.question) || question.header !== void 0 && typeof question.header !== "string" || typeof question.multiSelect !== "boolean" || question.allowOther !== void 0 && typeof question.allowOther !== "boolean" || !Array.isArray(question.options) || !optionCountCanBeAnswered(question, question.options.length)) return false;
2931
2936
  const labels = /* @__PURE__ */ new Set();
2932
2937
  for (const option of question.options) {
2933
2938
  if (!option || typeof option !== "object" || Array.isArray(option)) return false;
@@ -2971,19 +2976,34 @@ var parseAgentQuestionAnswers = (questions, value) => {
2971
2976
  }
2972
2977
  return answers;
2973
2978
  };
2979
+ var noOptionsWhenAbsent = (options) => options ?? [];
2980
+ var optionsNamedByLabel = (options) => Array.isArray(options) ? options.map((label) => ({ label })) : options;
2981
+ var offersOnlyItsOptions = (raw, options) => raw.isOther === false && Array.isArray(options) && options.length > 0;
2974
2982
  var codexQuestionFields = (raw, toolName) => {
2975
2983
  if (!isRecord(raw) || raw.isSecret === true) return void 0;
2984
+ const options = noOptionsWhenAbsent(raw.options);
2976
2985
  if (toolName === CODEX_ASYNC_QUESTION_TOOL) {
2977
- const labels = Array.isArray(raw.options) ? raw.options : [];
2978
- return { question: raw.title, options: labels.map((label) => ({ label })), multiSelect: false };
2986
+ return { question: raw.title, options: optionsNamedByLabel(options), multiSelect: false };
2979
2987
  }
2980
- return { ...raw, multiSelect: raw.multiSelect ?? false, ...raw.isOther === false ? { allowOther: false } : {} };
2988
+ return { ...raw, options, multiSelect: raw.multiSelect ?? false, ...offersOnlyItsOptions(raw, options) ? { allowOther: false } : {} };
2981
2989
  };
2990
+ var agentQuestionsOf = (questions) => questions.flatMap((question) => agentQuestionFieldsIn(question) ?? []);
2982
2991
  var parseCodexQuestions = (toolName, toolInput) => {
2983
2992
  const raw = Array.isArray(toolInput.questions) ? toolInput.questions : [];
2984
2993
  const questions = raw.map((question) => codexQuestionFields(question, toolName));
2985
- return isAgentQuestionSet(questions) ? parseAgentQuestions({ questions }) : void 0;
2986
- };
2994
+ return isAgentQuestionSet(questions) ? agentQuestionsOf(questions) : void 0;
2995
+ };
2996
+ var typedTextAsAnswers = (questions, text2) => {
2997
+ const [only, ...others] = questions;
2998
+ if (!only || others.length > 0 || !isTypedAnswerQuestion(only)) return null;
2999
+ if (text2.trim().length === 0 || isHandBackAnswer(text2)) return null;
3000
+ return { [only.question]: text2 };
3001
+ };
3002
+ var plainAskOf = (question) => isTypedAnswerQuestion(question) ? { type: "input" } : { type: "select", options: question.options.map((option) => option.label) };
3003
+ var isLoneTypedAnswerQuestion = (questions) => questions.length === 1 && questions.every(isTypedAnswerQuestion);
3004
+ var questionsShownAsASet = (questions) => isLoneTypedAnswerQuestion(questions) ? void 0 : questions;
3005
+ var agentQuestionContext = (header, project) => header ? `${header}: your agent is asking in ${project}` : `Your agent is asking in ${project}`;
3006
+ var answersToQuestionsAsAsked = (questions, answer) => questionsShownAsASet(questions) ? parseAgentQuestionAnswers(questions, answer) : typedTextAsAnswers(questions, answer);
2987
3007
  var CODEX_QUESTION_ANSWERED_IN_PUSHARY = "The user already answered this question in Pushary, so it was not shown again";
2988
3008
  var CODEX_QUESTION_CONTINUE = "Continue with this answer and do not ask it again";
2989
3009
  var quotedAnswerPair = ([question, answer]) => `${JSON.stringify(question)}: ${JSON.stringify(answer)}`;
@@ -6138,6 +6158,7 @@ var elicitationContentFromAnswers = (ask, answers) => {
6138
6158
  }
6139
6159
  return content;
6140
6160
  };
6161
+ var isHandBackAnswer = (answer) => classifyConfirmResponse(answer) === "defer";
6141
6162
 
6142
6163
  // ../contracts/src/hook-activation.ts
6143
6164
  var hookWritePath = (toolName, input) => toolName === "Write" && typeof input.file_path === "string" && input.file_path.startsWith("/") && input.file_path.length <= 4096 ? input.file_path : void 0;
@@ -6237,8 +6258,13 @@ export {
6237
6258
  AGENT_QUESTION_OPTION_MAX,
6238
6259
  AGENT_QUESTION_DESCRIPTION_MAX,
6239
6260
  parseAgentQuestions,
6261
+ isTypedAnswerQuestion,
6240
6262
  parseAgentQuestionAnswers,
6241
6263
  parseCodexQuestions,
6264
+ plainAskOf,
6265
+ questionsShownAsASet,
6266
+ agentQuestionContext,
6267
+ answersToQuestionsAsAsked,
6242
6268
  codexQuestionAnswerReason,
6243
6269
  normalizeInstallSource,
6244
6270
  HOOK_BUDGETS,
@@ -1,18 +1,18 @@
1
1
  import {
2
2
  readExistingMachineId
3
- } from "./chunk-T6RIKJUO.js";
3
+ } from "./chunk-SQ5G6A6K.js";
4
4
  import {
5
5
  NetworkError
6
6
  } from "./chunk-7QLSKOSU.js";
7
7
  import {
8
8
  getBaseUrl
9
- } from "./chunk-CQ5JGRML.js";
9
+ } from "./chunk-LVDC3RUE.js";
10
10
  import {
11
11
  getPackageVersion
12
12
  } from "./chunk-QTOLNRET.js";
13
13
  import {
14
14
  clientContextHeaders
15
- } from "./chunk-LF3TLC7B.js";
15
+ } from "./chunk-GZL3KEPC.js";
16
16
 
17
17
  // src/cli/net.ts
18
18
  import { createRequire } from "module";
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  HOOK_HOLD_BUDGET_ENV,
3
3
  hookHoldBudgetProof
4
- } from "./chunk-LF3TLC7B.js";
4
+ } from "./chunk-GZL3KEPC.js";
5
5
 
6
6
  // src/hold-budget.ts
7
7
  var takeHookHoldBudget = (args = process.argv.slice(2), env = process.env) => {
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  ensureCodexTrustsPusharyHooks
3
- } from "./chunk-FCMWUYIE.js";
3
+ } from "./chunk-2NIRYGTK.js";
4
4
  import {
5
5
  CODEX_INSTRUCTIONS_LABEL,
6
6
  GEMINI_INSTRUCTIONS_LABEL,
@@ -11,7 +11,7 @@ import {
11
11
  macAppFxBridge,
12
12
  refreshInstructionBlock,
13
13
  renderAgentInstructions
14
- } from "./chunk-MTKV4RUQ.js";
14
+ } from "./chunk-NQDEMRAS.js";
15
15
  import {
16
16
  OPENCODE_HOOK_BINARY,
17
17
  agentHookOwner,
@@ -21,10 +21,10 @@ import {
21
21
  openCodeInstructionsFile,
22
22
  openCodePluginDir,
23
23
  openCodeWired
24
- } from "./chunk-K23WMLPY.js";
24
+ } from "./chunk-PZDMZ7LM.js";
25
25
  import {
26
26
  detectClaudeVersion
27
- } from "./chunk-RIVNNBEK.js";
27
+ } from "./chunk-LVWXRXT7.js";
28
28
  import {
29
29
  addClaudeMcpServer,
30
30
  addCompatibleHooks,
@@ -33,7 +33,7 @@ import {
33
33
  compatibleConfigFile,
34
34
  compatibleInstructionsFile,
35
35
  hasCompatibleHooks
36
- } from "./chunk-N77BH7H2.js";
36
+ } from "./chunk-UPFFO4F6.js";
37
37
  import {
38
38
  claudeUnprovenHolds,
39
39
  claudeWired,
@@ -41,7 +41,7 @@ import {
41
41
  codexWired,
42
42
  geminiWired,
43
43
  planHooks
44
- } from "./chunk-Q7OXI6VS.js";
44
+ } from "./chunk-CUEUANIU.js";
45
45
  import {
46
46
  CLAUDE_HOOK_BINARY,
47
47
  CLAUDE_HOOK_EVENTS,
@@ -52,7 +52,7 @@ import {
52
52
  needsReregistration,
53
53
  registrationSignatures,
54
54
  supportedClaudeEvents
55
- } from "./chunk-6C4S3QYD.js";
55
+ } from "./chunk-QQYUWTYS.js";
56
56
  import {
57
57
  formatVersion
58
58
  } from "./chunk-6ICPEJY5.js";
@@ -80,21 +80,21 @@ import {
80
80
  registeredCommands,
81
81
  registrationHolderOf,
82
82
  vscodePluginMcp
83
- } from "./chunk-OML4YFBN.js";
83
+ } from "./chunk-TWLWDIFB.js";
84
84
  import {
85
85
  resolveGlobalBinDir,
86
86
  resolveGlobalBinary
87
- } from "./chunk-XUW2DRAQ.js";
87
+ } from "./chunk-AEXACKDR.js";
88
88
  import {
89
89
  readJsonSafe,
90
90
  writeFileAtomic,
91
91
  writeJsonAtomic
92
- } from "./chunk-AQFEP65J.js";
92
+ } from "./chunk-QENTGE75.js";
93
93
  import {
94
94
  HOOK_COMPATIBLE_PROFILES,
95
95
  isCompatibleAgentType,
96
96
  isRecord
97
- } from "./chunk-LF3TLC7B.js";
97
+ } from "./chunk-GZL3KEPC.js";
98
98
 
99
99
  // src/reapply.ts
100
100
  import { dirname, join } from "path";
@@ -1,19 +1,19 @@
1
1
  import {
2
2
  resolveInstallSourceFor
3
- } from "./chunk-4QQEUJL4.js";
3
+ } from "./chunk-7RZO6VWD.js";
4
4
  import {
5
5
  backupFile,
6
6
  readJsonSafe,
7
7
  writeFileAtomic,
8
8
  writeJsonAtomic
9
- } from "./chunk-AQFEP65J.js";
9
+ } from "./chunk-QENTGE75.js";
10
10
  import {
11
11
  configFilePath
12
- } from "./chunk-CQ5JGRML.js";
12
+ } from "./chunk-LVDC3RUE.js";
13
13
  import {
14
14
  API_KEY_PREFIX_PATTERN,
15
15
  isRecord
16
- } from "./chunk-LF3TLC7B.js";
16
+ } from "./chunk-GZL3KEPC.js";
17
17
 
18
18
  // src/shell-alias.ts
19
19
  import { homedir } from "os";
@@ -3,11 +3,11 @@ import {
3
3
  decodePublicKey,
4
4
  generateSessionKey,
5
5
  wrapSessionKey
6
- } from "./chunk-5463UUO2.js";
6
+ } from "./chunk-JSQOHMNJ.js";
7
7
  import {
8
8
  fetchTranscriptRecipients,
9
9
  uploadTranscriptRecords
10
- } from "./chunk-GCN73COS.js";
10
+ } from "./chunk-N3NSWWNU.js";
11
11
 
12
12
  // src/live-session.ts
13
13
  var MAX_TRANSCRIPT_QUEUE = 100;
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  parseSseMessages
3
- } from "./chunk-P2546BBI.js";
3
+ } from "./chunk-A54W5A74.js";
4
4
  import {
5
5
  NPX_LATEST_COMMAND
6
- } from "./chunk-MC4VY5LK.js";
6
+ } from "./chunk-5SFM6XB4.js";
7
7
 
8
8
  // src/mcp-stdio-bridge.ts
9
9
  var MCP_BRIDGE_BINARY = "pushary-mcp";
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  redactSecretsFromContent
3
- } from "./chunk-LF3TLC7B.js";
3
+ } from "./chunk-GZL3KEPC.js";
4
4
 
5
5
  // src/crypto.ts
6
6
  import nacl from "tweetnacl";
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  isSafeReadOnlyCommand
3
- } from "./chunk-LF3TLC7B.js";
3
+ } from "./chunk-GZL3KEPC.js";
4
4
 
5
5
  // src/ledger.ts
6
6
  import { appendFileSync, existsSync, mkdirSync, readFileSync, renameSync, rmSync, statSync } from "fs";
@@ -2,25 +2,25 @@ import {
2
2
  SIGNED_OUT_ON_MAC_MESSAGE,
3
3
  describeSignedOutKey,
4
4
  readSignedOutDiagnosis
5
- } from "./chunk-6SWMKF5E.js";
5
+ } from "./chunk-4YNNAF53.js";
6
6
  import {
7
7
  createIo
8
8
  } from "./chunk-FO3MDD26.js";
9
9
  import {
10
10
  readKeySource
11
- } from "./chunk-VYBH6D4X.js";
11
+ } from "./chunk-IRZ5FVWG.js";
12
12
  import {
13
13
  absoluteUrl,
14
14
  checkApiKey,
15
15
  describeKeyCheck,
16
16
  keyCheckFromResponse
17
- } from "./chunk-L5YTS2BP.js";
17
+ } from "./chunk-FBKVCODG.js";
18
18
  import {
19
19
  EXIT
20
20
  } from "./chunk-KZERVKTD.js";
21
21
  import {
22
22
  getBaseUrl
23
- } from "./chunk-CQ5JGRML.js";
23
+ } from "./chunk-LVDC3RUE.js";
24
24
 
25
25
  // src/cli/report-key.ts
26
26
  var { dim, yellow } = createIo();
@@ -4,19 +4,19 @@ import {
4
4
  outcomeOfFailedAsk,
5
5
  reportMachineDenial,
6
6
  storedWaitDeadline
7
- } from "./chunk-JPABKXK6.js";
7
+ } from "./chunk-QLDTBZBP.js";
8
8
  import {
9
9
  isGatingMoment,
10
10
  recordKeylessMoment
11
- } from "./chunk-7CLLWDCP.js";
11
+ } from "./chunk-JYXIARGW.js";
12
12
  import {
13
13
  isDeferAnswer,
14
14
  oncePerSession
15
- } from "./chunk-DHJSBK63.js";
15
+ } from "./chunk-LVZYIUSR.js";
16
16
  import {
17
17
  activeHookSource,
18
18
  activeIdentity
19
- } from "./chunk-N77BH7H2.js";
19
+ } from "./chunk-UPFFO4F6.js";
20
20
  import {
21
21
  DEFAULT_SESSION,
22
22
  UNNAMED_ACTION,
@@ -40,10 +40,10 @@ import {
40
40
  reportEvent,
41
41
  scopePathFor,
42
42
  settleQuestionsForToolUse
43
- } from "./chunk-U2L42GVI.js";
43
+ } from "./chunk-4YTFYILS.js";
44
44
  import {
45
45
  repoKeyFor
46
- } from "./chunk-JBT3ZSJS.js";
46
+ } from "./chunk-XXNT4FGA.js";
47
47
  import {
48
48
  askUser,
49
49
  cancelQuestion,
@@ -56,17 +56,17 @@ import {
56
56
  sendNotification,
57
57
  waitForQuestion,
58
58
  waitsForThePhone
59
- } from "./chunk-ZMPR436Z.js";
59
+ } from "./chunk-6QM54CSJ.js";
60
60
  import {
61
61
  getMachineId
62
- } from "./chunk-T6RIKJUO.js";
62
+ } from "./chunk-SQ5G6A6K.js";
63
63
  import {
64
64
  getApiKey,
65
65
  getBaseUrl
66
- } from "./chunk-CQ5JGRML.js";
66
+ } from "./chunk-LVDC3RUE.js";
67
67
  import {
68
68
  NPX_LATEST_COMMAND
69
- } from "./chunk-MC4VY5LK.js";
69
+ } from "./chunk-5SFM6XB4.js";
70
70
  import {
71
71
  AGENT_QUESTION_STRATEGY,
72
72
  AGENT_QUESTION_TOOL,
@@ -111,7 +111,7 @@ import {
111
111
  resolveGate,
112
112
  timeoutActionWithoutLocalPrompt,
113
113
  unansweredRefusalReason
114
- } from "./chunk-LF3TLC7B.js";
114
+ } from "./chunk-GZL3KEPC.js";
115
115
 
116
116
  // src/claude-permission-rules.ts
117
117
  import { readFileSync, statSync } from "fs";
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  NPX_LATEST_COMMAND
3
- } from "./chunk-MC4VY5LK.js";
3
+ } from "./chunk-5SFM6XB4.js";
4
4
 
5
5
  // src/config.ts
6
6
  import { readFileSync } from "fs";
@@ -1,6 +1,12 @@
1
+ import {
2
+ findNativeClaudeInstall
3
+ } from "./chunk-VUFHYMSP.js";
1
4
  import {
2
5
  parseVersion
3
6
  } from "./chunk-6ICPEJY5.js";
7
+ import {
8
+ isRecord
9
+ } from "./chunk-GZL3KEPC.js";
4
10
 
5
11
  // src/setup/agent-probe.ts
6
12
  import { execSync } from "child_process";
@@ -12,20 +18,28 @@ var versionFromInstallPath = (path) => {
12
18
  const name = basename(path);
13
19
  return /^\d+\.\d+\.\d+$/.test(name) ? parseVersion(name) : null;
14
20
  };
21
+ var CLAUDE_CODE_PACKAGE = "@anthropic-ai/claude-code";
22
+ var CLAUDE_CODE_PLATFORM_PACKAGE_PREFIX = `${CLAUDE_CODE_PACKAGE}-`;
23
+ var MANIFEST_FOLDERS_SEARCHED = 4;
24
+ var isClaudeCodePackage = (name) => typeof name === "string" && (name === CLAUDE_CODE_PACKAGE || name.startsWith(CLAUDE_CODE_PLATFORM_PACKAGE_PREFIX));
25
+ var parsedManifest = (raw) => {
26
+ try {
27
+ return JSON.parse(raw);
28
+ } catch {
29
+ return null;
30
+ }
31
+ };
32
+ var claudeCodeManifestVersion = (raw) => {
33
+ const manifest = parsedManifest(raw);
34
+ if (!isRecord(manifest) || !isClaudeCodePackage(manifest.name)) return null;
35
+ return typeof manifest.version === "string" ? parseVersion(manifest.version) : null;
36
+ };
15
37
  var versionFromManifest = (probe, binPath) => {
16
38
  let dir = dirname(binPath);
17
- for (let depth = 0; depth < 4; depth++) {
39
+ for (let depth = 0; depth < MANIFEST_FOLDERS_SEARCHED; depth++) {
18
40
  const raw = probe.readFile(join(dir, "package.json"));
19
- if (raw) {
20
- try {
21
- const { version } = JSON.parse(raw);
22
- if (typeof version === "string") {
23
- const parsed = parseVersion(version);
24
- if (parsed) return parsed;
25
- }
26
- } catch {
27
- }
28
- }
41
+ const version = raw ? claudeCodeManifestVersion(raw) : null;
42
+ if (version) return version;
29
43
  const parent = dirname(dir);
30
44
  if (parent === dir) break;
31
45
  dir = parent;
@@ -63,7 +77,8 @@ var readFile = (path) => {
63
77
  return null;
64
78
  }
65
79
  };
66
- var detectClaudeVersion = () => readClaudeVersion({ resolveOnPath: () => onPath("claude"), realpath, readFile });
80
+ var claudeOnPathElseInItsOwnInstallFolder = () => onPath("claude") ?? findNativeClaudeInstall() ?? null;
81
+ var detectClaudeVersion = () => readClaudeVersion({ resolveOnPath: claudeOnPathElseInItsOwnInstallFolder, realpath, readFile });
67
82
 
68
83
  export {
69
84
  realpath,
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  DEFAULT_SESSION
3
- } from "./chunk-U2L42GVI.js";
3
+ } from "./chunk-4YTFYILS.js";
4
4
 
5
5
  // src/answer.ts
6
6
  var isDeferAnswer = (value) => value === "defer";
@@ -1,18 +1,21 @@
1
1
  import {
2
2
  openCodeConfigDirFrom
3
- } from "./chunk-K23WMLPY.js";
3
+ } from "./chunk-PZDMZ7LM.js";
4
+ import {
5
+ nativeClaudeInstallPath
6
+ } from "./chunk-VUFHYMSP.js";
4
7
  import {
5
8
  grokHome
6
- } from "./chunk-N77BH7H2.js";
9
+ } from "./chunk-UPFFO4F6.js";
7
10
  import {
8
11
  codexHomeFrom
9
- } from "./chunk-OML4YFBN.js";
12
+ } from "./chunk-TWLWDIFB.js";
10
13
  import {
11
14
  resolvePathBinary
12
- } from "./chunk-XUW2DRAQ.js";
15
+ } from "./chunk-AEXACKDR.js";
13
16
  import {
14
17
  HOOK_COMPATIBLE_PROFILES
15
- } from "./chunk-LF3TLC7B.js";
18
+ } from "./chunk-GZL3KEPC.js";
16
19
 
17
20
  // src/hermes-config.ts
18
21
  import { execFileSync } from "child_process";
@@ -502,11 +505,11 @@ var detectAgent = (probe, deps = defaultDeps) => {
502
505
  }
503
506
  return { kind: "not-found", checked };
504
507
  };
505
- var agentProbes = (home = homedir3()) => ({
508
+ var agentProbes = (home = homedir3(), platform = process.platform) => ({
506
509
  claude_code: {
507
510
  binary: "claude",
508
511
  // The native installer puts it here, outside a default non-login PATH.
509
- paths: [join3(home, ".local", "bin", "claude")],
512
+ paths: [nativeClaudeInstallPath(home, platform)],
510
513
  configMarkers: [join3(home, ".claude")]
511
514
  },
512
515
  codex: {
@@ -528,14 +531,14 @@ var agentProbes = (home = homedir3()) => ({
528
531
  // GUI editor. `cursor` on PATH only exists if the user ran "Install 'cursor'
529
532
  // command in PATH" from the command palette, which most never do.
530
533
  binary: "cursor",
531
- paths: process.platform === "darwin" ? ["/Applications/Cursor.app"] : process.platform === "win32" ? [join3(process.env.LOCALAPPDATA ?? join3(home, "AppData", "Local"), "Programs", "cursor")] : ["/usr/share/cursor", join3(home, ".local", "share", "cursor")],
534
+ paths: platform === "darwin" ? ["/Applications/Cursor.app"] : platform === "win32" ? [join3(process.env.LOCALAPPDATA ?? join3(home, "AppData", "Local"), "Programs", "cursor")] : ["/usr/share/cursor", join3(home, ".local", "share", "cursor")],
532
535
  configMarkers: [join3(home, ".cursor")]
533
536
  },
534
537
  vscode: {
535
538
  // Like Cursor, a GUI editor: `code` on PATH only exists if the user ran
536
539
  // "Shell Command: Install 'code' command in PATH", which on macOS is opt-in.
537
540
  binary: "code",
538
- paths: process.platform === "darwin" ? ["/Applications/Visual Studio Code.app"] : process.platform === "win32" ? [join3(process.env.LOCALAPPDATA ?? join3(home, "AppData", "Local"), "Programs", "Microsoft VS Code")] : ["/usr/share/code", join3(home, ".local", "share", "code")],
541
+ paths: platform === "darwin" ? ["/Applications/Visual Studio Code.app"] : platform === "win32" ? [join3(process.env.LOCALAPPDATA ?? join3(home, "AppData", "Local"), "Programs", "Microsoft VS Code")] : ["/usr/share/code", join3(home, ".local", "share", "code")],
539
542
  // The settings directory rather than ~/.vscode, because the settings
540
543
  // directory is what this installer actually writes to. Insiders counts:
541
544
  // someone running only Insiders still has VS Code.
@@ -3,7 +3,7 @@ import {
3
3
  } from "./chunk-KZERVKTD.js";
4
4
  import {
5
5
  renderCommandHelp
6
- } from "./chunk-MC4VY5LK.js";
6
+ } from "./chunk-5SFM6XB4.js";
7
7
  import {
8
8
  getPackageVersion
9
9
  } from "./chunk-QTOLNRET.js";
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  getBaseUrl
3
- } from "./chunk-CQ5JGRML.js";
3
+ } from "./chunk-LVDC3RUE.js";
4
4
 
5
5
  // src/transcript-api.ts
6
6
  var fetchTranscriptRecipients = async (apiKey, baseUrl = getBaseUrl()) => {
@@ -1,25 +1,25 @@
1
1
  import {
2
2
  MCP_BRIDGE_BINARY
3
- } from "./chunk-46TC24ET.js";
3
+ } from "./chunk-JCMSISCC.js";
4
4
  import {
5
5
  KEY_FILE_MODE
6
- } from "./chunk-VYBH6D4X.js";
6
+ } from "./chunk-IRZ5FVWG.js";
7
7
  import {
8
8
  NpmInstallError,
9
9
  NpmMissingError,
10
10
  NpmPermissionError
11
- } from "./chunk-XUW2DRAQ.js";
11
+ } from "./chunk-AEXACKDR.js";
12
12
  import {
13
13
  readJsonSafe,
14
14
  writeFileAtomic,
15
15
  writeJsonAtomic
16
- } from "./chunk-AQFEP65J.js";
16
+ } from "./chunk-QENTGE75.js";
17
17
  import {
18
18
  NPX_LATEST_COMMAND
19
- } from "./chunk-MC4VY5LK.js";
19
+ } from "./chunk-5SFM6XB4.js";
20
20
  import {
21
21
  readSetupAgentFailures
22
- } from "./chunk-LF3TLC7B.js";
22
+ } from "./chunk-GZL3KEPC.js";
23
23
 
24
24
  // src/instruction-file.ts
25
25
  import { accessSync, constants, existsSync, readFileSync, statSync, writeFileSync, mkdirSync, rmSync } from "fs";
@@ -1,18 +1,18 @@
1
1
  import {
2
2
  macAppBridgeAvailable
3
- } from "./chunk-K23WMLPY.js";
3
+ } from "./chunk-PZDMZ7LM.js";
4
4
  import {
5
5
  keyPrefix
6
- } from "./chunk-VYBH6D4X.js";
6
+ } from "./chunk-IRZ5FVWG.js";
7
7
  import {
8
8
  bridgeAgentKey
9
- } from "./chunk-OML4YFBN.js";
9
+ } from "./chunk-TWLWDIFB.js";
10
10
  import {
11
11
  readJsonSafe
12
- } from "./chunk-AQFEP65J.js";
12
+ } from "./chunk-QENTGE75.js";
13
13
  import {
14
14
  isValidApiKey
15
- } from "./chunk-LF3TLC7B.js";
15
+ } from "./chunk-GZL3KEPC.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;
@@ -377,7 +377,7 @@ var CodexAppCards = class {
377
377
  await Promise.allSettled(outstanding.map((question) => this.cancel(question)));
378
378
  }
379
379
  thePhone() {
380
- this.phone ??= import("./api-K6ZROHYB.js");
380
+ this.phone ??= import("./api-RQAY3A5V.js");
381
381
  return this.phone;
382
382
  }
383
383
  questionShown(message) {
@@ -695,7 +695,7 @@ var codexDesktopCommand = async (args, entry, readAccount) => {
695
695
  return runCodexDesktopProxy(engine2, args.slice(3), readAccount, { watchesForCards: layoutIsKnown });
696
696
  }
697
697
  if (args[0] === APP_CARDS_FLAG) {
698
- const { codexAppCardsCommandOnThisMac } = await import("./codex-app-cards-switch-P4RVJNRV.js");
698
+ const { codexAppCardsCommandOnThisMac } = await import("./codex-app-cards-switch-SVGTZ2UN.js");
699
699
  return codexAppCardsCommandOnThisMac(args.slice(1), entry, readAccount);
700
700
  }
701
701
  if (args.length > 2) throw new Error("Usage: pushary codex --desktop [path/to/Codex.app]");