@mastra/core 1.1.0-alpha.0 → 1.1.0-alpha.1
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 +26 -0
- package/dist/agent/index.cjs +8 -8
- package/dist/agent/index.js +1 -1
- package/dist/{chunk-Z3XVFOTH.js → chunk-64LMKFD3.js} +4 -4
- package/dist/{chunk-Z3XVFOTH.js.map → chunk-64LMKFD3.js.map} +1 -1
- package/dist/{chunk-WBJMSOYD.cjs → chunk-66462UTX.cjs} +192 -140
- package/dist/chunk-66462UTX.cjs.map +1 -0
- package/dist/{chunk-N2FELMHU.cjs → chunk-BKUNHQZ4.cjs} +57 -24
- package/dist/chunk-BKUNHQZ4.cjs.map +1 -0
- package/dist/{chunk-DXTYXWYM.cjs → chunk-C6YO523J.cjs} +7 -7
- package/dist/{chunk-DXTYXWYM.cjs.map → chunk-C6YO523J.cjs.map} +1 -1
- package/dist/{chunk-OZFBUMI3.cjs → chunk-EZWVMAC6.cjs} +7 -7
- package/dist/{chunk-OZFBUMI3.cjs.map → chunk-EZWVMAC6.cjs.map} +1 -1
- package/dist/{chunk-ACEGVEZF.js → chunk-H4C5NORS.js} +66 -46
- package/dist/chunk-H4C5NORS.js.map +1 -0
- package/dist/{chunk-5VWOGZLE.js → chunk-HKD4NSHR.js} +49 -16
- package/dist/chunk-HKD4NSHR.js.map +1 -0
- package/dist/{chunk-3CXWVB55.cjs → chunk-IKS5Z56O.cjs} +39 -36
- package/dist/{chunk-3CXWVB55.cjs.map → chunk-IKS5Z56O.cjs.map} +1 -1
- package/dist/{chunk-YETWOFQL.js → chunk-KPIJA2R5.js} +21 -31
- package/dist/chunk-KPIJA2R5.js.map +1 -0
- package/dist/{chunk-XSRROONT.cjs → chunk-LMNHODU4.cjs} +5 -5
- package/dist/{chunk-XSRROONT.cjs.map → chunk-LMNHODU4.cjs.map} +1 -1
- package/dist/{chunk-ZZCLGEMJ.js → chunk-NVRAVZZM.js} +192 -139
- package/dist/chunk-NVRAVZZM.js.map +1 -0
- package/dist/{chunk-6FHHT22W.cjs → chunk-O7II2PSR.cjs} +44 -44
- package/dist/{chunk-6FHHT22W.cjs.map → chunk-O7II2PSR.cjs.map} +1 -1
- package/dist/{chunk-ARMHYWF5.js → chunk-QT56V3PE.js} +4 -4
- package/dist/{chunk-ARMHYWF5.js.map → chunk-QT56V3PE.js.map} +1 -1
- package/dist/{chunk-TV4DA7RI.cjs → chunk-RIPKI7ON.cjs} +21 -31
- package/dist/chunk-RIPKI7ON.cjs.map +1 -0
- package/dist/{chunk-5BEYS33K.js → chunk-RQGER4J4.js} +3 -3
- package/dist/{chunk-5BEYS33K.js.map → chunk-RQGER4J4.js.map} +1 -1
- package/dist/{chunk-REH5FX2O.js → chunk-SFICZTYL.js} +28 -25
- package/dist/chunk-SFICZTYL.js.map +1 -0
- package/dist/{chunk-CEYA6FNF.js → chunk-SJUNV5AS.js} +3 -3
- package/dist/{chunk-CEYA6FNF.js.map → chunk-SJUNV5AS.js.map} +1 -1
- package/dist/{chunk-ETSBNSRY.cjs → chunk-TO7IB5JE.cjs} +17 -9
- package/dist/chunk-TO7IB5JE.cjs.map +1 -0
- package/dist/{chunk-QGVPEZ5T.js → chunk-UJRSZGKO.js} +16 -8
- package/dist/chunk-UJRSZGKO.js.map +1 -0
- package/dist/{chunk-RFTFSXJY.cjs → chunk-YSFYUEEG.cjs} +72 -52
- package/dist/chunk-YSFYUEEG.cjs.map +1 -0
- package/dist/docs/README.md +1 -1
- package/dist/docs/SKILL.md +1 -1
- package/dist/docs/SOURCE_MAP.json +271 -271
- package/dist/docs/agents/01-overview.md +2 -2
- package/dist/docs/evals/01-overview.md +5 -5
- package/dist/docs/mcp/01-overview.md +2 -2
- package/dist/docs/observability/01-overview.md +1 -1
- package/dist/docs/observability/03-overview.md +3 -3
- package/dist/docs/rag/01-overview.md +1 -1
- package/dist/docs/tools-mcp/01-mcp-overview.md +2 -2
- package/dist/docs/voice/01-overview.md +1 -1
- package/dist/docs/workflows/01-overview.md +5 -5
- package/dist/docs/workspace/01-overview.md +32 -29
- package/dist/docs/workspace/02-filesystem.md +13 -0
- package/dist/docs/workspace/03-sandbox.md +11 -4
- package/dist/docs/workspace/05-search.md +1 -1
- package/dist/docs/workspace/06-reference.md +304 -12
- package/dist/evals/index.cjs +20 -20
- package/dist/evals/index.js +3 -3
- package/dist/evals/scoreTraces/index.cjs +5 -5
- package/dist/evals/scoreTraces/index.js +2 -2
- package/dist/index.cjs +2 -2
- package/dist/index.js +1 -1
- package/dist/llm/index.cjs +9 -9
- package/dist/llm/index.js +2 -2
- package/dist/llm/model/provider-types.generated.d.ts +6 -2
- package/dist/loop/index.cjs +12 -12
- package/dist/loop/index.js +1 -1
- package/dist/loop/network/index.d.ts.map +1 -1
- package/dist/mastra/index.cjs +2 -2
- package/dist/mastra/index.d.ts +3 -3
- package/dist/mastra/index.d.ts.map +1 -1
- package/dist/mastra/index.js +1 -1
- package/dist/memory/index.cjs +11 -11
- package/dist/memory/index.js +1 -1
- package/dist/processors/index.cjs +40 -40
- package/dist/processors/index.js +1 -1
- package/dist/provider-registry-JZ6QRIVL.cjs +40 -0
- package/dist/{provider-registry-63ZEAPKK.cjs.map → provider-registry-JZ6QRIVL.cjs.map} +1 -1
- package/dist/provider-registry-SQTJTKSM.js +3 -0
- package/dist/{provider-registry-4RA5NQGH.js.map → provider-registry-SQTJTKSM.js.map} +1 -1
- package/dist/provider-registry.json +14 -6
- package/dist/relevance/index.cjs +3 -3
- package/dist/relevance/index.js +1 -1
- package/dist/storage/constants.cjs +16 -16
- package/dist/storage/constants.d.ts.map +1 -1
- package/dist/storage/constants.js +1 -1
- package/dist/storage/domains/agents/base.d.ts +17 -23
- package/dist/storage/domains/agents/base.d.ts.map +1 -1
- package/dist/storage/domains/agents/inmemory.d.ts +1 -1
- package/dist/storage/domains/agents/inmemory.d.ts.map +1 -1
- package/dist/storage/index.cjs +101 -101
- package/dist/storage/index.js +2 -2
- package/dist/storage/types.d.ts +53 -37
- package/dist/storage/types.d.ts.map +1 -1
- package/dist/stream/index.cjs +8 -8
- package/dist/stream/index.js +1 -1
- package/dist/tool-loop-agent/index.cjs +4 -4
- package/dist/tool-loop-agent/index.js +1 -1
- package/dist/vector/index.cjs +7 -7
- package/dist/vector/index.js +1 -1
- package/dist/workflows/evented/index.cjs +10 -10
- package/dist/workflows/evented/index.js +1 -1
- package/dist/workflows/index.cjs +24 -24
- package/dist/workflows/index.js +1 -1
- package/dist/workspace/index.cjs +32 -32
- package/dist/workspace/index.js +1 -1
- package/dist/workspace/skills/schemas.d.ts +17 -47
- package/dist/workspace/skills/schemas.d.ts.map +1 -1
- package/dist/workspace/skills/types.d.ts +4 -4
- package/dist/workspace/skills/types.d.ts.map +1 -1
- package/package.json +4 -4
- package/src/llm/model/provider-types.generated.d.ts +6 -2
- package/dist/chunk-5VWOGZLE.js.map +0 -1
- package/dist/chunk-ACEGVEZF.js.map +0 -1
- package/dist/chunk-ETSBNSRY.cjs.map +0 -1
- package/dist/chunk-N2FELMHU.cjs.map +0 -1
- package/dist/chunk-QGVPEZ5T.js.map +0 -1
- package/dist/chunk-REH5FX2O.js.map +0 -1
- package/dist/chunk-RFTFSXJY.cjs.map +0 -1
- package/dist/chunk-TV4DA7RI.cjs.map +0 -1
- package/dist/chunk-WBJMSOYD.cjs.map +0 -1
- package/dist/chunk-YETWOFQL.js.map +0 -1
- package/dist/chunk-ZZCLGEMJ.js.map +0 -1
- package/dist/provider-registry-4RA5NQGH.js +0 -3
- package/dist/provider-registry-63ZEAPKK.cjs +0 -40
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
var chunkIIZF4W7B_cjs = require('./chunk-IIZF4W7B.cjs');
|
|
4
|
-
var z = require('zod');
|
|
5
4
|
var fs2 = require('fs/promises');
|
|
6
5
|
var nodePath = require('path');
|
|
7
6
|
var fs = require('fs');
|
|
@@ -9,6 +8,7 @@ var matter = require('gray-matter');
|
|
|
9
8
|
var childProcess = require('child_process');
|
|
10
9
|
var crypto = require('crypto');
|
|
11
10
|
var os = require('os');
|
|
11
|
+
var zod = require('zod');
|
|
12
12
|
|
|
13
13
|
function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
|
|
14
14
|
|
|
@@ -30,7 +30,6 @@ function _interopNamespace(e) {
|
|
|
30
30
|
return Object.freeze(n);
|
|
31
31
|
}
|
|
32
32
|
|
|
33
|
-
var z__default = /*#__PURE__*/_interopDefault(z);
|
|
34
33
|
var fs2__namespace = /*#__PURE__*/_interopNamespace(fs2);
|
|
35
34
|
var nodePath__namespace = /*#__PURE__*/_interopNamespace(nodePath);
|
|
36
35
|
var matter__default = /*#__PURE__*/_interopDefault(matter);
|
|
@@ -858,6 +857,8 @@ var SearchEngine = class {
|
|
|
858
857
|
};
|
|
859
858
|
}
|
|
860
859
|
};
|
|
860
|
+
|
|
861
|
+
// src/workspace/skills/schemas.ts
|
|
861
862
|
var SKILL_LIMITS = {
|
|
862
863
|
/** Recommended max tokens for instructions */
|
|
863
864
|
MAX_INSTRUCTION_TOKENS: 5e3,
|
|
@@ -866,34 +867,77 @@ var SKILL_LIMITS = {
|
|
|
866
867
|
/** Max characters for name field */
|
|
867
868
|
MAX_NAME_LENGTH: 64,
|
|
868
869
|
/** Max characters for description field */
|
|
869
|
-
MAX_DESCRIPTION_LENGTH: 1024
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
|
|
877
|
-
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
}
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
|
|
893
|
-
|
|
894
|
-
|
|
895
|
-
|
|
896
|
-
|
|
870
|
+
MAX_DESCRIPTION_LENGTH: 1024};
|
|
871
|
+
function validateSkillName(name) {
|
|
872
|
+
const errors = [];
|
|
873
|
+
const fieldPath = "name";
|
|
874
|
+
if (typeof name !== "string") {
|
|
875
|
+
errors.push(`${fieldPath}: Expected string, received ${typeof name}`);
|
|
876
|
+
return errors;
|
|
877
|
+
}
|
|
878
|
+
if (name.length === 0) {
|
|
879
|
+
errors.push(`${fieldPath}: Skill name cannot be empty`);
|
|
880
|
+
return errors;
|
|
881
|
+
}
|
|
882
|
+
if (name.length > SKILL_LIMITS.MAX_NAME_LENGTH) {
|
|
883
|
+
errors.push(`${fieldPath}: Skill name must be ${SKILL_LIMITS.MAX_NAME_LENGTH} characters or less`);
|
|
884
|
+
}
|
|
885
|
+
if (!/^[a-z0-9-]+$/.test(name)) {
|
|
886
|
+
errors.push(`${fieldPath}: Skill name must contain only lowercase letters, numbers, and hyphens`);
|
|
887
|
+
}
|
|
888
|
+
if (name.startsWith("-") || name.endsWith("-")) {
|
|
889
|
+
errors.push(`${fieldPath}: Skill name must not start or end with a hyphen`);
|
|
890
|
+
}
|
|
891
|
+
if (name.includes("--")) {
|
|
892
|
+
errors.push(`${fieldPath}: Skill name must not contain consecutive hyphens`);
|
|
893
|
+
}
|
|
894
|
+
return errors;
|
|
895
|
+
}
|
|
896
|
+
function validateSkillDescription(description) {
|
|
897
|
+
const errors = [];
|
|
898
|
+
const fieldPath = "description";
|
|
899
|
+
if (typeof description !== "string") {
|
|
900
|
+
errors.push(`${fieldPath}: Expected string, received ${typeof description}`);
|
|
901
|
+
return errors;
|
|
902
|
+
}
|
|
903
|
+
if (description.length === 0) {
|
|
904
|
+
errors.push(`${fieldPath}: Skill description cannot be empty`);
|
|
905
|
+
return errors;
|
|
906
|
+
}
|
|
907
|
+
if (description.length > SKILL_LIMITS.MAX_DESCRIPTION_LENGTH) {
|
|
908
|
+
errors.push(`${fieldPath}: Skill description must be ${SKILL_LIMITS.MAX_DESCRIPTION_LENGTH} characters or less`);
|
|
909
|
+
}
|
|
910
|
+
if (description.trim().length === 0) {
|
|
911
|
+
errors.push(`${fieldPath}: Skill description cannot be only whitespace`);
|
|
912
|
+
}
|
|
913
|
+
return errors;
|
|
914
|
+
}
|
|
915
|
+
function validateSkillLicense(license) {
|
|
916
|
+
const errors = [];
|
|
917
|
+
const fieldPath = "license";
|
|
918
|
+
if (license === void 0 || license === null) {
|
|
919
|
+
return errors;
|
|
920
|
+
}
|
|
921
|
+
if (typeof license !== "string") {
|
|
922
|
+
errors.push(`${fieldPath}: Expected string, received ${typeof license}`);
|
|
923
|
+
}
|
|
924
|
+
return errors;
|
|
925
|
+
}
|
|
926
|
+
function validateSkillCompatibility(_compatibility) {
|
|
927
|
+
return [];
|
|
928
|
+
}
|
|
929
|
+
function validateSkillMetadataField(metadata) {
|
|
930
|
+
const errors = [];
|
|
931
|
+
const fieldPath = "metadata";
|
|
932
|
+
if (metadata === void 0 || metadata === null) {
|
|
933
|
+
return errors;
|
|
934
|
+
}
|
|
935
|
+
if (typeof metadata !== "object" || Array.isArray(metadata)) {
|
|
936
|
+
errors.push(`${fieldPath}: Expected object, received ${Array.isArray(metadata) ? "array" : typeof metadata}`);
|
|
937
|
+
return errors;
|
|
938
|
+
}
|
|
939
|
+
return errors;
|
|
940
|
+
}
|
|
897
941
|
function estimateTokens(text) {
|
|
898
942
|
const words = text.split(/\s+/).filter(Boolean).length;
|
|
899
943
|
return Math.ceil(words * 1.3);
|
|
@@ -904,12 +948,20 @@ function countLines(text) {
|
|
|
904
948
|
function validateSkillMetadata(metadata, dirName, instructions) {
|
|
905
949
|
const errors = [];
|
|
906
950
|
const warnings = [];
|
|
907
|
-
|
|
908
|
-
|
|
909
|
-
|
|
951
|
+
if (typeof metadata !== "object" || metadata === null || Array.isArray(metadata)) {
|
|
952
|
+
errors.push(
|
|
953
|
+
`Expected object, received ${metadata === null ? "null" : Array.isArray(metadata) ? "array" : typeof metadata}`
|
|
954
|
+
);
|
|
955
|
+
return { valid: false, errors, warnings };
|
|
910
956
|
}
|
|
911
|
-
|
|
912
|
-
|
|
957
|
+
const data = metadata;
|
|
958
|
+
errors.push(...validateSkillName(data.name));
|
|
959
|
+
errors.push(...validateSkillDescription(data.description));
|
|
960
|
+
errors.push(...validateSkillLicense(data.license));
|
|
961
|
+
errors.push(...validateSkillCompatibility());
|
|
962
|
+
errors.push(...validateSkillMetadataField(data.metadata));
|
|
963
|
+
if (dirName && typeof data.name === "string" && data.name !== dirName) {
|
|
964
|
+
errors.push(`Skill name "${data.name}" must match directory name "${dirName}"`);
|
|
913
965
|
}
|
|
914
966
|
if (instructions) {
|
|
915
967
|
const lineCount = countLines(instructions);
|
|
@@ -3254,22 +3306,22 @@ function createWorkspaceTools(workspace) {
|
|
|
3254
3306
|
id: WORKSPACE_TOOLS.FILESYSTEM.READ_FILE,
|
|
3255
3307
|
description: "Read the contents of a file from the workspace filesystem. Supports reading specific line ranges using offset/limit parameters.",
|
|
3256
3308
|
requireApproval: readFileConfig.requireApproval,
|
|
3257
|
-
inputSchema:
|
|
3258
|
-
path:
|
|
3259
|
-
encoding:
|
|
3260
|
-
offset:
|
|
3261
|
-
limit:
|
|
3262
|
-
showLineNumbers:
|
|
3309
|
+
inputSchema: zod.z.object({
|
|
3310
|
+
path: zod.z.string().describe('The path to the file to read (e.g., "/data/config.json")'),
|
|
3311
|
+
encoding: zod.z.enum(["utf-8", "utf8", "base64", "hex", "binary"]).optional().describe("The encoding to use when reading the file. Defaults to utf-8 for text files."),
|
|
3312
|
+
offset: zod.z.number().optional().describe("Line number to start reading from (1-indexed). If omitted, starts from line 1."),
|
|
3313
|
+
limit: zod.z.number().optional().describe("Maximum number of lines to read. If omitted, reads to the end of the file."),
|
|
3314
|
+
showLineNumbers: zod.z.boolean().optional().default(true).describe("Whether to prefix each line with its line number (default: true)")
|
|
3263
3315
|
}),
|
|
3264
|
-
outputSchema:
|
|
3265
|
-
content:
|
|
3266
|
-
size:
|
|
3267
|
-
path:
|
|
3268
|
-
lines:
|
|
3269
|
-
start:
|
|
3270
|
-
end:
|
|
3316
|
+
outputSchema: zod.z.object({
|
|
3317
|
+
content: zod.z.string().describe("The file contents (with optional line number prefixes)"),
|
|
3318
|
+
size: zod.z.number().describe("The file size in bytes"),
|
|
3319
|
+
path: zod.z.string().describe("The full path to the file"),
|
|
3320
|
+
lines: zod.z.object({
|
|
3321
|
+
start: zod.z.number().describe("First line number returned"),
|
|
3322
|
+
end: zod.z.number().describe("Last line number returned")
|
|
3271
3323
|
}).optional().describe("Line range information (when offset/limit used)"),
|
|
3272
|
-
totalLines:
|
|
3324
|
+
totalLines: zod.z.number().optional().describe("Total number of lines in the file")
|
|
3273
3325
|
}),
|
|
3274
3326
|
execute: async ({ path: path4, encoding, offset, limit, showLineNumbers }) => {
|
|
3275
3327
|
const effectiveEncoding = encoding ?? "utf-8";
|
|
@@ -3316,15 +3368,15 @@ function createWorkspaceTools(workspace) {
|
|
|
3316
3368
|
id: WORKSPACE_TOOLS.FILESYSTEM.WRITE_FILE,
|
|
3317
3369
|
description: "Write content to a file in the workspace filesystem. Creates parent directories if needed.",
|
|
3318
3370
|
requireApproval: writeFileConfig.requireApproval,
|
|
3319
|
-
inputSchema:
|
|
3320
|
-
path:
|
|
3321
|
-
content:
|
|
3322
|
-
overwrite:
|
|
3371
|
+
inputSchema: zod.z.object({
|
|
3372
|
+
path: zod.z.string().describe('The path where to write the file (e.g., "/data/output.txt")'),
|
|
3373
|
+
content: zod.z.string().describe("The content to write to the file"),
|
|
3374
|
+
overwrite: zod.z.boolean().optional().default(true).describe("Whether to overwrite the file if it already exists")
|
|
3323
3375
|
}),
|
|
3324
|
-
outputSchema:
|
|
3325
|
-
success:
|
|
3326
|
-
path:
|
|
3327
|
-
size:
|
|
3376
|
+
outputSchema: zod.z.object({
|
|
3377
|
+
success: zod.z.boolean(),
|
|
3378
|
+
path: zod.z.string().describe("The path where the file was written"),
|
|
3379
|
+
size: zod.z.number().describe("The size of the written content in bytes")
|
|
3328
3380
|
}),
|
|
3329
3381
|
execute: async ({ path: path4, content, overwrite }) => {
|
|
3330
3382
|
if (readTracker && writeFileConfig.requireReadBeforeWrite) {
|
|
@@ -3357,17 +3409,17 @@ function createWorkspaceTools(workspace) {
|
|
|
3357
3409
|
id: WORKSPACE_TOOLS.FILESYSTEM.EDIT_FILE,
|
|
3358
3410
|
description: "Edit a file by replacing specific text. The old_string must match exactly and be unique in the file (unless using replace_all). You should read the file first to ensure you have the exact text to replace.",
|
|
3359
3411
|
requireApproval: editFileConfig.requireApproval,
|
|
3360
|
-
inputSchema:
|
|
3361
|
-
path:
|
|
3362
|
-
old_string:
|
|
3363
|
-
new_string:
|
|
3364
|
-
replace_all:
|
|
3412
|
+
inputSchema: zod.z.object({
|
|
3413
|
+
path: zod.z.string().describe("The path to the file to edit"),
|
|
3414
|
+
old_string: zod.z.string().describe("The exact text to find and replace. Must be unique in the file."),
|
|
3415
|
+
new_string: zod.z.string().describe("The text to replace old_string with"),
|
|
3416
|
+
replace_all: zod.z.boolean().optional().default(false).describe("If true, replace all occurrences. If false (default), old_string must be unique.")
|
|
3365
3417
|
}),
|
|
3366
|
-
outputSchema:
|
|
3367
|
-
success:
|
|
3368
|
-
path:
|
|
3369
|
-
replacements:
|
|
3370
|
-
error:
|
|
3418
|
+
outputSchema: zod.z.object({
|
|
3419
|
+
success: zod.z.boolean(),
|
|
3420
|
+
path: zod.z.string().describe("The path to the edited file"),
|
|
3421
|
+
replacements: zod.z.number().describe("Number of replacements made"),
|
|
3422
|
+
error: zod.z.string().optional().describe("Error message if the edit failed")
|
|
3371
3423
|
}),
|
|
3372
3424
|
execute: async ({ path: path4, old_string, new_string, replace_all }) => {
|
|
3373
3425
|
try {
|
|
@@ -3437,26 +3489,26 @@ Examples:
|
|
|
3437
3489
|
- Directories only: { path: "/", dirsOnly: true }
|
|
3438
3490
|
- Exclude node_modules: { path: "/", exclude: "node_modules" }`,
|
|
3439
3491
|
requireApproval: listFilesConfig.requireApproval,
|
|
3440
|
-
inputSchema:
|
|
3441
|
-
path:
|
|
3442
|
-
maxDepth:
|
|
3443
|
-
showHidden:
|
|
3444
|
-
dirsOnly:
|
|
3445
|
-
exclude:
|
|
3446
|
-
extension:
|
|
3492
|
+
inputSchema: zod.z.object({
|
|
3493
|
+
path: zod.z.string().default("/").describe("Directory path to list"),
|
|
3494
|
+
maxDepth: zod.z.number().optional().default(3).describe("Maximum depth to descend (default: 3). Similar to tree -L flag."),
|
|
3495
|
+
showHidden: zod.z.boolean().optional().default(false).describe('Show hidden files starting with "." (default: false). Similar to tree -a flag.'),
|
|
3496
|
+
dirsOnly: zod.z.boolean().optional().default(false).describe("List directories only, no files (default: false). Similar to tree -d flag."),
|
|
3497
|
+
exclude: zod.z.string().optional().describe('Pattern to exclude (e.g., "node_modules"). Similar to tree -I flag.'),
|
|
3498
|
+
extension: zod.z.string().optional().describe('Filter by file extension (e.g., ".ts"). Similar to tree -P flag.')
|
|
3447
3499
|
}),
|
|
3448
|
-
outputSchema:
|
|
3449
|
-
tree:
|
|
3450
|
-
summary:
|
|
3451
|
-
metadata:
|
|
3452
|
-
workspace:
|
|
3453
|
-
id:
|
|
3454
|
-
name:
|
|
3500
|
+
outputSchema: zod.z.object({
|
|
3501
|
+
tree: zod.z.string().describe("Tree-style directory listing"),
|
|
3502
|
+
summary: zod.z.string().describe('Summary of directories and files (e.g., "3 directories, 12 files")'),
|
|
3503
|
+
metadata: zod.z.object({
|
|
3504
|
+
workspace: zod.z.object({
|
|
3505
|
+
id: zod.z.string().optional(),
|
|
3506
|
+
name: zod.z.string().optional()
|
|
3455
3507
|
}).optional(),
|
|
3456
|
-
filesystem:
|
|
3457
|
-
id:
|
|
3458
|
-
name:
|
|
3459
|
-
provider:
|
|
3508
|
+
filesystem: zod.z.object({
|
|
3509
|
+
id: zod.z.string().optional(),
|
|
3510
|
+
name: zod.z.string().optional(),
|
|
3511
|
+
provider: zod.z.string().optional()
|
|
3460
3512
|
}).optional()
|
|
3461
3513
|
}).optional().describe("Metadata about the workspace and filesystem")
|
|
3462
3514
|
}),
|
|
@@ -3494,15 +3546,15 @@ Examples:
|
|
|
3494
3546
|
id: WORKSPACE_TOOLS.FILESYSTEM.DELETE,
|
|
3495
3547
|
description: "Delete a file or directory from the workspace filesystem",
|
|
3496
3548
|
requireApproval: deleteConfig.requireApproval,
|
|
3497
|
-
inputSchema:
|
|
3498
|
-
path:
|
|
3499
|
-
recursive:
|
|
3549
|
+
inputSchema: zod.z.object({
|
|
3550
|
+
path: zod.z.string().describe("The path to the file or directory to delete"),
|
|
3551
|
+
recursive: zod.z.boolean().optional().default(false).describe(
|
|
3500
3552
|
"If true, delete directories and their contents recursively. Required for non-empty directories."
|
|
3501
3553
|
)
|
|
3502
3554
|
}),
|
|
3503
|
-
outputSchema:
|
|
3504
|
-
success:
|
|
3505
|
-
path:
|
|
3555
|
+
outputSchema: zod.z.object({
|
|
3556
|
+
success: zod.z.boolean(),
|
|
3557
|
+
path: zod.z.string()
|
|
3506
3558
|
}),
|
|
3507
3559
|
execute: async ({ path: path4, recursive }) => {
|
|
3508
3560
|
const stat3 = await workspace.filesystem.stat(path4);
|
|
@@ -3521,14 +3573,14 @@ Examples:
|
|
|
3521
3573
|
id: WORKSPACE_TOOLS.FILESYSTEM.FILE_STAT,
|
|
3522
3574
|
description: "Get file or directory metadata from the workspace. Returns existence, type, size, and modification time.",
|
|
3523
3575
|
requireApproval: fileStatConfig.requireApproval,
|
|
3524
|
-
inputSchema:
|
|
3525
|
-
path:
|
|
3576
|
+
inputSchema: zod.z.object({
|
|
3577
|
+
path: zod.z.string().describe("The path to check")
|
|
3526
3578
|
}),
|
|
3527
|
-
outputSchema:
|
|
3528
|
-
exists:
|
|
3529
|
-
type:
|
|
3530
|
-
size:
|
|
3531
|
-
modifiedAt:
|
|
3579
|
+
outputSchema: zod.z.object({
|
|
3580
|
+
exists: zod.z.boolean().describe("Whether the path exists"),
|
|
3581
|
+
type: zod.z.enum(["file", "directory", "none"]).describe("The type of the path if it exists"),
|
|
3582
|
+
size: zod.z.number().optional().describe("Size in bytes (for files)"),
|
|
3583
|
+
modifiedAt: zod.z.string().optional().describe("Last modification time (ISO string)")
|
|
3532
3584
|
}),
|
|
3533
3585
|
execute: async ({ path: path4 }) => {
|
|
3534
3586
|
try {
|
|
@@ -3554,13 +3606,13 @@ Examples:
|
|
|
3554
3606
|
id: WORKSPACE_TOOLS.FILESYSTEM.MKDIR,
|
|
3555
3607
|
description: "Create a directory in the workspace filesystem",
|
|
3556
3608
|
requireApproval: mkdirConfig.requireApproval,
|
|
3557
|
-
inputSchema:
|
|
3558
|
-
path:
|
|
3559
|
-
recursive:
|
|
3609
|
+
inputSchema: zod.z.object({
|
|
3610
|
+
path: zod.z.string().describe("The path of the directory to create"),
|
|
3611
|
+
recursive: zod.z.boolean().optional().default(true).describe("Whether to create parent directories if they do not exist")
|
|
3560
3612
|
}),
|
|
3561
|
-
outputSchema:
|
|
3562
|
-
success:
|
|
3563
|
-
path:
|
|
3613
|
+
outputSchema: zod.z.object({
|
|
3614
|
+
success: zod.z.boolean(),
|
|
3615
|
+
path: zod.z.string()
|
|
3564
3616
|
}),
|
|
3565
3617
|
execute: async ({ path: path4, recursive }) => {
|
|
3566
3618
|
await workspace.filesystem.mkdir(path4, { recursive });
|
|
@@ -3576,26 +3628,26 @@ Examples:
|
|
|
3576
3628
|
id: WORKSPACE_TOOLS.SEARCH.SEARCH,
|
|
3577
3629
|
description: "Search indexed content in the workspace. Supports keyword (BM25), semantic (vector), and hybrid search modes.",
|
|
3578
3630
|
requireApproval: searchConfig.requireApproval,
|
|
3579
|
-
inputSchema:
|
|
3580
|
-
query:
|
|
3581
|
-
topK:
|
|
3582
|
-
mode:
|
|
3583
|
-
minScore:
|
|
3631
|
+
inputSchema: zod.z.object({
|
|
3632
|
+
query: zod.z.string().describe("The search query string"),
|
|
3633
|
+
topK: zod.z.number().optional().default(5).describe("Maximum number of results to return"),
|
|
3634
|
+
mode: zod.z.enum(["bm25", "vector", "hybrid"]).optional().describe("Search mode: bm25 for keyword search, vector for semantic search, hybrid for both combined"),
|
|
3635
|
+
minScore: zod.z.number().optional().describe("Minimum score threshold (0-1 for normalized scores)")
|
|
3584
3636
|
}),
|
|
3585
|
-
outputSchema:
|
|
3586
|
-
results:
|
|
3587
|
-
|
|
3588
|
-
id:
|
|
3589
|
-
content:
|
|
3590
|
-
score:
|
|
3591
|
-
lineRange:
|
|
3592
|
-
start:
|
|
3593
|
-
end:
|
|
3637
|
+
outputSchema: zod.z.object({
|
|
3638
|
+
results: zod.z.array(
|
|
3639
|
+
zod.z.object({
|
|
3640
|
+
id: zod.z.string().describe("Document/file path"),
|
|
3641
|
+
content: zod.z.string().describe("The matching content"),
|
|
3642
|
+
score: zod.z.number().describe("Relevance score"),
|
|
3643
|
+
lineRange: zod.z.object({
|
|
3644
|
+
start: zod.z.number(),
|
|
3645
|
+
end: zod.z.number()
|
|
3594
3646
|
}).optional().describe("Line range where query terms were found")
|
|
3595
3647
|
})
|
|
3596
3648
|
),
|
|
3597
|
-
count:
|
|
3598
|
-
mode:
|
|
3649
|
+
count: zod.z.number().describe("Number of results returned"),
|
|
3650
|
+
mode: zod.z.string().describe("The search mode that was used")
|
|
3599
3651
|
}),
|
|
3600
3652
|
execute: async ({ query, topK, mode, minScore }) => {
|
|
3601
3653
|
const results = await workspace.search(query, {
|
|
@@ -3622,14 +3674,14 @@ Examples:
|
|
|
3622
3674
|
id: WORKSPACE_TOOLS.SEARCH.INDEX,
|
|
3623
3675
|
description: "Index content for search. The path becomes the document ID in search results.",
|
|
3624
3676
|
requireApproval: indexConfig.requireApproval,
|
|
3625
|
-
inputSchema:
|
|
3626
|
-
path:
|
|
3627
|
-
content:
|
|
3628
|
-
metadata:
|
|
3677
|
+
inputSchema: zod.z.object({
|
|
3678
|
+
path: zod.z.string().describe("The document ID/path for search results"),
|
|
3679
|
+
content: zod.z.string().describe("The text content to index"),
|
|
3680
|
+
metadata: zod.z.record(zod.z.unknown()).optional().describe("Optional metadata to store with the document")
|
|
3629
3681
|
}),
|
|
3630
|
-
outputSchema:
|
|
3631
|
-
success:
|
|
3632
|
-
path:
|
|
3682
|
+
outputSchema: zod.z.object({
|
|
3683
|
+
success: zod.z.boolean(),
|
|
3684
|
+
path: zod.z.string().describe("The indexed document ID")
|
|
3633
3685
|
}),
|
|
3634
3686
|
execute: async ({ path: path4, content, metadata }) => {
|
|
3635
3687
|
await workspace.index(path4, content, { metadata });
|
|
@@ -3647,20 +3699,20 @@ Examples:
|
|
|
3647
3699
|
id: WORKSPACE_TOOLS.SANDBOX.EXECUTE_COMMAND,
|
|
3648
3700
|
description: `Execute a shell command in the workspace sandbox. The output (stdout/stderr) is displayed to the user automatically in the tool result. ${pathInfo}`,
|
|
3649
3701
|
requireApproval: executeCommandConfig.requireApproval,
|
|
3650
|
-
inputSchema:
|
|
3651
|
-
command:
|
|
3652
|
-
args:
|
|
3653
|
-
timeout:
|
|
3702
|
+
inputSchema: zod.z.object({
|
|
3703
|
+
command: zod.z.string().describe('The command to execute (e.g., "ls", "npm", "python")'),
|
|
3704
|
+
args: zod.z.array(zod.z.string()).nullish().default([]).describe("Arguments to pass to the command"),
|
|
3705
|
+
timeout: zod.z.number().nullish().default(3e4).describe(
|
|
3654
3706
|
"Maximum execution time in milliseconds. Default is 30000 (30 seconds). Example: 60000 for 1 minute."
|
|
3655
3707
|
),
|
|
3656
|
-
cwd:
|
|
3708
|
+
cwd: zod.z.string().nullish().describe("Working directory for the command")
|
|
3657
3709
|
}),
|
|
3658
|
-
outputSchema:
|
|
3659
|
-
success:
|
|
3660
|
-
stdout:
|
|
3661
|
-
stderr:
|
|
3662
|
-
exitCode:
|
|
3663
|
-
executionTimeMs:
|
|
3710
|
+
outputSchema: zod.z.object({
|
|
3711
|
+
success: zod.z.boolean().describe("Whether the command executed successfully (exit code 0)"),
|
|
3712
|
+
stdout: zod.z.string().describe("Standard output from the command"),
|
|
3713
|
+
stderr: zod.z.string().describe("Standard error output"),
|
|
3714
|
+
exitCode: zod.z.number().describe("Exit code (0 = success)"),
|
|
3715
|
+
executionTimeMs: zod.z.number().describe("How long the execution took in milliseconds")
|
|
3664
3716
|
}),
|
|
3665
3717
|
execute: async ({ command, args, timeout, cwd }, context) => {
|
|
3666
3718
|
const getExecutionMetadata = () => ({
|
|
@@ -3761,5 +3813,5 @@ exports.extractLines = extractLines;
|
|
|
3761
3813
|
exports.getRecommendedIsolation = getRecommendedIsolation;
|
|
3762
3814
|
exports.isIsolationAvailable = isIsolationAvailable;
|
|
3763
3815
|
exports.resolveToolConfig = resolveToolConfig;
|
|
3764
|
-
//# sourceMappingURL=chunk-
|
|
3765
|
-
//# sourceMappingURL=chunk-
|
|
3816
|
+
//# sourceMappingURL=chunk-66462UTX.cjs.map
|
|
3817
|
+
//# sourceMappingURL=chunk-66462UTX.cjs.map
|