@truefoundry/trueforge 0.2.0-rc.3 → 0.2.0-rc.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/_frontend/assets/{AgentCodeSnippets-N546FNNS-DlWVvctF.js → AgentCodeSnippets-U6KQWVBJ-mo8URLKV.js} +1 -1
- package/dist/_frontend/assets/AgentCodeSnippets-U6KQWVBJ-mo8URLKV.js.br +0 -0
- package/dist/_frontend/assets/AgentCodeSnippets-U6KQWVBJ-mo8URLKV.js.gz +0 -0
- package/dist/_frontend/assets/AgentMetricChart-3D6FUFO6-DzIcybRU.js +1 -0
- package/dist/_frontend/assets/AgentMetricChart-3D6FUFO6-DzIcybRU.js.br +0 -0
- package/dist/_frontend/assets/AgentMetricChart-3D6FUFO6-DzIcybRU.js.gz +0 -0
- package/dist/_frontend/assets/{AgentOverview-VF74XC7I-DuR4GDFb.js → AgentOverview-RLJ6HZCN-YJvNjt8b.js} +1 -1
- package/dist/_frontend/assets/AgentOverview-RLJ6HZCN-YJvNjt8b.js.br +0 -0
- package/dist/_frontend/assets/AgentOverview-RLJ6HZCN-YJvNjt8b.js.gz +0 -0
- package/dist/_frontend/assets/{AgentSessionEventTimeline-RFR6LQMY-B_5nS70p.js → AgentSessionEventTimeline-CDXRRUZQ-CnbfBoc3.js} +1 -1
- package/dist/_frontend/assets/AgentSessionEventTimeline-CDXRRUZQ-CnbfBoc3.js.br +0 -0
- package/dist/_frontend/assets/AgentSessionEventTimeline-CDXRRUZQ-CnbfBoc3.js.gz +0 -0
- package/dist/_frontend/assets/{AgentSessionEventTimelineChart-27CQF6FX-DSTwylcS.js → AgentSessionEventTimelineChart-S2WX6ZEA-BjzWPaWE.js} +1 -1
- package/dist/_frontend/assets/AgentSessionEventTimelineChart-S2WX6ZEA-BjzWPaWE.js.br +0 -0
- package/dist/_frontend/assets/AgentSessionEventTimelineChart-S2WX6ZEA-BjzWPaWE.js.gz +0 -0
- package/dist/_frontend/assets/AgentSessions-UI3L7XY2-CG8nWJdo.js +1 -0
- package/dist/_frontend/assets/AgentSessions-UI3L7XY2-CG8nWJdo.js.br +0 -0
- package/dist/_frontend/assets/AgentSessions-UI3L7XY2-CG8nWJdo.js.gz +0 -0
- package/dist/_frontend/assets/{ConnectorSettings-R5VEP7BO-Cvdqimeu.js → ConnectorSettings-OIGAC2HU-xm76mpmk.js} +1 -1
- package/dist/_frontend/assets/ConnectorSettings-OIGAC2HU-xm76mpmk.js.br +0 -0
- package/dist/_frontend/assets/ConnectorSettings-OIGAC2HU-xm76mpmk.js.gz +0 -0
- package/dist/_frontend/assets/{DockLayout-F44RWGEY-DVcqWNpi.js → DockLayout-J5BRKMJZ-xjQQzILb.js} +1 -1
- package/dist/_frontend/assets/{DrawerLayout-SQ323AVM-CrsDJpVR.js → DrawerLayout-65YHGHIF-CehQ0ZjJ.js} +2 -2
- package/dist/_frontend/assets/DrawerLayout-65YHGHIF-CehQ0ZjJ.js.br +0 -0
- package/dist/_frontend/assets/DrawerLayout-65YHGHIF-CehQ0ZjJ.js.gz +0 -0
- package/dist/_frontend/assets/{ModelSettings-6QLS63HM-B0omK7y_.js → ModelSettings-VP6WCMGT-DuhYOy95.js} +1 -1
- package/dist/_frontend/assets/ModelSettings-VP6WCMGT-DuhYOy95.js.br +0 -0
- package/dist/_frontend/assets/ModelSettings-VP6WCMGT-DuhYOy95.js.gz +0 -0
- package/dist/_frontend/assets/SandboxSettings-GTZT7LD6-F_5p7NeO.js +1 -0
- package/dist/_frontend/assets/SandboxSettings-GTZT7LD6-F_5p7NeO.js.br +0 -0
- package/dist/_frontend/assets/SandboxSettings-GTZT7LD6-F_5p7NeO.js.gz +0 -0
- package/dist/_frontend/assets/SchedulesPage-ARWU7BZF-BIZcHayD.js +1 -0
- package/dist/_frontend/assets/SchedulesPage-ARWU7BZF-BIZcHayD.js.br +0 -0
- package/dist/_frontend/assets/SchedulesPage-ARWU7BZF-BIZcHayD.js.gz +0 -0
- package/dist/_frontend/assets/{SettingsBuilder-GISAH2WU-2fVa9yeg.js → SettingsBuilder-A4BPYIFZ-B4p1JpXq.js} +2 -2
- package/dist/_frontend/assets/SettingsBuilder-A4BPYIFZ-B4p1JpXq.js.br +0 -0
- package/dist/_frontend/assets/SettingsBuilder-A4BPYIFZ-B4p1JpXq.js.gz +0 -0
- package/dist/_frontend/assets/{ShellRouteSync-EN33DUQ7-C280D67g.js → ShellRouteSync-SSLGM35F-Cqt-1Q8u.js} +1 -1
- package/dist/_frontend/assets/ShellRouteSync-SSLGM35F-Cqt-1Q8u.js.br +0 -0
- package/dist/_frontend/assets/ShellRouteSync-SSLGM35F-Cqt-1Q8u.js.gz +0 -0
- package/dist/_frontend/assets/{SidebarLayout-35K4AKTC-0-Mjo6gf.js → SidebarLayout-MFDOGAVJ-pSgzH70r.js} +2 -2
- package/dist/_frontend/assets/SidebarLayout-MFDOGAVJ-pSgzH70r.js.br +0 -0
- package/dist/_frontend/assets/SidebarLayout-MFDOGAVJ-pSgzH70r.js.gz +0 -0
- package/dist/_frontend/assets/{SkillSettings-JSX2BTII-BriJH4Oj.js → SkillSettings-WQPUQ5TE-x17-_tYg.js} +1 -1
- package/dist/_frontend/assets/SkillSettings-WQPUQ5TE-x17-_tYg.js.br +0 -0
- package/dist/_frontend/assets/SkillSettings-WQPUQ5TE-x17-_tYg.js.gz +0 -0
- package/dist/_frontend/assets/TrueForgeUIWithRouter-5CDICMCE-DcMl1KUh.js +1 -0
- package/dist/_frontend/assets/{WidgetLayout-RKBSN2FZ-u6iVYu3w.js → WidgetLayout-HE7E4UL5-D_jC6D5-.js} +1 -1
- package/dist/_frontend/assets/WidgetLayout-HE7E4UL5-D_jC6D5-.js.br +0 -0
- package/dist/_frontend/assets/WidgetLayout-HE7E4UL5-D_jC6D5-.js.gz +0 -0
- package/dist/_frontend/assets/{chunk-73FQVITT-mgvTPDmd.js → chunk-2BDTG544-FxcOqFr-.js} +1 -1
- package/dist/_frontend/assets/chunk-2BDTG544-FxcOqFr-.js.br +0 -0
- package/dist/_frontend/assets/chunk-2BDTG544-FxcOqFr-.js.gz +0 -0
- package/dist/_frontend/assets/{chunk-62JRHF6Z-DYrEQoq5.js → chunk-62JRHF6Z-6aeTVQm8.js} +1 -1
- package/dist/_frontend/assets/chunk-62JRHF6Z-6aeTVQm8.js.br +0 -0
- package/dist/_frontend/assets/chunk-62JRHF6Z-6aeTVQm8.js.gz +0 -0
- package/dist/_frontend/assets/{chunk-LUG7E6BL-QKvrInc2.js → chunk-TGKQRK3S-D5Bs7icZ.js} +1 -1
- package/dist/_frontend/assets/chunk-TGKQRK3S-D5Bs7icZ.js.br +0 -0
- package/dist/_frontend/assets/chunk-TGKQRK3S-D5Bs7icZ.js.gz +0 -0
- package/dist/_frontend/assets/{chunk-GIPFF6FZ-DPTdcXQj.js → chunk-VXKNS7FH-Dm2ZAGlE.js} +2 -2
- package/dist/_frontend/assets/chunk-VXKNS7FH-Dm2ZAGlE.js.br +0 -0
- package/dist/_frontend/assets/chunk-VXKNS7FH-Dm2ZAGlE.js.gz +0 -0
- package/dist/_frontend/assets/{cssMode-BNfxrwWp.js → cssMode-BSK94pjD.js} +1 -1
- package/dist/_frontend/assets/cssMode-BSK94pjD.js.br +0 -0
- package/dist/_frontend/assets/cssMode-BSK94pjD.js.gz +0 -0
- package/dist/_frontend/assets/{freemarker2-ClbLzW-k.js → freemarker2-hYZ9lU-u.js} +1 -1
- package/dist/_frontend/assets/freemarker2-hYZ9lU-u.js.br +0 -0
- package/dist/_frontend/assets/freemarker2-hYZ9lU-u.js.gz +0 -0
- package/dist/_frontend/assets/{handlebars-5nE6yTDt.js → handlebars-CJdvCy_0.js} +1 -1
- package/dist/_frontend/assets/handlebars-CJdvCy_0.js.br +0 -0
- package/dist/_frontend/assets/handlebars-CJdvCy_0.js.gz +0 -0
- package/dist/_frontend/assets/{html-BZRf7Zhg.js → html-BHnJtaJv.js} +1 -1
- package/dist/_frontend/assets/html-BHnJtaJv.js.br +0 -0
- package/dist/_frontend/assets/html-BHnJtaJv.js.gz +0 -0
- package/dist/_frontend/assets/{htmlMode-C6O73C_r.js → htmlMode-BTNbHYXw.js} +1 -1
- package/dist/_frontend/assets/htmlMode-BTNbHYXw.js.br +0 -0
- package/dist/_frontend/assets/htmlMode-BTNbHYXw.js.gz +0 -0
- package/dist/_frontend/assets/{index-D0Yf366e.js → index-B1sBHguz.js} +1 -1
- package/dist/_frontend/assets/index-B1sBHguz.js.br +0 -0
- package/dist/_frontend/assets/index-B1sBHguz.js.gz +0 -0
- package/dist/_frontend/assets/{index-DBjak9Sg.js → index-BU6gYO7K.js} +3 -3
- package/dist/_frontend/assets/index-BU6gYO7K.js.br +0 -0
- package/dist/_frontend/assets/index-BU6gYO7K.js.gz +0 -0
- package/dist/_frontend/assets/{index-XpZpj5Rl.js → index-DZOZ1xN3.js} +240 -240
- package/dist/_frontend/assets/index-DZOZ1xN3.js.br +0 -0
- package/dist/_frontend/assets/index-DZOZ1xN3.js.gz +0 -0
- package/dist/_frontend/assets/{javascript-CrSAQdU4.js → javascript-BKY4Sujy.js} +1 -1
- package/dist/_frontend/assets/{jsonMode-Dal25yu2.js → jsonMode-B_jTSLwe.js} +1 -1
- package/dist/_frontend/assets/jsonMode-B_jTSLwe.js.br +0 -0
- package/dist/_frontend/assets/jsonMode-B_jTSLwe.js.gz +0 -0
- package/dist/_frontend/assets/{liquid-Ci7gjLGv.js → liquid-OVC8bSZr.js} +1 -1
- package/dist/_frontend/assets/liquid-OVC8bSZr.js.br +0 -0
- package/dist/_frontend/assets/liquid-OVC8bSZr.js.gz +0 -0
- package/dist/_frontend/assets/{lspLanguageFeatures-rM-QiA57.js → lspLanguageFeatures-BpQc31SX.js} +1 -1
- package/dist/_frontend/assets/lspLanguageFeatures-BpQc31SX.js.br +0 -0
- package/dist/_frontend/assets/lspLanguageFeatures-BpQc31SX.js.gz +0 -0
- package/dist/_frontend/assets/{mdx-J3rSuJw4.js → mdx-Rt-sDg8a.js} +1 -1
- package/dist/_frontend/assets/mdx-Rt-sDg8a.js.br +0 -0
- package/dist/_frontend/assets/mdx-Rt-sDg8a.js.gz +0 -0
- package/dist/_frontend/assets/{python-BSpXGEco.js → python-CLLuhWlP.js} +1 -1
- package/dist/_frontend/assets/python-CLLuhWlP.js.br +0 -0
- package/dist/_frontend/assets/python-CLLuhWlP.js.gz +0 -0
- package/dist/_frontend/assets/{razor-DLV1uhEc.js → razor-CTEZKBpz.js} +1 -1
- package/dist/_frontend/assets/razor-CTEZKBpz.js.br +0 -0
- package/dist/_frontend/assets/razor-CTEZKBpz.js.gz +0 -0
- package/dist/_frontend/assets/{tsMode-CQqRu3mP.js → tsMode-BsjOp9ss.js} +1 -1
- package/dist/_frontend/assets/tsMode-BsjOp9ss.js.br +0 -0
- package/dist/_frontend/assets/tsMode-BsjOp9ss.js.gz +0 -0
- package/dist/_frontend/assets/{typescript-BExfm66c.js → typescript-CpIJvyBH.js} +1 -1
- package/dist/_frontend/assets/typescript-CpIJvyBH.js.br +0 -0
- package/dist/_frontend/assets/typescript-CpIJvyBH.js.gz +0 -0
- package/dist/_frontend/assets/{workers-Cn25A5Lb.js → workers-C_uhAUan.js} +1 -1
- package/dist/_frontend/assets/workers-C_uhAUan.js.br +0 -0
- package/dist/_frontend/assets/workers-C_uhAUan.js.gz +0 -0
- package/dist/_frontend/assets/{xml-D2IDD-hb.js → xml-BxHi2HCJ.js} +1 -1
- package/dist/_frontend/assets/xml-BxHi2HCJ.js.br +0 -0
- package/dist/_frontend/assets/xml-BxHi2HCJ.js.gz +0 -0
- package/dist/_frontend/assets/{yaml-CY4c2A0Y.js → yaml-DyyH_CDu.js} +1 -1
- package/dist/_frontend/assets/yaml-DyyH_CDu.js.br +0 -0
- package/dist/_frontend/assets/yaml-DyyH_CDu.js.gz +0 -0
- package/dist/_frontend/index.html +1 -1
- package/dist/controller-main.js +101 -108
- package/dist/controller-main.js.map +1 -1
- package/dist/main.js +459 -277
- package/dist/main.js.map +1 -1
- package/package.json +2 -2
- package/dist/_frontend/assets/AgentCodeSnippets-N546FNNS-DlWVvctF.js.br +0 -0
- package/dist/_frontend/assets/AgentCodeSnippets-N546FNNS-DlWVvctF.js.gz +0 -0
- package/dist/_frontend/assets/AgentMetricChart-YWJYVYYA-DTDXcVgE.js +0 -1
- package/dist/_frontend/assets/AgentMetricChart-YWJYVYYA-DTDXcVgE.js.br +0 -0
- package/dist/_frontend/assets/AgentMetricChart-YWJYVYYA-DTDXcVgE.js.gz +0 -0
- package/dist/_frontend/assets/AgentOverview-VF74XC7I-DuR4GDFb.js.br +0 -0
- package/dist/_frontend/assets/AgentOverview-VF74XC7I-DuR4GDFb.js.gz +0 -0
- package/dist/_frontend/assets/AgentSessionEventTimeline-RFR6LQMY-B_5nS70p.js.br +0 -0
- package/dist/_frontend/assets/AgentSessionEventTimeline-RFR6LQMY-B_5nS70p.js.gz +0 -0
- package/dist/_frontend/assets/AgentSessionEventTimelineChart-27CQF6FX-DSTwylcS.js.br +0 -0
- package/dist/_frontend/assets/AgentSessionEventTimelineChart-27CQF6FX-DSTwylcS.js.gz +0 -0
- package/dist/_frontend/assets/AgentSessions-4IVX2SGD-Bf2N2ega.js +0 -1
- package/dist/_frontend/assets/AgentSessions-4IVX2SGD-Bf2N2ega.js.br +0 -0
- package/dist/_frontend/assets/AgentSessions-4IVX2SGD-Bf2N2ega.js.gz +0 -0
- package/dist/_frontend/assets/ConnectorSettings-R5VEP7BO-Cvdqimeu.js.br +0 -0
- package/dist/_frontend/assets/ConnectorSettings-R5VEP7BO-Cvdqimeu.js.gz +0 -0
- package/dist/_frontend/assets/DrawerLayout-SQ323AVM-CrsDJpVR.js.br +0 -0
- package/dist/_frontend/assets/DrawerLayout-SQ323AVM-CrsDJpVR.js.gz +0 -0
- package/dist/_frontend/assets/ModelSettings-6QLS63HM-B0omK7y_.js.br +0 -0
- package/dist/_frontend/assets/ModelSettings-6QLS63HM-B0omK7y_.js.gz +0 -0
- package/dist/_frontend/assets/SandboxSettings-OLKDXIQS-O1pf1zn0.js +0 -1
- package/dist/_frontend/assets/SandboxSettings-OLKDXIQS-O1pf1zn0.js.br +0 -0
- package/dist/_frontend/assets/SandboxSettings-OLKDXIQS-O1pf1zn0.js.gz +0 -0
- package/dist/_frontend/assets/SchedulesPage-TMOTK6DR-D9JlkZFv.js +0 -1
- package/dist/_frontend/assets/SchedulesPage-TMOTK6DR-D9JlkZFv.js.br +0 -0
- package/dist/_frontend/assets/SchedulesPage-TMOTK6DR-D9JlkZFv.js.gz +0 -0
- package/dist/_frontend/assets/SettingsBuilder-GISAH2WU-2fVa9yeg.js.br +0 -0
- package/dist/_frontend/assets/SettingsBuilder-GISAH2WU-2fVa9yeg.js.gz +0 -0
- package/dist/_frontend/assets/ShellRouteSync-EN33DUQ7-C280D67g.js.br +0 -0
- package/dist/_frontend/assets/ShellRouteSync-EN33DUQ7-C280D67g.js.gz +0 -0
- package/dist/_frontend/assets/SidebarLayout-35K4AKTC-0-Mjo6gf.js.br +0 -0
- package/dist/_frontend/assets/SidebarLayout-35K4AKTC-0-Mjo6gf.js.gz +0 -0
- package/dist/_frontend/assets/SkillSettings-JSX2BTII-BriJH4Oj.js.br +0 -0
- package/dist/_frontend/assets/SkillSettings-JSX2BTII-BriJH4Oj.js.gz +0 -0
- package/dist/_frontend/assets/TrueForgeUIWithRouter-6VCR7ES3-CtIaYnA8.js +0 -1
- package/dist/_frontend/assets/WidgetLayout-RKBSN2FZ-u6iVYu3w.js.br +0 -0
- package/dist/_frontend/assets/WidgetLayout-RKBSN2FZ-u6iVYu3w.js.gz +0 -0
- package/dist/_frontend/assets/chunk-62JRHF6Z-DYrEQoq5.js.br +0 -0
- package/dist/_frontend/assets/chunk-62JRHF6Z-DYrEQoq5.js.gz +0 -0
- package/dist/_frontend/assets/chunk-73FQVITT-mgvTPDmd.js.br +0 -0
- package/dist/_frontend/assets/chunk-73FQVITT-mgvTPDmd.js.gz +0 -0
- package/dist/_frontend/assets/chunk-GIPFF6FZ-DPTdcXQj.js.br +0 -0
- package/dist/_frontend/assets/chunk-GIPFF6FZ-DPTdcXQj.js.gz +0 -0
- package/dist/_frontend/assets/chunk-LUG7E6BL-QKvrInc2.js.br +0 -0
- package/dist/_frontend/assets/chunk-LUG7E6BL-QKvrInc2.js.gz +0 -0
- package/dist/_frontend/assets/cssMode-BNfxrwWp.js.br +0 -0
- package/dist/_frontend/assets/cssMode-BNfxrwWp.js.gz +0 -0
- package/dist/_frontend/assets/freemarker2-ClbLzW-k.js.br +0 -0
- package/dist/_frontend/assets/freemarker2-ClbLzW-k.js.gz +0 -0
- package/dist/_frontend/assets/handlebars-5nE6yTDt.js.br +0 -0
- package/dist/_frontend/assets/handlebars-5nE6yTDt.js.gz +0 -0
- package/dist/_frontend/assets/html-BZRf7Zhg.js.br +0 -0
- package/dist/_frontend/assets/html-BZRf7Zhg.js.gz +0 -0
- package/dist/_frontend/assets/htmlMode-C6O73C_r.js.br +0 -0
- package/dist/_frontend/assets/htmlMode-C6O73C_r.js.gz +0 -0
- package/dist/_frontend/assets/index-D0Yf366e.js.br +0 -0
- package/dist/_frontend/assets/index-D0Yf366e.js.gz +0 -0
- package/dist/_frontend/assets/index-DBjak9Sg.js.br +0 -0
- package/dist/_frontend/assets/index-DBjak9Sg.js.gz +0 -0
- package/dist/_frontend/assets/index-XpZpj5Rl.js.br +0 -0
- package/dist/_frontend/assets/index-XpZpj5Rl.js.gz +0 -0
- package/dist/_frontend/assets/jsonMode-Dal25yu2.js.br +0 -0
- package/dist/_frontend/assets/jsonMode-Dal25yu2.js.gz +0 -0
- package/dist/_frontend/assets/liquid-Ci7gjLGv.js.br +0 -0
- package/dist/_frontend/assets/liquid-Ci7gjLGv.js.gz +0 -0
- package/dist/_frontend/assets/lspLanguageFeatures-rM-QiA57.js.br +0 -0
- package/dist/_frontend/assets/lspLanguageFeatures-rM-QiA57.js.gz +0 -0
- package/dist/_frontend/assets/mdx-J3rSuJw4.js.br +0 -0
- package/dist/_frontend/assets/mdx-J3rSuJw4.js.gz +0 -0
- package/dist/_frontend/assets/python-BSpXGEco.js.br +0 -0
- package/dist/_frontend/assets/python-BSpXGEco.js.gz +0 -0
- package/dist/_frontend/assets/razor-DLV1uhEc.js.br +0 -0
- package/dist/_frontend/assets/razor-DLV1uhEc.js.gz +0 -0
- package/dist/_frontend/assets/tsMode-CQqRu3mP.js.br +0 -0
- package/dist/_frontend/assets/tsMode-CQqRu3mP.js.gz +0 -0
- package/dist/_frontend/assets/typescript-BExfm66c.js.br +0 -0
- package/dist/_frontend/assets/typescript-BExfm66c.js.gz +0 -0
- package/dist/_frontend/assets/workers-Cn25A5Lb.js.br +0 -0
- package/dist/_frontend/assets/workers-Cn25A5Lb.js.gz +0 -0
- package/dist/_frontend/assets/xml-D2IDD-hb.js.br +0 -0
- package/dist/_frontend/assets/xml-D2IDD-hb.js.gz +0 -0
- package/dist/_frontend/assets/yaml-CY4c2A0Y.js.br +0 -0
- package/dist/_frontend/assets/yaml-CY4c2A0Y.js.gz +0 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@truefoundry/trueforge",
|
|
3
|
-
"version": "0.2.0-rc.
|
|
3
|
+
"version": "0.2.0-rc.4",
|
|
4
4
|
"description": "TrueForge Agent Harness: server, HTTP API, and chat UI (npx @truefoundry/trueforge)",
|
|
5
5
|
"author": "TrueFoundry",
|
|
6
6
|
"license": "MIT",
|
|
@@ -48,7 +48,7 @@
|
|
|
48
48
|
"yaml": "^2.9.0",
|
|
49
49
|
"zod": "^4.4.3",
|
|
50
50
|
"@truefoundry/trueforge-core": "0.2.0-rc.3",
|
|
51
|
-
"@truefoundry/trueforge-sdk": "0.2.0-rc.
|
|
51
|
+
"@truefoundry/trueforge-sdk": "0.2.0-rc.4"
|
|
52
52
|
},
|
|
53
53
|
"devDependencies": {
|
|
54
54
|
"@swc/core": "^1.16.1",
|
|
Binary file
|
|
Binary file
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{ab as j,r as d,j as a,aw as C,av as k}from"./index-XpZpj5Rl.js";import{c as F,a as M,d as R,L as S,e as w,P as D,f as T,p}from"./index-D0Yf366e.js";M.register(R,S,w,D,T,p);var E=["#6366F1","#2563eb","#0EA5E9"],$=["#6366F1","#60a5fa","#38BDF8"],A=new Intl.NumberFormat(void 0,{maximumFractionDigits:4}),O=new Intl.DateTimeFormat(void 0,{month:"short",day:"numeric",hour:"numeric",minute:"2-digit"});function f(e,t){return t==="$"?C(e):t==="ms"?k(e):`${A.format(e)}${t==="count"||t.length===0?"":` ${t}`}`}function _(e){const t=new Date(e);return Number.isNaN(t.getTime())?e:O.format(t)}function G({graph:e,definition:t,error:u,colorIndex:b=0}){const l=j(),r=l==="dark"?$:E,i=l==="dark"?"#71717a":"#a1a1aa",m=l==="dark"?"#27272a":"#e4e4e7",c=d.useMemo(()=>e==null?[]:[...new Set(e.graphLines.flatMap(s=>s.values.map(o=>o.timestamp)))].sort(),[e]),y=d.useMemo(()=>({labels:c.map(_),datasets:(e==null?void 0:e.graphLines.map((s,o)=>{const L=new Map(s.values.map(n=>[n.timestamp,n.value])),x=r[(b+o)%r.length];return{label:s.name,data:c.map(n=>L.get(n)??null),borderColor:x,backgroundColor:x,pointRadius:0,pointHoverRadius:0,borderWidth:2,borderCapStyle:"butt",borderJoinStyle:"miter",tension:0,spanGaps:!0}}))??[]}),[b,r,e,c]),v=d.useMemo(()=>({responsive:!0,maintainAspectRatio:!1,animation:!1,interaction:{intersect:!1,mode:"index"},plugins:{legend:{display:((e==null?void 0:e.graphLines.length)??0)>1,labels:{color:i,boxWidth:10,boxHeight:2}},tooltip:{callbacks:{label:s=>{const o=s.parsed.y;return`${s.dataset.label??""}: ${o==null?"—":f(o,(e==null?void 0:e.unit)??"")}`}}}},scales:{x:{grid:{display:!1},border:{color:m},ticks:{color:i,maxRotation:0,autoSkip:!0,maxTicksLimit:8}},y:{beginAtZero:!0,grid:{color:m},border:{display:!1},ticks:{color:i,callback:s=>f(Number(s),(e==null?void 0:e.unit)??"")}}}}),[i,e,m]),N=(e==null?void 0:e.graphLines.some(s=>s.values.length>0))===!0;return a.jsxs("section",{className:"min-w-0 rounded-lg border border-border bg-card-bg p-4","data-slot":"agent-metric-chart",children:[a.jsx("h3",{className:"text-sm font-semibold text-text-primary",children:(e==null?void 0:e.displayName)??t.displayName}),a.jsx("p",{className:"mt-1 text-xs text-text-secondary",children:(e==null?void 0:e.description)??t.description}),a.jsx("div",{className:"mt-4 h-64",children:u!=null?a.jsx("div",{className:"flex h-full items-center justify-center text-sm text-failure-bg",children:u}):N?a.jsx(F,{data:y,options:v}):a.jsx("div",{className:"flex h-full items-center justify-center text-sm text-text-secondary",children:"No data"})})]})}export{G as AgentMetricChart};
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
var Fe=e=>{throw TypeError(e)};var Oe=(e,t,n)=>t.has(e)||Fe("Cannot "+n);var fe=(e,t,n)=>(Oe(e,t,"read from private field"),n?n.call(e):t.get(e)),Ge=(e,t,n)=>t.has(e)?Fe("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),Be=(e,t,n,o)=>(Oe(e,t,"write to private field"),o?o.call(e,n):t.set(e,n),n);import{a as wt}from"./chunk-73FQVITT-mgvTPDmd.js";import{r as w,j as P,bl as Ct,B as Lt,a as Pt,bm as Rt,bn as Et,E as kt,c as we,o as $e,M as Mt,L as He,I as It,e as Dt,bo as Tt}from"./index-XpZpj5Rl.js";function Nt(e,t){const n=getComputedStyle(e),o=parseFloat(n.fontSize);return t*o}function jt(e,t){const n=getComputedStyle(e.ownerDocument.documentElement),o=parseFloat(n.fontSize);return t*o}function At(e){return e/100*window.innerHeight}function Ft(e){return e/100*window.innerWidth}function Ot(e){switch(typeof e){case"number":return[e,"px"];case"string":{const t=parseFloat(e);return e.endsWith("%")?[t,"%"]:e.endsWith("px")?[t,"px"]:e.endsWith("rem")?[t,"rem"]:e.endsWith("em")?[t,"em"]:e.endsWith("vh")?[t,"vh"]:e.endsWith("vw")?[t,"vw"]:[t,"%"]}}}function pe({groupSize:e,panelElement:t,styleProp:n}){let o;const[r,i]=Ot(n);switch(i){case"%":{o=r/100*e;break}case"px":{o=r;break}case"rem":{o=jt(t,r);break}case"em":{o=Nt(t,r);break}case"vh":{o=At(r);break}case"vw":{o=Ft(r);break}}return o}function O(e){return parseFloat(e.toFixed(3))}function de({group:e}){const{orientation:t,panels:n}=e;return n.reduce((o,r)=>(o+=t==="horizontal"?r.element.offsetWidth:r.element.offsetHeight,o),0)}function Pe(e){const{panels:t}=e,n=de({group:e});return n===0?t.map(o=>({groupResizeBehavior:o.panelConstraints.groupResizeBehavior,collapsedSize:0,collapsible:o.panelConstraints.collapsible===!0,defaultSize:void 0,disabled:o.panelConstraints.disabled,minSize:0,maxSize:100,panelId:o.id})):t.map(o=>{const{element:r,panelConstraints:i}=o;let u=0;if(i.collapsedSize!==void 0){const c=pe({groupSize:n,panelElement:r,styleProp:i.collapsedSize});u=O(c/n*100)}let a;if(i.defaultSize!==void 0){const c=pe({groupSize:n,panelElement:r,styleProp:i.defaultSize});a=O(c/n*100)}let s=0;if(i.minSize!==void 0){const c=pe({groupSize:n,panelElement:r,styleProp:i.minSize});s=O(c/n*100)}let l=100;if(i.maxSize!==void 0){const c=pe({groupSize:n,panelElement:r,styleProp:i.maxSize});l=O(c/n*100)}return{groupResizeBehavior:i.groupResizeBehavior,collapsedSize:u,collapsible:i.collapsible===!0,defaultSize:a,disabled:i.disabled,minSize:s,maxSize:l,panelId:o.id}})}function M(e,t="Assertion error"){if(!e)throw Error(t)}function Re(e,t){return Array.from(t).sort(e==="horizontal"?Gt:Bt)}function Gt(e,t){const n=e.element.offsetLeft-t.element.offsetLeft;return n!==0?n:e.element.offsetWidth-t.element.offsetWidth}function Bt(e,t){const n=e.element.offsetTop-t.element.offsetTop;return n!==0?n:e.element.offsetHeight-t.element.offsetHeight}function it(e){return e!==null&&typeof e=="object"&&"nodeType"in e&&e.nodeType===Node.ELEMENT_NODE}function at(e,t){return{x:e.x>=t.left&&e.x<=t.right?0:Math.min(Math.abs(e.x-t.left),Math.abs(e.x-t.right)),y:e.y>=t.top&&e.y<=t.bottom?0:Math.min(Math.abs(e.y-t.top),Math.abs(e.y-t.bottom))}}function $t({orientation:e,rects:t,targetRect:n}){const o={x:n.x+n.width/2,y:n.y+n.height/2};let r,i=Number.MAX_VALUE;for(const u of t){const{x:a,y:s}=at(o,u),l=e==="horizontal"?a:s;l<i&&(i=l,r=u)}return M(r,"No rect found"),r}let ve;function Ht(){return ve===void 0&&(typeof matchMedia=="function"?ve=!!matchMedia("(pointer:coarse)").matches:ve=!1),ve}function lt(e){const{element:t,orientation:n,panels:o,separators:r}=e,i=Re(n,Array.from(t.children).filter(it).map(v=>({element:v}))).map(({element:v})=>v),u=[];let a=!1,s=!1,l=-1,c=-1,h=0,f,x=[];{let v=-1;for(const d of i)d.hasAttribute("data-panel")&&(v++,d.hasAttribute("data-disabled")||(h++,l===-1&&(l=v),c=v))}if(h>1){let v=-1;for(const d of i)if(d.hasAttribute("data-panel")){v++;const g=o.find(p=>p.element===d);if(g){if(f){const p=f.element.getBoundingClientRect(),b=d.getBoundingClientRect();let S;if(s){const y=n==="horizontal"?new DOMRect(p.right,p.top,0,p.height):new DOMRect(p.left,p.bottom,p.width,0),m=n==="horizontal"?new DOMRect(b.left,b.top,0,b.height):new DOMRect(b.left,b.top,b.width,0);switch(x.length){case 0:{S=[y,m];break}case 1:{const E=x[0],k=$t({orientation:n,rects:[p,b],targetRect:E.element.getBoundingClientRect()});S=[E,k===p?m:y];break}default:{S=x;break}}}else x.length?S=x:S=[n==="horizontal"?new DOMRect(p.right,b.top,b.left-p.right,b.height):new DOMRect(b.left,p.bottom,b.width,b.top-p.bottom)];for(const y of S){let m="width"in y?y:y.element.getBoundingClientRect();const E=Ht()?e.resizeTargetMinimumSize.coarse:e.resizeTargetMinimumSize.fine;if(m.width<E){const D=E-m.width;m=new DOMRect(m.x-D/2,m.y,m.width+D,m.height)}if(m.height<E){const D=E-m.height;m=new DOMRect(m.x,m.y-D/2,m.width,m.height+D)}const k=v<=l||v>c;!a&&!k&&u.push({group:e,groupSize:de({group:e}),panels:[f,g],separator:"width"in y?void 0:y,rect:m}),a=!1}}s=!1,f=g,x=[]}}else if(d.hasAttribute("data-separator")){d.ariaDisabled!==null&&(a=!0);const g=r.find(p=>p.element===d);g?x.push(g):(f=void 0,x=[])}else s=!0}return u}var _;class ut{constructor(){Ge(this,_,{})}addListener(t,n){const o=fe(this,_)[t];return o===void 0?fe(this,_)[t]=[n]:o.includes(n)||o.push(n),()=>{this.removeListener(t,n)}}emit(t,n){const o=fe(this,_)[t];if(o!==void 0)if(o.length===1)o[0].call(null,n);else{let r=!1,i=null;const u=Array.from(o);for(let a=0;a<u.length;a++){const s=u[a];try{s.call(null,n)}catch(l){i===null&&(r=!0,i=l)}}if(r)throw i}}removeAllListeners(){Be(this,_,{})}removeListener(t,n){const o=fe(this,_)[t];if(o!==void 0){const r=o.indexOf(n);r>=0&&o.splice(r,1)}}}_=new WeakMap;let ue={cursorFlags:0,state:"inactive"};const ke=new ut;function ee(){return ue}function Wt(e){return ke.addListener("change",e)}function Ut(e){const t=ue,n={...ue};n.cursorFlags=e,ue=n,ke.emit("change",{prev:t,next:n})}function ce(e){const t=ue;ue=e,ke.emit("change",{prev:t,next:e})}const Vt=e=>e,Ce=()=>{},ct=1,dt=2,ft=4,pt=8,We=3,Ue=12;let be;function Ve(){return be===void 0&&(be=!1,typeof window<"u"&&(window.navigator.userAgent.includes("Chrome")||window.navigator.userAgent.includes("Firefox"))&&(be=!0)),be}function Yt({cursorFlags:e,groups:t,state:n}){let o=0,r=0;switch(n){case"active":case"hover":t.forEach(i=>{if(!i.mutableState.disableCursor)switch(i.orientation){case"horizontal":{o++;break}case"vertical":{r++;break}}})}if(!(o===0&&r===0)){switch(n){case"active":{if(e&&Ve()){const i=(e&ct)!==0,u=(e&dt)!==0,a=(e&ft)!==0,s=(e&pt)!==0;if(i)return a?"se-resize":s?"ne-resize":"e-resize";if(u)return a?"sw-resize":s?"nw-resize":"w-resize";if(a)return"s-resize";if(s)return"n-resize"}break}}return Ve()?o>0&&r>0?"move":o>0?"ew-resize":"ns-resize":o>0&&r>0?"grab":o>0?"col-resize":"row-resize"}}const Ye=new WeakMap;function Me(e){if(!e.defaultView||!e.adoptedStyleSheets)return;let{prevStyle:t,styleSheet:n}=Ye.get(e)??{};n===void 0&&(n=new e.defaultView.CSSStyleSheet,e.adoptedStyleSheets&&(Object.isExtensible(e.adoptedStyleSheets)?e.adoptedStyleSheets.push(n):e.adoptedStyleSheets=[...e.adoptedStyleSheets,n]));const o=ee();switch(o.state){case"active":case"hover":{const r=Yt({cursorFlags:o.cursorFlags,groups:o.hitRegions.map(u=>u.group),state:o.state}),i=`*, *:hover {cursor: ${r} !important; }`;if(t===i)return;t=i,r?n.cssRules.length===0?n.insertRule(i):n.replaceSync(i):n.cssRules.length===1&&n.deleteRule(0);break}case"inactive":{t=void 0,n.cssRules.length===1&&n.deleteRule(0);break}}Ye.set(e,{prevStyle:t,styleSheet:n})}let U=new Map;const ht=new ut;function qt(e){U=new Map(U),U.delete(e)}function qe(e,t){for(const[n]of U)if(n.id===e)return n}function J(e,t){for(const[n,o]of U)if(n.id===e)return o;if(t)throw Error(`Could not find data for Group with id ${e}`)}function K(){return U}function Ie(e,t){return ht.addListener("groupChange",n=>{n.group.id===e&&t(n)})}function q(e,t,n){const o=U.get(e);U=new Map(U),U.set(e,t),ht.emit("groupChange",{group:e,isUserInteraction:(n==null?void 0:n.isUserInteraction)===!0,prev:o,next:t})}function gt(e){const t=ee(),n=K();let o=!1;switch(t.state){case"active":ce({cursorFlags:0,state:"inactive"}),t.hitRegions.length>0&&(Me(e),o=!0,t.hitRegions.forEach(r=>{if(!n.has(r.group))return;const i=J(r.group.id,!0);q(r.group,i,{isUserInteraction:!0})}))}return o}function Xe(e){e.defaultPrevented||gt(e.currentTarget)}function Xt(e,t,n){let o,r={x:1/0,y:1/0};for(const i of t){const u=at(n,i.rect);switch(e){case"horizontal":{u.x<=r.x&&(o=i,r=u);break}case"vertical":{u.y<=r.y&&(o=i,r=u);break}}}return o?{distance:r,hitRegion:o}:void 0}function _t(e){return e!==null&&typeof e=="object"&&"nodeType"in e&&e.nodeType===Node.DOCUMENT_FRAGMENT_NODE}function Jt(e,t){if(e===t)throw new Error("Cannot compare node with itself");const n={a:Ke(e),b:Ke(t)};let o;for(;n.a.at(-1)===n.b.at(-1);)o=n.a.pop(),n.b.pop();M(o,"Stacking order can only be calculated for elements with a common ancestor");const r={a:Je(_e(n.a)),b:Je(_e(n.b))};if(r.a===r.b){const i=o.childNodes,u={a:n.a.at(-1),b:n.b.at(-1)};let a=i.length;for(;a--;){const s=i[a];if(s===u.a)return 1;if(s===u.b)return-1}}return Math.sign(r.a-r.b)}const Kt=/\b(?:position|zIndex|opacity|transform|webkitTransform|mixBlendMode|filter|webkitFilter|isolation)\b/;function Zt(e){const t=getComputedStyle(mt(e)??e).display;return t==="flex"||t==="inline-flex"}function Qt(e){const t=getComputedStyle(e);return!!(t.position==="fixed"||t.zIndex!=="auto"&&(t.position!=="static"||Zt(e))||+t.opacity<1||"transform"in t&&t.transform!=="none"||"webkitTransform"in t&&t.webkitTransform!=="none"||"mixBlendMode"in t&&t.mixBlendMode!=="normal"||"filter"in t&&t.filter!=="none"||"webkitFilter"in t&&t.webkitFilter!=="none"||"isolation"in t&&t.isolation==="isolate"||Kt.test(t.willChange)||t.webkitOverflowScrolling==="touch")}function _e(e){let t=e.length;for(;t--;){const n=e[t];if(M(n,"Missing node"),Qt(n))return n}return null}function Je(e){return e&&Number(getComputedStyle(e).zIndex)||0}function Ke(e){const t=[];for(;e;)t.push(e),e=mt(e);return t}function mt(e){const{parentNode:t}=e;return _t(t)?t.host:t}function en(e,t){return e.x<t.x+t.width&&e.x+e.width>t.x&&e.y<t.y+t.height&&e.y+e.height>t.y}function tn({groupElement:e,hitRegion:t,pointerEventTarget:n}){if(!it(n)||n.contains(e)||e.contains(n))return!0;if(Jt(n,e)>0){let o=n;for(;o;){if(o.contains(e))return!0;if(en(o.getBoundingClientRect(),t))return!1;o=o.parentElement}}return!0}function De(e,t){const n=[];return t.forEach((o,r)=>{if(r.disabled)return;const i=lt(r),u=Xt(r.orientation,i,{x:e.clientX,y:e.clientY});u&&u.distance.x<=0&&u.distance.y<=0&&tn({groupElement:r.element,hitRegion:u.hitRegion.rect,pointerEventTarget:e.target})&&n.push(u.hitRegion)}),n}function nn(e,t){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!=t[n])return!1;return!0}function A(e,t,n=0){return Math.abs(O(e)-O(t))<=n}function W(e,t){return A(e,t)?0:e>t?1:-1}function le({overrideDisabledPanels:e,panelConstraints:t,prevSize:n,size:o}){const{collapsedSize:r=0,collapsible:i,disabled:u,maxSize:a=100,minSize:s=0}=t;if(u&&!e)return n;if(W(o,s)<0)if(i){const l=(r+s)/2;W(o,l)<0?o=r:o=s}else o=s;return o=Math.min(a,o),o=O(o),o}function ge({delta:e,initialLayout:t,panelConstraints:n,pivotIndices:o,prevLayout:r,trigger:i}){if(A(e,0))return t;const u=i==="imperative-api",a=Object.values(t),s=Object.values(r),l=[...a],[c,h]=o;M(c!=null,"Invalid first pivot index"),M(h!=null,"Invalid second pivot index");let f=0;switch(i){case"keyboard":{{const d=e<0?h:c,g=n[d];M(g,`Panel constraints not found for index ${d}`);const{collapsedSize:p=0,collapsible:b,minSize:S=0}=g;if(b){const y=a[d];if(M(y!=null,`Previous layout not found for panel index ${d}`),A(y,p)){const m=S-y;W(m,Math.abs(e))>0&&(e=e<0?0-m:m)}}}{const d=e<0?c:h,g=n[d];M(g,`No panel constraints found for index ${d}`);const{collapsedSize:p=0,collapsible:b,minSize:S=0}=g;if(b){const y=a[d];if(M(y!=null,`Previous layout not found for panel index ${d}`),A(y,S)){const m=y-p;W(m,Math.abs(e))>0&&(e=e<0?0-m:m)}}}break}default:{const d=e<0?h:c,g=n[d];M(g,`Panel constraints not found for index ${d}`);const p=a[d],{collapsible:b,collapsedSize:S,minSize:y}=g;if(b&&W(p,y)<0)if(e>0){const m=y-S,E=m/2,k=p+e;W(k,y)<0&&(e=W(e,E)<=0?0:m)}else{const m=y-S,E=100-m/2,k=p-e;W(k,y)<0&&(e=W(100+e,E)>0?0:-m)}break}}{const d=e<0?1:-1;let g=e<0?h:c,p=0;for(;;){const S=a[g];M(S!=null,`Previous layout not found for panel index ${g}`);const y=le({overrideDisabledPanels:u,panelConstraints:n[g],prevSize:S,size:100})-S;if(p+=y,g+=d,g<0||g>=n.length)break}const b=Math.min(Math.abs(e),Math.abs(p));e=e<0?0-b:b}{let d=e<0?c:h;for(;d>=0&&d<n.length;){const g=Math.abs(e)-Math.abs(f),p=a[d];M(p!=null,`Previous layout not found for panel index ${d}`);const b=p-g,S=le({overrideDisabledPanels:u,panelConstraints:n[d],prevSize:p,size:b});if(!A(p,S)&&(f+=p-S,l[d]=S,f.toFixed(3).localeCompare(Math.abs(e).toFixed(3),void 0,{numeric:!0})>=0))break;e<0?d--:d++}}if(nn(s,l))return r;{const d=e<0?h:c,g=a[d];M(g!=null,`Previous layout not found for panel index ${d}`);const p=g+f,b=le({overrideDisabledPanels:u,panelConstraints:n[d],prevSize:g,size:p});if(l[d]=b,!A(b,p)){let S=p-b,y=e<0?h:c;for(;y>=0&&y<n.length;){const m=l[y];M(m!=null,`Previous layout not found for panel index ${y}`);const E=m+S,k=le({overrideDisabledPanels:u,panelConstraints:n[y],prevSize:m,size:E});if(A(m,k)||(S-=k-m,l[y]=k),A(S,0))break;e>0?y--:y++}}}const x=Object.values(l).reduce((d,g)=>g+d,0);if(!A(x,100,.1))return r;const v=Object.keys(r);return l.reduce((d,g,p)=>(d[v[p]]=g,d),{})}function te(e,t){if(Object.keys(e).length!==Object.keys(t).length)return!1;for(const n in e)if(t[n]===void 0||W(e[n],t[n])!==0)return!1;return!0}function ne({layout:e,panelConstraints:t}){const n=Object.values(e),o=[...n],r=o.reduce((a,s)=>a+s,0);if(o.length!==t.length)throw Error(`Invalid ${t.length} panel layout: ${o.map(a=>`${a}%`).join(", ")}`);if(!A(r,100)&&o.length>0)for(let a=0;a<t.length;a++){const s=o[a];M(s!=null,`No layout data found for index ${a}`);const l=100/r*s;o[a]=l}let i=0;for(let a=0;a<t.length;a++){const s=n[a];M(s!=null,`No layout data found for index ${a}`);const l=o[a];M(l!=null,`No layout data found for index ${a}`);const c=le({overrideDisabledPanels:!0,panelConstraints:t[a],prevSize:s,size:l});l!=c&&(i+=l-c,o[a]=c)}if(!A(i,0))for(let a=0;a<t.length;a++){const s=o[a];M(s!=null,`No layout data found for index ${a}`);const l=s+i,c=le({overrideDisabledPanels:!0,panelConstraints:t[a],prevSize:s,size:l});if(s!==c&&(i-=c-s,o[a]=c,A(i,0)))break}const u=Object.keys(e);return o.reduce((a,s,l)=>(a[u[l]]=s,a),{})}function vt({groupId:e,panelId:t}){const n=()=>{const s=K();for(const[l,{defaultLayoutDeferred:c,derivedPanelConstraints:h,layout:f,groupSize:x,separatorToPanels:v}]of s)if(l.id===e)return{defaultLayoutDeferred:c,derivedPanelConstraints:h,group:l,groupSize:x,layout:f,separatorToPanels:v};throw Error(`Group ${e} not found`)},o=()=>{const s=n().derivedPanelConstraints.find(l=>l.panelId===t);if(s!==void 0)return s;throw Error(`Panel constraints not found for Panel ${t}`)},r=()=>{const s=n().group.panels.find(l=>l.id===t);if(s!==void 0)return s;throw Error(`Layout not found for Panel ${t}`)},i=()=>{const s=n().layout[t];if(s!==void 0)return s;throw Error(`Layout not found for Panel ${t}`)},u=({nextSize:s,panels:l,prevLayout:c,derivedPanelConstraints:h})=>{const f=i(),x=l.findIndex(g=>g.id===t),v=x===0,d=x===l.length-1;if(d&&s<f&&(v||l.slice(0,x).every((g,p)=>{const b=h[p];return(b==null?void 0:b.collapsible)&&A(b.collapsedSize,c[b.panelId])}))){const g=l.slice(0,x).reduce((p,b)=>p+c[b.id],0);return{...c,[t]:O(100-g)}}return ge({delta:d?f-s:s-f,initialLayout:c,panelConstraints:h,pivotIndices:d?[x-1,x]:[x,x+1],prevLayout:c,trigger:"imperative-api"})},a=s=>{const l=i();if(s===l)return;const{defaultLayoutDeferred:c,derivedPanelConstraints:h,group:f,groupSize:x,layout:v,separatorToPanels:d}=n(),g=u({nextSize:s,panels:f.panels,prevLayout:v,derivedPanelConstraints:h}),p=ne({layout:g,panelConstraints:h});te(v,p)||q(f,{defaultLayoutDeferred:c,derivedPanelConstraints:h,groupSize:x,layout:p,separatorToPanels:d})};return{collapse:()=>{const{collapsible:s,collapsedSize:l}=o(),{mutableValues:c}=r(),h=i();s&&h!==l&&(c.expandToSize=h,a(l))},expand:()=>{const{collapsible:s,collapsedSize:l,minSize:c}=o(),{mutableValues:h}=r(),f=i();if(s&&f===l){let x=h.expandToSize??c;x===0&&(x=1),a(x)}},getSize:()=>{const{group:s}=n(),l=i(),{element:c}=r(),h=s.orientation==="horizontal"?c.offsetWidth:c.offsetHeight;return{asPercentage:l,inPixels:h}},isCollapsed:()=>{const{collapsible:s,collapsedSize:l}=o(),c=i();return s&&A(l,c)},resize:s=>{const{group:l}=n(),{element:c}=r(),h=de({group:l}),f=pe({groupSize:h,panelElement:c,styleProp:s}),x=O(f/h*100);a(x)}}}function Ze(e){if(e.defaultPrevented)return;const t=K();De(e,t).forEach(n=>{if(n.separator&&!n.separator.disableDoubleClick){const o=n.panels.find(r=>r.panelConstraints.defaultSize!==void 0);if(o){const r=o.panelConstraints.defaultSize,i=vt({groupId:n.group.id,panelId:o.id});i&&r!==void 0&&(i.resize(r),e.preventDefault())}}})}function ye(e){const t=K();for(const[n]of t)if(n.separators.some(o=>o.element===e))return n;throw Error("Could not find parent Group for separator element")}function bt({groupId:e}){const t=()=>{const n=K();for(const[o,r]of n)if(o.id===e)return{group:o,...r};throw Error(`Could not find Group with id "${e}"`)};return{getLayout(){const{defaultLayoutDeferred:n,layout:o}=t();return n?{}:o},setLayout(n){const{defaultLayoutDeferred:o,derivedPanelConstraints:r,group:i,groupSize:u,layout:a,separatorToPanels:s}=t(),l=ne({layout:n,panelConstraints:r});return o?a:(te(a,l)||q(i,{defaultLayoutDeferred:o,derivedPanelConstraints:r,groupSize:u,layout:l,separatorToPanels:s}),l)}}}function Q(e,t){const n=ye(e),o=J(n.id,!0),r=n.separators.find(c=>c.element===e);M(r,"Matching separator not found");const i=o.separatorToPanels.get(r);M(i,"Matching panels not found");const u=i.map(c=>n.panels.indexOf(c)),a=bt({groupId:n.id}).getLayout(),s=ge({delta:t,initialLayout:a,panelConstraints:o.derivedPanelConstraints,pivotIndices:u,prevLayout:a,trigger:"keyboard"}),l=ne({layout:s,panelConstraints:o.derivedPanelConstraints});te(a,l)||q(n,{defaultLayoutDeferred:o.defaultLayoutDeferred,derivedPanelConstraints:o.derivedPanelConstraints,groupSize:o.groupSize,layout:l,separatorToPanels:o.separatorToPanels},{isUserInteraction:!0})}function Qe(e){if(e.defaultPrevented)return;const t=e.currentTarget,n=ye(t);if(!n.disabled)switch(e.key){case"ArrowDown":{e.preventDefault(),n.orientation==="vertical"&&Q(t,5);break}case"ArrowLeft":{e.preventDefault(),n.orientation==="horizontal"&&Q(t,-5);break}case"ArrowRight":{e.preventDefault(),n.orientation==="horizontal"&&Q(t,5);break}case"ArrowUp":{e.preventDefault(),n.orientation==="vertical"&&Q(t,-5);break}case"End":{e.preventDefault(),Q(t,100);break}case"Enter":{e.preventDefault();const o=ye(t),r=J(o.id,!0),{derivedPanelConstraints:i,layout:u,separatorToPanels:a}=r,s=o.separators.find(f=>f.element===t);M(s,"Matching separator not found");const l=a.get(s);M(l,"Matching panels not found");const c=l[0],h=i.find(f=>f.panelId===c.id);if(M(h,"Panel metadata not found"),h.collapsible){const f=u[c.id],x=h.collapsedSize===f?o.mutableState.expandedPanelSizes[c.id]??h.minSize:h.collapsedSize;Q(t,x-f)}break}case"F6":{e.preventDefault();const o=ye(t).separators.map(u=>u.element),r=Array.from(o).findIndex(u=>u===e.currentTarget);M(r!==null,"Index not found");const i=e.shiftKey?r>0?r-1:o.length-1:r+1<o.length?r+1:0;o[i].focus({preventScroll:!0});break}case"Home":{e.preventDefault(),Q(t,-100);break}}}function et(e){if(e.defaultPrevented||e.pointerType==="mouse"&&e.button>0)return;const t=K(),n=De(e,t),o=new Map;let r=!1;n.forEach(i=>{i.separator&&(r||(r=!0,i.separator.element.focus({focusVisible:!1,preventScroll:!0})));const u=t.get(i.group);u&&o.set(i.group,u.layout)}),ce({cursorFlags:0,hitRegions:n,initialLayoutMap:o,pointerDownAtPoint:{x:e.clientX,y:e.clientY},state:"active"}),n.length&&e.preventDefault()}function yt({document:e,event:t,hitRegions:n,initialLayoutMap:o,mountedGroups:r,pointerDownAtPoint:i,prevCursorFlags:u}){let a=0;n.forEach(l=>{const{group:c,groupSize:h}=l,{orientation:f,panels:x}=c,{disableCursor:v}=c.mutableState;let d=0;i?f==="horizontal"?d=(t.clientX-i.x)/h*100:d=(t.clientY-i.y)/h*100:f==="horizontal"?d=t.clientX<0?-100:100:d=t.clientY<0?-100:100;const g=o.get(c),p=r.get(c);if(!g||!p)return;const{defaultLayoutDeferred:b,derivedPanelConstraints:S,groupSize:y,layout:m,separatorToPanels:E}=p;if(S&&m&&E){const k=ge({delta:d,initialLayout:g,panelConstraints:S,pivotIndices:l.panels.map(D=>x.indexOf(D)),prevLayout:m,trigger:"mouse-or-touch"});if(te(k,m)){if(d!==0&&!v)switch(f){case"horizontal":{a|=d<0?ct:dt;break}case"vertical":{a|=d<0?ft:pt;break}}}else q(l.group,{defaultLayoutDeferred:b,derivedPanelConstraints:S,groupSize:y,layout:k,separatorToPanels:E})}});let s=0;t.movementX===0?s|=u&We:s|=a&We,t.movementY===0?s|=u&Ue:s|=a&Ue,Ut(s),Me(e)}function tt(e){const t=K(),n=ee();switch(n.state){case"active":yt({document:e.currentTarget,event:e,hitRegions:n.hitRegions,initialLayoutMap:n.initialLayoutMap,mountedGroups:t,prevCursorFlags:n.cursorFlags})}}function nt(e){var o,r;if(e.defaultPrevented)return;const t=ee(),n=K();switch(t.state){case"active":{if(e.buttons===0){ce({cursorFlags:0,state:"inactive"}),t.hitRegions.forEach(i=>{if(!n.has(i.group))return;const u=J(i.group.id,!0);q(i.group,u,{isUserInteraction:!0})});return}for(const i of t.hitRegions)if(i.separator){const{element:u}=i.separator;(o=u.hasPointerCapture)!=null&&o.call(u,e.pointerId)||((r=u.setPointerCapture)==null||r.call(u,e.pointerId))}yt({document:e.currentTarget,event:e,hitRegions:t.hitRegions,initialLayoutMap:t.initialLayoutMap,mountedGroups:n,pointerDownAtPoint:t.pointerDownAtPoint,prevCursorFlags:t.cursorFlags});break}default:{const i=De(e,n);i.length===0?t.state!=="inactive"&&ce({cursorFlags:0,state:"inactive"}):ce({cursorFlags:0,hitRegions:i,state:"hover"}),Me(e.currentTarget);break}}}function ot(e){if(e.relatedTarget instanceof HTMLIFrameElement)switch(ee().state){case"hover":ce({cursorFlags:0,state:"inactive"})}}function rt(e){e.defaultPrevented||e.pointerType==="mouse"&&e.button>0||gt(e.currentTarget)&&e.preventDefault()}function st(e){let t=0,n=0;const o={};for(const i of e)if(i.defaultSize!==void 0){t++;const u=O(i.defaultSize);n+=u,o[i.panelId]=u}else o[i.panelId]=void 0;const r=e.length-t;if(r!==0){const i=O((100-n)/r);for(const u of e)u.defaultSize===void 0&&(o[u.panelId]=i)}return o}function on(e,t,n){if(!n[0])return;const o=e.panels.find(s=>s.element===t);if(!o||!o.onResize)return;const r=de({group:e}),i=e.orientation==="horizontal"?o.element.offsetWidth:o.element.offsetHeight,u=o.mutableValues.prevSize,a={asPercentage:O(i/r*100),inPixels:i};o.mutableValues.prevSize=a,o.onResize(a,o.id,u)}function rn(e,t){if(Object.keys(e).length!==Object.keys(t).length)return!1;for(const n in e)if(e[n]!==t[n])return!1;return!0}function sn(e,t){return e.length!==t.length?!1:e.every((n,o)=>rn(n,t[o]))}function an({group:e,nextGroupSize:t,prevGroupSize:n,prevLayout:o}){if(n<=0||t<=0||n===t)return o;let r=0,i=0,u=!1;const a=new Map,s=[];for(const h of e.panels){const f=o[h.id]??0;switch(h.panelConstraints.groupResizeBehavior){case"preserve-pixel-size":{u=!0;const x=f/100*n,v=O(x/t*100);a.set(h.id,v),r+=v;break}case"preserve-relative-size":default:{s.push(h.id),i+=f;break}}}if(!u||s.length===0)return o;const l=100-r,c={...o};if(a.forEach((h,f)=>{c[f]=h}),i>0)for(const h of s){const f=o[h]??0;c[h]=O(f/i*l)}else{const h=O(l/s.length);for(const f of s)c[f]=h}return c}function ln(e,t){const n=e.map(r=>r.id),o=Object.keys(t);if(n.length!==o.length)return!1;for(const r of n)if(!o.includes(r))return!1;return!0}const ae=new Map;function un(e){let t=!0;M(e.element.ownerDocument.defaultView,"Cannot register an unmounted Group");const n=e.element.ownerDocument.defaultView.ResizeObserver,o=new Set,r=new Set,i=new n(v=>{for(const d of v){const{borderBoxSize:g,target:p}=d;if(p===e.element){if(t){const b=de({group:e});if(b===0)return;const S=J(e.id);if(!S)return;const y=Pe(e),m=S.defaultLayoutDeferred?st(y):S.layout,E=an({group:e,nextGroupSize:b,prevGroupSize:S.groupSize,prevLayout:m}),k=ne({layout:E,panelConstraints:y});if(!S.defaultLayoutDeferred&&te(S.layout,k)&&sn(S.derivedPanelConstraints,y)&&S.groupSize===b)continue;q(e,{defaultLayoutDeferred:!1,derivedPanelConstraints:y,groupSize:b,layout:k,separatorToPanels:S.separatorToPanels})}}else on(e,p,g)}});i.observe(e.element),e.panels.forEach(v=>{M(!o.has(v.id),`Panel ids must be unique; id "${v.id}" was used more than once`),o.add(v.id),v.onResize&&i.observe(v.element)});const u=de({group:e}),a=Pe(e),s=e.panels.map(({id:v})=>v).join(",");let l=e.mutableState.defaultLayout;l&&(ln(e.panels,l)||(l=void 0));const c=e.mutableState.layouts[s]??l??st(a),h=ne({layout:c,panelConstraints:a}),f=e.element.ownerDocument;ae.set(f,(ae.get(f)??0)+1);const x=new Map;return lt(e).forEach(v=>{v.separator&&x.set(v.separator,v.panels)}),q(e,{defaultLayoutDeferred:u===0,derivedPanelConstraints:a,groupSize:u,layout:h,separatorToPanels:x}),e.separators.forEach(v=>{M(!r.has(v.id),`Separator ids must be unique; id "${v.id}" was used more than once`),r.add(v.id),v.element.addEventListener("keydown",Qe)}),ae.get(f)===1&&(f.addEventListener("contextmenu",Xe,!0),f.addEventListener("dblclick",Ze,!0),f.addEventListener("pointerdown",et,!0),f.addEventListener("pointerleave",tt),f.addEventListener("pointermove",nt),f.addEventListener("pointerout",ot),f.addEventListener("pointerup",rt,!0)),function(){t=!1,ae.set(f,Math.max(0,(ae.get(f)??0)-1)),qt(e),e.separators.forEach(v=>{v.element.removeEventListener("keydown",Qe)}),ae.get(f)||(f.removeEventListener("contextmenu",Xe,!0),f.removeEventListener("dblclick",Ze,!0),f.removeEventListener("pointerdown",et,!0),f.removeEventListener("pointerleave",tt),f.removeEventListener("pointermove",nt),f.removeEventListener("pointerout",ot),f.removeEventListener("pointerup",rt,!0)),i.disconnect()}}function cn(){const[e,t]=w.useState({}),n=w.useCallback(()=>t({}),[]);return[e,n]}function Te(e){const t=w.useId();return`${e??t}`}const oe=typeof window<"u"?w.useLayoutEffect:w.useEffect;function he(e){const t=w.useRef(e);return oe(()=>{t.current=e},[e]),w.useCallback((...n)=>{var o;return(o=t.current)==null?void 0:o.call(t,...n)},[t])}function Ne(...e){return he(t=>{e.forEach(n=>{if(n)switch(typeof n){case"function":{n(t);break}case"object":{n.current=t;break}}})})}function je(e){const t=w.useRef({...e});return oe(()=>{for(const n in e)t.current[n]=e[n]},[e]),t.current}const St=w.createContext(null);function dn(e,t){const n=w.useRef({getLayout:()=>({}),setLayout:Vt});w.useImperativeHandle(t,()=>n.current,[]),oe(()=>{Object.assign(n.current,bt({groupId:e}))})}function xt({children:e,className:t,defaultLayout:n,disableCursor:o,disabled:r,elementRef:i,groupRef:u,id:a,onLayoutChange:s,onLayoutChanged:l,orientation:c="horizontal",resizeTargetMinimumSize:h={coarse:20,fine:10},style:f,...x}){const v=w.useRef({onLayoutChange:{},onLayoutChanged:{}}),d=he(C=>{te(v.current.onLayoutChange,C)||(v.current.onLayoutChange=C,s==null||s(C))}),g=he((C,z)=>{te(v.current.onLayoutChanged,C)||(v.current.onLayoutChanged=C,l==null||l(C,{isUserInteraction:z}))}),p=Te(a),b=w.useRef(null),[S,y]=cn(),m=w.useRef({lastExpandedPanelSizes:{},layouts:{},panels:[],resizeTargetMinimumSize:h,separators:[]}),E=Ne(b,i);dn(p,u);const k=he((C,z)=>{const I=ee(),R=qe(C),T=J(C);if(T){let G=!1;switch(I.state){case"active":{G=I.hitRegions.some(V=>V.group===R);break}}return{flexGrow:T.layout[z]??1,pointerEvents:G?"none":void 0}}if(n!=null&&n[z])return{flexGrow:n==null?void 0:n[z]}}),D=je({defaultLayout:n,disableCursor:o}),N=w.useMemo(()=>({get disableCursor(){return!!D.disableCursor},getPanelStyles:k,id:p,orientation:c,registerPanel:C=>{const z=m.current;return z.panels=Re(c,[...z.panels,C]),y(),()=>{z.panels=z.panels.filter(I=>I!==C),y()}},registerSeparator:C=>{const z=m.current;return z.separators=Re(c,[...z.separators,C]),y(),()=>{z.separators=z.separators.filter(I=>I!==C),y()}},updatePanelProps:(C,{disabled:z})=>{const I=m.current.panels.find(G=>G.id===C);I&&(I.panelConstraints.disabled=z);const R=qe(p),T=J(p);R&&T&&q(R,{...T,derivedPanelConstraints:Pe(R)})},updateSeparatorProps:(C,{disabled:z,disableDoubleClick:I})=>{const R=m.current.separators.find(T=>T.id===C);R&&(R.disabled=z,R.disableDoubleClick=I)}}),[k,p,y,c,D]),B=w.useRef(null);return oe(()=>{const C=b.current;if(C===null)return;const z=m.current;let I;if(D.defaultLayout!==void 0&&Object.keys(D.defaultLayout).length===z.panels.length){I={};for(const H of z.panels){const X=D.defaultLayout[H.id];X!==void 0&&(I[H.id]=X)}}const R={disabled:!!r,element:C,id:p,mutableState:{defaultLayout:I,disableCursor:!!D.disableCursor,expandedPanelSizes:m.current.lastExpandedPanelSizes,layouts:m.current.layouts},orientation:c,panels:z.panels,resizeTargetMinimumSize:z.resizeTargetMinimumSize,separators:z.separators};B.current=R;const T=un(R),{defaultLayoutDeferred:G,derivedPanelConstraints:V,layout:Y}=J(R.id,!0);!G&&V.length>0&&(d(Y),g(Y,!1));const Z=Ie(p,H=>{const{defaultLayoutDeferred:X,derivedPanelConstraints:j,layout:re}=H.next;if(X||j.length===0)return;const me=R.panels.map(({id:$})=>$).join(",");R.mutableState.layouts[me]=re,j.forEach($=>{if($.collapsible){const{layout:se}=H.prev??{};if(se){const xe=A($.collapsedSize,re[$.panelId]),ze=A($.collapsedSize,se[$.panelId]);xe&&!ze&&(R.mutableState.expandedPanelSizes[$.panelId]=se[$.panelId])}}});const Se=ee().state!=="active";d(re),Se&&g(re,H.isUserInteraction)});return()=>{B.current=null,T(),Z()}},[r,p,g,d,c,S,D]),w.useEffect(()=>{const C=B.current;C&&(C.mutableState.defaultLayout=n,C.mutableState.disableCursor=!!o)}),P.jsx(St.Provider,{value:N,children:P.jsx("div",{...x,className:t,"data-group":!0,"data-testid":p,id:p,ref:E,style:{height:"100%",width:"100%",overflow:"hidden",...f,display:"flex",flexDirection:c==="horizontal"?"row":"column",flexWrap:"nowrap",touchAction:c==="horizontal"?"pan-y":"pan-x"},children:e})})}xt.displayName="Group";function Ae(){const e=w.useContext(St);return M(e,"Group Context not found; did you render a Panel or Separator outside of a Group?"),e}function fn(e,t){const{id:n}=Ae(),o=w.useRef({collapse:Ce,expand:Ce,getSize:()=>({asPercentage:0,inPixels:0}),isCollapsed:()=>!1,resize:Ce});w.useImperativeHandle(t,()=>o.current,[]),oe(()=>{Object.assign(o.current,vt({groupId:n,panelId:e}))})}function Ee({children:e,className:t,collapsedSize:n="0%",collapsible:o=!1,defaultSize:r,disabled:i,elementRef:u,groupResizeBehavior:a="preserve-relative-size",id:s,maxSize:l="100%",minSize:c="0%",onResize:h,panelRef:f,style:x,...v}){const d=!!s,g=Te(s),p=je({disabled:i}),b=w.useRef(null),S=Ne(b,u),{getPanelStyles:y,id:m,orientation:E,registerPanel:k,updatePanelProps:D}=Ae(),N=h!==null,B=he((R,T,G)=>{h==null||h(R,s,G)});oe(()=>{const R=b.current;if(R!==null){const T={element:R,id:g,idIsStable:d,mutableValues:{expandToSize:void 0,prevSize:void 0},onResize:N?B:void 0,panelConstraints:{groupResizeBehavior:a,collapsedSize:n,collapsible:o,defaultSize:r,disabled:p.disabled,maxSize:l,minSize:c}};return k(T)}},[a,n,o,r,N,g,d,l,c,B,k,p]),w.useEffect(()=>{D(g,{disabled:i})},[i,g,D]),fn(g,f);const C=()=>{const R=y(m,g);if(R)return JSON.stringify(R)},z=w.useSyncExternalStore(R=>Ie(m,R),C,C);let I;return z?I=JSON.parse(z):r!==void 0?I={flexGrow:void 0,flexShrink:void 0,flexBasis:r}:I={flexGrow:1},P.jsx("div",{...v,"data-disabled":i||void 0,"data-panel":!0,"data-testid":g,id:g,ref:S,style:{...pn,display:"flex",flexBasis:0,flexShrink:1,overflow:"visible",...I},children:P.jsx("div",{className:t,style:{maxHeight:"100%",maxWidth:"100%",flexGrow:1,overflow:"auto",...x,touchAction:E==="horizontal"?"pan-y":"pan-x"},children:e})})}Ee.displayName="Panel";const pn={minHeight:0,maxHeight:"100%",height:"auto",minWidth:0,maxWidth:"100%",width:"auto",border:"none",borderWidth:0,padding:0,margin:0};function hn({layout:e,panelConstraints:t,panelId:n,panelIndex:o}){let r,i;const u=e[n],a=t.find(s=>s.panelId===n);if(a){const s=a.maxSize,l=a.collapsible?a.collapsedSize:a.minSize,c=[o,o+1];i=ne({layout:ge({delta:l-u,initialLayout:e,panelConstraints:t,pivotIndices:c,prevLayout:e}),panelConstraints:t})[n],r=ne({layout:ge({delta:s-u,initialLayout:e,panelConstraints:t,pivotIndices:c,prevLayout:e}),panelConstraints:t})[n]}return{valueControls:n,valueMax:r,valueMin:i,valueNow:u}}function zt({children:e,className:t,disabled:n,disableDoubleClick:o,elementRef:r,id:i,style:u,...a}){const s=Te(i),l=je({disabled:n,disableDoubleClick:o}),[c,h]=w.useState({}),[f,x]=w.useState("inactive"),[v,d]=w.useState(!1),g=w.useRef(null),p=Ne(g,r),{disableCursor:b,id:S,orientation:y,registerSeparator:m,updateSeparatorProps:E}=Ae(),k=y==="horizontal"?"vertical":"horizontal";oe(()=>{const B=g.current;if(B!==null){const C={disabled:l.disabled,disableDoubleClick:l.disableDoubleClick,element:B,id:s},z=m(C),I=Wt(T=>{x(T.next.state!=="inactive"&&T.next.hitRegions.some(G=>G.separator===C)?T.next.state:"inactive")}),R=Ie(S,T=>{const{derivedPanelConstraints:G,layout:V,separatorToPanels:Y}=T.next,Z=Y.get(C);if(Z){const H=Z[0],X=Z.indexOf(H);h(hn({layout:V,panelConstraints:G,panelId:H.id,panelIndex:X}))}});return()=>{I(),R(),z()}}},[S,s,m,l]),w.useEffect(()=>{E(s,{disabled:n,disableDoubleClick:o})},[n,o,s,E]);let D;n&&!b&&(D="not-allowed");let N;if(n)N="disabled";else switch(f){case"active":{N="active";break}default:v?N="focus":N=f}return P.jsx("div",{...a,"aria-controls":c.valueControls,"aria-disabled":n||void 0,"aria-orientation":k,"aria-valuemax":c.valueMax,"aria-valuemin":c.valueMin,"aria-valuenow":c.valueNow,children:e,className:t,"data-separator":N,"data-testid":s,id:s,onBlur:()=>d(!1),onFocus:()=>d(!0),ref:p,role:"separator",style:{flexBasis:"auto",cursor:D,...u,flexGrow:0,flexShrink:0,touchAction:"none"},tabIndex:n?void 0:0})}zt.displayName="Separator";async function gn({fetchPage:e}){const t=[];let n;do{const o=await e(n);t.push(...o.data),n=o.nextPageToken}while(n!=null&&n.length>0);return t}function Le(e){var n;const t=(n=e.title)==null?void 0:n.trim();return t!=null&&t.length>0?t:"Untitled session"}function mn(e){return"isMutable"in e&&typeof Reflect.get(e,"isMutable")=="boolean"?Reflect.get(e,"isMutable")===!0:e.agentName==null}function vn(e){return"sourceType"in e&&Reflect.get(e,"sourceType")==="schedule"?"schedule":void 0}function xn({agentId:e,startTimestamp:t,endTimestamp:n,shareView:o}){const r=Ct(),i=Lt(),u=Pt(),a=Rt(),{sessionId:s,updateShareSearch:l}=Et(),{allows:c}=kt({resourceType:"session",resourceIds:s==null?[]:[s]}),h=c(s,"MANAGE"),f=we("AgentSessionListRow"),x=we("AgentSessionDetailHeader"),v=we("AgentSessionTimelineContainer"),[d,g]=w.useState([]),[p,b]=w.useState(),[S,y]=w.useState(!0),[m,E]=w.useState(!1),[k,D]=w.useState(!1),N=w.useRef(0),[B,C]=w.useState(),[z,I]=w.useState(),[R,T]=w.useState(!1),[G,V]=w.useState(!1),Y=w.useMemo(()=>({order:"desc",limit:20,...e==null||e.length===0?{}:{agentId:e},...t==null?{}:{startTimestamp:t},...n==null?{}:{endTimestamp:n}}),[e,n,t]);w.useEffect(()=>{const L=++N.current;let F=!1;return y(!0),E(!1),D(!1),r.listSessions(Y).then(ie=>{F||N.current!==L||(g(ie.data),b(ie.nextPageToken))}).catch(()=>{F||N.current!==L||(g([]),b(void 0),D(!0))}).finally(()=>{!F&&N.current===L&&y(!1)}),()=>{F=!0}},[Y,r]);const Z=w.useCallback(async()=>{if(p==null||m)return;const L=N.current;E(!0);try{const F=await r.listSessions({...Y,pageToken:p});if(N.current!==L)return;g(ie=>[...ie,...F.data]),b(F.nextPageToken)}catch{}finally{N.current===L&&E(!1)}},[m,Y,p,r]);w.useEffect(()=>{if(s==null||s.length===0){C(void 0),I(void 0),V(!1),T(!1);return}let L=!1;return T(!0),V(!1),C(void 0),I(void 0),Promise.all([gn({fetchPage:F=>r.listSessionEvents({sessionId:s,limit:100,...F==null?{}:{pageToken:F}})}),i.getSession({sessionId:s}).catch(()=>{})]).then(([F,ie])=>{L||(C([...F].reverse()),I(ie))}).catch(()=>{L||V(!0)}).finally(()=>{L||T(!1)}),()=>{L=!0}},[i,s,r]);const H=L=>{const F=o==="sessions"?Tt(L.createdAt):null;l({sessionId:L.id,...o==="sessions"?{view:"sessions",...F==null?{}:{timeRange:F}}:{agentId:e??null,tab:"sessions",view:null,timeRange:null}})},X=()=>{s!=null&&l({sessionId:null})},j=d.find(L=>L.id===s),re=z!=null?Le(z):j!=null?Le(j):s??"Untitled session",me=z!=null?$e(z):j!=null?$e(j):!1,Se=z!=null?z.isMutable:j!=null?mn(j):!0,$=me?"Resume Agent building":"Resume Chat",se=s!=null&&a!=null?wt({sessionId:s,routes:a}):null,xe=()=>{if(!h||s==null||u==null)return;const L=(z==null?void 0:z.agentName)??(j==null?void 0:j.agentName);u.openHistorySession({sessionId:s,isMutable:Se,isCreateAgent:me,...L!=null&&L.length>0?{agentName:L}:{}})},ze=se!=null?{resumeHref:se,resumeLabel:$}:u!=null?{onResume:xe,resumeLabel:$}:{};return!S&&!k&&d.length===0&&(s==null||s.length===0)?P.jsx(Mt,{title:"No Sessions Found",description:"There are no sessions available at the moment.",className:"bg-primary-bg"}):P.jsxs(xt,{id:"agent-sessions-split",orientation:"horizontal",className:"h-full min-h-0 w-full",resizeTargetMinimumSize:{coarse:24,fine:11},children:[P.jsx(Ee,{id:"agent-sessions-list",defaultSize:"35%",minSize:"20%",maxSize:"50%",children:P.jsxs("aside",{className:"flex h-full min-h-0 w-full flex-col bg-sidebar-bg",children:[P.jsx("div",{className:"scrollbar-none min-h-0 flex-1 overflow-y-auto",children:S?P.jsx("div",{className:"space-y-2 p-3",role:"status","aria-label":"Loading sessions",children:["a","b","c"].map(L=>P.jsx(He,{className:"h-16 rounded-md"},L))}):k?P.jsx("p",{className:"px-3 py-6 text-center text-xs text-text-secondary",children:"Sessions could not be loaded."}):d.map(L=>P.jsx(f,{title:Le(L),agentName:L.agentName??void 0,sourceType:vn(L),lastActivityAt:L.lastActivityAt,metrics:L.metrics,active:L.id===s,onSelect:()=>H(L)},L.id))}),p!=null&&!S?P.jsx("div",{className:"shrink-0 border-t border-border p-3",children:P.jsx("button",{type:"button",disabled:m,onClick:()=>void Z(),className:"h-8 w-full rounded-md border border-border text-xs font-medium text-text-primary hover:bg-ghost-button-hover disabled:opacity-60",children:m?"Loading…":"Load more"})}):null]})}),P.jsxs(zt,{id:"agent-sessions-resizer","aria-label":"Resize session list",className:"group/resizer relative z-10 w-0 cursor-col-resize focus-visible:outline-none",children:[P.jsx("div",{"aria-hidden":!0,className:"absolute inset-y-0 -left-1.25 w-2.75"}),P.jsx("div",{"aria-hidden":!0,className:"absolute inset-y-0 left-0 w-px bg-border transition-colors"}),P.jsx("div",{"aria-hidden":!0,className:Dt("absolute top-1/2 left-0 z-10 flex h-4 w-2 -translate-x-1/2 -translate-y-1/2 items-center justify-center rounded-xs shadow-sm transition-colors","bg-secondary-button-bg text-text-secondary","group-hover/resizer:bg-primary-button-bg group-hover/resizer:text-primary-button-text","group-active/resizer:bg-primary-button-bg group-active/resizer:text-primary-button-text","group-focus-visible/resizer:bg-primary-button-bg group-focus-visible/resizer:text-primary-button-text"),children:P.jsx(It,{name:"grip-vertical",size:10})})]}),P.jsx(Ee,{id:"agent-session-detail",defaultSize:"65%",minSize:"30%",children:P.jsx("section",{className:"flex h-full min-w-0 flex-col bg-primary-bg",children:s==null?P.jsx("div",{className:"flex flex-1 items-center justify-center px-6 text-sm text-text-secondary",children:"Select a session to view details"}):G?P.jsx("div",{className:"flex flex-1 items-center justify-center px-6 text-sm text-text-secondary",children:"Session details could not be loaded."}):P.jsxs(P.Fragment,{children:[P.jsx(x,{title:re,sessionId:s,agentId:e,createdAt:(z==null?void 0:z.createdAt)??(j==null?void 0:j.createdAt),view:o,onClose:X,canResume:h,...ze}),R||B===void 0?P.jsx("div",{className:"flex flex-1 flex-col p-4",role:"status","aria-label":"Loading session details",children:P.jsx(He,{className:"min-h-64 flex-1 rounded-lg"})}):P.jsx(v,{sessionId:s,events:B,listMetrics:j==null?void 0:j.metrics})]})})})]})}export{xn as AgentSessions};
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{aD as H,D as V,r,aE as B,j as e,S as J,I as N,a5 as Y,K as O,aG as Q,aH as W,aI as X,e as Z,aJ as ee,a9 as te}from"./index-XpZpj5Rl.js";var se={execTimeoutMs:3e5,autoStopIntervalInMinutes:15,autoArchiveIntervalInMinutes:10080,autoDeleteIntervalInMinutes:43200},F=te("h-11 shadow-sm");function U(s){if(s.trim()==="")return null;const l=Number(s);return!Number.isFinite(l)||l<0?null:l}var ae=({open:s,onOpenChange:l,onSave:d,title:g,description:I,initialConfig:R=null,requireApiKey:y=!0,busy:w=!1,error:C})=>{const[m,k]=r.useState(""),[u,x]=r.useState(""),[M,i]=r.useState(""),[p,o]=r.useState(""),[b,f]=r.useState(""),[P,v]=r.useState(!1),S=()=>{k(""),x(""),i(""),o(""),f(""),v(!1)};r.useEffect(()=>{if(!s)return;const a=R??se;k(String(a.execTimeoutMs)),x(String(a.autoStopIntervalInMinutes)),i(String(a.autoArchiveIntervalInMinutes)),o(String(a.autoDeleteIntervalInMinutes)),f(""),v(!1)},[s,R]);const $=a=>{a||S(),l(a)},h=U(m),A=U(u),T=U(M),E=U(p),_=b.trim(),K=(!y||!!_)&&h!=null&&A!=null&&T!=null&&E!=null,z=async a=>{if(a.preventDefault(),!(!K||w||h==null||A==null||T==null||E==null))try{await d({execTimeoutMs:h,autoStopIntervalInMinutes:A,autoArchiveIntervalInMinutes:T,autoDeleteIntervalInMinutes:E,apiKey:_}),S(),l(!1)}catch{}};return e.jsx(Q,{open:s,onOpenChange:$,title:g,description:I,contentSized:!0,headerIcon:e.jsx("span",{className:"flex size-11 shrink-0 items-center justify-center rounded-lg border border-border bg-secondary-bg text-text-primary","aria-hidden":!0,children:e.jsx(N,{name:"cube",className:"size-6"})}),children:e.jsxs("form",{className:"flex flex-col overflow-y-auto p-5 md:p-6",onSubmit:z,children:[e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{children:[e.jsxs("label",{htmlFor:"sandbox-api-key",className:"mb-1.5 block text-sm font-medium text-text-primary",children:["API key",y?null:e.jsx("span",{className:"font-normal text-text-secondary",children:" (optional)"})]}),e.jsx("input",{id:"sandbox-api-key",type:"password",required:y,value:b,onChange:a=>{f(a.target.value)},placeholder:y?"dtn_...":"Leave blank to keep existing",autoFocus:!0,className:F})]}),e.jsxs(W,{expanded:P,onChange:(a,t)=>v(t),className:"rounded-md border border-border",children:[e.jsx(X,{className:"px-3 py-2.5",children:e.jsxs("span",{className:"flex w-full items-center justify-between text-sm font-medium text-text-primary",children:["Advanced settings",e.jsx(N,{name:"chevron-down",className:Z("size-4 shrink-0 text-text-secondary transition-transform duration-200",P?"rotate-0":"-rotate-90")})]})}),e.jsxs(ee,{className:"space-y-4 border-t border-border px-3 pb-3 pt-4",children:[e.jsxs("div",{children:[e.jsx("label",{htmlFor:"sandbox-exec-timeout",className:"mb-1.5 block text-sm font-medium text-text-primary",children:"Exec timeout (ms)"}),e.jsx("input",{id:"sandbox-exec-timeout",type:"number",min:0,required:!0,value:m,onChange:a=>{k(a.target.value)},placeholder:"300000",className:F})]}),e.jsxs("div",{children:[e.jsx("label",{htmlFor:"sandbox-auto-stop",className:"mb-1.5 block text-sm font-medium text-text-primary",children:"Auto-stop interval (minutes)"}),e.jsx("input",{id:"sandbox-auto-stop",type:"number",min:0,required:!0,value:u,onChange:a=>{x(a.target.value)},placeholder:"15",className:F})]}),e.jsxs("div",{children:[e.jsx("label",{htmlFor:"sandbox-auto-archive",className:"mb-1.5 block text-sm font-medium text-text-primary",children:"Auto-archive interval (minutes)"}),e.jsx("input",{id:"sandbox-auto-archive",type:"number",min:0,required:!0,value:M,onChange:a=>{i(a.target.value)},placeholder:"10080",className:F})]}),e.jsxs("div",{children:[e.jsx("label",{htmlFor:"sandbox-auto-delete",className:"mb-1.5 block text-sm font-medium text-text-primary",children:"Auto-delete interval (minutes)"}),e.jsx("input",{id:"sandbox-auto-delete",type:"number",min:0,required:!0,value:p,onChange:a=>{o(a.target.value)},placeholder:"43200",className:F})]})]})]})]}),e.jsxs("div",{className:"mt-6 space-y-3",children:[C?e.jsx("p",{className:"text-failure-bg text-sm",children:C}):null,e.jsx(O.Primary,{type:"submit",size:"large",disabled:!K||w,className:"w-full shrink-0",children:"Save"})]})]})})},ne=ae,re=1e4,D=({execTimeoutMs:s,autoStopIntervalInMinutes:l,autoArchiveIntervalInMinutes:d,autoDeleteIntervalInMinutes:g})=>({execTimeoutMs:s,autoStopIntervalInMinutes:l,autoArchiveIntervalInMinutes:d,autoDeleteIntervalInMinutes:g}),le=s=>{switch(s){case"pending":return{label:"Syncing image...",className:"text-warning-bg"};case"ready":return{label:"Connected",className:"text-success-bg"};case"failed":return{label:"Sync failed",className:"text-failure-bg"};default:return{label:s,className:"text-text-secondary"}}},ie=()=>{const{sandboxCatalog:s}=H(),l=V(),[d,g]=r.useState([]),[I,R]=r.useState([]),[y,w]=r.useState(!0),[C,m]=r.useState(null),[k,u]=r.useState(null),[x,M]=r.useState(!1),[i,p]=r.useState(null),[o,b]=r.useState(null),f=r.useCallback(async({quiet:t=!1}={})=>{if(s){t||w(!0),m(null);try{const[n,c]=await Promise.all([s.listSandboxProviders(),s.getSandboxProviderCatalog()]);g(n),R(c)}catch(n){m(B(n,"Failed to load sandbox providers"))}finally{t||w(!1)}}},[s]);r.useEffect(()=>{f()},[f]);const P=d.some(t=>t.snapshotSyncStatus.status==="pending");r.useEffect(()=>{if(!s||!P)return;const t=s;let n=!1,c;function j(){c=window.setTimeout(()=>{q()},re)}async function q(){try{const L=await t.listSandboxProviders();if(n)return;g(L),m(null),L.some(G=>G.snapshotSyncStatus.status==="pending")&&j()}catch(L){if(n)return;m(B(L,"Failed to refresh sandbox providers")),j()}}return j(),()=>{n=!0,c!==void 0&&window.clearTimeout(c)}},[s,P]);const v=d.length>0,S=r.useMemo(()=>{if(v)return[];const t=new Set(d.map(n=>n.data.catalogId));return I.filter(n=>!t.has(n.id))},[I,d,v]),$=r.useMemo(()=>o?D(o):i?D(i):null,[o,i]);if(!s)return e.jsx("p",{className:"text-sm text-text-secondary",children:"Sandbox provider catalog is not available."});const h=async(t,n=m)=>{M(!0),m(null);try{await t(),await f({quiet:!0})}catch(c){throw n(B(c,"Request failed")),c}finally{M(!1)}},A=async t=>{i&&(u(null),await h(async()=>{await s.createSandboxProvider({catalogId:i.id,name:i.name,type:i.type,...D(t),apiKey:t.apiKey})},u),p(null),setTimeout(()=>{l==null||l.showSuccess({title:`${i.name} configured`})},0))},T=async t=>{o&&(u(null),await h(async()=>{await s.updateSandboxProvider({id:o.id,...D(t),...t.apiKey?{apiKey:t.apiKey}:{}})},u),b(null),setTimeout(()=>{l==null||l.showSuccess({title:`${o.name} updated`})},0))},E=t=>{h(async()=>{await s.updateSandboxProvider({id:t.id,...D(t)})}).catch(()=>{})},_=t=>{const n=s.deleteSandboxProvider;n&&h(async()=>{await n({id:t.id})}).catch(()=>{})},K=i!=null||o!=null,z=o!=null,a=o?`Update ${o.name}`:i?`Configure ${i.name}`:"Configure sandbox provider";return e.jsxs(e.Fragment,{children:[e.jsx("h3",{className:"text-xl font-semibold tracking-tight text-text-primary",children:"Sandbox providers"}),e.jsx("p",{className:"mt-1 text-sm text-text-secondary",children:"Choose a provider that runs sandboxes for code, files and shell commands. Only one can be active at a time."}),C?e.jsx("p",{className:"mt-3 rounded-md border border-failure-bg/30 bg-failure-bg/10 px-3 py-2 text-sm text-failure-bg",children:C}):null,e.jsx("div",{className:"mt-4 flex-1 overflow-y-auto",children:y?e.jsx("p",{className:"text-sm text-text-secondary",children:"Loading sandbox providers…"}):e.jsxs("div",{className:"space-y-6",children:[d.length>0?e.jsxs("section",{children:[e.jsxs("h4",{className:"mb-2 text-xs font-semibold uppercase tracking-wide text-text-secondary",children:["Configured · ",d.length]}),e.jsx("div",{className:"overflow-hidden rounded-xl border border-border bg-card-bg",children:d.map(t=>{const n=t.data,c=le(t.snapshotSyncStatus.status),j=t.snapshotSyncStatus.statusReason,q=e.jsxs("span",{className:`inline-flex items-center gap-1.5 text-sm font-medium ${c.className}`,children:[t.snapshotSyncStatus.status==="pending"?e.jsx(J,{size:16,"aria-label":"Syncing snapshot image"}):t.snapshotSyncStatus.status==="ready"?e.jsx("span",{className:"size-2 rounded-full bg-success-bg","aria-hidden":!0}):t.snapshotSyncStatus.status==="failed"?e.jsx(N,{name:"triangle-exclamation",className:"size-4"}):null,c.label]});return e.jsxs("article",{className:"flex flex-col gap-3 border-b border-border p-3 last:border-b-0 sm:flex-row sm:items-center",children:[e.jsxs("div",{className:"flex min-w-0 flex-1 items-center gap-3",children:[e.jsx("span",{className:"flex size-9 shrink-0 items-center justify-center rounded-lg border border-border bg-secondary-bg text-text-primary","aria-hidden":!0,children:e.jsx(N,{name:"cube",className:"size-4.5"})}),e.jsx("div",{className:"min-w-0",children:e.jsx("h5",{className:"truncate text-sm font-medium text-text-primary",children:n.name})})]}),e.jsxs("div",{className:"flex flex-wrap items-center gap-2.5 sm:justify-end",children:[q,j?e.jsx(Y,{content:j,children:e.jsx("button",{type:"button","aria-label":"Snapshot sync status details",className:"inline-flex text-text-secondary transition-colors hover:text-text-primary",children:e.jsx(N,{name:"info",className:"size-4"})})}):null,t.snapshotSyncStatus.status==="failed"?e.jsx(O.Ghost,{size:"small",type:"button",disabled:x,onClick:()=>{E(n)},children:"Retry"}):null,e.jsx(O.Secondary,{size:"small",type:"button",disabled:x,onClick:()=>{u(null),p(null),b(n)},children:"Update"}),s.deleteSandboxProvider?e.jsx(O.Ghost,{size:"small",className:"text-text-secondary",type:"button",disabled:x,onClick:()=>{_(n)},children:"Remove"}):null]})]},n.id)})})]}):null,v?null:e.jsxs("section",{children:[e.jsxs("h4",{className:"mb-2 text-xs font-semibold uppercase tracking-wide text-text-secondary",children:["Available · ",S.length]}),S.length===0?e.jsx("p",{className:"text-sm text-text-secondary",children:I.length>0?"All catalog providers are configured.":"No sandbox providers in the catalog."}):e.jsx("div",{className:"overflow-hidden rounded-xl border border-border bg-card-bg",children:S.map(t=>e.jsxs("article",{className:"flex flex-col gap-3 border-b border-border p-3 last:border-b-0 sm:flex-row sm:items-center",children:[e.jsxs("div",{className:"flex min-w-0 flex-1 items-center gap-3",children:[e.jsx("span",{className:"flex size-9 shrink-0 items-center justify-center rounded-lg border border-border bg-secondary-bg text-text-primary","aria-hidden":!0,children:e.jsx(N,{name:"cube",className:"size-4.5"})}),e.jsx("div",{className:"min-w-0",children:e.jsx("h5",{className:"truncate text-sm font-medium text-text-primary",children:t.name})})]}),e.jsx(O.Secondary,{type:"button",disabled:x,onClick:()=>{u(null),b(null),p(t)},children:"Configure"})]},t.id))})]})]})}),e.jsx(ne,{open:K,onOpenChange:t=>{t||(u(null),p(null),b(null))},onSave:z?T:A,title:a,description:z?"Update this sandbox provider. Leave API key blank to keep the existing key.":"Configure this sandbox provider. API key is never stored in the catalog.",initialConfig:$,requireApiKey:!z,busy:x,error:k})]})},de=ie;export{de as default};
|
|
Binary file
|
|
Binary file
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{A as Ne,B as Ie,D as je,r as i,E as fe,F as we,y as ye,G as Fe,q as ge,j as e,P as We,H as Qe,J as te,K as M,I as C,L as Ke,M as Te,N as Ce,O as Ye,Q as Ze,R as Ee,U as X,V as Je,W as ee,X as Xe,Y as et,Z as tt,$ as st,a0 as nt,a1 as at,e as G,c as rt,a2 as lt,a3 as he,d as it,a4 as ot,a5 as ct,a as dt,a6 as ut,a7 as mt,a8 as xt,a9 as ze,i as ht,aa as ft}from"./index-XpZpj5Rl.js";var Ae=[{value:"America/New_York",label:"America/New_York (ET)"},{value:"America/Chicago",label:"America/Chicago (CT)"},{value:"America/Denver",label:"America/Denver (MT)"},{value:"America/Los_Angeles",label:"America/Los_Angeles (PT)"},{value:"UTC",label:"UTC"},{value:"Europe/London",label:"Europe/London (GMT/BST)"},{value:"Europe/Berlin",label:"Europe/Berlin (CET)"},{value:"Asia/Kolkata",label:"Asia/Kolkata (IST)"},{value:"Asia/Tokyo",label:"Asia/Tokyo (JST)"}];function Me(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone||"UTC"}catch{return"UTC"}}function gt(t){const n=Me(),l=new Set(Ae.map(o=>o.value));return[...[n,t].flatMap(o=>o==null||o.length===0||l.has(o)?[]:(l.add(o),[{value:o,label:o===n?`${o} (Local)`:o}])),...Ae]}var Le=[{value:1,label:"Mon"},{value:2,label:"Tue"},{value:3,label:"Wed"},{value:4,label:"Thu"},{value:5,label:"Fri"},{value:6,label:"Sat"},{value:0,label:"Sun"}],bt={"America/New_York":"ET","America/Chicago":"CT","America/Denver":"MT","America/Los_Angeles":"PT",UTC:"UTC","Europe/London":"GMT","Europe/Berlin":"CET","Asia/Kolkata":"IST","Asia/Tokyo":"JST"};function xe(){return{name:"",task:"",recurrence:"daily",hour:9,minute:0,weekdays:[1],customCron:"0 9 * * *",timezone:Me()}}function pt(t){return bt[t]??t.split("/").pop()??t}function $e(t){return t.toString().padStart(2,"0")}function de({hour:t,minute:n}){const l=t>=12?"PM":"AM",a=t%12===0?12:t%12;return`${String(a)}:${$e(n)} ${l}`}function be(t){const n=t.minute,l=t.hour;switch(t.recurrence){case"hourly":return`${String(n)} * * * *`;case"daily":return`${String(n)} ${String(l)} * * *`;case"weekly":{const a=[...t.weekdays].sort((c,g)=>c-g),o=a.length>0?a.join(","):"*";return`${String(n)} ${String(l)} * * ${o}`}case"custom":return t.customCron.trim()}}function re(t){const n=pt(t.timezone),l=t.cron.trim().split(/\s+/);if(l.length!==5)return t.cron;const[a,o,c,g,b]=l;if(c!=="*"||g!=="*")return t.cron;const u=Number(a),x=Number(o);if(o==="*"&&b==="*"&&a!==void 0&&!Number.isNaN(u))return`Hourly at :${$e(u)} ${n}`;if(b==="*"&&o!==void 0&&a!==void 0&&!Number.isNaN(x)&&!Number.isNaN(u))return`Daily ${de({hour:x,minute:u})} ${n}`;if(b==="1-5"&&o!==void 0&&a!==void 0&&!Number.isNaN(x)&&!Number.isNaN(u))return`Weekdays ${de({hour:x,minute:u})} ${n}`;if(b!=null&&/^\d(?:,\d)*$/.test(b)&&o!==void 0&&a!==void 0&&!Number.isNaN(x)&&!Number.isNaN(u)){const f=b.split(",").map(p=>{var N;return((N=Le.find(r=>r.value===Number(p)))==null?void 0:N.label)??p});return f.length===1?`Every ${f[0]==="Mon"?"Monday":f[0]} ${de({hour:x,minute:u})} ${n}`:`${f.join(", ")} ${de({hour:x,minute:u})} ${n}`}return t.cron}function Re(t){const n=xe(),l=t.cron.trim().split(/\s+/);if(l.length!==5)return{...n,name:t.name,task:t.task,timezone:t.timezone,recurrence:"custom",customCron:t.cron};const[a,o,c,g,b]=l,u=Number(a),x=Number(o);return c!=="*"||g!=="*"?{...n,name:t.name,task:t.task,timezone:t.timezone,recurrence:"custom",customCron:t.cron}:o==="*"&&b==="*"&&!Number.isNaN(u)?{...n,name:t.name,task:t.task,timezone:t.timezone,recurrence:"hourly",minute:u,customCron:t.cron}:b==="*"&&!Number.isNaN(x)&&!Number.isNaN(u)?{...n,name:t.name,task:t.task,timezone:t.timezone,recurrence:"daily",hour:x,minute:u,customCron:t.cron}:b!=null&&/^\d(?:,\d)*$/.test(b)&&!Number.isNaN(x)&&!Number.isNaN(u)?{...n,name:t.name,task:t.task,timezone:t.timezone,recurrence:"weekly",hour:x,minute:u,weekdays:b.split(",").map(Number),customCron:t.cron}:{...n,name:t.name,task:t.task,timezone:t.timezone,recurrence:"custom",customCron:t.cron,hour:Number.isNaN(x)?n.hour:x,minute:Number.isNaN(u)?n.minute:u}}function Nt(t,n=Date.now()){if(t==null)return"Never";const l=Date.parse(t);if(Number.isNaN(l))return"Never";const a=Math.round((n-l)/1e3);if(a<60)return"just now";const o=Math.round(a/60);if(o<60)return`${String(o)} min ago`;const c=Math.round(o/60);if(c<48)return`${String(c)} hour${c===1?"":"s"} ago`;const g=Math.round(c/24);return`${String(g)} day${g===1?"":"s"} ago`}var jt=[{value:"hourly",label:"Hourly"},{value:"daily",label:"Daily"},{value:"weekly",label:"Weekly"}],yt=Array.from({length:24},(t,n)=>({value:String(n),label:n.toString().padStart(2,"0")})),vt=[0,15,30,45].map(t=>({value:String(t),label:`:${t.toString().padStart(2,"0")}`}));function St({values:t,onChange:n,agentId:l,onAgentIdChange:a,agentOptions:o,agentOptionsLoaded:c=!0,agentPickerDisabled:g=!1,onBuildAgent:b}){const u=be(t),x=re({cron:u,timezone:t.timezone}),f=gt(t.timezone),p=(r,v)=>{n({...t,[r]:v})},N=r=>{const O=t.weekdays.includes(r)?t.weekdays.filter(_=>_!==r):[...t.weekdays,r];n({...t,weekdays:O.length>0?O:[r]})};return e.jsxs("div",{className:"flex flex-col gap-4 px-5 py-4",children:[e.jsxs("div",{className:"block",children:[e.jsx("span",{className:"mb-1.5 block text-sm font-medium",children:"Agent"}),e.jsx(te,{"aria-label":"Agent",placeholder:"Select an agent",value:l,options:o.map(r=>({value:r.agentId,label:r.name})),onValueChange:r=>a==null?void 0:a(r),disabled:g||a==null,emptyContent:c?e.jsx("p",{className:"text-text-secondary px-3 py-5 text-center text-sm",children:"No Agents created yet"}):null,footer:c&&o.length===0&&b!=null?e.jsx("div",{className:"flex justify-end border-t border-border px-2 pt-2",children:e.jsxs(M.Ghost,{type:"button",onClick:b,children:[e.jsx(C,{name:"plus",className:"size-3.5"}),"Build Agent"]})}):null})]}),e.jsxs("label",{className:"block",children:[e.jsx("span",{className:"mb-1.5 block text-sm font-medium",children:"Name"}),e.jsx("input",{value:t.name,onChange:r=>p("name",r.target.value),placeholder:"harness-daily-digest",className:ze("h-8"),required:!0})]}),e.jsxs("label",{className:"block",children:[e.jsx("span",{className:"mb-1.5 block text-sm font-medium",children:"Task"}),e.jsx("textarea",{value:t.task,onChange:r=>p("task",r.target.value),rows:3,placeholder:"Summarise yesterday's harness runs and post the digest…",className:ze("resize-y py-2"),required:!0})]}),e.jsxs("fieldset",{children:[e.jsx("legend",{className:"mb-1.5 text-sm font-medium",children:"Frequency"}),e.jsx("div",{className:"rounded-t-lg border border-border p-4",children:e.jsxs("div",{className:"flex flex-col gap-4",children:[e.jsx("div",{className:"grid grid-cols-3 gap-1 rounded-lg border border-border bg-primary-bg p-1",children:jt.map(r=>{const v=t.recurrence===r.value;return e.jsx("button",{type:"button",className:G("rounded-md border px-2 py-2 text-sm font-medium transition-colors",v?"border-primary-button-bg/40 bg-primary-button-bg/10 font-semibold text-primary-button-bg":"border-transparent text-text-secondary hover:bg-ghost-button-hover"),"aria-pressed":v,onClick:()=>p("recurrence",r.value),children:r.label},r.value)})}),t.recurrence==="custom"?e.jsxs("div",{className:"rounded-md border border-border bg-secondary-bg/40 px-3 py-2",children:[e.jsx("span",{className:"block text-xs text-text-secondary",children:"Existing custom schedule"}),e.jsx("code",{className:"mt-1 block font-mono text-sm text-text-primary",children:t.customCron}),e.jsx("span",{className:"mt-1 block text-xs text-text-secondary",children:"Select Hourly, Daily, or Weekly to replace this schedule."})]}):null,t.recurrence==="weekly"?e.jsxs("fieldset",{children:[e.jsx("legend",{className:"mb-2 text-sm font-medium",children:"Days"}),e.jsx("div",{className:"flex gap-2",children:Le.map(r=>{const v=t.weekdays.includes(r.value);return e.jsx("button",{type:"button",className:G("min-w-0 flex-1 rounded-md border px-3 py-2 text-[0.8125rem] font-medium",v?"border-primary-button-bg/40 bg-primary-button-bg/10 font-semibold text-primary-button-bg":"border-border text-text-secondary hover:bg-ghost-button-hover"),"aria-pressed":v,onClick:()=>N(r.value),children:r.label},r.value)})})]}):null,e.jsxs("div",{className:"flex gap-4",children:[t.recurrence==="daily"||t.recurrence==="weekly"?e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsx("span",{className:"mb-1.5 block text-sm font-medium",children:"Hour"}),e.jsx(te,{"aria-label":"Hour",value:String(t.hour),options:yt,onValueChange:r=>p("hour",Number(r))})]}):null,t.recurrence!=="custom"?e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsx("span",{className:"mb-1.5 block text-sm font-medium",children:"Minute"}),e.jsx(te,{"aria-label":"Minute",value:String(t.minute),options:vt,onValueChange:r=>p("minute",Number(r))})]}):null,e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsx("span",{className:"mb-1.5 block text-sm font-medium",children:"Timezone"}),e.jsx(te,{"aria-label":"Timezone",value:t.timezone,options:f,onValueChange:r=>p("timezone",r),menuClassName:"w-full min-w-0"})]})]})]})}),e.jsx("div",{className:"rounded-b-lg border border-t-0 border-border bg-primary-button-bg/10 px-4 py-3",children:e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(C,{name:"clock",className:"size-4 shrink-0 text-primary-button-bg"}),e.jsx("span",{className:"shrink-0 text-xs font-medium text-text-secondary",children:"Schedule"}),e.jsx("p",{className:"min-w-0 flex-1 truncate text-sm text-text-primary",children:x||"—"}),e.jsx("code",{className:"shrink-0 whitespace-nowrap font-mono text-[0.8125rem] font-bold text-text-secondary",children:u||"—"})]})})]})]})}function kt(t){return t.startsWith("manual-")}function wt(t){return t==="failed"?"failed":"success"}function Oe(t){return t==="failed"?"Failed":t==="triggered"?"Triggered":"Scheduled"}function _e(t){return kt(t)?"Manual test":"Cron"}function Tt(t,n=5){return t.filter(a=>a.status!=="scheduled").slice(0,n).reverse()}function pe(t){if(t==null)return"—";const n=new Date(t);return Number.isNaN(n.getTime())?"—":new Intl.DateTimeFormat(void 0,{month:"short",day:"numeric",year:"numeric",hour:"numeric",minute:"2-digit",hour12:!0}).format(n)}function Ct({run:t}){return e.jsxs("div",{className:"flex flex-col gap-1 text-left text-xs",children:[e.jsx("p",{className:"text-text-primary font-medium",children:Oe(t.status)}),e.jsx("p",{className:"text-text-secondary",children:_e(t.name)}),e.jsxs("p",{className:"text-text-secondary",children:["Scheduled for: ",pe(t.scheduledFor)]}),t.triggeredAt!=null?e.jsxs("p",{className:"text-text-secondary",children:["Triggered at: ",pe(t.triggeredAt)]}):null,e.jsxs("p",{className:"text-text-secondary",children:["Triggered by: ",t.triggeredBy]})]})}var Et={success:"border-emerald-600/30 bg-emerald-500/10 text-emerald-700 dark:border-emerald-400/35 dark:bg-emerald-500/15 dark:text-emerald-300",failed:"border-red-600/30 bg-red-500/10 text-red-700 dark:border-red-400/35 dark:bg-red-500/15 dark:text-red-300"};function Be({run:t}){const n=wt(t.status),l=pe(t.triggeredAt??t.scheduledFor);return e.jsx(ct,{content:e.jsx(Ct,{run:t}),side:"top",children:e.jsx("span",{className:G("inline-flex size-6 shrink-0 items-center justify-center rounded-md border",Et[n]),"aria-label":`${Oe(t.status)} run at ${l}`,children:e.jsx(C,{name:n==="failed"?"triangle-exclamation":"check",className:"size-3.5"})})})}function Ue({status:t}){const n=t==="active";return e.jsxs("span",{className:G("inline-flex items-center gap-1.5 rounded-full border px-2.5 py-0.5 text-xs font-medium",n?"border-emerald-600/30 bg-emerald-500/10 text-emerald-700 dark:border-emerald-400/35 dark:bg-emerald-500/15 dark:text-emerald-300":"border-amber-600/30 bg-amber-500/10 text-amber-800 dark:border-amber-400/35 dark:bg-amber-500/15 dark:text-amber-300"),children:[e.jsx("span",{className:G("size-1.5 shrink-0 rounded-full",n?"bg-emerald-600 dark:bg-emerald-400":"bg-amber-600 dark:bg-amber-400"),"aria-hidden":!0}),n?"Active":"Paused"]})}function zt(t,n){return t.find(l=>l.name===n||l.id===n)??null}function At({connector:t,onConnected:n}){return ht()==null?null:e.jsx(ft,{connector:t,onConnected:n})}function ae({label:t,children:n}){return e.jsxs("div",{className:"flex items-start justify-between gap-3 border-b border-border px-3 py-2.5 last:border-b-0",children:[e.jsx("span",{className:"text-text-secondary shrink-0 text-[10px] font-semibold tracking-wide uppercase",children:t}),e.jsx("div",{className:"min-w-0 text-right text-sm text-text-primary",children:n})]})}function Rt({schedule:t,agentName:n,mcpMounts:l,onEditConfiguration:a}){const o=Ne(),c=je(),{connectors:g,ensureLoaded:b,refreshConnectors:u,loading:x,error:f}=xt(),[p,N]=i.useState(!1),[r,v]=i.useState(null),O=re({cron:t.cron,timezone:t.timezone}),_=async()=>{N(!0);try{const w=await o.createScheduleRun({scheduleId:t.id});v(w),c==null||c.showSuccess({title:"Test run started"})}catch(w){c==null||c.showError(w)}finally{N(!1)}};return i.useEffect(()=>{b()},[b]),i.useEffect(()=>{f!=null&&(c==null||c.showError(f))},[f,c]),e.jsxs("div",{className:"flex flex-col gap-4 px-5 py-4",children:[e.jsxs("section",{className:"overflow-hidden rounded-lg border border-border bg-card-bg",children:[e.jsx(ae,{label:"Agent",children:n}),e.jsx(ae,{label:"Name",children:t.name}),e.jsx(ae,{label:"Status",children:e.jsx(Ue,{status:t.status})}),e.jsx(ae,{label:"Task",children:e.jsx("span",{className:"whitespace-pre-wrap break-words",children:t.task})}),e.jsx(ae,{label:"Frequency",children:e.jsxs("div",{className:"flex flex-wrap items-center justify-end gap-1.5",children:[e.jsx("span",{children:O}),e.jsx("code",{className:"text-text-secondary font-mono text-xs",children:t.cron})]})}),e.jsx("div",{className:"flex justify-end px-3 py-2.5",children:e.jsxs(M.Secondary,{type:"button",size:"small",onClick:a,children:[e.jsx(C,{name:"pencil",className:"size-3.5"}),"Edit Configuration"]})})]}),e.jsxs("section",{className:"overflow-hidden rounded-lg border border-border bg-card-bg",children:[e.jsx("div",{className:"border-b border-border px-3 py-2",children:e.jsx("h3",{className:"text-text-secondary text-[10px] font-semibold tracking-wide uppercase",children:"Tool Authorization"})}),l.length===0?e.jsx("p",{className:"text-text-secondary px-3 py-3 text-sm",children:"No MCP connectors configured for this agent."}):e.jsx("ul",{className:"divide-y divide-border",children:l.map(w=>{const m=zt(g,w.name),k=(m==null?void 0:m.authenticated)===!0,V=m==null&&!x;return e.jsxs("li",{className:"flex items-center gap-2 px-3 py-2.5",children:[e.jsx("span",{className:G("inline-flex size-4 shrink-0 items-center justify-center rounded-full border",k?"border-emerald-600/40 bg-emerald-500/15 text-emerald-700 dark:text-emerald-300":"border-border text-transparent"),"aria-hidden":!0,children:k?e.jsx(C,{name:"check",className:"size-3"}):null}),e.jsx("span",{className:"text-text-primary min-w-0 flex-1 truncate text-sm",children:w.name}),k?e.jsx("span",{className:"text-success-bg text-xs font-medium",children:"Connected"}):V?e.jsx("span",{className:"text-text-secondary text-xs",children:"Unavailable"}):m!=null&&m.authenticated===!1?e.jsx(At,{connector:m,onConnected:u}):x?e.jsx("span",{className:"text-text-secondary text-xs",children:"Loading…"}):null]},w.name)})})]}),e.jsxs("section",{className:"overflow-hidden rounded-lg border border-border bg-card-bg",children:[e.jsxs("div",{className:"flex items-center justify-between gap-2 border-b border-border px-3 py-2",children:[e.jsx("h3",{className:"text-text-secondary text-[10px] font-semibold tracking-wide uppercase",children:"Test Run"}),e.jsxs(M.Primary,{type:"button",disabled:p,size:"small",onClick:()=>void _(),children:[e.jsx(C,{name:p?"loader":"play",className:G("size-3.5",p&&"animate-spin")}),"Run Test"]})]}),r==null?e.jsx("p",{className:"text-text-secondary px-3 py-3 text-sm",children:"Run a one-off test using the schedule task. This does not change the cron pending run."}):e.jsxs("div",{className:"flex items-center gap-3 px-3 py-3",children:[e.jsx(Be,{run:r}),e.jsxs("div",{className:"min-w-0 text-sm",children:[e.jsx("p",{className:"text-text-primary font-medium",children:_e(r.name)}),e.jsx("p",{className:"text-text-secondary",children:Nt(r.triggeredAt??r.scheduledFor)})]})]})]})]})}function Pt({open:t,onOpenChange:n,mode:l,schedule:a,initialAgentId:o="",onSaved:c}){var ne;const g=Ne(),b=Ie(),u=dt(),x=je(),[f,p]=i.useState(xe),[N,r]=i.useState(o),[v,O]=i.useState([]),[_,w]=i.useState(!1),[m,k]=i.useState({kind:"form"}),[V,I]=i.useState(!1),[le,y]=i.useState(!1),[B,E]=i.useState(null),se=m.kind==="form"?m.saved:m.schedule,L=l==="edit"&&m.kind==="form"&&m.saved==null&&a!=null,$=m.kind==="form"&&m.saved!=null,q=l==="create"&&m.kind==="form"&&m.saved==null,{allows:W}=fe({resourceType:"agent",resourceIds:N.length===0?[]:[N]});i.useEffect(()=>{if(!t)return;let h=!1;return w(!1),Fe(b).then(S=>{h||(O(S),w(!0))}).catch(()=>{}),()=>{h=!0}},[t,b]),i.useEffect(()=>{if(!t){p(xe()),r(o),E(null),k({kind:"form"}),y(!1);return}if(l==="edit"&&a!=null){p(Re({name:a.name,task:a.task,cron:a.cron,timezone:a.timezone})),r(a.agentId),k({kind:"form"});return}p(xe()),r(o),k({kind:"form"})},[t,l,a,o]);const Q=i.useMemo(()=>v.map(h=>({agentId:ge(h),name:h.name})),[v]),z=i.useMemo(()=>v.find(h=>ge(h)===N)??null,[v,N]),A=(z==null?void 0:z.name)??(se==null?void 0:se.agentName)??(a==null?void 0:a.agentName)??((ne=Q.find(h=>h.agentId===N))==null?void 0:ne.name)??N,ie=i.useMemo(()=>{var S;return(((S=z==null?void 0:z.agentSpec)==null?void 0:S.mcpServers)??[]).map(ut).filter(T=>T!=null).map(T=>({name:T}))},[z]),U=i.useMemo(()=>{const h=be(f);return f.name.trim().length>0&&f.task.trim().length>0&&h.length>0&&N.length>0&&(!q||W(N,"USE"))},[N,W,f,q]),R=h=>{k({kind:"test",schedule:h}),p(Re({name:h.name,task:h.task,cron:h.cron,timezone:h.timezone})),r(h.agentId)},K=async h=>{if(h.preventDefault(),!U)return;const S=be(f);I(!0),E(null);try{if(L&&a!=null){await g.updateSchedule({id:a.id,name:f.name.trim(),task:f.task.trim(),cron:S,timezone:f.timezone,status:a.status}),c==null||c(),n(!1);return}if($&&m.kind==="form"&&m.saved!=null){const Z=await g.updateSchedule({id:m.saved.id,name:f.name.trim(),task:f.task.trim(),cron:S,timezone:f.timezone,status:"paused"});c==null||c(),R(Z),x==null||x.showSuccess({title:"Schedule saved as paused",description:re({cron:Z.cron,timezone:Z.timezone})});return}const T=await g.createSchedule({agentId:N,name:f.name.trim(),task:f.task.trim(),cron:S,timezone:f.timezone,status:"paused"});c==null||c(),R(T),x==null||x.showSuccess({title:"Schedule saved as paused",description:re({cron:T.cron,timezone:T.timezone})})}catch(T){const Z=T instanceof Error?T.message:"Failed to save schedule";E(Z)}finally{I(!1)}},oe=async()=>{if(m.kind==="test"){y(!0),E(null);try{await g.updateSchedule({id:m.schedule.id,name:m.schedule.name,task:m.schedule.task,cron:m.schedule.cron,timezone:m.schedule.timezone,status:"active"}),c==null||c(),x==null||x.showSuccess({title:"Schedule activated"}),n(!1)}catch(h){const S=h instanceof Error?h.message:"Failed to activate schedule";E(S),x==null||x.showError(h)}finally{y(!1)}}},Y=m.kind==="test"?"Test Schedule":L||$?"Edit Schedule":"New Schedule",F=m.kind==="test"?`Recurring unattended runs of ${A}.`:L||$?"Update cadence and task for this schedule.":"Create a recurring unattended run for an agent.";let P;return m.kind==="test"?P=e.jsxs("div",{className:"flex flex-col gap-2",children:[B!=null?e.jsx("p",{className:"text-failure-bg text-sm",children:B}):null,e.jsx(M.Secondary,{type:"button",className:"w-full",disabled:le,onClick:()=>void oe(),children:"Activate Schedule"})]}):P=e.jsxs("div",{className:"flex flex-col gap-2",children:[B!=null?e.jsx("p",{className:"text-failure-bg text-sm",children:B}):null,e.jsxs("div",{className:"flex justify-end gap-2",children:[e.jsx(M.Secondary,{type:"button",onClick:()=>n(!1),disabled:V,children:"Cancel"}),e.jsx(M.Primary,{type:"submit",form:"schedule-form",disabled:!U||V,children:"Save"})]})]}),e.jsx(mt,{open:t,onOpenChange:n,title:Y,description:F,anchor:"right",size:"xl",headerIcon:e.jsx("span",{className:"text-primary-button-bg inline-flex size-8 items-center justify-center",children:e.jsx(C,{name:m.kind==="test"||L||$?"calendar":"calendar-plus",className:"size-5"})}),footer:P,children:m.kind==="test"?e.jsx(Rt,{schedule:m.schedule,agentName:A,mcpMounts:ie,onEditConfiguration:()=>{E(null),k({kind:"form",saved:m.schedule})}}):e.jsx("form",{id:"schedule-form",onSubmit:h=>void K(h),children:e.jsx(St,{values:f,onChange:p,agentId:N,onAgentIdChange:L||$?void 0:r,agentOptions:Q,agentOptionsLoaded:_,agentPickerDisabled:L||$,onBuildAgent:l==="create"&&(u==null?void 0:u.isComposerEnabled)===!0?()=>{n(!1),u.openAgentBuilder()}:void 0})})})}function Pe(t){return e.jsx(ot,{children:e.jsx(Pt,{...t})})}function Dt({runs:t}){const n=Tt(t);return n.length===0?e.jsx("span",{className:"text-text-secondary text-sm",children:"—"}):e.jsx("div",{className:"flex items-center gap-1",children:n.map(l=>e.jsx(Be,{run:l},l.id))})}var It=[{value:"all",label:"All statuses"},{value:"active",label:"Active"},{value:"paused",label:"Paused"}],De=[10,25];function ue(t){return Math.min(Math.max(t,1),25)}function me(t){const n=ye(t);return{nameQuery:n.q??"",statusFilter:n.status??"all",agentFilter:n.agent??"all"}}function Ft(t){const n=ye(window.location.search);if(!n.isNew)return{kind:"closed"};const l=t??n.agent;return{kind:"create",...l==null?{}:{agentId:l}}}function Mt({schedule:t,running:n,canManage:l,canDelete:a,onRunNow:o,onEdit:c,onTogglePause:g,onDelete:b}){const u=rt("PermissionGuard");return e.jsxs("div",{className:"inline-flex items-center justify-end gap-1.5",children:[e.jsx(u,{allowed:l,children:e.jsxs(M.Secondary,{type:"button",disabled:n,"aria-label":`Run now ${t.name}`,size:"large",onClick:o,children:[e.jsx(C,{name:n?"loader":"play",className:G("size-3.5",n&&"animate-spin")}),"Run now"]})}),e.jsxs(lt,{align:"end",trigger:e.jsx("button",{type:"button",className:it({variant:"ghost",size:"icon"}),"aria-label":`Actions for ${t.name}`,children:e.jsx(C,{name:"ellipsis"})}),children:[e.jsx(u,{allowed:l,children:e.jsxs(he,{onClick:c,children:[e.jsx(C,{name:"pencil",className:"size-3.5"}),"Edit"]})}),e.jsx(u,{allowed:l,children:e.jsxs(he,{onClick:g,children:[e.jsx(C,{name:t.status==="active"?"pause":"play",className:"size-3.5"}),t.status==="active"?"Pause":"Resume"]})}),e.jsx(u,{allowed:a,children:e.jsxs(he,{className:"text-failure-bg focus:text-failure-bg",onClick:b,children:[e.jsx(C,{name:"trash",className:"size-3.5"}),"Delete"]})})]})]})}function $t({agentId:t}){const n=Ne(),l=Ie(),a=je(),[o,c]=i.useState([]),{allows:g}=fe({resourceType:"schedule",resourceIds:o.map(s=>s.id)}),[b,u]=i.useState({}),[x,f]=i.useState(!1),[p,N]=i.useState(()=>new Set),[r,v]=i.useState([]),[O,_]=i.useState(!0),[w,m]=i.useState(null),[k,V]=i.useState(()=>me(window.location.search).nameQuery),[I,le]=i.useState(()=>me(window.location.search).statusFilter),[y,B]=i.useState(()=>t??me(window.location.search).agentFilter),E=t??(y==="all"?null:y),se=i.useMemo(()=>E==null?r.map(s=>s.agentId):[E],[r,E]),{allows:L}=fe({resourceType:"agent",resourceIds:se}),$=l.permissions==null||(E==null?r.some(s=>L(s.agentId,"USE")):L(E,"USE")),[q,W]=i.useState(()=>Ft(t)),[Q,z]=i.useState(null),[A,ie]=i.useState(()=>ue(at)),[U,R]=i.useState(void 0),[K,oe]=i.useState(void 0),[Y,F]=i.useState([]),P=i.useRef(0),ne=i.useRef(!1),h=i.useCallback(async({rows:s,gen:d})=>{if(s.length===0){d===P.current&&u({});return}f(!0);try{const j=await Promise.allSettled(s.map(D=>n.listScheduleRuns({scheduleId:D.id})));if(d!==P.current)return;u(Object.fromEntries(s.map((D,H)=>{const J=j[H],qe=(J==null?void 0:J.status)==="fulfilled"?J.value:[];return[D.id,qe]})))}finally{d===P.current&&f(!1)}},[n]),S=i.useCallback(async({token:s,size:d,agentId:j})=>{const D=++P.current;_(!0),m(null);try{const H=await n.listSchedules({limit:ue(d),...s===void 0||s===""?{}:{pageToken:s},...j==="all"?{}:{agentIds:[j]}});if(D!==P.current)return;c(H.data),oe(H.nextPageToken),h({rows:H.data,gen:D})}catch(H){if(D!==P.current)return;const J=H instanceof Error?H.message:"Failed to load schedules";m(J),c([]),u({}),oe(void 0)}finally{D===P.current&&_(!1)}},[n,h]),T=i.useCallback(s=>{const d=(s==null?void 0:s.size)??A,j=(s==null?void 0:s.agentId)??y;R(void 0),F([]),S({token:void 0,size:d,agentId:j})},[y,S,A]);i.useEffect(()=>{we({agent:t===void 0&&y!=="all"?y:null,status:I==="all"?null:I,q:k.trim().length===0?null:k})},[y,t,I,k]),i.useEffect(()=>{t!==void 0&&B(s=>s===t?s:(R(void 0),F([]),t))},[t]),i.useEffect(()=>{ne.current||!ye(window.location.search).isNew||(ne.current=!0,we({isNew:null}))},[]),i.useEffect(()=>{const s=()=>{const d=me(window.location.search);V(d.nameQuery),le(d.statusFilter),B(j=>{const D=t??d.agentFilter;return j===D?j:(R(void 0),F([]),D)})};return window.addEventListener("popstate",s),()=>{window.removeEventListener("popstate",s)}},[t]),i.useEffect(()=>{S({token:U,size:A,agentId:y})},[y,A,U,S]),i.useEffect(()=>{let s=!1;return Fe(l).then(d=>{s||v(d.map(j=>({agentId:ge(j),name:j.name})))}).catch(()=>{}),()=>{s=!0}},[l]);const Z=i.useMemo(()=>{const s=new Map;for(const d of r)s.set(d.agentId,d.name);return s},[r]),ce=i.useMemo(()=>{const s=k.trim().toLowerCase();return o.filter(d=>!(I!=="all"&&d.status!==I||s.length>0&&!d.name.toLowerCase().includes(s)))},[o,k,I]),ve=Y.length>0||K!=null,He=async s=>{if(!g(s.id,"MANAGE"))return;const d=s.status==="active"?"paused":"active";try{await n.updateSchedule({...s,status:d}),await S({token:U,size:A,agentId:y})}catch(j){a==null||a.showError(j)}},Ge=async s=>{if(g(s.id,"MANAGE")){N(d=>new Set(d).add(s.id));try{await n.createScheduleRun({scheduleId:s.id}),a==null||a.showSuccess({title:"Run started"});const d=await n.listScheduleRuns({scheduleId:s.id});u(j=>({...j,[s.id]:d}))}catch(d){a==null||a.showError(d)}finally{N(d=>{const j=new Set(d);return j.delete(s.id),j})}}},Ve=async s=>{if(g(s.id,"DELETE")){z(null);try{await n.deleteSchedule({id:s.id}),T()}catch(d){a==null||a.showError(d)}}},Se=()=>{K!=null&&(F(s=>[...s,U??""]),R(K))},ke=()=>{if(Y.length===0)return;const s=[...Y],d=s.pop();F(s),R(d===""?void 0:d)};return e.jsxs("div",{className:"flex h-full min-h-0 flex-col bg-primary-bg",children:[e.jsx(We,{title:t===void 0?"Scheduled Agents":void 0,end:e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"w-full sm:w-56",children:e.jsx(Qe,{query:k,setQuery:V,placeholder:"Search schedules by name"})}),e.jsx(te,{value:I,onValueChange:le,options:It,className:"sm:w-40","aria-label":"Filter by status"}),t===void 0?e.jsx(te,{value:y,onValueChange:s=>{B(s),R(void 0),F([])},options:[{value:"all",label:"All agents"},...r.map(s=>({value:s.agentId,label:s.name}))],className:"sm:w-40","aria-label":"Filter by agent"}):null,e.jsxs(M.Primary,{type:"button",disabled:!$,onClick:()=>$&&W({kind:"create",agentId:y!=="all"?y:void 0}),children:[e.jsx(C,{name:"plus",className:"size-3.5"}),"Create Schedule"]})]})}),e.jsx("div",{className:"min-h-0 flex-1 overflow-auto px-4 py-4",children:O?e.jsx("div",{className:"flex flex-col gap-2",role:"status","aria-label":"Loading schedules",children:Array.from({length:5},(s,d)=>e.jsx(Ke,{className:"h-12 w-full rounded-md"},d))}):w!=null?e.jsx("p",{className:"text-failure-bg px-3 py-8 text-center text-sm",children:w}):o.length===0?e.jsx(Te,{title:"No Schedules Found",description:"Create one to get started.",className:"min-h-full"}):ce.length===0?e.jsxs("div",{className:"flex min-h-full flex-col",children:[e.jsx(Te,{title:"No Schedules Found",description:"No schedules match your filters.",className:"flex-1"}),ve?e.jsx(Ce,{pageSize:A,rowCount:0,canPrev:Y.length>0,canNext:K!=null,onPrev:ke,onNext:Se,pageSizeOptions:De,onPageSizeChange:s=>{const d=ue(s);ie(d),R(void 0),F([])}}):null]}):e.jsxs("div",{className:"overflow-hidden rounded-lg border border-border",children:[e.jsxs(Ye,{className:"min-w-[48rem]",children:[e.jsx(Ze,{children:e.jsxs(Ee,{className:"hover:bg-transparent",children:[e.jsx(X,{children:"Name"}),e.jsx(X,{children:"Agent"}),e.jsx(X,{children:"Frequency"}),e.jsx(X,{children:"Status"}),e.jsx(X,{children:"Last 5 runs"}),e.jsx(X,{children:e.jsx("span",{className:"sr-only",children:"Actions"})})]})}),e.jsx(Je,{children:ce.map(s=>{const d=re({cron:s.cron,timezone:s.timezone}),j=s.agentName??Z.get(s.agentId)??s.agentId;return e.jsxs(Ee,{children:[e.jsx(ee,{className:"text-text-primary font-medium",children:e.jsx("span",{className:"text-left !no-underline",children:s.name})}),e.jsx(ee,{children:j}),e.jsx(ee,{children:d}),e.jsx(ee,{children:e.jsx(Ue,{status:s.status})}),e.jsx(ee,{children:x?e.jsx("span",{className:"text-text-secondary text-sm",children:"…"}):e.jsx(Dt,{runs:b[s.id]??[]})}),e.jsx(ee,{className:"text-right",children:e.jsx(Mt,{schedule:s,running:p.has(s.id),canManage:g(s.id,"MANAGE"),canDelete:g(s.id,"DELETE"),onRunNow:()=>void Ge(s),onEdit:()=>{g(s.id,"MANAGE")&&W({kind:"edit",schedule:s})},onTogglePause:()=>void He(s),onDelete:()=>{g(s.id,"DELETE")&&z(s)}})})]},s.id)})})]}),(ce.length>0||ve)&&e.jsx(Ce,{pageSize:A,rowCount:ce.length,canPrev:Y.length>0,canNext:K!=null,onPrev:ke,onNext:Se,pageSizeOptions:De,onPageSizeChange:s=>{const d=ue(s);ie(d),R(void 0),F([])}})]})}),q.kind==="create"?e.jsx(Pe,{open:!0,mode:"create",initialAgentId:q.agentId??"",onOpenChange:s=>{s||W({kind:"closed"})},onSaved:()=>T()}):null,q.kind==="edit"?e.jsx(Pe,{open:!0,mode:"edit",schedule:q.schedule,onOpenChange:s=>{s||W({kind:"closed"})},onSaved:()=>void S({token:U,size:A,agentId:y})}):null,Q!=null?e.jsxs(Xe,{open:!0,onOpenChange:s=>{s||z(null)},"aria-label":"Delete schedule",className:"max-w-md",children:[e.jsx(et,{children:e.jsxs(tt,{children:[e.jsx(st,{children:"Delete schedule"}),e.jsxs("p",{className:"text-text-secondary text-sm",children:["“",Q.name,"” will stop running. This cannot be undone."]})]})}),e.jsxs(nt,{children:[e.jsx(M.Secondary,{type:"button",onClick:()=>z(null),children:"Cancel"}),e.jsx(M.Destructive,{type:"button",disabled:!g(Q.id,"DELETE"),onClick:()=>void Ve(Q),children:"Delete"})]})]}):null]})}export{$t as SchedulesPage};
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as t,j as o,T as a}from"./index-XpZpj5Rl.js";import{r as m}from"./chunk-73FQVITT-mgvTPDmd.js";import{B as i}from"./chunk-62JRHF6Z-DYrEQoq5.js";function p({routes:e,...s}){const r=t.useMemo(()=>m(e),[e]);return o.jsx(i,{basename:r.basename||void 0,children:o.jsx(a,{...s,resolvedRoutes:r})})}export{p as TrueForgeUIWithRouter};
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|