@hotmeshio/long-tail 0.14.4 → 0.16.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +23 -9
- package/build/api/escalations/create.js +18 -0
- package/build/api/escalations/index.d.ts +1 -0
- package/build/api/escalations/index.js +3 -1
- package/build/api/escalations/lookups.d.ts +20 -0
- package/build/api/escalations/lookups.js +90 -0
- package/build/api/escalations/metadata.d.ts +1 -1
- package/build/api/escalations/metadata.js +4 -4
- package/build/api/escalations/resolve.d.ts +1 -1
- package/build/api/escalations/resolve.js +6 -6
- package/build/api/knowledge.d.ts +9 -0
- package/build/api/knowledge.js +24 -0
- package/build/bin/ltc.js +10 -0
- package/build/index.d.ts +1 -1
- package/build/index.js +3 -2
- package/build/lib/cli/commands/escalations.d.ts +3 -0
- package/build/lib/cli/commands/escalations.js +25 -0
- package/build/lib/cli/commands/knowledge.d.ts +5 -0
- package/build/lib/cli/commands/knowledge.js +17 -2
- package/build/lib/cli/scanner.js +2 -0
- package/build/lib/db/schemas/033_knowledge_versions.sql +33 -0
- package/build/routes/escalations/single.js +10 -0
- package/build/routes/knowledge.js +35 -2
- package/build/sdk/index.d.ts +5 -0
- package/build/sdk/index.js +3 -0
- package/build/services/diagnostics/patterns.js +1 -1
- package/build/services/escalation/crud.d.ts +3 -3
- package/build/services/escalation/crud.js +9 -2
- package/build/services/escalation/resolver-validation.js +6 -0
- package/build/services/escalation/sql.d.ts +1 -1
- package/build/services/escalation/sql.js +1 -1
- package/build/services/knowledge/index.d.ts +18 -0
- package/build/services/knowledge/index.js +52 -0
- package/build/services/knowledge/lookup-cache.d.ts +29 -0
- package/build/services/knowledge/lookup-cache.js +94 -0
- package/build/services/knowledge/sql.d.ts +2 -0
- package/build/services/knowledge/sql.js +14 -0
- package/build/services/mcp/server-tools.js +30 -0
- package/build/services/orchestrator/condition.d.ts +33 -13
- package/build/services/orchestrator/condition.js +41 -14
- package/build/services/yaml-workflow/durable-compiler/parser.js +4 -1
- package/build/shared/form-validation/ctx-path.d.ts +12 -0
- package/build/shared/form-validation/ctx-path.js +56 -0
- package/build/shared/form-validation/field-validator.d.ts +4 -2
- package/build/shared/form-validation/field-validator.js +21 -17
- package/build/shared/form-validation/index.d.ts +1 -0
- package/build/shared/form-validation/index.js +1 -0
- package/build/shared/form-validation/x-lt-help.d.ts +1 -1
- package/build/shared/form-validation/x-lt-help.js +2 -1
- package/build/shared/form-validation/x-lt-options.d.ts +1 -16
- package/build/shared/form-validation/x-lt-options.js +35 -23
- package/build/system/activities/knowledge.d.ts +3 -0
- package/build/system/activities/knowledge.js +5 -2
- package/build/system/activities/sql.d.ts +6 -10
- package/build/system/activities/sql.js +105 -49
- package/build/system/mcp-servers/admin/schemas.d.ts +4 -4
- package/build/system/mcp-servers/knowledge.js +23 -2
- package/build/system/seed/tool-manifests-escalation.js +12 -0
- package/build/system/seed/tool-manifests-knowledge.d.ts +36 -0
- package/build/system/seed/tool-manifests-knowledge.js +15 -1
- package/build/tsconfig.tsbuildinfo +1 -1
- package/build/types/escalation.d.ts +37 -3
- package/build/types/escalation.js +42 -2
- package/dashboard/dist/assets/{AdminDashboard-CUqnrc7h.js → AdminDashboard-BVgjY4zN.js} +2 -2
- package/dashboard/dist/assets/{AdminDashboard-CUqnrc7h.js.map → AdminDashboard-BVgjY4zN.js.map} +1 -1
- package/dashboard/dist/assets/{AgentConfigPage-lmUOwyHO.js → AgentConfigPage-ChL59YL5.js} +6 -6
- package/dashboard/dist/assets/AgentConfigPage-ChL59YL5.js.map +1 -0
- package/dashboard/dist/assets/{AgentDetailPage-C_xAw6aF.js → AgentDetailPage-IJfgCOIF.js} +2 -2
- package/dashboard/dist/assets/AgentDetailPage-IJfgCOIF.js.map +1 -0
- package/dashboard/dist/assets/{AgentsPage-CHCGAkpN.js → AgentsPage-C7PnPXz_.js} +2 -2
- package/dashboard/dist/assets/{AgentsPage-CHCGAkpN.js.map → AgentsPage-C7PnPXz_.js.map} +1 -1
- package/dashboard/dist/assets/AvailableEscalationsPage-C5f2rqHa.js +2 -0
- package/dashboard/dist/assets/{AvailableEscalationsPage-BvQdHMl2.js.map → AvailableEscalationsPage-C5f2rqHa.js.map} +1 -1
- package/dashboard/dist/assets/{BotPicker-Dsr8Yyj_.js → BotPicker-CBf6bHLV.js} +2 -2
- package/dashboard/dist/assets/{BotPicker-Dsr8Yyj_.js.map → BotPicker-CBf6bHLV.js.map} +1 -1
- package/dashboard/dist/assets/{BulkAssignModal-CbUftMR2.js → BulkAssignModal-CkxoPByA.js} +2 -2
- package/dashboard/dist/assets/{BulkAssignModal-CbUftMR2.js.map → BulkAssignModal-CkxoPByA.js.map} +1 -1
- package/dashboard/dist/assets/CapabilitiesPage-D7USh3F0.js +2 -0
- package/dashboard/dist/assets/{CapabilitiesPage-CPNUJPHs.js.map → CapabilitiesPage-D7USh3F0.js.map} +1 -1
- package/dashboard/dist/assets/{CollapsibleSection-DffGX2tR.js → CollapsibleSection-DfPpAIxa.js} +2 -2
- package/dashboard/dist/assets/{CollapsibleSection-DffGX2tR.js.map → CollapsibleSection-DfPpAIxa.js.map} +1 -1
- package/dashboard/dist/assets/CountdownTimer-DVL7WIcE.js +2 -0
- package/dashboard/dist/assets/CountdownTimer-DVL7WIcE.js.map +1 -0
- package/dashboard/dist/assets/{CredentialsPage-UXnD_Rau.js → CredentialsPage-BHZ5SKIu.js} +2 -2
- package/dashboard/dist/assets/{CredentialsPage-UXnD_Rau.js.map → CredentialsPage-BHZ5SKIu.js.map} +1 -1
- package/dashboard/dist/assets/{CronLabel-CctUYUlI.js → CronLabel-wE8Hms6c.js} +2 -2
- package/dashboard/dist/assets/{CronLabel-CctUYUlI.js.map → CronLabel-wE8Hms6c.js.map} +1 -1
- package/dashboard/dist/assets/{DropZone-7UoXQ4qL.js → DropZone-Pv-v5RAs.js} +2 -2
- package/dashboard/dist/assets/{DropZone-7UoXQ4qL.js.map → DropZone-Pv-v5RAs.js.map} +1 -1
- package/dashboard/dist/assets/{ElapsedCell-C7_Y8xXn.js → ElapsedCell-B4VxKHpw.js} +2 -2
- package/dashboard/dist/assets/{ElapsedCell-C7_Y8xXn.js.map → ElapsedCell-B4VxKHpw.js.map} +1 -1
- package/dashboard/dist/assets/{EntityTimelinePanel-pRu91gZK.js → EntityTimelinePanel-CFbQDHOj.js} +2 -2
- package/dashboard/dist/assets/{EntityTimelinePanel-pRu91gZK.js.map → EntityTimelinePanel-CFbQDHOj.js.map} +1 -1
- package/dashboard/dist/assets/{EscalationListSchemaPage-B3f2mjqg.js → EscalationListSchemaPage-YTgexl4f.js} +2 -2
- package/dashboard/dist/assets/{EscalationListSchemaPage-B3f2mjqg.js.map → EscalationListSchemaPage-YTgexl4f.js.map} +1 -1
- package/dashboard/dist/assets/{EscalationSchemaPage-AJ85FRZy.js → EscalationSchemaPage-Sjk05eHP.js} +2 -2
- package/dashboard/dist/assets/{EscalationSchemaPage-AJ85FRZy.js.map → EscalationSchemaPage-Sjk05eHP.js.map} +1 -1
- package/dashboard/dist/assets/{EscalationsOverview-DMLLWzjS.js → EscalationsOverview-gHWPjUpZ.js} +2 -2
- package/dashboard/dist/assets/{EscalationsOverview-DMLLWzjS.js.map → EscalationsOverview-gHWPjUpZ.js.map} +1 -1
- package/dashboard/dist/assets/{EventTable-BlNuCTN6.js → EventTable-C9lHQ57t.js} +2 -2
- package/dashboard/dist/assets/{EventTable-BlNuCTN6.js.map → EventTable-C9lHQ57t.js.map} +1 -1
- package/dashboard/dist/assets/{FilterBar-B-rkcWkV.js → FilterBar-BY--ANxv.js} +2 -2
- package/dashboard/dist/assets/{FilterBar-B-rkcWkV.js.map → FilterBar-BY--ANxv.js.map} +1 -1
- package/dashboard/dist/assets/{GraphInvokePage-Bkt5tAFo.js → GraphInvokePage-B-Oo5s-W.js} +2 -2
- package/dashboard/dist/assets/{GraphInvokePage-Bkt5tAFo.js.map → GraphInvokePage-B-Oo5s-W.js.map} +1 -1
- package/dashboard/dist/assets/{HomePage-CIE9bCFQ.js → HomePage-BrcjKOaJ.js} +2 -2
- package/dashboard/dist/assets/{HomePage-CIE9bCFQ.js.map → HomePage-BrcjKOaJ.js.map} +1 -1
- package/dashboard/dist/assets/ListToolbar-D5TQ4X_M.js +2 -0
- package/dashboard/dist/assets/{ListToolbar-C_-Utxqm.js.map → ListToolbar-D5TQ4X_M.js.map} +1 -1
- package/dashboard/dist/assets/{McpOverview-c0p171OK.js → McpOverview-jlukVWQ7.js} +2 -2
- package/dashboard/dist/assets/{McpOverview-c0p171OK.js.map → McpOverview-jlukVWQ7.js.map} +1 -1
- package/dashboard/dist/assets/{McpQueryDetailPage-B61I9-dM.js → McpQueryDetailPage-BWKbvJSd.js} +3 -3
- package/dashboard/dist/assets/{McpQueryDetailPage-B61I9-dM.js.map → McpQueryDetailPage-BWKbvJSd.js.map} +1 -1
- package/dashboard/dist/assets/McpQueryPage-BH2Pon4M.js +2 -0
- package/dashboard/dist/assets/{McpQueryPage-Viqi13Fa.js.map → McpQueryPage-BH2Pon4M.js.map} +1 -1
- package/dashboard/dist/assets/{McpRunDetailPage-CiAx_xyV.js → McpRunDetailPage-kUnq2QSO.js} +2 -2
- package/dashboard/dist/assets/{McpRunDetailPage-CiAx_xyV.js.map → McpRunDetailPage-kUnq2QSO.js.map} +1 -1
- package/dashboard/dist/assets/{McpRunsPage-BpfvNRbE.js → McpRunsPage-BTucgt64.js} +2 -2
- package/dashboard/dist/assets/{McpRunsPage-BpfvNRbE.js.map → McpRunsPage-BTucgt64.js.map} +1 -1
- package/dashboard/dist/assets/{NamespacePill-CKp_9EaI.js → NamespacePill-DONj6eUU.js} +2 -2
- package/dashboard/dist/assets/{NamespacePill-CKp_9EaI.js.map → NamespacePill-DONj6eUU.js.map} +1 -1
- package/dashboard/dist/assets/{OperationsPage-DGKwUE6h.js → OperationsPage-Cp8WL-ld.js} +3 -3
- package/dashboard/dist/assets/{OperationsPage-DGKwUE6h.js.map → OperationsPage-Cp8WL-ld.js.map} +1 -1
- package/dashboard/dist/assets/{OperatorDashboard-ha-05tgB.js → OperatorDashboard-wHyeLWzX.js} +2 -2
- package/dashboard/dist/assets/{OperatorDashboard-ha-05tgB.js.map → OperatorDashboard-wHyeLWzX.js.map} +1 -1
- package/dashboard/dist/assets/{PageHeader-CDDpHpdv.js → PageHeader-CFVw67M6.js} +2 -2
- package/dashboard/dist/assets/{PageHeader-CDDpHpdv.js.map → PageHeader-CFVw67M6.js.map} +1 -1
- package/dashboard/dist/assets/{PageHeaderWithStats-DIWH6fRv.js → PageHeaderWithStats-D9tQxILm.js} +2 -2
- package/dashboard/dist/assets/{PageHeaderWithStats-DIWH6fRv.js.map → PageHeaderWithStats-D9tQxILm.js.map} +1 -1
- package/dashboard/dist/assets/{PersonaDetailPage-DMH-D1ns.js → PersonaDetailPage-BXlTqLDK.js} +2 -2
- package/dashboard/dist/assets/{PersonaDetailPage-DMH-D1ns.js.map → PersonaDetailPage-BXlTqLDK.js.map} +1 -1
- package/dashboard/dist/assets/{PersonasPage-YLjCcQcU.js → PersonasPage-DlmdJ3Dm.js} +2 -2
- package/dashboard/dist/assets/{PersonasPage-YLjCcQcU.js.map → PersonasPage-DlmdJ3Dm.js.map} +1 -1
- package/dashboard/dist/assets/{ProcessDetailPage-W5_2FJHn.js → ProcessDetailPage-D88ocvmT.js} +2 -2
- package/dashboard/dist/assets/{ProcessDetailPage-W5_2FJHn.js.map → ProcessDetailPage-D88ocvmT.js.map} +1 -1
- package/dashboard/dist/assets/{ProcessesListPage-5f_2S9ER.js → ProcessesListPage-DpXm-KtK.js} +2 -2
- package/dashboard/dist/assets/{ProcessesListPage-5f_2S9ER.js.map → ProcessesListPage-DpXm-KtK.js.map} +1 -1
- package/dashboard/dist/assets/{RoleDetailPage-CuDTO13n.js → RoleDetailPage-DE2Rj2QE.js} +2 -2
- package/dashboard/dist/assets/{RoleDetailPage-CuDTO13n.js.map → RoleDetailPage-DE2Rj2QE.js.map} +1 -1
- package/dashboard/dist/assets/{RolePill-C0hExOmI.js → RolePill-Di_5hfvw.js} +2 -2
- package/dashboard/dist/assets/{RolePill-C0hExOmI.js.map → RolePill-Di_5hfvw.js.map} +1 -1
- package/dashboard/dist/assets/{RolesPage-McMYumsZ.js → RolesPage-CZSvJlsz.js} +2 -2
- package/dashboard/dist/assets/{RolesPage-McMYumsZ.js.map → RolesPage-CZSvJlsz.js.map} +1 -1
- package/dashboard/dist/assets/{RunAsSelector-CC87e67k.js → RunAsSelector-BawZcqAk.js} +2 -2
- package/dashboard/dist/assets/{RunAsSelector-CC87e67k.js.map → RunAsSelector-BawZcqAk.js.map} +1 -1
- package/dashboard/dist/assets/{ScanCodesPage-Zk6Jorv_.js → ScanCodesPage-DSlpA9kK.js} +2 -2
- package/dashboard/dist/assets/{ScanCodesPage-Zk6Jorv_.js.map → ScanCodesPage-DSlpA9kK.js.map} +1 -1
- package/dashboard/dist/assets/{ScanSchemeDetailPage-B79pya8o.js → ScanSchemeDetailPage-BK4hisGD.js} +2 -2
- package/dashboard/dist/assets/{ScanSchemeDetailPage-B79pya8o.js.map → ScanSchemeDetailPage-BK4hisGD.js.map} +1 -1
- package/dashboard/dist/assets/{ScanStationPage-BLlHMmd_.js → ScanStationPage-D3QjajFD.js} +2 -2
- package/dashboard/dist/assets/{ScanStationPage-BLlHMmd_.js.map → ScanStationPage-D3QjajFD.js.map} +1 -1
- package/dashboard/dist/assets/{ScopeBadge-BBQvz4pj.js → ScopeBadge-CqIIeWjK.js} +2 -2
- package/dashboard/dist/assets/{ScopeBadge-BBQvz4pj.js.map → ScopeBadge-CqIIeWjK.js.map} +1 -1
- package/dashboard/dist/assets/{StickyPagination-CnJgQPU1.js → StickyPagination-BfZwU2NR.js} +2 -2
- package/dashboard/dist/assets/{StickyPagination-CnJgQPU1.js.map → StickyPagination-BfZwU2NR.js.map} +1 -1
- package/dashboard/dist/assets/{StreamMessageDetail-CU5wrqO_.js → StreamMessageDetail-C7zIHX5D.js} +2 -2
- package/dashboard/dist/assets/{StreamMessageDetail-CU5wrqO_.js.map → StreamMessageDetail-C7zIHX5D.js.map} +1 -1
- package/dashboard/dist/assets/{SwimlaneTimeline-D5m-_zgy.js → SwimlaneTimeline-DNSo8AT8.js} +2 -2
- package/dashboard/dist/assets/{SwimlaneTimeline-D5m-_zgy.js.map → SwimlaneTimeline-DNSo8AT8.js.map} +1 -1
- package/dashboard/dist/assets/{TagInput-BXxXs1JD.js → TagInput-BLwxTNsI.js} +2 -2
- package/dashboard/dist/assets/{TagInput-BXxXs1JD.js.map → TagInput-BLwxTNsI.js.map} +1 -1
- package/dashboard/dist/assets/{TaskDetailPage-SvVSH39Q.js → TaskDetailPage-BOJ8pwh3.js} +2 -2
- package/dashboard/dist/assets/{TaskDetailPage-SvVSH39Q.js.map → TaskDetailPage-BOJ8pwh3.js.map} +1 -1
- package/dashboard/dist/assets/{TaskQueuePill-BKGJBVZG.js → TaskQueuePill-DVgcqd-h.js} +2 -2
- package/dashboard/dist/assets/{TaskQueuePill-BKGJBVZG.js.map → TaskQueuePill-DVgcqd-h.js.map} +1 -1
- package/dashboard/dist/assets/{TasksListPage-BtpwvxkS.js → TasksListPage-C4CYqZf8.js} +2 -2
- package/dashboard/dist/assets/{TasksListPage-BtpwvxkS.js.map → TasksListPage-C4CYqZf8.js.map} +1 -1
- package/dashboard/dist/assets/{TimeAgo-BPODA7Dm.js → TimeAgo-JRPi9IEd.js} +2 -2
- package/dashboard/dist/assets/{TimeAgo-BPODA7Dm.js.map → TimeAgo-JRPi9IEd.js.map} +1 -1
- package/dashboard/dist/assets/{TimestampCell-DEQXlxbH.js → TimestampCell-BVYyU-nl.js} +2 -2
- package/dashboard/dist/assets/{TimestampCell-DEQXlxbH.js.map → TimestampCell-BVYyU-nl.js.map} +1 -1
- package/dashboard/dist/assets/{ToolPill-BY6zLSfA.js → ToolPill-C6hkOqPx.js} +2 -2
- package/dashboard/dist/assets/{ToolPill-BY6zLSfA.js.map → ToolPill-C6hkOqPx.js.map} +1 -1
- package/dashboard/dist/assets/{ToolTestPanel-Ztc0pRSh.js → ToolTestPanel-IGrd44Au.js} +2 -2
- package/dashboard/dist/assets/{ToolTestPanel-Ztc0pRSh.js.map → ToolTestPanel-IGrd44Au.js.map} +1 -1
- package/dashboard/dist/assets/{TopicDetailPage-BmpEqg-Q.js → TopicDetailPage-DhianNey.js} +3 -3
- package/dashboard/dist/assets/{TopicDetailPage-BmpEqg-Q.js.map → TopicDetailPage-DhianNey.js.map} +1 -1
- package/dashboard/dist/assets/{TopicsPage-BVW5y6vE.js → TopicsPage-Glhqz_Nv.js} +2 -2
- package/dashboard/dist/assets/{TopicsPage-BVW5y6vE.js.map → TopicsPage-Glhqz_Nv.js.map} +1 -1
- package/dashboard/dist/assets/{UserName-D915g7ba.js → UserName-CD9OqhNI.js} +2 -2
- package/dashboard/dist/assets/{UserName-D915g7ba.js.map → UserName-CD9OqhNI.js.map} +1 -1
- package/dashboard/dist/assets/{WorkflowExecutionPage-CIl9ESgk.js → WorkflowExecutionPage-8Q2438Ry.js} +2 -2
- package/dashboard/dist/assets/{WorkflowExecutionPage-CIl9ESgk.js.map → WorkflowExecutionPage-8Q2438Ry.js.map} +1 -1
- package/dashboard/dist/assets/{WorkflowPill-qp5UF3-y.js → WorkflowPill-CN-952iI.js} +2 -2
- package/dashboard/dist/assets/{WorkflowPill-qp5UF3-y.js.map → WorkflowPill-CN-952iI.js.map} +1 -1
- package/dashboard/dist/assets/{WorkflowsDashboard-DtkaGgdZ.js → WorkflowsDashboard-CkAoYT86.js} +2 -2
- package/dashboard/dist/assets/{WorkflowsDashboard-DtkaGgdZ.js.map → WorkflowsDashboard-CkAoYT86.js.map} +1 -1
- package/dashboard/dist/assets/{WorkflowsOverview-DANXhmXb.js → WorkflowsOverview-Zh_EidMp.js} +2 -2
- package/dashboard/dist/assets/{WorkflowsOverview-DANXhmXb.js.map → WorkflowsOverview-Zh_EidMp.js.map} +1 -1
- package/dashboard/dist/assets/{YamlWorkflowDetailPage-m6Ub7qtE.js → YamlWorkflowDetailPage-BKJbFT8C.js} +2 -2
- package/dashboard/dist/assets/{YamlWorkflowDetailPage-m6Ub7qtE.js.map → YamlWorkflowDetailPage-BKJbFT8C.js.map} +1 -1
- package/dashboard/dist/assets/{YamlWorkflowsPage-5MOsxbLW.js → YamlWorkflowsPage-DK1z6iFt.js} +2 -2
- package/dashboard/dist/assets/{YamlWorkflowsPage-5MOsxbLW.js.map → YamlWorkflowsPage-DK1z6iFt.js.map} +1 -1
- package/dashboard/dist/assets/{agents-DacpnIqz.js → agents-BEASyYpg.js} +2 -2
- package/dashboard/dist/assets/{agents-DacpnIqz.js.map → agents-BEASyYpg.js.map} +1 -1
- package/dashboard/dist/assets/{bots-El47Xy5a.js → bots-CaXqSHat.js} +2 -2
- package/dashboard/dist/assets/{bots-El47Xy5a.js.map → bots-CaXqSHat.js.map} +1 -1
- package/dashboard/dist/assets/{capabilities-DGC__Aob.js → capabilities-Cijq-qev.js} +2 -2
- package/dashboard/dist/assets/{capabilities-DGC__Aob.js.map → capabilities-Cijq-qev.js.map} +1 -1
- package/dashboard/dist/assets/{controlplane-Bzx-qd8m.js → controlplane-HGuRC7AW.js} +2 -2
- package/dashboard/dist/assets/{controlplane-Bzx-qd8m.js.map → controlplane-HGuRC7AW.js.map} +1 -1
- package/dashboard/dist/assets/{escalation-columns-BmY7BriY.js → escalation-columns-BLVz8XCP.js} +2 -2
- package/dashboard/dist/assets/{escalation-columns-BmY7BriY.js.map → escalation-columns-BLVz8XCP.js.map} +1 -1
- package/dashboard/dist/assets/index-BJDAXUzO.js +2 -0
- package/dashboard/dist/assets/index-BJDAXUzO.js.map +1 -0
- package/dashboard/dist/assets/{index-CoIh4ipz.js → index-CEIp6WWg.js} +2 -2
- package/dashboard/dist/assets/{index-CoIh4ipz.js.map → index-CEIp6WWg.js.map} +1 -1
- package/dashboard/dist/assets/index-CK_ohh6Q.js +3 -0
- package/dashboard/dist/assets/index-CK_ohh6Q.js.map +1 -0
- package/dashboard/dist/assets/{index-Ce6ghhpn.js → index-CLQ0HBHR.js} +2 -2
- package/dashboard/dist/assets/{index-Ce6ghhpn.js.map → index-CLQ0HBHR.js.map} +1 -1
- package/dashboard/dist/assets/{index-Cfw6FARc.js → index-Cg0vCZng.js} +2 -2
- package/dashboard/dist/assets/{index-Cfw6FARc.js.map → index-Cg0vCZng.js.map} +1 -1
- package/dashboard/dist/assets/{index-SU2xrnBD.js → index-CgXVDPW-.js} +31 -31
- package/dashboard/dist/assets/index-CgXVDPW-.js.map +1 -0
- package/dashboard/dist/assets/index-ClY0ihQ5.js +2 -0
- package/dashboard/dist/assets/{index-DH_xm9UQ.js.map → index-ClY0ihQ5.js.map} +1 -1
- package/dashboard/dist/assets/{index-ZtpEajtq.js → index-D2OU2MJb.js} +2 -2
- package/dashboard/dist/assets/{index-ZtpEajtq.js.map → index-D2OU2MJb.js.map} +1 -1
- package/dashboard/dist/assets/{index-CHwg51qz.js → index-IkgBE7e_.js} +2 -2
- package/dashboard/dist/assets/{index-CHwg51qz.js.map → index-IkgBE7e_.js.map} +1 -1
- package/dashboard/dist/assets/{index-BPK2cB4Q.js → index-Xi3LO4Ye.js} +4 -4
- package/dashboard/dist/assets/{index-BPK2cB4Q.js.map → index-Xi3LO4Ye.js.map} +1 -1
- package/dashboard/dist/assets/{index-DpsVlk5z.js → index-YMd3ZiPd.js} +2 -2
- package/dashboard/dist/assets/{index-DpsVlk5z.js.map → index-YMd3ZiPd.js.map} +1 -1
- package/dashboard/dist/assets/{index-Bwlnpbpd.js → index-t1JXcmBG.js} +2 -2
- package/dashboard/dist/assets/{index-Bwlnpbpd.js.map → index-t1JXcmBG.js.map} +1 -1
- package/dashboard/dist/assets/{index-DYz57kr_.js → index-tCDjx1kF.js} +2 -2
- package/dashboard/dist/assets/{index-DYz57kr_.js.map → index-tCDjx1kF.js.map} +1 -1
- package/dashboard/dist/assets/knowledge-DpaUJtVW.js +2 -0
- package/dashboard/dist/assets/knowledge-DpaUJtVW.js.map +1 -0
- package/dashboard/dist/assets/{mcp-BEqxxlW9.js → mcp-BkkLq6OE.js} +2 -2
- package/dashboard/dist/assets/{mcp-BEqxxlW9.js.map → mcp-BkkLq6OE.js.map} +1 -1
- package/dashboard/dist/assets/{mcp-query-qXTlQfc_.js → mcp-query-DeXu3La5.js} +2 -2
- package/dashboard/dist/assets/{mcp-query-qXTlQfc_.js.map → mcp-query-DeXu3La5.js.map} +1 -1
- package/dashboard/dist/assets/{personas-jJEDmBtg.js → personas-BRbKVVko.js} +2 -2
- package/dashboard/dist/assets/{personas-jJEDmBtg.js.map → personas-BRbKVVko.js.map} +1 -1
- package/dashboard/dist/assets/{pipelines-BNPJh69x.js → pipelines-B7xo92sK.js} +2 -2
- package/dashboard/dist/assets/{pipelines-BNPJh69x.js.map → pipelines-B7xo92sK.js.map} +1 -1
- package/dashboard/dist/assets/{tasks-DhD71qXJ.js → tasks-BGyqM1Ho.js} +2 -2
- package/dashboard/dist/assets/{tasks-DhD71qXJ.js.map → tasks-BGyqM1Ho.js.map} +1 -1
- package/dashboard/dist/assets/{topics-CrXwwuW-.js → topics-I81rKc75.js} +2 -2
- package/dashboard/dist/assets/{topics-CrXwwuW-.js.map → topics-I81rKc75.js.map} +1 -1
- package/dashboard/dist/assets/{useEventHooks-DL7R0ASv.js → useEventHooks-CjV3uNxt.js} +2 -2
- package/dashboard/dist/assets/{useEventHooks-DL7R0ASv.js.map → useEventHooks-CjV3uNxt.js.map} +1 -1
- package/dashboard/dist/assets/{useNamespace-ETqzJakA.js → useNamespace-B-HMdRka.js} +2 -2
- package/dashboard/dist/assets/{useNamespace-ETqzJakA.js.map → useNamespace-B-HMdRka.js.map} +1 -1
- package/dashboard/dist/assets/{useYamlActivityEvents-SqY67S-F.js → useYamlActivityEvents-CNsAlsgz.js} +2 -2
- package/dashboard/dist/assets/{useYamlActivityEvents-SqY67S-F.js.map → useYamlActivityEvents-CNsAlsgz.js.map} +1 -1
- package/dashboard/dist/assets/{users-DF8dTbOo.js → users-DiTqBepm.js} +2 -2
- package/dashboard/dist/assets/{users-DF8dTbOo.js.map → users-DiTqBepm.js.map} +1 -1
- package/dashboard/dist/assets/{vendor-icons-BgsXTN4h.js → vendor-icons-h-jlRSb9.js} +141 -146
- package/dashboard/dist/assets/vendor-icons-h-jlRSb9.js.map +1 -0
- package/dashboard/dist/assets/{workflows-Bdke7fzx.js → workflows-TA0p_3B8.js} +2 -2
- package/dashboard/dist/assets/{workflows-Bdke7fzx.js.map → workflows-TA0p_3B8.js.map} +1 -1
- package/dashboard/dist/assets/{yaml-workflows-UMxHYunb.js → yaml-workflows-DN9-DBnQ.js} +2 -2
- package/dashboard/dist/assets/{yaml-workflows-UMxHYunb.js.map → yaml-workflows-DN9-DBnQ.js.map} +1 -1
- package/dashboard/dist/index.html +2 -2
- package/docs/api/http/escalations.md +31 -8
- package/docs/api/http/knowledge.md +24 -2
- package/docs/api/http/roles.md +1 -1
- package/docs/api/mcp/admin.md +1 -1
- package/docs/api/mcp/human-queue.md +14 -0
- package/docs/api/mcp/knowledge.md +17 -1
- package/docs/api/sdk/escalations.md +38 -15
- package/docs/api/sdk/knowledge.md +27 -0
- package/docs/api/sdk/roles.md +1 -1
- package/docs/compilation.md +1 -1
- package/docs/compiler.md +2 -2
- package/docs/dashboard.md +1 -1
- package/docs/data.md +3 -3
- package/docs/hitl/escalation.md +14 -12
- package/docs/hitl/iframe.md +2 -2
- package/docs/hitl/lookups.md +134 -0
- package/docs/hitl/resolution.md +4 -4
- package/docs/hitl/roles.md +4 -4
- package/docs/hitl/x-lt-show-if.md +1 -1
- package/docs/hitl/x-lt-transition.md +2 -2
- package/docs/hitl/x-lt-validation.md +2 -1
- package/docs/hitl/x-lt-widget.md +2 -2
- package/docs/hitl-guide.md +6 -3
- package/docs/story.md +1 -1
- package/package.json +1 -1
- package/dashboard/dist/assets/AgentConfigPage-lmUOwyHO.js.map +0 -1
- package/dashboard/dist/assets/AgentDetailPage-C_xAw6aF.js.map +0 -1
- package/dashboard/dist/assets/AvailableEscalationsPage-BvQdHMl2.js +0 -2
- package/dashboard/dist/assets/CapabilitiesPage-CPNUJPHs.js +0 -2
- package/dashboard/dist/assets/CountdownTimer-Bb_VuJc8.js +0 -2
- package/dashboard/dist/assets/CountdownTimer-Bb_VuJc8.js.map +0 -1
- package/dashboard/dist/assets/ListToolbar-C_-Utxqm.js +0 -2
- package/dashboard/dist/assets/McpQueryPage-Viqi13Fa.js +0 -2
- package/dashboard/dist/assets/index-B4ZNPgcz.js +0 -2
- package/dashboard/dist/assets/index-B4ZNPgcz.js.map +0 -1
- package/dashboard/dist/assets/index-Cqc7Wu5Y.js +0 -3
- package/dashboard/dist/assets/index-Cqc7Wu5Y.js.map +0 -1
- package/dashboard/dist/assets/index-DH_xm9UQ.js +0 -2
- package/dashboard/dist/assets/index-SU2xrnBD.js.map +0 -1
- package/dashboard/dist/assets/knowledge-k-5jr2BN.js +0 -2
- package/dashboard/dist/assets/knowledge-k-5jr2BN.js.map +0 -1
- package/dashboard/dist/assets/vendor-icons-BgsXTN4h.js.map +0 -1
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
# Versioned Knowledge Lookups
|
|
2
|
+
|
|
3
|
+
An escalation can pin **versioned knowledge lookups** — enumerated lists (select options, checklist items, cascade maps) that live once in the knowledge store and are referenced by thousands of rows. The refs ride the escalation; the content does not. Forms address the resolved content through the `lookup.*` context domain, so the full x-lt vocabulary works against it: `x-lt-options`, `x-lt-source`, `x-lt-showIf`, `x-lt-help`.
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## The Ref
|
|
8
|
+
|
|
9
|
+
```json
|
|
10
|
+
{ "domain": "catalog", "key": "materials", "version": 2, "as": "materials" }
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
| Field | Required | Meaning |
|
|
14
|
+
|-------|----------|---------|
|
|
15
|
+
| `domain` | yes | Knowledge domain |
|
|
16
|
+
| `key` | yes | Entry key within the domain |
|
|
17
|
+
| `version` | yes | The immutable edition this escalation reads |
|
|
18
|
+
| `as` | no | The ref's form-context address, when the key alone is ambiguous |
|
|
19
|
+
|
|
20
|
+
`version` is required by design. A ref names an **immutable edition**, never a moving target: every escalation created against edition 2 renders edition 2 forever, however the entry evolves afterward. Refs live under the reserved `envelope.lookups` key — the unindexed, render-only bag beside `formDefaults`. They ride the engine's atomic write but never touch the GIN-indexed metadata surface: refs are form plumbing, not facets.
|
|
21
|
+
|
|
22
|
+
## Creating an Escalation with Lookups
|
|
23
|
+
|
|
24
|
+
Pass `lookups` to `conditional` — the same compile-time-literal discipline as `schemaVersion`:
|
|
25
|
+
|
|
26
|
+
```typescript
|
|
27
|
+
const decision = await conditional<CascadeResolverV1>(signalId, {
|
|
28
|
+
role: 'catalog-picker',
|
|
29
|
+
description: 'Pick a material for this order',
|
|
30
|
+
lookups: [
|
|
31
|
+
{ domain: 'catalog', key: 'materials', version: 2 },
|
|
32
|
+
{ domain: 'catalog', key: 'geo', version: 1 },
|
|
33
|
+
],
|
|
34
|
+
schemaVersion: 1,
|
|
35
|
+
});
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
The refs fold into `envelope.lookups` as a pure transform — a pinned wait costs exactly what an unpinned one does. A malformed ref (missing field, non-integer version) throws before the row is written; over the HTTP create surface the same validation answers with a 400.
|
|
39
|
+
|
|
40
|
+
## Versioning
|
|
41
|
+
|
|
42
|
+
Every knowledge entry carries a `current_version`, and every write that changes its data mints an immutable snapshot automatically — no publish step:
|
|
43
|
+
|
|
44
|
+
1. **Add items** — write the entry (`storeEntry`, `set_knowledge_field`, the dashboard editor). The data change bumps `current_version` and snapshots the new edition. Writes that leave the data unchanged mint nothing.
|
|
45
|
+
2. **Repin** — update the workflow's `lookups` literal to the new version, evolving the resolver payload type alongside when the new items change what the form can answer.
|
|
46
|
+
3. **Rows in flight keep their edition** — an escalation pinned to v1 renders v1's list even after v5 exists.
|
|
47
|
+
|
|
48
|
+
Inspect the lineage with `GET /api/knowledge/entry/versions?domain=catalog&key=materials`, `ltc kb versions catalog materials`, or the `list_knowledge_versions` MCP tool. Fetch a specific edition with `?version=N` on the entry endpoint.
|
|
49
|
+
|
|
50
|
+
## The Grant
|
|
51
|
+
|
|
52
|
+
The refs on the row ARE the grant. Any user who may read the escalation may fetch exactly the pinned editions it names:
|
|
53
|
+
|
|
54
|
+
```
|
|
55
|
+
GET /api/escalations/:id/lookups
|
|
56
|
+
→ { "lookups": [{ "domain": "catalog", "key": "materials", "version": 2, "data": { "items": [...] } }] }
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
The general knowledge API (`/api/knowledge/*`) is a builder surface — superadmin or engineer. A member never queries the knowledge store directly; the escalation-scoped endpoint serves them precisely the editions their work item carries, and nothing else. A ref whose snapshot does not exist answers with `missing: true` for that ref — the batch never fails.
|
|
60
|
+
|
|
61
|
+
## Form Addressing
|
|
62
|
+
|
|
63
|
+
The resolved refs form the `lookup` context domain, keyed by each ref's `as` (or its `key`):
|
|
64
|
+
|
|
65
|
+
```json
|
|
66
|
+
{
|
|
67
|
+
"properties": {
|
|
68
|
+
"material": {
|
|
69
|
+
"type": "string",
|
|
70
|
+
"x-lt-options": "lookup.materials.items"
|
|
71
|
+
},
|
|
72
|
+
"checks": {
|
|
73
|
+
"type": "object",
|
|
74
|
+
"x-lt-widget": "checklist",
|
|
75
|
+
"x-lt-source": "lookup.checks.items",
|
|
76
|
+
"x-lt-require-all": true
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
The entry's `data` is addressed directly — a flat option list lives at `data.items`, so the token reads `lookup.<name>.items`. Everything the context domains offer works here: `x-lt-showIf` conditions, `{{lookup.materials.items}}` in `x-lt-help`, dynamic bounds.
|
|
83
|
+
|
|
84
|
+
Membership is enforced on both sides of the wire: the dashboard constrains the choices, and an `enforce_schema` role's server gate re-resolves the same pinned editions and rejects an out-of-edition value with the canonical 422.
|
|
85
|
+
|
|
86
|
+
## Cascading Selects
|
|
87
|
+
|
|
88
|
+
An option path may embed `{{domain.path}}` interpolation segments — the same grammar as `x-lt-help` tokens — so one answer drives the next field's legal set:
|
|
89
|
+
|
|
90
|
+
```json
|
|
91
|
+
{
|
|
92
|
+
"properties": {
|
|
93
|
+
"country": { "type": "string", "x-lt-options": "lookup.geo.countries" },
|
|
94
|
+
"region": { "type": "string", "x-lt-options": "lookup.geo.regions.{{resolver.country}}" }
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
With a `catalog/geo` entry shaped as:
|
|
100
|
+
|
|
101
|
+
```json
|
|
102
|
+
{
|
|
103
|
+
"countries": ["US", "EU"],
|
|
104
|
+
"regions": {
|
|
105
|
+
"US": ["CA", "NY", "TX"],
|
|
106
|
+
"EU": ["DE", "FR", "ES"]
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
- **Region renders disabled** (an empty select on the explicit **Choose…** placeholder) until Country carries an answer.
|
|
112
|
+
- **Choosing a country enables and populates Region** with exactly that country's list — the path re-resolves against the live form on every edit.
|
|
113
|
+
- **Changing the country resets the presentation**: a previously chosen region that is no longer legal shows the placeholder again, and the stale value fails the membership pass on submit — client-side in the error panel, server-side as the 422 for enforcing roles.
|
|
114
|
+
- Chains extend naturally: C can interpolate B the same way B interpolates A, walking one nested map or several refs.
|
|
115
|
+
|
|
116
|
+
Interpolation works in `x-lt-source` the same way, so checklist item sets can follow an answer too.
|
|
117
|
+
|
|
118
|
+
## Efficiency
|
|
119
|
+
|
|
120
|
+
- **Refs, not content, ride the rows.** Thousands of escalations sharing one list each store a three-field ref; the list lives once per edition.
|
|
121
|
+
- **One fetch per page.** The resolve UI batch-fetches all refs in a single `GET /:id/lookups` call at load. Pinned editions are immutable, so the response caches for the whole session.
|
|
122
|
+
- **Zero network during execution.** Cascade levels resolve locally from the already-fetched entry data — every keystroke re-resolves in memory.
|
|
123
|
+
- **Server-side, snapshots cache indefinitely.** Enforcement reads come from an in-process LRU keyed by `(domain, key, version)`; the first row referencing an edition pays the read, every later row hits memory.
|
|
124
|
+
|
|
125
|
+
## Reference Example
|
|
126
|
+
|
|
127
|
+
`examples/workflows/lookup-cascade/` is the canonical reference:
|
|
128
|
+
|
|
129
|
+
- `material` — select from the pinned `catalog/materials` edition; the seed mints v1 (three items) then v2 (five), and seeds one escalation pinned to each, so both editions render side by side from ONE role form
|
|
130
|
+
- `country` → `region` — the cascade pair over `catalog/geo`
|
|
131
|
+
- `checks` — checklist sourced from `catalog/checks` with `x-lt-require-all`
|
|
132
|
+
- the `catalog-picker` role sets `enforce_schema: true`, so out-of-edition submissions reject server-side
|
|
133
|
+
|
|
134
|
+
Invoke `lookupCascade` with `{ "data": { "materials_version": 1 } }` (or `2`) to pin either edition per run.
|
package/docs/hitl/resolution.md
CHANGED
|
@@ -120,8 +120,8 @@ Cancellation is terminal — a cancelled escalation cannot be re-opened.
|
|
|
120
120
|
|
|
121
121
|
### When cancellation happens
|
|
122
122
|
|
|
123
|
-
- **Workflow termination** — `POST /api/workflows/:workflowId/terminate` automatically cancels any pending escalations tied to it. The waiting `
|
|
124
|
-
- **Explicit cancel** — cancel a single escalation via the API or from the dashboard. Any workflow waiting on that escalation via `
|
|
123
|
+
- **Workflow termination** — `POST /api/workflows/:workflowId/terminate` automatically cancels any pending escalations tied to it. The waiting `conditional` call returns `null`.
|
|
124
|
+
- **Explicit cancel** — cancel a single escalation via the API or from the dashboard. Any workflow waiting on that escalation via `conditional` receives `null`.
|
|
125
125
|
|
|
126
126
|
### API
|
|
127
127
|
|
|
@@ -139,10 +139,10 @@ Returns 409 if the escalation is already resolved or cancelled.
|
|
|
139
139
|
|
|
140
140
|
### Handling cancellation in workflows
|
|
141
141
|
|
|
142
|
-
`
|
|
142
|
+
`conditional` returns `T | false | null`. Always guard before accessing the payload:
|
|
143
143
|
|
|
144
144
|
```typescript
|
|
145
|
-
const decision = await
|
|
145
|
+
const decision = await conditional<{ approved: boolean }>(signalId, escalationConfig);
|
|
146
146
|
|
|
147
147
|
if (decision === null) {
|
|
148
148
|
// Escalation was cancelled
|
package/docs/hitl/roles.md
CHANGED
|
@@ -2,10 +2,10 @@
|
|
|
2
2
|
|
|
3
3
|
## Role-Based Routing
|
|
4
4
|
|
|
5
|
-
Escalations are routed by role, and any member of the role can handle them — a person working the queue in the dashboard, or a service account claiming and resolving through the API or MCP tools. Members only see escalations for roles they hold. Set `role` on every `
|
|
5
|
+
Escalations are routed by role, and any member of the role can handle them — a person working the queue in the dashboard, or a service account claiming and resolving through the API or MCP tools. Members only see escalations for roles they hold. Set `role` on every `conditional` config to name the target queue:
|
|
6
6
|
|
|
7
7
|
```typescript
|
|
8
|
-
const decision = await
|
|
8
|
+
const decision = await conditional<{ approved: boolean }>(signalId, {
|
|
9
9
|
role: 'finance-reviewer', // only users with this role see it
|
|
10
10
|
description: `Approve spend of $${amount}`,
|
|
11
11
|
// ...
|
|
@@ -25,7 +25,7 @@ A `member` of a role carries a work-surface scope that narrows what they see and
|
|
|
25
25
|
|
|
26
26
|
`self` means escalations assigned to that member (`assigned_to = user`); `all` means the whole role queue. `admin` and `superadmin` always work the whole queue.
|
|
27
27
|
|
|
28
|
-
Scope is a property of the **membership** (`lt_user_roles`), not of the escalation row. The escalation engine is unchanged — `
|
|
28
|
+
Scope is a property of the **membership** (`lt_user_roles`), not of the escalation row. The escalation engine is unchanged — `conditional` and `ltCreateEscalation` write rows exactly as before. Scope is resolved at read time when a user lists or acts on the queue.
|
|
29
29
|
|
|
30
30
|
See the [Roles API](../api/http/roles.md#work-surface-scope) for the five member profiles and the assignment contract.
|
|
31
31
|
|
|
@@ -36,7 +36,7 @@ See the [Roles API](../api/http/roles.md#work-surface-scope) for the five member
|
|
|
36
36
|
To route a single item to a named person, assign the escalation to them and provision them with `read_scope=self` + `write_scope=self`. The workflow sets `assigned_to` to the person's user ID when it creates the escalation, then provisions or updates that user as a `member` with self/self scope on the target role. They land directly on that one item — a just-in-time form scoped by RBAC — with no access to the rest of the queue.
|
|
37
37
|
|
|
38
38
|
```typescript
|
|
39
|
-
const decision = await
|
|
39
|
+
const decision = await conditional<{ confirmed: boolean; address: string }>(signalId, {
|
|
40
40
|
role: 'customer-triage',
|
|
41
41
|
assigned_to: userId, // pre-claim
|
|
42
42
|
description: 'Confirm your shipping address',
|
|
@@ -94,7 +94,7 @@ A queue that receives both regular items and a special signal type. The payload
|
|
|
94
94
|
In the workflow, guard the payload fields before accessing them:
|
|
95
95
|
|
|
96
96
|
```typescript
|
|
97
|
-
const decision = await
|
|
97
|
+
const decision = await conditional<{
|
|
98
98
|
approved: boolean;
|
|
99
99
|
rejection_reason?: string;
|
|
100
100
|
notes?: string;
|
|
@@ -35,13 +35,13 @@ commit, using the HotMesh `condition({ assignee, durationMinutes, parentId })`
|
|
|
35
35
|
primitive:
|
|
36
36
|
|
|
37
37
|
```ts
|
|
38
|
-
const step1 = await
|
|
38
|
+
const step1 = await conditional<Step1 & { $resolution?: EscalationResolution }>(sig1, {
|
|
39
39
|
role: STEP1_ROLE, /* … */ schemaVersion: 1,
|
|
40
40
|
});
|
|
41
41
|
const owner = step1.$resolution?.resolvedBy; // who resolved step 1
|
|
42
42
|
const parent = step1.$resolution?.escalationId; // step 1's id — the correlation key
|
|
43
43
|
|
|
44
|
-
await
|
|
44
|
+
await conditional<Step2>(sig2, {
|
|
45
45
|
role: STEP2_ROLE,
|
|
46
46
|
assignee: owner, // born assigned — no create-then-claim race
|
|
47
47
|
durationMinutes: 30, // a hard claim, so it stays with the owner
|
|
@@ -120,6 +120,7 @@ When the envelope carries `left_quantity_options: [0, 1, 2, 3]`, the field rende
|
|
|
120
120
|
- While the current value is outside the option list (an empty init, options that shrank per-row), the select opens on an explicit disabled **Choose…** placeholder — never an implicit first option.
|
|
121
121
|
- A path that resolves to nothing (missing, empty array, no scalar entries) yields no options: the field renders as the plain input for its type and membership is not enforced for that submission.
|
|
122
122
|
- Membership is enforced on both sides of the wire: the dashboard constrains the choices, and an enforced role's server gate rejects a payload whose value is outside the row's resolved list with the canonical 422 (`Must be one of: 0, 1, 2, 3`).
|
|
123
|
+
- Option lists can also come from version-pinned knowledge entries (the `lookup` domain), and paths may embed `{{domain.path}}` interpolation segments for cascading selects — a dependent select whose parent is unanswered renders disabled and fails closed. See [lookups.md](lookups.md).
|
|
123
124
|
|
|
124
125
|
---
|
|
125
126
|
|
|
@@ -230,7 +231,7 @@ The path is dot-separated, with optional `[n]` array indices. A missing or non-n
|
|
|
230
231
|
**Workflow side — passing the bound in the envelope:**
|
|
231
232
|
|
|
232
233
|
```typescript
|
|
233
|
-
const decision = await
|
|
234
|
+
const decision = await conditional<{ score: number; notes: string }>(signalId, {
|
|
234
235
|
role: 'quality-reviewer',
|
|
235
236
|
envelope: {
|
|
236
237
|
min_score: 60,
|
package/docs/hitl/x-lt-widget.md
CHANGED
|
@@ -144,7 +144,7 @@ The field type must be `"object"`. The submitted value is `Record<string, boolea
|
|
|
144
144
|
|
|
145
145
|
`x-lt-source` uses the `"domain.path"` convention (same as `x-lt-showIf` and `x-lt-help` tokens). The renderer expects an array of `{ id: string; label: string; required?: boolean }` objects at that path.
|
|
146
146
|
|
|
147
|
-
- `"envelope"` — for item definitions that are render data only (no query cost). The workflow puts them in `
|
|
147
|
+
- `"envelope"` — for item definitions that are render data only (no query cost). The workflow puts them in `conditional`'s `envelope` parameter.
|
|
148
148
|
- `"metadata"` — only when items need to be GIN-indexed and searchable as facets. Adds index cost.
|
|
149
149
|
|
|
150
150
|
### Geometry (`x-lt-variant`)
|
|
@@ -191,7 +191,7 @@ const checklistItems = [
|
|
|
191
191
|
{ id: 'photos', label: 'Before/after photos are present', required: false },
|
|
192
192
|
];
|
|
193
193
|
|
|
194
|
-
const decision = await
|
|
194
|
+
const decision = await conditional<{ checks: Record<string, boolean> }>(signalId, {
|
|
195
195
|
role: 'checklist-operator',
|
|
196
196
|
envelope: {
|
|
197
197
|
checklist_items: checklistItems,
|
package/docs/hitl-guide.md
CHANGED
|
@@ -16,6 +16,7 @@ This works because the form is data: a JSON Schema stored on the role, versioned
|
|
|
16
16
|
|----------|-----|-----|
|
|
17
17
|
| Typed fields, formats, required | Plain JSON Schema | [form.md](hitl/form.md) |
|
|
18
18
|
| Input guards (bounds, patterns, dynamic limits) | Validation keywords | [x-lt-validation.md](hitl/x-lt-validation.md) |
|
|
19
|
+
| Option lists shared by thousands of rows, cascading selects | Versioned lookups | [lookups.md](hitl/lookups.md) |
|
|
19
20
|
| Fields that appear based on another answer | `x-lt-showIf` | [x-lt-show-if.md](hitl/x-lt-show-if.md) |
|
|
20
21
|
| Sections, columns, ordering, side-panel help | Layout keywords | [x-lt-layout.md](hitl/x-lt-layout.md) |
|
|
21
22
|
| Runtime-driven items, files, signatures, SOP blocks | Widgets | [x-lt-widget.md](hitl/x-lt-widget.md) |
|
|
@@ -65,6 +66,7 @@ When you author a HITL-backed workflow, the platform handles:
|
|
|
65
66
|
- **AI triage** — optional auto-resolution for common patterns
|
|
66
67
|
- **Credential security** — password fields use ephemeral tokens, never stored in plain text
|
|
67
68
|
- **Schema enforcement** — roles with `enforce_schema` validate every resolver payload server-side (dashboard, API, MCP, CLI alike) with the same pass the form runs, rejecting violations as a structured 422 (see [schema-enforcement.md](schema-enforcement.md))
|
|
69
|
+
- **Versioned lookups** — escalations pin immutable knowledge editions for their option lists; the refs grant readers exactly those editions, and cascading selects resolve locally from one batch fetch (see [lookups.md](hitl/lookups.md))
|
|
68
70
|
- **Telemetry** — trace IDs link escalations to OpenTelemetry traces
|
|
69
71
|
- **Bulk operations** — bulk claim, assign, triage, and cancel for queue management
|
|
70
72
|
- **Cancellation** — cancel pending escalations from the API or dashboard
|
|
@@ -79,7 +81,8 @@ Ordered as a learning path — each file adds one capability to the same form:
|
|
|
79
81
|
|
|
80
82
|
| Topic | File |
|
|
81
83
|
|-------|------|
|
|
82
|
-
| Creating escalations with `
|
|
84
|
+
| Creating escalations with `conditional`, schema versioning | [escalation.md](hitl/escalation.md) |
|
|
85
|
+
| Versioned knowledge lookups, the `lookup.*` domain, cascading selects | [lookups.md](hitl/lookups.md) |
|
|
83
86
|
| Field types, formats, required, read-only | [form.md](hitl/form.md) |
|
|
84
87
|
| Pre-submission validation guards (min, max, pattern, dynamic bounds) | [x-lt-validation.md](hitl/x-lt-validation.md) |
|
|
85
88
|
| Conditional visibility (`x-lt-showIf`, `x-lt-hide-if-empty`) | [x-lt-show-if.md](hitl/x-lt-show-if.md) |
|
|
@@ -101,7 +104,7 @@ Ordered as a learning path — each file adds one capability to the same form:
|
|
|
101
104
|
| Keyword | Level | Purpose |
|
|
102
105
|
|---------|-------|---------|
|
|
103
106
|
| `x-lt-widget` | field | Rich control: `file-upload`, `code-editor`, `signature`, `rich-text`, `markdown`, `checklist`, `attachment` (alias `image`) |
|
|
104
|
-
| `x-lt-source` | field | Data path for context-driven widgets: `"domain.path"` |
|
|
107
|
+
| `x-lt-source` | field | Data path for context-driven widgets: `"domain.path"`; may embed `{{domain.path}}` interpolation segments |
|
|
105
108
|
| `x-lt-require-all` | field | Checklist completion guard — every item must be checked, except items declared `required: false` |
|
|
106
109
|
| `x-lt-require-any` | schema | At-least-one guard — each `string[]` group needs a value in one visible member; `0`/`false` count as answers |
|
|
107
110
|
| `x-lt-require-sum` | schema | Quantity-group guard — the numeric values of `{ fields, minimum? }` must total at least `minimum` (default 1) |
|
|
@@ -112,7 +115,7 @@ Ordered as a learning path — each file adds one capability to the same form:
|
|
|
112
115
|
| `x-lt-showIf` | field | Show field when a value is truthy at `domain.path`; prefix `!` to invert; `=VALUE` / `!=VALUE` compare the string form |
|
|
113
116
|
| `x-lt-hide-if-empty` | field | `true` — suppress the field when its value is null, `""`, `false`, or `0` |
|
|
114
117
|
| `x-lt-section` | field | Section group label |
|
|
115
|
-
| `x-lt-options` | field | Dynamic select options — resolves a `"domain.path"` to the field's option list; static `enum` wins |
|
|
118
|
+
| `x-lt-options` | field | Dynamic select options — resolves a `"domain.path"` to the field's option list; static `enum` wins; `{{domain.path}}` segments make cascading selects |
|
|
116
119
|
| `x-lt-minimum` | field | Dynamic lower bound — resolves a `"domain.path"` from the escalation context |
|
|
117
120
|
| `x-lt-maximum` | field | Dynamic upper bound — resolves a `"domain.path"` from the escalation context |
|
|
118
121
|
| `x-lt-min-length` | field | Dynamic minimum string length — resolves a `"domain.path"` |
|
package/docs/story.md
CHANGED
|
@@ -120,7 +120,7 @@ Each capability shows who uses it: which agents, which pipelines, which workflow
|
|
|
120
120
|
|
|
121
121
|
The orchestration backstage — the same durable workflow, offered two ways:
|
|
122
122
|
|
|
123
|
-
- **Procedural** — readable,
|
|
123
|
+
- **Procedural** — readable, durable TypeScript. Configure it, invoke it, watch its executions. Emulated atop the graph: cheap to maintain, heavier to run.
|
|
124
124
|
- **Graph** — that same workflow as a compiled, deterministic DAG. Same guarantees, roughly 3x faster, less to read. Run or schedule it; the router discovers it and pulls the work when it's healthy to.
|
|
125
125
|
|
|
126
126
|
Every procedural pattern has a graph equivalent and the reverse, so the choice is readability or speed — never durability, escalation, or transactional safety. Engineers move freely between them: execution traces, durable cycle replay, swimlane timelines. Nothing is hidden. The technical depth is the product.
|
package/package.json
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"AgentConfigPage-lmUOwyHO.js","sources":["../../src/pages/agents/detail/agent-form-types.ts","../../src/pages/agents/detail/IdentityStep.tsx","../../src/pages/agents/detail/MotivationStep.tsx","../../src/pages/agents/detail/KnowledgeStep.tsx","../../src/components/common/form/CapabilityCombobox.tsx","../../src/components/common/form/ReactionSelector.tsx","../../src/pages/agents/detail/SubscriptionsStep.tsx","../../src/pages/agents/detail/ScheduleStep.tsx","../../src/pages/agents/detail/ReviewStep.tsx","../../src/pages/agents/detail/AgentConfigPage.tsx"],"sourcesContent":["import type { Agent, AgentBehaviors } from '../../../api/agents';\nimport type { AgentSubscription } from '../../../api/agent-subscriptions';\n\nexport interface SubscriptionFormState {\n id?: string;\n topic: string;\n filter: string;\n reaction_type: 'durable' | 'pipeline' | 'mcp_query' | 'capability';\n workflow_type: string;\n pipeline_id: string;\n mcp_prompt: string;\n server_id: string;\n tool_name: string;\n input_mapping: string;\n execute_as: string;\n enabled: boolean;\n}\n\nexport interface ScheduleFormState {\n cron: string;\n reaction_type: 'durable' | 'pipeline' | 'capability';\n workflow_type: string;\n pipeline_id: string;\n server_id: string;\n tool_name: string;\n envelope: string; // JSON string\n execute_as: string;\n}\n\nexport interface AgentFormState {\n name: string;\n description: string;\n goals: string;\n rules: string;\n user_id: string;\n knowledge_domain: string;\n subscriptions: SubscriptionFormState[];\n schedules: ScheduleFormState[];\n}\n\nexport const EMPTY_FORM: AgentFormState = {\n name: '',\n description: '',\n goals: '',\n rules: '',\n user_id: '',\n knowledge_domain: '',\n subscriptions: [],\n schedules: [],\n};\n\nexport const STEP_LABELS = ['Identity', 'Motivation', 'Knowledge', 'Subscriptions', 'Schedule', 'Review'];\n\nexport const EMPTY_SUBSCRIPTION: SubscriptionFormState = {\n topic: '',\n filter: '',\n reaction_type: 'durable',\n workflow_type: '',\n pipeline_id: '',\n mcp_prompt: '',\n server_id: '',\n tool_name: '',\n input_mapping: '{}',\n execute_as: '',\n enabled: true,\n};\n\nexport const EMPTY_SCHEDULE: ScheduleFormState = {\n cron: '0 * * * *',\n reaction_type: 'durable',\n workflow_type: '',\n pipeline_id: '',\n server_id: '',\n tool_name: '',\n envelope: '{}',\n execute_as: '',\n};\n\nexport function isStepValid(step: number, form: AgentFormState): boolean {\n switch (step) {\n case 1: return form.name.trim().length > 0;\n case 2: return true;\n case 3: return true;\n case 4: {\n return form.subscriptions.every((s) => {\n if (!s.topic.trim()) return false;\n if (s.reaction_type === 'durable' && !s.workflow_type) return false;\n if (s.reaction_type === 'pipeline' && !s.pipeline_id) return false;\n if (s.reaction_type === 'mcp_query' && !s.mcp_prompt) return false;\n if (s.reaction_type === 'capability' && (!s.server_id || !s.tool_name)) return false;\n return true;\n });\n }\n case 5: {\n return form.schedules.every((s) => {\n if (!s.cron) return false;\n if (s.reaction_type === 'pipeline') return !!s.pipeline_id;\n if (s.reaction_type === 'capability') return !!s.server_id && !!s.tool_name;\n return !!s.workflow_type;\n });\n }\n case 6: return true;\n default: return true;\n }\n}\n\nexport function agentToForm(\n agent: Agent,\n subscriptions: AgentSubscription[],\n): AgentFormState {\n // Parse schedules from behaviors.schedules or fall back to legacy single cron\n const schedules: ScheduleFormState[] = agent.behaviors?.schedules?.length\n ? (agent.behaviors.schedules as any[]).map((s: any) => ({\n cron: s.cron || '',\n reaction_type: s.reaction_type || 'durable',\n workflow_type: s.workflow_type || '',\n pipeline_id: s.pipeline_id || '',\n server_id: s.server_id || '',\n tool_name: s.tool_name || '',\n envelope: s.envelope ? JSON.stringify(s.envelope, null, 2) : '{}',\n execute_as: s.execute_as || '',\n }))\n : agent.behaviors?.cron\n ? [{ cron: agent.behaviors.cron, reaction_type: 'durable' as const, workflow_type: agent.workflow_type ?? '', pipeline_id: '', server_id: '', tool_name: '', envelope: '{}', execute_as: '' }]\n : [];\n\n return {\n name: agent.id,\n description: agent.description ?? '',\n goals: agent.goals ?? '',\n rules: agent.rules ?? '',\n user_id: agent.user_id ?? '',\n knowledge_domain: agent.knowledge_domain ?? '',\n subscriptions: subscriptions.map((s) => ({\n id: s.id,\n topic: s.topic,\n filter: s.filter ? JSON.stringify(s.filter, null, 2) : '',\n reaction_type: s.reaction_type,\n workflow_type: s.workflow_type ?? '',\n pipeline_id: s.pipeline_id ?? '',\n mcp_prompt: s.mcp_prompt ?? '',\n server_id: s.server_id ?? '',\n tool_name: s.tool_name ?? '',\n input_mapping: JSON.stringify(s.input_mapping ?? {}, null, 2),\n execute_as: s.execute_as ?? '',\n enabled: s.enabled,\n })),\n schedules,\n };\n}\n\nexport function formToAgentPayload(form: AgentFormState): Record<string, any> {\n const behaviors: AgentBehaviors = {};\n // Store schedules array in behaviors\n if (form.schedules.length > 0) {\n (behaviors as any).schedules = form.schedules.map((s) => ({\n cron: s.cron,\n reaction_type: s.reaction_type || 'durable',\n workflow_type: s.reaction_type === 'pipeline' ? undefined : s.workflow_type,\n pipeline_id: s.reaction_type === 'pipeline' ? s.pipeline_id : undefined,\n envelope: tryParseJson(s.envelope) ?? {},\n execute_as: s.execute_as || undefined,\n }));\n // Legacy compat: also set top-level cron from first schedule\n behaviors.cron = form.schedules[0].cron;\n }\n\n return {\n id: form.name,\n description: form.description || undefined,\n goals: form.goals || undefined,\n rules: form.rules || undefined,\n user_id: form.user_id || undefined,\n knowledge_domain: form.knowledge_domain || undefined,\n behaviors,\n workflow_type: form.schedules[0]?.workflow_type || undefined,\n pipeline_id: undefined,\n };\n}\n\nexport function formToSubscriptionPayloads(form: AgentFormState): Array<{\n id?: string;\n topic: string;\n filter?: Record<string, any>;\n reaction_type: string;\n workflow_type?: string;\n pipeline_id?: string;\n mcp_prompt?: string;\n input_mapping: Record<string, any>;\n execute_as?: string;\n enabled: boolean;\n}> {\n return form.subscriptions.map((s) => ({\n id: s.id,\n topic: s.topic,\n filter: s.filter ? tryParseJson(s.filter) : undefined,\n reaction_type: s.reaction_type,\n workflow_type: s.workflow_type || undefined,\n pipeline_id: s.pipeline_id || undefined,\n mcp_prompt: s.mcp_prompt || undefined,\n server_id: s.server_id || undefined,\n tool_name: s.tool_name || undefined,\n input_mapping: tryParseJson(s.input_mapping) ?? {},\n execute_as: s.execute_as || undefined,\n enabled: s.enabled,\n }));\n}\n\nfunction tryParseJson(s: string): Record<string, any> | undefined {\n if (!s.trim()) return undefined;\n try { return JSON.parse(s); } catch { return undefined; }\n}\n\n/**\n * Update a single field in a mapping JSON object, applying form-friendly defaults:\n *\n * - Optional fields with empty values (empty string, null, undefined, empty array, \"[]\")\n * are **omitted** from the output — not stored as \"\".\n * - Required fields always persist (even if empty) so validation catches them.\n * - JSON array strings (e.g., '[\"a\",\"b\"]') are parsed into real arrays.\n *\n * Returns the updated JSON string.\n */\nexport function updateMappingField(\n currentJson: string,\n key: string,\n fieldValue: any,\n required: string[],\n): string {\n let parsed: Record<string, any>;\n try { parsed = JSON.parse(currentJson); } catch { parsed = {}; }\n\n const isReq = required.includes(key);\n\n // Optional fields with empty/blank values are omitted (undefined, not \"\")\n const isEmpty = fieldValue === '' || fieldValue === undefined || fieldValue === null\n || (Array.isArray(fieldValue) && fieldValue.length === 0)\n || fieldValue === '[]';\n if (!isReq && isEmpty) {\n const { [key]: _, ...rest } = parsed;\n return JSON.stringify(rest, null, 2);\n }\n\n // If the value is a JSON array string, parse it so the output is a real array\n let resolved = fieldValue;\n if (typeof fieldValue === 'string') {\n try {\n const p = JSON.parse(fieldValue);\n if (Array.isArray(p)) resolved = p;\n } catch { /* keep as string */ }\n }\n return JSON.stringify({ ...parsed, [key]: resolved }, null, 2);\n}\n\nexport const sectionCls = 'section-header mt-[3em] first:mt-0';\nexport const labelCls = 'label';\nexport const hintCls = 'hint';\nexport const inputCls = 'input';\nexport const jsonCls = 'input-json w-full';\n","import { BookOpen } from 'lucide-react';\nimport type { AgentFormState } from './agent-form-types';\nimport { labelCls, hintCls, inputCls } from './agent-form-types';\n\ninterface Props {\n form: AgentFormState;\n set: (field: keyof AgentFormState, value: any) => void;\n}\n\nexport function IdentityStep({ form, set }: Props) {\n return (\n <div className=\"space-y-8\">\n <div className=\"border-l-2 border-accent/30 pl-3 py-1 flex items-start justify-between\">\n <p className=\"text-xs text-text-secondary italic leading-relaxed\">\n Give your automation a name and describe what it does. The name appears everywhere — in events, logs, and the dashboard.\n </p>\n <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\"><BookOpen className=\"w-3 h-3\" strokeWidth={1.5} /></button>\n </div>\n\n <div>\n <label className={labelCls}>Name *</label>\n <input type=\"text\" value={form.name} onChange={(e) => set('name', e.target.value)} placeholder=\"health-monitor\" className={inputCls} />\n <p className={hintCls}>Lowercase, kebab-case. This appears everywhere.</p>\n </div>\n\n <div>\n <label className={labelCls}>Description</label>\n <input type=\"text\" value={form.description} onChange={(e) => set('description', e.target.value)} placeholder=\"Watches for workflow failures and captures diagnostics\" className={inputCls} />\n <p className={hintCls}>One sentence that explains what this automation does.</p>\n </div>\n </div>\n );\n}\n","import { BookOpen } from 'lucide-react';\nimport type { AgentFormState } from './agent-form-types';\nimport { labelCls, hintCls, inputCls } from './agent-form-types';\n\ninterface Props {\n form: AgentFormState;\n set: (field: keyof AgentFormState, value: any) => void;\n}\n\nexport function MotivationStep({ form, set }: Props) {\n return (\n <div className=\"space-y-8\">\n <div className=\"border-l-2 border-accent/30 pl-3 py-1 flex items-start justify-between\">\n <p className=\"text-xs text-text-secondary italic leading-relaxed\">\n Goals define what drives the automation. Rules define what constrains it.\n </p>\n <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\"><BookOpen className=\"w-3 h-3\" strokeWidth={1.5} /></button>\n </div>\n\n <div className=\"grid grid-cols-2 gap-8\">\n <div>\n <label className={labelCls}>Goals</label>\n <textarea value={form.goals} onChange={(e) => set('goals', e.target.value)} placeholder=\"Detect failures early, capture diagnostics, alert before cascading\" rows={4} className={`${inputCls} resize-none`} />\n <p className={hintCls}>Primary motivation. What the automation is trying to achieve.</p>\n </div>\n <div>\n <label className={labelCls}>Rules</label>\n <textarea value={form.rules} onChange={(e) => set('rules', e.target.value)} placeholder=\"Never auto-restart failed workflows. Always escalate to humans.\" rows={4} className={`${inputCls} resize-none`} />\n <p className={hintCls}>Guardrails. What it must never do, even when goals suggest it should.</p>\n </div>\n </div>\n </div>\n );\n}\n","import { Brain, BookOpen } from 'lucide-react';\nimport { useListDomains } from '../../../api/knowledge';\nimport { DateValue } from '../../../components/common/display/DateValue';\nimport type { AgentFormState } from './agent-form-types';\nimport { labelCls, hintCls, inputCls } from './agent-form-types';\n\ninterface Props {\n form: AgentFormState;\n set: (field: keyof AgentFormState, value: any) => void;\n}\n\nexport function KnowledgeStep({ form, set }: Props) {\n const { data: domainData } = useListDomains();\n const domains = domainData?.domains ?? [];\n\n return (\n <div className=\"space-y-6\">\n <div className=\"border-l-2 border-accent/30 pl-3 py-1 flex items-start justify-between\">\n <p className=\"text-xs text-text-secondary italic leading-relaxed\">\n Assign a knowledge domain — the automation's memory. It stores context here over time.\n </p>\n <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\"><BookOpen className=\"w-3 h-3\" strokeWidth={1.5} /></button>\n </div>\n\n <div>\n <label className={labelCls}>Knowledge Domain</label>\n <input\n type=\"text\"\n value={form.knowledge_domain}\n onChange={(e) => set('knowledge_domain', e.target.value)}\n placeholder=\"e.g., system-health, content-review, vendor-data\"\n className={inputCls}\n list=\"domain-suggestions\"\n />\n <datalist id=\"domain-suggestions\">\n {domains.map((d) => <option key={d.domain} value={d.domain} />)}\n </datalist>\n <p className={hintCls}>Choose an existing domain to share memory, or type a new name to create one.</p>\n </div>\n\n {domains.length > 0 && (\n <div>\n <label className={labelCls}>Existing Domains</label>\n <div className=\"space-y-0.5 mt-2\">\n {domains.map((d) => (\n <button\n key={d.domain}\n type=\"button\"\n onClick={() => set('knowledge_domain', d.domain)}\n className={`w-full flex items-center gap-3 px-3 py-2 rounded-md text-left transition-colors ${\n form.knowledge_domain === d.domain ? 'border-l-2 border-l-accent bg-accent/5' : 'hover:bg-surface-hover border-l-2 border-l-transparent'\n }`}\n >\n <Brain className=\"w-3.5 h-3.5 text-text-quaternary shrink-0\" strokeWidth={1.5} />\n <span className=\"text-sm text-text-primary flex-1\">{d.domain}</span>\n <span className=\"text-2xs text-text-quaternary\">{d.count} entries</span>\n <span className=\"text-2xs text-text-quaternary\"><DateValue date={d.latest} /></span>\n </button>\n ))}\n </div>\n </div>\n )}\n </div>\n );\n}\n","import { useState, useRef, useEffect, useMemo } from 'react';\nimport { Server } from 'lucide-react';\nimport { useCapabilities } from '../../../api/capabilities';\n\n/**\n * Searchable combobox for selecting a capability (MCP server tool).\n *\n * Searches across ALL tools from all servers in a single flat list.\n * Selecting a tool sets both serverId and toolName in one action.\n * Styled to match the TopicCombobox used for event topic selection.\n */\nexport function CapabilityCombobox({ serverId, toolName, onChange }: {\n serverId: string;\n toolName: string;\n onChange: (serverId: string, toolName: string) => void;\n}) {\n const { data } = useCapabilities();\n const allTools = useMemo(\n () => data?.categories?.flatMap((c) => c.tools) ?? [],\n [data],\n );\n\n const [open, setOpen] = useState(false);\n const [filter, setFilter] = useState('');\n const inputRef = useRef<HTMLInputElement>(null);\n const containerRef = useRef<HTMLDivElement>(null);\n\n // Close on outside click\n useEffect(() => {\n if (!open) return;\n function handleClick(e: MouseEvent) {\n if (containerRef.current && !containerRef.current.contains(e.target as Node)) {\n setOpen(false);\n }\n }\n document.addEventListener('mousedown', handleClick);\n return () => document.removeEventListener('mousedown', handleClick);\n }, [open]);\n\n const displayValue = toolName ? `${toolName}` : '';\n const filterText = open ? filter : displayValue;\n\n const filtered = useMemo(() => {\n const q = (open ? filter : '').toLowerCase();\n if (!q) return allTools;\n return allTools.filter((t) =>\n t.name.toLowerCase().includes(q) ||\n t.serverName.toLowerCase().includes(q) ||\n (t.description ?? '').toLowerCase().includes(q),\n );\n }, [allTools, filter, open]);\n\n const selectedTool = toolName\n ? allTools.find((t) => t.serverId === serverId && t.name === toolName)\n : undefined;\n\n return (\n <div ref={containerRef} className=\"relative\">\n <input\n ref={inputRef}\n type=\"text\"\n value={filterText}\n onFocus={() => { setOpen(true); setFilter(displayValue); }}\n onChange={(e) => {\n const v = e.target.value;\n setFilter(v);\n if (!v) onChange('', '');\n if (!open) setOpen(true);\n }}\n placeholder=\"Search capabilities...\"\n className=\"input font-mono text-sm w-full\"\n />\n\n {/* Selected tool description */}\n {!open && selectedTool?.description && (\n <p className=\"text-2xs text-text-tertiary mt-1 italic\">{selectedTool.description}</p>\n )}\n\n {open && filtered.length > 0 && (\n <div className=\"absolute z-[100] left-0 right-0 mt-1 max-h-64 overflow-y-auto rounded-md border border-surface-border bg-surface shadow-lg\">\n {filtered.map((t) => (\n <button\n key={`${t.serverId}:${t.name}`}\n type=\"button\"\n onClick={() => {\n onChange(t.serverId, t.name);\n setFilter(t.name);\n setOpen(false);\n }}\n className={`w-full text-left px-3 py-2 hover:bg-surface-hover transition-colors flex items-center gap-3 ${\n serverId === t.serverId && toolName === t.name ? 'bg-accent/5' : ''\n }`}\n >\n <span className=\"text-2xs font-mono text-text-primary shrink-0\">{t.name}</span>\n <span className=\"inline-flex items-center gap-1 px-1.5 py-0.5 rounded text-2xs font-medium shrink-0 bg-accent/10 text-accent\">\n <Server className=\"w-2 h-2\" strokeWidth={1.5} />\n {t.serverName}\n </span>\n {t.description && (\n <span className=\"text-2xs text-text-quaternary truncate\">{t.description}</span>\n )}\n </button>\n ))}\n </div>\n )}\n\n {open && filtered.length === 0 && filter && (\n <div className=\"absolute z-[100] left-0 right-0 mt-1 rounded-md border border-surface-border bg-surface shadow-lg px-3 py-4 text-center\">\n <p className=\"text-2xs text-text-quaternary\">No capabilities match \"{filter}\"</p>\n </div>\n )}\n </div>\n );\n}\n","import { useWorkflowConfigs } from '../../../api/workflows';\nimport { useYamlWorkflows } from '../../../api/yaml-workflows';\nimport { CapabilityCombobox } from './CapabilityCombobox';\n\nconst LABELS: Record<string, string> = {\n durable: 'Workflow',\n pipeline: 'Pipeline',\n capability: 'Capability',\n mcp_query: 'MCP Query',\n};\n\nconst ALL_TYPES = ['durable', 'pipeline', 'capability', 'mcp_query'] as const;\n\nexport interface ReactionSelectorProps {\n reactionType: string;\n onReactionTypeChange: (type: string) => void;\n workflowType: string;\n onWorkflowTypeChange: (v: string) => void;\n pipelineId: string;\n onPipelineIdChange: (v: string) => void;\n serverId: string;\n toolName: string;\n onCapabilityChange: (serverId: string, toolName: string) => void;\n mcpPrompt?: string;\n onMcpPromptChange?: (v: string) => void;\n availableTypes?: typeof ALL_TYPES[number][];\n}\n\nexport function ReactionSelector({\n reactionType,\n onReactionTypeChange,\n workflowType,\n onWorkflowTypeChange,\n pipelineId,\n onPipelineIdChange,\n serverId,\n toolName,\n onCapabilityChange,\n mcpPrompt,\n onMcpPromptChange,\n availableTypes = [...ALL_TYPES],\n}: ReactionSelectorProps) {\n const { data: configs } = useWorkflowConfigs();\n const invocableWorkflows = (configs ?? []).filter((c: any) => c.invocable).map((c: any) => c.workflow_type as string);\n const { data: pipelineData } = useYamlWorkflows({ status: 'active' });\n const pipelines = (pipelineData?.workflows ?? []).map((w: any) => ({ id: w.id as string, name: (w.graph_topic || w.id) as string }));\n\n return (\n <div className=\"space-y-4\">\n {/* Type tabs */}\n <div className=\"flex gap-1\">\n {availableTypes.map((rt) => {\n const active = reactionType === rt;\n return (\n <button\n key={rt}\n type=\"button\"\n onClick={() => onReactionTypeChange(rt)}\n className={`px-3 py-1.5 text-2xs font-medium rounded-md transition-colors ${\n active\n ? 'bg-accent/10 text-accent'\n : 'text-text-tertiary hover:text-text-primary hover:bg-surface-hover'\n }`}\n >\n {LABELS[rt]}\n </button>\n );\n })}\n </div>\n\n {/* Target selector per type */}\n {reactionType === 'durable' && (\n <div>\n <label className=\"label\">Workflow *</label>\n <select value={workflowType} onChange={(e) => onWorkflowTypeChange(e.target.value)} className=\"input\">\n <option value=\"\">Select workflow...</option>\n {invocableWorkflows.map((wt) => <option key={wt} value={wt}>{wt}</option>)}\n </select>\n </div>\n )}\n\n {reactionType === 'pipeline' && (\n <div>\n <label className=\"label\">Pipeline *</label>\n <select value={pipelineId} onChange={(e) => onPipelineIdChange(e.target.value)} className=\"input\">\n <option value=\"\">Select pipeline...</option>\n {pipelines.map((p) => <option key={p.id} value={p.id}>{p.name}</option>)}\n </select>\n </div>\n )}\n\n {reactionType === 'capability' && (\n <div>\n <label className=\"label\">Capability *</label>\n <CapabilityCombobox\n serverId={serverId}\n toolName={toolName}\n onChange={onCapabilityChange}\n />\n </div>\n )}\n\n {reactionType === 'mcp_query' && onMcpPromptChange && (\n <div>\n <label className=\"label\">Prompt *</label>\n <textarea\n value={mcpPrompt ?? ''}\n onChange={(e) => onMcpPromptChange(e.target.value)}\n placeholder=\"Analyze the error and suggest remediation...\"\n rows={3}\n className=\"input resize-none\"\n />\n </div>\n )}\n </div>\n );\n}\n","import { useState, useRef, useEffect, useMemo } from 'react';\nimport { Plus, Trash2, Radio, BookOpen } from 'lucide-react';\nimport { RunAsSelector } from '../../../components/common/form/RunAsSelector';\nimport { ReactionSelector } from '../../../components/common/form/ReactionSelector';\nimport { useTopics, type TopicCatalogEntry } from '../../../api/topics';\nimport { useCapabilities } from '../../../api/capabilities';\nimport type { AgentFormState, SubscriptionFormState } from './agent-form-types';\nimport { EMPTY_SUBSCRIPTION, updateMappingField, sectionCls, hintCls, inputCls, jsonCls } from './agent-form-types';\n\nconst CATEGORY_COLORS: Record<string, string> = {\n task: 'bg-status-active/10 text-status-active',\n workflow: 'bg-accent/15 text-accent',\n escalation: 'bg-status-warning/10 text-status-warning',\n activity: 'bg-status-active/10 text-status-active',\n knowledge: 'bg-accent/10 text-accent',\n file: 'bg-status-draft/10 text-status-draft',\n agent: 'bg-status-success/10 text-status-success',\n app: 'bg-status-error/10 text-status-error',\n milestone: 'bg-accent/10 text-accent',\n};\n\ninterface Props {\n form: AgentFormState;\n set: (field: keyof AgentFormState, value: any) => void;\n}\n\nexport function SubscriptionsStep({ form, set }: Props) {\n const { data: topicsData } = useTopics({ limit: 200 });\n const { data: capData } = useCapabilities();\n const catalogTopics = topicsData?.topics ?? [];\n const allTools = useMemo(() => capData?.categories?.flatMap((c) => c.tools) ?? [], [capData]);\n const [selected, setSelected] = useState(0);\n\n const updateSub = (index: number, field: keyof SubscriptionFormState, value: any) => {\n const next = [...form.subscriptions];\n next[index] = { ...next[index], [field]: value };\n set('subscriptions', next);\n };\n\n const addSub = () => {\n set('subscriptions', [...form.subscriptions, { ...EMPTY_SUBSCRIPTION }]);\n setSelected(form.subscriptions.length);\n };\n\n const removeSub = (index: number) => {\n set('subscriptions', form.subscriptions.filter((_, i) => i !== index));\n if (selected >= form.subscriptions.length - 1) setSelected(Math.max(0, form.subscriptions.length - 2));\n };\n\n const subs = form.subscriptions;\n const sub = subs[selected];\n const isComplete = (s: SubscriptionFormState) => {\n if (!s.topic) return false;\n if (s.reaction_type === 'durable') return !!s.workflow_type;\n if (s.reaction_type === 'pipeline') return !!s.pipeline_id;\n if (s.reaction_type === 'mcp_query') return !!s.mcp_prompt;\n if (s.reaction_type === 'capability') return !!s.server_id && !!s.tool_name;\n return false;\n };\n\n // Find the selected topic's catalog entry for schema preview\n const selectedCatalogEntry = sub ? catalogTopics.find((t) => t.topic === sub.topic) : undefined;\n\n if (subs.length === 0) {\n return (\n <div className=\"max-w-xl\">\n <div className=\"border-l-2 border-accent/30 pl-3 py-1 flex items-start justify-between mb-8\">\n <p className=\"text-xs text-text-secondary italic leading-relaxed\">\n Optional. When a matching event is published, the automation runs the configured workflow with the event payload.\n </p>\n <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\"><BookOpen className=\"w-3 h-3\" strokeWidth={1.5} /></button>\n </div>\n <div className=\"flex flex-col items-center justify-center py-12 text-center\">\n <Radio className=\"w-8 h-8 text-text-quaternary/40 mb-3\" strokeWidth={1} />\n <p className=\"text-sm text-text-tertiary mb-2\">No event subscriptions yet</p>\n <p className=\"text-2xs text-text-quaternary max-w-sm mb-6\">\n Each subscription listens for a topic pattern and runs a workflow when it matches.\n </p>\n <button onClick={addSub} className=\"flex items-center gap-2 text-xs text-accent hover:text-accent-hover transition-colors\">\n <Plus className=\"w-3.5 h-3.5\" /> Add first subscription\n </button>\n </div>\n </div>\n );\n }\n\n return (\n <div>\n <div className=\"border-l-2 border-accent/30 pl-3 py-1 flex items-start justify-between mb-6\">\n <p className=\"text-xs text-text-secondary italic leading-relaxed\">\n Optional. When a matching event is published, the automation runs the configured workflow with the event payload.\n </p>\n <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\"><BookOpen className=\"w-3 h-3\" strokeWidth={1.5} /></button>\n </div>\n\n <div className=\"flex gap-8\">\n {/* Sub-index */}\n <div className=\"w-52 shrink-0 space-y-0.5\">\n {subs.map((s, i) => (\n <div key={i} className={`group/sub flex items-center rounded-md transition-colors ${\n selected === i ? 'bg-accent/10 text-accent' : 'text-text-tertiary hover:text-text-primary hover:bg-surface-hover'\n }`}>\n <button onClick={() => setSelected(i)} className=\"flex-1 text-left px-3 py-2 min-w-0\">\n <div className=\"flex items-center gap-1.5\">\n <span className={`w-2.5 h-2.5 rounded-full dot-ring shrink-0 ${isComplete(s) ? 'bg-status-success' : 'bg-surface-border'}`} />\n <span className=\"text-2xs font-mono truncate\">{s.topic || 'new subscription'}</span>\n </div>\n <span className=\"text-2xs text-text-quaternary ml-3\">→ {s.workflow_type || s.tool_name || s.reaction_type}</span>\n </button>\n <button onClick={(e) => { e.stopPropagation(); if (confirm(`Remove subscription \"${s.topic || 'new'}\"?\\n\\nThis takes effect when you save.`)) removeSub(i); }} className=\"opacity-0 group-hover/sub:opacity-100 px-2 text-text-quaternary hover:text-status-error transition-all\" title=\"Remove\">\n <Trash2 className=\"w-3 h-3\" />\n </button>\n </div>\n ))}\n <button onClick={addSub} className=\"w-full flex items-center gap-1.5 px-3 py-2 text-2xs text-accent hover:text-accent-hover transition-colors\">\n <Plus className=\"w-3 h-3\" /> Add\n </button>\n </div>\n\n {/* Detail form */}\n {sub && (\n <div className=\"flex-1 min-w-0 space-y-12\">\n\n {/* When — topic combobox */}\n <div>\n <label className={sectionCls}>When this event fires</label>\n <TopicCombobox\n value={sub.topic}\n onChange={(v) => updateSub(selected, 'topic', v)}\n topics={catalogTopics}\n />\n\n {/* Schema preview when a catalog topic is selected */}\n {selectedCatalogEntry?.payload_schema && (\n <div className=\"mt-3 p-3 rounded-md bg-surface-sunken border border-surface-border\">\n <p className=\"text-2xs text-text-quaternary mb-1 uppercase tracking-wider font-medium\">Payload Schema</p>\n <pre className=\"text-2xs font-mono text-text-secondary whitespace-pre-wrap overflow-x-auto max-h-40\">\n {JSON.stringify(selectedCatalogEntry.payload_schema.properties ?? selectedCatalogEntry.payload_schema, null, 2)}\n </pre>\n {selectedCatalogEntry.description && (\n <p className=\"text-2xs text-text-tertiary mt-2 italic\">{selectedCatalogEntry.description}</p>\n )}\n </div>\n )}\n </div>\n\n {/* Reaction selector — full width */}\n <div>\n <label className={sectionCls}>Run this reaction</label>\n <ReactionSelector\n reactionType={sub.reaction_type}\n onReactionTypeChange={(v) => updateSub(selected, 'reaction_type', v)}\n workflowType={sub.workflow_type}\n onWorkflowTypeChange={(v) => updateSub(selected, 'workflow_type', v)}\n pipelineId={sub.pipeline_id}\n onPipelineIdChange={(v) => updateSub(selected, 'pipeline_id', v)}\n serverId={sub.server_id}\n toolName={sub.tool_name}\n onCapabilityChange={(sid, tn) => {\n const next = [...form.subscriptions];\n const entry = { ...next[selected], server_id: sid, tool_name: tn };\n // Auto-generate mapping template from tool schema\n const tool = allTools.find((t) => t.serverId === sid && t.name === tn);\n const props = tool?.inputSchema?.properties as Record<string, any> | undefined;\n if (props && tn) {\n const template: Record<string, string> = {};\n for (const key of Object.keys(props)) {\n if (key.startsWith('_')) continue;\n template[key] = `{event.data.${key}}`;\n }\n entry.input_mapping = JSON.stringify(template, null, 2);\n }\n next[selected] = entry;\n set('subscriptions', next);\n }}\n mcpPrompt={sub.mcp_prompt}\n onMcpPromptChange={(v) => updateSub(selected, 'mcp_prompt', v)}\n\n />\n </div>\n\n {/* Identity + Filter — 2 col */}\n <div className=\"grid grid-cols-2 gap-6\">\n <div>\n <label className={sectionCls}>As identity</label>\n <RunAsSelector selected={sub.execute_as} onChange={(v) => updateSub(selected, 'execute_as', v)} />\n <p className={hintCls}>Identity used when invoking the workflow.</p>\n </div>\n <div>\n <label className={sectionCls}>But only if</label>\n <input type=\"text\" value={sub.filter} onChange={(e) => updateSub(selected, 'filter', e.target.value)} placeholder='{\"extension\": \"png\"}' className={`${inputCls} font-mono text-xs`} />\n <p className={hintCls}>JSON filter against event.data. Click an operator to insert:</p>\n <div className=\"flex flex-wrap gap-1.5 mt-1.5\">\n {[\n { label: 'equals', value: '{\"key\": \"val\"}' },\n { label: 'not equal', value: '{\"key\": {\"$ne\": \"val\"}}' },\n { label: 'in list', value: '{\"key\": {\"$in\": [\"a\", \"b\"]}}' },\n { label: 'exists', value: '{\"key\": {\"$exists\": true}}' },\n ].map((op) => (\n <button\n key={op.label}\n type=\"button\"\n onClick={() => updateSub(selected, 'filter', op.value)}\n className=\"px-2 py-0.5 text-2xs font-mono rounded bg-accent/8 text-accent hover:bg-accent/15 transition-colors\"\n >\n {op.label}\n </button>\n ))}\n </div>\n </div>\n </div>\n\n {/* Input Mapping full width */}\n <div>\n <label className={sectionCls}>With this data</label>\n {sub.reaction_type === 'capability' && sub.tool_name ? (\n <CapabilityMappingForm\n tool={allTools.find((t) => t.serverId === sub.server_id && t.name === sub.tool_name)}\n value={sub.input_mapping}\n onChange={(v) => updateSub(selected, 'input_mapping', v)}\n eventSchema={selectedCatalogEntry?.payload_schema}\n />\n ) : (\n <>\n <textarea value={sub.input_mapping} onChange={(e) => updateSub(selected, 'input_mapping', e.target.value)} rows={10} className={jsonCls} placeholder={'{\\n \"data\": {\\n \"orderId\": \"{event.data.orderId}\",\\n \"error\": \"{event.data.error}\"\\n }\\n}'} />\n <p className={hintCls}>Maps event fields to workflow input. {'{event.data.fieldName}'} resolves at runtime.</p>\n </>\n )}\n </div>\n </div>\n )}\n </div>\n </div>\n );\n}\n\n// ── Capability Mapping Form ─────────────────────────────────────────────────\n\nfunction CapabilityMappingForm({ tool, value, onChange, eventSchema }: {\n tool?: { name: string; description?: string; inputSchema: Record<string, any> };\n value: string;\n onChange: (v: string) => void;\n eventSchema?: Record<string, any>;\n}) {\n const [jsonMode, setJsonMode] = useState(false);\n const props = (tool?.inputSchema?.properties ?? {}) as Record<string, any>;\n const required = (tool?.inputSchema?.required as string[]) ?? [];\n const allFields = Object.entries(props).filter(([k]) => !k.startsWith('_'));\n\n // Required fields first (in declared required-array order), then optional alphabetically\n const fields = useMemo(() =>\n [...allFields].sort(([a], [b]) => {\n const ai = required.indexOf(a);\n const bi = required.indexOf(b);\n if (ai !== -1 && bi !== -1) return ai - bi;\n if (ai !== -1) return -1;\n if (bi !== -1) return 1;\n return a.localeCompare(b);\n }),\n [allFields, required]);\n\n // Build event field suggestions from the topic's payload schema\n const eventSuggestions = useMemo(() => {\n const suggestions: Array<{ value: string; label: string }> = [\n { value: '{event.type}', label: 'event type' },\n { value: '{event.source}', label: 'event source' },\n { value: '{event.timestamp}', label: 'ISO timestamp' },\n { value: '{event.workflowId}', label: 'workflow ID' },\n { value: '{event.workflowName}', label: 'workflow name' },\n ];\n const schemaProps = eventSchema?.properties as Record<string, any> | undefined;\n if (schemaProps) {\n for (const [key, def] of Object.entries(schemaProps)) {\n suggestions.push({\n value: `{event.data.${key}}`,\n label: (def as any).description || key,\n });\n }\n }\n return suggestions;\n }, [eventSchema]);\n\n const parsed = useMemo(() => {\n try { return JSON.parse(value) as Record<string, any>; }\n catch { return {} as Record<string, any>; }\n }, [value]);\n\n const updateField = (key: string, fieldValue: any) => {\n onChange(updateMappingField(value, key, fieldValue, required));\n };\n\n if (fields.length === 0 || jsonMode) {\n return (\n <div>\n {fields.length > 0 && (\n <div className=\"flex justify-end mb-1\">\n <button type=\"button\" onClick={() => setJsonMode(false)} className=\"text-2xs text-accent hover:text-accent-hover transition-colors\">Form view</button>\n </div>\n )}\n <textarea value={value} onChange={(e) => onChange(e.target.value)} rows={8} className={jsonCls} placeholder={'{\\n \"domain\": \"{event.data.name}\",\\n \"key\": \"{event.data.path}\"\\n}'} />\n <p className={hintCls}>Maps event fields to capability inputs. {'{event.data.fieldName}'} resolves at runtime.</p>\n </div>\n );\n }\n\n return (\n <div>\n <div className=\"flex items-center justify-between mb-3\">\n <p className=\"text-2xs text-text-tertiary\">\n Map each input to an event field or enter a static value.\n </p>\n <button type=\"button\" onClick={() => setJsonMode(true)} className=\"text-2xs text-text-tertiary hover:text-accent transition-colors\">Raw JSON</button>\n </div>\n\n <div className=\"space-y-4\">\n {fields.map(([key, def]) => {\n const isReq = required.includes(key);\n const desc = (def as any).description;\n const fieldType = (def as any).type;\n const currentVal = typeof parsed[key] === 'string' ? parsed[key]\n : typeof parsed[key] === 'object' ? JSON.stringify(parsed[key])\n : parsed[key] != null ? String(parsed[key]) : '';\n\n return (\n <div key={key} className=\"bg-surface-sunken/30 rounded-md px-4 py-3\">\n <div className=\"flex items-baseline gap-2 mb-0.5\">\n <label className=\"text-2xs font-semibold uppercase tracking-wider text-text-secondary\">\n {key.replace(/[_-]/g, ' ')}\n {isReq && <span className=\"text-status-error ml-0.5\">*</span>}\n </label>\n {fieldType && <span className=\"text-2xs text-text-quaternary\">{fieldType}</span>}\n </div>\n {desc && <p className=\"text-2xs text-text-quaternary mb-2\">{desc}</p>}\n <MappingFieldInput\n value={currentVal}\n onChange={(v) => updateField(key, v)}\n suggestions={eventSuggestions}\n fieldType={fieldType}\n placeholder={`{event.data.${key}}`}\n />\n </div>\n );\n })}\n </div>\n </div>\n );\n}\n\n/** Input with dropdown suggestions for event field references */\nfunction MappingFieldInput({ value, onChange, suggestions, fieldType, placeholder }: {\n value: string;\n onChange: (v: string) => void;\n suggestions: Array<{ value: string; label: string }>;\n fieldType?: string;\n placeholder: string;\n}) {\n const [open, setOpen] = useState(false);\n const [filter, setFilter] = useState('');\n const containerRef = useRef<HTMLDivElement>(null);\n\n useEffect(() => {\n if (!open) return;\n function handleClick(e: MouseEvent) {\n if (containerRef.current && !containerRef.current.contains(e.target as Node)) setOpen(false);\n }\n document.addEventListener('mousedown', handleClick);\n return () => document.removeEventListener('mousedown', handleClick);\n }, [open]);\n\n const filtered = suggestions.filter((s) =>\n s.value.toLowerCase().includes(filter.toLowerCase()) ||\n s.label.toLowerCase().includes(filter.toLowerCase()),\n );\n\n if (fieldType === 'object') {\n return (\n <textarea\n value={value}\n onChange={(e) => {\n try { onChange(JSON.parse(e.target.value)); }\n catch { onChange(e.target.value); }\n }}\n rows={3}\n className={`${jsonCls} text-xs`}\n placeholder={`{ \"source\": \"{event.source}\" }`}\n />\n );\n }\n\n if (fieldType === 'array') {\n // Parse existing value: could be a JSON array string or comma-separated\n const items: string[] = (() => {\n try {\n const parsed = JSON.parse(value);\n if (Array.isArray(parsed)) return parsed.map(String);\n } catch { /* fall through */ }\n return value ? value.split(',').map((s: string) => s.trim()).filter(Boolean) : [];\n })();\n\n return (\n <div>\n <div className=\"flex flex-wrap gap-1.5 mb-2 min-h-[28px]\">\n {items.map((item, i) => (\n <span key={i} className=\"inline-flex items-center gap-1 px-2 py-0.5 text-2xs font-mono bg-accent/10 text-accent rounded-full\">\n {item}\n <button\n type=\"button\"\n onClick={() => { const next = items.filter((_, j) => j !== i); onChange(JSON.stringify(next)); }}\n className=\"text-accent/50 hover:text-accent ml-0.5\"\n >\n ×\n </button>\n </span>\n ))}\n </div>\n <input\n type=\"text\"\n className=\"input font-mono text-xs w-full\"\n placeholder=\"Type a value and press Enter\"\n onKeyDown={(e) => {\n if (e.key === 'Enter' || e.key === ',') {\n e.preventDefault();\n const v = (e.target as HTMLInputElement).value.trim();\n if (v) {\n onChange(JSON.stringify([...items, v]));\n (e.target as HTMLInputElement).value = '';\n }\n }\n }}\n />\n </div>\n );\n }\n\n return (\n <div ref={containerRef} className=\"relative\">\n <input\n type=\"text\"\n value={value}\n onFocus={() => { setOpen(true); setFilter(''); }}\n onChange={(e) => { onChange(e.target.value); setFilter(e.target.value); if (!open) setOpen(true); }}\n className=\"input font-mono text-xs w-full\"\n placeholder={placeholder}\n />\n {open && filtered.length > 0 && (\n <div className=\"absolute z-[100] left-0 right-0 mt-1 max-h-48 overflow-y-auto rounded-md border border-surface-border bg-surface shadow-lg\">\n {filtered.map((s) => (\n <button\n key={s.value}\n type=\"button\"\n onClick={() => { onChange(s.value); setOpen(false); }}\n className={`w-full text-left px-3 py-1.5 hover:bg-surface-hover transition-colors flex items-center gap-3 ${value === s.value ? 'bg-accent/5' : ''}`}\n >\n <span className=\"text-2xs font-mono text-accent shrink-0\">{s.value}</span>\n <span className=\"text-2xs text-text-quaternary truncate\">{s.label}</span>\n </button>\n ))}\n </div>\n )}\n </div>\n );\n}\n\n// ── Topic Combobox ──────────────────────────────────────────────────────────\n\nfunction TopicCombobox({ value, onChange, topics }: {\n value: string;\n onChange: (v: string) => void;\n topics: TopicCatalogEntry[];\n}) {\n const [open, setOpen] = useState(false);\n const [filter, setFilter] = useState('');\n const inputRef = useRef<HTMLInputElement>(null);\n const containerRef = useRef<HTMLDivElement>(null);\n\n // Close on outside click\n useEffect(() => {\n function handleClick(e: MouseEvent) {\n if (containerRef.current && !containerRef.current.contains(e.target as Node)) {\n setOpen(false);\n }\n }\n if (open) document.addEventListener('mousedown', handleClick);\n return () => document.removeEventListener('mousedown', handleClick);\n }, [open]);\n\n const filterText = open ? filter : value;\n const filtered = topics.filter((t) =>\n t.topic.toLowerCase().includes((open ? filter : '').toLowerCase()) ||\n (t.description ?? '').toLowerCase().includes((open ? filter : '').toLowerCase()),\n );\n\n return (\n <div ref={containerRef} className=\"relative\">\n <input\n ref={inputRef}\n type=\"text\"\n value={filterText}\n onFocus={() => { setOpen(true); setFilter(value); }}\n onChange={(e) => {\n const v = e.target.value;\n setFilter(v);\n onChange(v);\n if (!open) setOpen(true);\n }}\n placeholder=\"workflow.failed or app.>\"\n className={`${inputCls} font-mono`}\n />\n\n {open && filtered.length > 0 && (\n <div className=\"absolute z-[100] left-0 right-0 mt-1 max-h-64 overflow-y-auto rounded-md border border-surface-border bg-surface shadow-lg\">\n {filtered.map((t) => {\n const catCls = CATEGORY_COLORS[t.category] ?? 'bg-surface-sunken text-text-tertiary';\n return (\n <button\n key={t.topic}\n type=\"button\"\n onClick={() => {\n onChange(t.topic);\n setFilter(t.topic);\n setOpen(false);\n }}\n className={`w-full text-left px-3 py-2 hover:bg-surface-hover transition-colors flex items-center gap-3 ${\n value === t.topic ? 'bg-accent/5' : ''\n }`}\n >\n <span className=\"text-2xs font-mono text-text-primary shrink-0\">{t.topic}</span>\n <span className={`inline-flex items-center px-1.5 py-0.5 rounded text-2xs font-medium shrink-0 ${catCls}`}>{t.category}</span>\n {t.description && (\n <span className=\"text-2xs text-text-quaternary truncate\">{t.description}</span>\n )}\n </button>\n );\n })}\n </div>\n )}\n </div>\n );\n}\n","import { useState } from 'react';\nimport { Plus, Trash2, Clock, BookOpen } from 'lucide-react';\nimport { RunAsSelector } from '../../../components/common/form/RunAsSelector';\nimport { ReactionSelector } from '../../../components/common/form/ReactionSelector';\nimport type { AgentFormState, ScheduleFormState } from './agent-form-types';\nimport { EMPTY_SCHEDULE, sectionCls, hintCls, inputCls, jsonCls } from './agent-form-types';\n\nconst CRON_PRESETS = [\n '*/5 * * * *',\n '*/15 * * * *',\n '0 * * * *',\n '0 */4 * * *',\n '0 7 * * *',\n '0 9 * * 1-5',\n];\n\nfunction describeCron(expr: string): string {\n const m: Record<string, string> = {\n '* * * * *': 'Every minute',\n '*/5 * * * *': 'Every 5 min',\n '*/15 * * * *': 'Every 15 min',\n '0 * * * *': 'Hourly',\n '0 */4 * * *': 'Every 4 hours',\n '0 7 * * *': 'Daily 7 AM UTC',\n '0 9 * * 1-5': 'Weekdays 9 AM UTC',\n '0 0 * * 1': 'Weekly Monday',\n };\n return m[expr] || expr;\n}\n\ninterface Props {\n form: AgentFormState;\n set: (field: keyof AgentFormState, value: any) => void;\n}\n\nexport function ScheduleStep({ form, set }: Props) {\n const [selected, setSelected] = useState(0);\n\n const updateSched = (index: number, field: keyof ScheduleFormState, value: any) => {\n const next = [...form.schedules];\n next[index] = { ...next[index], [field]: value };\n set('schedules', next);\n };\n\n const addSched = () => {\n set('schedules', [...form.schedules, { ...EMPTY_SCHEDULE }]);\n setSelected(form.schedules.length);\n };\n\n const removeSched = (index: number) => {\n set('schedules', form.schedules.filter((_: any, i: number) => i !== index));\n if (selected >= form.schedules.length - 1) setSelected(Math.max(0, form.schedules.length - 2));\n };\n\n const scheds = form.schedules;\n const sched = scheds[selected];\n\n if (scheds.length === 0) {\n return (\n <div>\n <div className=\"border-l-2 border-accent/30 pl-3 py-1 mb-8 flex items-start justify-between\">\n <p className=\"text-xs text-text-secondary italic leading-relaxed\">\n Optional. Each schedule runs a workflow on a cron timer.\n </p>\n <button onClick={() => { window.location.hash = '#docs:agents.md:schedule'; }} className=\"text-text-quaternary hover:text-accent transition-colors shrink-0 ml-3\" title=\"Docs: Schedule\"><BookOpen className=\"w-3 h-3\" strokeWidth={1.5} /></button>\n </div>\n <div className=\"flex flex-col items-center justify-center py-12 text-center\">\n <Clock className=\"w-8 h-8 text-text-quaternary/40 mb-3\" strokeWidth={1} />\n <p className=\"text-sm text-text-tertiary mb-2\">No schedules</p>\n <p className=\"text-2xs text-text-quaternary max-w-sm mb-6\">\n Add a schedule to run a workflow on a recurring cron timer.\n </p>\n <button onClick={addSched} className=\"flex items-center gap-2 text-xs text-accent hover:text-accent-hover transition-colors\">\n <Plus className=\"w-3.5 h-3.5\" /> Add schedule\n </button>\n </div>\n </div>\n );\n }\n\n return (\n <div>\n <div className=\"border-l-2 border-accent/30 pl-3 py-1 mb-6 flex items-start justify-between\">\n <p className=\"text-xs text-text-secondary italic leading-relaxed\">\n Each schedule runs a workflow on a timer. An automation can have multiple schedules targeting different workflows.\n </p>\n <button onClick={() => { window.location.hash = '#docs:agents.md:schedule'; }} className=\"text-text-quaternary hover:text-accent transition-colors shrink-0 ml-3\" title=\"Docs: Schedule\"><BookOpen className=\"w-3 h-3\" strokeWidth={1.5} /></button>\n </div>\n\n <div className=\"flex gap-8\">\n {/* Sub-index */}\n <div className=\"w-48 shrink-0 space-y-0.5\">\n {scheds.map((s, i) => (\n <div key={i} className={`group/sched flex items-center rounded-md transition-colors ${\n selected === i ? 'bg-accent/10 text-accent' : 'text-text-tertiary hover:text-text-primary hover:bg-surface-hover'\n }`}>\n <button onClick={() => setSelected(i)} className=\"flex-1 text-left px-3 py-2 min-w-0\">\n <span className=\"text-2xs font-mono block\">{s.cron || 'new schedule'}</span>\n <span className=\"text-2xs text-text-quaternary\">{(s.reaction_type === 'pipeline' ? s.pipeline_id : s.workflow_type) || 'no target'} · {describeCron(s.cron)}</span>\n </button>\n <button onClick={(e) => { e.stopPropagation(); if (confirm(`Remove schedule \"${s.cron || 'new'}\"?\\n\\nThis takes effect when you save.`)) removeSched(i); }} className=\"opacity-0 group-hover/sched:opacity-100 px-2 text-text-quaternary hover:text-status-error transition-all\" title=\"Remove\">\n <Trash2 className=\"w-3 h-3\" />\n </button>\n </div>\n ))}\n <button onClick={addSched} className=\"w-full flex items-center gap-1.5 px-3 py-2 text-2xs text-accent hover:text-accent-hover transition-colors\">\n <Plus className=\"w-3 h-3\" /> Add\n </button>\n </div>\n\n {/* Detail form */}\n {sched && (\n <div className=\"flex-1 min-w-0 space-y-12\">\n\n {/* Every — cron + presets */}\n <div>\n <label className={sectionCls}>Run every</label>\n <input type=\"text\" value={sched.cron} onChange={(e) => updateSched(selected, 'cron', e.target.value)} placeholder=\"0 * * * *\" className={`${inputCls} font-mono`} />\n {sched.cron && <p className=\"text-2xs text-accent/80 mt-1\">{describeCron(sched.cron)}</p>}\n <div className=\"flex gap-3 mt-2 overflow-x-auto\">\n {CRON_PRESETS.map((p) => (\n <button key={p} type=\"button\" onClick={() => updateSched(selected, 'cron', p)}\n className={`text-2xs font-mono whitespace-nowrap transition-colors ${sched.cron === p ? 'text-accent font-medium' : 'text-accent/50 hover:text-accent'}`}\n >{describeCron(p)}</button>\n ))}\n </div>\n </div>\n\n {/* Run this reaction */}\n <div>\n <label className={sectionCls}>Run this reaction</label>\n <ReactionSelector\n reactionType={sched.reaction_type}\n onReactionTypeChange={(v) => updateSched(selected, 'reaction_type', v)}\n workflowType={sched.workflow_type}\n onWorkflowTypeChange={(v) => updateSched(selected, 'workflow_type', v)}\n pipelineId={sched.pipeline_id}\n onPipelineIdChange={(v) => updateSched(selected, 'pipeline_id', v)}\n serverId={sched.server_id}\n toolName={sched.tool_name}\n onCapabilityChange={(sid, tn) => { updateSched(selected, 'server_id', sid); updateSched(selected, 'tool_name', tn); }}\n availableTypes={['durable', 'pipeline', 'capability']}\n\n />\n </div>\n\n {/* As identity */}\n <div>\n <label className={sectionCls}>As identity</label>\n <RunAsSelector selected={sched.execute_as} onChange={(v) => updateSched(selected, 'execute_as', v)} />\n <p className={hintCls}>Identity used when invoking.</p>\n </div>\n\n {/* Envelope */}\n <div>\n <label className={sectionCls}>With this data</label>\n <textarea value={sched.envelope} onChange={(e) => updateSched(selected, 'envelope', e.target.value)} rows={10} className={jsonCls} placeholder={'{\\n \"data\": { \"source\": \"cron\" }\\n}'} />\n <p className={hintCls}>Static payload passed to the workflow on each invocation.</p>\n </div>\n </div>\n )}\n </div>\n </div>\n );\n}\n","import { Bot, Compass, Brain, Radio, Clock } from 'lucide-react';\nimport { EventTopicPill } from '../../../components/common/display/EventTopicPill';\nimport { CronLabel } from '../../../components/common/display/CronLabel';\nimport { WorkflowPill } from '../../../components/common/display/WorkflowPill';\nimport type { AgentFormState } from './agent-form-types';\n\ninterface Props {\n form: AgentFormState;\n}\n\nfunction Section({ icon: Icon, color, title, children }: { icon: React.ElementType; color: string; title: string; children: React.ReactNode }) {\n return (\n <div className=\"mb-10\">\n <div className=\"flex items-center gap-2 mb-2 pb-1.5 border-b border-surface-border/40\">\n <Icon className={`w-3.5 h-3.5 ${color}`} strokeWidth={1.5} />\n <h3 className=\"text-xs font-semibold uppercase tracking-widest text-accent/80\">{title}</h3>\n </div>\n <div className=\"pl-5.5\">{children}</div>\n </div>\n );\n}\n\nfunction Field({ label, children }: { label: string; children: React.ReactNode }) {\n return (\n <div className=\"flex gap-3 py-0.5\">\n <span className=\"text-2xs text-text-quaternary w-20 shrink-0\">{label}</span>\n <span className=\"text-xs text-text-primary\">{children}</span>\n </div>\n );\n}\n\nexport function ReviewStep({ form }: Props) {\n return (\n <div>\n <Section icon={Bot} color=\"text-accent\" title=\"Identity\">\n <Field label=\"Name\">{form.name || '—'}</Field>\n {form.description && <Field label=\"Description\">{form.description}</Field>}\n </Section>\n\n {(form.goals || form.rules) && (\n <Section icon={Compass} color=\"text-accent\" title=\"Motivation\">\n {form.goals && <Field label=\"Goals\">{form.goals}</Field>}\n {form.rules && <Field label=\"Rules\">{form.rules}</Field>}\n </Section>\n )}\n\n <Section icon={Brain} color=\"text-accent\" title=\"Knowledge\">\n <Field label=\"Domain\">{form.knowledge_domain || 'None'}</Field>\n </Section>\n\n {/* Subscriptions + Schedule side by side */}\n <div className=\"grid grid-cols-2 gap-x-10\">\n <Section icon={Radio} color=\"text-accent\" title={`Subscriptions (${form.subscriptions.length})`}>\n {form.subscriptions.length === 0 ? (\n <span className=\"text-2xs text-text-quaternary\">None configured</span>\n ) : (\n <div className=\"divide-y divide-surface-border/30\">\n {form.subscriptions.map((sub, i) => (\n <div key={i} className=\"flex items-center py-1.5\">\n <div className=\"flex-1 min-w-0\"><EventTopicPill topic={sub.topic || 'unset'} /></div>\n <div className=\"flex items-center gap-1.5 shrink-0\"><span className=\"text-text-quaternary text-2xs\">→</span>{sub.workflow_type ? <WorkflowPill type={sub.workflow_type} /> : <span className=\"text-2xs text-text-quaternary\">{sub.reaction_type}</span>}</div>\n </div>\n ))}\n </div>\n )}\n </Section>\n\n <Section icon={Clock} color=\"text-accent\" title={`Schedules (${form.schedules.length})`}>\n {form.schedules.length === 0 ? (\n <span className=\"text-2xs text-text-quaternary\">None configured</span>\n ) : (\n <div className=\"divide-y divide-surface-border/30\">\n {form.schedules.map((s, i) => (\n <div key={i} className=\"flex items-center py-1.5\">\n <div className=\"flex-1 min-w-0\"><CronLabel cron={s.cron} /></div>\n <div className=\"flex items-center gap-1.5 shrink-0\"><span className=\"text-text-quaternary text-2xs\">→</span>{s.workflow_type ? <WorkflowPill type={s.workflow_type} /> : <span className=\"text-2xs text-text-quaternary\">no workflow</span>}</div>\n </div>\n ))}\n </div>\n )}\n </Section>\n </div>\n\n <div className=\"border-l-2 border-status-success/30 pl-3 py-2 mt-6\">\n <p className=\"text-2xs text-text-tertiary leading-relaxed\">\n After saving, subscriptions and schedules activate immediately. You can pause the automation anytime.\n </p>\n </div>\n </div>\n );\n}\n","import { useState, useEffect, useCallback } from 'react';\nimport { useParams, useNavigate, useSearchParams } from 'react-router-dom';\nimport {\n Bot, Brain, Radio, Clock, Check, Compass,\n} from 'lucide-react';\nimport { useAgent, useCreateAgent, useUpdateAgent } from '../../../api/agents';\nimport { useAgentSubscriptions, useCreateSubscription, useUpdateSubscription, useDeleteSubscription } from '../../../api/agent-subscriptions';\nimport { useSettings } from '../../../api/settings';\nimport { getAiOverride } from '../../../lib/view-as';\nimport { PageHeader } from '../../../components/common/layout/PageHeader';\nimport {\n EMPTY_FORM,\n agentToForm,\n formToAgentPayload,\n formToSubscriptionPayloads,\n} from './agent-form-types';\nimport type { AgentFormState } from './agent-form-types';\nimport { IdentityStep } from './IdentityStep';\nimport { MotivationStep } from './MotivationStep';\nimport { KnowledgeStep } from './KnowledgeStep';\nimport { SubscriptionsStep } from './SubscriptionsStep';\nimport { ScheduleStep } from './ScheduleStep';\nimport { ReviewStep } from './ReviewStep';\n\nconst SECTIONS = [\n { id: 1, label: 'Identity', icon: Bot },\n { id: 2, label: 'Motivation', icon: Compass },\n { id: 3, label: 'Knowledge', icon: Brain },\n { id: 4, label: 'Subscriptions', icon: Radio },\n { id: 5, label: 'Schedules', icon: Clock },\n { id: 6, label: 'Review', icon: Check },\n];\n\nexport function AgentConfigPage() {\n const { id } = useParams<{ id: string }>();\n const isNew = !id;\n const navigate = useNavigate();\n const { data: settings } = useSettings();\n const aiOverride = getAiOverride();\n const aiEnabled = aiOverride !== null ? aiOverride : !!settings?.ai?.enabled;\n const noun = aiEnabled ? 'Agent' : 'Automation';\n const { data: existing, isLoading } = useAgent(isNew ? null : id!);\n const { data: subsData } = useAgentSubscriptions(isNew ? null : id!);\n\n const createAgent = useCreateAgent();\n const updateAgent = useUpdateAgent();\n const createSub = useCreateSubscription();\n const updateSub = useUpdateSubscription();\n const deleteSub = useDeleteSubscription();\n\n const [form, setForm] = useState<AgentFormState>(EMPTY_FORM);\n const [initialized, setInitialized] = useState(false);\n const [saveError, setSaveError] = useState('');\n\n const [searchParams, setSearchParams] = useSearchParams();\n const section = parseInt(searchParams.get('step') || '1', 10);\n const setSection = useCallback((s: number) => {\n setSearchParams((prev) => {\n const next = new URLSearchParams(prev);\n next.set('step', String(s));\n return next;\n }, { replace: true });\n }, [setSearchParams]);\n\n useEffect(() => {\n if (initialized) return;\n if (isNew) { setForm(EMPTY_FORM); setInitialized(true); return; }\n if (existing && subsData) {\n setForm(agentToForm(existing, subsData.subscriptions ?? []));\n setInitialized(true);\n }\n }, [existing, subsData, isNew, initialized]);\n\n const set = (field: keyof AgentFormState, value: any) =>\n setForm((f) => ({ ...f, [field]: value }));\n\n const handleSave = async () => {\n setSaveError('');\n try {\n const payload = formToAgentPayload(form);\n let agentId = id;\n\n if (isNew) {\n const created = await createAgent.mutateAsync(payload as any);\n agentId = created.id;\n } else {\n await updateAgent.mutateAsync({ id: id!, ...payload } as any);\n }\n\n const subPayloads = formToSubscriptionPayloads(form);\n const existingSubs = subsData?.subscriptions ?? [];\n const existingIds = new Set(existingSubs.map((s) => s.id));\n\n for (const sub of subPayloads) {\n if (sub.id && existingIds.has(sub.id)) {\n const { id: subId, ...rest } = sub;\n await updateSub.mutateAsync({ agentId: agentId!, subId: subId!, ...rest } as any);\n existingIds.delete(subId!);\n } else {\n const { id: _ignored, ...rest } = sub;\n await createSub.mutateAsync({ agentId: agentId!, ...rest } as any);\n }\n }\n\n for (const removedId of existingIds) {\n await deleteSub.mutateAsync({ agentId: agentId!, subId: removedId });\n }\n\n navigate(`/agents/${agentId}`);\n } catch (err: any) {\n setSaveError(err.message);\n }\n };\n\n if (!isNew && isLoading) {\n return <div className=\"animate-pulse space-y-4\"><div className=\"h-8 bg-surface-sunken rounded w-48\" /><div className=\"h-60 bg-surface-sunken rounded\" /></div>;\n }\n\n const isPending = createAgent.isPending || updateAgent.isPending;\n\n return (\n <div>\n <PageHeader\n title={isNew ? `New ${noun}` : `${noun}: ${existing?.id ?? ''}`}\n docsHash=\"#docs:agents.md\"\n />\n\n <div className=\"flex gap-10\">\n {/* Section nav — sticky left sidebar */}\n <nav className=\"w-44 shrink-0 sticky top-0 self-start pt-2\">\n <div className=\"space-y-0.5\">\n {SECTIONS.map((s) => {\n const Icon = s.icon;\n const active = section === s.id;\n return (\n <button\n key={s.id}\n onClick={() => setSection(s.id)}\n className={`w-full flex items-center gap-2.5 px-3 py-2 rounded-md text-left transition-colors ${\n active\n ? 'bg-accent/10 text-accent'\n : 'text-text-tertiary hover:text-text-primary hover:bg-surface-hover'\n }`}\n >\n <Icon className=\"w-3.5 h-3.5 shrink-0\" strokeWidth={1.5} />\n <span className=\"text-xs font-medium\">{s.label}</span>\n </button>\n );\n })}\n </div>\n\n {/* Save / Cancel — always visible */}\n <div className=\"mt-8 pt-4 border-t border-surface-border space-y-2\">\n <button\n onClick={handleSave}\n disabled={!form.name.trim() || isPending}\n className=\"w-full btn-primary text-xs disabled:opacity-50\"\n >\n {isPending ? 'Saving...' : isNew ? `Create ${noun}` : 'Save'}\n </button>\n <button\n onClick={() => navigate(isNew ? '/agents' : `/agents/${id}`)}\n className=\"w-full btn-ghost text-xs\"\n >\n Cancel\n </button>\n </div>\n\n {saveError && <p className=\"text-xs text-status-error mt-3\">{saveError}</p>}\n </nav>\n\n {/* Section content */}\n <div className=\"flex-1 min-w-0 pt-2\">\n {section === 1 && <IdentityStep form={form} set={set} />}\n {section === 2 && <MotivationStep form={form} set={set} />}\n {section === 3 && <KnowledgeStep form={form} set={set} />}\n {section === 4 && <SubscriptionsStep form={form} set={set} />}\n {section === 5 && <ScheduleStep form={form} set={set} />}\n {section === 6 && <ReviewStep form={form} />}\n </div>\n </div>\n </div>\n );\n}\n"],"names":["EMPTY_FORM","EMPTY_SUBSCRIPTION","EMPTY_SCHEDULE","agentToForm","agent","subscriptions","schedules","_b","_a","s","_c","formToAgentPayload","form","behaviors","tryParseJson","formToSubscriptionPayloads","updateMappingField","currentJson","key","fieldValue","required","parsed","isReq","isEmpty","_","rest","resolved","sectionCls","labelCls","hintCls","inputCls","jsonCls","IdentityStep","set","jsxs","jsx","BookOpen","e","MotivationStep","KnowledgeStep","domainData","useListDomains","domains","d","Brain","DateValue","CapabilityCombobox","serverId","toolName","onChange","data","useCapabilities","allTools","useMemo","c","open","setOpen","useState","filter","setFilter","inputRef","useRef","containerRef","useEffect","handleClick","displayValue","filterText","filtered","q","t","selectedTool","v","Server","LABELS","ALL_TYPES","ReactionSelector","reactionType","onReactionTypeChange","workflowType","onWorkflowTypeChange","pipelineId","onPipelineIdChange","onCapabilityChange","mcpPrompt","onMcpPromptChange","availableTypes","configs","useWorkflowConfigs","invocableWorkflows","pipelineData","useYamlWorkflows","pipelines","w","rt","active","wt","p","CATEGORY_COLORS","SubscriptionsStep","topicsData","useTopics","capData","catalogTopics","selected","setSelected","updateSub","index","field","value","next","addSub","removeSub","i","subs","sub","isComplete","selectedCatalogEntry","Radio","Plus","Trash2","TopicCombobox","sid","tn","entry","tool","props","template","RunAsSelector","op","CapabilityMappingForm","Fragment","eventSchema","jsonMode","setJsonMode","allFields","k","fields","a","b","ai","bi","eventSuggestions","suggestions","schemaProps","def","updateField","desc","fieldType","currentVal","MappingFieldInput","placeholder","items","item","j","topics","catCls","CRON_PRESETS","describeCron","expr","ScheduleStep","updateSched","addSched","removeSched","scheds","sched","Clock","Section","Icon","color","title","children","Field","label","ReviewStep","Bot","Compass","EventTopicPill","WorkflowPill","CronLabel","SECTIONS","Check","AgentConfigPage","id","useParams","isNew","navigate","useNavigate","settings","useSettings","aiOverride","getAiOverride","noun","existing","isLoading","useAgent","subsData","useAgentSubscriptions","createAgent","useCreateAgent","updateAgent","useUpdateAgent","createSub","useCreateSubscription","useUpdateSubscription","deleteSub","useDeleteSubscription","setForm","initialized","setInitialized","saveError","setSaveError","searchParams","setSearchParams","useSearchParams","section","setSection","useCallback","prev","f","handleSave","payload","agentId","subPayloads","existingSubs","existingIds","subId","_ignored","removedId","err","isPending","PageHeader"],"mappings":"i2BAwCO,MAAMA,EAA6B,CACxC,KAAM,GACN,YAAa,GACb,MAAO,GACP,MAAO,GACP,QAAS,GACT,iBAAkB,GAClB,cAAe,CAAA,EACf,UAAW,CAAA,CACb,EAIaC,GAA4C,CACvD,MAAO,GACP,OAAQ,GACR,cAAe,UACf,cAAe,GACf,YAAa,GACb,WAAY,GACZ,UAAW,GACX,UAAW,GACX,cAAe,KACf,WAAY,GACZ,QAAS,EACX,EAEaC,GAAoC,CAC/C,KAAM,YACN,cAAe,UACf,cAAe,GACf,YAAa,GACb,UAAW,GACX,UAAW,GACX,SAAU,KACV,WAAY,EACd,EA8BO,SAASC,GACdC,EACAC,EACgB,WAEhB,MAAMC,GAAiCC,GAAAC,EAAAJ,EAAM,YAAN,YAAAI,EAAiB,YAAjB,MAAAD,EAA4B,OAC9DH,EAAM,UAAU,UAAoB,IAAKK,IAAY,CACpD,KAAMA,EAAE,MAAQ,GAChB,cAAeA,EAAE,eAAiB,UAClC,cAAeA,EAAE,eAAiB,GAClC,YAAaA,EAAE,aAAe,GAC9B,UAAWA,EAAE,WAAa,GAC1B,UAAWA,EAAE,WAAa,GAC1B,SAAUA,EAAE,SAAW,KAAK,UAAUA,EAAE,SAAU,KAAM,CAAC,EAAI,KAC7D,WAAYA,EAAE,YAAc,EAAA,EAC5B,GACFC,EAAAN,EAAM,YAAN,MAAAM,EAAiB,KACf,CAAC,CAAE,KAAMN,EAAM,UAAU,KAAM,cAAe,UAAoB,cAAeA,EAAM,eAAiB,GAAI,YAAa,GAAI,UAAW,GAAI,UAAW,GAAI,SAAU,KAAM,WAAY,EAAA,CAAI,EAC3L,CAAA,EAEN,MAAO,CACL,KAAMA,EAAM,GACZ,YAAaA,EAAM,aAAe,GAClC,MAAOA,EAAM,OAAS,GACtB,MAAOA,EAAM,OAAS,GACtB,QAASA,E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