digital-tools 2.0.1
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/.turbo/turbo-build.log +5 -0
- package/CHANGELOG.md +9 -0
- package/README.md +1144 -0
- package/dist/define.d.ts +109 -0
- package/dist/define.d.ts.map +1 -0
- package/dist/define.js +268 -0
- package/dist/define.js.map +1 -0
- package/dist/entities/advertising.d.ts +79 -0
- package/dist/entities/advertising.d.ts.map +1 -0
- package/dist/entities/advertising.js +1000 -0
- package/dist/entities/advertising.js.map +1 -0
- package/dist/entities/ai.d.ts +69 -0
- package/dist/entities/ai.d.ts.map +1 -0
- package/dist/entities/ai.js +757 -0
- package/dist/entities/ai.js.map +1 -0
- package/dist/entities/analytics.d.ts +83 -0
- package/dist/entities/analytics.d.ts.map +1 -0
- package/dist/entities/analytics.js +1589 -0
- package/dist/entities/analytics.js.map +1 -0
- package/dist/entities/automation.d.ts +61 -0
- package/dist/entities/automation.d.ts.map +1 -0
- package/dist/entities/automation.js +602 -0
- package/dist/entities/automation.js.map +1 -0
- package/dist/entities/communication.d.ts +96 -0
- package/dist/entities/communication.d.ts.map +1 -0
- package/dist/entities/communication.js +1151 -0
- package/dist/entities/communication.js.map +1 -0
- package/dist/entities/crm.d.ts +91 -0
- package/dist/entities/crm.d.ts.map +1 -0
- package/dist/entities/crm.js +1387 -0
- package/dist/entities/crm.js.map +1 -0
- package/dist/entities/design.d.ts +61 -0
- package/dist/entities/design.d.ts.map +1 -0
- package/dist/entities/design.js +547 -0
- package/dist/entities/design.js.map +1 -0
- package/dist/entities/development.d.ts +145 -0
- package/dist/entities/development.d.ts.map +1 -0
- package/dist/entities/development.js +2213 -0
- package/dist/entities/development.js.map +1 -0
- package/dist/entities/document.d.ts +54 -0
- package/dist/entities/document.d.ts.map +1 -0
- package/dist/entities/document.js +875 -0
- package/dist/entities/document.js.map +1 -0
- package/dist/entities/ecommerce.d.ts +93 -0
- package/dist/entities/ecommerce.d.ts.map +1 -0
- package/dist/entities/ecommerce.js +1430 -0
- package/dist/entities/ecommerce.js.map +1 -0
- package/dist/entities/experiment.d.ts +89 -0
- package/dist/entities/experiment.d.ts.map +1 -0
- package/dist/entities/experiment.js +1040 -0
- package/dist/entities/experiment.js.map +1 -0
- package/dist/entities/finance.d.ts +272 -0
- package/dist/entities/finance.d.ts.map +1 -0
- package/dist/entities/finance.js +3479 -0
- package/dist/entities/finance.js.map +1 -0
- package/dist/entities/forms.d.ts +91 -0
- package/dist/entities/forms.d.ts.map +1 -0
- package/dist/entities/forms.js +1893 -0
- package/dist/entities/forms.js.map +1 -0
- package/dist/entities/hr.d.ts +62 -0
- package/dist/entities/hr.d.ts.map +1 -0
- package/dist/entities/hr.js +662 -0
- package/dist/entities/hr.js.map +1 -0
- package/dist/entities/identity.d.ts +90 -0
- package/dist/entities/identity.d.ts.map +1 -0
- package/dist/entities/identity.js +998 -0
- package/dist/entities/identity.js.map +1 -0
- package/dist/entities/index.d.ts +410 -0
- package/dist/entities/index.d.ts.map +1 -0
- package/dist/entities/index.js +283 -0
- package/dist/entities/index.js.map +1 -0
- package/dist/entities/infrastructure.d.ts +98 -0
- package/dist/entities/infrastructure.d.ts.map +1 -0
- package/dist/entities/infrastructure.js +1154 -0
- package/dist/entities/infrastructure.js.map +1 -0
- package/dist/entities/knowledge.d.ts +98 -0
- package/dist/entities/knowledge.d.ts.map +1 -0
- package/dist/entities/knowledge.js +1439 -0
- package/dist/entities/knowledge.js.map +1 -0
- package/dist/entities/marketing.d.ts +82 -0
- package/dist/entities/marketing.d.ts.map +1 -0
- package/dist/entities/marketing.js +1611 -0
- package/dist/entities/marketing.js.map +1 -0
- package/dist/entities/media.d.ts +83 -0
- package/dist/entities/media.d.ts.map +1 -0
- package/dist/entities/media.js +1635 -0
- package/dist/entities/media.js.map +1 -0
- package/dist/entities/notification.d.ts +76 -0
- package/dist/entities/notification.d.ts.map +1 -0
- package/dist/entities/notification.js +1200 -0
- package/dist/entities/notification.js.map +1 -0
- package/dist/entities/presentation.d.ts +61 -0
- package/dist/entities/presentation.d.ts.map +1 -0
- package/dist/entities/presentation.js +1275 -0
- package/dist/entities/presentation.js.map +1 -0
- package/dist/entities/productivity.d.ts +92 -0
- package/dist/entities/productivity.d.ts.map +1 -0
- package/dist/entities/productivity.js +1318 -0
- package/dist/entities/productivity.js.map +1 -0
- package/dist/entities/project-management.d.ts +89 -0
- package/dist/entities/project-management.d.ts.map +1 -0
- package/dist/entities/project-management.js +1137 -0
- package/dist/entities/project-management.js.map +1 -0
- package/dist/entities/recruiting.d.ts +54 -0
- package/dist/entities/recruiting.d.ts.map +1 -0
- package/dist/entities/recruiting.js +737 -0
- package/dist/entities/recruiting.js.map +1 -0
- package/dist/entities/shipping.d.ts +52 -0
- package/dist/entities/shipping.d.ts.map +1 -0
- package/dist/entities/shipping.js +510 -0
- package/dist/entities/shipping.js.map +1 -0
- package/dist/entities/signature.d.ts +83 -0
- package/dist/entities/signature.d.ts.map +1 -0
- package/dist/entities/signature.js +1103 -0
- package/dist/entities/signature.js.map +1 -0
- package/dist/entities/site.d.ts +33 -0
- package/dist/entities/site.d.ts.map +1 -0
- package/dist/entities/site.js +223 -0
- package/dist/entities/site.js.map +1 -0
- package/dist/entities/spreadsheet.d.ts +68 -0
- package/dist/entities/spreadsheet.d.ts.map +1 -0
- package/dist/entities/spreadsheet.js +1342 -0
- package/dist/entities/spreadsheet.js.map +1 -0
- package/dist/entities/storage.d.ts +74 -0
- package/dist/entities/storage.d.ts.map +1 -0
- package/dist/entities/storage.js +1199 -0
- package/dist/entities/storage.js.map +1 -0
- package/dist/entities/support.d.ts +83 -0
- package/dist/entities/support.d.ts.map +1 -0
- package/dist/entities/support.js +1167 -0
- package/dist/entities/support.js.map +1 -0
- package/dist/entities/video-conferencing.d.ts +129 -0
- package/dist/entities/video-conferencing.d.ts.map +1 -0
- package/dist/entities/video-conferencing.js +1751 -0
- package/dist/entities/video-conferencing.js.map +1 -0
- package/dist/entities/video.d.ts +76 -0
- package/dist/entities/video.d.ts.map +1 -0
- package/dist/entities/video.js +951 -0
- package/dist/entities/video.js.map +1 -0
- package/dist/entities.d.ts +147 -0
- package/dist/entities.d.ts.map +1 -0
- package/dist/entities.js +1664 -0
- package/dist/entities.js.map +1 -0
- package/dist/index.d.ts +29 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +75 -0
- package/dist/index.js.map +1 -0
- package/dist/providers/analytics/index.d.ts +19 -0
- package/dist/providers/analytics/index.d.ts.map +1 -0
- package/dist/providers/analytics/index.js +18 -0
- package/dist/providers/analytics/index.js.map +1 -0
- package/dist/providers/analytics/mixpanel.d.ts +25 -0
- package/dist/providers/analytics/mixpanel.d.ts.map +1 -0
- package/dist/providers/analytics/mixpanel.js +256 -0
- package/dist/providers/analytics/mixpanel.js.map +1 -0
- package/dist/providers/calendar/cal-com.d.ts +26 -0
- package/dist/providers/calendar/cal-com.d.ts.map +1 -0
- package/dist/providers/calendar/cal-com.js +304 -0
- package/dist/providers/calendar/cal-com.js.map +1 -0
- package/dist/providers/calendar/google-calendar.d.ts +25 -0
- package/dist/providers/calendar/google-calendar.d.ts.map +1 -0
- package/dist/providers/calendar/google-calendar.js +336 -0
- package/dist/providers/calendar/google-calendar.js.map +1 -0
- package/dist/providers/calendar/index.d.ts +20 -0
- package/dist/providers/calendar/index.d.ts.map +1 -0
- package/dist/providers/calendar/index.js +21 -0
- package/dist/providers/calendar/index.js.map +1 -0
- package/dist/providers/crm/hubspot.d.ts +25 -0
- package/dist/providers/crm/hubspot.d.ts.map +1 -0
- package/dist/providers/crm/hubspot.js +567 -0
- package/dist/providers/crm/hubspot.js.map +1 -0
- package/dist/providers/crm/index.d.ts +19 -0
- package/dist/providers/crm/index.d.ts.map +1 -0
- package/dist/providers/crm/index.js +18 -0
- package/dist/providers/crm/index.js.map +1 -0
- package/dist/providers/development/github.d.ts +25 -0
- package/dist/providers/development/github.d.ts.map +1 -0
- package/dist/providers/development/github.js +473 -0
- package/dist/providers/development/github.js.map +1 -0
- package/dist/providers/development/index.d.ts +19 -0
- package/dist/providers/development/index.d.ts.map +1 -0
- package/dist/providers/development/index.js +18 -0
- package/dist/providers/development/index.js.map +1 -0
- package/dist/providers/ecommerce/index.d.ts +19 -0
- package/dist/providers/ecommerce/index.d.ts.map +1 -0
- package/dist/providers/ecommerce/index.js +18 -0
- package/dist/providers/ecommerce/index.js.map +1 -0
- package/dist/providers/ecommerce/shopify.d.ts +25 -0
- package/dist/providers/ecommerce/shopify.d.ts.map +1 -0
- package/dist/providers/ecommerce/shopify.js +379 -0
- package/dist/providers/ecommerce/shopify.js.map +1 -0
- package/dist/providers/email/index.d.ts +20 -0
- package/dist/providers/email/index.d.ts.map +1 -0
- package/dist/providers/email/index.js +21 -0
- package/dist/providers/email/index.js.map +1 -0
- package/dist/providers/email/resend.d.ts +25 -0
- package/dist/providers/email/resend.d.ts.map +1 -0
- package/dist/providers/email/resend.js +259 -0
- package/dist/providers/email/resend.js.map +1 -0
- package/dist/providers/email/sendgrid.d.ts +25 -0
- package/dist/providers/email/sendgrid.d.ts.map +1 -0
- package/dist/providers/email/sendgrid.js +162 -0
- package/dist/providers/email/sendgrid.js.map +1 -0
- package/dist/providers/finance/index.d.ts +19 -0
- package/dist/providers/finance/index.d.ts.map +1 -0
- package/dist/providers/finance/index.js +18 -0
- package/dist/providers/finance/index.js.map +1 -0
- package/dist/providers/finance/stripe.d.ts +25 -0
- package/dist/providers/finance/stripe.d.ts.map +1 -0
- package/dist/providers/finance/stripe.js +550 -0
- package/dist/providers/finance/stripe.js.map +1 -0
- package/dist/providers/forms/index.d.ts +19 -0
- package/dist/providers/forms/index.d.ts.map +1 -0
- package/dist/providers/forms/index.js +18 -0
- package/dist/providers/forms/index.js.map +1 -0
- package/dist/providers/forms/typeform.d.ts +25 -0
- package/dist/providers/forms/typeform.d.ts.map +1 -0
- package/dist/providers/forms/typeform.js +501 -0
- package/dist/providers/forms/typeform.js.map +1 -0
- package/dist/providers/index.d.ts +56 -0
- package/dist/providers/index.d.ts.map +1 -0
- package/dist/providers/index.js +124 -0
- package/dist/providers/index.js.map +1 -0
- package/dist/providers/knowledge/index.d.ts +19 -0
- package/dist/providers/knowledge/index.d.ts.map +1 -0
- package/dist/providers/knowledge/index.js +18 -0
- package/dist/providers/knowledge/index.js.map +1 -0
- package/dist/providers/knowledge/notion.d.ts +25 -0
- package/dist/providers/knowledge/notion.d.ts.map +1 -0
- package/dist/providers/knowledge/notion.js +390 -0
- package/dist/providers/knowledge/notion.js.map +1 -0
- package/dist/providers/marketing/index.d.ts +19 -0
- package/dist/providers/marketing/index.d.ts.map +1 -0
- package/dist/providers/marketing/index.js +18 -0
- package/dist/providers/marketing/index.js.map +1 -0
- package/dist/providers/marketing/mailchimp.d.ts +25 -0
- package/dist/providers/marketing/mailchimp.d.ts.map +1 -0
- package/dist/providers/marketing/mailchimp.js +444 -0
- package/dist/providers/marketing/mailchimp.js.map +1 -0
- package/dist/providers/media/cloudinary.d.ts +25 -0
- package/dist/providers/media/cloudinary.d.ts.map +1 -0
- package/dist/providers/media/cloudinary.js +319 -0
- package/dist/providers/media/cloudinary.js.map +1 -0
- package/dist/providers/media/index.d.ts +19 -0
- package/dist/providers/media/index.d.ts.map +1 -0
- package/dist/providers/media/index.js +18 -0
- package/dist/providers/media/index.js.map +1 -0
- package/dist/providers/messaging/index.d.ts +24 -0
- package/dist/providers/messaging/index.d.ts.map +1 -0
- package/dist/providers/messaging/index.js +21 -0
- package/dist/providers/messaging/index.js.map +1 -0
- package/dist/providers/messaging/slack.d.ts +25 -0
- package/dist/providers/messaging/slack.d.ts.map +1 -0
- package/dist/providers/messaging/slack.js +394 -0
- package/dist/providers/messaging/slack.js.map +1 -0
- package/dist/providers/messaging/twilio-sms.d.ts +25 -0
- package/dist/providers/messaging/twilio-sms.d.ts.map +1 -0
- package/dist/providers/messaging/twilio-sms.js +250 -0
- package/dist/providers/messaging/twilio-sms.js.map +1 -0
- package/dist/providers/project-management/index.d.ts +19 -0
- package/dist/providers/project-management/index.d.ts.map +1 -0
- package/dist/providers/project-management/index.js +18 -0
- package/dist/providers/project-management/index.js.map +1 -0
- package/dist/providers/project-management/linear.d.ts +25 -0
- package/dist/providers/project-management/linear.d.ts.map +1 -0
- package/dist/providers/project-management/linear.js +576 -0
- package/dist/providers/project-management/linear.js.map +1 -0
- package/dist/providers/registry.d.ts +41 -0
- package/dist/providers/registry.d.ts.map +1 -0
- package/dist/providers/registry.js +87 -0
- package/dist/providers/registry.js.map +1 -0
- package/dist/providers/spreadsheet/google-sheets.d.ts +25 -0
- package/dist/providers/spreadsheet/google-sheets.d.ts.map +1 -0
- package/dist/providers/spreadsheet/google-sheets.js +376 -0
- package/dist/providers/spreadsheet/google-sheets.js.map +1 -0
- package/dist/providers/spreadsheet/index.d.ts +20 -0
- package/dist/providers/spreadsheet/index.d.ts.map +1 -0
- package/dist/providers/spreadsheet/index.js +21 -0
- package/dist/providers/spreadsheet/index.js.map +1 -0
- package/dist/providers/spreadsheet/xlsx.d.ts +26 -0
- package/dist/providers/spreadsheet/xlsx.d.ts.map +1 -0
- package/dist/providers/spreadsheet/xlsx.js +424 -0
- package/dist/providers/spreadsheet/xlsx.js.map +1 -0
- package/dist/providers/storage/index.d.ts +30 -0
- package/dist/providers/storage/index.d.ts.map +1 -0
- package/dist/providers/storage/index.js +25 -0
- package/dist/providers/storage/index.js.map +1 -0
- package/dist/providers/storage/s3.d.ts +25 -0
- package/dist/providers/storage/s3.d.ts.map +1 -0
- package/dist/providers/storage/s3.js +420 -0
- package/dist/providers/storage/s3.js.map +1 -0
- package/dist/providers/support/index.d.ts +19 -0
- package/dist/providers/support/index.d.ts.map +1 -0
- package/dist/providers/support/index.js +18 -0
- package/dist/providers/support/index.js.map +1 -0
- package/dist/providers/support/zendesk.d.ts +25 -0
- package/dist/providers/support/zendesk.d.ts.map +1 -0
- package/dist/providers/support/zendesk.js +374 -0
- package/dist/providers/support/zendesk.js.map +1 -0
- package/dist/providers/tasks/index.d.ts +19 -0
- package/dist/providers/tasks/index.d.ts.map +1 -0
- package/dist/providers/tasks/index.js +18 -0
- package/dist/providers/tasks/index.js.map +1 -0
- package/dist/providers/tasks/todoist.d.ts +25 -0
- package/dist/providers/tasks/todoist.d.ts.map +1 -0
- package/dist/providers/tasks/todoist.js +287 -0
- package/dist/providers/tasks/todoist.js.map +1 -0
- package/dist/providers/types.d.ts +1753 -0
- package/dist/providers/types.d.ts.map +1 -0
- package/dist/providers/types.js +10 -0
- package/dist/providers/types.js.map +1 -0
- package/dist/providers/video-conferencing/google-meet.d.ts +26 -0
- package/dist/providers/video-conferencing/google-meet.d.ts.map +1 -0
- package/dist/providers/video-conferencing/google-meet.js +287 -0
- package/dist/providers/video-conferencing/google-meet.js.map +1 -0
- package/dist/providers/video-conferencing/index.d.ts +22 -0
- package/dist/providers/video-conferencing/index.d.ts.map +1 -0
- package/dist/providers/video-conferencing/index.js +32 -0
- package/dist/providers/video-conferencing/index.js.map +1 -0
- package/dist/providers/video-conferencing/jitsi.d.ts +26 -0
- package/dist/providers/video-conferencing/jitsi.d.ts.map +1 -0
- package/dist/providers/video-conferencing/jitsi.js +255 -0
- package/dist/providers/video-conferencing/jitsi.js.map +1 -0
- package/dist/providers/video-conferencing/teams.d.ts +26 -0
- package/dist/providers/video-conferencing/teams.d.ts.map +1 -0
- package/dist/providers/video-conferencing/teams.js +271 -0
- package/dist/providers/video-conferencing/teams.js.map +1 -0
- package/dist/providers/video-conferencing/zoom.d.ts +25 -0
- package/dist/providers/video-conferencing/zoom.d.ts.map +1 -0
- package/dist/providers/video-conferencing/zoom.js +333 -0
- package/dist/providers/video-conferencing/zoom.js.map +1 -0
- package/dist/providers/voice/vapi.d.ts +27 -0
- package/dist/providers/voice/vapi.d.ts.map +1 -0
- package/dist/providers/voice/vapi.js +440 -0
- package/dist/providers/voice/vapi.js.map +1 -0
- package/dist/registry.d.ts +38 -0
- package/dist/registry.d.ts.map +1 -0
- package/dist/registry.js +129 -0
- package/dist/registry.js.map +1 -0
- package/dist/tools/communication.d.ts +94 -0
- package/dist/tools/communication.d.ts.map +1 -0
- package/dist/tools/communication.js +185 -0
- package/dist/tools/communication.js.map +1 -0
- package/dist/tools/data.d.ts +61 -0
- package/dist/tools/data.d.ts.map +1 -0
- package/dist/tools/data.js +206 -0
- package/dist/tools/data.js.map +1 -0
- package/dist/tools/index.d.ts +12 -0
- package/dist/tools/index.d.ts.map +1 -0
- package/dist/tools/index.js +12 -0
- package/dist/tools/index.js.map +1 -0
- package/dist/tools/web.d.ts +45 -0
- package/dist/tools/web.d.ts.map +1 -0
- package/dist/tools/web.js +138 -0
- package/dist/tools/web.js.map +1 -0
- package/dist/types.d.ts +330 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +11 -0
- package/dist/types.js.map +1 -0
- package/package.json +45 -0
- package/src/define.ts +321 -0
- package/src/entities/advertising.ts +1086 -0
- package/src/entities/ai.ts +835 -0
- package/src/entities/analytics.ts +1690 -0
- package/src/entities/automation.ts +669 -0
- package/src/entities/communication.ts +1255 -0
- package/src/entities/crm.ts +1481 -0
- package/src/entities/design.ts +606 -0
- package/src/entities/development.ts +2392 -0
- package/src/entities/document.ts +930 -0
- package/src/entities/ecommerce.ts +1539 -0
- package/src/entities/experiment.ts +1139 -0
- package/src/entities/finance.ts +3907 -0
- package/src/entities/forms.ts +2021 -0
- package/src/entities/hr.ts +725 -0
- package/src/entities/identity.ts +1093 -0
- package/src/entities/index.ts +731 -0
- package/src/entities/infrastructure.ts +1254 -0
- package/src/entities/knowledge.ts +1547 -0
- package/src/entities/marketing.ts +1718 -0
- package/src/entities/media.ts +1747 -0
- package/src/entities/notification.ts +1260 -0
- package/src/entities/presentation.ts +1360 -0
- package/src/entities/productivity.ts +1411 -0
- package/src/entities/project-management.ts +1222 -0
- package/src/entities/recruiting.ts +797 -0
- package/src/entities/shipping.ts +566 -0
- package/src/entities/signature.ts +1204 -0
- package/src/entities/site.ts +244 -0
- package/src/entities/spreadsheet.ts +1434 -0
- package/src/entities/storage.ts +1290 -0
- package/src/entities/support.ts +1267 -0
- package/src/entities/video-conferencing.ts +1874 -0
- package/src/entities/video.ts +1035 -0
- package/src/entities.ts +1795 -0
- package/src/index.ts +176 -0
- package/src/providers/analytics/index.ts +21 -0
- package/src/providers/analytics/mixpanel.ts +311 -0
- package/src/providers/calendar/cal-com.ts +435 -0
- package/src/providers/calendar/google-calendar.ts +412 -0
- package/src/providers/calendar/index.ts +24 -0
- package/src/providers/crm/hubspot.ts +667 -0
- package/src/providers/crm/index.ts +21 -0
- package/src/providers/development/github.ts +608 -0
- package/src/providers/development/index.ts +21 -0
- package/src/providers/ecommerce/index.ts +21 -0
- package/src/providers/ecommerce/shopify.ts +451 -0
- package/src/providers/email/index.ts +24 -0
- package/src/providers/email/resend.ts +301 -0
- package/src/providers/email/sendgrid.ts +196 -0
- package/src/providers/finance/index.ts +21 -0
- package/src/providers/finance/stripe.ts +665 -0
- package/src/providers/forms/index.ts +21 -0
- package/src/providers/forms/typeform.ts +598 -0
- package/src/providers/index.ts +281 -0
- package/src/providers/knowledge/index.ts +21 -0
- package/src/providers/knowledge/notion.ts +497 -0
- package/src/providers/marketing/index.ts +21 -0
- package/src/providers/marketing/mailchimp.ts +656 -0
- package/src/providers/media/cloudinary.ts +373 -0
- package/src/providers/media/index.ts +21 -0
- package/src/providers/messaging/index.ts +24 -0
- package/src/providers/messaging/slack.ts +487 -0
- package/src/providers/messaging/twilio-sms.ts +301 -0
- package/src/providers/project-management/index.ts +21 -0
- package/src/providers/project-management/linear.ts +693 -0
- package/src/providers/registry.ts +119 -0
- package/src/providers/spreadsheet/google-sheets.ts +464 -0
- package/src/providers/spreadsheet/index.ts +24 -0
- package/src/providers/spreadsheet/xlsx.ts +542 -0
- package/src/providers/storage/index.ts +35 -0
- package/src/providers/storage/s3.ts +513 -0
- package/src/providers/support/index.ts +21 -0
- package/src/providers/support/zendesk.ts +417 -0
- package/src/providers/tasks/index.ts +21 -0
- package/src/providers/tasks/todoist.ts +407 -0
- package/src/providers/types.ts +2113 -0
- package/src/providers/video-conferencing/google-meet.ts +412 -0
- package/src/providers/video-conferencing/index.ts +35 -0
- package/src/providers/video-conferencing/jitsi.ts +324 -0
- package/src/providers/video-conferencing/teams.ts +408 -0
- package/src/providers/video-conferencing/zoom.ts +451 -0
- package/src/registry.ts +172 -0
- package/src/tools/communication.ts +256 -0
- package/src/tools/data.ts +236 -0
- package/src/tools/index.ts +12 -0
- package/src/tools/web.ts +161 -0
- package/src/types.ts +539 -0
- package/test/define.test.ts +367 -0
- package/test/registry.test.ts +444 -0
- package/test/tools.test.ts +453 -0
- package/tsconfig.json +20 -0
|
@@ -0,0 +1,451 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Zoom Video Conferencing Provider
|
|
3
|
+
*
|
|
4
|
+
* Concrete implementation of VideoConferencingProvider using Zoom API v2.
|
|
5
|
+
*
|
|
6
|
+
* @packageDocumentation
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
import type {
|
|
10
|
+
VideoConferencingProvider,
|
|
11
|
+
ProviderConfig,
|
|
12
|
+
ProviderHealth,
|
|
13
|
+
ProviderInfo,
|
|
14
|
+
CreateMeetingOptions,
|
|
15
|
+
MeetingData,
|
|
16
|
+
MeetingListOptions,
|
|
17
|
+
PaginatedResult,
|
|
18
|
+
ParticipantData,
|
|
19
|
+
MeetingRecordingData,
|
|
20
|
+
} from '../types.js'
|
|
21
|
+
import { defineProvider } from '../registry.js'
|
|
22
|
+
|
|
23
|
+
const ZOOM_API_URL = 'https://api.zoom.us/v2'
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* Zoom provider info
|
|
27
|
+
*/
|
|
28
|
+
export const zoomInfo: ProviderInfo = {
|
|
29
|
+
id: 'video-conferencing.zoom',
|
|
30
|
+
name: 'Zoom',
|
|
31
|
+
description: 'Zoom video conferencing and webinar platform',
|
|
32
|
+
category: 'video-conferencing',
|
|
33
|
+
website: 'https://zoom.us',
|
|
34
|
+
docsUrl: 'https://developers.zoom.us/docs/api/',
|
|
35
|
+
requiredConfig: ['accountId', 'clientId', 'clientSecret'],
|
|
36
|
+
optionalConfig: ['accessToken'],
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
* Zoom API response types
|
|
41
|
+
*/
|
|
42
|
+
interface ZoomMeetingResponse {
|
|
43
|
+
id: number
|
|
44
|
+
topic: string
|
|
45
|
+
start_time?: string
|
|
46
|
+
duration?: number
|
|
47
|
+
timezone?: string
|
|
48
|
+
agenda?: string
|
|
49
|
+
join_url: string
|
|
50
|
+
host_id: string
|
|
51
|
+
status: string
|
|
52
|
+
password?: string
|
|
53
|
+
created_at: string
|
|
54
|
+
settings?: {
|
|
55
|
+
host_video?: boolean
|
|
56
|
+
participant_video?: boolean
|
|
57
|
+
join_before_host?: boolean
|
|
58
|
+
mute_upon_entry?: boolean
|
|
59
|
+
waiting_room?: boolean
|
|
60
|
+
auto_recording?: string
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
interface ZoomMeetingListResponse {
|
|
65
|
+
meetings: ZoomMeetingResponse[]
|
|
66
|
+
page_count: number
|
|
67
|
+
page_number: number
|
|
68
|
+
page_size: number
|
|
69
|
+
total_records: number
|
|
70
|
+
next_page_token?: string
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
interface ZoomParticipantResponse {
|
|
74
|
+
id: string
|
|
75
|
+
name: string
|
|
76
|
+
user_email?: string
|
|
77
|
+
join_time: string
|
|
78
|
+
leave_time?: string
|
|
79
|
+
duration?: number
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
interface ZoomRecordingResponse {
|
|
83
|
+
id: string
|
|
84
|
+
meeting_id: string
|
|
85
|
+
recording_type: string
|
|
86
|
+
file_type: string
|
|
87
|
+
download_url: string
|
|
88
|
+
file_size?: number
|
|
89
|
+
recording_start: string
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
/**
|
|
93
|
+
* OAuth token response
|
|
94
|
+
*/
|
|
95
|
+
interface ZoomTokenResponse {
|
|
96
|
+
access_token: string
|
|
97
|
+
token_type: string
|
|
98
|
+
expires_in: number
|
|
99
|
+
scope: string
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
/**
|
|
103
|
+
* Create Zoom video conferencing provider
|
|
104
|
+
*/
|
|
105
|
+
export function createZoomProvider(config: ProviderConfig): VideoConferencingProvider {
|
|
106
|
+
let accountId: string
|
|
107
|
+
let clientId: string
|
|
108
|
+
let clientSecret: string
|
|
109
|
+
let accessToken: string | undefined
|
|
110
|
+
let tokenExpiresAt: number = 0
|
|
111
|
+
|
|
112
|
+
/**
|
|
113
|
+
* Get OAuth access token using Server-to-Server OAuth
|
|
114
|
+
*/
|
|
115
|
+
async function getAccessToken(): Promise<string> {
|
|
116
|
+
// Return cached token if still valid (with 5-minute buffer)
|
|
117
|
+
if (accessToken && Date.now() < tokenExpiresAt - 300000) {
|
|
118
|
+
return accessToken
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
// Get new token
|
|
122
|
+
const credentials = Buffer.from(`${clientId}:${clientSecret}`).toString('base64')
|
|
123
|
+
const response = await fetch(`https://zoom.us/oauth/token?grant_type=account_credentials&account_id=${accountId}`, {
|
|
124
|
+
method: 'POST',
|
|
125
|
+
headers: {
|
|
126
|
+
Authorization: `Basic ${credentials}`,
|
|
127
|
+
'Content-Type': 'application/x-www-form-urlencoded',
|
|
128
|
+
},
|
|
129
|
+
})
|
|
130
|
+
|
|
131
|
+
if (!response.ok) {
|
|
132
|
+
throw new Error(`Failed to get access token: HTTP ${response.status}`)
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
const data = (await response.json()) as ZoomTokenResponse
|
|
136
|
+
accessToken = data.access_token
|
|
137
|
+
tokenExpiresAt = Date.now() + data.expires_in * 1000
|
|
138
|
+
|
|
139
|
+
return accessToken
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
/**
|
|
143
|
+
* Make authenticated API request
|
|
144
|
+
*/
|
|
145
|
+
async function apiRequest<T>(
|
|
146
|
+
endpoint: string,
|
|
147
|
+
options: RequestInit = {}
|
|
148
|
+
): Promise<T> {
|
|
149
|
+
const token = await getAccessToken()
|
|
150
|
+
const url = `${ZOOM_API_URL}${endpoint}`
|
|
151
|
+
|
|
152
|
+
const response = await fetch(url, {
|
|
153
|
+
...options,
|
|
154
|
+
headers: {
|
|
155
|
+
Authorization: `Bearer ${token}`,
|
|
156
|
+
'Content-Type': 'application/json',
|
|
157
|
+
...options.headers,
|
|
158
|
+
},
|
|
159
|
+
})
|
|
160
|
+
|
|
161
|
+
if (!response.ok) {
|
|
162
|
+
const errorData = await response.json().catch(() => ({}))
|
|
163
|
+
throw new Error(
|
|
164
|
+
`Zoom API error: ${response.status} - ${(errorData as any)?.message || response.statusText}`
|
|
165
|
+
)
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
return response.json() as Promise<T>
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
/**
|
|
172
|
+
* Convert Zoom meeting response to MeetingData
|
|
173
|
+
*/
|
|
174
|
+
function convertMeeting(meeting: ZoomMeetingResponse): MeetingData {
|
|
175
|
+
return {
|
|
176
|
+
id: meeting.id.toString(),
|
|
177
|
+
topic: meeting.topic,
|
|
178
|
+
startTime: meeting.start_time ? new Date(meeting.start_time) : undefined,
|
|
179
|
+
duration: meeting.duration,
|
|
180
|
+
timezone: meeting.timezone,
|
|
181
|
+
agenda: meeting.agenda,
|
|
182
|
+
joinUrl: meeting.join_url,
|
|
183
|
+
hostId: meeting.host_id,
|
|
184
|
+
status: meeting.status as 'waiting' | 'started' | 'finished',
|
|
185
|
+
password: meeting.password,
|
|
186
|
+
createdAt: new Date(meeting.created_at),
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
return {
|
|
191
|
+
info: zoomInfo,
|
|
192
|
+
|
|
193
|
+
async initialize(cfg: ProviderConfig): Promise<void> {
|
|
194
|
+
accountId = cfg.accountId as string
|
|
195
|
+
clientId = cfg.clientId as string
|
|
196
|
+
clientSecret = cfg.clientSecret as string
|
|
197
|
+
accessToken = cfg.accessToken as string | undefined
|
|
198
|
+
|
|
199
|
+
if (!accountId || !clientId || !clientSecret) {
|
|
200
|
+
throw new Error('Zoom requires accountId, clientId, and clientSecret')
|
|
201
|
+
}
|
|
202
|
+
},
|
|
203
|
+
|
|
204
|
+
async healthCheck(): Promise<ProviderHealth> {
|
|
205
|
+
const start = Date.now()
|
|
206
|
+
try {
|
|
207
|
+
// Get current user to verify API access
|
|
208
|
+
await apiRequest('/users/me')
|
|
209
|
+
|
|
210
|
+
return {
|
|
211
|
+
healthy: true,
|
|
212
|
+
latencyMs: Date.now() - start,
|
|
213
|
+
message: 'Connected',
|
|
214
|
+
checkedAt: new Date(),
|
|
215
|
+
}
|
|
216
|
+
} catch (error) {
|
|
217
|
+
return {
|
|
218
|
+
healthy: false,
|
|
219
|
+
latencyMs: Date.now() - start,
|
|
220
|
+
message: error instanceof Error ? error.message : 'Unknown error',
|
|
221
|
+
checkedAt: new Date(),
|
|
222
|
+
}
|
|
223
|
+
}
|
|
224
|
+
},
|
|
225
|
+
|
|
226
|
+
async dispose(): Promise<void> {
|
|
227
|
+
// Clear cached token
|
|
228
|
+
accessToken = undefined
|
|
229
|
+
tokenExpiresAt = 0
|
|
230
|
+
},
|
|
231
|
+
|
|
232
|
+
async createMeeting(meeting: CreateMeetingOptions): Promise<MeetingData> {
|
|
233
|
+
const body: Record<string, unknown> = {
|
|
234
|
+
topic: meeting.topic,
|
|
235
|
+
type: meeting.startTime ? 2 : 1, // 1 = instant, 2 = scheduled
|
|
236
|
+
...(meeting.startTime && {
|
|
237
|
+
start_time: meeting.startTime.toISOString(),
|
|
238
|
+
}),
|
|
239
|
+
...(meeting.duration && { duration: meeting.duration }),
|
|
240
|
+
...(meeting.timezone && { timezone: meeting.timezone }),
|
|
241
|
+
...(meeting.agenda && { agenda: meeting.agenda }),
|
|
242
|
+
...(meeting.password && { password: meeting.password }),
|
|
243
|
+
}
|
|
244
|
+
|
|
245
|
+
if (meeting.settings) {
|
|
246
|
+
body.settings = {
|
|
247
|
+
...(meeting.settings.hostVideo !== undefined && {
|
|
248
|
+
host_video: meeting.settings.hostVideo,
|
|
249
|
+
}),
|
|
250
|
+
...(meeting.settings.participantVideo !== undefined && {
|
|
251
|
+
participant_video: meeting.settings.participantVideo,
|
|
252
|
+
}),
|
|
253
|
+
...(meeting.settings.joinBeforeHost !== undefined && {
|
|
254
|
+
join_before_host: meeting.settings.joinBeforeHost,
|
|
255
|
+
}),
|
|
256
|
+
...(meeting.settings.muteUponEntry !== undefined && {
|
|
257
|
+
mute_upon_entry: meeting.settings.muteUponEntry,
|
|
258
|
+
}),
|
|
259
|
+
...(meeting.settings.waitingRoom !== undefined && {
|
|
260
|
+
waiting_room: meeting.settings.waitingRoom,
|
|
261
|
+
}),
|
|
262
|
+
...(meeting.settings.autoRecording && {
|
|
263
|
+
auto_recording: meeting.settings.autoRecording,
|
|
264
|
+
}),
|
|
265
|
+
}
|
|
266
|
+
}
|
|
267
|
+
|
|
268
|
+
const response = await apiRequest<ZoomMeetingResponse>('/users/me/meetings', {
|
|
269
|
+
method: 'POST',
|
|
270
|
+
body: JSON.stringify(body),
|
|
271
|
+
})
|
|
272
|
+
|
|
273
|
+
return convertMeeting(response)
|
|
274
|
+
},
|
|
275
|
+
|
|
276
|
+
async getMeeting(meetingId: string): Promise<MeetingData | null> {
|
|
277
|
+
try {
|
|
278
|
+
const response = await apiRequest<ZoomMeetingResponse>(`/meetings/${meetingId}`)
|
|
279
|
+
return convertMeeting(response)
|
|
280
|
+
} catch (error) {
|
|
281
|
+
if (error instanceof Error && error.message.includes('404')) {
|
|
282
|
+
return null
|
|
283
|
+
}
|
|
284
|
+
throw error
|
|
285
|
+
}
|
|
286
|
+
},
|
|
287
|
+
|
|
288
|
+
async updateMeeting(
|
|
289
|
+
meetingId: string,
|
|
290
|
+
updates: Partial<CreateMeetingOptions>
|
|
291
|
+
): Promise<MeetingData> {
|
|
292
|
+
const body: Record<string, unknown> = {}
|
|
293
|
+
|
|
294
|
+
if (updates.topic) body.topic = updates.topic
|
|
295
|
+
if (updates.startTime) body.start_time = updates.startTime.toISOString()
|
|
296
|
+
if (updates.duration !== undefined) body.duration = updates.duration
|
|
297
|
+
if (updates.timezone) body.timezone = updates.timezone
|
|
298
|
+
if (updates.agenda !== undefined) body.agenda = updates.agenda
|
|
299
|
+
if (updates.password !== undefined) body.password = updates.password
|
|
300
|
+
|
|
301
|
+
if (updates.settings) {
|
|
302
|
+
body.settings = {
|
|
303
|
+
...(updates.settings.hostVideo !== undefined && {
|
|
304
|
+
host_video: updates.settings.hostVideo,
|
|
305
|
+
}),
|
|
306
|
+
...(updates.settings.participantVideo !== undefined && {
|
|
307
|
+
participant_video: updates.settings.participantVideo,
|
|
308
|
+
}),
|
|
309
|
+
...(updates.settings.joinBeforeHost !== undefined && {
|
|
310
|
+
join_before_host: updates.settings.joinBeforeHost,
|
|
311
|
+
}),
|
|
312
|
+
...(updates.settings.muteUponEntry !== undefined && {
|
|
313
|
+
mute_upon_entry: updates.settings.muteUponEntry,
|
|
314
|
+
}),
|
|
315
|
+
...(updates.settings.waitingRoom !== undefined && {
|
|
316
|
+
waiting_room: updates.settings.waitingRoom,
|
|
317
|
+
}),
|
|
318
|
+
...(updates.settings.autoRecording !== undefined && {
|
|
319
|
+
auto_recording: updates.settings.autoRecording,
|
|
320
|
+
}),
|
|
321
|
+
}
|
|
322
|
+
}
|
|
323
|
+
|
|
324
|
+
await apiRequest(`/meetings/${meetingId}`, {
|
|
325
|
+
method: 'PATCH',
|
|
326
|
+
body: JSON.stringify(body),
|
|
327
|
+
})
|
|
328
|
+
|
|
329
|
+
// Fetch updated meeting
|
|
330
|
+
const updated = await this.getMeeting(meetingId)
|
|
331
|
+
if (!updated) {
|
|
332
|
+
throw new Error(`Failed to fetch updated meeting ${meetingId}`)
|
|
333
|
+
}
|
|
334
|
+
return updated
|
|
335
|
+
},
|
|
336
|
+
|
|
337
|
+
async deleteMeeting(meetingId: string): Promise<boolean> {
|
|
338
|
+
try {
|
|
339
|
+
await apiRequest(`/meetings/${meetingId}`, {
|
|
340
|
+
method: 'DELETE',
|
|
341
|
+
})
|
|
342
|
+
return true
|
|
343
|
+
} catch (error) {
|
|
344
|
+
if (error instanceof Error && error.message.includes('404')) {
|
|
345
|
+
return false
|
|
346
|
+
}
|
|
347
|
+
throw error
|
|
348
|
+
}
|
|
349
|
+
},
|
|
350
|
+
|
|
351
|
+
async listMeetings(options: MeetingListOptions = {}): Promise<PaginatedResult<MeetingData>> {
|
|
352
|
+
const params = new URLSearchParams()
|
|
353
|
+
|
|
354
|
+
// Map type option to Zoom API parameter
|
|
355
|
+
const typeMap: Record<string, string> = {
|
|
356
|
+
scheduled: 'scheduled',
|
|
357
|
+
live: 'live',
|
|
358
|
+
upcoming: 'upcoming',
|
|
359
|
+
previous: 'previous_meetings',
|
|
360
|
+
}
|
|
361
|
+
|
|
362
|
+
if (options.type) {
|
|
363
|
+
params.append('type', typeMap[options.type] || 'scheduled')
|
|
364
|
+
} else {
|
|
365
|
+
params.append('type', 'scheduled')
|
|
366
|
+
}
|
|
367
|
+
|
|
368
|
+
if (options.limit) params.append('page_size', options.limit.toString())
|
|
369
|
+
if (options.cursor) params.append('next_page_token', options.cursor)
|
|
370
|
+
|
|
371
|
+
const response = await apiRequest<ZoomMeetingListResponse>(
|
|
372
|
+
`/users/me/meetings?${params.toString()}`
|
|
373
|
+
)
|
|
374
|
+
|
|
375
|
+
return {
|
|
376
|
+
items: response.meetings.map(convertMeeting),
|
|
377
|
+
total: response.total_records,
|
|
378
|
+
hasMore: !!response.next_page_token,
|
|
379
|
+
nextCursor: response.next_page_token,
|
|
380
|
+
}
|
|
381
|
+
},
|
|
382
|
+
|
|
383
|
+
async endMeeting(meetingId: string): Promise<boolean> {
|
|
384
|
+
try {
|
|
385
|
+
await apiRequest(`/meetings/${meetingId}/status`, {
|
|
386
|
+
method: 'PUT',
|
|
387
|
+
body: JSON.stringify({ action: 'end' }),
|
|
388
|
+
})
|
|
389
|
+
return true
|
|
390
|
+
} catch (error) {
|
|
391
|
+
if (error instanceof Error && error.message.includes('404')) {
|
|
392
|
+
return false
|
|
393
|
+
}
|
|
394
|
+
throw error
|
|
395
|
+
}
|
|
396
|
+
},
|
|
397
|
+
|
|
398
|
+
async getParticipants(meetingId: string): Promise<ParticipantData[]> {
|
|
399
|
+
try {
|
|
400
|
+
const response = await apiRequest<{ participants: ZoomParticipantResponse[] }>(
|
|
401
|
+
`/past_meetings/${meetingId}/participants`
|
|
402
|
+
)
|
|
403
|
+
|
|
404
|
+
return response.participants.map((p) => ({
|
|
405
|
+
id: p.id,
|
|
406
|
+
name: p.name,
|
|
407
|
+
email: p.user_email,
|
|
408
|
+
joinTime: new Date(p.join_time),
|
|
409
|
+
leaveTime: p.leave_time ? new Date(p.leave_time) : undefined,
|
|
410
|
+
duration: p.duration,
|
|
411
|
+
}))
|
|
412
|
+
} catch (error) {
|
|
413
|
+
if (error instanceof Error && error.message.includes('404')) {
|
|
414
|
+
return []
|
|
415
|
+
}
|
|
416
|
+
throw error
|
|
417
|
+
}
|
|
418
|
+
},
|
|
419
|
+
|
|
420
|
+
async getRecordings(meetingId: string): Promise<MeetingRecordingData[]> {
|
|
421
|
+
try {
|
|
422
|
+
const response = await apiRequest<{ recording_files: ZoomRecordingResponse[] }>(
|
|
423
|
+
`/meetings/${meetingId}/recordings`
|
|
424
|
+
)
|
|
425
|
+
|
|
426
|
+
return response.recording_files.map((r) => ({
|
|
427
|
+
id: r.id,
|
|
428
|
+
meetingId: r.meeting_id,
|
|
429
|
+
type: r.recording_type === 'audio_only' ? 'audio' :
|
|
430
|
+
r.file_type === 'TRANSCRIPT' ? 'transcript' : 'video',
|
|
431
|
+
url: r.download_url,
|
|
432
|
+
size: r.file_size,
|
|
433
|
+
duration: undefined, // Not provided in this endpoint
|
|
434
|
+
createdAt: new Date(r.recording_start),
|
|
435
|
+
}))
|
|
436
|
+
} catch (error) {
|
|
437
|
+
if (error instanceof Error && error.message.includes('404')) {
|
|
438
|
+
return []
|
|
439
|
+
}
|
|
440
|
+
throw error
|
|
441
|
+
}
|
|
442
|
+
},
|
|
443
|
+
}
|
|
444
|
+
}
|
|
445
|
+
|
|
446
|
+
/**
|
|
447
|
+
* Zoom provider definition
|
|
448
|
+
*/
|
|
449
|
+
export const zoomProvider = defineProvider(zoomInfo, async (config) =>
|
|
450
|
+
createZoomProvider(config)
|
|
451
|
+
)
|
package/src/registry.ts
ADDED
|
@@ -0,0 +1,172 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Tool Registry - Registration and discovery for tools
|
|
3
|
+
*
|
|
4
|
+
* Provides a central registry for tools that can be used by
|
|
5
|
+
* both humans and AI agents.
|
|
6
|
+
*
|
|
7
|
+
* @packageDocumentation
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
import type {
|
|
11
|
+
AnyTool,
|
|
12
|
+
ToolCategory,
|
|
13
|
+
ToolQuery,
|
|
14
|
+
ToolRegistry,
|
|
15
|
+
MCPTool,
|
|
16
|
+
} from './types.js'
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* In-memory tool registry implementation
|
|
20
|
+
*/
|
|
21
|
+
class InMemoryToolRegistry implements ToolRegistry {
|
|
22
|
+
private tools: Map<string, AnyTool> = new Map()
|
|
23
|
+
|
|
24
|
+
register(tool: AnyTool): void {
|
|
25
|
+
if (this.tools.has(tool.id)) {
|
|
26
|
+
console.warn(`Tool "${tool.id}" already registered, overwriting`)
|
|
27
|
+
}
|
|
28
|
+
this.tools.set(tool.id, tool)
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
unregister(id: string): boolean {
|
|
32
|
+
return this.tools.delete(id)
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
get(id: string): AnyTool | undefined {
|
|
36
|
+
return this.tools.get(id)
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
has(id: string): boolean {
|
|
40
|
+
return this.tools.has(id)
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
list(): string[] {
|
|
44
|
+
return Array.from(this.tools.keys())
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
query(options: ToolQuery): AnyTool[] {
|
|
48
|
+
let results = Array.from(this.tools.values())
|
|
49
|
+
|
|
50
|
+
// Filter by category
|
|
51
|
+
if (options.category) {
|
|
52
|
+
results = results.filter((t) => t.category === options.category)
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
// Filter by subcategory
|
|
56
|
+
if (options.subcategory) {
|
|
57
|
+
results = results.filter((t) => t.subcategory === options.subcategory)
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
// Filter by tags
|
|
61
|
+
if (options.tags && options.tags.length > 0) {
|
|
62
|
+
results = results.filter(
|
|
63
|
+
(t) => t.tags && options.tags!.some((tag) => t.tags!.includes(tag))
|
|
64
|
+
)
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
// Filter by audience
|
|
68
|
+
if (options.audience) {
|
|
69
|
+
results = results.filter(
|
|
70
|
+
(t) =>
|
|
71
|
+
t.audience === options.audience ||
|
|
72
|
+
t.audience === 'both' ||
|
|
73
|
+
!t.audience
|
|
74
|
+
)
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
// Text search
|
|
78
|
+
if (options.search) {
|
|
79
|
+
const search = options.search.toLowerCase()
|
|
80
|
+
results = results.filter(
|
|
81
|
+
(t) =>
|
|
82
|
+
t.name.toLowerCase().includes(search) ||
|
|
83
|
+
t.description.toLowerCase().includes(search) ||
|
|
84
|
+
t.id.toLowerCase().includes(search)
|
|
85
|
+
)
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
// Pagination
|
|
89
|
+
const offset = options.offset ?? 0
|
|
90
|
+
const limit = options.limit ?? results.length
|
|
91
|
+
results = results.slice(offset, offset + limit)
|
|
92
|
+
|
|
93
|
+
return results
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
byCategory(category: ToolCategory): AnyTool[] {
|
|
97
|
+
return this.query({ category })
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
clear(): void {
|
|
101
|
+
this.tools.clear()
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
/**
|
|
106
|
+
* Global tool registry instance
|
|
107
|
+
*/
|
|
108
|
+
export const registry: ToolRegistry = new InMemoryToolRegistry()
|
|
109
|
+
|
|
110
|
+
/**
|
|
111
|
+
* Create a new registry instance (for isolated testing or namespacing)
|
|
112
|
+
*/
|
|
113
|
+
export function createRegistry(): ToolRegistry {
|
|
114
|
+
return new InMemoryToolRegistry()
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
/**
|
|
118
|
+
* Convert a Tool to MCP format
|
|
119
|
+
*/
|
|
120
|
+
export function toMCP(tool: AnyTool): MCPTool {
|
|
121
|
+
return {
|
|
122
|
+
name: tool.id,
|
|
123
|
+
description: tool.description,
|
|
124
|
+
inputSchema: {
|
|
125
|
+
type: 'object',
|
|
126
|
+
properties: Object.fromEntries(
|
|
127
|
+
tool.parameters.map((p) => [
|
|
128
|
+
p.name,
|
|
129
|
+
typeof p.schema === 'object' && 'type' in p.schema
|
|
130
|
+
? { ...p.schema, description: p.description }
|
|
131
|
+
: { description: p.description },
|
|
132
|
+
])
|
|
133
|
+
),
|
|
134
|
+
required: tool.parameters.filter((p) => p.required).map((p) => p.name),
|
|
135
|
+
},
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
/**
|
|
140
|
+
* Convert all registered tools to MCP format
|
|
141
|
+
*/
|
|
142
|
+
export function listMCPTools(reg: ToolRegistry = registry): MCPTool[] {
|
|
143
|
+
return reg.list().map((id) => toMCP(reg.get(id)!))
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
/**
|
|
147
|
+
* Register a tool in the global registry
|
|
148
|
+
*/
|
|
149
|
+
export function registerTool(tool: AnyTool): void {
|
|
150
|
+
registry.register(tool)
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
/**
|
|
154
|
+
* Get a tool from the global registry
|
|
155
|
+
*/
|
|
156
|
+
export function getTool(id: string): AnyTool | undefined {
|
|
157
|
+
return registry.get(id)
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
/**
|
|
161
|
+
* Execute a tool by ID
|
|
162
|
+
*/
|
|
163
|
+
export async function executeTool<TInput, TOutput>(
|
|
164
|
+
id: string,
|
|
165
|
+
input: TInput
|
|
166
|
+
): Promise<TOutput> {
|
|
167
|
+
const tool = registry.get(id)
|
|
168
|
+
if (!tool) {
|
|
169
|
+
throw new Error(`Tool "${id}" not found`)
|
|
170
|
+
}
|
|
171
|
+
return tool.handler(input) as Promise<TOutput>
|
|
172
|
+
}
|