@mondaydotcomorg/agent-toolkit 2.0.8 → 2.0.9
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/cjs/mcp/index.d.ts +1 -1
- package/dist/cjs/mcp/index.js +1 -1
- package/dist/cjs/mcp/index.js.map +1 -1
- package/dist/cjs/openai/index.d.ts +1 -1
- package/dist/cjs/openai/index.js +1 -1
- package/dist/cjs/openai/index.js.map +1 -1
- package/dist/esm/mcp/index.d.ts +1 -1
- package/dist/esm/mcp/index.js +1 -1
- package/dist/esm/mcp/index.js.map +1 -1
- package/dist/esm/openai/index.d.ts +1 -1
- package/dist/esm/openai/index.js +3 -3
- package/dist/esm/openai/index.js.map +1 -1
- package/package.json +1 -1
package/dist/cjs/openai/index.js
CHANGED
|
@@ -392,5 +392,5 @@
|
|
|
392
392
|
}
|
|
393
393
|
}
|
|
394
394
|
}
|
|
395
|
-
`),d=await this.mondayApi.request(a);if(!d.__type)return{content:`Type '${e.typeName}' not found in the GraphQL schema. Please check the type name and try again.`};let t=`## Type: ${d.__type.name||"Unnamed"} ${e.typeName===d.__type.name?"":`(queried: ${e.typeName})`}\nKind: ${d.__type.kind}\n${d.__type.description?`Description: ${d.__type.description}`:""}\n\n`;return d.__type.fields&&d.__type.fields.length>0&&(t+="## Fields\n",d.__type.fields.forEach((e=>{const p=gn(e.type);t+=`- ${e.name}: ${p}${e.description?` - ${e.description}`:""}\n`,e.args&&e.args.length>0&&(t+=" Arguments:\n",e.args.forEach((e=>{const p=gn(e.type);t+=` - ${e.name}: ${p}${e.description?` - ${e.description}`:""}${e.defaultValue?` (default: ${e.defaultValue})`:""}\n`})))})),t+="\n"),d.__type.inputFields&&d.__type.inputFields.length>0&&(t+="## Input Fields\n",d.__type.inputFields.forEach((e=>{const p=gn(e.type);t+=`- ${e.name}: ${p}${e.description?` - ${e.description}`:""}${e.defaultValue?` (default: ${e.defaultValue})`:""}\n`})),t+="\n"),d.__type.interfaces&&d.__type.interfaces.length>0&&(t+="## Implements\n",d.__type.interfaces.forEach((e=>{t+=`- ${e.name}\n`})),t+="\n"),d.__type.enumValues&&d.__type.enumValues.length>0&&(t+="## Enum Values\n",d.__type.enumValues.forEach((e=>{t+=`- ${e.name}${e.description?` - ${e.description}`:""}\n`})),t+="\n"),d.__type.possibleTypes&&d.__type.possibleTypes.length>0&&(t+="## Possible Types\n",d.__type.possibleTypes.forEach((e=>{t+=`- ${e.name}\n`}))),t+=`\n## Usage Examples\nIf this is a Query or Mutation field, you can use it in the all_monday_api tool.\n\nExample for query:\nall_monday_api(operation: "query", name: "getTypeData", variables: "{\\"typeName\\": \\"${d.__type.name}\\"}")\n\nExample for object field access:\nWhen querying objects that have this type, include these fields in your query.\n`,{content:t}}catch(e){const p=e instanceof Error?e.message:"Unknown error",a=p.includes("JSON");return{content:`Error fetching type details: ${p}${a?"\n\nThis could be because the type name is incorrect or the GraphQL query format is invalid. Please check the type name and try again.":""}`}}var p}},class extends _{constructor(){super(...arguments),this.name="create_custom_activity",this.type=l.MUTATION}getDescription(){return"Create a new custom activity in the E&A app"}getInputSchema(){return En}async execute(e){const p={color:e.color,icon_id:e.icon_id,name:e.name};return await this.mondayApi.request(Xt,p),{content:`Custom activity '${e.name}' with color ${e.color} and icon ${e.icon_id} successfully created`}}},class extends _{constructor(){super(...arguments),this.name="create_timeline_item",this.type=l.MUTATION}getDescription(){return"Create a new timeline item in the E&A app"}getInputSchema(){return bn}async execute(e){const p={item_id:e.item_id.toString(),custom_activity_id:e.custom_activity_id,title:e.title,timestamp:e.timestamp,summary:e.summary,content:e.content,location:e.location,phone:e.phone,url:e.url};e.start_timestamp&&e.end_timestamp&&(p.time_range={start_timestamp:e.start_timestamp,end_timestamp:e.end_timestamp});const a=await this.mondayApi.request(Wt,p);return{content:`Timeline item '${e.title}' with ID ${a.create_timeline_item?.id} successfully created on item ${e.item_id}`}}},class extends _{constructor(){super(...arguments),this.name="fetch_custom_activity",this.type=l.QUERY}getDescription(){return"Get custom activities from the E&A app"}getInputSchema(){return In}async execute(e){const p=await this.mondayApi.request(Zt);if(!p.custom_activity||0===p.custom_activity.length)return{content:"No custom activities found"};const a=p.custom_activity.map((e=>({id:e.id,name:e.name,color:e.color,icon_id:e.icon_id,type:e.type})));return{content:`Found ${a.length} custom activities: ${JSON.stringify(a,null,2)}`}}}];exports.MondayAgentToolkit=class{constructor(p){this.mondayApi=new e.ApiClient({token:p.mondayApiToken,apiVersion:p.mondayApiVersion,requestConfig:p.mondayApiRequestConfig});const a=function(e,p,a){if(!a)return e;let d=e;return a.enableDynamicApiTools&&!a.readOnlyMode
|
|
395
|
+
`),d=await this.mondayApi.request(a);if(!d.__type)return{content:`Type '${e.typeName}' not found in the GraphQL schema. Please check the type name and try again.`};let t=`## Type: ${d.__type.name||"Unnamed"} ${e.typeName===d.__type.name?"":`(queried: ${e.typeName})`}\nKind: ${d.__type.kind}\n${d.__type.description?`Description: ${d.__type.description}`:""}\n\n`;return d.__type.fields&&d.__type.fields.length>0&&(t+="## Fields\n",d.__type.fields.forEach((e=>{const p=gn(e.type);t+=`- ${e.name}: ${p}${e.description?` - ${e.description}`:""}\n`,e.args&&e.args.length>0&&(t+=" Arguments:\n",e.args.forEach((e=>{const p=gn(e.type);t+=` - ${e.name}: ${p}${e.description?` - ${e.description}`:""}${e.defaultValue?` (default: ${e.defaultValue})`:""}\n`})))})),t+="\n"),d.__type.inputFields&&d.__type.inputFields.length>0&&(t+="## Input Fields\n",d.__type.inputFields.forEach((e=>{const p=gn(e.type);t+=`- ${e.name}: ${p}${e.description?` - ${e.description}`:""}${e.defaultValue?` (default: ${e.defaultValue})`:""}\n`})),t+="\n"),d.__type.interfaces&&d.__type.interfaces.length>0&&(t+="## Implements\n",d.__type.interfaces.forEach((e=>{t+=`- ${e.name}\n`})),t+="\n"),d.__type.enumValues&&d.__type.enumValues.length>0&&(t+="## Enum Values\n",d.__type.enumValues.forEach((e=>{t+=`- ${e.name}${e.description?` - ${e.description}`:""}\n`})),t+="\n"),d.__type.possibleTypes&&d.__type.possibleTypes.length>0&&(t+="## Possible Types\n",d.__type.possibleTypes.forEach((e=>{t+=`- ${e.name}\n`}))),t+=`\n## Usage Examples\nIf this is a Query or Mutation field, you can use it in the all_monday_api tool.\n\nExample for query:\nall_monday_api(operation: "query", name: "getTypeData", variables: "{\\"typeName\\": \\"${d.__type.name}\\"}")\n\nExample for object field access:\nWhen querying objects that have this type, include these fields in your query.\n`,{content:t}}catch(e){const p=e instanceof Error?e.message:"Unknown error",a=p.includes("JSON");return{content:`Error fetching type details: ${p}${a?"\n\nThis could be because the type name is incorrect or the GraphQL query format is invalid. Please check the type name and try again.":""}`}}var p}},class extends _{constructor(){super(...arguments),this.name="create_custom_activity",this.type=l.MUTATION}getDescription(){return"Create a new custom activity in the E&A app"}getInputSchema(){return En}async execute(e){const p={color:e.color,icon_id:e.icon_id,name:e.name};return await this.mondayApi.request(Xt,p),{content:`Custom activity '${e.name}' with color ${e.color} and icon ${e.icon_id} successfully created`}}},class extends _{constructor(){super(...arguments),this.name="create_timeline_item",this.type=l.MUTATION}getDescription(){return"Create a new timeline item in the E&A app"}getInputSchema(){return bn}async execute(e){const p={item_id:e.item_id.toString(),custom_activity_id:e.custom_activity_id,title:e.title,timestamp:e.timestamp,summary:e.summary,content:e.content,location:e.location,phone:e.phone,url:e.url};e.start_timestamp&&e.end_timestamp&&(p.time_range={start_timestamp:e.start_timestamp,end_timestamp:e.end_timestamp});const a=await this.mondayApi.request(Wt,p);return{content:`Timeline item '${e.title}' with ID ${a.create_timeline_item?.id} successfully created on item ${e.item_id}`}}},class extends _{constructor(){super(...arguments),this.name="fetch_custom_activity",this.type=l.QUERY}getDescription(){return"Get custom activities from the E&A app"}getInputSchema(){return In}async execute(e){const p=await this.mondayApi.request(Zt);if(!p.custom_activity||0===p.custom_activity.length)return{content:"No custom activities found"};const a=p.custom_activity.map((e=>({id:e.id,name:e.name,color:e.color,icon_id:e.icon_id,type:e.type})));return{content:`Found ${a.length} custom activities: ${JSON.stringify(a,null,2)}`}}}];exports.MondayAgentToolkit=class{constructor(p){this.mondayApi=new e.ApiClient({token:p.mondayApiToken,apiVersion:p.mondayApiVersion,requestConfig:p.mondayApiRequestConfig});const a=function(e,p,a){if(!a)return e;let d=e;return a.enableDynamicApiTools&&!a.readOnlyMode?"only"===a.enableDynamicApiTools?e.filter((e=>new e(p).type===l.ALL_API)):d:(d=d.filter((e=>new e(p).type!==l.ALL_API)),a.include?d=e.filter((e=>{const d=new e(p);return a.include?.includes(d.name)})):a.exclude&&(d=e.filter((e=>{const d=new e(p);return!a.exclude?.includes(d.name)}))),a.readOnlyMode&&(d=d.filter((e=>new e(p).type===l.QUERY))),d)}(Dn,this.mondayApi,p.toolsConfiguration);this.tools=a.map((e=>new e(this.mondayApi)))}getTools(){return this.tools.map((e=>{const d=e.getInputSchema();return{type:"function",function:{name:e.name,description:e.getDescription(),parameters:d?p.zodToJsonSchema(a.z.object(d)):void 0}}}))}async handleToolCall(e){const{name:p,arguments:d}=e.function,t=JSON.parse(d),i=this.tools.find((e=>e.name===p));if(!i)throw new Error(`Unknown tool: ${p}`);const n=a.z.object(i.getInputSchema()).safeParse(t);if(!n.success)throw new Error(`Invalid arguments: ${n.error.message}`);const o=await i.execute(n.data);return{role:"tool",tool_call_id:e.id,content:o.content}}};
|
|
396
396
|
//# sourceMappingURL=index.js.map
|