@theokit/sdk-tools 0.11.0 → 0.12.0

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
@@ -1,5 +1,14 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.11.1
4
+
5
+ ### Patch Changes
6
+
7
+ - 453ad2d: SE43 — system-design audit fixes (public-surface changes).
8
+
9
+ - **`@theokit/sdk` (minor):** the shared persistence kernel is now reachable from the sanctioned public `@theokit/sdk/persistence` barrel — `withCwdMutex`, `sanitizeFts5Query`, and `PersistenceSchema` are added (joining `replaceFileAtomic` / `openSqliteResilient` / `atomicWriteText` / `atomicWriteJson`). The `@theokit/sdk/internal/persistence` export is now **deprecated**: it re-exports its full surface unchanged for one release (back-compat) and is scheduled for removal in a future major. No breaking change; existing imports keep working.
10
+ - **Satellites (patch):** `sdk-tools` / `sdk-memory` / `sdk-cache` / `sdk-handoff` / `sdk-budget` tightened their `@theokit/sdk` peer-range floor from `>=1.7.0` to `>=4.0.0`, matching the v4-only surfaces they import (prevents a non-workspace install resolving an incompatible old sdk).
11
+
3
12
  ## 0.11.0
4
13
 
5
14
  ### Minor Changes
@@ -31,13 +40,13 @@
31
40
 
32
41
  A pluggable filesystem _storage_ provider, the storage-side twin of `@theokit/sdk/sandbox`. `FilesystemBackend` is an abstract class with four methods (`readFile` / `writeFile` / `stat` / `list`), an `exists()` derived on the base, a boundary `basePath`, a `readOnly` flag, structured `stat().mtimeMs` (the read-before-write oracle for SE32), and typed errors (`FileNotFoundError` / `FilesystemSecurityError` / `FilesystemReadOnlyError` / `StaleFileError`). `LocalFilesystem` is the local-process implementation, boundary-enforced by reusing the core path-guard (traversal + symlink escape → `FilesystemSecurityError`). `FilesystemProvider` + `resolveFilesystem` support a per-request resolver `(ctx) => FilesystemBackend` for multi-tenant roots.
33
42
 
34
- Unlike `SandboxBackend` (whose file ops shell out via `execute`, require command execution, and give no structured `stat`), a `FilesystemBackend` serves a filesystem-only workspace with no sandbox — see ADR 0011 for why file ops are NOT routed through `SandboxBackend`. `@theokit/sdk-tools`' `createWriteFileTool` now accepts an optional `filesystem` backend (writes route through it; omitted ⇒ identical local-`projectRoot` behavior). This is the backend seam, NOT a bundled `Workspace` and NOT a new toolset — bring-your-own-tools stands; `mounts`/FUSE, S3/GCS, and LSP remain out of core. From the Mastra Workspaces comparison (SDK Evolution roadmap SE31).
43
+ Unlike `SandboxBackend` (whose file ops shell out via `execute`, require command execution, and give no structured `stat`), a `FilesystemBackend` serves a filesystem-only workspace with no sandbox — see ADR 0011 for why file ops are NOT routed through `SandboxBackend`. `@theokit/sdk-tools`' `createWriteFileTool` now accepts an optional `filesystem` backend (writes route through it; omitted ⇒ identical local-`projectRoot` behavior). This is the backend seam, NOT a bundled `Workspace` and NOT a new toolset — bring-your-own-tools stands; `mounts`/FUSE, S3/GCS, and LSP remain out of core. (SDK Evolution roadmap SE31.)
35
44
 
36
45
  - 84df83a: **SE32 — read-before-write safety (`requireReadBeforeWrite` + `ReadTracker`).**
37
46
 
38
47
  An opt-in guard on `createWriteFileTool` that refuses to blindly overwrite a file the agent has not seen. A per-run `ReadTracker` (exported from `@theokit/sdk-tools`) records each file's mtime when `createReadFileTool` reads it; when `createWriteFileTool` is created with `{ requireReadBeforeWrite: true, readTracker }`, a write is refused with `read_required` if the existing file was never read, or `stale_file` if it changed on disk since it was read. A NEW file writes freely (nothing to clobber). Default OFF — omitting the flag preserves current behavior exactly.
39
48
 
40
- Works on both the local `projectRoot` path and the SE31 `filesystem` backend path (the backend also gets `expectedMtime` forwarded so it re-checks at write time — TOCTOU defense). The tracker is deliberately per-instance, not a global singleton, so state never leaks across runs. `edit_file` already has implicit read-before-write safety via `old_string` content matching, so the guard targets the blind-overwrite path (`write_file`). Mirrors Mastra Workspaces' read-before-write (`FileReadRequiredError` / `StaleFileError`). From the Mastra Workspaces comparison (SDK Evolution roadmap SE32).
49
+ Works on both the local `projectRoot` path and the SE31 `filesystem` backend path (the backend also gets `expectedMtime` forwarded so it re-checks at write time — TOCTOU defense). The tracker is deliberately per-instance, not a global singleton, so state never leaks across runs. `edit_file` already has implicit read-before-write safety via `old_string` content matching, so the guard targets the blind-overwrite path (`write_file`). Refusals surface as `FileReadRequiredError` / `StaleFileError`. (SDK Evolution roadmap SE32.)
41
50
 
42
51
  ## 0.8.0
43
52
 
package/README.md CHANGED
@@ -75,7 +75,7 @@ After (2.x):
75
75
  import { createReadFileTool } from "@theokit/sdk-tools";
76
76
  ```
77
77
 
78
- See `docs/migration/1-x-to-2-0.md` in the monorepo root.
78
+ See the monorepo `CHANGELOG.md` for the 1.x → 2.0 package-split migration notes.
79
79
 
80
80
  ## License
81
81
 
package/dist/index.cjs CHANGED
@@ -5,8 +5,8 @@ var path = require('path');
5
5
  var sdk = require('@theokit/sdk');
6
6
  var zod = require('zod');
7
7
  var fs = require('fs');
8
- var persistence = require('@theokit/sdk/internal/persistence');
9
8
  var pathSafety = require('@theokit/sdk/path-safety');
9
+ var persistence = require('@theokit/sdk/persistence');
10
10
  var child_process = require('child_process');
11
11
  var promises$1 = require('dns/promises');
12
12
  var net = require('net');
@@ -990,6 +990,14 @@ function withDescription(tool, description) {
990
990
  handler: tool.handler
991
991
  };
992
992
  }
993
+ function withName(tool, name) {
994
+ return {
995
+ name,
996
+ description: tool.description,
997
+ inputSchema: tool.inputSchema,
998
+ handler: tool.handler
999
+ };
1000
+ }
993
1001
  function esc(s) {
994
1002
  return String(s).replaceAll("&", "&amp;").replaceAll("<", "&lt;").replaceAll(">", "&gt;");
995
1003
  }
@@ -2284,6 +2292,7 @@ exports.todoItemsToPlanNodes = todoItemsToPlanNodes;
2284
2292
  exports.truncateOutput = truncateOutput;
2285
2293
  exports.withDefaultGuidance = withDefaultGuidance;
2286
2294
  exports.withDescription = withDescription;
2295
+ exports.withName = withName;
2287
2296
  exports.withShellExitGuidance = withShellExitGuidance;
2288
2297
  exports.withToolResultGuidance = withToolResultGuidance;
2289
2298
  //# sourceMappingURL=index.cjs.map