@pushary/agent-hooks 1.9.54 → 1.9.56
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 +20 -0
- package/dist/{api-K6ZROHYB.js → api-JHBUZ7CV.js} +11 -11
- package/dist/bin/pushary-bell-hook.js +29 -29
- package/dist/bin/pushary-bell.js +11 -11
- package/dist/bin/pushary-claude.js +31 -30
- package/dist/bin/pushary-clean.js +35 -34
- package/dist/bin/pushary-codex-bridge.js +23 -22
- package/dist/bin/pushary-codex-hook.js +34 -34
- package/dist/bin/pushary-codex-session.js +8 -8
- package/dist/bin/pushary-codex.js +15 -15
- package/dist/bin/pushary-connect.js +27 -27
- package/dist/bin/pushary-cowork.js +5 -5
- package/dist/bin/pushary-daemon.js +40 -39
- package/dist/bin/pushary-disconnect.js +27 -27
- package/dist/bin/pushary-doctor.js +47 -40
- package/dist/bin/pushary-elicitation-hook.js +29 -29
- package/dist/bin/pushary-gemini-bridge.js +17 -16
- package/dist/bin/pushary-gemini-hook.js +31 -31
- package/dist/bin/pushary-hook.js +33 -33
- package/dist/bin/pushary-login.js +14 -14
- package/dist/bin/pushary-logout.js +27 -27
- package/dist/bin/pushary-mcp.js +12 -12
- package/dist/bin/pushary-mode.js +14 -14
- package/dist/bin/pushary-notification-hook.js +28 -28
- package/dist/bin/pushary-opencode-hook.js +30 -30
- package/dist/bin/pushary-permission-denied-hook.js +33 -33
- package/dist/bin/pushary-permission-hook.js +32 -32
- package/dist/bin/pushary-post-hook.js +28 -28
- package/dist/bin/pushary-prompt-hook.js +28 -28
- package/dist/bin/pushary-session-end-hook.js +30 -29
- package/dist/bin/pushary-session-start-hook.js +36 -35
- package/dist/bin/pushary-setup.js +90 -60
- package/dist/bin/pushary-stats.js +5 -5
- package/dist/bin/pushary-status.js +31 -30
- package/dist/bin/pushary-stop-hook.js +28 -28
- package/dist/bin/pushary-stopfailure-hook.js +28 -28
- package/dist/bin/pushary-suggestions.js +14 -14
- package/dist/bin/pushary-transcript-register.js +20 -20
- package/dist/bin/pushary-transcripts.js +9 -9
- package/dist/bin/pushary-upgrade.js +37 -36
- package/dist/bin/pushary-wait.js +14 -14
- package/dist/bin/pushary.js +8 -8
- package/dist/{chunk-EK7SZJ4K.js → chunk-32MSOGMD.js} +3 -3
- package/dist/{chunk-LIESRXK5.js → chunk-4OXULVUA.js} +1 -1
- package/dist/{chunk-FV34HT35.js → chunk-4US3BCQJ.js} +1 -1
- package/dist/{chunk-OML4YFBN.js → chunk-57EOP757.js} +2 -2
- package/dist/{chunk-NSY2V7XU.js → chunk-5HMYW5W2.js} +1 -1
- package/dist/{chunk-L5YTS2BP.js → chunk-5HRXOANL.js} +3 -3
- package/dist/{chunk-IHUFRAHB.js → chunk-6PUHW2FP.js} +4 -4
- package/dist/{chunk-FCMWUYIE.js → chunk-6U3L4K57.js} +2 -2
- package/dist/{chunk-U2L42GVI.js → chunk-724266XT.js} +10 -10
- package/dist/{chunk-Q7OXI6VS.js → chunk-74DKFWU2.js} +5 -5
- package/dist/{chunk-RIVNNBEK.js → chunk-7QAL23TB.js} +27 -12
- package/dist/{chunk-RL7EOD6I.js → chunk-AKBFNTJF.js} +11 -11
- package/dist/{chunk-56ZTIY6D.js → chunk-AKFTQT7P.js} +3 -3
- package/dist/{chunk-JOWF4Y4P.js → chunk-DFZTZRKL.js} +4 -4
- package/dist/{chunk-BL3WAGIK.js → chunk-DUACX6E3.js} +7 -7
- package/dist/{chunk-2LEH5IGX.js → chunk-DWV3LTUH.js} +28 -14
- package/dist/{chunk-XZRLFBEA.js → chunk-ECQNBLPS.js} +51 -15
- package/dist/{chunk-H57DXSHR.js → chunk-FBFPQLJG.js} +3 -3
- package/dist/{chunk-VQPSWD3A.js → chunk-FFGW45DJ.js} +10 -10
- package/dist/{chunk-NECZKPJN.js → chunk-FJ7ZMR4N.js} +5 -5
- package/dist/{chunk-7CLLWDCP.js → chunk-FLUKEZMH.js} +1 -1
- package/dist/{chunk-PQ4K74WL.js → chunk-FVERRWDP.js} +15 -12
- package/dist/{chunk-5463UUO2.js → chunk-FXW3FW4A.js} +1 -1
- package/dist/{chunk-3RPN7AAT.js → chunk-G63LBV4Y.js} +1 -1
- package/dist/{chunk-MTKV4RUQ.js → chunk-GWQ6T6JV.js} +6 -6
- package/dist/{chunk-NHVEQLQC.js → chunk-HR3DJWP2.js} +2 -2
- package/dist/{chunk-ZWOWEXCV.js → chunk-HTN7SMKB.js} +10 -7
- package/dist/{chunk-RH6KR6EH.js → chunk-I6OGFHJT.js} +5 -5
- package/dist/{chunk-XDCXTDHH.js → chunk-ILQARYXK.js} +5 -5
- package/dist/{chunk-ZMPR436Z.js → chunk-J5HQNZXQ.js} +5 -5
- package/dist/{chunk-NELH25J7.js → chunk-JPTFFZWY.js} +11 -11
- package/dist/{chunk-XSUJ2PQY.js → chunk-JSS5RG65.js} +3 -3
- package/dist/{chunk-K23WMLPY.js → chunk-JTQHC3RV.js} +6 -6
- package/dist/{chunk-EPOD7QHT.js → chunk-KWAOOXSD.js} +12 -9
- package/dist/{chunk-S6RNS4UL.js → chunk-L66VPBS5.js} +1 -1
- package/dist/{chunk-46TC24ET.js → chunk-LTCNAIY2.js} +2 -2
- package/dist/{chunk-GCN73COS.js → chunk-LW4ZEC3A.js} +1 -1
- package/dist/{chunk-UVT6B6XN.js → chunk-M6DTXZQK.js} +2 -2
- package/dist/{chunk-FI73DGNB.js → chunk-M7ZXKMVX.js} +1 -1
- package/dist/{chunk-JPABKXK6.js → chunk-MVW5WS6F.js} +6 -6
- package/dist/{chunk-LD4MWJMD.js → chunk-MW3DD3S5.js} +6 -6
- package/dist/{chunk-CQ5JGRML.js → chunk-MWBFB7WA.js} +1 -1
- package/dist/{chunk-63IQRYVP.js → chunk-OCYOOGXW.js} +4 -4
- package/dist/{chunk-ONCWYACA.js → chunk-OX5EYBOC.js} +1 -1
- package/dist/{chunk-ALZZVC3E.js → chunk-PI2WWZQQ.js} +3 -3
- package/dist/{chunk-AQFEP65J.js → chunk-QENTGE75.js} +10 -1
- package/dist/{chunk-DWQYCOPI.js → chunk-QW3FRUFB.js} +1 -1
- package/dist/{chunk-QKU46TK5.js → chunk-QWUWQBIJ.js} +3 -3
- package/dist/{chunk-T5L5NWT3.js → chunk-RZF2GIPI.js} +2 -2
- package/dist/{chunk-JBT3ZSJS.js → chunk-S3CQBNUU.js} +1 -1
- package/dist/{chunk-DHJSBK63.js → chunk-SM2DT5KP.js} +1 -1
- package/dist/{chunk-T6RIKJUO.js → chunk-SMMDQXI2.js} +2 -2
- package/dist/{chunk-MC4VY5LK.js → chunk-T4IAMIX4.js} +1 -1
- package/dist/{chunk-XUW2DRAQ.js → chunk-T6GEEMVC.js} +3 -3
- package/dist/{chunk-6SWMKF5E.js → chunk-V2AMLVMD.js} +2 -2
- package/dist/{chunk-MHQB62K5.js → chunk-VRPDHJGB.js} +5 -5
- package/dist/chunk-VUFHYMSP.js +32 -0
- package/dist/{chunk-6C4S3QYD.js → chunk-VZ3YPEMG.js} +3 -3
- package/dist/{chunk-P2546BBI.js → chunk-WCPN3GVW.js} +3 -3
- package/dist/{chunk-N77BH7H2.js → chunk-WNVQPGLH.js} +4 -4
- package/dist/{chunk-4QQEUJL4.js → chunk-WW266XKU.js} +2 -2
- package/dist/{chunk-ZOP3I2GQ.js → chunk-X5FHQMUL.js} +3 -3
- package/dist/{chunk-VYBH6D4X.js → chunk-YBE2KH2U.js} +4 -4
- package/dist/{chunk-BUXDR6US.js → chunk-ZMRO6ESW.js} +1 -1
- package/dist/{codex-app-cards-switch-P4RVJNRV.js → codex-app-cards-switch-7UIGMEUE.js} +12 -12
- package/dist/{codex-desktop-launch-RIBIFXSF.js → codex-desktop-launch-66LZ6R4Y.js} +1 -1
- package/dist/{codex-session-launch-KLH2FSSJ.js → codex-session-launch-3TGHFR7R.js} +20 -19
- package/dist/{config-HX6ZNOIL.js → config-OBDZ2CL3.js} +3 -3
- package/dist/{global-upgrade-AZN3BPI3.js → global-upgrade-6M2UXUUL.js} +8 -8
- package/dist/{identity-AQIMUWYN.js → identity-WJUPU3AK.js} +5 -5
- package/dist/{live-capabilities-4IIFAMHU.js → live-capabilities-GACO2VB6.js} +8 -4
- package/dist/{paths-X4IPV2WJ.js → paths-5PWAQF63.js} +3 -3
- package/dist/{reapply-CXODG53B.js → reapply-EYPT5EP2.js} +28 -27
- package/dist/src/index.js +22 -22
- package/dist/{upgrade-lock-AHISGKER.js → upgrade-lock-G2ZPV7ZO.js} +5 -5
- package/dist/{usage-ZC6BKIE3.js → usage-PXBMEKSA.js} +3 -3
- package/package.json +1 -1
- /package/dist/{chunk-LF3TLC7B.js → chunk-WACFIQYA.js} +0 -0
|
@@ -1,6 +1,12 @@
|
|
|
1
|
+
import {
|
|
2
|
+
findNativeClaudeInstall
|
|
3
|
+
} from "./chunk-VUFHYMSP.js";
|
|
1
4
|
import {
|
|
2
5
|
parseVersion
|
|
3
6
|
} from "./chunk-6ICPEJY5.js";
|
|
7
|
+
import {
|
|
8
|
+
isRecord
|
|
9
|
+
} from "./chunk-WACFIQYA.js";
|
|
4
10
|
|
|
5
11
|
// src/setup/agent-probe.ts
|
|
6
12
|
import { execSync } from "child_process";
|
|
@@ -12,20 +18,28 @@ var versionFromInstallPath = (path) => {
|
|
|
12
18
|
const name = basename(path);
|
|
13
19
|
return /^\d+\.\d+\.\d+$/.test(name) ? parseVersion(name) : null;
|
|
14
20
|
};
|
|
21
|
+
var CLAUDE_CODE_PACKAGE = "@anthropic-ai/claude-code";
|
|
22
|
+
var CLAUDE_CODE_PLATFORM_PACKAGE_PREFIX = `${CLAUDE_CODE_PACKAGE}-`;
|
|
23
|
+
var MANIFEST_FOLDERS_SEARCHED = 4;
|
|
24
|
+
var isClaudeCodePackage = (name) => typeof name === "string" && (name === CLAUDE_CODE_PACKAGE || name.startsWith(CLAUDE_CODE_PLATFORM_PACKAGE_PREFIX));
|
|
25
|
+
var parsedManifest = (raw) => {
|
|
26
|
+
try {
|
|
27
|
+
return JSON.parse(raw);
|
|
28
|
+
} catch {
|
|
29
|
+
return null;
|
|
30
|
+
}
|
|
31
|
+
};
|
|
32
|
+
var claudeCodeManifestVersion = (raw) => {
|
|
33
|
+
const manifest = parsedManifest(raw);
|
|
34
|
+
if (!isRecord(manifest) || !isClaudeCodePackage(manifest.name)) return null;
|
|
35
|
+
return typeof manifest.version === "string" ? parseVersion(manifest.version) : null;
|
|
36
|
+
};
|
|
15
37
|
var versionFromManifest = (probe, binPath) => {
|
|
16
38
|
let dir = dirname(binPath);
|
|
17
|
-
for (let depth = 0; depth <
|
|
39
|
+
for (let depth = 0; depth < MANIFEST_FOLDERS_SEARCHED; depth++) {
|
|
18
40
|
const raw = probe.readFile(join(dir, "package.json"));
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
const { version } = JSON.parse(raw);
|
|
22
|
-
if (typeof version === "string") {
|
|
23
|
-
const parsed = parseVersion(version);
|
|
24
|
-
if (parsed) return parsed;
|
|
25
|
-
}
|
|
26
|
-
} catch {
|
|
27
|
-
}
|
|
28
|
-
}
|
|
41
|
+
const version = raw ? claudeCodeManifestVersion(raw) : null;
|
|
42
|
+
if (version) return version;
|
|
29
43
|
const parent = dirname(dir);
|
|
30
44
|
if (parent === dir) break;
|
|
31
45
|
dir = parent;
|
|
@@ -63,7 +77,8 @@ var readFile = (path) => {
|
|
|
63
77
|
return null;
|
|
64
78
|
}
|
|
65
79
|
};
|
|
66
|
-
var
|
|
80
|
+
var claudeOnPathElseInItsOwnInstallFolder = () => onPath("claude") ?? findNativeClaudeInstall() ?? null;
|
|
81
|
+
var detectClaudeVersion = () => readClaudeVersion({ resolveOnPath: claudeOnPathElseInItsOwnInstallFolder, realpath, readFile });
|
|
67
82
|
|
|
68
83
|
export {
|
|
69
84
|
realpath,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
ensureCodexTrustsPusharyHooks
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-6U3L4K57.js";
|
|
4
4
|
import {
|
|
5
5
|
CODEX_INSTRUCTIONS_LABEL,
|
|
6
6
|
GEMINI_INSTRUCTIONS_LABEL,
|
|
@@ -11,7 +11,7 @@ import {
|
|
|
11
11
|
macAppFxBridge,
|
|
12
12
|
refreshInstructionBlock,
|
|
13
13
|
renderAgentInstructions
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-GWQ6T6JV.js";
|
|
15
15
|
import {
|
|
16
16
|
OPENCODE_HOOK_BINARY,
|
|
17
17
|
agentHookOwner,
|
|
@@ -21,10 +21,10 @@ import {
|
|
|
21
21
|
openCodeInstructionsFile,
|
|
22
22
|
openCodePluginDir,
|
|
23
23
|
openCodeWired
|
|
24
|
-
} from "./chunk-
|
|
24
|
+
} from "./chunk-JTQHC3RV.js";
|
|
25
25
|
import {
|
|
26
26
|
detectClaudeVersion
|
|
27
|
-
} from "./chunk-
|
|
27
|
+
} from "./chunk-7QAL23TB.js";
|
|
28
28
|
import {
|
|
29
29
|
addClaudeMcpServer,
|
|
30
30
|
addCompatibleHooks,
|
|
@@ -33,7 +33,7 @@ import {
|
|
|
33
33
|
compatibleConfigFile,
|
|
34
34
|
compatibleInstructionsFile,
|
|
35
35
|
hasCompatibleHooks
|
|
36
|
-
} from "./chunk-
|
|
36
|
+
} from "./chunk-WNVQPGLH.js";
|
|
37
37
|
import {
|
|
38
38
|
claudeUnprovenHolds,
|
|
39
39
|
claudeWired,
|
|
@@ -41,7 +41,7 @@ import {
|
|
|
41
41
|
codexWired,
|
|
42
42
|
geminiWired,
|
|
43
43
|
planHooks
|
|
44
|
-
} from "./chunk-
|
|
44
|
+
} from "./chunk-74DKFWU2.js";
|
|
45
45
|
import {
|
|
46
46
|
CLAUDE_HOOK_BINARY,
|
|
47
47
|
CLAUDE_HOOK_EVENTS,
|
|
@@ -52,7 +52,7 @@ import {
|
|
|
52
52
|
needsReregistration,
|
|
53
53
|
registrationSignatures,
|
|
54
54
|
supportedClaudeEvents
|
|
55
|
-
} from "./chunk-
|
|
55
|
+
} from "./chunk-VZ3YPEMG.js";
|
|
56
56
|
import {
|
|
57
57
|
formatVersion
|
|
58
58
|
} from "./chunk-6ICPEJY5.js";
|
|
@@ -80,21 +80,21 @@ import {
|
|
|
80
80
|
registeredCommands,
|
|
81
81
|
registrationHolderOf,
|
|
82
82
|
vscodePluginMcp
|
|
83
|
-
} from "./chunk-
|
|
83
|
+
} from "./chunk-57EOP757.js";
|
|
84
84
|
import {
|
|
85
85
|
resolveGlobalBinDir,
|
|
86
86
|
resolveGlobalBinary
|
|
87
|
-
} from "./chunk-
|
|
87
|
+
} from "./chunk-T6GEEMVC.js";
|
|
88
88
|
import {
|
|
89
89
|
readJsonSafe,
|
|
90
90
|
writeFileAtomic,
|
|
91
91
|
writeJsonAtomic
|
|
92
|
-
} from "./chunk-
|
|
92
|
+
} from "./chunk-QENTGE75.js";
|
|
93
93
|
import {
|
|
94
94
|
HOOK_COMPATIBLE_PROFILES,
|
|
95
95
|
isCompatibleAgentType,
|
|
96
96
|
isRecord
|
|
97
|
-
} from "./chunk-
|
|
97
|
+
} from "./chunk-WACFIQYA.js";
|
|
98
98
|
|
|
99
99
|
// src/reapply.ts
|
|
100
100
|
import { dirname, join } from "path";
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import {
|
|
2
2
|
pusharyDir
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-57EOP757.js";
|
|
4
4
|
import {
|
|
5
5
|
readJsonSafe
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-QENTGE75.js";
|
|
7
7
|
import {
|
|
8
8
|
isRecord
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-WACFIQYA.js";
|
|
10
10
|
|
|
11
11
|
// src/process-ownership.ts
|
|
12
12
|
import { createHash, randomUUID } from "crypto";
|
|
@@ -2,25 +2,25 @@ import {
|
|
|
2
2
|
SIGNED_OUT_ON_MAC_MESSAGE,
|
|
3
3
|
describeSignedOutKey,
|
|
4
4
|
readSignedOutDiagnosis
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-V2AMLVMD.js";
|
|
6
6
|
import {
|
|
7
7
|
createIo
|
|
8
8
|
} from "./chunk-FO3MDD26.js";
|
|
9
9
|
import {
|
|
10
10
|
readKeySource
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-YBE2KH2U.js";
|
|
12
12
|
import {
|
|
13
13
|
absoluteUrl,
|
|
14
14
|
checkApiKey,
|
|
15
15
|
describeKeyCheck,
|
|
16
16
|
keyCheckFromResponse
|
|
17
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-5HRXOANL.js";
|
|
18
18
|
import {
|
|
19
19
|
EXIT
|
|
20
20
|
} from "./chunk-KZERVKTD.js";
|
|
21
21
|
import {
|
|
22
22
|
getBaseUrl
|
|
23
|
-
} from "./chunk-
|
|
23
|
+
} from "./chunk-MWBFB7WA.js";
|
|
24
24
|
|
|
25
25
|
// src/cli/report-key.ts
|
|
26
26
|
var { dim, yellow } = createIo();
|
|
@@ -4,25 +4,25 @@ import {
|
|
|
4
4
|
} from "./chunk-XHKBHWLX.js";
|
|
5
5
|
import {
|
|
6
6
|
readControlMode
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-YBE2KH2U.js";
|
|
8
8
|
import {
|
|
9
9
|
getMachineId
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-SMMDQXI2.js";
|
|
11
11
|
import {
|
|
12
12
|
pusharyDir
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-57EOP757.js";
|
|
14
14
|
import {
|
|
15
15
|
resolveGlobalBinary
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-T6GEEMVC.js";
|
|
17
17
|
import {
|
|
18
18
|
readJsonSafe,
|
|
19
19
|
writeFileAtomic,
|
|
20
20
|
writeJsonAtomic,
|
|
21
21
|
writeJsonAtomicDurable
|
|
22
|
-
} from "./chunk-
|
|
22
|
+
} from "./chunk-QENTGE75.js";
|
|
23
23
|
import {
|
|
24
24
|
getApiKey
|
|
25
|
-
} from "./chunk-
|
|
25
|
+
} from "./chunk-MWBFB7WA.js";
|
|
26
26
|
import {
|
|
27
27
|
CLI_PACKAGE_NAMES,
|
|
28
28
|
cmdShimTarget,
|
|
@@ -32,7 +32,7 @@ import {
|
|
|
32
32
|
} from "./chunk-QTOLNRET.js";
|
|
33
33
|
import {
|
|
34
34
|
isRecord
|
|
35
|
-
} from "./chunk-
|
|
35
|
+
} from "./chunk-WACFIQYA.js";
|
|
36
36
|
|
|
37
37
|
// src/daemon-lifecycle.ts
|
|
38
38
|
import { dirname, join, win32 as win32Path } from "path";
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
2
|
realpath
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-7QAL23TB.js";
|
|
4
|
+
import {
|
|
5
|
+
findNativeClaudeInstall
|
|
6
|
+
} from "./chunk-VUFHYMSP.js";
|
|
4
7
|
import {
|
|
5
8
|
readGlobalPrefixAsync,
|
|
6
9
|
resolveGlobalBinary,
|
|
@@ -10,10 +13,13 @@ import {
|
|
|
10
13
|
resolvePackageVersionFromBinary,
|
|
11
14
|
resolvePathBinary,
|
|
12
15
|
resolvePathBinaryAsync
|
|
13
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-T6GEEMVC.js";
|
|
14
17
|
import {
|
|
15
18
|
MANAGED_PROVIDERS
|
|
16
|
-
} from "./chunk-
|
|
19
|
+
} from "./chunk-WACFIQYA.js";
|
|
20
|
+
|
|
21
|
+
// src/live-capabilities.ts
|
|
22
|
+
import { homedir } from "os";
|
|
17
23
|
|
|
18
24
|
// src/setup/codex-install-probe.ts
|
|
19
25
|
import { existsSync, readdirSync, statSync } from "fs";
|
|
@@ -125,13 +131,19 @@ var missingControlPrerequisite = (input) => {
|
|
|
125
131
|
if (!input.managerAvailable) return "service-manager";
|
|
126
132
|
return null;
|
|
127
133
|
};
|
|
134
|
+
var WHAT_REQUIRED_PHONE_START_LACKS = {
|
|
135
|
+
provider: "install and configure a supported Claude Code, Codex or Gemini provider",
|
|
136
|
+
"service-manager": "no native background-service manager is available in this OS session"
|
|
137
|
+
};
|
|
138
|
+
var describeMissingControlPrerequisite = (missing) => WHAT_REQUIRED_PHONE_START_LACKS[missing];
|
|
128
139
|
var phoneStartIsRequired = (input) => input.mode === "on" || input.policy === "legacy" || input.lifecycleFailed;
|
|
129
140
|
var preferGlobalProviderBinary = (platform) => platform === "win32";
|
|
130
|
-
var
|
|
141
|
+
var nativeInstallOf = (provider, platform, home) => provider === "claude" ? findNativeClaudeInstall(home, platform) : void 0;
|
|
142
|
+
var resolveProviderBinary = (provider, platform = process.platform, home = homedir()) => (preferGlobalProviderBinary(platform) ? resolveGlobalBinary(provider) ?? resolvePathBinary(provider, platform) : resolvePathBinary(provider, platform) ?? resolveGlobalBinary(provider)) ?? nativeInstallOf(provider, platform, home);
|
|
131
143
|
var codexBinaryIsBroken = (binary) => codexInstallHealthAt(binary).kind === "binary-missing";
|
|
132
|
-
var detectCapabilities = (providers, codexCanStart) => {
|
|
144
|
+
var detectCapabilities = (providers, codexCanStart, home) => {
|
|
133
145
|
const enabled = new Set(providers);
|
|
134
|
-
const binaryFor = (provider) => enabled.has(provider) ? resolveProviderBinary(provider) : void 0;
|
|
146
|
+
const binaryFor = (provider) => enabled.has(provider) ? resolveProviderBinary(provider, process.platform, home) : void 0;
|
|
135
147
|
const codexBin = binaryFor("codex");
|
|
136
148
|
const geminiBin = binaryFor("gemini");
|
|
137
149
|
return providerLiveCapabilities({
|
|
@@ -142,12 +154,12 @@ var detectCapabilities = (providers, codexCanStart) => {
|
|
|
142
154
|
};
|
|
143
155
|
var anyInstalledCodex = () => true;
|
|
144
156
|
var codexWithItsProgram = (binary) => !codexBinaryIsBroken(binary);
|
|
145
|
-
var detectProviderLiveCapabilities = (providers = MANAGED_PROVIDERS) => detectCapabilities(providers, anyInstalledCodex);
|
|
146
|
-
var detectLaunchableProviderCapabilities = (providers = MANAGED_PROVIDERS) => detectCapabilities(providers, codexWithItsProgram);
|
|
157
|
+
var detectProviderLiveCapabilities = (providers = MANAGED_PROVIDERS, home = homedir()) => detectCapabilities(providers, anyInstalledCodex, home);
|
|
158
|
+
var detectLaunchableProviderCapabilities = (providers = MANAGED_PROVIDERS, home = homedir()) => detectCapabilities(providers, codexWithItsProgram, home);
|
|
147
159
|
var SPAWN_CAPABILITY = "spawn";
|
|
148
160
|
var launchAdvertisement = (launchable) => hasSpawnProvider(launchable) ? [SPAWN_CAPABILITY, ...launchable] : launchable;
|
|
149
|
-
var expectedLaunchCapabilities = (providers = MANAGED_PROVIDERS) => launchAdvertisement(detectLaunchableProviderCapabilities(providers));
|
|
150
|
-
var discoverProviderInventory = async (providers, signal, platform = process.platform) => {
|
|
161
|
+
var expectedLaunchCapabilities = (providers = MANAGED_PROVIDERS, home = homedir()) => launchAdvertisement(detectLaunchableProviderCapabilities(providers, home));
|
|
162
|
+
var discoverProviderInventory = async (providers, signal, platform = process.platform, home = homedir()) => {
|
|
151
163
|
let prefix;
|
|
152
164
|
const globalBinary = async (provider) => {
|
|
153
165
|
const location = await (prefix ??= readGlobalPrefixAsync(signal));
|
|
@@ -155,7 +167,7 @@ var discoverProviderInventory = async (providers, signal, platform = process.pla
|
|
|
155
167
|
};
|
|
156
168
|
const findBinary = async (provider) => {
|
|
157
169
|
const binary = preferGlobalProviderBinary(platform) ? await globalBinary(provider) ?? await resolvePathBinaryAsync(provider, signal, platform) : await resolvePathBinaryAsync(provider, signal, platform) ?? await globalBinary(provider);
|
|
158
|
-
return [provider, binary];
|
|
170
|
+
return [provider, binary ?? nativeInstallOf(provider, platform, home)];
|
|
159
171
|
};
|
|
160
172
|
const found = await Promise.all([...new Set(providers)].map(findBinary));
|
|
161
173
|
const binaries = {};
|
|
@@ -171,9 +183,10 @@ var discoverProviderInventory = async (providers, signal, platform = process.pla
|
|
|
171
183
|
})
|
|
172
184
|
};
|
|
173
185
|
};
|
|
174
|
-
var trackProviderInventory = async (providers, onChange) => {
|
|
186
|
+
var trackProviderInventory = async (providers, onChange, home = homedir()) => {
|
|
175
187
|
const controller = new AbortController();
|
|
176
|
-
|
|
188
|
+
const discover = () => discoverProviderInventory(providers, controller.signal, process.platform, home);
|
|
189
|
+
let current = await discover();
|
|
177
190
|
let pending;
|
|
178
191
|
const accept = (next) => {
|
|
179
192
|
if (controller.signal.aborted) return;
|
|
@@ -182,7 +195,7 @@ var trackProviderInventory = async (providers, onChange) => {
|
|
|
182
195
|
};
|
|
183
196
|
const refresh = () => {
|
|
184
197
|
if (controller.signal.aborted) return Promise.resolve();
|
|
185
|
-
return pending ??=
|
|
198
|
+
return pending ??= discover().then(accept).finally(() => {
|
|
186
199
|
pending = void 0;
|
|
187
200
|
});
|
|
188
201
|
};
|
|
@@ -206,6 +219,7 @@ export {
|
|
|
206
219
|
hasSpawnProvider,
|
|
207
220
|
resolveControlPolicy,
|
|
208
221
|
missingControlPrerequisite,
|
|
222
|
+
describeMissingControlPrerequisite,
|
|
209
223
|
phoneStartIsRequired,
|
|
210
224
|
resolveProviderBinary,
|
|
211
225
|
codexBinaryIsBroken,
|
|
@@ -14,19 +14,19 @@ import {
|
|
|
14
14
|
} from "./chunk-FO3MDD26.js";
|
|
15
15
|
import {
|
|
16
16
|
callMcpTool
|
|
17
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-WCPN3GVW.js";
|
|
18
18
|
import {
|
|
19
19
|
reportedInstallSource
|
|
20
|
-
} from "./chunk-
|
|
20
|
+
} from "./chunk-WW266XKU.js";
|
|
21
21
|
import {
|
|
22
22
|
NPX_LATEST_COMMAND
|
|
23
|
-
} from "./chunk-
|
|
23
|
+
} from "./chunk-T4IAMIX4.js";
|
|
24
24
|
import {
|
|
25
25
|
NO_PAIRING_COMPUTER,
|
|
26
26
|
PAIR_TTL_SECONDS,
|
|
27
27
|
classifyConfirmResponse,
|
|
28
28
|
isAnswerSource
|
|
29
|
-
} from "./chunk-
|
|
29
|
+
} from "./chunk-WACFIQYA.js";
|
|
30
30
|
|
|
31
31
|
// src/reach.ts
|
|
32
32
|
var reachVerdict = (channels) => {
|
|
@@ -99,10 +99,12 @@ var describeJustPairedRepair = (verdict) => {
|
|
|
99
99
|
|
|
100
100
|
// src/setup/verify.ts
|
|
101
101
|
var plural2 = (count, one) => `${count} ${one}${count === 1 ? "" : "s"}`;
|
|
102
|
+
var SETUP_AGENT_NAME = "Pushary setup";
|
|
103
|
+
var ownAppPlatforms = (channels) => channels.yours?.appPlatforms ?? channels.appPlatforms;
|
|
102
104
|
var describeRecipients = (push, channels) => {
|
|
103
105
|
const parts = [];
|
|
104
106
|
if (push.app > 0) {
|
|
105
|
-
const platforms = channels
|
|
107
|
+
const platforms = ownAppPlatforms(channels);
|
|
106
108
|
const suffix = platforms.length > 0 ? ` (${platforms.join(", ")})` : "";
|
|
107
109
|
parts.push(`${plural2(push.app, "app device")}${suffix}`);
|
|
108
110
|
}
|
|
@@ -131,7 +133,7 @@ var sendTestNotification = async (apiKey) => {
|
|
|
131
133
|
const result = await callMcpTool(apiKey, "send_notification", {
|
|
132
134
|
title: "Pushary is connected",
|
|
133
135
|
body: "This setup notification reached you. Agent hooks still need a real-agent check.",
|
|
134
|
-
agentName:
|
|
136
|
+
agentName: SETUP_AGENT_NAME
|
|
135
137
|
}, { timeoutMs: 2e4 });
|
|
136
138
|
const toCount = (value) => typeof value === "number" && Number.isFinite(value) ? value : 0;
|
|
137
139
|
const app = toCount(result.delivery?.mobile?.recipients);
|
|
@@ -185,8 +187,10 @@ var describeVerifyOutcome = (outcome) => {
|
|
|
185
187
|
};
|
|
186
188
|
}
|
|
187
189
|
};
|
|
188
|
-
var ROUND_TRIP_QUESTION = "Pushary delivery test.
|
|
190
|
+
var ROUND_TRIP_QUESTION = "Pushary delivery test. Answer either way to test returning an answer. This does not test your agent hooks.";
|
|
189
191
|
var ROUND_TRIP_TIMEOUT_MS = 55e3;
|
|
192
|
+
var reportNoInterrupt = async () => {
|
|
193
|
+
};
|
|
190
194
|
var defaultAsk = (apiKey, agentName) => (
|
|
191
195
|
// wait:false so the poll is ours: the blocking form returns on the SITE's
|
|
192
196
|
// policy timeout, which a user may have set to seconds, and a setup check
|
|
@@ -218,10 +222,11 @@ var answeredRoundTrip = (answer, correlationId, latencyMs) => {
|
|
|
218
222
|
...isAnswerSource(answer.answerSource) ? { answerSource: answer.answerSource } : {}
|
|
219
223
|
};
|
|
220
224
|
};
|
|
221
|
-
var verifyRoundTrip = async (apiKey, agentName =
|
|
225
|
+
var verifyRoundTrip = async (apiKey, agentName = SETUP_AGENT_NAME, deps = {}) => {
|
|
222
226
|
const ask = deps.ask ?? defaultAsk;
|
|
223
227
|
const wait = deps.wait ?? defaultWait;
|
|
224
228
|
const cancel = deps.cancel ?? defaultCancel;
|
|
229
|
+
const interrupted = deps.interrupted ?? reportNoInterrupt;
|
|
225
230
|
const now = deps.now ?? Date.now;
|
|
226
231
|
const started = now();
|
|
227
232
|
let asked;
|
|
@@ -237,8 +242,12 @@ var verifyRoundTrip = async (apiKey, agentName = "Pushary setup", deps = {}) =>
|
|
|
237
242
|
let timer;
|
|
238
243
|
try {
|
|
239
244
|
await Promise.race([
|
|
240
|
-
|
|
241
|
-
|
|
245
|
+
Promise.all([
|
|
246
|
+
cancel(apiKey, asked.correlationId).catch(() => {
|
|
247
|
+
}),
|
|
248
|
+
interrupted(code).catch(() => {
|
|
249
|
+
})
|
|
250
|
+
]),
|
|
242
251
|
new Promise((resolve) => {
|
|
243
252
|
timer = setTimeout(resolve, 4e3);
|
|
244
253
|
})
|
|
@@ -291,7 +300,30 @@ var describeAnswerSource = (source) => {
|
|
|
291
300
|
return source ? `Answer source: ${source}. This was a synthetic test.` : "The answering surface was not reported. This was a synthetic test.";
|
|
292
301
|
}
|
|
293
302
|
};
|
|
294
|
-
var
|
|
303
|
+
var NOTIFICATION_ANSWER_STEPS = /* @__PURE__ */ new Map([
|
|
304
|
+
["ios", "Press and hold the notification, then tap Approve."],
|
|
305
|
+
["android", "Expand the notification, then tap Approve."]
|
|
306
|
+
]);
|
|
307
|
+
var EITHER_PHONE_ANSWER_STEP = "Press and hold the notification on iPhone, or expand it on Android, then tap Approve.";
|
|
308
|
+
var notificationAnswerStep = (appPlatforms) => {
|
|
309
|
+
const platforms = [...new Set(appPlatforms)];
|
|
310
|
+
const [onlyPlatform] = platforms;
|
|
311
|
+
if (onlyPlatform === void 0) return null;
|
|
312
|
+
if (platforms.length > 1) return EITHER_PHONE_ANSWER_STEP;
|
|
313
|
+
return NOTIFICATION_ANSWER_STEPS.get(onlyPlatform) ?? EITHER_PHONE_ANSWER_STEP;
|
|
314
|
+
};
|
|
315
|
+
var WAITING_FOR_TAP = "Waiting for you to tap the notification";
|
|
316
|
+
var WAITING_FOR_ANSWER = "Waiting for your answer";
|
|
317
|
+
var describeAnswerTestPrompt = (appPlatforms) => {
|
|
318
|
+
const step = notificationAnswerStep(appPlatforms);
|
|
319
|
+
return { step, waiting: step === null ? WAITING_FOR_TAP : WAITING_FOR_ANSWER };
|
|
320
|
+
};
|
|
321
|
+
var CHECK_THE_NOTIFICATION_OPENED = "Check the notification actually opened something you could tap, then run pushary doctor --roundtrip.";
|
|
322
|
+
var unansweredNextStep = (appPlatforms) => {
|
|
323
|
+
const step = notificationAnswerStep(appPlatforms);
|
|
324
|
+
return step === null ? CHECK_THE_NOTIFICATION_OPENED : `To send another one, run pushary doctor --roundtrip. ${step}`;
|
|
325
|
+
};
|
|
326
|
+
var describeRoundTripOutcome = (outcome, appPlatforms = []) => {
|
|
295
327
|
switch (outcome.kind) {
|
|
296
328
|
case "answered":
|
|
297
329
|
return {
|
|
@@ -305,7 +337,7 @@ var describeRoundTripOutcome = (outcome) => {
|
|
|
305
337
|
message: "The question was sent and nothing came back.",
|
|
306
338
|
next: [
|
|
307
339
|
"A push that arrives and cannot be answered is the most common way this breaks, so this is worth resolving now.",
|
|
308
|
-
|
|
340
|
+
unansweredNextStep(appPlatforms)
|
|
309
341
|
]
|
|
310
342
|
};
|
|
311
343
|
case "notify-only":
|
|
@@ -331,8 +363,8 @@ var describeRoundTripOutcome = (outcome) => {
|
|
|
331
363
|
};
|
|
332
364
|
}
|
|
333
365
|
};
|
|
334
|
-
var describeRoundTrip = (outcome) => {
|
|
335
|
-
const report = describeRoundTripOutcome(outcome);
|
|
366
|
+
var describeRoundTrip = (outcome, appPlatforms = []) => {
|
|
367
|
+
const report = describeRoundTripOutcome(outcome, appPlatforms);
|
|
336
368
|
return { ...report, next: [...report.next, "Agent hook activation remains unverified. Restart your agent and check one real approval."] };
|
|
337
369
|
};
|
|
338
370
|
var roundTripEvidence = (outcome) => ({
|
|
@@ -560,7 +592,7 @@ var sendAndConfirm = async (apiKey, channels) => {
|
|
|
560
592
|
const report = describeVerifyOutcome(outcome);
|
|
561
593
|
stopSend(report.ok ? check : yellow("!"), report.message);
|
|
562
594
|
for (const line of report.next) console.log(` ${dim(line)}`);
|
|
563
|
-
return { reachesYou: report.ok, outcome, detail: null };
|
|
595
|
+
return { reachesYou: report.ok, outcome, detail: null, appPlatforms: ownAppPlatforms(channels) };
|
|
564
596
|
};
|
|
565
597
|
var printCapabilityDelta = () => {
|
|
566
598
|
console.log(` ${dim("Two ways to get approvals on your phone:")}`);
|
|
@@ -1028,7 +1060,11 @@ var waitForYourPhone = async (apiKey, options = {}) => {
|
|
|
1028
1060
|
export {
|
|
1029
1061
|
reachVerdict,
|
|
1030
1062
|
describeReach,
|
|
1063
|
+
SETUP_AGENT_NAME,
|
|
1064
|
+
ownAppPlatforms,
|
|
1031
1065
|
verifyRoundTrip,
|
|
1066
|
+
notificationAnswerStep,
|
|
1067
|
+
describeAnswerTestPrompt,
|
|
1032
1068
|
describeRoundTripOutcome,
|
|
1033
1069
|
describeRoundTrip,
|
|
1034
1070
|
roundTripEvidence,
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import {
|
|
2
2
|
autoUpdateLock
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-57EOP757.js";
|
|
4
4
|
import {
|
|
5
5
|
installPackageGlobally,
|
|
6
6
|
npmErrorMessage
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-T6GEEMVC.js";
|
|
8
8
|
import {
|
|
9
9
|
writeJsonAtomic
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-QENTGE75.js";
|
|
11
11
|
|
|
12
12
|
// src/upgrade-lock.ts
|
|
13
13
|
import { fork } from "child_process";
|
|
@@ -3,41 +3,41 @@ import {
|
|
|
3
3
|
loadPin,
|
|
4
4
|
savePin,
|
|
5
5
|
verifyRecipients
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-QW3FRUFB.js";
|
|
7
7
|
import {
|
|
8
8
|
ensureDaemonRunning
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-DUACX6E3.js";
|
|
10
10
|
import {
|
|
11
11
|
hookOwnerOf
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-74DKFWU2.js";
|
|
13
13
|
import {
|
|
14
14
|
buildTranscriptRecords,
|
|
15
15
|
decodePublicKey,
|
|
16
16
|
generateSessionKey,
|
|
17
17
|
wrapSessionKey
|
|
18
|
-
} from "./chunk-
|
|
18
|
+
} from "./chunk-FXW3FW4A.js";
|
|
19
19
|
import {
|
|
20
20
|
fetchTranscriptRecipients,
|
|
21
21
|
uploadTranscriptRecords
|
|
22
|
-
} from "./chunk-
|
|
22
|
+
} from "./chunk-LW4ZEC3A.js";
|
|
23
23
|
import {
|
|
24
24
|
transcriptEnvironmentPreference,
|
|
25
25
|
transcriptsEnabled
|
|
26
|
-
} from "./chunk-
|
|
26
|
+
} from "./chunk-4US3BCQJ.js";
|
|
27
27
|
import {
|
|
28
28
|
readTranscriptPreference
|
|
29
|
-
} from "./chunk-
|
|
29
|
+
} from "./chunk-YBE2KH2U.js";
|
|
30
30
|
import {
|
|
31
31
|
codexHome,
|
|
32
32
|
pusharyDir
|
|
33
|
-
} from "./chunk-
|
|
33
|
+
} from "./chunk-57EOP757.js";
|
|
34
34
|
import {
|
|
35
35
|
writeJsonAtomic
|
|
36
|
-
} from "./chunk-
|
|
36
|
+
} from "./chunk-QENTGE75.js";
|
|
37
37
|
import {
|
|
38
38
|
getApiKey,
|
|
39
39
|
getBaseUrl
|
|
40
|
-
} from "./chunk-
|
|
40
|
+
} from "./chunk-MWBFB7WA.js";
|
|
41
41
|
|
|
42
42
|
// src/transcript-registration.ts
|
|
43
43
|
import { createHash } from "crypto";
|
|
@@ -4,7 +4,7 @@ import {
|
|
|
4
4
|
forkFinishWithUpgradeLock,
|
|
5
5
|
installWithUpgradeLock,
|
|
6
6
|
releaseAutoUpdateLock
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-FBFPQLJG.js";
|
|
8
8
|
import {
|
|
9
9
|
describeAutoUpdateCheck,
|
|
10
10
|
globalInstallLocation,
|
|
@@ -14,7 +14,7 @@ import {
|
|
|
14
14
|
readAutoUpdateState,
|
|
15
15
|
updateAutoUpdateState,
|
|
16
16
|
upgradeEntryFor
|
|
17
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-QWUWQBIJ.js";
|
|
18
18
|
import {
|
|
19
19
|
EXIT
|
|
20
20
|
} from "./chunk-KZERVKTD.js";
|
|
@@ -22,17 +22,17 @@ import {
|
|
|
22
22
|
autoUpdateLock,
|
|
23
23
|
autoUpdateLog,
|
|
24
24
|
autoUpdateState
|
|
25
|
-
} from "./chunk-
|
|
25
|
+
} from "./chunk-57EOP757.js";
|
|
26
26
|
import {
|
|
27
27
|
execNpm,
|
|
28
28
|
fetchLatestPublishedVersion,
|
|
29
29
|
npmErrorMessage,
|
|
30
30
|
readGlobalCliInstallAt,
|
|
31
31
|
readGlobalPrefix
|
|
32
|
-
} from "./chunk-
|
|
32
|
+
} from "./chunk-T6GEEMVC.js";
|
|
33
33
|
import {
|
|
34
34
|
NPX_LATEST_COMMAND
|
|
35
|
-
} from "./chunk-
|
|
35
|
+
} from "./chunk-T4IAMIX4.js";
|
|
36
36
|
import {
|
|
37
37
|
commandsPackage,
|
|
38
38
|
globalUpgradeEntry,
|
|
@@ -1,17 +1,15 @@
|
|
|
1
|
+
import {
|
|
2
|
+
findNativeClaudeInstall
|
|
3
|
+
} from "./chunk-VUFHYMSP.js";
|
|
4
|
+
import {
|
|
5
|
+
isFile
|
|
6
|
+
} from "./chunk-QENTGE75.js";
|
|
7
|
+
|
|
1
8
|
// src/wrapper/claudeBinary.ts
|
|
2
|
-
import {
|
|
9
|
+
import { homedir } from "os";
|
|
3
10
|
import { join, delimiter } from "path";
|
|
4
11
|
var WRAPPER_ACTIVE_ENV = "PUSHARY_WRAPPER_ACTIVE";
|
|
5
|
-
var
|
|
6
|
-
try {
|
|
7
|
-
return statSync(path).isFile();
|
|
8
|
-
} catch {
|
|
9
|
-
return false;
|
|
10
|
-
}
|
|
11
|
-
};
|
|
12
|
-
var findClaudeBinary = () => {
|
|
13
|
-
const override = process.env.PUSHARY_CLAUDE_BIN?.trim();
|
|
14
|
-
if (override) return isFile(override) ? override : null;
|
|
12
|
+
var firstClaudeOnPath = () => {
|
|
15
13
|
const pathVar = process.env.PATH ?? "";
|
|
16
14
|
const exts = process.platform === "win32" ? [".cmd", ".exe", ".bat", ""] : [""];
|
|
17
15
|
for (const dir of pathVar.split(delimiter)) {
|
|
@@ -21,7 +19,12 @@ var findClaudeBinary = () => {
|
|
|
21
19
|
if (isFile(candidate)) return candidate;
|
|
22
20
|
}
|
|
23
21
|
}
|
|
24
|
-
return
|
|
22
|
+
return void 0;
|
|
23
|
+
};
|
|
24
|
+
var findClaudeBinary = (home = homedir()) => {
|
|
25
|
+
const override = process.env.PUSHARY_CLAUDE_BIN?.trim();
|
|
26
|
+
if (override) return isFile(override) ? override : null;
|
|
27
|
+
return firstClaudeOnPath() ?? findNativeClaudeInstall(home) ?? null;
|
|
25
28
|
};
|
|
26
29
|
|
|
27
30
|
export {
|