@opengeni/react 4.6.1 → 4.6.2-canary.39854174564001
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/app/app-state.js +5 -5
- package/dist/app/components/Composer.js +14 -14
- package/dist/app/components/artifacts/artifact-library.js +2 -2
- package/dist/app/components/artifacts/chat-interactive-block.js +10 -10
- package/dist/app/components/artifacts/inline-chat-image.js +14 -14
- package/dist/app/components/artifacts/retained-file-preview.js +15 -15
- package/dist/app/components/artifacts/retained-text-preview.js +2 -2
- package/dist/app/components/artifacts/site-conversations.js +4 -3
- package/dist/app/components/artifacts/site-data.js +2 -2
- package/dist/app/components/artifacts/site-publishing.js +11 -11
- package/dist/app/components/artifacts/site-settings.js +12 -12
- package/dist/app/components/billing-class-mark.js +3 -3
- package/dist/app/components/capabilities/capability-detail-sheet.js +2 -2
- package/dist/app/components/capabilities/capability-logo-source.js +7 -7
- package/dist/app/components/capabilities/native-connect-readiness.js +1 -0
- package/dist/app/components/capabilities/native-connect-readiness.js.map +1 -1
- package/dist/app/components/capabilities/native-connect-setup.js +6 -6
- package/dist/app/components/capabilities/perform-capability-action.js +2 -1
- package/dist/app/components/capabilities/prepared-mcp-setup-card.js +8 -8
- package/dist/app/components/capabilities/session-capability-card.js +28 -27
- package/dist/app/components/capabilities/session-capability-card.js.map +1 -1
- package/dist/app/components/capabilities/session-chrome-card.js +14 -14
- package/dist/app/components/capabilities/session-custom-mcp-card.js +9 -9
- package/dist/app/components/capabilities/session-github-card.js +9 -9
- package/dist/app/components/capabilities/session-machine-card.js +13 -13
- package/dist/app/components/command-menu/chat-status.js +6 -5
- package/dist/app/components/command-menu/chat-switcher.d.ts +2 -0
- package/dist/app/components/command-menu/chat-switcher.js +26 -9
- package/dist/app/components/command-menu/chat-switcher.js.map +1 -1
- package/dist/app/components/command-menu/command-menu.js +9 -8
- package/dist/app/components/command-menu/command-menu.js.map +1 -1
- package/dist/app/components/command-menu/shortcut-sheet.js +4 -4
- package/dist/app/components/composer-mobile-plus-panel.js +5 -5
- package/dist/app/components/composer-mobile-plus.js +1 -1
- package/dist/app/components/credit-required-gate.js +1 -1
- package/dist/app/components/credit-required-prompt.js +3 -3
- package/dist/app/components/desktop/app-shots.js +5 -5
- package/dist/app/components/desktop/this-computer.js +4 -4
- package/dist/app/components/feedback.js +3 -3
- package/dist/app/components/github-app-connect-launcher.js +1 -1
- package/dist/app/components/machines/connect-machine-dialog.js +3 -3
- package/dist/app/components/markdown.js +4 -4
- package/dist/app/components/models/models-ui.js +2 -2
- package/dist/app/components/pickers.js +5 -5
- package/dist/app/components/rail/rail-context.js +1 -1
- package/dist/app/components/rail/rail-sections.js +15 -14
- package/dist/app/components/rail/session-header.d.ts +6 -5
- package/dist/app/components/rail/session-header.js +11 -10
- package/dist/app/components/rail/session-list.js +14 -13
- package/dist/app/components/rail/session-row-hover-details.js +7 -6
- package/dist/app/components/rail/session-shell.js +30 -32
- package/dist/app/components/rail/site-session-group-heading.js +2 -1
- package/dist/app/components/session/agent-configuration-panel.js +3 -3
- package/dist/app/components/session/banners.js +6 -6
- package/dist/app/components/session/editable-artifacts-workspace.js +12 -12
- package/dist/app/components/session/failed-session-banner.js +4 -4
- package/dist/app/components/session/human-input.js +24 -24
- package/dist/app/components/session/inspector.js +30 -30
- package/dist/app/components/session/message-actions.js +3 -3
- package/dist/app/components/session/message-resource-attachments.js +5 -5
- package/dist/app/components/session/model-recovery-notice.js +3 -3
- package/dist/app/components/session/new-session-settings-menu.js +4 -4
- package/dist/app/components/session/sandbox-switcher.js +7 -7
- package/dist/app/components/session/sandbox-workspace.js +33 -33
- package/dist/app/components/session/search-markdown-highlight.js +5 -5
- package/dist/app/components/session/search-results-view.js +6 -6
- package/dist/app/components/session/session-admission-notice.js +4 -4
- package/dist/app/components/session/session-machine-access-notice.js +4 -4
- package/dist/app/components/session/session-search-dialog.js +6 -6
- package/dist/app/components/session/session-usage-limit-section.js +3 -3
- package/dist/app/components/session/session-wait-status.js +2 -1
- package/dist/app/components/session/session-wait-status.js.map +1 -1
- package/dist/app/components/session/subagents.js +5 -4
- package/dist/app/components/session/subscription-account-indicator.d.ts +35 -0
- package/dist/app/components/session/{codex-account-indicator.js → subscription-account-indicator.js} +23 -10
- package/dist/app/components/session/subscription-account-menu.d.ts +11 -12
- package/dist/app/components/session/subscription-account-menu.js +1 -1
- package/dist/app/components/session/subscription-account.d.ts +105 -0
- package/dist/app/components/usage/usage-entry.js +3 -3
- package/dist/app/components/workspace-composer-plus.js +10 -10
- package/dist/app/embed/session-app.js +92 -94
- package/dist/app/lib/actions/actions-provider.js +4 -4
- package/dist/app/lib/actions/chat-switcher.d.ts +19 -7
- package/dist/app/lib/codex-usage-query.js +2 -2
- package/dist/app/lib/composer-connectors.js +8 -8
- package/dist/app/lib/console-text.js +2 -2
- package/dist/app/lib/drive-connect-return.d.ts +26 -0
- package/dist/app/lib/drive-connect-return.js +16 -0
- package/dist/app/lib/events.js +7 -7
- package/dist/app/lib/failed-session-copy.js +3 -3
- package/dist/app/lib/model-access-onboarding.js +3 -3
- package/dist/app/lib/move-chat-to-machine.js +3 -3
- package/dist/app/lib/session-branch-cache.js +6 -5
- package/dist/app/lib/session-group-pagination.js +6 -5
- package/dist/app/lib/session-hover-facts.js +6 -5
- package/dist/app/lib/session-rail.js +2 -1
- package/dist/app/lib/sessions-group.js +5 -4
- package/dist/app/lib/turn-failure-analytics.js +4 -4
- package/dist/app/lib/use-workspace-machines.js +4 -4
- package/dist/app/lib/use-workspace-model-catalog.js +3 -3
- package/dist/app/lib/use-workspace-rigs.js +2 -2
- package/dist/app/lib/workspace-navigation-preference.js +4 -4
- package/dist/app/lib/workspace-scope-context.js +3 -3
- package/dist/app/routes/artifacts.js +26 -25
- package/dist/app/routes/artifacts.js.map +1 -1
- package/dist/app/routes/retained-artifact.js +15 -15
- package/dist/app/routes/session.js +64 -63
- package/dist/app/routes/sessions-index.js +41 -41
- package/dist/app/routes/site-view.js +30 -29
- package/dist/app/routes/site-view.js.map +1 -1
- package/dist/artifacts-document.js +4 -4
- package/dist/artifacts-presentation.js +4 -4
- package/dist/artifacts-spreadsheet.js +4 -4
- package/dist/artifacts.js +10 -10
- package/dist/{browser-viewer-YQC6BFMS.js → browser-viewer-VKIAULG7.js} +4 -4
- package/dist/{chat-interactive-block-Z22YHDRU.js → chat-interactive-block-JGYSW4KB.js} +5 -5
- package/dist/{chunk-WN2MIB4Q.js → chunk-22V2QCEM.js} +2 -2
- package/dist/{chunk-SJPAKWWP.js → chunk-2BISI664.js} +2 -2
- package/dist/{chunk-O5UOCMH4.js → chunk-2LPJVEWY.js} +3 -3
- package/dist/{chunk-JI6WPLZB.js → chunk-2SBCOGQN.js} +4 -4
- package/dist/{chunk-6JF7C3U3.js → chunk-2WERWWSS.js} +2 -2
- package/dist/{chunk-4XKT4ENZ.js → chunk-2Y3QL3DA.js} +4 -4
- package/dist/{chunk-KVMFT6FN.js → chunk-3FL3F4WF.js} +2 -2
- package/dist/{chunk-4VJOZJDV.js → chunk-3JPQAIYJ.js} +2 -2
- package/dist/{chunk-27EORKJ4.js → chunk-3N4LNBJF.js} +2 -2
- package/dist/{chunk-7JZSFJHB.js → chunk-3OJU3RUR.js} +2 -2
- package/dist/{chunk-NV5OYV3G.js → chunk-3U6K36QA.js} +5 -5
- package/dist/{chunk-MDRLP5DO.js → chunk-3W7ROHN4.js} +3 -3
- package/dist/{chunk-3MQM4ZOC.js → chunk-3Y6ZR2VN.js} +3 -3
- package/dist/{chunk-HXZIX7MR.js → chunk-47AB65IO.js} +4 -4
- package/dist/{chunk-DNYD7AUG.js → chunk-4BOLIZ7Y.js} +3 -3
- package/dist/{chunk-4XO346BW.js → chunk-4FBJFQFU.js} +2 -2
- package/dist/{chunk-DAQG3C4W.js → chunk-4HM6YDBX.js} +3 -3
- package/dist/{chunk-BWKZEW6K.js → chunk-4T3E56NT.js} +3 -3
- package/dist/{chunk-4PC7LIQK.js → chunk-4ZMUWRFF.js} +3 -3
- package/dist/{chunk-O4AWXTZQ.js → chunk-52XIYULR.js} +3 -3
- package/dist/{chunk-GXK4CUAB.js → chunk-5WQKTT5Z.js} +2 -2
- package/dist/{chunk-MHIYYHCL.js → chunk-5ZAHAUWD.js} +10 -10
- package/dist/{chunk-6N7W3TOV.js → chunk-63BPMTBM.js} +2 -2
- package/dist/{chunk-R5YZ3ROM.js → chunk-63PQKTTT.js} +2 -2
- package/dist/{chunk-WLZVXCPZ.js → chunk-6GO6WN22.js} +3 -3
- package/dist/{chunk-6PQBKMUL.js → chunk-6IIA63VD.js} +11 -7
- package/dist/chunk-6IIA63VD.js.map +1 -0
- package/dist/{chunk-PQCFW2KT.js → chunk-6IRDW7K3.js} +18 -13
- package/dist/chunk-6IRDW7K3.js.map +1 -0
- package/dist/{chunk-XDCZBOEY.js → chunk-6LGBGPBU.js} +1 -1
- package/dist/{chunk-D4QOZXPM.js → chunk-7ITDATTP.js} +2 -2
- package/dist/{chunk-M5E3CKSE.js → chunk-7QWWE5XL.js} +2 -2
- package/dist/{chunk-RABKQFTA.js → chunk-A2HCAMRH.js} +2 -2
- package/dist/{chunk-6K3WNTRI.js → chunk-AODISQO6.js} +2 -2
- package/dist/{chunk-C6JL6PBL.js → chunk-AQDRH6VF.js} +3 -3
- package/dist/{chunk-72XEFLMD.js → chunk-ASWINLSW.js} +2 -2
- package/dist/{chunk-DNLXQUBX.js → chunk-B746OUJC.js} +24 -36
- package/dist/chunk-B746OUJC.js.map +1 -0
- package/dist/{chunk-FVCLVASD.js → chunk-B7ZKSROO.js} +24 -24
- package/dist/{chunk-EURDMOXZ.js → chunk-BYJZUCOQ.js} +2 -2
- package/dist/{chunk-ZWACUOU5.js → chunk-CDBGAAJY.js} +3 -3
- package/dist/chunk-CDBGAAJY.js.map +1 -0
- package/dist/{chunk-BPD4IJBG.js → chunk-CG6CJMIS.js} +2 -2
- package/dist/{chunk-B254JG72.js → chunk-CQX24PT7.js} +2 -2
- package/dist/{chunk-HJTTDLF6.js → chunk-CY3NO4JN.js} +4 -4
- package/dist/{chunk-OLUG4IFF.js → chunk-D2RLPRSG.js} +2 -2
- package/dist/{chunk-74NIHMAT.js → chunk-D653JH6D.js} +3 -3
- package/dist/{chunk-FMATVQFW.js → chunk-DA6EQDFR.js} +6 -6
- package/dist/{chunk-2LUO22FR.js → chunk-DAI5CTQF.js} +4 -4
- package/dist/{chunk-HTKVYEVB.js → chunk-DBM4ZXDN.js} +2 -2
- package/dist/{chunk-MB2DTUEG.js → chunk-DNYKLU3K.js} +4 -4
- package/dist/{chunk-NPDL4W4Y.js → chunk-DT53LBQN.js} +44 -45
- package/dist/chunk-DT53LBQN.js.map +1 -0
- package/dist/{chunk-26P7B46A.js → chunk-DXYARXK3.js} +3 -3
- package/dist/{chunk-JQKURO3S.js → chunk-E4MQRQ6Z.js} +2 -2
- package/dist/{chunk-KW53DBY7.js → chunk-EBW2E32G.js} +2 -2
- package/dist/{chunk-O73DRA77.js → chunk-ENKBO7FC.js} +4 -4
- package/dist/{chunk-32HA7DXJ.js → chunk-EQNGX77H.js} +11 -11
- package/dist/{chunk-CA64OZLZ.js → chunk-FAPYRTG6.js} +4 -4
- package/dist/{chunk-WWM7WVD2.js → chunk-GABFKHQE.js} +2 -2
- package/dist/chunk-GLCOKWLH.js +42 -0
- package/dist/chunk-GLCOKWLH.js.map +1 -0
- package/dist/{chunk-OHG2UQ2O.js → chunk-GNM3OY36.js} +51 -13
- package/dist/chunk-GNM3OY36.js.map +1 -0
- package/dist/{chunk-JJ7VMIEQ.js → chunk-H2GTWX4D.js} +14 -14
- package/dist/{chunk-LR7U3HCD.js → chunk-HPSATFLQ.js} +4 -4
- package/dist/{chunk-TM2ZLY3Q.js → chunk-I56TUH3Z.js} +13 -13
- package/dist/{chunk-ZZUKJ5HQ.js → chunk-IG2ERMSB.js} +2 -2
- package/dist/{chunk-2SZ3KC5S.js → chunk-IMKIIS4Y.js} +2 -2
- package/dist/{chunk-I57HZMMA.js → chunk-IXIE3H43.js} +2 -2
- package/dist/{chunk-OWJD3V4V.js → chunk-J3YQ3554.js} +2 -2
- package/dist/{chunk-BCFHMBMK.js → chunk-J5HZBHU4.js} +7 -7
- package/dist/{chunk-UHMMRQGU.js → chunk-KD7GNHOP.js} +3 -3
- package/dist/{chunk-RXMIXKB3.js → chunk-KIKAVZOW.js} +2 -2
- package/dist/{chunk-X7Z4B5GK.js → chunk-KPL7EXS6.js} +2 -2
- package/dist/{chunk-GTR2WUBA.js → chunk-KX6M5CJI.js} +1 -1
- package/dist/{chunk-CYO5HL4C.js → chunk-KYL2BPS2.js} +2 -2
- package/dist/{chunk-ZPZYYSHW.js → chunk-L7EAQGWN.js} +5 -5
- package/dist/{chunk-QLDMF7MH.js → chunk-LC5HE7PZ.js} +2 -2
- package/dist/{chunk-3SMJ2BIQ.js → chunk-LGD5RESZ.js} +7 -33
- package/dist/chunk-LGD5RESZ.js.map +1 -0
- package/dist/{chunk-4ICPJZAB.js → chunk-LMYSYG6U.js} +2 -2
- package/dist/{chunk-3ZZOE4SN.js → chunk-LOCDYMD6.js} +4 -4
- package/dist/{chunk-DNWBLT4U.js → chunk-MASBMJ2M.js} +2 -2
- package/dist/{chunk-6VITVQ23.js → chunk-MTYE2PPR.js} +1 -1
- package/dist/{chunk-NZMQDUOD.js → chunk-MU6HYDNF.js} +5 -5
- package/dist/{chunk-GMVKCEBG.js → chunk-MY6QEDZ2.js} +2 -2
- package/dist/{chunk-SK57RWSA.js → chunk-MZGKQ5WV.js} +2 -2
- package/dist/{chunk-HSQRYJ4P.js → chunk-N52SFH2K.js} +2 -2
- package/dist/{chunk-CEQUNJJY.js → chunk-NDCP5TVN.js} +2 -2
- package/dist/{chunk-MY6VZVCP.js → chunk-OAJX5CEL.js} +4 -4
- package/dist/{chunk-BQWUXC55.js → chunk-OBBLVC2W.js} +9 -9
- package/dist/{chunk-IWIMIRV3.js → chunk-OSJTLQXA.js} +9 -4
- package/dist/chunk-OSJTLQXA.js.map +1 -0
- package/dist/{chunk-FH75NNLB.js → chunk-OZ5NAXCP.js} +2 -2
- package/dist/{chunk-PEGNFZ3F.js → chunk-P5S777YI.js} +2 -2
- package/dist/{chunk-LY6727IF.js → chunk-PPSVFNEA.js} +1 -1
- package/dist/{chunk-K4FDZVMQ.js → chunk-PR42VIVY.js} +2 -2
- package/dist/{chunk-I74J2UZ2.js → chunk-PWMZCW4H.js} +8 -8
- package/dist/{chunk-6YDXUE5H.js → chunk-PYA2O3WS.js} +2 -2
- package/dist/{chunk-GUIZDI5T.js → chunk-Q2PA4KZS.js} +2 -2
- package/dist/{chunk-DZH2HTTB.js → chunk-R27GW5WV.js} +1 -1
- package/dist/chunk-R4U4EWZG.js +414 -0
- package/dist/chunk-R4U4EWZG.js.map +1 -0
- package/dist/{chunk-7OIBLMDP.js → chunk-RAQISW42.js} +2 -2
- package/dist/{chunk-CPKD2YGK.js → chunk-RNU5CUPI.js} +2 -2
- package/dist/{chunk-467VRP4E.js → chunk-RO5YZQHZ.js} +3 -3
- package/dist/{chunk-SSZROOOI.js → chunk-ROLXYGT5.js} +2 -2
- package/dist/{chunk-F4B2YYCN.js → chunk-TAWFXRXB.js} +3 -3
- package/dist/{chunk-G3FU2IF7.js → chunk-TB7UW5BB.js} +3 -3
- package/dist/{chunk-NF6Q4XTN.js → chunk-TQF2I5SY.js} +3 -3
- package/dist/{chunk-MM7OKOTE.js → chunk-UBXHP224.js} +43 -18
- package/dist/chunk-UBXHP224.js.map +1 -0
- package/dist/{chunk-M7A226EQ.js → chunk-UL44R3W2.js} +2 -2
- package/dist/{chunk-65K5LV4L.js → chunk-UQKBV22P.js} +21 -20
- package/dist/{chunk-65K5LV4L.js.map → chunk-UQKBV22P.js.map} +1 -1
- package/dist/{chunk-GTR5NLVP.js → chunk-VCRQPLKS.js} +2 -2
- package/dist/{chunk-NWSAF6P5.js → chunk-WJDH7CH5.js} +22 -1
- package/dist/chunk-WJDH7CH5.js.map +1 -0
- package/dist/{chunk-LG67ZNRU.js → chunk-WK2ZCTUF.js} +2 -2
- package/dist/{chunk-XGE75VPK.js → chunk-WNARM3LY.js} +3 -3
- package/dist/{chunk-RNBH5TSM.js → chunk-WQ2RTQYO.js} +2 -2
- package/dist/chunk-X5XEYQ4B.js +84 -0
- package/dist/chunk-X5XEYQ4B.js.map +1 -0
- package/dist/{chunk-W57QFLQD.js → chunk-X6JIGNLI.js} +4 -4
- package/dist/{chunk-CKA4SJRK.js → chunk-XIQDCQX7.js} +2 -2
- package/dist/{chunk-AJ7PY4FJ.js → chunk-Y3GCG6CA.js} +2 -2
- package/dist/{chunk-2K27S6LK.js → chunk-Y565N5ZJ.js} +24 -7
- package/dist/chunk-Y565N5ZJ.js.map +1 -0
- package/dist/{chunk-ZRB4M3GG.js → chunk-YC5KH7ZB.js} +3 -3
- package/dist/{chunk-4RY64KQY.js → chunk-YJUKLLNP.js} +2 -2
- package/dist/{chunk-24POWVUY.js → chunk-ZDJNRRVS.js} +4 -4
- package/dist/{chunk-S6WJ6TUT.js → chunk-ZEVJGMNB.js} +2 -2
- package/dist/chunk-ZEVJGMNB.js.map +1 -0
- package/dist/{chunk-M7YEZR6X.js → chunk-ZITMDA4C.js} +2 -2
- package/dist/components/model-policy-picker.d.ts +2 -0
- package/dist/composer.js +6 -6
- package/dist/{computer-viewer-BWVNDFTO.js → computer-viewer-6CRLWQHP.js} +5 -5
- package/dist/connect.js +6 -6
- package/dist/connection-service-presentation.d.ts +1 -4
- package/dist/desktop.js +2 -2
- package/dist/editor.js +2 -2
- package/dist/{embedded-new-voice-GBXSZ3TO.js → embedded-new-voice-KILV3RYM.js} +5 -5
- package/dist/{embedded-voice-MGI7EK7C.js → embedded-voice-GHDRLCFX.js} +5 -5
- package/dist/{fleet-decision-row-35S3GAUN.js → fleet-decision-row-DQXRRBT7.js} +2 -2
- package/dist/index.js +36 -36
- package/dist/interaction.js +5 -5
- package/dist/machines.js +3 -3
- package/dist/messages/en.d.ts +1 -1
- package/dist/messages.js +1 -1
- package/dist/{model-policy-picker-menu-KP53N6UJ.js → model-policy-picker-menu-5ALKUJMR.js} +4 -4
- package/dist/{platform-activity-row-ISMXR7NJ.js → platform-activity-row-227C764Z.js} +2 -2
- package/dist/{queue-surface-implementation-ULW7DDJA.js → queue-surface-implementation-H3NOBXU5.js} +5 -5
- package/dist/realtime.js +4 -4
- package/dist/{sandbox-files-QYSD4XCZ.js → sandbox-files-5FEOHUMD.js} +6 -6
- package/dist/session-app.js +92 -94
- package/dist/{session-realtime-JXRLPNUH.js → session-realtime-OHBMODNX.js} +3 -3
- package/dist/session-realtime.js +2 -2
- package/dist/session-ui.js +24 -24
- package/dist/session.js +5 -5
- package/dist/sites.js +2 -2
- package/dist/terminal.js +2 -2
- package/dist/this-computer.js +3 -3
- package/dist/timeline/connector-logo-index.d.ts +19 -0
- package/dist/{timeline-annotation-markers-OJYKHBEO.js → timeline-annotation-markers-NDHS7MCK.js} +2 -2
- package/dist/{timeline-annotation-selection-6OAZLXFU.js → timeline-annotation-selection-DRQSTJOV.js} +2 -2
- package/dist/{timeline-annotations-dialog-5M6DP5FX.js → timeline-annotations-dialog-G6J5ZJKN.js} +3 -3
- package/dist/timeline-model.d.ts +2 -0
- package/dist/timeline-model.js +9 -1
- package/dist/ui/list-row.js +1 -1
- package/dist/usage.js +2 -2
- package/dist/workbench.js +4 -4
- package/package.json +4 -4
- package/src/app/components/capabilities/native-connect-readiness.tsx +1 -0
- package/src/app/components/capabilities/perform-capability-action.test.ts +67 -0
- package/src/app/components/capabilities/perform-capability-action.tsx +28 -0
- package/src/app/components/command-menu/chat-switcher.tsx +25 -4
- package/src/app/components/rail/session-header.test.tsx +73 -2
- package/src/app/components/rail/session-header.tsx +20 -12
- package/src/app/components/rail/session-shell.tsx +10 -18
- package/src/app/components/session/subscription-account-indicator.test.ts +239 -0
- package/src/app/components/session/subscription-account-indicator.tsx +361 -0
- package/src/app/components/session/subscription-account-menu.tsx +21 -43
- package/src/app/components/session/subscription-account.test.ts +314 -0
- package/src/app/components/session/subscription-account.ts +354 -0
- package/src/app/lib/actions/actions-provider.tsx +11 -0
- package/src/app/lib/actions/actions.test.ts +59 -4
- package/src/app/lib/actions/chat-switcher.ts +73 -20
- package/src/app/lib/drive-connect-return.test.ts +183 -0
- package/src/app/lib/drive-connect-return.tsx +116 -0
- package/src/app/routes/session.tsx +12 -14
- package/src/app/routes/sessions-index.tsx +1 -0
- package/src/components/model-policy-picker-menu.tsx +25 -4
- package/src/components/model-policy-picker.tsx +2 -0
- package/src/components/session-mcp-capability-card.tsx +13 -4
- package/src/connection-service-presentation.ts +6 -1
- package/src/messages/en.ts +1 -1
- package/src/timeline/connector-logo-index.test.ts +46 -0
- package/src/timeline/connector-logo-index.ts +68 -0
- package/src/timeline-model.ts +6 -0
- package/src/ui/list-row.tsx +38 -10
- package/styles/compiled.css +13 -0
- package/dist/app/components/session/codex-account-indicator.d.ts +0 -9
- package/dist/app/components/session/model-account-indicator.d.ts +0 -10
- package/dist/app/components/session/model-account-indicator.js +0 -34
- package/dist/app/components/session/model-account-usage.d.ts +0 -8
- package/dist/app/components/session/model-account-usage.js +0 -8
- package/dist/chunk-2K27S6LK.js.map +0 -1
- package/dist/chunk-3SMJ2BIQ.js.map +0 -1
- package/dist/chunk-6PQBKMUL.js.map +0 -1
- package/dist/chunk-7H2D4VNU.js +0 -150
- package/dist/chunk-7H2D4VNU.js.map +0 -1
- package/dist/chunk-DNLXQUBX.js.map +0 -1
- package/dist/chunk-HCCSAECI.js +0 -132
- package/dist/chunk-HCCSAECI.js.map +0 -1
- package/dist/chunk-IWIMIRV3.js.map +0 -1
- package/dist/chunk-M77ZQE5T.js +0 -58
- package/dist/chunk-M77ZQE5T.js.map +0 -1
- package/dist/chunk-MM7OKOTE.js.map +0 -1
- package/dist/chunk-NPDL4W4Y.js.map +0 -1
- package/dist/chunk-NWSAF6P5.js.map +0 -1
- package/dist/chunk-OHG2UQ2O.js.map +0 -1
- package/dist/chunk-PQCFW2KT.js.map +0 -1
- package/dist/chunk-S6WJ6TUT.js.map +0 -1
- package/dist/chunk-ZWACUOU5.js.map +0 -1
- package/dist/session-realtime-JXRLPNUH.js.map +0 -1
- package/src/app/components/session/codex-account-indicator.tsx +0 -207
- package/src/app/components/session/model-account-indicator.tsx +0 -189
- package/src/app/components/session/model-account-usage.test.ts +0 -59
- package/src/app/components/session/model-account-usage.tsx +0 -89
- /package/dist/app/components/session/{codex-account-indicator.js.map → subscription-account-indicator.js.map} +0 -0
- /package/dist/app/{components/session/model-account-indicator.js.map → lib/drive-connect-return.js.map} +0 -0
- /package/dist/{app/components/session/model-account-usage.js.map → browser-viewer-VKIAULG7.js.map} +0 -0
- /package/dist/{browser-viewer-YQC6BFMS.js.map → chat-interactive-block-JGYSW4KB.js.map} +0 -0
- /package/dist/{chunk-WN2MIB4Q.js.map → chunk-22V2QCEM.js.map} +0 -0
- /package/dist/{chunk-SJPAKWWP.js.map → chunk-2BISI664.js.map} +0 -0
- /package/dist/{chunk-O5UOCMH4.js.map → chunk-2LPJVEWY.js.map} +0 -0
- /package/dist/{chunk-JI6WPLZB.js.map → chunk-2SBCOGQN.js.map} +0 -0
- /package/dist/{chunk-6JF7C3U3.js.map → chunk-2WERWWSS.js.map} +0 -0
- /package/dist/{chunk-4XKT4ENZ.js.map → chunk-2Y3QL3DA.js.map} +0 -0
- /package/dist/{chunk-KVMFT6FN.js.map → chunk-3FL3F4WF.js.map} +0 -0
- /package/dist/{chunk-4VJOZJDV.js.map → chunk-3JPQAIYJ.js.map} +0 -0
- /package/dist/{chunk-27EORKJ4.js.map → chunk-3N4LNBJF.js.map} +0 -0
- /package/dist/{chunk-7JZSFJHB.js.map → chunk-3OJU3RUR.js.map} +0 -0
- /package/dist/{chunk-NV5OYV3G.js.map → chunk-3U6K36QA.js.map} +0 -0
- /package/dist/{chunk-MDRLP5DO.js.map → chunk-3W7ROHN4.js.map} +0 -0
- /package/dist/{chunk-3MQM4ZOC.js.map → chunk-3Y6ZR2VN.js.map} +0 -0
- /package/dist/{chunk-HXZIX7MR.js.map → chunk-47AB65IO.js.map} +0 -0
- /package/dist/{chunk-DNYD7AUG.js.map → chunk-4BOLIZ7Y.js.map} +0 -0
- /package/dist/{chunk-4XO346BW.js.map → chunk-4FBJFQFU.js.map} +0 -0
- /package/dist/{chunk-DAQG3C4W.js.map → chunk-4HM6YDBX.js.map} +0 -0
- /package/dist/{chunk-BWKZEW6K.js.map → chunk-4T3E56NT.js.map} +0 -0
- /package/dist/{chunk-4PC7LIQK.js.map → chunk-4ZMUWRFF.js.map} +0 -0
- /package/dist/{chunk-O4AWXTZQ.js.map → chunk-52XIYULR.js.map} +0 -0
- /package/dist/{chunk-GXK4CUAB.js.map → chunk-5WQKTT5Z.js.map} +0 -0
- /package/dist/{chunk-MHIYYHCL.js.map → chunk-5ZAHAUWD.js.map} +0 -0
- /package/dist/{chunk-6N7W3TOV.js.map → chunk-63BPMTBM.js.map} +0 -0
- /package/dist/{chunk-R5YZ3ROM.js.map → chunk-63PQKTTT.js.map} +0 -0
- /package/dist/{chunk-WLZVXCPZ.js.map → chunk-6GO6WN22.js.map} +0 -0
- /package/dist/{chunk-XDCZBOEY.js.map → chunk-6LGBGPBU.js.map} +0 -0
- /package/dist/{chunk-D4QOZXPM.js.map → chunk-7ITDATTP.js.map} +0 -0
- /package/dist/{chunk-M5E3CKSE.js.map → chunk-7QWWE5XL.js.map} +0 -0
- /package/dist/{chunk-RABKQFTA.js.map → chunk-A2HCAMRH.js.map} +0 -0
- /package/dist/{chunk-6K3WNTRI.js.map → chunk-AODISQO6.js.map} +0 -0
- /package/dist/{chunk-C6JL6PBL.js.map → chunk-AQDRH6VF.js.map} +0 -0
- /package/dist/{chunk-72XEFLMD.js.map → chunk-ASWINLSW.js.map} +0 -0
- /package/dist/{chunk-FVCLVASD.js.map → chunk-B7ZKSROO.js.map} +0 -0
- /package/dist/{chunk-EURDMOXZ.js.map → chunk-BYJZUCOQ.js.map} +0 -0
- /package/dist/{chunk-BPD4IJBG.js.map → chunk-CG6CJMIS.js.map} +0 -0
- /package/dist/{chunk-B254JG72.js.map → chunk-CQX24PT7.js.map} +0 -0
- /package/dist/{chunk-HJTTDLF6.js.map → chunk-CY3NO4JN.js.map} +0 -0
- /package/dist/{chunk-OLUG4IFF.js.map → chunk-D2RLPRSG.js.map} +0 -0
- /package/dist/{chunk-74NIHMAT.js.map → chunk-D653JH6D.js.map} +0 -0
- /package/dist/{chunk-FMATVQFW.js.map → chunk-DA6EQDFR.js.map} +0 -0
- /package/dist/{chunk-2LUO22FR.js.map → chunk-DAI5CTQF.js.map} +0 -0
- /package/dist/{chunk-HTKVYEVB.js.map → chunk-DBM4ZXDN.js.map} +0 -0
- /package/dist/{chunk-MB2DTUEG.js.map → chunk-DNYKLU3K.js.map} +0 -0
- /package/dist/{chunk-26P7B46A.js.map → chunk-DXYARXK3.js.map} +0 -0
- /package/dist/{chunk-JQKURO3S.js.map → chunk-E4MQRQ6Z.js.map} +0 -0
- /package/dist/{chunk-KW53DBY7.js.map → chunk-EBW2E32G.js.map} +0 -0
- /package/dist/{chunk-O73DRA77.js.map → chunk-ENKBO7FC.js.map} +0 -0
- /package/dist/{chunk-32HA7DXJ.js.map → chunk-EQNGX77H.js.map} +0 -0
- /package/dist/{chunk-CA64OZLZ.js.map → chunk-FAPYRTG6.js.map} +0 -0
- /package/dist/{chunk-WWM7WVD2.js.map → chunk-GABFKHQE.js.map} +0 -0
- /package/dist/{chunk-JJ7VMIEQ.js.map → chunk-H2GTWX4D.js.map} +0 -0
- /package/dist/{chunk-LR7U3HCD.js.map → chunk-HPSATFLQ.js.map} +0 -0
- /package/dist/{chunk-TM2ZLY3Q.js.map → chunk-I56TUH3Z.js.map} +0 -0
- /package/dist/{chunk-ZZUKJ5HQ.js.map → chunk-IG2ERMSB.js.map} +0 -0
- /package/dist/{chunk-2SZ3KC5S.js.map → chunk-IMKIIS4Y.js.map} +0 -0
- /package/dist/{chunk-I57HZMMA.js.map → chunk-IXIE3H43.js.map} +0 -0
- /package/dist/{chunk-OWJD3V4V.js.map → chunk-J3YQ3554.js.map} +0 -0
- /package/dist/{chunk-BCFHMBMK.js.map → chunk-J5HZBHU4.js.map} +0 -0
- /package/dist/{chunk-UHMMRQGU.js.map → chunk-KD7GNHOP.js.map} +0 -0
- /package/dist/{chunk-RXMIXKB3.js.map → chunk-KIKAVZOW.js.map} +0 -0
- /package/dist/{chunk-X7Z4B5GK.js.map → chunk-KPL7EXS6.js.map} +0 -0
- /package/dist/{chunk-GTR2WUBA.js.map → chunk-KX6M5CJI.js.map} +0 -0
- /package/dist/{chunk-CYO5HL4C.js.map → chunk-KYL2BPS2.js.map} +0 -0
- /package/dist/{chunk-ZPZYYSHW.js.map → chunk-L7EAQGWN.js.map} +0 -0
- /package/dist/{chunk-QLDMF7MH.js.map → chunk-LC5HE7PZ.js.map} +0 -0
- /package/dist/{chunk-4ICPJZAB.js.map → chunk-LMYSYG6U.js.map} +0 -0
- /package/dist/{chunk-3ZZOE4SN.js.map → chunk-LOCDYMD6.js.map} +0 -0
- /package/dist/{chunk-DNWBLT4U.js.map → chunk-MASBMJ2M.js.map} +0 -0
- /package/dist/{chunk-6VITVQ23.js.map → chunk-MTYE2PPR.js.map} +0 -0
- /package/dist/{chunk-NZMQDUOD.js.map → chunk-MU6HYDNF.js.map} +0 -0
- /package/dist/{chunk-GMVKCEBG.js.map → chunk-MY6QEDZ2.js.map} +0 -0
- /package/dist/{chunk-SK57RWSA.js.map → chunk-MZGKQ5WV.js.map} +0 -0
- /package/dist/{chunk-HSQRYJ4P.js.map → chunk-N52SFH2K.js.map} +0 -0
- /package/dist/{chunk-CEQUNJJY.js.map → chunk-NDCP5TVN.js.map} +0 -0
- /package/dist/{chunk-MY6VZVCP.js.map → chunk-OAJX5CEL.js.map} +0 -0
- /package/dist/{chunk-BQWUXC55.js.map → chunk-OBBLVC2W.js.map} +0 -0
- /package/dist/{chunk-FH75NNLB.js.map → chunk-OZ5NAXCP.js.map} +0 -0
- /package/dist/{chunk-PEGNFZ3F.js.map → chunk-P5S777YI.js.map} +0 -0
- /package/dist/{chunk-LY6727IF.js.map → chunk-PPSVFNEA.js.map} +0 -0
- /package/dist/{chunk-K4FDZVMQ.js.map → chunk-PR42VIVY.js.map} +0 -0
- /package/dist/{chunk-I74J2UZ2.js.map → chunk-PWMZCW4H.js.map} +0 -0
- /package/dist/{chunk-6YDXUE5H.js.map → chunk-PYA2O3WS.js.map} +0 -0
- /package/dist/{chunk-GUIZDI5T.js.map → chunk-Q2PA4KZS.js.map} +0 -0
- /package/dist/{chunk-DZH2HTTB.js.map → chunk-R27GW5WV.js.map} +0 -0
- /package/dist/{chunk-7OIBLMDP.js.map → chunk-RAQISW42.js.map} +0 -0
- /package/dist/{chunk-CPKD2YGK.js.map → chunk-RNU5CUPI.js.map} +0 -0
- /package/dist/{chunk-467VRP4E.js.map → chunk-RO5YZQHZ.js.map} +0 -0
- /package/dist/{chunk-SSZROOOI.js.map → chunk-ROLXYGT5.js.map} +0 -0
- /package/dist/{chunk-F4B2YYCN.js.map → chunk-TAWFXRXB.js.map} +0 -0
- /package/dist/{chunk-G3FU2IF7.js.map → chunk-TB7UW5BB.js.map} +0 -0
- /package/dist/{chunk-NF6Q4XTN.js.map → chunk-TQF2I5SY.js.map} +0 -0
- /package/dist/{chunk-M7A226EQ.js.map → chunk-UL44R3W2.js.map} +0 -0
- /package/dist/{chunk-GTR5NLVP.js.map → chunk-VCRQPLKS.js.map} +0 -0
- /package/dist/{chunk-LG67ZNRU.js.map → chunk-WK2ZCTUF.js.map} +0 -0
- /package/dist/{chunk-XGE75VPK.js.map → chunk-WNARM3LY.js.map} +0 -0
- /package/dist/{chunk-RNBH5TSM.js.map → chunk-WQ2RTQYO.js.map} +0 -0
- /package/dist/{chunk-W57QFLQD.js.map → chunk-X6JIGNLI.js.map} +0 -0
- /package/dist/{chunk-CKA4SJRK.js.map → chunk-XIQDCQX7.js.map} +0 -0
- /package/dist/{chunk-AJ7PY4FJ.js.map → chunk-Y3GCG6CA.js.map} +0 -0
- /package/dist/{chunk-ZRB4M3GG.js.map → chunk-YC5KH7ZB.js.map} +0 -0
- /package/dist/{chunk-4RY64KQY.js.map → chunk-YJUKLLNP.js.map} +0 -0
- /package/dist/{chunk-24POWVUY.js.map → chunk-ZDJNRRVS.js.map} +0 -0
- /package/dist/{chunk-M7YEZR6X.js.map → chunk-ZITMDA4C.js.map} +0 -0
- /package/dist/{chat-interactive-block-Z22YHDRU.js.map → computer-viewer-6CRLWQHP.js.map} +0 -0
- /package/dist/{computer-viewer-BWVNDFTO.js.map → embedded-new-voice-KILV3RYM.js.map} +0 -0
- /package/dist/{embedded-new-voice-GBXSZ3TO.js.map → embedded-voice-GHDRLCFX.js.map} +0 -0
- /package/dist/{fleet-decision-row-35S3GAUN.js.map → fleet-decision-row-DQXRRBT7.js.map} +0 -0
- /package/dist/{embedded-voice-MGI7EK7C.js.map → model-policy-picker-menu-5ALKUJMR.js.map} +0 -0
- /package/dist/{platform-activity-row-ISMXR7NJ.js.map → platform-activity-row-227C764Z.js.map} +0 -0
- /package/dist/{queue-surface-implementation-ULW7DDJA.js.map → queue-surface-implementation-H3NOBXU5.js.map} +0 -0
- /package/dist/{model-policy-picker-menu-KP53N6UJ.js.map → sandbox-files-5FEOHUMD.js.map} +0 -0
- /package/dist/{sandbox-files-QYSD4XCZ.js.map → session-realtime-OHBMODNX.js.map} +0 -0
- /package/dist/{timeline-annotation-markers-OJYKHBEO.js.map → timeline-annotation-markers-NDHS7MCK.js.map} +0 -0
- /package/dist/{timeline-annotation-selection-6OAZLXFU.js.map → timeline-annotation-selection-DRQSTJOV.js.map} +0 -0
- /package/dist/{timeline-annotations-dialog-5M6DP5FX.js.map → timeline-annotations-dialog-G6J5ZJKN.js.map} +0 -0
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
//
|
|
2
|
-
//
|
|
1
|
+
// The subscription-account dropdown every provider shares. Its content comes
|
|
2
|
+
// from `subscriptionAccountMenuContent`; data sources own loading,
|
|
3
|
+
// authorization, usage freshness and selection.
|
|
3
4
|
import { ChevronDownIcon, Loader2Icon } from "lucide-react";
|
|
4
5
|
import type { ReactNode } from "react";
|
|
5
6
|
|
|
@@ -24,25 +25,29 @@ export type SubscriptionAccountMenuRow = {
|
|
|
24
25
|
detail?: string;
|
|
25
26
|
personal?: boolean;
|
|
26
27
|
disabled?: boolean;
|
|
27
|
-
/**
|
|
28
|
-
remaining?: number | null;
|
|
29
|
-
/** Cached window readings, not an aggregate capacity/eligibility estimate. */
|
|
28
|
+
/** Per-window readings, not an aggregate capacity/eligibility estimate. */
|
|
30
29
|
usageSummary?: string | undefined;
|
|
31
30
|
};
|
|
32
31
|
|
|
33
32
|
export type SubscriptionAccountUsageWindow = {
|
|
34
33
|
label: string;
|
|
35
|
-
|
|
36
|
-
usedPercent
|
|
34
|
+
/** Null means unknown; values over 100 can represent overage. */
|
|
35
|
+
usedPercent: number | null;
|
|
37
36
|
detail?: string;
|
|
38
37
|
};
|
|
39
38
|
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
39
|
+
export type SubscriptionAccountMenuUsage = {
|
|
40
|
+
checking?: boolean | undefined;
|
|
41
|
+
unavailable?: boolean | undefined;
|
|
42
|
+
message?: string | undefined;
|
|
43
|
+
note?: string | undefined;
|
|
44
|
+
windows?: SubscriptionAccountUsageWindow[] | undefined;
|
|
45
|
+
};
|
|
46
|
+
|
|
47
|
+
function UsageRow({ label, usedPercent, detail }: SubscriptionAccountUsageWindow) {
|
|
48
|
+
const known = typeof usedPercent === "number" && Number.isFinite(usedPercent);
|
|
49
|
+
const pct = known ? Math.min(100, Math.max(0, usedPercent)) : 0;
|
|
50
|
+
const text = known ? `${Math.round(usedPercent)}% used` : "Unknown";
|
|
46
51
|
return (
|
|
47
52
|
<div className="space-y-0.5 text-2xs text-fg-subtle">
|
|
48
53
|
<div className="flex items-center gap-2">
|
|
@@ -53,7 +58,7 @@ function UsageRow({ label, remaining, usedPercent, detail }: SubscriptionAccount
|
|
|
53
58
|
<span
|
|
54
59
|
className="h-1 min-w-0 flex-1 overflow-hidden rounded-full bg-surface-2"
|
|
55
60
|
role="progressbar"
|
|
56
|
-
aria-label={`${label}
|
|
61
|
+
aria-label={`${label} used`}
|
|
57
62
|
aria-valuemin={0}
|
|
58
63
|
aria-valuemax={100}
|
|
59
64
|
aria-valuenow={pct}
|
|
@@ -62,9 +67,7 @@ function UsageRow({ label, remaining, usedPercent, detail }: SubscriptionAccount
|
|
|
62
67
|
<span
|
|
63
68
|
className={cn(
|
|
64
69
|
"block h-full rounded-full",
|
|
65
|
-
|
|
66
|
-
? "bg-status-waiting"
|
|
67
|
-
: "bg-brand",
|
|
70
|
+
pct >= 90 ? "bg-status-waiting" : "bg-brand",
|
|
68
71
|
)}
|
|
69
72
|
style={{ width: `${pct}%` }}
|
|
70
73
|
/>
|
|
@@ -79,24 +82,6 @@ function UsageRow({ label, remaining, usedPercent, detail }: SubscriptionAccount
|
|
|
79
82
|
);
|
|
80
83
|
}
|
|
81
84
|
|
|
82
|
-
function MiniBar({ remaining }: { remaining: number }) {
|
|
83
|
-
const pct = Math.min(100, Math.max(0, remaining));
|
|
84
|
-
return (
|
|
85
|
-
<span
|
|
86
|
-
className="inline-flex shrink-0 items-center gap-1.5 text-2xs text-fg-subtle"
|
|
87
|
-
title={`${Math.round(pct)}% remaining in the tighter usage window`}
|
|
88
|
-
>
|
|
89
|
-
<span className="h-1 w-8 overflow-hidden rounded-full bg-surface-2" aria-hidden="true">
|
|
90
|
-
<span
|
|
91
|
-
className={cn("block h-full rounded-full", pct <= 10 ? "bg-status-waiting" : "bg-brand")}
|
|
92
|
-
style={{ width: `${pct}%` }}
|
|
93
|
-
/>
|
|
94
|
-
</span>
|
|
95
|
-
<span className="whitespace-nowrap tabular-nums">{Math.round(pct)}% remaining</span>
|
|
96
|
-
</span>
|
|
97
|
-
);
|
|
98
|
-
}
|
|
99
|
-
|
|
100
85
|
export function SubscriptionAccountMenu({
|
|
101
86
|
ariaLabel,
|
|
102
87
|
triggerMark,
|
|
@@ -128,13 +113,7 @@ export function SubscriptionAccountMenu({
|
|
|
128
113
|
metadata: string;
|
|
129
114
|
identity?: string | null | undefined;
|
|
130
115
|
tone?: "ok" | "warn" | "bad" | undefined;
|
|
131
|
-
usage:
|
|
132
|
-
checking?: boolean | undefined;
|
|
133
|
-
unavailable?: boolean | undefined;
|
|
134
|
-
message?: string | undefined;
|
|
135
|
-
note?: string | undefined;
|
|
136
|
-
windows?: SubscriptionAccountUsageWindow[] | undefined;
|
|
137
|
-
};
|
|
116
|
+
usage: SubscriptionAccountMenuUsage;
|
|
138
117
|
accounts: SubscriptionAccountMenuRow[];
|
|
139
118
|
selectedId: string | null;
|
|
140
119
|
automaticSelected: boolean;
|
|
@@ -168,7 +147,6 @@ export function SubscriptionAccountMenu({
|
|
|
168
147
|
) : null}
|
|
169
148
|
</span>
|
|
170
149
|
{account.plan ? <DropdownMenuMeta>{account.plan}</DropdownMenuMeta> : null}
|
|
171
|
-
{account.remaining != null ? <MiniBar remaining={account.remaining} /> : null}
|
|
172
150
|
{account.status ? (
|
|
173
151
|
<span className="shrink-0 text-xs text-status-waiting">{account.status}</span>
|
|
174
152
|
) : null}
|
|
@@ -0,0 +1,314 @@
|
|
|
1
|
+
import { describe, expect, test } from "bun:test";
|
|
2
|
+
import {
|
|
3
|
+
showsSubscriptionAccountMenu,
|
|
4
|
+
subscriptionAccountMenuContent,
|
|
5
|
+
subscriptionAccountProvider,
|
|
6
|
+
subscriptionAccountUsage,
|
|
7
|
+
type SubscriptionAccount,
|
|
8
|
+
type SubscriptionAccountState,
|
|
9
|
+
type SubscriptionAccountUsage,
|
|
10
|
+
} from "./subscription-account";
|
|
11
|
+
|
|
12
|
+
const snapshot = (
|
|
13
|
+
windows: SubscriptionAccountUsage["windows"],
|
|
14
|
+
extra: Partial<SubscriptionAccountUsage> = {},
|
|
15
|
+
): SubscriptionAccountUsage => ({
|
|
16
|
+
windows,
|
|
17
|
+
observedAt: null,
|
|
18
|
+
exhaustedUntil: null,
|
|
19
|
+
exhaustedKind: null,
|
|
20
|
+
...extra,
|
|
21
|
+
});
|
|
22
|
+
|
|
23
|
+
function account(id: string, extra: Partial<SubscriptionAccount> = {}): SubscriptionAccount {
|
|
24
|
+
return {
|
|
25
|
+
id,
|
|
26
|
+
label: `Acme ${id}`,
|
|
27
|
+
email: `${id}@example.test`,
|
|
28
|
+
plan: "Pro",
|
|
29
|
+
source: "organization",
|
|
30
|
+
status: "active",
|
|
31
|
+
refusal: null,
|
|
32
|
+
choosable: true,
|
|
33
|
+
usage: snapshot(
|
|
34
|
+
[
|
|
35
|
+
{ id: "five_hour", usedPercent: 36, resetsAt: null, status: "ok" },
|
|
36
|
+
{ id: "seven_day", usedPercent: 62, resetsAt: null, status: "ok" },
|
|
37
|
+
],
|
|
38
|
+
{ observedAt: "2026-10-22T16:50:00Z" },
|
|
39
|
+
),
|
|
40
|
+
...extra,
|
|
41
|
+
};
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
function state(extra: Partial<SubscriptionAccountState> = {}): SubscriptionAccountState {
|
|
45
|
+
const accounts = [
|
|
46
|
+
account("a"),
|
|
47
|
+
account("b", { source: "workspace" }),
|
|
48
|
+
account("c", { status: "needs_relogin", choosable: false, refusal: "inactive", usage: null }),
|
|
49
|
+
];
|
|
50
|
+
return {
|
|
51
|
+
provider: "claude",
|
|
52
|
+
loading: false,
|
|
53
|
+
unavailable: false,
|
|
54
|
+
accounts,
|
|
55
|
+
current: accounts[0]!,
|
|
56
|
+
currentHidden: false,
|
|
57
|
+
serving: false,
|
|
58
|
+
automatic: true,
|
|
59
|
+
chosenId: null,
|
|
60
|
+
waiting: false,
|
|
61
|
+
usageCheck: "idle",
|
|
62
|
+
choosing: false,
|
|
63
|
+
choosingTarget: undefined,
|
|
64
|
+
appliedTo: null,
|
|
65
|
+
mutationError: null,
|
|
66
|
+
...extra,
|
|
67
|
+
};
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
describe("one menu for every subscription provider", () => {
|
|
71
|
+
test("Codex and Claude differ only in the provider name", () => {
|
|
72
|
+
const claude = subscriptionAccountMenuContent(state({ provider: "claude" }));
|
|
73
|
+
const codex = subscriptionAccountMenuContent(state({ provider: "codex" }));
|
|
74
|
+
const neutral = (value: unknown) => JSON.stringify(value).replaceAll(/Claude|Codex/g, "X");
|
|
75
|
+
expect(neutral(codex)).toBe(neutral(claude));
|
|
76
|
+
expect(claude.ariaLabel).toBe("Claude account · Acme a");
|
|
77
|
+
expect(codex.ariaLabel).toBe("Codex account · Acme a");
|
|
78
|
+
});
|
|
79
|
+
|
|
80
|
+
test("the current account shows its plan, owner, email and usage the same way", () => {
|
|
81
|
+
const content = subscriptionAccountMenuContent(state());
|
|
82
|
+
expect(content.selectionLabel).toBe("Current account");
|
|
83
|
+
expect(content.identity).toBe("a@example.test");
|
|
84
|
+
expect(content.metadata).toBe("Pro · Organization");
|
|
85
|
+
expect(content.usage.windows?.map((window) => [window.label, window.usedPercent])).toEqual([
|
|
86
|
+
["5h", 36],
|
|
87
|
+
["Week", 62],
|
|
88
|
+
]);
|
|
89
|
+
expect(content.usage.note).toStartWith("Updated ");
|
|
90
|
+
expect(content.automaticLabel).toBe("Automatic");
|
|
91
|
+
expect(content.actionLabel).toBe("Use for next turn");
|
|
92
|
+
// Other accounts summarize each window; the current one is shown above.
|
|
93
|
+
expect(content.accounts.map((row) => row.usageSummary)).toEqual([
|
|
94
|
+
undefined,
|
|
95
|
+
"5h 36% · Week 62% used",
|
|
96
|
+
undefined,
|
|
97
|
+
]);
|
|
98
|
+
expect(content.accounts[2]).toMatchObject({ status: "Needs reconnect", disabled: true });
|
|
99
|
+
expect(content.accounts[1]?.detail).toBe("Acme b · b@example.test · Pro · This workspace");
|
|
100
|
+
});
|
|
101
|
+
|
|
102
|
+
test("a turn waiting for capacity offers a retry for any provider", () => {
|
|
103
|
+
for (const provider of ["codex", "claude"]) {
|
|
104
|
+
const content = subscriptionAccountMenuContent(state({ provider, waiting: true }));
|
|
105
|
+
expect(content.selectionLabel).toBe("Limit reached");
|
|
106
|
+
expect(content.actionLabel).toBe("Retry with");
|
|
107
|
+
expect(content.tone).toBe("warn");
|
|
108
|
+
expect(content.note).toBe("Changing accounts retries the waiting turn.");
|
|
109
|
+
}
|
|
110
|
+
});
|
|
111
|
+
|
|
112
|
+
test("a chosen account this person cannot see keeps a way back to Automatic", () => {
|
|
113
|
+
const content = subscriptionAccountMenuContent(
|
|
114
|
+
state({ current: null, currentHidden: true, automatic: false, chosenId: null }),
|
|
115
|
+
);
|
|
116
|
+
expect(content.displayName).toBe("Account unavailable");
|
|
117
|
+
expect(content.selectionLabel).toBe("Chosen account");
|
|
118
|
+
expect(content.usage.message).toBe("Account usage hidden");
|
|
119
|
+
expect(content.automaticSelected).toBe(false);
|
|
120
|
+
expect(content.selectedId).toBeNull();
|
|
121
|
+
});
|
|
122
|
+
|
|
123
|
+
test("an explicit choice is checked and named as chosen", () => {
|
|
124
|
+
const content = subscriptionAccountMenuContent(state({ automatic: false, chosenId: "a" }));
|
|
125
|
+
expect(content.selectionLabel).toBe("Chosen account");
|
|
126
|
+
expect(content.selectedId).toBe("a");
|
|
127
|
+
expect(content.automaticSelected).toBe(false);
|
|
128
|
+
});
|
|
129
|
+
|
|
130
|
+
test("tone flags reconnects and windows near their limit", () => {
|
|
131
|
+
expect(
|
|
132
|
+
subscriptionAccountMenuContent(state({ current: account("x", { status: "needs_relogin" }) }))
|
|
133
|
+
.tone,
|
|
134
|
+
).toBe("bad");
|
|
135
|
+
expect(
|
|
136
|
+
subscriptionAccountMenuContent(
|
|
137
|
+
state({
|
|
138
|
+
current: account("x", {
|
|
139
|
+
usage: snapshot([{ id: "five_hour", usedPercent: 95, resetsAt: null, status: "ok" }]),
|
|
140
|
+
}),
|
|
141
|
+
}),
|
|
142
|
+
).tone,
|
|
143
|
+
).toBe("warn");
|
|
144
|
+
expect(subscriptionAccountMenuContent(state()).tone).toBe("ok");
|
|
145
|
+
});
|
|
146
|
+
|
|
147
|
+
test("empty and failed reads say so in the same words", () => {
|
|
148
|
+
const empty = subscriptionAccountMenuContent(state({ accounts: [], current: null }));
|
|
149
|
+
expect(empty.emptyMessage).toBe("No accounts available.");
|
|
150
|
+
expect(empty.displayName).toBe("Automatic");
|
|
151
|
+
expect(empty.metadata).toBe("Claude subscription");
|
|
152
|
+
const failed = subscriptionAccountMenuContent(
|
|
153
|
+
state({ accounts: [], current: null, unavailable: true }),
|
|
154
|
+
);
|
|
155
|
+
expect(failed.emptyMessage).toBe("Accounts unavailable.");
|
|
156
|
+
// A failed read does not know the selection, so nothing claims Automatic.
|
|
157
|
+
expect(failed.displayName).toBe("Accounts unavailable");
|
|
158
|
+
expect(failed.selectionLabel).toBe("Account selection");
|
|
159
|
+
expect(failed.automaticSelected).toBe(false);
|
|
160
|
+
expect(failed.selectedId).toBeNull();
|
|
161
|
+
expect(failed.ariaLabel).toBe("Claude account · Accounts unavailable");
|
|
162
|
+
expect(subscriptionAccountMenuContent(state({ mutationError: "busy" })).error).toBe(
|
|
163
|
+
"Couldn't switch: busy",
|
|
164
|
+
);
|
|
165
|
+
});
|
|
166
|
+
|
|
167
|
+
test("a failed check on the current account keeps the other accounts' readings", () => {
|
|
168
|
+
const failed = subscriptionAccountMenuContent(state({ usageCheck: "failed" }));
|
|
169
|
+
expect(failed.accounts.map((row) => row.usageSummary)).toEqual([
|
|
170
|
+
undefined,
|
|
171
|
+
"5h 36% · Week 62% used",
|
|
172
|
+
undefined,
|
|
173
|
+
]);
|
|
174
|
+
});
|
|
175
|
+
|
|
176
|
+
test("the serving account is the current account, even when another one is chosen", () => {
|
|
177
|
+
const hidden = subscriptionAccountMenuContent(
|
|
178
|
+
state({ current: null, currentHidden: true, serving: true, automatic: false, chosenId: "b" }),
|
|
179
|
+
);
|
|
180
|
+
expect(hidden.selectionLabel).toBe("Current account");
|
|
181
|
+
expect(hidden.displayName).toBe("Account unavailable");
|
|
182
|
+
expect(hidden.selectedId).toBe("b");
|
|
183
|
+
const visible = subscriptionAccountMenuContent(
|
|
184
|
+
state({ serving: true, automatic: false, chosenId: "a" }),
|
|
185
|
+
);
|
|
186
|
+
expect(visible.selectionLabel).toBe("Current account");
|
|
187
|
+
});
|
|
188
|
+
|
|
189
|
+
test("a chip near its limit says so to assistive technology", () => {
|
|
190
|
+
const near = subscriptionAccountMenuContent(
|
|
191
|
+
state({
|
|
192
|
+
current: account("a", {
|
|
193
|
+
usage: snapshot([
|
|
194
|
+
{ id: "five_hour", usedPercent: 95, resetsAt: null, status: "warning" },
|
|
195
|
+
]),
|
|
196
|
+
}),
|
|
197
|
+
}),
|
|
198
|
+
);
|
|
199
|
+
expect(near.ariaLabel).toBe("Claude account · Acme a · Near its limit");
|
|
200
|
+
});
|
|
201
|
+
|
|
202
|
+
test("with nothing to choose or show, only the provider mark remains", () => {
|
|
203
|
+
expect(showsSubscriptionAccountMenu(state({ accounts: [], current: null }))).toBe(false);
|
|
204
|
+
expect(showsSubscriptionAccountMenu(state())).toBe(true);
|
|
205
|
+
for (const extra of [
|
|
206
|
+
{ unavailable: true },
|
|
207
|
+
{ currentHidden: true },
|
|
208
|
+
{ waiting: true },
|
|
209
|
+
{ automatic: false },
|
|
210
|
+
]) {
|
|
211
|
+
expect(showsSubscriptionAccountMenu(state({ accounts: [], current: null, ...extra }))).toBe(
|
|
212
|
+
true,
|
|
213
|
+
);
|
|
214
|
+
}
|
|
215
|
+
});
|
|
216
|
+
|
|
217
|
+
test("a live check hides readings until it answers", () => {
|
|
218
|
+
const checking = subscriptionAccountMenuContent(state({ usageCheck: "checking" }));
|
|
219
|
+
expect(checking.usage).toEqual({ checking: true });
|
|
220
|
+
expect(checking.accounts.every((row) => row.usageSummary === undefined)).toBe(true);
|
|
221
|
+
expect(subscriptionAccountMenuContent(state({ usageCheck: "failed" })).usage).toEqual({
|
|
222
|
+
unavailable: true,
|
|
223
|
+
});
|
|
224
|
+
});
|
|
225
|
+
});
|
|
226
|
+
|
|
227
|
+
describe("usage readings", () => {
|
|
228
|
+
test("a limit whose end has passed no longer reads as reached", () => {
|
|
229
|
+
const ended = snapshot([], {
|
|
230
|
+
exhaustedUntil: "2026-10-22T10:00:00Z",
|
|
231
|
+
exhaustedKind: "quota",
|
|
232
|
+
});
|
|
233
|
+
expect(subscriptionAccountUsage(ended, Date.parse("2026-10-22T11:00:00Z")).message).toBe(
|
|
234
|
+
"No usage reading yet",
|
|
235
|
+
);
|
|
236
|
+
expect(subscriptionAccountUsage(ended, Date.parse("2026-10-22T09:00:00Z")).message).toStartWith(
|
|
237
|
+
"Limit reached until ",
|
|
238
|
+
);
|
|
239
|
+
});
|
|
240
|
+
|
|
241
|
+
test("missing readings and empty snapshots say there is no reading yet", () => {
|
|
242
|
+
expect(subscriptionAccountUsage(undefined).message).toBe("No usage reading yet");
|
|
243
|
+
expect(subscriptionAccountUsage(null).message).toBe("No usage reading yet");
|
|
244
|
+
const empty = subscriptionAccountUsage(snapshot([]));
|
|
245
|
+
expect(empty).toMatchObject({ message: "No usage reading yet", windows: [] });
|
|
246
|
+
expect(empty.note).toBeUndefined();
|
|
247
|
+
});
|
|
248
|
+
|
|
249
|
+
test("partial and unknown windows are never completed, aggregated or given a made-up percent", () => {
|
|
250
|
+
const view = subscriptionAccountUsage(
|
|
251
|
+
snapshot([
|
|
252
|
+
{ id: "seven_day_opus", usedPercent: null, resetsAt: null, status: "unknown" },
|
|
253
|
+
{ id: "overage", usedPercent: 125, resetsAt: null, status: "unknown" },
|
|
254
|
+
{ id: "custom", usedPercent: 8, resetsAt: null, status: "warning" },
|
|
255
|
+
]),
|
|
256
|
+
);
|
|
257
|
+
expect(view.windows?.map((window) => window.usedPercent)).toEqual([null, 125, 8]);
|
|
258
|
+
expect(view.windows?.map((window) => window.label)).toEqual([
|
|
259
|
+
"Week · Opus",
|
|
260
|
+
"Overage",
|
|
261
|
+
"custom",
|
|
262
|
+
]);
|
|
263
|
+
expect(view.summary).toBe("Week · Opus unknown · Overage 125% · custom 8% used");
|
|
264
|
+
expect(view.windows?.[0]?.detail).toContain("Status unknown");
|
|
265
|
+
expect(view.windows?.[2]?.detail).toContain("Near its limit");
|
|
266
|
+
});
|
|
267
|
+
|
|
268
|
+
test("neutral primary/secondary ids do not claim a window length", () => {
|
|
269
|
+
const view = subscriptionAccountUsage(
|
|
270
|
+
snapshot([{ id: "primary", usedPercent: 10, resetsAt: null, status: "ok" }]),
|
|
271
|
+
);
|
|
272
|
+
expect(view.windows?.[0]?.label).toBe("Primary");
|
|
273
|
+
});
|
|
274
|
+
|
|
275
|
+
test("an account-wide limit without windows names when it ends", () => {
|
|
276
|
+
const view = subscriptionAccountUsage(
|
|
277
|
+
snapshot([], { exhaustedKind: "rate_limit", exhaustedUntil: "2020-01-01T09:00:00Z" }),
|
|
278
|
+
Date.parse("2020-01-01T08:00:00Z"),
|
|
279
|
+
);
|
|
280
|
+
expect(view.message).toStartWith("Limit reached until ");
|
|
281
|
+
expect(view.windows).toEqual([]);
|
|
282
|
+
});
|
|
283
|
+
|
|
284
|
+
test("a past reset keeps the reading but says it may be outdated", () => {
|
|
285
|
+
const value = snapshot([
|
|
286
|
+
{ id: "five_hour", usedPercent: 100, resetsAt: "2026-10-12T12:00:00Z", status: "exhausted" },
|
|
287
|
+
]);
|
|
288
|
+
const before = subscriptionAccountUsage(value, Date.parse("2026-10-12T11:00:00Z"));
|
|
289
|
+
const after = subscriptionAccountUsage(value, Date.parse("2026-10-12T13:00:00Z"));
|
|
290
|
+
expect(before.windows?.[0]?.detail).toContain("Resets ");
|
|
291
|
+
expect(after.windows?.[0]?.detail).toContain("Reset passed; usage may be outdated");
|
|
292
|
+
expect(after.windows?.[0]?.detail).toContain("Limit reached");
|
|
293
|
+
expect(after.windows?.[0]?.usedPercent).toBe(100);
|
|
294
|
+
});
|
|
295
|
+
});
|
|
296
|
+
|
|
297
|
+
describe("which subscription a chat offers accounts for", () => {
|
|
298
|
+
test("Codex product models, then the catalog's connected subscription", () => {
|
|
299
|
+
expect(subscriptionAccountProvider("codex/gpt-6-astra", undefined)).toBe("codex");
|
|
300
|
+
expect(
|
|
301
|
+
subscriptionAccountProvider("organization-claude-subscription/claude-opus-5-5", {
|
|
302
|
+
kind: "connected_subscription",
|
|
303
|
+
provider: "claude",
|
|
304
|
+
}),
|
|
305
|
+
).toBe("claude");
|
|
306
|
+
expect(
|
|
307
|
+
subscriptionAccountProvider("supergrok/grok-4.6", {
|
|
308
|
+
kind: "connected_subscription",
|
|
309
|
+
provider: "xai",
|
|
310
|
+
}),
|
|
311
|
+
).toBe("xai");
|
|
312
|
+
expect(subscriptionAccountProvider("gpt-5.6-sol", undefined)).toBeNull();
|
|
313
|
+
});
|
|
314
|
+
});
|