@yaks/platform 0.0.0-stage → 0.2.36
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/LICENSE +202 -0
- package/README.md +261 -2
- package/_client-blobs.js +7 -0
- package/_client-error.js +70 -0
- package/_client-modal.js +3 -0
- package/_client-replica.js +5 -0
- package/_client-review.js +1 -0
- package/_client-schema.js +1 -0
- package/_client-vault.js +31 -0
- package/_edit-query.js +1 -0
- package/_uploads.js +4 -0
- package/account-browser.js +67 -0
- package/account-browser.js.map +1 -0
- package/account-browser.ts +87 -0
- package/account-rows.js +130 -0
- package/account-rows.js.map +1 -0
- package/account-rows.ts +237 -0
- package/admin-visits-view.js +65 -0
- package/admin-visits-view.js.map +1 -0
- package/admin-visits-view.ts +120 -0
- package/admin-visits.js +143 -0
- package/admin-visits.js.map +1 -0
- package/admin-visits.ts +211 -0
- package/admit-graph.js +8 -0
- package/admit-graph.js.map +1 -0
- package/admit-graph.ts +10 -0
- package/agent-guide.js +368 -0
- package/agent-guide.js.map +1 -0
- package/agent-guide.ts +450 -0
- package/agents-browser.js +143 -0
- package/agents-browser.js.map +1 -0
- package/agents-browser.ts +141 -0
- package/agents-view.js +129 -0
- package/agents-view.js.map +1 -0
- package/agents-view.ts +236 -0
- package/agents.js +148 -0
- package/agents.js.map +1 -0
- package/agents.ts +150 -0
- package/app-actions.js +56 -0
- package/app-actions.js.map +1 -0
- package/app-actions.ts +61 -0
- package/app-authority.js +280 -0
- package/app-authority.js.map +1 -0
- package/app-authority.ts +356 -0
- package/app-canvas-browser.js +308 -0
- package/app-canvas-browser.js.map +1 -0
- package/app-canvas-browser.ts +377 -0
- package/app-canvas-view.js +244 -0
- package/app-canvas-view.js.map +1 -0
- package/app-canvas-view.ts +399 -0
- package/app-canvas.js +87 -0
- package/app-canvas.js.map +1 -0
- package/app-canvas.ts +170 -0
- package/app-client.js +521 -0
- package/app-client.js.map +1 -0
- package/app-client.ts +562 -0
- package/app-command.js +108 -0
- package/app-command.js.map +1 -0
- package/app-command.ts +155 -0
- package/app-commands.js +334 -0
- package/app-commands.js.map +1 -0
- package/app-commands.ts +379 -0
- package/app-decision.js +69 -0
- package/app-decision.js.map +1 -0
- package/app-decision.ts +61 -0
- package/app-effects.js +43 -0
- package/app-effects.js.map +1 -0
- package/app-effects.ts +53 -0
- package/app-file.js +252 -0
- package/app-file.js.map +1 -0
- package/app-file.ts +362 -0
- package/app-friends.js +60 -0
- package/app-friends.js.map +1 -0
- package/app-friends.ts +81 -0
- package/app-graph.js +9 -0
- package/app-graph.js.map +1 -0
- package/app-graph.ts +9 -0
- package/app-icon.js +59 -0
- package/app-icon.js.map +1 -0
- package/app-icon.ts +121 -0
- package/app-made.js +164 -0
- package/app-made.js.map +1 -0
- package/app-made.ts +306 -0
- package/app-outbound.js +72 -0
- package/app-outbound.js.map +1 -0
- package/app-outbound.ts +109 -0
- package/app-outbox.js +42 -0
- package/app-outbox.js.map +1 -0
- package/app-outbox.ts +46 -0
- package/app-patch.js +75 -0
- package/app-patch.js.map +1 -0
- package/app-patch.ts +106 -0
- package/app-read.js +101 -0
- package/app-read.js.map +1 -0
- package/app-read.ts +126 -0
- package/app-role-tools.js +232 -0
- package/app-role-tools.js.map +1 -0
- package/app-role-tools.ts +258 -0
- package/app-roles.js +91 -0
- package/app-roles.js.map +1 -0
- package/app-roles.ts +76 -0
- package/app-session-access.js +109 -0
- package/app-session-access.js.map +1 -0
- package/app-session-access.ts +145 -0
- package/app-starter.js +109 -0
- package/app-starter.js.map +1 -0
- package/app-starter.ts +123 -0
- package/app-storage.js +38 -0
- package/app-storage.js.map +1 -0
- package/app-storage.ts +54 -0
- package/app-style-guide.js +138 -0
- package/app-style-guide.js.map +1 -0
- package/app-style-guide.ts +195 -0
- package/app-subs.js +89 -0
- package/app-subs.js.map +1 -0
- package/app-subs.ts +110 -0
- package/app-tests.js +54 -0
- package/app-tests.js.map +1 -0
- package/app-tests.ts +56 -0
- package/app-tile.js +209 -0
- package/app-tile.js.map +1 -0
- package/app-tile.ts +227 -0
- package/app-transfer.js +188 -0
- package/app-transfer.js.map +1 -0
- package/app-transfer.ts +281 -0
- package/app-vocab.js +52 -0
- package/app-vocab.js.map +1 -0
- package/app-vocab.ts +43 -0
- package/app-words.js +55 -0
- package/app-words.js.map +1 -0
- package/app-words.ts +73 -0
- package/app-worker.js +28 -0
- package/app-worker.js.map +1 -0
- package/app-worker.ts +38 -0
- package/app-writes.js +132 -0
- package/app-writes.js.map +1 -0
- package/app-writes.ts +128 -0
- package/asset-bytes.js +57 -0
- package/asset-bytes.js.map +1 -0
- package/asset-bytes.ts +90 -0
- package/asset-response.js +28 -0
- package/asset-response.js.map +1 -0
- package/asset-response.ts +46 -0
- package/asset-url.js +556 -0
- package/asset-url.js.map +1 -0
- package/asset-url.ts +774 -0
- package/attribution-vocab.js +14 -0
- package/attribution-vocab.js.map +1 -0
- package/attribution-vocab.ts +11 -0
- package/authorship-graph.js +8 -0
- package/authorship-graph.js.map +1 -0
- package/authorship-graph.ts +10 -0
- package/badge.js +98 -0
- package/blob-images.js +206 -0
- package/blob-images.js.map +1 -0
- package/blob-images.ts +323 -0
- package/blob-posters.js +125 -0
- package/blob-posters.js.map +1 -0
- package/blob-posters.ts +207 -0
- package/blob-routes.js +14 -0
- package/blob-routes.js.map +1 -0
- package/blob-routes.ts +25 -0
- package/bots.js +77 -0
- package/bots.js.map +1 -0
- package/bots.ts +93 -0
- package/browser-mockup.js +81 -0
- package/browser-mockup.js.map +1 -0
- package/browser-mockup.ts +105 -0
- package/browser-record.js +55 -0
- package/browser-record.js.map +1 -0
- package/browser-record.ts +66 -0
- package/browser-scroll.js +90 -0
- package/browser-scroll.js.map +1 -0
- package/browser-scroll.ts +108 -0
- package/browser-stream.js +79 -0
- package/browser-stream.js.map +1 -0
- package/browser-stream.ts +84 -0
- package/browser-trace.js +252 -0
- package/browser-trace.js.map +1 -0
- package/browser-trace.ts +330 -0
- package/browser-viewer.js +236 -0
- package/browser-viewer.js.map +1 -0
- package/browser-viewer.ts +233 -0
- package/browser-visit.js +1522 -0
- package/browser-visit.js.map +1 -0
- package/browser-visit.ts +2179 -0
- package/browser-wire.js +242 -0
- package/browser-wire.js.map +1 -0
- package/browser-wire.ts +262 -0
- package/budget.js +17 -0
- package/budget.js.map +1 -0
- package/budget.ts +42 -0
- package/cli.js +52 -0
- package/cli.js.map +1 -0
- package/cli.ts +55 -0
- package/client-modules.js +24 -0
- package/client-modules.js.map +1 -0
- package/client-modules.ts +24 -0
- package/client-routes.js +83 -0
- package/client-routes.js.map +1 -0
- package/client-routes.ts +104 -0
- package/client-words.js +62 -0
- package/client-words.js.map +1 -0
- package/client-words.ts +77 -0
- package/client.js +709 -0
- package/comp.js +2 -0
- package/comp.js.map +1 -0
- package/comp.ts +15 -0
- package/config.js +497 -0
- package/config.js.map +1 -0
- package/config.ts +287 -0
- package/connect-parts.js +107 -0
- package/connect-parts.js.map +1 -0
- package/connect-parts.ts +165 -0
- package/connected-activity-browser.js +301 -0
- package/connected-activity-browser.js.map +1 -0
- package/connected-activity-browser.ts +341 -0
- package/connected-activity-view.js +55 -0
- package/connected-activity-view.js.map +1 -0
- package/connected-activity-view.ts +81 -0
- package/connected-activity-wire.js +165 -0
- package/connected-activity-wire.js.map +1 -0
- package/connected-activity-wire.ts +171 -0
- package/connected-activity.css +156 -0
- package/connected-activity.js +185 -0
- package/connected-activity.js.map +1 -0
- package/connected-activity.ts +278 -0
- package/connection-icon-browser.js +50 -0
- package/connection-icon-browser.js.map +1 -0
- package/connection-icon-browser.ts +52 -0
- package/connections-browser.js +393 -0
- package/connections-browser.js.map +1 -0
- package/connections-browser.ts +465 -0
- package/connections-page.js +178 -0
- package/connections-page.js.map +1 -0
- package/connections-page.ts +461 -0
- package/connections-view.js +1215 -0
- package/connections-view.js.map +1 -0
- package/connections-view.ts +2239 -0
- package/connector-upload.js +94 -0
- package/connector-upload.js.map +1 -0
- package/connector-upload.ts +146 -0
- package/consent.js +2 -0
- package/consent.js.map +1 -0
- package/consent.ts +3 -0
- package/cookie.js +53 -0
- package/cookie.js.map +1 -0
- package/cookie.ts +75 -0
- package/copy.js +104 -0
- package/corner.js +226 -0
- package/credential-draft-move.js +154 -0
- package/credential-draft-move.js.map +1 -0
- package/credential-draft-move.ts +197 -0
- package/credential-draft-place.js +2 -0
- package/credential-draft-place.js.map +1 -0
- package/credential-draft-place.ts +4 -0
- package/credential-drafts.js +66 -0
- package/credential-drafts.js.map +1 -0
- package/credential-drafts.ts +93 -0
- package/dashboard-browser.js +149 -0
- package/dashboard-browser.js.map +1 -0
- package/dashboard-browser.ts +184 -0
- package/dashboard-view.js +293 -0
- package/dashboard-view.js.map +1 -0
- package/dashboard-view.ts +423 -0
- package/dashboard.js +268 -0
- package/dashboard.js.map +1 -0
- package/dashboard.ts +436 -0
- package/deno.json +1 -0
- package/describe-graph.js +8 -0
- package/describe-graph.js.map +1 -0
- package/describe-graph.ts +7 -0
- package/directory-derived.js +142 -0
- package/directory-derived.js.map +1 -0
- package/directory-derived.ts +198 -0
- package/directory-index-move.js +77 -0
- package/directory-index-move.js.map +1 -0
- package/directory-index-move.ts +59 -0
- package/directory-index.js +382 -0
- package/directory-index.js.map +1 -0
- package/directory-index.ts +550 -0
- package/directory-pages.js +41 -0
- package/directory-pages.js.map +1 -0
- package/directory-pages.ts +71 -0
- package/directory-route.js +129 -0
- package/directory-route.js.map +1 -0
- package/directory-route.ts +189 -0
- package/directory-vocab.js +58 -0
- package/directory-vocab.js.map +1 -0
- package/directory-vocab.ts +46 -0
- package/document-graph.js +86 -0
- package/document-graph.js.map +1 -0
- package/document-graph.ts +93 -0
- package/document-ocr.js +146 -0
- package/document-ocr.js.map +1 -0
- package/document-ocr.ts +204 -0
- package/documents.js +50 -0
- package/documents.js.map +1 -0
- package/documents.ts +64 -0
- package/domain-pages.js +221 -0
- package/domain-pages.js.map +1 -0
- package/domain-pages.ts +586 -0
- package/domain-settings.js +88 -0
- package/domain-settings.js.map +1 -0
- package/domain-settings.ts +132 -0
- package/domain-transfer.js +138 -0
- package/domain-transfer.js.map +1 -0
- package/domain-transfer.ts +190 -0
- package/donation-loans.js +176 -0
- package/donation-loans.js.map +1 -0
- package/donation-loans.ts +271 -0
- package/draft-choice.js +136 -0
- package/draft-choice.js.map +1 -0
- package/draft-choice.ts +310 -0
- package/drawing.js +27 -0
- package/drawing.js.map +1 -0
- package/drawing.ts +40 -0
- package/early-report.js +18 -0
- package/early-report.js.map +1 -0
- package/early-report.ts +31 -0
- package/edit-client-path.js +2 -0
- package/edit-client-path.js.map +1 -0
- package/edit-client-path.ts +1 -0
- package/edit-mode.js +920 -0
- package/edit-mode.js.map +1 -0
- package/edit-mode.ts +1003 -0
- package/edit-sync.js +61 -0
- package/edit-sync.js.map +1 -0
- package/edit-sync.ts +83 -0
- package/edit.js +265 -0
- package/embed-graph.js +11 -0
- package/embed-graph.js.map +1 -0
- package/embed-graph.ts +8 -0
- package/embedded-payment.js +211 -0
- package/embedded-payment.js.map +1 -0
- package/embedded-payment.ts +290 -0
- package/entry-actions-browser.js +43 -0
- package/entry-actions-browser.js.map +1 -0
- package/entry-actions-browser.ts +64 -0
- package/entry-actions.js +56 -0
- package/entry-actions.js.map +1 -0
- package/entry-actions.ts +59 -0
- package/escape.js +14 -0
- package/escape.js.map +1 -0
- package/escape.ts +24 -0
- package/face-input.js +6 -0
- package/face-input.js.map +1 -0
- package/face-input.ts +14 -0
- package/facebook.js +370 -0
- package/facebook.js.map +1 -0
- package/facebook.ts +474 -0
- package/facets.js +142 -0
- package/facets.js.map +1 -0
- package/facets.ts +89 -0
- package/fee.js +45 -0
- package/fee.js.map +1 -0
- package/fee.ts +51 -0
- package/fence.js +164 -0
- package/fence.js.map +1 -0
- package/fence.ts +223 -0
- package/file-metadata.js +135 -0
- package/file-metadata.js.map +1 -0
- package/file-metadata.ts +177 -0
- package/file-operation.js +51 -0
- package/file-operation.js.map +1 -0
- package/file-operation.ts +32 -0
- package/file-redirects.js +72 -0
- package/file-redirects.js.map +1 -0
- package/file-redirects.ts +74 -0
- package/file-root.js +8 -0
- package/file-root.js.map +1 -0
- package/file-root.ts +24 -0
- package/files-routes.js +203 -0
- package/files-routes.js.map +1 -0
- package/files-routes.ts +282 -0
- package/files.js +369 -0
- package/files.js.map +1 -0
- package/files.ts +522 -0
- package/fingerprint.js +217 -0
- package/fingerprint.js.map +1 -0
- package/fingerprint.ts +314 -0
- package/firsts.js +335 -0
- package/firsts.js.map +1 -0
- package/firsts.ts +368 -0
- package/friends-at.js +78 -0
- package/friends-at.js.map +1 -0
- package/friends-at.ts +115 -0
- package/friends-browser.js +66 -0
- package/friends-browser.js.map +1 -0
- package/friends-browser.ts +77 -0
- package/friends-dock-browser.js +375 -0
- package/friends-dock-browser.js.map +1 -0
- package/friends-dock-browser.ts +408 -0
- package/friends-dock-view.js +363 -0
- package/friends-dock-view.js.map +1 -0
- package/friends-dock-view.ts +592 -0
- package/friends-view.js +33 -0
- package/friends-view.js.map +1 -0
- package/friends-view.ts +69 -0
- package/friends.js +153 -0
- package/friends.js.map +1 -0
- package/friends.ts +200 -0
- package/fundraising-orders.js +197 -0
- package/fundraising-orders.js.map +1 -0
- package/fundraising-orders.ts +283 -0
- package/fundraising.js +165 -0
- package/fundraising.js.map +1 -0
- package/fundraising.ts +215 -0
- package/funnel.js +141 -0
- package/funnel.js.map +1 -0
- package/funnel.ts +284 -0
- package/gift-savings.js +19 -0
- package/gift-savings.js.map +1 -0
- package/gift-savings.ts +29 -0
- package/git-history.js +331 -0
- package/git-history.js.map +1 -0
- package/git-history.ts +481 -0
- package/giving-browser.js +35 -0
- package/giving-browser.js.map +1 -0
- package/giving-browser.ts +40 -0
- package/giving-pages.js +284 -0
- package/giving-pages.js.map +1 -0
- package/giving-pages.ts +418 -0
- package/giving-view.js +244 -0
- package/giving-view.js.map +1 -0
- package/giving-view.ts +509 -0
- package/giving.js +198 -0
- package/giving.js.map +1 -0
- package/giving.ts +280 -0
- package/gmail-mailbox.js +52 -0
- package/gmail-mailbox.js.map +1 -0
- package/gmail-mailbox.ts +74 -0
- package/graves.js +136 -0
- package/graves.js.map +1 -0
- package/graves.ts +180 -0
- package/hashed.js +499 -0
- package/hashed.js.map +1 -0
- package/hashed.ts +676 -0
- package/home/assets.js +15 -0
- package/home/assets.js.map +1 -0
- package/home/assets.ts +16 -0
- package/home/brands/stripe.svg +12 -0
- package/home/brands/zoom.svg +34 -0
- package/home/demos.js +413 -0
- package/home/demos.js.map +1 -0
- package/home/demos.ts +431 -0
- package/home/games.js +112 -0
- package/home/games.js.map +1 -0
- package/home/games.ts +137 -0
- package/home/icons.js +41 -0
- package/home/icons.js.map +1 -0
- package/home/icons.ts +42 -0
- package/home/mascot/calculating.webp +0 -0
- package/home/mascot/flag.webp +0 -0
- package/home/mascot/letter.webp +0 -0
- package/home/mascot/plane.webp +0 -0
- package/home/mascot/plug.webp +0 -0
- package/home/mascot/thinking.webp +0 -0
- package/home/mascot/typing.webp +0 -0
- package/home/mascot/wave.webp +0 -0
- package/home/mod.tsx +517 -0
- package/home/parts.js +149 -0
- package/home/parts.js.map +1 -0
- package/home/parts.ts +45 -0
- package/home/phone.tsx +152 -0
- package/home/scenes.tsx +212 -0
- package/home/sky.js +930 -0
- package/home/sky.tsx +479 -0
- package/home/story.js +392 -0
- package/home/style.css +1304 -0
- package/home/words.js +2 -0
- package/home/words.js.map +1 -0
- package/home/words.ts +8 -0
- package/home/yak.js +146 -0
- package/home/yak_test.tsx +111 -0
- package/home-router.js +30 -0
- package/home-router.js.map +1 -0
- package/home-router.ts +41 -0
- package/host.js +58 -0
- package/host.js.map +1 -0
- package/host.ts +97 -0
- package/hosted-page.js +126 -0
- package/hosted-page.js.map +1 -0
- package/hosted-page.ts +295 -0
- package/install-browser.js +89 -0
- package/install-browser.js.map +1 -0
- package/install-browser.ts +99 -0
- package/install-icons.js +271 -0
- package/install-icons.js.map +1 -0
- package/install-icons.ts +366 -0
- package/installs.js +197 -0
- package/installs.js.map +1 -0
- package/installs.ts +270 -0
- package/instrument.js +50 -0
- package/instrument.js.map +1 -0
- package/instrument.ts +55 -0
- package/integration-icons.js +138 -0
- package/integration-icons.js.map +1 -0
- package/integration-icons.ts +198 -0
- package/interaction-browser.js +95 -0
- package/interaction-browser.js.map +1 -0
- package/interaction-browser.ts +107 -0
- package/interaction-report.js +399 -0
- package/interaction-report.js.map +1 -0
- package/interaction-report.ts +450 -0
- package/interaction.js +273 -0
- package/interaction.js.map +1 -0
- package/interaction.ts +290 -0
- package/invite-browser.js +98 -0
- package/invite-browser.js.map +1 -0
- package/invite-browser.ts +123 -0
- package/invite-view.js +100 -0
- package/invite-view.js.map +1 -0
- package/invite-view.ts +137 -0
- package/kept.js +520 -0
- package/kept.js.map +1 -0
- package/kept.ts +821 -0
- package/kills-graph.js +18 -0
- package/kills-graph.js.map +1 -0
- package/kills-graph.ts +16 -0
- package/ladder.js +418 -0
- package/ladder.js.map +1 -0
- package/ladder.ts +510 -0
- package/lenses-graph.js +24 -0
- package/lenses-graph.js.map +1 -0
- package/lenses-graph.ts +27 -0
- package/lenses.js +197 -0
- package/lenses.js.map +1 -0
- package/lenses.ts +204 -0
- package/lent.js +32 -0
- package/lent.js.map +1 -0
- package/lent.ts +95 -0
- package/letters.js +134 -0
- package/letters.js.map +1 -0
- package/letters.ts +251 -0
- package/lexicon-graph.js +11 -0
- package/lexicon-graph.js.map +1 -0
- package/lexicon-graph.ts +7 -0
- package/link-preview.js +111 -0
- package/link-preview.js.map +1 -0
- package/link-preview.ts +136 -0
- package/listing.js +262 -0
- package/listing.js.map +1 -0
- package/listing.ts +330 -0
- package/local-time.js +32 -0
- package/local-time.js.map +1 -0
- package/local-time.ts +41 -0
- package/located.js +380 -0
- package/located.js.map +1 -0
- package/located.ts +471 -0
- package/log-graph.js +7 -0
- package/log-graph.js.map +1 -0
- package/log-graph.ts +9 -0
- package/lower-graph.js +7 -0
- package/lower-graph.js.map +1 -0
- package/lower-graph.ts +9 -0
- package/mail-request.js +32 -0
- package/mail-request.js.map +1 -0
- package/mail-request.ts +29 -0
- package/mail-senders.js +40 -0
- package/mail-senders.js.map +1 -0
- package/mail-senders.ts +47 -0
- package/managed-browser-pilot.js +151 -0
- package/managed-browser-pilot.js.map +1 -0
- package/managed-browser-pilot.ts +230 -0
- package/managed-browser-sites.js +43 -0
- package/managed-browser-sites.js.map +1 -0
- package/managed-browser-sites.ts +41 -0
- package/managed-browser-wire.js +142 -0
- package/managed-browser-wire.js.map +1 -0
- package/managed-browser-wire.ts +140 -0
- package/managed-browser.js +529 -0
- package/managed-browser.js.map +1 -0
- package/managed-browser.ts +740 -0
- package/manifest.js +425 -0
- package/manifest.js.map +1 -0
- package/manifest.ts +468 -0
- package/metadata-effect.js +61 -0
- package/metadata-effect.js.map +1 -0
- package/metadata-effect.ts +59 -0
- package/meter-graph.js +205 -0
- package/meter-graph.js.map +1 -0
- package/meter-graph.ts +238 -0
- package/meter-vocab.js +8 -0
- package/meter-vocab.js.map +1 -0
- package/meter-vocab.ts +4 -0
- package/meter.js +402 -0
- package/meter.js.map +1 -0
- package/meter.ts +697 -0
- package/mod.js +14 -0
- package/mod.js.map +1 -0
- package/mod.ts +16 -0
- package/models-vocab.js +25 -0
- package/models-vocab.js.map +1 -0
- package/models-vocab.ts +15 -0
- package/monogram.js +32 -0
- package/monogram.js.map +1 -0
- package/monogram.ts +46 -0
- package/mover.js +6 -0
- package/mover.js.map +1 -0
- package/mover.ts +45 -0
- package/named.js +136 -0
- package/named.js.map +1 -0
- package/named.ts +169 -0
- package/names.js +196 -0
- package/names.js.map +1 -0
- package/names.ts +252 -0
- package/notices-vocab.js +20 -0
- package/notices-vocab.js.map +1 -0
- package/notices-vocab.ts +28 -0
- package/numbers.js +85 -0
- package/numbers.js.map +1 -0
- package/numbers.ts +97 -0
- package/object-hosts.js +137 -0
- package/object-hosts.js.map +1 -0
- package/object-hosts.ts +153 -0
- package/open-script.js +235 -0
- package/open-script.js.map +1 -0
- package/open-script.ts +253 -0
- package/opening.js +31 -0
- package/opening.js.map +1 -0
- package/opening.ts +28 -0
- package/operator-activity-view.js +82 -0
- package/operator-activity-view.js.map +1 -0
- package/operator-activity-view.ts +85 -0
- package/operator-activity.js +220 -0
- package/operator-activity.js.map +1 -0
- package/operator-activity.ts +293 -0
- package/operator-brief.js +36 -0
- package/operator-brief.js.map +1 -0
- package/operator-brief.ts +76 -0
- package/operator-copy-browser.js +67 -0
- package/operator-copy-browser.js.map +1 -0
- package/operator-copy-browser.ts +71 -0
- package/operator-corner.js +266 -0
- package/operator-corner.js.map +1 -0
- package/operator-corner.ts +300 -0
- package/operator-decisions.js +19 -0
- package/operator-decisions.js.map +1 -0
- package/operator-decisions.ts +18 -0
- package/operator-docs.js +152 -0
- package/operator-docs.js.map +1 -0
- package/operator-docs.ts +196 -0
- package/operator-door.js +10 -0
- package/operator-door.js.map +1 -0
- package/operator-door.ts +14 -0
- package/operator-drafts-browser.js +28 -0
- package/operator-drafts-browser.js.map +1 -0
- package/operator-drafts-browser.ts +32 -0
- package/operator-drafts.js +60 -0
- package/operator-drafts.js.map +1 -0
- package/operator-drafts.ts +80 -0
- package/operator-early-draft.js +110 -0
- package/operator-early-draft.js.map +1 -0
- package/operator-early-draft.ts +125 -0
- package/operator-go-browser.js +130 -0
- package/operator-go-browser.js.map +1 -0
- package/operator-go-browser.ts +182 -0
- package/operator-go-step.js +86 -0
- package/operator-go-step.js.map +1 -0
- package/operator-go-step.ts +92 -0
- package/operator-go-tool.js +49 -0
- package/operator-go-tool.js.map +1 -0
- package/operator-go-tool.ts +31 -0
- package/operator-go.js +68 -0
- package/operator-go.js.map +1 -0
- package/operator-go.ts +100 -0
- package/operator-graph.js +46 -0
- package/operator-graph.js.map +1 -0
- package/operator-graph.ts +60 -0
- package/operator-handoff.js +91 -0
- package/operator-handoff.js.map +1 -0
- package/operator-handoff.ts +104 -0
- package/operator-machine.js +136 -0
- package/operator-machine.js.map +1 -0
- package/operator-machine.ts +168 -0
- package/operator-matches-browser.js +155 -0
- package/operator-matches-browser.js.map +1 -0
- package/operator-matches-browser.ts +178 -0
- package/operator-matches-view.js +147 -0
- package/operator-matches-view.js.map +1 -0
- package/operator-matches-view.ts +224 -0
- package/operator-matches.js +65 -0
- package/operator-matches.js.map +1 -0
- package/operator-matches.ts +120 -0
- package/operator-memory.js +119 -0
- package/operator-memory.js.map +1 -0
- package/operator-memory.ts +122 -0
- package/operator-mic.ts +40 -0
- package/operator-model.js +144 -0
- package/operator-model.js.map +1 -0
- package/operator-model.ts +154 -0
- package/operator-notes.js +32 -0
- package/operator-notes.js.map +1 -0
- package/operator-notes.ts +40 -0
- package/operator-opening-browser.js +184 -0
- package/operator-opening-browser.js.map +1 -0
- package/operator-opening-browser.ts +195 -0
- package/operator-owner.js +391 -0
- package/operator-owner.js.map +1 -0
- package/operator-owner.ts +392 -0
- package/operator-page-context.js +121 -0
- package/operator-page-context.js.map +1 -0
- package/operator-page-context.ts +143 -0
- package/operator-page-image.js +38 -0
- package/operator-page-image.js.map +1 -0
- package/operator-page-image.ts +42 -0
- package/operator-panel-browser.js +601 -0
- package/operator-panel-browser.js.map +1 -0
- package/operator-panel-browser.ts +669 -0
- package/operator-panel-view.js +69 -0
- package/operator-panel-view.js.map +1 -0
- package/operator-panel-view.ts +100 -0
- package/operator-panel.js +131 -0
- package/operator-panel.js.map +1 -0
- package/operator-panel.ts +155 -0
- package/operator-push.tsx +112 -0
- package/operator-record.js +55 -0
- package/operator-record.js.map +1 -0
- package/operator-record.ts +92 -0
- package/operator-replies.js +240 -0
- package/operator-replies.js.map +1 -0
- package/operator-replies.ts +281 -0
- package/operator-reply-view.js +117 -0
- package/operator-reply-view.js.map +1 -0
- package/operator-reply-view.ts +185 -0
- package/operator-safety.js +30 -0
- package/operator-safety.js.map +1 -0
- package/operator-safety.ts +53 -0
- package/operator-settings-browser.js +257 -0
- package/operator-settings-browser.js.map +1 -0
- package/operator-settings-browser.ts +290 -0
- package/operator-settings-view.js +291 -0
- package/operator-settings-view.js.map +1 -0
- package/operator-settings-view.ts +588 -0
- package/operator-settings.js +79 -0
- package/operator-settings.js.map +1 -0
- package/operator-settings.ts +137 -0
- package/operator-source.js +43 -0
- package/operator-source.js.map +1 -0
- package/operator-source.ts +69 -0
- package/operator-talk-browser.js +94 -0
- package/operator-talk-browser.js.map +1 -0
- package/operator-talk-browser.ts +120 -0
- package/operator-talk.js +83 -0
- package/operator-talk.js.map +1 -0
- package/operator-talk.ts +127 -0
- package/operator-task-text.js +45 -0
- package/operator-task-text.js.map +1 -0
- package/operator-task-text.ts +49 -0
- package/operator-timing-browser.js +51 -0
- package/operator-timing-browser.js.map +1 -0
- package/operator-timing-browser.ts +68 -0
- package/operator-timing-view.js +48 -0
- package/operator-timing-view.js.map +1 -0
- package/operator-timing-view.ts +90 -0
- package/operator-timing.js +132 -0
- package/operator-timing.js.map +1 -0
- package/operator-timing.ts +170 -0
- package/operator-vocab.js +8 -0
- package/operator-vocab.js.map +1 -0
- package/operator-vocab.ts +7 -0
- package/operator-voice-audio.ts +84 -0
- package/operator-voice-browser.ts +237 -0
- package/operator-voice-feedback.js +108 -0
- package/operator-voice-feedback.js.map +1 -0
- package/operator-voice-feedback.ts +133 -0
- package/operator-voice-view.js +33 -0
- package/operator-voice-view.js.map +1 -0
- package/operator-voice-view.ts +43 -0
- package/operator-voice.css +38 -0
- package/operator-voice.js +35 -0
- package/operator-voice.js.map +1 -0
- package/operator-voice.ts +33 -0
- package/operator-wait.js +70 -0
- package/operator-wait.js.map +1 -0
- package/operator-wait.ts +79 -0
- package/operator-watches.js +126 -0
- package/operator-watches.js.map +1 -0
- package/operator-watches.ts +141 -0
- package/operator-words.js +94 -0
- package/operator-words.js.map +1 -0
- package/operator-words.ts +114 -0
- package/outreach-trial.js +103 -0
- package/outreach-trial.js.map +1 -0
- package/outreach-trial.ts +122 -0
- package/outreach-vocab.js +10 -0
- package/outreach-vocab.js.map +1 -0
- package/outreach-vocab.ts +7 -0
- package/outreach.js +162 -0
- package/outreach.js.map +1 -0
- package/outreach.ts +239 -0
- package/package.json +1131 -4
- package/packs.js +103 -0
- package/packs.js.map +1 -0
- package/packs.ts +119 -0
- package/page-copy.js +267 -0
- package/page-copy.js.map +1 -0
- package/page-copy.ts +362 -0
- package/page-graph.js +114 -0
- package/page-graph.js.map +1 -0
- package/page-graph.ts +151 -0
- package/page-links.js +78 -0
- package/page-links.js.map +1 -0
- package/page-links.ts +124 -0
- package/page-parts.js +236 -0
- package/page-parts.js.map +1 -0
- package/page-parts.ts +388 -0
- package/page-query.js +95 -0
- package/page-query.js.map +1 -0
- package/page-query.ts +120 -0
- package/page-script.js +183 -0
- package/page-script.js.map +1 -0
- package/page-script.ts +192 -0
- package/page-wire.js +93 -0
- package/page-wire.js.map +1 -0
- package/page-wire.ts +100 -0
- package/pages-vocab.js +9 -0
- package/pages-vocab.js.map +1 -0
- package/pages-vocab.ts +5 -0
- package/partials.js +21 -0
- package/partials.js.map +1 -0
- package/partials.ts +37 -0
- package/payment-browser.js +250 -0
- package/payment-browser.js.map +1 -0
- package/payment-browser.ts +298 -0
- package/payment-rows.js +117 -0
- package/payment-rows.js.map +1 -0
- package/payment-rows.ts +219 -0
- package/payment-view.js +397 -0
- package/payment-view.js.map +1 -0
- package/payment-view.ts +852 -0
- package/people-browser.js +186 -0
- package/people-browser.js.map +1 -0
- package/people-browser.ts +210 -0
- package/people-rows.js +192 -0
- package/people-rows.js.map +1 -0
- package/people-rows.ts +289 -0
- package/people-view.js +463 -0
- package/people-view.js.map +1 -0
- package/people-view.ts +804 -0
- package/person-lines.js +196 -0
- package/person-lines.js.map +1 -0
- package/person-lines.ts +256 -0
- package/place.js +30 -0
- package/place.js.map +1 -0
- package/place.ts +31 -0
- package/plan-details.js +39 -0
- package/plan-details.js.map +1 -0
- package/plan-details.ts +57 -0
- package/plan-trial-graph.js +63 -0
- package/plan-trial-graph.js.map +1 -0
- package/plan-trial-graph.ts +57 -0
- package/plans.js +223 -0
- package/plans.js.map +1 -0
- package/plans.ts +313 -0
- package/platform-credentials.js +136 -0
- package/platform-credentials.js.map +1 -0
- package/platform-credentials.ts +189 -0
- package/poster-backfill.js +72 -0
- package/poster-backfill.js.map +1 -0
- package/poster-backfill.ts +96 -0
- package/presence.js +57 -0
- package/presence.js.map +1 -0
- package/presence.ts +77 -0
- package/preview-audit.js +65 -0
- package/preview-audit.js.map +1 -0
- package/preview-audit.ts +126 -0
- package/preview-fit.js +62 -0
- package/preview-fit.js.map +1 -0
- package/preview-fit.ts +72 -0
- package/preview-html.js +96 -0
- package/preview-html.js.map +1 -0
- package/preview-html.ts +139 -0
- package/preview.js +317 -0
- package/preview.js.map +1 -0
- package/preview.ts +498 -0
- package/price.js +53 -0
- package/price.js.map +1 -0
- package/price.ts +85 -0
- package/profile-browser.js +117 -0
- package/profile-browser.js.map +1 -0
- package/profile-browser.ts +141 -0
- package/profile-view.js +96 -0
- package/profile-view.js.map +1 -0
- package/profile-view.ts +197 -0
- package/provider-credits.js +159 -0
- package/provider-credits.js.map +1 -0
- package/provider-credits.ts +174 -0
- package/public-site-choice.js +18 -0
- package/public-site-choice.js.map +1 -0
- package/public-site-choice.ts +21 -0
- package/public-site.js +151 -0
- package/public-site.js.map +1 -0
- package/public-site.ts +268 -0
- package/publishing-graph.js +136 -0
- package/publishing-graph.js.map +1 -0
- package/publishing-graph.ts +122 -0
- package/qr.js +32 -0
- package/qr.js.map +1 -0
- package/qr.ts +32 -0
- package/query-page.js +159 -0
- package/query-page.js.map +1 -0
- package/query-page.ts +249 -0
- package/query-refusal.js +174 -0
- package/query-refusal.js.map +1 -0
- package/query-refusal.ts +319 -0
- package/refusal-loop.js +71 -0
- package/refusal-loop.js.map +1 -0
- package/refusal-loop.ts +98 -0
- package/refusals-vocab.js +9 -0
- package/refusals-vocab.js.map +1 -0
- package/refusals-vocab.ts +5 -0
- package/refused-writes.js +119 -0
- package/refused-writes.js.map +1 -0
- package/refused-writes.ts +152 -0
- package/refused.js +67 -0
- package/refused.js.map +1 -0
- package/refused.ts +76 -0
- package/regional-route-storage.js +127 -0
- package/regional-route-storage.js.map +1 -0
- package/regional-route-storage.ts +94 -0
- package/regional-route.js +105 -0
- package/regional-route.js.map +1 -0
- package/regional-route.ts +158 -0
- package/regional-serving-copy.js +153 -0
- package/regional-serving-copy.js.map +1 -0
- package/regional-serving-copy.ts +200 -0
- package/release-asset.js +71 -0
- package/release-asset.js.map +1 -0
- package/release-asset.ts +121 -0
- package/release-browser.js +383 -0
- package/release-code.js +5 -0
- package/release-entry.js +3 -0
- package/release-file.js +169 -0
- package/release-file.js.map +1 -0
- package/release-file.ts +241 -0
- package/release-index.js +140 -0
- package/release-index.js.map +1 -0
- package/release-index.ts +161 -0
- package/release-page.js +227 -0
- package/release-reads.js +27 -0
- package/release-reads.js.map +1 -0
- package/release-reads.ts +56 -0
- package/release-sheets.js +76 -0
- package/release-state.js +181 -0
- package/release-update.js +22 -0
- package/release-update.js.map +1 -0
- package/release-update.ts +29 -0
- package/release.js +50 -0
- package/release.js.map +1 -0
- package/release.ts +72 -0
- package/released.js +263 -0
- package/released.js.map +1 -0
- package/released.ts +310 -0
- package/remake-graph.js +17 -0
- package/remake-graph.js.map +1 -0
- package/remake-graph.ts +15 -0
- package/rouse-graph.js +11 -0
- package/rouse-graph.js.map +1 -0
- package/rouse-graph.ts +8 -0
- package/route-memory.js +101 -0
- package/route-memory.js.map +1 -0
- package/route-memory.ts +132 -0
- package/routes.js +1143 -0
- package/routes.js.map +1 -0
- package/routes.ts +1502 -0
- package/sale-recovery.js +175 -0
- package/sale-recovery.js.map +1 -0
- package/sale-recovery.ts +156 -0
- package/sales.js +113 -0
- package/sales.js.map +1 -0
- package/sales.ts +150 -0
- package/schema.js +28 -0
- package/schema.js.map +1 -0
- package/schema.ts +13 -0
- package/serving-copy.js +161 -0
- package/serving-copy.js.map +1 -0
- package/serving-copy.ts +201 -0
- package/settings-drafts-browser.js +81 -0
- package/settings-drafts-browser.js.map +1 -0
- package/settings-drafts-browser.ts +95 -0
- package/settings-drafts.js +119 -0
- package/settings-drafts.js.map +1 -0
- package/settings-drafts.ts +136 -0
- package/shared-browser.js +61 -0
- package/shared-browser.js.map +1 -0
- package/shared-browser.ts +77 -0
- package/shared-view.js +29 -0
- package/shared-view.js.map +1 -0
- package/shared-view.ts +47 -0
- package/side-browser.js +164 -0
- package/side-browser.js.map +1 -0
- package/side-browser.ts +201 -0
- package/side-parts.js +258 -0
- package/side-parts.js.map +1 -0
- package/side-parts.ts +447 -0
- package/side-rows.js +64 -0
- package/side-rows.js.map +1 -0
- package/side-rows.ts +104 -0
- package/signed-in.js +37 -0
- package/signed-in.js.map +1 -0
- package/signed-in.ts +45 -0
- package/site-assets.js +8 -0
- package/site-assets.js.map +1 -0
- package/site-assets.ts +25 -0
- package/site-header.js +65 -0
- package/site-header.js.map +1 -0
- package/site-header.ts +71 -0
- package/site-nav.js +75 -0
- package/site-nav.js.map +1 -0
- package/site-nav.ts +82 -0
- package/site-validation.js +37 -0
- package/site-validation.js.map +1 -0
- package/site-validation.ts +47 -0
- package/space-apps-browser.js +107 -0
- package/space-apps-browser.js.map +1 -0
- package/space-apps-browser.ts +128 -0
- package/space-apps-view.js +222 -0
- package/space-apps-view.js.map +1 -0
- package/space-apps-view.ts +396 -0
- package/space-apps.js +88 -0
- package/space-apps.js.map +1 -0
- package/space-apps.ts +143 -0
- package/space-logo.js +82 -0
- package/space-logo.js.map +1 -0
- package/space-logo.ts +112 -0
- package/space-pages-browser.js +474 -0
- package/space-pages-browser.js.map +1 -0
- package/space-pages-browser.ts +463 -0
- package/space-pages-view.js +212 -0
- package/space-pages-view.js.map +1 -0
- package/space-pages-view.ts +460 -0
- package/space-pages.js +193 -0
- package/space-pages.js.map +1 -0
- package/space-pages.ts +282 -0
- package/space-switch.js +36 -0
- package/space-switch.js.map +1 -0
- package/space-switch.ts +64 -0
- package/splash.js +510 -0
- package/splash.js.map +1 -0
- package/splash.ts +525 -0
- package/standing.js +409 -0
- package/standing.js.map +1 -0
- package/standing.ts +746 -0
- package/still.js +63 -0
- package/still.js.map +1 -0
- package/still.ts +95 -0
- package/store-listing.js +107 -0
- package/store-listing.js.map +1 -0
- package/store-listing.ts +133 -0
- package/store-wake.js +65 -0
- package/store-wake.js.map +1 -0
- package/store-wake.ts +101 -0
- package/stream-posters.js +177 -0
- package/stream-posters.js.map +1 -0
- package/stream-posters.ts +297 -0
- package/support-contract-service.js +219 -0
- package/support-contract-service.js.map +1 -0
- package/support-contract-service.ts +307 -0
- package/support-contract-view.js +155 -0
- package/support-contract-view.js.map +1 -0
- package/support-contract-view.ts +265 -0
- package/support-contract.js +114 -0
- package/support-contract.js.map +1 -0
- package/support-contract.ts +157 -0
- package/sweep-vocab.js +10 -0
- package/sweep-vocab.js.map +1 -0
- package/sweep-vocab.ts +9 -0
- package/talk-views-browser.js +208 -0
- package/talk-views-browser.js.map +1 -0
- package/talk-views-browser.ts +232 -0
- package/talk-views.js +36 -0
- package/talk-views.js.map +1 -0
- package/talk-views.ts +64 -0
- package/task-rows.js +86 -0
- package/task-rows.js.map +1 -0
- package/task-rows.ts +96 -0
- package/tasks-view.js +111 -0
- package/tasks-view.js.map +1 -0
- package/tasks-view.ts +176 -0
- package/toast.ts +17 -0
- package/trash-graph.js +41 -0
- package/trash-graph.js.map +1 -0
- package/trash-graph.ts +27 -0
- package/trash-vocab.js +8 -0
- package/trash-vocab.js.map +1 -0
- package/trash-vocab.ts +4 -0
- package/trial.js +325 -0
- package/trial.js.map +1 -0
- package/trial.ts +451 -0
- package/update-rows.js +77 -0
- package/update-rows.js.map +1 -0
- package/update-rows.ts +171 -0
- package/update-waiting.js +131 -0
- package/update-waiting.js.map +1 -0
- package/update-waiting.ts +133 -0
- package/updates-browser.js +28 -0
- package/updates-browser.js.map +1 -0
- package/updates-browser.ts +33 -0
- package/updates-day-browser.js +77 -0
- package/updates-day-browser.js.map +1 -0
- package/updates-day-browser.ts +84 -0
- package/updates-day.js +60 -0
- package/updates-day.js.map +1 -0
- package/updates-day.ts +94 -0
- package/updates-list-browser.js +175 -0
- package/updates-list-browser.js.map +1 -0
- package/updates-list-browser.ts +198 -0
- package/updates-view.js +546 -0
- package/updates-view.js.map +1 -0
- package/updates-view.ts +814 -0
- package/upload-client-path.js +5 -0
- package/upload-client-path.js.map +1 -0
- package/upload-client-path.ts +4 -0
- package/uploads.js +290 -0
- package/uploads.js.map +1 -0
- package/uploads.ts +334 -0
- package/upstream.js +40 -0
- package/upstream.js.map +1 -0
- package/upstream.ts +57 -0
- package/version-view.js +57 -0
- package/version-view.js.map +1 -0
- package/version-view.ts +99 -0
- package/versions.js +231 -0
- package/versions.js.map +1 -0
- package/versions.ts +367 -0
- package/visit-counts.js +123 -0
- package/visit-counts.js.map +1 -0
- package/visit-counts.ts +162 -0
- package/visitor-location.js +33 -0
- package/visitor-location.js.map +1 -0
- package/visitor-location.ts +38 -0
- package/visitor.js +152 -0
- package/visitor.js.map +1 -0
- package/visitor.ts +228 -0
- package/visits-browser.js +71 -0
- package/visits-browser.js.map +1 -0
- package/visits-browser.ts +87 -0
- package/visits-view.js +88 -0
- package/visits-view.js.map +1 -0
- package/visits-view.ts +184 -0
- package/visits.js +428 -0
- package/visits.js.map +1 -0
- package/visits.ts +561 -0
- package/vocab/account.vocab.json +349 -0
- package/vocab/agents.vocab.json +64 -0
- package/vocab/app-canvas.vocab.json +137 -0
- package/vocab/app-friends.vocab.json +71 -0
- package/vocab/app-permissions.vocab.json +46 -0
- package/vocab/apps.vocab.json +553 -0
- package/vocab/attribution.vocab.json +32 -0
- package/vocab/builder-install.vocab.json +10 -0
- package/vocab/connections.vocab.json +128 -0
- package/vocab/dashboard.vocab.json +148 -0
- package/vocab/directory.vocab.json +2445 -0
- package/vocab/exception.vocab.json +18 -0
- package/vocab/fundraising.vocab.json +284 -0
- package/vocab/gmail-mailbox.vocab.json +73 -0
- package/vocab/kernel.vocab.json +420 -0
- package/vocab/mcp-retirement.vocab.json +66 -0
- package/vocab/meter.vocab.json +230 -0
- package/vocab/models-install.vocab.json +10 -0
- package/vocab/notices.vocab.json +88 -0
- package/vocab/operator-drafts.vocab.json +19 -0
- package/vocab/operator-matches.vocab.json +85 -0
- package/vocab/operator-settings.vocab.json +127 -0
- package/vocab/operator-talk.vocab.json +92 -0
- package/vocab/operator.vocab.json +1314 -0
- package/vocab/outreach.vocab.json +141 -0
- package/vocab/pages.vocab.json +38 -0
- package/vocab/payment.vocab.json +271 -0
- package/vocab/people.vocab.json +337 -0
- package/vocab/presence.vocab.json +19 -0
- package/vocab/preview.vocab.json +66 -0
- package/vocab/referenced.vocab.json +17 -0
- package/vocab/referral.vocab.json +272 -0
- package/vocab/refusals.vocab.json +16 -0
- package/vocab/registration.vocab.json +17 -0
- package/vocab/serving.vocab.json +103 -0
- package/vocab/side.vocab.json +97 -0
- package/vocab/space-apps.vocab.json +137 -0
- package/vocab/space-pages.vocab.json +416 -0
- package/vocab/sweep-install.vocab.json +10 -0
- package/vocab/sweep.vocab.json +125 -0
- package/vocab/trash.vocab.json +19 -0
- package/vocab/update.vocab.json +53 -0
- package/vocab/upload.vocab.json +69 -0
- package/vocab/use.vocab.json +93 -0
- package/vocab/visits.vocab.json +143 -0
- package/vocab/waiting.vocab.json +29 -0
- package/vocab.js +16 -0
- package/vocab.js.map +1 -0
- package/vocab.json +1703 -0
- package/vocab.ts +17 -0
- package/weigh-graph.js +12 -0
- package/weigh-graph.js.map +1 -0
- package/weigh-graph.ts +9 -0
- package/wire-news.js +30 -0
- package/wire-news.js.map +1 -0
- package/wire-news.ts +30 -0
- package/work-standing.js +64 -0
- package/work-standing.js.map +1 -0
- package/work-standing.ts +44 -0
- package/woven.js +435 -0
- package/woven.js.map +1 -0
- package/woven.ts +649 -0
- package/wrap-graph.js +17 -0
- package/wrap-graph.js.map +1 -0
- package/wrap-graph.ts +15 -0
- package/write-owner.js +11 -0
- package/write-owner.js.map +1 -0
- package/write-owner.ts +24 -0
|
@@ -0,0 +1,2239 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A space's Connections page (`/manage/<space>/connections`), drawn from its
|
|
3
|
+
* `connectionsPage` row (./connections-page.ts): the connections agents asked
|
|
4
|
+
* for, the person's own, the space's and what its apps borrow, the person's
|
|
5
|
+
* MCP servers, and the catalog of services to connect. One dialog shows the
|
|
6
|
+
* connection, loan, server or service opened (`opened`, the address's hash in
|
|
7
|
+
* the browser, `?detail=` on the server). What the page says beside the row,
|
|
8
|
+
* which changes only by leaving the page, is its `ConnectionsView`. The server
|
|
9
|
+
* draws it for the first paint, and the browser draws it again as the row
|
|
10
|
+
* moves (./connections-browser.ts).
|
|
11
|
+
*
|
|
12
|
+
* @module
|
|
13
|
+
*/
|
|
14
|
+
/* @ts-types="npm:@types/react@19.3.0" */ import {
|
|
15
|
+
cloneElement,
|
|
16
|
+
type ComponentProps,
|
|
17
|
+
createContext,
|
|
18
|
+
createElement as h,
|
|
19
|
+
Fragment,
|
|
20
|
+
type ReactElement,
|
|
21
|
+
type ReactNode as Kids,
|
|
22
|
+
useContext,
|
|
23
|
+
} from 'react'
|
|
24
|
+
import { Button } from '@yaks/ui/Button'
|
|
25
|
+
import { Card } from '@yaks/ui/Card'
|
|
26
|
+
import { Cards } from '@yaks/ui/Cards'
|
|
27
|
+
import { Check } from '@yaks/ui/Check'
|
|
28
|
+
import { Chip } from '@yaks/ui/Chip'
|
|
29
|
+
import { Chips } from '@yaks/ui/Chips'
|
|
30
|
+
import { Empty } from '@yaks/ui/Empty'
|
|
31
|
+
import { ErrorNotice } from '@yaks/ui/ErrorNotice'
|
|
32
|
+
import { Field } from '@yaks/ui/Field'
|
|
33
|
+
import { Form } from '@yaks/ui/Form'
|
|
34
|
+
import { Group } from '@yaks/ui/Group'
|
|
35
|
+
import { Loading } from '@yaks/ui/Loading'
|
|
36
|
+
import { Logo } from '@yaks/ui/Logo'
|
|
37
|
+
import { Modal } from '@yaks/ui/Modal'
|
|
38
|
+
import { More } from '@yaks/ui/More'
|
|
39
|
+
import { Notice } from '@yaks/ui/Notice'
|
|
40
|
+
import { Rows } from '@yaks/ui/Rows'
|
|
41
|
+
import { Section, Select, Stack } from '@yaks/ui/parts'
|
|
42
|
+
import { Time } from '@yaks/ui/Time'
|
|
43
|
+
import { Answer, Save } from '@yaks/ux'
|
|
44
|
+
import {
|
|
45
|
+
type Action,
|
|
46
|
+
ActionMenu,
|
|
47
|
+
actionProps,
|
|
48
|
+
type Actions,
|
|
49
|
+
menuOf,
|
|
50
|
+
MoreMenu,
|
|
51
|
+
} from '@yaks/ux/context-menu'
|
|
52
|
+
import { type Host, spaceHost } from './host.js'
|
|
53
|
+
import { FRIENDS_ACCESS } from './app-friends.js'
|
|
54
|
+
import { enabling, integrationLogo, managePath } from './routes.js'
|
|
55
|
+
import { aiUse, connectionsFull, count } from './standing.js'
|
|
56
|
+
import { ceilings, NAMES, planName, SUBSCRIBED, type Tier } from './plans.js'
|
|
57
|
+
import { planPrice } from './price.js'
|
|
58
|
+
import { choice } from './side-parts.js'
|
|
59
|
+
import type { Picked } from './side-rows.ts'
|
|
60
|
+
import {
|
|
61
|
+
fieldsOf,
|
|
62
|
+
heading,
|
|
63
|
+
held,
|
|
64
|
+
labeled,
|
|
65
|
+
said as told,
|
|
66
|
+
sentence,
|
|
67
|
+
status,
|
|
68
|
+
} from './page-parts.js'
|
|
69
|
+
import {
|
|
70
|
+
credentialHelp,
|
|
71
|
+
credentialLabel,
|
|
72
|
+
detail,
|
|
73
|
+
howTo,
|
|
74
|
+
keyBox,
|
|
75
|
+
logo,
|
|
76
|
+
overview,
|
|
77
|
+
resources,
|
|
78
|
+
signingIn,
|
|
79
|
+
siteLogin,
|
|
80
|
+
technical,
|
|
81
|
+
} from './connect-parts.js'
|
|
82
|
+
import type {
|
|
83
|
+
Borrowed,
|
|
84
|
+
CatalogEntry,
|
|
85
|
+
Connections,
|
|
86
|
+
Face,
|
|
87
|
+
Grantee,
|
|
88
|
+
McpPage,
|
|
89
|
+
Offered,
|
|
90
|
+
Service,
|
|
91
|
+
Shown,
|
|
92
|
+
Using,
|
|
93
|
+
} from './connections-page.ts'
|
|
94
|
+
|
|
95
|
+
/** What the page says beside its row: whose and which space's it is, where
|
|
96
|
+
* yaks.app answers, and the spaces the person owns, which a service opened
|
|
97
|
+
* may be connected to instead. */
|
|
98
|
+
export type ConnectionsView = {
|
|
99
|
+
person: string
|
|
100
|
+
space: { eid: string; slug: string; title?: string }
|
|
101
|
+
/** where yaks.app answers (./host.ts `Host`) */
|
|
102
|
+
env: Host
|
|
103
|
+
spaces: Picked[]
|
|
104
|
+
/** what its address asks the read (./connections-page.ts `askOf`) */
|
|
105
|
+
ask: string
|
|
106
|
+
inspection?: string
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
let Inspection = createContext(false)
|
|
110
|
+
|
|
111
|
+
let ConnectionForm = ({ children, ...props }: ComponentProps<typeof Form>) => {
|
|
112
|
+
let readOnly = useContext(Inspection) && props.method == 'post'
|
|
113
|
+
return h(
|
|
114
|
+
Form,
|
|
115
|
+
readOnly
|
|
116
|
+
? {
|
|
117
|
+
...props,
|
|
118
|
+
inert: true,
|
|
119
|
+
'data-save': undefined,
|
|
120
|
+
'data-save-reset': undefined,
|
|
121
|
+
}
|
|
122
|
+
: props,
|
|
123
|
+
children,
|
|
124
|
+
!readOnly && props.method == 'post' &&
|
|
125
|
+
!props['data-save'] &&
|
|
126
|
+
told(
|
|
127
|
+
'',
|
|
128
|
+
false,
|
|
129
|
+
(props.className ?? props.class) == 'Card_Form' ? 'end' : undefined,
|
|
130
|
+
),
|
|
131
|
+
)
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
// An item's menu, or with `more` its ⋯ and menu: an inspection, which only
|
|
135
|
+
// shows the page, offers nothing in it but to open the item.
|
|
136
|
+
let Offered = (
|
|
137
|
+
{ more, actions, ...props }: {
|
|
138
|
+
id: string
|
|
139
|
+
label: string
|
|
140
|
+
actions: Actions
|
|
141
|
+
more?: boolean
|
|
142
|
+
},
|
|
143
|
+
) => {
|
|
144
|
+
let offered = useContext(Inspection) ? { open: actions.open } : actions
|
|
145
|
+
return Object.values(offered).some(Boolean)
|
|
146
|
+
? h(more ? MoreMenu : ActionMenu, { ...props, actions: offered })
|
|
147
|
+
: null
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
// A space at its plan's connections, where another would be refused
|
|
151
|
+
// (yaks.app connections.ts `admitted`): the limit, what the Plus plan gives,
|
|
152
|
+
// and its checkout, the Billing page's button (./payment-view.ts), which
|
|
153
|
+
// ./connections-browser.ts presses the same way. None below the limit.
|
|
154
|
+
let full = (
|
|
155
|
+
slug: string,
|
|
156
|
+
plan: { tier: Tier | null; held: number },
|
|
157
|
+
readOnly: boolean,
|
|
158
|
+
) => {
|
|
159
|
+
let limit = ceilings(plan.tier, slug)?.connections
|
|
160
|
+
if (limit == null || plan.held < limit) return null
|
|
161
|
+
return h(
|
|
162
|
+
Card,
|
|
163
|
+
{ className: 'Bill' },
|
|
164
|
+
h(
|
|
165
|
+
Card.Sub,
|
|
166
|
+
null,
|
|
167
|
+
`${connectionsFull({ slug, tier: plan.tier })}. The ${NAMES.plus} ` +
|
|
168
|
+
`plan connects as many as you like and includes ${aiUse('plus')}. ` +
|
|
169
|
+
`A first paid subscription to it adds $${SUBSCRIBED} of building ` +
|
|
170
|
+
'credit.',
|
|
171
|
+
),
|
|
172
|
+
h(
|
|
173
|
+
Form.Actions,
|
|
174
|
+
null,
|
|
175
|
+
h(Button, {
|
|
176
|
+
type: 'button',
|
|
177
|
+
disabled: readOnly,
|
|
178
|
+
mod: 'go',
|
|
179
|
+
className: 'Bill_Go',
|
|
180
|
+
'data-door': 'checkout',
|
|
181
|
+
'data-plan': 'plus',
|
|
182
|
+
'data-per': 'month',
|
|
183
|
+
}, `Get ${planName('plus')} — ${planPrice('plus')}`),
|
|
184
|
+
),
|
|
185
|
+
told(),
|
|
186
|
+
)
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
// The integration directory, which lists services others added.
|
|
190
|
+
let DIRECTORY = '/integrations'
|
|
191
|
+
|
|
192
|
+
/** Choose the space that will use a provider's completed installation. */
|
|
193
|
+
export let installChoice = (
|
|
194
|
+
action: string,
|
|
195
|
+
state: string,
|
|
196
|
+
spaces: { eid: string; title: string; slug: string }[],
|
|
197
|
+
label: string,
|
|
198
|
+
): Kids =>
|
|
199
|
+
h(
|
|
200
|
+
ConnectionForm,
|
|
201
|
+
{ method: 'post', action },
|
|
202
|
+
held('install', state),
|
|
203
|
+
labeled(
|
|
204
|
+
'install-space',
|
|
205
|
+
'Space',
|
|
206
|
+
h(
|
|
207
|
+
Select,
|
|
208
|
+
{ id: 'install-space', name: 'space', required: true },
|
|
209
|
+
spaces.length > 1 ? h('option', { value: '' }, 'Choose a space') : null,
|
|
210
|
+
spaces.map((s) => h('option', { value: s.eid }, s.title || s.slug)),
|
|
211
|
+
),
|
|
212
|
+
),
|
|
213
|
+
h(Button, { type: 'submit' }, label),
|
|
214
|
+
)
|
|
215
|
+
|
|
216
|
+
/** The answers to a sign-in that came back to a browser other than the one
|
|
217
|
+
* that began it, posted back to `action`, the return's own address. */
|
|
218
|
+
export let approveConnect = (action: string): Kids =>
|
|
219
|
+
h(
|
|
220
|
+
ConnectionForm,
|
|
221
|
+
{ method: 'post', action },
|
|
222
|
+
h(
|
|
223
|
+
Button,
|
|
224
|
+
{ mod: 'go', type: 'submit', name: 'answer', value: 'connect' },
|
|
225
|
+
'Connect',
|
|
226
|
+
),
|
|
227
|
+
' ',
|
|
228
|
+
h(Button, { type: 'submit', name: 'answer', value: 'decline' }, 'Decline'),
|
|
229
|
+
)
|
|
230
|
+
|
|
231
|
+
// A label for what may be left empty.
|
|
232
|
+
let optional = (label: Kids) => [
|
|
233
|
+
label,
|
|
234
|
+
' ',
|
|
235
|
+
h(Form.Optional, null, '(optional)'),
|
|
236
|
+
]
|
|
237
|
+
|
|
238
|
+
// What the page says of something, as a notice; a refusal where `no`.
|
|
239
|
+
let noticed = (say?: string, no?: boolean) =>
|
|
240
|
+
say
|
|
241
|
+
? no ? h(ErrorNotice, null, say) : h(Notice, { role: 'status' }, say)
|
|
242
|
+
: null
|
|
243
|
+
|
|
244
|
+
// How a connection stands, as its head says it.
|
|
245
|
+
let STATUS = {
|
|
246
|
+
needed: 'Needs connecting',
|
|
247
|
+
connected: 'Connected',
|
|
248
|
+
broken: 'Needs reconnecting',
|
|
249
|
+
}
|
|
250
|
+
|
|
251
|
+
// A button a connection's form sends: quiet unless it is the card's one
|
|
252
|
+
// next step.
|
|
253
|
+
let press = (value: string, label: string, quiet = true) =>
|
|
254
|
+
h(Button, { mod: !quiet && 'go', type: 'submit', name: 'do', value }, label)
|
|
255
|
+
|
|
256
|
+
let appAccess = (a: Using, credential: string, personal: boolean) =>
|
|
257
|
+
h(
|
|
258
|
+
Section.Sub,
|
|
259
|
+
null,
|
|
260
|
+
personal
|
|
261
|
+
? 'Only you can use this connection in the app.'
|
|
262
|
+
: a.anyone
|
|
263
|
+
? `Anyone who can open the app can make requests using ${credential}.`
|
|
264
|
+
: `Only app members can make requests using ${credential}.`,
|
|
265
|
+
)
|
|
266
|
+
|
|
267
|
+
let visitorAccess = (
|
|
268
|
+
a: Using,
|
|
269
|
+
credential: string,
|
|
270
|
+
form: (kids: Kids) => Kids,
|
|
271
|
+
named = false,
|
|
272
|
+
) =>
|
|
273
|
+
h(
|
|
274
|
+
More,
|
|
275
|
+
{ 'data-key': `access-${a.app}-${a.anyone}`, 'data-save-fold': '' },
|
|
276
|
+
h(
|
|
277
|
+
More.Summary,
|
|
278
|
+
null,
|
|
279
|
+
named ? `Visitor access for ${a.title}` : 'Visitor access',
|
|
280
|
+
),
|
|
281
|
+
h(
|
|
282
|
+
More.Body,
|
|
283
|
+
null,
|
|
284
|
+
h(
|
|
285
|
+
Form.Hint,
|
|
286
|
+
null,
|
|
287
|
+
a.anyone
|
|
288
|
+
? `Only app members will be able to make requests using ${credential}.`
|
|
289
|
+
: `Anyone who can open ${a.title}, including people who aren’t members, could use ${credential} through the app. They may be able to access account data, use up quota, or incur charges.`,
|
|
290
|
+
),
|
|
291
|
+
form(h(
|
|
292
|
+
Form.Actions,
|
|
293
|
+
null,
|
|
294
|
+
a.anyone
|
|
295
|
+
? press('close', 'Limit to members')
|
|
296
|
+
: press('open', 'Allow visitors'),
|
|
297
|
+
)),
|
|
298
|
+
),
|
|
299
|
+
)
|
|
300
|
+
|
|
301
|
+
let accessCredential = (c: Pick<Shown, 'face' | 'keyed'>) =>
|
|
302
|
+
c.keyed ? credentialLabel(c.face) : 'connected account'
|
|
303
|
+
|
|
304
|
+
let credentialFields = (face: Face, id: string) => [
|
|
305
|
+
h(Form.Hint, null, credentialHelp(face)),
|
|
306
|
+
keyBox(id, 'API key', null, '', face.fields),
|
|
307
|
+
h(Save.Slot, { label: 'Save' }),
|
|
308
|
+
]
|
|
309
|
+
|
|
310
|
+
// What a connection lacking scopes its integration now asks for says.
|
|
311
|
+
let FULLER = 'Reconnect to grant full access.'
|
|
312
|
+
let APP_NAMES = new Intl.ListFormat('en', { type: 'conjunction' })
|
|
313
|
+
|
|
314
|
+
// A connection signed in to, rather than given a key, that is connected or
|
|
315
|
+
// was refused, signs in again in place: the same connection, the apps using
|
|
316
|
+
// it, and a new grant.
|
|
317
|
+
let reconnects = (c: Shown) =>
|
|
318
|
+
!c.keyed && !c.failed && !(c.each && !c.own) &&
|
|
319
|
+
(c.status == 'connected' || c.status == 'broken')
|
|
320
|
+
|
|
321
|
+
// Where a connection stands, which says what can be done with it: `ask`, the
|
|
322
|
+
// space's side of an app that asks each person to connect their own;
|
|
323
|
+
// `waiting`, one an app shares and waits on, which is connected rather than
|
|
324
|
+
// removed; `again`, signed in to again in place, which `needs` doing.
|
|
325
|
+
let standing = (c: Shown) => {
|
|
326
|
+
let ask = c.each && !c.own
|
|
327
|
+
let again = reconnects(c)
|
|
328
|
+
return {
|
|
329
|
+
ask,
|
|
330
|
+
again,
|
|
331
|
+
needs: again && (c.status == 'broken' || !!c.lacking.length),
|
|
332
|
+
waiting: c.status == 'needed' && !!c.apps.length && !c.each,
|
|
333
|
+
connecting: !ask && !c.keyed && !again &&
|
|
334
|
+
(c.status != 'connected' || !!c.failed),
|
|
335
|
+
}
|
|
336
|
+
}
|
|
337
|
+
|
|
338
|
+
// The id of the form that does `act` to the item at `key`: the button in its
|
|
339
|
+
// dialog and its menu (@yaks/ux/context-menu) both send it.
|
|
340
|
+
let doing = (key: string, act: string) => `do-${act}-${encodeURIComponent(key)}`
|
|
341
|
+
|
|
342
|
+
// The action sending the item at `key`'s form for `act`, as its button would.
|
|
343
|
+
let acting = (
|
|
344
|
+
key: string,
|
|
345
|
+
act: string,
|
|
346
|
+
label: string,
|
|
347
|
+
more: Partial<Action> = {},
|
|
348
|
+
): Action => ({
|
|
349
|
+
label,
|
|
350
|
+
submits: doing(key, act),
|
|
351
|
+
sends: ['do', act],
|
|
352
|
+
...more,
|
|
353
|
+
})
|
|
354
|
+
|
|
355
|
+
// The kit's button doing `a`, the page's go-ahead unless `quiet`.
|
|
356
|
+
let pressed = (a: Action, quiet = true) =>
|
|
357
|
+
h(Button, { mod: !quiet && 'go', ...actionProps(a) }, a.label)
|
|
358
|
+
|
|
359
|
+
// Whether a sign-in leaves for its service in a tab of its own.
|
|
360
|
+
let away = (face: Pick<Face, 'broker'>) =>
|
|
361
|
+
face.broker ? { target: '_blank' } : {}
|
|
362
|
+
|
|
363
|
+
/** What can be done with a connection, its dialog at `open`, declared once:
|
|
364
|
+
* its card's menu and its dialog's buttons are drawn from it. */
|
|
365
|
+
export let connectionActions = (
|
|
366
|
+
c: Shown,
|
|
367
|
+
key: string,
|
|
368
|
+
open: string,
|
|
369
|
+
): Actions => {
|
|
370
|
+
let is = standing(c)
|
|
371
|
+
return {
|
|
372
|
+
open: { label: 'Open', href: open },
|
|
373
|
+
signin: is.connecting ? acting(key, 'signin', 'Connect') : undefined,
|
|
374
|
+
reconnect: is.again
|
|
375
|
+
? acting(key, 'reconnect', is.needs ? 'Reconnect' : 'Sign in again')
|
|
376
|
+
: undefined,
|
|
377
|
+
disconnect: !is.ask && !is.waiting
|
|
378
|
+
? acting(
|
|
379
|
+
key,
|
|
380
|
+
'disconnect',
|
|
381
|
+
c.status == 'needed' ? 'Remove' : 'Disconnect',
|
|
382
|
+
{ danger: true },
|
|
383
|
+
)
|
|
384
|
+
: undefined,
|
|
385
|
+
}
|
|
386
|
+
}
|
|
387
|
+
|
|
388
|
+
/** What can be done with a connection an app here borrows, `mine` the
|
|
389
|
+
* space's own that could replace it: use that, or connect its own. */
|
|
390
|
+
export let borrowedActions = (
|
|
391
|
+
b: Borrowed,
|
|
392
|
+
key: string,
|
|
393
|
+
open: string,
|
|
394
|
+
on: boolean,
|
|
395
|
+
mine?: Shown,
|
|
396
|
+
): Actions => ({
|
|
397
|
+
open: { label: 'Open', href: open },
|
|
398
|
+
own: mine
|
|
399
|
+
? acting(key, 'attach', 'Use your own')
|
|
400
|
+
: on && !b.keyed
|
|
401
|
+
? acting(key, 'own', 'Connect your own')
|
|
402
|
+
: undefined,
|
|
403
|
+
})
|
|
404
|
+
|
|
405
|
+
/** What can be done with one of the person's MCP servers: turn it on or
|
|
406
|
+
* off, share it with the space or keep it theirs, move it to the trash, or
|
|
407
|
+
* restore it from there. */
|
|
408
|
+
export let serverActions = (
|
|
409
|
+
s: McpPage['servers'][number],
|
|
410
|
+
key: string,
|
|
411
|
+
open: string,
|
|
412
|
+
): Actions => ({
|
|
413
|
+
open: { label: 'Open', href: open },
|
|
414
|
+
...s.trashed ? { restore: acting(key, 'mcp-restore', 'Restore') } : {
|
|
415
|
+
power: s.enabled
|
|
416
|
+
? acting(key, 'mcp-off', 'Turn off')
|
|
417
|
+
: acting(key, 'mcp-on', 'Turn on'),
|
|
418
|
+
share: s.machine
|
|
419
|
+
? undefined
|
|
420
|
+
: s.everyone
|
|
421
|
+
? acting(key, 'mcp-mine', 'Use only with me')
|
|
422
|
+
: acting(key, 'mcp-everyone', 'Share with everyone'),
|
|
423
|
+
remove: acting(key, 'mcp-remove', 'Remove', { danger: true }),
|
|
424
|
+
},
|
|
425
|
+
})
|
|
426
|
+
|
|
427
|
+
/** What can be done with a credential kept in the trash of the space
|
|
428
|
+
* `space`: restore it, or erase it for good. */
|
|
429
|
+
export let retainedActions = (
|
|
430
|
+
one: Retained,
|
|
431
|
+
space: string,
|
|
432
|
+
key: string,
|
|
433
|
+
open: string,
|
|
434
|
+
): Actions => ({
|
|
435
|
+
open: { label: 'Open', href: open },
|
|
436
|
+
restore: acting(key, 'restore-credential', 'Restore credential'),
|
|
437
|
+
erase: {
|
|
438
|
+
label: 'Erase saved credential…',
|
|
439
|
+
href: `/space/${space}/confirm/credentialerase/${one.id}`,
|
|
440
|
+
danger: true,
|
|
441
|
+
},
|
|
442
|
+
})
|
|
443
|
+
|
|
444
|
+
// The credential, the apps using it, and the connection's advanced settings.
|
|
445
|
+
// For an app that asks each person to connect their own, the space's side
|
|
446
|
+
// shows only the request.
|
|
447
|
+
let connection = (
|
|
448
|
+
c: Shown,
|
|
449
|
+
on: boolean,
|
|
450
|
+
action: string,
|
|
451
|
+
close: Record<string, unknown>,
|
|
452
|
+
context: Kids,
|
|
453
|
+
env: Host,
|
|
454
|
+
actions: Actions,
|
|
455
|
+
menu: string,
|
|
456
|
+
) => {
|
|
457
|
+
let is = standing(c)
|
|
458
|
+
let { ask } = is
|
|
459
|
+
let id = (what: string) => `${what}-${c.eid}`
|
|
460
|
+
let form = (kids: Kids, at: Record<string, unknown> = {}) =>
|
|
461
|
+
h(
|
|
462
|
+
ConnectionForm,
|
|
463
|
+
{
|
|
464
|
+
method: 'post',
|
|
465
|
+
action,
|
|
466
|
+
...at,
|
|
467
|
+
'data-key': at['data-save'],
|
|
468
|
+
},
|
|
469
|
+
held('connection', c.eid),
|
|
470
|
+
kids,
|
|
471
|
+
)
|
|
472
|
+
let editing = (do_: string, kids: Kids) =>
|
|
473
|
+
form([held('do', do_), kids], { 'data-save': id(do_) })
|
|
474
|
+
// An action's own form, its button in it where the dialog shows one, else
|
|
475
|
+
// empty and hidden, for the menu to send.
|
|
476
|
+
let sending = (a: Action | undefined, shown: boolean, quiet = true) =>
|
|
477
|
+
a?.submits
|
|
478
|
+
? form(shown ? pressed(a, quiet) : null, {
|
|
479
|
+
id: a.submits,
|
|
480
|
+
class: 'Card_Form',
|
|
481
|
+
hidden: !shown || undefined,
|
|
482
|
+
...a.sends?.[1] == 'disconnect' ? {} : away(c.face),
|
|
483
|
+
})
|
|
484
|
+
: null
|
|
485
|
+
let { signin, reconnect, disconnect } = actions
|
|
486
|
+
let open = c.status != 'connected' || !!c.failed
|
|
487
|
+
// A key is pasted here for a keyed connection this deploy can keep one for.
|
|
488
|
+
let keying = !ask && on && c.keyed
|
|
489
|
+
let login = siteLogin(c.face)
|
|
490
|
+
let credential = credentialLabel(c.face)
|
|
491
|
+
// A connection signed in to again only now and then keeps that, and its
|
|
492
|
+
// disconnecting, in its head's ⋯; one needing it says so in its body.
|
|
493
|
+
let tucked = is.again && !is.needs
|
|
494
|
+
let more = tucked
|
|
495
|
+
? h(Offered, {
|
|
496
|
+
more: true,
|
|
497
|
+
id: `${menu}-in`,
|
|
498
|
+
label: `More for ${c.face.title}`,
|
|
499
|
+
actions: { reconnect, disconnect },
|
|
500
|
+
})
|
|
501
|
+
: null
|
|
502
|
+
let { connecting } = is
|
|
503
|
+
let needsReconnect = is.needs
|
|
504
|
+
let purpose = c.apps.length
|
|
505
|
+
? `Connect ${c.face.title} to give ${
|
|
506
|
+
APP_NAMES.format(c.apps.map((app) => app.title))
|
|
507
|
+
} access through the account you choose.`
|
|
508
|
+
: c.own
|
|
509
|
+
? `Sign in to ${c.face.title} to use your own account.`
|
|
510
|
+
: `Connect ${c.face.title} so you can grant apps access.`
|
|
511
|
+
let connect = connecting || needsReconnect
|
|
512
|
+
? h(
|
|
513
|
+
Form.Line,
|
|
514
|
+
null,
|
|
515
|
+
h(
|
|
516
|
+
Section.Sub,
|
|
517
|
+
null,
|
|
518
|
+
connecting
|
|
519
|
+
? purpose
|
|
520
|
+
: c.lacking.length
|
|
521
|
+
? FULLER
|
|
522
|
+
: 'Sign in again to restore this connection.',
|
|
523
|
+
),
|
|
524
|
+
sending(connecting ? signin : reconnect, true, false),
|
|
525
|
+
)
|
|
526
|
+
: null
|
|
527
|
+
let stands = ask ? status('Each person connects their own') : status(
|
|
528
|
+
login
|
|
529
|
+
? c.status == 'needed'
|
|
530
|
+
? 'Needs sign-in details'
|
|
531
|
+
: c.status == 'connected'
|
|
532
|
+
? 'Sign-in details saved'
|
|
533
|
+
: 'Needs new sign-in details'
|
|
534
|
+
: STATUS[c.status],
|
|
535
|
+
c.status == 'connected' ? 'positive' : 'negative',
|
|
536
|
+
)
|
|
537
|
+
let notice = c.failed
|
|
538
|
+
? noticed(
|
|
539
|
+
`${c.face.title} could not be connected. Try connecting again.`,
|
|
540
|
+
true,
|
|
541
|
+
)
|
|
542
|
+
: c.saving
|
|
543
|
+
? noticed(sentence(c.saving))
|
|
544
|
+
: null
|
|
545
|
+
let fields = keying
|
|
546
|
+
? form(
|
|
547
|
+
[held('do', 'key'), credentialFields(c.face, id('key'))],
|
|
548
|
+
{ 'data-save': id('key'), 'data-save-reset': '' },
|
|
549
|
+
)
|
|
550
|
+
: null
|
|
551
|
+
let paste = keying && h(
|
|
552
|
+
More,
|
|
553
|
+
{ open, 'data-save-fold': '' },
|
|
554
|
+
h(
|
|
555
|
+
More.Summary,
|
|
556
|
+
null,
|
|
557
|
+
login
|
|
558
|
+
? open ? `Sign in to ${c.face.title}` : 'Replace sign-in details'
|
|
559
|
+
: open
|
|
560
|
+
? `Enter your ${credential}`
|
|
561
|
+
: `Replace the ${credential}`,
|
|
562
|
+
),
|
|
563
|
+
h(More.Body, null, fields),
|
|
564
|
+
)
|
|
565
|
+
let forApp = (a: Using, kids: Kids, at: Record<string, unknown> = {}) =>
|
|
566
|
+
form([held('app', a.app), kids], at)
|
|
567
|
+
let using = (a: Using, only: boolean) =>
|
|
568
|
+
a.borrower != null
|
|
569
|
+
? h(
|
|
570
|
+
Rows.Item,
|
|
571
|
+
{ as: 'li' },
|
|
572
|
+
h(
|
|
573
|
+
Rows.Main,
|
|
574
|
+
null,
|
|
575
|
+
h(Rows.Name, null, a.borrower),
|
|
576
|
+
h(
|
|
577
|
+
Rows.Meta,
|
|
578
|
+
null,
|
|
579
|
+
`Their copy of ${a.title} borrows this connection.`,
|
|
580
|
+
),
|
|
581
|
+
),
|
|
582
|
+
c.each ? null : h(
|
|
583
|
+
Rows.Actions,
|
|
584
|
+
null,
|
|
585
|
+
forApp(a, press('recall', 'Recall')),
|
|
586
|
+
),
|
|
587
|
+
)
|
|
588
|
+
: h(
|
|
589
|
+
Section,
|
|
590
|
+
{ as: 'li' },
|
|
591
|
+
only ? null : h(Rows.Name, null, a.title),
|
|
592
|
+
appAccess(a, `your ${accessCredential(c)}`, c.each),
|
|
593
|
+
)
|
|
594
|
+
// The space's own apps first, then the copies borrowing it.
|
|
595
|
+
let rows = [...c.apps].sort((a, b) =>
|
|
596
|
+
Number(a.borrower != null) - Number(b.borrower != null)
|
|
597
|
+
)
|
|
598
|
+
let only = rows.length == 1 && rows[0].borrower == null ? rows[0] : null
|
|
599
|
+
let apps = ask
|
|
600
|
+
? c.apps.length
|
|
601
|
+
? h(
|
|
602
|
+
Card.Sub,
|
|
603
|
+
null,
|
|
604
|
+
`Each person who uses ${
|
|
605
|
+
c.apps.map((a) => a.title).join(', ')
|
|
606
|
+
} connects their own account, from the app.`,
|
|
607
|
+
)
|
|
608
|
+
: null
|
|
609
|
+
: rows.length
|
|
610
|
+
? h(
|
|
611
|
+
Rows,
|
|
612
|
+
{ as: 'ul', className: 'Connection_Apps' },
|
|
613
|
+
rows.map((a) => using(a, !!only)),
|
|
614
|
+
)
|
|
615
|
+
: h(Card.Sub, null, 'No apps use the connection yet.')
|
|
616
|
+
let attaching = c.status == 'connected' && !c.own && c.available.length > 0
|
|
617
|
+
let attach = attaching
|
|
618
|
+
? form(
|
|
619
|
+
labeled(
|
|
620
|
+
id('attach'),
|
|
621
|
+
'Grant app access',
|
|
622
|
+
h(
|
|
623
|
+
Form.Line,
|
|
624
|
+
null,
|
|
625
|
+
h(
|
|
626
|
+
Select,
|
|
627
|
+
{ id: id('attach'), name: 'app', required: true },
|
|
628
|
+
h('option', { value: '' }, 'Choose an app'),
|
|
629
|
+
c.available.map((a) => h('option', { value: a.app }, a.title)),
|
|
630
|
+
),
|
|
631
|
+
press('attach', 'Attach', false),
|
|
632
|
+
),
|
|
633
|
+
c.face.visitors == 'on'
|
|
634
|
+
? 'App visitors can use this connection by default.'
|
|
635
|
+
: 'Only app members can use this connection by default.',
|
|
636
|
+
),
|
|
637
|
+
{ class: 'Connection_Attach' },
|
|
638
|
+
)
|
|
639
|
+
: null
|
|
640
|
+
// Whether a service this space added is in the integration directory, for
|
|
641
|
+
// anyone to add with their own key: its owner lists it or takes it out.
|
|
642
|
+
let listing = c.about
|
|
643
|
+
? h(
|
|
644
|
+
Form.Field,
|
|
645
|
+
null,
|
|
646
|
+
h(Form.Label, { as: 'span' }, 'Public listing'),
|
|
647
|
+
h(
|
|
648
|
+
Form.Hint,
|
|
649
|
+
null,
|
|
650
|
+
c.listed
|
|
651
|
+
? [
|
|
652
|
+
'Listed in the ',
|
|
653
|
+
h('a', {
|
|
654
|
+
href: `${DIRECTORY}#${encodeURIComponent(c.integration)}`,
|
|
655
|
+
}, 'public directory'),
|
|
656
|
+
`, for anyone to connect with their own ${credential}.`,
|
|
657
|
+
]
|
|
658
|
+
: `Once listed, anyone could connect it with their own ${credential}.`,
|
|
659
|
+
),
|
|
660
|
+
form(
|
|
661
|
+
h(
|
|
662
|
+
Form.Actions,
|
|
663
|
+
null,
|
|
664
|
+
c.listed ? press('unlist', 'Unlist') : press('list', 'List publicly'),
|
|
665
|
+
),
|
|
666
|
+
),
|
|
667
|
+
)
|
|
668
|
+
: null
|
|
669
|
+
// What is said about a service this space added, its owner's to change.
|
|
670
|
+
let told = c.about
|
|
671
|
+
? h(
|
|
672
|
+
More,
|
|
673
|
+
{ 'data-save-fold': '' },
|
|
674
|
+
h(More.Summary, null, `About ${c.face.title}`),
|
|
675
|
+
h(
|
|
676
|
+
More.Body,
|
|
677
|
+
null,
|
|
678
|
+
editing('about', [
|
|
679
|
+
(
|
|
680
|
+
[
|
|
681
|
+
['title', 'Name', c.face.title],
|
|
682
|
+
['tagline', 'Description', 'Short description'],
|
|
683
|
+
['site', 'Website', 'https://…'],
|
|
684
|
+
...credential == 'API key'
|
|
685
|
+
? [
|
|
686
|
+
[
|
|
687
|
+
'example',
|
|
688
|
+
'API key format',
|
|
689
|
+
'rk_live_••••••••',
|
|
690
|
+
] as const,
|
|
691
|
+
]
|
|
692
|
+
: [],
|
|
693
|
+
] as const
|
|
694
|
+
).map(([k, label, hint]) =>
|
|
695
|
+
labeled(
|
|
696
|
+
id(k),
|
|
697
|
+
label,
|
|
698
|
+
h(Field, {
|
|
699
|
+
id: id(k),
|
|
700
|
+
name: k,
|
|
701
|
+
value: c.about![k] ?? '',
|
|
702
|
+
placeholder: hint,
|
|
703
|
+
...k == 'site' && { type: 'url', pattern: 'https://.*' },
|
|
704
|
+
}),
|
|
705
|
+
)
|
|
706
|
+
),
|
|
707
|
+
labeled(
|
|
708
|
+
id('instructions'),
|
|
709
|
+
login ? 'Sign-in instructions' : `How to get the ${credential}`,
|
|
710
|
+
h(Field, {
|
|
711
|
+
lines: true,
|
|
712
|
+
id: id('instructions'),
|
|
713
|
+
name: 'instructions',
|
|
714
|
+
rows: 6,
|
|
715
|
+
placeholder: login
|
|
716
|
+
? 'Where to sign in and which account to use'
|
|
717
|
+
: `Where to find the ${credential}`,
|
|
718
|
+
value: c.about.instructions ?? '',
|
|
719
|
+
}),
|
|
720
|
+
'Written for whoever connects it and the agent helping them, in Markdown.',
|
|
721
|
+
),
|
|
722
|
+
h(Save.Slot, { label: 'Save' }),
|
|
723
|
+
]),
|
|
724
|
+
),
|
|
725
|
+
)
|
|
726
|
+
: null
|
|
727
|
+
let icon = c.about
|
|
728
|
+
? h(
|
|
729
|
+
Form.Field,
|
|
730
|
+
null,
|
|
731
|
+
h(Form.Label, { as: 'span' }, 'Icon'),
|
|
732
|
+
h('div', {
|
|
733
|
+
'data-key': id('icon'),
|
|
734
|
+
'data-kept': '',
|
|
735
|
+
'data-connection-icon': c.eid,
|
|
736
|
+
'data-icon-src': integrationLogo(c.face, env),
|
|
737
|
+
}, logo(c.face, env)),
|
|
738
|
+
)
|
|
739
|
+
: null
|
|
740
|
+
// Lending it to the copies people install of an app here: the calls a
|
|
741
|
+
// month each copy may make, saved again to change it, and the button that
|
|
742
|
+
// stops lending and takes every loan back. Only a shared sentinel the app
|
|
743
|
+
// holds is lent, never the key itself.
|
|
744
|
+
let lendable = c.status == 'connected' && !c.own && !c.each
|
|
745
|
+
let lend = (a: Using) => {
|
|
746
|
+
let field = `${id('lend')}-${a.app}`
|
|
747
|
+
let stop = `${field}-stop`
|
|
748
|
+
return [
|
|
749
|
+
forApp(
|
|
750
|
+
a,
|
|
751
|
+
[
|
|
752
|
+
a.lends == null ? null : held('do', 'lend'),
|
|
753
|
+
labeled(
|
|
754
|
+
field,
|
|
755
|
+
`Lend to copies of ${a.title}`,
|
|
756
|
+
h(
|
|
757
|
+
Form.Line,
|
|
758
|
+
null,
|
|
759
|
+
h(Field, {
|
|
760
|
+
id: field,
|
|
761
|
+
name: 'cap',
|
|
762
|
+
type: 'number',
|
|
763
|
+
min: 1,
|
|
764
|
+
step: 1,
|
|
765
|
+
inputmode: 'numeric',
|
|
766
|
+
value: a.lends ?? 100,
|
|
767
|
+
placeholder: 'e.g. 100',
|
|
768
|
+
required: true,
|
|
769
|
+
}),
|
|
770
|
+
a.lends == null ? press('lend', 'Lend') : null,
|
|
771
|
+
a.lends == null ? null : h(
|
|
772
|
+
Button,
|
|
773
|
+
{ type: 'submit', form: stop, name: 'do', value: 'lend' },
|
|
774
|
+
'Stop lending',
|
|
775
|
+
),
|
|
776
|
+
),
|
|
777
|
+
`How many calls each installed copy may make each month. A copy can connect with its own ${credential} instead.`,
|
|
778
|
+
),
|
|
779
|
+
a.lends == null ? null : h(Save.Slot, { label: 'Save' }),
|
|
780
|
+
],
|
|
781
|
+
a.lends == null ? {} : { 'data-save': field },
|
|
782
|
+
),
|
|
783
|
+
a.lends == null ? null : forApp(a, null, { id: stop, hidden: true }),
|
|
784
|
+
]
|
|
785
|
+
}
|
|
786
|
+
let lent = lendable
|
|
787
|
+
? c.apps.filter((a) => a.borrower == null && !a.direct).map(lend)
|
|
788
|
+
: []
|
|
789
|
+
let folded = [
|
|
790
|
+
c.scopes.length
|
|
791
|
+
? h(Section.Sub, null, 'Scopes ', h('code', null, c.scopes.join(', ')))
|
|
792
|
+
: null,
|
|
793
|
+
...rows.filter((app) => !c.each && app.binding && app.borrower == null).map(
|
|
794
|
+
(app) =>
|
|
795
|
+
h(
|
|
796
|
+
Section.Sub,
|
|
797
|
+
{ key: app.app },
|
|
798
|
+
`${app.title} reads this connection as `,
|
|
799
|
+
h('code', null, `env.${app.binding}`),
|
|
800
|
+
'.',
|
|
801
|
+
),
|
|
802
|
+
),
|
|
803
|
+
...c.each || c.face.visitors == 'never' ? [] : rows
|
|
804
|
+
.filter((app) => app.borrower == null)
|
|
805
|
+
.map((app) =>
|
|
806
|
+
visitorAccess(
|
|
807
|
+
app,
|
|
808
|
+
`your ${accessCredential(c)}`,
|
|
809
|
+
(kids) => forApp(app, kids),
|
|
810
|
+
!only,
|
|
811
|
+
)
|
|
812
|
+
),
|
|
813
|
+
keying && open ? null : howTo(c.face, false),
|
|
814
|
+
technical(c.face),
|
|
815
|
+
...lent,
|
|
816
|
+
listing,
|
|
817
|
+
told,
|
|
818
|
+
icon,
|
|
819
|
+
tucked ? null : sending(disconnect, true),
|
|
820
|
+
]
|
|
821
|
+
let as = c.title || c.account
|
|
822
|
+
let usage = h(
|
|
823
|
+
Section,
|
|
824
|
+
{ className: 'Connection_Section', 'aria-labelledby': id('apps') },
|
|
825
|
+
h(
|
|
826
|
+
Section.Title,
|
|
827
|
+
{ as: 'h3', id: id('apps') },
|
|
828
|
+
only ? `Used by ${only.title}` : 'Apps using this connection',
|
|
829
|
+
),
|
|
830
|
+
apps,
|
|
831
|
+
attach,
|
|
832
|
+
context,
|
|
833
|
+
)
|
|
834
|
+
return h(
|
|
835
|
+
Modal.Body,
|
|
836
|
+
{ 'data-connection': c.eid },
|
|
837
|
+
h(Modal.Head, {
|
|
838
|
+
title: c.face.title,
|
|
839
|
+
mark: logo(c.face, env),
|
|
840
|
+
status: stands,
|
|
841
|
+
actions: more,
|
|
842
|
+
close,
|
|
843
|
+
}),
|
|
844
|
+
h(
|
|
845
|
+
Modal.Main,
|
|
846
|
+
null,
|
|
847
|
+
// What came of a press of its ⋯, whose forms are out of sight.
|
|
848
|
+
tucked ? h(ErrorNotice, { 'data-connections-status': '' }) : null,
|
|
849
|
+
tucked ? sending(reconnect, false) : null,
|
|
850
|
+
tucked ? sending(disconnect, false) : null,
|
|
851
|
+
...overview(c.face),
|
|
852
|
+
resources(c.face),
|
|
853
|
+
connect,
|
|
854
|
+
notice,
|
|
855
|
+
as && c.status == 'connected'
|
|
856
|
+
? h(Section.Sub, null, 'Connected as ', h('strong', null, as))
|
|
857
|
+
: null,
|
|
858
|
+
keying && open ? howTo(c.face, true) : null,
|
|
859
|
+
paste,
|
|
860
|
+
usage,
|
|
861
|
+
folded.some(Boolean)
|
|
862
|
+
? h(
|
|
863
|
+
More,
|
|
864
|
+
{ className: 'Connection_Section', 'data-save-fold': '' },
|
|
865
|
+
h(More.Summary, null, 'Advanced'),
|
|
866
|
+
h(More.Body, null, folded),
|
|
867
|
+
)
|
|
868
|
+
: null,
|
|
869
|
+
),
|
|
870
|
+
)
|
|
871
|
+
}
|
|
872
|
+
|
|
873
|
+
// A connection an app here borrows from the space that lent it with the app,
|
|
874
|
+
// as a card: its head says whose it is, its row what the app has spent of the
|
|
875
|
+
// cap it was lent under and who may call out through it, which is this space's
|
|
876
|
+
// to say, and what replaces it is the space's own: a
|
|
877
|
+
// connection it holds already, a sign-in, or a key pasted under the fold.
|
|
878
|
+
let borrowing = (
|
|
879
|
+
b: Borrowed,
|
|
880
|
+
env: Host,
|
|
881
|
+
on: boolean,
|
|
882
|
+
action: string,
|
|
883
|
+
close: Record<string, unknown>,
|
|
884
|
+
actions: Actions,
|
|
885
|
+
mine?: Shown,
|
|
886
|
+
) => {
|
|
887
|
+
let form = (
|
|
888
|
+
kids: Kids,
|
|
889
|
+
connection = b.eid,
|
|
890
|
+
edit = false,
|
|
891
|
+
part = '',
|
|
892
|
+
at: Record<string, unknown> = {},
|
|
893
|
+
) =>
|
|
894
|
+
h(
|
|
895
|
+
ConnectionForm,
|
|
896
|
+
{
|
|
897
|
+
className: part,
|
|
898
|
+
method: 'post',
|
|
899
|
+
action,
|
|
900
|
+
...at,
|
|
901
|
+
...edit
|
|
902
|
+
? {
|
|
903
|
+
'data-save': `own-${b.eid}-${b.app.app}`,
|
|
904
|
+
'data-save-reset': '',
|
|
905
|
+
}
|
|
906
|
+
: {},
|
|
907
|
+
},
|
|
908
|
+
edit ? held('do', 'own') : null,
|
|
909
|
+
held('connection', connection),
|
|
910
|
+
held('app', b.app.app),
|
|
911
|
+
kids,
|
|
912
|
+
)
|
|
913
|
+
let { own: owning } = actions
|
|
914
|
+
let ownership = owning
|
|
915
|
+
? form(
|
|
916
|
+
pressed(owning, !!mine),
|
|
917
|
+
mine?.eid ?? b.eid,
|
|
918
|
+
false,
|
|
919
|
+
'Card_Form',
|
|
920
|
+
{ id: owning.submits, ...mine ? {} : away(b.face) },
|
|
921
|
+
)
|
|
922
|
+
: null
|
|
923
|
+
let id = `own-${b.eid}-${b.app.app}`
|
|
924
|
+
let credential = credentialLabel(b.face)
|
|
925
|
+
let own = on && b.keyed && !mine
|
|
926
|
+
? h(
|
|
927
|
+
More,
|
|
928
|
+
null,
|
|
929
|
+
h(More.Summary, null, `Use your own ${credential}`),
|
|
930
|
+
h(
|
|
931
|
+
More.Body,
|
|
932
|
+
null,
|
|
933
|
+
form(credentialFields(b.face, id), b.eid, true),
|
|
934
|
+
),
|
|
935
|
+
)
|
|
936
|
+
: null
|
|
937
|
+
return h(
|
|
938
|
+
Modal.Body,
|
|
939
|
+
{ 'data-borrowed': b.eid },
|
|
940
|
+
h(Modal.Head, {
|
|
941
|
+
title: b.face.title,
|
|
942
|
+
mark: logo(b.face, env),
|
|
943
|
+
status: status(`Borrowed from ${b.lender}`, 'positive'),
|
|
944
|
+
close,
|
|
945
|
+
}),
|
|
946
|
+
...overview(b.face),
|
|
947
|
+
resources(b.face),
|
|
948
|
+
ownership ? h(Card.Actions, null, ownership) : null,
|
|
949
|
+
own,
|
|
950
|
+
h(
|
|
951
|
+
Section,
|
|
952
|
+
{ className: 'Connection_Section', 'aria-labelledby': id },
|
|
953
|
+
h(Section.Title, { as: 'h3', id }, `Used by ${b.app.title}`),
|
|
954
|
+
appAccess(b.app, `${b.lender}’s ${accessCredential(b)}`, false),
|
|
955
|
+
),
|
|
956
|
+
h(
|
|
957
|
+
More,
|
|
958
|
+
{ className: 'Connection_Section', 'data-save-fold': '' },
|
|
959
|
+
h(More.Summary, null, 'Advanced'),
|
|
960
|
+
h(
|
|
961
|
+
More.Body,
|
|
962
|
+
null,
|
|
963
|
+
b.app.cap == null ? null : h(
|
|
964
|
+
Form.Hint,
|
|
965
|
+
null,
|
|
966
|
+
`This app can make up to ${b.app.cap} requests per month with this connection.`,
|
|
967
|
+
),
|
|
968
|
+
b.face.visitors == 'never'
|
|
969
|
+
? null
|
|
970
|
+
: visitorAccess(b.app, `${b.lender}’s ${accessCredential(b)}`, form),
|
|
971
|
+
howTo(b.face, false),
|
|
972
|
+
technical(b.face),
|
|
973
|
+
),
|
|
974
|
+
),
|
|
975
|
+
)
|
|
976
|
+
}
|
|
977
|
+
|
|
978
|
+
// The id of the menu of the item at `key`.
|
|
979
|
+
let menuId = (key: string) => `menu-${encodeURIComponent(key)}`
|
|
980
|
+
|
|
981
|
+
// A card opens its dialog, `actions.open`, and its menu (a right-click, a
|
|
982
|
+
// long press) offers the rest. It carries just the name, status and one line.
|
|
983
|
+
let card = (
|
|
984
|
+
env: Host,
|
|
985
|
+
face: Pick<Face, 'name' | 'title' | 'logo' | 'image'>,
|
|
986
|
+
line: Kids,
|
|
987
|
+
key: string,
|
|
988
|
+
actions: Actions,
|
|
989
|
+
stands?: Kids,
|
|
990
|
+
) =>
|
|
991
|
+
h(
|
|
992
|
+
Fragment,
|
|
993
|
+
{ key },
|
|
994
|
+
h(
|
|
995
|
+
Card,
|
|
996
|
+
{ mod: 'button', ...actionProps(actions.open!), ...menuOf(menuId(key)) },
|
|
997
|
+
heading(face.title, { mark: logo(face, env), status: stands }),
|
|
998
|
+
line ? h(Card.Sub, null, line) : null,
|
|
999
|
+
),
|
|
1000
|
+
h(Offered, { id: menuId(key), label: face.title, actions }),
|
|
1001
|
+
)
|
|
1002
|
+
|
|
1003
|
+
let serviceKey = (name: string) => `service:${name}`
|
|
1004
|
+
let serviceFace = (name: string) => ({ name, title: name, logo: '', image: '' })
|
|
1005
|
+
let serviceLine = (s: Service) => [
|
|
1006
|
+
'Signed in with your yaks.app account ',
|
|
1007
|
+
h(Time, { at: new Date(s.connectedAt * 1000).toISOString() }),
|
|
1008
|
+
'.',
|
|
1009
|
+
]
|
|
1010
|
+
|
|
1011
|
+
// The link a card's button follows: this page, opened on one thing.
|
|
1012
|
+
let openedOn = (action: string, value: string) =>
|
|
1013
|
+
`${action}#${encodeURIComponent(value)}`
|
|
1014
|
+
|
|
1015
|
+
type Retained = NonNullable<Connections['trash']>[number]
|
|
1016
|
+
|
|
1017
|
+
let retainedKey = (one: Retained) => `credential:${one.id}`
|
|
1018
|
+
let retainedLine = (one: Retained) => [
|
|
1019
|
+
'Saved ',
|
|
1020
|
+
h(Time, { at: new Date(one.at).toISOString() }),
|
|
1021
|
+
'. Kept privately until restored or permanently erased.',
|
|
1022
|
+
]
|
|
1023
|
+
|
|
1024
|
+
let credentialTrash = (
|
|
1025
|
+
href: string,
|
|
1026
|
+
open: boolean,
|
|
1027
|
+
cards: Kids[] | undefined,
|
|
1028
|
+
) =>
|
|
1029
|
+
h(
|
|
1030
|
+
'div',
|
|
1031
|
+
{ className: 'Connection_Trash' },
|
|
1032
|
+
h(Button, {
|
|
1033
|
+
href,
|
|
1034
|
+
mod: 'quiet',
|
|
1035
|
+
'aria-controls': 'credential-trash',
|
|
1036
|
+
'aria-expanded': open,
|
|
1037
|
+
}, 'Trash'),
|
|
1038
|
+
h(
|
|
1039
|
+
'div',
|
|
1040
|
+
{
|
|
1041
|
+
id: 'credential-trash',
|
|
1042
|
+
className: 'Connection_TrashItems',
|
|
1043
|
+
hidden: !open,
|
|
1044
|
+
},
|
|
1045
|
+
open &&
|
|
1046
|
+
h(Answer<Kids>, {
|
|
1047
|
+
answered: { rows: cards ?? [], ready: !!cards },
|
|
1048
|
+
empty: 'No saved credentials in the trash.',
|
|
1049
|
+
loading: 'Loading trash…',
|
|
1050
|
+
name: 'trash',
|
|
1051
|
+
children: (kept) => h(Cards, null, kept),
|
|
1052
|
+
}),
|
|
1053
|
+
),
|
|
1054
|
+
)
|
|
1055
|
+
|
|
1056
|
+
// What each of a server's states says, beside its name.
|
|
1057
|
+
let MCP_STATE: Record<
|
|
1058
|
+
McpPage['servers'][number]['status'],
|
|
1059
|
+
[string, 'positive' | 'negative']
|
|
1060
|
+
> = {
|
|
1061
|
+
open: ['Connected', 'positive'],
|
|
1062
|
+
machine: ['On your machine', 'positive'],
|
|
1063
|
+
connected: ['Connected', 'positive'],
|
|
1064
|
+
needed: ['Waiting for a key or sign-in', 'negative'],
|
|
1065
|
+
broken: ['Its key or sign-in was refused', 'negative'],
|
|
1066
|
+
unavailable: ['Unavailable', 'negative'],
|
|
1067
|
+
}
|
|
1068
|
+
|
|
1069
|
+
// One grant's button on the connections page: the app, the source and the
|
|
1070
|
+
// act, `source-grant` or `source-revoke`.
|
|
1071
|
+
let granting = (
|
|
1072
|
+
action: string,
|
|
1073
|
+
a: Grantee,
|
|
1074
|
+
at: string,
|
|
1075
|
+
act: string,
|
|
1076
|
+
label: string,
|
|
1077
|
+
) =>
|
|
1078
|
+
h(
|
|
1079
|
+
ConnectionForm,
|
|
1080
|
+
{ method: 'post', action, className: 'Card_Form' },
|
|
1081
|
+
held('app', a.eid),
|
|
1082
|
+
held('at', at),
|
|
1083
|
+
press(act, label, act == 'source-revoke'),
|
|
1084
|
+
)
|
|
1085
|
+
|
|
1086
|
+
// An app asking the person for what they connected (`./api/allow`), at the
|
|
1087
|
+
// top of their connections page: each source it asks for, allowed or not.
|
|
1088
|
+
let sourceAsk = (
|
|
1089
|
+
ask: NonNullable<McpPage['ask']>,
|
|
1090
|
+
action: string,
|
|
1091
|
+
env: Host,
|
|
1092
|
+
) => {
|
|
1093
|
+
let friends = ask.at == FRIENDS_ACCESS
|
|
1094
|
+
return h(
|
|
1095
|
+
Card,
|
|
1096
|
+
{ id: 'grant' },
|
|
1097
|
+
h(
|
|
1098
|
+
Card.Title,
|
|
1099
|
+
null,
|
|
1100
|
+
friends
|
|
1101
|
+
? `Let ${ask.app.title} see your friends?`
|
|
1102
|
+
: `${ask.app.title} requests access to a connection`,
|
|
1103
|
+
),
|
|
1104
|
+
h(
|
|
1105
|
+
Card.Sub,
|
|
1106
|
+
null,
|
|
1107
|
+
friends
|
|
1108
|
+
? `${ask.app.title} can read your confirmed friends and their visible online status, and send play invitations on your behalf. You can remove access in Connections.`
|
|
1109
|
+
: `${ask.app.title} can call the tools of an approved connection on your behalf only while you use the app. Other users cannot use your connection.`,
|
|
1110
|
+
),
|
|
1111
|
+
ask.sources.length
|
|
1112
|
+
? ask.sources.map((src) =>
|
|
1113
|
+
h(
|
|
1114
|
+
Card.Sub,
|
|
1115
|
+
{ as: 'div' },
|
|
1116
|
+
h('strong', null, h(Logo, null, src.title)),
|
|
1117
|
+
` ${src.about} `,
|
|
1118
|
+
src.granted
|
|
1119
|
+
? granting(action, ask.app, src.at, 'source-revoke', 'Stop')
|
|
1120
|
+
: granting(action, ask.app, src.at, 'source-grant', 'Allow'),
|
|
1121
|
+
)
|
|
1122
|
+
)
|
|
1123
|
+
: h(
|
|
1124
|
+
Card.Sub,
|
|
1125
|
+
null,
|
|
1126
|
+
'No matching connection. Add a connection below before granting app access.',
|
|
1127
|
+
),
|
|
1128
|
+
h(
|
|
1129
|
+
Card.Sub,
|
|
1130
|
+
null,
|
|
1131
|
+
h(
|
|
1132
|
+
'a',
|
|
1133
|
+
{ href: `https://${spaceHost(env, ask.app.space)}/${ask.app.slug}/` },
|
|
1134
|
+
`Back to ${ask.app.title}`,
|
|
1135
|
+
),
|
|
1136
|
+
),
|
|
1137
|
+
)
|
|
1138
|
+
}
|
|
1139
|
+
|
|
1140
|
+
let friendsAccess = (apps: Grantee[], action: string) =>
|
|
1141
|
+
h(
|
|
1142
|
+
Card,
|
|
1143
|
+
null,
|
|
1144
|
+
heading('Friends access'),
|
|
1145
|
+
apps.map((app) =>
|
|
1146
|
+
h(
|
|
1147
|
+
Card.Sub,
|
|
1148
|
+
{ key: app.eid },
|
|
1149
|
+
app.title,
|
|
1150
|
+
granting(action, app, FRIENDS_ACCESS, 'source-revoke', 'Remove access'),
|
|
1151
|
+
)
|
|
1152
|
+
),
|
|
1153
|
+
)
|
|
1154
|
+
|
|
1155
|
+
// What a server waiting on its credential offers: a box for its key, or a
|
|
1156
|
+
// button that starts its sign-in (`signin` on its connection).
|
|
1157
|
+
let mcpCredential = (
|
|
1158
|
+
s: McpPage['servers'][number],
|
|
1159
|
+
on: boolean,
|
|
1160
|
+
action: string,
|
|
1161
|
+
redirect?: string,
|
|
1162
|
+
) => {
|
|
1163
|
+
if (s.status != 'needed' && s.status != 'broken') return null
|
|
1164
|
+
if (s.keyed) {
|
|
1165
|
+
return on
|
|
1166
|
+
? h(
|
|
1167
|
+
ConnectionForm,
|
|
1168
|
+
{ method: 'post', action },
|
|
1169
|
+
held('server', s.id),
|
|
1170
|
+
labeled(
|
|
1171
|
+
`mcp-header-${s.id}`,
|
|
1172
|
+
'Header',
|
|
1173
|
+
h(Field, {
|
|
1174
|
+
id: `mcp-header-${s.id}`,
|
|
1175
|
+
name: 'header',
|
|
1176
|
+
value: s.header ?? '',
|
|
1177
|
+
placeholder: 'Authorization',
|
|
1178
|
+
}),
|
|
1179
|
+
'The header its key goes in, such as X-API-Key. Left empty, it is sent as a bearer token.',
|
|
1180
|
+
),
|
|
1181
|
+
keyBox(`mcp-key-${s.id}`, 'Its key', press('mcp-key', 'Save', false)),
|
|
1182
|
+
)
|
|
1183
|
+
: h(Card.Sub, null, 'Saving connection keys is currently unavailable.')
|
|
1184
|
+
}
|
|
1185
|
+
return s.connection
|
|
1186
|
+
? [
|
|
1187
|
+
h(
|
|
1188
|
+
ConnectionForm,
|
|
1189
|
+
{ method: 'post', action },
|
|
1190
|
+
held('connection', s.connection),
|
|
1191
|
+
h(Form.Actions, null, press('signin', `Sign in to ${s.name}`, false)),
|
|
1192
|
+
),
|
|
1193
|
+
on ? mcpClient(s, action, redirect) : null,
|
|
1194
|
+
]
|
|
1195
|
+
: null
|
|
1196
|
+
}
|
|
1197
|
+
|
|
1198
|
+
// A box for the OAuth client a server signs in as, for a server that takes
|
|
1199
|
+
// only clients it knows: one made in its developer portal.
|
|
1200
|
+
let mcpClient = (
|
|
1201
|
+
s: McpPage['servers'][number],
|
|
1202
|
+
action: string,
|
|
1203
|
+
redirect?: string,
|
|
1204
|
+
) =>
|
|
1205
|
+
h(
|
|
1206
|
+
More,
|
|
1207
|
+
null,
|
|
1208
|
+
h(More.Summary, null, 'Sign in with your own OAuth client'),
|
|
1209
|
+
h(
|
|
1210
|
+
More.Body,
|
|
1211
|
+
null,
|
|
1212
|
+
h(
|
|
1213
|
+
ConnectionForm,
|
|
1214
|
+
{ method: 'post', action },
|
|
1215
|
+
held('server', s.id),
|
|
1216
|
+
labeled(
|
|
1217
|
+
`mcp-client-${s.id}`,
|
|
1218
|
+
'Client id',
|
|
1219
|
+
h(Field, {
|
|
1220
|
+
id: `mcp-client-${s.id}`,
|
|
1221
|
+
placeholder: 'Paste the ID from your provider',
|
|
1222
|
+
name: 'client_id',
|
|
1223
|
+
required: true,
|
|
1224
|
+
}),
|
|
1225
|
+
),
|
|
1226
|
+
labeled(
|
|
1227
|
+
`mcp-client-secret-${s.id}`,
|
|
1228
|
+
'Client secret',
|
|
1229
|
+
h(Field, {
|
|
1230
|
+
id: `mcp-client-secret-${s.id}`,
|
|
1231
|
+
placeholder: 'Paste the secret from your provider',
|
|
1232
|
+
name: 'client_secret',
|
|
1233
|
+
type: 'password',
|
|
1234
|
+
autocomplete: 'off',
|
|
1235
|
+
}),
|
|
1236
|
+
`Its redirect URI is ${redirect}. The secret is kept in the vault and never shown again.`,
|
|
1237
|
+
),
|
|
1238
|
+
h(Form.Actions, null, press('mcp-client', 'Save', false)),
|
|
1239
|
+
),
|
|
1240
|
+
),
|
|
1241
|
+
)
|
|
1242
|
+
|
|
1243
|
+
let mcpForm = (
|
|
1244
|
+
action: string,
|
|
1245
|
+
id: string,
|
|
1246
|
+
kids: Kids,
|
|
1247
|
+
part?: string,
|
|
1248
|
+
at: Record<string, unknown> = {},
|
|
1249
|
+
) =>
|
|
1250
|
+
h(
|
|
1251
|
+
ConnectionForm,
|
|
1252
|
+
{ method: 'post', action, className: part, ...at },
|
|
1253
|
+
held('server', id),
|
|
1254
|
+
kids,
|
|
1255
|
+
)
|
|
1256
|
+
|
|
1257
|
+
let mcpKey = (s: McpPage['servers'][number]) => `mcp:${s.id}`
|
|
1258
|
+
|
|
1259
|
+
let mcpStatus = (s: McpPage['servers'][number]) =>
|
|
1260
|
+
s.trashed
|
|
1261
|
+
? status('In trash')
|
|
1262
|
+
: s.enabled
|
|
1263
|
+
? status(...MCP_STATE[s.status])
|
|
1264
|
+
: status('Off')
|
|
1265
|
+
|
|
1266
|
+
// A tool a server offers, which a person may allow.
|
|
1267
|
+
type Tool = NonNullable<NonNullable<McpPage['tools']>['list']>[number]
|
|
1268
|
+
|
|
1269
|
+
let mcpLine = (s: McpPage['servers'][number]) =>
|
|
1270
|
+
s.machine ? `${s.url} on your machine` : s.url
|
|
1271
|
+
|
|
1272
|
+
let mcpDetails = (
|
|
1273
|
+
s: McpPage['servers'][number],
|
|
1274
|
+
m: McpPage,
|
|
1275
|
+
on: boolean,
|
|
1276
|
+
action: string,
|
|
1277
|
+
chooseTools: string,
|
|
1278
|
+
alternative: string | undefined,
|
|
1279
|
+
close: Record<string, unknown>,
|
|
1280
|
+
actions: Actions,
|
|
1281
|
+
) => {
|
|
1282
|
+
let form = (kids: Kids, part?: string) => mcpForm(action, s.id, kids, part)
|
|
1283
|
+
// An action's own form, which its menu sends too.
|
|
1284
|
+
let sending = (a: Action | undefined, kids: Kids, part?: string) =>
|
|
1285
|
+
a?.submits ? mcpForm(action, s.id, kids, part, { id: a.submits }) : null
|
|
1286
|
+
let { power, share, remove, restore } = actions
|
|
1287
|
+
let tools = () => {
|
|
1288
|
+
let t = m.tools?.server == s.id ? m.tools : undefined
|
|
1289
|
+
if (!t) {
|
|
1290
|
+
return h(Button, { href: chooseTools, mod: 'quiet' }, 'Choose its tools')
|
|
1291
|
+
}
|
|
1292
|
+
return h(Answer<Tool>, {
|
|
1293
|
+
answered: {
|
|
1294
|
+
rows: t.list ?? [],
|
|
1295
|
+
ready: true,
|
|
1296
|
+
refused: t.failed && 'Refresh the page to try again.',
|
|
1297
|
+
},
|
|
1298
|
+
empty: 'This server offers no tools',
|
|
1299
|
+
failed: 'The tools could not load.',
|
|
1300
|
+
children: (list) => toolsForm(list),
|
|
1301
|
+
})
|
|
1302
|
+
}
|
|
1303
|
+
let toolsForm = (list: Tool[]) =>
|
|
1304
|
+
form([
|
|
1305
|
+
h(Card.Sub, null, 'The tools your agents and apps may use:'),
|
|
1306
|
+
list.map((tool) =>
|
|
1307
|
+
h(
|
|
1308
|
+
Check,
|
|
1309
|
+
null,
|
|
1310
|
+
h(Check.Input, {
|
|
1311
|
+
type: 'checkbox',
|
|
1312
|
+
name: 'tool',
|
|
1313
|
+
value: tool.name,
|
|
1314
|
+
checked: tool.allowed,
|
|
1315
|
+
}),
|
|
1316
|
+
tool.title,
|
|
1317
|
+
tool.description ? h(Check.Note, null, ` ${tool.description}`) : null,
|
|
1318
|
+
)
|
|
1319
|
+
),
|
|
1320
|
+
h(Form.Actions, null, press('mcp-tools', 'Save tools', false)),
|
|
1321
|
+
])
|
|
1322
|
+
let head = h(Modal.Head, {
|
|
1323
|
+
title: s.name,
|
|
1324
|
+
mark: logo(s),
|
|
1325
|
+
status: mcpStatus(s),
|
|
1326
|
+
close,
|
|
1327
|
+
})
|
|
1328
|
+
if (s.trashed) {
|
|
1329
|
+
return h(
|
|
1330
|
+
Modal.Body,
|
|
1331
|
+
null,
|
|
1332
|
+
head,
|
|
1333
|
+
h(
|
|
1334
|
+
Modal.Main,
|
|
1335
|
+
null,
|
|
1336
|
+
h(Card.Sub, null, mcpLine(s)),
|
|
1337
|
+
restore
|
|
1338
|
+
? sending(restore, h(Form.Actions, null, pressed(restore, false)))
|
|
1339
|
+
: null,
|
|
1340
|
+
),
|
|
1341
|
+
)
|
|
1342
|
+
}
|
|
1343
|
+
return h(
|
|
1344
|
+
Modal.Body,
|
|
1345
|
+
null,
|
|
1346
|
+
head,
|
|
1347
|
+
h(
|
|
1348
|
+
Modal.Main,
|
|
1349
|
+
null,
|
|
1350
|
+
h(
|
|
1351
|
+
Modal.Actions,
|
|
1352
|
+
{ 'aria-label': 'Actions' },
|
|
1353
|
+
power ? sending(power, pressed(power), 'Card_Form') : null,
|
|
1354
|
+
remove ? sending(remove, pressed(remove), 'Card_Form') : null,
|
|
1355
|
+
),
|
|
1356
|
+
h(Card.Sub, null, mcpLine(s)),
|
|
1357
|
+
s.machine ? null : h(
|
|
1358
|
+
Card.Sub,
|
|
1359
|
+
{ as: 'div' },
|
|
1360
|
+
s.everyone
|
|
1361
|
+
? 'The space Operator uses your sign-in or key when working with anyone in the space. '
|
|
1362
|
+
: 'The space Operator uses the MCP server only when working with you. ',
|
|
1363
|
+
share ? sending(share, pressed(share), 'Card_Form') : null,
|
|
1364
|
+
),
|
|
1365
|
+
s.header
|
|
1366
|
+
? h(Card.Sub, null, `Its key goes in the ${s.header} header.`)
|
|
1367
|
+
: null,
|
|
1368
|
+
mcpCredential(s, on, action, m.redirect),
|
|
1369
|
+
s.alternative
|
|
1370
|
+
? h(
|
|
1371
|
+
Notice,
|
|
1372
|
+
null,
|
|
1373
|
+
'This MCP server cannot sign in through yaks.app. ',
|
|
1374
|
+
alternative
|
|
1375
|
+
? h('a', { href: alternative }, `Open ${s.alternative.title}`)
|
|
1376
|
+
: null,
|
|
1377
|
+
)
|
|
1378
|
+
: s.enabled
|
|
1379
|
+
? tools()
|
|
1380
|
+
: null,
|
|
1381
|
+
h(
|
|
1382
|
+
More,
|
|
1383
|
+
null,
|
|
1384
|
+
h(More.Summary, null, 'Rename'),
|
|
1385
|
+
h(
|
|
1386
|
+
More.Body,
|
|
1387
|
+
null,
|
|
1388
|
+
form(
|
|
1389
|
+
h(
|
|
1390
|
+
Form.Line,
|
|
1391
|
+
null,
|
|
1392
|
+
h(Field, {
|
|
1393
|
+
name: 'name',
|
|
1394
|
+
value: s.name,
|
|
1395
|
+
required: true,
|
|
1396
|
+
'aria-label': 'Name',
|
|
1397
|
+
placeholder: 'e.g. Calendar tools',
|
|
1398
|
+
}),
|
|
1399
|
+
press('mcp-name', 'Rename', false),
|
|
1400
|
+
),
|
|
1401
|
+
),
|
|
1402
|
+
),
|
|
1403
|
+
),
|
|
1404
|
+
s.apps.map((a) =>
|
|
1405
|
+
h(
|
|
1406
|
+
Card.Sub,
|
|
1407
|
+
null,
|
|
1408
|
+
`Used by ${a.title} `,
|
|
1409
|
+
granting(action, a, `mcp:${s.id}`, 'source-revoke', 'Stop'),
|
|
1410
|
+
)
|
|
1411
|
+
),
|
|
1412
|
+
),
|
|
1413
|
+
)
|
|
1414
|
+
}
|
|
1415
|
+
|
|
1416
|
+
let addMcp = (on: boolean, action: string, redirect?: string) =>
|
|
1417
|
+
h(
|
|
1418
|
+
ConnectionForm,
|
|
1419
|
+
{ method: 'post', action },
|
|
1420
|
+
held('do', 'mcp-add'),
|
|
1421
|
+
labeled(
|
|
1422
|
+
'mcp-url',
|
|
1423
|
+
'Address',
|
|
1424
|
+
h(Field, {
|
|
1425
|
+
id: 'mcp-url',
|
|
1426
|
+
name: 'url',
|
|
1427
|
+
inputmode: 'url',
|
|
1428
|
+
autocomplete: 'off',
|
|
1429
|
+
spellcheck: 'false',
|
|
1430
|
+
required: true,
|
|
1431
|
+
placeholder: 'https://example.com/mcp',
|
|
1432
|
+
}),
|
|
1433
|
+
'yaks.app names the server and checks whether the server requires a sign-in or key.',
|
|
1434
|
+
),
|
|
1435
|
+
labeled(
|
|
1436
|
+
'mcp-for-everyone',
|
|
1437
|
+
'Who can use the server through the space Operator',
|
|
1438
|
+
[
|
|
1439
|
+
[
|
|
1440
|
+
'everyone',
|
|
1441
|
+
'Everyone the Operator works with, using your sign-in or key',
|
|
1442
|
+
],
|
|
1443
|
+
['me', 'Only me'],
|
|
1444
|
+
].map(([value, label]) =>
|
|
1445
|
+
h(
|
|
1446
|
+
Check,
|
|
1447
|
+
null,
|
|
1448
|
+
h(Check.Input, {
|
|
1449
|
+
type: 'radio',
|
|
1450
|
+
name: 'for',
|
|
1451
|
+
id: `mcp-for-${value}`,
|
|
1452
|
+
value,
|
|
1453
|
+
}),
|
|
1454
|
+
label,
|
|
1455
|
+
)
|
|
1456
|
+
),
|
|
1457
|
+
'Left unchosen: only you for a server you sign in to, everyone for one that takes a key or nothing.',
|
|
1458
|
+
),
|
|
1459
|
+
h(
|
|
1460
|
+
More,
|
|
1461
|
+
null,
|
|
1462
|
+
h(More.Summary, null, 'Advanced'),
|
|
1463
|
+
h(
|
|
1464
|
+
More.Body,
|
|
1465
|
+
null,
|
|
1466
|
+
labeled(
|
|
1467
|
+
'mcp-name',
|
|
1468
|
+
'Name',
|
|
1469
|
+
h(Field, {
|
|
1470
|
+
id: 'mcp-name',
|
|
1471
|
+
name: 'name',
|
|
1472
|
+
placeholder: 'e.g. Calendar tools',
|
|
1473
|
+
}),
|
|
1474
|
+
'Leave blank to use the server’s name or hostname.',
|
|
1475
|
+
),
|
|
1476
|
+
labeled(
|
|
1477
|
+
'mcp-client',
|
|
1478
|
+
'OAuth client id',
|
|
1479
|
+
h(Field, {
|
|
1480
|
+
id: 'mcp-client',
|
|
1481
|
+
name: 'client_id',
|
|
1482
|
+
placeholder: 'Paste the ID from your provider',
|
|
1483
|
+
}),
|
|
1484
|
+
`For a server you sign in to that registers no client for yaks.app: one made in its developer portal, with the redirect URI ${redirect}.`,
|
|
1485
|
+
),
|
|
1486
|
+
on
|
|
1487
|
+
? labeled(
|
|
1488
|
+
'mcp-client-secret',
|
|
1489
|
+
'OAuth client secret',
|
|
1490
|
+
h(Field, {
|
|
1491
|
+
id: 'mcp-client-secret',
|
|
1492
|
+
placeholder: 'Paste the secret from your provider',
|
|
1493
|
+
name: 'client_secret',
|
|
1494
|
+
type: 'password',
|
|
1495
|
+
autocomplete: 'off',
|
|
1496
|
+
}),
|
|
1497
|
+
'Kept in the vault and never shown again.',
|
|
1498
|
+
)
|
|
1499
|
+
: null,
|
|
1500
|
+
on
|
|
1501
|
+
? labeled(
|
|
1502
|
+
'mcp-key',
|
|
1503
|
+
'Key',
|
|
1504
|
+
h(Field, {
|
|
1505
|
+
id: 'mcp-key',
|
|
1506
|
+
placeholder: 'Paste the server’s access key',
|
|
1507
|
+
name: 'key',
|
|
1508
|
+
type: 'password',
|
|
1509
|
+
autocomplete: 'off',
|
|
1510
|
+
}),
|
|
1511
|
+
'Enter the header for the server’s key. Leave blank to let yaks.app check whether the server requires a key.',
|
|
1512
|
+
)
|
|
1513
|
+
: null,
|
|
1514
|
+
labeled(
|
|
1515
|
+
'mcp-header',
|
|
1516
|
+
'Header',
|
|
1517
|
+
h(Field, {
|
|
1518
|
+
id: 'mcp-header',
|
|
1519
|
+
name: 'header',
|
|
1520
|
+
placeholder: 'Authorization',
|
|
1521
|
+
}),
|
|
1522
|
+
'The header its key goes in, such as X-API-Key. Left empty, a key is sent as a bearer token.',
|
|
1523
|
+
),
|
|
1524
|
+
h(
|
|
1525
|
+
Check,
|
|
1526
|
+
null,
|
|
1527
|
+
h(Check.Input, {
|
|
1528
|
+
type: 'checkbox',
|
|
1529
|
+
name: 'machine',
|
|
1530
|
+
id: 'mcp-machine',
|
|
1531
|
+
value: 'here',
|
|
1532
|
+
}),
|
|
1533
|
+
'Connect to a server on the space’s machine through the tunnel. Enter the server path, such as /mcp. Only you can use the connection, and no key is required.',
|
|
1534
|
+
),
|
|
1535
|
+
),
|
|
1536
|
+
),
|
|
1537
|
+
h(
|
|
1538
|
+
Form.Actions,
|
|
1539
|
+
null,
|
|
1540
|
+
h(Button, { type: 'submit', mod: 'go' }, 'Add'),
|
|
1541
|
+
),
|
|
1542
|
+
)
|
|
1543
|
+
|
|
1544
|
+
let NEW_MCP = 'new:mcp'
|
|
1545
|
+
let CUSTOM_CONNECTION = 'new:custom'
|
|
1546
|
+
|
|
1547
|
+
/** Whether `c` holds what `opened` names, or was read for it: a dialog the
|
|
1548
|
+
* page draws without asking the server again. */
|
|
1549
|
+
export let holds = (c: Connections, opened: string): boolean =>
|
|
1550
|
+
opened == NEW_MCP || opened == CUSTOM_CONNECTION || c.open == opened ||
|
|
1551
|
+
c.list.some((one) => one.eid == opened || one.integration == opened) ||
|
|
1552
|
+
c.borrowed.some((b) => b.eid == opened) ||
|
|
1553
|
+
!!c.mcp?.servers.some((s) => mcpKey(s) == opened) ||
|
|
1554
|
+
c.services.some((s) => serviceKey(s.name) == opened) ||
|
|
1555
|
+
!!c.trash?.some((one) => retainedKey(one) == opened) ||
|
|
1556
|
+
[c.asked, ...c.built].some((i) => i?.name == opened)
|
|
1557
|
+
|
|
1558
|
+
// An MCP server's OAuth connection supplies its grant. The server owns its
|
|
1559
|
+
// card and dialog, including links from agents that name the credential.
|
|
1560
|
+
let serverOf = (c: Connections, one: Shown) =>
|
|
1561
|
+
c.mcp?.servers.find((s) =>
|
|
1562
|
+
s.connection == one.eid || mcpKey(s) == one.integration
|
|
1563
|
+
)
|
|
1564
|
+
let integrationsOf = (c: Connections) =>
|
|
1565
|
+
c.list.filter((one) => !serverOf(c, one))
|
|
1566
|
+
// A connection's dialog is named by its service, or by its eid when the
|
|
1567
|
+
// space holds more than one of that service.
|
|
1568
|
+
let keyIn = (integrations: Shown[], one: Shown) =>
|
|
1569
|
+
integrations.filter((c) => c.integration == one.integration).length > 1
|
|
1570
|
+
? one.eid
|
|
1571
|
+
: one.integration
|
|
1572
|
+
// A detail read can carry a catalog description of a service the page
|
|
1573
|
+
// already holds. Its link opens the connection with its own controls.
|
|
1574
|
+
let offersOf = (c: Connections) => {
|
|
1575
|
+
let names = new Set(c.list.map((one) => one.integration))
|
|
1576
|
+
return [c.asked, ...c.built].filter((i): i is Offered =>
|
|
1577
|
+
!!i && !names.has(i.name)
|
|
1578
|
+
)
|
|
1579
|
+
}
|
|
1580
|
+
|
|
1581
|
+
/** Which of the dialog's bodies `opened` shows, by its `data-key`, and what
|
|
1582
|
+
* the dialog is called while it shows it: what a press opens without
|
|
1583
|
+
* drawing the page again (./connections-browser.ts). The page has no such
|
|
1584
|
+
* body when `opened` is something `c` does not hold. */
|
|
1585
|
+
export let chosen = (
|
|
1586
|
+
c: Connections,
|
|
1587
|
+
opened: string | null,
|
|
1588
|
+
): { key: string | null; label: string } => {
|
|
1589
|
+
let integrations = integrationsOf(c)
|
|
1590
|
+
let open = opened
|
|
1591
|
+
? c.list.find((one) => one.eid == opened || one.integration == opened)
|
|
1592
|
+
: undefined
|
|
1593
|
+
let offered = opened ? offersOf(c).find((i) => i.name == opened) : undefined
|
|
1594
|
+
let server = c.mcp?.servers.find((s) => mcpKey(s) == opened) ??
|
|
1595
|
+
(open && serverOf(c, open))
|
|
1596
|
+
let key = server
|
|
1597
|
+
? mcpKey(server)
|
|
1598
|
+
: offered?.name ?? (open && keyIn(integrations, open)) ??
|
|
1599
|
+
(opened && c.borrowed.find((b) => b.eid == opened)?.eid) ?? opened
|
|
1600
|
+
return {
|
|
1601
|
+
key,
|
|
1602
|
+
label: offered
|
|
1603
|
+
? `Connect ${offered.face.title}`
|
|
1604
|
+
: key == NEW_MCP
|
|
1605
|
+
? 'Add an MCP server'
|
|
1606
|
+
: key == CUSTOM_CONNECTION
|
|
1607
|
+
? 'Add an API key'
|
|
1608
|
+
: 'Manage connection',
|
|
1609
|
+
}
|
|
1610
|
+
}
|
|
1611
|
+
|
|
1612
|
+
/** The Connections page of `view`'s space, drawn from `c`, its one dialog
|
|
1613
|
+
* showing what `opened` names: a connection by its eid or its service's name,
|
|
1614
|
+
* a loan, an MCP server (`mcp:<id>`), or a service to connect; by default
|
|
1615
|
+
* what the row was read for (`c.open`, or the service it was asked to add).
|
|
1616
|
+
* The dialog shows loading while the page reads a detail. If that read finds
|
|
1617
|
+
* nothing, the page says so beside the list. */
|
|
1618
|
+
export let connectionsView = (
|
|
1619
|
+
view: ConnectionsView,
|
|
1620
|
+
c: Connections,
|
|
1621
|
+
opened: string | null = c.open ?? c.asked?.name ?? null,
|
|
1622
|
+
) => {
|
|
1623
|
+
let { env } = view
|
|
1624
|
+
let inspection = view.inspection
|
|
1625
|
+
let at = { space: view.space.slug, spaces: view.spaces }
|
|
1626
|
+
let host = spaceHost(env, at.space)
|
|
1627
|
+
let context = new URL(
|
|
1628
|
+
enabling(inspection ?? managePath('connections', at.space), c.enable),
|
|
1629
|
+
'https://page.invalid',
|
|
1630
|
+
)
|
|
1631
|
+
let asked = new URLSearchParams(view.ask)
|
|
1632
|
+
let q = asked.get('q') ?? ''
|
|
1633
|
+
let mcp = asked.get('mcp')
|
|
1634
|
+
if (!opened && mcp) opened = `mcp:${mcp}`
|
|
1635
|
+
if (q) context.searchParams.set('q', q)
|
|
1636
|
+
let trashOpen = asked.has('trash')
|
|
1637
|
+
let pathOf = (to: URL) => `${to.pathname}${to.search}`
|
|
1638
|
+
let opening = (path: string, key: string) => {
|
|
1639
|
+
if (!inspection) return openedOn(path, key)
|
|
1640
|
+
let to = new URL(path, context)
|
|
1641
|
+
to.searchParams.set('detail', key)
|
|
1642
|
+
return pathOf(to)
|
|
1643
|
+
}
|
|
1644
|
+
let ordinary = pathOf(context)
|
|
1645
|
+
context.searchParams.set('trash', '1')
|
|
1646
|
+
let withTrash = pathOf(context)
|
|
1647
|
+
let action = trashOpen ? withTrash : ordinary
|
|
1648
|
+
let closing = inspection ? action : `${action}#`
|
|
1649
|
+
// The service the page was opened to add: a key to paste, or a sign-in to
|
|
1650
|
+
// start, and which space it goes to.
|
|
1651
|
+
let close = {
|
|
1652
|
+
href: closing,
|
|
1653
|
+
'data-modal-close': '',
|
|
1654
|
+
autofocus: true,
|
|
1655
|
+
}
|
|
1656
|
+
let offer = (i: Offered) =>
|
|
1657
|
+
h(Modal.Body, null, [
|
|
1658
|
+
h(Modal.Head, {
|
|
1659
|
+
title: `Connect ${i.face.title}`,
|
|
1660
|
+
mark: logo(i.face, env),
|
|
1661
|
+
close,
|
|
1662
|
+
}),
|
|
1663
|
+
detail(i.face, i.keyed),
|
|
1664
|
+
to(true, inspection ? undefined : addTo(i.name)),
|
|
1665
|
+
i.available === false
|
|
1666
|
+
? [
|
|
1667
|
+
h(
|
|
1668
|
+
Notice,
|
|
1669
|
+
null,
|
|
1670
|
+
`${i.face.title} connections are currently unavailable.`,
|
|
1671
|
+
),
|
|
1672
|
+
h(Button, { type: 'button', disabled: true }, 'Connect'),
|
|
1673
|
+
]
|
|
1674
|
+
: h(
|
|
1675
|
+
ConnectionForm,
|
|
1676
|
+
{
|
|
1677
|
+
method: 'post',
|
|
1678
|
+
action,
|
|
1679
|
+
...i.keyed && {
|
|
1680
|
+
'data-key': `add-${i.name}`,
|
|
1681
|
+
'data-save': `add-${i.name}`,
|
|
1682
|
+
'data-save-reset': '',
|
|
1683
|
+
},
|
|
1684
|
+
},
|
|
1685
|
+
held('integration', i.name),
|
|
1686
|
+
howTo(i.face, true),
|
|
1687
|
+
i.keyed
|
|
1688
|
+
? [held('do', 'add'), credentialFields(i.face, `add-${i.name}`)]
|
|
1689
|
+
: h(Form.Actions, null, signingIn(i.face, 'Connect', 'add')),
|
|
1690
|
+
),
|
|
1691
|
+
// A service with its own MCP server is signed in to there, as a server
|
|
1692
|
+
// this space connects (@yaks/connections/mcp), its tools the person's.
|
|
1693
|
+
i.face.mcp && i.available !== false
|
|
1694
|
+
? h(
|
|
1695
|
+
ConnectionForm,
|
|
1696
|
+
{ method: 'post', action },
|
|
1697
|
+
held('url', i.face.mcp),
|
|
1698
|
+
h(
|
|
1699
|
+
Form.Actions,
|
|
1700
|
+
null,
|
|
1701
|
+
signingIn(
|
|
1702
|
+
i.face,
|
|
1703
|
+
`Sign in with your ${i.face.title} account`,
|
|
1704
|
+
'mcp-add',
|
|
1705
|
+
i.keyed,
|
|
1706
|
+
),
|
|
1707
|
+
),
|
|
1708
|
+
)
|
|
1709
|
+
: null,
|
|
1710
|
+
])
|
|
1711
|
+
let add = h(
|
|
1712
|
+
ConnectionForm,
|
|
1713
|
+
{
|
|
1714
|
+
method: 'post',
|
|
1715
|
+
action,
|
|
1716
|
+
'data-key': 'new-api-key',
|
|
1717
|
+
'data-save': 'new-api-key',
|
|
1718
|
+
'data-save-reset': '',
|
|
1719
|
+
},
|
|
1720
|
+
held('do', 'add'),
|
|
1721
|
+
fieldsOf(
|
|
1722
|
+
labeled(
|
|
1723
|
+
'new-name',
|
|
1724
|
+
'Name',
|
|
1725
|
+
h(Field, {
|
|
1726
|
+
id: 'new-name',
|
|
1727
|
+
name: 'integration',
|
|
1728
|
+
maxlength: 60,
|
|
1729
|
+
placeholder: 'Weather API',
|
|
1730
|
+
required: true,
|
|
1731
|
+
}),
|
|
1732
|
+
),
|
|
1733
|
+
labeled(
|
|
1734
|
+
'new-hosts',
|
|
1735
|
+
'API addresses',
|
|
1736
|
+
h(Field, {
|
|
1737
|
+
id: 'new-hosts',
|
|
1738
|
+
name: 'hosts',
|
|
1739
|
+
autocomplete: 'off',
|
|
1740
|
+
spellcheck: 'false',
|
|
1741
|
+
placeholder: 'api.example.com',
|
|
1742
|
+
required: true,
|
|
1743
|
+
}),
|
|
1744
|
+
'Enter the addresses from the API documentation. The API key is sent only to these addresses.',
|
|
1745
|
+
),
|
|
1746
|
+
labeled(
|
|
1747
|
+
'new-key',
|
|
1748
|
+
'API key',
|
|
1749
|
+
h(Field, {
|
|
1750
|
+
id: 'new-key',
|
|
1751
|
+
placeholder: 'Paste your API key',
|
|
1752
|
+
name: 'key',
|
|
1753
|
+
type: 'password',
|
|
1754
|
+
autocomplete: 'off',
|
|
1755
|
+
spellcheck: 'false',
|
|
1756
|
+
required: true,
|
|
1757
|
+
}),
|
|
1758
|
+
),
|
|
1759
|
+
labeled(
|
|
1760
|
+
'new-instructions',
|
|
1761
|
+
optional('How to get an API key'),
|
|
1762
|
+
h(Field, {
|
|
1763
|
+
lines: true,
|
|
1764
|
+
id: 'new-instructions',
|
|
1765
|
+
name: 'instructions',
|
|
1766
|
+
placeholder: 'Where to find the API key',
|
|
1767
|
+
}),
|
|
1768
|
+
),
|
|
1769
|
+
h(Save.Slot, { label: 'Save' }),
|
|
1770
|
+
),
|
|
1771
|
+
)
|
|
1772
|
+
// What the space holds already that could replace a loan: a connected
|
|
1773
|
+
// connection through the same service.
|
|
1774
|
+
let mine = (b: Borrowed) =>
|
|
1775
|
+
c.list.find((one) =>
|
|
1776
|
+
!one.own && one.integration == b.integration &&
|
|
1777
|
+
one.status == 'connected' && !one.failed && !one.each
|
|
1778
|
+
)
|
|
1779
|
+
let servers = c.mcp?.servers ?? []
|
|
1780
|
+
let integrations = integrationsOf(c)
|
|
1781
|
+
// What agents asked for and nobody connected: an app's ask, never the
|
|
1782
|
+
// space's side of an ask each person answers with their own.
|
|
1783
|
+
let working = (one: Shown) => one.status == 'connected' && !one.failed
|
|
1784
|
+
let started = (one: Shown) => one.status == 'needed' && !one.own && !one.each
|
|
1785
|
+
let asks = integrations.filter((one) => started(one) && one.apps.length)
|
|
1786
|
+
let pending = integrations.filter((one) => started(one) && !one.apps.length)
|
|
1787
|
+
// Within a group, one that needs reconnecting comes before the connected.
|
|
1788
|
+
let rest = integrations.filter((one) => !started(one))
|
|
1789
|
+
.toSorted((a, b) => +working(a) - +working(b))
|
|
1790
|
+
let keyOf = (one: Shown) => keyIn(integrations, one)
|
|
1791
|
+
let manage = (key: string) => opening(action, key)
|
|
1792
|
+
// What can be done with each item, declared once beside what it is: its
|
|
1793
|
+
// card's menu and its dialog's buttons are drawn from the same.
|
|
1794
|
+
let ofConnection = (one: Shown) =>
|
|
1795
|
+
connectionActions(one, keyOf(one), manage(keyOf(one)))
|
|
1796
|
+
let ofBorrowed = (b: Borrowed) =>
|
|
1797
|
+
borrowedActions(b, b.eid, manage(b.eid), c.on, mine(b))
|
|
1798
|
+
let ofServer = (s: McpPage['servers'][number]) =>
|
|
1799
|
+
serverActions(s, mcpKey(s), manage(mcpKey(s)))
|
|
1800
|
+
let ofRetained = (one: Retained) =>
|
|
1801
|
+
retainedActions(one, at.space, retainedKey(one), manage(retainedKey(one)))
|
|
1802
|
+
let opens = (label: string, href: string): Actions => ({
|
|
1803
|
+
open: { label, href },
|
|
1804
|
+
})
|
|
1805
|
+
let shown = (one: Shown) =>
|
|
1806
|
+
card(
|
|
1807
|
+
env,
|
|
1808
|
+
one.face,
|
|
1809
|
+
one.each && !one.own
|
|
1810
|
+
? `Each person connects their own, from ${
|
|
1811
|
+
one.apps.map((a) => a.title).join(', ') || 'the app'
|
|
1812
|
+
}.`
|
|
1813
|
+
: one.lacking.length && reconnects(one)
|
|
1814
|
+
? FULLER
|
|
1815
|
+
: one.apps.length
|
|
1816
|
+
? `For ${one.apps.map((a) => a.title).join(', ')}`
|
|
1817
|
+
: one.face.tagline,
|
|
1818
|
+
keyOf(one),
|
|
1819
|
+
ofConnection(one),
|
|
1820
|
+
status(
|
|
1821
|
+
one.failed
|
|
1822
|
+
? 'Not saved'
|
|
1823
|
+
: one.each && !one.own
|
|
1824
|
+
? 'Each person connects their own'
|
|
1825
|
+
: STATUS[one.status],
|
|
1826
|
+
one.each && !one.own
|
|
1827
|
+
? undefined
|
|
1828
|
+
: one.status == 'connected' && !one.failed
|
|
1829
|
+
? 'positive'
|
|
1830
|
+
: 'negative',
|
|
1831
|
+
),
|
|
1832
|
+
)
|
|
1833
|
+
let grid = (cards: Kids[]) => cards.length ? h(Cards, null, cards) : null
|
|
1834
|
+
let group = (title: Kids, ...kids: Kids[]) =>
|
|
1835
|
+
kids.some(Boolean) ? h(Stack, null, h(Group, null, title), kids) : null
|
|
1836
|
+
let yours = [
|
|
1837
|
+
...rest.filter((one) => one.own).map(shown),
|
|
1838
|
+
...c.services.map((s) =>
|
|
1839
|
+
card(
|
|
1840
|
+
env,
|
|
1841
|
+
serviceFace(s.name),
|
|
1842
|
+
serviceLine(s),
|
|
1843
|
+
serviceKey(s.name),
|
|
1844
|
+
opens('Open', manage(serviceKey(s.name))),
|
|
1845
|
+
status('Connected', 'positive'),
|
|
1846
|
+
)
|
|
1847
|
+
),
|
|
1848
|
+
]
|
|
1849
|
+
|
|
1850
|
+
let here = [
|
|
1851
|
+
...rest.filter((one) => !one.own).map(shown),
|
|
1852
|
+
...c.borrowed.map((b) =>
|
|
1853
|
+
card(
|
|
1854
|
+
env,
|
|
1855
|
+
b.face,
|
|
1856
|
+
`${b.app.title} borrows ${b.lender}’s`,
|
|
1857
|
+
b.eid,
|
|
1858
|
+
ofBorrowed(b),
|
|
1859
|
+
status('Borrowed', 'positive'),
|
|
1860
|
+
)
|
|
1861
|
+
),
|
|
1862
|
+
]
|
|
1863
|
+
// The catalog: a search box over every service, what it found or the
|
|
1864
|
+
// featured ones, and the categories to look through.
|
|
1865
|
+
let cat = c.catalog
|
|
1866
|
+
let tile = (i: CatalogEntry) =>
|
|
1867
|
+
card(
|
|
1868
|
+
env,
|
|
1869
|
+
i,
|
|
1870
|
+
i.tagline,
|
|
1871
|
+
`catalog:${i.name}`,
|
|
1872
|
+
opens('Connect', opening(action, i.name)),
|
|
1873
|
+
)
|
|
1874
|
+
let finding = h(
|
|
1875
|
+
ConnectionForm,
|
|
1876
|
+
{
|
|
1877
|
+
method: 'get',
|
|
1878
|
+
action: context.pathname,
|
|
1879
|
+
role: 'search',
|
|
1880
|
+
'data-find': '',
|
|
1881
|
+
},
|
|
1882
|
+
inspection
|
|
1883
|
+
? [...new URL(inspection, context).searchParams.entries()]
|
|
1884
|
+
.map(([name, value]) => h(Form.Hidden, { key: name, name, value }))
|
|
1885
|
+
: null,
|
|
1886
|
+
c.enable?.length ? held('enable', c.enable.join(',')) : null,
|
|
1887
|
+
trashOpen ? held('trash', '1') : null,
|
|
1888
|
+
h(
|
|
1889
|
+
Form.Line,
|
|
1890
|
+
null,
|
|
1891
|
+
h(Field, {
|
|
1892
|
+
type: 'search',
|
|
1893
|
+
name: 'q',
|
|
1894
|
+
value: q,
|
|
1895
|
+
placeholder: 'Search connections',
|
|
1896
|
+
'aria-label': 'Search connections',
|
|
1897
|
+
autocomplete: 'off',
|
|
1898
|
+
}),
|
|
1899
|
+
h(Button, { type: 'submit' }, 'Search'),
|
|
1900
|
+
),
|
|
1901
|
+
)
|
|
1902
|
+
// A category opens the services of its kind, as a search for it.
|
|
1903
|
+
let browse = (k: { name: string; label: string }) => {
|
|
1904
|
+
let to = new URL(action, context)
|
|
1905
|
+
to.searchParams.set('q', k.name)
|
|
1906
|
+
return h(Chip, { key: k.name, href: pathOf(to) }, k.label)
|
|
1907
|
+
}
|
|
1908
|
+
// A search answers once the catalog has answered what was typed.
|
|
1909
|
+
let found = cat && (cat.q != q || cat.q)
|
|
1910
|
+
? h(Answer<CatalogEntry>, {
|
|
1911
|
+
answered: { rows: cat.q == q ? cat.found : [], ready: cat.q == q },
|
|
1912
|
+
empty: [
|
|
1913
|
+
h(Empty.Title, { key: 'title' }, `No connections match “${cat.q}”`),
|
|
1914
|
+
h('p', { key: 'add' }, 'You can add an API key below.'),
|
|
1915
|
+
],
|
|
1916
|
+
loading: 'Searching…',
|
|
1917
|
+
name: 'connection-search',
|
|
1918
|
+
children: (shown) => [
|
|
1919
|
+
h(
|
|
1920
|
+
Card.Sub,
|
|
1921
|
+
{ key: 'matched' },
|
|
1922
|
+
cat.matched > shown.length
|
|
1923
|
+
? `The first ${shown.length} of ${
|
|
1924
|
+
count(cat.matched)
|
|
1925
|
+
} connections matching “${cat.q}”.`
|
|
1926
|
+
: `${
|
|
1927
|
+
cat.matched == 1
|
|
1928
|
+
? 'One connection matches'
|
|
1929
|
+
: `${cat.matched} connections match`
|
|
1930
|
+
} “${cat.q}”.`,
|
|
1931
|
+
),
|
|
1932
|
+
h(Fragment, { key: 'found' }, grid(shown.map(tile))),
|
|
1933
|
+
],
|
|
1934
|
+
})
|
|
1935
|
+
: cat
|
|
1936
|
+
? [
|
|
1937
|
+
group('Featured', grid(cat.featured.map(tile))),
|
|
1938
|
+
group(
|
|
1939
|
+
'Categories',
|
|
1940
|
+
cat.kinds.length ? h(Chips, null, cat.kinds.map(browse)) : null,
|
|
1941
|
+
),
|
|
1942
|
+
]
|
|
1943
|
+
: null
|
|
1944
|
+
// The selected service says which space it goes to, in the space switcher
|
|
1945
|
+
// that offers the others.
|
|
1946
|
+
let current = at.spaces?.find((s) => s.slug == at.space)
|
|
1947
|
+
let owned = (at.spaces ?? []).filter((s) => s.owner)
|
|
1948
|
+
let spaceName = view.space.title || current?.title || at.space
|
|
1949
|
+
let to = (pending: boolean, other?: (slug: string) => string) => [
|
|
1950
|
+
h(
|
|
1951
|
+
Card.Sub,
|
|
1952
|
+
null,
|
|
1953
|
+
pending
|
|
1954
|
+
? `Available to apps in ${spaceName} once connected.`
|
|
1955
|
+
: `Connected for apps in ${spaceName}.`,
|
|
1956
|
+
),
|
|
1957
|
+
other && current && owned.length > 1
|
|
1958
|
+
? h(
|
|
1959
|
+
'div',
|
|
1960
|
+
{ className: 'Connect_Space' },
|
|
1961
|
+
choice(
|
|
1962
|
+
current,
|
|
1963
|
+
owned,
|
|
1964
|
+
(s) => other(s.slug),
|
|
1965
|
+
null,
|
|
1966
|
+
undefined,
|
|
1967
|
+
'Space for the connection',
|
|
1968
|
+
),
|
|
1969
|
+
)
|
|
1970
|
+
: null,
|
|
1971
|
+
]
|
|
1972
|
+
let addTo = (name: string) => (slug: string) =>
|
|
1973
|
+
openedOn(managePath('connections', slug), name)
|
|
1974
|
+
let contents = (one: Shown) =>
|
|
1975
|
+
connection(
|
|
1976
|
+
one,
|
|
1977
|
+
c.on,
|
|
1978
|
+
action,
|
|
1979
|
+
close,
|
|
1980
|
+
one.own ? null : to(one.status == 'needed'),
|
|
1981
|
+
env,
|
|
1982
|
+
ofConnection(one),
|
|
1983
|
+
menuId(keyOf(one)),
|
|
1984
|
+
)
|
|
1985
|
+
let serverTile = (s: McpPage['servers'][number]) =>
|
|
1986
|
+
card(
|
|
1987
|
+
env,
|
|
1988
|
+
serviceFace(s.name),
|
|
1989
|
+
mcpLine(s),
|
|
1990
|
+
mcpKey(s),
|
|
1991
|
+
ofServer(s),
|
|
1992
|
+
mcpStatus(s),
|
|
1993
|
+
)
|
|
1994
|
+
let serving = (s: McpPage['servers'][number]) => {
|
|
1995
|
+
let to = new URL(action, context)
|
|
1996
|
+
to.searchParams.set('mcp', s.id)
|
|
1997
|
+
return mcpDetails(
|
|
1998
|
+
s,
|
|
1999
|
+
c.mcp!,
|
|
2000
|
+
c.on,
|
|
2001
|
+
action,
|
|
2002
|
+
opening(pathOf(to), mcpKey(s)),
|
|
2003
|
+
s.alternative &&
|
|
2004
|
+
(c.list.some((i) => i.integration == s.alternative?.name) ||
|
|
2005
|
+
c.built.some((i) => i.name == s.alternative?.name))
|
|
2006
|
+
? opening(action, s.alternative.name)
|
|
2007
|
+
: undefined,
|
|
2008
|
+
close,
|
|
2009
|
+
ofServer(s),
|
|
2010
|
+
)
|
|
2011
|
+
}
|
|
2012
|
+
let offers = offersOf(c)
|
|
2013
|
+
let pick = chosen(c, opened)
|
|
2014
|
+
let additions: [string, ReactElement<Record<string, unknown>>][] = c.on
|
|
2015
|
+
? [
|
|
2016
|
+
[
|
|
2017
|
+
NEW_MCP,
|
|
2018
|
+
h(
|
|
2019
|
+
Modal.Body,
|
|
2020
|
+
null,
|
|
2021
|
+
h(Modal.Head, { title: 'Add an MCP server', close }),
|
|
2022
|
+
h(Modal.Main, null, addMcp(c.on, action, c.mcp?.redirect)),
|
|
2023
|
+
),
|
|
2024
|
+
],
|
|
2025
|
+
[
|
|
2026
|
+
CUSTOM_CONNECTION,
|
|
2027
|
+
h(
|
|
2028
|
+
Modal.Body,
|
|
2029
|
+
null,
|
|
2030
|
+
h(Modal.Head, { title: 'Add an API key', close }),
|
|
2031
|
+
h(Modal.Main, null, add),
|
|
2032
|
+
),
|
|
2033
|
+
],
|
|
2034
|
+
]
|
|
2035
|
+
: []
|
|
2036
|
+
let bodies: [string, ReactElement<Record<string, unknown>>][] = [
|
|
2037
|
+
...offers.map((
|
|
2038
|
+
i,
|
|
2039
|
+
): [string, ReactElement<Record<string, unknown>>] => [i.name, offer(i)]),
|
|
2040
|
+
...integrations.map((
|
|
2041
|
+
one,
|
|
2042
|
+
): [string, ReactElement<Record<string, unknown>>] => [
|
|
2043
|
+
keyOf(one),
|
|
2044
|
+
contents(one),
|
|
2045
|
+
]),
|
|
2046
|
+
...c.borrowed.map((b): [string, ReactElement<Record<string, unknown>>] => [
|
|
2047
|
+
b.eid,
|
|
2048
|
+
borrowing(b, env, c.on, action, close, ofBorrowed(b), mine(b)),
|
|
2049
|
+
]),
|
|
2050
|
+
...servers.map((s): [string, ReactElement<Record<string, unknown>>] => [
|
|
2051
|
+
mcpKey(s),
|
|
2052
|
+
serving(s),
|
|
2053
|
+
]),
|
|
2054
|
+
...c.services.map((s): [string, ReactElement<Record<string, unknown>>] => [
|
|
2055
|
+
serviceKey(s.name),
|
|
2056
|
+
h(
|
|
2057
|
+
Modal.Body,
|
|
2058
|
+
null,
|
|
2059
|
+
h(Modal.Head, {
|
|
2060
|
+
title: s.name,
|
|
2061
|
+
mark: logo(serviceFace(s.name), env),
|
|
2062
|
+
status: status('Connected', 'positive'),
|
|
2063
|
+
close,
|
|
2064
|
+
}),
|
|
2065
|
+
h(Modal.Main, null, h(Card.Sub, null, serviceLine(s))),
|
|
2066
|
+
),
|
|
2067
|
+
]),
|
|
2068
|
+
...(c.trash ?? []).map((
|
|
2069
|
+
one,
|
|
2070
|
+
): [string, ReactElement<Record<string, unknown>>] => {
|
|
2071
|
+
let { restore, erase } = ofRetained(one)
|
|
2072
|
+
return [
|
|
2073
|
+
retainedKey(one),
|
|
2074
|
+
h(
|
|
2075
|
+
Modal.Body,
|
|
2076
|
+
null,
|
|
2077
|
+
h(Modal.Head, {
|
|
2078
|
+
title: one.integration,
|
|
2079
|
+
mark: logo(serviceFace(one.integration), env),
|
|
2080
|
+
status: status('In trash'),
|
|
2081
|
+
close,
|
|
2082
|
+
}),
|
|
2083
|
+
h(
|
|
2084
|
+
Modal.Main,
|
|
2085
|
+
null,
|
|
2086
|
+
h(Card.Sub, null, retainedLine(one)),
|
|
2087
|
+
h(
|
|
2088
|
+
ConnectionForm,
|
|
2089
|
+
{ method: 'post', action, id: restore!.submits },
|
|
2090
|
+
held('retained', one.id),
|
|
2091
|
+
h(
|
|
2092
|
+
Form.Actions,
|
|
2093
|
+
null,
|
|
2094
|
+
pressed(restore!, false),
|
|
2095
|
+
pressed(erase!),
|
|
2096
|
+
),
|
|
2097
|
+
),
|
|
2098
|
+
),
|
|
2099
|
+
),
|
|
2100
|
+
]
|
|
2101
|
+
}),
|
|
2102
|
+
...additions,
|
|
2103
|
+
]
|
|
2104
|
+
if (opened && !holds(c, opened)) {
|
|
2105
|
+
bodies.push([
|
|
2106
|
+
opened,
|
|
2107
|
+
h(Modal.Body, null, [
|
|
2108
|
+
h(Modal.Head, { title: 'Connection details', close }),
|
|
2109
|
+
h(Loading, { state: 'connection', as: 'p' }, 'Loading connection…'),
|
|
2110
|
+
]),
|
|
2111
|
+
])
|
|
2112
|
+
}
|
|
2113
|
+
let selected = bodies.find(([k]) => k == pick.key)
|
|
2114
|
+
let showing = selected?.[0]
|
|
2115
|
+
let missing = opened && opened == c.open && !selected
|
|
2116
|
+
// Every body is kept in the page, showing only while opened, so what is
|
|
2117
|
+
// typed into one stays when it closes and its drafts are bound at once.
|
|
2118
|
+
let modal = h(
|
|
2119
|
+
Modal,
|
|
2120
|
+
{
|
|
2121
|
+
open: !!showing,
|
|
2122
|
+
'aria-modal': true,
|
|
2123
|
+
id: 'connect',
|
|
2124
|
+
'data-modal-key': showing,
|
|
2125
|
+
'aria-label': showing ? pick.label : 'Manage connection',
|
|
2126
|
+
},
|
|
2127
|
+
// Drawn while closed too, so a press opens a body without drawing the
|
|
2128
|
+
// dialog again.
|
|
2129
|
+
h(Modal.Backdrop, {
|
|
2130
|
+
href: closing,
|
|
2131
|
+
'data-modal-close': '',
|
|
2132
|
+
tabIndex: -1,
|
|
2133
|
+
'aria-label': 'Close connection details',
|
|
2134
|
+
}),
|
|
2135
|
+
bodies.map(([k, body]) =>
|
|
2136
|
+
cloneElement(body, {
|
|
2137
|
+
key: k,
|
|
2138
|
+
'data-key': k,
|
|
2139
|
+
'data-modal-key': k,
|
|
2140
|
+
hidden: body != selected?.[1],
|
|
2141
|
+
})
|
|
2142
|
+
),
|
|
2143
|
+
)
|
|
2144
|
+
let catalog = h(
|
|
2145
|
+
Stack,
|
|
2146
|
+
{ id: 'find' },
|
|
2147
|
+
h(Group, null, 'Available connections'),
|
|
2148
|
+
finding,
|
|
2149
|
+
c.on
|
|
2150
|
+
? group(
|
|
2151
|
+
'Other connections',
|
|
2152
|
+
grid([
|
|
2153
|
+
card(
|
|
2154
|
+
env,
|
|
2155
|
+
serviceFace('MCP server'),
|
|
2156
|
+
'Connect by its address',
|
|
2157
|
+
NEW_MCP,
|
|
2158
|
+
opens('Add', opening(action, NEW_MCP)),
|
|
2159
|
+
),
|
|
2160
|
+
card(
|
|
2161
|
+
env,
|
|
2162
|
+
serviceFace('API key'),
|
|
2163
|
+
'For a service that isn’t listed',
|
|
2164
|
+
CUSTOM_CONNECTION,
|
|
2165
|
+
opens('Add', opening(action, CUSTOM_CONNECTION)),
|
|
2166
|
+
),
|
|
2167
|
+
]),
|
|
2168
|
+
)
|
|
2169
|
+
: null,
|
|
2170
|
+
h(Stack, { 'data-found': '' }, found),
|
|
2171
|
+
)
|
|
2172
|
+
let liveServers = servers.filter((s) => !s.trashed)
|
|
2173
|
+
let trashedServers = servers.filter((s) => s.trashed)
|
|
2174
|
+
let content = h(
|
|
2175
|
+
Inspection.Provider,
|
|
2176
|
+
{ value: !!inspection },
|
|
2177
|
+
h(Stack, {
|
|
2178
|
+
inert: selected ? true : undefined,
|
|
2179
|
+
'data-connections': '',
|
|
2180
|
+
'data-bind-save': inspection ? undefined : '',
|
|
2181
|
+
}, [
|
|
2182
|
+
h(ErrorNotice, { 'data-connections-status': '' }),
|
|
2183
|
+
missing
|
|
2184
|
+
? h(
|
|
2185
|
+
ErrorNotice,
|
|
2186
|
+
{ 'data-connections-missing': '' },
|
|
2187
|
+
'The requested connection is unavailable. Choose a connection below.',
|
|
2188
|
+
)
|
|
2189
|
+
: null,
|
|
2190
|
+
c.plan ? full(view.space.slug, c.plan, !!inspection) : null,
|
|
2191
|
+
c.mcp?.ask ? sourceAsk(c.mcp.ask, action, env) : null,
|
|
2192
|
+
c.mcp?.friends?.length ? friendsAccess(c.mcp.friends, action) : null,
|
|
2193
|
+
c.on ? null : h(
|
|
2194
|
+
Card,
|
|
2195
|
+
null,
|
|
2196
|
+
heading('Connections are unavailable'),
|
|
2197
|
+
h(
|
|
2198
|
+
Card.Sub,
|
|
2199
|
+
null,
|
|
2200
|
+
'API keys and sign-in details can’t be saved right now.',
|
|
2201
|
+
),
|
|
2202
|
+
),
|
|
2203
|
+
// What needs connecting leads, so nobody scrolls past what is
|
|
2204
|
+
// connected to find it.
|
|
2205
|
+
group('Requested by agents', grid(asks.map(shown))),
|
|
2206
|
+
group('Finish connecting', grid(pending.map(shown))),
|
|
2207
|
+
group('Yours', grid(yours)),
|
|
2208
|
+
group(yours.length ? `Connected for ${host}` : 'Connected', grid(here)),
|
|
2209
|
+
group('MCP servers', grid(liveServers.map(serverTile))),
|
|
2210
|
+
catalog,
|
|
2211
|
+
trashedServers.length
|
|
2212
|
+
? h(
|
|
2213
|
+
More,
|
|
2214
|
+
null,
|
|
2215
|
+
h(More.Summary, null, 'MCP servers in the trash'),
|
|
2216
|
+
h(More.Body, null, grid(trashedServers.map(serverTile))),
|
|
2217
|
+
)
|
|
2218
|
+
: null,
|
|
2219
|
+
c.on || trashOpen
|
|
2220
|
+
? credentialTrash(
|
|
2221
|
+
trashOpen ? ordinary : withTrash,
|
|
2222
|
+
trashOpen,
|
|
2223
|
+
c.trash?.map((one) =>
|
|
2224
|
+
card(
|
|
2225
|
+
env,
|
|
2226
|
+
serviceFace(one.integration),
|
|
2227
|
+
retainedLine(one),
|
|
2228
|
+
retainedKey(one),
|
|
2229
|
+
ofRetained(one),
|
|
2230
|
+
status('In trash'),
|
|
2231
|
+
)
|
|
2232
|
+
),
|
|
2233
|
+
)
|
|
2234
|
+
: null,
|
|
2235
|
+
]),
|
|
2236
|
+
modal,
|
|
2237
|
+
)
|
|
2238
|
+
return content
|
|
2239
|
+
}
|