codingbuddy 2.4.0 → 2.4.2

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 (89) hide show
  1. package/README.md +70 -0
  2. package/dist/src/cli/init/prompts/tech-stack-prompt.d.ts +1 -0
  3. package/dist/src/cli/init/prompts/tech-stack-prompt.js +1 -0
  4. package/dist/src/cli/init/prompts/tech-stack-prompt.js.map +1 -1
  5. package/dist/src/cli/init/prompts/test-strategy-prompt.d.ts +1 -0
  6. package/dist/src/cli/init/prompts/test-strategy-prompt.js +9 -7
  7. package/dist/src/cli/init/prompts/test-strategy-prompt.js.map +1 -1
  8. package/dist/src/keyword/patterns/agent.patterns.d.ts +2 -0
  9. package/dist/src/keyword/patterns/agent.patterns.js +91 -0
  10. package/dist/src/keyword/patterns/agent.patterns.js.map +1 -0
  11. package/dist/src/keyword/patterns/ai-ml.patterns.d.ts +2 -0
  12. package/dist/src/keyword/patterns/ai-ml.patterns.js +81 -0
  13. package/dist/src/keyword/patterns/ai-ml.patterns.js.map +1 -0
  14. package/dist/src/keyword/patterns/backend.patterns.d.ts +2 -0
  15. package/dist/src/keyword/patterns/backend.patterns.js +91 -0
  16. package/dist/src/keyword/patterns/backend.patterns.js.map +1 -0
  17. package/dist/src/keyword/patterns/context.patterns.d.ts +2 -0
  18. package/dist/src/keyword/patterns/context.patterns.js +82 -0
  19. package/dist/src/keyword/patterns/context.patterns.js.map +1 -0
  20. package/dist/src/keyword/patterns/data.patterns.d.ts +2 -0
  21. package/dist/src/keyword/patterns/data.patterns.js +47 -0
  22. package/dist/src/keyword/patterns/data.patterns.js.map +1 -0
  23. package/dist/src/keyword/patterns/explicit.patterns.d.ts +1 -0
  24. package/dist/src/keyword/patterns/explicit.patterns.js +10 -0
  25. package/dist/src/keyword/patterns/explicit.patterns.js.map +1 -0
  26. package/dist/src/keyword/patterns/index.d.ts +12 -0
  27. package/dist/src/keyword/patterns/index.js +26 -0
  28. package/dist/src/keyword/patterns/index.js.map +1 -0
  29. package/dist/src/keyword/patterns/intent-pattern-checks.d.ts +2 -0
  30. package/dist/src/keyword/patterns/intent-pattern-checks.js +48 -0
  31. package/dist/src/keyword/patterns/intent-pattern-checks.js.map +1 -0
  32. package/dist/src/keyword/patterns/intent-patterns.types.d.ts +15 -0
  33. package/dist/src/keyword/patterns/intent-patterns.types.js +3 -0
  34. package/dist/src/keyword/patterns/intent-patterns.types.js.map +1 -0
  35. package/dist/src/keyword/patterns/meta-discussion.patterns.d.ts +1 -0
  36. package/dist/src/keyword/patterns/meta-discussion.patterns.js +11 -0
  37. package/dist/src/keyword/patterns/meta-discussion.patterns.js.map +1 -0
  38. package/dist/src/keyword/patterns/mobile.patterns.d.ts +2 -0
  39. package/dist/src/keyword/patterns/mobile.patterns.js +35 -0
  40. package/dist/src/keyword/patterns/mobile.patterns.js.map +1 -0
  41. package/dist/src/keyword/patterns/platform.patterns.d.ts +2 -0
  42. package/dist/src/keyword/patterns/platform.patterns.js +72 -0
  43. package/dist/src/keyword/patterns/platform.patterns.js.map +1 -0
  44. package/dist/src/keyword/patterns/tooling.patterns.d.ts +2 -0
  45. package/dist/src/keyword/patterns/tooling.patterns.js +78 -0
  46. package/dist/src/keyword/patterns/tooling.patterns.js.map +1 -0
  47. package/dist/src/keyword/primary-agent-resolver.d.ts +6 -32
  48. package/dist/src/keyword/primary-agent-resolver.js +24 -738
  49. package/dist/src/keyword/primary-agent-resolver.js.map +1 -1
  50. package/dist/src/keyword/strategies/__tests__/strategy-test.utils.d.ts +8 -0
  51. package/dist/src/keyword/strategies/__tests__/strategy-test.utils.js +45 -0
  52. package/dist/src/keyword/strategies/__tests__/strategy-test.utils.js.map +1 -0
  53. package/dist/src/keyword/strategies/act-agent.strategy.d.ts +10 -0
  54. package/dist/src/keyword/strategies/act-agent.strategy.js +125 -0
  55. package/dist/src/keyword/strategies/act-agent.strategy.js.map +1 -0
  56. package/dist/src/keyword/strategies/eval-agent.strategy.d.ts +5 -0
  57. package/dist/src/keyword/strategies/eval-agent.strategy.js +19 -0
  58. package/dist/src/keyword/strategies/eval-agent.strategy.js.map +1 -0
  59. package/dist/src/keyword/strategies/index.d.ts +4 -0
  60. package/dist/src/keyword/strategies/index.js +10 -0
  61. package/dist/src/keyword/strategies/index.js.map +1 -0
  62. package/dist/src/keyword/strategies/plan-agent.strategy.d.ts +6 -0
  63. package/dist/src/keyword/strategies/plan-agent.strategy.js +68 -0
  64. package/dist/src/keyword/strategies/plan-agent.strategy.js.map +1 -0
  65. package/dist/src/keyword/strategies/resolution-strategy.interface.d.ts +20 -0
  66. package/dist/src/keyword/strategies/resolution-strategy.interface.js +3 -0
  67. package/dist/src/keyword/strategies/resolution-strategy.interface.js.map +1 -0
  68. package/dist/src/mcp/handlers/config.handler.js +2 -1
  69. package/dist/src/mcp/handlers/config.handler.js.map +1 -1
  70. package/dist/src/mcp/mcp.service.d.ts +4 -0
  71. package/dist/src/mcp/mcp.service.js +35 -2
  72. package/dist/src/mcp/mcp.service.js.map +1 -1
  73. package/dist/src/session/__tests__/session-test.utils.d.ts +5 -0
  74. package/dist/src/session/__tests__/session-test.utils.js +59 -0
  75. package/dist/src/session/__tests__/session-test.utils.js.map +1 -0
  76. package/dist/src/session/session.cache.d.ts +19 -0
  77. package/dist/src/session/session.cache.js +83 -0
  78. package/dist/src/session/session.cache.js.map +1 -0
  79. package/dist/src/session/session.parser.d.ts +22 -0
  80. package/dist/src/session/session.parser.js +273 -0
  81. package/dist/src/session/session.parser.js.map +1 -0
  82. package/dist/src/session/session.serializer.d.ts +6 -0
  83. package/dist/src/session/session.serializer.js +84 -0
  84. package/dist/src/session/session.serializer.js.map +1 -0
  85. package/dist/src/session/session.service.d.ts +1 -12
  86. package/dist/src/session/session.service.js +19 -403
  87. package/dist/src/session/session.service.js.map +1 -1
  88. package/dist/tsconfig.build.tsbuildinfo +1 -1
  89. package/package.json +2 -2
@@ -3,22 +3,40 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.PrimaryAgentResolver = void 0;
4
4
  const common_1 = require("@nestjs/common");
5
5
  const keyword_types_1 = require("./keyword.types");
6
+ const strategies_1 = require("./strategies");
6
7
  class PrimaryAgentResolver {
7
8
  constructor(getProjectConfig, listPrimaryAgents) {
8
9
  this.getProjectConfig = getProjectConfig;
9
10
  this.listPrimaryAgents = listPrimaryAgents;
10
11
  this.logger = new common_1.Logger(PrimaryAgentResolver.name);
12
+ this.evalStrategy = new strategies_1.EvalAgentStrategy();
13
+ this.planStrategy = new strategies_1.PlanAgentStrategy();
14
+ this.actStrategy = new strategies_1.ActAgentStrategy(this.getProjectConfig);
11
15
  }
12
16
  async resolve(mode, prompt, context, recommendedActAgent) {
13
- if (mode === 'EVAL') {
14
- return this.createResult(keyword_types_1.EVAL_PRIMARY_AGENT, 'default', 1.0, 'EVAL mode always uses code-reviewer');
15
- }
16
17
  const allAgents = await this.safeListPrimaryAgents();
17
18
  const availableAgents = await this.filterExcludedAgents(allAgents);
18
- if (mode === 'PLAN') {
19
- return this.resolvePlanAgent(prompt, availableAgents);
19
+ const strategyContext = {
20
+ prompt,
21
+ availableAgents,
22
+ context,
23
+ recommendedActAgent,
24
+ };
25
+ const strategy = this.getStrategy(mode);
26
+ const result = await strategy.resolve(strategyContext);
27
+ this.logger.debug(`[${mode}] Resolved agent: ${result.agentName} (source: ${result.source}, confidence: ${result.confidence})`);
28
+ return result;
29
+ }
30
+ getStrategy(mode) {
31
+ switch (mode) {
32
+ case 'EVAL':
33
+ return this.evalStrategy;
34
+ case 'PLAN':
35
+ return this.planStrategy;
36
+ case 'ACT':
37
+ default:
38
+ return this.actStrategy;
20
39
  }
21
- return this.resolveActAgent(prompt, availableAgents, context, recommendedActAgent);
22
40
  }
23
41
  async filterExcludedAgents(agents) {
24
42
  try {
@@ -37,140 +55,6 @@ class PrimaryAgentResolver {
37
55
  }
38
56
  return agents;
39
57
  }
40
- resolvePlanAgent(prompt, availableAgents) {
41
- const explicit = this.parseExplicitRequest(prompt, availableAgents, Array.from(keyword_types_1.PLAN_PRIMARY_AGENTS));
42
- if (explicit) {
43
- return explicit;
44
- }
45
- const planAgent = this.choosePlanAgent(prompt, availableAgents);
46
- return planAgent;
47
- }
48
- choosePlanAgent(prompt, availableAgents) {
49
- const architecturePatterns = /아키텍처|architecture|시스템\s*설계|system\s*design|구조|structure|API\s*설계|마이크로서비스|microservice|기술\s*선택|technology/i;
50
- const planningPatterns = /계획|plan|단계|step|태스크|task|TDD|구현\s*순서|implementation\s*order|리팩토링|refactor/i;
51
- const hasArchitectureIntent = architecturePatterns.test(prompt);
52
- const hasPlanningIntent = planningPatterns.test(prompt);
53
- if (hasArchitectureIntent && !hasPlanningIntent) {
54
- if (availableAgents.includes('solution-architect')) {
55
- return this.createResult('solution-architect', 'intent', 0.9, 'Architecture-focused task detected in PLAN mode');
56
- }
57
- }
58
- if (hasPlanningIntent && !hasArchitectureIntent) {
59
- if (availableAgents.includes('technical-planner')) {
60
- return this.createResult('technical-planner', 'intent', 0.9, 'Planning/implementation-focused task detected in PLAN mode');
61
- }
62
- }
63
- if (hasArchitectureIntent && hasPlanningIntent) {
64
- if (availableAgents.includes('solution-architect')) {
65
- return this.createResult('solution-architect', 'intent', 0.85, 'Both architecture and planning detected; architecture takes precedence');
66
- }
67
- }
68
- const defaultPlanAgent = availableAgents.includes('solution-architect')
69
- ? 'solution-architect'
70
- : availableAgents.includes('technical-planner')
71
- ? 'technical-planner'
72
- : keyword_types_1.DEFAULT_ACT_AGENT;
73
- return this.createResult(defaultPlanAgent, 'default', 1.0, 'PLAN mode default: solution-architect for high-level design');
74
- }
75
- async resolveActAgent(prompt, availableAgents, context, recommendedActAgent) {
76
- const explicit = this.parseExplicitRequest(prompt, availableAgents, Array.from(keyword_types_1.ACT_PRIMARY_AGENTS));
77
- if (explicit) {
78
- return explicit;
79
- }
80
- if (recommendedActAgent && availableAgents.includes(recommendedActAgent)) {
81
- return this.createResult(recommendedActAgent, 'config', 1.0, `Using recommended agent from PLAN mode: ${recommendedActAgent}`);
82
- }
83
- const fromConfig = await this.getFromProjectConfig(availableAgents);
84
- if (fromConfig) {
85
- return fromConfig;
86
- }
87
- if (this.isMetaAgentDiscussion(prompt)) {
88
- this.logger.debug('Meta-agent discussion detected, skipping intent patterns');
89
- }
90
- else {
91
- for (const { agent, patterns, category, } of PrimaryAgentResolver.INTENT_PATTERN_CHECKS) {
92
- const result = this.inferFromIntentPatterns(prompt, availableAgents, agent, patterns, category);
93
- if (result) {
94
- return result;
95
- }
96
- }
97
- }
98
- if (context) {
99
- const fromContext = this.inferFromContext(context, availableAgents);
100
- if (fromContext && fromContext.confidence >= 0.8) {
101
- return fromContext;
102
- }
103
- }
104
- if (availableAgents.includes(keyword_types_1.DEFAULT_ACT_AGENT)) {
105
- return this.createResult(keyword_types_1.DEFAULT_ACT_AGENT, 'default', 1.0, 'ACT mode default: frontend-developer (no specific intent detected)');
106
- }
107
- if (availableAgents.length > 0) {
108
- return this.createResult(availableAgents[0], 'default', 0.8, `ACT mode fallback: ${availableAgents[0]} (default agent excluded)`);
109
- }
110
- return this.createResult(keyword_types_1.DEFAULT_ACT_AGENT, 'default', 0.5, 'ACT mode fallback: frontend-developer (no agents available)');
111
- }
112
- inferFromIntentPatterns(prompt, availableAgents, targetAgent, patterns, patternCategory) {
113
- if (!availableAgents.includes(targetAgent)) {
114
- return null;
115
- }
116
- for (const { pattern, confidence, description } of patterns) {
117
- if (pattern.test(prompt)) {
118
- return this.createResult(targetAgent, 'intent', confidence, `${patternCategory} pattern detected: ${description}`);
119
- }
120
- }
121
- return null;
122
- }
123
- parseExplicitRequest(prompt, availableAgents, allowedAgents) {
124
- for (const pattern of PrimaryAgentResolver.EXPLICIT_PATTERNS) {
125
- const match = prompt.match(pattern);
126
- if (match?.[1]) {
127
- const agentName = match[1].toLowerCase();
128
- const isAvailable = availableAgents.includes(agentName);
129
- const isAllowed = !allowedAgents || allowedAgents.includes(agentName);
130
- if (isAvailable && isAllowed) {
131
- return this.createResult(agentName, 'explicit', 1.0, `Explicit request for ${agentName} in prompt`);
132
- }
133
- }
134
- }
135
- return null;
136
- }
137
- async getFromProjectConfig(availableAgents) {
138
- try {
139
- const config = await this.getProjectConfig();
140
- if (config?.primaryAgent) {
141
- const agentName = config.primaryAgent.toLowerCase();
142
- if (availableAgents.includes(agentName)) {
143
- return this.createResult(agentName, 'config', 1.0, `Configured in project: ${agentName}`);
144
- }
145
- this.logger.warn(`Configured agent '${config.primaryAgent}' not found in registry. ` +
146
- `Available: ${availableAgents.join(', ')}`);
147
- }
148
- }
149
- catch (error) {
150
- this.logger.warn(`Failed to load project config for agent resolution: ${error instanceof Error ? error.message : 'Unknown error'}`);
151
- }
152
- return null;
153
- }
154
- inferFromContext(context, availableAgents) {
155
- if (context.filePath) {
156
- for (const { pattern, agent, confidence, } of PrimaryAgentResolver.CONTEXT_PATTERNS) {
157
- if (pattern.test(context.filePath)) {
158
- if (availableAgents.includes(agent)) {
159
- return this.createResult(agent, 'context', confidence, `Inferred from file path: ${context.filePath}`);
160
- }
161
- }
162
- }
163
- }
164
- if (context.projectType === 'infrastructure') {
165
- if (availableAgents.includes('devops-engineer')) {
166
- return this.createResult('devops-engineer', 'context', 0.85, `Inferred from project type: ${context.projectType}`);
167
- }
168
- }
169
- return null;
170
- }
171
- isMetaAgentDiscussion(prompt) {
172
- return PrimaryAgentResolver.META_AGENT_DISCUSSION_PATTERNS.some(pattern => pattern.test(prompt));
173
- }
174
58
  async safeListPrimaryAgents() {
175
59
  try {
176
60
  const agents = await this.listPrimaryAgents();
@@ -186,604 +70,6 @@ class PrimaryAgentResolver {
186
70
  return [...keyword_types_1.ALL_PRIMARY_AGENTS];
187
71
  }
188
72
  }
189
- createResult(agentName, source, confidence, reason) {
190
- return { agentName, source, confidence, reason };
191
- }
192
73
  }
193
74
  exports.PrimaryAgentResolver = PrimaryAgentResolver;
194
- PrimaryAgentResolver.EXPLICIT_PATTERNS = [
195
- /(\w+-\w+)(?:로|으로)\s*(?:작업|개발|해)/i,
196
- /(?:use|using)\s+(\w+-\w+)(?:\s+agent)?/i,
197
- /as\s+(\w+-\w+)/i,
198
- /(\w+-\w+)\s+agent(?:로|으로)/i,
199
- ];
200
- PrimaryAgentResolver.DATA_INTENT_PATTERNS = [
201
- {
202
- pattern: /schema\.prisma/i,
203
- confidence: 0.95,
204
- description: 'Prisma schema',
205
- },
206
- {
207
- pattern: /migration/i,
208
- confidence: 0.9,
209
- description: 'Database migration',
210
- },
211
- { pattern: /\.sql$/i, confidence: 0.9, description: 'SQL file' },
212
- {
213
- pattern: /database|데이터베이스|DB\s*(설계|스키마|마이그레이션)/i,
214
- confidence: 0.9,
215
- description: 'Database design',
216
- },
217
- {
218
- pattern: /스키마|schema\s*design/i,
219
- confidence: 0.9,
220
- description: 'Schema design',
221
- },
222
- {
223
- pattern: /ERD|entity.?relationship/i,
224
- confidence: 0.9,
225
- description: 'ERD design',
226
- },
227
- {
228
- pattern: /쿼리\s*최적화|query\s*optim/i,
229
- confidence: 0.85,
230
- description: 'Query optimization',
231
- },
232
- {
233
- pattern: /인덱스|index(ing)?/i,
234
- confidence: 0.85,
235
- description: 'Indexing',
236
- },
237
- {
238
- pattern: /정규화|normaliz/i,
239
- confidence: 0.85,
240
- description: 'Normalization',
241
- },
242
- ];
243
- PrimaryAgentResolver.MOBILE_INTENT_PATTERNS = [
244
- {
245
- pattern: /react.?native/i,
246
- confidence: 0.95,
247
- description: 'React Native',
248
- },
249
- { pattern: /flutter/i, confidence: 0.95, description: 'Flutter' },
250
- { pattern: /expo/i, confidence: 0.9, description: 'Expo' },
251
- { pattern: /swiftui/i, confidence: 0.95, description: 'SwiftUI' },
252
- {
253
- pattern: /jetpack\s*compose/i,
254
- confidence: 0.95,
255
- description: 'Jetpack Compose',
256
- },
257
- {
258
- pattern: /모바일\s*(앱|개발|화면)/i,
259
- confidence: 0.9,
260
- description: 'Korean: mobile app',
261
- },
262
- {
263
- pattern: /mobile\s*(app|develop|screen)/i,
264
- confidence: 0.9,
265
- description: 'Mobile app',
266
- },
267
- { pattern: /iOS\s*(앱|개발)/i, confidence: 0.9, description: 'iOS app' },
268
- {
269
- pattern: /android\s*(앱|개발)/i,
270
- confidence: 0.9,
271
- description: 'Android app',
272
- },
273
- ];
274
- PrimaryAgentResolver.TOOLING_INTENT_PATTERNS = [
275
- {
276
- pattern: /codingbuddy\.config/i,
277
- confidence: 0.98,
278
- description: 'CodingBuddy config',
279
- },
280
- {
281
- pattern: /tsconfig.*\.json/i,
282
- confidence: 0.95,
283
- description: 'TypeScript config',
284
- },
285
- { pattern: /eslint/i, confidence: 0.95, description: 'ESLint config' },
286
- {
287
- pattern: /prettier/i,
288
- confidence: 0.95,
289
- description: 'Prettier config',
290
- },
291
- {
292
- pattern: /stylelint/i,
293
- confidence: 0.95,
294
- description: 'Stylelint config',
295
- },
296
- {
297
- pattern: /vite\.config/i,
298
- confidence: 0.95,
299
- description: 'Vite config',
300
- },
301
- {
302
- pattern: /next\.config/i,
303
- confidence: 0.95,
304
- description: 'Next.js config',
305
- },
306
- { pattern: /webpack/i, confidence: 0.9, description: 'Webpack config' },
307
- {
308
- pattern: /rollup\.config/i,
309
- confidence: 0.9,
310
- description: 'Rollup config',
311
- },
312
- {
313
- pattern: /package\.json/i,
314
- confidence: 0.9,
315
- description: 'Package.json',
316
- },
317
- {
318
- pattern: /yarn\.lock|pnpm-lock|package-lock/i,
319
- confidence: 0.85,
320
- description: 'Lock files',
321
- },
322
- {
323
- pattern: /\.config\.(js|ts|mjs|cjs|json)$/i,
324
- confidence: 0.85,
325
- description: 'Config file extension',
326
- },
327
- {
328
- pattern: /설정\s*(파일|변경|수정)/i,
329
- confidence: 0.85,
330
- description: 'Korean: config file',
331
- },
332
- {
333
- pattern: /빌드\s*(설정|도구|환경)/i,
334
- confidence: 0.85,
335
- description: 'Korean: build config',
336
- },
337
- {
338
- pattern: /패키지\s*(관리|설치|업데이트|의존성)/i,
339
- confidence: 0.85,
340
- description: 'Korean: package management',
341
- },
342
- {
343
- pattern: /린터|린트\s*설정/i,
344
- confidence: 0.85,
345
- description: 'Korean: linter config',
346
- },
347
- ];
348
- PrimaryAgentResolver.PLATFORM_INTENT_PATTERNS = [
349
- { pattern: /terraform/i, confidence: 0.95, description: 'Terraform' },
350
- { pattern: /pulumi/i, confidence: 0.95, description: 'Pulumi' },
351
- { pattern: /aws.?cdk/i, confidence: 0.95, description: 'AWS CDK' },
352
- { pattern: /helm/i, confidence: 0.95, description: 'Helm chart' },
353
- {
354
- pattern: /argocd|argo.?cd/i,
355
- confidence: 0.95,
356
- description: 'Argo CD',
357
- },
358
- { pattern: /flux.?cd|fluxcd/i, confidence: 0.95, description: 'Flux CD' },
359
- {
360
- pattern: /kubernetes|k8s/i,
361
- confidence: 0.9,
362
- description: 'Kubernetes',
363
- },
364
- {
365
- pattern: /kustomize|kustomization/i,
366
- confidence: 0.95,
367
- description: 'Kustomize',
368
- },
369
- {
370
- pattern: /kubectl|kubeconfig/i,
371
- confidence: 0.9,
372
- description: 'Kubectl',
373
- },
374
- {
375
- pattern: /k8s.*manifest|manifest.*k8s|kubernetes.*manifest/i,
376
- confidence: 0.9,
377
- description: 'K8s manifest',
378
- },
379
- {
380
- pattern: /EKS|GKE|AKS/i,
381
- confidence: 0.9,
382
- description: 'Managed Kubernetes',
383
- },
384
- {
385
- pattern: /IRSA|workload.?identity/i,
386
- confidence: 0.9,
387
- description: 'Workload identity',
388
- },
389
- {
390
- pattern: /인프라\s*(코드|설정|관리|자동화)/i,
391
- confidence: 0.85,
392
- description: 'Korean: infrastructure',
393
- },
394
- {
395
- pattern: /infrastructure.?as.?code|IaC/i,
396
- confidence: 0.9,
397
- description: 'Infrastructure as Code',
398
- },
399
- { pattern: /gitops/i, confidence: 0.9, description: 'GitOps' },
400
- {
401
- pattern: /multi.?cloud|hybrid.?cloud/i,
402
- confidence: 0.85,
403
- description: 'Multi-cloud',
404
- },
405
- {
406
- pattern: /finops|cloud.?cost|비용\s*최적화/i,
407
- confidence: 0.85,
408
- description: 'Cloud cost optimization',
409
- },
410
- {
411
- pattern: /disaster.?recovery|RTO|RPO/i,
412
- confidence: 0.85,
413
- description: 'Disaster recovery',
414
- },
415
- ];
416
- PrimaryAgentResolver.AI_ML_INTENT_PATTERNS = [
417
- {
418
- pattern: /pytorch|tensorflow|keras|jax/i,
419
- confidence: 0.95,
420
- description: 'ML Framework',
421
- },
422
- {
423
- pattern: /hugging\s*face|transformers|diffusers/i,
424
- confidence: 0.95,
425
- description: 'HuggingFace',
426
- },
427
- {
428
- pattern: /langchain|llama.?index|llamaindex/i,
429
- confidence: 0.95,
430
- description: 'LLM Framework',
431
- },
432
- {
433
- pattern: /openai\s*(api|sdk)|anthropic\s*(api|sdk)/i,
434
- confidence: 0.95,
435
- description: 'LLM API',
436
- },
437
- {
438
- pattern: /machine\s*learning|ML\s*(모델|model|파이프라인|pipeline)/i,
439
- confidence: 0.9,
440
- description: 'Machine Learning',
441
- },
442
- {
443
- pattern: /딥\s*러닝|deep\s*learning|신경망|neural\s*network/i,
444
- confidence: 0.9,
445
- description: 'Deep Learning',
446
- },
447
- {
448
- pattern: /모델\s*학습|train.*model|fine.?tun|파인\s*튜닝/i,
449
- confidence: 0.9,
450
- description: 'Model Training',
451
- },
452
- {
453
- pattern: /RAG|retrieval.*augment|검색\s*증강/i,
454
- confidence: 0.9,
455
- description: 'RAG',
456
- },
457
- {
458
- pattern: /프롬프트\s*엔지니어링|prompt\s*engineer/i,
459
- confidence: 0.9,
460
- description: 'Prompt Engineering',
461
- },
462
- {
463
- pattern: /LLM\s*(개발|develop|구현|implement|통합|integrat)/i,
464
- confidence: 0.9,
465
- description: 'LLM Development',
466
- },
467
- {
468
- pattern: /임베딩|embedding|벡터\s*(DB|database|저장)/i,
469
- confidence: 0.85,
470
- description: 'Embeddings',
471
- },
472
- {
473
- pattern: /추론|inference|predict|예측\s*모델/i,
474
- confidence: 0.85,
475
- description: 'Inference',
476
- },
477
- {
478
- pattern: /AI\s*(모델|model|에이전트|agent|챗봇|chatbot)/i,
479
- confidence: 0.85,
480
- description: 'AI Model/Agent',
481
- },
482
- {
483
- pattern: /자연어\s*처리|NLP|텍스트\s*분석/i,
484
- confidence: 0.85,
485
- description: 'NLP',
486
- },
487
- {
488
- pattern: /컴퓨터\s*비전|computer\s*vision|이미지\s*인식/i,
489
- confidence: 0.85,
490
- description: 'Computer Vision',
491
- },
492
- ];
493
- PrimaryAgentResolver.BACKEND_INTENT_PATTERNS = [
494
- {
495
- pattern: /nestjs|nest\.js/i,
496
- confidence: 0.95,
497
- description: 'NestJS',
498
- },
499
- {
500
- pattern: /express\.js|express\s+서버|express\s+server/i,
501
- confidence: 0.95,
502
- description: 'Express',
503
- },
504
- {
505
- pattern: /fastify|koa\.js|hapi/i,
506
- confidence: 0.95,
507
- description: 'Node.js Framework',
508
- },
509
- {
510
- pattern: /django|flask|fastapi/i,
511
- confidence: 0.95,
512
- description: 'Python Framework',
513
- },
514
- {
515
- pattern: /spring\s*boot|spring\s*framework/i,
516
- confidence: 0.95,
517
- description: 'Spring Boot',
518
- },
519
- {
520
- pattern: /gin|echo|fiber/i,
521
- confidence: 0.9,
522
- description: 'Go Framework',
523
- },
524
- {
525
- pattern: /rails|ruby\s+on\s+rails/i,
526
- confidence: 0.95,
527
- description: 'Ruby on Rails',
528
- },
529
- {
530
- pattern: /REST\s*API|RESTful/i,
531
- confidence: 0.9,
532
- description: 'REST API',
533
- },
534
- {
535
- pattern: /GraphQL\s*(API|서버|server|스키마|schema)/i,
536
- confidence: 0.9,
537
- description: 'GraphQL',
538
- },
539
- {
540
- pattern: /gRPC|protobuf/i,
541
- confidence: 0.9,
542
- description: 'gRPC',
543
- },
544
- {
545
- pattern: /API\s*(설계|개발|구현|design|develop|implement)/i,
546
- confidence: 0.9,
547
- description: 'API Development',
548
- },
549
- {
550
- pattern: /서버\s*(개발|구현|로직)|server.?side\s*(logic|develop)/i,
551
- confidence: 0.85,
552
- description: 'Server Development',
553
- },
554
- {
555
- pattern: /백엔드\s*(개발|구현|로직)|backend\s*(develop|logic|implement)/i,
556
- confidence: 0.85,
557
- description: 'Backend Development',
558
- },
559
- {
560
- pattern: /미들웨어|middleware/i,
561
- confidence: 0.85,
562
- description: 'Middleware',
563
- },
564
- {
565
- pattern: /인증\s*서버|auth.*server|OAuth\s*서버/i,
566
- confidence: 0.85,
567
- description: 'Auth Server',
568
- },
569
- {
570
- pattern: /웹소켓|websocket|socket\.io/i,
571
- confidence: 0.85,
572
- description: 'WebSocket',
573
- },
574
- {
575
- pattern: /마이크로서비스|microservice/i,
576
- confidence: 0.85,
577
- description: 'Microservice',
578
- },
579
- ];
580
- PrimaryAgentResolver.AGENT_INTENT_PATTERNS = [
581
- {
582
- pattern: /MCP\s*(서버|server|tool|도구)/i,
583
- confidence: 0.95,
584
- description: 'MCP Server',
585
- },
586
- {
587
- pattern: /model\s*context\s*protocol/i,
588
- confidence: 0.95,
589
- description: 'Model Context Protocol',
590
- },
591
- {
592
- pattern: /에이전트\s*(설계|개발|구현|아키텍처)/i,
593
- confidence: 0.95,
594
- description: 'Korean: Agent Development',
595
- },
596
- {
597
- pattern: /agent\s*(design|develop|architect|framework)/i,
598
- confidence: 0.95,
599
- description: 'Agent Development',
600
- },
601
- {
602
- pattern: /claude\s*(code|에이전트|agent|sdk)/i,
603
- confidence: 0.95,
604
- description: 'Claude Agent',
605
- },
606
- {
607
- pattern: /agent.?를?\s*만[들드]/i,
608
- confidence: 0.9,
609
- description: 'Korean: Creating Agent (with English)',
610
- },
611
- {
612
- pattern: /에이전트\s*만[들드]/i,
613
- confidence: 0.9,
614
- description: 'Korean: Creating Agent (native)',
615
- },
616
- {
617
- pattern: /\.json\s*(에이전트|agent)|agent.*\.json/i,
618
- confidence: 0.9,
619
- description: 'Agent JSON Definition',
620
- },
621
- {
622
- pattern: /specialist.*agent|agent.*specialist/i,
623
- confidence: 0.9,
624
- description: 'Specialist Agent',
625
- },
626
- {
627
- pattern: /primary.*agent|agent.*resolver|agent.*select/i,
628
- confidence: 0.9,
629
- description: 'Agent Resolution',
630
- },
631
- {
632
- pattern: /워크플로우\s*(자동화|설계|구현)/i,
633
- confidence: 0.9,
634
- description: 'Korean: Workflow Automation',
635
- },
636
- {
637
- pattern: /workflow\s*(automat|design|orchestrat)/i,
638
- confidence: 0.9,
639
- description: 'Workflow Automation',
640
- },
641
- {
642
- pattern: /LLM\s*(체인|chain|오케스트레이션|orchestrat)/i,
643
- confidence: 0.9,
644
- description: 'LLM Orchestration',
645
- },
646
- {
647
- pattern: /AI\s*에이전트\s*(설계|개발)|AI\s*agent\s*(design|develop)/i,
648
- confidence: 0.9,
649
- description: 'AI Agent Design',
650
- },
651
- {
652
- pattern: /자동화\s*(파이프라인|pipeline|시스템)/i,
653
- confidence: 0.85,
654
- description: 'Automation Pipeline',
655
- },
656
- {
657
- pattern: /tool\s*(use|calling|호출)|function\s*calling/i,
658
- confidence: 0.85,
659
- description: 'Tool Calling',
660
- },
661
- {
662
- pattern: /멀티\s*에이전트|multi.?agent/i,
663
- confidence: 0.85,
664
- description: 'Multi-Agent',
665
- },
666
- ];
667
- PrimaryAgentResolver.INTENT_PATTERN_CHECKS = [
668
- {
669
- agent: 'agent-architect',
670
- patterns: PrimaryAgentResolver.AGENT_INTENT_PATTERNS,
671
- category: 'Agent',
672
- },
673
- {
674
- agent: 'tooling-engineer',
675
- patterns: PrimaryAgentResolver.TOOLING_INTENT_PATTERNS,
676
- category: 'Tooling',
677
- },
678
- {
679
- agent: 'platform-engineer',
680
- patterns: PrimaryAgentResolver.PLATFORM_INTENT_PATTERNS,
681
- category: 'Platform',
682
- },
683
- {
684
- agent: 'data-engineer',
685
- patterns: PrimaryAgentResolver.DATA_INTENT_PATTERNS,
686
- category: 'Data',
687
- },
688
- {
689
- agent: 'ai-ml-engineer',
690
- patterns: PrimaryAgentResolver.AI_ML_INTENT_PATTERNS,
691
- category: 'AI/ML',
692
- },
693
- {
694
- agent: 'backend-developer',
695
- patterns: PrimaryAgentResolver.BACKEND_INTENT_PATTERNS,
696
- category: 'Backend',
697
- },
698
- {
699
- agent: 'mobile-developer',
700
- patterns: PrimaryAgentResolver.MOBILE_INTENT_PATTERNS,
701
- category: 'Mobile',
702
- },
703
- ];
704
- PrimaryAgentResolver.META_AGENT_DISCUSSION_PATTERNS = [
705
- /(?:mobile|frontend|backend|data|platform|devops|ai-?ml).?(?:developer|engineer)\s*(?:가|이|를|은|는|로|에|의|와|과)/i,
706
- /(?:agent|에이전트)\s*(?:매칭|호출|선택|resolution|matching|selection|추천|recommendation)/i,
707
- /primary\s*agent\s*(?:선택|매칭|시스템|system)/i,
708
- /(?:agent|에이전트)\s*(?:활성화|activation|호출|invocation|파이프라인|pipeline)/i,
709
- /(?:agent|에이전트).{0,20}(?:버그|bug|문제|issue|오류|error|잘못|wrong)/i,
710
- ];
711
- PrimaryAgentResolver.CONTEXT_PATTERNS = [
712
- {
713
- pattern: /react-native\.config\.js$/i,
714
- agent: 'mobile-developer',
715
- confidence: 0.95,
716
- },
717
- {
718
- pattern: /metro\.config\.js$/i,
719
- agent: 'mobile-developer',
720
- confidence: 0.95,
721
- },
722
- { pattern: /app\.json$/i, agent: 'mobile-developer', confidence: 0.85 },
723
- { pattern: /pubspec\.yaml$/i, agent: 'mobile-developer', confidence: 0.95 },
724
- { pattern: /\.dart$/i, agent: 'mobile-developer', confidence: 0.9 },
725
- { pattern: /Podfile$/i, agent: 'mobile-developer', confidence: 0.9 },
726
- { pattern: /\.swift$/i, agent: 'mobile-developer', confidence: 0.9 },
727
- {
728
- pattern: /build\.gradle(\.kts)?$/i,
729
- agent: 'mobile-developer',
730
- confidence: 0.85,
731
- },
732
- {
733
- pattern: /AndroidManifest\.xml$/i,
734
- agent: 'mobile-developer',
735
- confidence: 0.9,
736
- },
737
- { pattern: /\.kt$/i, agent: 'mobile-developer', confidence: 0.85 },
738
- { pattern: /\.sql$/i, agent: 'data-engineer', confidence: 0.9 },
739
- { pattern: /schema\.prisma$/i, agent: 'data-engineer', confidence: 0.95 },
740
- { pattern: /migrations?\//i, agent: 'data-engineer', confidence: 0.9 },
741
- { pattern: /\.entity\.ts$/i, agent: 'data-engineer', confidence: 0.85 },
742
- { pattern: /\.tf$/i, agent: 'platform-engineer', confidence: 0.95 },
743
- { pattern: /\.tfvars$/i, agent: 'platform-engineer', confidence: 0.95 },
744
- {
745
- pattern: /terragrunt\.hcl$/i,
746
- agent: 'platform-engineer',
747
- confidence: 0.95,
748
- },
749
- { pattern: /Chart\.yaml$/i, agent: 'platform-engineer', confidence: 0.95 },
750
- { pattern: /values\.yaml$/i, agent: 'platform-engineer', confidence: 0.75 },
751
- {
752
- pattern: /helm.*templates\/|charts\/.*templates\//i,
753
- agent: 'platform-engineer',
754
- confidence: 0.9,
755
- },
756
- {
757
- pattern: /kustomization\.ya?ml$/i,
758
- agent: 'platform-engineer',
759
- confidence: 0.95,
760
- },
761
- {
762
- pattern: /Pulumi\.ya?ml$/i,
763
- agent: 'platform-engineer',
764
- confidence: 0.95,
765
- },
766
- {
767
- pattern: /argocd\/|argo-cd\//i,
768
- agent: 'platform-engineer',
769
- confidence: 0.9,
770
- },
771
- {
772
- pattern: /flux-system\//i,
773
- agent: 'platform-engineer',
774
- confidence: 0.9,
775
- },
776
- {
777
- pattern: /Dockerfile|docker-compose/i,
778
- agent: 'devops-engineer',
779
- confidence: 0.9,
780
- },
781
- { pattern: /\.go$/i, agent: 'backend-developer', confidence: 0.85 },
782
- { pattern: /\.py$/i, agent: 'backend-developer', confidence: 0.85 },
783
- { pattern: /\.java$/i, agent: 'backend-developer', confidence: 0.85 },
784
- { pattern: /\.rs$/i, agent: 'backend-developer', confidence: 0.85 },
785
- { pattern: /\.tsx?$/i, agent: 'frontend-developer', confidence: 0.7 },
786
- { pattern: /\.jsx?$/i, agent: 'frontend-developer', confidence: 0.7 },
787
- { pattern: /agents?.*\.json$/i, agent: 'agent-architect', confidence: 0.8 },
788
- ];
789
75
  //# sourceMappingURL=primary-agent-resolver.js.map