@datatechsolutions/ui 2.10.9 → 2.11.1
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/package.json +2 -1
- package/dist/astrlabe/contracts.d.mts +0 -293
- package/dist/astrlabe/contracts.d.ts +0 -293
- package/dist/astrlabe/contracts.js +0 -5
- package/dist/astrlabe/contracts.js.map +0 -1
- package/dist/astrlabe/contracts.mjs +0 -4
- package/dist/astrlabe/contracts.mjs.map +0 -1
- package/dist/astrlabe/graph-node.d.mts +0 -28
- package/dist/astrlabe/graph-node.d.ts +0 -28
- package/dist/astrlabe/graph-node.js +0 -27
- package/dist/astrlabe/graph-node.js.map +0 -1
- package/dist/astrlabe/graph-node.mjs +0 -6
- package/dist/astrlabe/graph-node.mjs.map +0 -1
- package/dist/astrlabe/index.d.mts +0 -707
- package/dist/astrlabe/index.d.ts +0 -707
- package/dist/astrlabe/index.js +0 -3248
- package/dist/astrlabe/index.js.map +0 -1
- package/dist/astrlabe/index.mjs +0 -2957
- package/dist/astrlabe/index.mjs.map +0 -1
- package/dist/astrlabe/utils.d.mts +0 -71
- package/dist/astrlabe/utils.d.ts +0 -71
- package/dist/astrlabe/utils.js +0 -31
- package/dist/astrlabe/utils.js.map +0 -1
- package/dist/astrlabe/utils.mjs +0 -6
- package/dist/astrlabe/utils.mjs.map +0 -1
- package/dist/astrlabe/workflow-canvas.d.mts +0 -5
- package/dist/astrlabe/workflow-canvas.d.ts +0 -5
- package/dist/astrlabe/workflow-canvas.js +0 -20
- package/dist/astrlabe/workflow-canvas.js.map +0 -1
- package/dist/astrlabe/workflow-canvas.mjs +0 -11
- package/dist/astrlabe/workflow-canvas.mjs.map +0 -1
- package/dist/astrlabe/workflow-preview-canvas.d.mts +0 -10
- package/dist/astrlabe/workflow-preview-canvas.d.ts +0 -10
- package/dist/astrlabe/workflow-preview-canvas.js +0 -28
- package/dist/astrlabe/workflow-preview-canvas.js.map +0 -1
- package/dist/astrlabe/workflow-preview-canvas.mjs +0 -26
- package/dist/astrlabe/workflow-preview-canvas.mjs.map +0 -1
- package/dist/chunk-3GDQP6AS.mjs +0 -15
- package/dist/chunk-3GDQP6AS.mjs.map +0 -1
- package/dist/chunk-3GE3MBUZ.js +0 -279
- package/dist/chunk-3GE3MBUZ.js.map +0 -1
- package/dist/chunk-55H6WZQP.js +0 -5
- package/dist/chunk-55H6WZQP.js.map +0 -1
- package/dist/chunk-7VJ7CMMT.mjs +0 -96
- package/dist/chunk-7VJ7CMMT.mjs.map +0 -1
- package/dist/chunk-AM2TTPYM.mjs +0 -189
- package/dist/chunk-AM2TTPYM.mjs.map +0 -1
- package/dist/chunk-BLNXRUC4.mjs +0 -276
- package/dist/chunk-BLNXRUC4.mjs.map +0 -1
- package/dist/chunk-D2JF6C3E.mjs +0 -46
- package/dist/chunk-D2JF6C3E.mjs.map +0 -1
- package/dist/chunk-DFR6CMJH.js +0 -197
- package/dist/chunk-DFR6CMJH.js.map +0 -1
- package/dist/chunk-JB6RNAD2.mjs +0 -4
- package/dist/chunk-JB6RNAD2.mjs.map +0 -1
- package/dist/chunk-LTWL7B4K.mjs +0 -7167
- package/dist/chunk-LTWL7B4K.mjs.map +0 -1
- package/dist/chunk-OZNTQROP.mjs +0 -39
- package/dist/chunk-OZNTQROP.mjs.map +0 -1
- package/dist/chunk-P4YYEM4B.js +0 -44
- package/dist/chunk-P4YYEM4B.js.map +0 -1
- package/dist/chunk-QWG2FMUN.mjs +0 -60
- package/dist/chunk-QWG2FMUN.mjs.map +0 -1
- package/dist/chunk-S3GAARSA.js +0 -7228
- package/dist/chunk-S3GAARSA.js.map +0 -1
- package/dist/chunk-S7KHTUHA.js +0 -65
- package/dist/chunk-S7KHTUHA.js.map +0 -1
- package/dist/chunk-UPTU224P.js +0 -23923
- package/dist/chunk-UPTU224P.js.map +0 -1
- package/dist/chunk-UZ3CMNUJ.js +0 -49
- package/dist/chunk-UZ3CMNUJ.js.map +0 -1
- package/dist/chunk-VUNV25KB.js +0 -18
- package/dist/chunk-VUNV25KB.js.map +0 -1
- package/dist/chunk-WURR63IK.mjs +0 -23189
- package/dist/chunk-WURR63IK.mjs.map +0 -1
- package/dist/chunk-YXN2K77G.js +0 -102
- package/dist/chunk-YXN2K77G.js.map +0 -1
- package/dist/entity-drawer-D2H7ugi9.d.mts +0 -31
- package/dist/entity-drawer-D2H7ugi9.d.ts +0 -31
- package/dist/index.d.mts +0 -4791
- package/dist/index.d.ts +0 -4791
- package/dist/index.js +0 -2893
- package/dist/index.js.map +0 -1
- package/dist/index.mjs +0 -8
- package/dist/index.mjs.map +0 -1
- package/dist/lib/i18n-context.d.mts +0 -36
- package/dist/lib/i18n-context.d.ts +0 -36
- package/dist/lib/i18n-context.js +0 -30
- package/dist/lib/i18n-context.js.map +0 -1
- package/dist/lib/i18n-context.mjs +0 -5
- package/dist/lib/i18n-context.mjs.map +0 -1
- package/dist/lib/router-context.d.mts +0 -35
- package/dist/lib/router-context.d.ts +0 -35
- package/dist/lib/router-context.js +0 -26
- package/dist/lib/router-context.js.map +0 -1
- package/dist/lib/router-context.mjs +0 -5
- package/dist/lib/router-context.mjs.map +0 -1
- package/dist/navigation-ANFMVDVW.mjs +0 -2445
- package/dist/navigation-ANFMVDVW.mjs.map +0 -1
- package/dist/navigation-JQ2TJKKI.js +0 -2447
- package/dist/navigation-JQ2TJKKI.js.map +0 -1
- package/dist/use-haptic-2SHBMEY5.js +0 -18
- package/dist/use-haptic-2SHBMEY5.js.map +0 -1
- package/dist/use-haptic-4UCNQATC.mjs +0 -5
- package/dist/use-haptic-4UCNQATC.mjs.map +0 -1
- package/dist/workflow-canvas-CGeuIgBQ.d.ts +0 -241
- package/dist/workflow-canvas-at3LMbkg.d.mts +0 -241
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/astrlabe/utils/workflow-validator.ts"],"names":[],"mappings":";;;AA0CO,SAAS,sBAAsB,KAAA,EAAwC;AAC5E,EAAA,MAAM,SAAmB,EAAC;A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AAA,CAAM,IAAA,CAAK,QAAQ,CAAA;AAAA,IAC1C;AAAA,EACF;AAGA,EAAA,MAAM,gBAAA,uBAAuB,GAAA,EAAoB;AACjD,EAAA,KAAA,MAAW,QAAQ,UAAA,EAAY;AAC7B,IAAA,gBAAA,CAAiB,GAAA,CAAI,IAAA,CAAK,EAAA,EAAI,IAAA,CAAK,KAAK,QAAQ,CAAA;AAAA,EAClD;AAEA,EAAA,OAAO,MAAA,CAAO,IAAI,CAAC,MAAA,KAAW,iBAAiB,GAAA,CAAI,MAAM,KAAK,MAAM,CAAA;AACtE","file":"chunk-3GE3MBUZ.js","sourcesContent":["/**\n * Workflow Validator\n * =================\n * Validates the workflow graph before publishing.\n * Ensures the graph forms a valid DAG with proper node connections.\n */\n\nimport type {\n WorkflowGraph,\n WorkflowNode,\n WorkflowEdge,\n IfElseNodeConfig,\n CodeNodeConfig,\n HttpRequestNodeConfig,\n TemplateTransformNodeConfig,\n KnowledgeBaseNodeConfig,\n AnswerNodeConfig,\n QuestionClassifierNodeConfig,\n ParameterExtractorNodeConfig,\n VariableAssignerNodeConfig,\n VariableAggregatorNodeConfig,\n DocumentExtractorNodeConfig,\n ListOperatorNodeConfig,\n} from '../contracts'\n\nexport type ValidationResult = {\n valid: boolean\n errors: string[]\n}\n\n/**\n * Validate a workflow graph for publishing.\n * Checks:\n * - At least one agent node exists\n * - All edges have valid source/target nodes\n * - No orphan nodes (every node has at least one connection, except note nodes)\n * - Tool nodes connect to agent nodes only\n * - Agent chain forms a valid DAG (no cycles)\n * - Rule nodes have incoming edges from agents\n * - Logic node constraints (start/end uniqueness, config validation)\n * - New node type validations (answer, question_classifier, parameter_extractor, etc.)\n */\nexport function validateWorkflowGraph(graph: WorkflowGraph): ValidationResult {\n const errors: string[] = []\n const nodeMap = new Map<string, WorkflowNode>()\n\n for (const node of graph.nodes) {\n nodeMap.set(node.id, node)\n }\n\n // 1. At least one agent node\n const agentNodes = graph.nodes.filter((node) => node.type === 'agent')\n if (agentNodes.length === 0) {\n errors.push('At least one agent node is required')\n }\n\n // 2. All edges reference valid nodes\n for (const edge of graph.edges) {\n if (!nodeMap.has(edge.source)) {\n errors.push(`Edge \"${edge.id}\" references non-existent source node \"${edge.source}\"`)\n }\n if (!nodeMap.has(edge.target)) {\n errors.push(`Edge \"${edge.id}\" references non-existent target node \"${edge.target}\"`)\n }\n }\n\n // 3. No orphan nodes (every node should have at least one connection, except note nodes)\n const connectedNodeIds = new Set<string>()\n for (const edge of graph.edges) {\n connectedNodeIds.add(edge.source)\n connectedNodeIds.add(edge.target)\n }\n\n for (const node of graph.nodes) {\n // Note nodes are annotations and not part of execution — skip orphan check\n if (node.type === 'note') continue\n if (!connectedNodeIds.has(node.id)) {\n errors.push(`Node \"${node.data.label}\" (${node.type}) is not connected to any other node`)\n }\n }\n\n // 4. Tool -> Agent only\n for (const edge of graph.edges) {\n const sourceNode = nodeMap.get(edge.source)\n const targetNode = nodeMap.get(edge.target)\n if (!sourceNode || !targetNode) continue\n\n if (sourceNode.type === 'tool' && targetNode.type !== 'agent') {\n errors.push(`Tool \"${sourceNode.data.label}\" can only connect to agent nodes, not ${targetNode.type} nodes`)\n }\n }\n\n // 5. Rule nodes should have incoming edges from agents\n const ruleNodes = graph.nodes.filter((node) => node.type === 'rule')\n for (const ruleNode of ruleNodes) {\n const incomingEdges = graph.edges.filter((edge) => edge.target === ruleNode.id)\n const hasAgentSource = incomingEdges.some((edge) => {\n const sourceNode = nodeMap.get(edge.source)\n return sourceNode?.type === 'agent'\n })\n if (incomingEdges.length === 0 || !hasAgentSource) {\n errors.push(`Rule \"${ruleNode.data.label}\" must have an incoming connection from an agent`)\n }\n }\n\n // 6. No cycles (topological sort of agent nodes)\n if (agentNodes.length > 1) {\n const cycleError = detectCycle(agentNodes, graph.edges, nodeMap)\n if (cycleError) {\n errors.push(cycleError)\n }\n }\n\n // 7. At most 1 start node\n const startNodes = graph.nodes.filter((node) => node.type === 'start')\n if (startNodes.length > 1) {\n errors.push('Only one Start node is allowed')\n }\n\n // 8. At most 1 end node\n const endNodes = graph.nodes.filter((node) => node.type === 'end')\n if (endNodes.length > 1) {\n errors.push('Only one End node is allowed')\n }\n\n // 9. Start node has no incoming edges\n for (const startNode of startNodes) {\n const incomingEdges = graph.edges.filter((edge) => edge.target === startNode.id)\n if (incomingEdges.length > 0) {\n errors.push('Start node cannot have incoming connections')\n }\n }\n\n // 10. End node has no outgoing edges\n for (const endNode of endNodes) {\n const outgoingEdges = graph.edges.filter((edge) => edge.source === endNode.id)\n if (outgoingEdges.length > 0) {\n errors.push('End node cannot have outgoing connections')\n }\n }\n\n // 11. IF/ELSE has at least 1 condition\n const ifElseNodes = graph.nodes.filter((node) => node.type === 'if_else')\n for (const ifElseNode of ifElseNodes) {\n const config = ifElseNode.data.config as IfElseNodeConfig | undefined\n if (!config || config.conditions.length === 0) {\n errors.push('IF/ELSE node must have at least one condition')\n }\n }\n\n // 12. Code node has non-empty code\n const codeNodes = graph.nodes.filter((node) => node.type === 'code')\n for (const codeNode of codeNodes) {\n const config = codeNode.data.config as CodeNodeConfig | undefined\n if (!config || !config.code.trim()) {\n errors.push('Code node must have code content')\n }\n }\n\n // 13. HTTP Request has valid URL\n const httpNodes = graph.nodes.filter((node) => node.type === 'http_request')\n for (const httpNode of httpNodes) {\n const config = httpNode.data.config as HttpRequestNodeConfig | undefined\n if (!config || !config.url.trim()) {\n errors.push('HTTP Request node must have a URL')\n }\n }\n\n // 14. Template has non-empty template\n const templateNodes = graph.nodes.filter((node) => node.type === 'template_transform')\n for (const templateNode of templateNodes) {\n const config = templateNode.data.config as TemplateTransformNodeConfig | undefined\n if (!config || !config.template.trim()) {\n errors.push('Template node must have template content')\n }\n }\n\n // 15. Knowledge Base has source ID\n const knowledgeBaseNodes = graph.nodes.filter((node) => node.type === 'knowledge_base')\n for (const knowledgeBaseNode of knowledgeBaseNodes) {\n const config = knowledgeBaseNode.data.config as KnowledgeBaseNodeConfig | undefined\n if (!config || !config.sourceId.trim()) {\n errors.push('Knowledge Base node must have a source configured')\n }\n }\n\n // 16. Iteration has outgoing edge\n const iterationNodes = graph.nodes.filter((node) => node.type === 'iteration')\n for (const iterationNode of iterationNodes) {\n const outgoingEdges = graph.edges.filter((edge) => edge.source === iterationNode.id)\n if (outgoingEdges.length === 0) {\n errors.push('Iteration node must have at least one outgoing connection')\n }\n }\n\n // ============================================================================\n // New node type validations (9 new node types)\n // ============================================================================\n\n // 17. Answer node: outputTemplate must be non-empty\n const answerNodes = graph.nodes.filter((node) => node.type === 'answer')\n for (const answerNode of answerNodes) {\n const config = answerNode.data.config as AnswerNodeConfig | undefined\n if (!config || !config.outputTemplate.trim()) {\n errors.push('Answer node must have a non-empty output template')\n }\n }\n\n // 18. Question Classifier: must have >= 2 categories with non-empty names\n const questionClassifierNodes = graph.nodes.filter((node) => node.type === 'question_classifier')\n for (const questionClassifierNode of questionClassifierNodes) {\n const config = questionClassifierNode.data.config as QuestionClassifierNodeConfig | undefined\n if (!config || config.categories.length < 2) {\n errors.push('Question Classifier node must have at least 2 categories')\n } else {\n const emptyCategories = config.categories.filter((category) => !category.name.trim())\n if (emptyCategories.length > 0) {\n errors.push('Question Classifier node has categories with empty names')\n }\n }\n }\n\n // 19. Parameter Extractor: must have >= 1 parameter with non-empty name\n const parameterExtractorNodes = graph.nodes.filter((node) => node.type === 'parameter_extractor')\n for (const parameterExtractorNode of parameterExtractorNodes) {\n const config = parameterExtractorNode.data.config as ParameterExtractorNodeConfig | undefined\n if (!config || config.parameters.length === 0) {\n errors.push('Parameter Extractor node must have at least 1 parameter')\n } else {\n const emptyParameters = config.parameters.filter((parameter) => !parameter.name.trim())\n if (emptyParameters.length > 0) {\n errors.push('Parameter Extractor node has parameters with empty names')\n }\n }\n }\n\n // 20. Variable Assigner: must have >= 1 assignment\n const variableAssignerNodes = graph.nodes.filter((node) => node.type === 'variable_assigner')\n for (const variableAssignerNode of variableAssignerNodes) {\n const config = variableAssignerNode.data.config as VariableAssignerNodeConfig | undefined\n if (!config || config.assignments.length === 0) {\n errors.push('Variable Assigner node must have at least 1 assignment')\n }\n }\n\n // 21. Variable Aggregator: must have >= 1 inputVariable and non-empty outputVariable\n const variableAggregatorNodes = graph.nodes.filter((node) => node.type === 'variable_aggregator')\n for (const variableAggregatorNode of variableAggregatorNodes) {\n const config = variableAggregatorNode.data.config as VariableAggregatorNodeConfig | undefined\n if (!config || config.inputVariables.length === 0) {\n errors.push('Variable Aggregator node must have at least 1 input variable')\n }\n if (!config || !config.outputVariable.trim()) {\n errors.push('Variable Aggregator node must have a non-empty output variable')\n }\n }\n\n // 22. Document Extractor: outputVariable must be non-empty\n const documentExtractorNodes = graph.nodes.filter((node) => node.type === 'document_extractor')\n for (const documentExtractorNode of documentExtractorNodes) {\n const config = documentExtractorNode.data.config as DocumentExtractorNodeConfig | undefined\n if (!config || !config.outputVariable.trim()) {\n errors.push('Document Extractor node must have a non-empty output variable')\n }\n }\n\n // 23. List Operator: inputVariable and outputVariable must be non-empty\n const listOperatorNodes = graph.nodes.filter((node) => node.type === 'list_operator')\n for (const listOperatorNode of listOperatorNodes) {\n const config = listOperatorNode.data.config as ListOperatorNodeConfig | undefined\n if (!config || !config.inputVariable.trim()) {\n errors.push('List Operator node must have a non-empty input variable')\n }\n if (!config || !config.outputVariable.trim()) {\n errors.push('List Operator node must have a non-empty output variable')\n }\n }\n\n // 24. Iteration Start: must follow an Iteration node (incoming edge source must be iteration type)\n const iterationStartNodes = graph.nodes.filter((node) => node.type === 'iteration_start')\n for (const iterationStartNode of iterationStartNodes) {\n const incomingEdges = graph.edges.filter((edge) => edge.target === iterationStartNode.id)\n const hasIterationSource = incomingEdges.some((edge) => {\n const sourceNode = nodeMap.get(edge.source)\n return sourceNode?.type === 'iteration'\n })\n if (incomingEdges.length === 0 || !hasIterationSource) {\n errors.push('Iteration Start node must have an incoming connection from an Iteration node')\n }\n }\n\n // Note: Note nodes skip validation — they are annotations, not part of execution.\n\n return {\n valid: errors.length === 0,\n errors,\n }\n}\n\n/**\n * Detect cycles in the agent subgraph using DFS.\n */\nfunction detectCycle(\n agentNodes: WorkflowNode[],\n edges: WorkflowEdge[],\n nodeMap: Map<string, WorkflowNode>\n): string | null {\n const agentIds = new Set(agentNodes.map((node) => node.id))\n const adjacencyList = new Map<string, string[]>()\n\n for (const agentId of agentIds) {\n adjacencyList.set(agentId, [])\n }\n\n for (const edge of edges) {\n const sourceNode = nodeMap.get(edge.source)\n const targetNode = nodeMap.get(edge.target)\n if (\n sourceNode?.type === 'agent' &&\n targetNode?.type === 'agent' &&\n agentIds.has(edge.source) &&\n agentIds.has(edge.target)\n ) {\n adjacencyList.get(edge.source)!.push(edge.target)\n }\n }\n\n const visited = new Set<string>()\n const inStack = new Set<string>()\n\n function hasCycleDfs(nodeId: string): boolean {\n visited.add(nodeId)\n inStack.add(nodeId)\n\n const neighbors = adjacencyList.get(nodeId) ?? []\n for (const neighbor of neighbors) {\n if (!visited.has(neighbor)) {\n if (hasCycleDfs(neighbor)) return true\n } else if (inStack.has(neighbor)) {\n return true\n }\n }\n\n inStack.delete(nodeId)\n return false\n }\n\n for (const agentId of agentIds) {\n if (!visited.has(agentId)) {\n if (hasCycleDfs(agentId)) {\n return 'Cycle detected in agent pipeline — agents must form a directed acyclic graph (DAG)'\n }\n }\n }\n\n return null\n}\n\n/**\n * Topologically sort agent nodes from the graph edges.\n * Returns agent entityIds in execution order.\n * Logic nodes are skipped — only agent entityIds are returned.\n */\nexport function topologicalSortAgents(graph: WorkflowGraph): string[] {\n const agentNodes = graph.nodes.filter((node) => node.type === 'agent')\n const agentIdSet = new Set(agentNodes.map((node) => node.id))\n\n // Build adjacency list for agent-to-agent edges\n const inDegree = new Map<string, number>()\n const adjacencyList = new Map<string, string[]>()\n\n for (const node of agentNodes) {\n inDegree.set(node.id, 0)\n adjacencyList.set(node.id, [])\n }\n\n for (const edge of graph.edges) {\n if (agentIdSet.has(edge.source) && agentIdSet.has(edge.target)) {\n adjacencyList.get(edge.source)!.push(edge.target)\n inDegree.set(edge.target, (inDegree.get(edge.target) ?? 0) + 1)\n }\n }\n\n // Kahn's algorithm\n const queue: string[] = []\n for (const [nodeId, degree] of inDegree) {\n if (degree === 0) queue.push(nodeId)\n }\n\n const sorted: string[] = []\n while (queue.length > 0) {\n const current = queue.shift()!\n sorted.push(current)\n\n for (const neighbor of adjacencyList.get(current) ?? []) {\n const newDegree = (inDegree.get(neighbor) ?? 1) - 1\n inDegree.set(neighbor, newDegree)\n if (newDegree === 0) queue.push(neighbor)\n }\n }\n\n // Map node IDs back to entityIds\n const nodeIdToEntityId = new Map<string, string>()\n for (const node of agentNodes) {\n nodeIdToEntityId.set(node.id, node.data.entityId)\n }\n\n return sorted.map((nodeId) => nodeIdToEntityId.get(nodeId) ?? nodeId)\n}\n"]}
|
package/dist/chunk-55H6WZQP.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":[],"names":[],"mappings":"","file":"chunk-55H6WZQP.js"}
|
package/dist/chunk-7VJ7CMMT.mjs
DELETED
|
@@ -1,96 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import { createContext, useContext } from 'react';
|
|
3
|
-
import { jsx } from 'react/jsx-runtime';
|
|
4
|
-
|
|
5
|
-
// src/lib/i18n-context.tsx
|
|
6
|
-
var I18nContext = createContext(null);
|
|
7
|
-
function I18nProvider({ children, value }) {
|
|
8
|
-
return /* @__PURE__ */ jsx(I18nContext.Provider, { value, children });
|
|
9
|
-
}
|
|
10
|
-
function useTranslations(namespace) {
|
|
11
|
-
const context = useContext(I18nContext);
|
|
12
|
-
if (!context) {
|
|
13
|
-
const fallback = ((key, params) => {
|
|
14
|
-
let result = namespace ? `${namespace}.${key}` : key;
|
|
15
|
-
if (params) {
|
|
16
|
-
for (const [paramKey, paramValue] of Object.entries(params)) {
|
|
17
|
-
result = result.replace(`{${paramKey}}`, String(paramValue));
|
|
18
|
-
}
|
|
19
|
-
}
|
|
20
|
-
return result;
|
|
21
|
-
});
|
|
22
|
-
fallback.raw = (key) => key;
|
|
23
|
-
return fallback;
|
|
24
|
-
}
|
|
25
|
-
const translateFn = context.translate(namespace);
|
|
26
|
-
if (!translateFn.raw) {
|
|
27
|
-
translateFn.raw = (key) => {
|
|
28
|
-
const messages = context.messages;
|
|
29
|
-
if (!messages) return void 0;
|
|
30
|
-
const fullKey = namespace ? `${namespace}.${key}` : key;
|
|
31
|
-
return getNestedValue(messages, fullKey);
|
|
32
|
-
};
|
|
33
|
-
}
|
|
34
|
-
return translateFn;
|
|
35
|
-
}
|
|
36
|
-
function getNestedValue(object, path) {
|
|
37
|
-
const parts = path.split(".");
|
|
38
|
-
let current = object;
|
|
39
|
-
for (const part of parts) {
|
|
40
|
-
if (current === null || current === void 0 || typeof current !== "object") return void 0;
|
|
41
|
-
current = current[part];
|
|
42
|
-
}
|
|
43
|
-
return current;
|
|
44
|
-
}
|
|
45
|
-
function useLocale() {
|
|
46
|
-
const context = useContext(I18nContext);
|
|
47
|
-
return context?.locale ?? "en";
|
|
48
|
-
}
|
|
49
|
-
function useFormatter() {
|
|
50
|
-
const locale = useLocale();
|
|
51
|
-
return {
|
|
52
|
-
dateTime: (date, options) => new Intl.DateTimeFormat(locale, options).format(date),
|
|
53
|
-
relativeTime: (date) => {
|
|
54
|
-
const now = Date.now();
|
|
55
|
-
const diffMs = date.getTime() - now;
|
|
56
|
-
const diffSeconds = Math.round(diffMs / 1e3);
|
|
57
|
-
const diffMinutes = Math.round(diffMs / 6e4);
|
|
58
|
-
const diffHours = Math.round(diffMs / 36e5);
|
|
59
|
-
const diffDays = Math.round(diffMs / 864e5);
|
|
60
|
-
const rtf = new Intl.RelativeTimeFormat(locale, { numeric: "auto" });
|
|
61
|
-
if (Math.abs(diffSeconds) < 60) return rtf.format(diffSeconds, "second");
|
|
62
|
-
if (Math.abs(diffMinutes) < 60) return rtf.format(diffMinutes, "minute");
|
|
63
|
-
if (Math.abs(diffHours) < 24) return rtf.format(diffHours, "hour");
|
|
64
|
-
return rtf.format(diffDays, "day");
|
|
65
|
-
},
|
|
66
|
-
number: (value, options) => new Intl.NumberFormat(locale, options).format(value)
|
|
67
|
-
};
|
|
68
|
-
}
|
|
69
|
-
function createI18nFromMessages(locale, messages) {
|
|
70
|
-
return {
|
|
71
|
-
locale,
|
|
72
|
-
messages,
|
|
73
|
-
translate: (namespace) => {
|
|
74
|
-
const fn = ((key, params) => {
|
|
75
|
-
const fullKey = namespace ? `${namespace}.${key}` : key;
|
|
76
|
-
const raw = getNestedValue(messages, fullKey);
|
|
77
|
-
let result = typeof raw === "string" ? raw : key;
|
|
78
|
-
if (params) {
|
|
79
|
-
for (const [paramKey, paramValue] of Object.entries(params)) {
|
|
80
|
-
result = result.replace(new RegExp(`\\{${paramKey}\\}`, "g"), String(paramValue));
|
|
81
|
-
}
|
|
82
|
-
}
|
|
83
|
-
return result;
|
|
84
|
-
});
|
|
85
|
-
fn.raw = (key) => {
|
|
86
|
-
const fullKey = namespace ? `${namespace}.${key}` : key;
|
|
87
|
-
return getNestedValue(messages, fullKey);
|
|
88
|
-
};
|
|
89
|
-
return fn;
|
|
90
|
-
}
|
|
91
|
-
};
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
export { I18nProvider, createI18nFromMessages, useFormatter, useLocale, useTranslations };
|
|
95
|
-
//# sourceMappingURL=chunk-7VJ7CMMT.mjs.map
|
|
96
|
-
//# sourceMappingURL=chunk-7VJ7CMMT.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/lib/i18n-context.tsx"],"names":[],"mappings":";;;;AAaA,IAAM,WAAA,GAAc,cAAuC,IAAI,CAAA;AAOxD,SAAS,YAAA,CAAa,EAAE,QAAA,EAAU,KAAA,EAAM,EAAsB;AACnE,EAAA,uBAAO,GAAA,CAAC,WAAA,CAAY,QAAA,EAAZ,EAAqB,OAAe,QAAA,EAAS,CAAA;AACvD;AAEO,SAAS,gBAAgB,SAAA,EAAiC;AAC/D,EAAA,MAAM,OAAA,GAAU,WAAW,W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AAA,UAClF;AAAA,QACF;AACA,QAAA,OAAO,MAAA;AAAA,MACT,CAAA,CAAA;AACA,MAAA,EAAA,CAAG,GAAA,GAAM,CAAC,GAAA,KAAgB;AACxB,QAAA,MAAM,UAAU,SAAA,GAAY,CAAA,EAAG,SAAS,CAAA,CAAA,EAAI,GAAG,CAAA,CAAA,GAAK,GAAA;AACpD,QAAA,OAAO,cAAA,CAAe,UAAU,OAAO,CAAA;AAAA,MACzC,CAAA;AACA,MAAA,OAAO,EAAA;AAAA,IACT;AAAA,GACF;AACF","file":"chunk-7VJ7CMMT.mjs","sourcesContent":["import { createContext, useContext, type ReactNode } from 'react'\n\ntype TranslateFn = ((key: string, params?: Record<string, unknown>) => string) & {\n /** Return the raw (unparsed) value at a given key — useful for arrays/objects in messages */\n raw: (key: string) => unknown\n}\n\nexport interface I18nContextValue {\n translate: (namespace?: string) => TranslateFn\n locale: string\n messages?: Record<string, unknown>\n}\n\nconst I18nContext = createContext<I18nContextValue | null>(null)\n\nexport type I18nProviderProps = {\n children: ReactNode\n value: I18nContextValue\n}\n\nexport function I18nProvider({ children, value }: I18nProviderProps) {\n return <I18nContext.Provider value={value}>{children}</I18nContext.Provider>\n}\n\nexport function useTranslations(namespace?: string): TranslateFn {\n const context = useContext(I18nContext)\n if (!context) {\n const fallback = ((key: string, params?: Record<string, unknown>) => {\n let result = namespace ? `${namespace}.${key}` : key\n if (params) {\n for (const [paramKey, paramValue] of Object.entries(params)) {\n result = result.replace(`{${paramKey}}`, String(paramValue))\n }\n }\n return result\n }) as TranslateFn\n fallback.raw = (key: string) => key\n return fallback\n }\n const translateFn = context.translate(namespace) as TranslateFn\n if (!translateFn.raw) {\n translateFn.raw = (key: string) => {\n const messages = context.messages\n if (!messages) return undefined\n const fullKey = namespace ? `${namespace}.${key}` : key\n return getNestedValue(messages, fullKey)\n }\n }\n return translateFn\n}\n\nfunction getNestedValue(object: Record<string, unknown>, path: string): unknown {\n const parts = path.split('.')\n let current: unknown = object\n for (const part of parts) {\n if (current === null || current === undefined || typeof current !== 'object') return undefined\n current = (current as Record<string, unknown>)[part]\n }\n return current\n}\n\nexport function useLocale(): string {\n const context = useContext(I18nContext)\n return context?.locale ?? 'en'\n}\n\nexport type I18nFormatter = {\n dateTime: (date: Date, options?: Intl.DateTimeFormatOptions) => string\n relativeTime: (date: Date, options?: Intl.RelativeTimeFormatOptions) => string\n number: (value: number, options?: Intl.NumberFormatOptions) => string\n}\n\nexport function useFormatter(): I18nFormatter {\n const locale = useLocale()\n return {\n dateTime: (date: Date, options?: Intl.DateTimeFormatOptions) =>\n new Intl.DateTimeFormat(locale, options).format(date),\n relativeTime: (date: Date) => {\n const now = Date.now()\n const diffMs = date.getTime() - now\n const diffSeconds = Math.round(diffMs / 1000)\n const diffMinutes = Math.round(diffMs / 60000)\n const diffHours = Math.round(diffMs / 3600000)\n const diffDays = Math.round(diffMs / 86400000)\n const rtf = new Intl.RelativeTimeFormat(locale, { numeric: 'auto' })\n if (Math.abs(diffSeconds) < 60) return rtf.format(diffSeconds, 'second')\n if (Math.abs(diffMinutes) < 60) return rtf.format(diffMinutes, 'minute')\n if (Math.abs(diffHours) < 24) return rtf.format(diffHours, 'hour')\n return rtf.format(diffDays, 'day')\n },\n number: (value: number, options?: Intl.NumberFormatOptions) =>\n new Intl.NumberFormat(locale, options).format(value),\n }\n}\n\n/**\n * Create an I18nContextValue from a flat messages object and locale.\n * Messages should be a nested object where keys are namespaces\n * and values are objects of translation key → ICU message string.\n *\n * This performs simple string interpolation with {param} placeholders.\n * For full ICU MessageFormat (plurals, select, etc.), use intl-messageformat.\n */\nexport function createI18nFromMessages(\n locale: string,\n messages: Record<string, unknown>,\n): I18nContextValue {\n return {\n locale,\n messages,\n translate: (namespace?: string) => {\n const fn = ((key: string, params?: Record<string, unknown>) => {\n const fullKey = namespace ? `${namespace}.${key}` : key\n const raw = getNestedValue(messages, fullKey)\n let result = typeof raw === 'string' ? raw : key\n if (params) {\n for (const [paramKey, paramValue] of Object.entries(params)) {\n result = result.replace(new RegExp(`\\\\{${paramKey}\\\\}`, 'g'), String(paramValue))\n }\n }\n return result\n }) as TranslateFn\n fn.raw = (key: string) => {\n const fullKey = namespace ? `${namespace}.${key}` : key\n return getNestedValue(messages, fullKey)\n }\n return fn\n },\n }\n}\n"]}
|
package/dist/chunk-AM2TTPYM.mjs
DELETED
|
@@ -1,189 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import Dagre from '@dagrejs/dagre';
|
|
3
|
-
|
|
4
|
-
// src/astrlabe/utils/logic-node-defaults.ts
|
|
5
|
-
function createDefaultLogicNodeConfig(nodeType) {
|
|
6
|
-
switch (nodeType) {
|
|
7
|
-
case "start":
|
|
8
|
-
return { type: "start", inputVariables: [] };
|
|
9
|
-
case "end":
|
|
10
|
-
return { type: "end", outputVariables: [] };
|
|
11
|
-
case "if_else":
|
|
12
|
-
return {
|
|
13
|
-
type: "if_else",
|
|
14
|
-
conditions: [{ variable: "", operator: "equals", value: "" }],
|
|
15
|
-
logicalOperator: "and"
|
|
16
|
-
};
|
|
17
|
-
case "code":
|
|
18
|
-
return { type: "code", language: "javascript", code: "" };
|
|
19
|
-
case "http_request":
|
|
20
|
-
return {
|
|
21
|
-
type: "http_request",
|
|
22
|
-
method: "GET",
|
|
23
|
-
url: "",
|
|
24
|
-
headers: {},
|
|
25
|
-
body: "",
|
|
26
|
-
timeoutMs: 1e4
|
|
27
|
-
};
|
|
28
|
-
case "template_transform":
|
|
29
|
-
return { type: "template_transform", template: "", outputVariable: "" };
|
|
30
|
-
case "iteration":
|
|
31
|
-
return { type: "iteration", iteratorVariable: "", maxIterations: 100 };
|
|
32
|
-
case "knowledge_base":
|
|
33
|
-
return { type: "knowledge_base", sourceId: "", topK: 5, similarityThreshold: 0.7 };
|
|
34
|
-
case "answer":
|
|
35
|
-
return { type: "answer", outputTemplate: "", outputVariables: [] };
|
|
36
|
-
case "question_classifier":
|
|
37
|
-
return {
|
|
38
|
-
type: "question_classifier",
|
|
39
|
-
modelId: "",
|
|
40
|
-
instructions: "",
|
|
41
|
-
categories: [
|
|
42
|
-
{ id: crypto.randomUUID(), name: "", description: "" },
|
|
43
|
-
{ id: crypto.randomUUID(), name: "", description: "" }
|
|
44
|
-
]
|
|
45
|
-
};
|
|
46
|
-
case "parameter_extractor":
|
|
47
|
-
return {
|
|
48
|
-
type: "parameter_extractor",
|
|
49
|
-
modelId: "",
|
|
50
|
-
parameters: [{ name: "", type: "string", description: "", required: true }]
|
|
51
|
-
};
|
|
52
|
-
case "variable_assigner":
|
|
53
|
-
return {
|
|
54
|
-
type: "variable_assigner",
|
|
55
|
-
assignments: [{ target: "", source: "" }]
|
|
56
|
-
};
|
|
57
|
-
case "variable_aggregator":
|
|
58
|
-
return {
|
|
59
|
-
type: "variable_aggregator",
|
|
60
|
-
inputVariables: [],
|
|
61
|
-
outputVariable: "",
|
|
62
|
-
aggregationMode: "array"
|
|
63
|
-
};
|
|
64
|
-
case "document_extractor":
|
|
65
|
-
return {
|
|
66
|
-
type: "document_extractor",
|
|
67
|
-
extractionMode: "text",
|
|
68
|
-
outputVariable: ""
|
|
69
|
-
};
|
|
70
|
-
case "list_operator":
|
|
71
|
-
return {
|
|
72
|
-
type: "list_operator",
|
|
73
|
-
operation: "filter",
|
|
74
|
-
inputVariable: "",
|
|
75
|
-
outputVariable: "",
|
|
76
|
-
condition: ""
|
|
77
|
-
};
|
|
78
|
-
case "iteration_start":
|
|
79
|
-
return {
|
|
80
|
-
type: "iteration_start",
|
|
81
|
-
iteratorVariable: "",
|
|
82
|
-
itemVariable: "item",
|
|
83
|
-
indexVariable: "index"
|
|
84
|
-
};
|
|
85
|
-
case "note":
|
|
86
|
-
return {
|
|
87
|
-
type: "note",
|
|
88
|
-
text: "",
|
|
89
|
-
color: "yellow",
|
|
90
|
-
width: 200,
|
|
91
|
-
height: 150
|
|
92
|
-
};
|
|
93
|
-
case "group":
|
|
94
|
-
return {
|
|
95
|
-
type: "group",
|
|
96
|
-
label: "Group",
|
|
97
|
-
color: "slate",
|
|
98
|
-
isExpanded: true,
|
|
99
|
-
width: 400,
|
|
100
|
-
height: 300,
|
|
101
|
-
collapsedWidth: 260,
|
|
102
|
-
collapsedHeight: 60
|
|
103
|
-
};
|
|
104
|
-
case "datasource":
|
|
105
|
-
return {
|
|
106
|
-
type: "datasource",
|
|
107
|
-
datasourceId: "",
|
|
108
|
-
dialect: "",
|
|
109
|
-
table: "",
|
|
110
|
-
selectedColumns: [],
|
|
111
|
-
filterVariables: {},
|
|
112
|
-
outputVariable: "datasourceResult",
|
|
113
|
-
limit: 100
|
|
114
|
-
};
|
|
115
|
-
default:
|
|
116
|
-
return null;
|
|
117
|
-
}
|
|
118
|
-
}
|
|
119
|
-
var DEFAULT_NODE_WIDTH = 260;
|
|
120
|
-
var DEFAULT_NODE_HEIGHT = 70;
|
|
121
|
-
function getNodeSize(node) {
|
|
122
|
-
const measured = node.measured;
|
|
123
|
-
return {
|
|
124
|
-
width: measured?.width ?? DEFAULT_NODE_WIDTH,
|
|
125
|
-
height: measured?.height ?? DEFAULT_NODE_HEIGHT
|
|
126
|
-
};
|
|
127
|
-
}
|
|
128
|
-
function applyDagreLayout(nodes, edges, direction) {
|
|
129
|
-
const nodeSpacingHorizontal = 80;
|
|
130
|
-
const nodeSpacingVertical = 50;
|
|
131
|
-
const layoutNodes = nodes.filter(
|
|
132
|
-
(node) => !node.parentId && node.type !== "note"
|
|
133
|
-
);
|
|
134
|
-
const dagreGraph = new Dagre.graphlib.Graph({ directed: true });
|
|
135
|
-
dagreGraph.setDefaultEdgeLabel(() => ({}));
|
|
136
|
-
const isHorizontal = direction === "LR";
|
|
137
|
-
dagreGraph.setGraph({
|
|
138
|
-
rankdir: direction,
|
|
139
|
-
nodesep: isHorizontal ? nodeSpacingVertical : nodeSpacingHorizontal,
|
|
140
|
-
ranksep: isHorizontal ? nodeSpacingHorizontal : nodeSpacingVertical,
|
|
141
|
-
marginx: 40,
|
|
142
|
-
marginy: 40
|
|
143
|
-
});
|
|
144
|
-
const layoutNodeIds = new Set(layoutNodes.map((node) => node.id));
|
|
145
|
-
for (const node of layoutNodes) {
|
|
146
|
-
const { width, height } = getNodeSize(node);
|
|
147
|
-
dagreGraph.setNode(node.id, { width, height });
|
|
148
|
-
}
|
|
149
|
-
for (const edge of edges) {
|
|
150
|
-
if (layoutNodeIds.has(edge.source) && layoutNodeIds.has(edge.target)) {
|
|
151
|
-
dagreGraph.setEdge(edge.source, edge.target);
|
|
152
|
-
}
|
|
153
|
-
}
|
|
154
|
-
Dagre.layout(dagreGraph);
|
|
155
|
-
const positionMap = /* @__PURE__ */ new Map();
|
|
156
|
-
for (const node of layoutNodes) {
|
|
157
|
-
const dagreNode = dagreGraph.node(node.id);
|
|
158
|
-
if (!dagreNode) continue;
|
|
159
|
-
const { width, height } = getNodeSize(node);
|
|
160
|
-
positionMap.set(node.id, {
|
|
161
|
-
x: dagreNode.x - width / 2,
|
|
162
|
-
y: dagreNode.y - height / 2
|
|
163
|
-
});
|
|
164
|
-
}
|
|
165
|
-
return nodes.map((node) => {
|
|
166
|
-
const newPosition = positionMap.get(node.id);
|
|
167
|
-
if (!newPosition) return node;
|
|
168
|
-
return { ...node, position: newPosition };
|
|
169
|
-
});
|
|
170
|
-
}
|
|
171
|
-
|
|
172
|
-
// src/astrlabe/utils/agent-tier.ts
|
|
173
|
-
var TIERS = [
|
|
174
|
-
{ maxElo: 1200, tier: { key: "beginner", pillColor: "bg-cyan-100 text-cyan-700 dark:bg-cyan-900/30 dark:text-cyan-400" } },
|
|
175
|
-
{ maxElo: 1600, tier: { key: "intermediate", pillColor: "bg-pink-100 text-pink-700 dark:bg-pink-900/30 dark:text-pink-400" } },
|
|
176
|
-
{ maxElo: 2e3, tier: { key: "advanced", pillColor: "bg-amber-100 text-amber-700 dark:bg-amber-900/30 dark:text-amber-400" } },
|
|
177
|
-
{ maxElo: Infinity, tier: { key: "expert", pillColor: "bg-emerald-100 text-emerald-700 dark:bg-emerald-900/30 dark:text-emerald-400" } }
|
|
178
|
-
];
|
|
179
|
-
function getAgentTier(elo) {
|
|
180
|
-
const eloValue = elo ?? 0;
|
|
181
|
-
for (const { maxElo, tier } of TIERS) {
|
|
182
|
-
if (eloValue < maxElo) return tier;
|
|
183
|
-
}
|
|
184
|
-
return TIERS[TIERS.length - 1].tier;
|
|
185
|
-
}
|
|
186
|
-
|
|
187
|
-
export { applyDagreLayout, createDefaultLogicNodeConfig, getAgentTier };
|
|
188
|
-
//# sourceMappingURL=chunk-AM2TTPYM.mjs.map
|
|
189
|
-
//# sourceMappingURL=chunk-AM2TTPYM.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/astrlabe/utils/logic-node-defaults.ts","../src/astrlabe/utils/layout-engine.ts","../src/astrlabe/utils/agent-tier.ts"],"names":[],"mappings":";;;AAQO,SAAS,6BAA6B,QAAA,EAAoD;AAC/F,EAAA,QAAQ,QAAA;AAAU,IAChB,KAAK,OAAA;AACH,MAAA,OAAO,EAAE,IAAA,EAAM,OAAA,EAAS,cAAA,EAAgB,EAAC,EAAE;AAAA,IAC7C,KAAK,KAAA;AACH,MAAA,OAAO,EAAE,IAAA,EAAM,KAAA,EAAO,eAAA,EAAiB,EAAC,EAAE;AAAA,IAC5C,KAAK,SAAA;AACH,MAAA,OAAO;AAAA,QACL,IAAA,EAAM,SAAA;AAAA,QACN,UAAA,EAAY,CAAC,EAAE,QAAA,EAAU,IAAI,QAAA,EAAU,QAAA,EAAU,KAAA,EAAO,EAAA,EAAI,CAAA;AAAA,QAC5D,eAAA,EAAiB;AAAA,OACnB;AAAA,IACF,KAAK,MAAA;AACH,MAAA,OAAO,EAAE,IAAA,EAAM,MAAA,EAAQ,QAAA,EAAU,YAAA,EAAc,MAAM,EAAA,EAAG;AAAA,IAC1D,KAAK,cAAA;AACH,MAAA,OAAO;AAAA,QACL,IAAA,EAAM,cAAA;AAAA,QACN,MAAA,EAAQ,KAAA;AAAA,QACR,GAAA,EAAK,EAAA;AAA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,KAAS;AACzB,IAAA,MAAM,WAAA,GAAc,WAAA,CAAY,GAAA,CAAI,IAAA,CAAK,EAAE,CAAA;AAC3C,IAAA,IAAI,CAAC,aAAa,OAAO,IAAA;AACzB,IAAA,OAAO,EAAE,GAAG,IAAA,EAAM,QAAA,EAAU,WAAA,EAAY;AAAA,EAC1C,CAAC,CAAA;AACH;;;AC5EA,IAAM,KAAA,GAAoD;AAAA,EACxD,EAAE,QAAQ,IAAA,EAAM,IAAA,EAAM,EAAE,GAAA,EAAK,UAAA,EAAY,SAAA,EAAW,kEAAA,EAAmE,EAAE;AAAA,EACzH,EAAE,QAAQ,IAAA,EAAM,IAAA,EAAM,EAAE,GAAA,EAAK,cAAA,EAAgB,SAAA,EAAW,kEAAA,EAAmE,EAAE;AAAA,EAC7H,EAAE,QAAQ,GAAA,EAAM,IAAA,EAAM,EAAE,GAAA,EAAK,UAAA,EAAY,SAAA,EAAW,sEAAA,EAAuE,EAAE;AAAA,EAC7H,EAAE,QAAQ,QAAA,EAAU,IAAA,EAAM,EAAE,GAAA,EAAK,QAAA,EAAU,SAAA,EAAW,8EAAA,EAA+E;AACvI,CAAA;AAEO,SAAS,aAAa,GAAA,EAAoC;AAC/D,EAAA,MAAM,WAAW,GAAA,IAAO,CAAA;AACxB,EAAA,KAAA,MAAW,EAAE,MAAA,EAAQ,IAAA,EAAK,IAAK,KAAA,EAAO;AACpC,IAAA,IAAI,QAAA,GAAW,QAAQ,OAAO,IAAA;AAAA,EAChC;AACA,EAAA,OAAO,KAAA,CAAM,KAAA,CAAM,MAAA,GAAS,CAAC,CAAA,CAAE,IAAA;AACjC","file":"chunk-AM2TTPYM.mjs","sourcesContent":["/**\n * Logic Node Default Configs\n * ==========================\n * Factory function to create default configs for each logic node type.\n */\n\nimport type { WorkflowNodeType, LogicNodeConfig } from '../contracts'\n\nexport function createDefaultLogicNodeConfig(nodeType: WorkflowNodeType): LogicNodeConfig | null {\n switch (nodeType) {\n case 'start':\n return { type: 'start', inputVariables: [] }\n case 'end':\n return { type: 'end', outputVariables: [] }\n case 'if_else':\n return {\n type: 'if_else',\n conditions: [{ variable: '', operator: 'equals', value: '' }],\n logicalOperator: 'and',\n }\n case 'code':\n return { type: 'code', language: 'javascript', code: '' }\n case 'http_request':\n return {\n type: 'http_request',\n method: 'GET',\n url: '',\n headers: {},\n body: '',\n timeoutMs: 10000,\n }\n case 'template_transform':\n return { type: 'template_transform', template: '', outputVariable: '' }\n case 'iteration':\n return { type: 'iteration', iteratorVariable: '', maxIterations: 100 }\n case 'knowledge_base':\n return { type: 'knowledge_base', sourceId: '', topK: 5, similarityThreshold: 0.7 }\n case 'answer':\n return { type: 'answer', outputTemplate: '', outputVariables: [] }\n case 'question_classifier':\n return {\n type: 'question_classifier',\n modelId: '',\n instructions: '',\n categories: [\n { id: crypto.randomUUID(), name: '', description: '' },\n { id: crypto.randomUUID(), name: '', description: '' },\n ],\n }\n case 'parameter_extractor':\n return {\n type: 'parameter_extractor',\n modelId: '',\n parameters: [{ name: '', type: 'string', description: '', required: true }],\n }\n case 'variable_assigner':\n return {\n type: 'variable_assigner',\n assignments: [{ target: '', source: '' }],\n }\n case 'variable_aggregator':\n return {\n type: 'variable_aggregator',\n inputVariables: [],\n outputVariable: '',\n aggregationMode: 'array',\n }\n case 'document_extractor':\n return {\n type: 'document_extractor',\n extractionMode: 'text',\n outputVariable: '',\n }\n case 'list_operator':\n return {\n type: 'list_operator',\n operation: 'filter',\n inputVariable: '',\n outputVariable: '',\n condition: '',\n }\n case 'iteration_start':\n return {\n type: 'iteration_start',\n iteratorVariable: '',\n itemVariable: 'item',\n indexVariable: 'index',\n }\n case 'note':\n return {\n type: 'note',\n text: '',\n color: 'yellow',\n width: 200,\n height: 150,\n }\n case 'group':\n return {\n type: 'group',\n label: 'Group',\n color: 'slate',\n isExpanded: true,\n width: 400,\n height: 300,\n collapsedWidth: 260,\n collapsedHeight: 60,\n }\n case 'datasource':\n return {\n type: 'datasource',\n datasourceId: '',\n dialect: '',\n table: '',\n selectedColumns: [],\n filterVariables: {},\n outputVariable: 'datasourceResult',\n limit: 100,\n }\n default:\n return null\n }\n}\n","/**\n * Layout Engine\n * =============\n * Auto-layout for workflow graphs using @dagrejs/dagre.\n * Pure utility — no React dependencies.\n */\n\nimport Dagre from '@dagrejs/dagre'\nimport type { Node, Edge } from '@xyflow/react'\n\n/** Layout direction: free means no auto-layout is applied. */\nexport type LayoutDirection = 'free' | 'LR' | 'TB'\n\nconst DEFAULT_NODE_WIDTH = 260\nconst DEFAULT_NODE_HEIGHT = 70\n\nfunction getNodeSize(node: Node): { width: number; height: number } {\n const measured = node.measured as { width?: number; height?: number } | undefined\n return {\n width: measured?.width ?? DEFAULT_NODE_WIDTH,\n height: measured?.height ?? DEFAULT_NODE_HEIGHT,\n }\n}\n\n/**\n * Apply dagre layout to the given nodes and edges.\n * Returns a new array of nodes with updated positions.\n * Group child nodes (parentId set) and note nodes are excluded from layout.\n */\nexport function applyDagreLayout(\n nodes: Node[],\n edges: Edge[],\n direction: Exclude<LayoutDirection, 'free'>,\n): Node[] {\n const nodeSpacingHorizontal = 80\n const nodeSpacingVertical = 50\n\n // Separate layoutable nodes from excluded ones\n const layoutNodes = nodes.filter(\n (node) => !node.parentId && node.type !== 'note',\n )\n\n // Build dagre graph\n const dagreGraph = new Dagre.graphlib.Graph({ directed: true })\n dagreGraph.setDefaultEdgeLabel(() => ({}))\n\n const isHorizontal = direction === 'LR'\n dagreGraph.setGraph({\n rankdir: direction,\n nodesep: isHorizontal ? nodeSpacingVertical : nodeSpacingHorizontal,\n ranksep: isHorizontal ? nodeSpacingHorizontal : nodeSpacingVertical,\n marginx: 40,\n marginy: 40,\n })\n\n const layoutNodeIds = new Set(layoutNodes.map((node) => node.id))\n\n for (const node of layoutNodes) {\n const { width, height } = getNodeSize(node)\n dagreGraph.setNode(node.id, { width, height })\n }\n\n for (const edge of edges) {\n if (layoutNodeIds.has(edge.source) && layoutNodeIds.has(edge.target)) {\n dagreGraph.setEdge(edge.source, edge.target)\n }\n }\n\n Dagre.layout(dagreGraph)\n\n // Build position map — dagre returns center coords, React Flow uses top-left\n const positionMap = new Map<string, { x: number; y: number }>()\n for (const node of layoutNodes) {\n const dagreNode = dagreGraph.node(node.id)\n if (!dagreNode) continue\n const { width, height } = getNodeSize(node)\n positionMap.set(node.id, {\n x: dagreNode.x - width / 2,\n y: dagreNode.y - height / 2,\n })\n }\n\n // Return all nodes with updated positions for layout-participating nodes\n return nodes.map((node) => {\n const newPosition = positionMap.get(node.id)\n if (!newPosition) return node\n return { ...node, position: newPosition }\n })\n}\n","/**\n * Agent ELO Tier\n * ==============\n * Derives difficulty tier from agent ELO rating.\n * Used in node palette, agent flow node, and agent drawer.\n */\n\nexport type AgentTier = {\n key: 'beginner' | 'intermediate' | 'advanced' | 'expert'\n pillColor: string\n}\n\nconst TIERS: Array<{ maxElo: number; tier: AgentTier }> = [\n { maxElo: 1200, tier: { key: 'beginner', pillColor: 'bg-cyan-100 text-cyan-700 dark:bg-cyan-900/30 dark:text-cyan-400' } },\n { maxElo: 1600, tier: { key: 'intermediate', pillColor: 'bg-pink-100 text-pink-700 dark:bg-pink-900/30 dark:text-pink-400' } },\n { maxElo: 2000, tier: { key: 'advanced', pillColor: 'bg-amber-100 text-amber-700 dark:bg-amber-900/30 dark:text-amber-400' } },\n { maxElo: Infinity, tier: { key: 'expert', pillColor: 'bg-emerald-100 text-emerald-700 dark:bg-emerald-900/30 dark:text-emerald-400' } },\n]\n\nexport function getAgentTier(elo: number | undefined): AgentTier {\n const eloValue = elo ?? 0\n for (const { maxElo, tier } of TIERS) {\n if (eloValue < maxElo) return tier\n }\n return TIERS[TIERS.length - 1].tier\n}\n"]}
|