@warlock.js/ai-workspace 5.29.0 → 5.31.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 +68 -0
- package/README.md +40 -21
- package/cjs/index.cjs +3295 -360
- 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 +199 -31
- package/esm/backends/local.mjs.map +1 -1
- package/esm/backends/mock.d.mts +12 -6
- package/esm/backends/mock.d.mts.map +1 -1
- package/esm/backends/mock.mjs +45 -3
- package/esm/backends/mock.mjs.map +1 -1
- package/esm/contracts/index.d.mts +3 -3
- package/esm/contracts/tool-io.type.d.mts +248 -11
- package/esm/contracts/tool-io.type.d.mts.map +1 -1
- package/esm/contracts/workspace-backend.contract.d.mts +78 -2
- package/esm/contracts/workspace-backend.contract.d.mts.map +1 -1
- package/esm/contracts/workspace-ops.contract.d.mts +41 -16
- package/esm/contracts/workspace-ops.contract.d.mts.map +1 -1
- package/esm/contracts/workspace-policy.type.d.mts +142 -14
- package/esm/contracts/workspace-policy.type.d.mts.map +1 -1
- package/esm/contracts/workspace.contract.d.mts +75 -22
- package/esm/contracts/workspace.contract.d.mts.map +1 -1
- package/esm/errors.d.mts +80 -6
- package/esm/errors.d.mts.map +1 -1
- package/esm/errors.mjs +23 -2
- package/esm/errors.mjs.map +1 -1
- package/esm/index.d.mts +13 -5
- package/esm/index.mjs +10 -2
- package/esm/ops.d.mts +22 -3
- package/esm/ops.d.mts.map +1 -1
- package/esm/ops.mjs +341 -82
- package/esm/ops.mjs.map +1 -1
- package/esm/policy/jail.mjs +73 -0
- package/esm/policy/jail.mjs.map +1 -0
- package/esm/policy/policy.d.mts +26 -16
- package/esm/policy/policy.d.mts.map +1 -1
- package/esm/policy/policy.mjs +62 -86
- package/esm/policy/policy.mjs.map +1 -1
- package/esm/policy/shell-check.d.mts +64 -0
- package/esm/policy/shell-check.d.mts.map +1 -0
- package/esm/policy/shell-check.mjs +627 -0
- package/esm/policy/shell-check.mjs.map +1 -0
- package/esm/policy/shell-parser.mjs +802 -0
- package/esm/policy/shell-parser.mjs.map +1 -0
- package/esm/policy/tokenize-command.d.mts +63 -0
- package/esm/policy/tokenize-command.d.mts.map +1 -0
- package/esm/policy/tokenize-command.mjs +76 -24
- package/esm/policy/tokenize-command.mjs.map +1 -1
- package/esm/shell-jobs.d.mts +45 -0
- package/esm/shell-jobs.d.mts.map +1 -0
- package/esm/shell-jobs.mjs +247 -0
- package/esm/shell-jobs.mjs.map +1 -0
- package/esm/todos.d.mts +22 -0
- package/esm/todos.d.mts.map +1 -0
- package/esm/todos.mjs +73 -0
- package/esm/todos.mjs.map +1 -0
- 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 +3 -2
- 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 +3 -2
- 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 +3 -2
- package/esm/tools/grep.mjs.map +1 -1
- package/esm/tools/json-schemas.mjs +175 -0
- package/esm/tools/json-schemas.mjs.map +1 -0
- package/esm/tools/list-dir.d.mts +32 -0
- package/esm/tools/list-dir.d.mts.map +1 -0
- package/esm/tools/list-dir.mjs +50 -0
- package/esm/tools/list-dir.mjs.map +1 -0
- package/esm/tools/multi-edit.d.mts +38 -0
- package/esm/tools/multi-edit.d.mts.map +1 -0
- package/esm/tools/multi-edit.mjs +121 -0
- package/esm/tools/multi-edit.mjs.map +1 -0
- package/esm/tools/read-file.d.mts +5 -5
- package/esm/tools/read-file.d.mts.map +1 -1
- package/esm/tools/read-file.mjs +10 -20
- package/esm/tools/read-file.mjs.map +1 -1
- package/esm/tools/run-shell.d.mts +39 -13
- package/esm/tools/run-shell.d.mts.map +1 -1
- package/esm/tools/run-shell.mjs +60 -47
- package/esm/tools/run-shell.mjs.map +1 -1
- package/esm/tools/run-tests.d.mts +11 -2
- package/esm/tools/run-tests.d.mts.map +1 -1
- package/esm/tools/run-tests.mjs +15 -7
- package/esm/tools/run-tests.mjs.map +1 -1
- package/esm/tools/schema.mjs +24 -19
- package/esm/tools/schema.mjs.map +1 -1
- package/esm/tools/shell-kill.d.mts +25 -0
- package/esm/tools/shell-kill.d.mts.map +1 -0
- package/esm/tools/shell-kill.mjs +36 -0
- package/esm/tools/shell-kill.mjs.map +1 -0
- package/esm/tools/shell-output.d.mts +30 -0
- package/esm/tools/shell-output.d.mts.map +1 -0
- package/esm/tools/shell-output.mjs +49 -0
- package/esm/tools/shell-output.mjs.map +1 -0
- package/esm/tools/todo.d.mts +43 -0
- package/esm/tools/todo.d.mts.map +1 -0
- package/esm/tools/todo.mjs +126 -0
- package/esm/tools/todo.mjs.map +1 -0
- 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 +3 -2
- package/esm/tools/write-file.mjs.map +1 -1
- package/esm/workspace.d.mts +12 -9
- package/esm/workspace.d.mts.map +1 -1
- package/esm/workspace.mjs +109 -28
- package/esm/workspace.mjs.map +1 -1
- package/llms-full.txt +192 -35
- package/llms.txt +1 -1
- package/package.json +5 -4
- package/skills/README.md +2 -2
- package/skills/build-loop-agent/SKILL.md +7 -7
- package/skills/index.md +6 -1
- package/skills/use-a-workspace/SKILL.md +185 -28
package/esm/index.d.mts
CHANGED
|
@@ -1,20 +1,28 @@
|
|
|
1
|
-
import { EditFileInput, EditFileResult, GlobInput, GlobResult, GrepInput, GrepMatch, GrepResult, ReadFileInput, ReadFileResult, RunShellInput, RunShellResult, RunTestsInput, WorkspaceToolName, WriteFileInput, WriteFileResult } from "./contracts/tool-io.type.mjs";
|
|
2
|
-
import {
|
|
1
|
+
import { EditFileInput, EditFileResult, ExecOptions, GlobInput, GlobResult, GrepInput, GrepMatch, GrepResult, ListDirEntry, ListDirEntryType, ListDirInput, ListDirOptions, ListDirResult, MultiEditInput, MultiEditOperation, MultiEditResult, ReadFileInput, ReadFileResult, RunShellBackgroundResult, RunShellInput, RunShellResult, RunTestsInput, ShellJobInfo, ShellJobStatus, ShellKillInput, ShellOutputInput, ShellOutputOptions, ShellOutputResult, StartShellOptions, TodoListResult, TodoWriteInput, WorkspaceTodo, WorkspaceTodoInput, WorkspaceTodoStatus, WorkspaceToolName, WriteFileInput, WriteFileResult } from "./contracts/tool-io.type.mjs";
|
|
2
|
+
import { WorkspaceAllowCommand, WorkspaceBackendType, WorkspaceBackgroundPolicy, WorkspaceCommandCheckContext, WorkspaceCommandPattern, WorkspaceListPolicy, WorkspacePolicy, WorkspaceReadPolicy, WorkspaceShellInterpreter, WorkspaceShellPolicy } from "./contracts/workspace-policy.type.mjs";
|
|
3
|
+
import { WorkspaceBackend, WorkspaceBackendExecOptions, WorkspaceBackendExecResult, WorkspaceBackendProcess, WorkspaceBackendStartOptions, WorkspaceBackendStat, WorkspaceOutputStream } from "./contracts/workspace-backend.contract.mjs";
|
|
3
4
|
import { WorkspaceOps } from "./contracts/workspace-ops.contract.mjs";
|
|
4
|
-
import { WorkspaceBackendType, WorkspacePolicy, WorkspaceReadPolicy, WorkspaceShellPolicy } from "./contracts/workspace-policy.type.mjs";
|
|
5
5
|
import { Workspace, WorkspaceTools } from "./contracts/workspace.contract.mjs";
|
|
6
|
-
import { WorkspaceEditError, WorkspaceEditErrorOptions, WorkspaceEditFailure, WorkspacePolicyError, WorkspacePolicyErrorOptions, WorkspacePolicyViolation } from "./errors.mjs";
|
|
6
|
+
import { WorkspaceEditError, WorkspaceEditErrorOptions, WorkspaceEditFailure, WorkspaceJobError, WorkspaceJobErrorOptions, WorkspaceJobFailure, WorkspacePolicyError, WorkspacePolicyErrorOptions, WorkspacePolicyViolation, WorkspaceShellRefusalReason } from "./errors.mjs";
|
|
7
7
|
import { ResolvedPath, buildEnv, isCommandAllowed, resolveInJail } from "./policy/policy.mjs";
|
|
8
|
+
import { WorkspaceShellCheck, WorkspaceShellPath, WorkspaceShellPathAccess, checkShellCommand } from "./policy/shell-check.mjs";
|
|
9
|
+
import { ArgvAnalysis, analyzeArgvCommand, tokenizeCommand } from "./policy/tokenize-command.mjs";
|
|
8
10
|
import { createOps } from "./ops.mjs";
|
|
9
11
|
import { createLocalBackend } from "./backends/local.mjs";
|
|
10
12
|
import { MockBackendSeed, MockExecResult, createMockBackend } from "./backends/mock.mjs";
|
|
11
13
|
import { makeEditFileTool } from "./tools/edit-file.mjs";
|
|
12
14
|
import { MakeGlobToolOptions, makeGlobTool } from "./tools/glob.mjs";
|
|
13
15
|
import { MakeGrepToolOptions, makeGrepTool } from "./tools/grep.mjs";
|
|
16
|
+
import { makeListDirTool } from "./tools/list-dir.mjs";
|
|
17
|
+
import { makeMultiEditTool } from "./tools/multi-edit.mjs";
|
|
14
18
|
import { makeReadFileTool } from "./tools/read-file.mjs";
|
|
15
19
|
import { MakeRunShellToolOptions, makeRunShellTool } from "./tools/run-shell.mjs";
|
|
16
20
|
import { MakeRunTestsToolOptions, makeRunTestsTool } from "./tools/run-tests.mjs";
|
|
21
|
+
import { makeShellKillTool } from "./tools/shell-kill.mjs";
|
|
22
|
+
import { makeShellOutputTool } from "./tools/shell-output.mjs";
|
|
23
|
+
import { TodoStore } from "./todos.mjs";
|
|
24
|
+
import { makeTodoReadTool, makeTodoWriteTool } from "./tools/todo.mjs";
|
|
17
25
|
import { makeWriteFileTool } from "./tools/write-file.mjs";
|
|
18
26
|
import { workspace } from "./workspace.mjs";
|
|
19
|
-
export { type EditFileInput, type EditFileResult, type GlobInput, type GlobResult, type GrepInput, type GrepMatch, type GrepResult, type MakeGlobToolOptions, type MakeGrepToolOptions, type MakeRunShellToolOptions, type MakeRunTestsToolOptions, type MockBackendSeed, type MockExecResult, type ReadFileInput, type ReadFileResult, type ResolvedPath, type RunShellInput, type RunShellResult, type RunTestsInput, type Workspace, type WorkspaceBackend, type WorkspaceBackendExecOptions, type WorkspaceBackendExecResult, type WorkspaceBackendType, WorkspaceEditError, type WorkspaceEditErrorOptions, type WorkspaceEditFailure, type WorkspaceOps, type WorkspacePolicy, WorkspacePolicyError, type WorkspacePolicyErrorOptions, type WorkspacePolicyViolation, type WorkspaceReadPolicy, type WorkspaceShellPolicy, type WorkspaceToolName, type WorkspaceTools, type WriteFileInput, type WriteFileResult, buildEnv, createLocalBackend, createMockBackend, createOps, isCommandAllowed, makeEditFileTool, makeGlobTool, makeGrepTool, makeReadFileTool, makeRunShellTool, makeRunTestsTool, makeWriteFileTool, resolveInJail, workspace };
|
|
27
|
+
export { type ArgvAnalysis, type EditFileInput, type EditFileResult, type ExecOptions, type GlobInput, type GlobResult, type GrepInput, type GrepMatch, type GrepResult, type ListDirEntry, type ListDirEntryType, type ListDirInput, type ListDirOptions, type ListDirResult, type MakeGlobToolOptions, type MakeGrepToolOptions, type MakeRunShellToolOptions, type MakeRunTestsToolOptions, type MockBackendSeed, type MockExecResult, type MultiEditInput, type MultiEditOperation, type MultiEditResult, type ReadFileInput, type ReadFileResult, type ResolvedPath, type RunShellBackgroundResult, type RunShellInput, type RunShellResult, type RunTestsInput, type ShellJobInfo, type ShellJobStatus, type ShellKillInput, type ShellOutputInput, type ShellOutputOptions, type ShellOutputResult, type StartShellOptions, type TodoListResult, TodoStore, type TodoWriteInput, type Workspace, type WorkspaceAllowCommand, type WorkspaceBackend, type WorkspaceBackendExecOptions, type WorkspaceBackendExecResult, type WorkspaceBackendProcess, type WorkspaceBackendStartOptions, type WorkspaceBackendStat, type WorkspaceBackendType, type WorkspaceBackgroundPolicy, type WorkspaceCommandCheckContext, type WorkspaceCommandPattern, WorkspaceEditError, type WorkspaceEditErrorOptions, type WorkspaceEditFailure, WorkspaceJobError, type WorkspaceJobErrorOptions, type WorkspaceJobFailure, type WorkspaceListPolicy, type WorkspaceOps, type WorkspaceOutputStream, type WorkspacePolicy, WorkspacePolicyError, type WorkspacePolicyErrorOptions, type WorkspacePolicyViolation, type WorkspaceReadPolicy, type WorkspaceShellCheck, type WorkspaceShellInterpreter, type WorkspaceShellPath, type WorkspaceShellPathAccess, type WorkspaceShellPolicy, type WorkspaceShellRefusalReason, type WorkspaceTodo, type WorkspaceTodoInput, type WorkspaceTodoStatus, type WorkspaceToolName, type WorkspaceTools, type WriteFileInput, type WriteFileResult, analyzeArgvCommand, buildEnv, checkShellCommand, createLocalBackend, createMockBackend, createOps, isCommandAllowed, makeEditFileTool, makeGlobTool, makeGrepTool, makeListDirTool, makeMultiEditTool, makeReadFileTool, makeRunShellTool, makeRunTestsTool, makeShellKillTool, makeShellOutputTool, makeTodoReadTool, makeTodoWriteTool, makeWriteFileTool, resolveInJail, tokenizeCommand, workspace };
|
|
20
28
|
import "./workspace.mjs";
|
package/esm/index.mjs
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
import { WorkspaceEditError, WorkspacePolicyError } from "./errors.mjs";
|
|
1
|
+
import { WorkspaceEditError, WorkspaceJobError, WorkspacePolicyError } from "./errors.mjs";
|
|
2
|
+
import { analyzeArgvCommand, tokenizeCommand } from "./policy/tokenize-command.mjs";
|
|
3
|
+
import { checkShellCommand } from "./policy/shell-check.mjs";
|
|
2
4
|
import { buildEnv, isCommandAllowed, resolveInJail } from "./policy/policy.mjs";
|
|
3
5
|
import { createOps } from "./ops.mjs";
|
|
4
6
|
import { createLocalBackend } from "./backends/local.mjs";
|
|
@@ -6,10 +8,16 @@ import { createMockBackend } from "./backends/mock.mjs";
|
|
|
6
8
|
import { makeEditFileTool } from "./tools/edit-file.mjs";
|
|
7
9
|
import { makeGlobTool } from "./tools/glob.mjs";
|
|
8
10
|
import { makeGrepTool } from "./tools/grep.mjs";
|
|
11
|
+
import { makeListDirTool } from "./tools/list-dir.mjs";
|
|
12
|
+
import { makeMultiEditTool } from "./tools/multi-edit.mjs";
|
|
9
13
|
import { makeReadFileTool } from "./tools/read-file.mjs";
|
|
10
14
|
import { makeRunShellTool } from "./tools/run-shell.mjs";
|
|
11
15
|
import { makeRunTestsTool } from "./tools/run-tests.mjs";
|
|
16
|
+
import { makeShellKillTool } from "./tools/shell-kill.mjs";
|
|
17
|
+
import { makeShellOutputTool } from "./tools/shell-output.mjs";
|
|
18
|
+
import { TodoStore } from "./todos.mjs";
|
|
19
|
+
import { makeTodoReadTool, makeTodoWriteTool } from "./tools/todo.mjs";
|
|
12
20
|
import { makeWriteFileTool } from "./tools/write-file.mjs";
|
|
13
21
|
import { workspace } from "./workspace.mjs";
|
|
14
22
|
|
|
15
|
-
export { WorkspaceEditError, WorkspacePolicyError, buildEnv, createLocalBackend, createMockBackend, createOps, isCommandAllowed, makeEditFileTool, makeGlobTool, makeGrepTool, makeReadFileTool, makeRunShellTool, makeRunTestsTool, makeWriteFileTool, resolveInJail, workspace };
|
|
23
|
+
export { TodoStore, WorkspaceEditError, WorkspaceJobError, WorkspacePolicyError, analyzeArgvCommand, buildEnv, checkShellCommand, createLocalBackend, createMockBackend, createOps, isCommandAllowed, makeEditFileTool, makeGlobTool, makeGrepTool, makeListDirTool, makeMultiEditTool, makeReadFileTool, makeRunShellTool, makeRunTestsTool, makeShellKillTool, makeShellOutputTool, makeTodoReadTool, makeTodoWriteTool, makeWriteFileTool, resolveInJail, tokenizeCommand, workspace };
|
package/esm/ops.d.mts
CHANGED
|
@@ -1,7 +1,24 @@
|
|
|
1
|
+
import { WorkspacePolicy } from "./contracts/workspace-policy.type.mjs";
|
|
1
2
|
import { WorkspaceBackend } from "./contracts/workspace-backend.contract.mjs";
|
|
2
3
|
import { WorkspaceOps } from "./contracts/workspace-ops.contract.mjs";
|
|
3
|
-
import {
|
|
4
|
-
|
|
4
|
+
import { ShellJobs } from "./shell-jobs.mjs";
|
|
5
|
+
|
|
6
|
+
//#region ../../packages/ai-workspace/src/ops.d.ts
|
|
7
|
+
/**
|
|
8
|
+
* The internal, single-instance implementation of {@link WorkspaceOps}.
|
|
9
|
+
* Holds the backend + policy and is the one place the jail, command
|
|
10
|
+
* gating, read caps, and the read-before-edit guard are enforced — both
|
|
11
|
+
* the agent-facing tools and the human-facing direct methods funnel
|
|
12
|
+
* through this object, so there is exactly one set of rules.
|
|
13
|
+
*/
|
|
14
|
+
/**
|
|
15
|
+
* State an ops layer shares with the other projections of the same
|
|
16
|
+
* workspace (`readonly()`, `scope()`): the background commands it owns.
|
|
17
|
+
*/
|
|
18
|
+
interface OpsRuntime {
|
|
19
|
+
/** The workspace's background commands. */
|
|
20
|
+
jobs: ShellJobs;
|
|
21
|
+
}
|
|
5
22
|
/**
|
|
6
23
|
* Create the policy-enforced operation layer over a backend.
|
|
7
24
|
*
|
|
@@ -14,12 +31,14 @@ import { WorkspacePolicy } from "./contracts/workspace-policy.type.mjs";
|
|
|
14
31
|
*
|
|
15
32
|
* @param backend - The dumb IO executor (local disk or in-memory mock).
|
|
16
33
|
* @param policy - The policy that bounds every operation.
|
|
34
|
+
* @param runtime - State shared with other views of the same workspace
|
|
35
|
+
* (its background commands); a fresh one when omitted.
|
|
17
36
|
*
|
|
18
37
|
* @example
|
|
19
38
|
* const ops = createOps(localBackend, { cwd: "/srv/api", shell: { allow: ["npm"] } });
|
|
20
39
|
* const { content, hash } = await ops.readFile("src/index.ts");
|
|
21
40
|
*/
|
|
22
|
-
declare function createOps(backend: WorkspaceBackend, policy: WorkspacePolicy): WorkspaceOps;
|
|
41
|
+
declare function createOps(backend: WorkspaceBackend, policy: WorkspacePolicy, runtime?: OpsRuntime): WorkspaceOps;
|
|
23
42
|
//#endregion
|
|
24
43
|
export { createOps };
|
|
25
44
|
//# sourceMappingURL=ops.d.mts.map
|
package/esm/ops.d.mts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ops.d.mts","names":[],"sources":["
|
|
1
|
+
{"version":3,"file":"ops.d.mts","names":[],"sources":["../../../../../../../packages/ai-workspace/src/ops.ts"],"mappings":";;;;;;;;;AA8LA;;;;AAEiB;AAitBjB;;;AAjtBiB,UAFA,UAAA;EAqtBP;EAntBR,IAAA,EAAM,SAAS;AAAA;;;;;;;;;;;AAqtBF;;;;;;;;;iBAJC,SAAA,CACd,OAAA,EAAS,gBAAA,EACT,MAAA,EAAQ,eAAA,EACR,OAAA,GAAU,UAAA,GACT,YAAA"}
|