openpond 0.0.35 → 0.0.37
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/README.md +4 -0
- package/dist/chunks/{app-layer-GUF2CKYH.js → app-layer-LF2HK2B2.js} +6 -3
- package/dist/chunks/{apps-DIVHAUOV.js → apps-ZMCMQZKX.js} +16 -12
- package/dist/chunks/{chunk-YPK2W34Z.js → chunk-2WMGA5FE.js} +8 -10
- package/dist/chunks/{chunk-NTRTK6C6.js → chunk-35PPAOWD.js} +2 -2
- package/dist/chunks/chunk-3VURZQHA.js +864 -0
- package/dist/chunks/{chunk-FRPL5XPX.js → chunk-43YI36NA.js} +1 -1
- package/dist/chunks/{chunk-4Y25BACE.js → chunk-A3CJUBA7.js} +1 -1
- package/dist/chunks/{chunk-RLQGMSW7.js → chunk-BWA3COR4.js} +573 -1204
- package/dist/chunks/{chunk-TXJ4TIDO.js → chunk-HLCTINEP.js} +1 -1
- package/dist/chunks/{chunk-GUGFYXFS.js → chunk-IATK3CIP.js} +6 -6
- package/dist/chunks/{chunk-2GV3QBBZ.js → chunk-ICLLW5QD.js} +1 -1
- package/dist/chunks/chunk-KSRWKXRB.js +12 -0
- package/dist/chunks/{chunk-II2ERA2H.js → chunk-KT2BB4AR.js} +30 -11
- package/dist/chunks/{chunk-XIF53VR3.js → chunk-LNKYEHIJ.js} +28 -3
- package/dist/chunks/{chunk-SECNDLPQ.js → chunk-MHBQWGCL.js} +1070 -57
- package/dist/chunks/chunk-MUMPWI4O.js +92 -0
- package/dist/chunks/{chunk-ZZOTKXRD.js → chunk-N6E6YSTP.js} +2 -2
- package/dist/chunks/{chunk-S3VA47DG.js → chunk-PGET7EZF.js} +7 -5
- package/dist/chunks/chunk-T4QXKU5Y.js +1 -0
- package/dist/chunks/{chunk-LUA5QGQP.js → chunk-VFL2JVBZ.js} +48 -121
- package/dist/chunks/{chunk-EY52SLOQ.js → chunk-WL76II47.js} +1 -1
- package/dist/chunks/{chunk-CRFB72X2.js → chunk-WTA33KQQ.js} +23 -19
- package/dist/chunks/{chunk-LHYK6QO2.js → chunk-XEJ7XXUQ.js} +1 -0
- package/dist/chunks/{chunk-2I5TZW66.js → chunk-ZPL4GZML.js} +128 -4
- package/dist/chunks/chunk-ZZ4ECDTP.js +668 -0
- package/dist/chunks/{cli-HUVI6ELM.js → cli-5NFIDCRL.js} +5 -5
- package/dist/chunks/cli-AS3DZ7XB.js +23 -0
- package/dist/chunks/{core-commands-2HUTKFHQ.js → core-commands-7223BEQL.js} +7 -4
- package/dist/chunks/{extend-PAJMXYKV.js → extend-6N5S5KA5.js} +18 -13
- package/dist/chunks/extension-FJSVCG2Q.js +121 -0
- package/dist/chunks/{harness-UWAS2VAN.js → harness-OMJXIGEW.js} +6 -3
- package/dist/chunks/{help-M7D2XAOX.js → help-YPPROIS7.js} +2 -1
- package/dist/chunks/{opchat-FQ2CJVM6.js → opchat-K7IYFPX6.js} +12 -7
- package/dist/chunks/{organizations-L5N6LJ7O.js → organizations-W3FMAWQ4.js} +8 -5
- package/dist/chunks/{profile-KH5IKVNY.js → profile-N4B3F7M7.js} +11 -8
- package/dist/chunks/{project-agent-F4NHVRGY.js → project-agent-NA6SGU25.js} +10 -7
- package/dist/chunks/{sandbox-command-DDXRQNB6.js → sandbox-command-AKCFJKKN.js} +7 -4
- package/dist/chunks/{sandbox-template-5EEEQKR5.js → sandbox-template-5NKTAXCL.js} +11 -7
- package/dist/chunks/{src-34FV42HE.js → src-SCS4KKP4.js} +2387 -1262
- package/dist/chunks/{src-LHZWUSD7.js → src-XAVSQTVR.js} +3 -3
- package/dist/chunks/{teams-bot-HFWO5GOV.js → teams-bot-557NZC73.js} +6 -3
- package/dist/chunks/{workspaces-LO44JAC2.js → workspaces-S2H75XQB.js} +6 -2
- package/dist/cli.js +14 -11
- package/dist/index.js +27 -9
- package/dist/profile/local-profile-types.d.ts +1 -0
- package/dist/profile/profile-skills.d.ts +2 -0
- package/dist/web/assets/{AppDialog-T3j6O3yg.js → AppDialog-y6krB0MJ.js} +1 -1
- package/dist/web/assets/{AppsView-70Qqf9eJ.js → AppsView-4F6oLktr.js} +1 -1
- package/dist/web/assets/{BrowserSidebar-CdBLHdNW.js → BrowserSidebar-C0MHQaaD.js} +1 -1
- package/dist/web/assets/{CloudWorkView-C5-jvlOo.js → CloudWorkView-DwFIZoXy.js} +1 -1
- package/dist/web/assets/CommandMenu-CYGFrMZi.js +1 -0
- package/dist/web/assets/{CommunityView-BHUJ9Hun.js → CommunityView-C6n89YXz.js} +1 -1
- package/dist/web/assets/ComposerCreateImproveStrip-C3RwXC3_.js +1 -0
- package/dist/web/assets/{GetStartedView-CIXScviw.js → GetStartedView-fwD0ZXo9.js} +1 -1
- package/dist/web/assets/LabSkillSidebar-BSuc-NJr.js +1 -0
- package/dist/web/assets/LabSkillSidebar-CVxtS9pd.css +1 -0
- package/dist/web/assets/LabsRoute-BrJkBNig.css +1 -0
- package/dist/web/assets/LabsRoute-D2y8dSsT.js +3 -0
- package/dist/web/assets/MainChatThread-Dj_Ry6WQ.js +2 -0
- package/dist/web/assets/{MakeAgentTutorialLearningPanel-r7jyZVc0.js → MakeAgentTutorialLearningPanel-Bz2VDaRe.js} +2 -2
- package/dist/web/assets/{MarkdownText-E35C404I.js → MarkdownText-B6Nu_0Fz.js} +4 -4
- package/dist/web/assets/Messages-CH2wfv2a.js +10 -0
- package/dist/web/assets/NativeSkillSidebar-4iUfgwqO.js +1 -0
- package/dist/web/assets/{NewProjectDialog-BowacUmA.js → NewProjectDialog-8M5-6-h-.js} +1 -1
- package/dist/web/assets/{PostTrainingLearningPanel-oJu5qaHK.js → PostTrainingLearningPanel-CdG5KHZs.js} +2 -2
- package/dist/web/assets/{PostTrainingStatusPill-B9Eoc4s0.js → PostTrainingStatusPill-COZ4qISQ.js} +1 -1
- package/dist/web/assets/{ProfileSettingsSection-Dnh92gDH.js → ProfileSettingsSection-Bo7dybgW.js} +1 -1
- package/dist/web/assets/RightChatPanelStack-Di8zoHJI.js +1 -0
- package/dist/web/assets/{SettingsView-uHhQnazW.css → SettingsView-BcYyY66X.css} +1 -1
- package/dist/web/assets/SettingsView-CAaKdDHt.js +6 -0
- package/dist/web/assets/{TeamChatView-Tn4X5cuY.js → TeamChatView-CzQYFBap.js} +2 -2
- package/dist/web/assets/{TerminalOverlay-DoX5LYzK.js → TerminalOverlay-B56XmI-k.js} +1 -1
- package/dist/web/assets/TrainingCreationPanel-C_ntWAAP.js +1 -0
- package/dist/web/assets/{TrainingDraftPanel-Da6uGu9y.js → TrainingDraftPanel-3hJIxLNn.js} +1 -1
- package/dist/web/assets/{UsageSettingsSection-DKky0p47.js → UsageSettingsSection-r3CqRm6Q.js} +1 -1
- package/dist/web/assets/WorkspaceDiffPanel-By8PWUuE.js +14 -0
- package/dist/web/assets/{WorkspaceEnvironmentMenu-Ba4M8z1N.js → WorkspaceEnvironmentMenu-7wmC-spz.js} +3 -3
- package/dist/web/assets/{WorkspaceGitDialogs-CSepNOb8.js → WorkspaceGitDialogs-Hn--lsRh.js} +1 -1
- package/dist/web/assets/{WorkspaceMonacoEditor-LhFdzCRs.js → WorkspaceMonacoEditor-CHd22UcG.js} +3 -3
- package/dist/web/assets/{activity-bW02ZsBD.js → activity-Dp5V58om.js} +1 -1
- package/dist/web/assets/{boxes-B1dRA1pi.js → boxes-DE7WJaEv.js} +1 -1
- package/dist/web/assets/{chevron-up-CySy6WNq.js → chevron-up-BWx8gGab.js} +1 -1
- package/dist/web/assets/{circle-x-DY8vKAKi.js → circle-x-DnmOfZIg.js} +1 -1
- package/dist/web/assets/{copy-DuHI1UZ_.js → copy-BjWvaXLC.js} +1 -1
- package/dist/web/assets/{create-pipeline-request-CGBcdK9r.js → create-pipeline-request-C4V6-lWN.js} +3 -3
- package/dist/web/assets/{credit-card-Bot0OuTl.js → credit-card-Bjg0Zaw5.js} +1 -1
- package/dist/web/assets/{cssMode-BIjAothW.js → cssMode-KFDYjM8T.js} +1 -1
- package/dist/web/assets/file-BrC1KjAS.js +1 -0
- package/dist/web/assets/{git-branch-Cm02aNWq.js → git-branch-DTeeARsp.js} +1 -1
- package/dist/web/assets/{git-commit-horizontal-FYILXW0v.js → git-commit-horizontal-C8UFKlXy.js} +1 -1
- package/dist/web/assets/{htmlMode-zO2xLLgL.js → htmlMode-NbLN3n6Q.js} +1 -1
- package/dist/web/assets/index-BcZetaeD.css +1 -0
- package/dist/web/assets/index-DQalqxbw.js +177 -0
- package/dist/web/assets/index-DYxF_d9i.js +1 -0
- package/dist/web/assets/{info-DeuEU_RO.js → info-BXBpMeVU.js} +1 -1
- package/dist/web/assets/{jsonMode-D2A3mj4n.js → jsonMode-Bl3r4LM_.js} +1 -1
- package/dist/web/assets/{lspLanguageFeatures-aPSqvscU.js → lspLanguageFeatures-DH22w5XD.js} +1 -1
- package/dist/web/assets/make-agent-tutorial-CAnTPFCK.js +2 -0
- package/dist/web/assets/{monaco.contribution-Do3Jjslo.js → monaco.contribution-C0BsxYAz.js} +2 -2
- package/dist/web/assets/{monaco.contribution-DAq6Jihl.js → monaco.contribution-CzpXjm9j.js} +2 -2
- package/dist/web/assets/{monaco.contribution-CHVe9CQ9.js → monaco.contribution-DK-g-i00.js} +2 -2
- package/dist/web/assets/{monaco.contribution-KqCt1n9-.js → monaco.contribution-iAurj7TQ.js} +2 -2
- package/dist/web/assets/{monitor-DXvHWFeW.js → monitor-Ba2FFblh.js} +1 -1
- package/dist/web/assets/{play-BIHyH-Yu.js → play-2NDQ4-7K.js} +1 -1
- package/dist/web/assets/{python-g3mtmU2J.js → python-CQ0TmUW9.js} +1 -1
- package/dist/web/assets/{refresh-cw-Daz0oqwK.js → refresh-cw-CyermMsy.js} +1 -1
- package/dist/web/assets/{reply-wu9DIBuK.js → reply-BSExNLHM.js} +1 -1
- package/dist/web/assets/{rotate-cw-D7q9GgNc.js → rotate-cw-DJ-zYG9E.js} +1 -1
- package/dist/web/assets/{save-BVFY6VTI.js → save-Bij3cc3Q.js} +1 -1
- package/dist/web/assets/{toggleHighContrast-D9C_WUDu.js → toggleHighContrast-CxALivAH.js} +1 -1
- package/dist/web/assets/{training-1du5QD-P.css → training-BN8CALIc.css} +1 -1
- package/dist/web/assets/{tsMode-B4lEUN5X.js → tsMode-vH4lMS7h.js} +1 -1
- package/dist/web/assets/{upload-DNbYB4Rl.js → upload-DbJfEI3G.js} +1 -1
- package/dist/web/assets/{wifi-off-C5QLifIJ.js → wifi-off-BnVFBG28.js} +1 -1
- package/dist/web/assets/{workers-CV4BZb_x.js → workers-CBihj7z6.js} +1 -1
- package/dist/web/assets/{yaml-3ah8oX43.js → yaml-Bhkoq1sy.js} +1 -1
- package/dist/web/index.html +2 -2
- package/docs/command-reference.md +15 -0
- package/package.json +1 -1
- package/dist/chunks/cli-3AEIYSMD.js +0 -19
- package/dist/web/assets/CommandMenu-B3Y4MvmT.js +0 -1
- package/dist/web/assets/ComposerCreateImproveStrip-DeRI5XEO.js +0 -1
- package/dist/web/assets/LabsRoute-CgKtVYTP.css +0 -1
- package/dist/web/assets/LabsRoute-Cs_R1fuu.js +0 -3
- package/dist/web/assets/MainChatThread-h7VSA_Rc.js +0 -2
- package/dist/web/assets/Messages-BANZuAnA.js +0 -10
- package/dist/web/assets/NativeSkillSidebar-Qgccncuc.js +0 -1
- package/dist/web/assets/RightChatPanelStack-pGwbt6Wy.js +0 -1
- package/dist/web/assets/SettingsView-Bjehxwt1.js +0 -6
- package/dist/web/assets/TrainingCreationPanel-BLSf1Bnp.js +0 -1
- package/dist/web/assets/WorkspaceDiffPanel-DTRtW9n8.js +0 -14
- package/dist/web/assets/circle-alert-DMHz5tj_.js +0 -1
- package/dist/web/assets/index-B5AN29EO.js +0 -177
- package/dist/web/assets/index-BnwYyUgT.js +0 -1
- package/dist/web/assets/index-COGlKIJ4.css +0 -1
- package/dist/web/assets/make-agent-tutorial-A2W9Ajwv.js +0 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
.remote-access-summary{align-items:flex-start}.remote-access-summary .account-summary-actions{flex-wrap:wrap}.remote-access-icon,.remote-access-peer-dot{display:grid;place-items:center;width:34px;height:34px;border-radius:17px;background:#ffffff12;color:#9d9d9d}.remote-access-icon.configured{background:#3aa3ff21;color:#77bdff}.remote-access-icon.online{background:#50c87821;color:#8ddfa8}.remote-access-link-heading{align-items:center}.remote-access-link-heading>div{display:grid;gap:3px;min-width:0}.remote-access-link-heading span,.remote-access-link-heading small{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.remote-access-value-row{align-items:flex-start}.remote-access-value-row div{gap:6px}.remote-access-value-row strong.flash{animation:remote-access-title-flash 1.5s ease-out}.remote-access-value-row code{display:block;max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:#dcdcdc;font:12px/1.45 ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,monospace}.remote-access-peer-row{grid-template-columns:38px minmax(0,1fr) auto auto}.remote-access-environment{display:grid}.remote-access-environment-row{display:grid;min-height:62px;border-bottom:1px solid rgba(255,255,255,.06)}.remote-access-environment-row:last-child{border-bottom:0}.remote-access-environment-row.three{grid-template-columns:repeat(3,minmax(0,1fr))}.remote-access-environment-row.two{grid-template-columns:repeat(2,minmax(0,1fr))}.remote-access-environment-cell{display:grid;align-content:center;gap:5px;min-width:0;padding:12px 16px;border-right:1px solid rgba(255,255,255,.06)}.remote-access-environment-cell:last-child{border-right:0}.remote-access-environment-cell strong,.remote-access-environment-cell span{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.remote-access-environment-cell strong{color:#f6f6f6;font-size:13px;font-weight:550}.remote-access-environment-cell span{color:#9b9b9b;font-size:12px}.remote-access-peer-dot{width:11px;height:11px;justify-self:center;border-radius:999px;background:#555}.remote-access-peer-dot.online{background:#58d68d;box-shadow:0 0 0 4px #58d68d1f}.remote-access-config{overflow:hidden;border:1px solid var(--border);border-radius:16px;background:#181818}.remote-access-config pre{max-height:260px;margin:0;overflow:auto;background:#0f0f0f;color:#dcdcdc;padding:14px 16px;font:12px/1.5 ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,monospace;white-space:pre}@keyframes remote-access-title-flash{0%,to{color:#f6f6f6;text-shadow:none}18%,55%{color:#ffbc8f;text-shadow:0 0 12px rgba(255,156,86,.35)}}@media(max-width:720px){.remote-access-environment-row.three,.remote-access-environment-row.two{grid-template-columns:1fr}.remote-access-environment-cell{min-height:56px;border-right:0;border-bottom:1px solid rgba(255,255,255,.06)}.remote-access-environment-cell:last-child{border-bottom:0}}.compute-settings{gap:16px}.compute-title-row{display:flex;align-items:center;justify-content:space-between;gap:12px}.compute-title-row h1{margin:0}.dataset-storage-intro{max-width:680px;margin:7px 0 0;color:#999;font-size:13px;line-height:1.5}.dataset-storage-list{min-width:0}.dataset-storage-row small.dataset-storage-error{color:#df8e8e}.compute-summary-main{grid-template-columns:minmax(0,1fr)}.compute-device-default{padding-top:0}.model-storage-picker{display:grid;gap:6px;max-width:640px;padding:14px 16px 16px}.model-storage-label{color:#9b9b9b;font-size:12px;white-space:nowrap}.model-storage-control-row{display:grid;grid-template-columns:minmax(0,1fr) 36px;align-items:center;gap:8px}.model-storage-select{width:100%;min-width:0;height:36px;border:1px solid rgba(255,255,255,.08);border-radius:8px;outline:0;appearance:none;background:linear-gradient(45deg,transparent 50%,#9b9b9b 50%) calc(100% - 16px) 50% / 5px 5px no-repeat,linear-gradient(135deg,#9b9b9b 50%,transparent 50%) calc(100% - 11px) 50% / 5px 5px no-repeat,#101010;color:var(--text);padding:0 32px 0 10px;font-size:13px}.model-storage-select:focus{border-color:#06b6d480}.model-storage-add{width:36px;height:36px}.model-storage-dialog{width:min(520px,calc(100vw - 34px))}.model-storage-dialog-note{border:1px solid rgba(143,200,255,.16);border-radius:9px;background:#8fc8ff12;color:#b4cae0;padding:9px 10px;font-size:12px;line-height:1.45}.compute-row{display:flex;align-items:center;justify-content:space-between;gap:18px;padding:13px 16px;border-top:1px solid var(--border)}.compute-row:first-of-type{border-top:0}.compute-row>div{display:grid;gap:4px;min-width:0}.compute-row strong{color:#f1f1f1;font-size:13px;font-weight:570}.compute-row small{overflow-wrap:anywhere;color:#9b9b9b;font-size:12px}.compute-row>span{flex:0 0 auto;color:#b7b7b7;font-size:12px}.compute-diagnostics{border:1px solid var(--border);border-radius:12px;color:#b7b7b7;padding:12px 14px;font-size:12px}.compute-diagnostics summary{color:#dedede;cursor:pointer}.compute-diagnostics ul{margin:10px 0 0;padding-left:18px}.compute-heading-actions{display:flex;align-items:center;gap:8px}.compute-download-row{display:grid;gap:10px;padding:13px 16px;border-top:1px solid var(--border)}.compute-download-row>div{display:grid;gap:4px}.compute-download-row strong{color:#f1f1f1;font-size:13px}.compute-download-row small{overflow-wrap:anywhere;color:#9b9b9b;font-size:12px}.compute-download-row progress{width:100%;height:5px;accent-color:var(--cyan)}@media(max-width:720px){.compute-row{align-items:flex-start;flex-direction:column;gap:7px}}.notification-settings-card{overflow:hidden}.notification-mode-list{display:grid}.notification-mode-option{display:grid;grid-template-columns:18px minmax(0,1fr);align-items:start;gap:11px;min-height:66px;padding:14px 16px;border-bottom:1px solid rgba(255,255,255,.06);background:transparent;cursor:pointer}.notification-mode-option:last-child{border-bottom:0}.notification-mode-option:hover{background:#ffffff09}.notification-mode-option.selected{background:#3aa3ff13}.notification-mode-option input{width:15px;height:15px;margin:2px 0 0;accent-color:#3aa3ff}.notification-mode-option>span,.notification-thread-copy{display:grid;min-width:0;gap:4px}.notification-mode-option strong,.notification-thread-copy strong{color:#f4f4f4;font-size:13px;font-weight:560}.notification-mode-option small,.notification-thread-copy small{color:#9b9b9b;font-size:12px;line-height:1.4}.notification-thread-row{display:grid;grid-template-columns:32px minmax(0,1fr) auto;align-items:center;gap:12px;min-height:66px;padding:12px 16px;border-bottom:1px solid rgba(255,255,255,.06)}.notification-thread-row:last-of-type{border-bottom:0}.notification-thread-icon{display:grid;place-items:center;width:32px;height:32px;border-radius:10px;background:#3aa3ff1c;color:#8fc8ff}.notification-thread-icon.muted{background:#ffffff0f;color:#929292}.notification-settings-error{padding:11px 16px;border-top:1px solid rgba(255,98,98,.2);background:#ff626212;color:#ffb0b0;font-size:12px}@media(max-width:760px){.notification-thread-row{grid-template-columns:32px minmax(0,1fr)}.notification-thread-row>.settings-secondary{grid-column:2;justify-self:start}}.wallet-view{display:grid;gap:18px;width:min(920px,calc(100% - 96px));min-width:0;justify-self:center}.wallet-credit-card{display:grid;gap:28px;width:min(520px,100%);min-height:258px;border:1px solid rgba(255,255,255,.1);border-radius:8px;background:#202322;color:#f7f7f7;padding:20px;box-shadow:0 18px 48px #00000047}.wallet-card-top,.wallet-card-bottom,.wallet-panel-header,.wallet-address-row,.wallet-asset-row{display:flex;align-items:center}.wallet-card-top,.wallet-panel-header,.wallet-address-row,.wallet-asset-row{justify-content:space-between;gap:14px}.wallet-card-brand{display:inline-flex;align-items:center;gap:8px;color:#d7f0df;font-size:13px;font-weight:650}.wallet-card-balance{display:grid;gap:5px}.wallet-card-balance span,.wallet-card-bottom span,.wallet-panel-header span,.wallet-card-address span,.wallet-address-row span,.wallet-asset-row span{color:#9b9b9b;font-size:12px}.wallet-card-balance strong{color:#f9f9f9;font-size:32px;font-weight:600;letter-spacing:0}.wallet-card-bottom{display:grid;grid-template-columns:minmax(0,1fr) minmax(120px,auto);align-items:end;gap:18px}.wallet-card-bottom>div,.wallet-panel-header div,.wallet-asset-row>div:not(.wallet-asset-identity){display:grid;gap:4px;min-width:0}.wallet-address-row>div{display:grid;gap:4px;min-width:0;width:100%}.wallet-card-bottom strong,.wallet-panel-header strong,.wallet-asset-row strong{min-width:0;overflow:hidden;color:#f3f3f3;text-overflow:ellipsis;white-space:nowrap;font-size:14px;font-weight:550}.wallet-card-products{justify-items:end;text-align:right}.wallet-card-products strong{max-width:220px}.wallet-content-grid{display:grid;grid-template-columns:minmax(0,1.15fr) minmax(260px,.85fr);align-items:start;gap:14px}.wallet-side-stack{display:grid;gap:14px;min-width:0}.wallet-panel{min-width:0;overflow:hidden;border:1px solid var(--border);border-radius:8px;background:#181818}.wallet-panel-header{min-height:62px;padding:14px 16px;border-bottom:1px solid var(--border)}.wallet-address-list,.wallet-asset-list{display:grid}.wallet-address-row,.wallet-asset-row{min-height:64px;padding:13px 16px;border-bottom:1px solid rgba(255,255,255,.06)}.wallet-address-row{justify-content:stretch}.wallet-address-row:last-child,.wallet-asset-row:last-child{border-bottom:0}.wallet-card-address{display:grid;gap:6px;margin-top:12px}.wallet-card-address>div{display:flex;align-items:center;gap:6px;min-width:0;max-width:100%}.wallet-card-address code{display:block;min-width:0;flex:0 1 auto;overflow:hidden;color:#e8e8e8;text-overflow:ellipsis;white-space:nowrap;filter:blur(5px);font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;font-size:12px;transition:filter .14s ease;-webkit-user-select:none;user-select:none}.wallet-card-address:hover code,.wallet-card-address:focus-within code{filter:blur(0);-webkit-user-select:text;user-select:text}.wallet-card-address.empty code{color:#777;filter:none;font-family:inherit;-webkit-user-select:auto;user-select:auto}.wallet-address-row code{display:block;min-width:0;flex:1 1 auto;overflow:hidden;color:#e8e8e8;text-overflow:ellipsis;white-space:nowrap;filter:blur(5px);font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;font-size:12px;transition:filter .14s ease;-webkit-user-select:none;user-select:none}.wallet-address-line{display:flex;align-items:center;gap:6px;min-width:0;width:100%}.wallet-address-row:hover code,.wallet-address-row:focus-within code{filter:blur(0);-webkit-user-select:text;user-select:text}.wallet-address-row.empty code{color:#777;filter:none;font-family:inherit;-webkit-user-select:auto;user-select:auto}.wallet-copy-button{display:inline-grid;place-items:center;width:24px;height:24px;flex:0 0 24px;border:0;border-radius:8px;background:#252525;color:#a8a8a8;padding:0}.wallet-copy-button.ghost{background:transparent;color:#c7c7c7}.wallet-copy-button:hover:not(:disabled),.wallet-copy-button:focus-visible{outline:0;background:#303030;color:var(--text)}.wallet-copy-button.ghost:hover:not(:disabled),.wallet-copy-button.ghost:focus-visible{background:#ffffff14}.wallet-copy-button:disabled{opacity:.42}.wallet-asset-row>span{flex:0 0 auto;color:#8ddfa8}.wallet-asset-row.empty{justify-content:flex-start}.wallet-asset-values{display:grid;justify-items:end;gap:4px;min-width:120px;text-align:right}.wallet-asset-values strong{max-width:180px}.wallet-asset-values span{color:#8ddfa8}.wallet-asset-identity{display:inline-flex;align-items:center;gap:10px;min-width:0;flex:1 1 auto;overflow:hidden;white-space:nowrap}.wallet-asset-identity strong{color:#f3f3f3;font-size:14px;font-weight:550;overflow:hidden;text-overflow:ellipsis}.wallet-asset-identity>span:not(.wallet-token-fallback){flex:0 0 auto;color:#9b9b9b;font-size:12px;font-weight:450}.wallet-asset-identity img,.wallet-token-fallback{width:24px;height:24px;flex:0 0 24px;border-radius:999px}.wallet-token-fallback{display:inline-grid;place-items:center;background:#2a2d2c;color:#d7f0df;font-size:11px;font-weight:650}.skills-settings{max-width:980px}.skills-settings-header{display:flex;align-items:flex-start;justify-content:space-between;gap:24px}.skills-settings-header h1{margin-bottom:8px}.skills-settings-header p{max-width:680px;margin:0;color:var(--muted);font-size:13px;line-height:1.55}.native-skills-list{border:1px solid rgba(255,255,255,.08);border-radius:14px;background:#ffffff05}.native-skill-row{display:grid;grid-template-columns:34px minmax(220px,1.2fr) minmax(180px,.8fr) auto 16px;align-items:center;gap:12px;width:100%;min-height:72px;border:0;border-bottom:1px solid rgba(255,255,255,.06);background:transparent;color:var(--text);padding:12px 16px;text-align:left}.native-skill-row:last-child{border-bottom:0}.native-skill-row:hover,.native-skill-row:focus-visible{background:#ffffff0b}.native-skill-row:focus-visible{outline:1px solid rgba(34,211,238,.46);outline-offset:-1px}.native-skill-icon{display:grid;place-items:center;width:32px;height:32px;border-radius:9px;background:#22d3ee17;color:#67e8f9}.native-skill-identity,.native-skill-provider{display:grid;gap:4px;min-width:0}.native-skill-identity strong,.native-skill-provider strong,.native-skill-identity span,.native-skill-provider span{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.native-skill-identity strong{font-size:13px;font-weight:620}.native-skill-identity span,.native-skill-provider span{color:var(--muted);font-size:11px}.native-skill-provider strong{color:#d8d8d8;font-size:12px;font-weight:560}.native-skill-provider span{font-family:var(--font-mono, ui-monospace, SFMono-Regular, Menlo, monospace)}.native-skill-status{border-radius:999px;background:#4ade8017;color:#86efac;padding:5px 8px;font-size:10px;font-weight:650;white-space:nowrap}.native-skill-row>svg{color:#737373}@media(max-width:760px){.skills-settings-header{flex-direction:column;gap:12px}.native-skill-row{grid-template-columns:34px minmax(0,1fr) 16px}.native-skill-provider,.native-skill-status{display:none}}
|
|
1
|
+
.remote-access-summary{align-items:flex-start}.remote-access-summary .account-summary-actions{flex-wrap:wrap}.remote-access-icon,.remote-access-peer-dot{display:grid;place-items:center;width:34px;height:34px;border-radius:17px;background:#ffffff12;color:#9d9d9d}.remote-access-icon.configured{background:#3aa3ff21;color:#77bdff}.remote-access-icon.online{background:#50c87821;color:#8ddfa8}.remote-access-link-heading{align-items:center}.remote-access-link-heading>div{display:grid;gap:3px;min-width:0}.remote-access-link-heading span,.remote-access-link-heading small{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.remote-access-value-row{align-items:flex-start}.remote-access-value-row div{gap:6px}.remote-access-value-row strong.flash{animation:remote-access-title-flash 1.5s ease-out}.remote-access-value-row code{display:block;max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:#dcdcdc;font:12px/1.45 ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,monospace}.remote-access-peer-row{grid-template-columns:38px minmax(0,1fr) auto auto}.remote-access-environment{display:grid}.remote-access-environment-row{display:grid;min-height:62px;border-bottom:1px solid rgba(255,255,255,.06)}.remote-access-environment-row:last-child{border-bottom:0}.remote-access-environment-row.three{grid-template-columns:repeat(3,minmax(0,1fr))}.remote-access-environment-row.two{grid-template-columns:repeat(2,minmax(0,1fr))}.remote-access-environment-cell{display:grid;align-content:center;gap:5px;min-width:0;padding:12px 16px;border-right:1px solid rgba(255,255,255,.06)}.remote-access-environment-cell:last-child{border-right:0}.remote-access-environment-cell strong,.remote-access-environment-cell span{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.remote-access-environment-cell strong{color:#f6f6f6;font-size:13px;font-weight:550}.remote-access-environment-cell span{color:#9b9b9b;font-size:12px}.remote-access-peer-dot{width:11px;height:11px;justify-self:center;border-radius:999px;background:#555}.remote-access-peer-dot.online{background:#58d68d;box-shadow:0 0 0 4px #58d68d1f}.remote-access-config{overflow:hidden;border:1px solid var(--border);border-radius:16px;background:#181818}.remote-access-config pre{max-height:260px;margin:0;overflow:auto;background:#0f0f0f;color:#dcdcdc;padding:14px 16px;font:12px/1.5 ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,monospace;white-space:pre}@keyframes remote-access-title-flash{0%,to{color:#f6f6f6;text-shadow:none}18%,55%{color:#ffbc8f;text-shadow:0 0 12px rgba(255,156,86,.35)}}@media(max-width:720px){.remote-access-environment-row.three,.remote-access-environment-row.two{grid-template-columns:1fr}.remote-access-environment-cell{min-height:56px;border-right:0;border-bottom:1px solid rgba(255,255,255,.06)}.remote-access-environment-cell:last-child{border-bottom:0}}.compute-settings{gap:16px}.compute-title-row{display:flex;align-items:center;justify-content:space-between;gap:12px}.compute-title-row h1{margin:0}.dataset-storage-intro{max-width:680px;margin:7px 0 0;color:#999;font-size:13px;line-height:1.5}.dataset-storage-list{min-width:0}.dataset-storage-row small.dataset-storage-error{color:#df8e8e}.compute-summary-main{grid-template-columns:minmax(0,1fr)}.compute-device-default{padding-top:0}.model-storage-picker{display:grid;gap:6px;max-width:640px;padding:14px 16px 16px}.model-storage-label{color:#9b9b9b;font-size:12px;white-space:nowrap}.model-storage-control-row{display:grid;grid-template-columns:minmax(0,1fr) 36px;align-items:center;gap:8px}.model-storage-select{width:100%;min-width:0;height:36px;border:1px solid rgba(255,255,255,.08);border-radius:8px;outline:0;appearance:none;background:linear-gradient(45deg,transparent 50%,#9b9b9b 50%) calc(100% - 16px) 50% / 5px 5px no-repeat,linear-gradient(135deg,#9b9b9b 50%,transparent 50%) calc(100% - 11px) 50% / 5px 5px no-repeat,#101010;color:var(--text);padding:0 32px 0 10px;font-size:13px}.model-storage-select:focus{border-color:#06b6d480}.model-storage-add{width:36px;height:36px}.model-storage-dialog{width:min(520px,calc(100vw - 34px))}.model-storage-dialog-note{border:1px solid rgba(143,200,255,.16);border-radius:9px;background:#8fc8ff12;color:#b4cae0;padding:9px 10px;font-size:12px;line-height:1.45}.compute-row{display:flex;align-items:center;justify-content:space-between;gap:18px;padding:13px 16px;border-top:1px solid var(--border)}.compute-row:first-of-type{border-top:0}.compute-row>div{display:grid;gap:4px;min-width:0}.compute-row strong{color:#f1f1f1;font-size:13px;font-weight:570}.compute-row small{overflow-wrap:anywhere;color:#9b9b9b;font-size:12px}.compute-row>span{flex:0 0 auto;color:#b7b7b7;font-size:12px}.compute-diagnostics{border:1px solid var(--border);border-radius:12px;color:#b7b7b7;padding:12px 14px;font-size:12px}.compute-diagnostics summary{color:#dedede;cursor:pointer}.compute-diagnostics ul{margin:10px 0 0;padding-left:18px}.compute-heading-actions{display:flex;align-items:center;gap:8px}.compute-download-row{display:grid;gap:10px;padding:13px 16px;border-top:1px solid var(--border)}.compute-download-row>div{display:grid;gap:4px}.compute-download-row strong{color:#f1f1f1;font-size:13px}.compute-download-row small{overflow-wrap:anywhere;color:#9b9b9b;font-size:12px}.compute-download-row progress{width:100%;height:5px;accent-color:var(--cyan)}@media(max-width:720px){.compute-row{align-items:flex-start;flex-direction:column;gap:7px}}.notification-settings-card{overflow:hidden}.notification-mode-list{display:grid}.notification-mode-option{display:grid;grid-template-columns:18px minmax(0,1fr);align-items:start;gap:11px;min-height:66px;padding:14px 16px;border-bottom:1px solid rgba(255,255,255,.06);background:transparent;cursor:pointer}.notification-mode-option:last-child{border-bottom:0}.notification-mode-option:hover{background:#ffffff09}.notification-mode-option.selected{background:#3aa3ff13}.notification-mode-option input{width:15px;height:15px;margin:2px 0 0;accent-color:#3aa3ff}.notification-mode-option>span,.notification-thread-copy{display:grid;min-width:0;gap:4px}.notification-mode-option strong,.notification-thread-copy strong{color:#f4f4f4;font-size:13px;font-weight:560}.notification-mode-option small,.notification-thread-copy small{color:#9b9b9b;font-size:12px;line-height:1.4}.notification-thread-row{display:grid;grid-template-columns:32px minmax(0,1fr) auto;align-items:center;gap:12px;min-height:66px;padding:12px 16px;border-bottom:1px solid rgba(255,255,255,.06)}.notification-thread-row:last-of-type{border-bottom:0}.notification-thread-icon{display:grid;place-items:center;width:32px;height:32px;border-radius:10px;background:#3aa3ff1c;color:#8fc8ff}.notification-thread-icon.muted{background:#ffffff0f;color:#929292}.notification-settings-error{padding:11px 16px;border-top:1px solid rgba(255,98,98,.2);background:#ff626212;color:#ffb0b0;font-size:12px}@media(max-width:760px){.notification-thread-row{grid-template-columns:32px minmax(0,1fr)}.notification-thread-row>.settings-secondary{grid-column:2;justify-self:start}}.wallet-view{display:grid;gap:18px;width:min(920px,calc(100% - 96px));min-width:0;justify-self:center}.wallet-credit-card{display:grid;gap:28px;width:min(520px,100%);min-height:258px;border:1px solid rgba(255,255,255,.1);border-radius:8px;background:#202322;color:#f7f7f7;padding:20px;box-shadow:0 18px 48px #00000047}.wallet-card-top,.wallet-card-bottom,.wallet-panel-header,.wallet-address-row,.wallet-asset-row{display:flex;align-items:center}.wallet-card-top,.wallet-panel-header,.wallet-address-row,.wallet-asset-row{justify-content:space-between;gap:14px}.wallet-card-brand{display:inline-flex;align-items:center;gap:8px;color:#d7f0df;font-size:13px;font-weight:650}.wallet-card-balance{display:grid;gap:5px}.wallet-card-balance span,.wallet-card-bottom span,.wallet-panel-header span,.wallet-card-address span,.wallet-address-row span,.wallet-asset-row span{color:#9b9b9b;font-size:12px}.wallet-card-balance strong{color:#f9f9f9;font-size:32px;font-weight:600;letter-spacing:0}.wallet-card-bottom{display:grid;grid-template-columns:minmax(0,1fr) minmax(120px,auto);align-items:end;gap:18px}.wallet-card-bottom>div,.wallet-panel-header div,.wallet-asset-row>div:not(.wallet-asset-identity){display:grid;gap:4px;min-width:0}.wallet-address-row>div{display:grid;gap:4px;min-width:0;width:100%}.wallet-card-bottom strong,.wallet-panel-header strong,.wallet-asset-row strong{min-width:0;overflow:hidden;color:#f3f3f3;text-overflow:ellipsis;white-space:nowrap;font-size:14px;font-weight:550}.wallet-card-products{justify-items:end;text-align:right}.wallet-card-products strong{max-width:220px}.wallet-content-grid{display:grid;grid-template-columns:minmax(0,1.15fr) minmax(260px,.85fr);align-items:start;gap:14px}.wallet-side-stack{display:grid;gap:14px;min-width:0}.wallet-panel{min-width:0;overflow:hidden;border:1px solid var(--border);border-radius:8px;background:#181818}.wallet-panel-header{min-height:62px;padding:14px 16px;border-bottom:1px solid var(--border)}.wallet-address-list,.wallet-asset-list{display:grid}.wallet-address-row,.wallet-asset-row{min-height:64px;padding:13px 16px;border-bottom:1px solid rgba(255,255,255,.06)}.wallet-address-row{justify-content:stretch}.wallet-address-row:last-child,.wallet-asset-row:last-child{border-bottom:0}.wallet-card-address{display:grid;gap:6px;margin-top:12px}.wallet-card-address>div{display:flex;align-items:center;gap:6px;min-width:0;max-width:100%}.wallet-card-address code{display:block;min-width:0;flex:0 1 auto;overflow:hidden;color:#e8e8e8;text-overflow:ellipsis;white-space:nowrap;filter:blur(5px);font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;font-size:12px;transition:filter .14s ease;-webkit-user-select:none;user-select:none}.wallet-card-address:hover code,.wallet-card-address:focus-within code{filter:blur(0);-webkit-user-select:text;user-select:text}.wallet-card-address.empty code{color:#777;filter:none;font-family:inherit;-webkit-user-select:auto;user-select:auto}.wallet-address-row code{display:block;min-width:0;flex:1 1 auto;overflow:hidden;color:#e8e8e8;text-overflow:ellipsis;white-space:nowrap;filter:blur(5px);font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;font-size:12px;transition:filter .14s ease;-webkit-user-select:none;user-select:none}.wallet-address-line{display:flex;align-items:center;gap:6px;min-width:0;width:100%}.wallet-address-row:hover code,.wallet-address-row:focus-within code{filter:blur(0);-webkit-user-select:text;user-select:text}.wallet-address-row.empty code{color:#777;filter:none;font-family:inherit;-webkit-user-select:auto;user-select:auto}.wallet-copy-button{display:inline-grid;place-items:center;width:24px;height:24px;flex:0 0 24px;border:0;border-radius:8px;background:#252525;color:#a8a8a8;padding:0}.wallet-copy-button.ghost{background:transparent;color:#c7c7c7}.wallet-copy-button:hover:not(:disabled),.wallet-copy-button:focus-visible{outline:0;background:#303030;color:var(--text)}.wallet-copy-button.ghost:hover:not(:disabled),.wallet-copy-button.ghost:focus-visible{background:#ffffff14}.wallet-copy-button:disabled{opacity:.42}.wallet-asset-row>span{flex:0 0 auto;color:#8ddfa8}.wallet-asset-row.empty{justify-content:flex-start}.wallet-asset-values{display:grid;justify-items:end;gap:4px;min-width:120px;text-align:right}.wallet-asset-values strong{max-width:180px}.wallet-asset-values span{color:#8ddfa8}.wallet-asset-identity{display:inline-flex;align-items:center;gap:10px;min-width:0;flex:1 1 auto;overflow:hidden;white-space:nowrap}.wallet-asset-identity strong{color:#f3f3f3;font-size:14px;font-weight:550;overflow:hidden;text-overflow:ellipsis}.wallet-asset-identity>span:not(.wallet-token-fallback){flex:0 0 auto;color:#9b9b9b;font-size:12px;font-weight:450}.wallet-asset-identity img,.wallet-token-fallback{width:24px;height:24px;flex:0 0 24px;border-radius:999px}.wallet-token-fallback{display:inline-grid;place-items:center;background:#2a2d2c;color:#d7f0df;font-size:11px;font-weight:650}.skills-settings{max-width:980px}.skills-settings-header{display:flex;align-items:flex-start;justify-content:space-between;gap:24px}.skills-settings-header h1{margin-bottom:8px}.skills-settings-header p{max-width:680px;margin:0;color:var(--muted);font-size:13px;line-height:1.55}.github-extensions-heading{align-items:center}.github-extensions-heading-actions,.github-extension-row-actions{display:flex;align-items:center;gap:8px}.github-extension-add{display:grid;grid-template-columns:minmax(220px,1fr) minmax(180px,.75fr) minmax(150px,.55fr) auto;align-items:end;gap:12px;padding:16px;border-bottom:1px solid rgba(255,255,255,.06)}.github-extension-add-copy,.github-extension-add label,.github-extension-preview>div{display:grid;gap:5px}.github-extension-add-copy strong,.github-extension-preview strong{font-size:13px}.github-extension-add-copy span,.github-extension-add label>span,.github-extension-preview span{color:var(--muted);font-size:11px;line-height:1.45}.github-extension-add input{width:100%;height:34px;border:1px solid rgba(255,255,255,.1);border-radius:9px;background:#0000002e;color:var(--text);padding:0 10px;outline:none}.github-extension-add input:focus{border-color:#22d3ee73}.github-extension-message{padding:10px 16px;border-bottom:1px solid rgba(255,255,255,.06);font-size:12px}.github-extension-message.error{color:#fca5a5;background:#f871710f}.github-extension-preview{display:grid;grid-template-columns:minmax(180px,.7fr) minmax(240px,1fr) auto;align-items:center;gap:16px;padding:14px 16px;border-bottom:1px solid rgba(255,255,255,.06);background:#22d3ee09}.github-extension-preview-skills{display:flex!important;flex-direction:row;flex-wrap:wrap;gap:6px!important}.github-extension-preview-skills>span{border-radius:999px;background:#ffffff0f;padding:4px 7px}.github-extension-row{display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:center;gap:12px;min-height:76px;border-bottom:1px solid rgba(255,255,255,.06)}.github-extension-row:last-child{border-bottom:0}.github-extension-open{display:grid;grid-template-columns:34px minmax(220px,1.2fr) minmax(180px,.8fr) auto 16px;align-items:center;gap:12px;min-width:0;min-height:76px;border:0;background:transparent;color:var(--text);padding:12px 0 12px 16px;text-align:left}.github-extension-open:hover,.github-extension-open:focus-visible{background:#ffffff0b}.github-extension-open:focus-visible{outline:1px solid rgba(34,211,238,.46);outline-offset:-1px}.github-extension-open:disabled{cursor:default;opacity:.64}.github-extension-row-actions{padding-right:16px}.github-extension-row-actions .danger:hover:not(:disabled){color:#fca5a5;background:#f8717117}.native-skills-list{border:1px solid rgba(255,255,255,.08);border-radius:14px;background:#ffffff05}.personal-skill-row{cursor:default}.personal-skill-row:hover{background:transparent}.skills-settings-empty{padding:18px 16px;color:var(--muted);font-size:12px}.native-skill-row{display:grid;grid-template-columns:34px minmax(220px,1.2fr) minmax(180px,.8fr) auto 16px;align-items:center;gap:12px;width:100%;min-height:72px;border:0;border-bottom:1px solid rgba(255,255,255,.06);background:transparent;color:var(--text);padding:12px 16px;text-align:left}.native-skill-row:last-child{border-bottom:0}.native-skill-row:hover,.native-skill-row:focus-visible{background:#ffffff0b}.native-skill-row:focus-visible{outline:1px solid rgba(34,211,238,.46);outline-offset:-1px}.native-skill-icon{display:grid;place-items:center;width:32px;height:32px;border-radius:9px;background:#22d3ee17;color:#67e8f9}.native-skill-identity,.native-skill-provider{display:grid;gap:4px;min-width:0}.native-skill-identity strong,.native-skill-provider strong,.native-skill-identity span,.native-skill-provider span{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.native-skill-identity strong{font-size:13px;font-weight:620}.native-skill-identity span,.native-skill-provider span{color:var(--muted);font-size:11px}.native-skill-provider strong{color:#d8d8d8;font-size:12px;font-weight:560}.native-skill-provider span{font-family:var(--font-mono, ui-monospace, SFMono-Regular, Menlo, monospace)}.native-skill-status{border-radius:999px;background:#4ade8017;color:#86efac;padding:5px 8px;font-size:10px;font-weight:650;white-space:nowrap}.native-skill-status.invalid{background:#f8717117;color:#fca5a5}.native-skill-row>svg{color:#737373}@media(max-width:760px){.skills-settings-header{flex-direction:column;gap:12px}.native-skill-row{grid-template-columns:34px minmax(0,1fr) 16px}.github-extension-add{grid-template-columns:1fr;align-items:stretch}.github-extension-preview{grid-template-columns:1fr}.github-extension-row{grid-template-columns:minmax(0,1fr) auto}.github-extension-open{grid-template-columns:34px minmax(0,1fr) 16px}.github-extension-open .native-skill-provider,.github-extension-open .native-skill-status,.native-skill-provider,.native-skill-status{display:none}}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./UsageSettingsSection-r3CqRm6Q.js","./index-DQalqxbw.js","./index-BcZetaeD.css","./activity-Dp5V58om.js","./index-DYxF_d9i.js","./UsageSettingsSection-O8VK0qBL.css"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{d as ue,j as e,r as i,u as Ss,X as Le,e as qs,o as Vs,f as Ks,g as Hs,h as Js,p as Ys,D as Ce,E as Zs,k as Ue,l as Xs,m as Qs,n as T,q as et,s as Ve,t as ws,v as Cs,w as st,x as tt,L as nt,y as at,z as Ze,A as ke,G as ye,H as Oe,I as lt,J as it,K as rt,N as ot,O as te,Q as ct,R as Ke,T as ks,U as He,V as dt,M as ut,W as ht,Y as mt,Z as Je,_ as gt,$ as pt,a0 as ts,a as ft,a1 as ns,a2 as Ps,a3 as xt,a4 as vt,a5 as jt,a6 as bt,a7 as ce,a8 as as,a9 as Te,aa as Ie,ab as yt,ac as Nt,ad as St,ae as wt,af as Ct,ag as kt}from"./index-DQalqxbw.js";import{R as Pt,P as Rt}from"./ProfileSettingsSection-Bo7dybgW.js";import{R as re}from"./refresh-cw-CyermMsy.js";/* empty css */import{S as Xe}from"./save-Bij3cc3Q.js";import{C as It}from"./chevron-up-BWx8gGab.js";import{P as Mt}from"./play-2NDQ4-7K.js";import{R as Dt}from"./rotate-cw-DJ-zYG9E.js";import{B as Rs,W as At,S as ls}from"./wifi-off-BnVFBG28.js";import{C as Is}from"./credit-card-Bjg0Zaw5.js";import{M as Et}from"./monitor-Ba2FFblh.js";import{r as Ot}from"./index-DYxF_d9i.js";import{C as Ms}from"./copy-BjWvaXLC.js";import"./git-commit-horizontal-C8UFKlXy.js";const Tt=[["rect",{width:"8",height:"4",x:"8",y:"2",rx:"1",ry:"1",key:"tgr4d6"}],["path",{d:"M8 4H6a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-2",key:"4jdomd"}],["path",{d:"M16 4h2a2 2 0 0 1 2 2v4",key:"3hqy98"}],["path",{d:"M21 14H11",key:"1bme5i"}],["path",{d:"m15 10-4 4 4 4",key:"5dvupr"}]],Lt=ue("clipboard-copy",Tt);const Ut=[["path",{d:"m18 16 4-4-4-4",key:"1inbqp"}],["path",{d:"m6 8-4 4 4 4",key:"15zrgr"}],["path",{d:"m14.5 4-5 16",key:"e7oirm"}]],$t=ue("code-xml",Ut);const zt=[["line",{x1:"22",x2:"2",y1:"12",y2:"12",key:"1y58io"}],["path",{d:"M5.45 5.11 2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z",key:"oot6mr"}],["line",{x1:"6",x2:"6.01",y1:"16",y2:"16",key:"sgf278"}],["line",{x1:"10",x2:"10.01",y1:"16",y2:"16",key:"1l4acy"}]],Bt=ue("hard-drive",zt);const _t=[["path",{d:"M2.586 17.414A2 2 0 0 0 2 18.828V21a1 1 0 0 0 1 1h3a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h1a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h.172a2 2 0 0 0 1.414-.586l.814-.814a6.5 6.5 0 1 0-4-4z",key:"1s6t7t"}],["circle",{cx:"16.5",cy:"7.5",r:".5",fill:"currentColor",key:"w0ekpg"}]],ie=ue("key-round",_t);const Ft=[["path",{d:"M12 2v10",key:"mnfbl"}],["path",{d:"M18.4 6.6a9 9 0 1 1-12.77.04",key:"obofu9"}]],Gt=ue("power",Ft);const Wt=[["path",{d:"M4.9 16.1C1 12.2 1 5.8 4.9 1.9",key:"s0qx1y"}],["path",{d:"M7.8 4.7a6.14 6.14 0 0 0-.8 7.5",key:"1idnkw"}],["circle",{cx:"12",cy:"9",r:"2",key:"1092wv"}],["path",{d:"M16.2 4.8c2 2 2.26 5.11.8 7.47",key:"ojru2q"}],["path",{d:"M19.1 1.9a9.96 9.96 0 0 1 0 14.1",key:"rhi7fg"}],["path",{d:"M9.5 18h5",key:"mfy3pd"}],["path",{d:"m8 22 4-11 4 11",key:"25yftu"}]],Ds=ue("radio-tower",Wt);const qt=[["path",{d:"M10 5H3",key:"1qgfaw"}],["path",{d:"M12 19H3",key:"yhmn1j"}],["path",{d:"M14 3v4",key:"1sua03"}],["path",{d:"M16 17v4",key:"1q0r14"}],["path",{d:"M21 12h-9",key:"1o4lsq"}],["path",{d:"M21 19h-5",key:"1rlt1p"}],["path",{d:"M21 5h-7",key:"1oszz2"}],["path",{d:"M8 10v4",key:"tgpxqk"}],["path",{d:"M8 12H3",key:"a7s4jb"}]],As=ue("sliders-horizontal",qt);const Vt=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["circle",{cx:"12",cy:"10",r:"3",key:"ilqhr7"}],["path",{d:"M7 20.662V19a2 2 0 0 1 2-2h6a2 2 0 0 1 2 2v1.662",key:"154egf"}]],Kt=ue("circle-user",Vt);function is({handle:s,image:t}){const a=s?.trim().slice(0,1).toUpperCase()||"+";return e.jsx("div",{className:"account-avatar",children:t?e.jsx("img",{src:t,alt:""}):e.jsx("span",{children:a})})}function Ae({state:s,label:t}){return e.jsx("span",{className:`account-state ${s}`,children:t??s.replace("_"," ")})}function Ht(s,t){return s==="connect"?{handle:void 0,currentBaseUrl:null}:{handle:t?.handle,currentBaseUrl:t?.baseUrl??null}}function rs(s,t){const a=t.trim().replace(/\/+$/,"");if(!a)throw new Error(`${s} is required.`);try{const n=new URL(a);if(n.protocol!=="http:"&&n.protocol!=="https:")throw new Error("unsupported protocol")}catch{throw new Error(`${s} must be an absolute http or https URL.`)}return a}function os({account:s,busy:t,initialApiKey:a="",mode:n="update",onClose:l,onSave:r}){const h=i.useId(),o=n==="connect",[x,y]=i.useState(a),[j,b]=i.useState(s?.baseUrl??""),[p,d]=i.useState(s?.apiBaseUrl??""),[c,m]=i.useState(null),[N,f]=i.useState(null);Ss(N),i.useEffect(()=>{y(a),b(s?.baseUrl??""),d(s?.apiBaseUrl??""),m(null),f(null)},[s?.apiBaseUrl,s?.baseUrl,s?.handle,a]);async function u(C){C.preventDefault(),m(null),f(null);const k=x.trim();if(o&&!k){m("API key is required.");return}let w,P;try{w=rs("Base URL",j),P=rs("API base URL",p)}catch(D){m(D instanceof Error?D.message:String(D));return}try{const D=Ht(n,s);await r({...D,baseUrl:w,apiBaseUrl:P,apiKey:o?k:void 0,environment:s?.environment??null})}catch(D){f(D instanceof Error?D.message:String(D))}}return e.jsx("div",{className:"git-dialog-backdrop account-endpoint-dialog-backdrop",role:"presentation",onMouseDown:C=>{C.target===C.currentTarget&&!t&&l()},children:e.jsxs("form",{className:"git-dialog account-endpoint-dialog",role:"dialog","aria-modal":"true","aria-labelledby":h,onSubmit:C=>{u(C)},children:[e.jsx("button",{className:"git-dialog-close",disabled:t,type:"button",title:"Close","aria-label":"Close",onClick:l,children:e.jsx(Le,{size:16})}),e.jsx("div",{className:"git-dialog-icon",children:o?e.jsx(ie,{size:18}):e.jsx(As,{size:18})}),e.jsx("h2",{id:h,children:o?"Environment account":"Environment endpoints"}),o?e.jsxs("label",{className:"git-dialog-field",children:[e.jsx("span",{children:"API key"}),e.jsx("input",{autoFocus:!0,disabled:t,placeholder:"opk_...",type:"password",value:x,onChange:C=>y(C.target.value)})]}):null,e.jsxs("label",{className:"git-dialog-field",children:[e.jsx("span",{children:"Base URL"}),e.jsx("input",{autoFocus:!o,disabled:t,inputMode:"url",value:j,onChange:C=>b(C.target.value)})]}),e.jsxs("label",{className:"git-dialog-field",children:[e.jsx("span",{children:"API base URL"}),e.jsx("input",{disabled:t,inputMode:"url",value:p,onChange:C=>d(C.target.value)})]}),c?e.jsx("div",{className:"profile-dialog-warning",children:c}):null,e.jsxs("div",{className:"git-dialog-footer",children:[e.jsx("button",{className:"git-dialog-secondary",disabled:t,type:"button",onClick:l,children:"Cancel"}),e.jsxs("button",{className:"git-dialog-primary",disabled:t,type:"submit",children:[e.jsx(Xe,{size:14}),e.jsx("span",{children:t?"Saving":o?"Connect account":"Update account"})]})]})]})})}const Ge="https://openpond.ai/settings/api-keys",Jt="Changing the active OpenPond account rechecks cloud projects, hosted agents, default team, and profile sync for that account. Local projects stay on this machine; projects uploaded from another account will need to be synced again for this account.";function Yt({payload:s,connection:t,apiKey:a,saving:n,refreshingAccounts:l,setApiKey:r,saveAccount:h,saveEnvironmentAccount:o,refreshAccounts:x,switchAccount:y,onPayload:j,onPreferences:b,onError:p,onToast:d}){const c=s?.account,m=c?.state??"loading",N=m==="signed_in",f=m==="signed_out",u=m==="auth_error",C=c?.email?.trim()||null,k=c?.accounts??[],[w,P]=i.useState([]),[,D]=i.useState(!1),[F,g]=i.useState(null),[S,v]=i.useState(null),[R,A]=i.useState(null),[L,G]=i.useState(null),[q,K]=i.useState(!1),[M,U]=i.useState(!1),[H,Q]=i.useState(null),{confirmAction:ne,confirmDialog:J,resolveConfirmDialog:V}=qs(),E=k.find(I=>I.isActive)??k[0]??null,B=s?.preferences.defaultTeamId?.trim()||null,ee=R??B,le=Vs(c),ge=s?.accountMeta.asOf??"",pe=Me(c?.environment,E?.environment),he=N?Me(E?.displayLabel,E?.handle,c?.label,c?.activeProfile?.handle,"Signed in"):u?"Account needs attention":f?"No account connected":"Loading account",fe=N?C??cs(pe):u?c?.error??"Reconnect this account to restore OpenPond cloud features.":f?"Cloud projects, hosted agents, wallet, and team defaults are disabled until you sign in.":"Checking account status.",xe=k.length>0,ve=f?"Sign in to OpenPond":u?"Reconnect account":"Add or update account",Y=f?"Paste an OpenPond API key to connect this desktop app.":u?"Paste a fresh OpenPond API key for the active account.":"Saved to OpenPond CLI config.",je=f?"Sign in":u?"Reconnect":"Save account",z=i.useMemo(()=>w.filter(I=>I.status==="active"),[w]),$e=(i.useMemo(()=>ee?z.find(I=>I.teamId===ee)??null:null,[z,ee])??Ks(z))?.teamId??"",Ne=i.useMemo(()=>z.map(I=>({value:I.teamId,label:Me(I.displayName,I.name,I.slug,"Team"),description:Hs(I.role)})),[z]),ze=$e||Ne[0]?.value||"",Be=Ne.length>0,_e=!t||!!S||!!F||z.length===0,Pe=L?We(L):null,Re=!!(Pe&&H===Pe),O=Zt(E?.baseUrl??c?.baseUrl),$=N||u;i.useEffect(()=>{if(!t||!le){P([]),g(null),D(!1);return}let I=!1;const se=Js(le);return se?(P(se),D(!1)):(P([]),D(!0)),g(null),Ys({accountKey:le,force:!!ge,fetchOrganizations:async()=>(await T.organizations(t)).organizations.map(et).filter(X=>!!X).filter(X=>X.status==="active")}).then(W=>{I||P(W)}).catch(W=>{I||(se||P([]),g(W instanceof Error?W.message:String(W)))}).finally(()=>{I||D(!1)}),()=>{I=!0}},[ge,t,le]),i.useEffect(()=>{R&&B===R&&A(null)},[B,R]);async function _(I,se={notify:!0}){const W=z.find(X=>X.teamId===I)??null;if(!(!t||!W||S||(R??B)===W.teamId)){A(W.teamId),v(W.teamId),p(null),Qs({teamId:W.teamId,accountKey:le,force:!0,fetchAgents:async X=>(await T.listSandboxAgents(t,{teamId:X})).agents}).catch(()=>{});try{b(await T.savePreferences(t,{defaultTeamId:W.teamId})),se.notify&&d?.("Default team updated","success")}catch(X){A(null),p(X instanceof Error?X.message:String(X))}finally{v(null)}}}async function ae(I="Continue"){return $?ne({title:"Change active OpenPond account?",body:Jt,confirmLabel:I,cancelLabel:"Cancel"}):!0}async function be(I){if(I.preventDefault(),q){U(!0);return}await ae(je)&&await h(I)}async function _s(I){await ae("Save account")&&(await o({apiKey:I.apiKey??"",handle:I.handle,baseUrl:I.baseUrl,apiBaseUrl:I.apiBaseUrl,environment:ds(I.environment)}),U(!1),K(!1))}async function Fs(I){if(!t||!L)throw new Error("OpenPond server connection is not ready.");if(L.isActive&&!await ae("Save endpoints"))return;const se=We(L);Q(se),p(null);try{const W=await T.updateOpenPondAccountConfig(t,{handle:I.handle??L.handle,currentBaseUrl:I.currentBaseUrl,baseUrl:I.baseUrl,apiBaseUrl:I.apiBaseUrl,chatApiBaseUrl:null,environment:ds(I.environment),setActive:L.isActive});j(W),d?.("Account endpoints updated","success"),G(null)}catch(W){throw p(W instanceof Error?W.message:String(W)),W}finally{Q(null)}}async function Gs(I){const se=I.handle?.trim()||"";se&&await ae("Switch account")&&await y(se,I.baseUrl)}return e.jsxs("section",{className:"account-settings",children:[e.jsxs("div",{className:"account-settings-title",children:[e.jsx("h1",{children:"Account"}),e.jsx("button",{className:"settings-icon-button ghost",disabled:!t||n||l,title:"Refresh accounts and team data","aria-label":"Refresh accounts and team data",type:"button",onClick:()=>{x()},children:e.jsx(re,{size:15,className:l?"settings-spin":void 0})})]}),e.jsxs("div",{className:"account-summary",children:[e.jsxs("div",{className:"account-summary-main",children:[e.jsx(is,{handle:he,image:N?c?.avatarUrl??E?.avatarUrl??null:null}),e.jsxs("div",{children:[e.jsx("span",{children:"Active account"}),e.jsx("strong",{children:he}),e.jsxs("div",{className:"account-summary-meta",children:[e.jsx("small",{className:N&&C?"private-account-email":N?void 0:"account-summary-copy",tabIndex:N&&C?0:void 0,children:fe}),N&&Be?e.jsx(Ce,{className:"account-team-dropdown",compact:!0,disabled:_e,label:"Default team",options:Ne,value:ze,onChange:I=>{_(I)}}):null]})]})]}),e.jsx("div",{className:"account-summary-actions",children:e.jsx(Ae,{state:m,label:f?"not signed in":void 0})})]}),e.jsxs("form",{className:"account-login-form",onSubmit:I=>{be(I)},children:[f||u?e.jsxs("div",{className:"account-signin-panel",children:[e.jsx(ie,{size:18}),e.jsxs("div",{children:[e.jsx("strong",{children:f?"Connect this app to your OpenPond account":"Refresh the saved OpenPond credential"}),e.jsx("span",{children:f?"Local projects stay available without sign-in; cloud agents, wallet, teams, and hosted runs need an account.":"The saved credential could not authenticate. Replace it to resume cloud features."})]}),e.jsxs("a",{className:"settings-secondary account-api-key-link",href:O,rel:"noreferrer",target:"_blank",children:[e.jsx(Zs,{size:14}),e.jsx("span",{children:"Create key"})]})]}):null,e.jsxs("div",{className:"account-list-heading",children:[e.jsx("span",{children:ve}),e.jsx("small",{children:Y})]}),e.jsxs("div",{className:"account-form-grid",children:[e.jsxs("label",{children:[e.jsx("span",{children:"API key"}),e.jsx("input",{value:a,onChange:I=>r(I.target.value),placeholder:"opk_...",type:"password"})]}),e.jsxs("div",{className:"account-environment-field",children:[e.jsx("span",{children:"Environment"}),e.jsxs("button",{className:`account-env-toggle account-form-env-toggle ${q?"active":""}`,disabled:n,type:"button","aria-pressed":q,onClick:()=>K(I=>!I),children:[e.jsx("span",{className:"account-env-toggle-switch","aria-hidden":"true"}),e.jsx("span",{children:"Environment"})]})]})]}),e.jsxs("button",{className:"settings-primary",disabled:n||!q&&!a.trim(),children:[e.jsx(Ue,{size:15}),e.jsx("span",{children:n?"Saving":je})]})]}),xe?e.jsxs("div",{className:"account-list",children:[e.jsxs("div",{className:"account-list-heading",children:[e.jsx("span",{children:"OpenPond accounts"}),e.jsxs("small",{children:[k.length," account",k.length===1?"":"s"]})]}),k.map(I=>{const se=I.handle?.trim()||"",W=Me(I.displayLabel,I.handle,"Unknown account"),X=I.email?.trim()||null,Fe=Xt(I.environment),Ws=We(I);return e.jsxs("div",{className:"account-row",children:[e.jsx(is,{handle:W,image:I.avatarUrl??null}),e.jsxs("div",{className:"account-details",children:[e.jsx("strong",{children:W}),X?e.jsx("span",{className:"private-account-email",tabIndex:0,children:X}):null,e.jsx("span",{children:cs(I.environment??"production")})]}),e.jsxs("div",{className:"account-row-actions",children:[e.jsxs("button",{className:`account-env-toggle ${Fe?"active":""}`,disabled:!t||n||!!H||!se,type:"button","aria-pressed":Fe,title:"Configure environment endpoints",onClick:()=>G(I),children:[e.jsx("span",{className:"account-env-toggle-switch","aria-hidden":"true"}),e.jsx("span",{children:"Environment"})]}),I.isActive?e.jsx("span",{className:"active-pill",children:"Active"}):e.jsx("button",{className:"inline-action",disabled:n||!se,type:"button",onClick:()=>{Gs(I)},children:"Use"})]}),e.jsx(Ae,{state:I.authHealth})]},Ws)})]}):null,c?.products&&c.products.length>0&&e.jsxs("div",{className:"account-list",children:[e.jsxs("div",{className:"account-list-heading",children:[e.jsx("span",{children:"Products"}),e.jsxs("small",{children:[c.products.length," active"]})]}),c.products.map(I=>e.jsxs("div",{className:"product-row",children:[e.jsxs("div",{children:[e.jsx("strong",{children:I.name}),e.jsx("span",{children:I.type})]}),e.jsx(Ae,{state:I.status})]},I.id))]}),e.jsxs("div",{className:"settings-footnote",children:[e.jsx("span",{children:s?.server.runtimeVersion??"Runtime loading"}),e.jsx("strong",{children:t?.serverUrl??"loading"})]}),s?.appsMeta.lastRefreshError&&e.jsxs("div",{className:"settings-footnote warning",children:[e.jsx("span",{children:"Last refresh error"}),e.jsx("strong",{children:s.appsMeta.lastRefreshError})]}),L?e.jsx(os,{account:L,busy:Re,onClose:()=>{Re||G(null)},onSave:Fs}):null,M?e.jsx(os,{account:E,busy:n,initialApiKey:a,mode:"connect",onClose:()=>{n||U(!1)},onSave:_s}):null,e.jsx(Xs,{state:J,onResolve:V})]})}function We(s){return`${s.handle.trim().toLowerCase()}|${s.baseUrl??"default"}`}function Me(...s){for(const t of s){const a=t?.trim();if(a)return a}return""}function cs(s){const t=s.trim().toLowerCase();return!t||t==="production"?"Production":"Environment"}function Zt(s){const t=s?.trim().replace(/\/+$/,"");if(!t)return Ge;try{const a=new URL(t);return a.protocol!=="http:"&&a.protocol!=="https:"?Ge:`${t}/settings/api-keys`}catch{return Ge}}function ds(s){const t=s?.trim();return!t||t.toLowerCase()==="production"?"custom":t}function Xt(s){const t=s?.trim().toLowerCase();return!!(t&&t!=="production")}function Qt({advancedWorkspaceControls:s,defaultBranchPrefix:t,defaultNewProjectDirectory:a,preferences:n,saving:l,chooseDefaultProjectDirectory:r,saveDefaults:h,setAdvancedWorkspaceControls:o,setDefaultBranchPrefix:x,setDefaultNewProjectDirectory:y}){const j=Ve(t)===n.defaultBranchPrefix&&a.trim()===n.defaultNewProjectDirectory&&s===n.advancedWorkspaceControls;return e.jsxs("section",{className:"account-settings",children:[e.jsx("h1",{children:"Defaults"}),e.jsxs("form",{className:"provider-settings-form",onSubmit:b=>{h(b)},children:[e.jsxs("label",{className:"settings-check-row",children:[e.jsx("input",{type:"checkbox",checked:s,disabled:l,onChange:b=>o(b.target.checked)}),e.jsxs("span",{children:[e.jsx("strong",{children:"Show advanced Git controls"}),e.jsx("small",{children:"Show branch, commit, and push controls for local project workflows."})]})]}),e.jsxs("div",{className:"account-list-heading",children:[e.jsx("span",{children:"Git branches"}),e.jsx("small",{children:"Used for advanced and non-managed branch creation"})]}),e.jsx("div",{className:"provider-settings-grid single",children:e.jsxs("label",{className:"settings-select-field",children:[e.jsx("span",{children:"Branch prefix"}),e.jsx("input",{value:t,disabled:l,placeholder:"feat/",onChange:b=>x(b.target.value)})]})}),e.jsxs("div",{className:"account-list-heading",children:[e.jsx("span",{children:"Projects"}),e.jsx("small",{children:"Used when starting a new local project from scratch"})]}),e.jsxs("div",{className:"settings-path-row",children:[e.jsxs("label",{className:"settings-select-field",children:[e.jsx("span",{children:"New project directory"}),e.jsx("input",{value:a,disabled:l,placeholder:"~/Documents/OpenPond Projects",onChange:b=>y(b.target.value)})]}),e.jsxs("button",{type:"button",className:"settings-secondary",disabled:l,onClick:()=>{r()},children:[e.jsx(ws,{size:14}),e.jsx("span",{children:"Browse"})]})]}),e.jsx("button",{className:"settings-primary",disabled:l||j,children:e.jsx("span",{children:l?"Saving":"Save defaults"})})]}),e.jsxs("div",{className:"settings-footnote",children:[e.jsx("span",{children:"Initial branch name"}),e.jsxs("strong",{children:[Ve(t),"example-project"]})]}),e.jsxs("div",{className:"settings-footnote",children:[e.jsx("span",{children:"New projects"}),e.jsx("strong",{children:a||n.defaultNewProjectDirectory})]})]})}function en({diagnostics:s,diagnosticsAvailable:t,diagnosticsBusy:a,diagnosticsStatus:n,logDir:l,logLineLimit:r,logLines:h,logViewBusy:o,logViewSummary:x,logViewportRef:y,tailLogs:j,copyRecentLogs:b,exportDiagnosticsBundle:p,loadOlderLogs:d,openLogsFolder:c,refreshLogView:m,toggleTailLogs:N}){const f=s.filter(C=>C.name==="diagnostic"&&C.status==="failed").slice().reverse().map(sn),u=typeof window>"u"?void 0:window.openpond;return e.jsxs("section",{className:"account-settings",children:[e.jsx("h1",{children:"Diagnostics"}),e.jsxs("div",{className:"diagnostics-log-panel",children:[e.jsxs("div",{className:"account-list-heading",children:[e.jsx("span",{children:"Recent errors"}),e.jsxs("small",{children:[f.length," saved"]})]}),e.jsx("div",{className:"diagnostics-error-list",role:"list",children:f.length===0?e.jsx("div",{className:"diagnostics-error-empty",children:"No saved errors"}):f.map(C=>e.jsxs("article",{className:"diagnostics-error-entry",role:"listitem",children:[e.jsx(Cs,{size:15}),e.jsxs("div",{className:"diagnostics-error-body",children:[e.jsxs("div",{className:"diagnostics-error-title",children:[e.jsx("strong",{children:C.message}),e.jsx("time",{dateTime:C.timestamp,children:C.timeLabel})]}),e.jsxs("div",{className:"diagnostics-error-meta",children:[e.jsx("span",{children:C.surface}),C.status?e.jsx("span",{children:C.status}):null,C.sequence?e.jsxs("span",{children:["#",C.sequence]}):null]}),C.detail?e.jsxs("details",{className:"diagnostics-error-detail",children:[e.jsx("summary",{children:"Details"}),e.jsx("pre",{children:C.detail})]}):null]})]},C.id))})]}),e.jsxs("div",{className:"account-list",children:[e.jsxs("div",{className:"account-list-heading",children:[e.jsx("span",{children:"Logs"}),e.jsx("small",{children:t?"Desktop":"Unavailable"})]}),e.jsxs("div",{className:"product-row",children:[e.jsxs("div",{children:[e.jsx("strong",{children:"Logs folder"}),e.jsx("span",{children:"Desktop and server logs"})]}),e.jsxs("button",{type:"button",className:"settings-secondary",disabled:a!==null||!u?.openLogsFolder,onClick:()=>{c()},children:[e.jsx(ws,{size:15}),e.jsx("span",{children:a==="logs"?"Opening":"Open"})]})]}),e.jsxs("div",{className:"product-row",children:[e.jsxs("div",{children:[e.jsx("strong",{children:"Diagnostics export"}),e.jsx("span",{children:"Support folder with diagnostics.txt"})]}),e.jsxs("button",{type:"button",className:"settings-secondary",disabled:a!==null||!u?.exportDiagnostics,onClick:()=>{p()},children:[e.jsx(st,{size:15}),e.jsx("span",{children:a==="export"?"Exporting":"Export"})]})]}),e.jsxs("div",{className:"product-row",children:[e.jsxs("div",{children:[e.jsx("strong",{children:"Recent logs"}),e.jsx("span",{children:"Last 1000 lines to clipboard"})]}),e.jsxs("button",{type:"button",className:"settings-secondary",disabled:a!==null||!u?.copyRecentLogs,onClick:()=>{b()},children:[e.jsx(Lt,{size:15}),e.jsx("span",{children:a==="copy"?"Copying":"Copy"})]})]})]}),e.jsxs("div",{className:"diagnostics-log-panel",children:[e.jsxs("div",{className:"account-list-heading",children:[e.jsx("span",{children:"Log view"}),e.jsxs("div",{className:"settings-heading-actions diagnostics-log-actions",children:[e.jsx("small",{children:x}),e.jsx("button",{type:"button",className:`settings-icon-button ${j?"active":""}`,title:j?"Pause tail":"Tail logs","aria-label":j?"Pause tail":"Tail logs",disabled:!u?.readRecentLogs,onClick:N,children:j?e.jsx(tt,{size:15}):e.jsx(Mt,{size:15})}),e.jsx("button",{type:"button",className:"settings-icon-button",title:"Refresh logs","aria-label":"Refresh logs",disabled:o!==null||!u?.readRecentLogs,onClick:()=>{m(r,"refresh")},children:e.jsx(re,{size:15})}),e.jsxs("button",{type:"button",className:"settings-secondary",disabled:o!==null||!u?.readRecentLogs,onClick:d,children:[e.jsx(It,{size:15}),e.jsx("span",{children:o==="older"?"Loading":"Older"})]})]})]}),e.jsx("div",{ref:y,className:"diagnostics-log-viewer",role:"log","aria-live":j?"polite":"off",children:h.length===0?e.jsx("div",{className:"diagnostics-log-empty",children:o?"Loading logs":"No log lines"}):h.map((C,k)=>e.jsxs("div",{className:"diagnostics-log-entry",children:[e.jsx("span",{className:"diagnostics-log-source",children:C.file}),e.jsx("code",{children:C.line})]},`${C.file}:${C.timestamp}:${C.index}:${k}`))}),l&&e.jsxs("div",{className:"diagnostics-log-dir",children:[e.jsx("span",{children:"Source"}),e.jsx("strong",{children:l})]})]}),n&&e.jsxs("div",{className:`settings-footnote ${n.warning?"warning":""}`,children:[e.jsx("span",{children:n.label}),e.jsx("strong",{children:n.value})]})]})}function sn(s){const t=us(s.data),a=us(t.context),l=de(t.stack)??de(t.detail)??de(a.detail)??null;return{id:s.id,timestamp:s.timestamp,timeLabel:nn(s.timestamp),message:tn(s,t),surface:de(t.surface)??s.source??"diagnostic",status:s.status??null,sequence:s.sequence??null,detail:l}}function tn(s,t){return de(s.error)??de(s.output)??de(t.message)??de(t.error)??"Diagnostic event"}function nn(s){const t=new Date(s);return Number.isNaN(t.getTime())?s:t.toLocaleString([],{month:"short",day:"numeric",hour:"numeric",minute:"2-digit"})}function us(s){return s&&typeof s=="object"&&!Array.isArray(s)?s:{}}function de(s){return typeof s=="string"&&s.trim()?s.trim():null}const hs=[{id:"typescript",label:"TypeScript",placeholder:"typescript-language-server"},{id:"python",label:"Python",placeholder:"pyright-langserver"},{id:"rust",label:"Rust",placeholder:"rust-analyzer"}];function an({editorPreferences:s,lspStatus:t,preferences:a,restarting:n,saving:l,statusLoading:r,refreshLspStatus:h,restartLanguageServers:o,saveEditorSettings:x,setEditorPreferences:y,setLanguageCustomCommand:j,setLanguageMode:b}){const p=JSON.stringify(s)!==JSON.stringify(a.editor),d=new Map(t?.languages.map(c=>[c.language,c])??[]);return e.jsxs("section",{className:"account-settings",children:[e.jsx("h1",{children:"Editor"}),e.jsxs("form",{className:"provider-settings-form editor-settings-form",onSubmit:c=>{x(c)},children:[e.jsxs("div",{className:"account-list-heading",children:[e.jsx("span",{children:"Language servers"}),e.jsx("small",{children:"Local tools"})]}),e.jsx("div",{className:"provider-settings-grid single",children:e.jsxs("div",{className:"settings-select-field",children:[e.jsx("span",{children:"Language servers"}),e.jsx(Ce,{value:s.languageServers,disabled:l,label:"Language servers",options:nt,onChange:c=>y(m=>({...m,languageServers:c}))})]})}),e.jsxs("label",{className:"settings-check-row",children:[e.jsx("input",{type:"checkbox",checked:s.diagnosticsWhileEditing,disabled:l||s.languageServers==="off",onChange:c=>y(m=>({...m,diagnosticsWhileEditing:c.target.checked}))}),e.jsxs("span",{children:[e.jsx("strong",{children:"Diagnostics while editing"}),e.jsx("small",{children:"Update Monaco markers as the local buffer changes."})]})]}),e.jsxs("label",{className:"settings-check-row",children:[e.jsx("input",{type:"checkbox",checked:s.checkOnSave,disabled:l||s.languageServers==="off",onChange:c=>y(m=>({...m,checkOnSave:c.target.checked}))}),e.jsxs("span",{children:[e.jsx("strong",{children:"Check on save"}),e.jsx("small",{children:"Refresh diagnostics after writing a file."})]})]}),e.jsxs("div",{className:"account-list-heading",children:[e.jsx("span",{children:"Languages"}),e.jsx("small",{children:"Auto, disabled, or custom executable"})]}),e.jsx("div",{className:"lsp-language-list",children:hs.map(c=>{const m=s.languages[c.id];return e.jsxs("div",{className:"lsp-language-row",children:[e.jsxs("div",{className:"lsp-language-label",children:[e.jsx("strong",{children:c.label}),e.jsx("span",{children:ms(d.get(c.id),r)})]}),e.jsxs("div",{className:"settings-select-field",children:[e.jsx("span",{children:"Mode"}),e.jsx(Ce,{value:m.mode,disabled:l||s.languageServers==="off",label:`${c.label} language server mode`,options:at,onChange:N=>b(c.id,N)})]}),e.jsxs("label",{className:"settings-select-field",children:[e.jsx("span",{children:"Custom executable"}),e.jsx("input",{value:m.customCommand,disabled:l||s.languageServers==="off"||m.mode!=="custom",placeholder:c.placeholder,onChange:N=>j(c.id,N.target.value)})]})]},c.id)})}),e.jsx("button",{className:"settings-primary",disabled:l||!p,children:e.jsx("span",{children:l?"Saving":"Save editor settings"})})]}),e.jsxs("div",{className:"account-list",children:[e.jsxs("div",{className:"account-list-heading",children:[e.jsx("span",{children:"LSP status"}),e.jsxs("div",{className:"settings-heading-actions",children:[e.jsx("small",{children:r?"Checking":t?"Current":"Not checked"}),e.jsx("button",{type:"button",className:"settings-icon-button",title:"Refresh LSP status","aria-label":"Refresh LSP status",disabled:r||n,onClick:()=>{h()},children:e.jsx(re,{className:r?"settings-spin":void 0,size:15})}),e.jsxs("button",{type:"button",className:"settings-secondary",disabled:r||n,onClick:()=>{o()},children:[e.jsx(Dt,{className:n?"settings-spin":void 0,size:15}),e.jsx("span",{children:n?"Restarting":"Restart"})]})]})]}),hs.map(c=>{const m=d.get(c.id);return e.jsxs("div",{className:"product-row lsp-status-row",children:[e.jsxs("div",{children:[e.jsx("strong",{children:c.label}),e.jsx("span",{title:m?.command??m?.message??void 0,children:m?.command??m?.message??"Not checked"})]}),e.jsx("span",{className:`lsp-status-pill ${m?.status??"missing"}`,children:ms(m,r)})]},c.id)})]}),e.jsxs("div",{className:"settings-footnote",children:[e.jsx("span",{children:"Project config"}),e.jsx("strong",{children:"Uses tsconfig, pyrightconfig, pyproject, and Cargo files when present"})]})]})}function ms(s,t){return t&&!s?"Checking":s?s.status==="found"?"Found":s.status==="disabled"?"Disabled":s.status==="error"?"Error":"Missing":"Not checked"}function ln({goalStorageLocation:s,preferences:t,saving:a,saveDefaults:n,setGoalStorageLocation:l}){return e.jsxs("section",{className:"account-settings",children:[e.jsx("h1",{children:"Goals"}),e.jsxs("form",{className:"provider-settings-form",onSubmit:r=>{n(r)},children:[e.jsxs("div",{className:"account-list-heading",children:[e.jsx("span",{children:"Storage"}),e.jsx("small",{children:"Controls where local goal state, plans, and artifacts are written"})]}),e.jsxs("div",{className:"settings-radio-group",children:[e.jsxs("label",{className:"settings-radio-row",children:[e.jsx("input",{type:"radio",name:"goal-storage-location",checked:s==="global",disabled:a,onChange:()=>l("global")}),e.jsxs("span",{children:[e.jsx("strong",{children:"User home"}),e.jsx("small",{children:"Store goal files under ~/.openpond/goals."})]})]}),e.jsxs("label",{className:"settings-radio-row",children:[e.jsx("input",{type:"radio",name:"goal-storage-location",checked:s==="workspace",disabled:a,onChange:()=>l("workspace")}),e.jsxs("span",{children:[e.jsx("strong",{children:"Working directory"}),e.jsx("small",{children:"Store goal files in the current workspace under .openpond/goals."})]})]})]}),e.jsx("button",{className:"settings-primary",disabled:a||s===t.goalStorageLocation,children:e.jsx("span",{children:a?"Saving":"Save goals"})})]}),e.jsxs("div",{className:"settings-footnote",children:[e.jsx("span",{children:"Goal storage"}),e.jsx("strong",{children:s==="global"?"~/.openpond/goals":".openpond/goals in the working directory"})]})]})}function rn({contextCompactionAutoEnabled:s,preferences:t,saving:a,saveDefaults:n,setContextCompactionAutoEnabled:l}){return e.jsxs("section",{className:"account-settings",children:[e.jsx("h1",{children:"Context"}),e.jsxs("form",{className:"provider-settings-form",onSubmit:r=>{n(r)},children:[e.jsxs("div",{className:"account-list-heading",children:[e.jsx("span",{children:"Compaction"}),e.jsx("small",{children:"Controls automatic compaction for long OpenPond and BYOK chats"})]}),e.jsxs("label",{className:"settings-check-row",children:[e.jsx("input",{type:"checkbox",checked:s,disabled:a,onChange:r=>l(r.target.checked)}),e.jsxs("span",{children:[e.jsx("strong",{children:"Auto compact long chats"}),e.jsx("small",{children:"Summarize older turns at 85% context before the selected model runs out. The transcript stays visible."})]})]}),e.jsx("button",{className:"settings-primary",disabled:a||s===t.contextCompaction.autoEnabled,children:e.jsx("span",{children:a?"Saving":"Save context"})})]})]})}function on({insightsEnabled:s,insightsUseDefaultModel:t,insightsProvider:a,insightsModel:n,insightsEvidenceSources:l,preferences:r,providers:h,saving:o,saveDefaults:x,changeInsightsProvider:y,setInsightsEnabled:j,setInsightsUseDefaultModel:b,setInsightsModel:p,setInsightsEvidenceSourceEnabled:d}){const c=Ze(h,{enabledOnly:!0}),m=ke(a,h),N="settings-insights-model-options",f=s===r.insightsEnabled&&gn(l,r.insightsEvidenceSources)&&pn({useDefault:t,provider:a,model:n},r);return e.jsxs("section",{className:"account-settings insights-settings",children:[e.jsx("h1",{children:"Insights"}),e.jsxs("form",{className:"provider-settings-form",onSubmit:u=>{x(u)},children:[e.jsxs("div",{className:"account-list-heading",children:[e.jsx("span",{children:"Background agent"}),e.jsx("small",{children:"Controls the background Insights agent"})]}),e.jsxs("label",{className:"settings-check-row",children:[e.jsx("input",{type:"checkbox",checked:s,disabled:o,onChange:u=>j(u.target.checked)}),e.jsxs("span",{children:[e.jsx("strong",{children:"Run background Insights"}),e.jsx("small",{children:"Startup and interval scans run while the app is open."})]})]}),e.jsxs("label",{className:"settings-check-row",children:[e.jsx("input",{type:"checkbox",checked:t,disabled:o,onChange:u=>b(u.target.checked)}),e.jsxs("span",{children:[e.jsx("strong",{children:"Use default chat model"}),e.jsxs("small",{children:[ye(r.defaultChatProvider,h)," /"," ",Oe(r.defaultChatModel,h,r.defaultChatProvider)]})]})]}),t?null:e.jsxs("div",{className:"provider-settings-grid two",children:[e.jsxs("label",{className:"settings-select-field",children:[e.jsx("span",{children:"Insights provider"}),e.jsx("select",{value:a,disabled:o,onChange:u=>y(u.target.value),children:c.map(u=>e.jsx("option",{value:u.value,children:u.label},u.value))})]}),e.jsxs("label",{className:"settings-select-field",children:[e.jsx("span",{children:"Insights model"}),e.jsx("input",{value:n,disabled:o,list:N,onChange:u=>p(u.target.value)}),e.jsx("datalist",{id:N,children:m.map(u=>e.jsx("option",{value:u.value,children:u.label},u.value))})]})]}),e.jsx("div",{className:"settings-check-grid","aria-label":"Insights evidence sources",children:Os.map(u=>e.jsxs("label",{className:"settings-check-row compact",children:[e.jsx("input",{type:"checkbox",checked:l[u.key],disabled:o,onChange:C=>d(u.key,C.target.checked)}),e.jsxs("span",{children:[e.jsx("strong",{children:u.label}),e.jsx("small",{children:u.description})]})]},u.key))}),e.jsx("button",{className:"settings-primary",disabled:o||f,children:e.jsx("span",{children:o?"Saving":"Save insights"})})]}),e.jsxs("div",{className:"settings-footnote",children:[e.jsx("span",{children:"Insights model"}),e.jsx("strong",{children:t?"Default chat model":`${ye(a,h)} / ${n}`})]})]})}function cn({subagentsEnabled:s,subagentDelegationMode:t,subagentsUseDefaultModel:a,subagentsProvider:n,subagentsModel:l,subagentRoles:r,subagentsMaxConcurrentRuns:h,subagentsMaxConcurrentRunsPerProvider:o,subagentsMaxConcurrentRunsPerWorkspaceTarget:x,preferences:y,providers:j,saving:b,saveDefaults:p,changeSubagentsProvider:d,setSubagentsEnabled:c,setSubagentDelegationMode:m,setSubagentsUseDefaultModel:N,setSubagentsModel:f,setSubagentsMaxConcurrentRuns:u,setSubagentsMaxConcurrentRunsPerProvider:C,setSubagentsMaxConcurrentRunsPerWorkspaceTarget:k,setSubagentRoleEnabled:w,setSubagentRoleIsolationMode:P,setSubagentRoleMaxConcurrentRuns:D,setSubagentRoleModel:F,setSubagentRolePeerMessages:g,setSubagentRoleToolPolicy:S,changeSubagentRoleProvider:v}){const R=Ze(j,{enabledOnly:!0}),A=a?y.defaultChatProvider:n,L=a?y.defaultChatModel:l,G=Es(ke(A,j),L),q=a?null:{providerId:n,modelId:l.trim()},K=fn({enabled:s,delegationMode:t,defaultModelRef:q,roles:r,maxConcurrentRuns:h,maxConcurrentRunsPerProvider:o,maxConcurrentRunsPerWorkspaceTarget:x},y);return e.jsx("section",{className:"account-settings subagents-settings",children:e.jsxs("form",{className:"subagent-settings-form",onSubmit:M=>{p(M)},children:[e.jsxs("div",{className:"subagent-settings-title-row",children:[e.jsx("h1",{children:"Subagents"}),e.jsxs("div",{className:"subagent-settings-actions",children:[e.jsx("button",{className:`settings-primary subagent-save-button${K?"":" dirty"}`,disabled:b||K,children:e.jsx("span",{children:b?"Saving":"Save agents"})}),e.jsxs("label",{className:"provider-toggle subagent-card-toggle","aria-label":"Allow subagents",children:[e.jsx("input",{type:"checkbox",checked:s,disabled:b,onChange:M=>c(M.target.checked)}),e.jsx("span",{})]})]})]}),e.jsxs("section",{className:"subagent-settings-section",children:[e.jsx("div",{className:"subagent-settings-card-header",children:e.jsxs("div",{children:[e.jsx("span",{children:"Default delegation"}),e.jsx("small",{children:"Used unless a task overrides it from the composer."})]})}),e.jsx("div",{className:"subagent-field-grid two",children:e.jsxs("label",{className:"settings-select-field",children:[e.jsx("span",{children:"Subagent use"}),e.jsxs("select",{value:t,disabled:b||!s,onChange:M=>m(M.target.value),children:[e.jsx("option",{value:"manual",children:"Manual"}),e.jsx("option",{value:"balanced",children:"Balanced"}),e.jsx("option",{value:"proactive",children:"Proactive"})]})]})})]}),e.jsxs("section",{className:"subagent-settings-section",children:[e.jsx("div",{className:"subagent-settings-card-header",children:e.jsx("div",{children:e.jsx("span",{children:"Default model"})})}),e.jsxs("div",{className:"subagent-field-grid two",children:[e.jsxs("label",{className:"settings-select-field",children:[e.jsx("span",{children:"Provider"}),e.jsx("select",{value:A,disabled:b||!s,onChange:M=>{N(!1),d(M.target.value)},children:R.map(M=>e.jsx("option",{value:M.value,children:M.label},M.value))})]}),e.jsxs("label",{className:"settings-select-field",children:[e.jsx("span",{children:"Model"}),e.jsx("select",{value:L,disabled:b||!s,onChange:M=>{N(!1),f(M.target.value)},children:G.map(M=>e.jsx("option",{value:M.value,children:M.label},M.value))})]})]})]}),e.jsx("div",{className:"subagent-role-list",children:r.map(M=>{const U=lt.find(E=>E.id===M.id),H=M.modelRef?.providerId??A,Q=M.modelRef?.modelId||it(H,j)||L,ne=mn(R,j,{providerId:H,modelId:Q}),J=Ee(H,Q),V=b||!s||!M.enabled;return e.jsxs("section",{className:`subagent-role-row${M.enabled?"":" disabled"}`,children:[e.jsxs("div",{className:"subagent-settings-card-header subagent-role-header",children:[e.jsxs("div",{className:"subagent-role-title",children:[e.jsx("span",{children:U?.label??M.id}),e.jsx("small",{children:U?.description??"Custom subagent role."})]}),e.jsxs("label",{className:"provider-toggle subagent-card-toggle","aria-label":`${U?.label??M.id} enabled`,children:[e.jsx("input",{type:"checkbox",checked:M.enabled,disabled:b||!s,onChange:E=>w(M.id,E.target.checked)}),e.jsx("span",{})]})]}),e.jsxs("div",{className:"subagent-role-controls",children:[e.jsxs("label",{className:"settings-select-field",children:[e.jsx("span",{children:"Model"}),e.jsx("select",{value:J,disabled:V,onChange:E=>{const B=ne.find(ee=>ee.value===E.target.value);B&&(v(M.id,B.providerId),F(M.id,B.modelId))},children:ne.map(E=>e.jsx("option",{value:E.value,children:E.label},E.value))})]}),e.jsxs("label",{className:"settings-select-field",children:[e.jsx("span",{children:"Isolation"}),e.jsx("select",{value:M.isolationMode,disabled:V,onChange:E=>P(M.id,E.target.value),children:dn.map(E=>e.jsx("option",{value:E.value,children:E.label},E.value))})]}),e.jsxs("label",{className:"settings-select-field",children:[e.jsx("span",{children:"Tools"}),e.jsx("select",{value:M.toolPolicy,disabled:V,onChange:E=>S(M.id,E.target.value),children:un.map(E=>e.jsx("option",{value:E.value,children:E.label},E.value))})]}),e.jsxs("label",{className:"settings-select-field",children:[e.jsx("span",{children:"Peer messages"}),e.jsx("select",{value:M.peerMessages,disabled:V,onChange:E=>g(M.id,E.target.value),children:hn.map(E=>e.jsx("option",{value:E.value,children:E.label},E.value))})]})]}),e.jsx("div",{className:"subagent-role-budget-grid",children:e.jsxs("label",{className:"settings-select-field",children:[e.jsx("span",{children:"Role concurrency"}),e.jsx("input",{type:"number",min:1,max:16,value:M.maxConcurrentRuns,disabled:V,onChange:E=>D(M.id,gs(E.target.value,1))})]})})]},M.id)})}),e.jsxs("section",{className:"subagent-settings-section",children:[e.jsx("div",{className:"subagent-settings-card-header",children:e.jsxs("div",{children:[e.jsx("span",{children:"Limits"}),e.jsx("small",{children:"Controls child worker concurrency."})]})}),e.jsxs("div",{className:"subagent-field-grid four",children:[e.jsxs("label",{className:"settings-select-field",children:[e.jsx("span",{children:"Total concurrency"}),e.jsx("input",{type:"number",min:1,max:32,value:h,disabled:b||!s,onChange:M=>u(gs(M.target.value,1))})]}),e.jsxs("label",{className:"settings-select-field",children:[e.jsx("span",{children:"Per provider"}),e.jsx("input",{type:"number",min:1,max:32,value:o??"",placeholder:"No cap",disabled:b||!s,onChange:M=>C(Ye(M.target.value))})]}),e.jsxs("label",{className:"settings-select-field",children:[e.jsx("span",{children:"Per workspace"}),e.jsx("input",{type:"number",min:1,max:32,value:x??"",placeholder:"No cap",disabled:b||!s,onChange:M=>k(Ye(M.target.value))})]})]})]})]})})}const dn=[{value:"none",label:"Direct workspace"},{value:"copy_on_write",label:"Copy-on-write"},{value:"worktree",label:"Worktree"}],un=[{value:"read_only",label:"Read only"},{value:"workspace_write",label:"Workspace write"},{value:"full_tools",label:"Full tools"}],hn=[{value:"goal_scoped",label:"Scoped handoffs"},{value:"disabled",label:"Disabled"}];function Es(s,t){const a=t.trim();return!a||s.some(n=>n.value===a)?s:[{value:a,label:a},...s]}function Ee(s,t){return JSON.stringify([s,t])}function mn(s,t,a){const n=[];for(const l of s){const r=Es(ke(l.value,t),l.value===a.providerId?a.modelId:"");for(const h of r)n.push({value:Ee(l.value,h.value),label:`${l.label} / ${h.label}`,providerId:l.value,modelId:h.value})}return a.modelId&&!n.some(l=>l.value===Ee(a.providerId,a.modelId))&&n.unshift({value:Ee(a.providerId,a.modelId),label:`${ye(a.providerId,t)} / ${a.modelId}`,providerId:a.providerId,modelId:a.modelId}),n}const Os=[{key:"createEdit",label:"Create/Improve",description:"Waiting, blocked, or failed Create/Improve runs."},{key:"stuckTurns",label:"Stuck turns",description:"Failed or long-running active turns."},{key:"toolFailures",label:"Tool failures",description:"Repeated tool or action failures."},{key:"abandonedGoals",label:"Abandoned goals",description:"Goal loops left active too long."},{key:"userCorrections",label:"Corrections",description:"Repeated correction-style prompts."},{key:"unresolvedConversations",label:"Unresolved chats",description:"Long chats with unresolved recent work."},{key:"usageAnomalies",label:"Usage",description:"Spikes, failures, missing usage, and latency changes."}];function gn(s,t){return Os.every(a=>s[a.key]===t[a.key])}function pn(s,t){return s.useDefault?!t.insightsModelRef:t.insightsModelRef?.providerId===s.provider&&t.insightsModelRef?.modelId===s.model.trim()}function Ye(s){const t=s.trim();if(!t)return null;const a=Number(t);return Number.isFinite(a)?a:null}function gs(s,t){return Ye(s)??t}function fn(s,t){const a=t.subagents;return s.enabled===a.enabled&&s.delegationMode===a.delegationMode&&xn(s.defaultModelRef,a.defaultModelRef)&&s.maxConcurrentRuns===a.maxConcurrentRuns&&s.maxConcurrentRunsPerProvider===a.maxConcurrentRunsPerProvider&&s.maxConcurrentRunsPerWorkspaceTarget===a.maxConcurrentRunsPerWorkspaceTarget&&JSON.stringify(s.roles)===JSON.stringify(a.roles)}function xn(s,t){return(s?.providerId??null)===(t?.providerId??null)&&(s?.modelId??null)===(t?.modelId??null)}const vn=[{mode:"all",label:"All new messages",detail:"Show an in-app alert for every Team Chat message."},{mode:"direct_mentions",label:"Direct messages and mentions",detail:"Show alerts for direct messages and messages that mention you."},{mode:"none",label:"Nothing",detail:"Keep unread counts without showing message alerts."}];function jn({currentUserId:s,enabled:t,mode:a,threads:n,onModeChange:l,onThreadMuteChange:r}){const[h,o]=i.useState(null),[x,y]=i.useState(null);Ss(x);const j=i.useMemo(()=>n.filter(d=>d.archivedAt===null).map(d=>({thread:d,label:bn(d,s)})).sort((d,c)=>{const m=+!!c.thread.mutedAt-+!!d.thread.mutedAt;return m!==0?m:d.label.localeCompare(c.label)}),[s,n]),b=j.filter(({thread:d})=>!!d.mutedAt).length,p=i.useCallback(async d=>{o(d.id),y(null),await r(d.id,!d.mutedAt)||y("Could not update this conversation. Try again."),o(null)},[r]);return e.jsxs("section",{className:"account-settings notifications-settings",children:[e.jsx("h1",{children:"Notifications"}),e.jsxs("div",{className:"account-list notification-settings-card",children:[e.jsxs("div",{className:"account-list-heading",children:[e.jsx("span",{children:"Team chat notifications"}),e.jsx("small",{children:"In-app alerts"})]}),e.jsx("div",{className:"notification-mode-list",role:"radiogroup","aria-label":"Notify me about",children:vn.map(d=>e.jsxs("label",{className:`notification-mode-option${a===d.mode?" selected":""}`,children:[e.jsx("input",{type:"radio",name:"team-chat-notification-mode",checked:a===d.mode,onChange:()=>l(d.mode)}),e.jsxs("span",{children:[e.jsx("strong",{children:d.label}),e.jsx("small",{children:d.detail})]})]},d.mode))})]}),e.jsxs("div",{className:"account-list notification-settings-card",children:[e.jsxs("div",{className:"account-list-heading",children:[e.jsx("span",{children:"Conversation overrides"}),e.jsx("small",{children:b===1?"1 muted":`${b} muted`})]}),t?j.length===0?e.jsx("div",{className:"empty-account-list",children:e.jsx("span",{children:"Open a Team Chat conversation to manage it here."})}):j.map(({thread:d,label:c})=>{const m=!!d.mutedAt,N=h===d.id;return e.jsxs("div",{className:"notification-thread-row",children:[e.jsx("span",{className:`notification-thread-icon${m?" muted":""}`,children:m?e.jsx(rt,{size:15}):e.jsx(Rs,{size:15})}),e.jsxs("span",{className:"notification-thread-copy",children:[e.jsx("strong",{children:c}),e.jsx("small",{children:m?"Muted":"Uses the team chat setting"})]}),e.jsx("button",{type:"button",className:"settings-secondary",disabled:h!==null,onClick:()=>{p(d)},children:N?"Saving":m?"Unmute":"Mute"})]},d.id)}):e.jsx("div",{className:"empty-account-list",children:e.jsx("span",{children:"Connect a team to manage conversation overrides."})})]}),e.jsx("div",{className:"settings-footnote",children:e.jsx("span",{children:"Muted conversations never show alerts. Unread counts remain available."})})]})}function bn(s,t){return s.kind==="general"||s.kind==="channel"?`#${s.title?.trim()||"general"}`:s.kind==="dm"?s.participants.find(a=>a.userId!==t)?.name??s.title?.trim()??"Direct message":s.title?.trim()||s.participants.filter(a=>a.userId!==t).map(a=>a.name).join(", ")||"Group conversation"}function yn({canSaveCurrentTemplate:s,personalizationTemplateId:t,personalizationTemplateOptions:a,saveAsNewOpen:n,saving:l,selectedPersonalizationTemplate:r,selectedTemplateIsCustom:h,soulDraft:o,templateNameDraft:x,changePersonalizationTemplate:y,changeSoulDraft:j,openSaveAsNew:b,resetPersonalizationDraft:p,savePersonalization:d,setSaveAsNewOpen:c,setTemplateNameDraft:m}){function N(f){f.preventDefault(),d(n)}return e.jsxs("section",{className:"account-settings",children:[e.jsx("h1",{children:"Personalization"}),e.jsxs("form",{className:"provider-settings-form personalization-form",onSubmit:N,children:[e.jsxs("div",{className:"account-list-heading",children:[e.jsx("span",{children:"Agent style"}),e.jsx("div",{className:"settings-heading-actions",children:n?e.jsxs(e.Fragment,{children:[e.jsx("input",{className:"settings-heading-input",value:x,onChange:f=>m(f.target.value),placeholder:"Name","aria-label":"Template name"}),e.jsx("button",{type:"button",className:"settings-icon-button",title:"Cancel","aria-label":"Cancel",disabled:l,onClick:()=>c(!1),children:e.jsx(Le,{size:15})}),e.jsx("button",{type:"button",className:"settings-icon-button primary",title:"Save new template","aria-label":"Save new template",disabled:l||!o.trim()||!x.trim(),onClick:()=>{d(!0)},children:e.jsx(ot,{size:15})})]}):e.jsxs(e.Fragment,{children:[e.jsx("small",{children:h?"Custom template":"Built-in template"}),e.jsx("button",{type:"button",className:"settings-icon-button",title:"Save as new","aria-label":"Save as new",disabled:l||!r||!o.trim(),onClick:b,children:e.jsx(Ue,{size:15})})]})})]}),e.jsx("div",{className:"provider-settings-grid single",children:e.jsxs("div",{className:"settings-select-field",children:[e.jsx("span",{children:"Template"}),e.jsx(Ce,{value:t,disabled:l||a.length===0,label:"Personalization template",options:a,onChange:f=>{y(f)}})]})}),e.jsxs("label",{className:"settings-select-field personalization-editor",children:[e.jsx("span",{children:"SOUL.md"}),e.jsx("textarea",{value:o,onChange:f=>j(f.target.value),spellCheck:!1})]}),e.jsxs("div",{className:"settings-button-row",children:[e.jsx("button",{type:"button",className:"settings-icon-button",title:"Reset to template","aria-label":"Reset to template",disabled:l||!r,onClick:p,children:e.jsx(Pt,{size:15})}),h&&e.jsx("button",{className:"settings-icon-button primary",title:"Save template","aria-label":"Save template",disabled:l||!s,children:e.jsx(Xe,{size:15})})]})]})]})}const Nn=[{value:"local_secret",label:"Saved key",description:"Encrypted on this machine"},{value:"env",label:"Environment variable",description:"Read by the local server"}],Sn=120,wn=new Set(["openai","xai","zai"]),Cn=new Set(["chatgpt-subscription"]),kn="https://api.z.ai/api/coding/paas/v4";function ps(s){return s.split(/[\n,]/).map(t=>t.trim()).filter(Boolean)}function Ts(s){return s?s.available?"Ready":s.credential.connected?"Configured":s.credential.lastError||s.lastError?"Needs attention":s.id==="codex"?"Needs Codex login":s.routing.localByok?"Needs key":s.enabled?"Enabled":"Off":"Unknown"}function Ls(s){return s?s.available?"ready":s.credential.connected?"configured":s.credential.lastError||s.lastError||s.id==="codex"?"warning":"muted":"unknown"}function fs(s){return s.credential.connected?s.credential.redacted?s.credential.redacted:s.credential.source==="chatgpt_subscription"?"ChatGPT subscription":s.credential.source:s.credential.lastError??"Not connected"}function Pn(s){return s?.trim().replace(/\/+$/,"")??""}function Us(s,t){return s.id==="zai"&&Pn(t.providers.zai?.baseUrl)===kn}function Rn(s,t){return!s.credential.connected||!s.routing.localByok?"":s.credential.source==="chatgpt_subscription"?"Subscription":Us(s,t)?"Coding Plan key":"API key"}function In(s,t){const a=t.modelCaches[s.id];if(s.routing.localByok&&s.enabled&&!s.credential.connected||!s.enabled&&s.id!=="openpond")return"";const n=Math.max(a?.models.length??0,s.modelIds.length),l=s.defaultModel?Oe(s.defaultModel,t,s.id):"",r=n===1?"1 model":`${n} models`,h=Rn(s,t);return[Ts(s),h,a?r:"",l].filter(Boolean).join(" · ")}function Mn(s){return s!=="openpond"&&Ke(s)}function Qe(s){return s?wn.has(s.id)||s.credentialModes.some(t=>Cn.has(t)):!1}function Dn(s){return Qe(s)?["api","subscription"]:["api"]}function xs(s,t){return!s||!t||!Qe(s)?"api":s.credential.source==="chatgpt_subscription"||Us(s,t)?"subscription":"api"}function vs(s,t){const a=ct.filter(n=>!!s?.statuses[n]);return t?a.filter(n=>Qe(s?.statuses[n])):a}function An(s){if(!s)return"Never";const t=new Date(s);return Number.isNaN(t.getTime())?s:t.toLocaleString()}function En(s,t,a=Sn){const n=[],l=new Set,r=new Set(t.map(o=>o.trim()).filter(Boolean)),h=o=>{l.has(o.value)||n.length>=a||(l.add(o.value),n.push(o))};for(const o of s)r.has(o.value)&&h(o);for(const o of s)h(o);return n}function On({account:s,codex:t,providers:a,providerBusy:n,validationMessage:l,deleteProviderCredential:r,loadProviderModels:h,refreshProviderModels:o,saveProviderConfig:x,saveProviderCredential:y,startOpenAiSubscriptionAuth:j,validateProvider:b}){const[p,d]=i.useState(null),[c,m]=i.useState(!1),N=i.useMemo(()=>vs(a,!1),[a]),f=i.useMemo(()=>vs(a,c),[a,c]),u=p?a?.statuses[p]??null:null;function C(k,w){d(k),w&&h(k)}return e.jsxs("section",{className:"account-settings",children:[e.jsx("h1",{children:"Providers"}),a?e.jsxs("div",{className:"provider-manager-panel",children:[e.jsxs("div",{className:"account-list-heading provider-manager-heading",children:[e.jsxs("div",{className:"provider-manager-title-row",children:[e.jsx("span",{children:"Model providers"}),e.jsxs("label",{className:"settings-check-row compact provider-subscription-filter",children:[e.jsx("input",{type:"checkbox",checked:c,onChange:k=>m(k.currentTarget.checked)}),e.jsx("span",{children:"Subscriptions"})]})]}),e.jsxs("small",{children:[f.length," of ",N.length," presets"]})]}),f.length>0?e.jsx("div",{className:"provider-manager-scroll",role:"list",children:f.map(k=>{const w=a.statuses[k],P=a.modelCaches[k],D=w.modelIds.length>0&&(P?.models.length??0)<w.modelIds.length,F=n?.startsWith(`${k}:`)??!1,g=Mn(k),S=k==="openpond"||!!a.providers[k]?.enabled;return e.jsxs("div",{className:"provider-manager-row",role:"listitem",children:[e.jsxs("label",{className:"provider-toggle","aria-label":`Enable ${w.displayName}`,children:[e.jsx("input",{type:"checkbox",checked:S,disabled:!g||F,onChange:v=>{C(k,!1),x(k,{enabled:v.currentTarget.checked})}}),e.jsx("span",{})]}),e.jsx("div",{className:"provider-row-main",children:e.jsx("strong",{children:w.displayName})}),e.jsxs("div",{className:`provider-row-status ${Ls(w)}`,children:[F?e.jsx(te,{size:13,className:"settings-spin"}):null,e.jsx("span",{children:In(w,a)})]}),e.jsx("button",{type:"button",className:"settings-secondary provider-details-button",onClick:()=>{C(k,D)},children:"Details"})]},k)})}):e.jsxs("div",{className:"empty-account-list provider-manager-empty",children:[e.jsx("strong",{children:"No subscription providers"}),e.jsx("span",{children:"Turn off the filter to show API-key providers."})]})]}):null,l?e.jsxs("div",{className:"settings-footnote provider-validation-message",children:[e.jsx("span",{children:"Last validation"}),e.jsx("strong",{children:l})]}):null,p&&u&&a?e.jsx(Tn,{account:s,codex:t,providerId:p,providerBusy:n,settings:a,status:u,onClose:()=>d(null),onDeleteCredential:r,onRefreshModels:o,onSaveConfig:x,onSaveCredential:y,onStartOpenAiSubscriptionAuth:j,onValidate:b}):null]})}function Tn({account:s,codex:t,providerId:a,providerBusy:n,settings:l,status:r,onClose:h,onDeleteCredential:o,onRefreshModels:x,onSaveConfig:y,onSaveCredential:j,onStartOpenAiSubscriptionAuth:b,onValidate:p}){const d=l.providers[a],c=l.modelCaches[a],m=i.useId(),N=i.useRef(a),f=Math.max(c?.models.length??0,r.modelIds.length),u=r.routing.localByok&&Ke(a)&&a!=="codex",C=i.useMemo(()=>u?Dn(r):[],[u,r]),k=C.includes("subscription"),[w,P]=i.useState(()=>xs(r,l)),D=u&&w==="subscription"&&k,F=S=>`${m}-${S}-panel`,g=a==="codex"?"Codex app server":d?.baseUrl??(a==="openpond"?s?.chatApiBaseUrl:null)??"Not set";return i.useEffect(()=>{if(N.current!==a){N.current=a,P(xs(r,l));return}u&&!C.includes(w)&&P("api")},[w,C,u,a,l,r]),e.jsx("div",{className:"git-dialog-backdrop provider-dialog-backdrop",role:"presentation",onMouseDown:h,children:e.jsxs("section",{className:"git-dialog provider-details-dialog",role:"dialog","aria-modal":"true","aria-label":`${r.displayName} provider details`,onMouseDown:S=>S.stopPropagation(),children:[e.jsx("button",{className:"git-dialog-close",type:"button",title:"Close","aria-label":"Close",onClick:h,children:e.jsx(Le,{size:16})}),e.jsxs("div",{className:"provider-dialog-header",children:[e.jsxs("div",{children:[e.jsx("h2",{children:r.displayName}),e.jsx("span",{children:ye(a,l)})]}),e.jsx("div",{className:`provider-state-pill ${Ls(r)}`,children:Ts(r)})]}),u?e.jsx("div",{className:"surface-tabs provider-mode-tabs",role:"tablist","aria-label":`${r.displayName} mode`,children:C.map(S=>e.jsx("button",{type:"button",role:"tab",id:`${m}-${S}`,className:w===S?"active":void 0,"aria-selected":w===S,"aria-controls":F(S),onClick:()=>P(S),children:S==="api"?"API":"Subscription"},S))}):null,e.jsxs("dl",{className:"provider-dialog-stats",children:[e.jsxs("div",{children:[e.jsx("dt",{children:"Credential"}),e.jsx("dd",{title:fs(r),children:fs(r)})]}),D?null:e.jsxs(e.Fragment,{children:[e.jsxs("div",{children:[e.jsx("dt",{children:"Base URL"}),e.jsx("dd",{title:g,children:g})]}),e.jsxs("div",{children:[e.jsx("dt",{children:"Model"}),e.jsx("dd",{title:d?.defaultModel??r.defaultModel??void 0,children:d?.defaultModel??r.defaultModel??"Not set"})]}),e.jsxs("div",{children:[e.jsx("dt",{children:"Models"}),e.jsxs("dd",{title:c?.lastError??void 0,children:[f," cached · ",An(c?.fetchedAt)]})]})]}),a==="codex"?e.jsxs(e.Fragment,{children:[e.jsxs("div",{children:[e.jsx("dt",{children:"Account"}),e.jsx("dd",{title:t?.account?.email??void 0,children:t?.account?.label??t?.account?.email??"Not signed in"})]}),e.jsxs("div",{children:[e.jsx("dt",{children:"Binary"}),e.jsx("dd",{title:t?.binaryPath??void 0,children:t?.binaryPath??"Not found"})]})]}):null,r.credential.lastError||c?.lastError||r.lastError?e.jsxs("div",{className:"provider-dialog-error",children:[e.jsx("dt",{children:"Error"}),e.jsx("dd",{title:r.credential.lastError??c?.lastError??r.lastError??void 0,children:r.credential.lastError??c?.lastError??r.lastError})]}):null]}),a==="codex"?e.jsx(Ln,{providerBusy:n,status:r,onValidate:p}):u&&d&&c?e.jsx(Un,{credentialTab:w,credentialTabsId:m,hasSubscriptionTab:k,providerId:a,providerBusy:n,settings:l,status:r,onDeleteCredential:o,onRefreshModels:x,onSaveConfig:y,onSaveCredential:j,onStartOpenAiSubscriptionAuth:b,onValidate:p}):r.routing.localByok&&!Ke(a)?e.jsxs("div",{className:"provider-dialog-note",children:[e.jsx(Cs,{size:15}),e.jsx("span",{children:"Adapter pending"})]}):null]})})}function Ln({providerBusy:s,status:t,onValidate:a}){const n=s==="codex:validate";return e.jsxs("div",{className:"provider-dialog-body codex-provider-body",children:[e.jsxs("div",{className:"provider-dialog-note codex-provider-note",children:[e.jsx(ie,{size:15}),e.jsxs("span",{children:["Uses your local ",e.jsx("code",{children:"codex login"})," session through the Codex app server. This route is separate from OpenAI Platform API-key billing."]})]}),e.jsx("div",{className:"settings-button-row codex-provider-actions",children:e.jsxs("button",{type:"button",className:"settings-secondary",disabled:n,onClick:()=>{a("codex",{modelId:t.defaultModel??void 0})},children:[n?e.jsx(te,{size:14,className:"settings-spin"}):e.jsx(ks,{size:14}),e.jsx("span",{children:n?"Testing":"Test Codex login"})]})})]})}function Un({credentialTab:s,credentialTabsId:t,hasSubscriptionTab:a,providerId:n,providerBusy:l,settings:r,status:h,onDeleteCredential:o,onRefreshModels:x,onSaveConfig:y,onSaveCredential:j,onStartOpenAiSubscriptionAuth:b,onValidate:p}){const d=r.providers[n],c=i.useMemo(()=>ke(n,r),[n,r]),m=`provider-models-${n}`,N=i.useRef(n),[f,u]=i.useState(d.baseUrl??""),[C,k]=i.useState(d.defaultModel??""),[w,P]=i.useState(d.modelOverrides.join(`
|
|
3
|
+
`)),[D,F]=i.useState({baseUrl:!1,defaultModel:!1,modelOverrides:!1}),[g,S]=i.useState("local_secret"),[v,R]=i.useState(""),[A,L]=i.useState(""),G=l===`${n}:config`,q=l===`${n}:credential`,K=l===`${n}:validate`,M=l===`${n}:models`,U=l==="openai:credential",H=n==="openai",Q=n==="xai",ne=n==="zai",V=(z=>`${t}-${z}-panel`)(s),E=s==="subscription"&&a,B=s==="subscription"&&ne?"coding-plan":"api",ee=B==="coding-plan"?"Coding Plan key":"API key",le=h.credential.connected?B==="coding-plan"?"Replace saved plan key":"Replace saved key":ee,ge=B==="coding-plan"?"Save plan key":"Save key",pe=i.useMemo(()=>En(c,[C,...ps(w)]),[C,c,w]),he=Math.max(0,c.length-pe.length);i.useEffect(()=>{if(N.current!==n){N.current=n,F({baseUrl:!1,defaultModel:!1,modelOverrides:!1}),u(d.baseUrl??""),k(d.defaultModel??""),P(d.modelOverrides.join(`
|
|
4
|
+
`));return}D.baseUrl||u(d.baseUrl??""),D.defaultModel||k(d.defaultModel??""),D.modelOverrides||P(d.modelOverrides.join(`
|
|
5
|
+
`))},[d.baseUrl,d.defaultModel,d.modelOverrides,D.baseUrl,D.defaultModel,D.modelOverrides,n]);const fe=g==="env"?!!A.trim():!!v.trim();async function xe(z){z.preventDefault(),await y(n,{enabled:!0,baseUrl:f.trim()||null,defaultModel:C.trim()||null,modelOverrides:ps(w)}),F({baseUrl:!1,defaultModel:!1,modelOverrides:!1})}async function ve(z){if(z.preventDefault(),!!fe){if(g==="env"){await j(n,{source:"env",envVar:A.trim()});return}await j(n,{source:"local_secret",value:v}),R("")}}function Y({panel:z=!0}={}){return e.jsxs("form",{className:"provider-credential-panel",id:z?V:void 0,role:z?"tabpanel":void 0,"aria-labelledby":z?`${t}-${s}`:void 0,onSubmit:Z=>{ve(Z)},children:[e.jsxs("div",{className:"provider-card-grid credential-grid",children:[e.jsxs("div",{className:"settings-select-field",children:[e.jsx("span",{children:"Credential source"}),e.jsx(Ce,{value:g,disabled:q,label:"Credential source",options:Nn,onChange:Z=>S(Z)})]}),g==="env"?e.jsxs("label",{className:"settings-select-field",children:[e.jsx("span",{children:"Environment variable"}),e.jsx("input",{value:A,disabled:q,placeholder:"PROVIDER_API_KEY",onChange:Z=>L(Z.currentTarget.value)})]}):e.jsxs("label",{className:"settings-select-field",children:[e.jsx("span",{children:ee}),e.jsx("input",{type:"password",value:v,disabled:q,placeholder:le,autoComplete:"off",onChange:Z=>R(Z.currentTarget.value)})]})]}),e.jsxs("div",{className:"settings-button-row",children:[e.jsxs("button",{className:"settings-secondary",disabled:q||!fe,children:[q?e.jsx(te,{size:14,className:"settings-spin"}):e.jsx(ie,{size:14}),e.jsx("span",{children:q?"Saving":ge})]}),e.jsx("button",{type:"button",className:"settings-icon-button ghost","aria-label":`Delete ${h.displayName} credential`,disabled:q||!h.credential.connected,onClick:()=>{o(n)},children:e.jsx(He,{size:15})})]})]})}function je(){return H?e.jsxs("div",{className:"provider-subscription-panel",id:V,role:"tabpanel","aria-labelledby":`${t}-subscription`,children:[e.jsxs("div",{className:"provider-dialog-note codex-provider-note",children:[e.jsx(ie,{size:15}),e.jsx("span",{children:"ChatGPT subscription auth opens OpenAI login and stores a refresh token locally. API keys remain available under the API tab for raw Platform billing."})]}),e.jsxs("div",{className:"settings-button-row",children:[e.jsxs("button",{type:"button",className:"settings-secondary",disabled:U,onClick:()=>{b("browser")},children:[U?e.jsx(te,{size:14,className:"settings-spin"}):e.jsx(ie,{size:14}),e.jsx("span",{children:U?"Opening":"Connect ChatGPT"})]}),e.jsxs("button",{type:"button",className:"settings-secondary",disabled:U,onClick:()=>{b("device")},children:[U?e.jsx(te,{size:14,className:"settings-spin"}):e.jsx(ie,{size:14}),e.jsx("span",{children:"Device code"})]}),e.jsx("button",{type:"button",className:"settings-icon-button ghost","aria-label":`Delete ${h.displayName} credential`,disabled:U||!h.credential.connected,onClick:()=>{o(n)},children:e.jsx(He,{size:15})})]})]}):Q?e.jsx("div",{className:"provider-subscription-panel",id:V,role:"tabpanel","aria-labelledby":`${t}-subscription`,children:e.jsxs("div",{className:"provider-dialog-note xai-provider-note",children:[e.jsx(ie,{size:15}),e.jsx("span",{children:"SuperGrok includes Grok app and Grok Build access. xAI API calls here still use an xAI Console API key with API credits or invoiced billing, so there is no separate Connect SuperGrok step yet."})]})}):ne?e.jsxs("div",{className:"provider-subscription-panel",id:V,role:"tabpanel","aria-labelledby":`${t}-subscription`,children:[e.jsxs("div",{className:"provider-dialog-note subscription-provider-note",children:[e.jsx(ie,{size:15}),e.jsx("span",{children:"GLM Coding Plan uses a plan API key with the dedicated Coding endpoint. General Z.ai API keys and balances are separate."})]}),Y({panel:!1})]}):null}return e.jsxs("div",{className:"provider-dialog-body",children:[E?null:e.jsxs("form",{className:"provider-card-form",onSubmit:z=>{xe(z)},children:[e.jsxs("div",{className:"provider-card-grid",children:[e.jsxs("label",{className:"settings-select-field",children:[e.jsx("span",{children:"Base URL"}),e.jsx("input",{value:f,disabled:G,placeholder:"https://api.example.com/v1",onChange:z=>{F(Z=>({...Z,baseUrl:!0})),u(z.currentTarget.value)}})]}),e.jsxs("label",{className:"settings-select-field",children:[e.jsx("span",{children:"Default model"}),e.jsx("input",{list:m,value:C,disabled:G,placeholder:"Model id",onChange:z=>{F(Z=>({...Z,defaultModel:!0})),k(z.currentTarget.value)}}),e.jsx("datalist",{id:m,children:pe.map(z=>e.jsx("option",{value:z.value,children:z.label},z.value))}),he>0?e.jsxs("small",{children:[he," more cached models hidden from suggestions"]}):null]})]}),e.jsxs("div",{className:"settings-button-row",children:[e.jsxs("button",{className:"settings-secondary",disabled:G,children:[G?e.jsx(te,{size:14,className:"settings-spin"}):e.jsx(Xe,{size:14}),e.jsx("span",{children:G?"Saving":"Save config"})]}),e.jsxs("button",{type:"button",className:"settings-secondary",disabled:M,onClick:()=>{x(n)},children:[M?e.jsx(te,{size:14,className:"settings-spin"}):e.jsx(re,{size:14}),e.jsx("span",{children:M?"Refreshing":"Refresh models"})]}),e.jsxs("button",{type:"button",className:"settings-secondary",disabled:K||!C.trim(),onClick:()=>{p(n,{baseUrl:f.trim()||void 0,modelId:C.trim()||void 0})},children:[K?e.jsx(te,{size:14,className:"settings-spin"}):e.jsx(ks,{size:14}),e.jsx("span",{children:K?"Testing":"Test"})]})]})]}),e.jsx("div",{className:"provider-card-form credential-form",children:E?je():Y()})]})}function $n({status:s,busy:t,flashTailscaleUp:a,refresh:n,enableRemoteAccess:l,disableRemoteAccess:r,copyRemoteLink:h,copyTailscaleUpCommand:o,copyServeCommand:x,copyServeSetupUrl:y,copyOperatorCommand:j,createRemoteLink:b}){const p=s?.tailscale.installed??!1,d=s?.serve.enabled??!1,c=s?.serve.reachable??!1,m=!!(s?.webUiAvailable&&p),N=d?!!s?.remoteWebUrl:m,u=(s?.tailscale.peers??[]).filter(w=>!w.isSelf),C=!!s?.tailscale.error?.includes("set --operator"),k=!!(d&&s?.remoteWebUrl);return e.jsxs("section",{className:"account-settings remote-access-settings",children:[e.jsx("h1",{children:"Remote access"}),e.jsxs("div",{className:"account-summary remote-access-summary",children:[e.jsxs("div",{className:"account-summary-main",children:[e.jsx("div",{className:`remote-access-icon ${c?"online":d?"configured":""}`,children:p?e.jsx(Ds,{size:18}):e.jsx(At,{size:18})}),e.jsxs("div",{children:[e.jsx("strong",{children:c?"Tailscale Serve is reachable":d?"Tailscale Serve is configured":"Tailscale Serve is off"}),e.jsx("small",{children:s?_n(s):"Checking Tailscale"})]})]}),e.jsxs("div",{className:"account-summary-actions",children:[e.jsx("button",{type:"button",className:"settings-icon-button",title:"Refresh remote access","aria-label":"Refresh remote access",disabled:t!==null,onClick:()=>{n()},children:e.jsx(re,{className:t==="refresh"?"settings-spin":"",size:15})}),e.jsxs("button",{type:"button",className:"settings-secondary",disabled:t!==null||!p||!d&&!m,onClick:()=>{d?r():l()},children:[e.jsx(Gt,{size:15}),e.jsx("span",{children:d?t==="disable"?"Turning off":"Turn off":t==="enable"?"Turning on":"Turn on"})]})]})]}),e.jsxs("div",{className:"account-list",children:[e.jsx("div",{className:"account-list-heading remote-access-link-heading",children:e.jsxs("div",{children:[e.jsx("span",{children:"OpenPond link"}),e.jsx("small",{children:k?"Browser UI":"Tailscale + Serve"})]})}),k&&e.jsx(oe,{label:"Remote URL",value:s?.remoteWebUrl??null,actionLabel:t==="copy-link"?"Copying":"Copy",disabled:!s?.remoteWebUrl||t!==null,onAction:h}),e.jsx(oe,{label:"Tailscale up",value:s?.tailscaleUpCommand??null,flash:a,actionLabel:t==="copy-up-command"?"Copying":"Copy",disabled:!s?.tailscaleUpCommand||t!==null,onAction:o}),e.jsx(oe,{label:"Serve command",value:s?.serveCommand??null,actionLabel:t==="copy-command"?"Copying":"Copy",disabled:!s?.serveCommand||t!==null,onAction:x}),s?.serve.setupUrl&&e.jsx(oe,{label:"Enable Serve",value:s.serve.setupUrl,actionLabel:t==="copy-serve-setup"?"Copying":"Copy",disabled:t!==null,onAction:y}),C&&e.jsx(oe,{label:"One-time setup",value:s?.operatorCommand??null,actionLabel:t==="copy-operator"?"Copying":"Copy",disabled:!s?.operatorCommand||t!==null,onAction:j}),e.jsx(oe,{label:"Local target",value:s?.localUrl??null}),s?.tailscale.authUrl&&e.jsx(oe,{label:"Tailscale login",value:s.tailscale.authUrl}),e.jsx(oe,{label:"Disable command",value:s?.disableCommand??null})]}),e.jsxs("div",{className:"account-list",children:[e.jsxs("div",{className:"account-list-heading remote-access-link-heading",children:[e.jsxs("div",{children:[e.jsx("span",{children:"Authorized clients"}),e.jsxs("small",{children:[u.length," devices"]})]}),e.jsx("button",{type:"button",className:"settings-secondary",disabled:t!==null||!N,onClick:()=>{b()},children:e.jsx("span",{children:d?"Copy link":"Create link"})})]}),s?u.length===0?e.jsxs("div",{className:"empty-account-list",children:[e.jsx("strong",{children:"No clients reported"}),e.jsx("span",{children:s?.tailscale.running?"Tailscale did not return peer devices.":"Tailscale is not running."})]}):u.map(w=>e.jsx(Bn,{peer:w},w.id)):e.jsxs("div",{className:"empty-account-list",children:[e.jsx("strong",{children:"Checking clients"}),e.jsx("span",{children:"Loading tailnet devices."})]})]}),e.jsxs("div",{className:"account-list",children:[e.jsxs("div",{className:"account-list-heading",children:[e.jsx("span",{children:"Remote environment"}),e.jsx("small",{children:s?.tailscale.tailnetName??"Tailnet"})]}),e.jsx(zn,{status:s})]}),s?.serve.configText&&e.jsxs("div",{className:"remote-access-config",children:[e.jsxs("div",{className:"account-list-heading",children:[e.jsx("span",{children:"Tailscale config"}),e.jsx("small",{children:s.serve.enabled?"OpenPond target found":"No OpenPond target"})]}),e.jsx("pre",{children:s.serve.configText})]})]})}function oe({actionLabel:s,disabled:t,flash:a,label:n,onAction:l,value:r}){return e.jsxs("div",{className:"product-row remote-access-value-row",children:[e.jsxs("div",{children:[e.jsx("strong",{className:a?"flash":void 0,children:n}),e.jsx("code",{children:r??"Not available"})]}),l&&e.jsx("button",{type:"button",className:"settings-secondary",disabled:t,onClick:()=>{l()},children:e.jsx("span",{children:s??"Copy"})})]})}function zn({status:s}){const t=[{label:"State",value:s?.tailscale.backendState??"Unknown"},{label:"Machine",value:s?.tailscale.machineName??"Unknown"},{label:"Tailnet",value:s?.tailscale.tailnetName??"Unknown"}],a=[{label:"Tailscale IP",value:s?.tailscale.tailscaleIps.join(", ")||"Unknown"},{label:"HTTPS host",value:s?.serve.httpsHost??s?.tailscale.dnsName??"Unknown"}];return e.jsxs("div",{className:"remote-access-environment",children:[e.jsx("div",{className:"remote-access-environment-row three",children:t.map(n=>e.jsx(js,{label:n.label,value:n.value},n.label))}),e.jsx("div",{className:"remote-access-environment-row two",children:a.map(n=>e.jsx(js,{label:n.label,value:n.value},n.label))})]})}function js({label:s,value:t}){return e.jsxs("div",{className:"remote-access-environment-cell",children:[e.jsx("strong",{children:s}),e.jsx("span",{children:t})]})}function Bn({peer:s}){return e.jsxs("div",{className:"account-row remote-access-peer-row",children:[e.jsx("div",{className:`remote-access-peer-dot ${s.online?"online":""}`}),e.jsxs("div",{className:"account-details",children:[e.jsx("strong",{children:s.name}),e.jsx("span",{children:s.dnsName??s.tailscaleIps[0]??"No address"})]}),e.jsx("span",{className:`account-state ${s.online?"signed_in":""}`,children:s.online?"Online":"Offline"}),e.jsx("span",{className:"account-state",children:s.os??"Unknown"})]})}function _n(s){return s.tailscale.installed?s.tailscale.running?s.webUiAvailable?s.serve.reachable?s.remoteUrl??"Tailnet link ready":s.remoteUrl?`${s.remoteUrl} ready to configure`:"Tailnet DNS unavailable":"Browser UI is not served by this process":s.tailscale.authUrl?"Tailscale needs sign-in":"Tailscale is not running":"Tailscale is not installed"}const Fn=[{items:[{section:"account",label:"Account",Icon:Kt},{section:"notifications",label:"Notifications",Icon:Rs},{section:"providers",label:"Providers",Icon:ut},{section:"compute",label:"Compute",Icon:Et},{section:"dataset-storage",label:"Dataset Storage",Icon:Bt},{section:"wallet",label:"Wallet",Icon:Is},{section:"usage",label:"Activity",Icon:ht},{section:"defaults",label:"Defaults",Icon:As}]},{label:"Harness",items:[{section:"profile",label:"My Profile",Icon:mt},{section:"skills",label:"Skills",Icon:Je},{section:"goals",label:"Goals",Icon:ls},{section:"context",label:"Context",Icon:gt},{section:"insights",label:"Insights",Icon:pt},{section:"training",label:"Training",Icon:ts},{section:"subagents",label:"Subagents",Icon:ts}]},{items:[{section:"editor",label:"Editor",Icon:$t},{section:"remote",label:"Remote",Icon:Ds},{section:"personalization",label:"Personalization",Icon:ft},{section:"diagnostics",label:"Diagnostics",Icon:ls}]}];function Gn({section:s,onBack:t,onSectionChange:a}){return e.jsxs("aside",{className:"settings-sidebar",children:[e.jsxs("button",{className:"settings-back",onClick:t,children:[e.jsx(dt,{size:15}),e.jsx("span",{children:"Back to app"})]}),e.jsx("nav",{className:"settings-nav","aria-label":"Settings",children:Fn.map((n,l)=>e.jsxs("div",{className:"settings-nav-group",children:[n.label?e.jsx("div",{className:"settings-nav-heading",children:n.label}):null,n.items.map(({section:r,label:h,Icon:o})=>e.jsxs("button",{className:`settings-nav-item ${s===r?"active":""}`,onClick:()=>a(r),children:[e.jsx(o,{size:16}),e.jsx("span",{children:h})]},r))]},n.label??`settings-${l}`))})]})}function Wn({catalog:s,connection:t,onCatalog:a,onError:n,onOpenExtension:l,onToast:r}){const[h,o]=i.useState(""),[x,y]=i.useState(""),[j,b]=i.useState(null),[p,d]=i.useState(null),[c,m]=i.useState(null),N=i.useCallback(g=>{const S=g instanceof Error?g.message:String(g);m(S),n(S),r?.(S,"error")},[n,r]),f=i.useCallback(()=>{m(null),n(null)},[n]),u=i.useCallback(async g=>{if(g?.preventDefault(),!(!t||!h.trim()||p)){f(),d("preview");try{const S=await T.extensionPreview(t,{source:h.trim(),...x.trim()?{ref:x.trim()}:{}});b(S)}catch(S){b(null),N(S)}finally{d(null)}}},[p,f,t,N,x,h]),C=i.useCallback(async()=>{if(!(!t||!j||p)){f(),d("install");try{const g=await T.extensionAdd(t,{source:j.repositoryUrl,ref:j.requestedRef});a(g.catalog),o(""),y(""),b(null),r?.(`Installed ${g.extension.owner}/${g.extension.repo}.`,"success")}catch(g){N(g)}finally{d(null)}}},[p,f,t,a,r,j,N]),k=i.useCallback(async g=>{if(!(!t||p)){f(),d(`update:${g.id}`);try{const S=await T.extensionUpdate(t,g);a(S.catalog);const v=S.extension.resolvedCommit===g.resolvedCommit&&S.extension.packageHash===g.packageHash;r?.(v?`${g.owner}/${g.repo} is already current.`:`Updated ${g.owner}/${g.repo}.`,"success")}catch(S){N(S)}finally{d(null)}}},[p,f,t,a,r,N]),w=i.useCallback(async()=>{if(!(!t||p||s.extensions.length===0)){f(),d("update-all");try{const g=await T.extensionUpdateAll(t);a(g.catalog);const S=`Updated ${g.updated.length}; ${g.unchanged.length} already current${g.failed.length?`; ${g.failed.length} failed`:""}.`;r?.(S,g.failed.length?"error":"success"),g.failed.length&&m(g.failed.map(v=>v.error).join(" "))}catch(g){N(g)}finally{d(null)}}},[p,s.extensions.length,f,t,a,r,N]),P=i.useCallback(async g=>{if(!(!t||p)&&window.confirm(`Remove ${g.owner}/${g.repo} and its ${g.skills.length} installed skill${g.skills.length===1?"":"s"}? Profile and built-in skills will not be changed.`)){f(),d(`remove:${g.id}`);try{const S=await T.extensionRemove(t,g);a(S.catalog),r?.(`Removed ${g.owner}/${g.repo}.`,"success")}catch(S){N(S)}finally{d(null)}}},[p,f,t,a,r,N]),D=i.useCallback(g=>{o(g),b(null),m(null)},[]),F=i.useCallback(g=>{y(g),b(null),m(null)},[]);return e.jsxs("div",{className:"account-list native-skills-list github-extensions-list",children:[e.jsxs("div",{className:"account-list-heading github-extensions-heading",children:[e.jsx("span",{children:"Third-party extensions"}),e.jsxs("div",{className:"github-extensions-heading-actions",children:[e.jsxs("small",{children:[s.extensions.length," installed from GitHub"]}),e.jsxs("button",{className:"settings-secondary compact",disabled:!t||p!==null||s.extensions.length===0,type:"button",onClick:()=>{w()},children:[p==="update-all"?e.jsx(te,{className:"settings-spin",size:13}):e.jsx(re,{size:13}),"Update all"]})]})]}),e.jsxs("form",{className:"github-extension-add",onSubmit:g=>{u(g)},children:[e.jsxs("div",{className:"github-extension-add-copy",children:[e.jsx("strong",{children:"Add a GitHub skill pack"}),e.jsx("span",{children:"Use a skills-CLI-compatible owner/repo or GitHub URL. OpenPond installs it locally without running setup code."})]}),e.jsxs("label",{children:[e.jsx("span",{children:"Repository"}),e.jsx("input",{disabled:!t||p!==null,placeholder:"owner/repo",value:h,onChange:g=>D(g.target.value)})]}),e.jsxs("label",{className:"github-extension-ref-input",children:[e.jsx("span",{children:"Branch, tag, or SHA"}),e.jsx("input",{disabled:!t||p!==null,placeholder:"Default branch",value:x,onChange:g=>F(g.target.value)})]}),e.jsxs("button",{className:"settings-secondary",disabled:!t||!h.trim()||p!==null,type:"submit",children:[p==="preview"?e.jsx(te,{className:"settings-spin",size:14}):e.jsx(ns,{size:14}),p==="preview"?"Checking":"Preview"]})]}),c||s.error?e.jsx("div",{className:"github-extension-message error",role:"alert",children:c??s.error}):null,j?e.jsxs("div",{className:"github-extension-preview",children:[e.jsxs("div",{children:[e.jsxs("strong",{children:[j.owner,"/",j.repo]}),e.jsxs("span",{children:[j.skills.length," skill",j.skills.length===1?"":"s"," at ",j.resolvedCommit.slice(0,12)]})]}),e.jsx("div",{className:"github-extension-preview-skills",children:j.skills.map(g=>e.jsx("span",{children:g.name},g.relativePath))}),e.jsxs("button",{className:"settings-secondary",disabled:p!==null,type:"button",onClick:()=>{C()},children:[p==="install"?e.jsx(te,{className:"settings-spin",size:14}):e.jsx(Ue,{size:14}),p==="install"?"Installing":"Install extension"]})]}):null,s.extensions.length?s.extensions.map(g=>{const S=p===`update:${g.id}`,v=p===`remove:${g.id}`;return e.jsxs("div",{className:"github-extension-row",children:[e.jsxs("button",{"aria-label":`Open ${g.owner}/${g.repo} extension source`,className:"github-extension-open",disabled:!t||p!==null,type:"button",onClick:()=>l(g),children:[e.jsx("span",{className:"native-skill-icon","aria-hidden":"true",children:e.jsx(ns,{size:17})}),e.jsxs("span",{className:"native-skill-identity",children:[e.jsxs("strong",{children:[g.owner,"/",g.repo]}),e.jsx("span",{children:g.skills.map(R=>R.name).join(", ")})]}),e.jsxs("span",{className:"native-skill-provider",children:[e.jsxs("strong",{children:[g.skills.length," skill",g.skills.length===1?"":"s"]}),e.jsxs("span",{children:[g.requestedRef," · ",g.resolvedCommit.slice(0,12)]})]}),e.jsx("span",{className:`native-skill-status ${g.validationStatus==="valid"?"":"invalid"}`,children:g.validationStatus==="valid"?"Ready":"Needs attention"}),e.jsx(Ps,{size:16,"aria-hidden":"true"})]}),e.jsxs("span",{className:"github-extension-row-actions",children:[e.jsx("button",{"aria-label":`Update ${g.owner}/${g.repo}`,className:"settings-icon-button ghost",disabled:p!==null,title:"Update extension",type:"button",onClick:()=>{k(g)},children:S?e.jsx(te,{className:"settings-spin",size:14}):e.jsx(re,{size:14})}),e.jsx("button",{"aria-label":`Remove ${g.owner}/${g.repo}`,className:"settings-icon-button ghost danger",disabled:p!==null,title:"Remove extension",type:"button",onClick:()=>{P(g)},children:v?e.jsx(te,{className:"settings-spin",size:14}):e.jsx(He,{size:14})})]})]},g.id)}):e.jsx("div",{className:"skills-settings-empty",children:"No third-party extensions installed."})]})}function qn({onOpenSkill:s,onOpenExtension:t,personalSkills:a,extensionCatalog:n,connection:l,onExtensionCatalog:r,onError:h,onToast:o}){return e.jsxs("section",{className:"account-settings skills-settings","aria-labelledby":"skills-settings-title",children:[e.jsx("header",{className:"skills-settings-header",children:e.jsxs("div",{children:[e.jsx("h1",{id:"skills-settings-title",children:"Skills"}),e.jsx("p",{children:"Install third-party GitHub packs, inspect personal Codex skills, and view instructions bundled with OpenPond."})]})}),e.jsx(Wn,{catalog:n,connection:l,onCatalog:r,onError:h,onOpenExtension:t,onToast:o}),e.jsxs("div",{className:"account-list native-skills-list",children:[e.jsxs("div",{className:"account-list-heading",children:[e.jsx("span",{children:"Personal Codex skills"}),e.jsx("small",{children:"Discovered from your local Codex skills folder"})]}),a.length?a.map(x=>e.jsxs("div",{className:"native-skill-row personal-skill-row",children:[e.jsx("span",{className:"native-skill-icon","aria-hidden":"true",children:e.jsx(Je,{size:17})}),e.jsxs("span",{className:"native-skill-identity",children:[e.jsx("strong",{children:x.name}),e.jsx("span",{children:x.description||"Packaged Codex skill"})]}),e.jsxs("span",{className:"native-skill-provider",children:[e.jsx("strong",{children:x.resourceFiles.length?`${x.resourceFiles.length} packaged resource${x.resourceFiles.length===1?"":"s"}`:"Instructions only"}),e.jsx("span",{children:x.sourcePath})]}),e.jsx("span",{className:`native-skill-status ${x.validationStatus==="valid"?"":"invalid"}`,children:x.validationStatus==="valid"?"Ready":"Needs attention"}),e.jsx("span",{"aria-hidden":"true"})]},x.sourcePath)):e.jsx("div",{className:"skills-settings-empty",children:"No personal Codex skills found."})]}),e.jsxs("div",{className:"account-list native-skills-list",children:[e.jsxs("div",{className:"account-list-heading",children:[e.jsx("span",{children:"App integration skills"}),e.jsx("small",{children:"Bundled with this OpenPond build"})]}),xt.map(x=>{const y=vt(x.provider)?.label??x.provider;return e.jsxs("button",{className:"native-skill-row",type:"button",onClick:()=>s(x),children:[e.jsx("span",{className:"native-skill-icon","aria-hidden":"true",children:e.jsx(Je,{size:17})}),e.jsxs("span",{className:"native-skill-identity",children:[e.jsx("strong",{children:x.name}),e.jsx("span",{children:x.description})]}),e.jsxs("span",{className:"native-skill-provider",children:[e.jsx("strong",{children:y}),e.jsx("span",{children:x.path})]}),e.jsx("span",{className:"native-skill-status",children:"Built in"}),e.jsx(Ps,{size:16,"aria-hidden":"true"})]},x.name)})]})]})}const es="default";function Vn({connection:s,embedded:t=!1,onError:a,onPreferences:n,preferences:l,providers:r}){const h=l.training,[o,x]=i.useState(qe(h.defaultModelRef)),[y,j]=i.useState(h.creationMode),[b,p]=i.useState(h.autoApproveEvidence),[d,c]=i.useState(!1),m=i.useMemo(()=>Ze(r,{includeUnavailable:!0}),[r]),N=i.useMemo(()=>m.map(w=>({provider:w,models:ke(w.value,r)})).filter(w=>w.models.length>0),[m,r]),f=Kn(o),u=jt(l.defaultChatProvider,l.defaultChatModel,r)?` · ${Hn(l.codexReasoningEffort)} reasoning`:"",C=Jn(f,h.defaultModelRef??null)&&y===h.creationMode&&b===h.autoApproveEvidence;i.useEffect(()=>{x(qe(h.defaultModelRef)),j(h.creationMode),p(h.autoApproveEvidence)},[l.defaultChatModel,l.defaultChatProvider,h.autoApproveEvidence,h.creationMode,h.defaultModelRef]);async function k(w){if(w.preventDefault(),!!s){c(!0),a(null);try{n(await T.savePreferences(s,{training:{defaultModelRef:f,creationMode:y,autoApproveEvidence:b}}))}catch(P){a(P instanceof Error?P.message:String(P))}finally{c(!1)}}}return e.jsxs("section",{className:`account-settings training-settings${t?" embedded":""}`,children:[t?null:e.jsx("h1",{children:"Training"}),e.jsxs("form",{className:"provider-settings-form",onSubmit:w=>{k(w)},children:[e.jsxs("div",{className:"account-list-heading",children:[e.jsx("span",{children:"Taskset authoring"}),e.jsx("small",{children:"The coding model that proposes tasks, graders, fixtures, and policy boundaries"})]}),e.jsx("div",{className:"provider-settings-grid single",children:e.jsxs("label",{className:"settings-select-field",children:[e.jsx("span",{children:"Authoring model"}),e.jsxs("select",{value:o,disabled:d,onChange:w=>x(w.target.value),children:[e.jsxs("option",{value:es,children:["Use chat default — ",ye(l.defaultChatProvider,r)," · ",Oe(l.defaultChatModel,r,l.defaultChatProvider),u]}),N.map(w=>e.jsx("optgroup",{label:w.provider.label,children:w.models.map(P=>e.jsx("option",{value:qe({providerId:w.provider.value,modelId:P.value}),children:P.label},P.value))},w.provider.value))]}),e.jsx("small",{children:"By default, /train follows the same provider, model, and reasoning level selected for chat."})]})}),e.jsxs("div",{className:"account-list-heading",children:[e.jsx("span",{children:"Default flow"}),e.jsx("small",{children:"Used by /train and Task Creator unless you choose another mode"})]}),e.jsx("div",{className:"provider-settings-grid single",children:e.jsxs("label",{className:"settings-select-field",children:[e.jsx("span",{children:"Task Creator mode"}),e.jsxs("select",{value:y,disabled:d,onChange:w=>j(w.target.value),children:[e.jsx("option",{value:"customize",children:"Guided plan — review and revise before materializing"}),e.jsx("option",{value:"defaults",children:"Fast draft — use reversible defaults"})]})]})}),e.jsxs("div",{className:"account-list-heading",children:[e.jsx("span",{children:"Evidence confirmation"}),e.jsx("small",{children:"Controls the first authoring gate; materialization and training remain separate"})]}),e.jsxs("label",{className:"settings-check-row",children:[e.jsx("input",{type:"checkbox",checked:b,disabled:d,onChange:w=>p(w.target.checked)}),e.jsxs("span",{children:[e.jsx("strong",{children:"Skip evidence confirmation"}),e.jsx("small",{children:"Immediately send excerpts from explicitly selected chats to the authoring model. This never approves Taskset materialization or training spend."})]})]}),e.jsx("button",{className:"settings-primary",disabled:d||C,children:e.jsx("span",{children:d?"Saving":"Save training settings"})})]}),e.jsxs("div",{className:"settings-footnote",children:[e.jsx("span",{children:"Authoring model"}),e.jsx("strong",{children:f?`${ye(f.providerId,r)} / ${Oe(f.modelId,r,f.providerId)}`:"Chat default"})]}),e.jsxs("div",{className:"settings-footnote",children:[e.jsx("span",{children:"Safety boundary"}),e.jsx("strong",{children:"Taskset and training approvals always required"})]})]})}function qe(s){return s?JSON.stringify([s.providerId,s.modelId]):es}function Kn(s){if(s===es)return null;try{const t=JSON.parse(s);return!Array.isArray(t)||t.length!==2||typeof t[0]!="string"||typeof t[1]!="string"?null:{providerId:t[0],modelId:t[1]}}catch{return null}}function Hn(s){return`${s.slice(0,1).toUpperCase()}${s.slice(1)}`}function Jn(s,t){return s?.providerId===t?.providerId&&s?.modelId===t?.modelId}function $s({disabled:s,onChange:t,purpose:a="model",storageRoots:n,value:l}){const r=i.useId(),[h,o]=i.useState(!1),x=bs(l),y=p=>a==="dataset"?p.datasetStorePath:p.modelStorePath,j=a==="dataset"?"Dataset":"Model",b=n.find(p=>bs(y(p))===x)??null;return e.jsxs("div",{className:"model-storage-picker",children:[e.jsxs("label",{className:"model-storage-label",htmlFor:r,children:[j," storage"]}),e.jsxs("div",{className:"model-storage-control-row",children:[e.jsxs("select",{"aria-label":`${j} storage drive`,className:"model-storage-select",disabled:s,id:r,title:l??`No ${a} storage configured`,value:l??"",onChange:p=>t(p.target.value||null),children:[e.jsx("option",{value:"",children:"Not configured"}),l&&!b?e.jsx("option",{value:l,children:"Manual location"}):null,n.map(p=>e.jsxs("option",{disabled:!p.mounted||!p.writable,title:y(p),value:y(p),children:[p.label," · ",Qn(p.kind)," · ",ea(p)]},p.id))]}),e.jsx("button",{className:"settings-icon-button model-storage-add",disabled:s,type:"button",title:"Add manual location","aria-label":`Add manual ${a} storage location`,onClick:()=>o(!0),children:e.jsx(Ue,{size:15})})]}),h?Yn(e.jsx(Zn,{initialPath:l??"",purpose:a,onClose:()=>o(!1),onUse:p=>{t(p),o(!1)}})):null]})}function Yn(s){return typeof document>"u"?s:Ot.createPortal(s,document.body)}function Zn({initialPath:s,onClose:t,onUse:a,purpose:n="model"}){const l=i.useId(),[r,h]=i.useState(s),o=Xn(r);i.useEffect(()=>{const y=j=>{j.key==="Escape"&&t()};return window.addEventListener("keydown",y),()=>window.removeEventListener("keydown",y)},[t]);function x(y){y.preventDefault(),y.stopPropagation(),!o&&a(r.trim())}return e.jsx("div",{className:"git-dialog-backdrop",role:"presentation",onMouseDown:y=>{y.target===y.currentTarget&&t()},children:e.jsxs("form",{className:"git-dialog model-storage-dialog",role:"dialog","aria-modal":"true","aria-labelledby":l,onSubmit:x,children:[e.jsx("button",{className:"git-dialog-close",type:"button",title:"Close","aria-label":`Close manual ${n} storage`,onClick:t,children:e.jsx(Le,{size:15})}),e.jsx("div",{className:"git-dialog-icon",children:e.jsx(bt,{size:18})}),e.jsxs("h2",{id:l,children:["Manual ",n," storage"]}),e.jsx("p",{children:"Enter an absolute path to a folder mounted on this machine."}),e.jsxs("label",{className:"git-dialog-field",children:[e.jsx("span",{children:"Mounted folder path"}),e.jsx("input",{autoFocus:!0,spellCheck:!1,value:r,placeholder:n==="dataset"?"/mnt/OpenPond/datasets":"/mnt/models or /run/user/…/gvfs/…",onChange:y=>h(y.target.value)})]}),e.jsx("div",{className:"model-storage-dialog-note",children:"For SMB, connect the share in Files or Finder first, then paste its mounted folder path. OpenPond uses your operating system’s existing connection and credentials."}),r.trim()&&o?e.jsx("div",{className:"profile-dialog-warning",children:o}):null,e.jsxs("div",{className:"git-dialog-footer",children:[e.jsx("button",{className:"git-dialog-secondary",type:"button",onClick:t,children:"Cancel"}),e.jsx("button",{className:"git-dialog-primary",disabled:!!o,type:"submit",children:"Use location"})]})]})})}function Xn(s){const t=s.trim();return t?/^[a-z][a-z\d+.-]*:\/\//i.test(t)?"Use the mounted folder path, not an smb:// or other network URL.":t==="~"||t.startsWith("~/")||t.startsWith("/")||t.startsWith("\\\\")||/^[a-z]:[\\/]/i.test(t)?null:"Enter an absolute mounted folder path.":"Enter a mounted folder path."}function Qn(s){return s==="network"?"Network":s==="removable"?"Removable":s==="cache"?"Cache":"Local"}function ea(s){return s.mounted?s.writable?`${sa(s.freeBytes)} free`:"Read only":"Not mounted"}function bs(s){const t=(s??"").trim().replace(/[\\/]+$/,"");return/^(?:[a-z]:[\\/]|\\\\)/i.test(t)?t.toLowerCase():t}function sa(s){if(s==null)return"Unknown";if(s<1024)return`${s} B`;const t=["KB","MB","GB","TB"];let a=s,n=-1;do a/=1024,n+=1;while(a>=1024&&n<t.length-1);return`${a>=10?a.toFixed(0):a.toFixed(1)} ${t[n]}`}function ta({state:s,busy:t,title:a="Compute",onScan:n,onSave:l,onDownloadSmolLm2:r,onCancelDownload:h}){const o=s?.inventory??null,[x,y]=i.useState(s?.settings.modelStorePath??null),[j,b]=i.useState(s?.settings.defaultDeviceIds[0]??"automatic");i.useEffect(()=>{y(s?.settings.modelStorePath??null)},[s?.settings.modelStorePath]),i.useEffect(()=>{b(s?.settings.defaultDeviceIds[0]??"automatic")},[s?.settings.defaultDeviceIds]);const p=x===(s?.settings.modelStorePath??null)&&j===(s?.settings.defaultDeviceIds[0]??"automatic"),d=i.useMemo(()=>o?.devices.filter(u=>u.kind!=="cpu"&&u.available)??[],[o?.devices]),c=o?.models.find(u=>u.modelId==="HuggingFaceTB/SmolLM2-135M-Instruct")??null,m=[...o?.downloads??[]].reverse().find(u=>u.modelId==="HuggingFaceTB/SmolLM2-135M-Instruct")??null,N=!!(m&&["queued","downloading","verifying","cancelling"].includes(m.status));async function f(u){u.preventDefault(),await l(x,s?.settings.datasetStorePath??null,j==="automatic"?[]:[j])}return e.jsxs("section",{className:"account-settings compute-settings",children:[e.jsxs("div",{className:"compute-title-row",children:[e.jsx("h1",{children:a}),e.jsx("button",{className:"settings-icon-button",type:"button",title:"Scan compute","aria-label":"Scan compute",disabled:t!==null,onClick:()=>{n()},children:e.jsx(re,{size:15,className:t==="scan"?"settings-spin":void 0})})]}),e.jsx("div",{className:"account-summary",children:e.jsx("div",{className:"account-summary-main compute-summary-main",children:e.jsxs("div",{children:[e.jsx("strong",{children:o?`${o.host.operatingSystem} · ${o.host.architecture}`:t==="load"?"Loading this machine":"This machine has not been scanned"}),e.jsx("small",{children:o?`${o.devices.length} device${o.devices.length===1?"":"s"} · ${we(o.host.totalMemoryBytes)} memory · scanned ${ia(o.scannedAt)}`:"Run a bounded native scan to discover local training capabilities."})]})})}),e.jsxs("form",{className:"provider-settings-form",onSubmit:u=>{f(u)},children:[e.jsx("div",{className:"account-list-heading",children:e.jsx("span",{children:"Defaults"})}),e.jsx($s,{disabled:t!==null,storageRoots:o?.storageRoots??[],value:x,onChange:y}),e.jsx("div",{className:"provider-settings-grid single compute-device-default",children:e.jsxs("label",{className:"settings-select-field",children:[e.jsx("span",{children:"Default device"}),e.jsxs("select",{value:j,disabled:t!==null,onChange:u=>b(u.target.value),children:[e.jsx("option",{value:"automatic",children:"Automatic"}),d.map(u=>e.jsx("option",{value:u.id,children:u.name},u.id))]})]})}),e.jsx("button",{className:"settings-primary",disabled:t!==null||p,children:t==="save"?"Saving":"Save compute settings"})]}),e.jsx(ys,{title:"Devices",empty:"No devices discovered",rows:(o?.devices??[]).map(u=>({id:u.id,title:u.name,detail:na(u),meta:u.available?"Available":u.unavailableReason??"Unavailable"}))}),e.jsx(ys,{title:"Runtimes",empty:"No runtimes discovered",rows:(o?.runtimes??[]).map(u=>({id:u.id,title:aa(u.kind),detail:u.version??u.detail??"Not installed",meta:u.state==="available"?"Available":"Unavailable"}))}),e.jsxs("div",{className:"account-list",children:[e.jsxs("div",{className:"account-list-heading",children:[e.jsx("span",{children:"Models"}),e.jsxs("div",{className:"compute-heading-actions",children:[N&&m?e.jsx("button",{type:"button",className:"settings-secondary",disabled:m.status==="cancelling",onClick:()=>{h(m.id)},children:m.status==="cancelling"?"Cancelling":"Cancel"}):c?null:e.jsx("button",{type:"button",className:"settings-secondary",disabled:!s?.settings.modelStorePath,onClick:()=>{r()},children:"Download SmolLM2"}),e.jsx("small",{children:o?.models.length??0})]})]}),m&&!c?e.jsxs("div",{className:"compute-download-row",children:[e.jsxs("div",{children:[e.jsx("strong",{children:"SmolLM2 135M Instruct"}),e.jsx("small",{children:m.status==="failed"?m.error:`${la(m.status)} · ${we(m.downloadedBytes)} of ${we(m.expectedBytes)} · Apache-2.0`})]}),e.jsx("progress",{max:m.expectedBytes,value:m.downloadedBytes})]}):null,o?.models.length?o.models.map(u=>e.jsxs("div",{className:"compute-row",children:[e.jsxs("div",{children:[e.jsx("strong",{children:u.name}),e.jsxs("small",{children:[u.source," · ",u.format," · ",we(u.sizeBytes)]})]}),e.jsx("span",{children:u.trainingCompatible?"Trainable":u.inferenceCompatible?"Inference only":"Unsupported"})]},u.id)):m?null:e.jsx("div",{className:"empty-account-list",children:e.jsx("span",{children:"No recognized local models"})})]}),o?.warnings.length?e.jsxs("details",{className:"compute-diagnostics",children:[e.jsx("summary",{children:"Diagnostics"}),e.jsx("ul",{children:o.warnings.map(u=>e.jsx("li",{children:u},u))})]}):null]})}function ys({title:s,empty:t,rows:a}){return e.jsxs("div",{className:"account-list",children:[e.jsxs("div",{className:"account-list-heading",children:[e.jsx("span",{children:s}),e.jsx("small",{children:a.length})]}),a.length?a.map(n=>e.jsxs("div",{className:"compute-row",children:[e.jsxs("div",{children:[e.jsx("strong",{children:n.title}),e.jsx("small",{children:n.detail})]}),e.jsx("span",{children:n.meta})]},n.id)):e.jsx("div",{className:"empty-account-list",children:e.jsx("span",{children:t})})]})}function na(s){return[s.vendor,s.kind,s.totalMemoryBytes?we(s.totalMemoryBytes):null,s.computeCapability?`compute ${s.computeCapability}`:null].filter(Boolean).join(" · ")}function aa(s){return s==="trl_peft"?"TRL / PEFT":s.toUpperCase()}function la(s){return s.replaceAll("_"," ").replace(/^./,t=>t.toUpperCase())}function ia(s){const t=new Date(s);return Number.isNaN(t.valueOf())?s:t.toLocaleString()}function we(s){if(s==null)return"Unknown";if(s<1024)return`${s} B`;const t=["KB","MB","GB","TB"];let a=s,n=-1;do a/=1024,n+=1;while(a>=1024&&n<t.length-1);return`${a>=10?a.toFixed(0):a.toFixed(1)} ${t[n]}`}function ra({state:s,catalog:t,busy:a,catalogLoading:n,onRefresh:l,onSave:r}){const[h,o]=i.useState(s?.settings.datasetStorePath??null);i.useEffect(()=>{o(s?.settings.datasetStorePath??null)},[s?.settings.datasetStorePath]);const x=i.useMemo(()=>s?.inventory?.storageRoots.find(p=>Ns(p.datasetStorePath)===Ns(h))??null,[h,s?.inventory?.storageRoots]),y=h===(s?.settings.datasetStorePath??null),j=t?.datasets??[];async function b(p){p.preventDefault(),await r(h)}return e.jsxs("section",{className:"account-settings compute-settings dataset-storage-settings",children:[e.jsxs("div",{className:"compute-title-row",children:[e.jsxs("div",{children:[e.jsx("h1",{children:"Dataset Storage"}),e.jsx("p",{className:"dataset-storage-intro",children:"Choose where Dataset artifacts are saved and review registered Datasets without loading their rows."})]}),e.jsx("button",{"aria-label":"Refresh Dataset storage",className:"settings-icon-button",disabled:a!==null||n,onClick:()=>{l()},title:"Refresh Dataset storage",type:"button",children:e.jsx(re,{className:n?"settings-spin":void 0,size:15})})]}),e.jsx("div",{className:"account-summary",children:e.jsx("div",{className:"account-summary-main compute-summary-main",children:e.jsxs("div",{children:[e.jsx("strong",{children:x?.label??(h?"Manual location":"Not configured")}),e.jsx("small",{children:h??"Choose a writable local or mounted location before importing a Dataset."}),x?e.jsxs("small",{children:[ua(x.kind)," · ",x.freeBytes==null?"Free space unknown":`${zs(x.freeBytes)} free`]}):null]})})}),e.jsxs("form",{className:"provider-settings-form",onSubmit:p=>{b(p)},children:[e.jsx("div",{className:"account-list-heading",children:e.jsx("span",{children:"Location"})}),e.jsx($s,{disabled:a!==null,onChange:o,purpose:"dataset",storageRoots:s?.inventory?.storageRoots??[],value:h}),e.jsx("button",{className:"settings-primary",disabled:a!==null||y,children:a==="save"?"Saving":"Save Dataset storage"})]}),e.jsxs("div",{className:"account-list dataset-storage-list",children:[e.jsxs("div",{className:"account-list-heading",children:[e.jsx("span",{children:"Registered Datasets"}),e.jsx("small",{children:j.length})]}),j.length?j.map(p=>e.jsx(oa,{dataset:p},p.tasksetId)):e.jsx("div",{className:"empty-account-list",children:e.jsx("span",{children:n?"Loading registered Datasets":"No registered Datasets"})})]})]})}function oa({dataset:s}){const t=s.storageKind==="parquet"?"Parquet":"Inline Taskset";return e.jsxs("div",{className:"compute-row dataset-storage-row",children:[e.jsxs("div",{children:[e.jsx("strong",{children:s.name}),e.jsxs("small",{children:[Bs(s.rowCount)," rows"," · ",ca(s)," · ",t," · ",s.sizeBytes==null?"Size unavailable":zs(s.sizeBytes)]}),!s.available&&s.unavailableReason?e.jsx("small",{className:"dataset-storage-error",children:s.unavailableReason}):null]}),e.jsx("span",{children:s.available?da(s.status):"Unavailable"})]})}function ca(s){return[["train",s.splitCounts.train],["validation",s.splitCounts.validation],["test",s.splitCounts.test],["frozen eval",s.splitCounts.frozen_eval]].filter(([,a])=>Number(a)>0).map(([a,n])=>`${Bs(Number(n))} ${a}`).join(" · ")||"No split rows"}function zs(s){if(s<1024)return`${s} B`;const t=["KB","MB","GB","TB"];let a=s,n=-1;do a/=1024,n+=1;while(a>=1024&&n<t.length-1);return`${a>=10?a.toFixed(0):a.toFixed(1)} ${t[n]}`}function Bs(s){return new Intl.NumberFormat().format(s)}function Ns(s){return s?.replace(/[\\/]+$/,"")??""}function da(s){return s.replaceAll("_"," ").replace(/^./,t=>t.toUpperCase())}function ua(s){return s.replace(/^./,t=>t.toUpperCase())}function ha({payload:s}){const t=s?.account??null,a=t?.profile??null,n=t?.products??[],l=t?.balance?.breakdown??[],r=t?.state==="signed_in"?t?.label??t?.activeProfile?.handle??"OpenPond account":"Not signed in",h=a?.turnkeyOperatingWalletAddress??null,o=n.length>0?n.map(b=>b.name).join(", "):"None",x=[{label:"Personal wallet",address:a?.turnkeyWalletAddress??null},{label:"Operating wallet",address:h}],y=t?.state??"loading",j=y==="signed_in"?"active":void 0;return e.jsxs("section",{className:"wallet-view","aria-label":"Wallet",children:[e.jsxs("div",{className:"wallet-credit-card",children:[e.jsxs("div",{className:"wallet-card-top",children:[e.jsxs("div",{className:"wallet-card-brand",children:[e.jsx(Is,{size:18}),e.jsx("span",{children:"OpenPond"})]}),e.jsx(Ae,{state:y,label:j})]}),e.jsxs("div",{className:"wallet-card-balance",children:[e.jsx("span",{children:"Balance"}),e.jsx("strong",{children:t?.balanceLabel??"$0.00"}),e.jsx(ma,{address:h})]}),e.jsxs("div",{className:"wallet-card-bottom",children:[e.jsxs("div",{children:[e.jsx("span",{children:"Account"}),e.jsx("strong",{children:r})]}),e.jsxs("div",{className:"wallet-card-products",children:[e.jsx("span",{children:"Products"}),e.jsx("strong",{title:o,children:o})]})]})]}),e.jsxs("div",{className:"wallet-content-grid",children:[e.jsxs("section",{className:"wallet-panel",children:[e.jsx("div",{className:"wallet-panel-header",children:e.jsx("div",{children:e.jsx("span",{children:"Assets"})})}),e.jsx("div",{className:"wallet-asset-list",children:l.length>0?l.map(b=>e.jsx(pa,{asset:b},`${b.wallet}-${b.chain}-${b.asset}`)):e.jsx("div",{className:"wallet-asset-row empty",children:e.jsxs("div",{children:[e.jsx("strong",{children:"No assets found"}),e.jsx("span",{children:"Refresh after funding the operating wallet."})]})})})]}),e.jsx("div",{className:"wallet-side-stack",children:e.jsxs("section",{className:"wallet-panel",children:[e.jsx("div",{className:"wallet-panel-header",children:e.jsx("div",{children:e.jsx("span",{children:"Wallets"})})}),e.jsx("div",{className:"wallet-address-list",children:x.map(b=>e.jsx(ga,{label:b.label,address:b.address},b.label))})]})})]})]})}function ma({address:s}){const t=s?.trim()||null;return e.jsxs("div",{className:`wallet-card-address ${t?"":"empty"}`,children:[e.jsx("span",{children:"Operating wallet"}),e.jsxs("div",{children:[e.jsx("code",{children:t??"Not available"}),e.jsx("button",{type:"button",className:"wallet-copy-button ghost",title:"Copy operating wallet","aria-label":"Copy operating wallet",disabled:!t,onClick:()=>{t&&ce(t)},children:e.jsx(Ms,{size:12})})]})]})}function ga({label:s,address:t}){const a=t?.trim()||null;return e.jsx("div",{className:`wallet-address-row ${a?"":"empty"}`,children:e.jsxs("div",{children:[e.jsx("span",{children:s}),e.jsxs("div",{className:"wallet-address-line",children:[e.jsx("code",{children:a??"Not available"}),e.jsx("button",{type:"button",className:"wallet-copy-button ghost",title:`Copy ${s}`,"aria-label":`Copy ${s}`,disabled:!a,onClick:()=>{a&&ce(a)},children:e.jsx(Ms,{size:12})})]})]})})}function pa({asset:s}){const t=xa(s.amount,s.asset),a=va(s.usdValue),n=fa(s.asset);return e.jsxs("div",{className:"wallet-asset-row",children:[e.jsxs("div",{className:"wallet-asset-identity",children:[n?e.jsx("img",{src:n,alt:""}):e.jsx("span",{className:"wallet-token-fallback",children:s.asset.slice(0,1)}),e.jsx("strong",{children:s.asset}),e.jsx("span",{children:s.chain})]}),e.jsxs("div",{className:"wallet-asset-values",children:[e.jsx("strong",{children:t}),e.jsx("span",{children:a})]})]})}function fa(s){switch(s.trim().toUpperCase()){case"ETH":return as.ETH;case"USDC":return as.USDC;default:return null}}function xa(s,t){if(!s)return`0 ${t}`;const a=Number(s);return Number.isFinite(a)?`${new Intl.NumberFormat("en-US",{maximumFractionDigits:a>=1?4:8}).format(a)} ${t}`:`${s} ${t}`}function va(s){if(s===null)return"$0.00";const t=typeof s=="number"?s:Number(s);return Number.isFinite(t)?new Intl.NumberFormat("en-US",{style:"currency",currency:"USD",minimumFractionDigits:2,maximumFractionDigits:2}).format(t):"$0.00"}function ja({connection:s,onError:t,onPayload:a}){const[n,l]=i.useState(""),[r,h]=i.useState(!1),[o,x]=i.useState(!1);i.useEffect(()=>{s||l("")},[s]);async function y(d,c){if(s){h(!0),t(null);try{const m=await T.switchOpenPondAccount(s,{handle:d,baseUrl:c??null}),N=await T.savePreferences(s,{defaultTeamId:null});a({...m,preferences:N.preferences})}catch(m){t(m instanceof Error?m.message:String(m))}finally{h(!1)}}}async function j(d){if(d.preventDefault(),!(!s||!n.trim())){h(!0),t(null);try{const c=await T.saveOpenPondAccount(s,{apiKey:n.trim(),setActive:!0}),m=await T.savePreferences(s,{defaultTeamId:null});a({...c,preferences:m.preferences}),l("")}catch(c){t(c instanceof Error?c.message:String(c))}finally{h(!1)}}}async function b(d){if(!(!s||!d.apiKey.trim())){h(!0),t(null);try{const c=d.handle?.trim(),m=d.environment?.trim(),N=await T.saveOpenPondAccount(s,{apiKey:d.apiKey.trim(),handle:c||void 0,baseUrl:d.baseUrl,apiBaseUrl:d.apiBaseUrl,environment:m||"custom",setActive:!0}),f=await T.savePreferences(s,{defaultTeamId:null});a({...N,preferences:f.preferences}),l("")}catch(c){throw t(c instanceof Error?c.message:String(c)),c}finally{h(!1)}}}async function p(){if(s){x(!0),t(null);try{a(await T.refreshOpenPondAccounts(s))}catch(d){t(d instanceof Error?d.message:String(d))}finally{x(!1)}}}return{apiKey:n,refreshingAccounts:o,saving:r,refreshAccounts:p,saveAccount:j,saveEnvironmentAccount:b,setApiKey:l,switchAccount:y}}function ba({connection:s,onError:t,onPreferences:a,preferences:n,providers:l}){const[r,h]=i.useState(n.defaultBranchPrefix),[o,x]=i.useState(n.defaultNewProjectDirectory),[y,j]=i.useState(n.goalStorageLocation),[b,p]=i.useState(n.advancedWorkspaceControls),[d,c]=i.useState(n.contextCompaction.autoEnabled),[m,N]=i.useState(n.insightsEnabled),[f,u]=i.useState(!n.insightsModelRef),[C,k]=i.useState(n.insightsModelRef?.providerId??n.defaultChatProvider),[w,P]=i.useState(n.insightsModelRef?.modelId??n.defaultChatModel),[D,F]=i.useState(n.insightsEvidenceSources),[g,S]=i.useState(n.subagents.enabled),[v,R]=i.useState(n.subagents.delegationMode),[A,L]=i.useState(!n.subagents.defaultModelRef),[G,q]=i.useState(n.subagents.defaultModelRef?.providerId??n.defaultChatProvider),[K,M]=i.useState(n.subagents.defaultModelRef?.modelId??n.defaultChatModel),[U,H]=i.useState(n.subagents.roles),[Q,ne]=i.useState(n.subagents.maxConcurrentRuns),[J,V]=i.useState(n.subagents.maxConcurrentRunsPerProvider),[E,B]=i.useState(n.subagents.maxConcurrentRunsPerWorkspaceTarget),[ee,le]=i.useState(!1),ge=A?null:{providerId:G,modelId:K.trim()},pe=g!==n.subagents.enabled||v!==n.subagents.delegationMode||!ya(ge,n.subagents.defaultModelRef)||Q!==n.subagents.maxConcurrentRuns||J!==n.subagents.maxConcurrentRunsPerProvider||E!==n.subagents.maxConcurrentRunsPerWorkspaceTarget||JSON.stringify(U)!==JSON.stringify(n.subagents.roles);i.useEffect(()=>{h(n.defaultBranchPrefix),x(n.defaultNewProjectDirectory),j(n.goalStorageLocation),p(n.advancedWorkspaceControls),c(n.contextCompaction.autoEnabled),N(n.insightsEnabled),u(!n.insightsModelRef),k(n.insightsModelRef?.providerId??n.defaultChatProvider),P(n.insightsModelRef?.modelId??n.defaultChatModel),F(n.insightsEvidenceSources),S(n.subagents.enabled),R(n.subagents.delegationMode),L(!n.subagents.defaultModelRef),q(n.subagents.defaultModelRef?.providerId??n.defaultChatProvider),M(n.subagents.defaultModelRef?.modelId??n.defaultChatModel),H(n.subagents.roles),ne(n.subagents.maxConcurrentRuns),V(n.subagents.maxConcurrentRunsPerProvider),B(n.subagents.maxConcurrentRunsPerWorkspaceTarget)},[n.defaultChatProvider,n.defaultChatModel,n.defaultBranchPrefix,n.defaultNewProjectDirectory,n.goalStorageLocation,n.advancedWorkspaceControls,n.contextCompaction.autoEnabled,n.insightsEnabled,n.insightsModelRef,n.insightsEvidenceSources,n.subagents]);function he(O){k(O),P($=>Te(O,$,l))}function fe(O){q(O),M($=>Te(O,$,l))}function xe(){return A?n.defaultChatProvider:G}function ve(){return A?n.defaultChatModel:K}function Y(O,$){H(_=>_.map(ae=>ae.id===O?$(ae):ae))}function je(O,$){Y(O,_=>({..._,enabled:$}))}function z(O,$){Y(O,_=>({..._,background:$}))}function Z(O,$){Y(O,_=>{if($)return{..._,modelRef:null};const ae=_.modelRef?.providerId??xe(),be=_.modelRef?.modelId??ve();return{..._,modelRef:Ie(ae,be,l)??null}})}function ss(O,$){Y(O,_=>({..._,modelRef:Ie($,_.modelRef?.modelId??ve(),l)??null}))}function $e(O,$){Y(O,_=>{const ae=_.modelRef?.providerId??xe(),be=$.trim();return{..._,modelRef:be?{providerId:ae,modelId:be}:null}})}function Ne(O,$){Y(O,_=>({..._,isolationMode:$}))}function ze(O,$){Y(O,_=>({..._,toolPolicy:$}))}function Be(O,$){Y(O,_=>({..._,peerMessages:$}))}function _e(O,$){Y(O,_=>({..._,maxConcurrentRuns:me($,1,16)}))}async function Pe(){let O=null;if(window.openpond?.selectFolder){const $=await window.openpond.selectFolder();if($.canceled)return;O=$.path}else O=window.prompt("Default new project directory",o);O?.trim()&&x(O.trim())}async function Re(O){if(O.preventDefault(),!!s){le(!0),t(null);try{a(await T.savePreferences(s,{defaultBranchPrefix:Ve(r),defaultNewProjectDirectory:o.trim(),goalStorageLocation:y,advancedWorkspaceControls:b,contextCompaction:{...n.contextCompaction,autoEnabled:d},insightsEnabled:m,insightsModelRef:f?null:Ie(C,w,l)??null,insightsEvidenceSources:D,subagents:{enabled:g,workspaceDefaultsVersion:n.subagents.workspaceDefaultsVersion,toolDefaultsVersion:n.subagents.toolDefaultsVersion,delegationMode:v,defaultModelRef:A?null:Ie(G,K,l)??null,roles:U,maxConcurrentRuns:me(Q,1,32),maxConcurrentRunsPerProvider:J===null?null:me(J,1,32),maxConcurrentRunsPerWorkspaceTarget:E===null?null:me(E,1,32)}}))}catch($){t($ instanceof Error?$.message:String($))}finally{le(!1)}}}return{advancedWorkspaceControls:b,contextCompactionAutoEnabled:d,defaultBranchPrefix:r,defaultNewProjectDirectory:o,goalStorageLocation:y,insightsEnabled:m,insightsUseDefaultModel:f,insightsProvider:C,insightsModel:w,insightsEvidenceSources:D,subagentsEnabled:g,subagentDelegationMode:v,subagentsUseDefaultModel:A,subagentsProvider:G,subagentsModel:K,subagentRoles:U,subagentsMaxConcurrentRuns:Q,subagentsMaxConcurrentRunsPerProvider:J,subagentsMaxConcurrentRunsPerWorkspaceTarget:E,subagentsDirty:pe,saving:ee,chooseDefaultProjectDirectory:Pe,saveDefaults:Re,changeInsightsProvider:he,changeSubagentsProvider:fe,changeSubagentRoleProvider:ss,setAdvancedWorkspaceControls:p,setContextCompactionAutoEnabled:c,setDefaultBranchPrefix:h,setDefaultNewProjectDirectory:x,setGoalStorageLocation:j,setInsightsEnabled:N,setInsightsUseDefaultModel:u,setInsightsModel:P,setSubagentsUseDefaultModel:L,setSubagentsModel:M,setInsightsEvidenceSourceEnabled:(O,$)=>F(_=>({..._,[O]:$})),setSubagentsEnabled:S,setSubagentDelegationMode:O=>R(O),setSubagentsMaxConcurrentRuns:O=>ne(me(O,1,32)),setSubagentsMaxConcurrentRunsPerProvider:O=>V(O===null?null:me(O,1,32)),setSubagentsMaxConcurrentRunsPerWorkspaceTarget:O=>B(O===null?null:me(O,1,32)),setSubagentRoleBackground:z,setSubagentRoleEnabled:je,setSubagentRoleIsolationMode:Ne,setSubagentRoleMaxConcurrentRuns:_e,setSubagentRoleModel:$e,setSubagentRolePeerMessages:Be,setSubagentRoleToolPolicy:ze,setSubagentRoleUseDefaultModel:Z}}function me(s,t,a){return Number.isFinite(s)?Math.min(a,Math.max(t,Math.trunc(s))):t}function ya(s,t){return(s?.providerId??null)===(t?.providerId??null)&&(s?.modelId??null)===(t?.modelId??null)}const Na=15e3,Sa=100,wa=100,Ca=2500;function ka({onError:s,section:t}){const[a,n]=i.useState(null),[l,r]=i.useState(null),[h,o]=i.useState(Sa),[x,y]=i.useState([]),[j,b]=i.useState(null),[p,d]=i.useState(!0),c=i.useRef(null),[m,N]=i.useState(null),f=!!(window.openpond?.openLogsFolder||window.openpond?.readRecentLogs||window.openpond?.copyRecentLogs||window.openpond?.exportDiagnostics),C=!!window.openpond?.readRecentLogs?`${x.length} of ${h} line${h===1?"":"s"}${p?" tailing":""}`:"Unavailable";i.useEffect(()=>{t==="diagnostics"&&k(h,"refresh",{quiet:!0})},[t]),i.useEffect(()=>{if(t!=="diagnostics"||!p||!window.openpond?.readRecentLogs)return;let S=!1;const v=window.setInterval(()=>{S||(S=!0,k(h,"refresh",{quiet:!0}).finally(()=>{S=!1}))},Ca);return()=>window.clearInterval(v)},[t,p,h]),i.useEffect(()=>{if(t!=="diagnostics"||!p)return;const S=c.current;S&&(S.scrollTop=S.scrollHeight)},[t,p,x]);async function k(S=h,v="refresh",R={}){const A=window.openpond?.readRecentLogs;if(!A){const L="Log view is not available in this runtime.";R.quiet||(N({label:"Logs",value:L,warning:!0}),s(L));return}R.quiet||r(v);try{const L=await De(A(S),"Read logs");if(!L.ok)throw new Error(L.error);o(L.lineLimit),b(L.logDir),y(L.lines),R.quiet?N(G=>G?.label==="Logs"?null:G):N(null)}catch(L){const G=L instanceof Error?L.message:String(L);N({label:"Logs",value:G,warning:!0}),R.quiet||s(G)}finally{R.quiet||r(null)}}function w(){d(!1),k(h+wa,"older")}function P(){const S=!p;d(S),S&&k(h,"refresh",{quiet:!0})}async function D(){const S=window.openpond?.openLogsFolder;if(!S){const v="Desktop logs are not available in this runtime.";N({label:"Logs",value:v,warning:!0}),s(v);return}n("logs"),s(null);try{const v=await De(S(),"Open logs");if(!v.ok)throw new Error(v.error??"Could not open the logs folder.");N(null)}catch(v){const R=v instanceof Error?v.message:String(v);N({label:"Logs",value:R,warning:!0}),s(R)}finally{n(null)}}async function F(){const S=window.openpond?.copyRecentLogs;if(!S){const v="Recent log copy is not available in this runtime.";N({label:"Copy",value:v,warning:!0}),s(v);return}n("copy"),s(null);try{const v=await De(S(1e3),"Copy recent logs");if(!v.ok)throw new Error(v.error??"Could not copy recent logs.");N({label:"Copy",value:v.lines?`Copied ${v.lines} recent log lines.`:"Copied recent logs."})}catch(v){const R=v instanceof Error?v.message:String(v);N({label:"Copy",value:R,warning:!0}),s(R)}finally{n(null)}}async function g(){const S=window.openpond?.exportDiagnostics;if(!S){const v="Diagnostics export is not available in this runtime.";N({label:"Export",value:v,warning:!0}),s(v);return}n("export"),s(null);try{const v=await De(S(),"Export diagnostics");if(!v.ok)throw new Error(v.error??"Could not export diagnostics.");N({label:"Export",value:v.path?`Saved to ${v.path}`:"Diagnostics exported."})}catch(v){const R=v instanceof Error?v.message:String(v);N({label:"Export",value:R,warning:!0}),s(R)}finally{n(null)}}return{diagnosticsAvailable:f,diagnosticsBusy:a,diagnosticsStatus:m,logDir:j,logLineLimit:h,logLines:x,logViewBusy:l,logViewSummary:C,logViewportRef:c,tailLogs:p,copyRecentLogs:F,exportDiagnosticsBundle:g,loadOlderLogs:w,openLogsFolder:D,refreshLogView:k,toggleTailLogs:P}}async function De(s,t){let a;try{return await Promise.race([s,new Promise((n,l)=>{a=window.setTimeout(()=>{l(new Error(`${t} did not receive a desktop response.`))},Na)})])}finally{a!==void 0&&window.clearTimeout(a)}}function Pa({connection:s,enabled:t,onError:a,onPreferences:n,onToast:l,preferences:r}){const[h,o]=i.useState(r.editor),[x,y]=i.useState(null),[j,b]=i.useState(!1),[p,d]=i.useState(!1),[c,m]=i.useState(!1);i.useEffect(()=>{o(r.editor)},[r.editor]);const N=i.useCallback(async()=>{if(s){d(!0);try{y(await T.workspaceLspSettingsStatus(s))}catch(w){a(w instanceof Error?w.message:String(w))}finally{d(!1)}}},[s,a]);i.useEffect(()=>{!t||!s||N()},[s,t,N]);function f(w,P){o(D=>({...D,languages:{...D.languages,[w]:{...D.languages[w],mode:P}}}))}function u(w,P){o(D=>({...D,languages:{...D.languages,[w]:{...D.languages[w],customCommand:P}}}))}async function C(w){if(w.preventDefault(),!!s){b(!0),a(null);try{const P=await T.savePreferences(s,{editor:h});n(P),y(await T.workspaceLspSettingsStatus(s))}catch(P){a(P instanceof Error?P.message:String(P))}finally{b(!1)}}}async function k(){if(s){m(!0),a(null);try{await T.restartWorkspaceLsp(s),y(await T.workspaceLspSettingsStatus(s)),l?.("Language servers restarted.","success")}catch(w){a(w instanceof Error?w.message:String(w))}finally{m(!1)}}}return{editorPreferences:h,lspStatus:x,restarting:c,saving:j,statusLoading:p,refreshLspStatus:N,restartLanguageServers:k,saveEditorSettings:C,setEditorPreferences:o,setLanguageCustomCommand:u,setLanguageMode:f}}function Ra({connection:s,onError:t,onPayload:a,personalization:n}){const l=i.useMemo(()=>n.templates.map(g=>({value:g.id,label:g.name,description:g.id===n.activeTemplateId?"Selected":g.source==="built_in"?g.description:void 0})),[n.activeTemplateId,n.templates]),[r,h]=i.useState(n.activeTemplateId),[o,x]=i.useState(n.soul),[y,j]=i.useState(""),[b,p]=i.useState(!1),[d,c]=i.useState(!1),m=n.templates.find(g=>g.id===r)??n.templates[0],N=m?.source==="custom",f=m?o!==m.content:!0,u=r!==n.activeTemplateId||o!==n.soul||f,C=!!(N&&o.trim()&&m&&u);i.useEffect(()=>{h(n.activeTemplateId),x(n.soul);const g=n.templates.find(S=>S.id===n.activeTemplateId);j(g?`${g.name} Copy`:""),p(!1)},[n.activeTemplateId,n.soul,n.templates]);async function k(g=!1){if(!g&&!N)return;const S=g?y:m?.name;if(!(!s||!o.trim()||!S?.trim())){c(!0),t(null);try{a(await T.savePersonalization(s,{activeTemplateId:r,templateName:S,soul:o,saveAsNew:g})),p(!1)}catch(v){t(v instanceof Error?v.message:String(v))}finally{c(!1)}}}async function w(g){const S=n.templates.find(v=>v.id===g);if(S&&(h(S.id),j(`${S.name} Copy`),x(S.content),p(!1),!!s)){c(!0),t(null);try{a(await T.savePersonalization(s,{activeTemplateId:S.id,templateName:S.name,soul:S.content,saveAsNew:!1}))}catch(v){t(v instanceof Error?v.message:String(v))}finally{c(!1)}}}function P(){m&&(j(`${m.name} Copy`),x(m.content),p(!1))}function D(g){x(g),m&&!N&&g!==m.content&&p(!0)}function F(){m&&(j(`${m.name} Copy`),p(!0))}return{canSaveCurrentTemplate:C,personalizationTemplateId:r,personalizationTemplateOptions:l,saveAsNewOpen:b,saving:d,selectedPersonalizationTemplate:m,selectedTemplateIsCustom:N,soulDraft:o,templateNameDraft:y,changePersonalizationTemplate:w,changeSoulDraft:D,openSaveAsNew:F,resetPersonalizationDraft:P,savePersonalization:k,setSaveAsNewOpen:p,setTemplateNameDraft:j}}function Ia({connection:s,onError:t,onPreferences:a,onProviders:n,preferences:l,providers:r}){const[h,o]=i.useState(l.defaultChatProvider),[x,y]=i.useState(l.defaultChatModel),[j,b]=i.useState(!1),[p,d]=i.useState(null),[c,m]=i.useState(null);i.useEffect(()=>{o(l.defaultChatProvider),y(l.defaultChatModel)},[l.defaultChatProvider,l.defaultChatModel]);async function N(v){if(v.preventDefault(),!!s){b(!0),t(null);try{a(await T.savePreferences(s,{defaultChatProvider:h,defaultChatModel:Te(h,x,r)}))}catch(R){t(R instanceof Error?R.message:String(R))}finally{b(!1)}}}function f(v){o(v),y(R=>Te(v,R,r))}async function u(v,R,A){if(!s)return null;d(`${v}:${R}`),m(null),t(null);try{return await A()}catch(L){return t(L instanceof Error?L.message:String(L)),null}finally{d(null)}}async function C(v,R){await u(v,"config",async()=>{const A=await T.saveProviderSettings(s,{providers:{[v]:R}});return n(A),A})}async function k(v,R){await u(v,"credential",async()=>{const A=await T.saveProviderCredential(s,v,R);return n(A),A})}async function w(v){await u(v,"credential",async()=>{const R=await T.deleteProviderCredential(s,v,{});return n(R),R})}async function P(v){return u("openai","credential",async()=>{const R=await T.startOpenAiSubscriptionAuth(s,{method:v});return R.method==="browser"?(window.open(R.url,"_blank","noopener,noreferrer"),m("OpenAI ChatGPT login opened in your browser. Return here after authorization.")):(window.open(R.url,"_blank","noopener,noreferrer"),m(`OpenAI device login started. Enter code ${R.userCode}.`)),D(R.expiresAt),R})}async function D(v){if(s)for(;Date.now()<v;){await new Promise(R=>setTimeout(R,2500));try{const R=await T.providerSettings(s);n(R);const A=R.statuses.openai?.credential;if(A?.connected&&A.source==="chatgpt_subscription"){m("OpenAI ChatGPT subscription connected.");return}}catch{}}}async function F(v){await u(v,"models",async()=>{const R=await T.refreshProviderModels(s,v,{force:!0});return n(R.providers),R})}async function g(v){await u(v,"models",async()=>{const R=await T.loadProviderModels(s,v,{limit:500});return n(R.providers),R})}async function S(v,R={}){await u(v,"validate",async()=>{const A=await T.validateProviderCredential(s,v,R);return m(A.ok?`${v} validated${A.modelId?` with ${A.modelId}`:""}.`:A.errors.join(`
|
|
6
|
+
`)||`${v} validation failed.`),n(A.providers),A})}return{defaultModel:x,defaultProvider:h,providerBusy:p,saving:j,validationMessage:c,changeDefaultProvider:f,deleteProviderCredential:w,loadProviderModels:g,refreshProviderModels:F,saveProviderConfig:C,saveProviderCredential:k,saveProviders:N,setDefaultModel:y,startOpenAiSubscriptionAuth:P,validateProvider:S}}function Ma({connection:s,enabled:t,onError:a,onToast:n}){const[l,r]=i.useState(null),[h,o]=i.useState(null),[x,y]=i.useState(!1),j=i.useRef(null),b=i.useCallback(async(P={})=>{if(s){P.quiet||o("refresh");try{const D=await T.remoteAccess(s);r(D),a(null)}catch(D){a(D instanceof Error?D.message:String(D))}finally{P.quiet||o(null)}}},[s,a]);i.useEffect(()=>{!t||!s||b({quiet:!0})},[s,t,b]),i.useEffect(()=>()=>{j.current!==null&&window.clearTimeout(j.current)},[]);function p(){j.current!==null&&window.clearTimeout(j.current),y(!1),window.setTimeout(()=>{y(!0),j.current=window.setTimeout(()=>{y(!1),j.current=null},1500)},0)}async function d(){if(a(null),!!s)try{r(await T.remoteAccess(s))}catch{}}async function c(){if(!s)return null;l&&!l.tailscale.running&&p(),o("enable");try{const P=await T.enableRemoteAccess(s);return r(P.status),a(null),P.status.tailscale.running?!P.status.serve.enabled&&P.status.serve.error&&n?.(P.status.serve.setupUrl?"Tailscale Serve needs to be enabled for this tailnet. Copy the Enable Serve link.":P.message||P.status.serve.error,"error"):(p(),n?.(P.message||"Tailscale is not running. Run Tailscale up first.","error")),P.status}catch{return await d(),p(),n?.("Unable to turn on remote access. Run Tailscale up first.","error"),null}finally{o(null)}}async function m(){if(s&&window.confirm("Turn off remote access? This runs tailscale serve reset and clears Tailscale Serve config on this device.")){o("disable");try{const P=await T.disableRemoteAccess(s);r(P.status),a(null)}catch{await d()}finally{o(null)}}}async function N(){l?.remoteWebUrl&&(o("copy-link"),await ce(l.remoteWebUrl),o(null))}async function f(){l?.serveCommand&&(o("copy-command"),await ce(l.serveCommand),o(null))}async function u(){l?.serve.setupUrl&&(o("copy-serve-setup"),await ce(l.serve.setupUrl),o(null))}async function C(){l?.tailscaleUpCommand&&(o("copy-up-command"),await ce(l.tailscaleUpCommand),o(null))}async function k(){l?.operatorCommand&&(o("copy-operator"),await ce(l.operatorCommand),o(null))}async function w(){if(!l?.serve.enabled){const P=await c();P?.serve.enabled&&P.remoteWebUrl&&await ce(P.remoteWebUrl);return}await N()}return{status:l,busy:h,flashTailscaleUp:x,refresh:b,enableRemoteAccess:c,disableRemoteAccess:m,copyRemoteLink:N,copyTailscaleUpCommand:C,copyServeCommand:f,copyServeSetupUrl:u,copyOperatorCommand:k,createRemoteLink:w}}function Da(s){const{connection:t,enabled:a,onError:n}=s,[l,r]=i.useState(null),[h,o]=i.useState(null),x=i.useCallback(async()=>{if(t){o("load");try{const c=await T.computeState(t);r(c),n(null)}catch(c){n(Se(c))}finally{o(null)}}},[t,n]),y=i.useCallback(async()=>{if(t){o("scan");try{const c=await T.scanCompute(t),m=await T.computeState(t);r({...m,inventory:c,scanning:!1}),n(null)}catch(c){n(Se(c))}finally{o(null)}}},[t,n]),j=i.useCallback(async(c,m,N)=>{if(!t)return!1;o("save");try{const f=await T.updateComputeSettings(t,{modelStorePath:c,datasetStorePath:m,defaultDeviceIds:N}),u=await T.computeState(t);return r({...u,settings:f}),n(null),!0}catch(f){return n(Se(f)),!1}finally{o(null)}},[t,n]),b=i.useCallback(async()=>{if(t)try{await T.downloadSmolLm2(t),await x()}catch(c){n(Se(c))}},[t,n,x]),p=i.useCallback(async c=>{if(t)try{await T.cancelModelDownload(t,c),await x()}catch(m){n(Se(m))}},[t,n,x]);i.useEffect(()=>{a&&x()},[a,x]);const d=l?.inventory?.downloads.some(c=>["queued","downloading","verifying","cancelling"].includes(c.status))??!1;return i.useEffect(()=>{if(!a||!d)return;const c=window.setInterval(()=>{x()},1e3);return()=>window.clearInterval(c)},[a,d,x]),{state:l,busy:h,refresh:x,scan:y,save:j,downloadSmolLm2:b,cancelDownload:p}}function Se(s){return s instanceof Error?s.message:String(s)}function Aa(s){const{connection:t,enabled:a,onError:n,profileId:l}=s,[r,h]=i.useState(null),[o,x]=i.useState(!1),y=i.useCallback(async()=>{if(t){x(!0);try{h(await T.datasetCatalog(t,l)),n(null)}catch(j){n(Ea(j))}finally{x(!1)}}},[t,n,l]);return i.useEffect(()=>{a&&y()},[a,y]),{catalog:r,loading:o,refresh:y}}function Ea(s){return s instanceof Error?s.message:String(s)}const Oa=i.lazy(()=>kt(()=>import("./UsageSettingsSection-r3CqRm6Q.js"),__vite__mapDeps([0,1,2,3,4,5]),import.meta.url).then(s=>({default:s.UsageSettingsSection})));function Ja({payload:s,connection:t,diagnostics:a,onPayload:n,onError:l,onToast:r,onBack:h,onOpenSourceSession:o,onOpenSkill:x,onOpenExtension:y,teamChatCurrentUserId:j,teamChatEnabled:b,teamChatNotificationMode:p,teamChatThreads:d,onTeamChatNotificationModeChange:c,onTeamChatThreadMuteChange:m,initialSection:N="account"}){const[f,u]=i.useState(N),C=s?.codex??null,k=i.useMemo(()=>yt(s?.preferences),[s?.preferences]),w=s?.personalization??Nt,P=a??s?.diagnostics??[],D=St()&&wt(t?.platform),F=i.useCallback(B=>{s&&n({...s,providers:B})},[n,s]),g=i.useCallback(B=>{s&&n({...s,preferences:B.preferences})},[n,s]),S=i.useCallback(B=>{s&&n({...s,extensionCatalog:B})},[n,s]),v=ja({connection:t,onError:l,onPayload:n}),R=Ia({connection:t,onError:l,onPayload:n,onPreferences:g,onProviders:F,preferences:k,providers:s?.providers??null}),A=ba({connection:t,onError:l,onPayload:n,onPreferences:g,preferences:k,providers:s?.providers??null}),L=Pa({connection:t,enabled:f==="editor",onError:l,onPayload:n,onPreferences:g,onToast:r,preferences:k}),G=Ra({connection:t,onError:l,onPayload:n,personalization:w}),q=ka({onError:l,section:f}),K=Ma({connection:t,enabled:f==="remote",onError:l,onToast:r}),M=f==="dataset-storage",U=Da({connection:t,enabled:f==="compute"||M,onError:l}),H=Aa({connection:t,enabled:M,onError:l,profileId:s?.profile.activeProfile??"default"}),Q=i.useCallback(B=>U.save(U.state?.settings.modelStorePath??null,B,U.state?.settings.defaultDeviceIds??[]),[U.save,U.state?.settings.defaultDeviceIds,U.state?.settings.modelStorePath]),ne=i.useCallback(async()=>{await Promise.all([U.refresh(),H.refresh()])},[U.refresh,H.refresh]),J=i.useCallback(()=>f!=="subagents"||!A.subagentsDirty?!0:window.confirm("You have unsaved changes. Leave Subagents without saving?"),[A.subagentsDirty,f]),V=i.useCallback(B=>{B!==f&&J()&&u(B)},[J,f]),E=i.useCallback(()=>{J()&&h()},[J,h]);return i.useEffect(()=>{u(N)},[N]),i.useEffect(()=>{if(f!=="subagents"||!A.subagentsDirty)return;const B=ee=>{ee.preventDefault(),ee.returnValue="You have unsaved changes."};return window.addEventListener("beforeunload",B),()=>window.removeEventListener("beforeunload",B)},[A.subagentsDirty,f]),e.jsxs("div",{className:`settings-shell ${D?"platform-macos":""}`,children:[e.jsx("div",{className:"settings-drag-region","aria-hidden":"true"}),e.jsx("div",{className:"settings-window-controls",children:e.jsx(Ct,{platform:t?.platform})}),e.jsx(Gn,{section:f,onBack:E,onSectionChange:V}),e.jsx("main",{className:"settings-content",children:f==="account"?e.jsx(Yt,{payload:s,connection:t,onPayload:n,onPreferences:g,onError:l,onToast:r,...v}):f==="notifications"?e.jsx(jn,{currentUserId:j,enabled:b,mode:p,threads:d,onModeChange:c,onThreadMuteChange:m}):f==="wallet"?e.jsx(ha,{payload:s}):f==="profile"?e.jsx(Rt,{payload:s,connection:t,onPayload:n,onError:l,onToast:r}):f==="skills"?e.jsx(qn,{personalSkills:s?.codexPersonalSkills??[],extensionCatalog:s?.extensionCatalog??{rootPath:"",registryPath:"",extensions:[],error:null},connection:t,onExtensionCatalog:S,onError:l,onToast:r,onOpenSkill:x,onOpenExtension:y}):f==="providers"?e.jsx(On,{account:s?.account??null,codex:C,providers:s?.providers??null,...R}):f==="compute"?e.jsx(ta,{state:U.state,busy:U.busy,onScan:U.scan,onSave:U.save,onDownloadSmolLm2:U.downloadSmolLm2,onCancelDownload:U.cancelDownload}):f==="dataset-storage"?e.jsx(ra,{state:U.state,catalog:H.catalog,busy:U.busy,catalogLoading:H.loading,onRefresh:ne,onSave:Q}):f==="defaults"?e.jsx(Qt,{preferences:k,...A}):f==="goals"?e.jsx(ln,{preferences:k,...A}):f==="context"?e.jsx(rn,{preferences:k,...A}):f==="insights"?e.jsx(on,{preferences:k,providers:s?.providers??null,...A}):f==="training"?e.jsx(Vn,{connection:t,onError:l,onPreferences:g,preferences:k,providers:s?.providers??null}):f==="subagents"?e.jsx(cn,{preferences:k,providers:s?.providers??null,...A}):f==="editor"?e.jsx(an,{preferences:k,...L}):f==="remote"?e.jsx($n,{...K}):f==="usage"?e.jsx(i.Suspense,{fallback:e.jsx("div",{className:"usage-load-state",children:"Loading activity…"}),children:e.jsx(Oa,{account:s?.account??null,connection:t,enabled:f==="usage",onError:l,onOpenSourceSession:o})}):f==="personalization"?e.jsx(yn,{...G}):e.jsx(en,{diagnostics:P,...q})})]})}export{Ja as SettingsView};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{j as t,
|
|
1
|
+
import{j as t,c2 as J,X as R,r as o,c3 as le,c4 as K,a as re,U as de,M as H,Y as T,n as ce,bK as E,u as me,e as ue,c5 as ge,c6 as he,c7 as fe,l as xe,c8 as ve,c9 as ye}from"./index-DQalqxbw.js";/* empty css */import{M as k}from"./MarkdownText-B6Nu_0Fz.js";import{R as X}from"./refresh-cw-CyermMsy.js";import{R as N}from"./reply-BSExNLHM.js";import{r as Ce}from"./index-DYxF_d9i.js";function be(e,l){const s=new Set(Array.from(e.matchAll(/(?:^|\s)@([a-zA-Z0-9_-]+)/g),n=>(n[1]??"").toLowerCase()));return l.filter(n=>{const d=n.handle?.toLowerCase(),r=n.name.toLowerCase().replace(/[^a-z0-9_-]+/g,"-");return d&&s.has(d)||s.has(r)}).map(n=>n.userId)}function je(e){return t.jsxs("div",{className:"team-chat-composer-reply",role:"status",children:[t.jsx(N,{size:15,"aria-hidden":"true"}),t.jsxs("button",{type:"button",className:"team-chat-composer-reply-target","aria-label":`Jump to message from ${e.authorLabel}`,onClick:e.onJump,children:[t.jsxs("strong",{children:["Replying to ",e.authorLabel]}),t.jsx("span",{children:J(e.target)})]}),t.jsx("button",{type:"button",className:"team-chat-icon-button","aria-label":"Cancel reply","data-tooltip":"Cancel reply",onClick:e.onCancel,children:t.jsx(R,{size:14})})]})}function we(e){return t.jsxs("button",{type:"button",className:"team-chat-message-reply-quote","aria-label":`Jump to replied message from ${e.authorLabel}`,onClick:e.onJump,children:[t.jsx("strong",{children:e.authorLabel}),t.jsx("span",{children:J(e.target)})]})}function Te(e){const l=o.useRef(null);if(o.useEffect(()=>{if(!e.menu)return;l.current?.focus();const n=()=>e.onClose(),d=r=>{r.key==="Escape"&&n()};return window.addEventListener("click",n),window.addEventListener("blur",n),window.addEventListener("keydown",d),window.addEventListener("scroll",n,!0),()=>{window.removeEventListener("click",n),window.removeEventListener("blur",n),window.removeEventListener("keydown",d),window.removeEventListener("scroll",n,!0)}},[e.menu,e.onClose]),!e.menu||typeof document>"u")return null;const s=t.jsx("div",{className:"team-chat-message-context-menu",role:"menu","aria-label":"Message actions",style:{left:e.menu.x,top:e.menu.y},onClick:n=>n.stopPropagation(),children:t.jsxs("button",{ref:l,type:"button",role:"menuitem",onClick:()=>{e.onReply(e.menu.message),e.onClose()},children:[t.jsx(N,{size:14}),"Reply"]})});return Ce.createPortal(s,document.body)}function Me(e){const d=e.clientX||e.fallbackX,r=e.clientY||e.fallbackY;return{x:Math.max(8,Math.min(d,e.viewportWidth-150-8)),y:Math.max(8,Math.min(r,e.viewportHeight-42-8))}}function Y(e){return`team-chat-message-${encodeURIComponent(e)}`}function Re(e){const[l,s]=o.useState(!1),[n,d]=o.useState(e.message.body),r=e.message.refs.find(a=>a.refType==="hosted_ai_thread"),m=e.message.refs.find(a=>a.refType==="agent_run"),v=typeof r?.preview.status=="string"?r.preview.status:null,h=typeof e.message.metadata.deliveryStatus=="string"?e.message.metadata.deliveryStatus:null,y=typeof e.message.metadata.uploadProgress=="string"?e.message.metadata.uploadProgress:null,c=!e.message.deletedAt&&!h,g=le(e.message,e.messagesById),b=g?K(g,e.membersById):null;return t.jsxs("article",{id:Y(e.message.id),className:`team-chat-message${e.own?" own":""}`,tabIndex:-1,onContextMenu:a=>{if(!c)return;a.preventDefault();const C=a.currentTarget.getBoundingClientRect();e.onOpenReplyMenu(e.message,{clientX:a.clientX,clientY:a.clientY,fallbackX:C.right-12,fallbackY:C.top+24})},children:[t.jsx(Ie,{member:e.author}),t.jsxs("div",{className:"team-chat-message-content",children:[t.jsxs("header",{children:[t.jsx("strong",{children:e.author?.name??"Team member"}),t.jsx("time",{children:Se(e.message.createdAt)}),e.message.editedAt?t.jsx("span",{children:"edited"}):null,h==="sending"?t.jsx("span",{children:"sending"}):null,h==="sending"&&y?t.jsxs("span",{children:["uploaded ",y]}):null,h==="failed"?t.jsx("span",{className:"failed",children:"not sent"}):null,h==="failed"?t.jsxs("div",{className:"team-chat-message-actions visible",children:[t.jsx("button",{type:"button","data-tooltip":"Retry message","aria-label":"Retry message",onClick:()=>{e.onRetry(e.message)},children:t.jsx(X,{size:13})}),t.jsx("button",{type:"button","data-tooltip":"Remove failed message","aria-label":"Remove failed message",onClick:()=>e.onDismissFailed(e.message),children:t.jsx(R,{size:13})})]}):c||e.own&&!e.message.deletedAt?t.jsxs("div",{className:"team-chat-message-actions",children:[c?t.jsx("button",{type:"button","data-tooltip":"Reply","aria-label":"Reply to message",onClick:()=>e.onReply(e.message),children:t.jsx(N,{size:13})}):null,e.own&&!r?t.jsx("button",{type:"button","data-tooltip":"Edit message","aria-label":"Edit message",onClick:()=>s(!0),children:t.jsx(re,{size:13})}):null,e.own?t.jsx("button",{type:"button","data-tooltip":"Delete message","aria-label":"Delete message",onClick:()=>{e.onDelete(e.message)},children:t.jsx(de,{size:13})}):null]}):null]}),g&&b?t.jsx(we,{authorLabel:b,target:g,onJump:()=>e.onJumpToMessage(g.id)}):null,l?t.jsxs("form",{className:"team-chat-message-edit",onSubmit:a=>{a.preventDefault(),e.onEdit(e.message,n).then(C=>{C&&s(!1)})},children:[t.jsx("textarea",{autoFocus:!0,value:n,onChange:a=>d(a.currentTarget.value),onKeyDown:a=>{a.key==="Escape"&&(a.preventDefault(),s(!1),d(e.message.body))}}),t.jsxs("div",{children:[t.jsx("button",{type:"button",onClick:()=>s(!1),children:"Cancel"}),t.jsx("button",{type:"submit",disabled:!n.trim(),children:"Save"})]})]}):t.jsx("div",{className:e.message.deletedAt?"deleted":"",children:e.message.deletedAt?"Message deleted":e.message.body}),!e.message.deletedAt&&e.message.attachments.length>0?t.jsx(Ae,{message:e.message,connection:e.connection}):null,r?t.jsxs("button",{type:"button",className:"team-chat-thread-link",onClick:()=>{e.onOpenAiThread(r.refId)},children:[t.jsx(H,{size:14}),t.jsx("span",{children:"Thread"}),v&&v!=="completed"?t.jsx("small",{children:_(v)}):null,t.jsx("span",{"aria-hidden":"true",children:"›"})]}):null,m?t.jsxs("button",{type:"button",className:"team-chat-thread-link",onClick:()=>{e.onOpenAgentConversation(m.refId)},children:[t.jsx(T,{size:14}),t.jsx("span",{children:"Agent run"}),t.jsx("small",{children:_(String(m.preview.status??"queued"))}),t.jsx("span",{"aria-hidden":"true",children:"›"})]}):null]})]})}function Ae(e){const l=new Map(Array.isArray(e.message.metadata.localAttachmentPreviews)?e.message.metadata.localAttachmentPreviews.flatMap(s=>{if(!s||typeof s!="object")return[];const n=s;return typeof n.id=="string"&&typeof n.url=="string"?[[n.id,n.url]]:[]}):[]);return t.jsx("div",{className:"team-chat-message-images",children:e.message.attachments.map(s=>t.jsx(Pe,{attachmentId:s.id,alt:s.name,teamId:e.message.teamId,connection:e.connection,localUrl:l.get(s.clientAttachmentId)??null},s.id))})}function Pe(e){const[l,s]=o.useState(e.localUrl),[n,d]=o.useState(!1),r=o.useRef(0);async function m(){if(!e.connection||e.localUrl){e.localUrl||d(!0);return}d(!1);try{const v=await ce.teamChatAttachmentDownload(e.connection,e.teamId,e.attachmentId);s(v.url)}catch{s(null),d(!0)}}return o.useEffect(()=>{s(e.localUrl),d(!1),r.current=0,e.localUrl||m()},[e.attachmentId,e.connection,e.localUrl,e.teamId]),l?t.jsx("a",{href:l,target:"_blank",rel:"noreferrer","aria-label":`Open ${e.alt}`,children:t.jsx("img",{src:l,alt:e.alt,loading:"lazy",onError:()=>{if(!e.localUrl&&r.current<1){r.current+=1,m();return}s(null),d(!0)}})}):n?t.jsx("button",{type:"button",className:"team-chat-message-image-retry","aria-label":`Retry ${e.alt}`,"data-tooltip":"Retry image",onClick:()=>{r.current=0,e.localUrl?(d(!1),s(e.localUrl)):m()},children:t.jsx(X,{size:18})}):t.jsx("div",{className:"team-chat-message-image-loading",role:"status","aria-label":`Loading ${e.alt}`})}function _(e){return e==="pending"?"Starting":e==="running"?"Responding":e==="failed"?"Failed":e==="interrupted"?"Interrupted":e==="cancelled"?"Cancelled":e}function Ie({member:e}){if(e?.image)return t.jsx("img",{className:"team-chat-avatar",src:e.image,alt:""});const l=(e?.name??"T").split(/\s+/).slice(0,2).map(s=>s[0]?.toUpperCase()??"").join("");return t.jsx("span",{className:"team-chat-avatar fallback",children:l})}function Se(e){const l=new Date(e);return Number.isFinite(l.getTime())?l.toLocaleTimeString([],{hour:"numeric",minute:"2-digit"}):""}const L={value:"none",label:"No project",detail:"Team conversation",options:[],busy:!1},U={value:"local",label:"Local",detail:"Local execution",options:[],action:{value:"local",label:"Local",detail:"Local execution",disabled:!1},busy:!1},G=new Set(["codex","openai","xai","openrouter","deepseek","zai","moonshot","together","groq","fireworks","custom-openai-compatible"]);function ke(e,l){return!l||e===l?e:e?`${l}
|
|
2
2
|
|
|
3
|
-
${e}`:l}function Oe(e){me(e.error);const[l,s]=o.useState(""),[n,d]=o.useState(!1),[r,m]=o.useState(null),[v,h]=o.useState(null),[y,c]=o.useState(0),g=o.useRef(null),b=o.useRef(!0),a=o.useRef(e.detail?.thread.id??null);a.current=e.detail?.thread.id??null;const{confirmAction:C,confirmDialog:V,resolveConfirmDialog:Z}=ue(),A=o.useMemo(()=>new Map(e.members.map(i=>[i.userId,i])),[e.members]),D=o.useMemo(()=>new Map((e.detail?.messages??[]).map(i=>[i.id,i])),[e.detail?.messages]),Q=e.detail?.thread.id??null,z=r?.threadId===Q?D.get(r.message.id)??r.message:null,M=z?.deletedAt?null:z,j=M?ge(M):null,O=j?H(j,A):null,p=e.detail?he(e.detail.thread,e.currentUserId):"Team",P=G.has(e.provider)?e.provider:"codex",$=P===e.provider?e.model:"gpt-5.6-sol",ee=o.useMemo(()=>fe({hostedActions:e.agents,profile:e.profile,teamId:e.teamId}),[e.agents,e.profile,e.teamId]),te=e.detail?.messages.at(-1)?.sequence??0;o.useEffect(()=>{if(!b.current)return;const i=g.current;i&&(i.scrollTop=i.scrollHeight)},[te,e.detail?.thread.id]);const q=o.useCallback(i=>{i.deletedAt||i.id.startsWith("pending:")||typeof i.metadata.deliveryStatus=="string"||(m({threadId:i.threadId,message:i}),d(!1),h(null),c(f=>f+1))},[]),ne=o.useCallback(()=>h(null),[]),ae=o.useCallback((i,f)=>{const x=Me({...f,viewportWidth:window.innerWidth,viewportHeight:window.innerHeight});h({message:i,...x})},[]),B=o.useCallback(i=>{const f=document.getElementById(Y(i));f&&(f.scrollIntoView({behavior:"smooth",block:"center"}),f.focus({preventScroll:!0}))},[]);async function se(i=[],f=null){if(i.some(u=>u.kind!=="image"||!["image/png","image/jpeg","image/webp","image/gif"].includes(u.mediaType)))return e.showToast("Team chat supports PNG, JPEG, WebP, and GIF images.","error"),!1;let x=f;if(M&&x)return e.showToast("Remove the agent action before replying to a message.","error"),!1;if(ve(x)){const u=ye(x);if(!u)throw new Error("The selected profile agent is missing its profile id.");if(!await C({title:`Publish ${x.label??x.name??"agent"} to Team?`,body:`This will upload the committed agent source to ${e.teamName??"this Team"}, create its hosted runtime, and then send your message.`,confirmLabel:"Publish and send",tone:"default"}))return!1;x=await e.onPublishProfileAgent(u)}const I=x?.approvalPolicy?.risk;let F=null;if(x?.approvalPolicy?.required&&I&&I!=="read"){const u=I==="destructive";if(!await C({title:u?"Approve destructive action?":"Approve external write?",body:`${x.label??x.name??"This agent action"} will use the workspace connection to ${u?"perform a destructive operation":"write external data"}. Approve this run only?`,confirmLabel:u?"Approve destructive action":"Approve write",tone:u?"danger":"default"}))return!1;F=crypto.randomUUID()}const S=l,oe=e.detail?.thread.id??null,w=M,W=()=>{a.current===oe&&(s(u=>ke(u,S)),w&&m(u=>u??{threadId:w.threadId,message:w}))};s(""),w&&m(null);try{const u=await e.onSendMessage({body:S,useModel:n,providerId:P,modelId:$,mentionUserIds:be(S,e.members),attachments:i,replyToMessage:w,selectedActionKey:x?.id??null,approvalId:F});return u?n&&d(!1):W(),u}catch(u){throw W(),u}}return t.jsxs("section",{className:"team-chat-view",children:[t.jsxs("div",{className:"team-chat-main conversation-surface-main",children:[t.jsxs("div",{className:"team-chat-messages conversation-message-scroll",role:"log","aria-live":"polite","aria-relevant":"additions text","aria-busy":e.loading,"aria-label":p,tabIndex:0,ref:g,onScroll:i=>{const f=i.currentTarget;b.current=f.scrollHeight-f.scrollTop-f.clientHeight<72},children:[e.detail?.hasMoreBefore?t.jsx("button",{type:"button",className:"team-chat-load-older",disabled:e.loading,onClick:()=>{e.onLoadMoreMessages()},children:e.loading?"Loading...":"Load older messages"}):null,e.loading&&!e.detail?t.jsx("div",{className:"team-chat-empty",children:"Loading messages..."}):e.detail?.messages.length?e.detail.messages.map(i=>t.jsx(Re,{message:i,author:i.authorUserId?A.get(i.authorUserId)??null:null,own:i.authorUserId===e.currentUserId,onOpenAiThread:e.onOpenAiThread,onOpenAgentConversation:e.onOpenAgentConversation,onEdit:e.onEditMessage,onDelete:e.onDeleteMessage,onRetry:e.onRetryMessage,onDismissFailed:e.onDismissFailedMessage,membersById:A,messagesById:D,onReply:q,onOpenReplyMenu:ae,onJumpToMessage:B,connection:e.connection},i.id)):t.jsx("div",{className:"team-chat-empty",children:"No messages yet"})]}),t.jsxs("div",{className:"team-chat-composer-shell conversation-composer-shell",children:[j&&O?t.jsx(je,{authorLabel:O,target:j,onCancel:()=>m(null),onJump:()=>B(j.id)}):null,t.jsx(E,{mode:"dock",surface:"team",teamUseModel:n,teamUseModelLocked:!!j,teamMentionMembers:e.members.filter(i=>i.userId!==e.currentUserId),actionCatalog:ee,onTeamUseModelChange:d,prompt:l,contextWindowStatus:e.contextWindowStatus,busy:e.busy,running:!1,focusRequestId:y,submissionScopeKey:`team:${e.detail?.thread.id??"none"}`,showProjectFooter:!1,connection:e.connection,providerSettings:e.providerSettings,provider:P,model:$,projectTarget:L,workspaceTarget:U,codexPermissionMode:e.codexPermissionMode,codexReasoningEffort:e.codexReasoningEffort,openPondCommandAccessMode:e.openPondCommandAccessMode,onProviderChange:e.onProviderChange,onProviderSetupOpen:e.onOpenProviderSettings,onProjectTargetChange:()=>{},onWorkspaceTargetChange:()=>{},onModelChange:e.onModelChange,onCodexPermissionModeChange:e.onCodexPermissionModeChange,onCodexReasoningEffortChange:e.onCodexReasoningEffortChange,onOpenPondCommandAccessModeChange:e.onOpenPondCommandAccessModeChange,onPromptChange:s,showToast:e.showToast,onSubmit:async(i,f)=>se(i??[],f??null),onStop:()=>!1})]})]}),t.jsx(Te,{menu:v,onClose:ne,onReply:q}),t.jsx(xe,{state:V,onResolve:Z})]})}function $e(e){const[l,s]=o.useState(""),n=e.agentConversation,d=o.useRef(null),r=o.useRef(null),m=o.useRef(null),v=n.messages.at(-1)?.sequence??0,h=["pending","queued","running"].includes(n.run.status);o.useEffect(()=>{const c=d.current;c&&(c.scrollTop=c.scrollHeight)},[v,n.run.status]),o.useEffect(()=>{r.current?.focus();const c=g=>{g.key==="Escape"&&(g.preventDefault(),e.onCloseAgentConversation())};return window.addEventListener("keydown",c),()=>window.removeEventListener("keydown",c)},[e.onCloseAgentConversation]);async function y(){const c=m.current??crypto.randomUUID();m.current=c;const g=await e.onSendAgentTurn({body:l,clientRequestId:c});return g&&(m.current=null,s("")),g}return t.jsxs("aside",{className:"workspace-diff-panel team-ai-thread-panel","aria-label":`${n.agent.name} run`,children:[e.onResizeStart?t.jsx("div",{className:"workspace-diff-resize-handle",role:"separator","aria-orientation":"vertical","aria-label":"Resize agent run panel",onPointerDown:e.onResizeStart}):null,t.jsxs("header",{children:[t.jsxs("div",{children:[t.jsx(T,{size:15}),t.jsx("strong",{children:n.agent.name}),t.jsx("span",{children:n.run.status})]}),t.jsx("button",{ref:r,type:"button",className:"team-chat-icon-button","aria-label":"Close agent run",onClick:e.onCloseAgentConversation,children:t.jsx(R,{size:16})})]}),t.jsxs("div",{className:"team-ai-thread-messages",ref:d,role:"log","aria-live":"polite","aria-relevant":"additions text",tabIndex:0,children:[n.messages.map(c=>t.jsxs("article",{className:`team-ai-message ${c.role}`,children:[t.jsxs("div",{className:"team-ai-message-author",children:[c.role==="assistant"?t.jsx(T,{size:14}):null,t.jsx("strong",{children:c.role==="user"?"Team member":n.agent.name})]}),t.jsx(k,{connection:e.connection,content:c.body})]},c.id)),n.messages.length===0?t.jsx("div",{className:"team-chat-empty",children:"The agent run is starting."}):null]}),t.jsx("div",{className:"team-ai-thread-composer",children:t.jsx(E,{mode:"dock",surface:"team",teamUseModel:!1,teamUseModelLocked:!0,prompt:l,contextWindowStatus:e.contextWindowStatus,busy:e.busy||h,running:h,submissionScopeKey:`team-agent:${n.conversationId}`,showProjectFooter:!1,connection:e.connection,providerSettings:e.providerSettings,provider:e.provider,model:e.model,projectTarget:L,workspaceTarget:U,codexPermissionMode:e.codexPermissionMode,codexReasoningEffort:e.codexReasoningEffort,openPondCommandAccessMode:e.openPondCommandAccessMode,onProviderChange:e.onProviderChange,onProviderSetupOpen:e.onOpenProviderSettings,onProjectTargetChange:()=>{},onWorkspaceTargetChange:()=>{},onModelChange:e.onModelChange,onCodexPermissionModeChange:e.onCodexPermissionModeChange,onCodexReasoningEffortChange:e.onCodexReasoningEffortChange,onOpenPondCommandAccessModeChange:e.onOpenPondCommandAccessModeChange,onPromptChange:c=>{m.current=null,s(c)},showToast:e.showToast,onSubmit:y,onStop:()=>!1})})]})}function qe(e){const[l,s]=o.useState(""),n=e.aiThread,d=new Map(e.members.map(a=>[a.userId,a])),r=n.turns.at(-1)??null,m=o.useRef(null),v=n.messages.at(-1)?.sequence??0,h=o.useRef(null),y=G.has(e.provider)?e.provider:"codex",c=y===e.provider?e.model:"gpt-5.6-sol",g=!!(n.activeTurn&&(n.activeTurn.status==="pending"||n.activeTurn.status==="running"));o.useEffect(()=>{const a=m.current;a&&(a.scrollTop=a.scrollHeight)},[v,n.activeTurn?.partialBody]),o.useEffect(()=>{h.current?.focus();const a=C=>{C.key==="Escape"&&(C.preventDefault(),e.onCloseAiThread())};return window.addEventListener("keydown",a),()=>window.removeEventListener("keydown",a)},[e.onCloseAiThread]);async function b(){const a=await e.onSendAiTurn({body:l,providerId:y,modelId:c});return a&&s(""),a}return t.jsxs("aside",{className:"workspace-diff-panel team-ai-thread-panel","aria-label":"AI thread",children:[e.onResizeStart?t.jsx("div",{className:"workspace-diff-resize-handle",role:"separator","aria-label":"Resize AI thread panel","aria-orientation":"vertical",onPointerDown:e.onResizeStart}):null,t.jsxs("header",{children:[t.jsxs("div",{children:[t.jsx(K,{size:15}),t.jsx("strong",{children:"AI thread"}),t.jsxs("span",{children:[n.messages.length," messages"]})]}),t.jsx("button",{ref:h,type:"button",className:"team-chat-icon-button","data-tooltip":"Close thread","aria-label":"Close thread",onClick:e.onCloseAiThread,children:t.jsx(R,{size:16})})]}),t.jsxs("div",{className:"team-ai-thread-messages",ref:m,role:"log","aria-live":"polite","aria-relevant":"additions text",tabIndex:0,children:[n.messages.map(a=>t.jsxs("article",{className:`team-ai-message ${a.role}`,children:[t.jsxs("div",{className:"team-ai-message-author",children:[a.role==="assistant"?t.jsx(T,{size:14}):null,t.jsx("strong",{children:a.role==="assistant"?"Model":a.createdByUserId?d.get(a.createdByUserId)?.name??"Team member":"Team member"})]}),t.jsx(k,{connection:e.connection,content:a.body})]},a.id)),n.activeTurn?.partialBody?t.jsxs("article",{className:"team-ai-message assistant streaming",children:[t.jsxs("div",{className:"team-ai-message-author",children:[t.jsx(T,{size:14}),t.jsx("strong",{children:"Model"}),t.jsx("span",{children:n.activeTurn.status})]}),t.jsx(k,{connection:e.connection,content:n.activeTurn.partialBody})]}):n.activeTurn?t.jsx("div",{className:"team-ai-running",children:n.activeTurn.status==="pending"?"Starting model...":"Model is responding..."}):r&&["failed","interrupted","cancelled"].includes(r.status)?t.jsx("div",{className:`team-ai-turn-state ${r.status}`,children:r.status==="failed"?"Model response failed":r.status==="interrupted"?"Model response was interrupted":"Model response was cancelled"}):null]}),t.jsx("div",{className:"team-ai-thread-composer",children:t.jsx(E,{mode:"dock",surface:"team",teamUseModel:!0,teamUseModelLocked:!0,prompt:l,contextWindowStatus:e.contextWindowStatus,busy:g,running:g,submissionScopeKey:`team-ai:${n.conversationId}`,showProjectFooter:!1,connection:e.connection,providerSettings:e.providerSettings,provider:y,model:c,projectTarget:L,workspaceTarget:U,codexPermissionMode:e.codexPermissionMode,codexReasoningEffort:e.codexReasoningEffort,openPondCommandAccessMode:e.openPondCommandAccessMode,onProviderChange:e.onProviderChange,onProviderSetupOpen:e.onOpenProviderSettings,onProjectTargetChange:()=>{},onWorkspaceTargetChange:()=>{},onModelChange:e.onModelChange,onCodexPermissionModeChange:e.onCodexPermissionModeChange,onCodexReasoningEffortChange:e.onCodexReasoningEffortChange,onOpenPondCommandAccessModeChange:e.onOpenPondCommandAccessModeChange,onPromptChange:s,showToast:e.showToast,onSubmit:b,onStop:e.onStopAiTurn})})]})}export{$e as TeamAgentConversationPanel,qe as TeamAiThreadPanel,Oe as TeamChatView,ke as restoreFailedTeamChatPrompt};
|
|
3
|
+
${e}`:l}function Oe(e){me(e.error);const[l,s]=o.useState(""),[n,d]=o.useState(!1),[r,m]=o.useState(null),[v,h]=o.useState(null),[y,c]=o.useState(0),g=o.useRef(null),b=o.useRef(!0),a=o.useRef(e.detail?.thread.id??null);a.current=e.detail?.thread.id??null;const{confirmAction:C,confirmDialog:V,resolveConfirmDialog:Q}=ue(),A=o.useMemo(()=>new Map(e.members.map(i=>[i.userId,i])),[e.members]),D=o.useMemo(()=>new Map((e.detail?.messages??[]).map(i=>[i.id,i])),[e.detail?.messages]),Z=e.detail?.thread.id??null,z=r?.threadId===Z?D.get(r.message.id)??r.message:null,M=z?.deletedAt?null:z,j=M?ge(M):null,O=j?K(j,A):null,p=e.detail?he(e.detail.thread,e.currentUserId):"Team",P=G.has(e.provider)?e.provider:"codex",q=P===e.provider?e.model:"gpt-5.6-sol",ee=o.useMemo(()=>fe({hostedActions:e.agents,profile:e.profile,teamId:e.teamId}),[e.agents,e.profile,e.teamId]),te=e.detail?.messages.at(-1)?.sequence??0;o.useEffect(()=>{if(!b.current)return;const i=g.current;i&&(i.scrollTop=i.scrollHeight)},[te,e.detail?.thread.id]);const $=o.useCallback(i=>{i.deletedAt||i.id.startsWith("pending:")||typeof i.metadata.deliveryStatus=="string"||(m({threadId:i.threadId,message:i}),d(!1),h(null),c(f=>f+1))},[]),ne=o.useCallback(()=>h(null),[]),ae=o.useCallback((i,f)=>{const x=Me({...f,viewportWidth:window.innerWidth,viewportHeight:window.innerHeight});h({message:i,...x})},[]),B=o.useCallback(i=>{const f=document.getElementById(Y(i));f&&(f.scrollIntoView({behavior:"smooth",block:"center"}),f.focus({preventScroll:!0}))},[]);async function se(i=[],f=null){if(i.some(u=>u.kind!=="image"||!["image/png","image/jpeg","image/webp","image/gif"].includes(u.mediaType)))return e.showToast("Team chat supports PNG, JPEG, WebP, and GIF images.","error"),!1;let x=f;if(M&&x)return e.showToast("Remove the agent action before replying to a message.","error"),!1;if(ve(x)){const u=ye(x);if(!u)throw new Error("The selected profile agent is missing its profile id.");if(!await C({title:`Publish ${x.label??x.name??"agent"} to Team?`,body:`This will upload the committed agent source to ${e.teamName??"this Team"}, create its hosted runtime, and then send your message.`,confirmLabel:"Publish and send",tone:"default"}))return!1;x=await e.onPublishProfileAgent(u)}const I=x?.approvalPolicy?.risk;let F=null;if(x?.approvalPolicy?.required&&I&&I!=="read"){const u=I==="destructive";if(!await C({title:u?"Approve destructive action?":"Approve external write?",body:`${x.label??x.name??"This agent action"} will use the workspace connection to ${u?"perform a destructive operation":"write external data"}. Approve this run only?`,confirmLabel:u?"Approve destructive action":"Approve write",tone:u?"danger":"default"}))return!1;F=crypto.randomUUID()}const S=l,oe=e.detail?.thread.id??null,w=M,W=()=>{a.current===oe&&(s(u=>ke(u,S)),w&&m(u=>u??{threadId:w.threadId,message:w}))};s(""),w&&m(null);try{const u=await e.onSendMessage({body:S,useModel:n,providerId:P,modelId:q,mentionUserIds:be(S,e.members),attachments:i,replyToMessage:w,selectedActionKey:x?.id??null,approvalId:F});return u?n&&d(!1):W(),u}catch(u){throw W(),u}}return t.jsxs("section",{className:"team-chat-view",children:[t.jsxs("div",{className:"team-chat-main conversation-surface-main",children:[t.jsxs("div",{className:"team-chat-messages conversation-message-scroll",role:"log","aria-live":"polite","aria-relevant":"additions text","aria-busy":e.loading,"aria-label":p,tabIndex:0,ref:g,onScroll:i=>{const f=i.currentTarget;b.current=f.scrollHeight-f.scrollTop-f.clientHeight<72},children:[e.detail?.hasMoreBefore?t.jsx("button",{type:"button",className:"team-chat-load-older",disabled:e.loading,onClick:()=>{e.onLoadMoreMessages()},children:e.loading?"Loading...":"Load older messages"}):null,e.loading&&!e.detail?t.jsx("div",{className:"team-chat-empty",children:"Loading messages..."}):e.detail?.messages.length?e.detail.messages.map(i=>t.jsx(Re,{message:i,author:i.authorUserId?A.get(i.authorUserId)??null:null,own:i.authorUserId===e.currentUserId,onOpenAiThread:e.onOpenAiThread,onOpenAgentConversation:e.onOpenAgentConversation,onEdit:e.onEditMessage,onDelete:e.onDeleteMessage,onRetry:e.onRetryMessage,onDismissFailed:e.onDismissFailedMessage,membersById:A,messagesById:D,onReply:$,onOpenReplyMenu:ae,onJumpToMessage:B,connection:e.connection},i.id)):t.jsx("div",{className:"team-chat-empty",children:"No messages yet"})]}),t.jsxs("div",{className:"team-chat-composer-shell conversation-composer-shell",children:[j&&O?t.jsx(je,{authorLabel:O,target:j,onCancel:()=>m(null),onJump:()=>B(j.id)}):null,t.jsx(E,{mode:"dock",surface:"team",teamUseModel:n,teamUseModelLocked:!!j,teamMentionMembers:e.members.filter(i=>i.userId!==e.currentUserId),actionCatalog:ee,onTeamUseModelChange:d,prompt:l,contextWindowStatus:e.contextWindowStatus,busy:e.busy,running:!1,focusRequestId:y,submissionScopeKey:`team:${e.detail?.thread.id??"none"}`,showProjectFooter:!1,connection:e.connection,providerSettings:e.providerSettings,provider:P,model:q,projectTarget:L,workspaceTarget:U,codexPermissionMode:e.codexPermissionMode,codexReasoningEffort:e.codexReasoningEffort,openPondCommandAccessMode:e.openPondCommandAccessMode,onProviderChange:e.onProviderChange,onProviderSetupOpen:e.onOpenProviderSettings,onProjectTargetChange:()=>{},onWorkspaceTargetChange:()=>{},onModelChange:e.onModelChange,onCodexPermissionModeChange:e.onCodexPermissionModeChange,onCodexReasoningEffortChange:e.onCodexReasoningEffortChange,onOpenPondCommandAccessModeChange:e.onOpenPondCommandAccessModeChange,onPromptChange:s,showToast:e.showToast,onSubmit:async(i,f)=>se(i??[],f??null),onStop:()=>!1})]})]}),t.jsx(Te,{menu:v,onClose:ne,onReply:$}),t.jsx(xe,{state:V,onResolve:Q})]})}function qe(e){const[l,s]=o.useState(""),n=e.agentConversation,d=o.useRef(null),r=o.useRef(null),m=o.useRef(null),v=n.messages.at(-1)?.sequence??0,h=["pending","queued","running"].includes(n.run.status);o.useEffect(()=>{const c=d.current;c&&(c.scrollTop=c.scrollHeight)},[v,n.run.status]),o.useEffect(()=>{r.current?.focus();const c=g=>{g.key==="Escape"&&(g.preventDefault(),e.onCloseAgentConversation())};return window.addEventListener("keydown",c),()=>window.removeEventListener("keydown",c)},[e.onCloseAgentConversation]);async function y(){const c=m.current??crypto.randomUUID();m.current=c;const g=await e.onSendAgentTurn({body:l,clientRequestId:c});return g&&(m.current=null,s("")),g}return t.jsxs("aside",{className:"workspace-diff-panel team-ai-thread-panel","aria-label":`${n.agent.name} run`,children:[e.onResizeStart?t.jsx("div",{className:"workspace-diff-resize-handle",role:"separator","aria-orientation":"vertical","aria-label":"Resize agent run panel",onPointerDown:e.onResizeStart}):null,t.jsxs("header",{children:[t.jsxs("div",{children:[t.jsx(T,{size:15}),t.jsx("strong",{children:n.agent.name}),t.jsx("span",{children:n.run.status})]}),t.jsx("button",{ref:r,type:"button",className:"team-chat-icon-button","aria-label":"Close agent run",onClick:e.onCloseAgentConversation,children:t.jsx(R,{size:16})})]}),t.jsxs("div",{className:"team-ai-thread-messages",ref:d,role:"log","aria-live":"polite","aria-relevant":"additions text",tabIndex:0,children:[n.messages.map(c=>t.jsxs("article",{className:`team-ai-message ${c.role}`,children:[t.jsxs("div",{className:"team-ai-message-author",children:[c.role==="assistant"?t.jsx(T,{size:14}):null,t.jsx("strong",{children:c.role==="user"?"Team member":n.agent.name})]}),t.jsx(k,{connection:e.connection,content:c.body})]},c.id)),n.messages.length===0?t.jsx("div",{className:"team-chat-empty",children:"The agent run is starting."}):null]}),t.jsx("div",{className:"team-ai-thread-composer",children:t.jsx(E,{mode:"dock",surface:"team",teamUseModel:!1,teamUseModelLocked:!0,prompt:l,contextWindowStatus:e.contextWindowStatus,busy:e.busy||h,running:h,submissionScopeKey:`team-agent:${n.conversationId}`,showProjectFooter:!1,connection:e.connection,providerSettings:e.providerSettings,provider:e.provider,model:e.model,projectTarget:L,workspaceTarget:U,codexPermissionMode:e.codexPermissionMode,codexReasoningEffort:e.codexReasoningEffort,openPondCommandAccessMode:e.openPondCommandAccessMode,onProviderChange:e.onProviderChange,onProviderSetupOpen:e.onOpenProviderSettings,onProjectTargetChange:()=>{},onWorkspaceTargetChange:()=>{},onModelChange:e.onModelChange,onCodexPermissionModeChange:e.onCodexPermissionModeChange,onCodexReasoningEffortChange:e.onCodexReasoningEffortChange,onOpenPondCommandAccessModeChange:e.onOpenPondCommandAccessModeChange,onPromptChange:c=>{m.current=null,s(c)},showToast:e.showToast,onSubmit:y,onStop:()=>!1})})]})}function $e(e){const[l,s]=o.useState(""),n=e.aiThread,d=new Map(e.members.map(a=>[a.userId,a])),r=n.turns.at(-1)??null,m=o.useRef(null),v=n.messages.at(-1)?.sequence??0,h=o.useRef(null),y=G.has(e.provider)?e.provider:"codex",c=y===e.provider?e.model:"gpt-5.6-sol",g=!!(n.activeTurn&&(n.activeTurn.status==="pending"||n.activeTurn.status==="running"));o.useEffect(()=>{const a=m.current;a&&(a.scrollTop=a.scrollHeight)},[v,n.activeTurn?.partialBody]),o.useEffect(()=>{h.current?.focus();const a=C=>{C.key==="Escape"&&(C.preventDefault(),e.onCloseAiThread())};return window.addEventListener("keydown",a),()=>window.removeEventListener("keydown",a)},[e.onCloseAiThread]);async function b(){const a=await e.onSendAiTurn({body:l,providerId:y,modelId:c});return a&&s(""),a}return t.jsxs("aside",{className:"workspace-diff-panel team-ai-thread-panel","aria-label":"AI thread",children:[e.onResizeStart?t.jsx("div",{className:"workspace-diff-resize-handle",role:"separator","aria-label":"Resize AI thread panel","aria-orientation":"vertical",onPointerDown:e.onResizeStart}):null,t.jsxs("header",{children:[t.jsxs("div",{children:[t.jsx(H,{size:15}),t.jsx("strong",{children:"AI thread"}),t.jsxs("span",{children:[n.messages.length," messages"]})]}),t.jsx("button",{ref:h,type:"button",className:"team-chat-icon-button","data-tooltip":"Close thread","aria-label":"Close thread",onClick:e.onCloseAiThread,children:t.jsx(R,{size:16})})]}),t.jsxs("div",{className:"team-ai-thread-messages",ref:m,role:"log","aria-live":"polite","aria-relevant":"additions text",tabIndex:0,children:[n.messages.map(a=>t.jsxs("article",{className:`team-ai-message ${a.role}`,children:[t.jsxs("div",{className:"team-ai-message-author",children:[a.role==="assistant"?t.jsx(T,{size:14}):null,t.jsx("strong",{children:a.role==="assistant"?"Model":a.createdByUserId?d.get(a.createdByUserId)?.name??"Team member":"Team member"})]}),t.jsx(k,{connection:e.connection,content:a.body})]},a.id)),n.activeTurn?.partialBody?t.jsxs("article",{className:"team-ai-message assistant streaming",children:[t.jsxs("div",{className:"team-ai-message-author",children:[t.jsx(T,{size:14}),t.jsx("strong",{children:"Model"}),t.jsx("span",{children:n.activeTurn.status})]}),t.jsx(k,{connection:e.connection,content:n.activeTurn.partialBody})]}):n.activeTurn?t.jsx("div",{className:"team-ai-running",children:n.activeTurn.status==="pending"?"Starting model...":"Model is responding..."}):r&&["failed","interrupted","cancelled"].includes(r.status)?t.jsx("div",{className:`team-ai-turn-state ${r.status}`,children:r.status==="failed"?"Model response failed":r.status==="interrupted"?"Model response was interrupted":"Model response was cancelled"}):null]}),t.jsx("div",{className:"team-ai-thread-composer",children:t.jsx(E,{mode:"dock",surface:"team",teamUseModel:!0,teamUseModelLocked:!0,prompt:l,contextWindowStatus:e.contextWindowStatus,busy:g,running:g,submissionScopeKey:`team-ai:${n.conversationId}`,showProjectFooter:!1,connection:e.connection,providerSettings:e.providerSettings,provider:y,model:c,projectTarget:L,workspaceTarget:U,codexPermissionMode:e.codexPermissionMode,codexReasoningEffort:e.codexReasoningEffort,openPondCommandAccessMode:e.openPondCommandAccessMode,onProviderChange:e.onProviderChange,onProviderSetupOpen:e.onOpenProviderSettings,onProjectTargetChange:()=>{},onWorkspaceTargetChange:()=>{},onModelChange:e.onModelChange,onCodexPermissionModeChange:e.onCodexPermissionModeChange,onCodexReasoningEffortChange:e.onCodexReasoningEffortChange,onOpenPondCommandAccessModeChange:e.onOpenPondCommandAccessModeChange,onPromptChange:s,showToast:e.showToast,onSubmit:b,onStop:e.onStopAiTurn})})]})}export{qe as TeamAgentConversationPanel,$e as TeamAiThreadPanel,Oe as TeamChatView,ke as restoreFailedTeamChatPrompt};
|