@tencent-ai/codebuddy-code 1.0.19 → 1.1.0
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 +19 -0
- package/dist/422.codebuddy.js +1 -1
- package/dist/566.codebuddy.js +1 -1
- package/dist/codebuddy.js +1 -1
- package/lib/node/index.js +2 -0
- package/package.json +1 -1
- package/product.internal.json +2 -2
- package/product.ioa.json +2 -2
- package/product.json +3 -3
- package/dist/444.codebuddy.js +0 -1
- package/dist/814.codebuddy.js +0 -1
- package/dist/889.codebuddy.js +0 -1
package/lib/node/index.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tencent-ai/codebuddy-code",
|
|
3
|
-
"version": "1.0
|
|
3
|
+
"version": "1.1.0",
|
|
4
4
|
"description": "Use CodeBuddy, Tencent's AI assistant, right from your terminal. CodeBuddy can understand your codebase, edit files, run terminal commands, and handle entire workflows for you.",
|
|
5
5
|
"main": "lib/node/index.js",
|
|
6
6
|
"typings": "lib/node/index.d.ts",
|
package/product.internal.json
CHANGED
|
@@ -200,6 +200,6 @@
|
|
|
200
200
|
"officialWebsite": "https://copilot.tencent.com/cli",
|
|
201
201
|
"upgradeUrl": ""
|
|
202
202
|
},
|
|
203
|
-
"commit": "
|
|
204
|
-
"date": "2025-09-
|
|
203
|
+
"commit": "71cf1be97a9649c0981d0366782780b137c7fa9d",
|
|
204
|
+
"date": "2025-09-17T16:20:44.581Z"
|
|
205
205
|
}
|
package/product.ioa.json
CHANGED
|
@@ -291,6 +291,6 @@
|
|
|
291
291
|
"officialWebsite": "https://copilot.tencent.com/cli",
|
|
292
292
|
"upgradeUrl": ""
|
|
293
293
|
},
|
|
294
|
-
"commit": "
|
|
295
|
-
"date": "2025-09-
|
|
294
|
+
"commit": "71cf1be97a9649c0981d0366782780b137c7fa9d",
|
|
295
|
+
"date": "2025-09-17T16:20:45.915Z"
|
|
296
296
|
}
|
package/product.json
CHANGED
|
@@ -219,7 +219,7 @@
|
|
|
219
219
|
},
|
|
220
220
|
{
|
|
221
221
|
"name": "tool-task-description",
|
|
222
|
-
"template": "Launch a new agent to handle complex, multi-step tasks autonomously.\n\nAvailable agent types and the tools they have access to:\n- general-purpose: General-purpose agent for researching complex questions, searching for code, and executing multi-step tasks. When you are searching for a keyword or file and are not confident that you will find the right match in the first few tries use this agent to perform the search for you. (Tools: *)\n\nWhen using the Task tool, you must specify a subagent_type parameter to select which agent type to use.\n\n\n\nWhen NOT to use the Agent tool:\n- If you want to read a specific file path, use the Read or Glob tool instead of the Agent tool, to find the match more quickly\n- If you are searching for a specific class definition like \"class Foo\", use the Glob tool instead, to find the match more quickly\n- If you are searching for code within a specific file or set of 2-3 files, use the Read tool instead of the Agent tool, to find the match more quickly\n- Other tasks that are not related to the agent descriptions above\n\n\nUsage notes:\n1. Launch multiple agents concurrently whenever possible, to maximize performance; to do that, use a single message with multiple tool uses\n2. When the agent is done, it will return a single message back to you. The result returned by the agent is not visible to the user. To show the user the result, you should send a text message back to the user with a concise summary of the result.\n3. Each agent invocation is stateless. You will not be able to send additional messages to the agent, nor will the agent be able to communicate with you outside of its final report. Therefore, your prompt should contain a highly detailed task description for the agent to perform autonomously and you should specify exactly what information the agent should return back to you in its final and only message to you.\n4. The agent's outputs should generally be trusted\n5. Clearly tell the agent whether you expect it to write code or just to do research (search, file reads, web fetches, etc.), since it is not aware of the user's intent\n6. If the agent description mentions that it should be used proactively, then you should try your best to use it without the user having to ask for it first. Use your judgement.\n\nExample usage:\n\n<example_agent_descriptions>\n\"code-reviewer\": use this agent after you are done writing a signficant piece of code\n\"greeting-responder\": use this agent when to respond to user greetings with a friendly joke\n</example_agent_description>\n\n<example>\nuser: \"Please write a function that checks if a number is prime\"\nassistant: Sure let me write a function that checks if a number is prime\nassistant: First let me use the Write tool to write a function that checks if a number is prime\nassistant: I'm going to use the Write tool to write the following code:\n<code>\nfunction isPrime(n) {\n if (n <= 1) return false\n for (let i = 2; i * i <= n; i++) {\n if (n % i === 0) return false\n }\n return true\n}\n</code>\n<commentary>\nSince a signficant piece of code was written and the task was completed, now use the code-reviewer agent to review the code\n</commentary>\nassistant: Now let me use the code-reviewer agent to review the code\nassistant: Uses the Task tool to launch the with the code-reviewer agent\n</example>\n\n<example>\nuser: \"Hello\"\n<commentary>\nSince the user is greeting, use the greeting-responder agent to respond with a friendly joke\n</commentary>\nassistant: \"I'm going to use the Task tool to launch the with the greeting-responder agent\"\n</example>\n\n"
|
|
222
|
+
"template": "Launch a new agent to handle complex, multi-step tasks autonomously.\n\nAvailable agent types and the tools they have access to:\n- general-purpose: General-purpose agent for researching complex questions, searching for code, and executing multi-step tasks. When you are searching for a keyword or file and are not confident that you will find the right match in the first few tries use this agent to perform the search for you. (Tools: *)\n{%- if agents and agents.length > 0 -%}\n{%- for agent in agents -%}\n{%- if agent.asTool %}\n- {{agent.name}}: {{agent.description}} (Tools: {%- if agent.tools and agent.tools.length > 0 -%}{{agent.tools.join(',')}}{%- endif -%})\n{%- endif -%}\n{%- endfor -%}\n{%- endif %}\n\nWhen using the Task tool, you must specify a subagent_type parameter to select which agent type to use.\n\n\n\nWhen NOT to use the Agent tool:\n- If you want to read a specific file path, use the Read or Glob tool instead of the Agent tool, to find the match more quickly\n- If you are searching for a specific class definition like \"class Foo\", use the Glob tool instead, to find the match more quickly\n- If you are searching for code within a specific file or set of 2-3 files, use the Read tool instead of the Agent tool, to find the match more quickly\n- Other tasks that are not related to the agent descriptions above\n\n\nUsage notes:\n1. Launch multiple agents concurrently whenever possible, to maximize performance; to do that, use a single message with multiple tool uses\n2. When the agent is done, it will return a single message back to you. The result returned by the agent is not visible to the user. To show the user the result, you should send a text message back to the user with a concise summary of the result.\n3. Each agent invocation is stateless. You will not be able to send additional messages to the agent, nor will the agent be able to communicate with you outside of its final report. Therefore, your prompt should contain a highly detailed task description for the agent to perform autonomously and you should specify exactly what information the agent should return back to you in its final and only message to you.\n4. The agent's outputs should generally be trusted\n5. Clearly tell the agent whether you expect it to write code or just to do research (search, file reads, web fetches, etc.), since it is not aware of the user's intent\n6. If the agent description mentions that it should be used proactively, then you should try your best to use it without the user having to ask for it first. Use your judgement.\n\nExample usage:\n\n<example_agent_descriptions>\n\"code-reviewer\": use this agent after you are done writing a signficant piece of code\n\"greeting-responder\": use this agent when to respond to user greetings with a friendly joke\n</example_agent_description>\n\n<example>\nuser: \"Please write a function that checks if a number is prime\"\nassistant: Sure let me write a function that checks if a number is prime\nassistant: First let me use the Write tool to write a function that checks if a number is prime\nassistant: I'm going to use the Write tool to write the following code:\n<code>\nfunction isPrime(n) {\n if (n <= 1) return false\n for (let i = 2; i * i <= n; i++) {\n if (n % i === 0) return false\n }\n return true\n}\n</code>\n<commentary>\nSince a signficant piece of code was written and the task was completed, now use the code-reviewer agent to review the code\n</commentary>\nassistant: Now let me use the code-reviewer agent to review the code\nassistant: Uses the Task tool to launch the with the code-reviewer agent\n</example>\n\n<example>\nuser: \"Hello\"\n<commentary>\nSince the user is greeting, use the greeting-responder agent to respond with a friendly joke\n</commentary>\nassistant: \"I'm going to use the Task tool to launch the with the greeting-responder agent\"\n</example>\n\n"
|
|
223
223
|
},
|
|
224
224
|
{
|
|
225
225
|
"name": "tool-bash-description",
|
|
@@ -568,6 +568,6 @@
|
|
|
568
568
|
"description": "tool-task-description"
|
|
569
569
|
}
|
|
570
570
|
],
|
|
571
|
-
"commit": "
|
|
572
|
-
"date": "2025-09-
|
|
571
|
+
"commit": "71cf1be97a9649c0981d0366782780b137c7fa9d",
|
|
572
|
+
"date": "2025-09-17T16:20:43.209Z"
|
|
573
573
|
}
|
package/dist/444.codebuddy.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";exports.id=444,exports.ids=[444],exports.modules={84444:(e,t,r)=>{r.r(t),r.d(t,{Client:()=>Client});var s=r(76889);class Protocol{constructor(e){this._options=e,this._requestMessageId=0,this._requestHandlers=new Map,this._requestHandlerAbortControllers=new Map,this._notificationHandlers=new Map,this._responseHandlers=new Map,this._progressHandlers=new Map,this._timeoutInfo=new Map,this._pendingDebouncedNotifications=new Set,this.setNotificationHandler(s.CancelledNotificationSchema,(e=>{const t=this._requestHandlerAbortControllers.get(e.params.requestId);null==t||t.abort(e.params.reason)})),this.setNotificationHandler(s.ProgressNotificationSchema,(e=>{this._onprogress(e)})),this.setRequestHandler(s.PingRequestSchema,(e=>({})))}_setupTimeout(e,t,r,s,o=!1){this._timeoutInfo.set(e,{timeoutId:setTimeout(s,t),startTime:Date.now(),timeout:t,maxTotalTimeout:r,resetTimeoutOnProgress:o,onTimeout:s})}_resetTimeout(e){const t=this._timeoutInfo.get(e);if(!t)return!1;const r=Date.now()-t.startTime;if(t.maxTotalTimeout&&r>=t.maxTotalTimeout)throw this._timeoutInfo.delete(e),new s.McpError(s.ErrorCode.RequestTimeout,"Maximum total timeout exceeded",{maxTotalTimeout:t.maxTotalTimeout,totalElapsed:r});return clearTimeout(t.timeoutId),t.timeoutId=setTimeout(t.onTimeout,t.timeout),!0}_cleanupTimeout(e){const t=this._timeoutInfo.get(e);t&&(clearTimeout(t.timeoutId),this._timeoutInfo.delete(e))}async connect(e){var t,r,o;this._transport=e;const i=null===(t=this.transport)||void 0===t?void 0:t.onclose;this._transport.onclose=()=>{null==i||i(),this._onclose()};const n=null===(r=this.transport)||void 0===r?void 0:r.onerror;this._transport.onerror=e=>{null==n||n(e),this._onerror(e)};const a=null===(o=this._transport)||void 0===o?void 0:o.onmessage;this._transport.onmessage=(e,t)=>{null==a||a(e,t),(0,s.isJSONRPCResponse)(e)||(0,s.isJSONRPCError)(e)?this._onresponse(e):(0,s.isJSONRPCRequest)(e)?this._onrequest(e,t):(0,s.isJSONRPCNotification)(e)?this._onnotification(e):this._onerror(new Error(`Unknown message type: ${JSON.stringify(e)}`))},await this._transport.start()}_onclose(){var e;const t=this._responseHandlers;this._responseHandlers=new Map,this._progressHandlers.clear(),this._pendingDebouncedNotifications.clear(),this._transport=void 0,null===(e=this.onclose)||void 0===e||e.call(this);const r=new s.McpError(s.ErrorCode.ConnectionClosed,"Connection closed");for(const e of t.values())e(r)}_onerror(e){var t;null===(t=this.onerror)||void 0===t||t.call(this,e)}_onnotification(e){var t;const r=null!==(t=this._notificationHandlers.get(e.method))&&void 0!==t?t:this.fallbackNotificationHandler;void 0!==r&&Promise.resolve().then((()=>r(e))).catch((e=>this._onerror(new Error(`Uncaught error in notification handler: ${e}`))))}_onrequest(e,t){var r,o,i,n;const a=null!==(r=this._requestHandlers.get(e.method))&&void 0!==r?r:this.fallbackRequestHandler;if(void 0===a)return void(null===(o=this._transport)||void 0===o||o.send({jsonrpc:"2.0",id:e.id,error:{code:s.ErrorCode.MethodNotFound,message:"Method not found"}}).catch((e=>this._onerror(new Error(`Failed to send an error response: ${e}`)))));const l=new AbortController;this._requestHandlerAbortControllers.set(e.id,l);const u={signal:l.signal,sessionId:null===(i=this._transport)||void 0===i?void 0:i.sessionId,_meta:null===(n=e.params)||void 0===n?void 0:n._meta,sendNotification:t=>this.notification(t,{relatedRequestId:e.id}),sendRequest:(t,r,s)=>this.request(t,r,{...s,relatedRequestId:e.id}),authInfo:null==t?void 0:t.authInfo,requestId:e.id,requestInfo:null==t?void 0:t.requestInfo};Promise.resolve().then((()=>a(e,u))).then((t=>{var r;if(!l.signal.aborted)return null===(r=this._transport)||void 0===r?void 0:r.send({result:t,jsonrpc:"2.0",id:e.id})}),(t=>{var r,o;if(!l.signal.aborted)return null===(r=this._transport)||void 0===r?void 0:r.send({jsonrpc:"2.0",id:e.id,error:{code:Number.isSafeInteger(t.code)?t.code:s.ErrorCode.InternalError,message:null!==(o=t.message)&&void 0!==o?o:"Internal error"}})})).catch((e=>this._onerror(new Error(`Failed to send response: ${e}`)))).finally((()=>{this._requestHandlerAbortControllers.delete(e.id)}))}_onprogress(e){const{progressToken:t,...r}=e.params,s=Number(t),o=this._progressHandlers.get(s);if(!o)return void this._onerror(new Error(`Received a progress notification for an unknown token: ${JSON.stringify(e)}`));const i=this._responseHandlers.get(s),n=this._timeoutInfo.get(s);if(n&&i&&n.resetTimeoutOnProgress)try{this._resetTimeout(s)}catch(e){return void i(e)}o(r)}_onresponse(e){const t=Number(e.id),r=this._responseHandlers.get(t);if(void 0!==r)if(this._responseHandlers.delete(t),this._progressHandlers.delete(t),this._cleanupTimeout(t),(0,s.isJSONRPCResponse)(e))r(e);else{r(new s.McpError(e.error.code,e.error.message,e.error.data))}else this._onerror(new Error(`Received a response for an unknown message ID: ${JSON.stringify(e)}`))}get transport(){return this._transport}async close(){var e;await(null===(e=this._transport)||void 0===e?void 0:e.close())}request(e,t,r){const{relatedRequestId:o,resumptionToken:i,onresumptiontoken:n}=null!=r?r:{};return new Promise(((a,l)=>{var u,c,d,h,p,m;if(!this._transport)return void l(new Error("Not connected"));!0===(null===(u=this._options)||void 0===u?void 0:u.enforceStrictCapabilities)&&this.assertCapabilityForMethod(e.method),null===(c=null==r?void 0:r.signal)||void 0===c||c.throwIfAborted();const v=this._requestMessageId++,_={...e,jsonrpc:"2.0",id:v};(null==r?void 0:r.onprogress)&&(this._progressHandlers.set(v,r.onprogress),_.params={...e.params,_meta:{...(null===(d=e.params)||void 0===d?void 0:d._meta)||{},progressToken:v}});const cancel=e=>{var t;this._responseHandlers.delete(v),this._progressHandlers.delete(v),this._cleanupTimeout(v),null===(t=this._transport)||void 0===t||t.send({jsonrpc:"2.0",method:"notifications/cancelled",params:{requestId:v,reason:String(e)}},{relatedRequestId:o,resumptionToken:i,onresumptiontoken:n}).catch((e=>this._onerror(new Error(`Failed to send cancellation: ${e}`)))),l(e)};this._responseHandlers.set(v,(e=>{var s;if(!(null===(s=null==r?void 0:r.signal)||void 0===s?void 0:s.aborted)){if(e instanceof Error)return l(e);try{const r=t.parse(e.result);a(r)}catch(e){l(e)}}})),null===(h=null==r?void 0:r.signal)||void 0===h||h.addEventListener("abort",(()=>{var e;cancel(null===(e=null==r?void 0:r.signal)||void 0===e?void 0:e.reason)}));const f=null!==(p=null==r?void 0:r.timeout)&&void 0!==p?p:6e4;this._setupTimeout(v,f,null==r?void 0:r.maxTotalTimeout,(()=>cancel(new s.McpError(s.ErrorCode.RequestTimeout,"Request timed out",{timeout:f}))),null!==(m=null==r?void 0:r.resetTimeoutOnProgress)&&void 0!==m&&m),this._transport.send(_,{relatedRequestId:o,resumptionToken:i,onresumptiontoken:n}).catch((e=>{this._cleanupTimeout(v),l(e)}))}))}async notification(e,t){var r,s;if(!this._transport)throw new Error("Not connected");this.assertNotificationCapability(e.method);if((null!==(s=null===(r=this._options)||void 0===r?void 0:r.debouncedNotificationMethods)&&void 0!==s?s:[]).includes(e.method)&&!e.params&&!(null==t?void 0:t.relatedRequestId)){if(this._pendingDebouncedNotifications.has(e.method))return;return this._pendingDebouncedNotifications.add(e.method),void Promise.resolve().then((()=>{var r;if(this._pendingDebouncedNotifications.delete(e.method),!this._transport)return;const s={...e,jsonrpc:"2.0"};null===(r=this._transport)||void 0===r||r.send(s,t).catch((e=>this._onerror(e)))}))}const o={...e,jsonrpc:"2.0"};await this._transport.send(o,t)}setRequestHandler(e,t){const r=e.shape.method.value;this.assertRequestHandlerCapability(r),this._requestHandlers.set(r,((r,s)=>Promise.resolve(t(e.parse(r),s))))}removeRequestHandler(e){this._requestHandlers.delete(e)}assertCanSetRequestHandler(e){if(this._requestHandlers.has(e))throw new Error(`A request handler for ${e} already exists, which would be overridden`)}setNotificationHandler(e,t){this._notificationHandlers.set(e.shape.method.value,(r=>Promise.resolve(t(e.parse(r)))))}removeNotificationHandler(e){this._notificationHandlers.delete(e)}}var o=r(82174);class Client extends Protocol{constructor(e,t){var r;super(t),this._clientInfo=e,this._cachedToolOutputValidators=new Map,this._capabilities=null!==(r=null==t?void 0:t.capabilities)&&void 0!==r?r:{},this._ajv=new o}registerCapabilities(e){if(this.transport)throw new Error("Cannot register capabilities after connecting to transport");this._capabilities=function mergeCapabilities(e,t){return Object.entries(t).reduce(((e,[t,r])=>(e[t]=r&&"object"==typeof r&&e[t]?{...e[t],...r}:r,e)),{...e})}(this._capabilities,e)}assertCapability(e,t){var r;if(!(null===(r=this._serverCapabilities)||void 0===r?void 0:r[e]))throw new Error(`Server does not support ${e} (required for ${t})`)}async connect(e,t){if(await super.connect(e),void 0===e.sessionId)try{const r=await this.request({method:"initialize",params:{protocolVersion:s.LATEST_PROTOCOL_VERSION,capabilities:this._capabilities,clientInfo:this._clientInfo}},s.InitializeResultSchema,t);if(void 0===r)throw new Error(`Server sent invalid initialize result: ${r}`);if(!s.SUPPORTED_PROTOCOL_VERSIONS.includes(r.protocolVersion))throw new Error(`Server's protocol version is not supported: ${r.protocolVersion}`);this._serverCapabilities=r.capabilities,this._serverVersion=r.serverInfo,e.setProtocolVersion&&e.setProtocolVersion(r.protocolVersion),this._instructions=r.instructions,await this.notification({method:"notifications/initialized"})}catch(e){throw this.close(),e}}getServerCapabilities(){return this._serverCapabilities}getServerVersion(){return this._serverVersion}getInstructions(){return this._instructions}assertCapabilityForMethod(e){var t,r,s,o,i;switch(e){case"logging/setLevel":if(!(null===(t=this._serverCapabilities)||void 0===t?void 0:t.logging))throw new Error(`Server does not support logging (required for ${e})`);break;case"prompts/get":case"prompts/list":if(!(null===(r=this._serverCapabilities)||void 0===r?void 0:r.prompts))throw new Error(`Server does not support prompts (required for ${e})`);break;case"resources/list":case"resources/templates/list":case"resources/read":case"resources/subscribe":case"resources/unsubscribe":if(!(null===(s=this._serverCapabilities)||void 0===s?void 0:s.resources))throw new Error(`Server does not support resources (required for ${e})`);if("resources/subscribe"===e&&!this._serverCapabilities.resources.subscribe)throw new Error(`Server does not support resource subscriptions (required for ${e})`);break;case"tools/call":case"tools/list":if(!(null===(o=this._serverCapabilities)||void 0===o?void 0:o.tools))throw new Error(`Server does not support tools (required for ${e})`);break;case"completion/complete":if(!(null===(i=this._serverCapabilities)||void 0===i?void 0:i.completions))throw new Error(`Server does not support completions (required for ${e})`)}}assertNotificationCapability(e){var t;if("notifications/roots/list_changed"===e)if(!(null===(t=this._capabilities.roots)||void 0===t?void 0:t.listChanged))throw new Error(`Client does not support roots list changed notifications (required for ${e})`)}assertRequestHandlerCapability(e){switch(e){case"sampling/createMessage":if(!this._capabilities.sampling)throw new Error(`Client does not support sampling capability (required for ${e})`);break;case"elicitation/create":if(!this._capabilities.elicitation)throw new Error(`Client does not support elicitation capability (required for ${e})`);break;case"roots/list":if(!this._capabilities.roots)throw new Error(`Client does not support roots capability (required for ${e})`)}}async ping(e){return this.request({method:"ping"},s.EmptyResultSchema,e)}async complete(e,t){return this.request({method:"completion/complete",params:e},s.CompleteResultSchema,t)}async setLoggingLevel(e,t){return this.request({method:"logging/setLevel",params:{level:e}},s.EmptyResultSchema,t)}async getPrompt(e,t){return this.request({method:"prompts/get",params:e},s.GetPromptResultSchema,t)}async listPrompts(e,t){return this.request({method:"prompts/list",params:e},s.ListPromptsResultSchema,t)}async listResources(e,t){return this.request({method:"resources/list",params:e},s.ListResourcesResultSchema,t)}async listResourceTemplates(e,t){return this.request({method:"resources/templates/list",params:e},s.ListResourceTemplatesResultSchema,t)}async readResource(e,t){return this.request({method:"resources/read",params:e},s.ReadResourceResultSchema,t)}async subscribeResource(e,t){return this.request({method:"resources/subscribe",params:e},s.EmptyResultSchema,t)}async unsubscribeResource(e,t){return this.request({method:"resources/unsubscribe",params:e},s.EmptyResultSchema,t)}async callTool(e,t=s.CallToolResultSchema,r){const o=await this.request({method:"tools/call",params:e},t,r),i=this.getToolOutputValidator(e.name);if(i){if(!o.structuredContent&&!o.isError)throw new s.McpError(s.ErrorCode.InvalidRequest,`Tool ${e.name} has an output schema but did not return structured content`);if(o.structuredContent)try{if(!i(o.structuredContent))throw new s.McpError(s.ErrorCode.InvalidParams,`Structured content does not match the tool's output schema: ${this._ajv.errorsText(i.errors)}`)}catch(e){if(e instanceof s.McpError)throw e;throw new s.McpError(s.ErrorCode.InvalidParams,`Failed to validate structured content: ${e instanceof Error?e.message:String(e)}`)}}return o}cacheToolOutputSchemas(e){this._cachedToolOutputValidators.clear();for(const t of e)if(t.outputSchema)try{const e=this._ajv.compile(t.outputSchema);this._cachedToolOutputValidators.set(t.name,e)}catch(e){}}getToolOutputValidator(e){return this._cachedToolOutputValidators.get(e)}async listTools(e,t){const r=await this.request({method:"tools/list",params:e},s.ListToolsResultSchema,t);return this.cacheToolOutputSchemas(r.tools),r}async sendRootsListChanged(){return this.notification({method:"notifications/roots/list_changed"})}}}};
|
package/dist/814.codebuddy.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";exports.id=814,exports.ids=[814],exports.modules={47814:(r,s,e)=>{e.r(s),e.d(s,{DEFAULT_INHERITED_ENV_VARS:()=>a,StdioClientTransport:()=>StdioClientTransport,getDefaultEnvironment:()=>getDefaultEnvironment});var t=e(91092),i=e(1708),o=e(57075),n=e(76889);class ReadBuffer{append(r){this._buffer=this._buffer?Buffer.concat([this._buffer,r]):r}readMessage(){if(!this._buffer)return null;const r=this._buffer.indexOf("\n");if(-1===r)return null;const s=this._buffer.toString("utf8",0,r).replace(/\r$/,"");return this._buffer=this._buffer.subarray(r+1),function deserializeMessage(r){return n.JSONRPCMessageSchema.parse(JSON.parse(r))}(s)}clear(){this._buffer=void 0}}const a="win32"===i.platform?["APPDATA","HOMEDRIVE","HOMEPATH","LOCALAPPDATA","PATH","PROCESSOR_ARCHITECTURE","SYSTEMDRIVE","SYSTEMROOT","TEMP","USERNAME","USERPROFILE","PROGRAMFILES"]:["HOME","LOGNAME","PATH","SHELL","TERM","USER"];function getDefaultEnvironment(){const r={};for(const s of a){const e=i.env[s];void 0!==e&&(e.startsWith("()")||(r[s]=e))}return r}class StdioClientTransport{constructor(r){this._abortController=new AbortController,this._readBuffer=new ReadBuffer,this._stderrStream=null,this._serverParams=r,"pipe"!==r.stderr&&"overlapped"!==r.stderr||(this._stderrStream=new o.PassThrough)}async start(){if(this._process)throw new Error("StdioClientTransport already started! If using Client class, note that connect() calls start() automatically.");return new Promise(((r,s)=>{var e,o,n,a,l;this._process=t(this._serverParams.command,null!==(e=this._serverParams.args)&&void 0!==e?e:[],{env:{...getDefaultEnvironment(),...this._serverParams.env},stdio:["pipe","pipe",null!==(o=this._serverParams.stderr)&&void 0!==o?o:"inherit"],shell:!1,signal:this._abortController.signal,windowsHide:"win32"===i.platform&&"type"in i,cwd:this._serverParams.cwd}),this._process.on("error",(r=>{var e,t;"AbortError"!==r.name?(s(r),null===(t=this.onerror)||void 0===t||t.call(this,r)):null===(e=this.onclose)||void 0===e||e.call(this)})),this._process.on("spawn",(()=>{r()})),this._process.on("close",(r=>{var s;this._process=void 0,null===(s=this.onclose)||void 0===s||s.call(this)})),null===(n=this._process.stdin)||void 0===n||n.on("error",(r=>{var s;null===(s=this.onerror)||void 0===s||s.call(this,r)})),null===(a=this._process.stdout)||void 0===a||a.on("data",(r=>{this._readBuffer.append(r),this.processReadBuffer()})),null===(l=this._process.stdout)||void 0===l||l.on("error",(r=>{var s;null===(s=this.onerror)||void 0===s||s.call(this,r)})),this._stderrStream&&this._process.stderr&&this._process.stderr.pipe(this._stderrStream)}))}get stderr(){var r,s;return this._stderrStream?this._stderrStream:null!==(s=null===(r=this._process)||void 0===r?void 0:r.stderr)&&void 0!==s?s:null}get pid(){var r,s;return null!==(s=null===(r=this._process)||void 0===r?void 0:r.pid)&&void 0!==s?s:null}processReadBuffer(){for(var r,s;;)try{const s=this._readBuffer.readMessage();if(null===s)break;null===(r=this.onmessage)||void 0===r||r.call(this,s)}catch(r){null===(s=this.onerror)||void 0===s||s.call(this,r)}}async close(){this._abortController.abort(),this._process=void 0,this._readBuffer.clear()}send(r){return new Promise((s=>{var e;if(!(null===(e=this._process)||void 0===e?void 0:e.stdin))throw new Error("Not connected");const t=function serializeMessage(r){return JSON.stringify(r)+"\n"}(r);this._process.stdin.write(t)?s():this._process.stdin.once("drain",s)}))}}}};
|
package/dist/889.codebuddy.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";exports.id=889,exports.ids=[889],exports.modules={76889:(e,t,o)=>{o.r(t),o.d(t,{AudioContentSchema:()=>se,BaseMetadataSchema:()=>y,BlobResourceContentsSchema:()=>A,BooleanSchemaSchema:()=>Ne,CallToolRequestSchema:()=>be,CallToolResultSchema:()=>de,CancelledNotificationSchema:()=>f,ClientCapabilitiesSchema:()=>q,ClientNotificationSchema:()=>Fe,ClientRequestSchema:()=>De,ClientResultSchema:()=>Ge,CompatibilityCallToolResultSchema:()=>Se,CompleteRequestSchema:()=>we,CompleteResultSchema:()=>Ae,ContentBlockSchema:()=>ze,CreateMessageRequestSchema:()=>Te,CreateMessageResultSchema:()=>qe,CursorSchema:()=>l,DEFAULT_NEGOTIATED_PROTOCOL_VERSION:()=>s,ElicitRequestSchema:()=>ve,ElicitResultSchema:()=>Ie,EmbeddedResourceSchema:()=>ie,EmptyResultSchema:()=>P,EnumSchemaSchema:()=>Oe,ErrorCode:()=>x,GetPromptRequestSchema:()=>oe,GetPromptResultSchema:()=>ce,ImageContentSchema:()=>ne,ImplementationSchema:()=>T,InitializeRequestSchema:()=>N,InitializeResultSchema:()=>L,InitializedNotificationSchema:()=>O,JSONRPCErrorSchema:()=>j,JSONRPCMessageSchema:()=>C,JSONRPCNotificationSchema:()=>b,JSONRPCRequestSchema:()=>S,JSONRPCResponseSchema:()=>R,JSONRPC_VERSION:()=>r,LATEST_PROTOCOL_VERSION:()=>n,ListPromptsRequestSchema:()=>ee,ListPromptsResultSchema:()=>te,ListResourceTemplatesRequestSchema:()=>D,ListResourceTemplatesResultSchema:()=>F,ListResourcesRequestSchema:()=>U,ListResourcesResultSchema:()=>B,ListRootsRequestSchema:()=>He,ListRootsResultSchema:()=>Ue,ListToolsRequestSchema:()=>ue,ListToolsResultSchema:()=>ge,LoggingLevelSchema:()=>xe,LoggingMessageNotificationSchema:()=>Ce,McpError:()=>McpError,ModelHintSchema:()=>Pe,ModelPreferencesSchema:()=>fe,NotificationSchema:()=>u,NumberSchemaSchema:()=>Le,PaginatedRequestSchema:()=>M,PaginatedResultSchema:()=>k,PingRequestSchema:()=>_,PrimitiveSchemaDefinitionSchema:()=>_e,ProgressNotificationSchema:()=>I,ProgressSchema:()=>v,ProgressTokenSchema:()=>z,PromptArgumentSchema:()=>Y,PromptListChangedNotificationSchema:()=>me,PromptMessageSchema:()=>le,PromptReferenceSchema:()=>Je,PromptSchema:()=>Z,ReadResourceRequestSchema:()=>G,ReadResourceResultSchema:()=>W,RequestIdSchema:()=>d,RequestSchema:()=>p,ResourceContentsSchema:()=>J,ResourceLinkSchema:()=>re,ResourceListChangedNotificationSchema:()=>$,ResourceReferenceSchema:()=>ke,ResourceSchema:()=>V,ResourceTemplateReferenceSchema:()=>Me,ResourceTemplateSchema:()=>H,ResourceUpdatedNotificationSchema:()=>X,ResultSchema:()=>g,RootSchema:()=>Ve,RootsListChangedNotificationSchema:()=>Be,SUPPORTED_PROTOCOL_VERSIONS:()=>i,SamplingMessageSchema:()=>ye,ServerCapabilitiesSchema:()=>E,ServerNotificationSchema:()=>$e,ServerRequestSchema:()=>We,ServerResultSchema:()=>Ke,SetLevelRequestSchema:()=>je,StringSchemaSchema:()=>Ee,SubscribeRequestSchema:()=>K,TextContentSchema:()=>ae,TextResourceContentsSchema:()=>w,ToolAnnotationsSchema:()=>pe,ToolListChangedNotificationSchema:()=>Re,ToolSchema:()=>he,UnsubscribeRequestSchema:()=>Q,isInitializeRequest:()=>isInitializeRequest,isInitializedNotification:()=>isInitializedNotification,isJSONRPCError:()=>isJSONRPCError,isJSONRPCNotification:()=>isJSONRPCNotification,isJSONRPCRequest:()=>isJSONRPCRequest,isJSONRPCResponse:()=>isJSONRPCResponse});var a=o(7578);const n="2025-06-18",s="2025-03-26",i=[n,"2025-03-26","2024-11-05","2024-10-07"],r="2.0",z=a.z.union([a.z.string(),a.z.number().int()]),l=a.z.string(),c=a.z.object({progressToken:a.z.optional(z)}).passthrough(),m=a.z.object({_meta:a.z.optional(c)}).passthrough(),p=a.z.object({method:a.z.string(),params:a.z.optional(m)}),h=a.z.object({_meta:a.z.optional(a.z.object({}).passthrough())}).passthrough(),u=a.z.object({method:a.z.string(),params:a.z.optional(h)}),g=a.z.object({_meta:a.z.optional(a.z.object({}).passthrough())}).passthrough(),d=a.z.union([a.z.string(),a.z.number().int()]),S=a.z.object({jsonrpc:a.z.literal(r),id:d}).merge(p).strict(),isJSONRPCRequest=e=>S.safeParse(e).success,b=a.z.object({jsonrpc:a.z.literal(r)}).merge(u).strict(),isJSONRPCNotification=e=>b.safeParse(e).success,R=a.z.object({jsonrpc:a.z.literal(r),id:d,result:g}).strict(),isJSONRPCResponse=e=>R.safeParse(e).success;var x;!function(e){e[e.ConnectionClosed=-32e3]="ConnectionClosed",e[e.RequestTimeout=-32001]="RequestTimeout",e[e.ParseError=-32700]="ParseError",e[e.InvalidRequest=-32600]="InvalidRequest",e[e.MethodNotFound=-32601]="MethodNotFound",e[e.InvalidParams=-32602]="InvalidParams",e[e.InternalError=-32603]="InternalError"}(x||(x={}));const j=a.z.object({jsonrpc:a.z.literal(r),id:d,error:a.z.object({code:a.z.number().int(),message:a.z.string(),data:a.z.optional(a.z.unknown())})}).strict(),isJSONRPCError=e=>j.safeParse(e).success,C=a.z.union([S,b,R,j]),P=g.strict(),f=u.extend({method:a.z.literal("notifications/cancelled"),params:h.extend({requestId:d,reason:a.z.string().optional()})}),y=a.z.object({name:a.z.string(),title:a.z.optional(a.z.string())}).passthrough(),T=y.extend({version:a.z.string()}),q=a.z.object({experimental:a.z.optional(a.z.object({}).passthrough()),sampling:a.z.optional(a.z.object({}).passthrough()),elicitation:a.z.optional(a.z.object({}).passthrough()),roots:a.z.optional(a.z.object({listChanged:a.z.optional(a.z.boolean())}).passthrough())}).passthrough(),N=p.extend({method:a.z.literal("initialize"),params:m.extend({protocolVersion:a.z.string(),capabilities:q,clientInfo:T})}),isInitializeRequest=e=>N.safeParse(e).success,E=a.z.object({experimental:a.z.optional(a.z.object({}).passthrough()),logging:a.z.optional(a.z.object({}).passthrough()),completions:a.z.optional(a.z.object({}).passthrough()),prompts:a.z.optional(a.z.object({listChanged:a.z.optional(a.z.boolean())}).passthrough()),resources:a.z.optional(a.z.object({subscribe:a.z.optional(a.z.boolean()),listChanged:a.z.optional(a.z.boolean())}).passthrough()),tools:a.z.optional(a.z.object({listChanged:a.z.optional(a.z.boolean())}).passthrough())}).passthrough(),L=g.extend({protocolVersion:a.z.string(),capabilities:E,serverInfo:T,instructions:a.z.optional(a.z.string())}),O=u.extend({method:a.z.literal("notifications/initialized")}),isInitializedNotification=e=>O.safeParse(e).success,_=p.extend({method:a.z.literal("ping")}),v=a.z.object({progress:a.z.number(),total:a.z.optional(a.z.number()),message:a.z.optional(a.z.string())}).passthrough(),I=u.extend({method:a.z.literal("notifications/progress"),params:h.merge(v).extend({progressToken:z})}),M=p.extend({params:m.extend({cursor:a.z.optional(l)}).optional()}),k=g.extend({nextCursor:a.z.optional(l)}),J=a.z.object({uri:a.z.string(),mimeType:a.z.optional(a.z.string()),_meta:a.z.optional(a.z.object({}).passthrough())}).passthrough(),w=J.extend({text:a.z.string()}),A=J.extend({blob:a.z.string().base64()}),V=y.extend({uri:a.z.string(),description:a.z.optional(a.z.string()),mimeType:a.z.optional(a.z.string()),_meta:a.z.optional(a.z.object({}).passthrough())}),H=y.extend({uriTemplate:a.z.string(),description:a.z.optional(a.z.string()),mimeType:a.z.optional(a.z.string()),_meta:a.z.optional(a.z.object({}).passthrough())}),U=M.extend({method:a.z.literal("resources/list")}),B=k.extend({resources:a.z.array(V)}),D=M.extend({method:a.z.literal("resources/templates/list")}),F=k.extend({resourceTemplates:a.z.array(H)}),G=p.extend({method:a.z.literal("resources/read"),params:m.extend({uri:a.z.string()})}),W=g.extend({contents:a.z.array(a.z.union([w,A]))}),$=u.extend({method:a.z.literal("notifications/resources/list_changed")}),K=p.extend({method:a.z.literal("resources/subscribe"),params:m.extend({uri:a.z.string()})}),Q=p.extend({method:a.z.literal("resources/unsubscribe"),params:m.extend({uri:a.z.string()})}),X=u.extend({method:a.z.literal("notifications/resources/updated"),params:h.extend({uri:a.z.string()})}),Y=a.z.object({name:a.z.string(),description:a.z.optional(a.z.string()),required:a.z.optional(a.z.boolean())}).passthrough(),Z=y.extend({description:a.z.optional(a.z.string()),arguments:a.z.optional(a.z.array(Y)),_meta:a.z.optional(a.z.object({}).passthrough())}),ee=M.extend({method:a.z.literal("prompts/list")}),te=k.extend({prompts:a.z.array(Z)}),oe=p.extend({method:a.z.literal("prompts/get"),params:m.extend({name:a.z.string(),arguments:a.z.optional(a.z.record(a.z.string()))})}),ae=a.z.object({type:a.z.literal("text"),text:a.z.string(),_meta:a.z.optional(a.z.object({}).passthrough())}).passthrough(),ne=a.z.object({type:a.z.literal("image"),data:a.z.string().base64(),mimeType:a.z.string(),_meta:a.z.optional(a.z.object({}).passthrough())}).passthrough(),se=a.z.object({type:a.z.literal("audio"),data:a.z.string().base64(),mimeType:a.z.string(),_meta:a.z.optional(a.z.object({}).passthrough())}).passthrough(),ie=a.z.object({type:a.z.literal("resource"),resource:a.z.union([w,A]),_meta:a.z.optional(a.z.object({}).passthrough())}).passthrough(),re=V.extend({type:a.z.literal("resource_link")}),ze=a.z.union([ae,ne,se,re,ie]),le=a.z.object({role:a.z.enum(["user","assistant"]),content:ze}).passthrough(),ce=g.extend({description:a.z.optional(a.z.string()),messages:a.z.array(le)}),me=u.extend({method:a.z.literal("notifications/prompts/list_changed")}),pe=a.z.object({title:a.z.optional(a.z.string()),readOnlyHint:a.z.optional(a.z.boolean()),destructiveHint:a.z.optional(a.z.boolean()),idempotentHint:a.z.optional(a.z.boolean()),openWorldHint:a.z.optional(a.z.boolean())}).passthrough(),he=y.extend({description:a.z.optional(a.z.string()),inputSchema:a.z.object({type:a.z.literal("object"),properties:a.z.optional(a.z.object({}).passthrough()),required:a.z.optional(a.z.array(a.z.string()))}).passthrough(),outputSchema:a.z.optional(a.z.object({type:a.z.literal("object"),properties:a.z.optional(a.z.object({}).passthrough()),required:a.z.optional(a.z.array(a.z.string()))}).passthrough()),annotations:a.z.optional(pe),_meta:a.z.optional(a.z.object({}).passthrough())}),ue=M.extend({method:a.z.literal("tools/list")}),ge=k.extend({tools:a.z.array(he)}),de=g.extend({content:a.z.array(ze).default([]),structuredContent:a.z.object({}).passthrough().optional(),isError:a.z.optional(a.z.boolean())}),Se=de.or(g.extend({toolResult:a.z.unknown()})),be=p.extend({method:a.z.literal("tools/call"),params:m.extend({name:a.z.string(),arguments:a.z.optional(a.z.record(a.z.unknown()))})}),Re=u.extend({method:a.z.literal("notifications/tools/list_changed")}),xe=a.z.enum(["debug","info","notice","warning","error","critical","alert","emergency"]),je=p.extend({method:a.z.literal("logging/setLevel"),params:m.extend({level:xe})}),Ce=u.extend({method:a.z.literal("notifications/message"),params:h.extend({level:xe,logger:a.z.optional(a.z.string()),data:a.z.unknown()})}),Pe=a.z.object({name:a.z.string().optional()}).passthrough(),fe=a.z.object({hints:a.z.optional(a.z.array(Pe)),costPriority:a.z.optional(a.z.number().min(0).max(1)),speedPriority:a.z.optional(a.z.number().min(0).max(1)),intelligencePriority:a.z.optional(a.z.number().min(0).max(1))}).passthrough(),ye=a.z.object({role:a.z.enum(["user","assistant"]),content:a.z.union([ae,ne,se])}).passthrough(),Te=p.extend({method:a.z.literal("sampling/createMessage"),params:m.extend({messages:a.z.array(ye),systemPrompt:a.z.optional(a.z.string()),includeContext:a.z.optional(a.z.enum(["none","thisServer","allServers"])),temperature:a.z.optional(a.z.number()),maxTokens:a.z.number().int(),stopSequences:a.z.optional(a.z.array(a.z.string())),metadata:a.z.optional(a.z.object({}).passthrough()),modelPreferences:a.z.optional(fe)})}),qe=g.extend({model:a.z.string(),stopReason:a.z.optional(a.z.enum(["endTurn","stopSequence","maxTokens"]).or(a.z.string())),role:a.z.enum(["user","assistant"]),content:a.z.discriminatedUnion("type",[ae,ne,se])}),Ne=a.z.object({type:a.z.literal("boolean"),title:a.z.optional(a.z.string()),description:a.z.optional(a.z.string()),default:a.z.optional(a.z.boolean())}).passthrough(),Ee=a.z.object({type:a.z.literal("string"),title:a.z.optional(a.z.string()),description:a.z.optional(a.z.string()),minLength:a.z.optional(a.z.number()),maxLength:a.z.optional(a.z.number()),format:a.z.optional(a.z.enum(["email","uri","date","date-time"]))}).passthrough(),Le=a.z.object({type:a.z.enum(["number","integer"]),title:a.z.optional(a.z.string()),description:a.z.optional(a.z.string()),minimum:a.z.optional(a.z.number()),maximum:a.z.optional(a.z.number())}).passthrough(),Oe=a.z.object({type:a.z.literal("string"),title:a.z.optional(a.z.string()),description:a.z.optional(a.z.string()),enum:a.z.array(a.z.string()),enumNames:a.z.optional(a.z.array(a.z.string()))}).passthrough(),_e=a.z.union([Ne,Ee,Le,Oe]),ve=p.extend({method:a.z.literal("elicitation/create"),params:m.extend({message:a.z.string(),requestedSchema:a.z.object({type:a.z.literal("object"),properties:a.z.record(a.z.string(),_e),required:a.z.optional(a.z.array(a.z.string()))}).passthrough()})}),Ie=g.extend({action:a.z.enum(["accept","decline","cancel"]),content:a.z.optional(a.z.record(a.z.string(),a.z.unknown()))}),Me=a.z.object({type:a.z.literal("ref/resource"),uri:a.z.string()}).passthrough(),ke=Me,Je=a.z.object({type:a.z.literal("ref/prompt"),name:a.z.string()}).passthrough(),we=p.extend({method:a.z.literal("completion/complete"),params:m.extend({ref:a.z.union([Je,Me]),argument:a.z.object({name:a.z.string(),value:a.z.string()}).passthrough(),context:a.z.optional(a.z.object({arguments:a.z.optional(a.z.record(a.z.string(),a.z.string()))}))})}),Ae=g.extend({completion:a.z.object({values:a.z.array(a.z.string()).max(100),total:a.z.optional(a.z.number().int()),hasMore:a.z.optional(a.z.boolean())}).passthrough()}),Ve=a.z.object({uri:a.z.string().startsWith("file://"),name:a.z.optional(a.z.string()),_meta:a.z.optional(a.z.object({}).passthrough())}).passthrough(),He=p.extend({method:a.z.literal("roots/list")}),Ue=g.extend({roots:a.z.array(Ve)}),Be=u.extend({method:a.z.literal("notifications/roots/list_changed")}),De=a.z.union([_,N,we,je,oe,ee,U,D,G,K,Q,be,ue]),Fe=a.z.union([f,I,O,Be]),Ge=a.z.union([P,qe,Ie,Ue]),We=a.z.union([_,Te,ve,He]),$e=a.z.union([f,I,Ce,X,$,Re,me]),Ke=a.z.union([P,L,Ae,ce,te,B,F,W,de,ge]);class McpError extends Error{constructor(e,t,o){super(`MCP error ${e}: ${t}`),this.code=e,this.data=o,this.name="McpError"}}}};
|