@pushary/agent-hooks 0.89.12 → 0.89.13
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 +17 -0
- package/README.md +1 -0
- package/dist/bin/pushary-bell-hook.js +4 -4
- package/dist/bin/pushary-bell.js +7 -7
- package/dist/bin/pushary-claude.js +133 -28
- package/dist/bin/pushary-clean.js +22 -13
- package/dist/bin/pushary-codex-bridge.js +9 -9
- package/dist/bin/pushary-codex-hook.js +8 -8
- package/dist/bin/pushary-codex.js +6 -6
- package/dist/bin/pushary-connect.js +8 -8
- package/dist/bin/pushary-daemon.js +15 -15
- package/dist/bin/pushary-disconnect.js +7 -7
- package/dist/bin/pushary-doctor.js +18 -18
- package/dist/bin/pushary-elicitation-hook.js +3 -3
- package/dist/bin/pushary-gemini-bridge.js +9 -9
- package/dist/bin/pushary-gemini-hook.js +7 -7
- package/dist/bin/pushary-hook.js +12 -12
- package/dist/bin/pushary-login.js +6 -6
- package/dist/bin/pushary-logout.js +6 -6
- package/dist/bin/pushary-mode.js +5 -5
- package/dist/bin/pushary-notification-hook.js +6 -6
- package/dist/bin/pushary-opencode-hook.js +7 -7
- package/dist/bin/pushary-permission-denied-hook.js +10 -10
- package/dist/bin/pushary-permission-hook.js +10 -10
- package/dist/bin/pushary-post-hook.js +6 -6
- package/dist/bin/pushary-prompt-hook.js +6 -6
- package/dist/bin/pushary-session-end-hook.js +6 -6
- package/dist/bin/pushary-session-start-hook.js +6 -6
- package/dist/bin/pushary-setup.js +19 -19
- package/dist/bin/pushary-stats.js +4 -4
- package/dist/bin/pushary-status.js +10 -10
- package/dist/bin/pushary-stop-hook.js +6 -6
- package/dist/bin/pushary-stopfailure-hook.js +6 -6
- package/dist/bin/pushary-suggestions.js +2 -2
- package/dist/bin/pushary-transcripts.d.ts +1 -0
- package/dist/bin/pushary-transcripts.js +79 -0
- package/dist/bin/pushary-upgrade.js +14 -14
- package/dist/bin/pushary-wait.js +5 -5
- package/dist/bin/pushary.js +3 -2
- package/dist/{chunk-OVEGEQSB.js → chunk-3YGGEDJK.js} +1 -1
- package/dist/{chunk-WDVQ6O4C.js → chunk-4IPSMEGT.js} +67 -5
- package/dist/{chunk-OCMOTJTW.js → chunk-5MNTWAAJ.js} +7 -7
- package/dist/{chunk-NBRM3FMD.js → chunk-5YEF55AX.js} +1 -1
- package/dist/{chunk-PS7DQ2SU.js → chunk-7JZCADBR.js} +2 -2
- package/dist/{chunk-XREW7RQ3.js → chunk-ANMHIZZY.js} +1 -1
- package/dist/{chunk-KVHP5ZME.js → chunk-B2HND22S.js} +1 -1
- package/dist/{chunk-VPLQFXCH.js → chunk-C56VHSXU.js} +1 -1
- package/dist/{chunk-6GU55AQQ.js → chunk-CBGGUEKE.js} +1 -1
- package/dist/{chunk-FCUUVHTS.js → chunk-FOGW6O2Y.js} +1 -1
- package/dist/{chunk-RLQWNEPM.js → chunk-GMJDQDXU.js} +14 -0
- package/dist/{chunk-5NDB3YOE.js → chunk-JTBDBKHU.js} +1 -1
- package/dist/{chunk-6V7ZDH3A.js → chunk-JVLB5CAJ.js} +3 -3
- package/dist/{chunk-MFNQ5IMW.js → chunk-KNLKHJZR.js} +1 -1
- package/dist/{chunk-JJV5Q4KG.js → chunk-M3UABYRT.js} +1 -1
- package/dist/{chunk-7HYJPOGG.js → chunk-MNTZKFZI.js} +4 -4
- package/dist/{chunk-NESKLV6R.js → chunk-MSTHT2M7.js} +3 -3
- package/dist/{chunk-JVZX5YRJ.js → chunk-N4QJ3CLX.js} +1 -1
- package/dist/{chunk-RNKPLUWC.js → chunk-NBDU3R3G.js} +1 -1
- package/dist/{chunk-OADGBOP7.js → chunk-OX35BSPV.js} +4 -4
- package/dist/{chunk-DHR4F2CR.js → chunk-RAEPAUNJ.js} +1 -1
- package/dist/{chunk-GKPURU7P.js → chunk-S4BLNILH.js} +1 -1
- package/dist/{chunk-3XSP5SML.js → chunk-VASZ6TWW.js} +2 -2
- package/dist/{chunk-OTPJ4FUR.js → chunk-WHDSJ6PD.js} +1 -1
- package/dist/chunk-YKLCWWEI.js +76 -0
- package/dist/{chunk-327YMKP5.js → chunk-YXT55PYF.js} +1 -1
- package/dist/{chunk-Y4WVZIEI.js → chunk-ZO43JTT3.js} +1 -1
- package/dist/{chunk-6VXNA5JB.js → chunk-ZP3SNUP7.js} +1 -1
- package/dist/{chunk-7DK3ZH3N.js → chunk-ZWEKONU6.js} +1 -1
- package/dist/src/index.js +10 -10
- package/package.json +3 -2
- /package/dist/{chunk-3MCEES6Z.js → chunk-QINYXLA5.js} +0 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,22 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.89.13
|
|
4
|
+
|
|
5
|
+
### Synced transcripts survive large turns and restarts safely
|
|
6
|
+
|
|
7
|
+
Oversized file reads and diffs are shortened before encryption instead of being
|
|
8
|
+
rejected by the server, with the removed UTF-8 byte count recorded in the turn.
|
|
9
|
+
Stable HMAC identifiers prevent transcript contents leaking through record ids,
|
|
10
|
+
and a resumed session reuses its persisted encryption key rather than conflicting
|
|
11
|
+
with the key already registered for that session.
|
|
12
|
+
|
|
13
|
+
Transcript recipients are now pinned on first use and later key changes stop sync
|
|
14
|
+
until the user explicitly runs `pushary transcripts trust --rotate`. First use
|
|
15
|
+
also fails closed when that pin cannot be stored, so no session key is wrapped to
|
|
16
|
+
an unrecorded recipient. New sessions can independently wrap their key for the
|
|
17
|
+
owner's phone and an optional audited compliance-recovery recipient; installations
|
|
18
|
+
without one remain compatible.
|
|
19
|
+
|
|
3
20
|
## 0.89.12
|
|
4
21
|
|
|
5
22
|
### Phone control installs as a native service, without a VM
|
package/README.md
CHANGED
|
@@ -200,6 +200,7 @@ stats Show the approval moments your agents hit while not connected
|
|
|
200
200
|
suggestions List rules mined from your own approvals
|
|
201
201
|
upgrade Update the globally installed hooks to the latest version
|
|
202
202
|
hook Run as a PreToolUse hook (reads stdin, writes stdout)
|
|
203
|
+
transcripts Show or re-trust the keys this machine seals transcripts to
|
|
203
204
|
```
|
|
204
205
|
|
|
205
206
|
Run `pushary <command> --help` for one command's options.
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import {
|
|
3
3
|
handleBell
|
|
4
|
-
} from "../chunk-
|
|
4
|
+
} from "../chunk-C56VHSXU.js";
|
|
5
5
|
import {
|
|
6
6
|
readHookInput
|
|
7
7
|
} from "../chunk-6CUUA7HO.js";
|
|
8
|
-
import "../chunk-
|
|
8
|
+
import "../chunk-NBDU3R3G.js";
|
|
9
9
|
import "../chunk-BC3VCZ3E.js";
|
|
10
|
-
import "../chunk-
|
|
10
|
+
import "../chunk-ANMHIZZY.js";
|
|
11
11
|
import "../chunk-4LL6LG5X.js";
|
|
12
12
|
import "../chunk-2UMNXADU.js";
|
|
13
|
-
import "../chunk-
|
|
13
|
+
import "../chunk-QINYXLA5.js";
|
|
14
14
|
|
|
15
15
|
// bin/pushary-bell-hook.ts
|
|
16
16
|
var main = async () => {
|
package/dist/bin/pushary-bell.js
CHANGED
|
@@ -5,14 +5,14 @@ import {
|
|
|
5
5
|
liveAgentCount,
|
|
6
6
|
ring,
|
|
7
7
|
upgradeThreshold
|
|
8
|
-
} from "../chunk-
|
|
8
|
+
} from "../chunk-C56VHSXU.js";
|
|
9
9
|
import {
|
|
10
10
|
guardBinary
|
|
11
11
|
} from "../chunk-VF3RTVWY.js";
|
|
12
12
|
import "../chunk-L4ZCFMWW.js";
|
|
13
13
|
import {
|
|
14
14
|
claudeSettings
|
|
15
|
-
} from "../chunk-
|
|
15
|
+
} from "../chunk-3YGGEDJK.js";
|
|
16
16
|
import {
|
|
17
17
|
createIo
|
|
18
18
|
} from "../chunk-5RUIFDTP.js";
|
|
@@ -21,22 +21,22 @@ import {
|
|
|
21
21
|
} from "../chunk-GMXKITVA.js";
|
|
22
22
|
import {
|
|
23
23
|
exitOnHelpFlag
|
|
24
|
-
} from "../chunk-
|
|
25
|
-
import "../chunk-
|
|
24
|
+
} from "../chunk-WHDSJ6PD.js";
|
|
25
|
+
import "../chunk-GMJDQDXU.js";
|
|
26
26
|
import "../chunk-DINDL2CF.js";
|
|
27
|
-
import "../chunk-
|
|
27
|
+
import "../chunk-NBDU3R3G.js";
|
|
28
28
|
import "../chunk-BC3VCZ3E.js";
|
|
29
29
|
import "../chunk-7QLSKOSU.js";
|
|
30
30
|
import {
|
|
31
31
|
EXIT
|
|
32
32
|
} from "../chunk-KZERVKTD.js";
|
|
33
|
-
import "../chunk-
|
|
33
|
+
import "../chunk-ANMHIZZY.js";
|
|
34
34
|
import {
|
|
35
35
|
readJsonSafe,
|
|
36
36
|
writeJsonAtomic
|
|
37
37
|
} from "../chunk-4LL6LG5X.js";
|
|
38
38
|
import "../chunk-2UMNXADU.js";
|
|
39
|
-
import "../chunk-
|
|
39
|
+
import "../chunk-QINYXLA5.js";
|
|
40
40
|
|
|
41
41
|
// src/bell/install.ts
|
|
42
42
|
import { join } from "path";
|
|
@@ -1,24 +1,30 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
+
import {
|
|
3
|
+
changedRecipientsMessage,
|
|
4
|
+
loadPin,
|
|
5
|
+
savePin,
|
|
6
|
+
verifyRecipients
|
|
7
|
+
} from "../chunk-YKLCWWEI.js";
|
|
2
8
|
import {
|
|
3
9
|
ensureDaemonRunning
|
|
4
|
-
} from "../chunk-
|
|
10
|
+
} from "../chunk-7JZCADBR.js";
|
|
5
11
|
import {
|
|
6
12
|
buildTranscriptRecords,
|
|
7
13
|
decodePublicKey,
|
|
8
14
|
generateSessionKey,
|
|
9
15
|
wrapSessionKey
|
|
10
|
-
} from "../chunk-
|
|
16
|
+
} from "../chunk-4IPSMEGT.js";
|
|
11
17
|
import {
|
|
12
18
|
fetchTranscriptRecipients,
|
|
13
19
|
uploadTranscriptRecords
|
|
14
20
|
} from "../chunk-QZCFVWA7.js";
|
|
15
21
|
import {
|
|
16
22
|
transcriptsEnabled
|
|
17
|
-
} from "../chunk-
|
|
23
|
+
} from "../chunk-M3UABYRT.js";
|
|
18
24
|
import {
|
|
19
25
|
startProcessOwnership,
|
|
20
26
|
withSpawnProcessOwnership
|
|
21
|
-
} from "../chunk-
|
|
27
|
+
} from "../chunk-CBGGUEKE.js";
|
|
22
28
|
import {
|
|
23
29
|
needsShell,
|
|
24
30
|
spawnClaude
|
|
@@ -32,7 +38,7 @@ import {
|
|
|
32
38
|
getPolicy,
|
|
33
39
|
repoKeyFor,
|
|
34
40
|
reportEvent
|
|
35
|
-
} from "../chunk-
|
|
41
|
+
} from "../chunk-OX35BSPV.js";
|
|
36
42
|
import {
|
|
37
43
|
DEFAULT_SESSION,
|
|
38
44
|
askUser,
|
|
@@ -50,19 +56,19 @@ import {
|
|
|
50
56
|
deriveToolTarget,
|
|
51
57
|
describeToolCall,
|
|
52
58
|
scopePathFor
|
|
53
|
-
} from "../chunk-
|
|
59
|
+
} from "../chunk-N4QJ3CLX.js";
|
|
54
60
|
import {
|
|
55
61
|
getMachineId
|
|
56
|
-
} from "../chunk-
|
|
57
|
-
import "../chunk-
|
|
62
|
+
} from "../chunk-JTBDBKHU.js";
|
|
63
|
+
import "../chunk-3YGGEDJK.js";
|
|
58
64
|
import "../chunk-DINDL2CF.js";
|
|
59
|
-
import "../chunk-
|
|
65
|
+
import "../chunk-NBDU3R3G.js";
|
|
60
66
|
import "../chunk-BC3VCZ3E.js";
|
|
61
67
|
import "../chunk-BSZYIAZL.js";
|
|
62
68
|
import "../chunk-SAF6HGAA.js";
|
|
63
69
|
import "../chunk-7QLSKOSU.js";
|
|
64
70
|
import "../chunk-KZERVKTD.js";
|
|
65
|
-
import "../chunk-
|
|
71
|
+
import "../chunk-ANMHIZZY.js";
|
|
66
72
|
import "../chunk-4LL6LG5X.js";
|
|
67
73
|
import {
|
|
68
74
|
getApiKey,
|
|
@@ -71,7 +77,7 @@ import {
|
|
|
71
77
|
import {
|
|
72
78
|
KILL_REASON,
|
|
73
79
|
resolveGate
|
|
74
|
-
} from "../chunk-
|
|
80
|
+
} from "../chunk-QINYXLA5.js";
|
|
75
81
|
|
|
76
82
|
// src/wrapper/claudeBinary.ts
|
|
77
83
|
import { statSync } from "fs";
|
|
@@ -147,13 +153,82 @@ var runLocalPassthrough = (binary, args2) => {
|
|
|
147
153
|
import { basename } from "path";
|
|
148
154
|
|
|
149
155
|
// src/transcript-sync.ts
|
|
156
|
+
import { homedir as homedir2 } from "os";
|
|
157
|
+
import { join as join3, resolve } from "path";
|
|
158
|
+
import { existsSync as existsSync2, readFileSync as readFileSync2 } from "fs";
|
|
159
|
+
|
|
160
|
+
// src/transcript-session-key.ts
|
|
161
|
+
import { existsSync, mkdirSync, readFileSync, readdirSync, rmSync, statSync as statSync2, writeFileSync } from "fs";
|
|
150
162
|
import { homedir } from "os";
|
|
151
|
-
import { join as join2
|
|
152
|
-
|
|
163
|
+
import { join as join2 } from "path";
|
|
164
|
+
var sessionDir = () => process.env.PUSHARY_SESSION_KEY_DIR?.trim() || join2(homedir(), ".pushary", "sessions");
|
|
165
|
+
var SESSION_KEY_TTL_MS = 48 * 60 * 60 * 1e3;
|
|
166
|
+
var SAFE_SESSION_ID = /^[A-Za-z0-9._-]{1,128}$/;
|
|
167
|
+
var fileFor = (sessionId) => SAFE_SESSION_ID.test(sessionId) ? join2(sessionDir(), `${sessionId}.json`) : null;
|
|
168
|
+
var loadSessionKey = (sessionId) => {
|
|
169
|
+
const path = fileFor(sessionId);
|
|
170
|
+
if (!path || !existsSync(path)) return null;
|
|
171
|
+
try {
|
|
172
|
+
if (Date.now() - statSync2(path).mtimeMs > SESSION_KEY_TTL_MS) return null;
|
|
173
|
+
const raw = JSON.parse(readFileSync(path, "utf-8"));
|
|
174
|
+
const key = typeof raw.sessionKey === "string" ? Buffer.from(raw.sessionKey, "base64") : null;
|
|
175
|
+
if (!key || key.length !== 32) return null;
|
|
176
|
+
return {
|
|
177
|
+
sessionKey: new Uint8Array(key),
|
|
178
|
+
wrappedKey: typeof raw.wrappedKey === "string" ? raw.wrappedKey : null,
|
|
179
|
+
providerWrappedKey: typeof raw.providerWrappedKey === "string" ? raw.providerWrappedKey : null,
|
|
180
|
+
providerKeyId: typeof raw.providerKeyId === "string" ? raw.providerKeyId : null,
|
|
181
|
+
keyUploaded: raw.keyUploaded === true
|
|
182
|
+
};
|
|
183
|
+
} catch {
|
|
184
|
+
return null;
|
|
185
|
+
}
|
|
186
|
+
};
|
|
187
|
+
var saveSessionKey = (sessionId, value) => {
|
|
188
|
+
const path = fileFor(sessionId);
|
|
189
|
+
if (!path) return;
|
|
190
|
+
try {
|
|
191
|
+
mkdirSync(sessionDir(), { recursive: true, mode: 448 });
|
|
192
|
+
writeFileSync(
|
|
193
|
+
path,
|
|
194
|
+
JSON.stringify({
|
|
195
|
+
sessionKey: Buffer.from(value.sessionKey).toString("base64"),
|
|
196
|
+
wrappedKey: value.wrappedKey,
|
|
197
|
+
providerWrappedKey: value.providerWrappedKey,
|
|
198
|
+
providerKeyId: value.providerKeyId,
|
|
199
|
+
keyUploaded: value.keyUploaded
|
|
200
|
+
}),
|
|
201
|
+
{ mode: 384 }
|
|
202
|
+
);
|
|
203
|
+
} catch {
|
|
204
|
+
}
|
|
205
|
+
};
|
|
206
|
+
var sweepStaleSessionKeys = (now = Date.now()) => {
|
|
207
|
+
const dir = sessionDir();
|
|
208
|
+
if (!existsSync(dir)) return 0;
|
|
209
|
+
let removed = 0;
|
|
210
|
+
try {
|
|
211
|
+
for (const name of readdirSync(dir)) {
|
|
212
|
+
if (!name.endsWith(".json")) continue;
|
|
213
|
+
const path = join2(dir, name);
|
|
214
|
+
try {
|
|
215
|
+
if (now - statSync2(path).mtimeMs <= SESSION_KEY_TTL_MS) continue;
|
|
216
|
+
rmSync(path, { force: true });
|
|
217
|
+
removed += 1;
|
|
218
|
+
} catch {
|
|
219
|
+
}
|
|
220
|
+
}
|
|
221
|
+
} catch {
|
|
222
|
+
return removed;
|
|
223
|
+
}
|
|
224
|
+
return removed;
|
|
225
|
+
};
|
|
226
|
+
|
|
227
|
+
// src/transcript-sync.ts
|
|
153
228
|
var claudeTranscriptPath = (cwd, sessionId) => {
|
|
154
229
|
const projectId = resolve(cwd).replace(/[^a-zA-Z0-9-]/g, "-");
|
|
155
|
-
const configDir = process.env.CLAUDE_CONFIG_DIR ||
|
|
156
|
-
return
|
|
230
|
+
const configDir = process.env.CLAUDE_CONFIG_DIR || join3(homedir2(), ".claude");
|
|
231
|
+
return join3(configDir, "projects", projectId, `${sessionId}.jsonl`);
|
|
157
232
|
};
|
|
158
233
|
var createSyncState = () => ({
|
|
159
234
|
sessionKey: null,
|
|
@@ -241,7 +316,7 @@ var chunkRecords = (records) => {
|
|
|
241
316
|
};
|
|
242
317
|
var readLines = (path) => {
|
|
243
318
|
try {
|
|
244
|
-
return
|
|
319
|
+
return existsSync2(path) ? readFileSync2(path, "utf-8").split("\n") : [];
|
|
245
320
|
} catch {
|
|
246
321
|
return [];
|
|
247
322
|
}
|
|
@@ -249,19 +324,49 @@ var readLines = (path) => {
|
|
|
249
324
|
var IDLE_CEILING_MS = 6e4;
|
|
250
325
|
var nextInterval = (previousMs, idle, baseMs, maxMs) => idle ? Math.min(previousMs * 2, maxMs) : baseMs;
|
|
251
326
|
var startTranscriptSync = (opts) => {
|
|
327
|
+
let warnedAboutRecipients = false;
|
|
328
|
+
const fetchPinnedRecipients = async () => {
|
|
329
|
+
const offer = await fetchTranscriptRecipients(opts.apiKey);
|
|
330
|
+
if (!offer) return null;
|
|
331
|
+
const verdict = verifyRecipients(offer, loadPin());
|
|
332
|
+
if (verdict.kind === "first-use" && !savePin(verdict.pin)) return null;
|
|
333
|
+
if (verdict.kind === "changed") {
|
|
334
|
+
if (!warnedAboutRecipients) {
|
|
335
|
+
warnedAboutRecipients = true;
|
|
336
|
+
process.stderr.write(`${changedRecipientsMessage(verdict, offer)}
|
|
337
|
+
`);
|
|
338
|
+
}
|
|
339
|
+
return null;
|
|
340
|
+
}
|
|
341
|
+
return offer;
|
|
342
|
+
};
|
|
252
343
|
const uploader = {
|
|
253
|
-
fetchTranscriptRecipients:
|
|
344
|
+
fetchTranscriptRecipients: fetchPinnedRecipients,
|
|
254
345
|
uploadRecords: (params) => uploadTranscriptRecords(opts.apiKey, params)
|
|
255
346
|
};
|
|
256
347
|
const path = claudeTranscriptPath(opts.cwd, opts.sessionId);
|
|
257
|
-
|
|
348
|
+
const persisted = loadSessionKey(opts.sessionId);
|
|
349
|
+
let state = persisted ? { ...createSyncState(), ...persisted } : createSyncState();
|
|
350
|
+
sweepStaleSessionKeys();
|
|
351
|
+
let persistedUploaded = persisted?.keyUploaded ?? false;
|
|
258
352
|
let running = true;
|
|
259
353
|
let inFlight = false;
|
|
260
354
|
const tick = async () => {
|
|
261
355
|
if (!running || inFlight) return;
|
|
262
356
|
inFlight = true;
|
|
263
357
|
try {
|
|
358
|
+
const before = state.sessionKey;
|
|
264
359
|
state = await syncTick(readLines(path), state, uploader, opts.sessionId, opts.machineId);
|
|
360
|
+
if (state.sessionKey && (before !== state.sessionKey || state.keyUploaded !== persistedUploaded)) {
|
|
361
|
+
persistedUploaded = state.keyUploaded;
|
|
362
|
+
saveSessionKey(opts.sessionId, {
|
|
363
|
+
sessionKey: state.sessionKey,
|
|
364
|
+
wrappedKey: state.wrappedKey,
|
|
365
|
+
providerWrappedKey: state.providerWrappedKey,
|
|
366
|
+
providerKeyId: state.providerKeyId,
|
|
367
|
+
keyUploaded: state.keyUploaded
|
|
368
|
+
});
|
|
369
|
+
}
|
|
265
370
|
} catch {
|
|
266
371
|
} finally {
|
|
267
372
|
inFlight = false;
|
|
@@ -292,9 +397,9 @@ var startTranscriptSync = (opts) => {
|
|
|
292
397
|
|
|
293
398
|
// src/wrapper/sdkLoader.ts
|
|
294
399
|
import { spawn } from "child_process";
|
|
295
|
-
import { existsSync as
|
|
296
|
-
import { homedir as
|
|
297
|
-
import { join as
|
|
400
|
+
import { existsSync as existsSync3, mkdirSync as mkdirSync2, writeFileSync as writeFileSync2 } from "fs";
|
|
401
|
+
import { homedir as homedir3 } from "os";
|
|
402
|
+
import { join as join4 } from "path";
|
|
298
403
|
import { pathToFileURL } from "url";
|
|
299
404
|
var userMessage = (text) => ({
|
|
300
405
|
type: "user",
|
|
@@ -304,8 +409,8 @@ var userMessage = (text) => ({
|
|
|
304
409
|
var SDK_VERSION = "0.3.207";
|
|
305
410
|
var SDK_PACKAGE = "@anthropic-ai/claude-agent-sdk";
|
|
306
411
|
var SDK_SPEC = `${SDK_PACKAGE}@${SDK_VERSION}`;
|
|
307
|
-
var sdkCacheDir = () => process.env.PUSHARY_REMOTE_SDK_DIR?.trim() ||
|
|
308
|
-
var cachedSdkEntry = () =>
|
|
412
|
+
var sdkCacheDir = () => process.env.PUSHARY_REMOTE_SDK_DIR?.trim() || join4(homedir3(), ".pushary", "remote-sdk");
|
|
413
|
+
var cachedSdkEntry = () => join4(sdkCacheDir(), "node_modules", "@anthropic-ai", "claude-agent-sdk", "sdk.mjs");
|
|
309
414
|
var importSdk = async (specifierOrUrl) => {
|
|
310
415
|
try {
|
|
311
416
|
const mod = await import(specifierOrUrl);
|
|
@@ -320,7 +425,7 @@ var loadClaudeSdk = async () => {
|
|
|
320
425
|
const fromResolution = await importSdk(SDK_PACKAGE);
|
|
321
426
|
if (fromResolution) return fromResolution;
|
|
322
427
|
const entry = cachedSdkEntry();
|
|
323
|
-
if (
|
|
428
|
+
if (existsSync3(entry)) return importSdk(pathToFileURL(entry).href);
|
|
324
429
|
return null;
|
|
325
430
|
};
|
|
326
431
|
var ensureClaudeSdk = async (log) => {
|
|
@@ -328,10 +433,10 @@ var ensureClaudeSdk = async (log) => {
|
|
|
328
433
|
if (present) return present;
|
|
329
434
|
const dir = sdkCacheDir();
|
|
330
435
|
try {
|
|
331
|
-
|
|
332
|
-
const pkgJson =
|
|
333
|
-
if (!
|
|
334
|
-
|
|
436
|
+
mkdirSync2(dir, { recursive: true });
|
|
437
|
+
const pkgJson = join4(dir, "package.json");
|
|
438
|
+
if (!existsSync3(pkgJson)) {
|
|
439
|
+
writeFileSync2(pkgJson, `${JSON.stringify({ name: "pushary-remote-sdk", private: true })}
|
|
335
440
|
`);
|
|
336
441
|
}
|
|
337
442
|
} catch {
|
|
@@ -9,10 +9,10 @@ import {
|
|
|
9
9
|
shortenHome,
|
|
10
10
|
unregisterPluginLocation,
|
|
11
11
|
vscodeSettingsTargets
|
|
12
|
-
} from "../chunk-
|
|
12
|
+
} from "../chunk-VASZ6TWW.js";
|
|
13
13
|
import {
|
|
14
14
|
pusharyHookExecutable
|
|
15
|
-
} from "../chunk-
|
|
15
|
+
} from "../chunk-MSTHT2M7.js";
|
|
16
16
|
import {
|
|
17
17
|
OPENCODE_PLUGIN_SIBLING,
|
|
18
18
|
OPENCODE_PLUGIN_SIBLING_CONTENTS,
|
|
@@ -22,25 +22,25 @@ import {
|
|
|
22
22
|
openCodePluginDir,
|
|
23
23
|
openCodePluginFile,
|
|
24
24
|
removeOpenCodeMcpServer
|
|
25
|
-
} from "../chunk-
|
|
25
|
+
} from "../chunk-ZWEKONU6.js";
|
|
26
26
|
import {
|
|
27
27
|
isClaudeMcpSnapshot,
|
|
28
28
|
removeClaudeMcpServers,
|
|
29
29
|
removeGeminiSettings,
|
|
30
30
|
removePusharySettings,
|
|
31
31
|
restoreClaudeMcpServer
|
|
32
|
-
} from "../chunk-
|
|
33
|
-
import "../chunk-
|
|
32
|
+
} from "../chunk-JVLB5CAJ.js";
|
|
33
|
+
import "../chunk-B2HND22S.js";
|
|
34
34
|
import "../chunk-VF3RTVWY.js";
|
|
35
35
|
import {
|
|
36
36
|
disableDaemonService
|
|
37
|
-
} from "../chunk-
|
|
37
|
+
} from "../chunk-7JZCADBR.js";
|
|
38
38
|
import "../chunk-XHKBHWLX.js";
|
|
39
39
|
import {
|
|
40
40
|
execNpm
|
|
41
41
|
} from "../chunk-L4ZCFMWW.js";
|
|
42
|
-
import "../chunk-
|
|
43
|
-
import "../chunk-
|
|
42
|
+
import "../chunk-N4QJ3CLX.js";
|
|
43
|
+
import "../chunk-JTBDBKHU.js";
|
|
44
44
|
import {
|
|
45
45
|
claudeJson,
|
|
46
46
|
claudeMcpReceipt,
|
|
@@ -63,14 +63,14 @@ import {
|
|
|
63
63
|
removeCodexHookTrust,
|
|
64
64
|
removeCodexHooks,
|
|
65
65
|
vscodePluginDir
|
|
66
|
-
} from "../chunk-
|
|
66
|
+
} from "../chunk-3YGGEDJK.js";
|
|
67
67
|
import {
|
|
68
68
|
rejectUnknownFlags
|
|
69
69
|
} from "../chunk-GMXKITVA.js";
|
|
70
70
|
import {
|
|
71
71
|
exitOnHelpFlag
|
|
72
|
-
} from "../chunk-
|
|
73
|
-
import "../chunk-
|
|
72
|
+
} from "../chunk-WHDSJ6PD.js";
|
|
73
|
+
import "../chunk-GMJDQDXU.js";
|
|
74
74
|
import "../chunk-DINDL2CF.js";
|
|
75
75
|
import {
|
|
76
76
|
removeClaudeAlias
|
|
@@ -84,7 +84,7 @@ import "../chunk-2UMNXADU.js";
|
|
|
84
84
|
import {
|
|
85
85
|
CURSOR_GATE_EVENTS,
|
|
86
86
|
HOOK_LOCATOR_BINARY
|
|
87
|
-
} from "../chunk-
|
|
87
|
+
} from "../chunk-QINYXLA5.js";
|
|
88
88
|
|
|
89
89
|
// bin/pushary-clean.ts
|
|
90
90
|
import { existsSync, readFileSync, copyFileSync, readdirSync } from "fs";
|
|
@@ -122,7 +122,16 @@ var APP_OWNED_ENTRIES = [
|
|
|
122
122
|
// Shared: AgentInstaller.vscodePlugin writes .pushary/plugins/vscode, and so
|
|
123
123
|
// does the CLI. Not attributable, so it is kept whenever the app is installed
|
|
124
124
|
// rather than removed and left registered against a path that is gone.
|
|
125
|
-
"plugins"
|
|
125
|
+
"plugins",
|
|
126
|
+
// Shared, and the one whose loss is silent. `identity.ts` writes this Mac's id
|
|
127
|
+
// here and `DeviceIdentity.current()` reads it in preference to its own
|
|
128
|
+
// UserDefaults copy, precisely so one Mac has one id. Deleting it while the app
|
|
129
|
+
// is installed does not stop the app: it falls back to the copy it minted
|
|
130
|
+
// before that reconciliation existed, and the Mac starts reporting two ids that
|
|
131
|
+
// can never compare equal. A session tagged with the other one is then a
|
|
132
|
+
// session the app refuses to fetch messages for, and one `TerminalJump` calls
|
|
133
|
+
// `.onAnotherMachine`.
|
|
134
|
+
"machine-id"
|
|
126
135
|
];
|
|
127
136
|
var isAppOwned = (name) => APP_OWNED_ENTRIES.includes(name);
|
|
128
137
|
|
|
@@ -6,16 +6,16 @@ import {
|
|
|
6
6
|
postLiveSession,
|
|
7
7
|
postLiveSessionUntilAccepted,
|
|
8
8
|
startLiveSessionHeartbeat
|
|
9
|
-
} from "../chunk-
|
|
10
|
-
import "../chunk-
|
|
9
|
+
} from "../chunk-ZP3SNUP7.js";
|
|
10
|
+
import "../chunk-4IPSMEGT.js";
|
|
11
11
|
import "../chunk-QZCFVWA7.js";
|
|
12
12
|
import {
|
|
13
13
|
transcriptsEnabled
|
|
14
|
-
} from "../chunk-
|
|
14
|
+
} from "../chunk-M3UABYRT.js";
|
|
15
15
|
import {
|
|
16
16
|
startProcessOwnership,
|
|
17
17
|
withSpawnProcessOwnership
|
|
18
|
-
} from "../chunk-
|
|
18
|
+
} from "../chunk-CBGGUEKE.js";
|
|
19
19
|
import {
|
|
20
20
|
spawnClaude
|
|
21
21
|
} from "../chunk-XHKBHWLX.js";
|
|
@@ -24,17 +24,17 @@ import {
|
|
|
24
24
|
} from "../chunk-L4ZCFMWW.js";
|
|
25
25
|
import {
|
|
26
26
|
getMachineId
|
|
27
|
-
} from "../chunk-
|
|
28
|
-
import "../chunk-
|
|
29
|
-
import "../chunk-
|
|
27
|
+
} from "../chunk-JTBDBKHU.js";
|
|
28
|
+
import "../chunk-3YGGEDJK.js";
|
|
29
|
+
import "../chunk-NBDU3R3G.js";
|
|
30
30
|
import "../chunk-BC3VCZ3E.js";
|
|
31
|
-
import "../chunk-
|
|
31
|
+
import "../chunk-ANMHIZZY.js";
|
|
32
32
|
import "../chunk-4LL6LG5X.js";
|
|
33
33
|
import {
|
|
34
34
|
getApiKey,
|
|
35
35
|
getBaseUrl
|
|
36
36
|
} from "../chunk-2UMNXADU.js";
|
|
37
|
-
import "../chunk-
|
|
37
|
+
import "../chunk-QINYXLA5.js";
|
|
38
38
|
|
|
39
39
|
// bin/pushary-codex-bridge.ts
|
|
40
40
|
import { existsSync } from "fs";
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import {
|
|
3
3
|
defersToNativeMode
|
|
4
|
-
} from "../chunk-
|
|
4
|
+
} from "../chunk-S4BLNILH.js";
|
|
5
5
|
import {
|
|
6
6
|
isGatingMoment,
|
|
7
7
|
recordKeylessMoment
|
|
8
|
-
} from "../chunk-
|
|
8
|
+
} from "../chunk-FOGW6O2Y.js";
|
|
9
9
|
import {
|
|
10
10
|
readHookInput
|
|
11
11
|
} from "../chunk-6CUUA7HO.js";
|
|
@@ -34,7 +34,7 @@ import {
|
|
|
34
34
|
toCodexWire,
|
|
35
35
|
toPolicyLookup,
|
|
36
36
|
toPolicyLookups
|
|
37
|
-
} from "../chunk-
|
|
37
|
+
} from "../chunk-OX35BSPV.js";
|
|
38
38
|
import {
|
|
39
39
|
DEFAULT_SESSION,
|
|
40
40
|
askUser,
|
|
@@ -50,18 +50,18 @@ import {
|
|
|
50
50
|
deriveToolTarget,
|
|
51
51
|
describeToolCall,
|
|
52
52
|
scopePathFor
|
|
53
|
-
} from "../chunk-
|
|
53
|
+
} from "../chunk-N4QJ3CLX.js";
|
|
54
54
|
import {
|
|
55
55
|
getMachineId
|
|
56
|
-
} from "../chunk-
|
|
56
|
+
} from "../chunk-JTBDBKHU.js";
|
|
57
57
|
import {
|
|
58
58
|
canonicalJson
|
|
59
|
-
} from "../chunk-
|
|
59
|
+
} from "../chunk-3YGGEDJK.js";
|
|
60
60
|
import "../chunk-BSZYIAZL.js";
|
|
61
61
|
import "../chunk-SAF6HGAA.js";
|
|
62
62
|
import "../chunk-7QLSKOSU.js";
|
|
63
63
|
import "../chunk-KZERVKTD.js";
|
|
64
|
-
import "../chunk-
|
|
64
|
+
import "../chunk-ANMHIZZY.js";
|
|
65
65
|
import "../chunk-4LL6LG5X.js";
|
|
66
66
|
import {
|
|
67
67
|
getApiKey
|
|
@@ -73,7 +73,7 @@ import {
|
|
|
73
73
|
hookWaitClamped,
|
|
74
74
|
hookWaitDeadline,
|
|
75
75
|
resolveGate
|
|
76
|
-
} from "../chunk-
|
|
76
|
+
} from "../chunk-QINYXLA5.js";
|
|
77
77
|
|
|
78
78
|
// bin/pushary-codex-hook.ts
|
|
79
79
|
import { basename } from "path";
|
|
@@ -1,26 +1,26 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import {
|
|
3
3
|
reportEvent
|
|
4
|
-
} from "../chunk-
|
|
4
|
+
} from "../chunk-OX35BSPV.js";
|
|
5
5
|
import {
|
|
6
6
|
askUser,
|
|
7
7
|
waitForAnswer
|
|
8
8
|
} from "../chunk-JHJHCMAF.js";
|
|
9
|
-
import "../chunk-
|
|
9
|
+
import "../chunk-N4QJ3CLX.js";
|
|
10
10
|
import {
|
|
11
11
|
getMachineId
|
|
12
|
-
} from "../chunk-
|
|
13
|
-
import "../chunk-
|
|
12
|
+
} from "../chunk-JTBDBKHU.js";
|
|
13
|
+
import "../chunk-3YGGEDJK.js";
|
|
14
14
|
import "../chunk-BSZYIAZL.js";
|
|
15
15
|
import "../chunk-SAF6HGAA.js";
|
|
16
16
|
import "../chunk-7QLSKOSU.js";
|
|
17
17
|
import "../chunk-KZERVKTD.js";
|
|
18
|
-
import "../chunk-
|
|
18
|
+
import "../chunk-ANMHIZZY.js";
|
|
19
19
|
import "../chunk-4LL6LG5X.js";
|
|
20
20
|
import {
|
|
21
21
|
getApiKey
|
|
22
22
|
} from "../chunk-2UMNXADU.js";
|
|
23
|
-
import "../chunk-
|
|
23
|
+
import "../chunk-QINYXLA5.js";
|
|
24
24
|
|
|
25
25
|
// bin/pushary-codex.ts
|
|
26
26
|
import { basename } from "path";
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import {
|
|
3
3
|
printKeyCheck
|
|
4
|
-
} from "../chunk-
|
|
4
|
+
} from "../chunk-YXT55PYF.js";
|
|
5
5
|
import {
|
|
6
6
|
confirmAppConnection,
|
|
7
7
|
connectDevice,
|
|
8
8
|
printConnectInstructions
|
|
9
|
-
} from "../chunk-
|
|
9
|
+
} from "../chunk-KNLKHJZR.js";
|
|
10
10
|
import "../chunk-3EGEA4KH.js";
|
|
11
11
|
import {
|
|
12
12
|
checkApiKey
|
|
13
|
-
} from "../chunk-
|
|
13
|
+
} from "../chunk-ZO43JTT3.js";
|
|
14
14
|
import {
|
|
15
15
|
createIo
|
|
16
16
|
} from "../chunk-5RUIFDTP.js";
|
|
@@ -19,12 +19,12 @@ import {
|
|
|
19
19
|
} from "../chunk-GMXKITVA.js";
|
|
20
20
|
import {
|
|
21
21
|
exitOnHelpFlag
|
|
22
|
-
} from "../chunk-
|
|
23
|
-
import "../chunk-
|
|
22
|
+
} from "../chunk-WHDSJ6PD.js";
|
|
23
|
+
import "../chunk-GMJDQDXU.js";
|
|
24
24
|
import "../chunk-DINDL2CF.js";
|
|
25
25
|
import {
|
|
26
26
|
readKeySource
|
|
27
|
-
} from "../chunk-
|
|
27
|
+
} from "../chunk-NBDU3R3G.js";
|
|
28
28
|
import "../chunk-BC3VCZ3E.js";
|
|
29
29
|
import "../chunk-BSZYIAZL.js";
|
|
30
30
|
import "../chunk-SAF6HGAA.js";
|
|
@@ -34,10 +34,10 @@ import {
|
|
|
34
34
|
import {
|
|
35
35
|
EXIT
|
|
36
36
|
} from "../chunk-KZERVKTD.js";
|
|
37
|
-
import "../chunk-
|
|
37
|
+
import "../chunk-ANMHIZZY.js";
|
|
38
38
|
import "../chunk-4LL6LG5X.js";
|
|
39
39
|
import "../chunk-2UMNXADU.js";
|
|
40
|
-
import "../chunk-
|
|
40
|
+
import "../chunk-QINYXLA5.js";
|
|
41
41
|
|
|
42
42
|
// bin/pushary-connect.ts
|
|
43
43
|
exitOnHelpFlag("connect");
|