@pushary/agent-hooks 1.9.156 → 1.9.158

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 (140) hide show
  1. package/CHANGELOG.md +13 -0
  2. package/data/openclaw-plugin/README.md +1 -1
  3. package/data/openclaw-plugin/dist/approval-question.js +5 -5
  4. package/data/openclaw-plugin/dist/file-change-preview.js +67 -23
  5. package/data/openclaw-plugin/package.json +1 -1
  6. package/dist/{api-3C62HQDC.js → api-MRFKFDVV.js} +11 -11
  7. package/dist/bin/pushary-audit.js +3 -3
  8. package/dist/bin/pushary-bell-hook.js +28 -28
  9. package/dist/bin/pushary-bell.js +11 -11
  10. package/dist/bin/pushary-claude.js +27 -27
  11. package/dist/bin/pushary-clean.js +37 -37
  12. package/dist/bin/pushary-codex-bridge.js +23 -23
  13. package/dist/bin/pushary-codex-hook.js +50 -42
  14. package/dist/bin/pushary-codex-session.js +8 -8
  15. package/dist/bin/pushary-codex.js +16 -16
  16. package/dist/bin/pushary-connect.js +33 -33
  17. package/dist/bin/pushary-cowork.js +5 -5
  18. package/dist/bin/pushary-daemon.js +44 -44
  19. package/dist/bin/pushary-disconnect.js +28 -28
  20. package/dist/bin/pushary-doctor.js +45 -45
  21. package/dist/bin/pushary-elicitation-hook.js +28 -28
  22. package/dist/bin/pushary-gemini-bridge.js +17 -17
  23. package/dist/bin/pushary-gemini-hook.js +32 -32
  24. package/dist/bin/pushary-hook.js +35 -35
  25. package/dist/bin/pushary-login.js +22 -22
  26. package/dist/bin/pushary-logout.js +28 -28
  27. package/dist/bin/pushary-mcp.js +12 -12
  28. package/dist/bin/pushary-mode.js +16 -16
  29. package/dist/bin/pushary-notification-hook.js +27 -27
  30. package/dist/bin/pushary-opencode-hook.js +31 -31
  31. package/dist/bin/pushary-permission-denied-hook.js +35 -35
  32. package/dist/bin/pushary-permission-hook.js +35 -35
  33. package/dist/bin/pushary-post-hook.js +28 -28
  34. package/dist/bin/pushary-prompt-hook.js +27 -27
  35. package/dist/bin/pushary-session-end-hook.js +27 -27
  36. package/dist/bin/pushary-session-start-hook.js +37 -37
  37. package/dist/bin/pushary-setup.js +53 -53
  38. package/dist/bin/pushary-stats.js +5 -5
  39. package/dist/bin/pushary-status.js +34 -34
  40. package/dist/bin/pushary-stop-hook.js +27 -27
  41. package/dist/bin/pushary-stopfailure-hook.js +27 -27
  42. package/dist/bin/pushary-suggestions.js +16 -16
  43. package/dist/bin/pushary-transcript-register.js +17 -17
  44. package/dist/bin/pushary-transcripts.js +25 -25
  45. package/dist/bin/pushary-upgrade.js +42 -42
  46. package/dist/bin/pushary-wait.js +16 -16
  47. package/dist/bin/pushary.js +7 -7
  48. package/dist/{chunk-2N23JFER.js → chunk-2L52USKM.js} +3 -3
  49. package/dist/{chunk-XHPTW6WL.js → chunk-2MPT7YQK.js} +2 -2
  50. package/dist/{chunk-KHKN7Q7Z.js → chunk-3QU4WXAH.js} +5 -5
  51. package/dist/{chunk-KUUMJRFS.js → chunk-3UNZ7HRN.js} +75 -49
  52. package/dist/{chunk-O3NAHPCR.js → chunk-4B5K6YIP.js} +1 -1
  53. package/dist/{chunk-CHI57HS3.js → chunk-4I2SHNEU.js} +3 -3
  54. package/dist/{chunk-T3LSBTWU.js → chunk-4NHQAMSK.js} +2 -2
  55. package/dist/{chunk-DMWKPUAI.js → chunk-4SN4FHFZ.js} +2 -2
  56. package/dist/{chunk-UJJ2OXFA.js → chunk-4WL2MINE.js} +1 -1
  57. package/dist/{chunk-TIGOIQFK.js → chunk-6GGK3T24.js} +5 -5
  58. package/dist/{chunk-3FQJYA76.js → chunk-AGYD6XNI.js} +3 -3
  59. package/dist/{chunk-V4OIPLSC.js → chunk-ALQWZCUT.js} +4 -4
  60. package/dist/{chunk-C3HYWUZE.js → chunk-AMIUB22C.js} +1 -1
  61. package/dist/{chunk-QONYKXWP.js → chunk-ANQBLZAE.js} +1 -1
  62. package/dist/{chunk-P5JV6YZW.js → chunk-AOP55JR2.js} +1 -1
  63. package/dist/{chunk-AKUYCHJU.js → chunk-APCJZFTJ.js} +1 -1
  64. package/dist/{chunk-KWHADNCV.js → chunk-AZZNHW3R.js} +4 -4
  65. package/dist/{chunk-MH4O453X.js → chunk-B3BOAYRO.js} +3 -2
  66. package/dist/{chunk-UGJ25K2F.js → chunk-C6PAIHLP.js} +10 -10
  67. package/dist/{chunk-TIOQ55VZ.js → chunk-CAMFNSJS.js} +6 -6
  68. package/dist/{chunk-HXX4EFK3.js → chunk-CCKY3JDB.js} +3 -3
  69. package/dist/{chunk-B2SZN2C7.js → chunk-CIAJ55EQ.js} +5 -5
  70. package/dist/{chunk-ICHKAH5Q.js → chunk-CS4Z44F5.js} +6 -6
  71. package/dist/{chunk-WIOLCW7W.js → chunk-CSZWWPNS.js} +1 -1
  72. package/dist/{chunk-RF35YTIF.js → chunk-DHI3X5WK.js} +2 -2
  73. package/dist/{chunk-MEUAK5BK.js → chunk-EGBI4GRS.js} +2 -2
  74. package/dist/{chunk-CV6G4IDZ.js → chunk-EHRWEXRN.js} +2 -2
  75. package/dist/{chunk-6UGVZTRA.js → chunk-FGVBFDNV.js} +1 -1
  76. package/dist/{chunk-ANL74IBU.js → chunk-FTTSQAF4.js} +1 -1
  77. package/dist/{chunk-UOVTXOSS.js → chunk-GHHVXARK.js} +1 -1
  78. package/dist/{chunk-Z3W42VTS.js → chunk-GLDSXDRV.js} +5 -5
  79. package/dist/{chunk-3EF7G5EV.js → chunk-GTYVNVBZ.js} +4 -4
  80. package/dist/{chunk-KB7YWU7A.js → chunk-HA2SRYYP.js} +18 -0
  81. package/dist/{chunk-7HDQUTRK.js → chunk-IIK3CZXJ.js} +7 -7
  82. package/dist/{chunk-JIH55UHZ.js → chunk-IKC33YKC.js} +8 -5
  83. package/dist/{chunk-W2GOSAFI.js → chunk-IOKJJ2SY.js} +4 -4
  84. package/dist/{chunk-PMEDJ4WM.js → chunk-IVOELLUK.js} +4 -4
  85. package/dist/{chunk-RF7HGOBC.js → chunk-J7HSUQK2.js} +2 -2
  86. package/dist/{chunk-WWDWEVGT.js → chunk-JKRQL2BL.js} +5 -5
  87. package/dist/{chunk-5TCLBCUO.js → chunk-K3I2NMEF.js} +6 -6
  88. package/dist/{chunk-DDSMTD4W.js → chunk-K3OCYJPK.js} +3 -3
  89. package/dist/{chunk-25PVMWSM.js → chunk-LVZBLKAU.js} +1 -1
  90. package/dist/{chunk-4RSJZOKB.js → chunk-MHYX5Q3F.js} +1 -1
  91. package/dist/{chunk-44FDCO7M.js → chunk-MLPPQ556.js} +8 -8
  92. package/dist/{chunk-OGB4QCB3.js → chunk-MTITL2IG.js} +5 -5
  93. package/dist/{chunk-Y6OGY2G4.js → chunk-N2LWKWNY.js} +3 -3
  94. package/dist/{chunk-Q242EVCI.js → chunk-N3CFEMLS.js} +2 -2
  95. package/dist/{chunk-YPSP7NZI.js → chunk-N5SSADNW.js} +4 -4
  96. package/dist/{chunk-G6SQOGSD.js → chunk-NW63PGKF.js} +4 -4
  97. package/dist/{chunk-FIBJOHFC.js → chunk-OCWXE4PR.js} +8 -8
  98. package/dist/{chunk-WCVANKUD.js → chunk-ORQ7THNZ.js} +1 -1
  99. package/dist/{chunk-C4K4KYOY.js → chunk-PBPQRJ2T.js} +3 -3
  100. package/dist/{chunk-PKU3WFT5.js → chunk-PI3BOI3A.js} +1 -1
  101. package/dist/{chunk-E2KAAKWU.js → chunk-PND5IGC7.js} +3 -3
  102. package/dist/{chunk-UAYNQ2IG.js → chunk-Q7WCDUFV.js} +4 -4
  103. package/dist/{chunk-ALRANF2G.js → chunk-QP3TCKRZ.js} +117 -29
  104. package/dist/{chunk-3UYTCDDY.js → chunk-QVVBU2JU.js} +6 -6
  105. package/dist/{chunk-WSPDIT2B.js → chunk-RL5JLDRE.js} +2 -2
  106. package/dist/{chunk-F6ZBXV4G.js → chunk-RRVFN432.js} +1 -1
  107. package/dist/{chunk-JBF6A2X5.js → chunk-SNQOEDZ2.js} +1 -1
  108. package/dist/{chunk-EQF6SSQL.js → chunk-SZMDRBNK.js} +2 -2
  109. package/dist/{chunk-MGT2V2AB.js → chunk-T3PZQNIK.js} +1 -1
  110. package/dist/{chunk-S6DJAYQW.js → chunk-TKBCLK4B.js} +5 -5
  111. package/dist/{chunk-CAZ5FMWP.js → chunk-TMWXWBFP.js} +6 -6
  112. package/dist/{chunk-BMR66K6T.js → chunk-TPLTB256.js} +4 -4
  113. package/dist/{chunk-TWOSBIAW.js → chunk-TSR3FPGL.js} +1 -1
  114. package/dist/{chunk-R4DMHIOK.js → chunk-TYBVQ33X.js} +5 -5
  115. package/dist/{chunk-MOX7IOGL.js → chunk-TZJR5ESF.js} +5 -5
  116. package/dist/{chunk-ELF4NIIM.js → chunk-UDLWNOXX.js} +2 -2
  117. package/dist/{chunk-EPYNFHCW.js → chunk-UPI3JDHZ.js} +3 -3
  118. package/dist/{chunk-WDCS3RGI.js → chunk-UVWKMFLQ.js} +2 -2
  119. package/dist/{chunk-6NRFAP45.js → chunk-V36P4KS4.js} +1 -1
  120. package/dist/{chunk-HKID4EAA.js → chunk-X254TRBU.js} +4 -4
  121. package/dist/{chunk-JQ3X62Q7.js → chunk-XHCX6DOY.js} +5 -5
  122. package/dist/{chunk-KOBIBSE6.js → chunk-XNJ2HOEL.js} +3 -3
  123. package/dist/{chunk-4IOT26IC.js → chunk-XSIZKQ2C.js} +11 -11
  124. package/dist/{chunk-M2WLCRMX.js → chunk-YPFOTFEG.js} +1 -1
  125. package/dist/{chunk-2LTRA6NA.js → chunk-ZYDE6QRW.js} +3 -3
  126. package/dist/{codex-app-cards-switch-B7GY2ONI.js → codex-app-cards-switch-CXXDGH7R.js} +11 -11
  127. package/dist/{codex-card-routing-6RN4N266.js → codex-card-routing-WP4IHJFN.js} +2 -2
  128. package/dist/{codex-desktop-launch-K4GU2NFZ.js → codex-desktop-launch-EN7ACHC6.js} +1 -1
  129. package/dist/{codex-session-launch-AVEFGOT7.js → codex-session-launch-7BV4VTJW.js} +20 -20
  130. package/dist/{config-YGUXX5GB.js → config-SZMMBOJV.js} +3 -3
  131. package/dist/{global-upgrade-HLXPTFDU.js → global-upgrade-I5J6BDHA.js} +9 -9
  132. package/dist/{identity-CAC763RQ.js → identity-GLJNTNHW.js} +4 -4
  133. package/dist/{live-capabilities-WRI22INV.js → live-capabilities-AYO7FOHS.js} +4 -4
  134. package/dist/{paths-DNXBDJJH.js → paths-NRBEF3T2.js} +3 -3
  135. package/dist/{reapply-HUOMCZ2U.js → reapply-J2QUV7J2.js} +30 -30
  136. package/dist/src/index.d.ts +6 -1
  137. package/dist/src/index.js +34 -34
  138. package/dist/{upgrade-lock-CRW26OIW.js → upgrade-lock-H6SU7MJR.js} +4 -4
  139. package/dist/{usage-AWWCZ7H7.js → usage-MY3DIFBG.js} +3 -3
  140. package/package.json +1 -1
package/CHANGELOG.md CHANGED
@@ -1,5 +1,18 @@
1
1
  # Changelog
2
2
 
3
+ ## 1.9.158
4
+
5
+ - The CLI now tells Pushary why each tool call ran without a question, so a quiet session can be told apart from a broken one. This covers Claude Code and every agent that runs the same `pushary-hook` and `pushary-post-hook`: Qwen Code, CodeBuddy, Qoder, Droid, Devin, Antigravity CLI and Grok Build. `PreToolUse` leaves a small record for the call, keyed by its tool use id, saying how it ended: the agent's permission mode owned it, Claude Code's own allowlist owned it, a standing rule allowed it, Pushary asked, Pushary tried to ask and could not (for example because the workspace has no active subscription), the call went to the agent's prompt, Pushary could not decide, or it was refused or stopped. The `PostToolUse` report for the same call reads the record back and sends it as `gateOutcome`. Only calls whose `PostToolUse` Pushary reports leave a record: the gated tools, `Task` and `WebFetch`. `Agent`, `ExitPlanMode`, `AskUserQuestion` and MCP calls leave none, and a machine with no key leaves none. The record lives in your temporary folder for at most an hour, at most 512 at a time, in a folder only you can open. Expired records are cleared at most every 10 minutes, and a record that cannot be written is skipped without a message. What `PreToolUse` decides is unchanged.
6
+ - The tool, prompt, turn end, subagent, compaction, session start and end, notification, failed turn and auto mode denial reports now carry `permissionMode` when the hook input has one. Codex sends the same field on its tool, prompt, turn end, session and subagent reports, from the `permission_mode` its hook input already carries. Codex reports no `gateOutcome`.
7
+ - Both fields are additions to the existing reports, and the server accepts reports without them, so an older CLI keeps working against the new server and this CLI against an older one.
8
+
9
+ ## 1.9.157
10
+
11
+ - This CLI carries the OpenClaw plugin 0.1.4. An approval for a `.env` file no longer sends its values. A complete write sends the variable names only when every line is a plain `NAME=value` assignment, a comment or blank. Any other line, such as a quoted value spread over several lines or an unclosed quote, means the approval sends neither names nor values. Before, a quoted value that spanned several lines had its later lines sent as written.
12
+ - An edit or a patch to a `.env` file sends the paths and leaves out the changed lines, because a fragment can start inside a value. A patch that also changes other files still shows those files in full, including when its file headers are indented. A patch that arrives in `command`, as OpenClaw's Codex harness sends it, is shown as a patch with the same rules. Before, it was shown as a command with the whole patch, `.env` lines included.
13
+ - A `write` or `edit` to a `.env` file whose parameters the plugin cannot read, such as an `edits` entry without its `newText`, sends only the path instead of every parameter. An `edit` that also carries a `command` parameter is shown as the file change, not as a command.
14
+ - The plugin recognises Windows paths, `file://` URLs (including a network share such as `file://server/share/.env`) and Windows stream names such as `.env::$DATA` as `.env` files.
15
+
3
16
  ## 1.9.156
4
17
 
5
18
  - OpenCode: questions reach your phone. OpenCode asked its own questions, such as "ask me a multiple choice question", with its built-in `question` tool, which shows only in the terminal. Pushary forwards OpenCode's permission prompts, but no plugin API can answer that tool, so nothing reached the phone or the Mac notch. The instructions setup writes to OpenCode's `AGENTS.md` now tell it to ask every question through Pushary's `ask_user`, one at a time, even while you are at the terminal, as fx already does. They name both forms OpenCode offers: `tools.pushary.ask_user(...)` inside `execute` when OpenCode 2 lists Pushary under Code Mode, and the direct `pushary_ask_user` otherwise. So a question now reaches your phone and the Mac notch while you are at your desk too, and you can answer it there. In Terminal mode Pushary hands it straight back to OpenCode's prompt. A handoff that asks in the terminal, or an `ask_user` that fails, still falls back to OpenCode's own prompt. Setup and `pushary upgrade` write the new block; an existing CLI connection gets it on the next upgrade, and a Mac app connection after the Mac app update and a reconnect.
@@ -104,7 +104,7 @@ Before anything is sent, the plugin removes what it can recognise as a secret:
104
104
 
105
105
  - Key and token formats it knows: Pushary keys, `sk-` keys (OpenAI, Anthropic), Stripe, GitHub, GitLab, Slack, Google, AWS access key ids, npm, xAI and JWTs, plus private key blocks and long base64-like strings of 40 or more characters.
106
106
  - Passwords in URLs, `Bearer` and `Authorization` values, and the value of anything named like a password, token, secret, API key, access key, client secret or private key. In JSON this holds at any depth, whatever the value.
107
- - Every value in a `.env` file (`.env`, `.env.*` or a name ending in `.env`, such as `gateway.env`). Only the variable names are sent.
107
+ - For a complete write to a `.env` file (`.env`, `.env.*` or a name ending in `.env`, such as `gateway.env`), Pushary receives the variable names when every line is a plain `NAME=value` assignment, a comment or blank. A file with any other line, such as a value spread over several lines, sends neither names nor values. For an edit or patch, Pushary receives the paths and omits the dotenv change contents because a fragment can start inside a value.
108
108
 
109
109
  Redaction works from these patterns. A secret in a command that matches none of them, such as a password with spaces passed to a flag of its own, is sent as written. The plugin leaves the rest of a command as it is so you can see what will run.
110
110
 
@@ -1,5 +1,5 @@
1
1
  import { commandPreviewOf } from './command-preview.js';
2
- import { fileChangePreviewOf } from './file-change-preview.js';
2
+ import { fileChangePreviewOf, PATCH_OPERATION } from './file-change-preview.js';
3
3
  import { serializedWithCredentialsRedacted } from './parameter-redaction.js';
4
4
  import { redactSecrets, redactSecretsDeep } from './redaction.js';
5
5
  import { SESSIONS_SPAWN_TOOL, SPAWN_FOLDER_PARAMETER, startsAnAcpSession } from './protected-writes.js';
@@ -27,12 +27,12 @@ const stringParameter = (params, name) => {
27
27
  return typeof value === 'string' && value.trim().length > 0 ? value : undefined;
28
28
  };
29
29
  const describedCall = (event) => {
30
- const preview = commandPreviewOf(event.params, PARAMETERS_THE_CONTEXT_SHOWS);
31
- if (preview !== null)
32
- return { kind: 'command', preview };
33
30
  const change = fileChangePreviewOf(hostToolId(event.toolName), event.params);
34
31
  if (change !== null)
35
32
  return { kind: 'file_change', change };
33
+ const preview = commandPreviewOf(event.params, PARAMETERS_THE_CONTEXT_SHOWS);
34
+ if (preview !== null)
35
+ return { kind: 'command', preview };
36
36
  const visible = withHiddenCharactersShown(serializedWithCredentialsRedacted(event.params));
37
37
  return { kind: 'parameters', line: redactSecrets(visible), body: redactSecretsDeep(visible) };
38
38
  };
@@ -55,7 +55,7 @@ const commandQuestion = (preview) => {
55
55
  const quotedList = (paths) => truncated(paths.map(path => `\`${collapsed(path)}\``).join(', '), QUESTION_SUMMARY_MAX);
56
56
  const fileChangeQuestion = (change) => {
57
57
  const targets = quotedList(change.paths);
58
- const asked = change.operation === 'patch' ? `apply a patch to ${targets}` : `${change.operation} ${targets}`;
58
+ const asked = change.operation === PATCH_OPERATION ? `apply a patch to ${targets}` : `${change.operation} ${targets}`;
59
59
  return `Allow ${AGENT_LABEL} to ${asked}? Read the change before you answer.`;
60
60
  };
61
61
  const quotedForQuestion = (text) => `\`${truncated(collapsed(redactSecrets(withHiddenCharactersShown(text))), QUESTION_SUMMARY_MAX)}\``;
@@ -1,19 +1,28 @@
1
- import { basename } from 'node:path';
1
+ import { win32 } from 'node:path';
2
+ import { fileURLToPath } from 'node:url';
3
+ import { isRecord } from './parameter-redaction.js';
2
4
  import { APPLY_PATCH_TOOL, EDIT_TOOL, patchTargetsOf, WRITE_TOOL } from './protected-writes.js';
3
5
  import { redactSecrets, redactSecretsDeep } from './redaction.js';
4
6
  import { withHiddenCharactersShown } from './visible-text.js';
7
+ export const WRITE_OPERATION = 'write';
8
+ export const EDIT_OPERATION = 'edit';
9
+ export const PATCH_OPERATION = 'patch';
5
10
  const PATH_PARAMETER = 'path';
6
11
  const CONTENT_PARAMETER = 'content';
7
12
  const EDITS_PARAMETER = 'edits';
8
- const PATCH_PARAMETER = 'input';
13
+ const PATCH_PARAMETERS = ['input', 'command'];
9
14
  const OLD_TEXT_PARAMETER = 'oldText';
10
15
  const NEW_TEXT_PARAMETER = 'newText';
11
16
  const ENV_FILE_NAME = '.env';
12
- const ENV_ASSIGNMENT = /^([+\- ]?[ \t]*(?:export[ \t]+)?[A-Za-z_][A-Za-z0-9_.-]*[ \t]*=[ \t]*)\S.*$/gm;
13
- const HIDDEN_VALUE = '[value not sent]';
17
+ const ENV_BLANK_OR_COMMENT_LINE = /^[ \t]*(?:#.*)?$/;
18
+ const ENV_ASSIGNMENT_LINE = /^[ \t]*(?:export[ \t]+)?([A-Za-z_][A-Za-z0-9_.-]*)[ \t]*=[ \t]*(?:(?:"[^"]*"|'[^']*'|`[^`]*`)[ \t]*(?:#.*)?|[^"'`\s].*)?$/;
19
+ const WINDOWS_STREAM_SEPARATOR = ':';
20
+ const ENV_VALUE_HIDDEN = '[value not sent]';
21
+ const ENV_EDIT_HIDDEN = '[dotenv change contents not sent]';
22
+ const PATCH_FILE_START = /(?=^[ \t]*\*\*\* (?:Add|Delete|Update) File: )/m;
23
+ const PATCH_END = '*** End Patch';
14
24
  const REMOVED_LINE_PREFIX = '- ';
15
25
  const ADDED_LINE_PREFIX = '+ ';
16
- const isRecord = (value) => typeof value === 'object' && value !== null && !Array.isArray(value);
17
26
  const textParameter = (params, name) => {
18
27
  const value = params[name];
19
28
  return typeof value === 'string' ? value : undefined;
@@ -22,15 +31,41 @@ const pathParameter = (params) => {
22
31
  const path = textParameter(params, PATH_PARAMETER)?.trim();
23
32
  return path ? path : undefined;
24
33
  };
34
+ const fileUrlPathOf = (url) => {
35
+ try {
36
+ return fileURLToPath(url);
37
+ }
38
+ catch {
39
+ return url;
40
+ }
41
+ };
42
+ const isEnvFileName = (name) => name.endsWith(ENV_FILE_NAME) || name.startsWith(`${ENV_FILE_NAME}.`);
25
43
  export const isEnvFile = (path) => {
26
- const name = basename(path.trim()).toLowerCase();
27
- return name.endsWith(ENV_FILE_NAME) || name.startsWith(`${ENV_FILE_NAME}.`);
44
+ const referenced = path.trim().replace(/^@/, '');
45
+ const resolved = referenced.startsWith('file://') ? fileUrlPathOf(referenced) : referenced;
46
+ const name = win32.basename(resolved).toLowerCase();
47
+ const [nameBeforeStream = name] = name.split(WINDOWS_STREAM_SEPARATOR);
48
+ return isEnvFileName(name) || isEnvFileName(nameBeforeStream);
28
49
  };
29
- const withEnvValuesHidden = (text) => text.replace(ENV_ASSIGNMENT, `$1${HIDDEN_VALUE}`);
30
- const sendableText = (text, hidesEnvValues) => {
31
- const visible = withHiddenCharactersShown(text);
32
- return redactSecretsDeep(hidesEnvValues ? withEnvValuesHidden(visible) : visible);
50
+ const sendableText = (text) => redactSecretsDeep(withHiddenCharactersShown(text));
51
+ const isEnvBlankOrComment = (line) => ENV_BLANK_OR_COMMENT_LINE.test(line);
52
+ const assignedEnvNameOf = (line) => ENV_ASSIGNMENT_LINE.exec(line)?.[1] ?? null;
53
+ const isEnvName = (name) => name !== null;
54
+ const envNamesOnly = (content) => {
55
+ const lines = content.split(/\r?\n/).filter(line => !isEnvBlankOrComment(line));
56
+ const names = lines.map(assignedEnvNameOf).filter(isEnvName);
57
+ if (names.length === 0 || names.length !== lines.length)
58
+ return ENV_EDIT_HIDDEN;
59
+ return [...new Set(names)].sort().map(name => `${name}=${ENV_VALUE_HIDDEN}`).join('\n');
33
60
  };
61
+ const isPatchPathHeader = (line) => patchTargetsOf(line).length > 0;
62
+ const withoutEnvPatchContents = (patch) => patch.split(PATCH_FILE_START).map(section => {
63
+ if (!patchTargetsOf(section).some(isEnvFile))
64
+ return section;
65
+ const headers = section.split(/\r?\n/).filter(isPatchPathHeader);
66
+ const end = section.trimEnd().endsWith(PATCH_END) ? [PATCH_END] : [];
67
+ return [...headers, ENV_EDIT_HIDDEN, ...end, ''].join('\n');
68
+ }).join('');
34
69
  const sendablePath = (path) => redactSecrets(withHiddenCharactersShown(path));
35
70
  const lineCountOf = (text) => {
36
71
  if (text.length === 0)
@@ -66,39 +101,38 @@ const writePreviewOf = (params) => {
66
101
  return null;
67
102
  const shownPath = sendablePath(path);
68
103
  return {
69
- operation: 'write',
104
+ operation: WRITE_OPERATION,
70
105
  paths: [shownPath],
71
- body: `Write ${shownPath}, ${plural(lineCountOf(content), 'line')}:\n\n${sendableText(content, isEnvFile(path))}`,
106
+ body: `Write ${shownPath}, ${plural(lineCountOf(content), 'line')}:\n\n${sendableText(isEnvFile(path) ? envNamesOnly(content) : content)}`,
72
107
  };
73
108
  };
74
- const shownEdit = (edit, hidesEnvValues) => [prefixedLines(sendableText(edit.oldText, hidesEnvValues), REMOVED_LINE_PREFIX), prefixedLines(sendableText(edit.newText, hidesEnvValues), ADDED_LINE_PREFIX)].join('\n');
109
+ const shownEdit = (edit) => [prefixedLines(sendableText(edit.oldText), REMOVED_LINE_PREFIX), prefixedLines(sendableText(edit.newText), ADDED_LINE_PREFIX)].join('\n');
75
110
  const editPreviewOf = (params) => {
76
111
  const path = pathParameter(params);
77
112
  const edits = textEditsOf(params);
78
113
  if (path === undefined || edits === null)
79
114
  return null;
80
115
  const shownPath = sendablePath(path);
81
- const hidesEnvValues = isEnvFile(path);
116
+ const changes = isEnvFile(path) ? ENV_EDIT_HIDDEN : edits.map(shownEdit).join('\n\n');
82
117
  return {
83
- operation: 'edit',
118
+ operation: EDIT_OPERATION,
84
119
  paths: [shownPath],
85
- body: `Edit ${shownPath}, ${plural(edits.length, 'change')}:\n\n${edits.map(edit => shownEdit(edit, hidesEnvValues)).join('\n\n')}`,
120
+ body: `Edit ${shownPath}, ${plural(edits.length, 'change')}:\n\n${changes}`,
86
121
  };
87
122
  };
123
+ const hasPatchTargets = (text) => text !== undefined && patchTargetsOf(text).length > 0;
88
124
  const patchPreviewOf = (params) => {
89
- const patch = textParameter(params, PATCH_PARAMETER);
125
+ const patch = PATCH_PARAMETERS.map(name => textParameter(params, name)).find(hasPatchTargets);
90
126
  if (patch === undefined)
91
127
  return null;
92
128
  const targets = patchTargetsOf(patch);
93
- if (targets.length === 0)
94
- return null;
95
129
  return {
96
- operation: 'patch',
130
+ operation: PATCH_OPERATION,
97
131
  paths: targets.map(sendablePath),
98
- body: sendableText(patch, targets.some(isEnvFile)),
132
+ body: sendableText(targets.some(isEnvFile) ? withoutEnvPatchContents(patch) : patch),
99
133
  };
100
134
  };
101
- export const fileChangePreviewOf = (toolId, params) => {
135
+ const readablePreviewOf = (toolId, params) => {
102
136
  if (toolId === WRITE_TOOL)
103
137
  return writePreviewOf(params);
104
138
  if (toolId === EDIT_TOOL)
@@ -107,3 +141,13 @@ export const fileChangePreviewOf = (toolId, params) => {
107
141
  return patchPreviewOf(params);
108
142
  return null;
109
143
  };
144
+ const PATH_CHANGE_OPERATIONS = new Map([
145
+ [WRITE_TOOL, WRITE_OPERATION],
146
+ [EDIT_TOOL, EDIT_OPERATION],
147
+ ]);
148
+ const withheldEnvChangeOf = (toolId, params) => {
149
+ const operation = PATH_CHANGE_OPERATIONS.get(toolId);
150
+ const path = pathParameter(params);
151
+ return operation === undefined || path === undefined || !isEnvFile(path) ? null : { operation, paths: [sendablePath(path)], body: ENV_EDIT_HIDDEN };
152
+ };
153
+ export const fileChangePreviewOf = (toolId, params) => readablePreviewOf(toolId, params) ?? withheldEnvChangeOf(toolId, params);
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pushary/openclaw",
3
- "version": "0.1.3",
3
+ "version": "0.1.4",
4
4
  "description": "Phone approvals for OpenClaw. Pushary asks you before your AI agent runs a gated tool call, and blocks the call unless you approve it.",
5
5
  "author": "Pushary <business@pushary.com>",
6
6
  "homepage": "https://pushary.com/human-in-the-loop-openclaw",
@@ -19,25 +19,25 @@ import {
19
19
  waitRetryPauseMs,
20
20
  waitsForThePhone,
21
21
  withdrawQuestion
22
- } from "./chunk-ICHKAH5Q.js";
22
+ } from "./chunk-CS4Z44F5.js";
23
23
  import "./chunk-POFBE6ZY.js";
24
- import "./chunk-MOX7IOGL.js";
25
- import "./chunk-C4K4KYOY.js";
26
- import "./chunk-E2KAAKWU.js";
27
- import "./chunk-TWOSBIAW.js";
28
- import "./chunk-4RSJZOKB.js";
24
+ import "./chunk-TZJR5ESF.js";
25
+ import "./chunk-PBPQRJ2T.js";
26
+ import "./chunk-PND5IGC7.js";
27
+ import "./chunk-TSR3FPGL.js";
28
+ import "./chunk-MHYX5Q3F.js";
29
29
  import "./chunk-YU2EUD7O.js";
30
- import "./chunk-MH4O453X.js";
31
- import "./chunk-PMEDJ4WM.js";
32
- import "./chunk-ANL74IBU.js";
30
+ import "./chunk-B3BOAYRO.js";
31
+ import "./chunk-IVOELLUK.js";
32
+ import "./chunk-FTTSQAF4.js";
33
33
  import "./chunk-BG4HHB7E.js";
34
34
  import "./chunk-TODDEIYG.js";
35
- import "./chunk-P5JV6YZW.js";
35
+ import "./chunk-AOP55JR2.js";
36
36
  import "./chunk-WIIMW5YO.js";
37
37
  import {
38
38
  DECISION_STOP_REASON,
39
39
  UNVERIFIABLE_APPROVAL_REASON
40
- } from "./chunk-KB7YWU7A.js";
40
+ } from "./chunk-HA2SRYYP.js";
41
41
  import "./chunk-MLKGABMK.js";
42
42
  export {
43
43
  ABANDONED_WAIT,
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  exitOnHelpFlag
4
- } from "../chunk-MGT2V2AB.js";
4
+ } from "../chunk-T3PZQNIK.js";
5
5
  import {
6
6
  EXIT
7
7
  } from "../chunk-BG4HHB7E.js";
@@ -9,7 +9,7 @@ import {
9
9
  readJsonSafe,
10
10
  writeJsonAtomic
11
11
  } from "../chunk-TODDEIYG.js";
12
- import "../chunk-P5JV6YZW.js";
12
+ import "../chunk-AOP55JR2.js";
13
13
  import "../chunk-WIIMW5YO.js";
14
14
  import {
15
15
  AUDIT_CHAIN_FINDING_SEVERITY,
@@ -22,7 +22,7 @@ import {
22
22
  parseAuditChainExport,
23
23
  parseAuditKnownHead,
24
24
  verifyAuditChainSite
25
- } from "../chunk-KB7YWU7A.js";
25
+ } from "../chunk-HA2SRYYP.js";
26
26
  import "../chunk-MLKGABMK.js";
27
27
 
28
28
  // src/audit-verify.ts
@@ -1,45 +1,45 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  handleBell
4
- } from "../chunk-WCVANKUD.js";
4
+ } from "../chunk-ORQ7THNZ.js";
5
5
  import {
6
6
  readHookInput
7
- } from "../chunk-KHKN7Q7Z.js";
8
- import "../chunk-3EF7G5EV.js";
9
- import "../chunk-UGJ25K2F.js";
7
+ } from "../chunk-3QU4WXAH.js";
8
+ import "../chunk-GTYVNVBZ.js";
9
+ import "../chunk-C6PAIHLP.js";
10
10
  import "../chunk-WHB622LP.js";
11
- import "../chunk-OGB4QCB3.js";
12
- import "../chunk-5TCLBCUO.js";
13
- import "../chunk-BMR66K6T.js";
14
- import "../chunk-ALRANF2G.js";
15
- import "../chunk-JIH55UHZ.js";
16
- import "../chunk-6UGVZTRA.js";
17
- import "../chunk-6NRFAP45.js";
11
+ import "../chunk-MTITL2IG.js";
12
+ import "../chunk-K3I2NMEF.js";
13
+ import "../chunk-TPLTB256.js";
14
+ import "../chunk-QP3TCKRZ.js";
15
+ import "../chunk-IKC33YKC.js";
16
+ import "../chunk-FGVBFDNV.js";
17
+ import "../chunk-V36P4KS4.js";
18
18
  import "../chunk-YPY4YCIZ.js";
19
- import "../chunk-CHI57HS3.js";
19
+ import "../chunk-4I2SHNEU.js";
20
20
  import "../chunk-352FIVVH.js";
21
- import "../chunk-AKUYCHJU.js";
22
- import "../chunk-UJJ2OXFA.js";
23
- import "../chunk-ICHKAH5Q.js";
21
+ import "../chunk-APCJZFTJ.js";
22
+ import "../chunk-4WL2MINE.js";
23
+ import "../chunk-CS4Z44F5.js";
24
24
  import "../chunk-POFBE6ZY.js";
25
- import "../chunk-MOX7IOGL.js";
26
- import "../chunk-C4K4KYOY.js";
27
- import "../chunk-E2KAAKWU.js";
25
+ import "../chunk-TZJR5ESF.js";
26
+ import "../chunk-PBPQRJ2T.js";
27
+ import "../chunk-PND5IGC7.js";
28
28
  import "../chunk-H6CL3T2S.js";
29
- import "../chunk-QONYKXWP.js";
30
- import "../chunk-TWOSBIAW.js";
31
- import "../chunk-4RSJZOKB.js";
29
+ import "../chunk-ANQBLZAE.js";
30
+ import "../chunk-TSR3FPGL.js";
31
+ import "../chunk-MHYX5Q3F.js";
32
32
  import "../chunk-YU2EUD7O.js";
33
- import "../chunk-2LTRA6NA.js";
34
- import "../chunk-ELF4NIIM.js";
35
- import "../chunk-MH4O453X.js";
36
- import "../chunk-PMEDJ4WM.js";
37
- import "../chunk-ANL74IBU.js";
33
+ import "../chunk-ZYDE6QRW.js";
34
+ import "../chunk-UDLWNOXX.js";
35
+ import "../chunk-B3BOAYRO.js";
36
+ import "../chunk-IVOELLUK.js";
37
+ import "../chunk-FTTSQAF4.js";
38
38
  import "../chunk-BG4HHB7E.js";
39
39
  import "../chunk-TODDEIYG.js";
40
- import "../chunk-P5JV6YZW.js";
40
+ import "../chunk-AOP55JR2.js";
41
41
  import "../chunk-WIIMW5YO.js";
42
- import "../chunk-KB7YWU7A.js";
42
+ import "../chunk-HA2SRYYP.js";
43
43
  import "../chunk-MLKGABMK.js";
44
44
 
45
45
  // bin/pushary-bell-hook.ts
@@ -5,29 +5,29 @@ import {
5
5
  liveAgentCount,
6
6
  ring,
7
7
  upgradeThreshold
8
- } from "../chunk-WCVANKUD.js";
8
+ } from "../chunk-ORQ7THNZ.js";
9
9
  import {
10
10
  createIo
11
- } from "../chunk-UOVTXOSS.js";
11
+ } from "../chunk-GHHVXARK.js";
12
12
  import {
13
13
  exitOnHelpFlag
14
- } from "../chunk-MGT2V2AB.js";
14
+ } from "../chunk-T3PZQNIK.js";
15
15
  import {
16
16
  addBellHooks,
17
17
  bellInstalled,
18
18
  removeBellHooks
19
- } from "../chunk-6NRFAP45.js";
19
+ } from "../chunk-V36P4KS4.js";
20
20
  import {
21
21
  parseFlags
22
22
  } from "../chunk-YPY4YCIZ.js";
23
23
  import "../chunk-YU2EUD7O.js";
24
- import "../chunk-2LTRA6NA.js";
25
- import "../chunk-ELF4NIIM.js";
24
+ import "../chunk-ZYDE6QRW.js";
25
+ import "../chunk-UDLWNOXX.js";
26
26
  import {
27
27
  claudeSettings
28
- } from "../chunk-MH4O453X.js";
29
- import "../chunk-PMEDJ4WM.js";
30
- import "../chunk-ANL74IBU.js";
28
+ } from "../chunk-B3BOAYRO.js";
29
+ import "../chunk-IVOELLUK.js";
30
+ import "../chunk-FTTSQAF4.js";
31
31
  import {
32
32
  EXIT
33
33
  } from "../chunk-BG4HHB7E.js";
@@ -35,11 +35,11 @@ import {
35
35
  readJsonSafe,
36
36
  writeJsonAtomic
37
37
  } from "../chunk-TODDEIYG.js";
38
- import "../chunk-P5JV6YZW.js";
38
+ import "../chunk-AOP55JR2.js";
39
39
  import "../chunk-WIIMW5YO.js";
40
40
  import {
41
41
  isRecord
42
- } from "../chunk-KB7YWU7A.js";
42
+ } from "../chunk-HA2SRYYP.js";
43
43
  import "../chunk-MLKGABMK.js";
44
44
 
45
45
  // bin/pushary-bell.ts
@@ -6,30 +6,30 @@ import {
6
6
  import {
7
7
  CommandReceipts,
8
8
  controllerCommandSchema
9
- } from "../chunk-PKU3WFT5.js";
9
+ } from "../chunk-PI3BOI3A.js";
10
10
  import {
11
11
  SESSION_IDLE_TIMEOUT_MS,
12
12
  describeIdleWindow,
13
13
  startProcessOwnership,
14
14
  withSpawnProcessOwnership
15
- } from "../chunk-CV6G4IDZ.js";
15
+ } from "../chunk-EHRWEXRN.js";
16
16
  import "../chunk-CYTPQDQY.js";
17
17
  import {
18
18
  announceSubscriptionRequired,
19
19
  isDeferAnswer
20
- } from "../chunk-M2WLCRMX.js";
20
+ } from "../chunk-YPFOTFEG.js";
21
21
  import {
22
22
  claudeTranscriptPath,
23
23
  redactDraft,
24
24
  registerTranscript,
25
25
  registeredTranscriptEnabled,
26
26
  startDraftPublisher
27
- } from "../chunk-UGJ25K2F.js";
27
+ } from "../chunk-C6PAIHLP.js";
28
28
  import "../chunk-WHB622LP.js";
29
29
  import {
30
30
  ensureDaemonRunning
31
- } from "../chunk-5TCLBCUO.js";
32
- import "../chunk-BMR66K6T.js";
31
+ } from "../chunk-K3I2NMEF.js";
32
+ import "../chunk-TPLTB256.js";
33
33
  import {
34
34
  DEFAULT_SESSION,
35
35
  PHONE_DRIVER,
@@ -44,28 +44,28 @@ import {
44
44
  removePendingCommand,
45
45
  reportEvent,
46
46
  savePendingCommand
47
- } from "../chunk-ALRANF2G.js";
47
+ } from "../chunk-QP3TCKRZ.js";
48
48
  import {
49
49
  UNNAMED_ACTION,
50
50
  deriveToolTarget,
51
51
  describeStopFailure,
52
52
  describeToolCall,
53
53
  scopePathFor
54
- } from "../chunk-JIH55UHZ.js";
55
- import "../chunk-6UGVZTRA.js";
56
- import "../chunk-6NRFAP45.js";
54
+ } from "../chunk-IKC33YKC.js";
55
+ import "../chunk-FGVBFDNV.js";
56
+ import "../chunk-V36P4KS4.js";
57
57
  import "../chunk-YPY4YCIZ.js";
58
- import "../chunk-CHI57HS3.js";
58
+ import "../chunk-4I2SHNEU.js";
59
59
  import {
60
60
  external_exports
61
61
  } from "../chunk-352FIVVH.js";
62
62
  import {
63
63
  transcriptsEnabled
64
- } from "../chunk-AKUYCHJU.js";
64
+ } from "../chunk-APCJZFTJ.js";
65
65
  import {
66
66
  repoKeyFor,
67
67
  repositoryScopeFor
68
- } from "../chunk-UJJ2OXFA.js";
68
+ } from "../chunk-4WL2MINE.js";
69
69
  import {
70
70
  askUser,
71
71
  cancelQuestion,
@@ -79,13 +79,13 @@ import {
79
79
  waitRetryPauseMs,
80
80
  waitsForThePhone,
81
81
  withdrawQuestion
82
- } from "../chunk-ICHKAH5Q.js";
82
+ } from "../chunk-CS4Z44F5.js";
83
83
  import "../chunk-POFBE6ZY.js";
84
84
  import {
85
85
  SubscriptionRequiredError
86
- } from "../chunk-MOX7IOGL.js";
87
- import "../chunk-C4K4KYOY.js";
88
- import "../chunk-E2KAAKWU.js";
86
+ } from "../chunk-TZJR5ESF.js";
87
+ import "../chunk-PBPQRJ2T.js";
88
+ import "../chunk-PND5IGC7.js";
89
89
  import {
90
90
  needsShell,
91
91
  spawnClaude
@@ -95,27 +95,27 @@ import {
95
95
  commandAckIsFinal,
96
96
  readCommandAck,
97
97
  refusedReceiptMessage
98
- } from "../chunk-QONYKXWP.js";
99
- import "../chunk-TWOSBIAW.js";
98
+ } from "../chunk-ANQBLZAE.js";
99
+ import "../chunk-TSR3FPGL.js";
100
100
  import {
101
101
  getMachineId
102
- } from "../chunk-4RSJZOKB.js";
102
+ } from "../chunk-MHYX5Q3F.js";
103
103
  import "../chunk-YU2EUD7O.js";
104
- import "../chunk-2LTRA6NA.js";
105
- import "../chunk-ELF4NIIM.js";
104
+ import "../chunk-ZYDE6QRW.js";
105
+ import "../chunk-UDLWNOXX.js";
106
106
  import {
107
107
  claudeConfigDir
108
- } from "../chunk-MH4O453X.js";
109
- import "../chunk-PMEDJ4WM.js";
108
+ } from "../chunk-B3BOAYRO.js";
109
+ import "../chunk-IVOELLUK.js";
110
110
  import {
111
111
  getApiKey,
112
112
  getBaseUrl
113
- } from "../chunk-ANL74IBU.js";
113
+ } from "../chunk-FTTSQAF4.js";
114
114
  import "../chunk-BG4HHB7E.js";
115
115
  import "../chunk-TODDEIYG.js";
116
116
  import {
117
117
  NPX_LATEST_COMMAND
118
- } from "../chunk-P5JV6YZW.js";
118
+ } from "../chunk-AOP55JR2.js";
119
119
  import "../chunk-WIIMW5YO.js";
120
120
  import {
121
121
  DECISION_STOP_REASON,
@@ -129,7 +129,7 @@ import {
129
129
  refusesWhenUnanswered,
130
130
  resolveGate,
131
131
  timeoutActionWithoutLocalPrompt
132
- } from "../chunk-KB7YWU7A.js";
132
+ } from "../chunk-HA2SRYYP.js";
133
133
  import "../chunk-MLKGABMK.js";
134
134
 
135
135
  // src/wrapper/localPassthrough.ts