@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.
Files changed (129) hide show
  1. package/CHANGELOG.md +26 -0
  2. package/dist/agent/index.cjs +8 -8
  3. package/dist/agent/index.js +1 -1
  4. package/dist/{chunk-Z3XVFOTH.js → chunk-64LMKFD3.js} +4 -4
  5. package/dist/{chunk-Z3XVFOTH.js.map → chunk-64LMKFD3.js.map} +1 -1
  6. package/dist/{chunk-WBJMSOYD.cjs → chunk-66462UTX.cjs} +192 -140
  7. package/dist/chunk-66462UTX.cjs.map +1 -0
  8. package/dist/{chunk-N2FELMHU.cjs → chunk-BKUNHQZ4.cjs} +57 -24
  9. package/dist/chunk-BKUNHQZ4.cjs.map +1 -0
  10. package/dist/{chunk-DXTYXWYM.cjs → chunk-C6YO523J.cjs} +7 -7
  11. package/dist/{chunk-DXTYXWYM.cjs.map → chunk-C6YO523J.cjs.map} +1 -1
  12. package/dist/{chunk-OZFBUMI3.cjs → chunk-EZWVMAC6.cjs} +7 -7
  13. package/dist/{chunk-OZFBUMI3.cjs.map → chunk-EZWVMAC6.cjs.map} +1 -1
  14. package/dist/{chunk-ACEGVEZF.js → chunk-H4C5NORS.js} +66 -46
  15. package/dist/chunk-H4C5NORS.js.map +1 -0
  16. package/dist/{chunk-5VWOGZLE.js → chunk-HKD4NSHR.js} +49 -16
  17. package/dist/chunk-HKD4NSHR.js.map +1 -0
  18. package/dist/{chunk-3CXWVB55.cjs → chunk-IKS5Z56O.cjs} +39 -36
  19. package/dist/{chunk-3CXWVB55.cjs.map → chunk-IKS5Z56O.cjs.map} +1 -1
  20. package/dist/{chunk-YETWOFQL.js → chunk-KPIJA2R5.js} +21 -31
  21. package/dist/chunk-KPIJA2R5.js.map +1 -0
  22. package/dist/{chunk-XSRROONT.cjs → chunk-LMNHODU4.cjs} +5 -5
  23. package/dist/{chunk-XSRROONT.cjs.map → chunk-LMNHODU4.cjs.map} +1 -1
  24. package/dist/{chunk-ZZCLGEMJ.js → chunk-NVRAVZZM.js} +192 -139
  25. package/dist/chunk-NVRAVZZM.js.map +1 -0
  26. package/dist/{chunk-6FHHT22W.cjs → chunk-O7II2PSR.cjs} +44 -44
  27. package/dist/{chunk-6FHHT22W.cjs.map → chunk-O7II2PSR.cjs.map} +1 -1
  28. package/dist/{chunk-ARMHYWF5.js → chunk-QT56V3PE.js} +4 -4
  29. package/dist/{chunk-ARMHYWF5.js.map → chunk-QT56V3PE.js.map} +1 -1
  30. package/dist/{chunk-TV4DA7RI.cjs → chunk-RIPKI7ON.cjs} +21 -31
  31. package/dist/chunk-RIPKI7ON.cjs.map +1 -0
  32. package/dist/{chunk-5BEYS33K.js → chunk-RQGER4J4.js} +3 -3
  33. package/dist/{chunk-5BEYS33K.js.map → chunk-RQGER4J4.js.map} +1 -1
  34. package/dist/{chunk-REH5FX2O.js → chunk-SFICZTYL.js} +28 -25
  35. package/dist/chunk-SFICZTYL.js.map +1 -0
  36. package/dist/{chunk-CEYA6FNF.js → chunk-SJUNV5AS.js} +3 -3
  37. package/dist/{chunk-CEYA6FNF.js.map → chunk-SJUNV5AS.js.map} +1 -1
  38. package/dist/{chunk-ETSBNSRY.cjs → chunk-TO7IB5JE.cjs} +17 -9
  39. package/dist/chunk-TO7IB5JE.cjs.map +1 -0
  40. package/dist/{chunk-QGVPEZ5T.js → chunk-UJRSZGKO.js} +16 -8
  41. package/dist/chunk-UJRSZGKO.js.map +1 -0
  42. package/dist/{chunk-RFTFSXJY.cjs → chunk-YSFYUEEG.cjs} +72 -52
  43. package/dist/chunk-YSFYUEEG.cjs.map +1 -0
  44. package/dist/docs/README.md +1 -1
  45. package/dist/docs/SKILL.md +1 -1
  46. package/dist/docs/SOURCE_MAP.json +271 -271
  47. package/dist/docs/agents/01-overview.md +2 -2
  48. package/dist/docs/evals/01-overview.md +5 -5
  49. package/dist/docs/mcp/01-overview.md +2 -2
  50. package/dist/docs/observability/01-overview.md +1 -1
  51. package/dist/docs/observability/03-overview.md +3 -3
  52. package/dist/docs/rag/01-overview.md +1 -1
  53. package/dist/docs/tools-mcp/01-mcp-overview.md +2 -2
  54. package/dist/docs/voice/01-overview.md +1 -1
  55. package/dist/docs/workflows/01-overview.md +5 -5
  56. package/dist/docs/workspace/01-overview.md +32 -29
  57. package/dist/docs/workspace/02-filesystem.md +13 -0
  58. package/dist/docs/workspace/03-sandbox.md +11 -4
  59. package/dist/docs/workspace/05-search.md +1 -1
  60. package/dist/docs/workspace/06-reference.md +304 -12
  61. package/dist/evals/index.cjs +20 -20
  62. package/dist/evals/index.js +3 -3
  63. package/dist/evals/scoreTraces/index.cjs +5 -5
  64. package/dist/evals/scoreTraces/index.js +2 -2
  65. package/dist/index.cjs +2 -2
  66. package/dist/index.js +1 -1
  67. package/dist/llm/index.cjs +9 -9
  68. package/dist/llm/index.js +2 -2
  69. package/dist/llm/model/provider-types.generated.d.ts +6 -2
  70. package/dist/loop/index.cjs +12 -12
  71. package/dist/loop/index.js +1 -1
  72. package/dist/loop/network/index.d.ts.map +1 -1
  73. package/dist/mastra/index.cjs +2 -2
  74. package/dist/mastra/index.d.ts +3 -3
  75. package/dist/mastra/index.d.ts.map +1 -1
  76. package/dist/mastra/index.js +1 -1
  77. package/dist/memory/index.cjs +11 -11
  78. package/dist/memory/index.js +1 -1
  79. package/dist/processors/index.cjs +40 -40
  80. package/dist/processors/index.js +1 -1
  81. package/dist/provider-registry-JZ6QRIVL.cjs +40 -0
  82. package/dist/{provider-registry-63ZEAPKK.cjs.map → provider-registry-JZ6QRIVL.cjs.map} +1 -1
  83. package/dist/provider-registry-SQTJTKSM.js +3 -0
  84. package/dist/{provider-registry-4RA5NQGH.js.map → provider-registry-SQTJTKSM.js.map} +1 -1
  85. package/dist/provider-registry.json +14 -6
  86. package/dist/relevance/index.cjs +3 -3
  87. package/dist/relevance/index.js +1 -1
  88. package/dist/storage/constants.cjs +16 -16
  89. package/dist/storage/constants.d.ts.map +1 -1
  90. package/dist/storage/constants.js +1 -1
  91. package/dist/storage/domains/agents/base.d.ts +17 -23
  92. package/dist/storage/domains/agents/base.d.ts.map +1 -1
  93. package/dist/storage/domains/agents/inmemory.d.ts +1 -1
  94. package/dist/storage/domains/agents/inmemory.d.ts.map +1 -1
  95. package/dist/storage/index.cjs +101 -101
  96. package/dist/storage/index.js +2 -2
  97. package/dist/storage/types.d.ts +53 -37
  98. package/dist/storage/types.d.ts.map +1 -1
  99. package/dist/stream/index.cjs +8 -8
  100. package/dist/stream/index.js +1 -1
  101. package/dist/tool-loop-agent/index.cjs +4 -4
  102. package/dist/tool-loop-agent/index.js +1 -1
  103. package/dist/vector/index.cjs +7 -7
  104. package/dist/vector/index.js +1 -1
  105. package/dist/workflows/evented/index.cjs +10 -10
  106. package/dist/workflows/evented/index.js +1 -1
  107. package/dist/workflows/index.cjs +24 -24
  108. package/dist/workflows/index.js +1 -1
  109. package/dist/workspace/index.cjs +32 -32
  110. package/dist/workspace/index.js +1 -1
  111. package/dist/workspace/skills/schemas.d.ts +17 -47
  112. package/dist/workspace/skills/schemas.d.ts.map +1 -1
  113. package/dist/workspace/skills/types.d.ts +4 -4
  114. package/dist/workspace/skills/types.d.ts.map +1 -1
  115. package/package.json +4 -4
  116. package/src/llm/model/provider-types.generated.d.ts +6 -2
  117. package/dist/chunk-5VWOGZLE.js.map +0 -1
  118. package/dist/chunk-ACEGVEZF.js.map +0 -1
  119. package/dist/chunk-ETSBNSRY.cjs.map +0 -1
  120. package/dist/chunk-N2FELMHU.cjs.map +0 -1
  121. package/dist/chunk-QGVPEZ5T.js.map +0 -1
  122. package/dist/chunk-REH5FX2O.js.map +0 -1
  123. package/dist/chunk-RFTFSXJY.cjs.map +0 -1
  124. package/dist/chunk-TV4DA7RI.cjs.map +0 -1
  125. package/dist/chunk-WBJMSOYD.cjs.map +0 -1
  126. package/dist/chunk-YETWOFQL.js.map +0 -1
  127. package/dist/chunk-ZZCLGEMJ.js.map +0 -1
  128. package/dist/provider-registry-4RA5NQGH.js +0 -3
  129. package/dist/provider-registry-63ZEAPKK.cjs +0 -40
@@ -1,5 +1,4 @@
1
1
  import { createTool } from './chunk-IW3BNL7A.js';
2
- import z, { z as z$1 } from 'zod';
3
2
  import * as fs2 from 'fs/promises';
4
3
  import * as nodePath from 'path';
5
4
  import { constants } from 'fs';
@@ -9,6 +8,7 @@ import { execFileSync } from 'child_process';
9
8
  import * as crypto from 'crypto';
10
9
  import * as os from 'os';
11
10
  import os__default from 'os';
11
+ import { z } from 'zod';
12
12
 
13
13
  // src/workspace/errors.ts
14
14
  var WorkspaceError = class extends Error {
@@ -830,6 +830,8 @@ var SearchEngine = class {
830
830
  };
831
831
  }
832
832
  };
833
+
834
+ // src/workspace/skills/schemas.ts
833
835
  var SKILL_LIMITS = {
834
836
  /** Recommended max tokens for instructions */
835
837
  MAX_INSTRUCTION_TOKENS: 5e3,
@@ -838,34 +840,77 @@ var SKILL_LIMITS = {
838
840
  /** Max characters for name field */
839
841
  MAX_NAME_LENGTH: 64,
840
842
  /** Max characters for description field */
841
- MAX_DESCRIPTION_LENGTH: 1024,
842
- /** Max characters for compatibility field */
843
- MAX_COMPATIBILITY_LENGTH: 500
844
- };
845
- var SkillNameSchema = z.string().min(1, "Skill name cannot be empty").max(SKILL_LIMITS.MAX_NAME_LENGTH, `Skill name must be ${SKILL_LIMITS.MAX_NAME_LENGTH} characters or less`).regex(/^[a-z0-9-]+$/, "Skill name must contain only lowercase letters, numbers, and hyphens").refine((name) => !name.startsWith("-") && !name.endsWith("-"), {
846
- message: "Skill name must not start or end with a hyphen"
847
- }).refine((name) => !name.includes("--"), {
848
- message: "Skill name must not contain consecutive hyphens"
849
- }).describe("Skill name (1-64 chars, lowercase letters/numbers/hyphens only, must match directory name)");
850
- var SkillDescriptionSchema = z.string().min(1, "Skill description cannot be empty").max(
851
- SKILL_LIMITS.MAX_DESCRIPTION_LENGTH,
852
- `Skill description must be ${SKILL_LIMITS.MAX_DESCRIPTION_LENGTH} characters or less`
853
- ).refine((desc) => desc.trim().length > 0, {
854
- message: "Skill description cannot be only whitespace"
855
- }).describe("Description of what the skill does and when to use it (1-1024 characters)");
856
- var SkillCompatibilitySchema = z.string().max(
857
- SKILL_LIMITS.MAX_COMPATIBILITY_LENGTH,
858
- `Compatibility field must be ${SKILL_LIMITS.MAX_COMPATIBILITY_LENGTH} characters or less`
859
- ).optional().describe("Environment requirements or compatibility notes (max 500 chars)");
860
- var SkillLicenseSchema = z.string().optional().describe('License for the skill (e.g., "Apache-2.0", "MIT")');
861
- var SkillMetadataFieldSchema = z.record(z.string()).optional().describe("Arbitrary key-value metadata (e.g., author, version)");
862
- var SkillMetadataSchema = z.object({
863
- name: SkillNameSchema,
864
- description: SkillDescriptionSchema,
865
- license: SkillLicenseSchema,
866
- compatibility: SkillCompatibilitySchema,
867
- metadata: SkillMetadataFieldSchema
868
- });
843
+ MAX_DESCRIPTION_LENGTH: 1024};
844
+ function validateSkillName(name) {
845
+ const errors = [];
846
+ const fieldPath = "name";
847
+ if (typeof name !== "string") {
848
+ errors.push(`${fieldPath}: Expected string, received ${typeof name}`);
849
+ return errors;
850
+ }
851
+ if (name.length === 0) {
852
+ errors.push(`${fieldPath}: Skill name cannot be empty`);
853
+ return errors;
854
+ }
855
+ if (name.length > SKILL_LIMITS.MAX_NAME_LENGTH) {
856
+ errors.push(`${fieldPath}: Skill name must be ${SKILL_LIMITS.MAX_NAME_LENGTH} characters or less`);
857
+ }
858
+ if (!/^[a-z0-9-]+$/.test(name)) {
859
+ errors.push(`${fieldPath}: Skill name must contain only lowercase letters, numbers, and hyphens`);
860
+ }
861
+ if (name.startsWith("-") || name.endsWith("-")) {
862
+ errors.push(`${fieldPath}: Skill name must not start or end with a hyphen`);
863
+ }
864
+ if (name.includes("--")) {
865
+ errors.push(`${fieldPath}: Skill name must not contain consecutive hyphens`);
866
+ }
867
+ return errors;
868
+ }
869
+ function validateSkillDescription(description) {
870
+ const errors = [];
871
+ const fieldPath = "description";
872
+ if (typeof description !== "string") {
873
+ errors.push(`${fieldPath}: Expected string, received ${typeof description}`);
874
+ return errors;
875
+ }
876
+ if (description.length === 0) {
877
+ errors.push(`${fieldPath}: Skill description cannot be empty`);
878
+ return errors;
879
+ }
880
+ if (description.length > SKILL_LIMITS.MAX_DESCRIPTION_LENGTH) {
881
+ errors.push(`${fieldPath}: Skill description must be ${SKILL_LIMITS.MAX_DESCRIPTION_LENGTH} characters or less`);
882
+ }
883
+ if (description.trim().length === 0) {
884
+ errors.push(`${fieldPath}: Skill description cannot be only whitespace`);
885
+ }
886
+ return errors;
887
+ }
888
+ function validateSkillLicense(license) {
889
+ const errors = [];
890
+ const fieldPath = "license";
891
+ if (license === void 0 || license === null) {
892
+ return errors;
893
+ }
894
+ if (typeof license !== "string") {
895
+ errors.push(`${fieldPath}: Expected string, received ${typeof license}`);
896
+ }
897
+ return errors;
898
+ }
899
+ function validateSkillCompatibility(_compatibility) {
900
+ return [];
901
+ }
902
+ function validateSkillMetadataField(metadata) {
903
+ const errors = [];
904
+ const fieldPath = "metadata";
905
+ if (metadata === void 0 || metadata === null) {
906
+ return errors;
907
+ }
908
+ if (typeof metadata !== "object" || Array.isArray(metadata)) {
909
+ errors.push(`${fieldPath}: Expected object, received ${Array.isArray(metadata) ? "array" : typeof metadata}`);
910
+ return errors;
911
+ }
912
+ return errors;
913
+ }
869
914
  function estimateTokens(text) {
870
915
  const words = text.split(/\s+/).filter(Boolean).length;
871
916
  return Math.ceil(words * 1.3);
@@ -876,12 +921,20 @@ function countLines(text) {
876
921
  function validateSkillMetadata(metadata, dirName, instructions) {
877
922
  const errors = [];
878
923
  const warnings = [];
879
- const result = SkillMetadataSchema.safeParse(metadata);
880
- if (!result.success) {
881
- errors.push(...result.error.errors.map((err) => `${err.path.join(".")}: ${err.message}`));
924
+ if (typeof metadata !== "object" || metadata === null || Array.isArray(metadata)) {
925
+ errors.push(
926
+ `Expected object, received ${metadata === null ? "null" : Array.isArray(metadata) ? "array" : typeof metadata}`
927
+ );
928
+ return { valid: false, errors, warnings };
882
929
  }
883
- if (dirName && result.success && result.data.name !== dirName) {
884
- errors.push(`Skill name "${result.data.name}" must match directory name "${dirName}"`);
930
+ const data = metadata;
931
+ errors.push(...validateSkillName(data.name));
932
+ errors.push(...validateSkillDescription(data.description));
933
+ errors.push(...validateSkillLicense(data.license));
934
+ errors.push(...validateSkillCompatibility());
935
+ errors.push(...validateSkillMetadataField(data.metadata));
936
+ if (dirName && typeof data.name === "string" && data.name !== dirName) {
937
+ errors.push(`Skill name "${data.name}" must match directory name "${dirName}"`);
885
938
  }
886
939
  if (instructions) {
887
940
  const lineCount = countLines(instructions);
@@ -3226,22 +3279,22 @@ function createWorkspaceTools(workspace) {
3226
3279
  id: WORKSPACE_TOOLS.FILESYSTEM.READ_FILE,
3227
3280
  description: "Read the contents of a file from the workspace filesystem. Supports reading specific line ranges using offset/limit parameters.",
3228
3281
  requireApproval: readFileConfig.requireApproval,
3229
- inputSchema: z$1.object({
3230
- path: z$1.string().describe('The path to the file to read (e.g., "/data/config.json")'),
3231
- encoding: z$1.enum(["utf-8", "utf8", "base64", "hex", "binary"]).optional().describe("The encoding to use when reading the file. Defaults to utf-8 for text files."),
3232
- offset: z$1.number().optional().describe("Line number to start reading from (1-indexed). If omitted, starts from line 1."),
3233
- limit: z$1.number().optional().describe("Maximum number of lines to read. If omitted, reads to the end of the file."),
3234
- showLineNumbers: z$1.boolean().optional().default(true).describe("Whether to prefix each line with its line number (default: true)")
3282
+ inputSchema: z.object({
3283
+ path: z.string().describe('The path to the file to read (e.g., "/data/config.json")'),
3284
+ encoding: 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."),
3285
+ offset: z.number().optional().describe("Line number to start reading from (1-indexed). If omitted, starts from line 1."),
3286
+ limit: z.number().optional().describe("Maximum number of lines to read. If omitted, reads to the end of the file."),
3287
+ showLineNumbers: z.boolean().optional().default(true).describe("Whether to prefix each line with its line number (default: true)")
3235
3288
  }),
3236
- outputSchema: z$1.object({
3237
- content: z$1.string().describe("The file contents (with optional line number prefixes)"),
3238
- size: z$1.number().describe("The file size in bytes"),
3239
- path: z$1.string().describe("The full path to the file"),
3240
- lines: z$1.object({
3241
- start: z$1.number().describe("First line number returned"),
3242
- end: z$1.number().describe("Last line number returned")
3289
+ outputSchema: z.object({
3290
+ content: z.string().describe("The file contents (with optional line number prefixes)"),
3291
+ size: z.number().describe("The file size in bytes"),
3292
+ path: z.string().describe("The full path to the file"),
3293
+ lines: z.object({
3294
+ start: z.number().describe("First line number returned"),
3295
+ end: z.number().describe("Last line number returned")
3243
3296
  }).optional().describe("Line range information (when offset/limit used)"),
3244
- totalLines: z$1.number().optional().describe("Total number of lines in the file")
3297
+ totalLines: z.number().optional().describe("Total number of lines in the file")
3245
3298
  }),
3246
3299
  execute: async ({ path: path4, encoding, offset, limit, showLineNumbers }) => {
3247
3300
  const effectiveEncoding = encoding ?? "utf-8";
@@ -3288,15 +3341,15 @@ function createWorkspaceTools(workspace) {
3288
3341
  id: WORKSPACE_TOOLS.FILESYSTEM.WRITE_FILE,
3289
3342
  description: "Write content to a file in the workspace filesystem. Creates parent directories if needed.",
3290
3343
  requireApproval: writeFileConfig.requireApproval,
3291
- inputSchema: z$1.object({
3292
- path: z$1.string().describe('The path where to write the file (e.g., "/data/output.txt")'),
3293
- content: z$1.string().describe("The content to write to the file"),
3294
- overwrite: z$1.boolean().optional().default(true).describe("Whether to overwrite the file if it already exists")
3344
+ inputSchema: z.object({
3345
+ path: z.string().describe('The path where to write the file (e.g., "/data/output.txt")'),
3346
+ content: z.string().describe("The content to write to the file"),
3347
+ overwrite: z.boolean().optional().default(true).describe("Whether to overwrite the file if it already exists")
3295
3348
  }),
3296
- outputSchema: z$1.object({
3297
- success: z$1.boolean(),
3298
- path: z$1.string().describe("The path where the file was written"),
3299
- size: z$1.number().describe("The size of the written content in bytes")
3349
+ outputSchema: z.object({
3350
+ success: z.boolean(),
3351
+ path: z.string().describe("The path where the file was written"),
3352
+ size: z.number().describe("The size of the written content in bytes")
3300
3353
  }),
3301
3354
  execute: async ({ path: path4, content, overwrite }) => {
3302
3355
  if (readTracker && writeFileConfig.requireReadBeforeWrite) {
@@ -3329,17 +3382,17 @@ function createWorkspaceTools(workspace) {
3329
3382
  id: WORKSPACE_TOOLS.FILESYSTEM.EDIT_FILE,
3330
3383
  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.",
3331
3384
  requireApproval: editFileConfig.requireApproval,
3332
- inputSchema: z$1.object({
3333
- path: z$1.string().describe("The path to the file to edit"),
3334
- old_string: z$1.string().describe("The exact text to find and replace. Must be unique in the file."),
3335
- new_string: z$1.string().describe("The text to replace old_string with"),
3336
- replace_all: z$1.boolean().optional().default(false).describe("If true, replace all occurrences. If false (default), old_string must be unique.")
3385
+ inputSchema: z.object({
3386
+ path: z.string().describe("The path to the file to edit"),
3387
+ old_string: z.string().describe("The exact text to find and replace. Must be unique in the file."),
3388
+ new_string: z.string().describe("The text to replace old_string with"),
3389
+ replace_all: z.boolean().optional().default(false).describe("If true, replace all occurrences. If false (default), old_string must be unique.")
3337
3390
  }),
3338
- outputSchema: z$1.object({
3339
- success: z$1.boolean(),
3340
- path: z$1.string().describe("The path to the edited file"),
3341
- replacements: z$1.number().describe("Number of replacements made"),
3342
- error: z$1.string().optional().describe("Error message if the edit failed")
3391
+ outputSchema: z.object({
3392
+ success: z.boolean(),
3393
+ path: z.string().describe("The path to the edited file"),
3394
+ replacements: z.number().describe("Number of replacements made"),
3395
+ error: z.string().optional().describe("Error message if the edit failed")
3343
3396
  }),
3344
3397
  execute: async ({ path: path4, old_string, new_string, replace_all }) => {
3345
3398
  try {
@@ -3409,26 +3462,26 @@ Examples:
3409
3462
  - Directories only: { path: "/", dirsOnly: true }
3410
3463
  - Exclude node_modules: { path: "/", exclude: "node_modules" }`,
3411
3464
  requireApproval: listFilesConfig.requireApproval,
3412
- inputSchema: z$1.object({
3413
- path: z$1.string().default("/").describe("Directory path to list"),
3414
- maxDepth: z$1.number().optional().default(3).describe("Maximum depth to descend (default: 3). Similar to tree -L flag."),
3415
- showHidden: z$1.boolean().optional().default(false).describe('Show hidden files starting with "." (default: false). Similar to tree -a flag.'),
3416
- dirsOnly: z$1.boolean().optional().default(false).describe("List directories only, no files (default: false). Similar to tree -d flag."),
3417
- exclude: z$1.string().optional().describe('Pattern to exclude (e.g., "node_modules"). Similar to tree -I flag.'),
3418
- extension: z$1.string().optional().describe('Filter by file extension (e.g., ".ts"). Similar to tree -P flag.')
3465
+ inputSchema: z.object({
3466
+ path: z.string().default("/").describe("Directory path to list"),
3467
+ maxDepth: z.number().optional().default(3).describe("Maximum depth to descend (default: 3). Similar to tree -L flag."),
3468
+ showHidden: z.boolean().optional().default(false).describe('Show hidden files starting with "." (default: false). Similar to tree -a flag.'),
3469
+ dirsOnly: z.boolean().optional().default(false).describe("List directories only, no files (default: false). Similar to tree -d flag."),
3470
+ exclude: z.string().optional().describe('Pattern to exclude (e.g., "node_modules"). Similar to tree -I flag.'),
3471
+ extension: z.string().optional().describe('Filter by file extension (e.g., ".ts"). Similar to tree -P flag.')
3419
3472
  }),
3420
- outputSchema: z$1.object({
3421
- tree: z$1.string().describe("Tree-style directory listing"),
3422
- summary: z$1.string().describe('Summary of directories and files (e.g., "3 directories, 12 files")'),
3423
- metadata: z$1.object({
3424
- workspace: z$1.object({
3425
- id: z$1.string().optional(),
3426
- name: z$1.string().optional()
3473
+ outputSchema: z.object({
3474
+ tree: z.string().describe("Tree-style directory listing"),
3475
+ summary: z.string().describe('Summary of directories and files (e.g., "3 directories, 12 files")'),
3476
+ metadata: z.object({
3477
+ workspace: z.object({
3478
+ id: z.string().optional(),
3479
+ name: z.string().optional()
3427
3480
  }).optional(),
3428
- filesystem: z$1.object({
3429
- id: z$1.string().optional(),
3430
- name: z$1.string().optional(),
3431
- provider: z$1.string().optional()
3481
+ filesystem: z.object({
3482
+ id: z.string().optional(),
3483
+ name: z.string().optional(),
3484
+ provider: z.string().optional()
3432
3485
  }).optional()
3433
3486
  }).optional().describe("Metadata about the workspace and filesystem")
3434
3487
  }),
@@ -3466,15 +3519,15 @@ Examples:
3466
3519
  id: WORKSPACE_TOOLS.FILESYSTEM.DELETE,
3467
3520
  description: "Delete a file or directory from the workspace filesystem",
3468
3521
  requireApproval: deleteConfig.requireApproval,
3469
- inputSchema: z$1.object({
3470
- path: z$1.string().describe("The path to the file or directory to delete"),
3471
- recursive: z$1.boolean().optional().default(false).describe(
3522
+ inputSchema: z.object({
3523
+ path: z.string().describe("The path to the file or directory to delete"),
3524
+ recursive: z.boolean().optional().default(false).describe(
3472
3525
  "If true, delete directories and their contents recursively. Required for non-empty directories."
3473
3526
  )
3474
3527
  }),
3475
- outputSchema: z$1.object({
3476
- success: z$1.boolean(),
3477
- path: z$1.string()
3528
+ outputSchema: z.object({
3529
+ success: z.boolean(),
3530
+ path: z.string()
3478
3531
  }),
3479
3532
  execute: async ({ path: path4, recursive }) => {
3480
3533
  const stat3 = await workspace.filesystem.stat(path4);
@@ -3493,14 +3546,14 @@ Examples:
3493
3546
  id: WORKSPACE_TOOLS.FILESYSTEM.FILE_STAT,
3494
3547
  description: "Get file or directory metadata from the workspace. Returns existence, type, size, and modification time.",
3495
3548
  requireApproval: fileStatConfig.requireApproval,
3496
- inputSchema: z$1.object({
3497
- path: z$1.string().describe("The path to check")
3549
+ inputSchema: z.object({
3550
+ path: z.string().describe("The path to check")
3498
3551
  }),
3499
- outputSchema: z$1.object({
3500
- exists: z$1.boolean().describe("Whether the path exists"),
3501
- type: z$1.enum(["file", "directory", "none"]).describe("The type of the path if it exists"),
3502
- size: z$1.number().optional().describe("Size in bytes (for files)"),
3503
- modifiedAt: z$1.string().optional().describe("Last modification time (ISO string)")
3552
+ outputSchema: z.object({
3553
+ exists: z.boolean().describe("Whether the path exists"),
3554
+ type: z.enum(["file", "directory", "none"]).describe("The type of the path if it exists"),
3555
+ size: z.number().optional().describe("Size in bytes (for files)"),
3556
+ modifiedAt: z.string().optional().describe("Last modification time (ISO string)")
3504
3557
  }),
3505
3558
  execute: async ({ path: path4 }) => {
3506
3559
  try {
@@ -3526,13 +3579,13 @@ Examples:
3526
3579
  id: WORKSPACE_TOOLS.FILESYSTEM.MKDIR,
3527
3580
  description: "Create a directory in the workspace filesystem",
3528
3581
  requireApproval: mkdirConfig.requireApproval,
3529
- inputSchema: z$1.object({
3530
- path: z$1.string().describe("The path of the directory to create"),
3531
- recursive: z$1.boolean().optional().default(true).describe("Whether to create parent directories if they do not exist")
3582
+ inputSchema: z.object({
3583
+ path: z.string().describe("The path of the directory to create"),
3584
+ recursive: z.boolean().optional().default(true).describe("Whether to create parent directories if they do not exist")
3532
3585
  }),
3533
- outputSchema: z$1.object({
3534
- success: z$1.boolean(),
3535
- path: z$1.string()
3586
+ outputSchema: z.object({
3587
+ success: z.boolean(),
3588
+ path: z.string()
3536
3589
  }),
3537
3590
  execute: async ({ path: path4, recursive }) => {
3538
3591
  await workspace.filesystem.mkdir(path4, { recursive });
@@ -3548,26 +3601,26 @@ Examples:
3548
3601
  id: WORKSPACE_TOOLS.SEARCH.SEARCH,
3549
3602
  description: "Search indexed content in the workspace. Supports keyword (BM25), semantic (vector), and hybrid search modes.",
3550
3603
  requireApproval: searchConfig.requireApproval,
3551
- inputSchema: z$1.object({
3552
- query: z$1.string().describe("The search query string"),
3553
- topK: z$1.number().optional().default(5).describe("Maximum number of results to return"),
3554
- mode: z$1.enum(["bm25", "vector", "hybrid"]).optional().describe("Search mode: bm25 for keyword search, vector for semantic search, hybrid for both combined"),
3555
- minScore: z$1.number().optional().describe("Minimum score threshold (0-1 for normalized scores)")
3604
+ inputSchema: z.object({
3605
+ query: z.string().describe("The search query string"),
3606
+ topK: z.number().optional().default(5).describe("Maximum number of results to return"),
3607
+ mode: z.enum(["bm25", "vector", "hybrid"]).optional().describe("Search mode: bm25 for keyword search, vector for semantic search, hybrid for both combined"),
3608
+ minScore: z.number().optional().describe("Minimum score threshold (0-1 for normalized scores)")
3556
3609
  }),
3557
- outputSchema: z$1.object({
3558
- results: z$1.array(
3559
- z$1.object({
3560
- id: z$1.string().describe("Document/file path"),
3561
- content: z$1.string().describe("The matching content"),
3562
- score: z$1.number().describe("Relevance score"),
3563
- lineRange: z$1.object({
3564
- start: z$1.number(),
3565
- end: z$1.number()
3610
+ outputSchema: z.object({
3611
+ results: z.array(
3612
+ z.object({
3613
+ id: z.string().describe("Document/file path"),
3614
+ content: z.string().describe("The matching content"),
3615
+ score: z.number().describe("Relevance score"),
3616
+ lineRange: z.object({
3617
+ start: z.number(),
3618
+ end: z.number()
3566
3619
  }).optional().describe("Line range where query terms were found")
3567
3620
  })
3568
3621
  ),
3569
- count: z$1.number().describe("Number of results returned"),
3570
- mode: z$1.string().describe("The search mode that was used")
3622
+ count: z.number().describe("Number of results returned"),
3623
+ mode: z.string().describe("The search mode that was used")
3571
3624
  }),
3572
3625
  execute: async ({ query, topK, mode, minScore }) => {
3573
3626
  const results = await workspace.search(query, {
@@ -3594,14 +3647,14 @@ Examples:
3594
3647
  id: WORKSPACE_TOOLS.SEARCH.INDEX,
3595
3648
  description: "Index content for search. The path becomes the document ID in search results.",
3596
3649
  requireApproval: indexConfig.requireApproval,
3597
- inputSchema: z$1.object({
3598
- path: z$1.string().describe("The document ID/path for search results"),
3599
- content: z$1.string().describe("The text content to index"),
3600
- metadata: z$1.record(z$1.unknown()).optional().describe("Optional metadata to store with the document")
3650
+ inputSchema: z.object({
3651
+ path: z.string().describe("The document ID/path for search results"),
3652
+ content: z.string().describe("The text content to index"),
3653
+ metadata: z.record(z.unknown()).optional().describe("Optional metadata to store with the document")
3601
3654
  }),
3602
- outputSchema: z$1.object({
3603
- success: z$1.boolean(),
3604
- path: z$1.string().describe("The indexed document ID")
3655
+ outputSchema: z.object({
3656
+ success: z.boolean(),
3657
+ path: z.string().describe("The indexed document ID")
3605
3658
  }),
3606
3659
  execute: async ({ path: path4, content, metadata }) => {
3607
3660
  await workspace.index(path4, content, { metadata });
@@ -3619,20 +3672,20 @@ Examples:
3619
3672
  id: WORKSPACE_TOOLS.SANDBOX.EXECUTE_COMMAND,
3620
3673
  description: `Execute a shell command in the workspace sandbox. The output (stdout/stderr) is displayed to the user automatically in the tool result. ${pathInfo}`,
3621
3674
  requireApproval: executeCommandConfig.requireApproval,
3622
- inputSchema: z$1.object({
3623
- command: z$1.string().describe('The command to execute (e.g., "ls", "npm", "python")'),
3624
- args: z$1.array(z$1.string()).nullish().default([]).describe("Arguments to pass to the command"),
3625
- timeout: z$1.number().nullish().default(3e4).describe(
3675
+ inputSchema: z.object({
3676
+ command: z.string().describe('The command to execute (e.g., "ls", "npm", "python")'),
3677
+ args: z.array(z.string()).nullish().default([]).describe("Arguments to pass to the command"),
3678
+ timeout: z.number().nullish().default(3e4).describe(
3626
3679
  "Maximum execution time in milliseconds. Default is 30000 (30 seconds). Example: 60000 for 1 minute."
3627
3680
  ),
3628
- cwd: z$1.string().nullish().describe("Working directory for the command")
3681
+ cwd: z.string().nullish().describe("Working directory for the command")
3629
3682
  }),
3630
- outputSchema: z$1.object({
3631
- success: z$1.boolean().describe("Whether the command executed successfully (exit code 0)"),
3632
- stdout: z$1.string().describe("Standard output from the command"),
3633
- stderr: z$1.string().describe("Standard error output"),
3634
- exitCode: z$1.number().describe("Exit code (0 = success)"),
3635
- executionTimeMs: z$1.number().describe("How long the execution took in milliseconds")
3683
+ outputSchema: z.object({
3684
+ success: z.boolean().describe("Whether the command executed successfully (exit code 0)"),
3685
+ stdout: z.string().describe("Standard output from the command"),
3686
+ stderr: z.string().describe("Standard error output"),
3687
+ exitCode: z.number().describe("Exit code (0 = success)"),
3688
+ executionTimeMs: z.number().describe("How long the execution took in milliseconds")
3636
3689
  }),
3637
3690
  execute: async ({ command, args, timeout, cwd }, context) => {
3638
3691
  const getExecutionMetadata = () => ({
@@ -3702,5 +3755,5 @@ Examples:
3702
3755
  }
3703
3756
 
3704
3757
  export { DirectoryNotEmptyError, DirectoryNotFoundError, FileExistsError, FileNotFoundError, FileReadRequiredError, FilesystemError, FilesystemNotAvailableError, IsDirectoryError, IsolationUnavailableError, LocalFilesystem, LocalSandbox, NotDirectoryError, PermissionError, SandboxError, SandboxExecutionError, SandboxFeatureNotSupportedError, SandboxNotAvailableError, SandboxNotReadyError, SandboxTimeoutError, SearchNotAvailableError, WORKSPACE_TOOLS, WORKSPACE_TOOLS_PREFIX, Workspace, WorkspaceError, WorkspaceNotReadyError, WorkspaceReadOnlyError, createWorkspaceTools, detectIsolation, extractLines, getRecommendedIsolation, isIsolationAvailable, resolveToolConfig };
3705
- //# sourceMappingURL=chunk-ZZCLGEMJ.js.map
3706
- //# sourceMappingURL=chunk-ZZCLGEMJ.js.map
3758
+ //# sourceMappingURL=chunk-NVRAVZZM.js.map
3759
+ //# sourceMappingURL=chunk-NVRAVZZM.js.map