pushary 1.9.23 → 1.9.25

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 (105) hide show
  1. package/CHANGELOG.md +15 -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/pushary-gate.mjs +4 -2
  5. package/data/cursor-plugin/scripts/pushary-gate.test.mjs +14 -1
  6. package/dist/bin/pushary-bell-hook.js +25 -25
  7. package/dist/bin/pushary-bell.js +9 -9
  8. package/dist/bin/pushary-claude.js +27 -26
  9. package/dist/bin/pushary-clean.js +41 -93
  10. package/dist/bin/pushary-codex-bridge.js +17 -17
  11. package/dist/bin/pushary-codex-hook.js +30 -30
  12. package/dist/bin/pushary-codex.js +12 -12
  13. package/dist/bin/pushary-connect.js +24 -24
  14. package/dist/bin/pushary-cowork.js +5 -5
  15. package/dist/bin/pushary-daemon.js +31 -31
  16. package/dist/bin/pushary-disconnect.js +24 -24
  17. package/dist/bin/pushary-doctor.js +33 -33
  18. package/dist/bin/pushary-elicitation-hook.js +25 -25
  19. package/dist/bin/pushary-gemini-bridge.js +13 -13
  20. package/dist/bin/pushary-gemini-hook.js +27 -27
  21. package/dist/bin/pushary-hook.js +29 -29
  22. package/dist/bin/pushary-login.js +16 -16
  23. package/dist/bin/pushary-logout.js +77 -26
  24. package/dist/bin/pushary-mcp.js +9 -9
  25. package/dist/bin/pushary-mode.js +12 -12
  26. package/dist/bin/pushary-notification-hook.js +24 -24
  27. package/dist/bin/pushary-opencode-hook.js +26 -26
  28. package/dist/bin/pushary-permission-denied-hook.js +29 -29
  29. package/dist/bin/pushary-permission-hook.js +28 -28
  30. package/dist/bin/pushary-post-hook.js +24 -24
  31. package/dist/bin/pushary-prompt-hook.js +24 -24
  32. package/dist/bin/pushary-session-end-hook.js +24 -24
  33. package/dist/bin/pushary-session-start-hook.js +28 -28
  34. package/dist/bin/pushary-setup.js +41 -38
  35. package/dist/bin/pushary-stats.js +5 -5
  36. package/dist/bin/pushary-status.js +26 -26
  37. package/dist/bin/pushary-stop-hook.js +24 -24
  38. package/dist/bin/pushary-stopfailure-hook.js +24 -24
  39. package/dist/bin/pushary-suggestions.js +12 -12
  40. package/dist/bin/pushary-transcript-register.js +17 -17
  41. package/dist/bin/pushary-transcripts.js +7 -7
  42. package/dist/bin/pushary-upgrade.js +30 -30
  43. package/dist/bin/pushary-wait.js +12 -12
  44. package/dist/bin/pushary.js +6 -6
  45. package/dist/{chunk-GN6BJXC7.js → chunk-2CUE3XXS.js} +1 -1
  46. package/dist/{chunk-OH6OGEOY.js → chunk-2J2WFX7X.js} +4 -4
  47. package/dist/{chunk-QIODXPTP.js → chunk-2VQZC6DW.js} +4 -4
  48. package/dist/{chunk-SWQLZQE3.js → chunk-2XHBYMVN.js} +14 -13
  49. package/dist/{chunk-HXZG5WHU.js → chunk-3UYMOWX6.js} +2 -2
  50. package/dist/{chunk-R5C3QCVT.js → chunk-4KZP4YMV.js} +1 -1
  51. package/dist/{chunk-73HGV4R6.js → chunk-5ETE7F45.js} +2 -2
  52. package/dist/{chunk-OQPEHKH2.js → chunk-5Q2QJ2AL.js} +1 -1
  53. package/dist/{chunk-K2EYK5RL.js → chunk-5WTEKIAS.js} +4 -4
  54. package/dist/{chunk-AV5VX7OK.js → chunk-7UZD2F4Y.js} +8 -8
  55. package/dist/{chunk-E2LGKG75.js → chunk-7V6PJFDF.js} +3 -3
  56. package/dist/{chunk-KJA6IGOZ.js → chunk-A3QQWXIE.js} +1 -1
  57. package/dist/{chunk-GYP6DLA4.js → chunk-AXB4ABUD.js} +8 -8
  58. package/dist/{chunk-I46QTKYI.js → chunk-BGJDOHNF.js} +5 -5
  59. package/dist/{chunk-FBV2KS3Z.js → chunk-BHRMHDOO.js} +2 -2
  60. package/dist/{chunk-RN5NRRHX.js → chunk-EJJNZYDS.js} +2 -2
  61. package/dist/{chunk-6HT2TUZD.js → chunk-EJMXZH5E.js} +2 -2
  62. package/dist/{chunk-N4DMADJM.js → chunk-FCXYDR62.js} +1 -1
  63. package/dist/{chunk-ZGYO6OQE.js → chunk-FJKV64M7.js} +5 -5
  64. package/dist/{chunk-QFNY4KUQ.js → chunk-FLC4TVXH.js} +1 -1
  65. package/dist/{chunk-NHBPW6C4.js → chunk-G446AVR5.js} +2 -2
  66. package/dist/{chunk-AQ3TSQA2.js → chunk-GC5HJE3T.js} +21 -8
  67. package/dist/{chunk-CJTQNUUT.js → chunk-HEJMZVJI.js} +2 -2
  68. package/dist/{chunk-OH647UT3.js → chunk-KGSN2SOL.js} +793 -18
  69. package/dist/{chunk-7RGEJOQS.js → chunk-KM7AEGKF.js} +3 -3
  70. package/dist/{chunk-FIYCICHC.js → chunk-KP4BIZLP.js} +2 -2
  71. package/dist/{chunk-YXHVMZPR.js → chunk-KZLOVLA6.js} +4 -4
  72. package/dist/{chunk-AXSHPFU3.js → chunk-LDNKGG5G.js} +3 -3
  73. package/dist/{chunk-DKBPNHAI.js → chunk-N3ACK3YA.js} +4 -4
  74. package/dist/{chunk-4GKQDFH6.js → chunk-NFH2H7PD.js} +5 -5
  75. package/dist/{chunk-BY5EKA6W.js → chunk-OFHSTCXK.js} +3 -3
  76. package/dist/{chunk-LEQRIJ4H.js → chunk-OOKIWOMK.js} +3 -3
  77. package/dist/{chunk-7J2AX5T6.js → chunk-OWOSNGEQ.js} +2 -2
  78. package/dist/{chunk-SSWK2WYX.js → chunk-PAMW5M53.js} +5 -5
  79. package/dist/{chunk-JNKHCGHR.js → chunk-PM2WJSUH.js} +1 -1
  80. package/dist/{chunk-JCEUDLGW.js → chunk-PPGLIWOR.js} +1 -1
  81. package/dist/{chunk-PFB7P4F3.js → chunk-PSNF27BC.js} +6 -6
  82. package/dist/{chunk-2AUKCSLQ.js → chunk-Q37XFSPO.js} +4 -4
  83. package/dist/{chunk-S2R2U5W5.js → chunk-RSENVGBQ.js} +4 -4
  84. package/dist/{chunk-M7DCI44L.js → chunk-SGGR5MN2.js} +1 -1
  85. package/dist/{chunk-NSCETODW.js → chunk-TLUSUDRU.js} +1 -1
  86. package/dist/chunk-UJB6HHP4.js +166 -0
  87. package/dist/{chunk-YZPFJCFE.js → chunk-UK7OY3EJ.js} +1 -1
  88. package/dist/{chunk-ISAKLEKE.js → chunk-UUOC7A7M.js} +7 -7
  89. package/dist/{chunk-Z4UDB7EC.js → chunk-VEGS4NYF.js} +3 -3
  90. package/dist/{chunk-USUI4P63.js → chunk-VFF7ZBIS.js} +2 -2
  91. package/dist/{chunk-RHIKMNWJ.js → chunk-VN5Q4KOD.js} +2 -2
  92. package/dist/{chunk-6GHZAS7S.js → chunk-WEKXYS2F.js} +4 -4
  93. package/dist/{chunk-SLBO7PHS.js → chunk-WKEP4JAW.js} +2 -2
  94. package/dist/{chunk-M6R3SZZS.js → chunk-YD3DIFIU.js} +1 -1
  95. package/dist/{chunk-EDN4F6GX.js → chunk-ZLGCNHJG.js} +1 -1
  96. package/dist/{chunk-A5U62Q6K.js → chunk-ZLY7BHN4.js} +5 -5
  97. package/dist/{chunk-AFP3HZVK.js → chunk-ZNT4ZZXJ.js} +1 -1
  98. package/dist/{chunk-XBETSM5T.js → chunk-ZV3262AA.js} +3 -3
  99. package/dist/{global-upgrade-SKY7A3SI.js → global-upgrade-4M4TJKQR.js} +6 -6
  100. package/dist/{paths-XUUEK7OU.js → paths-6JY6J56N.js} +2 -2
  101. package/dist/{reapply-WQDP26EA.js → reapply-LFEQ5GF6.js} +20 -20
  102. package/dist/src/index.js +19 -19
  103. package/dist/{upgrade-lock-AYW3TB7X.js → upgrade-lock-CZRCHYVU.js} +3 -3
  104. package/package.json +1 -1
  105. package/dist/chunk-OYIN77HO.js +0 -72
@@ -1,20 +1,20 @@
1
1
  import {
2
2
  defersToNativeMode,
3
3
  reportMachineDenial
4
- } from "./chunk-FBV2KS3Z.js";
4
+ } from "./chunk-BHRMHDOO.js";
5
5
  import {
6
6
  isGatingMoment,
7
7
  recordKeylessMoment
8
- } from "./chunk-GN6BJXC7.js";
8
+ } from "./chunk-2CUE3XXS.js";
9
9
  import {
10
10
  announceSubscriptionRequired,
11
11
  isDeferAnswer,
12
12
  oncePerSession
13
- } from "./chunk-M7DCI44L.js";
13
+ } from "./chunk-SGGR5MN2.js";
14
14
  import {
15
15
  activeHookSource,
16
16
  activeIdentity
17
- } from "./chunk-K2EYK5RL.js";
17
+ } from "./chunk-5WTEKIAS.js";
18
18
  import {
19
19
  DEFAULT_SESSION,
20
20
  UNNAMED_ACTION,
@@ -39,7 +39,7 @@ import {
39
39
  reportEvent,
40
40
  scopePathFor,
41
41
  settleQuestionsForToolUse
42
- } from "./chunk-GYP6DLA4.js";
42
+ } from "./chunk-AXB4ABUD.js";
43
43
  import {
44
44
  askUser,
45
45
  cancelQuestion,
@@ -51,20 +51,20 @@ import {
51
51
  sendNotification,
52
52
  waitForQuestion,
53
53
  waitsForThePhone
54
- } from "./chunk-4GKQDFH6.js";
54
+ } from "./chunk-NFH2H7PD.js";
55
55
  import {
56
56
  SubscriptionRequiredError
57
- } from "./chunk-E2LGKG75.js";
57
+ } from "./chunk-7V6PJFDF.js";
58
58
  import {
59
59
  getMachineId
60
- } from "./chunk-EDN4F6GX.js";
60
+ } from "./chunk-ZLGCNHJG.js";
61
61
  import {
62
62
  getApiKey,
63
63
  getBaseUrl
64
- } from "./chunk-OQPEHKH2.js";
64
+ } from "./chunk-5Q2QJ2AL.js";
65
65
  import {
66
66
  NPX_LATEST_COMMAND
67
- } from "./chunk-LEQRIJ4H.js";
67
+ } from "./chunk-OOKIWOMK.js";
68
68
  import {
69
69
  AGENT_QUESTION_STRATEGY,
70
70
  DECISION_STOP_REASON,
@@ -104,8 +104,9 @@ import {
104
104
  parseAgentQuestionAnswers,
105
105
  parseAgentQuestions,
106
106
  questionHandedToTheTerminal,
107
- resolveGate
108
- } from "./chunk-OH647UT3.js";
107
+ resolveGate,
108
+ timeoutActionWithoutLocalPrompt
109
+ } from "./chunk-KGSN2SOL.js";
109
110
 
110
111
  // src/claude-permission-rules.ts
111
112
  import { readFileSync, statSync } from "fs";
@@ -345,7 +346,7 @@ var dispatchModeHandler = async (apiKey, input, toolPolicy, machineId, trainingC
345
346
  const runHandler = () => {
346
347
  switch (ownPrompt ? toolPolicy.mode : approvalModeWithoutLocalPrompt(toolPolicy.mode)) {
347
348
  case "push_only":
348
- return handlePushOnly(apiKey, description, projectName, toolPolicy.timeoutSeconds, toolPolicy.timeoutAction, sessionId, machineId, input.tool_name, toolTarget, decision, signals);
349
+ return handlePushOnly(apiKey, description, projectName, toolPolicy.timeoutSeconds, ownPrompt ? toolPolicy.timeoutAction : timeoutActionWithoutLocalPrompt(toolPolicy), sessionId, machineId, input.tool_name, toolTarget, decision, signals);
349
350
  case "terminal_only":
350
351
  return Promise.resolve(handleTerminalOnly());
351
352
  case "push_first":
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  CODEX_HOOK_STATUS
3
- } from "./chunk-RHIKMNWJ.js";
3
+ } from "./chunk-VN5Q4KOD.js";
4
4
  import {
5
5
  NPX_LATEST_COMMAND
6
- } from "./chunk-LEQRIJ4H.js";
6
+ } from "./chunk-OOKIWOMK.js";
7
7
 
8
8
  // src/setup/codex-trust.ts
9
9
  var CODEX_TRUST_TELEMETRY = {
@@ -10,7 +10,7 @@ import {
10
10
  isSetupConnectMode,
11
11
  isValidApiKey,
12
12
  normalizeAgentId
13
- } from "./chunk-OH647UT3.js";
13
+ } from "./chunk-KGSN2SOL.js";
14
14
 
15
15
  // src/setup/options.ts
16
16
  var AGENT_CHOICES = SETUP_AGENT_CHOICES;
@@ -3,11 +3,11 @@ import {
3
3
  decodePublicKey,
4
4
  generateSessionKey,
5
5
  wrapSessionKey
6
- } from "./chunk-N4DMADJM.js";
6
+ } from "./chunk-FCXYDR62.js";
7
7
  import {
8
8
  fetchTranscriptRecipients,
9
9
  uploadTranscriptRecords
10
- } from "./chunk-QFNY4KUQ.js";
10
+ } from "./chunk-FLC4TVXH.js";
11
11
 
12
12
  // src/live-session.ts
13
13
  var MAX_TRANSCRIPT_QUEUE = 100;
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  NPX_LATEST_COMMAND
3
- } from "./chunk-LEQRIJ4H.js";
3
+ } from "./chunk-OOKIWOMK.js";
4
4
 
5
5
  // src/config.ts
6
6
  import { readFileSync } from "fs";
@@ -3,18 +3,18 @@ import {
3
3
  addGeminiMcpServer,
4
4
  removeGeminiMcpServer,
5
5
  supportedClaudeEvents
6
- } from "./chunk-7RGEJOQS.js";
6
+ } from "./chunk-KM7AEGKF.js";
7
7
  import {
8
8
  CLAUDE_CODE_AGENT,
9
9
  parseApplyPatchFiles
10
- } from "./chunk-GYP6DLA4.js";
10
+ } from "./chunk-AXB4ABUD.js";
11
11
  import {
12
12
  guardBinary,
13
13
  guardBinaryRefusing,
14
14
  holdBudgetOf,
15
15
  isProtectedByScope,
16
16
  registerHookEntry
17
- } from "./chunk-QIODXPTP.js";
17
+ } from "./chunk-2VQZC6DW.js";
18
18
  import {
19
19
  HOOK_LOCATOR_BINARY,
20
20
  PHONE_ANSWERED_TOOLS,
@@ -24,7 +24,7 @@ import {
24
24
  refusalOutput,
25
25
  toToolLookup,
26
26
  withHookHoldBudget
27
- } from "./chunk-OH647UT3.js";
27
+ } from "./chunk-KGSN2SOL.js";
28
28
 
29
29
  // src/claude-config.ts
30
30
  import { join } from "path";
@@ -6,38 +6,38 @@ import {
6
6
  } from "./chunk-VTR4VRL2.js";
7
7
  import {
8
8
  ensureDaemonRunning
9
- } from "./chunk-SSWK2WYX.js";
9
+ } from "./chunk-PAMW5M53.js";
10
10
  import {
11
11
  buildTranscriptRecords,
12
12
  decodePublicKey,
13
13
  generateSessionKey,
14
14
  wrapSessionKey
15
- } from "./chunk-N4DMADJM.js";
15
+ } from "./chunk-FCXYDR62.js";
16
16
  import {
17
17
  fetchTranscriptRecipients,
18
18
  uploadTranscriptRecords
19
- } from "./chunk-QFNY4KUQ.js";
19
+ } from "./chunk-FLC4TVXH.js";
20
20
  import {
21
21
  transcriptEnvironmentPreference,
22
22
  transcriptsEnabled
23
- } from "./chunk-M6R3SZZS.js";
23
+ } from "./chunk-YD3DIFIU.js";
24
24
  import {
25
25
  hookOwnerOf
26
- } from "./chunk-A5U62Q6K.js";
26
+ } from "./chunk-ZLY7BHN4.js";
27
27
  import {
28
28
  readTranscriptPreference
29
- } from "./chunk-AQ3TSQA2.js";
29
+ } from "./chunk-GC5HJE3T.js";
30
30
  import {
31
31
  codexHome,
32
32
  pusharyDir
33
- } from "./chunk-QIODXPTP.js";
33
+ } from "./chunk-2VQZC6DW.js";
34
34
  import {
35
35
  writeJsonAtomic
36
36
  } from "./chunk-AQFEP65J.js";
37
37
  import {
38
38
  getApiKey,
39
39
  getBaseUrl
40
- } from "./chunk-OQPEHKH2.js";
40
+ } from "./chunk-5Q2QJ2AL.js";
41
41
 
42
42
  // src/transcript-registration.ts
43
43
  import { createHash } from "crypto";
@@ -1,12 +1,12 @@
1
1
  import {
2
2
  keyCheckFromResponse
3
- } from "./chunk-Z4UDB7EC.js";
3
+ } from "./chunk-VEGS4NYF.js";
4
4
  import {
5
5
  installNetworkDefaults
6
- } from "./chunk-XBETSM5T.js";
6
+ } from "./chunk-ZV3262AA.js";
7
7
  import {
8
8
  getBaseUrl
9
- } from "./chunk-OQPEHKH2.js";
9
+ } from "./chunk-5Q2QJ2AL.js";
10
10
 
11
11
  // src/retry.ts
12
12
  var isRetryable = (err) => {
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  PRETOOLUSE_GATED_TOOLS
3
- } from "./chunk-OH647UT3.js";
3
+ } from "./chunk-KGSN2SOL.js";
4
4
 
5
5
  // src/claude-tools.ts
6
6
  var POSTTOOLUSE_MIRROR_ONLY_TOOLS = ["TodoWrite", "Task", "WebFetch", "WebSearch"];
@@ -2,7 +2,7 @@ import {
2
2
  IDLE_PROMPT_NOTIFICATION,
3
3
  NOTIFICATION_PUSH_TYPES,
4
4
  POSTTOOLUSE_MIRROR_ONLY_TOOLS
5
- } from "./chunk-KJA6IGOZ.js";
5
+ } from "./chunk-A3QQWXIE.js";
6
6
  import {
7
7
  cancelQuestion,
8
8
  clientErrorKindOf,
@@ -10,26 +10,26 @@ import {
10
10
  reportClientError,
11
11
  sendNotification,
12
12
  waitForAnswer
13
- } from "./chunk-4GKQDFH6.js";
13
+ } from "./chunk-NFH2H7PD.js";
14
14
  import {
15
15
  withRetry
16
- } from "./chunk-E2LGKG75.js";
16
+ } from "./chunk-7V6PJFDF.js";
17
17
  import {
18
18
  getMachineId
19
- } from "./chunk-EDN4F6GX.js";
19
+ } from "./chunk-ZLGCNHJG.js";
20
20
  import {
21
21
  reportedInstallSource
22
- } from "./chunk-6HT2TUZD.js";
22
+ } from "./chunk-EJMXZH5E.js";
23
23
  import {
24
24
  canonicalJson
25
- } from "./chunk-QIODXPTP.js";
25
+ } from "./chunk-2VQZC6DW.js";
26
26
  import {
27
27
  writeFileAtomic
28
28
  } from "./chunk-AQFEP65J.js";
29
29
  import {
30
30
  getApiKey,
31
31
  getBaseUrl
32
- } from "./chunk-OQPEHKH2.js";
32
+ } from "./chunk-5Q2QJ2AL.js";
33
33
  import {
34
34
  ACTION_BODY_MAX,
35
35
  AGENT_LABELS_BY_TYPE,
@@ -60,7 +60,7 @@ import {
60
60
  resolvePolicy,
61
61
  toToolLookup,
62
62
  truncateLine
63
- } from "./chunk-OH647UT3.js";
63
+ } from "./chunk-KGSN2SOL.js";
64
64
 
65
65
  // ../hook-mapping/src/describe.ts
66
66
  import { isAbsolute, relative, resolve } from "path";
@@ -4,7 +4,7 @@ import {
4
4
  forkFinishWithUpgradeLock,
5
5
  installWithUpgradeLock,
6
6
  releaseAutoUpdateLock
7
- } from "./chunk-JCEUDLGW.js";
7
+ } from "./chunk-PPGLIWOR.js";
8
8
  import {
9
9
  describeAutoUpdateCheck,
10
10
  globalInstallLocation,
@@ -14,7 +14,7 @@ import {
14
14
  readAutoUpdateState,
15
15
  updateAutoUpdateState,
16
16
  upgradeEntryFor
17
- } from "./chunk-USUI4P63.js";
17
+ } from "./chunk-VFF7ZBIS.js";
18
18
  import {
19
19
  EXIT
20
20
  } from "./chunk-KZERVKTD.js";
@@ -27,10 +27,10 @@ import {
27
27
  npmErrorMessage,
28
28
  readGlobalCliInstallAt,
29
29
  readGlobalPrefix
30
- } from "./chunk-QIODXPTP.js";
30
+ } from "./chunk-2VQZC6DW.js";
31
31
  import {
32
32
  NPX_LATEST_COMMAND
33
- } from "./chunk-LEQRIJ4H.js";
33
+ } from "./chunk-OOKIWOMK.js";
34
34
  import {
35
35
  commandsPackage,
36
36
  globalUpgradeEntry,
@@ -39,7 +39,7 @@ import {
39
39
  isSameMajorVersion,
40
40
  ownPackageRoot,
41
41
  packageVersionAt
42
- } from "./chunk-OH647UT3.js";
42
+ } from "./chunk-KGSN2SOL.js";
43
43
 
44
44
  // src/global-upgrade.ts
45
45
  import { existsSync } from "fs";
@@ -6,12 +6,12 @@ import {
6
6
  permissionDeniedAction,
7
7
  releaseThrottle,
8
8
  reportEvent
9
- } from "./chunk-GYP6DLA4.js";
9
+ } from "./chunk-AXB4ABUD.js";
10
10
  import {
11
11
  machineDecisionFor,
12
12
  shouldDeferToNativeMode,
13
13
  wireVerdictFor
14
- } from "./chunk-OH647UT3.js";
14
+ } from "./chunk-KGSN2SOL.js";
15
15
 
16
16
  // src/machine-decision-audit.ts
17
17
  import { basename } from "path";
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  parseSseMessages
3
- } from "./chunk-E2LGKG75.js";
3
+ } from "./chunk-7V6PJFDF.js";
4
4
  import {
5
5
  NPX_LATEST_COMMAND
6
- } from "./chunk-LEQRIJ4H.js";
6
+ } from "./chunk-OOKIWOMK.js";
7
7
 
8
8
  // src/mcp-stdio-bridge.ts
9
9
  var MCP_BRIDGE_BINARY = "pushary-mcp";
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  configFilePath
3
- } from "./chunk-OQPEHKH2.js";
3
+ } from "./chunk-5Q2QJ2AL.js";
4
4
  import {
5
5
  normalizeInstallSource
6
- } from "./chunk-OH647UT3.js";
6
+ } from "./chunk-KGSN2SOL.js";
7
7
 
8
8
  // src/install-source.ts
9
9
  import { readFileSync } from "fs";
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  redactSecretsFromContent
3
- } from "./chunk-OH647UT3.js";
3
+ } from "./chunk-KGSN2SOL.js";
4
4
 
5
5
  // src/crypto.ts
6
6
  import nacl from "tweetnacl";
@@ -1,15 +1,15 @@
1
1
  import {
2
2
  compatibleConfigFile
3
- } from "./chunk-K2EYK5RL.js";
3
+ } from "./chunk-5WTEKIAS.js";
4
4
  import {
5
5
  hookOwnerOf,
6
6
  hookOwnerOfCommands,
7
7
  liveBridgeProbe,
8
8
  resolveBridgeStub
9
- } from "./chunk-A5U62Q6K.js";
9
+ } from "./chunk-ZLY7BHN4.js";
10
10
  import {
11
11
  AGENT_CHOICES
12
- } from "./chunk-R5C3QCVT.js";
12
+ } from "./chunk-4KZP4YMV.js";
13
13
  import {
14
14
  claudeSettings,
15
15
  codexHooksJson,
@@ -18,7 +18,7 @@ import {
18
18
  guardedArgv,
19
19
  pusharyDir,
20
20
  vscodePluginDir
21
- } from "./chunk-QIODXPTP.js";
21
+ } from "./chunk-2VQZC6DW.js";
22
22
  import {
23
23
  readJsonSafe
24
24
  } from "./chunk-AQFEP65J.js";
@@ -29,7 +29,7 @@ import {
29
29
  OPENCODE_APPROVAL_EVENT,
30
30
  hookCompatibleProfile,
31
31
  isRecord
32
- } from "./chunk-OH647UT3.js";
32
+ } from "./chunk-KGSN2SOL.js";
33
33
 
34
34
  // src/opencode-plugin.ts
35
35
  var OPENCODE_PLUGIN_MARKER = "pushary-opencode-plugin w1";
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  getBaseUrl
3
- } from "./chunk-OQPEHKH2.js";
3
+ } from "./chunk-5Q2QJ2AL.js";
4
4
 
5
5
  // src/transcript-api.ts
6
6
  var fetchTranscriptRecipients = async (apiKey, baseUrl = getBaseUrl()) => {
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  pusharyDir
3
- } from "./chunk-QIODXPTP.js";
3
+ } from "./chunk-2VQZC6DW.js";
4
4
  import {
5
5
  readJsonSafe,
6
6
  writeFileAtomic
@@ -13,7 +13,7 @@ import {
13
13
  serializeDeclinedAgents,
14
14
  withDeclinedAgent,
15
15
  withoutDeclinedAgent
16
- } from "./chunk-OH647UT3.js";
16
+ } from "./chunk-KGSN2SOL.js";
17
17
 
18
18
  // src/declined-agents-file.ts
19
19
  import { join } from "path";
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  resolveInstallSourceFor
3
- } from "./chunk-6HT2TUZD.js";
3
+ } from "./chunk-EJMXZH5E.js";
4
4
  import {
5
5
  backupFile,
6
6
  readJsonSafe,
@@ -9,11 +9,11 @@ import {
9
9
  } from "./chunk-AQFEP65J.js";
10
10
  import {
11
11
  configFilePath
12
- } from "./chunk-OQPEHKH2.js";
12
+ } from "./chunk-5Q2QJ2AL.js";
13
13
  import {
14
14
  API_KEY_PREFIX_PATTERN,
15
15
  isRecord
16
- } from "./chunk-OH647UT3.js";
16
+ } from "./chunk-KGSN2SOL.js";
17
17
 
18
18
  // src/shell-alias.ts
19
19
  import { homedir } from "os";
@@ -115,6 +115,8 @@ var isDisabledExport = (line) => {
115
115
  };
116
116
  var keyPrefix = (key) => key.split(".")[0] ?? key;
117
117
  var MAC_APP_KEY_PREFIX_FIELD = "macAppKeyPrefix";
118
+ var CLI_CREATED_KEY_PREFIX_FIELD = "cliCreatedKeyPrefix";
119
+ var isCliCreatedKey = (key, createdPrefix) => keyPrefix(key) === createdPrefix;
118
120
  var findKeyExport = (contents) => {
119
121
  const lines = contents.split("\n");
120
122
  for (const [index, line] of lines.entries()) {
@@ -131,6 +133,11 @@ var keepMacAppKeyPrefix = (current, apiKey) => {
131
133
  const { [MAC_APP_KEY_PREFIX_FIELD]: recorded, ...rest } = current;
132
134
  return recorded === keyPrefix(apiKey) ? { ...rest, [MAC_APP_KEY_PREFIX_FIELD]: recorded } : rest;
133
135
  };
136
+ var savedKeyIsCliCreated = (current, apiKey, origin) => origin === "created_by_this_cli" || current[CLI_CREATED_KEY_PREFIX_FIELD] === keyPrefix(apiKey);
137
+ var withKeyRecords = (current, apiKey, origin) => {
138
+ const { [CLI_CREATED_KEY_PREFIX_FIELD]: _previous, ...rest } = keepMacAppKeyPrefix(current, apiKey);
139
+ return savedKeyIsCliCreated(current, apiKey, origin) ? { ...rest, [CLI_CREATED_KEY_PREFIX_FIELD]: keyPrefix(apiKey) } : rest;
140
+ };
134
141
  var manualKeyStepFor = (kind, platform) => kind === "no-rc" || platform === "win32" ? "config-only" : "paste-export";
135
142
  var rcResult = (kind, over = {}) => ({
136
143
  kind,
@@ -211,7 +218,7 @@ var resolveRcTarget = () => {
211
218
  const fallback = FALLBACK_RCS.map((name) => join2(homedir2(), name)).find(existsSync2);
212
219
  return fallback ? { path: fallback, shell: null } : null;
213
220
  };
214
- var writeKey = (apiKey, options = {}) => {
221
+ var writeKey = (apiKey, origin, options = {}) => {
215
222
  const configPath = configFilePath();
216
223
  const existing = readJsonSafe(configPath);
217
224
  let current = {};
@@ -229,7 +236,7 @@ var writeKey = (apiKey, options = {}) => {
229
236
  writeJsonAtomic(
230
237
  configPath,
231
238
  {
232
- ...keepMacAppKeyPrefix(current, apiKey),
239
+ ...withKeyRecords(current, apiKey, origin),
233
240
  apiKey,
234
241
  installSource: resolveInstallSourceFor(current),
235
242
  ...options.controlMode ? { controlMode: options.controlMode } : {},
@@ -248,7 +255,7 @@ var clearKey = (options = {}) => {
248
255
  const existing = readConfigRecord(configPath);
249
256
  let removedFromConfig = false;
250
257
  if (existing !== null && typeof existing.apiKey === "string") {
251
- const { apiKey: _dropped, [MAC_APP_KEY_PREFIX_FIELD]: _adopted, ...rest } = existing;
258
+ const { apiKey: _dropped, [MAC_APP_KEY_PREFIX_FIELD]: _adopted, [CLI_CREATED_KEY_PREFIX_FIELD]: _created, ...rest } = existing;
252
259
  writeJsonAtomic(configPath, rest, KEY_FILE_MODE);
253
260
  restrictFile(configPath);
254
261
  removedFromConfig = true;
@@ -306,11 +313,13 @@ var readKeySource = () => {
306
313
  if (fileKey) return { kind: "config", key: fileKey, origin: configPath, drift: null };
307
314
  return { kind: "none", key: null, origin: null, drift: null };
308
315
  };
309
- var readMacAppKeyPrefix = (configPath = configFilePath()) => {
310
- const recorded = readConfigRecord(configPath)?.[MAC_APP_KEY_PREFIX_FIELD];
316
+ var readRecordedKeyPrefix = (configPath, field) => {
317
+ const recorded = readConfigRecord(configPath)?.[field];
311
318
  return typeof recorded === "string" && API_KEY_PREFIX_PATTERN.test(recorded) ? recorded : null;
312
319
  };
320
+ var readMacAppKeyPrefix = (configPath = configFilePath()) => readRecordedKeyPrefix(configPath, MAC_APP_KEY_PREFIX_FIELD);
313
321
  var isAdoptedMacAppKey = (key, adoptedPrefix) => keyPrefix(key) === adoptedPrefix;
322
+ var readCliCreatedKeyPrefix = (configPath = configFilePath()) => readRecordedKeyPrefix(configPath, CLI_CREATED_KEY_PREFIX_FIELD);
314
323
  var recordMacAppKeyPrefix = (apiKey, configPath = configFilePath()) => {
315
324
  const config = readConfigRecord(configPath);
316
325
  if (config === null || config.apiKey !== apiKey) return false;
@@ -348,7 +357,9 @@ export {
348
357
  exportLine,
349
358
  isDisabledExport,
350
359
  keyPrefix,
360
+ isCliCreatedKey,
351
361
  manualKeyStepFor,
362
+ resolveRcTarget,
352
363
  writeKey,
353
364
  clearKey,
354
365
  readConfigFileKey,
@@ -357,7 +368,9 @@ export {
357
368
  readKeySource,
358
369
  readMacAppKeyPrefix,
359
370
  isAdoptedMacAppKey,
371
+ readCliCreatedKeyPrefix,
360
372
  recordMacAppKeyPrefix,
373
+ shellProfileCandidates,
361
374
  findExportedKeyLines,
362
375
  findExportedKeyLine
363
376
  };
@@ -1,12 +1,12 @@
1
1
  import {
2
2
  pusharyDir
3
- } from "./chunk-QIODXPTP.js";
3
+ } from "./chunk-2VQZC6DW.js";
4
4
  import {
5
5
  readJsonSafe
6
6
  } from "./chunk-AQFEP65J.js";
7
7
  import {
8
8
  isRecord
9
- } from "./chunk-OH647UT3.js";
9
+ } from "./chunk-KGSN2SOL.js";
10
10
 
11
11
  // src/process-ownership.ts
12
12
  import { createHash, randomUUID } from "crypto";