@mjasnikovs/pi-task 0.14.16 → 0.14.18

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.
@@ -90,7 +90,15 @@ export async function setTaskSection(cwd, id, heading, content) {
90
90
  const re = sectionRegex(heading);
91
91
  let next;
92
92
  if (re.test(body)) {
93
- next = body.replace(re, `$1\n${content.trim()}\n\n`);
93
+ // Use a replacer FUNCTION, not a replacement string: `content` is
94
+ // untrusted model output and may contain `$`-sequences (`$\``, `$'`,
95
+ // `$&`, `$1`, `$$`). In a replacement string those are special patterns
96
+ // String.prototype.replace would expand — e.g. a spec line with the
97
+ // regex `^\+[1-9]\d{1,14}$` ends in the literal `` $` `` (dollar +
98
+ // closing backtick), which expands to "everything before the match" and
99
+ // silently mangles/truncates the stored section (dropping ACCEPTANCE /
100
+ // VERIFY), making the spec unrunnable. A function return is literal.
101
+ next = body.replace(re, (_m, p1) => `${p1}\n${content.trim()}\n\n`);
94
102
  }
95
103
  else {
96
104
  const sep = body.endsWith('\n\n') ? ''
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mjasnikovs/pi-task",
3
- "version": "0.14.16",
3
+ "version": "0.14.18",
4
4
  "description": "Deterministic spec-orchestration for local models, with a bundled real-time remote web view and web/docs/fetch/worker subagent tools.",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -18,9 +18,9 @@
18
18
  "prepublishOnly": "bun run build"
19
19
  },
20
20
  "peerDependencies": {
21
- "@earendil-works/pi-coding-agent": "0.78.1",
22
- "@earendil-works/pi-agent-core": "0.78.1",
23
- "@earendil-works/pi-tui": "0.78.1"
21
+ "@earendil-works/pi-coding-agent": ">=0.80.0",
22
+ "@earendil-works/pi-agent-core": ">=0.80.0",
23
+ "@earendil-works/pi-tui": ">=0.80.0"
24
24
  },
25
25
  "dependencies": {
26
26
  "@mozilla/readability": "0.6.0",
@@ -32,9 +32,9 @@
32
32
  "ws": "8.21.0"
33
33
  },
34
34
  "devDependencies": {
35
- "@earendil-works/pi-agent-core": "0.78.1",
36
- "@earendil-works/pi-coding-agent": "0.78.1",
37
- "@earendil-works/pi-tui": "0.78.1",
35
+ "@earendil-works/pi-agent-core": "0.80.2",
36
+ "@earendil-works/pi-coding-agent": "0.80.2",
37
+ "@earendil-works/pi-tui": "0.80.2",
38
38
  "@eslint/js": "10.0.1",
39
39
  "@sinclair/typebox": "0.34.49",
40
40
  "@types/bun": "1.3.12",