@warlock.js/ai-workspace 5.45.0 → 5.47.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.
Files changed (48) hide show
  1. package/CHANGELOG.md +20 -0
  2. package/README.md +2 -0
  3. package/cjs/index.cjs +514 -54
  4. package/cjs/index.cjs.map +1 -1
  5. package/esm/backends/local.d.mts.map +1 -1
  6. package/esm/backends/local.mjs +24 -1
  7. package/esm/backends/local.mjs.map +1 -1
  8. package/esm/contracts/index.d.mts +4 -4
  9. package/esm/contracts/tool-io.type.d.mts +6 -0
  10. package/esm/contracts/tool-io.type.d.mts.map +1 -1
  11. package/esm/contracts/workspace-backend.contract.d.mts +20 -0
  12. package/esm/contracts/workspace-backend.contract.d.mts.map +1 -1
  13. package/esm/contracts/workspace-edit.type.d.mts +30 -0
  14. package/esm/contracts/workspace-edit.type.d.mts.map +1 -1
  15. package/esm/contracts/workspace-ops.contract.d.mts +7 -2
  16. package/esm/contracts/workspace-ops.contract.d.mts.map +1 -1
  17. package/esm/contracts/workspace-policy.type.d.mts +23 -0
  18. package/esm/contracts/workspace-policy.type.d.mts.map +1 -1
  19. package/esm/contracts/workspace.contract.d.mts +4 -1
  20. package/esm/contracts/workspace.contract.d.mts.map +1 -1
  21. package/esm/hooks/shell-output.mjs +113 -0
  22. package/esm/hooks/shell-output.mjs.map +1 -0
  23. package/esm/index.d.mts +4 -4
  24. package/esm/ops.d.mts.map +1 -1
  25. package/esm/ops.mjs +108 -40
  26. package/esm/ops.mjs.map +1 -1
  27. package/esm/policy/shell-check.d.mts +2 -0
  28. package/esm/policy/shell-check.d.mts.map +1 -1
  29. package/esm/policy/shell-check.mjs +59 -5
  30. package/esm/policy/shell-check.mjs.map +1 -1
  31. package/esm/search/walk.mjs +209 -0
  32. package/esm/search/walk.mjs.map +1 -0
  33. package/esm/shell-jobs.d.mts +1 -1
  34. package/esm/shell-jobs.d.mts.map +1 -1
  35. package/esm/shell-jobs.mjs +1 -1
  36. package/esm/shell-jobs.mjs.map +1 -1
  37. package/esm/tools/glob.mjs +5 -4
  38. package/esm/tools/glob.mjs.map +1 -1
  39. package/esm/tools/grep.mjs +3 -2
  40. package/esm/tools/grep.mjs.map +1 -1
  41. package/esm/tools/run-shell.d.mts.map +1 -1
  42. package/esm/tools/run-shell.mjs +2 -1
  43. package/esm/tools/run-shell.mjs.map +1 -1
  44. package/esm/workspace.mjs +2 -2
  45. package/esm/workspace.mjs.map +1 -1
  46. package/llms-full.txt +36 -17
  47. package/package.json +3 -3
  48. package/skills/use-a-workspace/SKILL.md +36 -17
package/CHANGELOG.md CHANGED
@@ -4,6 +4,26 @@ All notable changes to `@warlock.js/ai-workspace` are documented in this file.
4
4
 
5
5
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/). `@warlock.js/*` packages are released in lockstep — every package shares the same version number, so a version below may list only the changes that affected this package.
6
6
 
7
+ ## 5.47.0 - 2026-11-06
8
+
9
+ ### Added
10
+
11
+ - `policy.search`: `skipDirs` (default `[".git", "node_modules"]`), `gitignore` (default `true`), `maxFiles` (default `50000`; the search stops there and the result carries `truncated: true` and `maxFilesReached: true`) and `concurrency` (default `16`). New type `WorkspaceSearchPolicy`.
12
+ - `ws.glob(pattern, { signal })`, `ws.grep(pattern, { signal })`; the `glob` and `grep` tools pass the run's signal.
13
+ - Optional `WorkspaceBackend.listTyped(absDir)` returning `{ path, type }` entries (type `WorkspaceBackendDirEntry`); the local backend implements it. Backends without it keep working through `list` plus `stat`.
14
+
15
+ - `hooks.onShellOutput({ callId?, jobId?, command, stream, chunk })` streams `run_shell` output while the command runs, for foreground commands and background jobs (a job's events carry its `jobId` and continue after `run_shell` returns). Chunks are decoded, ordered per stream and delivered at most about 20 times a second; a throwing hook is ignored and the tool result (truncation, spilling) is unchanged. `hooks.redactShellOutput(text)` masks secrets: output is buffered to whole lines before it is redacted so a secret split across reads is found, and `shell.env` values of eight or more characters are masked automatically. `ExecOptions.callId` is echoed on a foreground command's events, `WorkspaceBackendExecOptions.onOutput` lets a backend stream (the local backend does; others deliver the whole capture at the end), and the new type `WorkspaceShellOutputEvent` is exported.
16
+
17
+ ### Changed
18
+
19
+ - `glob` and `grep` no longer search `node_modules`, `.git` or gitignored paths by default. Set `search.skipDirs: [".git"]` to search `node_modules` again and `search.gitignore: false` to search ignored files; a pattern that names a skipped folder in its static prefix (`node_modules/pkg/*.json`) still searches it.
20
+
21
+ - Under bash on Windows, a command line with an unquoted backslash before a letter, digit or dot inside a word (`cd ab\terra4\client`) is refused with `reason: "unsupported-syntax"` and a message showing the forward-slash form (`ab/terra4/client`), because bash reads the backslashes as escapes and runs a different path. Quoted paths and escaped spaces pass; bash on Linux and macOS is unchanged. `run_shell`'s description states the forward-slash rule for bash on Windows. `checkShellCommand` takes an optional `platform` option.
22
+
23
+ ### Fixed
24
+
25
+ - `glob` and `grep` timed out on large workspaces because they listed every folder (including `node_modules` and `.git`) before matching, listed each entry a second time to tell files from folders, read all folders at once and ignored the run's `signal`. They now start at the pattern's static folder prefix (and at `grep`'s `glob` folder), drop `denyPaths`, skipped and gitignored folders before listing them, read folders with their types in one call, read 16 folders at a time and stop when the signal aborts. The jail, `denyPaths` and symlink rules are unchanged (symlinked folders are never followed).
26
+
7
27
  ## 5.45.0 - 2026-11-05
8
28
 
9
29
  ### Added
package/README.md CHANGED
@@ -158,6 +158,8 @@ for (const file of await ws.glob("src/models/**/*.ts")) {
158
158
  unique, and a miss returns a `hint` with the closest text.
159
159
  - **`hooks.afterEdit`** — runs after a write and returns compiler or linter output as
160
160
  `diagnostics` on the result; a throw or timeout never fails the edit.
161
+ - **`hooks.onShellOutput`** — live `run_shell` output (foreground and background), throttled,
162
+ line-buffered so `hooks.redactShellOutput` sees whole lines; never changes the result.
161
163
  - **`output.spillDir`** — oversized `run_shell`, `shell_output`, `grep`, `glob` and
162
164
  `read_file` output is saved to a file; the result keeps head and tail plus a pointer.
163
165
  - **Bounded reads** — `read.maxBytes` caps the UTF-8 bytes a read returns (line