@pushary/agent-hooks 1.7.0 → 1.7.2

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.
Files changed (102) hide show
  1. package/CHANGELOG.md +28 -0
  2. package/dist/bin/pushary-bell-hook.js +23 -23
  3. package/dist/bin/pushary-bell.js +10 -10
  4. package/dist/bin/pushary-claude.js +46 -35
  5. package/dist/bin/pushary-clean.js +194 -102
  6. package/dist/bin/pushary-codex-bridge.js +18 -17
  7. package/dist/bin/pushary-codex-hook.js +53 -39
  8. package/dist/bin/pushary-codex.js +14 -12
  9. package/dist/bin/pushary-connect.js +16 -16
  10. package/dist/bin/pushary-cowork.js +5 -5
  11. package/dist/bin/pushary-daemon.js +27 -27
  12. package/dist/bin/pushary-disconnect.js +19 -17
  13. package/dist/bin/pushary-doctor.js +99 -43
  14. package/dist/bin/pushary-elicitation-hook.js +35 -26
  15. package/dist/bin/pushary-gemini-bridge.js +12 -12
  16. package/dist/bin/pushary-gemini-hook.js +47 -32
  17. package/dist/bin/pushary-hook.js +34 -32
  18. package/dist/bin/pushary-login.js +16 -16
  19. package/dist/bin/pushary-logout.js +8 -8
  20. package/dist/bin/pushary-mcp.js +9 -8
  21. package/dist/bin/pushary-mode.js +10 -10
  22. package/dist/bin/pushary-notification-hook.js +29 -27
  23. package/dist/bin/pushary-opencode-hook.js +46 -32
  24. package/dist/bin/pushary-permission-denied-hook.js +34 -32
  25. package/dist/bin/pushary-permission-hook.js +33 -31
  26. package/dist/bin/pushary-post-hook.js +29 -27
  27. package/dist/bin/pushary-prompt-hook.js +29 -27
  28. package/dist/bin/pushary-session-end-hook.js +29 -27
  29. package/dist/bin/pushary-session-start-hook.js +33 -31
  30. package/dist/bin/pushary-setup.js +143 -105
  31. package/dist/bin/pushary-stats.js +5 -5
  32. package/dist/bin/pushary-status.js +19 -19
  33. package/dist/bin/pushary-stop-hook.js +29 -27
  34. package/dist/bin/pushary-stopfailure-hook.js +29 -27
  35. package/dist/bin/pushary-suggestions.js +5 -5
  36. package/dist/bin/pushary-transcript-register.js +19 -19
  37. package/dist/bin/pushary-transcripts.js +7 -7
  38. package/dist/bin/pushary-upgrade.js +20 -20
  39. package/dist/bin/pushary-wait.js +10 -10
  40. package/dist/bin/pushary.js +6 -6
  41. package/dist/{chunk-IJ6ECPA6.js → chunk-2B4XCMH6.js} +75 -232
  42. package/dist/{chunk-EGKXSQCY.js → chunk-2XOHXZRC.js} +12 -4
  43. package/dist/{chunk-D6BULEJW.js → chunk-3NSRL5E7.js} +2 -2
  44. package/dist/{chunk-UC65FJJT.js → chunk-3RO2UWJQ.js} +2 -2
  45. package/dist/{chunk-73T6MSU5.js → chunk-4S7CCOXB.js} +5 -5
  46. package/dist/{chunk-7OS4IHGI.js → chunk-5GIBNUBD.js} +2 -2
  47. package/dist/chunk-5OP5MQI7.js +45 -0
  48. package/dist/{chunk-B3UXMSMW.js → chunk-65RN6ZCO.js} +1 -1
  49. package/dist/{chunk-2PS6QWDW.js → chunk-6NHXKTQU.js} +2 -2
  50. package/dist/{chunk-V6QRSU2G.js → chunk-6QZK4O36.js} +4 -4
  51. package/dist/{chunk-ZQ7IDOKY.js → chunk-A6WQF7FQ.js} +3 -3
  52. package/dist/{chunk-QXAK5RFU.js → chunk-AWZNDM3B.js} +1 -1
  53. package/dist/{chunk-JNXVOU6Y.js → chunk-D4OGEWLH.js} +19 -2
  54. package/dist/{chunk-R2XCLT6I.js → chunk-E3PLF7YB.js} +4 -4
  55. package/dist/{chunk-2C7CCWVX.js → chunk-F6BMJOSW.js} +1 -1
  56. package/dist/{chunk-XNCMT7YY.js → chunk-HOIGXMI7.js} +1 -1
  57. package/dist/{chunk-CVALVGA7.js → chunk-I7B2DNVU.js} +1 -1
  58. package/dist/{chunk-S3UD4V6W.js → chunk-INR3RVQ3.js} +13 -3
  59. package/dist/{chunk-52NVBNJT.js → chunk-IZVAVXHQ.js} +6 -4
  60. package/dist/{chunk-5HLTWFJ6.js → chunk-JMSB6CJT.js} +1 -1
  61. package/dist/{chunk-KYQXUGH7.js → chunk-KAJT6HPI.js} +3 -3
  62. package/dist/{chunk-VKVIAZQO.js → chunk-KLXYMPTM.js} +1 -1
  63. package/dist/{chunk-PQ4F64M2.js → chunk-L6IF4JOF.js} +3 -3
  64. package/dist/{chunk-ROQK7IN3.js → chunk-LI3C2IQY.js} +2 -2
  65. package/dist/{chunk-B234346F.js → chunk-M2JGLFFS.js} +1 -1
  66. package/dist/chunk-MY3UZO5U.js +99 -0
  67. package/dist/chunk-N6IOSZOE.js +185 -0
  68. package/dist/{chunk-DNJUSFBL.js → chunk-NYBZJ44G.js} +40 -5
  69. package/dist/{chunk-BBKNJJVX.js → chunk-OJRB5QKN.js} +6 -6
  70. package/dist/{chunk-PUDBG3GM.js → chunk-OXEF6JHD.js} +4 -4
  71. package/dist/{chunk-LEZFOTMI.js → chunk-PWNQGITG.js} +1 -1
  72. package/dist/{chunk-B76WVEDX.js → chunk-Q7CDBJXU.js} +1 -1
  73. package/dist/{chunk-KXMZMZD3.js → chunk-QSZ37ROP.js} +1 -1
  74. package/dist/{chunk-BH2SKSSK.js → chunk-R7ZETVNR.js} +1 -1
  75. package/dist/{chunk-DZURML2D.js → chunk-RLRDPZG4.js} +1 -1
  76. package/dist/{chunk-J2355HR7.js → chunk-SEIZQZEE.js} +1 -1
  77. package/dist/{chunk-V4AQBAVG.js → chunk-SJN64NJX.js} +1 -1
  78. package/dist/{chunk-B3YQANFN.js → chunk-SKEW3TQX.js} +1 -1
  79. package/dist/{chunk-L4H2Q2S4.js → chunk-SKMWPXGV.js} +500 -46
  80. package/dist/{chunk-WUNZAE7I.js → chunk-T3PRPFDY.js} +5 -5
  81. package/dist/{chunk-YYINL576.js → chunk-TVJYGZXB.js} +2 -2
  82. package/dist/{chunk-O2LEPIU6.js → chunk-U3MS6D5X.js} +1 -1
  83. package/dist/{chunk-5RUIFDTP.js → chunk-U4TMAANR.js} +33 -2
  84. package/dist/{chunk-KW2RRR7D.js → chunk-UFNBKYWT.js} +3 -3
  85. package/dist/{chunk-DVQDPI3T.js → chunk-UUTWHVSV.js} +35 -35
  86. package/dist/{chunk-X6KDKOV5.js → chunk-VQDJ6KB3.js} +3 -3
  87. package/dist/{chunk-UOAQ6QMP.js → chunk-VSGKQ3HI.js} +2 -2
  88. package/dist/{chunk-YROGUPOZ.js → chunk-WWTLAZQA.js} +25 -8
  89. package/dist/{chunk-SQRWHALT.js → chunk-WXIVUIXA.js} +2 -2
  90. package/dist/{chunk-HDRNWNVP.js → chunk-YLCSKVQQ.js} +9 -28
  91. package/dist/{chunk-JXUAXO74.js → chunk-YNJ2H2FD.js} +2 -2
  92. package/dist/{chunk-BWYJ6AAF.js → chunk-YU4222G2.js} +2 -2
  93. package/dist/{chunk-4F46VIEE.js → chunk-YU54LNC6.js} +6 -6
  94. package/dist/{chunk-EAQMWJPG.js → chunk-ZMWX5SDA.js} +8 -8
  95. package/dist/{chunk-6ADZQFVW.js → chunk-ZUKZJQGR.js} +1 -1
  96. package/dist/{reapply-6PH3FMPX.js → reapply-D6RSDYCK.js} +9 -9
  97. package/dist/src/index.d.ts +1 -0
  98. package/dist/src/index.js +22 -20
  99. package/package.json +2 -1
  100. package/dist/chunk-DANOZVZK.js +0 -307
  101. package/dist/chunk-P32LPT2L.js +0 -6
  102. package/dist/chunk-YHG74UFF.js +0 -12
package/dist/src/index.js CHANGED
@@ -1,15 +1,15 @@
1
1
  import {
2
2
  handlePreToolUse
3
- } from "../chunk-DVQDPI3T.js";
4
- import "../chunk-WUNZAE7I.js";
5
- import "../chunk-KYQXUGH7.js";
6
- import "../chunk-52NVBNJT.js";
7
- import "../chunk-2C7CCWVX.js";
8
- import "../chunk-YHG74UFF.js";
9
- import "../chunk-ZQ7IDOKY.js";
3
+ } from "../chunk-UUTWHVSV.js";
4
+ import "../chunk-T3PRPFDY.js";
5
+ import "../chunk-KAJT6HPI.js";
6
+ import "../chunk-IZVAVXHQ.js";
7
+ import "../chunk-F6BMJOSW.js";
8
+ import "../chunk-5OP5MQI7.js";
9
+ import "../chunk-A6WQF7FQ.js";
10
10
  import {
11
11
  fetchAccountPublicKey
12
- } from "../chunk-KXMZMZD3.js";
12
+ } from "../chunk-QSZ37ROP.js";
13
13
  import {
14
14
  fetchModeOverride,
15
15
  fetchModeState,
@@ -18,31 +18,33 @@ import {
18
18
  handlePostToolUse,
19
19
  handleStop,
20
20
  reportEvent
21
- } from "../chunk-IJ6ECPA6.js";
22
- import "../chunk-DZURML2D.js";
21
+ } from "../chunk-2B4XCMH6.js";
22
+ import "../chunk-N6IOSZOE.js";
23
+ import "../chunk-RLRDPZG4.js";
23
24
  import {
24
25
  askUser,
25
26
  cancelQuestion,
26
27
  waitForAnswer
27
- } from "../chunk-EGKXSQCY.js";
28
- import "../chunk-V6QRSU2G.js";
28
+ } from "../chunk-2XOHXZRC.js";
29
+ import "../chunk-6QZK4O36.js";
29
30
  import "../chunk-POFBE6ZY.js";
30
- import "../chunk-JNXVOU6Y.js";
31
- import "../chunk-KW2RRR7D.js";
32
- import "../chunk-XNCMT7YY.js";
31
+ import "../chunk-D4OGEWLH.js";
32
+ import "../chunk-VQDJ6KB3.js";
33
+ import "../chunk-UFNBKYWT.js";
34
+ import "../chunk-HOIGXMI7.js";
33
35
  import "../chunk-7QLSKOSU.js";
34
36
  import "../chunk-KZERVKTD.js";
35
- import "../chunk-ROQK7IN3.js";
36
- import "../chunk-DNJUSFBL.js";
37
+ import "../chunk-LI3C2IQY.js";
38
+ import "../chunk-NYBZJ44G.js";
37
39
  import "../chunk-T7E75EKA.js";
38
40
  import {
39
41
  getApiKey,
40
42
  getBaseUrl
41
- } from "../chunk-V4AQBAVG.js";
42
- import "../chunk-B3UXMSMW.js";
43
+ } from "../chunk-SJN64NJX.js";
44
+ import "../chunk-65RN6ZCO.js";
43
45
  import {
44
46
  resolvePolicy
45
- } from "../chunk-YROGUPOZ.js";
47
+ } from "../chunk-WWTLAZQA.js";
46
48
  export {
47
49
  askUser,
48
50
  cancelQuestion,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pushary/agent-hooks",
3
- "version": "1.7.0",
3
+ "version": "1.7.2",
4
4
  "description": "Permission hooks for AI coding agents: route tool approvals through Pushary push notifications",
5
5
  "keywords": [
6
6
  "pushary",
@@ -89,6 +89,7 @@
89
89
  "test": "node ../../scripts/ci/run-tests.mjs src bin",
90
90
  "typecheck": "tsc --noEmit",
91
91
  "conformance": "bun scripts/hook-conformance.ts",
92
+ "live:phone-session-hooks": "bun scripts/phone-session-hooks.ts",
92
93
  "gen:hooks-spec": "bun scripts/generate-hooks-spec.ts"
93
94
  },
94
95
  "dependencies": {
@@ -1,307 +0,0 @@
1
- import {
2
- resolvePathBinary
3
- } from "./chunk-DNJUSFBL.js";
4
-
5
- // src/hermes-config.ts
6
- import { execFileSync } from "child_process";
7
- import { existsSync, readFileSync, rmSync, writeFileSync } from "fs";
8
- import { homedir, tmpdir } from "os";
9
- import { join } from "path";
10
- var isRecord = (value) => Boolean(value) && typeof value === "object" && !Array.isArray(value);
11
- var isSnapshot = (value) => isRecord(value) && typeof value.present === "boolean" && Object.hasOwn(value, "value");
12
- var isHermesConfigReceipt = (value) => {
13
- if (!isRecord(value)) return false;
14
- return ["security", "approval", "transport", "fallback", "plugins", "enabled", "agent", "disabled"].every((key) => isSnapshot(value[key])) && typeof value.pushary_enabled === "boolean" && typeof value.clarify_disabled === "boolean";
15
- };
16
- var HERMES_PIP_PACKAGE = "hermes-plugin-pushary";
17
- var HERMES_CONFIG_SCRIPT = String.raw`
18
- import json, os, sys
19
- from hermes_cli.config import load_config, save_config
20
-
21
- mode, receipt_path = sys.argv[1], sys.argv[2]
22
- c = load_config()
23
-
24
- def snap(obj, key):
25
- return {"present": key in obj, "value": obj.get(key)}
26
-
27
- restore_conflicts = []
28
-
29
- def restore(obj, key, before, ours):
30
- if before.get("present") and before.get("value") == ours:
31
- return
32
- if before.get("present"):
33
- if key in obj and obj.get(key) == before.get("value"):
34
- return
35
- elif key not in obj:
36
- return
37
- if obj.get(key) != ours:
38
- restore_conflicts.append(key)
39
- return
40
- if before.get("present"):
41
- obj[key] = before.get("value")
42
- else:
43
- obj.pop(key, None)
44
-
45
- def restore_container(obj, key, before, current, changed):
46
- raw = obj.get(key)
47
- if isinstance(before.get("value"), dict):
48
- if not isinstance(raw, dict):
49
- if changed:
50
- restore_conflicts.append(key)
51
- return
52
- if current or before.get("present"):
53
- obj[key] = current
54
- else:
55
- obj.pop(key, None)
56
- elif isinstance(raw, dict) and current:
57
- restore_conflicts.append(key)
58
- else:
59
- restore(obj, key, before, {})
60
-
61
- def restore_list_member(obj, key, before, ours, ours_before):
62
- raw = obj.get(key)
63
- if isinstance(before.get("value"), list):
64
- if ours_before:
65
- return
66
- if not isinstance(raw, list):
67
- restore_conflicts.append(key)
68
- return
69
- remaining = [item for item in raw if item != ours]
70
- if remaining or before.get("present"):
71
- obj[key] = remaining
72
- else:
73
- obj.pop(key, None)
74
- return
75
- if before.get("present") and raw == before.get("value"):
76
- return
77
- if not before.get("present") and key not in obj:
78
- return
79
- if not isinstance(raw, list):
80
- restore_conflicts.append(key)
81
- return
82
- remaining = [item for item in raw if item != ours]
83
- if remaining:
84
- restore_conflicts.append(key)
85
- else:
86
- restore(obj, key, before, raw)
87
-
88
- def valid_snapshot(value):
89
- return isinstance(value, dict) and isinstance(value.get("present"), bool) and "value" in value
90
-
91
- def valid_receipt(value):
92
- snapshots = ["security", "approval", "transport", "fallback", "plugins", "enabled", "agent", "disabled"]
93
- return (isinstance(value, dict)
94
- and all(valid_snapshot(value.get(key)) for key in snapshots)
95
- and isinstance(value.get("pushary_enabled"), bool)
96
- and isinstance(value.get("clarify_disabled"), bool))
97
-
98
- if mode == "setup":
99
- security_before = snap(c, "security")
100
- s = c.get("security") if isinstance(c.get("security"), dict) else {}
101
- approval_before = snap(s, "approval")
102
- ap = s.get("approval") if isinstance(s.get("approval"), dict) else {}
103
- plugins_before = snap(c, "plugins")
104
- p = c.get("plugins") if isinstance(c.get("plugins"), dict) else {}
105
- agent_before = snap(c, "agent")
106
- a = c.get("agent") if isinstance(c.get("agent"), dict) else {}
107
- enabled = p.get("enabled") if isinstance(p.get("enabled"), list) else []
108
- disabled = a.get("disabled_toolsets") if isinstance(a.get("disabled_toolsets"), list) else []
109
- receipt = {
110
- "security": security_before,
111
- "approval": approval_before,
112
- "transport": snap(ap, "transport"),
113
- "fallback": snap(ap, "transport_fallback"),
114
- "plugins": plugins_before,
115
- "enabled": snap(p, "enabled"),
116
- "pushary_enabled": "pushary" in enabled,
117
- "agent": agent_before,
118
- "disabled": snap(a, "disabled_toolsets"),
119
- "clarify_disabled": "clarify" in disabled,
120
- }
121
- if os.path.exists(receipt_path):
122
- with open(receipt_path, encoding="utf-8") as handle:
123
- existing_receipt = json.load(handle)
124
- if not valid_receipt(existing_receipt):
125
- raise ValueError("invalid Pushary Hermes setup receipt")
126
- else:
127
- os.makedirs(os.path.dirname(receipt_path), exist_ok=True)
128
- temp = receipt_path + ".tmp"
129
- with open(temp, "x", encoding="utf-8") as handle:
130
- json.dump(receipt, handle)
131
- os.chmod(temp, 0o600)
132
- os.replace(temp, receipt_path)
133
- ap["transport"] = "pushary"
134
- ap["transport_fallback"] = "builtin"
135
- s["approval"] = ap
136
- c["security"] = s
137
- p["enabled"] = enabled if "pushary" in enabled else enabled + ["pushary"]
138
- c["plugins"] = p
139
- a["disabled_toolsets"] = disabled if "clarify" in disabled else disabled + ["clarify"]
140
- c["agent"] = a
141
- else:
142
- receipt_exists = os.path.exists(receipt_path)
143
- try:
144
- with open(receipt_path, encoding="utf-8") as handle:
145
- receipt = json.load(handle)
146
- except (OSError, ValueError):
147
- if receipt_exists:
148
- raise
149
- receipt = None
150
- s = c.get("security") if isinstance(c.get("security"), dict) else {}
151
- ap = s.get("approval") if isinstance(s.get("approval"), dict) else {}
152
- if receipt:
153
- if not valid_receipt(receipt):
154
- raise ValueError("invalid Pushary Hermes setup receipt")
155
- approval_changed = (not receipt["transport"].get("present")
156
- or receipt["transport"].get("value") != "pushary"
157
- or not receipt["fallback"].get("present")
158
- or receipt["fallback"].get("value") != "builtin")
159
- plugins_changed = not (isinstance(receipt["enabled"].get("value"), list)
160
- and receipt["pushary_enabled"])
161
- agent_changed = not (isinstance(receipt["disabled"].get("value"), list)
162
- and receipt["clarify_disabled"])
163
- restore(ap, "transport", receipt["transport"], "pushary")
164
- restore(ap, "transport_fallback", receipt["fallback"], "builtin")
165
- else:
166
- if ap.get("transport") == "pushary": ap.pop("transport", None)
167
- if ap.get("transport_fallback") == "builtin": ap.pop("transport_fallback", None)
168
- if receipt:
169
- restore_container(s, "approval", receipt["approval"], ap, approval_changed)
170
- restore_container(c, "security", receipt["security"], s, approval_changed)
171
- else:
172
- if ap: s["approval"] = ap
173
- else: s.pop("approval", None)
174
- if s: c["security"] = s
175
- else: c.pop("security", None)
176
-
177
- p = c.get("plugins") if isinstance(c.get("plugins"), dict) else {}
178
- if receipt:
179
- restore_list_member(p, "enabled", receipt["enabled"], "pushary", receipt["pushary_enabled"])
180
- restore_container(c, "plugins", receipt["plugins"], p, plugins_changed)
181
- else:
182
- enabled = p.get("enabled") if isinstance(p.get("enabled"), list) else []
183
- enabled = [item for item in enabled if item != "pushary"]
184
- if enabled: p["enabled"] = enabled
185
- else: p.pop("enabled", None)
186
- if p: c["plugins"] = p
187
- else: c.pop("plugins", None)
188
-
189
- a = c.get("agent") if isinstance(c.get("agent"), dict) else {}
190
- if receipt:
191
- restore_list_member(a, "disabled_toolsets", receipt["disabled"], "clarify", receipt["clarify_disabled"])
192
- restore_container(c, "agent", receipt["agent"], a, agent_changed)
193
- else:
194
- disabled = a.get("disabled_toolsets") if isinstance(a.get("disabled_toolsets"), list) else []
195
- disabled = [item for item in disabled if item != "clarify"]
196
- if disabled: a["disabled_toolsets"] = disabled
197
- else: a.pop("disabled_toolsets", None)
198
- if a: c["agent"] = a
199
- else: c.pop("agent", None)
200
-
201
- if receipt and restore_conflicts:
202
- raise ValueError("Hermes config changed after Pushary setup")
203
-
204
- save_config(c)
205
- `;
206
- var resolveHermesPython = () => {
207
- const launcher = resolvePathBinary("hermes");
208
- if (launcher && process.platform !== "win32") {
209
- try {
210
- const shebang = readFileSync(launcher, "utf-8").split("\n", 1)[0];
211
- const interpreter = shebang?.startsWith("#!") ? shebang.slice(2).trim().split(/\s+/)[0] : void 0;
212
- if (interpreter && /python/i.test(interpreter) && existsSync(interpreter)) return interpreter;
213
- } catch {
214
- }
215
- }
216
- const root = join(homedir(), ".hermes", "hermes-agent", "venv");
217
- const candidates = process.platform === "win32" ? [join(root, "Scripts", "python.exe"), join(root, "Scripts", "python3.exe")] : [join(root, "bin", "python3"), join(root, "bin", "python")];
218
- return candidates.find(existsSync) ?? null;
219
- };
220
- var runHermesPythonScript = (python, script, ...args) => {
221
- const path = join(tmpdir(), `pushary-hermes-${process.pid}-${Date.now()}.py`);
222
- try {
223
- writeFileSync(path, script, { encoding: "utf-8", mode: 384 });
224
- execFileSync(python, [path, ...args], { env: { ...process.env }, stdio: "pipe", timeout: 15e3 });
225
- return true;
226
- } catch {
227
- return false;
228
- } finally {
229
- try {
230
- rmSync(path, { force: true });
231
- } catch {
232
- }
233
- }
234
- };
235
-
236
- // src/skills-cli.ts
237
- import { execSync } from "child_process";
238
- var PUSHARY_SKILL_SOURCE = "Pushary/pushary-skill";
239
- var PUSHARY_SKILL_NAME = "pushary";
240
- var installSkillViaSkillsCli = (agent) => {
241
- try {
242
- execSync(`npx -y skills@latest add ${PUSHARY_SKILL_SOURCE}@${PUSHARY_SKILL_NAME} -y -g --agent ${agent}`, {
243
- stdio: "pipe",
244
- timeout: 9e4
245
- });
246
- return true;
247
- } catch {
248
- return false;
249
- }
250
- };
251
- var installAgentSkill = async (request, effects) => {
252
- if (request.skillsCliInUse) {
253
- const startedAt = effects.now();
254
- if (effects.runSkillsCli(request.agent)) {
255
- const modifiedAt = effects.skillModifiedAt(request.agentSkillDir);
256
- if (modifiedAt !== null && modifiedAt >= startedAt) return "skills-cli";
257
- }
258
- }
259
- await effects.writePackagedSkill(request.agentSkillDir);
260
- return "packaged-copy";
261
- };
262
-
263
- // src/cli/dry-run.ts
264
- import { execFileSync as execFileSync2 } from "child_process";
265
- import { rmSync as rmSync2, writeFileSync as writeFileSync2 } from "fs";
266
- var createGuards = (isDryRun, note) => ({
267
- write: (path, contents) => {
268
- if (isDryRun()) return note("rewrite", path);
269
- writeFileSync2(path, contents, "utf-8");
270
- },
271
- remove: (path, options = {}) => {
272
- if (isDryRun()) return note("remove ", path);
273
- rmSync2(path, { recursive: true, force: options.force ?? false });
274
- },
275
- execFile: (file, args, options, describe) => {
276
- if (isDryRun()) return note("run ", describe);
277
- execFileSync2(file, args, options);
278
- }
279
- });
280
- var describeService = (effects) => {
281
- if (effects.controlMode === "off") return "skip the phone-start background service (--control off)";
282
- const where = effects.serviceDefinitionPath ?? "the phone-start service definition";
283
- const condition = effects.controlMode === "on" ? "" : ", when a supported agent and a service manager are present";
284
- return `write ${where} and register it with the OS${condition}`;
285
- };
286
- var describeSetupSideEffects = (effects) => [
287
- `run npm install -g @pushary/agent-hooks@${effects.version} (the hooks run from the global copy; up to two minutes)`,
288
- `write ${effects.configFile} (the API key, mode 600)`,
289
- effects.rcPath ? `edit ${effects.rcPath} (export PUSHARY_API_KEY)` : "print the export line for your shell, since no rc file was found",
290
- describeService(effects),
291
- "ask Add Pushary instructions to this project's CLAUDE.md/AGENTS.md? (default no)",
292
- "ask Alias claude to pushary claude? (default no)"
293
- ];
294
-
295
- export {
296
- isHermesConfigReceipt,
297
- HERMES_PIP_PACKAGE,
298
- HERMES_CONFIG_SCRIPT,
299
- resolveHermesPython,
300
- runHermesPythonScript,
301
- PUSHARY_SKILL_SOURCE,
302
- PUSHARY_SKILL_NAME,
303
- installSkillViaSkillsCli,
304
- installAgentSkill,
305
- createGuards,
306
- describeSetupSideEffects
307
- };
@@ -1,6 +0,0 @@
1
- // src/hooks-spec.ts
2
- var CURSOR_GATE_SCRIPT = "pushary-gate.mjs";
3
-
4
- export {
5
- CURSOR_GATE_SCRIPT
6
- };
@@ -1,12 +0,0 @@
1
- // src/answer.ts
2
- var denyReasonFrom = (value, note) => {
3
- const trimmed = note?.trim();
4
- if (trimmed) return `Denied from your phone: ${trimmed}`;
5
- return value && value !== "no" && value !== "yes" ? `Denied from your phone: ${value}` : "Denied via push notification";
6
- };
7
- var isDeferAnswer = (value) => value === "defer";
8
-
9
- export {
10
- denyReasonFrom,
11
- isDeferAnswer
12
- };