@pushary/agent-hooks 1.9.50 → 1.9.52
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.
- package/CHANGELOG.md +22 -0
- package/README.md +9 -1
- package/dist/api-K6ZROHYB.js +55 -0
- package/dist/bin/pushary-bell-hook.js +28 -25
- package/dist/bin/pushary-bell.js +13 -11
- package/dist/bin/pushary-claude.js +37 -33
- package/dist/bin/pushary-clean.js +68 -42
- package/dist/bin/pushary-codex-bridge.js +23 -20
- package/dist/bin/pushary-codex-hook.js +36 -32
- package/dist/bin/pushary-codex-session.js +17 -616
- package/dist/bin/pushary-codex.js +15 -12
- package/dist/bin/pushary-connect.js +31 -28
- package/dist/bin/pushary-cowork.js +7 -6
- package/dist/bin/pushary-daemon.js +57 -52
- package/dist/bin/pushary-disconnect.js +29 -26
- package/dist/bin/pushary-doctor.js +58 -53
- package/dist/bin/pushary-elicitation-hook.js +29 -26
- package/dist/bin/pushary-gemini-bridge.js +17 -15
- package/dist/bin/pushary-gemini-hook.js +33 -29
- package/dist/bin/pushary-hook.js +34 -31
- package/dist/bin/pushary-login.js +19 -16
- package/dist/bin/pushary-logout.js +30 -27
- package/dist/bin/pushary-mcp.js +16 -9
- package/dist/bin/pushary-mode.js +16 -14
- package/dist/bin/pushary-notification-hook.js +27 -24
- package/dist/bin/pushary-opencode-hook.js +32 -28
- package/dist/bin/pushary-permission-denied-hook.js +32 -29
- package/dist/bin/pushary-permission-hook.js +31 -28
- package/dist/bin/pushary-post-hook.js +27 -24
- package/dist/bin/pushary-prompt-hook.js +27 -24
- package/dist/bin/pushary-session-end-hook.js +27 -24
- package/dist/bin/pushary-session-start-hook.js +34 -29
- package/dist/bin/pushary-setup.js +195 -138
- package/dist/bin/pushary-stats.js +8 -7
- package/dist/bin/pushary-status.js +35 -32
- package/dist/bin/pushary-stop-hook.js +27 -24
- package/dist/bin/pushary-stopfailure-hook.js +27 -24
- package/dist/bin/pushary-suggestions.js +16 -14
- package/dist/bin/pushary-transcript-register.js +19 -17
- package/dist/bin/pushary-transcripts.js +10 -9
- package/dist/bin/pushary-upgrade.js +76 -46
- package/dist/bin/pushary-wait.js +16 -14
- package/dist/bin/pushary.js +10 -8
- package/dist/{chunk-GBKSCDEK.js → chunk-2LEH5IGX.js} +17 -4
- package/dist/chunk-36NGFHE4.js +72 -0
- package/dist/{chunk-B7LV6W7U.js → chunk-3RPN7AAT.js} +1 -1
- package/dist/{chunk-GDDXGBTM.js → chunk-46TC24ET.js} +2 -2
- package/dist/{chunk-KEAIIVW3.js → chunk-4QQEUJL4.js} +2 -2
- package/dist/{chunk-XNZB274I.js → chunk-5463UUO2.js} +1 -1
- package/dist/{chunk-FPKQGWAF.js → chunk-56ZTIY6D.js} +2 -2
- package/dist/{chunk-34AQAQKW.js → chunk-63IQRYVP.js} +4 -4
- package/dist/{chunk-25SYEAW4.js → chunk-6C4S3QYD.js} +3 -3
- package/dist/{chunk-4PCJ6DYK.js → chunk-6SWMKF5E.js} +2 -2
- package/dist/{chunk-Y7WD72J7.js → chunk-7CLLWDCP.js} +1 -1
- package/dist/{chunk-WLT6J3SB.js → chunk-ALZZVC3E.js} +2 -2
- package/dist/{chunk-ZMYLVFXC.js → chunk-BL3WAGIK.js} +14 -9
- package/dist/{chunk-PA54A437.js → chunk-BUXDR6US.js} +1 -1
- package/dist/{chunk-VUS6QGND.js → chunk-CQ5JGRML.js} +5 -1
- package/dist/{chunk-IF2UPWD2.js → chunk-DHJSBK63.js} +1 -1
- package/dist/chunk-DMJFW4KL.js +729 -0
- package/dist/{chunk-ABMEBN2R.js → chunk-EK7SZJ4K.js} +6 -4
- package/dist/{chunk-VCZN7NAB.js → chunk-EPOD7QHT.js} +7 -5
- package/dist/{chunk-KIO2MZQC.js → chunk-FCMWUYIE.js} +5 -3
- package/dist/{chunk-YTYXFA5M.js → chunk-FI73DGNB.js} +1 -1
- package/dist/{chunk-JGNYCRB2.js → chunk-FV34HT35.js} +1 -1
- package/dist/{chunk-KK2DIUVV.js → chunk-GCN73COS.js} +1 -1
- package/dist/{chunk-KBGKWB5T.js → chunk-H57DXSHR.js} +4 -2
- package/dist/{chunk-SALUTWPX.js → chunk-IHUFRAHB.js} +4 -4
- package/dist/chunk-JBT3ZSJS.js +92 -0
- package/dist/{chunk-5Q2FRMPC.js → chunk-JOWF4Y4P.js} +4 -4
- package/dist/{chunk-EP6S6VY3.js → chunk-JPABKXK6.js} +6 -6
- package/dist/{chunk-LLRYP5TR.js → chunk-K23WMLPY.js} +5 -5
- package/dist/{chunk-34RXPM5U.js → chunk-L5YTS2BP.js} +3 -3
- package/dist/{chunk-SE4JFMLW.js → chunk-LD4MWJMD.js} +8 -6
- package/dist/{chunk-OR5F63C2.js → chunk-LF3TLC7B.js} +2 -168
- package/dist/{chunk-XTVEW2NG.js → chunk-LIESRXK5.js} +1 -1
- package/dist/{chunk-ZOKMGBPR.js → chunk-MC4VY5LK.js} +16 -5
- package/dist/{chunk-K73CBZKW.js → chunk-MHQB62K5.js} +4 -4
- package/dist/{chunk-DH4BWFU7.js → chunk-MTKV4RUQ.js} +82 -16
- package/dist/{chunk-Y74IJ2IO.js → chunk-N77BH7H2.js} +10 -4
- package/dist/{chunk-ZTTCYHOM.js → chunk-NECZKPJN.js} +31 -6
- package/dist/{chunk-TGCIFEDE.js → chunk-NELH25J7.js} +13 -11
- package/dist/{chunk-HXRH7ZCK.js → chunk-NHVEQLQC.js} +2 -2
- package/dist/{chunk-OW4DNSQ6.js → chunk-NSY2V7XU.js} +1 -1
- package/dist/chunk-OHSHDQZF.js +271 -0
- package/dist/{chunk-ZYYQJSIO.js → chunk-OML4YFBN.js} +44 -462
- package/dist/{chunk-X3RCIOIH.js → chunk-ONCWYACA.js} +1 -1
- package/dist/{chunk-LZYJMSOY.js → chunk-P2546BBI.js} +3 -3
- package/dist/{chunk-WEY5ZHDB.js → chunk-Q7OXI6VS.js} +5 -5
- package/dist/{chunk-APASKZ2I.js → chunk-QKU46TK5.js} +5 -3
- package/dist/chunk-QTOLNRET.js +169 -0
- package/dist/{chunk-TYTIDEBW.js → chunk-RH6KR6EH.js} +5 -5
- package/dist/{chunk-7RMSB4A2.js → chunk-RL7EOD6I.js} +87 -24
- package/dist/{chunk-BOVSUH4N.js → chunk-S6RNS4UL.js} +2 -2
- package/dist/{chunk-LY3OJFBW.js → chunk-T6RIKJUO.js} +2 -1
- package/dist/{chunk-YVO4HIHX.js → chunk-U2L42GVI.js} +12 -10
- package/dist/{chunk-BXK6ZJVJ.js → chunk-UVT6B6XN.js} +2 -2
- package/dist/{chunk-UCF3EZZL.js → chunk-VQPSWD3A.js} +13 -13
- package/dist/{chunk-XH3F66VD.js → chunk-VYBH6D4X.js} +3 -3
- package/dist/chunk-XCEN33UP.js +7 -0
- package/dist/{chunk-GTGXQ7FJ.js → chunk-XDCXTDHH.js} +11 -11
- package/dist/{chunk-OZLGTMIY.js → chunk-XSUJ2PQY.js} +2 -2
- package/dist/chunk-XUW2DRAQ.js +427 -0
- package/dist/{chunk-UHVD7BSV.js → chunk-XZRLFBEA.js} +6 -6
- package/dist/{chunk-AWMMABVB.js → chunk-ZMPR436Z.js} +52 -138
- package/dist/{chunk-PXUNPXOX.js → chunk-ZOP3I2GQ.js} +3 -3
- package/dist/codex-app-cards-switch-OUQ3DUWF.js +52 -0
- package/dist/codex-desktop-launch-EIFLPLB7.js +27 -0
- package/dist/codex-session-launch-KLH2FSSJ.js +331 -0
- package/dist/config-HX6ZNOIL.js +14 -0
- package/dist/{global-upgrade-AIUSS2YH.js → global-upgrade-AZN3BPI3.js} +8 -6
- package/dist/identity-AQIMUWYN.js +15 -0
- package/dist/live-capabilities-4IIFAMHU.js +53 -0
- package/dist/{paths-RO34TYNM.js → paths-X4IPV2WJ.js} +4 -2
- package/dist/{reapply-KTNPP4XE.js → reapply-CXODG53B.js} +27 -21
- package/dist/src/index.d.ts +3 -3
- package/dist/src/index.js +22 -19
- package/dist/{upgrade-lock-5UAGXIW7.js → upgrade-lock-AHISGKER.js} +5 -3
- package/dist/usage-ZC6BKIE3.js +10 -0
- package/package.json +1 -1
|
@@ -1,27 +1,27 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import {
|
|
3
3
|
runBrowserLogin
|
|
4
|
-
} from "../chunk-
|
|
4
|
+
} from "../chunk-FI73DGNB.js";
|
|
5
5
|
import {
|
|
6
6
|
coworkOutput,
|
|
7
7
|
coworkSelection
|
|
8
|
-
} from "../chunk-
|
|
8
|
+
} from "../chunk-ZOP3I2GQ.js";
|
|
9
9
|
import "../chunk-PUZZELE6.js";
|
|
10
10
|
import {
|
|
11
11
|
clearDeclinedAgent,
|
|
12
12
|
declinedAgentForSetupChoice
|
|
13
|
-
} from "../chunk-
|
|
13
|
+
} from "../chunk-ALZZVC3E.js";
|
|
14
14
|
import {
|
|
15
15
|
CURSOR_GATE_SCRIPT,
|
|
16
16
|
describeVersionManagerPin,
|
|
17
17
|
saveSetupFailure,
|
|
18
18
|
versionManagerOf
|
|
19
|
-
} from "../chunk-
|
|
19
|
+
} from "../chunk-XSUJ2PQY.js";
|
|
20
20
|
import {
|
|
21
21
|
codexTrustOutcome,
|
|
22
22
|
describeCodexTrustConfirmation,
|
|
23
23
|
needsCodexTrustStep
|
|
24
|
-
} from "../chunk-
|
|
24
|
+
} from "../chunk-NHVEQLQC.js";
|
|
25
25
|
import {
|
|
26
26
|
describeWaitLadder
|
|
27
27
|
} from "../chunk-CVWG2N3Y.js";
|
|
@@ -39,23 +39,24 @@ import {
|
|
|
39
39
|
roundTripEvidence,
|
|
40
40
|
verifyRoundTrip,
|
|
41
41
|
waitForYourPhone
|
|
42
|
-
} from "../chunk-
|
|
42
|
+
} from "../chunk-XZRLFBEA.js";
|
|
43
43
|
import "../chunk-3EGEA4KH.js";
|
|
44
44
|
import {
|
|
45
45
|
readManagedControlEvidence,
|
|
46
46
|
waitForMachineReadiness
|
|
47
|
-
} from "../chunk-
|
|
47
|
+
} from "../chunk-XDCXTDHH.js";
|
|
48
48
|
import {
|
|
49
49
|
ensureCodexTrustsPusharyHooks
|
|
50
|
-
} from "../chunk-
|
|
51
|
-
import {
|
|
52
|
-
setHumanStream
|
|
53
|
-
} from "../chunk-QCGNGEGE.js";
|
|
50
|
+
} from "../chunk-FCMWUYIE.js";
|
|
54
51
|
import {
|
|
55
52
|
describeSetupSideEffects,
|
|
56
53
|
installAgentSkill,
|
|
57
54
|
installSkillViaSkillsCli
|
|
58
55
|
} from "../chunk-EUW7JL2K.js";
|
|
56
|
+
import {
|
|
57
|
+
codexEngineBehindLauncher
|
|
58
|
+
} from "../chunk-DMJFW4KL.js";
|
|
59
|
+
import "../chunk-XCEN33UP.js";
|
|
59
60
|
import {
|
|
60
61
|
CURSOR_PLUGIN_BACKUP_INFIX,
|
|
61
62
|
CURSOR_PLUGIN_STAGING_PREFIX,
|
|
@@ -64,7 +65,7 @@ import {
|
|
|
64
65
|
soleGateFile,
|
|
65
66
|
soleGateReceipt,
|
|
66
67
|
soleGateReceiptFile
|
|
67
|
-
} from "../chunk-
|
|
68
|
+
} from "../chunk-63IQRYVP.js";
|
|
68
69
|
import {
|
|
69
70
|
HERMES_PIP_PACKAGE,
|
|
70
71
|
describeDetection,
|
|
@@ -77,15 +78,21 @@ import {
|
|
|
77
78
|
runHermesConfigScript,
|
|
78
79
|
shortenHome,
|
|
79
80
|
vscodeSettingsTargets
|
|
80
|
-
} from "../chunk-
|
|
81
|
+
} from "../chunk-EPOD7QHT.js";
|
|
81
82
|
import {
|
|
82
83
|
mcpServerBearer,
|
|
83
84
|
readMacAppAgentKey
|
|
84
|
-
} from "../chunk-
|
|
85
|
+
} from "../chunk-MHQB62K5.js";
|
|
86
|
+
import {
|
|
87
|
+
setHumanStream
|
|
88
|
+
} from "../chunk-QCGNGEGE.js";
|
|
85
89
|
import {
|
|
86
90
|
AgentConfigError,
|
|
91
|
+
CODEX_INSTRUCTIONS_LABEL,
|
|
87
92
|
FX_PUSHARY_TOOLS_RULE,
|
|
88
93
|
FX_QUESTION_TOOL,
|
|
94
|
+
GEMINI_INSTRUCTIONS_LABEL,
|
|
95
|
+
OPENCODE_INSTRUCTIONS_LABEL,
|
|
89
96
|
SHARED_AGENTS_MD_LABEL,
|
|
90
97
|
afterAgentFailureNote,
|
|
91
98
|
agentFailureFromError,
|
|
@@ -109,10 +116,10 @@ import {
|
|
|
109
116
|
writeInstructionBlock,
|
|
110
117
|
writeSetupConfigFile,
|
|
111
118
|
writeSetupConfigJson
|
|
112
|
-
} from "../chunk-
|
|
119
|
+
} from "../chunk-MTKV4RUQ.js";
|
|
113
120
|
import {
|
|
114
121
|
MCP_BRIDGE_BINARY
|
|
115
|
-
} from "../chunk-
|
|
122
|
+
} from "../chunk-46TC24ET.js";
|
|
116
123
|
import {
|
|
117
124
|
OPENCODE_HOOK_BINARY,
|
|
118
125
|
addOpenCodeMcpServer,
|
|
@@ -128,16 +135,29 @@ import {
|
|
|
128
135
|
openCodePluginDir,
|
|
129
136
|
openCodePluginFile,
|
|
130
137
|
openCodeWired
|
|
131
|
-
} from "../chunk-
|
|
138
|
+
} from "../chunk-K23WMLPY.js";
|
|
132
139
|
import {
|
|
133
140
|
ansiPainter,
|
|
134
141
|
createIo,
|
|
135
142
|
useColor
|
|
136
143
|
} from "../chunk-FO3MDD26.js";
|
|
144
|
+
import {
|
|
145
|
+
checkCodexInstall,
|
|
146
|
+
detectProviderLiveCapabilities,
|
|
147
|
+
expectedLaunchCapabilities,
|
|
148
|
+
hasSpawnProvider,
|
|
149
|
+
missingControlPrerequisite,
|
|
150
|
+
nodeCodexInstallProbe,
|
|
151
|
+
phoneStartIsRequired,
|
|
152
|
+
resolveControlPolicy
|
|
153
|
+
} from "../chunk-2LEH5IGX.js";
|
|
154
|
+
import {
|
|
155
|
+
detectClaudeVersion
|
|
156
|
+
} from "../chunk-RIVNNBEK.js";
|
|
137
157
|
import {
|
|
138
158
|
describeAutoUpdateAnnouncement,
|
|
139
159
|
takeAutoUpdateAnnouncement
|
|
140
|
-
} from "../chunk-
|
|
160
|
+
} from "../chunk-QKU46TK5.js";
|
|
141
161
|
import {
|
|
142
162
|
addClaudeMcpServer,
|
|
143
163
|
addCompatibleHooks,
|
|
@@ -152,11 +172,12 @@ import {
|
|
|
152
172
|
compatibleInstructionsFile,
|
|
153
173
|
compatibleMcpFile,
|
|
154
174
|
compatiblePermissionRuleFile,
|
|
175
|
+
compatibleRecord,
|
|
155
176
|
compatibleTargetPaths,
|
|
156
177
|
hasCompatibleHooks,
|
|
157
178
|
isClaudeMcpSnapshot,
|
|
158
179
|
updateClaudeMcpSnapshot
|
|
159
|
-
} from "../chunk-
|
|
180
|
+
} from "../chunk-N77BH7H2.js";
|
|
160
181
|
import {
|
|
161
182
|
DAEMON_COLD_START_TIMEOUT_MS,
|
|
162
183
|
clearDaemonNeedsLogin,
|
|
@@ -170,7 +191,7 @@ import {
|
|
|
170
191
|
replaceDaemonService,
|
|
171
192
|
stopDaemonService,
|
|
172
193
|
waitForDaemonRemoteProof
|
|
173
|
-
} from "../chunk-
|
|
194
|
+
} from "../chunk-BL3WAGIK.js";
|
|
174
195
|
import {
|
|
175
196
|
KEEP_HINT,
|
|
176
197
|
captureHookTakeover,
|
|
@@ -182,24 +203,29 @@ import {
|
|
|
182
203
|
geminiWired,
|
|
183
204
|
planHooks,
|
|
184
205
|
pusharyHookExecutable
|
|
185
|
-
} from "../chunk-
|
|
206
|
+
} from "../chunk-Q7OXI6VS.js";
|
|
186
207
|
import {
|
|
187
208
|
GEMINI_HOOK_BINARY,
|
|
188
209
|
GEMINI_HOOK_EVENTS,
|
|
189
210
|
addGeminiHooks,
|
|
190
211
|
addGeminiMcpServer
|
|
191
|
-
} from "../chunk-
|
|
212
|
+
} from "../chunk-6C4S3QYD.js";
|
|
192
213
|
import {
|
|
193
214
|
AGENT_CHOICES,
|
|
194
215
|
effectiveControlMode,
|
|
195
216
|
effectiveVerify,
|
|
196
217
|
parseSetupOptions
|
|
197
|
-
} from "../chunk-
|
|
198
|
-
import "../chunk-
|
|
218
|
+
} from "../chunk-BUXDR6US.js";
|
|
219
|
+
import "../chunk-LIESRXK5.js";
|
|
199
220
|
import "../chunk-GMXKITVA.js";
|
|
200
221
|
import {
|
|
201
222
|
transcriptPreferenceForSetup
|
|
202
|
-
} from "../chunk-
|
|
223
|
+
} from "../chunk-FV34HT35.js";
|
|
224
|
+
import "../chunk-XHKBHWLX.js";
|
|
225
|
+
import {
|
|
226
|
+
compareVersion,
|
|
227
|
+
parseVersion
|
|
228
|
+
} from "../chunk-6ICPEJY5.js";
|
|
203
229
|
import {
|
|
204
230
|
KEY_FILE_MODE,
|
|
205
231
|
exportLine,
|
|
@@ -212,48 +238,36 @@ import {
|
|
|
212
238
|
recordMacAppKeyPrefix,
|
|
213
239
|
resolveShellRc,
|
|
214
240
|
writeKey
|
|
215
|
-
} from "../chunk-
|
|
241
|
+
} from "../chunk-VYBH6D4X.js";
|
|
216
242
|
import {
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
nodeCodexInstallProbe,
|
|
223
|
-
phoneStartIsRequired,
|
|
224
|
-
resolveControlPolicy
|
|
225
|
-
} from "../chunk-GBKSCDEK.js";
|
|
226
|
-
import {
|
|
227
|
-
detectClaudeVersion
|
|
228
|
-
} from "../chunk-RIVNNBEK.js";
|
|
229
|
-
import "../chunk-XHKBHWLX.js";
|
|
230
|
-
import {
|
|
231
|
-
compareVersion,
|
|
232
|
-
parseVersion
|
|
233
|
-
} from "../chunk-6ICPEJY5.js";
|
|
243
|
+
CODEX_ENGINE_DIRECTORY,
|
|
244
|
+
CODEX_ENGINE_ENTRYPOINT,
|
|
245
|
+
CODEX_ENGINE_MANIFEST,
|
|
246
|
+
codexEngineInside
|
|
247
|
+
} from "../chunk-36NGFHE4.js";
|
|
234
248
|
import {
|
|
235
249
|
reportEvent
|
|
236
|
-
} from "../chunk-
|
|
237
|
-
import "../chunk-
|
|
238
|
-
import "../chunk-
|
|
239
|
-
import "../chunk-
|
|
250
|
+
} from "../chunk-U2L42GVI.js";
|
|
251
|
+
import "../chunk-3RPN7AAT.js";
|
|
252
|
+
import "../chunk-JBT3ZSJS.js";
|
|
253
|
+
import "../chunk-ZMPR436Z.js";
|
|
254
|
+
import "../chunk-P2546BBI.js";
|
|
240
255
|
import "../chunk-POFBE6ZY.js";
|
|
241
|
-
import "../chunk-LZYJMSOY.js";
|
|
242
256
|
import {
|
|
243
257
|
checkApiKey,
|
|
244
258
|
describeKeyCheck,
|
|
245
259
|
samePusharyAccount
|
|
246
|
-
} from "../chunk-
|
|
247
|
-
import "../chunk-
|
|
248
|
-
import "../chunk-
|
|
260
|
+
} from "../chunk-L5YTS2BP.js";
|
|
261
|
+
import "../chunk-EK7SZJ4K.js";
|
|
262
|
+
import "../chunk-T6RIKJUO.js";
|
|
249
263
|
import {
|
|
250
264
|
UsageError
|
|
251
265
|
} from "../chunk-7QLSKOSU.js";
|
|
252
266
|
import {
|
|
253
267
|
EXIT
|
|
254
268
|
} from "../chunk-KZERVKTD.js";
|
|
269
|
+
import "../chunk-4QQEUJL4.js";
|
|
255
270
|
import {
|
|
256
|
-
NpmMissingError,
|
|
257
271
|
addCodexHookTrust,
|
|
258
272
|
addCodexHooks,
|
|
259
273
|
addCodexMcpServer,
|
|
@@ -267,13 +281,13 @@ import {
|
|
|
267
281
|
codexConfigToml,
|
|
268
282
|
codexHome,
|
|
269
283
|
codexHookPositions,
|
|
284
|
+
codexHooksJson,
|
|
270
285
|
codexSkillDir2 as codexSkillDir,
|
|
271
286
|
codexVacatedIndexes,
|
|
272
287
|
cursorPluginDir,
|
|
273
288
|
cursorUserHooks,
|
|
274
289
|
cursorUserMcp,
|
|
275
290
|
dropVacatedCodexHookTrust,
|
|
276
|
-
fetchLatestPublishedVersion,
|
|
277
291
|
fxAgentsMd,
|
|
278
292
|
fxConfigDir,
|
|
279
293
|
fxMcpProfile,
|
|
@@ -287,47 +301,53 @@ import {
|
|
|
287
301
|
guardedArgv,
|
|
288
302
|
hermesConfigReceipt,
|
|
289
303
|
hookTakeoverReceipt,
|
|
290
|
-
installGlobally,
|
|
291
|
-
npmInstallFailure,
|
|
292
|
-
plannedGlobalPackage,
|
|
293
304
|
pusharyConfigFile,
|
|
294
305
|
readCodexMcpAuth,
|
|
295
|
-
resolveGlobalBinDir,
|
|
296
|
-
resolveGlobalBinary,
|
|
297
306
|
vscodePluginDir,
|
|
298
307
|
vscodePluginMcp
|
|
299
|
-
} from "../chunk-
|
|
308
|
+
} from "../chunk-OML4YFBN.js";
|
|
309
|
+
import {
|
|
310
|
+
NpmMissingError,
|
|
311
|
+
fetchLatestPublishedVersion,
|
|
312
|
+
installGlobally,
|
|
313
|
+
npmInstallFailure,
|
|
314
|
+
plannedGlobalPackage,
|
|
315
|
+
resolveGlobalBinDir,
|
|
316
|
+
resolveGlobalBinary
|
|
317
|
+
} from "../chunk-XUW2DRAQ.js";
|
|
300
318
|
import {
|
|
301
319
|
backupFile,
|
|
302
320
|
readJsonSafe
|
|
303
321
|
} from "../chunk-AQFEP65J.js";
|
|
304
322
|
import {
|
|
305
323
|
getBaseUrl
|
|
306
|
-
} from "../chunk-
|
|
324
|
+
} from "../chunk-CQ5JGRML.js";
|
|
307
325
|
import {
|
|
308
326
|
NPX_LATEST_COMMAND,
|
|
309
327
|
renderCommandHelp
|
|
310
|
-
} from "../chunk-
|
|
328
|
+
} from "../chunk-MC4VY5LK.js";
|
|
329
|
+
import {
|
|
330
|
+
getPackageVersion,
|
|
331
|
+
isNewerVersion,
|
|
332
|
+
launchedPackage,
|
|
333
|
+
ownPackageName
|
|
334
|
+
} from "../chunk-QTOLNRET.js";
|
|
311
335
|
import {
|
|
312
336
|
HOOK_COMPATIBLE_PROFILES,
|
|
313
337
|
PRETOOLUSE_GATED_TOOLS,
|
|
314
338
|
SUPPORT_EMAIL,
|
|
315
339
|
computerOsOfPlatform,
|
|
316
|
-
getPackageVersion,
|
|
317
340
|
hookCompatibleProfile,
|
|
318
341
|
isApprovalMode,
|
|
319
342
|
isComputerAgent,
|
|
320
|
-
isNewerVersion,
|
|
321
343
|
isRecord,
|
|
322
344
|
isTimeoutAction,
|
|
323
|
-
isValidApiKey
|
|
324
|
-
|
|
325
|
-
ownPackageName
|
|
326
|
-
} from "../chunk-OR5F63C2.js";
|
|
345
|
+
isValidApiKey
|
|
346
|
+
} from "../chunk-LF3TLC7B.js";
|
|
327
347
|
|
|
328
348
|
// bin/pushary-setup.ts
|
|
329
349
|
import { existsSync, readFileSync, writeFileSync, mkdirSync, cpSync, rmSync, renameSync, realpathSync, statSync, openSync, readSync, closeSync } from "fs";
|
|
330
|
-
import { join as
|
|
350
|
+
import { join as join4, dirname as dirname3, basename } from "path";
|
|
331
351
|
import { homedir, hostname } from "os";
|
|
332
352
|
import { execSync } from "child_process";
|
|
333
353
|
import { checkbox, input, confirm } from "@inquirer/prompts";
|
|
@@ -337,6 +357,26 @@ import { parse as parseTOML, stringify as stringifyTOML } from "smol-toml";
|
|
|
337
357
|
// src/cli/exit.ts
|
|
338
358
|
var isExitPromptError = (err) => err instanceof Error && (err.name === "ExitPromptError" || err.message.includes("User force closed") || /force closed the prompt/i.test(err.message));
|
|
339
359
|
|
|
360
|
+
// src/setup/agent-targets.ts
|
|
361
|
+
import { join } from "path";
|
|
362
|
+
var agentSetupTargets = (exists) => ({
|
|
363
|
+
claude_code: [claudeJson(), claudeSettings(), join(claudeSkillDir(), "SKILL.md")],
|
|
364
|
+
codex: [join(codexHome(), "config.toml"), codexHooksJson(), join(codexSkillDir(), "SKILL.md"), codexAgentsMd()],
|
|
365
|
+
gemini_cli: [geminiSettings(), geminiMd()],
|
|
366
|
+
hermes: [`the Hermes virtualenv (pip install ${HERMES_PIP_PACKAGE})`],
|
|
367
|
+
cursor: [join(cursorPluginDir(), "mcp.json"), cursorUserHooks()],
|
|
368
|
+
vscode: [vscodePluginMcp(), ...vscodeSettingsTargets(exists)],
|
|
369
|
+
opencode: [
|
|
370
|
+
openCodePluginFile(),
|
|
371
|
+
join(openCodePluginDir(), "package.json"),
|
|
372
|
+
openCodeConfigFile(),
|
|
373
|
+
openCodeInstructionsFile()
|
|
374
|
+
],
|
|
375
|
+
fx: [fxMcpProfile(), fxSettings(), fxAgentsMd()],
|
|
376
|
+
...compatibleRecord((profile) => compatibleTargetPaths(profile)),
|
|
377
|
+
custom: ["nothing (prints connection details only)"]
|
|
378
|
+
});
|
|
379
|
+
|
|
340
380
|
// src/cli/enter-key.ts
|
|
341
381
|
var enterKeyListener = (input2 = process.stdin) => {
|
|
342
382
|
if (input2.isTTY !== true) return null;
|
|
@@ -881,7 +921,7 @@ var unverifiedKeyClosingReason = (facts) => {
|
|
|
881
921
|
};
|
|
882
922
|
|
|
883
923
|
// src/setup/codex-version.ts
|
|
884
|
-
import { dirname, join } from "path";
|
|
924
|
+
import { dirname, join as join2 } from "path";
|
|
885
925
|
var parseCodexVersion = parseVersion;
|
|
886
926
|
var compareCodexVersion = compareVersion;
|
|
887
927
|
var versionFromManifest = (probe, binPath) => {
|
|
@@ -896,10 +936,10 @@ var versionFromManifest = (probe, binPath) => {
|
|
|
896
936
|
}
|
|
897
937
|
};
|
|
898
938
|
let dir = dirname(binPath);
|
|
899
|
-
const shimVersion = readVersion(
|
|
939
|
+
const shimVersion = readVersion(join2(dir, "node_modules", "@openai", "codex", "package.json"));
|
|
900
940
|
if (shimVersion) return shimVersion;
|
|
901
941
|
for (let depth = 0; depth < 4; depth++) {
|
|
902
|
-
const version = readVersion(
|
|
942
|
+
const version = readVersion(join2(dir, "package.json"));
|
|
903
943
|
if (version) return version;
|
|
904
944
|
const parent = dirname(dir);
|
|
905
945
|
if (parent === dir) break;
|
|
@@ -923,7 +963,7 @@ var readCodexVersion = (probe) => {
|
|
|
923
963
|
};
|
|
924
964
|
|
|
925
965
|
// src/setup/codex-bundled.ts
|
|
926
|
-
import { join as
|
|
966
|
+
import { dirname as dirname2, join as join3 } from "path";
|
|
927
967
|
var asRecord = (value) => value && typeof value === "object" && !Array.isArray(value) ? value : void 0;
|
|
928
968
|
var codexCliPathFromConfig = (config) => {
|
|
929
969
|
const servers = asRecord(config.mcp_servers);
|
|
@@ -934,16 +974,34 @@ var codexCliPathFromConfig = (config) => {
|
|
|
934
974
|
}
|
|
935
975
|
return null;
|
|
936
976
|
};
|
|
977
|
+
var SYSTEM_CHATGPT_APP = "/Applications/ChatGPT.app";
|
|
978
|
+
var userChatGptApp = (home) => join3(home, "Applications", "ChatGPT.app");
|
|
937
979
|
var bundledCodexCandidates = (home, platform) => platform === "darwin" ? [
|
|
938
|
-
|
|
939
|
-
|
|
980
|
+
codexEngineInside(SYSTEM_CHATGPT_APP),
|
|
981
|
+
codexEngineInside(userChatGptApp(home)),
|
|
982
|
+
join3(SYSTEM_CHATGPT_APP, "Contents", "Resources", "codex"),
|
|
983
|
+
join3(userChatGptApp(home), "Contents", "Resources", "codex")
|
|
940
984
|
] : [];
|
|
941
985
|
var findBundledCodex = (probe) => {
|
|
942
986
|
const config = probe.config();
|
|
943
987
|
const declared = config ? codexCliPathFromConfig(config) : null;
|
|
944
|
-
|
|
988
|
+
const codex = declared ? probe.engineBehindPusharyLauncher(declared) ?? declared : null;
|
|
989
|
+
if (codex && probe.exists(codex)) return codex;
|
|
945
990
|
return bundledCodexCandidates(probe.home, probe.platform).find(probe.exists) ?? null;
|
|
946
991
|
};
|
|
992
|
+
var ENGINE_ENTRYPOINT_INSIDE_THE_APP = `/${CODEX_ENGINE_DIRECTORY}/${CODEX_ENGINE_ENTRYPOINT}`;
|
|
993
|
+
var MANIFEST_VERSION = /^\d+\.\d+\.\d+/;
|
|
994
|
+
var codexEngineManifestBeside = (codex) => codex.endsWith(ENGINE_ENTRYPOINT_INSIDE_THE_APP) ? join3(dirname2(dirname2(codex)), CODEX_ENGINE_MANIFEST) : null;
|
|
995
|
+
var parseCodexEngineManifestVersion = (contents) => {
|
|
996
|
+
let manifest;
|
|
997
|
+
try {
|
|
998
|
+
manifest = JSON.parse(contents);
|
|
999
|
+
} catch {
|
|
1000
|
+
return null;
|
|
1001
|
+
}
|
|
1002
|
+
const version = asRecord(manifest)?.version;
|
|
1003
|
+
return typeof version === "string" ? version.match(MANIFEST_VERSION)?.[0] ?? null : null;
|
|
1004
|
+
};
|
|
947
1005
|
var parseEmbeddedCodexVersion = (haystack) => haystack.match(/cli_version(\d+\.\d+\.\d+)/)?.[1] ?? null;
|
|
948
1006
|
|
|
949
1007
|
// src/setup/telemetry.ts
|
|
@@ -1236,10 +1294,10 @@ var installGlobally2 = async () => {
|
|
|
1236
1294
|
var _cachedSkillContent = null;
|
|
1237
1295
|
var fetchSkillContent = async () => {
|
|
1238
1296
|
if (_cachedSkillContent) return _cachedSkillContent;
|
|
1239
|
-
const __dirname =
|
|
1297
|
+
const __dirname = dirname3(fileURLToPath(import.meta.url));
|
|
1240
1298
|
const candidates = [
|
|
1241
|
-
|
|
1242
|
-
|
|
1299
|
+
join4(__dirname, "..", "..", "data", "SKILL.md"),
|
|
1300
|
+
join4(__dirname, "..", "data", "SKILL.md")
|
|
1243
1301
|
];
|
|
1244
1302
|
const source = candidates.find((path) => existsSync(path));
|
|
1245
1303
|
if (!source) throw new Error("packaged skill not found");
|
|
@@ -1249,12 +1307,12 @@ var fetchSkillContent = async () => {
|
|
|
1249
1307
|
var writePackagedSkill = async (dir) => {
|
|
1250
1308
|
const content = await fetchSkillContent();
|
|
1251
1309
|
if (!existsSync(dir)) mkdirSync(dir, { recursive: true });
|
|
1252
|
-
writeFileSync(
|
|
1310
|
+
writeFileSync(join4(dir, "SKILL.md"), content, "utf-8");
|
|
1253
1311
|
};
|
|
1254
|
-
var skillsCliInUse = () => isInstalled("skills") || existsSync(
|
|
1312
|
+
var skillsCliInUse = () => isInstalled("skills") || existsSync(join4(homedir(), ".agents", "skills"));
|
|
1255
1313
|
var skillInstallEffects = {
|
|
1256
1314
|
runSkillsCli: installSkillViaSkillsCli,
|
|
1257
|
-
skillModifiedAt: (dir) => statSync(
|
|
1315
|
+
skillModifiedAt: (dir) => statSync(join4(dir, "SKILL.md"), { throwIfNoEntry: false })?.mtimeMs ?? null,
|
|
1258
1316
|
writePackagedSkill,
|
|
1259
1317
|
now: () => Date.now()
|
|
1260
1318
|
};
|
|
@@ -1360,7 +1418,7 @@ var setupHermes = async (_apiKey) => {
|
|
|
1360
1418
|
console.log(` ${dim("To send approvals back to the terminal:")} remove ${bold("security.approval.transport")} from ~/.hermes/config.yaml`);
|
|
1361
1419
|
console.log(` ${dim("To re-enable terminal questions:")} remove ${bold("clarify")} from ${dim("agent.disabled_toolsets")}`);
|
|
1362
1420
|
};
|
|
1363
|
-
var CODEX_HOOKS_JSON =
|
|
1421
|
+
var CODEX_HOOKS_JSON = join4(CODEX_HOME, "hooks.json");
|
|
1364
1422
|
var CODEX_HOOKS_MIN_VERSION = [0, 122, 0];
|
|
1365
1423
|
var codexOnPath = () => {
|
|
1366
1424
|
const whichCmd = IS_WINDOWS ? "where" : "which";
|
|
@@ -1409,6 +1467,24 @@ var readEmbeddedCodexVersion = (path) => {
|
|
|
1409
1467
|
}
|
|
1410
1468
|
}
|
|
1411
1469
|
};
|
|
1470
|
+
var LARGEST_LAUNCHER_BYTES = 64 * 1024;
|
|
1471
|
+
var engineBehindPusharyLauncher = (path) => {
|
|
1472
|
+
try {
|
|
1473
|
+
if (statSync(path).size > LARGEST_LAUNCHER_BYTES) return null;
|
|
1474
|
+
return codexEngineBehindLauncher(readFileSync(path, "utf-8"));
|
|
1475
|
+
} catch {
|
|
1476
|
+
return null;
|
|
1477
|
+
}
|
|
1478
|
+
};
|
|
1479
|
+
var codexEngineManifestVersion = (codex) => {
|
|
1480
|
+
const manifest = codexEngineManifestBeside(codex);
|
|
1481
|
+
if (!manifest) return null;
|
|
1482
|
+
try {
|
|
1483
|
+
return parseCodexEngineManifestVersion(readFileSync(manifest, "utf-8"));
|
|
1484
|
+
} catch {
|
|
1485
|
+
return null;
|
|
1486
|
+
}
|
|
1487
|
+
};
|
|
1412
1488
|
var bundledCodex = () => findBundledCodex({
|
|
1413
1489
|
config: () => {
|
|
1414
1490
|
try {
|
|
@@ -1418,6 +1494,7 @@ var bundledCodex = () => findBundledCodex({
|
|
|
1418
1494
|
}
|
|
1419
1495
|
},
|
|
1420
1496
|
exists: existsSync,
|
|
1497
|
+
engineBehindPusharyLauncher,
|
|
1421
1498
|
home: homedir(),
|
|
1422
1499
|
platform: process.platform
|
|
1423
1500
|
});
|
|
@@ -1433,7 +1510,7 @@ var detectCodexVersion = () => readCodexVersion({
|
|
|
1433
1510
|
},
|
|
1434
1511
|
bundledVersion: () => {
|
|
1435
1512
|
const path = bundledCodex();
|
|
1436
|
-
return path ? readEmbeddedCodexVersion(path) : null;
|
|
1513
|
+
return path ? codexEngineManifestVersion(path) ?? readEmbeddedCodexVersion(path) : null;
|
|
1437
1514
|
},
|
|
1438
1515
|
brewVersions: () => {
|
|
1439
1516
|
try {
|
|
@@ -1569,7 +1646,7 @@ var setupCodex = async (apiKey) => {
|
|
|
1569
1646
|
}
|
|
1570
1647
|
await installSkill("codex", CODEX_SKILL_DIR);
|
|
1571
1648
|
await spinner("Teaching Codex to ask via push (~/.codex/AGENTS.md)", async () => {
|
|
1572
|
-
writeInstructionBlock(CODEX_AGENTS_MD, renderAgentInstructions(
|
|
1649
|
+
writeInstructionBlock(CODEX_AGENTS_MD, renderAgentInstructions(CODEX_INSTRUCTIONS_LABEL));
|
|
1573
1650
|
});
|
|
1574
1651
|
const confirmation = hooksSupported ? await confirmCodexTrust() : null;
|
|
1575
1652
|
const trustOutcome = confirmation === null ? null : codexTrustOutcome(confirmation, portedTrustWritten);
|
|
@@ -1617,17 +1694,17 @@ var setupCodex = async (apiKey) => {
|
|
|
1617
1694
|
}
|
|
1618
1695
|
};
|
|
1619
1696
|
var resolveBundledPlugin = () => {
|
|
1620
|
-
const dir =
|
|
1697
|
+
const dir = dirname3(fileURLToPath(import.meta.url));
|
|
1621
1698
|
const candidates = [
|
|
1622
|
-
|
|
1623
|
-
|
|
1624
|
-
|
|
1625
|
-
|
|
1699
|
+
join4(dir, "..", "..", "data", "cursor-plugin"),
|
|
1700
|
+
join4(dir, "..", "data", "cursor-plugin"),
|
|
1701
|
+
join4(dir, "..", "..", "..", "cursor-plugin"),
|
|
1702
|
+
join4(dir, "..", "..", "cursor-plugin")
|
|
1626
1703
|
];
|
|
1627
|
-
return candidates.find((p) => existsSync(
|
|
1704
|
+
return candidates.find((p) => existsSync(join4(p, ".cursor-plugin", "plugin.json"))) ?? null;
|
|
1628
1705
|
};
|
|
1629
1706
|
var installCursorUserHooks = (gateScript) => {
|
|
1630
|
-
const bundled = readJson(
|
|
1707
|
+
const bundled = readJson(join4(CURSOR_PLUGIN_DIR, "hooks", "hooks.json")).hooks ?? {};
|
|
1631
1708
|
let userHooks = {};
|
|
1632
1709
|
if (existsSync(CURSOR_USER_HOOKS)) {
|
|
1633
1710
|
const result = readJsonSafe(CURSOR_USER_HOOKS);
|
|
@@ -1655,7 +1732,7 @@ var installCursorUserHooks = (gateScript) => {
|
|
|
1655
1732
|
writeJson(CURSOR_USER_HOOKS, { ...userHooks, version: userHooks.version ?? 1, hooks });
|
|
1656
1733
|
};
|
|
1657
1734
|
var neutralizePluginGate = () => {
|
|
1658
|
-
const path =
|
|
1735
|
+
const path = join4(CURSOR_PLUGIN_DIR, "hooks", "hooks.json");
|
|
1659
1736
|
if (!existsSync(path)) return;
|
|
1660
1737
|
const data = readJson(path);
|
|
1661
1738
|
if (!data.hooks) return;
|
|
@@ -1678,7 +1755,7 @@ var setupCursor = async (apiKey) => {
|
|
|
1678
1755
|
const source = resolveBundledPlugin();
|
|
1679
1756
|
if (!source) throw new Error("bundled Cursor plugin not found in this package");
|
|
1680
1757
|
await spinner("Installing Pushary plugin", async () => {
|
|
1681
|
-
const staging =
|
|
1758
|
+
const staging = join4(dirname3(CURSOR_PLUGIN_DIR), `${CURSOR_PLUGIN_STAGING_PREFIX}${process.pid}`);
|
|
1682
1759
|
const backup = `${CURSOR_PLUGIN_DIR}${CURSOR_PLUGIN_BACKUP_INFIX}${(/* @__PURE__ */ new Date()).toISOString().replace(/[:.]/g, "-")}`;
|
|
1683
1760
|
rmSync(staging, { recursive: true, force: true });
|
|
1684
1761
|
try {
|
|
@@ -1686,7 +1763,7 @@ var setupCursor = async (apiKey) => {
|
|
|
1686
1763
|
recursive: true,
|
|
1687
1764
|
filter: (p) => !["tools", "node_modules", ".git", ".DS_Store"].includes(basename(p))
|
|
1688
1765
|
});
|
|
1689
|
-
const staged = readJsonSafe(
|
|
1766
|
+
const staged = readJsonSafe(join4(staging, ".cursor-plugin", "plugin.json"));
|
|
1690
1767
|
if (staged.kind !== "ok") {
|
|
1691
1768
|
throw new Error("staged Cursor plugin is missing or has an unreadable plugin.json");
|
|
1692
1769
|
}
|
|
@@ -1704,7 +1781,7 @@ var setupCursor = async (apiKey) => {
|
|
|
1704
1781
|
}
|
|
1705
1782
|
});
|
|
1706
1783
|
await spinner("Linking your API key", async () => {
|
|
1707
|
-
const mcpPath =
|
|
1784
|
+
const mcpPath = join4(CURSOR_PLUGIN_DIR, "mcp.json");
|
|
1708
1785
|
const mcp = readAgentJson(mcpPath);
|
|
1709
1786
|
const servers = mcp.mcpServers ?? {};
|
|
1710
1787
|
if (servers.pushary) {
|
|
@@ -1714,7 +1791,7 @@ var setupCursor = async (apiKey) => {
|
|
|
1714
1791
|
}
|
|
1715
1792
|
});
|
|
1716
1793
|
await spinner("Registering permission gate (~/.cursor/hooks.json)", async () => {
|
|
1717
|
-
installCursorUserHooks(
|
|
1794
|
+
installCursorUserHooks(join4(CURSOR_PLUGIN_DIR, "scripts", "pushary-gate.mjs"));
|
|
1718
1795
|
neutralizePluginGate();
|
|
1719
1796
|
});
|
|
1720
1797
|
console.log();
|
|
@@ -1726,18 +1803,18 @@ var setupCursor = async (apiKey) => {
|
|
|
1726
1803
|
noteManual("Fully quit and reopen Cursor. A Reload Window may not be enough.");
|
|
1727
1804
|
};
|
|
1728
1805
|
var resolveBundledVsCodePlugin = () => {
|
|
1729
|
-
const dir =
|
|
1806
|
+
const dir = dirname3(fileURLToPath(import.meta.url));
|
|
1730
1807
|
const candidates = [
|
|
1731
|
-
|
|
1732
|
-
|
|
1733
|
-
|
|
1734
|
-
|
|
1808
|
+
join4(dir, "..", "..", "data", "vscode-plugin"),
|
|
1809
|
+
join4(dir, "..", "data", "vscode-plugin"),
|
|
1810
|
+
join4(dir, "..", "..", "..", "vscode-plugin"),
|
|
1811
|
+
join4(dir, "..", "..", "vscode-plugin")
|
|
1735
1812
|
];
|
|
1736
|
-
return candidates.find((p) => existsSync(
|
|
1813
|
+
return candidates.find((p) => existsSync(join4(p, ".claude-plugin", "plugin.json"))) ?? null;
|
|
1737
1814
|
};
|
|
1738
1815
|
var pinGuardedVsCodeGate = (pluginDir) => {
|
|
1739
|
-
const hooksPath =
|
|
1740
|
-
const guarded = guardVsCodeGateHooks(readJson(hooksPath),
|
|
1816
|
+
const hooksPath = join4(pluginDir, "hooks", "hooks.json");
|
|
1817
|
+
const guarded = guardVsCodeGateHooks(readJson(hooksPath), join4(pluginDir, "scripts", CURSOR_GATE_SCRIPT));
|
|
1741
1818
|
if (guarded.kind === "invalid") throw new Error(guarded.reason);
|
|
1742
1819
|
writeJson(hooksPath, guarded.document);
|
|
1743
1820
|
};
|
|
@@ -1753,7 +1830,7 @@ var registerVsCodePlugin = (pluginDir) => {
|
|
|
1753
1830
|
continue;
|
|
1754
1831
|
}
|
|
1755
1832
|
if (current !== null) backupFile(settingsPath);
|
|
1756
|
-
mkdirSync(
|
|
1833
|
+
mkdirSync(dirname3(settingsPath), { recursive: true });
|
|
1757
1834
|
writeSetupConfigFile(settingsPath, result.content);
|
|
1758
1835
|
written.push(settingsPath);
|
|
1759
1836
|
}
|
|
@@ -1766,16 +1843,16 @@ var setupVsCode = async (apiKey) => {
|
|
|
1766
1843
|
const source = resolveBundledVsCodePlugin();
|
|
1767
1844
|
if (!source) throw new Error("bundled VS Code plugin not found in this package");
|
|
1768
1845
|
await spinner("Installing Pushary plugin", async () => {
|
|
1769
|
-
const staging =
|
|
1846
|
+
const staging = join4(dirname3(VSCODE_PLUGIN_DIR), `.pushary-staging-vscode-${process.pid}`);
|
|
1770
1847
|
const backup = `${VSCODE_PLUGIN_DIR}.pushary-backup-${(/* @__PURE__ */ new Date()).toISOString().replace(/[:.]/g, "-")}`;
|
|
1771
|
-
mkdirSync(
|
|
1848
|
+
mkdirSync(dirname3(VSCODE_PLUGIN_DIR), { recursive: true });
|
|
1772
1849
|
rmSync(staging, { recursive: true, force: true });
|
|
1773
1850
|
try {
|
|
1774
1851
|
cpSync(source, staging, {
|
|
1775
1852
|
recursive: true,
|
|
1776
1853
|
filter: (p) => !["tools", "node_modules", ".git", ".DS_Store"].includes(basename(p))
|
|
1777
1854
|
});
|
|
1778
|
-
const staged = readJsonSafe(
|
|
1855
|
+
const staged = readJsonSafe(join4(staging, ".claude-plugin", "plugin.json"));
|
|
1779
1856
|
if (staged.kind !== "ok") {
|
|
1780
1857
|
throw new Error("staged VS Code plugin is missing or has an unreadable plugin.json");
|
|
1781
1858
|
}
|
|
@@ -2002,7 +2079,7 @@ var setupGemini = async (apiKey) => {
|
|
|
2002
2079
|
writeSetupConfigJson(GEMINI_SETTINGS, settings, KEY_FILE_MODE);
|
|
2003
2080
|
});
|
|
2004
2081
|
await spinner("Teaching Gemini to ask via push (~/.gemini/GEMINI.md)", async () => {
|
|
2005
|
-
writeInstructionBlock(GEMINI_MD, renderAgentInstructions(
|
|
2082
|
+
writeInstructionBlock(GEMINI_MD, renderAgentInstructions(GEMINI_INSTRUCTIONS_LABEL));
|
|
2006
2083
|
});
|
|
2007
2084
|
console.log();
|
|
2008
2085
|
console.log(` ${dim("What this configured:")}`);
|
|
@@ -2034,7 +2111,7 @@ var setupOpenCode = async (apiKey) => {
|
|
|
2034
2111
|
writeSetupConfigJson(openCodeConfigFile(), config, KEY_FILE_MODE);
|
|
2035
2112
|
});
|
|
2036
2113
|
await spinner("Teaching OpenCode to ask via push", async () => {
|
|
2037
|
-
writeInstructionBlock(OPENCODE_INSTRUCTIONS(), renderAgentInstructions(
|
|
2114
|
+
writeInstructionBlock(OPENCODE_INSTRUCTIONS(), renderAgentInstructions(OPENCODE_INSTRUCTIONS_LABEL));
|
|
2038
2115
|
});
|
|
2039
2116
|
console.log();
|
|
2040
2117
|
console.log(` ${dim("What this configured:")}`);
|
|
@@ -2047,10 +2124,6 @@ var setupOpenCode = async (apiKey) => {
|
|
|
2047
2124
|
noteManual("Restart OpenCode to load the plugin.");
|
|
2048
2125
|
return "configured";
|
|
2049
2126
|
};
|
|
2050
|
-
var compatibleRecord = (of) => HOOK_COMPATIBLE_PROFILES.reduce(
|
|
2051
|
-
(record, profile) => ({ ...record, [profile.agentType]: of(profile) }),
|
|
2052
|
-
{}
|
|
2053
|
-
);
|
|
2054
2127
|
var clearSetupChoiceDecline = (agent) => {
|
|
2055
2128
|
const declined = declinedAgentForSetupChoice(agent);
|
|
2056
2129
|
if (declined) clearDeclinedAgent(declined);
|
|
@@ -2120,25 +2193,25 @@ var agentIsWired = (agent) => {
|
|
|
2120
2193
|
return claudeWired({
|
|
2121
2194
|
claudeJson: readJson2(CLAUDE_JSON),
|
|
2122
2195
|
settings: readJson2(CLAUDE_SETTINGS),
|
|
2123
|
-
skillExists: existsSync(
|
|
2196
|
+
skillExists: existsSync(join4(CLAUDE_SKILL_DIR, "SKILL.md"))
|
|
2124
2197
|
});
|
|
2125
2198
|
case "codex": {
|
|
2126
2199
|
let config = null;
|
|
2127
2200
|
try {
|
|
2128
|
-
config = parseTOML(readFileSync(
|
|
2201
|
+
config = parseTOML(readFileSync(join4(CODEX_HOME, "config.toml"), "utf-8"));
|
|
2129
2202
|
} catch {
|
|
2130
2203
|
config = null;
|
|
2131
2204
|
}
|
|
2132
2205
|
return codexWired({
|
|
2133
2206
|
config,
|
|
2134
2207
|
hooks: readJson2(CODEX_HOOKS_JSON),
|
|
2135
|
-
skillExists: existsSync(
|
|
2208
|
+
skillExists: existsSync(join4(CODEX_SKILL_DIR, "SKILL.md"))
|
|
2136
2209
|
});
|
|
2137
2210
|
}
|
|
2138
2211
|
case "gemini_cli":
|
|
2139
2212
|
return geminiWired({ settings: readJson2(GEMINI_SETTINGS) });
|
|
2140
2213
|
case "cursor":
|
|
2141
|
-
return existsSync(
|
|
2214
|
+
return existsSync(join4(CURSOR_PLUGIN_DIR, "mcp.json"));
|
|
2142
2215
|
case "vscode":
|
|
2143
2216
|
return existsSync(VSCODE_PLUGIN_MCP);
|
|
2144
2217
|
case "opencode":
|
|
@@ -2183,7 +2256,7 @@ var setupCompatibleAgent = (profile) => async (apiKey) => {
|
|
|
2183
2256
|
console.log(`
|
|
2184
2257
|
${bold(`Setting up ${profile.label}`)}
|
|
2185
2258
|
`);
|
|
2186
|
-
if (!isInstalled(profile.binary) && (profile.configDirIsShared || !existsSync(
|
|
2259
|
+
if (!isInstalled(profile.binary) && (profile.configDirIsShared || !existsSync(dirname3(configFile)))) {
|
|
2187
2260
|
console.log(` ${yellow("!")} ${profile.label} not found. Skipping.`);
|
|
2188
2261
|
console.log(` ${dim(`Install ${profile.label} and re-run setup to configure.`)}`);
|
|
2189
2262
|
return "skipped";
|
|
@@ -2288,8 +2361,8 @@ var offerProjectInstructions = async (agents, options) => {
|
|
|
2288
2361
|
});
|
|
2289
2362
|
if (!wanted) return;
|
|
2290
2363
|
for (const target of targets) {
|
|
2291
|
-
await spinner(`Writing managed block to ${
|
|
2292
|
-
writeInstructionBlock(
|
|
2364
|
+
await spinner(`Writing managed block to ${join4(process.cwd(), target.file)}`, async () => {
|
|
2365
|
+
writeInstructionBlock(join4(process.cwd(), target.file), renderProjectAgentInstructions(target.label));
|
|
2293
2366
|
}, { optional: true });
|
|
2294
2367
|
}
|
|
2295
2368
|
console.log(` ${dim("Commit the file to share it. Teammates without a key fall back to the terminal.")}`);
|
|
@@ -2481,23 +2554,7 @@ var resolveAgents = async (options) => {
|
|
|
2481
2554
|
validate: (picked) => picked.length > 0 || "Select at least one agent, or re-run with --agents none."
|
|
2482
2555
|
});
|
|
2483
2556
|
};
|
|
2484
|
-
var AGENT_TARGETS =
|
|
2485
|
-
claude_code: [CLAUDE_JSON, CLAUDE_SETTINGS, join3(CLAUDE_SKILL_DIR, "SKILL.md")],
|
|
2486
|
-
codex: [join3(CODEX_HOME, "config.toml"), CODEX_HOOKS_JSON, join3(CODEX_SKILL_DIR, "SKILL.md"), CODEX_AGENTS_MD],
|
|
2487
|
-
gemini_cli: [GEMINI_SETTINGS, GEMINI_MD],
|
|
2488
|
-
hermes: [`the Hermes virtualenv (pip install ${HERMES_PIP_PACKAGE})`],
|
|
2489
|
-
cursor: [join3(CURSOR_PLUGIN_DIR, "mcp.json"), CURSOR_USER_HOOKS],
|
|
2490
|
-
vscode: [VSCODE_PLUGIN_MCP, ...vscodeSettingsTargets(existsSync)],
|
|
2491
|
-
opencode: [
|
|
2492
|
-
openCodePluginFile(),
|
|
2493
|
-
join3(openCodePluginDir(), "package.json"),
|
|
2494
|
-
openCodeConfigFile(),
|
|
2495
|
-
OPENCODE_INSTRUCTIONS()
|
|
2496
|
-
],
|
|
2497
|
-
fx: [fxMcpProfile(), fxSettings(), fxAgentsMd()],
|
|
2498
|
-
...compatibleRecord((profile) => compatibleTargetPaths(profile)),
|
|
2499
|
-
custom: ["nothing (prints connection details only)"]
|
|
2500
|
-
};
|
|
2557
|
+
var AGENT_TARGETS = agentSetupTargets(existsSync);
|
|
2501
2558
|
var reportDryRun = (apiKey, agents, keyCheck, controlMode) => {
|
|
2502
2559
|
console.log();
|
|
2503
2560
|
console.log(` ${bold("Dry run.")} ${dim("Nothing below has been written.")}`);
|