@theokit/sdk-tools 0.11.1 → 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 +2 -2
- package/README.md +1 -1
- package/dist/index.cjs +9 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +14 -3
- package/dist/index.d.ts +14 -3
- package/dist/index.js +9 -1
- package/dist/index.js.map +1 -1
- package/package.json +14 -14
package/CHANGELOG.md
CHANGED
|
@@ -40,13 +40,13 @@
|
|
|
40
40
|
|
|
41
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.
|
|
42
42
|
|
|
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.
|
|
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.)
|
|
44
44
|
|
|
45
45
|
- 84df83a: **SE32 — read-before-write safety (`requireReadBeforeWrite` + `ReadTracker`).**
|
|
46
46
|
|
|
47
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.
|
|
48
48
|
|
|
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`).
|
|
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.)
|
|
50
50
|
|
|
51
51
|
## 0.8.0
|
|
52
52
|
|
package/README.md
CHANGED
package/dist/index.cjs
CHANGED
|
@@ -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("&", "&").replaceAll("<", "<").replaceAll(">", ">");
|
|
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
|