@codyswann/lisa 4.101.3 → 4.101.5

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 (110) hide show
  1. package/all/copy-overwrite/scripts/lib/usage-ledger-integrity.mjs +18 -1
  2. package/all/copy-overwrite/scripts/lib/usage-ledger.d.mts +1 -0
  3. package/all/copy-overwrite/scripts/lib/usage-ledger.mjs +2 -2
  4. package/all/copy-overwrite/scripts/npm-updater-helper-graph.json +2 -2
  5. package/dist/core/lisa-owned-hash-ledger.d.ts.map +1 -1
  6. package/dist/core/lisa-owned-hash-ledger.js +8 -0
  7. package/dist/core/lisa-owned-hash-ledger.js.map +1 -1
  8. package/dist/core/nightly-e2e-guard-behavior-certificate.js +2 -2
  9. package/dist/core/upstream-evidence-manifest.d.ts.map +1 -1
  10. package/dist/core/upstream-evidence-manifest.js +17 -8
  11. package/dist/core/upstream-evidence-manifest.js.map +1 -1
  12. package/dist/opencode/hooks-installer.d.ts.map +1 -1
  13. package/dist/opencode/hooks-installer.js +8 -0
  14. package/dist/opencode/hooks-installer.js.map +1 -1
  15. package/dist/opencode/plugin-catalog.d.ts.map +1 -1
  16. package/dist/opencode/plugin-catalog.js +5 -0
  17. package/dist/opencode/plugin-catalog.js.map +1 -1
  18. package/dist/opencode/plugin-templates/block-host-name-leak.mjs +511 -0
  19. package/dist/opencode/plugin-templates/block-host-name-leak.sh +69 -0
  20. package/dist/opencode/plugin-templates/host-name-command-context.mjs +455 -0
  21. package/dist/opencode/plugin-templates/lisa-block-host-name-leak.ts +62 -0
  22. package/dist/utils/usage-accounting.d.ts.map +1 -1
  23. package/dist/utils/usage-accounting.js +12 -2
  24. package/dist/utils/usage-accounting.js.map +1 -1
  25. package/package.json +4 -4
  26. package/plugins/lisa/.claude-plugin/plugin.json +1 -1
  27. package/plugins/lisa/.codex-plugin/plugin.json +1 -1
  28. package/plugins/lisa/hooks/block-host-name-leak.mjs +11 -5
  29. package/plugins/lisa/hooks/host-name-command-context.mjs +45 -2
  30. package/plugins/lisa-agy/hooks/block-host-name-leak.mjs +11 -5
  31. package/plugins/lisa-agy/hooks/host-name-command-context.mjs +45 -2
  32. package/plugins/lisa-agy/plugin.json +1 -1
  33. package/plugins/lisa-cdk/.claude-plugin/plugin.json +1 -1
  34. package/plugins/lisa-cdk/.codex-plugin/plugin.json +1 -1
  35. package/plugins/lisa-cdk-agy/plugin.json +1 -1
  36. package/plugins/lisa-cdk-copilot/.claude-plugin/plugin.json +1 -1
  37. package/plugins/lisa-cdk-cursor/.claude-plugin/plugin.json +1 -1
  38. package/plugins/lisa-cdk-devin/.claude-plugin/plugin.json +1 -1
  39. package/plugins/lisa-cdk-devin/.devin-plugin/plugin.json +1 -1
  40. package/plugins/lisa-copilot/.claude-plugin/plugin.json +1 -1
  41. package/plugins/lisa-copilot/hooks/block-host-name-leak.mjs +11 -5
  42. package/plugins/lisa-copilot/hooks/host-name-command-context.mjs +45 -2
  43. package/plugins/lisa-cursor/.claude-plugin/plugin.json +1 -1
  44. package/plugins/lisa-cursor/hooks/block-host-name-leak.mjs +11 -5
  45. package/plugins/lisa-cursor/hooks/host-name-command-context.mjs +45 -2
  46. package/plugins/lisa-devin/.claude-plugin/plugin.json +1 -1
  47. package/plugins/lisa-devin/.devin-plugin/plugin.json +1 -1
  48. package/plugins/lisa-devin/hooks/block-host-name-leak.mjs +11 -5
  49. package/plugins/lisa-devin/hooks/host-name-command-context.mjs +45 -2
  50. package/plugins/lisa-expo/.claude-plugin/plugin.json +1 -1
  51. package/plugins/lisa-expo/.codex-plugin/plugin.json +1 -1
  52. package/plugins/lisa-expo-agy/plugin.json +1 -1
  53. package/plugins/lisa-expo-copilot/.claude-plugin/plugin.json +1 -1
  54. package/plugins/lisa-expo-cursor/.claude-plugin/plugin.json +1 -1
  55. package/plugins/lisa-expo-devin/.claude-plugin/plugin.json +1 -1
  56. package/plugins/lisa-expo-devin/.devin-plugin/plugin.json +1 -1
  57. package/plugins/lisa-harper-fabric/.claude-plugin/plugin.json +1 -1
  58. package/plugins/lisa-harper-fabric/.codex-plugin/plugin.json +1 -1
  59. package/plugins/lisa-harper-fabric-agy/plugin.json +1 -1
  60. package/plugins/lisa-harper-fabric-copilot/.claude-plugin/plugin.json +1 -1
  61. package/plugins/lisa-harper-fabric-cursor/.claude-plugin/plugin.json +1 -1
  62. package/plugins/lisa-harper-fabric-devin/.claude-plugin/plugin.json +1 -1
  63. package/plugins/lisa-harper-fabric-devin/.devin-plugin/plugin.json +1 -1
  64. package/plugins/lisa-nestjs/.claude-plugin/plugin.json +1 -1
  65. package/plugins/lisa-nestjs/.codex-plugin/plugin.json +1 -1
  66. package/plugins/lisa-nestjs-agy/plugin.json +1 -1
  67. package/plugins/lisa-nestjs-copilot/.claude-plugin/plugin.json +1 -1
  68. package/plugins/lisa-nestjs-cursor/.claude-plugin/plugin.json +1 -1
  69. package/plugins/lisa-nestjs-devin/.claude-plugin/plugin.json +1 -1
  70. package/plugins/lisa-nestjs-devin/.devin-plugin/plugin.json +1 -1
  71. package/plugins/lisa-openclaw/.claude-plugin/plugin.json +1 -1
  72. package/plugins/lisa-openclaw/.codex-plugin/plugin.json +1 -1
  73. package/plugins/lisa-openclaw-agy/plugin.json +1 -1
  74. package/plugins/lisa-openclaw-copilot/.claude-plugin/plugin.json +1 -1
  75. package/plugins/lisa-openclaw-cursor/.claude-plugin/plugin.json +1 -1
  76. package/plugins/lisa-openclaw-devin/.claude-plugin/plugin.json +1 -1
  77. package/plugins/lisa-openclaw-devin/.devin-plugin/plugin.json +1 -1
  78. package/plugins/lisa-phaser/.claude-plugin/plugin.json +1 -1
  79. package/plugins/lisa-phaser/.codex-plugin/plugin.json +1 -1
  80. package/plugins/lisa-phaser-agy/plugin.json +1 -1
  81. package/plugins/lisa-phaser-copilot/.claude-plugin/plugin.json +1 -1
  82. package/plugins/lisa-phaser-cursor/.claude-plugin/plugin.json +1 -1
  83. package/plugins/lisa-phaser-devin/.claude-plugin/plugin.json +1 -1
  84. package/plugins/lisa-phaser-devin/.devin-plugin/plugin.json +1 -1
  85. package/plugins/lisa-rails/.claude-plugin/plugin.json +1 -1
  86. package/plugins/lisa-rails/.codex-plugin/plugin.json +1 -1
  87. package/plugins/lisa-rails-agy/plugin.json +1 -1
  88. package/plugins/lisa-rails-copilot/.claude-plugin/plugin.json +1 -1
  89. package/plugins/lisa-rails-cursor/.claude-plugin/plugin.json +1 -1
  90. package/plugins/lisa-rails-devin/.claude-plugin/plugin.json +1 -1
  91. package/plugins/lisa-rails-devin/.devin-plugin/plugin.json +1 -1
  92. package/plugins/lisa-typescript/.claude-plugin/plugin.json +1 -1
  93. package/plugins/lisa-typescript/.codex-plugin/plugin.json +1 -1
  94. package/plugins/lisa-typescript-agy/plugin.json +1 -1
  95. package/plugins/lisa-typescript-copilot/.claude-plugin/plugin.json +1 -1
  96. package/plugins/lisa-typescript-cursor/.claude-plugin/plugin.json +1 -1
  97. package/plugins/lisa-typescript-devin/.claude-plugin/plugin.json +1 -1
  98. package/plugins/lisa-typescript-devin/.devin-plugin/plugin.json +1 -1
  99. package/plugins/lisa-wiki/.claude-plugin/plugin.json +1 -1
  100. package/plugins/lisa-wiki/.codex-plugin/plugin.json +1 -1
  101. package/plugins/lisa-wiki-agy/plugin.json +1 -1
  102. package/plugins/lisa-wiki-copilot/.claude-plugin/plugin.json +1 -1
  103. package/plugins/lisa-wiki-cursor/.claude-plugin/plugin.json +1 -1
  104. package/plugins/lisa-wiki-devin/.claude-plugin/plugin.json +1 -1
  105. package/plugins/lisa-wiki-devin/.devin-plugin/plugin.json +1 -1
  106. package/plugins/src/base/hooks/block-host-name-leak.mjs +11 -5
  107. package/plugins/src/base/hooks/host-name-command-context.mjs +45 -2
  108. package/scripts/copy-opencode-plugin-templates.mjs +3 -0
  109. package/scripts/lib/host-name-launcher-cases.mjs +280 -0
  110. package/scripts/verify-host-name-target-scope.mjs +9 -0
@@ -0,0 +1,69 @@
1
+ #!/usr/bin/env bash
2
+ # This file is managed by Lisa and IS replaced on each `lisa` run.
3
+ # Do not edit directly — durable changes belong upstream in Lisa.
4
+
5
+ # PreToolUse hook for Bash: refuse an outbound tracker write that names a host
6
+ # project.
7
+ #
8
+ # The classification lives in block-host-name-leak.mjs beside this file, because
9
+ # the detector it must consult is compiled JavaScript (`dist/core/`) and calling
10
+ # it from Node is the only way to keep ONE denylist. A bash reimplementation of
11
+ # the matcher would be a second copy of the thing the guard exists to protect,
12
+ # and copies drift.
13
+ #
14
+ # This wrapper does three things and nothing else: probe its interpreters,
15
+ # unwrap the Claude hook envelope, and hand the command string to Node.
16
+ #
17
+ # FAILING OPEN, LOUDLY
18
+ #
19
+ # Claude Code treats exit 2 as a refusal and every OTHER non-zero exit as a
20
+ # non-blocking hook error — meaning the command runs. Under `set -euo pipefail`
21
+ # an absent jq exits 127, so an unguarded probe would permit exactly what this
22
+ # exists to stop. Degrading to "allow" is correct: a hook that cannot read its
23
+ # input cannot tell a tracker write from a directory listing, and failing closed
24
+ # would block every Bash call on a machine missing an interpreter. Announcing it
25
+ # is mandatory, because a guard that is silently absent reads exactly like a
26
+ # guard that is passing. Same reasoning as block-direct-issue-create.sh.
27
+ set -euo pipefail
28
+
29
+ input="$(cat)"
30
+
31
+ for required in jq node; do
32
+ if ! command -v "$required" >/dev/null 2>&1; then
33
+ printf 'block-host-name-leak: %s not found; host-identity enforcement is NOT active\n' \
34
+ "$required" >&2
35
+ exit 0
36
+ fi
37
+ done
38
+
39
+ tool_name="$(printf '%s' "$input" | jq -r '.tool_name // empty' 2>/dev/null || true)"
40
+ if [ "$tool_name" != "Bash" ]; then
41
+ exit 0
42
+ fi
43
+
44
+ command_str="$(printf '%s' "$input" | jq -r '.tool_input.command // empty' 2>/dev/null || true)"
45
+ if [ -z "$command_str" ]; then
46
+ exit 0
47
+ fi
48
+
49
+ project_dir="${CLAUDE_PROJECT_DIR:-}"
50
+ if [ -z "$project_dir" ]; then
51
+ project_dir="$PWD"
52
+ fi
53
+
54
+ hook_dir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
55
+ classifier="$hook_dir/block-host-name-leak.mjs"
56
+ if [ ! -r "$classifier" ]; then
57
+ printf 'block-host-name-leak: classifier missing at %s; host-identity enforcement is NOT active\n' \
58
+ "$classifier" >&2
59
+ exit 0
60
+ fi
61
+
62
+ if [ ! -r "$hook_dir/host-name-command-context.mjs" ]; then
63
+ printf 'block-host-name-leak: command-context helper missing; host-identity enforcement is NOT active\n' >&2
64
+ exit 0
65
+ fi
66
+
67
+ status=0
68
+ node "$classifier" "$command_str" "$project_dir" || status=$?
69
+ exit "$status"
@@ -0,0 +1,455 @@
1
+ // This file is managed by Lisa and IS replaced on each `lisa` run.
2
+ // Do not edit directly — durable changes belong upstream in Lisa.
3
+
4
+ /**
5
+ * Bounded command/target resolution; submitted scripts are never executed.
6
+ * One literal sh/bash -c script operand is parsed once. Dynamic scripts,
7
+ * deeper launchers, other interpreters and other launcher options are outside
8
+ * this recognition contract, not proof that an unrecognized command is safe.
9
+ */
10
+ import { execFileSync } from "node:child_process";
11
+ import { statSync } from "node:fs";
12
+ import path from "node:path";
13
+
14
+ const VALUE_FLAGS = new Set([
15
+ "--repo",
16
+ "-R",
17
+ "--body",
18
+ "-b",
19
+ "--title",
20
+ "-t",
21
+ "--message",
22
+ "-m",
23
+ "--body-file",
24
+ "--input",
25
+ "-f",
26
+ "-F",
27
+ "--field",
28
+ "--raw-field",
29
+ "-X",
30
+ "--method",
31
+ "-H",
32
+ "--header",
33
+ "--hostname",
34
+ "-q",
35
+ "--jq",
36
+ "--template",
37
+ "-p",
38
+ "--preview",
39
+ "--base",
40
+ "--head",
41
+ "--assignee",
42
+ "--label",
43
+ "--milestone",
44
+ "--project",
45
+ "--reviewer",
46
+ ]);
47
+ const FIELD_FLAGS = new Set(["-f", "-F", "--field", "--raw-field"]);
48
+ const METHODS = new Set(["POST", "PATCH", "PUT"]);
49
+ const SHORT_VALUES = /^(-[RbBtTmMfFXHqp])(.+)$/u;
50
+
51
+ /**
52
+ * Read literal words and command separators, retaining expansion uncertainty.
53
+ * @param {string} command Raw Bash command.
54
+ * @returns {object[]} Literal words and separators.
55
+ */
56
+ function words(command) {
57
+ const result = [];
58
+ let value = "",
59
+ quote = "",
60
+ literal = true,
61
+ started = false;
62
+ const flush = () => {
63
+ if (started) result.push({ value, literal });
64
+ value = "";
65
+ literal = true;
66
+ started = false;
67
+ };
68
+ for (let i = 0; i < command.length; i += 1) {
69
+ const char = command[i];
70
+ if (char === "\\" && quote !== "'") {
71
+ const next = command[++i];
72
+ if (next === undefined) literal = false;
73
+ else if (next !== "\n") {
74
+ if (quote === '"' && !/[$`"\\]/u.test(next)) value += "\\";
75
+ value += next;
76
+ }
77
+ if (next !== "\n") started = true;
78
+ } else if (quote !== "") {
79
+ if (char === quote) quote = "";
80
+ else {
81
+ value += char;
82
+ if (quote === '"' && /[$`]/u.test(char)) literal = false;
83
+ }
84
+ started = true;
85
+ } else if (char === '"' || char === "'") {
86
+ quote = char;
87
+ started = true;
88
+ } else if (/[;&|\n()<>]/u.test(char)) {
89
+ flush();
90
+ const operator =
91
+ char === command[i + 1] && /[&|]/u.test(char)
92
+ ? char + command[++i]
93
+ : char;
94
+ result.push({ operator });
95
+ } else if (/\s/u.test(char)) flush();
96
+ else {
97
+ value += char;
98
+ started = true;
99
+ if (/[$`*?[\]~]/u.test(char)) literal = false;
100
+ }
101
+ }
102
+ if (quote !== "") literal = false;
103
+ flush();
104
+ return result;
105
+ }
106
+
107
+ /**
108
+ * Split option values without treating body text as a second option/endpoint.
109
+ * @param {object[]} input Active gh arguments only.
110
+ * @returns {object} Parsed flags, positional words and normalized tokens.
111
+ */
112
+ function argumentsOf(input) {
113
+ const flags = new Map(),
114
+ fieldOccurrences = [],
115
+ positional = [],
116
+ tokens = [];
117
+ // Any expansion can add/replace routing arguments after shell word splitting.
118
+ // Never evaluate it or certify a target from the remaining literal words.
119
+ let certain = input.every(word => word.literal);
120
+ for (let i = 0; i < input.length; i += 1) {
121
+ const word = input[i];
122
+ if (word.value === "--") {
123
+ positional.push(...input.slice(i + 1));
124
+ tokens.push(...input.slice(i).map(item => item.value));
125
+ break;
126
+ }
127
+ const equals = word.value.indexOf("=");
128
+ const directFlag = equals > 0 ? word.value.slice(0, equals) : word.value;
129
+ const attached = VALUE_FLAGS.has(directFlag)
130
+ ? null
131
+ : SHORT_VALUES.exec(word.value);
132
+ const flag =
133
+ attached?.[1] ??
134
+ (equals > 0 && word.value.startsWith("-") ? directFlag : word.value);
135
+ tokens.push(flag);
136
+ if (VALUE_FLAGS.has(flag)) {
137
+ const value = attached
138
+ ? { ...word, value: attached[2] }
139
+ : equals > 0
140
+ ? { ...word, value: word.value.slice(equals + 1) }
141
+ : input[++i];
142
+ if (value === undefined) {
143
+ certain = false;
144
+ continue;
145
+ }
146
+ // Alias spellings share one Cobra option; the last occurrence wins.
147
+ flags.set(
148
+ flag === "-R" ? "--repo" : flag === "-X" ? "--method" : flag,
149
+ value
150
+ );
151
+ // API fields are additive even though routing options use last values.
152
+ if (FIELD_FLAGS.has(flag)) fieldOccurrences.push([flag, value]);
153
+ tokens.push(value.value);
154
+ } else if (!word.value.startsWith("-")) positional.push(word);
155
+ else if (!word.literal) certain = false;
156
+ }
157
+ const nounWord = positional[0],
158
+ verbWord = positional[1];
159
+ const noun = nounWord?.literal ? nounWord.value : undefined,
160
+ verb = verbWord?.value;
161
+ // Command-name expansions can supply several argv words. A following
162
+ // read-looking literal does not prove that the expanded command is a read.
163
+ const uncertainName =
164
+ nounWord?.literal === false ||
165
+ (["issue", "pr"].includes(noun) && verbWord?.literal === false);
166
+ const method = flags.get("--method");
167
+ const writes =
168
+ uncertainName ||
169
+ (noun === "api"
170
+ ? method
171
+ ? !method.literal || METHODS.has(method.value.toUpperCase())
172
+ : [...FIELD_FLAGS].some(flag => flags.has(flag)) ||
173
+ Boolean(flags.get("--input")?.value)
174
+ : ["issue", "pr"].includes(noun) &&
175
+ ["create", "comment", "edit"].includes(verb));
176
+ return {
177
+ flags,
178
+ fieldOccurrences,
179
+ positional,
180
+ tokens: ["gh", ...tokens],
181
+ noun,
182
+ writes,
183
+ certain,
184
+ };
185
+ }
186
+
187
+ /**
188
+ * Normalize only repository shapes gh/git actually accept; unresolved syntax is unknown.
189
+ * @param {string} spec Repository argument, URL or Git remote.
190
+ * @returns {string|undefined} Lowercased owner/repository, or unknown.
191
+ */
192
+ export function repositoryFromSpec(spec) {
193
+ if (typeof spec !== "string" || /[\s${}`*?#[\]]/u.test(spec))
194
+ return undefined;
195
+ const normalized = spec
196
+ .trim()
197
+ .replace(/\.git\/?$/u, "")
198
+ .replace(/\/$/u, "");
199
+ const matched =
200
+ /^(?:(?:https?:\/\/|ssh:\/\/git@)[^/]+\/|git@[^:]+:|[^/:]+\/)?([\w.-]+)\/([\w.-]+)$/u.exec(
201
+ normalized
202
+ );
203
+ return matched ? `${matched[1]}/${matched[2]}`.toLowerCase() : undefined;
204
+ }
205
+
206
+ /**
207
+ * Resolve literal cd and leading environment assignments across simple command lists.
208
+ * Pipelines, conditionals and other shell syntax never earn a target exemption.
209
+ * @param {string} command Raw Bash command.
210
+ * @param {string} initialCwd The actual hook process cwd, separate from detector root.
211
+ * @param {object} env The actual inherited environment.
212
+ * @returns {object[]} Active gh calls with their bounded command contexts.
213
+ */
214
+ export function ghCommands(command, initialCwd, env = process.env) {
215
+ return commandContexts(command, initialCwd, env, true, false);
216
+ }
217
+
218
+ /**
219
+ * Parse a command list, permitting at most one literal executable script slot.
220
+ * @param {string} command Command text, never evaluated.
221
+ * @param {string|undefined} initialCwd Inherited literal directory, if known.
222
+ * @param {object} env Inherited environment.
223
+ * @param {boolean} launcherAllowed Whether one launcher remains in scope.
224
+ * @param {boolean} initialUncertain Whether the parent context is unresolved.
225
+ * @returns {object[]} Active gh calls and their isolated command contexts.
226
+ */
227
+ function commandContexts(
228
+ command,
229
+ initialCwd,
230
+ env,
231
+ launcherAllowed,
232
+ initialUncertain
233
+ ) {
234
+ const calls = [];
235
+ const inherited = { ...env };
236
+ let cwd = initialCwd,
237
+ segment = [],
238
+ uncertain = initialUncertain;
239
+ const consume = () => {
240
+ if (segment.length === 0) return;
241
+ const local = { ...inherited };
242
+ let index = segment[0].value === "env" ? 1 : 0;
243
+ while (/^[A-Za-z_][A-Za-z_0-9]*=/u.test(segment[index]?.value ?? "")) {
244
+ const item = segment[index++],
245
+ split = item.value.indexOf("=");
246
+ local[item.value.slice(0, split)] = item.literal
247
+ ? item.value.slice(split + 1)
248
+ : undefined;
249
+ if (!item.literal) uncertain = true;
250
+ }
251
+ const executable = segment[index]?.value;
252
+ if (executable === "cd") {
253
+ const args = segment.slice(index + 1).filter(item => item.value !== "--");
254
+ const directory =
255
+ args.length === 1 && args[0].literal && !args[0].value.startsWith("-")
256
+ ? args[0].value
257
+ : undefined;
258
+ try {
259
+ const resolved =
260
+ directory === undefined ||
261
+ (!path.isAbsolute(directory) &&
262
+ !/^\.\.?(?:\/|$)/u.test(directory) &&
263
+ (uncertain || local.CDPATH))
264
+ ? undefined
265
+ : path.isAbsolute(directory)
266
+ ? directory
267
+ : cwd === undefined
268
+ ? undefined
269
+ : path.resolve(cwd, directory);
270
+ cwd =
271
+ resolved !== undefined && statSync(resolved).isDirectory()
272
+ ? resolved
273
+ : undefined;
274
+ } catch {
275
+ cwd = undefined;
276
+ }
277
+ } else if (executable === "export") {
278
+ for (const item of segment.slice(index + 1)) {
279
+ const split = item.value.indexOf("=");
280
+ if (split < 1 || !item.literal) {
281
+ uncertain = true;
282
+ continue;
283
+ }
284
+ inherited[item.value.slice(0, split)] = item.value.slice(split + 1);
285
+ }
286
+ } else if (executable !== undefined && path.basename(executable) === "gh") {
287
+ calls.push({
288
+ ...argumentsOf(segment.slice(index + 1)),
289
+ cwd,
290
+ env: local,
291
+ certainContext: !uncertain,
292
+ });
293
+ } else if (
294
+ launcherAllowed &&
295
+ segment[index]?.literal &&
296
+ ["sh", "bash"].includes(path.basename(executable ?? "")) &&
297
+ segment[index + 1]?.literal &&
298
+ segment[index + 1].value === "-c" &&
299
+ segment[index + 2]?.literal
300
+ ) {
301
+ // Only this operand is executable text. Later argv words are $0/$1/etc,
302
+ // not scripts. Child cd/export changes cannot mutate the outer shell.
303
+ calls.push(
304
+ ...commandContexts(
305
+ segment[index + 2].value,
306
+ cwd,
307
+ local,
308
+ false,
309
+ uncertain
310
+ )
311
+ );
312
+ } else {
313
+ // A function/source/pushd or unsupported launcher may change the shell
314
+ // context. Do not grant later writes an exemption based on the old cwd.
315
+ uncertain = true;
316
+ cwd = undefined;
317
+ const nested = segment.findIndex(item => item.value === "gh");
318
+ if (nested !== -1)
319
+ calls.push({
320
+ ...argumentsOf(segment.slice(nested + 1)),
321
+ cwd,
322
+ env: local,
323
+ certainContext: false,
324
+ });
325
+ }
326
+ segment = [];
327
+ };
328
+ for (const word of words(command)) {
329
+ if (word.operator === undefined) segment.push(word);
330
+ else {
331
+ consume();
332
+ if (!["&&", ";", "\n"].includes(word.operator)) {
333
+ uncertain = true;
334
+ cwd = undefined;
335
+ }
336
+ }
337
+ }
338
+ consume();
339
+ return calls;
340
+ }
341
+
342
+ /**
343
+ * Read gh's local selected default, falling back only to one unambiguous remote.
344
+ * All reads share a five-second ceiling and execute no shell or network query.
345
+ * @param {object} context One gh command context.
346
+ * @returns {string|undefined} Verified repository, or unknown.
347
+ */
348
+ function localRepository(context) {
349
+ if (!context.certainContext) return undefined;
350
+ if (context.env.GH_REPO) return repositoryFromSpec(context.env.GH_REPO);
351
+ if (context.cwd === undefined) return undefined;
352
+ const deadline = Date.now() + 5000;
353
+ const read = (command, args) => {
354
+ const remaining = deadline - Date.now();
355
+ if (remaining <= 0) throw new Error("Repository lookup deadline expired");
356
+ return execFileSync(command, args, {
357
+ cwd: context.cwd,
358
+ env: { ...context.env, GH_PROMPT_DISABLED: "1" },
359
+ timeout: remaining,
360
+ encoding: "utf8",
361
+ stdio: ["ignore", "pipe", "pipe"],
362
+ }).trim();
363
+ };
364
+ try {
365
+ const selected = read("gh", ["repo", "set-default", "--view"]);
366
+ if (selected !== "") return repositoryFromSpec(selected);
367
+ const remotes = read("git", ["remote"]).split("\n").filter(Boolean);
368
+ if (remotes.length !== 1) return undefined;
369
+ return repositoryFromSpec(read("git", ["remote", "get-url", remotes[0]]));
370
+ } catch {
371
+ // probe-direction: fail-closed — failed lookup grants no host exemption;
372
+ // the caller retains its inspection path for an undetermined target.
373
+ return undefined;
374
+ }
375
+ }
376
+
377
+ /**
378
+ * Resolve only active command arguments; prose cannot masquerade as routing.
379
+ * @param {object} context One parsed gh call.
380
+ * @returns {string|undefined} Verified owner/repository, or unknown.
381
+ */
382
+ export function commandRepository(context) {
383
+ if (!context.certain || !context.certainContext) return undefined;
384
+ if (context.noun !== "api") {
385
+ // gh 2.88.1 issue comment/edit and PR finder resolve a URL selector before
386
+ // BaseRepo (--repo/GH_REPO/local default). Body option values are not here.
387
+ const selectors = context.positional.slice(2);
388
+ const batch =
389
+ context.noun === "issue" && context.positional[1]?.value === "edit";
390
+ if (
391
+ (batch && selectors.length > 1) ||
392
+ (["comment", "edit"].includes(context.positional[1]?.value) &&
393
+ selectors.some(item => /^https?:\/\//u.test(item.value)))
394
+ ) {
395
+ if (!batch && selectors.length !== 1) return undefined;
396
+ let repository, identity;
397
+ for (const item of selectors) {
398
+ // ParseIssuesFromArgs lets numeric selectors inherit the common URL repo.
399
+ if (batch && /^#?[+-]?\d+$/u.test(item.value)) {
400
+ const number = BigInt(item.value.replace(/^#/u, ""));
401
+ if (BigInt.asIntN(64, number) !== number) return undefined;
402
+ continue;
403
+ }
404
+ const selected =
405
+ /^https?:\/\/[^/]+\/([\w.-]+)\/([\w.-]+)\/(issues|pull)\/\d+(?:[/?#].*)?$/u.exec(
406
+ item.value
407
+ );
408
+ if (!selected || (context.noun === "pr" && selected[3] !== "pull"))
409
+ return undefined;
410
+ try {
411
+ const host = new URL(item.value).hostname
412
+ .replace(/^www\./u, "")
413
+ .toLowerCase();
414
+ const repo = batch
415
+ ? `${selected[1]}/${selected[2]}`.toLowerCase()
416
+ : repositoryFromSpec(`${selected[1]}/${selected[2]}`);
417
+ const current = `${host}/${repo}`;
418
+ if (
419
+ !host ||
420
+ !repo ||
421
+ (identity !== undefined && identity !== current)
422
+ )
423
+ return undefined;
424
+ identity = current;
425
+ repository = repo;
426
+ } catch {
427
+ // probe-direction: fail-closed — invalid URL grants no host exemption;
428
+ // the caller retains its inspection path for an undetermined target.
429
+ return undefined;
430
+ }
431
+ }
432
+ if (repository !== undefined) return repository;
433
+ }
434
+ const explicit = context.flags.get("--repo") ?? context.flags.get("-R");
435
+ return explicit
436
+ ? explicit.literal
437
+ ? repositoryFromSpec(explicit.value)
438
+ : undefined
439
+ : localRepository(context);
440
+ }
441
+ const endpoint = context.positional[1];
442
+ if (!endpoint?.literal) return undefined;
443
+ let value = endpoint.value;
444
+ if (/\{(?:owner|repo)\}/u.test(value)) {
445
+ const repository = localRepository(context);
446
+ if (repository === undefined) return undefined;
447
+ const [owner, repo] = repository.split("/");
448
+ value = value.replaceAll("{owner}", owner).replaceAll("{repo}", repo);
449
+ }
450
+ const found =
451
+ /^(?:https?:\/\/[^/]+\/)?\/?repos\/([\w.-]+)\/([\w.-]+)(?:\/|$)/u.exec(
452
+ value
453
+ );
454
+ return found ? repositoryFromSpec(`${found[1]}/${found[2]}`) : undefined;
455
+ }
@@ -0,0 +1,62 @@
1
+ /**
2
+ * Lisa-managed OpenCode tool.execute.before adapter for the canonical host-name
3
+ * guard. Command text is sent as data to the Bash wrapper; it is never executed.
4
+ *
5
+ * The installed wrapper, classifier and context helper stay beside this module.
6
+ * Target resolution remains canonical: known host writes are allowed; Lisa and
7
+ * unknown-target writes retain inspection. Literal one-level sh/bash -c support
8
+ * and its dynamic/deeper/other-launcher limits are the same on every surface.
9
+ * Exit0 allows (including explicitly announced inactive enforcement), exit2
10
+ * refuses, and any other exit reports an environment failure. Inactive warnings
11
+ * must remain visible instead of turning a missing guard into a quiet pass.
12
+ *
13
+ * Copied verbatim into .opencode/plugin/ and run by OpenCode's Bun runtime.
14
+ */
15
+ export const LisaBlockHostNameLeak = async () => ({
16
+ "tool.execute.before": async (
17
+ input: { tool: string },
18
+ output: { args?: { command?: string; workdir?: string } }
19
+ ) => {
20
+ if (input.tool !== "bash") return;
21
+ const command = String(output.args?.command ?? "");
22
+ if (!command) return;
23
+
24
+ const hookPath = `${import.meta.dir}/block-host-name-leak.sh`;
25
+ const processHandle = Bun.spawn(["/bin/bash", hookPath], {
26
+ cwd: output.args?.workdir || process.cwd(),
27
+ env: { ...process.env, CLAUDE_PROJECT_DIR: process.cwd() },
28
+ stdin: "pipe",
29
+ stdout: "ignore",
30
+ stderr: "pipe",
31
+ // The canonical local repository probe retains its own five-second
32
+ // bound. This adapter separately bounds the entire guard and fails closed.
33
+ timeout: 10_000,
34
+ killSignal: "SIGKILL",
35
+ });
36
+ try {
37
+ await processHandle.stdin.write(
38
+ JSON.stringify({ tool_name: "Bash", tool_input: { command } })
39
+ );
40
+ await processHandle.stdin.end();
41
+ } catch {
42
+ // An early exit can close stdin; the real status below owns the verdict.
43
+ }
44
+ const [status, reason] = await Promise.all([
45
+ processHandle.exited,
46
+ new Response(processHandle.stderr).text(),
47
+ ]);
48
+ if (status === 0) {
49
+ if (reason.trim()) console.error(reason.trim());
50
+ return;
51
+ }
52
+ if (status !== 2) {
53
+ throw new Error(
54
+ `block-host-name-leak: guard environment failure (status ${status}) at ${hookPath}` +
55
+ (reason.trim() ? `: ${reason.trim()}` : "")
56
+ );
57
+ }
58
+ throw new Error(
59
+ reason.trim() || "block-host-name-leak: tracker write refused."
60
+ );
61
+ },
62
+ });
@@ -1 +1 @@
1
- {"version":3,"file":"usage-accounting.d.ts","sourceRoot":"","sources":["../../src/utils/usage-accounting.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,kBAAkB,EAClB,qBAAqB,EACtB,MAAM,uDAAuD,CAAC;AAC/D,OAAO,EAAE,+BAA+B,EAAE,MAAM,iEAAiE,CAAC;AAClH,OAAO,KAAK,EACV,cAAc,EACd,e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EAAE,CAAC;IACnD,OAAO,EAAE,SAAS,cAAc,EAAE,CAAC;IACnC,MAAM,CAAC,EAAE,eAAe,GAAG,IAAI,CAAC;CACjC,GACA,MAAM,CAoCR"}
@@ -90,6 +90,14 @@ function splitDocumentAroundRange(document, range) {
90
90
  const after = document.slice(range.end).trimStart();
91
91
  return { before, after };
92
92
  }
93
+ /**
94
+ * Preserve an existing suffix ending instead of adding one on every rewrite.
95
+ * @param text Unmanaged content following the accounting section.
96
+ * @returns The unchanged suffix, adding a final newline only when missing.
97
+ */
98
+ function withTrailingNewline(text) {
99
+ return text.endsWith("\n") ? text : `${text}\n`;
100
+ }
93
101
  /**
94
102
  * Render a token-count value for the human-readable table.
95
103
  *
@@ -353,12 +361,14 @@ export function upsertLisaUsageSection(document, input) {
353
361
  }).trimEnd();
354
362
  const { before, after } = splitDocumentAroundRange(document, parsed.range);
355
363
  if (!before) {
356
- return after ? `${usageSection}\n\n${after}\n` : `${usageSection}\n`;
364
+ return after
365
+ ? `${usageSection}\n\n${withTrailingNewline(after)}`
366
+ : `${usageSection}\n`;
357
367
  }
358
368
  if (!after) {
359
369
  return `${before}\n\n${usageSection}\n`;
360
370
  }
361
- return `${before}\n\n${usageSection}\n\n${after}\n`;
371
+ return `${before}\n\n${usageSection}\n\n${withTrailingNewline(after)}`;
362
372
  }
363
373
  /* eslint-enable max-lines -- End usage accounting public utility surface. */
364
374
  //# sourceMappingURL=usage-accounting.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"usage-accounting.js","sourceRoot":"","sources":["../../src/utils/usage-accounting.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,kBAAkB,EAClB,qBAAqB,GACtB,MAAM,uDAAuD,CAAC;AAC/D,OAAO,EAAE,+BAA+B,EAAE,MAAM,iEAAiE,CAAC;AASlH,OAAO,EACL,kBAAkB,EAClB,qBAAqB,EACrB,+BAA+B,GAChC,CAAC;AASF,uHAAuH;AAEvH,OAAO,EAAE,8BAA8B,EAAE,MAAM,8BAA8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