qlogicagent 0.5.2 → 0.5.3
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/README.md +402 -402
- package/dist/agent.js +18 -0
- package/dist/cli.js +360 -0
- package/dist/contracts.js +1 -0
- package/dist/index.js +22 -0
- package/dist/orchestration.js +125 -0
- package/dist/types/agent/agent.d.ts +43 -0
- package/dist/types/agent/constants.d.ts +47 -0
- package/dist/types/agent/tool-loop.d.ts +96 -0
- package/dist/types/agent/types.d.ts +250 -0
- package/dist/types/cli/main.d.ts +11 -0
- package/dist/types/cli/stdio-server.d.ts +56 -0
- package/dist/types/cli/tool-bootstrap.d.ts +21 -0
- package/dist/types/config/config.d.ts +17 -0
- package/dist/types/contracts/hooks.d.ts +175 -0
- package/dist/types/contracts/index.d.ts +10 -0
- package/dist/types/contracts/planner.d.ts +35 -0
- package/dist/types/contracts/skill-candidate.d.ts +63 -0
- package/dist/types/contracts/todo.d.ts +14 -0
- package/dist/types/index.d.ts +13 -0
- package/dist/types/llm/builtin-providers.d.ts +10 -0
- package/dist/types/llm/debug-transport.d.ts +12 -0
- package/dist/types/llm/index.d.ts +16 -0
- package/dist/types/llm/llm-client.d.ts +43 -0
- package/dist/types/llm/model-catalog.d.ts +53 -0
- package/dist/types/llm/provider-def.d.ts +59 -0
- package/dist/types/llm/provider-registry.d.ts +54 -0
- package/dist/types/llm/transport.d.ts +62 -0
- package/dist/types/llm/transports/anthropic-messages.d.ts +31 -0
- package/dist/types/llm/transports/openai-chat.d.ts +36 -0
- package/dist/types/orchestration/agent-registry.d.ts +46 -0
- package/dist/types/orchestration/context-collapse.d.ts +58 -0
- package/dist/types/orchestration/context-compression.d.ts +301 -0
- package/dist/types/orchestration/conversation-repair.d.ts +61 -0
- package/dist/types/orchestration/curator-scheduler.d.ts +119 -0
- package/dist/types/orchestration/error-classification.d.ts +12 -0
- package/dist/types/orchestration/failover-classification.d.ts +8 -0
- package/dist/types/orchestration/failover-error.d.ts +33 -0
- package/dist/types/orchestration/fork-subagent.d.ts +100 -0
- package/dist/types/orchestration/index.d.ts +113 -0
- package/dist/types/orchestration/memory-provider.d.ts +14 -0
- package/dist/types/orchestration/reactive-compact.d.ts +73 -0
- package/dist/types/orchestration/retry-loop.d.ts +69 -0
- package/dist/types/orchestration/skill-candidate.d.ts +52 -0
- package/dist/types/orchestration/skill-consolidation.d.ts +123 -0
- package/dist/types/orchestration/skill-improvement.d.ts +59 -0
- package/dist/types/orchestration/skill-similarity.d.ts +98 -0
- package/dist/types/orchestration/task-types.d.ts +142 -0
- package/dist/types/orchestration/team-orchestration.d.ts +195 -0
- package/dist/types/orchestration/team-tool-loop-wiring.d.ts +92 -0
- package/dist/types/orchestration/tool-choice-policy.d.ts +54 -0
- package/dist/types/orchestration/tool-loop-state.d.ts +50 -0
- package/dist/types/orchestration/tool-schema.d.ts +39 -0
- package/dist/types/orchestration/turn-loop-guard.d.ts +86 -0
- package/dist/types/runtime/execution/dream-agent.d.ts +199 -0
- package/dist/types/runtime/execution/forked-agent.d.ts +111 -0
- package/dist/types/runtime/execution/index.d.ts +6 -0
- package/dist/types/runtime/execution/progress-tracker.d.ts +78 -0
- package/dist/types/runtime/execution/remote-agent.d.ts +63 -0
- package/dist/types/runtime/execution/streaming-tool-executor.d.ts +100 -0
- package/dist/types/runtime/execution/tool-eligibility.d.ts +59 -0
- package/dist/types/runtime/execution/tool-result-storage.d.ts +87 -0
- package/dist/types/runtime/hooks/context-compression.d.ts +61 -0
- package/dist/types/runtime/hooks/hook-registry.d.ts +12 -0
- package/dist/types/runtime/hooks/index.d.ts +3 -0
- package/dist/types/runtime/hooks/memory-hooks.d.ts +49 -0
- package/dist/types/runtime/index.d.ts +5 -0
- package/dist/types/runtime/infra/cleanup-registry.d.ts +23 -0
- package/dist/types/runtime/infra/file-watcher.d.ts +72 -0
- package/dist/types/runtime/infra/index.d.ts +6 -0
- package/dist/types/runtime/infra/secure-storage.d.ts +81 -0
- package/dist/types/runtime/infra/task-runtime.d.ts +108 -0
- package/dist/types/runtime/infra/token-budget.d.ts +92 -0
- package/dist/types/runtime/infra/worktree-backend.d.ts +85 -0
- package/dist/types/runtime/prompt/environment-context.d.ts +23 -0
- package/dist/types/runtime/prompt/index.d.ts +3 -0
- package/dist/types/runtime/prompt/instruction-loader.d.ts +64 -0
- package/dist/types/runtime/prompt/system-prompt-sections.d.ts +63 -0
- package/dist/types/runtime/session/index.d.ts +2 -0
- package/dist/types/runtime/session/session-memory.d.ts +91 -0
- package/dist/types/runtime/session/session-persistence.d.ts +94 -0
- package/dist/types/runtime/session/session-state.d.ts +117 -0
- package/dist/types/skills/index.d.ts +125 -0
- package/dist/types/skills/mcp/index.d.ts +3 -0
- package/dist/types/skills/mcp/mcp-http-client.d.ts +66 -0
- package/dist/types/skills/mcp/mcp-manager.d.ts +84 -0
- package/dist/types/skills/mcp/mcp-stdio-client.d.ts +84 -0
- package/dist/types/skills/memory-extractor.d.ts +64 -0
- package/dist/types/skills/memory-query-tool.d.ts +43 -0
- package/dist/types/skills/memory-store.d.ts +66 -0
- package/dist/types/skills/memory-tool.d.ts +67 -0
- package/dist/types/skills/permissions/bash-classifier.d.ts +30 -0
- package/dist/types/skills/permissions/classifier-cache.d.ts +51 -0
- package/dist/types/skills/permissions/denial-tracking.d.ts +42 -0
- package/dist/types/skills/permissions/hook-runner.d.ts +85 -0
- package/dist/types/skills/permissions/index.d.ts +12 -0
- package/dist/types/skills/permissions/permission-classifier.d.ts +41 -0
- package/dist/types/skills/permissions/rule-engine.d.ts +41 -0
- package/dist/types/skills/permissions/settings-watcher.d.ts +46 -0
- package/dist/types/skills/permissions/types.d.ts +113 -0
- package/dist/types/skills/plugins/index.d.ts +2 -0
- package/dist/types/skills/plugins/plugin-api.d.ts +38 -0
- package/dist/types/skills/plugins/plugin-loader.d.ts +45 -0
- package/dist/types/skills/plugins/plugin-marketplace.d.ts +61 -0
- package/dist/types/skills/portable-tool.d.ts +71 -0
- package/dist/types/skills/qmemory-adapter.d.ts +42 -0
- package/dist/types/skills/skill-frontmatter.d.ts +19 -0
- package/dist/types/skills/skill-guard.d.ts +23 -0
- package/dist/types/skills/skill-loader.d.ts +16 -0
- package/dist/types/skills/skill-source.d.ts +119 -0
- package/dist/types/skills/skill-types.d.ts +199 -0
- package/dist/types/skills/think-tool.d.ts +16 -0
- package/dist/types/skills/todo-tool.d.ts +63 -0
- package/dist/types/skills/tool-registry.d.ts +29 -0
- package/dist/types/skills/tools/agent-tool.d.ts +91 -0
- package/dist/types/skills/tools/apply-patch-tool.d.ts +29 -0
- package/dist/types/skills/tools/ask-user-tool.d.ts +80 -0
- package/dist/types/skills/tools/brief-tool.d.ts +74 -0
- package/dist/types/skills/tools/browser-tool.d.ts +114 -0
- package/dist/types/skills/tools/checkpoint-tool.d.ts +66 -0
- package/dist/types/skills/tools/config-tool.d.ts +63 -0
- package/dist/types/skills/tools/cron-tool.d.ts +116 -0
- package/dist/types/skills/tools/edit-tool.d.ts +43 -0
- package/dist/types/skills/tools/exec-tool.d.ts +97 -0
- package/dist/types/skills/tools/image-generate-tool.d.ts +62 -0
- package/dist/types/skills/tools/instructions-tool.d.ts +103 -0
- package/dist/types/skills/tools/lsp-tool.d.ts +153 -0
- package/dist/types/skills/tools/mcp-client-types.d.ts +269 -0
- package/dist/types/skills/tools/mcp-resource-tools.d.ts +14 -0
- package/dist/types/skills/tools/mcp-tool.d.ts +249 -0
- package/dist/types/skills/tools/memory-tool.d.ts +74 -0
- package/dist/types/skills/tools/monitor-tool.d.ts +113 -0
- package/dist/types/skills/tools/music-generate-tool.d.ts +55 -0
- package/dist/types/skills/tools/notebook-edit-tool.d.ts +15 -0
- package/dist/types/skills/tools/notify-tool.d.ts +53 -0
- package/dist/types/skills/tools/patch-tool.d.ts +45 -0
- package/dist/types/skills/tools/pdf-tool.d.ts +66 -0
- package/dist/types/skills/tools/plan-mode-tool.d.ts +98 -0
- package/dist/types/skills/tools/read-tool.d.ts +51 -0
- package/dist/types/skills/tools/repl-tool.d.ts +70 -0
- package/dist/types/skills/tools/search-tool.d.ts +112 -0
- package/dist/types/skills/tools/send-message-tool.d.ts +51 -0
- package/dist/types/skills/tools/shell/bash-provider.d.ts +26 -0
- package/dist/types/skills/tools/shell/command-classification.d.ts +44 -0
- package/dist/types/skills/tools/shell/command-semantics.d.ts +14 -0
- package/dist/types/skills/tools/shell/destructive-command-warning.d.ts +10 -0
- package/dist/types/skills/tools/shell/exec-permissions.d.ts +52 -0
- package/dist/types/skills/tools/shell/index.d.ts +17 -0
- package/dist/types/skills/tools/shell/powershell-provider.d.ts +15 -0
- package/dist/types/skills/tools/shell/shell-command.d.ts +54 -0
- package/dist/types/skills/tools/shell/shell-exec.d.ts +33 -0
- package/dist/types/skills/tools/shell/shell-provider.d.ts +85 -0
- package/dist/types/skills/tools/shell/task-output.d.ts +45 -0
- package/dist/types/skills/tools/skill-invoke-tool.d.ts +46 -0
- package/dist/types/skills/tools/skill-list-tool.d.ts +33 -0
- package/dist/types/skills/tools/skill-manage-tool.d.ts +73 -0
- package/dist/types/skills/tools/skill-view-tool.d.ts +37 -0
- package/dist/types/skills/tools/sleep-tool.d.ts +49 -0
- package/dist/types/skills/tools/structured-output-tool.d.ts +116 -0
- package/dist/types/skills/tools/task-tool.d.ts +104 -0
- package/dist/types/skills/tools/team-tool.d.ts +89 -0
- package/dist/types/skills/tools/tool-search-tool.d.ts +51 -0
- package/dist/types/skills/tools/tts-tool.d.ts +38 -0
- package/dist/types/skills/tools/video-edit-tool.d.ts +69 -0
- package/dist/types/skills/tools/video-generate-tool.d.ts +62 -0
- package/dist/types/skills/tools/video-merge-tool.d.ts +105 -0
- package/dist/types/skills/tools/video-upscale-tool.d.ts +45 -0
- package/dist/types/skills/tools/web-fetch-tool.d.ts +78 -0
- package/dist/types/skills/tools/web-search-tool.d.ts +57 -0
- package/dist/types/skills/tools/workflow-tool.d.ts +44 -0
- package/dist/types/skills/tools/worktree-tool.d.ts +69 -0
- package/dist/types/skills/tools/write-tool.d.ts +45 -0
- package/package.json +3 -2
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
import type { PortableTool } from "../portable-tool.js";
|
|
2
|
+
export declare const PLAN_MODE_TOOL_NAME: "plan_mode";
|
|
3
|
+
export type PlanModeAction = "enter" | "exit";
|
|
4
|
+
export interface PlanModeToolParams {
|
|
5
|
+
/** Action: enter or exit plan mode */
|
|
6
|
+
action: PlanModeAction;
|
|
7
|
+
/** Plan text (for exit — the finalized plan to present for approval) */
|
|
8
|
+
plan?: string;
|
|
9
|
+
/** File path where plan was saved (optional) */
|
|
10
|
+
planFilePath?: string;
|
|
11
|
+
/**
|
|
12
|
+
* Semantic permissions to request on exit (CC ExitPlanModeV2 parity).
|
|
13
|
+
* Each entry describes a tool + intent the agent wants permission for.
|
|
14
|
+
*/
|
|
15
|
+
allowedPrompts?: Array<{
|
|
16
|
+
tool: string;
|
|
17
|
+
prompt: string;
|
|
18
|
+
}>;
|
|
19
|
+
}
|
|
20
|
+
export declare const PLAN_MODE_TOOL_SCHEMA: {
|
|
21
|
+
readonly type: "object";
|
|
22
|
+
readonly properties: {
|
|
23
|
+
readonly action: {
|
|
24
|
+
readonly type: "string";
|
|
25
|
+
readonly enum: readonly ["enter", "exit"];
|
|
26
|
+
readonly description: string;
|
|
27
|
+
};
|
|
28
|
+
readonly plan: {
|
|
29
|
+
readonly type: "string";
|
|
30
|
+
readonly description: string;
|
|
31
|
+
};
|
|
32
|
+
readonly planFilePath: {
|
|
33
|
+
readonly type: "string";
|
|
34
|
+
readonly description: "Optional file path where the plan was saved for reference.";
|
|
35
|
+
};
|
|
36
|
+
readonly allowedPrompts: {
|
|
37
|
+
readonly type: "array";
|
|
38
|
+
readonly description: string;
|
|
39
|
+
readonly items: {
|
|
40
|
+
readonly type: "object";
|
|
41
|
+
readonly properties: {
|
|
42
|
+
readonly tool: {
|
|
43
|
+
readonly type: "string";
|
|
44
|
+
readonly description: "Tool name to pre-approve.";
|
|
45
|
+
};
|
|
46
|
+
readonly prompt: {
|
|
47
|
+
readonly type: "string";
|
|
48
|
+
readonly description: "Intent description for this permission.";
|
|
49
|
+
};
|
|
50
|
+
};
|
|
51
|
+
readonly required: readonly ["tool", "prompt"];
|
|
52
|
+
};
|
|
53
|
+
};
|
|
54
|
+
};
|
|
55
|
+
readonly required: readonly ["action"];
|
|
56
|
+
};
|
|
57
|
+
/** Tools allowed during plan mode (read-only + reasoning) */
|
|
58
|
+
export declare const PLAN_MODE_ALLOWED_TOOLS: readonly string[];
|
|
59
|
+
export interface PlanModeState {
|
|
60
|
+
active: boolean;
|
|
61
|
+
enteredAt?: string;
|
|
62
|
+
plan?: string;
|
|
63
|
+
planFilePath?: string;
|
|
64
|
+
}
|
|
65
|
+
export interface PlanModeResult {
|
|
66
|
+
success: boolean;
|
|
67
|
+
state: PlanModeState;
|
|
68
|
+
allowedTools?: readonly string[];
|
|
69
|
+
error?: string;
|
|
70
|
+
}
|
|
71
|
+
/**
|
|
72
|
+
* Host-provided plan mode backend.
|
|
73
|
+
* The host is responsible for filtering tool availability based on mode state.
|
|
74
|
+
*/
|
|
75
|
+
export interface PlanModeToolDeps {
|
|
76
|
+
/** Get current plan mode state */
|
|
77
|
+
getState(): PlanModeState;
|
|
78
|
+
/** Enter plan mode — host should restrict tool availability */
|
|
79
|
+
enterPlanMode(): Promise<PlanModeResult>;
|
|
80
|
+
/** Exit plan mode — host restores full tool availability */
|
|
81
|
+
exitPlanMode(plan?: string, planFilePath?: string): Promise<PlanModeResult>;
|
|
82
|
+
/** Check if in agent/sub-agent context (plan mode not allowed in sub-agents) */
|
|
83
|
+
isAgentContext?(): boolean;
|
|
84
|
+
/**
|
|
85
|
+
* Request approval for the plan from the user/coordinator.
|
|
86
|
+
* CC parity: ExitPlanModeV2 triggers an approval dialog on exit.
|
|
87
|
+
* Returns true if approved, false if rejected.
|
|
88
|
+
*/
|
|
89
|
+
requestPlanApproval?(plan: string, allowedPrompts?: Array<{
|
|
90
|
+
tool: string;
|
|
91
|
+
prompt: string;
|
|
92
|
+
}>): Promise<boolean>;
|
|
93
|
+
/**
|
|
94
|
+
* Persist plan to disk (CC parity: plan is saved to planFilePath).
|
|
95
|
+
*/
|
|
96
|
+
persistPlan?(plan: string, filePath: string): Promise<void>;
|
|
97
|
+
}
|
|
98
|
+
export declare function createPlanModeTool(deps: PlanModeToolDeps): PortableTool<PlanModeToolParams>;
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import type { PortableTool } from "../portable-tool.js";
|
|
2
|
+
export declare const READ_TOOL_NAME: "read";
|
|
3
|
+
export interface ReadToolParams {
|
|
4
|
+
path: string;
|
|
5
|
+
offset?: number;
|
|
6
|
+
limit?: number;
|
|
7
|
+
}
|
|
8
|
+
export declare const READ_TOOL_SCHEMA: {
|
|
9
|
+
readonly type: "object";
|
|
10
|
+
readonly properties: {
|
|
11
|
+
readonly path: {
|
|
12
|
+
readonly type: "string";
|
|
13
|
+
readonly description: "Absolute path to the file to read.";
|
|
14
|
+
};
|
|
15
|
+
readonly offset: {
|
|
16
|
+
readonly type: "number";
|
|
17
|
+
readonly description: "Line number to start reading from (1-indexed). Default: 1.";
|
|
18
|
+
};
|
|
19
|
+
readonly limit: {
|
|
20
|
+
readonly type: "number";
|
|
21
|
+
readonly description: "Maximum number of lines to read. Default/max: 2000.";
|
|
22
|
+
};
|
|
23
|
+
};
|
|
24
|
+
readonly required: readonly ["path"];
|
|
25
|
+
};
|
|
26
|
+
export type ReadResultType = "text" | "image" | "binary_rejected";
|
|
27
|
+
/** Deps injected by the host runtime for file reading. */
|
|
28
|
+
export interface ReadToolDeps {
|
|
29
|
+
/** Read file content. Return string for text, base64 for images, or rejection. */
|
|
30
|
+
readFile(path: string): Promise<{
|
|
31
|
+
type: "text";
|
|
32
|
+
text: string;
|
|
33
|
+
} | {
|
|
34
|
+
type: "image";
|
|
35
|
+
base64: string;
|
|
36
|
+
mimeType: string;
|
|
37
|
+
} | {
|
|
38
|
+
type: "binary";
|
|
39
|
+
mimeType: string;
|
|
40
|
+
}>;
|
|
41
|
+
/** Resolve a relative path to absolute. */
|
|
42
|
+
resolvePath(input: string): string;
|
|
43
|
+
/**
|
|
44
|
+
* Validate read access for the given path.
|
|
45
|
+
* Returns null if allowed, or an error message if blocked.
|
|
46
|
+
* Blocks device paths (/dev/zero, /dev/random, etc.) and
|
|
47
|
+
* paths outside the allowed workspace.
|
|
48
|
+
*/
|
|
49
|
+
validatePath?(path: string): string | null;
|
|
50
|
+
}
|
|
51
|
+
export declare function createReadTool(deps: ReadToolDeps): PortableTool<ReadToolParams>;
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import type { PortableTool } from "../portable-tool.js";
|
|
2
|
+
export declare const REPL_TOOL_NAME: "repl";
|
|
3
|
+
export interface ReplToolParams {
|
|
4
|
+
/** JavaScript code to execute in the persistent VM context */
|
|
5
|
+
code: string;
|
|
6
|
+
}
|
|
7
|
+
export declare const REPL_TOOL_SCHEMA: {
|
|
8
|
+
readonly type: "object";
|
|
9
|
+
readonly properties: {
|
|
10
|
+
readonly code: {
|
|
11
|
+
readonly type: "string";
|
|
12
|
+
readonly description: string;
|
|
13
|
+
};
|
|
14
|
+
};
|
|
15
|
+
readonly required: readonly ["code"];
|
|
16
|
+
};
|
|
17
|
+
export interface ReplExecResult {
|
|
18
|
+
output: string;
|
|
19
|
+
error?: string;
|
|
20
|
+
duration: number;
|
|
21
|
+
}
|
|
22
|
+
/** Primitive operations injected into the VM context. */
|
|
23
|
+
export interface ReplPrimitives {
|
|
24
|
+
readFile(path: string): Promise<string>;
|
|
25
|
+
writeFile(path: string, content: string): Promise<void>;
|
|
26
|
+
editFile(path: string, edits: Array<{
|
|
27
|
+
oldText: string;
|
|
28
|
+
newText: string;
|
|
29
|
+
}>): Promise<string>;
|
|
30
|
+
exec(command: string): Promise<{
|
|
31
|
+
stdout: string;
|
|
32
|
+
stderr: string;
|
|
33
|
+
exitCode: number;
|
|
34
|
+
}>;
|
|
35
|
+
glob(pattern: string): Promise<string[]>;
|
|
36
|
+
grep(pattern: string, path?: string): Promise<Array<{
|
|
37
|
+
file: string;
|
|
38
|
+
line: number;
|
|
39
|
+
text: string;
|
|
40
|
+
}>>;
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* Host-provided REPL execution backend.
|
|
44
|
+
*/
|
|
45
|
+
export interface ReplToolDeps {
|
|
46
|
+
/**
|
|
47
|
+
* Execute JavaScript code within a persistent VM context.
|
|
48
|
+
* The VM is pre-initialized with the primitive functions above.
|
|
49
|
+
* Each tool invocation reuses the same VM (preserving variable state).
|
|
50
|
+
*/
|
|
51
|
+
executeInVm(code: string): Promise<ReplExecResult>;
|
|
52
|
+
/**
|
|
53
|
+
* Reset the VM context (clear state). Optional hook called on errors.
|
|
54
|
+
*/
|
|
55
|
+
resetVm?(): void;
|
|
56
|
+
/**
|
|
57
|
+
* The host-provided primitives injected into the VM.
|
|
58
|
+
* When provided, the tool validates that the host has set up all required primitives.
|
|
59
|
+
*/
|
|
60
|
+
primitives?: ReplPrimitives;
|
|
61
|
+
/**
|
|
62
|
+
* Permission check for individual primitive operations.
|
|
63
|
+
* Called before each primitive executes inside the VM.
|
|
64
|
+
* Returns null if allowed, or an error message if denied.
|
|
65
|
+
*/
|
|
66
|
+
checkPermission?(operation: string, args: unknown[]): Promise<string | null>;
|
|
67
|
+
}
|
|
68
|
+
/** Tool names that should be hidden from direct LLM access when REPL is active. */
|
|
69
|
+
export declare const REPL_HIDES_TOOLS: readonly string[];
|
|
70
|
+
export declare function createReplTool(deps: ReplToolDeps): PortableTool<ReplToolParams>;
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
import type { PortableTool } from "../portable-tool.js";
|
|
2
|
+
export declare const SEARCH_TOOL_NAME: "search";
|
|
3
|
+
export type SearchMode = "filename" | "content" | "both";
|
|
4
|
+
export interface SearchToolParams {
|
|
5
|
+
mode: SearchMode;
|
|
6
|
+
pattern: string;
|
|
7
|
+
path?: string;
|
|
8
|
+
fileGlob?: string;
|
|
9
|
+
contextLines?: number;
|
|
10
|
+
caseInsensitive?: boolean;
|
|
11
|
+
headLimit?: number;
|
|
12
|
+
offset?: number;
|
|
13
|
+
}
|
|
14
|
+
export declare const SEARCH_TOOL_SCHEMA: {
|
|
15
|
+
readonly type: "object";
|
|
16
|
+
readonly properties: {
|
|
17
|
+
readonly mode: {
|
|
18
|
+
readonly type: "string";
|
|
19
|
+
readonly enum: readonly ["filename", "content", "both"];
|
|
20
|
+
readonly description: string;
|
|
21
|
+
};
|
|
22
|
+
readonly pattern: {
|
|
23
|
+
readonly type: "string";
|
|
24
|
+
readonly description: string;
|
|
25
|
+
};
|
|
26
|
+
readonly path: {
|
|
27
|
+
readonly type: "string";
|
|
28
|
+
readonly description: "Directory to search in. Defaults to workdir/cwd if omitted.";
|
|
29
|
+
};
|
|
30
|
+
readonly fileGlob: {
|
|
31
|
+
readonly type: "string";
|
|
32
|
+
readonly description: string;
|
|
33
|
+
};
|
|
34
|
+
readonly contextLines: {
|
|
35
|
+
readonly type: "number";
|
|
36
|
+
readonly description: string;
|
|
37
|
+
};
|
|
38
|
+
readonly caseInsensitive: {
|
|
39
|
+
readonly type: "boolean";
|
|
40
|
+
readonly description: "Case insensitive search (content/both modes). Default: false.";
|
|
41
|
+
};
|
|
42
|
+
readonly headLimit: {
|
|
43
|
+
readonly type: "number";
|
|
44
|
+
readonly description: string;
|
|
45
|
+
};
|
|
46
|
+
readonly offset: {
|
|
47
|
+
readonly type: "number";
|
|
48
|
+
readonly description: "Skip first N results before applying headLimit. Default: 0.";
|
|
49
|
+
};
|
|
50
|
+
};
|
|
51
|
+
readonly required: readonly ["mode", "pattern"];
|
|
52
|
+
};
|
|
53
|
+
export interface SearchFileResult {
|
|
54
|
+
path: string;
|
|
55
|
+
}
|
|
56
|
+
export interface SearchContentResult {
|
|
57
|
+
path: string;
|
|
58
|
+
line: number;
|
|
59
|
+
text: string;
|
|
60
|
+
contextBefore?: string[];
|
|
61
|
+
contextAfter?: string[];
|
|
62
|
+
}
|
|
63
|
+
export interface SearchOutput {
|
|
64
|
+
mode: SearchMode;
|
|
65
|
+
totalMatches: number;
|
|
66
|
+
truncated: boolean;
|
|
67
|
+
fileResults?: SearchFileResult[];
|
|
68
|
+
contentResults?: SearchContentResult[];
|
|
69
|
+
}
|
|
70
|
+
/** Host-provided search backend. */
|
|
71
|
+
export interface SearchToolDeps {
|
|
72
|
+
/**
|
|
73
|
+
* Find files matching a glob pattern.
|
|
74
|
+
* Returns array of relative file paths.
|
|
75
|
+
* The host SHOULD auto-exclude VCS directories (.git, .svn, .hg, .bzr)
|
|
76
|
+
* unless the user explicitly includes them.
|
|
77
|
+
*/
|
|
78
|
+
glob(pattern: string, options: {
|
|
79
|
+
cwd: string;
|
|
80
|
+
limit: number;
|
|
81
|
+
}): Promise<{
|
|
82
|
+
files: string[];
|
|
83
|
+
truncated: boolean;
|
|
84
|
+
}>;
|
|
85
|
+
/**
|
|
86
|
+
* Search file contents using regex.
|
|
87
|
+
* The implementation may use ripgrep, native grep, or a custom engine.
|
|
88
|
+
* Returns match records.
|
|
89
|
+
* The host SHOULD auto-exclude VCS directories (.git, .svn, .hg, .bzr)
|
|
90
|
+
* and enforce --max-columns 500 to avoid minified file noise.
|
|
91
|
+
*/
|
|
92
|
+
grep(pattern: string, options: {
|
|
93
|
+
cwd: string;
|
|
94
|
+
fileGlob?: string;
|
|
95
|
+
caseInsensitive?: boolean;
|
|
96
|
+
contextLines?: number;
|
|
97
|
+
headLimit?: number;
|
|
98
|
+
offset?: number;
|
|
99
|
+
}): Promise<{
|
|
100
|
+
matches: Array<{
|
|
101
|
+
path: string;
|
|
102
|
+
line: number;
|
|
103
|
+
text: string;
|
|
104
|
+
contextBefore?: string[];
|
|
105
|
+
contextAfter?: string[];
|
|
106
|
+
}>;
|
|
107
|
+
truncated: boolean;
|
|
108
|
+
}>;
|
|
109
|
+
/** Resolve relative path to absolute. If omitted, cwd is used. */
|
|
110
|
+
resolvePath?(input: string): string;
|
|
111
|
+
}
|
|
112
|
+
export declare function createSearchTool(deps: SearchToolDeps): PortableTool<SearchToolParams>;
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import type { PortableTool } from "../portable-tool.js";
|
|
2
|
+
export declare const SEND_MESSAGE_TOOL_NAME: "send_message";
|
|
3
|
+
export interface SendMessageToolParams {
|
|
4
|
+
/** Target agent name or '*' for broadcast */
|
|
5
|
+
to: string;
|
|
6
|
+
/** Message content */
|
|
7
|
+
message: string;
|
|
8
|
+
/** Optional short summary for routing/display */
|
|
9
|
+
summary?: string;
|
|
10
|
+
}
|
|
11
|
+
export declare const SEND_MESSAGE_TOOL_SCHEMA: {
|
|
12
|
+
readonly type: "object";
|
|
13
|
+
readonly properties: {
|
|
14
|
+
readonly to: {
|
|
15
|
+
readonly type: "string";
|
|
16
|
+
readonly description: string;
|
|
17
|
+
};
|
|
18
|
+
readonly message: {
|
|
19
|
+
readonly type: "string";
|
|
20
|
+
readonly description: "Message content to send to the target agent.";
|
|
21
|
+
};
|
|
22
|
+
readonly summary: {
|
|
23
|
+
readonly type: "string";
|
|
24
|
+
readonly description: "Optional short summary (for logging/routing).";
|
|
25
|
+
};
|
|
26
|
+
};
|
|
27
|
+
readonly required: readonly ["to", "message"];
|
|
28
|
+
};
|
|
29
|
+
export interface SendMessageResult {
|
|
30
|
+
success: boolean;
|
|
31
|
+
recipients?: string[];
|
|
32
|
+
error?: string;
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* Host-provided message routing backend.
|
|
36
|
+
* Messages are delivered asynchronously via mailbox pattern.
|
|
37
|
+
*/
|
|
38
|
+
export interface SendMessageToolDeps {
|
|
39
|
+
/** Send message to target agent(s). Returns delivery status. */
|
|
40
|
+
sendMessage(params: {
|
|
41
|
+
to: string;
|
|
42
|
+
message: string;
|
|
43
|
+
summary?: string;
|
|
44
|
+
senderId: string;
|
|
45
|
+
}): Promise<SendMessageResult>;
|
|
46
|
+
/** Get the current agent's ID */
|
|
47
|
+
getSenderId(): string;
|
|
48
|
+
/** List available teammates */
|
|
49
|
+
listTeammates?(): string[];
|
|
50
|
+
}
|
|
51
|
+
export declare function createSendMessageTool(deps: SendMessageToolDeps): PortableTool<SendMessageToolParams>;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import type { ShellProvider } from "./shell-provider.js";
|
|
2
|
+
export interface BashProviderOptions {
|
|
3
|
+
/**
|
|
4
|
+
* Absolute path to a pre-saved shell snapshot file.
|
|
5
|
+
* If provided, will be `source`d before every command
|
|
6
|
+
* to restore environment (virtualenvs, PATHs, etc.).
|
|
7
|
+
*/
|
|
8
|
+
snapshotFilePath?: string;
|
|
9
|
+
/**
|
|
10
|
+
* Script fragment that sets session-specific env vars.
|
|
11
|
+
* Injected between snapshot sourcing and command execution.
|
|
12
|
+
*/
|
|
13
|
+
sessionEnvScript?: string;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Create a bash ShellProvider.
|
|
17
|
+
*
|
|
18
|
+
* @param shellPath Absolute path to bash (e.g. `/bin/bash`, `/usr/bin/bash`)
|
|
19
|
+
* @param options Optional snapshot / session env
|
|
20
|
+
*/
|
|
21
|
+
export declare function createBashProvider(shellPath: string, options?: BashProviderOptions): ShellProvider;
|
|
22
|
+
/**
|
|
23
|
+
* Update the snapshot file path at runtime (e.g. after re-snapshotting).
|
|
24
|
+
* This is a convenience — in practice the provider is re-created infrequently.
|
|
25
|
+
*/
|
|
26
|
+
export declare function updateSnapshot(provider: ShellProvider, snapshotFilePath: string | undefined): void;
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
/** Commands that search/find content (collapsible in UI). */
|
|
2
|
+
export declare const SEARCH_COMMANDS: Set<string>;
|
|
3
|
+
/** Commands that read/display file content (collapsible in UI). */
|
|
4
|
+
export declare const READ_COMMANDS: Set<string>;
|
|
5
|
+
/** Commands that list directory contents. */
|
|
6
|
+
export declare const LIST_COMMANDS: Set<string>;
|
|
7
|
+
/**
|
|
8
|
+
* Commands that are semantically neutral — they don't interact
|
|
9
|
+
* with the file system in a meaningful way. Skipped when
|
|
10
|
+
* classifying piped commands.
|
|
11
|
+
*/
|
|
12
|
+
export declare const SEMANTIC_NEUTRAL_COMMANDS: Set<string>;
|
|
13
|
+
/**
|
|
14
|
+
* Commands that produce no stdout on success.
|
|
15
|
+
* For these, the tool shows "Done" instead of "(No output)".
|
|
16
|
+
*/
|
|
17
|
+
export declare const SILENT_COMMANDS: Set<string>;
|
|
18
|
+
export interface CommandClassification {
|
|
19
|
+
/** First "real" command word (after env vars / wrappers). */
|
|
20
|
+
firstCommand: string | null;
|
|
21
|
+
/** Whether the command is search-like (find, grep, etc.). */
|
|
22
|
+
isSearch: boolean;
|
|
23
|
+
/** Whether the command only reads (cat, head, stat, etc.). */
|
|
24
|
+
isRead: boolean;
|
|
25
|
+
/** Whether the command lists files (ls, tree, du). */
|
|
26
|
+
isList: boolean;
|
|
27
|
+
/** Whether the command is expected to produce no stdout. */
|
|
28
|
+
isSilent: boolean;
|
|
29
|
+
/** Whether the command is safe to run in parallel with others. */
|
|
30
|
+
isConcurrencySafe: boolean;
|
|
31
|
+
/** Whether the command only reads state (never mutates). */
|
|
32
|
+
isReadOnly: boolean;
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* Check whether a command has any `cd` or pushd/popd that changes CWD.
|
|
36
|
+
* Ported from cc's `commandHasAnyCd()`.
|
|
37
|
+
*/
|
|
38
|
+
export declare function commandHasAnyCd(command: string): boolean;
|
|
39
|
+
/**
|
|
40
|
+
* Classify a shell command.
|
|
41
|
+
*
|
|
42
|
+
* Mirrors cc's `isSearchOrReadBashCommand()` + `isSilentBashCommand()`.
|
|
43
|
+
*/
|
|
44
|
+
export declare function classifyCommand(command: string): CommandClassification;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export interface CommandSemanticResult {
|
|
2
|
+
isError: boolean;
|
|
3
|
+
message?: string;
|
|
4
|
+
}
|
|
5
|
+
/**
|
|
6
|
+
* Interpret a command's exit code using semantic rules.
|
|
7
|
+
*
|
|
8
|
+
* @param command - The shell command that was executed
|
|
9
|
+
* @param exitCode - The process exit code
|
|
10
|
+
* @param stdout - Standard output
|
|
11
|
+
* @param stderr - Standard error
|
|
12
|
+
* @returns Semantic interpretation (isError + optional message)
|
|
13
|
+
*/
|
|
14
|
+
export declare function interpretCommandResult(command: string, exitCode: number, stdout: string, stderr: string): CommandSemanticResult;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Check a bash/sh command for destructive patterns.
|
|
3
|
+
* Returns the first matching warning, or null.
|
|
4
|
+
*/
|
|
5
|
+
export declare function getDestructiveCommandWarning(command: string): string | null;
|
|
6
|
+
/**
|
|
7
|
+
* Check a PowerShell command for destructive patterns.
|
|
8
|
+
* Returns the first matching warning, or null.
|
|
9
|
+
*/
|
|
10
|
+
export declare function getPowerShellDestructiveCommandWarning(command: string): string | null;
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Environment variables that can safely appear as prefixes.
|
|
3
|
+
* Ported from cc's SAFE_ENV_VARS.
|
|
4
|
+
*
|
|
5
|
+
* NEVER add:
|
|
6
|
+
* PATH, LD_PRELOAD, LD_LIBRARY_PATH, DYLD_* (execution/library loading)
|
|
7
|
+
* PYTHONPATH, NODE_PATH, CLASSPATH, RUBYLIB (module loading)
|
|
8
|
+
* GOFLAGS, RUSTFLAGS, NODE_OPTIONS (code execution flags)
|
|
9
|
+
* HOME, TMPDIR, SHELL, BASH_ENV (system behavior)
|
|
10
|
+
*/
|
|
11
|
+
export declare const SAFE_ENV_VARS: Set<string>;
|
|
12
|
+
/**
|
|
13
|
+
* Commands that execute their arguments — should not be treated
|
|
14
|
+
* as "first word" for permission prefix matching.
|
|
15
|
+
* Ported from cc's BARE_SHELL_PREFIXES.
|
|
16
|
+
*/
|
|
17
|
+
export declare const BARE_SHELL_PREFIXES: Set<string>;
|
|
18
|
+
/**
|
|
19
|
+
* Strip safe env var prefixes and wrapper commands.
|
|
20
|
+
* Ported from cc's `stripSafeWrappers()`.
|
|
21
|
+
*
|
|
22
|
+
* `NODE_ENV=test timeout 30 grep -r foo .` → `grep -r foo .`
|
|
23
|
+
*/
|
|
24
|
+
export declare function stripSafeWrappers(command: string): string;
|
|
25
|
+
/**
|
|
26
|
+
* Aggressively strip ALL leading env vars (not just safe ones).
|
|
27
|
+
* Used for deny-rule matching where the env prefix doesn't change
|
|
28
|
+
* the dangerousness of the underlying command.
|
|
29
|
+
* Ported from cc's `stripAllLeadingEnvVars()`.
|
|
30
|
+
*/
|
|
31
|
+
export declare function stripAllLeadingEnvVars(command: string, blocklist?: RegExp): string;
|
|
32
|
+
/**
|
|
33
|
+
* Extract `<cmd> <subcommand>` prefix for rule matching.
|
|
34
|
+
* E.g. `git commit -m "foo"` → `git commit`
|
|
35
|
+
* Ported from cc's `getSimpleCommandPrefix()`.
|
|
36
|
+
*/
|
|
37
|
+
export declare function getSimpleCommandPrefix(command: string): string | null;
|
|
38
|
+
/**
|
|
39
|
+
* Extract the first command word for prefix-based rule matching.
|
|
40
|
+
* Ported from cc's `getFirstWordPrefix()`.
|
|
41
|
+
*/
|
|
42
|
+
export declare function getFirstWordPrefix(command: string): string | null;
|
|
43
|
+
/**
|
|
44
|
+
* Strip argv-level wrapper commands.
|
|
45
|
+
* Ported from cc's `stripWrappersFromArgv()`.
|
|
46
|
+
*/
|
|
47
|
+
export declare function stripWrappersFromArgv(argv: string[]): string[];
|
|
48
|
+
/**
|
|
49
|
+
* Detect blocking sleep/wait patterns in commands.
|
|
50
|
+
* Ported from cc's `detectBlockedSleepPattern()`.
|
|
51
|
+
*/
|
|
52
|
+
export declare function detectBlockedSleepPattern(command: string): string | null;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export type { ShellType, BuildCommandOpts, BuiltCommand, ShellProvider, } from "./shell-provider.js";
|
|
2
|
+
export { isPowerShellToolEnabled, getDefaultShellType, generateCommandId, } from "./shell-provider.js";
|
|
3
|
+
export { createBashProvider } from "./bash-provider.js";
|
|
4
|
+
export type { BashProviderOptions } from "./bash-provider.js";
|
|
5
|
+
export { createPowerShellProvider, encodePowerShellCommand, } from "./powershell-provider.js";
|
|
6
|
+
export type { CommandClassification } from "./command-classification.js";
|
|
7
|
+
export { SEARCH_COMMANDS, READ_COMMANDS, LIST_COMMANDS, SEMANTIC_NEUTRAL_COMMANDS, SILENT_COMMANDS, classifyCommand, commandHasAnyCd, } from "./command-classification.js";
|
|
8
|
+
export { SAFE_ENV_VARS, BARE_SHELL_PREFIXES, stripSafeWrappers, stripAllLeadingEnvVars, getSimpleCommandPrefix, getFirstWordPrefix, stripWrappersFromArgv, detectBlockedSleepPattern, } from "./exec-permissions.js";
|
|
9
|
+
export { getDestructiveCommandWarning, getPowerShellDestructiveCommandWarning, } from "./destructive-command-warning.js";
|
|
10
|
+
export type { CommandSemanticResult } from "./command-semantics.js";
|
|
11
|
+
export { interpretCommandResult } from "./command-semantics.js";
|
|
12
|
+
export { TaskOutput, generateTaskId, getTaskOutputDir, setTaskOutputDir, getTaskOutputPath, MAX_TASK_OUTPUT_BYTES, } from "./task-output.js";
|
|
13
|
+
export type { ProgressCallback } from "./task-output.js";
|
|
14
|
+
export type { ExecResult, ShellCommand } from "./shell-command.js";
|
|
15
|
+
export { wrapSpawn, createAbortedCommand, createFailedCommand, } from "./shell-command.js";
|
|
16
|
+
export { exec, getCwd, setCwd, initCwd, getOriginalCwd, setShellProvider, getShellProvider, } from "./shell-exec.js";
|
|
17
|
+
export type { ExecOptions } from "./shell-exec.js";
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { ShellProvider } from "./shell-provider.js";
|
|
2
|
+
/**
|
|
3
|
+
* Encode a PowerShell command as UTF-16LE Base64 for -EncodedCommand.
|
|
4
|
+
* This avoids all quoting/escaping issues when passing complex commands
|
|
5
|
+
* through cmd.exe or other shell wrappers.
|
|
6
|
+
*
|
|
7
|
+
* Ported directly from cc's `encodePowerShellCommand()`.
|
|
8
|
+
*/
|
|
9
|
+
export declare function encodePowerShellCommand(psCommand: string): string;
|
|
10
|
+
/**
|
|
11
|
+
* Create a PowerShell ShellProvider.
|
|
12
|
+
*
|
|
13
|
+
* @param shellPath Absolute path to pwsh.exe or powershell.exe
|
|
14
|
+
*/
|
|
15
|
+
export declare function createPowerShellProvider(shellPath: string): ShellProvider;
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import type { ChildProcess } from "node:child_process";
|
|
2
|
+
import { TaskOutput } from "./task-output.js";
|
|
3
|
+
export interface ExecResult {
|
|
4
|
+
stdout: string;
|
|
5
|
+
stderr: string;
|
|
6
|
+
/** Exit code. 137 = SIGKILL, 143 = SIGTERM, 145 = aborted. */
|
|
7
|
+
code: number;
|
|
8
|
+
/** Whether the process was interrupted (killed or timed out). */
|
|
9
|
+
interrupted: boolean;
|
|
10
|
+
/** Set when backgrounded. */
|
|
11
|
+
backgroundTaskId?: string;
|
|
12
|
+
/** Set when the user explicitly backgrounded. */
|
|
13
|
+
backgroundedByUser?: boolean;
|
|
14
|
+
/** Set when assistant mode auto-backgrounded. */
|
|
15
|
+
assistantAutoBackgrounded?: boolean;
|
|
16
|
+
/** Path to raw output file for large outputs. */
|
|
17
|
+
outputFilePath?: string;
|
|
18
|
+
/** Total output file size in bytes. */
|
|
19
|
+
outputFileSize?: number;
|
|
20
|
+
/** Error message when command failed before spawning. */
|
|
21
|
+
preSpawnError?: string;
|
|
22
|
+
}
|
|
23
|
+
export interface ShellCommand {
|
|
24
|
+
/** Move the process to background. Returns true if successful. */
|
|
25
|
+
background(taskId: string): boolean;
|
|
26
|
+
/** Promise resolving when the process exits. */
|
|
27
|
+
result: Promise<ExecResult>;
|
|
28
|
+
/** Kill the process immediately. */
|
|
29
|
+
kill(): void;
|
|
30
|
+
/** Current lifecycle status. */
|
|
31
|
+
status: "running" | "backgrounded" | "completed" | "killed";
|
|
32
|
+
/** Clean up stream resources and listeners. */
|
|
33
|
+
cleanup(): void;
|
|
34
|
+
/** Register timeout callback (for auto-backgrounding). */
|
|
35
|
+
onTimeout?: (callback: (backgroundFn: (taskId: string) => boolean) => void) => void;
|
|
36
|
+
/** Output container. */
|
|
37
|
+
taskOutput: TaskOutput;
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* Wrap a child process with lifecycle management.
|
|
41
|
+
* Ported from cc's wrapSpawn().
|
|
42
|
+
*/
|
|
43
|
+
export declare function wrapSpawn(childProcess: ChildProcess, abortSignal: AbortSignal, timeout: number, taskOutput: TaskOutput, shouldAutoBackground?: boolean, maxOutputBytes?: number): ShellCommand;
|
|
44
|
+
/**
|
|
45
|
+
* Create a ShellCommand for commands that were aborted before execution.
|
|
46
|
+
*/
|
|
47
|
+
export declare function createAbortedCommand(backgroundTaskId?: string, opts?: {
|
|
48
|
+
stderr?: string;
|
|
49
|
+
code?: number;
|
|
50
|
+
}): ShellCommand;
|
|
51
|
+
/**
|
|
52
|
+
* Create a ShellCommand for commands that failed before spawn.
|
|
53
|
+
*/
|
|
54
|
+
export declare function createFailedCommand(preSpawnError: string): ShellCommand;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import type { ShellProvider, ShellType } from "./shell-provider.js";
|
|
2
|
+
import { type ShellCommand } from "./shell-command.js";
|
|
3
|
+
import { type ProgressCallback } from "./task-output.js";
|
|
4
|
+
export type { ExecResult } from "./shell-command.js";
|
|
5
|
+
export declare function getCwd(): string;
|
|
6
|
+
export declare function setCwd(path: string, relativeTo?: string): void;
|
|
7
|
+
export declare function getOriginalCwd(): string;
|
|
8
|
+
export declare function initCwd(cwd: string): void;
|
|
9
|
+
export interface ExecOptions {
|
|
10
|
+
timeout?: number;
|
|
11
|
+
onProgress?: ProgressCallback;
|
|
12
|
+
/** When true, `cd` in the command does NOT update the session CWD. */
|
|
13
|
+
preventCwdChanges?: boolean;
|
|
14
|
+
shouldAutoBackground?: boolean;
|
|
15
|
+
/** When provided, stdout is piped and this callback fires per chunk. */
|
|
16
|
+
onStdout?: (data: string) => void;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Set the shell provider for this session.
|
|
20
|
+
* Must be called once at startup by the host.
|
|
21
|
+
*/
|
|
22
|
+
export declare function setShellProvider(provider: ShellProvider): void;
|
|
23
|
+
/**
|
|
24
|
+
* Get the current shell provider, or throw if not configured.
|
|
25
|
+
*/
|
|
26
|
+
export declare function getShellProvider(): ShellProvider;
|
|
27
|
+
/**
|
|
28
|
+
* Execute a shell command using the configured provider.
|
|
29
|
+
* Creates a new child process for each invocation.
|
|
30
|
+
*
|
|
31
|
+
* Ported from cc's Shell.ts — the tool owns process lifecycle.
|
|
32
|
+
*/
|
|
33
|
+
export declare function exec(command: string, abortSignal: AbortSignal, shellType?: ShellType, options?: ExecOptions): Promise<ShellCommand>;
|