codingbuddy 4.4.0 → 5.0.0
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/dist/src/agent/agent.module.js +3 -1
- package/dist/src/agent/agent.module.js.map +1 -1
- package/dist/src/agent/agent.service.d.ts +13 -4
- package/dist/src/agent/agent.service.js +125 -12
- package/dist/src/agent/agent.service.js.map +1 -1
- package/dist/src/agent/agent.types.d.ts +53 -0
- package/dist/src/agent/agent.types.js.map +1 -1
- package/dist/src/collaboration/discussion-engine.d.ts +14 -0
- package/dist/src/collaboration/discussion-engine.js +49 -0
- package/dist/src/collaboration/discussion-engine.js.map +1 -0
- package/dist/src/collaboration/index.d.ts +5 -0
- package/dist/src/collaboration/index.js +22 -0
- package/dist/src/collaboration/index.js.map +1 -0
- package/dist/src/collaboration/opinion-adapter.d.ts +14 -0
- package/dist/src/collaboration/opinion-adapter.js +56 -0
- package/dist/src/collaboration/opinion-adapter.js.map +1 -0
- package/dist/src/collaboration/terminal-formatter.d.ts +5 -0
- package/dist/src/collaboration/terminal-formatter.js +57 -0
- package/dist/src/collaboration/terminal-formatter.js.map +1 -0
- package/dist/src/collaboration/types.d.ts +50 -0
- package/dist/src/collaboration/types.js +53 -0
- package/dist/src/collaboration/types.js.map +1 -0
- package/dist/src/config/config.schema.d.ts +8 -0
- package/dist/src/config/config.schema.js +4 -0
- package/dist/src/config/config.schema.js.map +1 -1
- package/dist/src/context/context-document.service.d.ts +1 -1
- package/dist/src/context/context-document.service.js +6 -2
- package/dist/src/context/context-document.service.js.map +1 -1
- package/dist/src/context/context-document.types.d.ts +18 -0
- package/dist/src/context/context-document.types.js +13 -1
- package/dist/src/context/context-document.types.js.map +1 -1
- package/dist/src/context/context-parser.utils.js +32 -0
- package/dist/src/context/context-parser.utils.js.map +1 -1
- package/dist/src/context/context-serializer.utils.d.ts +3 -2
- package/dist/src/context/context-serializer.utils.js +25 -1
- package/dist/src/context/context-serializer.utils.js.map +1 -1
- package/dist/src/keyword/explicit-pattern-matcher.d.ts +3 -0
- package/dist/src/keyword/explicit-pattern-matcher.js +34 -0
- package/dist/src/keyword/explicit-pattern-matcher.js.map +1 -0
- package/dist/src/keyword/keyword.module.js +17 -1
- package/dist/src/keyword/keyword.module.js.map +1 -1
- package/dist/src/keyword/keyword.service.d.ts +2 -0
- package/dist/src/keyword/keyword.service.js +15 -0
- package/dist/src/keyword/keyword.service.js.map +1 -1
- package/dist/src/keyword/keyword.types.d.ts +6 -1
- package/dist/src/keyword/keyword.types.js +7 -1
- package/dist/src/keyword/keyword.types.js.map +1 -1
- package/dist/src/keyword/primary-agent-resolver.d.ts +5 -2
- package/dist/src/keyword/primary-agent-resolver.js +22 -1
- package/dist/src/keyword/primary-agent-resolver.js.map +1 -1
- package/dist/src/keyword/strategies/act-agent.strategy.js +8 -0
- package/dist/src/keyword/strategies/act-agent.strategy.js.map +1 -1
- package/dist/src/keyword/strategies/index.d.ts +1 -1
- package/dist/src/keyword/strategies/index.js.map +1 -1
- package/dist/src/keyword/strategies/resolution-strategy.interface.d.ts +3 -0
- package/dist/src/keyword/taskmaestro-detector.d.ts +1 -0
- package/dist/src/keyword/taskmaestro-detector.js +16 -0
- package/dist/src/keyword/taskmaestro-detector.js.map +1 -0
- package/dist/src/mcp/handlers/agent.handler.d.ts +1 -0
- package/dist/src/mcp/handlers/agent.handler.js +51 -2
- package/dist/src/mcp/handlers/agent.handler.js.map +1 -1
- package/dist/src/mcp/handlers/context-document.handler.d.ts +3 -0
- package/dist/src/mcp/handlers/context-document.handler.js +91 -10
- package/dist/src/mcp/handlers/context-document.handler.js.map +1 -1
- package/dist/src/mcp/handlers/discussion.handler.d.ts +14 -0
- package/dist/src/mcp/handlers/discussion.handler.js +168 -0
- package/dist/src/mcp/handlers/discussion.handler.js.map +1 -0
- package/dist/src/mcp/handlers/discussion.types.d.ts +18 -0
- package/dist/src/mcp/handlers/discussion.types.js +11 -0
- package/dist/src/mcp/handlers/discussion.types.js.map +1 -0
- package/dist/src/mcp/handlers/index.d.ts +3 -0
- package/dist/src/mcp/handlers/index.js +7 -1
- package/dist/src/mcp/handlers/index.js.map +1 -1
- package/dist/src/mcp/handlers/mode.handler.d.ts +3 -0
- package/dist/src/mcp/handlers/mode.handler.js +58 -0
- package/dist/src/mcp/handlers/mode.handler.js.map +1 -1
- package/dist/src/mcp/handlers/pipeline.handler.d.ts +14 -0
- package/dist/src/mcp/handlers/pipeline.handler.js +137 -0
- package/dist/src/mcp/handlers/pipeline.handler.js.map +1 -0
- package/dist/src/mcp/mcp.module.js +5 -0
- package/dist/src/mcp/mcp.module.js.map +1 -1
- package/dist/src/mcp/sse-auth.guard.js +4 -6
- package/dist/src/mcp/sse-auth.guard.js.map +1 -1
- package/dist/src/parallel-validation/extract-file-paths.d.ts +1 -0
- package/dist/src/parallel-validation/extract-file-paths.js +19 -0
- package/dist/src/parallel-validation/extract-file-paths.js.map +1 -0
- package/dist/src/parallel-validation/index.d.ts +5 -0
- package/dist/src/parallel-validation/index.js +12 -0
- package/dist/src/parallel-validation/index.js.map +1 -0
- package/dist/src/parallel-validation/overlap-matrix.d.ts +10 -0
- package/dist/src/parallel-validation/overlap-matrix.js +23 -0
- package/dist/src/parallel-validation/overlap-matrix.js.map +1 -0
- package/dist/src/parallel-validation/parallel-validation.handler.d.ts +8 -0
- package/dist/src/parallel-validation/parallel-validation.handler.js +84 -0
- package/dist/src/parallel-validation/parallel-validation.handler.js.map +1 -0
- package/dist/src/parallel-validation/parallel-validation.types.d.ts +12 -0
- package/dist/src/parallel-validation/parallel-validation.types.js +3 -0
- package/dist/src/parallel-validation/parallel-validation.types.js.map +1 -0
- package/dist/src/parallel-validation/wave-splitter.d.ts +2 -0
- package/dist/src/parallel-validation/wave-splitter.js +39 -0
- package/dist/src/parallel-validation/wave-splitter.js.map +1 -0
- package/dist/src/pipeline/index.d.ts +5 -0
- package/dist/src/pipeline/index.js +14 -0
- package/dist/src/pipeline/index.js.map +1 -0
- package/dist/src/pipeline/pipeline.executors.d.ts +2 -0
- package/dist/src/pipeline/pipeline.executors.js +79 -0
- package/dist/src/pipeline/pipeline.executors.js.map +1 -0
- package/dist/src/pipeline/pipeline.module.d.ts +2 -0
- package/dist/src/pipeline/pipeline.module.js +21 -0
- package/dist/src/pipeline/pipeline.module.js.map +1 -0
- package/dist/src/pipeline/pipeline.service.d.ts +8 -0
- package/dist/src/pipeline/pipeline.service.js +89 -0
- package/dist/src/pipeline/pipeline.service.js.map +1 -0
- package/dist/src/pipeline/pipeline.types.d.ts +47 -0
- package/dist/src/pipeline/pipeline.types.js +33 -0
- package/dist/src/pipeline/pipeline.types.js.map +1 -0
- package/dist/src/rules/rule-tracker.d.ts +24 -0
- package/dist/src/rules/rule-tracker.js +74 -0
- package/dist/src/rules/rule-tracker.js.map +1 -0
- package/dist/src/shared/event-bridge-reader.d.ts +17 -0
- package/dist/src/shared/event-bridge-reader.js +56 -0
- package/dist/src/shared/event-bridge-reader.js.map +1 -0
- package/dist/src/shared/version.d.ts +1 -1
- package/dist/src/shared/version.js +1 -1
- package/dist/src/tui/components/AgentDiscussionPanel.d.ts +8 -0
- package/dist/src/tui/components/AgentDiscussionPanel.js +21 -0
- package/dist/src/tui/components/AgentDiscussionPanel.js.map +1 -0
- package/dist/src/tui/components/AgentDiscussionPanel.spec.js +85 -0
- package/dist/src/tui/components/AgentDiscussionPanel.spec.js.map +1 -0
- package/dist/src/tui/components/FlowMap.d.ts +3 -1
- package/dist/src/tui/components/FlowMap.js +30 -3
- package/dist/src/tui/components/FlowMap.js.map +1 -1
- package/dist/src/tui/components/FlowMap.spec.js +88 -0
- package/dist/src/tui/components/FlowMap.spec.js.map +1 -1
- package/dist/src/tui/components/FocusedAgentPanel.d.ts +3 -1
- package/dist/src/tui/components/FocusedAgentPanel.js +8 -3
- package/dist/src/tui/components/FocusedAgentPanel.js.map +1 -1
- package/dist/src/tui/components/FocusedAgentPanel.spec.js +76 -0
- package/dist/src/tui/components/FocusedAgentPanel.spec.js.map +1 -1
- package/dist/src/tui/components/HeaderBar.d.ts +3 -1
- package/dist/src/tui/components/HeaderBar.js +12 -6
- package/dist/src/tui/components/HeaderBar.js.map +1 -1
- package/dist/src/tui/components/HeaderBar.spec.js +31 -13
- package/dist/src/tui/components/HeaderBar.spec.js.map +1 -1
- package/dist/src/tui/components/StageHealthBar.d.ts +5 -1
- package/dist/src/tui/components/StageHealthBar.js +6 -1
- package/dist/src/tui/components/StageHealthBar.js.map +1 -1
- package/dist/src/tui/components/StageHealthBar.spec.js +22 -0
- package/dist/src/tui/components/StageHealthBar.spec.js.map +1 -1
- package/dist/src/tui/components/agent-discussion-panel.pure.d.ts +10 -0
- package/dist/src/tui/components/agent-discussion-panel.pure.js +94 -0
- package/dist/src/tui/components/agent-discussion-panel.pure.js.map +1 -0
- package/dist/src/tui/components/focused-agent.pure.d.ts +1 -0
- package/dist/src/tui/components/focused-agent.pure.js +11 -0
- package/dist/src/tui/components/focused-agent.pure.js.map +1 -1
- package/dist/src/tui/components/index.d.ts +5 -1
- package/dist/src/tui/components/index.js +18 -1
- package/dist/src/tui/components/index.js.map +1 -1
- package/dist/src/tui/components/live.pure.d.ts +9 -0
- package/dist/src/tui/components/live.pure.js +70 -0
- package/dist/src/tui/components/live.pure.js.map +1 -0
- package/dist/src/tui/dashboard-app.js +10 -6
- package/dist/src/tui/dashboard-app.js.map +1 -1
- package/dist/src/tui/dashboard-app.spec.js +14 -0
- package/dist/src/tui/dashboard-app.spec.js.map +1 -1
- package/dist/src/tui/dashboard-types.d.ts +8 -0
- package/dist/src/tui/dashboard-types.js.map +1 -1
- package/dist/src/tui/eventbus-ui.integration.spec.js +3 -0
- package/dist/src/tui/eventbus-ui.integration.spec.js.map +1 -1
- package/dist/src/tui/events/index.d.ts +1 -1
- package/dist/src/tui/events/index.js.map +1 -1
- package/dist/src/tui/events/types.d.ts +6 -0
- package/dist/src/tui/events/types.js +1 -0
- package/dist/src/tui/events/types.js.map +1 -1
- package/dist/src/tui/hooks/index.d.ts +1 -1
- package/dist/src/tui/hooks/index.js +3 -3
- package/dist/src/tui/hooks/index.js.map +1 -1
- package/dist/src/tui/hooks/use-dashboard-state.d.ts +4 -1
- package/dist/src/tui/hooks/use-dashboard-state.js +26 -0
- package/dist/src/tui/hooks/use-dashboard-state.js.map +1 -1
- package/dist/src/tui/hooks/use-tick.d.ts +1 -0
- package/dist/src/tui/hooks/use-tick.js +15 -0
- package/dist/src/tui/hooks/use-tick.js.map +1 -0
- package/dist/src/tui/hooks/use-tick.spec.d.ts +1 -0
- package/dist/src/tui/hooks/use-tick.spec.js +70 -0
- package/dist/src/tui/hooks/use-tick.spec.js.map +1 -0
- package/dist/src/tui/index.d.ts +1 -1
- package/dist/src/tui/index.js +2 -2
- package/dist/src/tui/index.js.map +1 -1
- package/dist/src/tui-bundle.mjs +468 -133
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/package.json +15 -14
- package/dist/src/tui/components/header-bar.pure.d.ts +0 -1
- package/dist/src/tui/components/header-bar.pure.js +0 -9
- package/dist/src/tui/components/header-bar.pure.js.map +0 -1
- package/dist/src/tui/hooks/use-clock.d.ts +0 -1
- package/dist/src/tui/hooks/use-clock.js +0 -16
- package/dist/src/tui/hooks/use-clock.js.map +0 -1
- package/dist/src/tui/hooks/use-clock.spec.js +0 -43
- package/dist/src/tui/hooks/use-clock.spec.js.map +0 -1
- /package/dist/src/tui/{hooks/use-clock.spec.d.ts → components/AgentDiscussionPanel.spec.d.ts} +0 -0
|
@@ -10,12 +10,14 @@ exports.AgentModule = void 0;
|
|
|
10
10
|
const common_1 = require("@nestjs/common");
|
|
11
11
|
const agent_service_1 = require("./agent.service");
|
|
12
12
|
const rules_module_1 = require("../rules/rules.module");
|
|
13
|
+
const custom_1 = require("../custom");
|
|
14
|
+
const config_module_1 = require("../config/config.module");
|
|
13
15
|
let AgentModule = class AgentModule {
|
|
14
16
|
};
|
|
15
17
|
exports.AgentModule = AgentModule;
|
|
16
18
|
exports.AgentModule = AgentModule = __decorate([
|
|
17
19
|
(0, common_1.Module)({
|
|
18
|
-
imports: [rules_module_1.RulesModule],
|
|
20
|
+
imports: [rules_module_1.RulesModule, custom_1.CustomModule, config_module_1.CodingBuddyConfigModule],
|
|
19
21
|
providers: [agent_service_1.AgentService],
|
|
20
22
|
exports: [agent_service_1.AgentService],
|
|
21
23
|
})
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"agent.module.js","sourceRoot":"","sources":["../../../src/agent/agent.module.ts"],"names":[],"mappings":";;;;;;;;;AAAA,2CAAwC;AACxC,mDAA+C;AAC/C,wDAAoD;
|
|
1
|
+
{"version":3,"file":"agent.module.js","sourceRoot":"","sources":["../../../src/agent/agent.module.ts"],"names":[],"mappings":";;;;;;;;;AAAA,2CAAwC;AACxC,mDAA+C;AAC/C,wDAAoD;AACpD,sCAAyC;AACzC,2DAAkE;AAO3D,IAAM,WAAW,GAAjB,MAAM,WAAW;CAAG,CAAA;AAAd,kCAAW;sBAAX,WAAW;IALvB,IAAA,eAAM,EAAC;QACN,OAAO,EAAE,CAAC,0BAAW,EAAE,qBAAY,EAAE,uCAAuB,CAAC;QAC7D,SAAS,EAAE,CAAC,4BAAY,CAAC;QACzB,OAAO,EAAE,CAAC,4BAAY,CAAC;KACxB,CAAC;GACW,WAAW,CAAG"}
|
|
@@ -1,17 +1,26 @@
|
|
|
1
1
|
import { RulesService } from '../rules/rules.service';
|
|
2
|
+
import { CustomService } from '../custom';
|
|
3
|
+
import { ConfigService } from '../config/config.service';
|
|
2
4
|
import type { Mode } from '../keyword/keyword.types';
|
|
3
|
-
import type {
|
|
5
|
+
import type { AgentProfile } from '../rules/rules.types';
|
|
6
|
+
import type { AgentContext, AgentSystemPrompt, InlineAgentDefinition, ParallelAgentSet, DispatchAgentsInput, DispatchResult } from './agent.types';
|
|
4
7
|
import type { VerbosityLevel } from '../shared/verbosity.types';
|
|
5
8
|
export declare class AgentService {
|
|
6
9
|
private readonly rulesService;
|
|
10
|
+
private readonly customService;
|
|
11
|
+
private readonly configService;
|
|
7
12
|
private readonly logger;
|
|
8
|
-
constructor(rulesService: RulesService);
|
|
9
|
-
getAgentSystemPrompt(agentName: string, context: AgentContext): Promise<AgentSystemPrompt>;
|
|
10
|
-
prepareParallelAgents(mode: Mode, specialists: string[], targetFiles?: string[], sharedContext?: string, verbosity?: VerbosityLevel): Promise<ParallelAgentSet>;
|
|
13
|
+
constructor(rulesService: RulesService, customService: CustomService, configService: ConfigService);
|
|
14
|
+
getAgentSystemPrompt(agentName: string, context: AgentContext, inlineAgents?: Record<string, InlineAgentDefinition>): Promise<AgentSystemPrompt>;
|
|
15
|
+
prepareParallelAgents(mode: Mode, specialists: string[], targetFiles?: string[], sharedContext?: string, verbosity?: VerbosityLevel, inlineAgents?: Record<string, InlineAgentDefinition>): Promise<ParallelAgentSet>;
|
|
11
16
|
private loadAgents;
|
|
12
17
|
private tryLoadAgent;
|
|
13
18
|
private buildParallelAgentSet;
|
|
14
19
|
getRecommendedAgents(modeDefaults: string[], files: string[]): string[];
|
|
15
20
|
private addFilePatternAgents;
|
|
16
21
|
dispatchAgents(input: DispatchAgentsInput): Promise<DispatchResult>;
|
|
22
|
+
private buildTaskmaestroPrompt;
|
|
23
|
+
private buildTaskmaestroHint;
|
|
24
|
+
private buildTeamsHint;
|
|
25
|
+
resolveAgent(agentName: string, inlineAgents?: Record<string, InlineAgentDefinition>): Promise<AgentProfile>;
|
|
17
26
|
}
|
|
@@ -13,17 +13,21 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
13
13
|
exports.AgentService = void 0;
|
|
14
14
|
const common_1 = require("@nestjs/common");
|
|
15
15
|
const rules_service_1 = require("../rules/rules.service");
|
|
16
|
+
const custom_1 = require("../custom");
|
|
17
|
+
const config_service_1 = require("../config/config.service");
|
|
16
18
|
const agent_types_1 = require("./agent.types");
|
|
17
19
|
const agent_prompt_builder_1 = require("./agent-prompt.builder");
|
|
18
20
|
const agent_summary_utils_1 = require("./agent-summary.utils");
|
|
19
21
|
const verbosity_types_1 = require("../shared/verbosity.types");
|
|
20
22
|
let AgentService = AgentService_1 = class AgentService {
|
|
21
|
-
constructor(rulesService) {
|
|
23
|
+
constructor(rulesService, customService, configService) {
|
|
22
24
|
this.rulesService = rulesService;
|
|
25
|
+
this.customService = customService;
|
|
26
|
+
this.configService = configService;
|
|
23
27
|
this.logger = new common_1.Logger(AgentService_1.name);
|
|
24
28
|
}
|
|
25
|
-
async getAgentSystemPrompt(agentName, context) {
|
|
26
|
-
const agentProfile = await this.
|
|
29
|
+
async getAgentSystemPrompt(agentName, context, inlineAgents) {
|
|
30
|
+
const agentProfile = await this.resolveAgent(agentName, inlineAgents);
|
|
27
31
|
const systemPrompt = (0, agent_prompt_builder_1.buildAgentSystemPrompt)(agentProfile, context);
|
|
28
32
|
const description = (0, agent_prompt_builder_1.buildTaskDescription)(agentProfile, context);
|
|
29
33
|
return {
|
|
@@ -33,7 +37,7 @@ let AgentService = AgentService_1 = class AgentService {
|
|
|
33
37
|
description,
|
|
34
38
|
};
|
|
35
39
|
}
|
|
36
|
-
async prepareParallelAgents(mode, specialists, targetFiles, sharedContext, verbosity) {
|
|
40
|
+
async prepareParallelAgents(mode, specialists, targetFiles, sharedContext, verbosity, inlineAgents) {
|
|
37
41
|
const uniqueSpecialists = Array.from(new Set(specialists));
|
|
38
42
|
const context = {
|
|
39
43
|
mode,
|
|
@@ -41,11 +45,11 @@ let AgentService = AgentService_1 = class AgentService {
|
|
|
41
45
|
taskDescription: sharedContext,
|
|
42
46
|
};
|
|
43
47
|
const verbosityConfig = (0, verbosity_types_1.getVerbosityConfig)(verbosity || 'standard');
|
|
44
|
-
const { agents, failedAgents } = await this.loadAgents(uniqueSpecialists, context, verbosityConfig.includeAgentPrompt);
|
|
48
|
+
const { agents, failedAgents } = await this.loadAgents(uniqueSpecialists, context, verbosityConfig.includeAgentPrompt, inlineAgents);
|
|
45
49
|
return this.buildParallelAgentSet(agents, failedAgents);
|
|
46
50
|
}
|
|
47
|
-
async loadAgents(specialists, context, includeFullPrompt) {
|
|
48
|
-
const results = await Promise.all(specialists.map(name => this.tryLoadAgent(name, context, includeFullPrompt)));
|
|
51
|
+
async loadAgents(specialists, context, includeFullPrompt, inlineAgents) {
|
|
52
|
+
const results = await Promise.all(specialists.map(name => this.tryLoadAgent(name, context, includeFullPrompt, inlineAgents)));
|
|
49
53
|
const agents = [];
|
|
50
54
|
const failedAgents = [];
|
|
51
55
|
for (const result of results) {
|
|
@@ -59,9 +63,9 @@ let AgentService = AgentService_1 = class AgentService {
|
|
|
59
63
|
}
|
|
60
64
|
return { agents, failedAgents };
|
|
61
65
|
}
|
|
62
|
-
async tryLoadAgent(specialistName, context, includeFullPrompt) {
|
|
66
|
+
async tryLoadAgent(specialistName, context, includeFullPrompt, inlineAgents) {
|
|
63
67
|
try {
|
|
64
|
-
const profile = await this.
|
|
68
|
+
const profile = await this.resolveAgent(specialistName, inlineAgents);
|
|
65
69
|
const agent = {
|
|
66
70
|
id: specialistName,
|
|
67
71
|
displayName: profile.name,
|
|
@@ -124,7 +128,7 @@ let AgentService = AgentService_1 = class AgentService {
|
|
|
124
128
|
};
|
|
125
129
|
if (input.primaryAgent) {
|
|
126
130
|
try {
|
|
127
|
-
const agentPrompt = await this.getAgentSystemPrompt(input.primaryAgent, context);
|
|
131
|
+
const agentPrompt = await this.getAgentSystemPrompt(input.primaryAgent, context, input.inlineAgents);
|
|
128
132
|
result.primaryAgent = {
|
|
129
133
|
name: input.primaryAgent,
|
|
130
134
|
displayName: agentPrompt.displayName,
|
|
@@ -142,9 +146,51 @@ let AgentService = AgentService_1 = class AgentService {
|
|
|
142
146
|
result.failedAgents = [...(result.failedAgents || []), { id: input.primaryAgent, reason }];
|
|
143
147
|
}
|
|
144
148
|
}
|
|
149
|
+
if (input.executionStrategy === 'taskmaestro' && input.specialists?.length) {
|
|
150
|
+
const uniqueSpecialists = Array.from(new Set(input.specialists));
|
|
151
|
+
const { agents, failedAgents } = await this.loadAgents(uniqueSpecialists, context, true, input.inlineAgents);
|
|
152
|
+
const assignments = agents.map(agent => ({
|
|
153
|
+
name: agent.id,
|
|
154
|
+
displayName: agent.displayName,
|
|
155
|
+
prompt: this.buildTaskmaestroPrompt(agent, input),
|
|
156
|
+
}));
|
|
157
|
+
return {
|
|
158
|
+
primaryAgent: result.primaryAgent,
|
|
159
|
+
taskmaestro: {
|
|
160
|
+
sessionName: `${(input.mode ?? 'eval').toLowerCase()}-specialists`,
|
|
161
|
+
paneCount: assignments.length,
|
|
162
|
+
assignments,
|
|
163
|
+
},
|
|
164
|
+
executionStrategy: 'taskmaestro',
|
|
165
|
+
executionHint: this.buildTaskmaestroHint(assignments.length),
|
|
166
|
+
failedAgents: failedAgents.length > 0 ? failedAgents : result.failedAgents,
|
|
167
|
+
};
|
|
168
|
+
}
|
|
169
|
+
if (input.executionStrategy === 'teams' && input.specialists?.length) {
|
|
170
|
+
const uniqueSpecialists = Array.from(new Set(input.specialists));
|
|
171
|
+
const teamName = `${(input.mode ?? 'eval').toLowerCase()}-specialists`;
|
|
172
|
+
const { agents, failedAgents } = await this.loadAgents(uniqueSpecialists, context, true, input.inlineAgents);
|
|
173
|
+
const teammates = agents.map(agent => ({
|
|
174
|
+
name: agent.id,
|
|
175
|
+
subagent_type: 'general-purpose',
|
|
176
|
+
team_name: teamName,
|
|
177
|
+
prompt: agent.taskPrompt || `Perform ${agent.displayName} analysis in ${input.mode} mode`,
|
|
178
|
+
}));
|
|
179
|
+
return {
|
|
180
|
+
primaryAgent: result.primaryAgent,
|
|
181
|
+
teams: {
|
|
182
|
+
team_name: teamName,
|
|
183
|
+
description: `${input.mode} mode specialist team`,
|
|
184
|
+
teammates,
|
|
185
|
+
},
|
|
186
|
+
executionStrategy: 'teams',
|
|
187
|
+
executionHint: this.buildTeamsHint(teamName, teammates.length),
|
|
188
|
+
failedAgents: failedAgents.length > 0 ? failedAgents : result.failedAgents,
|
|
189
|
+
};
|
|
190
|
+
}
|
|
145
191
|
if (input.includeParallel && input.specialists?.length) {
|
|
146
192
|
const uniqueSpecialists = Array.from(new Set(input.specialists));
|
|
147
|
-
const { agents, failedAgents } = await this.loadAgents(uniqueSpecialists, context, true);
|
|
193
|
+
const { agents, failedAgents } = await this.loadAgents(uniqueSpecialists, context, true, input.inlineAgents);
|
|
148
194
|
result.parallelAgents = agents.map((agent) => ({
|
|
149
195
|
name: agent.id,
|
|
150
196
|
displayName: agent.displayName,
|
|
@@ -160,12 +206,79 @@ let AgentService = AgentService_1 = class AgentService {
|
|
|
160
206
|
result.failedAgents = failedAgents;
|
|
161
207
|
}
|
|
162
208
|
}
|
|
209
|
+
result.executionStrategy = 'subagent';
|
|
163
210
|
return result;
|
|
164
211
|
}
|
|
212
|
+
buildTaskmaestroPrompt(agent, input) {
|
|
213
|
+
const taskContext = input.taskDescription ? `\n\n**Task:** ${input.taskDescription}` : '';
|
|
214
|
+
const fileContext = input.targetFiles?.length
|
|
215
|
+
? `\n\n**Target Files:**\n${input.targetFiles.map(f => '- ' + f).join('\n')}`
|
|
216
|
+
: '';
|
|
217
|
+
return `${agent.taskPrompt || agent.summary || ''}${taskContext}${fileContext}
|
|
218
|
+
|
|
219
|
+
**Output Format:**
|
|
220
|
+
- Severity: CRITICAL / HIGH / MEDIUM / LOW / INFO
|
|
221
|
+
- File reference
|
|
222
|
+
- Finding description
|
|
223
|
+
- Recommendation
|
|
224
|
+
|
|
225
|
+
When done, provide a summary of all findings.`;
|
|
226
|
+
}
|
|
227
|
+
buildTaskmaestroHint(paneCount) {
|
|
228
|
+
return `TaskMaestro execution:
|
|
229
|
+
1. /taskmaestro start --panes ${paneCount}
|
|
230
|
+
2. Wait for all panes to show Claude Code prompt
|
|
231
|
+
3. For each assignment: /taskmaestro assign <pane_index> "<prompt>"
|
|
232
|
+
4. /taskmaestro status — monitor progress
|
|
233
|
+
5. When all panes show idle: collect results
|
|
234
|
+
6. /taskmaestro stop all — cleanup`;
|
|
235
|
+
}
|
|
236
|
+
buildTeamsHint(teamName, teammateCount) {
|
|
237
|
+
return `Teams execution:
|
|
238
|
+
1. TeamCreate: { team_name: "${teamName}" }
|
|
239
|
+
2. Spawn ${teammateCount} teammate(s) via Agent tool with team_name: "${teamName}"
|
|
240
|
+
3. Create tasks via TaskCreate and assign with TaskUpdate
|
|
241
|
+
4. Monitor via TaskList — teammates coordinate via shared task list
|
|
242
|
+
5. Collect results when all teammates go idle
|
|
243
|
+
6. Shutdown teammates via SendMessage with shutdown_request`;
|
|
244
|
+
}
|
|
245
|
+
async resolveAgent(agentName, inlineAgents) {
|
|
246
|
+
if (inlineAgents?.[agentName]) {
|
|
247
|
+
const inline = inlineAgents[agentName];
|
|
248
|
+
this.logger.debug(`Resolved agent '${agentName}' from inline definition`);
|
|
249
|
+
return {
|
|
250
|
+
name: inline.name,
|
|
251
|
+
description: inline.description,
|
|
252
|
+
role: inline.role,
|
|
253
|
+
communication: inline.communication,
|
|
254
|
+
source: 'custom',
|
|
255
|
+
};
|
|
256
|
+
}
|
|
257
|
+
try {
|
|
258
|
+
const projectRoot = this.configService.getProjectRoot();
|
|
259
|
+
const customAgents = await this.customService.listCustomAgents(projectRoot);
|
|
260
|
+
const customAgent = customAgents.find(a => a.name === `${agentName}.json`);
|
|
261
|
+
if (customAgent) {
|
|
262
|
+
this.logger.debug(`Resolved agent '${agentName}' from custom local`);
|
|
263
|
+
return {
|
|
264
|
+
name: customAgent.parsed.name,
|
|
265
|
+
description: customAgent.parsed.description,
|
|
266
|
+
role: customAgent.parsed.role,
|
|
267
|
+
source: 'custom',
|
|
268
|
+
};
|
|
269
|
+
}
|
|
270
|
+
}
|
|
271
|
+
catch (error) {
|
|
272
|
+
this.logger.warn(`Failed to check custom agents for '${agentName}': ${error instanceof Error ? error.message : 'Unknown error'}`);
|
|
273
|
+
}
|
|
274
|
+
return this.rulesService.getAgent(agentName);
|
|
275
|
+
}
|
|
165
276
|
};
|
|
166
277
|
exports.AgentService = AgentService;
|
|
167
278
|
exports.AgentService = AgentService = AgentService_1 = __decorate([
|
|
168
279
|
(0, common_1.Injectable)(),
|
|
169
|
-
__metadata("design:paramtypes", [rules_service_1.RulesService
|
|
280
|
+
__metadata("design:paramtypes", [rules_service_1.RulesService,
|
|
281
|
+
custom_1.CustomService,
|
|
282
|
+
config_service_1.ConfigService])
|
|
170
283
|
], AgentService);
|
|
171
284
|
//# sourceMappingURL=agent.service.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"agent.service.js","sourceRoot":"","sources":["../../../src/agent/agent.service.ts"],"names":[],"mappings":";;;;;;;;;;;;;AAAA,2CAAoD;AACpD,0DAAsD;
|
|
1
|
+
{"version":3,"file":"agent.service.js","sourceRoot":"","sources":["../../../src/agent/agent.service.ts"],"names":[],"mappings":";;;;;;;;;;;;;AAAA,2CAAoD;AACpD,0DAAsD;AACtD,sCAA0C;AAC1C,6DAAyD;AAgBzD,+CAAyD;AACzD,iEAIgC;AAChC,+DAA2D;AAE3D,+DAA+D;AAGxD,IAAM,YAAY,oBAAlB,MAAM,YAAY;IAGvB,YACmB,YAA0B,EAC1B,aAA4B,EAC5B,aAA4B;QAF5B,iBAAY,GAAZ,YAAY,CAAc;QAC1B,kBAAa,GAAb,aAAa,CAAe;QAC5B,kBAAa,GAAb,aAAa,CAAe;QAL9B,WAAM,GAAG,IAAI,eAAM,CAAC,cAAY,CAAC,IAAI,CAAC,CAAC;IAMrD,CAAC;IAKJ,KAAK,CAAC,oBAAoB,CACxB,SAAiB,EACjB,OAAqB,EACrB,YAAoD;QAEpD,MAAM,YAAY,GAAG,MAAM,IAAI,CAAC,YAAY,CAAC,SAAS,EAAE,YAAY,CAAC,CAAC;QAEtE,MAAM,YAAY,GAAG,IAAA,6CAAsB,EAAC,YAAY,EAAE,OAAO,CAAC,CAAC;QACnE,MAAM,WAAW,GAAG,IAAA,2CAAoB,EAAC,YAAY,EAAE,OAAO,CAAC,CAAC;QAEhE,OAAO;YACL,SAAS;YACT,WAAW,EAAE,YAAY,CAAC,IAAI;YAC9B,YAAY;YACZ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O,CAAC,CAAC,CAAC,eAAe,EAAE,CAChH,CAAC;QACJ,CAAC;QAGD,OAAO,IAAI,CAAC,YAAY,CAAC,QAAQ,CAAC,SAAS,CAAC,CAAC;IAC/C,CAAC;CACF,CAAA;AAvYY,oCAAY;uBAAZ,YAAY;IADxB,IAAA,mBAAU,GAAE;qCAKsB,4BAAY;QACX,sBAAa;QACb,8BAAa;GANpC,YAAY,CAuYxB"}
|
|
@@ -43,11 +43,62 @@ export interface DispatchedAgent {
|
|
|
43
43
|
description: string;
|
|
44
44
|
dispatchParams: DispatchParams;
|
|
45
45
|
}
|
|
46
|
+
export interface TaskmaestroAssignment {
|
|
47
|
+
name: string;
|
|
48
|
+
displayName: string;
|
|
49
|
+
prompt: string;
|
|
50
|
+
}
|
|
51
|
+
export interface TaskmaestroDispatch {
|
|
52
|
+
sessionName: string;
|
|
53
|
+
paneCount: number;
|
|
54
|
+
assignments: TaskmaestroAssignment[];
|
|
55
|
+
}
|
|
56
|
+
export interface TeamsTeammate {
|
|
57
|
+
name: string;
|
|
58
|
+
subagent_type: 'general-purpose';
|
|
59
|
+
team_name: string;
|
|
60
|
+
prompt: string;
|
|
61
|
+
}
|
|
62
|
+
export interface TeamsDispatch {
|
|
63
|
+
team_name: string;
|
|
64
|
+
description: string;
|
|
65
|
+
teammates: TeamsTeammate[];
|
|
66
|
+
}
|
|
67
|
+
export interface VisibilityMessages {
|
|
68
|
+
onStart: string;
|
|
69
|
+
onFinding: string;
|
|
70
|
+
onComplete: string;
|
|
71
|
+
}
|
|
72
|
+
export interface VisibilityConfig {
|
|
73
|
+
reportTo: string;
|
|
74
|
+
format: string;
|
|
75
|
+
includeProgress: boolean;
|
|
76
|
+
messages?: VisibilityMessages;
|
|
77
|
+
}
|
|
46
78
|
export interface DispatchResult {
|
|
47
79
|
primaryAgent?: DispatchedAgent;
|
|
48
80
|
parallelAgents?: DispatchedAgent[];
|
|
49
81
|
executionHint: string;
|
|
50
82
|
failedAgents?: FailedAgent[];
|
|
83
|
+
taskmaestro?: TaskmaestroDispatch;
|
|
84
|
+
teams?: TeamsDispatch;
|
|
85
|
+
executionStrategy?: string;
|
|
86
|
+
visibility?: VisibilityConfig;
|
|
87
|
+
}
|
|
88
|
+
export interface InlineAgentDefinition {
|
|
89
|
+
name: string;
|
|
90
|
+
description: string;
|
|
91
|
+
role: {
|
|
92
|
+
title: string;
|
|
93
|
+
expertise: string[];
|
|
94
|
+
responsibilities?: string[];
|
|
95
|
+
};
|
|
96
|
+
communication?: {
|
|
97
|
+
language?: string;
|
|
98
|
+
style?: string;
|
|
99
|
+
[key: string]: unknown;
|
|
100
|
+
};
|
|
101
|
+
[key: string]: unknown;
|
|
51
102
|
}
|
|
52
103
|
export interface DispatchAgentsInput {
|
|
53
104
|
mode: Mode;
|
|
@@ -56,5 +107,7 @@ export interface DispatchAgentsInput {
|
|
|
56
107
|
specialists?: string[];
|
|
57
108
|
includeParallel?: boolean;
|
|
58
109
|
primaryAgent?: string;
|
|
110
|
+
executionStrategy?: 'subagent' | 'taskmaestro' | 'teams';
|
|
111
|
+
inlineAgents?: Record<string, InlineAgentDefinition>;
|
|
59
112
|
}
|
|
60
113
|
export declare const FILE_PATTERN_SPECIALISTS: Record<string, string[]>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"agent.types.js","sourceRoot":"","sources":["../../../src/agent/agent.types.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"agent.types.js","sourceRoot":"","sources":["../../../src/agent/agent.types.ts"],"names":[],"mappings":";;;AA6La,QAAA,wBAAwB,GAA6B;IAEhE,IAAI,EAAE,CAAC,qBAAqB,CAAC;IAC7B,KAAK,EAAE,CAAC,qBAAqB,EAAE,0BAA0B,CAAC;IAC1D,QAAQ,EAAE,CAAC,qBAAqB,CAAC;IACjC,KAAK,EAAE,CAAC,qBAAqB,CAAC;IAC9B,KAAK,EAAE,CAAC,qBAAqB,CAAC;IAC9B,GAAG,EAAE,CAAC,qBAAqB,CAAC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C;IAG3C,SAAS,EAAE,CAAC,sBAAsB,EAAE,eAAe,CAAC;IACpD,OAAO,EAAE,CAAC,sBAAsB,CAAC;IACjC,OAAO,EAAE,CAAC,sBAAsB,CAAC;IACjC,MAAM,EAAE,CAAC,sBAAsB,EAAE,yBAAyB,CAAC;IAC3D,SAAS,EAAE,CAAC,sBAAsB,EAAE,0BAA0B,CAAC;IAC/D,QAAQ,EAAE,CAAC,sBAAsB,CAAC;IAClC,OAAO,EAAE,CAAC,sBAAsB,CAAC;IACjC,UAAU,EAAE,CAAC,sBAAsB,EAAE,wBAAwB,CAAC;CAC/D,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { AgentOpinion, CrossReview, ConsensusResult, DiscussionRound, Stance } from './types';
|
|
2
|
+
export declare class DiscussionEngine {
|
|
3
|
+
private rounds;
|
|
4
|
+
constructor();
|
|
5
|
+
addOpinion(opinion: AgentOpinion): void;
|
|
6
|
+
addCrossReview(review: CrossReview): void;
|
|
7
|
+
nextRound(): void;
|
|
8
|
+
getCurrentRound(): DiscussionRound;
|
|
9
|
+
getAllRounds(): readonly DiscussionRound[];
|
|
10
|
+
getConsensus(): ConsensusResult;
|
|
11
|
+
getAgentStanceHistory(agentId: string): Stance[];
|
|
12
|
+
reset(): void;
|
|
13
|
+
private mutableCurrentRound;
|
|
14
|
+
}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.DiscussionEngine = void 0;
|
|
4
|
+
const types_1 = require("./types");
|
|
5
|
+
class DiscussionEngine {
|
|
6
|
+
constructor() {
|
|
7
|
+
this.rounds = [];
|
|
8
|
+
this.rounds.push({ roundNumber: 1, opinions: [], crossReviews: [] });
|
|
9
|
+
}
|
|
10
|
+
addOpinion(opinion) {
|
|
11
|
+
const current = this.mutableCurrentRound();
|
|
12
|
+
current.opinions.push(opinion);
|
|
13
|
+
}
|
|
14
|
+
addCrossReview(review) {
|
|
15
|
+
const current = this.mutableCurrentRound();
|
|
16
|
+
current.crossReviews.push(review);
|
|
17
|
+
}
|
|
18
|
+
nextRound() {
|
|
19
|
+
const nextNumber = this.rounds.length + 1;
|
|
20
|
+
this.rounds.push({ roundNumber: nextNumber, opinions: [], crossReviews: [] });
|
|
21
|
+
}
|
|
22
|
+
getCurrentRound() {
|
|
23
|
+
return this.rounds[this.rounds.length - 1];
|
|
24
|
+
}
|
|
25
|
+
getAllRounds() {
|
|
26
|
+
return this.rounds;
|
|
27
|
+
}
|
|
28
|
+
getConsensus() {
|
|
29
|
+
return (0, types_1.calculateConsensus)(this.getCurrentRound().opinions);
|
|
30
|
+
}
|
|
31
|
+
getAgentStanceHistory(agentId) {
|
|
32
|
+
const stances = [];
|
|
33
|
+
for (const round of this.rounds) {
|
|
34
|
+
const opinion = round.opinions.find(o => o.agentId === agentId);
|
|
35
|
+
if (opinion) {
|
|
36
|
+
stances.push(opinion.stance);
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
return stances;
|
|
40
|
+
}
|
|
41
|
+
reset() {
|
|
42
|
+
this.rounds = [{ roundNumber: 1, opinions: [], crossReviews: [] }];
|
|
43
|
+
}
|
|
44
|
+
mutableCurrentRound() {
|
|
45
|
+
return this.rounds[this.rounds.length - 1];
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
exports.DiscussionEngine = DiscussionEngine;
|
|
49
|
+
//# sourceMappingURL=discussion-engine.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"discussion-engine.js","sourceRoot":"","sources":["../../../src/collaboration/discussion-engine.ts"],"names":[],"mappings":";;;AAKA,mCAA6C;AAE7C,MAAa,gBAAgB;IAG3B;QAFQ,WAAM,GAAsB,EAAE,CAAC;QAGrC,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,EAAE,WAAW,EAAE,CAAC,EAAE,QAAQ,EAAE,EAAE,EAAE,YAAY,EAAE,EAAE,EAAE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CAAC;IACjB,CAAC;IAGD,KAAK;QACH,IAAI,CAAC,MAAM,GAAG,CAAC,EAAE,WAAW,EAAE,CAAC,EAAE,QAAQ,EAAE,EAAE,EAAE,YAAY,EAAE,EAAE,EAAE,CAAC,CAAC;IACrE,CAAC;IAEO,mBAAmB;QACzB,OAAO,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;IAC7C,CAAC;CACF;AA5DD,4CA4DC"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export type { Stance, AgentOpinion, CrossReview, DiscussionRound, ConsensusResult, CreateAgentOpinionParams, CreateCrossReviewParams, } from './types';
|
|
2
|
+
export { STANCES, STANCE_ICONS, createAgentOpinion, createCrossReview, createDiscussionRound, calculateConsensus, } from './types';
|
|
3
|
+
export { DiscussionEngine } from './discussion-engine';
|
|
4
|
+
export { formatOpinion, formatCrossReview, formatConsensus, formatDiscussionRound, } from './terminal-formatter';
|
|
5
|
+
export { mapSeverityToStance, convertSpecialistResult, convertSpecialistResults, type FindingSeverity, type SpecialistFinding, type SpecialistResult, } from './opinion-adapter';
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.convertSpecialistResults = exports.convertSpecialistResult = exports.mapSeverityToStance = exports.formatDiscussionRound = exports.formatConsensus = exports.formatCrossReview = exports.formatOpinion = exports.DiscussionEngine = exports.calculateConsensus = exports.createDiscussionRound = exports.createCrossReview = exports.createAgentOpinion = exports.STANCE_ICONS = exports.STANCES = void 0;
|
|
4
|
+
var types_1 = require("./types");
|
|
5
|
+
Object.defineProperty(exports, "STANCES", { enumerable: true, get: function () { return types_1.STANCES; } });
|
|
6
|
+
Object.defineProperty(exports, "STANCE_ICONS", { enumerable: true, get: function () { return types_1.STANCE_ICONS; } });
|
|
7
|
+
Object.defineProperty(exports, "createAgentOpinion", { enumerable: true, get: function () { return types_1.createAgentOpinion; } });
|
|
8
|
+
Object.defineProperty(exports, "createCrossReview", { enumerable: true, get: function () { return types_1.createCrossReview; } });
|
|
9
|
+
Object.defineProperty(exports, "createDiscussionRound", { enumerable: true, get: function () { return types_1.createDiscussionRound; } });
|
|
10
|
+
Object.defineProperty(exports, "calculateConsensus", { enumerable: true, get: function () { return types_1.calculateConsensus; } });
|
|
11
|
+
var discussion_engine_1 = require("./discussion-engine");
|
|
12
|
+
Object.defineProperty(exports, "DiscussionEngine", { enumerable: true, get: function () { return discussion_engine_1.DiscussionEngine; } });
|
|
13
|
+
var terminal_formatter_1 = require("./terminal-formatter");
|
|
14
|
+
Object.defineProperty(exports, "formatOpinion", { enumerable: true, get: function () { return terminal_formatter_1.formatOpinion; } });
|
|
15
|
+
Object.defineProperty(exports, "formatCrossReview", { enumerable: true, get: function () { return terminal_formatter_1.formatCrossReview; } });
|
|
16
|
+
Object.defineProperty(exports, "formatConsensus", { enumerable: true, get: function () { return terminal_formatter_1.formatConsensus; } });
|
|
17
|
+
Object.defineProperty(exports, "formatDiscussionRound", { enumerable: true, get: function () { return terminal_formatter_1.formatDiscussionRound; } });
|
|
18
|
+
var opinion_adapter_1 = require("./opinion-adapter");
|
|
19
|
+
Object.defineProperty(exports, "mapSeverityToStance", { enumerable: true, get: function () { return opinion_adapter_1.mapSeverityToStance; } });
|
|
20
|
+
Object.defineProperty(exports, "convertSpecialistResult", { enumerable: true, get: function () { return opinion_adapter_1.convertSpecialistResult; } });
|
|
21
|
+
Object.defineProperty(exports, "convertSpecialistResults", { enumerable: true, get: function () { return opinion_adapter_1.convertSpecialistResults; } });
|
|
22
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/collaboration/index.ts"],"names":[],"mappings":";;;AAYA,iCAOiB;AANf,gGAAA,OAAO,OAAA;AACP,qGAAA,YAAY,OAAA;AACZ,2GAAA,kBAAkB,OAAA;AAClB,0GAAA,iBAAiB,OAAA;AACjB,8GAAA,qBAAqB,OAAA;AACrB,2GAAA,kBAAkB,OAAA;AAEpB,yDAAuD;AAA9C,qHAAA,gBAAgB,OAAA;AACzB,2DAK8B;AAJ5B,mHAAA,aAAa,OAAA;AACb,uHAAA,iBAAiB,OAAA;AACjB,qHAAA,eAAe,OAAA;AACf,2HAAA,qBAAqB,OAAA;AAEvB,qDAO2B;AANzB,sHAAA,mBAAmB,OAAA;AACnB,0HAAA,uBAAuB,OAAA;AACvB,2HAAA,wBAAwB,OAAA"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { AgentOpinion, DiscussionRound, Stance } from './types';
|
|
2
|
+
export type FindingSeverity = 'critical' | 'high' | 'medium' | 'low' | 'none';
|
|
3
|
+
export interface SpecialistFinding {
|
|
4
|
+
readonly text: string;
|
|
5
|
+
readonly severity: FindingSeverity;
|
|
6
|
+
}
|
|
7
|
+
export interface SpecialistResult {
|
|
8
|
+
readonly agentName: string;
|
|
9
|
+
readonly findings: readonly SpecialistFinding[];
|
|
10
|
+
readonly recommendations: readonly string[];
|
|
11
|
+
}
|
|
12
|
+
export declare function mapSeverityToStance(severity: FindingSeverity): Stance;
|
|
13
|
+
export declare function convertSpecialistResult(result: SpecialistResult): AgentOpinion;
|
|
14
|
+
export declare function convertSpecialistResults(results: readonly SpecialistResult[], roundNumber?: number): DiscussionRound;
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.mapSeverityToStance = mapSeverityToStance;
|
|
4
|
+
exports.convertSpecialistResult = convertSpecialistResult;
|
|
5
|
+
exports.convertSpecialistResults = convertSpecialistResults;
|
|
6
|
+
const types_1 = require("./types");
|
|
7
|
+
const SEVERITY_RANK = {
|
|
8
|
+
none: 0,
|
|
9
|
+
low: 1,
|
|
10
|
+
medium: 2,
|
|
11
|
+
high: 3,
|
|
12
|
+
critical: 4,
|
|
13
|
+
};
|
|
14
|
+
function mapSeverityToStance(severity) {
|
|
15
|
+
switch (severity) {
|
|
16
|
+
case 'critical':
|
|
17
|
+
case 'high':
|
|
18
|
+
return 'reject';
|
|
19
|
+
case 'medium':
|
|
20
|
+
return 'concern';
|
|
21
|
+
case 'low':
|
|
22
|
+
case 'none':
|
|
23
|
+
return 'approve';
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
function slugify(name) {
|
|
27
|
+
return `specialist:${name.toLowerCase().replace(/\s+/g, '-')}`;
|
|
28
|
+
}
|
|
29
|
+
function highestSeverity(findings) {
|
|
30
|
+
if (findings.length === 0)
|
|
31
|
+
return 'none';
|
|
32
|
+
let max = 'none';
|
|
33
|
+
for (const f of findings) {
|
|
34
|
+
if (SEVERITY_RANK[f.severity] > SEVERITY_RANK[max]) {
|
|
35
|
+
max = f.severity;
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
return max;
|
|
39
|
+
}
|
|
40
|
+
function convertSpecialistResult(result) {
|
|
41
|
+
const severity = highestSeverity(result.findings);
|
|
42
|
+
const stance = mapSeverityToStance(severity);
|
|
43
|
+
const reasoning = result.findings.length === 0 ? 'No issues found.' : result.findings.map(f => f.text).join('; ');
|
|
44
|
+
return (0, types_1.createAgentOpinion)({
|
|
45
|
+
agentId: slugify(result.agentName),
|
|
46
|
+
agentName: result.agentName,
|
|
47
|
+
stance,
|
|
48
|
+
reasoning,
|
|
49
|
+
suggestedChanges: [...result.recommendations],
|
|
50
|
+
});
|
|
51
|
+
}
|
|
52
|
+
function convertSpecialistResults(results, roundNumber = 1) {
|
|
53
|
+
const opinions = results.map(convertSpecialistResult);
|
|
54
|
+
return (0, types_1.createDiscussionRound)(roundNumber, opinions);
|
|
55
|
+
}
|
|
56
|
+
//# sourceMappingURL=opinion-adapter.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"opinion-adapter.js","sourceRoot":"","sources":["../../../src/collaboration/opinion-adapter.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KAAK,CAAC,CAAC,CAAC,CAAC,kBAAkB,CAAC,CAAC,CAAC,MAAM,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAElG,OAAO,IAAA,0BAAkB,EAAC;QACxB,OAAO,EAAE,OAAO,CAAC,MAAM,CAAC,SAAS,CAAC;QAClC,SAAS,EAAE,MAAM,CAAC,SAAS;QAC3B,MAAM;QACN,SAAS;QACT,gBAAgB,EAAE,CAAC,GAAG,MAAM,CAAC,eAAe,CAAC;KAC9C,CAAC,CAAC;AACL,CAAC;AAKD,SAAgB,wBAAwB,CACtC,OAAoC,EACpC,WAAW,GAAG,CAAC;IAEf,MAAM,QAAQ,GAAG,OAAO,CAAC,GAAG,CAAC,uBAAuB,CAAC,CAAC;IACtD,OAAO,IAAA,6BAAqB,EAAC,WAAW,EAAE,QAAQ,CAAC,CAAC;AACtD,CAAC"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { AgentOpinion, CrossReview, ConsensusResult, DiscussionRound } from './types';
|
|
2
|
+
export declare function formatOpinion(opinion: AgentOpinion): string;
|
|
3
|
+
export declare function formatCrossReview(review: CrossReview, agentNames: Record<string, string>): string;
|
|
4
|
+
export declare function formatConsensus(consensus: ConsensusResult): string;
|
|
5
|
+
export declare function formatDiscussionRound(round: DiscussionRound): string;
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.formatOpinion = formatOpinion;
|
|
4
|
+
exports.formatCrossReview = formatCrossReview;
|
|
5
|
+
exports.formatConsensus = formatConsensus;
|
|
6
|
+
exports.formatDiscussionRound = formatDiscussionRound;
|
|
7
|
+
const types_1 = require("./types");
|
|
8
|
+
const theme_1 = require("../tui/utils/theme");
|
|
9
|
+
const CROSS_REVIEW_VERBS = {
|
|
10
|
+
approve: 'agrees',
|
|
11
|
+
concern: 'notes',
|
|
12
|
+
reject: 'disagrees',
|
|
13
|
+
};
|
|
14
|
+
function formatOpinion(opinion) {
|
|
15
|
+
const avatar = (0, theme_1.getAgentAvatar)(opinion.agentName);
|
|
16
|
+
const icon = types_1.STANCE_ICONS[opinion.stance];
|
|
17
|
+
const parts = [
|
|
18
|
+
`${avatar} ${opinion.agentName} — ${icon} ${opinion.stance}: "${opinion.reasoning}"`,
|
|
19
|
+
];
|
|
20
|
+
if (opinion.suggestedChanges.length > 0) {
|
|
21
|
+
for (const change of opinion.suggestedChanges) {
|
|
22
|
+
parts.push(` → ${change}`);
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
return parts.join('\n');
|
|
26
|
+
}
|
|
27
|
+
function formatCrossReview(review, agentNames) {
|
|
28
|
+
const fromAvatar = (0, theme_1.getAgentAvatar)(agentNames[review.fromAgentId] ?? 'unknown');
|
|
29
|
+
const fromName = agentNames[review.fromAgentId] ?? review.fromAgentId;
|
|
30
|
+
const toName = agentNames[review.toAgentId] ?? review.toAgentId;
|
|
31
|
+
const verb = CROSS_REVIEW_VERBS[review.stance];
|
|
32
|
+
return `${fromAvatar} ${fromName} → ${toName} ${verb}: "${review.comment}"`;
|
|
33
|
+
}
|
|
34
|
+
function formatConsensus(consensus) {
|
|
35
|
+
const icon = consensus.reached ? '✅' : '❌';
|
|
36
|
+
const agreeCount = consensus.approveCount;
|
|
37
|
+
return `${icon} Consensus: ${agreeCount}/${consensus.totalAgents} | Critical: ${consensus.criticalCount}`;
|
|
38
|
+
}
|
|
39
|
+
function formatDiscussionRound(round) {
|
|
40
|
+
const lines = [];
|
|
41
|
+
for (const opinion of round.opinions) {
|
|
42
|
+
lines.push(formatOpinion(opinion));
|
|
43
|
+
}
|
|
44
|
+
if (round.crossReviews.length > 0) {
|
|
45
|
+
const agentNames = {};
|
|
46
|
+
for (const opinion of round.opinions) {
|
|
47
|
+
agentNames[opinion.agentId] = opinion.agentName;
|
|
48
|
+
}
|
|
49
|
+
for (const review of round.crossReviews) {
|
|
50
|
+
lines.push(formatCrossReview(review, agentNames));
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
const consensus = (0, types_1.calculateConsensus)(round.opinions);
|
|
54
|
+
lines.push(formatConsensus(consensus));
|
|
55
|
+
return lines.join('\n');
|
|
56
|
+
}
|
|
57
|
+
//# sourceMappingURL=terminal-formatter.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"terminal-formatter.js","sourceRoot":"","sources":["../../../src/collaboration/terminal-formatter.ts"],"names":[],"mappings":";;AAiBA,sCAcC;AAGD,8CAOC;AAGD,0CAIC;AAGD,sDAwBC;AArED,mCAA2D;AAC3D,8CAAoD;AAGpD,MAAM,kBAAkB,GAAqC;IAC3D,OAAO,EAAE,QAAQ;IACjB,OAAO,EAAE,OAAO;IAChB,MAAM,EAAE,WAAW;CACpB,CAAC;AAGF,SAAgB,aAAa,CAAC,OAAqB;IACjD,MAAM,MAAM,GAAG,IAAA,sBAAc,EAAC,OAAO,CAAC,SAAS,CAAC,CAAC;IACjD,MAAM,IAAI,GAAG,oBAAY,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;IAC1C,MAAM,KAAK,GAAG;QACZ,GAAG,MAAM,IAAI,OAAO,CAAC,SAAS,MAAM,IAAI,IAAI,OAAO,CAAC,MAAM,MAAM,OAAO,CAAC,SAAS,GAAG;KACrF,CAAC;IAEF,IAAI,OAAO,CAAC,gBAAgB,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QACxC,KAAK,MAAM,MAAM,IAAI,OAAO,CAAC,gBAAgB,EAAE,CAAC;YAC9C,KAAK,CAAC,IAAI,CAAC,OAAO,MAAM,EAAE,CAAC,CAAC;QAC9B,CAAC;IACH,CAAC;IAED,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AAC1B,CAAC;AAGD,SAAgB,iBAAiB,CAAC,MAAmB,EAAE,UAAkC;IACvF,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