@truefoundry/trueforge 0.2.0-rc.5 → 0.2.0-rc.6
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-V5A56M7R-ZCh9CtX_.js → AgentCodeSnippets-UWKIJI6U-BuMY_5q9.js} +1 -1
- package/dist/_frontend/assets/AgentCodeSnippets-UWKIJI6U-BuMY_5q9.js.br +0 -0
- package/dist/_frontend/assets/AgentCodeSnippets-UWKIJI6U-BuMY_5q9.js.gz +0 -0
- package/dist/_frontend/assets/AgentMetricChart-4ZJJED5Q-Ck2gd1mC.js +1 -0
- package/dist/_frontend/assets/AgentMetricChart-4ZJJED5Q-Ck2gd1mC.js.br +0 -0
- package/dist/_frontend/assets/AgentMetricChart-4ZJJED5Q-Ck2gd1mC.js.gz +0 -0
- package/dist/_frontend/assets/AgentOverview-UZBCVNMP-EMNirCRT.js +1 -0
- package/dist/_frontend/assets/AgentOverview-UZBCVNMP-EMNirCRT.js.br +0 -0
- package/dist/_frontend/assets/AgentOverview-UZBCVNMP-EMNirCRT.js.gz +0 -0
- package/dist/_frontend/assets/{AgentSessionEventTimeline-UUXOJXTC-Nk5ZgtJk.js → AgentSessionEventTimeline-N4RXG2NU-JgVOEYK9.js} +1 -1
- package/dist/_frontend/assets/AgentSessionEventTimeline-N4RXG2NU-JgVOEYK9.js.br +0 -0
- package/dist/_frontend/assets/AgentSessionEventTimeline-N4RXG2NU-JgVOEYK9.js.gz +0 -0
- package/dist/_frontend/assets/{AgentSessionEventTimelineChart-FIAQCYJC-TBWekOBI.js → AgentSessionEventTimelineChart-EMWNJMMK-BRwdPd5w.js} +1 -1
- package/dist/_frontend/assets/AgentSessionEventTimelineChart-EMWNJMMK-BRwdPd5w.js.br +0 -0
- package/dist/_frontend/assets/AgentSessionEventTimelineChart-EMWNJMMK-BRwdPd5w.js.gz +0 -0
- package/dist/_frontend/assets/{AgentSessions-WHODEG2M-OzQblCn4.js → AgentSessions-CD7JAQTC-BXh1e6-3.js} +1 -1
- package/dist/_frontend/assets/AgentSessions-CD7JAQTC-BXh1e6-3.js.br +0 -0
- package/dist/_frontend/assets/AgentSessions-CD7JAQTC-BXh1e6-3.js.gz +0 -0
- package/dist/_frontend/assets/{ConnectorSettings-QTAI4TQX-PySj_xEm.js → ConnectorSettings-GEI4S6SD-BUjOgTQp.js} +1 -1
- package/dist/_frontend/assets/ConnectorSettings-GEI4S6SD-BUjOgTQp.js.br +0 -0
- package/dist/_frontend/assets/ConnectorSettings-GEI4S6SD-BUjOgTQp.js.gz +0 -0
- package/dist/_frontend/assets/{DockLayout-TATYU5SV-DAuT7yes.js → DockLayout-JZ4DKDOR-jsSVZPx1.js} +1 -1
- package/dist/_frontend/assets/{DrawerLayout-DXHNV33K-BP-6TUEf.js → DrawerLayout-AV4FJTGV-DoyHvbgS.js} +2 -2
- package/dist/_frontend/assets/DrawerLayout-AV4FJTGV-DoyHvbgS.js.br +0 -0
- package/dist/_frontend/assets/DrawerLayout-AV4FJTGV-DoyHvbgS.js.gz +0 -0
- package/dist/_frontend/assets/{ModelSettings-UWTBHQRG-L5KYrHBM.js → ModelSettings-4TNETPJJ-1PfEncEw.js} +1 -1
- package/dist/_frontend/assets/ModelSettings-4TNETPJJ-1PfEncEw.js.br +0 -0
- package/dist/_frontend/assets/ModelSettings-4TNETPJJ-1PfEncEw.js.gz +0 -0
- package/dist/_frontend/assets/SandboxSettings-IEIWFKQW-DMx0nXkz.js +1 -0
- package/dist/_frontend/assets/SandboxSettings-IEIWFKQW-DMx0nXkz.js.br +0 -0
- package/dist/_frontend/assets/SandboxSettings-IEIWFKQW-DMx0nXkz.js.gz +0 -0
- package/dist/_frontend/assets/SchedulesPage-ZG5IMQI3-DM9Xo4uZ.js +1 -0
- package/dist/_frontend/assets/SchedulesPage-ZG5IMQI3-DM9Xo4uZ.js.br +0 -0
- package/dist/_frontend/assets/SchedulesPage-ZG5IMQI3-DM9Xo4uZ.js.gz +0 -0
- package/dist/_frontend/assets/{SettingsBuilder-3OA4UCIM-AN2PJd1q.js → SettingsBuilder-B2ULQPIT-D67kXI0z.js} +2 -2
- package/dist/_frontend/assets/SettingsBuilder-B2ULQPIT-D67kXI0z.js.br +0 -0
- package/dist/_frontend/assets/SettingsBuilder-B2ULQPIT-D67kXI0z.js.gz +0 -0
- package/dist/_frontend/assets/{ShellRouteSync-J74MV23Q-CDk4uzrR.js → ShellRouteSync-SJXFKUAJ-BhQD7AoV.js} +1 -1
- package/dist/_frontend/assets/ShellRouteSync-SJXFKUAJ-BhQD7AoV.js.br +0 -0
- package/dist/_frontend/assets/ShellRouteSync-SJXFKUAJ-BhQD7AoV.js.gz +0 -0
- package/dist/_frontend/assets/{SidebarLayout-EQXQPYIU-zWCTPIcp.js → SidebarLayout-XUM2Y6PA-BQdDTrNi.js} +2 -2
- package/dist/_frontend/assets/SidebarLayout-XUM2Y6PA-BQdDTrNi.js.br +0 -0
- package/dist/_frontend/assets/SidebarLayout-XUM2Y6PA-BQdDTrNi.js.gz +0 -0
- package/dist/_frontend/assets/{SkillSettings-KQ6GQ7JW-oZVHsKV_.js → SkillSettings-NHBL5ZXU-BmInxxan.js} +1 -1
- package/dist/_frontend/assets/SkillSettings-NHBL5ZXU-BmInxxan.js.br +0 -0
- package/dist/_frontend/assets/SkillSettings-NHBL5ZXU-BmInxxan.js.gz +0 -0
- package/dist/_frontend/assets/TrueForgeUIWithRouter-NVV7IXXP-DBsGykLD.js +1 -0
- package/dist/_frontend/assets/{WidgetLayout-YWZTYFZL-BgYVWW8O.js → WidgetLayout-T7DBLKV3-CfF0xPJV.js} +1 -1
- package/dist/_frontend/assets/WidgetLayout-T7DBLKV3-CfF0xPJV.js.br +0 -0
- package/dist/_frontend/assets/WidgetLayout-T7DBLKV3-CfF0xPJV.js.gz +0 -0
- package/dist/_frontend/assets/{chunk-4MCIDE2C-ClJFqC75.js → chunk-2QTH6JHX-DIiHfgUm.js} +1 -1
- package/dist/_frontend/assets/chunk-2QTH6JHX-DIiHfgUm.js.br +0 -0
- package/dist/_frontend/assets/chunk-2QTH6JHX-DIiHfgUm.js.gz +0 -0
- package/dist/_frontend/assets/chunk-3R62ISBR-CDV8LPCs.js +1 -0
- package/dist/_frontend/assets/chunk-3R62ISBR-CDV8LPCs.js.br +0 -0
- package/dist/_frontend/assets/chunk-3R62ISBR-CDV8LPCs.js.gz +0 -0
- package/dist/_frontend/assets/{chunk-62JRHF6Z-CXLsU_my.js → chunk-62JRHF6Z-bd9_iLmQ.js} +1 -1
- package/dist/_frontend/assets/chunk-62JRHF6Z-bd9_iLmQ.js.br +0 -0
- package/dist/_frontend/assets/chunk-62JRHF6Z-bd9_iLmQ.js.gz +0 -0
- package/dist/_frontend/assets/{chunk-ZZB3JIBQ-EN4V28Ji.js → chunk-NFUX2ESW-D-OknU8a.js} +2 -2
- package/dist/_frontend/assets/chunk-NFUX2ESW-D-OknU8a.js.br +0 -0
- package/dist/_frontend/assets/chunk-NFUX2ESW-D-OknU8a.js.gz +0 -0
- package/dist/_frontend/assets/{cssMode-Dk1ChNt4.js → cssMode-Buxt2F5C.js} +1 -1
- package/dist/_frontend/assets/cssMode-Buxt2F5C.js.br +0 -0
- package/dist/_frontend/assets/cssMode-Buxt2F5C.js.gz +0 -0
- package/dist/_frontend/assets/{freemarker2-D_Yi-Euz.js → freemarker2-Cdfv6ur6.js} +1 -1
- package/dist/_frontend/assets/freemarker2-Cdfv6ur6.js.br +0 -0
- package/dist/_frontend/assets/freemarker2-Cdfv6ur6.js.gz +0 -0
- package/dist/_frontend/assets/{handlebars-Cm_UQxos.js → handlebars-Dv-Q7Um6.js} +1 -1
- package/dist/_frontend/assets/handlebars-Dv-Q7Um6.js.br +0 -0
- package/dist/_frontend/assets/handlebars-Dv-Q7Um6.js.gz +0 -0
- package/dist/_frontend/assets/{html-BIx_CMMA.js → html-Cwmd4EDN.js} +1 -1
- package/dist/_frontend/assets/html-Cwmd4EDN.js.br +0 -0
- package/dist/_frontend/assets/html-Cwmd4EDN.js.gz +0 -0
- package/dist/_frontend/assets/{htmlMode-D7eeA6bm.js → htmlMode-Cf0xNt85.js} +1 -1
- package/dist/_frontend/assets/htmlMode-Cf0xNt85.js.br +0 -0
- package/dist/_frontend/assets/htmlMode-Cf0xNt85.js.gz +0 -0
- package/dist/_frontend/assets/{index-Y_4XXAao.js → index-BIRSKAK8.js} +243 -243
- package/dist/_frontend/assets/index-BIRSKAK8.js.br +0 -0
- package/dist/_frontend/assets/index-BIRSKAK8.js.gz +0 -0
- package/dist/_frontend/assets/{index-uWXj7DW5.js → index-BxyaDaQf.js} +1 -1
- package/dist/_frontend/assets/index-BxyaDaQf.js.br +0 -0
- package/dist/_frontend/assets/{index-uWXj7DW5.js.gz → index-BxyaDaQf.js.gz} +0 -0
- package/dist/_frontend/assets/{index-BJUe77Ib.js → index-OPxVm2Vd.js} +3 -3
- package/dist/_frontend/assets/index-OPxVm2Vd.js.br +0 -0
- package/dist/_frontend/assets/index-OPxVm2Vd.js.gz +0 -0
- package/dist/_frontend/assets/{javascript-CHojKZO8.js → javascript-BooEWA5C.js} +1 -1
- package/dist/_frontend/assets/{jsonMode-BTk9mIUo.js → jsonMode-Bc4b557E.js} +1 -1
- package/dist/_frontend/assets/jsonMode-Bc4b557E.js.br +0 -0
- package/dist/_frontend/assets/jsonMode-Bc4b557E.js.gz +0 -0
- package/dist/_frontend/assets/{liquid-M5ngFTv5.js → liquid-Dpr5_yD4.js} +1 -1
- package/dist/_frontend/assets/liquid-Dpr5_yD4.js.br +0 -0
- package/dist/_frontend/assets/liquid-Dpr5_yD4.js.gz +0 -0
- package/dist/_frontend/assets/{lspLanguageFeatures-jPhJA8WX.js → lspLanguageFeatures-BR2DRsTt.js} +1 -1
- package/dist/_frontend/assets/lspLanguageFeatures-BR2DRsTt.js.br +0 -0
- package/dist/_frontend/assets/lspLanguageFeatures-BR2DRsTt.js.gz +0 -0
- package/dist/_frontend/assets/{mdx-DmyHsr0E.js → mdx-HA7ugVt3.js} +1 -1
- package/dist/_frontend/assets/mdx-HA7ugVt3.js.br +0 -0
- package/dist/_frontend/assets/mdx-HA7ugVt3.js.gz +0 -0
- package/dist/_frontend/assets/{python-BRFA9b-I.js → python-C2JnSJsq.js} +1 -1
- package/dist/_frontend/assets/python-C2JnSJsq.js.br +0 -0
- package/dist/_frontend/assets/python-C2JnSJsq.js.gz +0 -0
- package/dist/_frontend/assets/{razor-CYsS4Kjw.js → razor-DxJxbSt9.js} +1 -1
- package/dist/_frontend/assets/razor-DxJxbSt9.js.br +0 -0
- package/dist/_frontend/assets/razor-DxJxbSt9.js.gz +0 -0
- package/dist/_frontend/assets/{tsMode-COQtB6OT.js → tsMode-DSQIB4wq.js} +1 -1
- package/dist/_frontend/assets/tsMode-DSQIB4wq.js.br +0 -0
- package/dist/_frontend/assets/tsMode-DSQIB4wq.js.gz +0 -0
- package/dist/_frontend/assets/{typescript-B3uUksf0.js → typescript-CYdXdQVS.js} +1 -1
- package/dist/_frontend/assets/typescript-CYdXdQVS.js.br +0 -0
- package/dist/_frontend/assets/typescript-CYdXdQVS.js.gz +0 -0
- package/dist/_frontend/assets/{workers-CgLq606Q.js → workers-C1M-tlfr.js} +1 -1
- package/dist/_frontend/assets/workers-C1M-tlfr.js.br +0 -0
- package/dist/_frontend/assets/workers-C1M-tlfr.js.gz +0 -0
- package/dist/_frontend/assets/{xml-YO228FLn.js → xml-uosDAHfe.js} +1 -1
- package/dist/_frontend/assets/xml-uosDAHfe.js.br +0 -0
- package/dist/_frontend/assets/xml-uosDAHfe.js.gz +0 -0
- package/dist/_frontend/assets/{yaml-CirMKB9x.js → yaml-CFmHi-W6.js} +1 -1
- package/dist/_frontend/assets/yaml-CFmHi-W6.js.br +0 -0
- package/dist/_frontend/assets/yaml-CFmHi-W6.js.gz +0 -0
- package/dist/_frontend/index.html +1 -1
- package/dist/controller-main.js.map +1 -1
- package/dist/main.js +466 -285
- package/dist/main.js.map +1 -1
- package/dist/postgres/migrations/20260909_000001_agent_description.js +16 -0
- package/dist/postgres/migrations/20260909_000001_agent_description.js.map +1 -0
- package/dist/sqlite/migrations/20260911_000001_agent_description.js +18 -0
- package/dist/sqlite/migrations/20260911_000001_agent_description.js.map +1 -0
- package/package.json +3 -3
- package/dist/_frontend/assets/AgentCodeSnippets-V5A56M7R-ZCh9CtX_.js.br +0 -0
- package/dist/_frontend/assets/AgentCodeSnippets-V5A56M7R-ZCh9CtX_.js.gz +0 -0
- package/dist/_frontend/assets/AgentMetricChart-GEADURES-CIR5UtB4.js +0 -1
- package/dist/_frontend/assets/AgentMetricChart-GEADURES-CIR5UtB4.js.br +0 -0
- package/dist/_frontend/assets/AgentMetricChart-GEADURES-CIR5UtB4.js.gz +0 -0
- package/dist/_frontend/assets/AgentOverview-NPC4P2EY-Z0AslRUd.js +0 -1
- package/dist/_frontend/assets/AgentOverview-NPC4P2EY-Z0AslRUd.js.br +0 -0
- package/dist/_frontend/assets/AgentOverview-NPC4P2EY-Z0AslRUd.js.gz +0 -0
- package/dist/_frontend/assets/AgentSessionEventTimeline-UUXOJXTC-Nk5ZgtJk.js.br +0 -0
- package/dist/_frontend/assets/AgentSessionEventTimeline-UUXOJXTC-Nk5ZgtJk.js.gz +0 -0
- package/dist/_frontend/assets/AgentSessionEventTimelineChart-FIAQCYJC-TBWekOBI.js.br +0 -0
- package/dist/_frontend/assets/AgentSessionEventTimelineChart-FIAQCYJC-TBWekOBI.js.gz +0 -0
- package/dist/_frontend/assets/AgentSessions-WHODEG2M-OzQblCn4.js.br +0 -0
- package/dist/_frontend/assets/AgentSessions-WHODEG2M-OzQblCn4.js.gz +0 -0
- package/dist/_frontend/assets/ConnectorSettings-QTAI4TQX-PySj_xEm.js.br +0 -0
- package/dist/_frontend/assets/ConnectorSettings-QTAI4TQX-PySj_xEm.js.gz +0 -0
- package/dist/_frontend/assets/DrawerLayout-DXHNV33K-BP-6TUEf.js.br +0 -0
- package/dist/_frontend/assets/DrawerLayout-DXHNV33K-BP-6TUEf.js.gz +0 -0
- package/dist/_frontend/assets/ModelSettings-UWTBHQRG-L5KYrHBM.js.br +0 -0
- package/dist/_frontend/assets/ModelSettings-UWTBHQRG-L5KYrHBM.js.gz +0 -0
- package/dist/_frontend/assets/SandboxSettings-BITQONS3-COVuckfo.js +0 -1
- package/dist/_frontend/assets/SandboxSettings-BITQONS3-COVuckfo.js.br +0 -0
- package/dist/_frontend/assets/SandboxSettings-BITQONS3-COVuckfo.js.gz +0 -0
- package/dist/_frontend/assets/SchedulesPage-JIUWNYUH-5f3ROPme.js +0 -1
- package/dist/_frontend/assets/SchedulesPage-JIUWNYUH-5f3ROPme.js.br +0 -0
- package/dist/_frontend/assets/SchedulesPage-JIUWNYUH-5f3ROPme.js.gz +0 -0
- package/dist/_frontend/assets/SettingsBuilder-3OA4UCIM-AN2PJd1q.js.br +0 -0
- package/dist/_frontend/assets/SettingsBuilder-3OA4UCIM-AN2PJd1q.js.gz +0 -0
- package/dist/_frontend/assets/ShellRouteSync-J74MV23Q-CDk4uzrR.js.br +0 -0
- package/dist/_frontend/assets/ShellRouteSync-J74MV23Q-CDk4uzrR.js.gz +0 -0
- package/dist/_frontend/assets/SidebarLayout-EQXQPYIU-zWCTPIcp.js.br +0 -0
- package/dist/_frontend/assets/SidebarLayout-EQXQPYIU-zWCTPIcp.js.gz +0 -0
- package/dist/_frontend/assets/SkillSettings-KQ6GQ7JW-oZVHsKV_.js.br +0 -0
- package/dist/_frontend/assets/SkillSettings-KQ6GQ7JW-oZVHsKV_.js.gz +0 -0
- package/dist/_frontend/assets/TrueForgeUIWithRouter-R3UXQZRY-wD0P6NXT.js +0 -1
- package/dist/_frontend/assets/WidgetLayout-YWZTYFZL-BgYVWW8O.js.br +0 -0
- package/dist/_frontend/assets/WidgetLayout-YWZTYFZL-BgYVWW8O.js.gz +0 -0
- package/dist/_frontend/assets/chunk-4MCIDE2C-ClJFqC75.js.br +0 -0
- package/dist/_frontend/assets/chunk-4MCIDE2C-ClJFqC75.js.gz +0 -0
- package/dist/_frontend/assets/chunk-62JRHF6Z-CXLsU_my.js.br +0 -0
- package/dist/_frontend/assets/chunk-62JRHF6Z-CXLsU_my.js.gz +0 -0
- package/dist/_frontend/assets/chunk-7NYDADYN-_y_WJnHd.js +0 -1
- package/dist/_frontend/assets/chunk-7NYDADYN-_y_WJnHd.js.br +0 -0
- package/dist/_frontend/assets/chunk-7NYDADYN-_y_WJnHd.js.gz +0 -0
- package/dist/_frontend/assets/chunk-ZZB3JIBQ-EN4V28Ji.js.br +0 -0
- package/dist/_frontend/assets/chunk-ZZB3JIBQ-EN4V28Ji.js.gz +0 -0
- package/dist/_frontend/assets/cssMode-Dk1ChNt4.js.br +0 -0
- package/dist/_frontend/assets/cssMode-Dk1ChNt4.js.gz +0 -0
- package/dist/_frontend/assets/freemarker2-D_Yi-Euz.js.br +0 -0
- package/dist/_frontend/assets/freemarker2-D_Yi-Euz.js.gz +0 -0
- package/dist/_frontend/assets/handlebars-Cm_UQxos.js.br +0 -0
- package/dist/_frontend/assets/handlebars-Cm_UQxos.js.gz +0 -0
- package/dist/_frontend/assets/html-BIx_CMMA.js.br +0 -0
- package/dist/_frontend/assets/html-BIx_CMMA.js.gz +0 -0
- package/dist/_frontend/assets/htmlMode-D7eeA6bm.js.br +0 -0
- package/dist/_frontend/assets/htmlMode-D7eeA6bm.js.gz +0 -0
- package/dist/_frontend/assets/index-BJUe77Ib.js.br +0 -0
- package/dist/_frontend/assets/index-BJUe77Ib.js.gz +0 -0
- package/dist/_frontend/assets/index-Y_4XXAao.js.br +0 -0
- package/dist/_frontend/assets/index-Y_4XXAao.js.gz +0 -0
- package/dist/_frontend/assets/index-uWXj7DW5.js.br +0 -0
- package/dist/_frontend/assets/jsonMode-BTk9mIUo.js.br +0 -0
- package/dist/_frontend/assets/jsonMode-BTk9mIUo.js.gz +0 -0
- package/dist/_frontend/assets/liquid-M5ngFTv5.js.br +0 -0
- package/dist/_frontend/assets/liquid-M5ngFTv5.js.gz +0 -0
- package/dist/_frontend/assets/lspLanguageFeatures-jPhJA8WX.js.br +0 -0
- package/dist/_frontend/assets/lspLanguageFeatures-jPhJA8WX.js.gz +0 -0
- package/dist/_frontend/assets/mdx-DmyHsr0E.js.br +0 -0
- package/dist/_frontend/assets/mdx-DmyHsr0E.js.gz +0 -0
- package/dist/_frontend/assets/python-BRFA9b-I.js.br +0 -0
- package/dist/_frontend/assets/python-BRFA9b-I.js.gz +0 -0
- package/dist/_frontend/assets/razor-CYsS4Kjw.js.br +0 -0
- package/dist/_frontend/assets/razor-CYsS4Kjw.js.gz +0 -0
- package/dist/_frontend/assets/tsMode-COQtB6OT.js.br +0 -0
- package/dist/_frontend/assets/tsMode-COQtB6OT.js.gz +0 -0
- package/dist/_frontend/assets/typescript-B3uUksf0.js.br +0 -0
- package/dist/_frontend/assets/typescript-B3uUksf0.js.gz +0 -0
- package/dist/_frontend/assets/workers-CgLq606Q.js.br +0 -0
- package/dist/_frontend/assets/workers-CgLq606Q.js.gz +0 -0
- package/dist/_frontend/assets/xml-YO228FLn.js.br +0 -0
- package/dist/_frontend/assets/xml-YO228FLn.js.gz +0 -0
- package/dist/_frontend/assets/yaml-CirMKB9x.js.br +0 -0
- package/dist/_frontend/assets/yaml-CirMKB9x.js.gz +0 -0
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
// src/db/postgres/migrations/20260909_000001_agent_description.ts
|
|
2
|
+
import { sql } from "kysely";
|
|
3
|
+
async function up(db) {
|
|
4
|
+
await sql`SET LOCAL lock_timeout = '5s'`.execute(db);
|
|
5
|
+
await db.schema.alterTable("agent").addColumn("description", "text", (col) => col.notNull().defaultTo("")).execute();
|
|
6
|
+
await sql`UPDATE agent SET description = name`.execute(db);
|
|
7
|
+
}
|
|
8
|
+
async function down(db) {
|
|
9
|
+
await sql`SET LOCAL lock_timeout = '5s'`.execute(db);
|
|
10
|
+
await db.schema.alterTable("agent").dropColumn("description").execute();
|
|
11
|
+
}
|
|
12
|
+
export {
|
|
13
|
+
down,
|
|
14
|
+
up
|
|
15
|
+
};
|
|
16
|
+
//# sourceMappingURL=20260909_000001_agent_description.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/db/postgres/migrations/20260909_000001_agent_description.ts"],"sourcesContent":["import { sql, type Kysely } from 'kysely';\n\n/** Add agent `description`; backfill existing rows from `name`. */\nexport async function up(db: Kysely<unknown>): Promise<void> {\n await sql`SET LOCAL lock_timeout = '5s'`.execute(db);\n await db.schema\n .alterTable('agent')\n .addColumn('description', 'text', col => col.notNull().defaultTo(''))\n .execute();\n await sql`UPDATE agent SET description = name`.execute(db);\n}\n\nexport async function down(db: Kysely<unknown>): Promise<void> {\n await sql`SET LOCAL lock_timeout = '5s'`.execute(db);\n await db.schema.alterTable('agent').dropColumn('description').execute();\n}\n"],"mappings":";AAAA,SAAS,WAAwB;AAGjC,eAAsB,GAAG,IAAoC;AAC3D,QAAM,mCAAmC,QAAQ,EAAE;AACnD,QAAM,GAAG,OACN,WAAW,OAAO,EAClB,UAAU,eAAe,QAAQ,SAAO,IAAI,QAAQ,EAAE,UAAU,EAAE,CAAC,EACnE,QAAQ;AACX,QAAM,yCAAyC,QAAQ,EAAE;AAC3D;AAEA,eAAsB,KAAK,IAAoC;AAC7D,QAAM,mCAAmC,QAAQ,EAAE;AACnD,QAAM,GAAG,OAAO,WAAW,OAAO,EAAE,WAAW,aAAa,EAAE,QAAQ;AACxE;","names":[]}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
// src/db/sqlite/migrations/20260911_000001_agent_description.ts
|
|
2
|
+
import { sql } from "kysely";
|
|
3
|
+
async function up(db) {
|
|
4
|
+
await db.transaction().execute(async (trx) => {
|
|
5
|
+
await sql`ALTER TABLE agent ADD COLUMN description TEXT NOT NULL DEFAULT ''`.execute(trx);
|
|
6
|
+
await sql`UPDATE agent SET description = name`.execute(trx);
|
|
7
|
+
});
|
|
8
|
+
}
|
|
9
|
+
async function down(db) {
|
|
10
|
+
await db.transaction().execute(async (trx) => {
|
|
11
|
+
await sql`ALTER TABLE agent DROP COLUMN description`.execute(trx);
|
|
12
|
+
});
|
|
13
|
+
}
|
|
14
|
+
export {
|
|
15
|
+
down,
|
|
16
|
+
up
|
|
17
|
+
};
|
|
18
|
+
//# sourceMappingURL=20260911_000001_agent_description.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/db/sqlite/migrations/20260911_000001_agent_description.ts"],"sourcesContent":["import { type Kysely, sql } from 'kysely';\n\n/** Add agent `description`; backfill existing rows from `name`. Mirrors postgres. */\nexport async function up(db: Kysely<unknown>): Promise<void> {\n await db.transaction().execute(async trx => {\n await sql`ALTER TABLE agent ADD COLUMN description TEXT NOT NULL DEFAULT ''`.execute(trx);\n await sql`UPDATE agent SET description = name`.execute(trx);\n });\n}\n\nexport async function down(db: Kysely<unknown>): Promise<void> {\n await db.transaction().execute(async trx => {\n await sql`ALTER TABLE agent DROP COLUMN description`.execute(trx);\n });\n}\n"],"mappings":";AAAA,SAAsB,WAAW;AAGjC,eAAsB,GAAG,IAAoC;AAC3D,QAAM,GAAG,YAAY,EAAE,QAAQ,OAAM,QAAO;AAC1C,UAAM,uEAAuE,QAAQ,GAAG;AACxF,UAAM,yCAAyC,QAAQ,GAAG;AAAA,EAC5D,CAAC;AACH;AAEA,eAAsB,KAAK,IAAoC;AAC7D,QAAM,GAAG,YAAY,EAAE,QAAQ,OAAM,QAAO;AAC1C,UAAM,+CAA+C,QAAQ,GAAG;AAAA,EAClE,CAAC;AACH;","names":[]}
|
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.6",
|
|
4
4
|
"description": "TrueForge Agent Harness: server, HTTP API, and chat UI (npx @truefoundry/trueforge)",
|
|
5
5
|
"author": "TrueFoundry",
|
|
6
6
|
"license": "MIT",
|
|
@@ -47,8 +47,8 @@
|
|
|
47
47
|
"winston": "^3.19.0",
|
|
48
48
|
"yaml": "^2.9.0",
|
|
49
49
|
"zod": "^4.4.3",
|
|
50
|
-
"@truefoundry/trueforge-core": "0.2.0-rc.
|
|
51
|
-
"@truefoundry/trueforge-sdk": "0.2.0-rc.
|
|
50
|
+
"@truefoundry/trueforge-core": "0.2.0-rc.4",
|
|
51
|
+
"@truefoundry/trueforge-sdk": "0.2.0-rc.5"
|
|
52
52
|
},
|
|
53
53
|
"devDependencies": {
|
|
54
54
|
"@swc/core": "^1.16.1",
|
|
Binary file
|
|
Binary file
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{ad as j,r as d,j as a,ay as C,ax as k}from"./index-Y_4XXAao.js";import{c as F,a as M,d as R,L as S,e as D,P as T,f as p,p as w}from"./index-uWXj7DW5.js";M.register(R,S,D,T,p,w);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:x=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])),b=r[(x+o)%r.length];return{label:s.name,data:c.map(n=>L.get(n)??null),borderColor:b,backgroundColor:b,pointRadius:0,pointHoverRadius:0,borderWidth:2,borderCapStyle:"butt",borderJoinStyle:"miter",tension:0,spanGaps:!0}}))??[]}),[x,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
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{c as R,r as _,j as e,I as O,e as D}from"./index-Y_4XXAao.js";var i="text-right font-mono text-primary-button-bg";function p(t){return typeof t=="object"&&t!=null}function u(t){return!("name"in t)||typeof t.name!="string"?null:t.name}function x(t,...a){for(const l of a){const c=t==null?void 0:t[l];if(c!==void 0)return c}}function U(t){if(!p(t))return!1;const a=x(t,"enableTools","enable_tools");return a===void 0||Array.isArray(a)&&a.includes("@all")}function V(t){const a=t.lastIndexOf("/");return a>=0?t.slice(a+1):t}function L({detail:t}){var C,S,A,I,M,E,T,$;const a=R("Markdown"),l=R("AgentOverviewCard"),[c,F]=_.useState("markdown"),[h,g]=_.useState(!1),n=t.agentSpec,f=n.skills??[],b=n.mcpServers??[],j=p(n.model.params)?n.model.params:null,y=x(j,"maxTokens","max_tokens"),N=x(j,"temperature"),o=p(n.config)?n.config:null,m=p(o==null?void 0:o.sandbox)?o.sandbox:null,d=(C=n.instructions)!=null&&C.trim()?n.instructions:null,v=[["Sandbox",typeof(m==null?void 0:m.enabled)=="boolean"?m.enabled?"Enabled":"Disabled":void 0],["Iteration limit",x(o,"iterationLimit","iteration_limit")],["Response format",x(o,"responseFormat","response_format")]].filter(s=>typeof s[1]=="string"||typeof s[1]=="number"),w=[["Generative UI",(A=(S=n.config)==null?void 0:S.generativeUi)==null?void 0:A.enabled],["Dynamic sub-agents",(M=(I=n.config)==null?void 0:I.dynamicSubAgents)==null?void 0:M.enabled],["Ask user questions",(T=(E=n.config)==null?void 0:E.askUserQuestions)==null?void 0:T.enabled]].filter(s=>typeof s[1]=="boolean"),k=c==="markdown"?"Raw":"Markdown";return e.jsxs("div",{className:"grid min-h-0 flex-1 gap-3 overflow-auto p-4 md:grid-cols-[minmax(0,1fr)_18rem] md:overflow-hidden",children:[e.jsxs("section",{className:"flex min-h-64 flex-col rounded-lg border border-border bg-card-bg p-4 text-text-primary",children:[e.jsxs("div",{className:"mb-3 flex shrink-0 items-center justify-between gap-2",children:[e.jsxs("h2",{className:"flex items-center gap-1.5 text-sm font-semibold text-text-primary",children:[e.jsx(O,{name:"book-open",className:"size-4 text-text-secondary"}),"Instructions"]}),d?e.jsxs("div",{className:"inline-flex h-7 items-stretch overflow-hidden rounded-md border border-border bg-primary-bg text-xs font-medium text-text-secondary",role:"group","aria-label":"Instructions actions",children:[e.jsx("button",{type:"button","aria-label":`Show ${k}`,onClick:()=>F(s=>s==="markdown"?"raw":"markdown"),className:"cursor-pointer px-2.5 transition-colors hover:bg-ghost-button-hover hover:text-text-primary",children:k}),e.jsx("span",{className:"w-px self-stretch bg-border","aria-hidden":!0}),e.jsx("button",{type:"button",title:h?"Copied!":"Copy","aria-label":h?"Copied!":"Copy",onClick:()=>{navigator.clipboard.writeText(d).then(()=>{g(!0),setTimeout(()=>g(!1),2e3)})},className:"inline-flex cursor-pointer items-center justify-center px-2 transition-colors hover:bg-ghost-button-hover hover:text-text-primary",children:e.jsx(O,{name:h?"check":"copy",size:12})})]}):null]}),e.jsx("div",{className:"min-h-0 flex-1 overflow-auto",children:d?c==="markdown"?e.jsx(a,{content:d,readOnly:!0,className:"text-sm"}):e.jsx("pre",{className:"whitespace-pre-wrap break-words font-mono text-sm text-text-primary",children:d}):e.jsx("p",{className:"text-sm text-text-secondary",children:"No instructions for this agent."})})]}),e.jsxs("aside",{className:"flex min-h-0 min-w-0 flex-col gap-3 md:overflow-auto",children:[e.jsx(l,{title:"Model Configuration",icon:"cpu",children:e.jsxs("dl",{className:"grid grid-cols-[auto_minmax(0,1fr)] gap-x-3 gap-y-1 text-xs",children:[e.jsx("dt",{className:"text-text-secondary",children:"Model"}),e.jsx("dd",{className:D(i,"truncate"),title:n.model.name,children:V(n.model.name)}),typeof y=="number"?e.jsxs(e.Fragment,{children:[e.jsx("dt",{className:"text-text-secondary",children:"Max tokens"}),e.jsx("dd",{className:i,children:y})]}):null,(($=n.model.params)==null?void 0:$.reasoningEffort)!==void 0?e.jsxs(e.Fragment,{children:[e.jsx("dt",{className:"text-text-secondary",children:"Reasoning"}),e.jsx("dd",{className:i,children:n.model.params.reasoningEffort})]}):null,typeof N=="number"?e.jsxs(e.Fragment,{children:[e.jsx("dt",{className:"text-text-secondary",children:"Temperature"}),e.jsx("dd",{className:i,children:N})]}):null]})}),e.jsx(l,{title:"MCP Servers",icon:"plug",count:b.length,children:b.length===0?e.jsx("p",{className:"text-xs text-text-secondary",children:"No connectors attached."}):e.jsx("ul",{className:"space-y-1.5",children:b.map((s,r)=>e.jsx("li",{className:"rounded-md bg-secondary-bg px-2 py-1.5 text-xs",children:e.jsxs("span",{className:"flex items-center justify-between gap-2",children:[e.jsx("span",{className:"truncate",children:u(s)??`Connector ${r+1}`}),U(s)?e.jsx("span",{className:"shrink-0 rounded-full bg-primary-button-bg/10 px-1.5 py-0.5 text-[10px] text-primary-button-bg",children:"All tools"}):null]})},`${u(s)??"connector"}-${r}`))})}),e.jsx(l,{title:"Attached Skills",icon:"lightbulb",count:f.length,children:f.length===0?e.jsx("p",{className:"text-xs text-text-secondary",children:"No skills attached."}):e.jsx("ul",{className:"space-y-1.5",children:f.map((s,r)=>e.jsx("li",{className:"rounded-md bg-secondary-bg px-2 py-1.5 text-xs",children:u(s)??`Skill ${r+1}`},`${u(s)??"skill"}-${r}`))})}),v.length>0?e.jsx(l,{title:"Execution",icon:"terminal",children:e.jsx("dl",{className:"space-y-1 text-xs",children:v.map(([s,r])=>e.jsxs("div",{className:"flex justify-between gap-3",children:[e.jsx("dt",{className:"text-text-secondary",children:s}),e.jsx("dd",{className:i,children:r})]},s))})}):null,w.length>0?e.jsx(l,{title:"Capabilities",icon:"cube",children:e.jsx("dl",{className:"space-y-1 text-xs",children:w.map(([s,r])=>e.jsxs("div",{className:"flex justify-between gap-3",children:[e.jsx("dt",{className:"text-text-secondary",children:s}),e.jsx("dd",{className:i,children:r?"Enabled":"Disabled"})]},s))})}):null]})]})}export{L as default};
|
|
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
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{aF as V,D as H,r,aG as B,j as e,S as J,I as N,a7 as Y,L,aI as Q,aJ as W,aK as X,e as Z,aL as ee,ab as te}from"./index-Y_4XXAao.js";var se={execTimeoutMs:3e5,autoStopIntervalInMinutes:15,autoArchiveIntervalInMinutes:10080,autoDeleteIntervalInMinutes:43200},E=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:O=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=O??se;k(String(a.execTimeoutMs)),x(String(a.autoStopIntervalInMinutes)),i(String(a.autoArchiveIntervalInMinutes)),o(String(a.autoDeleteIntervalInMinutes)),f(""),v(!1)},[s,O]);const $=a=>{a||S(),l(a)},h=U(m),A=U(u),T=U(M),F=U(p),R=b.trim(),_=(!y||!!R)&&h!=null&&A!=null&&T!=null&&F!=null,z=async a=>{if(a.preventDefault(),!(!_||w||h==null||A==null||T==null||F==null))try{await d({execTimeoutMs:h,autoStopIntervalInMinutes:A,autoArchiveIntervalInMinutes:T,autoDeleteIntervalInMinutes:F,apiKey:R}),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:E})]}),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:E})]}),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:E})]}),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:E})]}),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:E})]})]})]})]}),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(L.Primary,{type:"submit",size:"large",disabled:!_||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}=V(),l=H(),[d,g]=r.useState([]),[I,O]=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),O(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 K=await t.listSandboxProviders();if(n)return;g(K),m(null),K.some(G=>G.snapshotSyncStatus.status==="pending")&&j()}catch(K){if(n)return;m(B(K,"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))},F=t=>{h(async()=>{await s.updateSandboxProvider({id:t.id,...D(t)})}).catch(()=>{})},R=t=>{const n=s.deleteSandboxProvider;n&&h(async()=>{await n({id:t.id})}).catch(()=>{})},_=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(L.Ghost,{size:"small",type:"button",disabled:x,onClick:()=>{F(n)},children:"Retry"}):null,e.jsx(L.Secondary,{size:"small",type:"button",disabled:x,onClick:()=>{u(null),p(null),b(n)},children:"Update"}),s.deleteSandboxProvider?e.jsx(L.Ghost,{size:"small",className:"text-text-secondary",type:"button",disabled:x,onClick:()=>{R(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(L.Secondary,{type:"button",disabled:x,onClick:()=>{u(null),b(null),p(t)},children:"Configure"})]},t.id))})]})]})}),e.jsx(ne,{open:_,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 Fe,D as je,r as i,E as fe,F as Te,y as ye,G as Me,q as ge,H as Qe,j as e,P as Ke,J as Ye,K as te,L as M,I as C,M as Ze,N as Ce,O as Ee,Q as Je,R as Xe,U as ze,V as J,W as et,X,Y as tt,Z as st,$ as nt,a0 as at,a1 as rt,a2 as lt,a3 as it,e as G,c as ot,a4 as ct,a5 as he,d as dt,a6 as ut,a7 as mt,a as xt,a8 as ht,a9 as ft,aa as gt,ab as Ae,i as bt,ac as pt}from"./index-Y_4XXAao.js";var Re=[{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 Le(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone||"UTC"}catch{return"UTC"}}function Nt(t){const n=Le(),l=new Set(Re.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}])),...Re]}var $e=[{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"}],jt={"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:Le()}}function yt(t){return jt[t]??t.split("/").pop()??t}function Oe(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)}:${Oe(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=yt(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 :${Oe(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=$e.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 Pe(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 vt(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 St=[{value:"hourly",label:"Hourly"},{value:"daily",label:"Daily"},{value:"weekly",label:"Weekly"}],kt=Array.from({length:24},(t,n)=>({value:String(n),label:n.toString().padStart(2,"0")})),wt=[0,15,30,45].map(t=>({value:String(t),label:`:${t.toString().padStart(2,"0")}`}));function Tt({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=Nt(t.timezone),p=(r,v)=>{n({...t,[r]:v})},N=r=>{const O=t.weekdays.includes(r)?t.weekdays.filter(B=>B!==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:Ae("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:Ae("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:St.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:$e.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:kt,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:wt,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 Ct(t){return t.startsWith("manual-")}function Et(t){return t==="failed"?"failed":"success"}function Be(t){return t==="failed"?"Failed":t==="triggered"?"Triggered":"Scheduled"}function _e(t){return Ct(t)?"Manual test":"Cron"}function zt(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 At({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:Be(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 Rt={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 Ue({run:t}){const n=Et(t.status),l=pe(t.triggeredAt??t.scheduledFor);return e.jsx(mt,{content:e.jsx(At,{run:t}),side:"top",children:e.jsx("span",{className:G("inline-flex size-6 shrink-0 items-center justify-center rounded-md border",Rt[n]),"aria-label":`${Be(t.status)} run at ${l}`,children:e.jsx(C,{name:n==="failed"?"triangle-exclamation":"check",className:"size-3.5"})})})}function He({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 Pt(t,n){return t.find(l=>l.name===n||l.id===n)??null}function Dt({connector:t,onConnected:n}){return bt()==null?null:e.jsx(pt,{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 It({schedule:t,agentName:n,mcpMounts:l,onEditConfiguration:a}){const o=Ne(),c=je(),{connectors:g,ensureLoaded:b,refreshConnectors:u,loading:x,error:f}=gt(),[p,N]=i.useState(!1),[r,v]=i.useState(null),O=re({cron:t.cron,timezone:t.timezone}),B=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(He,{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=Pt(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(Dt,{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 B(),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(Ue,{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:vt(r.triggeredAt??r.scheduledFor)})]})]})]})]})}function Ft({open:t,onOpenChange:n,mode:l,schedule:a,initialAgentId:o="",onSaved:c}){var ne;const g=Ne(),b=Fe(),u=xt(),x=je(),[f,p]=i.useState(xe),[N,r]=i.useState(o),[v,O]=i.useState([]),[B,w]=i.useState(!1),[m,k]=i.useState({kind:"form"}),[V,I]=i.useState(!1),[le,y]=i.useState(!1),[_,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),Me(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(Pe({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(ht).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(Pe({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:[_!=null?e.jsx("p",{className:"text-failure-bg text-sm",children:_}):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:[_!=null?e.jsx("p",{className:"text-failure-bg text-sm",children:_}):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(ft,{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(It,{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(Tt,{values:f,onChange:p,agentId:N,onAgentIdChange:L||$?void 0:r,agentOptions:Q,agentOptionsLoaded:B,agentPickerDisabled:L||$,onBuildAgent:l==="create"&&(u==null?void 0:u.isComposerEnabled)===!0?()=>{n(!1),u.openAgentBuilder()}:void 0})})})}function De(t){return e.jsx(ut,{children:e.jsx(Ft,{...t})})}function Mt({runs:t}){const n=zt(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(Ue,{run:l},l.id))})}var Lt=[{value:"all",label:"All statuses"},{value:"active",label:"Active"},{value:"paused",label:"Paused"}],Ie=[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 $t(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 Ot({schedule:t,running:n,canManage:l,canDelete:a,onRunNow:o,onEdit:c,onTogglePause:g,onDelete:b}){const u=ot("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(ct,{align:"end",trigger:e.jsx("button",{type:"button",className:dt({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=Fe(),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,B]=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,_]=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(()=>$t(t)),[Q,z]=i.useState(null),[A,ie]=i.useState(()=>ue(it)),[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 ee=j[H],We=(ee==null?void 0:ee.status)==="fulfilled"?ee.value:[];return[D.id,We]})))}finally{d===P.current&&f(!1)}},[n]),S=i.useCallback(async({token:s,size:d,agentId:j})=>{const D=++P.current;B(!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 ee=H instanceof Error?H.message:"Failed to load schedules";m(ee),c([]),u({}),oe(void 0)}finally{D===P.current&&B(!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(()=>{Te({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&&_(s=>s===t?s:(R(void 0),F([]),t))},[t]),i.useEffect(()=>{ne.current||!ye(window.location.search).isNew||(ne.current=!0,Te({isNew:null}))},[]),i.useEffect(()=>{const s=()=>{const d=me(window.location.search);V(d.nameQuery),le(d.statusFilter),_(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 Me(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=Qe(o),Se=Y.length>0||K!=null,Ge=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)}},Ve=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})}}},qe=async s=>{if(g(s.id,"DELETE")){z(null);try{await n.deleteSchedule({id:s.id}),T()}catch(d){a==null||a.showError(d)}}},ke=()=>{K!=null&&(F(s=>[...s,U??""]),R(K))},we=()=>{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(Ke,{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(Ye,{query:k,setQuery:V,placeholder:"Search schedules by name"})}),e.jsx(te,{value:I,onValueChange:le,options:Lt,className:"sm:w-40","aria-label":"Filter by status"}),t===void 0?e.jsx(te,{value:y,onValueChange:s=>{_(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(Ze,{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(Ce,{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(Ce,{title:"No Schedules Found",description:"No schedules match your filters.",className:"flex-1"}),Se?e.jsx(Ee,{pageSize:A,rowCount:0,canPrev:Y.length>0,canNext:K!=null,onPrev:we,onNext:ke,pageSizeOptions:Ie,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(Je,{className:"min-w-[48rem]",children:[e.jsx(Xe,{children:e.jsxs(ze,{className:"hover:bg-transparent",children:[e.jsx(J,{children:"Name"}),e.jsx(J,{children:"Agent"}),ve?e.jsx(J,{children:"Created by"}):null,e.jsx(J,{children:"Frequency"}),e.jsx(J,{children:"Status"}),e.jsx(J,{children:"Last 5 runs"}),e.jsx(J,{children:e.jsx("span",{className:"sr-only",children:"Actions"})})]})}),e.jsx(et,{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(ze,{children:[e.jsx(X,{className:"text-text-primary font-medium",children:e.jsx("span",{className:"text-left !no-underline",children:s.name})}),e.jsx(X,{children:j}),ve?e.jsx(X,{children:e.jsx(tt,{subject:s.createdBySubject})}):null,e.jsx(X,{children:d}),e.jsx(X,{children:e.jsx(He,{status:s.status})}),e.jsx(X,{children:x?e.jsx("span",{className:"text-text-secondary text-sm",children:"…"}):e.jsx(Mt,{runs:b[s.id]??[]})}),e.jsx(X,{className:"text-right",children:e.jsx(Ot,{schedule:s,running:p.has(s.id),canManage:g(s.id,"MANAGE"),canDelete:g(s.id,"DELETE"),onRunNow:()=>void Ve(s),onEdit:()=>{g(s.id,"MANAGE")&&W({kind:"edit",schedule:s})},onTogglePause:()=>void Ge(s),onDelete:()=>{g(s.id,"DELETE")&&z(s)}})})]},s.id)})})]}),(ce.length>0||Se)&&e.jsx(Ee,{pageSize:A,rowCount:ce.length,canPrev:Y.length>0,canNext:K!=null,onPrev:we,onNext:ke,pageSizeOptions:Ie,onPageSizeChange:s=>{const d=ue(s);ie(d),R(void 0),F([])}})]})}),q.kind==="create"?e.jsx(De,{open:!0,mode:"create",initialAgentId:q.agentId??"",onOpenChange:s=>{s||W({kind:"closed"})},onSaved:()=>T()}):null,q.kind==="edit"?e.jsx(De,{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(st,{open:!0,onOpenChange:s=>{s||z(null)},"aria-label":"Delete schedule",className:"max-w-md",children:[e.jsx(nt,{children:e.jsxs(at,{children:[e.jsx(rt,{children:"Delete schedule"}),e.jsxs("p",{className:"text-text-secondary text-sm",children:["“",Q.name,"” will stop running. This cannot be undone."]})]})}),e.jsxs(lt,{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 qe(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-Y_4XXAao.js";import{r as m}from"./chunk-4MCIDE2C-ClJFqC75.js";import{B as i}from"./chunk-62JRHF6Z-CXLsU_my.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
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{j as n,r as d,aN as se,a as D,c as p,aO as j,aP as oe,aQ as re,aR as ae,aS as P,aT as B,h as X,u as Y,aU as E,aV as ie,aW as le,aX as ce,aY as ue,aZ as H,a_ as $,a$ as Z,b0 as de,i as J,b1 as z,b2 as Q,a6 as me,b3 as pe,b4 as fe,b5 as ge,b6 as he,b7 as T,L as q,aM as xe,aa as ee,b8 as Ce,b9 as ne,ba as be,bb as ve,bc as Se,bd as je,be as Ae,bf as ye,g as Me,E as ke,m as te,s as Ie,bg as Re,bh as Ne,bi as Te,bj as we,I as O,d as _,e as w,bk as F,bl as Ee,a7 as Pe,bm as Le}from"./index-Y_4XXAao.js";function Oe(){var b;const{pending:o}=$(),e=Ce(),[t,i]=d.useState({approvalId:null,index:0}),a=d.useRef(null),r=o.length,u=t.approvalId==null?-1:o.findIndex(h=>h.approvalId===t.approvalId),l=u>=0?u:r===0?0:Math.min(t.index,r-1),s=(b=o[l])==null?void 0:b.approvalId;d.useEffect(()=>{const h=s??null;t.approvalId===h&&t.index===l||i({approvalId:h,index:l})},[s,l,t.approvalId,t.index]),d.useEffect(()=>{if(s==null||e==null){s==null&&(a.current=null);return}a.current!==s&&(a.current=s,e.focus(s))},[s,e]);const c=d.useCallback(()=>{var C;const h=Math.max(0,l-1);i({approvalId:((C=o[h])==null?void 0:C.approvalId)??null,index:h})},[o,l]),m=d.useCallback(()=>{var C;const h=Math.min(Math.max(r-1,0),l+1);i({approvalId:((C=o[h])==null?void 0:C.approvalId)??null,index:h})},[r,o,l]),g=d.useCallback(()=>{s==null||e==null||e.focus(s)},[s,e]);return{count:r,index:l,canPrev:l>0,canNext:l<r-1,goPrev:c,goNext:m,focusCurrent:g}}function De(){const o=p("ApprovalNavBanner"),{count:e,index:t,canPrev:i,canNext:a,goPrev:r,goNext:u,focusCurrent:l}=Oe();return e===0?null:n.jsx(o,{total:e,current:t+1,canPrev:i,canNext:a,onPrev:r,onNext:u,onFocusCurrent:l})}var L={radioValue:"",custom:""};function Ue({disabled:o=!1}){const e=p("AskUserPrompt"),{pending:t,respond:i}=H(),a=E(),r=t[0],u=d.useMemo(()=>r==null?[]:[{id:r.toolCallId,question:r.question??"Answer required",options:r.options??[]}],[r]),[l,s]=d.useState(0),[c,m]=d.useState({});d.useEffect(()=>{s(0),m({})},[r==null?void 0:r.toolCallId]);const g=Math.min(l,Math.max(u.length-1,0)),b=u[g],h=b==null?L:c[b.id]??L,C=d.useCallback(v=>{const x=c[v]??L;return x.radioValue===z?x.custom.trim():x.radioValue.trim()},[c]),A=d.useMemo(()=>u.every(v=>C(v.id)),[C,u]),y=h.radioValue===z?h.custom.trim():h.radioValue.trim(),S=a||o||b==null||y.length===0,k=S||!A,M=d.useCallback((v,x)=>{m(N=>({...N,[v]:{...N[v]??L,...x}}))},[]),R=d.useCallback(()=>{if(o||r==null||!A)return;const v=C(r.toolCallId);v&&i({toolCallId:r.toolCallId,content:v})},[A,o,C,r,i]);return r==null||b==null?null:n.jsx(e,{questions:u,readOnly:a||o,currentQuestion:b,currentQuestionIndex:g,currentAnswer:h,totalQuestions:u.length,isMultiQuestion:u.length>1,isLastQuestion:g===u.length-1,allQuestionsAnswered:A,isSubmitDisabled:S,isSubmitAllDisabled:k,onCurrentQuestionIndexChange:s,onCurrentAnswerChange:M,onSubmit:R})}function _e(o){var i,a,r;const e=o.thread.messages,t=e[e.length-1];return(t==null?void 0:t.role)!=="assistant"||((i=t.status)==null?void 0:i.type)!=="requires-action"?!1:((r=(a=t.metadata)==null?void 0:a.custom)==null?void 0:r.pendingMcpAuth)===!0}function Fe(){const o=j(_e),{pending:e}=H(),{pending:t}=$(),i=Z();if(o)return{kind:"mcp"};const a=e[0];if(a!=null){const r=a.toolName;return r!=null&&(i==null?void 0:i[r])!=null?{kind:"custom",toolName:r}:{kind:"ask-user"}}return t.length>0?{kind:"approval"}:{kind:"compose"}}function Be({disabled:o=!1}){const e=Z(),{pending:t,respond:i}=H(),a=E(),r=t[0],u=d.useCallback(s=>{if(o||r==null)return;const c=s.trim();c&&i({toolCallId:r.toolCallId,content:c})},[o,r,i]);if(r==null||r.toolName==null)return null;const l=e==null?void 0:e[r.toolName];return l==null?null:n.jsx(l,{args:r.args??{},disabled:a||o,onSubmit:u})}function He({servers:o,onContinue:e,readOnly:t}){const i=p("McpAuthPrompt"),{handleAuthorize:a}=xe(),{refreshConnectors:r}=ee(),u=l=>{a(l,s=>{s&&r()})};return n.jsx(i,{servers:o,onConnect:u,onContinue:e,readOnly:t})}function Ve({disabled:o=!1}){const e=p("McpAuthPrompt"),{pending:t,resume:i}=de(),a=E(),r=J();if(!t)return null;if(r)return n.jsx(He,{servers:t.mcpServers,onContinue:()=>{o||i()},readOnly:a||o});const u=l=>{const s=t.mcpServers.find(c=>c.id===l);s!=null&&s.authUrl&&window.open(s.authUrl,"_blank","noopener,noreferrer")};return n.jsx(e,{servers:t.mcpServers,onConnect:u,onContinue:()=>{o||i()},readOnly:a||o})}function ze({disabled:o,hasText:e,hasAttachments:t,requiresModel:i,hasModel:a}){return!o&&(e||t)&&(!i||a)}function W({placeholder:o,forceDisabled:e=!1,connectedToBanner:t=!1}){var R,v;const i=p("ComposerShell"),a=Y(),r=D(),u=j(x=>x.composer.text.trim().length>0),l=j(x=>x.composer.attachments.length>0),{agentSpec:s}=ne(),c=r==null||r.mode.status==="active"&&r.mode.isMutable,m=!!((v=(R=s==null?void 0:s.model)==null?void 0:R.name)!=null&&v.trim()),{isBusy:g,send:b,resetBusy:h}=be(),C=B(),A=ve(),y=d.useRef(null),S=g||e||!C,k=ze({disabled:S,hasText:u,hasAttachments:l,requiresModel:c,hasModel:m}),M=()=>{k&&b(()=>a.composer().send())};return n.jsxs(n.Fragment,{children:[n.jsx("input",{ref:y,type:"file",multiple:!0,hidden:!0,onChange:x=>{const N=x.target.files;if(N)for(const U of N)a.composer().addAttachment(U);x.target.value=""}}),n.jsx(T.AttachmentDropzone,{disabled:S,"data-slot":"aui_composer-attachment-dropzone",className:"w-full rounded-[0.75rem] transition-[box-shadow] data-[dragging=true]:ring-focus-ring/20 data-[dragging=true]:ring-3",children:n.jsx(T.Root,{"data-slot":"aui_composer-root",className:"w-full",onSubmit:x=>{x.preventDefault(),M()},children:n.jsx(i,{className:t?"rounded-t-none border-t-0 focus-within:ring-0":void 0,attachments:n.jsx(Se,{}),input:n.jsx(T.Input,{"data-slot":"aui_composer-input",placeholder:o,disabled:S,submitMode:"enter","aria-label":"Message input",className:"text-text-primary placeholder:text-text-secondary/80 max-h-[10lh] min-h-10 w-full resize-none overflow-y-auto rounded-lg border-none bg-transparent px-1 py-1 text-base leading-normal shadow-none outline-none disabled:cursor-not-allowed"}),disabled:S,canSubmit:k,isRunning:g&&!e,onSubmit:M,onCancel:C?()=>{h(),A()}:void 0,onAttach:C?()=>{var x;return(x=y.current)==null?void 0:x.click()}:void 0})})})]})}function G({placeholder:o,forceDisabled:e=!1,connectedToBanner:t=!1}){const i=D(),a=p("ComposerLeftSection"),r=p("ComposerRightSection"),u=Q("ComposerLeftSection"),l=Q("ComposerRightSection"),s=p("DraftComposerLeftSection"),c=p("DraftComposerRightSection");return(i==null?void 0:i.mode.status)==="active"&&i.mode.isMutable?n.jsx(me,{children:n.jsx(pe,{overrides:{ComposerLeftSection:u?s:a,ComposerRightSection:l?c:r},children:n.jsx(W,{placeholder:o,forceDisabled:e,connectedToBanner:t})})}):n.jsx(W,{placeholder:o,forceDisabled:e,connectedToBanner:t})}function Qe({placeholder:o="Ask anything... (Shift+Enter for new line)"}){const e=Fe(),t=B();return e.kind==="mcp"?n.jsx(Ve,{disabled:!t}):e.kind==="custom"?n.jsx(Be,{disabled:!t}):e.kind==="ask-user"?n.jsx(Ue,{disabled:!t}):e.kind==="approval"?n.jsxs("div",{"data-slot":"aui_composer-approval-pause",className:"flex w-full flex-col",children:[n.jsx(De,{}),n.jsx(G,{placeholder:o,forceDisabled:!0,connectedToBanner:!0})]}):n.jsx(G,{placeholder:o})}var qe=200,K='[data-slot="aui_thread-viewport"]';function We(){const o=p("HistoryLoader"),{hasOlderHistory:e,isLoadingOlderHistory:t,loadOlderHistory:i}=ie(),[a,r]=d.useState(null),u=d.useRef(!1),l=d.useCallback(async()=>{if(u.current)return;u.current=!0;const s=(a==null?void 0:a.closest(K))??null,c=(s==null?void 0:s.scrollHeight)??0,m=(s==null?void 0:s.scrollTop)??0;try{await i(),requestAnimationFrame(()=>{if(s==null)return;const g=s.scrollHeight-c;g>0&&s.scrollTo({top:m+g,behavior:"instant"})})}catch{}finally{u.current=!1}},[a,i]);return d.useEffect(()=>{if(a==null||!e)return;const s=a.closest(K),c=new IntersectionObserver(m=>{m.some(g=>g.isIntersecting)&&l()},{root:s,rootMargin:`${qe}px 0px 0px 0px`});return c.observe(a),()=>c.disconnect()},[a,e,l]),e?n.jsx(o,{ref:r,isLoading:t}):null}function Ge(){const o=p("ResumeUnavailable");return ue()?n.jsx(o,{}):null}function Ke(){return j(e=>{var t;return(((t=e.message.attachments)==null?void 0:t.length)??0)>0})?n.jsx("div",{className:"pointer-events-none mb-2 opacity-90",children:n.jsx(je,{})}):null}function Xe(){const o=p("UserMessageEdit"),e=p("MessageTimestamp"),t=E(),i=B(),a=j(s=>s.message.createdAt),{cancel:r,disabled:u}=fe(),{disabled:l}=ge();return n.jsx(he.Root,{"data-role":"user",children:n.jsx(T.Root,{"data-slot":"aui_user-edit-composer-root",className:"fade-in slide-in-from-bottom-1 animate-in flex w-full justify-end px-2 duration-150",children:n.jsx(o,{timestamp:n.jsx(e,{createdAt:a}),attachments:n.jsx(Ke,{}),input:n.jsx("div",{className:"mt-1 rounded border border-border bg-secondary-bg p-2 text-text-primary",children:n.jsx(T.Input,{"data-slot":"aui_user-edit-input",disabled:t||!i,submitMode:"enter","aria-label":"Edit message",className:"max-h-32 min-h-10 w-full resize-none border-none bg-transparent p-0 text-base leading-[1.34] outline-none focus:shadow-none"})}),footer:n.jsxs("div",{className:"flex items-center justify-end gap-2",children:[n.jsx(q.Secondary,{type:"button",disabled:u,onClick:r,children:"Cancel"}),n.jsx(T.Send,{asChild:!0,children:n.jsx(q.Primary,{type:"submit",disabled:l||t||!i,children:"Save & Rerun"})})]})})})})}function Ye(){const o=X(),e=Y(),t=j(l=>l.threadListItem.remoteId),i=j(l=>l.threadListItem.title),a=E(),r=d.useRef(!1),u=d.useRef(void 0);d.useEffect(()=>{u.current=void 0},[t]),d.useEffect(()=>{const l=r.current&&!a;if(r.current=a,!l||o==null||t==null||u.current===t)return;if(i!=null&&i.trim()!==""){u.current=t;return}let s=!1;return o.getSession({sessionId:t}).then(c=>{if(s)return;const m=typeof c.title=="string"?c.title.trim():"";if(m.length!==0)return u.current=t,e.threadListItem().rename(m)}).catch(()=>{}),()=>{s=!0}},[e,a,t,o,i])}function $e({children:o}){return n.jsx("div",{className:"animate-in fade-in slide-in-from-bottom-1 fill-mode-both duration-200",children:o})}function Ze({isEditing:o}){return j(t=>t.message.role)==="user"?o?n.jsx(Xe,{}):n.jsx(le,{}):n.jsx(ce,{})}function Je({composer:o}){d.useEffect(()=>{se()},[]),Ye();const e=D(),t=p("WelcomeScreen"),i=p("MessageListSkeleton"),a=p("ScrollToBottomButton"),r=p("MessageGroup"),u=p("ThreadComposerAreaShell"),l=p("ThreadRootShell"),s=p("ThreadViewportShell"),c=j(oe),m=j(b=>b.thread.isLoading),g=(e==null?void 0:e.mode.status)==="active"?e.mode.agentName!=null&&e.mode.agentName.length>0?e.mode.agentName:e.mode.isMutable&&e.mode.isCreateAgent?"Start building a new Agent":void 0:void 0;return n.jsx(re,{children:n.jsx(ae,{children:n.jsx(P.Root,{asChild:!0,children:n.jsxs(l,{children:[n.jsx(P.Viewport,{asChild:!0,autoScroll:!0,children:n.jsxs(s,{isEmpty:c,children:[c&&n.jsx(t,{heading:g}),c&&!m&&o,m?n.jsx(i,{}):!c&&n.jsxs(n.Fragment,{children:[n.jsx(We,{}),n.jsxs(r,{children:[n.jsx(P.Messages,{children:({message:b})=>n.jsx($e,{children:n.jsx(Ze,{isEditing:b.role==="user"&&b.composer.isEditing})})}),n.jsx(Ge,{})]})]})]})}),!m&&!c&&n.jsxs(u,{isEmpty:c,children:[n.jsx(P.ScrollToBottom,{asChild:!0,children:n.jsx(a,{})}),o]})]})})})})}function nn(){return n.jsx(Je,{composer:n.jsx(Qe,{})})}function tn({className:o}){const e=Ee(),t=j(r=>r.threadListItem.title);if(e===null)return null;const i=(t==null?void 0:t.trim())??"",a=e.allowThreadTitle&&i.length>0?i:e.name;return n.jsxs("h1",{className:w("flex min-w-0 items-center gap-1.5",Le,o),children:[n.jsx("span",{className:"truncate",title:a,children:a}),e.isEditing?n.jsx(Pe,{content:"Try changes here, then choose Update agent to save.",side:"bottom",children:n.jsxs("span",{className:"border-warning-bg/40 bg-warning-bg/10 text-warning-bg inline-flex shrink-0 items-center gap-1 rounded-full border px-2 py-0.5 text-xs font-medium",children:[n.jsx(O,{name:"pencil",className:"size-3"}),"Editing"]})}):null]})}function sn({className:o,labeled:e=!1}){const t=D(),i=J(),a=te(),{mode:r,setTheme:u}=Te(),l=p("ShellActionsActionSlot"),s=r==="dark",c=s?"Light":"Dark",m=we({catalog:i,capabilities:a}),g="hover:bg-secondary-button-hover hover:text-ghost-button-text";return n.jsxs("div",{className:w("flex shrink-0 items-center gap-1",e?"w-full flex-col items-center gap-1 text-sidebar-text":"text-text-primary",o),children:[n.jsxs("a",{href:"https://trueforge.dev",target:"_blank",rel:"noopener noreferrer","aria-label":"Documentation",title:"Documentation",className:_({variant:"ghost",size:e?void 0:"icon",className:w(g,e&&F)}),children:[n.jsx(O,{name:"book-open",size:e?14:void 0}),e?n.jsx("span",{className:"text-center",children:"Docs"}):null]}),n.jsxs("button",{type:"button","aria-label":s?"Switch to light theme":"Switch to dark theme",title:s?"Light theme":"Dark theme",className:_({variant:"ghost",size:e?void 0:"icon",className:w(g,e&&F)}),onClick:()=>u(s?"light":"dark"),children:[n.jsx(O,{name:s?"sun":"moon",size:e?14:void 0}),e?n.jsx("span",{className:"text-center",children:c}):null]}),t!=null&&m?n.jsxs("button",{type:"button","aria-label":"Settings",title:"Settings","aria-expanded":t.settingsOpen,"aria-current":t.settingsOpen?"page":void 0,className:_({variant:"ghost",size:e?void 0:"icon",className:w(g,e&&F,t.settingsOpen&&"bg-primary-button-bg font-medium text-primary-button-text hover:bg-primary-button-hover hover:text-primary-button-text")}),onClick:()=>t.setSettingsOpen(!0),children:[n.jsx(O,{name:"settings",size:e?14:void 0}),e?n.jsx("span",{className:"text-center",children:"Settings"}):null]}):null,n.jsx(l,{})]})}function on({showClose:o=!1}){const{agentSpec:e}=ne(),t=Ae(),i=ye(),a=Me(),r=a.mode.status==="active"?a.mode.agentId:void 0,{allows:u}=ke({resourceType:"agent",resourceIds:r==null?[]:[r]}),l=u(r,"MANAGE"),s=X(),c=te(),m=ee(),g=p("AgentConfigPanel"),b=p("AgentConfigEditors"),[h,C]=d.useState(null),A=Ie(a.mode),{draft:y,flush:S}=Re(),k=d.useCallback(()=>{S(),i(),a.setAgentConfigOpen(!1)},[i,S,a]);d.useEffect(()=>{A&&m.ensureLoaded()},[m,A]),d.useEffect(()=>{l||C(null)},[l]),d.useEffect(()=>{if(!o||!a.agentConfigOpen)return;const f=I=>{!I.defaultPrevented&&I.key==="Escape"&&h===null&&document.querySelector("dialog[open]")===null&&k()};return window.addEventListener("keydown",f),()=>window.removeEventListener("keydown",f)},[k,h,a.agentConfigOpen,o]),d.useEffect(()=>()=>{S();try{i()}catch{}},[i,S]);const M=d.useCallback(({next:f,instructions:I})=>{var V;if(l){if(f.skills&&f.skills.length>0&&(c==null?void 0:c.sandbox.enabled)===!0){t==null||t({...f,instructions:I||void 0,config:{...f.config,sandbox:{...(V=f.config)==null?void 0:V.sandbox,enabled:!0}}});return}t==null||t({...f,instructions:I||void 0})}},[l,c==null?void 0:c.sandbox.enabled,t]),R=d.useCallback(f=>{M({next:f,instructions:y})},[M,y]),v=d.useCallback(f=>{e!==null&&M({next:Ne({spec:e,messages:f.messages}),instructions:f.instructions})},[e,M]),x=d.useCallback(async f=>(s==null?void 0:s.getMcpTools)===void 0?[]:s.getMcpTools({connectorId:f}),[s]),N=d.useCallback(async f=>{var I;return(I=s==null?void 0:s.getMcpConnector)==null?void 0:I.call(s,{connectorId:f})},[s]);if(!A||e===null||o&&!a.agentConfigOpen)return null;const U=m.models.find(f=>f.name===e.model.name);return n.jsxs(n.Fragment,{children:[n.jsx(g,{spec:e,model:U,models:m.models,modelsLoading:m.loading,modelsError:m.error,skills:m.skills,skillsAvailable:(c==null?void 0:c.skill.enabled)===!0,instructions:y,onOpenEditor:f=>{l&&C(f)},onChange:R,disabled:!l,onClose:o?k:void 0}),n.jsx(b,{editor:h,spec:e,models:m.models,connectors:m.connectors,skills:m.skills,loading:m.loading,error:m.error,skillsDisabled:(c==null?void 0:c.skill.enabled)!==!0,sandboxAvailable:(c==null?void 0:c.sandbox.enabled)===!0,instructions:y,onInstructionsSave:v,...(s==null?void 0:s.getMcpConnector)===void 0?{}:{loadMcpConnector:N},loadMcpTools:x,onRefreshConnectors:m.refreshConnectors,onChange:R,onClose:()=>C(null)})]})}export{on as A,tn as N,sn as S,nn as T};
|
|
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
|