@hotmeshio/long-tail 0.19.1 → 0.20.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/build/api/workflows/config.d.ts +3 -0
- package/build/api/workflows/config.js +15 -0
- package/build/api/workflows/index.d.ts +1 -0
- package/build/api/workflows/index.js +3 -1
- package/build/api/workflows/input-lookups.d.ts +16 -0
- package/build/api/workflows/input-lookups.js +69 -0
- package/build/api/workflows/input-validation.d.ts +4 -3
- package/build/api/workflows/input-validation.js +7 -4
- package/build/api/workflows/invocable.js +1 -0
- package/build/api/workflows/invocation.js +1 -1
- package/build/lib/db/schemas/035_workflow_input_lookups.sql +9 -0
- package/build/routes/workflows/config.js +10 -0
- package/build/services/config/cache.js +1 -0
- package/build/services/config/read.js +2 -0
- package/build/services/config/sql.d.ts +2 -2
- package/build/services/config/sql.js +6 -5
- package/build/services/config/write.js +10 -1
- package/build/services/knowledge/index.d.ts +1 -0
- package/build/services/knowledge/index.js +1 -0
- package/build/services/knowledge/lookup-refs.d.ts +7 -0
- package/build/services/knowledge/lookup-refs.js +26 -0
- package/build/services/mcp/db-server/schemas.d.ts +2 -2
- package/build/shared/form-validation/field-validator.d.ts +1 -0
- package/build/shared/form-validation/field-validator.js +94 -6
- package/build/shared/form-validation/invoke-context.d.ts +4 -3
- package/build/shared/form-validation/invoke-context.js +5 -4
- package/build/shared/form-validation/x-lt-options.d.ts +3 -3
- package/build/shared/form-validation/x-lt-options.js +19 -5
- package/build/shared/form-validation/x-lt-show-if.d.ts +5 -0
- package/build/shared/form-validation/x-lt-show-if.js +10 -0
- package/build/start/workers.js +10 -0
- package/build/system/mcp-servers/admin/schemas.d.ts +64 -20
- package/build/system/mcp-servers/admin/schemas.js +19 -3
- package/build/system/mcp-servers/admin/workflow-config.js +54 -9
- package/build/system/mcp-servers/admin/workflows.js +9 -7
- package/build/system/mcp-servers/db-query/schemas.d.ts +2 -2
- package/build/system/seed/tool-manifests-admin.d.ts +517 -54
- package/build/system/seed/tool-manifests-admin.js +4 -3
- package/build/tsconfig.tsbuildinfo +1 -1
- package/build/types/config.d.ts +4 -0
- package/build/types/startup.d.ts +6 -0
- package/dashboard/dist/assets/{AdminDashboard-Drs-9TRM.js → AdminDashboard-DplvDBti.js} +2 -2
- package/dashboard/dist/assets/{AdminDashboard-Drs-9TRM.js.map → AdminDashboard-DplvDBti.js.map} +1 -1
- package/dashboard/dist/assets/{AgentConfigPage-BDPDZ7-v.js → AgentConfigPage-D8Bf6YxO.js} +2 -2
- package/dashboard/dist/assets/{AgentConfigPage-BDPDZ7-v.js.map → AgentConfigPage-D8Bf6YxO.js.map} +1 -1
- package/dashboard/dist/assets/{AgentDetailPage-CGBulM4_.js → AgentDetailPage-BN8g0Y2G.js} +2 -2
- package/dashboard/dist/assets/{AgentDetailPage-CGBulM4_.js.map → AgentDetailPage-BN8g0Y2G.js.map} +1 -1
- package/dashboard/dist/assets/{AgentsPage-D77JeViQ.js → AgentsPage-7JJBHku8.js} +2 -2
- package/dashboard/dist/assets/{AgentsPage-D77JeViQ.js.map → AgentsPage-7JJBHku8.js.map} +1 -1
- package/dashboard/dist/assets/{AvailableEscalationsPage-CqM_MOMy.js → AvailableEscalationsPage-lz5qwSjg.js} +2 -2
- package/dashboard/dist/assets/{AvailableEscalationsPage-CqM_MOMy.js.map → AvailableEscalationsPage-lz5qwSjg.js.map} +1 -1
- package/dashboard/dist/assets/{BotPicker-CC5vI_Sv.js → BotPicker-CGCnIz8I.js} +2 -2
- package/dashboard/dist/assets/{BotPicker-CC5vI_Sv.js.map → BotPicker-CGCnIz8I.js.map} +1 -1
- package/dashboard/dist/assets/{BulkAssignModal-BXiJnlqt.js → BulkAssignModal-NJBcoj-f.js} +2 -2
- package/dashboard/dist/assets/{BulkAssignModal-BXiJnlqt.js.map → BulkAssignModal-NJBcoj-f.js.map} +1 -1
- package/dashboard/dist/assets/{CapabilitiesPage-D9TC2iKy.js → CapabilitiesPage-F8dpNn9B.js} +2 -2
- package/dashboard/dist/assets/{CapabilitiesPage-D9TC2iKy.js.map → CapabilitiesPage-F8dpNn9B.js.map} +1 -1
- package/dashboard/dist/assets/{CollapsibleSection-D10lGw_u.js → CollapsibleSection-BZW6VpCU.js} +2 -2
- package/dashboard/dist/assets/{CollapsibleSection-D10lGw_u.js.map → CollapsibleSection-BZW6VpCU.js.map} +1 -1
- package/dashboard/dist/assets/{ConfirmDeleteModal-BJdLN6No.js → ConfirmDeleteModal-64adXLdq.js} +2 -2
- package/dashboard/dist/assets/{ConfirmDeleteModal-BJdLN6No.js.map → ConfirmDeleteModal-64adXLdq.js.map} +1 -1
- package/dashboard/dist/assets/{CountdownTimer-D9B-BjQ7.js → CountdownTimer-BxDub9d2.js} +2 -2
- package/dashboard/dist/assets/{CountdownTimer-D9B-BjQ7.js.map → CountdownTimer-BxDub9d2.js.map} +1 -1
- package/dashboard/dist/assets/{CredentialsPage-hniUAFBK.js → CredentialsPage-CnLzopLL.js} +2 -2
- package/dashboard/dist/assets/{CredentialsPage-hniUAFBK.js.map → CredentialsPage-CnLzopLL.js.map} +1 -1
- package/dashboard/dist/assets/{CronLabel-v9DCD2FX.js → CronLabel-CAD5UYDT.js} +2 -2
- package/dashboard/dist/assets/{CronLabel-v9DCD2FX.js.map → CronLabel-CAD5UYDT.js.map} +1 -1
- package/dashboard/dist/assets/{ElapsedCell-_xvVTK8N.js → ElapsedCell-CwO4ufd0.js} +2 -2
- package/dashboard/dist/assets/{ElapsedCell-_xvVTK8N.js.map → ElapsedCell-CwO4ufd0.js.map} +1 -1
- package/dashboard/dist/assets/{EntityTimelinePanel-1lT3jkCM.js → EntityTimelinePanel-CkF-oW-m.js} +2 -2
- package/dashboard/dist/assets/{EntityTimelinePanel-1lT3jkCM.js.map → EntityTimelinePanel-CkF-oW-m.js.map} +1 -1
- package/dashboard/dist/assets/{EscalationListSchemaPage-BeQUTUEO.js → EscalationListSchemaPage-h9JO_q5f.js} +2 -2
- package/dashboard/dist/assets/{EscalationListSchemaPage-BeQUTUEO.js.map → EscalationListSchemaPage-h9JO_q5f.js.map} +1 -1
- package/dashboard/dist/assets/{EscalationListView-uuZRMSLB.js → EscalationListView-AHW2xtlr.js} +2 -2
- package/dashboard/dist/assets/{EscalationListView-uuZRMSLB.js.map → EscalationListView-AHW2xtlr.js.map} +1 -1
- package/dashboard/dist/assets/{EscalationSchemaPage-D4VlEwyS.js → EscalationSchemaPage-mJFL5_Se.js} +2 -2
- package/dashboard/dist/assets/{EscalationSchemaPage-D4VlEwyS.js.map → EscalationSchemaPage-mJFL5_Se.js.map} +1 -1
- package/dashboard/dist/assets/{EscalationsOverview-Bx6Zrzm-.js → EscalationsOverview-DlXUFqWJ.js} +2 -2
- package/dashboard/dist/assets/{EscalationsOverview-Bx6Zrzm-.js.map → EscalationsOverview-DlXUFqWJ.js.map} +1 -1
- package/dashboard/dist/assets/{EventTable-KEC3YWBf.js → EventTable-Ike2xchn.js} +2 -2
- package/dashboard/dist/assets/{EventTable-KEC3YWBf.js.map → EventTable-Ike2xchn.js.map} +1 -1
- package/dashboard/dist/assets/{FilterBar-xwN_b5fj.js → FilterBar-DMOR-O1c.js} +2 -2
- package/dashboard/dist/assets/{FilterBar-xwN_b5fj.js.map → FilterBar-DMOR-O1c.js.map} +1 -1
- package/dashboard/dist/assets/{GraphInvokePage-DV7Y0fe2.js → GraphInvokePage-CKtvWowP.js} +2 -2
- package/dashboard/dist/assets/{GraphInvokePage-DV7Y0fe2.js.map → GraphInvokePage-CKtvWowP.js.map} +1 -1
- package/dashboard/dist/assets/{HomePage-G785SWcW.js → HomePage-BQ3Q791Q.js} +2 -2
- package/dashboard/dist/assets/{HomePage-G785SWcW.js.map → HomePage-BQ3Q791Q.js.map} +1 -1
- package/dashboard/dist/assets/{ListToolbar-zPVYPg3W.js → ListToolbar-DdJzj472.js} +2 -2
- package/dashboard/dist/assets/{ListToolbar-zPVYPg3W.js.map → ListToolbar-DdJzj472.js.map} +1 -1
- package/dashboard/dist/assets/{McpOverview-CMGUq8hx.js → McpOverview-BbtrduWn.js} +2 -2
- package/dashboard/dist/assets/{McpOverview-CMGUq8hx.js.map → McpOverview-BbtrduWn.js.map} +1 -1
- package/dashboard/dist/assets/{McpQueryDetailPage-CdhLhaKn.js → McpQueryDetailPage-C1L4T-Wt.js} +2 -2
- package/dashboard/dist/assets/{McpQueryDetailPage-CdhLhaKn.js.map → McpQueryDetailPage-C1L4T-Wt.js.map} +1 -1
- package/dashboard/dist/assets/{McpQueryPage-CNSNMagY.js → McpQueryPage-CfJy7HZ7.js} +2 -2
- package/dashboard/dist/assets/{McpQueryPage-CNSNMagY.js.map → McpQueryPage-CfJy7HZ7.js.map} +1 -1
- package/dashboard/dist/assets/{McpRunDetailPage-DBm8hUaW.js → McpRunDetailPage-CA9yv7he.js} +2 -2
- package/dashboard/dist/assets/{McpRunDetailPage-DBm8hUaW.js.map → McpRunDetailPage-CA9yv7he.js.map} +1 -1
- package/dashboard/dist/assets/{McpRunsPage-B6rb5QBf.js → McpRunsPage-D7QXjW9z.js} +2 -2
- package/dashboard/dist/assets/{McpRunsPage-B6rb5QBf.js.map → McpRunsPage-D7QXjW9z.js.map} +1 -1
- package/dashboard/dist/assets/{OperationsPage-Dxk1fAMg.js → OperationsPage-aLHHAP2X.js} +2 -2
- package/dashboard/dist/assets/{OperationsPage-Dxk1fAMg.js.map → OperationsPage-aLHHAP2X.js.map} +1 -1
- package/dashboard/dist/assets/{OperatorDashboard-DBOscDnf.js → OperatorDashboard-sXNDh1Ph.js} +2 -2
- package/dashboard/dist/assets/{OperatorDashboard-DBOscDnf.js.map → OperatorDashboard-sXNDh1Ph.js.map} +1 -1
- package/dashboard/dist/assets/{PersonaDetailPage-BGRdGpeR.js → PersonaDetailPage-NeHD-Gra.js} +2 -2
- package/dashboard/dist/assets/{PersonaDetailPage-BGRdGpeR.js.map → PersonaDetailPage-NeHD-Gra.js.map} +1 -1
- package/dashboard/dist/assets/{PersonasPage-DRzOZcVa.js → PersonasPage-DavKXRWX.js} +2 -2
- package/dashboard/dist/assets/{PersonasPage-DRzOZcVa.js.map → PersonasPage-DavKXRWX.js.map} +1 -1
- package/dashboard/dist/assets/{ProcessDetailPage-BLGjZXpM.js → ProcessDetailPage-DkdKJGe6.js} +2 -2
- package/dashboard/dist/assets/{ProcessDetailPage-BLGjZXpM.js.map → ProcessDetailPage-DkdKJGe6.js.map} +1 -1
- package/dashboard/dist/assets/{ProcessesListPage-5NnysKFC.js → ProcessesListPage-CjwVKe32.js} +2 -2
- package/dashboard/dist/assets/{ProcessesListPage-5NnysKFC.js.map → ProcessesListPage-CjwVKe32.js.map} +1 -1
- package/dashboard/dist/assets/ResolverForm-Bk-wDkN-.js +3 -0
- package/dashboard/dist/assets/ResolverForm-Bk-wDkN-.js.map +1 -0
- package/dashboard/dist/assets/{RoleDetailPage-C_LIoe1j.js → RoleDetailPage-WQt0y5l7.js} +3 -3
- package/dashboard/dist/assets/{RoleDetailPage-C_LIoe1j.js.map → RoleDetailPage-WQt0y5l7.js.map} +1 -1
- package/dashboard/dist/assets/{RolesPage-BmW1LzkU.js → RolesPage-OM9KM8Pg.js} +2 -2
- package/dashboard/dist/assets/{RolesPage-BmW1LzkU.js.map → RolesPage-OM9KM8Pg.js.map} +1 -1
- package/dashboard/dist/assets/{RunAsSelector-BwZTJ4Yj.js → RunAsSelector-fFMt1bGe.js} +2 -2
- package/dashboard/dist/assets/{RunAsSelector-BwZTJ4Yj.js.map → RunAsSelector-fFMt1bGe.js.map} +1 -1
- package/dashboard/dist/assets/ScanCodesPage-AujH-pPQ.js +2 -0
- package/dashboard/dist/assets/{ScanCodesPage-FiYIYB-m.js.map → ScanCodesPage-AujH-pPQ.js.map} +1 -1
- package/dashboard/dist/assets/{ScanSchemeDetailPage-BiAqtD-a.js → ScanSchemeDetailPage-eKQpmsC_.js} +2 -2
- package/dashboard/dist/assets/{ScanSchemeDetailPage-BiAqtD-a.js.map → ScanSchemeDetailPage-eKQpmsC_.js.map} +1 -1
- package/dashboard/dist/assets/{ScanStationPage-8CdOtbCD.js → ScanStationPage-C1_ppDoZ.js} +2 -2
- package/dashboard/dist/assets/{ScanStationPage-8CdOtbCD.js.map → ScanStationPage-C1_ppDoZ.js.map} +1 -1
- package/dashboard/dist/assets/{StickyPagination-DRuqKhZt.js → StickyPagination-B91Pk9xh.js} +2 -2
- package/dashboard/dist/assets/{StickyPagination-DRuqKhZt.js.map → StickyPagination-B91Pk9xh.js.map} +1 -1
- package/dashboard/dist/assets/{StreamMessageDetail-JwlbRiMn.js → StreamMessageDetail-C7SPqaJt.js} +2 -2
- package/dashboard/dist/assets/{StreamMessageDetail-JwlbRiMn.js.map → StreamMessageDetail-C7SPqaJt.js.map} +1 -1
- package/dashboard/dist/assets/{SwimlaneTimeline-hu3c4bCJ.js → SwimlaneTimeline-BcHR8ylf.js} +2 -2
- package/dashboard/dist/assets/{SwimlaneTimeline-hu3c4bCJ.js.map → SwimlaneTimeline-BcHR8ylf.js.map} +1 -1
- package/dashboard/dist/assets/{TaskDetailPage-NqVZF3jW.js → TaskDetailPage-Bqj0I_I0.js} +2 -2
- package/dashboard/dist/assets/{TaskDetailPage-NqVZF3jW.js.map → TaskDetailPage-Bqj0I_I0.js.map} +1 -1
- package/dashboard/dist/assets/{TasksListPage-BQNaSzCn.js → TasksListPage-BB1f79lL.js} +2 -2
- package/dashboard/dist/assets/{TasksListPage-BQNaSzCn.js.map → TasksListPage-BB1f79lL.js.map} +1 -1
- package/dashboard/dist/assets/{TimeAgo-Cv35DOiI.js → TimeAgo-BFnODmNe.js} +2 -2
- package/dashboard/dist/assets/{TimeAgo-Cv35DOiI.js.map → TimeAgo-BFnODmNe.js.map} +1 -1
- package/dashboard/dist/assets/{TimestampCell-DHUXey9s.js → TimestampCell-BXgLOBsr.js} +2 -2
- package/dashboard/dist/assets/{TimestampCell-DHUXey9s.js.map → TimestampCell-BXgLOBsr.js.map} +1 -1
- package/dashboard/dist/assets/{ToolTestPanel-DvuLFWqQ.js → ToolTestPanel-Bwe3J5lj.js} +2 -2
- package/dashboard/dist/assets/{ToolTestPanel-DvuLFWqQ.js.map → ToolTestPanel-Bwe3J5lj.js.map} +1 -1
- package/dashboard/dist/assets/{TopicDetailPage-TXX3QNSo.js → TopicDetailPage-DAF07vZ9.js} +2 -2
- package/dashboard/dist/assets/{TopicDetailPage-TXX3QNSo.js.map → TopicDetailPage-DAF07vZ9.js.map} +1 -1
- package/dashboard/dist/assets/{TopicsPage-h-oyTeEJ.js → TopicsPage-C1gxBUap.js} +2 -2
- package/dashboard/dist/assets/{TopicsPage-h-oyTeEJ.js.map → TopicsPage-C1gxBUap.js.map} +1 -1
- package/dashboard/dist/assets/{UserName-BceRCeDF.js → UserName-BzXJUE6q.js} +2 -2
- package/dashboard/dist/assets/{UserName-BceRCeDF.js.map → UserName-BzXJUE6q.js.map} +1 -1
- package/dashboard/dist/assets/{WorkflowExecutionPage-CmHGcaN9.js → WorkflowExecutionPage-SkRU5cRX.js} +2 -2
- package/dashboard/dist/assets/{WorkflowExecutionPage-CmHGcaN9.js.map → WorkflowExecutionPage-SkRU5cRX.js.map} +1 -1
- package/dashboard/dist/assets/{WorkflowsDashboard-B0r2lQXk.js → WorkflowsDashboard-CZAqRk1N.js} +2 -2
- package/dashboard/dist/assets/{WorkflowsDashboard-B0r2lQXk.js.map → WorkflowsDashboard-CZAqRk1N.js.map} +1 -1
- package/dashboard/dist/assets/{WorkflowsOverview-BTMc2PJ_.js → WorkflowsOverview-BoN44VTE.js} +2 -2
- package/dashboard/dist/assets/{WorkflowsOverview-BTMc2PJ_.js.map → WorkflowsOverview-BoN44VTE.js.map} +1 -1
- package/dashboard/dist/assets/{YamlWorkflowDetailPage-DUiCVnZp.js → YamlWorkflowDetailPage-CqjhtdJf.js} +2 -2
- package/dashboard/dist/assets/{YamlWorkflowDetailPage-DUiCVnZp.js.map → YamlWorkflowDetailPage-CqjhtdJf.js.map} +1 -1
- package/dashboard/dist/assets/{YamlWorkflowsPage-BAuXfwi0.js → YamlWorkflowsPage-CwnJkzyb.js} +2 -2
- package/dashboard/dist/assets/{YamlWorkflowsPage-BAuXfwi0.js.map → YamlWorkflowsPage-CwnJkzyb.js.map} +1 -1
- package/dashboard/dist/assets/{agents-BvmLCk4h.js → agents-gV0Ys-sY.js} +2 -2
- package/dashboard/dist/assets/{agents-BvmLCk4h.js.map → agents-gV0Ys-sY.js.map} +1 -1
- package/dashboard/dist/assets/{bots-f_tyhl4I.js → bots-B97itB3I.js} +2 -2
- package/dashboard/dist/assets/{bots-f_tyhl4I.js.map → bots-B97itB3I.js.map} +1 -1
- package/dashboard/dist/assets/{capabilities-DNo5bqLx.js → capabilities-CR9xZgGd.js} +2 -2
- package/dashboard/dist/assets/{capabilities-DNo5bqLx.js.map → capabilities-CR9xZgGd.js.map} +1 -1
- package/dashboard/dist/assets/{controlplane-Dyyj2Irb.js → controlplane-YxvP1KCa.js} +2 -2
- package/dashboard/dist/assets/{controlplane-Dyyj2Irb.js.map → controlplane-YxvP1KCa.js.map} +1 -1
- package/dashboard/dist/assets/{escalation-columns-DIigeTOK.js → escalation-columns-uq-IV2aj.js} +2 -2
- package/dashboard/dist/assets/{escalation-columns-DIigeTOK.js.map → escalation-columns-uq-IV2aj.js.map} +1 -1
- package/dashboard/dist/assets/index-3ezfWLkE.js +6 -0
- package/dashboard/dist/assets/index-3ezfWLkE.js.map +1 -0
- package/dashboard/dist/assets/{index-CsKiRyhy.js → index-B9BBCqLI.js} +2 -2
- package/dashboard/dist/assets/{index-CsKiRyhy.js.map → index-B9BBCqLI.js.map} +1 -1
- package/dashboard/dist/assets/{index-DL83W7Gu.js → index-BQpV-DTG.js} +2 -2
- package/dashboard/dist/assets/{index-DL83W7Gu.js.map → index-BQpV-DTG.js.map} +1 -1
- package/dashboard/dist/assets/index-Bp9KBLT5.js +2 -0
- package/dashboard/dist/assets/{index-D7ESqn22.js.map → index-Bp9KBLT5.js.map} +1 -1
- package/dashboard/dist/assets/{index-DvxxrFBo.js → index-CFbo9FU9.js} +2 -2
- package/dashboard/dist/assets/{index-DvxxrFBo.js.map → index-CFbo9FU9.js.map} +1 -1
- package/dashboard/dist/assets/{index-e2X-s0EQ.js → index-CIpHj4di.js} +2 -2
- package/dashboard/dist/assets/{index-e2X-s0EQ.js.map → index-CIpHj4di.js.map} +1 -1
- package/dashboard/dist/assets/{index-BMlQYOE1.js → index-CIwlVfvV.js} +10 -10
- package/dashboard/dist/assets/index-CIwlVfvV.js.map +1 -0
- package/dashboard/dist/assets/{index-BNZknxFY.js → index-CUZ6LYye.js} +2 -2
- package/dashboard/dist/assets/{index-BNZknxFY.js.map → index-CUZ6LYye.js.map} +1 -1
- package/dashboard/dist/assets/index-Cfvkl2J0.js +13 -0
- package/dashboard/dist/assets/index-Cfvkl2J0.js.map +1 -0
- package/dashboard/dist/assets/{index-DWse7ERF.js → index-DMeaiKgf.js} +2 -2
- package/dashboard/dist/assets/{index-DWse7ERF.js.map → index-DMeaiKgf.js.map} +1 -1
- package/dashboard/dist/assets/{index-C-Xr2V3F.js → index-DwOnWeu8.js} +2 -2
- package/dashboard/dist/assets/{index-C-Xr2V3F.js.map → index-DwOnWeu8.js.map} +1 -1
- package/dashboard/dist/assets/index-SGyrXGp8.js +3 -0
- package/dashboard/dist/assets/{index-CegPUKpc.js.map → index-SGyrXGp8.js.map} +1 -1
- package/dashboard/dist/assets/{index-PcyGjmBm.js → index-ipqwPavs.js} +2 -2
- package/dashboard/dist/assets/{index-PcyGjmBm.js.map → index-ipqwPavs.js.map} +1 -1
- package/dashboard/dist/assets/invoke-context-DrVyUEfs.js +2 -0
- package/dashboard/dist/assets/invoke-context-DrVyUEfs.js.map +1 -0
- package/dashboard/dist/assets/{knowledge-Coo6CKzo.js → knowledge-XX6cW4Ob.js} +2 -2
- package/dashboard/dist/assets/{knowledge-Coo6CKzo.js.map → knowledge-XX6cW4Ob.js.map} +1 -1
- package/dashboard/dist/assets/{mcp-Cz5eFnP_.js → mcp-CH13hNH2.js} +2 -2
- package/dashboard/dist/assets/{mcp-Cz5eFnP_.js.map → mcp-CH13hNH2.js.map} +1 -1
- package/dashboard/dist/assets/{mcp-query-BtnuO4LF.js → mcp-query-Duydd3JA.js} +2 -2
- package/dashboard/dist/assets/{mcp-query-BtnuO4LF.js.map → mcp-query-Duydd3JA.js.map} +1 -1
- package/dashboard/dist/assets/{personas-C2-LgpHQ.js → personas-mDk4lLQS.js} +2 -2
- package/dashboard/dist/assets/{personas-C2-LgpHQ.js.map → personas-mDk4lLQS.js.map} +1 -1
- package/dashboard/dist/assets/{pipelines-TuXQvUA-.js → pipelines-B5GcgCeF.js} +2 -2
- package/dashboard/dist/assets/{pipelines-TuXQvUA-.js.map → pipelines-B5GcgCeF.js.map} +1 -1
- package/dashboard/dist/assets/{resolver-payload-C1dXB3n6.js → resolver-payload-m9AGKZ3a.js} +2 -2
- package/dashboard/dist/assets/{resolver-payload-C1dXB3n6.js.map → resolver-payload-m9AGKZ3a.js.map} +1 -1
- package/dashboard/dist/assets/{tasks-OUzpu__z.js → tasks-CItmNsRp.js} +2 -2
- package/dashboard/dist/assets/{tasks-OUzpu__z.js.map → tasks-CItmNsRp.js.map} +1 -1
- package/dashboard/dist/assets/{topics-B8bdrBaW.js → topics-CJYG7BX5.js} +2 -2
- package/dashboard/dist/assets/{topics-B8bdrBaW.js.map → topics-CJYG7BX5.js.map} +1 -1
- package/dashboard/dist/assets/{useDebouncedValue-Cp5ZOtVE.js → useDebouncedValue-BrwgXcp8.js} +2 -2
- package/dashboard/dist/assets/{useDebouncedValue-Cp5ZOtVE.js.map → useDebouncedValue-BrwgXcp8.js.map} +1 -1
- package/dashboard/dist/assets/{useNamespace-DtQe3wZ5.js → useNamespace-CHty0HAS.js} +2 -2
- package/dashboard/dist/assets/{useNamespace-DtQe3wZ5.js.map → useNamespace-CHty0HAS.js.map} +1 -1
- package/dashboard/dist/assets/{useYamlActivityEvents-CS22c15X.js → useYamlActivityEvents-CoTsia7t.js} +2 -2
- package/dashboard/dist/assets/{useYamlActivityEvents-CS22c15X.js.map → useYamlActivityEvents-CoTsia7t.js.map} +1 -1
- package/dashboard/dist/assets/{yaml-workflows-HQIki3hI.js → yaml-workflows-CiWwx5rM.js} +2 -2
- package/dashboard/dist/assets/{yaml-workflows-HQIki3hI.js.map → yaml-workflows-CiWwx5rM.js.map} +1 -1
- package/dashboard/dist/index.html +1 -1
- package/docs/api/http/workflows.md +28 -1
- package/docs/api/mcp/admin.md +40 -4
- package/docs/code-owned-configuration.md +1 -1
- package/docs/dashboard.md +1 -1
- package/docs/design-principles.md +6 -5
- package/docs/hitl/form.md +12 -7
- package/docs/hitl/invoke-form.md +6 -3
- package/docs/hitl/lookups.md +21 -0
- package/docs/hitl/x-lt-validation.md +50 -3
- package/docs/hitl/x-lt-widget.md +21 -0
- package/docs/hitl-guide.md +5 -2
- package/package.json +1 -1
- package/dashboard/dist/assets/ResolverForm-Dy0yirtP.js +0 -2
- package/dashboard/dist/assets/ResolverForm-Dy0yirtP.js.map +0 -1
- package/dashboard/dist/assets/ScanCodesPage-FiYIYB-m.js +0 -2
- package/dashboard/dist/assets/index-BMlQYOE1.js.map +0 -1
- package/dashboard/dist/assets/index-CegPUKpc.js +0 -3
- package/dashboard/dist/assets/index-D7ESqn22.js +0 -2
- package/dashboard/dist/assets/index-DPLssnMW.js +0 -6
- package/dashboard/dist/assets/index-DPLssnMW.js.map +0 -1
- package/dashboard/dist/assets/index-DoETPlJP.js +0 -11
- package/dashboard/dist/assets/index-DoETPlJP.js.map +0 -1
- package/dashboard/dist/assets/seed-form-json-DvPsISxD.js +0 -2
- package/dashboard/dist/assets/seed-form-json-DvPsISxD.js.map +0 -1
package/dashboard/dist/assets/{yaml-workflows-HQIki3hI.js.map → yaml-workflows-CiWwx5rM.js.map}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"yaml-workflows-HQIki3hI.js","sources":["../../src/api/yaml-workflows.ts"],"sourcesContent":["import { useQuery, useMutation, useQueryClient } from '@tanstack/react-query';\nimport { apiFetch } from './client';\nimport type { LTYamlWorkflowRecord, LTYamlWorkflowStatus, LTYamlWorkflowVersion } from './types';\n\ninterface YamlWorkflowListResponse {\n workflows: LTYamlWorkflowRecord[];\n total: number;\n}\n\ninterface YamlWorkflowFilters {\n status?: LTYamlWorkflowStatus;\n graph_topic?: string;\n app_id?: string;\n search?: string;\n set_id?: string;\n limit?: number;\n offset?: number;\n}\n\nexport function useYamlWorkflows(filters: YamlWorkflowFilters = {}) {\n const params = new URLSearchParams();\n if (filters.status) params.set('status', filters.status);\n if (filters.graph_topic) params.set('graph_topic', filters.graph_topic);\n if (filters.app_id) params.set('app_id', filters.app_id);\n if (filters.search) params.set('search', filters.search);\n if (filters.set_id) params.set('set_id', filters.set_id);\n if (filters.limit) params.set('limit', String(filters.limit));\n if (filters.offset !== undefined) params.set('offset', String(filters.offset));\n\n return useQuery<YamlWorkflowListResponse>({\n queryKey: ['yamlWorkflows', filters],\n queryFn: () => apiFetch(`/yaml-workflows?${params}`),\n });\n}\n\nexport function useYamlWorkflowAppIds() {\n return useQuery<{ app_ids: string[] }>({\n queryKey: ['yamlWorkflowAppIds'],\n queryFn: () => apiFetch('/yaml-workflows/app-ids'),\n });\n}\n\nexport function useYamlWorkflowByTopic(graphTopic: string | undefined, appId?: string) {\n return useQuery<YamlWorkflowListResponse>({\n queryKey: ['yamlWorkflows', 'byTopic', graphTopic, appId],\n queryFn: () => {\n const params = new URLSearchParams({ graph_topic: graphTopic!, limit: '1' });\n if (appId) params.set('app_id', appId);\n return apiFetch(`/yaml-workflows?${params}`);\n },\n enabled: !!graphTopic,\n });\n}\n\nexport function useYamlWorkflow(id: string) {\n return useQuery<LTYamlWorkflowRecord>({\n queryKey: ['yamlWorkflows', id],\n queryFn: () => apiFetch(`/yaml-workflows/${id}`),\n enabled: !!id,\n });\n}\n\nexport function useCreateYamlWorkflow() {\n const queryClient = useQueryClient();\n return useMutation({\n mutationFn: (input: {\n workflow_id: string;\n task_queue: string;\n workflow_name: string;\n name: string;\n description?: string;\n app_id?: string;\n subscribes?: string;\n tags?: string[];\n compilation_feedback?: string;\n }) =>\n apiFetch<LTYamlWorkflowRecord>('/yaml-workflows', {\n method: 'POST',\n body: JSON.stringify(input),\n }),\n onSuccess: () => {\n queryClient.invalidateQueries({ queryKey: ['yamlWorkflows'], refetchType: 'all' });\n },\n });\n}\n\nexport function useDeployYamlWorkflow() {\n const queryClient = useQueryClient();\n return useMutation({\n mutationFn: (id: string) =>\n apiFetch<LTYamlWorkflowRecord>(`/yaml-workflows/${id}/deploy`, {\n method: 'POST',\n }),\n onSuccess: () => {\n queryClient.invalidateQueries({ queryKey: ['yamlWorkflows'], refetchType: 'all' });\n },\n });\n}\n\nexport function useActivateYamlWorkflow() {\n const queryClient = useQueryClient();\n return useMutation({\n mutationFn: (id: string) =>\n apiFetch<LTYamlWorkflowRecord>(`/yaml-workflows/${id}/activate`, {\n method: 'POST',\n }),\n onSuccess: () => {\n queryClient.invalidateQueries({ queryKey: ['yamlWorkflows'], refetchType: 'all' });\n },\n });\n}\n\nexport function useInvokeYamlWorkflow() {\n const queryClient = useQueryClient();\n return useMutation({\n mutationFn: ({ id, data, sync, execute_as }: { id: string; data: Record<string, unknown>; sync?: boolean; execute_as?: string }) =>\n apiFetch<{ result?: unknown; job_id?: string }>(`/yaml-workflows/${id}/invoke`, {\n method: 'POST',\n body: JSON.stringify({ data, sync, ...(execute_as ? { execute_as } : {}) }),\n }),\n onSuccess: () => {\n queryClient.invalidateQueries({ queryKey: ['yamlWorkflows'], refetchType: 'all' });\n },\n });\n}\n\nexport function useRegenerateYamlWorkflow() {\n const queryClient = useQueryClient();\n return useMutation({\n mutationFn: ({ id, task_queue, compilation_feedback }: { id: string; task_queue?: string; compilation_feedback?: string }) =>\n apiFetch<LTYamlWorkflowRecord>(`/yaml-workflows/${id}/regenerate`, {\n method: 'POST',\n body: JSON.stringify({ task_queue, compilation_feedback }),\n }),\n onSuccess: () => {\n queryClient.invalidateQueries({ queryKey: ['yamlWorkflows'], refetchType: 'all' });\n },\n });\n}\n\nexport function useArchiveYamlWorkflow() {\n const queryClient = useQueryClient();\n return useMutation({\n mutationFn: (id: string) =>\n apiFetch<LTYamlWorkflowRecord>(`/yaml-workflows/${id}/archive`, {\n method: 'POST',\n }),\n onSuccess: () => {\n queryClient.invalidateQueries({ queryKey: ['yamlWorkflows'], refetchType: 'all' });\n },\n });\n}\n\nexport function useRestoreYamlWorkflow() {\n const queryClient = useQueryClient();\n return useMutation({\n mutationFn: (id: string) =>\n apiFetch<LTYamlWorkflowRecord>(`/yaml-workflows/${id}/restore`, {\n method: 'POST',\n }),\n onSuccess: () => {\n queryClient.invalidateQueries({ queryKey: ['yamlWorkflows'], refetchType: 'all' });\n queryClient.invalidateQueries({ queryKey: ['yamlWorkflow'], refetchType: 'all' });\n },\n });\n}\n\nexport function useUpdateYamlWorkflow() {\n const queryClient = useQueryClient();\n return useMutation({\n mutationFn: ({ id, ...updates }: { id: string; yaml_content?: string; name?: string; description?: string; input_schema?: Record<string, unknown>; output_schema?: Record<string, unknown>; tags?: string[]; app_id?: string; graph_topic?: string }) =>\n apiFetch<LTYamlWorkflowRecord>(`/yaml-workflows/${id}`, {\n method: 'PUT',\n body: JSON.stringify(updates),\n }),\n onSuccess: () => {\n queryClient.invalidateQueries({ queryKey: ['yamlWorkflows'], refetchType: 'all' });\n },\n });\n}\n\nexport function useDeleteYamlWorkflow() {\n const queryClient = useQueryClient();\n return useMutation({\n mutationFn: (id: string) =>\n apiFetch<{ deleted: boolean }>(`/yaml-workflows/${id}`, {\n method: 'DELETE',\n }),\n onSuccess: () => {\n queryClient.invalidateQueries({ queryKey: ['yamlWorkflows'], refetchType: 'all' });\n },\n });\n}\n\n// ── Cron scheduling ─────────────────────────────────────────────\n\nexport function useSetYamlCron() {\n const queryClient = useQueryClient();\n return useMutation({\n mutationFn: ({ id, cron_schedule, cron_envelope, execute_as }: {\n id: string;\n cron_schedule: string;\n cron_envelope?: Record<string, unknown> | null;\n execute_as?: string | null;\n }) =>\n apiFetch<LTYamlWorkflowRecord>(`/yaml-workflows/${id}/cron`, {\n method: 'PUT',\n body: JSON.stringify({ cron_schedule, cron_envelope, execute_as }),\n }),\n onSuccess: () => {\n queryClient.invalidateQueries({ queryKey: ['yamlWorkflows'], refetchType: 'all' });\n },\n });\n}\n\nexport function useClearYamlCron() {\n const queryClient = useQueryClient();\n return useMutation({\n mutationFn: (id: string) =>\n apiFetch<LTYamlWorkflowRecord>(`/yaml-workflows/${id}/cron`, {\n method: 'DELETE',\n }),\n onSuccess: () => {\n queryClient.invalidateQueries({ queryKey: ['yamlWorkflows'], refetchType: 'all' });\n },\n });\n}\n\n// ── Version history ─────────────────────────────────────────────\n\nexport function useYamlWorkflowVersions(id: string) {\n return useQuery<{ versions: LTYamlWorkflowVersion[]; total: number }>({\n queryKey: ['yamlWorkflows', id, 'versions'],\n queryFn: () => apiFetch(`/yaml-workflows/${id}/versions`),\n enabled: !!id,\n });\n}\n\nexport function useYamlWorkflowVersion(id: string, version: number | null) {\n return useQuery<LTYamlWorkflowVersion>({\n queryKey: ['yamlWorkflows', id, 'versions', version],\n queryFn: () => apiFetch(`/yaml-workflows/${id}/versions/${version}`),\n enabled: !!id && version !== null,\n });\n}\n"],"names":["useYamlWorkflows","filters","params","useQuery","apiFetch","useYamlWorkflowAppIds","useYamlWorkflow","id","useCreateYamlWorkflow","queryClient","useQueryClient","useMutation","input","useDeployYamlWorkflow","useActivateYamlWorkflow","useInvokeYamlWorkflow","data","sync","execute_as","useRegenerateYamlWorkflow","task_queue","compilation_feedback","useArchiveYamlWorkflow","useRestoreYamlWorkflow","useUpdateYamlWorkflow","updates","useDeleteYamlWorkflow","useYamlWorkflowVersions","useYamlWorkflowVersion","version"],"mappings":"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"}
|
|
1
|
+
{"version":3,"file":"yaml-workflows-CiWwx5rM.js","sources":["../../src/api/yaml-workflows.ts"],"sourcesContent":["import { useQuery, useMutation, useQueryClient } from '@tanstack/react-query';\nimport { apiFetch } from './client';\nimport type { LTYamlWorkflowRecord, LTYamlWorkflowStatus, LTYamlWorkflowVersion } from './types';\n\ninterface YamlWorkflowListResponse {\n workflows: LTYamlWorkflowRecord[];\n total: number;\n}\n\ninterface YamlWorkflowFilters {\n status?: LTYamlWorkflowStatus;\n graph_topic?: string;\n app_id?: string;\n search?: string;\n set_id?: string;\n limit?: number;\n offset?: number;\n}\n\nexport function useYamlWorkflows(filters: YamlWorkflowFilters = {}) {\n const params = new URLSearchParams();\n if (filters.status) params.set('status', filters.status);\n if (filters.graph_topic) params.set('graph_topic', filters.graph_topic);\n if (filters.app_id) params.set('app_id', filters.app_id);\n if (filters.search) params.set('search', filters.search);\n if (filters.set_id) params.set('set_id', filters.set_id);\n if (filters.limit) params.set('limit', String(filters.limit));\n if (filters.offset !== undefined) params.set('offset', String(filters.offset));\n\n return useQuery<YamlWorkflowListResponse>({\n queryKey: ['yamlWorkflows', filters],\n queryFn: () => apiFetch(`/yaml-workflows?${params}`),\n });\n}\n\nexport function useYamlWorkflowAppIds() {\n return useQuery<{ app_ids: string[] }>({\n queryKey: ['yamlWorkflowAppIds'],\n queryFn: () => apiFetch('/yaml-workflows/app-ids'),\n });\n}\n\nexport function useYamlWorkflowByTopic(graphTopic: string | undefined, appId?: string) {\n return useQuery<YamlWorkflowListResponse>({\n queryKey: ['yamlWorkflows', 'byTopic', graphTopic, appId],\n queryFn: () => {\n const params = new URLSearchParams({ graph_topic: graphTopic!, limit: '1' });\n if (appId) params.set('app_id', appId);\n return apiFetch(`/yaml-workflows?${params}`);\n },\n enabled: !!graphTopic,\n });\n}\n\nexport function useYamlWorkflow(id: string) {\n return useQuery<LTYamlWorkflowRecord>({\n queryKey: ['yamlWorkflows', id],\n queryFn: () => apiFetch(`/yaml-workflows/${id}`),\n enabled: !!id,\n });\n}\n\nexport function useCreateYamlWorkflow() {\n const queryClient = useQueryClient();\n return useMutation({\n mutationFn: (input: {\n workflow_id: string;\n task_queue: string;\n workflow_name: string;\n name: string;\n description?: string;\n app_id?: string;\n subscribes?: string;\n tags?: string[];\n compilation_feedback?: string;\n }) =>\n apiFetch<LTYamlWorkflowRecord>('/yaml-workflows', {\n method: 'POST',\n body: JSON.stringify(input),\n }),\n onSuccess: () => {\n queryClient.invalidateQueries({ queryKey: ['yamlWorkflows'], refetchType: 'all' });\n },\n });\n}\n\nexport function useDeployYamlWorkflow() {\n const queryClient = useQueryClient();\n return useMutation({\n mutationFn: (id: string) =>\n apiFetch<LTYamlWorkflowRecord>(`/yaml-workflows/${id}/deploy`, {\n method: 'POST',\n }),\n onSuccess: () => {\n queryClient.invalidateQueries({ queryKey: ['yamlWorkflows'], refetchType: 'all' });\n },\n });\n}\n\nexport function useActivateYamlWorkflow() {\n const queryClient = useQueryClient();\n return useMutation({\n mutationFn: (id: string) =>\n apiFetch<LTYamlWorkflowRecord>(`/yaml-workflows/${id}/activate`, {\n method: 'POST',\n }),\n onSuccess: () => {\n queryClient.invalidateQueries({ queryKey: ['yamlWorkflows'], refetchType: 'all' });\n },\n });\n}\n\nexport function useInvokeYamlWorkflow() {\n const queryClient = useQueryClient();\n return useMutation({\n mutationFn: ({ id, data, sync, execute_as }: { id: string; data: Record<string, unknown>; sync?: boolean; execute_as?: string }) =>\n apiFetch<{ result?: unknown; job_id?: string }>(`/yaml-workflows/${id}/invoke`, {\n method: 'POST',\n body: JSON.stringify({ data, sync, ...(execute_as ? { execute_as } : {}) }),\n }),\n onSuccess: () => {\n queryClient.invalidateQueries({ queryKey: ['yamlWorkflows'], refetchType: 'all' });\n },\n });\n}\n\nexport function useRegenerateYamlWorkflow() {\n const queryClient = useQueryClient();\n return useMutation({\n mutationFn: ({ id, task_queue, compilation_feedback }: { id: string; task_queue?: string; compilation_feedback?: string }) =>\n apiFetch<LTYamlWorkflowRecord>(`/yaml-workflows/${id}/regenerate`, {\n method: 'POST',\n body: JSON.stringify({ task_queue, compilation_feedback }),\n }),\n onSuccess: () => {\n queryClient.invalidateQueries({ queryKey: ['yamlWorkflows'], refetchType: 'all' });\n },\n });\n}\n\nexport function useArchiveYamlWorkflow() {\n const queryClient = useQueryClient();\n return useMutation({\n mutationFn: (id: string) =>\n apiFetch<LTYamlWorkflowRecord>(`/yaml-workflows/${id}/archive`, {\n method: 'POST',\n }),\n onSuccess: () => {\n queryClient.invalidateQueries({ queryKey: ['yamlWorkflows'], refetchType: 'all' });\n },\n });\n}\n\nexport function useRestoreYamlWorkflow() {\n const queryClient = useQueryClient();\n return useMutation({\n mutationFn: (id: string) =>\n apiFetch<LTYamlWorkflowRecord>(`/yaml-workflows/${id}/restore`, {\n method: 'POST',\n }),\n onSuccess: () => {\n queryClient.invalidateQueries({ queryKey: ['yamlWorkflows'], refetchType: 'all' });\n queryClient.invalidateQueries({ queryKey: ['yamlWorkflow'], refetchType: 'all' });\n },\n });\n}\n\nexport function useUpdateYamlWorkflow() {\n const queryClient = useQueryClient();\n return useMutation({\n mutationFn: ({ id, ...updates }: { id: string; yaml_content?: string; name?: string; description?: string; input_schema?: Record<string, unknown>; output_schema?: Record<string, unknown>; tags?: string[]; app_id?: string; graph_topic?: string }) =>\n apiFetch<LTYamlWorkflowRecord>(`/yaml-workflows/${id}`, {\n method: 'PUT',\n body: JSON.stringify(updates),\n }),\n onSuccess: () => {\n queryClient.invalidateQueries({ queryKey: ['yamlWorkflows'], refetchType: 'all' });\n },\n });\n}\n\nexport function useDeleteYamlWorkflow() {\n const queryClient = useQueryClient();\n return useMutation({\n mutationFn: (id: string) =>\n apiFetch<{ deleted: boolean }>(`/yaml-workflows/${id}`, {\n method: 'DELETE',\n }),\n onSuccess: () => {\n queryClient.invalidateQueries({ queryKey: ['yamlWorkflows'], refetchType: 'all' });\n },\n });\n}\n\n// ── Cron scheduling ─────────────────────────────────────────────\n\nexport function useSetYamlCron() {\n const queryClient = useQueryClient();\n return useMutation({\n mutationFn: ({ id, cron_schedule, cron_envelope, execute_as }: {\n id: string;\n cron_schedule: string;\n cron_envelope?: Record<string, unknown> | null;\n execute_as?: string | null;\n }) =>\n apiFetch<LTYamlWorkflowRecord>(`/yaml-workflows/${id}/cron`, {\n method: 'PUT',\n body: JSON.stringify({ cron_schedule, cron_envelope, execute_as }),\n }),\n onSuccess: () => {\n queryClient.invalidateQueries({ queryKey: ['yamlWorkflows'], refetchType: 'all' });\n },\n });\n}\n\nexport function useClearYamlCron() {\n const queryClient = useQueryClient();\n return useMutation({\n mutationFn: (id: string) =>\n apiFetch<LTYamlWorkflowRecord>(`/yaml-workflows/${id}/cron`, {\n method: 'DELETE',\n }),\n onSuccess: () => {\n queryClient.invalidateQueries({ queryKey: ['yamlWorkflows'], refetchType: 'all' });\n },\n });\n}\n\n// ── Version history ─────────────────────────────────────────────\n\nexport function useYamlWorkflowVersions(id: string) {\n return useQuery<{ versions: LTYamlWorkflowVersion[]; total: number }>({\n queryKey: ['yamlWorkflows', id, 'versions'],\n queryFn: () => apiFetch(`/yaml-workflows/${id}/versions`),\n enabled: !!id,\n });\n}\n\nexport function useYamlWorkflowVersion(id: string, version: number | null) {\n return useQuery<LTYamlWorkflowVersion>({\n queryKey: ['yamlWorkflows', id, 'versions', version],\n queryFn: () => apiFetch(`/yaml-workflows/${id}/versions/${version}`),\n enabled: !!id && version !== null,\n });\n}\n"],"names":["useYamlWorkflows","filters","params","useQuery","apiFetch","useYamlWorkflowAppIds","useYamlWorkflow","id","useCreateYamlWorkflow","queryClient","useQueryClient","useMutation","input","useDeployYamlWorkflow","useActivateYamlWorkflow","useInvokeYamlWorkflow","data","sync","execute_as","useRegenerateYamlWorkflow","task_queue","compilation_feedback","useArchiveYamlWorkflow","useRestoreYamlWorkflow","useUpdateYamlWorkflow","updates","useDeleteYamlWorkflow","useYamlWorkflowVersions","useYamlWorkflowVersion","version"],"mappings":"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"}
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
<link rel="preconnect" href="https://fonts.googleapis.com" />
|
|
9
9
|
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
|
|
10
10
|
<link href="https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap" rel="stylesheet" />
|
|
11
|
-
<script type="module" crossorigin src="./assets/index-
|
|
11
|
+
<script type="module" crossorigin src="./assets/index-CIwlVfvV.js"></script>
|
|
12
12
|
<link rel="modulepreload" crossorigin href="./assets/vendor-query-DvWWuNIB.js">
|
|
13
13
|
<link rel="modulepreload" crossorigin href="./assets/vendor-react-_9U4mKFr.js">
|
|
14
14
|
<link rel="modulepreload" crossorigin href="./assets/vendor-icons-DeBdvyKJ.js">
|
|
@@ -141,6 +141,7 @@ PUT /api/workflows/:type/config
|
|
|
141
141
|
| `tool_tags` | `string[]` | `[]` | MCP tool tags for scoped tool discovery |
|
|
142
142
|
| `envelope_schema` | `object \| null` | `null` | Example envelope that pre-fills the legacy invoke form |
|
|
143
143
|
| `input_schema` | `object \| null` | `null` | x-lt-* JSON Schema for the rich invoke form; `POST /:type/invoke` validates `data` against it. See [Invoke forms](../../hitl/invoke-form.md). |
|
|
144
|
+
| `input_lookups` | `{ domain, key, version, as? }[] \| null` | `null` | Versioned knowledge refs the invoke form reads as `lookup.<as ?? key>`; malformed refs are refused with `400`. See [Lookups](../../hitl/lookups.md#pinning-on-a-workflow-config). |
|
|
144
145
|
| `icon` | `string \| null` | `null` | Curated icon name from `WORKFLOW_ICONS`; unknown names are refused with `400` |
|
|
145
146
|
| `resolver_schema` | `object \| null` | `null` | **Deprecated** legacy fallback only. The escalation form is owned by the target role as a versioned `form_schema`. |
|
|
146
147
|
| `cron_schedule` | `string \| null` | `null` | Cron expression for scheduled execution (e.g., `"0 9 * * *"`) |
|
|
@@ -162,6 +163,29 @@ PUT /api/workflows/:type/config
|
|
|
162
163
|
|
|
163
164
|
This endpoint is idempotent. It replaces the entire configuration, including roles and invocation roles (cascade delete + re-insert). It also invalidates the in-memory config cache.
|
|
164
165
|
|
|
166
|
+
### Resolve a workflow's input lookups
|
|
167
|
+
|
|
168
|
+
```
|
|
169
|
+
GET /api/workflows/:type/input-lookups
|
|
170
|
+
```
|
|
171
|
+
|
|
172
|
+
The versioned knowledge editions pinned on the config's `input_lookups`, resolved server-side. The refs on the config ARE the grant: any caller the invoke gate admits for the workflow reads exactly the pinned editions it names. Editions are immutable, so the response caches for the session. A ref whose snapshot does not exist answers with `missing: true`; the batch never fails.
|
|
173
|
+
|
|
174
|
+
**Response 200:**
|
|
175
|
+
|
|
176
|
+
```json
|
|
177
|
+
{
|
|
178
|
+
"lookups": [
|
|
179
|
+
{ "domain": "fleet", "key": "serial-numbers", "version": 1, "as": "serials", "data": { "items": [{ "value": "sn-1", "label": "Printer 1" }] } }
|
|
180
|
+
]
|
|
181
|
+
}
|
|
182
|
+
```
|
|
183
|
+
|
|
184
|
+
| Status | Meaning |
|
|
185
|
+
|--------|---------|
|
|
186
|
+
| `403` | The caller may not invoke this workflow |
|
|
187
|
+
| `404` | No config exists for this type |
|
|
188
|
+
|
|
165
189
|
### Delete a workflow configuration
|
|
166
190
|
|
|
167
191
|
Requires `admin` or `superadmin` role.
|
|
@@ -210,6 +234,8 @@ Start a workflow by its registered type. The workflow must have `invocable: true
|
|
|
210
234
|
| `metadata` | `object` | no | Control flow metadata passed as `envelope.metadata` |
|
|
211
235
|
| `execute_as` | `string` | no | Service account `external_id` to run as (admin only) |
|
|
212
236
|
|
|
237
|
+
The input gate validates against the `metadata` in the request; the dashboard sends the config's `envelope_schema.metadata` with every invoke it starts.
|
|
238
|
+
|
|
213
239
|
**Example request:**
|
|
214
240
|
|
|
215
241
|
```json
|
|
@@ -243,7 +269,7 @@ The workflow starts on its configured `task_queue` with a generated workflow ID
|
|
|
243
269
|
| `403` | `{ "error": "User not registered" }` | RBAC check failed — no matching user |
|
|
244
270
|
| `403` | `{ "error": "Insufficient role for invocation" }` | User lacks a required invocation role |
|
|
245
271
|
| `404` | `{ "error": "Workflow not found" }` | No config exists for this type |
|
|
246
|
-
| `422` | `{ "error": "data failed input schema validation (n violations)", "code": "schema_validation", "violations": [{ "field", "message" }], "role": null, "schemaVersion": null, "workflowType" }` | The config declares `input_schema` and `data` violates it |
|
|
272
|
+
| `422` | `{ "error": "data failed input schema validation (n violations)", "code": "schema_validation", "violations": [{ "field", "message" }], "role": null, "schemaVersion": null, "workflowType" }` | The config declares `input_schema` and `data` violates it; `x-lt-options` over pinned `input_lookups` constrains values to the resolved edition |
|
|
247
273
|
|
|
248
274
|
**Authorization:**
|
|
249
275
|
|
|
@@ -660,6 +686,7 @@ Interrupt a running workflow. The workflow is immediately terminated.
|
|
|
660
686
|
| `GET` | `/:type/config` | any | Get a single workflow configuration |
|
|
661
687
|
| `PUT` | `/:type/config` | admin | Create or replace a workflow configuration |
|
|
662
688
|
| `DELETE` | `/:type/config` | admin | Delete a workflow configuration (cascade) |
|
|
689
|
+
| `GET` | `/:type/input-lookups` | RBAC | Resolve the config's pinned knowledge lookups (invoke predicate) |
|
|
663
690
|
| `POST` | `/:type/invoke` | RBAC | Invoke a workflow (requires `invocable: true`) |
|
|
664
691
|
| `GET` | `/:workflowId/status` | any | Workflow status |
|
|
665
692
|
| `GET` | `/:workflowId/result` | any | Get workflow result (200 if complete, 202 if running) |
|
package/docs/api/mcp/admin.md
CHANGED
|
@@ -442,9 +442,23 @@ List all certified workflow configurations with roles and settings.
|
|
|
442
442
|
|
|
443
443
|
**Parameters:** None.
|
|
444
444
|
|
|
445
|
+
### get_workflow_config
|
|
446
|
+
|
|
447
|
+
The full configuration row for one workflow, plus `tier` (`registered` or `certified`) and `input_lookup_data`: the pinned `input_lookups` resolved into the form-context shape the input form reads, keyed `<as ?? key>`, or `null` when none are pinned. Call it before `invoke_workflow` to read the `input_schema` a payload must satisfy and the `envelope_schema.metadata` every run starts from.
|
|
448
|
+
|
|
449
|
+
| | |
|
|
450
|
+
|---|---|
|
|
451
|
+
| Read-safe | Yes |
|
|
452
|
+
|
|
453
|
+
**Parameters:**
|
|
454
|
+
|
|
455
|
+
| Field | Type | Required | Description |
|
|
456
|
+
|-------|------|----------|-------------|
|
|
457
|
+
| workflow_type | string | Yes | Registered workflow type name |
|
|
458
|
+
|
|
445
459
|
### upsert_workflow_config
|
|
446
460
|
|
|
447
|
-
Create or replace a workflow configuration (certify). Activates the interceptor for task tracking and escalation chains.
|
|
461
|
+
Create or replace a workflow configuration (certify). Activates the interceptor for task tracking and escalation chains. Full replace, matching `PUT /api/workflows/:type/config`: omitted fields clear to their defaults, so send the whole profile (start from `get_workflow_config`).
|
|
448
462
|
|
|
449
463
|
| | |
|
|
450
464
|
|---|---|
|
|
@@ -466,6 +480,11 @@ Create or replace a workflow configuration (certify). Activates the interceptor
|
|
|
466
480
|
| consumes | string[] | No | Event topics consumed |
|
|
467
481
|
| tool_tags | string[] | No | Tool tags for routing |
|
|
468
482
|
| cron_schedule | string | No | Cron schedule expression |
|
|
483
|
+
| envelope_schema | object | No | Envelope template; the dashboard stamps its `metadata` on runs it starts |
|
|
484
|
+
| input_schema | object | No | x-lt-* JSON Schema for the invoke form; invoke validates `data` against it |
|
|
485
|
+
| input_lookups | `{ domain, key, version, as? }[]` | No | Versioned knowledge refs the invoke form reads as `lookup.<as ?? key>`; malformed refs are refused |
|
|
486
|
+
| icon | string | No | Curated icon name from `WORKFLOW_ICONS`; unknown names are refused |
|
|
487
|
+
| read_safe | boolean | No | Side-effect-free; eligible for `invoke_workflow_read_safe` |
|
|
469
488
|
|
|
470
489
|
### delete_workflow_config
|
|
471
490
|
|
|
@@ -499,7 +518,7 @@ Unified list of all known workflows: active workers, historical entities, and re
|
|
|
499
518
|
|
|
500
519
|
### invoke_workflow
|
|
501
520
|
|
|
502
|
-
Start a certified workflow by type. Returns workflow ID immediately.
|
|
521
|
+
Start a certified workflow by type. Returns workflow ID immediately. Call `get_workflow_config` for the `input_schema` the payload must satisfy. The input gate validates against the `metadata` the caller sends.
|
|
503
522
|
|
|
504
523
|
| | |
|
|
505
524
|
|---|---|
|
|
@@ -510,9 +529,26 @@ Start a certified workflow by type. Returns workflow ID immediately.
|
|
|
510
529
|
| Field | Type | Required | Description |
|
|
511
530
|
|-------|------|----------|-------------|
|
|
512
531
|
| workflow_type | string | Yes | Workflow type to invoke |
|
|
513
|
-
| data | object | Yes | Input data |
|
|
514
|
-
| metadata | object | No |
|
|
532
|
+
| data | object | Yes | Input data; validated against `input_schema` when the config declares one |
|
|
533
|
+
| metadata | object | No | Control flow metadata passed as `envelope.metadata` |
|
|
515
534
|
| execute_as | string | No | Execution identity |
|
|
535
|
+
| options | object | No | HotMesh WorkflowOptions passthrough (`workflowId`, `entity`, `expire`, `search`) |
|
|
536
|
+
|
|
537
|
+
**Errors:**
|
|
538
|
+
|
|
539
|
+
| Result | Meaning |
|
|
540
|
+
|--------|---------|
|
|
541
|
+
| `isError` with `{ "error": "data failed input schema validation (n violations)", "code": "schema_validation", "violations": [{ "field", "message" }], "role": null, "schemaVersion": null, "workflowType" }` | The config declares `input_schema` and `data` violates it; nothing starts |
|
|
542
|
+
|
|
543
|
+
### invoke_workflow_read_safe
|
|
544
|
+
|
|
545
|
+
Start a workflow registered read-safe (side-effect-free). Same contract as `invoke_workflow`, including the input gate and metadata merge, gated to configs carrying `read_safe: true`. Any workflow may be attempted; one without the flag, or one not invocable, fails with a clear error. The invocation surface for read-scoped callers.
|
|
546
|
+
|
|
547
|
+
| | |
|
|
548
|
+
|---|---|
|
|
549
|
+
| Read-safe | Yes |
|
|
550
|
+
|
|
551
|
+
**Parameters:** Same as `invoke_workflow`.
|
|
516
552
|
|
|
517
553
|
### get_workflow_status
|
|
518
554
|
|
|
@@ -57,7 +57,7 @@ The domain dictionary's override lives beside its path:
|
|
|
57
57
|
|
|
58
58
|
| Surface | Declared via | Code-owned apply writes | Left alone (runtime state) |
|
|
59
59
|
|---|---|---|---|
|
|
60
|
-
| Workflow profiles | `workers[].config` | full profile incl. role lists and `
|
|
60
|
+
| Workflow profiles | `workers[].config` | full profile incl. role lists, `input_schema`, and `input_lookups` (replace semantics) | task history, escalations |
|
|
61
61
|
| Roles | `roles[]` | declared fields only (PATCH); escalation targets replace | membership, undeclared fields |
|
|
62
62
|
| Topics | `topics[]` | whole catalog entry (`managed: true`) | `last_seen_at` |
|
|
63
63
|
| MCP servers | `mcp.serverFactories[].config` | description, tags, category, compile hints, credential providers | tool manifest, connection status |
|
package/docs/dashboard.md
CHANGED
|
@@ -139,7 +139,7 @@ Every invokable workflow is presented as a tool. The list of tools takes the lef
|
|
|
139
139
|
- **Heading and description** — the icon and title, with the identifier, tier, and queue as metadata, then the config's one-line description. Keep reference material in `x-lt-help`; it appears in the side panel on demand.
|
|
140
140
|
- **Identity summary** — who will execute: the current user, the workflow's configured `execute_as` bot ("configured default"), or, for admins and superadmins, an override chosen from the bot picker ("admin override").
|
|
141
141
|
- **Certification checkbox** — for a certified workflow, stamps `metadata.certified` on this one run.
|
|
142
|
-
- **The form** — a workflow that declares `inputSchema` renders the x-lt-* form: sections, two columns, conditional fields and instruction blocks, and a side panel with **Instructions** (the interpolated `x-lt-help`) and **Issues** (violations, click to focus). Every other workflow renders the envelope template form from `envelopeSchema`, with its Form and JSON views. See [Invoke forms](hitl/invoke-form.md).
|
|
142
|
+
- **The form** — a workflow that declares `inputSchema` renders the x-lt-* form: sections, two columns, conditional fields and instruction blocks, selects with inline or lookup-backed labeled options, Yes/No decisions over booleans, multi-select lists, validated JSON maps, and a side panel with **Instructions** (the interpolated `x-lt-help`) and **Issues** (violations, click to focus). The `fleetTools` example exercises every shape. Every other workflow renders the envelope template form from `envelopeSchema`, with its Form and JSON views. See [Invoke forms](hitl/invoke-form.md).
|
|
143
143
|
- **Submit** — posts `{ data, metadata }` to the invoke endpoint. The page stays put, reports the started id, and subscribes to that run's `system.workflow.{id}.completed` and `.failed` events, so the outcome and the workflow's returned `data` appear beside Submit without leaving the page. One click disarms the button until the person chooses **Submit again**. While live events are off, a warning beside the button offers a reconnect, since the result could not arrive otherwise. Builders also get a **View workflow** link to its execution. A `422` from the input schema gate lands in the Issues view.
|
|
144
144
|
|
|
145
145
|
Below 1280px the list folds into a select and the form takes the full width.
|
|
@@ -85,11 +85,12 @@ Chroma is spent, not spread.
|
|
|
85
85
|
rich text, uploads) fill the cell. The signature pad holds its natural
|
|
86
86
|
document proportion (25rem, the 400×150 export) — the PNG is the
|
|
87
87
|
artifact, and stretching the pad stretches the document.
|
|
88
|
-
- **Decisions are never checkboxes.** A decision is an
|
|
89
|
-
explicit disabled **Choose…** placeholder
|
|
90
|
-
implicit first option, and there is no way
|
|
91
|
-
|
|
92
|
-
|
|
88
|
+
- **Decisions are never checkboxes.** A decision is an option list opening
|
|
89
|
+
on an explicit disabled **Choose…** placeholder, a Yes/No pair included.
|
|
90
|
+
The user picks; nothing is an implicit first option, and there is no way
|
|
91
|
+
back to unchosen unless the field declares `x-lt-nullable`.
|
|
92
|
+
- Checkboxes exist only inside checklists and multi-selects, and as the
|
|
93
|
+
single confirmation box — confirmations of work, not choices.
|
|
93
94
|
- **Item length and selection mode determine list geometry.**
|
|
94
95
|
Sentence-length require-all *rituals* read top-down, one per row — the
|
|
95
96
|
vertical stack is deliberate. Short pick-any *tags* (reasons, categories)
|
package/docs/hitl/form.md
CHANGED
|
@@ -26,16 +26,21 @@ Declare `title` on every field whose key isn't already a readable label — it i
|
|
|
26
26
|
|
|
27
27
|
## Field Types
|
|
28
28
|
|
|
29
|
-
|
|
29
|
+
The control follows the field's declared `type` and its tokens; the stored value only fills it. A field with no value yet renders the empty state of its control: a number is an empty input, a boolean is an unchecked box, a select opens on **Choose…**, a multi-select has nothing picked, a JSON editor is empty. Every property starts at its `default`, or `{}` for an object, or empty text.
|
|
30
|
+
|
|
31
|
+
| Declared type | Renders As |
|
|
30
32
|
|-----------|-----------|
|
|
31
33
|
| `boolean` | Checkbox toggle |
|
|
32
|
-
| `
|
|
33
|
-
| `
|
|
34
|
-
| `string`
|
|
35
|
-
| `string`/`number` + `
|
|
34
|
+
| `boolean` + `enum` / `x-lt-options` | Select emitting `true` or `false` (a Yes/No decision) |
|
|
35
|
+
| `number` / `integer` | Number input |
|
|
36
|
+
| `string` | Text input; `format: "textarea"` for multi-line |
|
|
37
|
+
| `string`/`number` + `enum` | Select |
|
|
38
|
+
| any scalar + `x-lt-options` | Select with labeled options: inline, from the context, or from a lookup (see [x-lt-validation.md](x-lt-validation.md#select-options-x-lt-options)) |
|
|
39
|
+
| `array` + `x-lt-options` | Multi-select chips emitting the picked values in list order |
|
|
40
|
+
| `array` / `object` + `x-lt-widget: "json"` | Validated JSON editor (see [x-lt-widget.md](x-lt-widget.md#json)) |
|
|
41
|
+
| `array` without options | Tag display (read-only) |
|
|
42
|
+
| `object` | Nested fields from `properties`, or a widget (see [x-lt-widget.md](x-lt-widget.md)) |
|
|
36
43
|
| `null` | Read-only "null" display |
|
|
37
|
-
| `array` | Tag display (read-only) |
|
|
38
|
-
| `object` | Nested section with recursive fields, or a widget (see [x-lt-widget.md](x-lt-widget.md)) |
|
|
39
44
|
|
|
40
45
|
---
|
|
41
46
|
|
package/docs/hitl/invoke-form.md
CHANGED
|
@@ -22,7 +22,8 @@ Workflow names read as titles on the page: `fleetTools` shows as **Fleet Tools**
|
|
|
22
22
|
| Field | Role in the invoke |
|
|
23
23
|
|---|---|
|
|
24
24
|
| `inputSchema` | The form. JSON Schema `properties` plus x-lt-* tokens. Rendered by the Invoke Tool page; enforced by the invoke API. |
|
|
25
|
-
| `envelopeSchema.metadata` | The `metadata`
|
|
25
|
+
| `envelopeSchema.metadata` | The `metadata` the Invoke Tool page stamps on every run from this form. `envelopeSchema.data` is ignored when `inputSchema` is present. |
|
|
26
|
+
| `inputLookups` | Versioned knowledge refs (`{ domain, key, version, as? }`) the form reads as `lookup.<as ?? key>`. See [Lookups](lookups.md#pinning-on-a-workflow-config). |
|
|
26
27
|
| `invocationRoles` | Who sees the workflow on the Invoke Tool page and who may start it. Empty means every authenticated user. |
|
|
27
28
|
| `description` | One line at the top of the form column, markdown allowed. Keep the reference material in `x-lt-help`, which appears in the side panel on demand. |
|
|
28
29
|
| `icon` | A curated icon from `WORKFLOW_ICONS` (`icon: WORKFLOW_ICONS.WRENCH`). Leads the workflow's row and heading in place of the tier glyph so operators tell tools apart at a glance. The registry offers the same set as a picker. |
|
|
@@ -44,7 +45,9 @@ The form edits flat values keyed by property name. On submit, `x-lt-bind` maps t
|
|
|
44
45
|
"metadata": { "source": "dashboard" } }
|
|
45
46
|
```
|
|
46
47
|
|
|
47
|
-
Conditions and help tokens read the live form under the `input` domain: `x-lt-showIf: "input.action=retire"`, `{{input.serialNumber}}`. `resolver` names the same values, so a schema written for an escalation form works unchanged.
|
|
48
|
+
Conditions and help tokens read the live form under the `input` domain: `x-lt-showIf: "input.action=retire"`, `{{input.serialNumber}}`. `resolver` names the same values, so a schema written for an escalation form works unchanged. An invoke form reads four domains: `input`, `resolver`, `metadata` (the run's metadata), and `lookup` (the editions pinned by `inputLookups`, keyed `<as ?? key>`).
|
|
49
|
+
|
|
50
|
+
The gate validates against the `metadata` the caller sends. The Invoke Tool page sends the declared `envelopeSchema.metadata` plus the per-run `certified` flag; an API or MCP caller that wants a condition such as `x-lt-showIf: "metadata.mode=strict"` to hold sends that metadata itself.
|
|
48
51
|
|
|
49
52
|
Hidden conditional fields still submit their defaults, as on every x-lt-* form. Treat empty as absent in the workflow.
|
|
50
53
|
|
|
@@ -93,6 +96,6 @@ Once a run starts, the page subscribes to `system.workflow.{workflowId}.complete
|
|
|
93
96
|
}
|
|
94
97
|
```
|
|
95
98
|
|
|
96
|
-
The MCP tools `invoke_workflow` and `invoke_workflow_read_safe` run the same gate and return the body as an error result. The gate reads bound paths from the nested `data`, skips fields a `x-lt-showIf` hides, and applies every validation keyword the form applies.
|
|
99
|
+
The MCP tools `invoke_workflow` and `invoke_workflow_read_safe` run the same gate and return the body as an error result; `get_workflow_config` returns the `input_schema`, the declared metadata, and the resolved lookup data a caller needs to compose a valid payload. The gate reads bound paths from the nested `data`, skips fields a `x-lt-showIf` hides, resolves `x-lt-options` over pinned lookups, and applies every validation keyword the form applies.
|
|
97
100
|
|
|
98
101
|
`GET /api/workflows/invocable` returns the caller's invokable workflows with their tier. The list and the gate share one predicate, so the page never offers a workflow the API would refuse.
|
package/docs/hitl/lookups.md
CHANGED
|
@@ -37,6 +37,27 @@ const decision = await conditional<CascadeResolverV1>(signalId, {
|
|
|
37
37
|
|
|
38
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
39
|
|
|
40
|
+
## Pinning on a Workflow Config
|
|
41
|
+
|
|
42
|
+
An invoke form pins editions the same way. Declare `inputLookups` beside `inputSchema` on the worker config and the form reads them under `lookup.<as ?? key>`:
|
|
43
|
+
|
|
44
|
+
```typescript
|
|
45
|
+
const fleetToolsConfig: LTWorkerConfig = {
|
|
46
|
+
invocable: true,
|
|
47
|
+
inputSchema: FLEET_TOOLS_INPUT_SCHEMA,
|
|
48
|
+
inputLookups: [{ domain: 'fleet', key: 'serial-numbers', version: 1, as: 'serials' }],
|
|
49
|
+
};
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
```jsonc
|
|
53
|
+
// inputSchema.properties
|
|
54
|
+
"serialNumber": { "type": "string", "title": "Serial", "x-lt-options": "lookup.serials.items" }
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
The Invoke Tool page fetches `GET /api/workflows/:type/input-lookups` once per workflow; the grant is the invoke predicate, so whoever may start the workflow reads exactly the pinned editions. The invoke API resolves the same refs into the gate, so a value outside the edition is refused with the canonical 422. The registry detail page edits the refs under **Lookups** in its Invocation column; the preview renders against the resolved editions.
|
|
58
|
+
|
|
59
|
+
The refs are checked twice on save. Shape first: a missing `domain` or `key`, a `version` that is not a positive integer, or an empty `as` answers `400` with the field named. Existence second: a ref whose edition does not exist answers `400` naming the editions that do (`Lookup ref fleet/serial-numbers v3 names no edition (editions: v1, v2)`), from `PUT /api/workflows/:type/config` and from the MCP `upsert_workflow_config` tool alike. On the worker boot path a malformed ref fails the boot; a ref whose edition is not yet written logs a warning, since seeds commonly run after registration. At run time the resolver reads each edition once and holds it in memory (editions are immutable), a missing edition answers `missing: true` for that ref without failing the batch, the Invoke Tool page shows which pinned editions are unavailable, and the fields that read them follow the `x-lt-options` rules: a plain path falls back to the typed input, an interpolated path stays a disabled select and fails closed.
|
|
60
|
+
|
|
40
61
|
## Versioning
|
|
41
62
|
|
|
42
63
|
Every knowledge entry carries a `current_version`, and every write that changes its data mints an immutable snapshot automatically — no publish step:
|
|
@@ -6,7 +6,7 @@ The form runs a full validation pass before any submit is accepted. Every visibl
|
|
|
6
6
|
|
|
7
7
|
## Required
|
|
8
8
|
|
|
9
|
-
Fields listed in the schema's `required` array block submission when empty. A red asterisk marks required fields. Required validation is skipped for fields hidden by `x-lt-showIf` at submission time.
|
|
9
|
+
Fields listed in the schema's `required` array block submission when empty. A red asterisk marks required fields. Empty means `null`, `undefined`, blank text, an unchecked checkbox, an object with no truthy value, an empty multi-select, or an empty `json` list. A boolean with an option list is answered by either value, and a `json` map is answered by any key. Required validation is skipped for fields hidden by `x-lt-showIf` at submission time.
|
|
10
10
|
|
|
11
11
|
```json
|
|
12
12
|
{
|
|
@@ -93,9 +93,30 @@ When `envelope.min_score` is `60`, submitting a score of `45` blocks with "Minim
|
|
|
93
93
|
|
|
94
94
|
---
|
|
95
95
|
|
|
96
|
-
##
|
|
96
|
+
## Select Options (`x-lt-options`)
|
|
97
97
|
|
|
98
|
-
A
|
|
98
|
+
`x-lt-options` takes one of three forms. A `"domain.path"` string, or an array of path strings, resolves the list from the context (first path that resolves wins). An array with **no string entries** is the list itself, written inline: `{ value, label }` objects, numbers, or booleans. A literal string value is written as an object, `{ "value": "rn", "label": "Registered Nurse" }`, since a bare string is always read as a path. A static `enum` wins over both.
|
|
99
|
+
|
|
100
|
+
```json
|
|
101
|
+
{
|
|
102
|
+
"properties": {
|
|
103
|
+
"role": {
|
|
104
|
+
"type": "string",
|
|
105
|
+
"x-lt-options": [{ "value": "rn", "label": "Registered Nurse" }, { "value": "lpn", "label": "Practical Nurse" }]
|
|
106
|
+
},
|
|
107
|
+
"powerCycled": {
|
|
108
|
+
"type": "boolean",
|
|
109
|
+
"x-lt-options": [{ "value": true, "label": "Yes" }, { "value": false, "label": "No" }]
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
```
|
|
114
|
+
|
|
115
|
+
A boolean with an option list renders as a select, not a checkbox: use it for decisions, and keep the checkbox for confirmations.
|
|
116
|
+
|
|
117
|
+
**Clearable selects.** A select opens on a disabled **Choose…** placeholder and, once a value is picked, offers no way back. With `"x-lt-nullable": true` the placeholder stays enabled and picking it submits `null`, for a choice that may lawfully stay unmade.
|
|
118
|
+
|
|
119
|
+
The list can also ride the escalation instead of the schema. The token names a `"domain.path"`; the array of strings or numbers at that path becomes the field's options, one static role form, per-row legal values:
|
|
99
120
|
|
|
100
121
|
```json
|
|
101
122
|
{
|
|
@@ -126,6 +147,32 @@ When the envelope carries `left_quantity_options: [0, 1, 2, 3]`, the field rende
|
|
|
126
147
|
|
|
127
148
|
---
|
|
128
149
|
|
|
150
|
+
## Lists and Maps
|
|
151
|
+
|
|
152
|
+
A `type: "array"` field with its own `x-lt-options` (path or literal) renders as a multi-select of chips; the submitted value is the array of picked values in list order. A list is validated only when it is edited this way or through the `json` widget; a list shown as read-only tags is left alone.
|
|
153
|
+
|
|
154
|
+
```json
|
|
155
|
+
{
|
|
156
|
+
"required": ["roles"],
|
|
157
|
+
"properties": {
|
|
158
|
+
"roles": { "type": "array", "x-lt-options": [{ "value": "gluer", "label": "Gluer" }, { "value": "qa", "label": "QA" }], "minItems": 1, "maxItems": 2 },
|
|
159
|
+
"weights": {
|
|
160
|
+
"type": "object",
|
|
161
|
+
"x-lt-widget": "json",
|
|
162
|
+
"propertyNames": { "enum": ["bag", "plate", "spool"] },
|
|
163
|
+
"additionalProperties": { "type": "number", "minimum": 0, "maximum": 1 }
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
```
|
|
168
|
+
|
|
169
|
+
- A required multi-select or `json` list needs at least one item. An empty optional list passes its constraints.
|
|
170
|
+
- Every item must belong to the option list (`Must be one of: gluer, qa`); `minItems`/`maxItems` bound the length (`At least 1 item`, `At most 2 items`); a `json` list checks each item against `items`, including `items.enum` (`Item 2: Expected a number`).
|
|
171
|
+
- A map's keys must belong to `propertyNames.enum` (`Unknown key "tray". Allowed: bag, plate, spool`) and every value must satisfy an object-shaped `additionalProperties` (`"bag": Minimum value is 0`). A required map needs at least one key; a zero weight is an answer.
|
|
172
|
+
- The same rules run on the wire: an API or MCP caller sending the list or map under the bound key receives the same violations as the form shows.
|
|
173
|
+
|
|
174
|
+
---
|
|
175
|
+
|
|
129
176
|
## Checklist Completion (`x-lt-require-all`)
|
|
130
177
|
|
|
131
178
|
A checklist-widget field can require every item to be checked before submission:
|
package/docs/hitl/x-lt-widget.md
CHANGED
|
@@ -6,6 +6,7 @@ For rich inputs beyond standard HTML types, set `x-lt-widget` on any field:
|
|
|
6
6
|
|--------|------------|
|
|
7
7
|
| `"file-upload"` | File picker with drag-and-drop. Stores a base64 data URL. Use `accept` to filter file types. |
|
|
8
8
|
| `"code-editor"` | Monospace textarea with tab-key support. Use `x-lt-language` for the syntax hint. |
|
|
9
|
+
| `"json"` | Validated JSON editor for a `list` or `object` field. Unparseable text blocks submit as **Invalid JSON**; a parsed value is validated as the declared type. |
|
|
9
10
|
| `"signature"` | HTML5 Canvas drawing pad. Outputs a PNG data URL. |
|
|
10
11
|
| `"rich-text"` | Tall textarea for formatted text input. |
|
|
11
12
|
| `"markdown"` | Markdown source rendered with headings, tables, lists, code blocks. Editable by default; set `readOnly: true` for a pure content block. |
|
|
@@ -61,6 +62,26 @@ The submitted value is a base64 data URL (`data:image/png;base64,...`). `accept`
|
|
|
61
62
|
|
|
62
63
|
---
|
|
63
64
|
|
|
65
|
+
## JSON
|
|
66
|
+
|
|
67
|
+
```json
|
|
68
|
+
{
|
|
69
|
+
"properties": {
|
|
70
|
+
"weights": {
|
|
71
|
+
"type": "object",
|
|
72
|
+
"x-lt-widget": "json",
|
|
73
|
+
"propertyNames": { "enum": ["bag", "plate", "spool"] },
|
|
74
|
+
"additionalProperties": { "type": "number", "minimum": 0, "maximum": 1 },
|
|
75
|
+
"description": "Zero or omit a key to exclude it"
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
A monospace editor holding the raw JSON of a `type: "array"` or `"object"` field. While the text does not parse, the field reads **Invalid JSON** and blocks submit; once it parses, the value is validated as the declared type: `items` (`type`, `enum`, bounds), `minItems`, `maxItems` for lists; `propertyNames.enum` and `additionalProperties` (`type`, `minimum`, `maximum`) for maps. Empty text submits `null`. Typing never reformats the text. See [Lists and Maps](x-lt-validation.md#lists-and-maps).
|
|
82
|
+
|
|
83
|
+
---
|
|
84
|
+
|
|
64
85
|
## Signature
|
|
65
86
|
|
|
66
87
|
```json
|
package/docs/hitl-guide.md
CHANGED
|
@@ -105,7 +105,7 @@ Ordered as a learning path — each file adds one capability to the same form:
|
|
|
105
105
|
| Keyword | Level | Purpose |
|
|
106
106
|
|---------|-------|---------|
|
|
107
107
|
| `input.*` | domain | The live form values on the Invoke surface (alias of `resolver.*`) for `x-lt-showIf`, `x-lt-help`, and `x-lt-options` |
|
|
108
|
-
| `x-lt-widget` | field | Rich control: `file-upload`, `code-editor`, `signature`, `rich-text`, `markdown`, `checklist`, `attachment` (alias `image`) |
|
|
108
|
+
| `x-lt-widget` | field | Rich control: `file-upload`, `code-editor`, `json`, `signature`, `rich-text`, `markdown`, `checklist`, `attachment` (alias `image`) |
|
|
109
109
|
| `x-lt-source` | field | Data path for context-driven widgets: `"domain.path"` or an ordered array of paths (first to resolve wins); may embed `{{domain.path}}` interpolation segments |
|
|
110
110
|
| `x-lt-require-all` | field | Checklist completion guard — every item must be checked, except items declared `required: false` |
|
|
111
111
|
| `x-lt-default-checked` | field | Checklist first-load default — an unanswered field initializes to every item checked (affirm-then-exception); saved answers are never clobbered |
|
|
@@ -118,7 +118,10 @@ Ordered as a learning path — each file adds one capability to the same form:
|
|
|
118
118
|
| `x-lt-showIf` | field | Show field when a value is truthy at `domain.path`; prefix `!` to invert; `=VALUE` / `!=VALUE` compare the string form; an array requires every condition |
|
|
119
119
|
| `x-lt-hide-if-empty` | field | `true` — suppress the field when its value is null, `""`, `false`, or `0` |
|
|
120
120
|
| `x-lt-section` | field | Section group label |
|
|
121
|
-
| `x-lt-options` | field |
|
|
121
|
+
| `x-lt-options` | field | Select options — an inline literal list (`{ value, label }` objects, numbers, booleans), or a `"domain.path"` (or an ordered array of paths, first to resolve wins) resolved from the context; static `enum` wins; `{{domain.path}}` segments make cascading selects; on a list field, the multi-select's options |
|
|
122
|
+
| `x-lt-nullable` | field | `true` — a select keeps **Choose…** enabled and picking it submits `null` |
|
|
123
|
+
| `items` / `minItems` / `maxItems` | field | Rules for a multi-select or `json` list: `items` validates each entry, the bounds cap the length |
|
|
124
|
+
| `propertyNames` / `additionalProperties` | field | Map rules for the `json` editor: an `enum` of allowed keys, and the schema every value must satisfy |
|
|
122
125
|
| `x-lt-minimum` | field | Dynamic lower bound — resolves a `"domain.path"` from the escalation context |
|
|
123
126
|
| `x-lt-maximum` | field | Dynamic upper bound — resolves a `"domain.path"` from the escalation context |
|
|
124
127
|
| `x-lt-min-length` | field | Dynamic minimum string length — resolves a `"domain.path"` |
|
package/package.json
CHANGED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{a as v,j as n}from"./vendor-query-DvWWuNIB.js";import{al as At,aa as Et,bv as _t,bj as Ot,aE as K,bw as $t,a4 as Ct}from"./vendor-icons-DeBdvyKJ.js";import{g as et,H as Tt,c as Y,r as nt,s as Ft}from"./EscalationListView-uuZRMSLB.js";import{ad as lt,ai as Dt,a9 as st,a0 as Mt,a5 as It,s as Wt}from"./index-BMlQYOE1.js";import{L as gt}from"./vendor-react-_9U4mKFr.js";import{S as Lt}from"./StatusBadge-DHVwxre2.js";function U(t,e){const r=e==null?void 0:e.title;if(typeof r=="string"&&r.trim().length>0)return r.trim();const s=t.split(/[_-]+/).filter(Boolean);return s.length<=1?t:s.map(i=>Rt(i)?i:i.charAt(0).toUpperCase()+i.slice(1)).join(" ")}function Rt(t){return t.length>1&&t===t.toUpperCase()&&/[A-Z]/.test(t)}const Pt=/\{\{\s*([^{}]+?)\s*\}\}/g;function S(t){return typeof t=="string"&&/\{\{[^{}]+\}\}/.test(t)}function rt(t,e){if(!e)return;const r=t.indexOf("."),s=e[r===-1?t:t.slice(0,r)];if(r===-1)return s;if(!(s===null||typeof s!="object"))return et(s,t.slice(r+1))}function bt(t,e){let r=!1;const s=t.replace(Pt,(i,o)=>{const l=rt(o,e);return typeof l=="string"&&l.trim().length>0?l:typeof l=="number"&&Number.isFinite(l)?String(l):(r=!0,"")});return r?null:s}const qt="x-lt-options";function ct(t){return typeof t=="string"||typeof t=="number"&&Number.isFinite(t)}function Ut(t){if(ct(t))return{value:t,label:String(t)};if(t&&typeof t=="object"&&!Array.isArray(t)){const e=t,r=e.value!==void 0?e.value:e.id;if(ct(r)&&typeof e.label=="string"&&e.label.length>0)return{value:r,label:e.label}}return null}function mt(t,e){if(!t)return;const r=t.enum;if(Array.isArray(r)&&r.length>0)return r.map(l=>({value:l,label:String(l)}));const s=t[qt],i=(typeof s=="string"?[s]:Array.isArray(s)?s:[]).filter(l=>typeof l=="string"&&l.length>0);if(i.length===0)return;const o=i.some(S)?[]:void 0;for(const l of i){let c=l;if(S(l)){const a=bt(l,e);if(a===null)continue;c=a}const d=rt(c,e);if(!Array.isArray(d))continue;const u=d.map(Ut).filter(a=>a!==null);if(u.length>0)return u}return o}function it(t,e){const r=(typeof t=="string"?[t]:Array.isArray(t)?t:[]).filter(s=>typeof s=="string"&&s.length>0);if(r.length===0||!e)return[];for(const s of r){let i=s;if(S(s)){const l=bt(s,e);if(l===null)continue;i=l}const o=rt(i,e);if(Array.isArray(o)&&o.length>0)return o}return[]}const Ht="x-lt-default-checked";function Jt(t,e,r){if((t==null?void 0:t["x-lt-widget"])!=="checklist"||t[Ht]!==!0||e&&typeof e=="object"&&!Array.isArray(e)&&Object.keys(e).length>0)return null;const s=it(t["x-lt-source"],r);return s.length===0?null:Object.fromEntries(s.map(i=>[i.id,!0]))}function Xt(t,e,r){if((e==null?void 0:e["x-lt-widget"])!=="checklist"||e["x-lt-require-all"]!==!0)return;const i=it(e["x-lt-source"],r).filter(c=>c.required!==!1);if(i.length===0)return;const o=typeof t=="object"&&t!==null&&!Array.isArray(t)?t:{},l=i.filter(c=>!o[c.id]).length;if(l!==0)return`${l} of ${i.length} checks incomplete`}function Yt(t,e){const r=e==null?void 0:e.type;if(typeof r=="string"&&!(t==null||t===""))switch(r){case"string":return typeof t=="string"?void 0:"Expected text";case"number":return typeof t=="number"&&Number.isFinite(t)?void 0:"Expected a number";case"integer":return typeof t=="number"&&Number.isInteger(t)?void 0:"Expected a whole number";case"boolean":return typeof t=="boolean"?void 0:"Expected true or false";case"array":return Array.isArray(t)?void 0:"Expected a list";case"object":return typeof t=="object"&&!Array.isArray(t)?void 0:"Expected an object";default:return}}function zt(t,e,r){if(!e)return;const s=mt(e,r);if(s!==void 0&&t!==void 0&&t!==null&&t!==""){if(s.length===0)return"No valid options for this selection";if(!s.some(i=>i.value===t))return`Must be one of: ${s.map(i=>String(i.value)).join(", ")}`}if(typeof t=="string"){const i=t.trim();if(i==="")return;const o=X(e.minLength,e["x-lt-min-length"],r);if(o!==void 0&&i.length<o)return`Minimum ${o} character${o===1?"":"s"}`;const l=X(e.maxLength,e["x-lt-max-length"],r);if(l!==void 0&&i.length>l)return`Maximum ${l} characters (${i.length} entered)`;const c=e.pattern;if(c)try{if(!new RegExp(c).test(i))return e["x-lt-pattern-error"]??"Invalid format"}catch{}const d=e.format;if(d==="email"&&!/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(i))return"Enter a valid email address";if(d==="uri"&&!/^https?:\/\/.+/.test(i))return"Enter a valid URL"}if(typeof t=="number"){const i=X(e.minimum,e["x-lt-minimum"],r),o=X(e.exclusiveMinimum,void 0,r),l=X(e.maximum,e["x-lt-maximum"],r),c=X(e.exclusiveMaximum,void 0,r);if(i!==void 0&&t<i)return`Minimum value is ${i}`;if(o!==void 0&&t<=o)return`Must be greater than ${o}`;if(l!==void 0&&t>l)return`Maximum value is ${l}`;if(c!==void 0&&t>=c)return`Must be less than ${c}`}}function X(t,e,r){if(typeof t=="number")return t;if(typeof e=="string"&&r){const s=e.indexOf(".");if(s!==-1){const i=e.slice(0,s),o=e.slice(s+1),l=r[i];if(l&&typeof l=="object"){const c=o.split(".");let d=l;for(const u of c)if(d=d[u],d===void 0)break;if(typeof d=="number")return d;if(typeof d=="string"){const u=Number(d);if(!Number.isNaN(u))return u}}}}}function Gt(t,e,r,s,i){if(!s)return;if(r){if(t==null||typeof t=="boolean"&&!t||typeof t=="string"&&t.trim()==="")return"Required";if(typeof t=="object"&&!Array.isArray(t)&&t!==null){const c=Object.values(t);if(c.length===0||c.every(d=>!d))return"Required"}}const o=Yt(t,e);if(o)return o;const l=Xt(t,e,i);return l||zt(t,e,i)}function dt(t){return t!=null&&t!==""&&t!==!1&&t!==0}function Qt(t){return t==null?"":typeof t=="object"?JSON.stringify(t):String(t)}function xt(t,e){const r=t.indexOf("."),s=r===-1?t:t.slice(0,r);if(!Tt.includes(s))return{known:!1,value:void 0};const i=e[s];if(r===-1)return{known:!0,value:i};try{return{known:!0,value:et(i,t.slice(r+1))}}catch{return{known:!0,value:void 0}}}function jt(t,e){if(Array.isArray(t))return t.every(d=>jt(d,e));if(typeof t!="string"||t.length===0||!e)return!0;const r=t.startsWith("!"),s=r?t.slice(1):t,i=s.indexOf("!="),o=s.indexOf("=");if(i!==-1||o!==-1&&o!==i+1){const d=i!==-1&&(o===-1||i<o),u=d?i:o,a=s.slice(0,u).trim(),g=s.slice(u+(d?2:1)).trim(),{known:x,value:y}=xt(a,e);if(!x)return!0;const w=Qt(y)===g,b=d?!w:w;return r?!b:b}const{known:l,value:c}=xt(s,e);return l?r?!dt(c):dt(c):!0}const Vt=2600;function Zt({hint:t,onLockedClick:e,children:r}){const[s,i]=v.useState(null);v.useEffect(()=>{if(!s)return;const l=setTimeout(()=>i(null),Vt);return()=>clearTimeout(l)},[s]);const o=l=>{if(e==null||e(),t){const c=Math.min(Math.max(l.clientX,96),window.innerWidth-96);i(d=>({x:c,y:l.clientY,n:((d==null?void 0:d.n)??0)+1}))}};return n.jsxs("div",{className:"pb-8 max-w-form",onClick:o,"data-testid":"locked-form-frame",children:[r,t&&s&&n.jsxs("div",{role:"status",className:"fixed z-[60] pointer-events-none flex items-center gap-2 px-3 py-1.5 rounded-md bg-surface-raised border border-surface-border shadow-lg text-xs font-medium text-text-primary whitespace-nowrap animate-[click-hint_2.6s_ease-in-out_both]",style:{left:s.x,top:s.y-12},onAnimationEnd:()=>i(null),"data-testid":"locked-form-hint",children:[n.jsx(At,{className:"w-3.5 h-3.5 text-accent shrink-0",strokeWidth:1.5}),t]},s.n)]})}function E({children:t,isRequired:e,htmlFor:r}){return n.jsxs("label",{htmlFor:r,className:"block text-2xs font-semibold uppercase tracking-wider text-text-secondary",children:[t,e&&n.jsx("span",{className:"text-status-error ml-0.5",children:"*"})]})}function W({id:t,children:e}){return n.jsx("p",{id:t,className:"text-2xs text-text-tertiary mt-0.5 leading-snug",children:e})}function H({error:t,id:e}){return t?n.jsx("p",{id:e,role:"alert",className:"text-2xs text-status-error mt-1 animate-[field-error-in_0.3s_ease-out]",children:t}):null}function z(t){return t?"input text-sm w-full mt-1 border-status-error/50 focus:border-status-error animate-[field-shake_0.4s_ease-in-out]":"input text-sm w-full mt-1"}function Bt(t){return t?"select text-sm mt-1 min-w-[min(16rem,100%)] max-w-full border-status-error/50 focus:border-status-error animate-[field-shake_0.4s_ease-in-out]":"select text-sm mt-1 min-w-[min(16rem,100%)] max-w-full"}function Kt({fieldKey:t,value:e,onChange:r,schema:s,isRequired:i}){const o=v.useRef(null),l=(s==null?void 0:s.accept)??void 0,c=U(t,s),d=s==null?void 0:s.description,u=v.useCallback(g=>{var w;const x=(w=g.target.files)==null?void 0:w[0];if(!x)return;const y=new FileReader;y.onload=()=>{typeof y.result=="string"&&r(y.result)},y.readAsDataURL(x)},[r]),a=e.startsWith("data:");return n.jsxs("div",{children:[n.jsx(E,{isRequired:i,children:c}),d&&n.jsx("p",{className:"text-2xs text-text-tertiary mt-0.5",children:d}),n.jsxs("div",{className:"mt-1",children:[n.jsx("input",{ref:o,type:"file",accept:l,onChange:u,className:"hidden"}),n.jsx("button",{type:"button",onClick:()=>{var g;return(g=o.current)==null?void 0:g.click()},className:"btn-secondary text-xs px-3 py-1.5",children:a?"Replace file":"Choose file"}),a&&n.jsx("span",{className:"ml-2 text-xs text-status-success",children:"File attached"})]})]})}function St({fieldKey:t,value:e,onChange:r,schema:s,isRequired:i}){const o=U(t,s),l=s==null?void 0:s.description,c=(s==null?void 0:s["x-lt-language"])??"",d=v.useCallback(u=>{if(u.key==="Tab"){u.preventDefault();const a=u.currentTarget,g=a.selectionStart,x=a.selectionEnd,y=e.substring(0,g)+" "+e.substring(x);r(y),requestAnimationFrame(()=>{a.selectionStart=a.selectionEnd=g+2})}},[e,r]);return n.jsxs("div",{children:[n.jsxs(E,{isRequired:i,children:[o,c&&n.jsx("span",{className:"ml-2 text-text-tertiary/60 normal-case font-normal",children:c})]}),l&&n.jsx("p",{className:"text-2xs text-text-tertiary mt-0.5",children:l}),n.jsx("textarea",{value:e,onChange:u=>r(u.target.value),onKeyDown:d,className:"input w-full mt-1 font-mono text-xs leading-relaxed",rows:10,spellCheck:!1})]})}function te({fieldKey:t,value:e,onChange:r,schema:s,isRequired:i}){const o=v.useRef(null),[l,c]=v.useState(!1),d=U(t,s),u=s==null?void 0:s.description;v.useEffect(()=>{const b=o.current;if(!b)return;const f=b.getContext("2d");if(f&&(f.lineWidth=2,f.lineCap="round",f.strokeStyle="#1E1535",e&&e.startsWith("data:"))){const N=new Image;N.onload=()=>f.drawImage(N,0,0),N.src=e}},[]);const a=v.useCallback(b=>{const f=o.current,N=f.getBoundingClientRect(),_=N.width>0?f.width/N.width:1,p=N.height>0?f.height/N.height:1;return"touches"in b?{x:(b.touches[0].clientX-N.left)*_,y:(b.touches[0].clientY-N.top)*p}:{x:(b.clientX-N.left)*_,y:(b.clientY-N.top)*p}},[]),g=v.useCallback(b=>{var _;c(!0);const f=(_=o.current)==null?void 0:_.getContext("2d");if(!f)return;const N=a(b);f.beginPath(),f.moveTo(N.x,N.y)},[a]),x=v.useCallback(b=>{var _;if(!l)return;const f=(_=o.current)==null?void 0:_.getContext("2d");if(!f)return;const N=a(b);f.lineTo(N.x,N.y),f.stroke()},[l,a]),y=v.useCallback(()=>{c(!1);const b=o.current;b&&r(b.toDataURL("image/png"))},[r]),w=v.useCallback(()=>{const b=o.current;if(!b)return;const f=b.getContext("2d");f&&(f.clearRect(0,0,b.width,b.height),r(""))},[r]);return n.jsxs("div",{children:[n.jsx(E,{isRequired:i,children:d}),u&&n.jsx("p",{className:"text-2xs text-text-tertiary mt-0.5",children:u}),n.jsx("div",{className:"mt-1 max-w-[25rem] border border-surface-border rounded-md overflow-hidden bg-white",children:n.jsx("canvas",{ref:o,width:400,height:150,className:"w-full cursor-crosshair touch-none",onMouseDown:g,onMouseMove:x,onMouseUp:y,onMouseLeave:y,onTouchStart:g,onTouchMove:x,onTouchEnd:y})}),n.jsx("button",{type:"button",onClick:w,className:"mt-1 text-2xs text-text-tertiary hover:text-accent transition-colors",children:"Clear"})]})}function ee({fieldKey:t,value:e,onChange:r,schema:s,isRequired:i}){const o=U(t,s),l=s==null?void 0:s.description;return n.jsxs("div",{children:[n.jsx(E,{isRequired:i,children:o}),l&&n.jsx("p",{className:"text-2xs text-text-tertiary mt-0.5",children:l}),n.jsx("textarea",{value:e,onChange:c=>r(c.target.value),className:"input w-full mt-1 text-sm leading-relaxed",rows:8,placeholder:"Supports plain text. Markdown formatting is preserved."})]})}function ne({fieldKey:t,value:e,onChange:r,schema:s,isRequired:i}){const[o,l]=v.useState("write"),c=U(t,s),d=s==null?void 0:s.description;return(s==null?void 0:s.readOnly)===!0?n.jsx(lt,{content:e,className:"my-1"}):n.jsxs("div",{children:[n.jsxs("div",{className:"flex items-center justify-between",children:[n.jsx(E,{isRequired:i,children:c}),n.jsx("div",{className:"flex items-center gap-0.5",children:["write","preview"].map(a=>n.jsx("button",{type:"button",onClick:()=>l(a),className:`px-2 py-0.5 text-2xs rounded transition-colors ${o===a?"bg-accent/10 text-accent font-semibold":"text-text-quaternary hover:text-text-secondary"}`,children:a==="write"?"Write":"Preview"},a))})]}),d&&n.jsx("p",{className:"text-2xs text-text-tertiary mt-0.5",children:d}),o==="write"?n.jsx("textarea",{value:e,onChange:a=>r(a.target.value),className:"input w-full mt-1 text-sm font-mono leading-relaxed",rows:10,placeholder:"Write markdown — headings, lists, tables, code blocks, and links all render."}):n.jsx("div",{className:"mt-1 px-3 py-2 border border-surface-border rounded min-h-[120px]",children:e.trim()?n.jsx(lt,{content:e}):n.jsx("p",{className:"text-xs text-text-quaternary italic",children:"Nothing to preview."})})]})}const se=28;function re({fieldKey:t,value:e,onChange:r,schema:s,escalationContext:i,isRequired:o,submitAttempted:l,error:c}){const d=(s==null?void 0:s["x-lt-require-all"])===!0,u=it(s==null?void 0:s["x-lt-source"],i);let a={};try{e&&(a=JSON.parse(e))}catch{}const g=(()=>{const p=Jt(s,a,i);return p?JSON.stringify(p):null})();v.useEffect(()=>{g&&r(g)},[g]);const x=p=>r(JSON.stringify({...a,[p]:!a[p]})),y=U(t,s),w=s==null?void 0:s.description;if(u.length===0)return n.jsxs(n.Fragment,{children:[n.jsx("p",{className:"text-xs text-text-tertiary italic mt-1",children:"No checklist items. None of the field's x-lt-source paths resolved on this escalation."}),c&&n.jsx("p",{className:"text-2xs text-status-error mt-1 animate-[field-error-in_0.3s_ease-out]",children:c})]});const b=s==null?void 0:s["x-lt-variant"],f=b==="chips"||b==="rows"?b:d||u.some(p=>p.label.length>se)?"rows":"chips",N=u.filter(p=>a[p.id]).length,_=(u.find(p=>!a[p.id]&&p.required!==!1)??u[0]).id;return n.jsxs("div",{role:"group","aria-label":y,"aria-required":o||void 0,"aria-invalid":c?!0:void 0,children:[n.jsx(E,{isRequired:o,children:y}),w&&n.jsx(W,{children:w}),f==="chips"?n.jsx("div",{className:"flex flex-wrap gap-2 mt-2",children:u.map(p=>{const $=a[p.id]??!1,C=!$&&!!l&&N===0&&(p.required||o);return n.jsxs("label",{className:`inline-flex items-center gap-1.5 cursor-pointer select-none px-3.5 py-2 text-sm border transition-colors rounded-[var(--lt-radius-field)] ${$?"bg-accent border-accent text-text-inverse":C?"bg-surface-field border-status-error/60 text-status-error":"bg-surface-field border-surface-field-border text-text-secondary hover:border-accent hover:text-text-primary"}`,children:[n.jsx("input",{type:"checkbox",checked:$,onChange:()=>x(p.id),className:"sr-only","data-testid":`checklist-item-${p.id}`,...p.id===_?{"data-field-key":t}:{}}),$&&n.jsx(Et,{className:"w-3.5 h-3.5 shrink-0",strokeWidth:2.5}),p.label]},p.id)})}):n.jsx("div",{className:"space-y-2.5 mt-2",children:u.map(p=>{const $=a[p.id]??!1,C=!$&&!!l&&(d?p.required!==!1:N===0&&(p.required||o));return n.jsxs("label",{className:`flex items-start gap-3 cursor-pointer group select-none rounded px-2 py-1 -mx-2 transition-colors ${C?"bg-status-error/5":"hover:bg-surface-hover"}`,children:[n.jsx("input",{type:"checkbox",checked:$,onChange:()=>x(p.id),className:`mt-0.5 w-3.5 h-3.5 shrink-0 rounded ${C?"accent-status-error":"accent-accent"}`,"data-testid":`checklist-item-${p.id}`,...p.id===_?{"data-field-key":t}:{}}),n.jsxs("span",{className:`text-sm leading-snug transition-colors ${C?"text-status-error":"text-text-secondary group-hover:text-text-primary"}`,children:[p.label,p.required&&n.jsx("span",{className:`ml-0.5 text-2xs ${C?"text-status-error":"text-text-quaternary"}`,children:"*"})]})]},p.id)})}),n.jsx("p",{className:"text-2xs text-text-quaternary mt-3 tabular-nums",children:f==="chips"?n.jsxs(n.Fragment,{children:[N," selected",o&&N===0&&!!l&&n.jsx("span",{className:"ml-1 text-text-quaternary/60",children:"(check at least one)"})]}):n.jsxs(n.Fragment,{children:[N," / ",u.length," confirmed",d?n.jsxs("span",{className:"ml-1 text-text-quaternary/60",children:["(all required",u.some(p=>p.required===!1)?" except optional":"",")"]}):o&&N===0&&!!l&&n.jsx("span",{className:"ml-1 text-text-quaternary/60",children:"(at least one required)"})]})}),c&&n.jsx("p",{role:"alert",className:"text-2xs text-status-error mt-1 animate-[field-error-in_0.3s_ease-out]",children:c})]})}const ie=/\.(png|jpe?g|gif|webp|avif|bmp|svg)(\?.*)?$/i;function oe(t){var s,i,o,l;const e=t.trim();if(!e)return{kind:"none"};const r=(i=(s=/^data:([^;,]+)[;,]/.exec(e))==null?void 0:s[1])==null?void 0:i.toLowerCase();if(r)return r.startsWith("image/")?{kind:"image",src:e}:{kind:"file",href:e,label:r==="application/pdf"?"PDF":r,isData:!0};if(/^https?:\/\//i.test(e)){if(ie.test(e))return{kind:"image",src:e};const c=(l=(o=/\.([a-z0-9]{2,5})(\?.*)?$/i.exec(e))==null?void 0:o[1])==null?void 0:l.toUpperCase();return{kind:"file",href:e,label:c??"attachment",isData:!1}}return{kind:"none"}}function ut({fieldKey:t,value:e,schema:r}){const[s,i]=v.useState(!1),o=oe(e??""),l=t.replace(/[_-]/g," "),c=r==null?void 0:r.description,d=n.jsxs(n.Fragment,{children:[n.jsx("label",{className:"text-2xs font-semibold uppercase tracking-widest text-text-tertiary",children:l}),c&&n.jsx("p",{className:"text-2xs text-text-tertiary mt-0.5",children:c})]});return o.kind==="none"?n.jsxs("div",{children:[d,n.jsx("p",{className:"text-xs text-text-quaternary italic mt-1",children:"No attachment"})]}):o.kind==="image"?n.jsxs("div",{children:[d,n.jsxs("div",{className:"mt-1",children:[n.jsx("button",{type:"button",onClick:()=>i(!0),className:"block rounded-[0.125em] border border-surface-border overflow-hidden hover:border-accent transition-colors",title:"View full size",children:n.jsx("img",{src:o.src,alt:t.replace(/[_-]/g," "),className:"max-h-48 max-w-full object-contain","data-testid":`attachment-image-${t}`})}),s&&n.jsx("div",{className:"fixed inset-0 z-[100] bg-text-primary/60 backdrop-blur-sm flex items-center justify-center p-8 cursor-zoom-out",onClick:()=>i(!1),role:"dialog","aria-modal":"true","aria-label":`${l} — full size`,children:n.jsx("img",{src:o.src,alt:l,className:"max-h-[90vh] max-w-[90vw] object-contain"})})]})]}):n.jsxs("div",{children:[d,n.jsx("div",{className:"mt-1",children:n.jsxs("a",{href:o.href,...o.isData?{download:`${t}.${o.label==="PDF"?"pdf":"bin"}`}:{target:"_blank",rel:"noopener noreferrer"},className:"inline-flex items-center gap-1.5 text-xs text-accent hover:text-accent-hover transition-colors","data-testid":`attachment-link-${t}`,children:[n.jsx(_t,{className:"w-3.5 h-3.5",strokeWidth:1.5}),o.isData?`Download ${o.label}`:`Open ${o.label}`,o.isData?n.jsx(Ot,{className:"w-3 h-3",strokeWidth:1.5}):n.jsx(K,{className:"w-3 h-3",strokeWidth:1.5})]})})]})}function ae({fieldKey:t,schema:e,escalationContext:r}){const s=(e==null?void 0:e["x-lt-href"])??"",i=s&&r?Y(s,r):s,o=(e==null?void 0:e.title)??(e==null?void 0:e.description)??"Open",l=e==null?void 0:e.description,c=i.startsWith("/"),d=!i.trim();return n.jsxs("div",{"data-field-key":t,children:[n.jsx(E,{children:o}),l&&n.jsx(W,{children:l}),n.jsx("div",{className:"mt-1",children:d?n.jsx("span",{className:"text-xs text-text-quaternary italic",children:"No link configured"}):c?n.jsxs(gt,{to:i,className:"inline-flex items-center gap-1 text-xs text-accent hover:text-accent-hover transition-colors","data-testid":`link-widget-${t}`,children:[o,n.jsx(K,{className:"w-3 h-3 shrink-0",strokeWidth:1.5})]}):n.jsxs("a",{href:i,target:"_blank",rel:"noreferrer",className:"inline-flex items-center gap-1 text-xs text-accent hover:text-accent-hover transition-colors","data-testid":`link-widget-${t}`,children:[o,n.jsx(K,{className:"w-3 h-3 shrink-0",strokeWidth:1.5})]})})]})}function yt({to:t,className:e=""}){return n.jsxs(gt,{to:t,title:"View details",tabIndex:-1,className:`inline-flex items-center justify-center w-6 h-6 shrink-0 rounded border border-surface-border text-accent/70 hover:text-accent hover:border-accent/60 hover:bg-accent/5 transition-colors ${e}`,children:[n.jsx($t,{className:"w-3.5 h-3.5",strokeWidth:2}),n.jsx("span",{className:"sr-only",children:"View details"})]})}const pt="—";function le(t,e){if(!t||!e)return"";const r=t.indexOf(".");if(r===-1)return"";const s=t.slice(0,r),i=t.slice(r+1);try{const o=et(e[s],i);return typeof o=="string"?o:""}catch{return""}}function ce(t,e){if(!t||t===pt)return pt;if(e==="age"){const r=new Date(t);return Number.isNaN(r.getTime())?t:st(t)}return t}function de({fieldKey:t,schema:e,escalationContext:r}){const s=e==null?void 0:e["x-lt-source"],i=(e==null?void 0:e["x-lt-fields"])??[],o=(e==null?void 0:e.title)??"Linked escalation",l=e==null?void 0:e.description,c=le(s,r),{data:d,isLoading:u,isError:a}=Dt(c);return n.jsxs("div",{"data-field-key":t,children:[n.jsx(E,{children:o}),l&&n.jsx(W,{children:l}),n.jsx("div",{className:"mt-1",children:!c||a?n.jsx("p",{className:"text-xs text-text-quaternary italic","data-testid":`escalation-widget-empty-${t}`,children:"No linked record"}):u?n.jsx(ue,{}):d?n.jsx(xe,{esc:d,fields:i,fieldKey:t}):n.jsx("p",{className:"text-xs text-text-quaternary italic",children:"No linked record"})})]})}function xe({esc:t,fields:e,fieldKey:r}){if(!t)return null;const s=nt(t);return n.jsxs("div",{className:"border-l-2 border-accent-faint pl-3 py-2 space-y-2","data-testid":`escalation-widget-card-${r}`,children:[n.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[n.jsxs("span",{className:"text-2xs font-semibold uppercase tracking-wider text-text-secondary",children:[t.type,t.subtype&&t.subtype!==t.type?` · ${t.subtype}`:""]}),n.jsx(Lt,{status:t.status})]}),t.description&&n.jsx("p",{className:"text-xs text-text-primary leading-snug",children:t.description}),e.length>0&&n.jsx("dl",{className:"grid grid-cols-[auto_1fr] gap-x-4 gap-y-0.5",children:e.map(i=>{const o=Y(i.value,s),l=ce(o,i.format);return n.jsxs("div",{className:"contents",children:[n.jsx("dt",{className:"text-2xs text-text-tertiary whitespace-nowrap",children:i.label}),n.jsx("dd",{className:"text-2xs text-text-primary",children:l})]},i.label)})}),n.jsxs("div",{className:"flex items-center justify-between gap-2",children:[n.jsxs("span",{className:"text-2xs text-text-quaternary",children:[t.role," · ",st(t.created_at)]}),n.jsx(yt,{to:`/escalations/detail/${t.id}`})]})]})}function ue(){return n.jsxs("div",{className:"border-l-2 border-accent-faint pl-3 py-2 space-y-2 animate-pulse",children:[n.jsx("div",{className:"h-3 w-32 bg-surface-sunken rounded"}),n.jsx("div",{className:"h-3 w-48 bg-surface-sunken rounded"}),n.jsx("div",{className:"h-3 w-24 bg-surface-sunken rounded"})]})}function pe(t,e){if(!t)return{};const r={};for(const[s,i]of Object.entries(t))r[s]=typeof i=="string"?Y(i,e):i;return r}function fe(t,e,r){const s=pe(t.facets,e),i={role:t.role,status:t.status??"pending",facets:s,limit:t.limit,enabled:!!(t.role||Object.keys(s).length)};return t.assigned==="me"?{...i,assigned_to:r,available:!1,enabled:i.enabled&&!!r}:t.assigned==="any"?i:{...i,available:t.available??!0}}const ge=[{label:"Description",value:"{{escalation.description}}"},{label:"Role",value:"{{escalation.role}}"},{label:"Age",value:"{{escalation.created_at}}",format:"age"}],ft="—";function be(t,e){if(!t||t===ft)return ft;if(e==="age"){const r=new Date(t);return Number.isNaN(r.getTime())?t:st(t)}return t}function tt(t,e){return typeof t=="string"?Y(t,e):Array.isArray(t)?t.map(r=>tt(r,e)):t&&typeof t=="object"?Object.fromEntries(Object.entries(t).map(([r,s])=>[r,tt(s,e)])):t}function me({fieldKey:t,schema:e,escalationContext:r}){const s=(e==null?void 0:e["x-lt-query"])??{},i=(e==null?void 0:e["x-lt-columns"])??ge,o=(e==null?void 0:e["x-lt-actions"])??[],l=(e==null?void 0:e.title)??"Related items",c=e==null?void 0:e.description,d=r??{},{user:u}=Mt(),a=fe(s,d,u==null?void 0:u.userId),{data:g,isLoading:x}=It({role:a.role,status:a.status,facets:a.facets,assigned_to:a.assigned_to,available:a.available,limit:a.limit??5,enabled:a.enabled,include:Ft({columns:i,actions:o})?"envelope":void 0}),y=(g==null?void 0:g.escalations)??[],w=Wt(),[b,f]=v.useState({}),[N,_]=v.useState(null),p=async($,C)=>{const R=nt($);if(!(C.confirm&&!window.confirm(Y(C.confirm,R)))){_($.id),f(I=>({...I,[$.id]:""}));try{await w.mutateAsync({id:$.id,resolverPayload:tt(C.resolverPayload,R)})}catch(I){f(P=>({...P,[$.id]:I.message}))}finally{_(null)}}};return n.jsxs("div",{"data-field-key":t,children:[n.jsx(E,{children:l}),c&&n.jsx(W,{children:c}),n.jsx("div",{className:"mt-1","data-testid":`escalation-list-widget-${t}`,children:x?n.jsx(ye,{columns:i.length}):n.jsx(je,{escalations:y,columns:i,fieldKey:t,actions:o,onAction:p,pendingRow:N,rowErrors:b})})]})}function je({escalations:t,columns:e,fieldKey:r,actions:s,onAction:i,pendingRow:o,rowErrors:l}){return t.length===0?n.jsx("p",{className:"text-xs text-text-quaternary italic py-1","data-testid":`escalation-list-empty-${r}`,children:"No items found"}):n.jsxs("table",{className:"w-full text-xs border-collapse","data-testid":`escalation-list-table-${r}`,children:[n.jsx("thead",{children:n.jsxs("tr",{className:"border-b border-surface-border",children:[e.map(c=>n.jsx("th",{className:"text-left text-2xs font-semibold uppercase tracking-wider text-text-tertiary pb-1 pr-3 last:pr-0",children:c.label},c.label)),s.length>0&&n.jsx("th",{className:"w-px"}),n.jsx("th",{className:"w-8"})]})}),n.jsx("tbody",{children:t.map(c=>{const d=nt(c),u=l[c.id];return n.jsxs("tr",{className:"border-b border-surface-border/50 last:border-0 hover:bg-surface-sunken/50 transition-colors",children:[e.map(a=>{const g=Y(a.value,d),x=be(g,a.format);return n.jsx("td",{className:"py-1 pr-3 last:pr-0 text-text-primary align-top",children:x},a.label)}),s.length>0&&n.jsxs("td",{className:"py-1 pr-2 align-top whitespace-nowrap",children:[s.map(a=>n.jsx("button",{type:"button",onClick:()=>i(c,a),disabled:o===c.id,className:"px-2 py-0.5 text-2xs font-medium text-accent border border-accent/40 rounded hover:bg-accent/10 disabled:opacity-40 disabled:cursor-default transition-colors ml-1 first:ml-0","data-testid":`escalation-list-action-${c.id}`,children:a.label},a.label)),u&&n.jsx("p",{className:"text-2xs text-status-error mt-0.5 whitespace-normal max-w-[16rem]","data-testid":`escalation-list-action-error-${c.id}`,children:u})]}),n.jsx("td",{className:"py-1 pl-2 align-top",children:n.jsx(yt,{to:`/escalations/detail/${c.id}`})})]},c.id)})})]})}function ye({columns:t}){return n.jsx("div",{className:"space-y-1.5 animate-pulse",children:[0,1,2].map(e=>n.jsx("div",{className:"flex gap-4",children:Array.from({length:t},(r,s)=>n.jsx("div",{className:"h-3 bg-surface-sunken rounded flex-1"},s))},e))})}const Z={"file-upload":Kt,"code-editor":St,signature:te,"rich-text":ee,markdown:ne,checklist:re,attachment:ut,image:ut,link:ae,escalation:de,"escalation-list":me};function ht({fieldKey:t,value:e,onChange:r,onBlur:s,schema:i,isRequired:o,isReadOnly:l,error:c,escalationContext:d,submitAttempted:u}){var P;const a=(P=i==null?void 0:i.properties)==null?void 0:P[t],g=U(t,a),x=a==null?void 0:a["x-lt-widget"],y=`lt-field-${t}`,w=`${y}-error`,b=`${y}-help`,f=typeof(a==null?void 0:a.description)=="string"&&a.description.length>0?a.description:void 0,p={id:y,"aria-required":o||void 0,"aria-invalid":c?!0:void 0,"aria-describedby":c?w:f!==void 0?b:void 0},$=x==="markdown"&&typeof e=="string",C=(x==="attachment"||x==="image")&&typeof e=="string",R=!!(x&&x in Z);if(l&&!$&&!C&&!R){const A=e===null?"null":typeof e=="object"?JSON.stringify(e,null,2):String(e);return n.jsxs("div",{children:[n.jsx(E,{isRequired:o,children:g}),n.jsx("p",{className:"text-sm text-text-secondary mt-0.5 whitespace-pre-wrap",children:A})]})}if(x&&x in Z){const A=Z[x],O=o||(a==null?void 0:a["x-lt-require-all"])===!0,k={fieldKey:t,schema:a,escalationContext:d,isRequired:O,submitAttempted:u,error:c};if((a==null?void 0:a.type)==="object"){const T=typeof e=="string"?e:typeof e=="object"&&e!==null&&!Array.isArray(e)?JSON.stringify(e):"";return n.jsx(A,{...k,value:T,onChange:F=>{try{r(JSON.parse(F))}catch{r(F)}}})}if(typeof e=="string")return n.jsx(A,{...k,value:e,onChange:T=>r(T)});if(typeof e=="object"&&e!==null&&!Array.isArray(e))return n.jsx(A,{...k,value:JSON.stringify(e),onChange:T=>{try{r(JSON.parse(T))}catch{r(T)}}})}const I=mt(a,d);if(I&&(e===null||typeof e=="string"||typeof e=="number")){const A=e===null?"":String(e),O=I.some(k=>String(k.value)===A);return n.jsxs("div",{children:[n.jsx(E,{isRequired:o,htmlFor:y,children:g}),f&&n.jsx(W,{id:b,children:f}),n.jsxs("select",{value:O?A:"",disabled:I.length===0,onChange:k=>{const T=I.find(F=>String(F.value)===k.target.value);r(T?T.value:k.target.value)},onBlur:s,"data-field-key":t,className:Bt(!!c),...p,children:[!O&&n.jsx("option",{value:"",disabled:!0,children:"Choose…"}),I.map(k=>n.jsx("option",{value:String(k.value),children:k.label},String(k.value)))]}),n.jsx(H,{error:c,id:w})]})}if(typeof e=="boolean")return n.jsxs("div",{children:[n.jsxs("label",{className:"flex items-center gap-2 cursor-pointer",children:[n.jsx("input",{type:"checkbox",checked:e,onChange:A=>{r(A.target.checked),s==null||s()},className:"w-3.5 h-3.5 rounded accent-accent","data-field-key":t,...p}),n.jsxs("span",{className:"text-2xs font-semibold uppercase tracking-wider text-text-secondary",children:[g,o&&n.jsx("span",{className:"text-status-error ml-0.5",children:"*"})]})]}),f&&n.jsx(W,{id:b,children:f}),n.jsx(H,{error:c,id:w})]});if(typeof e=="number")return n.jsxs("div",{children:[n.jsx(E,{isRequired:o,htmlFor:y,children:g}),f&&n.jsx(W,{id:b,children:f}),n.jsx("input",{type:"number",value:e,onChange:A=>r(parseFloat(A.target.value)||0),onBlur:s,step:"any","data-field-key":t,className:`${z(!!c)} max-w-48`,...p}),n.jsx(H,{error:c,id:w})]});if(typeof e=="string"){if((a==null?void 0:a.format)==="password")return n.jsxs("div",{children:[n.jsx(E,{isRequired:o,htmlFor:y,children:g}),f&&n.jsx(W,{id:b,children:f}),n.jsx("input",{type:"password",value:e,onChange:F=>r(F.target.value),onBlur:s,"data-field-key":t,className:z(!!c),autoComplete:"off",...p}),n.jsx(H,{error:c,id:w})]});const O=a==null?void 0:a.format,k={date:"date","date-time":"datetime-local",email:"email",uri:"url"},T={date:"max-w-48","date-time":"max-w-64"};if(O&&O in k)return n.jsxs("div",{children:[n.jsx(E,{isRequired:o,htmlFor:y,children:g}),f&&n.jsx(W,{id:b,children:f}),n.jsx("input",{type:k[O],value:e,onChange:F=>r(F.target.value),onBlur:s,"data-field-key":t,className:`${z(!!c)} ${T[O]??""}`,...p}),n.jsx(H,{error:c,id:w})]});if(O==="textarea"||e.length>80){const F=a==null?void 0:a.maxLength,J=a==null?void 0:a["x-lt-max-length"];let M=F;if(M===void 0&&J&&d){const q=J.indexOf(".");if(q!==-1){const G=J.slice(0,q),Q=J.slice(q+1),m=d[G];if(m&&typeof m=="object"){let h=m;for(const j of Q.split("."))if(h=h[j],h===void 0)break;if(typeof h=="number")M=h;else if(typeof h=="string"){const j=Number(h);Number.isNaN(j)||(M=j)}}}}const V=M!==void 0&&e.length>M;return n.jsxs("div",{children:[n.jsx(E,{isRequired:o,htmlFor:y,children:g}),f&&n.jsx(W,{id:b,children:f}),n.jsx("textarea",{value:e,onChange:q=>{r(q.target.value),s==null||s()},onBlur:s,"data-field-key":t,className:`${z(!!c)} leading-relaxed`,rows:Math.min(6,Math.max(3,Math.ceil(e.length/60))),...p}),M!==void 0&&n.jsxs("p",{className:`text-2xs mt-0.5 text-right tabular-nums ${V?"text-status-error font-medium":"text-text-quaternary"}`,children:[e.length," / ",M]}),n.jsx(H,{error:c,id:w})]})}return n.jsxs("div",{children:[n.jsx(E,{isRequired:o,htmlFor:y,children:g}),f&&n.jsx(W,{id:b,children:f}),n.jsx("input",{type:"text",value:e,onChange:F=>r(F.target.value),onBlur:s,"data-field-key":t,className:z(!!c),...p}),n.jsx(H,{error:c,id:w})]})}if(e===null)return n.jsxs("div",{children:[n.jsx(E,{isRequired:o,children:g}),n.jsx("p",{className:"text-xs text-text-tertiary italic mt-1",children:"null"})]});if(Array.isArray(e))return n.jsxs("div",{children:[n.jsx(E,{isRequired:o,children:g}),n.jsx("div",{className:"flex flex-wrap gap-1.5 mt-1",children:e.map((A,O)=>n.jsx("span",{className:"px-2 py-0.5 text-2xs font-mono bg-surface-sunken rounded text-text-secondary",children:String(A)},O))})]});if(typeof e=="object"){const A=Object.entries(e);return n.jsxs("div",{children:[n.jsx(E,{isRequired:o,children:g}),n.jsx("div",{className:"ml-4 mt-2 pl-4 border-l border-accent-faint space-y-3",children:A.map(([O,k])=>n.jsx(ht,{fieldKey:O,value:k,onChange:T=>r({...e,[O]:T})},O))})]})}return null}function he({items:t,columns:e=1}){if(t.length===0)return null;const r=e>=2&&t.length>1?"grid-cols-1 @dict-inline:grid-cols-[max-content_1fr] @dict-pairs:grid-cols-[max-content_1fr_max-content_1fr]":"grid-cols-1 @dict-inline:grid-cols-[max-content_1fr]";return n.jsx("div",{className:"@container",children:n.jsx("dl",{className:`grid ${r} items-baseline gap-x-6 @dict-pairs:gap-x-8 gap-y-1.5`,children:t.map(({key:s,label:i,value:o})=>n.jsxs(v.Fragment,{children:[n.jsx("dt",{className:"text-2xs font-semibold uppercase tracking-wide text-text-secondary mt-2 first:mt-0 @dict-inline:mt-0",children:i}),n.jsx("dd",{className:"text-sm text-text-primary break-words min-w-0","data-field-key":s,children:Ne(o)})]},s))})})}function Ne(t){return t==null||t===""?"—":typeof t=="boolean"?t?"Yes":"No":typeof t=="object"?JSON.stringify(t):String(t)}const B="dictionary",ve=new Set(["markdown","attachment","image"]);function Nt(t,e){if(!e)return;const r=t==null?void 0:t["x-lt-section-options"],s=r==null?void 0:r[e];return s&&typeof s=="object"?s:void 0}function we(t,e,r){var c,d;const s=(c=t==null?void 0:t.properties)==null?void 0:c[r];if((s==null?void 0:s.readOnly)!==!0)return!1;const i=s==null?void 0:s["x-lt-widget"];if(typeof i=="string"&&ve.has(i))return!1;const o=s==null?void 0:s["x-lt-display"];if(typeof o=="string")return o===B;const l=(d=Nt(t,e))==null?void 0:d.display;return typeof l=="string"?l===B:(t==null?void 0:t["x-lt-display"])===B}function ke(t,e,r,s){var o;const i=[];for(const l of t){const[c]=l,d=i[i.length-1];if(we(e,r,c)){(d==null?void 0:d.kind)==="dictionary"?d.entries.push(l):i.push({kind:"dictionary",entries:[l]});continue}const u=(o=e==null?void 0:e.properties)==null?void 0:o[c],a=u==null?void 0:u["x-lt-column-group"];if(s==="two-column"&&typeof a=="string"&&a.trim()){(d==null?void 0:d.kind)==="column-group"&&d.name===a?d.entries.push(l):i.push({kind:"column-group",name:a,entries:[l]});continue}i.push({kind:"field",entry:l})}return i}function Ae({name:t,entries:e,formSchema:r,layout:s,renderField:i}){const o=ke(e,r,t,s),l=Nt(r,t),c=(l==null?void 0:l.columns)??(s==="two-column"?2:1),d=a=>a.map(([g,x])=>{var y;return{key:g,label:U(g,(y=r==null?void 0:r.properties)==null?void 0:y[g]),value:x}}),u=()=>o.map((a,g)=>a.kind==="dictionary"?n.jsx("div",{className:s==="two-column"?"col-span-full":"",children:n.jsx(he,{items:d(a.entries),columns:c})},`dict-${g}`):a.kind==="column-group"?n.jsx("div",{className:"@container",children:n.jsx("div",{className:"grid grid-cols-1 @grp-cols:grid-cols-2 gap-x-4 gap-y-5",children:a.entries.map(x=>i(x))})},`group-${a.name}-${g}`):i(a.entry));return n.jsxs("div",{className:t?"border border-surface-border bg-surface-sunken rounded-[var(--lt-radius-section)] p-4 animate-[section-enter_0.25s_ease-out]":"",children:[t&&n.jsx("p",{className:"mb-4 text-[1.40625rem] font-semibold tracking-wider text-heading [font-variant-caps:small-caps]",children:t}),s==="two-column"?n.jsx("div",{className:"@container",children:n.jsx("div",{className:"grid grid-cols-1 @form-cols:grid-cols-2 gap-x-col-gap gap-y-5",children:u()})}):n.jsx("div",{className:"space-y-5",children:u()})]})}function Fe({value:t,onChange:e,disabled:r,submitAttempted:s,escalationContext:i,onOpenHelp:o,onDisabledClick:l,disabledHint:c}){var G,Q;const[d,u]=v.useState({}),[a,g]=v.useState({}),[x,y]=v.useState(null),[w,b]=v.useState(!1),[f,N]=v.useState(new Set);v.useEffect(()=>{try{const m=JSON.parse(t);if(typeof m=="object"&&m!==null&&!Array.isArray(m)){const h={},j={};for(const[D,L]of Object.entries(m))D.startsWith("_")?j[D]=L:h[D]=L;u(h),g(j),y(j._form_schema&&typeof j._form_schema=="object"?j._form_schema:null),b(!1)}}catch{b(!0)}},[t]);const _=v.useCallback(m=>{u(m),e(JSON.stringify({...m,...a},null,2))},[a,e]),p=v.useCallback((m,h)=>{_({...d,[m]:h})},[d,_]),$=v.useCallback(m=>{N(h=>{if(h.has(m))return h;const j=new Set(h);return j.add(m),j})},[]);if(w)return n.jsx("p",{className:"text-xs text-status-error",children:"Unable to parse resolver data as form. Use the JSON editor below."});const C=Object.entries(d);if(C.length===0)return n.jsx("p",{className:"text-xs text-text-tertiary italic",children:"No resolver fields defined."});const R=x==null?void 0:x["x-lt-order"],I=R?[...C].sort((m,h)=>{const j=R.indexOf(m[0]),D=R.indexOf(h[0]);return(j===-1?1/0:j)-(D===-1?1/0:D)}):C,P={...i??{},resolver:d,input:d},A=I.filter(([m,h])=>{var D;const j=(D=x==null?void 0:x.properties)==null?void 0:D[m];return!(!jt(j==null?void 0:j["x-lt-showIf"],P)||(j==null?void 0:j["x-lt-hide-if-empty"])===!0&&(h==null||h===""||h===!1||h===0))}),O=new Set((x==null?void 0:x.required)??[]),k=x==null?void 0:x["x-lt-layout"],T=x==null?void 0:x.title,F=x==null?void 0:x.description,J=typeof(x==null?void 0:x["x-lt-help"])=="string"||typeof(x==null?void 0:x["x-lt-context"])=="string",M=[];for(const m of A){const[h]=m,j=(G=x==null?void 0:x.properties)==null?void 0:G[h],D=((Q=j==null?void 0:j["x-lt-section"])==null?void 0:Q.trim())||null,L=M[M.length-1];!L||L.name!==D?M.push({name:D,entries:[m]}):L.entries.push(m)}const V=([m,h])=>{var at;const j=(at=x==null?void 0:x.properties)==null?void 0:at[m],D=(j==null?void 0:j.readOnly)===!0,L=(j==null?void 0:j["x-lt-span"])??1,ot=O.has(m),vt=f.has(m)||!!s,wt=Gt(h,j,ot,vt,P);return n.jsx("div",{className:`animate-[field-enter_0.2s_ease-out] ${k==="two-column"&&L>=2?"col-span-full":""}`,children:n.jsx(ht,{fieldKey:m,value:h,onChange:kt=>p(m,kt),onBlur:()=>$(m),schema:x,isRequired:ot,isReadOnly:D,error:wt,escalationContext:P,submitAttempted:!!s})},m)},q=n.jsxs("div",{className:r?"pointer-events-none":void 0,inert:r||void 0,"aria-disabled":r||void 0,children:[T&&n.jsxs("div",{className:"mb-1 flex items-center gap-1.5",children:[n.jsx("h3",{className:"heading-3",children:T}),J&&o&&n.jsx("button",{type:"button",onClick:o,title:"Open instructions","aria-label":"Open instructions",className:"p-1 rounded-md text-text-tertiary hover:text-accent hover:bg-surface-hover transition-colors",children:n.jsx(Ct,{className:"w-4 h-4",strokeWidth:1.5})})]}),F&&n.jsx("p",{className:"text-sm text-text-secondary leading-relaxed mb-6",children:F}),n.jsx("div",{className:"space-y-8",children:M.map((m,h)=>n.jsx(Ae,{name:m.name,entries:m.entries,formSchema:x,layout:k,renderField:V},m.name??`__s${h}`))})]});return r?n.jsx(Zt,{hint:c,onLockedClick:l,children:q}):n.jsx("div",{className:"pb-8 max-w-form",children:q})}export{Fe as R,U as d,jt as e,fe as r,Gt as v};
|
|
2
|
-
//# sourceMappingURL=ResolverForm-Dy0yirtP.js.map
|