pushary 1.9.235 → 1.9.236

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 (149) hide show
  1. package/CHANGELOG.md +8 -0
  2. package/data/cursor-plugin/.cursor-plugin/plugin.json +1 -1
  3. package/data/cursor-plugin/CHANGELOG.md +4 -0
  4. package/data/cursor-plugin/scripts/redaction.mjs +2 -0
  5. package/data/openclaw-plugin/dist/redaction.js +2 -0
  6. package/data/vscode-plugin/.claude-plugin/plugin.json +1 -1
  7. package/data/vscode-plugin/CHANGELOG.md +4 -0
  8. package/data/vscode-plugin/scripts/redaction.mjs +2 -0
  9. package/dist/{api-UVFEVNJD.js → api-ZRAS6XVR.js} +11 -11
  10. package/dist/bin/pushary-audit.js +3 -3
  11. package/dist/bin/pushary-bell-hook.js +28 -28
  12. package/dist/bin/pushary-bell.js +12 -12
  13. package/dist/bin/pushary-calls.js +15 -15
  14. package/dist/bin/pushary-claude.js +26 -26
  15. package/dist/bin/pushary-clean.js +39 -39
  16. package/dist/bin/pushary-codex-bridge.js +23 -23
  17. package/dist/bin/pushary-codex-hook.js +34 -34
  18. package/dist/bin/pushary-codex-session.js +8 -8
  19. package/dist/bin/pushary-codex.js +16 -16
  20. package/dist/bin/pushary-connect.js +35 -35
  21. package/dist/bin/pushary-cowork.js +5 -5
  22. package/dist/bin/pushary-daemon.js +46 -46
  23. package/dist/bin/pushary-disconnect.js +30 -30
  24. package/dist/bin/pushary-display-hook.js +8 -0
  25. package/dist/bin/pushary-doctor.js +47 -47
  26. package/dist/bin/pushary-elicitation-hook.js +27 -27
  27. package/dist/bin/pushary-gemini-bridge.js +18 -18
  28. package/dist/bin/pushary-gemini-hook.js +31 -31
  29. package/dist/bin/pushary-hook.js +35 -35
  30. package/dist/bin/pushary-login.js +23 -23
  31. package/dist/bin/pushary-logout.js +31 -31
  32. package/dist/bin/pushary-mcp.js +12 -12
  33. package/dist/bin/pushary-mode.js +16 -16
  34. package/dist/bin/pushary-notification-hook.js +27 -27
  35. package/dist/bin/pushary-opencode-bridge.js +22 -22
  36. package/dist/bin/pushary-opencode-hook.js +32 -32
  37. package/dist/bin/pushary-permission-denied-hook.js +34 -34
  38. package/dist/bin/pushary-permission-hook.js +35 -35
  39. package/dist/bin/pushary-post-hook.js +28 -28
  40. package/dist/bin/pushary-prompt-hook.js +27 -27
  41. package/dist/bin/pushary-session-end-hook.js +27 -27
  42. package/dist/bin/pushary-session-start-hook.js +39 -39
  43. package/dist/bin/pushary-sessions.js +12 -12
  44. package/dist/bin/pushary-setup.js +325 -67
  45. package/dist/bin/pushary-stats.js +5 -5
  46. package/dist/bin/pushary-status.js +36 -36
  47. package/dist/bin/pushary-stop-hook.js +27 -27
  48. package/dist/bin/pushary-stopfailure-hook.js +27 -27
  49. package/dist/bin/pushary-suggestions.js +16 -16
  50. package/dist/bin/pushary-transcript-register.js +17 -17
  51. package/dist/bin/pushary-transcripts.js +26 -26
  52. package/dist/bin/pushary-upgrade.js +47 -47
  53. package/dist/bin/pushary-wait.js +16 -16
  54. package/dist/bin/pushary.js +7 -7
  55. package/dist/{chunk-FCQ52N4E.js → chunk-2H63TCPL.js} +8 -8
  56. package/dist/{chunk-3B5FQ542.js → chunk-2MB3FZAJ.js} +2 -2
  57. package/dist/{chunk-KTJHZVCD.js → chunk-35IY2SPK.js} +3 -3
  58. package/dist/{chunk-6H3RBEHP.js → chunk-37RAJAPB.js} +1 -1
  59. package/dist/{chunk-MN6DXDJR.js → chunk-3SEH5JU3.js} +6 -6
  60. package/dist/{chunk-3QQY5USW.js → chunk-3W7UZY2B.js} +4 -4
  61. package/dist/{chunk-4QQ3HXGR.js → chunk-4CUOYT5O.js} +3 -3
  62. package/dist/{chunk-SFIYMKWT.js → chunk-4OHGEWKF.js} +5 -5
  63. package/dist/{chunk-XYRXKL3V.js → chunk-4OLECRWP.js} +1 -1
  64. package/dist/{chunk-3C2XMGXE.js → chunk-5JRALQKT.js} +3 -3
  65. package/dist/{chunk-HI3LOBT5.js → chunk-5PWGMOHP.js} +112 -48
  66. package/dist/{chunk-TMN7LKDC.js → chunk-6LF7EQIZ.js} +7 -7
  67. package/dist/{chunk-FEVQDABQ.js → chunk-74MBT2PL.js} +2 -2
  68. package/dist/{chunk-CSXA4HMV.js → chunk-7HKBGKLY.js} +2 -2
  69. package/dist/{chunk-H4364HR3.js → chunk-7TGJ6FPW.js} +5 -5
  70. package/dist/{chunk-3K2S4OW7.js → chunk-ABQRDSE5.js} +7 -6
  71. package/dist/{chunk-ELP65DFC.js → chunk-B6GCLODI.js} +1 -1
  72. package/dist/{chunk-MHZSIN5K.js → chunk-BX3VDXXW.js} +3 -3
  73. package/dist/{chunk-JF4VX754.js → chunk-CFIZWE37.js} +1 -1
  74. package/dist/{chunk-GPD4BB76.js → chunk-CG2YLNCB.js} +1 -1
  75. package/dist/{chunk-JF3ONE4H.js → chunk-D6O4XDS5.js} +2 -2
  76. package/dist/{chunk-BBZ3BBZC.js → chunk-DEZKBMHO.js} +4 -4
  77. package/dist/{chunk-GSB62GNT.js → chunk-DKFM2NSF.js} +4 -4
  78. package/dist/{chunk-H5TBR4BB.js → chunk-EZ4QXQNX.js} +5 -5
  79. package/dist/{chunk-OSDIFFSP.js → chunk-FIIRS53K.js} +3 -3
  80. package/dist/{chunk-Z7LAWFZ7.js → chunk-GNCOGELX.js} +1 -1
  81. package/dist/{chunk-ZPQPTIIY.js → chunk-GQGV7H6W.js} +2 -2
  82. package/dist/{chunk-WMCF6PR5.js → chunk-GS2SPPBB.js} +3 -3
  83. package/dist/{chunk-7B2DHU32.js → chunk-HAZ72WZD.js} +16 -16
  84. package/dist/{chunk-A2GO3G2I.js → chunk-HB4BB66C.js} +6 -6
  85. package/dist/{chunk-LDX3KQMJ.js → chunk-HR7UASHX.js} +2 -2
  86. package/dist/{chunk-2QUYUFYQ.js → chunk-HTDRJMP5.js} +4 -4
  87. package/dist/{chunk-OV2XD2UY.js → chunk-HY27YNME.js} +1 -1
  88. package/dist/{chunk-JYFMVOML.js → chunk-J2JGO6SS.js} +1 -1
  89. package/dist/{chunk-NDXTGRZG.js → chunk-J65WHWPK.js} +1 -1
  90. package/dist/{chunk-FUJZW3R5.js → chunk-JZ272QIY.js} +1 -1
  91. package/dist/{chunk-7XCL66ON.js → chunk-KVGQYML5.js} +2 -2
  92. package/dist/{chunk-VPG6QENY.js → chunk-LZYSSSF3.js} +10 -10
  93. package/dist/{chunk-TAXOI6AK.js → chunk-M45REXUU.js} +4 -4
  94. package/dist/{chunk-XGW4PJPO.js → chunk-NEQMXQZQ.js} +2 -2
  95. package/dist/{chunk-WY2UKKLD.js → chunk-NH4HBX7J.js} +1 -1
  96. package/dist/{chunk-WVJFHP75.js → chunk-NSUIUOE7.js} +1 -1
  97. package/dist/{chunk-TWACA7ER.js → chunk-NVJQHRM3.js} +9 -9
  98. package/dist/{chunk-JM6EAV42.js → chunk-O3UOI6ML.js} +5 -5
  99. package/dist/{chunk-M64A2Z2F.js → chunk-OGFKB66L.js} +1 -1
  100. package/dist/{chunk-JFXYGMV5.js → chunk-OHMC3ZFE.js} +4 -4
  101. package/dist/{chunk-FZN7TKSM.js → chunk-OSRHNYI6.js} +1 -1
  102. package/dist/{chunk-G5EKU4RB.js → chunk-P3JLLHOO.js} +3 -3
  103. package/dist/{chunk-5QLIXOVT.js → chunk-P4ZXHSJX.js} +1 -1
  104. package/dist/{chunk-HPFGXE6Y.js → chunk-PDIDI2JS.js} +6 -6
  105. package/dist/{chunk-Q5SVRCFU.js → chunk-QFP4D7BE.js} +1 -1
  106. package/dist/{chunk-JPKOYDQJ.js → chunk-QKX4J66I.js} +6 -6
  107. package/dist/{chunk-5DRTR5FC.js → chunk-QNM5EW76.js} +5 -5
  108. package/dist/{chunk-AA54OZM2.js → chunk-RHML34U3.js} +5 -5
  109. package/dist/{chunk-7MRK2WXT.js → chunk-RXFLVAIV.js} +2 -2
  110. package/dist/{chunk-HJSW3MH2.js → chunk-SPGDOHHJ.js} +2 -2
  111. package/dist/{chunk-HDD23XYP.js → chunk-SU3M242B.js} +11 -11
  112. package/dist/{chunk-FMWG4X3D.js → chunk-T5OA2WR7.js} +5 -5
  113. package/dist/{chunk-G5OTSL26.js → chunk-TBHZAZPR.js} +3 -3
  114. package/dist/{chunk-K6PBTBLO.js → chunk-TJJEYS3S.js} +4 -4
  115. package/dist/{chunk-Z5EWWGD2.js → chunk-TKTZBQIL.js} +5 -5
  116. package/dist/{chunk-ULDUDSTW.js → chunk-U33VHYHK.js} +24 -0
  117. package/dist/{chunk-URDT623B.js → chunk-UBPTE3MH.js} +1 -1
  118. package/dist/{chunk-X4G5G2ZN.js → chunk-UKHFRW5M.js} +2 -2
  119. package/dist/{chunk-UIBQDALO.js → chunk-UODLZ2D6.js} +3 -3
  120. package/dist/{chunk-4CEGJAEB.js → chunk-UY6AOWQU.js} +162 -21
  121. package/dist/{chunk-DW7ZQX7L.js → chunk-VQXWLHLD.js} +1 -1
  122. package/dist/{chunk-V4ZQBKI6.js → chunk-VRV7MD3W.js} +1 -1
  123. package/dist/{chunk-52PIW2SN.js → chunk-VSNFCUGH.js} +3 -3
  124. package/dist/{chunk-DN6HPGCI.js → chunk-W4F6RVN5.js} +5 -5
  125. package/dist/{chunk-E6IFBGZF.js → chunk-WFUWUWCT.js} +2 -2
  126. package/dist/{chunk-FKX7SWNT.js → chunk-X3SEEC4X.js} +7 -7
  127. package/dist/{chunk-MQSO2S3H.js → chunk-XEXFRZS7.js} +1 -1
  128. package/dist/{chunk-4UIVOCDT.js → chunk-XX3Z4KQL.js} +1 -1
  129. package/dist/{chunk-V7ULGI7U.js → chunk-XYOB4W72.js} +4 -4
  130. package/dist/{chunk-RV5LIW3K.js → chunk-Y4GEE5VA.js} +12 -12
  131. package/dist/{chunk-EINN22XV.js → chunk-YKTCIWKY.js} +2 -2
  132. package/dist/{chunk-LIYQSMYK.js → chunk-Z3XPHDVP.js} +4 -4
  133. package/dist/{chunk-BJRPBKE7.js → chunk-ZAKG5GGJ.js} +4 -4
  134. package/dist/{chunk-ICLT2KA5.js → chunk-ZQ5NCJVO.js} +1 -1
  135. package/dist/{chunk-TGM2WHUG.js → chunk-ZT4PSGTB.js} +2 -2
  136. package/dist/{codex-app-cards-switch-DBFQJU3Y.js → codex-app-cards-switch-CEWQAZD2.js} +11 -11
  137. package/dist/{codex-card-routing-TKG7LOP4.js → codex-card-routing-VRLWXQ4Z.js} +2 -2
  138. package/dist/{codex-desktop-launch-UXMYKS5C.js → codex-desktop-launch-EU5BXQFP.js} +3 -3
  139. package/dist/{codex-session-launch-5NOJKDWN.js → codex-session-launch-7PSWFAOC.js} +20 -20
  140. package/dist/{config-HHUSXJZE.js → config-UQOFNS26.js} +3 -3
  141. package/dist/{global-upgrade-J2NB62DV.js → global-upgrade-WO2MIUOJ.js} +9 -9
  142. package/dist/{identity-7O3ZBVUY.js → identity-7UK4G6K7.js} +4 -4
  143. package/dist/{live-capabilities-773SVQWH.js → live-capabilities-HRJBL4FO.js} +4 -4
  144. package/dist/{paths-VZXMX35O.js → paths-2FPNRZAX.js} +3 -3
  145. package/dist/{reapply-7MIBK2WB.js → reapply-GH4LWS25.js} +34 -34
  146. package/dist/src/index.js +33 -33
  147. package/dist/{upgrade-lock-WWTTPOIZ.js → upgrade-lock-CA25EHHB.js} +4 -4
  148. package/dist/{usage-PHTLHFL2.js → usage-23UD3UL7.js} +3 -3
  149. package/package.json +1 -1
@@ -8,7 +8,7 @@ import {
8
8
  PUSHARY_CLI_LATEST_FOR_POWERSHELL,
9
9
  SETUP_AGENT_CHOICES,
10
10
  isApprovalMode
11
- } from "./chunk-ULDUDSTW.js";
11
+ } from "./chunk-U33VHYHK.js";
12
12
 
13
13
  // src/cli/mode-request.ts
14
14
  var parseDuration = (value) => {
@@ -261,7 +261,7 @@ var SETUP_OPTIONS = [
261
261
  ["--key-stdin", "Read the API key from the first line of stdin, so it never appears in argv or shell history"],
262
262
  ["--agents <list>", 'Comma-separated agent ids, or "auto" for everything detected, or "none" to save the key only'],
263
263
  ["--yes, -y", "Accept every default and ask nothing. Implies --agents auto unless --agents is given"],
264
- ["--connect app", "Pair the native Pushary app, no key to paste (default)"],
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
266
  ["--control auto|on|off", "Manage phone-start automatically (default), require it, or disable its background service"],
267
267
  ["--transcripts on|off", "Enable or disable encrypted transcript sync on this machine"],
@@ -1,10 +1,10 @@
1
1
  import {
2
2
  callDecisionStore,
3
3
  identifyingToolInput
4
- } from "./chunk-HDD23XYP.js";
4
+ } from "./chunk-SU3M242B.js";
5
5
  import {
6
6
  canonicalJson
7
- } from "./chunk-FEVQDABQ.js";
7
+ } from "./chunk-74MBT2PL.js";
8
8
 
9
9
  // src/phone-approval.ts
10
10
  import { createHash } from "crypto";
@@ -29,7 +29,7 @@ import {
29
29
  toolResultErrorText,
30
30
  transcriptTokensIn,
31
31
  transcriptUsageRequest
32
- } from "./chunk-WVJFHP75.js";
32
+ } from "./chunk-NSUIUOE7.js";
33
33
  import {
34
34
  askUser,
35
35
  cancelQuestion,
@@ -48,37 +48,37 @@ import {
48
48
  waitForQuestion,
49
49
  waitsForThePhone,
50
50
  writeDegraded
51
- } from "./chunk-A2GO3G2I.js";
51
+ } from "./chunk-HB4BB66C.js";
52
52
  import {
53
53
  RETRY_ACK,
54
54
  readCommandAck,
55
55
  refusedReceiptMessage
56
- } from "./chunk-M64A2Z2F.js";
56
+ } from "./chunk-OGFKB66L.js";
57
57
  import {
58
58
  SubscriptionRequiredError,
59
59
  isRetryable,
60
60
  withRetry
61
- } from "./chunk-H4364HR3.js";
61
+ } from "./chunk-7TGJ6FPW.js";
62
62
  import {
63
63
  fetchAsCredential
64
- } from "./chunk-NDXTGRZG.js";
64
+ } from "./chunk-J65WHWPK.js";
65
65
  import {
66
66
  branchFor,
67
67
  projectNameFor,
68
68
  repoKeyFor
69
- } from "./chunk-4UIVOCDT.js";
69
+ } from "./chunk-XX3Z4KQL.js";
70
70
  import {
71
71
  getMachineId
72
- } from "./chunk-OV2XD2UY.js";
72
+ } from "./chunk-HY27YNME.js";
73
73
  import {
74
74
  reportedInstallSource
75
- } from "./chunk-X4G5G2ZN.js";
75
+ } from "./chunk-UKHFRW5M.js";
76
76
  import {
77
77
  IDLE_PROMPT_NOTIFICATION,
78
78
  NOTIFICATION_PUSH_TYPES,
79
79
  POSTTOOLUSE_MIRROR_ONLY_TOOLS,
80
80
  claudeConfigDir
81
- } from "./chunk-FEVQDABQ.js";
81
+ } from "./chunk-74MBT2PL.js";
82
82
  import {
83
83
  compareVersion,
84
84
  parseVersion
@@ -87,7 +87,7 @@ import {
87
87
  getApiKey,
88
88
  getBaseUrl,
89
89
  isMalformedApiKeyError
90
- } from "./chunk-XGW4PJPO.js";
90
+ } from "./chunk-NEQMXQZQ.js";
91
91
  import {
92
92
  writeFileAtomic,
93
93
  writeJsonAtomicDurable
@@ -145,7 +145,7 @@ import {
145
145
  resolveAutoResolveOrigin,
146
146
  resolvePolicy,
147
147
  unansweredRefusalReason
148
- } from "./chunk-ULDUDSTW.js";
148
+ } from "./chunk-U33VHYHK.js";
149
149
 
150
150
  // src/pending.ts
151
151
  import { join } from "path";
@@ -1,13 +1,13 @@
1
1
  import {
2
2
  addGeminiMcpServer,
3
3
  removeGeminiMcpServer
4
- } from "./chunk-K6PBTBLO.js";
4
+ } from "./chunk-TJJEYS3S.js";
5
5
  import {
6
6
  CLAUDE_CODE_AGENT
7
- } from "./chunk-HDD23XYP.js";
7
+ } from "./chunk-SU3M242B.js";
8
8
  import {
9
9
  compatibleToolLookup
10
- } from "./chunk-WVJFHP75.js";
10
+ } from "./chunk-NSUIUOE7.js";
11
11
  import {
12
12
  CLAUDE_HOOK_EVENTS,
13
13
  PUSHARY_MCP_URL,
@@ -19,7 +19,7 @@ import {
19
19
  isPusharyHook,
20
20
  registerHookEntry,
21
21
  removeClaudeMcpServers
22
- } from "./chunk-FEVQDABQ.js";
22
+ } from "./chunk-74MBT2PL.js";
23
23
  import {
24
24
  AGENT_ENFORCEMENT,
25
25
  HOOK_COMPATIBLE_PROFILES,
@@ -32,7 +32,7 @@ import {
32
32
  pusharyMissingReason,
33
33
  refusalOutput,
34
34
  withHookHoldBudget
35
- } from "./chunk-ULDUDSTW.js";
35
+ } from "./chunk-U33VHYHK.js";
36
36
 
37
37
  // src/config-document.ts
38
38
  import { parse, stringify } from "smol-toml";
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  pusharyFetch
3
- } from "./chunk-OSDIFFSP.js";
3
+ } from "./chunk-FIIRS53K.js";
4
4
  import {
5
5
  getBaseUrl
6
- } from "./chunk-XGW4PJPO.js";
6
+ } from "./chunk-NEQMXQZQ.js";
7
7
  import {
8
8
  NetworkError
9
9
  } from "./chunk-CINBAX5G.js";
@@ -13,7 +13,7 @@ import {
13
13
  import {
14
14
  isValidApiKey,
15
15
  normalizeKeyScope
16
- } from "./chunk-ULDUDSTW.js";
16
+ } from "./chunk-U33VHYHK.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,9 +1,9 @@
1
1
  import {
2
2
  AGENT_CHOICES
3
- } from "./chunk-Z7LAWFZ7.js";
3
+ } from "./chunk-GNCOGELX.js";
4
4
  import {
5
5
  BELL_HOOK_BINARY
6
- } from "./chunk-5QLIXOVT.js";
6
+ } from "./chunk-P4ZXHSJX.js";
7
7
  import {
8
8
  CLAUDE_HOOK_EVENTS,
9
9
  CODEX_HOOK_EVENTS,
@@ -16,13 +16,13 @@ import {
16
16
  isBridgeLocator,
17
17
  isProtectedByScope,
18
18
  registerHookEntry
19
- } from "./chunk-FEVQDABQ.js";
19
+ } from "./chunk-74MBT2PL.js";
20
20
  import {
21
21
  CURSOR_GATE_EVENTS,
22
22
  HOOK_BUDGETS,
23
23
  HOOK_LOCATOR_BINARY,
24
24
  hookCommandHoldBudget
25
- } from "./chunk-ULDUDSTW.js";
25
+ } from "./chunk-U33VHYHK.js";
26
26
 
27
27
  // src/gemini-config.ts
28
28
  var GEMINI_HOOK_BINARY = "pushary-gemini-hook";
@@ -18,18 +18,18 @@ import {
18
18
  settingSnapshot,
19
19
  writeHermesSetting,
20
20
  writeSetupReceipt
21
- } from "./chunk-2QUYUFYQ.js";
21
+ } from "./chunk-HTDRJMP5.js";
22
22
  import {
23
23
  OPENCLAW_MIN_VERSION,
24
24
  OPENCLAW_PLUGIN_ID,
25
25
  OPENCLAW_PLUGIN_PACKAGE
26
- } from "./chunk-4QQ3HXGR.js";
26
+ } from "./chunk-4CUOYT5O.js";
27
27
  import {
28
28
  retryAgentCommand
29
- } from "./chunk-MHZSIN5K.js";
29
+ } from "./chunk-BX3VDXXW.js";
30
30
  import {
31
31
  configFilePath
32
- } from "./chunk-XGW4PJPO.js";
32
+ } from "./chunk-NEQMXQZQ.js";
33
33
  import {
34
34
  readJsonSafe,
35
35
  writeJsonAtomic
@@ -37,7 +37,7 @@ import {
37
37
  import {
38
38
  readSetupOutcomeProperties,
39
39
  redactSecretsFromContent
40
- } from "./chunk-ULDUDSTW.js";
40
+ } from "./chunk-U33VHYHK.js";
41
41
 
42
42
  // src/hermes/shell-gate.ts
43
43
  var readHermesShellGate = async (launcher) => {
@@ -4693,6 +4693,22 @@ var readSetupOutcomeProperties = (body) => {
4693
4693
  };
4694
4694
  var SETUP_STOPPED_PATH = "/api/agent/setup-stopped";
4695
4695
 
4696
+ // ../contracts/src/cli-local-confirm.ts
4697
+ var CLI_LOCAL_TERMINAL_PATH = "/api/cli/auth/local";
4698
+ var CLI_LOCAL_BIND_PATH = "/api/cli/auth/bind";
4699
+ var LOCAL_CONFIRM_HOST = "127.0.0.1";
4700
+ var LOCAL_CONFIRM_PATH = "/confirm";
4701
+ var LOCAL_CONFIRM_STATE_PARAM = "state";
4702
+ var LOCAL_CONFIRM_NONCE_PARAM = "nonce";
4703
+ var LOCAL_TERMINAL_ENTRY_PARAM = "listener";
4704
+ var CONFIRMED_TERMINAL_PARAM = "terminal";
4705
+ var LOCAL_CONFIRM_TOKEN_PATTERN = /^[A-Za-z0-9_-]{32,64}$/;
4706
+ var isLocalConfirmToken = (value) => typeof value === "string" && LOCAL_CONFIRM_TOKEN_PATTERN.test(value);
4707
+ var LOCAL_TERMINAL_VALUE_SEPARATOR = ".";
4708
+ var localTerminalValue = (terminal) => `${terminal.port}${LOCAL_TERMINAL_VALUE_SEPARATOR}${terminal.state}`;
4709
+ var localTerminalEntryUrl = (baseUrl, terminal) => `${baseUrl.replace(/\/+$/, "")}${CLI_LOCAL_TERMINAL_PATH}?${LOCAL_TERMINAL_ENTRY_PARAM}=${localTerminalValue(terminal)}`;
4710
+ var confirmedTerminalUrl = (authorizeUrl, nonce) => `${authorizeUrl}?${new URLSearchParams({ [CONFIRMED_TERMINAL_PARAM]: nonce })}`;
4711
+
4696
4712
  // ../contracts/src/policy-capabilities.ts
4697
4713
  var POLICY_REQUEST_CAPABILITIES_HEADER = "x-pushary-policy-capabilities";
4698
4714
  var POLICY_REQUEST_CAPABILITY = {
@@ -11391,6 +11407,14 @@ export {
11391
11407
  isSetupConnectMode,
11392
11408
  readSetupOutcomeProperties,
11393
11409
  SETUP_STOPPED_PATH,
11410
+ CLI_LOCAL_BIND_PATH,
11411
+ LOCAL_CONFIRM_HOST,
11412
+ LOCAL_CONFIRM_PATH,
11413
+ LOCAL_CONFIRM_STATE_PARAM,
11414
+ LOCAL_CONFIRM_NONCE_PARAM,
11415
+ isLocalConfirmToken,
11416
+ localTerminalEntryUrl,
11417
+ confirmedTerminalUrl,
11394
11418
  POLICY_REQUEST_CAPABILITIES_HEADER,
11395
11419
  CLI_POLICY_REQUEST_CAPABILITIES,
11396
11420
  policyRequestCapabilitiesHeaderValue,
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  isSafeReadOnlyCommand
3
- } from "./chunk-ULDUDSTW.js";
3
+ } from "./chunk-U33VHYHK.js";
4
4
 
5
5
  // src/ledger.ts
6
6
  import { appendFileSync, existsSync, mkdirSync, readFileSync, renameSync, rmSync, statSync } from "fs";
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  configFilePath
3
- } from "./chunk-XGW4PJPO.js";
3
+ } from "./chunk-NEQMXQZQ.js";
4
4
  import {
5
5
  normalizeInstallSource
6
- } from "./chunk-ULDUDSTW.js";
6
+ } from "./chunk-U33VHYHK.js";
7
7
 
8
8
  // src/install-source.ts
9
9
  import { readFileSync } from "fs";
@@ -1,13 +1,13 @@
1
1
  import {
2
2
  pusharyHookExecutable
3
- } from "./chunk-K6PBTBLO.js";
3
+ } from "./chunk-TJJEYS3S.js";
4
4
  import {
5
5
  bridgeResolvesToApp,
6
6
  cursorUserHooks,
7
7
  executableFileName,
8
8
  isBridgeLocator,
9
9
  liveBridgeProbe
10
- } from "./chunk-FEVQDABQ.js";
10
+ } from "./chunk-74MBT2PL.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-ULDUDSTW.js";
24
+ } from "./chunk-U33VHYHK.js";
25
25
 
26
26
  // src/cursor-gate-registration.ts
27
27
  import { dirname, isAbsolute, join, resolve } from "path";
@@ -9,14 +9,96 @@ import {
9
9
  } from "./chunk-3EGEA4KH.js";
10
10
  import {
11
11
  getBaseUrl
12
- } from "./chunk-XGW4PJPO.js";
12
+ } from "./chunk-NEQMXQZQ.js";
13
+ import {
14
+ CLI_LOCAL_BIND_PATH,
15
+ LOCAL_CONFIRM_HOST,
16
+ LOCAL_CONFIRM_NONCE_PARAM,
17
+ LOCAL_CONFIRM_PATH,
18
+ LOCAL_CONFIRM_STATE_PARAM,
19
+ confirmedTerminalUrl,
20
+ isLocalConfirmToken,
21
+ localTerminalEntryUrl
22
+ } from "./chunk-U33VHYHK.js";
13
23
 
14
24
  // src/cli/login-ui.ts
15
25
  import { hostname } from "os";
16
26
 
27
+ // src/cli/local-confirm.ts
28
+ import { createHash, randomBytes, timingSafeEqual } from "crypto";
29
+ import { createServer } from "http";
30
+ var STATE_BYTES = 24;
31
+ var ANY_FREE_PORT = 0;
32
+ var newLocalConfirmState = () => randomBytes(STATE_BYTES).toString("base64url");
33
+ var localConfirmStateHash = (state) => createHash("sha256").update(state).digest("hex");
34
+ var sameState = (expected, given) => {
35
+ const expectedBytes = Buffer.from(expected);
36
+ const givenBytes = Buffer.from(given);
37
+ return expectedBytes.length === givenBytes.length && timingSafeEqual(expectedBytes, givenBytes);
38
+ };
39
+ var redirectTo = (response, location) => {
40
+ response.writeHead(302, { Location: location, "Cache-Control": "no-store", "Referrer-Policy": "no-referrer" });
41
+ response.end();
42
+ };
43
+ var confirmUrlOf = (request) => {
44
+ try {
45
+ return new URL(request.url ?? "/", `http://${LOCAL_CONFIRM_HOST}`);
46
+ } catch {
47
+ return null;
48
+ }
49
+ };
50
+ var notFound = (response) => {
51
+ response.writeHead(404, { "Cache-Control": "no-store" });
52
+ response.end();
53
+ };
54
+ var listenForLocalConfirm = (options) => new Promise((resolve) => {
55
+ const state = options.state;
56
+ let confirmed = false;
57
+ let binding = false;
58
+ let listeningOn = "";
59
+ const answer = async (request, response) => {
60
+ const url = confirmUrlOf(request);
61
+ if (url === null) return notFound(response);
62
+ if (request.method !== "GET" || url.pathname !== LOCAL_CONFIRM_PATH || request.headers.host !== listeningOn) return notFound(response);
63
+ const nonce = url.searchParams.get(LOCAL_CONFIRM_NONCE_PARAM);
64
+ if (!sameState(state, url.searchParams.get(LOCAL_CONFIRM_STATE_PARAM) ?? "")) return notFound(response);
65
+ if (confirmed || binding || !isLocalConfirmToken(nonce)) return redirectTo(response, options.authorizeUrl);
66
+ binding = true;
67
+ const bound = await options.bind(nonce).catch(() => false);
68
+ binding = false;
69
+ if (bound) confirmed = true;
70
+ redirectTo(response, bound ? confirmedTerminalUrl(options.authorizeUrl, nonce) : options.authorizeUrl);
71
+ };
72
+ const server = createServer((request, response) => {
73
+ answer(request, response).catch(() => {
74
+ if (!response.headersSent) notFound(response);
75
+ else response.end();
76
+ });
77
+ });
78
+ server.once("error", () => resolve(null));
79
+ server.listen(ANY_FREE_PORT, LOCAL_CONFIRM_HOST, () => {
80
+ const address = server.address();
81
+ if (address === null || typeof address === "string") {
82
+ server.close();
83
+ return resolve(null);
84
+ }
85
+ listeningOn = `${LOCAL_CONFIRM_HOST}:${address.port}`;
86
+ server.unref();
87
+ resolve({
88
+ terminal: { port: address.port, state },
89
+ confirmed: () => confirmed,
90
+ close: () => {
91
+ server.close();
92
+ server.closeAllConnections();
93
+ }
94
+ });
95
+ });
96
+ });
97
+
17
98
  // src/cli/login.ts
18
99
  var START_PATH = "/api/cli/auth/start";
19
100
  var CLAIM_PATH = "/api/cli/auth/claim";
101
+ var LOGIN_COMMAND_REQUEST = { command: "login" };
20
102
  var DEFAULT_TIMEOUT_MS = 1e4;
21
103
  var post = async (url, body, fetchImpl) => fetchImpl(url, {
22
104
  method: "POST",
@@ -26,15 +108,21 @@ var post = async (url, body, fetchImpl) => fetchImpl(url, {
26
108
  });
27
109
  var asString = (value) => typeof value === "string" && value ? value : null;
28
110
  var asNumber = (value, fallback) => typeof value === "number" && Number.isFinite(value) ? value : fallback;
29
- var startLogin = async (machineLabel, cliVersion, deps = {}) => {
111
+ var startLogin = async (machineLabel, cliVersion, deps = {}, request = LOGIN_COMMAND_REQUEST) => {
30
112
  const fetchImpl = deps.fetchImpl ?? fetch;
31
113
  const baseUrl = deps.baseUrl ?? getBaseUrl();
32
- const keypair = generateKeypair();
114
+ const keypair = request.keypair ?? generateKeypair();
33
115
  let response;
34
116
  try {
35
117
  response = await post(
36
118
  `${baseUrl}${START_PATH}`,
37
- { cliPublicKey: keypair.publicKeyB64, machineLabel, cliVersion },
119
+ {
120
+ cliPublicKey: keypair.publicKeyB64,
121
+ machineLabel,
122
+ cliVersion,
123
+ command: request.command,
124
+ ...request.localConfirmStateHash === void 0 ? {} : { localConfirmStateHash: request.localConfirmStateHash }
125
+ },
38
126
  fetchImpl
39
127
  );
40
128
  } catch (err) {
@@ -63,7 +151,8 @@ var startLogin = async (machineLabel, cliVersion, deps = {}) => {
63
151
  intervalMs: Math.max(1, asNumber(body.interval, 2)) * 1e3,
64
152
  expiresInSeconds: Math.max(1, asNumber(body.expiresInSeconds, 900)),
65
153
  fingerprint: asString(body.fingerprint) ?? publicKeyFingerprint(keypair.publicKeyB64),
66
- keypair
154
+ keypair,
155
+ localConfirm: request.localConfirmStateHash !== void 0 && body.localConfirm === true
67
156
  }
68
157
  };
69
158
  };
@@ -112,6 +201,11 @@ var pollOnce = async (start, deps = {}) => {
112
201
  return { kind: "pending", expiresInSeconds: asNumber(body.expiresInSeconds, 0) };
113
202
  }
114
203
  };
204
+ var settlesWhenAborted = (signal) => new Promise((resolve) => {
205
+ if (signal === void 0) return;
206
+ if (signal.aborted) return resolve();
207
+ signal.addEventListener("abort", () => resolve(), { once: true });
208
+ });
115
209
  var waitForLogin = async (start, handlers = {}, deps = {}) => {
116
210
  const now = deps.now ?? Date.now;
117
211
  const sleep = deps.sleep ?? ((ms) => new Promise((resolve) => setTimeout(resolve, ms)));
@@ -119,7 +213,10 @@ var waitForLogin = async (start, handlers = {}, deps = {}) => {
119
213
  let polls = 0;
120
214
  let consecutiveFailures = 0;
121
215
  const noticed = /* @__PURE__ */ new Set();
216
+ const aborted = settlesWhenAborted(handlers.signal);
217
+ const stopped = () => handlers.signal?.aborted === true;
122
218
  while (now() < deadline) {
219
+ if (stopped()) return { state: { kind: "stopped" }, polls };
123
220
  const state = await pollOnce(start, deps);
124
221
  polls += 1;
125
222
  if (state.kind === "authorized" || state.kind === "rejected" || state.kind === "expired") {
@@ -139,10 +236,24 @@ var waitForLogin = async (start, handlers = {}, deps = {}) => {
139
236
  }
140
237
  }
141
238
  handlers.onTick?.(state, Math.max(0, Math.ceil((deadline - now()) / 1e3)));
142
- await sleep(start.intervalMs);
239
+ await Promise.race([sleep(start.intervalMs), aborted]);
143
240
  }
144
241
  return { state: { kind: "expired" }, polls };
145
242
  };
243
+ var bindLocalTerminal = async (start, nonce, deps = {}) => {
244
+ const fetchImpl = deps.fetchImpl ?? fetch;
245
+ const baseUrl = deps.baseUrl ?? getBaseUrl();
246
+ try {
247
+ const response = await post(
248
+ `${baseUrl}${CLI_LOCAL_BIND_PATH}`,
249
+ { loginId: start.loginId, cliPublicKey: start.keypair.publicKeyB64, nonce },
250
+ fetchImpl
251
+ );
252
+ return response.ok;
253
+ } catch {
254
+ return false;
255
+ }
256
+ };
146
257
  var cancelLogin = async (start, deps = {}) => {
147
258
  const fetchImpl = deps.fetchImpl ?? fetch;
148
259
  const baseUrl = deps.baseUrl ?? getBaseUrl();
@@ -158,8 +269,38 @@ var cancelLogin = async (start, deps = {}) => {
158
269
  };
159
270
 
160
271
  // src/cli/login-ui.ts
272
+ var printLoginNotice = (ui, state, mayOpenBrowser) => {
273
+ if (state.kind === "needs-workspace") {
274
+ ui.say(` ${ui.yellow("!")} Waiting on a workspace. Finish creating one in the browser and this continues on its own.`);
275
+ } else if (state.kind === "payment-required") {
276
+ ui.say(` ${ui.yellow("!")} A plan is needed before a key can be issued. Nothing was created yet.`);
277
+ ui.say(` ${ui.dim("Choose one at")} ${ui.cyan(state.checkoutUrl)}`);
278
+ ui.say(` ${ui.dim("Keep the browser tab open and this finishes on its own once the plan is active.")}`);
279
+ ui.say(` ${ui.dim("If you closed it, reopen the page and enter the same code again.")}`);
280
+ if (mayOpenBrowser) openInBrowser(state.checkoutUrl);
281
+ } else if (state.kind === "unreachable") {
282
+ ui.say(` ${ui.yellow("!")} Still trying. pushary.com is not answering ${ui.dim(`(${state.detail})`)}`);
283
+ }
284
+ };
285
+ var originOf = (url) => {
286
+ try {
287
+ return new URL(url).origin;
288
+ } catch {
289
+ return null;
290
+ }
291
+ };
292
+ var browserEntryUrl = (start, listener) => {
293
+ const origin = originOf(start.verificationUrl);
294
+ return listener === null || origin === null ? start.verificationUrl : localTerminalEntryUrl(origin, listener.terminal);
295
+ };
296
+ var listenForThisTerminal = async (start, state, deps) => start.localConfirm ? listenForLocalConfirm({ authorizeUrl: start.verificationUrl, state, bind: (nonce) => bindLocalTerminal(start, nonce, deps) }) : null;
161
297
  var runBrowserLogin = async (ui, options, deps = {}) => {
162
- const started = await startLogin(hostname(), options.cliVersion, deps);
298
+ const mayOpenBrowser = !options.noBrowser && canOpenBrowser();
299
+ const localState = newLocalConfirmState();
300
+ const started = await startLogin(hostname(), options.cliVersion, deps, {
301
+ command: options.command ?? "login",
302
+ ...mayOpenBrowser ? { localConfirmStateHash: localConfirmStateHash(localState) } : {}
303
+ });
163
304
  if (started.kind === "rate-limited") {
164
305
  return { kind: "unavailable", detail: `too many attempts, retry in ${started.retryAfterSeconds}s` };
165
306
  }
@@ -179,6 +320,7 @@ var runBrowserLogin = async (ui, options, deps = {}) => {
179
320
  };
180
321
  process.on("SIGINT", onSignal);
181
322
  process.on("SIGHUP", onSignal);
323
+ let listener = null;
182
324
  try {
183
325
  ui.say("");
184
326
  ui.say(` ${ui.bold("Sign in to Pushary")}`);
@@ -189,22 +331,11 @@ var runBrowserLogin = async (ui, options, deps = {}) => {
189
331
  ui.say(` ${ui.dim(`This terminal shows fingerprint ${start.fingerprint}. The page shows the same one.`)}`);
190
332
  ui.say(` ${ui.dim("The code is only on your screen. Nobody can send you a link that fills it in.")}`);
191
333
  ui.say("");
192
- if (!options.noBrowser && canOpenBrowser() && openInBrowser(start.verificationUrl)) {
334
+ listener = mayOpenBrowser ? await listenForThisTerminal(start, localState, deps) : null;
335
+ if (mayOpenBrowser && openInBrowser(browserEntryUrl(start, listener))) {
193
336
  ui.say(` ${ui.dim("Opened your browser.")}`);
194
337
  }
195
- const notice = (state2) => {
196
- if (state2.kind === "needs-workspace") {
197
- ui.say(` ${ui.yellow("!")} Waiting on a workspace. Finish creating one in the browser and this continues on its own.`);
198
- } else if (state2.kind === "payment-required") {
199
- ui.say(` ${ui.yellow("!")} A plan is needed before a key can be issued. Nothing was created yet.`);
200
- ui.say(` ${ui.dim("Choose one at")} ${ui.cyan(state2.checkoutUrl)}`);
201
- ui.say(` ${ui.dim("Keep the browser tab open and this finishes on its own once the plan is active.")}`);
202
- ui.say(` ${ui.dim("If you closed it, reopen the page and enter the same code again.")}`);
203
- if (!options.noBrowser && canOpenBrowser()) openInBrowser(state2.checkoutUrl);
204
- } else if (state2.kind === "unreachable") {
205
- ui.say(` ${ui.yellow("!")} Still trying. pushary.com is not answering ${ui.dim(`(${state2.detail})`)}`);
206
- }
207
- };
338
+ const notice = (state2) => printLoginNotice(ui, state2, mayOpenBrowser);
208
339
  const { state } = await waitForLogin(start, { onNotice: notice }, deps);
209
340
  if (state.kind === "authorized") {
210
341
  return {
@@ -217,11 +348,21 @@ var runBrowserLogin = async (ui, options, deps = {}) => {
217
348
  if (state.kind === "rejected") return { kind: "rejected" };
218
349
  return { kind: "expired" };
219
350
  } finally {
351
+ listener?.close();
220
352
  process.off("SIGINT", onSignal);
221
353
  process.off("SIGHUP", onSignal);
222
354
  }
223
355
  };
224
356
 
225
357
  export {
358
+ newLocalConfirmState,
359
+ localConfirmStateHash,
360
+ startLogin,
361
+ pollOnce,
362
+ waitForLogin,
363
+ cancelLogin,
364
+ printLoginNotice,
365
+ browserEntryUrl,
366
+ listenForThisTerminal,
226
367
  runBrowserLogin
227
368
  };
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  canonicalGateInputs,
3
3
  patchDeletesFiles
4
- } from "./chunk-WVJFHP75.js";
4
+ } from "./chunk-NSUIUOE7.js";
5
5
 
6
6
  // src/gate-call-reading.ts
7
7
  var gateCallReadingOf = (profile, raw) => {
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  shouldDeferToNativeMode
3
- } from "./chunk-ULDUDSTW.js";
3
+ } from "./chunk-U33VHYHK.js";
4
4
 
5
5
  // src/native-defer.ts
6
6
  var nativeDeferOptions = () => {
@@ -4,10 +4,10 @@ import {
4
4
  } from "./chunk-P6DUWKAO.js";
5
5
  import {
6
6
  fetchAsCredential
7
- } from "./chunk-NDXTGRZG.js";
7
+ } from "./chunk-J65WHWPK.js";
8
8
  import {
9
9
  getBaseUrl
10
- } from "./chunk-XGW4PJPO.js";
10
+ } from "./chunk-NEQMXQZQ.js";
11
11
  import {
12
12
  writeJsonAtomicDurable
13
13
  } from "./chunk-PM2NRK6Y.js";
@@ -15,7 +15,7 @@ import {
15
15
  compressTranscriptRecord,
16
16
  redactSecretsFromContent,
17
17
  transcriptRecordPlaintext
18
- } from "./chunk-ULDUDSTW.js";
18
+ } from "./chunk-U33VHYHK.js";
19
19
 
20
20
  // src/transcript-recipient-pin.ts
21
21
  import { createHash } from "crypto";
@@ -1,22 +1,22 @@
1
1
  import {
2
2
  cursorGateOwnsClaudeCall,
3
3
  readCursorGateRegistration
4
- } from "./chunk-UIBQDALO.js";
4
+ } from "./chunk-UODLZ2D6.js";
5
5
  import {
6
6
  registerTranscript
7
- } from "./chunk-VPG6QENY.js";
7
+ } from "./chunk-LZYSSSF3.js";
8
8
  import {
9
9
  namedEvent
10
- } from "./chunk-FMWG4X3D.js";
10
+ } from "./chunk-T5OA2WR7.js";
11
11
  import {
12
12
  writeDegraded
13
- } from "./chunk-A2GO3G2I.js";
13
+ } from "./chunk-HB4BB66C.js";
14
14
  import {
15
15
  claudeShapedHookInput,
16
16
  hookCompatibleProfileBySource,
17
17
  isGrokHookPayload,
18
18
  isGrokSessionEndStop
19
- } from "./chunk-ULDUDSTW.js";
19
+ } from "./chunk-U33VHYHK.js";
20
20
 
21
21
  // src/tool-hook-input.ts
22
22
  var OPTIONAL_TEXT_FIELDS = ["hook_event_name", "session_id", "cwd", "transcript_path", "tool_use_id", "permission_mode", "cursor_version"];
@@ -1,11 +1,11 @@
1
1
  import {
2
2
  autoUpdateLock
3
- } from "./chunk-FEVQDABQ.js";
3
+ } from "./chunk-74MBT2PL.js";
4
4
  import {
5
5
  installPackageGlobally,
6
6
  npmErrorMessage,
7
7
  throwIfNpmRefusesInstall
8
- } from "./chunk-JFXYGMV5.js";
8
+ } from "./chunk-OHMC3ZFE.js";
9
9
  import {
10
10
  writeJsonAtomic
11
11
  } from "./chunk-PM2NRK6Y.js";