@wrongstack/tools 0.308.7 → 0.309.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/dist/audit.js CHANGED
@@ -138,12 +138,12 @@ function resolveWin32Command(cmd) {
138
138
  }
139
139
  return cmd;
140
140
  }
141
- var WIN32_SHELL_META = /[&|<>"\r\n\0]/;
141
+ var WIN32_SHELL_META = /[&|<>"%\r\n\0]/;
142
142
  function assertSafeWin32ShellArgs(args) {
143
143
  for (const arg of args) {
144
144
  if (typeof arg === "string" && WIN32_SHELL_META.test(arg)) {
145
145
  throw new Error(
146
- 'win32 cmd shim spawn: argument contains a shell metacharacter (one of & | < > ", or a newline) that could enable command injection through the .cmd/.bat wrapper - refusing to run. Offending argument: ' + JSON.stringify(arg)
146
+ 'win32 cmd shim spawn: argument contains a shell metacharacter (one of & | < > " %, or a newline) that could enable command injection through the .cmd/.bat wrapper - refusing to run. Offending argument: ' + JSON.stringify(arg)
147
147
  );
148
148
  }
149
149
  }
@@ -374,7 +374,7 @@ var SENSITIVE_FLAG_PATTERNS = [
374
374
  // redaction function. Synced with core copy.
375
375
  /(?<![-\w])-(?:password|p|a)(?:[=\s]+)?[^\s,-]+/gi,
376
376
  // env var–style secrets: TOKEN=x, API_KEY=y, etc.
377
- /(?:TOKEN|API_KEY|API_SECRET|AUTH_TOKEN|GITHUB_TOKEN|GH_TOKEN|BEARER|JWT|OAUTH|CREDENTIAL|SECRET|PRIVATE_KEY|PASSWORD|PASSWD)\s*[=:]\s*[^\s,]+/gi,
377
+ /(?:TOKEN|API_KEY|API_SECRET|AUTH_TOKEN|GITHUB_TOKEN|GH_TOKEN|BEARER|JWT|OAUTH|CREDENTIAL|SECRET|PRIVATE_KEY|PASSWORD|PASSWD|PASSPHRASE)\s*[=:]\s*[^\s,]+/gi,
378
378
  // Generic high-entropy look: base64 strings >32 chars or hex strings >32 digits — but only
379
379
  // when preceded by a flag name (e.g. --github-token=EyJ...). Global flag so
380
380
  // every such flag in the command line is redacted, not just the first.
package/dist/bash.js CHANGED
@@ -405,7 +405,7 @@ var SENSITIVE_FLAG_PATTERNS = [
405
405
  // redaction function. Synced with core copy.
406
406
  /(?<![-\w])-(?:password|p|a)(?:[=\s]+)?[^\s,-]+/gi,
407
407
  // env var–style secrets: TOKEN=x, API_KEY=y, etc.
408
- /(?:TOKEN|API_KEY|API_SECRET|AUTH_TOKEN|GITHUB_TOKEN|GH_TOKEN|BEARER|JWT|OAUTH|CREDENTIAL|SECRET|PRIVATE_KEY|PASSWORD|PASSWD)\s*[=:]\s*[^\s,]+/gi,
408
+ /(?:TOKEN|API_KEY|API_SECRET|AUTH_TOKEN|GITHUB_TOKEN|GH_TOKEN|BEARER|JWT|OAUTH|CREDENTIAL|SECRET|PRIVATE_KEY|PASSWORD|PASSWD|PASSPHRASE)\s*[=:]\s*[^\s,]+/gi,
409
409
  // Generic high-entropy look: base64 strings >32 chars or hex strings >32 digits — but only
410
410
  // when preceded by a flag name (e.g. --github-token=EyJ...). Global flag so
411
411
  // every such flag in the command line is redacted, not just the first.
package/dist/builtin.js CHANGED
@@ -169,7 +169,7 @@ function assertSafeWin32ShellArgs(args) {
169
169
  for (const arg of args) {
170
170
  if (typeof arg === "string" && WIN32_SHELL_META.test(arg)) {
171
171
  throw new Error(
172
- 'win32 cmd shim spawn: argument contains a shell metacharacter (one of & | < > ", or a newline) that could enable command injection through the .cmd/.bat wrapper - refusing to run. Offending argument: ' + JSON.stringify(arg)
172
+ 'win32 cmd shim spawn: argument contains a shell metacharacter (one of & | < > " %, or a newline) that could enable command injection through the .cmd/.bat wrapper - refusing to run. Offending argument: ' + JSON.stringify(arg)
173
173
  );
174
174
  }
175
175
  }
@@ -190,7 +190,7 @@ var WIN32_SHELL_META;
190
190
  var init_win32_resolve = __esm({
191
191
  "src/_win32-resolve.ts"() {
192
192
  "use strict";
193
- WIN32_SHELL_META = /[&|<>"\r\n\0]/;
193
+ WIN32_SHELL_META = /[&|<>"%\r\n\0]/;
194
194
  }
195
195
  });
196
196
 
@@ -432,7 +432,7 @@ var init_redact_command = __esm({
432
432
  // redaction function. Synced with core copy.
433
433
  /(?<![-\w])-(?:password|p|a)(?:[=\s]+)?[^\s,-]+/gi,
434
434
  // env var–style secrets: TOKEN=x, API_KEY=y, etc.
435
- /(?:TOKEN|API_KEY|API_SECRET|AUTH_TOKEN|GITHUB_TOKEN|GH_TOKEN|BEARER|JWT|OAUTH|CREDENTIAL|SECRET|PRIVATE_KEY|PASSWORD|PASSWD)\s*[=:]\s*[^\s,]+/gi,
435
+ /(?:TOKEN|API_KEY|API_SECRET|AUTH_TOKEN|GITHUB_TOKEN|GH_TOKEN|BEARER|JWT|OAUTH|CREDENTIAL|SECRET|PRIVATE_KEY|PASSWORD|PASSWD|PASSPHRASE)\s*[=:]\s*[^\s,]+/gi,
436
436
  // Generic high-entropy look: base64 strings >32 chars or hex strings >32 digits — but only
437
437
  // when preceded by a flag name (e.g. --github-token=EyJ...). Global flag so
438
438
  // every such flag in the command line is redacted, not just the first.
@@ -23233,6 +23233,12 @@ var gitTool = {
23233
23233
  // The git subcommand (status/commit/push) is what a trust rule needs to
23234
23234
  // distinguish; `git status` and `git push --force` must not share a subject.
23235
23235
  subjectKey: "command",
23236
+ // `command` is an enum subcommand, so on its own it rendered the subject
23237
+ // `"push"` — and one "always allow" then covered every push, to any branch,
23238
+ // with or without `--force`. These are the fields that change what the call
23239
+ // actually does, so the stored trust rule is as specific as the invocation
23240
+ // the user approved.
23241
+ subjectFields: ["branch", "force", "worktreeAction", "worktreePath", "newBranch"],
23236
23242
  mutating: true,
23237
23243
  capabilities: ["fs.write", "shell.restricted"],
23238
23244
  timeoutMs: TIMEOUT_MS2,
@@ -25425,13 +25431,7 @@ function broadcastTodoUpdate(context, todos) {
25425
25431
  to: `@session:${sessionId}`,
25426
25432
  type: "status",
25427
25433
  subject: `Kanban todo list updated (${todos.length} item${todos.length === 1 ? "" : "s"})`,
25428
- body: JSON.stringify({
25429
- kind: "kanban.todos.updated",
25430
- sessionId,
25431
- revision: context.state.revision,
25432
- todoCount: todos.length,
25433
- statusCounts
25434
- }),
25434
+ body: `Shared Kanban board synced this session's todo list: ${todos.length} item${todos.length === 1 ? "" : "s"} \u2014 ${statusCounts.completed} completed, ${statusCounts.inProgress} in progress, ${statusCounts.pending} pending.`,
25435
25435
  priority: "normal",
25436
25436
  senderSessionId: sessionId
25437
25437
  }).catch(() => {
@@ -435,7 +435,7 @@ function assertSafeWin32ShellArgs(args) {
435
435
  for (const arg of args) {
436
436
  if (typeof arg === "string" && WIN32_SHELL_META.test(arg)) {
437
437
  throw new Error(
438
- 'win32 cmd shim spawn: argument contains a shell metacharacter (one of & | < > ", or a newline) that could enable command injection through the .cmd/.bat wrapper - refusing to run. Offending argument: ' + JSON.stringify(arg)
438
+ 'win32 cmd shim spawn: argument contains a shell metacharacter (one of & | < > " %, or a newline) that could enable command injection through the .cmd/.bat wrapper - refusing to run. Offending argument: ' + JSON.stringify(arg)
439
439
  );
440
440
  }
441
441
  }
@@ -456,7 +456,7 @@ var WIN32_SHELL_META;
456
456
  var init_win32_resolve = __esm({
457
457
  "src/_win32-resolve.ts"() {
458
458
  "use strict";
459
- WIN32_SHELL_META = /[&|<>"\r\n\0]/;
459
+ WIN32_SHELL_META = /[&|<>"%\r\n\0]/;
460
460
  }
461
461
  });
462
462
 
@@ -10993,7 +10993,7 @@ var SENSITIVE_FLAG_PATTERNS = [
10993
10993
  // redaction function. Synced with core copy.
10994
10994
  /(?<![-\w])-(?:password|p|a)(?:[=\s]+)?[^\s,-]+/gi,
10995
10995
  // env var–style secrets: TOKEN=x, API_KEY=y, etc.
10996
- /(?:TOKEN|API_KEY|API_SECRET|AUTH_TOKEN|GITHUB_TOKEN|GH_TOKEN|BEARER|JWT|OAUTH|CREDENTIAL|SECRET|PRIVATE_KEY|PASSWORD|PASSWD)\s*[=:]\s*[^\s,]+/gi,
10996
+ /(?:TOKEN|API_KEY|API_SECRET|AUTH_TOKEN|GITHUB_TOKEN|GH_TOKEN|BEARER|JWT|OAUTH|CREDENTIAL|SECRET|PRIVATE_KEY|PASSWORD|PASSWD|PASSPHRASE)\s*[=:]\s*[^\s,]+/gi,
10997
10997
  // Generic high-entropy look: base64 strings >32 chars or hex strings >32 digits — but only
10998
10998
  // when preceded by a flag name (e.g. --github-token=EyJ...). Global flag so
10999
10999
  // every such flag in the command line is redacted, not just the first.
package/dist/exec.js CHANGED
@@ -652,12 +652,12 @@ function resolveWin32Command(cmd) {
652
652
  }
653
653
  return cmd;
654
654
  }
655
- var WIN32_SHELL_META = /[&|<>"\r\n\0]/;
655
+ var WIN32_SHELL_META = /[&|<>"%\r\n\0]/;
656
656
  function assertSafeWin32ShellArgs(args) {
657
657
  for (const arg of args) {
658
658
  if (typeof arg === "string" && WIN32_SHELL_META.test(arg)) {
659
659
  throw new Error(
660
- 'win32 cmd shim spawn: argument contains a shell metacharacter (one of & | < > ", or a newline) that could enable command injection through the .cmd/.bat wrapper - refusing to run. Offending argument: ' + JSON.stringify(arg)
660
+ 'win32 cmd shim spawn: argument contains a shell metacharacter (one of & | < > " %, or a newline) that could enable command injection through the .cmd/.bat wrapper - refusing to run. Offending argument: ' + JSON.stringify(arg)
661
661
  );
662
662
  }
663
663
  }
@@ -898,7 +898,7 @@ var SENSITIVE_FLAG_PATTERNS = [
898
898
  // redaction function. Synced with core copy.
899
899
  /(?<![-\w])-(?:password|p|a)(?:[=\s]+)?[^\s,-]+/gi,
900
900
  // env var–style secrets: TOKEN=x, API_KEY=y, etc.
901
- /(?:TOKEN|API_KEY|API_SECRET|AUTH_TOKEN|GITHUB_TOKEN|GH_TOKEN|BEARER|JWT|OAUTH|CREDENTIAL|SECRET|PRIVATE_KEY|PASSWORD|PASSWD)\s*[=:]\s*[^\s,]+/gi,
901
+ /(?:TOKEN|API_KEY|API_SECRET|AUTH_TOKEN|GITHUB_TOKEN|GH_TOKEN|BEARER|JWT|OAUTH|CREDENTIAL|SECRET|PRIVATE_KEY|PASSWORD|PASSWD|PASSPHRASE)\s*[=:]\s*[^\s,]+/gi,
902
902
  // Generic high-entropy look: base64 strings >32 chars or hex strings >32 digits — but only
903
903
  // when preceded by a flag name (e.g. --github-token=EyJ...). Global flag so
904
904
  // every such flag in the command line is redacted, not just the first.
package/dist/format.js CHANGED
@@ -138,12 +138,12 @@ function resolveWin32Command(cmd) {
138
138
  }
139
139
  return cmd;
140
140
  }
141
- var WIN32_SHELL_META = /[&|<>"\r\n\0]/;
141
+ var WIN32_SHELL_META = /[&|<>"%\r\n\0]/;
142
142
  function assertSafeWin32ShellArgs(args) {
143
143
  for (const arg of args) {
144
144
  if (typeof arg === "string" && WIN32_SHELL_META.test(arg)) {
145
145
  throw new Error(
146
- 'win32 cmd shim spawn: argument contains a shell metacharacter (one of & | < > ", or a newline) that could enable command injection through the .cmd/.bat wrapper - refusing to run. Offending argument: ' + JSON.stringify(arg)
146
+ 'win32 cmd shim spawn: argument contains a shell metacharacter (one of & | < > " %, or a newline) that could enable command injection through the .cmd/.bat wrapper - refusing to run. Offending argument: ' + JSON.stringify(arg)
147
147
  );
148
148
  }
149
149
  }
@@ -374,7 +374,7 @@ var SENSITIVE_FLAG_PATTERNS = [
374
374
  // redaction function. Synced with core copy.
375
375
  /(?<![-\w])-(?:password|p|a)(?:[=\s]+)?[^\s,-]+/gi,
376
376
  // env var–style secrets: TOKEN=x, API_KEY=y, etc.
377
- /(?:TOKEN|API_KEY|API_SECRET|AUTH_TOKEN|GITHUB_TOKEN|GH_TOKEN|BEARER|JWT|OAUTH|CREDENTIAL|SECRET|PRIVATE_KEY|PASSWORD|PASSWD)\s*[=:]\s*[^\s,]+/gi,
377
+ /(?:TOKEN|API_KEY|API_SECRET|AUTH_TOKEN|GITHUB_TOKEN|GH_TOKEN|BEARER|JWT|OAUTH|CREDENTIAL|SECRET|PRIVATE_KEY|PASSWORD|PASSWD|PASSPHRASE)\s*[=:]\s*[^\s,]+/gi,
378
378
  // Generic high-entropy look: base64 strings >32 chars or hex strings >32 digits — but only
379
379
  // when preceded by a flag name (e.g. --github-token=EyJ...). Global flag so
380
380
  // every such flag in the command line is redacted, not just the first.
package/dist/git.js CHANGED
@@ -95,6 +95,12 @@ var gitTool = {
95
95
  // The git subcommand (status/commit/push) is what a trust rule needs to
96
96
  // distinguish; `git status` and `git push --force` must not share a subject.
97
97
  subjectKey: "command",
98
+ // `command` is an enum subcommand, so on its own it rendered the subject
99
+ // `"push"` — and one "always allow" then covered every push, to any branch,
100
+ // with or without `--force`. These are the fields that change what the call
101
+ // actually does, so the stored trust rule is as specific as the invocation
102
+ // the user approved.
103
+ subjectFields: ["branch", "force", "worktreeAction", "worktreePath", "newBranch"],
98
104
  mutating: true,
99
105
  capabilities: ["fs.write", "shell.restricted"],
100
106
  timeoutMs: TIMEOUT_MS,
package/dist/index.js CHANGED
@@ -55,7 +55,7 @@ function assertSafeWin32ShellArgs(args) {
55
55
  for (const arg of args) {
56
56
  if (typeof arg === "string" && WIN32_SHELL_META.test(arg)) {
57
57
  throw new Error(
58
- 'win32 cmd shim spawn: argument contains a shell metacharacter (one of & | < > ", or a newline) that could enable command injection through the .cmd/.bat wrapper - refusing to run. Offending argument: ' + JSON.stringify(arg)
58
+ 'win32 cmd shim spawn: argument contains a shell metacharacter (one of & | < > " %, or a newline) that could enable command injection through the .cmd/.bat wrapper - refusing to run. Offending argument: ' + JSON.stringify(arg)
59
59
  );
60
60
  }
61
61
  }
@@ -76,7 +76,7 @@ var WIN32_SHELL_META;
76
76
  var init_win32_resolve = __esm({
77
77
  "src/_win32-resolve.ts"() {
78
78
  "use strict";
79
- WIN32_SHELL_META = /[&|<>"\r\n\0]/;
79
+ WIN32_SHELL_META = /[&|<>"%\r\n\0]/;
80
80
  }
81
81
  });
82
82
 
@@ -432,7 +432,7 @@ var init_redact_command = __esm({
432
432
  // redaction function. Synced with core copy.
433
433
  /(?<![-\w])-(?:password|p|a)(?:[=\s]+)?[^\s,-]+/gi,
434
434
  // env var–style secrets: TOKEN=x, API_KEY=y, etc.
435
- /(?:TOKEN|API_KEY|API_SECRET|AUTH_TOKEN|GITHUB_TOKEN|GH_TOKEN|BEARER|JWT|OAUTH|CREDENTIAL|SECRET|PRIVATE_KEY|PASSWORD|PASSWD)\s*[=:]\s*[^\s,]+/gi,
435
+ /(?:TOKEN|API_KEY|API_SECRET|AUTH_TOKEN|GITHUB_TOKEN|GH_TOKEN|BEARER|JWT|OAUTH|CREDENTIAL|SECRET|PRIVATE_KEY|PASSWORD|PASSWD|PASSPHRASE)\s*[=:]\s*[^\s,]+/gi,
436
436
  // Generic high-entropy look: base64 strings >32 chars or hex strings >32 digits — but only
437
437
  // when preceded by a flag name (e.g. --github-token=EyJ...). Global flag so
438
438
  // every such flag in the command line is redacted, not just the first.
@@ -23400,6 +23400,12 @@ var gitTool = {
23400
23400
  // The git subcommand (status/commit/push) is what a trust rule needs to
23401
23401
  // distinguish; `git status` and `git push --force` must not share a subject.
23402
23402
  subjectKey: "command",
23403
+ // `command` is an enum subcommand, so on its own it rendered the subject
23404
+ // `"push"` — and one "always allow" then covered every push, to any branch,
23405
+ // with or without `--force`. These are the fields that change what the call
23406
+ // actually does, so the stored trust rule is as specific as the invocation
23407
+ // the user approved.
23408
+ subjectFields: ["branch", "force", "worktreeAction", "worktreePath", "newBranch"],
23403
23409
  mutating: true,
23404
23410
  capabilities: ["fs.write", "shell.restricted"],
23405
23411
  timeoutMs: TIMEOUT_MS2,
@@ -25594,13 +25600,7 @@ function broadcastTodoUpdate(context, todos) {
25594
25600
  to: `@session:${sessionId}`,
25595
25601
  type: "status",
25596
25602
  subject: `Kanban todo list updated (${todos.length} item${todos.length === 1 ? "" : "s"})`,
25597
- body: JSON.stringify({
25598
- kind: "kanban.todos.updated",
25599
- sessionId,
25600
- revision: context.state.revision,
25601
- todoCount: todos.length,
25602
- statusCounts
25603
- }),
25603
+ body: `Shared Kanban board synced this session's todo list: ${todos.length} item${todos.length === 1 ? "" : "s"} \u2014 ${statusCounts.completed} completed, ${statusCounts.inProgress} in progress, ${statusCounts.pending} pending.`,
25604
25604
  priority: "normal",
25605
25605
  senderSessionId: sessionId
25606
25606
  }).catch(() => {
package/dist/install.js CHANGED
@@ -145,12 +145,12 @@ function resolveWin32Command(cmd) {
145
145
  }
146
146
  return cmd;
147
147
  }
148
- var WIN32_SHELL_META = /[&|<>"\r\n\0]/;
148
+ var WIN32_SHELL_META = /[&|<>"%\r\n\0]/;
149
149
  function assertSafeWin32ShellArgs(args) {
150
150
  for (const arg of args) {
151
151
  if (typeof arg === "string" && WIN32_SHELL_META.test(arg)) {
152
152
  throw new Error(
153
- 'win32 cmd shim spawn: argument contains a shell metacharacter (one of & | < > ", or a newline) that could enable command injection through the .cmd/.bat wrapper - refusing to run. Offending argument: ' + JSON.stringify(arg)
153
+ 'win32 cmd shim spawn: argument contains a shell metacharacter (one of & | < > " %, or a newline) that could enable command injection through the .cmd/.bat wrapper - refusing to run. Offending argument: ' + JSON.stringify(arg)
154
154
  );
155
155
  }
156
156
  }
@@ -381,7 +381,7 @@ var SENSITIVE_FLAG_PATTERNS = [
381
381
  // redaction function. Synced with core copy.
382
382
  /(?<![-\w])-(?:password|p|a)(?:[=\s]+)?[^\s,-]+/gi,
383
383
  // env var–style secrets: TOKEN=x, API_KEY=y, etc.
384
- /(?:TOKEN|API_KEY|API_SECRET|AUTH_TOKEN|GITHUB_TOKEN|GH_TOKEN|BEARER|JWT|OAUTH|CREDENTIAL|SECRET|PRIVATE_KEY|PASSWORD|PASSWD)\s*[=:]\s*[^\s,]+/gi,
384
+ /(?:TOKEN|API_KEY|API_SECRET|AUTH_TOKEN|GITHUB_TOKEN|GH_TOKEN|BEARER|JWT|OAUTH|CREDENTIAL|SECRET|PRIVATE_KEY|PASSWORD|PASSWD|PASSPHRASE)\s*[=:]\s*[^\s,]+/gi,
385
385
  // Generic high-entropy look: base64 strings >32 chars or hex strings >32 digits — but only
386
386
  // when preceded by a flag name (e.g. --github-token=EyJ...). Global flag so
387
387
  // every such flag in the command line is redacted, not just the first.
@@ -2266,12 +2266,12 @@ function resolveWin32Command(cmd) {
2266
2266
  }
2267
2267
  return cmd;
2268
2268
  }
2269
- var WIN32_SHELL_META = /[&|<>"\r\n\0]/;
2269
+ var WIN32_SHELL_META = /[&|<>"%\r\n\0]/;
2270
2270
  function assertSafeWin32ShellArgs(args) {
2271
2271
  for (const arg of args) {
2272
2272
  if (typeof arg === "string" && WIN32_SHELL_META.test(arg)) {
2273
2273
  throw new Error(
2274
- 'win32 cmd shim spawn: argument contains a shell metacharacter (one of & | < > ", or a newline) that could enable command injection through the .cmd/.bat wrapper - refusing to run. Offending argument: ' + JSON.stringify(arg)
2274
+ 'win32 cmd shim spawn: argument contains a shell metacharacter (one of & | < > " %, or a newline) that could enable command injection through the .cmd/.bat wrapper - refusing to run. Offending argument: ' + JSON.stringify(arg)
2275
2275
  );
2276
2276
  }
2277
2277
  }
@@ -2502,7 +2502,7 @@ var SENSITIVE_FLAG_PATTERNS = [
2502
2502
  // redaction function. Synced with core copy.
2503
2503
  /(?<![-\w])-(?:password|p|a)(?:[=\s]+)?[^\s,-]+/gi,
2504
2504
  // env var–style secrets: TOKEN=x, API_KEY=y, etc.
2505
- /(?:TOKEN|API_KEY|API_SECRET|AUTH_TOKEN|GITHUB_TOKEN|GH_TOKEN|BEARER|JWT|OAUTH|CREDENTIAL|SECRET|PRIVATE_KEY|PASSWORD|PASSWD)\s*[=:]\s*[^\s,]+/gi,
2505
+ /(?:TOKEN|API_KEY|API_SECRET|AUTH_TOKEN|GITHUB_TOKEN|GH_TOKEN|BEARER|JWT|OAUTH|CREDENTIAL|SECRET|PRIVATE_KEY|PASSWORD|PASSWD|PASSPHRASE)\s*[=:]\s*[^\s,]+/gi,
2506
2506
  // Generic high-entropy look: base64 strings >32 chars or hex strings >32 digits — but only
2507
2507
  // when preceded by a flag name (e.g. --github-token=EyJ...). Global flag so
2508
2508
  // every such flag in the command line is redacted, not just the first.
package/dist/lint.js CHANGED
@@ -138,12 +138,12 @@ function resolveWin32Command(cmd) {
138
138
  }
139
139
  return cmd;
140
140
  }
141
- var WIN32_SHELL_META = /[&|<>"\r\n\0]/;
141
+ var WIN32_SHELL_META = /[&|<>"%\r\n\0]/;
142
142
  function assertSafeWin32ShellArgs(args) {
143
143
  for (const arg of args) {
144
144
  if (typeof arg === "string" && WIN32_SHELL_META.test(arg)) {
145
145
  throw new Error(
146
- 'win32 cmd shim spawn: argument contains a shell metacharacter (one of & | < > ", or a newline) that could enable command injection through the .cmd/.bat wrapper - refusing to run. Offending argument: ' + JSON.stringify(arg)
146
+ 'win32 cmd shim spawn: argument contains a shell metacharacter (one of & | < > " %, or a newline) that could enable command injection through the .cmd/.bat wrapper - refusing to run. Offending argument: ' + JSON.stringify(arg)
147
147
  );
148
148
  }
149
149
  }
@@ -374,7 +374,7 @@ var SENSITIVE_FLAG_PATTERNS = [
374
374
  // redaction function. Synced with core copy.
375
375
  /(?<![-\w])-(?:password|p|a)(?:[=\s]+)?[^\s,-]+/gi,
376
376
  // env var–style secrets: TOKEN=x, API_KEY=y, etc.
377
- /(?:TOKEN|API_KEY|API_SECRET|AUTH_TOKEN|GITHUB_TOKEN|GH_TOKEN|BEARER|JWT|OAUTH|CREDENTIAL|SECRET|PRIVATE_KEY|PASSWORD|PASSWD)\s*[=:]\s*[^\s,]+/gi,
377
+ /(?:TOKEN|API_KEY|API_SECRET|AUTH_TOKEN|GITHUB_TOKEN|GH_TOKEN|BEARER|JWT|OAUTH|CREDENTIAL|SECRET|PRIVATE_KEY|PASSWORD|PASSWD|PASSPHRASE)\s*[=:]\s*[^\s,]+/gi,
378
378
  // Generic high-entropy look: base64 strings >32 chars or hex strings >32 digits — but only
379
379
  // when preceded by a flag name (e.g. --github-token=EyJ...). Global flag so
380
380
  // every such flag in the command line is redacted, not just the first.
package/dist/outdated.js CHANGED
@@ -219,7 +219,7 @@ function assertSafeWin32ShellArgs(args) {
219
219
  for (const arg of args) {
220
220
  if (typeof arg === "string" && WIN32_SHELL_META.test(arg)) {
221
221
  throw new Error(
222
- 'win32 cmd shim spawn: argument contains a shell metacharacter (one of & | < > ", or a newline) that could enable command injection through the .cmd/.bat wrapper - refusing to run. Offending argument: ' + JSON.stringify(arg)
222
+ 'win32 cmd shim spawn: argument contains a shell metacharacter (one of & | < > " %, or a newline) that could enable command injection through the .cmd/.bat wrapper - refusing to run. Offending argument: ' + JSON.stringify(arg)
223
223
  );
224
224
  }
225
225
  }
@@ -240,7 +240,7 @@ var WIN32_SHELL_META;
240
240
  var init_win32_resolve = __esm({
241
241
  "src/_win32-resolve.ts"() {
242
242
  "use strict";
243
- WIN32_SHELL_META = /[&|<>"\r\n\0]/;
243
+ WIN32_SHELL_META = /[&|<>"%\r\n\0]/;
244
244
  }
245
245
  });
246
246
 
@@ -2759,7 +2759,7 @@ var init_redact_command = __esm({
2759
2759
  // redaction function. Synced with core copy.
2760
2760
  /(?<![-\w])-(?:password|p|a)(?:[=\s]+)?[^\s,-]+/gi,
2761
2761
  // env var–style secrets: TOKEN=x, API_KEY=y, etc.
2762
- /(?:TOKEN|API_KEY|API_SECRET|AUTH_TOKEN|GITHUB_TOKEN|GH_TOKEN|BEARER|JWT|OAUTH|CREDENTIAL|SECRET|PRIVATE_KEY|PASSWORD|PASSWD)\s*[=:]\s*[^\s,]+/gi,
2762
+ /(?:TOKEN|API_KEY|API_SECRET|AUTH_TOKEN|GITHUB_TOKEN|GH_TOKEN|BEARER|JWT|OAUTH|CREDENTIAL|SECRET|PRIVATE_KEY|PASSWORD|PASSWD|PASSPHRASE)\s*[=:]\s*[^\s,]+/gi,
2763
2763
  // Generic high-entropy look: base64 strings >32 chars or hex strings >32 digits — but only
2764
2764
  // when preceded by a flag name (e.g. --github-token=EyJ...). Global flag so
2765
2765
  // every such flag in the command line is redacted, not just the first.
package/dist/pack.js CHANGED
@@ -169,7 +169,7 @@ function assertSafeWin32ShellArgs(args) {
169
169
  for (const arg of args) {
170
170
  if (typeof arg === "string" && WIN32_SHELL_META.test(arg)) {
171
171
  throw new Error(
172
- 'win32 cmd shim spawn: argument contains a shell metacharacter (one of & | < > ", or a newline) that could enable command injection through the .cmd/.bat wrapper - refusing to run. Offending argument: ' + JSON.stringify(arg)
172
+ 'win32 cmd shim spawn: argument contains a shell metacharacter (one of & | < > " %, or a newline) that could enable command injection through the .cmd/.bat wrapper - refusing to run. Offending argument: ' + JSON.stringify(arg)
173
173
  );
174
174
  }
175
175
  }
@@ -190,7 +190,7 @@ var WIN32_SHELL_META;
190
190
  var init_win32_resolve = __esm({
191
191
  "src/_win32-resolve.ts"() {
192
192
  "use strict";
193
- WIN32_SHELL_META = /[&|<>"\r\n\0]/;
193
+ WIN32_SHELL_META = /[&|<>"%\r\n\0]/;
194
194
  }
195
195
  });
196
196
 
@@ -432,7 +432,7 @@ var init_redact_command = __esm({
432
432
  // redaction function. Synced with core copy.
433
433
  /(?<![-\w])-(?:password|p|a)(?:[=\s]+)?[^\s,-]+/gi,
434
434
  // env var–style secrets: TOKEN=x, API_KEY=y, etc.
435
- /(?:TOKEN|API_KEY|API_SECRET|AUTH_TOKEN|GITHUB_TOKEN|GH_TOKEN|BEARER|JWT|OAUTH|CREDENTIAL|SECRET|PRIVATE_KEY|PASSWORD|PASSWD)\s*[=:]\s*[^\s,]+/gi,
435
+ /(?:TOKEN|API_KEY|API_SECRET|AUTH_TOKEN|GITHUB_TOKEN|GH_TOKEN|BEARER|JWT|OAUTH|CREDENTIAL|SECRET|PRIVATE_KEY|PASSWORD|PASSWD|PASSPHRASE)\s*[=:]\s*[^\s,]+/gi,
436
436
  // Generic high-entropy look: base64 strings >32 chars or hex strings >32 digits — but only
437
437
  // when preceded by a flag name (e.g. --github-token=EyJ...). Global flag so
438
438
  // every such flag in the command line is redacted, not just the first.
@@ -23233,6 +23233,12 @@ var gitTool = {
23233
23233
  // The git subcommand (status/commit/push) is what a trust rule needs to
23234
23234
  // distinguish; `git status` and `git push --force` must not share a subject.
23235
23235
  subjectKey: "command",
23236
+ // `command` is an enum subcommand, so on its own it rendered the subject
23237
+ // `"push"` — and one "always allow" then covered every push, to any branch,
23238
+ // with or without `--force`. These are the fields that change what the call
23239
+ // actually does, so the stored trust rule is as specific as the invocation
23240
+ // the user approved.
23241
+ subjectFields: ["branch", "force", "worktreeAction", "worktreePath", "newBranch"],
23236
23242
  mutating: true,
23237
23243
  capabilities: ["fs.write", "shell.restricted"],
23238
23244
  timeoutMs: TIMEOUT_MS2,
@@ -25425,13 +25431,7 @@ function broadcastTodoUpdate(context, todos) {
25425
25431
  to: `@session:${sessionId}`,
25426
25432
  type: "status",
25427
25433
  subject: `Kanban todo list updated (${todos.length} item${todos.length === 1 ? "" : "s"})`,
25428
- body: JSON.stringify({
25429
- kind: "kanban.todos.updated",
25430
- sessionId,
25431
- revision: context.state.revision,
25432
- todoCount: todos.length,
25433
- statusCounts
25434
- }),
25434
+ body: `Shared Kanban board synced this session's todo list: ${todos.length} item${todos.length === 1 ? "" : "s"} \u2014 ${statusCounts.completed} completed, ${statusCounts.inProgress} in progress, ${statusCounts.pending} pending.`,
25435
25435
  priority: "normal",
25436
25436
  senderSessionId: sessionId
25437
25437
  }).catch(() => {
package/dist/plan.js CHANGED
@@ -226,13 +226,7 @@ function broadcastTodoUpdate(context, todos) {
226
226
  to: `@session:${sessionId}`,
227
227
  type: "status",
228
228
  subject: `Kanban todo list updated (${todos.length} item${todos.length === 1 ? "" : "s"})`,
229
- body: JSON.stringify({
230
- kind: "kanban.todos.updated",
231
- sessionId,
232
- revision: context.state.revision,
233
- todoCount: todos.length,
234
- statusCounts
235
- }),
229
+ body: `Shared Kanban board synced this session's todo list: ${todos.length} item${todos.length === 1 ? "" : "s"} \u2014 ${statusCounts.completed} completed, ${statusCounts.inProgress} in progress, ${statusCounts.pending} pending.`,
236
230
  priority: "normal",
237
231
  senderSessionId: sessionId
238
232
  }).catch(() => {
@@ -211,7 +211,7 @@ var SENSITIVE_FLAG_PATTERNS = [
211
211
  // redaction function. Synced with core copy.
212
212
  /(?<![-\w])-(?:password|p|a)(?:[=\s]+)?[^\s,-]+/gi,
213
213
  // env var–style secrets: TOKEN=x, API_KEY=y, etc.
214
- /(?:TOKEN|API_KEY|API_SECRET|AUTH_TOKEN|GITHUB_TOKEN|GH_TOKEN|BEARER|JWT|OAUTH|CREDENTIAL|SECRET|PRIVATE_KEY|PASSWORD|PASSWD)\s*[=:]\s*[^\s,]+/gi,
214
+ /(?:TOKEN|API_KEY|API_SECRET|AUTH_TOKEN|GITHUB_TOKEN|GH_TOKEN|BEARER|JWT|OAUTH|CREDENTIAL|SECRET|PRIVATE_KEY|PASSWORD|PASSWD|PASSPHRASE)\s*[=:]\s*[^\s,]+/gi,
215
215
  // Generic high-entropy look: base64 strings >32 chars or hex strings >32 digits — but only
216
216
  // when preceded by a flag name (e.g. --github-token=EyJ...). Global flag so
217
217
  // every such flag in the command line is redacted, not just the first.
@@ -213,13 +213,7 @@ function broadcastTodoUpdate(context, todos) {
213
213
  to: `@session:${sessionId}`,
214
214
  type: "status",
215
215
  subject: `Kanban todo list updated (${todos.length} item${todos.length === 1 ? "" : "s"})`,
216
- body: JSON.stringify({
217
- kind: "kanban.todos.updated",
218
- sessionId,
219
- revision: context.state.revision,
220
- todoCount: todos.length,
221
- statusCounts
222
- }),
216
+ body: `Shared Kanban board synced this session's todo list: ${todos.length} item${todos.length === 1 ? "" : "s"} \u2014 ${statusCounts.completed} completed, ${statusCounts.inProgress} in progress, ${statusCounts.pending} pending.`,
223
217
  priority: "normal",
224
218
  senderSessionId: sessionId
225
219
  }).catch(() => {
package/dist/task.js CHANGED
@@ -186,13 +186,7 @@ function broadcastTodoUpdate(context, todos) {
186
186
  to: `@session:${sessionId}`,
187
187
  type: "status",
188
188
  subject: `Kanban todo list updated (${todos.length} item${todos.length === 1 ? "" : "s"})`,
189
- body: JSON.stringify({
190
- kind: "kanban.todos.updated",
191
- sessionId,
192
- revision: context.state.revision,
193
- todoCount: todos.length,
194
- statusCounts
195
- }),
189
+ body: `Shared Kanban board synced this session's todo list: ${todos.length} item${todos.length === 1 ? "" : "s"} \u2014 ${statusCounts.completed} completed, ${statusCounts.inProgress} in progress, ${statusCounts.pending} pending.`,
196
190
  priority: "normal",
197
191
  senderSessionId: sessionId
198
192
  }).catch(() => {
package/dist/test.js CHANGED
@@ -141,12 +141,12 @@ function resolveWin32Command(cmd) {
141
141
  }
142
142
  return cmd;
143
143
  }
144
- var WIN32_SHELL_META = /[&|<>"\r\n\0]/;
144
+ var WIN32_SHELL_META = /[&|<>"%\r\n\0]/;
145
145
  function assertSafeWin32ShellArgs(args) {
146
146
  for (const arg of args) {
147
147
  if (typeof arg === "string" && WIN32_SHELL_META.test(arg)) {
148
148
  throw new Error(
149
- 'win32 cmd shim spawn: argument contains a shell metacharacter (one of & | < > ", or a newline) that could enable command injection through the .cmd/.bat wrapper - refusing to run. Offending argument: ' + JSON.stringify(arg)
149
+ 'win32 cmd shim spawn: argument contains a shell metacharacter (one of & | < > " %, or a newline) that could enable command injection through the .cmd/.bat wrapper - refusing to run. Offending argument: ' + JSON.stringify(arg)
150
150
  );
151
151
  }
152
152
  }
@@ -377,7 +377,7 @@ var SENSITIVE_FLAG_PATTERNS = [
377
377
  // redaction function. Synced with core copy.
378
378
  /(?<![-\w])-(?:password|p|a)(?:[=\s]+)?[^\s,-]+/gi,
379
379
  // env var–style secrets: TOKEN=x, API_KEY=y, etc.
380
- /(?:TOKEN|API_KEY|API_SECRET|AUTH_TOKEN|GITHUB_TOKEN|GH_TOKEN|BEARER|JWT|OAUTH|CREDENTIAL|SECRET|PRIVATE_KEY|PASSWORD|PASSWD)\s*[=:]\s*[^\s,]+/gi,
380
+ /(?:TOKEN|API_KEY|API_SECRET|AUTH_TOKEN|GITHUB_TOKEN|GH_TOKEN|BEARER|JWT|OAUTH|CREDENTIAL|SECRET|PRIVATE_KEY|PASSWORD|PASSWD|PASSPHRASE)\s*[=:]\s*[^\s,]+/gi,
381
381
  // Generic high-entropy look: base64 strings >32 chars or hex strings >32 digits — but only
382
382
  // when preceded by a flag name (e.g. --github-token=EyJ...). Global flag so
383
383
  // every such flag in the command line is redacted, not just the first.
package/dist/todo.js CHANGED
@@ -335,13 +335,7 @@ function broadcastTodoUpdate(context, todos) {
335
335
  to: `@session:${sessionId}`,
336
336
  type: "status",
337
337
  subject: `Kanban todo list updated (${todos.length} item${todos.length === 1 ? "" : "s"})`,
338
- body: JSON.stringify({
339
- kind: "kanban.todos.updated",
340
- sessionId,
341
- revision: context.state.revision,
342
- todoCount: todos.length,
343
- statusCounts
344
- }),
338
+ body: `Shared Kanban board synced this session's todo list: ${todos.length} item${todos.length === 1 ? "" : "s"} \u2014 ${statusCounts.completed} completed, ${statusCounts.inProgress} in progress, ${statusCounts.pending} pending.`,
345
339
  priority: "normal",
346
340
  senderSessionId: sessionId
347
341
  }).catch(() => {
package/dist/tool-tier.js CHANGED
@@ -169,7 +169,7 @@ function assertSafeWin32ShellArgs(args) {
169
169
  for (const arg of args) {
170
170
  if (typeof arg === "string" && WIN32_SHELL_META.test(arg)) {
171
171
  throw new Error(
172
- 'win32 cmd shim spawn: argument contains a shell metacharacter (one of & | < > ", or a newline) that could enable command injection through the .cmd/.bat wrapper - refusing to run. Offending argument: ' + JSON.stringify(arg)
172
+ 'win32 cmd shim spawn: argument contains a shell metacharacter (one of & | < > " %, or a newline) that could enable command injection through the .cmd/.bat wrapper - refusing to run. Offending argument: ' + JSON.stringify(arg)
173
173
  );
174
174
  }
175
175
  }
@@ -190,7 +190,7 @@ var WIN32_SHELL_META;
190
190
  var init_win32_resolve = __esm({
191
191
  "src/_win32-resolve.ts"() {
192
192
  "use strict";
193
- WIN32_SHELL_META = /[&|<>"\r\n\0]/;
193
+ WIN32_SHELL_META = /[&|<>"%\r\n\0]/;
194
194
  }
195
195
  });
196
196
 
@@ -432,7 +432,7 @@ var init_redact_command = __esm({
432
432
  // redaction function. Synced with core copy.
433
433
  /(?<![-\w])-(?:password|p|a)(?:[=\s]+)?[^\s,-]+/gi,
434
434
  // env var–style secrets: TOKEN=x, API_KEY=y, etc.
435
- /(?:TOKEN|API_KEY|API_SECRET|AUTH_TOKEN|GITHUB_TOKEN|GH_TOKEN|BEARER|JWT|OAUTH|CREDENTIAL|SECRET|PRIVATE_KEY|PASSWORD|PASSWD)\s*[=:]\s*[^\s,]+/gi,
435
+ /(?:TOKEN|API_KEY|API_SECRET|AUTH_TOKEN|GITHUB_TOKEN|GH_TOKEN|BEARER|JWT|OAUTH|CREDENTIAL|SECRET|PRIVATE_KEY|PASSWORD|PASSWD|PASSPHRASE)\s*[=:]\s*[^\s,]+/gi,
436
436
  // Generic high-entropy look: base64 strings >32 chars or hex strings >32 digits — but only
437
437
  // when preceded by a flag name (e.g. --github-token=EyJ...). Global flag so
438
438
  // every such flag in the command line is redacted, not just the first.
@@ -23233,6 +23233,12 @@ var gitTool = {
23233
23233
  // The git subcommand (status/commit/push) is what a trust rule needs to
23234
23234
  // distinguish; `git status` and `git push --force` must not share a subject.
23235
23235
  subjectKey: "command",
23236
+ // `command` is an enum subcommand, so on its own it rendered the subject
23237
+ // `"push"` — and one "always allow" then covered every push, to any branch,
23238
+ // with or without `--force`. These are the fields that change what the call
23239
+ // actually does, so the stored trust rule is as specific as the invocation
23240
+ // the user approved.
23241
+ subjectFields: ["branch", "force", "worktreeAction", "worktreePath", "newBranch"],
23236
23242
  mutating: true,
23237
23243
  capabilities: ["fs.write", "shell.restricted"],
23238
23244
  timeoutMs: TIMEOUT_MS2,
@@ -25425,13 +25431,7 @@ function broadcastTodoUpdate(context, todos) {
25425
25431
  to: `@session:${sessionId}`,
25426
25432
  type: "status",
25427
25433
  subject: `Kanban todo list updated (${todos.length} item${todos.length === 1 ? "" : "s"})`,
25428
- body: JSON.stringify({
25429
- kind: "kanban.todos.updated",
25430
- sessionId,
25431
- revision: context.state.revision,
25432
- todoCount: todos.length,
25433
- statusCounts
25434
- }),
25434
+ body: `Shared Kanban board synced this session's todo list: ${todos.length} item${todos.length === 1 ? "" : "s"} \u2014 ${statusCounts.completed} completed, ${statusCounts.inProgress} in progress, ${statusCounts.pending} pending.`,
25435
25435
  priority: "normal",
25436
25436
  senderSessionId: sessionId
25437
25437
  }).catch(() => {
package/dist/typecheck.js CHANGED
@@ -141,12 +141,12 @@ function resolveWin32Command(cmd) {
141
141
  }
142
142
  return cmd;
143
143
  }
144
- var WIN32_SHELL_META = /[&|<>"\r\n\0]/;
144
+ var WIN32_SHELL_META = /[&|<>"%\r\n\0]/;
145
145
  function assertSafeWin32ShellArgs(args) {
146
146
  for (const arg of args) {
147
147
  if (typeof arg === "string" && WIN32_SHELL_META.test(arg)) {
148
148
  throw new Error(
149
- 'win32 cmd shim spawn: argument contains a shell metacharacter (one of & | < > ", or a newline) that could enable command injection through the .cmd/.bat wrapper - refusing to run. Offending argument: ' + JSON.stringify(arg)
149
+ 'win32 cmd shim spawn: argument contains a shell metacharacter (one of & | < > " %, or a newline) that could enable command injection through the .cmd/.bat wrapper - refusing to run. Offending argument: ' + JSON.stringify(arg)
150
150
  );
151
151
  }
152
152
  }
@@ -377,7 +377,7 @@ var SENSITIVE_FLAG_PATTERNS = [
377
377
  // redaction function. Synced with core copy.
378
378
  /(?<![-\w])-(?:password|p|a)(?:[=\s]+)?[^\s,-]+/gi,
379
379
  // env var–style secrets: TOKEN=x, API_KEY=y, etc.
380
- /(?:TOKEN|API_KEY|API_SECRET|AUTH_TOKEN|GITHUB_TOKEN|GH_TOKEN|BEARER|JWT|OAUTH|CREDENTIAL|SECRET|PRIVATE_KEY|PASSWORD|PASSWD)\s*[=:]\s*[^\s,]+/gi,
380
+ /(?:TOKEN|API_KEY|API_SECRET|AUTH_TOKEN|GITHUB_TOKEN|GH_TOKEN|BEARER|JWT|OAUTH|CREDENTIAL|SECRET|PRIVATE_KEY|PASSWORD|PASSWD|PASSPHRASE)\s*[=:]\s*[^\s,]+/gi,
381
381
  // Generic high-entropy look: base64 strings >32 chars or hex strings >32 digits — but only
382
382
  // when preceded by a flag name (e.g. --github-token=EyJ...). Global flag so
383
383
  // every such flag in the command line is redacted, not just the first.
package/dist/win32.js CHANGED
@@ -36,12 +36,12 @@ function resolvePowerShell(cmd) {
36
36
  }
37
37
  return resolved;
38
38
  }
39
- var WIN32_SHELL_META = /[&|<>"\r\n\0]/;
39
+ var WIN32_SHELL_META = /[&|<>"%\r\n\0]/;
40
40
  function assertSafeWin32ShellArgs(args) {
41
41
  for (const arg of args) {
42
42
  if (typeof arg === "string" && WIN32_SHELL_META.test(arg)) {
43
43
  throw new Error(
44
- 'win32 cmd shim spawn: argument contains a shell metacharacter (one of & | < > ", or a newline) that could enable command injection through the .cmd/.bat wrapper - refusing to run. Offending argument: ' + JSON.stringify(arg)
44
+ 'win32 cmd shim spawn: argument contains a shell metacharacter (one of & | < > " %, or a newline) that could enable command injection through the .cmd/.bat wrapper - refusing to run. Offending argument: ' + JSON.stringify(arg)
45
45
  );
46
46
  }
47
47
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wrongstack/tools",
3
- "version": "0.308.7",
3
+ "version": "0.309.1",
4
4
  "license": "MIT",
5
5
  "description": "WrongStack built-in tools: read/write/edit, bash/exec, grep/glob, git, fetch, test, lint, and more.",
6
6
  "repository": {
@@ -253,9 +253,9 @@
253
253
  "turndown": "^7.2.4",
254
254
  "undici": "^8.10.0",
255
255
  "web-tree-sitter": "0.26.12",
256
- "@wrongstack/core": "0.308.7",
257
- "@wrongstack/persistence": "0.308.7",
258
- "@wrongstack/kanban": "0.308.7"
256
+ "@wrongstack/core": "0.309.1",
257
+ "@wrongstack/kanban": "0.309.1",
258
+ "@wrongstack/persistence": "0.309.1"
259
259
  },
260
260
  "devDependencies": {
261
261
  "@types/node": "^26.2.0",