@carlonicora/nestjs-neo4jsonapi 1.97.0 → 1.98.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/agents/graph/tools/search-entities.tool.d.ts.map +1 -1
- package/dist/agents/graph/tools/search-entities.tool.js +14 -3
- package/dist/agents/graph/tools/search-entities.tool.js.map +1 -1
- package/dist/agents/graph/tools/tool.factory.d.ts.map +1 -1
- package/dist/agents/graph/tools/tool.factory.js +16 -2
- package/dist/agents/graph/tools/tool.factory.js.map +1 -1
- package/dist/agents/graph/tools/traverse.tool.d.ts.map +1 -1
- package/dist/agents/graph/tools/traverse.tool.js +14 -4
- package/dist/agents/graph/tools/traverse.tool.js.map +1 -1
- package/dist/agents/index.d.ts +15 -0
- package/dist/agents/index.d.ts.map +1 -1
- package/dist/agents/index.js +28 -1
- package/dist/agents/index.js.map +1 -1
- package/dist/agents/operator/contexts/operator.context.d.ts +54 -0
- package/dist/agents/operator/contexts/operator.context.d.ts.map +1 -0
- package/dist/agents/operator/contexts/operator.context.js +23 -0
- package/dist/agents/operator/contexts/operator.context.js.map +1 -0
- package/dist/agents/operator/controllers/operator.controller.d.ts +37 -0
- package/dist/agents/operator/controllers/operator.controller.d.ts.map +1 -0
- package/dist/agents/operator/controllers/operator.controller.js +142 -0
- package/dist/agents/operator/controllers/operator.controller.js.map +1 -0
- package/dist/agents/operator/entities/operator.meta.d.ts +8 -0
- package/dist/agents/operator/entities/operator.meta.d.ts.map +1 -0
- package/dist/agents/operator/entities/operator.meta.js +15 -0
- package/dist/agents/operator/entities/operator.meta.js.map +1 -0
- package/dist/agents/operator/interfaces/operator.tool.interface.d.ts +42 -0
- package/dist/agents/operator/interfaces/operator.tool.interface.d.ts.map +1 -0
- package/dist/agents/operator/interfaces/operator.tool.interface.js +6 -0
- package/dist/agents/operator/interfaces/operator.tool.interface.js.map +1 -0
- package/dist/agents/operator/operator.module.d.ts +3 -0
- package/dist/agents/operator/operator.module.d.ts.map +1 -0
- package/dist/agents/operator/operator.module.js +44 -0
- package/dist/agents/operator/operator.module.js.map +1 -0
- package/dist/agents/operator/prompts/operator.system.prompt.d.ts +2 -0
- package/dist/agents/operator/prompts/operator.system.prompt.d.ts.map +1 -0
- package/dist/agents/operator/prompts/operator.system.prompt.js +25 -0
- package/dist/agents/operator/prompts/operator.system.prompt.js.map +1 -0
- package/dist/agents/operator/services/operator.checkpointer.service.d.ts +57 -0
- package/dist/agents/operator/services/operator.checkpointer.service.d.ts.map +1 -0
- package/dist/agents/operator/services/operator.checkpointer.service.js +171 -0
- package/dist/agents/operator/services/operator.checkpointer.service.js.map +1 -0
- package/dist/agents/operator/services/operator.service.d.ts +81 -0
- package/dist/agents/operator/services/operator.service.d.ts.map +1 -0
- package/dist/agents/operator/services/operator.service.js +341 -0
- package/dist/agents/operator/services/operator.service.js.map +1 -0
- package/dist/agents/operator/tools/operator-test-action.tool.d.ts +12 -0
- package/dist/agents/operator/tools/operator-test-action.tool.d.ts.map +1 -0
- package/dist/agents/operator/tools/operator-test-action.tool.js +46 -0
- package/dist/agents/operator/tools/operator-test-action.tool.js.map +1 -0
- package/dist/agents/operator/tools/operator.tool.registry.d.ts +32 -0
- package/dist/agents/operator/tools/operator.tool.registry.d.ts.map +1 -0
- package/dist/agents/operator/tools/operator.tool.registry.js +95 -0
- package/dist/agents/operator/tools/operator.tool.registry.js.map +1 -0
- package/dist/agents/operator/tools/search-communities.tool.d.ts +16 -0
- package/dist/agents/operator/tools/search-communities.tool.d.ts.map +1 -0
- package/dist/agents/operator/tools/search-communities.tool.js +51 -0
- package/dist/agents/operator/tools/search-communities.tool.js.map +1 -0
- package/dist/agents/operator/tools/search-documents.tool.d.ts +17 -0
- package/dist/agents/operator/tools/search-documents.tool.d.ts.map +1 -0
- package/dist/agents/operator/tools/search-documents.tool.js +76 -0
- package/dist/agents/operator/tools/search-documents.tool.js.map +1 -0
- package/dist/config/base.config.d.ts +6 -0
- package/dist/config/base.config.d.ts.map +1 -1
- package/dist/config/base.config.js +1 -0
- package/dist/config/base.config.js.map +1 -1
- package/dist/config/interfaces/base.config.interface.d.ts +2 -0
- package/dist/config/interfaces/base.config.interface.d.ts.map +1 -1
- package/dist/config/interfaces/config.operator.interface.d.ts +9 -0
- package/dist/config/interfaces/config.operator.interface.d.ts.map +1 -0
- package/dist/config/interfaces/config.operator.interface.js +3 -0
- package/dist/config/interfaces/config.operator.interface.js.map +1 -0
- package/dist/config/interfaces/config.prompts.interface.d.ts +1 -0
- package/dist/config/interfaces/config.prompts.interface.d.ts.map +1 -1
- package/dist/config/interfaces/index.d.ts +1 -0
- package/dist/config/interfaces/index.d.ts.map +1 -1
- package/dist/config/interfaces/index.js +1 -0
- package/dist/config/interfaces/index.js.map +1 -1
- package/dist/core/llm/services/llm.service.d.ts +35 -0
- package/dist/core/llm/services/llm.service.d.ts.map +1 -1
- package/dist/core/llm/services/llm.service.js +92 -0
- package/dist/core/llm/services/llm.service.js.map +1 -1
- package/dist/foundations/assistant/assistant.module.d.ts.map +1 -1
- package/dist/foundations/assistant/assistant.module.js +14 -1
- package/dist/foundations/assistant/assistant.module.js.map +1 -1
- package/dist/foundations/assistant/entities/assistant.d.ts +1 -0
- package/dist/foundations/assistant/entities/assistant.d.ts.map +1 -1
- package/dist/foundations/assistant/entities/assistant.js +1 -0
- package/dist/foundations/assistant/entities/assistant.js.map +1 -1
- package/dist/foundations/assistant/services/assistant.service.d.ts +88 -1
- package/dist/foundations/assistant/services/assistant.service.d.ts.map +1 -1
- package/dist/foundations/assistant/services/assistant.service.js +365 -2
- package/dist/foundations/assistant/services/assistant.service.js.map +1 -1
- package/dist/foundations/assistant-action/assistant-action.module.d.ts +5 -0
- package/dist/foundations/assistant-action/assistant-action.module.d.ts.map +1 -0
- package/dist/foundations/assistant-action/assistant-action.module.js +43 -0
- package/dist/foundations/assistant-action/assistant-action.module.js.map +1 -0
- package/dist/foundations/assistant-action/controllers/assistant-action.controller.d.ts +30 -0
- package/dist/foundations/assistant-action/controllers/assistant-action.controller.d.ts.map +1 -0
- package/dist/foundations/assistant-action/controllers/assistant-action.controller.js +119 -0
- package/dist/foundations/assistant-action/controllers/assistant-action.controller.js.map +1 -0
- package/dist/foundations/assistant-action/cron/assistant-action.expiry.cron.d.ts +9 -0
- package/dist/foundations/assistant-action/cron/assistant-action.expiry.cron.d.ts.map +1 -0
- package/dist/foundations/assistant-action/cron/assistant-action.expiry.cron.js +46 -0
- package/dist/foundations/assistant-action/cron/assistant-action.expiry.cron.js.map +1 -0
- package/dist/foundations/assistant-action/entities/assistant-action.d.ts +49 -0
- package/dist/foundations/assistant-action/entities/assistant-action.d.ts.map +1 -0
- package/dist/foundations/assistant-action/entities/assistant-action.js +43 -0
- package/dist/foundations/assistant-action/entities/assistant-action.js.map +1 -0
- package/dist/foundations/assistant-action/entities/assistant-action.meta.d.ts +3 -0
- package/dist/foundations/assistant-action/entities/assistant-action.meta.d.ts.map +1 -0
- package/dist/foundations/assistant-action/entities/assistant-action.meta.js +10 -0
- package/dist/foundations/assistant-action/entities/assistant-action.meta.js.map +1 -0
- package/dist/foundations/assistant-action/index.d.ts +7 -0
- package/dist/foundations/assistant-action/index.d.ts.map +1 -0
- package/dist/foundations/assistant-action/index.js +23 -0
- package/dist/foundations/assistant-action/index.js.map +1 -0
- package/dist/foundations/assistant-action/repositories/assistant-action.repository.d.ts +81 -0
- package/dist/foundations/assistant-action/repositories/assistant-action.repository.d.ts.map +1 -0
- package/dist/foundations/assistant-action/repositories/assistant-action.repository.js +131 -0
- package/dist/foundations/assistant-action/repositories/assistant-action.repository.js.map +1 -0
- package/dist/foundations/assistant-action/services/assistant-action.service.d.ts +48 -0
- package/dist/foundations/assistant-action/services/assistant-action.service.d.ts.map +1 -0
- package/dist/foundations/assistant-action/services/assistant-action.service.js +67 -0
- package/dist/foundations/assistant-action/services/assistant-action.service.js.map +1 -0
- package/dist/foundations/assistant-message/entities/assistant-message.d.ts +12 -0
- package/dist/foundations/assistant-message/entities/assistant-message.d.ts.map +1 -1
- package/dist/foundations/assistant-message/entities/assistant-message.js +11 -0
- package/dist/foundations/assistant-message/entities/assistant-message.js.map +1 -1
- package/dist/foundations/assistant-message/repositories/assistant-message.repository.d.ts +9 -0
- package/dist/foundations/assistant-message/repositories/assistant-message.repository.d.ts.map +1 -1
- package/dist/foundations/assistant-message/services/assistant-message.service.d.ts +9 -0
- package/dist/foundations/assistant-message/services/assistant-message.service.d.ts.map +1 -1
- package/dist/foundations/index.d.ts +1 -0
- package/dist/foundations/index.d.ts.map +1 -1
- package/dist/foundations/index.js +1 -0
- package/dist/foundations/index.js.map +1 -1
- package/package.json +2 -1
|
@@ -0,0 +1,119 @@
|
|
|
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.AssistantActionController = void 0;
|
|
16
|
+
const common_1 = require("@nestjs/common");
|
|
17
|
+
const decorators_1 = require("../../../common/decorators");
|
|
18
|
+
const jwt_auth_guard_1 = require("../../../common/guards/jwt.auth.guard");
|
|
19
|
+
const crud_handlers_1 = require("../../../common/handlers/crud.handlers");
|
|
20
|
+
const cache_service_1 = require("../../../core/cache/services/cache.service");
|
|
21
|
+
const jsonapi_service_1 = require("../../../core/jsonapi/services/jsonapi.service");
|
|
22
|
+
const audit_service_1 = require("../../audit/services/audit.service");
|
|
23
|
+
const assistant_service_1 = require("../../assistant/services/assistant.service");
|
|
24
|
+
const assistant_message_1 = require("../../assistant-message/entities/assistant-message");
|
|
25
|
+
const assistant_action_1 = require("../entities/assistant-action");
|
|
26
|
+
const assistant_action_meta_1 = require("../entities/assistant-action.meta");
|
|
27
|
+
const assistant_action_service_1 = require("../services/assistant-action.service");
|
|
28
|
+
let AssistantActionController = class AssistantActionController {
|
|
29
|
+
constructor(assistantActions, assistants, jsonApi, auditService, cacheService) {
|
|
30
|
+
this.assistantActions = assistantActions;
|
|
31
|
+
this.assistants = assistants;
|
|
32
|
+
this.jsonApi = jsonApi;
|
|
33
|
+
this.auditService = auditService;
|
|
34
|
+
this.cacheService = cacheService;
|
|
35
|
+
this.crud = (0, crud_handlers_1.createCrudHandlers)(() => this.assistantActions);
|
|
36
|
+
}
|
|
37
|
+
// GET /assistant-actions/:actionId
|
|
38
|
+
async findById(request, reply, actionId) {
|
|
39
|
+
return this.crud.findById(reply, actionId);
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* POST /assistant-actions/:actionId/approve — resolve the pending action and
|
|
43
|
+
* resume the frozen operator run with approval. Synchronously returns the
|
|
44
|
+
* final assistant message (JSON:API) with the resolved action included.
|
|
45
|
+
*/
|
|
46
|
+
async approve(request, reply, actionId) {
|
|
47
|
+
return this.resolve(reply, actionId, true);
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* POST /assistant-actions/:actionId/deny — resolve the pending action and
|
|
51
|
+
* resume with denial. Returns the wrap-up assistant message with the
|
|
52
|
+
* resolved action included.
|
|
53
|
+
*/
|
|
54
|
+
async deny(request, reply, actionId) {
|
|
55
|
+
return this.resolve(reply, actionId, false);
|
|
56
|
+
}
|
|
57
|
+
async resolve(reply, actionId, approved) {
|
|
58
|
+
const { assistantMessage, action } = await this.assistants.resolveAction({ actionId, approved });
|
|
59
|
+
const document = await this.jsonApi.buildSingle(assistant_message_1.AssistantMessageDescriptor.model, assistantMessage);
|
|
60
|
+
const actionDocument = await this.jsonApi.buildSingle(assistant_action_1.AssistantActionDescriptor.model, action);
|
|
61
|
+
// Merge the resolved action into `included`, deduping by (type,id) and
|
|
62
|
+
// never echoing the primary message resource back into `included`.
|
|
63
|
+
const merged = [...(document.included ?? []), actionDocument.data, ...(actionDocument.included ?? [])];
|
|
64
|
+
const seen = new Set();
|
|
65
|
+
document.included = merged.filter((resource) => {
|
|
66
|
+
if (!resource)
|
|
67
|
+
return false;
|
|
68
|
+
if (resource.type === document.data?.type && resource.id === document.data?.id)
|
|
69
|
+
return false;
|
|
70
|
+
const key = `${resource.type}-${resource.id}`;
|
|
71
|
+
if (seen.has(key))
|
|
72
|
+
return false;
|
|
73
|
+
seen.add(key);
|
|
74
|
+
return true;
|
|
75
|
+
});
|
|
76
|
+
reply.send(document);
|
|
77
|
+
}
|
|
78
|
+
};
|
|
79
|
+
exports.AssistantActionController = AssistantActionController;
|
|
80
|
+
__decorate([
|
|
81
|
+
(0, common_1.Get)(`${assistant_action_meta_1.assistantActionMeta.endpoint}/:actionId`),
|
|
82
|
+
(0, decorators_1.Audit)(assistant_action_meta_1.assistantActionMeta, "actionId"),
|
|
83
|
+
__param(0, (0, common_1.Req)()),
|
|
84
|
+
__param(1, (0, common_1.Res)()),
|
|
85
|
+
__param(2, (0, common_1.Param)("actionId")),
|
|
86
|
+
__metadata("design:type", Function),
|
|
87
|
+
__metadata("design:paramtypes", [Object, Object, String]),
|
|
88
|
+
__metadata("design:returntype", Promise)
|
|
89
|
+
], AssistantActionController.prototype, "findById", null);
|
|
90
|
+
__decorate([
|
|
91
|
+
(0, common_1.Post)(`${assistant_action_meta_1.assistantActionMeta.endpoint}/:actionId/approve`),
|
|
92
|
+
(0, decorators_1.CacheInvalidate)(assistant_action_meta_1.assistantActionMeta, "actionId"),
|
|
93
|
+
__param(0, (0, common_1.Req)()),
|
|
94
|
+
__param(1, (0, common_1.Res)()),
|
|
95
|
+
__param(2, (0, common_1.Param)("actionId")),
|
|
96
|
+
__metadata("design:type", Function),
|
|
97
|
+
__metadata("design:paramtypes", [Object, Object, String]),
|
|
98
|
+
__metadata("design:returntype", Promise)
|
|
99
|
+
], AssistantActionController.prototype, "approve", null);
|
|
100
|
+
__decorate([
|
|
101
|
+
(0, common_1.Post)(`${assistant_action_meta_1.assistantActionMeta.endpoint}/:actionId/deny`),
|
|
102
|
+
(0, decorators_1.CacheInvalidate)(assistant_action_meta_1.assistantActionMeta, "actionId"),
|
|
103
|
+
__param(0, (0, common_1.Req)()),
|
|
104
|
+
__param(1, (0, common_1.Res)()),
|
|
105
|
+
__param(2, (0, common_1.Param)("actionId")),
|
|
106
|
+
__metadata("design:type", Function),
|
|
107
|
+
__metadata("design:paramtypes", [Object, Object, String]),
|
|
108
|
+
__metadata("design:returntype", Promise)
|
|
109
|
+
], AssistantActionController.prototype, "deny", null);
|
|
110
|
+
exports.AssistantActionController = AssistantActionController = __decorate([
|
|
111
|
+
(0, common_1.UseGuards)(jwt_auth_guard_1.JwtAuthGuard),
|
|
112
|
+
(0, common_1.Controller)(),
|
|
113
|
+
__metadata("design:paramtypes", [assistant_action_service_1.AssistantActionService,
|
|
114
|
+
assistant_service_1.AssistantService,
|
|
115
|
+
jsonapi_service_1.JsonApiService,
|
|
116
|
+
audit_service_1.AuditService,
|
|
117
|
+
cache_service_1.CacheService])
|
|
118
|
+
], AssistantActionController);
|
|
119
|
+
//# sourceMappingURL=assistant-action.controller.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"assistant-action.controller.js","sourceRoot":"","sources":["../../../../src/foundations/assistant-action/controllers/assistant-action.controller.ts"],"names":[],"mappings":"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"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { AppLoggingService } from "../../../core/logging/services/logging.service";
|
|
2
|
+
import { AssistantActionRepository } from "../repositories/assistant-action.repository";
|
|
3
|
+
export declare class AssistantActionExpiryCron {
|
|
4
|
+
private readonly assistantActionRepository;
|
|
5
|
+
private readonly logger;
|
|
6
|
+
constructor(assistantActionRepository: AssistantActionRepository, logger: AppLoggingService);
|
|
7
|
+
handleOverdueActions(): Promise<void>;
|
|
8
|
+
}
|
|
9
|
+
//# sourceMappingURL=assistant-action.expiry.cron.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"assistant-action.expiry.cron.d.ts","sourceRoot":"","sources":["../../../../src/foundations/assistant-action/cron/assistant-action.expiry.cron.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,iBAAiB,EAAE,MAAM,gDAAgD,CAAC;AACnF,OAAO,EAAE,yBAAyB,EAAE,MAAM,6CAA6C,CAAC;AAExF,qBACa,yBAAyB;IAElC,OAAO,CAAC,QAAQ,CAAC,yBAAyB;IAC1C,OAAO,CAAC,QAAQ,CAAC,MAAM;gBADN,yBAAyB,EAAE,yBAAyB,EACpD,MAAM,EAAE,iBAAiB;IAItC,oBAAoB,IAAI,OAAO,CAAC,IAAI,CAAC;CAa5C"}
|
|
@@ -0,0 +1,46 @@
|
|
|
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.AssistantActionExpiryCron = void 0;
|
|
13
|
+
const common_1 = require("@nestjs/common");
|
|
14
|
+
const schedule_1 = require("@nestjs/schedule");
|
|
15
|
+
const logging_service_1 = require("../../../core/logging/services/logging.service");
|
|
16
|
+
const assistant_action_repository_1 = require("../repositories/assistant-action.repository");
|
|
17
|
+
let AssistantActionExpiryCron = class AssistantActionExpiryCron {
|
|
18
|
+
constructor(assistantActionRepository, logger) {
|
|
19
|
+
this.assistantActionRepository = assistantActionRepository;
|
|
20
|
+
this.logger = logger;
|
|
21
|
+
}
|
|
22
|
+
async handleOverdueActions() {
|
|
23
|
+
const overdueActions = await this.assistantActionRepository.findAllOverduePendingActions();
|
|
24
|
+
for (const { assistantActionId, companyId } of overdueActions) {
|
|
25
|
+
try {
|
|
26
|
+
await this.assistantActionRepository.expireAction({ assistantActionId, companyId });
|
|
27
|
+
}
|
|
28
|
+
catch (error) {
|
|
29
|
+
this.logger.error(`Failed to expire assistant action ${assistantActionId} for company ${companyId}: ${error.message}`, "AssistantActionExpiryCron");
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
};
|
|
34
|
+
exports.AssistantActionExpiryCron = AssistantActionExpiryCron;
|
|
35
|
+
__decorate([
|
|
36
|
+
(0, schedule_1.Cron)(schedule_1.CronExpression.EVERY_HOUR),
|
|
37
|
+
__metadata("design:type", Function),
|
|
38
|
+
__metadata("design:paramtypes", []),
|
|
39
|
+
__metadata("design:returntype", Promise)
|
|
40
|
+
], AssistantActionExpiryCron.prototype, "handleOverdueActions", null);
|
|
41
|
+
exports.AssistantActionExpiryCron = AssistantActionExpiryCron = __decorate([
|
|
42
|
+
(0, common_1.Injectable)(),
|
|
43
|
+
__metadata("design:paramtypes", [assistant_action_repository_1.AssistantActionRepository,
|
|
44
|
+
logging_service_1.AppLoggingService])
|
|
45
|
+
], AssistantActionExpiryCron);
|
|
46
|
+
//# sourceMappingURL=assistant-action.expiry.cron.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"assistant-action.expiry.cron.js","sourceRoot":"","sources":["../../../../src/foundations/assistant-action/cron/assistant-action.expiry.cron.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,2CAA4C;AAC5C,+CAAwD;AACxD,oFAAmF;AACnF,6FAAwF;AAGjF,IAAM,yBAAyB,GAA/B,MAAM,yBAAyB;IACpC,YACmB,yBAAoD,EACpD,MAAyB;QADzB,8BAAyB,GAAzB,yBAAyB,CAA2B;QACpD,WAAM,GAAN,MAAM,CAAmB;IACzC,CAAC;IAGE,AAAN,KAAK,CAAC,oBAAoB;QACxB,MAAM,cAAc,GAAG,MAAM,IAAI,CAAC,yBAAyB,CAAC,4BAA4B,EAAE,CAAC;QAC3F,KAAK,MAAM,EAAE,iBAAiB,EAAE,SAAS,EAAE,IAAI,cAAc,EAAE,CAAC;YAC9D,IAAI,CAAC;gBACH,MAAM,IAAI,CAAC,yBAAyB,CAAC,YAAY,CAAC,EAAE,iBAAiB,EAAE,SAAS,EAAE,CAAC,CAAC;YACtF,CAAC;YAAC,OAAO,KAAK,EAAE,CAAC;gBACf,IAAI,CAAC,MAAM,CAAC,KAAK,CACf,qCAAqC,iBAAiB,gBAAgB,SAAS,KAAM,KAAe,CAAC,OAAO,EAAE,EAC9G,2BAA2B,CAC5B,CAAC;YACJ,CAAC;QACH,CAAC;IACH,CAAC;CACF,CAAA;AApBY,8DAAyB;AAO9B;IADL,IAAA,eAAI,EAAC,yBAAc,CAAC,UAAU,CAAC;;;;qEAa/B;oCAnBU,yBAAyB;IADrC,IAAA,mBAAU,GAAE;qCAGmC,uDAAyB;QAC5C,mCAAiB;GAHjC,yBAAyB,CAoBrC"}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { Entity } from "../../../common";
|
|
2
|
+
import type { Company } from "../../company/entities/company";
|
|
3
|
+
import type { Assistant } from "../../assistant/entities/assistant";
|
|
4
|
+
import type { AssistantMessage } from "../../assistant-message/entities/assistant-message";
|
|
5
|
+
export type AssistantActionStatus = "pending" | "approved" | "denied" | "expired" | "executed" | "failed";
|
|
6
|
+
/**
|
|
7
|
+
* AssistantAction — a durable, first-class record of a destructive tool call
|
|
8
|
+
* awaiting (or having received) human approval. Survives Redis checkpoint loss
|
|
9
|
+
* and acts as the audit trail for operator approval gates.
|
|
10
|
+
*
|
|
11
|
+
* `requestedAt` is intentionally NOT a field — the framework's `createdAt`
|
|
12
|
+
* covers it.
|
|
13
|
+
*/
|
|
14
|
+
export type AssistantAction = Entity & {
|
|
15
|
+
status: AssistantActionStatus;
|
|
16
|
+
toolName: string;
|
|
17
|
+
toolArgs: string;
|
|
18
|
+
summary: string;
|
|
19
|
+
threadId: string;
|
|
20
|
+
userModuleIds: string;
|
|
21
|
+
contentScope?: string;
|
|
22
|
+
resolvedAt?: string;
|
|
23
|
+
expiresAt: string;
|
|
24
|
+
company: Company;
|
|
25
|
+
assistant: Assistant;
|
|
26
|
+
message?: AssistantMessage;
|
|
27
|
+
};
|
|
28
|
+
export declare const AssistantActionDescriptor: import("../../../common").EntityDescriptor<AssistantAction, {
|
|
29
|
+
assistant: {
|
|
30
|
+
model: import("../../../common").DataMeta;
|
|
31
|
+
direction: "in";
|
|
32
|
+
relationship: string;
|
|
33
|
+
cardinality: "one";
|
|
34
|
+
required: true;
|
|
35
|
+
dtoKey: string;
|
|
36
|
+
immutable: true;
|
|
37
|
+
};
|
|
38
|
+
message: {
|
|
39
|
+
model: import("../../../common").DataMeta;
|
|
40
|
+
direction: "in";
|
|
41
|
+
relationship: string;
|
|
42
|
+
cardinality: "one";
|
|
43
|
+
required: false;
|
|
44
|
+
dtoKey: string;
|
|
45
|
+
immutable: true;
|
|
46
|
+
};
|
|
47
|
+
}>;
|
|
48
|
+
export type AssistantActionDescriptorType = typeof AssistantActionDescriptor;
|
|
49
|
+
//# sourceMappingURL=assistant-action.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"assistant-action.d.ts","sourceRoot":"","sources":["../../../../src/foundations/assistant-action/entities/assistant-action.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAgB,MAAM,iBAAiB,CAAC;AACvD,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,gCAAgC,CAAC;AAC9D,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,oCAAoC,CAAC;AAEpE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,oDAAoD,CAAC;AAI3F,MAAM,MAAM,qBAAqB,GAAG,SAAS,GAAG,UAAU,GAAG,QAAQ,GAAG,SAAS,GAAG,UAAU,GAAG,QAAQ,CAAC;AAE1G;;;;;;;GAOG;AACH,MAAM,MAAM,eAAe,GAAG,MAAM,GAAG;IACrC,MAAM,EAAE,qBAAqB,CAAC;IAC9B,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,MAAM,CAAC;IACjB,aAAa,EAAE,MAAM,CAAC;IACtB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,OAAO,CAAC;IACjB,SAAS,EAAE,SAAS,CAAC;IACrB,OAAO,CAAC,EAAE,gBAAgB,CAAC;CAC5B,CAAC;AAEF,eAAO,MAAM,yBAAyB;;;;;;;;;;;;;;;;;;;EAkCpC,CAAC;AAEH,MAAM,MAAM,6BAA6B,GAAG,OAAO,yBAAyB,CAAC"}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.AssistantActionDescriptor = void 0;
|
|
4
|
+
const common_1 = require("../../../common");
|
|
5
|
+
const assistant_meta_1 = require("../../assistant/entities/assistant.meta");
|
|
6
|
+
const assistant_message_meta_1 = require("../../assistant-message/entities/assistant-message.meta");
|
|
7
|
+
const assistant_action_meta_1 = require("./assistant-action.meta");
|
|
8
|
+
exports.AssistantActionDescriptor = (0, common_1.defineEntity)()({
|
|
9
|
+
...assistant_action_meta_1.assistantActionMeta,
|
|
10
|
+
isCompanyScoped: true,
|
|
11
|
+
fields: {
|
|
12
|
+
status: { type: "string" },
|
|
13
|
+
toolName: { type: "string" },
|
|
14
|
+
toolArgs: { type: "string" },
|
|
15
|
+
summary: { type: "string" },
|
|
16
|
+
threadId: { type: "string" },
|
|
17
|
+
userModuleIds: { type: "string" },
|
|
18
|
+
contentScope: { type: "string" },
|
|
19
|
+
resolvedAt: { type: "datetime" },
|
|
20
|
+
expiresAt: { type: "datetime", required: true },
|
|
21
|
+
},
|
|
22
|
+
relationships: {
|
|
23
|
+
assistant: {
|
|
24
|
+
model: assistant_meta_1.assistantMeta,
|
|
25
|
+
direction: "in", // the Assistant owns the action: (Assistant)-[:HAS_ACTION]->(AssistantAction)
|
|
26
|
+
relationship: "HAS_ACTION",
|
|
27
|
+
cardinality: "one",
|
|
28
|
+
required: true,
|
|
29
|
+
dtoKey: "assistant",
|
|
30
|
+
immutable: true,
|
|
31
|
+
},
|
|
32
|
+
message: {
|
|
33
|
+
model: assistant_message_meta_1.assistantMessageMeta,
|
|
34
|
+
direction: "in", // (AssistantMessage)-[:REQUESTED_IN]->(AssistantAction)
|
|
35
|
+
relationship: "REQUESTED_IN",
|
|
36
|
+
cardinality: "one",
|
|
37
|
+
required: false,
|
|
38
|
+
dtoKey: "message",
|
|
39
|
+
immutable: true,
|
|
40
|
+
},
|
|
41
|
+
},
|
|
42
|
+
});
|
|
43
|
+
//# sourceMappingURL=assistant-action.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"assistant-action.js","sourceRoot":"","sources":["../../../../src/foundations/assistant-action/entities/assistant-action.ts"],"names":[],"mappings":";;;AAAA,4CAAuD;AAGvD,4EAAwE;AAExE,oGAA+F;AAC/F,mEAA8D;AA2BjD,QAAA,yBAAyB,GAAG,IAAA,qBAAY,GAAmB,CAAC;IACvE,GAAG,2CAAmB;IACtB,eAAe,EAAE,IAAI;IACrB,MAAM,EAAE;QACN,MAAM,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;QAC1B,QAAQ,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;QAC5B,QAAQ,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;QAC5B,OAAO,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;QAC3B,QAAQ,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;QAC5B,aAAa,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;QACjC,YAAY,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;QAChC,UAAU,EAAE,EAAE,IAAI,EAAE,UAAU,EAAE;QAChC,SAAS,EAAE,EAAE,IAAI,EAAE,UAAU,EAAE,QAAQ,EAAE,IAAI,EAAE;KAChD;IACD,aAAa,EAAE;QACb,SAAS,EAAE;YACT,KAAK,EAAE,8BAAa;YACpB,SAAS,EAAE,IAAI,EAAE,8EAA8E;YAC/F,YAAY,EAAE,YAAY;YAC1B,WAAW,EAAE,KAAK;YAClB,QAAQ,EAAE,IAAI;YACd,MAAM,EAAE,WAAW;YACnB,SAAS,EAAE,IAAI;SAChB;QACD,OAAO,EAAE;YACP,KAAK,EAAE,6CAAoB;YAC3B,SAAS,EAAE,IAAI,EAAE,wDAAwD;YACzE,YAAY,EAAE,cAAc;YAC5B,WAAW,EAAE,KAAK;YAClB,QAAQ,EAAE,KAAK;YACf,MAAM,EAAE,SAAS;YACjB,SAAS,EAAE,IAAI;SAChB;KACF;CACF,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"assistant-action.meta.d.ts","sourceRoot":"","sources":["../../../../src/foundations/assistant-action/entities/assistant-action.meta.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,gDAAgD,CAAC;AAE1E,eAAO,MAAM,mBAAmB,EAAE,QAKjC,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.assistantActionMeta = void 0;
|
|
4
|
+
exports.assistantActionMeta = {
|
|
5
|
+
type: "assistant-actions",
|
|
6
|
+
endpoint: "assistant-actions",
|
|
7
|
+
nodeName: "assistantAction",
|
|
8
|
+
labelName: "AssistantAction",
|
|
9
|
+
};
|
|
10
|
+
//# sourceMappingURL=assistant-action.meta.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"assistant-action.meta.js","sourceRoot":"","sources":["../../../../src/foundations/assistant-action/entities/assistant-action.meta.ts"],"names":[],"mappings":";;;AAEa,QAAA,mBAAmB,GAAa;IAC3C,IAAI,EAAE,mBAAmB;IACzB,QAAQ,EAAE,mBAAmB;IAC7B,QAAQ,EAAE,iBAAiB;IAC3B,SAAS,EAAE,iBAAiB;CAC7B,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export * from "./entities/assistant-action.meta";
|
|
2
|
+
export * from "./entities/assistant-action";
|
|
3
|
+
export * from "./repositories/assistant-action.repository";
|
|
4
|
+
export * from "./services/assistant-action.service";
|
|
5
|
+
export * from "./controllers/assistant-action.controller";
|
|
6
|
+
export * from "./assistant-action.module";
|
|
7
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/foundations/assistant-action/index.ts"],"names":[],"mappings":"AAAA,cAAc,kCAAkC,CAAC;AACjD,cAAc,6BAA6B,CAAC;AAC5C,cAAc,4CAA4C,CAAC;AAC3D,cAAc,qCAAqC,CAAC;AACpD,cAAc,2CAA2C,CAAC;AAC1D,cAAc,2BAA2B,CAAC"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./entities/assistant-action.meta"), exports);
|
|
18
|
+
__exportStar(require("./entities/assistant-action"), exports);
|
|
19
|
+
__exportStar(require("./repositories/assistant-action.repository"), exports);
|
|
20
|
+
__exportStar(require("./services/assistant-action.service"), exports);
|
|
21
|
+
__exportStar(require("./controllers/assistant-action.controller"), exports);
|
|
22
|
+
__exportStar(require("./assistant-action.module"), exports);
|
|
23
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/foundations/assistant-action/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,mEAAiD;AACjD,8DAA4C;AAC5C,6EAA2D;AAC3D,sEAAoD;AACpD,4EAA0D;AAC1D,4DAA0C"}
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
import { ClsService } from "nestjs-cls";
|
|
2
|
+
import { AbstractRepository } from "../../../core/neo4j/abstracts/abstract.repository";
|
|
3
|
+
import { Neo4jService } from "../../../core/neo4j/services/neo4j.service";
|
|
4
|
+
import { SecurityService } from "../../../core/security/services/security.service";
|
|
5
|
+
import { AssistantAction, AssistantActionDescriptor, AssistantActionStatus } from "../entities/assistant-action";
|
|
6
|
+
/**
|
|
7
|
+
* AssistantActionRepository
|
|
8
|
+
*
|
|
9
|
+
* Owner-RBAC is inherited from the parent Assistant (a user may only see the
|
|
10
|
+
* actions that belong to their own assistants). Company scope is applied
|
|
11
|
+
* automatically via `buildDefaultMatch()` (`isCompanyScoped: true`).
|
|
12
|
+
*/
|
|
13
|
+
export declare class AssistantActionRepository extends AbstractRepository<AssistantAction, typeof AssistantActionDescriptor.relationships> {
|
|
14
|
+
protected readonly descriptor: import("../../..").EntityDescriptor<AssistantAction, {
|
|
15
|
+
assistant: {
|
|
16
|
+
model: import("../../..").DataMeta;
|
|
17
|
+
direction: "in";
|
|
18
|
+
relationship: string;
|
|
19
|
+
cardinality: "one";
|
|
20
|
+
required: true;
|
|
21
|
+
dtoKey: string;
|
|
22
|
+
immutable: true;
|
|
23
|
+
};
|
|
24
|
+
message: {
|
|
25
|
+
model: import("../../..").DataMeta;
|
|
26
|
+
direction: "in";
|
|
27
|
+
relationship: string;
|
|
28
|
+
cardinality: "one";
|
|
29
|
+
required: false;
|
|
30
|
+
dtoKey: string;
|
|
31
|
+
immutable: true;
|
|
32
|
+
};
|
|
33
|
+
}>;
|
|
34
|
+
constructor(neo4j: Neo4jService, securityService: SecurityService, clsService: ClsService);
|
|
35
|
+
protected buildUserHasAccess(): string;
|
|
36
|
+
/**
|
|
37
|
+
* Atomically transition the action's status from `from` to `to`, guarded in
|
|
38
|
+
* Cypher so that only one of N concurrent attempts wins (`WHERE status =
|
|
39
|
+
* $from`). Also requires `expiresAt` to be in the future — expired actions
|
|
40
|
+
* can no longer be resolved.
|
|
41
|
+
*
|
|
42
|
+
* Under Neo4j's read-committed isolation a plain `MATCH … WHERE … SET` is
|
|
43
|
+
* check-then-set: the WHERE is evaluated before the write lock is acquired
|
|
44
|
+
* at SET and is NOT re-evaluated afterwards, so two concurrent approves
|
|
45
|
+
* could both pass the guard. The no-op `SET updatedAt = updatedAt` acquires
|
|
46
|
+
* the node's write lock BEFORE the guard (standard Neo4j CAS idiom), making
|
|
47
|
+
* the guard + transition atomic.
|
|
48
|
+
*
|
|
49
|
+
* Owner-RBAC (`buildUserHasAccess`) is injected via
|
|
50
|
+
* `securityService.userHasAccess()`, mirroring the framework's standard
|
|
51
|
+
* write path in AbstractRepository.
|
|
52
|
+
*
|
|
53
|
+
* Returns true when this call won the transition, false otherwise.
|
|
54
|
+
*/
|
|
55
|
+
resolveStatus(params: {
|
|
56
|
+
id: string;
|
|
57
|
+
from: AssistantActionStatus;
|
|
58
|
+
to: AssistantActionStatus;
|
|
59
|
+
}): Promise<boolean>;
|
|
60
|
+
/**
|
|
61
|
+
* Cross-company sweep used by AssistantActionExpiryCron (runs outside any
|
|
62
|
+
* request, so there is no CLS company context). Mirrors
|
|
63
|
+
* CommunityRepository.findAllStaleCommunities(): the read returns
|
|
64
|
+
* id + companyId pairs so that every subsequent write stays company-scoped.
|
|
65
|
+
*/
|
|
66
|
+
findAllOverduePendingActions(): Promise<{
|
|
67
|
+
assistantActionId: string;
|
|
68
|
+
companyId: string;
|
|
69
|
+
}[]>;
|
|
70
|
+
/**
|
|
71
|
+
* Company-scoped expiry write for a single overdue pending action, called by
|
|
72
|
+
* AssistantActionExpiryCron with the companyId resolved by the sweep above.
|
|
73
|
+
* Guarded on status AND expiresAt so a concurrent approval/denial between
|
|
74
|
+
* the sweep read and this write is never overwritten.
|
|
75
|
+
*/
|
|
76
|
+
expireAction(params: {
|
|
77
|
+
assistantActionId: string;
|
|
78
|
+
companyId: string;
|
|
79
|
+
}): Promise<void>;
|
|
80
|
+
}
|
|
81
|
+
//# sourceMappingURL=assistant-action.repository.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"assistant-action.repository.d.ts","sourceRoot":"","sources":["../../../../src/foundations/assistant-action/repositories/assistant-action.repository.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AACxC,OAAO,EAAE,kBAAkB,EAAE,MAAM,mDAAmD,CAAC;AACvF,OAAO,EAAE,YAAY,EAAE,MAAM,4CAA4C,CAAC;AAC1E,OAAO,EAAE,eAAe,EAAE,MAAM,kDAAkD,CAAC;AACnF,OAAO,EAAE,eAAe,EAAE,yBAAyB,EAAE,qBAAqB,EAAE,MAAM,8BAA8B,CAAC;AAGjH;;;;;;GAMG;AACH,qBACa,yBAA0B,SAAQ,kBAAkB,CAC/D,eAAe,EACf,OAAO,yBAAyB,CAAC,aAAa,CAC/C;IACC,SAAS,CAAC,QAAQ,CAAC,UAAU;;;;;;;;;;;;;;;;;;;OAA6B;gBAE9C,KAAK,EAAE,YAAY,EAAE,eAAe,EAAE,eAAe,EAAE,UAAU,EAAE,UAAU;IAIzF,SAAS,CAAC,kBAAkB,IAAI,MAAM;IAStC;;;;;;;;;;;;;;;;;;OAkBG;IACG,aAAa,CAAC,MAAM,EAAE;QAC1B,EAAE,EAAE,MAAM,CAAC;QACX,IAAI,EAAE,qBAAqB,CAAC;QAC5B,EAAE,EAAE,qBAAqB,CAAC;KAC3B,GAAG,OAAO,CAAC,OAAO,CAAC;IAsBpB;;;;;OAKG;IACG,4BAA4B,IAAI,OAAO,CAAC;QAAE,iBAAiB,EAAE,MAAM,CAAC;QAAC,SAAS,EAAE,MAAM,CAAA;KAAE,EAAE,CAAC;IAgBjG;;;;;OAKG;IACG,YAAY,CAAC,MAAM,EAAE;QAAE,iBAAiB,EAAE,MAAM,CAAC;QAAC,SAAS,EAAE,MAAM,CAAA;KAAE,GAAG,OAAO,CAAC,IAAI,CAAC;CAkB5F"}
|
|
@@ -0,0 +1,131 @@
|
|
|
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.AssistantActionRepository = void 0;
|
|
13
|
+
const common_1 = require("@nestjs/common");
|
|
14
|
+
const nestjs_cls_1 = require("nestjs-cls");
|
|
15
|
+
const abstract_repository_1 = require("../../../core/neo4j/abstracts/abstract.repository");
|
|
16
|
+
const neo4j_service_1 = require("../../../core/neo4j/services/neo4j.service");
|
|
17
|
+
const security_service_1 = require("../../../core/security/services/security.service");
|
|
18
|
+
const assistant_action_1 = require("../entities/assistant-action");
|
|
19
|
+
const assistant_action_meta_1 = require("../entities/assistant-action.meta");
|
|
20
|
+
/**
|
|
21
|
+
* AssistantActionRepository
|
|
22
|
+
*
|
|
23
|
+
* Owner-RBAC is inherited from the parent Assistant (a user may only see the
|
|
24
|
+
* actions that belong to their own assistants). Company scope is applied
|
|
25
|
+
* automatically via `buildDefaultMatch()` (`isCompanyScoped: true`).
|
|
26
|
+
*/
|
|
27
|
+
let AssistantActionRepository = class AssistantActionRepository extends abstract_repository_1.AbstractRepository {
|
|
28
|
+
constructor(neo4j, securityService, clsService) {
|
|
29
|
+
super(neo4j, securityService, clsService);
|
|
30
|
+
this.descriptor = assistant_action_1.AssistantActionDescriptor;
|
|
31
|
+
}
|
|
32
|
+
buildUserHasAccess() {
|
|
33
|
+
const { nodeName } = this.descriptor.model;
|
|
34
|
+
return `WITH ${nodeName}
|
|
35
|
+
WHERE EXISTS {
|
|
36
|
+
MATCH (${nodeName})<-[:HAS_ACTION]-(:Assistant)-[:CREATED_BY]->(:User {id: $currentUserId})
|
|
37
|
+
}
|
|
38
|
+
WITH ${nodeName}`;
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* Atomically transition the action's status from `from` to `to`, guarded in
|
|
42
|
+
* Cypher so that only one of N concurrent attempts wins (`WHERE status =
|
|
43
|
+
* $from`). Also requires `expiresAt` to be in the future — expired actions
|
|
44
|
+
* can no longer be resolved.
|
|
45
|
+
*
|
|
46
|
+
* Under Neo4j's read-committed isolation a plain `MATCH … WHERE … SET` is
|
|
47
|
+
* check-then-set: the WHERE is evaluated before the write lock is acquired
|
|
48
|
+
* at SET and is NOT re-evaluated afterwards, so two concurrent approves
|
|
49
|
+
* could both pass the guard. The no-op `SET updatedAt = updatedAt` acquires
|
|
50
|
+
* the node's write lock BEFORE the guard (standard Neo4j CAS idiom), making
|
|
51
|
+
* the guard + transition atomic.
|
|
52
|
+
*
|
|
53
|
+
* Owner-RBAC (`buildUserHasAccess`) is injected via
|
|
54
|
+
* `securityService.userHasAccess()`, mirroring the framework's standard
|
|
55
|
+
* write path in AbstractRepository.
|
|
56
|
+
*
|
|
57
|
+
* Returns true when this call won the transition, false otherwise.
|
|
58
|
+
*/
|
|
59
|
+
async resolveStatus(params) {
|
|
60
|
+
const query = this.neo4j.initQuery({ serialiser: assistant_action_1.AssistantActionDescriptor.model });
|
|
61
|
+
query.queryParams = { ...query.queryParams, searchValue: params.id, from: params.from, to: params.to };
|
|
62
|
+
query.query += `
|
|
63
|
+
${this.buildDefaultMatch({ searchField: "id" })}
|
|
64
|
+
${this.securityService.userHasAccess({ validator: () => this.buildUserHasAccess() })}
|
|
65
|
+
SET ${assistant_action_meta_1.assistantActionMeta.nodeName}.updatedAt = ${assistant_action_meta_1.assistantActionMeta.nodeName}.updatedAt
|
|
66
|
+
WITH ${assistant_action_meta_1.assistantActionMeta.nodeName}
|
|
67
|
+
WHERE ${assistant_action_meta_1.assistantActionMeta.nodeName}.status = $from AND ${assistant_action_meta_1.assistantActionMeta.nodeName}.expiresAt > datetime()
|
|
68
|
+
SET ${assistant_action_meta_1.assistantActionMeta.nodeName}.status = $to,
|
|
69
|
+
${assistant_action_meta_1.assistantActionMeta.nodeName}.resolvedAt = datetime(),
|
|
70
|
+
${assistant_action_meta_1.assistantActionMeta.nodeName}.updatedAt = datetime()
|
|
71
|
+
WITH ${assistant_action_meta_1.assistantActionMeta.nodeName}
|
|
72
|
+
${this.buildReturnStatement()}
|
|
73
|
+
`;
|
|
74
|
+
// writeOne (not readOne): the query contains SET, which Neo4j rejects
|
|
75
|
+
// inside a read transaction. writeOne shares QueryType and returns the
|
|
76
|
+
// serialised entity (or null when the guard did not match).
|
|
77
|
+
const updated = await this.neo4j.writeOne(query);
|
|
78
|
+
return !!updated;
|
|
79
|
+
}
|
|
80
|
+
/**
|
|
81
|
+
* Cross-company sweep used by AssistantActionExpiryCron (runs outside any
|
|
82
|
+
* request, so there is no CLS company context). Mirrors
|
|
83
|
+
* CommunityRepository.findAllStaleCommunities(): the read returns
|
|
84
|
+
* id + companyId pairs so that every subsequent write stays company-scoped.
|
|
85
|
+
*/
|
|
86
|
+
async findAllOverduePendingActions() {
|
|
87
|
+
const query = this.neo4j.initQuery();
|
|
88
|
+
query.queryParams = { ...query.queryParams, pendingStatus: "pending" };
|
|
89
|
+
query.query += `
|
|
90
|
+
MATCH (${assistant_action_meta_1.assistantActionMeta.nodeName}:${assistant_action_meta_1.assistantActionMeta.labelName} {status: $pendingStatus})-[:BELONGS_TO]->(company:Company)
|
|
91
|
+
WHERE ${assistant_action_meta_1.assistantActionMeta.nodeName}.expiresAt < datetime()
|
|
92
|
+
RETURN ${assistant_action_meta_1.assistantActionMeta.nodeName}.id AS assistantActionId, company.id AS companyId
|
|
93
|
+
ORDER BY ${assistant_action_meta_1.assistantActionMeta.nodeName}.expiresAt ASC
|
|
94
|
+
`;
|
|
95
|
+
const result = await this.neo4j.read(query.query, query.queryParams);
|
|
96
|
+
return result.records.map((record) => ({
|
|
97
|
+
assistantActionId: record.get("assistantActionId"),
|
|
98
|
+
companyId: record.get("companyId"),
|
|
99
|
+
}));
|
|
100
|
+
}
|
|
101
|
+
/**
|
|
102
|
+
* Company-scoped expiry write for a single overdue pending action, called by
|
|
103
|
+
* AssistantActionExpiryCron with the companyId resolved by the sweep above.
|
|
104
|
+
* Guarded on status AND expiresAt so a concurrent approval/denial between
|
|
105
|
+
* the sweep read and this write is never overwritten.
|
|
106
|
+
*/
|
|
107
|
+
async expireAction(params) {
|
|
108
|
+
const query = this.neo4j.initQuery();
|
|
109
|
+
query.queryParams = {
|
|
110
|
+
...query.queryParams,
|
|
111
|
+
assistantActionId: params.assistantActionId,
|
|
112
|
+
companyId: params.companyId,
|
|
113
|
+
pendingStatus: "pending",
|
|
114
|
+
expiredStatus: "expired",
|
|
115
|
+
};
|
|
116
|
+
query.query += `
|
|
117
|
+
MATCH (${assistant_action_meta_1.assistantActionMeta.nodeName}:${assistant_action_meta_1.assistantActionMeta.labelName} {id: $assistantActionId})-[:BELONGS_TO]->(company:Company {id: $companyId})
|
|
118
|
+
WHERE ${assistant_action_meta_1.assistantActionMeta.nodeName}.status = $pendingStatus AND ${assistant_action_meta_1.assistantActionMeta.nodeName}.expiresAt < datetime()
|
|
119
|
+
SET ${assistant_action_meta_1.assistantActionMeta.nodeName}.status = $expiredStatus,
|
|
120
|
+
${assistant_action_meta_1.assistantActionMeta.nodeName}.resolvedAt = datetime(),
|
|
121
|
+
${assistant_action_meta_1.assistantActionMeta.nodeName}.updatedAt = datetime()
|
|
122
|
+
`;
|
|
123
|
+
await this.neo4j.writeOne(query);
|
|
124
|
+
}
|
|
125
|
+
};
|
|
126
|
+
exports.AssistantActionRepository = AssistantActionRepository;
|
|
127
|
+
exports.AssistantActionRepository = AssistantActionRepository = __decorate([
|
|
128
|
+
(0, common_1.Injectable)(),
|
|
129
|
+
__metadata("design:paramtypes", [neo4j_service_1.Neo4jService, security_service_1.SecurityService, nestjs_cls_1.ClsService])
|
|
130
|
+
], AssistantActionRepository);
|
|
131
|
+
//# sourceMappingURL=assistant-action.repository.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"assistant-action.repository.js","sourceRoot":"","sources":["../../../../src/foundations/assistant-action/repositories/assistant-action.repository.ts"],"names":[],"mappings":"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"}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { ClsService } from "nestjs-cls";
|
|
2
|
+
import { JsonApiService } from "../../../core/jsonapi/services/jsonapi.service";
|
|
3
|
+
import { AbstractService } from "../../../core/neo4j/abstracts/abstract.service";
|
|
4
|
+
import { AssistantAction, AssistantActionDescriptor } from "../entities/assistant-action";
|
|
5
|
+
import { AssistantActionRepository } from "../repositories/assistant-action.repository";
|
|
6
|
+
export declare class AssistantActionService extends AbstractService<AssistantAction, typeof AssistantActionDescriptor.relationships> {
|
|
7
|
+
private readonly assistantActionRepository;
|
|
8
|
+
protected readonly descriptor: import("../../..").EntityDescriptor<AssistantAction, {
|
|
9
|
+
assistant: {
|
|
10
|
+
model: import("../../..").DataMeta;
|
|
11
|
+
direction: "in";
|
|
12
|
+
relationship: string;
|
|
13
|
+
cardinality: "one";
|
|
14
|
+
required: true;
|
|
15
|
+
dtoKey: string;
|
|
16
|
+
immutable: true;
|
|
17
|
+
};
|
|
18
|
+
message: {
|
|
19
|
+
model: import("../../..").DataMeta;
|
|
20
|
+
direction: "in";
|
|
21
|
+
relationship: string;
|
|
22
|
+
cardinality: "one";
|
|
23
|
+
required: false;
|
|
24
|
+
dtoKey: string;
|
|
25
|
+
immutable: true;
|
|
26
|
+
};
|
|
27
|
+
}>;
|
|
28
|
+
constructor(jsonApiService: JsonApiService, assistantActionRepository: AssistantActionRepository, clsService: ClsService);
|
|
29
|
+
/**
|
|
30
|
+
* Internal creation of a pending action (used by the operator turn flow when
|
|
31
|
+
* a run interrupts on a destructive tool call). Goes through `createFromDTO`
|
|
32
|
+
* — the framework path — so `expiresAt` (ISO string) is auto-cast to a Neo4j
|
|
33
|
+
* datetime by the descriptor.
|
|
34
|
+
*/
|
|
35
|
+
createPendingAction(params: {
|
|
36
|
+
id?: string;
|
|
37
|
+
toolName: string;
|
|
38
|
+
toolArgs: string;
|
|
39
|
+
summary: string;
|
|
40
|
+
threadId: string;
|
|
41
|
+
userModuleIds: string;
|
|
42
|
+
contentScope?: string;
|
|
43
|
+
expiresAt: string;
|
|
44
|
+
assistantId: string;
|
|
45
|
+
messageId?: string;
|
|
46
|
+
}): Promise<AssistantAction>;
|
|
47
|
+
}
|
|
48
|
+
//# sourceMappingURL=assistant-action.service.d.ts.map
|