@pushary/agent-hooks 0.90.1 → 0.91.0
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 +27 -0
- package/dist/bin/pushary-bell.js +6 -61
- package/dist/bin/pushary-claude.js +5 -5
- package/dist/bin/pushary-clean.js +98 -14
- package/dist/bin/pushary-codex-bridge.js +3 -3
- package/dist/bin/pushary-codex-hook.js +3 -3
- package/dist/bin/pushary-codex.js +3 -3
- package/dist/bin/pushary-connect.js +2 -2
- package/dist/bin/pushary-daemon.js +9 -9
- package/dist/bin/pushary-disconnect.js +2 -2
- package/dist/bin/pushary-doctor.js +13 -13
- package/dist/bin/pushary-elicitation-hook.js +2 -2
- package/dist/bin/pushary-gemini-bridge.js +3 -3
- package/dist/bin/pushary-gemini-hook.js +3 -3
- package/dist/bin/pushary-hook.js +4 -4
- package/dist/bin/pushary-login.js +4 -4
- package/dist/bin/pushary-logout.js +1 -1
- package/dist/bin/pushary-mode.js +2 -2
- package/dist/bin/pushary-notification-hook.js +3 -3
- package/dist/bin/pushary-opencode-hook.js +3 -3
- package/dist/bin/pushary-permission-denied-hook.js +4 -4
- package/dist/bin/pushary-permission-hook.js +4 -4
- package/dist/bin/pushary-post-hook.js +3 -3
- package/dist/bin/pushary-prompt-hook.js +3 -3
- package/dist/bin/pushary-session-end-hook.js +3 -3
- package/dist/bin/pushary-session-start-hook.js +3 -3
- package/dist/bin/pushary-setup.js +127 -180
- package/dist/bin/pushary-status.js +4 -4
- package/dist/bin/pushary-stop-hook.js +3 -3
- package/dist/bin/pushary-stopfailure-hook.js +3 -3
- package/dist/bin/pushary-upgrade.js +8 -8
- package/dist/bin/pushary-wait.js +2 -2
- package/dist/{chunk-B6H2KAQC.js → chunk-4IEW4ZRF.js} +2 -2
- package/dist/{chunk-54ELC7D7.js → chunk-AWHCZOZO.js} +1 -1
- package/dist/chunk-B65JGBIZ.js +539 -0
- package/dist/{chunk-KUZWXPUS.js → chunk-BVNYTQ5I.js} +23 -0
- package/dist/{chunk-AJYV3VGU.js → chunk-BXTJVM7O.js} +2 -0
- package/dist/{chunk-FQL5E6NG.js → chunk-CRVJCKIN.js} +85 -2
- package/dist/chunk-DSTLA2TC.js +68 -0
- package/dist/{chunk-GL3FFM7A.js → chunk-ELHCIEMM.js} +1 -1
- package/dist/{chunk-Y6BWPERV.js → chunk-GQ5ZC2QY.js} +1 -1
- package/dist/chunk-GU3EJCVV.js +43 -0
- package/dist/{chunk-4LOPSGLP.js → chunk-TVZQMPB7.js} +1 -1
- package/dist/{chunk-BQBEH6TV.js → chunk-VAMBUKXH.js} +4 -4
- package/dist/{chunk-DZDI62LY.js → chunk-WGKC6PU2.js} +2 -2
- package/dist/{chunk-7TPQEWUZ.js → chunk-YTD6PJM7.js} +1 -1
- package/dist/{chunk-H2QZRQR2.js → chunk-YTDH3XCE.js} +1 -1
- package/dist/{chunk-F2ICEWZL.js → chunk-Z4XCN2HH.js} +2 -2
- package/dist/{chunk-DYP6SMOR.js → chunk-Z6RFZKY4.js} +1 -1
- package/dist/src/index.js +4 -4
- package/package.json +1 -1
- package/dist/chunk-AZPIQG4G.js +0 -274
- package/dist/chunk-S6LYP7QA.js +0 -127
package/dist/chunk-S6LYP7QA.js
DELETED
|
@@ -1,127 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
HOOK_LOCATOR_BINARY
|
|
3
|
-
} from "./chunk-VNMKIJZB.js";
|
|
4
|
-
|
|
5
|
-
// src/diagnostics/bridge.ts
|
|
6
|
-
import { execFileSync } from "child_process";
|
|
7
|
-
import { existsSync, readFileSync } from "fs";
|
|
8
|
-
import { homedir } from "os";
|
|
9
|
-
import { dirname, join } from "path";
|
|
10
|
-
var BRIDGE_BUNDLE_IDENTIFIER = "com.pushary.app";
|
|
11
|
-
var BRIDGE_HELPER_SUFFIX = "/Contents/Helpers/pushary-bridge";
|
|
12
|
-
var BRIDGE_BUNDLE_ROOTS = ["/Applications/Pushary.app", "$HOME/Applications/Pushary.app"];
|
|
13
|
-
var expandHome = (path, home) => path.replaceAll("$HOME", home);
|
|
14
|
-
var parseBridgeStub = (contents, stubPath) => {
|
|
15
|
-
const helperSuffix = contents.match(/^H=(\S+)$/m)?.[1] ?? BRIDGE_HELPER_SUFFIX;
|
|
16
|
-
const cachePath = contents.match(/^C="([^"\n]+)"$/m)?.[1] ?? join(dirname(stubPath), ".bridge-cache");
|
|
17
|
-
const rootsLine = contents.match(/^for P in ((?:"[^"\n]*"\s*)+); do$/m)?.[1];
|
|
18
|
-
const bundleRoots = rootsLine ? [...rootsLine.matchAll(/"([^"]*)"/g)].map((match) => match[1]) : BRIDGE_BUNDLE_ROOTS;
|
|
19
|
-
const bundleIdentifier = contents.match(/kMDItemCFBundleIdentifier == "([^"]+)"/)?.[1] ?? BRIDGE_BUNDLE_IDENTIFIER;
|
|
20
|
-
return { helperSuffix, cachePath, bundleRoots, bundleIdentifier };
|
|
21
|
-
};
|
|
22
|
-
var resolveBridgeStub = (stubPath, probe) => {
|
|
23
|
-
const contents = probe.readFile(stubPath);
|
|
24
|
-
if (contents === null) return { kind: "no-stub", stub: stubPath };
|
|
25
|
-
const shape = parseBridgeStub(contents, stubPath);
|
|
26
|
-
const helperIn = (bundle) => `${bundle}${shape.helperSuffix}`;
|
|
27
|
-
const looked = [];
|
|
28
|
-
for (const root of shape.bundleRoots.map((root2) => expandHome(root2, probe.home))) {
|
|
29
|
-
looked.push(root);
|
|
30
|
-
if (probe.exists(helperIn(root))) return { kind: "bundle", helper: helperIn(root), via: "root" };
|
|
31
|
-
}
|
|
32
|
-
const cached = shape.cachePath ? probe.readFile(shape.cachePath)?.split("\n")[0]?.trim() : void 0;
|
|
33
|
-
if (cached) {
|
|
34
|
-
looked.push(cached);
|
|
35
|
-
if (probe.exists(helperIn(cached))) return { kind: "bundle", helper: helperIn(cached), via: "cache" };
|
|
36
|
-
}
|
|
37
|
-
for (const found of probe.mdfind(shape.bundleIdentifier)) {
|
|
38
|
-
looked.push(found);
|
|
39
|
-
if (probe.exists(helperIn(found))) return { kind: "bundle", helper: helperIn(found), via: "spotlight" };
|
|
40
|
-
}
|
|
41
|
-
return { kind: "missing", stub: stubPath, looked };
|
|
42
|
-
};
|
|
43
|
-
var BRIDGE_GONE_MESSAGE = "the Mac app is gone but its hooks remain; run pushary setup or reinstall the app";
|
|
44
|
-
var describeBridgeResolution = (resolution) => {
|
|
45
|
-
switch (resolution.kind) {
|
|
46
|
-
case "bundle":
|
|
47
|
-
return `${resolution.helper} (${resolution.via === "root" ? "installed" : resolution.via === "cache" ? "cached path" : "found by Spotlight"})`;
|
|
48
|
-
case "missing":
|
|
49
|
-
return BRIDGE_GONE_MESSAGE;
|
|
50
|
-
case "no-stub":
|
|
51
|
-
return `${resolution.stub} is not there; ${BRIDGE_GONE_MESSAGE}`;
|
|
52
|
-
}
|
|
53
|
-
};
|
|
54
|
-
var isBridgeLocator = (executable) => executable !== null && executable.split(/[/\\]/).pop() === HOOK_LOCATOR_BINARY;
|
|
55
|
-
var spotlight = (bundleIdentifier) => {
|
|
56
|
-
if (process.platform !== "darwin") return [];
|
|
57
|
-
try {
|
|
58
|
-
return execFileSync("/usr/bin/mdfind", [`kMDItemCFBundleIdentifier == "${bundleIdentifier}"`], {
|
|
59
|
-
encoding: "utf-8",
|
|
60
|
-
timeout: 5e3,
|
|
61
|
-
stdio: ["ignore", "pipe", "ignore"]
|
|
62
|
-
}).split("\n").map((line) => line.trim()).filter((line) => line !== "");
|
|
63
|
-
} catch {
|
|
64
|
-
return [];
|
|
65
|
-
}
|
|
66
|
-
};
|
|
67
|
-
var readOrNull = (path) => {
|
|
68
|
-
try {
|
|
69
|
-
return readFileSync(path, "utf-8");
|
|
70
|
-
} catch {
|
|
71
|
-
return null;
|
|
72
|
-
}
|
|
73
|
-
};
|
|
74
|
-
var liveBridgeProbe = () => ({
|
|
75
|
-
exists: existsSync,
|
|
76
|
-
readFile: readOrNull,
|
|
77
|
-
mdfind: spotlight,
|
|
78
|
-
home: homedir()
|
|
79
|
-
});
|
|
80
|
-
|
|
81
|
-
// src/diagnostics/service-runtime.ts
|
|
82
|
-
var unescapeXml = (value) => value.replaceAll(""", '"').replaceAll("'", "'").replaceAll("<", "<").replaceAll(">", ">").replaceAll("&", "&");
|
|
83
|
-
var unquoteSystemd = (value) => value.replaceAll('\\"', '"').replaceAll("\\\\", "\\").replaceAll("%%", "%");
|
|
84
|
-
var readServiceExecPath = (contents, platform) => {
|
|
85
|
-
if (platform === "darwin") {
|
|
86
|
-
const program = contents.match(/<key>ProgramArguments<\/key>\s*<array>\s*<string>([^<]*)<\/string>/)?.[1];
|
|
87
|
-
return program ? unescapeXml(program) : null;
|
|
88
|
-
}
|
|
89
|
-
if (platform === "linux") {
|
|
90
|
-
const exec = contents.match(/^ExecStart="((?:[^"\\]|\\.)*)"/m)?.[1];
|
|
91
|
-
return exec ? unquoteSystemd(exec) : null;
|
|
92
|
-
}
|
|
93
|
-
if (platform === "win32") {
|
|
94
|
-
const command = contents.match(/<Command>([^<]*)<\/Command>/)?.[1];
|
|
95
|
-
return command ? unescapeXml(command) : null;
|
|
96
|
-
}
|
|
97
|
-
return null;
|
|
98
|
-
};
|
|
99
|
-
var MANAGER_SEGMENTS = [
|
|
100
|
-
[".nvm", "nvm"],
|
|
101
|
-
["nvm", "nvm"],
|
|
102
|
-
["fnm", "fnm"],
|
|
103
|
-
[".fnm", "fnm"],
|
|
104
|
-
[".volta", "volta"],
|
|
105
|
-
["volta", "volta"],
|
|
106
|
-
[".asdf", "asdf"],
|
|
107
|
-
["asdf", "asdf"]
|
|
108
|
-
];
|
|
109
|
-
var versionManagerOf = (execPath) => {
|
|
110
|
-
const segments = execPath.split(/[/\\]/);
|
|
111
|
-
for (const segment of segments) {
|
|
112
|
-
const hit = MANAGER_SEGMENTS.find(([name]) => name === segment);
|
|
113
|
-
if (hit) return hit[1];
|
|
114
|
-
}
|
|
115
|
-
return null;
|
|
116
|
-
};
|
|
117
|
-
var describeVersionManagerPin = (execPath, manager) => `The background service is pinned to ${execPath}, which ${manager} manages. Switching Node versions strands it; run pushary daemon install afterwards.`;
|
|
118
|
-
|
|
119
|
-
export {
|
|
120
|
-
resolveBridgeStub,
|
|
121
|
-
describeBridgeResolution,
|
|
122
|
-
isBridgeLocator,
|
|
123
|
-
liveBridgeProbe,
|
|
124
|
-
readServiceExecPath,
|
|
125
|
-
versionManagerOf,
|
|
126
|
-
describeVersionManagerPin
|
|
127
|
-
};
|