mycontext-cli 0.4.8 → 0.4.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +113 -97
- package/dist/agents/communication/AgentCommunicationManager.d.ts +27 -0
- package/dist/agents/communication/AgentCommunicationManager.d.ts.map +1 -0
- package/dist/agents/communication/AgentCommunicationManager.js +293 -0
- package/dist/agents/communication/AgentCommunicationManager.js.map +1 -0
- package/dist/agents/evolution/CodeEvolutionEngine.d.ts +92 -0
- package/dist/agents/evolution/CodeEvolutionEngine.d.ts.map +1 -0
- package/dist/agents/evolution/CodeEvolutionEngine.js +639 -0
- package/dist/agents/evolution/CodeEvolutionEngine.js.map +1 -0
- package/dist/agents/implementations/ArchitectAgent.d.ts +39 -0
- package/dist/agents/implementations/ArchitectAgent.d.ts.map +1 -0
- package/dist/agents/implementations/ArchitectAgent.js +345 -0
- package/dist/agents/implementations/ArchitectAgent.js.map +1 -0
- package/dist/agents/implementations/CodeGenSubAgent.d.ts +12 -0
- package/dist/agents/implementations/CodeGenSubAgent.d.ts.map +1 -1
- package/dist/agents/implementations/CodeGenSubAgent.js +296 -43
- package/dist/agents/implementations/CodeGenSubAgent.js.map +1 -1
- package/dist/agents/implementations/PromptConstructorAgent.d.ts +50 -0
- package/dist/agents/implementations/PromptConstructorAgent.d.ts.map +1 -0
- package/dist/agents/implementations/PromptConstructorAgent.js +481 -0
- package/dist/agents/implementations/PromptConstructorAgent.js.map +1 -0
- package/dist/agents/implementations/SecurityAgent.d.ts +31 -0
- package/dist/agents/implementations/SecurityAgent.d.ts.map +1 -0
- package/dist/agents/implementations/SecurityAgent.js +453 -0
- package/dist/agents/implementations/SecurityAgent.js.map +1 -0
- package/dist/agents/intelligence/ProjectIntelligence.d.ts +127 -0
- package/dist/agents/intelligence/ProjectIntelligence.d.ts.map +1 -0
- package/dist/agents/intelligence/ProjectIntelligence.js +456 -0
- package/dist/agents/intelligence/ProjectIntelligence.js.map +1 -0
- package/dist/agents/interfaces/AgentCommunication.d.ts +65 -0
- package/dist/agents/interfaces/AgentCommunication.d.ts.map +1 -0
- package/dist/agents/interfaces/AgentCommunication.js +13 -0
- package/dist/agents/interfaces/AgentCommunication.js.map +1 -0
- package/dist/agents/learning/CrossProjectLearning.d.ts +99 -0
- package/dist/agents/learning/CrossProjectLearning.d.ts.map +1 -0
- package/dist/agents/learning/CrossProjectLearning.js +517 -0
- package/dist/agents/learning/CrossProjectLearning.js.map +1 -0
- package/dist/cli.js +47 -0
- package/dist/cli.js.map +1 -1
- package/dist/commands/agent-flow.d.ts +21 -0
- package/dist/commands/agent-flow.d.ts.map +1 -0
- package/dist/commands/agent-flow.js +225 -0
- package/dist/commands/agent-flow.js.map +1 -0
- package/dist/commands/generate-components.d.ts +0 -13
- package/dist/commands/generate-components.d.ts.map +1 -1
- package/dist/commands/generate-components.js +23 -385
- package/dist/commands/generate-components.js.map +1 -1
- package/dist/commands/generate.d.ts +4 -1
- package/dist/commands/generate.d.ts.map +1 -1
- package/dist/commands/generate.js +173 -1
- package/dist/commands/generate.js.map +1 -1
- package/dist/commands/predict.d.ts +36 -0
- package/dist/commands/predict.d.ts.map +1 -0
- package/dist/commands/predict.js +539 -0
- package/dist/commands/predict.js.map +1 -0
- package/dist/utils/clean.d.ts +6 -0
- package/dist/utils/clean.d.ts.map +1 -0
- package/dist/utils/clean.js +220 -0
- package/dist/utils/clean.js.map +1 -0
- package/dist/utils/githubModelsClient.d.ts.map +1 -1
- package/dist/utils/githubModelsClient.js +11 -12
- package/dist/utils/githubModelsClient.js.map +1 -1
- package/dist/utils/hybridAIClient.d.ts +1 -0
- package/dist/utils/hybridAIClient.d.ts.map +1 -1
- package/dist/utils/hybridAIClient.js +23 -9
- package/dist/utils/hybridAIClient.js.map +1 -1
- package/dist/utils/ollamaClient.d.ts.map +1 -1
- package/dist/utils/ollamaClient.js +6 -4
- package/dist/utils/ollamaClient.js.map +1 -1
- package/package.json +2 -1
package/README.md
CHANGED
|
@@ -1,139 +1,130 @@
|
|
|
1
1
|
# mycontext CLI
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
**🧠 The AI That Actually Understands Your Project**
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
AI-powered tool that generates production-ready React components by deeply understanding your project context.
|
|
6
6
|
|
|
7
7
|
## 🚀 Quick Start
|
|
8
8
|
|
|
9
|
-
### Install
|
|
10
|
-
|
|
11
9
|
```bash
|
|
10
|
+
# Install CLI
|
|
12
11
|
npm install -g mycontext-cli
|
|
13
|
-
# or
|
|
14
|
-
pnpm add -g mycontext-cli
|
|
15
|
-
```
|
|
16
12
|
|
|
17
|
-
|
|
13
|
+
# Initialize project
|
|
14
|
+
mycontext init my-app --description "Your project description"
|
|
15
|
+
cd my-app
|
|
18
16
|
|
|
19
|
-
|
|
20
|
-
mycontext
|
|
21
|
-
|
|
22
|
-
mycontext
|
|
17
|
+
# Generate context and components
|
|
18
|
+
mycontext generate context
|
|
19
|
+
mycontext generate types
|
|
20
|
+
mycontext generate brand
|
|
21
|
+
mycontext generate components-list
|
|
22
|
+
mycontext generate-components all --local --with-tests
|
|
23
23
|
```
|
|
24
24
|
|
|
25
|
-
##
|
|
25
|
+
## Core Workflow
|
|
26
26
|
|
|
27
|
-
###
|
|
27
|
+
### 1. Context Generation
|
|
28
28
|
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
29
|
+
```bash
|
|
30
|
+
mycontext generate context # PRD, user stories, technical specs
|
|
31
|
+
mycontext generate types # TypeScript interfaces
|
|
32
|
+
mycontext generate brand # Design system and branding
|
|
33
|
+
mycontext generate components-list # Component planning
|
|
34
|
+
```
|
|
34
35
|
|
|
35
|
-
###
|
|
36
|
+
### 2. Component Generation
|
|
36
37
|
|
|
37
|
-
|
|
38
|
-
-
|
|
39
|
-
-
|
|
40
|
-
|
|
41
|
-
- **Component Enhancement** - Advanced enhancement workflows
|
|
38
|
+
```bash
|
|
39
|
+
mycontext generate-components all --local --with-tests # Generate all components
|
|
40
|
+
mycontext generate-components <group> --local # Generate specific group
|
|
41
|
+
```
|
|
42
42
|
|
|
43
|
-
###
|
|
43
|
+
### 3. Preview & Iterate
|
|
44
44
|
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
45
|
+
```bash
|
|
46
|
+
mycontext preview components # Preview generated components
|
|
47
|
+
mycontext list components --local # List generated components
|
|
48
|
+
```
|
|
49
49
|
|
|
50
|
-
|
|
50
|
+
## Advanced Commands
|
|
51
51
|
|
|
52
52
|
```bash
|
|
53
|
-
#
|
|
54
|
-
mycontext
|
|
55
|
-
|
|
53
|
+
# AI predictions and insights
|
|
54
|
+
mycontext predict next # Next development steps
|
|
55
|
+
mycontext predict dependencies # Package suggestions
|
|
56
|
+
mycontext predict patterns # Architecture patterns
|
|
57
|
+
mycontext predict issues # Potential problems
|
|
58
|
+
|
|
59
|
+
# Component management
|
|
60
|
+
mycontext enhance <component> --prompt "improvements"
|
|
61
|
+
mycontext refine <component> --prompt "changes"
|
|
62
|
+
mycontext status --detailed # Project analysis
|
|
63
|
+
|
|
64
|
+
# Model management
|
|
65
|
+
mycontext model list # Available models
|
|
66
|
+
mycontext model test # Test generation
|
|
67
|
+
```
|
|
56
68
|
|
|
57
|
-
|
|
58
|
-
echo 'MYCONTEXT_GITHUB_TOKEN=ghp_xxx' > .mycontext/.env
|
|
69
|
+
## 📦 What You Get
|
|
59
70
|
|
|
60
|
-
|
|
61
|
-
mycontext
|
|
62
|
-
mycontext
|
|
63
|
-
mycontext
|
|
64
|
-
mycontext
|
|
71
|
+
- **`.mycontext/prd.md`** — Product Requirements Document
|
|
72
|
+
- **`.mycontext/types.ts`** — TypeScript type definitions
|
|
73
|
+
- **`.mycontext/branding.md`** — Design system specifications
|
|
74
|
+
- **`.mycontext/component-list.json`** — Component architecture plan
|
|
75
|
+
- **`components/.mycontext/`** — Generated React components with shadcn/ui
|
|
65
76
|
|
|
66
|
-
|
|
67
|
-
|
|
77
|
+
## Environment Setup
|
|
78
|
+
|
|
79
|
+
### Optional: GitHub Models (Faster Generation)
|
|
68
80
|
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
mycontext list components --local
|
|
81
|
+
```bash
|
|
82
|
+
echo 'MYCONTEXT_GITHUB_TOKEN=ghp_xxx' > .mycontext/.env
|
|
72
83
|
```
|
|
73
84
|
|
|
74
|
-
###
|
|
85
|
+
### Local AI Setup (Unlimited Generation)
|
|
75
86
|
|
|
76
87
|
```bash
|
|
77
|
-
#
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
mycontext core ready
|
|
88
|
+
# Install Ollama (one-time setup)
|
|
89
|
+
curl -fsSL https://ollama.ai/install.sh | sh
|
|
90
|
+
ollama pull llama3.2:3b
|
|
81
91
|
|
|
82
|
-
#
|
|
83
|
-
mycontext
|
|
84
|
-
|
|
85
|
-
# AI-powered enhancement
|
|
86
|
-
mycontext enhance Button.tsx --prompt "Add loading states"
|
|
87
|
-
mycontext refine Card.tsx --interactive
|
|
92
|
+
# Verify setup
|
|
93
|
+
mycontext model status
|
|
88
94
|
```
|
|
89
95
|
|
|
90
|
-
##
|
|
91
|
-
|
|
92
|
-
- `.mycontext/prd.md` — PRD
|
|
93
|
-
- `.mycontext/types.ts` — TypeScript types
|
|
94
|
-
- `.mycontext/branding.md` — Brand guidelines
|
|
95
|
-
- `.mycontext/component-list.json` — Component plan (merged by name when re-generated)
|
|
96
|
-
- `components/.mycontext/` — Generated components (safe default to avoid overriding user code)
|
|
97
|
-
- Group directories: kebab-case (e.g., `user-interface/`)
|
|
98
|
-
- Component files: PascalCase (e.g., `GameBoard.tsx`)
|
|
96
|
+
## Key Features
|
|
99
97
|
|
|
100
|
-
|
|
98
|
+
- **Context-Aware Generation**: Components that match your existing codebase patterns
|
|
99
|
+
- **Brand Consistency**: Automatic adherence to your design system
|
|
100
|
+
- **Type Safety**: Full TypeScript integration with generated interfaces
|
|
101
|
+
- **Production Ready**: Includes tests, documentation, and best practices
|
|
102
|
+
- **Local AI Support**: Ollama fallback for unlimited generation without API costs
|
|
101
103
|
|
|
102
|
-
|
|
103
|
-
- `.mycontext/01a-brief.md` — Project overview and brief
|
|
104
|
-
- `.mycontext/01b-requirements.md` — Technical requirements
|
|
105
|
-
- `.mycontext/01c-flows.md` — User flows and workflows
|
|
106
|
-
- `.mycontext/02-types.ts`
|
|
107
|
-
- `.mycontext/03-branding.md`
|
|
108
|
-
- `.mycontext/04-component-list.json`
|
|
104
|
+
## Support
|
|
109
105
|
|
|
110
|
-
|
|
106
|
+
- **GitHub Issues**: Report bugs and request features
|
|
107
|
+
- **Documentation**: Full CLI reference and guides
|
|
108
|
+
- **Community**: Share components and patterns
|
|
111
109
|
|
|
112
|
-
|
|
110
|
+
---
|
|
113
111
|
|
|
114
|
-
|
|
115
|
-
# Project Setup
|
|
116
|
-
mycontext init <project-name> [--description "text"] [--framework nextjs]
|
|
117
|
-
mycontext setup [--local] [--force] # Local AI setup
|
|
118
|
-
|
|
119
|
-
# Context Generation
|
|
120
|
-
mycontext generate context [--description "text"] # PRD + user stories
|
|
121
|
-
mycontext generate types # TypeScript interfaces
|
|
122
|
-
mycontext generate brand # Design system
|
|
123
|
-
mycontext generate components-list # Component planning
|
|
124
|
-
mycontext validate prd [--interactive] # PRD validation
|
|
112
|
+
**Built for developers who want AI that understands their project context.**
|
|
125
113
|
|
|
126
114
|
# Core Component (Brand Anchor)
|
|
127
|
-
|
|
128
|
-
mycontext core
|
|
129
|
-
mycontext core
|
|
130
|
-
mycontext core
|
|
115
|
+
|
|
116
|
+
mycontext core generate [name] [--group core] # Generate BrandComp
|
|
117
|
+
mycontext core refine [--desc "improvements"] # Record refinements
|
|
118
|
+
mycontext core ready # Mark ready for use
|
|
119
|
+
mycontext core status # Check core status
|
|
131
120
|
|
|
132
121
|
# Component Generation
|
|
122
|
+
|
|
133
123
|
mycontext generate-components all [--local] [--with-tests] [--check]
|
|
134
|
-
mycontext generate-components <group> [--local]
|
|
135
|
-
mycontext generate-components all --core-first
|
|
136
|
-
|
|
124
|
+
mycontext generate-components <group> [--local] # Single group
|
|
125
|
+
mycontext generate-components all --core-first # Core only, then stop
|
|
126
|
+
|
|
127
|
+
````
|
|
137
128
|
|
|
138
129
|
### **AI Enhancement Commands**
|
|
139
130
|
|
|
@@ -149,7 +140,7 @@ mycontext refine <component.tsx> --rollback # Rollback changes
|
|
|
149
140
|
--show-changes # Show detailed change breakdown
|
|
150
141
|
--preserve-history # Keep refinement history
|
|
151
142
|
--interactive # VS Code extension mode
|
|
152
|
-
|
|
143
|
+
````
|
|
153
144
|
|
|
154
145
|
### **Project Management**
|
|
155
146
|
|
|
@@ -180,6 +171,27 @@ mycontext model reset [--force] # Reset to clean state
|
|
|
180
171
|
mycontext model stats [--detailed] [--last 30d] # Usage statistics
|
|
181
172
|
```
|
|
182
173
|
|
|
174
|
+
### **🧠 Enhanced Intelligence Commands**
|
|
175
|
+
|
|
176
|
+
```bash
|
|
177
|
+
# Predictive Development (Production Ready)
|
|
178
|
+
mycontext predict next # Predict next development steps
|
|
179
|
+
mycontext predict dependencies # Suggest optimal packages and tools
|
|
180
|
+
mycontext predict patterns # Identify architectural patterns
|
|
181
|
+
mycontext predict issues # Forecast potential problems
|
|
182
|
+
mycontext predict optimization # Recommend performance improvements
|
|
183
|
+
|
|
184
|
+
# Agent Communication & Auto-Generation
|
|
185
|
+
mycontext agent-flow generate-context # Multi-agent context generation
|
|
186
|
+
mycontext agent-flow validate-workflow # Test agent communication system
|
|
187
|
+
mycontext clean # Auto-fix malformed files and issues
|
|
188
|
+
|
|
189
|
+
# Intelligence Options
|
|
190
|
+
--detailed # Show comprehensive analysis
|
|
191
|
+
--format json|table # Output format
|
|
192
|
+
--scope next|dependencies|patterns|issues|optimization # Prediction scope
|
|
193
|
+
```
|
|
194
|
+
|
|
183
195
|
### **Utilities & Maintenance**
|
|
184
196
|
|
|
185
197
|
```bash
|
|
@@ -219,8 +231,12 @@ mycontext help # Detailed help
|
|
|
219
231
|
### **Authentication & Models**
|
|
220
232
|
|
|
221
233
|
```bash
|
|
222
|
-
# GitHub Models (
|
|
223
|
-
MYCONTEXT_GITHUB_TOKEN=ghp_xxx # Set in .mycontext/.env
|
|
234
|
+
# GitHub Models (optional - provides faster generation when available)
|
|
235
|
+
MYCONTEXT_GITHUB_TOKEN=ghp_xxx # Set in .mycontext/.env for faster generation
|
|
236
|
+
|
|
237
|
+
# Ollama (automatic fallback - works without API keys)
|
|
238
|
+
# Install Ollama locally for unlimited component generation
|
|
239
|
+
# No API keys required - works offline when GitHub Models is rate-limited
|
|
224
240
|
|
|
225
241
|
# Alternative providers (optional)
|
|
226
242
|
HUGGINGFACE_API_KEY=hf_xxx # Hugging Face fallback
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { AgentMessage, AgentIntent, AgentContext, AgentCommunicationHandler, IntentResolver, WorkflowConfig } from "../interfaces/AgentCommunication";
|
|
2
|
+
import { SubAgentOrchestrator } from "../orchestrator/SubAgentOrchestrator";
|
|
3
|
+
export declare class AgentCommunicationManager implements AgentCommunicationHandler {
|
|
4
|
+
private messageHistory;
|
|
5
|
+
private orchestrator;
|
|
6
|
+
private intentResolver;
|
|
7
|
+
constructor(orchestrator: SubAgentOrchestrator, intentResolver?: IntentResolver);
|
|
8
|
+
sendMessage(message: AgentMessage): Promise<void>;
|
|
9
|
+
receiveMessage(agentName: string): Promise<AgentMessage | null>;
|
|
10
|
+
broadcastMessage(message: Omit<AgentMessage, "to">): Promise<void>;
|
|
11
|
+
getMessageHistory(agentName?: string): Promise<AgentMessage[]>;
|
|
12
|
+
clearHistory(): Promise<void>;
|
|
13
|
+
private saveMessageLog;
|
|
14
|
+
runAutoWorkflow(initialAgent: string, context: AgentContext, config: WorkflowConfig): Promise<{
|
|
15
|
+
success: boolean;
|
|
16
|
+
outputs: Record<string, any>;
|
|
17
|
+
messages: AgentMessage[];
|
|
18
|
+
}>;
|
|
19
|
+
}
|
|
20
|
+
export declare class DefaultIntentResolver implements IntentResolver {
|
|
21
|
+
analyzeOutput(output: any, context: AgentContext): Promise<AgentIntent>;
|
|
22
|
+
shouldTriggerNextAgent(intent: AgentIntent, context: AgentContext): Promise<boolean>;
|
|
23
|
+
getNextAgent(intent: AgentIntent, context: AgentContext): Promise<string | null>;
|
|
24
|
+
createStarterPrompt(intent: AgentIntent, context: AgentContext): Promise<string>;
|
|
25
|
+
private calculateConfidence;
|
|
26
|
+
}
|
|
27
|
+
//# sourceMappingURL=AgentCommunicationManager.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AgentCommunicationManager.d.ts","sourceRoot":"","sources":["../../../src/agents/communication/AgentCommunicationManager.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,YAAY,EACZ,WAAW,EACX,YAAY,EAEZ,yBAAyB,EACzB,cAAc,EAEd,cAAc,EACf,MAAM,kCAAkC,CAAC;AAC1C,OAAO,EAAE,oBAAoB,EAAE,MAAM,sCAAsC,CAAC;AAI5E,qBAAa,yBAA0B,YAAW,yBAAyB;IACzE,OAAO,CAAC,cAAc,CAAsB;IAC5C,OAAO,CAAC,YAAY,CAAuB;IAC3C,OAAO,CAAC,cAAc,CAAiB;gBAGrC,YAAY,EAAE,oBAAoB,EAClC,cAAc,CAAC,EAAE,cAAc;IAM3B,WAAW,CAAC,OAAO,EAAE,YAAY,GAAG,OAAO,CAAC,IAAI,CAAC;IAUjD,cAAc,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,YAAY,GAAG,IAAI,CAAC;IAM/D,gBAAgB,CAAC,OAAO,EAAE,IAAI,CAAC,YAAY,EAAE,IAAI,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC;IAWlE,iBAAiB,CAAC,SAAS,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,YAAY,EAAE,CAAC;IAO9D,YAAY,IAAI,OAAO,CAAC,IAAI,CAAC;YAIrB,cAAc;IAuBtB,eAAe,CACnB,YAAY,EAAE,MAAM,EACpB,OAAO,EAAE,YAAY,EACrB,MAAM,EAAE,cAAc,GACrB,OAAO,CAAC;QACT,OAAO,EAAE,OAAO,CAAC;QACjB,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;QAC7B,QAAQ,EAAE,YAAY,EAAE,CAAC;KAC1B,CAAC;CAwHH;AAGD,qBAAa,qBAAsB,YAAW,cAAc;IACpD,aAAa,CACjB,MAAM,EAAE,GAAG,EACX,OAAO,EAAE,YAAY,GACpB,OAAO,CAAC,WAAW,CAAC;IA8BjB,sBAAsB,CAC1B,MAAM,EAAE,WAAW,EACnB,OAAO,EAAE,YAAY,GACpB,OAAO,CAAC,OAAO,CAAC;IAOb,YAAY,CAChB,MAAM,EAAE,WAAW,EACnB,OAAO,EAAE,YAAY,GACpB,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC;IAiBnB,mBAAmB,CACvB,MAAM,EAAE,WAAW,EACnB,OAAO,EAAE,YAAY,GACpB,OAAO,CAAC,MAAM,CAAC;IA8BlB,OAAO,CAAC,mBAAmB;CAiC5B"}
|
|
@@ -0,0 +1,293 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
36
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
37
|
+
};
|
|
38
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
|
+
exports.DefaultIntentResolver = exports.AgentCommunicationManager = void 0;
|
|
40
|
+
const fs = __importStar(require("fs-extra"));
|
|
41
|
+
const path_1 = __importDefault(require("path"));
|
|
42
|
+
class AgentCommunicationManager {
|
|
43
|
+
constructor(orchestrator, intentResolver) {
|
|
44
|
+
this.messageHistory = [];
|
|
45
|
+
this.orchestrator = orchestrator;
|
|
46
|
+
this.intentResolver = intentResolver || new DefaultIntentResolver();
|
|
47
|
+
}
|
|
48
|
+
async sendMessage(message) {
|
|
49
|
+
this.messageHistory.push({
|
|
50
|
+
...message,
|
|
51
|
+
timestamp: new Date().toISOString(),
|
|
52
|
+
});
|
|
53
|
+
// Save communication log for debugging
|
|
54
|
+
await this.saveMessageLog(message);
|
|
55
|
+
}
|
|
56
|
+
async receiveMessage(agentName) {
|
|
57
|
+
// Get the latest message for this agent
|
|
58
|
+
const messages = this.messageHistory.filter((m) => m.to === agentName);
|
|
59
|
+
return messages.length > 0 ? messages[messages.length - 1] : null;
|
|
60
|
+
}
|
|
61
|
+
async broadcastMessage(message) {
|
|
62
|
+
const agentNames = this.orchestrator.listAgents();
|
|
63
|
+
for (const agentName of agentNames) {
|
|
64
|
+
await this.sendMessage({
|
|
65
|
+
...message,
|
|
66
|
+
to: agentName,
|
|
67
|
+
});
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
async getMessageHistory(agentName) {
|
|
71
|
+
if (!agentName)
|
|
72
|
+
return this.messageHistory;
|
|
73
|
+
return this.messageHistory.filter((m) => m.from === agentName || m.to === agentName);
|
|
74
|
+
}
|
|
75
|
+
async clearHistory() {
|
|
76
|
+
this.messageHistory = [];
|
|
77
|
+
}
|
|
78
|
+
async saveMessageLog(message) {
|
|
79
|
+
try {
|
|
80
|
+
const logDir = path_1.default.join(process.cwd(), ".mycontext", "agent-logs");
|
|
81
|
+
await fs.ensureDir(logDir);
|
|
82
|
+
const logFile = path_1.default.join(logDir, `communication-${new Date().toISOString().split("T")[0]}.json`);
|
|
83
|
+
let logs = [];
|
|
84
|
+
if (await fs.pathExists(logFile)) {
|
|
85
|
+
logs = await fs.readJson(logFile);
|
|
86
|
+
}
|
|
87
|
+
logs.push(message);
|
|
88
|
+
await fs.writeJson(logFile, logs, { spaces: 2 });
|
|
89
|
+
}
|
|
90
|
+
catch (error) {
|
|
91
|
+
// Silent fail - logging shouldn't break the workflow
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
// Auto workflow orchestration
|
|
95
|
+
async runAutoWorkflow(initialAgent, context, config) {
|
|
96
|
+
let currentAgent = initialAgent;
|
|
97
|
+
let outputs = {};
|
|
98
|
+
let retryCount = 0;
|
|
99
|
+
let attempts = 0;
|
|
100
|
+
const maxAttempts = config.agents.length * 2; // Safety limit
|
|
101
|
+
while (currentAgent && attempts < maxAttempts) {
|
|
102
|
+
attempts++;
|
|
103
|
+
try {
|
|
104
|
+
// Execute current agent
|
|
105
|
+
const agentOutput = await this.orchestrator.executeAgent(currentAgent, {
|
|
106
|
+
context,
|
|
107
|
+
previousOutputs: outputs,
|
|
108
|
+
retryCount,
|
|
109
|
+
});
|
|
110
|
+
outputs[currentAgent] = agentOutput;
|
|
111
|
+
// Analyze output and determine next action
|
|
112
|
+
const intent = await this.intentResolver.analyzeOutput(agentOutput, context);
|
|
113
|
+
// Send completion message
|
|
114
|
+
await this.sendMessage({
|
|
115
|
+
id: `${currentAgent}-${Date.now()}`,
|
|
116
|
+
from: currentAgent,
|
|
117
|
+
to: "coordinator",
|
|
118
|
+
type: "completion",
|
|
119
|
+
payload: { output: agentOutput, intent },
|
|
120
|
+
timestamp: new Date().toISOString(),
|
|
121
|
+
});
|
|
122
|
+
// Check if we should trigger next agent
|
|
123
|
+
if (config.enableAutoTransition &&
|
|
124
|
+
(await this.intentResolver.shouldTriggerNextAgent(intent, context))) {
|
|
125
|
+
const nextAgent = await this.intentResolver.getNextAgent(intent, context);
|
|
126
|
+
if (nextAgent) {
|
|
127
|
+
// Create starter prompt for next agent
|
|
128
|
+
const starterPrompt = await this.intentResolver.createStarterPrompt(intent, context);
|
|
129
|
+
// Update context with new starter prompt
|
|
130
|
+
context = {
|
|
131
|
+
...context,
|
|
132
|
+
userPrompt: starterPrompt,
|
|
133
|
+
previousOutputs: outputs,
|
|
134
|
+
};
|
|
135
|
+
// Send request to next agent
|
|
136
|
+
await this.sendMessage({
|
|
137
|
+
id: `transition-${Date.now()}`,
|
|
138
|
+
from: currentAgent,
|
|
139
|
+
to: nextAgent,
|
|
140
|
+
type: "request",
|
|
141
|
+
payload: {
|
|
142
|
+
starterPrompt,
|
|
143
|
+
context: context,
|
|
144
|
+
intent,
|
|
145
|
+
},
|
|
146
|
+
timestamp: new Date().toISOString(),
|
|
147
|
+
});
|
|
148
|
+
currentAgent = nextAgent;
|
|
149
|
+
retryCount = 0;
|
|
150
|
+
}
|
|
151
|
+
else {
|
|
152
|
+
// No next agent, workflow complete
|
|
153
|
+
break;
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
else if (intent.action === "refine" &&
|
|
157
|
+
retryCount < config.retryLimit) {
|
|
158
|
+
// Same agent needs to retry/refine
|
|
159
|
+
retryCount++;
|
|
160
|
+
context = {
|
|
161
|
+
...context,
|
|
162
|
+
userPrompt: intent.nextSteps?.join(" ") || "Please refine the output",
|
|
163
|
+
previousOutputs: outputs,
|
|
164
|
+
};
|
|
165
|
+
}
|
|
166
|
+
else {
|
|
167
|
+
// Workflow complete or max retries reached
|
|
168
|
+
break;
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
catch (error) {
|
|
172
|
+
await this.sendMessage({
|
|
173
|
+
id: `error-${Date.now()}`,
|
|
174
|
+
from: currentAgent,
|
|
175
|
+
to: "coordinator",
|
|
176
|
+
type: "error",
|
|
177
|
+
payload: { error: error.message, retryCount },
|
|
178
|
+
timestamp: new Date().toISOString(),
|
|
179
|
+
});
|
|
180
|
+
if (retryCount < config.retryLimit) {
|
|
181
|
+
retryCount++;
|
|
182
|
+
}
|
|
183
|
+
else {
|
|
184
|
+
break;
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
return {
|
|
189
|
+
success: Object.keys(outputs).length > 0,
|
|
190
|
+
outputs,
|
|
191
|
+
messages: this.messageHistory,
|
|
192
|
+
};
|
|
193
|
+
}
|
|
194
|
+
}
|
|
195
|
+
exports.AgentCommunicationManager = AgentCommunicationManager;
|
|
196
|
+
// Default intent resolver implementation
|
|
197
|
+
class DefaultIntentResolver {
|
|
198
|
+
async analyzeOutput(output, context) {
|
|
199
|
+
// Simple heuristic-based analysis
|
|
200
|
+
const confidence = this.calculateConfidence(output);
|
|
201
|
+
if (confidence < 0.3) {
|
|
202
|
+
return {
|
|
203
|
+
action: "refine",
|
|
204
|
+
reason: "Output quality below threshold",
|
|
205
|
+
confidence,
|
|
206
|
+
nextSteps: ["Improve output quality", "Add missing details"],
|
|
207
|
+
};
|
|
208
|
+
}
|
|
209
|
+
if (confidence > 0.8) {
|
|
210
|
+
return {
|
|
211
|
+
action: "complete",
|
|
212
|
+
reason: "High quality output achieved",
|
|
213
|
+
confidence,
|
|
214
|
+
nextSteps: ["Proceed to next stage"],
|
|
215
|
+
};
|
|
216
|
+
}
|
|
217
|
+
return {
|
|
218
|
+
action: "generate",
|
|
219
|
+
reason: "Acceptable output, continue workflow",
|
|
220
|
+
confidence,
|
|
221
|
+
nextSteps: ["Continue to next agent"],
|
|
222
|
+
};
|
|
223
|
+
}
|
|
224
|
+
async shouldTriggerNextAgent(intent, context) {
|
|
225
|
+
return (intent.action === "complete" ||
|
|
226
|
+
(intent.action === "generate" && intent.confidence > 0.6));
|
|
227
|
+
}
|
|
228
|
+
async getNextAgent(intent, context) {
|
|
229
|
+
// Simple sequential flow for now
|
|
230
|
+
const sequence = ["CodeGenSubAgent", "QASubAgent", "DocsSubAgent"];
|
|
231
|
+
// Find current agent in sequence (based on context)
|
|
232
|
+
if (context.previousOutputs) {
|
|
233
|
+
const completed = Object.keys(context.previousOutputs);
|
|
234
|
+
for (let i = 0; i < sequence.length; i++) {
|
|
235
|
+
if (!completed.includes(sequence[i])) {
|
|
236
|
+
return sequence[i];
|
|
237
|
+
}
|
|
238
|
+
}
|
|
239
|
+
}
|
|
240
|
+
return sequence[0]; // Default to first agent
|
|
241
|
+
}
|
|
242
|
+
async createStarterPrompt(intent, context) {
|
|
243
|
+
const basePrompt = context.userPrompt || "Generate high-quality output";
|
|
244
|
+
if (intent.action === "refine") {
|
|
245
|
+
return `${basePrompt}\n\nPlease refine the previous output with these improvements:\n${intent.nextSteps?.join("\n") || ""}`;
|
|
246
|
+
}
|
|
247
|
+
if (context.previousOutputs &&
|
|
248
|
+
Object.keys(context.previousOutputs).length > 0) {
|
|
249
|
+
const previousContext = Object.entries(context.previousOutputs)
|
|
250
|
+
.map(([agent, output]) => `${agent}: ${typeof output === "string"
|
|
251
|
+
? output.substring(0, 200) + "..."
|
|
252
|
+
: "Generated output"}`)
|
|
253
|
+
.join("\n");
|
|
254
|
+
return `${basePrompt}\n\nBuild upon previous agent outputs:\n${previousContext}`;
|
|
255
|
+
}
|
|
256
|
+
return basePrompt;
|
|
257
|
+
}
|
|
258
|
+
calculateConfidence(output) {
|
|
259
|
+
if (!output)
|
|
260
|
+
return 0;
|
|
261
|
+
if (typeof output === "string") {
|
|
262
|
+
// Simple heuristics for string output
|
|
263
|
+
const length = output.length;
|
|
264
|
+
const hasStructure = output.includes("\n") || output.includes("```");
|
|
265
|
+
const hasDetails = length > 100;
|
|
266
|
+
let score = 0.5;
|
|
267
|
+
if (hasStructure)
|
|
268
|
+
score += 0.2;
|
|
269
|
+
if (hasDetails)
|
|
270
|
+
score += 0.2;
|
|
271
|
+
if (length > 500)
|
|
272
|
+
score += 0.1;
|
|
273
|
+
return Math.min(score, 1.0);
|
|
274
|
+
}
|
|
275
|
+
if (typeof output === "object") {
|
|
276
|
+
// Object-based output confidence
|
|
277
|
+
const keys = Object.keys(output);
|
|
278
|
+
const hasCode = "code" in output;
|
|
279
|
+
const hasMetadata = "metadata" in output;
|
|
280
|
+
let score = 0.6;
|
|
281
|
+
if (hasCode)
|
|
282
|
+
score += 0.2;
|
|
283
|
+
if (hasMetadata)
|
|
284
|
+
score += 0.1;
|
|
285
|
+
if (keys.length > 3)
|
|
286
|
+
score += 0.1;
|
|
287
|
+
return Math.min(score, 1.0);
|
|
288
|
+
}
|
|
289
|
+
return 0.5; // Default confidence
|
|
290
|
+
}
|
|
291
|
+
}
|
|
292
|
+
exports.DefaultIntentResolver = DefaultIntentResolver;
|
|
293
|
+
//# sourceMappingURL=AgentCommunicationManager.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AgentCommunicationManager.js","sourceRoot":"","sources":["../../../src/agents/communication/AgentCommunicationManager.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAWA,6CAA+B;AAC/B,gD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