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,256 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Communication Tools - Email, messaging, notifications
|
|
3
|
+
*
|
|
4
|
+
* These tools define the interface for communication.
|
|
5
|
+
* Actual implementations would integrate with email services,
|
|
6
|
+
* Slack, etc. in production.
|
|
7
|
+
*
|
|
8
|
+
* @packageDocumentation
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
import { defineTool } from '../define.js'
|
|
12
|
+
import type { AnyTool } from '../types.js'
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* Email input type
|
|
16
|
+
*/
|
|
17
|
+
interface EmailInput {
|
|
18
|
+
to: string[]
|
|
19
|
+
cc?: string[]
|
|
20
|
+
bcc?: string[]
|
|
21
|
+
subject: string
|
|
22
|
+
body: string
|
|
23
|
+
html?: string
|
|
24
|
+
attachments?: Array<{
|
|
25
|
+
filename: string
|
|
26
|
+
content: string
|
|
27
|
+
contentType?: string
|
|
28
|
+
}>
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* Send an email
|
|
33
|
+
*/
|
|
34
|
+
export const sendEmail = defineTool<
|
|
35
|
+
EmailInput,
|
|
36
|
+
{ success: boolean; messageId?: string; error?: string }
|
|
37
|
+
>({
|
|
38
|
+
id: 'communication.email.send',
|
|
39
|
+
name: 'Send Email',
|
|
40
|
+
description: 'Send an email to one or more recipients',
|
|
41
|
+
category: 'communication',
|
|
42
|
+
subcategory: 'email',
|
|
43
|
+
input: {
|
|
44
|
+
type: 'object',
|
|
45
|
+
properties: {
|
|
46
|
+
to: { type: 'array', items: { type: 'string' }, description: 'Recipient email addresses' },
|
|
47
|
+
cc: { type: 'array', items: { type: 'string' }, description: 'CC recipients' },
|
|
48
|
+
bcc: { type: 'array', items: { type: 'string' }, description: 'BCC recipients' },
|
|
49
|
+
subject: { type: 'string', description: 'Email subject' },
|
|
50
|
+
body: { type: 'string', description: 'Plain text body' },
|
|
51
|
+
html: { type: 'string', description: 'HTML body (optional)' },
|
|
52
|
+
attachments: {
|
|
53
|
+
type: 'array',
|
|
54
|
+
items: {
|
|
55
|
+
type: 'object',
|
|
56
|
+
properties: {
|
|
57
|
+
filename: { type: 'string' },
|
|
58
|
+
content: { type: 'string' },
|
|
59
|
+
contentType: { type: 'string' },
|
|
60
|
+
},
|
|
61
|
+
},
|
|
62
|
+
description: 'File attachments',
|
|
63
|
+
},
|
|
64
|
+
},
|
|
65
|
+
required: ['to', 'subject', 'body'],
|
|
66
|
+
},
|
|
67
|
+
handler: async (input) => {
|
|
68
|
+
// In production, this would integrate with an email service
|
|
69
|
+
// (SendGrid, SES, Postmark, etc.)
|
|
70
|
+
console.log('[Email] Sending to:', input.to.join(', '))
|
|
71
|
+
console.log('[Email] Subject:', input.subject)
|
|
72
|
+
|
|
73
|
+
// Simulate sending
|
|
74
|
+
return {
|
|
75
|
+
success: true,
|
|
76
|
+
messageId: `msg_${Date.now()}_${Math.random().toString(36).slice(2)}`,
|
|
77
|
+
}
|
|
78
|
+
},
|
|
79
|
+
options: {
|
|
80
|
+
audience: 'both',
|
|
81
|
+
tags: ['email', 'send', 'notify'],
|
|
82
|
+
requiresConfirmation: true,
|
|
83
|
+
permissions: [{ type: 'execute', resource: 'email' }],
|
|
84
|
+
},
|
|
85
|
+
})
|
|
86
|
+
|
|
87
|
+
/**
|
|
88
|
+
* Slack message input
|
|
89
|
+
*/
|
|
90
|
+
interface SlackMessageInput {
|
|
91
|
+
channel: string
|
|
92
|
+
text: string
|
|
93
|
+
blocks?: unknown[]
|
|
94
|
+
threadTs?: string
|
|
95
|
+
unfurlLinks?: boolean
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
/**
|
|
99
|
+
* Send a Slack message
|
|
100
|
+
*/
|
|
101
|
+
export const sendSlackMessage = defineTool<
|
|
102
|
+
SlackMessageInput,
|
|
103
|
+
{ success: boolean; ts?: string; channel?: string; error?: string }
|
|
104
|
+
>({
|
|
105
|
+
id: 'communication.slack.send',
|
|
106
|
+
name: 'Send Slack Message',
|
|
107
|
+
description: 'Send a message to a Slack channel or thread',
|
|
108
|
+
category: 'communication',
|
|
109
|
+
subcategory: 'slack',
|
|
110
|
+
input: {
|
|
111
|
+
type: 'object',
|
|
112
|
+
properties: {
|
|
113
|
+
channel: { type: 'string', description: 'Channel ID or name (e.g., #general)' },
|
|
114
|
+
text: { type: 'string', description: 'Message text' },
|
|
115
|
+
blocks: { type: 'array', description: 'Slack Block Kit blocks' },
|
|
116
|
+
threadTs: { type: 'string', description: 'Thread timestamp for replies' },
|
|
117
|
+
unfurlLinks: { type: 'boolean', description: 'Unfurl URLs in the message' },
|
|
118
|
+
},
|
|
119
|
+
required: ['channel', 'text'],
|
|
120
|
+
},
|
|
121
|
+
handler: async (input) => {
|
|
122
|
+
// In production, this would integrate with Slack API
|
|
123
|
+
console.log('[Slack] Sending to:', input.channel)
|
|
124
|
+
console.log('[Slack] Message:', input.text)
|
|
125
|
+
|
|
126
|
+
return {
|
|
127
|
+
success: true,
|
|
128
|
+
ts: `${Date.now()}.000001`,
|
|
129
|
+
channel: input.channel,
|
|
130
|
+
}
|
|
131
|
+
},
|
|
132
|
+
options: {
|
|
133
|
+
audience: 'both',
|
|
134
|
+
tags: ['slack', 'message', 'chat'],
|
|
135
|
+
permissions: [{ type: 'execute', resource: 'slack' }],
|
|
136
|
+
},
|
|
137
|
+
})
|
|
138
|
+
|
|
139
|
+
/**
|
|
140
|
+
* Notification input
|
|
141
|
+
*/
|
|
142
|
+
interface NotificationInput {
|
|
143
|
+
channel: 'email' | 'slack' | 'sms' | 'push' | 'webhook'
|
|
144
|
+
recipients: string[]
|
|
145
|
+
title: string
|
|
146
|
+
message: string
|
|
147
|
+
priority?: 'low' | 'normal' | 'high' | 'urgent'
|
|
148
|
+
data?: Record<string, unknown>
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
/**
|
|
152
|
+
* Send a notification
|
|
153
|
+
*/
|
|
154
|
+
export const sendNotification = defineTool<
|
|
155
|
+
NotificationInput,
|
|
156
|
+
{ success: boolean; notificationId: string; delivered: string[] }
|
|
157
|
+
>({
|
|
158
|
+
id: 'communication.notify',
|
|
159
|
+
name: 'Send Notification',
|
|
160
|
+
description: 'Send a notification through various channels',
|
|
161
|
+
category: 'communication',
|
|
162
|
+
subcategory: 'notification',
|
|
163
|
+
input: {
|
|
164
|
+
type: 'object',
|
|
165
|
+
properties: {
|
|
166
|
+
channel: {
|
|
167
|
+
type: 'string',
|
|
168
|
+
enum: ['email', 'slack', 'sms', 'push', 'webhook'],
|
|
169
|
+
description: 'Notification channel',
|
|
170
|
+
},
|
|
171
|
+
recipients: { type: 'array', items: { type: 'string' }, description: 'Recipients' },
|
|
172
|
+
title: { type: 'string', description: 'Notification title' },
|
|
173
|
+
message: { type: 'string', description: 'Notification message' },
|
|
174
|
+
priority: {
|
|
175
|
+
type: 'string',
|
|
176
|
+
enum: ['low', 'normal', 'high', 'urgent'],
|
|
177
|
+
description: 'Priority level',
|
|
178
|
+
},
|
|
179
|
+
data: { type: 'object', description: 'Additional data' },
|
|
180
|
+
},
|
|
181
|
+
required: ['channel', 'recipients', 'title', 'message'],
|
|
182
|
+
},
|
|
183
|
+
handler: async (input) => {
|
|
184
|
+
console.log(`[Notification] [${input.channel}] ${input.title}`)
|
|
185
|
+
console.log(`[Notification] Recipients:`, input.recipients)
|
|
186
|
+
console.log(`[Notification] Priority:`, input.priority || 'normal')
|
|
187
|
+
|
|
188
|
+
return {
|
|
189
|
+
success: true,
|
|
190
|
+
notificationId: `notif_${Date.now()}`,
|
|
191
|
+
delivered: input.recipients,
|
|
192
|
+
}
|
|
193
|
+
},
|
|
194
|
+
options: {
|
|
195
|
+
audience: 'both',
|
|
196
|
+
tags: ['notify', 'alert', 'message'],
|
|
197
|
+
},
|
|
198
|
+
})
|
|
199
|
+
|
|
200
|
+
/**
|
|
201
|
+
* SMS input
|
|
202
|
+
*/
|
|
203
|
+
interface SmsInput {
|
|
204
|
+
to: string
|
|
205
|
+
message: string
|
|
206
|
+
from?: string
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
/**
|
|
210
|
+
* Send an SMS
|
|
211
|
+
*/
|
|
212
|
+
export const sendSms = defineTool<
|
|
213
|
+
SmsInput,
|
|
214
|
+
{ success: boolean; messageId?: string; error?: string }
|
|
215
|
+
>({
|
|
216
|
+
id: 'communication.sms.send',
|
|
217
|
+
name: 'Send SMS',
|
|
218
|
+
description: 'Send an SMS text message',
|
|
219
|
+
category: 'communication',
|
|
220
|
+
subcategory: 'sms',
|
|
221
|
+
input: {
|
|
222
|
+
type: 'object',
|
|
223
|
+
properties: {
|
|
224
|
+
to: { type: 'string', description: 'Phone number (E.164 format)' },
|
|
225
|
+
message: { type: 'string', description: 'SMS message (max 160 chars recommended)' },
|
|
226
|
+
from: { type: 'string', description: 'Sender phone number or ID' },
|
|
227
|
+
},
|
|
228
|
+
required: ['to', 'message'],
|
|
229
|
+
},
|
|
230
|
+
handler: async (input) => {
|
|
231
|
+
// In production, this would integrate with Twilio, etc.
|
|
232
|
+
console.log('[SMS] Sending to:', input.to)
|
|
233
|
+
console.log('[SMS] Message:', input.message.slice(0, 160))
|
|
234
|
+
|
|
235
|
+
return {
|
|
236
|
+
success: true,
|
|
237
|
+
messageId: `sms_${Date.now()}`,
|
|
238
|
+
}
|
|
239
|
+
},
|
|
240
|
+
options: {
|
|
241
|
+
audience: 'both',
|
|
242
|
+
tags: ['sms', 'text', 'mobile'],
|
|
243
|
+
requiresConfirmation: true,
|
|
244
|
+
permissions: [{ type: 'execute', resource: 'sms' }],
|
|
245
|
+
},
|
|
246
|
+
})
|
|
247
|
+
|
|
248
|
+
/**
|
|
249
|
+
* All communication tools
|
|
250
|
+
*/
|
|
251
|
+
export const communicationTools: AnyTool[] = [
|
|
252
|
+
sendEmail,
|
|
253
|
+
sendSlackMessage,
|
|
254
|
+
sendNotification,
|
|
255
|
+
sendSms,
|
|
256
|
+
]
|
|
@@ -0,0 +1,236 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Data Tools - Data manipulation, transformation, validation
|
|
3
|
+
*
|
|
4
|
+
* @packageDocumentation
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
import { defineTool } from '../define.js'
|
|
8
|
+
import type { AnyTool } from '../types.js'
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* Parse JSON string
|
|
12
|
+
*/
|
|
13
|
+
export const parseJson = defineTool<
|
|
14
|
+
{ text: string },
|
|
15
|
+
{ data: unknown; valid: boolean; error?: string }
|
|
16
|
+
>({
|
|
17
|
+
id: 'data.json.parse',
|
|
18
|
+
name: 'Parse JSON',
|
|
19
|
+
description: 'Parse a JSON string into an object',
|
|
20
|
+
category: 'data',
|
|
21
|
+
subcategory: 'transform',
|
|
22
|
+
input: {
|
|
23
|
+
type: 'object',
|
|
24
|
+
properties: {
|
|
25
|
+
text: { type: 'string', description: 'JSON string to parse' },
|
|
26
|
+
},
|
|
27
|
+
required: ['text'],
|
|
28
|
+
},
|
|
29
|
+
handler: async (input) => {
|
|
30
|
+
try {
|
|
31
|
+
const data = JSON.parse(input.text)
|
|
32
|
+
return { data, valid: true }
|
|
33
|
+
} catch (e) {
|
|
34
|
+
return {
|
|
35
|
+
data: null,
|
|
36
|
+
valid: false,
|
|
37
|
+
error: e instanceof Error ? e.message : 'Invalid JSON',
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
},
|
|
41
|
+
options: {
|
|
42
|
+
audience: 'both',
|
|
43
|
+
tags: ['json', 'parse', 'transform'],
|
|
44
|
+
idempotent: true,
|
|
45
|
+
},
|
|
46
|
+
})
|
|
47
|
+
|
|
48
|
+
/**
|
|
49
|
+
* Stringify object to JSON
|
|
50
|
+
*/
|
|
51
|
+
export const stringifyJson = defineTool<
|
|
52
|
+
{ data: unknown; pretty?: boolean },
|
|
53
|
+
{ text: string }
|
|
54
|
+
>({
|
|
55
|
+
id: 'data.json.stringify',
|
|
56
|
+
name: 'Stringify JSON',
|
|
57
|
+
description: 'Convert an object to a JSON string',
|
|
58
|
+
category: 'data',
|
|
59
|
+
subcategory: 'transform',
|
|
60
|
+
input: {
|
|
61
|
+
type: 'object',
|
|
62
|
+
properties: {
|
|
63
|
+
data: { description: 'Data to stringify' },
|
|
64
|
+
pretty: { type: 'boolean', description: 'Pretty print with indentation' },
|
|
65
|
+
},
|
|
66
|
+
required: ['data'],
|
|
67
|
+
},
|
|
68
|
+
handler: async (input) => {
|
|
69
|
+
const text = input.pretty
|
|
70
|
+
? JSON.stringify(input.data, null, 2)
|
|
71
|
+
: JSON.stringify(input.data)
|
|
72
|
+
return { text }
|
|
73
|
+
},
|
|
74
|
+
options: {
|
|
75
|
+
audience: 'both',
|
|
76
|
+
tags: ['json', 'stringify', 'transform'],
|
|
77
|
+
idempotent: true,
|
|
78
|
+
},
|
|
79
|
+
})
|
|
80
|
+
|
|
81
|
+
/**
|
|
82
|
+
* Parse CSV to array of objects
|
|
83
|
+
*/
|
|
84
|
+
export const parseCsv = defineTool<
|
|
85
|
+
{ text: string; delimiter?: string; hasHeaders?: boolean },
|
|
86
|
+
{ rows: Record<string, string>[]; headers: string[]; rowCount: number }
|
|
87
|
+
>({
|
|
88
|
+
id: 'data.csv.parse',
|
|
89
|
+
name: 'Parse CSV',
|
|
90
|
+
description: 'Parse CSV text into an array of objects',
|
|
91
|
+
category: 'data',
|
|
92
|
+
subcategory: 'transform',
|
|
93
|
+
input: {
|
|
94
|
+
type: 'object',
|
|
95
|
+
properties: {
|
|
96
|
+
text: { type: 'string', description: 'CSV text to parse' },
|
|
97
|
+
delimiter: { type: 'string', description: 'Column delimiter (default: comma)' },
|
|
98
|
+
hasHeaders: { type: 'boolean', description: 'First row is headers (default: true)' },
|
|
99
|
+
},
|
|
100
|
+
required: ['text'],
|
|
101
|
+
},
|
|
102
|
+
handler: async (input) => {
|
|
103
|
+
const delimiter = input.delimiter || ','
|
|
104
|
+
const hasHeaders = input.hasHeaders !== false
|
|
105
|
+
const lines = input.text.split('\n').filter((line) => line.trim())
|
|
106
|
+
|
|
107
|
+
if (lines.length === 0) {
|
|
108
|
+
return { rows: [], headers: [], rowCount: 0 }
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
const headers = hasHeaders
|
|
112
|
+
? lines[0].split(delimiter).map((h) => h.trim())
|
|
113
|
+
: lines[0].split(delimiter).map((_, i) => `column${i + 1}`)
|
|
114
|
+
|
|
115
|
+
const dataLines = hasHeaders ? lines.slice(1) : lines
|
|
116
|
+
|
|
117
|
+
const rows = dataLines.map((line) => {
|
|
118
|
+
const values = line.split(delimiter).map((v) => v.trim())
|
|
119
|
+
const row: Record<string, string> = {}
|
|
120
|
+
headers.forEach((header, i) => {
|
|
121
|
+
row[header] = values[i] || ''
|
|
122
|
+
})
|
|
123
|
+
return row
|
|
124
|
+
})
|
|
125
|
+
|
|
126
|
+
return { rows, headers, rowCount: rows.length }
|
|
127
|
+
},
|
|
128
|
+
options: {
|
|
129
|
+
audience: 'both',
|
|
130
|
+
tags: ['csv', 'parse', 'transform'],
|
|
131
|
+
idempotent: true,
|
|
132
|
+
},
|
|
133
|
+
})
|
|
134
|
+
|
|
135
|
+
/**
|
|
136
|
+
* Transform data using JSONPath-like expressions
|
|
137
|
+
*/
|
|
138
|
+
export const transformData = defineTool<
|
|
139
|
+
{ data: unknown; transform: Record<string, string> },
|
|
140
|
+
{ result: Record<string, unknown> }
|
|
141
|
+
>({
|
|
142
|
+
id: 'data.transform',
|
|
143
|
+
name: 'Transform Data',
|
|
144
|
+
description: 'Transform data by mapping fields to new structure',
|
|
145
|
+
category: 'data',
|
|
146
|
+
subcategory: 'transform',
|
|
147
|
+
input: {
|
|
148
|
+
type: 'object',
|
|
149
|
+
properties: {
|
|
150
|
+
data: { description: 'Source data to transform' },
|
|
151
|
+
transform: {
|
|
152
|
+
type: 'object',
|
|
153
|
+
description: 'Mapping of output fields to input paths (e.g., { "name": "user.firstName" })',
|
|
154
|
+
},
|
|
155
|
+
},
|
|
156
|
+
required: ['data', 'transform'],
|
|
157
|
+
},
|
|
158
|
+
handler: async (input) => {
|
|
159
|
+
const result: Record<string, unknown> = {}
|
|
160
|
+
|
|
161
|
+
for (const [outputKey, inputPath] of Object.entries(input.transform)) {
|
|
162
|
+
const pathParts = inputPath.split('.')
|
|
163
|
+
let value: unknown = input.data
|
|
164
|
+
|
|
165
|
+
for (const part of pathParts) {
|
|
166
|
+
if (value && typeof value === 'object' && part in (value as Record<string, unknown>)) {
|
|
167
|
+
value = (value as Record<string, unknown>)[part]
|
|
168
|
+
} else {
|
|
169
|
+
value = undefined
|
|
170
|
+
break
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
result[outputKey] = value
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
return { result }
|
|
178
|
+
},
|
|
179
|
+
options: {
|
|
180
|
+
audience: 'both',
|
|
181
|
+
tags: ['transform', 'map', 'extract'],
|
|
182
|
+
idempotent: true,
|
|
183
|
+
},
|
|
184
|
+
})
|
|
185
|
+
|
|
186
|
+
/**
|
|
187
|
+
* Filter array of objects
|
|
188
|
+
*/
|
|
189
|
+
export const filterData = defineTool<
|
|
190
|
+
{ data: unknown[]; filter: Record<string, unknown> },
|
|
191
|
+
{ results: unknown[]; count: number }
|
|
192
|
+
>({
|
|
193
|
+
id: 'data.filter',
|
|
194
|
+
name: 'Filter Data',
|
|
195
|
+
description: 'Filter an array of objects by field values',
|
|
196
|
+
category: 'data',
|
|
197
|
+
subcategory: 'transform',
|
|
198
|
+
input: {
|
|
199
|
+
type: 'object',
|
|
200
|
+
properties: {
|
|
201
|
+
data: { type: 'array', description: 'Array of objects to filter' },
|
|
202
|
+
filter: { type: 'object', description: 'Filter criteria (e.g., { "status": "active" })' },
|
|
203
|
+
},
|
|
204
|
+
required: ['data', 'filter'],
|
|
205
|
+
},
|
|
206
|
+
handler: async (input) => {
|
|
207
|
+
const results = input.data.filter((item) => {
|
|
208
|
+
if (typeof item !== 'object' || item === null) return false
|
|
209
|
+
|
|
210
|
+
for (const [key, value] of Object.entries(input.filter)) {
|
|
211
|
+
if ((item as Record<string, unknown>)[key] !== value) {
|
|
212
|
+
return false
|
|
213
|
+
}
|
|
214
|
+
}
|
|
215
|
+
return true
|
|
216
|
+
})
|
|
217
|
+
|
|
218
|
+
return { results, count: results.length }
|
|
219
|
+
},
|
|
220
|
+
options: {
|
|
221
|
+
audience: 'both',
|
|
222
|
+
tags: ['filter', 'query', 'search'],
|
|
223
|
+
idempotent: true,
|
|
224
|
+
},
|
|
225
|
+
})
|
|
226
|
+
|
|
227
|
+
/**
|
|
228
|
+
* All data tools
|
|
229
|
+
*/
|
|
230
|
+
export const dataTools: AnyTool[] = [
|
|
231
|
+
parseJson,
|
|
232
|
+
stringifyJson,
|
|
233
|
+
parseCsv,
|
|
234
|
+
transformData,
|
|
235
|
+
filterData,
|
|
236
|
+
]
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Common tool implementations
|
|
3
|
+
*
|
|
4
|
+
* Pre-built tools for common operations that can be used
|
|
5
|
+
* out of the box by both humans and AI agents.
|
|
6
|
+
*
|
|
7
|
+
* @packageDocumentation
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
export * from './web.js'
|
|
11
|
+
export * from './data.js'
|
|
12
|
+
export * from './communication.js'
|
package/src/tools/web.ts
ADDED
|
@@ -0,0 +1,161 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Web Tools - HTTP, scraping, browser automation
|
|
3
|
+
*
|
|
4
|
+
* @packageDocumentation
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
import { defineTool } from '../define.js'
|
|
8
|
+
import type { AnyTool } from '../types.js'
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* Fetch content from a URL
|
|
12
|
+
*/
|
|
13
|
+
export const fetchUrl = defineTool<
|
|
14
|
+
{ url: string; method?: string; headers?: Record<string, string>; body?: string },
|
|
15
|
+
{ status: number; headers: Record<string, string>; body: string }
|
|
16
|
+
>({
|
|
17
|
+
id: 'web.fetch',
|
|
18
|
+
name: 'Fetch URL',
|
|
19
|
+
description: 'Fetch content from a URL using HTTP',
|
|
20
|
+
category: 'web',
|
|
21
|
+
subcategory: 'fetch',
|
|
22
|
+
input: {
|
|
23
|
+
type: 'object',
|
|
24
|
+
properties: {
|
|
25
|
+
url: { type: 'string', description: 'URL to fetch' },
|
|
26
|
+
method: { type: 'string', description: 'HTTP method (default: GET)', enum: ['GET', 'POST', 'PUT', 'DELETE', 'PATCH'] },
|
|
27
|
+
headers: { type: 'object', description: 'Request headers' },
|
|
28
|
+
body: { type: 'string', description: 'Request body (for POST/PUT/PATCH)' },
|
|
29
|
+
},
|
|
30
|
+
required: ['url'],
|
|
31
|
+
},
|
|
32
|
+
handler: async (input) => {
|
|
33
|
+
const response = await fetch(input.url, {
|
|
34
|
+
method: input.method || 'GET',
|
|
35
|
+
headers: input.headers,
|
|
36
|
+
body: input.body,
|
|
37
|
+
})
|
|
38
|
+
|
|
39
|
+
const headers: Record<string, string> = {}
|
|
40
|
+
response.headers.forEach((value, key) => {
|
|
41
|
+
headers[key] = value
|
|
42
|
+
})
|
|
43
|
+
|
|
44
|
+
return {
|
|
45
|
+
status: response.status,
|
|
46
|
+
headers,
|
|
47
|
+
body: await response.text(),
|
|
48
|
+
}
|
|
49
|
+
},
|
|
50
|
+
options: {
|
|
51
|
+
audience: 'both',
|
|
52
|
+
tags: ['http', 'network', 'api'],
|
|
53
|
+
},
|
|
54
|
+
})
|
|
55
|
+
|
|
56
|
+
/**
|
|
57
|
+
* Parse HTML and extract content
|
|
58
|
+
*/
|
|
59
|
+
export const parseHtml = defineTool<
|
|
60
|
+
{ html: string; selector?: string },
|
|
61
|
+
{ text: string; links: string[]; images: string[] }
|
|
62
|
+
>({
|
|
63
|
+
id: 'web.parse-html',
|
|
64
|
+
name: 'Parse HTML',
|
|
65
|
+
description: 'Parse HTML content and extract text, links, and images',
|
|
66
|
+
category: 'web',
|
|
67
|
+
subcategory: 'scrape',
|
|
68
|
+
input: {
|
|
69
|
+
type: 'object',
|
|
70
|
+
properties: {
|
|
71
|
+
html: { type: 'string', description: 'HTML content to parse' },
|
|
72
|
+
selector: { type: 'string', description: 'CSS selector to filter content (optional)' },
|
|
73
|
+
},
|
|
74
|
+
required: ['html'],
|
|
75
|
+
},
|
|
76
|
+
handler: async (input) => {
|
|
77
|
+
// Basic HTML parsing without DOM (would use cheerio or jsdom in production)
|
|
78
|
+
const text = input.html.replace(/<[^>]*>/g, ' ').replace(/\s+/g, ' ').trim()
|
|
79
|
+
|
|
80
|
+
// Extract links
|
|
81
|
+
const linkRegex = /href="([^"]+)"/g
|
|
82
|
+
const links: string[] = []
|
|
83
|
+
let match
|
|
84
|
+
while ((match = linkRegex.exec(input.html)) !== null) {
|
|
85
|
+
links.push(match[1])
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
// Extract images
|
|
89
|
+
const imgRegex = /src="([^"]+)"/g
|
|
90
|
+
const images: string[] = []
|
|
91
|
+
while ((match = imgRegex.exec(input.html)) !== null) {
|
|
92
|
+
if (match[1].match(/\.(jpg|jpeg|png|gif|webp|svg)/i)) {
|
|
93
|
+
images.push(match[1])
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
return { text, links, images }
|
|
98
|
+
},
|
|
99
|
+
options: {
|
|
100
|
+
audience: 'both',
|
|
101
|
+
tags: ['html', 'parse', 'extract'],
|
|
102
|
+
},
|
|
103
|
+
})
|
|
104
|
+
|
|
105
|
+
/**
|
|
106
|
+
* Read content from a URL (combines fetch + parse)
|
|
107
|
+
*/
|
|
108
|
+
export const readUrl = defineTool<
|
|
109
|
+
{ url: string },
|
|
110
|
+
{ title: string; text: string; links: string[] }
|
|
111
|
+
>({
|
|
112
|
+
id: 'web.read',
|
|
113
|
+
name: 'Read URL',
|
|
114
|
+
description: 'Read and extract content from a webpage',
|
|
115
|
+
category: 'web',
|
|
116
|
+
subcategory: 'scrape',
|
|
117
|
+
input: {
|
|
118
|
+
type: 'object',
|
|
119
|
+
properties: {
|
|
120
|
+
url: { type: 'string', description: 'URL to read' },
|
|
121
|
+
},
|
|
122
|
+
required: ['url'],
|
|
123
|
+
},
|
|
124
|
+
handler: async (input) => {
|
|
125
|
+
const response = await fetch(input.url)
|
|
126
|
+
const html = await response.text()
|
|
127
|
+
|
|
128
|
+
// Extract title
|
|
129
|
+
const titleMatch = html.match(/<title[^>]*>([^<]+)<\/title>/i)
|
|
130
|
+
const title = titleMatch ? titleMatch[1].trim() : ''
|
|
131
|
+
|
|
132
|
+
// Extract body text
|
|
133
|
+
const bodyMatch = html.match(/<body[^>]*>([\s\S]*)<\/body>/i)
|
|
134
|
+
const body = bodyMatch ? bodyMatch[1] : html
|
|
135
|
+
const text = body.replace(/<script[\s\S]*?<\/script>/gi, '')
|
|
136
|
+
.replace(/<style[\s\S]*?<\/style>/gi, '')
|
|
137
|
+
.replace(/<[^>]*>/g, ' ')
|
|
138
|
+
.replace(/\s+/g, ' ')
|
|
139
|
+
.trim()
|
|
140
|
+
|
|
141
|
+
// Extract links
|
|
142
|
+
const linkRegex = /href="(https?:\/\/[^"]+)"/g
|
|
143
|
+
const links: string[] = []
|
|
144
|
+
let match
|
|
145
|
+
while ((match = linkRegex.exec(html)) !== null) {
|
|
146
|
+
links.push(match[1])
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
return { title, text: text.slice(0, 10000), links: [...new Set(links)] }
|
|
150
|
+
},
|
|
151
|
+
options: {
|
|
152
|
+
audience: 'both',
|
|
153
|
+
tags: ['read', 'scrape', 'extract'],
|
|
154
|
+
idempotent: true,
|
|
155
|
+
},
|
|
156
|
+
})
|
|
157
|
+
|
|
158
|
+
/**
|
|
159
|
+
* All web tools
|
|
160
|
+
*/
|
|
161
|
+
export const webTools: AnyTool[] = [fetchUrl, parseHtml, readUrl]
|