@hotmeshio/long-tail 0.4.7 → 0.4.8
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/build/adapters/express.d.ts +68 -0
- package/build/adapters/express.js +163 -0
- package/build/index.d.ts +1 -0
- package/build/index.js +3 -1
- package/build/lib/events/socketio.d.ts +3 -0
- package/build/lib/events/socketio.js +6 -1
- package/build/tsconfig.tsbuildinfo +1 -1
- package/dashboard/dist/assets/{AdminDashboard-qZYNzvw8.js → AdminDashboard-BVtpNGO1.js} +2 -2
- package/dashboard/dist/assets/{AdminDashboard-qZYNzvw8.js.map → AdminDashboard-BVtpNGO1.js.map} +1 -1
- package/dashboard/dist/assets/{AgentConfigPage-_SMbioNp.js → AgentConfigPage-BGDDZpxn.js} +2 -2
- package/dashboard/dist/assets/{AgentConfigPage-_SMbioNp.js.map → AgentConfigPage-BGDDZpxn.js.map} +1 -1
- package/dashboard/dist/assets/{AgentDetailPage-Cf_SRtbT.js → AgentDetailPage-9wlNBv63.js} +2 -2
- package/dashboard/dist/assets/{AgentDetailPage-Cf_SRtbT.js.map → AgentDetailPage-9wlNBv63.js.map} +1 -1
- package/dashboard/dist/assets/{AgentsPage-q53C1Xk_.js → AgentsPage-C8Sf-OUW.js} +2 -2
- package/dashboard/dist/assets/{AgentsPage-q53C1Xk_.js.map → AgentsPage-C8Sf-OUW.js.map} +1 -1
- package/dashboard/dist/assets/{AvailableEscalationsPage-DHWciaKb.js → AvailableEscalationsPage-BzfgOP5p.js} +2 -2
- package/dashboard/dist/assets/{AvailableEscalationsPage-DHWciaKb.js.map → AvailableEscalationsPage-BzfgOP5p.js.map} +1 -1
- package/dashboard/dist/assets/{BotPicker-638n5Jaz.js → BotPicker-6Xk1Fq1l.js} +2 -2
- package/dashboard/dist/assets/{BotPicker-638n5Jaz.js.map → BotPicker-6Xk1Fq1l.js.map} +1 -1
- package/dashboard/dist/assets/{CapabilitiesPage-PmgEhPl8.js → CapabilitiesPage-C30RqH3d.js} +2 -2
- package/dashboard/dist/assets/{CapabilitiesPage-PmgEhPl8.js.map → CapabilitiesPage-C30RqH3d.js.map} +1 -1
- package/dashboard/dist/assets/{CollapsibleSection-BEZoI6NU.js → CollapsibleSection-DR3D4kMt.js} +2 -2
- package/dashboard/dist/assets/{CollapsibleSection-BEZoI6NU.js.map → CollapsibleSection-DR3D4kMt.js.map} +1 -1
- package/dashboard/dist/assets/CredentialsPage-2nEwkFSm.js +2 -0
- package/dashboard/dist/assets/CredentialsPage-2nEwkFSm.js.map +1 -0
- package/dashboard/dist/assets/{CronLabel-Dg8U0s5a.js → CronLabel-Cfq2Hlsq.js} +2 -2
- package/dashboard/dist/assets/{CronLabel-Dg8U0s5a.js.map → CronLabel-Cfq2Hlsq.js.map} +1 -1
- package/dashboard/dist/assets/{CustomDurationPicker-BCbVMr-4.js → CustomDurationPicker-CSvIDpXD.js} +2 -2
- package/dashboard/dist/assets/{CustomDurationPicker-BCbVMr-4.js.map → CustomDurationPicker-CSvIDpXD.js.map} +1 -1
- package/dashboard/dist/assets/{ElapsedCell-fuG5wRDw.js → ElapsedCell-B4nhqILk.js} +2 -2
- package/dashboard/dist/assets/{ElapsedCell-fuG5wRDw.js.map → ElapsedCell-B4nhqILk.js.map} +1 -1
- package/dashboard/dist/assets/{EscalationsOverview-nYOZczYx.js → EscalationsOverview-CvMHVxgm.js} +2 -2
- package/dashboard/dist/assets/{EscalationsOverview-nYOZczYx.js.map → EscalationsOverview-CvMHVxgm.js.map} +1 -1
- package/dashboard/dist/assets/{EventTable-Cm0Ql46x.js → EventTable-faF8fMen.js} +2 -2
- package/dashboard/dist/assets/{EventTable-Cm0Ql46x.js.map → EventTable-faF8fMen.js.map} +1 -1
- package/dashboard/dist/assets/{HomePage-Cx6pvCFX.js → HomePage-DnSHq_dm.js} +2 -2
- package/dashboard/dist/assets/{HomePage-Cx6pvCFX.js.map → HomePage-DnSHq_dm.js.map} +1 -1
- package/dashboard/dist/assets/ListToolbar-C1EXfNfS.js +2 -0
- package/dashboard/dist/assets/ListToolbar-C1EXfNfS.js.map +1 -0
- package/dashboard/dist/assets/{McpOverview-BWsaxVKL.js → McpOverview-B9ZDlmUD.js} +2 -2
- package/dashboard/dist/assets/{McpOverview-BWsaxVKL.js.map → McpOverview-B9ZDlmUD.js.map} +1 -1
- package/dashboard/dist/assets/{McpQueryDetailPage-CQk3YpR-.js → McpQueryDetailPage-DdrdIa-N.js} +2 -2
- package/dashboard/dist/assets/{McpQueryDetailPage-CQk3YpR-.js.map → McpQueryDetailPage-DdrdIa-N.js.map} +1 -1
- package/dashboard/dist/assets/{McpQueryPage-Uf5DKujM.js → McpQueryPage-C9wb1cOa.js} +2 -2
- package/dashboard/dist/assets/{McpQueryPage-Uf5DKujM.js.map → McpQueryPage-C9wb1cOa.js.map} +1 -1
- package/dashboard/dist/assets/{McpRunDetailPage-D9GU27cS.js → McpRunDetailPage-b5ungm-L.js} +2 -2
- package/dashboard/dist/assets/{McpRunDetailPage-D9GU27cS.js.map → McpRunDetailPage-b5ungm-L.js.map} +1 -1
- package/dashboard/dist/assets/{McpRunsPage-5dVAu25-.js → McpRunsPage-wa62n3tp.js} +2 -2
- package/dashboard/dist/assets/{McpRunsPage-5dVAu25-.js.map → McpRunsPage-wa62n3tp.js.map} +1 -1
- package/dashboard/dist/assets/{OperatorDashboard-DNJtUDxl.js → OperatorDashboard-BDpk_HF5.js} +2 -2
- package/dashboard/dist/assets/{OperatorDashboard-DNJtUDxl.js.map → OperatorDashboard-BDpk_HF5.js.map} +1 -1
- package/dashboard/dist/assets/{ProcessDetailPage-BPsvlG0E.js → ProcessDetailPage-DHLKP0kz.js} +2 -2
- package/dashboard/dist/assets/{ProcessDetailPage-BPsvlG0E.js.map → ProcessDetailPage-DHLKP0kz.js.map} +1 -1
- package/dashboard/dist/assets/{ProcessesListPage-CnuCtHSP.js → ProcessesListPage-CpANHQGA.js} +2 -2
- package/dashboard/dist/assets/{ProcessesListPage-CnuCtHSP.js.map → ProcessesListPage-CpANHQGA.js.map} +1 -1
- package/dashboard/dist/assets/{RolesPage-BGJMx2S2.js → RolesPage-Ddta3UZX.js} +2 -2
- package/dashboard/dist/assets/{RolesPage-BGJMx2S2.js.map → RolesPage-Ddta3UZX.js.map} +1 -1
- package/dashboard/dist/assets/{RunAsSelector-CcNnj5AF.js → RunAsSelector-BpeN2J3V.js} +2 -2
- package/dashboard/dist/assets/{RunAsSelector-CcNnj5AF.js.map → RunAsSelector-BpeN2J3V.js.map} +1 -1
- package/dashboard/dist/assets/{SwimlaneTimeline-fWiYlTQw.js → SwimlaneTimeline-DSra_wMN.js} +2 -2
- package/dashboard/dist/assets/{SwimlaneTimeline-fWiYlTQw.js.map → SwimlaneTimeline-DSra_wMN.js.map} +1 -1
- package/dashboard/dist/assets/{TaskDetailPage-Byz19B5I.js → TaskDetailPage-Dqha2tKb.js} +2 -2
- package/dashboard/dist/assets/{TaskDetailPage-Byz19B5I.js.map → TaskDetailPage-Dqha2tKb.js.map} +1 -1
- package/dashboard/dist/assets/{TasksListPage-pe1Opw6s.js → TasksListPage-CM16b5S8.js} +2 -2
- package/dashboard/dist/assets/{TasksListPage-pe1Opw6s.js.map → TasksListPage-CM16b5S8.js.map} +1 -1
- package/dashboard/dist/assets/{TimeAgo-8aYUlXT9.js → TimeAgo-DCjPMPw-.js} +2 -2
- package/dashboard/dist/assets/{TimeAgo-8aYUlXT9.js.map → TimeAgo-DCjPMPw-.js.map} +1 -1
- package/dashboard/dist/assets/{TimestampCell-_1fW34op.js → TimestampCell-BBdTvZ08.js} +2 -2
- package/dashboard/dist/assets/{TimestampCell-_1fW34op.js.map → TimestampCell-BBdTvZ08.js.map} +1 -1
- package/dashboard/dist/assets/{ToolTestPanel-BD7ZkPeM.js → ToolTestPanel-Dz-76HVQ.js} +2 -2
- package/dashboard/dist/assets/{ToolTestPanel-BD7ZkPeM.js.map → ToolTestPanel-Dz-76HVQ.js.map} +1 -1
- package/dashboard/dist/assets/{TopicDetailPage-DL6QarSi.js → TopicDetailPage-Ccqf9h5E.js} +2 -2
- package/dashboard/dist/assets/{TopicDetailPage-DL6QarSi.js.map → TopicDetailPage-Ccqf9h5E.js.map} +1 -1
- package/dashboard/dist/assets/{TopicsPage-JYAk0csl.js → TopicsPage--1V67zFa.js} +2 -2
- package/dashboard/dist/assets/{TopicsPage-JYAk0csl.js.map → TopicsPage--1V67zFa.js.map} +1 -1
- package/dashboard/dist/assets/{UserName-Dcn8reNm.js → UserName-CfaTpV3T.js} +2 -2
- package/dashboard/dist/assets/{UserName-Dcn8reNm.js.map → UserName-CfaTpV3T.js.map} +1 -1
- package/dashboard/dist/assets/{WorkflowExecutionPage-DPie2xiD.js → WorkflowExecutionPage-Cp5_bsHY.js} +2 -2
- package/dashboard/dist/assets/{WorkflowExecutionPage-DPie2xiD.js.map → WorkflowExecutionPage-Cp5_bsHY.js.map} +1 -1
- package/dashboard/dist/assets/{WorkflowsDashboard-BRKurUye.js → WorkflowsDashboard-DaZZg4xU.js} +2 -2
- package/dashboard/dist/assets/{WorkflowsDashboard-BRKurUye.js.map → WorkflowsDashboard-DaZZg4xU.js.map} +1 -1
- package/dashboard/dist/assets/{WorkflowsOverview-C9Wob38P.js → WorkflowsOverview-D_ZkBVhB.js} +2 -2
- package/dashboard/dist/assets/{WorkflowsOverview-C9Wob38P.js.map → WorkflowsOverview-D_ZkBVhB.js.map} +1 -1
- package/dashboard/dist/assets/{YamlWorkflowsPage-BoKSRpKN.js → YamlWorkflowsPage-BKFXRwbK.js} +2 -2
- package/dashboard/dist/assets/{YamlWorkflowsPage-BoKSRpKN.js.map → YamlWorkflowsPage-BKFXRwbK.js.map} +1 -1
- package/dashboard/dist/assets/{agents-CpLOugsY.js → agents-GIg2jxet.js} +2 -2
- package/dashboard/dist/assets/{agents-CpLOugsY.js.map → agents-GIg2jxet.js.map} +1 -1
- package/dashboard/dist/assets/{bots-DRrquJqC.js → bots-CvrmNkL3.js} +2 -2
- package/dashboard/dist/assets/{bots-DRrquJqC.js.map → bots-CvrmNkL3.js.map} +1 -1
- package/dashboard/dist/assets/{capabilities-xbHvOXKc.js → capabilities-CQ5WgulO.js} +2 -2
- package/dashboard/dist/assets/{capabilities-xbHvOXKc.js.map → capabilities-CQ5WgulO.js.map} +1 -1
- package/dashboard/dist/assets/{controlplane-FilVp8jI.js → controlplane-sh5paKGB.js} +2 -2
- package/dashboard/dist/assets/{controlplane-FilVp8jI.js.map → controlplane-sh5paKGB.js.map} +1 -1
- package/dashboard/dist/assets/{escalation-SGea3mBy.js → escalation-DlTtA35J.js} +2 -2
- package/dashboard/dist/assets/{escalation-SGea3mBy.js.map → escalation-DlTtA35J.js.map} +1 -1
- package/dashboard/dist/assets/{escalation-columns-C6sLGnSX.js → escalation-columns-BHiDO_RZ.js} +2 -2
- package/dashboard/dist/assets/{escalation-columns-C6sLGnSX.js.map → escalation-columns-BHiDO_RZ.js.map} +1 -1
- package/dashboard/dist/assets/{helpers-wHzG3Maf.js → helpers-DuKOBZxw.js} +2 -2
- package/dashboard/dist/assets/{helpers-wHzG3Maf.js.map → helpers-DuKOBZxw.js.map} +1 -1
- package/dashboard/dist/assets/{index-C7k3xfpt.js → index-7icR5Pxv.js} +2 -2
- package/dashboard/dist/assets/index-7icR5Pxv.js.map +1 -0
- package/dashboard/dist/assets/{index-E1i1ADY1.js → index-BWXKb7C7.js} +2 -2
- package/dashboard/dist/assets/{index-E1i1ADY1.js.map → index-BWXKb7C7.js.map} +1 -1
- package/dashboard/dist/assets/{index-90jmsIHz.js → index-BXGMin7U.js} +2 -2
- package/dashboard/dist/assets/{index-90jmsIHz.js.map → index-BXGMin7U.js.map} +1 -1
- package/dashboard/dist/assets/{index-B7Vxutyl.js → index-B_e2uIz9.js} +28 -28
- package/dashboard/dist/assets/index-B_e2uIz9.js.map +1 -0
- package/dashboard/dist/assets/{index-Bu2EEWNN.js → index-C-JkowYp.js} +2 -2
- package/dashboard/dist/assets/{index-Bu2EEWNN.js.map → index-C-JkowYp.js.map} +1 -1
- package/dashboard/dist/assets/{index-H2tN256i.js → index-CRDT24gK.js} +2 -2
- package/dashboard/dist/assets/{index-H2tN256i.js.map → index-CRDT24gK.js.map} +1 -1
- package/dashboard/dist/assets/{index-BS3KIrQL.js → index-CglOyur2.js} +2 -2
- package/dashboard/dist/assets/{index-BS3KIrQL.js.map → index-CglOyur2.js.map} +1 -1
- package/dashboard/dist/assets/{index-DzgixtgL.js → index-CugmdGk-.js} +2 -2
- package/dashboard/dist/assets/{index-DzgixtgL.js.map → index-CugmdGk-.js.map} +1 -1
- package/dashboard/dist/assets/{index-WwUcAoas.js → index-DIpDSspp.js} +2 -2
- package/dashboard/dist/assets/{index-WwUcAoas.js.map → index-DIpDSspp.js.map} +1 -1
- package/dashboard/dist/assets/{index-DVxBi47d.js → index-Dbxp9Nvq.js} +2 -2
- package/dashboard/dist/assets/{index-DVxBi47d.js.map → index-Dbxp9Nvq.js.map} +1 -1
- package/dashboard/dist/assets/{index-CkYNpw4d.js → index-JH__2KWY.js} +2 -2
- package/dashboard/dist/assets/{index-CkYNpw4d.js.map → index-JH__2KWY.js.map} +1 -1
- package/dashboard/dist/assets/{index-C8xDd-Ys.js → index-PZaFsSGv.js} +2 -2
- package/dashboard/dist/assets/{index-C8xDd-Ys.js.map → index-PZaFsSGv.js.map} +1 -1
- package/dashboard/dist/assets/{index-Dr8WJAGM.js → index-qpt9aUuQ.js} +2 -2
- package/dashboard/dist/assets/{index-Dr8WJAGM.js.map → index-qpt9aUuQ.js.map} +1 -1
- package/dashboard/dist/assets/{knowledge-CQWNz28-.js → knowledge-tDl7bioT.js} +2 -2
- package/dashboard/dist/assets/{knowledge-CQWNz28-.js.map → knowledge-tDl7bioT.js.map} +1 -1
- package/dashboard/dist/assets/{mcp-J_cDlKuA.js → mcp-CvdtxZQK.js} +2 -2
- package/dashboard/dist/assets/{mcp-J_cDlKuA.js.map → mcp-CvdtxZQK.js.map} +1 -1
- package/dashboard/dist/assets/{mcp-query-C1zyeRvo.js → mcp-query-D5uxvom6.js} +2 -2
- package/dashboard/dist/assets/{mcp-query-C1zyeRvo.js.map → mcp-query-D5uxvom6.js.map} +1 -1
- package/dashboard/dist/assets/{mcp-runs-BR4fvXXw.js → mcp-runs-DBUF_MeD.js} +2 -2
- package/dashboard/dist/assets/{mcp-runs-BR4fvXXw.js.map → mcp-runs-DBUF_MeD.js.map} +1 -1
- package/dashboard/dist/assets/{namespaces-XOr9_XCV.js → namespaces-BYTDs3EH.js} +2 -2
- package/dashboard/dist/assets/{namespaces-XOr9_XCV.js.map → namespaces-BYTDs3EH.js.map} +1 -1
- package/dashboard/dist/assets/{roles-yuxJgQBf.js → roles-BWPoKy_E.js} +2 -2
- package/dashboard/dist/assets/{roles-yuxJgQBf.js.map → roles-BWPoKy_E.js.map} +1 -1
- package/dashboard/dist/assets/{tasks-CI3qsHdP.js → tasks-BQH9o3Ge.js} +2 -2
- package/dashboard/dist/assets/{tasks-CI3qsHdP.js.map → tasks-BQH9o3Ge.js.map} +1 -1
- package/dashboard/dist/assets/{topics-lm2GYKuv.js → topics-BjuxqPQn.js} +2 -2
- package/dashboard/dist/assets/{topics-lm2GYKuv.js.map → topics-BjuxqPQn.js.map} +1 -1
- package/dashboard/dist/assets/{useEventHooks-DpvfSw9p.js → useEventHooks-CZR0V3cW.js} +2 -2
- package/dashboard/dist/assets/{useEventHooks-DpvfSw9p.js.map → useEventHooks-CZR0V3cW.js.map} +1 -1
- package/dashboard/dist/assets/{useYamlActivityEvents-D-zuU9Ts.js → useYamlActivityEvents-DATwT-Bk.js} +2 -2
- package/dashboard/dist/assets/{useYamlActivityEvents-D-zuU9Ts.js.map → useYamlActivityEvents-DATwT-Bk.js.map} +1 -1
- package/dashboard/dist/assets/{users-DRkulG9o.js → users-DzO800OU.js} +2 -2
- package/dashboard/dist/assets/{users-DRkulG9o.js.map → users-DzO800OU.js.map} +1 -1
- package/dashboard/dist/assets/{workflows-dhvM792w.js → workflows-C093TSq9.js} +2 -2
- package/dashboard/dist/assets/{workflows-dhvM792w.js.map → workflows-C093TSq9.js.map} +1 -1
- package/dashboard/dist/assets/{yaml-workflows-DqbGpE2x.js → yaml-workflows-Du9N-ZOj.js} +2 -2
- package/dashboard/dist/assets/{yaml-workflows-DqbGpE2x.js.map → yaml-workflows-Du9N-ZOj.js.map} +1 -1
- package/dashboard/dist/index.html +6 -6
- package/package.json +1 -1
- package/dashboard/dist/assets/CredentialsPage-Dl15oW3U.js +0 -2
- package/dashboard/dist/assets/CredentialsPage-Dl15oW3U.js.map +0 -1
- package/dashboard/dist/assets/ListToolbar-YHesiWwN.js +0 -2
- package/dashboard/dist/assets/ListToolbar-YHesiWwN.js.map +0 -1
- package/dashboard/dist/assets/index-B7Vxutyl.js.map +0 -1
- package/dashboard/dist/assets/index-C7k3xfpt.js.map +0 -1
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import { Router } from 'express';
|
|
2
|
+
import type { Server as HttpServer } from 'http';
|
|
3
|
+
/**
|
|
4
|
+
* Express adapter for mounting the Long Tail dashboard at an arbitrary subpath
|
|
5
|
+
* inside an existing Express-based application (NestJS, Fastify-Express, etc.).
|
|
6
|
+
*
|
|
7
|
+
* @example NestJS
|
|
8
|
+
* ```typescript
|
|
9
|
+
* import { LTExpressAdapter } from '@hotmeshio/long-tail';
|
|
10
|
+
*
|
|
11
|
+
* const adapter = new LTExpressAdapter();
|
|
12
|
+
* adapter.setBasePath('/admin/longtail');
|
|
13
|
+
*
|
|
14
|
+
* @Module({})
|
|
15
|
+
* export class LongTailUiModule implements NestModule {
|
|
16
|
+
* configure(consumer: MiddlewareConsumer) {
|
|
17
|
+
* consumer
|
|
18
|
+
* .apply(adapter.getRouter())
|
|
19
|
+
* .forRoutes('/admin/longtail');
|
|
20
|
+
* }
|
|
21
|
+
*
|
|
22
|
+
* async onModuleInit() {
|
|
23
|
+
* // Attach socket.io to the host's HTTP server for real-time events
|
|
24
|
+
* const httpServer = this.httpAdapterHost.httpAdapter.getHttpServer();
|
|
25
|
+
* await adapter.attachServer(httpServer);
|
|
26
|
+
* }
|
|
27
|
+
* }
|
|
28
|
+
* ```
|
|
29
|
+
*
|
|
30
|
+
* @example Express
|
|
31
|
+
* ```typescript
|
|
32
|
+
* import { LTExpressAdapter } from '@hotmeshio/long-tail';
|
|
33
|
+
*
|
|
34
|
+
* const adapter = new LTExpressAdapter();
|
|
35
|
+
* adapter.setBasePath('/admin/longtail');
|
|
36
|
+
* app.use('/admin/longtail', adapter.getRouter());
|
|
37
|
+
*
|
|
38
|
+
* const server = app.listen(3000);
|
|
39
|
+
* await adapter.attachServer(server);
|
|
40
|
+
* ```
|
|
41
|
+
*/
|
|
42
|
+
export declare class LTExpressAdapter {
|
|
43
|
+
private basePath;
|
|
44
|
+
/**
|
|
45
|
+
* Set the subpath where the dashboard is mounted.
|
|
46
|
+
* Omit or pass '' for root-level deployment (standalone mode).
|
|
47
|
+
*/
|
|
48
|
+
setBasePath(basePath: string): void;
|
|
49
|
+
/**
|
|
50
|
+
* Attach Socket.IO to the host's HTTP server for real-time events.
|
|
51
|
+
*
|
|
52
|
+
* When Long Tail is started with `server: { enabled: false }` (embedded mode),
|
|
53
|
+
* the internal server is not created. Call this after the host server is
|
|
54
|
+
* listening so Socket.IO can bind to it with the correct subpath.
|
|
55
|
+
*
|
|
56
|
+
* Safe to call even when no Socket.IO adapter is registered — it no-ops.
|
|
57
|
+
*/
|
|
58
|
+
attachServer(server: HttpServer): Promise<void>;
|
|
59
|
+
/**
|
|
60
|
+
* Return a self-contained Express Router that serves:
|
|
61
|
+
* - `/api/*` — Long Tail API routes (auth, tasks, escalations, etc.)
|
|
62
|
+
* - `/health` — health check
|
|
63
|
+
* - Static dashboard assets
|
|
64
|
+
* - SPA fallback with injected `<base href>` and `window.__LT_BASE__`
|
|
65
|
+
*/
|
|
66
|
+
getRouter(): Router;
|
|
67
|
+
private resolveDashboardDist;
|
|
68
|
+
}
|
|
@@ -0,0 +1,163 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
36
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
37
|
+
};
|
|
38
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
|
+
exports.LTExpressAdapter = void 0;
|
|
40
|
+
const fs_1 = require("fs");
|
|
41
|
+
const path_1 = __importDefault(require("path"));
|
|
42
|
+
const express_1 = __importStar(require("express"));
|
|
43
|
+
const routes_1 = __importDefault(require("../routes"));
|
|
44
|
+
const events_1 = require("../lib/events");
|
|
45
|
+
const socketio_1 = require("../lib/events/socketio");
|
|
46
|
+
/**
|
|
47
|
+
* Express adapter for mounting the Long Tail dashboard at an arbitrary subpath
|
|
48
|
+
* inside an existing Express-based application (NestJS, Fastify-Express, etc.).
|
|
49
|
+
*
|
|
50
|
+
* @example NestJS
|
|
51
|
+
* ```typescript
|
|
52
|
+
* import { LTExpressAdapter } from '@hotmeshio/long-tail';
|
|
53
|
+
*
|
|
54
|
+
* const adapter = new LTExpressAdapter();
|
|
55
|
+
* adapter.setBasePath('/admin/longtail');
|
|
56
|
+
*
|
|
57
|
+
* @Module({})
|
|
58
|
+
* export class LongTailUiModule implements NestModule {
|
|
59
|
+
* configure(consumer: MiddlewareConsumer) {
|
|
60
|
+
* consumer
|
|
61
|
+
* .apply(adapter.getRouter())
|
|
62
|
+
* .forRoutes('/admin/longtail');
|
|
63
|
+
* }
|
|
64
|
+
*
|
|
65
|
+
* async onModuleInit() {
|
|
66
|
+
* // Attach socket.io to the host's HTTP server for real-time events
|
|
67
|
+
* const httpServer = this.httpAdapterHost.httpAdapter.getHttpServer();
|
|
68
|
+
* await adapter.attachServer(httpServer);
|
|
69
|
+
* }
|
|
70
|
+
* }
|
|
71
|
+
* ```
|
|
72
|
+
*
|
|
73
|
+
* @example Express
|
|
74
|
+
* ```typescript
|
|
75
|
+
* import { LTExpressAdapter } from '@hotmeshio/long-tail';
|
|
76
|
+
*
|
|
77
|
+
* const adapter = new LTExpressAdapter();
|
|
78
|
+
* adapter.setBasePath('/admin/longtail');
|
|
79
|
+
* app.use('/admin/longtail', adapter.getRouter());
|
|
80
|
+
*
|
|
81
|
+
* const server = app.listen(3000);
|
|
82
|
+
* await adapter.attachServer(server);
|
|
83
|
+
* ```
|
|
84
|
+
*/
|
|
85
|
+
class LTExpressAdapter {
|
|
86
|
+
constructor() {
|
|
87
|
+
this.basePath = '';
|
|
88
|
+
}
|
|
89
|
+
/**
|
|
90
|
+
* Set the subpath where the dashboard is mounted.
|
|
91
|
+
* Omit or pass '' for root-level deployment (standalone mode).
|
|
92
|
+
*/
|
|
93
|
+
setBasePath(basePath) {
|
|
94
|
+
this.basePath = basePath.replace(/\/+$/, '');
|
|
95
|
+
}
|
|
96
|
+
/**
|
|
97
|
+
* Attach Socket.IO to the host's HTTP server for real-time events.
|
|
98
|
+
*
|
|
99
|
+
* When Long Tail is started with `server: { enabled: false }` (embedded mode),
|
|
100
|
+
* the internal server is not created. Call this after the host server is
|
|
101
|
+
* listening so Socket.IO can bind to it with the correct subpath.
|
|
102
|
+
*
|
|
103
|
+
* Safe to call even when no Socket.IO adapter is registered — it no-ops.
|
|
104
|
+
*/
|
|
105
|
+
async attachServer(server) {
|
|
106
|
+
const socketAdapter = events_1.eventRegistry.getAdapter(socketio_1.SocketIOEventAdapter);
|
|
107
|
+
if (socketAdapter) {
|
|
108
|
+
// Override the socket.io path to include the base path
|
|
109
|
+
if (this.basePath) {
|
|
110
|
+
socketAdapter.setPath(`${this.basePath}/socket.io`);
|
|
111
|
+
}
|
|
112
|
+
socketAdapter.attachServer(server);
|
|
113
|
+
await socketAdapter.connect();
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
/**
|
|
117
|
+
* Return a self-contained Express Router that serves:
|
|
118
|
+
* - `/api/*` — Long Tail API routes (auth, tasks, escalations, etc.)
|
|
119
|
+
* - `/health` — health check
|
|
120
|
+
* - Static dashboard assets
|
|
121
|
+
* - SPA fallback with injected `<base href>` and `window.__LT_BASE__`
|
|
122
|
+
*/
|
|
123
|
+
getRouter() {
|
|
124
|
+
const router = (0, express_1.Router)();
|
|
125
|
+
router.use(express_1.default.json());
|
|
126
|
+
// Health check
|
|
127
|
+
router.get('/health', (_req, res) => {
|
|
128
|
+
res.json({ status: 'ok', timestamp: new Date().toISOString() });
|
|
129
|
+
});
|
|
130
|
+
// API routes — internal routes handle their own JWT auth
|
|
131
|
+
router.use('/api', routes_1.default);
|
|
132
|
+
// Dashboard static assets
|
|
133
|
+
const dashboardDist = this.resolveDashboardDist();
|
|
134
|
+
if (dashboardDist) {
|
|
135
|
+
router.use(express_1.default.static(dashboardDist));
|
|
136
|
+
// SPA fallback — inject base path into index.html
|
|
137
|
+
const indexHtml = (0, fs_1.readFileSync)(path_1.default.join(dashboardDist, 'index.html'), 'utf-8');
|
|
138
|
+
router.get('/{*splat}', (_req, res) => {
|
|
139
|
+
const html = indexHtml.replace('<head>', '<head>' +
|
|
140
|
+
`<base href="${this.basePath}/">` +
|
|
141
|
+
`<script>window.__LT_BASE__="${this.basePath}"</script>`);
|
|
142
|
+
res.type('html').send(html);
|
|
143
|
+
});
|
|
144
|
+
}
|
|
145
|
+
return router;
|
|
146
|
+
}
|
|
147
|
+
resolveDashboardDist() {
|
|
148
|
+
// Check multiple paths relative to the compiled output location:
|
|
149
|
+
// - Dev (ts-node from repo root): adapters/ -> dashboard/dist
|
|
150
|
+
// - Prod (node build/): build/adapters/ -> dashboard/dist
|
|
151
|
+
// - npm package: node_modules/@hotmeshio/long-tail/build/adapters/ -> dashboard/dist
|
|
152
|
+
const candidates = [
|
|
153
|
+
path_1.default.join(__dirname, '..', 'dashboard', 'dist'),
|
|
154
|
+
path_1.default.join(__dirname, '..', '..', 'dashboard', 'dist'),
|
|
155
|
+
];
|
|
156
|
+
for (const candidate of candidates) {
|
|
157
|
+
if ((0, fs_1.existsSync)(candidate))
|
|
158
|
+
return candidate;
|
|
159
|
+
}
|
|
160
|
+
return null;
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
exports.LTExpressAdapter = LTExpressAdapter;
|
package/build/index.d.ts
CHANGED
package/build/index.js
CHANGED
|
@@ -37,7 +37,7 @@ var __importStar = (this && this.__importStar) || (function () {
|
|
|
37
37
|
})();
|
|
38
38
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
39
|
exports.getSystemWorkers = exports.registerMcpTool = exports.getToolContext = exports.getActivityIdentity = exports.McpEscalationStrategy = exports.DefaultEscalationStrategy = exports.escalationStrategyRegistry = exports.McpVisionServer = exports.McpTranslationServer = exports.McpServer = exports.McpClient = exports.McpService = exports.BuiltInMcpAdapter = exports.mcpRegistry = exports.defaultMaintenanceConfig = exports.maintenanceRegistry = exports.PinoLoggerAdapter = exports.loggerRegistry = exports.HoneycombTelemetryAdapter = exports.telemetryRegistry = exports.publishKnowledgeEvent = exports.publishAgentEvent = exports.publishWorkflowEvent = exports.publishActivityEvent = exports.publishEscalationEvent = exports.publishTaskEvent = exports.publishMilestoneEvent = exports.SocketIOEventAdapter = exports.InMemoryEventAdapter = exports.NatsEventAdapter = exports.eventRegistry = exports.ltConfig = exports.seedConfigTopics = exports.seedSystemTopics = exports.TopicService = exports.UserService = exports.ConfigService = exports.EscalationService = exports.TaskService = exports.signToken = exports.requireAdmin = exports.requireAuth = exports.createAuthMiddleware = exports.JwtAuthAdapter = exports.conditionLT = exports.executeLT = exports.createLTActivityInterceptor = exports.createLTInterceptor = exports.registerLT = exports.start = void 0;
|
|
40
|
-
exports.api = exports.KnowledgeApi = exports.resolveCredential = exports.mimeFromPath = exports.getStorageBackend = exports.listOAuthConnections = exports.getFreshAccessToken = exports.createClient = exports.CallbackEventAdapter = exports.builtinMcpServerFactories = exports.getSystemAgents = void 0;
|
|
40
|
+
exports.LTExpressAdapter = exports.api = exports.KnowledgeApi = exports.resolveCredential = exports.mimeFromPath = exports.getStorageBackend = exports.listOAuthConnections = exports.getFreshAccessToken = exports.createClient = exports.CallbackEventAdapter = exports.builtinMcpServerFactories = exports.getSystemAgents = void 0;
|
|
41
41
|
const config_1 = require("./modules/config");
|
|
42
42
|
const logger_1 = require("./lib/logger");
|
|
43
43
|
const start_1 = require("./start");
|
|
@@ -138,6 +138,8 @@ var credentials_1 = require("./services/iam/credentials");
|
|
|
138
138
|
Object.defineProperty(exports, "resolveCredential", { enumerable: true, get: function () { return credentials_1.resolveCredential; } });
|
|
139
139
|
exports.KnowledgeApi = __importStar(require("./api/knowledge"));
|
|
140
140
|
exports.api = __importStar(require("./api"));
|
|
141
|
+
var express_1 = require("./adapters/express");
|
|
142
|
+
Object.defineProperty(exports, "LTExpressAdapter", { enumerable: true, get: function () { return express_1.LTExpressAdapter; } });
|
|
141
143
|
// ─── Server ──────────────────────────────────────────────────────────────────
|
|
142
144
|
async function main() {
|
|
143
145
|
const honeycombKey = process.env.HONEYCOMB_API_KEY;
|
|
@@ -34,11 +34,14 @@ export declare class SocketIOEventAdapter implements LTEventAdapter {
|
|
|
34
34
|
private io;
|
|
35
35
|
private httpServer;
|
|
36
36
|
private authenticate;
|
|
37
|
+
private socketPath;
|
|
37
38
|
constructor(options?: {
|
|
38
39
|
authenticate?: SocketIOAuthenticator;
|
|
39
40
|
});
|
|
40
41
|
/** Attach to an HTTP server. Must be called before connect(). */
|
|
41
42
|
attachServer(server: HttpServer): void;
|
|
43
|
+
/** Override the socket.io path (for subpath-mounted deployments). */
|
|
44
|
+
setPath(socketPath: string): void;
|
|
42
45
|
connect(): Promise<void>;
|
|
43
46
|
publish(event: LTEvent): Promise<void>;
|
|
44
47
|
disconnect(): Promise<void>;
|
|
@@ -32,12 +32,17 @@ class SocketIOEventAdapter {
|
|
|
32
32
|
constructor(options) {
|
|
33
33
|
this.io = null;
|
|
34
34
|
this.httpServer = null;
|
|
35
|
+
this.socketPath = '/socket.io';
|
|
35
36
|
this.authenticate = options?.authenticate ?? null;
|
|
36
37
|
}
|
|
37
38
|
/** Attach to an HTTP server. Must be called before connect(). */
|
|
38
39
|
attachServer(server) {
|
|
39
40
|
this.httpServer = server;
|
|
40
41
|
}
|
|
42
|
+
/** Override the socket.io path (for subpath-mounted deployments). */
|
|
43
|
+
setPath(socketPath) {
|
|
44
|
+
this.socketPath = socketPath;
|
|
45
|
+
}
|
|
41
46
|
async connect() {
|
|
42
47
|
if (!this.httpServer) {
|
|
43
48
|
logger_1.loggerRegistry.warn('[lt-events:socketio] no HTTP server attached — skipping');
|
|
@@ -45,7 +50,7 @@ class SocketIOEventAdapter {
|
|
|
45
50
|
}
|
|
46
51
|
this.io = new socket_io_1.Server(this.httpServer, {
|
|
47
52
|
cors: { origin: '*', methods: ['GET', 'POST'] },
|
|
48
|
-
path:
|
|
53
|
+
path: this.socketPath,
|
|
49
54
|
transports: ['polling', 'websocket'],
|
|
50
55
|
allowEIO3: true,
|
|
51
56
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"root":["../index.ts","../vitest.config.ts","../vitest.integration.config.ts","../api/agent-subscriptions.ts","../api/agents.ts","../api/auth.ts","../api/bot-accounts.ts","../api/capabilities.ts","../api/controlplane.ts","../api/dba.ts","../api/exports.ts","../api/files.ts","../api/index.ts","../api/insight.ts","../api/knowledge.ts","../api/maintenance.ts","../api/mcp-runs.ts","../api/namespaces.ts","../api/roles.ts","../api/settings.ts","../api/tasks.ts","../api/topics.ts","../api/users.ts","../api/workflow-sets.ts","../api/escalations/bulk.ts","../api/escalations/claim.ts","../api/escalations/create.ts","../api/escalations/helpers.ts","../api/escalations/index.ts","../api/escalations/list.ts","../api/escalations/resolve.ts","../api/escalations/single.ts","../api/mcp/index.ts","../api/mcp/servers.ts","../api/mcp/tools.ts","../api/workflows/config.ts","../api/workflows/discovery.ts","../api/workflows/index.ts","../api/workflows/invocation.ts","../api/yaml-workflows/cron.ts","../api/yaml-workflows/crud.ts","../api/yaml-workflows/deploy.ts","../api/yaml-workflows/helpers.ts","../api/yaml-workflows/index.ts","../api/yaml-workflows/versions.ts","../bin/ltc.ts","../lib/cli/auth.ts","../lib/cli/client.ts","../lib/cli/compile.ts","../lib/cli/format.ts","../lib/cli/init.ts","../lib/cli/output.ts","../lib/cli/scanner.ts","../lib/cli/types.ts","../lib/cli/commands/escalations.ts","../lib/cli/commands/knowledge.ts","../lib/cli/commands/mcp.ts","../lib/cli/commands/pipelines.ts","../lib/cli/commands/status.ts","../lib/cli/commands/streams.ts","../lib/cli/commands/users.ts","../lib/cli/commands/workflows.ts","../lib/db/index.ts","../lib/db/migrate.ts","../lib/events/callback.ts","../lib/events/index.ts","../lib/events/matching.ts","../lib/events/memory.ts","../lib/events/nats.ts","../lib/events/publish.ts","../lib/events/socketio.ts","../lib/logger/index.ts","../lib/logger/pino.ts","../lib/storage/index.ts","../lib/storage/local.ts","../lib/storage/mime.ts","../lib/storage/s3.ts","../lib/storage/types.ts","../lib/telemetry/honeycomb.ts","../lib/telemetry/index.ts","../modules/auth.ts","../modules/config.ts","../modules/defaults.ts","../modules/ltconfig.ts","../modules/maintenance.ts","../modules/utils.ts","../routes/agents.ts","../routes/auth.ts","../routes/bot-accounts.ts","../routes/capabilities.ts","../routes/controlplane.ts","../routes/dba.ts","../routes/delegation.ts","../routes/docs.ts","../routes/exports.ts","../routes/file-browser.ts","../routes/files.ts","../routes/index.ts","../routes/insight.ts","../routes/knowledge.ts","../routes/maintenance.ts","../routes/mcp-runs.ts","../routes/mcp.ts","../routes/namespaces.ts","../routes/nats-credentials.ts","../routes/oauth.ts","../routes/roles.ts","../routes/settings.ts","../routes/tasks.ts","../routes/topics.ts","../routes/users.ts","../routes/workflow-sets.ts","../routes/escalations/bulk.ts","../routes/escalations/index.ts","../routes/escalations/list.ts","../routes/escalations/resolve.ts","../routes/escalations/single.ts","../routes/workflows/config.ts","../routes/workflows/discovery.ts","../routes/workflows/index.ts","../routes/workflows/invocation.ts","../routes/yaml-workflows/cron.ts","../routes/yaml-workflows/crud.ts","../routes/yaml-workflows/deployment.ts","../routes/yaml-workflows/index.ts","../routes/yaml-workflows/versions.ts","../scripts/process-helpers.ts","../scripts/process.ts","../scripts/token.ts","../sdk/index.ts","../services/dba.ts","../services/hotmesh-utils.ts","../services/workflow-invocation.ts","../services/agent/index.ts","../services/agent/input-mapper.ts","../services/agent/sql.ts","../services/agent/subscription-sql.ts","../services/agent/subscriptions.ts","../services/agent/trigger-registry.ts","../services/auth/bot-api-key.ts","../services/auth/delegation.ts","../services/auth/index.ts","../services/auth/service-token.ts","../services/config/cache.ts","../services/config/index.ts","../services/config/provider.ts","../services/config/read.ts","../services/config/sql.ts","../services/config/write.ts","../services/controlplane/index.ts","../services/controlplane/quorum-bridge.ts","../services/controlplane/sql.ts","../services/controlplane/stream-messages-sql.ts","../services/controlplane/types.ts","../services/cron/index.ts","../services/escalation/bulk.ts","../services/escalation/crud.ts","../services/escalation/index.ts","../services/escalation/queries.ts","../services/escalation/sql.ts","../services/escalation/types.ts","../services/escalation-strategy/default.ts","../services/escalation-strategy/index.ts","../services/escalation-strategy/mcp.ts","../services/export/client.ts","../services/export/index.ts","../services/export/post-process.ts","../services/export/types.ts","../services/iam/activity.ts","../services/iam/bots.ts","../services/iam/context.ts","../services/iam/credentials.ts","../services/iam/envelope.ts","../services/iam/ephemeral.ts","../services/iam/index.ts","../services/iam/principal.ts","../services/iam/resolve.ts","../services/iam/sql.ts","../services/insight/index.ts","../services/insight/prompts.ts","../services/interceptor/activity-interceptor.ts","../services/interceptor/completion.ts","../services/interceptor/context.ts","../services/interceptor/escalation.ts","../services/interceptor/index.ts","../services/interceptor/lifecycle.ts","../services/interceptor/state.ts","../services/interceptor/types.ts","../services/interceptor/activities/config.ts","../services/interceptor/activities/escalation.ts","../services/interceptor/activities/index.ts","../services/interceptor/activities/task.ts","../services/interceptor/activities/workflow.ts","../services/llm/detect.ts","../services/llm/index.ts","../services/llm/translate.ts","../services/llm/types.ts","../services/llm/providers/anthropic.ts","../services/llm/providers/openai.ts","../services/maintenance/index.ts","../services/mcp/adapter.ts","../services/mcp/db.ts","../services/mcp/index.ts","../services/mcp/register-tool.ts","../services/mcp/server-lifecycle.ts","../services/mcp/server-tools.ts","../services/mcp/server.ts","../services/mcp/sql.ts","../services/mcp/types.ts","../services/mcp/workflow-compiler-server.ts","../services/mcp/workflow-server.ts","../services/mcp/client/connection-dispatch.ts","../services/mcp/client/connection-lifecycle.ts","../services/mcp/client/connection-test.ts","../services/mcp/client/connection.ts","../services/mcp/client/index.ts","../services/mcp/client/tools.ts","../services/mcp/db-server/index.ts","../services/mcp/db-server/schemas.ts","../services/mcp/db-server/tools.ts","../services/mcp/playwright-server/index.ts","../services/mcp/playwright-server/lifecycle.ts","../services/mcp/playwright-server/schemas.ts","../services/mcp/playwright-server/tools.ts","../services/mcp-runs/enrichment.ts","../services/mcp-runs/events.ts","../services/mcp-runs/execution-builder.ts","../services/mcp-runs/index.ts","../services/mcp-runs/queries.ts","../services/mcp-runs/sql.ts","../services/mcp-runs/types.ts","../services/namespace/index.ts","../services/namespace/sql.ts","../services/namespace/types.ts","../services/oauth/crypto.ts","../services/oauth/db.ts","../services/oauth/index.ts","../services/oauth/sql.ts","../services/oauth/state.ts","../services/oauth/providers/anthropic.ts","../services/oauth/providers/github.ts","../services/oauth/providers/google.ts","../services/oauth/providers/index.ts","../services/oauth/providers/microsoft.ts","../services/oauth/providers/mock.ts","../services/oauth/providers/registry.ts","../services/oauth/providers/types.ts","../services/orchestrator/condition.ts","../services/orchestrator/index.ts","../services/orchestrator/types.ts","../services/role/index.ts","../services/role/sql.ts","../services/role/types.ts","../services/task/crud.ts","../services/task/index.ts","../services/task/process.ts","../services/task/resolve.ts","../services/task/sql.ts","../services/task/types.ts","../services/topics/index.ts","../services/topics/sql.ts","../services/topics/system-topics.ts","../services/user/auth.ts","../services/user/crud.ts","../services/user/index.ts","../services/user/rbac.ts","../services/user/roles.ts","../services/user/seed-admin.ts","../services/user/sql.ts","../services/user/types.ts","../services/workers/registry.ts","../services/workflow-sets/db.ts","../services/workflow-sets/index.ts","../services/workflow-sets/sql.ts","../services/yaml-workflow/builder-regenerate.ts","../services/yaml-workflow/db-utils.ts","../services/yaml-workflow/db-versions.ts","../services/yaml-workflow/db.ts","../services/yaml-workflow/deployer-helpers.ts","../services/yaml-workflow/deployer.ts","../services/yaml-workflow/generator.ts","../services/yaml-workflow/index.ts","../services/yaml-workflow/input-analyzer-helpers.ts","../services/yaml-workflow/input-analyzer.ts","../services/yaml-workflow/invoke.ts","../services/yaml-workflow/sql.ts","../services/yaml-workflow/types.ts","../services/yaml-workflow/durable-compiler/index.ts","../services/yaml-workflow/durable-compiler/parser.ts","../services/yaml-workflow/durable-compiler/prompts.ts","../services/yaml-workflow/durable-compiler/types.ts","../services/yaml-workflow/pattern-detector/array-source.ts","../services/yaml-workflow/pattern-detector/collapse.ts","../services/yaml-workflow/pattern-detector/index.ts","../services/yaml-workflow/pattern-detector/run-detection.ts","../services/yaml-workflow/pattern-detector/types.ts","../services/yaml-workflow/pipeline/analyze.ts","../services/yaml-workflow/pipeline/extract-helpers.ts","../services/yaml-workflow/pipeline/extract.ts","../services/yaml-workflow/pipeline/index.ts","../services/yaml-workflow/pipeline/prompt-templates.ts","../services/yaml-workflow/pipeline/prompts.ts","../services/yaml-workflow/pipeline/validate.ts","../services/yaml-workflow/pipeline/build/dag-assembly.ts","../services/yaml-workflow/pipeline/build/dag.ts","../services/yaml-workflow/pipeline/build/index.ts","../services/yaml-workflow/pipeline/build/iteration.ts","../services/yaml-workflow/pipeline/build/metadata.ts","../services/yaml-workflow/pipeline/build/transform.ts","../services/yaml-workflow/pipeline/build/utils.ts","../services/yaml-workflow/pipeline/build/wiring.ts","../services/yaml-workflow/pipeline/compile/index.ts","../services/yaml-workflow/pipeline/compile/llm-call.ts","../services/yaml-workflow/pipeline/compile/parse-plan.ts","../services/yaml-workflow/pipeline/compile/summarize.ts","../services/yaml-workflow/workers/callbacks.ts","../services/yaml-workflow/workers/events.ts","../services/yaml-workflow/workers/index.ts","../services/yaml-workflow/workers/register.ts","../services/yaml-workflow/workers/scope.ts","../start/adapters.ts","../start/config.ts","../start/index.ts","../start/server.ts","../start/socket-auth.ts","../start/workers.ts","../system/index.ts","../system/activities/claude-code.ts","../system/activities/file-storage.ts","../system/activities/http.ts","../system/activities/knowledge.ts","../system/activities/oauth.ts","../system/activities/schema-exchange.ts","../system/activities/sql.ts","../system/activities/triage/cache.ts","../system/activities/triage/context.ts","../system/activities/triage/discovery.ts","../system/activities/triage/index.ts","../system/activities/triage/llm.ts","../system/activities/triage/tools.ts","../system/mcp-servers/claude-code.ts","../system/mcp-servers/docs.ts","../system/mcp-servers/events.ts","../system/mcp-servers/file-storage.ts","../system/mcp-servers/http-fetch.ts","../system/mcp-servers/human-queue-schemas.ts","../system/mcp-servers/human-queue.ts","../system/mcp-servers/knowledge.ts","../system/mcp-servers/oauth.ts","../system/mcp-servers/schema-exchange.ts","../system/mcp-servers/translation.ts","../system/mcp-servers/vision-prompts.ts","../system/mcp-servers/vision.ts","../system/mcp-servers/workflow-compiler.ts","../system/mcp-servers/workflow.ts","../system/mcp-servers/admin/escalations.ts","../system/mcp-servers/admin/index.ts","../system/mcp-servers/admin/maintenance.ts","../system/mcp-servers/admin/mcp-servers.ts","../system/mcp-servers/admin/schemas.ts","../system/mcp-servers/admin/tasks.ts","../system/mcp-servers/admin/users.ts","../system/mcp-servers/admin/workflow-config.ts","../system/mcp-servers/admin/workflows.ts","../system/mcp-servers/admin/yaml-workflows.ts","../system/mcp-servers/db-query/index.ts","../system/mcp-servers/db-query/schemas.ts","../system/mcp-servers/db-query/tools.ts","../system/mcp-servers/playwright/browser-lifecycle.ts","../system/mcp-servers/playwright/index.ts","../system/mcp-servers/playwright/schemas.ts","../system/mcp-servers/playwright/tools-atomic.ts","../system/mcp-servers/playwright/tools-navigation.ts","../system/mcp-servers/playwright/tools-page-interaction.ts","../system/mcp-servers/playwright/tools-run-script.ts","../system/mcp-servers/playwright/types.ts","../system/mcp-servers/playwright/vision-helper.ts","../system/mcp-servers/playwright-cli/helpers.ts","../system/mcp-servers/playwright-cli/index.ts","../system/mcp-servers/playwright-cli/schemas.ts","../system/mcp-servers/playwright-cli/tools-auth.ts","../system/mcp-servers/playwright-cli/tools-capture.ts","../system/seed/index.ts","../system/seed/tool-manifests-admin.ts","../system/seed/tool-manifests-browser.ts","../system/seed/tool-manifests-data.ts","../system/seed/tool-manifests-escalation.ts","../system/seed/tool-manifests-events.ts","../system/seed/tool-manifests-knowledge.ts","../system/seed/tool-manifests-workflows.ts","../system/workflows/tool-result-guard.ts","../system/workflows/capability-invoke/activities.ts","../system/workflows/capability-invoke/index.ts","../system/workflows/mcp-deterministic/activities.ts","../system/workflows/mcp-deterministic/index.ts","../system/workflows/mcp-query/index.ts","../system/workflows/mcp-query/prompts.ts","../system/workflows/mcp-query/strategy-advisors.ts","../system/workflows/mcp-query/types.ts","../system/workflows/mcp-query/activities/caches.ts","../system/workflows/mcp-query/activities/discovery.ts","../system/workflows/mcp-query/activities/index.ts","../system/workflows/mcp-query/activities/llm.ts","../system/workflows/mcp-query/activities/tool-executor.ts","../system/workflows/mcp-query/activities/tool-loader.ts","../system/workflows/mcp-query-router/activities.ts","../system/workflows/mcp-query-router/index.ts","../system/workflows/mcp-query-router/prompts.ts","../system/workflows/mcp-triage/activities-proxy.ts","../system/workflows/mcp-triage/index.ts","../system/workflows/mcp-triage/prompts.ts","../system/workflows/mcp-triage/response-builders.ts","../system/workflows/mcp-triage/response.ts","../system/workflows/mcp-triage/types.ts","../system/workflows/mcp-triage-deterministic/activities.ts","../system/workflows/mcp-triage-deterministic/index.ts","../system/workflows/mcp-triage-router/activities.ts","../system/workflows/mcp-triage-router/index.ts","../system/workflows/mcp-workflow-builder/index.ts","../system/workflows/mcp-workflow-builder/prompts.ts","../system/workflows/mcp-workflow-builder/activities/caches.ts","../system/workflows/mcp-workflow-builder/activities/index.ts","../system/workflows/mcp-workflow-builder/activities/llm.ts","../system/workflows/mcp-workflow-builder/activities/tool-loader.ts","../system/workflows/mcp-workflow-planner/index.ts","../system/workflows/mcp-workflow-planner/prompts.ts","../system/workflows/mcp-workflow-planner/activities/analyze.ts","../system/workflows/mcp-workflow-planner/activities/index.ts","../system/workflows/mcp-workflow-planner/activities/persist.ts","../system/workflows/mcp-workflow-planner/activities/plan.ts","../system/workflows/shared/discovery.ts","../system/workflows/shared/index.ts","../system/workflows/shared/llm-caller.ts","../system/workflows/shared/prompts.ts","../system/workflows/shared/strategy-advisors.ts","../system/workflows/shared/tool-executor.ts","../system/workflows/shared/tool-loader.ts","../system/workflows/shared/types.ts","../types/agent.ts","../types/auth.ts","../types/config.ts","../types/delegation.ts","../types/discovery.ts","../types/envelope.ts","../types/escalation-strategy.ts","../types/escalation.ts","../types/events.ts","../types/export.ts","../types/express.d.ts","../types/index.ts","../types/logger.ts","../types/maintenance.ts","../types/mcp.ts","../types/oauth.ts","../types/sdk.ts","../types/startup.ts","../types/task.ts","../types/telemetry.ts","../types/tool-context.ts","../types/user.ts","../types/workflow-set.ts","../types/workflow.ts","../types/yaml-workflow.ts","../workers/index.ts"],"version":"5.9.3"}
|
|
1
|
+
{"root":["../index.ts","../vitest.config.ts","../vitest.integration.config.ts","../adapters/express.ts","../api/agent-subscriptions.ts","../api/agents.ts","../api/auth.ts","../api/bot-accounts.ts","../api/capabilities.ts","../api/controlplane.ts","../api/dba.ts","../api/exports.ts","../api/files.ts","../api/index.ts","../api/insight.ts","../api/knowledge.ts","../api/maintenance.ts","../api/mcp-runs.ts","../api/namespaces.ts","../api/roles.ts","../api/settings.ts","../api/tasks.ts","../api/topics.ts","../api/users.ts","../api/workflow-sets.ts","../api/escalations/bulk.ts","../api/escalations/claim.ts","../api/escalations/create.ts","../api/escalations/helpers.ts","../api/escalations/index.ts","../api/escalations/list.ts","../api/escalations/resolve.ts","../api/escalations/single.ts","../api/mcp/index.ts","../api/mcp/servers.ts","../api/mcp/tools.ts","../api/workflows/config.ts","../api/workflows/discovery.ts","../api/workflows/index.ts","../api/workflows/invocation.ts","../api/yaml-workflows/cron.ts","../api/yaml-workflows/crud.ts","../api/yaml-workflows/deploy.ts","../api/yaml-workflows/helpers.ts","../api/yaml-workflows/index.ts","../api/yaml-workflows/versions.ts","../bin/ltc.ts","../lib/cli/auth.ts","../lib/cli/client.ts","../lib/cli/compile.ts","../lib/cli/format.ts","../lib/cli/init.ts","../lib/cli/output.ts","../lib/cli/scanner.ts","../lib/cli/types.ts","../lib/cli/commands/escalations.ts","../lib/cli/commands/knowledge.ts","../lib/cli/commands/mcp.ts","../lib/cli/commands/pipelines.ts","../lib/cli/commands/status.ts","../lib/cli/commands/streams.ts","../lib/cli/commands/users.ts","../lib/cli/commands/workflows.ts","../lib/db/index.ts","../lib/db/migrate.ts","../lib/events/callback.ts","../lib/events/index.ts","../lib/events/matching.ts","../lib/events/memory.ts","../lib/events/nats.ts","../lib/events/publish.ts","../lib/events/socketio.ts","../lib/logger/index.ts","../lib/logger/pino.ts","../lib/storage/index.ts","../lib/storage/local.ts","../lib/storage/mime.ts","../lib/storage/s3.ts","../lib/storage/types.ts","../lib/telemetry/honeycomb.ts","../lib/telemetry/index.ts","../modules/auth.ts","../modules/config.ts","../modules/defaults.ts","../modules/ltconfig.ts","../modules/maintenance.ts","../modules/utils.ts","../routes/agents.ts","../routes/auth.ts","../routes/bot-accounts.ts","../routes/capabilities.ts","../routes/controlplane.ts","../routes/dba.ts","../routes/delegation.ts","../routes/docs.ts","../routes/exports.ts","../routes/file-browser.ts","../routes/files.ts","../routes/index.ts","../routes/insight.ts","../routes/knowledge.ts","../routes/maintenance.ts","../routes/mcp-runs.ts","../routes/mcp.ts","../routes/namespaces.ts","../routes/nats-credentials.ts","../routes/oauth.ts","../routes/roles.ts","../routes/settings.ts","../routes/tasks.ts","../routes/topics.ts","../routes/users.ts","../routes/workflow-sets.ts","../routes/escalations/bulk.ts","../routes/escalations/index.ts","../routes/escalations/list.ts","../routes/escalations/resolve.ts","../routes/escalations/single.ts","../routes/workflows/config.ts","../routes/workflows/discovery.ts","../routes/workflows/index.ts","../routes/workflows/invocation.ts","../routes/yaml-workflows/cron.ts","../routes/yaml-workflows/crud.ts","../routes/yaml-workflows/deployment.ts","../routes/yaml-workflows/index.ts","../routes/yaml-workflows/versions.ts","../scripts/process-helpers.ts","../scripts/process.ts","../scripts/token.ts","../sdk/index.ts","../services/dba.ts","../services/hotmesh-utils.ts","../services/workflow-invocation.ts","../services/agent/index.ts","../services/agent/input-mapper.ts","../services/agent/sql.ts","../services/agent/subscription-sql.ts","../services/agent/subscriptions.ts","../services/agent/trigger-registry.ts","../services/auth/bot-api-key.ts","../services/auth/delegation.ts","../services/auth/index.ts","../services/auth/service-token.ts","../services/config/cache.ts","../services/config/index.ts","../services/config/provider.ts","../services/config/read.ts","../services/config/sql.ts","../services/config/write.ts","../services/controlplane/index.ts","../services/controlplane/quorum-bridge.ts","../services/controlplane/sql.ts","../services/controlplane/stream-messages-sql.ts","../services/controlplane/types.ts","../services/cron/index.ts","../services/escalation/bulk.ts","../services/escalation/crud.ts","../services/escalation/index.ts","../services/escalation/queries.ts","../services/escalation/sql.ts","../services/escalation/types.ts","../services/escalation-strategy/default.ts","../services/escalation-strategy/index.ts","../services/escalation-strategy/mcp.ts","../services/export/client.ts","../services/export/index.ts","../services/export/post-process.ts","../services/export/types.ts","../services/iam/activity.ts","../services/iam/bots.ts","../services/iam/context.ts","../services/iam/credentials.ts","../services/iam/envelope.ts","../services/iam/ephemeral.ts","../services/iam/index.ts","../services/iam/principal.ts","../services/iam/resolve.ts","../services/iam/sql.ts","../services/insight/index.ts","../services/insight/prompts.ts","../services/interceptor/activity-interceptor.ts","../services/interceptor/completion.ts","../services/interceptor/context.ts","../services/interceptor/escalation.ts","../services/interceptor/index.ts","../services/interceptor/lifecycle.ts","../services/interceptor/state.ts","../services/interceptor/types.ts","../services/interceptor/activities/config.ts","../services/interceptor/activities/escalation.ts","../services/interceptor/activities/index.ts","../services/interceptor/activities/task.ts","../services/interceptor/activities/workflow.ts","../services/llm/detect.ts","../services/llm/index.ts","../services/llm/translate.ts","../services/llm/types.ts","../services/llm/providers/anthropic.ts","../services/llm/providers/openai.ts","../services/maintenance/index.ts","../services/mcp/adapter.ts","../services/mcp/db.ts","../services/mcp/index.ts","../services/mcp/register-tool.ts","../services/mcp/server-lifecycle.ts","../services/mcp/server-tools.ts","../services/mcp/server.ts","../services/mcp/sql.ts","../services/mcp/types.ts","../services/mcp/workflow-compiler-server.ts","../services/mcp/workflow-server.ts","../services/mcp/client/connection-dispatch.ts","../services/mcp/client/connection-lifecycle.ts","../services/mcp/client/connection-test.ts","../services/mcp/client/connection.ts","../services/mcp/client/index.ts","../services/mcp/client/tools.ts","../services/mcp/db-server/index.ts","../services/mcp/db-server/schemas.ts","../services/mcp/db-server/tools.ts","../services/mcp/playwright-server/index.ts","../services/mcp/playwright-server/lifecycle.ts","../services/mcp/playwright-server/schemas.ts","../services/mcp/playwright-server/tools.ts","../services/mcp-runs/enrichment.ts","../services/mcp-runs/events.ts","../services/mcp-runs/execution-builder.ts","../services/mcp-runs/index.ts","../services/mcp-runs/queries.ts","../services/mcp-runs/sql.ts","../services/mcp-runs/types.ts","../services/namespace/index.ts","../services/namespace/sql.ts","../services/namespace/types.ts","../services/oauth/crypto.ts","../services/oauth/db.ts","../services/oauth/index.ts","../services/oauth/sql.ts","../services/oauth/state.ts","../services/oauth/providers/anthropic.ts","../services/oauth/providers/github.ts","../services/oauth/providers/google.ts","../services/oauth/providers/index.ts","../services/oauth/providers/microsoft.ts","../services/oauth/providers/mock.ts","../services/oauth/providers/registry.ts","../services/oauth/providers/types.ts","../services/orchestrator/condition.ts","../services/orchestrator/index.ts","../services/orchestrator/types.ts","../services/role/index.ts","../services/role/sql.ts","../services/role/types.ts","../services/task/crud.ts","../services/task/index.ts","../services/task/process.ts","../services/task/resolve.ts","../services/task/sql.ts","../services/task/types.ts","../services/topics/index.ts","../services/topics/sql.ts","../services/topics/system-topics.ts","../services/user/auth.ts","../services/user/crud.ts","../services/user/index.ts","../services/user/rbac.ts","../services/user/roles.ts","../services/user/seed-admin.ts","../services/user/sql.ts","../services/user/types.ts","../services/workers/registry.ts","../services/workflow-sets/db.ts","../services/workflow-sets/index.ts","../services/workflow-sets/sql.ts","../services/yaml-workflow/builder-regenerate.ts","../services/yaml-workflow/db-utils.ts","../services/yaml-workflow/db-versions.ts","../services/yaml-workflow/db.ts","../services/yaml-workflow/deployer-helpers.ts","../services/yaml-workflow/deployer.ts","../services/yaml-workflow/generator.ts","../services/yaml-workflow/index.ts","../services/yaml-workflow/input-analyzer-helpers.ts","../services/yaml-workflow/input-analyzer.ts","../services/yaml-workflow/invoke.ts","../services/yaml-workflow/sql.ts","../services/yaml-workflow/types.ts","../services/yaml-workflow/durable-compiler/index.ts","../services/yaml-workflow/durable-compiler/parser.ts","../services/yaml-workflow/durable-compiler/prompts.ts","../services/yaml-workflow/durable-compiler/types.ts","../services/yaml-workflow/pattern-detector/array-source.ts","../services/yaml-workflow/pattern-detector/collapse.ts","../services/yaml-workflow/pattern-detector/index.ts","../services/yaml-workflow/pattern-detector/run-detection.ts","../services/yaml-workflow/pattern-detector/types.ts","../services/yaml-workflow/pipeline/analyze.ts","../services/yaml-workflow/pipeline/extract-helpers.ts","../services/yaml-workflow/pipeline/extract.ts","../services/yaml-workflow/pipeline/index.ts","../services/yaml-workflow/pipeline/prompt-templates.ts","../services/yaml-workflow/pipeline/prompts.ts","../services/yaml-workflow/pipeline/validate.ts","../services/yaml-workflow/pipeline/build/dag-assembly.ts","../services/yaml-workflow/pipeline/build/dag.ts","../services/yaml-workflow/pipeline/build/index.ts","../services/yaml-workflow/pipeline/build/iteration.ts","../services/yaml-workflow/pipeline/build/metadata.ts","../services/yaml-workflow/pipeline/build/transform.ts","../services/yaml-workflow/pipeline/build/utils.ts","../services/yaml-workflow/pipeline/build/wiring.ts","../services/yaml-workflow/pipeline/compile/index.ts","../services/yaml-workflow/pipeline/compile/llm-call.ts","../services/yaml-workflow/pipeline/compile/parse-plan.ts","../services/yaml-workflow/pipeline/compile/summarize.ts","../services/yaml-workflow/workers/callbacks.ts","../services/yaml-workflow/workers/events.ts","../services/yaml-workflow/workers/index.ts","../services/yaml-workflow/workers/register.ts","../services/yaml-workflow/workers/scope.ts","../start/adapters.ts","../start/config.ts","../start/index.ts","../start/server.ts","../start/socket-auth.ts","../start/workers.ts","../system/index.ts","../system/activities/claude-code.ts","../system/activities/file-storage.ts","../system/activities/http.ts","../system/activities/knowledge.ts","../system/activities/oauth.ts","../system/activities/schema-exchange.ts","../system/activities/sql.ts","../system/activities/triage/cache.ts","../system/activities/triage/context.ts","../system/activities/triage/discovery.ts","../system/activities/triage/index.ts","../system/activities/triage/llm.ts","../system/activities/triage/tools.ts","../system/mcp-servers/claude-code.ts","../system/mcp-servers/docs.ts","../system/mcp-servers/events.ts","../system/mcp-servers/file-storage.ts","../system/mcp-servers/http-fetch.ts","../system/mcp-servers/human-queue-schemas.ts","../system/mcp-servers/human-queue.ts","../system/mcp-servers/knowledge.ts","../system/mcp-servers/oauth.ts","../system/mcp-servers/schema-exchange.ts","../system/mcp-servers/translation.ts","../system/mcp-servers/vision-prompts.ts","../system/mcp-servers/vision.ts","../system/mcp-servers/workflow-compiler.ts","../system/mcp-servers/workflow.ts","../system/mcp-servers/admin/escalations.ts","../system/mcp-servers/admin/index.ts","../system/mcp-servers/admin/maintenance.ts","../system/mcp-servers/admin/mcp-servers.ts","../system/mcp-servers/admin/schemas.ts","../system/mcp-servers/admin/tasks.ts","../system/mcp-servers/admin/users.ts","../system/mcp-servers/admin/workflow-config.ts","../system/mcp-servers/admin/workflows.ts","../system/mcp-servers/admin/yaml-workflows.ts","../system/mcp-servers/db-query/index.ts","../system/mcp-servers/db-query/schemas.ts","../system/mcp-servers/db-query/tools.ts","../system/mcp-servers/playwright/browser-lifecycle.ts","../system/mcp-servers/playwright/index.ts","../system/mcp-servers/playwright/schemas.ts","../system/mcp-servers/playwright/tools-atomic.ts","../system/mcp-servers/playwright/tools-navigation.ts","../system/mcp-servers/playwright/tools-page-interaction.ts","../system/mcp-servers/playwright/tools-run-script.ts","../system/mcp-servers/playwright/types.ts","../system/mcp-servers/playwright/vision-helper.ts","../system/mcp-servers/playwright-cli/helpers.ts","../system/mcp-servers/playwright-cli/index.ts","../system/mcp-servers/playwright-cli/schemas.ts","../system/mcp-servers/playwright-cli/tools-auth.ts","../system/mcp-servers/playwright-cli/tools-capture.ts","../system/seed/index.ts","../system/seed/tool-manifests-admin.ts","../system/seed/tool-manifests-browser.ts","../system/seed/tool-manifests-data.ts","../system/seed/tool-manifests-escalation.ts","../system/seed/tool-manifests-events.ts","../system/seed/tool-manifests-knowledge.ts","../system/seed/tool-manifests-workflows.ts","../system/workflows/tool-result-guard.ts","../system/workflows/capability-invoke/activities.ts","../system/workflows/capability-invoke/index.ts","../system/workflows/mcp-deterministic/activities.ts","../system/workflows/mcp-deterministic/index.ts","../system/workflows/mcp-query/index.ts","../system/workflows/mcp-query/prompts.ts","../system/workflows/mcp-query/strategy-advisors.ts","../system/workflows/mcp-query/types.ts","../system/workflows/mcp-query/activities/caches.ts","../system/workflows/mcp-query/activities/discovery.ts","../system/workflows/mcp-query/activities/index.ts","../system/workflows/mcp-query/activities/llm.ts","../system/workflows/mcp-query/activities/tool-executor.ts","../system/workflows/mcp-query/activities/tool-loader.ts","../system/workflows/mcp-query-router/activities.ts","../system/workflows/mcp-query-router/index.ts","../system/workflows/mcp-query-router/prompts.ts","../system/workflows/mcp-triage/activities-proxy.ts","../system/workflows/mcp-triage/index.ts","../system/workflows/mcp-triage/prompts.ts","../system/workflows/mcp-triage/response-builders.ts","../system/workflows/mcp-triage/response.ts","../system/workflows/mcp-triage/types.ts","../system/workflows/mcp-triage-deterministic/activities.ts","../system/workflows/mcp-triage-deterministic/index.ts","../system/workflows/mcp-triage-router/activities.ts","../system/workflows/mcp-triage-router/index.ts","../system/workflows/mcp-workflow-builder/index.ts","../system/workflows/mcp-workflow-builder/prompts.ts","../system/workflows/mcp-workflow-builder/activities/caches.ts","../system/workflows/mcp-workflow-builder/activities/index.ts","../system/workflows/mcp-workflow-builder/activities/llm.ts","../system/workflows/mcp-workflow-builder/activities/tool-loader.ts","../system/workflows/mcp-workflow-planner/index.ts","../system/workflows/mcp-workflow-planner/prompts.ts","../system/workflows/mcp-workflow-planner/activities/analyze.ts","../system/workflows/mcp-workflow-planner/activities/index.ts","../system/workflows/mcp-workflow-planner/activities/persist.ts","../system/workflows/mcp-workflow-planner/activities/plan.ts","../system/workflows/shared/discovery.ts","../system/workflows/shared/index.ts","../system/workflows/shared/llm-caller.ts","../system/workflows/shared/prompts.ts","../system/workflows/shared/strategy-advisors.ts","../system/workflows/shared/tool-executor.ts","../system/workflows/shared/tool-loader.ts","../system/workflows/shared/types.ts","../types/agent.ts","../types/auth.ts","../types/config.ts","../types/delegation.ts","../types/discovery.ts","../types/envelope.ts","../types/escalation-strategy.ts","../types/escalation.ts","../types/events.ts","../types/export.ts","../types/express.d.ts","../types/index.ts","../types/logger.ts","../types/maintenance.ts","../types/mcp.ts","../types/oauth.ts","../types/sdk.ts","../types/startup.ts","../types/task.ts","../types/telemetry.ts","../types/tool-context.ts","../types/user.ts","../types/workflow-set.ts","../types/workflow.ts","../types/yaml-workflow.ts","../workers/index.ts"],"version":"5.9.3"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{j as o}from"./vendor-query-B2UbickB.js";import{c as n}from"./tasks-
|
|
2
|
-
//# sourceMappingURL=AdminDashboard-
|
|
1
|
+
import{j as o}from"./vendor-query-B2UbickB.js";import{c as n}from"./tasks-BQH9o3Ge.js";import{r as m}from"./index-B_e2uIz9.js";import{f as c}from"./useEventHooks-CZR0V3cW.js";import{u}from"./mcp-CvdtxZQK.js";import{P as d}from"./PageHeaderWithStats-DQmNXYcG.js";import"./vendor-react-CX88sFS5.js";import"./vendor-icons-5gSix3t2.js";function j(){var a;c();const{data:s}=n({limit:1}),{data:e}=m({status:"pending",limit:1}),{data:t}=u(),r=((a=t==null?void 0:t.servers)==null?void 0:a.filter(i=>i.status==="connected").length)??0,l=t?`${r}/${t.total}`:"—";return o.jsx("div",{children:o.jsx(d,{title:"Admin",stats:[{label:"Tasks",value:(s==null?void 0:s.total)??"—"},{label:"Pending Escalations",value:(e==null?void 0:e.total)??"—",dotClass:"bg-status-pending"},{label:"MCP Servers",value:l},{label:"System",value:"Healthy",dotClass:"bg-status-success"}]})})}export{j as AdminDashboard};
|
|
2
|
+
//# sourceMappingURL=AdminDashboard-BVtpNGO1.js.map
|
package/dashboard/dist/assets/{AdminDashboard-qZYNzvw8.js.map → AdminDashboard-BVtpNGO1.js.map}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AdminDashboard-
|
|
1
|
+
{"version":3,"file":"AdminDashboard-BVtpNGO1.js","sources":["../../src/pages/admin/AdminDashboard.tsx"],"sourcesContent":["import { useTasks } from '../../api/tasks';\nimport { useEscalations } from '../../api/escalations';\nimport { useEscalationListEvents } from '../../hooks/useEventHooks';\nimport { useMcpServers } from '../../api/mcp';\nimport { PageHeaderWithStats } from '../../components/common/layout/PageHeaderWithStats';\n\nexport function AdminDashboard() {\n useEscalationListEvents();\n const { data: taskData } = useTasks({ limit: 1 });\n const { data: pendingEsc } = useEscalations({ status: 'pending', limit: 1 });\n const { data: mcpData } = useMcpServers();\n\n const connectedServers =\n mcpData?.servers?.filter((s) => s.status === 'connected').length ?? 0;\n const mcpLabel = mcpData ? `${connectedServers}/${mcpData.total}` : '—';\n\n return (\n <div>\n <PageHeaderWithStats\n title=\"Admin\"\n stats={[\n { label: 'Tasks', value: taskData?.total ?? '—' },\n { label: 'Pending Escalations', value: pendingEsc?.total ?? '—', dotClass: 'bg-status-pending' },\n { label: 'MCP Servers', value: mcpLabel },\n { label: 'System', value: 'Healthy', dotClass: 'bg-status-success' },\n ]}\n />\n </div>\n );\n}\n"],"names":["AdminDashboard","useEscalationListEvents","taskData","useTasks","pendingEsc","useEscalations","mcpData","useMcpServers","connectedServers","_a","s","mcpLabel","jsx","PageHeaderWithStats"],"mappings":"4UAMO,SAASA,GAAiB,OAC/BC,EAAA,EACA,KAAM,CAAE,KAAMC,CAAA,EAAaC,EAAS,CAAE,MAAO,EAAG,EAC1C,CAAE,KAAMC,CAAA,EAAeC,EAAe,CAAE,OAAQ,UAAW,MAAO,EAAG,EACrE,CAAE,KAAMC,CAAA,EAAYC,EAAA,EAEpBC,IACJC,EAAAH,GAAA,YAAAA,EAAS,UAAT,YAAAG,EAAkB,OAAQC,GAAMA,EAAE,SAAW,aAAa,SAAU,EAChEC,EAAWL,EAAU,GAAGE,CAAgB,IAAIF,EAAQ,KAAK,GAAK,IAEpE,aACG,MAAA,CACC,SAAAM,EAAAA,IAACC,EAAA,CACC,MAAM,QACN,MAAO,CACL,CAAE,MAAO,QAAS,OAAOX,GAAA,YAAAA,EAAU,QAAS,GAAA,EAC5C,CAAE,MAAO,sBAAuB,OAAOE,GAAA,YAAAA,EAAY,QAAS,IAAK,SAAU,mBAAA,EAC3E,CAAE,MAAO,cAAe,MAAOO,CAAA,EAC/B,CAAE,MAAO,SAAU,MAAO,UAAW,SAAU,mBAAA,CAAoB,CACrE,CAAA,EAEJ,CAEJ"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{j as e,a as f}from"./vendor-query-B2UbickB.js";import{a as re,d as le,b as oe}from"./agents-CpLOugsY.js";import{C as ce,u as de,a as pe,b as xe,c as ue}from"./CronLabel-Dg8U0s5a.js";import{d as me,u as he}from"./index-B7Vxutyl.js";import{P as fe}from"./PageHeader-B4w-LDUF.js";import{B as P,d as G,b as ve,R as U,l as L,p as X,a5 as Y,a as Z,aG as ee,Q as be}from"./vendor-icons-5gSix3t2.js";import{e as je}from"./knowledge-CQWNz28-.js";import{R as te}from"./RunAsSelector-CcNnj5AF.js";import{u as ye}from"./workflows-dhvM792w.js";import{u as ge}from"./yaml-workflows-DqbGpE2x.js";import{u as se}from"./capabilities-xbHvOXKc.js";import{u as we}from"./topics-lm2GYKuv.js";import{E as Ne}from"./EventTopicPill-RaASGdZz.js";import{W as V}from"./WorkflowPill-BkfIn8N3.js";import{e as _e,c as ke,f as Ce}from"./vendor-react-CX88sFS5.js";import"./BotPicker-638n5Jaz.js";import"./bots-DRrquJqC.js";const Q={name:"",description:"",goals:"",rules:"",user_id:"",knowledge_domain:"",subscriptions:[],schedules:[]},Se={topic:"",filter:"",reaction_type:"durable",workflow_type:"",pipeline_id:"",mcp_prompt:"",server_id:"",tool_name:"",input_mapping:"{}",execute_as:"",enabled:!0},qe={cron:"0 * * * *",reaction_type:"durable",workflow_type:"",pipeline_id:"",server_id:"",tool_name:"",envelope:"{}",execute_as:""};function Re(s,a){var o,p,u;const l=(p=(o=s.behaviors)==null?void 0:o.schedules)!=null&&p.length?s.behaviors.schedules.map(n=>({cron:n.cron||"",reaction_type:n.reaction_type||"durable",workflow_type:n.workflow_type||"",pipeline_id:n.pipeline_id||"",server_id:n.server_id||"",tool_name:n.tool_name||"",envelope:n.envelope?JSON.stringify(n.envelope,null,2):"{}",execute_as:n.execute_as||""})):(u=s.behaviors)!=null&&u.cron?[{cron:s.behaviors.cron,reaction_type:"durable",workflow_type:s.workflow_type??"",pipeline_id:"",server_id:"",tool_name:"",envelope:"{}",execute_as:""}]:[];return{name:s.id,description:s.description??"",goals:s.goals??"",rules:s.rules??"",user_id:s.user_id??"",knowledge_domain:s.knowledge_domain??"",subscriptions:a.map(n=>({id:n.id,topic:n.topic,filter:n.filter?JSON.stringify(n.filter,null,2):"",reaction_type:n.reaction_type,workflow_type:n.workflow_type??"",pipeline_id:n.pipeline_id??"",mcp_prompt:n.mcp_prompt??"",server_id:n.server_id??"",tool_name:n.tool_name??"",input_mapping:JSON.stringify(n.input_mapping??{},null,2),execute_as:n.execute_as??"",enabled:n.enabled})),schedules:l}}function $e(s){var l;const a={};return s.schedules.length>0&&(a.schedules=s.schedules.map(o=>({cron:o.cron,reaction_type:o.reaction_type||"durable",workflow_type:o.reaction_type==="pipeline"?void 0:o.workflow_type,pipeline_id:o.reaction_type==="pipeline"?o.pipeline_id:void 0,envelope:B(o.envelope)??{},execute_as:o.execute_as||void 0})),a.cron=s.schedules[0].cron),{id:s.name,description:s.description||void 0,goals:s.goals||void 0,rules:s.rules||void 0,user_id:s.user_id||void 0,knowledge_domain:s.knowledge_domain||void 0,behaviors:a,workflow_type:((l=s.schedules[0])==null?void 0:l.workflow_type)||void 0,pipeline_id:void 0}}function Pe(s){return s.subscriptions.map(a=>({id:a.id,topic:a.topic,filter:a.filter?B(a.filter):void 0,reaction_type:a.reaction_type,workflow_type:a.workflow_type||void 0,pipeline_id:a.pipeline_id||void 0,mcp_prompt:a.mcp_prompt||void 0,server_id:a.server_id||void 0,tool_name:a.tool_name||void 0,input_mapping:B(a.input_mapping)??{},execute_as:a.execute_as||void 0,enabled:a.enabled}))}function B(s){if(s.trim())try{return JSON.parse(s)}catch{return}}const S="section-header mt-[3em] first:mt-0",E="label",_="hint",R="input",M="input-json w-full";function Ie({form:s,set:a}){return e.jsxs("div",{className:"space-y-8",children:[e.jsxs("div",{className:"border-l-2 border-accent/30 pl-3 py-1 flex items-start justify-between",children:[e.jsx("p",{className:"text-[12px] text-text-secondary italic leading-relaxed",children:"Give your automation a name and describe what it does. The name appears everywhere — in events, logs, and the dashboard."}),e.jsx("button",{onClick:()=>{window.location.hash="#docs:agents.md:identity"},className:"text-text-quaternary hover:text-accent transition-colors shrink-0 ml-3",title:"Docs: Identity",children:e.jsx(P,{className:"w-3 h-3",strokeWidth:1.5})})]}),e.jsxs("div",{children:[e.jsx("label",{className:E,children:"Name *"}),e.jsx("input",{type:"text",value:s.name,onChange:l=>a("name",l.target.value),placeholder:"health-monitor",className:R}),e.jsx("p",{className:_,children:"Lowercase, kebab-case. This appears everywhere."})]}),e.jsxs("div",{children:[e.jsx("label",{className:E,children:"Description"}),e.jsx("input",{type:"text",value:s.description,onChange:l=>a("description",l.target.value),placeholder:"Watches for workflow failures and captures diagnostics",className:R}),e.jsx("p",{className:_,children:"One sentence that explains what this automation does."})]})]})}function Ee({form:s,set:a}){return e.jsxs("div",{className:"space-y-8",children:[e.jsxs("div",{className:"border-l-2 border-accent/30 pl-3 py-1 flex items-start justify-between",children:[e.jsx("p",{className:"text-[12px] text-text-secondary italic leading-relaxed",children:"Goals define what drives the automation. Rules define what constrains it."}),e.jsx("button",{onClick:()=>{window.location.hash="#docs:agents.md:motivation"},className:"text-text-quaternary hover:text-accent transition-colors shrink-0 ml-3",title:"Docs: Motivation",children:e.jsx(P,{className:"w-3 h-3",strokeWidth:1.5})})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-8",children:[e.jsxs("div",{children:[e.jsx("label",{className:E,children:"Goals"}),e.jsx("textarea",{value:s.goals,onChange:l=>a("goals",l.target.value),placeholder:"Detect failures early, capture diagnostics, alert before cascading",rows:4,className:`${R} resize-none`}),e.jsx("p",{className:_,children:"Primary motivation. What the automation is trying to achieve."})]}),e.jsxs("div",{children:[e.jsx("label",{className:E,children:"Rules"}),e.jsx("textarea",{value:s.rules,onChange:l=>a("rules",l.target.value),placeholder:"Never auto-restart failed workflows. Always escalate to humans.",rows:4,className:`${R} resize-none`}),e.jsx("p",{className:_,children:"Guardrails. What it must never do, even when goals suggest it should."})]})]})]})}function Oe({form:s,set:a}){const{data:l}=je(),o=(l==null?void 0:l.domains)??[];return e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{className:"border-l-2 border-accent/30 pl-3 py-1 flex items-start justify-between",children:[e.jsx("p",{className:"text-[12px] text-text-secondary italic leading-relaxed",children:"Assign a knowledge domain — the automation's memory. It stores context here over time."}),e.jsx("button",{onClick:()=>{window.location.hash="#docs:agents.md:knowledge"},className:"text-text-quaternary hover:text-accent transition-colors shrink-0 ml-3",title:"Docs: Knowledge",children:e.jsx(P,{className:"w-3 h-3",strokeWidth:1.5})})]}),e.jsxs("div",{children:[e.jsx("label",{className:E,children:"Knowledge Domain"}),e.jsx("input",{type:"text",value:s.knowledge_domain,onChange:p=>a("knowledge_domain",p.target.value),placeholder:"e.g., system-health, content-review, vendor-data",className:R,list:"domain-suggestions"}),e.jsx("datalist",{id:"domain-suggestions",children:o.map(p=>e.jsx("option",{value:p.domain},p.domain))}),e.jsx("p",{className:_,children:"Choose an existing domain to share memory, or type a new name to create one."})]}),o.length>0&&e.jsxs("div",{children:[e.jsx("label",{className:E,children:"Existing Domains"}),e.jsx("div",{className:"space-y-0.5 mt-2",children:o.map(p=>e.jsxs("button",{type:"button",onClick:()=>a("knowledge_domain",p.domain),className:`w-full flex items-center gap-3 px-3 py-2 rounded-md text-left transition-colors ${s.knowledge_domain===p.domain?"border-l-2 border-l-accent bg-accent/5":"hover:bg-surface-hover border-l-2 border-l-transparent"}`,children:[e.jsx(G,{className:"w-3.5 h-3.5 text-text-quaternary shrink-0",strokeWidth:1.5}),e.jsx("span",{className:"text-sm text-text-primary flex-1",children:p.domain}),e.jsxs("span",{className:"text-[10px] text-text-quaternary",children:[p.count," entries"]}),e.jsx("span",{className:"text-[9px] text-text-quaternary",children:e.jsx(me,{date:p.latest})})]},p.domain))})]})]})}function We({serverId:s,toolName:a,onChange:l}){const{data:o}=se(),p=f.useMemo(()=>{var t;return((t=o==null?void 0:o.categories)==null?void 0:t.flatMap(i=>i.tools))??[]},[o]),[u,n]=f.useState(!1),[v,d]=f.useState(""),c=f.useRef(null),h=f.useRef(null);f.useEffect(()=>{if(!u)return;function t(i){h.current&&!h.current.contains(i.target)&&n(!1)}return document.addEventListener("mousedown",t),()=>document.removeEventListener("mousedown",t)},[u]);const r=a?`${a}`:"",x=u?v:r,w=f.useMemo(()=>{const t=(u?v:"").toLowerCase();return t?p.filter(i=>i.name.toLowerCase().includes(t)||i.serverName.toLowerCase().includes(t)||(i.description??"").toLowerCase().includes(t)):p},[p,v,u]),m=a?p.find(t=>t.serverId===s&&t.name===a):void 0;return e.jsxs("div",{ref:h,className:"relative",children:[e.jsx("input",{ref:c,type:"text",value:x,onFocus:()=>{n(!0),d(r)},onChange:t=>{const i=t.target.value;d(i),i||l("",""),u||n(!0)},placeholder:"Search capabilities...",className:"input font-mono text-sm w-full"}),!u&&(m==null?void 0:m.description)&&e.jsx("p",{className:"text-[10px] text-text-tertiary mt-1 italic",children:m.description}),u&&w.length>0&&e.jsx("div",{className:"absolute z-50 left-0 right-0 mt-1 max-h-64 overflow-y-auto rounded-md border border-surface-border bg-surface shadow-lg",children:w.map(t=>e.jsxs("button",{type:"button",onClick:()=>{l(t.serverId,t.name),d(t.name),n(!1)},className:`w-full text-left px-3 py-2 hover:bg-surface-hover transition-colors flex items-center gap-3 ${s===t.serverId&&a===t.name?"bg-accent/5":""}`,children:[e.jsx("span",{className:"text-[11px] font-mono text-text-primary shrink-0",children:t.name}),e.jsxs("span",{className:"inline-flex items-center gap-1 px-1.5 py-0.5 rounded text-[9px] font-medium shrink-0 bg-accent/10 text-accent",children:[e.jsx(ve,{className:"w-2 h-2",strokeWidth:1.5}),t.serverName]}),t.description&&e.jsx("span",{className:"text-[10px] text-text-quaternary truncate",children:t.description})]},`${t.serverId}:${t.name}`))}),u&&w.length===0&&v&&e.jsx("div",{className:"absolute z-50 left-0 right-0 mt-1 rounded-md border border-surface-border bg-surface shadow-lg px-3 py-4 text-center",children:e.jsxs("p",{className:"text-[11px] text-text-quaternary",children:['No capabilities match "',v,'"']})})]})}const Ae={durable:"Workflow",pipeline:"Pipeline",capability:"Capability",mcp_query:"MCP Query"},Te=["durable","pipeline","capability","mcp_query"];function ae({reactionType:s,onReactionTypeChange:a,workflowType:l,onWorkflowTypeChange:o,pipelineId:p,onPipelineIdChange:u,serverId:n,toolName:v,onCapabilityChange:d,mcpPrompt:c,onMcpPromptChange:h,availableTypes:r=[...Te]}){const{data:x}=ye(),w=(x??[]).filter(i=>i.invocable).map(i=>i.workflow_type),{data:m}=ge({status:"active"}),t=((m==null?void 0:m.workflows)??[]).map(i=>({id:i.id,name:i.graph_topic||i.id}));return e.jsxs("div",{className:"space-y-4",children:[e.jsx("div",{className:"flex gap-1",children:r.map(i=>{const b=s===i;return e.jsx("button",{type:"button",onClick:()=>a(i),className:`px-3 py-1.5 text-[11px] font-medium rounded-md transition-colors ${b?"bg-accent/10 text-accent":"text-text-tertiary hover:text-text-primary hover:bg-surface-hover"}`,children:Ae[i]},i)})}),s==="durable"&&e.jsxs("div",{children:[e.jsx("label",{className:"label",children:"Workflow *"}),e.jsxs("select",{value:l,onChange:i=>o(i.target.value),className:"input",children:[e.jsx("option",{value:"",children:"Select workflow..."}),w.map(i=>e.jsx("option",{value:i,children:i},i))]})]}),s==="pipeline"&&e.jsxs("div",{children:[e.jsx("label",{className:"label",children:"Pipeline *"}),e.jsxs("select",{value:p,onChange:i=>u(i.target.value),className:"input",children:[e.jsx("option",{value:"",children:"Select pipeline..."}),t.map(i=>e.jsx("option",{value:i.id,children:i.name},i.id))]})]}),s==="capability"&&e.jsxs("div",{children:[e.jsx("label",{className:"label",children:"Capability *"}),e.jsx(We,{serverId:n,toolName:v,onChange:d})]}),s==="mcp_query"&&h&&e.jsxs("div",{children:[e.jsx("label",{className:"label",children:"Prompt *"}),e.jsx("textarea",{value:c??"",onChange:i=>h(i.target.value),placeholder:"Analyze the error and suggest remediation...",rows:3,className:"input resize-none"})]})]})}const Le={task:"bg-blue-400/15 text-blue-400",workflow:"bg-accent/15 text-accent",escalation:"bg-amber-400/15 text-amber-400",activity:"bg-cyan-400/15 text-cyan-400",knowledge:"bg-violet-400/15 text-violet-400",file:"bg-orange-400/15 text-orange-400",agent:"bg-emerald-400/15 text-emerald-400",app:"bg-rose-400/15 text-rose-400",milestone:"bg-violet-400/15 text-violet-400"};function Me({form:s,set:a}){const{data:l}=we({limit:200}),{data:o}=se(),p=(l==null?void 0:l.topics)??[],u=f.useMemo(()=>{var t;return((t=o==null?void 0:o.categories)==null?void 0:t.flatMap(i=>i.tools))??[]},[o]),[n,v]=f.useState(0),d=(t,i,b)=>{const j=[...s.subscriptions];j[t]={...j[t],[i]:b},a("subscriptions",j)},c=()=>{a("subscriptions",[...s.subscriptions,{...Se}]),v(s.subscriptions.length)},h=t=>{a("subscriptions",s.subscriptions.filter((i,b)=>b!==t)),n>=s.subscriptions.length-1&&v(Math.max(0,s.subscriptions.length-2))},r=s.subscriptions,x=r[n],w=t=>t.topic?t.reaction_type==="durable"?!!t.workflow_type:t.reaction_type==="pipeline"?!!t.pipeline_id:t.reaction_type==="mcp_query"?!!t.mcp_prompt:t.reaction_type==="capability"?!!t.server_id&&!!t.tool_name:!1:!1,m=x?p.find(t=>t.topic===x.topic):void 0;return r.length===0?e.jsxs("div",{className:"max-w-xl",children:[e.jsxs("div",{className:"border-l-2 border-accent/30 pl-3 py-1 flex items-start justify-between mb-8",children:[e.jsx("p",{className:"text-[12px] text-text-secondary italic leading-relaxed",children:"Optional. When a matching event is published, the automation runs the configured workflow with the event payload."}),e.jsx("button",{onClick:()=>{window.location.hash="#docs:agents.md:subscriptions"},className:"text-text-quaternary hover:text-accent transition-colors shrink-0 ml-3",title:"Docs: Subscriptions",children:e.jsx(P,{className:"w-3 h-3",strokeWidth:1.5})})]}),e.jsxs("div",{className:"flex flex-col items-center justify-center py-12 text-center",children:[e.jsx(U,{className:"w-8 h-8 text-text-quaternary/40 mb-3",strokeWidth:1}),e.jsx("p",{className:"text-sm text-text-tertiary mb-2",children:"No event subscriptions yet"}),e.jsx("p",{className:"text-[11px] text-text-quaternary max-w-sm mb-6",children:"Each subscription listens for a topic pattern and runs a workflow when it matches."}),e.jsxs("button",{onClick:c,className:"flex items-center gap-2 text-xs text-accent hover:text-accent-hover transition-colors",children:[e.jsx(L,{className:"w-3.5 h-3.5"})," Add first subscription"]})]})]}):e.jsxs("div",{children:[e.jsxs("div",{className:"border-l-2 border-accent/30 pl-3 py-1 flex items-start justify-between mb-6",children:[e.jsx("p",{className:"text-[12px] text-text-secondary italic leading-relaxed",children:"Optional. When a matching event is published, the automation runs the configured workflow with the event payload."}),e.jsx("button",{onClick:()=>{window.location.hash="#docs:agents.md:subscriptions"},className:"text-text-quaternary hover:text-accent transition-colors shrink-0 ml-3",title:"Docs: Subscriptions",children:e.jsx(P,{className:"w-3 h-3",strokeWidth:1.5})})]}),e.jsxs("div",{className:"flex gap-8",children:[e.jsxs("div",{className:"w-52 shrink-0 space-y-0.5",children:[r.map((t,i)=>e.jsxs("div",{className:`group/sub flex items-center rounded-md transition-colors ${n===i?"bg-accent/10 text-accent":"text-text-tertiary hover:text-text-primary hover:bg-surface-hover"}`,children:[e.jsxs("button",{onClick:()=>v(i),className:"flex-1 text-left px-3 py-2 min-w-0",children:[e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx("span",{className:`w-1.5 h-1.5 rounded-full shrink-0 ${w(t)?"bg-emerald-400":"bg-zinc-500"}`}),e.jsx("span",{className:"text-[11px] font-mono truncate",children:t.topic||"new subscription"})]}),e.jsxs("span",{className:"text-[9px] text-text-quaternary ml-3",children:["→ ",t.workflow_type||t.tool_name||t.reaction_type]})]}),e.jsx("button",{onClick:b=>{b.stopPropagation(),confirm(`Remove subscription "${t.topic||"new"}"?
|
|
1
|
+
import{j as e,a as f}from"./vendor-query-B2UbickB.js";import{a as re,d as le,b as oe}from"./agents-GIg2jxet.js";import{C as ce,u as de,a as pe,b as xe,c as ue}from"./CronLabel-Cfq2Hlsq.js";import{d as me,u as he}from"./index-B_e2uIz9.js";import{P as fe}from"./PageHeader-B4w-LDUF.js";import{B as P,d as G,b as ve,R as U,l as L,p as X,a5 as Y,a as Z,aG as ee,Q as be}from"./vendor-icons-5gSix3t2.js";import{e as je}from"./knowledge-tDl7bioT.js";import{R as te}from"./RunAsSelector-BpeN2J3V.js";import{u as ye}from"./workflows-C093TSq9.js";import{u as ge}from"./yaml-workflows-Du9N-ZOj.js";import{u as se}from"./capabilities-CQ5WgulO.js";import{u as we}from"./topics-BjuxqPQn.js";import{E as Ne}from"./EventTopicPill-RaASGdZz.js";import{W as V}from"./WorkflowPill-BkfIn8N3.js";import{e as _e,c as ke,f as Ce}from"./vendor-react-CX88sFS5.js";import"./BotPicker-6Xk1Fq1l.js";import"./bots-CvrmNkL3.js";const Q={name:"",description:"",goals:"",rules:"",user_id:"",knowledge_domain:"",subscriptions:[],schedules:[]},Se={topic:"",filter:"",reaction_type:"durable",workflow_type:"",pipeline_id:"",mcp_prompt:"",server_id:"",tool_name:"",input_mapping:"{}",execute_as:"",enabled:!0},qe={cron:"0 * * * *",reaction_type:"durable",workflow_type:"",pipeline_id:"",server_id:"",tool_name:"",envelope:"{}",execute_as:""};function Re(s,a){var o,p,u;const l=(p=(o=s.behaviors)==null?void 0:o.schedules)!=null&&p.length?s.behaviors.schedules.map(n=>({cron:n.cron||"",reaction_type:n.reaction_type||"durable",workflow_type:n.workflow_type||"",pipeline_id:n.pipeline_id||"",server_id:n.server_id||"",tool_name:n.tool_name||"",envelope:n.envelope?JSON.stringify(n.envelope,null,2):"{}",execute_as:n.execute_as||""})):(u=s.behaviors)!=null&&u.cron?[{cron:s.behaviors.cron,reaction_type:"durable",workflow_type:s.workflow_type??"",pipeline_id:"",server_id:"",tool_name:"",envelope:"{}",execute_as:""}]:[];return{name:s.id,description:s.description??"",goals:s.goals??"",rules:s.rules??"",user_id:s.user_id??"",knowledge_domain:s.knowledge_domain??"",subscriptions:a.map(n=>({id:n.id,topic:n.topic,filter:n.filter?JSON.stringify(n.filter,null,2):"",reaction_type:n.reaction_type,workflow_type:n.workflow_type??"",pipeline_id:n.pipeline_id??"",mcp_prompt:n.mcp_prompt??"",server_id:n.server_id??"",tool_name:n.tool_name??"",input_mapping:JSON.stringify(n.input_mapping??{},null,2),execute_as:n.execute_as??"",enabled:n.enabled})),schedules:l}}function $e(s){var l;const a={};return s.schedules.length>0&&(a.schedules=s.schedules.map(o=>({cron:o.cron,reaction_type:o.reaction_type||"durable",workflow_type:o.reaction_type==="pipeline"?void 0:o.workflow_type,pipeline_id:o.reaction_type==="pipeline"?o.pipeline_id:void 0,envelope:B(o.envelope)??{},execute_as:o.execute_as||void 0})),a.cron=s.schedules[0].cron),{id:s.name,description:s.description||void 0,goals:s.goals||void 0,rules:s.rules||void 0,user_id:s.user_id||void 0,knowledge_domain:s.knowledge_domain||void 0,behaviors:a,workflow_type:((l=s.schedules[0])==null?void 0:l.workflow_type)||void 0,pipeline_id:void 0}}function Pe(s){return s.subscriptions.map(a=>({id:a.id,topic:a.topic,filter:a.filter?B(a.filter):void 0,reaction_type:a.reaction_type,workflow_type:a.workflow_type||void 0,pipeline_id:a.pipeline_id||void 0,mcp_prompt:a.mcp_prompt||void 0,server_id:a.server_id||void 0,tool_name:a.tool_name||void 0,input_mapping:B(a.input_mapping)??{},execute_as:a.execute_as||void 0,enabled:a.enabled}))}function B(s){if(s.trim())try{return JSON.parse(s)}catch{return}}const S="section-header mt-[3em] first:mt-0",E="label",_="hint",R="input",M="input-json w-full";function Ie({form:s,set:a}){return e.jsxs("div",{className:"space-y-8",children:[e.jsxs("div",{className:"border-l-2 border-accent/30 pl-3 py-1 flex items-start justify-between",children:[e.jsx("p",{className:"text-[12px] text-text-secondary italic leading-relaxed",children:"Give your automation a name and describe what it does. The name appears everywhere — in events, logs, and the dashboard."}),e.jsx("button",{onClick:()=>{window.location.hash="#docs:agents.md:identity"},className:"text-text-quaternary hover:text-accent transition-colors shrink-0 ml-3",title:"Docs: Identity",children:e.jsx(P,{className:"w-3 h-3",strokeWidth:1.5})})]}),e.jsxs("div",{children:[e.jsx("label",{className:E,children:"Name *"}),e.jsx("input",{type:"text",value:s.name,onChange:l=>a("name",l.target.value),placeholder:"health-monitor",className:R}),e.jsx("p",{className:_,children:"Lowercase, kebab-case. This appears everywhere."})]}),e.jsxs("div",{children:[e.jsx("label",{className:E,children:"Description"}),e.jsx("input",{type:"text",value:s.description,onChange:l=>a("description",l.target.value),placeholder:"Watches for workflow failures and captures diagnostics",className:R}),e.jsx("p",{className:_,children:"One sentence that explains what this automation does."})]})]})}function Ee({form:s,set:a}){return e.jsxs("div",{className:"space-y-8",children:[e.jsxs("div",{className:"border-l-2 border-accent/30 pl-3 py-1 flex items-start justify-between",children:[e.jsx("p",{className:"text-[12px] text-text-secondary italic leading-relaxed",children:"Goals define what drives the automation. Rules define what constrains it."}),e.jsx("button",{onClick:()=>{window.location.hash="#docs:agents.md:motivation"},className:"text-text-quaternary hover:text-accent transition-colors shrink-0 ml-3",title:"Docs: Motivation",children:e.jsx(P,{className:"w-3 h-3",strokeWidth:1.5})})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-8",children:[e.jsxs("div",{children:[e.jsx("label",{className:E,children:"Goals"}),e.jsx("textarea",{value:s.goals,onChange:l=>a("goals",l.target.value),placeholder:"Detect failures early, capture diagnostics, alert before cascading",rows:4,className:`${R} resize-none`}),e.jsx("p",{className:_,children:"Primary motivation. What the automation is trying to achieve."})]}),e.jsxs("div",{children:[e.jsx("label",{className:E,children:"Rules"}),e.jsx("textarea",{value:s.rules,onChange:l=>a("rules",l.target.value),placeholder:"Never auto-restart failed workflows. Always escalate to humans.",rows:4,className:`${R} resize-none`}),e.jsx("p",{className:_,children:"Guardrails. What it must never do, even when goals suggest it should."})]})]})]})}function Oe({form:s,set:a}){const{data:l}=je(),o=(l==null?void 0:l.domains)??[];return e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{className:"border-l-2 border-accent/30 pl-3 py-1 flex items-start justify-between",children:[e.jsx("p",{className:"text-[12px] text-text-secondary italic leading-relaxed",children:"Assign a knowledge domain — the automation's memory. It stores context here over time."}),e.jsx("button",{onClick:()=>{window.location.hash="#docs:agents.md:knowledge"},className:"text-text-quaternary hover:text-accent transition-colors shrink-0 ml-3",title:"Docs: Knowledge",children:e.jsx(P,{className:"w-3 h-3",strokeWidth:1.5})})]}),e.jsxs("div",{children:[e.jsx("label",{className:E,children:"Knowledge Domain"}),e.jsx("input",{type:"text",value:s.knowledge_domain,onChange:p=>a("knowledge_domain",p.target.value),placeholder:"e.g., system-health, content-review, vendor-data",className:R,list:"domain-suggestions"}),e.jsx("datalist",{id:"domain-suggestions",children:o.map(p=>e.jsx("option",{value:p.domain},p.domain))}),e.jsx("p",{className:_,children:"Choose an existing domain to share memory, or type a new name to create one."})]}),o.length>0&&e.jsxs("div",{children:[e.jsx("label",{className:E,children:"Existing Domains"}),e.jsx("div",{className:"space-y-0.5 mt-2",children:o.map(p=>e.jsxs("button",{type:"button",onClick:()=>a("knowledge_domain",p.domain),className:`w-full flex items-center gap-3 px-3 py-2 rounded-md text-left transition-colors ${s.knowledge_domain===p.domain?"border-l-2 border-l-accent bg-accent/5":"hover:bg-surface-hover border-l-2 border-l-transparent"}`,children:[e.jsx(G,{className:"w-3.5 h-3.5 text-text-quaternary shrink-0",strokeWidth:1.5}),e.jsx("span",{className:"text-sm text-text-primary flex-1",children:p.domain}),e.jsxs("span",{className:"text-[10px] text-text-quaternary",children:[p.count," entries"]}),e.jsx("span",{className:"text-[9px] text-text-quaternary",children:e.jsx(me,{date:p.latest})})]},p.domain))})]})]})}function We({serverId:s,toolName:a,onChange:l}){const{data:o}=se(),p=f.useMemo(()=>{var t;return((t=o==null?void 0:o.categories)==null?void 0:t.flatMap(i=>i.tools))??[]},[o]),[u,n]=f.useState(!1),[v,d]=f.useState(""),c=f.useRef(null),h=f.useRef(null);f.useEffect(()=>{if(!u)return;function t(i){h.current&&!h.current.contains(i.target)&&n(!1)}return document.addEventListener("mousedown",t),()=>document.removeEventListener("mousedown",t)},[u]);const r=a?`${a}`:"",x=u?v:r,w=f.useMemo(()=>{const t=(u?v:"").toLowerCase();return t?p.filter(i=>i.name.toLowerCase().includes(t)||i.serverName.toLowerCase().includes(t)||(i.description??"").toLowerCase().includes(t)):p},[p,v,u]),m=a?p.find(t=>t.serverId===s&&t.name===a):void 0;return e.jsxs("div",{ref:h,className:"relative",children:[e.jsx("input",{ref:c,type:"text",value:x,onFocus:()=>{n(!0),d(r)},onChange:t=>{const i=t.target.value;d(i),i||l("",""),u||n(!0)},placeholder:"Search capabilities...",className:"input font-mono text-sm w-full"}),!u&&(m==null?void 0:m.description)&&e.jsx("p",{className:"text-[10px] text-text-tertiary mt-1 italic",children:m.description}),u&&w.length>0&&e.jsx("div",{className:"absolute z-50 left-0 right-0 mt-1 max-h-64 overflow-y-auto rounded-md border border-surface-border bg-surface shadow-lg",children:w.map(t=>e.jsxs("button",{type:"button",onClick:()=>{l(t.serverId,t.name),d(t.name),n(!1)},className:`w-full text-left px-3 py-2 hover:bg-surface-hover transition-colors flex items-center gap-3 ${s===t.serverId&&a===t.name?"bg-accent/5":""}`,children:[e.jsx("span",{className:"text-[11px] font-mono text-text-primary shrink-0",children:t.name}),e.jsxs("span",{className:"inline-flex items-center gap-1 px-1.5 py-0.5 rounded text-[9px] font-medium shrink-0 bg-accent/10 text-accent",children:[e.jsx(ve,{className:"w-2 h-2",strokeWidth:1.5}),t.serverName]}),t.description&&e.jsx("span",{className:"text-[10px] text-text-quaternary truncate",children:t.description})]},`${t.serverId}:${t.name}`))}),u&&w.length===0&&v&&e.jsx("div",{className:"absolute z-50 left-0 right-0 mt-1 rounded-md border border-surface-border bg-surface shadow-lg px-3 py-4 text-center",children:e.jsxs("p",{className:"text-[11px] text-text-quaternary",children:['No capabilities match "',v,'"']})})]})}const Ae={durable:"Workflow",pipeline:"Pipeline",capability:"Capability",mcp_query:"MCP Query"},Te=["durable","pipeline","capability","mcp_query"];function ae({reactionType:s,onReactionTypeChange:a,workflowType:l,onWorkflowTypeChange:o,pipelineId:p,onPipelineIdChange:u,serverId:n,toolName:v,onCapabilityChange:d,mcpPrompt:c,onMcpPromptChange:h,availableTypes:r=[...Te]}){const{data:x}=ye(),w=(x??[]).filter(i=>i.invocable).map(i=>i.workflow_type),{data:m}=ge({status:"active"}),t=((m==null?void 0:m.workflows)??[]).map(i=>({id:i.id,name:i.graph_topic||i.id}));return e.jsxs("div",{className:"space-y-4",children:[e.jsx("div",{className:"flex gap-1",children:r.map(i=>{const b=s===i;return e.jsx("button",{type:"button",onClick:()=>a(i),className:`px-3 py-1.5 text-[11px] font-medium rounded-md transition-colors ${b?"bg-accent/10 text-accent":"text-text-tertiary hover:text-text-primary hover:bg-surface-hover"}`,children:Ae[i]},i)})}),s==="durable"&&e.jsxs("div",{children:[e.jsx("label",{className:"label",children:"Workflow *"}),e.jsxs("select",{value:l,onChange:i=>o(i.target.value),className:"input",children:[e.jsx("option",{value:"",children:"Select workflow..."}),w.map(i=>e.jsx("option",{value:i,children:i},i))]})]}),s==="pipeline"&&e.jsxs("div",{children:[e.jsx("label",{className:"label",children:"Pipeline *"}),e.jsxs("select",{value:p,onChange:i=>u(i.target.value),className:"input",children:[e.jsx("option",{value:"",children:"Select pipeline..."}),t.map(i=>e.jsx("option",{value:i.id,children:i.name},i.id))]})]}),s==="capability"&&e.jsxs("div",{children:[e.jsx("label",{className:"label",children:"Capability *"}),e.jsx(We,{serverId:n,toolName:v,onChange:d})]}),s==="mcp_query"&&h&&e.jsxs("div",{children:[e.jsx("label",{className:"label",children:"Prompt *"}),e.jsx("textarea",{value:c??"",onChange:i=>h(i.target.value),placeholder:"Analyze the error and suggest remediation...",rows:3,className:"input resize-none"})]})]})}const Le={task:"bg-blue-400/15 text-blue-400",workflow:"bg-accent/15 text-accent",escalation:"bg-amber-400/15 text-amber-400",activity:"bg-cyan-400/15 text-cyan-400",knowledge:"bg-violet-400/15 text-violet-400",file:"bg-orange-400/15 text-orange-400",agent:"bg-emerald-400/15 text-emerald-400",app:"bg-rose-400/15 text-rose-400",milestone:"bg-violet-400/15 text-violet-400"};function Me({form:s,set:a}){const{data:l}=we({limit:200}),{data:o}=se(),p=(l==null?void 0:l.topics)??[],u=f.useMemo(()=>{var t;return((t=o==null?void 0:o.categories)==null?void 0:t.flatMap(i=>i.tools))??[]},[o]),[n,v]=f.useState(0),d=(t,i,b)=>{const j=[...s.subscriptions];j[t]={...j[t],[i]:b},a("subscriptions",j)},c=()=>{a("subscriptions",[...s.subscriptions,{...Se}]),v(s.subscriptions.length)},h=t=>{a("subscriptions",s.subscriptions.filter((i,b)=>b!==t)),n>=s.subscriptions.length-1&&v(Math.max(0,s.subscriptions.length-2))},r=s.subscriptions,x=r[n],w=t=>t.topic?t.reaction_type==="durable"?!!t.workflow_type:t.reaction_type==="pipeline"?!!t.pipeline_id:t.reaction_type==="mcp_query"?!!t.mcp_prompt:t.reaction_type==="capability"?!!t.server_id&&!!t.tool_name:!1:!1,m=x?p.find(t=>t.topic===x.topic):void 0;return r.length===0?e.jsxs("div",{className:"max-w-xl",children:[e.jsxs("div",{className:"border-l-2 border-accent/30 pl-3 py-1 flex items-start justify-between mb-8",children:[e.jsx("p",{className:"text-[12px] text-text-secondary italic leading-relaxed",children:"Optional. When a matching event is published, the automation runs the configured workflow with the event payload."}),e.jsx("button",{onClick:()=>{window.location.hash="#docs:agents.md:subscriptions"},className:"text-text-quaternary hover:text-accent transition-colors shrink-0 ml-3",title:"Docs: Subscriptions",children:e.jsx(P,{className:"w-3 h-3",strokeWidth:1.5})})]}),e.jsxs("div",{className:"flex flex-col items-center justify-center py-12 text-center",children:[e.jsx(U,{className:"w-8 h-8 text-text-quaternary/40 mb-3",strokeWidth:1}),e.jsx("p",{className:"text-sm text-text-tertiary mb-2",children:"No event subscriptions yet"}),e.jsx("p",{className:"text-[11px] text-text-quaternary max-w-sm mb-6",children:"Each subscription listens for a topic pattern and runs a workflow when it matches."}),e.jsxs("button",{onClick:c,className:"flex items-center gap-2 text-xs text-accent hover:text-accent-hover transition-colors",children:[e.jsx(L,{className:"w-3.5 h-3.5"})," Add first subscription"]})]})]}):e.jsxs("div",{children:[e.jsxs("div",{className:"border-l-2 border-accent/30 pl-3 py-1 flex items-start justify-between mb-6",children:[e.jsx("p",{className:"text-[12px] text-text-secondary italic leading-relaxed",children:"Optional. When a matching event is published, the automation runs the configured workflow with the event payload."}),e.jsx("button",{onClick:()=>{window.location.hash="#docs:agents.md:subscriptions"},className:"text-text-quaternary hover:text-accent transition-colors shrink-0 ml-3",title:"Docs: Subscriptions",children:e.jsx(P,{className:"w-3 h-3",strokeWidth:1.5})})]}),e.jsxs("div",{className:"flex gap-8",children:[e.jsxs("div",{className:"w-52 shrink-0 space-y-0.5",children:[r.map((t,i)=>e.jsxs("div",{className:`group/sub flex items-center rounded-md transition-colors ${n===i?"bg-accent/10 text-accent":"text-text-tertiary hover:text-text-primary hover:bg-surface-hover"}`,children:[e.jsxs("button",{onClick:()=>v(i),className:"flex-1 text-left px-3 py-2 min-w-0",children:[e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx("span",{className:`w-1.5 h-1.5 rounded-full shrink-0 ${w(t)?"bg-emerald-400":"bg-zinc-500"}`}),e.jsx("span",{className:"text-[11px] font-mono truncate",children:t.topic||"new subscription"})]}),e.jsxs("span",{className:"text-[9px] text-text-quaternary ml-3",children:["→ ",t.workflow_type||t.tool_name||t.reaction_type]})]}),e.jsx("button",{onClick:b=>{b.stopPropagation(),confirm(`Remove subscription "${t.topic||"new"}"?
|
|
2
2
|
|
|
3
3
|
This takes effect when you save.`)&&h(i)},className:"opacity-0 group-hover/sub:opacity-100 px-2 text-text-quaternary hover:text-red-400 transition-all",title:"Remove",children:e.jsx(X,{className:"w-3 h-3"})})]},i)),e.jsxs("button",{onClick:c,className:"w-full flex items-center gap-1.5 px-3 py-2 text-[11px] text-accent hover:text-accent-hover transition-colors",children:[e.jsx(L,{className:"w-3 h-3"})," Add"]})]}),x&&e.jsxs("div",{className:"flex-1 min-w-0 space-y-12",children:[e.jsxs("div",{children:[e.jsx("label",{className:S,children:"When this event fires"}),e.jsx(Je,{value:x.topic,onChange:t=>d(n,"topic",t),topics:p}),(m==null?void 0:m.payload_schema)&&e.jsxs("div",{className:"mt-3 p-3 rounded-md bg-surface-sunken border border-surface-border",children:[e.jsx("p",{className:"text-[10px] text-text-quaternary mb-1 uppercase tracking-wider font-medium",children:"Payload Schema"}),e.jsx("pre",{className:"text-[11px] font-mono text-text-secondary whitespace-pre-wrap overflow-x-auto max-h-40",children:JSON.stringify(m.payload_schema.properties??m.payload_schema,null,2)}),m.description&&e.jsx("p",{className:"text-[10px] text-text-tertiary mt-2 italic",children:m.description})]})]}),e.jsxs("div",{children:[e.jsx("label",{className:S,children:"Run this reaction"}),e.jsx(ae,{reactionType:x.reaction_type,onReactionTypeChange:t=>d(n,"reaction_type",t),workflowType:x.workflow_type,onWorkflowTypeChange:t=>d(n,"workflow_type",t),pipelineId:x.pipeline_id,onPipelineIdChange:t=>d(n,"pipeline_id",t),serverId:x.server_id,toolName:x.tool_name,onCapabilityChange:(t,i)=>{var $;const b=[...s.subscriptions],j={...b[n],server_id:t,tool_name:i},k=u.find(g=>g.serverId===t&&g.name===i),I=($=k==null?void 0:k.inputSchema)==null?void 0:$.properties;if(I&&i){const g={};for(const O of Object.keys(I))O.startsWith("_")||(g[O]=`{event.data.${O}}`);j.input_mapping=JSON.stringify(g,null,2)}b[n]=j,a("subscriptions",b)},mcpPrompt:x.mcp_prompt,onMcpPromptChange:t=>d(n,"mcp_prompt",t)})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-6",children:[e.jsxs("div",{children:[e.jsx("label",{className:S,children:"As identity"}),e.jsx(te,{selected:x.execute_as,onChange:t=>d(n,"execute_as",t)}),e.jsx("p",{className:_,children:"Identity used when invoking the workflow."})]}),e.jsxs("div",{children:[e.jsx("label",{className:S,children:"But only if"}),e.jsx("input",{type:"text",value:x.filter,onChange:t=>d(n,"filter",t.target.value),placeholder:'{"extension": "png"}',className:`${R} font-mono text-xs`}),e.jsxs("p",{className:_,children:["JSON filter against event.data. Operators: equality ",e.jsx("code",{className:"text-accent",children:'{"key":"val"}'}),", negation ",e.jsx("code",{className:"text-accent",children:'{"key":{"$ne":"val"}}'}),", in-list ",e.jsx("code",{className:"text-accent",children:'{"key":{"$in":["a","b"]}}'}),", exists ",e.jsx("code",{className:"text-accent",children:'{"key":{"$exists":true}}'})]})]})]}),e.jsxs("div",{children:[e.jsx("label",{className:S,children:"With this data"}),x.reaction_type==="capability"&&x.tool_name?e.jsx(Fe,{tool:u.find(t=>t.serverId===x.server_id&&t.name===x.tool_name),value:x.input_mapping,onChange:t=>d(n,"input_mapping",t),eventSchema:m==null?void 0:m.payload_schema}):e.jsxs(e.Fragment,{children:[e.jsx("textarea",{value:x.input_mapping,onChange:t=>d(n,"input_mapping",t.target.value),rows:10,className:M,placeholder:`{
|
|
4
4
|
"data": {
|
|
@@ -13,4 +13,4 @@ This takes effect when you save.`)&&h(i)},className:"opacity-0 group-hover/sub:o
|
|
|
13
13
|
This takes effect when you save.`)&&n(h)},className:"opacity-0 group-hover/sched:opacity-100 px-2 text-text-quaternary hover:text-red-400 transition-all",title:"Remove",children:e.jsx(X,{className:"w-3 h-3"})})]},h)),e.jsxs("button",{onClick:u,className:"w-full flex items-center gap-1.5 px-3 py-2 text-[11px] text-accent hover:text-accent-hover transition-colors",children:[e.jsx(L,{className:"w-3 h-3"})," Add"]})]}),d&&e.jsxs("div",{className:"flex-1 min-w-0 space-y-12",children:[e.jsxs("div",{children:[e.jsx("label",{className:S,children:"Run every"}),e.jsx("input",{type:"text",value:d.cron,onChange:c=>p(l,"cron",c.target.value),placeholder:"0 * * * *",className:`${R} font-mono`}),d.cron&&e.jsx("p",{className:"text-[11px] text-accent/80 mt-1",children:z(d.cron)}),e.jsx("div",{className:"flex gap-3 mt-2 overflow-x-auto",children:ze.map(c=>e.jsx("button",{type:"button",onClick:()=>p(l,"cron",c),className:`text-[10px] font-mono whitespace-nowrap transition-colors ${d.cron===c?"text-accent font-medium":"text-accent/50 hover:text-accent"}`,children:z(c)},c))})]}),e.jsxs("div",{children:[e.jsx("label",{className:S,children:"Run this reaction"}),e.jsx(ae,{reactionType:d.reaction_type,onReactionTypeChange:c=>p(l,"reaction_type",c),workflowType:d.workflow_type,onWorkflowTypeChange:c=>p(l,"workflow_type",c),pipelineId:d.pipeline_id,onPipelineIdChange:c=>p(l,"pipeline_id",c),serverId:d.server_id,toolName:d.tool_name,onCapabilityChange:(c,h)=>{p(l,"server_id",c),p(l,"tool_name",h)},availableTypes:["durable","pipeline","capability"]})]}),e.jsxs("div",{children:[e.jsx("label",{className:S,children:"As identity"}),e.jsx(te,{selected:d.execute_as,onChange:c=>p(l,"execute_as",c)}),e.jsx("p",{className:_,children:"Identity used when invoking."})]}),e.jsxs("div",{children:[e.jsx("label",{className:S,children:"With this data"}),e.jsx("textarea",{value:d.envelope,onChange:c=>p(l,"envelope",c.target.value),rows:10,className:M,placeholder:`{
|
|
14
14
|
"data": { "source": "cron" }
|
|
15
15
|
}`}),e.jsx("p",{className:_,children:"Static payload passed to the workflow on each invocation."})]})]})]})]})}function A({icon:s,color:a,title:l,children:o}){return e.jsxs("div",{className:"mb-10",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-2 pb-1.5 border-b border-surface-border/40",children:[e.jsx(s,{className:`w-3.5 h-3.5 ${a}`,strokeWidth:1.5}),e.jsx("h3",{className:"text-xs font-semibold uppercase tracking-widest text-accent/80",children:l})]}),e.jsx("div",{className:"pl-5.5",children:o})]})}function T({label:s,children:a}){return e.jsxs("div",{className:"flex gap-3 py-0.5",children:[e.jsx("span",{className:"text-[10px] text-text-quaternary w-20 shrink-0",children:s}),e.jsx("span",{className:"text-xs text-text-primary",children:a})]})}function Ge({form:s}){return e.jsxs("div",{children:[e.jsxs(A,{icon:Z,color:"text-accent",title:"Identity",children:[e.jsx(T,{label:"Name",children:s.name||"—"}),s.description&&e.jsx(T,{label:"Description",children:s.description})]}),(s.goals||s.rules)&&e.jsxs(A,{icon:ee,color:"text-rose-400",title:"Motivation",children:[s.goals&&e.jsx(T,{label:"Goals",children:s.goals}),s.rules&&e.jsx(T,{label:"Rules",children:s.rules})]}),e.jsx(A,{icon:G,color:"text-emerald-400",title:"Knowledge",children:e.jsx(T,{label:"Domain",children:s.knowledge_domain||"None"})}),e.jsxs("div",{className:"grid grid-cols-2 gap-x-10",children:[e.jsx(A,{icon:U,color:"text-cyan-400",title:`Subscriptions (${s.subscriptions.length})`,children:s.subscriptions.length===0?e.jsx("span",{className:"text-[11px] text-text-quaternary",children:"None configured"}):e.jsx("div",{className:"divide-y divide-surface-border/30",children:s.subscriptions.map((a,l)=>e.jsxs("div",{className:"flex items-center py-1.5",children:[e.jsx("div",{className:"flex-1 min-w-0",children:e.jsx(Ne,{topic:a.topic||"unset"})}),e.jsxs("div",{className:"flex items-center gap-1.5 shrink-0",children:[e.jsx("span",{className:"text-text-quaternary text-[10px]",children:"→"}),a.workflow_type?e.jsx(V,{type:a.workflow_type}):e.jsx("span",{className:"text-[11px] text-text-quaternary",children:a.reaction_type})]})]},l))})}),e.jsx(A,{icon:Y,color:"text-amber-400",title:`Schedules (${s.schedules.length})`,children:s.schedules.length===0?e.jsx("span",{className:"text-[11px] text-text-quaternary",children:"None configured"}):e.jsx("div",{className:"divide-y divide-surface-border/30",children:s.schedules.map((a,l)=>e.jsxs("div",{className:"flex items-center py-1.5",children:[e.jsx("div",{className:"flex-1 min-w-0",children:e.jsx(ce,{cron:a.cron})}),e.jsxs("div",{className:"flex items-center gap-1.5 shrink-0",children:[e.jsx("span",{className:"text-text-quaternary text-[10px]",children:"→"}),a.workflow_type?e.jsx(V,{type:a.workflow_type}):e.jsx("span",{className:"text-[11px] text-text-quaternary",children:"no workflow"})]})]},l))})})]}),e.jsx("div",{className:"border-l-2 border-emerald-400/30 pl-3 py-2 mt-6",children:e.jsx("p",{className:"text-[11px] text-text-tertiary leading-relaxed",children:"After saving, subscriptions and schedules activate immediately. You can pause the automation anytime."})})]})}const Ue=[{id:1,label:"Identity",icon:Z},{id:2,label:"Motivation",icon:ee},{id:3,label:"Knowledge",icon:G},{id:4,label:"Subscriptions",icon:U},{id:5,label:"Schedules",icon:Y},{id:6,label:"Review",icon:be}];function dt(){var H;const{id:s}=_e(),a=!s,l=ke(),{data:o}=he(),u=!!((H=o==null?void 0:o.ai)!=null&&H.enabled)?"Agent":"Automation",{data:n,isLoading:v}=re(a?null:s),{data:d}=de(a?null:s),c=le(),h=oe(),r=pe(),x=xe(),w=ue(),[m,t]=f.useState(Q),[i,b]=f.useState(!1),[j,k]=f.useState(""),[I,$]=Ce(),g=parseInt(I.get("step")||"1",10),O=f.useCallback(y=>{$(N=>{const q=new URLSearchParams(N);return q.set("step",String(y)),q},{replace:!0})},[$]);f.useEffect(()=>{if(!i){if(a){t(Q),b(!0);return}n&&d&&(t(Re(n,d.subscriptions??[])),b(!0))}},[n,d,a,i]);const W=(y,N)=>t(q=>({...q,[y]:N})),ne=async()=>{k("");try{const y=$e(m);let N=s;a?N=(await c.mutateAsync(y)).id:await h.mutateAsync({id:s,...y});const q=Pe(m),ie=(d==null?void 0:d.subscriptions)??[],F=new Set(ie.map(C=>C.id));for(const C of q)if(C.id&&F.has(C.id)){const{id:D,...J}=C;await x.mutateAsync({agentId:N,subId:D,...J}),F.delete(D)}else{const{id:D,...J}=C;await r.mutateAsync({agentId:N,...J})}for(const C of F)await w.mutateAsync({agentId:N,subId:C});l(`/agents/${N}`)}catch(y){k(y.message)}};if(!a&&v)return e.jsxs("div",{className:"animate-pulse space-y-4",children:[e.jsx("div",{className:"h-8 bg-surface-sunken rounded w-48"}),e.jsx("div",{className:"h-60 bg-surface-sunken rounded"})]});const K=c.isPending||h.isPending;return e.jsxs("div",{children:[e.jsx(fe,{title:a?`New ${u}`:`${u}: ${(n==null?void 0:n.id)??""}`,docsHash:"#docs:agents.md"}),e.jsxs("div",{className:"flex gap-10",children:[e.jsxs("nav",{className:"w-44 shrink-0 sticky top-0 self-start pt-2",children:[e.jsx("div",{className:"space-y-0.5",children:Ue.map(y=>{const N=y.icon,q=g===y.id;return e.jsxs("button",{onClick:()=>O(y.id),className:`w-full flex items-center gap-2.5 px-3 py-2 rounded-md text-left transition-colors ${q?"bg-accent/10 text-accent":"text-text-tertiary hover:text-text-primary hover:bg-surface-hover"}`,children:[e.jsx(N,{className:"w-3.5 h-3.5 shrink-0",strokeWidth:1.5}),e.jsx("span",{className:"text-xs font-medium",children:y.label})]},y.id)})}),e.jsxs("div",{className:"mt-8 pt-4 border-t border-surface-border space-y-2",children:[e.jsx("button",{onClick:ne,disabled:!m.name.trim()||K,className:"w-full btn-primary text-xs disabled:opacity-50",children:K?"Saving...":a?`Create ${u}`:"Save"}),e.jsx("button",{onClick:()=>l(a?"/agents":`/agents/${s}`),className:"w-full btn-ghost text-xs",children:"Cancel"})]}),j&&e.jsx("p",{className:"text-xs text-status-error mt-3",children:j})]}),e.jsxs("div",{className:"flex-1 min-w-0 pt-2",children:[g===1&&e.jsx(Ie,{form:m,set:W}),g===2&&e.jsx(Ee,{form:m,set:W}),g===3&&e.jsx(Oe,{form:m,set:W}),g===4&&e.jsx(Me,{form:m,set:W}),g===5&&e.jsx(Be,{form:m,set:W}),g===6&&e.jsx(Ge,{form:m})]})]})]})}export{dt as AgentConfigPage};
|
|
16
|
-
//# sourceMappingURL=AgentConfigPage-
|
|
16
|
+
//# sourceMappingURL=AgentConfigPage-BGDDZpxn.js.map
|