@warlock.js/ai-workspace 4.8.2 → 4.9.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/cjs/index.cjs +14 -14
- package/cjs/index.cjs.map +1 -1
- package/esm/backends/local.d.mts +1 -1
- package/esm/backends/local.d.mts.map +1 -1
- package/esm/backends/local.mjs +1 -1
- package/esm/backends/local.mjs.map +1 -1
- package/esm/backends/mock.d.mts +1 -1
- package/esm/backends/mock.d.mts.map +1 -1
- package/esm/backends/mock.mjs +1 -1
- package/esm/backends/mock.mjs.map +1 -1
- package/esm/contracts/tool-io.type.d.mts +1 -1
- package/esm/contracts/tool-io.type.d.mts.map +1 -1
- package/esm/contracts/workspace-backend.contract.d.mts +1 -1
- package/esm/contracts/workspace-backend.contract.d.mts.map +1 -1
- package/esm/contracts/workspace-ops.contract.d.mts +1 -1
- package/esm/contracts/workspace-ops.contract.d.mts.map +1 -1
- package/esm/contracts/workspace-policy.type.d.mts +1 -1
- package/esm/contracts/workspace-policy.type.d.mts.map +1 -1
- package/esm/contracts/workspace.contract.d.mts +1 -1
- package/esm/contracts/workspace.contract.d.mts.map +1 -1
- package/esm/errors.d.mts +1 -1
- package/esm/errors.d.mts.map +1 -1
- package/esm/errors.mjs +1 -1
- package/esm/errors.mjs.map +1 -1
- package/esm/ops.d.mts +1 -1
- package/esm/ops.d.mts.map +1 -1
- package/esm/ops.mjs +1 -1
- package/esm/ops.mjs.map +1 -1
- package/esm/policy/policy.d.mts +1 -1
- package/esm/policy/policy.d.mts.map +1 -1
- package/esm/policy/policy.mjs +1 -1
- package/esm/policy/policy.mjs.map +1 -1
- package/esm/tools/edit-file.d.mts +1 -1
- package/esm/tools/edit-file.d.mts.map +1 -1
- package/esm/tools/edit-file.mjs +1 -1
- package/esm/tools/edit-file.mjs.map +1 -1
- package/esm/tools/glob.d.mts +1 -1
- package/esm/tools/glob.d.mts.map +1 -1
- package/esm/tools/glob.mjs +1 -1
- package/esm/tools/glob.mjs.map +1 -1
- package/esm/tools/grep.d.mts +1 -1
- package/esm/tools/grep.d.mts.map +1 -1
- package/esm/tools/grep.mjs +1 -1
- package/esm/tools/grep.mjs.map +1 -1
- package/esm/tools/read-file.d.mts +1 -1
- package/esm/tools/read-file.d.mts.map +1 -1
- package/esm/tools/read-file.mjs +1 -1
- package/esm/tools/read-file.mjs.map +1 -1
- package/esm/tools/run-shell.d.mts +1 -1
- package/esm/tools/run-shell.d.mts.map +1 -1
- package/esm/tools/run-shell.mjs +1 -1
- package/esm/tools/run-shell.mjs.map +1 -1
- package/esm/tools/run-tests.d.mts +1 -1
- package/esm/tools/run-tests.d.mts.map +1 -1
- package/esm/tools/run-tests.mjs +1 -1
- package/esm/tools/run-tests.mjs.map +1 -1
- package/esm/tools/schema.mjs +1 -1
- package/esm/tools/schema.mjs.map +1 -1
- package/esm/tools/write-file.d.mts +1 -1
- package/esm/tools/write-file.d.mts.map +1 -1
- package/esm/tools/write-file.mjs +1 -1
- package/esm/tools/write-file.mjs.map +1 -1
- package/esm/workspace.d.mts +1 -1
- package/esm/workspace.d.mts.map +1 -1
- package/esm/workspace.mjs +1 -1
- package/esm/workspace.mjs.map +1 -1
- package/package.json +3 -3
package/cjs/index.cjs
CHANGED
|
@@ -34,7 +34,7 @@ let _warlock_js_fs = require("@warlock.js/fs");
|
|
|
34
34
|
let node_child_process = require("node:child_process");
|
|
35
35
|
let node_process = require("node:process");
|
|
36
36
|
|
|
37
|
-
//#region
|
|
37
|
+
//#region ../ai-workspace/src/errors.ts
|
|
38
38
|
/**
|
|
39
39
|
* The workspace policy engine refused an operation — a path escaped the
|
|
40
40
|
* jail (or hit a deny glob), or a shell command's executable was not
|
|
@@ -88,7 +88,7 @@ var WorkspaceEditError = class extends _warlock_js_ai.AIError {
|
|
|
88
88
|
};
|
|
89
89
|
|
|
90
90
|
//#endregion
|
|
91
|
-
//#region
|
|
91
|
+
//#region ../ai-workspace/src/policy/policy.ts
|
|
92
92
|
/**
|
|
93
93
|
* Resolve the canonical absolute form of `target`, collapsing any
|
|
94
94
|
* symlinks. `target` may not yet exist (a fresh `writeFile`/`mkdir`),
|
|
@@ -266,7 +266,7 @@ function buildEnv(policy) {
|
|
|
266
266
|
}
|
|
267
267
|
|
|
268
268
|
//#endregion
|
|
269
|
-
//#region
|
|
269
|
+
//#region ../ai-workspace/src/ops.ts
|
|
270
270
|
/** Default line window a read returns when the policy sets no `defaultLines`. */
|
|
271
271
|
const DEFAULT_READ_LINES = 2e3;
|
|
272
272
|
/** Hard ceiling on grep matches returned, so a broad pattern can't flood. */
|
|
@@ -553,7 +553,7 @@ function createOps(backend, policy) {
|
|
|
553
553
|
}
|
|
554
554
|
|
|
555
555
|
//#endregion
|
|
556
|
-
//#region
|
|
556
|
+
//#region ../ai-workspace/src/backends/local.ts
|
|
557
557
|
/**
|
|
558
558
|
* Hard ceiling on captured `stdout`/`stderr` per stream, in bytes. The raw
|
|
559
559
|
* executor truncates each stream once this many bytes have accumulated so a
|
|
@@ -754,7 +754,7 @@ function createLocalBackend() {
|
|
|
754
754
|
}
|
|
755
755
|
|
|
756
756
|
//#endregion
|
|
757
|
-
//#region
|
|
757
|
+
//#region ../ai-workspace/src/backends/mock.ts
|
|
758
758
|
/**
|
|
759
759
|
* Normalize an absolute path to a stable in-memory key: forward slashes,
|
|
760
760
|
* collapsed duplicate separators, and resolved `.` / `..` segments. There
|
|
@@ -919,7 +919,7 @@ function isMockBackendSeed(seed) {
|
|
|
919
919
|
}
|
|
920
920
|
|
|
921
921
|
//#endregion
|
|
922
|
-
//#region
|
|
922
|
+
//#region ../ai-workspace/src/tools/schema.ts
|
|
923
923
|
/**
|
|
924
924
|
* Tiny, dependency-free [Standard Schema](https://standardschema.dev)
|
|
925
925
|
* builders for the workspace tools' input validation. The package pins
|
|
@@ -1028,7 +1028,7 @@ function objectSchema(shape) {
|
|
|
1028
1028
|
}
|
|
1029
1029
|
|
|
1030
1030
|
//#endregion
|
|
1031
|
-
//#region
|
|
1031
|
+
//#region ../ai-workspace/src/tools/edit-file.ts
|
|
1032
1032
|
/** Default tool name exposed to the LLM. */
|
|
1033
1033
|
const DEFAULT_NAME$2 = "edit_file";
|
|
1034
1034
|
/** Input schema for the `edit_file` tool. */
|
|
@@ -1080,7 +1080,7 @@ function makeEditFileTool(ops, options) {
|
|
|
1080
1080
|
}
|
|
1081
1081
|
|
|
1082
1082
|
//#endregion
|
|
1083
|
-
//#region
|
|
1083
|
+
//#region ../ai-workspace/src/tools/glob.ts
|
|
1084
1084
|
/**
|
|
1085
1085
|
* Standard Schema for {@link GlobInput} — a single required `pattern`
|
|
1086
1086
|
* string. Built on the package's shared, dependency-free schema builders
|
|
@@ -1120,7 +1120,7 @@ function makeGlobTool(ops, options) {
|
|
|
1120
1120
|
}
|
|
1121
1121
|
|
|
1122
1122
|
//#endregion
|
|
1123
|
-
//#region
|
|
1123
|
+
//#region ../ai-workspace/src/tools/grep.ts
|
|
1124
1124
|
/**
|
|
1125
1125
|
* Standard Schema for {@link GrepInput} — `pattern` is a required string;
|
|
1126
1126
|
* `glob` and `ignoreCase` are optional. Built on the package's shared,
|
|
@@ -1166,7 +1166,7 @@ function makeGrepTool(ops, options) {
|
|
|
1166
1166
|
}
|
|
1167
1167
|
|
|
1168
1168
|
//#endregion
|
|
1169
|
-
//#region
|
|
1169
|
+
//#region ../ai-workspace/src/tools/read-file.ts
|
|
1170
1170
|
/** Default tool name exposed to the LLM. */
|
|
1171
1171
|
const DEFAULT_NAME$1 = "read_file";
|
|
1172
1172
|
/** Input schema for the `read_file` tool. */
|
|
@@ -1225,7 +1225,7 @@ function makeReadFileTool(ops, options) {
|
|
|
1225
1225
|
}
|
|
1226
1226
|
|
|
1227
1227
|
//#endregion
|
|
1228
|
-
//#region
|
|
1228
|
+
//#region ../ai-workspace/src/tools/run-shell.ts
|
|
1229
1229
|
/** The default tool name `run_shell` is exposed to the LLM under. */
|
|
1230
1230
|
const DEFAULT_RUN_SHELL_TOOL_NAME = "run_shell";
|
|
1231
1231
|
/**
|
|
@@ -1286,7 +1286,7 @@ function makeRunShellTool(ops, options) {
|
|
|
1286
1286
|
}
|
|
1287
1287
|
|
|
1288
1288
|
//#endregion
|
|
1289
|
-
//#region
|
|
1289
|
+
//#region ../ai-workspace/src/tools/run-tests.ts
|
|
1290
1290
|
/** The default tool name `run_tests` is exposed to the LLM under. */
|
|
1291
1291
|
const DEFAULT_RUN_TESTS_TOOL_NAME = "run_tests";
|
|
1292
1292
|
/** The default command run when no `command` override is configured. */
|
|
@@ -1349,7 +1349,7 @@ function makeRunTestsTool(ops, options) {
|
|
|
1349
1349
|
}
|
|
1350
1350
|
|
|
1351
1351
|
//#endregion
|
|
1352
|
-
//#region
|
|
1352
|
+
//#region ../ai-workspace/src/tools/write-file.ts
|
|
1353
1353
|
/** Default tool name exposed to the LLM. */
|
|
1354
1354
|
const DEFAULT_NAME = "write_file";
|
|
1355
1355
|
/** Input schema for the `write_file` tool. */
|
|
@@ -1396,7 +1396,7 @@ function makeWriteFileTool(ops, options) {
|
|
|
1396
1396
|
}
|
|
1397
1397
|
|
|
1398
1398
|
//#endregion
|
|
1399
|
-
//#region
|
|
1399
|
+
//#region ../ai-workspace/src/workspace.ts
|
|
1400
1400
|
/**
|
|
1401
1401
|
* The full set of tool names a writable workspace vends, in a stable
|
|
1402
1402
|
* canonical order so `tools.all()` is deterministic.
|