@jini-ai/agent-plugins 0.7.2 → 0.7.3-next.2
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 +4 -4
- package/NOTICE +2 -0
- package/README.md +11 -15
- package/calendly/plugin.json +3 -3
- package/cloudflare/lib/forms.mjs +9 -10
- package/cloudflare/lib/target.mjs +1 -1
- package/cloudflare/plugin.json +3 -3
- package/cloudflare/worker/forms-receiver.mjs +9 -9
- package/composio/plugin.json +3 -3
- package/core/persistent-state.js +227 -163
- package/dist/admin-surfaces/connections/connections.d.ts +11 -6
- package/dist/admin-surfaces/connections/connections.js +102 -85
- package/dist/admin-surfaces/node.d.ts +27 -0
- package/dist/admin-surfaces/node.js +32 -0
- package/dist/admin-surfaces/plugin-state.js +21 -18
- package/dist/admin-surfaces/surface-client.d.ts +4 -0
- package/dist/admin-surfaces/surface-client.js +124 -117
- package/dist/admin-surfaces/surface-handlers.js +21 -17
- package/dist/admin-surfaces/theme.d.ts +5 -1
- package/dist/admin-surfaces/theme.js +3 -3
- package/dist/connect/access-token-tool.d.ts +3 -1
- package/dist/connect/access-token-tool.js +3 -2
- package/dist/connect/apply-connect-defaults.js +2 -2
- package/dist/connect/apply-tool-renames.js +9 -8
- package/dist/connect/connect-tool.d.ts +2 -0
- package/dist/connect/connect-tool.js +3 -2
- package/dist/connect/credential-cards.js +3 -2
- package/dist/connect/credential-save-tool.d.ts +14 -11
- package/dist/connect/credential-save-tool.js +128 -121
- package/dist/connect/enable-access.d.ts +2 -2
- package/dist/connect/enable-access.js +6 -6
- package/dist/connect/executable/register.js +40 -34
- package/dist/connect/federate-mcp.d.ts +21 -11
- package/dist/connect/federate-mcp.js +28 -21
- package/dist/connect/grant-signed-in-defaults.js +3 -3
- package/dist/connect/import-access-token.js +2 -1
- package/dist/connect/index.d.ts +1 -0
- package/dist/connect/index.js +1 -0
- package/dist/connect/plugin-credential-card.js +2 -1
- package/dist/connect/plugin-host/index.d.ts +10 -5
- package/dist/connect/plugin-host/index.js +113 -100
- package/dist/connect/ports.d.ts +1 -1
- package/dist/connect/row-update.d.ts +22 -0
- package/dist/connect/row-update.js +18 -0
- package/dist/connect/switch-on-saved-token.d.ts +4 -2
- package/dist/connect/switch-on-saved-token.js +1 -1
- package/dist/connect/token-map.d.ts +44 -0
- package/dist/connect/token-map.js +49 -0
- package/dist/core/identity-namespace.js +5 -0
- package/dist/folder-zip.d.ts +3 -1
- package/dist/folder-zip.js +2 -2
- package/dist/lifecycle/activation.d.ts +4 -4
- package/dist/lifecycle/activation.js +4 -5
- package/dist/lifecycle/automatic-use.js +236 -210
- package/dist/lifecycle/bundled-digests.d.ts +75 -12
- package/dist/lifecycle/bundled-digests.js +213 -212
- package/dist/lifecycle/bundled-source-archive.d.ts +1 -1
- package/dist/lifecycle/bundled-source-archive.js +263 -264
- package/dist/lifecycle/capability-projection.d.ts +1 -1
- package/dist/lifecycle/capability-projection.js +1 -1
- package/dist/lifecycle/credential-card-metadata.d.ts +1 -1
- package/dist/lifecycle/credential-card-metadata.js +27 -3
- package/dist/lifecycle/exports.js +9 -4
- package/dist/lifecycle/fetch-archive.d.ts +1 -1
- package/dist/lifecycle/fetch-archive.js +1 -1
- package/dist/lifecycle/host-tools/identity.js +3 -2
- package/dist/lifecycle/host-tools/ports.d.ts +2 -0
- package/dist/lifecycle/host-tools/search-tool.d.ts +4 -2
- package/dist/lifecycle/host-tools/search-tool.js +9 -8
- package/dist/lifecycle/host-tools/skill-tool.d.ts +18 -2
- package/dist/lifecycle/host-tools/skill-tool.js +16 -8
- package/dist/lifecycle/index.d.ts +118 -110
- package/dist/lifecycle/index.js +45 -12
- package/dist/lifecycle/install-errors.d.ts +1 -1
- package/dist/lifecycle/install-from-url.d.ts +1 -1
- package/dist/lifecycle/install-from-url.js +1 -1
- package/dist/lifecycle/install.d.ts +7 -2
- package/dist/lifecycle/install.js +414 -396
- package/dist/lifecycle/installed-package-index.js +45 -42
- package/dist/lifecycle/layout.d.ts +1 -1
- package/dist/lifecycle/layout.js +1 -1
- package/dist/lifecycle/mail/catalog.d.ts +8 -32
- package/dist/lifecycle/mail/catalog.js +25 -20
- package/dist/lifecycle/mail/contribution.d.ts +2 -2
- package/dist/lifecycle/mail/contribution.js +34 -34
- package/dist/lifecycle/mail/selection.js +6 -2
- package/dist/lifecycle/manifest.d.ts +3 -3
- package/dist/lifecycle/manifest.js +4 -4
- package/dist/lifecycle/mcp-provisioning.d.ts +3 -3
- package/dist/lifecycle/mcp-provisioning.js +3 -3
- package/dist/lifecycle/package-paths.d.ts +1 -1
- package/dist/lifecycle/package-paths.js +1 -1
- package/dist/lifecycle/persistent-state.js +1 -2
- package/dist/lifecycle/ports.d.ts +5 -1
- package/dist/lifecycle/resolve-agent-plugin-refs.d.ts +30 -8
- package/dist/lifecycle/resolve-agent-plugin-refs.js +227 -228
- package/dist/lifecycle/retire-bundled.d.ts +1 -52
- package/dist/lifecycle/retire-bundled.js +134 -84
- package/dist/lifecycle/search.d.ts +2 -1
- package/dist/lifecycle/search.js +1 -1
- package/dist/lifecycle/seed-bundled.d.ts +1 -1
- package/dist/lifecycle/seed-bundled.js +154 -155
- package/dist/lifecycle/set-enabled.d.ts +1 -1
- package/dist/lifecycle/set-enabled.js +1 -1
- package/dist/lifecycle/skill-file-reader.js +53 -50
- package/dist/lifecycle/tools/projection.d.ts +4 -7
- package/dist/lifecycle/tools/projection.js +109 -108
- package/dist/lifecycle/trusted-plugin-files.d.ts +2 -2
- package/dist/lifecycle/trusted-plugin-files.js +1 -1
- package/dist/lifecycle/uninstall.d.ts +1 -1
- package/dist/lifecycle/uninstall.js +237 -241
- package/dist/lifecycle/update-store.js +20 -17
- package/dist/lifecycle/update.js +287 -281
- package/dist/lifecycle/yauzl-archive-reader.d.ts +2 -2
- package/dist/lifecycle/yauzl-archive-reader.js +8 -2
- package/dist/manifest.d.ts +11 -3
- package/dist/manifest.js +9 -9
- package/fly/jini-credential-schemes.json +11 -0
- package/fly/plugin.json +3 -4
- package/github/plugin.json +3 -3
- package/github/source-control/backup-push.mjs +11 -11
- package/github/source-control/commit-site.mjs +23 -13
- package/github/source-control/github.mjs +12 -6
- package/github/source-control/write-files.mjs +27 -28
- package/github-pages/{tovu-deploy-targets.json → jini-deploy-targets.json} +22 -22
- package/github-pages/plugin.json +3 -3
- package/github-pages/targets/github-pages.mjs +3 -3
- package/google-login/plugin.json +3 -3
- package/google-workspace/README.md +14 -14
- package/google-workspace/form-destinations/README.md +3 -3
- package/google-workspace/form-destinations/dedupe.mjs +1 -1
- package/google-workspace/form-destinations/mapping.mjs +8 -9
- package/google-workspace/form-destinations/sheets.mjs +1 -1
- package/google-workspace/{tovu-admin-surfaces.json → jini-admin-surfaces.json} +2 -2
- package/google-workspace/{tovu-agent-tools.json → jini-agent-tools.json} +28 -28
- package/google-workspace/{tovu-connections.json → jini-connections.json} +2 -2
- package/google-workspace/lib/auth.mjs +2 -2
- package/google-workspace/lib/form-destination-settings.mjs +1 -1
- package/google-workspace/lib/picker-flow.mjs +2 -2
- package/google-workspace/lib/request-policy.mjs +1 -1
- package/google-workspace/lib/surface-actions.mjs +1 -1
- package/google-workspace/plugin.json +3 -3
- package/google-workspace/tools/sheets/README.md +3 -3
- package/google-workspace/tools/sheets-admin/README.md +3 -3
- package/google-workspace/ui/README.md +4 -4
- package/google-workspace/ui/connection-panel.mjs +51 -51
- package/google-workspace/ui/destination-panel.mjs +34 -34
- package/google-workspace/ui/dom.mjs +15 -16
- package/google-workspace/ui/picker-flow.mjs +2 -2
- package/google-workspace/ui/picker.mjs +19 -19
- package/google-workspace/ui/surface-client.mjs +96 -69
- package/higgsfield-media/plugin.json +3 -3
- package/jev/plugin.json +3 -3
- package/kuinetic/CHANGELOG.md +12 -0
- package/kuinetic/mcp.json +4 -0
- package/kuinetic/plugin.json +27 -0
- package/kuinetic/skills/kuinetic/SKILL.md +120 -0
- package/kuinetic/skills/kuinetic/references/effects-by-family.md +32 -0
- package/kuinetic/skills/kuinetic/references/opt-in-tiers.md +12 -0
- package/kuinetic/skills/kuinetic/references/reserved-keys.md +36 -0
- package/meilisearch/plugin.json +5 -5
- package/netlify/plugin.json +3 -3
- package/netlify/targets/netlify.mjs +14 -4
- package/opentelemetry/plugin.json +3 -3
- package/package.json +27 -22
- package/posthog/plugin.json +3 -3
- package/railway/plugin.json +3 -3
- package/render/plugin.json +3 -3
- package/resend/NOTES.md +2 -2
- package/resend/adapters/resend.mjs +1 -1
- package/resend/{tovu-mail-adapters.json → jini-mail-adapters.json} +1 -1
- package/resend/lib/domains.mjs +8 -8
- package/resend/plugin.json +3 -3
- package/s3-compatible/{tovu-deploy-targets.json → jini-deploy-targets.json} +68 -68
- package/s3-compatible/jini-object-stores.json +29 -0
- package/s3-compatible/object-stores/s3-compatible.mjs +19 -13
- package/s3-compatible/plugin.json +3 -3
- package/s3-compatible/targets/s3-compatible.mjs +25 -25
- package/sentry/plugin.json +3 -3
- package/shadcn-ui/CHANGELOG.md +7 -0
- package/shadcn-ui/LICENSE +201 -0
- package/shadcn-ui/NOTICE +10 -0
- package/shadcn-ui/mcp.json +4 -0
- package/shadcn-ui/plugin.json +26 -0
- package/shopify/plugin.json +3 -3
- package/site-compliance/plugin.json +3 -3
- package/site-import/plugin.json +3 -3
- package/supabase/mcp.json +1 -4
- package/supabase/plugin.json +3 -3
- package/ui-ux-design/CHANGELOG.md +13 -0
- package/ui-ux-design/NOTICE +2 -0
- package/ui-ux-design/README.md +17 -7
- package/ui-ux-design/plugin.json +6 -3
- package/ui-ux-design/skills/ui-ux-design/SKILL.md +38 -152
- package/ui-ux-design/skills/ui-ux-design/references/full-workflow.md +156 -0
- package/ui-ux-design/skills/ui-ux-design/references/ui-animation.md +4 -4
- package/vercel/NOTES.md +1 -1
- package/vercel/object-stores/vercel-blob.mjs +12 -2
- package/vercel/plugin.json +3 -3
- package/vercel/targets/vercel.mjs +3 -3
- package/wordpress/plugin.json +3 -3
- package/dist/lifecycle/node.d.ts +0 -11
- package/dist/lifecycle/node.js +0 -38
- package/fly/tovu-credential-schemes.json +0 -11
- package/github/deployments/github.mjs +0 -415
- package/s3-compatible/tovu-object-stores.json +0 -29
- package/ui-ux-design/skills/ui-ux-design/references/kuinetic-reference.md +0 -184
- /package/cloudflare/{tovu-consent.json → jini-consent.json} +0 -0
- /package/cloudflare/{tovu-deploy-targets.json → jini-deploy-targets.json} +0 -0
- /package/cloudflare/{tovu-form-destinations.json → jini-form-destinations.json} +0 -0
- /package/fly/{tovu-deploy-configs.json → jini-deploy-configs.json} +0 -0
- /package/fly/{tovu-deploy-ops.json → jini-deploy-ops.json} +0 -0
- /package/github/{tovu-deploy-ops.json → jini-deploy-ops.json} +0 -0
- /package/github/{tovu-source-control.json → jini-source-control.json} +0 -0
- /package/google-login/{tovu-login-providers.json → jini-login-providers.json} +0 -0
- /package/google-workspace/{tovu-form-destinations.json → jini-form-destinations.json} +0 -0
- /package/meilisearch/{tovu-search-providers.json → jini-search-providers.json} +0 -0
- /package/netlify/{tovu-consent.json → jini-consent.json} +0 -0
- /package/netlify/{tovu-deploy-targets.json → jini-deploy-targets.json} +0 -0
- /package/railway/{tovu-deploy-configs.json → jini-deploy-configs.json} +0 -0
- /package/railway/{tovu-deploy-ops.json → jini-deploy-ops.json} +0 -0
- /package/render/{tovu-deploy-configs.json → jini-deploy-configs.json} +0 -0
- /package/render/{tovu-deploy-ops.json → jini-deploy-ops.json} +0 -0
- /package/{ui-ux-design → shadcn-ui}/skills/shadcn-ui/README.md +0 -0
- /package/{ui-ux-design → shadcn-ui}/skills/shadcn-ui/SKILL.md +0 -0
- /package/{ui-ux-design → shadcn-ui}/skills/shadcn-ui/examples/auth-layout.tsx +0 -0
- /package/{ui-ux-design → shadcn-ui}/skills/shadcn-ui/examples/data-table.tsx +0 -0
- /package/{ui-ux-design → shadcn-ui}/skills/shadcn-ui/examples/form-pattern.tsx +0 -0
- /package/{ui-ux-design → shadcn-ui}/skills/shadcn-ui/resources/component-catalog.md +0 -0
- /package/{ui-ux-design → shadcn-ui}/skills/shadcn-ui/resources/customization-guide.md +0 -0
- /package/{ui-ux-design → shadcn-ui}/skills/shadcn-ui/resources/migration-guide.md +0 -0
- /package/{ui-ux-design → shadcn-ui}/skills/shadcn-ui/resources/setup-guide.md +0 -0
- /package/{ui-ux-design → shadcn-ui}/skills/shadcn-ui/scripts/verify-setup.sh +0 -0
- /package/vercel/{tovu-consent.json → jini-consent.json} +0 -0
- /package/vercel/{tovu-deploy-targets.json → jini-deploy-targets.json} +0 -0
- /package/vercel/{tovu-object-stores.json → jini-object-stores.json} +0 -0
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
"spreadsheetId": {
|
|
33
33
|
"type": "string",
|
|
34
34
|
"pattern": "^[A-Za-z0-9_-]{10,200}$",
|
|
35
|
-
"description": "Spreadsheet id (the file must be one
|
|
35
|
+
"description": "Spreadsheet id (the file must be one the site created or the person picked)."
|
|
36
36
|
},
|
|
37
37
|
"ranges": {
|
|
38
38
|
"type": "array",
|
|
@@ -75,7 +75,7 @@
|
|
|
75
75
|
"spreadsheetId": {
|
|
76
76
|
"type": "string",
|
|
77
77
|
"pattern": "^[A-Za-z0-9_-]{10,200}$",
|
|
78
|
-
"description": "Spreadsheet id (the file must be one
|
|
78
|
+
"description": "Spreadsheet id (the file must be one the site created or the person picked)."
|
|
79
79
|
},
|
|
80
80
|
"dataFilters": {
|
|
81
81
|
"type": "array",
|
|
@@ -185,7 +185,7 @@
|
|
|
185
185
|
"spreadsheetId": {
|
|
186
186
|
"type": "string",
|
|
187
187
|
"pattern": "^[A-Za-z0-9_-]{10,200}$",
|
|
188
|
-
"description": "Spreadsheet id (the file must be one
|
|
188
|
+
"description": "Spreadsheet id (the file must be one the site created or the person picked)."
|
|
189
189
|
},
|
|
190
190
|
"title": { "type": "string", "minLength": 1, "maxLength": 200 },
|
|
191
191
|
"parentFolderId": { "type": "string", "pattern": "^[A-Za-z0-9_-]{1,256}$" }
|
|
@@ -211,7 +211,7 @@
|
|
|
211
211
|
"spreadsheetId": {
|
|
212
212
|
"type": "string",
|
|
213
213
|
"pattern": "^[A-Za-z0-9_-]{10,200}$",
|
|
214
|
-
"description": "Spreadsheet id (the file must be one
|
|
214
|
+
"description": "Spreadsheet id (the file must be one the site created or the person picked)."
|
|
215
215
|
},
|
|
216
216
|
"sheetId": {
|
|
217
217
|
"type": "integer",
|
|
@@ -222,7 +222,7 @@
|
|
|
222
222
|
"destinationSpreadsheetId": {
|
|
223
223
|
"type": "string",
|
|
224
224
|
"pattern": "^[A-Za-z0-9_-]{10,200}$",
|
|
225
|
-
"description": "Spreadsheet id (the file must be one
|
|
225
|
+
"description": "Spreadsheet id (the file must be one the site created or the person picked)."
|
|
226
226
|
}
|
|
227
227
|
}
|
|
228
228
|
}
|
|
@@ -246,7 +246,7 @@
|
|
|
246
246
|
"spreadsheetId": {
|
|
247
247
|
"type": "string",
|
|
248
248
|
"pattern": "^[A-Za-z0-9_-]{10,200}$",
|
|
249
|
-
"description": "Spreadsheet id (the file must be one
|
|
249
|
+
"description": "Spreadsheet id (the file must be one the site created or the person picked)."
|
|
250
250
|
},
|
|
251
251
|
"range": {
|
|
252
252
|
"type": "string",
|
|
@@ -278,7 +278,7 @@
|
|
|
278
278
|
"spreadsheetId": {
|
|
279
279
|
"type": "string",
|
|
280
280
|
"pattern": "^[A-Za-z0-9_-]{10,200}$",
|
|
281
|
-
"description": "Spreadsheet id (the file must be one
|
|
281
|
+
"description": "Spreadsheet id (the file must be one the site created or the person picked)."
|
|
282
282
|
},
|
|
283
283
|
"ranges": {
|
|
284
284
|
"type": "array",
|
|
@@ -315,7 +315,7 @@
|
|
|
315
315
|
"spreadsheetId": {
|
|
316
316
|
"type": "string",
|
|
317
317
|
"pattern": "^[A-Za-z0-9_-]{10,200}$",
|
|
318
|
-
"description": "Spreadsheet id (the file must be one
|
|
318
|
+
"description": "Spreadsheet id (the file must be one the site created or the person picked)."
|
|
319
319
|
},
|
|
320
320
|
"range": {
|
|
321
321
|
"type": "string",
|
|
@@ -361,7 +361,7 @@
|
|
|
361
361
|
"spreadsheetId": {
|
|
362
362
|
"type": "string",
|
|
363
363
|
"pattern": "^[A-Za-z0-9_-]{10,200}$",
|
|
364
|
-
"description": "Spreadsheet id (the file must be one
|
|
364
|
+
"description": "Spreadsheet id (the file must be one the site created or the person picked)."
|
|
365
365
|
},
|
|
366
366
|
"range": {
|
|
367
367
|
"type": "string",
|
|
@@ -406,7 +406,7 @@
|
|
|
406
406
|
"spreadsheetId": {
|
|
407
407
|
"type": "string",
|
|
408
408
|
"pattern": "^[A-Za-z0-9_-]{10,200}$",
|
|
409
|
-
"description": "Spreadsheet id (the file must be one
|
|
409
|
+
"description": "Spreadsheet id (the file must be one the site created or the person picked)."
|
|
410
410
|
},
|
|
411
411
|
"data": {
|
|
412
412
|
"type": "array",
|
|
@@ -446,7 +446,7 @@
|
|
|
446
446
|
},
|
|
447
447
|
{
|
|
448
448
|
"name": "sheets_values_clear",
|
|
449
|
-
"description": "Clear every value in one explicit A1 range (formatting stays). Asks the person to confirm; cannot be undone from
|
|
449
|
+
"description": "Clear every value in one explicit A1 range (formatting stays). Asks the person to confirm; cannot be undone from here.",
|
|
450
450
|
"effect": "destructive",
|
|
451
451
|
"module": "tools/sheets/values-clear.mjs",
|
|
452
452
|
"inputSchema": {
|
|
@@ -463,7 +463,7 @@
|
|
|
463
463
|
"spreadsheetId": {
|
|
464
464
|
"type": "string",
|
|
465
465
|
"pattern": "^[A-Za-z0-9_-]{10,200}$",
|
|
466
|
-
"description": "Spreadsheet id (the file must be one
|
|
466
|
+
"description": "Spreadsheet id (the file must be one the site created or the person picked)."
|
|
467
467
|
},
|
|
468
468
|
"range": {
|
|
469
469
|
"type": "string",
|
|
@@ -476,7 +476,7 @@
|
|
|
476
476
|
},
|
|
477
477
|
{
|
|
478
478
|
"name": "sheets_values_batch_clear",
|
|
479
|
-
"description": "Clear every value in up to 100 explicit A1 ranges. Asks the person to confirm; cannot be undone from
|
|
479
|
+
"description": "Clear every value in up to 100 explicit A1 ranges. Asks the person to confirm; cannot be undone from here.",
|
|
480
480
|
"effect": "destructive",
|
|
481
481
|
"module": "tools/sheets/values-batch-clear.mjs",
|
|
482
482
|
"inputSchema": {
|
|
@@ -493,7 +493,7 @@
|
|
|
493
493
|
"spreadsheetId": {
|
|
494
494
|
"type": "string",
|
|
495
495
|
"pattern": "^[A-Za-z0-9_-]{10,200}$",
|
|
496
|
-
"description": "Spreadsheet id (the file must be one
|
|
496
|
+
"description": "Spreadsheet id (the file must be one the site created or the person picked)."
|
|
497
497
|
},
|
|
498
498
|
"ranges": {
|
|
499
499
|
"type": "array",
|
|
@@ -528,7 +528,7 @@
|
|
|
528
528
|
"spreadsheetId": {
|
|
529
529
|
"type": "string",
|
|
530
530
|
"pattern": "^[A-Za-z0-9_-]{10,200}$",
|
|
531
|
-
"description": "Spreadsheet id (the file must be one
|
|
531
|
+
"description": "Spreadsheet id (the file must be one the site created or the person picked)."
|
|
532
532
|
},
|
|
533
533
|
"action": { "enum": ["get", "update", "clear"] },
|
|
534
534
|
"dataFilters": {
|
|
@@ -689,7 +689,7 @@
|
|
|
689
689
|
"spreadsheetId": {
|
|
690
690
|
"type": "string",
|
|
691
691
|
"pattern": "^[A-Za-z0-9_-]{10,200}$",
|
|
692
|
-
"description": "Spreadsheet id (the file must be one
|
|
692
|
+
"description": "Spreadsheet id (the file must be one the site created or the person picked)."
|
|
693
693
|
},
|
|
694
694
|
"ranges": {
|
|
695
695
|
"type": "array",
|
|
@@ -728,7 +728,7 @@
|
|
|
728
728
|
"spreadsheetId": {
|
|
729
729
|
"type": "string",
|
|
730
730
|
"pattern": "^[A-Za-z0-9_-]{10,200}$",
|
|
731
|
-
"description": "Spreadsheet id (the file must be one
|
|
731
|
+
"description": "Spreadsheet id (the file must be one the site created or the person picked)."
|
|
732
732
|
},
|
|
733
733
|
"find": { "type": "string", "minLength": 1, "maxLength": 1000 },
|
|
734
734
|
"replacement": { "type": "string", "maxLength": 1000 },
|
|
@@ -749,7 +749,7 @@
|
|
|
749
749
|
},
|
|
750
750
|
{
|
|
751
751
|
"name": "sheets_tab_modify",
|
|
752
|
-
"description": "Pass the connectionRef from the connection status and the spreadsheetId of a spreadsheet the person picked or
|
|
752
|
+
"description": "Pass the connectionRef from the connection status and the spreadsheetId of a spreadsheet the person picked or the site created. Add, rename, delete, duplicate or move one tab (sheetId is the tab's numeric id). add needs title; rename needs sheetId and title; delete and duplicate need sheetId (duplicate may set title and index); move needs sheetId and index. Deleting a tab deletes its data. The person confirms on a card before anything changes; remote changes cannot be undone from here.",
|
|
753
753
|
"effect": "destructive",
|
|
754
754
|
"module": "tools/sheets-admin/tab-modify.mjs",
|
|
755
755
|
"inputSchema": {
|
|
@@ -790,7 +790,7 @@
|
|
|
790
790
|
},
|
|
791
791
|
{
|
|
792
792
|
"name": "sheets_sort",
|
|
793
|
-
"description": "Pass the connectionRef from the connection status and the spreadsheetId of a spreadsheet the person picked or
|
|
793
|
+
"description": "Pass the connectionRef from the connection status and the spreadsheetId of a spreadsheet the person picked or the site created. Physically reorder the rows of a grid range (zero-based, end-exclusive indices) by up to 10 columns; dimensionIndex is the zero-based column. The old row order is not kept. The person confirms on a card before anything changes; remote changes cannot be undone from here.",
|
|
794
794
|
"effect": "destructive",
|
|
795
795
|
"module": "tools/sheets-admin/sort.mjs",
|
|
796
796
|
"inputSchema": {
|
|
@@ -831,7 +831,7 @@
|
|
|
831
831
|
},
|
|
832
832
|
{
|
|
833
833
|
"name": "sheets_basic_filter",
|
|
834
|
-
"description": "Pass the connectionRef from the connection status and the spreadsheetId of a spreadsheet the person picked or
|
|
834
|
+
"description": "Pass the connectionRef from the connection status and the spreadsheetId of a spreadsheet the person picked or the site created. Set or clear the basic filter of a tab. clear needs sheetId; set needs range and may give filterSpecs (Sheets FilterSpec objects). To read a tab's filter without a confirmation, call sheets_get with fields \"sheets(properties(sheetId),basicFilter)\". A filter hides rows; it never deletes or reorders data (to sort rows, use sheets_sort). The person confirms on a card before anything changes; remote changes cannot be undone from here.",
|
|
835
835
|
"effect": "write",
|
|
836
836
|
"module": "tools/sheets-admin/basic-filter.mjs",
|
|
837
837
|
"inputSchema": {
|
|
@@ -871,7 +871,7 @@
|
|
|
871
871
|
},
|
|
872
872
|
{
|
|
873
873
|
"name": "sheets_filter_views",
|
|
874
|
-
"description": "Pass the connectionRef from the connection status and the spreadsheetId of a spreadsheet the person picked or
|
|
874
|
+
"description": "Pass the connectionRef from the connection status and the spreadsheetId of a spreadsheet the person picked or the site created. List, add, update, duplicate or delete saved filter views. list may narrow to one sheetId; add needs filter (with range); update needs filterViewId, filter and fields (the filter properties to change); duplicate and delete need filterViewId. The person confirms on a card before anything changes; remote changes cannot be undone from here.",
|
|
875
875
|
"effect": "destructive",
|
|
876
876
|
"module": "tools/sheets-admin/filter-views.mjs",
|
|
877
877
|
"inputSchema": {
|
|
@@ -949,7 +949,7 @@
|
|
|
949
949
|
},
|
|
950
950
|
{
|
|
951
951
|
"name": "sheets_format",
|
|
952
|
-
"description": "Pass the connectionRef from the connection status and the spreadsheetId of a spreadsheet the person picked or
|
|
952
|
+
"description": "Pass the connectionRef from the connection status and the spreadsheetId of a spreadsheet the person picked or the site created. Format a grid range: cellFormat (a Sheets CellFormat: numberFormat, textFormat, backgroundColor, horizontalAlignment, wrapStrategy and so on) with fields naming exactly which format properties to set (for example [\"textFormat.bold\", \"numberFormat\"]); borders (top, bottom, left, right, innerHorizontal, innerVertical); frozenRowCount and frozenColumnCount for the range's tab; columnWidth in pixels for the range's columns. Never changes cell values. The person confirms on a card before anything changes; remote changes cannot be undone from here.",
|
|
953
953
|
"effect": "write",
|
|
954
954
|
"module": "tools/sheets-admin/format.mjs",
|
|
955
955
|
"inputSchema": {
|
|
@@ -1030,7 +1030,7 @@
|
|
|
1030
1030
|
},
|
|
1031
1031
|
{
|
|
1032
1032
|
"name": "sheets_named_ranges",
|
|
1033
|
-
"description": "Pass the connectionRef from the connection status and the spreadsheetId of a spreadsheet the person picked or
|
|
1033
|
+
"description": "Pass the connectionRef from the connection status and the spreadsheetId of a spreadsheet the person picked or the site created. List, add, update or delete named ranges. add needs name and range; update needs namedRangeId and a new name or range; delete needs namedRangeId. Formulas that use a deleted or moved name change with it. The person confirms on a card before anything changes; remote changes cannot be undone from here.",
|
|
1034
1034
|
"effect": "destructive",
|
|
1035
1035
|
"module": "tools/sheets-admin/named-ranges.mjs",
|
|
1036
1036
|
"inputSchema": {
|
|
@@ -1078,7 +1078,7 @@
|
|
|
1078
1078
|
},
|
|
1079
1079
|
{
|
|
1080
1080
|
"name": "sheets_protected_ranges_get",
|
|
1081
|
-
"description": "Pass the connectionRef from the connection status and the spreadsheetId of a spreadsheet the person picked or
|
|
1081
|
+
"description": "Pass the connectionRef from the connection status and the spreadsheetId of a spreadsheet the person picked or the site created. Which ranges are protected, who may edit them, and whether the connected account can (requestingUserCanEdit). Optionally only one tab (sheetId). Changing protection goes through sheets_batch_update.",
|
|
1082
1082
|
"effect": "read",
|
|
1083
1083
|
"module": "tools/sheets-admin/protected-ranges-get.mjs",
|
|
1084
1084
|
"inputSchema": {
|
|
@@ -1094,7 +1094,7 @@
|
|
|
1094
1094
|
},
|
|
1095
1095
|
{
|
|
1096
1096
|
"name": "sheets_developer_metadata",
|
|
1097
|
-
"description": "Pass the connectionRef from the connection status and the spreadsheetId of a spreadsheet the person picked or
|
|
1097
|
+
"description": "Pass the connectionRef from the connection status and the spreadsheetId of a spreadsheet the person picked or the site created. Read developer metadata: get one entry by metadataId, or search with up to 20 Sheets DataFilter objects. Creating, changing or deleting metadata goes through sheets_batch_update.",
|
|
1098
1098
|
"effect": "read",
|
|
1099
1099
|
"module": "tools/sheets-admin/developer-metadata.mjs",
|
|
1100
1100
|
"inputSchema": {
|
|
@@ -1122,7 +1122,7 @@
|
|
|
1122
1122
|
},
|
|
1123
1123
|
{
|
|
1124
1124
|
"name": "sheets_batch_update",
|
|
1125
|
-
"description": "Pass the connectionRef from the connection status and the spreadsheetId of a spreadsheet the person picked or
|
|
1125
|
+
"description": "Pass the connectionRef from the connection status and the spreadsheetId of a spreadsheet the person picked or the site created. Send up to 100 Sheets batchUpdate request objects (each names exactly one request kind, for example {\"insertDimension\": {...}}) in one atomic call, at most 1 MiB. Only reviewed, generally available request kinds are accepted (see the Sheets reference of this plugin); any other kind is refused before anything is sent. Field masks must be explicit, never *. The card lists every request kind. The person confirms on a card before anything changes; remote changes cannot be undone from here.",
|
|
1126
1126
|
"effect": "destructive",
|
|
1127
1127
|
"module": "tools/sheets-admin/batch-update.mjs",
|
|
1128
1128
|
"inputSchema": {
|
|
@@ -1143,7 +1143,7 @@
|
|
|
1143
1143
|
},
|
|
1144
1144
|
{
|
|
1145
1145
|
"name": "sheets_export_csv",
|
|
1146
|
-
"description": "Pass the connectionRef from the connection status and the spreadsheetId of a spreadsheet the person picked or
|
|
1146
|
+
"description": "Pass the connectionRef from the connection status and the spreadsheetId of a spreadsheet the person picked or the site created. Export one tab (sheetId), or an A1 range of it such as A1:F500, as a CSV file the person can download. At most 20,000 rows and 100,000 cells; a larger export is refused, never cut short. valueRenderOption FORMATTED_VALUE (default, as displayed) or UNFORMATTED_VALUE. Returns the file reference and its size, not the data.",
|
|
1147
1147
|
"effect": "read",
|
|
1148
1148
|
"module": "tools/sheets-admin/export-csv.mjs",
|
|
1149
1149
|
"inputSchema": {
|
|
@@ -1161,7 +1161,7 @@
|
|
|
1161
1161
|
},
|
|
1162
1162
|
{
|
|
1163
1163
|
"name": "sheets_open_existing",
|
|
1164
|
-
"description": "Work with a spreadsheet the person already has. Pass the connectionRef. Without spreadsheetId it answers waiting: the person chooses the file with Google's file picker in the Google Workspace plugin (a pasted link grants nothing). With the spreadsheetId of a picked file it checks that
|
|
1164
|
+
"description": "Work with a spreadsheet the person already has. Pass the connectionRef. Without spreadsheetId it answers waiting: the person chooses the file with Google's file picker in the Google Workspace plugin (a pasted link grants nothing). With the spreadsheetId of a picked file it checks that the site can open it and that it is a spreadsheet, and returns its id, title and link.",
|
|
1165
1165
|
"effect": "read",
|
|
1166
1166
|
"module": "tools/sheets-admin/open-existing.mjs",
|
|
1167
1167
|
"inputSchema": {
|
|
@@ -27,8 +27,8 @@
|
|
|
27
27
|
"apiOrigins": ["https://sheets.googleapis.com", "https://www.googleapis.com"],
|
|
28
28
|
"byoClient": true,
|
|
29
29
|
"clients": {
|
|
30
|
-
"web": { "clientIdEnv": "
|
|
31
|
-
"desktop": { "clientIdEnv": "
|
|
30
|
+
"web": { "clientIdEnv": "JINI_GOOGLE_WORKSPACE_OAUTH_WEB_CLIENT_ID", "clientSecretEnv": "JINI_GOOGLE_WORKSPACE_OAUTH_WEB_CLIENT_SECRET" },
|
|
31
|
+
"desktop": { "clientIdEnv": "JINI_GOOGLE_WORKSPACE_OAUTH_DESKTOP_CLIENT_ID", "clientSecretEnv": "JINI_GOOGLE_WORKSPACE_OAUTH_DESKTOP_CLIENT_SECRET" }
|
|
32
32
|
}
|
|
33
33
|
}
|
|
34
34
|
]
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @file The Google Workspace sign-in hooks (the `lib/auth.mjs` module `
|
|
2
|
+
* @file The Google Workspace sign-in hooks (the `lib/auth.mjs` module `jini-connections.json`
|
|
3
3
|
* names): which scopes a sign-in requests, who signed in, and how a grant is revoked at Google.
|
|
4
4
|
*
|
|
5
5
|
* Exists because the host's OAuth engine is provider-neutral: Google's endpoints live in
|
|
6
|
-
* `
|
|
6
|
+
* `jini-connections.json`, and everything Google-specific the engine must call back into lives
|
|
7
7
|
* here. The engine handles state, PKCE, the code exchange, refresh and token storage.
|
|
8
8
|
*
|
|
9
9
|
* Revocation honesty: `revoke` resolves only when Google answered 200, or answered `invalid_token`
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
*/
|
|
12
12
|
import { CONNECTION_ID } from './surface-actions.mjs';
|
|
13
13
|
|
|
14
|
-
/** This plugin's form-destination adapter id (`
|
|
14
|
+
/** This plugin's form-destination adapter id (`jini-form-destinations.json`). */
|
|
15
15
|
export const SHEETS_ADAPTER_ID = 'google-sheets';
|
|
16
16
|
export const MAX_FORM_DESTINATIONS = 50;
|
|
17
17
|
|
|
@@ -26,9 +26,9 @@ import { GoogleWorkspaceError } from './request-policy.mjs';
|
|
|
26
26
|
import { SHEETS_PRODUCT_ID } from './sheets-client.mjs';
|
|
27
27
|
import { CONNECTION_ID, sheetsUnavailableReason, surfaceAccount, surfaceRefusal, surfaceSheetsClient } from './surface-actions.mjs';
|
|
28
28
|
|
|
29
|
-
//
|
|
29
|
+
// Sites configure these public Picker values through the host.
|
|
30
30
|
/** Public config the hosted JS Picker needs; placeholders the operator sets, never secrets. */
|
|
31
|
-
export const PICKER_CONFIG_NAMES = Object.freeze({ developerKey: '
|
|
31
|
+
export const PICKER_CONFIG_NAMES = Object.freeze({ developerKey: 'JINI_GOOGLE_PICKER_BROWSER_KEY', appId: 'JINI_GOOGLE_PICKER_APP_ID' });
|
|
32
32
|
|
|
33
33
|
/** Long enough to browse Drive in the Picker; short enough that a forgotten tab stops being usable. */
|
|
34
34
|
export const PICKER_SESSION_TTL_MS = 15 * 60_000;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @file Google request policy for the Google Workspace plugin: the safe error every failure becomes,
|
|
3
3
|
* whether a failed request may be retried and how long to wait. The per-minute budgets themselves
|
|
4
|
-
* are declared in `
|
|
4
|
+
* are declared in `jini-connections.json` and enforced by the host on every token read.
|
|
5
5
|
*
|
|
6
6
|
* Exists so chat tools, admin actions and form delivery share ONE answer to "may this run again?"
|
|
7
7
|
* and one error vocabulary. Errors never carry tokens, Google's own message text or sheet contents:
|
|
@@ -14,7 +14,7 @@ import { isProductEnabled } from './product-state.mjs';
|
|
|
14
14
|
import { GoogleWorkspaceError } from './request-policy.mjs';
|
|
15
15
|
import { SHEETS_PRODUCT_ID, sheetsClientFor } from './sheets-client.mjs';
|
|
16
16
|
|
|
17
|
-
/** The plugin's one sign-in: `
|
|
17
|
+
/** The plugin's one sign-in: `jini-connections.json`'s id, declared by every surface that uses it. */
|
|
18
18
|
export const CONNECTION_ID = 'account';
|
|
19
19
|
|
|
20
20
|
const FAILURE_CODE = /^[a-z0-9]+(?:-[a-z0-9]+)*$/;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "https://agent-plugins.org/schemas/1.0.0/plugin.schema.json",
|
|
3
3
|
"name": "google-workspace",
|
|
4
|
-
"version": "0.1.
|
|
4
|
+
"version": "0.1.2",
|
|
5
5
|
"description": "Connects one Google account to this site with Google's own sign-in, then works with the Google files the person picks or this site creates (the drive.file permission, never the whole Drive). v1 ships Google Sheets: chat tools for spreadsheets and a form destination that appends submissions as rows. Products are turned on separately; turning one off stops its tools and deliveries without revoking the sign-in.",
|
|
6
|
-
"author": "
|
|
6
|
+
"author": "Jini",
|
|
7
7
|
"license": "Apache-2.0",
|
|
8
8
|
"extensions": {
|
|
9
9
|
"jini": {
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
"vendorAliases": ["google-sheets", "docs.google.com", "sheets.googleapis.com", "drive.googleapis.com", "gmail"],
|
|
12
12
|
"displayName": "Google Workspace",
|
|
13
13
|
"summary": "Sign in with Google once, then work with the spreadsheets you choose or create here.",
|
|
14
|
-
"id": "
|
|
14
|
+
"id": "jini/google-workspace",
|
|
15
15
|
"provides": [
|
|
16
16
|
"api-connection:google-workspace",
|
|
17
17
|
"form-destination:google-sheets"
|
|
@@ -3,8 +3,8 @@
|
|
|
3
3
|
## Purpose
|
|
4
4
|
|
|
5
5
|
The Google Sheets chat tools for spreadsheets, values, data filters and search (design §D). Each
|
|
6
|
-
`.mjs` file is one tool module declared in `../../
|
|
7
|
-
its `name` with the host's plugin prefix (in
|
|
6
|
+
`.mjs` file is one tool module declared in `../../jini-agent-tools.json`; the assistant sees it under
|
|
7
|
+
its `name` with the host's plugin prefix (in the first host, `p_google_workspace__<name>`). Every tool takes the `connectionRef` of the Google Workspace
|
|
8
8
|
connection; tools on an existing file also take its `spreadsheetId`. Tab, sort, filter, format,
|
|
9
9
|
named-range, protection, metadata, raw batch-update, CSV export and Picker tools live in
|
|
10
10
|
`../sheets-admin/` (a separate lot).
|
|
@@ -50,5 +50,5 @@ through `lib/http.mjs` (token right before each request, where the host charges
|
|
|
50
50
|
## Extension points
|
|
51
51
|
|
|
52
52
|
A new Sheets tool adds one module here (or under `../sheets-admin/`) and one entry in
|
|
53
|
-
`
|
|
53
|
+
`jini-agent-tools.json`; it reuses `sendSheetsRequest`, `sheetsUrl` and the bound helpers. A
|
|
54
54
|
second product uses `lib/http.mjs` directly with its own URL helper.
|
|
@@ -3,8 +3,8 @@
|
|
|
3
3
|
## Purpose
|
|
4
4
|
|
|
5
5
|
The structural and formatting half of the Google Sheets chat tools: everything beyond reading and
|
|
6
|
-
writing values. Each file is one tool module declared in `../../
|
|
7
|
-
by the assistant under its `name` with the host's plugin prefix (in
|
|
6
|
+
writing values. Each file is one tool module declared in `../../jini-agent-tools.json` and reached
|
|
7
|
+
by the assistant under its `name` with the host's plugin prefix (in the first host, `p_google_workspace__<name>`).
|
|
8
8
|
|
|
9
9
|
| Module | Tool | Effect |
|
|
10
10
|
|---|---|---|
|
|
@@ -42,4 +42,4 @@ by the assistant under its `name` with the host's plugin prefix (in Tovu, `p_goo
|
|
|
42
42
|
A new request kind is one reviewed row in `REQUEST_KINDS` (effect, replay class, required fields)
|
|
43
43
|
plus a line in `skills/google-workspace/references/sheets.md`. A new named wrapper is a module here
|
|
44
44
|
that builds inventory requests and calls `runBatchUpdate`, plus a declaration appended to
|
|
45
|
-
`
|
|
45
|
+
`jini-agent-tools.json`. Phase B may fold the shared helpers into `lib/sheets-client.mjs`.
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
## Purpose
|
|
4
4
|
|
|
5
|
-
The plugin's own admin screens, declared in `../
|
|
6
|
-
sandboxed frames (Jini `@jini-ai/agent-plugins/admin-surfaces`; in
|
|
5
|
+
The plugin's own admin screens, declared in `../jini-admin-surfaces.json` and mounted by the host as
|
|
6
|
+
sandboxed frames (Jini `@jini-ai/agent-plugins/admin-surfaces`; in the first host,
|
|
7
7
|
`apps/website/src/features/agent-plugins/admin-surfaces/`). Three surfaces:
|
|
8
8
|
|
|
9
9
|
| surface id | entry | what the person does there |
|
|
@@ -61,13 +61,13 @@ The host decides (the handler call's `context.hostKind`), and the bootstrap's `m
|
|
|
61
61
|
`system-browser` on a desktop host (Google's native Picker as a code + PKCE sign-in with
|
|
62
62
|
`trigger_onepick` and the spreadsheet MIME filter; `picked_file_ids` comes back through the host's
|
|
63
63
|
callback inbox), `hosted` on a hosted site (the JS Picker inside the frame, with the bootstrap's
|
|
64
|
-
short-lived access token and the public `
|
|
64
|
+
short-lived access token and the public `JINI_GOOGLE_PICKER_BROWSER_KEY` / `JINI_GOOGLE_PICKER_APP_ID`).
|
|
65
65
|
`unavailable` names why (not connected, permission missing, Sheets off, or a hosted site without both
|
|
66
66
|
Picker values: `picker-not-configured`). Every selection is verified by `lib/picker-selection.mjs` before it is saved.
|
|
67
67
|
|
|
68
68
|
## Extension points
|
|
69
69
|
|
|
70
70
|
A new product adds its switch automatically (the connection panel lists `products.json`); a new
|
|
71
|
-
action needs a declaration in `
|
|
71
|
+
action needs a declaration in `jini-admin-surfaces.json` (closed schemas) and a handler in the
|
|
72
72
|
surface's module. Another provider plugin builds its own panels on the same host seam; nothing here
|
|
73
73
|
is imported by a host or Jini.
|
|
@@ -24,7 +24,7 @@ const call = (action, payload = {}) => client.call({ action, payload });
|
|
|
24
24
|
/** Polls the status after a sign-in started, until the connection changes or the link expires. */
|
|
25
25
|
async function followSignIn(before, expiresAt) {
|
|
26
26
|
while (Date.now() < Date.parse(expiresAt)) {
|
|
27
|
-
await wait(POLL_MS);
|
|
27
|
+
await wait({ ms: POLL_MS });
|
|
28
28
|
const view = await call('status');
|
|
29
29
|
// The sign-in finished: the "continue to sign-in" instruction no longer applies.
|
|
30
30
|
if (JSON.stringify(view.connection) !== JSON.stringify(before.connection)) { notice = null; return render(view); }
|
|
@@ -37,9 +37,9 @@ async function followSignIn(before, expiresAt) {
|
|
|
37
37
|
* a retry can help), never a thrown page error. */
|
|
38
38
|
async function run(work) {
|
|
39
39
|
try {
|
|
40
|
-
await busy(app, work);
|
|
40
|
+
await busy({ root: app, work });
|
|
41
41
|
} catch (error) {
|
|
42
|
-
notice = { text: failureText(error), retry: error?.retryable === true ? () => run(work) : undefined };
|
|
42
|
+
notice = { text: failureText({ error }), retry: error?.retryable === true ? () => run(work) : undefined };
|
|
43
43
|
render(lastView);
|
|
44
44
|
}
|
|
45
45
|
}
|
|
@@ -76,13 +76,13 @@ function tickedDestinations() {
|
|
|
76
76
|
|
|
77
77
|
/** One unticked checkbox per destination while a switch is staged: moving one is always a choice. */
|
|
78
78
|
function reassignList(destinations) {
|
|
79
|
-
return h('fieldset', { class: 'list reassign' }, [
|
|
80
|
-
h('legend', {}, [REASSIGN_HINT]),
|
|
81
|
-
...destinations.map((entry) => h('label', { class: 'check' }, [
|
|
82
|
-
h('input', { type: 'checkbox', name: 'reassign', value: entry.formSlug }),
|
|
79
|
+
return h({ tag: 'fieldset' }, { props: { class: 'list reassign' }, children: [
|
|
80
|
+
h({ tag: 'legend' }, { props: {}, children: [REASSIGN_HINT] }),
|
|
81
|
+
...destinations.map((entry) => h({ tag: 'label' }, { props: { class: 'check' }, children: [
|
|
82
|
+
h({ tag: 'input' }, { props: { type: 'checkbox', name: 'reassign', value: entry.formSlug } }),
|
|
83
83
|
`${entry.formSlug}: ${entry.title} / ${entry.tabTitle}`,
|
|
84
|
-
])),
|
|
85
|
-
]);
|
|
84
|
+
] })),
|
|
85
|
+
] });
|
|
86
86
|
}
|
|
87
87
|
|
|
88
88
|
/**
|
|
@@ -90,24 +90,24 @@ function reassignList(destinations) {
|
|
|
90
90
|
* surface's declared `linkOrigins` open. The address stays visible in case the host refuses.
|
|
91
91
|
*/
|
|
92
92
|
function accountAccessLink(url) {
|
|
93
|
-
const open = () => client.openLink({ url }).catch((error) => { notice = { text: failureText(error) }; render(lastView); });
|
|
94
|
-
return h('p', { class: 'account-link' }, [
|
|
93
|
+
const open = () => client.openLink({ url }).catch((error) => { notice = { text: failureText({ error }) }; render(lastView); });
|
|
94
|
+
return h({ tag: 'p' }, { props: { class: 'account-link' }, children: [
|
|
95
95
|
'Or remove access yourself:', ' ',
|
|
96
|
-
h('button', { type: 'button', class: 'small', onClick: open }, ['Open Google Account page']),
|
|
97
|
-
' ', h('span', { class: 'url' }, [url]),
|
|
98
|
-
]);
|
|
96
|
+
h({ tag: 'button' }, { props: { type: 'button', class: 'small', onClick: open }, children: ['Open Google Account page'] }),
|
|
97
|
+
' ', h({ tag: 'span' }, { props: { class: 'url' }, children: [url] }),
|
|
98
|
+
] });
|
|
99
99
|
}
|
|
100
100
|
|
|
101
101
|
/** The second step of "Disconnect and revoke": nothing is sent until the person confirms here. */
|
|
102
102
|
function disconnectConfirmation(view) {
|
|
103
103
|
const cancel = () => { confirmingDisconnect = false; render(view); };
|
|
104
|
-
return h('div', { class: 'confirm', role: 'group', 'aria-label': 'Confirm disconnect' }, [
|
|
105
|
-
h('p', {}, [DISCONNECT_CONFIRM_TEXT]),
|
|
106
|
-
h('div', { class: 'actions' }, [
|
|
107
|
-
h('button', { type: 'button', class: 'danger', onClick: () => onAction('confirm-disconnect', view) }, ['Yes, disconnect and revoke']),
|
|
108
|
-
h('button', { type: 'button', onClick: cancel }, ['Cancel']),
|
|
109
|
-
]),
|
|
110
|
-
]);
|
|
104
|
+
return h({ tag: 'div' }, { props: { class: 'confirm', role: 'group', 'aria-label': 'Confirm disconnect' }, children: [
|
|
105
|
+
h({ tag: 'p' }, { props: {}, children: [DISCONNECT_CONFIRM_TEXT] }),
|
|
106
|
+
h({ tag: 'div' }, { props: { class: 'actions' }, children: [
|
|
107
|
+
h({ tag: 'button' }, { props: { type: 'button', class: 'danger', onClick: () => onAction('confirm-disconnect', view) }, children: ['Yes, disconnect and revoke'] }),
|
|
108
|
+
h({ tag: 'button' }, { props: { type: 'button', onClick: cancel }, children: ['Cancel'] }),
|
|
109
|
+
] }),
|
|
110
|
+
] });
|
|
111
111
|
}
|
|
112
112
|
|
|
113
113
|
function connectionCard(view) {
|
|
@@ -119,38 +119,38 @@ function connectionCard(view) {
|
|
|
119
119
|
if (entry.action === 'disconnect') return 'danger-quiet';
|
|
120
120
|
return index === 0 && summary.tone !== 'ok' ? 'primary' : undefined;
|
|
121
121
|
};
|
|
122
|
-
return h('section', { class: 'card', 'aria-labelledby': 'account-heading' }, [
|
|
123
|
-
h('div', { class: 'head' }, [
|
|
124
|
-
h('span', { class: `dot ${summary.tone}`, 'aria-hidden': 'true' }),
|
|
125
|
-
h('h2', { id: 'account-heading' }, [summary.heading]),
|
|
126
|
-
tip('About the Google connection', summary.detail),
|
|
127
|
-
]),
|
|
122
|
+
return h({ tag: 'section' }, { props: { class: 'card', 'aria-labelledby': 'account-heading' }, children: [
|
|
123
|
+
h({ tag: 'div' }, { props: { class: 'head' }, children: [
|
|
124
|
+
h({ tag: 'span' }, { props: { class: `dot ${summary.tone}`, 'aria-hidden': 'true' } }),
|
|
125
|
+
h({ tag: 'h2' }, { props: { id: 'account-heading' }, children: [summary.heading] }),
|
|
126
|
+
tip({ label: 'About the Google connection', text: summary.detail }),
|
|
127
|
+
] }),
|
|
128
128
|
switching && view.destinations.length > 0 ? reassignList(view.destinations) : null,
|
|
129
|
-
h('div', { class: 'actions' }, summary.buttons.map((entry, index) => h('button', { type: 'button', class: buttonClass(entry, index), onClick: () => onAction(entry.action, view) }, [entry.label]))),
|
|
129
|
+
h({ tag: 'div' }, { props: { class: 'actions' }, children: summary.buttons.map((entry, index) => h({ tag: 'button' }, { props: { type: 'button', class: buttonClass(entry, index), onClick: () => onAction(entry.action, view) }, children: [entry.label] })) }),
|
|
130
130
|
confirmingDisconnect ? disconnectConfirmation(view) : null,
|
|
131
131
|
view.connection.status === 'revocation-pending' ? accountAccessLink(view.accountAccessUrl) : null,
|
|
132
|
-
]);
|
|
132
|
+
] });
|
|
133
133
|
}
|
|
134
134
|
|
|
135
135
|
function productsCard(view) {
|
|
136
136
|
const rows = productRows({ products: view.products, connection: view.connection });
|
|
137
|
-
return h('section', { class: 'card', 'aria-labelledby': 'products-heading' }, [
|
|
138
|
-
h('div', { class: 'head' }, [
|
|
139
|
-
h('h2', { id: 'products-heading' }, ['Products']),
|
|
140
|
-
tip('About products', 'Turning a product on or off changes only what this site does; it never changes what Google granted.'),
|
|
141
|
-
]),
|
|
142
|
-
h('ul', { class: 'rows' }, rows.map((row) => h('li', { class: 'product' }, [
|
|
143
|
-
h('div', { class: 'product-name' }, [
|
|
144
|
-
h('span', { class: 'name-line' }, [h('strong', {}, [row.label]), tip(`About ${row.label}`, row.note)]),
|
|
145
|
-
h('span', { class: row.grant ? 'state warn' : 'state' }, [row.state]),
|
|
146
|
-
]),
|
|
147
|
-
row.grant ? h('button', { type: 'button', class: 'primary small', onClick: () => onAction('grant', view) }, ['Grant permission']) : null,
|
|
137
|
+
return h({ tag: 'section' }, { props: { class: 'card', 'aria-labelledby': 'products-heading' }, children: [
|
|
138
|
+
h({ tag: 'div' }, { props: { class: 'head' }, children: [
|
|
139
|
+
h({ tag: 'h2' }, { props: { id: 'products-heading' }, children: ['Products'] }),
|
|
140
|
+
tip({ label: 'About products', text: 'Turning a product on or off changes only what this site does; it never changes what Google granted.' }),
|
|
141
|
+
] }),
|
|
142
|
+
h({ tag: 'ul' }, { props: { class: 'rows' }, children: rows.map((row) => h({ tag: 'li' }, { props: { class: 'product' }, children: [
|
|
143
|
+
h({ tag: 'div' }, { props: { class: 'product-name' }, children: [
|
|
144
|
+
h({ tag: 'span' }, { props: { class: 'name-line' }, children: [h({ tag: 'strong' }, { props: {}, children: [row.label] }), tip({ label: `About ${row.label}`, text: row.note })] }),
|
|
145
|
+
h({ tag: 'span' }, { props: { class: row.grant ? 'state warn' : 'state' }, children: [row.state] }),
|
|
146
|
+
] }),
|
|
147
|
+
row.grant ? h({ tag: 'button' }, { props: { type: 'button', class: 'primary small', onClick: () => onAction('grant', view) }, children: ['Grant permission'] }) : null,
|
|
148
148
|
// A switch drawn from the toggle button: the visible track is decoration; its text is the action.
|
|
149
|
-
h('button', { type: 'button', class: 'switch', 'aria-pressed': String(row.enabled), onClick: () => run(async () => { notice = null; render(await call('set-product', { productId: row.id, enabled: !row.enabled })); }) }, [
|
|
150
|
-
h('span', { class: 'sr-only' }, [row.toggleLabel]),
|
|
151
|
-
]),
|
|
152
|
-
]))),
|
|
153
|
-
]);
|
|
149
|
+
h({ tag: 'button' }, { props: { type: 'button', class: 'switch', 'aria-pressed': String(row.enabled), onClick: () => run(async () => { notice = null; render(await call('set-product', { productId: row.id, enabled: !row.enabled })); }) }, children: [
|
|
150
|
+
h({ tag: 'span' }, { props: { class: 'sr-only' }, children: [row.toggleLabel] }),
|
|
151
|
+
] }),
|
|
152
|
+
] })) }),
|
|
153
|
+
] });
|
|
154
154
|
}
|
|
155
155
|
|
|
156
156
|
let lastView = null;
|
|
@@ -159,11 +159,11 @@ function render(view) {
|
|
|
159
159
|
lastView = view;
|
|
160
160
|
// A null view only comes from a failed first `status`, which always sets the notice first (and
|
|
161
161
|
// with no view there are no buttons, so no later action can render null again).
|
|
162
|
-
if (view === null) return show(app, noticeLine(notice));
|
|
163
|
-
return show(app,
|
|
164
|
-
notice ? noticeLine(notice) : null,
|
|
162
|
+
if (view === null) return show({ root: app }, { nodes: [noticeLine(notice)] });
|
|
163
|
+
return show({ root: app },
|
|
164
|
+
{ nodes: [notice ? noticeLine(notice) : null,
|
|
165
165
|
connectionCard(view),
|
|
166
|
-
productsCard(view));
|
|
166
|
+
productsCard(view)] });
|
|
167
167
|
}
|
|
168
168
|
|
|
169
169
|
/**
|
|
@@ -172,7 +172,7 @@ function render(view) {
|
|
|
172
172
|
* last line starts the real one.
|
|
173
173
|
* @param {{ window: Window, document: Document }} required
|
|
174
174
|
*/
|
|
175
|
-
export function initConnectionPanel(required) {
|
|
175
|
+
export function initConnectionPanel(required, _optional = {}) {
|
|
176
176
|
client = connectToHost({ window: required.window });
|
|
177
177
|
app = required.document.getElementById('app');
|
|
178
178
|
notice = null;
|
|
@@ -183,7 +183,7 @@ export function initConnectionPanel(required) {
|
|
|
183
183
|
|
|
184
184
|
/** The first `status`; a failure the host calls retryable offers "Try again" (another `status`). */
|
|
185
185
|
function load() {
|
|
186
|
-
return call('status').then(render, (error) => { notice = { text: failureText(error), retry: error?.retryable === true ? load : undefined }; render(null); });
|
|
186
|
+
return call('status').then(render, (error) => { notice = { text: failureText({ error }), retry: error?.retryable === true ? load : undefined }; render(null); });
|
|
187
187
|
}
|
|
188
188
|
|
|
189
189
|
initConnectionPanel({ window, document });
|