repoburg 1.3.20 → 1.3.22
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/backend/.env +2 -2
- package/backend/.repoburg/hooks/README.md +53 -0
- package/backend/.repoburg/hooks/eslint-hook.ts +46 -0
- package/backend/.repoburg/hooks/example-hook.ts +62 -0
- package/backend/dist/src/app.module.js +6 -0
- package/backend/dist/src/app.module.js.map +1 -1
- package/backend/dist/src/core-entities/index.d.ts +1 -0
- package/backend/dist/src/core-entities/index.js +1 -0
- package/backend/dist/src/core-entities/index.js.map +1 -1
- package/backend/dist/src/core-entities/tool-hook.entity.d.ts +7 -0
- package/backend/dist/src/core-entities/tool-hook.entity.js +37 -0
- package/backend/dist/src/core-entities/tool-hook.entity.js.map +1 -0
- package/backend/dist/src/interactive-chat/chat.module.js +2 -0
- package/backend/dist/src/interactive-chat/chat.module.js.map +1 -1
- package/backend/dist/src/interactive-chat/chat.service.d.ts +3 -1
- package/backend/dist/src/interactive-chat/chat.service.js +9 -2
- package/backend/dist/src/interactive-chat/chat.service.js.map +1 -1
- package/backend/dist/src/llm-orchestration/llm-orchestration.interfaces.d.ts +1 -1
- package/backend/dist/src/llm-orchestration/llm-orchestration.module.js +87 -50
- package/backend/dist/src/llm-orchestration/llm-orchestration.module.js.map +1 -1
- package/backend/dist/src/llm-orchestration/llm-turn-processor.service.d.ts +3 -1
- package/backend/dist/src/llm-orchestration/llm-turn-processor.service.js +70 -2
- package/backend/dist/src/llm-orchestration/llm-turn-processor.service.js.map +1 -1
- package/backend/dist/src/message-bus/dto/submit-message.dto.d.ts +4 -0
- package/backend/dist/src/message-bus/dto/submit-message.dto.js +22 -0
- package/backend/dist/src/message-bus/dto/submit-message.dto.js.map +1 -0
- package/backend/dist/src/message-bus/message-bus.controller.d.ts +13 -0
- package/backend/dist/src/message-bus/message-bus.controller.js +50 -0
- package/backend/dist/src/message-bus/message-bus.controller.js.map +1 -0
- package/backend/dist/src/message-bus/message-bus.module.d.ts +2 -0
- package/backend/dist/src/message-bus/message-bus.module.js +23 -0
- package/backend/dist/src/message-bus/message-bus.module.js.map +1 -0
- package/backend/dist/src/message-bus/message-bus.service.d.ts +7 -0
- package/backend/dist/src/message-bus/message-bus.service.js +32 -0
- package/backend/dist/src/message-bus/message-bus.service.js.map +1 -0
- package/backend/dist/src/seeding/data/system-prompts/default_master-agent.d.ts +1 -1
- package/backend/dist/src/seeding/data/system-prompts/default_master-agent.js +2 -2
- package/backend/dist/src/seeding/data/tool-hooks/eslint-hook.d.ts +2 -0
- package/backend/dist/src/seeding/data/tool-hooks/eslint-hook.js +52 -0
- package/backend/dist/src/seeding/data/tool-hooks/eslint-hook.js.map +1 -0
- package/backend/dist/src/seeding/data/tool-hooks/example-hook.d.ts +2 -0
- package/backend/dist/src/seeding/data/tool-hooks/example-hook.js +68 -0
- package/backend/dist/src/seeding/data/tool-hooks/example-hook.js.map +1 -0
- package/backend/dist/src/seeding/data/tool-hooks/readme.d.ts +2 -0
- package/backend/dist/src/seeding/data/tool-hooks/readme.js +59 -0
- package/backend/dist/src/seeding/data/tool-hooks/readme.js.map +1 -0
- package/backend/dist/src/sessions/sessions.module.js +2 -0
- package/backend/dist/src/sessions/sessions.module.js.map +1 -1
- package/backend/dist/src/sessions/sessions.service.d.ts +3 -1
- package/backend/dist/src/sessions/sessions.service.js +6 -2
- package/backend/dist/src/sessions/sessions.service.js.map +1 -1
- package/backend/dist/src/tool-hooks/dto/create-tool-hook.dto.d.ts +6 -0
- package/backend/dist/src/tool-hooks/dto/create-tool-hook.dto.js +36 -0
- package/backend/dist/src/tool-hooks/dto/create-tool-hook.dto.js.map +1 -0
- package/backend/dist/src/tool-hooks/dto/update-tool-hook.dto.d.ts +6 -0
- package/backend/dist/src/tool-hooks/dto/update-tool-hook.dto.js +38 -0
- package/backend/dist/src/tool-hooks/dto/update-tool-hook.dto.js.map +1 -0
- package/backend/dist/src/tool-hooks/tool-hooks.controller.d.ts +27 -0
- package/backend/dist/src/tool-hooks/tool-hooks.controller.js +123 -0
- package/backend/dist/src/tool-hooks/tool-hooks.controller.js.map +1 -0
- package/backend/dist/src/tool-hooks/tool-hooks.module.d.ts +2 -0
- package/backend/dist/src/tool-hooks/tool-hooks.module.js +27 -0
- package/backend/dist/src/tool-hooks/tool-hooks.module.js.map +1 -0
- package/backend/dist/src/tool-hooks/tool-hooks.service.d.ts +31 -0
- package/backend/dist/src/tool-hooks/tool-hooks.service.js +337 -0
- package/backend/dist/src/tool-hooks/tool-hooks.service.js.map +1 -0
- package/backend/dist/tsconfig.build.tsbuildinfo +1 -1
- package/package.json +3 -3
package/backend/.env
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#REPOBURG_PROJECT_PATH='/Users/celalertug/WebstormProjects/hihiho'
|
|
2
|
-
REPOBURG_PROJECT_PATH='/Users/celalertug/github/webcoder'
|
|
2
|
+
#REPOBURG_PROJECT_PATH='/Users/celalertug/github/webcoder'
|
|
3
3
|
#REPOBURG_PROJECT_PATH='/Users/celalertug/WebstormProjects/appdb'
|
|
4
4
|
#REPOBURG_PROJECT_PATH='/tmp/a/cleanappdev'
|
|
5
5
|
#REPOBURG_PROJECT_PATH='/Users/celalertug/everest/cleanappdev'
|
|
@@ -7,7 +7,7 @@ REPOBURG_PROJECT_PATH='/Users/celalertug/github/webcoder'
|
|
|
7
7
|
|
|
8
8
|
#react project
|
|
9
9
|
#REPOBURG_PROJECT_PATH='/Users/celalertug/WebstormProjects/ttt1234'
|
|
10
|
-
|
|
10
|
+
REPOBURG_PROJECT_PATH=/Users/celalertug/Desktop/tmp/repoburg-preview-boilerplate-main
|
|
11
11
|
|
|
12
12
|
#modern football
|
|
13
13
|
#REPOBURG_PROJECT_PATH=/Users/celalertug/WebstormProjects/fm1
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
# Repoburg Tool Hooks
|
|
2
|
+
|
|
3
|
+
This directory contains TypeScript scripts that can be attached to AI tool execution events.
|
|
4
|
+
You can configure these hooks in the "Tool Hooks" section of the Repoburg UI.
|
|
5
|
+
|
|
6
|
+
## How it works
|
|
7
|
+
|
|
8
|
+
1. **Create a script** in this folder (e.g., `audit-patch.ts`).
|
|
9
|
+
2. **Go to UI**: Open Repoburg -> Tool Hooks -> Add Hook.
|
|
10
|
+
3. **Configure**: Select the tool (e.g., `patch`), timing (`before` or `after`), and your script.
|
|
11
|
+
|
|
12
|
+
## Script Interface
|
|
13
|
+
|
|
14
|
+
Your script must **export a default function** that receives the context.
|
|
15
|
+
|
|
16
|
+
### Input Context
|
|
17
|
+
|
|
18
|
+
```typescript
|
|
19
|
+
interface HookContext {
|
|
20
|
+
hook_type: 'before' | 'after';
|
|
21
|
+
|
|
22
|
+
action: {
|
|
23
|
+
tool_name: string; // e.g. "patch"
|
|
24
|
+
args: any; // e.g. { file_path: "src/app.ts", patch_code: "..." }
|
|
25
|
+
|
|
26
|
+
// Only present for 'after' hooks
|
|
27
|
+
result?: {
|
|
28
|
+
status: 'SUCCESS' | 'FAILURE';
|
|
29
|
+
output?: string;
|
|
30
|
+
error?: string;
|
|
31
|
+
};
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
plan_context: any; // Shared state of the current AI plan
|
|
35
|
+
}
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
### Output Format
|
|
39
|
+
|
|
40
|
+
Your function should return an object (or void if passive):
|
|
41
|
+
|
|
42
|
+
```typescript
|
|
43
|
+
interface HookOutput {
|
|
44
|
+
// If true, the AI plan stops immediately.
|
|
45
|
+
should_halt_plan?: boolean;
|
|
46
|
+
|
|
47
|
+
// Optional message to log in the UI
|
|
48
|
+
message?: string;
|
|
49
|
+
|
|
50
|
+
// Optional data to merge back into the plan context
|
|
51
|
+
update_context?: Record<string, any>;
|
|
52
|
+
}
|
|
53
|
+
```
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ESLint Validation Hook
|
|
3
|
+
*
|
|
4
|
+
* Usage: Attach as 'after' hook to 'create_file', 'edit_file', 'patch'.
|
|
5
|
+
*/
|
|
6
|
+
import { exec } from 'child_process';
|
|
7
|
+
import { promisify } from 'util';
|
|
8
|
+
|
|
9
|
+
const execAsync = promisify(exec);
|
|
10
|
+
|
|
11
|
+
// Redefining types locally since this runs in a standalone VM context
|
|
12
|
+
export interface HookContext {
|
|
13
|
+
action: {
|
|
14
|
+
tool_name: string;
|
|
15
|
+
args: { file_path?: string; [key: string]: any };
|
|
16
|
+
};
|
|
17
|
+
plan_context: {
|
|
18
|
+
feedback: {
|
|
19
|
+
validationErrors: Array<{ tool_name: string; error: string }>;
|
|
20
|
+
};
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export default async function(context: HookContext) {
|
|
25
|
+
const filePath = context.action.args.file_path;
|
|
26
|
+
if (!filePath) return;
|
|
27
|
+
|
|
28
|
+
console.log(`[Hook] Running ESLint on ${filePath}`);
|
|
29
|
+
|
|
30
|
+
try {
|
|
31
|
+
// Adjust command as needed for your project structure
|
|
32
|
+
// We use --no-color to keep the error message clean for the AI
|
|
33
|
+
await execAsync(`npx eslint "${filePath}" --no-color`);
|
|
34
|
+
} catch (e: any) {
|
|
35
|
+
const errorOutput = e.stdout || e.stderr || e.message;
|
|
36
|
+
|
|
37
|
+
console.log(`[Hook] ESLint failed for ${filePath}`);
|
|
38
|
+
|
|
39
|
+
// Inject error into the shared plan context
|
|
40
|
+
// The orchestration engine will pick this up and present it to the AI in the next turn (or immediate feedback)
|
|
41
|
+
context.plan_context.feedback.validationErrors.push({
|
|
42
|
+
tool_name: context.action.tool_name,
|
|
43
|
+
error: `ESLint check failed:\n${errorOutput}`
|
|
44
|
+
});
|
|
45
|
+
}
|
|
46
|
+
}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Example Hook Script
|
|
3
|
+
*
|
|
4
|
+
* Usage:
|
|
5
|
+
* 1. Attach to 'patch' or 'edit_file' tool as a 'before' hook.
|
|
6
|
+
* 2. It will block edits to any file with 'lock' in the name.
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
// --- Type Definitions ---
|
|
10
|
+
|
|
11
|
+
export interface HookAction {
|
|
12
|
+
tool_name: string;
|
|
13
|
+
args: Record<string, any>;
|
|
14
|
+
// Only present for 'after' hooks
|
|
15
|
+
result?: {
|
|
16
|
+
status: 'SUCCESS' | 'FAILURE';
|
|
17
|
+
output?: string;
|
|
18
|
+
error?: string;
|
|
19
|
+
};
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
export interface HookContext {
|
|
23
|
+
hook_type: 'before' | 'after';
|
|
24
|
+
action: HookAction;
|
|
25
|
+
plan_context: any; // Shared state of the current AI plan
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
export interface HookOutput {
|
|
29
|
+
// If true, the AI plan stops immediately.
|
|
30
|
+
should_halt_plan?: boolean;
|
|
31
|
+
|
|
32
|
+
// Optional message to log in the UI
|
|
33
|
+
message?: string;
|
|
34
|
+
|
|
35
|
+
// Optional data to merge back into the plan context
|
|
36
|
+
update_context?: Record<string, any>;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
// --- Hook Logic ---
|
|
40
|
+
|
|
41
|
+
export default async function(context: HookContext): Promise<HookOutput | void> {
|
|
42
|
+
// 1. Extract Data
|
|
43
|
+
const filePath = context.action?.args?.file_path || '';
|
|
44
|
+
|
|
45
|
+
// Log to console (appears in backend logs)
|
|
46
|
+
console.log(`[Hook] analyzing action on: ${filePath}`);
|
|
47
|
+
|
|
48
|
+
// 2. Logic
|
|
49
|
+
if (filePath.includes('lock')) {
|
|
50
|
+
// Return Halt Signal
|
|
51
|
+
return {
|
|
52
|
+
should_halt_plan: true,
|
|
53
|
+
message: `BLOCKED: Editing files with "lock" in the name is forbidden by policy. File: ${filePath}`
|
|
54
|
+
};
|
|
55
|
+
} else {
|
|
56
|
+
// Return Pass Signal
|
|
57
|
+
return {
|
|
58
|
+
should_halt_plan: false,
|
|
59
|
+
message: `Hook allowed action on ${filePath}`
|
|
60
|
+
};
|
|
61
|
+
}
|
|
62
|
+
}
|
|
@@ -35,6 +35,9 @@ const chat_module_1 = require("./interactive-chat/chat.module");
|
|
|
35
35
|
const mcp_module_1 = require("./mcp/mcp.module");
|
|
36
36
|
const visual_editor_module_1 = require("./visual-editor/visual-editor.module");
|
|
37
37
|
const custom_variables_module_1 = require("./custom-variables/custom-variables.module");
|
|
38
|
+
const tool_hooks_module_1 = require("./tool-hooks/tool-hooks.module");
|
|
39
|
+
const core_entities_2 = require("./core-entities");
|
|
40
|
+
const message_bus_module_1 = require("./message-bus/message-bus.module");
|
|
38
41
|
let dbPath = ':memory:';
|
|
39
42
|
if (process.env.NODE_ENV === 'production') {
|
|
40
43
|
const projectPath = process.env.REPOBURG_PROJECT_PATH || process.cwd();
|
|
@@ -68,6 +71,7 @@ exports.AppModule = AppModule = __decorate([
|
|
|
68
71
|
core_entities_1.McpConfig,
|
|
69
72
|
core_entities_1.McpTool,
|
|
70
73
|
core_entities_1.CustomVariable,
|
|
74
|
+
core_entities_2.ToolHook,
|
|
71
75
|
],
|
|
72
76
|
synchronize: true,
|
|
73
77
|
autoLoadEntities: true,
|
|
@@ -93,6 +97,8 @@ exports.AppModule = AppModule = __decorate([
|
|
|
93
97
|
mcp_module_1.McpModule,
|
|
94
98
|
visual_editor_module_1.VisualEditorModule,
|
|
95
99
|
custom_variables_module_1.CustomVariablesModule,
|
|
100
|
+
tool_hooks_module_1.ToolHooksModule,
|
|
101
|
+
message_bus_module_1.MessageBusModule,
|
|
96
102
|
],
|
|
97
103
|
controllers: [app_controller_1.AppController],
|
|
98
104
|
providers: [app_service_1.AppService],
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"app.module.js","sourceRoot":"","sources":["../../src/app.module.ts"],"names":[],"mappings":";;;;;;;;;AAAA,2CAAwC;AACxC,qDAAiD;AACjD,+CAA2C;AAC3C,6CAAgD;AAChD,mDAcyB;AACzB,gEAA4D;AAC5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C,SAAS,CAAC,KAAK,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;IAC3C,CAAC;IACD,MAAM,GAAG,IAAI,CAAC,IAAI,CAAC,KAAK,EAAE,aAAa,CAAC,CAAC;IACzC,OAAO,CAAC,GAAG,CAAC,iCAAiC,MAAM,EAAE,CAAC,CAAC;AACzD,CAAC;AAqDM,IAAM,SAAS,GAAf,MAAM,SAAS;CAAG,CAAA;AAAZ,8BAAS;oBAAT,SAAS;IAnDrB,IAAA,eAAM,EAAC;QACN,OAAO,EAAE;YACP,uBAAa,CAAC,OAAO,CAAC;gBACpB,IAAI,EAAE,QAAQ;gBACd,QAAQ,EAAE,MAAM;gBAChB,QAAQ,EAAE;oBACR,uBAAO;oBACP,uBAAO;oBACP,+BAAe;oBACf,4BAAY;oBACZ,wBAAQ;oBACR,4BAAY;oBACZ,4BAAY;oBACZ,6BAAa;oBACb,gCAAgB;oBAChB,8BAAc;oBACd,yBAAS;oBACT,uBAAO;oBACP,8BAAc;oBACd,wBAAQ;iBACT;gBACD,WAAW,EAAE,IAAI;gBACjB,gBAAgB,EAAE,IAAI;aACvB,CAAC;YACF,gCAAc;YACd,gCAAc;YACd,2CAAmB;YACnB,mCAAe;YACf,2CAAmB;YACnB,iDAAsB;YACtB,mDAAuB;YACvB,2CAAmB;YACnB,8BAAa;YACb,kCAAe;YACf,6CAAoB;YACpB,+CAAqB;YACrB,+CAAqB;YACrB,iDAAsB;YACtB,yCAAkB;YAClB,4BAAY;YACZ,+CAAqB;YACrB,mCAAqB;YACrB,sBAAS;YACT,yCAAkB;YAClB,+CAAqB;YACrB,mCAAe;YACf,qCAAgB;SACjB;QACD,WAAW,EAAE,CAAC,8BAAa,CAAC;QAC5B,SAAS,EAAE,CAAC,wBAAU,CAAC;KACxB,CAAC;GACW,SAAS,CAAG"}
|
|
@@ -28,4 +28,5 @@ __exportStar(require("./context-snippet.entity"), exports);
|
|
|
28
28
|
__exportStar(require("./mcp-config.entity"), exports);
|
|
29
29
|
__exportStar(require("./mcp-tool.entity"), exports);
|
|
30
30
|
__exportStar(require("./custom-variable.entity"), exports);
|
|
31
|
+
__exportStar(require("./tool-hook.entity"), exports);
|
|
31
32
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/core-entities/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,gDAA8B;AAC9B,mDAAiC;AACjC,mDAAiC;AACjC,4DAA0C;AAC1C,yDAAuC;AACvC,qDAAmC;AACnC,yDAAuC;AACvC,yDAAuC;AACvC,0DAAwC;AACxC,6DAA2C;AAC3C,2DAAyC;AACzC,sDAAoC;AACpC,oDAAkC;AAClC,2DAAyC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/core-entities/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,gDAA8B;AAC9B,mDAAiC;AACjC,mDAAiC;AACjC,4DAA0C;AAC1C,yDAAuC;AACvC,qDAAmC;AACnC,yDAAuC;AACvC,yDAAuC;AACvC,0DAAwC;AACxC,6DAA2C;AAC3C,2DAAyC;AACzC,sDAAoC;AACpC,oDAAkC;AAClC,2DAAyC;AACzC,qDAAmC"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.ToolHook = void 0;
|
|
13
|
+
const typeorm_1 = require("typeorm");
|
|
14
|
+
const base_entity_1 = require("./base.entity");
|
|
15
|
+
let ToolHook = class ToolHook extends base_entity_1.BaseEntity {
|
|
16
|
+
};
|
|
17
|
+
exports.ToolHook = ToolHook;
|
|
18
|
+
__decorate([
|
|
19
|
+
(0, typeorm_1.Column)(),
|
|
20
|
+
__metadata("design:type", String)
|
|
21
|
+
], ToolHook.prototype, "tool_name", void 0);
|
|
22
|
+
__decorate([
|
|
23
|
+
(0, typeorm_1.Column)(),
|
|
24
|
+
__metadata("design:type", String)
|
|
25
|
+
], ToolHook.prototype, "timing", void 0);
|
|
26
|
+
__decorate([
|
|
27
|
+
(0, typeorm_1.Column)(),
|
|
28
|
+
__metadata("design:type", String)
|
|
29
|
+
], ToolHook.prototype, "script_filename", void 0);
|
|
30
|
+
__decorate([
|
|
31
|
+
(0, typeorm_1.Column)({ default: true }),
|
|
32
|
+
__metadata("design:type", Boolean)
|
|
33
|
+
], ToolHook.prototype, "is_active", void 0);
|
|
34
|
+
exports.ToolHook = ToolHook = __decorate([
|
|
35
|
+
(0, typeorm_1.Entity)('tool_hooks')
|
|
36
|
+
], ToolHook);
|
|
37
|
+
//# sourceMappingURL=tool-hook.entity.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tool-hook.entity.js","sourceRoot":"","sources":["../../../src/core-entities/tool-hook.entity.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,qCAAyC;AACzC,+CAA2C;AAGpC,IAAM,QAAQ,GAAd,MAAM,QAAS,SAAQ,wBAAU;CAYvC,CAAA;AAZY,4BAAQ;AAEnB;IADC,IAAA,gBAAM,GAAE;;2CACS;AAGlB;IADC,IAAA,gBAAM,GAAE;;wCACkB;AAG3B;IADC,IAAA,gBAAM,GAAE;;iDACe;AAGxB;IADC,IAAA,gBAAM,EAAC,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;;2CACP;mBAXR,QAAQ;IADpB,IAAA,gBAAM,EAAC,YAAY,CAAC;GACR,QAAQ,CAYpB"}
|
|
@@ -13,6 +13,7 @@ const llm_provider_module_1 = require("../llm-provider/llm-provider.module");
|
|
|
13
13
|
const events_module_1 = require("../events/events.module");
|
|
14
14
|
const llm_responses_module_1 = require("../llm-responses/llm-responses.module");
|
|
15
15
|
const application_state_module_1 = require("../application-state/application-state.module");
|
|
16
|
+
const message_bus_module_1 = require("../message-bus/message-bus.module");
|
|
16
17
|
let InteractiveChatModule = class InteractiveChatModule {
|
|
17
18
|
};
|
|
18
19
|
exports.InteractiveChatModule = InteractiveChatModule;
|
|
@@ -23,6 +24,7 @@ exports.InteractiveChatModule = InteractiveChatModule = __decorate([
|
|
|
23
24
|
events_module_1.EventsModule,
|
|
24
25
|
(0, common_1.forwardRef)(() => llm_responses_module_1.LlmResponsesModule),
|
|
25
26
|
application_state_module_1.ApplicationStateModule,
|
|
27
|
+
message_bus_module_1.MessageBusModule,
|
|
26
28
|
],
|
|
27
29
|
providers: [chat_service_1.ChatService],
|
|
28
30
|
exports: [chat_service_1.ChatService],
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"chat.module.js","sourceRoot":"","sources":["../../../src/interactive-chat/chat.module.ts"],"names":[],"mappings":";;;;;;;;;AAAA,2CAAoD;AACpD,iDAA6C;AAC7C,6EAAwE;AACxE,2DAAuD;AACvD,gFAA2E;AAC3E,4FAAuF;
|
|
1
|
+
{"version":3,"file":"chat.module.js","sourceRoot":"","sources":["../../../src/interactive-chat/chat.module.ts"],"names":[],"mappings":";;;;;;;;;AAAA,2CAAoD;AACpD,iDAA6C;AAC7C,6EAAwE;AACxE,2DAAuD;AACvD,gFAA2E;AAC3E,4FAAuF;AACvF,0EAAqE;AAa9D,IAAM,qBAAqB,GAA3B,MAAM,qBAAqB;CAAG,CAAA;AAAxB,sDAAqB;gCAArB,qBAAqB;IAXjC,IAAA,eAAM,EAAC;QACN,OAAO,EAAE;YACP,uCAAiB;YACjB,4BAAY;YACZ,IAAA,mBAAU,EAAC,GAAG,EAAE,CAAC,yCAAkB,CAAC;YACpC,iDAAsB;YACtB,qCAAgB;SACjB;QACD,SAAS,EAAE,CAAC,0BAAW,CAAC;QACxB,OAAO,EAAE,CAAC,0BAAW,CAAC;KACvB,CAAC;GACW,qBAAqB,CAAG"}
|
|
@@ -2,14 +2,16 @@ import { LlmProvider, LlmContent } from '../llm-provider/llm-provider.interface'
|
|
|
2
2
|
import { EventsGateway } from '../events/events.gateway';
|
|
3
3
|
import { LlmResponsesService } from '../llm-responses/llm-responses.service';
|
|
4
4
|
import { ApplicationStateService } from '../application-state/application-state.service';
|
|
5
|
+
import { MessageBusService } from '../message-bus/message-bus.service';
|
|
5
6
|
export declare class ChatService {
|
|
6
7
|
private readonly llmProvider;
|
|
7
8
|
private readonly eventsGateway;
|
|
8
9
|
private readonly llmResponsesService;
|
|
9
10
|
private readonly applicationStateService;
|
|
11
|
+
private readonly messageBusService;
|
|
10
12
|
private readonly logger;
|
|
11
13
|
private chatStates;
|
|
12
|
-
constructor(llmProvider: LlmProvider, eventsGateway: EventsGateway, llmResponsesService: LlmResponsesService, applicationStateService: ApplicationStateService);
|
|
14
|
+
constructor(llmProvider: LlmProvider, eventsGateway: EventsGateway, llmResponsesService: LlmResponsesService, applicationStateService: ApplicationStateService, messageBusService: MessageBusService);
|
|
13
15
|
private getOrCreateState;
|
|
14
16
|
hasChat(sessionId: string): boolean;
|
|
15
17
|
setSystemInstruction(sessionId: string, instruction: string | null): void;
|
|
@@ -20,12 +20,14 @@ const events_gateway_1 = require("../events/events.gateway");
|
|
|
20
20
|
const llm_responses_service_1 = require("../llm-responses/llm-responses.service");
|
|
21
21
|
const submit_llm_response_dto_1 = require("../llm-responses/dto/submit-llm-response.dto");
|
|
22
22
|
const application_state_service_1 = require("../application-state/application-state.service");
|
|
23
|
+
const message_bus_service_1 = require("../message-bus/message-bus.service");
|
|
23
24
|
let ChatService = ChatService_1 = class ChatService {
|
|
24
|
-
constructor(llmProvider, eventsGateway, llmResponsesService, applicationStateService) {
|
|
25
|
+
constructor(llmProvider, eventsGateway, llmResponsesService, applicationStateService, messageBusService) {
|
|
25
26
|
this.llmProvider = llmProvider;
|
|
26
27
|
this.eventsGateway = eventsGateway;
|
|
27
28
|
this.llmResponsesService = llmResponsesService;
|
|
28
29
|
this.applicationStateService = applicationStateService;
|
|
30
|
+
this.messageBusService = messageBusService;
|
|
29
31
|
this.logger = new common_1.Logger(ChatService_1.name);
|
|
30
32
|
this.chatStates = new Map();
|
|
31
33
|
}
|
|
@@ -56,6 +58,10 @@ let ChatService = ChatService_1 = class ChatService {
|
|
|
56
58
|
const historyForProvider = [...state.history];
|
|
57
59
|
state.history.push({ role: 'user', parts: [{ text: message }] });
|
|
58
60
|
if (isManual) {
|
|
61
|
+
this.messageBusService.submit({
|
|
62
|
+
event: 'llm-input-generated',
|
|
63
|
+
data: { prompt: message },
|
|
64
|
+
});
|
|
59
65
|
this.eventsGateway.sendToAll('llm-input-generated', { prompt: message });
|
|
60
66
|
this.eventsGateway.sendToAll('refresh-ui', {});
|
|
61
67
|
return;
|
|
@@ -91,6 +97,7 @@ exports.ChatService = ChatService = ChatService_1 = __decorate([
|
|
|
91
97
|
__param(2, (0, common_1.Inject)((0, common_1.forwardRef)(() => llm_responses_service_1.LlmResponsesService))),
|
|
92
98
|
__metadata("design:paramtypes", [Object, events_gateway_1.EventsGateway,
|
|
93
99
|
llm_responses_service_1.LlmResponsesService,
|
|
94
|
-
application_state_service_1.ApplicationStateService
|
|
100
|
+
application_state_service_1.ApplicationStateService,
|
|
101
|
+
message_bus_service_1.MessageBusService])
|
|
95
102
|
], ChatService);
|
|
96
103
|
//# sourceMappingURL=chat.service.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"chat.service.js","sourceRoot":"","sources":["../../../src/interactive-chat/chat.service.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,2CAAwE;AACxE,mFAIgD;AAChD,6DAAyD;AACzD,kFAA6E;AAC7E,0FAA2E;AAC3E,8FAAyF;
|
|
1
|
+
{"version":3,"file":"chat.service.js","sourceRoot":"","sources":["../../../src/interactive-chat/chat.service.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,2CAAwE;AACxE,mFAIgD;AAChD,6DAAyD;AACzD,kFAA6E;AAC7E,0FAA2E;AAC3E,8FAAyF;AACzF,4EAAuE;AAQhE,IAAM,WAAW,mBAAjB,MAAM,WAAW;IAItB,YAEE,WAAyC,EACxB,aAA4B,EAE7C,mBAAyD,EACxC,uBAAgD,EAChD,iBAAoC;QALpC,gBAAW,GAAX,WAAW,CAAa;QACxB,kBAAa,GAAb,aAAa,CAAe;QAE5B,wBAAmB,GAAnB,mBAAmB,CAAqB;QACxC,4BAAuB,GAAvB,uBAAuB,CAAyB;QAChD,sBAAiB,GAAjB,iBAAiB,CAAmB;QAVtC,WAAM,GAAG,IAAI,eAAM,CAAC,aAAW,CAAC,IAAI,CAAC,CAAC;QAC/C,eAAU,GAAG,IAAI,GAAG,EAAqB,CAAC;IAU/C,CAAC;IAEI,gBAAgB,CAAC,SAAiB;QACxC,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,SAAS,CAAC,EAAE,CAAC;YACpC,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,SAAS,EAAE;gBAC7B,iBAAiB,EAAE,IAAI;gBACvB,OAAO,EAAE,EAAE;aACZ,CAAC,CAAC;QACL,CAAC;QACD,OAAO,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,SAAS,CAAE,CAAC;IACzC,CAAC;IAEM,OAAO,CAAC,SAAiB;QAC9B,OAAO,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,SAAS,C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
45
|
};
|
|
46
46
|
flags: {
|
|
47
47
|
should_halt: boolean;
|
|
48
|
-
halt_reason?:
|
|
48
|
+
halt_reason?: string;
|
|
49
49
|
is_final: boolean;
|
|
50
50
|
follow_up_initiated: boolean;
|
|
51
51
|
should_halt_hooks?: boolean;
|
|
@@ -9,59 +9,39 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
9
9
|
exports.LlmOrchestrationModule = void 0;
|
|
10
10
|
const common_1 = require("@nestjs/common");
|
|
11
11
|
const typeorm_1 = require("@nestjs/typeorm");
|
|
12
|
-
const core_entities_1 = require("../core-entities");
|
|
13
12
|
const llm_output_parser_service_1 = require("./parser/llm-output-parser.service");
|
|
14
13
|
const llm_turn_processor_service_1 = require("./llm-turn-processor.service");
|
|
15
|
-
const
|
|
16
|
-
const yolo_mode_post_execution_hook_1 = require("./hooks/yolo-mode-post-execution.hook");
|
|
17
|
-
const application_state_module_1 = require("../application-state/application-state.module");
|
|
18
|
-
const chat_module_1 = require("../interactive-chat/chat.module");
|
|
14
|
+
const ai_actions_module_1 = require("../ai-actions/ai-actions.module");
|
|
19
15
|
const session_inputs_module_1 = require("../session-inputs/session-inputs.module");
|
|
16
|
+
const chat_module_1 = require("../interactive-chat/chat.module");
|
|
20
17
|
const events_module_1 = require("../events/events.module");
|
|
18
|
+
const application_state_module_1 = require("../application-state/application-state.module");
|
|
19
|
+
const core_entities_1 = require("../core-entities");
|
|
20
|
+
const execution_logs_module_1 = require("../execution-logs/execution-logs.module");
|
|
21
21
|
const system_prompts_module_1 = require("../system-prompts/system-prompts.module");
|
|
22
22
|
const sessions_module_1 = require("../sessions/sessions.module");
|
|
23
|
-
const
|
|
24
|
-
const use_mcp_tool_handler_1 = require("./action-handlers/use-mcp-tool.handler");
|
|
25
|
-
const request_context_handler_1 = require("./action-handlers/request-context.handler");
|
|
26
|
-
const new_session_handler_1 = require("./action-handlers/new-session.handler");
|
|
27
|
-
const final_handler_1 = require("./action-handlers/final.handler");
|
|
23
|
+
const workspace_module_1 = require("../workspace/workspace.module");
|
|
28
24
|
const mcp_module_1 = require("../mcp/mcp.module");
|
|
29
|
-
const
|
|
25
|
+
const tool_hooks_module_1 = require("../tool-hooks/tool-hooks.module");
|
|
30
26
|
const create_file_handler_1 = require("./action-handlers/create-file.handler");
|
|
31
|
-
const edit_file_handler_1 = require("./action-handlers/edit-file.handler");
|
|
32
27
|
const delete_file_handler_1 = require("./action-handlers/delete-file.handler");
|
|
33
|
-
const
|
|
28
|
+
const edit_file_handler_1 = require("./action-handlers/edit-file.handler");
|
|
29
|
+
const execute_shell_handler_1 = require("./action-handlers/execute-shell.handler");
|
|
30
|
+
const run_command_handler_1 = require("./action-handlers/run-command.handler");
|
|
31
|
+
const request_context_handler_1 = require("./action-handlers/request-context.handler");
|
|
32
|
+
const final_handler_1 = require("./action-handlers/final.handler");
|
|
33
|
+
const use_mcp_tool_handler_1 = require("./action-handlers/use-mcp-tool.handler");
|
|
34
34
|
const quick_edit_handler_1 = require("./action-handlers/quick-edit.handler");
|
|
35
|
-
const invalid_tool_feedback_hook_1 = require("./hooks/invalid-tool-feedback.hook");
|
|
36
|
-
const patch_handler_1 = require("./action-handlers/patch.handler");
|
|
37
35
|
const apply_diff_handler_1 = require("./action-handlers/apply-diff.handler");
|
|
36
|
+
const patch_handler_1 = require("./action-handlers/patch.handler");
|
|
37
|
+
const new_session_handler_1 = require("./action-handlers/new-session.handler");
|
|
38
38
|
const write_todo_handler_1 = require("./action-handlers/write-todo.handler");
|
|
39
|
-
const howto_handler_1 = require("./action-handlers/howto.handler");
|
|
40
|
-
const execute_shell_handler_1 = require("./action-handlers/execute-shell.handler");
|
|
41
39
|
const execute_code_handler_1 = require("./action-handlers/execute-code.handler");
|
|
42
|
-
const
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
apply_diff_handler_1.ApplyDiffHandler,
|
|
48
|
-
patch_handler_1.PatchHandler,
|
|
49
|
-
write_todo_handler_1.WriteTodoHandler,
|
|
50
|
-
run_command_handler_1.RunCommandHandler,
|
|
51
|
-
execute_shell_handler_1.ExecuteShellHandler,
|
|
52
|
-
execute_code_handler_1.ExecuteCodeHandler,
|
|
53
|
-
use_mcp_tool_handler_1.UseMcpToolHandler,
|
|
54
|
-
request_context_handler_1.RequestContextHandler,
|
|
55
|
-
new_session_handler_1.NewSessionHandler,
|
|
56
|
-
final_handler_1.FinalHandler,
|
|
57
|
-
howto_handler_1.HowtoHandler,
|
|
58
|
-
];
|
|
59
|
-
const postExecutionHooks = [
|
|
60
|
-
invalid_tool_feedback_hook_1.InvalidToolFeedbackHook,
|
|
61
|
-
follow_up_post_execution_hook_1.FollowUpPostExecutionHook,
|
|
62
|
-
yolo_mode_post_execution_hook_1.YoloModePostExecutionHook,
|
|
63
|
-
frontend_notification_hook_1.FrontendNotificationHook,
|
|
64
|
-
];
|
|
40
|
+
const howto_handler_1 = require("./action-handlers/howto.handler");
|
|
41
|
+
const invalid_tool_feedback_hook_1 = require("./hooks/invalid-tool-feedback.hook");
|
|
42
|
+
const frontend_notification_hook_1 = require("./hooks/frontend-notification.hook");
|
|
43
|
+
const follow_up_post_execution_hook_1 = require("./hooks/follow-up-post-execution.hook");
|
|
44
|
+
const yolo_mode_post_execution_hook_1 = require("./hooks/yolo-mode-post-execution.hook");
|
|
65
45
|
let LlmOrchestrationModule = class LlmOrchestrationModule {
|
|
66
46
|
};
|
|
67
47
|
exports.LlmOrchestrationModule = LlmOrchestrationModule;
|
|
@@ -69,33 +49,90 @@ exports.LlmOrchestrationModule = LlmOrchestrationModule = __decorate([
|
|
|
69
49
|
(0, common_1.Module)({
|
|
70
50
|
imports: [
|
|
71
51
|
typeorm_1.TypeOrmModule.forFeature([core_entities_1.AIAction, core_entities_1.SessionInput]),
|
|
72
|
-
|
|
73
|
-
(0, common_1.forwardRef)(() => chat_module_1.InteractiveChatModule),
|
|
52
|
+
(0, common_1.forwardRef)(() => ai_actions_module_1.AIActionsModule),
|
|
74
53
|
(0, common_1.forwardRef)(() => session_inputs_module_1.SessionInputsModule),
|
|
54
|
+
(0, common_1.forwardRef)(() => chat_module_1.InteractiveChatModule),
|
|
75
55
|
events_module_1.EventsModule,
|
|
76
56
|
(0, common_1.forwardRef)(() => system_prompts_module_1.SystemPromptsModule),
|
|
77
57
|
sessions_module_1.SessionsModule,
|
|
78
|
-
|
|
58
|
+
application_state_module_1.ApplicationStateModule,
|
|
79
59
|
execution_logs_module_1.ExecutionLogsModule,
|
|
60
|
+
workspace_module_1.WorkspaceModule,
|
|
61
|
+
mcp_module_1.McpModule,
|
|
62
|
+
tool_hooks_module_1.ToolHooksModule,
|
|
80
63
|
],
|
|
81
64
|
providers: [
|
|
82
65
|
llm_output_parser_service_1.LlmOutputParserService,
|
|
83
66
|
llm_turn_processor_service_1.LlmTurnProcessorService,
|
|
84
|
-
|
|
85
|
-
|
|
67
|
+
create_file_handler_1.CreateFileHandler,
|
|
68
|
+
delete_file_handler_1.DeleteFileHandler,
|
|
69
|
+
edit_file_handler_1.EditFileHandler,
|
|
70
|
+
execute_shell_handler_1.ExecuteShellHandler,
|
|
71
|
+
run_command_handler_1.RunCommandHandler,
|
|
72
|
+
request_context_handler_1.RequestContextHandler,
|
|
73
|
+
final_handler_1.FinalHandler,
|
|
74
|
+
use_mcp_tool_handler_1.UseMcpToolHandler,
|
|
75
|
+
quick_edit_handler_1.QuickEditHandler,
|
|
76
|
+
apply_diff_handler_1.ApplyDiffHandler,
|
|
77
|
+
patch_handler_1.PatchHandler,
|
|
78
|
+
new_session_handler_1.NewSessionHandler,
|
|
79
|
+
write_todo_handler_1.WriteTodoHandler,
|
|
80
|
+
execute_code_handler_1.ExecuteCodeHandler,
|
|
81
|
+
howto_handler_1.HowtoHandler,
|
|
82
|
+
invalid_tool_feedback_hook_1.InvalidToolFeedbackHook,
|
|
83
|
+
frontend_notification_hook_1.FrontendNotificationHook,
|
|
84
|
+
follow_up_post_execution_hook_1.FollowUpPostExecutionHook,
|
|
85
|
+
yolo_mode_post_execution_hook_1.YoloModePostExecutionHook,
|
|
86
86
|
{
|
|
87
87
|
provide: 'ACTION_HANDLER_REGISTRY',
|
|
88
|
-
useFactory: (
|
|
88
|
+
useFactory: (createFile, deleteFile, editFile, executeShell, runCommand, requestContext, final, useMcpTool, quickEdit, applyDiff, patch, newSession, writeTodo, executeCode, howto) => {
|
|
89
89
|
const registry = new Map();
|
|
90
|
-
|
|
90
|
+
registry.set(createFile.toolName, createFile);
|
|
91
|
+
registry.set(deleteFile.toolName, deleteFile);
|
|
92
|
+
registry.set(editFile.toolName, editFile);
|
|
93
|
+
registry.set(executeShell.toolName, executeShell);
|
|
94
|
+
registry.set(runCommand.toolName, runCommand);
|
|
95
|
+
registry.set(requestContext.toolName, requestContext);
|
|
96
|
+
registry.set(final.toolName, final);
|
|
97
|
+
registry.set(useMcpTool.toolName, useMcpTool);
|
|
98
|
+
registry.set(quickEdit.toolName, quickEdit);
|
|
99
|
+
registry.set(applyDiff.toolName, applyDiff);
|
|
100
|
+
registry.set(patch.toolName, patch);
|
|
101
|
+
registry.set(newSession.toolName, newSession);
|
|
102
|
+
registry.set(writeTodo.toolName, writeTodo);
|
|
103
|
+
registry.set(executeCode.toolName, executeCode);
|
|
104
|
+
registry.set(howto.toolName, howto);
|
|
91
105
|
return registry;
|
|
92
106
|
},
|
|
93
|
-
inject:
|
|
107
|
+
inject: [
|
|
108
|
+
create_file_handler_1.CreateFileHandler,
|
|
109
|
+
delete_file_handler_1.DeleteFileHandler,
|
|
110
|
+
edit_file_handler_1.EditFileHandler,
|
|
111
|
+
execute_shell_handler_1.ExecuteShellHandler,
|
|
112
|
+
run_command_handler_1.RunCommandHandler,
|
|
113
|
+
request_context_handler_1.RequestContextHandler,
|
|
114
|
+
final_handler_1.FinalHandler,
|
|
115
|
+
use_mcp_tool_handler_1.UseMcpToolHandler,
|
|
116
|
+
quick_edit_handler_1.QuickEditHandler,
|
|
117
|
+
apply_diff_handler_1.ApplyDiffHandler,
|
|
118
|
+
patch_handler_1.PatchHandler,
|
|
119
|
+
new_session_handler_1.NewSessionHandler,
|
|
120
|
+
write_todo_handler_1.WriteTodoHandler,
|
|
121
|
+
execute_code_handler_1.ExecuteCodeHandler,
|
|
122
|
+
howto_handler_1.HowtoHandler,
|
|
123
|
+
],
|
|
94
124
|
},
|
|
95
125
|
{
|
|
96
126
|
provide: 'POST_EXECUTION_HOOKS',
|
|
97
|
-
useFactory: (
|
|
98
|
-
|
|
127
|
+
useFactory: (invalidTool, frontendNotification, followUp, yoloMode) => {
|
|
128
|
+
return [invalidTool, yoloMode, followUp, frontendNotification];
|
|
129
|
+
},
|
|
130
|
+
inject: [
|
|
131
|
+
invalid_tool_feedback_hook_1.InvalidToolFeedbackHook,
|
|
132
|
+
frontend_notification_hook_1.FrontendNotificationHook,
|
|
133
|
+
follow_up_post_execution_hook_1.FollowUpPostExecutionHook,
|
|
134
|
+
yolo_mode_post_execution_hook_1.YoloModePostExecutionHook,
|
|
135
|
+
],
|
|
99
136
|
},
|
|
100
137
|
],
|
|
101
138
|
exports: [llm_turn_processor_service_1.LlmTurnProcessorService, 'ACTION_HANDLER_REGISTRY'],
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"llm-orchestration.module.js","sourceRoot":"","sources":["../../../src/llm-orchestration/llm-orchestration.module.ts"],"names":[],"mappings":";;;;;;;;;AAAA,2CAAoD;AACpD,6CAAgD;AAChD,
|
|
1
|
+
{"version":3,"file":"llm-orchestration.module.js","sourceRoot":"","sources":["../../../src/llm-orchestration/llm-orchestration.module.ts"],"names":[],"mappings":";;;;;;;;;AAAA,2CAAoD;AACpD,6CAAgD;AAChD,kFAA4E;AAC5E,6EAAuE;AACvE,uEAAkE;AAClE,mFAA8E;AAC9E,iEAAwE;AAExE,2DAAuD;AACvD,4FAAuF;AACvF,oDAA0D;AAC1D,mFAA8E;AAE9E,mFAA8E;AAC9E,iEAA6D;AAC7D,oEAAgE;AAChE,kDAA8C;AAC9C,uEAAkE;AAGlE,+EA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,GAAG,CAAC,WAAW,CAAC,QAAQ,EAAE,WAAW,CAAC,CAAC;oBAChD,QAAQ,CAAC,GAAG,CAAC,KAAK,CAAC,QAAQ,EAAE,KAAK,CAAC,CAAC;oBACpC,OAAO,QAAQ,CAAC;gBAClB,CAAC;gBACD,MAAM,EAAE;oBACN,uCAAiB;oBACjB,uCAAiB;oBACjB,mCAAe;oBACf,2CAAmB;oBACnB,uCAAiB;oBACjB,+CAAqB;oBACrB,4BAAY;oBACZ,wCAAiB;oBACjB,qCAAgB;oBAChB,qCAAgB;oBAChB,4BAAY;oBACZ,uCAAiB;oBACjB,qCAAgB;oBAChB,yCAAkB;oBAClB,4BAAY;iBACb;aACF;YACD;gBACE,OAAO,EAAE,sBAAsB;gBAC/B,UAAU,EAAE,CACV,WAAoC,EACpC,oBAA8C,EAC9C,QAAmC,EACnC,QAAmC,EACnC,EAAE;oBAEF,OAAO,CAAC,WAAW,EAAE,QAAQ,EAAE,QAAQ,EAAE,oBAAoB,CAAC,CAAC;gBACjE,CAAC;gBACD,MAAM,EAAE;oBACN,oDAAuB;oBACvB,qDAAwB;oBACxB,yDAAyB;oBACzB,yDAAyB;iBAC1B;aACF;SACF;QACD,OAAO,EAAE,CAAC,oDAAuB,EAAE,yBAAyB,CAAC;KAC9D,CAAC;GACW,sBAAsB,CAAG"}
|
|
@@ -5,6 +5,7 @@ import { ActionHandler } from './action-handlers/action-handler.interface';
|
|
|
5
5
|
import { PostExecutionHook } from './hooks/post-execution-hook.interface';
|
|
6
6
|
import { ApplicationStateService } from '../application-state/application-state.service';
|
|
7
7
|
import { ExecutionLogsService } from '../execution-logs/execution-logs.service';
|
|
8
|
+
import { ToolHooksService } from '../tool-hooks/tool-hooks.service';
|
|
8
9
|
export declare class LlmTurnProcessorService {
|
|
9
10
|
private readonly parser;
|
|
10
11
|
private readonly handlerRegistry;
|
|
@@ -13,8 +14,9 @@ export declare class LlmTurnProcessorService {
|
|
|
13
14
|
private readonly sessionInputsRepository;
|
|
14
15
|
private readonly applicationStateService;
|
|
15
16
|
private readonly executionLogsService;
|
|
17
|
+
private readonly toolHooksService;
|
|
16
18
|
private readonly logger;
|
|
17
|
-
constructor(parser: LlmOutputParserService, handlerRegistry: Map<string, ActionHandler>, postExecutionHooks: PostExecutionHook[], aiActionsRepository: Repository<AIAction>, sessionInputsRepository: Repository<SessionInput>, applicationStateService: ApplicationStateService, executionLogsService: ExecutionLogsService);
|
|
19
|
+
constructor(parser: LlmOutputParserService, handlerRegistry: Map<string, ActionHandler>, postExecutionHooks: PostExecutionHook[], aiActionsRepository: Repository<AIAction>, sessionInputsRepository: Repository<SessionInput>, applicationStateService: ApplicationStateService, executionLogsService: ExecutionLogsService, toolHooksService: ToolHooksService);
|
|
18
20
|
processTurn(sessionInput: SessionInput): Promise<SessionInput>;
|
|
19
21
|
private getSuccessStatusForStrategy;
|
|
20
22
|
}
|