@aeolus-fleet/gateway 0.31.0 → 0.32.0
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/dist/adapters/fleet/core-version.d.ts +1 -1
- package/dist/adapters/fleet/core-version.js +1 -1
- package/dist/adapters/fleet/proxy-ships-as-actor.js +5 -1
- package/dist/adapters/fleet/proxy-ships-as-actor.js.map +1 -1
- package/dist/adapters/fleet/rest-fleet-door.js +15 -6
- package/dist/adapters/fleet/rest-fleet-door.js.map +1 -1
- package/dist/adapters/http/mcp-endpoint.js +1 -1
- package/dist/adapters/http/mcp-endpoint.js.map +1 -1
- package/dist/adapters/http/person-tools.js +1 -1
- package/dist/adapters/http/person-tools.js.map +1 -1
- package/dist/adapters/pagasae/email-channel.js +4 -2
- package/dist/adapters/pagasae/email-channel.js.map +1 -1
- package/dist/adapters/prisma/generated/commonInputTypes.d.ts +50 -50
- package/dist/adapters/prisma/generated/internal/class.js +4 -4
- package/dist/adapters/prisma/generated/internal/class.js.map +1 -1
- package/dist/adapters/prisma/generated/internal/prismaNamespace.d.ts +2 -0
- package/dist/adapters/prisma/generated/internal/prismaNamespace.js +2 -0
- package/dist/adapters/prisma/generated/internal/prismaNamespace.js.map +1 -1
- package/dist/adapters/prisma/generated/internal/prismaNamespaceBrowser.d.ts +2 -0
- package/dist/adapters/prisma/generated/internal/prismaNamespaceBrowser.js +2 -0
- package/dist/adapters/prisma/generated/internal/prismaNamespaceBrowser.js.map +1 -1
- package/dist/adapters/prisma/generated/models/A2aPush.d.ts +0 -7
- package/dist/adapters/prisma/generated/models/Party.d.ts +70 -1
- package/dist/adapters/prisma/scope-requirements.d.ts +10 -0
- package/dist/adapters/prisma/scope-requirements.js +37 -0
- package/dist/adapters/prisma/scope-requirements.js.map +1 -0
- package/dist/adapters/trpc/router.d.ts +91 -8
- package/dist/adapters/trpc/router.js +98 -11
- package/dist/adapters/trpc/router.js.map +1 -1
- package/dist/app.js +34 -9
- package/dist/app.js.map +1 -1
- package/dist/core/a2a-out/agent-event.d.ts +1 -1
- package/dist/core/a2a-out/agent-event.js +2 -2
- package/dist/core/a2a-out/agent-event.js.map +1 -1
- package/dist/core/a2a-out/agent-statement.d.ts +2 -1
- package/dist/core/a2a-out/agent-statement.js +5 -2
- package/dist/core/a2a-out/agent-statement.js.map +1 -1
- package/dist/core/a2a-out/hand-a2a-message.d.ts +7 -2
- package/dist/core/a2a-out/hand-a2a-message.js +15 -1
- package/dist/core/a2a-out/hand-a2a-message.js.map +1 -1
- package/dist/core/a2a-out/read-agent-statement.d.ts +1 -0
- package/dist/core/a2a-out/read-agent-statement.js +1 -1
- package/dist/core/a2a-out/read-agent-statement.js.map +1 -1
- package/dist/core/a2a-out/state-a2a-agent.d.ts +3 -2
- package/dist/core/a2a-out/state-a2a-agent.js +3 -2
- package/dist/core/a2a-out/state-a2a-agent.js.map +1 -1
- package/dist/core/account-sign-in/account-in-view.d.ts +10 -1
- package/dist/core/account-sign-in/account-in-view.js +17 -4
- package/dist/core/account-sign-in/account-in-view.js.map +1 -1
- package/dist/core/connection/ports.d.ts +8 -0
- package/dist/core/mcp-out/hand-call.d.ts +6 -2
- package/dist/core/mcp-out/hand-call.js +14 -1
- package/dist/core/mcp-out/hand-call.js.map +1 -1
- package/dist/core/mcp-out/state-party.d.ts +3 -2
- package/dist/core/mcp-out/state-party.js +2 -2
- package/dist/core/mcp-out/state-party.js.map +1 -1
- package/dist/core/mcp-out/statement.d.ts +16 -0
- package/dist/core/mcp-out/statement.js +10 -3
- package/dist/core/mcp-out/statement.js.map +1 -1
- package/dist/core/operator/ports.d.ts +4 -4
- package/dist/core/parties/add-a2a-agent.js +1 -1
- package/dist/core/parties/add-a2a-agent.js.map +1 -1
- package/dist/core/parties/check-approving.d.ts +36 -0
- package/dist/core/parties/check-approving.js +48 -0
- package/dist/core/parties/check-approving.js.map +1 -0
- package/dist/core/parties/check-required-scopes.d.ts +34 -0
- package/dist/core/parties/check-required-scopes.js +27 -0
- package/dist/core/parties/check-required-scopes.js.map +1 -0
- package/dist/core/parties/ports.d.ts +21 -0
- package/dist/core/parties/read-listed-scopes.d.ts +17 -0
- package/dist/core/parties/read-listed-scopes.js +23 -0
- package/dist/core/parties/read-listed-scopes.js.map +1 -0
- package/dist/core/parties/read-scope-requirements.d.ts +18 -0
- package/dist/core/parties/read-scope-requirements.js +17 -0
- package/dist/core/parties/read-scope-requirements.js.map +1 -0
- package/dist/core/parties/scope-requirements.d.ts +34 -0
- package/dist/core/parties/scope-requirements.js +37 -0
- package/dist/core/parties/scope-requirements.js.map +1 -0
- package/dist/core/parties/set-scope-requirements.d.ts +45 -0
- package/dist/core/parties/set-scope-requirements.js +48 -0
- package/dist/core/parties/set-scope-requirements.js.map +1 -0
- package/dist/core/parties/switch-tools.d.ts +39 -0
- package/dist/core/parties/switch-tools.js +38 -0
- package/dist/core/parties/switch-tools.js.map +1 -0
- package/dist/core/parties/tool-switches.d.ts +4 -2
- package/dist/core/parties/tool-switches.js +2 -1
- package/dist/core/parties/tool-switches.js.map +1 -1
- package/dist/core/people/ports.d.ts +4 -2
- package/dist/core/people/wake-person.d.ts +22 -10
- package/dist/core/people/wake-person.js +88 -20
- package/dist/core/people/wake-person.js.map +1 -1
- package/dist/core/people/web-push-channel.js +1 -1
- package/dist/core/people/web-push-channel.js.map +1 -1
- package/dist/core/shared/errors.d.ts +1 -1
- package/dist/core/shared/errors.js.map +1 -1
- package/package.json +3 -3
- package/src/adapters/prisma/migrations/20261025140000_scope_requirements/migration.sql +3 -0
- package/src/adapters/prisma/schema.prisma +69 -65
- package/web/.next/BUILD_ID +1 -1
- package/web/.next/app-path-routes-manifest.json +1 -0
- package/web/.next/build-manifest.json +15 -3
- package/web/.next/diagnostics/route-bundle-stats.json +113 -77
- package/web/.next/fallback-build-manifest.json +3 -3
- package/web/.next/prerender-manifest.json +3 -3
- package/web/.next/routes-manifest.json +6 -0
- package/web/.next/server/app/(console)/gateway-off/page/app-paths-manifest.json +3 -0
- package/web/.next/server/app/(console)/gateway-off/page/build-manifest.json +23 -0
- package/web/.next/server/app/(console)/gateway-off/page/next-font-manifest.json +11 -0
- package/web/.next/server/app/(console)/gateway-off/page/react-loadable-manifest.json +1 -0
- package/web/.next/server/app/(console)/gateway-off/page/server-reference-manifest.json +15 -0
- package/web/.next/server/app/(console)/gateway-off/page.js +19 -0
- package/web/.next/server/app/(console)/gateway-off/page.js.map +5 -0
- package/web/.next/server/app/(console)/gateway-off/page.js.nft.json +1 -0
- package/web/.next/server/app/(console)/gateway-off/page_client-reference-manifest.js +3 -0
- package/web/.next/server/app/(console)/meetings/[meetingId]/page/server-reference-manifest.json +3 -3
- package/web/.next/server/app/(console)/meetings/[meetingId]/page.js.nft.json +1 -1
- package/web/.next/server/app/(console)/meetings/[meetingId]/page_client-reference-manifest.js +1 -1
- package/web/.next/server/app/(console)/outside-parties/[name]/change/page/server-reference-manifest.json +17 -7
- package/web/.next/server/app/(console)/outside-parties/[name]/change/page.js +4 -4
- package/web/.next/server/app/(console)/outside-parties/[name]/change/page.js.nft.json +1 -1
- package/web/.next/server/app/(console)/outside-parties/[name]/change/page_client-reference-manifest.js +1 -1
- package/web/.next/server/app/(console)/outside-parties/[name]/page/server-reference-manifest.json +15 -5
- package/web/.next/server/app/(console)/outside-parties/[name]/page.js +4 -4
- package/web/.next/server/app/(console)/outside-parties/[name]/page.js.nft.json +1 -1
- package/web/.next/server/app/(console)/outside-parties/[name]/page_client-reference-manifest.js +1 -1
- package/web/.next/server/app/(console)/outside-parties/[name]/retire/page/server-reference-manifest.json +17 -7
- package/web/.next/server/app/(console)/outside-parties/[name]/retire/page.js +4 -4
- package/web/.next/server/app/(console)/outside-parties/[name]/retire/page.js.nft.json +1 -1
- package/web/.next/server/app/(console)/outside-parties/[name]/retire/page_client-reference-manifest.js +1 -1
- package/web/.next/server/app/(console)/outside-parties/add/page/server-reference-manifest.json +17 -7
- package/web/.next/server/app/(console)/outside-parties/add/page.js +3 -4
- package/web/.next/server/app/(console)/outside-parties/add/page.js.nft.json +1 -1
- package/web/.next/server/app/(console)/outside-parties/add/page_client-reference-manifest.js +1 -1
- package/web/.next/server/app/(console)/outside-parties/add-a2a-agent/page/server-reference-manifest.json +2 -2
- package/web/.next/server/app/(console)/outside-parties/add-a2a-agent/page.js.nft.json +1 -1
- package/web/.next/server/app/(console)/outside-parties/add-a2a-agent/page_client-reference-manifest.js +1 -1
- package/web/.next/server/app/(console)/outside-parties/add-a2a-client/page/server-reference-manifest.json +2 -2
- package/web/.next/server/app/(console)/outside-parties/add-a2a-client/page.js.nft.json +1 -1
- package/web/.next/server/app/(console)/outside-parties/add-a2a-client/page_client-reference-manifest.js +1 -1
- package/web/.next/server/app/(console)/outside-parties/page/server-reference-manifest.json +2 -2
- package/web/.next/server/app/(console)/outside-parties/page.js.nft.json +1 -1
- package/web/.next/server/app/(console)/outside-parties/page_client-reference-manifest.js +1 -1
- package/web/.next/server/app/(console)/overview/changes/route.js.nft.json +1 -1
- package/web/.next/server/app/(console)/overview/focus/route.js.nft.json +1 -1
- package/web/.next/server/app/(console)/overview/page/server-reference-manifest.json +7 -7
- package/web/.next/server/app/(console)/overview/page.js.nft.json +1 -1
- package/web/.next/server/app/(console)/overview/page_client-reference-manifest.js +1 -1
- package/web/.next/server/app/(console)/overview/requests/[requestId]/page/server-reference-manifest.json +2 -2
- package/web/.next/server/app/(console)/overview/requests/[requestId]/page.js.nft.json +1 -1
- package/web/.next/server/app/(console)/overview/requests/[requestId]/page_client-reference-manifest.js +1 -1
- package/web/.next/server/app/(console)/parties/page/server-reference-manifest.json +9 -9
- package/web/.next/server/app/(console)/parties/page.js.nft.json +1 -1
- package/web/.next/server/app/(console)/parties/page_client-reference-manifest.js +1 -1
- package/web/.next/server/app/(console)/sign-in/failed/page/server-reference-manifest.json +1 -1
- package/web/.next/server/app/(console)/sign-in/failed/page.js.nft.json +1 -1
- package/web/.next/server/app/(console)/sign-in/failed/page_client-reference-manifest.js +1 -1
- package/web/.next/server/app/_global-error.html +1 -1
- package/web/.next/server/app/_global-error.rsc +1 -1
- package/web/.next/server/app/_global-error.segments/__PAGE__.segment.rsc +1 -1
- package/web/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
- package/web/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
- package/web/.next/server/app/_not-found/page/server-reference-manifest.json +1 -1
- package/web/.next/server/app/_not-found/page.js.nft.json +1 -1
- package/web/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
- package/web/.next/server/app/authorize/failed/page/server-reference-manifest.json +1 -1
- package/web/.next/server/app/authorize/failed/page.js.nft.json +1 -1
- package/web/.next/server/app/authorize/failed/page_client-reference-manifest.js +1 -1
- package/web/.next/server/app/authorize/pick/page/server-reference-manifest.json +1 -1
- package/web/.next/server/app/authorize/pick/page.js.nft.json +1 -1
- package/web/.next/server/app/authorize/pick/page_client-reference-manifest.js +1 -1
- package/web/.next/server/app/authorize/waiting/approval/page/server-reference-manifest.json +1 -1
- package/web/.next/server/app/authorize/waiting/approval/page.js.nft.json +1 -1
- package/web/.next/server/app/authorize/waiting/approval/page_client-reference-manifest.js +1 -1
- package/web/.next/server/app-paths-manifest.json +1 -0
- package/web/.next/server/chunks/[root-of-the-server]__0ykc8bq_c06a1._.js +1 -1
- package/web/.next/server/chunks/[root-of-the-server]__0ykc8bq_c06a1._.js.map +1 -1
- package/web/.next/server/chunks/ssr/0vkm_server_app_(console)_outside-parties_[name]_change_page_actions_04td11fxohsfm.js +1 -1
- package/web/.next/server/chunks/ssr/0vkm_server_app_(console)_outside-parties_[name]_change_page_actions_04td11fxohsfm.js.map +1 -1
- package/web/.next/server/chunks/ssr/0vkm_server_app_(console)_outside-parties_[name]_page_actions_0u-45itza1ls7.js +1 -1
- package/web/.next/server/chunks/ssr/0vkm_server_app_(console)_outside-parties_[name]_page_actions_0u-45itza1ls7.js.map +1 -1
- package/web/.next/server/chunks/ssr/0vkm_server_app_(console)_outside-parties_[name]_retire_page_actions_0s7ps6i0ts7v5.js +1 -1
- package/web/.next/server/chunks/ssr/0vkm_server_app_(console)_outside-parties_[name]_retire_page_actions_0s7ps6i0ts7v5.js.map +1 -1
- package/web/.next/server/chunks/ssr/0vkm_server_app_(console)_outside-parties_add-a2a-client_page_actions_0d_wgiu94c32e.js +1 -1
- package/web/.next/server/chunks/ssr/0vkm_server_app_(console)_outside-parties_add-a2a-client_page_actions_0d_wgiu94c32e.js.map +1 -1
- package/web/.next/server/chunks/ssr/0vkm_server_app_(console)_outside-parties_add_page_actions_0yfz_dfn-8uo7.js +1 -1
- package/web/.next/server/chunks/ssr/0vkm_server_app_(console)_outside-parties_add_page_actions_0yfz_dfn-8uo7.js.map +1 -1
- package/web/.next/server/chunks/ssr/0vkm_server_app_(console)_overview_requests_[requestId]_page_actions_0uki9j3mtuz9e.js +1 -1
- package/web/.next/server/chunks/ssr/0vkm_server_app_(console)_overview_requests_[requestId]_page_actions_0uki9j3mtuz9e.js.map +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__0-og0bl8lr2xq._.js +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__0-og0bl8lr2xq._.js.map +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__00q22dte1g2ww._.js +3 -0
- package/web/.next/server/chunks/ssr/[root-of-the-server]__00q22dte1g2ww._.js.map +1 -0
- package/web/.next/server/chunks/ssr/[root-of-the-server]__0k3g0p3t9t0c-._.js +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__0k3g0p3t9t0c-._.js.map +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__0n2us07jk-78w._.js +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__0rr5u24i9tjyc._.js +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__1-c9wugbbwsp3._.js +4 -0
- package/web/.next/server/chunks/ssr/[root-of-the-server]__1-c9wugbbwsp3._.js.map +1 -0
- package/web/.next/server/chunks/ssr/[root-of-the-server]__18-8taiduk1jn._.js +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__18-8taiduk1jn._.js.map +1 -1
- package/web/.next/server/chunks/ssr/{[root-of-the-server]__11w36a4le04vy._.js → [root-of-the-server]__1dc6okf5os70a._.js} +2 -2
- package/web/.next/server/chunks/ssr/[root-of-the-server]__1dc6okf5os70a._.js.map +1 -0
- package/web/.next/server/chunks/ssr/[root-of-the-server]__1dtyycvqa6uht._.js +1 -1
- package/web/.next/server/chunks/ssr/_0-lfpqqlgfhzj._.js.map +1 -1
- package/web/.next/server/chunks/ssr/_00dg5cvqofspn._.js +3 -0
- package/web/.next/server/chunks/ssr/_00dg5cvqofspn._.js.map +1 -0
- package/web/.next/server/chunks/ssr/_00hfzlqn1og18._.js +1 -1
- package/web/.next/server/chunks/ssr/_00hfzlqn1og18._.js.map +1 -1
- package/web/.next/server/chunks/ssr/_03lk54yp-yhw3._.js +2 -2
- package/web/.next/server/chunks/ssr/_03lk54yp-yhw3._.js.map +1 -1
- package/web/.next/server/chunks/ssr/_0_kakdt7lb6z-._.js +3 -0
- package/web/.next/server/chunks/ssr/_0_kakdt7lb6z-._.js.map +1 -0
- package/web/.next/server/chunks/ssr/_0bhvvyz0q_0ja._.js +1 -1
- package/web/.next/server/chunks/ssr/_0ka_9elusb800._.js +4 -0
- package/web/.next/server/chunks/ssr/_0ka_9elusb800._.js.map +1 -0
- package/web/.next/server/chunks/ssr/_0pyd1_y7w8ngp._.js +1 -1
- package/web/.next/server/chunks/ssr/_0pyd1_y7w8ngp._.js.map +1 -1
- package/web/.next/server/chunks/ssr/_0w2ptjht34s6t._.js +3 -0
- package/web/.next/server/chunks/ssr/_0w2ptjht34s6t._.js.map +1 -0
- package/web/.next/server/chunks/ssr/_0xickgbbju_9-._.js +1 -1
- package/web/.next/server/chunks/ssr/_0xickgbbju_9-._.js.map +1 -1
- package/web/.next/server/chunks/ssr/_1_wav28san6dm._.js +1 -1
- package/web/.next/server/chunks/ssr/_1pjtire7rqla0._.js +1 -1
- package/web/.next/server/chunks/ssr/_1pjtire7rqla0._.js.map +1 -1
- package/web/.next/server/chunks/ssr/_1qbsmlji34yph._.js +1 -1
- package/web/.next/server/chunks/ssr/_1qbsmlji34yph._.js.map +1 -1
- package/web/.next/server/chunks/ssr/_1uuy6gkkhq6bx._.js +3 -0
- package/web/.next/server/chunks/ssr/_1uuy6gkkhq6bx._.js.map +1 -0
- package/web/.next/server/chunks/ssr/_1y1ovmdhl9_ml._.js +3 -0
- package/web/.next/server/chunks/ssr/_1y1ovmdhl9_ml._.js.map +1 -0
- package/web/.next/server/chunks/ssr/node_modules_07sxnbglqc5q9._.js +3 -0
- package/web/.next/server/chunks/ssr/node_modules_07sxnbglqc5q9._.js.map +1 -0
- package/web/.next/server/chunks/ssr/node_modules_0_cxkn6vujxay._.js +3 -0
- package/web/.next/server/chunks/ssr/node_modules_0_cxkn6vujxay._.js.map +1 -0
- package/web/.next/server/chunks/ssr/node_modules_0qlo87g8tugr4._.js +3 -0
- package/web/.next/server/chunks/ssr/node_modules_0qlo87g8tugr4._.js.map +1 -0
- package/web/.next/server/chunks/ssr/node_modules_15ceu3jhtifcw._.js +3 -0
- package/web/.next/server/chunks/ssr/node_modules_15ceu3jhtifcw._.js.map +1 -0
- package/web/.next/server/chunks/ssr/node_modules_@aeolus-fleet_common_dist_header_1jvz31plyg2f-._.js +1 -1
- package/web/.next/server/chunks/ssr/node_modules_@aeolus-fleet_common_dist_header_1jvz31plyg2f-._.js.map +1 -1
- package/web/.next/server/chunks/ssr/node_modules_@base-ui_react_utils_FloatingPortalLite_mjs_1uzc1ezeugtex._.js +3 -0
- package/web/.next/server/chunks/ssr/node_modules_@base-ui_react_utils_FloatingPortalLite_mjs_1uzc1ezeugtex._.js.map +1 -0
- package/web/.next/server/chunks/ssr/node_modules_next_dist_esm_build_templates_app-page_1s46s8vlfx01v.js +3 -0
- package/web/.next/server/chunks/ssr/node_modules_next_dist_esm_build_templates_app-page_1s46s8vlfx01v.js.map +1 -0
- package/web/.next/server/chunks/ssr/web_0v-7sowo0hupw._.js +1 -1
- package/web/.next/server/chunks/ssr/web_0wys4l6za8umr._.js +1 -1
- package/web/.next/server/chunks/ssr/web_0wys4l6za8umr._.js.map +1 -1
- package/web/.next/server/chunks/ssr/web_1wcpaty_bz55q._.js +3 -0
- package/web/.next/server/chunks/ssr/web_1wcpaty_bz55q._.js.map +1 -0
- package/web/.next/server/chunks/ssr/web__next-internal_server_app_(console)_overview_page_actions_18on1ziyg1nzy.js +1 -1
- package/web/.next/server/chunks/ssr/web__next-internal_server_app_(console)_overview_page_actions_18on1ziyg1nzy.js.map +1 -1
- package/web/.next/server/chunks/ssr/{web_features_0ahlkugj7fu3n._.js → web_features_0xbnkk4hfgr9v._.js} +2 -2
- package/web/.next/server/chunks/ssr/{web_features_0ahlkugj7fu3n._.js.map → web_features_0xbnkk4hfgr9v._.js.map} +1 -1
- package/web/.next/server/chunks/ssr/web_features_0xnlgtw8bfqaa._.js +1 -1
- package/web/.next/server/chunks/ssr/web_features_10xz3ojtvfi7h._.js +3 -0
- package/web/.next/server/chunks/ssr/web_features_10xz3ojtvfi7h._.js.map +1 -0
- package/web/.next/server/chunks/ssr/web_features_1_2m6l73qk7qw._.js +1 -1
- package/web/.next/server/chunks/ssr/web_features_add-a2a-agent_ui_a2a-agent-form_tsx_0z8t1aalwzyl7._.js +1 -1
- package/web/.next/server/chunks/ssr/web_features_add-a2a-agent_ui_a2a-agent-form_tsx_0z8t1aalwzyl7._.js.map +1 -1
- package/web/.next/server/chunks/ssr/web_features_add-a2a-client_ui_a2a-client-form_tsx_1anv88g385nwe._.js +1 -1
- package/web/.next/server/chunks/ssr/web_features_add-a2a-client_ui_a2a-client-form_tsx_1anv88g385nwe._.js.map +1 -1
- package/web/.next/server/chunks/ssr/web_features_add-server_ui_add-server_tsx_1jnmar5xju49k._.js +1 -1
- package/web/.next/server/chunks/ssr/web_features_add-server_ui_add-server_tsx_1jnmar5xju49k._.js.map +1 -1
- package/web/.next/server/chunks/ssr/web_features_forms_1u0akr22eh_x_._.js +3 -0
- package/web/.next/server/chunks/ssr/web_features_forms_1u0akr22eh_x_._.js.map +1 -0
- package/web/.next/server/chunks/ssr/web_features_frame_0pe8cwpxe1egb._.js +1 -1
- package/web/.next/server/chunks/ssr/web_features_frame_ui_gateway-header_tsx_0e9tekx4jf7ng._.js +1 -1
- package/web/.next/server/chunks/ssr/web_features_frame_ui_gateway-header_tsx_0e9tekx4jf7ng._.js.map +1 -1
- package/web/.next/server/chunks/ssr/web_features_meeting_state_meeting-controls_tsx_12g4kzk2mbvvz._.js +1 -1
- package/web/.next/server/chunks/ssr/web_features_meeting_state_meeting-controls_tsx_12g4kzk2mbvvz._.js.map +1 -1
- package/web/.next/server/chunks/ssr/web_features_outside-parties_ui_switch-card_tsx_1_xnu9bm4tc-_._.js +1 -1
- package/web/.next/server/chunks/ssr/web_features_outside-parties_ui_switch-card_tsx_1_xnu9bm4tc-_._.js.map +1 -1
- package/web/.next/server/chunks/ssr/web_features_outside-party_0_9c27knfvw7u._.js +3 -0
- package/web/.next/server/chunks/ssr/web_features_outside-party_0_9c27knfvw7u._.js.map +1 -0
- package/web/.next/server/chunks/ssr/web_features_outside-party_actions_ts_102ar5pdowf8s._.js +1 -1
- package/web/.next/server/chunks/ssr/web_features_outside-party_actions_ts_102ar5pdowf8s._.js.map +1 -1
- package/web/.next/server/chunks/ssr/web_features_overview_0udx5lm8igils._.js +3 -0
- package/web/.next/server/chunks/ssr/{web_features_overview_16dyz2ngvs14b._.js.map → web_features_overview_0udx5lm8igils._.js.map} +1 -1
- package/web/.next/server/chunks/ssr/web_features_overview_hooks_overview-actions_ts_0-wrat07d1y5g._.js +1 -1
- package/web/.next/server/chunks/ssr/web_features_overview_state_1wuk95dw2_whp._.js +1 -1
- package/web/.next/server/chunks/ssr/web_features_overview_state_1wuk95dw2_whp._.js.map +1 -1
- package/web/.next/server/chunks/ssr/web_features_overview_state_decision-panel_tsx_0kpd26ggtr6h_._.js +1 -1
- package/web/.next/server/chunks/ssr/web_features_overview_state_decision-panel_tsx_0kpd26ggtr6h_._.js.map +1 -1
- package/web/.next/server/chunks/ssr/{web_features_overview_ui_action-button_tsx_14-5f45xbzbi6._.js → web_features_overview_ui_10mb24kjiffea._.js} +2 -2
- package/web/.next/server/chunks/ssr/{web_features_overview_ui_action-button_tsx_14-5f45xbzbi6._.js.map → web_features_overview_ui_10mb24kjiffea._.js.map} +1 -1
- package/web/.next/server/chunks/ssr/web_features_parties_actions_ts_0r-tbfsig2ty-._.js +1 -1
- package/web/.next/server/middleware-build-manifest.js +15 -3
- package/web/.next/server/next-font-manifest.js +1 -1
- package/web/.next/server/next-font-manifest.json +4 -0
- package/web/.next/server/pages/500.html +1 -1
- package/web/.next/server/preview-props.json +3 -3
- package/web/.next/server/server-reference-manifest.js +1 -1
- package/web/.next/server/server-reference-manifest.json +57 -31
- package/web/.next/static/chunks/10wzmy096av_5.css +3 -0
- package/web/.next/static/chunks/{21s2_ccrw90ok.js → 1ffk4chq_kmie.js} +1 -1
- package/web/.next/static/chunks/{3tss77vu57zju.js → 1nyfzf-d7kj96.js} +1 -1
- package/web/.next/static/chunks/202avng4-d5jq.js +1 -0
- package/web/.next/static/chunks/{1juj2_tl8d16x.js → 26kio8jl2dc6u.js} +1 -1
- package/web/.next/static/chunks/2cd4e71s711ad.js +1 -0
- package/web/.next/static/chunks/2i3ydqqupow_x.js +1 -0
- package/web/.next/static/chunks/2jvq5fses35mf.js +1 -0
- package/web/.next/static/chunks/2riya89_i0je8.js +1 -0
- package/web/.next/static/chunks/{3o8h4o3utbvgc.js → 2sx1mxv2u71xx.js} +1 -1
- package/web/.next/static/chunks/3_pwm8b3mf4mf.js +1 -0
- package/web/.next/static/chunks/{2hsi-sahla2aj.js → 3f3s544ovqebz.js} +1 -1
- package/web/.next/static/chunks/{2x00o45pdbkok.js → 3x_8doukmdfpu.js} +1 -1
- package/web/.next/static/chunks/{1pafc2gfswboo.js → 3yunex2p9do7t.js} +1 -1
- package/web/.next/static/chunks/{2n2qsek2y94y5.js → 40sj32h7okqjq.js} +1 -1
- package/web/.next/trace +1 -1
- package/web/.next/trace-build +1 -1
- package/web/.next/types/routes.d.ts +2 -1
- package/web/.next/types/validator.ts +17 -0
- package/dist/core/parties/switch-tool.d.ts +0 -29
- package/dist/core/parties/switch-tool.js +0 -33
- package/dist/core/parties/switch-tool.js.map +0 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__0m57jyae0dn_7._.js +0 -3
- package/web/.next/server/chunks/ssr/[root-of-the-server]__0m57jyae0dn_7._.js.map +0 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__11w36a4le04vy._.js.map +0 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__1k25lo5ka4mgd._.js +0 -3
- package/web/.next/server/chunks/ssr/[root-of-the-server]__1k25lo5ka4mgd._.js.map +0 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__1yjb00o7x58xv._.js +0 -3
- package/web/.next/server/chunks/ssr/[root-of-the-server]__1yjb00o7x58xv._.js.map +0 -1
- package/web/.next/server/chunks/ssr/node_modules_0cyjln1rocvt5._.js +0 -3
- package/web/.next/server/chunks/ssr/node_modules_0cyjln1rocvt5._.js.map +0 -1
- package/web/.next/server/chunks/ssr/node_modules_1ins1z8o_qrka._.js +0 -3
- package/web/.next/server/chunks/ssr/node_modules_1ins1z8o_qrka._.js.map +0 -1
- package/web/.next/server/chunks/ssr/web_features_0i_kwiszuiqcp._.js +0 -3
- package/web/.next/server/chunks/ssr/web_features_0i_kwiszuiqcp._.js.map +0 -1
- package/web/.next/server/chunks/ssr/web_features_1--8ungjj--ht._.js +0 -3
- package/web/.next/server/chunks/ssr/web_features_1--8ungjj--ht._.js.map +0 -1
- package/web/.next/server/chunks/ssr/web_features_1qq_ruz59ldc9._.js +0 -3
- package/web/.next/server/chunks/ssr/web_features_1qq_ruz59ldc9._.js.map +0 -1
- package/web/.next/server/chunks/ssr/web_features_forms_form-state_ts_2142hiopykfk1._.js +0 -3
- package/web/.next/server/chunks/ssr/web_features_forms_form-state_ts_2142hiopykfk1._.js.map +0 -1
- package/web/.next/server/chunks/ssr/web_features_outside-party_ui_20x5u9bhxeehi._.js +0 -3
- package/web/.next/server/chunks/ssr/web_features_outside-party_ui_20x5u9bhxeehi._.js.map +0 -1
- package/web/.next/server/chunks/ssr/web_features_overview_16dyz2ngvs14b._.js +0 -3
- package/web/.next/static/chunks/183mifyxtyab5.css +0 -3
- package/web/.next/static/chunks/1bnlc-p1_cm01.js +0 -1
- package/web/.next/static/chunks/1ca21kggixrjz.js +0 -1
- package/web/.next/static/chunks/2-t4g6oq6tjkg.js +0 -1
- package/web/.next/static/chunks/2l27ty2dy2pb4.js +0 -1
- /package/web/.next/static/{3whgLnRJ9iJe_25h6KGzQ → JmnMsO8U6uK0nukLKdccI}/_buildManifest.js +0 -0
- /package/web/.next/static/{3whgLnRJ9iJe_25h6KGzQ → JmnMsO8U6uK0nukLKdccI}/_clientMiddlewareManifest.js +0 -0
- /package/web/.next/static/{3whgLnRJ9iJe_25h6KGzQ → JmnMsO8U6uK0nukLKdccI}/_ssgManifest.js +0 -0
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
(()=>{"use strict";module.exports=[51636,a=>{let b=[{kind:"none",label:"No credential"},{kind:"bearer",label:"Bearer token"},{kind:"clientCredentials",label:"OAuth client credentials"}];a.s(["x",0,b,"C",0,function(a){return b.find(({kind:b})=>b===a)?.kind??"bearer"}])},88412,a=>{let b="inline-flex h-9 items-center justify-center gap-2 rounded-md px-4 font-medium disabled:opacity-60",c={primary:`${b} bg-primary text-primary-foreground hover:bg-primary-hover`,secondary:`${b} border border-border bg-card hover:bg-accent`,destructive:`${b} bg-destructive text-destructive-foreground`};a.s(["x",0,c,"r",0,"rounded-lg border border-border bg-card p-6 text-card-foreground shadow-sm","w",0,"h-9 w-full rounded-md border border-input bg-background px-3 font-mono text-code","z",0,"grid gap-1"])},35149,a=>{var b=a.i(87924),c=a.i(88412);a.s(["f",0,function({choices:a,current:d,help:e,refusal:f}){let g=null===d||a.some(a=>a.shipId===d.shipId)?a:[d,...a];return(0,b.jsxs)("label",{className:c.z,children:[(0,b.jsx)("span",{children:"Owner"}),(0,b.jsxs)("select",{className:c.w,name:"ownerShipId",defaultValue:d?.shipId??"",required:!0,"data-testid":"owner-field",children:[null===d?(0,b.jsx)("option",{value:"",disabled:!0,children:"Pick its owner"}):null,g.map(a=>(0,b.jsx)("option",{value:a.shipId,children:a.name},a.shipId))]}),(0,b.jsx)("span",{className:"text-muted-foreground",children:f??e})]})}])},25964,a=>{var b=a.i(72131),c=a.i(50944);a.s(["LiveRefresh",0,function({fleetId:a}){let d;return d=(0,c.useRouter)(),(0,b.useEffect)(()=>{let b=new EventSource(`/overview/changes?fleet=${encodeURIComponent(a)}`);return b.onmessage=()=>{d.refresh()},()=>{b.close()}},[a,d]),(0,b.useEffect)(()=>{let b,c=()=>{let c="visible"===document.visibilityState&&document.hasFocus();c&&void 0===b?b=new EventSource(`/overview/focus?fleet=${encodeURIComponent(a)}`):c||void 0===b||(b.close(),b=void 0)};return c(),window.addEventListener("focus",c),window.addEventListener("blur",c),document.addEventListener("visibilitychange",c),()=>{window.removeEventListener("focus",c),window.removeEventListener("blur",c),document.removeEventListener("visibilitychange",c),b?.close()}},[a]),null}],25964)},1542,
|
|
1
|
+
(()=>{"use strict";module.exports=[51636,a=>{let b=[{kind:"none",label:"No credential"},{kind:"bearer",label:"Bearer token"},{kind:"clientCredentials",label:"OAuth client credentials"}];a.s(["x",0,b,"C",0,function(a){return b.find(({kind:b})=>b===a)?.kind??"bearer"}])},88412,a=>{let b="inline-flex h-9 items-center justify-center gap-2 rounded-md px-4 font-medium disabled:opacity-60",c={primary:`${b} bg-primary text-primary-foreground hover:bg-primary-hover`,secondary:`${b} border border-border bg-card hover:bg-accent`,destructive:`${b} bg-destructive text-destructive-foreground`};a.s(["x",0,c,"r",0,"rounded-lg border border-border bg-card p-6 text-card-foreground shadow-sm","w",0,"h-9 w-full rounded-md border border-input bg-background px-3 font-mono text-code","z",0,"grid gap-1"])},35149,a=>{var b=a.i(87924),c=a.i(88412);a.s(["f",0,function({choices:a,current:d,help:e,refusal:f}){let g=null===d||a.some(a=>a.shipId===d.shipId)?a:[d,...a];return(0,b.jsxs)("label",{className:c.z,children:[(0,b.jsx)("span",{children:"Owner"}),(0,b.jsxs)("select",{className:c.w,name:"ownerShipId",defaultValue:d?.shipId??"",required:!0,"data-testid":"owner-field",children:[null===d?(0,b.jsx)("option",{value:"",disabled:!0,children:"Pick its owner"}):null,g.map(a=>(0,b.jsx)("option",{value:a.shipId,children:a.name},a.shipId))]}),(0,b.jsx)("span",{className:"text-muted-foreground",children:f??e})]})}])},25964,a=>{var b=a.i(72131),c=a.i(50944);a.s(["LiveRefresh",0,function({fleetId:a}){let d;return d=(0,c.useRouter)(),(0,b.useEffect)(()=>{let b=new EventSource(`/overview/changes?fleet=${encodeURIComponent(a)}`);return b.onmessage=()=>{d.refresh()},()=>{b.close()}},[a,d]),(0,b.useEffect)(()=>{let b,c=()=>{let c="visible"===document.visibilityState&&document.hasFocus();c&&void 0===b?b=new EventSource(`/overview/focus?fleet=${encodeURIComponent(a)}`):c||void 0===b||(b.close(),b=void 0)};return c(),window.addEventListener("focus",c),window.addEventListener("blur",c),document.addEventListener("visibilitychange",c),()=>{window.removeEventListener("focus",c),window.removeEventListener("blur",c),document.removeEventListener("visibilitychange",c),b?.close()}},[a]),null}],25964)},1542,a=>{var b=a.i(87924);let c={primary:"bg-primary text-primary-foreground hover:bg-primary-hover",secondary:"border border-border bg-card text-card-foreground hover:bg-accent"};a.s(["f",0,function({isPending:a,pendingLabel:d,variant:e="secondary",children:f,className:g="",disabled:h,...i}){return(0,b.jsx)("button",{...i,disabled:!0===h||a,"aria-busy":a,className:`inline-flex h-9 items-center gap-2 rounded-md px-4 disabled:cursor-not-allowed disabled:opacity-70 ${c[e]} ${g}`,children:a?(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)("span",{"aria-hidden":"true",className:"size-3.5 animate-spin rounded-full border-2 border-current border-t-transparent"}),d]}):f})}])},24229,a=>{var b=a.i(87924);a.s(["f",0,function({message:a,isFailure:c}){return c?(0,b.jsx)("p",{role:"alert","data-testid":"overview-failure",className:"rounded-md border border-tone-attention-border bg-tone-attention-bg px-3 py-2 text-tone-attention-fg",children:a}):(0,b.jsx)("p",{role:"status","data-testid":"overview-success",className:"rounded-md border border-tone-ok-border bg-tone-ok-bg px-3 py-2 text-tone-ok-fg",children:a})}])}]})();
|
|
2
2
|
|
|
3
|
-
//# sourceMappingURL=
|
|
3
|
+
//# sourceMappingURL=web_features_0xbnkk4hfgr9v._.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../web/features/forms/server-credential.ts","../../../../../web/features/forms/ui/look.ts","../../../../../web/features/forms/ui/owner-field.tsx","../../../../../web/features/overview/hooks/use-focus-report.ts","../../../../../web/features/overview/hooks/use-live-refresh.ts","../../../../../web/features/overview/state/live-refresh.tsx","../../../../../web/features/overview/ui/action-button.tsx","../../../../../web/features/overview/ui/notice.tsx"],"sourcesContent":["/**\n * An outside MCP server's credential, as the add, Parties and decision forms\n * take it: none for a server reached only on a private network, a static\n * bearer, or OAuth client credentials.\n */\n\n/** The credential kinds a form offers, with the words it shows. */\nexport const CREDENTIAL_KINDS = [\n { kind: 'none', label: 'No credential' },\n { kind: 'bearer', label: 'Bearer token' },\n { kind: 'clientCredentials', label: 'OAuth client credentials' },\n] as const;\n\nexport type CredentialKind = (typeof CREDENTIAL_KINDS)[number]['kind'];\n\nexport type ServerCredential =\n | { kind: 'none' }\n | { kind: 'bearer'; token: string }\n | { kind: 'clientCredentials'; clientId: string; clientSecret: string; issuer: string; scope?: string };\n\n/** The kind a form sent, a bearer when it sent none it knows. */\nexport function credentialKindOf(sent: string): CredentialKind {\n return CREDENTIAL_KINDS.find(({ kind }) => kind === sent)?.kind ?? 'bearer';\n}\n\n/** The credential the fields name: only the fields of its kind are read. */\nexport function serverCredentialOf(fields: { credentialKind: string; token: string; clientId: string; clientSecret: string; issuer: string; scope: string }): ServerCredential {\n const kind = credentialKindOf(fields.credentialKind);\n switch (kind) {\n case 'none':\n return { kind };\n case 'bearer':\n return { kind, token: fields.token };\n case 'clientCredentials':\n return { kind, clientId: fields.clientId, clientSecret: fields.clientSecret, issuer: fields.issuer, ...(fields.scope === '' ? {} : { scope: fields.scope }) };\n }\n}\n","/** The classes the pages share, on the design tokens: a card and the button kinds. */\nexport const CARD = 'rounded-lg border border-border bg-card p-6 text-card-foreground shadow-sm';\n\nconst BUTTON = 'inline-flex h-9 items-center justify-center gap-2 rounded-md px-4 font-medium disabled:opacity-60';\n\nexport const BUTTONS = {\n primary: `${BUTTON} bg-primary text-primary-foreground hover:bg-primary-hover`,\n secondary: `${BUTTON} border border-border bg-card hover:bg-accent`,\n destructive: `${BUTTON} bg-destructive text-destructive-foreground`,\n} as const;\n\nexport type ButtonKind = keyof typeof BUTTONS;\n\nexport const INPUT = 'h-9 w-full rounded-md border border-input bg-background px-3 font-mono text-code';\n\nexport const LABEL = 'grid gap-1';\n","import { INPUT, LABEL } from './look';\n\n/** A ship a party's owner may be picked from, by its name. */\nexport interface OwnerChoice {\n shipId: string;\n name: string;\n}\n\n/** The owner choices as a page read them, or why they could not be read. */\nexport type OwnerChoices = { isOk: true; value: OwnerChoice[] } | { isOk: false; refusal: string };\n\n/**\n * The owner of a party, picked by name from the ships the fleet takes as an\n * owner. The owner it has now stays a choice, though the fleet no longer\n * lists it, so saving leaves it as it is. Where the choices could not be\n * read, it says why, with nothing to pick.\n */\nexport function OwnerField({ choices, current, help, refusal }: { choices: readonly OwnerChoice[]; current: OwnerChoice | null; help: string; refusal?: string | undefined }) {\n const shown = current === null || choices.some((choice) => choice.shipId === current.shipId) ? choices : [current, ...choices];\n return (\n <label className={LABEL}>\n <span>Owner</span>\n <select className={INPUT} name=\"ownerShipId\" defaultValue={current?.shipId ?? ''} required data-testid=\"owner-field\">\n {current === null ? (\n <option value=\"\" disabled>\n Pick its owner\n </option>\n ) : null}\n {shown.map((choice) => (\n <option key={choice.shipId} value={choice.shipId}>\n {choice.name}\n </option>\n ))}\n </select>\n <span className=\"text-muted-foreground\">{refusal ?? help}</span>\n </label>\n );\n}\n","'use client';\n\nimport { useEffect } from 'react';\n\n/** The stream the page holds while in focus, which the web app's server follows on the gateway's API for the browser. */\nexport const FOCUS_PATH = '/overview/focus';\n\n/**\n * Tells the gateway while the page is in focus (wake a person, W6): it holds\n * the focus stream open while the window has focus and the page shows, and\n * closes it when either ends. While a page of the person is in focus, what\n * arrives is shown there and no wake goes out; an open page not in focus\n * changes nothing. A lost connection no longer counts as in focus.\n */\nexport function useFocusReport(fleetId: string): void {\n useEffect(() => {\n let focus: EventSource | undefined;\n const report = () => {\n const isInFocus = document.visibilityState === 'visible' && document.hasFocus();\n if (isInFocus && focus === undefined) {\n focus = new EventSource(`${FOCUS_PATH}?fleet=${encodeURIComponent(fleetId)}`);\n } else if (!isInFocus && focus !== undefined) {\n focus.close();\n focus = undefined;\n }\n };\n report();\n window.addEventListener('focus', report);\n window.addEventListener('blur', report);\n document.addEventListener('visibilitychange', report);\n return () => {\n window.removeEventListener('focus', report);\n window.removeEventListener('blur', report);\n document.removeEventListener('visibilitychange', report);\n focus?.close();\n };\n }, [fleetId]);\n}\n","'use client';\n\nimport { useRouter } from 'next/navigation';\nimport { useEffect } from 'react';\n\n/** The page's live updates, which the web app's server follows on the gateway's API for the browser. */\nexport const CHANGES_PATH = '/overview/changes';\n\n/**\n * Keeps the page in step with its fleet's requests: whenever one changes,\n * the page reads itself again on the server, as its own caller. The browser\n * opens the stream again by itself when it drops.\n */\nexport function useLiveRefresh(fleetId: string): void {\n const router = useRouter();\n useEffect(() => {\n const changes = new EventSource(`${CHANGES_PATH}?fleet=${encodeURIComponent(fleetId)}`);\n changes.onmessage = () => {\n router.refresh();\n };\n return () => {\n changes.close();\n };\n }, [fleetId, router]);\n}\n","'use client';\n\nimport { useFocusReport } from '../hooks/use-focus-report';\nimport { useLiveRefresh } from '../hooks/use-live-refresh';\n\n/** Keeps the page it sits in live, and tells the gateway while it is in focus (wake a person, W6): it shows nothing itself. */\nexport function LiveRefresh({ fleetId }: { fleetId: string }) {\n useLiveRefresh(fleetId);\n useFocusReport(fleetId);\n return null;\n}\n","import type { ButtonHTMLAttributes, ReactNode } from 'react';\n\nconst VARIANTS = {\n primary: 'bg-primary text-primary-foreground hover:bg-primary-hover',\n secondary: 'border border-border bg-card text-card-foreground hover:bg-accent',\n} as const;\n\n/**\n * A button for an action: the moment it is pressed and until the answer\n * comes, it shows a spinner and its working label, and cannot run twice.\n */\nexport function ActionButton({\n isPending,\n pendingLabel,\n variant = 'secondary',\n children,\n className = '',\n disabled,\n ...button\n}: ButtonHTMLAttributes<HTMLButtonElement> & { isPending: boolean; pendingLabel: string; variant?: keyof typeof VARIANTS; children: ReactNode }) {\n return (\n <button\n {...button}\n disabled={disabled === true || isPending}\n aria-busy={isPending}\n className={`inline-flex h-9 items-center gap-2 rounded-md px-4 disabled:cursor-not-allowed disabled:opacity-70 ${VARIANTS[variant]} ${className}`}\n >\n {isPending ? (\n <>\n <span aria-hidden=\"true\" className=\"size-3.5 animate-spin rounded-full border-2 border-current border-t-transparent\" />\n {pendingLabel}\n </>\n ) : (\n children\n )}\n </button>\n );\n}\n","/** What an action came to, said in place: a success as a status, a failure as an alert by the control. */\nexport function Notice({ message, isFailure }: { message: string; isFailure: boolean }) {\n return isFailure ? (\n <p role=\"alert\" data-testid=\"overview-failure\" className=\"rounded-md border border-tone-attention-border bg-tone-attention-bg px-3 py-2 text-tone-attention-fg\">\n {message}\n </p>\n ) : (\n <p role=\"status\" data-testid=\"overview-success\" className=\"rounded-md border border-tone-ok-border bg-tone-ok-bg px-3 py-2 text-tone-ok-fg\">\n {message}\n </p>\n );\n}\n"],"names":["CREDENTIAL_KINDS","kind","label","credentialKindOf","sent","find","serverCredentialOf","fields","credentialKind","token","clientId","clientSecret","issuer","scope","CARD","BUTTON","BUTTONS","primary","secondary","destructive","INPUT","LABEL","OwnerField","choices","current","help","refusal","shown","some","choice","shipId","className","name","defaultValue","required","value","disabled","map","FOCUS_PATH","useFocusReport","fleetId","focus","report","isInFocus","document","visibilityState","hasFocus","undefined","EventSource","encodeURIComponent","close","window","addEventListener","removeEventListener","VARIANTS","ActionButton","isPending","pendingLabel","variant","children","button"],"mappings":"6CAOO,IAAMA,EAAmB,CAC9B,CAAEC,KAAM,OAAQC,MAAO,eAAgB,EACvC,CAAED,KAAM,SAAUC,MAAO,cAAe,EACxC,CAAED,KAAM,oBAAqBC,MAAO,0BAA2B,EAChE,oBAUM,SAASC,AAAiBC,CAAY,EAC3C,OAAOJ,EAAiBK,IAAI,CAAC,CAAC,MAAEJ,CAAI,CAAE,GAAKA,IAASG,IAAOH,MAAQ,QACrE,eCpBA,IAAMc,EAAS,oGAEFC,EAAU,CACrBC,QAAS,CAAA,EAAGF,EAAO,0DAA0D,CAAC,CAC9EG,UAAW,CAAA,EAAGH,EAAO,6CAA6C,CAAC,CACnEI,YAAa,CAAA,EAAGJ,EAAO,2CAA2C,CAAC,AACrE,qBARoB,mFAYC,yFAEA,2CCfrB,EAAA,EAAA,CAAA,CAAA,kBAiBO,SAASO,AAAW,CAAEC,SAAO,SAAEC,CAAO,MAAEC,CAAI,SAAEC,CAAO,CAAgH,EAC1K,IAAMC,EAAoB,OAAZH,GAAoBD,EAAQK,IAAI,CAAC,AAACC,GAAWA,EAAOC,MAAM,GAAKN,EAAQM,MAAM,EAAIP,EAAU,CAACC,KAAYD,EAAQ,CAC9H,MACE,CAAA,EAAA,EAAA,IAAA,EAAC,QAAA,CAAMQ,UAAW,EAAA,CAAK,WACrB,CAAA,EAAA,EAAA,GAAA,EAAC,OAAA,UAAK,UACN,CAAA,EAAA,EAAA,IAAA,EAAC,SAAA,CAAOA,UAAW,EAAA,CAAK,CAAEC,KAAK,cAAcC,aAAcT,GAASM,QAAU,GAAII,QAAQ,CAAA,CAAA,EAAC,cAAY,w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,mBAAoBX,GACjDD,GAAOS,OACT,CACF,EAAG,CE5BY,EF4BH,EE3BL,IACT,2CCRA,IAAMI,EAAW,CACfrC,QAAS,4DACTC,UAAW,mEACb,aAMO,SAASqC,AAAa,WAC3BC,CAAS,cACTC,CAAY,SACZC,EAAU,WAAW,UACrBC,CAAQ,WACR5B,EAAY,EAAE,UACdK,CAAQ,CACR,GAAGwB,EAC0I,EAC7I,MACE,CAAA,EAAA,EAAA,GAAA,EAAC,SAAA,CACE,GAAGA,CAAM,CACVxB,UAAuB,IAAbA,GAAqBoB,EAC/B,YAAWA,EACXzB,UAAW,CAAC,mGAAmG,EAAEuB,CAAQ,CAACI,EAAQ,CAAC,CAAC,EAAE3B,EAAAA,CAAW,UAEhJyB,EACC,CAAA,EAAA,EAAA,IAAA,EAAA,EAAA,QAAA,CAAA,WACE,CAAA,EAAA,EAAA,GAAA,EAAC,OAAA,CAAK,cAAY,OAAOzB,UAAU,oFAClC0B,KAGHE,GAIR,oBCpCO,SAAS,AAAO,SAAE,CAAO,WAAE,CAAS,CAA2C,EACpF,OAAO,EACL,CAAA,EAAA,EAAA,GAAA,EAAC,IAAA,CAAE,KAAK,QAAQ,cAAY,mBAAmB,UAAU,gHACtD,IAGH,CAAA,EAAA,EAAA,GAAA,EAAC,IAAA,CAAE,KAAK,SAAS,cAAY,mBAAmB,UAAU,2FACvD,GAGP"}
|
|
1
|
+
{"version":3,"sources":["../../../../../web/features/forms/server-credential.ts","../../../../../web/features/forms/ui/look.ts","../../../../../web/features/forms/ui/owner-field.tsx","../../../../../web/features/overview/hooks/use-focus-report.ts","../../../../../web/features/overview/hooks/use-live-refresh.ts","../../../../../web/features/overview/state/live-refresh.tsx","../../../../../web/features/overview/ui/action-button.tsx","../../../../../web/features/overview/ui/notice.tsx"],"sourcesContent":["/**\n * An outside MCP server's credential, as the add, Parties and decision forms\n * take it: none for a server reached only on a private network, a static\n * bearer, or OAuth client credentials.\n */\n\n/** The credential kinds a form offers, with the words it shows. */\nexport const CREDENTIAL_KINDS = [\n { kind: 'none', label: 'No credential' },\n { kind: 'bearer', label: 'Bearer token' },\n { kind: 'clientCredentials', label: 'OAuth client credentials' },\n] as const;\n\nexport type CredentialKind = (typeof CREDENTIAL_KINDS)[number]['kind'];\n\nexport type ServerCredential =\n | { kind: 'none' }\n | { kind: 'bearer'; token: string }\n | { kind: 'clientCredentials'; clientId: string; clientSecret: string; issuer: string; scope?: string };\n\n/** The kind a form sent, a bearer when it sent none it knows. */\nexport function credentialKindOf(sent: string): CredentialKind {\n return CREDENTIAL_KINDS.find(({ kind }) => kind === sent)?.kind ?? 'bearer';\n}\n\n/** The credential the fields name: only the fields of its kind are read. */\nexport function serverCredentialOf(fields: { credentialKind: string; token: string; clientId: string; clientSecret: string; issuer: string; scope: string }): ServerCredential {\n const kind = credentialKindOf(fields.credentialKind);\n switch (kind) {\n case 'none':\n return { kind };\n case 'bearer':\n return { kind, token: fields.token };\n case 'clientCredentials':\n return { kind, clientId: fields.clientId, clientSecret: fields.clientSecret, issuer: fields.issuer, ...(fields.scope === '' ? {} : { scope: fields.scope }) };\n }\n}\n","/** The classes the pages share, on the design tokens: a card and the button kinds. */\nexport const CARD = 'rounded-lg border border-border bg-card p-6 text-card-foreground shadow-sm';\n\nconst BUTTON = 'inline-flex h-9 items-center justify-center gap-2 rounded-md px-4 font-medium disabled:opacity-60';\n\nexport const BUTTONS = {\n primary: `${BUTTON} bg-primary text-primary-foreground hover:bg-primary-hover`,\n secondary: `${BUTTON} border border-border bg-card hover:bg-accent`,\n destructive: `${BUTTON} bg-destructive text-destructive-foreground`,\n} as const;\n\nexport type ButtonKind = keyof typeof BUTTONS;\n\nexport const INPUT = 'h-9 w-full rounded-md border border-input bg-background px-3 font-mono text-code';\n\nexport const LABEL = 'grid gap-1';\n","import { INPUT, LABEL } from './look';\n\n/** A ship a party's owner may be picked from, by its name. */\nexport interface OwnerChoice {\n shipId: string;\n name: string;\n}\n\n/** The owner choices as a page read them, or why they could not be read. */\nexport type OwnerChoices = { isOk: true; value: OwnerChoice[] } | { isOk: false; refusal: string };\n\n/**\n * The owner of a party, picked by name from the ships the fleet takes as an\n * owner. The owner it has now stays a choice, though the fleet no longer\n * lists it, so saving leaves it as it is. Where the choices could not be\n * read, it says why, with nothing to pick.\n */\nexport function OwnerField({ choices, current, help, refusal }: { choices: readonly OwnerChoice[]; current: OwnerChoice | null; help: string; refusal?: string | undefined }) {\n const shown = current === null || choices.some((choice) => choice.shipId === current.shipId) ? choices : [current, ...choices];\n return (\n <label className={LABEL}>\n <span>Owner</span>\n <select className={INPUT} name=\"ownerShipId\" defaultValue={current?.shipId ?? ''} required data-testid=\"owner-field\">\n {current === null ? (\n <option value=\"\" disabled>\n Pick its owner\n </option>\n ) : null}\n {shown.map((choice) => (\n <option key={choice.shipId} value={choice.shipId}>\n {choice.name}\n </option>\n ))}\n </select>\n <span className=\"text-muted-foreground\">{refusal ?? help}</span>\n </label>\n );\n}\n","'use client';\n\nimport { useEffect } from 'react';\n\n/** The stream the page holds while in focus, which the web app's server follows on the gateway's API for the browser. */\nexport const FOCUS_PATH = '/overview/focus';\n\n/**\n * Tells the gateway while the page is in focus (wake a person, W6): it holds\n * the focus stream open while the window has focus and the page shows, and\n * closes it when either ends. While a page of the person is in focus, what\n * arrives is shown there and no wake goes out; an open page not in focus\n * changes nothing. A lost connection no longer counts as in focus.\n */\nexport function useFocusReport(fleetId: string): void {\n useEffect(() => {\n let focus: EventSource | undefined;\n const report = () => {\n const isInFocus = document.visibilityState === 'visible' && document.hasFocus();\n if (isInFocus && focus === undefined) {\n focus = new EventSource(`${FOCUS_PATH}?fleet=${encodeURIComponent(fleetId)}`);\n } else if (!isInFocus && focus !== undefined) {\n focus.close();\n focus = undefined;\n }\n };\n report();\n window.addEventListener('focus', report);\n window.addEventListener('blur', report);\n document.addEventListener('visibilitychange', report);\n return () => {\n window.removeEventListener('focus', report);\n window.removeEventListener('blur', report);\n document.removeEventListener('visibilitychange', report);\n focus?.close();\n };\n }, [fleetId]);\n}\n","'use client';\n\nimport { useRouter } from 'next/navigation';\nimport { useEffect } from 'react';\n\n/** The page's live updates, which the web app's server follows on the gateway's API for the browser. */\nexport const CHANGES_PATH = '/overview/changes';\n\n/**\n * Keeps the page in step with its fleet's requests: whenever one changes,\n * the page reads itself again on the server, as its own caller. The browser\n * opens the stream again by itself when it drops.\n */\nexport function useLiveRefresh(fleetId: string): void {\n const router = useRouter();\n useEffect(() => {\n const changes = new EventSource(`${CHANGES_PATH}?fleet=${encodeURIComponent(fleetId)}`);\n changes.onmessage = () => {\n router.refresh();\n };\n return () => {\n changes.close();\n };\n }, [fleetId, router]);\n}\n","'use client';\n\nimport { useFocusReport } from '../hooks/use-focus-report';\nimport { useLiveRefresh } from '../hooks/use-live-refresh';\n\n/** Keeps the page it sits in live, and tells the gateway while it is in focus (wake a person, W6): it shows nothing itself. */\nexport function LiveRefresh({ fleetId }: { fleetId: string }) {\n useLiveRefresh(fleetId);\n useFocusReport(fleetId);\n return null;\n}\n","import type { ButtonHTMLAttributes, ReactNode } from 'react';\n\nconst VARIANTS = {\n primary: 'bg-primary text-primary-foreground hover:bg-primary-hover',\n secondary: 'border border-border bg-card text-card-foreground hover:bg-accent',\n} as const;\n\n/**\n * A button for an action: the moment it is pressed and until the answer\n * comes, it shows a spinner and its working label, and cannot run twice.\n */\nexport function ActionButton({\n isPending,\n pendingLabel,\n variant = 'secondary',\n children,\n className = '',\n disabled,\n ...button\n}: ButtonHTMLAttributes<HTMLButtonElement> & { isPending: boolean; pendingLabel: string; variant?: keyof typeof VARIANTS; children: ReactNode }) {\n return (\n <button\n {...button}\n disabled={disabled === true || isPending}\n aria-busy={isPending}\n className={`inline-flex h-9 items-center gap-2 rounded-md px-4 disabled:cursor-not-allowed disabled:opacity-70 ${VARIANTS[variant]} ${className}`}\n >\n {isPending ? (\n <>\n <span aria-hidden=\"true\" className=\"size-3.5 animate-spin rounded-full border-2 border-current border-t-transparent\" />\n {pendingLabel}\n </>\n ) : (\n children\n )}\n </button>\n );\n}\n","/** What an action came to, said in place: a success as a status, a failure as an alert by the control. */\nexport function Notice({ message, isFailure }: { message: string; isFailure: boolean }) {\n return isFailure ? (\n <p role=\"alert\" data-testid=\"overview-failure\" className=\"rounded-md border border-tone-attention-border bg-tone-attention-bg px-3 py-2 text-tone-attention-fg\">\n {message}\n </p>\n ) : (\n <p role=\"status\" data-testid=\"overview-success\" className=\"rounded-md border border-tone-ok-border bg-tone-ok-bg px-3 py-2 text-tone-ok-fg\">\n {message}\n </p>\n );\n}\n"],"names":["CREDENTIAL_KINDS","kind","label","credentialKindOf","sent","find","serverCredentialOf","fields","credentialKind","token","clientId","clientSecret","issuer","scope","CARD","BUTTON","BUTTONS","primary","secondary","destructive","INPUT","LABEL","OwnerField","choices","current","help","refusal","shown","some","choice","shipId","className","name","defaultValue","required","value","disabled","map","FOCUS_PATH","useFocusReport","fleetId","focus","report","isInFocus","document","visibilityState","hasFocus","undefined","EventSource","encodeURIComponent","close","window","addEventListener","removeEventListener","VARIANTS","ActionButton","isPending","pendingLabel","variant","children","button","Notice","message","isFailure","role"],"mappings":"6CAOO,IAAMA,EAAmB,CAC9B,CAAEC,KAAM,OAAQC,MAAO,eAAgB,EACvC,CAAED,KAAM,SAAUC,MAAO,cAAe,EACxC,CAAED,KAAM,oBAAqBC,MAAO,0BAA2B,EAChE,oBAUM,SAASC,AAAiBC,CAAY,EAC3C,OAAOJ,EAAiBK,IAAI,CAAC,CAAC,MAAEJ,CAAI,CAAE,GAAKA,IAASG,IAAOH,MAAQ,QACrE,eCpBA,IAAMc,EAAS,oGAEFC,EAAU,CACrBC,QAAS,CAAA,EAAGF,EAAO,0DAA0D,CAAC,CAC9EG,UAAW,CAAA,EAAGH,EAAO,6CAA6C,CAAC,CACnEI,YAAa,CAAA,EAAGJ,EAAO,2CAA2C,CAAC,AACrE,qBARoB,mFAYC,yFAEA,2CCfrB,EAAA,EAAA,CAAA,CAAA,kBAiBO,SAASO,AAAW,SAAEC,CAAO,SAAEC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AAU,gHACtD+B,IAGH,CAAA,EAAA,EAAA,GAAA,EAAC,IAAA,CAAEE,KAAK,SAAS,cAAY,mBAAmBjC,UAAU,2FACvD+B,GAGP"}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
(()=>{"use strict";module.exports=[30587,a=>{a.s(["H",0,"fleet","Q",0,{kind:"idle"}])},51636,a=>{let b=[{kind:"none",label:"No credential"},{kind:"bearer",label:"Bearer token"},{kind:"clientCredentials",label:"OAuth client credentials"}];a.s(["x",0,b,"C",0,function(a){return b.find(({kind:b})=>b===a)?.kind??"bearer"}])},88412,a=>{let b="inline-flex h-9 items-center justify-center gap-2 rounded-md px-4 font-medium disabled:opacity-60",c={primary:`${b} bg-primary text-primary-foreground hover:bg-primary-hover`,secondary:`${b} border border-border bg-card hover:bg-accent`,destructive:`${b} bg-destructive text-destructive-foreground`};a.s(["x",0,c,"r",0,"rounded-lg border border-border bg-card p-6 text-card-foreground shadow-sm","w",0,"h-9 w-full rounded-md border border-input bg-background px-3 font-mono text-code","z",0,"grid gap-1"])},36855,77237,a=>{var b=a.i(87924);a.s(["f",0,function({state:a,testId:c}){switch(a.kind){case"idle":return null;case"done":return(0,b.jsx)("p",{role:"status","data-testid":c,className:"rounded-md border border-tone-ok-border bg-tone-ok-bg px-3 py-2 text-tone-ok-fg",children:a.message});case"refused":case"openNetwork":return(0,b.jsx)("p",{role:"alert","data-testid":c,className:"rounded-md border border-tone-attention-border bg-tone-attention-bg px-3 py-2 text-tone-attention-fg",children:a.message})}}],36855);var c=a.i(35112),d=a.i(88412);a.s(["f",0,function({children:a,pending:e,kind:f="primary",testId:g}){let h=(0,c.useFormStatus)();return(0,b.jsx)("button",{type:"submit",className:d.x[f],disabled:h.pending,"aria-busy":h.pending,"data-testid":g,children:h.pending?e:a})}],77237)},35149,a=>{var b=a.i(87924),c=a.i(88412);a.s(["f",0,function({choices:a,current:d,help:e,refusal:f}){let g=null===d||a.some(a=>a.shipId===d.shipId)?a:[d,...a];return(0,b.jsxs)("label",{className:c.z,children:[(0,b.jsx)("span",{children:"Owner"}),(0,b.jsxs)("select",{className:c.w,name:"ownerShipId",defaultValue:d?.shipId??"",required:!0,"data-testid":"owner-field",children:[null===d?(0,b.jsx)("option",{value:"",disabled:!0,children:"Pick its owner"}):null,g.map(a=>(0,b.jsx)("option",{value:a.shipId,children:a.name},a.shipId))]}),(0,b.jsx)("span",{className:"text-muted-foreground",children:f??e})]})}])},
|
|
1
|
+
(()=>{"use strict";module.exports=[30587,a=>{a.s(["H",0,"fleet","Q",0,{kind:"idle"}])},51636,a=>{let b=[{kind:"none",label:"No credential"},{kind:"bearer",label:"Bearer token"},{kind:"clientCredentials",label:"OAuth client credentials"}];a.s(["x",0,b,"C",0,function(a){return b.find(({kind:b})=>b===a)?.kind??"bearer"}])},88412,a=>{let b="inline-flex h-9 items-center justify-center gap-2 rounded-md px-4 font-medium disabled:opacity-60",c={primary:`${b} bg-primary text-primary-foreground hover:bg-primary-hover`,secondary:`${b} border border-border bg-card hover:bg-accent`,destructive:`${b} bg-destructive text-destructive-foreground`};a.s(["x",0,c,"r",0,"rounded-lg border border-border bg-card p-6 text-card-foreground shadow-sm","w",0,"h-9 w-full rounded-md border border-input bg-background px-3 font-mono text-code","z",0,"grid gap-1"])},36855,77237,a=>{var b=a.i(87924);a.s(["f",0,function({state:a,testId:c}){switch(a.kind){case"idle":return null;case"done":return(0,b.jsx)("p",{role:"status","data-testid":c,className:"rounded-md border border-tone-ok-border bg-tone-ok-bg px-3 py-2 text-tone-ok-fg",children:a.message});case"refused":case"openNetwork":return(0,b.jsx)("p",{role:"alert","data-testid":c,className:"rounded-md border border-tone-attention-border bg-tone-attention-bg px-3 py-2 text-tone-attention-fg",children:a.message})}}],36855);var c=a.i(35112),d=a.i(88412);a.s(["f",0,function({children:a,pending:e,kind:f="primary",testId:g}){let h=(0,c.useFormStatus)();return(0,b.jsx)("button",{type:"submit",className:d.x[f],disabled:h.pending,"aria-busy":h.pending,"data-testid":g,children:h.pending?e:a})}],77237)},35149,a=>{var b=a.i(87924),c=a.i(88412);a.s(["f",0,function({choices:a,current:d,help:e,refusal:f}){let g=null===d||a.some(a=>a.shipId===d.shipId)?a:[d,...a];return(0,b.jsxs)("label",{className:c.z,children:[(0,b.jsx)("span",{children:"Owner"}),(0,b.jsxs)("select",{className:c.w,name:"ownerShipId",defaultValue:d?.shipId??"",required:!0,"data-testid":"owner-field",children:[null===d?(0,b.jsx)("option",{value:"",disabled:!0,children:"Pick its owner"}):null,g.map(a=>(0,b.jsx)("option",{value:a.shipId,children:a.name},a.shipId))]}),(0,b.jsx)("span",{className:"text-muted-foreground",children:f??e})]})}])},45677,a=>{a.s(["f",0,"scope:"])}]})();
|
|
2
2
|
|
|
3
3
|
//# sourceMappingURL=web_features_0xnlgtw8bfqaa._.js.map
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
(()=>{"use strict";module.exports=[29493,a=>{let b=[{kind:"none",label:"No credential"},{kind:"bearer",label:"Bearer token"},{kind:"clientCredentials",label:"OAuth client credentials"}];a.s(["x",0,b,"y",0,function(a){var c;let d=(c=a.credentialKind,b.find(({kind:a})=>a===c)?.kind??"bearer");switch(d){case"none":return{kind:d};case"bearer":return{kind:d,token:a.token};case"clientCredentials":return{kind:d,clientId:a.clientId,clientSecret:a.clientSecret,issuer:a.issuer,...""===a.scope?{}:{scope:a.scope}}}}])},13930,a=>{let b=(0,a.i(11857).registerClientReference)(function(){throw Error("Attempted to call ActionForm() from the server but ActionForm is on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"[project]/web/features/forms/ui/action-form.tsx","ActionForm");a.s(["ActionForm",0,b])},69372,a=>{var b=a.i(13930);a.n(b)},49144,a=>{let b="inline-flex h-9 items-center justify-center gap-2 rounded-md px-4 font-medium disabled:opacity-60",c={primary:`${b} bg-primary text-primary-foreground hover:bg-primary-hover`,secondary:`${b} border border-border bg-card hover:bg-accent`,destructive:`${b} bg-destructive text-destructive-foreground`};a.s(["x",0,c,"r",0,"rounded-lg border border-border bg-card p-6 text-card-foreground shadow-sm","w",0,"h-9 w-full rounded-md border border-input bg-background px-3 font-mono text-code","z",0,"grid gap-1"])},65253,98323,a=>{let b={mcpServer:{protocol:"MCP",side:"server"},mcpClient:{protocol:"MCP",side:"client"},a2aClient:{protocol:"A2A",side:"client"},a2aAgent:{protocol:"A2A",side:"server"}};a.s(["G",0,b,"Y",0,{commissioning:{tone:"active",label:"Commissioning"},awaitingCrew:{tone:"waiting",label:"Awaiting crew"},crewed:{tone:"ok",label:"Crewed"}},"N",0,{server:{one:"server",many:"servers"},client:{one:"client",many:"clients"}},"R",0,function(a){let c=a.map(a=>b[a.kind]),d=[...new Set(c.map(a=>a.protocol))];return{total:a.length,sides:{server:c.filter(a=>"server"===a.side).length,client:c.filter(a=>"client"===a.side).length},protocols:d.map(a=>({protocol:a,count:c.filter(b=>b.protocol===a).length}))}},"M",0,function(a){switch(a.kind){case"mcpServer":return a.url;case"mcpClient":return a.clientId;case"a2aClient":return null;case"a2aAgent":return a.cardUrl}}],65253);var c=a.i(7997);let d={waiting:"border-tone-waiting-border bg-tone-waiting-bg text-tone-waiting-fg",active:"border-tone-active-border bg-tone-active-bg text-tone-active-fg",ok:"border-tone-ok-border bg-tone-ok-bg text-tone-ok-fg",attention:"border-tone-attention-border bg-tone-attention-bg text-tone-attention-fg",ended:"border-tone-ended-border bg-tone-ended-bg text-tone-ended-fg"};a.s(["T",0,function({tone:a,label:b}){return(0,c.jsx)("span",{className:`inline-flex items-center rounded-full border px-2 text-caption ${d[a]}`,children:b})},"E",0,function({children:a,isMono:b=!1}){return(0,c.jsx)("span",{className:`inline-flex items-center rounded-md border border-border px-2 text-caption ${b?"font-mono":""}`,children:a})}],98323)},22126,a=>{var b=a.i(7997),c=a.i(49144);a.s(["f",0,function(){return(0,b.jsxs)("section",{className:c.r,"data-testid":"no-sign-in",children:[(0,b.jsx)("h2",{className:"text-heading font-semibold",children:"Nobody signs in here"}),(0,b.jsx)("p",{className:"mt-2 text-muted-foreground",children:"This gateway signs no one in to its pages: it is no app at pagasae."})]})}])}]})();
|
|
2
|
+
|
|
3
|
+
//# sourceMappingURL=web_features_10xz3ojtvfi7h._.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../../web/features/forms/server-credential.ts","../../../../../web/features/forms/ui/action-form.tsx/__nextjs-internal-proxy.mjs%20%7B%20server%20%3D%3E%20%22%5Bproject%5D/web/features/forms/ui/action-form.tsx%22%20%7D","../../../../../web/features/forms/ui/look.ts","../../../../../web/features/outside-parties/party-kinds.ts","../../../../../web/features/outside-parties/ui/status-badge.tsx","../../../../../web/features/sign-in/ui/no-sign-in.tsx"],"sourcesContent":["/**\n * An outside MCP server's credential, as the add, Parties and decision forms\n * take it: none for a server reached only on a private network, a static\n * bearer, or OAuth client credentials.\n */\n\n/** The credential kinds a form offers, with the words it shows. */\nexport const CREDENTIAL_KINDS = [\n { kind: 'none', label: 'No credential' },\n { kind: 'bearer', label: 'Bearer token' },\n { kind: 'clientCredentials', label: 'OAuth client credentials' },\n] as const;\n\nexport type CredentialKind = (typeof CREDENTIAL_KINDS)[number]['kind'];\n\nexport type ServerCredential =\n | { kind: 'none' }\n | { kind: 'bearer'; token: string }\n | { kind: 'clientCredentials'; clientId: string; clientSecret: string; issuer: string; scope?: string };\n\n/** The kind a form sent, a bearer when it sent none it knows. */\nexport function credentialKindOf(sent: string): CredentialKind {\n return CREDENTIAL_KINDS.find(({ kind }) => kind === sent)?.kind ?? 'bearer';\n}\n\n/** The credential the fields name: only the fields of its kind are read. */\nexport function serverCredentialOf(fields: { credentialKind: string; token: string; clientId: string; clientSecret: string; issuer: string; scope: string }): ServerCredential {\n const kind = credentialKindOf(fields.credentialKind);\n switch (kind) {\n case 'none':\n return { kind };\n case 'bearer':\n return { kind, token: fields.token };\n case 'clientCredentials':\n return { kind, clientId: fields.clientId, clientSecret: fields.clientSecret, issuer: fields.issuer, ...(fields.scope === '' ? {} : { scope: fields.scope }) };\n }\n}\n","// This file is generated by next-core EcmascriptClientReferenceModule.\nimport { registerClientReference } from \"react-server-dom-turbopack/server\";\nexport const ActionForm = registerClientReference(\n function() { throw new Error(\"Attempted to call ActionForm() from the server but ActionForm is on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.\"); },\n \"[project]/web/features/forms/ui/action-form.tsx\",\n \"ActionForm\",\n);\n","/** The classes the pages share, on the design tokens: a card and the button kinds. */\nexport const CARD = 'rounded-lg border border-border bg-card p-6 text-card-foreground shadow-sm';\n\nconst BUTTON = 'inline-flex h-9 items-center justify-center gap-2 rounded-md px-4 font-medium disabled:opacity-60';\n\nexport const BUTTONS = {\n primary: `${BUTTON} bg-primary text-primary-foreground hover:bg-primary-hover`,\n secondary: `${BUTTON} border border-border bg-card hover:bg-accent`,\n destructive: `${BUTTON} bg-destructive text-destructive-foreground`,\n} as const;\n\nexport type ButtonKind = keyof typeof BUTTONS;\n\nexport const INPUT = 'h-9 w-full rounded-md border border-input bg-background px-3 font-mono text-code';\n\nexport const LABEL = 'grid gap-1';\n","/**\n * An outside party is a party and its protocol (design B, How A2A slots\n * in): the protocol is a tag on every card and the list counts per\n * protocol, so an A2A agent joins as one more kind here.\n */\nimport type { inferRouterOutputs } from '@trpc/server';\n\nimport type { GatewayRouter } from '../../../src/adapters/trpc/router.js';\n\n/** An outside party as the API lists it. */\nexport type ListedParty = inferRouterOutputs<GatewayRouter>['parties']['list'][number];\n\n/** Which side an outside party is on: a server the fleet's ships call, or a client that calls them. */\nexport type Side = 'server' | 'client';\n\nexport const PARTY_KINDS: Record<ListedParty['kind'], { protocol: string; side: Side }> = {\n mcpServer: { protocol: 'MCP', side: 'server' },\n mcpClient: { protocol: 'MCP', side: 'client' },\n a2aClient: { protocol: 'A2A', side: 'client' },\n a2aAgent: { protocol: 'A2A', side: 'server' },\n};\n\n/** Where a party is reached or named outside: an MCP server's URL, an MCP client's id, an A2A agent's card address; an A2A client has none. */\nexport function outsideAddressOf(party: ListedParty): string | null {\n switch (party.kind) {\n case 'mcpServer':\n return party.url;\n case 'mcpClient':\n return party.clientId;\n case 'a2aClient':\n return null;\n case 'a2aAgent':\n return party.cardUrl;\n }\n}\n\nexport const SIDES: Record<Side, { one: string; many: string }> = {\n server: { one: 'server', many: 'servers' },\n client: { one: 'client', many: 'clients' },\n};\n\n/** The tones the design tokens colour a status by. */\nexport type Tone = 'waiting' | 'active' | 'ok' | 'attention' | 'ended';\n\n/** A proxy ship's state as the console shows a status. */\nexport const PARTY_STATES: Record<ListedParty['state'], { tone: Tone; label: string }> = {\n commissioning: { tone: 'active', label: 'Commissioning' },\n awaitingCrew: { tone: 'waiting', label: 'Awaiting crew' },\n crewed: { tone: 'ok', label: 'Crewed' },\n};\n\nexport interface Counts {\n total: number;\n sides: Record<Side, number>;\n protocols: { protocol: string; count: number }[];\n}\n\n/** How many outside parties the fleet has, per side and per protocol. */\nexport function countsOf(parties: readonly Pick<ListedParty, 'kind'>[]): Counts {\n const kinds = parties.map((party) => PARTY_KINDS[party.kind]);\n const protocols = [...new Set(kinds.map((kind) => kind.protocol))];\n return {\n total: parties.length,\n sides: { server: kinds.filter((kind) => kind.side === 'server').length, client: kinds.filter((kind) => kind.side === 'client').length },\n protocols: protocols.map((protocol) => ({ protocol, count: kinds.filter((kind) => kind.protocol === protocol).length })),\n };\n}\n","import type { Tone } from '../party-kinds';\n\nconst TONES: Record<Tone, string> = {\n waiting: 'border-tone-waiting-border bg-tone-waiting-bg text-tone-waiting-fg',\n active: 'border-tone-active-border bg-tone-active-bg text-tone-active-fg',\n ok: 'border-tone-ok-border bg-tone-ok-bg text-tone-ok-fg',\n attention: 'border-tone-attention-border bg-tone-attention-bg text-tone-attention-fg',\n ended: 'border-tone-ended-border bg-tone-ended-bg text-tone-ended-fg',\n};\n\n/** A status in its tone, as the console shows one. */\nexport function StatusBadge({ tone, label }: { tone: Tone; label: string }) {\n return <span className={`inline-flex items-center rounded-full border px-2 text-caption ${TONES[tone]}`}>{label}</span>;\n}\n\n/** A plain tag: a protocol, a side, an id. */\nexport function Tag({ children, isMono = false }: { children: React.ReactNode; isMono?: boolean }) {\n return <span className={`inline-flex items-center rounded-md border border-border px-2 text-caption ${isMono ? 'font-mono' : ''}`}>{children}</span>;\n}\n","import { CARD } from '../../forms/ui/look';\n\n/** A gateway that is no app at pagasae signs no one in to its pages (header design H5). */\nexport function NoSignIn() {\n return (\n <section className={CARD} data-testid=\"no-sign-in\">\n <h2 className=\"text-heading font-semibold\">Nobody signs in here</h2>\n <p className=\"mt-2 text-muted-foreground\">This gateway signs no one in to its pages: it is no app at pagasae.</p>\n </section>\n );\n}\n"],"names":["CREDENTIAL_KINDS","kind","label","credentialKindOf","sent","find","serverCredentialOf","fields","credentialKind","token","clientId","clientSecret","issuer","scope","ActionForm","Error","CARD","BUTTON","BUTTONS","primary","secondary","destructive","INPUT","LABEL","PARTY_KINDS","mcpServer","protocol","side","mcpClient","a2aClient","a2aAgent","outsideAddressOf","party","url","cardUrl","SIDES","server","one","many","client","PARTY_STATES","commissioning","tone","awaitingCrew","crewed","countsOf","parties","kinds","map","protocols","Set","total","length","sides","filter","count","NoSignIn","className"],"mappings":"6CAOO,IAAMA,EAAmB,CAC9B,CAAEC,KAAM,OAAQC,MAAO,eAAgB,EACvC,CAAED,KAAM,SAAUC,MAAO,cAAe,EACxC,CAAED,KAAM,oBAAqBC,MAAO,0BAA2B,EAChE,oBAeM,SAASI,AAAmBC,CAAwH,QACzJ,IAAMN,GANyBG,EAMDG,EAAjBJ,AAN8B,AAMNK,cAAc,CAL5CR,EAAiBK,IAAI,CAAC,CAAC,MAAEJ,CAAI,CAAE,GAAKA,IAASG,IAAOH,MAAQ,UAMnE,OAAQA,GACN,IAAK,OACH,MAAO,MAAEA,CAAK,CAChB,KAAK,SACH,MAAO,MAAEA,EAAMQ,MAAOF,EAAOE,KAAK,AAAC,CACrC,KAAK,oBACH,MAAO,MAAER,EAAMS,SAAUH,EAAOG,QAAQ,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AAC,IAAA,CAAEA,UAAU,sCAA6B,0EAGhD","ignoreList":[1]}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
(()=>{"use strict";module.exports=[30587,a=>{a.s(["H",0,"fleet","Q",0,{kind:"idle"}])},88412,a=>{let b="inline-flex h-9 items-center justify-center gap-2 rounded-md px-4 font-medium disabled:opacity-60",c={primary:`${b} bg-primary text-primary-foreground hover:bg-primary-hover`,secondary:`${b} border border-border bg-card hover:bg-accent`,destructive:`${b} bg-destructive text-destructive-foreground`};a.s(["x",0,c,"r",0,"rounded-lg border border-border bg-card p-6 text-card-foreground shadow-sm","w",0,"h-9 w-full rounded-md border border-input bg-background px-3 font-mono text-code","z",0,"grid gap-1"])},36855,77237,a=>{var b=a.i(87924);a.s(["f",0,function({state:a,testId:c}){switch(a.kind){case"idle":return null;case"done":return(0,b.jsx)("p",{role:"status","data-testid":c,className:"rounded-md border border-tone-ok-border bg-tone-ok-bg px-3 py-2 text-tone-ok-fg",children:a.message});case"refused":case"openNetwork":return(0,b.jsx)("p",{role:"alert","data-testid":c,className:"rounded-md border border-tone-attention-border bg-tone-attention-bg px-3 py-2 text-tone-attention-fg",children:a.message})}}],36855);var c=a.i(35112),d=a.i(88412);a.s(["f",0,function({children:a,pending:e,kind:f="primary",testId:g}){let h=(0,c.useFormStatus)();return(0,b.jsx)("button",{type:"submit",className:d.x[f],disabled:h.pending,"aria-busy":h.pending,"data-testid":g,children:h.pending?e:a})}],77237)},35149,a=>{var b=a.i(87924),c=a.i(88412);a.s(["f",0,function({choices:a,current:d,help:e,refusal:f}){let g=null===d||a.some(a=>a.shipId===d.shipId)?a:[d,...a];return(0,b.jsxs)("label",{className:c.z,children:[(0,b.jsx)("span",{children:"Owner"}),(0,b.jsxs)("select",{className:c.w,name:"ownerShipId",defaultValue:d?.shipId??"",required:!0,"data-testid":"owner-field",children:[null===d?(0,b.jsx)("option",{value:"",disabled:!0,children:"Pick its owner"}):null,g.map(a=>(0,b.jsx)("option",{value:a.shipId,children:a.name},a.shipId))]}),(0,b.jsx)("span",{className:"text-muted-foreground",children:f??e})]})}])},
|
|
1
|
+
(()=>{"use strict";module.exports=[30587,a=>{a.s(["H",0,"fleet","Q",0,{kind:"idle"}])},88412,a=>{let b="inline-flex h-9 items-center justify-center gap-2 rounded-md px-4 font-medium disabled:opacity-60",c={primary:`${b} bg-primary text-primary-foreground hover:bg-primary-hover`,secondary:`${b} border border-border bg-card hover:bg-accent`,destructive:`${b} bg-destructive text-destructive-foreground`};a.s(["x",0,c,"r",0,"rounded-lg border border-border bg-card p-6 text-card-foreground shadow-sm","w",0,"h-9 w-full rounded-md border border-input bg-background px-3 font-mono text-code","z",0,"grid gap-1"])},36855,77237,a=>{var b=a.i(87924);a.s(["f",0,function({state:a,testId:c}){switch(a.kind){case"idle":return null;case"done":return(0,b.jsx)("p",{role:"status","data-testid":c,className:"rounded-md border border-tone-ok-border bg-tone-ok-bg px-3 py-2 text-tone-ok-fg",children:a.message});case"refused":case"openNetwork":return(0,b.jsx)("p",{role:"alert","data-testid":c,className:"rounded-md border border-tone-attention-border bg-tone-attention-bg px-3 py-2 text-tone-attention-fg",children:a.message})}}],36855);var c=a.i(35112),d=a.i(88412);a.s(["f",0,function({children:a,pending:e,kind:f="primary",testId:g}){let h=(0,c.useFormStatus)();return(0,b.jsx)("button",{type:"submit",className:d.x[f],disabled:h.pending,"aria-busy":h.pending,"data-testid":g,children:h.pending?e:a})}],77237)},35149,a=>{var b=a.i(87924),c=a.i(88412);a.s(["f",0,function({choices:a,current:d,help:e,refusal:f}){let g=null===d||a.some(a=>a.shipId===d.shipId)?a:[d,...a];return(0,b.jsxs)("label",{className:c.z,children:[(0,b.jsx)("span",{children:"Owner"}),(0,b.jsxs)("select",{className:c.w,name:"ownerShipId",defaultValue:d?.shipId??"",required:!0,"data-testid":"owner-field",children:[null===d?(0,b.jsx)("option",{value:"",disabled:!0,children:"Pick its owner"}):null,g.map(a=>(0,b.jsx)("option",{value:a.shipId,children:a.name},a.shipId))]}),(0,b.jsx)("span",{className:"text-muted-foreground",children:f??e})]})}])},45677,a=>{a.s(["f",0,"scope:"])}]})();
|
|
2
2
|
|
|
3
3
|
//# sourceMappingURL=web_features_1_2m6l73qk7qw._.js.map
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
module.exports=[96001,a=>{"use strict";var b=a.i(87924),c=a.i(72131),d=a.i(30587),e=a.i(60224),f=a.i(88412),g=a.i(36855),h=a.i(35149),i=a.i(77237),j=a.i(
|
|
1
|
+
module.exports=[96001,a=>{"use strict";var b=a.i(87924),c=a.i(72131),d=a.i(30587),e=a.i(60224),f=a.i(88412),g=a.i(36855),h=a.i(35149),i=a.i(77237),j=a.i(45677),k=a.i(5050);let l=(0,k.createServerReference)("60e1372b310028e4e5b6cd63f53b452da1eb63833d",k.callServer,void 0,k.findSourceMapURL,"addA2aAgent"),m={kind:"idle"};a.s(["A2aAgentForm",0,function({fleetId:a,requestId:k,owners:n,scopes:o}){let[p,q]=(0,c.useActionState)(l,m),r="refused"===p.kind?p.fields:{};return(0,b.jsxs)("form",{action:q,className:`${f.r} grid gap-3`,"data-testid":"add-a2a-agent-form",children:[(0,b.jsx)("input",{type:"hidden",name:d.H,value:a}),(0,b.jsx)("input",{type:"hidden",name:"requestId",value:k}),(0,b.jsx)("h1",{className:"text-title font-semibold",children:"Add an A2A agent"}),(0,b.jsx)(g.f,{state:"refused"===p.kind?p:{kind:"idle"}}),(0,b.jsxs)("label",{className:f.z,children:[(0,b.jsx)("span",{children:"Name, the proxy ship's"}),(0,b.jsx)("input",{className:f.w,name:"name",defaultValue:r.name??"",required:!0})]}),(0,b.jsxs)("label",{className:f.z,children:[(0,b.jsx)("span",{children:"Card address"}),(0,b.jsx)("input",{className:f.w,type:"url",name:"cardUrl",defaultValue:r.cardUrl??"",placeholder:"https://agent.example.com/.well-known/agent-card.json",required:!0}),(0,b.jsx)("span",{className:"text-caption text-muted-foreground",children:"The gateway reads the card first: an agent whose card it cannot state is not added."})]}),(0,b.jsx)(e.f,{legend:"The agent's credential",fields:r,noneHelp:"The gateway sends no credential: for an agent that asks for none."}),(0,b.jsxs)("label",{className:f.z,children:[(0,b.jsx)("span",{children:"Messages in flight at once"}),(0,b.jsx)("input",{className:f.w,type:"number",name:"concurrencyLimit",min:1,max:10,defaultValue:r.concurrencyLimit??"4"})]}),(0,b.jsx)(h.f,{choices:n.isOk?n.value:[],current:null,help:"A person ship or argo. It answers for this agent.",refusal:n.isOk?void 0:n.refusal}),0===o.length?null:(0,b.jsxs)("fieldset",{className:"grid gap-2",children:[(0,b.jsx)("legend",{className:"font-medium",children:"Scopes, beside sending and receiving"}),o.map(a=>(0,b.jsxs)("label",{className:"flex items-center gap-2",children:[(0,b.jsx)("input",{type:"checkbox",name:`${j.f}${a}`,defaultChecked:void 0!==r[`${j.f}${a}`]}),(0,b.jsx)("span",{className:"font-mono text-code",children:a})]},a))]}),(0,b.jsx)("div",{children:(0,b.jsx)(i.f,{pending:"Reading the card…",children:"Add"})})]})}],96001)}];
|
|
2
2
|
|
|
3
3
|
//# sourceMappingURL=web_features_add-a2a-agent_ui_a2a-agent-form_tsx_0z8t1aalwzyl7._.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../web/features/add-a2a-agent/ui/a2a-agent-form.tsx","../../../../../web/features/add-a2a-agent/data%
|
|
1
|
+
{"version":3,"sources":["../../../../../web/features/add-a2a-agent/ui/a2a-agent-form.tsx","../../../../../web/features/add-a2a-agent/data%3Aba1fc8%20%3Ctext/javascript%3E"],"sourcesContent":["'use client';\n\nimport { useActionState } from 'react';\n\nimport { FLEET_FIELD } from '../../forms/form-state';\nimport { CredentialFields } from '../../forms/ui/credential-fields';\nimport { CARD, INPUT, LABEL } from '../../forms/ui/look';\nimport { Outcome } from '../../forms/ui/outcome';\nimport { OwnerField, type OwnerChoices } from '../../forms/ui/owner-field';\nimport { SubmitButton } from '../../forms/ui/submit-button';\nimport { SCOPE_FIELD_PREFIX } from '../../outside-party/scope-changes';\nimport { addA2aAgent, type AddA2aAgentState } from '../actions';\n\nconst IDLE: AddA2aAgentState = { kind: 'idle' };\n\nconst CONCURRENCY_LIMIT_DEFAULT = '4';\n\n/** The form that adds an A2A agent: its name, card address, credential and calls at once, its owner and the approver's own scopes to tick. */\nexport function A2aAgentForm({ fleetId, requestId, owners, scopes }: { fleetId: string; requestId: string; owners: OwnerChoices; scopes: readonly string[] }) {\n const [state, action] = useActionState(addA2aAgent, IDLE);\n const fields = state.kind === 'refused' ? state.fields : {};\n return (\n <form action={action} className={`${CARD} grid gap-3`} data-testid=\"add-a2a-agent-form\">\n <input type=\"hidden\" name={FLEET_FIELD} value={fleetId} />\n <input type=\"hidden\" name=\"requestId\" value={requestId} />\n <h1 className=\"text-title font-semibold\">Add an A2A agent</h1>\n <Outcome state={state.kind === 'refused' ? state : { kind: 'idle' }} />\n <label className={LABEL}>\n <span>Name, the proxy ship's</span>\n <input className={INPUT} name=\"name\" defaultValue={fields.name ?? ''} required />\n </label>\n <label className={LABEL}>\n <span>Card address</span>\n <input className={INPUT} type=\"url\" name=\"cardUrl\" defaultValue={fields.cardUrl ?? ''} placeholder=\"https://agent.example.com/.well-known/agent-card.json\" required />\n <span className=\"text-caption text-muted-foreground\">The gateway reads the card first: an agent whose card it cannot state is not added.</span>\n </label>\n <CredentialFields legend=\"The agent's credential\" fields={fields} noneHelp=\"The gateway sends no credential: for an agent that asks for none.\" />\n <label className={LABEL}>\n <span>Messages in flight at once</span>\n <input className={INPUT} type=\"number\" name=\"concurrencyLimit\" min={1} max={10} defaultValue={fields.concurrencyLimit ?? CONCURRENCY_LIMIT_DEFAULT} />\n </label>\n <OwnerField choices={owners.isOk ? owners.value : []} current={null} help=\"A person ship or argo. It answers for this agent.\" refusal={owners.isOk ? undefined : owners.refusal} />\n {scopes.length === 0 ? null : (\n <fieldset className=\"grid gap-2\">\n <legend className=\"font-medium\">Scopes, beside sending and receiving</legend>\n {scopes.map((scope) => (\n <label key={scope} className=\"flex items-center gap-2\">\n <input type=\"checkbox\" name={`${SCOPE_FIELD_PREFIX}${scope}`} defaultChecked={fields[`${SCOPE_FIELD_PREFIX}${scope}`] !== undefined} />\n <span className=\"font-mono text-code\">{scope}</span>\n </label>\n ))}\n </fieldset>\n )}\n <div>\n <SubmitButton pending=\"Reading the card…\">Add</SubmitButton>\n </div>\n </form>\n );\n}\n","/* __next_internal_action_entry_do_not_use__ [{\"60e1372b310028e4e5b6cd63f53b452da1eb63833d\":{\"name\":\"addA2aAgent\"}},\"web/features/add-a2a-agent/actions.ts\",\"\"] */\"use turbopack: no side effects\";import{createServerReference,callServer,findSourceMapURL}from\"private-next-rsc-action-client-wrapper\";const $$RSC_SERVER_ACTION_0=/*#__PURE__*/createServerReference(\"60e1372b310028e4e5b6cd63f53b452da1eb63833d\",callServer,void 0,findSourceMapURL,\"addA2aAgent\");export{$$RSC_SERVER_ACTION_0 as addA2aAgent};"],"names":["$$RSC_SERVER_ACTION_0"],"mappings":"wDAEA,EAAA,EAAA,CAAA,CAAA,OAEA,EAAA,EAAA,CAAA,CAAA,OACA,EAAA,EAAA,CAAA,CAAA,OACA,EAAA,EAAA,CAAA,CAAA,OACA,EAAA,EAAA,CAAA,CAAA,OACA,EAAA,EAAA,CAAA,CAAA,OACA,EAAA,EAAA,CAAA,CAAA,OACA,EAAA,EAAA,CAAA,CAAA,OCVmM,EAAA,EAAA,CAAA,CAAA,MAAsG,IAAMA,EAAmC,CAAA,EAAA,EAAA,iBAAb,IAAa,AAAqB,EAAC,KAAxB,wCAAqE,EAAA,UAAU,CAAC,KAAK,EAAE,EAAA,gBAAgB,CAAC,eDalb,EAAyB,CAAE,KAAM,MAAO,wBAKvC,SAAS,AAAa,SAAE,CAAO,WAAE,CAAS,QAAE,CAAM,QAAE,CAAM,CAA2F,EAC1J,GAAM,CAAC,EAAO,EAAO,CAAG,CAAA,EAAA,EAAA,cAAc,AAAd,EAAe,EAAa,GAC9C,EAAwB,YAAf,EAAM,IAAI,CAAiB,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=[90344,a=>{"use strict";var b=a.i(87924),c=a.i(72131),d=a.i(25959),e=a.i(30587),f=a.i(88412),g=a.i(36855),h=a.i(35149),i=a.i(77237),j=a.i(45677),k=a.i(5050);let l=(0,k.createServerReference)("603cbf887d58be5debb93c1e2bfea0e8983e157c11",k.callServer,void 0,k.findSourceMapURL,"addA2aClient"),m={kind:"idle"};function n({name:a,bearer:c,fleetId:e}){return(0,b.jsxs)("section",{className:`${f.r} grid gap-3`,"data-testid":"add-a2a-client-added",children:[(0,b.jsxs)("h2",{className:"text-section font-semibold",children:[a," is added"]}),(0,b.jsx)("p",{children:"Hand its client this bearer now. It is shown only once: the gateway keeps no copy it can show again."}),(0,b.jsx)("code",{className:"break-all rounded-md border border-border bg-background px-3 py-2 font-mono text-code","data-testid":"add-a2a-client-bearer",children:c}),(0,b.jsx)("p",{children:(0,b.jsx)("a",{href:(0,d.f)(`/outside-parties/${encodeURIComponent(a)}`,e),className:"text-primary hover:underline",children:"Its card addresses"})})]})}a.s(["A2aClientForm",0,function({fleetId:a,requestId:d,owners:k,scopes:o}){let[p,q]=(0,c.useActionState)(l,m);return"added"===p.kind?(0,b.jsx)(n,{name:p.name,bearer:p.bearer,fleetId:a}):(0,b.jsxs)("form",{action:q,className:`${f.r} grid gap-3`,"data-testid":"add-a2a-client-form",children:[(0,b.jsx)("input",{type:"hidden",name:e.H,value:a}),(0,b.jsx)("input",{type:"hidden",name:"requestId",value:d}),(0,b.jsx)("h1",{className:"text-title font-semibold",children:"Add an A2A client"}),(0,b.jsxs)("label",{className:f.z,children:[(0,b.jsx)("span",{children:"Name, the proxy ship's"}),(0,b.jsx)("input",{className:f.w,name:"name",required:!0})]}),(0,b.jsx)(h.f,{choices:k.isOk?k.value:[],current:null,help:"A person ship or argo. It answers for this client.",refusal:k.isOk?void 0:k.refusal}),0===o.length?null:(0,b.jsxs)("fieldset",{className:"grid gap-2",children:[(0,b.jsx)("legend",{className:"font-medium",children:"Scopes, beside sending and receiving"}),o.map(a=>(0,b.jsxs)("label",{className:"flex items-center gap-2",children:[(0,b.jsx)("input",{type:"checkbox",name:`${j.f}${a}`}),(0,b.jsx)("span",{className:"font-mono text-code",children:a})]},a))]}),(0,b.jsx)("div",{children:(0,b.jsx)(i.f,{pending:"Adding…",children:"Add"})}),(0,b.jsx)(g.f,{state:"refused"===p.kind?p:{kind:"idle"}})]})}],90344)}];
|
|
2
2
|
|
|
3
3
|
//# sourceMappingURL=web_features_add-a2a-client_ui_a2a-client-form_tsx_1anv88g385nwe._.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../web/features/add-a2a-client/ui/a2a-client-form.tsx","../../../../../web/features/outside-parties/paths.ts","../../../../../web/features/add-a2a-client/data%
|
|
1
|
+
{"version":3,"sources":["../../../../../web/features/add-a2a-client/ui/a2a-client-form.tsx","../../../../../web/features/outside-parties/paths.ts","../../../../../web/features/add-a2a-client/data%3A807290%20%3Ctext/javascript%3E"],"sourcesContent":["'use client';\n\nimport { useActionState } from 'react';\n\nimport { inFleet } from '../../../lib/gateway-api/page-account';\nimport { FLEET_FIELD } from '../../forms/form-state';\nimport { CARD, INPUT, LABEL } from '../../forms/ui/look';\nimport { Outcome } from '../../forms/ui/outcome';\nimport { OwnerField, type OwnerChoices } from '../../forms/ui/owner-field';\nimport { SubmitButton } from '../../forms/ui/submit-button';\nimport { partyPath } from '../../outside-parties/paths';\nimport { SCOPE_FIELD_PREFIX } from '../../outside-party/scope-changes';\nimport { addA2aClient, type AddA2aClientState } from '../actions';\n\nconst IDLE: AddA2aClientState = { kind: 'idle' };\n\n/** The bearer, shown this once: the gateway keeps only its hash. */\nfunction Added({ name, bearer, fleetId }: { name: string; bearer: string; fleetId: string }) {\n return (\n <section className={`${CARD} grid gap-3`} data-testid=\"add-a2a-client-added\">\n <h2 className=\"text-section font-semibold\">{name} is added</h2>\n <p>Hand its client this bearer now. It is shown only once: the gateway keeps no copy it can show again.</p>\n <code className=\"break-all rounded-md border border-border bg-background px-3 py-2 font-mono text-code\" data-testid=\"add-a2a-client-bearer\">\n {bearer}\n </code>\n <p>\n <a href={inFleet(partyPath(name), fleetId)} className=\"text-primary hover:underline\">\n Its card addresses\n </a>\n </p>\n </section>\n );\n}\n\n/** The form that adds an A2A client: its name, owner and the approver's own scopes to tick; then its bearer. */\nexport function A2aClientForm({ fleetId, requestId, owners, scopes }: { fleetId: string; requestId: string; owners: OwnerChoices; scopes: readonly string[] }) {\n const [state, action] = useActionState(addA2aClient, IDLE);\n if (state.kind === 'added') {\n return <Added name={state.name} bearer={state.bearer} fleetId={fleetId} />;\n }\n return (\n <form action={action} className={`${CARD} grid gap-3`} data-testid=\"add-a2a-client-form\">\n <input type=\"hidden\" name={FLEET_FIELD} value={fleetId} />\n <input type=\"hidden\" name=\"requestId\" value={requestId} />\n <h1 className=\"text-title font-semibold\">Add an A2A client</h1>\n <label className={LABEL}>\n <span>Name, the proxy ship's</span>\n <input className={INPUT} name=\"name\" required />\n </label>\n <OwnerField choices={owners.isOk ? owners.value : []} current={null} help=\"A person ship or argo. It answers for this client.\" refusal={owners.isOk ? undefined : owners.refusal} />\n {scopes.length === 0 ? null : (\n <fieldset className=\"grid gap-2\">\n <legend className=\"font-medium\">Scopes, beside sending and receiving</legend>\n {scopes.map((scope) => (\n <label key={scope} className=\"flex items-center gap-2\">\n <input type=\"checkbox\" name={`${SCOPE_FIELD_PREFIX}${scope}`} />\n <span className=\"font-mono text-code\">{scope}</span>\n </label>\n ))}\n </fieldset>\n )}\n <div>\n <SubmitButton pending=\"Adding…\">Add</SubmitButton>\n </div>\n <Outcome state={state.kind === 'refused' ? state : { kind: 'idle' }} />\n </form>\n );\n}\n","/** The outside parties' pages. */\nexport const OUTSIDE_PARTIES_PATH = '/outside-parties';\n\nexport const ADD_SERVER_PATH = `${OUTSIDE_PARTIES_PATH}/add`;\n\nexport const ADD_A2A_CLIENT_PATH = `${OUTSIDE_PARTIES_PATH}/add-a2a-client`;\n\nexport const ADD_A2A_AGENT_PATH = `${OUTSIDE_PARTIES_PATH}/add-a2a-agent`;\n\n/** One outside party's page, or one of its own: changing it, retiring it. */\nexport function partyPath(name: string, action?: 'change' | 'retire'): string {\n return `${OUTSIDE_PARTIES_PATH}/${encodeURIComponent(name)}${action === undefined ? '' : `/${action}`}`;\n}\n","/* __next_internal_action_entry_do_not_use__ [{\"603cbf887d58be5debb93c1e2bfea0e8983e157c11\":{\"name\":\"addA2aClient\"}},\"web/features/add-a2a-client/actions.ts\",\"\"] */\"use turbopack: no side effects\";import{createServerReference,callServer,findSourceMapURL}from\"private-next-rsc-action-client-wrapper\";const $$RSC_SERVER_ACTION_0=/*#__PURE__*/createServerReference(\"603cbf887d58be5debb93c1e2bfea0e8983e157c11\",callServer,void 0,findSourceMapURL,\"addA2aClient\");export{$$RSC_SERVER_ACTION_0 as addA2aClient};"],"names":["OUTSIDE_PARTIES_PATH","ADD_SERVER_PATH","ADD_A2A_CLIENT_PATH","ADD_A2A_AGENT_PATH","partyPath","name","action","encodeURIComponent","undefined"],"mappings":"wDAEA,EAAA,EAAA,CAAA,CAAA,OAEA,EAAA,EAAA,CAAA,CAAA,OACA,EAAA,EAAA,CAAA,CAAA,OACA,EAAA,EAAA,CAAA,CAAA,OACA,EAAA,EAAA,CAAA,CAAA,OACA,EAAA,EAAA,CAAA,CAAA,OACA,EAAA,EAAA,CAAA,CAAA,OAEA,EAAA,EAAA,CAAA,CAAA,OEXqM,EAAA,EAAA,CAAA,CAAA,MAAsG,IAAM,EAAmC,CAAA,EAAA,EAAA,iBAAb,IAAa,AAAqB,EAAC,KAAxB,wCAAqE,EAAA,UAAU,CAAC,KAAK,EAAE,EAAA,gBAAgB,CAAC,gBFcpb,EAA0B,CAAE,KAAM,MAAO,EAG/C,SAAS,EAAM,MAAE,CAAI,QAAE,CAAM,SAAE,CAAO,CAAqD,EACzF,MACE,CAAA,EAAA,EAAA,IAAA,EAAC,UAAA,CAAQ,UAAW,CAAA,EAAG,EAAA,CAAI,CAAC,WAAW,CAA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AA,EAAC,OAAA,UAAK,2BACN,CAAA,EAAA,EAAA,GAAA,EAAC,QAAA,CAAM,UAAW,EAAA,CAAK,CAAE,KAAK,OAAO,QAAQ,CAAA,CAAA,OAE/C,CAAA,EAAA,EAAA,GAAA,EAAC,EAAA,CAAU,CAAA,CAAC,QAAS,EAAO,IAAI,CAAG,EAAO,KAAK,CAAG,EAAE,CAAE,QAAS,KAAM,KAAK,qDAAqD,QAAS,EAAO,IAAI,MAAG,EAAY,EAAO,OAAO,GAC7J,IAAlB,EAAO,MAAM,CAAS,KACrB,CAAA,EAAA,EAAA,IAAA,EAAC,WAAA,CAAS,UAAU,uBAClB,CAAA,EAAA,EAAA,GAAA,EAAC,SAAA,CAAO,UAAU,uBAAc,yCAC/B,EAAO,GAAG,CAAC,AAAC,GACX,CAAA,EAAA,EAAA,IAAA,EAAC,QAAA,CAAkB,UAAU,oCAC3B,CAAA,EAAA,EAAA,GAAA,EAAC,QAAA,CAAM,KAAK,WAAW,KAAM,CAAA,EAAG,EAAA,CAAkB,CAAA,EAAG,EAAA,CAAO,GAC5D,CAAA,EAAA,EAAA,GAAA,EAAC,OAAA,CAAK,UAAU,+BAAuB,MAF7B,OAOlB,CAAA,EAAA,EAAA,GAAA,EAAC,MAAA,UACC,CAAA,EAAA,EAAA,GAAA,EAAC,EAAA,CAAY,CAAA,CAAC,QAAQ,mBAAU,UAElC,CAAA,EAAA,EAAA,GAAA,EAAC,EAAA,CAAO,CAAA,CAAC,MAAsB,YAAf,EAAM,IAAI,CAAiB,EAAQ,CAAE,KAAM,MAAO,MAGxE"}
|
package/web/.next/server/chunks/ssr/web_features_add-server_ui_add-server_tsx_1jnmar5xju49k._.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
module.exports=[29372,a=>{"use strict";var b=a.i(87924),c=a.i(72131),d=a.i(30587),e=a.i(60224),f=a.i(88412),g=a.i(36855),h=a.i(35149),i=a.i(77237),j=a.i(10020),k=a.i(47763);function l({tool:a,control:c,testId:d}){let{name:e,description:f,isReadOnly:g,isNew:h=!1}=a,i=void 0===f?"":f.split("\n").map(a=>a.trim()).find(a=>""!==a)??"",j=void 0!==f&&f.trim()!==i;return(0,b.jsxs)("li",{className:"grid gap-1 border-b border-border py-2 last:border-b-0","data-testid":d,children:[(0,b.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[c,(0,b.jsx)("span",{className:"font-mono",children:e}),g?(0,b.jsx)(k.E,{children:"reads only"}):null,h?(0,b.jsx)(k.T,{tone:"attention",label:"New"}):null]}),""===i?null:j?(0,b.jsxs)("details",{className:"text-muted-foreground",children:[(0,b.jsx)("summary",{className:"cursor-pointer",children:i}),(0,b.jsx)("p",{className:"mt-1 whitespace-pre-line",children:f})]}):(0,b.jsx)("p",{className:"text-muted-foreground",children:i})]})}var m=a.i(5050);let n=(0,m.createServerReference)("
|
|
1
|
+
module.exports=[29372,a=>{"use strict";var b=a.i(87924),c=a.i(72131),d=a.i(30587),e=a.i(60224),f=a.i(88412),g=a.i(36855),h=a.i(35149),i=a.i(77237),j=a.i(10020),k=a.i(47763);function l({tool:a,control:c,testId:d}){let{name:e,description:f,isReadOnly:g,isNew:h=!1}=a,i=void 0===f?"":f.split("\n").map(a=>a.trim()).find(a=>""!==a)??"",j=void 0!==f&&f.trim()!==i;return(0,b.jsxs)("li",{className:"grid gap-1 border-b border-border py-2 last:border-b-0","data-testid":d,children:[(0,b.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[c,(0,b.jsx)("span",{className:"font-mono",children:e}),g?(0,b.jsx)(k.E,{children:"reads only"}):null,h?(0,b.jsx)(k.T,{tone:"attention",label:"New"}):null]}),""===i?null:j?(0,b.jsxs)("details",{className:"text-muted-foreground",children:[(0,b.jsx)("summary",{className:"cursor-pointer",children:i}),(0,b.jsx)("p",{className:"mt-1 whitespace-pre-line",children:f})]}):(0,b.jsx)("p",{className:"text-muted-foreground",children:i})]})}var m=a.i(5050);let n=(0,m.createServerReference)("6050e72c4951cfe2c298e4f22266f17e9b82c186a1",m.callServer,void 0,m.findSourceMapURL,"approveServer"),o=(0,m.createServerReference)("6066f7418afb7b8e3bbfe4ab46e1e2b04b0a09599e",m.callServer,void 0,m.findSourceMapURL,"checkServer"),p=["Address","Check","Owner"],q=["url","credentialKind","token","clientId","clientSecret","issuer","scope"];function r({at:a}){return(0,b.jsx)("ol",{className:"flex gap-4",children:p.map((c,d)=>(0,b.jsxs)("li",{"aria-current":d===a?"step":void 0,className:d<=a?"font-medium":"text-muted-foreground",children:[d+1," ",c]},c))})}function s({refusal:a}){return void 0===a?null:(0,b.jsx)(g.f,{state:{kind:"refused",message:a}})}function t({state:a,action:c,fleetId:g}){return(0,b.jsxs)("form",{action:c,className:`${f.r} grid gap-3`,"data-testid":"add-server-address",children:[(0,b.jsx)("input",{type:"hidden",name:d.H,value:g}),(0,b.jsx)(s,{refusal:a.refusal}),(0,b.jsxs)("label",{className:f.z,children:[(0,b.jsx)("span",{children:"Streamable HTTP address"}),(0,b.jsx)("input",{className:f.w,type:"url",name:"url",defaultValue:a.fields.url??"",placeholder:"https://mcp.example.com/mcp",required:!0})]}),(0,b.jsx)(e.f,{legend:"The server's credential",fields:a.fields,noneHelp:"The gateway sends no credential: for a server reached only on a private network."}),(0,b.jsx)("div",{children:(0,b.jsx)(i.f,{pending:"Checking the server…",testId:"add-server-check",children:"Check the server"})})]})}function u({tools:a,canSwitch:d}){let[e,f]=(0,c.useState)(new Set),g=a.length-e.size;return(0,b.jsxs)("section",{className:"grid gap-2","data-testid":"add-server-tools",children:[(0,b.jsxs)("h2",{className:"flex flex-wrap justify-between gap-2 text-section font-semibold",children:[(0,b.jsxs)("span",{children:["The server answers: ",a.length," ",1===a.length?"tool":"tools"]}),d?(0,b.jsxs)("span",{role:"status",className:"font-normal text-muted-foreground","data-testid":"add-server-tools-on",children:[g," of ",a.length," on"]}):null]}),(0,b.jsx)("p",{className:"text-muted-foreground",children:d?"The fleet may call only the tools switched on. A tool the server adds later starts off.":"Switching tools needs gateway:approve: every tool starts on, and an approver switches them on its page."}),(0,b.jsx)("ul",{className:"grid",children:a.map(a=>{let c=!e.has(a.name);return(0,b.jsx)(l,{tool:a,testId:"add-server-tool",control:d?(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)("input",{type:"hidden",name:"toolShown",value:a.name}),c?(0,b.jsx)("input",{type:"hidden",name:"toolOn",value:a.name}):null,(0,b.jsx)(j.f,{isOn:c,label:a.name,onClick:()=>{var b;b=a.name,f(a=>{let c=new Set(a);return c.delete(b)||c.add(b),c})}})]}):null},a.name)})})]})}function v({state:a,refused:e,action:g,onBack:j,fleetId:k,canSwitchTools:l}){let m,n="refused"===e.kind&&e.requestId===a.requestId,o=n?e.fields:a.fields,p=o.url??"",[r,t]=(0,c.useState)(o.name??function(a){if(!URL.canParse(a))return"";let{hostname:b}=new URL(a);return/^\d+(\.\d+){3}$/.test(b)||b.startsWith("[")?"":(b.split(".").filter(a=>"mcp"!==a&&"www"!==a)[0]??"").toLowerCase().replaceAll(/[^a-z0-9]+/g,"-").replaceAll(/^-+|-+$/g,"")}(p));return(0,b.jsx)(b.Fragment,{children:(0,b.jsxs)("form",{action:g,className:`${f.r} grid gap-3`,"data-testid":"add-server-owner",children:[(0,b.jsx)(u,{tools:a.tools,canSwitch:l}),(0,b.jsx)("h2",{className:"text-section font-semibold",children:"Its owner"}),(0,b.jsx)(s,{refusal:n?e.message:void 0}),(0,b.jsx)("input",{type:"hidden",name:d.H,value:k}),(0,b.jsx)("input",{type:"hidden",name:"requestId",value:a.requestId}),q.map(a=>(0,b.jsx)("input",{type:"hidden",name:a,value:o[a]??""},a)),(0,b.jsx)("p",{className:"font-mono text-muted-foreground",children:p}),(0,b.jsxs)("label",{className:f.z,children:[(0,b.jsx)("span",{children:"Proxy ship's name"}),(0,b.jsx)("input",{className:f.w,type:"text",name:"name",value:r,onChange:a=>{t(a.target.value)},required:!0})]}),(0,b.jsx)(h.f,{choices:a.owners,current:a.owners.find(a=>a.shipId===o.ownerShipId)??null,help:"A person ship or argo. It answers for this server."}),(0,b.jsxs)("label",{className:f.z,children:[(0,b.jsx)("span",{children:"Calls at once"}),(0,b.jsx)("input",{className:f.w,type:"number",name:"concurrencyLimit",min:1,max:10,defaultValue:o.concurrencyLimit??"4"})]}),(0,b.jsxs)("div",{className:"flex gap-2",children:[(0,b.jsx)(i.f,{pending:"Adding…",testId:"add-server-approve",children:""===(m=r.trim())?"Add as outside party":m.length>20?`Add ${m.slice(0,20)}…`:`Add ${m}`}),(0,b.jsx)("button",{type:"button",className:f.x.secondary,onClick:j,children:"Back to the address"})]})]})})}a.s(["AddServer",0,function({fleetId:a,canSwitchTools:d}){let[e,f]=(0,c.useActionState)(o,{step:"address",fields:{}}),[g,h]=(0,c.useActionState)(n,{kind:"idle"}),[i,j]=(0,c.useState)(void 0),k="owner"===e.step&&i!==e.requestId?e:void 0;return(0,b.jsxs)("div",{className:"grid gap-4",children:[(0,b.jsx)("h1",{className:"text-title font-semibold",children:"Add MCP server"}),(0,b.jsx)(r,{at:2*(void 0!==k)}),void 0===k?(0,b.jsx)(t,{state:e,action:f,fleetId:a}):(0,b.jsx)(v,{state:k,refused:g,action:h,onBack:()=>{j(k.requestId)},fleetId:a,canSwitchTools:d})]})}],29372)}];
|
|
2
2
|
|
|
3
3
|
//# sourceMappingURL=web_features_add-server_ui_add-server_tsx_1jnmar5xju49k._.js.map
|
package/web/.next/server/chunks/ssr/web_features_add-server_ui_add-server_tsx_1jnmar5xju49k._.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../web/features/add-server/ui/add-server.tsx","../../../../../web/features/add-server/tool-choice.ts","../../../../../web/features/outside-parties/ui/tool-row.tsx","../../../../../web/features/add-server/data%3Ae2a727%20%3Ctext/javascript%3E","../../../../../web/features/add-server/data%3A7cf07c%20%3Ctext/javascript%3E","../../../../../web/features/add-server/suggested-name.ts"],"sourcesContent":["'use client';\n\nimport { useActionState, useState } from 'react';\n\nimport { FLEET_FIELD } from '../../forms/form-state';\nimport { CredentialFields } from '../../forms/ui/credential-fields';\nimport { BUTTONS, CARD, INPUT, LABEL } from '../../forms/ui/look';\nimport { Outcome } from '../../forms/ui/outcome';\nimport { OwnerField } from '../../forms/ui/owner-field';\nimport { SubmitButton } from '../../forms/ui/submit-button';\nimport { Switch } from '../../forms/ui/switch';\nimport { ToolRow } from '../../outside-parties/ui/tool-row';\nimport { approveServer, checkServer, type AddServerState, type ApproveState, type CheckedTool } from '../actions';\nimport { addButtonLabel, suggestedName } from '../suggested-name';\nimport { TOOL_ON_FIELD, TOOL_SHOWN_FIELD } from '../tool-choice';\n\n/** The steps of adding a server, as the design numbers them. */\nconst STEPS = ['Address', 'Check', 'Owner'] as const;\n\nconst CONCURRENCY_LIMIT_DEFAULT = '4';\n\n/** The credential fields, carried on from the address step to the owner step. */\nconst CARRIED_FIELDS = ['url', 'credentialKind', 'token', 'clientId', 'clientSecret', 'issuer', 'scope'] as const;\n\nfunction Steps({ at }: { at: number }) {\n return (\n <ol className=\"flex gap-4\">\n {STEPS.map((step, index) => (\n <li key={step} aria-current={index === at ? 'step' : undefined} className={index <= at ? 'font-medium' : 'text-muted-foreground'}>\n {index + 1} {step}\n </li>\n ))}\n </ol>\n );\n}\n\nfunction Refused({ refusal }: { refusal: string | undefined }) {\n return refusal === undefined ? null : <Outcome state={{ kind: 'refused', message: refusal }} />;\n}\n\nfunction AddressStep({ state, action, fleetId }: { state: Extract<AddServerState, { step: 'address' }> | { fields: Record<string, string>; refusal?: string }; action: (form: FormData) => void; fleetId: string }) {\n return (\n <form action={action} className={`${CARD} grid gap-3`} data-testid=\"add-server-address\">\n <input type=\"hidden\" name={FLEET_FIELD} value={fleetId} />\n <Refused refusal={state.refusal} />\n <label className={LABEL}>\n <span>Streamable HTTP address</span>\n <input className={INPUT} type=\"url\" name=\"url\" defaultValue={state.fields.url ?? ''} placeholder=\"https://mcp.example.com/mcp\" required />\n </label>\n <CredentialFields legend=\"The server's credential\" fields={state.fields} noneHelp=\"The gateway sends no credential: for a server reached only on a private network.\" />\n <div>\n <SubmitButton pending=\"Checking the server…\" testId=\"add-server-check\">\n Check the server\n </SubmitButton>\n </div>\n </form>\n );\n}\n\n/**\n * The tools the check answered, one row each. An approver switches each on\n * or off, all on to start; the fleet may call only those on (aeolus-fleet#1151).\n * Without gateway:approve they show without switches, and every tool starts on.\n */\nfunction ToolsSection({ tools, canSwitch }: { tools: CheckedTool[]; canSwitch: boolean }) {\n const [off, setOff] = useState<ReadonlySet<string>>(new Set());\n const onCount = tools.length - off.size;\n const flip = (name: string) => {\n setOff((current) => {\n const next = new Set(current);\n if (!next.delete(name)) {\n next.add(name);\n }\n return next;\n });\n };\n return (\n <section className=\"grid gap-2\" data-testid=\"add-server-tools\">\n <h2 className=\"flex flex-wrap justify-between gap-2 text-section font-semibold\">\n <span>\n The server answers: {tools.length} {tools.length === 1 ? 'tool' : 'tools'}\n </span>\n {canSwitch ? (\n <span role=\"status\" className=\"font-normal text-muted-foreground\" data-testid=\"add-server-tools-on\">\n {onCount} of {tools.length} on\n </span>\n ) : null}\n </h2>\n <p className=\"text-muted-foreground\">{canSwitch ? 'The fleet may call only the tools switched on. A tool the server adds later starts off.' : 'Switching tools needs gateway:approve: every tool starts on, and an approver switches them on its page.'}</p>\n <ul className=\"grid\">\n {tools.map((tool) => {\n const isOn = !off.has(tool.name);\n return (\n <ToolRow\n key={tool.name}\n tool={tool}\n testId=\"add-server-tool\"\n control={\n canSwitch ? (\n <>\n <input type=\"hidden\" name={TOOL_SHOWN_FIELD} value={tool.name} />\n {isOn ? <input type=\"hidden\" name={TOOL_ON_FIELD} value={tool.name} /> : null}\n <Switch isOn={isOn} label={tool.name} onClick={() => { flip(tool.name); }} />\n </>\n ) : null\n }\n />\n );\n })}\n </ul>\n </section>\n );\n}\n\nfunction OwnerStep({ state, refused, action, onBack, fleetId, canSwitchTools }: { state: Extract<AddServerState, { step: 'owner' }>; refused: ApproveState; action: (form: FormData) => void; onBack: () => void; fleetId: string; canSwitchTools: boolean }) {\n // A refused approval of this check shows what the browser sent, and why.\n const isRefused = refused.kind === 'refused' && refused.requestId === state.requestId;\n const fields = isRefused ? refused.fields : state.fields;\n const url = fields.url ?? '';\n const [name, setName] = useState(fields.name ?? suggestedName(url));\n return (\n <>\n <form action={action} className={`${CARD} grid gap-3`} data-testid=\"add-server-owner\">\n <ToolsSection tools={state.tools} canSwitch={canSwitchTools} />\n <h2 className=\"text-section font-semibold\">Its owner</h2>\n <Refused refusal={isRefused ? refused.message : undefined} />\n <input type=\"hidden\" name={FLEET_FIELD} value={fleetId} />\n <input type=\"hidden\" name=\"requestId\" value={state.requestId} />\n {CARRIED_FIELDS.map((field) => (\n <input key={field} type=\"hidden\" name={field} value={fields[field] ?? ''} />\n ))}\n <p className=\"font-mono text-muted-foreground\">{url}</p>\n <label className={LABEL}>\n <span>Proxy ship's name</span>\n <input className={INPUT} type=\"text\" name=\"name\" value={name} onChange={(event) => { setName(event.target.value); }} required />\n </label>\n <OwnerField choices={state.owners} current={state.owners.find((owner) => owner.shipId === fields.ownerShipId) ?? null} help=\"A person ship or argo. It answers for this server.\" />\n <label className={LABEL}>\n <span>Calls at once</span>\n <input className={INPUT} type=\"number\" name=\"concurrencyLimit\" min={1} max={10} defaultValue={fields.concurrencyLimit ?? CONCURRENCY_LIMIT_DEFAULT} />\n </label>\n <div className=\"flex gap-2\">\n <SubmitButton pending=\"Adding…\" testId=\"add-server-approve\">\n {addButtonLabel(name)}\n </SubmitButton>\n <button type=\"button\" className={BUTTONS.secondary} onClick={onBack}>\n Back to the address\n </button>\n </div>\n </form>\n </>\n );\n}\n\n/**\n * Adding an outside MCP server in three steps: its address and credential,\n * the gateway's check of the tools it answers with, then its owner. Each\n * button says at once that its step is on its way.\n */\nexport function AddServer({ fleetId, canSwitchTools }: { fleetId: string; canSwitchTools: boolean }) {\n const [checked, check] = useActionState(checkServer, { step: 'address', fields: {} });\n const [refused, approve] = useActionState(approveServer, { kind: 'idle' });\n // Going back shows the address step again, with what was sent, until the next check answers.\n const [backFrom, setBackFrom] = useState<string | undefined>(undefined);\n const owner = checked.step === 'owner' && backFrom !== checked.requestId ? checked : undefined;\n return (\n <div className=\"grid gap-4\">\n <h1 className=\"text-title font-semibold\">Add MCP server</h1>\n <Steps at={owner === undefined ? 0 : 2} />\n {owner === undefined ? (\n <AddressStep state={checked} action={check} fleetId={fleetId} />\n ) : (\n <OwnerStep state={owner} refused={refused} action={approve} onBack={() => { setBackFrom(owner.requestId); }} fleetId={fleetId} canSwitchTools={canSwitchTools} />\n )}\n </div>\n );\n}\n","/**\n * The tools an approver switched when adding a server (aeolus-fleet#1151):\n * each tool the check answered is sent as shown, and the ticked ones as on.\n */\n\n/** The field naming each tool whose switch the form showed. */\nexport const TOOL_SHOWN_FIELD = 'toolShown';\n\n/** The field naming each tool ticked on. */\nexport const TOOL_ON_FIELD = 'toolOn';\n\nfunction namesIn(form: FormData, field: string): string[] {\n return form.getAll(field).filter((value) => typeof value === 'string');\n}\n\n/** Each tool shown, on or off; none when the form showed no switch, so the server keeps every tool on. */\nexport function toolChoiceOf(form: FormData): { name: string; isOn: boolean }[] | undefined {\n const shown = namesIn(form, TOOL_SHOWN_FIELD);\n if (shown.length === 0) {\n return undefined;\n }\n const on = new Set(namesIn(form, TOOL_ON_FIELD));\n return shown.map((name) => ({ name, isOn: on.has(name) }));\n}\n\n/** A description's first line with words, as a tool's row shows it before it is opened. */\nexport function firstLineOf(description: string): string {\n return description.split('\\n').map((line) => line.trim()).find((line) => line !== '') ?? '';\n}\n","import type { ReactNode } from 'react';\n\nimport { firstLineOf } from '../../add-server/tool-choice';\nimport { StatusBadge, Tag } from './status-badge';\n\n/** A tool of an outside MCP server, as its row shows it. */\nexport interface ShownTool {\n name: string;\n description?: string | undefined;\n isReadOnly: boolean;\n isNew?: boolean;\n}\n\n/**\n * One tool in a list an approver scans (aeolus-fleet#1151): its switch, its\n * name, whether the server says it reads only, whether it is new, and its\n * description's first line, the whole description folded open on a click.\n */\nexport function ToolRow({ tool, control, testId }: { tool: ShownTool; control: ReactNode; testId?: string }) {\n const { name, description, isReadOnly, isNew = false } = tool;\n const firstLine = description === undefined ? '' : firstLineOf(description);\n const isFolded = description !== undefined && description.trim() !== firstLine;\n return (\n <li className=\"grid gap-1 border-b border-border py-2 last:border-b-0\" data-testid={testId}>\n <div className=\"flex flex-wrap items-center gap-2\">\n {control}\n <span className=\"font-mono\">{name}</span>\n {isReadOnly ? <Tag>reads only</Tag> : null}\n {isNew ? <StatusBadge tone=\"attention\" label=\"New\" /> : null}\n </div>\n {firstLine === '' ? null : isFolded ? (\n <details className=\"text-muted-foreground\">\n <summary className=\"cursor-pointer\">{firstLine}</summary>\n <p className=\"mt-1 whitespace-pre-line\">{description}</p>\n </details>\n ) : (\n <p className=\"text-muted-foreground\">{firstLine}</p>\n )}\n </li>\n );\n}\n","/* __next_internal_action_entry_do_not_use__ [{\"602ff6f39d599a3b84620d262aa28c93324db169d2\":{\"name\":\"approveServer\"}},\"web/features/add-server/actions.ts\",\"\"] */\"use turbopack: no side effects\";import{createServerReference,callServer,findSourceMapURL}from\"private-next-rsc-action-client-wrapper\";const $$RSC_SERVER_ACTION_1=/*#__PURE__*/createServerReference(\"602ff6f39d599a3b84620d262aa28c93324db169d2\",callServer,void 0,findSourceMapURL,\"approveServer\");export{$$RSC_SERVER_ACTION_1 as approveServer};","/* __next_internal_action_entry_do_not_use__ [{\"6064df10af725664a578128647c76aa73389fff5c9\":{\"name\":\"checkServer\"}},\"web/features/add-server/actions.ts\",\"\"] */\"use turbopack: no side effects\";import{createServerReference,callServer,findSourceMapURL}from\"private-next-rsc-action-client-wrapper\";const $$RSC_SERVER_ACTION_0=/*#__PURE__*/createServerReference(\"6064df10af725664a578128647c76aa73389fff5c9\",callServer,void 0,findSourceMapURL,\"checkServer\");export{$$RSC_SERVER_ACTION_0 as checkServer};","/** The most characters of the proxy ship's name the add button shows. */\nconst BUTTON_NAME_MAX_LENGTH = 20;\n\n/** A proxy ship's name offered from a server's address: its host's first name that says whose it is; none for an IP address, whose numbers say nothing of it. */\nexport function suggestedName(url: string): string {\n if (!URL.canParse(url)) {\n return '';\n }\n const { hostname } = new URL(url);\n // URL writes every IPv4 host as four numbers, and keeps an IPv6 host in its brackets; the browser runs this too, so no node:net.\n if (/^\\d+(\\.\\d+){3}$/.test(hostname) || hostname.startsWith('[')) {\n return '';\n }\n const labels = hostname.split('.').filter((label) => label !== 'mcp' && label !== 'www');\n return (labels[0] ?? '').toLowerCase().replaceAll(/[^a-z0-9]+/g, '-').replaceAll(/^-+|-+$/g, '');\n}\n\n/** The add button's words: the proxy ship's name as typed, cut at 20 characters, or the plain words while none is typed. */\nexport function addButtonLabel(name: string): string {\n const typed = name.trim();\n if (typed === '') {\n return 'Add as outside party';\n }\n return typed.length > BUTTON_NAME_MAX_LENGTH ? `Add ${typed.slice(0, BUTTON_NAME_MAX_LENGTH)}…` : `Add ${typed}`;\n}\n"],"names":["TOOL_SHOWN_FIELD","TOOL_ON_FIELD","namesIn","form","field","getAll","filter","value","toolChoiceOf","shown","length","undefined","on","Set","map","name","isOn","has","firstLineOf","description","split","line","trim","find"],"mappings":"wDAEA,EAAA,EAAA,CAAA,CAAA,OAEA,EAAA,EAAA,CAAA,CAAA,OACA,EAAA,EAAA,CAAA,CAAA,OACA,EAAA,EAAA,CAAA,CAAA,OACA,EAAA,EAAA,CAAA,CAAA,OACA,EAAA,EAAA,CAAA,CAAA,OACA,EAAA,EAAA,CAAA,CAAA,OACA,EAAA,EAAA,CAAA,CAAA,OEPA,EAAA,EAAA,CAAA,CAAA,OAeO,SAAS,EAAQ,MAAE,CAAI,SAAE,CAAO,QAAE,CAAM,CAA4D,EACzG,GAAM,MAAE,CAAI,CAAE,aAAW,YAAE,CAAUA,OAAE,GAAQ,CAAK,CAAE,CAAG,EACnD,EAAY,KAAgB,MAAY,GAAiB,ADOxDmB,EAAYC,ACPgC,KDO3B,CAAC,MAAMN,GAAG,CAAC,AAACO,GAASA,EAAKC,IA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GAAA,EAAC,EAAA,CAAU,MAAO,EAAO,QAAS,EAAS,OAAQ,EAAS,OAAQ,KAAQ,EAAY,EAAM,SAAS,CAAG,EAAG,QAAS,EAAS,eAAgB,MAIvJ"}
|
|
1
|
+
{"version":3,"sources":["../../../../../web/features/add-server/ui/add-server.tsx","../../../../../web/features/add-server/tool-choice.ts","../../../../../web/features/outside-parties/ui/tool-row.tsx","../../../../../web/features/add-server/data%3A18a22b%20%3Ctext/javascript%3E","../../../../../web/features/add-server/data%3A48e858%20%3Ctext/javascript%3E","../../../../../web/features/add-server/suggested-name.ts"],"sourcesContent":["'use client';\n\nimport { useActionState, useState } from 'react';\n\nimport { FLEET_FIELD } from '../../forms/form-state';\nimport { CredentialFields } from '../../forms/ui/credential-fields';\nimport { BUTTONS, CARD, INPUT, LABEL } from '../../forms/ui/look';\nimport { Outcome } from '../../forms/ui/outcome';\nimport { OwnerField } from '../../forms/ui/owner-field';\nimport { SubmitButton } from '../../forms/ui/submit-button';\nimport { Switch } from '../../forms/ui/switch';\nimport { ToolRow } from '../../outside-parties/ui/tool-row';\nimport { approveServer, checkServer, type AddServerState, type ApproveState, type CheckedTool } from '../actions';\nimport { addButtonLabel, suggestedName } from '../suggested-name';\nimport { TOOL_ON_FIELD, TOOL_SHOWN_FIELD } from '../tool-choice';\n\n/** The steps of adding a server, as the design numbers them. */\nconst STEPS = ['Address', 'Check', 'Owner'] as const;\n\nconst CONCURRENCY_LIMIT_DEFAULT = '4';\n\n/** The credential fields, carried on from the address step to the owner step. */\nconst CARRIED_FIELDS = ['url', 'credentialKind', 'token', 'clientId', 'clientSecret', 'issuer', 'scope'] as const;\n\nfunction Steps({ at }: { at: number }) {\n return (\n <ol className=\"flex gap-4\">\n {STEPS.map((step, index) => (\n <li key={step} aria-current={index === at ? 'step' : undefined} className={index <= at ? 'font-medium' : 'text-muted-foreground'}>\n {index + 1} {step}\n </li>\n ))}\n </ol>\n );\n}\n\nfunction Refused({ refusal }: { refusal: string | undefined }) {\n return refusal === undefined ? null : <Outcome state={{ kind: 'refused', message: refusal }} />;\n}\n\nfunction AddressStep({ state, action, fleetId }: { state: Extract<AddServerState, { step: 'address' }> | { fields: Record<string, string>; refusal?: string }; action: (form: FormData) => void; fleetId: string }) {\n return (\n <form action={action} className={`${CARD} grid gap-3`} data-testid=\"add-server-address\">\n <input type=\"hidden\" name={FLEET_FIELD} value={fleetId} />\n <Refused refusal={state.refusal} />\n <label className={LABEL}>\n <span>Streamable HTTP address</span>\n <input className={INPUT} type=\"url\" name=\"url\" defaultValue={state.fields.url ?? ''} placeholder=\"https://mcp.example.com/mcp\" required />\n </label>\n <CredentialFields legend=\"The server's credential\" fields={state.fields} noneHelp=\"The gateway sends no credential: for a server reached only on a private network.\" />\n <div>\n <SubmitButton pending=\"Checking the server…\" testId=\"add-server-check\">\n Check the server\n </SubmitButton>\n </div>\n </form>\n );\n}\n\n/**\n * The tools the check answered, one row each. An approver switches each on\n * or off, all on to start; the fleet may call only those on (aeolus-fleet#1151).\n * Without gateway:approve they show without switches, and every tool starts on.\n */\nfunction ToolsSection({ tools, canSwitch }: { tools: CheckedTool[]; canSwitch: boolean }) {\n const [off, setOff] = useState<ReadonlySet<string>>(new Set());\n const onCount = tools.length - off.size;\n const flip = (name: string) => {\n setOff((current) => {\n const next = new Set(current);\n if (!next.delete(name)) {\n next.add(name);\n }\n return next;\n });\n };\n return (\n <section className=\"grid gap-2\" data-testid=\"add-server-tools\">\n <h2 className=\"flex flex-wrap justify-between gap-2 text-section font-semibold\">\n <span>\n The server answers: {tools.length} {tools.length === 1 ? 'tool' : 'tools'}\n </span>\n {canSwitch ? (\n <span role=\"status\" className=\"font-normal text-muted-foreground\" data-testid=\"add-server-tools-on\">\n {onCount} of {tools.length} on\n </span>\n ) : null}\n </h2>\n <p className=\"text-muted-foreground\">{canSwitch ? 'The fleet may call only the tools switched on. A tool the server adds later starts off.' : 'Switching tools needs gateway:approve: every tool starts on, and an approver switches them on its page.'}</p>\n <ul className=\"grid\">\n {tools.map((tool) => {\n const isOn = !off.has(tool.name);\n return (\n <ToolRow\n key={tool.name}\n tool={tool}\n testId=\"add-server-tool\"\n control={\n canSwitch ? (\n <>\n <input type=\"hidden\" name={TOOL_SHOWN_FIELD} value={tool.name} />\n {isOn ? <input type=\"hidden\" name={TOOL_ON_FIELD} value={tool.name} /> : null}\n <Switch isOn={isOn} label={tool.name} onClick={() => { flip(tool.name); }} />\n </>\n ) : null\n }\n />\n );\n })}\n </ul>\n </section>\n );\n}\n\nfunction OwnerStep({ state, refused, action, onBack, fleetId, canSwitchTools }: { state: Extract<AddServerState, { step: 'owner' }>; refused: ApproveState; action: (form: FormData) => void; onBack: () => void; fleetId: string; canSwitchTools: boolean }) {\n // A refused approval of this check shows what the browser sent, and why.\n const isRefused = refused.kind === 'refused' && refused.requestId === state.requestId;\n const fields = isRefused ? refused.fields : state.fields;\n const url = fields.url ?? '';\n const [name, setName] = useState(fields.name ?? suggestedName(url));\n return (\n <>\n <form action={action} className={`${CARD} grid gap-3`} data-testid=\"add-server-owner\">\n <ToolsSection tools={state.tools} canSwitch={canSwitchTools} />\n <h2 className=\"text-section font-semibold\">Its owner</h2>\n <Refused refusal={isRefused ? refused.message : undefined} />\n <input type=\"hidden\" name={FLEET_FIELD} value={fleetId} />\n <input type=\"hidden\" name=\"requestId\" value={state.requestId} />\n {CARRIED_FIELDS.map((field) => (\n <input key={field} type=\"hidden\" name={field} value={fields[field] ?? ''} />\n ))}\n <p className=\"font-mono text-muted-foreground\">{url}</p>\n <label className={LABEL}>\n <span>Proxy ship's name</span>\n <input className={INPUT} type=\"text\" name=\"name\" value={name} onChange={(event) => { setName(event.target.value); }} required />\n </label>\n <OwnerField choices={state.owners} current={state.owners.find((owner) => owner.shipId === fields.ownerShipId) ?? null} help=\"A person ship or argo. It answers for this server.\" />\n <label className={LABEL}>\n <span>Calls at once</span>\n <input className={INPUT} type=\"number\" name=\"concurrencyLimit\" min={1} max={10} defaultValue={fields.concurrencyLimit ?? CONCURRENCY_LIMIT_DEFAULT} />\n </label>\n <div className=\"flex gap-2\">\n <SubmitButton pending=\"Adding…\" testId=\"add-server-approve\">\n {addButtonLabel(name)}\n </SubmitButton>\n <button type=\"button\" className={BUTTONS.secondary} onClick={onBack}>\n Back to the address\n </button>\n </div>\n </form>\n </>\n );\n}\n\n/**\n * Adding an outside MCP server in three steps: its address and credential,\n * the gateway's check of the tools it answers with, then its owner. Each\n * button says at once that its step is on its way.\n */\nexport function AddServer({ fleetId, canSwitchTools }: { fleetId: string; canSwitchTools: boolean }) {\n const [checked, check] = useActionState(checkServer, { step: 'address', fields: {} });\n const [refused, approve] = useActionState(approveServer, { kind: 'idle' });\n // Going back shows the address step again, with what was sent, until the next check answers.\n const [backFrom, setBackFrom] = useState<string | undefined>(undefined);\n const owner = checked.step === 'owner' && backFrom !== checked.requestId ? checked : undefined;\n return (\n <div className=\"grid gap-4\">\n <h1 className=\"text-title font-semibold\">Add MCP server</h1>\n <Steps at={owner === undefined ? 0 : 2} />\n {owner === undefined ? (\n <AddressStep state={checked} action={check} fleetId={fleetId} />\n ) : (\n <OwnerStep state={owner} refused={refused} action={approve} onBack={() => { setBackFrom(owner.requestId); }} fleetId={fleetId} canSwitchTools={canSwitchTools} />\n )}\n </div>\n );\n}\n","/**\n * The tools an approver switched when adding a server (aeolus-fleet#1151):\n * each tool the check answered is sent as shown, and the ticked ones as on.\n */\n\n/** The field naming each tool whose switch the form showed. */\nexport const TOOL_SHOWN_FIELD = 'toolShown';\n\n/** The field naming each tool ticked on. */\nexport const TOOL_ON_FIELD = 'toolOn';\n\nfunction namesIn(form: FormData, field: string): string[] {\n return form.getAll(field).filter((value) => typeof value === 'string');\n}\n\n/** Each tool shown, on or off; none when the form showed no switch, so the server keeps every tool on. */\nexport function toolChoiceOf(form: FormData): { name: string; isOn: boolean }[] | undefined {\n const shown = namesIn(form, TOOL_SHOWN_FIELD);\n if (shown.length === 0) {\n return undefined;\n }\n const on = new Set(namesIn(form, TOOL_ON_FIELD));\n return shown.map((name) => ({ name, isOn: on.has(name) }));\n}\n\n/** A description's first line with words, as a tool's row shows it before it is opened. */\nexport function firstLineOf(description: string): string {\n return description.split('\\n').map((line) => line.trim()).find((line) => line !== '') ?? '';\n}\n","import type { ReactNode } from 'react';\n\nimport { firstLineOf } from '../../add-server/tool-choice';\nimport { StatusBadge, Tag } from './status-badge';\n\n/** A tool of an outside MCP server, as its row shows it. */\nexport interface ShownTool {\n name: string;\n description?: string | undefined;\n isReadOnly: boolean;\n isNew?: boolean;\n}\n\n/**\n * One tool in a list an approver scans (aeolus-fleet#1151): its switch, its\n * name, whether the server says it reads only, whether it is new, and its\n * description's first line, the whole description folded open on a click.\n */\nexport function ToolRow({ tool, control, testId }: { tool: ShownTool; control: ReactNode; testId?: string }) {\n const { name, description, isReadOnly, isNew = false } = tool;\n const firstLine = description === undefined ? '' : firstLineOf(description);\n const isFolded = description !== undefined && description.trim() !== firstLine;\n return (\n <li className=\"grid gap-1 border-b border-border py-2 last:border-b-0\" data-testid={testId}>\n <div className=\"flex flex-wrap items-center gap-2\">\n {control}\n <span className=\"font-mono\">{name}</span>\n {isReadOnly ? <Tag>reads only</Tag> : null}\n {isNew ? <StatusBadge tone=\"attention\" label=\"New\" /> : null}\n </div>\n {firstLine === '' ? null : isFolded ? (\n <details className=\"text-muted-foreground\">\n <summary className=\"cursor-pointer\">{firstLine}</summary>\n <p className=\"mt-1 whitespace-pre-line\">{description}</p>\n </details>\n ) : (\n <p className=\"text-muted-foreground\">{firstLine}</p>\n )}\n </li>\n );\n}\n","/* __next_internal_action_entry_do_not_use__ [{\"6050e72c4951cfe2c298e4f22266f17e9b82c186a1\":{\"name\":\"approveServer\"}},\"web/features/add-server/actions.ts\",\"\"] */\"use turbopack: no side effects\";import{createServerReference,callServer,findSourceMapURL}from\"private-next-rsc-action-client-wrapper\";const $$RSC_SERVER_ACTION_1=/*#__PURE__*/createServerReference(\"6050e72c4951cfe2c298e4f22266f17e9b82c186a1\",callServer,void 0,findSourceMapURL,\"approveServer\");export{$$RSC_SERVER_ACTION_1 as approveServer};","/* __next_internal_action_entry_do_not_use__ [{\"6066f7418afb7b8e3bbfe4ab46e1e2b04b0a09599e\":{\"name\":\"checkServer\"}},\"web/features/add-server/actions.ts\",\"\"] */\"use turbopack: no side effects\";import{createServerReference,callServer,findSourceMapURL}from\"private-next-rsc-action-client-wrapper\";const $$RSC_SERVER_ACTION_0=/*#__PURE__*/createServerReference(\"6066f7418afb7b8e3bbfe4ab46e1e2b04b0a09599e\",callServer,void 0,findSourceMapURL,\"checkServer\");export{$$RSC_SERVER_ACTION_0 as checkServer};","/** The most characters of the proxy ship's name the add button shows. */\nconst BUTTON_NAME_MAX_LENGTH = 20;\n\n/** A proxy ship's name offered from a server's address: its host's first name that says whose it is; none for an IP address, whose numbers say nothing of it. */\nexport function suggestedName(url: string): string {\n if (!URL.canParse(url)) {\n return '';\n }\n const { hostname } = new URL(url);\n // URL writes every IPv4 host as four numbers, and keeps an IPv6 host in its brackets; the browser runs this too, so no node:net.\n if (/^\\d+(\\.\\d+){3}$/.test(hostname) || hostname.startsWith('[')) {\n return '';\n }\n const labels = hostname.split('.').filter((label) => label !== 'mcp' && label !== 'www');\n return (labels[0] ?? '').toLowerCase().replaceAll(/[^a-z0-9]+/g, '-').replaceAll(/^-+|-+$/g, '');\n}\n\n/** The add button's words: the proxy ship's name as typed, cut at 20 characters, or the plain words while none is typed. */\nexport function addButtonLabel(name: string): string {\n const typed = name.trim();\n if (typed === '') {\n return 'Add as outside party';\n }\n return typed.length > BUTTON_NAME_MAX_LENGTH ? `Add ${typed.slice(0, BUTTON_NAME_MAX_LENGTH)}…` : `Add ${typed}`;\n}\n"],"names":["TOOL_SHOWN_FIELD","TOOL_ON_FIELD","namesIn","form","field","getAll","filter","value","toolChoiceOf","shown","length","undefined","on","Set","map","name","isOn","has","firstLineOf","description","split","line","trim","find"],"mappings":"wDAEA,EAAA,EAAA,CAAA,CAAA,OAEA,EAAA,EAAA,CAAA,CAAA,OAC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E,CAAC,EAAU,EAAY,CAAG,CAAA,EAAA,EAAA,QAAA,AAAQ,EAAqB,QACvD,EAAyB,UAAjB,EAAQ,IAAI,EAAgB,IAAa,EAAQ,SAAS,CAAG,OAAU,EACrF,MACE,CAAA,EAAA,EAAA,IAAA,EAAC,MAAA,CAAI,UAAU,uBACb,CAAA,EAAA,EAAA,GAAA,EAAC,KAAA,CAAG,UAAU,oCAA2B,mBACzC,CAAA,EAAA,EAAA,GAAA,EAAC,EAAA,CAAM,GAA8B,QAAhB,IAAV,CAAU,IAAY,KACtB,IAAV,EACC,CAAA,EAAA,EAAA,GAAA,EAAC,EAAA,CAAY,MAAO,EAAS,OAAQ,EAAO,QAAS,IAErD,CAAA,EAAA,EAAA,GAAA,EAAC,EAAA,CAAU,MAAO,EAAO,QAAS,EAAS,OAAQ,EAAS,OAAQ,KAAQ,EAAY,EAAM,SAAS,CAAG,EAAG,QAAS,EAAS,eAAgB,MAIvJ"}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
(()=>{"use strict";module.exports=[51636,a=>{let b=[{kind:"none",label:"No credential"},{kind:"bearer",label:"Bearer token"},{kind:"clientCredentials",label:"OAuth client credentials"}];a.s(["x",0,b,"C",0,function(a){return b.find(({kind:b})=>b===a)?.kind??"bearer"}])},35149,a=>{var b=a.i(87924),c=a.i(88412);a.s(["f",0,function({choices:a,current:d,help:e,refusal:f}){let g=null===d||a.some(a=>a.shipId===d.shipId)?a:[d,...a];return(0,b.jsxs)("label",{className:c.z,children:[(0,b.jsx)("span",{children:"Owner"}),(0,b.jsxs)("select",{className:c.w,name:"ownerShipId",defaultValue:d?.shipId??"",required:!0,"data-testid":"owner-field",children:[null===d?(0,b.jsx)("option",{value:"",disabled:!0,children:"Pick its owner"}):null,g.map(a=>(0,b.jsx)("option",{value:a.shipId,children:a.name},a.shipId))]}),(0,b.jsx)("span",{className:"text-muted-foreground",children:f??e})]})}])}]})();
|
|
2
|
+
|
|
3
|
+
//# sourceMappingURL=web_features_forms_1u0akr22eh_x_._.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../../web/features/forms/server-credential.ts","../../../../../web/features/forms/ui/owner-field.tsx"],"sourcesContent":["/**\n * An outside MCP server's credential, as the add, Parties and decision forms\n * take it: none for a server reached only on a private network, a static\n * bearer, or OAuth client credentials.\n */\n\n/** The credential kinds a form offers, with the words it shows. */\nexport const CREDENTIAL_KINDS = [\n { kind: 'none', label: 'No credential' },\n { kind: 'bearer', label: 'Bearer token' },\n { kind: 'clientCredentials', label: 'OAuth client credentials' },\n] as const;\n\nexport type CredentialKind = (typeof CREDENTIAL_KINDS)[number]['kind'];\n\nexport type ServerCredential =\n | { kind: 'none' }\n | { kind: 'bearer'; token: string }\n | { kind: 'clientCredentials'; clientId: string; clientSecret: string; issuer: string; scope?: string };\n\n/** The kind a form sent, a bearer when it sent none it knows. */\nexport function credentialKindOf(sent: string): CredentialKind {\n return CREDENTIAL_KINDS.find(({ kind }) => kind === sent)?.kind ?? 'bearer';\n}\n\n/** The credential the fields name: only the fields of its kind are read. */\nexport function serverCredentialOf(fields: { credentialKind: string; token: string; clientId: string; clientSecret: string; issuer: string; scope: string }): ServerCredential {\n const kind = credentialKindOf(fields.credentialKind);\n switch (kind) {\n case 'none':\n return { kind };\n case 'bearer':\n return { kind, token: fields.token };\n case 'clientCredentials':\n return { kind, clientId: fields.clientId, clientSecret: fields.clientSecret, issuer: fields.issuer, ...(fields.scope === '' ? {} : { scope: fields.scope }) };\n }\n}\n","import { INPUT, LABEL } from './look';\n\n/** A ship a party's owner may be picked from, by its name. */\nexport interface OwnerChoice {\n shipId: string;\n name: string;\n}\n\n/** The owner choices as a page read them, or why they could not be read. */\nexport type OwnerChoices = { isOk: true; value: OwnerChoice[] } | { isOk: false; refusal: string };\n\n/**\n * The owner of a party, picked by name from the ships the fleet takes as an\n * owner. The owner it has now stays a choice, though the fleet no longer\n * lists it, so saving leaves it as it is. Where the choices could not be\n * read, it says why, with nothing to pick.\n */\nexport function OwnerField({ choices, current, help, refusal }: { choices: readonly OwnerChoice[]; current: OwnerChoice | null; help: string; refusal?: string | undefined }) {\n const shown = current === null || choices.some((choice) => choice.shipId === current.shipId) ? choices : [current, ...choices];\n return (\n <label className={LABEL}>\n <span>Owner</span>\n <select className={INPUT} name=\"ownerShipId\" defaultValue={current?.shipId ?? ''} required data-testid=\"owner-field\">\n {current === null ? (\n <option value=\"\" disabled>\n Pick its owner\n </option>\n ) : null}\n {shown.map((choice) => (\n <option key={choice.shipId} value={choice.shipId}>\n {choice.name}\n </option>\n ))}\n </select>\n <span className=\"text-muted-foreground\">{refusal ?? help}</span>\n </label>\n );\n}\n"],"names":["CREDENTIAL_KINDS","kind","label","credentialKindOf","sent","find","serverCredentialOf","fields","credentialKind","token","clientId","clientSecret","issuer","scope","OwnerField","choices","current","help","refusal","shown","some","choice","shipId","className","name","defaultValue","required","value","disabled","map"],"mappings":"6CAOO,IAAMA,EAAmB,CAC9B,CAAEC,KAAM,OAAQC,MAAO,eAAgB,EACvC,CAAED,KAAM,SAAUC,MAAO,cAAe,EACxC,CAAED,KAAM,oBAAqBC,MAAO,0BAA2B,EAChE,oBAUM,SAASC,AAAiBC,CAAY,EAC3C,OAAOJ,EAAiBK,IAAI,CAAC,CAAC,MAAEJ,CAAI,CAAE,GAAKA,IAASG,IAAOH,MAAQ,QACrE,gCCvBA,EAAA,EAAA,CAAA,CAAA,kBAiBO,SAASa,AAAW,SAAEC,CAAO,SAAEC,CAAO,MAAEC,CAAI,SAAEC,CAAO,CAAgH,EAC1K,IAAMC,EAAQH,AAAY,UAAQD,EAAQK,IAAI,CAAC,AAACC,GAAWA,EAAOC,MAAM,GAAKN,EAAQM,MAAM,EAAIP,EAAU,CAACC,KAAYD,EAAQ,CAC9H,MACE,CAAA,EAAA,EAAA,IAAA,EAAC,QAAA,CAAMQ,UAAW,EAAA,CAAK,WACrB,CAAA,EAAA,EAAA,GAAA,EAAC,OAAA,UAAK,UACN,CAAA,EAAA,EAAA,IAAA,EAAC,SAAA,CAAOA,UAAW,EAAA,CAAK,CAAEC,KAAK,cAAcC,aAAcT,GAASM,QAAU,GAAII,QAAQ,CAAA,CAAA,EAAC,cAAY,wBACxF,OAAZV,EACC,CAAA,EAAA,EAAA,GAAA,EAAC,SAAA,CAAOW,MAAM,GAAGC,QAAQ,CAAA,CAAA,WAAC,mBAGxB,KACHT,EAAMU,GAAG,CAAC,AAACR,GACV,CAAA,EAAA,EAAA,GAAA,EAAC,SAAA,CAA2BM,MAAON,EAAOC,MAAM,UAC7CD,EAAOG,IAAI,EADDH,EAAOC,MAAM,MAK9B,CAAA,EAAA,EAAA,GAAA,EAAC,OAAA,CAAKC,UAAU,iCAAyBL,GAAWD,MAG1D"}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
(()=>{"use strict";module.exports=[72704,a=>{var b=a.i(7997),c=a.i(8403);function d({header:a,children:c}){return(0,b.jsxs)("div",{className:"flex min-h-dvh flex-col",children:[(0,b.jsx)("div",{"data-testid":"frame-header",className:"contents",children:a}),(0,b.jsx)("main",{className:"mx-auto w-full max-w-5xl flex-1 px-4 py-6",children:c})]})}var e=a.i(717),f=a.i(66283);async function g(){try{return await (await (0,f.z)(void 0)).account.apps.query()}catch(a){if(void 0!==(0,f.
|
|
1
|
+
(()=>{"use strict";module.exports=[72704,a=>{var b=a.i(7997),c=a.i(8403);function d({header:a,children:c}){return(0,b.jsxs)("div",{className:"flex min-h-dvh flex-col",children:[(0,b.jsx)("div",{"data-testid":"frame-header",className:"contents",children:a}),(0,b.jsx)("main",{className:"mx-auto w-full max-w-5xl flex-1 px-4 py-6",children:c})]})}var e=a.i(717),f=a.i(66283);async function g(){try{return await (await (0,f.z)(void 0)).account.apps.query()}catch(a){if(void 0!==(0,f.U)(a))return;throw a}}var h=a.i(75416),i=a.i(49310),j=a.i(26972),k=a.i(54757),k=k,l=a.i(27221),m=a.i(89963),n=a.i(83931),o=a.i(29517);let p=i.z.enum(["console","gateway","account","admin"]),q=j.z.object({app:p,url:k.httpUrl()});j.z.object({account:j.z.object({id:h.s,email:l.z.string()}),apps:m.z.array(q),fleets:m.z.array(j.z.object({id:(0,o.f)("fleet"),name:l.z.string(),argo:n.z.boolean(),apps:m.z.array(q)}))});var r=a.i(91156);let s=(0,o.f)("fleet");function t(a){return a.flatMap(({app:a,url:b})=>{let c=p.safeParse(a);return c.success?[{app:c.data,url:b}]:[]})}var u=a.i(73952);function v(){return(0,b.jsx)("header",{"data-testid":"plain-header",className:"flex h-14 items-center border-b border-border px-4",children:(0,b.jsx)("a",{href:"/overview",className:"text-section font-semibold",children:"Aeolus"})})}async function w({theme:a}){let c=await g(),d=void 0===c?[]:function(a){let b=h.s.safeParse(a.account.id),c=a.fleets.map(a=>s.safeParse(a.id));if(!b.success||c.some(a=>!a.success))return[];let d={account:{id:b.data,email:a.account.email},apps:t(a.apps),fleets:a.fleets.flatMap((a,b)=>{let d=c[b];return d?.success===!0?[{id:d.data,name:a.name,argo:!1,apps:t(a.apps)}]:[]})};return d.fleets.map(({id:a,name:b})=>(0,r.f)({list:d,fleet:{id:a,name:b},app:"gateway"}))}(c);return void 0===c||0===d.length?(0,b.jsx)(v,{}):(0,b.jsx)(e.Suspense,{fallback:(0,b.jsx)(v,{}),children:(0,b.jsx)(u.GatewayHeader,{switchers:d,email:c.account.email,accountUrl:c.apps.find(({app:a})=>"account"===a)?.url,theme:a})})}async function x({children:a}){return(0,b.jsx)(d,{header:(0,b.jsx)(w,{theme:await (0,c.f)()}),children:a})}a.s(["f",0,x],72704)},56397,a=>{let b=(0,a.i(11857).registerClientReference)(function(){throw Error("Attempted to call GatewayHeader() from the server but GatewayHeader is on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"[project]/web/features/frame/ui/gateway-header.tsx","GatewayHeader");a.s(["GatewayHeader",0,b])},73952,a=>{var b=a.i(56397);a.n(b)}]})();
|
|
2
2
|
|
|
3
3
|
//# sourceMappingURL=web_features_frame_0pe8cwpxe1egb._.js.map
|
package/web/.next/server/chunks/ssr/web_features_frame_ui_gateway-header_tsx_0e9tekx4jf7ng._.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
module.exports=[45648,a=>{"use strict";var b=a.i(87924),c=a.i(64831);let d={name:"search",size:24,node:[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]]};d.node;let e=(0,c.f)(d);var f=a.i(78400),g=a.i(21244),h=a.i(95725),i=a.i(6158),j=a.i(18486);function k({switcher:a,account:c,onSearch:d,searchLabel:l="Search or jump to",children:m,actions:n,className:o}){return(0,b.jsxs)("header",{"data-slot":"app-header",className:(0,j.f)("sticky top-0 z-30 flex h-(--size-header) shrink-0 items-center justify-between gap-4 border-b border-border bg-background px-6",o),children:[(0,b.jsxs)("div",{className:"flex min-w-0 items-center gap-3",children:[void 0===a?(0,b.jsx)("span",{"data-testid":"app-switcher-loading","aria-hidden":!0,className:"h-4 w-36 shrink-0 animate-pulse rounded bg-muted motion-reduce:animate-none"}):(0,b.jsx)(f.AppSwitcher,{switcher:a,layout:"full",className:"shrink-0"}),m]}),(0,b.jsxs)("div",{className:"flex shrink-0 items-center gap-3",children:[n,d?(0,b.jsxs)(g.f,{size:"sm",icon:(0,b.jsx)(e,{"aria-hidden":!0}),"data-testid":"header-search",className:"w-60 justify-start font-normal text-muted-foreground max-lg:w-auto",onClick:d,children:[(0,b.jsx)("span",{className:"grow text-left max-lg:sr-only",children:l}),(0,b.jsx)(h.f,{children:"⌘K"})]}):null,(0,b.jsx)(i.AvatarMenu,{...c})]})]})}var l=a.i(50944),m=a.i(72131),n=a.i(5050);let o=(0,n.createServerReference)("
|
|
1
|
+
module.exports=[45648,a=>{"use strict";var b=a.i(87924),c=a.i(64831);let d={name:"search",size:24,node:[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]]};d.node;let e=(0,c.f)(d);var f=a.i(78400),g=a.i(21244),h=a.i(95725),i=a.i(6158),j=a.i(18486);function k({switcher:a,account:c,onSearch:d,searchLabel:l="Search or jump to",children:m,actions:n,className:o}){return(0,b.jsxs)("header",{"data-slot":"app-header",className:(0,j.f)("sticky top-0 z-30 flex h-(--size-header) shrink-0 items-center justify-between gap-4 border-b border-border bg-background px-6",o),children:[(0,b.jsxs)("div",{className:"flex min-w-0 items-center gap-3",children:[void 0===a?(0,b.jsx)("span",{"data-testid":"app-switcher-loading","aria-hidden":!0,className:"h-4 w-36 shrink-0 animate-pulse rounded bg-muted motion-reduce:animate-none"}):(0,b.jsx)(f.AppSwitcher,{switcher:a,layout:"full",className:"shrink-0"}),m]}),(0,b.jsxs)("div",{className:"flex shrink-0 items-center gap-3",children:[n,d?(0,b.jsxs)(g.f,{size:"sm",icon:(0,b.jsx)(e,{"aria-hidden":!0}),"data-testid":"header-search",className:"w-60 justify-start font-normal text-muted-foreground max-lg:w-auto",onClick:d,children:[(0,b.jsx)("span",{className:"grow text-left max-lg:sr-only",children:l}),(0,b.jsx)(h.f,{children:"⌘K"})]}):null,(0,b.jsx)(i.AvatarMenu,{...c})]})]})}var l=a.i(50944),m=a.i(72131),n=a.i(5050);let o=(0,n.createServerReference)("404a6fe925a7b9f3a666fe6efebf5bf6e8ec052ac8",n.callServer,void 0,n.findSourceMapURL,"setTheme"),p=["light","dark","system"];var q=a.i(25959);let r=[{key:"overview",label:"Overview",path:"/overview"},{key:"outside-parties",label:"Outside parties",path:"/outside-parties"},{key:"parties",label:"Parties",path:"/parties"}];function s({fleetId:a}){let c=(0,l.usePathname)();return(0,b.jsx)("nav",{"aria-label":"Gateway",className:"flex shrink-0 items-center gap-1",children:r.map(({key:d,label:e,path:f})=>{let g=c===f||c.startsWith(`${f}/`);return(0,b.jsx)("a",{href:(0,q.f)(f,a),"data-testid":`frame-tab-${d}`,"aria-current":g?"page":void 0,className:`whitespace-nowrap rounded-md px-2 py-1 text-sm ${g?"bg-accent font-semibold":"text-muted-foreground hover:bg-accent"}`,children:e},d)})})}a.s(["GatewayHeader",0,function({switchers:a,email:c,accountUrl:d,theme:e}){let g=(0,l.useSearchParams)().get("fleet"),h=a.find(({fleet:a})=>a.id===g)??a[0],[j,n]=(0,m.useState)(e),[q,r]=(0,m.useState)(!1),t=(0,m.useRef)(null),u={name:c,signedInAs:"account",accountUrl:d,theme:j,themes:p,hasTheme:!0,onThemeChange:a=>{let b;n(a),document.documentElement.dataset.theme=a,b="dark"===a||"system"===a&&window.matchMedia("(prefers-color-scheme: dark)").matches,document.documentElement.classList.toggle("dark",b),o(a)},shortcuts:[],helpUrl:"https://github.com/ThomasHendrickx/aeolus-fleet",onSignOut:()=>{r(!0),t.current?.requestSubmit()},isSigningOut:q};return(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)("form",{ref:t,method:"post",action:"/sign-in/end",hidden:!0}),(0,b.jsx)(k,{switcher:h,account:u,className:"max-sm:hidden",children:void 0===h?null:(0,b.jsx)(s,{fleetId:h.fleet.id})}),(0,b.jsxs)("header",{className:"sticky top-0 z-30 flex h-14 shrink-0 items-center gap-3 border-b border-border bg-background px-4 sm:hidden",children:[void 0===h?null:(0,b.jsx)(f.AppSwitcher,{switcher:h,layout:"compact",className:"min-w-0"}),void 0===h?null:(0,b.jsx)(s,{fleetId:h.fleet.id}),(0,b.jsx)("span",{className:"grow"}),(0,b.jsx)(i.AvatarMenuSheet,{...u})]})]})}],45648)}];
|
|
2
2
|
|
|
3
3
|
//# sourceMappingURL=web_features_frame_ui_gateway-header_tsx_0e9tekx4jf7ng._.js.map
|