@jini-ai/agent-plugins 0.6.16 → 0.6.19
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 +35 -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 +254 -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 +249 -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/bundled-digests.js +4 -3
- 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/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 +586 -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,67 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @file Tool `sheets_export_csv` (`p_google_workspace__sheets_export_csv`): one tab (or an A1 range of it) as a CSV
|
|
3
|
+
* file the person can download. Read only on Google's side; the file is written through the host's
|
|
4
|
+
* artifact capability and only its reference, size and dimensions come back to chat.
|
|
5
|
+
*
|
|
6
|
+
* Exists because chat output is bounded (64 KiB) while a tab is not: the export reads the tab in
|
|
7
|
+
* bounded chunks, encodes CSV locally, and refuses — never truncates — anything over its bounds.
|
|
8
|
+
* A host without an artifact store passes no `artifacts` capability; the export refuses before any
|
|
9
|
+
* Google read then, so nothing is fetched for a file that could never be saved.
|
|
10
|
+
*/
|
|
11
|
+
import { getSpreadsheet, sheetsClientFor, sheetsUrl, tabsOf } from '../../lib/sheets-client.mjs';
|
|
12
|
+
import { encodeCsv, planChunks } from '../../lib/sheets-admin-csv.mjs';
|
|
13
|
+
import { parseBoundsA1 } from '../../lib/sheets-a1.mjs';
|
|
14
|
+
import { GoogleWorkspaceError } from '../../lib/request-policy.mjs';
|
|
15
|
+
|
|
16
|
+
/** The tab's title and grid size. @complexity O(t) tabs. */
|
|
17
|
+
async function readTab(client, input, signal) {
|
|
18
|
+
const body = await getSpreadsheet({ client, connectionRef: input.connectionRef, spreadsheetId: input.spreadsheetId, fields: 'sheets(properties(sheetId,title,gridProperties(rowCount,columnCount)))' }, { signal });
|
|
19
|
+
const properties = tabsOf({ body, sheetId: input.sheetId })[0]?.properties;
|
|
20
|
+
if (typeof properties?.title !== 'string') throw new GoogleWorkspaceError({ code: 'invalid-input' }, { detail: `no tab with sheetId ${input.sheetId}` });
|
|
21
|
+
return properties;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
/** The area to export: the given range, or the tab's whole grid. @complexity O(1). */
|
|
25
|
+
function areaOf(input, properties) {
|
|
26
|
+
if (input.range !== undefined) return parseBoundsA1({ range: input.range });
|
|
27
|
+
const grid = properties.gridProperties ?? {};
|
|
28
|
+
return { firstRow: 0, lastRow: Math.max(0, (grid.rowCount ?? 1) - 1), firstColumn: 0, lastColumn: Math.max(0, (grid.columnCount ?? 1) - 1) };
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
/** Every chunk's rows, each padded to its row count so later chunks keep their place. @complexity O(cells). */
|
|
32
|
+
async function readRows(client, input, chunks, signal) {
|
|
33
|
+
const rows = [];
|
|
34
|
+
for (const chunk of chunks) {
|
|
35
|
+
const body = await client.request({
|
|
36
|
+
connectionRef: input.connectionRef, url: sheetsUrl({ spreadsheetId: input.spreadsheetId }, { segments: ['values'], method: ':batchGet' }), kind: 'read',
|
|
37
|
+
query: { ranges: chunk.range, majorDimension: 'ROWS', valueRenderOption: input.valueRenderOption ?? 'FORMATTED_VALUE' },
|
|
38
|
+
}, signal ? { signal } : {});
|
|
39
|
+
rows.push(...paddedRows(body, chunk.rowCount));
|
|
40
|
+
}
|
|
41
|
+
return rows;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
/** One chunk's rows; Google drops trailing empty rows, so they are put back as empty rows. @complexity O(rows). */
|
|
45
|
+
function paddedRows(body, rowCount) {
|
|
46
|
+
const values = Array.isArray(body?.valueRanges?.[0]?.values) ? body.valueRanges[0].values : [];
|
|
47
|
+
return Array.from({ length: rowCount }, (_, index) => (Array.isArray(values[index]) ? values[index] : []));
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
/** A file name from the tab title: letters, digits, space, dot, dash and underscore only. @complexity O(title). */
|
|
51
|
+
function fileNameFor(title) {
|
|
52
|
+
const safe = title.replace(/[^\p{L}\p{N} ._-]+/gu, '_').trim().slice(0, 80);
|
|
53
|
+
return `${safe === '' ? 'sheet' : safe}.csv`;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
export default {
|
|
57
|
+
async invoke({ input, capabilities, signal }) {
|
|
58
|
+
if (!capabilities.artifacts) throw new GoogleWorkspaceError({ code: 'export-unavailable' });
|
|
59
|
+
const client = sheetsClientFor({ capabilities });
|
|
60
|
+
const properties = await readTab(client, input, signal);
|
|
61
|
+
const chunks = planChunks({ title: properties.title, area: areaOf(input, properties) });
|
|
62
|
+
const { csv, rows, columns, bytes } = encodeCsv({ rows: await readRows(client, input, chunks, signal) });
|
|
63
|
+
const fileName = fileNameFor(properties.title);
|
|
64
|
+
const { artifactRef } = await capabilities.artifacts.write({ name: fileName, mediaType: 'text/csv', content: csv });
|
|
65
|
+
return { artifactRef, fileName, rows, columns, bytes };
|
|
66
|
+
},
|
|
67
|
+
};
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @file Tool `sheets_filter_views` (`p_google_workspace__sheets_filter_views`): list, add, update, duplicate or
|
|
3
|
+
* delete saved filter views. Destructive because `delete` removes a view other people may use.
|
|
4
|
+
*
|
|
5
|
+
* Exists as a named wrapper over the reviewed filter-view request kinds; `list` reads only the views
|
|
6
|
+
* (field mask), never cell data.
|
|
7
|
+
*/
|
|
8
|
+
import { assertOutputWithin, getSpreadsheet, resourceLines, runBatchUpdate, sheetsClientFor, spreadsheetLine, tabsOf } from '../../lib/sheets-client.mjs';
|
|
9
|
+
|
|
10
|
+
/** action → the one batch request it sends. */
|
|
11
|
+
const REQUESTS = {
|
|
12
|
+
add: (input) => ({ addFilterView: { filter: input.filter } }),
|
|
13
|
+
update: (input) => ({ updateFilterView: { filter: { ...input.filter, filterViewId: input.filterViewId }, fields: input.fields.join(',') } }),
|
|
14
|
+
duplicate: (input) => ({ duplicateFilterView: { filterId: input.filterViewId } }),
|
|
15
|
+
delete: (input) => ({ deleteFilterView: { filterId: input.filterViewId } }),
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
/** Views per tab, optionally one tab. @complexity O(t) tabs. */
|
|
19
|
+
async function listViews(client, input, signal) {
|
|
20
|
+
const body = await getSpreadsheet({ client, connectionRef: input.connectionRef, spreadsheetId: input.spreadsheetId, fields: 'sheets(properties(sheetId,title),filterViews)' }, { signal });
|
|
21
|
+
const tabs = tabsOf({ body, sheetId: input.sheetId }).map((sheet) => ({ sheetId: sheet.properties?.sheetId, title: sheet.properties?.title, filterViews: sheet.filterViews ?? [] }));
|
|
22
|
+
return assertOutputWithin({ value: { action: 'list', tabs } });
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
export default {
|
|
26
|
+
async invoke({ input, capabilities, signal }) {
|
|
27
|
+
const client = sheetsClientFor({ capabilities });
|
|
28
|
+
if (input.action === 'list') return listViews(client, input, signal);
|
|
29
|
+
const { replies } = await runBatchUpdate({ client, connectionRef: input.connectionRef, spreadsheetId: input.spreadsheetId, requests: [REQUESTS[input.action](input)] }, { signal });
|
|
30
|
+
const view = replies[0]?.addFilterView?.filter ?? replies[0]?.duplicateFilterView?.filter;
|
|
31
|
+
return assertOutputWithin({ value: { action: input.action, ...(view ? { filterView: view } : { filterViewId: input.filterViewId }) } });
|
|
32
|
+
},
|
|
33
|
+
describeAffectedResources({ input }) {
|
|
34
|
+
const target = input.action === 'add' ? `new filter view "${input.filter?.title ?? 'untitled'}"` : `filter view ${input.filterViewId ?? ''}`.trim();
|
|
35
|
+
const verb = input.action === 'list' ? 'list filter views (no change)' : `${input.action} ${target}`;
|
|
36
|
+
return resourceLines({ lines: [spreadsheetLine(input), verb] });
|
|
37
|
+
},
|
|
38
|
+
};
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @file Tool `sheets_format` (`p_google_workspace__sheets_format`): basic formatting of a grid range — number
|
|
3
|
+
* formats, fonts, colours, alignment and wrapping (cell format with an explicit field mask), borders,
|
|
4
|
+
* frozen rows and columns, and column widths. A `write`: it never touches cell values.
|
|
5
|
+
*
|
|
6
|
+
* Exists as a named wrapper over the reviewed `repeatCell`, `updateBorders`,
|
|
7
|
+
* `updateSheetProperties` and `updateDimensionProperties` request kinds, sent as one batch. The
|
|
8
|
+
* format mask is always prefixed `userEnteredFormat.` from an allow-listed set (input schema), so a
|
|
9
|
+
* format call can never clear or overwrite values the way a `*` or `userEnteredValue` mask would.
|
|
10
|
+
*/
|
|
11
|
+
import { resourceLines, runBatchUpdate, sheetsClientFor, spreadsheetLine } from '../../lib/sheets-client.mjs';
|
|
12
|
+
import { gridRangeLabel } from '../../lib/sheets-a1.mjs';
|
|
13
|
+
|
|
14
|
+
const BORDER_SIDES = ['top', 'bottom', 'left', 'right', 'innerHorizontal', 'innerVertical'];
|
|
15
|
+
|
|
16
|
+
function cellFormatRequest(input) {
|
|
17
|
+
const fields = input.fields.map((field) => `userEnteredFormat.${field}`).join(',');
|
|
18
|
+
return { repeatCell: { range: input.range, cell: { userEnteredFormat: input.cellFormat }, fields } };
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
function bordersRequest(input) {
|
|
22
|
+
const sides = Object.fromEntries(BORDER_SIDES.filter((side) => input.borders[side]).map((side) => [side, input.borders[side]]));
|
|
23
|
+
return { updateBorders: { range: input.range, ...sides } };
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
/** Frozen rows/columns, only the ones given. @complexity O(1). */
|
|
27
|
+
function frozenRequest(input) {
|
|
28
|
+
const gridProperties = {};
|
|
29
|
+
if (input.frozenRowCount !== undefined) gridProperties.frozenRowCount = input.frozenRowCount;
|
|
30
|
+
if (input.frozenColumnCount !== undefined) gridProperties.frozenColumnCount = input.frozenColumnCount;
|
|
31
|
+
const fields = Object.keys(gridProperties).map((name) => `gridProperties.${name}`).join(',');
|
|
32
|
+
return { updateSheetProperties: { properties: { sheetId: input.range.sheetId, gridProperties }, fields } };
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
function columnWidthRequest(input) {
|
|
36
|
+
const { sheetId, startColumnIndex, endColumnIndex } = input.range;
|
|
37
|
+
const range = { sheetId, dimension: 'COLUMNS', ...(startColumnIndex === undefined ? {} : { startIndex: startColumnIndex }), ...(endColumnIndex === undefined ? {} : { endIndex: endColumnIndex }) };
|
|
38
|
+
return { updateDimensionProperties: { range, properties: { pixelSize: input.columnWidth }, fields: 'pixelSize' } };
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
/** The requests for the parts of the input that are present, in a fixed order. @complexity O(1). */
|
|
42
|
+
function requestsFor(input) {
|
|
43
|
+
return [
|
|
44
|
+
input.cellFormat === undefined ? undefined : cellFormatRequest(input),
|
|
45
|
+
input.borders === undefined ? undefined : bordersRequest(input),
|
|
46
|
+
input.frozenRowCount === undefined && input.frozenColumnCount === undefined ? undefined : frozenRequest(input),
|
|
47
|
+
input.columnWidth === undefined ? undefined : columnWidthRequest(input),
|
|
48
|
+
].filter(Boolean);
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
/** What the card lists as changing. @complexity O(1). */
|
|
52
|
+
function changedParts(input) {
|
|
53
|
+
return [
|
|
54
|
+
input.cellFormat === undefined ? undefined : `cell format (${input.fields.join(', ')})`,
|
|
55
|
+
input.borders === undefined ? undefined : 'borders',
|
|
56
|
+
input.frozenRowCount === undefined ? undefined : `frozen rows = ${input.frozenRowCount}`,
|
|
57
|
+
input.frozenColumnCount === undefined ? undefined : `frozen columns = ${input.frozenColumnCount}`,
|
|
58
|
+
input.columnWidth === undefined ? undefined : `column width = ${input.columnWidth}px`,
|
|
59
|
+
].filter(Boolean);
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
export default {
|
|
63
|
+
async invoke({ input, capabilities, signal }) {
|
|
64
|
+
await runBatchUpdate({ client: sheetsClientFor({ capabilities }), connectionRef: input.connectionRef, spreadsheetId: input.spreadsheetId, requests: requestsFor(input) }, { signal });
|
|
65
|
+
return { formatted: input.range, changed: changedParts(input) };
|
|
66
|
+
},
|
|
67
|
+
describeAffectedResources({ input }) {
|
|
68
|
+
return resourceLines({ lines: [spreadsheetLine(input), `format ${gridRangeLabel({ range: input.range })}: ${changedParts(input).join('; ')}`] });
|
|
69
|
+
},
|
|
70
|
+
};
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @file Tool `sheets_named_ranges` (`p_google_workspace__sheets_named_ranges`): list, add, update or delete named
|
|
3
|
+
* ranges. Destructive because deleting or re-pointing a named range breaks formulas that use it.
|
|
4
|
+
*
|
|
5
|
+
* Exists as a named wrapper over the reviewed named-range request kinds.
|
|
6
|
+
*/
|
|
7
|
+
import { assertOutputWithin, getSpreadsheet, resourceLines, runBatchUpdate, sheetsClientFor, spreadsheetLine } from '../../lib/sheets-client.mjs';
|
|
8
|
+
import { gridRangeLabel } from '../../lib/sheets-a1.mjs';
|
|
9
|
+
|
|
10
|
+
/** The fields an update changes: only the ones given. @complexity O(1). */
|
|
11
|
+
const updatedFields = (input) => ['name', 'range'].filter((field) => input[field] !== undefined).join(',');
|
|
12
|
+
|
|
13
|
+
/** action → the one batch request it sends. */
|
|
14
|
+
const REQUESTS = {
|
|
15
|
+
add: (input) => ({ addNamedRange: { namedRange: { name: input.name, range: input.range } } }),
|
|
16
|
+
update: (input) => ({ updateNamedRange: { namedRange: { namedRangeId: input.namedRangeId, ...(input.name === undefined ? {} : { name: input.name }), ...(input.range === undefined ? {} : { range: input.range }) }, fields: updatedFields(input) } }),
|
|
17
|
+
delete: (input) => ({ deleteNamedRange: { namedRangeId: input.namedRangeId } }),
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
export default {
|
|
21
|
+
async invoke({ input, capabilities, signal }) {
|
|
22
|
+
const client = sheetsClientFor({ capabilities });
|
|
23
|
+
if (input.action === 'list') {
|
|
24
|
+
const body = await getSpreadsheet({ client, connectionRef: input.connectionRef, spreadsheetId: input.spreadsheetId, fields: 'namedRanges' }, { signal });
|
|
25
|
+
return assertOutputWithin({ value: { action: 'list', namedRanges: body?.namedRanges ?? [] } });
|
|
26
|
+
}
|
|
27
|
+
const { replies } = await runBatchUpdate({ client, connectionRef: input.connectionRef, spreadsheetId: input.spreadsheetId, requests: [REQUESTS[input.action](input)] }, { signal });
|
|
28
|
+
const added = replies[0]?.addNamedRange?.namedRange;
|
|
29
|
+
return { action: input.action, ...(added ? { namedRange: added } : { namedRangeId: input.namedRangeId }) };
|
|
30
|
+
},
|
|
31
|
+
describeAffectedResources({ input }) {
|
|
32
|
+
const where = input.range ? ` at ${gridRangeLabel({ range: input.range })}` : '';
|
|
33
|
+
const newName = input.name === undefined ? '' : ` to "${input.name}"`;
|
|
34
|
+
const lines = {
|
|
35
|
+
list: 'list named ranges (no change)',
|
|
36
|
+
add: `add named range "${input.name}"${where}`,
|
|
37
|
+
update: `change named range ${input.namedRangeId}${newName}${where} (formulas using it follow the change)`,
|
|
38
|
+
delete: `delete named range ${input.namedRangeId} (formulas using it stop working)`,
|
|
39
|
+
};
|
|
40
|
+
return resourceLines({ lines: [spreadsheetLine(input), lines[input.action]] });
|
|
41
|
+
},
|
|
42
|
+
};
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @file Tool `sheets_open_existing` (`p_google_workspace__sheets_open_existing`): work with a spreadsheet the
|
|
3
|
+
* person already has. Without a `spreadsheetId` it answers `waiting` and points to the file picker;
|
|
4
|
+
* with one (from a completed pick) it verifies, with the connected account, that the site can open the
|
|
5
|
+
* file and that it is a spreadsheet (Drive metadata, then the Sheets API opens it: the same check as
|
|
6
|
+
* a Picker selection, `verifySpreadsheetAccess`), and returns its id, title and link. Read only.
|
|
7
|
+
*
|
|
8
|
+
* Exists because under `drive.file` a pasted link grants nothing: only Google's picker (or the site
|
|
9
|
+
* creating the file) does. Verifying through the API is the only honest answer to "can the site open
|
|
10
|
+
* this?": an ungranted file is `file-not-granted` with the next action "choose it with the picker".
|
|
11
|
+
* Chat receives resource metadata only; the link is built from the verified id, not taken from Google.
|
|
12
|
+
*/
|
|
13
|
+
import { verifySpreadsheetAccess } from '../../lib/picker-selection.mjs';
|
|
14
|
+
import { assertProductEnabled } from '../../lib/product-state.mjs';
|
|
15
|
+
import { SHEETS_PRODUCT_ID, assertSpreadsheetId, sheetsClientFor } from '../../lib/sheets-client.mjs';
|
|
16
|
+
|
|
17
|
+
const WAITING = Object.freeze({
|
|
18
|
+
status: 'waiting',
|
|
19
|
+
nextAction: 'open-picker',
|
|
20
|
+
message: 'Ask the person to choose the spreadsheet with Google\'s file picker in the Google Workspace plugin (or offer to create a new one). A pasted link is not enough. Then call this again with the chosen spreadsheetId.',
|
|
21
|
+
});
|
|
22
|
+
|
|
23
|
+
export default {
|
|
24
|
+
async invoke({ input, capabilities, signal }) {
|
|
25
|
+
if (input.spreadsheetId === undefined) {
|
|
26
|
+
// Sends nothing to Google, but pointing at the picker is still a Sheets action: it is gated too.
|
|
27
|
+
await assertProductEnabled({ state: capabilities.state, productId: SHEETS_PRODUCT_ID });
|
|
28
|
+
return WAITING;
|
|
29
|
+
}
|
|
30
|
+
const fileId = assertSpreadsheetId({ id: input.spreadsheetId });
|
|
31
|
+
const resource = await verifySpreadsheetAccess({ client: sheetsClientFor({ capabilities }), connectionRef: input.connectionRef, fileId }, signal ? { signal } : {});
|
|
32
|
+
return { status: 'selected', resource };
|
|
33
|
+
},
|
|
34
|
+
};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @file Tool `sheets_protected_ranges_get` (`p_google_workspace__sheets_protected_ranges_get`): which ranges of a
|
|
3
|
+
* spreadsheet are protected, by whom, and whether the connected account may edit them. Read only.
|
|
4
|
+
*
|
|
5
|
+
* Exists so chat can explain a refused edit before trying it. Protection changes go through
|
|
6
|
+
* `batch_update` (destructive, confirmed) instead of a wrapper.
|
|
7
|
+
*/
|
|
8
|
+
import { assertOutputWithin, getSpreadsheet, sheetsClientFor, tabsOf } from '../../lib/sheets-client.mjs';
|
|
9
|
+
|
|
10
|
+
const FIELDS = 'sheets(properties(sheetId,title),protectedRanges(protectedRangeId,range,namedRangeId,tableId,description,warningOnly,requestingUserCanEdit,unprotectedRanges,editors))';
|
|
11
|
+
|
|
12
|
+
export default {
|
|
13
|
+
async invoke({ input, capabilities, signal }) {
|
|
14
|
+
const body = await getSpreadsheet({ client: sheetsClientFor({ capabilities }), connectionRef: input.connectionRef, spreadsheetId: input.spreadsheetId, fields: FIELDS }, { signal });
|
|
15
|
+
const tabs = tabsOf({ body, sheetId: input.sheetId }).map((sheet) => ({ sheetId: sheet.properties?.sheetId, title: sheet.properties?.title, protectedRanges: sheet.protectedRanges ?? [] }));
|
|
16
|
+
return assertOutputWithin({ value: { tabs } });
|
|
17
|
+
},
|
|
18
|
+
};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @file Tool `sheets_sort` (`p_google_workspace__sheets_sort`): physically reorder the rows of a grid range by one
|
|
3
|
+
* or more columns. Destructive: the original row order is gone and the site cannot undo a remote change.
|
|
4
|
+
*
|
|
5
|
+
* Exists as a named wrapper over the reviewed `sortRange` request, sent through the batch path.
|
|
6
|
+
*/
|
|
7
|
+
import { resourceLines, runBatchUpdate, sheetsClientFor, spreadsheetLine } from '../../lib/sheets-client.mjs';
|
|
8
|
+
import { gridRangeLabel } from '../../lib/sheets-a1.mjs';
|
|
9
|
+
|
|
10
|
+
export default {
|
|
11
|
+
async invoke({ input, capabilities, signal }) {
|
|
12
|
+
await runBatchUpdate({ client: sheetsClientFor({ capabilities }), connectionRef: input.connectionRef, spreadsheetId: input.spreadsheetId, requests: [{ sortRange: { range: input.range, sortSpecs: input.sortSpecs } }] }, { signal });
|
|
13
|
+
return { sorted: input.range, sortSpecs: input.sortSpecs };
|
|
14
|
+
},
|
|
15
|
+
describeAffectedResources({ input }) {
|
|
16
|
+
return resourceLines({ lines: [spreadsheetLine(input), `reorder rows of ${gridRangeLabel({ range: input.range })} (the old order is not kept)`] });
|
|
17
|
+
},
|
|
18
|
+
};
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @file Tool `sheets_tab_modify` (`p_google_workspace__sheets_tab_modify`): add, rename, delete, duplicate or move
|
|
3
|
+
* one tab of a spreadsheet. Declared destructive because `delete` removes a tab and its data; the
|
|
4
|
+
* confirmation card names the spreadsheet, the action and the tab.
|
|
5
|
+
*
|
|
6
|
+
* Exists as a named wrapper so the common tab changes need no raw batch: each action becomes one
|
|
7
|
+
* reviewed request kind and goes through the same batch path as `batch_update`.
|
|
8
|
+
*/
|
|
9
|
+
import { resourceLines, runBatchUpdate, sheetsClientFor, spreadsheetLine } from '../../lib/sheets-client.mjs';
|
|
10
|
+
|
|
11
|
+
/** action → the one batch request it sends. */
|
|
12
|
+
const REQUESTS = {
|
|
13
|
+
add: (input) => ({ addSheet: { properties: { title: input.title, ...(input.index === undefined ? {} : { index: input.index }) } } }),
|
|
14
|
+
rename: (input) => ({ updateSheetProperties: { properties: { sheetId: input.sheetId, title: input.title }, fields: 'title' } }),
|
|
15
|
+
delete: (input) => ({ deleteSheet: { sheetId: input.sheetId } }),
|
|
16
|
+
duplicate: (input) => ({ duplicateSheet: { sourceSheetId: input.sheetId, ...(input.title === undefined ? {} : { newSheetName: input.title }), ...(input.index === undefined ? {} : { insertSheetIndex: input.index }) } }),
|
|
17
|
+
move: (input) => ({ updateSheetProperties: { properties: { sheetId: input.sheetId, index: input.index }, fields: 'index' } }),
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
/** The resulting tab: Google's properties for add/duplicate, the requested ones otherwise. @complexity O(1). */
|
|
21
|
+
function resultFor(input, reply) {
|
|
22
|
+
const created = reply?.addSheet?.properties ?? reply?.duplicateSheet?.properties;
|
|
23
|
+
if (created) return { action: input.action, tab: { sheetId: created.sheetId, title: created.title, index: created.index } };
|
|
24
|
+
return { action: input.action, tab: { sheetId: input.sheetId, ...(input.title === undefined ? {} : { title: input.title }), ...(input.index === undefined ? {} : { index: input.index }) } };
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
export default {
|
|
28
|
+
async invoke({ input, capabilities, signal }) {
|
|
29
|
+
const { replies } = await runBatchUpdate({ client: sheetsClientFor({ capabilities }), connectionRef: input.connectionRef, spreadsheetId: input.spreadsheetId, requests: [REQUESTS[input.action](input)] }, { signal });
|
|
30
|
+
return resultFor(input, replies[0]);
|
|
31
|
+
},
|
|
32
|
+
describeAffectedResources({ input }) {
|
|
33
|
+
const tab = input.sheetId === undefined ? `new tab "${input.title}"` : `tab ${input.sheetId}`;
|
|
34
|
+
return resourceLines({ lines: [spreadsheetLine(input), `${input.action} ${tab}${input.action === 'delete' ? ' and all of its data' : ''}`] });
|
|
35
|
+
},
|
|
36
|
+
};
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
{
|
|
2
|
+
"schemaVersion": 1,
|
|
3
|
+
"surfaces": [
|
|
4
|
+
{
|
|
5
|
+
"id": "connection",
|
|
6
|
+
"title": "Google Workspace",
|
|
7
|
+
"entry": "ui/connection-panel.html",
|
|
8
|
+
"files": ["ui/surface-client.mjs","ui/dom.mjs","ui/panel.css","ui/connection-panel.mjs","ui/connection-view.mjs"],
|
|
9
|
+
"handlerModule": "ui/connection-panel.handler.mjs",
|
|
10
|
+
"connections": [{"id":"account"}],
|
|
11
|
+
"deliveryAdapters": ["google-sheets"],
|
|
12
|
+
"linkOrigins": ["https://myaccount.google.com"],
|
|
13
|
+
"actions": [
|
|
14
|
+
{"name":"status","input":{"type":"object","properties":{},"required":[],"additionalProperties":false},"result":{"type":"object","properties":{"connection":{"type":"object","properties":{"status":{"type":"string","maxLength":32,"enum":["connected","reconnect-required","revocation-pending","disconnected"]},"grantedProducts":{"type":"array","items":{"type":"string","maxLength":64},"maxItems":16},"accountLabel":{"type":"string","maxLength":320},"pendingSwitchAccountLabel":{"type":"string","maxLength":320}},"required":["status","grantedProducts"],"additionalProperties":false},"products":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","maxLength":64},"label":{"type":"string","maxLength":128},"enabled":{"type":"boolean"},"granted":{"type":"boolean"}},"required":["id","label","enabled","granted"],"additionalProperties":false},"maxItems":16},"destinations":{"type":"array","items":{"type":"object","properties":{"formSlug":{"type":"string","maxLength":64},"title":{"type":"string","maxLength":1024},"tabTitle":{"type":"string","maxLength":1024}},"required":["formSlug","title","tabTitle"],"additionalProperties":false},"maxItems":50},"accountAccessUrl":{"type":"string","maxLength":256}},"required":["connection","products","destinations","accountAccessUrl"],"additionalProperties":false}},
|
|
15
|
+
{"name":"sign-in","input":{"type":"object","properties":{"action":{"type":"string","maxLength":16,"enum":["connect","reconnect","switch","add-scopes"]}},"required":["action"],"additionalProperties":false},"result":{"type":"object","properties":{"expiresAt":{"type":"string","maxLength":64}},"required":["expiresAt"],"additionalProperties":false}},
|
|
16
|
+
{"name":"confirm-switch","input":{"type":"object","properties":{"reassign":{"type":"array","items":{"type":"string","maxLength":64,"minLength":1},"maxItems":50}},"required":["reassign"],"additionalProperties":false},"result":{"type":"object","properties":{"connection":{"type":"object","properties":{"status":{"type":"string","maxLength":32,"enum":["connected","reconnect-required","revocation-pending","disconnected"]},"grantedProducts":{"type":"array","items":{"type":"string","maxLength":64},"maxItems":16},"accountLabel":{"type":"string","maxLength":320},"pendingSwitchAccountLabel":{"type":"string","maxLength":320}},"required":["status","grantedProducts"],"additionalProperties":false},"products":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","maxLength":64},"label":{"type":"string","maxLength":128},"enabled":{"type":"boolean"},"granted":{"type":"boolean"}},"required":["id","label","enabled","granted"],"additionalProperties":false},"maxItems":16},"destinations":{"type":"array","items":{"type":"object","properties":{"formSlug":{"type":"string","maxLength":64},"title":{"type":"string","maxLength":1024},"tabTitle":{"type":"string","maxLength":1024}},"required":["formSlug","title","tabTitle"],"additionalProperties":false},"maxItems":50},"accountAccessUrl":{"type":"string","maxLength":256},"reassignment":{"type":"object","properties":{"moved":{"type":"array","items":{"type":"string","maxLength":64},"maxItems":50},"failed":{"type":"array","items":{"type":"object","properties":{"formSlug":{"type":"string","maxLength":64},"code":{"type":"string","maxLength":64},"message":{"type":"string","maxLength":400}},"required":["formSlug","code","message"],"additionalProperties":false},"maxItems":50}},"required":["moved","failed"],"additionalProperties":false}},"required":["connection","products","destinations","accountAccessUrl","reassignment"],"additionalProperties":false}},
|
|
17
|
+
{"name":"cancel-switch","input":{"type":"object","properties":{},"required":[],"additionalProperties":false},"result":{"type":"object","properties":{"connection":{"type":"object","properties":{"status":{"type":"string","maxLength":32,"enum":["connected","reconnect-required","revocation-pending","disconnected"]},"grantedProducts":{"type":"array","items":{"type":"string","maxLength":64},"maxItems":16},"accountLabel":{"type":"string","maxLength":320},"pendingSwitchAccountLabel":{"type":"string","maxLength":320}},"required":["status","grantedProducts"],"additionalProperties":false},"products":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","maxLength":64},"label":{"type":"string","maxLength":128},"enabled":{"type":"boolean"},"granted":{"type":"boolean"}},"required":["id","label","enabled","granted"],"additionalProperties":false},"maxItems":16},"destinations":{"type":"array","items":{"type":"object","properties":{"formSlug":{"type":"string","maxLength":64},"title":{"type":"string","maxLength":1024},"tabTitle":{"type":"string","maxLength":1024}},"required":["formSlug","title","tabTitle"],"additionalProperties":false},"maxItems":50},"accountAccessUrl":{"type":"string","maxLength":256}},"required":["connection","products","destinations","accountAccessUrl"],"additionalProperties":false}},
|
|
18
|
+
{"name":"disconnect","input":{"type":"object","properties":{},"required":[],"additionalProperties":false},"result":{"type":"object","properties":{"connection":{"type":"object","properties":{"status":{"type":"string","maxLength":32,"enum":["connected","reconnect-required","revocation-pending","disconnected"]},"grantedProducts":{"type":"array","items":{"type":"string","maxLength":64},"maxItems":16},"accountLabel":{"type":"string","maxLength":320},"pendingSwitchAccountLabel":{"type":"string","maxLength":320}},"required":["status","grantedProducts"],"additionalProperties":false},"products":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","maxLength":64},"label":{"type":"string","maxLength":128},"enabled":{"type":"boolean"},"granted":{"type":"boolean"}},"required":["id","label","enabled","granted"],"additionalProperties":false},"maxItems":16},"destinations":{"type":"array","items":{"type":"object","properties":{"formSlug":{"type":"string","maxLength":64},"title":{"type":"string","maxLength":1024},"tabTitle":{"type":"string","maxLength":1024}},"required":["formSlug","title","tabTitle"],"additionalProperties":false},"maxItems":50},"accountAccessUrl":{"type":"string","maxLength":256},"revocation":{"type":"string","maxLength":16,"enum":["confirmed","pending","not-needed"]}},"required":["connection","products","destinations","accountAccessUrl","revocation"],"additionalProperties":false}},
|
|
19
|
+
{"name":"set-product","input":{"type":"object","properties":{"productId":{"type":"string","maxLength":64,"enum":["sheets"]},"enabled":{"type":"boolean"}},"required":["productId","enabled"],"additionalProperties":false},"result":{"type":"object","properties":{"connection":{"type":"object","properties":{"status":{"type":"string","maxLength":32,"enum":["connected","reconnect-required","revocation-pending","disconnected"]},"grantedProducts":{"type":"array","items":{"type":"string","maxLength":64},"maxItems":16},"accountLabel":{"type":"string","maxLength":320},"pendingSwitchAccountLabel":{"type":"string","maxLength":320}},"required":["status","grantedProducts"],"additionalProperties":false},"products":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","maxLength":64},"label":{"type":"string","maxLength":128},"enabled":{"type":"boolean"},"granted":{"type":"boolean"}},"required":["id","label","enabled","granted"],"additionalProperties":false},"maxItems":16},"destinations":{"type":"array","items":{"type":"object","properties":{"formSlug":{"type":"string","maxLength":64},"title":{"type":"string","maxLength":1024},"tabTitle":{"type":"string","maxLength":1024}},"required":["formSlug","title","tabTitle"],"additionalProperties":false},"maxItems":50},"accountAccessUrl":{"type":"string","maxLength":256}},"required":["connection","products","destinations","accountAccessUrl"],"additionalProperties":false}}
|
|
20
|
+
]
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
"id": "picker",
|
|
24
|
+
"title": "Choose spreadsheet",
|
|
25
|
+
"entry": "ui/picker.html",
|
|
26
|
+
"files": ["ui/surface-client.mjs","ui/dom.mjs","ui/panel.css","ui/picker-flow.mjs","ui/picker-view.mjs","ui/picker.mjs"],
|
|
27
|
+
"handlerModule": "ui/picker.handler.mjs",
|
|
28
|
+
"bootstrap": {"type":"object","properties":{"mode":{"type":"string","maxLength":16,"enum":["unavailable","system-browser","hosted"]},"reason":{"type":"string","maxLength":64},"message":{"type":"string","maxLength":300},"accountLabel":{"type":"string","maxLength":320},"picker":{"type":"object","properties":{"accessToken":{"type":"string","maxLength":4096},"developerKey":{"type":"string","maxLength":256},"appId":{"type":"string","maxLength":64},"sessionId":{"type":"string","maxLength":64}},"required":["accessToken","developerKey","appId","sessionId"],"additionalProperties":false}},"required":["mode"],"additionalProperties":false},
|
|
29
|
+
"connections": [{"id":"account","startParams":["trigger_onepick","mimetypes"],"callbackFields":["picked_file_ids"]}],
|
|
30
|
+
"publicConfig": ["TOVU_GOOGLE_PICKER_BROWSER_KEY","TOVU_GOOGLE_PICKER_APP_ID"],
|
|
31
|
+
"actions": [
|
|
32
|
+
{"name":"list-picked","input":{"type":"object","properties":{},"required":[],"additionalProperties":false},"result":{"type":"object","properties":{"spreadsheets":{"type":"array","items":{"type":"object","properties":{"spreadsheetId":{"type":"string","maxLength":200},"title":{"type":"string","maxLength":1024},"url":{"type":"string","maxLength":512}},"required":["spreadsheetId","title","url"],"additionalProperties":false},"maxItems":10}},"required":["spreadsheets"],"additionalProperties":false}},
|
|
33
|
+
{"name":"verify-picked","input":{"type":"object","properties":{"sessionId":{"type":"string","maxLength":64,"minLength":1},"fileId":{"type":"string","maxLength":256,"minLength":1}},"required":["sessionId","fileId"],"additionalProperties":false},"result":{"type":"object","properties":{"spreadsheet":{"type":"object","properties":{"spreadsheetId":{"type":"string","maxLength":200},"title":{"type":"string","maxLength":1024},"url":{"type":"string","maxLength":512}},"required":["spreadsheetId","title","url"],"additionalProperties":false}},"required":["spreadsheet"],"additionalProperties":false}},
|
|
34
|
+
{"name":"start-system-picker","input":{"type":"object","properties":{},"required":[],"additionalProperties":false},"result":{"type":"object","properties":{"expiresAt":{"type":"string","maxLength":64}},"required":["expiresAt"],"additionalProperties":false}},
|
|
35
|
+
{"name":"finish-system-picker","input":{"type":"object","properties":{},"required":[],"additionalProperties":false},"result":{"type":"object","properties":{"status":{"type":"string","maxLength":16,"enum":["none","waiting","expired","cancelled","selected"]},"spreadsheet":{"type":"object","properties":{"spreadsheetId":{"type":"string","maxLength":200},"title":{"type":"string","maxLength":1024},"url":{"type":"string","maxLength":512}},"required":["spreadsheetId","title","url"],"additionalProperties":false}},"required":["status"],"additionalProperties":false}}
|
|
36
|
+
],
|
|
37
|
+
"csp": {"script-src":["https://apis.google.com"],"frame-src":["https://docs.google.com"]}
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
"id": "form-destinations",
|
|
41
|
+
"title": "Form destinations",
|
|
42
|
+
"entry": "ui/destination-panel.html",
|
|
43
|
+
"files": ["ui/surface-client.mjs","ui/dom.mjs","ui/panel.css","ui/picker-flow.mjs","ui/picker-view.mjs","ui/destination-panel.mjs"],
|
|
44
|
+
"handlerModule": "ui/destination-panel.handler.mjs",
|
|
45
|
+
"deliveryAdapters": ["google-sheets"],
|
|
46
|
+
"forms": ["list"],
|
|
47
|
+
"bootstrap": {"type":"object","properties":{"mode":{"type":"string","maxLength":16,"enum":["unavailable","system-browser","hosted"]},"reason":{"type":"string","maxLength":64},"message":{"type":"string","maxLength":300},"accountLabel":{"type":"string","maxLength":320},"picker":{"type":"object","properties":{"accessToken":{"type":"string","maxLength":4096},"developerKey":{"type":"string","maxLength":256},"appId":{"type":"string","maxLength":64},"sessionId":{"type":"string","maxLength":64}},"required":["accessToken","developerKey","appId","sessionId"],"additionalProperties":false}},"required":["mode"],"additionalProperties":false},
|
|
48
|
+
"connections": [{"id":"account","startParams":["trigger_onepick","mimetypes"],"callbackFields":["picked_file_ids"]}],
|
|
49
|
+
"publicConfig": ["TOVU_GOOGLE_PICKER_BROWSER_KEY","TOVU_GOOGLE_PICKER_APP_ID"],
|
|
50
|
+
"actions": [
|
|
51
|
+
{"name":"list-picked","input":{"type":"object","properties":{},"required":[],"additionalProperties":false},"result":{"type":"object","properties":{"spreadsheets":{"type":"array","items":{"type":"object","properties":{"spreadsheetId":{"type":"string","maxLength":200},"title":{"type":"string","maxLength":1024},"url":{"type":"string","maxLength":512}},"required":["spreadsheetId","title","url"],"additionalProperties":false},"maxItems":10}},"required":["spreadsheets"],"additionalProperties":false}},
|
|
52
|
+
{"name":"verify-picked","input":{"type":"object","properties":{"sessionId":{"type":"string","maxLength":64,"minLength":1},"fileId":{"type":"string","maxLength":256,"minLength":1}},"required":["sessionId","fileId"],"additionalProperties":false},"result":{"type":"object","properties":{"spreadsheet":{"type":"object","properties":{"spreadsheetId":{"type":"string","maxLength":200},"title":{"type":"string","maxLength":1024},"url":{"type":"string","maxLength":512}},"required":["spreadsheetId","title","url"],"additionalProperties":false}},"required":["spreadsheet"],"additionalProperties":false}},
|
|
53
|
+
{"name":"start-system-picker","input":{"type":"object","properties":{},"required":[],"additionalProperties":false},"result":{"type":"object","properties":{"expiresAt":{"type":"string","maxLength":64}},"required":["expiresAt"],"additionalProperties":false}},
|
|
54
|
+
{"name":"finish-system-picker","input":{"type":"object","properties":{},"required":[],"additionalProperties":false},"result":{"type":"object","properties":{"status":{"type":"string","maxLength":16,"enum":["none","waiting","expired","cancelled","selected"]},"spreadsheet":{"type":"object","properties":{"spreadsheetId":{"type":"string","maxLength":200},"title":{"type":"string","maxLength":1024},"url":{"type":"string","maxLength":512}},"required":["spreadsheetId","title","url"],"additionalProperties":false}},"required":["status"],"additionalProperties":false}},
|
|
55
|
+
{"name":"list-destinations","input":{"type":"object","properties":{},"required":[],"additionalProperties":false},"result":{"type":"object","properties":{"forms":{"type":"array","items":{"type":"object","properties":{"slug":{"type":"string","minLength":1,"maxLength":64},"title":{"type":"string","maxLength":1024}},"required":["slug","title"],"additionalProperties":false},"maxItems":200},"destinations":{"type":"array","items":{"type":"object","properties":{"formSlug":{"type":"string","maxLength":64},"spreadsheetId":{"type":"string","maxLength":200},"title":{"type":"string","maxLength":1024},"url":{"type":"string","maxLength":512},"sheetId":{"type":"integer","minimum":0},"tabTitle":{"type":"string","maxLength":1024},"sameAccount":{"type":"boolean"}},"required":["formSlug","spreadsheetId","title","url","sheetId","tabTitle"],"additionalProperties":false},"maxItems":50},"picked":{"type":"array","items":{"type":"object","properties":{"spreadsheetId":{"type":"string","maxLength":200},"title":{"type":"string","maxLength":1024},"url":{"type":"string","maxLength":512}},"required":["spreadsheetId","title","url"],"additionalProperties":false},"maxItems":10}},"required":["destinations","picked"],"additionalProperties":false}},
|
|
56
|
+
{"name":"list-tabs","input":{"type":"object","properties":{"spreadsheetId":{"type":"string","maxLength":256,"minLength":1}},"required":["spreadsheetId"],"additionalProperties":false},"result":{"type":"object","properties":{"spreadsheet":{"type":"object","properties":{"spreadsheetId":{"type":"string","maxLength":200},"title":{"type":"string","maxLength":1024},"url":{"type":"string","maxLength":512}},"required":["spreadsheetId","title","url"],"additionalProperties":false},"tabs":{"type":"array","items":{"type":"object","properties":{"sheetId":{"type":"integer","minimum":0},"title":{"type":"string","maxLength":1024}},"required":["sheetId","title"],"additionalProperties":false},"maxItems":200}},"required":["spreadsheet","tabs"],"additionalProperties":false}},
|
|
57
|
+
{"name":"save-destination","input":{"type":"object","properties":{"formSlug":{"type":"string","maxLength":64,"minLength":1},"spreadsheetId":{"type":"string","maxLength":256,"minLength":1},"sheetId":{"type":"integer","minimum":0,"maximum":2147483647},"confirmExternalRows":{"type":"boolean"}},"required":["formSlug","spreadsheetId","sheetId","confirmExternalRows"],"additionalProperties":false},"result":{"type":"object","properties":{"forms":{"type":"array","items":{"type":"object","properties":{"slug":{"type":"string","minLength":1,"maxLength":64},"title":{"type":"string","maxLength":1024}},"required":["slug","title"],"additionalProperties":false},"maxItems":200},"destinations":{"type":"array","items":{"type":"object","properties":{"formSlug":{"type":"string","maxLength":64},"spreadsheetId":{"type":"string","maxLength":200},"title":{"type":"string","maxLength":1024},"url":{"type":"string","maxLength":512},"sheetId":{"type":"integer","minimum":0},"tabTitle":{"type":"string","maxLength":1024},"sameAccount":{"type":"boolean"}},"required":["formSlug","spreadsheetId","title","url","sheetId","tabTitle"],"additionalProperties":false},"maxItems":50},"picked":{"type":"array","items":{"type":"object","properties":{"spreadsheetId":{"type":"string","maxLength":200},"title":{"type":"string","maxLength":1024},"url":{"type":"string","maxLength":512}},"required":["spreadsheetId","title","url"],"additionalProperties":false},"maxItems":10}},"required":["destinations","picked"],"additionalProperties":false}},
|
|
58
|
+
{"name":"remove-destination","input":{"type":"object","properties":{"formSlug":{"type":"string","maxLength":64,"minLength":1}},"required":["formSlug"],"additionalProperties":false},"result":{"type":"object","properties":{"forms":{"type":"array","items":{"type":"object","properties":{"slug":{"type":"string","minLength":1,"maxLength":64},"title":{"type":"string","maxLength":1024}},"required":["slug","title"],"additionalProperties":false},"maxItems":200},"destinations":{"type":"array","items":{"type":"object","properties":{"formSlug":{"type":"string","maxLength":64},"spreadsheetId":{"type":"string","maxLength":200},"title":{"type":"string","maxLength":1024},"url":{"type":"string","maxLength":512},"sheetId":{"type":"integer","minimum":0},"tabTitle":{"type":"string","maxLength":1024},"sameAccount":{"type":"boolean"}},"required":["formSlug","spreadsheetId","title","url","sheetId","tabTitle"],"additionalProperties":false},"maxItems":50},"picked":{"type":"array","items":{"type":"object","properties":{"spreadsheetId":{"type":"string","maxLength":200},"title":{"type":"string","maxLength":1024},"url":{"type":"string","maxLength":512}},"required":["spreadsheetId","title","url"],"additionalProperties":false},"maxItems":10}},"required":["destinations","picked"],"additionalProperties":false}}
|
|
59
|
+
],
|
|
60
|
+
"csp": {"script-src":["https://apis.google.com"],"frame-src":["https://docs.google.com"]}
|
|
61
|
+
}
|
|
62
|
+
]
|
|
63
|
+
}
|