@mcpc-tech/core 0.3.9 → 0.3.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/plugins.mjs CHANGED
@@ -40,8 +40,10 @@ function createSearchPlugin(options = {}) {
40
40
  name: "plugin-search",
41
41
  version: "1.0.0",
42
42
  configureServer: (server) => {
43
- server.tool("search-tool-result", `Search for text patterns in files and directories. Use this to find specific content, code, or information within files. Provide a simple literal string or a regular expression. If your pattern is a regex, ensure it's valid; otherwise use quotes or escape special characters to treat it as a literal string.
44
- Only search within the allowed directory: ${allowedSearchDir}`, jsonSchema({
43
+ const defaultDescription = `Search for text patterns in files and directories. Use this to find specific content, code, or information within files. Provide a simple literal string or a regular expression. If your pattern is a regex, ensure it's valid; otherwise use quotes or escape special characters to treat it as a literal string.
44
+ Only search within the allowed directory: ${allowedSearchDir}`;
45
+ const toolDescription = options.toolDescription || defaultDescription;
46
+ server.tool("search-tool-result", toolDescription, jsonSchema({
45
47
  type: "object",
46
48
  properties: {
47
49
  pattern: {
@@ -261,9 +263,11 @@ function createLargeResultPlugin(options = {}) {
261
263
  const previewSize = options.previewSize || 4e3;
262
264
  let tempDir = options.tempDir || null;
263
265
  const configuredServers = /* @__PURE__ */ new Map();
266
+ const defaultSearchDescription = `Search within large tool result files that were saved due to size limits. Use when: a tool result was saved to file because it exceeded the context limit. Do NOT use this tool before calling the actual tool first. Provide specific keywords or patterns related to the content you're looking for.`;
264
267
  const searchConfig = {
265
268
  maxResults: options.search?.maxResults || 15,
266
269
  maxOutputSize: options.search?.maxOutputSize || 4e3,
270
+ toolDescription: options.search?.toolDescription || defaultSearchDescription,
267
271
  global: true
268
272
  };
269
273
  return {
@@ -1 +1 @@
1
- {"version":3,"file":"large-result.d.ts","sources":["../../../src/plugins/large-result.ts"],"names":[],"mappings":"AAQA,SAA6B,KAAK,aAAa,2BAA2B;AAC1E,cAAc,UAAU,6BAA6B;UAE3C;EACR,UAAU,MAAM;EAChB,cAAc,MAAM;EACpB,UAAU,MAAM;EAChB,SAAS;;AAGX;;;CAGC,GACD,OAAO,iBAAS,wBACd,UAAS,aAAkB,GAC1B;AAoGH;;CAEC,GACD,cAAM,0BAA0B;AAMhC,OAAO,cAAM,kBAAuC;AAEpD,eAAe,yBAAyB"}
1
+ {"version":3,"file":"large-result.d.ts","sources":["../../../src/plugins/large-result.ts"],"names":[],"mappings":"AAQA,SAA6B,KAAK,aAAa,2BAA2B;AAC1E,cAAc,UAAU,6BAA6B;UAE3C;EACR,UAAU,MAAM;EAChB,cAAc,MAAM;EACpB,UAAU,MAAM;EAChB,SAAS;;AAGX;;;CAGC,GACD,OAAO,iBAAS,wBACd,UAAS,aAAkB,GAC1B;AA4GH;;CAEC,GACD,cAAM,0BAA0B;AAMhC,OAAO,cAAM,kBAAuC;AAEpD,eAAe,yBAAyB"}
@@ -8,6 +8,7 @@ import type { ToolPlugin } from "../plugin-types.js";
8
8
  /** Allowed directory for search operations - restricts search scope for security (default: system temp directory) */ allowedDir?: string;
9
9
  /** Whether search should be case sensitive (default: false) */ caseSensitive?: boolean;
10
10
  /** Search timeout in milliseconds (default: 30000) */ timeoutMs?: number;
11
+ /** Custom description for the search tool (overrides default) */ toolDescription?: string;
11
12
  }
12
13
  /**
13
14
  * Create a search plugin that adds file search capability with size limits
@@ -1 +1 @@
1
- {"version":3,"file":"search-tool.d.ts","sources":["../../../src/plugins/search-tool.ts"],"names":[],"mappings":"AASA,cAAc,UAAU,6BAA6B;AAIrD;;CAEC,GACD,iBAAiB;EACf,sDAAsD,GACtD,SAAS,OAAO;EAChB,6DAA6D,GAC7D,aAAa,MAAM;EACnB,sDAAsD,GACtD,gBAAgB,MAAM;EACtB,mHAAmH,GACnH,aAAa,MAAM;EACnB,6DAA6D,GAC7D,gBAAgB,OAAO;EACvB,oDAAoD,GACpD,YAAY,MAAM;;AAGpB;;CAEC,GACD,OAAO,iBAAS,mBAAmB,UAAS,aAAkB,GAAG;AA0PjE;;CAEC,GACD,cAAM,qBAAqB;AAS3B,OAAO,cAAM,kBAAkC;AAE/C,eAAe,oBAAoB"}
1
+ {"version":3,"file":"search-tool.d.ts","sources":["../../../src/plugins/search-tool.ts"],"names":[],"mappings":"AASA,cAAc,UAAU,6BAA6B;AAIrD;;CAEC,GACD,iBAAiB;EACf,sDAAsD,GACtD,SAAS,OAAO;EAChB,6DAA6D,GAC7D,aAAa,MAAM;EACnB,sDAAsD,GACtD,gBAAgB,MAAM;EACtB,mHAAmH,GACnH,aAAa,MAAM;EACnB,6DAA6D,GAC7D,gBAAgB,OAAO;EACvB,oDAAoD,GACpD,YAAY,MAAM;EAClB,+DAA+D,GAC/D,kBAAkB,MAAM;;AAG1B;;CAEC,GACD,OAAO,iBAAS,mBAAmB,UAAS,aAAkB,GAAG;AA8PjE;;CAEC,GACD,cAAM,qBAAqB;AAS3B,OAAO,cAAM,kBAAkC;AAE/C,eAAe,oBAAoB"}