@pushary/agent-hooks 0.90.0 → 0.90.1

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 CHANGED
@@ -1,5 +1,18 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.90.1
4
+
5
+ ### Daemon logs distinguish health from failure
6
+
7
+ Successful daemon startup and phone-requested launches now go to the normal log,
8
+ leaving the error log for failures that need attention.
9
+
10
+ ### Command-store tests never touch live agent state
11
+
12
+ The pending command store accepts an explicit directory override. Tests use a
13
+ fresh temporary store, so parallel and sandboxed runs cannot read, overwrite, or
14
+ prune commands belonging to a real agent session.
15
+
3
16
  ## 0.90.0
4
17
 
5
18
  ### A hook that needs an answer is allowed to wait for one
@@ -41,7 +41,7 @@ import {
41
41
  phoneDrivenEnv,
42
42
  repoKeyFor,
43
43
  reportEvent
44
- } from "../chunk-TDZFPMSZ.js";
44
+ } from "../chunk-4LOPSGLP.js";
45
45
  import {
46
46
  DEFAULT_SESSION,
47
47
  askUser,
@@ -53,7 +53,7 @@ import {
53
53
  removePendingCommand,
54
54
  savePendingCommand,
55
55
  waitForAnswer
56
- } from "../chunk-FXEVRLHC.js";
56
+ } from "../chunk-F7OURW3C.js";
57
57
  import {
58
58
  UNNAMED_ACTION,
59
59
  deriveToolTarget,
@@ -34,7 +34,7 @@ import {
34
34
  toCodexWire,
35
35
  toPolicyLookup,
36
36
  toPolicyLookups
37
- } from "../chunk-TDZFPMSZ.js";
37
+ } from "../chunk-4LOPSGLP.js";
38
38
  import {
39
39
  DEFAULT_SESSION,
40
40
  askUser,
@@ -42,7 +42,7 @@ import {
42
42
  pollForAnswer,
43
43
  savePendingQuestion,
44
44
  sendNotification
45
- } from "../chunk-FXEVRLHC.js";
45
+ } from "../chunk-F7OURW3C.js";
46
46
  import {
47
47
  UNNAMED_ACTION,
48
48
  deriveActionBody,
@@ -1,11 +1,11 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  reportEvent
4
- } from "../chunk-TDZFPMSZ.js";
4
+ } from "../chunk-4LOPSGLP.js";
5
5
  import {
6
6
  askUser,
7
7
  waitForAnswer
8
- } from "../chunk-FXEVRLHC.js";
8
+ } from "../chunk-F7OURW3C.js";
9
9
  import "../chunk-L4E2BIJ2.js";
10
10
  import {
11
11
  getMachineId
@@ -329,7 +329,7 @@ var runSpawnDaemon = async () => {
329
329
  }
330
330
  const lifecycle = acquireDaemonLease({ machineId });
331
331
  if (lifecycle.kind === "already-running") {
332
- stderr(`[pushary] daemon already online as pid ${lifecycle.status.pid ?? "unknown"}
332
+ writeHuman(`[pushary] daemon already online as pid ${lifecycle.status.pid ?? "unknown"}
333
333
  `);
334
334
  return 0;
335
335
  }
@@ -11,7 +11,7 @@ import {
11
11
  cancelQuestion,
12
12
  pollForAnswer,
13
13
  savePendingQuestion
14
- } from "../chunk-FXEVRLHC.js";
14
+ } from "../chunk-F7OURW3C.js";
15
15
  import {
16
16
  getMachineId
17
17
  } from "../chunk-54ELC7D7.js";
@@ -22,7 +22,7 @@ import {
22
22
  readLastUserPrompt,
23
23
  repoKeyFor,
24
24
  reportEvent
25
- } from "../chunk-TDZFPMSZ.js";
25
+ } from "../chunk-4LOPSGLP.js";
26
26
  import {
27
27
  DEFAULT_SESSION,
28
28
  askUser,
@@ -30,7 +30,7 @@ import {
30
30
  savePendingQuestion,
31
31
  sendNotification,
32
32
  waitForAnswer
33
- } from "../chunk-FXEVRLHC.js";
33
+ } from "../chunk-F7OURW3C.js";
34
34
  import {
35
35
  UNNAMED_ACTION,
36
36
  deriveActionBody,
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  handlePreToolUse
4
- } from "../chunk-B7UZHEBL.js";
4
+ } from "../chunk-B6H2KAQC.js";
5
5
  import "../chunk-2LAHXHBR.js";
6
6
  import "../chunk-I463AEG3.js";
7
7
  import "../chunk-VHWCVD42.js";
@@ -9,8 +9,8 @@ import {
9
9
  readHookInput
10
10
  } from "../chunk-6CUUA7HO.js";
11
11
  import "../chunk-YHG74UFF.js";
12
- import "../chunk-TDZFPMSZ.js";
13
- import "../chunk-FXEVRLHC.js";
12
+ import "../chunk-4LOPSGLP.js";
13
+ import "../chunk-F7OURW3C.js";
14
14
  import "../chunk-L4E2BIJ2.js";
15
15
  import "../chunk-54ELC7D7.js";
16
16
  import "../chunk-KUZWXPUS.js";
@@ -4,8 +4,8 @@ import {
4
4
  } from "../chunk-6CUUA7HO.js";
5
5
  import {
6
6
  handleNotification
7
- } from "../chunk-TDZFPMSZ.js";
8
- import "../chunk-FXEVRLHC.js";
7
+ } from "../chunk-4LOPSGLP.js";
8
+ import "../chunk-F7OURW3C.js";
9
9
  import "../chunk-L4E2BIJ2.js";
10
10
  import "../chunk-54ELC7D7.js";
11
11
  import "../chunk-KUZWXPUS.js";
@@ -19,7 +19,7 @@ import {
19
19
  policyRequestFor,
20
20
  readLastPrompt,
21
21
  repoKeyFor
22
- } from "../chunk-TDZFPMSZ.js";
22
+ } from "../chunk-4LOPSGLP.js";
23
23
  import {
24
24
  DEFAULT_SESSION,
25
25
  askUser,
@@ -27,7 +27,7 @@ import {
27
27
  savePendingQuestion,
28
28
  sendNotification,
29
29
  waitForAnswer
30
- } from "../chunk-FXEVRLHC.js";
30
+ } from "../chunk-F7OURW3C.js";
31
31
  import {
32
32
  HOOK_FALLBACK_MAX,
33
33
  OPENCODE_TOOL_NAMES,
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  handlePermissionDenied
4
- } from "../chunk-B7UZHEBL.js";
4
+ } from "../chunk-B6H2KAQC.js";
5
5
  import "../chunk-2LAHXHBR.js";
6
6
  import "../chunk-I463AEG3.js";
7
7
  import "../chunk-VHWCVD42.js";
@@ -9,8 +9,8 @@ import {
9
9
  readHookInput
10
10
  } from "../chunk-6CUUA7HO.js";
11
11
  import "../chunk-YHG74UFF.js";
12
- import "../chunk-TDZFPMSZ.js";
13
- import "../chunk-FXEVRLHC.js";
12
+ import "../chunk-4LOPSGLP.js";
13
+ import "../chunk-F7OURW3C.js";
14
14
  import "../chunk-L4E2BIJ2.js";
15
15
  import "../chunk-54ELC7D7.js";
16
16
  import "../chunk-KUZWXPUS.js";
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  handlePermissionRequest
4
- } from "../chunk-B7UZHEBL.js";
4
+ } from "../chunk-B6H2KAQC.js";
5
5
  import "../chunk-2LAHXHBR.js";
6
6
  import "../chunk-I463AEG3.js";
7
7
  import "../chunk-VHWCVD42.js";
@@ -9,8 +9,8 @@ import {
9
9
  readHookInput
10
10
  } from "../chunk-6CUUA7HO.js";
11
11
  import "../chunk-YHG74UFF.js";
12
- import "../chunk-TDZFPMSZ.js";
13
- import "../chunk-FXEVRLHC.js";
12
+ import "../chunk-4LOPSGLP.js";
13
+ import "../chunk-F7OURW3C.js";
14
14
  import "../chunk-L4E2BIJ2.js";
15
15
  import "../chunk-54ELC7D7.js";
16
16
  import "../chunk-KUZWXPUS.js";
@@ -6,8 +6,8 @@ import {
6
6
  handleCompaction,
7
7
  handlePostToolUse,
8
8
  isCompactionEvent
9
- } from "../chunk-TDZFPMSZ.js";
10
- import "../chunk-FXEVRLHC.js";
9
+ } from "../chunk-4LOPSGLP.js";
10
+ import "../chunk-F7OURW3C.js";
11
11
  import "../chunk-L4E2BIJ2.js";
12
12
  import "../chunk-54ELC7D7.js";
13
13
  import "../chunk-KUZWXPUS.js";
@@ -4,8 +4,8 @@ import {
4
4
  } from "../chunk-6CUUA7HO.js";
5
5
  import {
6
6
  handleUserPrompt
7
- } from "../chunk-TDZFPMSZ.js";
8
- import "../chunk-FXEVRLHC.js";
7
+ } from "../chunk-4LOPSGLP.js";
8
+ import "../chunk-F7OURW3C.js";
9
9
  import "../chunk-L4E2BIJ2.js";
10
10
  import "../chunk-54ELC7D7.js";
11
11
  import "../chunk-KUZWXPUS.js";
@@ -4,8 +4,8 @@ import {
4
4
  } from "../chunk-6CUUA7HO.js";
5
5
  import {
6
6
  handleSessionEnd
7
- } from "../chunk-TDZFPMSZ.js";
8
- import "../chunk-FXEVRLHC.js";
7
+ } from "../chunk-4LOPSGLP.js";
8
+ import "../chunk-F7OURW3C.js";
9
9
  import "../chunk-L4E2BIJ2.js";
10
10
  import "../chunk-54ELC7D7.js";
11
11
  import "../chunk-KUZWXPUS.js";
@@ -4,8 +4,8 @@ import {
4
4
  } from "../chunk-6CUUA7HO.js";
5
5
  import {
6
6
  handleSessionStart
7
- } from "../chunk-TDZFPMSZ.js";
8
- import "../chunk-FXEVRLHC.js";
7
+ } from "../chunk-4LOPSGLP.js";
8
+ import "../chunk-F7OURW3C.js";
9
9
  import "../chunk-L4E2BIJ2.js";
10
10
  import "../chunk-54ELC7D7.js";
11
11
  import "../chunk-KUZWXPUS.js";
@@ -98,8 +98,8 @@ import {
98
98
  } from "../chunk-L4ZCFMWW.js";
99
99
  import {
100
100
  reportEvent
101
- } from "../chunk-TDZFPMSZ.js";
102
- import "../chunk-FXEVRLHC.js";
101
+ } from "../chunk-4LOPSGLP.js";
102
+ import "../chunk-F7OURW3C.js";
103
103
  import "../chunk-L4E2BIJ2.js";
104
104
  import "../chunk-54ELC7D7.js";
105
105
  import {
@@ -6,8 +6,8 @@ import {
6
6
  handleStop,
7
7
  handleSubagentStop,
8
8
  isSubagentStop
9
- } from "../chunk-TDZFPMSZ.js";
10
- import "../chunk-FXEVRLHC.js";
9
+ } from "../chunk-4LOPSGLP.js";
10
+ import "../chunk-F7OURW3C.js";
11
11
  import "../chunk-L4E2BIJ2.js";
12
12
  import "../chunk-54ELC7D7.js";
13
13
  import "../chunk-KUZWXPUS.js";
@@ -4,8 +4,8 @@ import {
4
4
  } from "../chunk-6CUUA7HO.js";
5
5
  import {
6
6
  handleStopFailure
7
- } from "../chunk-TDZFPMSZ.js";
8
- import "../chunk-FXEVRLHC.js";
7
+ } from "../chunk-4LOPSGLP.js";
8
+ import "../chunk-F7OURW3C.js";
9
9
  import "../chunk-L4E2BIJ2.js";
10
10
  import "../chunk-54ELC7D7.js";
11
11
  import "../chunk-KUZWXPUS.js";
@@ -13,7 +13,7 @@ import {
13
13
  savePendingCommand,
14
14
  sendNotification,
15
15
  waitForAnswer
16
- } from "./chunk-FXEVRLHC.js";
16
+ } from "./chunk-F7OURW3C.js";
17
17
  import {
18
18
  AGENT_IDENTITIES,
19
19
  compactionAction,
@@ -21,7 +21,7 @@ import {
21
21
  repoKeyFor,
22
22
  settleQuestionsForToolUse,
23
23
  throttlePass
24
- } from "./chunk-TDZFPMSZ.js";
24
+ } from "./chunk-4LOPSGLP.js";
25
25
  import {
26
26
  DEFAULT_SESSION,
27
27
  askUser,
@@ -29,7 +29,7 @@ import {
29
29
  pollForAnswer,
30
30
  savePendingQuestion,
31
31
  sendNotification
32
- } from "./chunk-FXEVRLHC.js";
32
+ } from "./chunk-F7OURW3C.js";
33
33
  import {
34
34
  UNNAMED_ACTION,
35
35
  deriveAction,
@@ -72,13 +72,13 @@ import { homedir, tmpdir } from "os";
72
72
  import { createHash } from "crypto";
73
73
  import { existsSync, mkdirSync, writeFileSync, readFileSync, readdirSync, renameSync, unlinkSync, rmSync, statSync } from "fs";
74
74
  var PENDING_DIR = join(tmpdir(), "pushary-pending");
75
- var COMMAND_DIR = join(homedir(), ".pushary", "run", "commands");
75
+ var commandRoot = () => process.env.PUSHARY_COMMAND_DIR?.trim() || join(homedir(), ".pushary", "run", "commands");
76
76
  var DEFAULT_SESSION = "_no_session";
77
77
  var GRACE_MS = 10 * 60 * 1e3;
78
78
  var sanitize = (sessionId) => sessionId.replace(/[^A-Za-z0-9_-]/g, "_").slice(0, 128) || DEFAULT_SESSION;
79
79
  var dirFor = (sessionId) => join(PENDING_DIR, sanitize(sessionId));
80
80
  var commandDirFor = (sessionId, namespace = "") => join(
81
- COMMAND_DIR,
81
+ commandRoot(),
82
82
  createHash("sha256").update(namespace).digest("hex").slice(0, 16),
83
83
  sanitize(sessionId)
84
84
  );
@@ -122,12 +122,12 @@ var pruneExpiredCommands = (dir) => {
122
122
  var pruneExpiredCommandStore = () => {
123
123
  let namespaces;
124
124
  try {
125
- namespaces = readdirSync(COMMAND_DIR, { withFileTypes: true });
125
+ namespaces = readdirSync(commandRoot(), { withFileTypes: true });
126
126
  } catch {
127
127
  return;
128
128
  }
129
129
  for (const namespace of namespaces.filter((entry) => entry.isDirectory())) {
130
- const namespaceDir = join(COMMAND_DIR, namespace.name);
130
+ const namespaceDir = join(commandRoot(), namespace.name);
131
131
  let sessions;
132
132
  try {
133
133
  sessions = readdirSync(namespaceDir, { withFileTypes: true });
package/dist/src/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  handlePreToolUse
3
- } from "../chunk-B7UZHEBL.js";
3
+ } from "../chunk-B6H2KAQC.js";
4
4
  import "../chunk-2LAHXHBR.js";
5
5
  import {
6
6
  fetchAccountPublicKey
@@ -16,12 +16,12 @@ import {
16
16
  handlePostToolUse,
17
17
  handleStop,
18
18
  reportEvent
19
- } from "../chunk-TDZFPMSZ.js";
19
+ } from "../chunk-4LOPSGLP.js";
20
20
  import {
21
21
  askUser,
22
22
  cancelQuestion,
23
23
  waitForAnswer
24
- } from "../chunk-FXEVRLHC.js";
24
+ } from "../chunk-F7OURW3C.js";
25
25
  import "../chunk-L4E2BIJ2.js";
26
26
  import "../chunk-54ELC7D7.js";
27
27
  import "../chunk-KUZWXPUS.js";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pushary/agent-hooks",
3
- "version": "0.90.0",
3
+ "version": "0.90.1",
4
4
  "description": "Permission hooks for AI coding agents: route tool approvals through Pushary push notifications",
5
5
  "keywords": [
6
6
  "pushary",