pushary 1.9.76 → 1.9.78
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 +15 -0
- package/dist/{api-YDCHRRA4.js → api-4WCUP47K.js} +10 -10
- package/dist/bin/pushary-bell-hook.js +25 -25
- package/dist/bin/pushary-bell.js +10 -10
- package/dist/bin/pushary-claude.js +26 -26
- package/dist/bin/pushary-clean.js +34 -34
- package/dist/bin/pushary-codex-bridge.js +21 -21
- package/dist/bin/pushary-codex-hook.js +30 -30
- package/dist/bin/pushary-codex-session.js +8 -8
- package/dist/bin/pushary-codex.js +13 -13
- package/dist/bin/pushary-connect.js +26 -26
- package/dist/bin/pushary-cowork.js +5 -5
- package/dist/bin/pushary-daemon.js +122 -66
- package/dist/bin/pushary-disconnect.js +25 -25
- package/dist/bin/pushary-display-hook.js +16 -16
- package/dist/bin/pushary-doctor.js +42 -42
- package/dist/bin/pushary-elicitation-hook.js +25 -25
- package/dist/bin/pushary-gemini-bridge.js +15 -15
- package/dist/bin/pushary-gemini-hook.js +27 -27
- package/dist/bin/pushary-hook.js +29 -29
- package/dist/bin/pushary-login.js +20 -20
- package/dist/bin/pushary-logout.js +24 -24
- package/dist/bin/pushary-mcp.js +11 -11
- package/dist/bin/pushary-mode.js +15 -15
- package/dist/bin/pushary-notification-hook.js +24 -24
- package/dist/bin/pushary-opencode-hook.js +26 -26
- package/dist/bin/pushary-permission-denied-hook.js +29 -29
- package/dist/bin/pushary-permission-hook.js +29 -29
- package/dist/bin/pushary-post-hook.js +24 -24
- package/dist/bin/pushary-prompt-hook.js +24 -24
- package/dist/bin/pushary-session-end-hook.js +26 -26
- package/dist/bin/pushary-session-start-hook.js +34 -34
- package/dist/bin/pushary-setup.js +58 -55
- package/dist/bin/pushary-stats.js +5 -5
- package/dist/bin/pushary-status.js +31 -31
- package/dist/bin/pushary-stop-hook.js +24 -24
- package/dist/bin/pushary-stopfailure-hook.js +24 -24
- package/dist/bin/pushary-suggestions.js +15 -15
- package/dist/bin/pushary-transcript-register.js +46 -18
- package/dist/bin/pushary-transcripts.js +19 -19
- package/dist/bin/pushary-upgrade.js +40 -40
- package/dist/bin/pushary-wait.js +15 -15
- package/dist/bin/pushary.js +7 -7
- package/dist/{chunk-TFYFQM5C.js → chunk-22FLBWJH.js} +2 -2
- package/dist/{chunk-KGWLDNNT.js → chunk-3XH4YLCN.js} +4 -4
- package/dist/{chunk-5FV472Q2.js → chunk-42Y7IZSV.js} +1 -1
- package/dist/{chunk-PPD64MZW.js → chunk-4DOJLAGR.js} +1 -1
- package/dist/{chunk-CUD6SYDG.js → chunk-4FYY6YW3.js} +1 -1
- package/dist/{chunk-BUR2LYQI.js → chunk-4ZSQPGAU.js} +2 -2
- package/dist/{chunk-MMVIKXCP.js → chunk-56POFDRB.js} +3 -3
- package/dist/{chunk-JNV5LOZH.js → chunk-5F3L3QOO.js} +4 -4
- package/dist/{chunk-WK2L3XVQ.js → chunk-5QOMMZFZ.js} +1 -1
- package/dist/{chunk-USZJJWZL.js → chunk-5WU6534E.js} +2 -2
- package/dist/{chunk-DZF2M3LM.js → chunk-5YHI2FN4.js} +6 -6
- package/dist/{chunk-ZY25SNFQ.js → chunk-6HDYWRCP.js} +1 -1
- package/dist/{chunk-47TIRGS5.js → chunk-6WOG2SCC.js} +1 -0
- package/dist/{chunk-4LX5QUFV.js → chunk-74NZ3CJQ.js} +1 -1
- package/dist/{chunk-W5AUTVVL.js → chunk-74R4IZ7N.js} +5 -5
- package/dist/{chunk-VZSSL6US.js → chunk-7BMBXTN4.js} +14 -14
- package/dist/{chunk-DB3NOEDW.js → chunk-7KMI2G24.js} +6 -6
- package/dist/{chunk-UEY4SHY2.js → chunk-AOGM34LL.js} +1 -1
- package/dist/{chunk-2QFYEB3P.js → chunk-B4MQSH3R.js} +5 -5
- package/dist/{chunk-F7R7M5MG.js → chunk-BE5BA3GF.js} +1 -1
- package/dist/{chunk-74ONBRPF.js → chunk-BM3AT5AF.js} +4 -4
- package/dist/{chunk-JZ5KV2FK.js → chunk-C5LCOXAC.js} +5 -5
- package/dist/{chunk-XLGD5LDG.js → chunk-CHBK47DU.js} +3 -3
- package/dist/{chunk-USMUW3LI.js → chunk-DLOUKVLM.js} +2 -2
- package/dist/{chunk-UMBVIFP5.js → chunk-DQCQQ2PY.js} +1 -1
- package/dist/{chunk-MTRZQR2R.js → chunk-EDHOHS3C.js} +3 -3
- package/dist/{chunk-M5VJ3HXB.js → chunk-FMDP5KWV.js} +6 -6
- package/dist/{chunk-CHIOUBPB.js → chunk-IVBQ5ISS.js} +13 -13
- package/dist/{chunk-5M5F4IWR.js → chunk-IVY6LYTO.js} +1 -1
- package/dist/{chunk-WLHHDDVA.js → chunk-JLBLEFBK.js} +3 -3
- package/dist/{chunk-WRCM4XGY.js → chunk-JM4WO3JT.js} +2 -2
- package/dist/{chunk-GJVV2EUC.js → chunk-KJYZXX7X.js} +5 -3
- package/dist/{chunk-NJTAUEW6.js → chunk-L2S7KWMF.js} +1 -1
- package/dist/{chunk-5KPMDLXB.js → chunk-LXSGNGK5.js} +3 -3
- package/dist/{chunk-VELPOV2F.js → chunk-MJXP5MFI.js} +4 -4
- package/dist/{chunk-YLB4AGZJ.js → chunk-MPZFQP6O.js} +1 -1
- package/dist/{chunk-E7U4YM4A.js → chunk-NFK5ZCLK.js} +3 -3
- package/dist/{chunk-7LLC4R66.js → chunk-NH7C6QBI.js} +4 -4
- package/dist/{chunk-Y4OBAK4I.js → chunk-OFJUHEEG.js} +8 -5
- package/dist/{chunk-IRLHN5UP.js → chunk-OFQACQDL.js} +27 -7
- package/dist/{chunk-CMNB4IZO.js → chunk-OOODSAHW.js} +3 -3
- package/dist/{chunk-7ZOWQBHQ.js → chunk-PYW7VWVZ.js} +5 -5
- package/dist/{chunk-M7JFGDGP.js → chunk-Q53QJQLY.js} +1 -1
- package/dist/{chunk-R3HXGHRQ.js → chunk-RCDZ2XZ6.js} +1 -1
- package/dist/{chunk-XJ5DYPTM.js → chunk-RDU5HWKU.js} +4 -4
- package/dist/{chunk-MAWC4PJV.js → chunk-RIVCTSYV.js} +5 -5
- package/dist/{chunk-E2VJ7B7D.js → chunk-RJEG3TUZ.js} +6 -6
- package/dist/{chunk-QUGP76DQ.js → chunk-SV2C7PZV.js} +6 -6
- package/dist/{chunk-7SFP6Y5U.js → chunk-T2MJ5H2V.js} +603 -162
- package/dist/{chunk-3YU6NIIL.js → chunk-TDLK3ZU2.js} +4 -4
- package/dist/{chunk-C2AR7QXU.js → chunk-TKQGDSO4.js} +2 -2
- package/dist/{chunk-2BK2EQOB.js → chunk-TNNB7P6Z.js} +7 -7
- package/dist/{chunk-7KYQ24FI.js → chunk-TQYSBYYZ.js} +4 -4
- package/dist/{chunk-IRN6JLSM.js → chunk-TRTAYW7Z.js} +4 -4
- package/dist/{chunk-SWRNJ3BP.js → chunk-VIIQLZJS.js} +3 -3
- package/dist/{chunk-NFUV25JZ.js → chunk-VYELSTZK.js} +3 -3
- package/dist/{chunk-S7C5NY4R.js → chunk-VZHDSUXK.js} +1 -1
- package/dist/{chunk-FAGQAR6I.js → chunk-WHTWHHE3.js} +478 -161
- package/dist/{chunk-57MQNSM5.js → chunk-WJTUCQ47.js} +1 -1
- package/dist/{chunk-KWGOKO4E.js → chunk-XCBKGQ6N.js} +3 -3
- package/dist/{chunk-T2EJ3H6Y.js → chunk-Y4I5YX3L.js} +3 -3
- package/dist/{chunk-GII565PB.js → chunk-YH3RAWMV.js} +1 -1
- package/dist/{chunk-NQA56AMZ.js → chunk-YJK3LBAJ.js} +6 -6
- package/dist/{chunk-B2PFCS72.js → chunk-YOPFR22Y.js} +2 -2
- package/dist/{chunk-5NW7VM35.js → chunk-YP35CA5L.js} +2 -2
- package/dist/{chunk-ITLWEGLE.js → chunk-Z5VZWDGL.js} +15 -5
- package/dist/{chunk-Y2CYSVWU.js → chunk-Z6DZHUCO.js} +6 -6
- package/dist/{chunk-YDPGBBV7.js → chunk-ZFS2Y5GK.js} +5 -5
- package/dist/{chunk-NVLKH5FS.js → chunk-ZM3ELQPE.js} +9 -9
- package/dist/{codex-app-cards-switch-3OUTABVU.js → codex-app-cards-switch-GUZ7XMPB.js} +11 -11
- package/dist/{codex-desktop-launch-JH3E2CIA.js → codex-desktop-launch-Q5UINXU6.js} +1 -1
- package/dist/{codex-session-launch-GR363OQN.js → codex-session-launch-4G5AFXXU.js} +18 -18
- package/dist/{config-R43UFHX7.js → config-725HOJFK.js} +3 -3
- package/dist/{global-upgrade-73GP4MZM.js → global-upgrade-AXTMEH3I.js} +10 -10
- package/dist/{identity-CA7CZGDL.js → identity-HLIZDGEN.js} +4 -4
- package/dist/{live-capabilities-RCGMQIIZ.js → live-capabilities-A74OIHWN.js} +5 -5
- package/dist/{paths-H7VNNB46.js → paths-ZHDLQD25.js} +3 -3
- package/dist/{reapply-3UIA3CUO.js → reapply-RC2AMGCQ.js} +27 -27
- package/dist/src/index.js +28 -28
- package/dist/{upgrade-lock-ZTLX5PDF.js → upgrade-lock-4B3D3OCT.js} +4 -4
- package/dist/{usage-C53NVWC2.js → usage-VVPEFYKS.js} +3 -3
- package/package.json +1 -1
|
@@ -1,30 +1,30 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import {
|
|
3
3
|
inspectConfiguredManagedProviders
|
|
4
|
-
} from "../chunk-
|
|
4
|
+
} from "../chunk-7BMBXTN4.js";
|
|
5
5
|
import {
|
|
6
6
|
HEARTBEAT_INTERVAL_MS,
|
|
7
7
|
sendHeartbeat
|
|
8
|
-
} from "../chunk-
|
|
9
|
-
import "../chunk-
|
|
8
|
+
} from "../chunk-B4MQSH3R.js";
|
|
9
|
+
import "../chunk-5WU6534E.js";
|
|
10
10
|
import {
|
|
11
11
|
readSignedOutDiagnosis
|
|
12
|
-
} from "../chunk-
|
|
12
|
+
} from "../chunk-YOPFR22Y.js";
|
|
13
13
|
import {
|
|
14
14
|
HERMES_INSTALL_MARKER_FILE,
|
|
15
15
|
defaultHermesHome,
|
|
16
16
|
parseHermesInstallMarker
|
|
17
|
-
} from "../chunk-
|
|
17
|
+
} from "../chunk-WHTWHHE3.js";
|
|
18
18
|
import {
|
|
19
19
|
writeHuman
|
|
20
20
|
} from "../chunk-QCGNGEGE.js";
|
|
21
|
-
import "../chunk-
|
|
22
|
-
import "../chunk-
|
|
23
|
-
import "../chunk-
|
|
24
|
-
import "../chunk-
|
|
21
|
+
import "../chunk-74R4IZ7N.js";
|
|
22
|
+
import "../chunk-VIIQLZJS.js";
|
|
23
|
+
import "../chunk-TKQGDSO4.js";
|
|
24
|
+
import "../chunk-SV2C7PZV.js";
|
|
25
25
|
import {
|
|
26
26
|
exitOnHelpFlag
|
|
27
|
-
} from "../chunk-
|
|
27
|
+
} from "../chunk-5QOMMZFZ.js";
|
|
28
28
|
import {
|
|
29
29
|
codexBinaryIsBroken,
|
|
30
30
|
detectProviderLiveCapabilities,
|
|
@@ -33,8 +33,8 @@ import {
|
|
|
33
33
|
launchableProviders,
|
|
34
34
|
resolveControlPolicy,
|
|
35
35
|
trackProviderInventory
|
|
36
|
-
} from "../chunk-
|
|
37
|
-
import "../chunk-
|
|
36
|
+
} from "../chunk-BM3AT5AF.js";
|
|
37
|
+
import "../chunk-VYELSTZK.js";
|
|
38
38
|
import {
|
|
39
39
|
SESSION_REAP_SILENCE_MS,
|
|
40
40
|
describeIdleWindow,
|
|
@@ -42,17 +42,17 @@ import {
|
|
|
42
42
|
listProcessProofs,
|
|
43
43
|
ownsLiveProcess,
|
|
44
44
|
silentSpawnedProofs
|
|
45
|
-
} from "../chunk-
|
|
46
|
-
import "../chunk-
|
|
45
|
+
} from "../chunk-CHBK47DU.js";
|
|
46
|
+
import "../chunk-DQCQQ2PY.js";
|
|
47
47
|
import {
|
|
48
48
|
readLocalAutoUpdateReport
|
|
49
|
-
} from "../chunk-
|
|
49
|
+
} from "../chunk-OOODSAHW.js";
|
|
50
50
|
import {
|
|
51
51
|
startRegisteredTranscripts
|
|
52
|
-
} from "../chunk-
|
|
53
|
-
import "../chunk-
|
|
52
|
+
} from "../chunk-T2MJ5H2V.js";
|
|
53
|
+
import "../chunk-MPZFQP6O.js";
|
|
54
54
|
import "../chunk-MHUKYYYR.js";
|
|
55
|
-
import "../chunk-
|
|
55
|
+
import "../chunk-TDLK3ZU2.js";
|
|
56
56
|
import {
|
|
57
57
|
DAEMON_LEASE_RENEW_INTERVAL_MS,
|
|
58
58
|
acquireDaemonLease,
|
|
@@ -69,53 +69,53 @@ import {
|
|
|
69
69
|
requestDaemonHandoff,
|
|
70
70
|
stopDaemonRunning,
|
|
71
71
|
writeDaemonNeedsLogin
|
|
72
|
-
} from "../chunk-
|
|
72
|
+
} from "../chunk-7KMI2G24.js";
|
|
73
73
|
import {
|
|
74
74
|
hookOwnerOf
|
|
75
|
-
} from "../chunk-
|
|
76
|
-
import "../chunk-
|
|
77
|
-
import "../chunk-
|
|
75
|
+
} from "../chunk-3XH4YLCN.js";
|
|
76
|
+
import "../chunk-4DOJLAGR.js";
|
|
77
|
+
import "../chunk-42Y7IZSV.js";
|
|
78
78
|
import "../chunk-NMUI3ZWG.js";
|
|
79
|
-
import "../chunk-
|
|
79
|
+
import "../chunk-Z5VZWDGL.js";
|
|
80
80
|
import "../chunk-XMSDA5WA.js";
|
|
81
|
-
import "../chunk-
|
|
81
|
+
import "../chunk-IVY6LYTO.js";
|
|
82
82
|
import {
|
|
83
83
|
spawnClaude
|
|
84
84
|
} from "../chunk-XHKBHWLX.js";
|
|
85
85
|
import {
|
|
86
86
|
readControlMode
|
|
87
|
-
} from "../chunk-
|
|
87
|
+
} from "../chunk-NH7C6QBI.js";
|
|
88
88
|
import {
|
|
89
89
|
pendingCommandReceipts,
|
|
90
90
|
removePendingCommand
|
|
91
|
-
} from "../chunk-
|
|
92
|
-
import "../chunk-
|
|
93
|
-
import "../chunk-
|
|
91
|
+
} from "../chunk-ZM3ELQPE.js";
|
|
92
|
+
import "../chunk-6HDYWRCP.js";
|
|
93
|
+
import "../chunk-PYW7VWVZ.js";
|
|
94
94
|
import "../chunk-POFBE6ZY.js";
|
|
95
|
-
import "../chunk-
|
|
96
|
-
import "../chunk-
|
|
97
|
-
import "../chunk-
|
|
95
|
+
import "../chunk-5F3L3QOO.js";
|
|
96
|
+
import "../chunk-NFK5ZCLK.js";
|
|
97
|
+
import "../chunk-XCBKGQ6N.js";
|
|
98
98
|
import {
|
|
99
99
|
getMachineId
|
|
100
|
-
} from "../chunk-
|
|
101
|
-
import "../chunk-
|
|
100
|
+
} from "../chunk-4ZSQPGAU.js";
|
|
101
|
+
import "../chunk-YP35CA5L.js";
|
|
102
102
|
import {
|
|
103
103
|
claudeConfigDir,
|
|
104
104
|
codexHome
|
|
105
|
-
} from "../chunk-
|
|
105
|
+
} from "../chunk-TQYSBYYZ.js";
|
|
106
106
|
import {
|
|
107
107
|
resolveBinary,
|
|
108
108
|
writeJsonAtomicDurable
|
|
109
|
-
} from "../chunk-
|
|
109
|
+
} from "../chunk-Y4I5YX3L.js";
|
|
110
110
|
import {
|
|
111
111
|
getApiKey,
|
|
112
112
|
getBaseUrl
|
|
113
|
-
} from "../chunk-
|
|
113
|
+
} from "../chunk-Q53QJQLY.js";
|
|
114
114
|
import "../chunk-PPY5N2E6.js";
|
|
115
115
|
import {
|
|
116
116
|
EXIT
|
|
117
117
|
} from "../chunk-KZERVKTD.js";
|
|
118
|
-
import "../chunk-
|
|
118
|
+
import "../chunk-RCDZ2XZ6.js";
|
|
119
119
|
import "../chunk-QTOLNRET.js";
|
|
120
120
|
import {
|
|
121
121
|
CLAUDE_INBOX,
|
|
@@ -145,13 +145,14 @@ import {
|
|
|
145
145
|
parseHermesAdmission,
|
|
146
146
|
parseHermesReplayCursor,
|
|
147
147
|
qualifyHermesReceiptMode
|
|
148
|
-
} from "../chunk-
|
|
148
|
+
} from "../chunk-OFJUHEEG.js";
|
|
149
149
|
import "../chunk-MLKGABMK.js";
|
|
150
150
|
|
|
151
151
|
// src/native-host-receiver.ts
|
|
152
152
|
import { join as join2 } from "path";
|
|
153
153
|
import { homedir } from "os";
|
|
154
154
|
import { readFileSync as readFileSync3 } from "fs";
|
|
155
|
+
import { createHash as createHash2 } from "crypto";
|
|
155
156
|
|
|
156
157
|
// src/native-host.ts
|
|
157
158
|
import WebSocket from "ws";
|
|
@@ -525,7 +526,7 @@ var NativeHostClient = class {
|
|
|
525
526
|
if (!node.isFile() || node.uid !== process.getuid?.() || node.size > 4096 || (node.mode & 63) !== 0)
|
|
526
527
|
throw new Error("unsafe intent");
|
|
527
528
|
const v = JSON.parse(readFileSync(file, "utf8"));
|
|
528
|
-
if (!nativeRecord(v) || v.version !== NATIVE_INPUT.journalVersion || v.agent !== this.options.agent || v.sessionId !== sessionId || v.commandId !== commandId || v.home !== resolve(this.options.home) || typeof v.submittedAtMs !== "number" || !Number.isSafeInteger(v.submittedAtMs) || typeof v.accepted !== "boolean" || v.hermesCursor !== void 0 && !parseHermesReplayCursor(v.hermesCursor))
|
|
529
|
+
if (!nativeRecord(v) || v.version !== NATIVE_INPUT.journalVersion || v.agent !== this.options.agent || v.sessionId !== sessionId || v.commandId !== commandId || v.home !== resolve(this.options.home) || typeof v.submittedAtMs !== "number" || !Number.isSafeInteger(v.submittedAtMs) || typeof v.accepted !== "boolean" || v.settlementScope !== void 0 && typeof v.settlementScope !== "string" || v.hermesCursor !== void 0 && !parseHermesReplayCursor(v.hermesCursor))
|
|
529
530
|
throw new Error("invalid intent");
|
|
530
531
|
const hermesCursor = parseHermesReplayCursor(v.hermesCursor);
|
|
531
532
|
return {
|
|
@@ -537,6 +538,7 @@ var NativeHostClient = class {
|
|
|
537
538
|
submittedAtMs: v.submittedAtMs,
|
|
538
539
|
accepted: v.accepted,
|
|
539
540
|
settled: v.settled === true,
|
|
541
|
+
settlementScope: v.settlementScope,
|
|
540
542
|
...hermesCursor ? { hermesCursor } : {}
|
|
541
543
|
};
|
|
542
544
|
} catch (e) {
|
|
@@ -554,7 +556,7 @@ var NativeHostClient = class {
|
|
|
554
556
|
if (!nativeRecord(raw) || !nativeIdentifier(raw.sessionId) || !nativeIdentifier(raw.commandId))
|
|
555
557
|
return [];
|
|
556
558
|
const intent = this.readIntent(raw.sessionId, raw.commandId);
|
|
557
|
-
return intent?.accepted && !intent.settled ? [{ sessionId: intent.sessionId, commandId: intent.commandId }] : [];
|
|
559
|
+
return intent?.accepted && !intent.settled && intent.settlementScope === this.options.settlementScope ? [{ sessionId: intent.sessionId, commandId: intent.commandId }] : [];
|
|
558
560
|
} catch {
|
|
559
561
|
return [];
|
|
560
562
|
}
|
|
@@ -586,6 +588,7 @@ var NativeHostClient = class {
|
|
|
586
588
|
home: resolve(this.options.home),
|
|
587
589
|
submittedAtMs: Date.now(),
|
|
588
590
|
accepted: false,
|
|
591
|
+
settlementScope: this.options.settlementScope,
|
|
589
592
|
...hermesCursor ? { hermesCursor } : {}
|
|
590
593
|
})
|
|
591
594
|
);
|
|
@@ -724,6 +727,7 @@ var startNativeInputReceiver = (apiKey, machineId, options) => {
|
|
|
724
727
|
const baseUrl = options.baseUrl ?? getBaseUrl();
|
|
725
728
|
const abort = new AbortController();
|
|
726
729
|
const busy = /* @__PURE__ */ new Set();
|
|
730
|
+
const settling = /* @__PURE__ */ new Set();
|
|
727
731
|
const heartbeats = /* @__PURE__ */ new Map();
|
|
728
732
|
const settlements = /* @__PURE__ */ new Map();
|
|
729
733
|
let scanning = false;
|
|
@@ -746,7 +750,8 @@ var startNativeInputReceiver = (apiKey, machineId, options) => {
|
|
|
746
750
|
};
|
|
747
751
|
const settle = async (commandId) => {
|
|
748
752
|
const pending = settlements.get(commandId);
|
|
749
|
-
if (!pending) return false;
|
|
753
|
+
if (!pending || settling.has(commandId) || settling.size >= CLAUDE_INBOX_RECEIVER.maxConcurrent) return false;
|
|
754
|
+
settling.add(commandId);
|
|
750
755
|
try {
|
|
751
756
|
const receipt = await post("/api/agent/command/ack", {
|
|
752
757
|
...pending,
|
|
@@ -755,7 +760,9 @@ var startNativeInputReceiver = (apiKey, machineId, options) => {
|
|
|
755
760
|
});
|
|
756
761
|
if (!isCommandAcknowledgementReceipt(receipt))
|
|
757
762
|
throw new Error("native acknowledgement missing receipt");
|
|
758
|
-
|
|
763
|
+
const current = settlements.get(commandId);
|
|
764
|
+
if (current?.state !== pending.state || current.failureCode !== pending.failureCode || current.sessionId !== pending.sessionId) return false;
|
|
765
|
+
if (pending.state === "delivered") client.confirmSettlement(pending.sessionId, commandId);
|
|
759
766
|
settlements.delete(commandId);
|
|
760
767
|
return true;
|
|
761
768
|
} catch (error) {
|
|
@@ -764,15 +771,13 @@ var startNativeInputReceiver = (apiKey, machineId, options) => {
|
|
|
764
771
|
error instanceof Error ? error.message : "native receipt recovery failed"
|
|
765
772
|
);
|
|
766
773
|
return false;
|
|
774
|
+
} finally {
|
|
775
|
+
settling.delete(commandId);
|
|
767
776
|
}
|
|
768
777
|
};
|
|
769
778
|
const receive = async (sessionId) => {
|
|
770
779
|
busy.add(sessionId);
|
|
771
780
|
try {
|
|
772
|
-
if ([...settlements.values()].some(
|
|
773
|
-
(receipt) => receipt.sessionId === sessionId
|
|
774
|
-
))
|
|
775
|
-
return;
|
|
776
781
|
const raw = await post("/api/agent/command/native", {
|
|
777
782
|
operation: "claim" /* claim */,
|
|
778
783
|
sessionId,
|
|
@@ -804,7 +809,13 @@ var startNativeInputReceiver = (apiKey, machineId, options) => {
|
|
|
804
809
|
state: "delivered"
|
|
805
810
|
});
|
|
806
811
|
}
|
|
807
|
-
for (const commandId of [...settlements
|
|
812
|
+
for (const [commandId, receipt] of [...settlements]) {
|
|
813
|
+
if (settling.size >= CLAUDE_INBOX_RECEIVER.maxConcurrent) break;
|
|
814
|
+
if (settling.has(commandId)) continue;
|
|
815
|
+
settlements.delete(commandId);
|
|
816
|
+
settlements.set(commandId, receipt);
|
|
817
|
+
void settle(commandId);
|
|
818
|
+
}
|
|
808
819
|
const sessions = (await client.sessions()).filter(options.ownsSession).slice(0, CLAUDE_INBOX_MAX_SESSIONS);
|
|
809
820
|
if (!sessions.length) return;
|
|
810
821
|
for (const session of sessions) {
|
|
@@ -871,6 +882,8 @@ var ownsHermes = (home) => {
|
|
|
871
882
|
}
|
|
872
883
|
};
|
|
873
884
|
var startNativeHostReceivers = (apiKey, machineId, report) => {
|
|
885
|
+
const baseUrl = getBaseUrl().replace(/\/+$/, "");
|
|
886
|
+
const settlementScope = createHash2("sha256").update(`${baseUrl}\0${apiKey}\0${machineId}`).digest("hex");
|
|
874
887
|
const homes = {
|
|
875
888
|
["codex" /* codex */]: codexHome(),
|
|
876
889
|
["hermes" /* hermes */]: defaultHermesHome()
|
|
@@ -878,11 +891,13 @@ var startNativeHostReceivers = (apiKey, machineId, report) => {
|
|
|
878
891
|
const stops = Object.values(NativeInputAgent).map((agent) => {
|
|
879
892
|
const home = homes[agent];
|
|
880
893
|
return startNativeInputReceiver(apiKey, machineId, {
|
|
894
|
+
baseUrl,
|
|
881
895
|
client: new NativeHostClient({
|
|
882
896
|
agent,
|
|
883
897
|
home,
|
|
884
898
|
report,
|
|
885
|
-
journalDir: join2(homedir(), ".pushary", NATIVE_INPUT.journalDirectory)
|
|
899
|
+
journalDir: join2(homedir(), ".pushary", NATIVE_INPUT.journalDirectory),
|
|
900
|
+
settlementScope
|
|
886
901
|
}),
|
|
887
902
|
agentType: agent,
|
|
888
903
|
agentName: agent === "codex" /* codex */ ? "Codex" : "Hermes",
|
|
@@ -928,15 +943,14 @@ import { join as join4, basename as basename2 } from "path";
|
|
|
928
943
|
import { homedir as homedir2 } from "os";
|
|
929
944
|
|
|
930
945
|
// src/claude-inbox.ts
|
|
931
|
-
import { createHash as
|
|
932
|
-
import { execFileSync } from "child_process";
|
|
946
|
+
import { createHash as createHash3, randomUUID } from "crypto";
|
|
933
947
|
import {
|
|
934
948
|
closeSync as closeSync2,
|
|
935
949
|
fsyncSync as fsyncSync2,
|
|
936
950
|
lstatSync as lstatSync2,
|
|
937
951
|
mkdirSync as mkdirSync2,
|
|
938
952
|
openSync as openSync2,
|
|
939
|
-
readFileSync as
|
|
953
|
+
readFileSync as readFileSync5,
|
|
940
954
|
readdirSync as readdirSync2,
|
|
941
955
|
readSync,
|
|
942
956
|
statSync,
|
|
@@ -946,21 +960,35 @@ import {
|
|
|
946
960
|
import { dirname as dirname2, isAbsolute, join as join3, resolve as resolve2 } from "path";
|
|
947
961
|
import { Socket } from "net";
|
|
948
962
|
import { setTimeout as delay } from "timers/promises";
|
|
949
|
-
|
|
950
|
-
|
|
951
|
-
|
|
952
|
-
|
|
953
|
-
|
|
954
|
-
|
|
955
|
-
|
|
963
|
+
|
|
964
|
+
// src/claude-process-identity.ts
|
|
965
|
+
import { execFileSync } from "child_process";
|
|
966
|
+
import { readFileSync as readFileSync4, readlinkSync } from "fs";
|
|
967
|
+
var linuxProcessStart = (stat) => {
|
|
968
|
+
const closingName = stat.lastIndexOf(")");
|
|
969
|
+
if (closingName < 0) return null;
|
|
970
|
+
const fields = stat.slice(closingName + 1).trim().split(/\s+/);
|
|
971
|
+
if (!/^\d+ \(/.test(stat) || fields[0] === "Z" || fields[0] === "X") return null;
|
|
972
|
+
const ticks = fields[19];
|
|
973
|
+
return ticks && /^\d+$/.test(ticks) ? ticks : null;
|
|
956
974
|
};
|
|
957
|
-
var
|
|
958
|
-
const
|
|
959
|
-
|
|
975
|
+
var linuxProcessDomain = (machineId, namespace) => {
|
|
976
|
+
const machine = machineId.trim();
|
|
977
|
+
if (!/^[a-f0-9]{32}$/i.test(machine) || !/^pid:\[\d+\]$/.test(namespace)) return null;
|
|
978
|
+
return `linux:${machine}:${namespace}`;
|
|
979
|
+
};
|
|
980
|
+
var currentClaudeProcessDomain = () => {
|
|
981
|
+
if (process.platform !== "linux") return null;
|
|
982
|
+
try {
|
|
983
|
+
return linuxProcessDomain(readFileSync4("/etc/machine-id", "utf8"), readlinkSync("/proc/self/ns/pid"));
|
|
984
|
+
} catch {
|
|
985
|
+
return null;
|
|
986
|
+
}
|
|
960
987
|
};
|
|
961
|
-
var
|
|
962
|
-
if (process.platform !== "darwin") return null;
|
|
988
|
+
var currentClaudeProcessStart = (pid) => {
|
|
963
989
|
try {
|
|
990
|
+
if (process.platform === "linux") return linuxProcessStart(readFileSync4(`/proc/${pid}/stat`, "utf8"));
|
|
991
|
+
if (process.platform !== "darwin") return null;
|
|
964
992
|
return execFileSync("/bin/ps", ["-p", String(pid), "-o", "lstart="], {
|
|
965
993
|
encoding: "utf8",
|
|
966
994
|
env: { ...process.env, TZ: "UTC", LC_ALL: "C" },
|
|
@@ -970,6 +998,25 @@ var processStart = (pid) => {
|
|
|
970
998
|
return null;
|
|
971
999
|
}
|
|
972
1000
|
};
|
|
1001
|
+
var matchesClaudeProcess = (session, platform, processStart, pidDomain) => {
|
|
1002
|
+
if (!processStart || processStart !== session.procStart) return false;
|
|
1003
|
+
if (platform === "linux") return pidDomain !== null && pidDomain === session.pidDomain;
|
|
1004
|
+
return platform === "darwin";
|
|
1005
|
+
};
|
|
1006
|
+
|
|
1007
|
+
// src/claude-inbox.ts
|
|
1008
|
+
var object = (value) => typeof value === "object" && value !== null && !Array.isArray(value);
|
|
1009
|
+
var digest = (value) => createHash3("sha256").update(value).digest("hex");
|
|
1010
|
+
var readObject = (file) => {
|
|
1011
|
+
const stat = lstatSync2(file);
|
|
1012
|
+
if (!stat.isFile() || stat.size > CLAUDE_INBOX.maxRecordBytes || stat.uid !== process.getuid?.())
|
|
1013
|
+
throw new Error("Invalid inbox record");
|
|
1014
|
+
return JSON.parse(readFileSync5(file, "utf8"));
|
|
1015
|
+
};
|
|
1016
|
+
var readKey = (file) => {
|
|
1017
|
+
const value = readObject(file);
|
|
1018
|
+
return object(value) && typeof value.peerToken === "string" && /^[0-9a-f]{32}$/.test(value.peerToken) && typeof value.procStart === "string" ? { peerToken: value.peerToken, procStart: value.procStart } : null;
|
|
1019
|
+
};
|
|
973
1020
|
var transcriptPath = (config, session) => join3(
|
|
974
1021
|
config,
|
|
975
1022
|
"projects",
|
|
@@ -1054,11 +1101,12 @@ var ClaudeInboxClient = class {
|
|
|
1054
1101
|
return sessions.flatMap((file) => {
|
|
1055
1102
|
try {
|
|
1056
1103
|
const session = parseClaudeInboxSession(
|
|
1057
|
-
readObject(join3(this.options.configDir, "sessions", file))
|
|
1104
|
+
readObject(join3(this.options.configDir, "sessions", file)),
|
|
1105
|
+
this.options.platform ?? process.platform
|
|
1058
1106
|
);
|
|
1059
1107
|
if (!session || file !== `${session.pid}.json` || !isAbsolute(session.cwd) || !isAbsolute(session.messagingSocketPath))
|
|
1060
1108
|
return [];
|
|
1061
|
-
if (
|
|
1109
|
+
if (!this.processMatches(session))
|
|
1062
1110
|
return [];
|
|
1063
1111
|
const socket = lstatSync2(session.messagingSocketPath);
|
|
1064
1112
|
if (!socket.isSocket() || socket.uid !== process.getuid?.()) return [];
|
|
@@ -1071,6 +1119,14 @@ var ClaudeInboxClient = class {
|
|
|
1071
1119
|
return [];
|
|
1072
1120
|
}
|
|
1073
1121
|
}
|
|
1122
|
+
processMatches(session) {
|
|
1123
|
+
return matchesClaudeProcess(
|
|
1124
|
+
session,
|
|
1125
|
+
this.options.platform ?? process.platform,
|
|
1126
|
+
(this.options.processStart ?? currentClaudeProcessStart)(session.pid),
|
|
1127
|
+
(this.options.pidDomain ?? currentClaudeProcessDomain)()
|
|
1128
|
+
);
|
|
1129
|
+
}
|
|
1074
1130
|
key(session) {
|
|
1075
1131
|
const canonicalSocket = session.messagingSocketPath.replace(
|
|
1076
1132
|
/^\/private(?=\/(?:tmp|var|etc)\/)/,
|
|
@@ -1135,7 +1191,7 @@ var ClaudeInboxClient = class {
|
|
|
1135
1191
|
if (!key) return "wake_not_sent" /* notSent */;
|
|
1136
1192
|
const socket = await connectInbox(session.messagingSocketPath);
|
|
1137
1193
|
if (!socket) return "wake_not_sent" /* notSent */;
|
|
1138
|
-
if (signal?.aborted ||
|
|
1194
|
+
if (signal?.aborted || !this.processMatches(session)) {
|
|
1139
1195
|
socket.destroy();
|
|
1140
1196
|
return "wake_not_sent" /* notSent */;
|
|
1141
1197
|
}
|
|
@@ -2,18 +2,18 @@
|
|
|
2
2
|
import {
|
|
3
3
|
declinedAgentsFile,
|
|
4
4
|
recordDeclinedAgent
|
|
5
|
-
} from "../chunk-
|
|
5
|
+
} from "../chunk-56POFDRB.js";
|
|
6
6
|
import {
|
|
7
7
|
isCursorPluginLeftover,
|
|
8
8
|
isPusharyCursorPluginManifest,
|
|
9
9
|
releaseSoleGate
|
|
10
|
-
} from "../chunk-
|
|
10
|
+
} from "../chunk-MJXP5MFI.js";
|
|
11
11
|
import {
|
|
12
12
|
planFxRemoval,
|
|
13
13
|
removeClineServer
|
|
14
|
-
} from "../chunk-
|
|
15
|
-
import "../chunk-
|
|
16
|
-
import "../chunk-
|
|
14
|
+
} from "../chunk-74R4IZ7N.js";
|
|
15
|
+
import "../chunk-VIIQLZJS.js";
|
|
16
|
+
import "../chunk-TKQGDSO4.js";
|
|
17
17
|
import {
|
|
18
18
|
OPENCODE_PLUGIN_SIBLING,
|
|
19
19
|
OPENCODE_PLUGIN_SIBLING_CONTENTS,
|
|
@@ -25,10 +25,10 @@ import {
|
|
|
25
25
|
openCodePluginDir,
|
|
26
26
|
openCodePluginFile,
|
|
27
27
|
removeOpenCodeMcpServer
|
|
28
|
-
} from "../chunk-
|
|
28
|
+
} from "../chunk-SV2C7PZV.js";
|
|
29
29
|
import {
|
|
30
30
|
exitOnHelpFlag
|
|
31
|
-
} from "../chunk-
|
|
31
|
+
} from "../chunk-5QOMMZFZ.js";
|
|
32
32
|
import {
|
|
33
33
|
compatibleConfigFile,
|
|
34
34
|
compatibleDocuments,
|
|
@@ -38,25 +38,25 @@ import {
|
|
|
38
38
|
isEmptiedPusharyOwnedDocument,
|
|
39
39
|
removeCompatibleHooks,
|
|
40
40
|
removeCompatibleMcpServer
|
|
41
|
-
} from "../chunk-
|
|
41
|
+
} from "../chunk-TDLK3ZU2.js";
|
|
42
42
|
import {
|
|
43
43
|
removeGeminiSettings
|
|
44
|
-
} from "../chunk-
|
|
45
|
-
import "../chunk-
|
|
46
|
-
import "../chunk-
|
|
44
|
+
} from "../chunk-3XH4YLCN.js";
|
|
45
|
+
import "../chunk-4DOJLAGR.js";
|
|
46
|
+
import "../chunk-42Y7IZSV.js";
|
|
47
47
|
import {
|
|
48
48
|
parseFlags
|
|
49
49
|
} from "../chunk-NMUI3ZWG.js";
|
|
50
|
-
import "../chunk-
|
|
51
|
-
import "../chunk-
|
|
52
|
-
import "../chunk-
|
|
53
|
-
import "../chunk-
|
|
50
|
+
import "../chunk-NH7C6QBI.js";
|
|
51
|
+
import "../chunk-ZM3ELQPE.js";
|
|
52
|
+
import "../chunk-6HDYWRCP.js";
|
|
53
|
+
import "../chunk-PYW7VWVZ.js";
|
|
54
54
|
import "../chunk-POFBE6ZY.js";
|
|
55
|
-
import "../chunk-
|
|
56
|
-
import "../chunk-
|
|
57
|
-
import "../chunk-
|
|
58
|
-
import "../chunk-
|
|
59
|
-
import "../chunk-
|
|
55
|
+
import "../chunk-5F3L3QOO.js";
|
|
56
|
+
import "../chunk-NFK5ZCLK.js";
|
|
57
|
+
import "../chunk-XCBKGQ6N.js";
|
|
58
|
+
import "../chunk-4ZSQPGAU.js";
|
|
59
|
+
import "../chunk-YP35CA5L.js";
|
|
60
60
|
import {
|
|
61
61
|
claudeJson,
|
|
62
62
|
claudeMcpReceipt,
|
|
@@ -86,11 +86,11 @@ import {
|
|
|
86
86
|
removePusharySettings,
|
|
87
87
|
removePusharyToolPermissions,
|
|
88
88
|
restoreClaudeMcpServer
|
|
89
|
-
} from "../chunk-
|
|
89
|
+
} from "../chunk-TQYSBYYZ.js";
|
|
90
90
|
import {
|
|
91
91
|
readFileOrMissing
|
|
92
|
-
} from "../chunk-
|
|
93
|
-
import "../chunk-
|
|
92
|
+
} from "../chunk-Y4I5YX3L.js";
|
|
93
|
+
import "../chunk-Q53QJQLY.js";
|
|
94
94
|
import {
|
|
95
95
|
UsageError
|
|
96
96
|
} from "../chunk-PPY5N2E6.js";
|
|
@@ -99,14 +99,14 @@ import {
|
|
|
99
99
|
} from "../chunk-KZERVKTD.js";
|
|
100
100
|
import {
|
|
101
101
|
isInvocationOf
|
|
102
|
-
} from "../chunk-
|
|
102
|
+
} from "../chunk-RCDZ2XZ6.js";
|
|
103
103
|
import "../chunk-QTOLNRET.js";
|
|
104
104
|
import {
|
|
105
105
|
DISCONNECTABLE_AGENTS,
|
|
106
106
|
DISCONNECT_AGENT_IDS,
|
|
107
107
|
hookCompatibleProfileBySource,
|
|
108
108
|
normalizeAgentId
|
|
109
|
-
} from "../chunk-
|
|
109
|
+
} from "../chunk-OFJUHEEG.js";
|
|
110
110
|
import "../chunk-MLKGABMK.js";
|
|
111
111
|
|
|
112
112
|
// bin/pushary-disconnect.ts
|
|
@@ -5,31 +5,31 @@ import {
|
|
|
5
5
|
loadSessionKey,
|
|
6
6
|
registeredTranscriptEnabled,
|
|
7
7
|
sessionKeyDirectory
|
|
8
|
-
} from "../chunk-
|
|
9
|
-
import "../chunk-
|
|
8
|
+
} from "../chunk-T2MJ5H2V.js";
|
|
9
|
+
import "../chunk-MPZFQP6O.js";
|
|
10
10
|
import "../chunk-MHUKYYYR.js";
|
|
11
|
-
import "../chunk-
|
|
12
|
-
import "../chunk-
|
|
13
|
-
import "../chunk-
|
|
14
|
-
import "../chunk-
|
|
11
|
+
import "../chunk-7KMI2G24.js";
|
|
12
|
+
import "../chunk-3XH4YLCN.js";
|
|
13
|
+
import "../chunk-4DOJLAGR.js";
|
|
14
|
+
import "../chunk-42Y7IZSV.js";
|
|
15
15
|
import "../chunk-NMUI3ZWG.js";
|
|
16
|
-
import "../chunk-
|
|
16
|
+
import "../chunk-Z5VZWDGL.js";
|
|
17
17
|
import "../chunk-XMSDA5WA.js";
|
|
18
|
-
import "../chunk-
|
|
18
|
+
import "../chunk-IVY6LYTO.js";
|
|
19
19
|
import "../chunk-XHKBHWLX.js";
|
|
20
|
-
import "../chunk-
|
|
21
|
-
import "../chunk-
|
|
22
|
-
import "../chunk-
|
|
23
|
-
import "../chunk-
|
|
24
|
-
import "../chunk-
|
|
20
|
+
import "../chunk-NH7C6QBI.js";
|
|
21
|
+
import "../chunk-4ZSQPGAU.js";
|
|
22
|
+
import "../chunk-YP35CA5L.js";
|
|
23
|
+
import "../chunk-TQYSBYYZ.js";
|
|
24
|
+
import "../chunk-Y4I5YX3L.js";
|
|
25
25
|
import {
|
|
26
26
|
getApiKey
|
|
27
|
-
} from "../chunk-
|
|
27
|
+
} from "../chunk-Q53QJQLY.js";
|
|
28
28
|
import "../chunk-PPY5N2E6.js";
|
|
29
29
|
import "../chunk-KZERVKTD.js";
|
|
30
|
-
import "../chunk-
|
|
30
|
+
import "../chunk-RCDZ2XZ6.js";
|
|
31
31
|
import "../chunk-QTOLNRET.js";
|
|
32
|
-
import "../chunk-
|
|
32
|
+
import "../chunk-OFJUHEEG.js";
|
|
33
33
|
import "../chunk-MLKGABMK.js";
|
|
34
34
|
|
|
35
35
|
// src/claude-display-capture.ts
|