@stackmemoryai/stackmemory 0.5.23 → 0.5.24

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.
Files changed (69) hide show
  1. package/dist/cli/claude-sm.js +2 -0
  2. package/dist/cli/claude-sm.js.map +2 -2
  3. package/dist/cli/commands/discovery.js +279 -0
  4. package/dist/cli/commands/discovery.js.map +7 -0
  5. package/dist/cli/index.js +2 -0
  6. package/dist/cli/index.js.map +2 -2
  7. package/dist/core/retrieval/llm-context-retrieval.js +1 -3
  8. package/dist/core/retrieval/llm-context-retrieval.js.map +3 -3
  9. package/dist/integrations/mcp/handlers/discovery-handlers.js +497 -0
  10. package/dist/integrations/mcp/handlers/discovery-handlers.js.map +7 -0
  11. package/dist/integrations/mcp/handlers/index.js +40 -12
  12. package/dist/integrations/mcp/handlers/index.js.map +2 -2
  13. package/dist/integrations/mcp/server.js +270 -0
  14. package/dist/integrations/mcp/server.js.map +2 -2
  15. package/dist/integrations/mcp/tool-definitions.js +141 -5
  16. package/dist/integrations/mcp/tool-definitions.js.map +2 -2
  17. package/package.json +1 -1
  18. package/dist/cli/commands/agent.js +0 -286
  19. package/dist/cli/commands/agent.js.map +0 -7
  20. package/dist/cli/commands/chromadb.js +0 -482
  21. package/dist/cli/commands/chromadb.js.map +0 -7
  22. package/dist/cli/commands/gc.js +0 -251
  23. package/dist/cli/commands/gc.js.map +0 -7
  24. package/dist/cli/commands/infinite-storage.js +0 -292
  25. package/dist/cli/commands/infinite-storage.js.map +0 -7
  26. package/dist/cli/commands/linear-create.js +0 -171
  27. package/dist/cli/commands/linear-create.js.map +0 -7
  28. package/dist/cli/commands/linear-list.js +0 -103
  29. package/dist/cli/commands/linear-list.js.map +0 -7
  30. package/dist/cli/commands/linear-migrate.js +0 -64
  31. package/dist/cli/commands/linear-migrate.js.map +0 -7
  32. package/dist/cli/commands/linear-test.js +0 -134
  33. package/dist/cli/commands/linear-test.js.map +0 -7
  34. package/dist/cli/commands/tui.js +0 -77
  35. package/dist/cli/commands/tui.js.map +0 -7
  36. package/dist/cli/commands/webhook.js +0 -181
  37. package/dist/cli/commands/webhook.js.map +0 -7
  38. package/dist/cli/streamlined-cli.js +0 -144
  39. package/dist/cli/streamlined-cli.js.map +0 -7
  40. package/dist/core/events/event-bus.js +0 -110
  41. package/dist/core/events/event-bus.js.map +0 -7
  42. package/dist/core/frame/workflow-templates-stub.js +0 -42
  43. package/dist/core/frame/workflow-templates-stub.js.map +0 -7
  44. package/dist/core/plugins/plugin-interface.js +0 -87
  45. package/dist/core/plugins/plugin-interface.js.map +0 -7
  46. package/dist/core/session/clear-survival-stub.js +0 -53
  47. package/dist/core/session/clear-survival-stub.js.map +0 -7
  48. package/dist/core/storage/chromadb-simple.js +0 -172
  49. package/dist/core/storage/chromadb-simple.js.map +0 -7
  50. package/dist/core/storage/simplified-storage.js +0 -328
  51. package/dist/core/storage/simplified-storage.js.map +0 -7
  52. package/dist/features/tasks/pebbles-task-store.js +0 -647
  53. package/dist/features/tasks/pebbles-task-store.js.map +0 -7
  54. package/dist/integrations/linear/sync-enhanced.js +0 -202
  55. package/dist/integrations/linear/sync-enhanced.js.map +0 -7
  56. package/dist/plugins/linear/index.js +0 -166
  57. package/dist/plugins/linear/index.js.map +0 -7
  58. package/dist/plugins/loader.js +0 -57
  59. package/dist/plugins/loader.js.map +0 -7
  60. package/dist/plugins/plugin-interface.js +0 -67
  61. package/dist/plugins/plugin-interface.js.map +0 -7
  62. package/dist/plugins/ralph/simple-ralph-plugin.js +0 -305
  63. package/dist/plugins/ralph/simple-ralph-plugin.js.map +0 -7
  64. package/dist/plugins/ralph/use-cases/code-generator.js +0 -151
  65. package/dist/plugins/ralph/use-cases/code-generator.js.map +0 -7
  66. package/dist/plugins/ralph/use-cases/test-generator.js +0 -201
  67. package/dist/plugins/ralph/use-cases/test-generator.js.map +0 -7
  68. package/dist/utils/logger.js +0 -52
  69. package/dist/utils/logger.js.map +0 -7
@@ -11,7 +11,8 @@ class MCPToolDefinitions {
11
11
  ...this.getContextTools(),
12
12
  ...this.getTaskTools(),
13
13
  ...this.getLinearTools(),
14
- ...this.getTraceTools()
14
+ ...this.getTraceTools(),
15
+ ...this.getDiscoveryTools()
15
16
  ];
16
17
  }
17
18
  /**
@@ -68,7 +69,14 @@ class MCPToolDefinitions {
68
69
  },
69
70
  type: {
70
71
  type: "string",
71
- enum: ["task", "subtask", "tool_scope", "review", "write", "debug"],
72
+ enum: [
73
+ "task",
74
+ "subtask",
75
+ "tool_scope",
76
+ "review",
77
+ "write",
78
+ "debug"
79
+ ],
72
80
  default: "task",
73
81
  description: "Type of frame"
74
82
  },
@@ -110,7 +118,14 @@ class MCPToolDefinitions {
110
118
  properties: {
111
119
  type: {
112
120
  type: "string",
113
- enum: ["FACT", "DECISION", "CONSTRAINT", "INTERFACE_CONTRACT", "TODO", "RISK"],
121
+ enum: [
122
+ "FACT",
123
+ "DECISION",
124
+ "CONSTRAINT",
125
+ "INTERFACE_CONTRACT",
126
+ "TODO",
127
+ "RISK"
128
+ ],
114
129
  description: "Type of anchor"
115
130
  },
116
131
  text: {
@@ -194,7 +209,13 @@ class MCPToolDefinitions {
194
209
  },
195
210
  status: {
196
211
  type: "string",
197
- enum: ["pending", "in-progress", "blocked", "completed", "cancelled"],
212
+ enum: [
213
+ "pending",
214
+ "in-progress",
215
+ "blocked",
216
+ "completed",
217
+ "cancelled"
218
+ ],
198
219
  description: "New status"
199
220
  },
200
221
  progress: {
@@ -215,7 +236,13 @@ class MCPToolDefinitions {
215
236
  properties: {
216
237
  status: {
217
238
  type: "string",
218
- enum: ["pending", "in-progress", "blocked", "completed", "cancelled"],
239
+ enum: [
240
+ "pending",
241
+ "in-progress",
242
+ "blocked",
243
+ "completed",
244
+ "cancelled"
245
+ ],
219
246
  description: "Filter by status"
220
247
  },
221
248
  priority: {
@@ -536,6 +563,113 @@ class MCPToolDefinitions {
536
563
  }
537
564
  ];
538
565
  }
566
+ /**
567
+ * Discovery and exploration tools
568
+ */
569
+ getDiscoveryTools() {
570
+ return [
571
+ {
572
+ name: "sm_discover",
573
+ description: "Discover relevant files based on current context. Extracts keywords from active frames and searches codebase for related files.",
574
+ inputSchema: {
575
+ type: "object",
576
+ properties: {
577
+ query: {
578
+ type: "string",
579
+ description: "Optional query to focus the discovery"
580
+ },
581
+ depth: {
582
+ type: "string",
583
+ enum: ["shallow", "medium", "deep"],
584
+ default: "medium",
585
+ description: "Search depth - shallow for quick results, deep for thorough exploration"
586
+ },
587
+ includePatterns: {
588
+ type: "array",
589
+ items: { type: "string" },
590
+ description: 'File patterns to include (e.g., ["*.ts", "*.md"])'
591
+ },
592
+ excludePatterns: {
593
+ type: "array",
594
+ items: { type: "string" },
595
+ description: 'Patterns to exclude (e.g., ["node_modules", "dist"])'
596
+ },
597
+ maxFiles: {
598
+ type: "number",
599
+ default: 20,
600
+ description: "Maximum files to return"
601
+ }
602
+ }
603
+ }
604
+ },
605
+ {
606
+ name: "sm_related_files",
607
+ description: "Find files related to a specific file or concept. Useful for understanding dependencies and connections.",
608
+ inputSchema: {
609
+ type: "object",
610
+ properties: {
611
+ file: {
612
+ type: "string",
613
+ description: "File path to find related files for"
614
+ },
615
+ concept: {
616
+ type: "string",
617
+ description: "Concept or term to find related files for"
618
+ },
619
+ maxFiles: {
620
+ type: "number",
621
+ default: 10,
622
+ description: "Maximum files to return"
623
+ }
624
+ }
625
+ }
626
+ },
627
+ {
628
+ name: "sm_session_summary",
629
+ description: "Get a summary of the current session including active tasks, recent files, and decisions made.",
630
+ inputSchema: {
631
+ type: "object",
632
+ properties: {
633
+ includeFiles: {
634
+ type: "boolean",
635
+ default: true,
636
+ description: "Include list of recently accessed files"
637
+ },
638
+ includeDecisions: {
639
+ type: "boolean",
640
+ default: true,
641
+ description: "Include recent decisions and constraints"
642
+ }
643
+ }
644
+ }
645
+ },
646
+ {
647
+ name: "sm_search",
648
+ description: "Search across StackMemory context - frames, events, decisions, and tasks.",
649
+ inputSchema: {
650
+ type: "object",
651
+ properties: {
652
+ query: {
653
+ type: "string",
654
+ description: "Search query"
655
+ },
656
+ scope: {
657
+ type: "string",
658
+ enum: ["all", "frames", "events", "decisions", "tasks"],
659
+ default: "all",
660
+ description: "Scope of search"
661
+ },
662
+ limit: {
663
+ type: "number",
664
+ default: 20,
665
+ description: "Maximum results to return"
666
+ }
667
+ },
668
+ required: ["query"]
669
+ }
670
+ }
671
+ ];
672
+ }
539
673
  /**
540
674
  * Get tool definition by name
541
675
  */
@@ -555,6 +689,8 @@ class MCPToolDefinitions {
555
689
  return this.getLinearTools();
556
690
  case "trace":
557
691
  return this.getTraceTools();
692
+ case "discovery":
693
+ return this.getDiscoveryTools();
558
694
  default:
559
695
  return [];
560
696
  }
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/integrations/mcp/tool-definitions.ts"],
4
- "sourcesContent": ["/**\n * MCP Tool Definitions\n * Centralized tool schema definitions for the MCP server\n */\n\nexport interface MCPToolDefinition {\n name: string;\n description: string;\n inputSchema: {\n type: 'object';\n properties: Record<string, any>;\n required?: string[];\n };\n}\n\nexport class MCPToolDefinitions {\n /**\n * Get all tool definitions\n */\n getAllToolDefinitions(): MCPToolDefinition[] {\n return [\n ...this.getContextTools(),\n ...this.getTaskTools(),\n ...this.getLinearTools(),\n ...this.getTraceTools(),\n ];\n }\n\n /**\n * Context management tools\n */\n private getContextTools(): MCPToolDefinition[] {\n return [\n {\n name: 'get_context',\n description: 'Get current project context and active frame information',\n inputSchema: {\n type: 'object',\n properties: {\n query: {\n type: 'string',\n description: 'What you want to know about the current context',\n },\n limit: {\n type: 'number',\n description: 'Max number of contexts to return',\n default: 5,\n },\n },\n },\n },\n {\n name: 'add_decision',\n description: 'Record a decision, constraint, or important information',\n inputSchema: {\n type: 'object',\n properties: {\n content: {\n type: 'string',\n description: 'The decision or information to record',\n },\n type: {\n type: 'string',\n enum: ['decision', 'constraint', 'learning'],\n description: 'Type of information being recorded',\n },\n },\n required: ['content', 'type'],\n },\n },\n {\n name: 'start_frame',\n description: 'Start a new frame (task/subtask) on the call stack',\n inputSchema: {\n type: 'object',\n properties: {\n name: { \n type: 'string', \n description: 'Frame name/goal' \n },\n type: {\n type: 'string',\n enum: ['task', 'subtask', 'tool_scope', 'review', 'write', 'debug'],\n default: 'task',\n description: 'Type of frame',\n },\n constraints: {\n type: 'array',\n items: { type: 'string' },\n description: 'List of constraints for this frame',\n },\n definitions: {\n type: 'object',\n description: 'Key definitions and context',\n },\n },\n required: ['name'],\n },\n },\n {\n name: 'close_frame',\n description: 'Close current or specified frame with optional summary',\n inputSchema: {\n type: 'object',\n properties: {\n frameId: {\n type: 'string',\n description: 'Frame ID to close (defaults to current)',\n },\n summary: {\n type: 'string',\n description: 'Summary of what was accomplished',\n },\n },\n },\n },\n {\n name: 'add_anchor',\n description: 'Add an important fact or decision anchor to current frame',\n inputSchema: {\n type: 'object',\n properties: {\n type: {\n type: 'string',\n enum: ['FACT', 'DECISION', 'CONSTRAINT', 'INTERFACE_CONTRACT', 'TODO', 'RISK'],\n description: 'Type of anchor',\n },\n text: {\n type: 'string',\n description: 'The anchor content',\n },\n priority: {\n type: 'number',\n minimum: 1,\n maximum: 10,\n default: 5,\n description: 'Priority level (1-10, higher = more important)',\n },\n },\n required: ['type', 'text'],\n },\n },\n {\n name: 'get_hot_stack',\n description: 'Get current hot stack of active frames',\n inputSchema: {\n type: 'object',\n properties: {\n max_events: {\n type: 'number',\n default: 10,\n description: 'Maximum events per frame to include',\n },\n },\n },\n },\n ];\n }\n\n /**\n * Task management tools\n */\n private getTaskTools(): MCPToolDefinition[] {\n return [\n {\n name: 'create_task',\n description: 'Create a new task',\n inputSchema: {\n type: 'object',\n properties: {\n title: {\n type: 'string',\n description: 'Task title',\n },\n description: {\n type: 'string',\n description: 'Task description',\n },\n priority: {\n type: 'string',\n enum: ['low', 'medium', 'high', 'critical'],\n default: 'medium',\n description: 'Task priority',\n },\n tags: {\n type: 'array',\n items: { type: 'string' },\n description: 'Task tags',\n },\n parent_id: {\n type: 'string',\n description: 'Parent task ID for subtasks',\n },\n },\n required: ['title'],\n },\n },\n {\n name: 'update_task_status',\n description: 'Update task status and progress',\n inputSchema: {\n type: 'object',\n properties: {\n task_id: {\n type: 'string',\n description: 'Task ID',\n },\n status: {\n type: 'string',\n enum: ['pending', 'in-progress', 'blocked', 'completed', 'cancelled'],\n description: 'New status',\n },\n progress: {\n type: 'number',\n minimum: 0,\n maximum: 100,\n description: 'Progress percentage',\n },\n },\n required: ['task_id', 'status'],\n },\n },\n {\n name: 'get_active_tasks',\n description: 'Get active tasks with optional filtering',\n inputSchema: {\n type: 'object',\n properties: {\n status: {\n type: 'string',\n enum: ['pending', 'in-progress', 'blocked', 'completed', 'cancelled'],\n description: 'Filter by status',\n },\n priority: {\n type: 'string',\n enum: ['low', 'medium', 'high', 'critical'],\n description: 'Filter by priority',\n },\n limit: {\n type: 'number',\n default: 20,\n description: 'Maximum tasks to return',\n },\n include_completed: {\n type: 'boolean',\n default: false,\n description: 'Include completed tasks',\n },\n tags: {\n type: 'array',\n items: { type: 'string' },\n description: 'Filter by tags',\n },\n search: {\n type: 'string',\n description: 'Search in title and description',\n },\n },\n },\n },\n {\n name: 'get_task_metrics',\n description: 'Get task analytics and metrics',\n inputSchema: {\n type: 'object',\n properties: {},\n },\n },\n {\n name: 'add_task_dependency',\n description: 'Add dependency between tasks',\n inputSchema: {\n type: 'object',\n properties: {\n task_id: {\n type: 'string',\n description: 'Task that depends on another',\n },\n depends_on: {\n type: 'string',\n description: 'Task that must be completed first',\n },\n dependency_type: {\n type: 'string',\n enum: ['blocks', 'related', 'subtask'],\n default: 'blocks',\n description: 'Type of dependency',\n },\n },\n required: ['task_id', 'depends_on'],\n },\n },\n ];\n }\n\n /**\n * Linear integration tools\n */\n private getLinearTools(): MCPToolDefinition[] {\n return [\n {\n name: 'linear_sync',\n description: 'Sync tasks with Linear issues',\n inputSchema: {\n type: 'object',\n properties: {\n direction: {\n type: 'string',\n enum: ['both', 'from_linear', 'to_linear'],\n default: 'both',\n description: 'Sync direction',\n },\n force: {\n type: 'boolean',\n default: false,\n description: 'Force sync even if no changes',\n },\n },\n },\n },\n {\n name: 'linear_update_task',\n description: 'Update Linear issue directly',\n inputSchema: {\n type: 'object',\n properties: {\n linear_id: {\n type: 'string',\n description: 'Linear issue ID',\n },\n status: {\n type: 'string',\n description: 'New status',\n },\n assignee_id: {\n type: 'string',\n description: 'Assignee user ID',\n },\n priority: {\n type: 'number',\n minimum: 0,\n maximum: 4,\n description: 'Priority (0=None, 1=Low, 2=Medium, 3=High, 4=Urgent)',\n },\n labels: {\n type: 'array',\n items: { type: 'string' },\n description: 'Label names to add',\n },\n },\n required: ['linear_id'],\n },\n },\n {\n name: 'linear_get_tasks',\n description: 'Get issues from Linear',\n inputSchema: {\n type: 'object',\n properties: {\n team_id: {\n type: 'string',\n description: 'Filter by team ID',\n },\n assignee_id: {\n type: 'string',\n description: 'Filter by assignee ID',\n },\n state: {\n type: 'string',\n enum: ['active', 'closed', 'all'],\n default: 'active',\n description: 'Issue state filter',\n },\n limit: {\n type: 'number',\n default: 20,\n description: 'Maximum issues to return',\n },\n search: {\n type: 'string',\n description: 'Search query',\n },\n },\n },\n },\n {\n name: 'linear_status',\n description: 'Get Linear integration status',\n inputSchema: {\n type: 'object',\n properties: {},\n },\n },\n ];\n }\n\n /**\n * Trace and debugging tools\n */\n private getTraceTools(): MCPToolDefinition[] {\n return [\n {\n name: 'get_traces',\n description: 'Get execution traces with optional filtering',\n inputSchema: {\n type: 'object',\n properties: {\n limit: {\n type: 'number',\n default: 20,\n description: 'Maximum traces to return',\n },\n pattern: {\n type: 'string',\n description: 'Filter by pattern name',\n },\n start_time: {\n type: 'string',\n format: 'date-time',\n description: 'Filter by start time',\n },\n end_time: {\n type: 'string',\n format: 'date-time',\n description: 'Filter by end time',\n },\n include_context: {\n type: 'boolean',\n default: false,\n description: 'Include full trace context',\n },\n },\n },\n },\n {\n name: 'analyze_traces',\n description: 'Analyze trace patterns for insights',\n inputSchema: {\n type: 'object',\n properties: {\n trace_id: {\n type: 'string',\n description: 'Specific trace to analyze',\n },\n analysis_type: {\n type: 'string',\n enum: ['performance', 'patterns', 'errors'],\n default: 'performance',\n description: 'Type of analysis to perform',\n },\n include_recommendations: {\n type: 'boolean',\n default: true,\n description: 'Include optimization recommendations',\n },\n },\n },\n },\n {\n name: 'start_browser_debug',\n description: 'Start browser debugging session',\n inputSchema: {\n type: 'object',\n properties: {\n url: {\n type: 'string',\n description: 'URL to navigate to',\n },\n headless: {\n type: 'boolean',\n default: false,\n description: 'Run browser in headless mode',\n },\n width: {\n type: 'number',\n default: 1280,\n description: 'Browser width',\n },\n height: {\n type: 'number',\n default: 720,\n description: 'Browser height',\n },\n capture_screenshots: {\n type: 'boolean',\n default: true,\n description: 'Enable screenshot capture',\n },\n },\n required: ['url'],\n },\n },\n {\n name: 'take_screenshot',\n description: 'Take screenshot in browser session',\n inputSchema: {\n type: 'object',\n properties: {\n session_id: {\n type: 'string',\n description: 'Browser session ID',\n },\n selector: {\n type: 'string',\n description: 'CSS selector to screenshot',\n },\n full_page: {\n type: 'boolean',\n default: false,\n description: 'Capture full page',\n },\n },\n required: ['session_id'],\n },\n },\n {\n name: 'execute_script',\n description: 'Execute JavaScript in browser session',\n inputSchema: {\n type: 'object',\n properties: {\n session_id: {\n type: 'string',\n description: 'Browser session ID',\n },\n script: {\n type: 'string',\n description: 'JavaScript code to execute',\n },\n args: {\n type: 'array',\n description: 'Arguments to pass to script',\n },\n },\n required: ['session_id', 'script'],\n },\n },\n {\n name: 'stop_browser_debug',\n description: 'Stop browser debugging session',\n inputSchema: {\n type: 'object',\n properties: {\n session_id: {\n type: 'string',\n description: 'Browser session ID to stop',\n },\n },\n required: ['session_id'],\n },\n },\n ];\n }\n\n /**\n * Get tool definition by name\n */\n getToolDefinition(name: string): MCPToolDefinition | undefined {\n return this.getAllToolDefinitions().find((tool: any) => tool.name === name);\n }\n\n /**\n * Get tool names by category\n */\n getToolsByCategory(category: 'context' | 'task' | 'linear' | 'trace'): MCPToolDefinition[] {\n switch (category) {\n case 'context':\n return this.getContextTools();\n case 'task':\n return this.getTaskTools();\n case 'linear':\n return this.getLinearTools();\n case 'trace':\n return this.getTraceTools();\n default:\n return [];\n }\n }\n}"],
5
- "mappings": ";;;;AAeO,MAAM,mBAAmB;AAAA;AAAA;AAAA;AAAA,EAI9B,wBAA6C;AAC3C,WAAO;AAAA,MACL,GAAG,KAAK,gBAAgB;AAAA,MACxB,GAAG,KAAK,aAAa;AAAA,MACrB,GAAG,KAAK,eAAe;AAAA,MACvB,GAAG,KAAK,cAAc;AAAA,IACxB;AAAA,EACF;AAAA;AAAA;AAAA;AAAA,EAKQ,kBAAuC;AAC7C,WAAO;AAAA,MACL;AAAA,QACE,MAAM;AAAA,QACN,aAAa;AAAA,QACb,aAAa;AAAA,UACX,MAAM;AAAA,UACN,YAAY;AAAA,YACV,OAAO;AAAA,cACL,MAAM;AAAA,cACN,aAAa;AAAA,YACf;AAAA,YACA,OAAO;AAAA,cACL,MAAM;AAAA,cACN,aAAa;AAAA,cACb,SAAS;AAAA,YACX;AAAA,UACF;AAAA,QACF;AAAA,MACF;AAAA,MACA;AAAA,QACE,MAAM;AAAA,QACN,aAAa;AAAA,QACb,aAAa;AAAA,UACX,MAAM;AAAA,UACN,YAAY;AAAA,YACV,SAAS;AAAA,cACP,MAAM;AAAA,cACN,aAAa;AAAA,YACf;AAAA,YACA,MAAM;AAAA,cACJ,MAAM;AAAA,cACN,MAAM,CAAC,YAAY,cAAc,UAAU;AAAA,cAC3C,aAAa;AAAA,YACf;AAAA,UACF;AAAA,UACA,UAAU,CAAC,WAAW,MAAM;AAAA,QAC9B;AAAA,MACF;AAAA,MACA;AAAA,QACE,MAAM;AAAA,QACN,aAAa;AAAA,QACb,aAAa;AAAA,UACX,MAAM;AAAA,UACN,YAAY;AAAA,YACV,MAAM;AAAA,cACJ,MAAM;AAAA,cACN,aAAa;AAAA,YACf;AAAA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;AAAA,QACN,aAAa;AAAA,QACb,aAAa;AAAA,UACX,MAAM;AAAA,UACN,YAAY;AAAA,YACV,YAAY;AAAA,cACV,MAAM;AAAA,cACN,aAAa;AAAA,YACf;AAAA,UACF;AAAA,UACA,UAAU,CAAC,YAAY;AAAA,QACzB;AAAA,MACF;AAAA,IACF;AAAA,EACF;AAAA;AAAA;AAAA;AAAA,EAKA,kBAAkB,MAA6C;AAC7D,WAAO,KAAK,sBAAsB,EAAE,KAAK,CAAC,SAAc,KAAK,SAAS,IAAI;AAAA,EAC5E;AAAA;AAAA;AAAA;AAAA,EAKA,mBAAmB,UAAwE;AACzF,YAAQ,UAAU;AAAA,MAChB,KAAK;AACH,eAAO,KAAK,gBAAgB;AAAA,MAC9B,KAAK;AACH,eAAO,KAAK,aAAa;AAAA,MAC3B,KAAK;AACH,eAAO,KAAK,eAAe;AAAA,MAC7B,KAAK;AACH,eAAO,KAAK,cAAc;AAAA,MAC5B;AACE,eAAO,CAAC;AAAA,IACZ;AAAA,EACF;AACF;",
4
+ "sourcesContent": ["/**\n * MCP Tool Definitions\n * Centralized tool schema definitions for the MCP server\n */\n\nexport interface MCPToolDefinition {\n name: string;\n description: string;\n inputSchema: {\n type: 'object';\n properties: Record<string, any>;\n required?: string[];\n };\n}\n\nexport class MCPToolDefinitions {\n /**\n * Get all tool definitions\n */\n getAllToolDefinitions(): MCPToolDefinition[] {\n return [\n ...this.getContextTools(),\n ...this.getTaskTools(),\n ...this.getLinearTools(),\n ...this.getTraceTools(),\n ...this.getDiscoveryTools(),\n ];\n }\n\n /**\n * Context management tools\n */\n private getContextTools(): MCPToolDefinition[] {\n return [\n {\n name: 'get_context',\n description: 'Get current project context and active frame information',\n inputSchema: {\n type: 'object',\n properties: {\n query: {\n type: 'string',\n description: 'What you want to know about the current context',\n },\n limit: {\n type: 'number',\n description: 'Max number of contexts to return',\n default: 5,\n },\n },\n },\n },\n {\n name: 'add_decision',\n description: 'Record a decision, constraint, or important information',\n inputSchema: {\n type: 'object',\n properties: {\n content: {\n type: 'string',\n description: 'The decision or information to record',\n },\n type: {\n type: 'string',\n enum: ['decision', 'constraint', 'learning'],\n description: 'Type of information being recorded',\n },\n },\n required: ['content', 'type'],\n },\n },\n {\n name: 'start_frame',\n description: 'Start a new frame (task/subtask) on the call stack',\n inputSchema: {\n type: 'object',\n properties: {\n name: {\n type: 'string',\n description: 'Frame name/goal',\n },\n type: {\n type: 'string',\n enum: [\n 'task',\n 'subtask',\n 'tool_scope',\n 'review',\n 'write',\n 'debug',\n ],\n default: 'task',\n description: 'Type of frame',\n },\n constraints: {\n type: 'array',\n items: { type: 'string' },\n description: 'List of constraints for this frame',\n },\n definitions: {\n type: 'object',\n description: 'Key definitions and context',\n },\n },\n required: ['name'],\n },\n },\n {\n name: 'close_frame',\n description: 'Close current or specified frame with optional summary',\n inputSchema: {\n type: 'object',\n properties: {\n frameId: {\n type: 'string',\n description: 'Frame ID to close (defaults to current)',\n },\n summary: {\n type: 'string',\n description: 'Summary of what was accomplished',\n },\n },\n },\n },\n {\n name: 'add_anchor',\n description:\n 'Add an important fact or decision anchor to current frame',\n inputSchema: {\n type: 'object',\n properties: {\n type: {\n type: 'string',\n enum: [\n 'FACT',\n 'DECISION',\n 'CONSTRAINT',\n 'INTERFACE_CONTRACT',\n 'TODO',\n 'RISK',\n ],\n description: 'Type of anchor',\n },\n text: {\n type: 'string',\n description: 'The anchor content',\n },\n priority: {\n type: 'number',\n minimum: 1,\n maximum: 10,\n default: 5,\n description: 'Priority level (1-10, higher = more important)',\n },\n },\n required: ['type', 'text'],\n },\n },\n {\n name: 'get_hot_stack',\n description: 'Get current hot stack of active frames',\n inputSchema: {\n type: 'object',\n properties: {\n max_events: {\n type: 'number',\n default: 10,\n description: 'Maximum events per frame to include',\n },\n },\n },\n },\n ];\n }\n\n /**\n * Task management tools\n */\n private getTaskTools(): MCPToolDefinition[] {\n return [\n {\n name: 'create_task',\n description: 'Create a new task',\n inputSchema: {\n type: 'object',\n properties: {\n title: {\n type: 'string',\n description: 'Task title',\n },\n description: {\n type: 'string',\n description: 'Task description',\n },\n priority: {\n type: 'string',\n enum: ['low', 'medium', 'high', 'critical'],\n default: 'medium',\n description: 'Task priority',\n },\n tags: {\n type: 'array',\n items: { type: 'string' },\n description: 'Task tags',\n },\n parent_id: {\n type: 'string',\n description: 'Parent task ID for subtasks',\n },\n },\n required: ['title'],\n },\n },\n {\n name: 'update_task_status',\n description: 'Update task status and progress',\n inputSchema: {\n type: 'object',\n properties: {\n task_id: {\n type: 'string',\n description: 'Task ID',\n },\n status: {\n type: 'string',\n enum: [\n 'pending',\n 'in-progress',\n 'blocked',\n 'completed',\n 'cancelled',\n ],\n description: 'New status',\n },\n progress: {\n type: 'number',\n minimum: 0,\n maximum: 100,\n description: 'Progress percentage',\n },\n },\n required: ['task_id', 'status'],\n },\n },\n {\n name: 'get_active_tasks',\n description: 'Get active tasks with optional filtering',\n inputSchema: {\n type: 'object',\n properties: {\n status: {\n type: 'string',\n enum: [\n 'pending',\n 'in-progress',\n 'blocked',\n 'completed',\n 'cancelled',\n ],\n description: 'Filter by status',\n },\n priority: {\n type: 'string',\n enum: ['low', 'medium', 'high', 'critical'],\n description: 'Filter by priority',\n },\n limit: {\n type: 'number',\n default: 20,\n description: 'Maximum tasks to return',\n },\n include_completed: {\n type: 'boolean',\n default: false,\n description: 'Include completed tasks',\n },\n tags: {\n type: 'array',\n items: { type: 'string' },\n description: 'Filter by tags',\n },\n search: {\n type: 'string',\n description: 'Search in title and description',\n },\n },\n },\n },\n {\n name: 'get_task_metrics',\n description: 'Get task analytics and metrics',\n inputSchema: {\n type: 'object',\n properties: {},\n },\n },\n {\n name: 'add_task_dependency',\n description: 'Add dependency between tasks',\n inputSchema: {\n type: 'object',\n properties: {\n task_id: {\n type: 'string',\n description: 'Task that depends on another',\n },\n depends_on: {\n type: 'string',\n description: 'Task that must be completed first',\n },\n dependency_type: {\n type: 'string',\n enum: ['blocks', 'related', 'subtask'],\n default: 'blocks',\n description: 'Type of dependency',\n },\n },\n required: ['task_id', 'depends_on'],\n },\n },\n ];\n }\n\n /**\n * Linear integration tools\n */\n private getLinearTools(): MCPToolDefinition[] {\n return [\n {\n name: 'linear_sync',\n description: 'Sync tasks with Linear issues',\n inputSchema: {\n type: 'object',\n properties: {\n direction: {\n type: 'string',\n enum: ['both', 'from_linear', 'to_linear'],\n default: 'both',\n description: 'Sync direction',\n },\n force: {\n type: 'boolean',\n default: false,\n description: 'Force sync even if no changes',\n },\n },\n },\n },\n {\n name: 'linear_update_task',\n description: 'Update Linear issue directly',\n inputSchema: {\n type: 'object',\n properties: {\n linear_id: {\n type: 'string',\n description: 'Linear issue ID',\n },\n status: {\n type: 'string',\n description: 'New status',\n },\n assignee_id: {\n type: 'string',\n description: 'Assignee user ID',\n },\n priority: {\n type: 'number',\n minimum: 0,\n maximum: 4,\n description:\n 'Priority (0=None, 1=Low, 2=Medium, 3=High, 4=Urgent)',\n },\n labels: {\n type: 'array',\n items: { type: 'string' },\n description: 'Label names to add',\n },\n },\n required: ['linear_id'],\n },\n },\n {\n name: 'linear_get_tasks',\n description: 'Get issues from Linear',\n inputSchema: {\n type: 'object',\n properties: {\n team_id: {\n type: 'string',\n description: 'Filter by team ID',\n },\n assignee_id: {\n type: 'string',\n description: 'Filter by assignee ID',\n },\n state: {\n type: 'string',\n enum: ['active', 'closed', 'all'],\n default: 'active',\n description: 'Issue state filter',\n },\n limit: {\n type: 'number',\n default: 20,\n description: 'Maximum issues to return',\n },\n search: {\n type: 'string',\n description: 'Search query',\n },\n },\n },\n },\n {\n name: 'linear_status',\n description: 'Get Linear integration status',\n inputSchema: {\n type: 'object',\n properties: {},\n },\n },\n ];\n }\n\n /**\n * Trace and debugging tools\n */\n private getTraceTools(): MCPToolDefinition[] {\n return [\n {\n name: 'get_traces',\n description: 'Get execution traces with optional filtering',\n inputSchema: {\n type: 'object',\n properties: {\n limit: {\n type: 'number',\n default: 20,\n description: 'Maximum traces to return',\n },\n pattern: {\n type: 'string',\n description: 'Filter by pattern name',\n },\n start_time: {\n type: 'string',\n format: 'date-time',\n description: 'Filter by start time',\n },\n end_time: {\n type: 'string',\n format: 'date-time',\n description: 'Filter by end time',\n },\n include_context: {\n type: 'boolean',\n default: false,\n description: 'Include full trace context',\n },\n },\n },\n },\n {\n name: 'analyze_traces',\n description: 'Analyze trace patterns for insights',\n inputSchema: {\n type: 'object',\n properties: {\n trace_id: {\n type: 'string',\n description: 'Specific trace to analyze',\n },\n analysis_type: {\n type: 'string',\n enum: ['performance', 'patterns', 'errors'],\n default: 'performance',\n description: 'Type of analysis to perform',\n },\n include_recommendations: {\n type: 'boolean',\n default: true,\n description: 'Include optimization recommendations',\n },\n },\n },\n },\n {\n name: 'start_browser_debug',\n description: 'Start browser debugging session',\n inputSchema: {\n type: 'object',\n properties: {\n url: {\n type: 'string',\n description: 'URL to navigate to',\n },\n headless: {\n type: 'boolean',\n default: false,\n description: 'Run browser in headless mode',\n },\n width: {\n type: 'number',\n default: 1280,\n description: 'Browser width',\n },\n height: {\n type: 'number',\n default: 720,\n description: 'Browser height',\n },\n capture_screenshots: {\n type: 'boolean',\n default: true,\n description: 'Enable screenshot capture',\n },\n },\n required: ['url'],\n },\n },\n {\n name: 'take_screenshot',\n description: 'Take screenshot in browser session',\n inputSchema: {\n type: 'object',\n properties: {\n session_id: {\n type: 'string',\n description: 'Browser session ID',\n },\n selector: {\n type: 'string',\n description: 'CSS selector to screenshot',\n },\n full_page: {\n type: 'boolean',\n default: false,\n description: 'Capture full page',\n },\n },\n required: ['session_id'],\n },\n },\n {\n name: 'execute_script',\n description: 'Execute JavaScript in browser session',\n inputSchema: {\n type: 'object',\n properties: {\n session_id: {\n type: 'string',\n description: 'Browser session ID',\n },\n script: {\n type: 'string',\n description: 'JavaScript code to execute',\n },\n args: {\n type: 'array',\n description: 'Arguments to pass to script',\n },\n },\n required: ['session_id', 'script'],\n },\n },\n {\n name: 'stop_browser_debug',\n description: 'Stop browser debugging session',\n inputSchema: {\n type: 'object',\n properties: {\n session_id: {\n type: 'string',\n description: 'Browser session ID to stop',\n },\n },\n required: ['session_id'],\n },\n },\n ];\n }\n\n /**\n * Discovery and exploration tools\n */\n private getDiscoveryTools(): MCPToolDefinition[] {\n return [\n {\n name: 'sm_discover',\n description:\n 'Discover relevant files based on current context. Extracts keywords from active frames and searches codebase for related files.',\n inputSchema: {\n type: 'object',\n properties: {\n query: {\n type: 'string',\n description: 'Optional query to focus the discovery',\n },\n depth: {\n type: 'string',\n enum: ['shallow', 'medium', 'deep'],\n default: 'medium',\n description:\n 'Search depth - shallow for quick results, deep for thorough exploration',\n },\n includePatterns: {\n type: 'array',\n items: { type: 'string' },\n description: 'File patterns to include (e.g., [\"*.ts\", \"*.md\"])',\n },\n excludePatterns: {\n type: 'array',\n items: { type: 'string' },\n description:\n 'Patterns to exclude (e.g., [\"node_modules\", \"dist\"])',\n },\n maxFiles: {\n type: 'number',\n default: 20,\n description: 'Maximum files to return',\n },\n },\n },\n },\n {\n name: 'sm_related_files',\n description:\n 'Find files related to a specific file or concept. Useful for understanding dependencies and connections.',\n inputSchema: {\n type: 'object',\n properties: {\n file: {\n type: 'string',\n description: 'File path to find related files for',\n },\n concept: {\n type: 'string',\n description: 'Concept or term to find related files for',\n },\n maxFiles: {\n type: 'number',\n default: 10,\n description: 'Maximum files to return',\n },\n },\n },\n },\n {\n name: 'sm_session_summary',\n description:\n 'Get a summary of the current session including active tasks, recent files, and decisions made.',\n inputSchema: {\n type: 'object',\n properties: {\n includeFiles: {\n type: 'boolean',\n default: true,\n description: 'Include list of recently accessed files',\n },\n includeDecisions: {\n type: 'boolean',\n default: true,\n description: 'Include recent decisions and constraints',\n },\n },\n },\n },\n {\n name: 'sm_search',\n description:\n 'Search across StackMemory context - frames, events, decisions, and tasks.',\n inputSchema: {\n type: 'object',\n properties: {\n query: {\n type: 'string',\n description: 'Search query',\n },\n scope: {\n type: 'string',\n enum: ['all', 'frames', 'events', 'decisions', 'tasks'],\n default: 'all',\n description: 'Scope of search',\n },\n limit: {\n type: 'number',\n default: 20,\n description: 'Maximum results to return',\n },\n },\n required: ['query'],\n },\n },\n ];\n }\n\n /**\n * Get tool definition by name\n */\n getToolDefinition(name: string): MCPToolDefinition | undefined {\n return this.getAllToolDefinitions().find((tool: any) => tool.name === name);\n }\n\n /**\n * Get tool names by category\n */\n getToolsByCategory(\n category: 'context' | 'task' | 'linear' | 'trace' | 'discovery'\n ): MCPToolDefinition[] {\n switch (category) {\n case 'context':\n return this.getContextTools();\n case 'task':\n return this.getTaskTools();\n case 'linear':\n return this.getLinearTools();\n case 'trace':\n return this.getTraceTools();\n case 'discovery':\n return this.getDiscoveryTools();\n default:\n return [];\n }\n }\n}\n"],
5
+ "mappings": ";;;;AAeO,MAAM,mBAAmB;AAAA;AAAA;AAAA;AAAA,EAI9B,wBAA6C;AAC3C,WAAO;AAAA,MACL,GAAG,KAAK,gBAAgB;AAAA,MACxB,GAAG,KAAK,aAAa;AAAA,MACrB,GAAG,KAAK,eAAe;AAAA,MACvB,GAAG,KAAK,cAAc;AAAA,MACtB,GAAG,KAAK,kBAAkB;AAAA,IAC5B;AAAA,EACF;AAAA;AAAA;AAAA;AAAA,EAKQ,kBAAuC;AAC7C,WAAO;AAAA,MACL;AAAA,QACE,MAAM;AAAA,QACN,aAAa;AAAA,QACb,aAAa;AAAA,UACX,MAAM;AAAA,UACN,YAAY;AAAA,YACV,OAAO;AAAA,cACL,MAAM;AAAA,cACN,aAAa;AAAA,YACf;AAAA,YACA,OAAO;AAAA,cACL,MAAM;AAAA,cACN,aAAa;AAAA,cACb,SAAS;AAAA,YACX;AAAA,UACF;AAAA,QACF;AAAA,MACF;AAAA,MACA;AAAA,QACE,MAAM;AAAA,QACN,aAAa;AAAA,QACb,aAAa;AAAA,UACX,MAAM;AAAA,UACN,YAAY;AAAA,YACV,SAAS;AAAA,cACP,MAAM;AAAA,cACN,aAAa;AAAA,YACf;AAAA,YACA,MAAM;AAAA,cACJ,MAAM;AAAA,cACN,MAAM,C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AAA,EAC5E;AAAA;AAAA;AAAA;AAAA,EAKA,mBACE,UACqB;AACrB,YAAQ,UAAU;AAAA,MAChB,KAAK;AACH,eAAO,KAAK,gBAAgB;AAAA,MAC9B,KAAK;AACH,eAAO,KAAK,aAAa;AAAA,MAC3B,KAAK;AACH,eAAO,KAAK,eAAe;AAAA,MAC7B,KAAK;AACH,eAAO,KAAK,cAAc;AAAA,MAC5B,KAAK;AACH,eAAO,KAAK,kBAAkB;AAAA,MAChC;AACE,eAAO,CAAC;AAAA,IACZ;AAAA,EACF;AACF;",
6
6
  "names": []
7
7
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stackmemoryai/stackmemory",
3
- "version": "0.5.23",
3
+ "version": "0.5.24",
4
4
  "description": "Lossless memory runtime for AI coding tools - organizes context as a call stack instead of linear chat logs, with team collaboration and infinite retention",
5
5
  "engines": {
6
6
  "node": ">=20.0.0",
@@ -1,286 +0,0 @@
1
- import { Command } from "commander";
2
- import Database from "better-sqlite3";
3
- import { join } from "path";
4
- import { existsSync } from "fs";
5
- import chalk from "chalk";
6
- import ora from "ora";
7
- import { LinearTaskManager } from "../../features/tasks/linear-task-manager.js";
8
- import { FrameManager } from "../../core/context/frame-manager.js";
9
- import {
10
- AgentTaskManager
11
- } from "../../agents/core/agent-task-manager.js";
12
- function createAgentCommand() {
13
- const agent = new Command("agent").description("AI agent task execution with Spotify-inspired strategies").option("-p, --project <path>", "Project root directory", process.cwd());
14
- agent.command("execute <taskId>").description("Execute a task with agent assistance").option("-f, --frame <frameId>", "Frame ID to use").option("--max-turns <number>", "Maximum turns per session", "10").option("--no-verify", "Skip verification loops").action(async (taskId, options) => {
15
- const spinner = ora("Initializing agent...").start();
16
- try {
17
- const { taskManager, session } = await initializeAgent(
18
- options.project,
19
- taskId,
20
- options.frame,
21
- parseInt(options.maxTurns)
22
- );
23
- spinner.succeed("Agent initialized");
24
- console.log(chalk.cyan("\n\u{1F4CB} Task Session Started"));
25
- console.log(chalk.gray(" Session ID:"), session.id);
26
- console.log(chalk.gray(" Task ID:"), session.taskId);
27
- console.log(chalk.gray(" Max Turns:"), session.maxTurns);
28
- console.log(
29
- chalk.gray(" Verification:"),
30
- options.verify ? "Enabled" : "Disabled"
31
- );
32
- await executeTaskWithFeedback(taskManager, session, options.verify);
33
- } catch (error) {
34
- spinner.fail("Agent execution failed");
35
- console.error(
36
- chalk.red("Error:"),
37
- error instanceof Error ? error.message : String(error)
38
- );
39
- process.exit(1);
40
- }
41
- });
42
- agent.command("status").description("Show active agent sessions").action(async (options) => {
43
- const spinner = ora("Loading sessions...").start();
44
- try {
45
- const projectRoot = options.parent?.project || process.cwd();
46
- const { taskManager } = await initializeAgentManager(projectRoot);
47
- const sessions = taskManager.getActiveSessions();
48
- spinner.stop();
49
- if (sessions.length === 0) {
50
- console.log(chalk.yellow("No active agent sessions"));
51
- return;
52
- }
53
- console.log(chalk.cyan("\n\u{1F916} Active Agent Sessions\n"));
54
- for (const session of sessions) {
55
- console.log(chalk.bold(`Session: ${session.sessionId}`));
56
- console.log(chalk.gray(" Task:"), session.taskId);
57
- console.log(
58
- chalk.gray(" Status:"),
59
- getStatusColor(session.status)(session.status)
60
- );
61
- console.log(chalk.gray(" Turn:"), `${session.turnCount}/10`);
62
- console.log(
63
- chalk.gray(" Started:"),
64
- session.startedAt.toLocaleString()
65
- );
66
- console.log("");
67
- }
68
- } catch (error) {
69
- spinner.fail("Failed to load sessions");
70
- console.error(
71
- chalk.red("Error:"),
72
- error instanceof Error ? error.message : String(error)
73
- );
74
- process.exit(1);
75
- }
76
- });
77
- agent.command("retry <sessionId>").description("Retry a failed session with learned context").action(async (sessionId, options) => {
78
- const spinner = ora("Retrying session...").start();
79
- try {
80
- const projectRoot = options.parent?.project || process.cwd();
81
- const { taskManager } = await initializeAgentManager(projectRoot);
82
- const newSession = await taskManager.retrySession(sessionId);
83
- if (!newSession) {
84
- spinner.fail(
85
- "Cannot retry session (max retries reached or session active)"
86
- );
87
- return;
88
- }
89
- spinner.succeed("Session retry started");
90
- console.log(chalk.cyan("\n\u267B\uFE0F Retry Session Started"));
91
- console.log(chalk.gray(" New Session ID:"), newSession.id);
92
- console.log(chalk.gray(" Task ID:"), newSession.taskId);
93
- await executeTaskWithFeedback(taskManager, newSession, true);
94
- } catch (error) {
95
- spinner.fail("Retry failed");
96
- console.error(
97
- chalk.red("Error:"),
98
- error instanceof Error ? error.message : String(error)
99
- );
100
- process.exit(1);
101
- }
102
- });
103
- agent.command("breakdown <taskId>").description("Break down a complex task into subtasks").action(async (taskId, options) => {
104
- const spinner = ora("Analyzing task complexity...").start();
105
- try {
106
- const projectRoot = options.parent?.project || process.cwd();
107
- const db = await openDatabase(projectRoot);
108
- const taskStore = new LinearTaskManager(projectRoot, db);
109
- const task = taskStore.getTask(taskId);
110
- if (!task) {
111
- spinner.fail(`Task ${taskId} not found`);
112
- return;
113
- }
114
- spinner.text = "Breaking down task...";
115
- const subtasks = generateTaskBreakdown(
116
- task.title,
117
- task.description || ""
118
- );
119
- spinner.succeed("Task breakdown complete");
120
- console.log(chalk.cyan(`
121
- \u{1F4CA} Task Breakdown: ${task.title}
122
- `));
123
- subtasks.forEach((subtask, index) => {
124
- console.log(chalk.bold(`${index + 1}. ${subtask.title}`));
125
- console.log(chalk.gray(" Description:"), subtask.description);
126
- console.log(
127
- chalk.gray(" Estimated turns:"),
128
- subtask.estimatedTurns
129
- );
130
- console.log(
131
- chalk.gray(" Verifiers:"),
132
- subtask.verifiers.join(", ")
133
- );
134
- console.log("");
135
- });
136
- console.log(
137
- chalk.yellow("Total estimated turns:"),
138
- subtasks.reduce((sum, st) => sum + st.estimatedTurns, 0)
139
- );
140
- } catch (error) {
141
- spinner.fail("Breakdown failed");
142
- console.error(
143
- chalk.red("Error:"),
144
- error instanceof Error ? error.message : String(error)
145
- );
146
- process.exit(1);
147
- }
148
- });
149
- return agent;
150
- }
151
- async function initializeAgent(projectRoot, taskId, frameId, maxTurns = 10) {
152
- const { taskManager, frameManager, taskStore } = await initializeAgentManager(projectRoot);
153
- const finalFrameId = frameId || frameManager.createFrame({
154
- type: "task",
155
- name: `Agent task execution for ${taskId}`,
156
- inputs: { taskId, agentSession: true }
157
- });
158
- const session = await taskManager.startTaskSession(taskId, finalFrameId);
159
- if (maxTurns !== 10) {
160
- session.maxTurns = maxTurns;
161
- }
162
- return { taskManager, session };
163
- }
164
- async function initializeAgentManager(projectRoot) {
165
- const db = await openDatabase(projectRoot);
166
- const taskStore = new LinearTaskManager(projectRoot, db);
167
- const frameManager = new FrameManager(db, projectRoot, void 0);
168
- const taskManager = new AgentTaskManager(taskStore, frameManager);
169
- return { taskManager, frameManager, taskStore };
170
- }
171
- async function executeTaskWithFeedback(taskManager, session, enableVerification) {
172
- console.log(chalk.cyan("\n\u{1F504} Starting execution loop...\n"));
173
- let turnCount = 0;
174
- let shouldContinue = true;
175
- let lastFeedback = "";
176
- while (shouldContinue && turnCount < session.maxTurns) {
177
- turnCount++;
178
- console.log(chalk.bold(`
179
- \u2550\u2550\u2550 Turn ${turnCount}/${session.maxTurns} \u2550\u2550\u2550`));
180
- const action = generateMockAction(turnCount, lastFeedback);
181
- console.log(chalk.gray("Action:"), action.substring(0, 100) + "...");
182
- const spinner = ora("Executing...").start();
183
- const result = await taskManager.executeTurn(session.id, action, {
184
- codeChange: turnCount > 1,
185
- testsPresent: turnCount > 2,
186
- enableVerification
187
- });
188
- if (result.success) {
189
- spinner.succeed("Turn completed successfully");
190
- } else {
191
- spinner.warn("Turn completed with issues");
192
- }
193
- console.log(chalk.yellow("\n\u{1F4DD} Feedback:"));
194
- console.log(result.feedback);
195
- if (result.verificationResults.length > 0) {
196
- console.log(chalk.cyan("\n\u2713 Verification Results:"));
197
- for (const vr of result.verificationResults) {
198
- const icon = vr.passed ? "\u2713" : "\u2717";
199
- const color = vr.passed ? chalk.green : chalk.red;
200
- console.log(color(` ${icon} ${vr.verifierId}: ${vr.message}`));
201
- }
202
- }
203
- shouldContinue = result.shouldContinue;
204
- lastFeedback = result.feedback;
205
- await delay(1e3);
206
- }
207
- console.log(chalk.cyan("\n\u2550\u2550\u2550 Session Complete \u2550\u2550\u2550\n"));
208
- console.log(chalk.gray("Total turns:"), turnCount);
209
- console.log(chalk.gray("Final status:"), session.status);
210
- }
211
- function generateMockAction(turn, previousFeedback) {
212
- const actions = [
213
- "Analyzing task requirements and constraints",
214
- "Setting up project structure and dependencies",
215
- "Implementing core functionality",
216
- "Adding error handling and validation",
217
- "Writing unit tests",
218
- "Refactoring for better code organization",
219
- "Adding documentation and comments",
220
- "Running final verification checks",
221
- "Optimizing performance",
222
- "Completing final cleanup"
223
- ];
224
- if (previousFeedback.includes("error")) {
225
- return `Fixing issues: ${previousFeedback.substring(0, 50)}...`;
226
- }
227
- return actions[Math.min(turn - 1, actions.length - 1)];
228
- }
229
- function generateTaskBreakdown(title, description) {
230
- return [
231
- {
232
- title: `Analyze and plan: ${title}`,
233
- description: "Understand requirements and create implementation plan",
234
- estimatedTurns: 2,
235
- verifiers: ["semantic-validator"]
236
- },
237
- {
238
- title: `Implement core: ${title}`,
239
- description: "Build main functionality",
240
- estimatedTurns: 4,
241
- verifiers: ["formatter", "linter", "semantic-validator"]
242
- },
243
- {
244
- title: `Test and validate: ${title}`,
245
- description: "Add tests and validate implementation",
246
- estimatedTurns: 3,
247
- verifiers: ["test-runner", "semantic-validator"]
248
- },
249
- {
250
- title: `Polish and document: ${title}`,
251
- description: "Final improvements and documentation",
252
- estimatedTurns: 1,
253
- verifiers: ["formatter", "linter"]
254
- }
255
- ];
256
- }
257
- async function openDatabase(projectRoot) {
258
- const dbPath = join(projectRoot, ".stackmemory", "cache.db");
259
- if (!existsSync(join(projectRoot, ".stackmemory"))) {
260
- throw new Error(
261
- 'StackMemory not initialized. Run "stackmemory init" first.'
262
- );
263
- }
264
- return new Database(dbPath);
265
- }
266
- function getStatusColor(status) {
267
- switch (status) {
268
- case "active":
269
- return chalk.green;
270
- case "completed":
271
- return chalk.blue;
272
- case "failed":
273
- return chalk.red;
274
- case "timeout":
275
- return chalk.yellow;
276
- default:
277
- return chalk.gray;
278
- }
279
- }
280
- function delay(ms) {
281
- return new Promise((resolve) => setTimeout(resolve, ms));
282
- }
283
- export {
284
- createAgentCommand
285
- };
286
- //# sourceMappingURL=agent.js.map