openpond 0.0.35 → 0.0.36

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (118) hide show
  1. package/dist/chunks/{app-layer-GUF2CKYH.js → app-layer-4AA4YYGK.js} +3 -3
  2. package/dist/chunks/{apps-DIVHAUOV.js → apps-V2JTB5MD.js} +3 -3
  3. package/dist/chunks/{chunk-FRPL5XPX.js → chunk-3DOOLZZM.js} +1 -1
  4. package/dist/chunks/{chunk-CRFB72X2.js → chunk-3JJBNVNX.js} +3 -3
  5. package/dist/chunks/{chunk-GUGFYXFS.js → chunk-65BVQIHR.js} +4 -4
  6. package/dist/chunks/{chunk-NTRTK6C6.js → chunk-6L5WJF7T.js} +2 -2
  7. package/dist/chunks/{chunk-SECNDLPQ.js → chunk-7IPF4X3K.js} +67 -1
  8. package/dist/chunks/{chunk-ZZOTKXRD.js → chunk-CJSD5ADV.js} +2 -2
  9. package/dist/chunks/{chunk-TXJ4TIDO.js → chunk-G6WW2656.js} +1 -1
  10. package/dist/chunks/{chunk-II2ERA2H.js → chunk-GALAW74P.js} +2 -2
  11. package/dist/chunks/{chunk-4Y25BACE.js → chunk-JAS6QZ2W.js} +1 -1
  12. package/dist/chunks/{chunk-EY52SLOQ.js → chunk-MJT7EW5Q.js} +1 -1
  13. package/dist/chunks/{chunk-2GV3QBBZ.js → chunk-MSX2J653.js} +1 -1
  14. package/dist/chunks/{chunk-YPK2W34Z.js → chunk-NVTC3XOA.js} +1 -1
  15. package/dist/chunks/{chunk-XIF53VR3.js → chunk-NWQTF6O4.js} +1 -1
  16. package/dist/chunks/{chunk-RLQGMSW7.js → chunk-NWVIUBJ3.js} +2 -2
  17. package/dist/chunks/{chunk-S3VA47DG.js → chunk-TYYR7KWY.js} +3 -3
  18. package/dist/chunks/{chunk-LUA5QGQP.js → chunk-YLULZMWE.js} +33 -33
  19. package/dist/chunks/{chunk-2I5TZW66.js → chunk-YRFQKUZD.js} +40 -1
  20. package/dist/chunks/{cli-3AEIYSMD.js → cli-4JA3SIDE.js} +6 -6
  21. package/dist/chunks/{cli-HUVI6ELM.js → cli-RJHEE4FA.js} +4 -4
  22. package/dist/chunks/{core-commands-2HUTKFHQ.js → core-commands-CQSPCVC4.js} +4 -4
  23. package/dist/chunks/{extend-PAJMXYKV.js → extend-4MZ75SHV.js} +9 -9
  24. package/dist/chunks/{harness-UWAS2VAN.js → harness-YVZU42S7.js} +3 -3
  25. package/dist/chunks/{help-M7D2XAOX.js → help-6SULYXVS.js} +1 -1
  26. package/dist/chunks/{opchat-FQ2CJVM6.js → opchat-XGS4AXHA.js} +5 -5
  27. package/dist/chunks/{organizations-L5N6LJ7O.js → organizations-4GFQ3NT2.js} +4 -4
  28. package/dist/chunks/{profile-KH5IKVNY.js → profile-VWMBIHIE.js} +7 -7
  29. package/dist/chunks/{project-agent-F4NHVRGY.js → project-agent-SQ6ODALG.js} +6 -6
  30. package/dist/chunks/{sandbox-command-DDXRQNB6.js → sandbox-command-34S2V7BN.js} +4 -4
  31. package/dist/chunks/{sandbox-template-5EEEQKR5.js → sandbox-template-VP5HMGQI.js} +5 -5
  32. package/dist/chunks/{src-34FV42HE.js → src-X3R3XIJT.js} +403 -28
  33. package/dist/chunks/{src-LHZWUSD7.js → src-YHUMH6W6.js} +2 -2
  34. package/dist/chunks/{teams-bot-HFWO5GOV.js → teams-bot-EIVRNO5S.js} +3 -3
  35. package/dist/chunks/{workspaces-LO44JAC2.js → workspaces-2N52V3BI.js} +2 -2
  36. package/dist/cli.js +10 -10
  37. package/dist/web/assets/{AppDialog-T3j6O3yg.js → AppDialog-j4N-gIi3.js} +1 -1
  38. package/dist/web/assets/{AppsView-70Qqf9eJ.js → AppsView-YiK3pqNb.js} +1 -1
  39. package/dist/web/assets/{BrowserSidebar-CdBLHdNW.js → BrowserSidebar-BWFLEQ8j.js} +1 -1
  40. package/dist/web/assets/{CloudWorkView-C5-jvlOo.js → CloudWorkView-3sS_1bhN.js} +1 -1
  41. package/dist/web/assets/CommandMenu-B11OrTCq.js +1 -0
  42. package/dist/web/assets/{CommunityView-BHUJ9Hun.js → CommunityView-DXyXTWhP.js} +1 -1
  43. package/dist/web/assets/ComposerCreateImproveStrip-3NoRiJJq.js +1 -0
  44. package/dist/web/assets/{GetStartedView-CIXScviw.js → GetStartedView-CPV5lgVH.js} +1 -1
  45. package/dist/web/assets/LabsRoute-B_nsEZXy.js +3 -0
  46. package/dist/web/assets/LabsRoute-dNN-odU0.css +1 -0
  47. package/dist/web/assets/MainChatThread-Dg7p3R2O.js +2 -0
  48. package/dist/web/assets/{MakeAgentTutorialLearningPanel-r7jyZVc0.js → MakeAgentTutorialLearningPanel-C6F-kJQd.js} +2 -2
  49. package/dist/web/assets/{MarkdownText-E35C404I.js → MarkdownText-CkVkr3P1.js} +3 -3
  50. package/dist/web/assets/Messages-C7uHGoFw.js +10 -0
  51. package/dist/web/assets/{NativeSkillSidebar-Qgccncuc.js → NativeSkillSidebar-BPpoHjEW.js} +1 -1
  52. package/dist/web/assets/{NewProjectDialog-BowacUmA.js → NewProjectDialog-DBMhkTvD.js} +1 -1
  53. package/dist/web/assets/{PostTrainingLearningPanel-oJu5qaHK.js → PostTrainingLearningPanel-B1Rp7iIL.js} +2 -2
  54. package/dist/web/assets/{PostTrainingStatusPill-B9Eoc4s0.js → PostTrainingStatusPill-BGZ9h5eW.js} +1 -1
  55. package/dist/web/assets/{ProfileSettingsSection-Dnh92gDH.js → ProfileSettingsSection-2NOHEz2b.js} +1 -1
  56. package/dist/web/assets/RightChatPanelStack-CLK7_zKe.js +1 -0
  57. package/dist/web/assets/{SettingsView-Bjehxwt1.js → SettingsView-BAqea_KX.js} +4 -4
  58. package/dist/web/assets/{TeamChatView-Tn4X5cuY.js → TeamChatView-qVscSedQ.js} +2 -2
  59. package/dist/web/assets/{TerminalOverlay-DoX5LYzK.js → TerminalOverlay-Bkw7XqMy.js} +1 -1
  60. package/dist/web/assets/TrainingCreationPanel-COg1wvw8.js +1 -0
  61. package/dist/web/assets/{TrainingDraftPanel-Da6uGu9y.js → TrainingDraftPanel-BNK2znmI.js} +1 -1
  62. package/dist/web/assets/{UsageSettingsSection-DKky0p47.js → UsageSettingsSection-CUxBaohC.js} +1 -1
  63. package/dist/web/assets/WorkspaceDiffPanel-qfFj8IRq.js +14 -0
  64. package/dist/web/assets/{WorkspaceEnvironmentMenu-Ba4M8z1N.js → WorkspaceEnvironmentMenu-C0-mH7oF.js} +3 -3
  65. package/dist/web/assets/{WorkspaceGitDialogs-CSepNOb8.js → WorkspaceGitDialogs-VvC2px0X.js} +1 -1
  66. package/dist/web/assets/{WorkspaceMonacoEditor-LhFdzCRs.js → WorkspaceMonacoEditor-CUIwoHv1.js} +3 -3
  67. package/dist/web/assets/{activity-bW02ZsBD.js → activity-BhqHgkfJ.js} +1 -1
  68. package/dist/web/assets/{boxes-B1dRA1pi.js → boxes-BpqUKFIm.js} +1 -1
  69. package/dist/web/assets/{chevron-up-CySy6WNq.js → chevron-up-BTn9DVRP.js} +1 -1
  70. package/dist/web/assets/{circle-x-DY8vKAKi.js → circle-x-B9Qa8o5a.js} +1 -1
  71. package/dist/web/assets/{copy-DuHI1UZ_.js → copy-BsYs6wBI.js} +1 -1
  72. package/dist/web/assets/{create-pipeline-request-CGBcdK9r.js → create-pipeline-request-vxgKoAvv.js} +3 -3
  73. package/dist/web/assets/{credit-card-Bot0OuTl.js → credit-card-BCePAwMI.js} +1 -1
  74. package/dist/web/assets/{cssMode-BIjAothW.js → cssMode-mw8RI2fR.js} +1 -1
  75. package/dist/web/assets/{git-branch-Cm02aNWq.js → git-branch-C7qQYFIs.js} +1 -1
  76. package/dist/web/assets/{git-commit-horizontal-FYILXW0v.js → git-commit-horizontal-CbX4pTOA.js} +1 -1
  77. package/dist/web/assets/{htmlMode-zO2xLLgL.js → htmlMode-Cc4Czh_M.js} +1 -1
  78. package/dist/web/assets/index-9tbdqUau.css +1 -0
  79. package/dist/web/assets/index-B_3z_lxq.js +1 -0
  80. package/dist/web/assets/index-Cr_RZ7GD.js +177 -0
  81. package/dist/web/assets/{info-DeuEU_RO.js → info-BNGbwgtq.js} +1 -1
  82. package/dist/web/assets/{jsonMode-D2A3mj4n.js → jsonMode-CbqbqGVz.js} +1 -1
  83. package/dist/web/assets/{lspLanguageFeatures-aPSqvscU.js → lspLanguageFeatures-DKiKr5tH.js} +1 -1
  84. package/dist/web/assets/make-agent-tutorial-KKauJpB9.js +2 -0
  85. package/dist/web/assets/{monaco.contribution-KqCt1n9-.js → monaco.contribution-CNgwz_pw.js} +2 -2
  86. package/dist/web/assets/{monaco.contribution-DAq6Jihl.js → monaco.contribution-CdUAX47Q.js} +2 -2
  87. package/dist/web/assets/{monaco.contribution-Do3Jjslo.js → monaco.contribution-D_-wu578.js} +2 -2
  88. package/dist/web/assets/{monaco.contribution-CHVe9CQ9.js → monaco.contribution-Dxc4IxFM.js} +2 -2
  89. package/dist/web/assets/{monitor-DXvHWFeW.js → monitor-CNdx_GTg.js} +1 -1
  90. package/dist/web/assets/{play-BIHyH-Yu.js → play-BLRANWaV.js} +1 -1
  91. package/dist/web/assets/{python-g3mtmU2J.js → python-DYgDMu2R.js} +1 -1
  92. package/dist/web/assets/{refresh-cw-Daz0oqwK.js → refresh-cw-BFjjwYNf.js} +1 -1
  93. package/dist/web/assets/{reply-wu9DIBuK.js → reply-D012cuZl.js} +1 -1
  94. package/dist/web/assets/{rotate-cw-D7q9GgNc.js → rotate-cw-CTfjlR4G.js} +1 -1
  95. package/dist/web/assets/{save-BVFY6VTI.js → save-B1zYlRyN.js} +1 -1
  96. package/dist/web/assets/{toggleHighContrast-D9C_WUDu.js → toggleHighContrast-D9XFH7EA.js} +1 -1
  97. package/dist/web/assets/{training-1du5QD-P.css → training-BN8CALIc.css} +1 -1
  98. package/dist/web/assets/{tsMode-B4lEUN5X.js → tsMode-BU-tuKsY.js} +1 -1
  99. package/dist/web/assets/{upload-DNbYB4Rl.js → upload-DU_81jvL.js} +1 -1
  100. package/dist/web/assets/{wifi-off-C5QLifIJ.js → wifi-off-TPsBnbGW.js} +1 -1
  101. package/dist/web/assets/{workers-CV4BZb_x.js → workers-NhWySRdT.js} +1 -1
  102. package/dist/web/assets/{yaml-3ah8oX43.js → yaml-DWXa_3ZL.js} +1 -1
  103. package/dist/web/index.html +2 -2
  104. package/package.json +1 -1
  105. package/dist/web/assets/CommandMenu-B3Y4MvmT.js +0 -1
  106. package/dist/web/assets/ComposerCreateImproveStrip-DeRI5XEO.js +0 -1
  107. package/dist/web/assets/LabsRoute-CgKtVYTP.css +0 -1
  108. package/dist/web/assets/LabsRoute-Cs_R1fuu.js +0 -3
  109. package/dist/web/assets/MainChatThread-h7VSA_Rc.js +0 -2
  110. package/dist/web/assets/Messages-BANZuAnA.js +0 -10
  111. package/dist/web/assets/RightChatPanelStack-pGwbt6Wy.js +0 -1
  112. package/dist/web/assets/TrainingCreationPanel-BLSf1Bnp.js +0 -1
  113. package/dist/web/assets/WorkspaceDiffPanel-DTRtW9n8.js +0 -14
  114. package/dist/web/assets/circle-alert-DMHz5tj_.js +0 -1
  115. package/dist/web/assets/index-B5AN29EO.js +0 -177
  116. package/dist/web/assets/index-BnwYyUgT.js +0 -1
  117. package/dist/web/assets/index-COGlKIJ4.css +0 -1
  118. package/dist/web/assets/make-agent-tutorial-A2W9Ajwv.js +0 -2
@@ -0,0 +1 @@
1
+ .labs-route{display:grid;grid-template-rows:auto minmax(0,1fr);width:100%;height:100%;min-width:0;min-height:0;overflow:hidden;background:var(--bg);color:var(--text)}.main-pane.page-active>.labs-route{grid-column:1;grid-row:1}.main-pane.page-active.diff-open>.labs-route{max-height:100%}.labs-header{display:flex;align-items:center;justify-content:space-between;gap:16px;min-width:0;padding:8px 28px 0;background:color-mix(in srgb,var(--bg) 94%,var(--panel))}.labs-header-navigation,.labs-header-actions{display:flex;align-items:center;gap:8px;min-width:0}.labs-create-button{display:inline-flex;align-items:center;justify-content:center;gap:6px;height:28px;flex:0 0 auto;padding:0 9px;border:1px solid #fff;border-radius:7px;background:#fff;color:#111;font:inherit;font-size:12px;font-weight:550;cursor:pointer}.labs-create-button:hover{background:#f1f1f1;border-color:#f1f1f1}.labs-primary-tabs{display:flex;align-items:center;gap:2px;min-width:0}.labs-primary-tabs button,.labs-subtabs button{display:inline-flex;align-items:center;gap:6px;border:0;border-bottom:2px solid transparent;background:transparent;color:var(--muted);padding:11px 12px 10px;font:inherit;font-size:12px;cursor:pointer}.labs-primary-tabs button.active,.labs-subtabs button.active{border-bottom-color:var(--text);color:var(--text)}.labs-primary-tabs button span,.labs-subtabs button span{color:var(--muted);font-size:10px}.labs-create-anchor{position:relative}.labs-create-menu{position:absolute;z-index:50;top:calc(100% + 4px);right:0;min-width:174px;border:0;border-radius:8px;background:#1d1d1d;box-shadow:0 14px 36px #0000006b;padding:4px}.labs-create-menu button{display:flex;align-items:center;gap:8px;width:100%;min-height:30px;border:0;border-radius:6px;background:transparent;color:var(--muted-strong);padding:0 9px;text-align:left;text-decoration:none;font-size:13px;cursor:pointer}.labs-create-menu button svg{flex:0 0 auto}.labs-create-menu button:hover,.labs-create-menu button:focus-visible{outline:0;background:#ffffff14;color:var(--text)}.labs-create-menu button:disabled{color:var(--muted);cursor:default;opacity:.62}.labs-create-menu button:disabled:hover,.labs-create-menu button:disabled:focus-visible{background:transparent;color:var(--muted)}.labs-create-menu strong{font-size:inherit;font-weight:400}.labs-create-menu small{display:none}.labs-panel{min-width:0;min-height:0;overflow:auto;scrollbar-color:rgba(255,255,255,.24) transparent;scrollbar-width:thin}.labs-flat-body{display:grid;gap:12px;width:min(1180px,calc(100% - 56px));margin-inline:auto;padding:8px 0 56px}.labs-dataset-detail-heading h1{margin:0;font-size:20px}.labs-dataset-detail-heading p{max-width:760px;margin:4px 0 0;color:var(--muted);font-size:11px;line-height:1.5}.labs-dataset-detail-heading{display:grid;grid-template-columns:auto minmax(0,1fr) auto;align-items:start;gap:12px;padding:12px 0 6px}.labs-datasets-page>.training-detail-tabs{padding:0}.labs-datasets-page>.training-detail-tabs button:disabled{cursor:not-allowed;opacity:.45}.labs-dataset-heading-spacer{width:31px;height:31px}.labs-back-button{display:grid;place-items:center;width:30px;height:30px;border:1px solid var(--border);border-radius:6px;background:transparent;color:var(--text);cursor:pointer}.labs-back-button:hover{background:var(--panel-soft)}.labs-datasets-table td:first-child{min-width:320px}.labs-workproduct-link{appearance:none;display:grid;width:100%;min-width:0;gap:3px;border:0;background:transparent;color:var(--text);padding:0;text-align:left;cursor:pointer;font:inherit}.labs-workproduct-link strong{overflow:hidden;font-size:12px;text-overflow:ellipsis;white-space:nowrap}.labs-workproduct-link span{overflow:hidden;color:var(--muted);font-size:10px;text-overflow:ellipsis;white-space:nowrap}.labs-home-models{display:grid;gap:10px;margin-top:10px;border-top:1px solid var(--border);padding-top:18px}.labs-section-heading{display:flex;align-items:flex-end;justify-content:space-between;gap:14px}.labs-section-heading h2{margin:0;font-size:15px}.labs-section-heading p{margin:3px 0 0;color:var(--muted);font-size:10px}.labs-section-heading>button{border:0;background:transparent;color:var(--muted-strong);padding:3px 0;font:inherit;font-size:11px;cursor:pointer}.labs-section-heading>button:hover{color:var(--text)}.labs-home-profile-controls .account-settings{max-width:none}.labs-home-profile-controls .profile-view{width:100%;justify-self:stretch;gap:0;padding:0}.labs-home-profile-controls .profile-control-panel{padding:2px 0 4px}.labs-training-run-name{display:grid;min-width:260px;gap:3px;padding:4px 0}.labs-training-run-progress-wrap{display:grid;gap:2px;margin-top:2px}.labs-training-run-name>strong{color:var(--text);font-size:12px}.labs-training-run-name>span,.labs-training-run-progress small,.labs-training-run-verdicts{color:var(--muted);font-size:10px;line-height:1.4}.labs-training-run-progress{display:flex;align-items:center;gap:8px}.labs-training-run-progress progress{width:min(180px,45%);height:5px;accent-color:var(--cyan)}.labs-model-baseline-facts{margin-top:12px}.labs-training-run-progress small{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.labs-workproduct-toolbar{display:flex;align-items:center;gap:8px}.labs-search{display:flex;align-items:center;flex:1;min-width:0;gap:7px;border:1px solid var(--border);border-radius:7px;background:var(--panel);padding:0 9px;color:var(--muted)}.labs-search input{width:100%;min-width:0;border:0;background:transparent;color:var(--text);padding:8px 0;font:inherit;font-size:12px;outline:0}.labs-workproduct-toolbar select{min-width:130px;border:1px solid var(--border);border-radius:7px;background:var(--panel);color:var(--text);padding:8px 9px;font:inherit;font-size:12px}.labs-table-empty{display:flex;min-height:88px;align-items:center;justify-content:center;gap:8px;border:1px solid var(--border);border-radius:8px;background:var(--panel);color:var(--muted);font-size:12px}.labs-workproducts-table{min-width:860px}.labs-workproducts-table th:first-child{width:8%}.labs-workproducts-table th:nth-child(2){width:32%}.labs-workproducts-table th:nth-child(4){width:9%}.labs-workproducts-table th:nth-child(5){width:8%}.labs-workproducts-table th:nth-child(6){width:9%}.labs-workproducts-table td:last-child{text-align:right;color:var(--muted)}.labs-workproducts-table.models-only th:first-child{width:42%}.labs-workproducts-table.models-only th:nth-child(2){width:18%}.labs-workproducts-table.models-only th:nth-child(3),.labs-workproducts-table.models-only th:nth-child(4){width:10%}.labs-workproducts-table.models-only td:first-child{min-width:280px}.labs-workproduct-use{min-height:28px}.labs-workproduct-actions{display:inline-flex;align-items:center;justify-content:flex-end;gap:8px}.labs-workproduct-training,.labs-workproduct-evals{text-align:center}.labs-workproduct-indicator{display:inline-flex;min-width:28px;align-items:center;justify-content:center;gap:4px;color:var(--muted)}.labs-workproduct-indicator strong{font-size:11px;font-variant-numeric:tabular-nums}.labs-workproduct-indicator.active{color:#68a8dd}.labs-workproduct-indicator.positive{color:#55aa74}.labs-workproduct-indicator.negative{color:#d76b70}.labs-workproduct-indicator.neutral,.labs-workproduct-na{color:var(--muted)}.labs-workproduct-na{font-size:12px}.labs-workproduct-updated{color:var(--muted);font-size:10px;white-space:nowrap}.labs-workproducts-table td:nth-child(2) button{display:grid;gap:3px;border:0;background:transparent;color:var(--text);padding:0;font:inherit;text-align:left;cursor:pointer}.labs-workproducts-table td:nth-child(2) strong{font-size:13px}.labs-workproducts-table td:nth-child(2) span{display:block;max-width:360px;overflow:hidden;color:var(--muted);font-size:10px;text-overflow:ellipsis;white-space:nowrap}.labs-workproducts-table code{display:block;max-width:220px;overflow:hidden;color:var(--muted);font-size:10px;text-overflow:ellipsis;white-space:nowrap}.labs-workproduct-type{color:var(--muted-strong);font-size:11px;font-weight:600}.labs-status-badge{display:inline-flex;align-items:center;width:max-content;border-radius:999px;padding:3px 8px;color:#fff;font-size:10px;font-weight:600;line-height:1.25;white-space:nowrap}.labs-status-badge.positive{background:#34784e}.labs-status-badge.info{background:#3f6394}.labs-status-badge.warning{background:#8b681f}.labs-status-badge.negative{background:#91484b}.labs-status-badge.neutral{background:#565861}.labs-pagination{display:flex;align-items:center;justify-content:flex-end;gap:10px;color:var(--muted);font-size:11px}.labs-pagination button{border:1px solid var(--border);border-radius:6px;background:transparent;color:var(--text);padding:5px 8px;font:inherit;font-size:11px;cursor:pointer}.labs-pagination button:disabled{opacity:.42;cursor:default}.labs-suggestions-page{min-height:100%}.labs-subtabs{display:flex;gap:2px;padding:0 28px}.labs-suggestions-body{overflow:auto}.labs-suggestions-body .insights-view,.labs-suggestions-body .training-page-body{width:min(1180px,calc(100% - 56px));margin-inline:auto}.labs-workproduct-detail{padding-top:22px}.labs-workproduct-detail-header{align-items:center}.labs-workproduct-detail-header>div:first-child{display:grid;min-width:0;gap:8px}.labs-workproduct-name-row{display:flex;align-items:center;min-width:0;gap:10px}.labs-workproduct-name-row h1{min-width:0}.labs-workproduct-header-actions,.labs-eval-actions{display:flex;align-items:center;justify-content:flex-end;flex-wrap:wrap;gap:6px}.labs-rename-backdrop{position:fixed;z-index:100;inset:0;display:flex;align-items:center;justify-content:center;background:#050609ad;padding:24px}.labs-rename-dialog{width:min(440px,100%);overflow:hidden;border:1px solid var(--border);border-radius:12px;background:var(--panel);box-shadow:0 22px 70px #0000006b}.labs-rename-dialog>header{display:grid;grid-template-columns:auto minmax(0,1fr) auto;align-items:start;gap:11px;border-bottom:1px solid var(--border);padding:16px 17px}.labs-rename-dialog h2,.labs-rename-dialog p{margin:0}.labs-rename-dialog h2{color:var(--text);font-size:14px}.labs-rename-dialog header p{margin-top:4px;color:var(--muted);font-size:11px;line-height:1.45}.labs-rename-dialog-icon{display:inline-flex;width:30px;height:30px;align-items:center;justify-content:center;border-radius:8px;background:#6291d124;color:#7da9e4}.labs-rename-dialog header button{display:inline-flex;width:28px;height:28px;align-items:center;justify-content:center;border:0;border-radius:6px;background:transparent;color:var(--muted);cursor:pointer}.labs-rename-dialog header button:hover:not(:disabled){background:#ffffff12;color:var(--text)}.labs-rename-dialog form{display:grid;gap:14px;padding:17px}.labs-rename-dialog form>label{display:grid;gap:7px;color:var(--muted-strong);font-size:11px;font-weight:650}.labs-rename-dialog input{width:100%;min-width:0;border:1px solid var(--border);border-radius:7px;outline:none;background:var(--bg);color:var(--text);padding:9px 10px;font:inherit;font-size:12px}.labs-rename-dialog input:focus{border-color:#5c8cc9;box-shadow:0 0 0 2px #5c8cc92e}.labs-rename-agent-id{display:flex;min-width:0;align-items:center;justify-content:space-between;gap:12px;color:var(--muted);font-size:10px}.labs-rename-agent-id code{overflow:hidden;color:var(--muted-strong);text-overflow:ellipsis;white-space:nowrap}.labs-rename-error{color:#e47b7f;font-size:11px}.labs-rename-dialog footer{display:flex;justify-content:flex-end;gap:8px}.labs-rename-dialog footer button{min-height:30px;border:1px solid var(--border);border-radius:7px;background:transparent;color:var(--text);padding:0 12px;font:inherit;font-size:11px;font-weight:650;cursor:pointer}.labs-rename-dialog footer button[type=submit]{border-color:#4e7db9;background:#416da3;color:#fff}.labs-rename-dialog button:disabled{cursor:default;opacity:.5}.labs-run-decision .composer-create-strip{margin:0}.labs-run-decision{display:grid;gap:10px}.labs-run-decision-actions{display:flex;justify-content:flex-end;gap:7px}.labs-status-dot{width:9px;height:9px;flex:0 0 auto;border-radius:999px;background:#565861}.labs-status-dot.small{width:7px;height:7px;margin-left:1px}.labs-status-dot.positive{background:#48a868}.labs-status-dot.info{background:#6291d1}.labs-status-dot.warning{background:#c89b3c}.labs-status-dot.negative{background:#c45e62}.labs-dataset-build-editor{display:flex;min-height:100%;flex-direction:column}.labs-dataset-build-back{align-self:flex-start;margin-top:16px}.labs-dataset-builder-workspace{display:flex;min-height:520px;flex:1;flex-direction:column;padding-top:12px}.labs-dataset-builder-workspace>.training-dialog-scroll-body,.labs-dataset-builder-workspace>.training-evidence-required>.training-dialog-scroll-body{max-height:none;overflow:visible}.labs-dataset-builder-workspace>.training-dialog-actions,.labs-dataset-builder-workspace>.training-evidence-required>.training-dialog-actions{margin-top:24px;border-top:1px solid var(--border);padding-top:16px}.labs-dataset-builder-workspace .training-source-options{max-height:440px}.labs-dataset-grader-list{display:grid;border:1px solid var(--border);border-radius:8px;overflow:hidden}.labs-dataset-grader-list>div{display:flex;align-items:center;justify-content:space-between;gap:16px;padding:11px 12px;border-bottom:1px solid var(--border)}.labs-dataset-grader-list>div:last-child{border-bottom:0}.labs-dataset-grader-list strong{font-size:12px}.labs-dataset-grader-list small{color:var(--muted);font-size:10px}.labs-change-page{display:grid;gap:20px;padding-top:18px}.labs-change-index,.labs-change-run-detail{display:grid;gap:14px;padding-top:18px}.labs-change-actions{display:flex;flex:0 0 auto;align-items:center;gap:7px}.labs-change-facts{display:grid;grid-template-columns:130px 130px minmax(0,1fr);margin:0;border-block:1px solid var(--border)}.labs-change-facts>div{display:grid;min-width:0;gap:4px;padding:12px 14px;border-right:1px solid var(--border)}.labs-change-facts>div:first-child{padding-left:0}.labs-change-facts>div:last-child{border-right:0}.labs-change-facts dt{color:var(--muted);font-size:10px}.labs-change-facts dd{margin:0;overflow:hidden;font:11px/1.4 monospace;text-overflow:ellipsis;white-space:nowrap}.labs-change-message,.labs-change-empty{display:flex;align-items:center;gap:8px;border:1px solid var(--border);border-radius:8px;padding:11px 12px;color:var(--muted);font-size:12px}.labs-change-message.negative,.labs-change-empty.negative{border-color:color-mix(in srgb,#c45e62 48%,var(--border));color:#db7779}.labs-change-timeline{position:relative;display:grid;gap:14px}.labs-change-timeline:before{position:absolute;z-index:0;top:0;bottom:0;left:7.5%;width:1px;background:var(--border);content:""}.labs-change-timeline-item{position:relative;z-index:1}.labs-change-card{display:grid;overflow:hidden;min-width:0;border:1px solid var(--border);border-radius:9px;background:var(--panel)}.labs-change-card-header,.labs-change-card-footer{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:10px 13px}.labs-change-card-header{padding-bottom:4px}.labs-change-card-header>span:last-child{color:var(--muted);font-size:10px}.labs-change-card-body{display:grid;gap:6px;padding:14px 13px}.labs-change-card-body h3{margin:0;font-size:14px;line-height:1.45}.labs-change-card-body p{margin:0;color:var(--muted);font-size:11px;line-height:1.55}.labs-change-card-footer{padding-top:4px}.labs-change-card-footer.end{justify-content:flex-end}.labs-change-timeline-label{color:var(--muted);font-size:10px}.labs-change-footer-status{display:flex;align-items:center;gap:7px;color:var(--muted-strong);font-size:11px}.labs-change-evals{display:grid}.labs-change-eval{display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:center;gap:10px;min-height:58px;padding:0 13px;border-bottom:1px solid var(--border)}.labs-change-eval:last-child{border-bottom:0}.labs-change-eval>div{display:grid;min-width:0;gap:3px}.labs-change-eval strong{overflow:hidden;font-size:12px;text-overflow:ellipsis;white-space:nowrap}.labs-change-eval span{color:var(--muted);font-size:10px}.labs-change-evals .labs-change-empty{border:0;border-radius:0}.labs-eval-receipts{display:grid;gap:8px}.labs-agent-change-history{min-width:700px}.labs-agent-change-history th:first-child{width:48%}.labs-agent-change-history td:first-child button{display:grid;gap:3px;width:100%;border:0;background:transparent;color:var(--text);padding:0;font:inherit;text-align:left;cursor:pointer}.labs-agent-change-history td:first-child strong{overflow:hidden;font-size:12px;text-overflow:ellipsis;white-space:nowrap}.labs-agent-change-history td:first-child span{color:var(--muted);font-size:10px}.labs-inline-facts{display:flex;gap:28px;flex-wrap:wrap;margin:0}.labs-inline-facts>div{display:grid;gap:3px}.labs-inline-facts dt{color:var(--muted);font-size:10px}.labs-inline-facts dd{margin:0;max-width:420px;overflow-wrap:anywhere;font-size:12px;font-weight:560}.labs-method-tabs{display:inline-flex;gap:3px;margin:0 0 18px;border:1px solid var(--border);border-radius:8px;background:var(--panel-soft);padding:3px}.labs-method-tabs button{display:flex;align-items:baseline;gap:8px;min-width:150px;border:0;border-radius:5px;background:transparent;color:var(--muted);padding:8px 11px;font:inherit;font-size:12px;text-align:left;cursor:pointer}.labs-method-tabs button:hover{color:var(--text)}.labs-method-tabs button.active{background:var(--panel);color:var(--text);box-shadow:inset 0 0 0 1px var(--border)}.labs-method-tabs button strong{margin-left:auto;color:inherit;font-size:10px}.labs-dataset-summary,.labs-eval-copy,.labs-version-storage-copy{margin-top:0;margin-bottom:16px}.labs-dataset-tabs{display:flex;width:fit-content}.labs-dataset-tabs button{min-width:132px}.labs-dataset-tabs button>span{margin-left:auto;color:var(--muted);font-size:10px}.labs-dataset-examples{display:grid;gap:8px}.labs-dataset-show-all{justify-self:center;margin-top:4px}.labs-dataset-example{overflow:hidden;border:1px solid var(--border);border-radius:8px;background:var(--panel-soft)}.labs-dataset-example>summary{display:grid;grid-template-columns:28px minmax(0,1fr) auto;align-items:center;gap:10px;padding:11px 12px;cursor:pointer;list-style:none}.labs-dataset-example>summary::-webkit-details-marker{display:none}.labs-dataset-example[open]>summary{background:var(--panel)}.labs-dataset-example-index{color:var(--muted);font:10px/1 var(--mono)}.labs-dataset-example-title{display:grid;min-width:0;gap:4px}.labs-dataset-example-title strong{overflow:hidden;font-size:12px;font-weight:560;text-overflow:ellipsis;white-space:nowrap}.labs-dataset-example-title small{color:var(--muted);font-size:10px}.labs-dataset-example-body{display:grid;gap:15px;border-top:1px solid var(--border);padding:14px}.labs-dataset-example-body section{display:grid;gap:6px}.labs-dataset-example-body h3,.labs-version-promotion>h3{margin:0;font-size:11px}.labs-dataset-example-body p{margin:0;color:var(--muted-strong);font-size:12px;line-height:1.55}.labs-dataset-example-body pre{max-height:180px;overflow:auto;margin:0;border:1px solid var(--border);border-radius:6px;background:var(--bg);padding:9px 10px;color:var(--text);font:10px/1.5 var(--mono);white-space:pre-wrap}.labs-dataset-example-advanced>summary,.labs-run-technical>summary{color:var(--muted);font-size:11px;cursor:pointer}.labs-dataset-example-advanced .training-configuration-list,.labs-run-technical .training-configuration-list{margin-top:10px}.labs-run-technical{margin-top:14px;border-top:1px solid var(--border);padding-top:10px}.labs-eval-setup>summary{color:var(--muted-strong);font-size:12px;cursor:pointer}.labs-eval-setup .training-table-wrap{margin-top:12px}.labs-version-storage{display:grid;gap:4px;max-width:280px}.labs-version-name{min-width:92px}.labs-version-name strong,.labs-version-name small{display:block}.labs-version-name small{margin-top:3px;color:var(--muted);font-size:10px}.labs-version-storage code{overflow:hidden;color:var(--muted);font-size:9px;text-overflow:ellipsis;white-space:nowrap}.labs-version-promotion{display:grid;gap:12px;margin-top:18px;border-top:1px solid var(--border);padding-top:16px}.labs-detail-copy{margin:14px 0 0;color:var(--muted);font-size:12px;line-height:1.55}.labs-expert-bootstrap-summary{display:grid;gap:12px}.labs-expert-bootstrap-summary>div:first-child{display:flex;align-items:center;gap:10px}.labs-expert-bootstrap-summary p{margin:0;color:var(--muted);font-size:12px;line-height:1.5}.labs-expert-bootstrap-dialog{width:min(820px,calc(100vw - 40px));max-height:min(780px,calc(100vh - 40px))}.labs-expert-trajectory-list{display:grid;gap:9px;margin-top:16px}.labs-expert-preview-facts{margin-bottom:4px}.labs-expert-trajectory{overflow:hidden;border:1px solid var(--border);border-radius:8px;background:var(--panel-soft)}.labs-expert-trajectory>summary{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:11px 12px;cursor:pointer;list-style:none}.labs-expert-trajectory>summary::-webkit-details-marker{display:none}.labs-expert-trajectory>summary>span:first-child{display:grid;gap:3px}.labs-expert-trajectory summary strong{font-size:12px}.labs-expert-trajectory summary small,.labs-expert-approval-note{color:var(--muted);font-size:11px}.labs-expert-trajectory[open]>summary>span:last-child{transform:rotate(90deg)}.labs-expert-trajectory-body{display:grid;gap:14px;border-top:1px solid var(--border);padding:13px}.labs-expert-trajectory-body section{display:grid;gap:6px}.labs-expert-trajectory-body h3{margin:0;font-size:11px}.labs-expert-trajectory-body p{margin:0;color:var(--muted);font-size:12px;line-height:1.5}.labs-expert-trajectory-body .training-pills span{border:1px solid var(--border);border-radius:999px;background:var(--panel);padding:3px 7px;color:var(--muted);font-family:var(--mono);font-size:10px}.labs-expert-trajectory-body pre{max-height:260px;overflow:auto;margin:0;border:1px solid var(--border);border-radius:6px;background:var(--bg);padding:9px;color:var(--text);font:10px/1.5 var(--mono);white-space:pre-wrap;overflow-wrap:anywhere}.labs-expert-messages>summary{color:var(--muted);font-size:11px;cursor:pointer}.labs-expert-messages pre{margin-top:8px}.labs-expert-bootstrap-dialog .training-dialog-actions{flex-wrap:nowrap}.labs-expert-approval-note{margin-right:auto}.labs-eval-summary{display:grid;gap:14px}.labs-eval-actions .dropdown-select{min-width:160px}.labs-validation-list{margin:14px 0 0;padding-left:18px;color:var(--muted);font-size:11px;line-height:1.5}.labs-activity-table{min-width:720px}.labs-model-eval-table{min-width:680px}.labs-training-error{margin:14px 0 0;color:#db7779;font-size:11px;line-height:1.5;white-space:pre-wrap}.labs-source-evals{display:grid;gap:8px}.labs-source-evals>strong{font-size:12px}.labs-source-evals ul{display:grid;gap:6px;margin:0;padding:0;list-style:none}.labs-source-evals li{display:flex;align-items:center;justify-content:space-between;gap:12px;border-bottom:1px solid var(--border);padding:0 0 6px}.labs-source-evals code{color:var(--muted);font-size:11px}.labs-source-evals+.labs-source-evals,.labs-source-evals+.training-table-wrap{margin-top:14px}.labs-models-table{min-width:820px}.labs-models-table th:first-child,.labs-models-table td:first-child{width:36%}.labs-models-table th:nth-child(2),.labs-models-table td:nth-child(2){width:190px}.labs-model-versions-table{min-width:860px}.labs-model-version-index{min-width:0}.labs-model-version-detail{display:grid;min-width:0;gap:14px}.labs-model-version-back{width:fit-content}.labs-version-row-button{display:grid;width:100%;gap:2px;border:0;background:transparent;padding:0;color:inherit;font:inherit;text-align:left;cursor:pointer}.labs-version-row-button small{color:var(--muted);font-family:var(--mono);font-size:10px}.labs-version-dataset-link{border:0;background:transparent;padding:0;color:var(--text);font:inherit;text-align:left;cursor:pointer}.labs-version-dataset-link:hover{text-decoration:underline;text-underline-offset:2px}.labs-version-detail-dataset{margin-top:14px}.labs-version-icon-button{display:inline-flex;align-items:center;justify-content:center;width:30px;height:30px;border:1px solid var(--border);border-radius:7px;background:transparent;color:var(--muted-strong)}.labs-version-icon-button[aria-pressed=true]{background:var(--panel-soft);color:var(--text)}.labs-new-version-dialog{width:min(640px,calc(100vw - 32px))}.labs-new-version-step{display:flex;align-items:flex-start;gap:10px;margin-top:16px}.labs-new-version-step-number{display:inline-flex;align-items:center;justify-content:center;width:22px;height:22px;border-radius:999px;background:var(--accent);color:#fff;font-size:11px;font-weight:700}.labs-new-version-step>div{display:grid;gap:2px}.labs-new-version-step p{margin:0;color:var(--muted);font-size:11px}.labs-new-version-select{display:grid;gap:6px;margin:12px 0;color:var(--muted-strong);font-size:11px}.labs-new-version-select select{width:100%;border:1px solid var(--border);border-radius:8px;background:var(--panel-soft);padding:9px 10px;color:var(--text)}.labs-new-version-dataset-facts{margin-bottom:18px}@media(max-width:860px){.labs-header{padding:8px 18px 0}.labs-primary-tabs button{padding-inline:8px}.labs-flat-body{width:calc(100% - 36px);padding:20px 0 36px}.labs-workproduct-toolbar{align-items:stretch;flex-direction:column}.labs-workproduct-toolbar select{width:100%}.labs-workproduct-detail{width:calc(100% - 36px)}.labs-workproduct-detail-header{align-items:flex-start;flex-direction:column}.labs-change-actions{width:100%}.labs-change-actions .training-button{flex:1}.labs-change-facts{grid-template-columns:minmax(0,1fr)}.labs-change-facts>div{border-right:0;border-bottom:1px solid var(--border);padding-inline:14px}.labs-change-facts>div:last-child{border-bottom:0}.labs-change-card-footer:not(.end){align-items:stretch;flex-direction:column}.labs-change-card-footer.end .training-button{width:100%}.labs-inline-facts{gap:16px}.labs-method-tabs{display:grid;width:100%;grid-template-columns:repeat(2,minmax(0,1fr))}.labs-dataset-tabs{grid-template-columns:repeat(3,minmax(0,1fr))}.labs-method-tabs button,.labs-dataset-tabs button{min-width:0}.labs-suggestions-body .insights-view,.labs-suggestions-body .training-page-body{width:calc(100% - 36px)}}@media(max-width:560px){.labs-primary-tabs button{font-size:11px;padding-inline:6px}.labs-primary-tabs button span{display:none}.labs-create-menu{right:-2px;width:min(270px,calc(100vw - 28px))}}.insights-view{display:grid;align-content:start;gap:24px;width:min(980px,calc(100% - 72px));min-width:0;justify-self:center;padding:42px 0 64px}.insights-empty,.insights-error{margin:0;color:var(--muted);font-size:13px;line-height:1.5}.insights-scan-preference{display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:24px;min-width:0}.insights-scan-preference>div:first-child{display:grid;gap:4px;min-width:0}.insights-scan-preference strong{color:var(--text);font-size:13px;font-weight:600}.insights-scan-preference span{color:var(--muted);font-size:12px;line-height:1.45}.insights-scan-controls{display:inline-flex;align-items:center;justify-content:flex-end;gap:12px;flex:0 0 auto}.insights-scan-preference button{flex:0 0 auto;min-width:72px;min-height:32px;border:1px solid var(--border);border-radius:8px;background:transparent;color:var(--muted);padding:0 11px}.insights-scan-preference button:hover:not(:disabled){background:var(--panel-hover);color:var(--text)}.insights-scan-preference button.active{border-color:color-mix(in srgb,#67d59a 40%,var(--border));background:color-mix(in srgb,#67d59a 9%,transparent);color:#79d8a4}.insights-scan-preference button:disabled{opacity:.65}.insights-scan-countdown{display:inline-flex;align-items:center;gap:7px;color:var(--muted);font-size:12px;white-space:nowrap}.insights-scan-dot{width:7px;height:7px;border-radius:999px;background:#f0d77a}.insights-scan-countdown.running .insights-scan-dot{background:#6ee7a8}.insights-active-scan{display:inline-flex;align-items:center;gap:10px;width:fit-content;max-width:100%;border:1px solid rgba(110,231,168,.24);border-radius:8px;background:#6ee7a812;color:var(--muted-strong);padding:9px 11px}.insights-active-scan .insights-scan-dot{background:#6ee7a8}.insights-active-scan div{display:grid;gap:2px;min-width:0}.insights-active-scan strong{color:var(--text);font-size:13px;font-weight:600}.insights-active-scan span:not(.insights-scan-dot){color:var(--muted);font-size:12px}.insights-error{color:#ff8a84}.insights-filters{display:grid;grid-template-columns:repeat(auto-fit,minmax(120px,1fr));align-items:end;gap:12px;min-width:0}.insights-filter-group{display:grid;gap:6px;min-width:0}.insights-filter-group>span{color:var(--muted);font-size:12px}.insights-filter-group select{width:100%;min-width:0;min-height:34px;border:1px solid var(--border);border-radius:8px;background:var(--panel);color:var(--text);padding:0 30px 0 10px;font:inherit;font-size:12px}.insights-filter-group select:hover{border-color:color-mix(in srgb,var(--text) 22%,var(--border))}.insights-filter-group select:focus-visible{outline:2px solid color-mix(in srgb,var(--accent, #7aa2ff) 55%,transparent);outline-offset:1px}.insights-section{display:grid;gap:10px;min-width:0}.insights-section h2{margin:0;color:var(--muted-strong);font-size:13px;font-weight:600}.insights-table-frame{min-width:0;overflow:hidden;border:1px solid var(--border);border-radius:8px;background:var(--panel)}.insights-table-scroll{width:100%;overflow-x:auto}.insights-table{width:100%;min-width:760px;border-collapse:collapse;color:var(--text);font-size:12px;text-align:left}.insights-runs-table{min-width:880px}.insights-table th,.insights-table td{min-width:0;border-bottom:1px solid var(--border);text-align:left;vertical-align:middle}.insights-table th{padding:9px 12px;background:var(--panel-soft);color:var(--muted);font-size:12px;font-weight:500;white-space:nowrap}.insights-table td{padding:11px 12px}.insights-table tbody tr:last-child td{border-bottom:0}.insights-table tbody tr:hover{background:var(--panel-soft)}.insights-observations-table th:nth-child(1),.insights-observations-table td:nth-child(1){width:92px}.insights-observations-table th:nth-child(2),.insights-observations-table td:nth-child(2){width:110px}.insights-observations-table th:nth-child(4),.insights-observations-table td:nth-child(4){width:132px}.insights-observations-table th:nth-child(5),.insights-observations-table td:nth-child(5){width:150px}.insights-runs-table th:nth-child(1),.insights-runs-table td:nth-child(1){width:112px}.insights-runs-table th:nth-child(2),.insights-runs-table td:nth-child(2){width:98px}.insights-runs-table th:nth-child(3),.insights-runs-table td:nth-child(3){width:160px}.insights-runs-table th:nth-child(5),.insights-runs-table td:nth-child(5){width:136px}.insights-runs-table th:nth-child(6),.insights-runs-table td:nth-child(6){width:112px}.insights-severity{display:inline-flex;align-items:center;min-height:22px;border-radius:7px;padding:0 7px;font-size:12px}.insights-severity.nit{background:#3aa3ff1f;color:#8bc7ff}.insights-severity.concern{background:#f4c5421f;color:#f0d77a}.insights-severity.blocker{background:#ff706a24;color:#ff9b96}.insights-status,.insights-status-stack,.insights-time{overflow:hidden;color:var(--muted);text-overflow:ellipsis;white-space:nowrap}.insights-status-stack{display:grid;gap:3px}.insights-status-stack small{overflow:hidden;color:var(--muted);font-size:11px;text-overflow:ellipsis}.insights-copy{display:grid;gap:4px;min-width:0}.insights-copy strong,.insights-copy span{min-width:0;overflow-wrap:anywhere}.insights-copy strong{color:var(--text);font-size:13px;font-weight:600}.insights-copy span{color:var(--muted-strong);line-height:1.4}.insights-actions{display:flex;align-items:center;justify-content:flex-end;gap:5px;min-width:0}.insights-actions button{display:inline-grid;place-items:center;width:28px;height:28px;border:0;border-radius:7px;background:transparent;color:var(--muted);padding:0}.insights-actions .insights-text-action{width:auto;min-width:28px;padding:0 8px;white-space:nowrap}.insights-actions button:hover{background:#ffffff14;color:var(--text)}.insights-pagination{display:flex;align-items:center;justify-content:space-between;gap:16px;border-top:1px solid var(--border);padding:8px 10px;color:var(--muted);font-size:12px}.insights-pagination>div{display:inline-flex;align-items:center;gap:10px}.insights-pagination button{min-height:28px;border:1px solid var(--border);border-radius:7px;background:transparent;color:var(--muted-strong);padding:0 9px;font-size:12px}.insights-pagination button:hover:not(:disabled){background:var(--panel-hover);color:var(--text)}.insights-pagination button:disabled{opacity:.42}@media(max-width:900px){.insights-filters{grid-template-columns:repeat(3,minmax(140px,1fr))}}@media(max-width:780px){.insights-view{width:min(100% - 32px,980px);padding:26px 0 42px}.insights-scan-preference{align-items:stretch;flex-direction:column;gap:12px}.insights-scan-controls{justify-content:space-between}.insights-filters{grid-template-columns:repeat(2,minmax(130px,1fr))}}@media(max-width:480px){.insights-filters{grid-template-columns:minmax(0,1fr)}}
@@ -0,0 +1,2 @@
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./TrainingCreationPanel-COg1wvw8.js","./index-Cr_RZ7GD.js","./index-9tbdqUau.css","./training-BN8CALIc.css"])))=>i.map(i=>d[i]);
2
+ import{j as i,r as s,af as j}from"./index-Cr_RZ7GD.js";import{T as _,M as T}from"./Messages-C7uHGoFw.js";import"./chevron-up-BTn9DVRP.js";import"./copy-BsYs6wBI.js";import"./credit-card-BCePAwMI.js";import"./MarkdownText-CkVkr3P1.js";import"./circle-x-B9Qa8o5a.js";import"./git-branch-C7qQYFIs.js";const R=s.lazy(()=>j(()=>import("./TrainingCreationPanel-COg1wvw8.js"),__vite__mapDeps([0,1,2,3]),import.meta.url).then(e=>({default:e.TrainingStatusReceipt})));function F({accountBaseUrl:e,activeWorkspaceAppId:r,billingOrganizationSlug:n,billingTeamId:o,connection:p,creation:a,onOpenBrowserLink:l,onOpenFileInSidebar:m,onOpenProfileSettings:c,onOpenSession:d,onScroll:h,preparingInitialScroll:u,rows:x,threadRef:g,workspaceRootPath:f}){return i.jsxs("section",{className:`chat-thread${u?" initial-scroll-pending":""}`,"aria-label":"Conversation",ref:g,onScroll:h,children:[x.map(t=>t.type==="thinking"?i.jsx(_,{},t.id):i.jsx(T,{activeWorkspaceAppId:r,accountBaseUrl:e,billingOrganizationSlug:n,billingTeamId:o,connection:p,message:t.message,onOpenFileInSidebar:m,onOpenBrowserLink:l,onOpenProfileSettings:c,onOpenSession:d,workspaceRootPath:f,showFooter:t.showFooter},t.id)),a?i.jsx(s.Suspense,{fallback:null,children:i.jsx(R,{creation:a})}):null]})}export{F as MainChatThread};
@@ -1,2 +1,2 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./MarkdownText-E35C404I.js","./index-B5AN29EO.js","./index-COGlKIJ4.css"])))=>i.map(i=>d[i]);
2
- import{r as l,j as e,W as g,a4 as w,ad as A,Y as T}from"./index-B5AN29EO.js";import{C as v}from"./copy-DuHI1UZ_.js";import{P as h}from"./play-BIHyH-Yu.js";import{m as _,c as C,M as E,a as x,d as b}from"./make-agent-tutorial-A2W9Ajwv.js";const L=l.lazy(()=>A(()=>import("./MarkdownText-E35C404I.js").then(a=>a.b),__vite__mapDeps([0,1,2]),import.meta.url).then(a=>({default:a.MarkdownText})));function M({activeVideoId:a,autoplay:r,onResizeStart:j,onSelectVideo:i,onSetAutoplay:f,onShowLessons:c,onShowScript:o,panelView:t}){const[n,d]=l.useState(!1),k=_(a),p=C(a),y={"play-all":"how-to-make-an-agent.md",create:"create-an-agent.md",use:"use-the-agent.md",improve:"improve-the-agent.md"}[a];l.useEffect(()=>{if(!n)return;const s=window.setTimeout(()=>d(!1),1600);return()=>window.clearTimeout(s)},[n]);function m(s){if(!["ArrowLeft","ArrowRight","Home","End"].includes(s.key))return;s.preventDefault();const u=s.key==="ArrowLeft"||s.key==="Home"?"lessons":"script";u==="lessons"?c():o(),document.getElementById(`make-agent-${u}-tab`)?.focus()}async function N(){await w(p)&&d(!0)}return e.jsxs("aside",{"aria-label":"Agents walkthrough panel",className:`workspace-diff-panel get-started-learning-panel show-${t}`,children:[e.jsx("div",{"aria-label":"Resize walkthrough panel","aria-orientation":"vertical",className:"workspace-diff-resize-handle",onPointerDown:j,role:"separator"}),e.jsx("div",{className:"workspace-diff-topbar get-started-learning-panel-tabs",children:e.jsxs("div",{"aria-label":"Walkthrough panel views",className:"workspace-diff-tabs",role:"tablist",children:[e.jsxs("button",{"aria-controls":"make-agent-lessons-panel","aria-selected":t==="lessons",className:`workspace-diff-tab ${t==="lessons"?"active":""}`,id:"make-agent-lessons-tab",onClick:c,onKeyDown:m,role:"tab",tabIndex:t==="lessons"?0:-1,type:"button",children:[e.jsx(h,{size:14}),e.jsx("span",{children:"Lessons"})]}),e.jsxs("button",{"aria-controls":"make-agent-script-panel","aria-selected":t==="script",className:`workspace-diff-tab ${t==="script"?"active":""}`,id:"make-agent-script-tab",onClick:o,onKeyDown:m,role:"tab",tabIndex:t==="script"?0:-1,type:"button",children:[e.jsx(g,{size:14}),e.jsx("span",{children:"Script"})]})]})}),t==="lessons"?e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"get-started-learning-panel-toolbar",children:[e.jsxs("span",{children:[e.jsx("strong",{children:E}),e.jsxs("small",{children:[x.length," lessons"]})]}),e.jsxs("button",{"aria-checked":r,"aria-label":"Autoplay lessons",className:`get-started-learning-autoplay ${r?"active":""}`,onClick:()=>f(!r),role:"switch",type:"button",children:[e.jsx("span",{children:"Autoplay"}),e.jsx("i",{"aria-hidden":"true"})]})]}),e.jsxs("div",{"aria-labelledby":"make-agent-lessons-tab",className:"get-started-learning-panel-body lessons",id:"make-agent-lessons-panel",role:"tabpanel",children:[e.jsx("ol",{children:x.map(s=>e.jsx("li",{children:e.jsxs("div",{className:"get-started-learning-lesson-card",children:[e.jsxs("button",{"aria-current":s.videoId===a?"true":void 0,"aria-label":`Play lesson ${s.lessonNumber}: ${s.title}`,className:"get-started-learning-lesson-button",onClick:()=>i(s.videoId),type:"button",children:[e.jsx("img",{alt:"",decoding:"async",loading:"lazy",src:s.posterUrl}),e.jsxs("span",{children:[e.jsxs("small",{children:[s.eyebrow," · ",s.duration]}),e.jsx("strong",{children:s.title})]})]}),e.jsx("button",{"aria-label":`Open script for ${s.title}`,className:"get-started-learning-script-button app-tooltip app-tooltip-right","data-tooltip":"Open script",onClick:()=>{i(s.videoId),o()},type:"button",children:e.jsx(g,{size:16})})]})},s.id))}),e.jsx("footer",{className:"get-started-learning-full-video",children:e.jsxs("button",{"aria-current":a==="play-all"?"true":void 0,"aria-label":`Play full video: ${b.title}`,onClick:()=>i("play-all"),type:"button",children:[e.jsx("span",{className:"get-started-learning-full-video-icon","aria-hidden":"true",children:e.jsx(h,{fill:"currentColor",size:13})}),e.jsxs("span",{children:[e.jsx("strong",{children:"Full video"}),e.jsxs("small",{children:[b.duration," · All 3 lessons"]})]})]})})]})]}):e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"get-started-learning-panel-toolbar file",children:[e.jsxs("span",{children:[e.jsx("small",{children:k.eyebrow}),e.jsx("strong",{children:y})]}),e.jsx("button",{"aria-label":n?"Script copied":"Copy walkthrough script",className:"diff-icon-button",onClick:()=>{N()},title:n?"Copied":"Copy script",type:"button",children:e.jsx(v,{size:14})})]}),e.jsx("div",{"aria-labelledby":"make-agent-script-tab",className:"get-started-learning-panel-body script",id:"make-agent-script-panel",role:"tabpanel",children:e.jsx("div",{className:"workspace-markdown-preview",children:e.jsx(l.Suspense,{fallback:e.jsx(z,{}),children:e.jsx(L,{content:p})})})})]})]})}function z(){return e.jsxs("div",{className:"get-started-script-status",children:[e.jsx(T,{size:18}),e.jsx("span",{children:"Opening walkthrough script…"})]})}export{M as MakeAgentTutorialLearningPanel};
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./MarkdownText-CkVkr3P1.js","./index-Cr_RZ7GD.js","./index-9tbdqUau.css"])))=>i.map(i=>d[i]);
2
+ import{r as l,j as e,Z as g,a6 as w,af as A,_ as T}from"./index-Cr_RZ7GD.js";import{C as _}from"./copy-BsYs6wBI.js";import{P as h}from"./play-BLRANWaV.js";import{m as v,c as C,M as E,a as x,d as b}from"./make-agent-tutorial-KKauJpB9.js";const L=l.lazy(()=>A(()=>import("./MarkdownText-CkVkr3P1.js").then(a=>a.b),__vite__mapDeps([0,1,2]),import.meta.url).then(a=>({default:a.MarkdownText})));function M({activeVideoId:a,autoplay:r,onResizeStart:j,onSelectVideo:i,onSetAutoplay:f,onShowLessons:c,onShowScript:o,panelView:t}){const[n,d]=l.useState(!1),k=v(a),p=C(a),y={"play-all":"how-to-make-an-agent.md",create:"create-an-agent.md",use:"use-the-agent.md",improve:"improve-the-agent.md"}[a];l.useEffect(()=>{if(!n)return;const s=window.setTimeout(()=>d(!1),1600);return()=>window.clearTimeout(s)},[n]);function m(s){if(!["ArrowLeft","ArrowRight","Home","End"].includes(s.key))return;s.preventDefault();const u=s.key==="ArrowLeft"||s.key==="Home"?"lessons":"script";u==="lessons"?c():o(),document.getElementById(`make-agent-${u}-tab`)?.focus()}async function N(){await w(p)&&d(!0)}return e.jsxs("aside",{"aria-label":"Agents walkthrough panel",className:`workspace-diff-panel get-started-learning-panel show-${t}`,children:[e.jsx("div",{"aria-label":"Resize walkthrough panel","aria-orientation":"vertical",className:"workspace-diff-resize-handle",onPointerDown:j,role:"separator"}),e.jsx("div",{className:"workspace-diff-topbar get-started-learning-panel-tabs",children:e.jsxs("div",{"aria-label":"Walkthrough panel views",className:"workspace-diff-tabs",role:"tablist",children:[e.jsxs("button",{"aria-controls":"make-agent-lessons-panel","aria-selected":t==="lessons",className:`workspace-diff-tab ${t==="lessons"?"active":""}`,id:"make-agent-lessons-tab",onClick:c,onKeyDown:m,role:"tab",tabIndex:t==="lessons"?0:-1,type:"button",children:[e.jsx(h,{size:14}),e.jsx("span",{children:"Lessons"})]}),e.jsxs("button",{"aria-controls":"make-agent-script-panel","aria-selected":t==="script",className:`workspace-diff-tab ${t==="script"?"active":""}`,id:"make-agent-script-tab",onClick:o,onKeyDown:m,role:"tab",tabIndex:t==="script"?0:-1,type:"button",children:[e.jsx(g,{size:14}),e.jsx("span",{children:"Script"})]})]})}),t==="lessons"?e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"get-started-learning-panel-toolbar",children:[e.jsxs("span",{children:[e.jsx("strong",{children:E}),e.jsxs("small",{children:[x.length," lessons"]})]}),e.jsxs("button",{"aria-checked":r,"aria-label":"Autoplay lessons",className:`get-started-learning-autoplay ${r?"active":""}`,onClick:()=>f(!r),role:"switch",type:"button",children:[e.jsx("span",{children:"Autoplay"}),e.jsx("i",{"aria-hidden":"true"})]})]}),e.jsxs("div",{"aria-labelledby":"make-agent-lessons-tab",className:"get-started-learning-panel-body lessons",id:"make-agent-lessons-panel",role:"tabpanel",children:[e.jsx("ol",{children:x.map(s=>e.jsx("li",{children:e.jsxs("div",{className:"get-started-learning-lesson-card",children:[e.jsxs("button",{"aria-current":s.videoId===a?"true":void 0,"aria-label":`Play lesson ${s.lessonNumber}: ${s.title}`,className:"get-started-learning-lesson-button",onClick:()=>i(s.videoId),type:"button",children:[e.jsx("img",{alt:"",decoding:"async",loading:"lazy",src:s.posterUrl}),e.jsxs("span",{children:[e.jsxs("small",{children:[s.eyebrow," · ",s.duration]}),e.jsx("strong",{children:s.title})]})]}),e.jsx("button",{"aria-label":`Open script for ${s.title}`,className:"get-started-learning-script-button app-tooltip app-tooltip-right","data-tooltip":"Open script",onClick:()=>{i(s.videoId),o()},type:"button",children:e.jsx(g,{size:16})})]})},s.id))}),e.jsx("footer",{className:"get-started-learning-full-video",children:e.jsxs("button",{"aria-current":a==="play-all"?"true":void 0,"aria-label":`Play full video: ${b.title}`,onClick:()=>i("play-all"),type:"button",children:[e.jsx("span",{className:"get-started-learning-full-video-icon","aria-hidden":"true",children:e.jsx(h,{fill:"currentColor",size:13})}),e.jsxs("span",{children:[e.jsx("strong",{children:"Full video"}),e.jsxs("small",{children:[b.duration," · All 3 lessons"]})]})]})})]})]}):e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"get-started-learning-panel-toolbar file",children:[e.jsxs("span",{children:[e.jsx("small",{children:k.eyebrow}),e.jsx("strong",{children:y})]}),e.jsx("button",{"aria-label":n?"Script copied":"Copy walkthrough script",className:"diff-icon-button",onClick:()=>{N()},title:n?"Copied":"Copy script",type:"button",children:e.jsx(_,{size:14})})]}),e.jsx("div",{"aria-labelledby":"make-agent-script-tab",className:"get-started-learning-panel-body script",id:"make-agent-script-panel",role:"tabpanel",children:e.jsx("div",{className:"workspace-markdown-preview",children:e.jsx(l.Suspense,{fallback:e.jsx(z,{}),children:e.jsx(L,{content:p})})})})]})]})}function z(){return e.jsxs("div",{className:"get-started-script-status",children:[e.jsx(T,{size:18}),e.jsx("span",{children:"Opening walkthrough script…"})]})}export{M as MakeAgentTutorialLearningPanel};
@@ -1,7 +1,7 @@
1
- import{r as h,n as K,j as a,v as re,X as te,bH as W,ce as ie,bJ as y,aQ as x,cf as le,a4 as _}from"./index-B5AN29EO.js";const P=new Map,se=15e3;function Y(e,r,n){const t=V(e),[i,l]=h.useState(()=>t.getUrl(r,n));return h.useEffect(()=>{let s=!1;return l(t.getUrl(r,n)),t.loadUrl(r,n).then(o=>{s||l(o)}),()=>{s=!0}},[r,n,t]),i}function V(e){const[,r]=h.useState(0),n=h.useCallback((l,s)=>!e||!l||!s?null:T(z(e,l,s)),[e]),t=h.useCallback(async(l,s)=>{if(!e||!l||!s)return null;const o=z(e,l,s),c=T(o);if(c)return c;const u=P.get(o);if(u?.state==="loading")return u.promise;const m=K.signWorkspaceImageUrl(e,{appId:l,path:s}).then(p=>(P.set(o,{state:"ready",url:p.url,expiresAt:p.expiresAt}),r(g=>g+1),p.url)).catch(()=>(P.delete(o),r(p=>p+1),null));return P.set(o,{state:"loading",promise:m}),m},[e]),i=h.useCallback((l,s)=>{t(l,s)},[t]);return h.useMemo(()=>({ensureUrl:i,getUrl:n,loadUrl:t}),[i,n,t])}function T(e){const r=P.get(e);return r?.state!=="ready"?null:r.expiresAt<=Date.now()+se?(P.delete(e),null):r.url}function z(e,r,n){return`${e.serverUrl}\0${e.token}\0${r}\0${n}`}function ae({open:e,src:r,title:n,onClose:t}){const[i,l]=h.useState(!1);if(h.useEffect(()=>{if(!e)return;const c=u=>{u.key==="Escape"&&t()};return window.addEventListener("keydown",c),()=>window.removeEventListener("keydown",c)},[t,e]),h.useEffect(()=>{l(!1)},[r]),!e||!r)return null;const s=(()=>{const c=n.split("/").pop()?.trim();if(c&&/\.[A-Za-z0-9]+$/.test(c))return c;try{const m=new URL(r,window.location.href).pathname.split("/").pop()?.trim();if(m&&/\.[A-Za-z0-9]+$/.test(m))return m}catch{}return"image.png"})(),o=()=>{const c=document.createElement("a");c.href=r,c.download=s,c.rel="noopener",document.body.appendChild(c),c.click(),c.remove()};return a.jsx("div",{className:"image-lightbox-backdrop",role:"presentation",onMouseDown:c=>{c.target===c.currentTarget&&t()},children:a.jsxs("section",{"aria-label":n?`Image preview: ${n}`:"Image preview","aria-modal":"true",className:"image-lightbox-dialog",role:"dialog",children:[a.jsxs("header",{className:"image-lightbox-header",children:[a.jsx("span",{title:n,children:n}),a.jsxs("div",{className:"image-lightbox-actions",children:[a.jsx("button",{type:"button","aria-label":"Download image",title:"Download",onClick:o,children:a.jsx(re,{size:16})}),a.jsx("button",{type:"button","aria-label":"Close image preview",title:"Close",onClick:t,children:a.jsx(te,{size:16})})]})]}),a.jsx("div",{className:"image-lightbox-frame",children:i?a.jsx("div",{className:"image-lightbox-error",children:"Image preview unavailable"}):a.jsx("img",{alt:n||"Image preview",decoding:"async",draggable:!1,src:r,onError:()=>l(!0)})})]})})}const L=new Map,oe=15e3;function q(e,r){const n=G(e),[t,i]=h.useState(()=>n.getUrl(r));return h.useEffect(()=>{let l=!1;return i(n.getUrl(r)),n.loadUrl(r).then(s=>{l||i(s)}),()=>{l=!0}},[r,n]),t}function G(e){const[,r]=h.useState(0),n=h.useCallback(i=>!e||!i?null:D(B(e,i)),[e]),t=h.useCallback(async i=>{if(!e||!i)return null;const l=B(e,i),s=D(l);if(s)return s;const o=L.get(l);if(o?.state==="loading")return o.promise;const c=K.signLocalImageUrl(e,{path:i}).then(u=>(L.set(l,{state:"ready",url:u.url,expiresAt:u.expiresAt}),r(m=>m+1),u.url)).catch(()=>(L.delete(l),r(u=>u+1),null));return L.set(l,{state:"loading",promise:c}),c},[e]);return h.useMemo(()=>({getUrl:n,loadUrl:t}),[n,t])}function D(e){const r=L.get(e);return r?.state!=="ready"?null:r.expiresAt<=Date.now()+oe?(L.delete(e),null):r.url}function B(e,r){return`${e.serverUrl}\0${e.token}\0${r}`}function ce(e){const r=e.replace(/\r\n/g,`
1
+ import{r as h,n as K,j as a,w as re,X as te,bN as H,ck as ie,bP as y,aU as x,cl as le,a6 as _}from"./index-Cr_RZ7GD.js";const P=new Map,se=15e3;function Y(e,r,n){const t=V(e),[i,l]=h.useState(()=>t.getUrl(r,n));return h.useEffect(()=>{let s=!1;return l(t.getUrl(r,n)),t.loadUrl(r,n).then(o=>{s||l(o)}),()=>{s=!0}},[r,n,t]),i}function V(e){const[,r]=h.useState(0),n=h.useCallback((l,s)=>!e||!l||!s?null:T(z(e,l,s)),[e]),t=h.useCallback(async(l,s)=>{if(!e||!l||!s)return null;const o=z(e,l,s),c=T(o);if(c)return c;const u=P.get(o);if(u?.state==="loading")return u.promise;const m=K.signWorkspaceImageUrl(e,{appId:l,path:s}).then(p=>(P.set(o,{state:"ready",url:p.url,expiresAt:p.expiresAt}),r(g=>g+1),p.url)).catch(()=>(P.delete(o),r(p=>p+1),null));return P.set(o,{state:"loading",promise:m}),m},[e]),i=h.useCallback((l,s)=>{t(l,s)},[t]);return h.useMemo(()=>({ensureUrl:i,getUrl:n,loadUrl:t}),[i,n,t])}function T(e){const r=P.get(e);return r?.state!=="ready"?null:r.expiresAt<=Date.now()+se?(P.delete(e),null):r.url}function z(e,r,n){return`${e.serverUrl}\0${e.token}\0${r}\0${n}`}function ae({open:e,src:r,title:n,onClose:t}){const[i,l]=h.useState(!1);if(h.useEffect(()=>{if(!e)return;const c=u=>{u.key==="Escape"&&t()};return window.addEventListener("keydown",c),()=>window.removeEventListener("keydown",c)},[t,e]),h.useEffect(()=>{l(!1)},[r]),!e||!r)return null;const s=(()=>{const c=n.split("/").pop()?.trim();if(c&&/\.[A-Za-z0-9]+$/.test(c))return c;try{const m=new URL(r,window.location.href).pathname.split("/").pop()?.trim();if(m&&/\.[A-Za-z0-9]+$/.test(m))return m}catch{}return"image.png"})(),o=()=>{const c=document.createElement("a");c.href=r,c.download=s,c.rel="noopener",document.body.appendChild(c),c.click(),c.remove()};return a.jsx("div",{className:"image-lightbox-backdrop",role:"presentation",onMouseDown:c=>{c.target===c.currentTarget&&t()},children:a.jsxs("section",{"aria-label":n?`Image preview: ${n}`:"Image preview","aria-modal":"true",className:"image-lightbox-dialog",role:"dialog",children:[a.jsxs("header",{className:"image-lightbox-header",children:[a.jsx("span",{title:n,children:n}),a.jsxs("div",{className:"image-lightbox-actions",children:[a.jsx("button",{type:"button","aria-label":"Download image",title:"Download",onClick:o,children:a.jsx(re,{size:16})}),a.jsx("button",{type:"button","aria-label":"Close image preview",title:"Close",onClick:t,children:a.jsx(te,{size:16})})]})]}),a.jsx("div",{className:"image-lightbox-frame",children:i?a.jsx("div",{className:"image-lightbox-error",children:"Image preview unavailable"}):a.jsx("img",{alt:n||"Image preview",decoding:"async",draggable:!1,src:r,onError:()=>l(!0)})})]})})}const L=new Map,oe=15e3;function q(e,r){const n=G(e),[t,i]=h.useState(()=>n.getUrl(r));return h.useEffect(()=>{let l=!1;return i(n.getUrl(r)),n.loadUrl(r).then(s=>{l||i(s)}),()=>{l=!0}},[r,n]),t}function G(e){const[,r]=h.useState(0),n=h.useCallback(i=>!e||!i?null:D(B(e,i)),[e]),t=h.useCallback(async i=>{if(!e||!i)return null;const l=B(e,i),s=D(l);if(s)return s;const o=L.get(l);if(o?.state==="loading")return o.promise;const c=K.signLocalImageUrl(e,{path:i}).then(u=>(L.set(l,{state:"ready",url:u.url,expiresAt:u.expiresAt}),r(m=>m+1),u.url)).catch(()=>(L.delete(l),r(u=>u+1),null));return L.set(l,{state:"loading",promise:c}),c},[e]);return h.useMemo(()=>({getUrl:n,loadUrl:t}),[n,t])}function D(e){const r=L.get(e);return r?.state!=="ready"?null:r.expiresAt<=Date.now()+oe?(L.delete(e),null):r.url}function B(e,r){return`${e.serverUrl}\0${e.token}\0${r}`}function ce(e){const r=e.replace(/\r\n/g,`
2
2
  `).split(`
3
3
  `),n=[];let t=[],i=[],l=!1,s=null,o,c=0;function u(){t.length!==0&&(n.push({type:"paragraph",content:t.join(`
4
4
  `).trim()}),t=[])}function m(){i.length!==0&&(n.push({type:"list",ordered:l,items:i}),i=[],l=!1)}for(let p=0;p<r.length;p+=1){const g=r[p];if(s){if(ue(g,c)){n.push({type:"code",content:s.join(`
5
5
  `),language:o}),s=null,o=void 0,c=0;continue}s.push(g);continue}const I=de(g);if(I){u(),m(),s=I.firstLine===void 0?[]:[I.firstLine],o=I.language,c=I.ticks;continue}const k=he(r,p);if(k){u(),m(),n.push({type:"table",headers:k.headers,rows:k.rows}),p=k.endIndex;continue}const f=g.match(/^\s*(#{1,4})(?:\s+|(?=\d+[.)]\s+))(.+)$/);if(f){u(),m();const d=f[1].length;n.push({type:"heading",level:d,content:f[2].trim()});continue}const w=g.match(/^\s*(?:([-*])|(\d+)[.)])\s+(.+)$/);if(w){u();const d=!!w[2];i.length>0&&d!==l&&m(),l=d,i.push(fe(w[3].trim()));continue}if(!g.trim()){u(),m();continue}m(),t.push(g)}return s&&n.push({type:"code",content:s.join(`
6
- `),language:o}),u(),m(),n}function ue(e,r){const n=e.match(/^\s*(`{2,})\s*(?:[A-Za-z0-9_-]+)?\s*$/);return!!(n&&n[1].length>=r)}function de(e){const r=e.match(/^\s*(`{2,})\s*([A-Za-z0-9_-]+)?\s*$/);if(r)return{language:r[2],ticks:r[1].length};const n=e.match(/^\s*(`{2,})\s*([A-Za-z][A-Za-z0-9_-]*)(?:\s+(\S.*)|(\S.*))$/);return n?{language:n[2],firstLine:n[3]??n[4],ticks:n[1].length}:null}function fe(e){const r=/^\[([ xX])]\s*(.*)$/.exec(e);return r?{content:r[2]??"",checked:r[1]?.toLowerCase()==="x"}:{content:e,checked:null}}function he(e,r){const n=e[r]??"",t=e[r+1]??"";if(!n.includes("|")||!pe(t))return null;const i=N(n);if(i.length===0)return null;const l=[];let s=r+2;for(;s<e.length;){const o=e[s]??"";if(!o.trim()||!o.includes("|"))break;l.push(N(o)),s+=1}return{headers:i,rows:l,endIndex:s-1}}function pe(e){const r=N(e);return r.length>0&&r.every(n=>/^:?-{3,}:?$/.test(n.trim()))}function N(e){return e.trim().replace(/^\|/,"").replace(/\|$/,"").split("|").map(n=>n.trim())}const me=new Set([".avif",".gif",".ico",".jpeg",".jpg",".png",".svg",".webp"]);function J({checked:e,inline:r=!1}){return a.jsx("input",{"aria-label":e?"Checked item":"Unchecked item",checked:e,className:`markdown-checkbox ${r?"inline":""}`,disabled:!0,readOnly:!0,type:"checkbox"})}function U(e,r){const n=[];let t=0,i=0;const l=s=>{s>i&&n.push(e.slice(i,s))};for(;t<e.length;){const s=e[t];if(s==="`"){const f=e.indexOf("`",t+1);if(f>t+1){const w=e.slice(t+1,f),d=r.onOpenFileInSidebar&&ke(w,e,t,f+1)?W(w,{workspaceRootPath:r.workspaceRootPath}):null;l(t),n.push(d?S(d.displayPath,d.path,d.displayPath,r,n.length):a.jsx("code",{children:w},n.length)),t=f+1,i=t;continue}}const o=s==="<"||e.startsWith("!<img",t)?ye(e,t):null;if(o){const f=A(o.src,r);if(f){l(t),n.push(X(o.alt,f,r,n.length)),t=o.end,i=t;continue}}const c=s==="<"?Ue(e,t):null;if(c){l(t),n.push(M(c.label,c.href,r,n.length)),t=c.end,i=t;continue}const u=s==="<"?Pe(e,t):null;if(u){l(t),n.push(M(u.href,u.href,r,n.length)),t=u.end,i=t;continue}const m=s==="["?xe(e,t):null;if(m){l(t),n.push(a.jsx(J,{checked:m.checked,inline:!0},n.length)),t=m.end,i=t;continue}const p=e.startsWith("![",t)?ve(e,t):null;if(p){const f=A(p.href,r);l(t),n.push(f?X(p.label,f,r,n.length):M(p.label||p.href,p.href,r,n.length)),t=p.end,i=t;continue}const g=s==="["?je(e,t):null;if(g){l(t),n.push(M(g.label,g.href,r,n.length)),t=g.end,i=t;continue}const I=ge(e,t);if(I){l(t),n.push(M(I.href,I.href,r,n.length)),t=I.end,i=t;continue}const k=r.onOpenFileInSidebar?ie(e,t,{workspaceRootPath:r.workspaceRootPath}):null;if(k){l(t),n.push(S(k.displayPath,k.path,k.displayPath,r,n.length)),t=k.end,i=t;continue}if(e.startsWith("**",t)){const f=e.indexOf("**",t+2);if(f>t+2){l(t),n.push(a.jsx("strong",{children:e.slice(t+2,f)},n.length)),t=f+2,i=t;continue}}if(e.startsWith("__",t)){const f=e.indexOf("__",t+2);if(f>t+2){l(t),n.push(a.jsx("strong",{children:e.slice(t+2,f)},n.length)),t=f+2,i=t;continue}}t+=1}return l(e.length),n}function ge(e,r){const n=r>0?e[r-1]:"";if(n&&!/[\s([{<]/.test(n))return null;const t=e.slice(r),i=/^(?:https?:\/\/|www\.)[^\s<>()]+(?:\([^\s<>()]*\)[^\s<>()]*)*/i.exec(t);if(!i)return null;let l=i[0];for(;/[.,;:!?]$/.test(l);)l=l.slice(0,-1);return l?{href:/^www\./i.test(l)?`https://${l}`:l,end:r+l.length}:null}function ke(e,r,n,t){return we(e)?!0:!r.slice(0,n).trim()&&!r.slice(t).trim()}function we(e){return/^(?:workspace|sandbox):file:/i.test(e.trim())}function M(e,r,n,t){const i=ne(r),l=A(i,n),s=/^https?:\/\//i.test(i),o=l?.kind==="url"?l.src:l?.src??i,c=n.onOpenFileInSidebar?W(i,{workspaceRootPath:n.workspaceRootPath}):null;return!l&&c?S(e,c.path,c.displayPath,n,t):a.jsx("a",{href:s||l?o:"#",className:l?"markdown-image-link":void 0,onBlur:()=>{l&&n.onPreviewImage(null)},onClick:u=>{if(l){u.preventDefault(),Ne(l,n),n.onPreviewImage(null);return}if(s&&n.onOpenBrowserLink){u.preventDefault(),n.onOpenBrowserLink(o);return}s||u.preventDefault()},onContextMenu:u=>{u.preventDefault(),n.onPreviewImage(null),n.onOpenLinkMenu(Se(o,i,u.clientX,u.clientY))},onFocus:u=>{l&&Z(l,n,u.currentTarget)},onMouseEnter:u=>{l&&Z(l,n,u.currentTarget)},onMouseLeave:()=>{l&&n.onPreviewImage(null)},rel:s?"noreferrer":void 0,target:s?"_blank":void 0,title:i,children:e},t)}function X(e,r,n,t){return a.jsx(Ie,{context:n,image:r,label:e},t)}function Ie({context:e,image:r,label:n}){const t=Y(e.connection,r.kind==="workspace"?r.appId:null,r.kind==="workspace"?r.path:null),i=q(e.connection,r.kind==="local"?r.path:null),l=r.kind==="url"?r.src:r.kind==="local"?i:t,s=n.trim()||r.title;return a.jsx("button",{type:"button",className:`markdown-inline-image ${l?"ready":"loading"}`,onClick:()=>{if(r.kind==="url"){e.onOpenImage({src:r.src,title:s});return}if(l){e.onOpenImage({src:l,title:s});return}r.kind!=="local"&&e.onOpenWorkspaceImage({appId:r.appId,path:r.path,title:s})},title:s,children:l?a.jsx("img",{alt:s,decoding:"async",loading:"lazy",src:l}):a.jsx("span",{"aria-hidden":"true"})})}function S(e,r,n,t,i){const l=Ce(r,n,t);return l?a.jsx(be,{context:t,displayPath:n,image:l,label:e,path:r},i):a.jsx(Q,{context:t,displayPath:n,label:e,path:r},i)}function Q({context:e,displayPath:r,label:n,path:t}){return a.jsx("a",{href:"#",className:"markdown-file-link",onClick:i=>{i.preventDefault(),e.onOpenFileInSidebar?.(t)},onContextMenu:i=>{i.preventDefault(),e.onPreviewImage(null),e.onOpenLinkMenu(Ae(t,r,i.clientX,i.clientY))},title:r,children:n})}function be({context:e,displayPath:r,image:n,label:t,path:i}){const l=Y(e.connection,n.kind==="workspace"?n.appId:null,n.kind==="workspace"?n.path:null),s=q(e.connection,n.kind==="local"?n.path:null),o=n.kind==="url"?n.src:n.kind==="local"?s:l,c=n.title||r;return a.jsxs("span",{className:"markdown-file-image-reference",children:[a.jsx(Q,{context:e,displayPath:r,label:t,path:i}),a.jsx("button",{type:"button",className:`markdown-file-image-preview ${o?"ready":"loading"}`,onClick:()=>{if(n.kind==="url"){e.onOpenImage({src:n.src,title:c});return}if(o){e.onOpenImage({src:o,title:c});return}n.kind!=="local"&&e.onOpenWorkspaceImage({appId:n.appId,path:n.path,title:c})},title:c,children:o?a.jsx("img",{alt:c,decoding:"async",loading:"lazy",src:o}):a.jsx("span",{"aria-hidden":"true"})})]})}function ve(e,r){if(!e.startsWith("![",r))return null;const n=r+2,t=e.indexOf("]",n);if(t<n||e[t+1]!=="(")return null;const i=ee(e,t+2);return i?{label:e.slice(n,t),href:i.href,end:i.end}:null}function je(e,r){const n=e.indexOf("]",r+1);if(n<=r+1||e[n+1]!=="(")return null;const t=ee(e,n+2);return t?{label:e.slice(r+1,n),href:t.href,end:t.end}:null}function ee(e,r){if(e[r]==="<"){const t=e.indexOf(">",r+1);return t<0||e[t+1]!==")"?null:{href:e.slice(r+1,t),end:t+2}}let n=0;for(let t=r;t<e.length;t+=1){const i=e[t];if(i==="\\"){t+=1;continue}if(i==="("){n+=1;continue}if(i===")"){if(n===0)return{href:e.slice(r,t),end:t+1};n-=1}}return null}function ye(e,r){const n=e[r]==="!"?r+1:r;if(!/^<img\b/i.test(e.slice(n)))return null;const t=e.indexOf(">",n+4);if(t<0)return null;const i=e.slice(n,t+1),l=E(i,"src");return l?{src:l,alt:E(i,"alt")??E(i,"title")??"",end:t+1}:null}function xe(e,r){const n=e.slice(r,r+3);return n==="[ ]"?{checked:!1,end:r+3}:n==="[x]"||n==="[X]"?{checked:!0,end:r+3}:null}function Ue(e,r){const n=e.slice(r),t=/^<a\s+[^>]*href\s*=\s*(["'])(.*?)\1[^>]*>(.*?)<\/a>/i.exec(n);return t?{href:t[2]??"",label:Le(t[3]??""),end:r+t[0].length}:null}function Pe(e,r){const n=e.indexOf(">",r+1);if(n<=r+1)return null;const t=e.slice(r+1,n).trim();return Me(t)?{href:t,end:n+1}:null}function Le(e){return e.replace(/<[^>]+>/g,"").trim()||e}function E(e,r){const t=new RegExp(`\\s${r}\\s*=\\s*(?:"([^"]*)"|'([^']*)'|([^\\s>]+))`,"i").exec(e);return t?.[1]??t?.[2]??t?.[3]??null}function Me(e){return/^(https?:\/\/|file:\/\/|(?:workspace|sandbox):file:|\/|\.{1,2}\/)/i.test(e)}function A(e,r){const n=ne(e);if(!n)return null;if(/^https?:\/\//i.test(n))try{const s=new URL(n),o=Ee(s,r);return o||(Re(s,r.connection)?{kind:"url",src:n,title:y(s.searchParams.get("path")??s.pathname)}:null)}catch{return null}const t=$e(n),i=H(t??n,r.workspaceRootPath);if(i)return{kind:"url",src:i,title:y(t??n)};if(!t||!x(t)||!r.connection)return null;if($(t))return{kind:"local",path:t,src:r.localImageUrls.getUrl(t),title:y(t)};if(!r.activeWorkspaceAppId)return null;const l=R(t,r.workspaceRootPath);return!l||!x(l)?null:{kind:"workspace",appId:r.activeWorkspaceAppId,path:l,src:r.workspaceImageUrls.getUrl(r.activeWorkspaceAppId,l),title:y(l)}}function Ce(e,r,n){const t=H(e,n.workspaceRootPath)??H(r,n.workspaceRootPath);if(t)return{kind:"url",src:t,title:y(r)};if(!x(e)||!n.connection)return null;if($(e))return{kind:"local",path:e,src:n.localImageUrls.getUrl(e),title:y(e)};if(!n.activeWorkspaceAppId)return null;const i=R(e,n.workspaceRootPath);return!i||!x(i)?null:{kind:"workspace",appId:n.activeWorkspaceAppId,path:i,src:n.workspaceImageUrls.getUrl(n.activeWorkspaceAppId,i),title:y(i)}}function H(e,r){const n=R(e,r),t="apps/web/public/";if(!n?.startsWith(t))return null;const i=n.slice(t.length);return!i||!Oe(i)?null:le(i.split("/").map(encodeURIComponent).join("/"))}function Oe(e){const r=e.split("?")[0]?.split("#")[0]??e,n=r.lastIndexOf(".");return n<0?!1:me.has(r.slice(n).toLowerCase())}function ne(e){return e.trim().replace(/^['"`]+|['"`]+$/g,"")}function $e(e){let r=e.trim();if(!r)return null;if(r.startsWith("file://"))try{return decodeURIComponent(new URL(r).pathname)}catch{return r.replace(/^file:\/\//,"")}if($(r))return r;const n=r.indexOf("#");n>=0&&(r=r.slice(0,n));const t=r.indexOf("?");return t>=0&&(r=r.slice(0,t)),r}function $(e){return/^file:\/\//i.test(e)||/^\//.test(e)||/^[A-Za-z]:[\\/]/.test(e)}function R(e,r){let n=e.trim().replace(/^['"`]+|['"`]+$/g,"");if(!n)return null;if(n.startsWith("file://"))try{n=decodeURIComponent(new URL(n).pathname)}catch{n=n.replace(/^file:\/\//,"")}if(n=n.replace(/\\/g,"/"),$(n)){const i=r?.trim().replace(/\\/g,"/").replace(/\/+$/,"");if(!i||!n.startsWith(`${i}/`))return null;n=n.slice(i.length+1)}n=n.replace(/^\.\/+/,"");const t=n.split("/").filter(Boolean);return t.length===0||t.some(i=>i==="."||i===".."||i===".git")?null:t.join("/")}function Re(e,r){if(r){const t=new URL(r.serverUrl);if(e.origin===t.origin){if(e.pathname==="/v1/local-image"||/\/v1\/workspaces\/[^/]+\/file-image$/.test(e.pathname))return!1;if(e.pathname==="/v1/assets/workspace-image"||e.pathname==="/v1/assets/chat-attachment-image")return!0}}if(x(e.pathname))return!0;const n=e.searchParams.get("path");return!!(n&&x(n))}function Ee(e,r){if(!r.connection)return null;const n=new URL(r.connection.serverUrl);if(e.origin!==n.origin)return null;const t=e.pathname==="/v1/assets/workspace-image"?e.searchParams.get("path"):null;if(t&&x(t))return{kind:"url",src:e.toString(),title:y(t)};const i=e.pathname==="/v1/assets/chat-attachment-image"?e.searchParams.get("storageName"):null;if(i&&x(i))return{kind:"url",src:e.toString(),title:y(i)};const l=/^\/v1\/workspaces\/([^/]+)\/file-image$/.exec(e.pathname),s=l?e.searchParams.get("path"):null;if(!l||!s||!x(s))return null;const o=decodeURIComponent(l[1]),c=R(s,r.workspaceRootPath);return!c||!x(c)?null:{kind:"workspace",appId:o,path:c,src:r.workspaceImageUrls.getUrl(o,c),title:y(c)}}function Ne(e,r){if(e.kind==="url"){r.onOpenImage(e);return}if(e.kind==="local"){e.src&&r.onOpenImage({src:e.src,title:e.title});return}if(e.src){r.onOpenImage({src:e.src,title:e.title});return}r.onOpenWorkspaceImage({appId:e.appId,path:e.path,title:e.title})}function Z(e,r,n){if(e.kind==="url"){r.onPreviewImage(C(e,n));return}if(e.kind==="local"){if(e.src){r.onPreviewImage(C({src:e.src,title:e.title},n));return}r.localImageUrls.loadUrl(e.path).then(t=>{t&&n.matches(":hover")&&r.onPreviewImage(C({src:t,title:e.title},n))});return}if(e.src){r.onPreviewImage(C({src:e.src,title:e.title},n));return}r.workspaceImageUrls.loadUrl(e.appId,e.path).then(t=>{t&&n.matches(":hover")&&r.onPreviewImage(C({src:t,title:e.title},n))})}function C(e,r){const n=r.getBoundingClientRect(),t=236,i=172,l=12,s=Math.max(l,Math.min(n.left,window.innerWidth-t-l)),o=n.bottom+8,c=o+i<=window.innerHeight-l?o:Math.max(l,n.top-i-8);return{...e,x:s,y:c}}function Se(e,r,n,t){return{kind:"browser",browserHref:e,displayHref:r,x:Math.max(8,Math.min(n,window.innerWidth-220-8)),y:Math.max(8,Math.min(t,window.innerHeight-142-8))}}function Ae(e,r,n,t){return{kind:"file",path:e,displayPath:r,x:Math.max(8,Math.min(n,window.innerWidth-220-8)),y:Math.max(8,Math.min(t,window.innerHeight-72-8))}}function He({activeWorkspaceAppId:e=null,connection:r=null,content:n,onOpenBrowserLink:t,onOpenFileInSidebar:i,workspaceRootPath:l=null}){const s=h.useMemo(()=>ce(n),[n]),[o,c]=h.useState(null),[u,m]=h.useState(null),[p,g]=h.useState(null),I=G(r),k=V(r),f=h.useCallback(d=>{k.loadUrl(d.appId,d.path).then(b=>{b&&c({src:b,title:d.title})})},[k]),w=h.useMemo(()=>({activeWorkspaceAppId:e,connection:r,onOpenBrowserLink:t,onOpenFileInSidebar:i,onOpenLinkMenu:g,onOpenImage:c,onOpenWorkspaceImage:f,onPreviewImage:m,localImageUrls:I,workspaceImageUrls:k,workspaceRootPath:l}),[e,r,f,I,t,i,k,l]);return h.useEffect(()=>{if(!p)return;const d=()=>g(null),b=v=>{v.key==="Escape"&&d()};return window.addEventListener("click",d),window.addEventListener("keydown",b),window.addEventListener("scroll",d,!0),()=>{window.removeEventListener("click",d),window.removeEventListener("keydown",b),window.removeEventListener("scroll",d,!0)}},[p]),a.jsxs("div",{className:"markdown-message",children:[s.map((d,b)=>{if(d.type==="code"){const v=We(d.content,l);return v?a.jsx("div",{className:"markdown-file-reference-block",children:v.map((j,O)=>a.jsx("div",{className:"markdown-file-reference-line",children:U(j,w)},O))},b):a.jsx("pre",{className:"markdown-code-block",children:a.jsx("code",{children:d.content})},b)}if(d.type==="list"){const v=d.ordered?"ol":"ul";return a.jsx(v,{className:"markdown-list",children:d.items.map((j,O)=>a.jsxs("li",{className:j.checked===null?void 0:"markdown-task-list-item",children:[j.checked===null?null:a.jsx(J,{checked:j.checked}),a.jsx("span",{children:U(j.content,w)})]},O))},b)}if(d.type==="heading"){const v=d.level===1?"h1":d.level===2?"h2":d.level===3?"h3":"h4";return a.jsx(v,{className:"markdown-heading",children:U(d.content,w)},b)}return d.type==="table"?a.jsx("div",{className:"markdown-table-wrap",children:a.jsxs("table",{className:"markdown-table",children:[a.jsx("thead",{children:a.jsx("tr",{children:d.headers.map((v,j)=>a.jsx("th",{children:U(v,w)},j))})}),a.jsx("tbody",{children:d.rows.map((v,j)=>a.jsx("tr",{children:d.headers.map((O,F)=>a.jsx("td",{children:U(v[F]??"",w)},F))},j))})]})},b):a.jsx("p",{className:"markdown-paragraph",children:U(d.content,w)},b)}),u&&a.jsx(Fe,{preview:u}),p&&a.jsx(_e,{menu:p,onClose:()=>g(null),onOpenBrowserLink:t,onOpenFileInSidebar:i}),a.jsx(ae,{open:!!o,src:o?.src??null,title:o?.title??"",onClose:()=>c(null)})]})}function We(e,r){const n=e.split(`
7
- `),t=[];for(const i of n){const l=i.trim();if(!l)continue;const o=l.replace(/^(?:[-*]|\d+[.)])\s+/,"").trim().replace(/^`+|`+$/g,"").trim();if(!o||!W(o,{workspaceRootPath:r}))return null;t.push(o)}return t.length>0?t:null}function Fe({preview:e}){const[r,n]=h.useState(!1);return h.useEffect(()=>{n(!1)},[e.src]),a.jsxs("div",{className:`markdown-image-hover-preview ${r?"unavailable":""}`,style:{left:e.x,top:e.y},children:[r?a.jsx("span",{children:"Preview unavailable"}):a.jsx("img",{alt:"",src:e.src,onError:()=>n(!0)}),a.jsx("span",{children:e.title})]})}function _e({menu:e,onClose:r,onOpenBrowserLink:n,onOpenFileInSidebar:t}){return e.kind==="file"?a.jsxs("div",{className:"markdown-link-menu",role:"menu",style:{left:e.x,top:e.y},onClick:i=>i.stopPropagation(),children:[a.jsx("button",{type:"button",role:"menuitem",onClick:()=>{t?.(e.path),r()},children:"Open in sidebar"}),a.jsx("button",{type:"button",role:"menuitem",onClick:()=>{_(e.displayPath),r()},children:"Copy path"})]}):a.jsxs("div",{className:"markdown-link-menu",role:"menu",style:{left:e.x,top:e.y},onClick:i=>i.stopPropagation(),children:[a.jsx("button",{type:"button",role:"menuitem",onClick:()=>{n?n(e.browserHref):window.open(e.browserHref,"_blank","noopener,noreferrer"),r()},children:"Open in sidebar"}),a.jsx("button",{type:"button",role:"menuitem",onClick:()=>{n?n(e.browserHref,{newTab:!0}):window.open(e.browserHref,"_blank","noopener,noreferrer"),r()},children:"Open in new tab"}),a.jsx("button",{type:"button",role:"menuitem",onClick:()=>{window.open(e.browserHref,"_blank","noopener,noreferrer"),r()},children:"Open externally"}),a.jsx("button",{type:"button",role:"menuitem",onClick:()=>{_(e.displayHref),r()},children:"Copy link"})]})}const ze=Object.freeze(Object.defineProperty({__proto__:null,MarkdownText:He},Symbol.toStringTag,{value:"Module"}));export{ae as I,He as M,q as a,ze as b,Y as u};
6
+ `),language:o}),u(),m(),n}function ue(e,r){const n=e.match(/^\s*(`{2,})\s*(?:[A-Za-z0-9_-]+)?\s*$/);return!!(n&&n[1].length>=r)}function de(e){const r=e.match(/^\s*(`{2,})\s*([A-Za-z0-9_-]+)?\s*$/);if(r)return{language:r[2],ticks:r[1].length};const n=e.match(/^\s*(`{2,})\s*([A-Za-z][A-Za-z0-9_-]*)(?:\s+(\S.*)|(\S.*))$/);return n?{language:n[2],firstLine:n[3]??n[4],ticks:n[1].length}:null}function fe(e){const r=/^\[([ xX])]\s*(.*)$/.exec(e);return r?{content:r[2]??"",checked:r[1]?.toLowerCase()==="x"}:{content:e,checked:null}}function he(e,r){const n=e[r]??"",t=e[r+1]??"";if(!n.includes("|")||!pe(t))return null;const i=N(n);if(i.length===0)return null;const l=[];let s=r+2;for(;s<e.length;){const o=e[s]??"";if(!o.trim()||!o.includes("|"))break;l.push(N(o)),s+=1}return{headers:i,rows:l,endIndex:s-1}}function pe(e){const r=N(e);return r.length>0&&r.every(n=>/^:?-{3,}:?$/.test(n.trim()))}function N(e){return e.trim().replace(/^\|/,"").replace(/\|$/,"").split("|").map(n=>n.trim())}const me=new Set([".avif",".gif",".ico",".jpeg",".jpg",".png",".svg",".webp"]);function J({checked:e,inline:r=!1}){return a.jsx("input",{"aria-label":e?"Checked item":"Unchecked item",checked:e,className:`markdown-checkbox ${r?"inline":""}`,disabled:!0,readOnly:!0,type:"checkbox"})}function U(e,r){const n=[];let t=0,i=0;const l=s=>{s>i&&n.push(e.slice(i,s))};for(;t<e.length;){const s=e[t];if(s==="`"){const f=e.indexOf("`",t+1);if(f>t+1){const w=e.slice(t+1,f),d=r.onOpenFileInSidebar&&ke(w,e,t,f+1)?H(w,{workspaceRootPath:r.workspaceRootPath}):null;l(t),n.push(d?S(d.displayPath,d.path,d.displayPath,r,n.length):a.jsx("code",{children:w},n.length)),t=f+1,i=t;continue}}const o=s==="<"||e.startsWith("!<img",t)?ye(e,t):null;if(o){const f=A(o.src,r);if(f){l(t),n.push(X(o.alt,f,r,n.length)),t=o.end,i=t;continue}}const c=s==="<"?Ue(e,t):null;if(c){l(t),n.push(M(c.label,c.href,r,n.length)),t=c.end,i=t;continue}const u=s==="<"?Pe(e,t):null;if(u){l(t),n.push(M(u.href,u.href,r,n.length)),t=u.end,i=t;continue}const m=s==="["?xe(e,t):null;if(m){l(t),n.push(a.jsx(J,{checked:m.checked,inline:!0},n.length)),t=m.end,i=t;continue}const p=e.startsWith("![",t)?ve(e,t):null;if(p){const f=A(p.href,r);l(t),n.push(f?X(p.label,f,r,n.length):M(p.label||p.href,p.href,r,n.length)),t=p.end,i=t;continue}const g=s==="["?je(e,t):null;if(g){l(t),n.push(M(g.label,g.href,r,n.length)),t=g.end,i=t;continue}const I=ge(e,t);if(I){l(t),n.push(M(I.href,I.href,r,n.length)),t=I.end,i=t;continue}const k=r.onOpenFileInSidebar?ie(e,t,{workspaceRootPath:r.workspaceRootPath}):null;if(k){l(t),n.push(S(k.displayPath,k.path,k.displayPath,r,n.length)),t=k.end,i=t;continue}if(e.startsWith("**",t)){const f=e.indexOf("**",t+2);if(f>t+2){l(t),n.push(a.jsx("strong",{children:e.slice(t+2,f)},n.length)),t=f+2,i=t;continue}}if(e.startsWith("__",t)){const f=e.indexOf("__",t+2);if(f>t+2){l(t),n.push(a.jsx("strong",{children:e.slice(t+2,f)},n.length)),t=f+2,i=t;continue}}t+=1}return l(e.length),n}function ge(e,r){const n=r>0?e[r-1]:"";if(n&&!/[\s([{<]/.test(n))return null;const t=e.slice(r),i=/^(?:https?:\/\/|www\.)[^\s<>()]+(?:\([^\s<>()]*\)[^\s<>()]*)*/i.exec(t);if(!i)return null;let l=i[0];for(;/[.,;:!?]$/.test(l);)l=l.slice(0,-1);return l?{href:/^www\./i.test(l)?`https://${l}`:l,end:r+l.length}:null}function ke(e,r,n,t){return we(e)?!0:!r.slice(0,n).trim()&&!r.slice(t).trim()}function we(e){return/^(?:workspace|sandbox):file:/i.test(e.trim())}function M(e,r,n,t){const i=ne(r),l=A(i,n),s=/^https?:\/\//i.test(i),o=l?.kind==="url"?l.src:l?.src??i,c=n.onOpenFileInSidebar?H(i,{workspaceRootPath:n.workspaceRootPath}):null;return!l&&c?S(e,c.path,c.displayPath,n,t):a.jsx("a",{href:s||l?o:"#",className:l?"markdown-image-link":void 0,onBlur:()=>{l&&n.onPreviewImage(null)},onClick:u=>{if(l){u.preventDefault(),Ne(l,n),n.onPreviewImage(null);return}if(s&&n.onOpenBrowserLink){u.preventDefault(),n.onOpenBrowserLink(o);return}s||u.preventDefault()},onContextMenu:u=>{u.preventDefault(),n.onPreviewImage(null),n.onOpenLinkMenu(Se(o,i,u.clientX,u.clientY))},onFocus:u=>{l&&Z(l,n,u.currentTarget)},onMouseEnter:u=>{l&&Z(l,n,u.currentTarget)},onMouseLeave:()=>{l&&n.onPreviewImage(null)},rel:s?"noreferrer":void 0,target:s?"_blank":void 0,title:i,children:e},t)}function X(e,r,n,t){return a.jsx(Ie,{context:n,image:r,label:e},t)}function Ie({context:e,image:r,label:n}){const t=Y(e.connection,r.kind==="workspace"?r.appId:null,r.kind==="workspace"?r.path:null),i=q(e.connection,r.kind==="local"?r.path:null),l=r.kind==="url"?r.src:r.kind==="local"?i:t,s=n.trim()||r.title;return a.jsx("button",{type:"button",className:`markdown-inline-image ${l?"ready":"loading"}`,onClick:()=>{if(r.kind==="url"){e.onOpenImage({src:r.src,title:s});return}if(l){e.onOpenImage({src:l,title:s});return}r.kind!=="local"&&e.onOpenWorkspaceImage({appId:r.appId,path:r.path,title:s})},title:s,children:l?a.jsx("img",{alt:s,decoding:"async",loading:"lazy",src:l}):a.jsx("span",{"aria-hidden":"true"})})}function S(e,r,n,t,i){const l=Ce(r,n,t);return l?a.jsx(be,{context:t,displayPath:n,image:l,label:e,path:r},i):a.jsx(Q,{context:t,displayPath:n,label:e,path:r},i)}function Q({context:e,displayPath:r,label:n,path:t}){return a.jsx("a",{href:"#",className:"markdown-file-link",onClick:i=>{i.preventDefault(),e.onOpenFileInSidebar?.(t)},onContextMenu:i=>{i.preventDefault(),e.onPreviewImage(null),e.onOpenLinkMenu(Ae(t,r,i.clientX,i.clientY))},title:r,children:n})}function be({context:e,displayPath:r,image:n,label:t,path:i}){const l=Y(e.connection,n.kind==="workspace"?n.appId:null,n.kind==="workspace"?n.path:null),s=q(e.connection,n.kind==="local"?n.path:null),o=n.kind==="url"?n.src:n.kind==="local"?s:l,c=n.title||r;return a.jsxs("span",{className:"markdown-file-image-reference",children:[a.jsx(Q,{context:e,displayPath:r,label:t,path:i}),a.jsx("button",{type:"button",className:`markdown-file-image-preview ${o?"ready":"loading"}`,onClick:()=>{if(n.kind==="url"){e.onOpenImage({src:n.src,title:c});return}if(o){e.onOpenImage({src:o,title:c});return}n.kind!=="local"&&e.onOpenWorkspaceImage({appId:n.appId,path:n.path,title:c})},title:c,children:o?a.jsx("img",{alt:c,decoding:"async",loading:"lazy",src:o}):a.jsx("span",{"aria-hidden":"true"})})]})}function ve(e,r){if(!e.startsWith("![",r))return null;const n=r+2,t=e.indexOf("]",n);if(t<n||e[t+1]!=="(")return null;const i=ee(e,t+2);return i?{label:e.slice(n,t),href:i.href,end:i.end}:null}function je(e,r){const n=e.indexOf("]",r+1);if(n<=r+1||e[n+1]!=="(")return null;const t=ee(e,n+2);return t?{label:e.slice(r+1,n),href:t.href,end:t.end}:null}function ee(e,r){if(e[r]==="<"){const t=e.indexOf(">",r+1);return t<0||e[t+1]!==")"?null:{href:e.slice(r+1,t),end:t+2}}let n=0;for(let t=r;t<e.length;t+=1){const i=e[t];if(i==="\\"){t+=1;continue}if(i==="("){n+=1;continue}if(i===")"){if(n===0)return{href:e.slice(r,t),end:t+1};n-=1}}return null}function ye(e,r){const n=e[r]==="!"?r+1:r;if(!/^<img\b/i.test(e.slice(n)))return null;const t=e.indexOf(">",n+4);if(t<0)return null;const i=e.slice(n,t+1),l=E(i,"src");return l?{src:l,alt:E(i,"alt")??E(i,"title")??"",end:t+1}:null}function xe(e,r){const n=e.slice(r,r+3);return n==="[ ]"?{checked:!1,end:r+3}:n==="[x]"||n==="[X]"?{checked:!0,end:r+3}:null}function Ue(e,r){const n=e.slice(r),t=/^<a\s+[^>]*href\s*=\s*(["'])(.*?)\1[^>]*>(.*?)<\/a>/i.exec(n);return t?{href:t[2]??"",label:Le(t[3]??""),end:r+t[0].length}:null}function Pe(e,r){const n=e.indexOf(">",r+1);if(n<=r+1)return null;const t=e.slice(r+1,n).trim();return Me(t)?{href:t,end:n+1}:null}function Le(e){return e.replace(/<[^>]+>/g,"").trim()||e}function E(e,r){const t=new RegExp(`\\s${r}\\s*=\\s*(?:"([^"]*)"|'([^']*)'|([^\\s>]+))`,"i").exec(e);return t?.[1]??t?.[2]??t?.[3]??null}function Me(e){return/^(https?:\/\/|file:\/\/|(?:workspace|sandbox):file:|\/|\.{1,2}\/)/i.test(e)}function A(e,r){const n=ne(e);if(!n)return null;if(/^https?:\/\//i.test(n))try{const s=new URL(n),o=Ee(s,r);return o||(Re(s,r.connection)?{kind:"url",src:n,title:y(s.searchParams.get("path")??s.pathname)}:null)}catch{return null}const t=$e(n),i=W(t??n,r.workspaceRootPath);if(i)return{kind:"url",src:i,title:y(t??n)};if(!t||!x(t)||!r.connection)return null;if($(t))return{kind:"local",path:t,src:r.localImageUrls.getUrl(t),title:y(t)};if(!r.activeWorkspaceAppId)return null;const l=R(t,r.workspaceRootPath);return!l||!x(l)?null:{kind:"workspace",appId:r.activeWorkspaceAppId,path:l,src:r.workspaceImageUrls.getUrl(r.activeWorkspaceAppId,l),title:y(l)}}function Ce(e,r,n){const t=W(e,n.workspaceRootPath)??W(r,n.workspaceRootPath);if(t)return{kind:"url",src:t,title:y(r)};if(!x(e)||!n.connection)return null;if($(e))return{kind:"local",path:e,src:n.localImageUrls.getUrl(e),title:y(e)};if(!n.activeWorkspaceAppId)return null;const i=R(e,n.workspaceRootPath);return!i||!x(i)?null:{kind:"workspace",appId:n.activeWorkspaceAppId,path:i,src:n.workspaceImageUrls.getUrl(n.activeWorkspaceAppId,i),title:y(i)}}function W(e,r){const n=R(e,r),t="apps/web/public/";if(!n?.startsWith(t))return null;const i=n.slice(t.length);return!i||!Oe(i)?null:le(i.split("/").map(encodeURIComponent).join("/"))}function Oe(e){const r=e.split("?")[0]?.split("#")[0]??e,n=r.lastIndexOf(".");return n<0?!1:me.has(r.slice(n).toLowerCase())}function ne(e){return e.trim().replace(/^['"`]+|['"`]+$/g,"")}function $e(e){let r=e.trim();if(!r)return null;if(r.startsWith("file://"))try{return decodeURIComponent(new URL(r).pathname)}catch{return r.replace(/^file:\/\//,"")}if($(r))return r;const n=r.indexOf("#");n>=0&&(r=r.slice(0,n));const t=r.indexOf("?");return t>=0&&(r=r.slice(0,t)),r}function $(e){return/^file:\/\//i.test(e)||/^\//.test(e)||/^[A-Za-z]:[\\/]/.test(e)}function R(e,r){let n=e.trim().replace(/^['"`]+|['"`]+$/g,"");if(!n)return null;if(n.startsWith("file://"))try{n=decodeURIComponent(new URL(n).pathname)}catch{n=n.replace(/^file:\/\//,"")}if(n=n.replace(/\\/g,"/"),$(n)){const i=r?.trim().replace(/\\/g,"/").replace(/\/+$/,"");if(!i||!n.startsWith(`${i}/`))return null;n=n.slice(i.length+1)}n=n.replace(/^\.\/+/,"");const t=n.split("/").filter(Boolean);return t.length===0||t.some(i=>i==="."||i===".."||i===".git")?null:t.join("/")}function Re(e,r){if(r){const t=new URL(r.serverUrl);if(e.origin===t.origin){if(e.pathname==="/v1/local-image"||/\/v1\/workspaces\/[^/]+\/file-image$/.test(e.pathname))return!1;if(e.pathname==="/v1/assets/workspace-image"||e.pathname==="/v1/assets/chat-attachment-image")return!0}}if(x(e.pathname))return!0;const n=e.searchParams.get("path");return!!(n&&x(n))}function Ee(e,r){if(!r.connection)return null;const n=new URL(r.connection.serverUrl);if(e.origin!==n.origin)return null;const t=e.pathname==="/v1/assets/workspace-image"?e.searchParams.get("path"):null;if(t&&x(t))return{kind:"url",src:e.toString(),title:y(t)};const i=e.pathname==="/v1/assets/chat-attachment-image"?e.searchParams.get("storageName"):null;if(i&&x(i))return{kind:"url",src:e.toString(),title:y(i)};const l=/^\/v1\/workspaces\/([^/]+)\/file-image$/.exec(e.pathname),s=l?e.searchParams.get("path"):null;if(!l||!s||!x(s))return null;const o=decodeURIComponent(l[1]),c=R(s,r.workspaceRootPath);return!c||!x(c)?null:{kind:"workspace",appId:o,path:c,src:r.workspaceImageUrls.getUrl(o,c),title:y(c)}}function Ne(e,r){if(e.kind==="url"){r.onOpenImage(e);return}if(e.kind==="local"){e.src&&r.onOpenImage({src:e.src,title:e.title});return}if(e.src){r.onOpenImage({src:e.src,title:e.title});return}r.onOpenWorkspaceImage({appId:e.appId,path:e.path,title:e.title})}function Z(e,r,n){if(e.kind==="url"){r.onPreviewImage(C(e,n));return}if(e.kind==="local"){if(e.src){r.onPreviewImage(C({src:e.src,title:e.title},n));return}r.localImageUrls.loadUrl(e.path).then(t=>{t&&n.matches(":hover")&&r.onPreviewImage(C({src:t,title:e.title},n))});return}if(e.src){r.onPreviewImage(C({src:e.src,title:e.title},n));return}r.workspaceImageUrls.loadUrl(e.appId,e.path).then(t=>{t&&n.matches(":hover")&&r.onPreviewImage(C({src:t,title:e.title},n))})}function C(e,r){const n=r.getBoundingClientRect(),t=236,i=172,l=12,s=Math.max(l,Math.min(n.left,window.innerWidth-t-l)),o=n.bottom+8,c=o+i<=window.innerHeight-l?o:Math.max(l,n.top-i-8);return{...e,x:s,y:c}}function Se(e,r,n,t){return{kind:"browser",browserHref:e,displayHref:r,x:Math.max(8,Math.min(n,window.innerWidth-220-8)),y:Math.max(8,Math.min(t,window.innerHeight-142-8))}}function Ae(e,r,n,t){return{kind:"file",path:e,displayPath:r,x:Math.max(8,Math.min(n,window.innerWidth-220-8)),y:Math.max(8,Math.min(t,window.innerHeight-72-8))}}function We({activeWorkspaceAppId:e=null,connection:r=null,content:n,onOpenBrowserLink:t,onOpenFileInSidebar:i,workspaceRootPath:l=null}){const s=h.useMemo(()=>ce(n),[n]),[o,c]=h.useState(null),[u,m]=h.useState(null),[p,g]=h.useState(null),I=G(r),k=V(r),f=h.useCallback(d=>{k.loadUrl(d.appId,d.path).then(b=>{b&&c({src:b,title:d.title})})},[k]),w=h.useMemo(()=>({activeWorkspaceAppId:e,connection:r,onOpenBrowserLink:t,onOpenFileInSidebar:i,onOpenLinkMenu:g,onOpenImage:c,onOpenWorkspaceImage:f,onPreviewImage:m,localImageUrls:I,workspaceImageUrls:k,workspaceRootPath:l}),[e,r,f,I,t,i,k,l]);return h.useEffect(()=>{if(!p)return;const d=()=>g(null),b=v=>{v.key==="Escape"&&d()};return window.addEventListener("click",d),window.addEventListener("keydown",b),window.addEventListener("scroll",d,!0),()=>{window.removeEventListener("click",d),window.removeEventListener("keydown",b),window.removeEventListener("scroll",d,!0)}},[p]),a.jsxs("div",{className:"markdown-message",children:[s.map((d,b)=>{if(d.type==="code"){const v=He(d.content,l);return v?a.jsx("div",{className:"markdown-file-reference-block",children:v.map((j,O)=>a.jsx("div",{className:"markdown-file-reference-line",children:U(j,w)},O))},b):a.jsx("pre",{className:"markdown-code-block",children:a.jsx("code",{children:d.content})},b)}if(d.type==="list"){const v=d.ordered?"ol":"ul";return a.jsx(v,{className:"markdown-list",children:d.items.map((j,O)=>a.jsxs("li",{className:j.checked===null?void 0:"markdown-task-list-item",children:[j.checked===null?null:a.jsx(J,{checked:j.checked}),a.jsx("span",{children:U(j.content,w)})]},O))},b)}if(d.type==="heading"){const v=d.level===1?"h1":d.level===2?"h2":d.level===3?"h3":"h4";return a.jsx(v,{className:"markdown-heading",children:U(d.content,w)},b)}return d.type==="table"?a.jsx("div",{className:"markdown-table-wrap",children:a.jsxs("table",{className:"markdown-table",children:[a.jsx("thead",{children:a.jsx("tr",{children:d.headers.map((v,j)=>a.jsx("th",{children:U(v,w)},j))})}),a.jsx("tbody",{children:d.rows.map((v,j)=>a.jsx("tr",{children:d.headers.map((O,F)=>a.jsx("td",{children:U(v[F]??"",w)},F))},j))})]})},b):a.jsx("p",{className:"markdown-paragraph",children:U(d.content,w)},b)}),u&&a.jsx(Fe,{preview:u}),p&&a.jsx(_e,{menu:p,onClose:()=>g(null),onOpenBrowserLink:t,onOpenFileInSidebar:i}),a.jsx(ae,{open:!!o,src:o?.src??null,title:o?.title??"",onClose:()=>c(null)})]})}function He(e,r){const n=e.split(`
7
+ `),t=[];for(const i of n){const l=i.trim();if(!l)continue;const o=l.replace(/^(?:[-*]|\d+[.)])\s+/,"").trim().replace(/^`+|`+$/g,"").trim();if(!o||!H(o,{workspaceRootPath:r}))return null;t.push(o)}return t.length>0?t:null}function Fe({preview:e}){const[r,n]=h.useState(!1);return h.useEffect(()=>{n(!1)},[e.src]),a.jsxs("div",{className:`markdown-image-hover-preview ${r?"unavailable":""}`,style:{left:e.x,top:e.y},children:[r?a.jsx("span",{children:"Preview unavailable"}):a.jsx("img",{alt:"",src:e.src,onError:()=>n(!0)}),a.jsx("span",{children:e.title})]})}function _e({menu:e,onClose:r,onOpenBrowserLink:n,onOpenFileInSidebar:t}){return e.kind==="file"?a.jsxs("div",{className:"markdown-link-menu",role:"menu",style:{left:e.x,top:e.y},onClick:i=>i.stopPropagation(),children:[a.jsx("button",{type:"button",role:"menuitem",onClick:()=>{t?.(e.path),r()},children:"Open in sidebar"}),a.jsx("button",{type:"button",role:"menuitem",onClick:()=>{_(e.displayPath),r()},children:"Copy path"})]}):a.jsxs("div",{className:"markdown-link-menu",role:"menu",style:{left:e.x,top:e.y},onClick:i=>i.stopPropagation(),children:[a.jsx("button",{type:"button",role:"menuitem",onClick:()=>{n?n(e.browserHref):window.open(e.browserHref,"_blank","noopener,noreferrer"),r()},children:"Open in sidebar"}),a.jsx("button",{type:"button",role:"menuitem",onClick:()=>{n?n(e.browserHref,{newTab:!0}):window.open(e.browserHref,"_blank","noopener,noreferrer"),r()},children:"Open in new tab"}),a.jsx("button",{type:"button",role:"menuitem",onClick:()=>{window.open(e.browserHref,"_blank","noopener,noreferrer"),r()},children:"Open externally"}),a.jsx("button",{type:"button",role:"menuitem",onClick:()=>{_(e.displayHref),r()},children:"Copy link"})]})}const ze=Object.freeze(Object.defineProperty({__proto__:null,MarkdownText:We},Symbol.toStringTag,{value:"Module"}));export{ae as I,We as M,q as a,ze as b,Y as u};
@@ -0,0 +1,10 @@
1
+ import{r as u,n as oe,bL as $,bM as de,j as n,T as ue,a0 as he,Z as b,bN as me,bO as k,at as N,bP as fe,Y as D,v as ge,a as pe,bQ as M,bR as xe,$ as H,S as je,aK as z,an as be,aC as ve,bS as Ce,bT as ye,a6 as Ne,bU as $e,E as Se}from"./index-Cr_RZ7GD.js";import{C as T}from"./chevron-up-BTn9DVRP.js";import{C as we}from"./copy-BsYs6wBI.js";import{C as P}from"./credit-card-BCePAwMI.js";import{I as Ae,a as ke,u as Ie,M as I}from"./MarkdownText-CkVkr3P1.js";import{C as Me,a as ze}from"./circle-x-B9Qa8o5a.js";import{G as Te}from"./git-branch-C7qQYFIs.js";function Re(e){const t=Ue(e);if(t)return t;const s=Pe();let a="";const r=[],l=[],i=[];for(const h of e){if(!a&&h.label&&(a=h.label),Je(l,h.label),et(i,h),h.kind==="command"&&h.content){Ee(s,Le(h.content));continue}Fe(s,h)||Xe(r,h.label)}const c=[...Ke(s),...l,...i],o=s.runCount>0?Ye(s.runCount):"",d=at(r),g=Qe(c,o)||d||a||"Ran command";return{kind:Ze(s,o),text:g}}function _e(e){const t=V(e);if(t.length===0||t.some(Z))return null;const s=t[0];if(s==="cat"){const a=p(t.slice(1));return a.length>0?`Read ${y(a)}`:"Read standard input"}return s==="sed"?rt(t):s==="rg"?lt(t):null}function Pe(){return{approvals:0,controlCount:0,editCount:0,goalContextUpdates:0,imageCount:0,listedFiles:0,readFileCount:0,readFiles:new Set,reasoningCount:0,runCount:0,searchedCode:0,subagentStatuses:new Map,testsOrChecks:0,turnInterruptions:0,webSearches:0}}function Ue(e){if(e.length===0)return null;const t=e.map(l=>l.subagentMessage).filter(l=>!!l);if(t.length===0||t.length!==e.length)return null;if(t.length===1){const l=t[0];return{kind:"subagent",text:`${l.direction==="received"?"Child Message Received":"Child Message Sent"}: ${l.summary}`}}const s=t.filter(l=>l.direction==="received").length,a=t.length-s,r=[s>0?U(s,"received"):null,a>0?U(a,"sent"):null].filter(l=>!!l);return{kind:"subagent",text:C(S(r))}}function U(e,t){return e===1?`child message ${t}`:`${e} child messages ${t}`}function Ee(e,t){e.editCount+=t.editCount??0,e.listedFiles+=t.listedFiles??0,e.searchedCode+=t.searchedCode??0,e.testsOrChecks+=t.testsOrChecks??0;for(const s of t.readFiles??[])e.readFiles.add(s);t.readFiles?.length&&(e.readFileCount+=t.readFiles.length),t.countedAsRun&&(e.runCount+=1)}function Fe(e,t){const s=t.label.toLowerCase();if(t.controlKind)return e.controlCount+=1,t.controlKind==="goal_context"&&(e.goalContextUpdates+=1),t.controlKind==="turn_aborted"&&(e.turnInterruptions+=1),!0;if(s==="reasoning")return e.reasoningCount+=1,!0;if(s.includes("approval"))return e.approvals+=1,!0;if(s.includes("subagent"))return He(e,t,a(s)),!0;if(s.includes("image"))return e.imageCount+=1,!0;function a(r){return r.includes("failed")?"failed":r.includes("blocked")?"blocked":r.includes("stale")?"stale":r.includes("needs revision")?"needs revision":r.includes("archived")?"archived":r.includes("accepted")?"accepted":r.includes("submitted")?"submitted":r.includes("completed")?"completed":"running"}return s.includes("web")?(e.webSearches+=1,!0):/\b(searching|searched)\b/.test(s)?(e.searchedCode+=1,!0):/\b(listing|listed)\b/.test(s)?(e.listedFiles+=1,!0):/\b(reading|read)\b/.test(s)?(e.readFileCount+=1,!0):/\b(editing|edited|writing|wrote|deleting|deleted|moving|moved|uploading|uploaded|creating|created)\b/.test(s)?(e.editCount+=1,!0):!1}function Le(e){const t=V(e);if(t.length===0||t.some(Z))return{countedAsRun:!0};const s=Be(t);if(!s)return{countedAsRun:!0};const[a,r]=s;if(a==="apply_patch")return{countedAsRun:!1,editCount:1};if(["rm","mv","cp","mkdir","touch"].includes(a))return{countedAsRun:!1,editCount:1};if(Oe(a,r)||qe(a))return{countedAsRun:!1,testsOrChecks:1};if(a==="rg")return r.includes("--files")?{countedAsRun:!1,listedFiles:1}:{countedAsRun:!1,searchedCode:1};if(["grep","ag"].includes(a))return{countedAsRun:!1,searchedCode:1};if(a==="git"&&r[0]==="grep")return{countedAsRun:!1,searchedCode:1};if(["ls","find","tree","fd"].includes(a))return{countedAsRun:!1,listedFiles:1};const l=Ge(a,r);return l.length>0?{countedAsRun:!1,readFiles:l}:{countedAsRun:!0}}function Be(e){let t=0;for(;/^[A-Za-z_][A-Za-z0-9_]*=.*/.test(e[t]??"");)t+=1;const s=e[t];if(!s)return null;if(s==="bunx"||s==="npx"){const a=e[t+1];return a?[a,e.slice(t+2)]:[s,[]]}return[s,e.slice(t+1)]}function Oe(e,t){if(!["bun","npm","pnpm","yarn"].includes(e))return!1;const s=t.join(" ").toLowerCase();return/\b(test|typecheck|check|lint|vitest|jest|playwright|tsc)\b/.test(s)}function qe(e){return["eslint","jest","playwright","prettier","tsc","vitest"].includes(e)}function Ge(e,t){if(e==="cat"||e==="nl"||e==="head"||e==="tail"||e==="wc")return w(p(t));if(e==="sed"){const s=t.findIndex(a=>a!=="-n"&&!a.startsWith("--"));return w(s>=0?p(t.slice(s+1)):[])}return e==="awk"||e==="jq"?w(p(t.slice(1))):[]}function w(e){return e.filter(t=>!(!t||t==="."||t==="-"||/^\d+$/.test(t)))}function Ke(e){const t=[],s=De(e);s&&t.push(s),e.editCount>0&&t.push("made edits");const a=e.readFiles.size||e.readFileCount;return a>0&&t.push(F("read",a,"file")),e.searchedCode>0&&t.push("searched code"),e.listedFiles>0&&t.push("listed files"),e.testsOrChecks>0&&t.push(e.testsOrChecks===1?"ran checks":`ran ${e.testsOrChecks} checks`),e.webSearches>0&&t.push("searched web"),e.imageCount>0&&t.push(F("read",e.imageCount,"image")),e.reasoningCount>0&&t.push("reasoned"),e.approvals>0&&t.push("requested approval"),t.push(...We(e)),t}function We(e){const t=[];e.goalContextUpdates===1&&t.push("goal context updated"),e.goalContextUpdates>1&&t.push(`${e.goalContextUpdates} goal context updates`),e.turnInterruptions===1&&t.push("turn interrupted"),e.turnInterruptions>1&&t.push(`${e.turnInterruptions} turns interrupted`);const s=e.controlCount-e.goalContextUpdates-e.turnInterruptions;return s===1&&t.push("context updated"),s>1&&t.push(`${s} context updates`),t}function De(e){const t=Ve(e);return t.failed>0?f(t.failed,"failed"):t.blocked>0?f(t.blocked,"blocked"):t.stale>0?f(t.stale,"stale"):t["needs revision"]>0?f(t["needs revision"],"needs revision"):t.submitted>0?f(t.submitted,"submitted"):t.running>0&&t.completed===0&&t.accepted===0?f(t.running,"running"):t.accepted>0?f(t.accepted,"accepted"):t.completed>0?f(t.completed,"completed"):t.archived>0?f(t.archived,"archived"):null}function He(e,t,s){const a=t.openSession?.sessionId??(t.content.trim()||t.id),r=e.subagentStatuses.get(a);(!r||E(s)>E(r))&&e.subagentStatuses.set(a,s)}function Ve(e){const t={accepted:0,archived:0,blocked:0,completed:0,failed:0,"needs revision":0,running:0,stale:0,submitted:0};for(const s of e.subagentStatuses.values())t[s]+=1;return t}function E(e){return e==="running"?1:e==="submitted"?2:e==="accepted"||e==="completed"||e==="archived"?3:e==="needs revision"?4:e==="blocked"?5:e==="stale"?6:7}function f(e,t){return e===1?`subagent ${t}`:`${e} subagents ${t}`}function Ze(e,t){const s=[];return e.subagentStatuses.size>0&&s.push("subagent"),e.editCount>0&&s.push("edit"),(e.readFiles.size>0||e.readFileCount>0)&&s.push("read"),e.searchedCode>0&&s.push("search"),e.listedFiles>0&&s.push("list"),e.webSearches>0&&s.push("web"),e.imageCount>0&&s.push("image"),e.reasoningCount>0&&s.push("reasoning"),e.approvals>0&&s.push("approval"),e.controlCount>0&&s.push("control"),(e.testsOrChecks>0||t)&&s.push("command"),s[0]??"command"}function Ye(e){return e===1?"ran a command":`ran ${e} commands`}function F(e,t,s){return t===1?`${e} a ${s}`:`${e} ${t} ${s}s`}function Qe(e,t){return e.length===0?t?C(t):"":t?`${C(S(e))}, ${t}`:C(S(e))}function Xe(e,t){const s=t.trim();s&&(e.includes(s)||e.push(s))}function Je(e,t){const s=tt(t);!s||e.includes(s)||e.push(s)}function et(e,t){const s=t.receipt;if(!s)return;const a=`${s.status} receipt ${st(s.id)} ${nt(s.totalUsd)}`;e.includes(a)||e.push(a)}function tt(e){switch(e.trim().toLowerCase()){case"applied locally":return"applied locally";case"apply locally failed":return"apply locally failed";case"exported sandbox patch":return"exported patch";case"patch export failed":return"patch export failed";case"preserved sandbox source":return"preserved sandbox source";case"preserve failed":return"preserve failed";case"stopped sandbox":return"stopped sandbox";case"sandbox stop failed":return"sandbox stop failed";default:return null}}function nt(e){const t=e.trim();return t.startsWith("$")?t:`$${t}`}function st(e){const t=e.trim();return t.length<=14?t:`${t.slice(0,6)}...${t.slice(-4)}`}function at(e){return e.length===0?"":C(S(e.map(it)))}function it(e){return e&&`${e[0].toLowerCase()}${e.slice(1)}`}function S(e){return e.length===0?"":e.length===1?e[0]:e.length===2?`${e[0]} and ${e[1]}`:`${e.slice(0,-1).join(", ")}, and ${e[e.length-1]}`}function C(e){return e&&`${e[0].toUpperCase()}${e.slice(1)}`}function rt(e){const t=e.findIndex((l,i)=>i>0&&l!=="-n"&&!l.startsWith("--")),s=t>=0?e[t]??"":"",a=t>=0?p(e.slice(t+1)):[],r=/^(\d+)(?:,(\d+))?p$/.exec(s);if(r){const l=r[1],i=r[2],c=i?`lines ${l}-${i}`:`line ${l}`;return a.length>0?`Read ${c} of ${y(a)}`:`Read ${c}`}return a.length>0?`Read ${y(a)} with sed`:"Run sed"}function lt(e){const t=e.slice(1);if(t.includes("--files")){const l=p(t.filter(i=>i!=="--files"));return l.length>0?`List files matching ${y(l)}`:"List files"}const s=p(t),a=s[0],r=s.slice(1);return a?r.length>0?`Search for ${L(a)} in ${y(r)}`:`Search for ${L(a)}`:"Search files"}function V(e){return(e.match(/"([^"\\]|\\.)*"|'[^']*'|[^\s]+/g)??[]).map(s=>ct(s)).filter(Boolean)}function ct(e){return e.startsWith("'")&&e.endsWith("'")||e.startsWith('"')&&e.endsWith('"')?e.slice(1,-1):e}function Z(e){return["|","&&","||",";",">",">>","<","(",")"].includes(e)}function p(e){const t=[];for(let s=0;s<e.length;s+=1){const a=e[s];if(!a.startsWith("-")){t.push(a);continue}ot(a)&&s+1<e.length&&(s+=1)}return t}function ot(e){return["-e","-f","-g","--glob","--type","-t","--context","-C","-A","-B","-m","-n","-c"].includes(e)}function y(e){return e.length===1?e[0]:e.length===2?`${e[0]} and ${e[1]}`:`${e[0]} and ${e.length-1} more`}function L(e){return`"${e}"`}const j=new Map,dt=15e3;function ut(e,t){const s=ht(e),[a,r]=u.useState(()=>s.getUrl(t));return u.useEffect(()=>{let l=!1;return r(s.getUrl(t)),s.loadUrl(t).then(i=>{l||r(i)}),()=>{l=!0}},[t,s]),a}function ht(e){const[,t]=u.useState(0),s=u.useCallback(r=>!e||!r?null:B(O(e,r)),[e]),a=u.useCallback(async r=>{if(!e||!r)return null;const l=O(e,r),i=B(l);if(i)return i;const c=j.get(l);if(c?.state==="loading")return c.promise;const o=oe.signChatAttachmentImageUrl(e,r).then(d=>(j.set(l,{state:"ready",url:d.url,expiresAt:d.expiresAt}),t(g=>g+1),d.url)).catch(()=>(j.delete(l),t(d=>d+1),null));return j.set(l,{state:"loading",promise:o}),o},[e]);return u.useMemo(()=>({getUrl:s,loadUrl:a}),[s,a])}function B(e){const t=j.get(e);return t?.state!=="ready"?null:t.expiresAt<=Date.now()+dt?(j.delete(e),null):t.url}function O(e,t){return[e.serverUrl,e.token,t.sessionId,t.turnId,t.attachmentId,t.storageName,t.contentType].join("\0")}function mt({actionRun:e,onOpenBrowserLink:t,onOpenFileInSidebar:s,workspaceRootPath:a=null}){const r=xt(e.status),l=jt(e);return n.jsxs("div",{className:`action-run-card ${e.status}`,children:[n.jsxs("div",{className:"action-run-header",children:[n.jsx("span",{className:"action-run-status",title:e.status,children:n.jsx(r,{size:15})}),n.jsxs("div",{className:"action-run-title",children:[n.jsx("strong",{children:e.title}),n.jsx("span",{children:e.actionName})]})]}),l.length>0&&n.jsx("div",{className:"action-run-meta","aria-label":"Action run metadata",children:l.map(i=>n.jsxs("span",{className:"action-run-chip",children:[i.icon,n.jsx("span",{children:i.label}),n.jsx("code",{children:i.value})]},i.label))}),e.responseText&&n.jsx("p",{className:"action-run-response",children:e.responseText}),e.refs.length>0&&n.jsx("div",{className:"action-run-ref-list","aria-label":"Action run references",children:e.refs.slice(0,8).map(i=>n.jsx(pt,{refItem:i,onOpenBrowserLink:t,onOpenFileInSidebar:s,workspaceRootPath:a},i.id))}),e.childCalls.length>0&&n.jsx("div",{className:"action-run-child-list","aria-label":"Child implementation calls",children:e.childCalls.map(i=>n.jsxs("div",{className:`action-run-child ${i.status}`,children:[n.jsx("span",{children:i.label}),n.jsx("small",{children:i.status}),i.detail&&n.jsx("code",{children:i.detail})]},i.id))})]})}function q(e){return e.implementationType==="openpond-profile-action"}function ft(e){const t=e.agentName??e.agentId;return e.actionName.endsWith(".chat")?$({actionId:e.actionName,label:e.title,name:t}):t?$({actionId:e.actionName,name:t}):e.title&&!de(e.title)?$({actionId:e.actionName,label:e.title}):$({actionId:e.actionName})}function gt(e){return e.status==="failed"?`${e.title} failed.`:e.status==="completed"?`${e.title} completed.`:e.status==="pending"?`${e.title} is pending.`:`${e.title} is running...`}function pt({refItem:e,onOpenBrowserLink:t,onOpenFileInSidebar:s,workspaceRootPath:a}){const r=s?me(e.target,{workspaceRootPath:a}):null,l=bt(e.target)&&t,i=!!(r&&s);return n.jsxs("div",{className:`action-run-ref ${e.kind}`,children:[n.jsx("span",{children:e.label}),n.jsx("code",{children:e.target}),l&&n.jsx("button",{type:"button",title:`Open ${e.target}`,"aria-label":`Open ${e.label}`,onClick:()=>t(e.target,{newTab:!0}),children:n.jsx(k,{size:13})}),i&&n.jsx("button",{type:"button",title:`Open ${e.target}`,"aria-label":`Open ${e.label}`,onClick:()=>{r&&s&&s(r.path)},children:n.jsx(k,{size:13})})]})}function xt(e){return e==="completed"?ue:e==="failed"?Me:ze}function jt(e){const t=[];return e.implementationType&&t.push({label:"Type",value:e.implementationType,icon:n.jsx(he,{size:12})}),e.runId&&t.push({label:"Run",value:e.runId,icon:n.jsx(b,{size:12})}),e.sandboxId&&t.push({label:"Sandbox",value:e.sandboxId,icon:n.jsx(b,{size:12})}),e.sourceRef&&t.push({label:"Source",value:e.sourceRef,icon:n.jsx(Te,{size:12})}),e.manifestHash&&t.push({label:"Manifest",value:e.manifestHash,icon:n.jsx(b,{size:12})}),t}function bt(e){return/^https?:\/\//i.test(e)}const A=5,vt=4,Y=5,Ct=280;function yt({activeWorkspaceAppId:e,connection:t,message:s,onOpenSession:a}){const[r,l]=u.useState(!1),[i,c]=u.useState(null),o=s.activities??[],d=Re(o),g=o.find(m=>m.imagePreview)?.imagePreview??null,h=R(i,t,e),x=o.some(m=>m.controlKind==="turn_aborted"),v=Et(o);return o.length>0&&o.every(m=>m.subagentMessage)?n.jsx($t,{activities:o}):n.jsxs("article",{className:"activity-group",children:[n.jsxs("div",{className:"activity-summary-row",children:[n.jsxs("button",{type:"button","aria-expanded":r,className:`activity-summary ${x?"danger":""}`,onClick:()=>l(m=>!m),children:[g?n.jsx(Tt,{activeWorkspaceAppId:e,connection:t,image:g}):n.jsx(Rt,{kind:d.kind}),n.jsx(At,{summary:d.text}),n.jsx(N,{className:`activity-summary-toggle ${r?"expanded":""}`,size:14})]}),v.length>0&&a?n.jsx(Pt,{onOpenSession:a,onShowAll:()=>l(!0),sessions:v}):null]}),r&&n.jsx("div",{className:"activity-details",children:o.map(m=>n.jsx(Nt,{activeWorkspaceAppId:e,activity:m,connection:t,onOpenImage:c,onOpenSession:a},m.id))}),n.jsx(Ae,{open:!!h,src:h,title:i?.path??"",onClose:()=>c(null)})]})}function Nt({activeWorkspaceAppId:e,activity:t,connection:s,onOpenImage:a,onOpenSession:r}){const l=R(t.imagePreview??null,s,e);return t.subagentMessage?n.jsx(Q,{activity:t}):n.jsxs("div",{className:`activity-detail-row ${t.controlKind==="turn_aborted"?"danger":""}`,children:[n.jsx("span",{children:t.label}),n.jsxs("div",{className:"activity-detail-main",children:[t.content&&(t.kind==="command"?n.jsx(kt,{className:"activity-detail-command",command:t.content}):Bt(t.content)?n.jsx("pre",{className:"activity-detail-output",children:t.content}):n.jsx("code",{children:t.content})),t.detail&&n.jsx("pre",{className:"activity-detail-output",children:Mt(t.detail)}),t.meta&&n.jsx("small",{className:"activity-detail-meta",children:t.meta}),t.imagePreview&&l&&n.jsx("button",{type:"button",className:"activity-image-preview",title:`Open ${t.imagePreview.path}`,onClick:()=>a(t.imagePreview??null),children:n.jsx("img",{alt:fe(t.imagePreview.path),decoding:"async",loading:"lazy",src:l})}),t.openSession&&r?n.jsx(X,{className:"activity-subagent-detail-avatar",openSession:t.openSession,onOpenSession:r}):null]})]},t.id)}function Q({activity:e}){const[t,s]=u.useState(!1),a=e.subagentMessage;if(!a)return null;const r=`${ee(a.roleId??e.openSession?.roleId)} subagent`,l=a.direction==="received"?`${r} update`:`Message to ${r.toLowerCase()}`,i=a.modelRef?.modelId?`${l} · ${a.modelRef.modelId}`:l,c=St(a),o=wt(a.body);return n.jsx("div",{className:`activity-child-message ${a.direction}`,children:n.jsxs("div",{className:"activity-child-message-card",children:[n.jsxs("div",{className:"activity-child-message-header",children:[n.jsxs("span",{className:"activity-child-message-title",children:[n.jsx(D,{"aria-hidden":!0,size:14}),n.jsx("strong",{title:i,children:i})]}),n.jsx("small",{children:a.kind.replace(/_/g," ")})]}),n.jsx("p",{className:o&&!t?"collapsed":void 0,style:{"--subagent-message-visible-lines":Y},children:a.body}),o?n.jsx("button",{type:"button",className:"activity-child-message-toggle","aria-expanded":t,onClick:()=>s(d=>!d),children:t?"Show less":"Show more"}):null,n.jsxs("details",{className:"activity-child-message-details",children:[n.jsx("summary",{children:"Message details"}),n.jsx("div",{className:"activity-child-message-facts","aria-label":"Child message metadata",children:c.map(d=>n.jsxs("span",{children:[n.jsx("small",{children:d.label}),n.jsx("code",{title:d.value,children:d.value})]},d.label))})]}),a.refs?.length?n.jsx("div",{className:"activity-child-message-refs","aria-label":"Child message references",children:a.refs.map(d=>n.jsxs("span",{children:[d.kind,":",d.id," (",d.label,")"]},`${d.kind}:${d.id}`))}):null]})},e.id)}function $t({activities:e}){const t=e[0]?.subagentMessage?.direction??"received";return n.jsx("article",{className:`activity-child-message-group ${t}`,children:e.map(s=>n.jsx(Q,{activity:s},s.id))})}function St(e){return[{label:"Message",value:e.messageId},{label:"Kind",value:e.kind},{label:"From",value:e.fromRunId},e.roleId?{label:"Role",value:e.roleId}:null,e.modelRef?{label:"Model",value:`${e.modelRef.providerId}/${e.modelRef.modelId}`}:null,e.childSessionId?{label:"Child",value:e.childSessionId}:null,e.parentGoalId?{label:"Goal",value:e.parentGoalId}:null,e.toRunId?{label:"To run",value:e.toRunId}:null,e.toRole?{label:"To role",value:e.toRole}:null,e.deliveryStatus?{label:"Delivery",value:e.deliveryStatus}:null,e.wakeReason?{label:"Wake",value:e.wakeReason}:null,e.createdAt?{label:"Created",value:e.createdAt}:null].filter(t=>!!t)}function wt(e){return e.length>Ct||e.split(/\r?\n/).length>Y}function At({summary:e}){return n.jsx("span",{className:"activity-summary-text",children:e})}function kt({className:e,command:t}){const s=_e(t)??t;return n.jsx("code",{className:`${e} shell-command-code`,title:t,children:s===t?It(t):s})}function It(e){return zt(e).map((t,s)=>n.jsx("span",{className:`shell-token ${t.kind}`,children:t.text},`${s}-${t.text}`))}function Mt(e){const t=e.replace(/\r\n/g,`
2
+ `).trimEnd(),s=t.split(`
3
+ `);if(s.length<=A)return t;const a=s.length-A;return`${s.slice(0,A).join(`
4
+ `)}
5
+ ... ${a} ${a===1?"line":"lines"} omitted`}function zt(e){const t=e.match(/"[^"]*"|'[^']*'|&&|\|\||[|;&()<>]|\s+|[^\s|;&()<>]+/g)??[e];let s=!0;return t.map(a=>/^\s+$/.test(a)?{kind:"plain",text:a}:/^(?:&&|\|\||[|;&()<>])$/.test(a)?(s=a!==")"&&a!==">",{kind:"operator",text:a}):/^(['"]).*\1$/.test(a)?{kind:"string",text:a}:/^[A-Za-z_][A-Za-z0-9_]*=.*/.test(a)?{kind:"variable",text:a}:s?(s=!1,{kind:"command",text:a}):/^-{1,2}[\w-]/.test(a)?{kind:"flag",text:a}:/^(?:\.{0,2}\/|~\/|[\w.-]+\/)/.test(a)?{kind:"path",text:a}:{kind:"plain",text:a})}function Tt({activeWorkspaceAppId:e,connection:t,image:s}){const a=R(s,t,e);return a?n.jsx("img",{"aria-hidden":!0,className:"activity-summary-image",decoding:"async",loading:"lazy",src:a,alt:""}):null}function Rt({kind:e}){const t=_t(e);return n.jsx(t,{"aria-hidden":!0,className:`activity-summary-kind-icon ${e}`,size:14})}function _t(e){return e==="approval"||e==="control"?ge:e==="edit"?pe:e==="image"?M:e==="list"?xe:e==="read"?b:e==="reasoning"?H:e==="search"?je:e==="subagent"?D:e==="web"?z:be}function Pt({onOpenSession:e,onShowAll:t,sessions:s}){const a=s.slice(0,vt),r=Math.max(0,s.length-a.length),l=s.map(J).join(", ");return n.jsxs("div",{"aria-label":`Subagent conversations: ${l}`,className:"activity-subagent-avatar-group",title:`Subagent conversations: ${l}`,children:[a.map(i=>n.jsx(X,{openSession:i,onOpenSession:e},i.sessionId)),r>0?n.jsxs("button",{type:"button","aria-label":`Show ${r} more subagent conversation${r===1?"":"s"}`,className:"activity-subagent-avatar activity-subagent-avatar-count",onClick:t,title:`Show ${r} more subagent conversation${r===1?"":"s"}`,children:["+",r]}):null]})}function X({className:e="",onOpenSession:t,openSession:s}){const a=te(s.roleId),r=Ft(s.status),l=`Open ${J(s)} conversation`;return n.jsx("button",{type:"button","aria-label":l,className:`activity-subagent-avatar ${e}`,"data-role":a,"data-status":r,onClick:()=>t(s.sessionId),title:l,children:n.jsx(Ut,{roleId:a})})}function Ut({roleId:e}){return e==="coding"?n.jsxs("svg",{"aria-hidden":!0,viewBox:"0 0 24 24",className:"activity-subagent-avatar-svg",children:[n.jsx("path",{d:"M9.4 7.2 4.8 12l4.6 4.8"}),n.jsx("path",{d:"m14.6 7.2 4.6 4.8-4.6 4.8"}),n.jsx("path",{d:"m12.9 5.7-1.8 12.6"})]}):e==="research"?n.jsxs("svg",{"aria-hidden":!0,viewBox:"0 0 24 24",className:"activity-subagent-avatar-svg",children:[n.jsx("circle",{cx:"10.8",cy:"10.8",r:"5.2"}),n.jsx("path",{d:"m15 15 4 4"}),n.jsx("path",{d:"M8.6 10.8h4.4"}),n.jsx("path",{d:"M10.8 8.6v4.4"})]}):e==="review"?n.jsxs("svg",{"aria-hidden":!0,viewBox:"0 0 24 24",className:"activity-subagent-avatar-svg",children:[n.jsx("path",{d:"M7 4.8h7.2L18 8.6v10.6H7z"}),n.jsx("path",{d:"M14 4.8v4h4"}),n.jsx("path",{d:"m8.9 14.2 2 2 4.3-4.7"})]}):e==="test"?n.jsxs("svg",{"aria-hidden":!0,viewBox:"0 0 24 24",className:"activity-subagent-avatar-svg",children:[n.jsx("path",{d:"M9.2 4.8h5.6"}),n.jsx("path",{d:"M10.4 4.8v5.4l-4 6.8a1.8 1.8 0 0 0 1.6 2.7h8a1.8 1.8 0 0 0 1.6-2.7l-4-6.8V4.8"}),n.jsx("path",{d:"M8.2 15.8h7.6"})]}):e==="docs"?n.jsxs("svg",{"aria-hidden":!0,viewBox:"0 0 24 24",className:"activity-subagent-avatar-svg",children:[n.jsx("path",{d:"M7 4.8h7.2L18 8.6v10.6H7z"}),n.jsx("path",{d:"M14 4.8v4h4"}),n.jsx("path",{d:"M9.2 11.4h5.6"}),n.jsx("path",{d:"M9.2 14.2h5.6"}),n.jsx("path",{d:"M9.2 17h3.4"})]}):e==="planner"?n.jsxs("svg",{"aria-hidden":!0,viewBox:"0 0 24 24",className:"activity-subagent-avatar-svg",children:[n.jsx("circle",{cx:"7.2",cy:"7.2",r:"2.1"}),n.jsx("circle",{cx:"16.8",cy:"7.2",r:"2.1"}),n.jsx("circle",{cx:"12",cy:"16.8",r:"2.1"}),n.jsx("path",{d:"M9 8.2h6"}),n.jsx("path",{d:"m8.5 9 2.4 5.4"}),n.jsx("path",{d:"m15.5 9-2.4 5.4"})]}):e==="summarizer"?n.jsxs("svg",{"aria-hidden":!0,viewBox:"0 0 24 24",className:"activity-subagent-avatar-svg",children:[n.jsx("path",{d:"M7 6.8h10"}),n.jsx("path",{d:"M7 10.4h8.2"}),n.jsx("path",{d:"M7 14h6.2"}),n.jsx("path",{d:"M7 17.6h4.2"})]}):n.jsxs("svg",{"aria-hidden":!0,viewBox:"0 0 24 24",className:"activity-subagent-avatar-svg",children:[n.jsx("circle",{cx:"12",cy:"8.2",r:"3.2"}),n.jsx("path",{d:"M6.5 19.2c.6-3 2.5-5 5.5-5s4.9 2 5.5 5"}),n.jsx("path",{d:"M5.2 11.8h2"}),n.jsx("path",{d:"M16.8 11.8h2"})]})}function Et(e){const t=new Map;for(const s of e){const a=s.openSession;a&&t.set(a.sessionId,{...t.get(a.sessionId),...a})}return[...t.values()].reverse()}function J(e){const t=`${ee(e.roleId)} subagent`,s=e.status?.replace(/_/g," ").trim();return s?`${t} (${s})`:t}function ee(e){return te(e).split(/[-_]+/).filter(Boolean).map(s=>s.slice(0,1).toUpperCase()+s.slice(1)).join(" ")||"Subagent"}function te(e){const t=e?.trim().toLowerCase()||"subagent";return/^[a-z][a-z0-9_-]*$/.test(t)?t:"subagent"}function Ft(e){const t=e?.trim().toLowerCase()||"unknown";return/^[a-z][a-z0-9_-]*$/.test(t)?t:"unknown"}function R(e,t,s){const a=e&&Lt(e.path)?e.path:null,r=e?.appId??s,l=ke(t,a),i=Ie(t,a?null:r,a?null:e?.path);return a?l:i}function Lt(e){return/^file:\/\//i.test(e)||/^\//.test(e)||/^[A-Za-z]:[\\/]/.test(e)}function Bt(e){return e.includes(`
6
+ `)||e.length>160}function Ot({summary:e,onOpenFileInSidebar:t}){const[s,a]=u.useState(null),r=`${e.filesChanged} ${e.filesChanged===1?"file":"files"} changed`,l=e.files.reduce((i,c)=>{const o=ne(c);return{additions:i.additions+o.additions,deletions:i.deletions+o.deletions}},{additions:0,deletions:0});return n.jsxs("div",{className:"change-summary-card",children:[n.jsxs("div",{className:"change-summary-header",children:[n.jsx("span",{children:r}),n.jsxs("span",{className:"change-summary-counts",children:[n.jsxs("span",{className:"diff-addition",children:["+",l.additions]}),n.jsxs("span",{className:"diff-deletion",children:["-",l.deletions]})]})]}),n.jsx("div",{className:"change-summary-files",children:e.files.map(i=>n.jsx(qt,{file:i,onOpenFileInSidebar:t,open:s===i.path,onToggle:()=>a(c=>c===i.path?null:i.path)},i.path))})]})}function qt({file:e,onOpenFileInSidebar:t,open:s,onToggle:a}){const r=ne(e),l=se(e.patch);return n.jsxs("div",{className:"change-summary-file",children:[n.jsxs("div",{className:"change-summary-file-trigger",children:[n.jsx("button",{type:"button",className:"change-summary-file-toggle",onClick:a,children:n.jsx("span",{children:e.path})}),n.jsxs("span",{className:"change-summary-counts",children:[n.jsxs("span",{className:"diff-addition",children:["+",r.additions]}),n.jsxs("span",{className:"diff-deletion",children:["-",r.deletions]})]}),t&&n.jsx("button",{type:"button",className:"change-summary-open-file",title:"Open in sidebar","aria-label":`Open ${e.path} in sidebar`,onClick:()=>t(e.path),children:n.jsx(k,{size:14})}),n.jsx("button",{type:"button",className:"change-summary-expand-file",title:s?"Hide patch":"Show patch","aria-label":s?`Hide ${e.path} patch`:`Show ${e.path} patch`,onClick:a,children:n.jsx(N,{className:s?"expanded":"",size:14})})]}),s&&l&&n.jsx("div",{className:"change-summary-patch-unavailable",children:"Patch is no longer available for this workspace path."}),s&&e.patch&&!l&&n.jsx("pre",{className:"change-summary-patch",children:n.jsx("code",{children:e.patch})})]})}function ne(e){if((e.status==="added"||e.status==="untracked")&&e.additions===0&&e.content)return{additions:Gt(e.content),deletions:0};if(e.additions>0||e.deletions>0||!e.patch||se(e.patch))return{additions:e.additions,deletions:e.deletions};const t=Kt(e.patch);return t.additions>0||t.deletions>0?t:{additions:e.additions,deletions:e.deletions}}function Gt(e){const t=e.endsWith(`
7
+ `)?e.slice(0,-1):e;return t?t.split(`
8
+ `).length:0}function se(e){return/^error: Could not access /m.test(e)}function Kt(e){let t=0,s=0;for(const a of e.split(`
9
+ `))a.startsWith("+++")||a.startsWith("---")||(a.startsWith("+")&&(t+=1),a.startsWith("-")&&(s+=1));return{additions:t,deletions:s}}function Wt({run:e}){const t=e.plan,s=e.questions.find(c=>c.status==="pending")??null,a=ve(t?.metadata),l=e.target.kind==="agent"?null:e.sourceRefs[0]??t?.sourcePlan[0]?.path??null,i=e.checkRefs.length||t?.checks.length||0;return n.jsxs("section",{className:"chat-create-receipt","aria-label":"Create or improve status",children:[n.jsxs("div",{className:"chat-create-receipt-heading",children:[n.jsx(b,{size:14}),n.jsx("span",{children:Dt(e)}),n.jsx("small",{children:e.target.kind})]}),n.jsx("p",{children:Ht(e,t?.summary??null,s?.prompt??null)}),a||l||i?n.jsxs("div",{className:"chat-create-receipt-facts",children:[a?n.jsx("span",{title:a.detail,children:a.label}):null,l?n.jsx("span",{title:l,children:l}):null,i?n.jsxs("span",{children:[i," Evals"]}):null]}):null]})}function Dt(e){const t=e.target.kind==="agent";return e.state==="awaiting_questions"?"Question ready":e.state==="awaiting_plan_approval"?"Plan ready":e.state==="applying_source"?t?"Saving Agent":"Applying source":e.state==="running_checks"?"Running Evals":e.state==="evaluating"?t?"Checking Agent":"Evaluating candidate":e.state==="awaiting_promotion"?t?"Update ready":"Candidate ready":e.state==="opening_pull_request"?"Opening review":e.state==="pull_request_open"?"Review open":e.state==="reconciling_release"?t?"Applying update":"Merging change":e.state==="released"?t?"Agent updated":"Released":e.state==="rejected"?t?"Current Agent kept":"Rejected":e.state==="ready"||e.state==="ready_local"?t?"Agent ready":"Workproduct ready":e.state==="published_hosted"?"Published":e.state==="cancelled"?"Cancelled":e.state==="blocked"?"Blocked":e.state==="failed"?"Failed":e.operation==="improve"?"Planning improvement":"Planning creation"}function Ht(e,t,s){return e.state==="awaiting_questions"&&s?s:t||(e.blockedReason?e.blockedReason:e.state==="ready"||e.state==="ready_local"?e.target.kind==="agent"?"The Agent and its actions are ready to use.":"The candidate and its Evals are ready.":e.state==="awaiting_promotion"?e.target.kind==="agent"?"The updated Agent passed its Evals. Apply the update or keep the current version.":"The candidate has been committed and evaluated. Merge or reject it.":e.state==="pull_request_open"&&e.releaseOutcome.pullRequest?e.target.kind==="agent"?"The Agent update review is waiting to finish or close.":"The external review is waiting for merge or closure.":e.state==="released"?e.target.kind==="agent"?"The Agent update is saved and its Evals passed.":"The change merged and the active Profile passed its post-merge Evals.":e.state==="rejected"?e.blockedReason??(e.target.kind==="agent"?"The Agent update was not applied.":"The candidate was rejected."):`Preparing work for ${e.objective}.`)}const G=5;function Vt({prompt:e}){const[t,s]=u.useState(!1),a=u.useMemo(()=>t?e.items:e.items.slice(0,G),[t,e.items]),r=Math.max(0,e.items.length-a.length),l=e.totalEvidenceCount||e.items.length;return n.jsxs("div",{className:"insights-run-prompt-card",children:[n.jsxs("div",{className:"insights-run-prompt-heading",children:[n.jsx("span",{className:"insights-run-prompt-icon","aria-hidden":"true",children:n.jsx(H,{size:15})}),n.jsxs("div",{children:[n.jsx("strong",{children:"Insights scan"}),n.jsx("span",{children:Yt(e,l)})]})]}),a.length>0?n.jsx("div",{className:"insights-run-evidence-list",children:a.map((i,c)=>n.jsx(Zt,{item:i},`${i.evidenceSource}:${i.evidenceKey}:${c}`))}):n.jsx("p",{className:"insights-run-empty",children:"No evidence items were included."}),e.items.length>G?n.jsxs("button",{type:"button",className:"insights-run-show-more",onClick:()=>s(i=>!i),children:[n.jsx("span",{children:t?"Show less":`Show ${r} more`}),t?n.jsx(T,{size:13}):n.jsx(N,{size:13})]}):null]})}function Zt({item:e}){const t=e.title??K(e.evidenceSource),s=e.summary??e.evidenceKey,a=e.createPipelineState??e.type??e.severity;return n.jsxs("div",{className:"insights-run-evidence-row",children:[n.jsxs("div",{children:[n.jsx("strong",{children:t}),n.jsx("span",{children:s})]}),n.jsxs("div",{className:"insights-run-evidence-meta",children:[n.jsx("span",{children:K(e.evidenceSource)}),a?n.jsx("span",{children:a}):null]})]})}function Yt(e,t){const s=[e.trigger?`${e.trigger} run`:"run",`${t} evidence item${t===1?"":"s"}`];return e.eventCount!==null&&s.push(`${e.eventCount} events`),e.truncated&&s.push("JSON truncated"),s.join(" · ")}function K(e){switch(e){case"create_edit":return"Create/Improve";case"stuck_turn":return"Stuck turn";case"tool_failure":return"Tool failure";case"abandoned_goal":return"Abandoned goal";case"user_correction":return"Correction";case"unresolved_conversation":return"Unresolved";case"usage_anomaly":return"Usage";default:return e||"Evidence"}}const bn=u.memo(function({activeWorkspaceAppId:t=null,accountBaseUrl:s=null,billingOrganizationSlug:a=null,billingTeamId:r=null,connection:l=null,message:i,onOpenBrowserLink:c,onOpenFileInSidebar:o,onOpenProfileSettings:d,onOpenSession:g,showFooter:h=!1,workspaceRootPath:x=null}){if(i.role==="status_divider")return n.jsx(un,{message:i});if(i.role==="activity_group")return n.jsx(yt,{activeWorkspaceAppId:t,connection:l,message:i,onOpenSession:g});if(i.role==="reasoning")return n.jsx(dn,{activeWorkspaceAppId:t,connection:l,message:i,onOpenBrowserLink:c,onOpenFileInSidebar:o,workspaceRootPath:x});if(i.role==="error")return i.errorKind==="opchat_quota_exceeded"?n.jsx("article",{className:"message-row assistant",children:n.jsx(an,{accountBaseUrl:s,billingOrganizationSlug:a,billingTeamId:r,onOpenBrowserLink:c})}):n.jsx("article",{className:"message-row assistant",children:n.jsx("div",{className:"assistant-message error-message",children:i.content??""})});if(i.role==="user"){const re=!!i.attachments?.length,le=!!i.attachments?.some(ce=>ce.kind==="image");return n.jsx("article",{className:"message-row user",children:n.jsxs("div",{className:`user-message ${i.insightsRunPrompt?"insights-run-message":""} ${re?"has-attachments":""} ${le?"has-image-attachments":""}`,children:[i.attachments?.length?n.jsx(ln,{attachments:i.attachments,connection:l}):null,i.insightsRunPrompt?n.jsx(Vt,{prompt:i.insightsRunPrompt}):null,i.content?n.jsx(Qt,{content:i.content}):null]})})}const v=Ce(i.timestamp),_=ye(i.timestamp),m=i.actionRun&&q(i.actionRun)?ft(i.actionRun):null;return n.jsxs("article",{className:"message-row assistant",children:[i.content?n.jsx("div",{className:"assistant-message",children:n.jsx(I,{activeWorkspaceAppId:t,connection:l,content:i.content,onOpenBrowserLink:c,onOpenFileInSidebar:o,workspaceRootPath:x})}):null,i.sources?.length?n.jsx(en,{sources:i.sources,onOpenBrowserLink:c}):null,i.actionRun&&q(i.actionRun)?n.jsxs("div",{className:`assistant-message action-run-profile-message ${i.actionRun.status}`,children:[n.jsx(I,{activeWorkspaceAppId:t,connection:l,content:i.actionRun.responseText??gt(i.actionRun),onOpenBrowserLink:c,onOpenFileInSidebar:o,workspaceRootPath:x}),m?n.jsx("div",{className:"action-run-agent-label",children:d?n.jsx("button",{type:"button",className:"action-run-agent-link",onClick:d,children:m}):n.jsx("span",{children:m})}):null]}):i.actionRun?n.jsx(mt,{actionRun:i.actionRun,onOpenBrowserLink:c,onOpenFileInSidebar:o,workspaceRootPath:x}):null,i.changeSummary&&n.jsx(Ot,{summary:i.changeSummary,onOpenFileInSidebar:o}),i.createImproveRun?n.jsx(Wt,{run:i.createImproveRun}):null,h&&n.jsxs("div",{className:"assistant-message-footer",children:[v&&n.jsx("time",{className:"message-timestamp",dateTime:i.timestamp,title:_,children:v}),n.jsx("button",{type:"button",className:"message-copy-button",title:"Copy message","aria-label":"Copy assistant message",disabled:!i.content,onClick:()=>{i.content&&Ne(i.content)},children:n.jsx(we,{size:14})})]})]})},Xt),W=10;function Qt({content:e}){const t=u.useMemo(()=>e.split(/\r?\n/),[e]),[s,a]=u.useState(!1),r=t.length>W,l=r&&!s?t.slice(0,W).join(`
10
+ `):e;return n.jsxs("div",{className:`user-message-content-wrap ${r?"collapsible":""}`,children:[n.jsx("div",{className:"user-message-content",children:l}),r?n.jsxs("button",{type:"button",className:"user-message-show-more","aria-expanded":s,onClick:()=>a(i=>!i),children:[s?n.jsx(T,{size:14}):n.jsx(N,{size:14}),n.jsx("span",{children:s?"Show less":"Show more"})]}):null]})}function Xt(e,t){return e.activeWorkspaceAppId===t.activeWorkspaceAppId&&e.accountBaseUrl===t.accountBaseUrl&&e.billingOrganizationSlug===t.billingOrganizationSlug&&e.billingTeamId===t.billingTeamId&&e.connection===t.connection&&e.onOpenBrowserLink===t.onOpenBrowserLink&&e.onOpenFileInSidebar===t.onOpenFileInSidebar&&e.onOpenProfileSettings===t.onOpenProfileSettings&&e.onOpenSession===t.onOpenSession&&e.showFooter===t.showFooter&&e.workspaceRootPath===t.workspaceRootPath&&Jt(e.message,t.message)}function Jt(e,t){return e===t?!0:e.id===t.id&&e.role===t.role&&e.content===t.content&&e.timestamp===t.timestamp&&e.turnId===t.turnId&&e.statusKind===t.statusKind&&e.statusState===t.statusState&&e.statusTone===t.statusTone&&e.errorKind===t.errorKind&&rn(e.attachments,t.attachments)&&e.activities===t.activities&&e.sources===t.sources&&e.actionRun===t.actionRun&&e.insightsRunPrompt===t.insightsRunPrompt&&e.changeSummary===t.changeSummary&&e.createImproveRun===t.createImproveRun}function en({sources:e,onOpenBrowserLink:t}){return n.jsxs("div",{className:"assistant-sources","aria-label":"Sources",children:[n.jsxs("span",{className:"assistant-sources-label",children:[n.jsx(z,{size:13}),n.jsx("span",{children:"Sources"})]}),e.map(s=>n.jsx(tn,{source:s,onOpenBrowserLink:t},`${s.id}:${s.url}`))]})}function tn({source:e,onOpenBrowserLink:t}){const s=sn(e),a=[e.title,ae(e.url)].filter(Boolean).join(" - "),r=n.jsxs(n.Fragment,{children:[n.jsx(nn,{source:e}),n.jsx("span",{children:s})]});return t?n.jsx("button",{type:"button",className:"assistant-source-pill",title:a||s,"aria-label":`Open source ${s}`,onClick:()=>t(e.url,{newTab:!0}),children:r}):n.jsx("a",{className:"assistant-source-pill",href:e.url,target:"_blank",rel:"noreferrer",title:a||s,"aria-label":`Open source ${s}`,children:r})}function nn({source:e}){const[t,s]=u.useState(!1);return!e.faviconUrl||t?n.jsx(z,{className:"assistant-source-fallback-icon",size:13}):n.jsx("img",{alt:"","aria-hidden":"true",className:"assistant-source-favicon",decoding:"async",loading:"lazy",src:e.faviconUrl,onError:()=>s(!0)})}function sn(e){return e.sourceName?.trim()||ae(e.url)||e.title}function ae(e){try{return new URL(e).hostname.replace(/^www\./i,"")}catch{return null}}function an({accountBaseUrl:e,billingOrganizationSlug:t,billingTeamId:s,onOpenBrowserLink:a}){const r=$e({accountBaseUrl:e,organizationSlug:t,teamId:s}),l=n.jsxs(n.Fragment,{children:[n.jsx(P,{size:15}),n.jsx("span",{children:"Add credits"}),n.jsx(Se,{size:13})]});return n.jsxs("div",{className:"assistant-message quota-error-card",role:"alert",children:[n.jsx("div",{className:"quota-error-card-icon",children:n.jsx(P,{size:17})}),n.jsxs("div",{className:"quota-error-card-body",children:[n.jsx("strong",{children:"OpenPond Chat allowance reached"}),n.jsx("p",{children:"You have reached your OpChat token allowance for this period. Add credits or wait for the allowance to reset."}),a?n.jsx("button",{type:"button",className:"quota-error-card-action",onClick:()=>a(r,{newTab:!0}),children:l}):n.jsx("a",{className:"quota-error-card-action",href:r,target:"_blank",rel:"noreferrer",children:l})]})]})}function rn(e,t){if(e===t)return!0;if(!e||!t||e.length!==t.length)return!1;for(let s=0;s<e.length;s+=1){const a=e[s],r=t[s];if(a.id!==r.id||a.kind!==r.kind||a.name!==r.name||a.mediaType!==r.mediaType||a.sizeBytes!==r.sizeBytes||a.imagePreview?.sessionId!==r.imagePreview?.sessionId||a.imagePreview?.turnId!==r.imagePreview?.turnId||a.imagePreview?.attachmentId!==r.imagePreview?.attachmentId||a.imagePreview?.storageName!==r.imagePreview?.storageName||a.imagePreview?.contentType!==r.imagePreview?.contentType)return!1}return!0}function ln({attachments:e,connection:t}){return n.jsx("div",{className:"user-message-attachments","aria-label":"Attached files",children:e.map(s=>n.jsx(cn,{attachment:s,connection:t},s.id))})}function cn({attachment:e,connection:t}){if(e.kind==="image"&&e.imagePreview)return n.jsx(on,{attachment:e,connection:t});const s=e.kind==="image"?M:b;return n.jsxs("span",{className:"user-message-attachment",title:e.name,children:[n.jsx(s,{size:13}),n.jsx("span",{children:e.name}),n.jsx("small",{children:ie(e.sizeBytes)})]})}function on({attachment:e,connection:t}){const s=ut(t,e.imagePreview);return n.jsxs("figure",{className:`user-message-image-attachment ${s?"ready":"loading"}`,title:e.name,children:[n.jsx("div",{className:"user-message-image-frame",children:s?n.jsx("img",{alt:e.name,decoding:"async",loading:"lazy",src:s}):n.jsx(M,{size:24})}),n.jsxs("figcaption",{children:[n.jsx("span",{children:e.name}),n.jsx("small",{children:ie(e.sizeBytes)})]})]})}function ie(e){if(e<1024)return`${e} B`;const t=["KB","MB","GB"];let s=e/1024;for(const a of t){if(s<1024)return`${s.toFixed(s>=10?0:1)} ${a}`;s/=1024}return`${s.toFixed(0)} TB`}const vn=u.memo(function(){return n.jsx("article",{className:"activity-group thinking-row","aria-live":"polite",children:n.jsx("div",{className:"activity-summary thinking-summary",role:"status",children:n.jsx("span",{children:"Thinking..."})})})});function dn({activeWorkspaceAppId:e,connection:t,message:s,onOpenBrowserLink:a,onOpenFileInSidebar:r,workspaceRootPath:l}){const i=s.content?.trim()??"",[c,o]=u.useState(!1);return i?n.jsx("article",{className:"message-row assistant reasoning-row",children:n.jsxs("div",{className:`assistant-reasoning-message ${c?"expanded":"collapsed"}`,children:[n.jsxs("button",{type:"button",className:"assistant-reasoning-toggle","aria-expanded":c,onClick:()=>o(d=>!d),children:[c?n.jsx(T,{size:14}):n.jsx(N,{size:14}),n.jsx("span",{children:c?"Hide thinking":"Show thinking"})]}),c?n.jsx("div",{className:"assistant-reasoning-content",children:n.jsx(I,{activeWorkspaceAppId:e,connection:t,content:i,onOpenBrowserLink:a,onOpenFileInSidebar:r,workspaceRootPath:l})}):null]})}):null}function un({message:e}){const t=e.statusTone??"info",s=e.statusState??"idle";return n.jsx("article",{className:`status-divider ${t} ${s}`,"aria-live":t==="danger"?"assertive":"polite",children:n.jsx("span",{children:e.content??""})})}export{bn as M,vn as T};
@@ -1 +1 @@
1
- import{j as e,W as o,as as c,at as n,X as d}from"./index-B5AN29EO.js";function x({expanded:s,skill:a,onClose:i,onResizeStart:r,onToggleExpanded:l}){const t=a.path.split("/").at(-1)??a.path;return e.jsxs("aside",{className:`workspace-diff-panel native-skill-sidebar ${s?"expanded":""}`,"aria-label":`Native skill source: ${a.name}`,children:[s?null:e.jsx("div",{className:"workspace-diff-resize-handle",role:"separator","aria-orientation":"vertical","aria-label":"Resize native skill source",onPointerDown:r}),e.jsxs("div",{className:"workspace-diff-topbar native-skill-sidebar-topbar",children:[e.jsx("div",{className:"workspace-diff-tabs",role:"tablist","aria-label":"Native skill files",children:e.jsxs("button",{className:"workspace-diff-tab active",type:"button",role:"tab","aria-selected":!0,children:[e.jsx(o,{size:14}),e.jsx("span",{children:t})]})}),e.jsxs("div",{className:"workspace-diff-toolbar-actions",children:[e.jsx("button",{className:"diff-icon-button",type:"button",title:s?"Dock sidebar":"Expand sidebar","aria-label":s?"Dock sidebar":"Expand sidebar",onClick:l,children:s?e.jsx(c,{size:14}):e.jsx(n,{size:14})}),e.jsx("button",{className:"diff-icon-button",type:"button",title:"Close skill source","aria-label":"Close skill source",onClick:i,children:e.jsx(d,{size:14})})]})]}),e.jsxs("div",{className:"native-skill-sidebar-body",children:[e.jsxs("header",{className:"native-skill-source-header",children:[e.jsx("h2",{children:a.name}),e.jsx("p",{children:a.description}),e.jsx("code",{children:a.path})]}),e.jsx("pre",{className:"native-skill-markdown-source","aria-label":`${a.name} Markdown source`,children:e.jsx("code",{children:a.body})})]})]})}export{x as NativeSkillSidebar};
1
+ import{j as e,Z as o,au as c,av as n,X as d}from"./index-Cr_RZ7GD.js";function x({expanded:s,skill:a,onClose:i,onResizeStart:r,onToggleExpanded:l}){const t=a.path.split("/").at(-1)??a.path;return e.jsxs("aside",{className:`workspace-diff-panel native-skill-sidebar ${s?"expanded":""}`,"aria-label":`Native skill source: ${a.name}`,children:[s?null:e.jsx("div",{className:"workspace-diff-resize-handle",role:"separator","aria-orientation":"vertical","aria-label":"Resize native skill source",onPointerDown:r}),e.jsxs("div",{className:"workspace-diff-topbar native-skill-sidebar-topbar",children:[e.jsx("div",{className:"workspace-diff-tabs",role:"tablist","aria-label":"Native skill files",children:e.jsxs("button",{className:"workspace-diff-tab active",type:"button",role:"tab","aria-selected":!0,children:[e.jsx(o,{size:14}),e.jsx("span",{children:t})]})}),e.jsxs("div",{className:"workspace-diff-toolbar-actions",children:[e.jsx("button",{className:"diff-icon-button",type:"button",title:s?"Dock sidebar":"Expand sidebar","aria-label":s?"Dock sidebar":"Expand sidebar",onClick:l,children:s?e.jsx(c,{size:14}):e.jsx(n,{size:14})}),e.jsx("button",{className:"diff-icon-button",type:"button",title:"Close skill source","aria-label":"Close skill source",onClick:i,children:e.jsx(d,{size:14})})]})]}),e.jsxs("div",{className:"native-skill-sidebar-body",children:[e.jsxs("header",{className:"native-skill-source-header",children:[e.jsx("h2",{children:a.name}),e.jsx("p",{children:a.description}),e.jsx("code",{children:a.path})]}),e.jsx("pre",{className:"native-skill-markdown-source","aria-label":`${a.name} Markdown source`,children:e.jsx("code",{children:a.body})})]})]})}export{x as NativeSkillSidebar};
@@ -1 +1 @@
1
- import{j as e,X as N,C as b,t as P,a3 as f}from"./index-B5AN29EO.js";function w({open:d,mode:i="local",name:s,path:r,directory:n,busy:l,onNameChange:c,onPathChange:j,onClose:p,onSubmit:g}){if(!d)return null;const o=i==="cloud",t=i==="existing-local",u=o?b:t?P:f,x=o?"New Cloud Project":t?"Use Existing Folder":"New Local Project",h=o?"Create a hosted project in OpenPond Cloud.":t?"Add an existing local project folder to Projects.":"Create a new local Git project and add it to Projects.",m=l||(t?!r.trim():!s.trim()),C=l?t?"Adding":"Creating":o?"Create Cloud Project":t?"Add project":"Create project";return e.jsx("div",{className:"git-dialog-backdrop",role:"presentation",children:e.jsxs("form",{className:"git-dialog new-project-dialog","aria-label":t?"Add existing project":"Create project",onSubmit:a=>{a.preventDefault(),g()},children:[e.jsx("button",{className:"git-dialog-close",disabled:l,type:"button",onClick:p,children:e.jsx(N,{size:14})}),e.jsx("div",{className:"git-dialog-icon",children:e.jsx(u,{size:18})}),e.jsx("h2",{children:x}),e.jsx("p",{children:h}),t?e.jsxs("label",{className:"git-dialog-field",children:[e.jsx("span",{children:"Folder path"}),e.jsx("input",{autoFocus:!0,disabled:l,placeholder:"/home/user/project",value:r,onChange:a=>j(a.target.value)})]}):e.jsxs(e.Fragment,{children:[e.jsxs("label",{className:"git-dialog-field",children:[e.jsx("span",{children:"Project name"}),e.jsx("input",{autoFocus:!0,disabled:l,placeholder:"New project",value:s,onChange:a=>c(a.target.value)})]}),e.jsxs("div",{className:"git-dialog-row",children:[e.jsx("span",{children:"Location"}),e.jsx("strong",{className:"git-dialog-path",children:o?"OpenPond Cloud":n})]})]}),e.jsx("button",{className:"git-dialog-primary full",disabled:m,type:"submit",children:C})]})})}export{w as NewProjectDialog};
1
+ import{j as e,X as N,C as b,t as P,a5 as f}from"./index-Cr_RZ7GD.js";function w({open:d,mode:i="local",name:s,path:r,directory:n,busy:l,onNameChange:c,onPathChange:j,onClose:p,onSubmit:g}){if(!d)return null;const o=i==="cloud",t=i==="existing-local",u=o?b:t?P:f,x=o?"New Cloud Project":t?"Use Existing Folder":"New Local Project",h=o?"Create a hosted project in OpenPond Cloud.":t?"Add an existing local project folder to Projects.":"Create a new local Git project and add it to Projects.",m=l||(t?!r.trim():!s.trim()),C=l?t?"Adding":"Creating":o?"Create Cloud Project":t?"Add project":"Create project";return e.jsx("div",{className:"git-dialog-backdrop",role:"presentation",children:e.jsxs("form",{className:"git-dialog new-project-dialog","aria-label":t?"Add existing project":"Create project",onSubmit:a=>{a.preventDefault(),g()},children:[e.jsx("button",{className:"git-dialog-close",disabled:l,type:"button",onClick:p,children:e.jsx(N,{size:14})}),e.jsx("div",{className:"git-dialog-icon",children:e.jsx(u,{size:18})}),e.jsx("h2",{children:x}),e.jsx("p",{children:h}),t?e.jsxs("label",{className:"git-dialog-field",children:[e.jsx("span",{children:"Folder path"}),e.jsx("input",{autoFocus:!0,disabled:l,placeholder:"/home/user/project",value:r,onChange:a=>j(a.target.value)})]}):e.jsxs(e.Fragment,{children:[e.jsxs("label",{className:"git-dialog-field",children:[e.jsx("span",{children:"Project name"}),e.jsx("input",{autoFocus:!0,disabled:l,placeholder:"New project",value:s,onChange:a=>c(a.target.value)})]}),e.jsxs("div",{className:"git-dialog-row",children:[e.jsx("span",{children:"Location"}),e.jsx("strong",{className:"git-dialog-path",children:o?"OpenPond Cloud":n})]})]}),e.jsx("button",{className:"git-dialog-primary full",disabled:m,type:"submit",children:C})]})})}export{w as NewProjectDialog};
@@ -1,2 +1,2 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./MarkdownText-E35C404I.js","./index-B5AN29EO.js","./index-COGlKIJ4.css"])))=>i.map(i=>d[i]);
2
- import{j as e,W as m,b0 as h,b1 as k,b9 as w,ba as T,a$ as y,r as u,a4 as P,ad as C,Y as $}from"./index-B5AN29EO.js";import{C as S}from"./copy-DuHI1UZ_.js";import{P as v}from"./play-BIHyH-Yu.js";import{R as E}from"./rotate-cw-D7q9GgNc.js";import{P as _}from"./PostTrainingStatusPill-B9Eoc4s0.js";const L=u.lazy(()=>C(()=>import("./MarkdownText-E35C404I.js").then(a=>a.b),__vite__mapDeps([0,1,2]),import.meta.url).then(a=>({default:a.MarkdownText}))),j=new Map;function R(a){const i=j.get(a);if(i)return i;const o=fetch(a).then(r=>{if(!r.ok)throw new Error(`Could not open script (${r.status})`);return r.text()}).catch(r=>{throw j.delete(a),r});return j.set(a,o),o}function U({activeLessonIndex:a,autoplay:i,fullCourseSelected:o,onResizeStart:r,onOpenScript:p,onSelectLesson:g,onSelectFullCourse:t,onSetAutoplay:x,onShowLessons:b,panelView:s,scriptLessonIndex:n}){const c=n===null?null:h[n]??null;function l(d){if(!c||!["ArrowLeft","ArrowRight","Home","End"].includes(d.key))return;d.preventDefault();const f=d.key==="ArrowLeft"||d.key==="Home"?"lessons":"script";f==="lessons"?b():p(n),document.getElementById(`post-training-${f}-tab`)?.focus()}return e.jsxs("aside",{"aria-label":"Post-training learning panel",className:`workspace-diff-panel get-started-learning-panel show-${s}`,children:[e.jsx("div",{"aria-label":"Resize learning panel","aria-orientation":"vertical",className:"workspace-diff-resize-handle",onPointerDown:r,role:"separator"}),e.jsx("div",{className:"workspace-diff-topbar get-started-learning-panel-tabs",children:e.jsxs("div",{"aria-label":"Learning panel views",className:"workspace-diff-tabs",role:"tablist",children:[e.jsxs("button",{"aria-controls":"post-training-lessons-panel","aria-selected":s==="lessons",className:`workspace-diff-tab ${s==="lessons"?"active":""}`,id:"post-training-lessons-tab",onClick:b,onKeyDown:l,role:"tab",tabIndex:s==="lessons"?0:-1,type:"button",children:[e.jsx(v,{size:14}),e.jsx("span",{children:"Lessons"})]}),c?e.jsxs("button",{"aria-controls":"post-training-script-panel","aria-selected":s==="script",className:`workspace-diff-tab ${s==="script"?"active":""}`,id:"post-training-script-tab",onClick:()=>p(n),onKeyDown:l,role:"tab",tabIndex:s==="script"?0:-1,type:"button",children:[e.jsx(m,{size:14}),e.jsx("span",{children:c.script?.fileName})]}):null]})}),s==="lessons"?e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"get-started-learning-panel-toolbar",children:[e.jsxs("span",{children:[e.jsxs("span",{className:"get-started-learning-toolbar-title",children:[e.jsx("strong",{children:k}),e.jsx(_,{})]}),e.jsxs("small",{children:[h.length," lessons"]})]}),e.jsxs("button",{"aria-checked":i,"aria-label":"Autoplay lessons",className:`get-started-learning-autoplay ${i?"active":""}`,onClick:()=>x(!i),role:"switch",type:"button",children:[e.jsx("span",{children:"Autoplay"}),e.jsx("i",{"aria-hidden":"true"})]})]}),e.jsx("div",{"aria-labelledby":"post-training-lessons-tab",className:"get-started-learning-panel-body lessons",id:"post-training-lessons-panel",role:"tabpanel",children:e.jsx(z,{activeLessonIndex:a,fullCourseSelected:o,onOpenScript:p,onSelectFullCourse:t,onSelectLesson:g})})]}):c?e.jsx(A,{lessonIndex:n},c.script?.url):null]})}function z({activeLessonIndex:a,fullCourseSelected:i,onOpenScript:o,onSelectFullCourse:r,onSelectLesson:p}){const g=w();return e.jsxs(e.Fragment,{children:[e.jsx("ol",{children:h.map((t,x)=>{const b=x===a,s=g[t.id],n=T(s),c=s?.completed?"Complete":`${n}% watched`;return e.jsx("li",{children:e.jsxs("div",{className:"get-started-learning-lesson-card",children:[e.jsxs("button",{className:"get-started-learning-lesson-button","aria-current":b&&!i?"true":void 0,"aria-label":`Play lesson ${t.lessonNumber}: ${t.title}`,onClick:()=>p(x),type:"button",children:[e.jsx("img",{alt:"",decoding:"async",loading:"lazy",src:t.posterUrl}),e.jsxs("span",{children:[e.jsxs("small",{children:[t.lessonNumber," · ",t.duration,n>0?` · ${c}`:""]}),e.jsx("strong",{children:t.title})]})]}),t.script?e.jsx("button",{"aria-label":`Open ${t.script.fileName} for ${t.title}`,className:"get-started-learning-script-button app-tooltip app-tooltip-right","data-tooltip":`Open ${t.script.fileName}`,onClick:()=>o(x),type:"button",children:e.jsx(m,{size:16})}):null,e.jsx("div",{"aria-label":`${t.title}: ${c}`,"aria-valuemax":100,"aria-valuemin":0,"aria-valuenow":n,className:`get-started-learning-progress ${s?.completed?"complete":""}`,role:"progressbar",children:e.jsx("i",{"aria-hidden":"true",style:{width:`${n}%`}})})]})},t.id)})}),e.jsx("footer",{className:"get-started-learning-full-video",children:e.jsxs("button",{"aria-current":i?"true":void 0,"aria-label":`Play full video: ${y.title}`,onClick:r,type:"button",children:[e.jsx("span",{className:"get-started-learning-full-video-icon","aria-hidden":"true",children:e.jsx(v,{fill:"currentColor",size:13})}),e.jsxs("span",{children:[e.jsx("strong",{children:"Full video"}),e.jsxs("small",{children:[y.duration," · All 10 lessons"]})]})]})})]})}function A({lessonIndex:a}){const i=h[a]??h[0],o=i.script?.url??"",[r,p]=u.useState(null),[g,t]=u.useState(null),[x,b]=u.useState(0),[s,n]=u.useState(!1);u.useEffect(()=>{let l=!0;return p(null),t(null),o?(R(o).then(d=>{l&&p(d)},d=>{l&&t(d instanceof Error?d.message:"Could not open script")}),()=>{l=!1}):(t("This lesson does not have a script."),()=>{l=!1})},[x,o]),u.useEffect(()=>{if(!s)return;const l=window.setTimeout(()=>n(!1),1600);return()=>window.clearTimeout(l)},[s]);async function c(){!r||!await P(r)||n(!0)}return e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"get-started-learning-panel-toolbar file",children:[e.jsxs("span",{children:[e.jsx("small",{children:i.slug}),e.jsx("strong",{children:i.script?.fileName})]}),e.jsx("button",{"aria-label":s?"Script copied":"Copy script for an LLM",className:"diff-icon-button",disabled:!r,onClick:()=>{c()},title:s?"Copied":"Copy script for an LLM",type:"button",children:e.jsx(S,{size:14})})]}),e.jsx("div",{"aria-busy":!r&&!g,className:"get-started-learning-panel-body script","data-script-url":o,id:"post-training-script-panel","aria-labelledby":"post-training-script-tab",role:"tabpanel",children:g?e.jsxs("div",{className:"get-started-script-status error",children:[e.jsx(m,{size:18}),e.jsx("span",{children:g}),e.jsxs("button",{onClick:()=>b(l=>l+1),type:"button",children:[e.jsx(E,{size:14}),"Try again"]})]}):r?e.jsx("div",{className:"workspace-markdown-preview",children:e.jsx(u.Suspense,{fallback:e.jsx(N,{}),children:e.jsx(L,{content:r})})}):e.jsx(N,{})})]})}function N(){return e.jsxs("div",{className:"get-started-script-status",children:[e.jsx($,{size:18}),e.jsx("span",{children:"Opening Markdown script…"})]})}export{U as PostTrainingLearningPanel};
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./MarkdownText-CkVkr3P1.js","./index-Cr_RZ7GD.js","./index-9tbdqUau.css"])))=>i.map(i=>d[i]);
2
+ import{j as e,Z as j,b6 as h,b7 as k,bf as w,bg as T,b5 as y,r as u,a6 as P,af as C,_ as S}from"./index-Cr_RZ7GD.js";import{C as $}from"./copy-BsYs6wBI.js";import{P as v}from"./play-BLRANWaV.js";import{R as E}from"./rotate-cw-CTfjlR4G.js";import{P as _}from"./PostTrainingStatusPill-BGZ9h5eW.js";const L=u.lazy(()=>C(()=>import("./MarkdownText-CkVkr3P1.js").then(a=>a.b),__vite__mapDeps([0,1,2]),import.meta.url).then(a=>({default:a.MarkdownText}))),f=new Map;function R(a){const i=f.get(a);if(i)return i;const o=fetch(a).then(r=>{if(!r.ok)throw new Error(`Could not open script (${r.status})`);return r.text()}).catch(r=>{throw f.delete(a),r});return f.set(a,o),o}function U({activeLessonIndex:a,autoplay:i,fullCourseSelected:o,onResizeStart:r,onOpenScript:p,onSelectLesson:g,onSelectFullCourse:t,onSetAutoplay:x,onShowLessons:b,panelView:s,scriptLessonIndex:n}){const c=n===null?null:h[n]??null;function l(d){if(!c||!["ArrowLeft","ArrowRight","Home","End"].includes(d.key))return;d.preventDefault();const m=d.key==="ArrowLeft"||d.key==="Home"?"lessons":"script";m==="lessons"?b():p(n),document.getElementById(`post-training-${m}-tab`)?.focus()}return e.jsxs("aside",{"aria-label":"Post-training learning panel",className:`workspace-diff-panel get-started-learning-panel show-${s}`,children:[e.jsx("div",{"aria-label":"Resize learning panel","aria-orientation":"vertical",className:"workspace-diff-resize-handle",onPointerDown:r,role:"separator"}),e.jsx("div",{className:"workspace-diff-topbar get-started-learning-panel-tabs",children:e.jsxs("div",{"aria-label":"Learning panel views",className:"workspace-diff-tabs",role:"tablist",children:[e.jsxs("button",{"aria-controls":"post-training-lessons-panel","aria-selected":s==="lessons",className:`workspace-diff-tab ${s==="lessons"?"active":""}`,id:"post-training-lessons-tab",onClick:b,onKeyDown:l,role:"tab",tabIndex:s==="lessons"?0:-1,type:"button",children:[e.jsx(v,{size:14}),e.jsx("span",{children:"Lessons"})]}),c?e.jsxs("button",{"aria-controls":"post-training-script-panel","aria-selected":s==="script",className:`workspace-diff-tab ${s==="script"?"active":""}`,id:"post-training-script-tab",onClick:()=>p(n),onKeyDown:l,role:"tab",tabIndex:s==="script"?0:-1,type:"button",children:[e.jsx(j,{size:14}),e.jsx("span",{children:c.script?.fileName})]}):null]})}),s==="lessons"?e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"get-started-learning-panel-toolbar",children:[e.jsxs("span",{children:[e.jsxs("span",{className:"get-started-learning-toolbar-title",children:[e.jsx("strong",{children:k}),e.jsx(_,{})]}),e.jsxs("small",{children:[h.length," lessons"]})]}),e.jsxs("button",{"aria-checked":i,"aria-label":"Autoplay lessons",className:`get-started-learning-autoplay ${i?"active":""}`,onClick:()=>x(!i),role:"switch",type:"button",children:[e.jsx("span",{children:"Autoplay"}),e.jsx("i",{"aria-hidden":"true"})]})]}),e.jsx("div",{"aria-labelledby":"post-training-lessons-tab",className:"get-started-learning-panel-body lessons",id:"post-training-lessons-panel",role:"tabpanel",children:e.jsx(z,{activeLessonIndex:a,fullCourseSelected:o,onOpenScript:p,onSelectFullCourse:t,onSelectLesson:g})})]}):c?e.jsx(A,{lessonIndex:n},c.script?.url):null]})}function z({activeLessonIndex:a,fullCourseSelected:i,onOpenScript:o,onSelectFullCourse:r,onSelectLesson:p}){const g=w();return e.jsxs(e.Fragment,{children:[e.jsx("ol",{children:h.map((t,x)=>{const b=x===a,s=g[t.id],n=T(s),c=s?.completed?"Complete":`${n}% watched`;return e.jsx("li",{children:e.jsxs("div",{className:"get-started-learning-lesson-card",children:[e.jsxs("button",{className:"get-started-learning-lesson-button","aria-current":b&&!i?"true":void 0,"aria-label":`Play lesson ${t.lessonNumber}: ${t.title}`,onClick:()=>p(x),type:"button",children:[e.jsx("img",{alt:"",decoding:"async",loading:"lazy",src:t.posterUrl}),e.jsxs("span",{children:[e.jsxs("small",{children:[t.lessonNumber," · ",t.duration,n>0?` · ${c}`:""]}),e.jsx("strong",{children:t.title})]})]}),t.script?e.jsx("button",{"aria-label":`Open ${t.script.fileName} for ${t.title}`,className:"get-started-learning-script-button app-tooltip app-tooltip-right","data-tooltip":`Open ${t.script.fileName}`,onClick:()=>o(x),type:"button",children:e.jsx(j,{size:16})}):null,e.jsx("div",{"aria-label":`${t.title}: ${c}`,"aria-valuemax":100,"aria-valuemin":0,"aria-valuenow":n,className:`get-started-learning-progress ${s?.completed?"complete":""}`,role:"progressbar",children:e.jsx("i",{"aria-hidden":"true",style:{width:`${n}%`}})})]})},t.id)})}),e.jsx("footer",{className:"get-started-learning-full-video",children:e.jsxs("button",{"aria-current":i?"true":void 0,"aria-label":`Play full video: ${y.title}`,onClick:r,type:"button",children:[e.jsx("span",{className:"get-started-learning-full-video-icon","aria-hidden":"true",children:e.jsx(v,{fill:"currentColor",size:13})}),e.jsxs("span",{children:[e.jsx("strong",{children:"Full video"}),e.jsxs("small",{children:[y.duration," · All 10 lessons"]})]})]})})]})}function A({lessonIndex:a}){const i=h[a]??h[0],o=i.script?.url??"",[r,p]=u.useState(null),[g,t]=u.useState(null),[x,b]=u.useState(0),[s,n]=u.useState(!1);u.useEffect(()=>{let l=!0;return p(null),t(null),o?(R(o).then(d=>{l&&p(d)},d=>{l&&t(d instanceof Error?d.message:"Could not open script")}),()=>{l=!1}):(t("This lesson does not have a script."),()=>{l=!1})},[x,o]),u.useEffect(()=>{if(!s)return;const l=window.setTimeout(()=>n(!1),1600);return()=>window.clearTimeout(l)},[s]);async function c(){!r||!await P(r)||n(!0)}return e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"get-started-learning-panel-toolbar file",children:[e.jsxs("span",{children:[e.jsx("small",{children:i.slug}),e.jsx("strong",{children:i.script?.fileName})]}),e.jsx("button",{"aria-label":s?"Script copied":"Copy script for an LLM",className:"diff-icon-button",disabled:!r,onClick:()=>{c()},title:s?"Copied":"Copy script for an LLM",type:"button",children:e.jsx($,{size:14})})]}),e.jsx("div",{"aria-busy":!r&&!g,className:"get-started-learning-panel-body script","data-script-url":o,id:"post-training-script-panel","aria-labelledby":"post-training-script-tab",role:"tabpanel",children:g?e.jsxs("div",{className:"get-started-script-status error",children:[e.jsx(j,{size:18}),e.jsx("span",{children:g}),e.jsxs("button",{onClick:()=>b(l=>l+1),type:"button",children:[e.jsx(E,{size:14}),"Try again"]})]}):r?e.jsx("div",{className:"workspace-markdown-preview",children:e.jsx(u.Suspense,{fallback:e.jsx(N,{}),children:e.jsx(L,{content:r})})}):e.jsx(N,{})})]})}function N(){return e.jsxs("div",{className:"get-started-script-status",children:[e.jsx(S,{size:18}),e.jsx("span",{children:"Opening Markdown script…"})]})}export{U as PostTrainingLearningPanel};
@@ -1 +1 @@
1
- import{j as s,bb as o}from"./index-B5AN29EO.js";const a="Subject to change, lesson work in progress";function r(){const t=o==="draft"?"Draft":"Published";return s.jsx("span",{"aria-label":`${t}: ${a}`,className:"get-started-playlist-status app-tooltip","data-tooltip":a,tabIndex:0,children:t})}export{r as P};
1
+ import{j as s,bh as o}from"./index-Cr_RZ7GD.js";const a="Subject to change, lesson work in progress";function r(){const t=o==="draft"?"Draft":"Published";return s.jsx("span",{"aria-label":`${t}: ${a}`,className:"get-started-playlist-status app-tooltip","data-tooltip":a,tabIndex:0,children:t})}export{r as P};
@@ -1 +1 @@
1
- import{d as T,r as x,n as m,u as G,j as e,V as z,w as U,k as H,ae as C,ak as E,X as $,W as q}from"./index-B5AN29EO.js";import{G as w}from"./git-commit-horizontal-FYILXW0v.js";import{P as B}from"./play-BIHyH-Yu.js";import{R as W}from"./refresh-cw-Daz0oqwK.js";/* empty css */const _=[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}]],V=T("rotate-ccw",_),Q=5e3;function X(s){const[a,t]=x.useState([]),[l,n]=x.useState(!1),[o,c]=x.useState(null),[d,p]=x.useState(()=>new Set);x.useEffect(()=>{if(!s){t([]),c(null),n(!1);return}let i=!1,r=null;async function f(b){if(!(!s||i)){b&&n(!0);try{const y=await m.localAgentSchedules(s);if(i)return;t(y.schedules),c(null)}catch(y){i||c(S(y))}finally{!i&&b&&n(!1)}}}return f(!0),r=window.setInterval(()=>{f(!1)},Q),()=>{i=!0,r!==null&&window.clearInterval(r)}},[s]);async function j(){if(s){n(!0);try{const i=await m.syncLocalAgentSchedules(s);t(i.schedules),c(null)}catch(i){c(S(i))}finally{n(!1)}}}async function g(i){if(!(!s||d.has(i.id))){h(i.id,!0);try{await m.runLocalAgentSchedule(s,i.id);const r=await m.localAgentSchedules(s);t(r.schedules),c(null)}catch(r){c(S(r))}finally{h(i.id,!1)}}}async function u(i){if(!(!s||d.has(i.id))){h(i.id,!0);try{await m.patchLocalAgentSchedule(s,i.id,{enabled:!i.enabled});const r=await m.localAgentSchedules(s);t(r.schedules),c(null)}catch(r){c(S(r))}finally{h(i.id,!1)}}}function h(i,r){p(f=>{const b=new Set(f);return r?b.add(i):b.delete(i),b})}return{error:o,loading:l,pendingScheduleIds:d,refresh:j,run:g,schedules:a,toggle:u}}function S(s){return s instanceof Error?s.message:String(s)}function J({connection:s,profile:a,selectedDefaultTeamId:t}){const l=X(s);return G(l.error,{prefix:"Local schedules"}),e.jsxs("div",{className:"account-list profile-agent-list","aria-label":"Profile agents",children:[e.jsxs("div",{className:"account-list-heading profile-agent-list-heading",children:[e.jsx("span",{children:"Agents"}),e.jsx("div",{className:"profile-skill-heading-actions",children:e.jsx("small",{children:Z(l.schedules.length,l.loading)})})]}),a.agents.length||l.schedules.length?e.jsx("div",{className:"profile-agent-table-frame",children:e.jsxs("table",{className:"profile-agent-table","aria-label":"Profile agents table",children:[e.jsxs("colgroup",{children:[e.jsx("col",{className:"profile-agent-column"}),e.jsx("col",{className:"profile-action-column"}),e.jsx("col",{className:"profile-check-column"}),e.jsx("col",{className:"profile-sync-column"})]}),e.jsx("thead",{children:e.jsxs("tr",{children:[e.jsx("th",{scope:"col",children:"Agent"}),e.jsx("th",{scope:"col",children:"Action"}),e.jsx("th",{scope:"col",children:"Check"}),e.jsx("th",{scope:"col",children:"Sync"})]})}),e.jsxs("tbody",{children:[a.agents.map(n=>e.jsx(K,{agent:n,defaultAction:a.summary.defaultAction,profile:a,selectedDefaultTeamId:t},n.id)),l.schedules.map(n=>e.jsx(Y,{pending:l.pendingScheduleIds.has(n.id),schedule:n,refreshing:l.loading,onRefresh:()=>{l.refresh()},onRun:()=>{l.run(n)},onToggle:()=>{l.toggle(n)}},n.id))]})]})}):e.jsxs("div",{className:"empty-account-list",children:[e.jsx("strong",{children:"No profile agents found"}),e.jsx("span",{children:"Create an agent, then run Profile checks to add it to the catalog."})]})]})}function K({agent:s,defaultAction:a,profile:t,selectedDefaultTeamId:l}){const n=te(t,s,l);return e.jsxs("tr",{className:"profile-agent-row",children:[e.jsx("td",{children:e.jsxs("div",{className:"profile-agent-identity",children:[e.jsx(z,{size:18}),e.jsxs("div",{children:[e.jsx("strong",{children:s.name}),e.jsx("span",{title:s.path,children:s.path})]})]})}),e.jsx("td",{children:e.jsx("div",{className:"profile-agent-action",children:e.jsx("span",{children:a??"None"})})}),e.jsx("td",{children:e.jsx(A,{status:n.check})}),e.jsx("td",{children:e.jsx(A,{status:n.sync})})]})}function Y({pending:s,refreshing:a,schedule:t,onRefresh:l,onRun:n,onToggle:o}){const c=ee(t),d=t.enabled?"Pause schedule":"Resume schedule";return e.jsxs("tr",{className:"profile-agent-row profile-schedule-agent-row",children:[e.jsx("td",{children:e.jsxs("div",{className:"profile-agent-identity",children:[e.jsx(z,{size:18}),e.jsxs("div",{children:[e.jsx("strong",{children:t.localProjectName}),e.jsxs("span",{title:t.scheduleName,children:["schedule: ",t.scheduleName]})]})]})}),e.jsx("td",{children:e.jsx("div",{className:"profile-agent-action",children:e.jsx("span",{title:t.targetAction,children:t.targetAction})})}),e.jsx("td",{children:e.jsx(A,{status:c})}),e.jsx("td",{children:e.jsxs("div",{className:"profile-schedule-actions",children:[e.jsx("span",{className:"profile-schedule-expression",title:se(t),children:t.enabled?t.scheduleExpression:"Paused"}),e.jsxs("div",{className:"profile-schedule-controls","aria-label":`${t.scheduleName} schedule controls`,children:[e.jsx("button",{className:"settings-icon-button profile-schedule-button",disabled:a,type:"button",title:"Refresh local schedules","aria-label":"Refresh local schedules",onClick:l,children:e.jsx(W,{size:14,className:a?"settings-spin":void 0})}),e.jsx("button",{className:"settings-icon-button profile-schedule-button",disabled:s,type:"button",title:"Run now","aria-label":`Run ${t.scheduleName} now`,onClick:n,children:e.jsx(V,{size:14})}),e.jsx("button",{className:"settings-icon-button profile-schedule-button",disabled:s,type:"button",title:d,"aria-label":`${d}: ${t.scheduleName}`,onClick:o,children:t.enabled?e.jsx(U,{size:14}):e.jsx(B,{size:14})})]})]})})]})}function A({status:s}){return e.jsx("span",{className:`profile-status-text ${s.state}`,children:s.label})}function Z(s,a){return a&&s===0?"Loading schedules":a?`${s} scheduled, refreshing`:s===1?"1 scheduled":s>1?`${s} scheduled`:"No schedules"}function ee(s){return s.enabled?s.lastError||s.lastRunStatus==="failed"?{state:"warning",label:"Failed"}:s.lastRunStatus==="running"?{state:"loading",label:"Running"}:s.lastRunStatus==="queued"?{state:"loading",label:"Queued"}:s.lastRunStatus==="skipped"?{state:"warning",label:"Skipped"}:s.lastRunStatus==="succeeded"?{state:"ready",label:"Succeeded"}:{state:"loading",label:"Scheduled"}:{state:"disabled",label:"Paused"}}function se(s){const a=[`${s.scheduleType}: ${s.scheduleExpression}`];return s.nextRunAt&&a.push(`next ${R(s.nextRunAt)}`),s.lastRunAt&&a.push(`last ${R(s.lastRunAt)}`),a.join(" - ")}function R(s){const a=new Date(s);return Number.isFinite(a.getTime())?a.toLocaleString(void 0,{month:"short",day:"numeric",hour:"numeric",minute:"2-digit"}):s}function te(s,a,t){if(!a.enabled)return{check:{state:"disabled",label:"Disabled"},sync:{state:"disabled",label:"Disabled"}};if(s.error)return{check:{state:"warning",label:"Error"},sync:{state:"warning",label:"Blocked"}};if(s.setupGate.blockingCount>0)return{check:{state:"warning",label:"Setup"},sync:{state:"warning",label:"Blocked"}};if(s.git?.dirty||ne(s,a)>0)return{check:{state:"loading",label:"Pending"},sync:{state:"warning",label:"Changed"}};if(s.catalog.stale)return{check:{state:"loading",label:"Stale"},sync:{state:"loading",label:"Waiting"}};if(!s.lastCheck)return{check:{state:"loading",label:"Unchecked"},sync:{state:"loading",label:"Waiting"}};if(s.lastCheck.status==="failed")return{check:{state:"warning",label:"Failed"},sync:{state:"warning",label:"Blocked"}};if(!s.summary.checkFresh)return{check:{state:"loading",label:"Stale"},sync:{state:"loading",label:"Waiting"}};if(ae(s,t))return{check:{state:"ready",label:"Passed"},sync:{state:"warning",label:"Sync acct"}};const l=s.summary.localHead??s.git?.head??null,n=s.hosted?.lastPushedLocalHead??null;return!(s.summary.hostedHead??s.hosted?.sourceCommitSha??null)&&!n?{check:{state:"ready",label:"Passed"},sync:{state:"loading",label:"Not synced"}}:l&&n&&l!==n?{check:{state:"ready",label:"Passed"},sync:{state:"loading",label:"Needed"}}:{check:{state:"ready",label:"Passed"},sync:{state:"ready",label:"Synced"}}}function ae(s,a){const t=s.hosted?.teamId?.trim()??"";return!!(t&&a&&t!==a)}function ne(s,a){let t=0;s.diff.changedAgents.includes(a.id)&&(t+=1),s.diff.newAgents.includes(a.id)&&(t+=1),s.diff.deletedAgents.includes(a.id)&&(t+=1);const l=a.path.replace(/^profiles\/[^/]+\//,"");for(const n of s.diff.files){const o=n.path.replace(/^profiles\/[^/]+\//,"");(o===l||o.startsWith(`${l}/`)||o.startsWith(`agents/${a.id}/`))&&(t+=1)}return t}function ye({section:s="all",payload:a,connection:t,onPayload:l,onError:n,onToast:o,onSkillCommand:c,overviewContent:d}){const[p,j]=x.useState(""),[g,u]=x.useState(null),h=a?.profile??null,i=a?.preferences.defaultTeamId?.trim()||"",r=s==="all"||s==="profile"||s==="controls",f=s==="all"||s==="agents",b=s==="all"||s==="profile";async function y(P){t&&(l(await m.bootstrap(t)),o?.(P,"success"))}async function v(P,O){if(!(!t||g)){u(P),n(null);try{await O()}catch(k){n(k instanceof Error?k.message:String(k))}finally{u(null)}}}function M(){v("init",async()=>{await m.profileInit(t,{}),await y("Profile initialized")})}function F(){v("commit",async()=>{await m.profileCommit(t,{message:p.trim()||null}),j(""),await y("Profile commit complete")})}function I(){v("push",async()=>{if(!i)throw new Error("Select a default team before syncing a hosted profile.");await m.profileCheck(t,{kind:"all"}),await m.profilePush(t,{teamId:i,ensureHosted:!0,message:null}),await y("Profile synced to hosted profile repo")})}return e.jsx("section",{className:"account-settings",children:h?.mode==="local"?e.jsxs(e.Fragment,{children:[r?e.jsxs(e.Fragment,{children:[e.jsx(le,{connection:t,profile:h,profileBusy:g,profileCommitMessage:p,selectedDefaultTeamId:i,syncDisabledReason:he(h,i),setProfileCommitMessage:j,submitProfileCommit:F,submitProfilePush:I}),d]}):null,f?e.jsx(J,{connection:t,profile:h,selectedDefaultTeamId:i}):null,b?e.jsx(de,{onSkillCommand:c,profile:h}):null]}):s==="agents"?e.jsxs("div",{className:"account-list",children:[e.jsxs("div",{className:"account-list-heading",children:[e.jsx("span",{children:"Agents"}),e.jsx("small",{children:"Profile required"})]}),e.jsxs("div",{className:"empty-account-list",children:[e.jsx("strong",{children:"No local Profile loaded"}),e.jsx("span",{children:"Open the Profile tab to create or load a Profile before managing agents."})]})]}):e.jsxs("div",{className:"account-list",children:[e.jsxs("div",{className:"account-list-heading",children:[e.jsx("span",{children:"Summary"}),e.jsx("small",{children:"Not loaded"})]}),e.jsxs("div",{className:"empty-account-list",children:[e.jsx("strong",{children:"No local profile loaded"}),e.jsx("span",{children:"OpenPond uses one Git-backed Profile in the default repo."}),e.jsxs("button",{className:"settings-secondary",disabled:!t||!!g,type:"button",onClick:M,children:[e.jsx(H,{size:14}),e.jsx("span",{children:g==="init"?"Creating":"Create default Profile"})]})]})]})})}function le({connection:s,profile:a,profileBusy:t,profileCommitMessage:l,selectedDefaultTeamId:n,syncDisabledReason:o,setProfileCommitMessage:c,submitProfileCommit:d,submitProfilePush:p}){const[j,g]=x.useState(!1),[u,h]=x.useState(!1),[i,r]=x.useState(!1),f=!s||!!t;return e.jsxs("div",{className:"profile-control-panel",children:[e.jsxs("div",{className:"profile-control-toolbar",children:[e.jsxs("div",{className:"profile-control-actions",children:[e.jsxs("button",{className:"settings-secondary",disabled:f,type:"button",onClick:()=>h(!0),children:[e.jsx(w,{size:14}),e.jsx("span",{children:t==="commit"?"Committing":"Commit"})]}),e.jsxs("button",{className:"settings-secondary",disabled:f||!a,type:"button",onClick:()=>r(!0),children:[e.jsx(C,{size:14}),e.jsx("span",{children:t==="push"?"Syncing":"Sync"})]}),e.jsxs("button",{className:"settings-secondary",disabled:!!t||!a,type:"button",onClick:()=>g(!0),children:[e.jsx(E,{size:14}),e.jsx("span",{children:"Repo"})]}),a?e.jsxs("span",{className:"profile-hosted-status",title:`Profile sync status: ${L(a,n)}`,children:[e.jsx(C,{size:14}),e.jsx("span",{children:"Profile sync"}),e.jsx("strong",{children:L(a,n)})]}):null]}),a?e.jsx("span",{className:`profile-local-status ${a.summary.state}`,title:a.summary.message,children:a.summary.message}):null]}),j&&a?e.jsx(ce,{profile:a,profileBusy:t,onClose:()=>g(!1)}):null,u?e.jsx(ie,{disabled:f,profileBusy:t,profileCommitMessage:l,setProfileCommitMessage:c,submitProfileCommit:d,onClose:()=>h(!1)}):null,i&&a?e.jsx(oe,{disabled:f,profile:a,profileBusy:t,selectedDefaultTeamId:n,syncDisabledReason:o,submitProfilePush:p,onClose:()=>r(!1)}):null]})}function ie({disabled:s,profileBusy:a,profileCommitMessage:t,setProfileCommitMessage:l,submitProfileCommit:n,onClose:o}){function c(d){d.preventDefault(),!s&&(n(),o())}return e.jsx("div",{className:"git-dialog-backdrop",role:"presentation",onMouseDown:o,children:e.jsxs("form",{className:"git-dialog profile-commit-dialog",role:"dialog","aria-modal":"true","aria-labelledby":"profile-commit-dialog-title",onMouseDown:d=>d.stopPropagation(),onSubmit:c,children:[e.jsx("button",{className:"git-dialog-close",disabled:!!a,type:"button",title:"Close","aria-label":"Close",onClick:o,children:e.jsx($,{size:14})}),e.jsx("div",{className:"git-dialog-icon",children:e.jsx(w,{size:18})}),e.jsx("h2",{id:"profile-commit-dialog-title",children:"Commit profile"}),e.jsxs("label",{className:"git-dialog-field",children:[e.jsx("span",{children:"Commit message"}),e.jsx("input",{autoFocus:!0,value:t,disabled:!!a,placeholder:"Update OpenPond profile",onChange:d=>l(d.target.value)})]}),e.jsxs("div",{className:"git-dialog-footer",children:[e.jsx("button",{className:"git-dialog-secondary",disabled:!!a,type:"button",onClick:o,children:"Cancel"}),e.jsxs("button",{className:"git-dialog-primary",disabled:s,type:"submit",children:[e.jsx(w,{size:14}),e.jsx("span",{children:a==="commit"?"Committing":"Commit"})]})]})]})})}function oe({disabled:s,profile:a,profileBusy:t,selectedDefaultTeamId:l,syncDisabledReason:n,submitProfilePush:o,onClose:c}){const d=ge(a,l),p=d.reduce((u,h)=>u+h.count,0),j=!s&&!n;function g(u){u.preventDefault(),j&&(o(),c())}return e.jsx("div",{className:"git-dialog-backdrop",role:"presentation",onMouseDown:c,children:e.jsxs("form",{className:"git-dialog profile-sync-dialog",role:"dialog","aria-modal":"true","aria-labelledby":"profile-sync-dialog-title",onMouseDown:u=>u.stopPropagation(),onSubmit:g,children:[e.jsx("button",{className:"git-dialog-close",disabled:!!t,type:"button",title:"Close","aria-label":"Close",onClick:c,children:e.jsx($,{size:14})}),e.jsx("div",{className:"git-dialog-icon",children:e.jsx(C,{size:18})}),e.jsx("h2",{id:"profile-sync-dialog-title",children:"Sync profile"}),e.jsx("p",{className:"profile-sync-explainer",children:"Sync publishes this committed Profile source for your team, so its Agents can be shared in team chat and attached to hosted sandboxes."}),e.jsxs("div",{className:"profile-dialog-summary",children:[e.jsxs("strong",{children:[p," ",p===1?"item":"items"," out of sync"]}),e.jsxs("span",{children:["Local ",N(a.summary.localHead??a.git?.head)," - Last pushed"," ",N(a.hosted?.lastPushedLocalHead)]})]}),d.length?e.jsx("div",{className:"profile-dialog-diff-list","aria-label":"Profile sync differences",children:d.map(u=>e.jsxs("div",{className:`profile-dialog-diff-row ${u.tone??""}`,children:[e.jsx("strong",{children:u.label}),e.jsx("span",{children:u.detail})]},u.label))}):e.jsx("div",{className:"profile-dialog-diff-list","aria-label":"Profile sync differences",children:e.jsxs("div",{className:"profile-dialog-diff-row",children:[e.jsx("strong",{children:"Aligned"}),e.jsx("span",{children:"Current local profile source has already been pushed."})]})}),n?e.jsx("div",{className:"profile-dialog-warning",children:n}):null,e.jsxs("div",{className:"git-dialog-footer",children:[e.jsx("button",{className:"git-dialog-secondary",disabled:!!t,type:"button",onClick:c,children:"Cancel"}),e.jsxs("button",{className:"git-dialog-primary",disabled:!j,type:"submit",children:[e.jsx(C,{size:14}),e.jsx("span",{children:t==="push"?"Syncing":"Confirm sync"})]})]})]})})}function ce({profile:s,profileBusy:a,onClose:t}){return e.jsx("div",{className:"git-dialog-backdrop",role:"presentation",onMouseDown:t,children:e.jsxs("div",{className:"git-dialog profile-path-dialog",role:"dialog","aria-modal":"true","aria-labelledby":"profile-path-dialog-title",onMouseDown:l=>l.stopPropagation(),children:[e.jsx("button",{className:"git-dialog-close",disabled:!!a,type:"button",title:"Close","aria-label":"Close",onClick:t,children:e.jsx($,{size:14})}),e.jsx("div",{className:"git-dialog-icon",children:e.jsx(E,{size:18})}),e.jsx("h2",{id:"profile-path-dialog-title",children:"Profile repo"}),e.jsxs("label",{className:"git-dialog-field",children:[e.jsx("span",{children:"Profile repo path"}),e.jsx("input",{"aria-label":"Profile repo path",readOnly:!0,value:s.repoPath??""})]}),e.jsxs("div",{className:"profile-dialog-summary",children:[e.jsx("strong",{children:s.git?.isRepo?"Git-backed":"Git setup required"}),e.jsxs("span",{children:[s.git?.branch??"No branch"," · ",N(s.git?.head)]})]}),e.jsx("div",{className:"git-dialog-footer",children:e.jsx("button",{className:"git-dialog-secondary",disabled:!!a,type:"button",onClick:t,children:"Close"})})]})})}function de({onSkillCommand:s,profile:a}){const t=a.skills.slice().sort((o,c)=>o.name.localeCompare(c.name)),l=!s;function n(o){s?.(o)}return e.jsxs("div",{className:"account-list profile-skill-list",children:[e.jsxs("div",{className:"account-list-heading profile-agent-list-heading",children:[e.jsx("span",{children:"Skills"}),e.jsxs("div",{className:"profile-skill-heading-actions",children:[e.jsxs("small",{children:[a.skillCatalog.skillCount," tracked"]}),e.jsxs("button",{className:"settings-secondary",disabled:l,type:"button",title:"Create profile skill",onClick:()=>n("/skill create "),children:[e.jsx(H,{size:14}),e.jsx("span",{children:"Create"})]})]})]}),t.length?e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"profile-skill-table-head","aria-hidden":"true",children:[e.jsx("span",{children:"Skill"}),e.jsx("span",{children:"Trigger"}),e.jsx("span",{children:"Status"}),e.jsx("span",{children:"Source"}),e.jsx("span",{children:"Actions"})]}),t.map(o=>e.jsx(re,{commandDisabled:l,onSkillCommand:n,skill:o},o.name))]}):e.jsxs("div",{className:"empty-account-list",children:[e.jsx("strong",{children:"No profile skills found"}),e.jsx("span",{children:"Use /skill create to add reusable profile instructions."})]})]})}function re({commandDisabled:s,onSkillCommand:a,skill:t}){const l=t.validationStatus==="valid"?{state:"ready",label:"valid"}:{state:"warning",label:t.validationStatus};return e.jsxs("div",{className:"product-row profile-skill-row",children:[e.jsxs("div",{className:"profile-agent-identity",children:[e.jsx(q,{size:18}),e.jsxs("div",{children:[e.jsx("strong",{children:t.name}),e.jsx("span",{title:t.path,children:t.path})]})]}),e.jsx("div",{className:"profile-skill-description",title:t.description,children:t.description||"No description"}),e.jsx(ue,{status:l}),e.jsx("div",{className:"profile-agent-action",children:e.jsx("span",{title:t.sourcePath,children:t.sourcePath})}),e.jsxs("div",{className:"profile-skill-actions",children:[e.jsx("button",{className:"settings-secondary compact",disabled:s||!t.enabled,type:"button",title:`Use ${t.name}`,onClick:()=>a(`$${t.name} `),children:e.jsx("span",{children:"Use"})}),e.jsx("button",{className:"settings-secondary compact",disabled:s,type:"button",title:`Edit ${t.name}`,onClick:()=>a(`/skill edit ${t.name} `),children:e.jsx("span",{children:"Edit"})})]})]})}function ue({status:s}){return e.jsx("span",{className:`profile-status-text ${s.state}`,children:s.label})}function N(s){return s?s.slice(0,10):"None"}function L(s,a){return D(s,a)?"Sync this account":s.hosted?.sourceCommitSha?`${s.hosted.promotionStatus??"uploaded"} ${N(s.hosted.sourceCommitSha)}`:"Not pushed"}function he(s,a){return a?s.git?.head?s.git.dirty?"Commit local profile changes before syncing.":null:"Commit the profile before syncing.":"Select a default team before syncing."}function ge(s,a){const t=[],l=s.summary.localHead??s.git?.head??null,n=s.hosted?.lastPushedLocalHead??null,o=s.summary.hostedHead??s.hosted?.sourceCommitSha??null;if(D(s,a)&&t.push({label:"Account",detail:"Hosted profile metadata was synced under a different default team.",count:1,tone:"warning"}),!o&&!n?t.push({label:"Hosted source",detail:"No hosted profile commit has been recorded.",count:1}):l&&n&&l!==n&&t.push({label:"Commit",detail:`Local ${N(l)} has not been pushed since ${N(n)}.`,count:1}),s.git?.dirty){const d=s.git.files.length||s.diff.files.length||1;t.push({label:"Uncommitted files",detail:`${d} local ${d===1?"file":"files"} changed.`,count:d,tone:"warning"})}const c=s.diff.changedAgents.length+s.diff.newAgents.length+s.diff.deletedAgents.length+s.diff.changedSkills.length+s.diff.changedActions.length+s.diff.changedExtensions.length+s.diff.setupChanges.length+s.diff.envRequirementChanges.length;return c>0&&t.push({label:"Profile changes",detail:fe(s),count:c,tone:s.git?.dirty?"warning":void 0}),s.catalog.stale&&t.push({label:"Catalog",detail:"Action catalog artifacts are stale or missing.",count:1,tone:"warning"}),s.setupGate.blockingCount>0&&t.push({label:"Setup",detail:`${s.setupGate.blockingCount} blocking setup ${s.setupGate.blockingCount===1?"requirement":"requirements"}.`,count:s.setupGate.blockingCount,tone:"warning"}),t}function fe(s){const a=[],t=s.diff.changedAgents.length+s.diff.newAgents.length+s.diff.deletedAgents.length;return t&&a.push(`${t} agent ${t===1?"change":"changes"}`),s.diff.changedActions.length&&a.push(`${s.diff.changedActions.length} action ${s.diff.changedActions.length===1?"change":"changes"}`),s.diff.changedSkills.length&&a.push(`${s.diff.changedSkills.length} skill ${s.diff.changedSkills.length===1?"change":"changes"}`),s.diff.changedExtensions.length&&a.push(`${s.diff.changedExtensions.length} extension ${s.diff.changedExtensions.length===1?"change":"changes"}`),s.diff.setupChanges.length&&a.push(`${s.diff.setupChanges.length} setup ${s.diff.setupChanges.length===1?"change":"changes"}`),s.diff.envRequirementChanges.length&&a.push(`${s.diff.envRequirementChanges.length} env ${s.diff.envRequirementChanges.length===1?"change":"changes"}`),a.join(", ")||"Profile source has local changes."}function D(s,a){const t=s.hosted?.teamId?.trim()??"";return!!(t&&a&&t!==a)}export{ye as P,V as R};
1
+ import{d as T,r as x,n as m,u as G,j as e,Y as z,x as U,k as H,ag as C,am as E,X as $,Z as q}from"./index-Cr_RZ7GD.js";import{G as w}from"./git-commit-horizontal-CbX4pTOA.js";import{P as B}from"./play-BLRANWaV.js";import{R as _}from"./refresh-cw-BFjjwYNf.js";/* empty css */const W=[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}]],V=T("rotate-ccw",W),Q=5e3;function X(s){const[a,t]=x.useState([]),[l,n]=x.useState(!1),[o,c]=x.useState(null),[d,p]=x.useState(()=>new Set);x.useEffect(()=>{if(!s){t([]),c(null),n(!1);return}let i=!1,r=null;async function f(b){if(!(!s||i)){b&&n(!0);try{const y=await m.localAgentSchedules(s);if(i)return;t(y.schedules),c(null)}catch(y){i||c(S(y))}finally{!i&&b&&n(!1)}}}return f(!0),r=window.setInterval(()=>{f(!1)},Q),()=>{i=!0,r!==null&&window.clearInterval(r)}},[s]);async function j(){if(s){n(!0);try{const i=await m.syncLocalAgentSchedules(s);t(i.schedules),c(null)}catch(i){c(S(i))}finally{n(!1)}}}async function g(i){if(!(!s||d.has(i.id))){h(i.id,!0);try{await m.runLocalAgentSchedule(s,i.id);const r=await m.localAgentSchedules(s);t(r.schedules),c(null)}catch(r){c(S(r))}finally{h(i.id,!1)}}}async function u(i){if(!(!s||d.has(i.id))){h(i.id,!0);try{await m.patchLocalAgentSchedule(s,i.id,{enabled:!i.enabled});const r=await m.localAgentSchedules(s);t(r.schedules),c(null)}catch(r){c(S(r))}finally{h(i.id,!1)}}}function h(i,r){p(f=>{const b=new Set(f);return r?b.add(i):b.delete(i),b})}return{error:o,loading:l,pendingScheduleIds:d,refresh:j,run:g,schedules:a,toggle:u}}function S(s){return s instanceof Error?s.message:String(s)}function Y({connection:s,profile:a,selectedDefaultTeamId:t}){const l=X(s);return G(l.error,{prefix:"Local schedules"}),e.jsxs("div",{className:"account-list profile-agent-list","aria-label":"Profile agents",children:[e.jsxs("div",{className:"account-list-heading profile-agent-list-heading",children:[e.jsx("span",{children:"Agents"}),e.jsx("div",{className:"profile-skill-heading-actions",children:e.jsx("small",{children:K(l.schedules.length,l.loading)})})]}),a.agents.length||l.schedules.length?e.jsx("div",{className:"profile-agent-table-frame",children:e.jsxs("table",{className:"profile-agent-table","aria-label":"Profile agents table",children:[e.jsxs("colgroup",{children:[e.jsx("col",{className:"profile-agent-column"}),e.jsx("col",{className:"profile-action-column"}),e.jsx("col",{className:"profile-check-column"}),e.jsx("col",{className:"profile-sync-column"})]}),e.jsx("thead",{children:e.jsxs("tr",{children:[e.jsx("th",{scope:"col",children:"Agent"}),e.jsx("th",{scope:"col",children:"Action"}),e.jsx("th",{scope:"col",children:"Check"}),e.jsx("th",{scope:"col",children:"Sync"})]})}),e.jsxs("tbody",{children:[a.agents.map(n=>e.jsx(Z,{agent:n,defaultAction:a.summary.defaultAction,profile:a,selectedDefaultTeamId:t},n.id)),l.schedules.map(n=>e.jsx(J,{pending:l.pendingScheduleIds.has(n.id),schedule:n,refreshing:l.loading,onRefresh:()=>{l.refresh()},onRun:()=>{l.run(n)},onToggle:()=>{l.toggle(n)}},n.id))]})]})}):e.jsxs("div",{className:"empty-account-list",children:[e.jsx("strong",{children:"No profile agents found"}),e.jsx("span",{children:"Create an agent, then run Profile checks to add it to the catalog."})]})]})}function Z({agent:s,defaultAction:a,profile:t,selectedDefaultTeamId:l}){const n=te(t,s,l);return e.jsxs("tr",{className:"profile-agent-row",children:[e.jsx("td",{children:e.jsxs("div",{className:"profile-agent-identity",children:[e.jsx(z,{size:18}),e.jsxs("div",{children:[e.jsx("strong",{children:s.name}),e.jsx("span",{title:s.path,children:s.path})]})]})}),e.jsx("td",{children:e.jsx("div",{className:"profile-agent-action",children:e.jsx("span",{children:a??"None"})})}),e.jsx("td",{children:e.jsx(A,{status:n.check})}),e.jsx("td",{children:e.jsx(A,{status:n.sync})})]})}function J({pending:s,refreshing:a,schedule:t,onRefresh:l,onRun:n,onToggle:o}){const c=ee(t),d=t.enabled?"Pause schedule":"Resume schedule";return e.jsxs("tr",{className:"profile-agent-row profile-schedule-agent-row",children:[e.jsx("td",{children:e.jsxs("div",{className:"profile-agent-identity",children:[e.jsx(z,{size:18}),e.jsxs("div",{children:[e.jsx("strong",{children:t.localProjectName}),e.jsxs("span",{title:t.scheduleName,children:["schedule: ",t.scheduleName]})]})]})}),e.jsx("td",{children:e.jsx("div",{className:"profile-agent-action",children:e.jsx("span",{title:t.targetAction,children:t.targetAction})})}),e.jsx("td",{children:e.jsx(A,{status:c})}),e.jsx("td",{children:e.jsxs("div",{className:"profile-schedule-actions",children:[e.jsx("span",{className:"profile-schedule-expression",title:se(t),children:t.enabled?t.scheduleExpression:"Paused"}),e.jsxs("div",{className:"profile-schedule-controls","aria-label":`${t.scheduleName} schedule controls`,children:[e.jsx("button",{className:"settings-icon-button profile-schedule-button",disabled:a,type:"button",title:"Refresh local schedules","aria-label":"Refresh local schedules",onClick:l,children:e.jsx(_,{size:14,className:a?"settings-spin":void 0})}),e.jsx("button",{className:"settings-icon-button profile-schedule-button",disabled:s,type:"button",title:"Run now","aria-label":`Run ${t.scheduleName} now`,onClick:n,children:e.jsx(V,{size:14})}),e.jsx("button",{className:"settings-icon-button profile-schedule-button",disabled:s,type:"button",title:d,"aria-label":`${d}: ${t.scheduleName}`,onClick:o,children:t.enabled?e.jsx(U,{size:14}):e.jsx(B,{size:14})})]})]})})]})}function A({status:s}){return e.jsx("span",{className:`profile-status-text ${s.state}`,children:s.label})}function K(s,a){return a&&s===0?"Loading schedules":a?`${s} scheduled, refreshing`:s===1?"1 scheduled":s>1?`${s} scheduled`:"No schedules"}function ee(s){return s.enabled?s.lastError||s.lastRunStatus==="failed"?{state:"warning",label:"Failed"}:s.lastRunStatus==="running"?{state:"loading",label:"Running"}:s.lastRunStatus==="queued"?{state:"loading",label:"Queued"}:s.lastRunStatus==="skipped"?{state:"warning",label:"Skipped"}:s.lastRunStatus==="succeeded"?{state:"ready",label:"Succeeded"}:{state:"loading",label:"Scheduled"}:{state:"disabled",label:"Paused"}}function se(s){const a=[`${s.scheduleType}: ${s.scheduleExpression}`];return s.nextRunAt&&a.push(`next ${R(s.nextRunAt)}`),s.lastRunAt&&a.push(`last ${R(s.lastRunAt)}`),a.join(" - ")}function R(s){const a=new Date(s);return Number.isFinite(a.getTime())?a.toLocaleString(void 0,{month:"short",day:"numeric",hour:"numeric",minute:"2-digit"}):s}function te(s,a,t){if(!a.enabled)return{check:{state:"disabled",label:"Disabled"},sync:{state:"disabled",label:"Disabled"}};if(s.error)return{check:{state:"warning",label:"Error"},sync:{state:"warning",label:"Blocked"}};if(s.setupGate.blockingCount>0)return{check:{state:"warning",label:"Setup"},sync:{state:"warning",label:"Blocked"}};if(s.git?.dirty||ne(s,a)>0)return{check:{state:"loading",label:"Pending"},sync:{state:"warning",label:"Changed"}};if(s.catalog.stale)return{check:{state:"loading",label:"Stale"},sync:{state:"loading",label:"Waiting"}};if(!s.lastCheck)return{check:{state:"loading",label:"Unchecked"},sync:{state:"loading",label:"Waiting"}};if(s.lastCheck.status==="failed")return{check:{state:"warning",label:"Failed"},sync:{state:"warning",label:"Blocked"}};if(!s.summary.checkFresh)return{check:{state:"loading",label:"Stale"},sync:{state:"loading",label:"Waiting"}};if(ae(s,t))return{check:{state:"ready",label:"Passed"},sync:{state:"warning",label:"Sync acct"}};const l=s.summary.localHead??s.git?.head??null,n=s.hosted?.lastPushedLocalHead??null;return!(s.summary.hostedHead??s.hosted?.sourceCommitSha??null)&&!n?{check:{state:"ready",label:"Passed"},sync:{state:"loading",label:"Not synced"}}:l&&n&&l!==n?{check:{state:"ready",label:"Passed"},sync:{state:"loading",label:"Needed"}}:{check:{state:"ready",label:"Passed"},sync:{state:"ready",label:"Synced"}}}function ae(s,a){const t=s.hosted?.teamId?.trim()??"";return!!(t&&a&&t!==a)}function ne(s,a){let t=0;s.diff.changedAgents.includes(a.id)&&(t+=1),s.diff.newAgents.includes(a.id)&&(t+=1),s.diff.deletedAgents.includes(a.id)&&(t+=1);const l=a.path.replace(/^profiles\/[^/]+\//,"");for(const n of s.diff.files){const o=n.path.replace(/^profiles\/[^/]+\//,"");(o===l||o.startsWith(`${l}/`)||o.startsWith(`agents/${a.id}/`))&&(t+=1)}return t}function ye({section:s="all",payload:a,connection:t,onPayload:l,onError:n,onToast:o,onSkillCommand:c,overviewContent:d}){const[p,j]=x.useState(""),[g,u]=x.useState(null),h=a?.profile??null,i=a?.preferences.defaultTeamId?.trim()||"",r=s==="all"||s==="profile"||s==="controls",f=s==="all"||s==="agents",b=s==="all"||s==="profile";async function y(P){t&&(l(await m.bootstrap(t)),o?.(P,"success"))}async function v(P,O){if(!(!t||g)){u(P),n(null);try{await O()}catch(k){n(k instanceof Error?k.message:String(k))}finally{u(null)}}}function M(){v("init",async()=>{await m.profileInit(t,{}),await y("Profile initialized")})}function F(){v("commit",async()=>{await m.profileCommit(t,{message:p.trim()||null}),j(""),await y("Profile commit complete")})}function I(){v("push",async()=>{if(!i)throw new Error("Select a default team before syncing a hosted profile.");await m.profileCheck(t,{kind:"all"}),await m.profilePush(t,{teamId:i,ensureHosted:!0,message:null}),await y("Profile synced to hosted profile repo")})}return e.jsx("section",{className:"account-settings",children:h?.mode==="local"?e.jsxs(e.Fragment,{children:[r?e.jsxs(e.Fragment,{children:[e.jsx(le,{connection:t,profile:h,profileBusy:g,profileCommitMessage:p,selectedDefaultTeamId:i,syncDisabledReason:he(h,i),setProfileCommitMessage:j,submitProfileCommit:F,submitProfilePush:I}),d]}):null,f?e.jsx(Y,{connection:t,profile:h,selectedDefaultTeamId:i}):null,b?e.jsx(de,{onSkillCommand:c,profile:h}):null]}):s==="agents"?e.jsxs("div",{className:"account-list",children:[e.jsxs("div",{className:"account-list-heading",children:[e.jsx("span",{children:"Agents"}),e.jsx("small",{children:"Profile required"})]}),e.jsxs("div",{className:"empty-account-list",children:[e.jsx("strong",{children:"No local Profile loaded"}),e.jsx("span",{children:"Open the Profile tab to create or load a Profile before managing agents."})]})]}):e.jsxs("div",{className:"account-list",children:[e.jsxs("div",{className:"account-list-heading",children:[e.jsx("span",{children:"Summary"}),e.jsx("small",{children:"Not loaded"})]}),e.jsxs("div",{className:"empty-account-list",children:[e.jsx("strong",{children:"No local profile loaded"}),e.jsx("span",{children:"OpenPond uses one Git-backed Profile in the default repo."}),e.jsxs("button",{className:"settings-secondary",disabled:!t||!!g,type:"button",onClick:M,children:[e.jsx(H,{size:14}),e.jsx("span",{children:g==="init"?"Creating":"Create default Profile"})]})]})]})})}function le({connection:s,profile:a,profileBusy:t,profileCommitMessage:l,selectedDefaultTeamId:n,syncDisabledReason:o,setProfileCommitMessage:c,submitProfileCommit:d,submitProfilePush:p}){const[j,g]=x.useState(!1),[u,h]=x.useState(!1),[i,r]=x.useState(!1),f=!s||!!t;return e.jsxs("div",{className:"profile-control-panel",children:[e.jsxs("div",{className:"profile-control-toolbar",children:[e.jsxs("div",{className:"profile-control-actions",children:[e.jsxs("button",{className:"settings-secondary",disabled:f,type:"button",onClick:()=>h(!0),children:[e.jsx(w,{size:14}),e.jsx("span",{children:t==="commit"?"Committing":"Commit"})]}),e.jsxs("button",{className:"settings-secondary",disabled:f||!a,type:"button",onClick:()=>r(!0),children:[e.jsx(C,{size:14}),e.jsx("span",{children:t==="push"?"Syncing":"Sync"})]}),e.jsxs("button",{className:"settings-secondary",disabled:!!t||!a,type:"button",onClick:()=>g(!0),children:[e.jsx(E,{size:14}),e.jsx("span",{children:"Repo"})]}),a?e.jsxs("span",{className:"profile-hosted-status",title:`Profile sync status: ${L(a,n)}`,children:[e.jsx(C,{size:14}),e.jsx("span",{children:"Profile sync"}),e.jsx("strong",{children:L(a,n)})]}):null]}),a?e.jsx("span",{className:`profile-local-status ${a.summary.state}`,title:a.summary.message,children:a.summary.message}):null]}),j&&a?e.jsx(ce,{profile:a,profileBusy:t,onClose:()=>g(!1)}):null,u?e.jsx(ie,{disabled:f,profileBusy:t,profileCommitMessage:l,setProfileCommitMessage:c,submitProfileCommit:d,onClose:()=>h(!1)}):null,i&&a?e.jsx(oe,{disabled:f,profile:a,profileBusy:t,selectedDefaultTeamId:n,syncDisabledReason:o,submitProfilePush:p,onClose:()=>r(!1)}):null]})}function ie({disabled:s,profileBusy:a,profileCommitMessage:t,setProfileCommitMessage:l,submitProfileCommit:n,onClose:o}){function c(d){d.preventDefault(),!s&&(n(),o())}return e.jsx("div",{className:"git-dialog-backdrop",role:"presentation",onMouseDown:o,children:e.jsxs("form",{className:"git-dialog profile-commit-dialog",role:"dialog","aria-modal":"true","aria-labelledby":"profile-commit-dialog-title",onMouseDown:d=>d.stopPropagation(),onSubmit:c,children:[e.jsx("button",{className:"git-dialog-close",disabled:!!a,type:"button",title:"Close","aria-label":"Close",onClick:o,children:e.jsx($,{size:14})}),e.jsx("div",{className:"git-dialog-icon",children:e.jsx(w,{size:18})}),e.jsx("h2",{id:"profile-commit-dialog-title",children:"Commit profile"}),e.jsxs("label",{className:"git-dialog-field",children:[e.jsx("span",{children:"Commit message"}),e.jsx("input",{autoFocus:!0,value:t,disabled:!!a,placeholder:"Update OpenPond profile",onChange:d=>l(d.target.value)})]}),e.jsxs("div",{className:"git-dialog-footer",children:[e.jsx("button",{className:"git-dialog-secondary",disabled:!!a,type:"button",onClick:o,children:"Cancel"}),e.jsxs("button",{className:"git-dialog-primary",disabled:s,type:"submit",children:[e.jsx(w,{size:14}),e.jsx("span",{children:a==="commit"?"Committing":"Commit"})]})]})]})})}function oe({disabled:s,profile:a,profileBusy:t,selectedDefaultTeamId:l,syncDisabledReason:n,submitProfilePush:o,onClose:c}){const d=ge(a,l),p=d.reduce((u,h)=>u+h.count,0),j=!s&&!n;function g(u){u.preventDefault(),j&&(o(),c())}return e.jsx("div",{className:"git-dialog-backdrop",role:"presentation",onMouseDown:c,children:e.jsxs("form",{className:"git-dialog profile-sync-dialog",role:"dialog","aria-modal":"true","aria-labelledby":"profile-sync-dialog-title",onMouseDown:u=>u.stopPropagation(),onSubmit:g,children:[e.jsx("button",{className:"git-dialog-close",disabled:!!t,type:"button",title:"Close","aria-label":"Close",onClick:c,children:e.jsx($,{size:14})}),e.jsx("div",{className:"git-dialog-icon",children:e.jsx(C,{size:18})}),e.jsx("h2",{id:"profile-sync-dialog-title",children:"Sync profile"}),e.jsx("p",{className:"profile-sync-explainer",children:"Sync publishes this committed Profile source for your team, so its Agents can be shared in team chat and attached to hosted sandboxes."}),e.jsxs("div",{className:"profile-dialog-summary",children:[e.jsxs("strong",{children:[p," ",p===1?"item":"items"," out of sync"]}),e.jsxs("span",{children:["Local ",N(a.summary.localHead??a.git?.head)," - Last pushed"," ",N(a.hosted?.lastPushedLocalHead)]})]}),d.length?e.jsx("div",{className:"profile-dialog-diff-list","aria-label":"Profile sync differences",children:d.map(u=>e.jsxs("div",{className:`profile-dialog-diff-row ${u.tone??""}`,children:[e.jsx("strong",{children:u.label}),e.jsx("span",{children:u.detail})]},u.label))}):e.jsx("div",{className:"profile-dialog-diff-list","aria-label":"Profile sync differences",children:e.jsxs("div",{className:"profile-dialog-diff-row",children:[e.jsx("strong",{children:"Aligned"}),e.jsx("span",{children:"Current local profile source has already been pushed."})]})}),n?e.jsx("div",{className:"profile-dialog-warning",children:n}):null,e.jsxs("div",{className:"git-dialog-footer",children:[e.jsx("button",{className:"git-dialog-secondary",disabled:!!t,type:"button",onClick:c,children:"Cancel"}),e.jsxs("button",{className:"git-dialog-primary",disabled:!j,type:"submit",children:[e.jsx(C,{size:14}),e.jsx("span",{children:t==="push"?"Syncing":"Confirm sync"})]})]})]})})}function ce({profile:s,profileBusy:a,onClose:t}){return e.jsx("div",{className:"git-dialog-backdrop",role:"presentation",onMouseDown:t,children:e.jsxs("div",{className:"git-dialog profile-path-dialog",role:"dialog","aria-modal":"true","aria-labelledby":"profile-path-dialog-title",onMouseDown:l=>l.stopPropagation(),children:[e.jsx("button",{className:"git-dialog-close",disabled:!!a,type:"button",title:"Close","aria-label":"Close",onClick:t,children:e.jsx($,{size:14})}),e.jsx("div",{className:"git-dialog-icon",children:e.jsx(E,{size:18})}),e.jsx("h2",{id:"profile-path-dialog-title",children:"Profile repo"}),e.jsxs("label",{className:"git-dialog-field",children:[e.jsx("span",{children:"Profile repo path"}),e.jsx("input",{"aria-label":"Profile repo path",readOnly:!0,value:s.repoPath??""})]}),e.jsxs("div",{className:"profile-dialog-summary",children:[e.jsx("strong",{children:s.git?.isRepo?"Git-backed":"Git setup required"}),e.jsxs("span",{children:[s.git?.branch??"No branch"," · ",N(s.git?.head)]})]}),e.jsx("div",{className:"git-dialog-footer",children:e.jsx("button",{className:"git-dialog-secondary",disabled:!!a,type:"button",onClick:t,children:"Close"})})]})})}function de({onSkillCommand:s,profile:a}){const t=a.skills.slice().sort((o,c)=>o.name.localeCompare(c.name)),l=!s;function n(o){s?.(o)}return e.jsxs("div",{className:"account-list profile-skill-list",children:[e.jsxs("div",{className:"account-list-heading profile-agent-list-heading",children:[e.jsx("span",{children:"Skills"}),e.jsxs("div",{className:"profile-skill-heading-actions",children:[e.jsxs("small",{children:[a.skillCatalog.skillCount," tracked"]}),e.jsxs("button",{className:"settings-secondary",disabled:l,type:"button",title:"Create profile skill",onClick:()=>n("/skill create "),children:[e.jsx(H,{size:14}),e.jsx("span",{children:"Create"})]})]})]}),t.length?e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"profile-skill-table-head","aria-hidden":"true",children:[e.jsx("span",{children:"Skill"}),e.jsx("span",{children:"Trigger"}),e.jsx("span",{children:"Status"}),e.jsx("span",{children:"Source"}),e.jsx("span",{children:"Actions"})]}),t.map(o=>e.jsx(re,{commandDisabled:l,onSkillCommand:n,skill:o},o.name))]}):e.jsxs("div",{className:"empty-account-list",children:[e.jsx("strong",{children:"No profile skills found"}),e.jsx("span",{children:"Use /skill create to add reusable profile instructions."})]})]})}function re({commandDisabled:s,onSkillCommand:a,skill:t}){const l=t.validationStatus==="valid"?{state:"ready",label:"valid"}:{state:"warning",label:t.validationStatus};return e.jsxs("div",{className:"product-row profile-skill-row",children:[e.jsxs("div",{className:"profile-agent-identity",children:[e.jsx(q,{size:18}),e.jsxs("div",{children:[e.jsx("strong",{children:t.name}),e.jsx("span",{title:t.path,children:t.path})]})]}),e.jsx("div",{className:"profile-skill-description",title:t.description,children:t.description||"No description"}),e.jsx(ue,{status:l}),e.jsx("div",{className:"profile-agent-action",children:e.jsx("span",{title:t.sourcePath,children:t.sourcePath})}),e.jsxs("div",{className:"profile-skill-actions",children:[e.jsx("button",{className:"settings-secondary compact",disabled:s||!t.enabled,type:"button",title:`Use ${t.name}`,onClick:()=>a(`$${t.name} `),children:e.jsx("span",{children:"Use"})}),e.jsx("button",{className:"settings-secondary compact",disabled:s,type:"button",title:`Edit ${t.name}`,onClick:()=>a(`/skill edit ${t.name} `),children:e.jsx("span",{children:"Edit"})})]})]})}function ue({status:s}){return e.jsx("span",{className:`profile-status-text ${s.state}`,children:s.label})}function N(s){return s?s.slice(0,10):"None"}function L(s,a){return D(s,a)?"Sync this account":s.hosted?.sourceCommitSha?`${s.hosted.promotionStatus??"uploaded"} ${N(s.hosted.sourceCommitSha)}`:"Not pushed"}function he(s,a){return a?s.git?.head?s.git.dirty?"Commit local profile changes before syncing.":null:"Commit the profile before syncing.":"Select a default team before syncing."}function ge(s,a){const t=[],l=s.summary.localHead??s.git?.head??null,n=s.hosted?.lastPushedLocalHead??null,o=s.summary.hostedHead??s.hosted?.sourceCommitSha??null;if(D(s,a)&&t.push({label:"Account",detail:"Hosted profile metadata was synced under a different default team.",count:1,tone:"warning"}),!o&&!n?t.push({label:"Hosted source",detail:"No hosted profile commit has been recorded.",count:1}):l&&n&&l!==n&&t.push({label:"Commit",detail:`Local ${N(l)} has not been pushed since ${N(n)}.`,count:1}),s.git?.dirty){const d=s.git.files.length||s.diff.files.length||1;t.push({label:"Uncommitted files",detail:`${d} local ${d===1?"file":"files"} changed.`,count:d,tone:"warning"})}const c=s.diff.changedAgents.length+s.diff.newAgents.length+s.diff.deletedAgents.length+s.diff.changedSkills.length+s.diff.changedActions.length+s.diff.changedExtensions.length+s.diff.setupChanges.length+s.diff.envRequirementChanges.length;return c>0&&t.push({label:"Profile changes",detail:fe(s),count:c,tone:s.git?.dirty?"warning":void 0}),s.catalog.stale&&t.push({label:"Catalog",detail:"Action catalog artifacts are stale or missing.",count:1,tone:"warning"}),s.setupGate.blockingCount>0&&t.push({label:"Setup",detail:`${s.setupGate.blockingCount} blocking setup ${s.setupGate.blockingCount===1?"requirement":"requirements"}.`,count:s.setupGate.blockingCount,tone:"warning"}),t}function fe(s){const a=[],t=s.diff.changedAgents.length+s.diff.newAgents.length+s.diff.deletedAgents.length;return t&&a.push(`${t} agent ${t===1?"change":"changes"}`),s.diff.changedActions.length&&a.push(`${s.diff.changedActions.length} action ${s.diff.changedActions.length===1?"change":"changes"}`),s.diff.changedSkills.length&&a.push(`${s.diff.changedSkills.length} skill ${s.diff.changedSkills.length===1?"change":"changes"}`),s.diff.changedExtensions.length&&a.push(`${s.diff.changedExtensions.length} extension ${s.diff.changedExtensions.length===1?"change":"changes"}`),s.diff.setupChanges.length&&a.push(`${s.diff.setupChanges.length} setup ${s.diff.setupChanges.length===1?"change":"changes"}`),s.diff.envRequirementChanges.length&&a.push(`${s.diff.envRequirementChanges.length} env ${s.diff.envRequirementChanges.length===1?"change":"changes"}`),a.join(", ")||"Profile source has local changes."}function D(s,a){const t=s.hosted?.teamId?.trim()??"";return!!(t&&a&&t!==a)}export{ye as P,V as R};