stitchkit 0.108.3 → 0.108.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -15,6 +15,14 @@ additive**; the first breaking change landed in 0.10.0. Grep the file for
15
15
 
16
16
  ## [Unreleased]
17
17
 
18
+ ## [0.108.4] - 2026-10-09
19
+
20
+ ### Fixed
21
+
22
+ - `stitchkit/agent-runtime/coding-tools` — `edit_file` now inserts `newText` literally when
23
+ `replaceAll: true`; JavaScript replacement tokens such as `$$`, `$&`, `` $` `` and `$'` no
24
+ longer rewrite the requested text. Single replacements already had this literal behavior.
25
+
18
26
  ## [0.108.3] - 2026-10-09
19
27
 
20
28
  ### Added
@@ -1 +1 @@
1
- {"version":3,"file":"coding-tool-search-patch.d.ts","sourceRoot":"","sources":["../../src/agent-runtime/coding-tool-search-patch.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EACV,qBAAqB,EACrB,yBAAyB,EACzB,qBAAqB,EACtB,MAAM,wBAAwB,CAAC;AA+VhC,wBAAgB,+BAA+B,CAC7C,MAAM,EAAE,qBAAqB,EAC7B,MAAM,EAAE,qBAAqB,GAC5B,SAAS,yBAAyB,EAAE,CAsBtC"}
1
+ {"version":3,"file":"coding-tool-search-patch.d.ts","sourceRoot":"","sources":["../../src/agent-runtime/coding-tool-search-patch.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EACV,qBAAqB,EACrB,yBAAyB,EACzB,qBAAqB,EACtB,MAAM,wBAAwB,CAAC;AAgWhC,wBAAgB,+BAA+B,CAC7C,MAAM,EAAE,qBAAqB,EAC7B,MAAM,EAAE,qBAAqB,GAC5B,SAAS,yBAAyB,EAAE,CAsBtC"}
@@ -6,7 +6,7 @@ import {
6
6
  AgentCodingToolAuthorizationSchema2,
7
7
  AgentCodingToolPathAuthorizationSchema2,
8
8
  createAgentCodingTools2
9
- } from "../../index-tycmtxky.js";
9
+ } from "../../index-sjntc4az.js";
10
10
  import"../../index-2kbysk9s.js";
11
11
  import"../../index-dj1aycxw.js";
12
12
  import"../../index-8ks9b85e.js";
@@ -8,7 +8,7 @@ import"../../index-q6crhe1n.js";
8
8
  import"../../index-fynr93w4.js";
9
9
  import {
10
10
  createAgentCodingTools2
11
- } from "../../index-tycmtxky.js";
11
+ } from "../../index-sjntc4az.js";
12
12
  import"../../index-2kbysk9s.js";
13
13
  import {
14
14
  COMMAND_CLEANUP_TIMEOUT_MS,
@@ -925,7 +925,8 @@ async function editFile(config, limits, input) {
925
925
  });
926
926
  }
927
927
  const replacements = input.replaceAll ? count : 1;
928
- const changed = input.replaceAll ? source.replaceAll(input.oldText, input.newText) : source.replace(input.oldText, () => input.newText);
928
+ const literalReplacement = () => input.newText;
929
+ const changed = input.replaceAll ? source.replaceAll(input.oldText, literalReplacement) : source.replace(input.oldText, literalReplacement);
929
930
  const bytes = Buffer.byteLength(changed);
930
931
  const resultSha256 = sha256(changed);
931
932
  if (bytes > limits.maxWriteBytes) {
@@ -21,7 +21,7 @@ artifact store is supplied, `read_output`.
21
21
 
22
22
  | Export | Kind | Summary |
23
23
  |--------|------|---------|
24
- | `createAgentCodingTools` | function | construct direct host-authorized bounded file, listing, glob, search, exact-snippet edit, shell and artifact runtime-tool definitions; every ordinary refusal is a typed code with an instructive `hint`, and filesystem operations use Linux `/proc/self/fd` or the packaged macOS Node-API backend and otherwise fail closed |
24
+ | `createAgentCodingTools` | function | construct direct host-authorized bounded file, listing, glob, search, exact-snippet edit, shell and artifact runtime-tool definitions; `edit_file` inserts `newText` literally in both single and `replaceAll` modes; every ordinary refusal is a typed code with an instructive `hint`, and filesystem operations use Linux `/proc/self/fd` or the packaged macOS Node-API backend and otherwise fail closed |
25
25
  | `AGENT_CODING_TOOL_NAMES` | const | the mounted tool names — `read_file`, `write_file`, `edit_file`, `list_directory`, `glob`, `search_files`, `run_command`, `read_output` |
26
26
  | `AgentCodingToolDefinition` | _type_ | peer-free structural direct-tool shape accepted by the canonical runtime-tool surface |
27
27
  | `AgentCodingToolConfig` | _type_ | absolute root, required operation authorization, optional async/sync `authorizePath({ path })` shared by direct file effects and discovery, finite executable alias map, exact child environment and optional limits |
@@ -322,8 +322,9 @@ includes the exact workspace-relative `recoveryPath`; an absolute path outside t
322
322
  suggested replacement. Applying the suggestion still passes the same descriptor-relative
323
323
  containment and symlink checks.
324
324
 
325
- `edit_file` replaces one exact snippet. `oldText` is itself the freshness guard for the region it
326
- changes, so the digest is the optional `expectedSha256` and an edit is one call; pass the digest
325
+ `edit_file` replaces one exact snippet. It inserts `newText` literally in both single and
326
+ `replaceAll` modes, including JavaScript replacement tokens such as `$$`, `$&`, `` $` `` and `$'`.
327
+ `oldText` is itself the freshness guard for the region it changes, so the digest is the optional `expectedSha256` and an edit is one call; pass the digest
327
328
  `read_file` returned when you want the whole-file guarantee, and read the `sha256` it returns to
328
329
  chain the next edit without re-reading. The read, the occurrence count and the construction of the
329
330
  new content all happen inside one per-target lock, so two concurrent edits of different snippets in
package/llms-full.txt CHANGED
@@ -5511,8 +5511,9 @@ includes the exact workspace-relative `recoveryPath`; an absolute path outside t
5511
5511
  suggested replacement. Applying the suggestion still passes the same descriptor-relative
5512
5512
  containment and symlink checks.
5513
5513
 
5514
- `edit_file` replaces one exact snippet. `oldText` is itself the freshness guard for the region it
5515
- changes, so the digest is the optional `expectedSha256` and an edit is one call; pass the digest
5514
+ `edit_file` replaces one exact snippet. It inserts `newText` literally in both single and
5515
+ `replaceAll` modes, including JavaScript replacement tokens such as `$$`, `$&`, `` $` `` and `$'`.
5516
+ `oldText` is itself the freshness guard for the region it changes, so the digest is the optional `expectedSha256` and an edit is one call; pass the digest
5516
5517
  `read_file` returned when you want the whole-file guarantee, and read the `sha256` it returns to
5517
5518
  chain the next edit without re-reading. The read, the occurrence count and the construction of the
5518
5519
  new content all happen inside one per-target lock, so two concurrent edits of different snippets in
@@ -21843,7 +21844,7 @@ artifact store is supplied, `read_output`.
21843
21844
 
21844
21845
  | Export | Kind | Summary |
21845
21846
  |--------|------|---------|
21846
- | `createAgentCodingTools` | function | construct direct host-authorized bounded file, listing, glob, search, exact-snippet edit, shell and artifact runtime-tool definitions; every ordinary refusal is a typed code with an instructive `hint`, and filesystem operations use Linux `/proc/self/fd` or the packaged macOS Node-API backend and otherwise fail closed |
21847
+ | `createAgentCodingTools` | function | construct direct host-authorized bounded file, listing, glob, search, exact-snippet edit, shell and artifact runtime-tool definitions; `edit_file` inserts `newText` literally in both single and `replaceAll` modes; every ordinary refusal is a typed code with an instructive `hint`, and filesystem operations use Linux `/proc/self/fd` or the packaged macOS Node-API backend and otherwise fail closed |
21847
21848
  | `AGENT_CODING_TOOL_NAMES` | const | the mounted tool names — `read_file`, `write_file`, `edit_file`, `list_directory`, `glob`, `search_files`, `run_command`, `read_output` |
21848
21849
  | `AgentCodingToolDefinition` | _type_ | peer-free structural direct-tool shape accepted by the canonical runtime-tool surface |
21849
21850
  | `AgentCodingToolConfig` | _type_ | absolute root, required operation authorization, optional async/sync `authorizePath({ path })` shared by direct file effects and discovery, finite executable alias map, exact child environment and optional limits |
package/llms.txt CHANGED
@@ -25,10 +25,10 @@ Load the slice for each entrypoint your code imports — `import … from 'stitc
25
25
  - **stitchkit/primitives**: [llms/primitives.txt](llms/primitives.txt) 11.7 KB
26
26
  - **stitchkit/server**: [llms/server.txt](llms/server.txt) 45.3 KB → [llms/server.2.txt](llms/server.2.txt) 14.6 KB → [llms/server.3.txt](llms/server.3.txt) 45.6 KB → [llms/server.4.txt](llms/server.4.txt) 38.3 KB → [llms/server.5.txt](llms/server.5.txt) 22.1 KB
27
27
  - **stitchkit/observability**: [llms/observability.txt](llms/observability.txt) 45.9 KB
28
- - **stitchkit/agent-runtime**: [llms/agent-runtime.txt](llms/agent-runtime.txt) 37.0 KB → [llms/agent-runtime.2.txt](llms/agent-runtime.2.txt) 46.7 KB → [llms/agent-runtime.3.txt](llms/agent-runtime.3.txt) 34.7 KB
28
+ - **stitchkit/agent-runtime**: [llms/agent-runtime.txt](llms/agent-runtime.txt) 37.1 KB → [llms/agent-runtime.2.txt](llms/agent-runtime.2.txt) 46.7 KB → [llms/agent-runtime.3.txt](llms/agent-runtime.3.txt) 34.7 KB
29
29
  - **stitchkit/agent-runtime/testing**: [llms/agent-runtime-testing.txt](llms/agent-runtime-testing.txt) 2.6 KB
30
30
  - **stitchkit/agent-runtime/harness**: [llms/agent-runtime-harness.txt](llms/agent-runtime-harness.txt) 11.0 KB
31
- - **stitchkit/agent-runtime/coding-tools**: [llms/agent-runtime-coding-tools.txt](llms/agent-runtime-coding-tools.txt) 4.9 KB
31
+ - **stitchkit/agent-runtime/coding-tools**: [llms/agent-runtime-coding-tools.txt](llms/agent-runtime-coding-tools.txt) 5.0 KB
32
32
  - **stitchkit/agent-runtime/browser**: [llms/agent-runtime-browser.txt](llms/agent-runtime-browser.txt) 3.8 KB
33
33
  - **stitchkit/agent-runtime/openrouter**: [llms/agent-runtime-openrouter.txt](llms/agent-runtime-openrouter.txt) 1.1 KB
34
34
  - **stitchkit/agent-runtime/sqlite/bun**: [llms/agent-runtime-sqlite-bun.txt](llms/agent-runtime-sqlite-bun.txt) 1.8 KB
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "stitchkit",
3
- "version": "0.108.3",
3
+ "version": "0.108.4",
4
4
  "description": "Contract-first backend framework — one defineContract() into an HTTP API, MCP tools, AI-agent tools and a typed client. Bun and Node.",
5
5
  "keywords": [
6
6
  "bun",