@lov3kaizen/agentsea-debugger 0.5.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/LICENSE +21 -0
- package/README.md +364 -0
- package/dist/Recorder-Dc9qR2V2.d.ts +138 -0
- package/dist/ReplayEngine-Dyyqy5bw.d.ts +54 -0
- package/dist/analysis/index.d.ts +4 -0
- package/dist/analysis/index.js +1840 -0
- package/dist/analysis/index.js.map +1 -0
- package/dist/diff-CLShBdWe.d.ts +24 -0
- package/dist/index-1W27DYJt.d.ts +366 -0
- package/dist/index-DRrKPSo9.d.ts +233 -0
- package/dist/index.d.ts +29 -0
- package/dist/index.js +6232 -0
- package/dist/index.js.map +1 -0
- package/dist/integrations/agentsea/index.d.ts +8 -0
- package/dist/integrations/agentsea/index.js +5826 -0
- package/dist/integrations/agentsea/index.js.map +1 -0
- package/dist/recording/index.d.ts +91 -0
- package/dist/recording/index.js +1207 -0
- package/dist/recording/index.js.map +1 -0
- package/dist/recording.types-Ck7pbikw.d.ts +281 -0
- package/dist/replay/index.d.ts +80 -0
- package/dist/replay/index.js +1112 -0
- package/dist/replay/index.js.map +1 -0
- package/dist/replay.types-C9hJizI-.d.ts +76 -0
- package/dist/storage/index.d.ts +135 -0
- package/dist/storage/index.js +588 -0
- package/dist/storage/index.js.map +1 -0
- package/dist/visualization/index.d.ts +123 -0
- package/dist/visualization/index.js +789 -0
- package/dist/visualization/index.js.map +1 -0
- package/dist/visualization.types-dWjGE037.d.ts +98 -0
- package/package.json +99 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/utils/helpers.ts","../../src/visualization/DecisionTree.ts","../../src/visualization/FlowGraph.ts"],"names":["DEFAULT_BUILD_OPTIONS"],"mappings":";;;AAWO,SAAS,UAAA,CAAW,SAAS,EAAA,EAAY;AAC9C,EAAA,MAAM,EAAA,GAAK,OAAO,EAAE,CAAA;AACpB,EAAA,OAAO,MAAA,GAAS,CAAA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EACxB;AAAA;AAAA;AAAA;AAAA,EAKQ,YAAY,IAAA,EAA6B;AAC/C,IAAA,QAAQ,IAAA,CAAK,OAAO,KAAA;AAAO,MACzB,KAAK,SAAA;AACH,QAAA,OAAO,SAAA;AAAA,MACT,KAAK,SAAA;AACH,QAAA,OAAO,SAAA;AAAA,MACT,KAAK,SAAA;AACH,QAAA,OAAO,SAAA;AAAA,MACT;AACE,QAAA,OAAO,KAAA;AAAA;AACX,EACF;AACF;AAKO,SAAS,uBACd,OAAA,EACkB;AAClB,EAAA,OAAO,IAAI,iBAAiB,OAAO,CAAA;AACrC","file":"index.js","sourcesContent":["/**\n * Helper Utilities\n *\n * Common utility functions for the debugger.\n */\n\nimport { nanoid } from 'nanoid';\n\n/**\n * Generate a unique ID with optional prefix\n */\nexport function generateId(prefix = ''): string {\n const id = nanoid(12);\n return prefix ? `${prefix}_${id}` : id;\n}\n\n/**\n * Get current timestamp in milliseconds\n */\nexport function now(): number {\n return Date.now();\n}\n\n/**\n * Calculate duration between two timestamps\n */\nexport function duration(start: number, end: number = now()): number {\n return end - start;\n}\n\n/**\n * Deep clone an object\n */\nexport function deepClone<T>(obj: T): T {\n if (obj === null || typeof obj !== 'object') {\n return obj;\n }\n\n if (Array.isArray(obj)) {\n return obj.map((item) => deepClone(item)) as T;\n }\n\n if (obj instanceof Date) {\n return new Date(obj.getTime()) as T;\n }\n\n if (obj instanceof Map) {\n const clonedMap = new Map();\n obj.forEach((value, key) => {\n clonedMap.set(deepClone(key), deepClone(value));\n });\n return clonedMap as T;\n }\n\n if (obj instanceof Set) {\n const clonedSet = new Set();\n obj.forEach((value) => {\n clonedSet.add(deepClone(value));\n });\n return clonedSet as T;\n }\n\n const clonedObj = {} as T;\n for (const key in obj) {\n if (Object.prototype.hasOwnProperty.call(obj, key)) {\n (clonedObj as Record<string, unknown>)[key] = deepClone(\n (obj as Record<string, unknown>)[key],\n );\n }\n }\n\n return clonedObj;\n}\n\n/**\n * Safely serialize an object to JSON\n */\nexport function safeStringify(obj: unknown, indent = 0): string {\n const seen = new WeakSet();\n\n return JSON.stringify(\n obj,\n (key, value) => {\n if (typeof value === 'object' && value !== null) {\n if (seen.has(value)) {\n return '[Circular]';\n }\n seen.add(value);\n }\n\n // Handle special types\n if (value instanceof Error) {\n return {\n name: value.name,\n message: value.message,\n stack: value.stack,\n };\n }\n\n if (value instanceof Map) {\n return Object.fromEntries(value);\n }\n\n if (value instanceof Set) {\n return Array.from(value);\n }\n\n if (typeof value === 'function') {\n return `[Function: ${value.name || 'anonymous'}]`;\n }\n\n if (typeof value === 'bigint') {\n return value.toString();\n }\n\n return value;\n },\n indent,\n );\n}\n\n/**\n * Safely parse JSON\n */\nexport function safeParse<T>(json: string, defaultValue?: T): T | undefined {\n try {\n return JSON.parse(json) as T;\n } catch {\n return defaultValue;\n }\n}\n\n/**\n * Format duration in human-readable format\n */\nexport function formatDuration(ms: number): string {\n if (ms < 1000) {\n return `${ms}ms`;\n }\n\n const seconds = Math.floor(ms / 1000);\n const minutes = Math.floor(seconds / 60);\n const hours = Math.floor(minutes / 60);\n\n if (hours > 0) {\n return `${hours}h ${minutes % 60}m ${seconds % 60}s`;\n }\n\n if (minutes > 0) {\n return `${minutes}m ${seconds % 60}s`;\n }\n\n return `${seconds}s`;\n}\n\n/**\n * Format bytes in human-readable format\n */\nexport function formatBytes(bytes: number): string {\n const units = ['B', 'KB', 'MB', 'GB', 'TB'];\n let size = bytes;\n let unitIndex = 0;\n\n while (size >= 1024 && unitIndex < units.length - 1) {\n size /= 1024;\n unitIndex++;\n }\n\n return `${size.toFixed(2)} ${units[unitIndex]}`;\n}\n\n/**\n * Truncate string to max length\n */\nexport function truncate(\n str: string,\n maxLength: number,\n suffix = '...',\n): string {\n if (str.length <= maxLength) {\n return str;\n }\n return str.slice(0, maxLength - suffix.length) + suffix;\n}\n\n/**\n * Debounce a function\n */\nexport function debounce<T extends (...args: unknown[]) => unknown>(\n fn: T,\n delay: number,\n): (...args: Parameters<T>) => void {\n let timeoutId: ReturnType<typeof setTimeout> | null = null;\n\n return (...args: Parameters<T>) => {\n if (timeoutId) {\n clearTimeout(timeoutId);\n }\n timeoutId = setTimeout(() => {\n fn(...args);\n timeoutId = null;\n }, delay);\n };\n}\n\n/**\n * Sleep for a given duration\n */\nexport function sleep(ms: number): Promise<void> {\n return new Promise((resolve) => setTimeout(resolve, ms));\n}\n\n/**\n * Retry a function with exponential backoff\n */\nexport async function retry<T>(\n fn: () => Promise<T>,\n maxAttempts = 3,\n baseDelayMs = 100,\n): Promise<T> {\n let lastError: Error | undefined;\n\n for (let attempt = 0; attempt < maxAttempts; attempt++) {\n try {\n return await fn();\n } catch (error) {\n lastError = error as Error;\n if (attempt < maxAttempts - 1) {\n await sleep(baseDelayMs * Math.pow(2, attempt));\n }\n }\n }\n\n throw lastError;\n}\n\n/**\n * Calculate object size in bytes (approximate)\n */\nexport function estimateSize(obj: unknown): number {\n return safeStringify(obj).length * 2; // UTF-16\n}\n","/**\n * DecisionTree\n *\n * Decision tree visualization for agent decision points.\n */\n\nimport type {\n DecisionTree,\n DecisionTreeNode,\n ExecutionStep,\n Decision,\n Recording,\n} from '../types/index.js';\nimport { generateId } from '../utils/helpers.js';\n\n/**\n * Node creation options\n */\nexport interface NodeOptions {\n /** Node label */\n label: string;\n /** Node type */\n type: 'decision' | 'outcome' | 'action' | 'branch';\n /** Decision data */\n decision?: Decision;\n /** Step reference */\n stepIndex?: number;\n /** Parent node ID */\n parentId?: string;\n /** Metadata */\n metadata?: Record<string, unknown>;\n}\n\n/**\n * Tree building options\n */\nexport interface TreeBuildOptions {\n /** Include tool calls as nodes */\n includeToolCalls?: boolean;\n /** Include all steps or just decisions */\n allSteps?: boolean;\n /** Maximum depth */\n maxDepth?: number;\n /** Collapse similar nodes */\n collapseSimilar?: boolean;\n}\n\n/**\n * Tree layout options\n */\nexport interface LayoutOptions {\n /** Layout direction */\n direction?: 'horizontal' | 'vertical';\n /** Node spacing */\n nodeSpacing?: number;\n /** Level spacing */\n levelSpacing?: number;\n /** Node width */\n nodeWidth?: number;\n /** Node height */\n nodeHeight?: number;\n}\n\n/**\n * Default options\n */\nconst DEFAULT_BUILD_OPTIONS: Required<TreeBuildOptions> = {\n includeToolCalls: true,\n allSteps: false,\n maxDepth: 50,\n collapseSimilar: false,\n};\n\nconst DEFAULT_LAYOUT_OPTIONS: Required<LayoutOptions> = {\n direction: 'vertical',\n nodeSpacing: 50,\n levelSpacing: 100,\n nodeWidth: 200,\n nodeHeight: 80,\n};\n\n/**\n * DecisionTreeBuilder\n *\n * Builds decision trees from recordings.\n *\n * @example\n * ```typescript\n * const builder = new DecisionTreeBuilder();\n *\n * // Build tree from recording\n * const tree = builder.build(recording);\n *\n * // Add a node\n * const node = builder.addNode({\n * label: 'Choose API',\n * type: 'decision',\n * decision: decisionData,\n * });\n *\n * // Export for visualization\n * const data = builder.export();\n * ```\n */\nexport class DecisionTreeBuilder {\n private nodes: Map<string, DecisionTreeNode> = new Map();\n private rootId?: string;\n private buildOptions: Required<TreeBuildOptions>;\n private layoutOptions: Required<LayoutOptions>;\n\n constructor(buildOptions?: TreeBuildOptions, layoutOptions?: LayoutOptions) {\n this.buildOptions = {\n ...DEFAULT_BUILD_OPTIONS,\n ...buildOptions,\n };\n\n this.layoutOptions = {\n ...DEFAULT_LAYOUT_OPTIONS,\n ...layoutOptions,\n };\n }\n\n /**\n * Build tree from a recording\n */\n build(recording: Recording): DecisionTree {\n this.clear();\n\n // Create root node\n const rootNode = this.addNode({\n label: 'Start',\n type: 'action',\n stepIndex: -1,\n metadata: {\n agentId: recording.agentId,\n agentName: recording.agentName,\n },\n });\n\n this.rootId = rootNode.id;\n let currentParentId = rootNode.id;\n let depth = 0;\n\n // Process steps\n for (const step of recording.steps) {\n if (depth >= this.buildOptions.maxDepth) {\n break;\n }\n\n const node = this.processStep(step, currentParentId, depth);\n\n if (node) {\n if (step.type === 'decision') {\n // Decision creates branches\n currentParentId = node.id;\n depth++;\n } else if (this.buildOptions.allSteps) {\n currentParentId = node.id;\n }\n }\n }\n\n // Add end node\n this.addNode({\n label: recording.status === 'completed' ? 'Complete' : 'Failed',\n type: 'outcome',\n parentId: currentParentId,\n metadata: {\n status: recording.status,\n durationMs: recording.durationMs,\n },\n });\n\n return this.export();\n }\n\n /**\n * Process a step into a node\n */\n private processStep(\n step: ExecutionStep,\n parentId: string,\n depth: number,\n ): DecisionTreeNode | null {\n // Handle decision steps\n if (step.type === 'decision' && step.decision) {\n return this.addDecisionNode(step, parentId, depth);\n }\n\n // Handle tool calls if enabled\n if (this.buildOptions.includeToolCalls && step.type === 'tool-call') {\n return this.addNode({\n label: `Tool: ${step.toolCall?.name ?? 'unknown'}`,\n type: 'action',\n stepIndex: step.index,\n parentId,\n metadata: {\n toolName: step.toolCall?.name,\n arguments: step.toolCall?.arguments,\n },\n });\n }\n\n // Handle all steps if enabled\n if (this.buildOptions.allSteps) {\n return this.addNode({\n label: this.getStepLabel(step),\n type: 'action',\n stepIndex: step.index,\n parentId,\n });\n }\n\n return null;\n }\n\n /**\n * Add a decision node with branches\n */\n private addDecisionNode(\n step: ExecutionStep,\n parentId: string,\n _depth: number,\n ): DecisionTreeNode {\n const decision = step.decision!;\n\n // Create decision node\n const decisionNode = this.addNode({\n label: decision.reason ?? 'Decision',\n type: 'decision',\n decision,\n stepIndex: step.index,\n parentId,\n metadata: {\n confidence: decision.confidence,\n optionsCount: decision.options.length,\n },\n });\n\n // Create branch nodes for each option\n for (const option of decision.options) {\n const isChosen = option.id === decision.chosen.id;\n\n this.addNode({\n label: option.description,\n type: 'branch',\n parentId: decisionNode.id,\n metadata: {\n optionId: option.id,\n chosen: isChosen,\n score: option.score,\n },\n });\n }\n\n return decisionNode;\n }\n\n /**\n * Get label for a step\n */\n private getStepLabel(step: ExecutionStep): string {\n switch (step.type) {\n case 'input':\n return 'User Input';\n case 'prompt':\n return 'Send Prompt';\n case 'response':\n return 'LLM Response';\n case 'tool-call':\n return `Call: ${step.toolCall?.name}`;\n case 'tool-result':\n return `Result: ${step.toolCall?.success ? 'OK' : 'Failed'}`;\n case 'decision':\n return 'Decision';\n case 'error':\n return `Error: ${step.error?.name}`;\n default:\n return step.type;\n }\n }\n\n /**\n * Add a node\n */\n addNode(options: NodeOptions): DecisionTreeNode {\n const id = generateId('node');\n\n const node: DecisionTreeNode = {\n id,\n label: options.label,\n type: options.type,\n decision: options.decision,\n stepIndex: options.stepIndex,\n children: [],\n metadata: options.metadata,\n };\n\n this.nodes.set(id, node);\n\n // Add to parent's children\n if (options.parentId) {\n const parent = this.nodes.get(options.parentId);\n if (parent) {\n parent.children.push(id);\n }\n }\n\n // Set as root if no parent\n if (!options.parentId && !this.rootId) {\n this.rootId = id;\n }\n\n return node;\n }\n\n /**\n * Get a node by ID\n */\n getNode(id: string): DecisionTreeNode | undefined {\n return this.nodes.get(id);\n }\n\n /**\n * Get root node\n */\n getRoot(): DecisionTreeNode | undefined {\n return this.rootId ? this.nodes.get(this.rootId) : undefined;\n }\n\n /**\n * Get all nodes\n */\n getNodes(): DecisionTreeNode[] {\n return Array.from(this.nodes.values());\n }\n\n /**\n * Get nodes at depth\n */\n getNodesAtDepth(depth: number): DecisionTreeNode[] {\n const result: DecisionTreeNode[] = [];\n\n const traverse = (nodeId: string, currentDepth: number) => {\n const node = this.nodes.get(nodeId);\n if (!node) return;\n\n if (currentDepth === depth) {\n result.push(node);\n } else {\n for (const childId of node.children) {\n traverse(childId, currentDepth + 1);\n }\n }\n };\n\n if (this.rootId) {\n traverse(this.rootId, 0);\n }\n\n return result;\n }\n\n /**\n * Get tree depth\n */\n getDepth(): number {\n let maxDepth = 0;\n\n const traverse = (nodeId: string, depth: number) => {\n maxDepth = Math.max(maxDepth, depth);\n\n const node = this.nodes.get(nodeId);\n if (node) {\n for (const childId of node.children) {\n traverse(childId, depth + 1);\n }\n }\n };\n\n if (this.rootId) {\n traverse(this.rootId, 0);\n }\n\n return maxDepth;\n }\n\n /**\n * Find path to node\n */\n findPath(nodeId: string): DecisionTreeNode[] {\n const path: DecisionTreeNode[] = [];\n\n const findParent = (targetId: string): string | null => {\n for (const [id, node] of this.nodes) {\n if (node.children.includes(targetId)) {\n return id;\n }\n }\n return null;\n };\n\n let currentId: string | null = nodeId;\n while (currentId) {\n const node = this.nodes.get(currentId);\n if (node) {\n path.unshift(node);\n }\n currentId = findParent(currentId);\n }\n\n return path;\n }\n\n /**\n * Find nodes by step index\n */\n findByStepIndex(stepIndex: number): DecisionTreeNode[] {\n return this.getNodes().filter((n) => n.stepIndex === stepIndex);\n }\n\n /**\n * Find decision nodes\n */\n findDecisionNodes(): DecisionTreeNode[] {\n return this.getNodes().filter((n) => n.type === 'decision');\n }\n\n /**\n * Clear the tree\n */\n clear(): void {\n this.nodes.clear();\n this.rootId = undefined;\n }\n\n /**\n * Export tree structure\n */\n export(): DecisionTree {\n const root = this.getRoot();\n\n return {\n id: generateId('tree'),\n root: root ?? {\n id: 'empty',\n label: 'Empty Tree',\n type: 'action',\n children: [],\n },\n nodes: this.getNodes(),\n metadata: {\n nodeCount: this.nodes.size,\n depth: this.getDepth(),\n decisionCount: this.findDecisionNodes().length,\n },\n };\n }\n\n /**\n * Export to Mermaid format\n */\n toMermaid(): string {\n const lines: string[] = ['graph TD'];\n\n const traverse = (nodeId: string) => {\n const node = this.nodes.get(nodeId);\n if (!node) return;\n\n const shape = this.getMermaidShape(node);\n lines.push(` ${nodeId}${shape}`);\n\n for (const childId of node.children) {\n const child = this.nodes.get(childId);\n const edgeLabel = child?.metadata?.chosen ? ' --> |chosen|' : ' --> ';\n lines.push(` ${nodeId}${edgeLabel}${childId}`);\n traverse(childId);\n }\n };\n\n if (this.rootId) {\n traverse(this.rootId);\n }\n\n return lines.join('\\n');\n }\n\n /**\n * Get Mermaid shape for node\n */\n private getMermaidShape(node: DecisionTreeNode): string {\n const label = node.label.replace(/\"/g, \"'\");\n\n switch (node.type) {\n case 'decision':\n return `{${label}}`;\n case 'outcome':\n return `((${label}))`;\n case 'branch':\n return `[/${label}/]`;\n default:\n return `[${label}]`;\n }\n }\n\n /**\n * Calculate layout positions\n */\n calculateLayout(): Map<string, { x: number; y: number }> {\n const positions = new Map<string, { x: number; y: number }>();\n\n const levelWidths: number[] = [];\n const levelPositions: number[] = [];\n\n // Calculate width at each level\n const calculateLevelWidths = (nodeId: string, level: number) => {\n if (!levelWidths[level]) {\n levelWidths[level] = 0;\n }\n levelWidths[level]++;\n\n const node = this.nodes.get(nodeId);\n if (node) {\n for (const childId of node.children) {\n calculateLevelWidths(childId, level + 1);\n }\n }\n };\n\n if (this.rootId) {\n calculateLevelWidths(this.rootId, 0);\n }\n\n // Initialize level positions\n for (let i = 0; i < levelWidths.length; i++) {\n levelPositions[i] = 0;\n }\n\n // Assign positions\n const assignPositions = (nodeId: string, level: number) => {\n const node = this.nodes.get(nodeId);\n if (!node) return;\n\n const levelWidth = levelWidths[level] * this.layoutOptions.nodeSpacing;\n const startX = -levelWidth / 2;\n const x = startX + levelPositions[level] * this.layoutOptions.nodeSpacing;\n const y = level * this.layoutOptions.levelSpacing;\n\n positions.set(nodeId, { x, y });\n levelPositions[level]++;\n\n for (const childId of node.children) {\n assignPositions(childId, level + 1);\n }\n };\n\n if (this.rootId) {\n assignPositions(this.rootId, 0);\n }\n\n return positions;\n }\n}\n\n/**\n * Create a decision tree builder\n */\nexport function createDecisionTreeBuilder(\n buildOptions?: TreeBuildOptions,\n layoutOptions?: LayoutOptions,\n): DecisionTreeBuilder {\n return new DecisionTreeBuilder(buildOptions, layoutOptions);\n}\n","/**\n * FlowGraph\n *\n * Execution flow graph visualization.\n */\n\nimport type {\n FlowGraph,\n FlowGraphNode,\n FlowGraphEdge,\n ExecutionStep,\n Recording,\n StepType,\n} from '../types/index.js';\nimport { generateId } from '../utils/helpers.js';\n\n/**\n * Node style configuration\n */\nexport interface NodeStyle {\n /** Fill color */\n fill?: string;\n /** Border color */\n stroke?: string;\n /** Border width */\n strokeWidth?: number;\n /** Shape type */\n shape?: 'rectangle' | 'ellipse' | 'diamond' | 'hexagon';\n /** Font size */\n fontSize?: number;\n /** Text color */\n textColor?: string;\n}\n\n/**\n * Edge style configuration\n */\nexport interface EdgeStyle {\n /** Line color */\n stroke?: string;\n /** Line width */\n strokeWidth?: number;\n /** Line type */\n lineType?: 'solid' | 'dashed' | 'dotted';\n /** Arrow type */\n arrowType?: 'arrow' | 'none' | 'diamond';\n /** Curve type */\n curveType?: 'straight' | 'bezier' | 'step';\n}\n\n/**\n * Graph building options\n */\nexport interface GraphBuildOptions {\n /** Group consecutive steps of same type */\n groupSimilar?: boolean;\n /** Include step durations */\n includeDurations?: boolean;\n /** Include tool call details */\n includeToolDetails?: boolean;\n /** Maximum nodes */\n maxNodes?: number;\n /** Custom node style by type */\n nodeStyles?: Partial<Record<StepType, NodeStyle>>;\n}\n\n/**\n * Default node styles by type\n */\nconst DEFAULT_NODE_STYLES: Record<StepType, NodeStyle> = {\n input: { fill: '#e3f2fd', shape: 'rectangle' },\n prompt: { fill: '#f3e5f5', shape: 'rectangle' },\n response: { fill: '#e8f5e9', shape: 'rectangle' },\n output: { fill: '#c8e6c9', shape: 'rectangle' },\n 'tool-call': { fill: '#fff3e0', shape: 'hexagon' },\n 'tool-result': { fill: '#fff8e1', shape: 'rectangle' },\n decision: { fill: '#fce4ec', shape: 'diamond' },\n error: { fill: '#ffebee', shape: 'rectangle' },\n 'memory-read': { fill: '#e0f7fa', shape: 'ellipse' },\n 'memory-write': { fill: '#e0f2f1', shape: 'ellipse' },\n handoff: { fill: '#ede7f6', shape: 'hexagon' },\n delegation: { fill: '#e8eaf6', shape: 'hexagon' },\n custom: { fill: '#fafafa', shape: 'rectangle' },\n};\n\n/**\n * Default build options\n */\nconst DEFAULT_BUILD_OPTIONS: Required<GraphBuildOptions> = {\n groupSimilar: false,\n includeDurations: true,\n includeToolDetails: true,\n maxNodes: 200,\n nodeStyles: {},\n};\n\n/**\n * FlowGraphBuilder\n *\n * Builds execution flow graphs from recordings.\n *\n * @example\n * ```typescript\n * const builder = new FlowGraphBuilder();\n *\n * // Build graph from recording\n * const graph = builder.build(recording);\n *\n * // Export for visualization\n * const svg = builder.toSVG();\n * const mermaid = builder.toMermaid();\n * ```\n */\nexport class FlowGraphBuilder {\n private nodes: Map<string, FlowGraphNode> = new Map();\n private edges: Map<string, FlowGraphEdge> = new Map();\n private options: Required<GraphBuildOptions>;\n private nodeStyles: Record<StepType, NodeStyle>;\n\n constructor(options?: GraphBuildOptions) {\n this.options = {\n ...DEFAULT_BUILD_OPTIONS,\n ...options,\n };\n\n this.nodeStyles = {\n ...DEFAULT_NODE_STYLES,\n ...options?.nodeStyles,\n };\n }\n\n /**\n * Build graph from a recording\n */\n build(recording: Recording): FlowGraph {\n this.clear();\n\n // Create start node\n const startNode = this.addNode({\n label: 'Start',\n type: 'input',\n metadata: {\n agentId: recording.agentId,\n agentName: recording.agentName,\n },\n });\n\n let previousNodeId = startNode.id;\n let nodeCount = 1;\n\n // Process steps\n for (const step of recording.steps) {\n if (nodeCount >= this.options.maxNodes) {\n break;\n }\n\n // Skip if grouping similar and same type as previous\n if (this.options.groupSimilar && previousNodeId) {\n const prevNode = this.nodes.get(previousNodeId);\n if (prevNode && prevNode.type === step.type) {\n // Update existing node\n this.updateNodeForGroup(prevNode, step);\n continue;\n }\n }\n\n const node = this.createNodeFromStep(step);\n this.nodes.set(node.id, node);\n\n // Create edge from previous node\n if (previousNodeId) {\n this.addEdge(previousNodeId, node.id, {\n durationMs: step.durationMs,\n });\n }\n\n previousNodeId = node.id;\n nodeCount++;\n }\n\n // Create end node\n const endNode = this.addNode({\n label: recording.status === 'completed' ? 'Complete' : 'Failed',\n type: recording.status === 'completed' ? 'response' : 'error',\n metadata: {\n status: recording.status,\n durationMs: recording.durationMs,\n },\n });\n\n if (previousNodeId) {\n this.addEdge(previousNodeId, endNode.id);\n }\n\n return this.export();\n }\n\n /**\n * Create a node from a step\n */\n private createNodeFromStep(step: ExecutionStep): FlowGraphNode {\n const style = this.nodeStyles[step.type] ?? DEFAULT_NODE_STYLES.custom;\n\n const node: FlowGraphNode = {\n id: generateId('node'),\n label: this.getStepLabel(step),\n type: step.type,\n stepIndex: step.index,\n style,\n metadata: this.getStepMetadata(step),\n };\n\n return node;\n }\n\n /**\n * Get label for a step\n */\n private getStepLabel(step: ExecutionStep): string {\n switch (step.type) {\n case 'input':\n return 'User Input';\n case 'prompt':\n return 'Prompt';\n case 'response':\n return 'Response';\n case 'tool-call':\n if (this.options.includeToolDetails && step.toolCall) {\n return `${step.toolCall.name}()`;\n }\n return 'Tool Call';\n case 'tool-result':\n return step.toolCall?.success ? 'Success' : 'Failed';\n case 'decision':\n return step.decision?.reason ?? 'Decision';\n case 'error':\n return step.error?.name ?? 'Error';\n case 'memory-read':\n return 'Read Memory';\n case 'memory-write':\n return 'Write Memory';\n case 'handoff':\n case 'delegation':\n return 'Hand Off';\n default:\n return step.type;\n }\n }\n\n /**\n * Get metadata for a step\n */\n private getStepMetadata(step: ExecutionStep): Record<string, unknown> {\n const metadata: Record<string, unknown> = {\n stepIndex: step.index,\n timestamp: step.timestamp,\n };\n\n if (this.options.includeDurations && step.durationMs) {\n metadata.durationMs = step.durationMs;\n }\n\n if (step.toolCall) {\n metadata.toolName = step.toolCall.name;\n if (this.options.includeToolDetails) {\n metadata.toolArguments = step.toolCall.arguments;\n }\n }\n\n if (step.decision) {\n metadata.confidence = step.decision.confidence;\n metadata.chosenOption = step.decision.chosen.description;\n }\n\n if (step.error) {\n metadata.errorMessage = step.error.message;\n }\n\n return metadata;\n }\n\n /**\n * Update node when grouping similar steps\n */\n private updateNodeForGroup(node: FlowGraphNode, step: ExecutionStep): void {\n const count = (node.metadata?.groupCount as number) ?? 1;\n node.metadata = {\n ...node.metadata,\n groupCount: count + 1,\n lastStepIndex: step.index,\n };\n node.label = `${node.label} (${count + 1})`;\n }\n\n /**\n * Add a node\n */\n addNode(options: {\n label: string;\n type: StepType;\n stepIndex?: number;\n style?: NodeStyle;\n metadata?: Record<string, unknown>;\n }): FlowGraphNode {\n const id = generateId('node');\n const style =\n options.style ??\n this.nodeStyles[options.type] ??\n DEFAULT_NODE_STYLES.custom;\n\n const node: FlowGraphNode = {\n id,\n label: options.label,\n type: options.type,\n stepIndex: options.stepIndex,\n style,\n metadata: options.metadata,\n };\n\n this.nodes.set(id, node);\n return node;\n }\n\n /**\n * Add an edge\n */\n addEdge(\n sourceId: string,\n targetId: string,\n options?: {\n label?: string;\n style?: EdgeStyle;\n durationMs?: number;\n },\n ): FlowGraphEdge {\n const id = generateId('edge');\n\n const edge: FlowGraphEdge = {\n id,\n source: sourceId,\n target: targetId,\n label: options?.label,\n style: options?.style,\n metadata: options?.durationMs\n ? { durationMs: options.durationMs }\n : undefined,\n };\n\n this.edges.set(id, edge);\n return edge;\n }\n\n /**\n * Get a node by ID\n */\n getNode(id: string): FlowGraphNode | undefined {\n return this.nodes.get(id);\n }\n\n /**\n * Get all nodes\n */\n getNodes(): FlowGraphNode[] {\n return Array.from(this.nodes.values());\n }\n\n /**\n * Get nodes by type\n */\n getNodesByType(type: StepType): FlowGraphNode[] {\n return this.getNodes().filter((n) => n.type === type);\n }\n\n /**\n * Get an edge by ID\n */\n getEdge(id: string): FlowGraphEdge | undefined {\n return this.edges.get(id);\n }\n\n /**\n * Get all edges\n */\n getEdges(): FlowGraphEdge[] {\n return Array.from(this.edges.values());\n }\n\n /**\n * Get edges from a node\n */\n getEdgesFrom(nodeId: string): FlowGraphEdge[] {\n return this.getEdges().filter((e) => e.source === nodeId);\n }\n\n /**\n * Get edges to a node\n */\n getEdgesTo(nodeId: string): FlowGraphEdge[] {\n return this.getEdges().filter((e) => e.target === nodeId);\n }\n\n /**\n * Find path between nodes\n */\n findPath(startId: string, endId: string): FlowGraphNode[] | null {\n const visited = new Set<string>();\n const path: FlowGraphNode[] = [];\n\n const dfs = (currentId: string): boolean => {\n if (visited.has(currentId)) {\n return false;\n }\n\n visited.add(currentId);\n const node = this.nodes.get(currentId);\n\n if (!node) {\n return false;\n }\n\n path.push(node);\n\n if (currentId === endId) {\n return true;\n }\n\n for (const edge of this.getEdgesFrom(currentId)) {\n if (dfs(edge.target)) {\n return true;\n }\n }\n\n path.pop();\n return false;\n };\n\n return dfs(startId) ? path : null;\n }\n\n /**\n * Get graph statistics\n */\n getStats(): {\n nodeCount: number;\n edgeCount: number;\n nodesByType: Record<string, number>;\n avgDuration: number;\n } {\n const nodesByType: Record<string, number> = {};\n let totalDuration = 0;\n let durationCount = 0;\n\n for (const node of this.nodes.values()) {\n nodesByType[node.type] = (nodesByType[node.type] ?? 0) + 1;\n\n const duration = node.metadata?.durationMs as number | undefined;\n if (duration) {\n totalDuration += duration;\n durationCount++;\n }\n }\n\n return {\n nodeCount: this.nodes.size,\n edgeCount: this.edges.size,\n nodesByType,\n avgDuration: durationCount > 0 ? totalDuration / durationCount : 0,\n };\n }\n\n /**\n * Clear the graph\n */\n clear(): void {\n this.nodes.clear();\n this.edges.clear();\n }\n\n /**\n * Export graph structure\n */\n export(): FlowGraph {\n return {\n id: generateId('graph'),\n nodes: this.getNodes(),\n edges: this.getEdges(),\n metadata: this.getStats(),\n };\n }\n\n /**\n * Export to Mermaid format\n */\n toMermaid(): string {\n const lines: string[] = ['flowchart TD'];\n\n // Add nodes\n for (const node of this.nodes.values()) {\n const shape = this.getMermaidShape(node);\n lines.push(` ${node.id}${shape}`);\n }\n\n // Add edges\n for (const edge of this.edges.values()) {\n const label = edge.label ? ` |${edge.label}|` : '';\n const arrow = edge.style?.lineType === 'dashed' ? '-.->' : '-->';\n lines.push(` ${edge.source}${arrow}${label}${edge.target}`);\n }\n\n return lines.join('\\n');\n }\n\n /**\n * Get Mermaid shape for node\n */\n private getMermaidShape(node: FlowGraphNode): string {\n const label = node.label.replace(/\"/g, \"'\");\n\n switch (node.style?.shape) {\n case 'ellipse':\n return `([${label}])`;\n case 'diamond':\n return `{${label}}`;\n case 'hexagon':\n return `{{${label}}}`;\n default:\n return `[${label}]`;\n }\n }\n\n /**\n * Export to DOT format (Graphviz)\n */\n toDOT(): string {\n const lines: string[] = ['digraph G {', ' rankdir=TB;'];\n\n // Add nodes\n for (const node of this.nodes.values()) {\n const shape = this.getDOTShape(node);\n const fill = node.style?.fill ?? '#ffffff';\n lines.push(\n ` \"${node.id}\" [label=\"${node.label}\", shape=${shape}, style=filled, fillcolor=\"${fill}\"];`,\n );\n }\n\n // Add edges\n for (const edge of this.edges.values()) {\n const label = edge.label ? `, label=\"${edge.label}\"` : '';\n const style = edge.style?.lineType === 'dashed' ? ', style=dashed' : '';\n lines.push(\n ` \"${edge.source}\" -> \"${edge.target}\" [${label}${style}];`,\n );\n }\n\n lines.push('}');\n return lines.join('\\n');\n }\n\n /**\n * Get DOT shape for node\n */\n private getDOTShape(node: FlowGraphNode): string {\n switch (node.style?.shape) {\n case 'ellipse':\n return 'ellipse';\n case 'diamond':\n return 'diamond';\n case 'hexagon':\n return 'hexagon';\n default:\n return 'box';\n }\n }\n}\n\n/**\n * Create a flow graph builder\n */\nexport function createFlowGraphBuilder(\n options?: GraphBuildOptions,\n): FlowGraphBuilder {\n return new FlowGraphBuilder(options);\n}\n"]}
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
import { e as Decision, S as StepType, T as ToolCall } from './recording.types-Ck7pbikw.js';
|
|
2
|
+
|
|
3
|
+
type FlowNodeType = StepType;
|
|
4
|
+
interface AlternativePath {
|
|
5
|
+
id: string;
|
|
6
|
+
option: string;
|
|
7
|
+
score?: number;
|
|
8
|
+
outcome?: string;
|
|
9
|
+
}
|
|
10
|
+
interface MermaidOptions {
|
|
11
|
+
direction?: 'TB' | 'BT' | 'LR' | 'RL';
|
|
12
|
+
includeStyles?: boolean;
|
|
13
|
+
theme?: 'default' | 'dark' | 'forest' | 'neutral';
|
|
14
|
+
}
|
|
15
|
+
type ExportFormat = 'mermaid' | 'dot' | 'json' | 'svg';
|
|
16
|
+
interface DecisionTreeNode {
|
|
17
|
+
id: string;
|
|
18
|
+
label: string;
|
|
19
|
+
type: 'decision' | 'outcome' | 'action' | 'branch';
|
|
20
|
+
decision?: Decision;
|
|
21
|
+
stepIndex?: number;
|
|
22
|
+
children: string[];
|
|
23
|
+
metadata?: Record<string, unknown>;
|
|
24
|
+
}
|
|
25
|
+
interface DecisionTree {
|
|
26
|
+
id: string;
|
|
27
|
+
root: DecisionTreeNode;
|
|
28
|
+
nodes: DecisionTreeNode[];
|
|
29
|
+
metadata?: Record<string, unknown>;
|
|
30
|
+
}
|
|
31
|
+
interface FlowGraphNode {
|
|
32
|
+
id: string;
|
|
33
|
+
label: string;
|
|
34
|
+
type: StepType;
|
|
35
|
+
stepIndex?: number;
|
|
36
|
+
style?: FlowNodeStyle;
|
|
37
|
+
metadata?: Record<string, unknown>;
|
|
38
|
+
}
|
|
39
|
+
interface FlowNodeStyle {
|
|
40
|
+
fill?: string;
|
|
41
|
+
stroke?: string;
|
|
42
|
+
strokeWidth?: number;
|
|
43
|
+
shape?: 'rectangle' | 'ellipse' | 'diamond' | 'hexagon';
|
|
44
|
+
fontSize?: number;
|
|
45
|
+
textColor?: string;
|
|
46
|
+
}
|
|
47
|
+
interface FlowGraphEdge {
|
|
48
|
+
id: string;
|
|
49
|
+
source: string;
|
|
50
|
+
target: string;
|
|
51
|
+
label?: string;
|
|
52
|
+
style?: FlowEdgeStyle;
|
|
53
|
+
metadata?: Record<string, unknown>;
|
|
54
|
+
}
|
|
55
|
+
interface FlowEdgeStyle {
|
|
56
|
+
stroke?: string;
|
|
57
|
+
strokeWidth?: number;
|
|
58
|
+
lineType?: 'solid' | 'dashed' | 'dotted';
|
|
59
|
+
arrowType?: 'arrow' | 'none' | 'diamond';
|
|
60
|
+
curveType?: 'straight' | 'bezier' | 'step';
|
|
61
|
+
}
|
|
62
|
+
interface FlowGraph {
|
|
63
|
+
id: string;
|
|
64
|
+
nodes: FlowGraphNode[];
|
|
65
|
+
edges: FlowGraphEdge[];
|
|
66
|
+
metadata?: Record<string, unknown>;
|
|
67
|
+
}
|
|
68
|
+
interface StateTimelineEntry {
|
|
69
|
+
timestamp: number;
|
|
70
|
+
stepIndex: number;
|
|
71
|
+
variable: string;
|
|
72
|
+
previousValue?: unknown;
|
|
73
|
+
newValue: unknown;
|
|
74
|
+
changeType: 'added' | 'modified' | 'removed';
|
|
75
|
+
}
|
|
76
|
+
interface StateTimeline {
|
|
77
|
+
recordingId: string;
|
|
78
|
+
entries: StateTimelineEntry[];
|
|
79
|
+
variables: string[];
|
|
80
|
+
durationMs: number;
|
|
81
|
+
}
|
|
82
|
+
interface ToolCallTreeNode {
|
|
83
|
+
id: string;
|
|
84
|
+
toolCall: ToolCall;
|
|
85
|
+
stepIndex: number;
|
|
86
|
+
parentId?: string;
|
|
87
|
+
childIds: string[];
|
|
88
|
+
depth: number;
|
|
89
|
+
}
|
|
90
|
+
interface ToolCallTree {
|
|
91
|
+
recordingId: string;
|
|
92
|
+
roots: string[];
|
|
93
|
+
nodes: Map<string, ToolCallTreeNode>;
|
|
94
|
+
totalCalls: number;
|
|
95
|
+
maxDepth: number;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
export type { AlternativePath as A, DecisionTreeNode as D, ExportFormat as E, FlowGraphNode as F, MermaidOptions as M, StateTimelineEntry as S, ToolCallTreeNode as T, DecisionTree as a, FlowNodeType as b, FlowNodeStyle as c, FlowGraphEdge as d, FlowEdgeStyle as e, FlowGraph as f, StateTimeline as g, ToolCallTree as h };
|
package/package.json
ADDED
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@lov3kaizen/agentsea-debugger",
|
|
3
|
+
"version": "0.5.1",
|
|
4
|
+
"description": "AI Agent debugger with step-through execution, decision tree visualization, checkpoint replay, and what-if scenario testing",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"main": "./dist/index.js",
|
|
7
|
+
"module": "./dist/index.js",
|
|
8
|
+
"types": "./dist/index.d.ts",
|
|
9
|
+
"exports": {
|
|
10
|
+
".": {
|
|
11
|
+
"types": "./dist/index.d.ts",
|
|
12
|
+
"import": "./dist/index.js"
|
|
13
|
+
},
|
|
14
|
+
"./recording": {
|
|
15
|
+
"types": "./dist/recording/index.d.ts",
|
|
16
|
+
"import": "./dist/recording/index.js"
|
|
17
|
+
},
|
|
18
|
+
"./replay": {
|
|
19
|
+
"types": "./dist/replay/index.d.ts",
|
|
20
|
+
"import": "./dist/replay/index.js"
|
|
21
|
+
},
|
|
22
|
+
"./visualization": {
|
|
23
|
+
"types": "./dist/visualization/index.d.ts",
|
|
24
|
+
"import": "./dist/visualization/index.js"
|
|
25
|
+
},
|
|
26
|
+
"./analysis": {
|
|
27
|
+
"types": "./dist/analysis/index.d.ts",
|
|
28
|
+
"import": "./dist/analysis/index.js"
|
|
29
|
+
},
|
|
30
|
+
"./storage": {
|
|
31
|
+
"types": "./dist/storage/index.d.ts",
|
|
32
|
+
"import": "./dist/storage/index.js"
|
|
33
|
+
},
|
|
34
|
+
"./agentsea": {
|
|
35
|
+
"types": "./dist/integrations/agentsea/index.d.ts",
|
|
36
|
+
"import": "./dist/integrations/agentsea/index.js"
|
|
37
|
+
}
|
|
38
|
+
},
|
|
39
|
+
"files": [
|
|
40
|
+
"dist",
|
|
41
|
+
"README.md"
|
|
42
|
+
],
|
|
43
|
+
"keywords": [
|
|
44
|
+
"debugger",
|
|
45
|
+
"ai",
|
|
46
|
+
"agent",
|
|
47
|
+
"replay",
|
|
48
|
+
"checkpoint",
|
|
49
|
+
"decision-tree",
|
|
50
|
+
"visualization",
|
|
51
|
+
"what-if",
|
|
52
|
+
"agentsea",
|
|
53
|
+
"llm"
|
|
54
|
+
],
|
|
55
|
+
"author": "lov3kaizen",
|
|
56
|
+
"license": "MIT",
|
|
57
|
+
"repository": {
|
|
58
|
+
"type": "git",
|
|
59
|
+
"url": "https://github.com/lov3kaizen/agentsea.git",
|
|
60
|
+
"directory": "packages/debugger"
|
|
61
|
+
},
|
|
62
|
+
"dependencies": {
|
|
63
|
+
"eventemitter3": "^5.0.1",
|
|
64
|
+
"lru-cache": "^10.4.3",
|
|
65
|
+
"nanoid": "^5.0.9",
|
|
66
|
+
"deep-diff": "^1.0.2"
|
|
67
|
+
},
|
|
68
|
+
"devDependencies": {
|
|
69
|
+
"@types/deep-diff": "^1.0.5",
|
|
70
|
+
"@types/node": "^20.17.10",
|
|
71
|
+
"tsup": "^8.3.5",
|
|
72
|
+
"typescript": "^5.7.2",
|
|
73
|
+
"vitest": "^2.1.8"
|
|
74
|
+
},
|
|
75
|
+
"peerDependencies": {
|
|
76
|
+
"@lov3kaizen/agentsea-core": ">=0.5.0"
|
|
77
|
+
},
|
|
78
|
+
"peerDependenciesMeta": {
|
|
79
|
+
"@lov3kaizen/agentsea-core": {
|
|
80
|
+
"optional": true
|
|
81
|
+
}
|
|
82
|
+
},
|
|
83
|
+
"optionalDependencies": {
|
|
84
|
+
"better-sqlite3": "^11.7.0"
|
|
85
|
+
},
|
|
86
|
+
"engines": {
|
|
87
|
+
"node": ">=18.0.0"
|
|
88
|
+
},
|
|
89
|
+
"scripts": {
|
|
90
|
+
"build": "tsup",
|
|
91
|
+
"dev": "tsup --watch",
|
|
92
|
+
"test": "vitest run",
|
|
93
|
+
"test:watch": "vitest",
|
|
94
|
+
"test:coverage": "vitest run --coverage",
|
|
95
|
+
"lint": "eslint src --ext .ts",
|
|
96
|
+
"type-check": "tsc --noEmit",
|
|
97
|
+
"clean": "rm -rf dist"
|
|
98
|
+
}
|
|
99
|
+
}
|