@decaf-ts/mcp-server 0.4.7 → 0.4.8
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/dist/mcp-server.cjs +1 -1
- package/dist/mcp-server.cjs.map +1 -1
- package/dist/mcp-server.js +1 -1
- package/dist/mcp-server.js.map +1 -1
- package/lib/builders/builder.cjs +3 -1
- package/lib/builders/builder.d.ts +1 -1
- package/lib/builders/builder.js.map +1 -1
- package/lib/esm/builders/builder.d.ts +1 -1
- package/lib/esm/builders/builder.js +3 -1
- package/lib/esm/builders/builder.js.map +1 -1
- package/lib/esm/mcp-server.d.ts +1 -1
- package/lib/esm/mcp-server.js +55 -16
- package/lib/esm/mcp-server.js.map +1 -1
- package/lib/esm/version.d.ts +1 -1
- package/lib/esm/version.js +1 -1
- package/lib/mcp-server.cjs +56 -17
- package/lib/mcp-server.d.ts +1 -1
- package/lib/mcp-server.js.map +1 -1
- package/lib/version.cjs +1 -1
- package/lib/version.d.ts +1 -1
- package/package.json +1 -1
package/dist/mcp-server.cjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
var e,t;e=this,t=function(e,t,r,n,o,s,i,a,c,d,l,m,u,p,h,g,f){"use strict";function y(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var b,S,v,w=y(c),x=y(d);(e=>{e[e.NONE=0]="NONE",e[e.BASIC=1]="BASIC",e[e.ADVANCED=2]="ADVANCED",e[e.HIGH=3]="HIGH"})(b||(b={})),(e=>{e[e.NONE=0]="NONE",e[e.LOW=1]="LOW",e[e.MEDIUM=2]="MEDIUM",e[e.HIGH=3]="HIGH"})(S||(S={})),(e=>{e[e.FREE=0]="FREE",e[e.LOW=1]="LOW",e[e.MEDIUM=2]="MEDIUM",e[e.HIGH=3]="HIGH"})(v||(v={}));class T extends r.Model{constructor(e){super(e),r.Model.fromObject(this,e)}log(e){const{sessionId:t,requestId:r,authInfo:o}=e||{};let s="string"==typeof t&&t.length>0?n.Logging.for(t).for(this):n.Logging.for(this);return o&&o.clientId&&(s=s.for(o.clientId)),r&&(s=s.for(r.toString())),s}setDescription(e){return this.description=e,this}setName(e){return this.name=e,this}setTitle(e){return this.title=e,this}}t.__decorate([r.required(),t.__metadata("design:type",String)],T.prototype,"description",void 0),t.__decorate([r.required(),t.__metadata("design:type",String)],T.prototype,"name",void 0),t.__decorate([r.required(),t.__metadata("design:type",String)],T.prototype,"title",void 0);class N extends T{constructor(e){super(e),this.reasoning=b.NONE,this.effort=S.NONE,this.cost=v.FREE}setReasoning(e){return this.reasoning=e,this}setEffort(e){return this.effort=e,this}setCost(e){return this.cost=e,this}}t.__decorate([r.required(),t.__metadata("design:type",Number)],N.prototype,"reasoning",void 0),t.__decorate([r.required(),t.__metadata("design:type",Number)],N.prototype,"effort",void 0),t.__decorate([r.required(),t.__metadata("design:type",Number)],N.prototype,"cost",void 0);class _ extends N{setCb(e){return this.cb=e,this}setArgsSchema(e){return this.argsSchema=e,this}constructor(e){super(e)}static get builder(){return new _}build(e){const t=this.hasErrors();if(t)throw Error(t.toString());try{return e.registerPrompt(this.name,{title:this.title,description:this.description,argsSchema:this.argsSchema},async(e,t)=>{const r=this.log(t);e=e||{},r.verbose(`Executing prompt ${this.name} with args: ${JSON.stringify(e)}`),e._meta=Object.assign(e._meta||{},{usage:{reasoning:this.reasoning,effort:this.effort,cost:this.cost}});const n=await Promise.resolve(this.cb(e,t));return r.verbose(`Prompt ${this.name} executed successfully.`),r.debug("Prompt execution meta: "+JSON.stringify(n._meta)),n})}catch(e){throw n.Logging.for(this).error("Failed to register prompt "+this.name,e),e}}}t.__decorate([r.required(),t.__metadata("design:type",Object)],_.prototype,"cb",void 0),t.__decorate([r.required(),t.__metadata("design:type",Object)],_.prototype,"argsSchema",void 0);class E extends T{setCb(e){return this.cb=e,this}setConfig(e){return this.config=e,this}setUriOtTemplate(e){return this.uriOrTemplate=e,this}constructor(e){super(e)}static get builder(){return new E}build(e){const t=this.hasErrors();if(t)throw Error(t.toString());try{const t="string"==typeof this.uriOrTemplate&&this.uriOrTemplate.includes("{")?new s.ResourceTemplate(new o.UriTemplate(this.uriOrTemplate),{list:void 0}):this.uriOrTemplate,r=Object.assign(this.config,{_meta:{}}),n=async(e,t)=>{const r=this.log(t);r.verbose(`Requesting resource ${this.name} from ${e.toString()}`);const n=await Promise.resolve(this.cb(e,t));return r.verbose(`Resource ${this.name} retrieved successfully.`),r.debug("Resource retrieval meta: "+JSON.stringify(n._meta)),n};return e.resource(this.name,t,r,n)}catch(e){throw n.Logging.for(this).error("Error registering resource "+this.name,e),e}}}t.__decorate([r.required(),t.__metadata("design:type",String)],E.prototype,"uriOrTemplate",void 0),t.__decorate([r.required(),t.__metadata("design:type",Function)],E.prototype,"cb",void 0),t.__decorate([r.required(),t.__metadata("design:type",Object)],E.prototype,"config",void 0);class O extends N{setAnnotations(e){return this.annotations=Object.assign(this.annotations,e),this}setCb(e){return this.cb=e,this}setInputSchema(e){return this.inputSchema=e,this}setOutputSchema(e){return this.outputSchema=e,this}constructor(e){super(e),this.annotations={readOnlyHint:!0,destructiveHint:!1,idempotentHint:!0,openWorldHint:!1}}static get builder(){return new O}build(e){const t=this.hasErrors();if(t)throw Error(t.toString());try{return e.registerTool(this.name,{title:this.title,description:this.description,inputSchema:this.inputSchema,outputSchema:this.outputSchema,annotations:this.annotations,_meta:{usage:{reasoning:this.reasoning,effort:this.effort,cost:this.cost}}},async(e,t)=>{const r=this.log(t);r.verbose(`Executing tool ${this.name} with args: ${JSON.stringify(e)}`),t._meta=Object.assign(t._meta||{},{usage:{reasoning:this.reasoning,effort:this.effort,cost:this.cost}});const n=await Promise.resolve(this.cb(e,t));return r.verbose(`Tool ${this.name} executed successfully.`),r.debug("Tool execution meta: "+JSON.stringify(n._meta)),n})}catch(e){throw n.Logging.for(this).error("Error building tool",e),e}}}t.__decorate([r.required(),t.__metadata("design:type",Object)],O.prototype,"annotations",void 0),t.__decorate([r.required(),t.__metadata("design:type",Object)],O.prototype,"cb",void 0),t.__decorate([r.type(Object.name),r.required(),t.__metadata("design:type",Object)],O.prototype,"inputSchema",void 0),t.__decorate([r.type(Object.name),t.__metadata("design:type",Object)],O.prototype,"outputSchema",void 0);const D=["\x1b[38;5;215m","\x1b[38;5;209m","\x1b[38;5;205m","\x1b[38;5;210m","\x1b[38;5;217m","\x1b[38;5;216m","\x1b[38;5;224m","\x1b[38;5;230m","\x1b[38;5;230m"];let j=null;async function A(e){const t=j||(j=new m.Project({tsConfigFilePath:void 0,skipAddingFilesFromTsConfig:!0}),j),r=t.addSourceFileAtPathIfExists(e)||t.createSourceFile(e,void 0,{overwrite:!1});try{await Promise.race([t.resolveSourceFileDependencies(),new Promise(e=>setTimeout(e,2e3))])}catch(e){}const n=r.getExportedDeclarations();return{astObjects:Array.from(n.entries()).flatMap(([t,r])=>r.map(r=>{const n="function"==typeof r.getStartLineNumber?r.getStartLineNumber():0,o="function"==typeof r.getEndLineNumber?r.getEndLineNumber():0,s="function"==typeof r.getKindName?(r.getKindName()+"").toLowerCase():"unknown",i="function"==typeof r.getStartLinePos?r.getStartLinePos():0;return{id:`${e}::${t}`,name:t,kind:s,location:{filePath:e,startLine:n,startColumn:i,endLine:o,endColumn:0},isExported:!0}}))}}const C="ts.ast.extract",P="AST Extraction Tool for TypeScript",I=l.z.object({filePath:l.z.string().describe("The path to the TypeScript file to analyze.")}).describe(`the input schema for the ${C} tool`);l.z.object({}).describe(`the output schema for the ${C} tool`);const $=O.builder.setName(C).setTitle(P).setDescription("Extracts and analyzes the Abstract Syntax Tree (AST) of TypeScript code to provide insights into its structure and components.").setInputSchema(I).setAnnotations({title:P,readOnlyHint:!0,destructiveHint:!1,idempotentHint:!0,openWorldHint:!1}).setCb(async(e,t)=>{const{filePath:r}=e,n=await Promise.race([A(r),new Promise(e=>setTimeout(()=>e(null),1500))]);if(!n||!n.astObjects)return{content:[{type:"text",text:"No AST objects or analysis timed out"}],structuredContent:{astObjects:[]}};const o=n.astObjects.map(e=>({id:e.id,name:e.name,kind:e.kind||"unknown",location:e.location,isExported:!!e.isExported,signature:e.signature,parentId:e.parentId,children:e.children,decorators:e.decorators,contextHints:e.contextHints||[]}));return{content:[{type:"text",text:`Found ${o.length} AST objects`}],structuredContent:{astObjects:o}}}),k=O.builder.setName("example-tool").setTitle("Example: Reverse String Tool").setDescription("Reverses the provided `text` input and returns the result.").setInputSchema(l.z.object({text:l.z.string()})).setCb(async(e,t)=>{const r=((e?.text??"")+"").split("").reverse().join("");return{content:[{type:"text",text:r}],structuredContent:{result:r}}}).setReasoning(b.NONE).setEffort(S.NONE).setCost(v.FREE),R=O.builder.setName("ast.jsdoc").setTitle("AST \u2192 JSDoc Tool").setDescription("Generate suggested JSDoc comments for TypeScript AST objects (MVP stub).").setInputSchema(l.z.object({filePath:l.z.string()})).setCb(async(e,t)=>{const r=[{type:"text",text:"Not implemented (stub)"}];return{content:r,structuredContent:{content:r}}}).setReasoning(b.BASIC).setEffort(S.LOW).setCost(v.FREE),q=[$,k,O.builder.setName("file.summarizer").setTitle("File Summarizer").setDescription("Produce a short structured summary for a TypeScript file.").setInputSchema(l.z.object({filePath:l.z.string()})).setCb(async(e,t)=>{if(!(e?.filePath??e?.path))return{content:[{type:"text",text:""}]};const r=await(async()=>({astObjects:[]}))().catch(()=>null),n=r&&r.astObjects||[],o=n.map(e=>e.name||e.id||e.kind).slice(0,20),s=`Found ${n.length} AST objects. Top names: ${o.join(", ")}`;return{content:[{type:"text",text:s}],structuredContent:{summary:s},_meta:{count:n.length}}}).setReasoning(b.NONE).setEffort(S.NONE).setCost(v.FREE),R];var z=Object.freeze({__proto__:null,Tools:q});const J="You're a senior TypeScript developer writing JSDoc documentation for a class to be used with better-docs. Given the module code:\nGenerate a JSDoc comment block for a TypeScript module file using better-docs formatting:",M="document the target code, always including the @description tag with a short description of the target, and a@summary tag with a more detailed one.\n Include @interface and @typeDef an @template tags when appropriate.\n Include detailed @description for all properties.\n For methods, include @description and @summary tags as defined for the target. also document every argument, including its type definition, and return type, referencing @template tags when necessary.\n\n The order of tags (when applicable) should be as follows:\n1 - @description;\n2 - @summary;\n3 - @template;\n4 - @param;\n5 - @return;\n6 - @interface or @typeDef followed by the interface or type name;\n8 - @memberOf referencing the appropriate module using the appropriate syntax\n\nOutput only the completed JSDoc comment block for the type or interface.\nrefer to the module it belongs with @memberOf this the `@memberOf module:<module_name>` syntax\nnever omit or change any code\nif the element is already documented, only restructure, correct, or add to the documentation. NEVER remove existing information",L="document the target code, always including the @description tag with a short description of the target, and a@summary tag with a more detailed one.\nInclude @const and @typeDef tags when appropriate.\nInclude detailed @description for all properties.\n- For enums, include @enum and @readonly, and add inline documentation for each member\n- For object-like constants:\n - Create a @typedef with @property for each key\n - Reference it in the constant using @type\n - Alternatively, document each key inline if small\n\nThe order of tags (when applicable) should be as follows:\n1 - @description;\n2 - @summary;\n3 - @template;\n4 - @property;\n6 - @const followed by the const or enum name;\n8 - @memberOf referencing the appropriate module using the appropriate syntax\n\nRespond with the JSDoc comment block(s) for both the typedef and the constant or enum.\nrefer to the module it belongs with @memberOf this the `@memberOf module:<module_name>` syntax\nnever omit or change any code\nif the element is already documented, only restructure, correct, or add to the documentation. NEVER remove existing information",F="NOTES:\n - when document a function/method parameters, and there is a template type involved, ALWAYS reference it using the @template tag;\n - when documenting a function type as a parameter, ALWAYS use the function(type1,type2):return_type syntax;\n ",H=l.z.object({}),B=_.builder.setName("ts.jsdoc.class").setTitle("Class JSDocs Prompt").setDescription("Generate JSDoc comments for a TypeScript class according to a curated template and prompt.").setArgsSchema(H).setReasoning(b.BASIC).setCb((e,t)=>({messages:[{role:"user",content:{type:"text",text:`${J}\ndocument the entire class and each of its functions including always including the @description tag with a short description of the target, and a@summary tag with a more detailed one.\nInclude @class tags when applicable.\ninclude @param tags in the class documentation and its type definitions\nInclude detailed @description for all properties.\nInclude @template tags when necessary.\nDo NOT document the constructor, but include the constructor arguments as @param in the class documentation\nFor methods and functions:\n- include @description and @summary tags as defined for the target. also document every argument, including its type definition, and return type, referencing @template tags when necessary.\n- create a usage example under the @example tag on the class documentation\n- create mermaid sequence diagrams under the @mermaid tag;\n\nThe order of tags (when applicable) should be as follows:\n1 - @description;\n2 - @summary;\n3 - @template;\n4 - @param;\n5 - @return;\n6 - @class\n7 - @example\n8 - @mermaid;\n\nignore @mermaid for methods with less that 15 lines and constructors.\nRespond only with the full JSDoc comment block for the class and its methods.\nNEVER user @memberOf in the class or any of it's methods\nif the element is already documented, only restructure, correct, or add to the documentation. NEVER remove existing information\nnever omit or change any code, including the constructor\n${F}`}}],_meta:{}})),G=l.z.object({}),U=_.builder.setName("ts.jsdoc.const").setTitle("Const JSDocs Prompt").setDescription("Generate JSDoc comments for a TypeScript constant according to a curated template and prompt.").setArgsSchema(G).setCb((e,t)=>({messages:[{role:"user",content:{type:"text",text:`${J}\n${L}\n${F}`}}]})),V=l.z.object({}),W=_.builder.setName("ts.jsdoc.decorator").setTitle("Decorator JSDocs Prompt").setDescription("Generate JSDoc comments for a TypeScript Decorator according to a curated template and prompt.").setArgsSchema(V).setCb((e,t)=>({messages:[{role:"user",content:{type:"text",text:`${J}\ndocument the target code, always including the @description tag with a short description of the target, and a@summary tag with a more detailed one.\nInclude @function an @template tags when appropriate.\nInclude detailed @description for all properties.\nFor methods, include @description and @summary tags as defined for the target. also document every argument, including its type definition, and return type, referencing @template tags when necessary.\ncreate mermaid sequence diagrams under the @mermaid tag;\n\nThe order of tags (when applicable) should be as follows:\n1 - @description;\n2 - @summary;\n3 - @template;\n4 - @param including type definitions;\n5 - @return;\n6 - @function followed by the interface or type name;\n7 - @mermaid with the sequence diagram for the function if it has over 10 lines\n8 - @category one of: "Decorators", "Class Decorators", "Method Decorators", "Property Decorators", "Parameter Decorators"\nOutput only the full JSDoc comment block for the function.\nDO NOT refer to the module it belongs with @memberOf\nnever omit or change any code\nif the element is already documented, only restructure, correct, or add to the documentation. NEVER remove existing information\n${F}`}}]})),K=l.z.object({}),Y=_.builder.setName("ts.jsdoc.enum").setTitle("Enum JSDocs Prompt").setDescription("Generate JSDoc comments for a TypeScript enum according to a curated template and prompt.").setArgsSchema(K).setCb((e,t)=>({messages:[{role:"user",content:{type:"text",text:`${J}\n${L}\n${F}`}}]})),Q=l.z.object({}),X=_.builder.setName("ts.jsdoc.function").setTitle("Function JSDocs Prompt").setDescription("Generate JSDoc comments for a TypeScript function according to a curated template and prompt.").setArgsSchema(Q).setCb((e,t)=>({messages:[{role:"user",content:{type:"text",text:`${J}\ndocument the target code, always including the @description tag with a short description of the target, and a@summary tag with a more detailed one.\nInclude @function an @template tags when appropriate.\nInclude detailed @description for all properties.\nFor methods, include @description and @summary tags as defined for the target. also document every argument, including its type definition, and return type, referencing @template tags when necessary.\ncreate mermaid sequence diagrams under the @mermaid tag;\n\nThe order of tags (when applicable) should be as follows:\n1 - @description;\n2 - @summary;\n3 - @template;\n4 - @param including type definitions;\n5 - @return;\n6 - @function followed by the interface or type name;\n7 - @mermaid with the sequence diagram for the function if ithas over 10 lines\n8 - @memberOf referencing the appropriate module using the appropriate syntax\n\nOutput only the full JSDoc comment block for the function.\nrefer to the module it belongs with @memberOf this the \`@memberOf module:<module_name>\` syntax\nnever omit or change any code\nif the element is already documented, only restructure, correct, or add to the documentation. NEVER remove existing information\n${F}`}}]})),Z=l.z.object({}),ee=_.builder.setName("ts.jsdoc.interface").setTitle("Interface JSDocs Prompt").setDescription("Generate JSDoc comments for a TypeScript interface according to a curated template and prompt.").setArgsSchema(Z).setCb((e,t)=>({messages:[{role:"user",content:{type:"text",text:`${J}\n${M}\n${F}`}}]})),te=l.z.object({}),re=_.builder.setName("ts.jsdoc.type").setTitle("Type JSDocs Prompt").setDescription("Generate JSDoc comments for a TypeScript type according to a curated template and prompt.").setArgsSchema(te).setCb((e,t)=>({messages:[{role:"user",content:{type:"text",text:`${J}\n${M}\n${F}`}}]})),ne=l.z.object({className:l.z.string().describe("the class name to turn into a builder")}),oe=_.builder.setName("ts.code.dp.builder").setTitle("Typescript builder design patter prompt").setDescription("for a class, with a defined set of properties, scafold a builder design pattern").setArgsSchema(ne).setReasoning(b.BASIC).setCb((e,t)=>(e.className=n.toPascalCase(e.className),{messages:[{role:"user",content:{type:"text",text:`You're a senior TypeScript developer writing typescript code.You're a senior TypeScript developer writing typescript code.\nTransform the selected class into a builder design pattern implementation in Typescript.\nuse @decaf-ts validation decorators to enforce the validation of your builder.\n\n- must extend the Model Class from @decaf-ts/decorator-validation;\n- each property must be marked as protected;\n- each property must have a setter method that returns 'this' for chaining;\n- the build() method must validate the properties using hasErrors() method from Model class;\n- if validation fails, throw an error with the validation errors;\n- if validation passes, return an instance of the original class with the set properties;\n- optionally (but do so by default) add the static builder and from methods from the example;\n- if the clasee already follows the pattern but has properties without decoration or without setters, simple add them;\n\nexample:\n\noriginal class:\n\`\`\`typescript\nexport class ${e.className} {\n description!: string;\n name!: string = "default name";\n title!: string;\n age?: string;\n dateOfBirth!: Date;\n}}\n\`\`\` \n\nresulting builder pattern implementation:\n\`\`\`typescript\nexport class ${e.className}Builder extends Model {\n\n @minlength(10\n @required()\n protected description!: string;\n \n @required()\n protected name!: string = "default value;\n \n @required()\n protected title!: string;\n \n @min(18)\n protected age?: string;\n \n @date()\n protected dateOfBirth!: Date;\n\n protected constructor(arg?: ModelArg<${e.className}Builder>>) {\n super(arg);\n Model.fromModel(this, arg);\n }\n\n setDescription(value: string) {\n this.description = value;\n return this;\n }\n\n setName(value: string) {\n this.name = value;\n return this;\n }\n\n setTitle(value: string) {\n this.title = value;\n return this;\n }\n setAge(value: number) {\n this.age = value;\n return this;\n }\n setDate(value: Date) {\n this.age = value;\n return this;\n }\n \n build(...args: any[]): ${e.className}Builder | Promise<${e.className}Builder> {\n const errs = this.hasErrors();\n if (errs) throw new Error(errs.toString());\n \n return // code that builds OBJ here\n }\n \n static get builder(): ${e.className}Builder {\n return new ${e.className}Builder(); // static method to get a new builder instance\n }\n \n static from<K extends keyof ${e.className}Builder>(obj: K, ${e.className}Builder[K]): ${e.className}Builder {\n return new ${e.className}Builder(); // static method to create a builder from an object\n }\n}\n\`\`\` \n\n`}}],_meta:{}})),se=l.z.object({text:l.z.string().optional()}),ie=_.builder.setName("example.prompt.echo").setTitle("Example: Echo Prompt").setDescription("Returns a short prompt containing the provided `text` as a user message.").setArgsSchema(se).setReasoning(b.BASIC).setCb((e,t)=>({messages:[{role:"user",content:{type:"text",text:e?.text??"(no text provided)"}}],_meta:{}})),ae=l.z.object({code:l.z.string().optional(),astObject:l.z.any().optional()}),ce=[B,U,W,Y,X,ee,re,oe,ie,_.builder.setName("interactive.jsdoc.assistant").setTitle("Interactive JSDoc Assistant").setDescription("Produce a ready-to-insert JSDoc block for a provided code snippet or AST object.").setArgsSchema(ae).setReasoning(b.BASIC).setCb((e,t)=>({messages:[{role:"user",content:{type:"text",text:"Generate a complete JSDoc comment block for the following code. Respond only with the full JSDoc block.\n\n"+(e?.code??"")}}],_meta:{}}))],de=[E.builder.setName("example.resource.hello").setTitle("Example: Hello Resource").setDescription("A tiny example resource that returns a simple payload for any URI.").setUriOtTemplate("example://hello/{name}").setConfig({description:"Example resource",_meta:{usage:{reasoning:b.NONE,effort:S.NONE,cost:v.FREE}}}).setCb(async(e,t)=>({content:{type:"text",text:"hello from example resource"},_meta:{}})),E.builder.setName("repo.metadata").setTitle("Repository Metadata Resource").setDescription("Expose basic repository metadata such as package.json and lint rules.").setUriOtTemplate("repo://metadata/{file}").setConfig({description:"Repository metadata resource",_meta:{usage:{reasoning:b.NONE,effort:S.NONE,cost:v.FREE}}}).setCb(async(e,t)=>{const r=e.pathname.replace(/^\//,"")||"package.json";try{const e=c.resolve(process.cwd(),r),t=await u.readFile(e,{encoding:"utf8"}),n=JSON.parse(t);return{content:{type:"json",data:JSON.stringify(n)},_meta:{}}}catch(e){return{content:{type:"text",text:""},_meta:{}}}})],le="##VERSION##",me="##PACKAGE##";f.Metadata.registerLibrary(me,le);const ue={mcpId:me,name:"Official Decaf-TS MCP Server",title:"Official Decaf-TS MCP Server",description:"Provides precise coding assistance for the decaf-ts framework",version:le,websiteUrl:"https://decaf-ts.github.io",repositoryUrl:"https://github.com/decaf-ts",license:"AGPL-3.0",contacts:[{name:"Decaf-TS",url:"https://decaf-ts.github.io"}],tags:"server,official,decaf-ts",metadata:{},icons:[{src:"workdocs/assets/favicon.svg",mimeType:"image/svg+xml",sizes:"any"}]},pe=n.LoggedEnvironment.accumulate(ue);class he extends n.LoggedClass{get client(){if(!this._mcp)throw Error("Mcp server requires Mcp client");return this._mcp}constructor(){super()}async load(){try{const e=await Promise.all(de.map(e=>e.build(this.client)));this.log.verbose(`Loaded ${e.length} resources`);const t=await Promise.all(ce.map(e=>e.build(this.client)));this.log.verbose(`Loaded ${t.length} prompts`);const r=await Promise.all(q.map(e=>e.build(this.client)));this.log.verbose(`Loaded ${r.length} tools`);try{const e=await Promise.resolve().then(()=>z),t=Object.values(e).filter(e=>e&&"function"==typeof e.build).filter(e=>!q.includes(e));if(t.length>0){const e=await Promise.all(t.map(e=>e.build(this.client)));this.log.verbose(`Loaded ${e.length} exported builders from tools module`)}}catch(e){this.log.verbose("No additional exported builders loaded from tools module: "+e)}}catch(e){throw this.log.error("Error loading core MCP components",e),e}}async boot(e="stdio"){const t=this.log;this.log.for(this.boot).info("McpServer booting..."),((e=n.Logging.get())=>{let t;try{t=(()=>{let e,t=__dirname;try{for(;t&&t!==w.default.parse(t).root;){const r=w.default.join(t,"node_modules");if(x.default.existsSync(r)&&x.default.statSync(r).isDirectory()){e=r;break}const n=w.default.dirname(t);if(n===t)break;t=n}}catch{}const r=[];if(e){const t=w.default.join(e,"@decaf-ts");try{if(x.default.existsSync(t)&&x.default.statSync(t).isDirectory()){const e=x.default.readdirSync(t);for(const n of e){const e=w.default.join(t,n);try{const t=w.default.join(e,"workdocs","assets","slogans.json");if(x.default.existsSync(t)&&x.default.statSync(t).isFile()){const e=x.default.readFileSync(t,"utf-8"),n=JSON.parse(e);if(Array.isArray(n))for(const e of n)"string"==typeof e&&e.trim().length>0&&r.push(e.trim())}}catch{}}}}catch{}}return 0===r.length?"Decaf: strongly brewed TypeScript.":r[Math.floor(Math.random()*r.length)]})()}catch{t="Decaf: strongly brewed TypeScript."}const r="# \u2591\u2592\u2593\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2593\u2592\u2591 \u2591\u2592\u2593\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2593\u2592\u2591 \u2591\u2592\u2593\u2588\u2588\u2588\u2588\u2588\u2588\u2593\u2592\u2591 \u2591\u2592\u2593\u2588\u2588\u2588\u2588\u2588\u2588\u2593\u2592\u2591 \u2591\u2592\u2593\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2593\u2592\u2591 \u2591\u2592\u2593\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2593\u2592\u2591 \u2591\u2592\u2593\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2593\u2592\u2591 \n# ( ( \u2591\u2592\u2593\u2588\u2593\u2592\u2591\u2591\u2592\u2593\u2588\u2593\u2592\u2591 \u2591\u2592\u2593\u2588\u2593\u2592\u2591 \u2591\u2592\u2593\u2588\u2593\u2592\u2591\u2591\u2592\u2593\u2588\u2593\u2592\u2591 \u2591\u2592\u2593\u2588\u2593\u2592\u2591\u2591\u2592\u2593\u2588\u2593\u2592\u2591 \u2591\u2592\u2593\u2588\u2593\u2592\u2591 \u2591\u2592\u2593\u2588\u2593\u2592\u2591 \u2591\u2592\u2593\u2588\u2593\u2592\u2591 \n# ) ) \u2591\u2592\u2593\u2588\u2593\u2592\u2591\u2591\u2592\u2593\u2588\u2593\u2592\u2591 \u2591\u2592\u2593\u2588\u2593\u2592\u2591 \u2591\u2592\u2593\u2588\u2593\u2592\u2591 \u2591\u2592\u2593\u2588\u2593\u2592\u2591\u2591\u2592\u2593\u2588\u2593\u2592\u2591 \u2591\u2592\u2593\u2588\u2593\u2592\u2591 \u2591\u2592\u2593\u2588\u2593\u2592\u2591 \u2591\u2592\u2593\u2588\u2593\u2592\u2591 \n# [=======] \u2591\u2592\u2593\u2588\u2593\u2592\u2591\u2591\u2592\u2593\u2588\u2593\u2592\u2591 \u2591\u2592\u2593\u2588\u2588\u2588\u2588\u2588\u2588\u2593\u2592\u2591 \u2591\u2592\u2593\u2588\u2593\u2592\u2591 \u2591\u2592\u2593\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2593\u2592\u2591 \u2591\u2592\u2593\u2588\u2588\u2588\u2588\u2588\u2588\u2593\u2592\u2591 \u2591\u2592\u2593\u2588\u2593\u2592\u2591 \u2591\u2592\u2593\u2588\u2588\u2588\u2588\u2588\u2588\u2593\u2592\u2591 \n# `-----\xb4 \u2591\u2592\u2593\u2588\u2593\u2592\u2591\u2591\u2592\u2593\u2588\u2593\u2592\u2591 \u2591\u2592\u2593\u2588\u2593\u2592\u2591 \u2591\u2592\u2593\u2588\u2593\u2592\u2591 \u2591\u2592\u2593\u2588\u2593\u2592\u2591\u2591\u2592\u2593\u2588\u2593\u2592\u2591 \u2591\u2592\u2593\u2588\u2593\u2592\u2591 \u2591\u2592\u2593\u2588\u2593\u2592\u2591 \u2591\u2592\u2593\u2588\u2593\u2592\u2591 \n# \u2591\u2592\u2593\u2588\u2593\u2592\u2591\u2591\u2592\u2593\u2588\u2593\u2592\u2591 \u2591\u2592\u2593\u2588\u2593\u2592\u2591 \u2591\u2592\u2593\u2588\u2593\u2592\u2591\u2591\u2592\u2593\u2588\u2593\u2592\u2591 \u2591\u2592\u2593\u2588\u2593\u2592\u2591\u2591\u2592\u2593\u2588\u2593\u2592\u2591 \u2591\u2592\u2593\u2588\u2593\u2592\u2591 \u2591\u2592\u2593\u2588\u2593\u2592\u2591 \u2591\u2592\u2593\u2588\u2593\u2592\u2591 \n# \u2591\u2592\u2593\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2593\u2592\u2591 \u2591\u2592\u2593\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2593\u2592\u2591 \u2591\u2592\u2593\u2588\u2588\u2588\u2588\u2588\u2588\u2593\u2592\u2591 \u2591\u2592\u2593\u2588\u2593\u2592\u2591\u2591\u2592\u2593\u2588\u2593\u2592\u2591 \u2591\u2592\u2593\u2588\u2593\u2592\u2591 \u2591\u2592\u2593\u2588\u2593\u2592\u2591 \u2591\u2592\u2593\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2593\u2592\u2591 \n#".split("\n"),o=r.reduce((e,t)=>Math.max(e,t.length),0);r.push("# "+t.padStart(o-3)),r.forEach((t,r)=>{const n=D[r%D.length]||"",o=e?e.info.bind(e):(()=>{}).bind();try{o(a.style(t||"").raw(n).text)}catch{o((t||"")+"")}})})(this.log);const r=((Array.isArray(pe.icons)?pe.icons:[pe.icons])||[]).map(e=>{const t="string"==typeof e?.src?e.src:(e?.src??"")+"",r="string"==typeof e?.mimeType?e.mimeType:(e?.mimeType??"")+"";let n=[];return Array.isArray(e?.sizes)?n=e.sizes.map(e=>e+""):"string"==typeof e?.sizes&&(n=(e.sizes+"").split(",").map(e=>e.trim())),{src:t,mimeType:r,sizes:n}}),o=pe.contacts;let s;if(null!=o)if(Array.isArray(o))s=o.map(e=>({name:"string"==typeof e?.name?e.name:(e?.name??"")+"",email:"string"==typeof e?.email?e.email:e?.email?e.email+"":void 0,url:"string"==typeof e?.url?e.url:e?.url?e.url+"":void 0}));else if("object"==typeof o){const e=Object.keys(o||{}).filter(e=>/^[0-9]+$/.test(e)).sort((e,t)=>Number(e)-Number(t));if(e.length>0)s=e.map(e=>{const t=o[e];return{name:"string"==typeof t?.name?t.name:(t?.name??"")+"",email:"string"==typeof t?.email?t.email:t?.email?t.email+"":void 0,url:"string"==typeof t?.url?t.url:t?.url?t.url+"":void 0}});else if("number"==typeof o.length){const e=Number(o.length)||0;s=[];for(let t=0;e>t;t++){const e=o[t];s.push({name:"string"==typeof e?.name?e.name:(e?.name??"")+"",email:"string"==typeof e?.email?e.email:e?.email?e.email+"":void 0,url:"string"==typeof e?.url?e.url:e?.url?e.url+"":void 0})}}else s=Object.keys(o).filter(e=>"length"!==e).map(e=>{const t=o[e];return{name:"string"==typeof t?.name?t.name:(t?.name??"")+"",email:"string"==typeof t?.email?t.email:t?.email?t.email+"":void 0,url:"string"==typeof t?.url?t.url:t?.url?t.url+"":void 0}})}const c={id:pe.mcpId,name:pe.name,title:pe.title,description:pe.description,websiteUrl:pe.websiteUrl,repositoryUrl:pe.repositoryUrl,version:pe.version,license:pe.license,contacts:s,tags:pe.tags?pe.tags.split(","):void 0,metadata:pe.metadata,icons:r};this._mcp=new i.McpServer(c,{instructions:"You are an AI assistant designed to help users with programming tasks related to the Decaf-TS framework. \nProvide clear, concise, and accurate information.\nIf you don't know the answer, admit it rather than making up information.\nAlways prioritize the user's intent and provide helpful suggestions when appropriate.\n",capabilities:{logging:{},completions:{},resources:{},tools:{},prompts:{}}});try{await this.load()}catch(e){throw this.log.error("Error loading resources/prompts/tools: "+e),e}if("string"==typeof e)switch(e){case"stdio":e=new h.StdioServerTransport;break;case"http":e=new p.StreamableHTTPServerTransport({sessionIdGenerator:()=>g.v4(),onsessioninitialized:e=>t.verbose("Session initialized: "+e),onsessionclosed:e=>t.verbose("Session closed: "+e),enableJsonResponse:!0,eventStore:void 0,allowedHosts:["*"],allowedOrigins:["*"],enableDnsRebindingProtection:!0});break;default:throw Error("Invalid transport type: "+e)}return this.client.connect(e)}}e.Builder=T,e.McpServer=he,e.PACKAGE_NAME=me,e.PromptBuilder=_,e.ResourceBuilder=E,e.ToolBuilder=O,e.UsableBuilder=N,e.VERSION=le},"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("tslib"),require("@decaf-ts/decorator-validation"),require("@decaf-ts/logging"),require("@modelcontextprotocol/sdk/shared/uriTemplate"),require("@modelcontextprotocol/sdk/server/mcp"),require("@modelcontextprotocol/sdk/server/mcp.js"),require("styled-string-builder"),require("path"),require("fs"),require("zod"),require("ts-morph"),require("fs/promises"),require("@modelcontextprotocol/sdk/server/streamableHttp"),require("@modelcontextprotocol/sdk/server/stdio"),require("uuid"),require("@decaf-ts/decoration")):"function"==typeof define&&define.amd?define(["exports","tslib","@decaf-ts/decorator-validation","@decaf-ts/logging","@modelcontextprotocol/sdk/shared/uriTemplate","@modelcontextprotocol/sdk/server/mcp","@modelcontextprotocol/sdk/server/mcp.js","styled-string-builder","path","fs","zod","ts-morph","fs/promises","@modelcontextprotocol/sdk/server/streamableHttp","@modelcontextprotocol/sdk/server/stdio","uuid","@decaf-ts/decoration"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self)["mcp-server"]={},e.tslib,e.decafTsDecoratorValidation,e.decafTsLogging,e.uriTemplate,e.mcp,e.mcp_js,e.styledStringBuilder,e.path,e.fs,e.zod,e.tsMorph,e.fsPromises,e.streamableHttp,e.stdio,e.uuid,e.decafTsDecoration);
|
|
1
|
+
var e,t;e=this,t=function(e,t,r,n,o,s,i,a,c,d,l,m,u,p,h,g){"use strict";function f(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var y,b,S,v=f(a),w=f(c);(e=>{e[e.NONE=0]="NONE",e[e.BASIC=1]="BASIC",e[e.ADVANCED=2]="ADVANCED",e[e.HIGH=3]="HIGH"})(y||(y={})),(e=>{e[e.NONE=0]="NONE",e[e.LOW=1]="LOW",e[e.MEDIUM=2]="MEDIUM",e[e.HIGH=3]="HIGH"})(b||(b={})),(e=>{e[e.FREE=0]="FREE",e[e.LOW=1]="LOW",e[e.MEDIUM=2]="MEDIUM",e[e.HIGH=3]="HIGH"})(S||(S={}));class x extends r.Model{constructor(e){super(e),r.Model.fromObject(this,e)}log(e){const{sessionId:t,requestId:r,authInfo:o}=e||{};let s="string"==typeof t&&t.length>0?n.Logging.for(t).for(this):n.Logging.for(this);return o&&o.clientId&&(s=s.for(o.clientId)),r&&(s=s.for(r.toString())),s}setDescription(e){return this.description=e,this}setName(e){return this.name=e,this}setTitle(e){return this.title=e,this}}t.__decorate([r.required(),t.__metadata("design:type",String)],x.prototype,"description",void 0),t.__decorate([r.required(),t.__metadata("design:type",String)],x.prototype,"name",void 0),t.__decorate([r.required(),t.__metadata("design:type",String)],x.prototype,"title",void 0);class T extends x{constructor(e){super(e),this.reasoning=y.NONE,this.effort=b.NONE,this.cost=S.FREE}setReasoning(e){return this.reasoning=e,this}setEffort(e){return this.effort=e,this}setCost(e){return this.cost=e,this}}t.__decorate([r.required(),t.__metadata("design:type",Number)],T.prototype,"reasoning",void 0),t.__decorate([r.required(),t.__metadata("design:type",Number)],T.prototype,"effort",void 0),t.__decorate([r.required(),t.__metadata("design:type",Number)],T.prototype,"cost",void 0);class N extends T{setCb(e){return this.cb=e,this}setArgsSchema(e){return this.argsSchema=e,this}constructor(e){super(e)}static get builder(){return new N}build(e){const t=this.hasErrors();if(t)throw Error(t.toString());try{return e.registerPrompt(this.name,{title:this.title,description:this.description,argsSchema:this.argsSchema},async(e,t)=>{const r=this.log(t);e=e||{},r.verbose(`Executing prompt ${this.name} with args: ${JSON.stringify(e)}`),e._meta=Object.assign(e._meta||{},{usage:{reasoning:this.reasoning,effort:this.effort,cost:this.cost}});const n=await Promise.resolve(this.cb(e,t));return r.verbose(`Prompt ${this.name} executed successfully.`),r.debug("Prompt execution meta: "+JSON.stringify(n._meta)),n})}catch(e){throw n.Logging.for(this).error("Failed to register prompt "+this.name,e),e}}}t.__decorate([r.required(),t.__metadata("design:type",Object)],N.prototype,"cb",void 0),t.__decorate([r.required(),t.__metadata("design:type",Object)],N.prototype,"argsSchema",void 0);class _ extends x{setCb(e){return this.cb=e,this}setConfig(e){return this.config=e,this}setUriOtTemplate(e){return this.uriOrTemplate=e,this}constructor(e){super(e)}static get builder(){return new _}build(e){const t=this.hasErrors();if(t)throw Error(t.toString());try{const t="string"==typeof this.uriOrTemplate&&this.uriOrTemplate.includes("{")?new s.ResourceTemplate(new o.UriTemplate(this.uriOrTemplate),{list:void 0}):this.uriOrTemplate,r=Object.assign(this.config,{_meta:{}}),n=async(e,t)=>{const r=this.log(t);r.verbose(`Requesting resource ${this.name} from ${e.toString()}`);const n=await Promise.resolve(this.cb(e,t));return r.verbose(`Resource ${this.name} retrieved successfully.`),r.debug("Resource retrieval meta: "+JSON.stringify(n._meta)),n};return e.resource(this.name,t,r,n)}catch(e){throw n.Logging.for(this).error("Error registering resource "+this.name,e),e}}}t.__decorate([r.required(),t.__metadata("design:type",String)],_.prototype,"uriOrTemplate",void 0),t.__decorate([r.required(),t.__metadata("design:type",Function)],_.prototype,"cb",void 0),t.__decorate([r.required(),t.__metadata("design:type",Object)],_.prototype,"config",void 0);class E extends T{setAnnotations(e){return this.annotations=Object.assign(this.annotations,e),this}setCb(e){return this.cb=e,this}setInputSchema(e){return this.inputSchema=e,this}setOutputSchema(e){return this.outputSchema=e,this}constructor(e){super(e),this.annotations={readOnlyHint:!0,destructiveHint:!1,idempotentHint:!0,openWorldHint:!1}}static get builder(){return new E}build(e){const t=this.hasErrors();if(t)throw Error(t.toString());try{return e.registerTool(this.name,{title:this.title,description:this.description,inputSchema:this.inputSchema,outputSchema:this.outputSchema,annotations:this.annotations,_meta:{usage:{reasoning:this.reasoning,effort:this.effort,cost:this.cost}}},async(e,t)=>{const r=this.log(t);r.verbose(`Executing tool ${this.name} with args: ${JSON.stringify(e)}`),t._meta=Object.assign(t._meta||{},{usage:{reasoning:this.reasoning,effort:this.effort,cost:this.cost}});const n=await Promise.resolve(this.cb(e,t));return r.verbose(`Tool ${this.name} executed successfully.`),r.debug("Tool execution meta: "+JSON.stringify(n._meta)),n})}catch(e){throw n.Logging.for(this).error("Error building tool",e),e}}}t.__decorate([r.required(),t.__metadata("design:type",Object)],E.prototype,"annotations",void 0),t.__decorate([r.required(),t.__metadata("design:type",Object)],E.prototype,"cb",void 0),t.__decorate([r.type(Object.name),r.required(),t.__metadata("design:type",Object)],E.prototype,"inputSchema",void 0),t.__decorate([r.type(Object.name),t.__metadata("design:type",Object)],E.prototype,"outputSchema",void 0);const O=["\x1b[38;5;215m","\x1b[38;5;209m","\x1b[38;5;205m","\x1b[38;5;210m","\x1b[38;5;217m","\x1b[38;5;216m","\x1b[38;5;224m","\x1b[38;5;230m","\x1b[38;5;230m"];let D=null;async function j(e){const t=D||(D=new l.Project({tsConfigFilePath:void 0,skipAddingFilesFromTsConfig:!0}),D),r=t.addSourceFileAtPathIfExists(e)||t.createSourceFile(e,void 0,{overwrite:!1});try{await Promise.race([t.resolveSourceFileDependencies(),new Promise(e=>setTimeout(e,2e3))])}catch(e){}const n=r.getExportedDeclarations();return{astObjects:Array.from(n.entries()).flatMap(([t,r])=>r.map(r=>{const n="function"==typeof r.getStartLineNumber?r.getStartLineNumber():0,o="function"==typeof r.getEndLineNumber?r.getEndLineNumber():0,s="function"==typeof r.getKindName?(r.getKindName()+"").toLowerCase():"unknown",i="function"==typeof r.getStartLinePos?r.getStartLinePos():0;return{id:`${e}::${t}`,name:t,kind:s,location:{filePath:e,startLine:n,startColumn:i,endLine:o,endColumn:0},isExported:!0}}))}}const A="ts.ast.extract",C="AST Extraction Tool for TypeScript",P=d.z.object({filePath:d.z.string().describe("The path to the TypeScript file to analyze.")}).describe(`the input schema for the ${A} tool`);d.z.object({}).describe(`the output schema for the ${A} tool`);const I=E.builder.setName(A).setTitle(C).setDescription("Extracts and analyzes the Abstract Syntax Tree (AST) of TypeScript code to provide insights into its structure and components.").setInputSchema(P).setAnnotations({title:C,readOnlyHint:!0,destructiveHint:!1,idempotentHint:!0,openWorldHint:!1}).setCb(async(e,t)=>{const{filePath:r}=e,n=await Promise.race([j(r),new Promise(e=>setTimeout(()=>e(null),1500))]);if(!n||!n.astObjects)return{content:[{type:"text",text:"No AST objects or analysis timed out"}],structuredContent:{astObjects:[]}};const o=n.astObjects.map(e=>({id:e.id,name:e.name,kind:e.kind||"unknown",location:e.location,isExported:!!e.isExported,signature:e.signature,parentId:e.parentId,children:e.children,decorators:e.decorators,contextHints:e.contextHints||[]}));return{content:[{type:"text",text:`Found ${o.length} AST objects`}],structuredContent:{astObjects:o}}}),$=E.builder.setName("example-tool").setTitle("Example: Reverse String Tool").setDescription("Reverses the provided `text` input and returns the result.").setInputSchema(d.z.object({text:d.z.string()})).setCb(async(e,t)=>{const r=((e?.text??"")+"").split("").reverse().join("");return{content:[{type:"text",text:r}],structuredContent:{result:r}}}).setReasoning(y.NONE).setEffort(b.NONE).setCost(S.FREE),k=E.builder.setName("ast.jsdoc").setTitle("AST \u2192 JSDoc Tool").setDescription("Generate suggested JSDoc comments for TypeScript AST objects (MVP stub).").setInputSchema(d.z.object({filePath:d.z.string()})).setCb(async(e,t)=>{const r=[{type:"text",text:"Not implemented (stub)"}];return{content:r,structuredContent:{content:r}}}).setReasoning(y.BASIC).setEffort(b.LOW).setCost(S.FREE),R=[I,$,E.builder.setName("file.summarizer").setTitle("File Summarizer").setDescription("Produce a short structured summary for a TypeScript file.").setInputSchema(d.z.object({filePath:d.z.string()})).setCb(async(e,t)=>{if(!(e?.filePath??e?.path))return{content:[{type:"text",text:""}]};const r=await(async()=>({astObjects:[]}))().catch(()=>null),n=r&&r.astObjects||[],o=n.map(e=>e.name||e.id||e.kind).slice(0,20),s=`Found ${n.length} AST objects. Top names: ${o.join(", ")}`;return{content:[{type:"text",text:s}],structuredContent:{summary:s},_meta:{count:n.length}}}).setReasoning(y.NONE).setEffort(b.NONE).setCost(S.FREE),k];var q=Object.freeze({__proto__:null,Tools:R});const z="You're a senior TypeScript developer writing JSDoc documentation for a class to be used with better-docs. Given the module code:\nGenerate a JSDoc comment block for a TypeScript module file using better-docs formatting:",J="document the target code, always including the @description tag with a short description of the target, and a@summary tag with a more detailed one.\n Include @interface and @typeDef an @template tags when appropriate.\n Include detailed @description for all properties.\n For methods, include @description and @summary tags as defined for the target. also document every argument, including its type definition, and return type, referencing @template tags when necessary.\n\n The order of tags (when applicable) should be as follows:\n1 - @description;\n2 - @summary;\n3 - @template;\n4 - @param;\n5 - @return;\n6 - @interface or @typeDef followed by the interface or type name;\n8 - @memberOf referencing the appropriate module using the appropriate syntax\n\nOutput only the completed JSDoc comment block for the type or interface.\nrefer to the module it belongs with @memberOf this the `@memberOf module:<module_name>` syntax\nnever omit or change any code\nif the element is already documented, only restructure, correct, or add to the documentation. NEVER remove existing information",M="document the target code, always including the @description tag with a short description of the target, and a@summary tag with a more detailed one.\nInclude @const and @typeDef tags when appropriate.\nInclude detailed @description for all properties.\n- For enums, include @enum and @readonly, and add inline documentation for each member\n- For object-like constants:\n - Create a @typedef with @property for each key\n - Reference it in the constant using @type\n - Alternatively, document each key inline if small\n\nThe order of tags (when applicable) should be as follows:\n1 - @description;\n2 - @summary;\n3 - @template;\n4 - @property;\n6 - @const followed by the const or enum name;\n8 - @memberOf referencing the appropriate module using the appropriate syntax\n\nRespond with the JSDoc comment block(s) for both the typedef and the constant or enum.\nrefer to the module it belongs with @memberOf this the `@memberOf module:<module_name>` syntax\nnever omit or change any code\nif the element is already documented, only restructure, correct, or add to the documentation. NEVER remove existing information",L="NOTES:\n - when document a function/method parameters, and there is a template type involved, ALWAYS reference it using the @template tag;\n - when documenting a function type as a parameter, ALWAYS use the function(type1,type2):return_type syntax;\n ",F=d.z.object({}),H=N.builder.setName("ts.jsdoc.class").setTitle("Class JSDocs Prompt").setDescription("Generate JSDoc comments for a TypeScript class according to a curated template and prompt.").setArgsSchema(F).setReasoning(y.BASIC).setCb((e,t)=>({messages:[{role:"user",content:{type:"text",text:`${z}\ndocument the entire class and each of its functions including always including the @description tag with a short description of the target, and a@summary tag with a more detailed one.\nInclude @class tags when applicable.\ninclude @param tags in the class documentation and its type definitions\nInclude detailed @description for all properties.\nInclude @template tags when necessary.\nDo NOT document the constructor, but include the constructor arguments as @param in the class documentation\nFor methods and functions:\n- include @description and @summary tags as defined for the target. also document every argument, including its type definition, and return type, referencing @template tags when necessary.\n- create a usage example under the @example tag on the class documentation\n- create mermaid sequence diagrams under the @mermaid tag;\n\nThe order of tags (when applicable) should be as follows:\n1 - @description;\n2 - @summary;\n3 - @template;\n4 - @param;\n5 - @return;\n6 - @class\n7 - @example\n8 - @mermaid;\n\nignore @mermaid for methods with less that 15 lines and constructors.\nRespond only with the full JSDoc comment block for the class and its methods.\nNEVER user @memberOf in the class or any of it's methods\nif the element is already documented, only restructure, correct, or add to the documentation. NEVER remove existing information\nnever omit or change any code, including the constructor\n${L}`}}],_meta:{}})),B=d.z.object({}),G=N.builder.setName("ts.jsdoc.const").setTitle("Const JSDocs Prompt").setDescription("Generate JSDoc comments for a TypeScript constant according to a curated template and prompt.").setArgsSchema(B).setCb((e,t)=>({messages:[{role:"user",content:{type:"text",text:`${z}\n${M}\n${L}`}}]})),U=d.z.object({}),V=N.builder.setName("ts.jsdoc.decorator").setTitle("Decorator JSDocs Prompt").setDescription("Generate JSDoc comments for a TypeScript Decorator according to a curated template and prompt.").setArgsSchema(U).setCb((e,t)=>({messages:[{role:"user",content:{type:"text",text:`${z}\ndocument the target code, always including the @description tag with a short description of the target, and a@summary tag with a more detailed one.\nInclude @function an @template tags when appropriate.\nInclude detailed @description for all properties.\nFor methods, include @description and @summary tags as defined for the target. also document every argument, including its type definition, and return type, referencing @template tags when necessary.\ncreate mermaid sequence diagrams under the @mermaid tag;\n\nThe order of tags (when applicable) should be as follows:\n1 - @description;\n2 - @summary;\n3 - @template;\n4 - @param including type definitions;\n5 - @return;\n6 - @function followed by the interface or type name;\n7 - @mermaid with the sequence diagram for the function if it has over 10 lines\n8 - @category one of: "Decorators", "Class Decorators", "Method Decorators", "Property Decorators", "Parameter Decorators"\nOutput only the full JSDoc comment block for the function.\nDO NOT refer to the module it belongs with @memberOf\nnever omit or change any code\nif the element is already documented, only restructure, correct, or add to the documentation. NEVER remove existing information\n${L}`}}]})),W=d.z.object({}),K=N.builder.setName("ts.jsdoc.enum").setTitle("Enum JSDocs Prompt").setDescription("Generate JSDoc comments for a TypeScript enum according to a curated template and prompt.").setArgsSchema(W).setCb((e,t)=>({messages:[{role:"user",content:{type:"text",text:`${z}\n${M}\n${L}`}}]})),Y=d.z.object({}),Q=N.builder.setName("ts.jsdoc.function").setTitle("Function JSDocs Prompt").setDescription("Generate JSDoc comments for a TypeScript function according to a curated template and prompt.").setArgsSchema(Y).setCb((e,t)=>({messages:[{role:"user",content:{type:"text",text:`${z}\ndocument the target code, always including the @description tag with a short description of the target, and a@summary tag with a more detailed one.\nInclude @function an @template tags when appropriate.\nInclude detailed @description for all properties.\nFor methods, include @description and @summary tags as defined for the target. also document every argument, including its type definition, and return type, referencing @template tags when necessary.\ncreate mermaid sequence diagrams under the @mermaid tag;\n\nThe order of tags (when applicable) should be as follows:\n1 - @description;\n2 - @summary;\n3 - @template;\n4 - @param including type definitions;\n5 - @return;\n6 - @function followed by the interface or type name;\n7 - @mermaid with the sequence diagram for the function if ithas over 10 lines\n8 - @memberOf referencing the appropriate module using the appropriate syntax\n\nOutput only the full JSDoc comment block for the function.\nrefer to the module it belongs with @memberOf this the \`@memberOf module:<module_name>\` syntax\nnever omit or change any code\nif the element is already documented, only restructure, correct, or add to the documentation. NEVER remove existing information\n${L}`}}]})),X=d.z.object({}),Z=N.builder.setName("ts.jsdoc.interface").setTitle("Interface JSDocs Prompt").setDescription("Generate JSDoc comments for a TypeScript interface according to a curated template and prompt.").setArgsSchema(X).setCb((e,t)=>({messages:[{role:"user",content:{type:"text",text:`${z}\n${J}\n${L}`}}]})),ee=d.z.object({}),te=N.builder.setName("ts.jsdoc.type").setTitle("Type JSDocs Prompt").setDescription("Generate JSDoc comments for a TypeScript type according to a curated template and prompt.").setArgsSchema(ee).setCb((e,t)=>({messages:[{role:"user",content:{type:"text",text:`${z}\n${J}\n${L}`}}]})),re=d.z.object({className:d.z.string().describe("the class name to turn into a builder")}),ne=N.builder.setName("ts.code.dp.builder").setTitle("Typescript builder design patter prompt").setDescription("for a class, with a defined set of properties, scafold a builder design pattern").setArgsSchema(re).setReasoning(y.BASIC).setCb((e,t)=>(e.className=n.toPascalCase(e.className),{messages:[{role:"user",content:{type:"text",text:`You're a senior TypeScript developer writing typescript code.You're a senior TypeScript developer writing typescript code.\nTransform the selected class into a builder design pattern implementation in Typescript.\nuse @decaf-ts validation decorators to enforce the validation of your builder.\n\n- must extend the Model Class from @decaf-ts/decorator-validation;\n- each property must be marked as protected;\n- each property must have a setter method that returns 'this' for chaining;\n- the build() method must validate the properties using hasErrors() method from Model class;\n- if validation fails, throw an error with the validation errors;\n- if validation passes, return an instance of the original class with the set properties;\n- optionally (but do so by default) add the static builder and from methods from the example;\n- if the clasee already follows the pattern but has properties without decoration or without setters, simple add them;\n\nexample:\n\noriginal class:\n\`\`\`typescript\nexport class ${e.className} {\n description!: string;\n name!: string = "default name";\n title!: string;\n age?: string;\n dateOfBirth!: Date;\n}}\n\`\`\` \n\nresulting builder pattern implementation:\n\`\`\`typescript\nexport class ${e.className}Builder extends Model {\n\n @minlength(10\n @required()\n protected description!: string;\n \n @required()\n protected name!: string = "default value;\n \n @required()\n protected title!: string;\n \n @min(18)\n protected age?: string;\n \n @date()\n protected dateOfBirth!: Date;\n\n protected constructor(arg?: ModelArg<${e.className}Builder>>) {\n super(arg);\n Model.fromModel(this, arg);\n }\n\n setDescription(value: string) {\n this.description = value;\n return this;\n }\n\n setName(value: string) {\n this.name = value;\n return this;\n }\n\n setTitle(value: string) {\n this.title = value;\n return this;\n }\n setAge(value: number) {\n this.age = value;\n return this;\n }\n setDate(value: Date) {\n this.age = value;\n return this;\n }\n \n build(...args: any[]): ${e.className}Builder | Promise<${e.className}Builder> {\n const errs = this.hasErrors();\n if (errs) throw new Error(errs.toString());\n \n return // code that builds OBJ here\n }\n \n static get builder(): ${e.className}Builder {\n return new ${e.className}Builder(); // static method to get a new builder instance\n }\n \n static from<K extends keyof ${e.className}Builder>(obj: K, ${e.className}Builder[K]): ${e.className}Builder {\n return new ${e.className}Builder(); // static method to create a builder from an object\n }\n}\n\`\`\` \n\n`}}],_meta:{}})),oe=d.z.object({text:d.z.string().optional()}),se=N.builder.setName("example.prompt.echo").setTitle("Example: Echo Prompt").setDescription("Returns a short prompt containing the provided `text` as a user message.").setArgsSchema(oe).setReasoning(y.BASIC).setCb((e,t)=>({messages:[{role:"user",content:{type:"text",text:e?.text??"(no text provided)"}}],_meta:{}})),ie=d.z.object({code:d.z.string().optional(),astObject:d.z.any().optional()}),ae=[H,G,V,K,Q,Z,te,ne,se,N.builder.setName("interactive.jsdoc.assistant").setTitle("Interactive JSDoc Assistant").setDescription("Produce a ready-to-insert JSDoc block for a provided code snippet or AST object.").setArgsSchema(ie).setReasoning(y.BASIC).setCb((e,t)=>({messages:[{role:"user",content:{type:"text",text:"Generate a complete JSDoc comment block for the following code. Respond only with the full JSDoc block.\n\n"+(e?.code??"")}}],_meta:{}}))],ce=[_.builder.setName("example.resource.hello").setTitle("Example: Hello Resource").setDescription("A tiny example resource that returns a simple payload for any URI.").setUriOtTemplate("example://hello/{name}").setConfig({description:"Example resource",_meta:{usage:{reasoning:y.NONE,effort:b.NONE,cost:S.FREE}}}).setCb(async(e,t)=>({content:{type:"text",text:"hello from example resource"},_meta:{}})),_.builder.setName("repo.metadata").setTitle("Repository Metadata Resource").setDescription("Expose basic repository metadata such as package.json and lint rules.").setUriOtTemplate("repo://metadata/{file}").setConfig({description:"Repository metadata resource",_meta:{usage:{reasoning:y.NONE,effort:b.NONE,cost:S.FREE}}}).setCb(async(e,t)=>{const r=e.pathname.replace(/^\//,"")||"package.json";try{const e=a.resolve(process.cwd(),r),t=await m.readFile(e,{encoding:"utf8"}),n=JSON.parse(t);return{content:{type:"json",data:JSON.stringify(n)},_meta:{}}}catch(e){return{content:{type:"text",text:""},_meta:{}}}})],de="##VERSION##",le="##PACKAGE##";g.Metadata.registerLibrary(le,de);const me={mcpId:le,name:"Official Decaf-TS MCP Server",title:"Official Decaf-TS MCP Server",description:"Provides precise coding assistance for the decaf-ts framework",version:de,websiteUrl:"https://decaf-ts.github.io",repositoryUrl:"https://github.com/decaf-ts",license:"AGPL-3.0",contacts:[{name:"Decaf-TS",url:"https://decaf-ts.github.io"}],tags:"server,official,decaf-ts",metadata:{},icons:[{src:"workdocs/assets/favicon.svg",mimeType:"image/svg+xml",sizes:"any"}]},ue=n.LoggedEnvironment.accumulate(me);class pe extends n.LoggedClass{get client(){if(!this._mcp)throw Error("Mcp server requires Mcp client");return this._mcp}constructor(){super()}async load(){try{const e=await Promise.all(ce.map(e=>e.build(this.client)));this.log.verbose(`Loaded ${e.length} resources`);const t=await Promise.all(ae.map(e=>e.build(this.client)));this.log.verbose(`Loaded ${t.length} prompts`);const r=await Promise.all(R.map(e=>e.build(this.client)));this.log.verbose(`Loaded ${r.length} tools`);try{const e=await Promise.resolve().then(()=>q),t=Object.values(e).filter(e=>e&&"function"==typeof e.build).filter(e=>!R.includes(e));if(t.length>0){const e=await Promise.all(t.map(e=>e.build(this.client)));this.log.verbose(`Loaded ${e.length} exported builders from tools module`)}}catch(e){this.log.verbose("No additional exported builders loaded from tools module: "+e)}}catch(e){throw this.log.error("Error loading core MCP components",e),e}}async boot(e="stdio"){const t=this.log;this.log.for(this.boot).info("McpServer booting..."),((e=n.Logging.get())=>{let t;try{t=(()=>{let e,t=__dirname;try{for(;t&&t!==v.default.parse(t).root;){const r=v.default.join(t,"node_modules");if(w.default.existsSync(r)&&w.default.statSync(r).isDirectory()){e=r;break}const n=v.default.dirname(t);if(n===t)break;t=n}}catch{}const r=[];if(e){const t=v.default.join(e,"@decaf-ts");try{if(w.default.existsSync(t)&&w.default.statSync(t).isDirectory()){const e=w.default.readdirSync(t);for(const n of e){const e=v.default.join(t,n);try{const t=v.default.join(e,"workdocs","assets","slogans.json");if(w.default.existsSync(t)&&w.default.statSync(t).isFile()){const e=w.default.readFileSync(t,"utf-8"),n=JSON.parse(e);if(Array.isArray(n))for(const e of n)"string"==typeof e&&e.trim().length>0&&r.push(e.trim())}}catch{}}}}catch{}}return 0===r.length?"Decaf: strongly brewed TypeScript.":r[Math.floor(Math.random()*r.length)]})()}catch{t="Decaf: strongly brewed TypeScript."}const r="# \u2591\u2592\u2593\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2593\u2592\u2591 \u2591\u2592\u2593\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2593\u2592\u2591 \u2591\u2592\u2593\u2588\u2588\u2588\u2588\u2588\u2588\u2593\u2592\u2591 \u2591\u2592\u2593\u2588\u2588\u2588\u2588\u2588\u2588\u2593\u2592\u2591 \u2591\u2592\u2593\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2593\u2592\u2591 \u2591\u2592\u2593\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2593\u2592\u2591 \u2591\u2592\u2593\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2593\u2592\u2591 \n# ( ( \u2591\u2592\u2593\u2588\u2593\u2592\u2591\u2591\u2592\u2593\u2588\u2593\u2592\u2591 \u2591\u2592\u2593\u2588\u2593\u2592\u2591 \u2591\u2592\u2593\u2588\u2593\u2592\u2591\u2591\u2592\u2593\u2588\u2593\u2592\u2591 \u2591\u2592\u2593\u2588\u2593\u2592\u2591\u2591\u2592\u2593\u2588\u2593\u2592\u2591 \u2591\u2592\u2593\u2588\u2593\u2592\u2591 \u2591\u2592\u2593\u2588\u2593\u2592\u2591 \u2591\u2592\u2593\u2588\u2593\u2592\u2591 \n# ) ) \u2591\u2592\u2593\u2588\u2593\u2592\u2591\u2591\u2592\u2593\u2588\u2593\u2592\u2591 \u2591\u2592\u2593\u2588\u2593\u2592\u2591 \u2591\u2592\u2593\u2588\u2593\u2592\u2591 \u2591\u2592\u2593\u2588\u2593\u2592\u2591\u2591\u2592\u2593\u2588\u2593\u2592\u2591 \u2591\u2592\u2593\u2588\u2593\u2592\u2591 \u2591\u2592\u2593\u2588\u2593\u2592\u2591 \u2591\u2592\u2593\u2588\u2593\u2592\u2591 \n# [=======] \u2591\u2592\u2593\u2588\u2593\u2592\u2591\u2591\u2592\u2593\u2588\u2593\u2592\u2591 \u2591\u2592\u2593\u2588\u2588\u2588\u2588\u2588\u2588\u2593\u2592\u2591 \u2591\u2592\u2593\u2588\u2593\u2592\u2591 \u2591\u2592\u2593\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2593\u2592\u2591 \u2591\u2592\u2593\u2588\u2588\u2588\u2588\u2588\u2588\u2593\u2592\u2591 \u2591\u2592\u2593\u2588\u2593\u2592\u2591 \u2591\u2592\u2593\u2588\u2588\u2588\u2588\u2588\u2588\u2593\u2592\u2591 \n# `-----\xb4 \u2591\u2592\u2593\u2588\u2593\u2592\u2591\u2591\u2592\u2593\u2588\u2593\u2592\u2591 \u2591\u2592\u2593\u2588\u2593\u2592\u2591 \u2591\u2592\u2593\u2588\u2593\u2592\u2591 \u2591\u2592\u2593\u2588\u2593\u2592\u2591\u2591\u2592\u2593\u2588\u2593\u2592\u2591 \u2591\u2592\u2593\u2588\u2593\u2592\u2591 \u2591\u2592\u2593\u2588\u2593\u2592\u2591 \u2591\u2592\u2593\u2588\u2593\u2592\u2591 \n# \u2591\u2592\u2593\u2588\u2593\u2592\u2591\u2591\u2592\u2593\u2588\u2593\u2592\u2591 \u2591\u2592\u2593\u2588\u2593\u2592\u2591 \u2591\u2592\u2593\u2588\u2593\u2592\u2591\u2591\u2592\u2593\u2588\u2593\u2592\u2591 \u2591\u2592\u2593\u2588\u2593\u2592\u2591\u2591\u2592\u2593\u2588\u2593\u2592\u2591 \u2591\u2592\u2593\u2588\u2593\u2592\u2591 \u2591\u2592\u2593\u2588\u2593\u2592\u2591 \u2591\u2592\u2593\u2588\u2593\u2592\u2591 \n# \u2591\u2592\u2593\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2593\u2592\u2591 \u2591\u2592\u2593\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2593\u2592\u2591 \u2591\u2592\u2593\u2588\u2588\u2588\u2588\u2588\u2588\u2593\u2592\u2591 \u2591\u2592\u2593\u2588\u2593\u2592\u2591\u2591\u2592\u2593\u2588\u2593\u2592\u2591 \u2591\u2592\u2593\u2588\u2593\u2592\u2591 \u2591\u2592\u2593\u2588\u2593\u2592\u2591 \u2591\u2592\u2593\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2593\u2592\u2591 \n#".split("\n"),o=r.reduce((e,t)=>Math.max(e,t.length),0);r.push("# "+t.padStart(o-3)),r.forEach((t,r)=>{const n=O[r%O.length]||"",o=e?e.info.bind(e):(()=>{}).bind();try{o(i.style(t||"").raw(n).text)}catch{o((t||"")+"")}})})(this.log);const r=((Array.isArray(ue.icons)?ue.icons:[ue.icons])||[]).map(e=>{const t="string"==typeof e?.src?e.src:(e?.src??"")+"",r="string"==typeof e?.mimeType?e.mimeType:(e?.mimeType??"")+"";let n=[];return Array.isArray(e?.sizes)?n=e.sizes.map(e=>e+""):"string"==typeof e?.sizes&&(n=(e.sizes+"").split(",").map(e=>e.trim())),{src:t,mimeType:r,sizes:n}}),o=ue.contacts;let a;if(null!=o)if(Array.isArray(o))a=o.map(e=>({name:"string"==typeof e?.name?e.name:(e?.name??"")+"",email:"string"==typeof e?.email?e.email:e?.email?e.email+"":void 0,url:"string"==typeof e?.url?e.url:e?.url?e.url+"":void 0}));else if("object"==typeof o){const e=Object.keys(o||{}).filter(e=>/^[0-9]+$/.test(e)).sort((e,t)=>Number(e)-Number(t));if(e.length>0)a=e.map(e=>{const t=o[e];return{name:"string"==typeof t?.name?t.name:(t?.name??"")+"",email:"string"==typeof t?.email?t.email:t?.email?t.email+"":void 0,url:"string"==typeof t?.url?t.url:t?.url?t.url+"":void 0}});else if("number"==typeof o.length){const e=Number(o.length)||0;a=[];for(let t=0;e>t;t++){const e=o[t];a.push({name:"string"==typeof e?.name?e.name:(e?.name??"")+"",email:"string"==typeof e?.email?e.email:e?.email?e.email+"":void 0,url:"string"==typeof e?.url?e.url:e?.url?e.url+"":void 0})}}else a=Object.keys(o).filter(e=>"length"!==e).map(e=>{const t=o[e];return{name:"string"==typeof t?.name?t.name:(t?.name??"")+"",email:"string"==typeof t?.email?t.email:t?.email?t.email+"":void 0,url:"string"==typeof t?.url?t.url:t?.url?t.url+"":void 0}})}const c={id:ue.mcpId,name:ue.name,title:ue.title,description:ue.description,websiteUrl:ue.websiteUrl,repositoryUrl:ue.repositoryUrl,version:ue.version,license:ue.license,contacts:a,tags:ue.tags?ue.tags.split(","):void 0,metadata:ue.metadata,icons:r};this._mcp=new s.McpServer(c,{instructions:"You are an AI assistant designed to help users with programming tasks related to the Decaf-TS framework. \nProvide clear, concise, and accurate information.\nIf you don't know the answer, admit it rather than making up information.\nAlways prioritize the user's intent and provide helpful suggestions when appropriate.\n",capabilities:{logging:{},completions:{},resources:{},tools:{},prompts:{}}});try{await this.load()}catch(e){throw this.log.error("Error loading resources/prompts/tools: "+e),e}if("string"==typeof e)switch(e){case"stdio":e=new p.StdioServerTransport;break;case"http":e=new u.StreamableHTTPServerTransport({sessionIdGenerator:()=>h.v4(),onsessioninitialized:e=>t.verbose("Session initialized: "+e),onsessionclosed:e=>t.verbose("Session closed: "+e),enableJsonResponse:!0,eventStore:void 0,allowedHosts:["*"],allowedOrigins:["*"],enableDnsRebindingProtection:!0});break;default:throw Error("Invalid transport type: "+e)}return this.client.connect(e)}}e.Builder=x,e.McpServer=pe,e.PACKAGE_NAME=le,e.PromptBuilder=N,e.ResourceBuilder=_,e.ToolBuilder=E,e.UsableBuilder=T,e.VERSION=de},"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("tslib"),require("@decaf-ts/decorator-validation"),require("@decaf-ts/logging"),require("@modelcontextprotocol/sdk/shared/uriTemplate"),require("@modelcontextprotocol/sdk/server/mcp"),require("styled-string-builder"),require("path"),require("fs"),require("zod"),require("ts-morph"),require("fs/promises"),require("@modelcontextprotocol/sdk/server/streamableHttp"),require("@modelcontextprotocol/sdk/server/stdio"),require("uuid"),require("@decaf-ts/decoration")):"function"==typeof define&&define.amd?define(["exports","tslib","@decaf-ts/decorator-validation","@decaf-ts/logging","@modelcontextprotocol/sdk/shared/uriTemplate","@modelcontextprotocol/sdk/server/mcp","styled-string-builder","path","fs","zod","ts-morph","fs/promises","@modelcontextprotocol/sdk/server/streamableHttp","@modelcontextprotocol/sdk/server/stdio","uuid","@decaf-ts/decoration"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self)["mcp-server"]={},e.tslib,e.decafTsDecoratorValidation,e.decafTsLogging,e.uriTemplate,e.mcp,e.styledStringBuilder,e.path,e.fs,e.zod,e.tsMorph,e.fsPromises,e.streamableHttp,e.stdio,e.uuid,e.decafTsDecoration);
|
|
2
2
|
//# sourceMappingURL=mcp-server.cjs.map
|
package/dist/mcp-server.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mcp-server.cjs","sources":["../src/constants.ts","../src/builders/builder.ts","../src/builders/prompt-builder.ts","../src/builders/resource-builder.ts","../src/builders/tool-builder.ts","../src/utils/banner.ts","../src/tools/ast/utils.ts","../src/tools/ast/ts-ast-tool.ts","../src/tools/example-tool/index.ts","../src/tools/ast-jsdoc-tools/index.ts","../src/tools/index.ts","../src/tools/file-summarizer/index.ts","../src/prompts/jsdocs/constants.ts","../src/prompts/jsdocs/class-prompt.ts","../src/prompts/jsdocs/const-prompt.ts","../src/prompts/jsdocs/decorator-prompt.ts","../src/prompts/jsdocs/enum-prompt.ts","../src/prompts/jsdocs/function-prompt.ts","../src/prompts/jsdocs/interface-prompt.ts","../src/prompts/jsdocs/types-prompt.ts","../src/prompts/code/design-patterns/builder.ts","../src/prompts/example-prompt/index.ts","../src/prompts/interactive-jsdoc/index.ts","../src/prompts/index.ts","../src/resources/index.ts","../src/resources/example-resource/index.ts","../src/resources/repo-metadata/index.ts","../src/version.ts","../src/environment.ts","../src/mcp-server.ts"],"sourcesContent":[null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null],"names":["ReasoningLevel","EffortLevel","Cost","Builder","Model","constructor","arg","super","fromObject","this","log","extra","sessionId","requestId","authInfo","length","Logging","for","clientId","toString","setDescription","value","description","setName","name","setTitle","title","__decorate","required","prototype","UsableBuilder","reasoning","NONE","effort","cost","FREE","setReasoning","setEffort","setCost","PromptBuilder","setCb","cb","setArgsSchema","argsSchema","builder","build","server","errs","hasErrors","Error","registerPrompt","async","args","verbose","JSON","stringify","_meta","Object","assign","usage","result","Promise","resolve","debug","e","error","ResourceBuilder","setConfig","config","setUriOtTemplate","uriOrTemplate","uriOrTemplateArg","includes","ResourceTemplate","UriTemplate","list","undefined","metadata","readCb","uri","resource","ToolBuilder","setAnnotations","annotations","setInputSchema","inputSchema","setOutputSchema","outputSchema","readOnlyHint","destructiveHint","idempotentHint","openWorldHint","registerTool","type","colors","_project","analyzeFile","filePath","project","Project","tsConfigFilePath","skipAddingFilesFromTsConfig","source","addSourceFileAtPathIfExists","createSourceFile","overwrite","race","resolveSourceFileDependencies","res","setTimeout","err","exported","getExportedDeclarations","astObjects","Array","from","entries","flatMap","decls","map","d","start","getStartLineNumber","end","getEndLineNumber","kind","getKindName","String","toLowerCase","startColumn","getStartLinePos","id","location","startLine","endLine","endColumn","isExported","toolName","toolTitle","z","object","string","describe","zod","TsAstTool","content","text","structuredContent","objects","o","signature","parentId","children","decorators","contextHints","ExampleTool","_extra","reversed","split","reverse","join","AstJsdocTool","_args","BASIC","LOW","Tools","path","catch","names","slice","summary","count","BaseJSDocPrompt","TypesPrompt","ConstantsPrompt","Footer","TsDocClassPrompt","messages","role","TsDocConstPrompt","TsDocDecoratorPrompt","TsDocEnumPrompt","TsDocFunctionPrompt","TsDocInterfacePrompt","TsDocTypeePrompt","className","TsCodeDesignPatterBuilderPrompt","toPascalCase","optional","ExamplePrompt","code","astObject","any","Prompts","Resources","_uri","file","pathname","replace","p","process","cwd","raw","readFile","encoding","parsed","parse","data","VERSION","PACKAGE_NAME","Metadata","registerLibrary","DefaultMcpEnvironment","mcpId","version","websiteUrl","repositoryUrl","license","contacts","url","tags","icons","src","mimeType","sizes","Environment","LoggedEnvironment","accumulate","McpServer","LoggedClass","client","_mcp","load","loadedResourced","all","r","loadedPrompts","loadedTools","toolsModule","toLoad","values","filter","v","c","loadedExported","t","boot","transportType","info","logger","get","message","nodeModulesDir","current","__dirname","root","candidate","fs","existsSync","statSync","isDirectory","parent","dirname","slogans","scopeDir","pkgs","readdirSync","pkg","depPath","slogansPath","isFile","readFileSync","isArray","s","trim","push","Math","floor","random","getSlogan","banner","maxLength","reduce","max","line","padStart","forEach","index","color","logFn","bind","console","style","printBanner","normalizedIcons","i","contactsRaw","normalizedContacts","email","numericKeys","keys","k","test","sort","a","b","Number","len","serverInfo","MCP","instructions","capabilities","logging","completions","resources","tools","prompts","StdioServerTransport","StreamableHTTPServerTransport","sessionIdGenerator","v4","onsessioninitialized","onsessionclosed","enableJsonResponse","eventStore","allowedHosts","allowedOrigins","enableDnsRebindingProtection","connect"],"mappings":"sJAAYA,EAOAC,EAOAC,gBAdZ,CAAYF,IACVA,EAAAA,EAAA,KAAA,GAAA,OACAA,EAAAA,EAAA,MAAA,GAAA,QACAA,EAAAA,EAAA,SAAA,GAAA,WACAA,EAAAA,EAAA,KAAA,GAAA,MACD,EALD,CAAYA,IAAAA,EAKX,CAAA,IAED,CAAYC,IACVA,EAAAA,EAAA,KAAA,GAAA,OACAA,EAAAA,EAAA,IAAA,GAAA,MACAA,EAAAA,EAAA,OAAA,GAAA,SACAA,EAAAA,EAAA,KAAA,GAAA,MACD,EALD,CAAYA,IAAAA,EAKX,CAAA,IAED,CAAYC,IACVA,EAAAA,EAAA,KAAA,GAAA,OACAA,EAAAA,EAAA,IAAA,GAAA,MACAA,EAAAA,EAAA,OAAA,GAAA,SACAA,EAAAA,EAAA,KAAA,GAAA,MACD,EALD,CAAYA,IAAAA,EAKX,CAAA,ICTK,MAAgBC,UAAqBC,EAAAA,MAQzC,WAAAC,CAAsBC,GACpBC,MAAMD,GACNF,EAAAA,MAAMI,WAAWC,KAAMH,EACxB,CAES,GAAAI,CAAIC,GACZ,MAAMC,UAAEA,EAASC,UAAEA,EAASC,SAAEA,GAAaH,GAAS,CAAA,EAGpD,IAAID,EAA2B,iBAAdE,GAA0BA,EAAUG,OAAS,EAAIC,EAAOA,QAACC,IAAIL,GAAWK,IAAIR,MAAeO,EAAAA,QAAQC,IAA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AGH,MAAMwO,EAA6B,CACjCjL,GAAI8F,GAAYZ,MAChB7L,KAAMyM,GAAYzM,KAClBE,MAAOuM,GAAYvM,MACnBJ,YAAa2M,GAAY3M,YACzBiM,WAAYU,GAAYV,WACxBC,cAAeS,GAAYT,cAC3BF,QAASW,GAAYX,QACrBG,QAASQ,GAAYR,QACrBC,SAAU+E,EACV7E,KAAMK,GAAYL,KAAOK,GAAYL,KAAK9D,MAAM,UAAOlF,EACvDC,SAAUoJ,GAAYpJ,SACtBgJ,MAAOyE,GAqBT7R,KAAK8N,KAAO,IAAI8E,EAAGjF,UAACgF,EAlBW,CAC7BE,a7BlIsB,mU6BmItBC,aAAc,CACZC,QAAS,CAAE,EACXC,YAAa,CAAE,EACfC,UAAW,CAGV,EACDC,MAAO,CAEN,EACDC,QAAS,CAER,KAKL,UACQnT,KAAK+N,MACZ,CAAC,MAAO1H,GAEP,MADArG,KAAKC,IAAIuD,MAAM,0CAA0C6C,GACnDA,CACP,CACD,GAA6B,iBAAlByI,EACT,OAAQA,GACN,IAAK,QACHA,EAAgB,IAAIsE,EAAAA,qBACpB,MACF,IAAK,OACHtE,EAAgB,IAAIuE,EAAAA,8BAA8B,CAChDC,mBAAoB,IAAMC,EAAAA,KAC1BC,qBAAuBrT,GACrBF,EAAI2C,QAAQ,wBAAwBzC,GACtCsT,gBAAkBtT,GAChBF,EAAI2C,QAAQ,mBAAmBzC,GACjCuT,oBAAoB,EACpBC,gBAAYxP,EACZyP,aAAc,CAAC,KACfC,eAAgB,CAAC,KACjBC,8BAA8B,IAEhC,MACF,QACE,MAAUtR,MAAM,2BAA2BsM,GAGjD,OAAO9O,KAAK6N,OAAOkG,QAAQjF,EAC5B"}
|
|
1
|
+
{"version":3,"file":"mcp-server.cjs","sources":["../src/constants.ts","../src/builders/builder.ts","../src/builders/prompt-builder.ts","../src/builders/resource-builder.ts","../src/builders/tool-builder.ts","../src/utils/banner.ts","../src/tools/ast/utils.ts","../src/tools/ast/ts-ast-tool.ts","../src/tools/example-tool/index.ts","../src/tools/ast-jsdoc-tools/index.ts","../src/tools/index.ts","../src/tools/file-summarizer/index.ts","../src/prompts/jsdocs/constants.ts","../src/prompts/jsdocs/class-prompt.ts","../src/prompts/jsdocs/const-prompt.ts","../src/prompts/jsdocs/decorator-prompt.ts","../src/prompts/jsdocs/enum-prompt.ts","../src/prompts/jsdocs/function-prompt.ts","../src/prompts/jsdocs/interface-prompt.ts","../src/prompts/jsdocs/types-prompt.ts","../src/prompts/code/design-patterns/builder.ts","../src/prompts/example-prompt/index.ts","../src/prompts/interactive-jsdoc/index.ts","../src/prompts/index.ts","../src/resources/index.ts","../src/resources/example-resource/index.ts","../src/resources/repo-metadata/index.ts","../src/version.ts","../src/environment.ts","../src/mcp-server.ts"],"sourcesContent":[null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null],"names":["ReasoningLevel","EffortLevel","Cost","Builder","Model","constructor","arg","super","fromObject","this","log","extra","sessionId","requestId","authInfo","length","Logging","for","clientId","toString","setDescription","value","description","setName","name","setTitle","title","__decorate","required","prototype","UsableBuilder","reasoning","NONE","effort","cost","FREE","setReasoning","setEffort","setCost","PromptBuilder","setCb","cb","setArgsSchema","argsSchema","builder","build","server","errs","hasErrors","Error","registerPrompt","async","args","verbose","JSON","stringify","_meta","Object","assign","usage","result","Promise","resolve","debug","e","error","ResourceBuilder","setConfig","config","setUriOtTemplate","uriOrTemplate","uriOrTemplateArg","includes","ResourceTemplate","UriTemplate","list","undefined","metadata","readCb","uri","resource","ToolBuilder","setAnnotations","annotations","setInputSchema","inputSchema","setOutputSchema","outputSchema","readOnlyHint","destructiveHint","idempotentHint","openWorldHint","registerTool","type","colors","_project","analyzeFile","filePath","project","Project","tsConfigFilePath","skipAddingFilesFromTsConfig","source","addSourceFileAtPathIfExists","createSourceFile","overwrite","race","resolveSourceFileDependencies","res","setTimeout","err","exported","getExportedDeclarations","astObjects","Array","from","entries","flatMap","decls","map","d","start","getStartLineNumber","end","getEndLineNumber","kind","getKindName","String","toLowerCase","startColumn","getStartLinePos","id","location","startLine","endLine","endColumn","isExported","toolName","toolTitle","z","object","string","describe","zod","TsAstTool","content","text","structuredContent","objects","o","signature","parentId","children","decorators","contextHints","ExampleTool","_extra","reversed","split","reverse","join","AstJsdocTool","_args","BASIC","LOW","Tools","path","catch","names","slice","summary","count","BaseJSDocPrompt","TypesPrompt","ConstantsPrompt","Footer","TsDocClassPrompt","messages","role","TsDocConstPrompt","TsDocDecoratorPrompt","TsDocEnumPrompt","TsDocFunctionPrompt","TsDocInterfacePrompt","TsDocTypeePrompt","className","TsCodeDesignPatterBuilderPrompt","toPascalCase","optional","ExamplePrompt","code","astObject","any","Prompts","Resources","_uri","file","pathname","replace","p","process","cwd","raw","readFile","encoding","parsed","parse","data","VERSION","PACKAGE_NAME","Metadata","registerLibrary","DefaultMcpEnvironment","mcpId","version","websiteUrl","repositoryUrl","license","contacts","url","tags","icons","src","mimeType","sizes","Environment","LoggedEnvironment","accumulate","McpServer","LoggedClass","client","_mcp","load","loadedResourced","all","r","loadedPrompts","loadedTools","toolsModule","toLoad","values","filter","v","c","loadedExported","t","boot","transportType","info","logger","get","message","nodeModulesDir","current","__dirname","root","candidate","fs","existsSync","statSync","isDirectory","parent","dirname","slogans","scopeDir","pkgs","readdirSync","pkg","depPath","slogansPath","isFile","readFileSync","isArray","s","trim","push","Math","floor","random","getSlogan","banner","maxLength","reduce","max","line","padStart","forEach","index","color","logFn","bind","console","style","printBanner","normalizedIcons","i","contactsRaw","normalizedContacts","email","numericKeys","keys","k","test","sort","a","b","Number","len","serverInfo","MCP","instructions","capabilities","logging","completions","resources","tools","prompts","StdioServerTransport","StreamableHTTPServerTransport","sessionIdGenerator","v4","onsessioninitialized","onsessionclosed","enableJsonResponse","eventStore","allowedHosts","allowedOrigins","enableDnsRebindingProtection","connect"],"mappings":"oJAAYA,EAOAC,EAOAC,gBAdZ,CAAYF,IACVA,EAAAA,EAAA,KAAA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,CAAC,MAAO1H,GAEP,MADArG,KAAKC,IAAIuD,MAAM,0CAA0C6C,GACnDA,CACP,CACD,GAA6B,iBAAlByI,EACT,OAAQA,GACN,IAAK,QACHA,EAAgB,IAAIsE,EAAAA,qBACpB,MACF,IAAK,OACHtE,EAAgB,IAAIuE,EAAAA,8BAA8B,CAChDC,mBAAoB,IAAMC,EAAAA,KAC1BC,qBAAuBrT,GACrBF,EAAI2C,QAAQ,wBAAwBzC,GACtCsT,gBAAkBtT,GAChBF,EAAI2C,QAAQ,mBAAmBzC,GACjCuT,oBAAoB,EACpBC,gBAAYxP,EACZyP,aAAc,CAAC,KACfC,eAAgB,CAAC,KACjBC,8BAA8B,IAEhC,MACF,QACE,MAAUtR,MAAM,2BAA2BsM,GAGjD,OAAO9O,KAAK6N,OAAOkG,QAAQjF,EAC5B"}
|
package/dist/mcp-server.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{__decorate as e,__metadata as t}from"tslib";import{required as n,Model as r,type as o}from"@decaf-ts/decorator-validation";import{Logging as s,toPascalCase as i,LoggedEnvironment as a,LoggedClass as c}from"@decaf-ts/logging";import{UriTemplate as l}from"@modelcontextprotocol/sdk/shared/uriTemplate";import{ResourceTemplate as d}from"@modelcontextprotocol/sdk/server/mcp";import{McpServer as m}from"@modelcontextprotocol/sdk/server/mcp.js";import{style as p}from"styled-string-builder";import u,{resolve as h}from"path";import g from"fs";import{z as f}from"zod";import{Project as y}from"ts-morph";import{readFile as b}from"fs/promises";import{StreamableHTTPServerTransport as S}from"@modelcontextprotocol/sdk/server/streamableHttp";import{StdioServerTransport as v}from"@modelcontextprotocol/sdk/server/stdio";import{v4 as w}from"uuid";import{Metadata as x}from"@decaf-ts/decoration";var N,O,E;(e=>{e[e.NONE=0]="NONE",e[e.BASIC=1]="BASIC",e[e.ADVANCED=2]="ADVANCED",e[e.HIGH=3]="HIGH"})(N||(N={})),(e=>{e[e.NONE=0]="NONE",e[e.LOW=1]="LOW",e[e.MEDIUM=2]="MEDIUM",e[e.HIGH=3]="HIGH"})(O||(O={})),(e=>{e[e.FREE=0]="FREE",e[e.LOW=1]="LOW",e[e.MEDIUM=2]="MEDIUM",e[e.HIGH=3]="HIGH"})(E||(E={}));class T extends r{constructor(e){super(e),r.fromObject(this,e)}log(e){const{sessionId:t,requestId:n,authInfo:r}=e||{};let o="string"==typeof t&&t.length>0?s.for(t).for(this):s.for(this);return r&&r.clientId&&(o=o.for(r.clientId)),n&&(o=o.for(n.toString())),o}setDescription(e){return this.description=e,this}setName(e){return this.name=e,this}setTitle(e){return this.title=e,this}}e([n(),t("design:type",String)],T.prototype,"description",void 0),e([n(),t("design:type",String)],T.prototype,"name",void 0),e([n(),t("design:type",String)],T.prototype,"title",void 0);class D extends T{constructor(e){super(e),this.reasoning=N.NONE,this.effort=O.NONE,this.cost=E.FREE}setReasoning(e){return this.reasoning=e,this}setEffort(e){return this.effort=e,this}setCost(e){return this.cost=e,this}}e([n(),t("design:type",Number)],D.prototype,"reasoning",void 0),e([n(),t("design:type",Number)],D.prototype,"effort",void 0),e([n(),t("design:type",Number)],D.prototype,"cost",void 0);class j extends D{setCb(e){return this.cb=e,this}setArgsSchema(e){return this.argsSchema=e,this}constructor(e){super(e)}static get builder(){return new j}build(e){const t=this.hasErrors();if(t)throw Error(t.toString());try{return e.registerPrompt(this.name,{title:this.title,description:this.description,argsSchema:this.argsSchema},async(e,t)=>{const n=this.log(t);e=e||{},n.verbose(`Executing prompt ${this.name} with args: ${JSON.stringify(e)}`),e._meta=Object.assign(e._meta||{},{usage:{reasoning:this.reasoning,effort:this.effort,cost:this.cost}});const r=await Promise.resolve(this.cb(e,t));return n.verbose(`Prompt ${this.name} executed successfully.`),n.debug("Prompt execution meta: "+JSON.stringify(r._meta)),r})}catch(e){throw s.for(this).error("Failed to register prompt "+this.name,e),e}}}e([n(),t("design:type",Object)],j.prototype,"cb",void 0),e([n(),t("design:type",Object)],j.prototype,"argsSchema",void 0);class A extends T{setCb(e){return this.cb=e,this}setConfig(e){return this.config=e,this}setUriOtTemplate(e){return this.uriOrTemplate=e,this}constructor(e){super(e)}static get builder(){return new A}build(e){const t=this.hasErrors();if(t)throw Error(t.toString());try{const t="string"==typeof this.uriOrTemplate&&this.uriOrTemplate.includes("{")?new d(new l(this.uriOrTemplate),{list:void 0}):this.uriOrTemplate,n=Object.assign(this.config,{_meta:{}}),r=async(e,t)=>{const n=this.log(t);n.verbose(`Requesting resource ${this.name} from ${e.toString()}`);const r=await Promise.resolve(this.cb(e,t));return n.verbose(`Resource ${this.name} retrieved successfully.`),n.debug("Resource retrieval meta: "+JSON.stringify(r._meta)),r};return e.resource(this.name,t,n,r)}catch(e){throw s.for(this).error("Error registering resource "+this.name,e),e}}}e([n(),t("design:type",String)],A.prototype,"uriOrTemplate",void 0),e([n(),t("design:type",Function)],A.prototype,"cb",void 0),e([n(),t("design:type",Object)],A.prototype,"config",void 0);class C extends D{setAnnotations(e){return this.annotations=Object.assign(this.annotations,e),this}setCb(e){return this.cb=e,this}setInputSchema(e){return this.inputSchema=e,this}setOutputSchema(e){return this.outputSchema=e,this}constructor(e){super(e),this.annotations={readOnlyHint:!0,destructiveHint:!1,idempotentHint:!0,openWorldHint:!1}}static get builder(){return new C}build(e){const t=this.hasErrors();if(t)throw Error(t.toString());try{return e.registerTool(this.name,{title:this.title,description:this.description,inputSchema:this.inputSchema,outputSchema:this.outputSchema,annotations:this.annotations,_meta:{usage:{reasoning:this.reasoning,effort:this.effort,cost:this.cost}}},async(e,t)=>{const n=this.log(t);n.verbose(`Executing tool ${this.name} with args: ${JSON.stringify(e)}`),t._meta=Object.assign(t._meta||{},{usage:{reasoning:this.reasoning,effort:this.effort,cost:this.cost}});const r=await Promise.resolve(this.cb(e,t));return n.verbose(`Tool ${this.name} executed successfully.`),n.debug("Tool execution meta: "+JSON.stringify(r._meta)),r})}catch(e){throw s.for(this).error("Error building tool",e),e}}}e([n(),t("design:type",Object)],C.prototype,"annotations",void 0),e([n(),t("design:type",Object)],C.prototype,"cb",void 0),e([o(Object.name),n(),t("design:type",Object)],C.prototype,"inputSchema",void 0),e([o(Object.name),t("design:type",Object)],C.prototype,"outputSchema",void 0);const I=["\x1b[38;5;215m","\x1b[38;5;209m","\x1b[38;5;205m","\x1b[38;5;210m","\x1b[38;5;217m","\x1b[38;5;216m","\x1b[38;5;224m","\x1b[38;5;230m","\x1b[38;5;230m"];let $=null;async function P(e){const t=$||($=new y({tsConfigFilePath:void 0,skipAddingFilesFromTsConfig:!0}),$),n=t.addSourceFileAtPathIfExists(e)||t.createSourceFile(e,void 0,{overwrite:!1});try{await Promise.race([t.resolveSourceFileDependencies(),new Promise(e=>setTimeout(e,2e3))])}catch(e){}const r=n.getExportedDeclarations();return{astObjects:Array.from(r.entries()).flatMap(([t,n])=>n.map(n=>{const r="function"==typeof n.getStartLineNumber?n.getStartLineNumber():0,o="function"==typeof n.getEndLineNumber?n.getEndLineNumber():0,s="function"==typeof n.getKindName?(n.getKindName()+"").toLowerCase():"unknown",i="function"==typeof n.getStartLinePos?n.getStartLinePos():0;return{id:`${e}::${t}`,name:t,kind:s,location:{filePath:e,startLine:r,startColumn:i,endLine:o,endColumn:0},isExported:!0}}))}}const k="ts.ast.extract",R="AST Extraction Tool for TypeScript",J=f.object({filePath:f.string().describe("The path to the TypeScript file to analyze.")}).describe(`the input schema for the ${k} tool`);f.object({}).describe(`the output schema for the ${k} tool`);const _=C.builder.setName(k).setTitle(R).setDescription("Extracts and analyzes the Abstract Syntax Tree (AST) of TypeScript code to provide insights into its structure and components.").setInputSchema(J).setAnnotations({title:R,readOnlyHint:!0,destructiveHint:!1,idempotentHint:!0,openWorldHint:!1}).setCb(async(e,t)=>{const{filePath:n}=e,r=await Promise.race([P(n),new Promise(e=>setTimeout(()=>e(null),1500))]);if(!r||!r.astObjects)return{content:[{type:"text",text:"No AST objects or analysis timed out"}],structuredContent:{astObjects:[]}};const o=r.astObjects.map(e=>({id:e.id,name:e.name,kind:e.kind||"unknown",location:e.location,isExported:!!e.isExported,signature:e.signature,parentId:e.parentId,children:e.children,decorators:e.decorators,contextHints:e.contextHints||[]}));return{content:[{type:"text",text:`Found ${o.length} AST objects`}],structuredContent:{astObjects:o}}}),F=C.builder.setName("example-tool").setTitle("Example: Reverse String Tool").setDescription("Reverses the provided `text` input and returns the result.").setInputSchema(f.object({text:f.string()})).setCb(async(e,t)=>{const n=((e?.text??"")+"").split("").reverse().join("");return{content:[{type:"text",text:n}],structuredContent:{result:n}}}).setReasoning(N.NONE).setEffort(O.NONE).setCost(E.FREE),M=C.builder.setName("ast.jsdoc").setTitle("AST \u2192 JSDoc Tool").setDescription("Generate suggested JSDoc comments for TypeScript AST objects (MVP stub).").setInputSchema(f.object({filePath:f.string()})).setCb(async(e,t)=>{const n=[{type:"text",text:"Not implemented (stub)"}];return{content:n,structuredContent:{content:n}}}).setReasoning(N.BASIC).setEffort(O.LOW).setCost(E.FREE),H=[_,F,C.builder.setName("file.summarizer").setTitle("File Summarizer").setDescription("Produce a short structured summary for a TypeScript file.").setInputSchema(f.object({filePath:f.string()})).setCb(async(e,t)=>{if(!(e?.filePath??e?.path))return{content:[{type:"text",text:""}]};const n=await(async()=>({astObjects:[]}))().catch(()=>null),r=n&&n.astObjects||[],o=r.map(e=>e.name||e.id||e.kind).slice(0,20),s=`Found ${r.length} AST objects. Top names: ${o.join(", ")}`;return{content:[{type:"text",text:s}],structuredContent:{summary:s},_meta:{count:r.length}}}).setReasoning(N.NONE).setEffort(O.NONE).setCost(E.FREE),M];var L=Object.freeze({__proto__:null,Tools:H});const B="You're a senior TypeScript developer writing JSDoc documentation for a class to be used with better-docs. Given the module code:\nGenerate a JSDoc comment block for a TypeScript module file using better-docs formatting:",G="document the target code, always including the @description tag with a short description of the target, and a@summary tag with a more detailed one.\n Include @interface and @typeDef an @template tags when appropriate.\n Include detailed @description for all properties.\n For methods, include @description and @summary tags as defined for the target. also document every argument, including its type definition, and return type, referencing @template tags when necessary.\n\n The order of tags (when applicable) should be as follows:\n1 - @description;\n2 - @summary;\n3 - @template;\n4 - @param;\n5 - @return;\n6 - @interface or @typeDef followed by the interface or type name;\n8 - @memberOf referencing the appropriate module using the appropriate syntax\n\nOutput only the completed JSDoc comment block for the type or interface.\nrefer to the module it belongs with @memberOf this the `@memberOf module:<module_name>` syntax\nnever omit or change any code\nif the element is already documented, only restructure, correct, or add to the documentation. NEVER remove existing information",z="document the target code, always including the @description tag with a short description of the target, and a@summary tag with a more detailed one.\nInclude @const and @typeDef tags when appropriate.\nInclude detailed @description for all properties.\n- For enums, include @enum and @readonly, and add inline documentation for each member\n- For object-like constants:\n - Create a @typedef with @property for each key\n - Reference it in the constant using @type\n - Alternatively, document each key inline if small\n\nThe order of tags (when applicable) should be as follows:\n1 - @description;\n2 - @summary;\n3 - @template;\n4 - @property;\n6 - @const followed by the const or enum name;\n8 - @memberOf referencing the appropriate module using the appropriate syntax\n\nRespond with the JSDoc comment block(s) for both the typedef and the constant or enum.\nrefer to the module it belongs with @memberOf this the `@memberOf module:<module_name>` syntax\nnever omit or change any code\nif the element is already documented, only restructure, correct, or add to the documentation. NEVER remove existing information",U="NOTES:\n - when document a function/method parameters, and there is a template type involved, ALWAYS reference it using the @template tag;\n - when documenting a function type as a parameter, ALWAYS use the function(type1,type2):return_type syntax;\n ",q=f.object({}),V=j.builder.setName("ts.jsdoc.class").setTitle("Class JSDocs Prompt").setDescription("Generate JSDoc comments for a TypeScript class according to a curated template and prompt.").setArgsSchema(q).setReasoning(N.BASIC).setCb((e,t)=>({messages:[{role:"user",content:{type:"text",text:`${B}\ndocument the entire class and each of its functions including always including the @description tag with a short description of the target, and a@summary tag with a more detailed one.\nInclude @class tags when applicable.\ninclude @param tags in the class documentation and its type definitions\nInclude detailed @description for all properties.\nInclude @template tags when necessary.\nDo NOT document the constructor, but include the constructor arguments as @param in the class documentation\nFor methods and functions:\n- include @description and @summary tags as defined for the target. also document every argument, including its type definition, and return type, referencing @template tags when necessary.\n- create a usage example under the @example tag on the class documentation\n- create mermaid sequence diagrams under the @mermaid tag;\n\nThe order of tags (when applicable) should be as follows:\n1 - @description;\n2 - @summary;\n3 - @template;\n4 - @param;\n5 - @return;\n6 - @class\n7 - @example\n8 - @mermaid;\n\nignore @mermaid for methods with less that 15 lines and constructors.\nRespond only with the full JSDoc comment block for the class and its methods.\nNEVER user @memberOf in the class or any of it's methods\nif the element is already documented, only restructure, correct, or add to the documentation. NEVER remove existing information\nnever omit or change any code, including the constructor\n${U}`}}],_meta:{}})),W=f.object({}),K=j.builder.setName("ts.jsdoc.const").setTitle("Const JSDocs Prompt").setDescription("Generate JSDoc comments for a TypeScript constant according to a curated template and prompt.").setArgsSchema(W).setCb((e,t)=>({messages:[{role:"user",content:{type:"text",text:`${B}\n${z}\n${U}`}}]})),Y=f.object({}),Q=j.builder.setName("ts.jsdoc.decorator").setTitle("Decorator JSDocs Prompt").setDescription("Generate JSDoc comments for a TypeScript Decorator according to a curated template and prompt.").setArgsSchema(Y).setCb((e,t)=>({messages:[{role:"user",content:{type:"text",text:`${B}\ndocument the target code, always including the @description tag with a short description of the target, and a@summary tag with a more detailed one.\nInclude @function an @template tags when appropriate.\nInclude detailed @description for all properties.\nFor methods, include @description and @summary tags as defined for the target. also document every argument, including its type definition, and return type, referencing @template tags when necessary.\ncreate mermaid sequence diagrams under the @mermaid tag;\n\nThe order of tags (when applicable) should be as follows:\n1 - @description;\n2 - @summary;\n3 - @template;\n4 - @param including type definitions;\n5 - @return;\n6 - @function followed by the interface or type name;\n7 - @mermaid with the sequence diagram for the function if it has over 10 lines\n8 - @category one of: "Decorators", "Class Decorators", "Method Decorators", "Property Decorators", "Parameter Decorators"\nOutput only the full JSDoc comment block for the function.\nDO NOT refer to the module it belongs with @memberOf\nnever omit or change any code\nif the element is already documented, only restructure, correct, or add to the documentation. NEVER remove existing information\n${U}`}}]})),X=f.object({}),Z=j.builder.setName("ts.jsdoc.enum").setTitle("Enum JSDocs Prompt").setDescription("Generate JSDoc comments for a TypeScript enum according to a curated template and prompt.").setArgsSchema(X).setCb((e,t)=>({messages:[{role:"user",content:{type:"text",text:`${B}\n${z}\n${U}`}}]})),ee=f.object({}),te=j.builder.setName("ts.jsdoc.function").setTitle("Function JSDocs Prompt").setDescription("Generate JSDoc comments for a TypeScript function according to a curated template and prompt.").setArgsSchema(ee).setCb((e,t)=>({messages:[{role:"user",content:{type:"text",text:`${B}\ndocument the target code, always including the @description tag with a short description of the target, and a@summary tag with a more detailed one.\nInclude @function an @template tags when appropriate.\nInclude detailed @description for all properties.\nFor methods, include @description and @summary tags as defined for the target. also document every argument, including its type definition, and return type, referencing @template tags when necessary.\ncreate mermaid sequence diagrams under the @mermaid tag;\n\nThe order of tags (when applicable) should be as follows:\n1 - @description;\n2 - @summary;\n3 - @template;\n4 - @param including type definitions;\n5 - @return;\n6 - @function followed by the interface or type name;\n7 - @mermaid with the sequence diagram for the function if ithas over 10 lines\n8 - @memberOf referencing the appropriate module using the appropriate syntax\n\nOutput only the full JSDoc comment block for the function.\nrefer to the module it belongs with @memberOf this the \`@memberOf module:<module_name>\` syntax\nnever omit or change any code\nif the element is already documented, only restructure, correct, or add to the documentation. NEVER remove existing information\n${U}`}}]})),ne=f.object({}),re=j.builder.setName("ts.jsdoc.interface").setTitle("Interface JSDocs Prompt").setDescription("Generate JSDoc comments for a TypeScript interface according to a curated template and prompt.").setArgsSchema(ne).setCb((e,t)=>({messages:[{role:"user",content:{type:"text",text:`${B}\n${G}\n${U}`}}]})),oe=f.object({}),se=j.builder.setName("ts.jsdoc.type").setTitle("Type JSDocs Prompt").setDescription("Generate JSDoc comments for a TypeScript type according to a curated template and prompt.").setArgsSchema(oe).setCb((e,t)=>({messages:[{role:"user",content:{type:"text",text:`${B}\n${G}\n${U}`}}]})),ie=f.object({className:f.string().describe("the class name to turn into a builder")}),ae=j.builder.setName("ts.code.dp.builder").setTitle("Typescript builder design patter prompt").setDescription("for a class, with a defined set of properties, scafold a builder design pattern").setArgsSchema(ie).setReasoning(N.BASIC).setCb((e,t)=>(e.className=i(e.className),{messages:[{role:"user",content:{type:"text",text:`You're a senior TypeScript developer writing typescript code.You're a senior TypeScript developer writing typescript code.\nTransform the selected class into a builder design pattern implementation in Typescript.\nuse @decaf-ts validation decorators to enforce the validation of your builder.\n\n- must extend the Model Class from @decaf-ts/decorator-validation;\n- each property must be marked as protected;\n- each property must have a setter method that returns 'this' for chaining;\n- the build() method must validate the properties using hasErrors() method from Model class;\n- if validation fails, throw an error with the validation errors;\n- if validation passes, return an instance of the original class with the set properties;\n- optionally (but do so by default) add the static builder and from methods from the example;\n- if the clasee already follows the pattern but has properties without decoration or without setters, simple add them;\n\nexample:\n\noriginal class:\n\`\`\`typescript\nexport class ${e.className} {\n description!: string;\n name!: string = "default name";\n title!: string;\n age?: string;\n dateOfBirth!: Date;\n}}\n\`\`\` \n\nresulting builder pattern implementation:\n\`\`\`typescript\nexport class ${e.className}Builder extends Model {\n\n @minlength(10\n @required()\n protected description!: string;\n \n @required()\n protected name!: string = "default value;\n \n @required()\n protected title!: string;\n \n @min(18)\n protected age?: string;\n \n @date()\n protected dateOfBirth!: Date;\n\n protected constructor(arg?: ModelArg<${e.className}Builder>>) {\n super(arg);\n Model.fromModel(this, arg);\n }\n\n setDescription(value: string) {\n this.description = value;\n return this;\n }\n\n setName(value: string) {\n this.name = value;\n return this;\n }\n\n setTitle(value: string) {\n this.title = value;\n return this;\n }\n setAge(value: number) {\n this.age = value;\n return this;\n }\n setDate(value: Date) {\n this.age = value;\n return this;\n }\n \n build(...args: any[]): ${e.className}Builder | Promise<${e.className}Builder> {\n const errs = this.hasErrors();\n if (errs) throw new Error(errs.toString());\n \n return // code that builds OBJ here\n }\n \n static get builder(): ${e.className}Builder {\n return new ${e.className}Builder(); // static method to get a new builder instance\n }\n \n static from<K extends keyof ${e.className}Builder>(obj: K, ${e.className}Builder[K]): ${e.className}Builder {\n return new ${e.className}Builder(); // static method to create a builder from an object\n }\n}\n\`\`\` \n\n`}}],_meta:{}})),ce=f.object({text:f.string().optional()}),le=j.builder.setName("example.prompt.echo").setTitle("Example: Echo Prompt").setDescription("Returns a short prompt containing the provided `text` as a user message.").setArgsSchema(ce).setReasoning(N.BASIC).setCb((e,t)=>({messages:[{role:"user",content:{type:"text",text:e?.text??"(no text provided)"}}],_meta:{}})),de=f.object({code:f.string().optional(),astObject:f.any().optional()}),me=[V,K,Q,Z,te,re,se,ae,le,j.builder.setName("interactive.jsdoc.assistant").setTitle("Interactive JSDoc Assistant").setDescription("Produce a ready-to-insert JSDoc block for a provided code snippet or AST object.").setArgsSchema(de).setReasoning(N.BASIC).setCb((e,t)=>({messages:[{role:"user",content:{type:"text",text:"Generate a complete JSDoc comment block for the following code. Respond only with the full JSDoc block.\n\n"+(e?.code??"")}}],_meta:{}}))],pe=[A.builder.setName("example.resource.hello").setTitle("Example: Hello Resource").setDescription("A tiny example resource that returns a simple payload for any URI.").setUriOtTemplate("example://hello/{name}").setConfig({description:"Example resource",_meta:{usage:{reasoning:N.NONE,effort:O.NONE,cost:E.FREE}}}).setCb(async(e,t)=>({content:{type:"text",text:"hello from example resource"},_meta:{}})),A.builder.setName("repo.metadata").setTitle("Repository Metadata Resource").setDescription("Expose basic repository metadata such as package.json and lint rules.").setUriOtTemplate("repo://metadata/{file}").setConfig({description:"Repository metadata resource",_meta:{usage:{reasoning:N.NONE,effort:O.NONE,cost:E.FREE}}}).setCb(async(e,t)=>{const n=e.pathname.replace(/^\//,"")||"package.json";try{const e=h(process.cwd(),n),t=await b(e,{encoding:"utf8"}),r=JSON.parse(t);return{content:{type:"json",data:JSON.stringify(r)},_meta:{}}}catch(e){return{content:{type:"text",text:""},_meta:{}}}})],ue="##VERSION##",he="##PACKAGE##";x.registerLibrary(he,ue);const ge={mcpId:he,name:"Official Decaf-TS MCP Server",title:"Official Decaf-TS MCP Server",description:"Provides precise coding assistance for the decaf-ts framework",version:ue,websiteUrl:"https://decaf-ts.github.io",repositoryUrl:"https://github.com/decaf-ts",license:"AGPL-3.0",contacts:[{name:"Decaf-TS",url:"https://decaf-ts.github.io"}],tags:"server,official,decaf-ts",metadata:{},icons:[{src:"workdocs/assets/favicon.svg",mimeType:"image/svg+xml",sizes:"any"}]},fe=a.accumulate(ge);class ye extends c{get client(){if(!this._mcp)throw Error("Mcp server requires Mcp client");return this._mcp}constructor(){super()}async load(){try{const e=await Promise.all(pe.map(e=>e.build(this.client)));this.log.verbose(`Loaded ${e.length} resources`);const t=await Promise.all(me.map(e=>e.build(this.client)));this.log.verbose(`Loaded ${t.length} prompts`);const n=await Promise.all(H.map(e=>e.build(this.client)));this.log.verbose(`Loaded ${n.length} tools`);try{const e=await Promise.resolve().then(()=>L),t=Object.values(e).filter(e=>e&&"function"==typeof e.build).filter(e=>!H.includes(e));if(t.length>0){const e=await Promise.all(t.map(e=>e.build(this.client)));this.log.verbose(`Loaded ${e.length} exported builders from tools module`)}}catch(e){this.log.verbose("No additional exported builders loaded from tools module: "+e)}}catch(e){throw this.log.error("Error loading core MCP components",e),e}}async boot(e="stdio"){const t=this.log;this.log.for(this.boot).info("McpServer booting..."),((e=s.get())=>{let t;try{t=(()=>{let e,t=__dirname;try{for(;t&&t!==u.parse(t).root;){const n=u.join(t,"node_modules");if(g.existsSync(n)&&g.statSync(n).isDirectory()){e=n;break}const r=u.dirname(t);if(r===t)break;t=r}}catch{}const n=[];if(e){const t=u.join(e,"@decaf-ts");try{if(g.existsSync(t)&&g.statSync(t).isDirectory()){const e=g.readdirSync(t);for(const r of e){const e=u.join(t,r);try{const t=u.join(e,"workdocs","assets","slogans.json");if(g.existsSync(t)&&g.statSync(t).isFile()){const e=g.readFileSync(t,"utf-8"),r=JSON.parse(e);if(Array.isArray(r))for(const e of r)"string"==typeof e&&e.trim().length>0&&n.push(e.trim())}}catch{}}}}catch{}}return 0===n.length?"Decaf: strongly brewed TypeScript.":n[Math.floor(Math.random()*n.length)]})()}catch{t="Decaf: strongly brewed TypeScript."}const n="# \u2591\u2592\u2593\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2593\u2592\u2591 \u2591\u2592\u2593\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2593\u2592\u2591 \u2591\u2592\u2593\u2588\u2588\u2588\u2588\u2588\u2588\u2593\u2592\u2591 \u2591\u2592\u2593\u2588\u2588\u2588\u2588\u2588\u2588\u2593\u2592\u2591 \u2591\u2592\u2593\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2593\u2592\u2591 \u2591\u2592\u2593\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2593\u2592\u2591 \u2591\u2592\u2593\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2593\u2592\u2591 \n# ( ( \u2591\u2592\u2593\u2588\u2593\u2592\u2591\u2591\u2592\u2593\u2588\u2593\u2592\u2591 \u2591\u2592\u2593\u2588\u2593\u2592\u2591 \u2591\u2592\u2593\u2588\u2593\u2592\u2591\u2591\u2592\u2593\u2588\u2593\u2592\u2591 \u2591\u2592\u2593\u2588\u2593\u2592\u2591\u2591\u2592\u2593\u2588\u2593\u2592\u2591 \u2591\u2592\u2593\u2588\u2593\u2592\u2591 \u2591\u2592\u2593\u2588\u2593\u2592\u2591 \u2591\u2592\u2593\u2588\u2593\u2592\u2591 \n# ) ) \u2591\u2592\u2593\u2588\u2593\u2592\u2591\u2591\u2592\u2593\u2588\u2593\u2592\u2591 \u2591\u2592\u2593\u2588\u2593\u2592\u2591 \u2591\u2592\u2593\u2588\u2593\u2592\u2591 \u2591\u2592\u2593\u2588\u2593\u2592\u2591\u2591\u2592\u2593\u2588\u2593\u2592\u2591 \u2591\u2592\u2593\u2588\u2593\u2592\u2591 \u2591\u2592\u2593\u2588\u2593\u2592\u2591 \u2591\u2592\u2593\u2588\u2593\u2592\u2591 \n# [=======] \u2591\u2592\u2593\u2588\u2593\u2592\u2591\u2591\u2592\u2593\u2588\u2593\u2592\u2591 \u2591\u2592\u2593\u2588\u2588\u2588\u2588\u2588\u2588\u2593\u2592\u2591 \u2591\u2592\u2593\u2588\u2593\u2592\u2591 \u2591\u2592\u2593\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2593\u2592\u2591 \u2591\u2592\u2593\u2588\u2588\u2588\u2588\u2588\u2588\u2593\u2592\u2591 \u2591\u2592\u2593\u2588\u2593\u2592\u2591 \u2591\u2592\u2593\u2588\u2588\u2588\u2588\u2588\u2588\u2593\u2592\u2591 \n# `-----\xb4 \u2591\u2592\u2593\u2588\u2593\u2592\u2591\u2591\u2592\u2593\u2588\u2593\u2592\u2591 \u2591\u2592\u2593\u2588\u2593\u2592\u2591 \u2591\u2592\u2593\u2588\u2593\u2592\u2591 \u2591\u2592\u2593\u2588\u2593\u2592\u2591\u2591\u2592\u2593\u2588\u2593\u2592\u2591 \u2591\u2592\u2593\u2588\u2593\u2592\u2591 \u2591\u2592\u2593\u2588\u2593\u2592\u2591 \u2591\u2592\u2593\u2588\u2593\u2592\u2591 \n# \u2591\u2592\u2593\u2588\u2593\u2592\u2591\u2591\u2592\u2593\u2588\u2593\u2592\u2591 \u2591\u2592\u2593\u2588\u2593\u2592\u2591 \u2591\u2592\u2593\u2588\u2593\u2592\u2591\u2591\u2592\u2593\u2588\u2593\u2592\u2591 \u2591\u2592\u2593\u2588\u2593\u2592\u2591\u2591\u2592\u2593\u2588\u2593\u2592\u2591 \u2591\u2592\u2593\u2588\u2593\u2592\u2591 \u2591\u2592\u2593\u2588\u2593\u2592\u2591 \u2591\u2592\u2593\u2588\u2593\u2592\u2591 \n# \u2591\u2592\u2593\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2593\u2592\u2591 \u2591\u2592\u2593\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2593\u2592\u2591 \u2591\u2592\u2593\u2588\u2588\u2588\u2588\u2588\u2588\u2593\u2592\u2591 \u2591\u2592\u2593\u2588\u2593\u2592\u2591\u2591\u2592\u2593\u2588\u2593\u2592\u2591 \u2591\u2592\u2593\u2588\u2593\u2592\u2591 \u2591\u2592\u2593\u2588\u2593\u2592\u2591 \u2591\u2592\u2593\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2593\u2592\u2591 \n#".split("\n"),r=n.reduce((e,t)=>Math.max(e,t.length),0);n.push("# "+t.padStart(r-3)),n.forEach((t,n)=>{const r=I[n%I.length]||"",o=e?e.info.bind(e):(()=>{}).bind();try{o(p(t||"").raw(r).text)}catch{o((t||"")+"")}})})(this.log);const n=((Array.isArray(fe.icons)?fe.icons:[fe.icons])||[]).map(e=>{const t="string"==typeof e?.src?e.src:(e?.src??"")+"",n="string"==typeof e?.mimeType?e.mimeType:(e?.mimeType??"")+"";let r=[];return Array.isArray(e?.sizes)?r=e.sizes.map(e=>e+""):"string"==typeof e?.sizes&&(r=(e.sizes+"").split(",").map(e=>e.trim())),{src:t,mimeType:n,sizes:r}}),r=fe.contacts;let o;if(null!=r)if(Array.isArray(r))o=r.map(e=>({name:"string"==typeof e?.name?e.name:(e?.name??"")+"",email:"string"==typeof e?.email?e.email:e?.email?e.email+"":void 0,url:"string"==typeof e?.url?e.url:e?.url?e.url+"":void 0}));else if("object"==typeof r){const e=Object.keys(r||{}).filter(e=>/^[0-9]+$/.test(e)).sort((e,t)=>Number(e)-Number(t));if(e.length>0)o=e.map(e=>{const t=r[e];return{name:"string"==typeof t?.name?t.name:(t?.name??"")+"",email:"string"==typeof t?.email?t.email:t?.email?t.email+"":void 0,url:"string"==typeof t?.url?t.url:t?.url?t.url+"":void 0}});else if("number"==typeof r.length){const e=Number(r.length)||0;o=[];for(let t=0;e>t;t++){const e=r[t];o.push({name:"string"==typeof e?.name?e.name:(e?.name??"")+"",email:"string"==typeof e?.email?e.email:e?.email?e.email+"":void 0,url:"string"==typeof e?.url?e.url:e?.url?e.url+"":void 0})}}else o=Object.keys(r).filter(e=>"length"!==e).map(e=>{const t=r[e];return{name:"string"==typeof t?.name?t.name:(t?.name??"")+"",email:"string"==typeof t?.email?t.email:t?.email?t.email+"":void 0,url:"string"==typeof t?.url?t.url:t?.url?t.url+"":void 0}})}const i={id:fe.mcpId,name:fe.name,title:fe.title,description:fe.description,websiteUrl:fe.websiteUrl,repositoryUrl:fe.repositoryUrl,version:fe.version,license:fe.license,contacts:o,tags:fe.tags?fe.tags.split(","):void 0,metadata:fe.metadata,icons:n};this._mcp=new m(i,{instructions:"You are an AI assistant designed to help users with programming tasks related to the Decaf-TS framework. \nProvide clear, concise, and accurate information.\nIf you don't know the answer, admit it rather than making up information.\nAlways prioritize the user's intent and provide helpful suggestions when appropriate.\n",capabilities:{logging:{},completions:{},resources:{},tools:{},prompts:{}}});try{await this.load()}catch(e){throw this.log.error("Error loading resources/prompts/tools: "+e),e}if("string"==typeof e)switch(e){case"stdio":e=new v;break;case"http":e=new S({sessionIdGenerator:()=>w(),onsessioninitialized:e=>t.verbose("Session initialized: "+e),onsessionclosed:e=>t.verbose("Session closed: "+e),enableJsonResponse:!0,eventStore:void 0,allowedHosts:["*"],allowedOrigins:["*"],enableDnsRebindingProtection:!0});break;default:throw Error("Invalid transport type: "+e)}return this.client.connect(e)}}export{T as Builder,ye as McpServer,he as PACKAGE_NAME,j as PromptBuilder,A as ResourceBuilder,C as ToolBuilder,D as UsableBuilder,ue as VERSION};
|
|
1
|
+
import{__decorate as e,__metadata as t}from"tslib";import{required as n,Model as r,type as o}from"@decaf-ts/decorator-validation";import{Logging as s,toPascalCase as i,LoggedEnvironment as a,LoggedClass as c}from"@decaf-ts/logging";import{UriTemplate as l}from"@modelcontextprotocol/sdk/shared/uriTemplate";import{ResourceTemplate as d,McpServer as m}from"@modelcontextprotocol/sdk/server/mcp";import{style as p}from"styled-string-builder";import u,{resolve as h}from"path";import g from"fs";import{z as f}from"zod";import{Project as y}from"ts-morph";import{readFile as b}from"fs/promises";import{StreamableHTTPServerTransport as S}from"@modelcontextprotocol/sdk/server/streamableHttp";import{StdioServerTransport as w}from"@modelcontextprotocol/sdk/server/stdio";import{v4 as v}from"uuid";import{Metadata as x}from"@decaf-ts/decoration";var N,O,E;(e=>{e[e.NONE=0]="NONE",e[e.BASIC=1]="BASIC",e[e.ADVANCED=2]="ADVANCED",e[e.HIGH=3]="HIGH"})(N||(N={})),(e=>{e[e.NONE=0]="NONE",e[e.LOW=1]="LOW",e[e.MEDIUM=2]="MEDIUM",e[e.HIGH=3]="HIGH"})(O||(O={})),(e=>{e[e.FREE=0]="FREE",e[e.LOW=1]="LOW",e[e.MEDIUM=2]="MEDIUM",e[e.HIGH=3]="HIGH"})(E||(E={}));class T extends r{constructor(e){super(e),r.fromObject(this,e)}log(e){const{sessionId:t,requestId:n,authInfo:r}=e||{};let o="string"==typeof t&&t.length>0?s.for(t).for(this):s.for(this);return r&&r.clientId&&(o=o.for(r.clientId)),n&&(o=o.for(n.toString())),o}setDescription(e){return this.description=e,this}setName(e){return this.name=e,this}setTitle(e){return this.title=e,this}}e([n(),t("design:type",String)],T.prototype,"description",void 0),e([n(),t("design:type",String)],T.prototype,"name",void 0),e([n(),t("design:type",String)],T.prototype,"title",void 0);class D extends T{constructor(e){super(e),this.reasoning=N.NONE,this.effort=O.NONE,this.cost=E.FREE}setReasoning(e){return this.reasoning=e,this}setEffort(e){return this.effort=e,this}setCost(e){return this.cost=e,this}}e([n(),t("design:type",Number)],D.prototype,"reasoning",void 0),e([n(),t("design:type",Number)],D.prototype,"effort",void 0),e([n(),t("design:type",Number)],D.prototype,"cost",void 0);class j extends D{setCb(e){return this.cb=e,this}setArgsSchema(e){return this.argsSchema=e,this}constructor(e){super(e)}static get builder(){return new j}build(e){const t=this.hasErrors();if(t)throw Error(t.toString());try{return e.registerPrompt(this.name,{title:this.title,description:this.description,argsSchema:this.argsSchema},async(e,t)=>{const n=this.log(t);e=e||{},n.verbose(`Executing prompt ${this.name} with args: ${JSON.stringify(e)}`),e._meta=Object.assign(e._meta||{},{usage:{reasoning:this.reasoning,effort:this.effort,cost:this.cost}});const r=await Promise.resolve(this.cb(e,t));return n.verbose(`Prompt ${this.name} executed successfully.`),n.debug("Prompt execution meta: "+JSON.stringify(r._meta)),r})}catch(e){throw s.for(this).error("Failed to register prompt "+this.name,e),e}}}e([n(),t("design:type",Object)],j.prototype,"cb",void 0),e([n(),t("design:type",Object)],j.prototype,"argsSchema",void 0);class A extends T{setCb(e){return this.cb=e,this}setConfig(e){return this.config=e,this}setUriOtTemplate(e){return this.uriOrTemplate=e,this}constructor(e){super(e)}static get builder(){return new A}build(e){const t=this.hasErrors();if(t)throw Error(t.toString());try{const t="string"==typeof this.uriOrTemplate&&this.uriOrTemplate.includes("{")?new d(new l(this.uriOrTemplate),{list:void 0}):this.uriOrTemplate,n=Object.assign(this.config,{_meta:{}}),r=async(e,t)=>{const n=this.log(t);n.verbose(`Requesting resource ${this.name} from ${e.toString()}`);const r=await Promise.resolve(this.cb(e,t));return n.verbose(`Resource ${this.name} retrieved successfully.`),n.debug("Resource retrieval meta: "+JSON.stringify(r._meta)),r};return e.resource(this.name,t,n,r)}catch(e){throw s.for(this).error("Error registering resource "+this.name,e),e}}}e([n(),t("design:type",String)],A.prototype,"uriOrTemplate",void 0),e([n(),t("design:type",Function)],A.prototype,"cb",void 0),e([n(),t("design:type",Object)],A.prototype,"config",void 0);class C extends D{setAnnotations(e){return this.annotations=Object.assign(this.annotations,e),this}setCb(e){return this.cb=e,this}setInputSchema(e){return this.inputSchema=e,this}setOutputSchema(e){return this.outputSchema=e,this}constructor(e){super(e),this.annotations={readOnlyHint:!0,destructiveHint:!1,idempotentHint:!0,openWorldHint:!1}}static get builder(){return new C}build(e){const t=this.hasErrors();if(t)throw Error(t.toString());try{return e.registerTool(this.name,{title:this.title,description:this.description,inputSchema:this.inputSchema,outputSchema:this.outputSchema,annotations:this.annotations,_meta:{usage:{reasoning:this.reasoning,effort:this.effort,cost:this.cost}}},async(e,t)=>{const n=this.log(t);n.verbose(`Executing tool ${this.name} with args: ${JSON.stringify(e)}`),t._meta=Object.assign(t._meta||{},{usage:{reasoning:this.reasoning,effort:this.effort,cost:this.cost}});const r=await Promise.resolve(this.cb(e,t));return n.verbose(`Tool ${this.name} executed successfully.`),n.debug("Tool execution meta: "+JSON.stringify(r._meta)),r})}catch(e){throw s.for(this).error("Error building tool",e),e}}}e([n(),t("design:type",Object)],C.prototype,"annotations",void 0),e([n(),t("design:type",Object)],C.prototype,"cb",void 0),e([o(Object.name),n(),t("design:type",Object)],C.prototype,"inputSchema",void 0),e([o(Object.name),t("design:type",Object)],C.prototype,"outputSchema",void 0);const I=["\x1b[38;5;215m","\x1b[38;5;209m","\x1b[38;5;205m","\x1b[38;5;210m","\x1b[38;5;217m","\x1b[38;5;216m","\x1b[38;5;224m","\x1b[38;5;230m","\x1b[38;5;230m"];let $=null;async function P(e){const t=$||($=new y({tsConfigFilePath:void 0,skipAddingFilesFromTsConfig:!0}),$),n=t.addSourceFileAtPathIfExists(e)||t.createSourceFile(e,void 0,{overwrite:!1});try{await Promise.race([t.resolveSourceFileDependencies(),new Promise(e=>setTimeout(e,2e3))])}catch(e){}const r=n.getExportedDeclarations();return{astObjects:Array.from(r.entries()).flatMap(([t,n])=>n.map(n=>{const r="function"==typeof n.getStartLineNumber?n.getStartLineNumber():0,o="function"==typeof n.getEndLineNumber?n.getEndLineNumber():0,s="function"==typeof n.getKindName?(n.getKindName()+"").toLowerCase():"unknown",i="function"==typeof n.getStartLinePos?n.getStartLinePos():0;return{id:`${e}::${t}`,name:t,kind:s,location:{filePath:e,startLine:r,startColumn:i,endLine:o,endColumn:0},isExported:!0}}))}}const k="ts.ast.extract",R="AST Extraction Tool for TypeScript",J=f.object({filePath:f.string().describe("The path to the TypeScript file to analyze.")}).describe(`the input schema for the ${k} tool`);f.object({}).describe(`the output schema for the ${k} tool`);const _=C.builder.setName(k).setTitle(R).setDescription("Extracts and analyzes the Abstract Syntax Tree (AST) of TypeScript code to provide insights into its structure and components.").setInputSchema(J).setAnnotations({title:R,readOnlyHint:!0,destructiveHint:!1,idempotentHint:!0,openWorldHint:!1}).setCb(async(e,t)=>{const{filePath:n}=e,r=await Promise.race([P(n),new Promise(e=>setTimeout(()=>e(null),1500))]);if(!r||!r.astObjects)return{content:[{type:"text",text:"No AST objects or analysis timed out"}],structuredContent:{astObjects:[]}};const o=r.astObjects.map(e=>({id:e.id,name:e.name,kind:e.kind||"unknown",location:e.location,isExported:!!e.isExported,signature:e.signature,parentId:e.parentId,children:e.children,decorators:e.decorators,contextHints:e.contextHints||[]}));return{content:[{type:"text",text:`Found ${o.length} AST objects`}],structuredContent:{astObjects:o}}}),F=C.builder.setName("example-tool").setTitle("Example: Reverse String Tool").setDescription("Reverses the provided `text` input and returns the result.").setInputSchema(f.object({text:f.string()})).setCb(async(e,t)=>{const n=((e?.text??"")+"").split("").reverse().join("");return{content:[{type:"text",text:n}],structuredContent:{result:n}}}).setReasoning(N.NONE).setEffort(O.NONE).setCost(E.FREE),M=C.builder.setName("ast.jsdoc").setTitle("AST \u2192 JSDoc Tool").setDescription("Generate suggested JSDoc comments for TypeScript AST objects (MVP stub).").setInputSchema(f.object({filePath:f.string()})).setCb(async(e,t)=>{const n=[{type:"text",text:"Not implemented (stub)"}];return{content:n,structuredContent:{content:n}}}).setReasoning(N.BASIC).setEffort(O.LOW).setCost(E.FREE),H=[_,F,C.builder.setName("file.summarizer").setTitle("File Summarizer").setDescription("Produce a short structured summary for a TypeScript file.").setInputSchema(f.object({filePath:f.string()})).setCb(async(e,t)=>{if(!(e?.filePath??e?.path))return{content:[{type:"text",text:""}]};const n=await(async()=>({astObjects:[]}))().catch(()=>null),r=n&&n.astObjects||[],o=r.map(e=>e.name||e.id||e.kind).slice(0,20),s=`Found ${r.length} AST objects. Top names: ${o.join(", ")}`;return{content:[{type:"text",text:s}],structuredContent:{summary:s},_meta:{count:r.length}}}).setReasoning(N.NONE).setEffort(O.NONE).setCost(E.FREE),M];var L=Object.freeze({__proto__:null,Tools:H});const B="You're a senior TypeScript developer writing JSDoc documentation for a class to be used with better-docs. Given the module code:\nGenerate a JSDoc comment block for a TypeScript module file using better-docs formatting:",G="document the target code, always including the @description tag with a short description of the target, and a@summary tag with a more detailed one.\n Include @interface and @typeDef an @template tags when appropriate.\n Include detailed @description for all properties.\n For methods, include @description and @summary tags as defined for the target. also document every argument, including its type definition, and return type, referencing @template tags when necessary.\n\n The order of tags (when applicable) should be as follows:\n1 - @description;\n2 - @summary;\n3 - @template;\n4 - @param;\n5 - @return;\n6 - @interface or @typeDef followed by the interface or type name;\n8 - @memberOf referencing the appropriate module using the appropriate syntax\n\nOutput only the completed JSDoc comment block for the type or interface.\nrefer to the module it belongs with @memberOf this the `@memberOf module:<module_name>` syntax\nnever omit or change any code\nif the element is already documented, only restructure, correct, or add to the documentation. NEVER remove existing information",z="document the target code, always including the @description tag with a short description of the target, and a@summary tag with a more detailed one.\nInclude @const and @typeDef tags when appropriate.\nInclude detailed @description for all properties.\n- For enums, include @enum and @readonly, and add inline documentation for each member\n- For object-like constants:\n - Create a @typedef with @property for each key\n - Reference it in the constant using @type\n - Alternatively, document each key inline if small\n\nThe order of tags (when applicable) should be as follows:\n1 - @description;\n2 - @summary;\n3 - @template;\n4 - @property;\n6 - @const followed by the const or enum name;\n8 - @memberOf referencing the appropriate module using the appropriate syntax\n\nRespond with the JSDoc comment block(s) for both the typedef and the constant or enum.\nrefer to the module it belongs with @memberOf this the `@memberOf module:<module_name>` syntax\nnever omit or change any code\nif the element is already documented, only restructure, correct, or add to the documentation. NEVER remove existing information",U="NOTES:\n - when document a function/method parameters, and there is a template type involved, ALWAYS reference it using the @template tag;\n - when documenting a function type as a parameter, ALWAYS use the function(type1,type2):return_type syntax;\n ",q=f.object({}),V=j.builder.setName("ts.jsdoc.class").setTitle("Class JSDocs Prompt").setDescription("Generate JSDoc comments for a TypeScript class according to a curated template and prompt.").setArgsSchema(q).setReasoning(N.BASIC).setCb((e,t)=>({messages:[{role:"user",content:{type:"text",text:`${B}\ndocument the entire class and each of its functions including always including the @description tag with a short description of the target, and a@summary tag with a more detailed one.\nInclude @class tags when applicable.\ninclude @param tags in the class documentation and its type definitions\nInclude detailed @description for all properties.\nInclude @template tags when necessary.\nDo NOT document the constructor, but include the constructor arguments as @param in the class documentation\nFor methods and functions:\n- include @description and @summary tags as defined for the target. also document every argument, including its type definition, and return type, referencing @template tags when necessary.\n- create a usage example under the @example tag on the class documentation\n- create mermaid sequence diagrams under the @mermaid tag;\n\nThe order of tags (when applicable) should be as follows:\n1 - @description;\n2 - @summary;\n3 - @template;\n4 - @param;\n5 - @return;\n6 - @class\n7 - @example\n8 - @mermaid;\n\nignore @mermaid for methods with less that 15 lines and constructors.\nRespond only with the full JSDoc comment block for the class and its methods.\nNEVER user @memberOf in the class or any of it's methods\nif the element is already documented, only restructure, correct, or add to the documentation. NEVER remove existing information\nnever omit or change any code, including the constructor\n${U}`}}],_meta:{}})),W=f.object({}),K=j.builder.setName("ts.jsdoc.const").setTitle("Const JSDocs Prompt").setDescription("Generate JSDoc comments for a TypeScript constant according to a curated template and prompt.").setArgsSchema(W).setCb((e,t)=>({messages:[{role:"user",content:{type:"text",text:`${B}\n${z}\n${U}`}}]})),Y=f.object({}),Q=j.builder.setName("ts.jsdoc.decorator").setTitle("Decorator JSDocs Prompt").setDescription("Generate JSDoc comments for a TypeScript Decorator according to a curated template and prompt.").setArgsSchema(Y).setCb((e,t)=>({messages:[{role:"user",content:{type:"text",text:`${B}\ndocument the target code, always including the @description tag with a short description of the target, and a@summary tag with a more detailed one.\nInclude @function an @template tags when appropriate.\nInclude detailed @description for all properties.\nFor methods, include @description and @summary tags as defined for the target. also document every argument, including its type definition, and return type, referencing @template tags when necessary.\ncreate mermaid sequence diagrams under the @mermaid tag;\n\nThe order of tags (when applicable) should be as follows:\n1 - @description;\n2 - @summary;\n3 - @template;\n4 - @param including type definitions;\n5 - @return;\n6 - @function followed by the interface or type name;\n7 - @mermaid with the sequence diagram for the function if it has over 10 lines\n8 - @category one of: "Decorators", "Class Decorators", "Method Decorators", "Property Decorators", "Parameter Decorators"\nOutput only the full JSDoc comment block for the function.\nDO NOT refer to the module it belongs with @memberOf\nnever omit or change any code\nif the element is already documented, only restructure, correct, or add to the documentation. NEVER remove existing information\n${U}`}}]})),X=f.object({}),Z=j.builder.setName("ts.jsdoc.enum").setTitle("Enum JSDocs Prompt").setDescription("Generate JSDoc comments for a TypeScript enum according to a curated template and prompt.").setArgsSchema(X).setCb((e,t)=>({messages:[{role:"user",content:{type:"text",text:`${B}\n${z}\n${U}`}}]})),ee=f.object({}),te=j.builder.setName("ts.jsdoc.function").setTitle("Function JSDocs Prompt").setDescription("Generate JSDoc comments for a TypeScript function according to a curated template and prompt.").setArgsSchema(ee).setCb((e,t)=>({messages:[{role:"user",content:{type:"text",text:`${B}\ndocument the target code, always including the @description tag with a short description of the target, and a@summary tag with a more detailed one.\nInclude @function an @template tags when appropriate.\nInclude detailed @description for all properties.\nFor methods, include @description and @summary tags as defined for the target. also document every argument, including its type definition, and return type, referencing @template tags when necessary.\ncreate mermaid sequence diagrams under the @mermaid tag;\n\nThe order of tags (when applicable) should be as follows:\n1 - @description;\n2 - @summary;\n3 - @template;\n4 - @param including type definitions;\n5 - @return;\n6 - @function followed by the interface or type name;\n7 - @mermaid with the sequence diagram for the function if ithas over 10 lines\n8 - @memberOf referencing the appropriate module using the appropriate syntax\n\nOutput only the full JSDoc comment block for the function.\nrefer to the module it belongs with @memberOf this the \`@memberOf module:<module_name>\` syntax\nnever omit or change any code\nif the element is already documented, only restructure, correct, or add to the documentation. NEVER remove existing information\n${U}`}}]})),ne=f.object({}),re=j.builder.setName("ts.jsdoc.interface").setTitle("Interface JSDocs Prompt").setDescription("Generate JSDoc comments for a TypeScript interface according to a curated template and prompt.").setArgsSchema(ne).setCb((e,t)=>({messages:[{role:"user",content:{type:"text",text:`${B}\n${G}\n${U}`}}]})),oe=f.object({}),se=j.builder.setName("ts.jsdoc.type").setTitle("Type JSDocs Prompt").setDescription("Generate JSDoc comments for a TypeScript type according to a curated template and prompt.").setArgsSchema(oe).setCb((e,t)=>({messages:[{role:"user",content:{type:"text",text:`${B}\n${G}\n${U}`}}]})),ie=f.object({className:f.string().describe("the class name to turn into a builder")}),ae=j.builder.setName("ts.code.dp.builder").setTitle("Typescript builder design patter prompt").setDescription("for a class, with a defined set of properties, scafold a builder design pattern").setArgsSchema(ie).setReasoning(N.BASIC).setCb((e,t)=>(e.className=i(e.className),{messages:[{role:"user",content:{type:"text",text:`You're a senior TypeScript developer writing typescript code.You're a senior TypeScript developer writing typescript code.\nTransform the selected class into a builder design pattern implementation in Typescript.\nuse @decaf-ts validation decorators to enforce the validation of your builder.\n\n- must extend the Model Class from @decaf-ts/decorator-validation;\n- each property must be marked as protected;\n- each property must have a setter method that returns 'this' for chaining;\n- the build() method must validate the properties using hasErrors() method from Model class;\n- if validation fails, throw an error with the validation errors;\n- if validation passes, return an instance of the original class with the set properties;\n- optionally (but do so by default) add the static builder and from methods from the example;\n- if the clasee already follows the pattern but has properties without decoration or without setters, simple add them;\n\nexample:\n\noriginal class:\n\`\`\`typescript\nexport class ${e.className} {\n description!: string;\n name!: string = "default name";\n title!: string;\n age?: string;\n dateOfBirth!: Date;\n}}\n\`\`\` \n\nresulting builder pattern implementation:\n\`\`\`typescript\nexport class ${e.className}Builder extends Model {\n\n @minlength(10\n @required()\n protected description!: string;\n \n @required()\n protected name!: string = "default value;\n \n @required()\n protected title!: string;\n \n @min(18)\n protected age?: string;\n \n @date()\n protected dateOfBirth!: Date;\n\n protected constructor(arg?: ModelArg<${e.className}Builder>>) {\n super(arg);\n Model.fromModel(this, arg);\n }\n\n setDescription(value: string) {\n this.description = value;\n return this;\n }\n\n setName(value: string) {\n this.name = value;\n return this;\n }\n\n setTitle(value: string) {\n this.title = value;\n return this;\n }\n setAge(value: number) {\n this.age = value;\n return this;\n }\n setDate(value: Date) {\n this.age = value;\n return this;\n }\n \n build(...args: any[]): ${e.className}Builder | Promise<${e.className}Builder> {\n const errs = this.hasErrors();\n if (errs) throw new Error(errs.toString());\n \n return // code that builds OBJ here\n }\n \n static get builder(): ${e.className}Builder {\n return new ${e.className}Builder(); // static method to get a new builder instance\n }\n \n static from<K extends keyof ${e.className}Builder>(obj: K, ${e.className}Builder[K]): ${e.className}Builder {\n return new ${e.className}Builder(); // static method to create a builder from an object\n }\n}\n\`\`\` \n\n`}}],_meta:{}})),ce=f.object({text:f.string().optional()}),le=j.builder.setName("example.prompt.echo").setTitle("Example: Echo Prompt").setDescription("Returns a short prompt containing the provided `text` as a user message.").setArgsSchema(ce).setReasoning(N.BASIC).setCb((e,t)=>({messages:[{role:"user",content:{type:"text",text:e?.text??"(no text provided)"}}],_meta:{}})),de=f.object({code:f.string().optional(),astObject:f.any().optional()}),me=[V,K,Q,Z,te,re,se,ae,le,j.builder.setName("interactive.jsdoc.assistant").setTitle("Interactive JSDoc Assistant").setDescription("Produce a ready-to-insert JSDoc block for a provided code snippet or AST object.").setArgsSchema(de).setReasoning(N.BASIC).setCb((e,t)=>({messages:[{role:"user",content:{type:"text",text:"Generate a complete JSDoc comment block for the following code. Respond only with the full JSDoc block.\n\n"+(e?.code??"")}}],_meta:{}}))],pe=[A.builder.setName("example.resource.hello").setTitle("Example: Hello Resource").setDescription("A tiny example resource that returns a simple payload for any URI.").setUriOtTemplate("example://hello/{name}").setConfig({description:"Example resource",_meta:{usage:{reasoning:N.NONE,effort:O.NONE,cost:E.FREE}}}).setCb(async(e,t)=>({content:{type:"text",text:"hello from example resource"},_meta:{}})),A.builder.setName("repo.metadata").setTitle("Repository Metadata Resource").setDescription("Expose basic repository metadata such as package.json and lint rules.").setUriOtTemplate("repo://metadata/{file}").setConfig({description:"Repository metadata resource",_meta:{usage:{reasoning:N.NONE,effort:O.NONE,cost:E.FREE}}}).setCb(async(e,t)=>{const n=e.pathname.replace(/^\//,"")||"package.json";try{const e=h(process.cwd(),n),t=await b(e,{encoding:"utf8"}),r=JSON.parse(t);return{content:{type:"json",data:JSON.stringify(r)},_meta:{}}}catch(e){return{content:{type:"text",text:""},_meta:{}}}})],ue="##VERSION##",he="##PACKAGE##";x.registerLibrary(he,ue);const ge={mcpId:he,name:"Official Decaf-TS MCP Server",title:"Official Decaf-TS MCP Server",description:"Provides precise coding assistance for the decaf-ts framework",version:ue,websiteUrl:"https://decaf-ts.github.io",repositoryUrl:"https://github.com/decaf-ts",license:"AGPL-3.0",contacts:[{name:"Decaf-TS",url:"https://decaf-ts.github.io"}],tags:"server,official,decaf-ts",metadata:{},icons:[{src:"workdocs/assets/favicon.svg",mimeType:"image/svg+xml",sizes:"any"}]},fe=a.accumulate(ge);class ye extends c{get client(){if(!this._mcp)throw Error("Mcp server requires Mcp client");return this._mcp}constructor(){super()}async load(){try{const e=await Promise.all(pe.map(e=>e.build(this.client)));this.log.verbose(`Loaded ${e.length} resources`);const t=await Promise.all(me.map(e=>e.build(this.client)));this.log.verbose(`Loaded ${t.length} prompts`);const n=await Promise.all(H.map(e=>e.build(this.client)));this.log.verbose(`Loaded ${n.length} tools`);try{const e=await Promise.resolve().then(()=>L),t=Object.values(e).filter(e=>e&&"function"==typeof e.build).filter(e=>!H.includes(e));if(t.length>0){const e=await Promise.all(t.map(e=>e.build(this.client)));this.log.verbose(`Loaded ${e.length} exported builders from tools module`)}}catch(e){this.log.verbose("No additional exported builders loaded from tools module: "+e)}}catch(e){throw this.log.error("Error loading core MCP components",e),e}}async boot(e="stdio"){const t=this.log;this.log.for(this.boot).info("McpServer booting..."),((e=s.get())=>{let t;try{t=(()=>{let e,t=__dirname;try{for(;t&&t!==u.parse(t).root;){const n=u.join(t,"node_modules");if(g.existsSync(n)&&g.statSync(n).isDirectory()){e=n;break}const r=u.dirname(t);if(r===t)break;t=r}}catch{}const n=[];if(e){const t=u.join(e,"@decaf-ts");try{if(g.existsSync(t)&&g.statSync(t).isDirectory()){const e=g.readdirSync(t);for(const r of e){const e=u.join(t,r);try{const t=u.join(e,"workdocs","assets","slogans.json");if(g.existsSync(t)&&g.statSync(t).isFile()){const e=g.readFileSync(t,"utf-8"),r=JSON.parse(e);if(Array.isArray(r))for(const e of r)"string"==typeof e&&e.trim().length>0&&n.push(e.trim())}}catch{}}}}catch{}}return 0===n.length?"Decaf: strongly brewed TypeScript.":n[Math.floor(Math.random()*n.length)]})()}catch{t="Decaf: strongly brewed TypeScript."}const n="# \u2591\u2592\u2593\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2593\u2592\u2591 \u2591\u2592\u2593\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2593\u2592\u2591 \u2591\u2592\u2593\u2588\u2588\u2588\u2588\u2588\u2588\u2593\u2592\u2591 \u2591\u2592\u2593\u2588\u2588\u2588\u2588\u2588\u2588\u2593\u2592\u2591 \u2591\u2592\u2593\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2593\u2592\u2591 \u2591\u2592\u2593\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2593\u2592\u2591 \u2591\u2592\u2593\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2593\u2592\u2591 \n# ( ( \u2591\u2592\u2593\u2588\u2593\u2592\u2591\u2591\u2592\u2593\u2588\u2593\u2592\u2591 \u2591\u2592\u2593\u2588\u2593\u2592\u2591 \u2591\u2592\u2593\u2588\u2593\u2592\u2591\u2591\u2592\u2593\u2588\u2593\u2592\u2591 \u2591\u2592\u2593\u2588\u2593\u2592\u2591\u2591\u2592\u2593\u2588\u2593\u2592\u2591 \u2591\u2592\u2593\u2588\u2593\u2592\u2591 \u2591\u2592\u2593\u2588\u2593\u2592\u2591 \u2591\u2592\u2593\u2588\u2593\u2592\u2591 \n# ) ) \u2591\u2592\u2593\u2588\u2593\u2592\u2591\u2591\u2592\u2593\u2588\u2593\u2592\u2591 \u2591\u2592\u2593\u2588\u2593\u2592\u2591 \u2591\u2592\u2593\u2588\u2593\u2592\u2591 \u2591\u2592\u2593\u2588\u2593\u2592\u2591\u2591\u2592\u2593\u2588\u2593\u2592\u2591 \u2591\u2592\u2593\u2588\u2593\u2592\u2591 \u2591\u2592\u2593\u2588\u2593\u2592\u2591 \u2591\u2592\u2593\u2588\u2593\u2592\u2591 \n# [=======] \u2591\u2592\u2593\u2588\u2593\u2592\u2591\u2591\u2592\u2593\u2588\u2593\u2592\u2591 \u2591\u2592\u2593\u2588\u2588\u2588\u2588\u2588\u2588\u2593\u2592\u2591 \u2591\u2592\u2593\u2588\u2593\u2592\u2591 \u2591\u2592\u2593\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2593\u2592\u2591 \u2591\u2592\u2593\u2588\u2588\u2588\u2588\u2588\u2588\u2593\u2592\u2591 \u2591\u2592\u2593\u2588\u2593\u2592\u2591 \u2591\u2592\u2593\u2588\u2588\u2588\u2588\u2588\u2588\u2593\u2592\u2591 \n# `-----\xb4 \u2591\u2592\u2593\u2588\u2593\u2592\u2591\u2591\u2592\u2593\u2588\u2593\u2592\u2591 \u2591\u2592\u2593\u2588\u2593\u2592\u2591 \u2591\u2592\u2593\u2588\u2593\u2592\u2591 \u2591\u2592\u2593\u2588\u2593\u2592\u2591\u2591\u2592\u2593\u2588\u2593\u2592\u2591 \u2591\u2592\u2593\u2588\u2593\u2592\u2591 \u2591\u2592\u2593\u2588\u2593\u2592\u2591 \u2591\u2592\u2593\u2588\u2593\u2592\u2591 \n# \u2591\u2592\u2593\u2588\u2593\u2592\u2591\u2591\u2592\u2593\u2588\u2593\u2592\u2591 \u2591\u2592\u2593\u2588\u2593\u2592\u2591 \u2591\u2592\u2593\u2588\u2593\u2592\u2591\u2591\u2592\u2593\u2588\u2593\u2592\u2591 \u2591\u2592\u2593\u2588\u2593\u2592\u2591\u2591\u2592\u2593\u2588\u2593\u2592\u2591 \u2591\u2592\u2593\u2588\u2593\u2592\u2591 \u2591\u2592\u2593\u2588\u2593\u2592\u2591 \u2591\u2592\u2593\u2588\u2593\u2592\u2591 \n# \u2591\u2592\u2593\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2593\u2592\u2591 \u2591\u2592\u2593\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2593\u2592\u2591 \u2591\u2592\u2593\u2588\u2588\u2588\u2588\u2588\u2588\u2593\u2592\u2591 \u2591\u2592\u2593\u2588\u2593\u2592\u2591\u2591\u2592\u2593\u2588\u2593\u2592\u2591 \u2591\u2592\u2593\u2588\u2593\u2592\u2591 \u2591\u2592\u2593\u2588\u2593\u2592\u2591 \u2591\u2592\u2593\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2593\u2592\u2591 \n#".split("\n"),r=n.reduce((e,t)=>Math.max(e,t.length),0);n.push("# "+t.padStart(r-3)),n.forEach((t,n)=>{const r=I[n%I.length]||"",o=e?e.info.bind(e):(()=>{}).bind();try{o(p(t||"").raw(r).text)}catch{o((t||"")+"")}})})(this.log);const n=((Array.isArray(fe.icons)?fe.icons:[fe.icons])||[]).map(e=>{const t="string"==typeof e?.src?e.src:(e?.src??"")+"",n="string"==typeof e?.mimeType?e.mimeType:(e?.mimeType??"")+"";let r=[];return Array.isArray(e?.sizes)?r=e.sizes.map(e=>e+""):"string"==typeof e?.sizes&&(r=(e.sizes+"").split(",").map(e=>e.trim())),{src:t,mimeType:n,sizes:r}}),r=fe.contacts;let o;if(null!=r)if(Array.isArray(r))o=r.map(e=>({name:"string"==typeof e?.name?e.name:(e?.name??"")+"",email:"string"==typeof e?.email?e.email:e?.email?e.email+"":void 0,url:"string"==typeof e?.url?e.url:e?.url?e.url+"":void 0}));else if("object"==typeof r){const e=Object.keys(r||{}).filter(e=>/^[0-9]+$/.test(e)).sort((e,t)=>Number(e)-Number(t));if(e.length>0)o=e.map(e=>{const t=r[e];return{name:"string"==typeof t?.name?t.name:(t?.name??"")+"",email:"string"==typeof t?.email?t.email:t?.email?t.email+"":void 0,url:"string"==typeof t?.url?t.url:t?.url?t.url+"":void 0}});else if("number"==typeof r.length){const e=Number(r.length)||0;o=[];for(let t=0;e>t;t++){const e=r[t];o.push({name:"string"==typeof e?.name?e.name:(e?.name??"")+"",email:"string"==typeof e?.email?e.email:e?.email?e.email+"":void 0,url:"string"==typeof e?.url?e.url:e?.url?e.url+"":void 0})}}else o=Object.keys(r).filter(e=>"length"!==e).map(e=>{const t=r[e];return{name:"string"==typeof t?.name?t.name:(t?.name??"")+"",email:"string"==typeof t?.email?t.email:t?.email?t.email+"":void 0,url:"string"==typeof t?.url?t.url:t?.url?t.url+"":void 0}})}const i={id:fe.mcpId,name:fe.name,title:fe.title,description:fe.description,websiteUrl:fe.websiteUrl,repositoryUrl:fe.repositoryUrl,version:fe.version,license:fe.license,contacts:o,tags:fe.tags?fe.tags.split(","):void 0,metadata:fe.metadata,icons:n};this._mcp=new m(i,{instructions:"You are an AI assistant designed to help users with programming tasks related to the Decaf-TS framework. \nProvide clear, concise, and accurate information.\nIf you don't know the answer, admit it rather than making up information.\nAlways prioritize the user's intent and provide helpful suggestions when appropriate.\n",capabilities:{logging:{},completions:{},resources:{},tools:{},prompts:{}}});try{await this.load()}catch(e){throw this.log.error("Error loading resources/prompts/tools: "+e),e}if("string"==typeof e)switch(e){case"stdio":e=new w;break;case"http":e=new S({sessionIdGenerator:()=>v(),onsessioninitialized:e=>t.verbose("Session initialized: "+e),onsessionclosed:e=>t.verbose("Session closed: "+e),enableJsonResponse:!0,eventStore:void 0,allowedHosts:["*"],allowedOrigins:["*"],enableDnsRebindingProtection:!0});break;default:throw Error("Invalid transport type: "+e)}return this.client.connect(e)}}export{T as Builder,ye as McpServer,he as PACKAGE_NAME,j as PromptBuilder,A as ResourceBuilder,C as ToolBuilder,D as UsableBuilder,ue as VERSION};
|
|
2
2
|
//# sourceMappingURL=mcp-server.js.map
|
package/dist/mcp-server.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mcp-server.js","sources":["../src/constants.ts","../src/builders/builder.ts","../src/builders/prompt-builder.ts","../src/builders/resource-builder.ts","../src/builders/tool-builder.ts","../src/utils/banner.ts","../src/tools/ast/utils.ts","../src/tools/ast/ts-ast-tool.ts","../src/tools/example-tool/index.ts","../src/tools/ast-jsdoc-tools/index.ts","../src/tools/index.ts","../src/tools/file-summarizer/index.ts","../src/prompts/jsdocs/constants.ts","../src/prompts/jsdocs/class-prompt.ts","../src/prompts/jsdocs/const-prompt.ts","../src/prompts/jsdocs/decorator-prompt.ts","../src/prompts/jsdocs/enum-prompt.ts","../src/prompts/jsdocs/function-prompt.ts","../src/prompts/jsdocs/interface-prompt.ts","../src/prompts/jsdocs/types-prompt.ts","../src/prompts/code/design-patterns/builder.ts","../src/prompts/example-prompt/index.ts","../src/prompts/interactive-jsdoc/index.ts","../src/prompts/index.ts","../src/resources/index.ts","../src/resources/example-resource/index.ts","../src/resources/repo-metadata/index.ts","../src/version.ts","../src/environment.ts","../src/mcp-server.ts"],"sourcesContent":[null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null],"names":["ReasoningLevel","EffortLevel","Cost","Builder","Model","constructor","arg","super","fromObject","this","log","extra","sessionId","requestId","authInfo","length","Logging","for","clientId","toString","setDescription","value","description","setName","name","setTitle","title","__decorate","required","prototype","UsableBuilder","reasoning","NONE","effort","cost","FREE","setReasoning","setEffort","setCost","PromptBuilder","setCb","cb","setArgsSchema","argsSchema","builder","build","server","errs","hasErrors","Error","registerPrompt","async","args","verbose","JSON","stringify","_meta","Object","assign","usage","result","Promise","resolve","debug","e","error","ResourceBuilder","setConfig","config","setUriOtTemplate","uriOrTemplate","uriOrTemplateArg","includes","ResourceTemplate","UriTemplate","list","undefined","metadata","readCb","uri","resource","ToolBuilder","setAnnotations","annotations","setInputSchema","inputSchema","setOutputSchema","outputSchema","readOnlyHint","destructiveHint","idempotentHint","openWorldHint","registerTool","type","colors","_project","analyzeFile","filePath","project","Project","tsConfigFilePath","skipAddingFilesFromTsConfig","source","addSourceFileAtPathIfExists","createSourceFile","overwrite","race","resolveSourceFileDependencies","res","setTimeout","err","exported","getExportedDeclarations","astObjects","Array","from","entries","flatMap","decls","map","d","start","getStartLineNumber","end","getEndLineNumber","kind","getKindName","String","toLowerCase","startColumn","getStartLinePos","id","location","startLine","endLine","endColumn","isExported","toolName","toolTitle","z","object","string","describe","TsAstTool","content","text","structuredContent","objects","o","signature","parentId","children","decorators","contextHints","ExampleTool","_extra","reversed","split","reverse","join","AstJsdocTool","_args","BASIC","LOW","Tools","path","catch","names","slice","summary","count","BaseJSDocPrompt","TypesPrompt","ConstantsPrompt","Footer","TsDocClassPrompt","messages","role","TsDocConstPrompt","TsDocDecoratorPrompt","TsDocEnumPrompt","TsDocFunctionPrompt","TsDocInterfacePrompt","TsDocTypeePrompt","className","TsCodeDesignPatterBuilderPrompt","toPascalCase","optional","ExamplePrompt","code","astObject","any","Prompts","Resources","_uri","file","pathname","replace","p","process","cwd","raw","readFile","encoding","parsed","parse","data","VERSION","PACKAGE_NAME","Metadata","registerLibrary","DefaultMcpEnvironment","mcpId","version","websiteUrl","repositoryUrl","license","contacts","url","tags","icons","src","mimeType","sizes","Environment","LoggedEnvironment","accumulate","McpServer","LoggedClass","client","_mcp","load","loadedResourced","all","r","loadedPrompts","loadedTools","toolsModule","toLoad","values","filter","v","c","loadedExported","t","boot","transportType","info","logger","get","message","nodeModulesDir","current","__dirname","root","candidate","fs","existsSync","statSync","isDirectory","parent","dirname","slogans","scopeDir","pkgs","readdirSync","pkg","depPath","slogansPath","isFile","readFileSync","isArray","s","trim","push","Math","floor","random","getSlogan","banner","maxLength","reduce","max","line","padStart","forEach","index","color","logFn","bind","console","style","printBanner","normalizedIcons","i","contactsRaw","normalizedContacts","email","numericKeys","keys","k","test","sort","a","b","Number","len","serverInfo","MCP","instructions","capabilities","logging","completions","resources","tools","prompts","StdioServerTransport","StreamableHTTPServerTransport","sessionIdGenerator","v4","onsessioninitialized","onsessionclosed","enableJsonResponse","eventStore","allowedHosts","allowedOrigins","enableDnsRebindingProtection","connect"],"mappings":"23BAAA,IAAYA,EAOAC,EAOAC,EAdZ,CAAYF,IACVA,EAAAA,EAAA,KAAA,GAAA,OACAA,EAAAA,EAAA,MAAA,GAAA,QACAA,EAAAA,EAAA,SAAA,GAAA,WACAA,EAAAA,EAAA,KAAA,GAAA,MACD,EALD,CAAYA,IAAAA,EAKX,CAAA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kG,QAAQjF,EAC5B"}
|
|
1
|
+
{"version":3,"file":"mcp-server.js","sources":["../src/constants.ts","../src/builders/builder.ts","../src/builders/prompt-builder.ts","../src/builders/resource-builder.ts","../src/builders/tool-builder.ts","../src/utils/banner.ts","../src/tools/ast/utils.ts","../src/tools/ast/ts-ast-tool.ts","../src/tools/example-tool/index.ts","../src/tools/ast-jsdoc-tools/index.ts","../src/tools/index.ts","../src/tools/file-summarizer/index.ts","../src/prompts/jsdocs/constants.ts","../src/prompts/jsdocs/class-prompt.ts","../src/prompts/jsdocs/const-prompt.ts","../src/prompts/jsdocs/decorator-prompt.ts","../src/prompts/jsdocs/enum-prompt.ts","../src/prompts/jsdocs/function-prompt.ts","../src/prompts/jsdocs/interface-prompt.ts","../src/prompts/jsdocs/types-prompt.ts","../src/prompts/code/design-patterns/builder.ts","../src/prompts/example-prompt/index.ts","../src/prompts/interactive-jsdoc/index.ts","../src/prompts/index.ts","../src/resources/index.ts","../src/resources/example-resource/index.ts","../src/resources/repo-metadata/index.ts","../src/version.ts","../src/environment.ts","../src/mcp-server.ts"],"sourcesContent":[null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null],"names":["ReasoningLevel","EffortLevel","Cost","Builder","Model","constructor","arg","super","fromObject","this","log","extra","sessionId","requestId","authInfo","length","Logging","for","clientId","toString","setDescription","value","description","setName","name","setTitle","title","__decorate","required","prototype","UsableBuilder","reasoning","NONE","effort","cost","FREE","setReasoning","setEffort","setCost","PromptBuilder","setCb","cb","setArgsSchema","argsSchema","builder","build","server","errs","hasErrors","Error","registerPrompt","async","args","verbose","JSON","stringify","_meta","Object","assign","usage","result","Promise","resolve","debug","e","error","ResourceBuilder","setConfig","config","setUriOtTemplate","uriOrTemplate","uriOrTemplateArg","includes","ResourceTemplate","UriTemplate","list","undefined","metadata","readCb","uri","resource","ToolBuilder","setAnnotations","annotations","setInputSchema","inputSchema","setOutputSchema","outputSchema","readOnlyHint","destructiveHint","idempotentHint","openWorldHint","registerTool","type","colors","_project","analyzeFile","filePath","project","Project","tsConfigFilePath","skipAddingFilesFromTsConfig","source","addSourceFileAtPathIfExists","createSourceFile","overwrite","race","resolveSourceFileDependencies","res","setTimeout","err","exported","getExportedDeclarations","astObjects","Array","from","entries","flatMap","decls","map","d","start","getStartLineNumber","end","getEndLineNumber","kind","getKindName","String","toLowerCase","startColumn","getStartLinePos","id","location","startLine","endLine","endColumn","isExported","toolName","toolTitle","z","object","string","describe","TsAstTool","content","text","structuredContent","objects","o","signature","parentId","children","decorators","contextHints","ExampleTool","_extra","reversed","split","reverse","join","AstJsdocTool","_args","BASIC","LOW","Tools","path","catch","names","slice","summary","count","BaseJSDocPrompt","TypesPrompt","ConstantsPrompt","Footer","TsDocClassPrompt","messages","role","TsDocConstPrompt","TsDocDecoratorPrompt","TsDocEnumPrompt","TsDocFunctionPrompt","TsDocInterfacePrompt","TsDocTypeePrompt","className","TsCodeDesignPatterBuilderPrompt","toPascalCase","optional","ExamplePrompt","code","astObject","any","Prompts","Resources","_uri","file","pathname","replace","p","process","cwd","raw","readFile","encoding","parsed","parse","data","VERSION","PACKAGE_NAME","Metadata","registerLibrary","DefaultMcpEnvironment","mcpId","version","websiteUrl","repositoryUrl","license","contacts","url","tags","icons","src","mimeType","sizes","Environment","LoggedEnvironment","accumulate","McpServer","LoggedClass","client","_mcp","load","loadedResourced","all","r","loadedPrompts","loadedTools","toolsModule","toLoad","values","filter","v","c","loadedExported","t","boot","transportType","info","logger","get","message","nodeModulesDir","current","__dirname","root","candidate","fs","existsSync","statSync","isDirectory","parent","dirname","slogans","scopeDir","pkgs","readdirSync","pkg","depPath","slogansPath","isFile","readFileSync","isArray","s","trim","push","Math","floor","random","getSlogan","banner","maxLength","reduce","max","line","padStart","forEach","index","color","logFn","bind","console","style","printBanner","normalizedIcons","i","contactsRaw","normalizedContacts","email","numericKeys","keys","k","test","sort","a","b","Number","len","serverInfo","MCP","instructions","capabilities","logging","completions","resources","tools","prompts","StdioServerTransport","StreamableHTTPServerTransport","sessionIdGenerator","v4","onsessioninitialized","onsessionclosed","enableJsonResponse","eventStore","allowedHosts","allowedOrigins","enableDnsRebindingProtection","connect"],"mappings":"s0BAAA,IAAYA,EAOAC,EAOAC,EAdZ,CAAYF,IACVA,EAAAA,EAAA,KAAA,GAAA,OACAA,EAAAA,EAAA,MAAA,GAAA,QACAA,EAAAA,EAAA,SAAA,GAAA,WACAA,EAAAA,EAAA,KAAA,GAAA,MACD,EALD,CAAYA,IAAAA,EAKX,CAAA,IAED,CAAYC,IACVA,EAAAA,EAAA,KAAA,GAAA,OACAA,EAAAA,EAAA,IAAA,GAAA,MACAA,EAAAA,EAAA,OAAA,GAAA,SACAA,EAAAA,EAAA,KAAA,GAAA,MACD,EALD,CAAYA,IAAAA,EAKX,CAAA,IAED,CAAYC,IACVA,EAAAA,EAAA,KAAA,GAAA,OACAA,EAAAA,EAAA,IAAA,GAAA,MACAA,EAAAA,EAAA,OAAA,GAAA,SACAA,EAAAA,EAAA,KAAA,GAAA,MACD,EALD,CAAYA,IAAAA,EAKX,CAAA,ICTK,MAAgBC,UAAqBC,EAQzC,WAAAC,CAAsBC,GACpBC,MAAMD,GACNF,EAAMI,WAAWC,KAAMH,EACxB,CAES,GAAAI,CAAIC,GACZ,MAAMC,UAAEA,EAASC,UAAEA,EAASC,SAAEA,GAAaH,GAAS,CAAA,EAGpD,IAAID,EACmB,iBAAdE,GAA0BA,EAAUG,OAAS,EAChDC,EAAQC,IAAIL,GAAWK,IAAIR,MAC3BO,EAAQC,IAAIR,MAGlB,OAFIK,GAAYA,EAASI,WAAUR,EAAMA,EAAIO,IAAIH,EAASI,WACtDL,IAAWH,EAAMA,EAAIO,IAAIJ,EAAUM,aAChCT,CACR,CAID,cAAAU,CAAeC,GAEb,OADAZ,KAAKa,YAAcD,EACZZ,IACR,CAED,OAAAc,CAAQF,GAEN,OADAZ,KAAKe,KAAOH,EACLZ,IACR,CAED,QAAAgB,CAASJ,G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pT,GACrBF,EAAI2C,QAAQ,wBAAwBzC,GACtCqT,gBAAkBrT,GAChBF,EAAI2C,QAAQ,mBAAmBzC,GACjCsT,oBAAoB,EACpBC,gBAAYvP,EACZwP,aAAc,CAAC,KACfC,eAAgB,CAAC,KACjBC,8BAA8B,IAEhC,MACF,QACE,MAAUrR,MAAM,2BAA2BqM,GAGjD,OAAO7O,KAAK4N,OAAOkG,QAAQjF,EAC5B"}
|
package/lib/builders/builder.cjs
CHANGED
|
@@ -22,7 +22,9 @@ class Builder extends decorator_validation_1.Model {
|
|
|
22
22
|
const { sessionId, requestId, authInfo } = extra || {};
|
|
23
23
|
// sessionId may be undefined for some transports or internal calls.
|
|
24
24
|
// Logging.for expects either a string or an object; avoid passing undefined.
|
|
25
|
-
let log = typeof sessionId ===
|
|
25
|
+
let log = typeof sessionId === "string" && sessionId.length > 0
|
|
26
|
+
? logging_1.Logging.for(sessionId).for(this)
|
|
27
|
+
: logging_1.Logging.for(this);
|
|
26
28
|
if (authInfo && authInfo.clientId)
|
|
27
29
|
log = log.for(authInfo.clientId);
|
|
28
30
|
if (requestId)
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Model, ModelArg } from "@decaf-ts/decorator-validation";
|
|
2
|
-
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp
|
|
2
|
+
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp";
|
|
3
3
|
import { RequestHandlerExtra } from "@modelcontextprotocol/sdk/shared/protocol";
|
|
4
4
|
import { ServerNotification, ServerRequest } from "@modelcontextprotocol/sdk/types";
|
|
5
5
|
import { Cost, EffortLevel, ReasoningLevel } from "../constants";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"builder.js","sourceRoot":"","sources":["../../src/builders/builder.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,yEAA2E;AAO3E,+CAA4C;AAC5C,kDAAiE;AAEjE,MAAsB,OAAa,SAAQ,4BAAK;IAQ9C,YAAsB,GAA4B;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AAC,WAAW,GAAG,KAAK,CAAC;QACzB,OAAO,IAAI,CAAC;IACd,CAAC;IAED,OAAO,CAAC,KAAa;QACnB,IAAI,CAAC,IAAI,GAAG,KAAK,CAAC;QAClB,OAAO,IAAI,CAAC;IACd,CAAC;IAED,QAAQ,CAAC,KAAa;QACpB,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;QACnB,OAAO,IAAI,CAAC;IACd,CAAC;CACF;AA1CD,0BA0CC;AAxCW;IADT,IAAA,+BAAQ,GAAE;;4CACoB;AAErB;IADT,IAAA,+BAAQ,GAAE;;qCACa;AAEd;IADT,IAAA,+BAAQ,GAAE;;sCACc;AAsC3B,MAAsB,aAAmB,SAAQ,OAAY;IAU3D,YAAsB,GAA4B;QAChD,KAAK,CAAC,GAAG,CAAC,CAAC;QATH,cAAS,GAAmB,0BAAc,CAAC,IAAI,CAAC;QAGhD,WAAM,GAAgB,uBAAW,CAAC,IAAI,CAAC;QAGvC,SAAI,GAAS,gBAAI,CAAC,IAAI,CAAC;IAIjC,CAAC;IAED,YAAY,CAAC,KAAqB;QAChC,IAAI,CAAC,SAAS,GAAG,KAAK,CAAC;QACvB,OAAO,IAAI,CAAC;IACd,CAAC;IAED,SAAS,CAAC,KAAkB;QAC1B,IAAI,CAAC,MAAM,GAAG,KAAK,CAAC;QACpB,OAAO,IAAI,CAAC;IACd,CAAC;IAED,OAAO,CAAC,KAAW;QACjB,IAAI,CAAC,IAAI,GAAG,KAAK,CAAC;QAClB,OAAO,IAAI,CAAC;IACd,CAAC;CACF;AA5BD,sCA4BC;AA1BW;IADT,IAAA,+BAAQ,GAAE;;gDAC+C;AAGhD;IADT,IAAA,+BAAQ,GAAE;;6CACsC;AAGvC;IADT,IAAA,+BAAQ,GAAE;;2CACsB"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Model, ModelArg } from "@decaf-ts/decorator-validation";
|
|
2
|
-
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp
|
|
2
|
+
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp";
|
|
3
3
|
import { RequestHandlerExtra } from "@modelcontextprotocol/sdk/shared/protocol";
|
|
4
4
|
import { ServerNotification, ServerRequest } from "@modelcontextprotocol/sdk/types";
|
|
5
5
|
import { Cost, EffortLevel, ReasoningLevel } from "../constants";
|
|
@@ -19,7 +19,9 @@ export class Builder extends Model {
|
|
|
19
19
|
const { sessionId, requestId, authInfo } = extra || {};
|
|
20
20
|
// sessionId may be undefined for some transports or internal calls.
|
|
21
21
|
// Logging.for expects either a string or an object; avoid passing undefined.
|
|
22
|
-
let log = typeof sessionId ===
|
|
22
|
+
let log = typeof sessionId === "string" && sessionId.length > 0
|
|
23
|
+
? Logging.for(sessionId).for(this)
|
|
24
|
+
: Logging.for(this);
|
|
23
25
|
if (authInfo && authInfo.clientId)
|
|
24
26
|
log = log.for(authInfo.clientId);
|
|
25
27
|
if (requestId)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"builder.js","sourceRoot":"","sources":["../../../src/builders/builder.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,EAAE,KAAK,EAAY,QAAQ,EAAE,MAAM,gCAAgC,CAAC;AAO3E,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAC5C,OAAO,EAAE,IAAI,EAAE,WAAW,EAAE,cAAc,EAAE,0BAAqB;AAEjE,MAAM,OAAgB,OAAa,SAAQ,KAAK;IAQ9C,YAAsB,GAA4B;QAChD,KAAK,CAAC,GAAG,CAAC,CAAC;QACX,KAAK,CAAC,UAAU,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC;IAC9B,CAAC;IAES,GAAG,CAAC,KAA6D;QACzE,MAAM,EAAE,SAAS,EAAE,SAAS,EAAE,QAAQ,EAAE,GAAG,KAAK,IAAI,EAAE,CAAC;QACvD,oEAAoE;QACpE,6EAA6E;QAC7E,IAAI,GAAG,
|
|
1
|
+
{"version":3,"file":"builder.js","sourceRoot":"","sources":["../../../src/buil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ACpB,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;QACnB,OAAO,IAAI,CAAC;IACd,CAAC;CACF;AAxCW;IADT,QAAQ,EAAE;;4CACoB;AAErB;IADT,QAAQ,EAAE;;qCACa;AAEd;IADT,QAAQ,EAAE;;sCACc;AAsC3B,MAAM,OAAgB,aAAmB,SAAQ,OAAY;IAU3D,YAAsB,GAA4B;QAChD,KAAK,CAAC,GAAG,CAAC,CAAC;QATH,cAAS,GAAmB,cAAc,CAAC,IAAI,CAAC;QAGhD,WAAM,GAAgB,WAAW,CAAC,IAAI,CAAC;QAGvC,SAAI,GAAS,IAAI,CAAC,IAAI,CAAC;IAIjC,CAAC;IAED,YAAY,CAAC,KAAqB;QAChC,IAAI,CAAC,SAAS,GAAG,KAAK,CAAC;QACvB,OAAO,IAAI,CAAC;IACd,CAAC;IAED,SAAS,CAAC,KAAkB;QAC1B,IAAI,CAAC,MAAM,GAAG,KAAK,CAAC;QACpB,OAAO,IAAI,CAAC;IACd,CAAC;IAED,OAAO,CAAC,KAAW;QACjB,IAAI,CAAC,IAAI,GAAG,KAAK,CAAC;QAClB,OAAO,IAAI,CAAC;IACd,CAAC;CACF;AA1BW;IADT,QAAQ,EAAE;;gDAC+C;AAGhD;IADT,QAAQ,EAAE;;6CACsC;AAGvC;IADT,QAAQ,EAAE;;2CACsB"}
|
package/lib/esm/mcp-server.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { LoggedClass } from "@decaf-ts/logging";
|
|
2
|
-
import { McpServer as MCP } from "@modelcontextprotocol/sdk/server/mcp
|
|
2
|
+
import { McpServer as MCP } from "@modelcontextprotocol/sdk/server/mcp";
|
|
3
3
|
import { Transport } from "@modelcontextprotocol/sdk/shared/transport";
|
|
4
4
|
export declare class McpServer extends LoggedClass {
|
|
5
5
|
private _mcp?;
|
package/lib/esm/mcp-server.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { LoggedClass } from "@decaf-ts/logging";
|
|
2
|
-
import { McpServer as MCP } from "@modelcontextprotocol/sdk/server/mcp
|
|
2
|
+
import { McpServer as MCP } from "@modelcontextprotocol/sdk/server/mcp";
|
|
3
3
|
import { printBanner } from "./utils/banner.js";
|
|
4
4
|
import { Tools } from "./tools/index.js";
|
|
5
5
|
import { Prompts } from "./prompts/index.js";
|
|
@@ -33,7 +33,6 @@ export class McpServer extends LoggedClass {
|
|
|
33
33
|
try {
|
|
34
34
|
// dynamic import so this code runs at runtime and picks up whatever the module exports
|
|
35
35
|
// (uses the same resolution as the static imports above)
|
|
36
|
-
// eslint-disable-next-line @typescript-eslint/no-var-requires
|
|
37
36
|
const toolsModule = await import("./tools");
|
|
38
37
|
const candidates = Object.values(toolsModule).filter((v) => v && typeof v.build === "function");
|
|
39
38
|
// remove duplicates that are already present in Tools (by identity)
|
|
@@ -58,15 +57,21 @@ export class McpServer extends LoggedClass {
|
|
|
58
57
|
const log = this.log;
|
|
59
58
|
this.log.for(this.boot).info("McpServer booting...");
|
|
60
59
|
printBanner(this.log);
|
|
61
|
-
const iconsRaw = Array.isArray(Environment.icons)
|
|
60
|
+
const iconsRaw = Array.isArray(Environment.icons)
|
|
61
|
+
? Environment.icons
|
|
62
|
+
: [Environment.icons];
|
|
62
63
|
const normalizedIcons = (iconsRaw || []).map((i) => {
|
|
63
|
-
const src = typeof i?.src ===
|
|
64
|
-
const mimeType = typeof i?.mimeType ===
|
|
64
|
+
const src = typeof i?.src === "string" ? i.src : String(i?.src ?? "");
|
|
65
|
+
const mimeType = typeof i?.mimeType === "string"
|
|
66
|
+
? i.mimeType
|
|
67
|
+
: String(i?.mimeType ?? "");
|
|
65
68
|
let sizes = [];
|
|
66
69
|
if (Array.isArray(i?.sizes))
|
|
67
70
|
sizes = i.sizes.map((s) => String(s));
|
|
68
|
-
else if (typeof i?.sizes ===
|
|
69
|
-
sizes = String(i.sizes)
|
|
71
|
+
else if (typeof i?.sizes === "string")
|
|
72
|
+
sizes = String(i.sizes)
|
|
73
|
+
.split(",")
|
|
74
|
+
.map((s) => s.trim());
|
|
70
75
|
return { src, mimeType, sizes };
|
|
71
76
|
});
|
|
72
77
|
// Normalize contacts: Environment may expose proxies or array-like objects
|
|
@@ -78,21 +83,39 @@ export class McpServer extends LoggedClass {
|
|
|
78
83
|
if (Array.isArray(contactsRaw)) {
|
|
79
84
|
normalizedContacts = contactsRaw.map((c) => ({
|
|
80
85
|
name: typeof c?.name === "string" ? c.name : String(c?.name ?? ""),
|
|
81
|
-
email: typeof c?.email === "string"
|
|
82
|
-
|
|
86
|
+
email: typeof c?.email === "string"
|
|
87
|
+
? c.email
|
|
88
|
+
: c?.email
|
|
89
|
+
? String(c.email)
|
|
90
|
+
: undefined,
|
|
91
|
+
url: typeof c?.url === "string"
|
|
92
|
+
? c.url
|
|
93
|
+
: c?.url
|
|
94
|
+
? String(c.url)
|
|
95
|
+
: undefined,
|
|
83
96
|
}));
|
|
84
97
|
}
|
|
85
98
|
else if (typeof contactsRaw === "object") {
|
|
86
99
|
// Prefer numeric-indexed properties if present (handles array-like proxies)
|
|
87
100
|
const keys = Object.keys(contactsRaw || {});
|
|
88
|
-
const numericKeys = keys
|
|
101
|
+
const numericKeys = keys
|
|
102
|
+
.filter((k) => /^[0-9]+$/.test(k))
|
|
103
|
+
.sort((a, b) => Number(a) - Number(b));
|
|
89
104
|
if (numericKeys.length > 0) {
|
|
90
105
|
normalizedContacts = numericKeys.map((k) => {
|
|
91
106
|
const c = contactsRaw[k];
|
|
92
107
|
return {
|
|
93
108
|
name: typeof c?.name === "string" ? c.name : String(c?.name ?? ""),
|
|
94
|
-
email: typeof c?.email === "string"
|
|
95
|
-
|
|
109
|
+
email: typeof c?.email === "string"
|
|
110
|
+
? c.email
|
|
111
|
+
: c?.email
|
|
112
|
+
? String(c.email)
|
|
113
|
+
: undefined,
|
|
114
|
+
url: typeof c?.url === "string"
|
|
115
|
+
? c.url
|
|
116
|
+
: c?.url
|
|
117
|
+
? String(c.url)
|
|
118
|
+
: undefined,
|
|
96
119
|
};
|
|
97
120
|
});
|
|
98
121
|
}
|
|
@@ -103,8 +126,16 @@ export class McpServer extends LoggedClass {
|
|
|
103
126
|
const c = contactsRaw[i];
|
|
104
127
|
normalizedContacts.push({
|
|
105
128
|
name: typeof c?.name === "string" ? c.name : String(c?.name ?? ""),
|
|
106
|
-
email: typeof c?.email === "string"
|
|
107
|
-
|
|
129
|
+
email: typeof c?.email === "string"
|
|
130
|
+
? c.email
|
|
131
|
+
: c?.email
|
|
132
|
+
? String(c.email)
|
|
133
|
+
: undefined,
|
|
134
|
+
url: typeof c?.url === "string"
|
|
135
|
+
? c.url
|
|
136
|
+
: c?.url
|
|
137
|
+
? String(c.url)
|
|
138
|
+
: undefined,
|
|
108
139
|
});
|
|
109
140
|
}
|
|
110
141
|
}
|
|
@@ -116,8 +147,16 @@ export class McpServer extends LoggedClass {
|
|
|
116
147
|
const c = contactsRaw[k];
|
|
117
148
|
return {
|
|
118
149
|
name: typeof c?.name === "string" ? c.name : String(c?.name ?? ""),
|
|
119
|
-
email: typeof c?.email === "string"
|
|
120
|
-
|
|
150
|
+
email: typeof c?.email === "string"
|
|
151
|
+
? c.email
|
|
152
|
+
: c?.email
|
|
153
|
+
? String(c.email)
|
|
154
|
+
: undefined,
|
|
155
|
+
url: typeof c?.url === "string"
|
|
156
|
+
? c.url
|
|
157
|
+
: c?.url
|
|
158
|
+
? String(c.url)
|
|
159
|
+
: undefined,
|
|
121
160
|
};
|
|
122
161
|
});
|
|
123
162
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mcp-server.js","sourceRoot":"","sources":["../../src/mcp-server.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,EAAE,SAAS,IAAI,GAAG,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"mcp-server.js","sourceRoot":"","sources":["../../src/mcp-server.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WA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AAI;qBACnC,CAAC,CAAC;oBACH,MAAM;gBACR;oBACE,MAAM,IAAI,KAAK,CAAC,2BAA2B,aAAa,EAAE,CAAC,CAAC;YAChE,CAAC;QACH,CAAC;QACD,OAAO,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,aAAa,CAAC,CAAC;IAC5C,CAAC;CACF"}
|
package/lib/esm/version.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const VERSION = "0.4.
|
|
1
|
+
export declare const VERSION = "0.4.7";
|
|
2
2
|
export declare const PACKAGE_NAME = "@decaf-ts/mcp-server";
|
package/lib/esm/version.js
CHANGED
package/lib/mcp-server.cjs
CHANGED
|
@@ -35,7 +35,7 @@ var __importStar = (this && this.__importStar) || (function () {
|
|
|
35
35
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
36
|
exports.McpServer = void 0;
|
|
37
37
|
const logging_1 = require("@decaf-ts/logging");
|
|
38
|
-
const
|
|
38
|
+
const mcp_1 = require("@modelcontextprotocol/sdk/server/mcp");
|
|
39
39
|
const banner_1 = require("./utils/banner.cjs");
|
|
40
40
|
const tools_1 = require("./tools/index.cjs");
|
|
41
41
|
const prompts_1 = require("./prompts/index.cjs");
|
|
@@ -69,7 +69,6 @@ class McpServer extends logging_1.LoggedClass {
|
|
|
69
69
|
try {
|
|
70
70
|
// dynamic import so this code runs at runtime and picks up whatever the module exports
|
|
71
71
|
// (uses the same resolution as the static imports above)
|
|
72
|
-
// eslint-disable-next-line @typescript-eslint/no-var-requires
|
|
73
72
|
const toolsModule = await Promise.resolve().then(() => __importStar(require("./tools")));
|
|
74
73
|
const candidates = Object.values(toolsModule).filter((v) => v && typeof v.build === "function");
|
|
75
74
|
// remove duplicates that are already present in Tools (by identity)
|
|
@@ -94,15 +93,21 @@ class McpServer extends logging_1.LoggedClass {
|
|
|
94
93
|
const log = this.log;
|
|
95
94
|
this.log.for(this.boot).info("McpServer booting...");
|
|
96
95
|
(0, banner_1.printBanner)(this.log);
|
|
97
|
-
const iconsRaw = Array.isArray(environment_1.Environment.icons)
|
|
96
|
+
const iconsRaw = Array.isArray(environment_1.Environment.icons)
|
|
97
|
+
? environment_1.Environment.icons
|
|
98
|
+
: [environment_1.Environment.icons];
|
|
98
99
|
const normalizedIcons = (iconsRaw || []).map((i) => {
|
|
99
|
-
const src = typeof i?.src ===
|
|
100
|
-
const mimeType = typeof i?.mimeType ===
|
|
100
|
+
const src = typeof i?.src === "string" ? i.src : String(i?.src ?? "");
|
|
101
|
+
const mimeType = typeof i?.mimeType === "string"
|
|
102
|
+
? i.mimeType
|
|
103
|
+
: String(i?.mimeType ?? "");
|
|
101
104
|
let sizes = [];
|
|
102
105
|
if (Array.isArray(i?.sizes))
|
|
103
106
|
sizes = i.sizes.map((s) => String(s));
|
|
104
|
-
else if (typeof i?.sizes ===
|
|
105
|
-
sizes = String(i.sizes)
|
|
107
|
+
else if (typeof i?.sizes === "string")
|
|
108
|
+
sizes = String(i.sizes)
|
|
109
|
+
.split(",")
|
|
110
|
+
.map((s) => s.trim());
|
|
106
111
|
return { src, mimeType, sizes };
|
|
107
112
|
});
|
|
108
113
|
// Normalize contacts: Environment may expose proxies or array-like objects
|
|
@@ -114,21 +119,39 @@ class McpServer extends logging_1.LoggedClass {
|
|
|
114
119
|
if (Array.isArray(contactsRaw)) {
|
|
115
120
|
normalizedContacts = contactsRaw.map((c) => ({
|
|
116
121
|
name: typeof c?.name === "string" ? c.name : String(c?.name ?? ""),
|
|
117
|
-
email: typeof c?.email === "string"
|
|
118
|
-
|
|
122
|
+
email: typeof c?.email === "string"
|
|
123
|
+
? c.email
|
|
124
|
+
: c?.email
|
|
125
|
+
? String(c.email)
|
|
126
|
+
: undefined,
|
|
127
|
+
url: typeof c?.url === "string"
|
|
128
|
+
? c.url
|
|
129
|
+
: c?.url
|
|
130
|
+
? String(c.url)
|
|
131
|
+
: undefined,
|
|
119
132
|
}));
|
|
120
133
|
}
|
|
121
134
|
else if (typeof contactsRaw === "object") {
|
|
122
135
|
// Prefer numeric-indexed properties if present (handles array-like proxies)
|
|
123
136
|
const keys = Object.keys(contactsRaw || {});
|
|
124
|
-
const numericKeys = keys
|
|
137
|
+
const numericKeys = keys
|
|
138
|
+
.filter((k) => /^[0-9]+$/.test(k))
|
|
139
|
+
.sort((a, b) => Number(a) - Number(b));
|
|
125
140
|
if (numericKeys.length > 0) {
|
|
126
141
|
normalizedContacts = numericKeys.map((k) => {
|
|
127
142
|
const c = contactsRaw[k];
|
|
128
143
|
return {
|
|
129
144
|
name: typeof c?.name === "string" ? c.name : String(c?.name ?? ""),
|
|
130
|
-
email: typeof c?.email === "string"
|
|
131
|
-
|
|
145
|
+
email: typeof c?.email === "string"
|
|
146
|
+
? c.email
|
|
147
|
+
: c?.email
|
|
148
|
+
? String(c.email)
|
|
149
|
+
: undefined,
|
|
150
|
+
url: typeof c?.url === "string"
|
|
151
|
+
? c.url
|
|
152
|
+
: c?.url
|
|
153
|
+
? String(c.url)
|
|
154
|
+
: undefined,
|
|
132
155
|
};
|
|
133
156
|
});
|
|
134
157
|
}
|
|
@@ -139,8 +162,16 @@ class McpServer extends logging_1.LoggedClass {
|
|
|
139
162
|
const c = contactsRaw[i];
|
|
140
163
|
normalizedContacts.push({
|
|
141
164
|
name: typeof c?.name === "string" ? c.name : String(c?.name ?? ""),
|
|
142
|
-
email: typeof c?.email === "string"
|
|
143
|
-
|
|
165
|
+
email: typeof c?.email === "string"
|
|
166
|
+
? c.email
|
|
167
|
+
: c?.email
|
|
168
|
+
? String(c.email)
|
|
169
|
+
: undefined,
|
|
170
|
+
url: typeof c?.url === "string"
|
|
171
|
+
? c.url
|
|
172
|
+
: c?.url
|
|
173
|
+
? String(c.url)
|
|
174
|
+
: undefined,
|
|
144
175
|
});
|
|
145
176
|
}
|
|
146
177
|
}
|
|
@@ -152,8 +183,16 @@ class McpServer extends logging_1.LoggedClass {
|
|
|
152
183
|
const c = contactsRaw[k];
|
|
153
184
|
return {
|
|
154
185
|
name: typeof c?.name === "string" ? c.name : String(c?.name ?? ""),
|
|
155
|
-
email: typeof c?.email === "string"
|
|
156
|
-
|
|
186
|
+
email: typeof c?.email === "string"
|
|
187
|
+
? c.email
|
|
188
|
+
: c?.email
|
|
189
|
+
? String(c.email)
|
|
190
|
+
: undefined,
|
|
191
|
+
url: typeof c?.url === "string"
|
|
192
|
+
? c.url
|
|
193
|
+
: c?.url
|
|
194
|
+
? String(c.url)
|
|
195
|
+
: undefined,
|
|
157
196
|
};
|
|
158
197
|
});
|
|
159
198
|
}
|
|
@@ -190,7 +229,7 @@ class McpServer extends logging_1.LoggedClass {
|
|
|
190
229
|
},
|
|
191
230
|
},
|
|
192
231
|
};
|
|
193
|
-
this._mcp = new
|
|
232
|
+
this._mcp = new mcp_1.McpServer(serverInfo, options);
|
|
194
233
|
try {
|
|
195
234
|
await this.load();
|
|
196
235
|
}
|
package/lib/mcp-server.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { LoggedClass } from "@decaf-ts/logging";
|
|
2
|
-
import { McpServer as MCP } from "@modelcontextprotocol/sdk/server/mcp
|
|
2
|
+
import { McpServer as MCP } from "@modelcontextprotocol/sdk/server/mcp";
|
|
3
3
|
import { Transport } from "@modelcontextprotocol/sdk/shared/transport";
|
|
4
4
|
export declare class McpServer extends LoggedClass {
|
|
5
5
|
private _mcp?;
|
package/lib/mcp-server.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mcp-server.js","sourceRoot":"","sources":["../src/mcp-server.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,+CAAgD;AAChD,
|
|
1
|
+
{"version":3,"file":"mcp-server.js","sourceRoot":"","sources":["../src/mcp-server.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,+CAAgD;AAChD,8DAAwE;AACxE,+CAA6C;AAC7C,6CAAgC;AAChC,iDAAoC;AACpC,q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AAC,CAAC;QACzC,IAAI,CAAC;YACH,MAAM,IAAI,CAAC,IAAI,EAAE,CAAC;QACpB,CAAC;QAAC,OAAO,GAAG,EAAE,CAAC;YACb,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,0CAA0C,GAAG,EAAE,CAAC,CAAC;YAChE,MAAM,GAAG,CAAC;QACZ,CAAC;QACD,IAAI,OAAO,aAAa,KAAK,QAAQ,EAAE,CAAC;YACtC,QAAQ,aAAa,EAAE,CAAC;gBACtB,KAAK,OAAO;oBACV,aAAa,GAAG,IAAI,4BAAoB,EAAE,CAAC;oBAC3C,MAAM;gBACR,KAAK,MAAM;oBACT,aAAa,GAAG,IAAI,8CAA6B,CAAC;wBAChD,kBAAkB,EAAE,GAAG,EAAE,CAAC,IAAA,SAAE,GAAE;wBAC9B,oBAAoB,EAAE,CAAC,SAAiB,EAAE,EAAE,CAC1C,GAAG,CAAC,OAAO,CAAC,wBAAwB,SAAS,EAAE,CAAC;wBAClD,eAAe,EAAE,CAAC,SAAiB,EAAE,EAAE,CACrC,GAAG,CAAC,OAAO,CAAC,mBAAmB,SAAS,EAAE,CAAC;wBAC7C,kBAAkB,EAAE,IAAI;wBACxB,UAAU,EAAE,SAAS;wBACrB,YAAY,EAAE,CAAC,GAAG,CAAC;wBACnB,cAAc,EAAE,CAAC,GAAG,CAAC;wBACrB,4BAA4B,EAAE,IAAI;qBACnC,CAAC,CAAC;oBACH,MAAM;gBACR;oBACE,MAAM,IAAI,KAAK,CAAC,2BAA2B,aAAa,EAAE,CAAC,CAAC;YAChE,CAAC;QACH,CAAC;QACD,OAAO,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,aAAa,CAAC,CAAC;IAC5C,CAAC;CACF;AAxPD,8BAwPC"}
|
package/lib/version.cjs
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.PACKAGE_NAME = exports.VERSION = void 0;
|
|
4
4
|
const decoration_1 = require("@decaf-ts/decoration");
|
|
5
|
-
exports.VERSION = "0.4.
|
|
5
|
+
exports.VERSION = "0.4.7";
|
|
6
6
|
exports.PACKAGE_NAME = "@decaf-ts/mcp-server";
|
|
7
7
|
decoration_1.Metadata.registerLibrary(exports.PACKAGE_NAME, exports.VERSION);
|
|
8
8
|
//# sourceMappingURL=version.js.map
|
package/lib/version.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const VERSION = "0.4.
|
|
1
|
+
export declare const VERSION = "0.4.7";
|
|
2
2
|
export declare const PACKAGE_NAME = "@decaf-ts/mcp-server";
|
package/package.json
CHANGED