@mastra/core 1.1.0-alpha.0 → 1.1.0-alpha.2

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 (137) hide show
  1. package/CHANGELOG.md +28 -0
  2. package/dist/agent/index.cjs +8 -8
  3. package/dist/agent/index.js +1 -1
  4. package/dist/{chunk-DXTYXWYM.cjs → chunk-4ACKGMN2.cjs} +7 -7
  5. package/dist/{chunk-DXTYXWYM.cjs.map → chunk-4ACKGMN2.cjs.map} +1 -1
  6. package/dist/{chunk-ZZCLGEMJ.js → chunk-4KQEQ4NM.js} +192 -353
  7. package/dist/chunk-4KQEQ4NM.js.map +1 -0
  8. package/dist/{chunk-6FHHT22W.cjs → chunk-4PERRFZD.cjs} +44 -44
  9. package/dist/{chunk-6FHHT22W.cjs.map → chunk-4PERRFZD.cjs.map} +1 -1
  10. package/dist/{chunk-XSRROONT.cjs → chunk-4QJBNJI4.cjs} +5 -5
  11. package/dist/{chunk-XSRROONT.cjs.map → chunk-4QJBNJI4.cjs.map} +1 -1
  12. package/dist/{chunk-QGVPEZ5T.js → chunk-BG6DCMO2.js} +20 -10
  13. package/dist/chunk-BG6DCMO2.js.map +1 -0
  14. package/dist/{chunk-REH5FX2O.js → chunk-FVVQY6UU.js} +28 -25
  15. package/dist/chunk-FVVQY6UU.js.map +1 -0
  16. package/dist/{chunk-Z3XVFOTH.js → chunk-FZZI2V2T.js} +4 -4
  17. package/dist/{chunk-Z3XVFOTH.js.map → chunk-FZZI2V2T.js.map} +1 -1
  18. package/dist/{chunk-ACEGVEZF.js → chunk-H4C5NORS.js} +66 -46
  19. package/dist/chunk-H4C5NORS.js.map +1 -0
  20. package/dist/{chunk-N2FELMHU.cjs → chunk-HR67B4UM.cjs} +57 -24
  21. package/dist/chunk-HR67B4UM.cjs.map +1 -0
  22. package/dist/{chunk-YETWOFQL.js → chunk-KPIJA2R5.js} +21 -31
  23. package/dist/chunk-KPIJA2R5.js.map +1 -0
  24. package/dist/{chunk-ETSBNSRY.cjs → chunk-MGOFRL36.cjs} +21 -11
  25. package/dist/chunk-MGOFRL36.cjs.map +1 -0
  26. package/dist/{chunk-5VWOGZLE.js → chunk-OSIE5L6N.js} +49 -16
  27. package/dist/chunk-OSIE5L6N.js.map +1 -0
  28. package/dist/{chunk-ARMHYWF5.js → chunk-OW7H7G5N.js} +4 -4
  29. package/dist/{chunk-ARMHYWF5.js.map → chunk-OW7H7G5N.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-WBJMSOYD.cjs → chunk-RYVRCT7Z.cjs} +192 -354
  33. package/dist/chunk-RYVRCT7Z.cjs.map +1 -0
  34. package/dist/{chunk-3CXWVB55.cjs → chunk-SLMSUZBA.cjs} +39 -36
  35. package/dist/{chunk-3CXWVB55.cjs.map → chunk-SLMSUZBA.cjs.map} +1 -1
  36. package/dist/{chunk-5BEYS33K.js → chunk-VAJRNUEF.js} +3 -3
  37. package/dist/{chunk-5BEYS33K.js.map → chunk-VAJRNUEF.js.map} +1 -1
  38. package/dist/{chunk-OZFBUMI3.cjs → chunk-VNGQXHUE.cjs} +7 -7
  39. package/dist/{chunk-OZFBUMI3.cjs.map → chunk-VNGQXHUE.cjs.map} +1 -1
  40. package/dist/{chunk-CEYA6FNF.js → chunk-YQMDMIP6.js} +3 -3
  41. package/dist/{chunk-CEYA6FNF.js.map → chunk-YQMDMIP6.js.map} +1 -1
  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 +7 -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-B3CGX3OF.js +3 -0
  82. package/dist/{provider-registry-4RA5NQGH.js.map → provider-registry-B3CGX3OF.js.map} +1 -1
  83. package/dist/provider-registry-CHV3DFFA.cjs +40 -0
  84. package/dist/{provider-registry-63ZEAPKK.cjs.map → provider-registry-CHV3DFFA.cjs.map} +1 -1
  85. package/dist/provider-registry.json +18 -8
  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.d.ts +1 -1
  111. package/dist/workspace/index.d.ts.map +1 -1
  112. package/dist/workspace/index.js +1 -1
  113. package/dist/workspace/skills/schemas.d.ts +17 -47
  114. package/dist/workspace/skills/schemas.d.ts.map +1 -1
  115. package/dist/workspace/skills/skill-source.d.ts +1 -13
  116. package/dist/workspace/skills/skill-source.d.ts.map +1 -1
  117. package/dist/workspace/skills/types.d.ts +9 -74
  118. package/dist/workspace/skills/types.d.ts.map +1 -1
  119. package/dist/workspace/skills/workspace-skills.d.ts +2 -19
  120. package/dist/workspace/skills/workspace-skills.d.ts.map +1 -1
  121. package/dist/workspace/workspace.d.ts +0 -12
  122. package/dist/workspace/workspace.d.ts.map +1 -1
  123. package/package.json +4 -4
  124. package/src/llm/model/provider-types.generated.d.ts +7 -2
  125. package/dist/chunk-5VWOGZLE.js.map +0 -1
  126. package/dist/chunk-ACEGVEZF.js.map +0 -1
  127. package/dist/chunk-ETSBNSRY.cjs.map +0 -1
  128. package/dist/chunk-N2FELMHU.cjs.map +0 -1
  129. package/dist/chunk-QGVPEZ5T.js.map +0 -1
  130. package/dist/chunk-REH5FX2O.js.map +0 -1
  131. package/dist/chunk-RFTFSXJY.cjs.map +0 -1
  132. package/dist/chunk-TV4DA7RI.cjs.map +0 -1
  133. package/dist/chunk-WBJMSOYD.cjs.map +0 -1
  134. package/dist/chunk-YETWOFQL.js.map +0 -1
  135. package/dist/chunk-ZZCLGEMJ.js.map +0 -1
  136. package/dist/provider-registry-4RA5NQGH.js +0 -3
  137. 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
- /** Max characters for compatibility field */
871
- MAX_COMPATIBILITY_LENGTH: 500
872
- };
873
- var SkillNameSchema = z__default.default.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("-"), {
874
- message: "Skill name must not start or end with a hyphen"
875
- }).refine((name) => !name.includes("--"), {
876
- message: "Skill name must not contain consecutive hyphens"
877
- }).describe("Skill name (1-64 chars, lowercase letters/numbers/hyphens only, must match directory name)");
878
- var SkillDescriptionSchema = z__default.default.string().min(1, "Skill description cannot be empty").max(
879
- SKILL_LIMITS.MAX_DESCRIPTION_LENGTH,
880
- `Skill description must be ${SKILL_LIMITS.MAX_DESCRIPTION_LENGTH} characters or less`
881
- ).refine((desc) => desc.trim().length > 0, {
882
- message: "Skill description cannot be only whitespace"
883
- }).describe("Description of what the skill does and when to use it (1-1024 characters)");
884
- var SkillCompatibilitySchema = z__default.default.string().max(
885
- SKILL_LIMITS.MAX_COMPATIBILITY_LENGTH,
886
- `Compatibility field must be ${SKILL_LIMITS.MAX_COMPATIBILITY_LENGTH} characters or less`
887
- ).optional().describe("Environment requirements or compatibility notes (max 500 chars)");
888
- var SkillLicenseSchema = z__default.default.string().optional().describe('License for the skill (e.g., "Apache-2.0", "MIT")');
889
- var SkillMetadataFieldSchema = z__default.default.record(z__default.default.string()).optional().describe("Arbitrary key-value metadata (e.g., author, version)");
890
- var SkillMetadataSchema = z__default.default.object({
891
- name: SkillNameSchema,
892
- description: SkillDescriptionSchema,
893
- license: SkillLicenseSchema,
894
- compatibility: SkillCompatibilitySchema,
895
- metadata: SkillMetadataFieldSchema
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
- const result = SkillMetadataSchema.safeParse(metadata);
908
- if (!result.success) {
909
- errors.push(...result.error.errors.map((err) => `${err.path.join(".")}: ${err.message}`));
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
- if (dirName && result.success && result.data.name !== dirName) {
912
- errors.push(`Skill name "${result.data.name}" must match directory name "${dirName}"`);
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);
@@ -931,11 +983,6 @@ function validateSkillMetadata(metadata, dirName, instructions) {
931
983
  warnings
932
984
  };
933
985
  }
934
-
935
- // src/workspace/skills/skill-source.ts
936
- function isWritableSource(source) {
937
- return "writeFile" in source && typeof source.writeFile === "function" && "mkdir" in source && typeof source.mkdir === "function" && "rmdir" in source && typeof source.rmdir === "function";
938
- }
939
986
  function isEnoentError(error) {
940
987
  return error !== null && typeof error === "object" && "code" in error && error.code === "ENOENT";
941
988
  }
@@ -1557,7 +1604,6 @@ var WorkspaceSkillsImpl = class {
1557
1604
  #skillsResolver;
1558
1605
  #searchEngine;
1559
1606
  #validateOnLoad;
1560
- #isWritable;
1561
1607
  /** Map of skill name -> full skill data */
1562
1608
  #skills = /* @__PURE__ */ new Map();
1563
1609
  /** Whether skills have been discovered */
@@ -1573,21 +1619,6 @@ var WorkspaceSkillsImpl = class {
1573
1619
  this.#skillsResolver = config.skills;
1574
1620
  this.#searchEngine = config.searchEngine;
1575
1621
  this.#validateOnLoad = config.validateOnLoad ?? true;
1576
- this.#isWritable = isWritableSource(this.#source);
1577
- }
1578
- /**
1579
- * Whether this skills instance supports write operations.
1580
- * Returns true if backed by a WorkspaceFilesystem, false for read-only sources.
1581
- */
1582
- get isWritable() {
1583
- return this.#isWritable;
1584
- }
1585
- /**
1586
- * Get the source as a writable source.
1587
- * Only call after checking #isWritable is true.
1588
- */
1589
- #getWritableSource() {
1590
- return this.#source;
1591
1622
  }
1592
1623
  // ===========================================================================
1593
1624
  // Discovery
@@ -1692,142 +1723,6 @@ var WorkspaceSkillsImpl = class {
1692
1723
  return results;
1693
1724
  }
1694
1725
  // ===========================================================================
1695
- // CRUD Operations
1696
- // ===========================================================================
1697
- async create(input) {
1698
- await this.#ensureInitialized();
1699
- if (!this.#isWritable) {
1700
- throw new Error("Skills are read-only. Write operations require a WorkspaceFilesystem.");
1701
- }
1702
- const { metadata, instructions, references, scripts, assets } = input;
1703
- if (this.#skills.has(metadata.name)) {
1704
- throw new Error(`Skill "${metadata.name}" already exists`);
1705
- }
1706
- if (this.#validateOnLoad) {
1707
- const validation = this.#validateSkillMetadata(metadata, metadata.name, instructions);
1708
- if (!validation.valid) {
1709
- throw new Error(`Invalid skill metadata:
1710
- ${validation.errors.join("\n")}`);
1711
- }
1712
- }
1713
- const skillsPath = this.#resolvedPaths[0];
1714
- if (!skillsPath) {
1715
- throw new Error("No skills path configured for creating skills");
1716
- }
1717
- const skillDir = this.#joinPath(skillsPath, metadata.name);
1718
- if (await this.#source.exists(skillDir)) {
1719
- throw new Error(`Directory "${skillDir}" already exists`);
1720
- }
1721
- const fs5 = this.#getWritableSource();
1722
- await fs5.mkdir(skillDir);
1723
- const skillMdContent = this.#buildSkillMd(metadata, instructions);
1724
- await fs5.writeFile(this.#joinPath(skillDir, "SKILL.md"), skillMdContent);
1725
- const refPaths = [];
1726
- if (references && references.length > 0) {
1727
- const refsDir = this.#joinPath(skillDir, "references");
1728
- await fs5.mkdir(refsDir);
1729
- for (const ref of references) {
1730
- const safeRefPath = this.#assertRelativePath(ref.path, "reference");
1731
- const refPath = this.#joinPath(refsDir, safeRefPath);
1732
- await this.#ensureParentDir(refPath);
1733
- await fs5.writeFile(refPath, ref.content);
1734
- refPaths.push(safeRefPath);
1735
- }
1736
- }
1737
- const scriptPaths = [];
1738
- if (scripts && scripts.length > 0) {
1739
- const scriptsDir = this.#joinPath(skillDir, "scripts");
1740
- await fs5.mkdir(scriptsDir);
1741
- for (const script of scripts) {
1742
- const safeScriptPath = this.#assertRelativePath(script.path, "script");
1743
- const scriptPath = this.#joinPath(scriptsDir, safeScriptPath);
1744
- await this.#ensureParentDir(scriptPath);
1745
- await fs5.writeFile(scriptPath, script.content);
1746
- scriptPaths.push(safeScriptPath);
1747
- }
1748
- }
1749
- const assetPaths = [];
1750
- if (assets && assets.length > 0) {
1751
- const assetsDir = this.#joinPath(skillDir, "assets");
1752
- await fs5.mkdir(assetsDir);
1753
- for (const asset of assets) {
1754
- const safeAssetPath = this.#assertRelativePath(asset.path, "asset");
1755
- const assetPath = this.#joinPath(assetsDir, safeAssetPath);
1756
- await this.#ensureParentDir(assetPath);
1757
- await fs5.writeFile(assetPath, asset.content);
1758
- assetPaths.push(safeAssetPath);
1759
- }
1760
- }
1761
- const source = this.#determineSource(skillsPath);
1762
- const indexableContent = await this.#buildIndexableContent(instructions, skillDir, refPaths);
1763
- const skill = {
1764
- ...metadata,
1765
- path: skillDir,
1766
- instructions,
1767
- source,
1768
- references: refPaths,
1769
- scripts: scriptPaths,
1770
- assets: assetPaths,
1771
- indexableContent
1772
- };
1773
- this.#skills.set(metadata.name, skill);
1774
- await this.#indexSkill(skill);
1775
- const { indexableContent: _, ...skillData } = skill;
1776
- return skillData;
1777
- }
1778
- async update(name, input) {
1779
- await this.#ensureInitialized();
1780
- if (!this.#isWritable) {
1781
- throw new Error("Skills are read-only. Write operations require a WorkspaceFilesystem.");
1782
- }
1783
- const skill = this.#skills.get(name);
1784
- if (!skill) {
1785
- throw new Error(`Skill "${name}" not found`);
1786
- }
1787
- const { metadata: updatedMetadata, instructions: updatedInstructions } = input;
1788
- const newMetadata = {
1789
- name: skill.name,
1790
- // Name cannot be changed
1791
- description: updatedMetadata?.description ?? skill.description,
1792
- license: updatedMetadata?.license ?? skill.license,
1793
- compatibility: updatedMetadata?.compatibility ?? skill.compatibility,
1794
- metadata: updatedMetadata?.metadata ?? skill.metadata
1795
- };
1796
- const newInstructions = updatedInstructions ?? skill.instructions;
1797
- if (this.#validateOnLoad) {
1798
- const validation = this.#validateSkillMetadata(newMetadata, name, newInstructions);
1799
- if (!validation.valid) {
1800
- throw new Error(`Invalid skill metadata:
1801
- ${validation.errors.join("\n")}`);
1802
- }
1803
- }
1804
- const skillMdContent = this.#buildSkillMd(newMetadata, newInstructions);
1805
- await this.#getWritableSource().writeFile(this.#joinPath(skill.path, "SKILL.md"), skillMdContent);
1806
- const indexableContent = await this.#buildIndexableContent(newInstructions, skill.path, skill.references);
1807
- const updatedSkill = {
1808
- ...skill,
1809
- ...newMetadata,
1810
- instructions: newInstructions,
1811
- indexableContent
1812
- };
1813
- this.#skills.set(name, updatedSkill);
1814
- await this.#indexSkill(updatedSkill);
1815
- const { indexableContent: _, ...skillData } = updatedSkill;
1816
- return skillData;
1817
- }
1818
- async delete(name) {
1819
- await this.#ensureInitialized();
1820
- if (!this.#isWritable) {
1821
- throw new Error("Skills are read-only. Write operations require a WorkspaceFilesystem.");
1822
- }
1823
- const skill = this.#skills.get(name);
1824
- if (!skill) {
1825
- throw new Error(`Skill "${name}" not found`);
1826
- }
1827
- await this.#getWritableSource().rmdir(skill.path, { recursive: true });
1828
- this.#skills.delete(name);
1829
- }
1830
- // ===========================================================================
1831
1726
  // Single-item Accessors
1832
1727
  // ===========================================================================
1833
1728
  async getReference(skillName, referencePath) {
@@ -2182,25 +2077,6 @@ ${validation.errors.join("\n")}`);
2182
2077
  }
2183
2078
  return { type: "local", projectPath: skillsPath };
2184
2079
  }
2185
- /**
2186
- * Build SKILL.md content from metadata and instructions
2187
- */
2188
- #buildSkillMd(metadata, instructions) {
2189
- const frontmatter = {
2190
- name: metadata.name,
2191
- description: metadata.description
2192
- };
2193
- if (metadata.license) {
2194
- frontmatter.license = metadata.license;
2195
- }
2196
- if (metadata.compatibility) {
2197
- frontmatter.compatibility = metadata.compatibility;
2198
- }
2199
- if (metadata.metadata) {
2200
- frontmatter.metadata = metadata.metadata;
2201
- }
2202
- return matter__default.default.stringify(instructions, frontmatter);
2203
- }
2204
2080
  /**
2205
2081
  * Join path segments (workspace paths use forward slashes)
2206
2082
  */
@@ -2229,30 +2105,6 @@ ${validation.errors.join("\n")}`);
2229
2105
  const lastSlash = path4.lastIndexOf("/");
2230
2106
  return lastSlash > 0 ? path4.substring(0, lastSlash) : "/";
2231
2107
  }
2232
- /**
2233
- * Ensure parent directory exists for a file path.
2234
- * Recursively creates parent directories if they don't exist.
2235
- * Only called from write operations that already checked #isWritable.
2236
- */
2237
- async #ensureParentDir(filePath) {
2238
- const parentPath = this.#getParentPath(filePath);
2239
- if (parentPath && parentPath !== "/") {
2240
- await this.#mkdirRecursive(parentPath);
2241
- }
2242
- }
2243
- /**
2244
- * Recursively create directories if they don't exist.
2245
- */
2246
- async #mkdirRecursive(dirPath) {
2247
- if (await this.#source.exists(dirPath)) {
2248
- return;
2249
- }
2250
- const parentPath = this.#getParentPath(dirPath);
2251
- if (parentPath && parentPath !== "/") {
2252
- await this.#mkdirRecursive(parentPath);
2253
- }
2254
- await this.#getWritableSource().mkdir(dirPath);
2255
- }
2256
2108
  };
2257
2109
 
2258
2110
  // src/workspace/workspace.ts
@@ -2309,12 +2161,6 @@ var Workspace = class {
2309
2161
  get filesystem() {
2310
2162
  return this._fs;
2311
2163
  }
2312
- /**
2313
- * Alias for filesystem.
2314
- */
2315
- get fs() {
2316
- return this._fs;
2317
- }
2318
2164
  /**
2319
2165
  * The sandbox provider (if configured).
2320
2166
  */
@@ -2334,19 +2180,11 @@ var Workspace = class {
2334
2180
  *
2335
2181
  * Returns undefined if no skillPaths are configured.
2336
2182
  *
2337
- * When filesystem is available, skills support full CRUD operations.
2338
- * Without filesystem, skills are loaded read-only via LocalSkillSource.
2339
- *
2340
2183
  * @example
2341
2184
  * ```typescript
2342
2185
  * const skills = await workspace.skills?.list();
2343
2186
  * const skill = await workspace.skills?.get('brand-guidelines');
2344
2187
  * const results = await workspace.skills?.search('brand colors');
2345
- *
2346
- * // CRUD operations (only available with filesystem)
2347
- * if (workspace.skills?.isWritable) {
2348
- * await workspace.skills.create({ ... });
2349
- * }
2350
2188
  * ```
2351
2189
  */
2352
2190
  get skills() {
@@ -3254,22 +3092,22 @@ function createWorkspaceTools(workspace) {
3254
3092
  id: WORKSPACE_TOOLS.FILESYSTEM.READ_FILE,
3255
3093
  description: "Read the contents of a file from the workspace filesystem. Supports reading specific line ranges using offset/limit parameters.",
3256
3094
  requireApproval: readFileConfig.requireApproval,
3257
- inputSchema: z.z.object({
3258
- path: z.z.string().describe('The path to the file to read (e.g., "/data/config.json")'),
3259
- encoding: z.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."),
3260
- offset: z.z.number().optional().describe("Line number to start reading from (1-indexed). If omitted, starts from line 1."),
3261
- limit: z.z.number().optional().describe("Maximum number of lines to read. If omitted, reads to the end of the file."),
3262
- showLineNumbers: z.z.boolean().optional().default(true).describe("Whether to prefix each line with its line number (default: true)")
3095
+ inputSchema: zod.z.object({
3096
+ path: zod.z.string().describe('The path to the file to read (e.g., "/data/config.json")'),
3097
+ 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."),
3098
+ offset: zod.z.number().optional().describe("Line number to start reading from (1-indexed). If omitted, starts from line 1."),
3099
+ limit: zod.z.number().optional().describe("Maximum number of lines to read. If omitted, reads to the end of the file."),
3100
+ showLineNumbers: zod.z.boolean().optional().default(true).describe("Whether to prefix each line with its line number (default: true)")
3263
3101
  }),
3264
- outputSchema: z.z.object({
3265
- content: z.z.string().describe("The file contents (with optional line number prefixes)"),
3266
- size: z.z.number().describe("The file size in bytes"),
3267
- path: z.z.string().describe("The full path to the file"),
3268
- lines: z.z.object({
3269
- start: z.z.number().describe("First line number returned"),
3270
- end: z.z.number().describe("Last line number returned")
3102
+ outputSchema: zod.z.object({
3103
+ content: zod.z.string().describe("The file contents (with optional line number prefixes)"),
3104
+ size: zod.z.number().describe("The file size in bytes"),
3105
+ path: zod.z.string().describe("The full path to the file"),
3106
+ lines: zod.z.object({
3107
+ start: zod.z.number().describe("First line number returned"),
3108
+ end: zod.z.number().describe("Last line number returned")
3271
3109
  }).optional().describe("Line range information (when offset/limit used)"),
3272
- totalLines: z.z.number().optional().describe("Total number of lines in the file")
3110
+ totalLines: zod.z.number().optional().describe("Total number of lines in the file")
3273
3111
  }),
3274
3112
  execute: async ({ path: path4, encoding, offset, limit, showLineNumbers }) => {
3275
3113
  const effectiveEncoding = encoding ?? "utf-8";
@@ -3316,15 +3154,15 @@ function createWorkspaceTools(workspace) {
3316
3154
  id: WORKSPACE_TOOLS.FILESYSTEM.WRITE_FILE,
3317
3155
  description: "Write content to a file in the workspace filesystem. Creates parent directories if needed.",
3318
3156
  requireApproval: writeFileConfig.requireApproval,
3319
- inputSchema: z.z.object({
3320
- path: z.z.string().describe('The path where to write the file (e.g., "/data/output.txt")'),
3321
- content: z.z.string().describe("The content to write to the file"),
3322
- overwrite: z.z.boolean().optional().default(true).describe("Whether to overwrite the file if it already exists")
3157
+ inputSchema: zod.z.object({
3158
+ path: zod.z.string().describe('The path where to write the file (e.g., "/data/output.txt")'),
3159
+ content: zod.z.string().describe("The content to write to the file"),
3160
+ overwrite: zod.z.boolean().optional().default(true).describe("Whether to overwrite the file if it already exists")
3323
3161
  }),
3324
- outputSchema: z.z.object({
3325
- success: z.z.boolean(),
3326
- path: z.z.string().describe("The path where the file was written"),
3327
- size: z.z.number().describe("The size of the written content in bytes")
3162
+ outputSchema: zod.z.object({
3163
+ success: zod.z.boolean(),
3164
+ path: zod.z.string().describe("The path where the file was written"),
3165
+ size: zod.z.number().describe("The size of the written content in bytes")
3328
3166
  }),
3329
3167
  execute: async ({ path: path4, content, overwrite }) => {
3330
3168
  if (readTracker && writeFileConfig.requireReadBeforeWrite) {
@@ -3357,17 +3195,17 @@ function createWorkspaceTools(workspace) {
3357
3195
  id: WORKSPACE_TOOLS.FILESYSTEM.EDIT_FILE,
3358
3196
  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
3197
  requireApproval: editFileConfig.requireApproval,
3360
- inputSchema: z.z.object({
3361
- path: z.z.string().describe("The path to the file to edit"),
3362
- old_string: z.z.string().describe("The exact text to find and replace. Must be unique in the file."),
3363
- new_string: z.z.string().describe("The text to replace old_string with"),
3364
- replace_all: z.z.boolean().optional().default(false).describe("If true, replace all occurrences. If false (default), old_string must be unique.")
3198
+ inputSchema: zod.z.object({
3199
+ path: zod.z.string().describe("The path to the file to edit"),
3200
+ old_string: zod.z.string().describe("The exact text to find and replace. Must be unique in the file."),
3201
+ new_string: zod.z.string().describe("The text to replace old_string with"),
3202
+ replace_all: zod.z.boolean().optional().default(false).describe("If true, replace all occurrences. If false (default), old_string must be unique.")
3365
3203
  }),
3366
- outputSchema: z.z.object({
3367
- success: z.z.boolean(),
3368
- path: z.z.string().describe("The path to the edited file"),
3369
- replacements: z.z.number().describe("Number of replacements made"),
3370
- error: z.z.string().optional().describe("Error message if the edit failed")
3204
+ outputSchema: zod.z.object({
3205
+ success: zod.z.boolean(),
3206
+ path: zod.z.string().describe("The path to the edited file"),
3207
+ replacements: zod.z.number().describe("Number of replacements made"),
3208
+ error: zod.z.string().optional().describe("Error message if the edit failed")
3371
3209
  }),
3372
3210
  execute: async ({ path: path4, old_string, new_string, replace_all }) => {
3373
3211
  try {
@@ -3437,26 +3275,26 @@ Examples:
3437
3275
  - Directories only: { path: "/", dirsOnly: true }
3438
3276
  - Exclude node_modules: { path: "/", exclude: "node_modules" }`,
3439
3277
  requireApproval: listFilesConfig.requireApproval,
3440
- inputSchema: z.z.object({
3441
- path: z.z.string().default("/").describe("Directory path to list"),
3442
- maxDepth: z.z.number().optional().default(3).describe("Maximum depth to descend (default: 3). Similar to tree -L flag."),
3443
- showHidden: z.z.boolean().optional().default(false).describe('Show hidden files starting with "." (default: false). Similar to tree -a flag.'),
3444
- dirsOnly: z.z.boolean().optional().default(false).describe("List directories only, no files (default: false). Similar to tree -d flag."),
3445
- exclude: z.z.string().optional().describe('Pattern to exclude (e.g., "node_modules"). Similar to tree -I flag.'),
3446
- extension: z.z.string().optional().describe('Filter by file extension (e.g., ".ts"). Similar to tree -P flag.')
3278
+ inputSchema: zod.z.object({
3279
+ path: zod.z.string().default("/").describe("Directory path to list"),
3280
+ maxDepth: zod.z.number().optional().default(3).describe("Maximum depth to descend (default: 3). Similar to tree -L flag."),
3281
+ showHidden: zod.z.boolean().optional().default(false).describe('Show hidden files starting with "." (default: false). Similar to tree -a flag.'),
3282
+ dirsOnly: zod.z.boolean().optional().default(false).describe("List directories only, no files (default: false). Similar to tree -d flag."),
3283
+ exclude: zod.z.string().optional().describe('Pattern to exclude (e.g., "node_modules"). Similar to tree -I flag.'),
3284
+ extension: zod.z.string().optional().describe('Filter by file extension (e.g., ".ts"). Similar to tree -P flag.')
3447
3285
  }),
3448
- outputSchema: z.z.object({
3449
- tree: z.z.string().describe("Tree-style directory listing"),
3450
- summary: z.z.string().describe('Summary of directories and files (e.g., "3 directories, 12 files")'),
3451
- metadata: z.z.object({
3452
- workspace: z.z.object({
3453
- id: z.z.string().optional(),
3454
- name: z.z.string().optional()
3286
+ outputSchema: zod.z.object({
3287
+ tree: zod.z.string().describe("Tree-style directory listing"),
3288
+ summary: zod.z.string().describe('Summary of directories and files (e.g., "3 directories, 12 files")'),
3289
+ metadata: zod.z.object({
3290
+ workspace: zod.z.object({
3291
+ id: zod.z.string().optional(),
3292
+ name: zod.z.string().optional()
3455
3293
  }).optional(),
3456
- filesystem: z.z.object({
3457
- id: z.z.string().optional(),
3458
- name: z.z.string().optional(),
3459
- provider: z.z.string().optional()
3294
+ filesystem: zod.z.object({
3295
+ id: zod.z.string().optional(),
3296
+ name: zod.z.string().optional(),
3297
+ provider: zod.z.string().optional()
3460
3298
  }).optional()
3461
3299
  }).optional().describe("Metadata about the workspace and filesystem")
3462
3300
  }),
@@ -3494,15 +3332,15 @@ Examples:
3494
3332
  id: WORKSPACE_TOOLS.FILESYSTEM.DELETE,
3495
3333
  description: "Delete a file or directory from the workspace filesystem",
3496
3334
  requireApproval: deleteConfig.requireApproval,
3497
- inputSchema: z.z.object({
3498
- path: z.z.string().describe("The path to the file or directory to delete"),
3499
- recursive: z.z.boolean().optional().default(false).describe(
3335
+ inputSchema: zod.z.object({
3336
+ path: zod.z.string().describe("The path to the file or directory to delete"),
3337
+ recursive: zod.z.boolean().optional().default(false).describe(
3500
3338
  "If true, delete directories and their contents recursively. Required for non-empty directories."
3501
3339
  )
3502
3340
  }),
3503
- outputSchema: z.z.object({
3504
- success: z.z.boolean(),
3505
- path: z.z.string()
3341
+ outputSchema: zod.z.object({
3342
+ success: zod.z.boolean(),
3343
+ path: zod.z.string()
3506
3344
  }),
3507
3345
  execute: async ({ path: path4, recursive }) => {
3508
3346
  const stat3 = await workspace.filesystem.stat(path4);
@@ -3521,14 +3359,14 @@ Examples:
3521
3359
  id: WORKSPACE_TOOLS.FILESYSTEM.FILE_STAT,
3522
3360
  description: "Get file or directory metadata from the workspace. Returns existence, type, size, and modification time.",
3523
3361
  requireApproval: fileStatConfig.requireApproval,
3524
- inputSchema: z.z.object({
3525
- path: z.z.string().describe("The path to check")
3362
+ inputSchema: zod.z.object({
3363
+ path: zod.z.string().describe("The path to check")
3526
3364
  }),
3527
- outputSchema: z.z.object({
3528
- exists: z.z.boolean().describe("Whether the path exists"),
3529
- type: z.z.enum(["file", "directory", "none"]).describe("The type of the path if it exists"),
3530
- size: z.z.number().optional().describe("Size in bytes (for files)"),
3531
- modifiedAt: z.z.string().optional().describe("Last modification time (ISO string)")
3365
+ outputSchema: zod.z.object({
3366
+ exists: zod.z.boolean().describe("Whether the path exists"),
3367
+ type: zod.z.enum(["file", "directory", "none"]).describe("The type of the path if it exists"),
3368
+ size: zod.z.number().optional().describe("Size in bytes (for files)"),
3369
+ modifiedAt: zod.z.string().optional().describe("Last modification time (ISO string)")
3532
3370
  }),
3533
3371
  execute: async ({ path: path4 }) => {
3534
3372
  try {
@@ -3554,13 +3392,13 @@ Examples:
3554
3392
  id: WORKSPACE_TOOLS.FILESYSTEM.MKDIR,
3555
3393
  description: "Create a directory in the workspace filesystem",
3556
3394
  requireApproval: mkdirConfig.requireApproval,
3557
- inputSchema: z.z.object({
3558
- path: z.z.string().describe("The path of the directory to create"),
3559
- recursive: z.z.boolean().optional().default(true).describe("Whether to create parent directories if they do not exist")
3395
+ inputSchema: zod.z.object({
3396
+ path: zod.z.string().describe("The path of the directory to create"),
3397
+ recursive: zod.z.boolean().optional().default(true).describe("Whether to create parent directories if they do not exist")
3560
3398
  }),
3561
- outputSchema: z.z.object({
3562
- success: z.z.boolean(),
3563
- path: z.z.string()
3399
+ outputSchema: zod.z.object({
3400
+ success: zod.z.boolean(),
3401
+ path: zod.z.string()
3564
3402
  }),
3565
3403
  execute: async ({ path: path4, recursive }) => {
3566
3404
  await workspace.filesystem.mkdir(path4, { recursive });
@@ -3576,26 +3414,26 @@ Examples:
3576
3414
  id: WORKSPACE_TOOLS.SEARCH.SEARCH,
3577
3415
  description: "Search indexed content in the workspace. Supports keyword (BM25), semantic (vector), and hybrid search modes.",
3578
3416
  requireApproval: searchConfig.requireApproval,
3579
- inputSchema: z.z.object({
3580
- query: z.z.string().describe("The search query string"),
3581
- topK: z.z.number().optional().default(5).describe("Maximum number of results to return"),
3582
- mode: z.z.enum(["bm25", "vector", "hybrid"]).optional().describe("Search mode: bm25 for keyword search, vector for semantic search, hybrid for both combined"),
3583
- minScore: z.z.number().optional().describe("Minimum score threshold (0-1 for normalized scores)")
3417
+ inputSchema: zod.z.object({
3418
+ query: zod.z.string().describe("The search query string"),
3419
+ topK: zod.z.number().optional().default(5).describe("Maximum number of results to return"),
3420
+ mode: zod.z.enum(["bm25", "vector", "hybrid"]).optional().describe("Search mode: bm25 for keyword search, vector for semantic search, hybrid for both combined"),
3421
+ minScore: zod.z.number().optional().describe("Minimum score threshold (0-1 for normalized scores)")
3584
3422
  }),
3585
- outputSchema: z.z.object({
3586
- results: z.z.array(
3587
- z.z.object({
3588
- id: z.z.string().describe("Document/file path"),
3589
- content: z.z.string().describe("The matching content"),
3590
- score: z.z.number().describe("Relevance score"),
3591
- lineRange: z.z.object({
3592
- start: z.z.number(),
3593
- end: z.z.number()
3423
+ outputSchema: zod.z.object({
3424
+ results: zod.z.array(
3425
+ zod.z.object({
3426
+ id: zod.z.string().describe("Document/file path"),
3427
+ content: zod.z.string().describe("The matching content"),
3428
+ score: zod.z.number().describe("Relevance score"),
3429
+ lineRange: zod.z.object({
3430
+ start: zod.z.number(),
3431
+ end: zod.z.number()
3594
3432
  }).optional().describe("Line range where query terms were found")
3595
3433
  })
3596
3434
  ),
3597
- count: z.z.number().describe("Number of results returned"),
3598
- mode: z.z.string().describe("The search mode that was used")
3435
+ count: zod.z.number().describe("Number of results returned"),
3436
+ mode: zod.z.string().describe("The search mode that was used")
3599
3437
  }),
3600
3438
  execute: async ({ query, topK, mode, minScore }) => {
3601
3439
  const results = await workspace.search(query, {
@@ -3622,14 +3460,14 @@ Examples:
3622
3460
  id: WORKSPACE_TOOLS.SEARCH.INDEX,
3623
3461
  description: "Index content for search. The path becomes the document ID in search results.",
3624
3462
  requireApproval: indexConfig.requireApproval,
3625
- inputSchema: z.z.object({
3626
- path: z.z.string().describe("The document ID/path for search results"),
3627
- content: z.z.string().describe("The text content to index"),
3628
- metadata: z.z.record(z.z.unknown()).optional().describe("Optional metadata to store with the document")
3463
+ inputSchema: zod.z.object({
3464
+ path: zod.z.string().describe("The document ID/path for search results"),
3465
+ content: zod.z.string().describe("The text content to index"),
3466
+ metadata: zod.z.record(zod.z.unknown()).optional().describe("Optional metadata to store with the document")
3629
3467
  }),
3630
- outputSchema: z.z.object({
3631
- success: z.z.boolean(),
3632
- path: z.z.string().describe("The indexed document ID")
3468
+ outputSchema: zod.z.object({
3469
+ success: zod.z.boolean(),
3470
+ path: zod.z.string().describe("The indexed document ID")
3633
3471
  }),
3634
3472
  execute: async ({ path: path4, content, metadata }) => {
3635
3473
  await workspace.index(path4, content, { metadata });
@@ -3647,20 +3485,20 @@ Examples:
3647
3485
  id: WORKSPACE_TOOLS.SANDBOX.EXECUTE_COMMAND,
3648
3486
  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
3487
  requireApproval: executeCommandConfig.requireApproval,
3650
- inputSchema: z.z.object({
3651
- command: z.z.string().describe('The command to execute (e.g., "ls", "npm", "python")'),
3652
- args: z.z.array(z.z.string()).nullish().default([]).describe("Arguments to pass to the command"),
3653
- timeout: z.z.number().nullish().default(3e4).describe(
3488
+ inputSchema: zod.z.object({
3489
+ command: zod.z.string().describe('The command to execute (e.g., "ls", "npm", "python")'),
3490
+ args: zod.z.array(zod.z.string()).nullish().default([]).describe("Arguments to pass to the command"),
3491
+ timeout: zod.z.number().nullish().default(3e4).describe(
3654
3492
  "Maximum execution time in milliseconds. Default is 30000 (30 seconds). Example: 60000 for 1 minute."
3655
3493
  ),
3656
- cwd: z.z.string().nullish().describe("Working directory for the command")
3494
+ cwd: zod.z.string().nullish().describe("Working directory for the command")
3657
3495
  }),
3658
- outputSchema: z.z.object({
3659
- success: z.z.boolean().describe("Whether the command executed successfully (exit code 0)"),
3660
- stdout: z.z.string().describe("Standard output from the command"),
3661
- stderr: z.z.string().describe("Standard error output"),
3662
- exitCode: z.z.number().describe("Exit code (0 = success)"),
3663
- executionTimeMs: z.z.number().describe("How long the execution took in milliseconds")
3496
+ outputSchema: zod.z.object({
3497
+ success: zod.z.boolean().describe("Whether the command executed successfully (exit code 0)"),
3498
+ stdout: zod.z.string().describe("Standard output from the command"),
3499
+ stderr: zod.z.string().describe("Standard error output"),
3500
+ exitCode: zod.z.number().describe("Exit code (0 = success)"),
3501
+ executionTimeMs: zod.z.number().describe("How long the execution took in milliseconds")
3664
3502
  }),
3665
3503
  execute: async ({ command, args, timeout, cwd }, context) => {
3666
3504
  const getExecutionMetadata = () => ({
@@ -3761,5 +3599,5 @@ exports.extractLines = extractLines;
3761
3599
  exports.getRecommendedIsolation = getRecommendedIsolation;
3762
3600
  exports.isIsolationAvailable = isIsolationAvailable;
3763
3601
  exports.resolveToolConfig = resolveToolConfig;
3764
- //# sourceMappingURL=chunk-WBJMSOYD.cjs.map
3765
- //# sourceMappingURL=chunk-WBJMSOYD.cjs.map
3602
+ //# sourceMappingURL=chunk-RYVRCT7Z.cjs.map
3603
+ //# sourceMappingURL=chunk-RYVRCT7Z.cjs.map