@pushary/agent-hooks 0.75.0 → 0.76.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 CHANGED
@@ -1,5 +1,36 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.76.0
4
+
5
+ ### A phone-supplied field could switch your approval gate off
6
+
7
+ `pushary claude --remote` sessions started from the phone build their command
8
+ line from fields the request supplies. The wrapper then read that command line
9
+ back to learn what it had been asked to do, and it scanned every position without
10
+ knowing which ones were a flag's **value** rather than a flag.
11
+
12
+ So a prompt or a model of `--permission-mode=dontAsk` was read as a real
13
+ permission mode. `dontAsk`, `plan` and `auto` all defer to the agent's own prompt
14
+ unconditionally, which means the session stopped asking you for approvals
15
+ entirely, and the decision log recorded a session that was never gated. A clean
16
+ approval history that is not true is worse than a missing one.
17
+
18
+ Flag values are now consumed with the flag that owns them, so nothing a request
19
+ supplies can be mistaken for an instruction. A `--permission-mode` you passed
20
+ yourself still works, in both the `--permission-mode plan` and
21
+ `--permission-mode=plan` forms.
22
+
23
+ The server that queues these sessions now also refuses flag-shaped model and
24
+ working-directory values, so an out-of-date CLI is protected against those two.
25
+ It cannot do the same for the prompt, which is free text you are entitled to
26
+ start with a dash, so **updating is what closes this one properly.**
27
+
28
+ Reaching it needed an authenticated session on your own account, spawning to your
29
+ own machine, with the daemon running. It is not cross-tenant and not remote code
30
+ execution. It matters most where the person spawning is not the person governed:
31
+ Team approval routing, Partner, and any case where a phone session or API key has
32
+ been compromised.
33
+
3
34
  ## 0.75.0
4
35
 
5
36
  ### An agent can now run the install
@@ -1047,18 +1047,33 @@ var flagValue = (args2, index) => {
1047
1047
  const next = args2[index + 1];
1048
1048
  return next && !next.startsWith("-") ? next : void 0;
1049
1049
  };
1050
+ var VALUE_TAKING_FLAGS = /* @__PURE__ */ new Set(["--model", "-m", "--cwd", "--add-dir", "--settings"]);
1051
+ var markValueConsumed = (args2, index, consumed, ownsNextToken) => {
1052
+ if (args2[index]?.includes("=")) return;
1053
+ const next = args2[index + 1];
1054
+ if (next == null) return;
1055
+ if (!ownsNextToken && next.startsWith("-")) return;
1056
+ consumed.add(index + 1);
1057
+ };
1050
1058
  var parseRemoteArgs = (args2) => {
1051
1059
  let initialPrompt;
1052
1060
  let resume;
1053
1061
  let permissionMode;
1062
+ const consumedAsValue = /* @__PURE__ */ new Set();
1054
1063
  for (let i = 0; i < args2.length; i++) {
1055
1064
  const arg = args2[i];
1065
+ if (consumedAsValue.has(i)) continue;
1056
1066
  if (arg === "-p" || arg === "--print" || arg?.startsWith("--print=")) {
1057
1067
  initialPrompt = flagValue(args2, i);
1068
+ markValueConsumed(args2, i, consumedAsValue, false);
1058
1069
  } else if (arg === "-r" || arg === "--resume" || arg?.startsWith("--resume=")) {
1059
1070
  resume = flagValue(args2, i);
1071
+ markValueConsumed(args2, i, consumedAsValue, false);
1060
1072
  } else if (arg === "--permission-mode" || arg?.startsWith("--permission-mode=")) {
1061
1073
  permissionMode = flagValue(args2, i);
1074
+ markValueConsumed(args2, i, consumedAsValue, false);
1075
+ } else if (VALUE_TAKING_FLAGS.has(arg ?? "")) {
1076
+ markValueConsumed(args2, i, consumedAsValue, true);
1062
1077
  }
1063
1078
  }
1064
1079
  return { initialPrompt, resume, permissionMode };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pushary/agent-hooks",
3
- "version": "0.75.0",
3
+ "version": "0.76.0",
4
4
  "description": "Permission hooks for AI coding agents: route tool approvals through Pushary push notifications",
5
5
  "keywords": [
6
6
  "pushary",