pushary 1.9.268 → 1.9.270

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 (143) hide show
  1. package/CHANGELOG.md +9 -0
  2. package/dist/{api-2PD4GLZO.js → api-QRQC65E7.js} +12 -12
  3. package/dist/bin/pushary-audit.js +3 -3
  4. package/dist/bin/pushary-bell-hook.js +28 -28
  5. package/dist/bin/pushary-bell.js +11 -11
  6. package/dist/bin/pushary-calls.js +14 -14
  7. package/dist/bin/pushary-claude.js +25 -25
  8. package/dist/bin/pushary-clean.js +39 -39
  9. package/dist/bin/pushary-codex-bridge.js +22 -22
  10. package/dist/bin/pushary-codex-hook.js +34 -34
  11. package/dist/bin/pushary-codex-session.js +8 -8
  12. package/dist/bin/pushary-codex.js +16 -16
  13. package/dist/bin/pushary-connect.js +35 -35
  14. package/dist/bin/pushary-cowork.js +5 -5
  15. package/dist/bin/pushary-daemon.js +46 -46
  16. package/dist/bin/pushary-disconnect.js +30 -30
  17. package/dist/bin/pushary-display-hook.js +16 -0
  18. package/dist/bin/pushary-doctor.js +48 -48
  19. package/dist/bin/pushary-elicitation-hook.js +27 -27
  20. package/dist/bin/pushary-gemini-bridge.js +17 -17
  21. package/dist/bin/pushary-gemini-hook.js +31 -31
  22. package/dist/bin/pushary-hook.js +35 -35
  23. package/dist/bin/pushary-login.js +42 -42
  24. package/dist/bin/pushary-logout.js +31 -31
  25. package/dist/bin/pushary-mcp.js +12 -12
  26. package/dist/bin/pushary-mode.js +15 -15
  27. package/dist/bin/pushary-notification-hook.js +27 -27
  28. package/dist/bin/pushary-opencode-bridge.js +21 -21
  29. package/dist/bin/pushary-opencode-hook.js +32 -32
  30. package/dist/bin/pushary-permission-denied-hook.js +34 -34
  31. package/dist/bin/pushary-permission-hook.js +35 -35
  32. package/dist/bin/pushary-post-hook.js +28 -28
  33. package/dist/bin/pushary-prompt-hook.js +27 -27
  34. package/dist/bin/pushary-session-end-hook.js +27 -27
  35. package/dist/bin/pushary-session-start-hook.js +39 -39
  36. package/dist/bin/pushary-sessions.js +12 -12
  37. package/dist/bin/pushary-setup.js +95 -63
  38. package/dist/bin/pushary-stats.js +5 -5
  39. package/dist/bin/pushary-status.js +36 -36
  40. package/dist/bin/pushary-stop-hook.js +27 -27
  41. package/dist/bin/pushary-stopfailure-hook.js +27 -27
  42. package/dist/bin/pushary-suggestions.js +15 -15
  43. package/dist/bin/pushary-transcript-register.js +16 -16
  44. package/dist/bin/pushary-transcripts.js +25 -25
  45. package/dist/bin/pushary-upgrade.js +47 -47
  46. package/dist/bin/pushary-wait.js +16 -16
  47. package/dist/bin/pushary.js +7 -7
  48. package/dist/{chunk-CIO6FAIU.js → chunk-2ABJ4VCG.js} +1 -1
  49. package/dist/{chunk-M2ETE6JQ.js → chunk-2C2XPI5Y.js} +1 -1
  50. package/dist/{chunk-S2DKGGEL.js → chunk-2GKTNETX.js} +5 -5
  51. package/dist/{chunk-X5R55HMM.js → chunk-3IHL4N2G.js} +6 -6
  52. package/dist/{chunk-N6ARPVSQ.js → chunk-3P3GPF6O.js} +11 -11
  53. package/dist/{chunk-ZYQHIMZU.js → chunk-3TN6OKJ2.js} +5 -5
  54. package/dist/{chunk-FF2LDPB2.js → chunk-3ZEKDHAX.js} +4 -4
  55. package/dist/{chunk-SYEUQH6Z.js → chunk-4JXYINSC.js} +3 -3
  56. package/dist/{chunk-NAVHNIM4.js → chunk-4O2FHBHY.js} +1 -1
  57. package/dist/{chunk-GCDVD242.js → chunk-4ZISYOJF.js} +6 -6
  58. package/dist/{chunk-XPS36L6H.js → chunk-5G6VZEDJ.js} +3 -3
  59. package/dist/{chunk-IR342JX3.js → chunk-65AS4TO4.js} +6 -6
  60. package/dist/{chunk-UVO56TVL.js → chunk-67FOJA34.js} +7 -7
  61. package/dist/{chunk-WYYZ2UFX.js → chunk-6Q2D4OON.js} +2 -2
  62. package/dist/{chunk-47NWTV5K.js → chunk-7JVJ4ZKU.js} +2 -2
  63. package/dist/{chunk-EKU4KLON.js → chunk-7TVCL4PI.js} +1 -1
  64. package/dist/{chunk-U2OB44U5.js → chunk-A2AN2T5O.js} +5 -5
  65. package/dist/{chunk-HSX5EVPH.js → chunk-AGK5KU7B.js} +2 -2
  66. package/dist/{chunk-DC35GPRY.js → chunk-ARDNSSLS.js} +8 -8
  67. package/dist/{chunk-NRTSHLZQ.js → chunk-B25EAOUY.js} +6 -6
  68. package/dist/{chunk-JQCF2IYA.js → chunk-BIJU6CPZ.js} +1 -1
  69. package/dist/{chunk-HPLG5D6Y.js → chunk-BIY5PLF6.js} +5 -5
  70. package/dist/{chunk-XIEYX4TJ.js → chunk-BY4SOA5N.js} +1 -1
  71. package/dist/{chunk-TEFLCQO4.js → chunk-CDGZIVNU.js} +1 -1
  72. package/dist/{chunk-O2X6KT7P.js → chunk-CGTPKZWB.js} +4 -4
  73. package/dist/{chunk-TKMOPFZS.js → chunk-COHRE67K.js} +3 -3
  74. package/dist/{chunk-5LE7C6Q2.js → chunk-DEMI4ZEH.js} +2 -2
  75. package/dist/{chunk-ERE3R6SS.js → chunk-DFN4FVB6.js} +4 -4
  76. package/dist/{chunk-FFWESSEY.js → chunk-DMAN3ZCW.js} +4 -4
  77. package/dist/{chunk-KVCWPOF6.js → chunk-DQA3PMYT.js} +10 -5
  78. package/dist/{chunk-BQ23UZJY.js → chunk-DTGU4J77.js} +5 -5
  79. package/dist/{chunk-P6AKOYLZ.js → chunk-DXPE4F2K.js} +4 -4
  80. package/dist/{chunk-AXVLRYIK.js → chunk-EZ5HNO4L.js} +1 -1
  81. package/dist/{chunk-LF5OEQNP.js → chunk-FB25FA3O.js} +2 -2
  82. package/dist/{chunk-QJHOS33W.js → chunk-GA7L6ZHW.js} +5 -5
  83. package/dist/{chunk-GYLIVREZ.js → chunk-GOSMCOHB.js} +14 -0
  84. package/dist/{chunk-AQPA4YIB.js → chunk-HBU5P5EC.js} +1 -1
  85. package/dist/{chunk-AT3C3Z3M.js → chunk-HEBBPZDN.js} +7 -7
  86. package/dist/{chunk-L6CWEU5C.js → chunk-HHOTW23E.js} +2 -2
  87. package/dist/{chunk-JSE7T4JL.js → chunk-HLJDCM3Z.js} +1 -1
  88. package/dist/{chunk-5WSFZXR6.js → chunk-IJCWAVT7.js} +2 -2
  89. package/dist/{chunk-UQB4MAA6.js → chunk-IU4M7QPA.js} +3 -3
  90. package/dist/{chunk-IQBJD5ZB.js → chunk-J35H5XWH.js} +4 -4
  91. package/dist/{chunk-GPEGT2EP.js → chunk-JF6IHH5E.js} +1 -1
  92. package/dist/{chunk-FK4BFIFR.js → chunk-JL4REHDW.js} +5 -5
  93. package/dist/{chunk-DJYBACUW.js → chunk-JRPOC47L.js} +1 -1
  94. package/dist/{chunk-TZO67S4V.js → chunk-JTLHPORS.js} +10 -10
  95. package/dist/{chunk-NOWWUX5V.js → chunk-KBT4OBJM.js} +3 -3
  96. package/dist/{chunk-SYCNMJ3Z.js → chunk-LATT2QB4.js} +1 -1
  97. package/dist/{chunk-HEAJBTIG.js → chunk-MDD4MCQY.js} +1 -1
  98. package/dist/{chunk-GMQ73QWC.js → chunk-NJB2WPGE.js} +16 -16
  99. package/dist/{chunk-AOCTHK4E.js → chunk-O4ZFUVDI.js} +3 -3
  100. package/dist/{chunk-NYP2NRV3.js → chunk-O63L6PLB.js} +1 -1
  101. package/dist/{chunk-WZM7Y5HM.js → chunk-O753NJME.js} +2 -1
  102. package/dist/{chunk-WCEP3U7C.js → chunk-OW4AMHJV.js} +1 -1
  103. package/dist/{chunk-Z5KP6GBC.js → chunk-PFNWKGAN.js} +4 -4
  104. package/dist/{chunk-FHCXJ2HZ.js → chunk-PGXWER6L.js} +5 -5
  105. package/dist/{chunk-2FI62SKT.js → chunk-PJDMIJG7.js} +1 -1
  106. package/dist/{chunk-NA5EQTCV.js → chunk-PK5JMVGN.js} +23 -3
  107. package/dist/{chunk-GP5UGODT.js → chunk-PWDSHCY4.js} +5 -5
  108. package/dist/{chunk-4ZSC56SL.js → chunk-R6JRCEIX.js} +1 -1
  109. package/dist/{chunk-S55XHTYZ.js → chunk-RFCTFMJS.js} +1 -1
  110. package/dist/{chunk-AQP5SMAF.js → chunk-RII5XZLB.js} +79 -18
  111. package/dist/{chunk-JXWWWVGR.js → chunk-RUWD6OFZ.js} +10 -10
  112. package/dist/{chunk-S4AQUVX3.js → chunk-TR5A6H2P.js} +3 -3
  113. package/dist/{chunk-YZRUE46K.js → chunk-TTU65I6T.js} +1 -1
  114. package/dist/{chunk-XUJBTEUC.js → chunk-TVNUXX5O.js} +4 -4
  115. package/dist/{chunk-YGCU6KMO.js → chunk-TZYJNKFN.js} +3 -3
  116. package/dist/{chunk-KQZQ55CO.js → chunk-UCK4UKBV.js} +4 -4
  117. package/dist/{chunk-V2UGSM45.js → chunk-UMZ2VLLR.js} +6 -6
  118. package/dist/{chunk-TOELRIWR.js → chunk-V4PD2R6X.js} +12 -12
  119. package/dist/{chunk-DPOLLK6I.js → chunk-VMIUZMAD.js} +3 -3
  120. package/dist/{chunk-26K5VC53.js → chunk-VSKX62AG.js} +1 -1
  121. package/dist/{chunk-GEBRKBLB.js → chunk-VWXR34GR.js} +5 -5
  122. package/dist/{chunk-2EHLFIVK.js → chunk-W2SZOATE.js} +4 -4
  123. package/dist/{chunk-DVAXZOTR.js → chunk-WS7Z6IJV.js} +1 -1
  124. package/dist/{chunk-YBAU5TAV.js → chunk-WXQA6JZO.js} +2 -2
  125. package/dist/{chunk-IEQDAZDB.js → chunk-X3DYMWPL.js} +2 -2
  126. package/dist/{chunk-LYBX463S.js → chunk-Y4DC5KRB.js} +2 -2
  127. package/dist/{chunk-WHFXXV2A.js → chunk-ZGVMX36I.js} +2 -2
  128. package/dist/{chunk-UNF23P35.js → chunk-ZX2HQ25K.js} +1 -1
  129. package/dist/{chunk-4LRWEHQT.js → chunk-ZXPNAYQC.js} +7 -7
  130. package/dist/{codex-app-cards-switch-TSHQTVOY.js → codex-app-cards-switch-EULJQSJY.js} +11 -11
  131. package/dist/{codex-card-routing-EZFQRLL5.js → codex-card-routing-RWF7Q5NP.js} +2 -2
  132. package/dist/{codex-desktop-launch-RBW6N6HI.js → codex-desktop-launch-6FTCM3KC.js} +3 -3
  133. package/dist/{codex-session-launch-TERIKZPR.js → codex-session-launch-7L5PTJTO.js} +21 -21
  134. package/dist/{config-2AGEPXWU.js → config-RUJK4OSC.js} +3 -3
  135. package/dist/{global-upgrade-67DCWAOQ.js → global-upgrade-JASHEAL5.js} +9 -9
  136. package/dist/{identity-QETOMF2L.js → identity-FKXV4DDS.js} +4 -4
  137. package/dist/{live-capabilities-5UIO6P52.js → live-capabilities-M5ZFRYQR.js} +4 -4
  138. package/dist/{paths-IRWDFERG.js → paths-OWVAAP4Y.js} +3 -3
  139. package/dist/{reapply-BBNONPII.js → reapply-P7KARKEQ.js} +34 -34
  140. package/dist/src/index.js +33 -33
  141. package/dist/{upgrade-lock-LICESK4W.js → upgrade-lock-6H24K6S3.js} +10 -6
  142. package/dist/{usage-CNCT5BGJ.js → usage-PENWECBI.js} +3 -3
  143. package/package.json +1 -1
@@ -7,30 +7,30 @@ import {
7
7
  restorePhoneApprovals,
8
8
  setAsidePhoneApprovalsOfOtherCalls,
9
9
  takePhoneApproval
10
- } from "./chunk-L6CWEU5C.js";
10
+ } from "./chunk-HHOTW23E.js";
11
11
  import {
12
12
  claudeSettingsLocationFor,
13
13
  readClaudePermissionRules
14
- } from "./chunk-LYBX463S.js";
14
+ } from "./chunk-Y4DC5KRB.js";
15
15
  import {
16
16
  defersToNativeMode
17
- } from "./chunk-JSE7T4JL.js";
17
+ } from "./chunk-HLJDCM3Z.js";
18
18
  import {
19
19
  reportMachineDenial
20
- } from "./chunk-Z5KP6GBC.js";
20
+ } from "./chunk-PFNWKGAN.js";
21
21
  import {
22
22
  isGatingMoment,
23
23
  recordKeylessMoment
24
- } from "./chunk-M2ETE6JQ.js";
24
+ } from "./chunk-2C2XPI5Y.js";
25
25
  import {
26
26
  isAdmitted,
27
27
  readAdmissionRules
28
- } from "./chunk-U2OB44U5.js";
28
+ } from "./chunk-A2AN2T5O.js";
29
29
  import {
30
30
  activeHookSource,
31
31
  activeIdentity,
32
32
  namedSource
33
- } from "./chunk-X5R55HMM.js";
33
+ } from "./chunk-3IHL4N2G.js";
34
34
  import {
35
35
  DEFAULT_SESSION,
36
36
  allow,
@@ -72,7 +72,7 @@ import {
72
72
  storedWaitDeadline,
73
73
  sweepFilesOlderThan,
74
74
  userScope
75
- } from "./chunk-N6ARPVSQ.js";
75
+ } from "./chunk-3P3GPF6O.js";
76
76
  import {
77
77
  UNNAMED_ACTION,
78
78
  deriveAction,
@@ -83,7 +83,7 @@ import {
83
83
  patchDeletesFiles,
84
84
  permissionDeniedAction,
85
85
  scopePathFor
86
- } from "./chunk-YZRUE46K.js";
86
+ } from "./chunk-TTU65I6T.js";
87
87
  import {
88
88
  askUser,
89
89
  cancelQuestion,
@@ -97,30 +97,30 @@ import {
97
97
  sendNotification,
98
98
  waitForQuestion,
99
99
  withdrawQuestion
100
- } from "./chunk-4LRWEHQT.js";
100
+ } from "./chunk-ZXPNAYQC.js";
101
101
  import {
102
102
  branchFor,
103
103
  projectNameFor,
104
104
  repoKeyFor,
105
105
  repositoryScopeFor
106
- } from "./chunk-S55XHTYZ.js";
106
+ } from "./chunk-RFCTFMJS.js";
107
107
  import {
108
108
  getMachineId
109
- } from "./chunk-4ZSC56SL.js";
109
+ } from "./chunk-R6JRCEIX.js";
110
110
  import {
111
111
  POSTTOOLUSE_MIRRORED_TOOLS
112
- } from "./chunk-WHFXXV2A.js";
112
+ } from "./chunk-ZGVMX36I.js";
113
113
  import {
114
114
  getApiKey,
115
115
  getBaseUrl,
116
116
  isMalformedApiKeyError
117
- } from "./chunk-5LE7C6Q2.js";
117
+ } from "./chunk-DEMI4ZEH.js";
118
118
  import {
119
119
  writeFileAtomic
120
120
  } from "./chunk-PM2NRK6Y.js";
121
121
  import {
122
122
  NPX_LATEST_COMMAND
123
- } from "./chunk-WZM7Y5HM.js";
123
+ } from "./chunk-O753NJME.js";
124
124
  import {
125
125
  AGENT_QUESTION_STRATEGY,
126
126
  AGENT_QUESTION_TOOL,
@@ -192,7 +192,7 @@ import {
192
192
  terminalStaysLiveForTheCall,
193
193
  timeoutActionWithoutLocalPrompt,
194
194
  unapprovedScopeReason
195
- } from "./chunk-GYLIVREZ.js";
195
+ } from "./chunk-GOSMCOHB.js";
196
196
 
197
197
  // src/terminal-answer-watch.ts
198
198
  import { closeSync, openSync, readSync, statSync } from "fs";
@@ -1,13 +1,13 @@
1
1
  import {
2
2
  pusharyHookExecutable
3
- } from "./chunk-2EHLFIVK.js";
3
+ } from "./chunk-W2SZOATE.js";
4
4
  import {
5
5
  bridgeResolvesToApp,
6
6
  cursorUserHooks,
7
7
  executableFileName,
8
8
  isBridgeLocator,
9
9
  liveBridgeProbe
10
- } from "./chunk-WHFXXV2A.js";
10
+ } from "./chunk-ZGVMX36I.js";
11
11
  import {
12
12
  atLeast,
13
13
  parseVersion
@@ -21,7 +21,7 @@ import {
21
21
  isCursorHookPayload,
22
22
  isRecord,
23
23
  toolsCoveredByGateEntry
24
- } from "./chunk-GYLIVREZ.js";
24
+ } from "./chunk-GOSMCOHB.js";
25
25
 
26
26
  // src/cursor-gate-registration.ts
27
27
  import { dirname, isAbsolute, join, resolve } from "path";
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  isFinalCommandAckRefusal
3
- } from "./chunk-GYLIVREZ.js";
3
+ } from "./chunk-GOSMCOHB.js";
4
4
 
5
5
  // src/command-ack-outcome.ts
6
6
  var SETTLED_ACK = { outcome: "settled" };
@@ -8,7 +8,7 @@ import {
8
8
  PUSHARY_CLI_LATEST_FOR_POWERSHELL,
9
9
  SETUP_AGENT_CHOICES,
10
10
  isApprovalMode
11
- } from "./chunk-GYLIVREZ.js";
11
+ } from "./chunk-GOSMCOHB.js";
12
12
 
13
13
  // src/cli/mode-request.ts
14
14
  var parseDuration = (value) => {
@@ -263,6 +263,7 @@ var SETUP_OPTIONS = [
263
263
  ["--yes, -y", "Accept every default and ask nothing. Implies --agents auto unless --agents is given"],
264
264
  ["--connect app", "Only pair the native Pushary app with a QR. By default setup offers browser sign-in first, with the QR below it"],
265
265
  ["--connect none", "Skip pairing a phone, same as --skip-phone"],
266
+ ["--code <XXXX-XXXX>", "The code from your phone, also read from PUSHARY_SETUP_CODE. Browser sign-in then only accepts the account and workspace that phone uses"],
266
267
  ["--control auto|on|off", "Manage phone-start automatically (default), require it, or disable its background service"],
267
268
  ["--transcripts on|off", "Enable or disable encrypted transcript sync on this machine"],
268
269
  ["--skip-phone", "Skip pairing a phone"],
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  HOOK_HOLD_BUDGET_ENV,
3
3
  hookHoldBudgetProof
4
- } from "./chunk-GYLIVREZ.js";
4
+ } from "./chunk-GOSMCOHB.js";
5
5
 
6
6
  // src/hold-budget.ts
7
7
  var takeHookHoldBudget = (args = process.argv.slice(2), env = process.env) => {
@@ -4,21 +4,21 @@ import {
4
4
  claimThrottle,
5
5
  releaseThrottle,
6
6
  reportEvent
7
- } from "./chunk-N6ARPVSQ.js";
7
+ } from "./chunk-3P3GPF6O.js";
8
8
  import {
9
9
  deriveToolTarget,
10
10
  permissionDeniedAction
11
- } from "./chunk-YZRUE46K.js";
11
+ } from "./chunk-TTU65I6T.js";
12
12
  import {
13
13
  projectNameFor
14
- } from "./chunk-S55XHTYZ.js";
14
+ } from "./chunk-RFCTFMJS.js";
15
15
  import {
16
16
  PERMISSION_ALLOWED_EVENT,
17
17
  PERMISSION_DENIED_EVENT,
18
18
  machineApprovalFor,
19
19
  machineDecisionFor,
20
20
  wireVerdictFor
21
- } from "./chunk-GYLIVREZ.js";
21
+ } from "./chunk-GOSMCOHB.js";
22
22
 
23
23
  // src/machine-decision-audit.ts
24
24
  var MACHINE_DECISION_REPORT_TIMEOUT_MS = 800;
@@ -3,24 +3,24 @@ import {
3
3
  expectedLaunchCapabilities,
4
4
  hasSpawnProvider,
5
5
  resolveControlPolicy
6
- } from "./chunk-YGCU6KMO.js";
6
+ } from "./chunk-TZYJNKFN.js";
7
7
  import {
8
8
  daemonHasRemoteProof,
9
9
  daemonServiceManagerAvailable,
10
10
  hasDaemonServiceDefinition,
11
11
  readDaemonNeedsLogin,
12
12
  readDaemonStatus
13
- } from "./chunk-IR342JX3.js";
13
+ } from "./chunk-65AS4TO4.js";
14
14
  import {
15
15
  getMachineId
16
- } from "./chunk-4ZSC56SL.js";
16
+ } from "./chunk-R6JRCEIX.js";
17
17
  import {
18
18
  readControlMode,
19
19
  readKeyInForce
20
- } from "./chunk-47NWTV5K.js";
20
+ } from "./chunk-7JVJ4ZKU.js";
21
21
  import {
22
22
  getBaseUrl
23
- } from "./chunk-5LE7C6Q2.js";
23
+ } from "./chunk-DEMI4ZEH.js";
24
24
  import {
25
25
  getPackageVersion
26
26
  } from "./chunk-CXQWDQCJ.js";
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  computerOsOfPlatform,
3
3
  isComputerAgent
4
- } from "./chunk-GYLIVREZ.js";
4
+ } from "./chunk-GOSMCOHB.js";
5
5
 
6
6
  // src/setup/phone-check.ts
7
7
  var NO_AGENT_CONNECTED_LINE = "Skipping the phone step: no agent was connected, so nothing could ask you anything on your phone yet.";
@@ -6,10 +6,13 @@ import {
6
6
  } from "./chunk-CINBAX5G.js";
7
7
  import {
8
8
  SETUP_AGENT_CHOICES,
9
+ SETUP_CODE_ENV,
10
+ SETUP_CODE_FLAG,
11
+ SETUP_CODE_SHAPE,
9
12
  isSetupConnectMode,
10
13
  isValidApiKey,
11
14
  normalizeAgentId
12
- } from "./chunk-GYLIVREZ.js";
15
+ } from "./chunk-GOSMCOHB.js";
13
16
 
14
17
  // src/setup/options.ts
15
18
  var AGENT_CHOICES = SETUP_AGENT_CHOICES;
@@ -40,7 +43,23 @@ var effectiveVerify = (options, context) => {
40
43
  var effectiveAgentSelection = (selection, context) => selection.kind === "ask" && !context.someoneCanAnswer ? { kind: "auto" } : selection;
41
44
  var SETUP_FLAGS = {
42
45
  bools: ["key-stdin", "skip-phone", "yes", "y", "json", "dry-run", "take-over-hooks", "hermes-gate-terminal", "verbose", "help", "h"],
43
- values: ["key", "connect", "agents", "verify", "control", "transcripts"]
46
+ values: ["key", "connect", "agents", "verify", "control", "transcripts", SETUP_CODE_FLAG]
47
+ };
48
+ var parseSetupCode = (raw) => {
49
+ if (raw === void 0) return null;
50
+ const code = raw.trim();
51
+ if (!SETUP_CODE_SHAPE.test(code)) {
52
+ throw new UsageError(`--${SETUP_CODE_FLAG} takes the eight character code from your phone, like K7P4-2QXM`);
53
+ }
54
+ return code.toUpperCase();
55
+ };
56
+ var setupCodeOf = (fromFlag, fromEnvironment) => {
57
+ if (fromFlag !== null) return { setupCode: fromFlag, setupCodeSource: "flag" };
58
+ return fromEnvironment === null ? { setupCode: null, setupCodeSource: null } : { setupCode: fromEnvironment, setupCodeSource: "environment" };
59
+ };
60
+ var setupCodeFromEnvironment = (env) => {
61
+ const code = env[SETUP_CODE_ENV]?.trim();
62
+ return code !== void 0 && SETUP_CODE_SHAPE.test(code) ? code.toUpperCase() : null;
44
63
  };
45
64
  var effectiveControlMode = (options, stored) => options.controlExplicit ? options.control : stored ?? options.control;
46
65
  var parseAgentSelection = (raw, yes) => {
@@ -126,7 +145,8 @@ var parseSetupOptions = (input) => {
126
145
  transcripts: transcriptsRaw === void 0 ? null : transcriptsRaw === "on",
127
146
  takeOverHooks: flags.bools.has("take-over-hooks"),
128
147
  hermesGateTerminal: flags.bools.has("hermes-gate-terminal"),
129
- verbose: flags.bools.has("verbose")
148
+ verbose: flags.bools.has("verbose"),
149
+ ...setupCodeOf(parseSetupCode(flags.values.get(SETUP_CODE_FLAG)), setupCodeFromEnvironment(input.env ?? {}))
130
150
  };
131
151
  };
132
152
 
@@ -4,13 +4,13 @@ import {
4
4
  configFailureKind,
5
5
  retryAgentCommand,
6
6
  writeSetupConfigFile
7
- } from "./chunk-SYEUQH6Z.js";
7
+ } from "./chunk-4JXYINSC.js";
8
8
  import {
9
9
  MCP_BRIDGE_BINARY
10
- } from "./chunk-O2X6KT7P.js";
10
+ } from "./chunk-CGTPKZWB.js";
11
11
  import {
12
12
  KEY_FILE_MODE
13
- } from "./chunk-47NWTV5K.js";
13
+ } from "./chunk-7JVJ4ZKU.js";
14
14
  import {
15
15
  CLINE_SERVER_NAME_TAKEN,
16
16
  CLINE_SETTINGS_REFUSALS,
@@ -32,10 +32,10 @@ import {
32
32
  withClinePusharyServer,
33
33
  withRefreshedClineKey,
34
34
  withoutClinePusharyServer
35
- } from "./chunk-WHFXXV2A.js";
35
+ } from "./chunk-ZGVMX36I.js";
36
36
  import {
37
37
  resolveGlobalBinary
38
- } from "./chunk-IQBJD5ZB.js";
38
+ } from "./chunk-J35H5XWH.js";
39
39
  import {
40
40
  readJsonSafe,
41
41
  writeFileAtomic,
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  pusharyDir
3
- } from "./chunk-WHFXXV2A.js";
3
+ } from "./chunk-ZGVMX36I.js";
4
4
  import {
5
5
  writeFileAtomic
6
6
  } from "./chunk-PM2NRK6Y.js";
@@ -2,7 +2,7 @@ import {
2
2
  localRepoKey,
3
3
  normalizeRepoRemote,
4
4
  parseGitBranch
5
- } from "./chunk-GYLIVREZ.js";
5
+ } from "./chunk-GOSMCOHB.js";
6
6
 
7
7
  // src/repo.ts
8
8
  import { existsSync, readFileSync, statSync } from "fs";
@@ -1,11 +1,11 @@
1
1
  import {
2
2
  autoUpdateLock
3
- } from "./chunk-WHFXXV2A.js";
3
+ } from "./chunk-ZGVMX36I.js";
4
4
  import {
5
5
  installPackageGlobally,
6
6
  npmErrorMessage,
7
7
  throwIfNpmRefusesInstall
8
- } from "./chunk-IQBJD5ZB.js";
8
+ } from "./chunk-J35H5XWH.js";
9
9
  import {
10
10
  writeJsonAtomic
11
11
  } from "./chunk-PM2NRK6Y.js";
@@ -14,7 +14,7 @@ import {
14
14
  } from "./chunk-CXQWDQCJ.js";
15
15
 
16
16
  // src/upgrade-lock.ts
17
- import { fork } from "child_process";
17
+ import { fork, spawnSync } from "child_process";
18
18
  import { createHash } from "crypto";
19
19
  import { existsSync, mkdirSync, readFileSync, realpathSync, statSync, unlinkSync } from "fs";
20
20
  import { createServer, Server } from "net";
@@ -100,6 +100,9 @@ var runningCliInstallerIn = (processes, ownPid) => {
100
100
  };
101
101
 
102
102
  // src/upgrade-lock.ts
103
+ var rejectConnection = (socket) => {
104
+ socket.destroy();
105
+ };
103
106
  var LOCK_HOST = "127.0.0.1";
104
107
  var LOCK_PORT_START = 49152;
105
108
  var LOCK_PORT_COUNT = 16384;
@@ -109,6 +112,12 @@ var LOCK_HANDLE = "pushary-upgrade-lock-handle";
109
112
  var HANDOFF_TIMEOUT_MS = 1e4;
110
113
  var FINISH_TIMEOUT_MS = 5 * 60 * 1e3;
111
114
  var KERNEL_LOCK_FORMAT = "kernel-v1";
115
+ var LOCK_PORT_CANDIDATE_COUNT = 8;
116
+ var RESERVED_PORT_CODE = "EACCES";
117
+ var PORT_IN_USE_CODE = "EADDRINUSE";
118
+ var EXCLUDED_PORT_RANGES_COMMAND = ["int", "ipv4", "show", "excludedportrange", "protocol=tcp"];
119
+ var EXCLUDED_PORT_RANGES_TIMEOUT_MS = 5e3;
120
+ var windowsNetshPath = () => `${process.env.SystemRoot?.trim() || "C:\\Windows"}\\System32\\netsh.exe`;
112
121
  var heldLocks = /* @__PURE__ */ new Map();
113
122
  var PENDING_INSTALL_STALE_AFTER_MS = 60 * 6e4;
114
123
  var PLATFORMS_WITH_PROCESS_TABLE = /* @__PURE__ */ new Set(["darwin", "linux"]);
@@ -116,7 +125,65 @@ var canonicalLockPath = (path) => {
116
125
  mkdirSync(dirname(path), { recursive: true });
117
126
  return join(realpathSync(dirname(path)), basename(path));
118
127
  };
119
- var lockPort = (path) => LOCK_PORT_START + createHash("sha256").update(path).digest().readUInt32BE(0) % LOCK_PORT_COUNT;
128
+ var hashedLockPort = (seed) => LOCK_PORT_START + createHash("sha256").update(seed).digest().readUInt32BE(0) % LOCK_PORT_COUNT;
129
+ var candidateSeed = (path, index) => index === 0 ? path : `${path}\0${index}`;
130
+ var upgradeLockPorts = (path) => [...new Set(Array.from({ length: LOCK_PORT_CANDIDATE_COUNT }, (_, index) => hashedLockPort(candidateSeed(path, index))))];
131
+ var errorCode = (error) => error instanceof Error && "code" in error && typeof error.code === "string" ? error.code : void 0;
132
+ var EXCLUDED_RANGE_ROW = /^\s*(\d+)\s+(\d+)(?:\s+\*)?\s*$/;
133
+ var EXCLUDED_RANGE_HEADER_RULE = /^\s*-+\s+-+\s*$/;
134
+ var parseExcludedPortRanges = (output) => {
135
+ const lines = output.split(/\r?\n/);
136
+ if (!lines.some((line) => EXCLUDED_RANGE_HEADER_RULE.test(line))) return void 0;
137
+ return lines.flatMap((line) => {
138
+ const row = EXCLUDED_RANGE_ROW.exec(line);
139
+ return row ? [{ start: Number(row[1]), end: Number(row[2]) }] : [];
140
+ });
141
+ };
142
+ var readExcludedPortRangesWithNetsh = () => {
143
+ const result = spawnSync(windowsNetshPath(), [...EXCLUDED_PORT_RANGES_COMMAND], { encoding: "utf8", timeout: EXCLUDED_PORT_RANGES_TIMEOUT_MS, windowsHide: true });
144
+ return result.status === 0 && typeof result.stdout === "string" ? result.stdout : void 0;
145
+ };
146
+ var listenExclusivelyOnLoopback = (port) => new Promise((resolve, reject) => {
147
+ const server = createServer(rejectConnection);
148
+ const failed = (error) => {
149
+ server.close();
150
+ reject(error);
151
+ };
152
+ server.once("error", failed);
153
+ server.listen({ host: LOCK_HOST, port, exclusive: true }, () => {
154
+ server.off("error", failed);
155
+ resolve(server);
156
+ });
157
+ });
158
+ var DEFAULT_PORT_ACCESS = {
159
+ listenOnLockPort: listenExclusivelyOnLoopback,
160
+ readExcludedPortRanges: readExcludedPortRangesWithNetsh
161
+ };
162
+ var portIsInRanges = (port, ranges) => ranges.some((range) => port >= range.start && port <= range.end);
163
+ var bindFirstUsableLockPort = async (path, platform, access) => {
164
+ const ports = upgradeLockPorts(path);
165
+ let excludedRanges;
166
+ let excludedRangesRead = false;
167
+ const windowsReserves = (port) => {
168
+ if (!excludedRangesRead) {
169
+ excludedRangesRead = true;
170
+ const output = access.readExcludedPortRanges();
171
+ excludedRanges = output === void 0 ? void 0 : parseExcludedPortRanges(output);
172
+ }
173
+ return excludedRanges !== void 0 && portIsInRanges(port, excludedRanges);
174
+ };
175
+ for (const port of ports) {
176
+ try {
177
+ return { kind: "bound", server: await access.listenOnLockPort(port) };
178
+ } catch (error) {
179
+ const code = errorCode(error);
180
+ if (code === PORT_IN_USE_CODE) return { kind: "in_use" };
181
+ if (platform !== "win32" || code !== RESERVED_PORT_CODE || !windowsReserves(port)) throw error;
182
+ }
183
+ }
184
+ return { kind: "every_port_reserved", ports };
185
+ };
186
+ var everyPortReservedReason = (ports) => `Windows reserves every loopback port the upgrade lock can use (${ports.join(", ")}). \`netsh int ipv4 show excludedportrange protocol=tcp\` lists the reserved ranges.`;
120
187
  var readLockRecord = (path) => {
121
188
  try {
122
189
  const value = JSON.parse(readFileSync(path, "utf8"));
@@ -175,9 +242,6 @@ var pendingInstallReason = (pending, path) => {
175
242
  return `${UNFINISHED_INSTALLATION}. To clear it, ${clearingSteps(path)}`;
176
243
  }
177
244
  };
178
- var rejectConnection = (socket) => {
179
- socket.destroy();
180
- };
181
245
  var inheritLock = (path) => new Promise((resolve) => {
182
246
  const done = (claim) => {
183
247
  clearTimeout(timer);
@@ -189,7 +253,7 @@ var inheritLock = (path) => new Promise((resolve) => {
189
253
  const receive = (message, handle) => {
190
254
  if (message !== LOCK_HANDLE || !(handle instanceof Server)) return;
191
255
  const address = handle.address();
192
- if (address === null || typeof address === "string" || address.port !== lockPort(path) || address.address !== LOCK_HOST) {
256
+ if (address === null || typeof address === "string" || !upgradeLockPorts(path).includes(address.port) || address.address !== LOCK_HOST) {
193
257
  handle.close();
194
258
  done({ kind: "unavailable", reason: "Invalid inherited upgrade lock" });
195
259
  return;
@@ -207,19 +271,17 @@ var inheritLock = (path) => new Promise((resolve) => {
207
271
  if (error) disconnected();
208
272
  });
209
273
  });
210
- var claimUpgradeLock = async (request = {}) => {
274
+ var claimUpgradeLock = async (request = {}, portAccess = DEFAULT_PORT_ACCESS) => {
211
275
  let server;
212
276
  try {
213
277
  const path = canonicalLockPath(request.lockPath ?? autoUpdateLock());
214
278
  const inheritedPath = process.env[INHERITED_LOCK_ENV];
215
279
  delete process.env[INHERITED_LOCK_ENV];
216
280
  if (inheritedPath === path && !heldLocks.has(path)) return await inheritLock(path);
217
- server = createServer(rejectConnection);
218
- const listener = server;
219
- await new Promise((resolve, reject) => {
220
- listener.once("error", reject);
221
- listener.listen({ host: LOCK_HOST, port: lockPort(path), exclusive: true }, resolve);
222
- });
281
+ const binding = await bindFirstUsableLockPort(path, request.platform ?? process.platform, portAccess);
282
+ if (binding.kind === "in_use") return { kind: "held", holderPid: readLockRecord(path).pid };
283
+ if (binding.kind === "every_port_reserved") return { kind: "unavailable", reason: everyPortReservedReason(binding.ports) };
284
+ server = binding.server;
223
285
  const record = readLockRecord(path);
224
286
  const isAlive = request.isAlive ?? isProcessAlive;
225
287
  const pending = record.installationPending ? judgePendingInstall(path, record, request, isAlive) : ENDED;
@@ -236,9 +298,6 @@ var claimUpgradeLock = async (request = {}) => {
236
298
  return { kind: "acquired" };
237
299
  } catch (error) {
238
300
  server?.close();
239
- if (error instanceof Error && "code" in error && error.code === "EADDRINUSE") {
240
- return { kind: "held", holderPid: readLockRecord(request.lockPath ?? autoUpdateLock()).pid };
241
- }
242
301
  return { kind: "unavailable", reason: npmErrorMessage(error) };
243
302
  }
244
303
  };
@@ -308,6 +367,8 @@ var installWithUpgradeLock = (request, lockPath = autoUpdateLock(), runNpm) => {
308
367
  export {
309
368
  PENDING_INSTALL_STALE_AFTER_MS,
310
369
  canonicalLockPath,
370
+ upgradeLockPorts,
371
+ parseExcludedPortRanges,
311
372
  claimUpgradeLock,
312
373
  leftAnUnfinishedInstallHere,
313
374
  ownsUpgradeLock,
@@ -1,35 +1,35 @@
1
1
  import {
2
2
  MANAGED_CLAUDE_SETTINGS_BY_PLATFORM
3
- } from "./chunk-LYBX463S.js";
3
+ } from "./chunk-Y4DC5KRB.js";
4
4
  import {
5
5
  declinedAgentsFile,
6
6
  readDeclinedAgents
7
- } from "./chunk-IEQDAZDB.js";
7
+ } from "./chunk-X3DYMWPL.js";
8
8
  import {
9
9
  OPENCODE_HOOK_BINARY,
10
10
  openCodeConfigDir,
11
11
  openCodePluginFile
12
- } from "./chunk-UVO56TVL.js";
12
+ } from "./chunk-67FOJA34.js";
13
13
  import {
14
14
  openCodePluginArgv
15
- } from "./chunk-EKU4KLON.js";
15
+ } from "./chunk-7TVCL4PI.js";
16
16
  import {
17
17
  liveCursorGateCoverage
18
- } from "./chunk-AOCTHK4E.js";
18
+ } from "./chunk-O4ZFUVDI.js";
19
19
  import {
20
20
  compatibleConfigFile,
21
21
  compatibleHookEvents,
22
22
  grokHome
23
- } from "./chunk-X5R55HMM.js";
23
+ } from "./chunk-3IHL4N2G.js";
24
24
  import {
25
25
  parseConfigDocument
26
- } from "./chunk-CIO6FAIU.js";
26
+ } from "./chunk-2ABJ4VCG.js";
27
27
  import {
28
28
  DEFAULT_HOOKS_KEY_PATH,
29
29
  GEMINI_HOOK_BINARY,
30
30
  GEMINI_HOOK_EVENTS,
31
31
  hooksAt
32
- } from "./chunk-2EHLFIVK.js";
32
+ } from "./chunk-W2SZOATE.js";
33
33
  import {
34
34
  CODEX_EARLIER_APPROVAL_MATCHERS,
35
35
  CODEX_HOOK_BINARY,
@@ -57,7 +57,7 @@ import {
57
57
  parseHookArgv,
58
58
  parseHookCommand,
59
59
  supportedClaudeEvents
60
- } from "./chunk-WHFXXV2A.js";
60
+ } from "./chunk-ZGVMX36I.js";
61
61
  import {
62
62
  readRegularJsonFile,
63
63
  readRegularTextFile
@@ -71,7 +71,7 @@ import {
71
71
  OPENCODE_APPROVAL_EVENT,
72
72
  isRecord,
73
73
  matcherMatchesEveryCall
74
- } from "./chunk-GYLIVREZ.js";
74
+ } from "./chunk-GOSMCOHB.js";
75
75
 
76
76
  // src/hook-wiring.ts
77
77
  import { createHash } from "crypto";
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  readExistingMachineId
3
- } from "./chunk-4ZSC56SL.js";
3
+ } from "./chunk-R6JRCEIX.js";
4
4
  import {
5
5
  getBaseUrl
6
- } from "./chunk-5LE7C6Q2.js";
6
+ } from "./chunk-DEMI4ZEH.js";
7
7
  import {
8
8
  NetworkError
9
9
  } from "./chunk-CINBAX5G.js";
@@ -13,7 +13,7 @@ import {
13
13
  import {
14
14
  clientContextHeaders,
15
15
  redactSecretsFromContent
16
- } from "./chunk-GYLIVREZ.js";
16
+ } from "./chunk-GOSMCOHB.js";
17
17
 
18
18
  // src/cli/net.ts
19
19
  import { createRequire } from "module";
@@ -29,7 +29,7 @@ import {
29
29
  reportableSessionId,
30
30
  toToolLookup,
31
31
  truncateLine
32
- } from "./chunk-GYLIVREZ.js";
32
+ } from "./chunk-GOSMCOHB.js";
33
33
 
34
34
  // ../hook-mapping/src/commit-receipt.ts
35
35
  var COMMIT_OUTPUT_MAX_LENGTH = 65536;
@@ -16,7 +16,7 @@ import {
16
16
  uninstallOpenClawPlugin,
17
17
  unsetOpenClawEntry,
18
18
  writeOpenClawEntry
19
- } from "./chunk-UQB4MAA6.js";
19
+ } from "./chunk-IU4M7QPA.js";
20
20
  import {
21
21
  needsShell
22
22
  } from "./chunk-3PSNUHC5.js";
@@ -28,10 +28,10 @@ import {
28
28
  openClawDirectoriesToLookIn,
29
29
  openClawPluginFolder,
30
30
  openClawSetupReceiptDirectory
31
- } from "./chunk-WHFXXV2A.js";
31
+ } from "./chunk-ZGVMX36I.js";
32
32
  import {
33
33
  resolvePathBinary
34
- } from "./chunk-IQBJD5ZB.js";
34
+ } from "./chunk-J35H5XWH.js";
35
35
  import {
36
36
  readJsonSafe,
37
37
  writeJsonAtomic
@@ -42,7 +42,7 @@ import {
42
42
  } from "./chunk-CXQWDQCJ.js";
43
43
  import {
44
44
  isRecord
45
- } from "./chunk-GYLIVREZ.js";
45
+ } from "./chunk-GOSMCOHB.js";
46
46
 
47
47
  // src/hermes/plugin-payload.ts
48
48
  import { createHash } from "crypto";
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  realpath
3
- } from "./chunk-DVAXZOTR.js";
3
+ } from "./chunk-WS7Z6IJV.js";
4
4
  import {
5
5
  findNativeClaudeInstall
6
6
  } from "./chunk-TCE3J44Z.js";
@@ -12,7 +12,7 @@ import {
12
12
  resolvePackageVersionFromBinary,
13
13
  resolvePathBinary,
14
14
  resolvePathBinaryAsync
15
- } from "./chunk-IQBJD5ZB.js";
15
+ } from "./chunk-J35H5XWH.js";
16
16
  import {
17
17
  AGENTS,
18
18
  CLAUDE_BRIDGE_CAPABILITY,
@@ -25,7 +25,7 @@ import {
25
25
  OPENCODE_BRIDGE_CAPABILITY,
26
26
  SPAWN_CAPABILITY,
27
27
  sessionProvidersAdvertisedBy
28
- } from "./chunk-GYLIVREZ.js";
28
+ } from "./chunk-GOSMCOHB.js";
29
29
 
30
30
  // src/live-capabilities.ts
31
31
  import { execFileSync } from "child_process";