@perstack/base 0.0.9 → 0.0.10
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/dist/bin/server.js +88 -0
- package/dist/bin/server.js.map +1 -0
- package/dist/{index.js → chunk-YR44BQS2.js} +42 -148
- package/dist/chunk-YR44BQS2.js.map +1 -0
- package/dist/src/index.js +114 -0
- package/dist/src/index.js.map +1 -0
- package/package.json +5 -5
- package/dist/index.d.ts +0 -532
- package/dist/index.js.map +0 -1
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
export { WorkspaceMode, appendTextFileConfig, appendTextFileLocalMode, appendTextFileStudioMode, attemptCompletion, attemptCompletionConfig, clearTodo, clearTodoConfig, createDirectoryConfig, createDirectoryLocalMode, createDirectoryStudioMode, createWorkspaceItem, deleteFileConfig, deleteFileLocalMode, deleteFileStudioMode, deleteWorkspaceItem, editTextFileConfig, editTextFileLocalMode, editTextFileStudioMode, findWorkspaceItem, getFileInfoConfig, getFileInfoLocalMode, getFileInfoStudioMode, getWorkspaceApiConfig, getWorkspaceItemContent, getWorkspaceItems, getWorkspaceMode, listDirectoryConfig, listDirectoryLocalMode, listDirectoryStudioMode, moveFileConfig, moveFileLocalMode, moveFileStudioMode, readImageFile, readImageFileConfig, readPdfFile, readPdfFileConfig, readTextFile, readTextFileConfig, resolveToolByMode, testUrlConfig, testUrls, think, thinkConfig, todo, todoConfig, updateWorkspaceItem, validatePath, workspacePath, writeTextFileConfig, writeTextFileLocalMode, writeTextFileStudioMode } from '../chunk-YR44BQS2.js';
|
|
2
|
+
import { execFile } from 'child_process';
|
|
3
|
+
import { promisify } from 'util';
|
|
4
|
+
import { dedent } from 'ts-dedent';
|
|
5
|
+
import { z } from 'zod';
|
|
6
|
+
|
|
7
|
+
var execFileAsync = promisify(execFile);
|
|
8
|
+
var execInputSchema = z.object({
|
|
9
|
+
command: z.string().describe("The command to execute"),
|
|
10
|
+
args: z.array(z.string()).describe("The arguments to pass to the command"),
|
|
11
|
+
env: z.record(z.string(), z.string()).describe("The environment variables to set"),
|
|
12
|
+
cwd: z.string().describe("The working directory to execute the command in"),
|
|
13
|
+
stdout: z.boolean().describe("Whether to capture the standard output"),
|
|
14
|
+
stderr: z.boolean().describe("Whether to capture the standard error"),
|
|
15
|
+
timeout: z.number().optional().describe("Timeout in milliseconds")
|
|
16
|
+
});
|
|
17
|
+
function execConfig() {
|
|
18
|
+
return {
|
|
19
|
+
title: "Execute Command",
|
|
20
|
+
description: dedent`
|
|
21
|
+
A tool for executing a command.
|
|
22
|
+
This tool helps execute a command with the given parameters.
|
|
23
|
+
|
|
24
|
+
When to use this tool:
|
|
25
|
+
- When you need to run system tasks or scripts.
|
|
26
|
+
- When automating the use of command-line tools or utilities.
|
|
27
|
+
|
|
28
|
+
Key features:
|
|
29
|
+
- Flexible Execution Environment: Specify environment variables, working directory, and arguments to tailor the command execution.
|
|
30
|
+
- Output Capture: Control whether to capture the standard output and standard error from the executed command.
|
|
31
|
+
- Simple Interface: A unified input schema consolidates all parameters needed for command execution.
|
|
32
|
+
|
|
33
|
+
Parameters explained:
|
|
34
|
+
- command: The command to execute (e.g., \`ls\`, \`python\`).
|
|
35
|
+
- args: A list of arguments to pass to the command, functioning similarly to command-line input.
|
|
36
|
+
- env: A record of key-value pairs representing environment variables for the command's execution environment.
|
|
37
|
+
- cwd: The working directory in which the command will run; both relative and absolute paths are supported.
|
|
38
|
+
- stdout: A boolean flag indicating whether to capture the standard output (set to \`true\` to capture).
|
|
39
|
+
- stderr: A boolean flag indicating whether to capture the standard error (set to \`true\` to capture).
|
|
40
|
+
- timeout: The timeout in milliseconds for the command execution.
|
|
41
|
+
|
|
42
|
+
Rules:
|
|
43
|
+
- Safety: Only execute commands from trusted sources to avoid executing malicious code.
|
|
44
|
+
- Command Termination: Do not execute commands that remain running in the foreground (e.g., \`tail -f\`), as the tool requires commands to complete.
|
|
45
|
+
- Resource Management: Be cautious when running commands that may consume significant system resources or produce large amounts of output.
|
|
46
|
+
- Error Handling: Implement proper error handling to catch and manage any issues that arise during command execution.
|
|
47
|
+
- Parameter Validation: Ensure that all provided parameters adhere to the expected format to prevent unexpected behavior.
|
|
48
|
+
`,
|
|
49
|
+
inputSchema: execInputSchema.shape
|
|
50
|
+
};
|
|
51
|
+
}
|
|
52
|
+
async function exec(input) {
|
|
53
|
+
try {
|
|
54
|
+
const { stdout, stderr } = await execFileAsync(input.command, input.args, {
|
|
55
|
+
cwd: input.cwd,
|
|
56
|
+
env: { ...process.env, ...input.env },
|
|
57
|
+
timeout: input.timeout
|
|
58
|
+
});
|
|
59
|
+
let output = "";
|
|
60
|
+
if (input.stdout) {
|
|
61
|
+
output += stdout;
|
|
62
|
+
}
|
|
63
|
+
if (input.stderr) {
|
|
64
|
+
output += stderr;
|
|
65
|
+
}
|
|
66
|
+
if (!output.trim()) {
|
|
67
|
+
output = "Command executed successfully, but produced no output.";
|
|
68
|
+
}
|
|
69
|
+
return {
|
|
70
|
+
content: [
|
|
71
|
+
{
|
|
72
|
+
type: "text",
|
|
73
|
+
text: output
|
|
74
|
+
}
|
|
75
|
+
]
|
|
76
|
+
};
|
|
77
|
+
} catch (error) {
|
|
78
|
+
let errMsg = "";
|
|
79
|
+
const execError = error;
|
|
80
|
+
if (execError && (execError.killed || execError.signal === "SIGTERM") && typeof input.timeout === "number") {
|
|
81
|
+
errMsg = `Error: Command timed out after ${input.timeout}ms.
|
|
82
|
+
`;
|
|
83
|
+
} else if (error instanceof Error) {
|
|
84
|
+
if (error.message.includes("timeout")) {
|
|
85
|
+
errMsg = `Error: Command timed out after ${input.timeout}ms.
|
|
86
|
+
`;
|
|
87
|
+
} else {
|
|
88
|
+
errMsg = `Error: ${error.message}
|
|
89
|
+
`;
|
|
90
|
+
}
|
|
91
|
+
} else {
|
|
92
|
+
errMsg = "An unknown error occurred.\n";
|
|
93
|
+
}
|
|
94
|
+
if (execError.stdout && input.stdout) {
|
|
95
|
+
errMsg += `Standard Output: ${execError.stdout}`;
|
|
96
|
+
}
|
|
97
|
+
if (execError.stderr && input.stderr) {
|
|
98
|
+
errMsg += `
|
|
99
|
+
Standard Error: ${execError.stderr}`;
|
|
100
|
+
}
|
|
101
|
+
return {
|
|
102
|
+
content: [
|
|
103
|
+
{
|
|
104
|
+
type: "text",
|
|
105
|
+
text: errMsg
|
|
106
|
+
}
|
|
107
|
+
]
|
|
108
|
+
};
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
export { exec, execConfig };
|
|
113
|
+
//# sourceMappingURL=index.js.map
|
|
114
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/tools/exec.ts"],"names":[],"mappings":"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","file":"index.js","sourcesContent":["import { execFile } from \"node:child_process\"\nimport { promisify } from \"node:util\"\nimport { dedent } from \"ts-dedent\"\nimport { z } from \"zod\"\n\nconst execFileAsync = promisify(execFile)\n\nconst execInputSchema = z.object({\n command: z.string().describe(\"The command to execute\"),\n args: z.array(z.string()).describe(\"The arguments to pass to the command\"),\n env: z.record(z.string(), z.string()).describe(\"The environment variables to set\"),\n cwd: z.string().describe(\"The working directory to execute the command in\"),\n stdout: z.boolean().describe(\"Whether to capture the standard output\"),\n stderr: z.boolean().describe(\"Whether to capture the standard error\"),\n timeout: z.number().optional().describe(\"Timeout in milliseconds\"),\n})\ntype ExecInput = z.infer<typeof execInputSchema>\n\nexport function execConfig() {\n return {\n title: \"Execute Command\",\n description: dedent`\n A tool for executing a command.\n This tool helps execute a command with the given parameters.\n\n When to use this tool:\n - When you need to run system tasks or scripts.\n - When automating the use of command-line tools or utilities.\n\n Key features:\n - Flexible Execution Environment: Specify environment variables, working directory, and arguments to tailor the command execution.\n - Output Capture: Control whether to capture the standard output and standard error from the executed command.\n - Simple Interface: A unified input schema consolidates all parameters needed for command execution.\n\n Parameters explained:\n - command: The command to execute (e.g., \\`ls\\`, \\`python\\`).\n - args: A list of arguments to pass to the command, functioning similarly to command-line input.\n - env: A record of key-value pairs representing environment variables for the command's execution environment.\n - cwd: The working directory in which the command will run; both relative and absolute paths are supported.\n - stdout: A boolean flag indicating whether to capture the standard output (set to \\`true\\` to capture).\n - stderr: A boolean flag indicating whether to capture the standard error (set to \\`true\\` to capture).\n - timeout: The timeout in milliseconds for the command execution.\n\n Rules:\n - Safety: Only execute commands from trusted sources to avoid executing malicious code.\n - Command Termination: Do not execute commands that remain running in the foreground (e.g., \\`tail -f\\`), as the tool requires commands to complete.\n - Resource Management: Be cautious when running commands that may consume significant system resources or produce large amounts of output.\n - Error Handling: Implement proper error handling to catch and manage any issues that arise during command execution.\n - Parameter Validation: Ensure that all provided parameters adhere to the expected format to prevent unexpected behavior.\n `,\n inputSchema: execInputSchema.shape,\n }\n}\n\nexport async function exec(input: ExecInput) {\n try {\n const { stdout, stderr } = await execFileAsync(input.command, input.args, {\n cwd: input.cwd,\n env: { ...process.env, ...input.env },\n timeout: input.timeout,\n })\n\n let output = \"\"\n if (input.stdout) {\n output += stdout\n }\n if (input.stderr) {\n output += stderr\n }\n\n if (!output.trim()) {\n output = \"Command executed successfully, but produced no output.\"\n }\n\n return {\n content: [\n {\n type: \"text\",\n text: output,\n },\n ],\n }\n } catch (error: unknown) {\n let errMsg = \"\"\n const execError = error as {\n message?: string\n stdout?: string\n stderr?: string\n killed?: boolean\n signal?: string\n }\n if (\n execError &&\n (execError.killed || execError.signal === \"SIGTERM\") &&\n typeof input.timeout === \"number\"\n ) {\n errMsg = `Error: Command timed out after ${input.timeout}ms.\\n`\n } else if (error instanceof Error) {\n if (error.message.includes(\"timeout\")) {\n errMsg = `Error: Command timed out after ${input.timeout}ms.\\n`\n } else {\n errMsg = `Error: ${error.message}\\n`\n }\n } else {\n errMsg = \"An unknown error occurred.\\n\"\n }\n if (execError.stdout && input.stdout) {\n errMsg += `Standard Output: ${execError.stdout}`\n }\n if (execError.stderr && input.stderr) {\n errMsg += `\\nStandard Error: ${execError.stderr}`\n }\n return {\n content: [\n {\n type: \"text\",\n text: errMsg,\n },\n ],\n }\n }\n}\n"]}
|
package/package.json
CHANGED
|
@@ -1,10 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@perstack/base",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.10",
|
|
4
4
|
"description": "Perstack base skills for agents.",
|
|
5
5
|
"author": "Wintermute Technologies, Inc.",
|
|
6
6
|
"license": "Apache-2.0",
|
|
7
7
|
"type": "module",
|
|
8
|
+
"bin": {
|
|
9
|
+
"@perstack/base": "dist/server.js"
|
|
10
|
+
},
|
|
8
11
|
"exports": {
|
|
9
12
|
".": "./dist/index.js"
|
|
10
13
|
},
|
|
@@ -29,12 +32,9 @@
|
|
|
29
32
|
"engines": {
|
|
30
33
|
"node": ">=22.0.0"
|
|
31
34
|
},
|
|
32
|
-
"bin": {
|
|
33
|
-
"base": "dist/server.js"
|
|
34
|
-
},
|
|
35
35
|
"scripts": {
|
|
36
36
|
"clean": "rm -rf dist",
|
|
37
|
-
"build": "pnpm run clean && tsup --config
|
|
37
|
+
"build": "pnpm run clean && tsup --config ./tsup.config.ts",
|
|
38
38
|
"typecheck": "tsc --noEmit",
|
|
39
39
|
"changeset": "changeset",
|
|
40
40
|
"version": "changeset version"
|
package/dist/index.d.ts
DELETED
|
@@ -1,532 +0,0 @@
|
|
|
1
|
-
import { CallToolResult } from '@modelcontextprotocol/sdk/types.js';
|
|
2
|
-
import { z } from 'zod';
|
|
3
|
-
|
|
4
|
-
declare const workspacePath: string;
|
|
5
|
-
declare function validatePath(requestedPath: string): Promise<string>;
|
|
6
|
-
|
|
7
|
-
type ToolResult = Record<string, unknown>;
|
|
8
|
-
type ToolFunction<TInput> = (input: TInput) => Promise<ToolResult>;
|
|
9
|
-
declare function resolveToolByMode<TInput>(localModeFunction: ToolFunction<TInput>, studioModeFunction?: ToolFunction<TInput>): (input: TInput) => Promise<CallToolResult>;
|
|
10
|
-
|
|
11
|
-
declare enum WorkspaceMode {
|
|
12
|
-
LOCAL = "local",
|
|
13
|
-
STUDIO = "studio"
|
|
14
|
-
}
|
|
15
|
-
interface WorkspaceItemBase {
|
|
16
|
-
id: string;
|
|
17
|
-
owner: "user" | "expert";
|
|
18
|
-
lifecycle: "application" | "expertJob";
|
|
19
|
-
permission: "readOnly" | "readWrite";
|
|
20
|
-
path: string;
|
|
21
|
-
createdAt: string;
|
|
22
|
-
updatedAt: string;
|
|
23
|
-
}
|
|
24
|
-
interface WorkspaceItemDirectory extends WorkspaceItemBase {
|
|
25
|
-
type: "workspaceItemDirectory";
|
|
26
|
-
}
|
|
27
|
-
interface WorkspaceItemFile extends WorkspaceItemBase {
|
|
28
|
-
type: "workspaceItemFile";
|
|
29
|
-
key: string;
|
|
30
|
-
mimeType: string;
|
|
31
|
-
size: number;
|
|
32
|
-
}
|
|
33
|
-
type WorkspaceItem = WorkspaceItemDirectory | WorkspaceItemFile;
|
|
34
|
-
interface WorkspaceApiConfig {
|
|
35
|
-
baseUrl: string;
|
|
36
|
-
apiKey: string;
|
|
37
|
-
expertJobId: string;
|
|
38
|
-
}
|
|
39
|
-
declare const getWorkspaceApiConfig: () => WorkspaceApiConfig | undefined;
|
|
40
|
-
declare const getWorkspaceMode: () => WorkspaceMode;
|
|
41
|
-
declare const findWorkspaceItem: (path: string) => Promise<WorkspaceItem | null>;
|
|
42
|
-
declare const createWorkspaceItem: (item: Omit<WorkspaceItem, "id" | "createdAt" | "updatedAt">, fileContent?: string) => Promise<WorkspaceItem>;
|
|
43
|
-
declare const updateWorkspaceItem: (id: string, updates: {
|
|
44
|
-
lifecycle?: "application" | "expertJob";
|
|
45
|
-
permission?: "readOnly" | "readWrite";
|
|
46
|
-
path?: string;
|
|
47
|
-
}) => Promise<WorkspaceItem>;
|
|
48
|
-
declare const getWorkspaceItems: (take?: number, skip?: number) => Promise<WorkspaceItem[]>;
|
|
49
|
-
declare const deleteWorkspaceItem: (workspaceItemId: string) => Promise<void>;
|
|
50
|
-
declare const getWorkspaceItemContent: (workspaceItem: WorkspaceItemFile) => Promise<string>;
|
|
51
|
-
|
|
52
|
-
declare const inputSchema$b: z.ZodObject<{
|
|
53
|
-
path: z.ZodString;
|
|
54
|
-
text: z.ZodString;
|
|
55
|
-
}, "strip", z.ZodTypeAny, {
|
|
56
|
-
path: string;
|
|
57
|
-
text: string;
|
|
58
|
-
}, {
|
|
59
|
-
path: string;
|
|
60
|
-
text: string;
|
|
61
|
-
}>;
|
|
62
|
-
type InputSchema$b = z.infer<typeof inputSchema$b>;
|
|
63
|
-
declare function appendTextFileConfig(): {
|
|
64
|
-
title: string;
|
|
65
|
-
description: string;
|
|
66
|
-
inputSchema: {
|
|
67
|
-
path: z.ZodString;
|
|
68
|
-
text: z.ZodString;
|
|
69
|
-
};
|
|
70
|
-
};
|
|
71
|
-
declare function appendTextFileLocalMode(input: InputSchema$b): Promise<ToolResult>;
|
|
72
|
-
declare function appendTextFileStudioMode(input: {
|
|
73
|
-
path: string;
|
|
74
|
-
text: string;
|
|
75
|
-
}): Promise<ToolResult>;
|
|
76
|
-
|
|
77
|
-
declare function attemptCompletionConfig(): {
|
|
78
|
-
title: string;
|
|
79
|
-
description: string;
|
|
80
|
-
inputSchema: {};
|
|
81
|
-
};
|
|
82
|
-
declare function attemptCompletion(): Promise<ToolResult>;
|
|
83
|
-
|
|
84
|
-
declare const inputSchema$a: z.ZodObject<{
|
|
85
|
-
path: z.ZodString;
|
|
86
|
-
}, "strip", z.ZodTypeAny, {
|
|
87
|
-
path: string;
|
|
88
|
-
}, {
|
|
89
|
-
path: string;
|
|
90
|
-
}>;
|
|
91
|
-
type InputSchema$a = z.infer<typeof inputSchema$a>;
|
|
92
|
-
declare function createDirectoryConfig(): {
|
|
93
|
-
title: string;
|
|
94
|
-
description: string;
|
|
95
|
-
inputSchema: {
|
|
96
|
-
path: z.ZodString;
|
|
97
|
-
};
|
|
98
|
-
};
|
|
99
|
-
declare function createDirectoryLocalMode(input: InputSchema$a): Promise<{
|
|
100
|
-
path: string;
|
|
101
|
-
}>;
|
|
102
|
-
declare function createDirectoryStudioMode(input: InputSchema$a): Promise<{
|
|
103
|
-
path: string;
|
|
104
|
-
}>;
|
|
105
|
-
|
|
106
|
-
declare const inputSchema$9: z.ZodObject<{
|
|
107
|
-
path: z.ZodString;
|
|
108
|
-
}, "strip", z.ZodTypeAny, {
|
|
109
|
-
path: string;
|
|
110
|
-
}, {
|
|
111
|
-
path: string;
|
|
112
|
-
}>;
|
|
113
|
-
type InputSchema$9 = z.infer<typeof inputSchema$9>;
|
|
114
|
-
declare function deleteFileConfig(): {
|
|
115
|
-
title: string;
|
|
116
|
-
description: string;
|
|
117
|
-
inputSchema: {
|
|
118
|
-
path: z.ZodString;
|
|
119
|
-
};
|
|
120
|
-
};
|
|
121
|
-
declare function deleteFileLocalMode(input: InputSchema$9): Promise<{
|
|
122
|
-
path: string;
|
|
123
|
-
}>;
|
|
124
|
-
declare function deleteFileStudioMode(input: InputSchema$9): Promise<{
|
|
125
|
-
path: string;
|
|
126
|
-
}>;
|
|
127
|
-
|
|
128
|
-
declare const inputSchema$8: z.ZodObject<{
|
|
129
|
-
path: z.ZodString;
|
|
130
|
-
newText: z.ZodString;
|
|
131
|
-
oldText: z.ZodString;
|
|
132
|
-
}, "strip", z.ZodTypeAny, {
|
|
133
|
-
path: string;
|
|
134
|
-
newText: string;
|
|
135
|
-
oldText: string;
|
|
136
|
-
}, {
|
|
137
|
-
path: string;
|
|
138
|
-
newText: string;
|
|
139
|
-
oldText: string;
|
|
140
|
-
}>;
|
|
141
|
-
type InputSchema$8 = z.infer<typeof inputSchema$8>;
|
|
142
|
-
declare function editTextFileConfig(): {
|
|
143
|
-
title: string;
|
|
144
|
-
description: string;
|
|
145
|
-
inputSchema: {
|
|
146
|
-
path: z.ZodString;
|
|
147
|
-
newText: z.ZodString;
|
|
148
|
-
oldText: z.ZodString;
|
|
149
|
-
};
|
|
150
|
-
};
|
|
151
|
-
declare function editTextFileLocalMode(input: InputSchema$8): Promise<{
|
|
152
|
-
path: string;
|
|
153
|
-
newText: string;
|
|
154
|
-
oldText: string;
|
|
155
|
-
}>;
|
|
156
|
-
declare function editTextFileStudioMode(input: InputSchema$8): Promise<{
|
|
157
|
-
path: string;
|
|
158
|
-
newText: string;
|
|
159
|
-
oldText: string;
|
|
160
|
-
}>;
|
|
161
|
-
|
|
162
|
-
declare const execInputSchema: z.ZodObject<{
|
|
163
|
-
command: z.ZodString;
|
|
164
|
-
args: z.ZodArray<z.ZodString, "many">;
|
|
165
|
-
env: z.ZodRecord<z.ZodString, z.ZodString>;
|
|
166
|
-
cwd: z.ZodString;
|
|
167
|
-
stdout: z.ZodBoolean;
|
|
168
|
-
stderr: z.ZodBoolean;
|
|
169
|
-
timeout: z.ZodOptional<z.ZodNumber>;
|
|
170
|
-
}, "strip", z.ZodTypeAny, {
|
|
171
|
-
command: string;
|
|
172
|
-
args: string[];
|
|
173
|
-
env: Record<string, string>;
|
|
174
|
-
cwd: string;
|
|
175
|
-
stdout: boolean;
|
|
176
|
-
stderr: boolean;
|
|
177
|
-
timeout?: number | undefined;
|
|
178
|
-
}, {
|
|
179
|
-
command: string;
|
|
180
|
-
args: string[];
|
|
181
|
-
env: Record<string, string>;
|
|
182
|
-
cwd: string;
|
|
183
|
-
stdout: boolean;
|
|
184
|
-
stderr: boolean;
|
|
185
|
-
timeout?: number | undefined;
|
|
186
|
-
}>;
|
|
187
|
-
type ExecInput = z.infer<typeof execInputSchema>;
|
|
188
|
-
declare function execConfig(): {
|
|
189
|
-
title: string;
|
|
190
|
-
description: string;
|
|
191
|
-
inputSchema: {
|
|
192
|
-
command: z.ZodString;
|
|
193
|
-
args: z.ZodArray<z.ZodString, "many">;
|
|
194
|
-
env: z.ZodRecord<z.ZodString, z.ZodString>;
|
|
195
|
-
cwd: z.ZodString;
|
|
196
|
-
stdout: z.ZodBoolean;
|
|
197
|
-
stderr: z.ZodBoolean;
|
|
198
|
-
timeout: z.ZodOptional<z.ZodNumber>;
|
|
199
|
-
};
|
|
200
|
-
};
|
|
201
|
-
declare function exec(input: ExecInput): Promise<{
|
|
202
|
-
content: {
|
|
203
|
-
type: string;
|
|
204
|
-
text: string;
|
|
205
|
-
}[];
|
|
206
|
-
}>;
|
|
207
|
-
|
|
208
|
-
declare const inputSchema$7: z.ZodObject<{
|
|
209
|
-
path: z.ZodString;
|
|
210
|
-
}, "strip", z.ZodTypeAny, {
|
|
211
|
-
path: string;
|
|
212
|
-
}, {
|
|
213
|
-
path: string;
|
|
214
|
-
}>;
|
|
215
|
-
type InputSchema$7 = z.infer<typeof inputSchema$7>;
|
|
216
|
-
declare function getFileInfoConfig(): {
|
|
217
|
-
title: string;
|
|
218
|
-
description: string;
|
|
219
|
-
inputSchema: {
|
|
220
|
-
path: z.ZodString;
|
|
221
|
-
};
|
|
222
|
-
};
|
|
223
|
-
declare function getFileInfoLocalMode(input: InputSchema$7): Promise<{
|
|
224
|
-
exists: boolean;
|
|
225
|
-
path: string;
|
|
226
|
-
absolutePath: string;
|
|
227
|
-
name: string;
|
|
228
|
-
directory: string;
|
|
229
|
-
extension: string | null;
|
|
230
|
-
type: string;
|
|
231
|
-
mimeType: string | null;
|
|
232
|
-
size: number;
|
|
233
|
-
sizeFormatted: string;
|
|
234
|
-
created: string;
|
|
235
|
-
modified: string;
|
|
236
|
-
accessed: string;
|
|
237
|
-
permissions: {
|
|
238
|
-
readable: boolean;
|
|
239
|
-
writable: boolean;
|
|
240
|
-
executable: boolean;
|
|
241
|
-
};
|
|
242
|
-
}>;
|
|
243
|
-
declare function getFileInfoStudioMode(input: InputSchema$7): Promise<{
|
|
244
|
-
workspaceItem: {
|
|
245
|
-
key?: string | undefined;
|
|
246
|
-
mimeType?: string | undefined;
|
|
247
|
-
size?: number | undefined;
|
|
248
|
-
id: string;
|
|
249
|
-
type: "workspaceItemDirectory" | "workspaceItemFile";
|
|
250
|
-
path: string;
|
|
251
|
-
owner: "user" | "expert";
|
|
252
|
-
lifecycle: "application" | "expertJob";
|
|
253
|
-
permission: "readOnly" | "readWrite";
|
|
254
|
-
createdAt: string;
|
|
255
|
-
updatedAt: string;
|
|
256
|
-
} | null;
|
|
257
|
-
exists: boolean;
|
|
258
|
-
path: string;
|
|
259
|
-
absolutePath: string;
|
|
260
|
-
name: string;
|
|
261
|
-
directory: string;
|
|
262
|
-
extension: string | null;
|
|
263
|
-
type: string;
|
|
264
|
-
mimeType: string | null;
|
|
265
|
-
size: number;
|
|
266
|
-
sizeFormatted: string;
|
|
267
|
-
created: string;
|
|
268
|
-
modified: string;
|
|
269
|
-
accessed: string;
|
|
270
|
-
permissions: {
|
|
271
|
-
readable: boolean;
|
|
272
|
-
writable: boolean;
|
|
273
|
-
executable: boolean;
|
|
274
|
-
};
|
|
275
|
-
}>;
|
|
276
|
-
|
|
277
|
-
declare const inputSchema$6: z.ZodObject<{
|
|
278
|
-
path: z.ZodString;
|
|
279
|
-
}, "strip", z.ZodTypeAny, {
|
|
280
|
-
path: string;
|
|
281
|
-
}, {
|
|
282
|
-
path: string;
|
|
283
|
-
}>;
|
|
284
|
-
type InputSchema$6 = z.infer<typeof inputSchema$6>;
|
|
285
|
-
interface DirectoryItem {
|
|
286
|
-
name: string;
|
|
287
|
-
path: string;
|
|
288
|
-
type: "directory" | "file";
|
|
289
|
-
size: number;
|
|
290
|
-
modified: string;
|
|
291
|
-
}
|
|
292
|
-
declare function listDirectoryConfig(): {
|
|
293
|
-
title: string;
|
|
294
|
-
description: string;
|
|
295
|
-
inputSchema: {
|
|
296
|
-
path: z.ZodString;
|
|
297
|
-
};
|
|
298
|
-
};
|
|
299
|
-
declare function listDirectoryLocalMode(input: InputSchema$6): Promise<{
|
|
300
|
-
path: string;
|
|
301
|
-
items: DirectoryItem[];
|
|
302
|
-
}>;
|
|
303
|
-
declare function listDirectoryStudioMode(input: InputSchema$6): Promise<{
|
|
304
|
-
path: string;
|
|
305
|
-
items: {
|
|
306
|
-
name: string;
|
|
307
|
-
path: string;
|
|
308
|
-
type: string;
|
|
309
|
-
size: number;
|
|
310
|
-
modified: string;
|
|
311
|
-
}[];
|
|
312
|
-
}>;
|
|
313
|
-
|
|
314
|
-
declare const inputSchema$5: z.ZodObject<{
|
|
315
|
-
source: z.ZodString;
|
|
316
|
-
destination: z.ZodString;
|
|
317
|
-
}, "strip", z.ZodTypeAny, {
|
|
318
|
-
source: string;
|
|
319
|
-
destination: string;
|
|
320
|
-
}, {
|
|
321
|
-
source: string;
|
|
322
|
-
destination: string;
|
|
323
|
-
}>;
|
|
324
|
-
type InputSchema$5 = z.infer<typeof inputSchema$5>;
|
|
325
|
-
declare function moveFileConfig(): {
|
|
326
|
-
title: string;
|
|
327
|
-
description: string;
|
|
328
|
-
inputSchema: {
|
|
329
|
-
source: z.ZodString;
|
|
330
|
-
destination: z.ZodString;
|
|
331
|
-
};
|
|
332
|
-
};
|
|
333
|
-
declare function moveFileLocalMode(input: InputSchema$5): Promise<{
|
|
334
|
-
source: string;
|
|
335
|
-
destination: string;
|
|
336
|
-
}>;
|
|
337
|
-
declare function moveFileStudioMode(input: InputSchema$5): Promise<{
|
|
338
|
-
source: string;
|
|
339
|
-
destination: string;
|
|
340
|
-
}>;
|
|
341
|
-
|
|
342
|
-
declare const inputSchema$4: z.ZodObject<{
|
|
343
|
-
path: z.ZodString;
|
|
344
|
-
}, "strip", z.ZodTypeAny, {
|
|
345
|
-
path: string;
|
|
346
|
-
}, {
|
|
347
|
-
path: string;
|
|
348
|
-
}>;
|
|
349
|
-
type InputSchema$4 = z.infer<typeof inputSchema$4>;
|
|
350
|
-
declare function readImageFileConfig(): {
|
|
351
|
-
title: string;
|
|
352
|
-
description: string;
|
|
353
|
-
inputSchema: {
|
|
354
|
-
path: z.ZodString;
|
|
355
|
-
};
|
|
356
|
-
};
|
|
357
|
-
declare function readImageFile(input: InputSchema$4): Promise<{
|
|
358
|
-
path: string;
|
|
359
|
-
mimeType: string;
|
|
360
|
-
size: number;
|
|
361
|
-
}>;
|
|
362
|
-
|
|
363
|
-
declare const inputSchema$3: z.ZodObject<{
|
|
364
|
-
path: z.ZodString;
|
|
365
|
-
}, "strip", z.ZodTypeAny, {
|
|
366
|
-
path: string;
|
|
367
|
-
}, {
|
|
368
|
-
path: string;
|
|
369
|
-
}>;
|
|
370
|
-
type InputSchema$3 = z.infer<typeof inputSchema$3>;
|
|
371
|
-
declare function readPdfFileConfig(): {
|
|
372
|
-
title: string;
|
|
373
|
-
description: string;
|
|
374
|
-
inputSchema: {
|
|
375
|
-
path: z.ZodString;
|
|
376
|
-
};
|
|
377
|
-
};
|
|
378
|
-
declare function readPdfFile(input: InputSchema$3): Promise<{
|
|
379
|
-
path: string;
|
|
380
|
-
mimeType: string;
|
|
381
|
-
size: number;
|
|
382
|
-
}>;
|
|
383
|
-
|
|
384
|
-
declare const inputSchema$2: z.ZodObject<{
|
|
385
|
-
path: z.ZodString;
|
|
386
|
-
from: z.ZodOptional<z.ZodNumber>;
|
|
387
|
-
to: z.ZodOptional<z.ZodNumber>;
|
|
388
|
-
}, "strip", z.ZodTypeAny, {
|
|
389
|
-
path: string;
|
|
390
|
-
from?: number | undefined;
|
|
391
|
-
to?: number | undefined;
|
|
392
|
-
}, {
|
|
393
|
-
path: string;
|
|
394
|
-
from?: number | undefined;
|
|
395
|
-
to?: number | undefined;
|
|
396
|
-
}>;
|
|
397
|
-
type InputSchema$2 = z.infer<typeof inputSchema$2>;
|
|
398
|
-
declare function readTextFileConfig(): {
|
|
399
|
-
title: string;
|
|
400
|
-
description: string;
|
|
401
|
-
inputSchema: {
|
|
402
|
-
path: z.ZodString;
|
|
403
|
-
from: z.ZodOptional<z.ZodNumber>;
|
|
404
|
-
to: z.ZodOptional<z.ZodNumber>;
|
|
405
|
-
};
|
|
406
|
-
};
|
|
407
|
-
declare function readTextFile(input: InputSchema$2): Promise<{
|
|
408
|
-
path: string;
|
|
409
|
-
content: string;
|
|
410
|
-
from: number;
|
|
411
|
-
to: number;
|
|
412
|
-
}>;
|
|
413
|
-
|
|
414
|
-
declare const inputSchema$1: z.ZodObject<{
|
|
415
|
-
urls: z.ZodArray<z.ZodString, "many">;
|
|
416
|
-
}, "strip", z.ZodTypeAny, {
|
|
417
|
-
urls: string[];
|
|
418
|
-
}, {
|
|
419
|
-
urls: string[];
|
|
420
|
-
}>;
|
|
421
|
-
type InputSchema$1 = z.infer<typeof inputSchema$1>;
|
|
422
|
-
declare function testUrlConfig(): {
|
|
423
|
-
title: string;
|
|
424
|
-
description: string;
|
|
425
|
-
inputSchema: {
|
|
426
|
-
urls: z.ZodArray<z.ZodString, "many">;
|
|
427
|
-
};
|
|
428
|
-
};
|
|
429
|
-
interface UrlTestResult {
|
|
430
|
-
url: string;
|
|
431
|
-
status: number;
|
|
432
|
-
title: string;
|
|
433
|
-
description: string;
|
|
434
|
-
}
|
|
435
|
-
declare function testUrls(input: InputSchema$1): Promise<{
|
|
436
|
-
results: UrlTestResult[];
|
|
437
|
-
}>;
|
|
438
|
-
|
|
439
|
-
declare const inputSchema: z.ZodObject<{
|
|
440
|
-
thought: z.ZodString;
|
|
441
|
-
nextThoughtNeeded: z.ZodOptional<z.ZodBoolean>;
|
|
442
|
-
}, "strip", z.ZodTypeAny, {
|
|
443
|
-
thought: string;
|
|
444
|
-
nextThoughtNeeded?: boolean | undefined;
|
|
445
|
-
}, {
|
|
446
|
-
thought: string;
|
|
447
|
-
nextThoughtNeeded?: boolean | undefined;
|
|
448
|
-
}>;
|
|
449
|
-
type InputSchema = z.infer<typeof inputSchema>;
|
|
450
|
-
declare function thinkConfig(): {
|
|
451
|
-
title: string;
|
|
452
|
-
description: string;
|
|
453
|
-
inputSchema: {
|
|
454
|
-
thought: z.ZodString;
|
|
455
|
-
nextThoughtNeeded: z.ZodOptional<z.ZodBoolean>;
|
|
456
|
-
};
|
|
457
|
-
};
|
|
458
|
-
declare function think(input: InputSchema): Promise<{
|
|
459
|
-
nextThoughtNeeded: boolean | undefined;
|
|
460
|
-
thoughtHistoryLength: number;
|
|
461
|
-
}>;
|
|
462
|
-
|
|
463
|
-
declare const todoInputSchema: z.ZodObject<{
|
|
464
|
-
newTodos: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
465
|
-
completedTodos: z.ZodOptional<z.ZodArray<z.ZodNumber, "many">>;
|
|
466
|
-
}, "strip", z.ZodTypeAny, {
|
|
467
|
-
newTodos?: string[] | undefined;
|
|
468
|
-
completedTodos?: number[] | undefined;
|
|
469
|
-
}, {
|
|
470
|
-
newTodos?: string[] | undefined;
|
|
471
|
-
completedTodos?: number[] | undefined;
|
|
472
|
-
}>;
|
|
473
|
-
type TodoInputSchema = z.infer<typeof todoInputSchema>;
|
|
474
|
-
declare function todoConfig(): {
|
|
475
|
-
title: string;
|
|
476
|
-
description: string;
|
|
477
|
-
inputSchema: {
|
|
478
|
-
newTodos: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
479
|
-
completedTodos: z.ZodOptional<z.ZodArray<z.ZodNumber, "many">>;
|
|
480
|
-
};
|
|
481
|
-
};
|
|
482
|
-
declare function todo(input: TodoInputSchema): Promise<{
|
|
483
|
-
todos: {
|
|
484
|
-
id: number;
|
|
485
|
-
title: string;
|
|
486
|
-
completed: boolean;
|
|
487
|
-
}[];
|
|
488
|
-
}>;
|
|
489
|
-
declare const clearTodoInputSchema: z.ZodObject<{}, "strip", z.ZodTypeAny, {}, {}>;
|
|
490
|
-
type ClearTodoInputSchema = z.infer<typeof clearTodoInputSchema>;
|
|
491
|
-
declare function clearTodoConfig(): {
|
|
492
|
-
title: string;
|
|
493
|
-
description: string;
|
|
494
|
-
inputSchema: {};
|
|
495
|
-
};
|
|
496
|
-
declare function clearTodo(input: ClearTodoInputSchema): Promise<{
|
|
497
|
-
todos: {
|
|
498
|
-
id: number;
|
|
499
|
-
title: string;
|
|
500
|
-
completed: boolean;
|
|
501
|
-
}[];
|
|
502
|
-
}>;
|
|
503
|
-
|
|
504
|
-
declare const toolInputSchema: z.ZodObject<{
|
|
505
|
-
path: z.ZodString;
|
|
506
|
-
text: z.ZodString;
|
|
507
|
-
}, "strip", z.ZodTypeAny, {
|
|
508
|
-
path: string;
|
|
509
|
-
text: string;
|
|
510
|
-
}, {
|
|
511
|
-
path: string;
|
|
512
|
-
text: string;
|
|
513
|
-
}>;
|
|
514
|
-
type ToolInputSchema = z.infer<typeof toolInputSchema>;
|
|
515
|
-
declare function writeTextFileConfig(): {
|
|
516
|
-
title: string;
|
|
517
|
-
description: string;
|
|
518
|
-
inputSchema: {
|
|
519
|
-
path: z.ZodString;
|
|
520
|
-
text: z.ZodString;
|
|
521
|
-
};
|
|
522
|
-
};
|
|
523
|
-
declare function writeTextFileLocalMode(input: ToolInputSchema): Promise<{
|
|
524
|
-
path: string;
|
|
525
|
-
text: string;
|
|
526
|
-
}>;
|
|
527
|
-
declare function writeTextFileStudioMode(input: ToolInputSchema): Promise<{
|
|
528
|
-
path: string;
|
|
529
|
-
text: string;
|
|
530
|
-
}>;
|
|
531
|
-
|
|
532
|
-
export { type ToolFunction, type ToolResult, type WorkspaceItem, type WorkspaceItemDirectory, type WorkspaceItemFile, WorkspaceMode, appendTextFileConfig, appendTextFileLocalMode, appendTextFileStudioMode, attemptCompletion, attemptCompletionConfig, clearTodo, clearTodoConfig, createDirectoryConfig, createDirectoryLocalMode, createDirectoryStudioMode, createWorkspaceItem, deleteFileConfig, deleteFileLocalMode, deleteFileStudioMode, deleteWorkspaceItem, editTextFileConfig, editTextFileLocalMode, editTextFileStudioMode, exec, execConfig, findWorkspaceItem, getFileInfoConfig, getFileInfoLocalMode, getFileInfoStudioMode, getWorkspaceApiConfig, getWorkspaceItemContent, getWorkspaceItems, getWorkspaceMode, listDirectoryConfig, listDirectoryLocalMode, listDirectoryStudioMode, moveFileConfig, moveFileLocalMode, moveFileStudioMode, readImageFile, readImageFileConfig, readPdfFile, readPdfFileConfig, readTextFile, readTextFileConfig, resolveToolByMode, testUrlConfig, testUrls, think, thinkConfig, todo, todoConfig, updateWorkspaceItem, validatePath, workspacePath, writeTextFileConfig, writeTextFileLocalMode, writeTextFileStudioMode };
|