@jini-ai/agent-plugins 0.6.17 → 0.6.22
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +34 -1
- package/NOTICE +14 -0
- package/README.md +35 -14
- package/charts-echarts/plugin.json +39 -0
- package/charts-echarts/skills/charts-echarts/SKILL.md +110 -0
- package/charts-recharts/plugin.json +32 -0
- package/charts-recharts/skills/charts-recharts/SKILL.md +108 -0
- package/cloudflare/NOTES.md +16 -0
- package/cloudflare/form-destinations/cloudflare-d1.mjs +9 -0
- package/cloudflare/lib/api.mjs +96 -0
- package/cloudflare/lib/assets.mjs +65 -0
- package/cloudflare/lib/dns.mjs +32 -0
- package/cloudflare/lib/domain-inventory.mjs +61 -0
- package/cloudflare/lib/domain-status.mjs +48 -0
- package/cloudflare/lib/domains.mjs +95 -0
- package/cloudflare/lib/forms.mjs +278 -0
- package/cloudflare/lib/pages-upload.mjs +51 -0
- package/cloudflare/lib/target.mjs +165 -0
- package/cloudflare/lib/workers-upload.mjs +48 -0
- package/cloudflare/lib/zones.mjs +25 -0
- package/cloudflare/mcp.json +4 -0
- package/cloudflare/plugin.json +96 -0
- package/cloudflare/skills/cloudflare/SKILL.md +57 -0
- package/cloudflare/skills/cloudflare/references/domains.md +31 -0
- package/cloudflare/skills/cloudflare/references/pages.md +18 -0
- package/cloudflare/skills/cloudflare/references/permissions.md +29 -0
- package/cloudflare/skills/cloudflare/references/troubleshooting.md +20 -0
- package/cloudflare/skills/cloudflare/references/workers.md +42 -0
- package/cloudflare/targets/cloudflare-pages.mjs +12 -0
- package/cloudflare/targets/cloudflare-workers.mjs +17 -0
- package/cloudflare/tovu-consent.json +6 -0
- package/cloudflare/tovu-deploy-targets.json +630 -0
- package/cloudflare/tovu-form-destinations.json +12 -0
- package/cloudflare/worker/forms-receiver.mjs +285 -0
- package/composio/mcp.json +10 -0
- package/composio/plugin.json +68 -0
- package/composio/skills/composio/SKILL.md +85 -0
- package/dist/core/identity-namespace.d.ts +12 -0
- package/dist/core/identity-namespace.js +20 -0
- package/dist/folder-zip-node.js +29 -7
- package/dist/lifecycle/activation-reader.d.ts +24 -0
- package/dist/lifecycle/activation-reader.js +27 -0
- package/dist/lifecycle/automatic-use.js +14 -2
- package/dist/lifecycle/bundled-digests.js +4 -3
- package/dist/lifecycle/bundled-file-policy.d.ts +22 -0
- package/dist/lifecycle/bundled-file-policy.js +19 -0
- package/dist/lifecycle/enable-grants.d.ts +26 -0
- package/dist/lifecycle/enable-grants.js +28 -0
- package/dist/lifecycle/index.d.ts +4 -0
- package/dist/lifecycle/index.js +4 -0
- package/dist/lifecycle/install.d.ts +7 -0
- package/dist/lifecycle/install.js +45 -3
- package/dist/lifecycle/manifest.d.ts +2 -2
- package/dist/lifecycle/manifest.js +5 -3
- package/dist/lifecycle/node.js +2 -0
- package/dist/lifecycle/persistent-state.js +1 -1
- package/dist/lifecycle/ports.d.ts +8 -0
- package/dist/lifecycle/search-projection.d.ts +8 -0
- package/dist/lifecycle/search-projection.js +23 -5
- package/dist/lifecycle/search.js +7 -2
- package/dist/lifecycle/seed-bundled.js +4 -1
- package/dist/manifest.d.ts +1 -1
- package/dist/manifest.js +3 -2
- package/fly/deploy-configs/fly.mjs +115 -0
- package/fly/deploy-ops/fly.mjs +102 -0
- package/fly/mcp.json +4 -0
- package/fly/plugin.json +81 -0
- package/fly/scripts/render-deploy-workflow.mjs +150 -0
- package/fly/skills/fly/SKILL.md +43 -0
- package/fly/skills/fly/references/fly-deploy.template.yml +117 -0
- package/fly/skills/fly/references/fly.template.toml +81 -0
- package/fly/tovu-credential-schemes.json +11 -0
- package/fly/tovu-deploy-configs.json +21 -0
- package/fly/tovu-deploy-ops.json +14 -0
- package/github/deploy-ops/github-actions.mjs +164 -0
- package/github/deployments/github.mjs +415 -0
- package/github/mcp.json +4 -0
- package/github/plugin.json +105 -0
- package/github/skills/github/SKILL.md +249 -0
- package/github/skills/github/references/actions.md +224 -0
- package/github/skills/github/references/auth-and-tokens.md +140 -0
- package/github/skills/github/references/repo-files.md +135 -0
- package/github/skills/github/references/site-backup.md +159 -0
- package/github/skills/github/references/source-control.md +123 -0
- package/github/source-control/backup-push.mjs +242 -0
- package/github/source-control/commit-site.mjs +459 -0
- package/github/source-control/github.mjs +93 -0
- package/github/source-control/write-files.mjs +468 -0
- package/github/tovu-deploy-ops.json +13 -0
- package/github/tovu-source-control.json +117 -0
- package/github-pages/NOTES.md +19 -0
- package/github-pages/mcp.json +4 -0
- package/github-pages/plugin.json +48 -0
- package/github-pages/skills/github-pages/SKILL.md +44 -0
- package/github-pages/targets/github-pages.mjs +543 -0
- package/github-pages/tovu-deploy-targets.json +327 -0
- package/google-login/exports/google-g.svg +1 -0
- package/google-login/exports/sign-in-button.css +68 -0
- package/google-login/exports/sign-in-button.html +4 -0
- package/google-login/mcp.json +4 -0
- package/google-login/plugin.json +59 -0
- package/google-login/skills/google-login/SKILL.md +96 -0
- package/google-login/tovu-login-providers.json +21 -0
- package/google-workspace/README.md +132 -0
- package/google-workspace/form-destinations/README.md +87 -0
- package/google-workspace/form-destinations/dedupe.mjs +43 -0
- package/google-workspace/form-destinations/delivery-result.mjs +69 -0
- package/google-workspace/form-destinations/mapping.mjs +152 -0
- package/google-workspace/form-destinations/sheets.mjs +202 -0
- package/google-workspace/lib/auth.mjs +81 -0
- package/google-workspace/lib/drive-files.mjs +54 -0
- package/google-workspace/lib/form-destination-settings.mjs +72 -0
- package/google-workspace/lib/http.mjs +168 -0
- package/google-workspace/lib/picker-flow.mjs +171 -0
- package/google-workspace/lib/picker-selection.mjs +107 -0
- package/google-workspace/lib/product-state.mjs +93 -0
- package/google-workspace/lib/request-policy.mjs +163 -0
- package/google-workspace/lib/sheets-a1.mjs +79 -0
- package/google-workspace/lib/sheets-admin-csv.mjs +82 -0
- package/google-workspace/lib/sheets-admin-request-kinds.mjs +183 -0
- package/google-workspace/lib/sheets-client.mjs +286 -0
- package/google-workspace/lib/surface-actions.mjs +107 -0
- package/google-workspace/mcp.json +4 -0
- package/google-workspace/plugin.json +77 -0
- package/google-workspace/products.json +12 -0
- package/google-workspace/skills/google-workspace/SKILL.md +82 -0
- package/google-workspace/skills/google-workspace/references/connection.md +102 -0
- package/google-workspace/skills/google-workspace/references/form-delivery.md +50 -0
- package/google-workspace/skills/google-workspace/references/sheets.md +149 -0
- package/google-workspace/skills/google-workspace/references/troubleshooting.md +31 -0
- package/google-workspace/tools/account-info.mjs +18 -0
- package/google-workspace/tools/sheets/README.md +54 -0
- package/google-workspace/tools/sheets/copy-tab.mjs +23 -0
- package/google-workspace/tools/sheets/copy.mjs +23 -0
- package/google-workspace/tools/sheets/create.mjs +35 -0
- package/google-workspace/tools/sheets/find-replace.mjs +38 -0
- package/google-workspace/tools/sheets/find.mjs +52 -0
- package/google-workspace/tools/sheets/get-by-data-filter.mjs +23 -0
- package/google-workspace/tools/sheets/get.mjs +22 -0
- package/google-workspace/tools/sheets/values-append.mjs +27 -0
- package/google-workspace/tools/sheets/values-batch-clear.mjs +20 -0
- package/google-workspace/tools/sheets/values-batch-get.mjs +20 -0
- package/google-workspace/tools/sheets/values-batch-update.mjs +29 -0
- package/google-workspace/tools/sheets/values-by-data-filter.mjs +62 -0
- package/google-workspace/tools/sheets/values-clear.mjs +20 -0
- package/google-workspace/tools/sheets/values-get.mjs +21 -0
- package/google-workspace/tools/sheets/values-update.mjs +26 -0
- package/google-workspace/tools/sheets-admin/README.md +45 -0
- package/google-workspace/tools/sheets-admin/basic-filter.mjs +32 -0
- package/google-workspace/tools/sheets-admin/batch-update.mjs +25 -0
- package/google-workspace/tools/sheets-admin/developer-metadata.mjs +28 -0
- package/google-workspace/tools/sheets-admin/export-csv.mjs +67 -0
- package/google-workspace/tools/sheets-admin/filter-views.mjs +38 -0
- package/google-workspace/tools/sheets-admin/format.mjs +70 -0
- package/google-workspace/tools/sheets-admin/named-ranges.mjs +42 -0
- package/google-workspace/tools/sheets-admin/open-existing.mjs +34 -0
- package/google-workspace/tools/sheets-admin/protected-ranges-get.mjs +18 -0
- package/google-workspace/tools/sheets-admin/sort.mjs +18 -0
- package/google-workspace/tools/sheets-admin/tab-modify.mjs +36 -0
- package/google-workspace/tovu-admin-surfaces.json +63 -0
- package/google-workspace/tovu-agent-tools.json +1178 -0
- package/google-workspace/tovu-connections.json +35 -0
- package/google-workspace/tovu-form-destinations.json +10 -0
- package/google-workspace/ui/README.md +73 -0
- package/google-workspace/ui/connection-panel.handler.mjs +167 -0
- package/google-workspace/ui/connection-panel.html +17 -0
- package/google-workspace/ui/connection-panel.mjs +189 -0
- package/google-workspace/ui/connection-view.mjs +120 -0
- package/google-workspace/ui/destination-panel.handler.mjs +106 -0
- package/google-workspace/ui/destination-panel.html +17 -0
- package/google-workspace/ui/destination-panel.mjs +150 -0
- package/google-workspace/ui/dom.mjs +140 -0
- package/google-workspace/ui/panel.css +170 -0
- package/google-workspace/ui/picker-flow.mjs +87 -0
- package/google-workspace/ui/picker-view.mjs +44 -0
- package/google-workspace/ui/picker.handler.mjs +56 -0
- package/google-workspace/ui/picker.html +17 -0
- package/google-workspace/ui/picker.mjs +88 -0
- package/google-workspace/ui/surface-client.mjs +227 -0
- package/higgsfield-media/mcp.json +9 -0
- package/higgsfield-media/plugin.json +109 -0
- package/higgsfield-media/skills/higgsfield-media/SKILL.md +325 -0
- package/higgsfield-media/skills/higgsfield-media/references/failure-modes.md +116 -0
- package/higgsfield-media/skills/higgsfield-media/references/models-and-plan-gates.md +142 -0
- package/jev/mcp.json +4 -0
- package/jev/plugin.json +44 -0
- package/jev/skills/jev/SKILL.md +308 -0
- package/jev/skills/jev/references/cookbooks.md +197 -0
- package/jev/skills/jev/references/jaggedness.md +135 -0
- package/jev/skills/jev/references/javascript-sdk.md +146 -0
- package/jev/skills/jev/references/patterns.md +123 -0
- package/jev/skills/jev/references/primitives-reference.md +187 -0
- package/langfuse/plugin.json +22 -0
- package/meilisearch/mcp.json +4 -0
- package/meilisearch/plugin.json +54 -0
- package/meilisearch/providers/meilisearch.mjs +651 -0
- package/meilisearch/skills/meilisearch/SKILL.md +43 -0
- package/meilisearch/tovu-search-providers.json +10 -0
- package/netlify/NOTES.md +13 -0
- package/netlify/mcp.json +4 -0
- package/netlify/plugin.json +47 -0
- package/netlify/skills/netlify/SKILL.md +39 -0
- package/netlify/targets/netlify.mjs +384 -0
- package/netlify/tovu-consent.json +6 -0
- package/netlify/tovu-deploy-targets.json +163 -0
- package/opentelemetry/mcp.json +4 -0
- package/opentelemetry/plugin.json +52 -0
- package/opentelemetry/skills/opentelemetry/SKILL.md +39 -0
- package/package.json +161 -6
- package/posthog/mcp.json +4 -0
- package/posthog/plugin.json +46 -0
- package/posthog/skills/posthog/SKILL.md +36 -0
- package/railway/deploy-configs/railway.mjs +135 -0
- package/railway/deploy-ops/railway.mjs +167 -0
- package/railway/mcp.json +4 -0
- package/railway/plugin.json +45 -0
- package/railway/skills/railway/SKILL.md +66 -0
- package/railway/tovu-deploy-configs.json +16 -0
- package/railway/tovu-deploy-ops.json +11 -0
- package/render/deploy-configs/render.mjs +141 -0
- package/render/deploy-ops/render.mjs +152 -0
- package/render/mcp.json +4 -0
- package/render/plugin.json +47 -0
- package/render/skills/render/SKILL.md +63 -0
- package/render/tovu-deploy-configs.json +16 -0
- package/render/tovu-deploy-ops.json +11 -0
- package/resend/NOTES.md +52 -0
- package/resend/adapters/resend.mjs +161 -0
- package/resend/lib/domains.mjs +137 -0
- package/resend/lib/errors.mjs +25 -0
- package/resend/lib/feedback.mjs +118 -0
- package/resend/mcp.json +13 -0
- package/resend/plugin.json +192 -0
- package/resend/skills/resend/SKILL.md +107 -0
- package/resend/tovu-mail-adapters.json +22 -0
- package/s3-compatible/NOTES.md +11 -0
- package/s3-compatible/mcp.json +4 -0
- package/s3-compatible/object-stores/s3-compatible.mjs +287 -0
- package/s3-compatible/plugin.json +56 -0
- package/s3-compatible/skills/s3-compatible/SKILL.md +39 -0
- package/s3-compatible/targets/s3-compatible.mjs +1054 -0
- package/s3-compatible/tovu-deploy-targets.json +432 -0
- package/s3-compatible/tovu-object-stores.json +29 -0
- package/sentry/mcp.json +4 -0
- package/sentry/plugin.json +49 -0
- package/sentry/skills/sentry/SKILL.md +34 -0
- package/shopify/mcp.json +4 -0
- package/shopify/plugin.json +22 -0
- package/shopify/skills/shopify/SKILL.md +103 -0
- package/shopify/skills/shopify/references/catalog-sync.md +74 -0
- package/shopify/skills/shopify/references/domains.md +26 -0
- package/shopify/skills/shopify/references/live-storefront.md +34 -0
- package/shopify/skills/shopify/references/storefront-snippets.md +21 -0
- package/site-compliance/mcp.json +4 -0
- package/site-compliance/plugin.json +34 -0
- package/site-compliance/skills/site-compliance/SKILL.md +220 -0
- package/site-compliance/skills/site-compliance/references/ccpa-cpra.md +115 -0
- package/site-compliance/skills/site-compliance/references/gdpr-eu-uk.md +143 -0
- package/site-compliance/skills/site-compliance/references/wcag-2-2.md +129 -0
- package/site-import/mcp.json +4 -0
- package/site-import/plugin.json +41 -0
- package/site-import/skills/site-import/SKILL.md +232 -0
- package/site-import/skills/site-import/references/content-mapping.md +166 -0
- package/site-import/skills/site-import/references/discovery-and-classification.md +117 -0
- package/site-import/skills/site-import/references/theme-extraction.md +34 -0
- package/slide-design/com.anthropic.claude-code/hooks/hooks.json +4 -0
- package/slide-design/mcp.json +4 -0
- package/slide-design/plugin.json +26 -0
- package/slide-design/skills/slide-design/SKILL.md +103 -0
- package/slide-design/skills/slide-design/references/charts-and-exhibits.md +100 -0
- package/slide-design/skills/slide-design/references/html-deck.md +175 -0
- package/slide-design/skills/slide-design/references/layout-and-style.md +131 -0
- package/slide-design/skills/slide-design/references/review.md +93 -0
- package/slide-design/skills/slide-design/references/storyline.md +118 -0
- package/stripe/plugin.json +22 -0
- package/supabase/mcp.json +26 -0
- package/supabase/plugin.json +78 -0
- package/supabase/skills/supabase/SKILL.md +169 -0
- package/supabase/skills/supabase/references/failure-modes.md +101 -0
- package/ui-ux-design/CHANGELOG.md +28 -0
- package/ui-ux-design/LICENSE +201 -0
- package/ui-ux-design/NOTICE +14 -0
- package/ui-ux-design/README.md +62 -0
- package/ui-ux-design/com.anthropic.claude-code/hooks/hooks.json +4 -0
- package/ui-ux-design/mcp.json +4 -0
- package/ui-ux-design/plugin.json +26 -0
- package/ui-ux-design/skills/frontend-accessibility/SKILL.md +60 -0
- package/ui-ux-design/skills/gstack-design/SKILL.md +53 -0
- package/ui-ux-design/skills/gstack-design/references/consultation.md +30 -0
- package/ui-ux-design/skills/gstack-design/references/html.md +29 -0
- package/ui-ux-design/skills/gstack-design/references/review.md +28 -0
- package/ui-ux-design/skills/gstack-design/references/shotgun.md +33 -0
- package/ui-ux-design/skills/gstack-design/references/upstream-notes.md +23 -0
- package/ui-ux-design/skills/interface-design/ORIGINAL.md +16 -0
- package/ui-ux-design/skills/interface-design/SKILL.md +41 -0
- package/ui-ux-design/skills/interface-design/references/commands/audit.md +40 -0
- package/ui-ux-design/skills/interface-design/references/commands/critique.md +21 -0
- package/ui-ux-design/skills/interface-design/references/commands/extract.md +34 -0
- package/ui-ux-design/skills/interface-design/references/commands/init.md +31 -0
- package/ui-ux-design/skills/interface-design/references/commands/status.md +22 -0
- package/ui-ux-design/skills/interface-design/references/examples/system-precision.md +29 -0
- package/ui-ux-design/skills/interface-design/references/examples/system-warmth.md +29 -0
- package/ui-ux-design/skills/interface-design/references/system-template.md +57 -0
- package/ui-ux-design/skills/shadcn-ui/README.md +244 -0
- package/ui-ux-design/skills/shadcn-ui/SKILL.md +333 -0
- package/ui-ux-design/skills/shadcn-ui/examples/auth-layout.tsx +177 -0
- package/ui-ux-design/skills/shadcn-ui/examples/data-table.tsx +313 -0
- package/ui-ux-design/skills/shadcn-ui/examples/form-pattern.tsx +177 -0
- package/ui-ux-design/skills/shadcn-ui/resources/component-catalog.md +481 -0
- package/ui-ux-design/skills/shadcn-ui/resources/customization-guide.md +516 -0
- package/ui-ux-design/skills/shadcn-ui/resources/migration-guide.md +463 -0
- package/ui-ux-design/skills/shadcn-ui/resources/setup-guide.md +412 -0
- package/ui-ux-design/skills/shadcn-ui/scripts/verify-setup.sh +134 -0
- package/ui-ux-design/skills/ui-ux-design/SKILL.md +171 -0
- package/ui-ux-design/skills/ui-ux-design/references/brand-and-voice.md +78 -0
- package/ui-ux-design/skills/ui-ux-design/references/chrome-mobile-test-matrix.md +137 -0
- package/ui-ux-design/skills/ui-ux-design/references/components-and-states.md +112 -0
- package/ui-ux-design/skills/ui-ux-design/references/delight-and-motion.md +54 -0
- package/ui-ux-design/skills/ui-ux-design/references/foundations.md +145 -0
- package/ui-ux-design/skills/ui-ux-design/references/inclusive-ai-imagery.md +57 -0
- package/ui-ux-design/skills/ui-ux-design/references/kole-jain-uiux-concepts.md +104 -0
- package/ui-ux-design/skills/ui-ux-design/references/kuinetic-reference.md +184 -0
- package/ui-ux-design/skills/ui-ux-design/references/openai-frontend-skill.md +139 -0
- package/ui-ux-design/skills/ui-ux-design/references/premium-ui.md +55 -0
- package/ui-ux-design/skills/ui-ux-design/references/research-and-validation.md +88 -0
- package/ui-ux-design/skills/ui-ux-design/references/sam-crawford-premium-websites.md +103 -0
- package/ui-ux-design/skills/ui-ux-design/references/self-made-web-designer-core-skills.md +119 -0
- package/ui-ux-design/skills/ui-ux-design/references/ui-animation.md +173 -0
- package/ui-ux-design/skills/ui-ux-design/references/ui-loop.md +234 -0
- package/ui-ux-design/skills/ui-ux-design/references/visual-storytelling.md +54 -0
- package/ui-ux-design/skills/vercel-web-design-guidelines/SKILL.md +39 -0
- package/ui-ux-design/skills/web-compliance/SKILL.md +134 -0
- package/ui-ux-design/skills/web-compliance/references/audit-evidence.md +59 -0
- package/vercel/NOTES.md +23 -0
- package/vercel/mcp.json +4 -0
- package/vercel/object-stores/vercel-blob.mjs +147 -0
- package/vercel/plugin.json +47 -0
- package/vercel/skills/vercel/SKILL.md +48 -0
- package/vercel/targets/vercel.mjs +644 -0
- package/vercel/tovu-consent.json +6 -0
- package/vercel/tovu-deploy-targets.json +219 -0
- package/vercel/tovu-object-stores.json +10 -0
- package/wordpress/NOTES.md +33 -0
- package/wordpress/plugin.json +30 -0
- package/wordpress/skills/wordpress/SKILL.md +43 -0
- package/wordpress/skills/wordpress/references/free-site-redirect.md +46 -0
- package/wordpress/skills/wordpress/references/subdomain.md +66 -0
|
@@ -0,0 +1,285 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Form submissions receiver, uploaded as `receiver.mjs` beside the site's static assets.
|
|
3
|
+
* Runs inside the Cloudflare Workers runtime: no imports, no Node APIs, Web platform only.
|
|
4
|
+
* Forms and full validation belong to the host; this receiver enforces its published supported
|
|
5
|
+
* subset and rejects unsupported fields at publish time.
|
|
6
|
+
* Never log answers, IPs or the management secret: only fixed reason codes.
|
|
7
|
+
*/
|
|
8
|
+
export const LIMITS = Object.freeze({ maxBodyBytes: 64 * 1024, maxFields: 100, maxValueLength: 5000, ratePerWindow: 5, windowSeconds: 60, maxPage: 100 });
|
|
9
|
+
/** The host's reserved names: the honeypot and the double-submit attempt token. Never stored. */
|
|
10
|
+
const HONEYPOT = '_hp';
|
|
11
|
+
const RESERVED = new Set([HONEYPOT, '_attempt']);
|
|
12
|
+
/** The host's existing result query names (`form`, `form_status`), so a returning page reads one vocabulary. */
|
|
13
|
+
const RESULT_KEYS = ['form', 'form_status', 'form_errors', 'form_retry_after'];
|
|
14
|
+
const SUBMIT_PATH = /^\/forms\/([a-z0-9][a-z0-9-]{0,99})\/submit\/?$/;
|
|
15
|
+
|
|
16
|
+
/** Routes form POSTs and the private pull API; every other request is the static site.
|
|
17
|
+
* @complexity O(body bytes + fields) per submission; O(page) per pull. */
|
|
18
|
+
export async function handleRequest({ request, env, manifest }, options = {}) {
|
|
19
|
+
const url = new URL(request.url);
|
|
20
|
+
const submit = SUBMIT_PATH.exec(url.pathname);
|
|
21
|
+
if (submit) return request.method === 'POST' ? handleSubmit({ request, env, manifest, slug: submit[1] }, options) : errorPage({ status: 405, message: 'This address only accepts form submissions.' });
|
|
22
|
+
if (url.pathname === '/_tovu/forms/pending') return request.method === 'GET' ? guarded({ request, env, work: () => listPending({ env, url }, options) }) : json({ status: 405, body: { error: 'METHOD_NOT_ALLOWED' } });
|
|
23
|
+
if (url.pathname === '/_tovu/forms/ack') return request.method === 'POST' ? guarded({ request, env, work: () => acknowledge({ request, env }, options) }) : json({ status: 405, body: { error: 'METHOD_NOT_ALLOWED' } });
|
|
24
|
+
const slug = sentFormSlug({ request, url, manifest });
|
|
25
|
+
return slug ? withSentNotice({ request, env, slug }, options) : env.ASSETS.fetch(request);
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
/** The form named by the host's own success query (`form=<slug>&form_status=success`) on a page GET, if
|
|
29
|
+
* it is one of this site's forms. Any other request is served untouched. */
|
|
30
|
+
export function sentFormSlug({ request, url, manifest }, _options = {}) {
|
|
31
|
+
if (request.method !== 'GET' || url.searchParams.get('form_status') !== 'success') return null;
|
|
32
|
+
const slug = url.searchParams.get('form');
|
|
33
|
+
return manifest.forms.some(form => form.slug === slug) ? slug : null;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
/** The static page with the same "sent" state the host's server renders: the form hidden and its own
|
|
37
|
+
* success slot shown. A page without a slot gets one plain accessible message after the form.
|
|
38
|
+
* Non-HTML or unsuccessful asset responses pass through unchanged. */
|
|
39
|
+
export async function withSentNotice({ request, env, slug }, { Rewriter = globalThis.HTMLRewriter } = {}) {
|
|
40
|
+
const response = await env.ASSETS.fetch(request);
|
|
41
|
+
if (!response.ok || !(response.headers.get('Content-Type') ?? '').includes('text/html') || !Rewriter) return response;
|
|
42
|
+
const rewriter = new Rewriter();
|
|
43
|
+
for (const [selector, handler] of sentNoticeHandlers({ slug })) rewriter.on(selector, handler);
|
|
44
|
+
return rewriter.transform(response);
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
const SENT_MESSAGE = 'Thanks, your submission was received.';
|
|
48
|
+
/** Element handlers in document order. The host renders the success slot before its form, so the form
|
|
49
|
+
* handler already knows whether a slot was shown. Selectors use the generic success hooks only. */
|
|
50
|
+
export function sentNoticeHandlers({ slug }, _options = {}) {
|
|
51
|
+
const state = { slot: false, noticed: false };
|
|
52
|
+
const showSlot = { element(element) { element.removeAttribute('hidden'); state.slot = true; } };
|
|
53
|
+
const hideForm = { element(element) {
|
|
54
|
+
element.setAttribute('hidden', '');
|
|
55
|
+
if (state.slot || state.noticed) return;
|
|
56
|
+
state.noticed = true;
|
|
57
|
+
element.after(`<p class="tovu-form-success" data-form-slug="${slug}" role="status">${SENT_MESSAGE}</p>`, { html: true });
|
|
58
|
+
} };
|
|
59
|
+
return [
|
|
60
|
+
[`div.tovu-form-success[data-form-slug="${slug}"]`, showSlot],
|
|
61
|
+
[`div[data-tovu-form-success][data-form-slug="${slug}"]`, showSlot],
|
|
62
|
+
[`form[data-form-slug="${slug}"]`, hideForm],
|
|
63
|
+
];
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
/** Honeypot, light manifest checks, D1 rate window, insert, then 303 to the success page. */
|
|
67
|
+
export async function handleSubmit({ request, env, manifest, slug }, { now = () => Date.now(), randomId = () => crypto.randomUUID() } = {}) {
|
|
68
|
+
const back = backLink({ request });
|
|
69
|
+
const form = manifest.forms.find(item => item.slug === slug);
|
|
70
|
+
if (!form) return errorPage({ status: 404, message: 'This form is not available.', back });
|
|
71
|
+
const parsed = await readFields({ request });
|
|
72
|
+
if (parsed.error) return errorPage({ ...parsed.error, back });
|
|
73
|
+
if ((parsed.fields.get(HONEYPOT) ?? []).some(value => value.trim() !== '')) return successRedirect({ request, form });
|
|
74
|
+
const checked = checkFields({ form, fields: parsed.fields });
|
|
75
|
+
if (checked.error) return errorPage({ status: 400, message: checked.error, back });
|
|
76
|
+
const refused = await storeSubmission({ db: env.TOVU_FORMS, slug, answers: checked.answers, ip: request.headers.get('CF-Connecting-IP'), secret: env.TOVU_FORMS_SECRET, back }, { now, randomId });
|
|
77
|
+
return refused ?? successRedirect({ request, form });
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
/** Rate window, then insert. Returns the error page to send, or null once the row is stored. */
|
|
81
|
+
async function storeSubmission({ db, slug, answers, ip, secret, back }, { now, randomId }) {
|
|
82
|
+
try {
|
|
83
|
+
if (!await withinRate({ db, key: await rateKey({ slug, ip, secret }), nowMs: now() })) return errorPage({ status: 429, message: 'Too many submissions. Wait a minute, then try again.', back });
|
|
84
|
+
await db.prepare('INSERT INTO submissions (id, form_slug, answers_json, submitted_at, ip) VALUES (?, ?, ?, ?, ?)')
|
|
85
|
+
.bind(randomId(), slug, JSON.stringify(answers), new Date(now()).toISOString(), null).run();
|
|
86
|
+
return null;
|
|
87
|
+
} catch {
|
|
88
|
+
console.error('FORMS_STORE_FAILED');
|
|
89
|
+
return errorPage({ status: 503, message: 'Your submission could not be saved. Try again in a few minutes.', back });
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
/** Reads at most LIMITS.maxBodyBytes while streaming, then parses URL-encoded or multipart text fields.
|
|
94
|
+
* Repeated names (checkbox groups) keep every value in order. */
|
|
95
|
+
export async function readFields({ request }, _options = {}) {
|
|
96
|
+
const type = (request.headers.get('Content-Type') ?? '').toLowerCase();
|
|
97
|
+
const multipart = type.startsWith('multipart/form-data');
|
|
98
|
+
if (!multipart && !type.startsWith('application/x-www-form-urlencoded')) return { error: { status: 415, message: 'This form must be sent as a normal web form.' } };
|
|
99
|
+
const bytes = await readBounded({ request });
|
|
100
|
+
if (!bytes) return { error: { status: 413, message: 'The submission is too large.' } };
|
|
101
|
+
const entries = multipart ? await multipartEntries({ bytes, type: request.headers.get('Content-Type') }) : [...new URLSearchParams(new TextDecoder().decode(bytes))];
|
|
102
|
+
const error = entriesError({ entries });
|
|
103
|
+
if (error) return { error };
|
|
104
|
+
const fields = new Map();
|
|
105
|
+
for (const [name, value] of entries) fields.set(name, [...(fields.get(name) ?? []), value]);
|
|
106
|
+
return { fields };
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
function entriesError({ entries }, _options = {}) {
|
|
110
|
+
if (!entries) return { status: 400, message: 'The submission could not be read.' };
|
|
111
|
+
if (entries.length > LIMITS.maxFields) return { status: 413, message: 'The submission has too many fields.' };
|
|
112
|
+
if (entries.some(([, value]) => typeof value !== 'string')) return { status: 400, message: 'File uploads are not accepted by this form.' };
|
|
113
|
+
return null;
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
async function readBounded({ request }, _options = {}) {
|
|
117
|
+
if (Number(request.headers.get('Content-Length')) > LIMITS.maxBodyBytes) return null;
|
|
118
|
+
if (!request.body) return new Uint8Array();
|
|
119
|
+
const chunks = [];
|
|
120
|
+
let size = 0;
|
|
121
|
+
for await (const chunk of request.body) {
|
|
122
|
+
size += chunk.byteLength;
|
|
123
|
+
if (size > LIMITS.maxBodyBytes) return null;
|
|
124
|
+
chunks.push(chunk);
|
|
125
|
+
}
|
|
126
|
+
const bytes = new Uint8Array(size);
|
|
127
|
+
let offset = 0;
|
|
128
|
+
for (const chunk of chunks) { bytes.set(chunk, offset); offset += chunk.byteLength; }
|
|
129
|
+
return bytes;
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
async function multipartEntries({ bytes, type }, _options = {}) {
|
|
133
|
+
try { return [...await new Response(bytes, { headers: { 'Content-Type': type } }).formData()]; }
|
|
134
|
+
catch { return null; }
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
/** Manifest-driven light validation; the host re-validates every answer on import.
|
|
138
|
+
* @returns {{answers: Record<string, string|string[]>} | {error: string}} */
|
|
139
|
+
export function checkFields({ form, fields }, _options = {}) {
|
|
140
|
+
const known = new Map(form.fields.map(field => [field.name, field]));
|
|
141
|
+
const unknown = [...fields.keys()].find(name => !RESERVED.has(name) && !known.has(name));
|
|
142
|
+
if (unknown !== undefined) return { error: `The field "${unknown}" is not part of this form.` };
|
|
143
|
+
const answers = {};
|
|
144
|
+
for (const field of form.fields) {
|
|
145
|
+
const problem = fieldProblem({ field, values: fields.get(field.name) ?? [] });
|
|
146
|
+
if (problem) return { error: problem };
|
|
147
|
+
const values = fields.get(field.name);
|
|
148
|
+
if (values) answers[field.name] = field.multiple ? values : values[0];
|
|
149
|
+
}
|
|
150
|
+
return { answers };
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
/** Only the published supported subset is accepted. Deployment refuses richer validation rather
|
|
154
|
+
* than showing success for answers the live form would reject. O(values + option count). */
|
|
155
|
+
function fieldProblem({ field, values }, _options = {}) {
|
|
156
|
+
if (field.validationUnsupported || field.type === 'file') return `"${field.name}" cannot be received here. Contact the site owner.`;
|
|
157
|
+
if (!field.multiple && values.length > 1) return `"${field.name}" was sent more than once.`;
|
|
158
|
+
if (values.length === 0) return field.required ? `"${field.name}" is required.` : null;
|
|
159
|
+
if (field.type === 'checkbox' || field.type === 'toggle') return checkboxProblem({ field, values });
|
|
160
|
+
return textFieldProblem({ field, values });
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
/** Text and choice checks run only after presence/multiplicity and checkbox admission. */
|
|
164
|
+
function textFieldProblem({ field, values }, _options = {}) {
|
|
165
|
+
if (field.required && !values.some(value => value.trim() !== '')) return `"${field.name}" is required.`;
|
|
166
|
+
const max = field.maxLength ?? LIMITS.maxValueLength;
|
|
167
|
+
if (values.some(value => [...value].length > max)) return `"${field.name}" is longer than ${max} characters.`;
|
|
168
|
+
if (values.some(value => value !== '' && value.length < (field.minLength ?? 0))) return `"${field.name}" is too short.`;
|
|
169
|
+
return typedFieldProblem({ field, values });
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
function checkboxProblem({ field, values }, _options = {}) {
|
|
173
|
+
const expected = field.checkboxValue ?? 'on';
|
|
174
|
+
return values[0] === expected ? null : `"${field.name}" must be checked with its declared value.`;
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
// Native email syntax, equivalent to the live CMS field adapter. Full-match checks refuse a final newline.
|
|
178
|
+
const EMAIL_PATTERN = /^[a-zA-Z0-9.!#$%&'*+\/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/;
|
|
179
|
+
function typedFieldProblem({ field, values }, _options = {}) {
|
|
180
|
+
if (field.type === 'email' && values.some(value => value !== '' && EMAIL_PATTERN.exec(value)?.[0] !== value)) return `"${field.name}" must be an email address.`;
|
|
181
|
+
if (!field.options) return null;
|
|
182
|
+
if (!field.multiple && !field.required && values[0] === '') return null;
|
|
183
|
+
const allowed = new Set(field.options);
|
|
184
|
+
if (new Set(values).size !== values.length || values.some(value => !allowed.has(value))) return `"${field.name}" contains an unavailable choice.`;
|
|
185
|
+
return null;
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
/** Secret-salted short-lived pseudonyms prevent offline IPv4 enumeration; no raw IP persists. */
|
|
189
|
+
async function rateKey({ slug, ip, secret }, _options = {}) {
|
|
190
|
+
if (typeof secret !== 'string' || secret.length < 32) throw new Error('FORMS_RECEIVER_SECRET_MISSING');
|
|
191
|
+
const digest = await crypto.subtle.digest('SHA-256', new TextEncoder().encode(JSON.stringify([secret, slug, ip ?? 'unknown'])));
|
|
192
|
+
return [...new Uint8Array(digest)].map(byte => byte.toString(16).padStart(2, '0')).join('');
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
/** Fixed-window counter in D1 (shared by every isolate). Counts only valid submissions.
|
|
196
|
+
* Stale windows for any key are pruned in the same batch; no matching rows means no row writes. */
|
|
197
|
+
export async function withinRate({ db, key, nowMs }, _options = {}) {
|
|
198
|
+
const windowStart = Math.floor(nowMs / 1000 / LIMITS.windowSeconds) * LIMITS.windowSeconds;
|
|
199
|
+
const [counted] = await db.batch([
|
|
200
|
+
db.prepare('INSERT INTO rate_windows (key, window_start, count) VALUES (?, ?, 1) ON CONFLICT(key) DO UPDATE SET count = CASE WHEN rate_windows.window_start = excluded.window_start THEN rate_windows.count + 1 ELSE 1 END, window_start = excluded.window_start RETURNING count').bind(key, windowStart),
|
|
201
|
+
db.prepare('DELETE FROM rate_windows WHERE window_start < ?').bind(windowStart - 3600),
|
|
202
|
+
]);
|
|
203
|
+
return Number(counted.results?.[0]?.count ?? Infinity) <= LIMITS.ratePerWindow;
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
/** The form's own success page when it has one; otherwise the referring page on this host (or `/`)
|
|
207
|
+
* with the host's result query names, exactly as the live site's 303 sets them. */
|
|
208
|
+
export function successRedirect({ request, form }, _options = {}) {
|
|
209
|
+
const target = form.successPath ? new URL(form.successPath, request.url) : (sameHostReferer({ request }) ?? new URL('/', request.url));
|
|
210
|
+
if (!form.successPath) {
|
|
211
|
+
for (const key of RESULT_KEYS) target.searchParams.delete(key);
|
|
212
|
+
target.searchParams.set('form', form.slug);
|
|
213
|
+
target.searchParams.set('form_status', 'success');
|
|
214
|
+
}
|
|
215
|
+
return new Response(null, { status: 303, headers: { Location: `${target.pathname}${target.search}`, 'Cache-Control': 'no-store' } });
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
function sameHostReferer({ request }, _options = {}) {
|
|
219
|
+
try {
|
|
220
|
+
const referer = new URL(request.headers.get('Referer') ?? '');
|
|
221
|
+
return referer.host === new URL(request.url).host && !referer.pathname.startsWith('//') ? referer : null;
|
|
222
|
+
} catch { return null; }
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
function backLink({ request }, _options = {}) {
|
|
226
|
+
const referer = sameHostReferer({ request });
|
|
227
|
+
return referer ? `${referer.pathname}${referer.search}` : '/';
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
const escapeHtml = value => String(value).replace(/[&<>"']/g, char => `&#${char.charCodeAt(0)};`);
|
|
231
|
+
|
|
232
|
+
/** Minimal accessible page; the site's theme is never copied here. */
|
|
233
|
+
export function errorPage({ status, message, back = '/' }, _options = {}) {
|
|
234
|
+
const body = `<!doctype html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1"><title>Form not sent</title></head>`
|
|
235
|
+
+ `<body><main><h1>Form not sent</h1><p role="alert">${escapeHtml(message)}</p><p><a href="${escapeHtml(back)}">Go back</a></p></main></body></html>`;
|
|
236
|
+
return new Response(body, { status, headers: { 'Content-Type': 'text/html; charset=utf-8', 'Cache-Control': 'no-store' } });
|
|
237
|
+
}
|
|
238
|
+
|
|
239
|
+
function json({ status = 200, body }, _options = {}) {
|
|
240
|
+
return Response.json(body, { status, headers: { 'Cache-Control': 'no-store' } });
|
|
241
|
+
}
|
|
242
|
+
|
|
243
|
+
/** Bearer check with a constant-time comparison of SHA-256 digests (equal length by construction). */
|
|
244
|
+
export async function authorized({ request, env }, _options = {}) {
|
|
245
|
+
const secret = env.TOVU_FORMS_SECRET;
|
|
246
|
+
const header = request.headers.get('Authorization') ?? '';
|
|
247
|
+
if (typeof secret !== 'string' || secret.length < 32 || !header.startsWith('Bearer ')) return false;
|
|
248
|
+
const encoder = new TextEncoder();
|
|
249
|
+
const [given, expected] = await Promise.all([header.slice(7), secret].map(value => crypto.subtle.digest('SHA-256', encoder.encode(value))));
|
|
250
|
+
const left = new Uint8Array(given);
|
|
251
|
+
const right = new Uint8Array(expected);
|
|
252
|
+
let difference = 0;
|
|
253
|
+
for (let index = 0; index < left.length; index += 1) difference |= left[index] ^ right[index];
|
|
254
|
+
return difference === 0;
|
|
255
|
+
}
|
|
256
|
+
|
|
257
|
+
async function guarded({ request, env, work }, _options = {}) {
|
|
258
|
+
if (!await authorized({ request, env })) return json({ status: 401, body: { error: 'UNAUTHORIZED' } });
|
|
259
|
+
try { return await work(); }
|
|
260
|
+
catch { console.error('FORMS_PULL_FAILED'); return json({ status: 503, body: { error: 'STORAGE_UNAVAILABLE' } }); }
|
|
261
|
+
}
|
|
262
|
+
|
|
263
|
+
/** Oldest unpulled rows after `after`, at most LIMITS.maxPage. */
|
|
264
|
+
export async function listPending({ env, url }, _options = {}) {
|
|
265
|
+
const after = Math.max(0, Number.parseInt(url.searchParams.get('after') ?? '0', 10) || 0);
|
|
266
|
+
const limit = Math.min(LIMITS.maxPage, Math.max(1, Number.parseInt(url.searchParams.get('limit') ?? '50', 10) || 50));
|
|
267
|
+
const { results = [] } = await env.TOVU_FORMS.prepare('SELECT seq, id, form_slug, answers_json, submitted_at FROM submissions WHERE pulled_at IS NULL AND seq > ? ORDER BY seq LIMIT ?').bind(after, limit).all();
|
|
268
|
+
const items = results.map(row => ({ seq: row.seq, id: row.id, formSlug: row.form_slug, answers: JSON.parse(row.answers_json), submittedAt: row.submitted_at, ip: null }));
|
|
269
|
+
return json({ body: { items, nextAfter: items.length ? items[items.length - 1].seq : after, hasMore: items.length === limit } });
|
|
270
|
+
}
|
|
271
|
+
|
|
272
|
+
function validIds({ ids }, _options = {}) {
|
|
273
|
+
return Array.isArray(ids) && ids.length > 0 && ids.length <= LIMITS.maxPage && ids.every(id => typeof id === 'string' && id.length > 0 && id.length <= 64);
|
|
274
|
+
}
|
|
275
|
+
|
|
276
|
+
/** Delete committed remote copies. The durable local receipt makes repeat acknowledgements safe. */
|
|
277
|
+
export async function acknowledge({ request, env }, { now = () => Date.now() } = {}) {
|
|
278
|
+
let body;
|
|
279
|
+
try { body = await request.json(); } catch { body = null; }
|
|
280
|
+
const ids = body?.ids;
|
|
281
|
+
if (!validIds({ ids })) return json({ status: 400, body: { error: 'INVALID_IDS' } });
|
|
282
|
+
const result = await env.TOVU_FORMS.prepare(`DELETE FROM submissions WHERE id IN (${ids.map(() => '?').join(', ')})`)
|
|
283
|
+
.bind(...ids).run();
|
|
284
|
+
return json({ body: { acknowledged: Number(result.meta?.changes ?? 0) } });
|
|
285
|
+
}
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://agent-plugins.org/schemas/1.0.0/plugin.schema.json",
|
|
3
|
+
"name": "composio",
|
|
4
|
+
"version": "1.0.0",
|
|
5
|
+
"description": "Lets the assistant use the user's other apps (Gmail, Google Calendar, Slack, Notion, GitHub, HubSpot, Linear and 1000+ more) through Composio Connect, Composio's hosted MCP server. One browser sign-in to Composio connects it; each app is then connected on first use by a Composio sign-in link, with no API keys anywhere.",
|
|
6
|
+
"author": "Tovu",
|
|
7
|
+
"license": "Apache-2.0",
|
|
8
|
+
"extensions": {
|
|
9
|
+
"tovu": {
|
|
10
|
+
"maturity": "soon",
|
|
11
|
+
"summary": "Lets the assistant use your other apps, like Gmail, Google Calendar, Slack and Notion. You connect each app with one sign-in link.",
|
|
12
|
+
"id": "tovu/composio",
|
|
13
|
+
"provides": [
|
|
14
|
+
"app-connectors"
|
|
15
|
+
],
|
|
16
|
+
"credentialCards": [
|
|
17
|
+
{
|
|
18
|
+
"target": "composio",
|
|
19
|
+
"title": "Connect Composio",
|
|
20
|
+
"label": "Composio account",
|
|
21
|
+
"category": "general",
|
|
22
|
+
"intro": "Connect Composio to use your other apps. Sign in here, then approve each app separately when you need it.",
|
|
23
|
+
"usedFor": [
|
|
24
|
+
"Finds tools for your other apps",
|
|
25
|
+
"Connects each app with your approval and carries out the tasks you request"
|
|
26
|
+
],
|
|
27
|
+
"keyHint": "Browser sign-in only; this connection does not accept a pasted API key.",
|
|
28
|
+
"saveKind": "oauth",
|
|
29
|
+
"permissions": "Connects tool discovery, schemas, account connections and requested app actions. App permissions are approved at each app’s own sign-in. Connection management and action execution need separate write grants; do not grant remote Bash or workbench tools.",
|
|
30
|
+
"baseUrl": "https://connect.composio.dev"
|
|
31
|
+
}
|
|
32
|
+
]
|
|
33
|
+
}
|
|
34
|
+
},
|
|
35
|
+
"keywords": [
|
|
36
|
+
"composio",
|
|
37
|
+
"apps",
|
|
38
|
+
"connect",
|
|
39
|
+
"connect-my-account",
|
|
40
|
+
"integrations",
|
|
41
|
+
"connectors",
|
|
42
|
+
"gmail",
|
|
43
|
+
"email",
|
|
44
|
+
"google-calendar",
|
|
45
|
+
"calendar",
|
|
46
|
+
"google-drive",
|
|
47
|
+
"google-sheets",
|
|
48
|
+
"slack",
|
|
49
|
+
"notion",
|
|
50
|
+
"github",
|
|
51
|
+
"linear",
|
|
52
|
+
"jira",
|
|
53
|
+
"hubspot",
|
|
54
|
+
"crm",
|
|
55
|
+
"discord",
|
|
56
|
+
"stripe",
|
|
57
|
+
"airtable",
|
|
58
|
+
"trello",
|
|
59
|
+
"asana",
|
|
60
|
+
"automation",
|
|
61
|
+
"send-email",
|
|
62
|
+
"external-mcp",
|
|
63
|
+
"mcp",
|
|
64
|
+
"oauth",
|
|
65
|
+
"sign-in",
|
|
66
|
+
"app-connectors"
|
|
67
|
+
]
|
|
68
|
+
}
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: composio
|
|
3
|
+
description: Use the user's other apps (Gmail, Calendar, Slack, Notion, GitHub, HubSpot, 1000+ more) through Composio Connect, Composio's hosted MCP server. Covers connecting from nothing (one browser sign-in to Composio, no API key), the grants the connection needs, and the per-app flow - search for a tool, read its schema, connect the app with a Composio sign-in link, then execute.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Composio: the user's other apps
|
|
7
|
+
|
|
8
|
+
## Connection card
|
|
9
|
+
|
|
10
|
+
Choose the card yourself from its `usedFor` list. Reuse a saved key or working sign-in for that
|
|
11
|
+
task. Never offer a replacement unless the person asks.
|
|
12
|
+
|
|
13
|
+
`agent_plugin_connect {pluginId:"composio"}` shows the plugin-declared **Connect Composio** card. Review each app’s sign-in permissions and grant only the requested tools. This hosted connection declares no token fallback; do not request or save a Composio API key.
|
|
14
|
+
|
|
15
|
+
Composio Connect is an **external MCP server** at `https://connect.composio.dev/mcp`. It does not
|
|
16
|
+
expose one tool per app. It exposes a handful of meta-tools, and you reach every app through them.
|
|
17
|
+
Its tools arrive in chat as `mcp__composio__<TOOL>`.
|
|
18
|
+
|
|
19
|
+
| Tool | What it is for |
|
|
20
|
+
|---|---|
|
|
21
|
+
| `COMPOSIO_SEARCH_TOOLS` | Find the app tool that does what the user asked ("send an email", "create a Linear issue") |
|
|
22
|
+
| `COMPOSIO_GET_TOOL_SCHEMAS` | Read the exact inputs of the tools you found |
|
|
23
|
+
| `COMPOSIO_MANAGE_CONNECTIONS` | Check whether an app is connected; get a sign-in link for one that is not |
|
|
24
|
+
| `COMPOSIO_WAIT_FOR_CONNECTIONS` | Wait while the user finishes that app sign-in |
|
|
25
|
+
| `COMPOSIO_MULTI_EXECUTE_TOOL` | Run the app tool(s) |
|
|
26
|
+
|
|
27
|
+
## Connecting from nothing
|
|
28
|
+
|
|
29
|
+
**Never ask the user for a Composio API key, and never accept one pasted into chat.** Composio
|
|
30
|
+
Connect signs the user in by standard MCP OAuth in their browser. The host discovers Composio's
|
|
31
|
+
endpoints and registers its own client, so nobody types a URL, client id or secret.
|
|
32
|
+
|
|
33
|
+
1. **Turn the plugin on.** It ships disabled. Offer to enable it; on yes call `plugins_set_enabled`
|
|
34
|
+
with `family: "agent-plugin"`, `pluginId: "composio"`, `enabled: true` (the user approves a
|
|
35
|
+
dialog), or they use the **Agent Plugins** screen. Enabling creates the `composio` connection row.
|
|
36
|
+
2. **Sign in.** Call `agent_plugin_connect { pluginId: "composio" }`. It provisions the declared
|
|
37
|
+
connection, shows the secure browser sign-in card and waits. On `status: "connected"`, continue;
|
|
38
|
+
on `status: "waiting-for-sign-in"`, wait for the person to return, then call it again once.
|
|
39
|
+
Say: "Sign in to Composio (free account; sign up there if you have none)." If it refuses because
|
|
40
|
+
the site is not set up for sign-in from chat, follow the host guidance for signing in elsewhere;
|
|
41
|
+
do not retry. Never create a second connection or use Bash, curl or a remote workbench to sign in.
|
|
42
|
+
3. **Grant the tools**, see [Grants](#grants). The host guidance says where grants are made and
|
|
43
|
+
whether a saved grant needs an assistant restart before it takes effect.
|
|
44
|
+
|
|
45
|
+
Say plainly that steps 1 and 3 need a click from the user. Do not imply you can finish alone.
|
|
46
|
+
|
|
47
|
+
## Grants
|
|
48
|
+
|
|
49
|
+
In the host's settings for the `composio` connection, grant these tools:
|
|
50
|
+
|
|
51
|
+
- `COMPOSIO_SEARCH_TOOLS`, `COMPOSIO_GET_TOOL_SCHEMAS`, `COMPOSIO_MANAGE_CONNECTIONS`,
|
|
52
|
+
`COMPOSIO_WAIT_FOR_CONNECTIONS`, `COMPOSIO_MULTI_EXECUTE_TOOL`.
|
|
53
|
+
- Where the host asks for a separate write grant (it applies only to a tool that declares it
|
|
54
|
+
writes), grant it for `COMPOSIO_MULTI_EXECUTE_TOOL` and `COMPOSIO_MANAGE_CONNECTIONS`. Without it
|
|
55
|
+
the host refuses the tool and it simply never appears.
|
|
56
|
+
|
|
57
|
+
**Do not grant** `COMPOSIO_REMOTE_WORKBENCH` or `COMPOSIO_REMOTE_BASH_TOOL`. They run code on
|
|
58
|
+
Composio's servers; nothing the user asks for here needs them.
|
|
59
|
+
|
|
60
|
+
If an `mcp__composio__*` tool you expect is missing, do not invent a reason. Report what the
|
|
61
|
+
host's admissions or refusal notice says, or say you do not know and point the user at the host's
|
|
62
|
+
connection settings.
|
|
63
|
+
|
|
64
|
+
## Doing a task
|
|
65
|
+
|
|
66
|
+
1. `COMPOSIO_SEARCH_TOOLS` with the user's goal in plain words.
|
|
67
|
+
2. `COMPOSIO_GET_TOOL_SCHEMAS` for the tool you will use. Never guess argument names.
|
|
68
|
+
3. `COMPOSIO_MANAGE_CONNECTIONS` for that app. If it is not connected, give the user the sign-in
|
|
69
|
+
link it returns ("Connect your Gmail here"), then `COMPOSIO_WAIT_FOR_CONNECTIONS`. Each app is
|
|
70
|
+
connected once; it stays connected across sessions.
|
|
71
|
+
4. `COMPOSIO_MULTI_EXECUTE_TOOL`.
|
|
72
|
+
|
|
73
|
+
**Ask before anything that sends, posts, pays, or deletes** (an email, a Slack message, a payment,
|
|
74
|
+
removing a record): show what will go out and to whom, and run it only after the user says yes.
|
|
75
|
+
Reading (listing emails, events, issues) needs no confirmation.
|
|
76
|
+
|
|
77
|
+
Report what the tool actually returned. If it failed, say so with its error in one plain sentence.
|
|
78
|
+
|
|
79
|
+
## When it stops working
|
|
80
|
+
|
|
81
|
+
- **"is disconnected: its authorization expired or was revoked"**: call `external_mcp_reauth_prompt`
|
|
82
|
+
for `composio`. After the user signs in again, retry the original call once.
|
|
83
|
+
- **An app's own sign-in expired** (the app tool fails with an auth error): run
|
|
84
|
+
`COMPOSIO_MANAGE_CONNECTIONS` for that app again and give the user the new link.
|
|
85
|
+
- **The user wants to disconnect an app**: that is done in their Composio account, not on this site.
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/** Selects the portable identity key without changing explicit host isolation.
|
|
2
|
+
* Legacy manifests remain readable only when no namespace was requested and `jini` is absent.
|
|
3
|
+
* A present malformed extension is left to the identity validator rather than bypassed.
|
|
4
|
+
* @returns The namespace to pass to the shared identity and metadata readers.
|
|
5
|
+
* @complexity O(1) time and space; no I/O or manifest mutation.
|
|
6
|
+
*/
|
|
7
|
+
export declare function resolveAgentPluginIdentityNamespace({ value }: {
|
|
8
|
+
readonly value: unknown;
|
|
9
|
+
}, { identityNamespace }?: {
|
|
10
|
+
readonly identityNamespace?: string;
|
|
11
|
+
}): string;
|
|
12
|
+
//# sourceMappingURL=identity-namespace.d.ts.map
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/** Selects the portable identity key without changing explicit host isolation.
|
|
2
|
+
* Legacy manifests remain readable only when no namespace was requested and `jini` is absent.
|
|
3
|
+
* A present malformed extension is left to the identity validator rather than bypassed.
|
|
4
|
+
* @returns The namespace to pass to the shared identity and metadata readers.
|
|
5
|
+
* @complexity O(1) time and space; no I/O or manifest mutation.
|
|
6
|
+
*/
|
|
7
|
+
export function resolveAgentPluginIdentityNamespace({ value }, { identityNamespace } = {}) {
|
|
8
|
+
if (identityNamespace !== undefined)
|
|
9
|
+
return identityNamespace;
|
|
10
|
+
if (typeof value !== 'object' || value === null || !('extensions' in value))
|
|
11
|
+
return 'jini';
|
|
12
|
+
const extensions = value.extensions;
|
|
13
|
+
if (typeof extensions !== 'object' || extensions === null || Array.isArray(extensions))
|
|
14
|
+
return 'jini';
|
|
15
|
+
if (Object.hasOwn(extensions, 'jini'))
|
|
16
|
+
return 'jini';
|
|
17
|
+
// Compatibility only: existing published manifests used this product's extension key.
|
|
18
|
+
return Object.hasOwn(extensions, 'tovu') ? 'tovu' : 'jini';
|
|
19
|
+
}
|
|
20
|
+
//# sourceMappingURL=identity-namespace.js.map
|
package/dist/folder-zip-node.js
CHANGED
|
@@ -126,19 +126,41 @@ function customizeText({ text, edit }) {
|
|
|
126
126
|
}
|
|
127
127
|
return text.slice(0, index) + edit.newString + text.slice(index + edit.oldString.length);
|
|
128
128
|
}
|
|
129
|
-
/**
|
|
129
|
+
/** Plugin-level history a fork must not inherit: `renamedFrom` lets a package answer for its old
|
|
130
|
+
* ids (export ownership, saved references) and `supersedes` lets it retire other packages. */
|
|
131
|
+
const HISTORICAL_IDENTITY_CLAIMS = ['renamedFrom', 'supersedes'];
|
|
132
|
+
function isPlainObject(value) {
|
|
133
|
+
return typeof value === 'object' && value !== null && !Array.isArray(value);
|
|
134
|
+
}
|
|
135
|
+
/** Every host key, not only the requesting host's: a manifest declares one `extensions` entry per
|
|
136
|
+
* host, so a fork read later by another host must not keep that host's publisher id or claims. */
|
|
137
|
+
function sanitizeHostIdentities({ extensions, localId }) {
|
|
138
|
+
for (const extension of Object.values(extensions)) {
|
|
139
|
+
if (!isPlainObject(extension))
|
|
140
|
+
continue;
|
|
141
|
+
if ('id' in extension)
|
|
142
|
+
extension.id = localId;
|
|
143
|
+
for (const claim of HISTORICAL_IDENTITY_CLAIMS)
|
|
144
|
+
delete extension[claim];
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
/** A fork must not retain its publisher identity or historical aliases and supersession claims.
|
|
148
|
+
* The requesting host always gets a fresh `local/<name>` id, even when the source declared none. */
|
|
130
149
|
function customizeManifest({ text, name, identityNamespace }) {
|
|
131
150
|
const manifest = JSON.parse(text);
|
|
132
151
|
if (!isAgentPluginName({ value: name }) || manifest.name === name) {
|
|
133
152
|
throw new FolderZipError('unreadable', 'Choose a valid new Agent Plugin id different from the source.');
|
|
134
153
|
}
|
|
135
154
|
manifest.name = name;
|
|
136
|
-
|
|
137
|
-
if (
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
}
|
|
155
|
+
manifest.extensions ??= {};
|
|
156
|
+
if (!isPlainObject(manifest.extensions))
|
|
157
|
+
throw new FolderZipError('unreadable', 'plugin.json extensions must be an object.');
|
|
158
|
+
const localId = `local/${name}`;
|
|
159
|
+
manifest.extensions[identityNamespace] ??= {};
|
|
160
|
+
sanitizeHostIdentities({ extensions: manifest.extensions, localId });
|
|
161
|
+
const host = manifest.extensions[identityNamespace];
|
|
162
|
+
if (isPlainObject(host))
|
|
163
|
+
host.id = localId;
|
|
142
164
|
return JSON.stringify(manifest, null, 2) + '\n';
|
|
143
165
|
}
|
|
144
166
|
/**
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/** Revision-checked, per-plugin activation queries: no repeated whole-file read on tool calls. */
|
|
2
|
+
export interface PluginActivationReaderPorts {
|
|
3
|
+
/** An atomic-file identity/version, not a TTL or wall clock. Errors must reject. */
|
|
4
|
+
revision(required: Record<string, never>, optional?: Record<string, never>): Promise<string>;
|
|
5
|
+
/** The existing strict activation owner; hosts pass only installed provisioning plugin ids. */
|
|
6
|
+
resolve(required: {
|
|
7
|
+
pluginId: string;
|
|
8
|
+
}, optional?: Record<string, never>): Promise<boolean>;
|
|
9
|
+
}
|
|
10
|
+
/** Cache one activation bit per plugin only while the host's durable revision remains unchanged.
|
|
11
|
+
* @returns A point-query reader and explicit reset; no global state or timers.
|
|
12
|
+
* @throws The injected revision/resolution error so a security caller can fail closed.
|
|
13
|
+
* @complexity O(1) lookup, one revision check per call; one resolution plus a second revision
|
|
14
|
+
* check on cache miss. O(p) memory for queried installed plugins, cleared on a version change.
|
|
15
|
+
*/
|
|
16
|
+
export declare function createVersionedPluginActivationReader({ ports }: {
|
|
17
|
+
ports: PluginActivationReaderPorts;
|
|
18
|
+
}, _options?: {}): {
|
|
19
|
+
isEnabled: ({ pluginId }: {
|
|
20
|
+
pluginId: string;
|
|
21
|
+
}, _options?: {}) => Promise<boolean>;
|
|
22
|
+
clear: (_required: Record<string, never>, _options?: {}) => void;
|
|
23
|
+
};
|
|
24
|
+
//# sourceMappingURL=activation-reader.d.ts.map
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/** Cache one activation bit per plugin only while the host's durable revision remains unchanged.
|
|
2
|
+
* @returns A point-query reader and explicit reset; no global state or timers.
|
|
3
|
+
* @throws The injected revision/resolution error so a security caller can fail closed.
|
|
4
|
+
* @complexity O(1) lookup, one revision check per call; one resolution plus a second revision
|
|
5
|
+
* check on cache miss. O(p) memory for queried installed plugins, cleared on a version change.
|
|
6
|
+
*/
|
|
7
|
+
export function createVersionedPluginActivationReader({ ports }, _options = {}) {
|
|
8
|
+
let version;
|
|
9
|
+
const enabledById = new Map();
|
|
10
|
+
async function isEnabled({ pluginId }, _options = {}) {
|
|
11
|
+
const current = await ports.revision({}, {});
|
|
12
|
+
if (current !== version) {
|
|
13
|
+
enabledById.clear();
|
|
14
|
+
version = current;
|
|
15
|
+
}
|
|
16
|
+
if (enabledById.has(pluginId))
|
|
17
|
+
return enabledById.get(pluginId);
|
|
18
|
+
const enabled = await ports.resolve({ pluginId }, {});
|
|
19
|
+
// A concurrent write must not cache a decision read from the revision it just replaced.
|
|
20
|
+
if (current !== await ports.revision({}, {}))
|
|
21
|
+
return false;
|
|
22
|
+
enabledById.set(pluginId, enabled);
|
|
23
|
+
return enabled;
|
|
24
|
+
}
|
|
25
|
+
return { isEnabled, clear: (_required, _options = {}) => { version = undefined; enabledById.clear(); } };
|
|
26
|
+
}
|
|
27
|
+
//# sourceMappingURL=activation-reader.js.map
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { agentVisiblePluginCandidate } from './search-projection.js';
|
|
1
2
|
export const DEFAULT_CHAT_AGENT_PLUGINS = 'auto';
|
|
2
3
|
const MAX_AUTOMATIC_GUIDANCE_BYTES = 8 * 1024;
|
|
3
4
|
/** Use the same one-line metadata reason in consent and progressive disclosure. */
|
|
@@ -167,7 +168,8 @@ export function createAutomaticAgentPluginUse({ mode, state: initialState, ports
|
|
|
167
168
|
return '';
|
|
168
169
|
for (const id of input.loaded ?? [])
|
|
169
170
|
alreadyLoaded.add(id);
|
|
170
|
-
const
|
|
171
|
+
const catalog = (await ports.list({}, {})).filter(plugin => !state.excluded.includes(plugin.pluginId));
|
|
172
|
+
const candidates = catalog.filter(plugin => plugin.enabled);
|
|
171
173
|
const ranked = rankCandidates({ candidates, input, ports });
|
|
172
174
|
// Owner decision 2026-10-18: no per-chat plugin count; the relevance threshold and vendor gate decide.
|
|
173
175
|
const relevant = ranked.filter(plugin => !delivered.has(plugin.pluginId) && !alreadyLoaded.has(plugin.pluginId));
|
|
@@ -177,7 +179,17 @@ export function createAutomaticAgentPluginUse({ mode, state: initialState, ports
|
|
|
177
179
|
const result = shouldLoad ? (await resolveGuidance({ matches }, { signal: input.signal })).join('\n\n') : relevantPluginNote({ matches, formatPluginToolPointer: ports.formatPluginToolPointer });
|
|
178
180
|
rememberAutoSelection();
|
|
179
181
|
await publishUsage();
|
|
180
|
-
|
|
182
|
+
// Off packages never enter guidance consent or resolution. A relevant catalog line is the
|
|
183
|
+
// only disclosure, so the model can offer the existing owner-approved enable flow.
|
|
184
|
+
const off = offPluginNote({ catalog, input });
|
|
185
|
+
return [result, off].filter(Boolean).join('\n\n');
|
|
186
|
+
}
|
|
187
|
+
/** Rank only catalog-safe fields for off plugins; no capability-triggered disclosure. O(p*t). */
|
|
188
|
+
function offPluginNote({ catalog, input }) {
|
|
189
|
+
if (!input.query)
|
|
190
|
+
return '';
|
|
191
|
+
const candidates = catalog.filter(plugin => !plugin.enabled).map(candidate => agentVisiblePluginCandidate({ candidate }));
|
|
192
|
+
return ports.rank({ query: input.query, candidates, limit: 10 }, {}).map(plugin => plugin.description ?? '').join('\n');
|
|
181
193
|
}
|
|
182
194
|
/** Admit one explicit id using the same catalog, consent, resolver and delivery state as prepare.
|
|
183
195
|
* No activation writes; unavailable guidance is retryable. O(p) local catalog lookup.
|