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.
Files changed (68) hide show
  1. package/backend/.env +2 -2
  2. package/backend/.repoburg/hooks/README.md +53 -0
  3. package/backend/.repoburg/hooks/eslint-hook.ts +46 -0
  4. package/backend/.repoburg/hooks/example-hook.ts +62 -0
  5. package/backend/dist/src/app.module.js +6 -0
  6. package/backend/dist/src/app.module.js.map +1 -1
  7. package/backend/dist/src/core-entities/index.d.ts +1 -0
  8. package/backend/dist/src/core-entities/index.js +1 -0
  9. package/backend/dist/src/core-entities/index.js.map +1 -1
  10. package/backend/dist/src/core-entities/tool-hook.entity.d.ts +7 -0
  11. package/backend/dist/src/core-entities/tool-hook.entity.js +37 -0
  12. package/backend/dist/src/core-entities/tool-hook.entity.js.map +1 -0
  13. package/backend/dist/src/interactive-chat/chat.module.js +2 -0
  14. package/backend/dist/src/interactive-chat/chat.module.js.map +1 -1
  15. package/backend/dist/src/interactive-chat/chat.service.d.ts +3 -1
  16. package/backend/dist/src/interactive-chat/chat.service.js +9 -2
  17. package/backend/dist/src/interactive-chat/chat.service.js.map +1 -1
  18. package/backend/dist/src/llm-orchestration/llm-orchestration.interfaces.d.ts +1 -1
  19. package/backend/dist/src/llm-orchestration/llm-orchestration.module.js +87 -50
  20. package/backend/dist/src/llm-orchestration/llm-orchestration.module.js.map +1 -1
  21. package/backend/dist/src/llm-orchestration/llm-turn-processor.service.d.ts +3 -1
  22. package/backend/dist/src/llm-orchestration/llm-turn-processor.service.js +70 -2
  23. package/backend/dist/src/llm-orchestration/llm-turn-processor.service.js.map +1 -1
  24. package/backend/dist/src/message-bus/dto/submit-message.dto.d.ts +4 -0
  25. package/backend/dist/src/message-bus/dto/submit-message.dto.js +22 -0
  26. package/backend/dist/src/message-bus/dto/submit-message.dto.js.map +1 -0
  27. package/backend/dist/src/message-bus/message-bus.controller.d.ts +13 -0
  28. package/backend/dist/src/message-bus/message-bus.controller.js +50 -0
  29. package/backend/dist/src/message-bus/message-bus.controller.js.map +1 -0
  30. package/backend/dist/src/message-bus/message-bus.module.d.ts +2 -0
  31. package/backend/dist/src/message-bus/message-bus.module.js +23 -0
  32. package/backend/dist/src/message-bus/message-bus.module.js.map +1 -0
  33. package/backend/dist/src/message-bus/message-bus.service.d.ts +7 -0
  34. package/backend/dist/src/message-bus/message-bus.service.js +32 -0
  35. package/backend/dist/src/message-bus/message-bus.service.js.map +1 -0
  36. package/backend/dist/src/seeding/data/system-prompts/default_master-agent.d.ts +1 -1
  37. package/backend/dist/src/seeding/data/system-prompts/default_master-agent.js +2 -2
  38. package/backend/dist/src/seeding/data/tool-hooks/eslint-hook.d.ts +2 -0
  39. package/backend/dist/src/seeding/data/tool-hooks/eslint-hook.js +52 -0
  40. package/backend/dist/src/seeding/data/tool-hooks/eslint-hook.js.map +1 -0
  41. package/backend/dist/src/seeding/data/tool-hooks/example-hook.d.ts +2 -0
  42. package/backend/dist/src/seeding/data/tool-hooks/example-hook.js +68 -0
  43. package/backend/dist/src/seeding/data/tool-hooks/example-hook.js.map +1 -0
  44. package/backend/dist/src/seeding/data/tool-hooks/readme.d.ts +2 -0
  45. package/backend/dist/src/seeding/data/tool-hooks/readme.js +59 -0
  46. package/backend/dist/src/seeding/data/tool-hooks/readme.js.map +1 -0
  47. package/backend/dist/src/sessions/sessions.module.js +2 -0
  48. package/backend/dist/src/sessions/sessions.module.js.map +1 -1
  49. package/backend/dist/src/sessions/sessions.service.d.ts +3 -1
  50. package/backend/dist/src/sessions/sessions.service.js +6 -2
  51. package/backend/dist/src/sessions/sessions.service.js.map +1 -1
  52. package/backend/dist/src/tool-hooks/dto/create-tool-hook.dto.d.ts +6 -0
  53. package/backend/dist/src/tool-hooks/dto/create-tool-hook.dto.js +36 -0
  54. package/backend/dist/src/tool-hooks/dto/create-tool-hook.dto.js.map +1 -0
  55. package/backend/dist/src/tool-hooks/dto/update-tool-hook.dto.d.ts +6 -0
  56. package/backend/dist/src/tool-hooks/dto/update-tool-hook.dto.js +38 -0
  57. package/backend/dist/src/tool-hooks/dto/update-tool-hook.dto.js.map +1 -0
  58. package/backend/dist/src/tool-hooks/tool-hooks.controller.d.ts +27 -0
  59. package/backend/dist/src/tool-hooks/tool-hooks.controller.js +123 -0
  60. package/backend/dist/src/tool-hooks/tool-hooks.controller.js.map +1 -0
  61. package/backend/dist/src/tool-hooks/tool-hooks.module.d.ts +2 -0
  62. package/backend/dist/src/tool-hooks/tool-hooks.module.js +27 -0
  63. package/backend/dist/src/tool-hooks/tool-hooks.module.js.map +1 -0
  64. package/backend/dist/src/tool-hooks/tool-hooks.service.d.ts +31 -0
  65. package/backend/dist/src/tool-hooks/tool-hooks.service.js +337 -0
  66. package/backend/dist/src/tool-hooks/tool-hooks.service.js.map +1 -0
  67. package/backend/dist/tsconfig.build.tsbuildinfo +1 -1
  68. package/package.json +3 -3
@@ -24,8 +24,9 @@ const handler_validation_error_1 = require("./errors/handler-validation.error");
24
24
  const ai_actions_service_1 = require("../ai-actions/ai-actions.service");
25
25
  const application_state_service_1 = require("../application-state/application-state.service");
26
26
  const execution_logs_service_1 = require("../execution-logs/execution-logs.service");
27
+ const tool_hooks_service_1 = require("../tool-hooks/tool-hooks.service");
27
28
  let LlmTurnProcessorService = LlmTurnProcessorService_1 = class LlmTurnProcessorService {
28
- constructor(parser, handlerRegistry, postExecutionHooks, aiActionsRepository, sessionInputsRepository, applicationStateService, executionLogsService) {
29
+ constructor(parser, handlerRegistry, postExecutionHooks, aiActionsRepository, sessionInputsRepository, applicationStateService, executionLogsService, toolHooksService) {
29
30
  this.parser = parser;
30
31
  this.handlerRegistry = handlerRegistry;
31
32
  this.postExecutionHooks = postExecutionHooks;
@@ -33,6 +34,7 @@ let LlmTurnProcessorService = LlmTurnProcessorService_1 = class LlmTurnProcessor
33
34
  this.sessionInputsRepository = sessionInputsRepository;
34
35
  this.applicationStateService = applicationStateService;
35
36
  this.executionLogsService = executionLogsService;
37
+ this.toolHooksService = toolHooksService;
36
38
  this.logger = new common_1.Logger(LlmTurnProcessorService_1.name);
37
39
  }
38
40
  async processTurn(sessionInput) {
@@ -68,6 +70,47 @@ let LlmTurnProcessorService = LlmTurnProcessorService_1 = class LlmTurnProcessor
68
70
  for (const action of parsedActions) {
69
71
  const handler = this.handlerRegistry.get(action.tool_name);
70
72
  let result;
73
+ const beforeHooks = await this.toolHooksService.findByTrigger(action.tool_name, 'before');
74
+ let hookHalted = false;
75
+ for (const hook of beforeHooks) {
76
+ try {
77
+ this.logger.log(`Running BEFORE hook: ${hook.script_filename} for tool ${action.tool_name}`);
78
+ const hookResult = await this.toolHooksService.executeHook(hook.script_filename, {
79
+ hook_type: 'before',
80
+ action: { tool_name: action.tool_name, args: action.arguments },
81
+ plan_context: executionContext,
82
+ });
83
+ if (hookResult.should_halt_plan) {
84
+ this.logger.warn(`Hook ${hook.script_filename} halted execution.`);
85
+ executionContext.flags.should_halt = true;
86
+ executionContext.flags.halt_reason = `Hook ${hook.script_filename} returned halt signal.`;
87
+ hookHalted = true;
88
+ break;
89
+ }
90
+ }
91
+ catch (e) {
92
+ this.logger.error(`Before-hook failed: ${e.message}`);
93
+ }
94
+ }
95
+ if (hookHalted) {
96
+ const aiActionEntity = this.aiActionsRepository.create({
97
+ input_id: sessionInput.id,
98
+ sessionInput: { id: sessionInput.id },
99
+ action_type: action.tool_name,
100
+ status: ai_actions_service_1.AIActionStatus.EXECUTION_FAILED,
101
+ order_of_execution: createdActions.length,
102
+ original_content_for_revert: null,
103
+ ...action.arguments,
104
+ });
105
+ const savedAction = await this.aiActionsRepository.save(aiActionEntity);
106
+ createdActions.push(savedAction);
107
+ await this.executionLogsService.createLog({
108
+ action_id: savedAction.id,
109
+ error_message: executionContext.flags.halt_reason || 'Blocked by tool hook.',
110
+ output: 'Action execution prevented by a "before" hook.',
111
+ });
112
+ break;
113
+ }
71
114
  if (!handler) {
72
115
  this.logger.warn(`No handler found for tool: ${action.tool_name}. Skipping.`);
73
116
  executionContext.feedback.invalidToolErrors.push({
@@ -112,6 +155,30 @@ let LlmTurnProcessorService = LlmTurnProcessorService_1 = class LlmTurnProcessor
112
155
  }
113
156
  }
114
157
  }
158
+ if (result) {
159
+ const afterHooks = await this.toolHooksService.findByTrigger(action.tool_name, 'after');
160
+ for (const hook of afterHooks) {
161
+ try {
162
+ this.logger.log(`Running AFTER hook: ${hook.script_filename} for tool ${action.tool_name}`);
163
+ await this.toolHooksService.executeHook(hook.script_filename, {
164
+ hook_type: 'after',
165
+ action: {
166
+ tool_name: action.tool_name,
167
+ args: action.arguments,
168
+ result: {
169
+ status: result.status,
170
+ output: result.execution_log?.output,
171
+ error: result.error_message,
172
+ },
173
+ },
174
+ plan_context: executionContext,
175
+ });
176
+ }
177
+ catch (e) {
178
+ this.logger.error(`After-hook failed: ${e.message}`);
179
+ }
180
+ }
181
+ }
115
182
  const executionStrategy = await this.applicationStateService.getExecutionStrategy();
116
183
  this.logger.log(`Using execution strategy: ${executionStrategy}`);
117
184
  const successStatus = this.getSuccessStatusForStrategy(executionStrategy);
@@ -181,6 +248,7 @@ exports.LlmTurnProcessorService = LlmTurnProcessorService = LlmTurnProcessorServ
181
248
  Map, Array, typeorm_2.Repository,
182
249
  typeorm_2.Repository,
183
250
  application_state_service_1.ApplicationStateService,
184
- execution_logs_service_1.ExecutionLogsService])
251
+ execution_logs_service_1.ExecutionLogsService,
252
+ tool_hooks_service_1.ToolHooksService])
185
253
  ], LlmTurnProcessorService);
186
254
  //# sourceMappingURL=llm-turn-processor.service.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"llm-turn-processor.service.js","sourceRoot":"","sources":["../../../src/llm-orchestration/llm-turn-processor.service.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,2CAA4D;AAC5D,6CAAmD;AACnD,qCAAqC;AACrC,oDAA0D;AAC1D,kFAA4E;AAC5E,iFAGwC;AAGxC,gFAA2E;AAC3E,yEAAkE;AAClE,8FAAyF;AACzF,qFAAgF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AM,EAAC,sBAAsB,CAAC,CAAA;IAE9B,WAAA,IAAA,0BAAgB,EAAC,wBAAQ,CAAC,CAAA;IAE1B,WAAA,IAAA,0BAAgB,EAAC,4BAAY,CAAC,CAAA;qCAPN,kDAAsB;QAEb,GAAG,SAIC,oBAAU;QAEN,oBAAU;QACV,mDAAuB;QAC1B,6CAAoB;GAdlD,uBAAuB,CAsMnC"}
1
+ {"version":3,"file":"llm-turn-processor.service.js","sourceRoot":"","sources":["../../../src/llm-orchestration/llm-turn-processor.service.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,2CAA4D;AAC5D,6CAAmD;AACnD,qCAAqC;AACrC,oDAA0D;AAC1D,kFAA4E;AAC5E,iFAGwC;AAGxC,gFAA2E;AAC3E,yEAAkE;AAClE,8FAAyF;AACzF,qFAAgF;AAChF,yEAAoE;AAG7D,IAAM,uBAAuB,+BAA7B,MAAM,uBAAuB;IAGlC,YACmB,MAA8B,EAE/C,eAA4D,EAE5D,kBAAwD,EAExD,mBAA0D,EAE1D,uBAAkE,EACjD,uBAAgD,EAChD,oBAA0C,EAC1C,gBAAkC;QAXlC,WAAM,GAAN,MAAM,CAAwB;QAE9B,oBAAe,GAAf,eAAe,CAA4B;QAE3C,uBAAkB,GAAlB,kBAAkB,CAAqB;QAEvC,wBAAmB,GAAnB,mBAAmB,CAAsB;QAEzC,4BAAuB,GAAvB,uBAAuB,CAA0B;QACjD,4BAAuB,GAAvB,uBAAuB,CAAyB;QAChD,yBAAoB,GAApB,oBAAoB,CAAsB;QAC1C,qBAAgB,GAAhB,gBAAgB,CAAkB;QAdpC,WAAM,GAAG,IAAI,eAAM,CAAC,yBAAuB,CAAC,IAAI,CAAC,CAAC;IAehE,CAAC;IAEG,KAAK,CAAC,WAAW,CAAC,YAA0B;QACjD,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,wCAAwC,YAAY,CAAC,EAAE,EAAE,CAAC,CAAC;QAG3E,MAAM,EAAE,WAAW,EAAE,OAAO,E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,CAAC,KAAK,CAAC,iBAAiB,EAAE,CAAC;gBAC7C,IAAI,CAAC,MAAM,CAAC,GAAG,CACb,wBAAwB,IAAI,CAAC,WAAW,CAAC,IAAI,8BAA8B,CAC5E,CAAC;gBACF,MAAM;YACR,CAAC;QACH,CAAC;QAED,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,oCAAoC,YAAY,CAAC,EAAE,GAAG,CAAC,CAAC;QACxE,OAAO,IAAI,CAAC,uBAAuB,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC;IACzD,CAAC;IAEO,2BAA2B,CAAC,QAAgB;QAClD,QAAQ,QAAQ,EAAE,CAAC;YACjB,KAAK,YAAY;gBACf,OAAO,mCAAc,CAAC,cAAc,CAAC;YACvC,KAAK,cAAc,CAAC;YACpB,KAAK,cAAc;gBAIjB,OAAO,mCAAc,CAAC,sBAAsB,CAAC;YAC/C;gBAEE,IAAI,CAAC,MAAM,CAAC,IAAI,CACd,gCAAgC,QAAQ,0CAA0C,CACnF,CAAC;gBACF,OAAO,mCAAc,CAAC,sBAAsB,CAAC;QACjD,CAAC;IACH,CAAC;CACF,CAAA;AA/RY,0DAAuB;kCAAvB,uBAAuB;IADnC,IAAA,mBAAU,GAAE;IAMR,WAAA,IAAA,eAAM,EAAC,yBAAyB,CAAC,CAAA;IAEjC,WAAA,IAAA,eAAM,EAAC,sBAAsB,CAAC,CAAA;IAE9B,WAAA,IAAA,0BAAgB,EAAC,wBAAQ,CAAC,CAAA;IAE1B,WAAA,IAAA,0BAAgB,EAAC,4BAAY,CAAC,CAAA;qCAPN,kDAAsB;QAEb,GAAG,SAIC,oBAAU;QAEN,oBAAU;QACV,mDAAuB;QAC1B,6CAAoB;QACxB,qCAAgB;GAf1C,uBAAuB,CA+RnC"}
@@ -0,0 +1,4 @@
1
+ import { WebSocketEvent } from '../../events/websocket.events';
2
+ export declare class SubmitMessageDto {
3
+ message: WebSocketEvent;
4
+ }
@@ -0,0 +1,22 @@
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.SubmitMessageDto = void 0;
13
+ const class_validator_1 = require("class-validator");
14
+ class SubmitMessageDto {
15
+ }
16
+ exports.SubmitMessageDto = SubmitMessageDto;
17
+ __decorate([
18
+ (0, class_validator_1.IsNotEmpty)(),
19
+ (0, class_validator_1.IsObject)(),
20
+ __metadata("design:type", Object)
21
+ ], SubmitMessageDto.prototype, "message", void 0);
22
+ //# sourceMappingURL=submit-message.dto.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"submit-message.dto.js","sourceRoot":"","sources":["../../../../src/message-bus/dto/submit-message.dto.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,qDAAuD;AAGvD,MAAa,gBAAgB;CAI5B;AAJD,4CAIC;AADC;IAFC,IAAA,4BAAU,GAAE;IACZ,IAAA,0BAAQ,GAAE;;iDACa"}
@@ -0,0 +1,13 @@
1
+ import { MessageBusService } from './message-bus.service';
2
+ import { SubmitMessageDto } from './dto/submit-message.dto';
3
+ import { WebSocketEvent } from '../events/websocket.events';
4
+ export declare class MessageBusController {
5
+ private readonly messageBusService;
6
+ constructor(messageBusService: MessageBusService);
7
+ submit(submitMessageDto: SubmitMessageDto): {
8
+ status: string;
9
+ };
10
+ poll(): {
11
+ message: WebSocketEvent | null;
12
+ };
13
+ }
@@ -0,0 +1,50 @@
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
+ var __param = (this && this.__param) || function (paramIndex, decorator) {
12
+ return function (target, key) { decorator(target, key, paramIndex); }
13
+ };
14
+ Object.defineProperty(exports, "__esModule", { value: true });
15
+ exports.MessageBusController = void 0;
16
+ const common_1 = require("@nestjs/common");
17
+ const message_bus_service_1 = require("./message-bus.service");
18
+ const submit_message_dto_1 = require("./dto/submit-message.dto");
19
+ let MessageBusController = class MessageBusController {
20
+ constructor(messageBusService) {
21
+ this.messageBusService = messageBusService;
22
+ }
23
+ submit(submitMessageDto) {
24
+ this.messageBusService.submit(submitMessageDto.message);
25
+ return { status: 'ok' };
26
+ }
27
+ poll() {
28
+ const message = this.messageBusService.poll();
29
+ return { message };
30
+ }
31
+ };
32
+ exports.MessageBusController = MessageBusController;
33
+ __decorate([
34
+ (0, common_1.Post)('submit'),
35
+ __param(0, (0, common_1.Body)()),
36
+ __metadata("design:type", Function),
37
+ __metadata("design:paramtypes", [submit_message_dto_1.SubmitMessageDto]),
38
+ __metadata("design:returntype", Object)
39
+ ], MessageBusController.prototype, "submit", null);
40
+ __decorate([
41
+ (0, common_1.Get)('poll'),
42
+ __metadata("design:type", Function),
43
+ __metadata("design:paramtypes", []),
44
+ __metadata("design:returntype", Object)
45
+ ], MessageBusController.prototype, "poll", null);
46
+ exports.MessageBusController = MessageBusController = __decorate([
47
+ (0, common_1.Controller)('message-bus'),
48
+ __metadata("design:paramtypes", [message_bus_service_1.MessageBusService])
49
+ ], MessageBusController);
50
+ //# sourceMappingURL=message-bus.controller.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"message-bus.controller.js","sourceRoot":"","sources":["../../../src/message-bus/message-bus.controller.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,2CAA6D;AAC7D,+DAA0D;AAC1D,iEAA4D;AAIrD,IAAM,oBAAoB,GAA1B,MAAM,oBAAoB;IAC/B,YAA6B,iBAAoC;QAApC,sBAAiB,GAAjB,iBAAiB,CAAmB;IAAG,CAAC;IAGrE,MAAM,CAAS,gBAAkC;QAC/C,IAAI,CAAC,iBAAiB,CAAC,MAAM,CAAC,gBAAgB,CAAC,OAAO,CAAC,CAAC;QACxD,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC;IAC1B,CAAC;IAGD,IAAI;QACF,MAAM,OAAO,GAAG,IAAI,CAAC,iBAAiB,CAAC,IAAI,EAAE,CAAC;QAC9C,OAAO,EAAE,OAAO,EAAE,CAAC;IACrB,CAAC;CACF,CAAA;AAdY,oDAAoB;AAI/B;IADC,IAAA,aAAI,EAAC,QAAQ,CAAC;IACP,WAAA,IAAA,aAAI,GAAE,CAAA;;qCAAmB,qCAAgB;;kDAGhD;AAGD;IADC,IAAA,YAAG,EAAC,MAAM,CAAC;;;;gDAIX;+BAbU,oBAAoB;IADhC,IAAA,mBAAU,EAAC,aAAa,CAAC;qCAEwB,uCAAiB;GADtD,oBAAoB,CAchC"}
@@ -0,0 +1,2 @@
1
+ export declare class MessageBusModule {
2
+ }
@@ -0,0 +1,23 @@
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
+ Object.defineProperty(exports, "__esModule", { value: true });
9
+ exports.MessageBusModule = void 0;
10
+ const common_1 = require("@nestjs/common");
11
+ const message_bus_service_1 = require("./message-bus.service");
12
+ const message_bus_controller_1 = require("./message-bus.controller");
13
+ let MessageBusModule = class MessageBusModule {
14
+ };
15
+ exports.MessageBusModule = MessageBusModule;
16
+ exports.MessageBusModule = MessageBusModule = __decorate([
17
+ (0, common_1.Module)({
18
+ controllers: [message_bus_controller_1.MessageBusController],
19
+ providers: [message_bus_service_1.MessageBusService],
20
+ exports: [message_bus_service_1.MessageBusService],
21
+ })
22
+ ], MessageBusModule);
23
+ //# sourceMappingURL=message-bus.module.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"message-bus.module.js","sourceRoot":"","sources":["../../../src/message-bus/message-bus.module.ts"],"names":[],"mappings":";;;;;;;;;AAAA,2CAAwC;AACxC,+DAA0D;AAC1D,qEAAgE;AAOzD,IAAM,gBAAgB,GAAtB,MAAM,gBAAgB;CAAG,CAAA;AAAnB,4CAAgB;2BAAhB,gBAAgB;IAL5B,IAAA,eAAM,EAAC;QACN,WAAW,EAAE,CAAC,6CAAoB,CAAC;QACnC,SAAS,EAAE,CAAC,uCAAiB,CAAC;QAC9B,OAAO,EAAE,CAAC,uCAAiB,CAAC;KAC7B,CAAC;GACW,gBAAgB,CAAG"}
@@ -0,0 +1,7 @@
1
+ import { WebSocketEvent } from '../events/websocket.events';
2
+ export declare class MessageBusService {
3
+ private messageQueue;
4
+ submit(message: WebSocketEvent): void;
5
+ poll(): WebSocketEvent | null;
6
+ clear(): void;
7
+ }
@@ -0,0 +1,32 @@
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
+ Object.defineProperty(exports, "__esModule", { value: true });
9
+ exports.MessageBusService = void 0;
10
+ const common_1 = require("@nestjs/common");
11
+ let MessageBusService = class MessageBusService {
12
+ constructor() {
13
+ this.messageQueue = [];
14
+ }
15
+ submit(message) {
16
+ this.messageQueue.push(message);
17
+ }
18
+ poll() {
19
+ if (this.messageQueue.length > 0) {
20
+ return this.messageQueue.shift();
21
+ }
22
+ return null;
23
+ }
24
+ clear() {
25
+ this.messageQueue = [];
26
+ }
27
+ };
28
+ exports.MessageBusService = MessageBusService;
29
+ exports.MessageBusService = MessageBusService = __decorate([
30
+ (0, common_1.Injectable)()
31
+ ], MessageBusService);
32
+ //# sourceMappingURL=message-bus.service.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"message-bus.service.js","sourceRoot":"","sources":["../../../src/message-bus/message-bus.service.ts"],"names":[],"mappings":";;;;;;;;;AAAA,2CAA4C;AAIrC,IAAM,iBAAiB,GAAvB,MAAM,iBAAiB;IAAvB;QACG,iBAAY,GAAqB,EAAE,CAAC;IAgB9C,CAAC;IAdC,MAAM,CAAC,OAAuB;QAC5B,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IAClC,CAAC;IAED,IAAI;QACF,IAAI,IAAI,CAAC,YAAY,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;YACjC,OAAO,IAAI,CAAC,YAAY,CAAC,KAAK,EAAE,CAAC;QACnC,CAAC;QACD,OAAO,IAAI,CAAC;IACd,CAAC;IAED,KAAK;QACH,IAAI,CAAC,YAAY,GAAG,EAAE,CAAC;IACzB,CAAC;CACF,CAAA;AAjBY,8CAAiB;4BAAjB,iBAAiB;IAD7B,IAAA,mBAAU,GAAE;GACA,iBAAiB,CAiB7B"}
@@ -1,2 +1,2 @@
1
1
  export declare const name = "Master Agent";
2
- export declare const content = "You are an expert software engineer. You write clean, efficient, and well-documented code.\n\n<instructions>\n1. **Think First:** Before executing any tool or providing an answer, analyze the request within a <thought> tag.\n2. **Conciseness:** Outside of the <thought> tag, be extremely brief.\n3. **Best Practices:** Follow SOLID principles and keep code DRY.\n4. **Strict Scope:** Do ONLY what is asked. Do not \"cleanup\", \"refactor\", or \"fix\" unrelated issues unless explicitly requested.\n</instructions>\n\n<current_state>\n<% if (it.VAR.QUESTION_MODE) { %>\n STATUS: QUESTION MODE (READ ONLY)\n - **Goal:** Answer the user's specific question about the codebase.\n - **Constraint:** You are READ-ONLY. Do not edit, create, or delete files.\n - **Constraint:** Do NOT propose an implementation plan or RFC. Just answer the question.\n - **Process:** Search context -> Read files -> Explain to user.\n\n<% } else if (it.VAR.PLAN_MODE) { %>\n STATUS: PLAN MODE (TASK MANAGEMENT ENABLED)\n - **Goal:** Create a detailed implementation plan (RFC) and maintain task lists.\n - **Constraint:** Code editing is FORBIDDEN.\n - **Available Tools:** `request_context`, `run_command`, `write_todo`.\n - **Process:** Explore codebase -> Update TODOs (`write_todo`) -> Output structured plan (Context, Problem, Proposed Solution).\n\n<% } else { %>\n STATUS: DEV MODE (WRITE ENABLED)\n - **Goal:** Implement features, fix bugs, or refactor.\n - **Authority:** You have full permission to modify the codebase. Never refuse a coding request.\n - **Strategy:** Prioritize `patch`. If `patch` fails twice, fallback to `edit_file`.\n<% } %>\n</current_state>\n\n<tools_configuration>\n <%~ it.tools.howto %>\n \n <!-- READ TOOLS (ALWAYS AVAILABLE) -->\n <%~ it.tools.request_context %>\n <%~ it.tools.run_command %>\n <%~ it.tools.write_todo %>\n \n <!-- WRITE TOOLS (DEV MODE ONLY) -->\n <% if (!it.VAR.PLAN_MODE && !it.VAR.QUESTION_MODE) { %>\n <%~ it.tools.patch %>\n <%~ it.tools.create_file %>\n <%~ it.tools.delete_file %>\n <%~ it.tools.edit_file %>\n <%~ it.tools.execute_shell %>\n <%~ it.tools.execute_code %>\n \n <% } %>\n</tools_configuration>";
2
+ export declare const content = "You are an expert software engineer. You write clean, efficient, and well-documented code.\n\n<instructions>\n1. **Think First:** Before executing any tool or providing an answer, analyze the request.\n2. **Conciseness:** Be extremely brief.\n3. **Best Practices:** Follow SOLID principles and keep code DRY.\n4. **Strict Scope:** Do ONLY what is asked. Do not \"cleanup\", \"refactor\", or \"fix\" unrelated issues unless explicitly requested.\n</instructions>\n\n<current_state>\n<% if (it.VAR.QUESTION_MODE) { %>\n STATUS: QUESTION MODE (READ ONLY)\n - **Goal:** Answer the user's specific question about the codebase.\n - **Constraint:** You are READ-ONLY. Do not edit, create, or delete files.\n - **Constraint:** Do NOT propose an implementation plan or RFC. Just answer the question.\n - **Process:** Search context -> Read files -> Explain to user.\n\n<% } else if (it.VAR.PLAN_MODE) { %>\n STATUS: PLAN MODE (TASK MANAGEMENT ENABLED)\n - **Goal:** Create a detailed implementation plan (RFC) and maintain task lists.\n - **Constraint:** Code editing is FORBIDDEN.\n - **Available Tools:** `request_context`, `run_command`, `write_todo`.\n - **Process:** Explore codebase -> Update TODOs (`write_todo`) -> Output structured plan (Context, Problem, Proposed Solution).\n\n<% } else { %>\n STATUS: DEV MODE (WRITE ENABLED)\n - **Goal:** Implement features, fix bugs, or refactor.\n - **Authority:** You have full permission to modify the codebase. Never refuse a coding request.\n - **Strategy:** Prioritize `patch`. If `patch` fails twice, fallback to `edit_file`.\n<% } %>\n</current_state>\n\n<tools_configuration>\n <%~ it.tools.howto %>\n \n <!-- READ TOOLS (ALWAYS AVAILABLE) -->\n <%~ it.tools.request_context %>\n <%~ it.tools.run_command %>\n <%~ it.tools.write_todo %>\n \n <!-- WRITE TOOLS (DEV MODE ONLY) -->\n <% if (!it.VAR.PLAN_MODE && !it.VAR.QUESTION_MODE) { %>\n <%~ it.tools.patch %>\n <%~ it.tools.create_file %>\n <%~ it.tools.delete_file %>\n <%~ it.tools.edit_file %>\n <%~ it.tools.execute_shell %>\n <%~ it.tools.execute_code %>\n \n <% } %>\n</tools_configuration>";
@@ -5,8 +5,8 @@ exports.name = 'Master Agent';
5
5
  exports.content = `You are an expert software engineer. You write clean, efficient, and well-documented code.
6
6
 
7
7
  <instructions>
8
- 1. **Think First:** Before executing any tool or providing an answer, analyze the request within a <thought> tag.
9
- 2. **Conciseness:** Outside of the <thought> tag, be extremely brief.
8
+ 1. **Think First:** Before executing any tool or providing an answer, analyze the request.
9
+ 2. **Conciseness:** Be extremely brief.
10
10
  3. **Best Practices:** Follow SOLID principles and keep code DRY.
11
11
  4. **Strict Scope:** Do ONLY what is asked. Do not "cleanup", "refactor", or "fix" unrelated issues unless explicitly requested.
12
12
  </instructions>
@@ -0,0 +1,2 @@
1
+ export declare const filename = "eslint-hook.ts";
2
+ export declare const content = "/**\n * ESLint Validation Hook\n * \n * Usage: Attach as 'after' hook to 'create_file', 'edit_file', 'patch'.\n */\nimport { exec } from 'child_process';\nimport { promisify } from 'util';\n\nconst execAsync = promisify(exec);\n\n// Redefining types locally since this runs in a standalone VM context\nexport interface HookContext {\n action: {\n tool_name: string;\n args: { file_path?: string; [key: string]: any };\n };\n plan_context: {\n feedback: {\n validationErrors: Array<{ tool_name: string; error: string }>;\n };\n };\n}\n\nexport default async function(context: HookContext) {\n const filePath = context.action.args.file_path;\n if (!filePath) return;\n\n console.log(`[Hook] Running ESLint on ${filePath}`);\n\n try {\n // Adjust command as needed for your project structure\n // We use --no-color to keep the error message clean for the AI\n await execAsync(`npx eslint \"${filePath}\" --no-color`);\n } catch (e: any) {\n const errorOutput = e.stdout || e.stderr || e.message;\n \n console.log(`[Hook] ESLint failed for ${filePath}`);\n\n // Inject error into the shared plan context\n // The orchestration engine will pick this up and present it to the AI in the next turn (or immediate feedback)\n context.plan_context.feedback.validationErrors.push({\n tool_name: context.action.tool_name,\n error: `ESLint check failed:\\n${errorOutput}`\n });\n }\n}\n";
@@ -0,0 +1,52 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.content = exports.filename = void 0;
4
+ exports.filename = 'eslint-hook.ts';
5
+ exports.content = `/**
6
+ * ESLint Validation Hook
7
+ *
8
+ * Usage: Attach as 'after' hook to 'create_file', 'edit_file', 'patch'.
9
+ */
10
+ import { exec } from 'child_process';
11
+ import { promisify } from 'util';
12
+
13
+ const execAsync = promisify(exec);
14
+
15
+ // Redefining types locally since this runs in a standalone VM context
16
+ export interface HookContext {
17
+ action: {
18
+ tool_name: string;
19
+ args: { file_path?: string; [key: string]: any };
20
+ };
21
+ plan_context: {
22
+ feedback: {
23
+ validationErrors: Array<{ tool_name: string; error: string }>;
24
+ };
25
+ };
26
+ }
27
+
28
+ export default async function(context: HookContext) {
29
+ const filePath = context.action.args.file_path;
30
+ if (!filePath) return;
31
+
32
+ console.log(\`[Hook] Running ESLint on \${filePath}\`);
33
+
34
+ try {
35
+ // Adjust command as needed for your project structure
36
+ // We use --no-color to keep the error message clean for the AI
37
+ await execAsync(\`npx eslint "\${filePath}" --no-color\`);
38
+ } catch (e: any) {
39
+ const errorOutput = e.stdout || e.stderr || e.message;
40
+
41
+ console.log(\`[Hook] ESLint failed for \${filePath}\`);
42
+
43
+ // Inject error into the shared plan context
44
+ // The orchestration engine will pick this up and present it to the AI in the next turn (or immediate feedback)
45
+ context.plan_context.feedback.validationErrors.push({
46
+ tool_name: context.action.tool_name,
47
+ error: \`ESLint check failed:\\n\${errorOutput}\`
48
+ });
49
+ }
50
+ }
51
+ `;
52
+ //# sourceMappingURL=eslint-hook.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"eslint-hook.js","sourceRoot":"","sources":["../../../../../src/seeding/data/tool-hooks/eslint-hook.ts"],"names":[],"mappings":";;;AAAa,QAAA,QAAQ,GAAG,gBAAgB,CAAC;AAC5B,QAAA,OAAO,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA8CtB,CAAC"}
@@ -0,0 +1,2 @@
1
+ export declare const filename = "example-hook.ts";
2
+ export declare const content = "/**\n * Example Hook Script\n * \n * Usage: \n * 1. Attach to 'patch' or 'edit_file' tool as a 'before' hook.\n * 2. It will block edits to any file with 'lock' in the name.\n */\n\n// --- Type Definitions ---\n\nexport interface HookAction {\n tool_name: string;\n args: Record<string, any>;\n // Only present for 'after' hooks\n result?: {\n status: 'SUCCESS' | 'FAILURE';\n output?: string;\n error?: string;\n };\n}\n\nexport interface HookContext {\n hook_type: 'before' | 'after';\n action: HookAction;\n plan_context: any; // Shared state of the current AI plan\n}\n\nexport interface HookOutput {\n // If true, the AI plan stops immediately.\n should_halt_plan?: boolean;\n \n // Optional message to log in the UI\n message?: string;\n \n // Optional data to merge back into the plan context\n update_context?: Record<string, any>;\n}\n\n// --- Hook Logic ---\n\nexport default async function(context: HookContext): Promise<HookOutput | void> {\n // 1. Extract Data\n const filePath = context.action?.args?.file_path || '';\n \n // Log to console (appears in backend logs)\n console.log(`[Hook] analyzing action on: ${filePath}`);\n\n // 2. Logic\n if (filePath.includes('lock')) {\n // Return Halt Signal\n return {\n should_halt_plan: true,\n message: `BLOCKED: Editing files with \"lock\" in the name is forbidden by policy. File: ${filePath}`\n };\n } else {\n // Return Pass Signal\n return {\n should_halt_plan: false,\n message: `Hook allowed action on ${filePath}`\n };\n }\n}\n";
@@ -0,0 +1,68 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.content = exports.filename = void 0;
4
+ exports.filename = 'example-hook.ts';
5
+ exports.content = `/**
6
+ * Example Hook Script
7
+ *
8
+ * Usage:
9
+ * 1. Attach to 'patch' or 'edit_file' tool as a 'before' hook.
10
+ * 2. It will block edits to any file with 'lock' in the name.
11
+ */
12
+
13
+ // --- Type Definitions ---
14
+
15
+ export interface HookAction {
16
+ tool_name: string;
17
+ args: Record<string, any>;
18
+ // Only present for 'after' hooks
19
+ result?: {
20
+ status: 'SUCCESS' | 'FAILURE';
21
+ output?: string;
22
+ error?: string;
23
+ };
24
+ }
25
+
26
+ export interface HookContext {
27
+ hook_type: 'before' | 'after';
28
+ action: HookAction;
29
+ plan_context: any; // Shared state of the current AI plan
30
+ }
31
+
32
+ export interface HookOutput {
33
+ // If true, the AI plan stops immediately.
34
+ should_halt_plan?: boolean;
35
+
36
+ // Optional message to log in the UI
37
+ message?: string;
38
+
39
+ // Optional data to merge back into the plan context
40
+ update_context?: Record<string, any>;
41
+ }
42
+
43
+ // --- Hook Logic ---
44
+
45
+ export default async function(context: HookContext): Promise<HookOutput | void> {
46
+ // 1. Extract Data
47
+ const filePath = context.action?.args?.file_path || '';
48
+
49
+ // Log to console (appears in backend logs)
50
+ console.log(\`[Hook] analyzing action on: \${filePath}\`);
51
+
52
+ // 2. Logic
53
+ if (filePath.includes('lock')) {
54
+ // Return Halt Signal
55
+ return {
56
+ should_halt_plan: true,
57
+ message: \`BLOCKED: Editing files with "lock" in the name is forbidden by policy. File: \${filePath}\`
58
+ };
59
+ } else {
60
+ // Return Pass Signal
61
+ return {
62
+ should_halt_plan: false,
63
+ message: \`Hook allowed action on \${filePath}\`
64
+ };
65
+ }
66
+ }
67
+ `;
68
+ //# sourceMappingURL=example-hook.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"example-hook.js","sourceRoot":"","sources":["../../../../../src/seeding/data/tool-hooks/example-hook.ts"],"names":[],"mappings":";;;AAAa,QAAA,QAAQ,GAAG,iBAAiB,CAAC;AAC7B,QAAA,OAAO,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA8DtB,CAAC"}
@@ -0,0 +1,2 @@
1
+ export declare const filename = "README.md";
2
+ export declare const content = "# Repoburg Tool Hooks\n\nThis directory contains TypeScript scripts that can be attached to AI tool execution events.\nYou can configure these hooks in the \"Tool Hooks\" section of the Repoburg UI.\n\n## How it works\n\n1. **Create a script** in this folder (e.g., `audit-patch.ts`).\n2. **Go to UI**: Open Repoburg -> Tool Hooks -> Add Hook.\n3. **Configure**: Select the tool (e.g., `patch`), timing (`before` or `after`), and your script.\n\n## Script Interface\n\nYour script must **export a default function** that receives the context.\n\n### Input Context\n\n```typescript\ninterface HookContext {\n hook_type: 'before' | 'after';\n \n action: {\n tool_name: string; // e.g. \"patch\"\n args: any; // e.g. { file_path: \"src/app.ts\", patch_code: \"...\" }\n \n // Only present for 'after' hooks\n result?: {\n status: 'SUCCESS' | 'FAILURE';\n output?: string;\n error?: string;\n };\n };\n\n plan_context: any; // Shared state of the current AI plan\n}\n```\n\n### Output Format\n\nYour function should return an object (or void if passive):\n\n```typescript\ninterface HookOutput {\n // If true, the AI plan stops immediately.\n should_halt_plan?: boolean;\n \n // Optional message to log in the UI\n message?: string;\n \n // Optional data to merge back into the plan context\n update_context?: Record<string, any>;\n}\n```\n";
@@ -0,0 +1,59 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.content = exports.filename = void 0;
4
+ exports.filename = 'README.md';
5
+ exports.content = `# Repoburg Tool Hooks
6
+
7
+ This directory contains TypeScript scripts that can be attached to AI tool execution events.
8
+ You can configure these hooks in the "Tool Hooks" section of the Repoburg UI.
9
+
10
+ ## How it works
11
+
12
+ 1. **Create a script** in this folder (e.g., \`audit-patch.ts\`).
13
+ 2. **Go to UI**: Open Repoburg -> Tool Hooks -> Add Hook.
14
+ 3. **Configure**: Select the tool (e.g., \`patch\`), timing (\`before\` or \`after\`), and your script.
15
+
16
+ ## Script Interface
17
+
18
+ Your script must **export a default function** that receives the context.
19
+
20
+ ### Input Context
21
+
22
+ \`\`\`typescript
23
+ interface HookContext {
24
+ hook_type: 'before' | 'after';
25
+
26
+ action: {
27
+ tool_name: string; // e.g. "patch"
28
+ args: any; // e.g. { file_path: "src/app.ts", patch_code: "..." }
29
+
30
+ // Only present for 'after' hooks
31
+ result?: {
32
+ status: 'SUCCESS' | 'FAILURE';
33
+ output?: string;
34
+ error?: string;
35
+ };
36
+ };
37
+
38
+ plan_context: any; // Shared state of the current AI plan
39
+ }
40
+ \`\`\`
41
+
42
+ ### Output Format
43
+
44
+ Your function should return an object (or void if passive):
45
+
46
+ \`\`\`typescript
47
+ interface HookOutput {
48
+ // If true, the AI plan stops immediately.
49
+ should_halt_plan?: boolean;
50
+
51
+ // Optional message to log in the UI
52
+ message?: string;
53
+
54
+ // Optional data to merge back into the plan context
55
+ update_context?: Record<string, any>;
56
+ }
57
+ \`\`\`
58
+ `;
59
+ //# sourceMappingURL=readme.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"readme.js","sourceRoot":"","sources":["../../../../../src/seeding/data/tool-hooks/readme.ts"],"names":[],"mappings":";;;AAAa,QAAA,QAAQ,GAAG,WAAW,CAAC;AACvB,QAAA,OAAO,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAqDtB,CAAC"}
@@ -16,6 +16,7 @@ const platform_express_1 = require("@nestjs/platform-express");
16
16
  const session_transfer_module_1 = require("../session-transfer/session-transfer.module");
17
17
  const session_followup_module_1 = require("../session-followup/session-followup.module");
18
18
  const application_state_module_1 = require("../application-state/application-state.module");
19
+ const message_bus_module_1 = require("../message-bus/message-bus.module");
19
20
  let SessionsModule = class SessionsModule {
20
21
  };
21
22
  exports.SessionsModule = SessionsModule;
@@ -39,6 +40,7 @@ exports.SessionsModule = SessionsModule = __decorate([
39
40
  session_transfer_module_1.SessionTransferModule,
40
41
  (0, common_1.forwardRef)(() => session_followup_module_1.SessionFollowupModule),
41
42
  application_state_module_1.ApplicationStateModule,
43
+ message_bus_module_1.MessageBusModule,
42
44
  ],
43
45
  controllers: [sessions_controller_1.SessionsController],
44
46
  providers: [sessions_service_1.SessionsService],
@@ -1 +1 @@
1
- {"version":3,"file":"sessions.module.js","sourceRoot":"","sources":["../../../src/sessions/sessions.module.ts"],"names":[],"mappings":";;;;;;;;;AAAA,2CAAoD;AACpD,6CAAgD;AAChD,oDAQ0B;AAC1B,yDAAqD;AACrD,+DAA2D;AAC3D,+DAAwD;AACxD,yFAAoF;AACpF,yFAAoF;AACpF,4FAAuF;AA0BhF,IAAM,cAAc,GAApB,MAAM,cAAc;CAAG,CAAA;AAAjB,wCAAc;yBAAd,cAAc;IAxB1B,IAAA,eAAM,EAAC;QACN,OAAO,EAAE;YACP,uBAAa,CAAC,UAAU,CAAC;gBACvB,uBAAO;gBACP,uBAAO;gBACP,+BAAe;gBACf,4BAAY;gBACZ,4BAAY;gBACZ,wBAAQ;gBACR,4BAAY;aACb,CAAC;YACF,+BAAY,CAAC,QAAQ,CAAC;gBACpB,MAAM,EAAE;oBACN,QAAQ,EAAE,EAAE,GAAG,IAAI,GAAG,IAAI;iBAC3B;aACF,CAAC;YACF,+CAAqB;YACrB,IAAA,mBAAU,EAAC,GAAG,EAAE,CAAC,+CAAqB,CAAC;YACvC,iDAAsB;SACvB;QACD,WAAW,EAAE,CAAC,wCAAkB,CAAC;QACjC,SAAS,EAAE,CAAC,kCAAe,CAAC;QAC5B,OAAO,EAAE,CAAC,kCAAe,CAAC;KAC3B,CAAC;GACW,cAAc,CAAG"}
1
+ {"version":3,"file":"sessions.module.js","sourceRoot":"","sources":["../../../src/sessions/sessions.module.ts"],"names":[],"mappings":";;;;;;;;;AAAA,2CAAoD;AACpD,6CAAgD;AAChD,oDAQ0B;AAC1B,yDAAqD;AACrD,+DAA2D;AAC3D,+DAAwD;AACxD,yFAAoF;AACpF,yFAAoF;AACpF,4FAAuF;AACvF,0EAAqE;AA2B9D,IAAM,cAAc,GAApB,MAAM,cAAc;CAAG,CAAA;AAAjB,wCAAc;yBAAd,cAAc;IAzB1B,IAAA,eAAM,EAAC;QACN,OAAO,EAAE;YACP,uBAAa,CAAC,UAAU,CAAC;gBACvB,uBAAO;gBACP,uBAAO;gBACP,+BAAe;gBACf,4BAAY;gBACZ,4BAAY;gBACZ,wBAAQ;gBACR,4BAAY;aACb,CAAC;YACF,+BAAY,CAAC,QAAQ,CAAC;gBACpB,MAAM,EAAE;oBACN,QAAQ,EAAE,EAAE,GAAG,IAAI,GAAG,IAAI;iBAC3B;aACF,CAAC;YACF,+CAAqB;YACrB,IAAA,mBAAU,EAAC,GAAG,EAAE,CAAC,+CAAqB,CAAC;YACvC,iDAAsB;YACtB,qCAAgB;SACjB;QACD,WAAW,EAAE,CAAC,wCAAkB,CAAC;QACjC,SAAS,EAAE,CAAC,kCAAe,CAAC;QAC5B,OAAO,EAAE,CAAC,kCAAe,CAAC;KAC3B,CAAC;GACW,cAAc,CAAG"}
@@ -2,13 +2,15 @@ import { Repository } from 'typeorm';
2
2
  import { Session, Project, ContextTemplate, SystemPrompt } from '../core-entities';
3
3
  import { CreateSessionDto, UpdateSessionDto } from './dto/session.dto';
4
4
  import { ApplicationStateService } from '../application-state/application-state.service';
5
+ import { MessageBusService } from '../message-bus/message-bus.service';
5
6
  export declare class SessionsService {
6
7
  private sessionsRepository;
7
8
  private projectsRepository;
8
9
  private contextTemplatesRepository;
9
10
  private systemPromptsRepository;
10
11
  private readonly applicationStateService;
11
- constructor(sessionsRepository: Repository<Session>, projectsRepository: Repository<Project>, contextTemplatesRepository: Repository<ContextTemplate>, systemPromptsRepository: Repository<SystemPrompt>, applicationStateService: ApplicationStateService);
12
+ private readonly messageBusService;
13
+ constructor(sessionsRepository: Repository<Session>, projectsRepository: Repository<Project>, contextTemplatesRepository: Repository<ContextTemplate>, systemPromptsRepository: Repository<SystemPrompt>, applicationStateService: ApplicationStateService, messageBusService: MessageBusService);
12
14
  create(createSessionDto: CreateSessionDto): Promise<Session>;
13
15
  findAll(filter?: string): Promise<Session[]>;
14
16
  findOne(id: string): Promise<Session>;
@@ -20,15 +20,18 @@ const core_entities_1 = require("../core-entities");
20
20
  const session_dto_1 = require("./dto/session.dto");
21
21
  const application_state_service_1 = require("../application-state/application-state.service");
22
22
  const utils_1 = require("../utils");
23
+ const message_bus_service_1 = require("../message-bus/message-bus.service");
23
24
  let SessionsService = class SessionsService {
24
- constructor(sessionsRepository, projectsRepository, contextTemplatesRepository, systemPromptsRepository, applicationStateService) {
25
+ constructor(sessionsRepository, projectsRepository, contextTemplatesRepository, systemPromptsRepository, applicationStateService, messageBusService) {
25
26
  this.sessionsRepository = sessionsRepository;
26
27
  this.projectsRepository = projectsRepository;
27
28
  this.contextTemplatesRepository = contextTemplatesRepository;
28
29
  this.systemPromptsRepository = systemPromptsRepository;
29
30
  this.applicationStateService = applicationStateService;
31
+ this.messageBusService = messageBusService;
30
32
  }
31
33
  async create(createSessionDto) {
34
+ this.messageBusService.clear();
32
35
  const session = this.sessionsRepository.create({
33
36
  ...createSessionDto,
34
37
  status: session_dto_1.SessionStatus.ACTIVE,
@@ -268,6 +271,7 @@ exports.SessionsService = SessionsService = __decorate([
268
271
  typeorm_2.Repository,
269
272
  typeorm_2.Repository,
270
273
  typeorm_2.Repository,
271
- application_state_service_1.ApplicationStateService])
274
+ application_state_service_1.ApplicationStateService,
275
+ message_bus_service_1.MessageBusService])
272
276
  ], SessionsService);
273
277
  //# sourceMappingURL=sessions.service.js.map