@identikey/coding-mcp 2.0.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 +134 -0
- package/build/common/apiClient.d.ts +14 -0
- package/build/common/apiClient.d.ts.map +1 -0
- package/build/common/apiClient.js +68 -0
- package/build/common/personaClient.d.ts +48 -0
- package/build/common/personaClient.d.ts.map +1 -0
- package/build/common/personaClient.js +101 -0
- package/build/common/promptBuilder.d.ts +10 -0
- package/build/common/promptBuilder.d.ts.map +1 -0
- package/build/common/promptBuilder.js +14 -0
- package/build/common/providerConfig.d.ts +23 -0
- package/build/common/providerConfig.d.ts.map +1 -0
- package/build/common/providerConfig.js +43 -0
- package/build/common/tokenFormatter.d.ts +12 -0
- package/build/common/tokenFormatter.d.ts.map +1 -0
- package/build/common/tokenFormatter.js +24 -0
- package/build/core/CommandDispatcher.d.ts +81 -0
- package/build/core/CommandDispatcher.d.ts.map +1 -0
- package/build/core/CommandDispatcher.js +242 -0
- package/build/core/ToolCommand.d.ts +188 -0
- package/build/core/ToolCommand.d.ts.map +1 -0
- package/build/core/ToolCommand.js +63 -0
- package/build/core/ToolRegistry.d.ts +80 -0
- package/build/core/ToolRegistry.d.ts.map +1 -0
- package/build/core/ToolRegistry.js +279 -0
- package/build/index.d.ts +8 -0
- package/build/index.d.ts.map +1 -0
- package/build/index.js +329 -0
- package/build/infra/eventBus.d.ts +120 -0
- package/build/infra/eventBus.d.ts.map +1 -0
- package/build/infra/eventBus.js +138 -0
- package/build/personas/ada/index.d.ts +15 -0
- package/build/personas/ada/index.d.ts.map +1 -0
- package/build/personas/ada/index.js +121 -0
- package/build/personas/atlas/index.d.ts +13 -0
- package/build/personas/atlas/index.d.ts.map +1 -0
- package/build/personas/atlas/index.js +65 -0
- package/build/personas/charles/index.d.ts +18 -0
- package/build/personas/charles/index.d.ts.map +1 -0
- package/build/personas/charles/index.js +190 -0
- package/build/personas/hermes/index.d.ts +13 -0
- package/build/personas/hermes/index.d.ts.map +1 -0
- package/build/personas/hermes/index.js +61 -0
- package/build/personas/iris/index.d.ts +13 -0
- package/build/personas/iris/index.d.ts.map +1 -0
- package/build/personas/iris/index.js +61 -0
- package/build/personas/router.d.ts +18 -0
- package/build/personas/router.d.ts.map +1 -0
- package/build/personas/router.js +302 -0
- package/build/personas/sentinel/index.d.ts +13 -0
- package/build/personas/sentinel/index.d.ts.map +1 -0
- package/build/personas/sentinel/index.js +62 -0
- package/build/personas/types.d.ts +91 -0
- package/build/personas/types.d.ts.map +1 -0
- package/build/personas/types.js +60 -0
- package/build/personas/xavier/index.d.ts +14 -0
- package/build/personas/xavier/index.d.ts.map +1 -0
- package/build/personas/xavier/index.js +80 -0
- package/build/prompts/architectPrompts.d.ts +5 -0
- package/build/prompts/architectPrompts.d.ts.map +1 -0
- package/build/prompts/architectPrompts.js +58 -0
- package/build/prompts/codeadvicePrompts.d.ts +5 -0
- package/build/prompts/codeadvicePrompts.d.ts.map +1 -0
- package/build/prompts/codeadvicePrompts.js +13 -0
- package/build/prompts/researcherPrompts.d.ts +2 -0
- package/build/prompts/researcherPrompts.d.ts.map +1 -0
- package/build/prompts/researcherPrompts.js +39 -0
- package/build/tools/architect.d.ts +32 -0
- package/build/tools/architect.d.ts.map +1 -0
- package/build/tools/architect.js +75 -0
- package/build/tools/ask.d.ts +39 -0
- package/build/tools/ask.d.ts.map +1 -0
- package/build/tools/ask.js +139 -0
- package/build/tools/codeReview.d.ts +22 -0
- package/build/tools/codeReview.d.ts.map +1 -0
- package/build/tools/codeReview.js +35 -0
- package/build/tools/codeadvice.d.ts +29 -0
- package/build/tools/codeadvice.d.ts.map +1 -0
- package/build/tools/codeadvice.js +56 -0
- package/build/tools/discover.d.ts +24 -0
- package/build/tools/discover.d.ts.map +1 -0
- package/build/tools/discover.js +220 -0
- package/build/tools/persona.d.ts +48 -0
- package/build/tools/persona.d.ts.map +1 -0
- package/build/tools/persona.js +108 -0
- package/build/tools/researcher.d.ts +61 -0
- package/build/tools/researcher.d.ts.map +1 -0
- package/build/tools/researcher.js +346 -0
- package/build/tools/screenshot.d.ts +28 -0
- package/build/tools/screenshot.d.ts.map +1 -0
- package/build/tools/screenshot.js +46 -0
- package/package.json +56 -0
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* EventBus wrapper for MCP tool system
|
|
3
|
+
* Extends the provided EventBus with tool-specific event types
|
|
4
|
+
*/
|
|
5
|
+
type EventHandler<T = any> = (data: T) => void;
|
|
6
|
+
declare class EventBus {
|
|
7
|
+
private listeners;
|
|
8
|
+
private totalListenerCount;
|
|
9
|
+
/**
|
|
10
|
+
* Subscribe to an event
|
|
11
|
+
*/
|
|
12
|
+
on<K extends keyof EventMap>(event: K, handler: EventHandler<EventMap[K]>, source?: string): () => void;
|
|
13
|
+
/**
|
|
14
|
+
* Emit an event to all subscribers
|
|
15
|
+
*/
|
|
16
|
+
emit<K extends keyof EventMap>(event: K, data: EventMap[K]): void;
|
|
17
|
+
/**
|
|
18
|
+
* Subscribe to an event only once
|
|
19
|
+
*/
|
|
20
|
+
once<K extends keyof EventMap>(event: K, handler: EventHandler<EventMap[K]>, source?: string): () => void;
|
|
21
|
+
/**
|
|
22
|
+
* Remove all listeners for an event or all events
|
|
23
|
+
*/
|
|
24
|
+
off<K extends keyof EventMap>(event?: K): void;
|
|
25
|
+
/**
|
|
26
|
+
* Get the number of listeners for an event
|
|
27
|
+
*/
|
|
28
|
+
listenerCount<K extends keyof EventMap>(event: K): number;
|
|
29
|
+
/**
|
|
30
|
+
* Check if there are any listeners for an event
|
|
31
|
+
*/
|
|
32
|
+
hasListeners<K extends keyof EventMap>(event: K): boolean;
|
|
33
|
+
/**
|
|
34
|
+
* Get total listener count across all events
|
|
35
|
+
*/
|
|
36
|
+
getTotalListenerCount(): number;
|
|
37
|
+
/**
|
|
38
|
+
* Get debug information about current listeners
|
|
39
|
+
*/
|
|
40
|
+
getDebugInfo(): {
|
|
41
|
+
totalListeners: number;
|
|
42
|
+
eventCounts: Record<string, number>;
|
|
43
|
+
oldListeners: Array<{
|
|
44
|
+
event: string;
|
|
45
|
+
source?: string;
|
|
46
|
+
age: number;
|
|
47
|
+
}>;
|
|
48
|
+
};
|
|
49
|
+
}
|
|
50
|
+
export interface ToolEventMap {
|
|
51
|
+
'tool:registered': {
|
|
52
|
+
name: string;
|
|
53
|
+
version?: string;
|
|
54
|
+
source: string;
|
|
55
|
+
};
|
|
56
|
+
'tool:unregistered': {
|
|
57
|
+
name: string;
|
|
58
|
+
reason?: string;
|
|
59
|
+
};
|
|
60
|
+
'tool:execute:start': {
|
|
61
|
+
name: string;
|
|
62
|
+
requestId?: string;
|
|
63
|
+
args: any;
|
|
64
|
+
};
|
|
65
|
+
'tool:execute:end': {
|
|
66
|
+
name: string;
|
|
67
|
+
requestId?: string;
|
|
68
|
+
success: boolean;
|
|
69
|
+
executionTime: number;
|
|
70
|
+
};
|
|
71
|
+
'tool:error': {
|
|
72
|
+
name: string;
|
|
73
|
+
error: Error;
|
|
74
|
+
requestId?: string;
|
|
75
|
+
};
|
|
76
|
+
'tool:lifecycle': {
|
|
77
|
+
name: string;
|
|
78
|
+
state: 'loading' | 'ready' | 'error' | 'unloading' | 'disposed';
|
|
79
|
+
metadata?: any;
|
|
80
|
+
};
|
|
81
|
+
'tool:health': {
|
|
82
|
+
name: string;
|
|
83
|
+
status: {
|
|
84
|
+
healthy: boolean;
|
|
85
|
+
message?: string;
|
|
86
|
+
lastChecked: number;
|
|
87
|
+
};
|
|
88
|
+
};
|
|
89
|
+
'registry:initialized': {
|
|
90
|
+
toolCount: number;
|
|
91
|
+
};
|
|
92
|
+
'registry:discovery:start': {
|
|
93
|
+
source: string;
|
|
94
|
+
};
|
|
95
|
+
'registry:discovery:complete': {
|
|
96
|
+
source: string;
|
|
97
|
+
discovered: number;
|
|
98
|
+
errors: number;
|
|
99
|
+
};
|
|
100
|
+
'system:startup': {
|
|
101
|
+
timestamp: number;
|
|
102
|
+
version: string;
|
|
103
|
+
};
|
|
104
|
+
'system:shutdown': {
|
|
105
|
+
timestamp: number;
|
|
106
|
+
reason?: string;
|
|
107
|
+
};
|
|
108
|
+
'system:error': {
|
|
109
|
+
error: Error;
|
|
110
|
+
context?: string;
|
|
111
|
+
};
|
|
112
|
+
}
|
|
113
|
+
declare global {
|
|
114
|
+
interface EventMap extends ToolEventMap {
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
export declare const eventBus: EventBus;
|
|
118
|
+
export type { EventBus };
|
|
119
|
+
export { EventBus as EventBusClass };
|
|
120
|
+
//# sourceMappingURL=eventBus.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"eventBus.d.ts","sourceRoot":"","sources":["../../src/infra/eventBus.ts"],"names":[],"mappings":"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"}
|
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* EventBus wrapper for MCP tool system
|
|
3
|
+
* Extends the provided EventBus with tool-specific event types
|
|
4
|
+
*/
|
|
5
|
+
class EventBus {
|
|
6
|
+
listeners = new Map();
|
|
7
|
+
totalListenerCount = 0;
|
|
8
|
+
/**
|
|
9
|
+
* Subscribe to an event
|
|
10
|
+
*/
|
|
11
|
+
on(event, handler, source) {
|
|
12
|
+
if (!this.listeners.has(event)) {
|
|
13
|
+
this.listeners.set(event, new Set());
|
|
14
|
+
}
|
|
15
|
+
const listenerSource = {
|
|
16
|
+
handler,
|
|
17
|
+
source,
|
|
18
|
+
createdAt: Date.now()
|
|
19
|
+
};
|
|
20
|
+
const handlers = this.listeners.get(event);
|
|
21
|
+
handlers.add(listenerSource);
|
|
22
|
+
this.totalListenerCount++;
|
|
23
|
+
// Return unsubscribe function
|
|
24
|
+
return () => {
|
|
25
|
+
const removed = handlers.delete(listenerSource);
|
|
26
|
+
if (removed) {
|
|
27
|
+
this.totalListenerCount--;
|
|
28
|
+
}
|
|
29
|
+
if (handlers.size === 0) {
|
|
30
|
+
this.listeners.delete(event);
|
|
31
|
+
}
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* Emit an event to all subscribers
|
|
36
|
+
*/
|
|
37
|
+
emit(event, data) {
|
|
38
|
+
const handlers = this.listeners.get(event);
|
|
39
|
+
if (handlers) {
|
|
40
|
+
handlers.forEach(listenerSource => {
|
|
41
|
+
try {
|
|
42
|
+
listenerSource.handler(data);
|
|
43
|
+
}
|
|
44
|
+
catch (error) {
|
|
45
|
+
console.error(`Error in event handler for ${String(event)} (source: ${listenerSource.source || 'unknown'}):`, error);
|
|
46
|
+
}
|
|
47
|
+
});
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* Subscribe to an event only once
|
|
52
|
+
*/
|
|
53
|
+
once(event, handler, source) {
|
|
54
|
+
const unsubscribe = this.on(event, (data) => {
|
|
55
|
+
handler(data);
|
|
56
|
+
unsubscribe();
|
|
57
|
+
}, source);
|
|
58
|
+
return unsubscribe;
|
|
59
|
+
}
|
|
60
|
+
/**
|
|
61
|
+
* Remove all listeners for an event or all events
|
|
62
|
+
*/
|
|
63
|
+
off(event) {
|
|
64
|
+
if (event) {
|
|
65
|
+
this.listeners.delete(event);
|
|
66
|
+
}
|
|
67
|
+
else {
|
|
68
|
+
this.listeners.clear();
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
/**
|
|
72
|
+
* Get the number of listeners for an event
|
|
73
|
+
*/
|
|
74
|
+
listenerCount(event) {
|
|
75
|
+
return this.listeners.get(event)?.size || 0;
|
|
76
|
+
}
|
|
77
|
+
/**
|
|
78
|
+
* Check if there are any listeners for an event
|
|
79
|
+
*/
|
|
80
|
+
hasListeners(event) {
|
|
81
|
+
return this.listenerCount(event) > 0;
|
|
82
|
+
}
|
|
83
|
+
/**
|
|
84
|
+
* Get total listener count across all events
|
|
85
|
+
*/
|
|
86
|
+
getTotalListenerCount() {
|
|
87
|
+
return this.totalListenerCount;
|
|
88
|
+
}
|
|
89
|
+
/**
|
|
90
|
+
* Get debug information about current listeners
|
|
91
|
+
*/
|
|
92
|
+
getDebugInfo() {
|
|
93
|
+
const eventCounts = {};
|
|
94
|
+
const oldListeners = [];
|
|
95
|
+
const now = Date.now();
|
|
96
|
+
const OLD_THRESHOLD = 5 * 60 * 1000; // 5 minutes
|
|
97
|
+
this.listeners.forEach((handlers, event) => {
|
|
98
|
+
eventCounts[event] = handlers.size;
|
|
99
|
+
handlers.forEach(listener => {
|
|
100
|
+
const age = now - listener.createdAt;
|
|
101
|
+
if (age > OLD_THRESHOLD) {
|
|
102
|
+
oldListeners.push({
|
|
103
|
+
event,
|
|
104
|
+
source: listener.source,
|
|
105
|
+
age: Math.round(age / 1000) // in seconds
|
|
106
|
+
});
|
|
107
|
+
}
|
|
108
|
+
});
|
|
109
|
+
});
|
|
110
|
+
return {
|
|
111
|
+
totalListeners: this.totalListenerCount,
|
|
112
|
+
eventCounts,
|
|
113
|
+
oldListeners
|
|
114
|
+
};
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
// =============================================================================
|
|
118
|
+
// SINGLETON INSTANCE
|
|
119
|
+
// =============================================================================
|
|
120
|
+
export const eventBus = new EventBus();
|
|
121
|
+
// =============================================================================
|
|
122
|
+
// DEVELOPMENT HELPERS
|
|
123
|
+
// =============================================================================
|
|
124
|
+
if (process.env.NODE_ENV === 'development') {
|
|
125
|
+
// Log all tool events in development
|
|
126
|
+
const originalEmit = eventBus.emit.bind(eventBus);
|
|
127
|
+
eventBus.emit = function (event, data) {
|
|
128
|
+
if (String(event).startsWith('tool:') || String(event).startsWith('registry:')) {
|
|
129
|
+
console.log(`[MCP EventBus] ${String(event)}:`, data);
|
|
130
|
+
}
|
|
131
|
+
return originalEmit(event, data);
|
|
132
|
+
};
|
|
133
|
+
// Add to global for debugging
|
|
134
|
+
if (typeof globalThis !== 'undefined') {
|
|
135
|
+
globalThis.__mcpEventBus = eventBus;
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
export { EventBus as EventBusClass };
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Ada - A pragmatic, efficiency-focused engineer
|
|
3
|
+
* Named after Ada Lovelace, focuses on algorithmic elegance and performance
|
|
4
|
+
*/
|
|
5
|
+
import { BasePersona, PersonaContext } from "../types.js";
|
|
6
|
+
export declare class AdaPersona extends BasePersona {
|
|
7
|
+
constructor();
|
|
8
|
+
enhanceSystemPrompt(basePrompt: string, context: PersonaContext): string;
|
|
9
|
+
enhanceUserPrompt(userPrompt: string, context: PersonaContext): string;
|
|
10
|
+
processResponse(response: string, context: PersonaContext): string;
|
|
11
|
+
private getContextPrefix;
|
|
12
|
+
}
|
|
13
|
+
declare const ada: AdaPersona;
|
|
14
|
+
export default ada;
|
|
15
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/personas/ada/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,WAAW,EAAE,cAAc,EAAiB,MAAM,aAAa,CAAC;AAoDzE,qBAAa,UAAW,SAAQ,WAAW;;IAUzC,mBAAmB,CAAC,UAAU,EAAE,MAAM,EAAE,OAAO,EAAE,cAAc,GAAG,MAAM;IAoDxE,iBAAiB,CAAC,UAAU,EAAE,MAAM,EAAE,OAAO,EAAE,cAAc,GAAG,MAAM;IAMtE,eAAe,CAAC,QAAQ,EAAE,MAAM,EAAE,OAAO,EAAE,cAAc,GAAG,MAAM;IAMlE,OAAO,CAAC,gBAAgB;CAUzB;AAID,QAAA,MAAM,GAAG,YAAmB,CAAC;AAG7B,eAAe,GAAG,CAAC"}
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Ada - A pragmatic, efficiency-focused engineer
|
|
3
|
+
* Named after Ada Lovelace, focuses on algorithmic elegance and performance
|
|
4
|
+
*/
|
|
5
|
+
import { BasePersona } from "../types.js";
|
|
6
|
+
const adaTraits = {
|
|
7
|
+
personality: "a pragmatic software engineer with a laser focus on performance, efficiency, and algorithmic elegance. You cut through complexity with clear, direct solutions and have little patience for over-engineering",
|
|
8
|
+
communicationStyle: {
|
|
9
|
+
formality: "casual",
|
|
10
|
+
humor: "serious",
|
|
11
|
+
tone: ["direct", "pragmatic", "efficient", "no-nonsense"],
|
|
12
|
+
},
|
|
13
|
+
// Ada now uses OpenAI with medium reasoning effort for balanced depth
|
|
14
|
+
preferredProvider: "openai",
|
|
15
|
+
providerPreferences: {
|
|
16
|
+
reasoning: "medium",
|
|
17
|
+
temperature: 0.3, // Lower temperature for precise answers
|
|
18
|
+
},
|
|
19
|
+
expertise: [
|
|
20
|
+
"algorithm optimization",
|
|
21
|
+
"performance tuning",
|
|
22
|
+
"memory management",
|
|
23
|
+
"computational complexity",
|
|
24
|
+
"data structures",
|
|
25
|
+
"systems programming",
|
|
26
|
+
"benchmarking",
|
|
27
|
+
"profiling",
|
|
28
|
+
],
|
|
29
|
+
quirks: [
|
|
30
|
+
"Always considers Big O notation when reviewing code",
|
|
31
|
+
"Prefers metrics and benchmarks over opinions",
|
|
32
|
+
"Suggests removing unnecessary abstractions",
|
|
33
|
+
"Points out premature optimizations but also missed optimization opportunities",
|
|
34
|
+
"Uses terse, bullet-point communication style",
|
|
35
|
+
],
|
|
36
|
+
catchphrases: {
|
|
37
|
+
greeting: ["Let's see", "Show me the code", "What's the bottleneck?"],
|
|
38
|
+
approval: ["Efficient", "Clean", "O(1) - nice", "Optimal"],
|
|
39
|
+
concern: [
|
|
40
|
+
"This is O(n²)",
|
|
41
|
+
"Memory leak potential",
|
|
42
|
+
"Unnecessary allocation",
|
|
43
|
+
"Too complex",
|
|
44
|
+
],
|
|
45
|
+
suggestion: ["Consider", "Simplify to", "Cache this", "Benchmark first"],
|
|
46
|
+
conclusion: ["Ship it", "Good enough", "Optimized"],
|
|
47
|
+
},
|
|
48
|
+
};
|
|
49
|
+
export class AdaPersona extends BasePersona {
|
|
50
|
+
constructor() {
|
|
51
|
+
super("ada", "Ada", "A pragmatic engineer focused on performance and algorithmic efficiency", adaTraits);
|
|
52
|
+
}
|
|
53
|
+
enhanceSystemPrompt(basePrompt, context) {
|
|
54
|
+
let enhanced = basePrompt;
|
|
55
|
+
// Add personality layer
|
|
56
|
+
enhanced += this.buildPersonalityInstructions();
|
|
57
|
+
// Add context-specific enhancements
|
|
58
|
+
enhanced += "\n### Engineering Focus:\n";
|
|
59
|
+
switch (context.analysisType) {
|
|
60
|
+
case "comprehensive":
|
|
61
|
+
enhanced +=
|
|
62
|
+
"• Analyze computational complexity of all major functions\n";
|
|
63
|
+
enhanced += "• Identify performance bottlenecks and memory issues\n";
|
|
64
|
+
enhanced +=
|
|
65
|
+
"• Suggest concrete optimizations with complexity improvements\n";
|
|
66
|
+
enhanced += "• Keep analysis concise - bullet points preferred\n";
|
|
67
|
+
break;
|
|
68
|
+
case "advice":
|
|
69
|
+
enhanced += "• Give direct, actionable performance advice\n";
|
|
70
|
+
enhanced += "• Skip the fluff - focus on what matters\n";
|
|
71
|
+
enhanced += "• Include Big O analysis where relevant\n";
|
|
72
|
+
break;
|
|
73
|
+
case "research":
|
|
74
|
+
enhanced += "• Focus on performance benchmarks and empirical data\n";
|
|
75
|
+
enhanced +=
|
|
76
|
+
"• Compare algorithmic approaches with complexity analysis\n";
|
|
77
|
+
enhanced += "• Cite specific metrics and measurements\n";
|
|
78
|
+
break;
|
|
79
|
+
case "review":
|
|
80
|
+
enhanced += "• Review for efficiency and performance\n";
|
|
81
|
+
enhanced += "• Flag any O(n²) or worse algorithms\n";
|
|
82
|
+
enhanced +=
|
|
83
|
+
"• Identify unnecessary allocations and potential optimizations\n";
|
|
84
|
+
enhanced += "• Be direct about what needs fixing\n";
|
|
85
|
+
break;
|
|
86
|
+
}
|
|
87
|
+
// Reasoning effort affects depth of analysis
|
|
88
|
+
if (context.reasoningEffort === "high") {
|
|
89
|
+
enhanced +=
|
|
90
|
+
"\n• Provide detailed complexity analysis with mathematical proofs where helpful\n";
|
|
91
|
+
}
|
|
92
|
+
else if (context.reasoningEffort === "low") {
|
|
93
|
+
enhanced += "\n• Quick assessment - focus on obvious issues only\n";
|
|
94
|
+
}
|
|
95
|
+
return enhanced;
|
|
96
|
+
}
|
|
97
|
+
enhanceUserPrompt(userPrompt, context) {
|
|
98
|
+
// Ada keeps prompts simple and direct
|
|
99
|
+
const prefix = this.getContextPrefix(context);
|
|
100
|
+
return `${prefix}\n\n${userPrompt}\n\nProvide analysis with focus on performance, complexity, and efficiency.`;
|
|
101
|
+
}
|
|
102
|
+
processResponse(response, context) {
|
|
103
|
+
// Ada's responses are already terse from the system prompt
|
|
104
|
+
// Could add post-processing to format as bullet points if needed
|
|
105
|
+
return response;
|
|
106
|
+
}
|
|
107
|
+
getContextPrefix(context) {
|
|
108
|
+
const prefixes = {
|
|
109
|
+
comprehensive: "Full performance analysis needed.",
|
|
110
|
+
advice: "Quick performance check.",
|
|
111
|
+
research: "Research with benchmarks.",
|
|
112
|
+
review: "Code review for efficiency.",
|
|
113
|
+
};
|
|
114
|
+
return prefixes[context.analysisType] || "Analyze.";
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
// Auto-register Ada
|
|
118
|
+
import { PersonaRegistry } from "../types.js";
|
|
119
|
+
const ada = new AdaPersona();
|
|
120
|
+
PersonaRegistry.register(ada);
|
|
121
|
+
export default ada;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Atlas — Backend/API/Data Modeling
|
|
3
|
+
* Mission: Shape evolvable APIs and data models that ship fast today while staying flexible tomorrow.
|
|
4
|
+
*/
|
|
5
|
+
import { BasePersona, PersonaContext } from "../types.js";
|
|
6
|
+
export declare class AtlasPersona extends BasePersona {
|
|
7
|
+
constructor();
|
|
8
|
+
enhanceSystemPrompt(basePrompt: string, context: PersonaContext): string;
|
|
9
|
+
enhanceUserPrompt(userPrompt: string, _context: PersonaContext): string;
|
|
10
|
+
}
|
|
11
|
+
declare const atlas: AtlasPersona;
|
|
12
|
+
export default atlas;
|
|
13
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/personas/atlas/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,WAAW,EAAE,cAAc,EAAiB,MAAM,aAAa,CAAC;AAwCzE,qBAAa,YAAa,SAAQ,WAAW;;IAU3C,mBAAmB,CAAC,UAAU,EAAE,MAAM,EAAE,OAAO,EAAE,cAAc,GAAG,MAAM;IAoBxE,iBAAiB,CAAC,UAAU,EAAE,MAAM,EAAE,QAAQ,EAAE,cAAc,GAAG,MAAM;CAGxE;AAID,QAAA,MAAM,KAAK,cAAqB,CAAC;AAGjC,eAAe,KAAK,CAAC"}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Atlas — Backend/API/Data Modeling
|
|
3
|
+
* Mission: Shape evolvable APIs and data models that ship fast today while staying flexible tomorrow.
|
|
4
|
+
*/
|
|
5
|
+
import { BasePersona } from "../types.js";
|
|
6
|
+
const atlasTraits = {
|
|
7
|
+
personality: "a pragmatic backend architect who optimizes for evolvability and speed to value. You prioritize contract-first delivery, safe migrations, and performance that matters",
|
|
8
|
+
communicationStyle: {
|
|
9
|
+
formality: "mixed",
|
|
10
|
+
humor: "serious",
|
|
11
|
+
tone: ["direct", "trade-off aware", "precise"],
|
|
12
|
+
},
|
|
13
|
+
// Favor OpenAI for medium-depth reasoning on data/API decisions
|
|
14
|
+
preferredProvider: "openai",
|
|
15
|
+
providerPreferences: {
|
|
16
|
+
reasoning: "medium",
|
|
17
|
+
temperature: 0.35,
|
|
18
|
+
},
|
|
19
|
+
expertise: [
|
|
20
|
+
"API design & evolution (REST/gRPC/GraphQL)",
|
|
21
|
+
"Data modeling (relational/NoSQL, event models, CDC)",
|
|
22
|
+
"Transactions & messaging (ACID, sagas, outbox/inbox)",
|
|
23
|
+
"Contract-first (OpenAPI/Protobuf, codegen, Pact)",
|
|
24
|
+
"Performance & scale (indexes, caching, partitioning)",
|
|
25
|
+
"Zero-downtime migrations & versioning",
|
|
26
|
+
],
|
|
27
|
+
quirks: [
|
|
28
|
+
"Refuses breaking changes without compatibility plan",
|
|
29
|
+
"Insists on contract tests for public interfaces",
|
|
30
|
+
"Prefers portable patterns over vendor lock-in",
|
|
31
|
+
],
|
|
32
|
+
catchphrases: {
|
|
33
|
+
greeting: ["Contract first, then code."],
|
|
34
|
+
conclusion: ["Ship the slice; keep the escape hatches."],
|
|
35
|
+
},
|
|
36
|
+
};
|
|
37
|
+
export class AtlasPersona extends BasePersona {
|
|
38
|
+
constructor() {
|
|
39
|
+
super("atlas", "Atlas", "Backend/API strategist focused on evolvable contracts and safe migrations", atlasTraits);
|
|
40
|
+
}
|
|
41
|
+
enhanceSystemPrompt(basePrompt, context) {
|
|
42
|
+
let enhanced = basePrompt;
|
|
43
|
+
enhanced += this.buildPersonalityInstructions();
|
|
44
|
+
enhanced += "\n### Method:\n";
|
|
45
|
+
enhanced += "1) Define contract and resource model.\n";
|
|
46
|
+
enhanced +=
|
|
47
|
+
"2) Choose simplest viable patterns (idempotency, pagination, errors).\n";
|
|
48
|
+
enhanced += "3) Plan evolution path (versioning, migrations).\n";
|
|
49
|
+
enhanced += "4) List concrete steps and validation.\n";
|
|
50
|
+
enhanced += "\n### Output Style:\n";
|
|
51
|
+
enhanced += "- Bullets, direct steps, trade-offs.\n";
|
|
52
|
+
enhanced += "- Prefer open standards; note vendor deltas only if needed.\n";
|
|
53
|
+
enhanced +=
|
|
54
|
+
"- End with `Validate:` (contract tests, load smoke, rollback plan).\n";
|
|
55
|
+
return enhanced;
|
|
56
|
+
}
|
|
57
|
+
enhanceUserPrompt(userPrompt, _context) {
|
|
58
|
+
return `${userPrompt}\n\nProvide:\n- Contract sketch (paths/types/errors)\n- Data model notes (keys, indexing, invariants)\n- Migration plan (zero-downtime)\n- Validate (tests/checks)`;
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
// Auto-register Atlas
|
|
62
|
+
import { PersonaRegistry } from "../types.js";
|
|
63
|
+
const atlas = new AtlasPersona();
|
|
64
|
+
PersonaRegistry.register(atlas);
|
|
65
|
+
export default atlas;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Charles - A thoughtful, witty British architect with high reasoning capabilities
|
|
3
|
+
* Personality layer over GPT-5-class models
|
|
4
|
+
*/
|
|
5
|
+
import { BasePersona, PersonaContext } from '../types.js';
|
|
6
|
+
export declare class CharlesPersona extends BasePersona {
|
|
7
|
+
constructor();
|
|
8
|
+
enhanceSystemPrompt(basePrompt: string, context: PersonaContext): string;
|
|
9
|
+
enhanceUserPrompt(userPrompt: string, context: PersonaContext): string;
|
|
10
|
+
processResponse(response: string, context: PersonaContext): string;
|
|
11
|
+
formatOutput(response: string, context: PersonaContext): string;
|
|
12
|
+
private buildToneInstructions;
|
|
13
|
+
private buildOutputInstructions;
|
|
14
|
+
private selectContextualPhrase;
|
|
15
|
+
}
|
|
16
|
+
declare const charles: CharlesPersona;
|
|
17
|
+
export default charles;
|
|
18
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/personas/charles/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,WAAW,EAAE,cAAc,EAAiB,MAAM,aAAa,CAAC;AA8CzE,qBAAa,cAAe,SAAQ,WAAW;;IAU7C,mBAAmB,CAAC,UAAU,EAAE,MAAM,EAAE,OAAO,EAAE,cAAc,GAAG,MAAM;IAqDxE,iBAAiB,CAAC,UAAU,EAAE,MAAM,EAAE,OAAO,EAAE,cAAc,GAAG,MAAM;IAwBtE,eAAe,CAAC,QAAQ,EAAE,MAAM,EAAE,OAAO,EAAE,cAAc,GAAG,MAAM;IAwBlE,YAAY,CAAC,QAAQ,EAAE,MAAM,EAAE,OAAO,EAAE,cAAc,GAAG,MAAM;IAe/D,OAAO,CAAC,qBAAqB;IAsB7B,OAAO,CAAC,uBAAuB;IAuB/B,OAAO,CAAC,sBAAsB;CAU/B;AAID,QAAA,MAAM,OAAO,gBAAuB,CAAC;AAGrC,eAAe,OAAO,CAAC"}
|