@backendkit-labs/agent-coding 0.28.4 → 0.29.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/README.md +2 -2
- package/dist/__tests__/context-hooks.test.d.ts +2 -0
- package/dist/__tests__/context-hooks.test.d.ts.map +1 -0
- package/dist/__tests__/context-hooks.test.js +21 -0
- package/dist/__tests__/context-hooks.test.js.map +1 -0
- package/dist/__tests__/sandbox.test.js +1 -1
- package/dist/__tests__/sandbox.test.js.map +1 -1
- package/dist/context-hooks.d.ts +11 -0
- package/dist/context-hooks.d.ts.map +1 -0
- package/dist/context-hooks.js +23 -0
- package/dist/context-hooks.js.map +1 -0
- package/dist/context-services.d.ts +12 -0
- package/dist/context-services.d.ts.map +1 -0
- package/dist/context-services.js +20 -0
- package/dist/context-services.js.map +1 -0
- package/dist/index.d.ts +5 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +21 -8
- package/dist/index.js.map +1 -1
- package/dist/orchestration/capability-matrix.d.ts +1 -1
- package/dist/orchestration/capability-matrix.d.ts.map +1 -1
- package/dist/pipeline/__tests__/AgentEngine.orchestratorFailure.test.d.ts +2 -0
- package/dist/pipeline/__tests__/AgentEngine.orchestratorFailure.test.d.ts.map +1 -0
- package/dist/pipeline/__tests__/AgentEngine.orchestratorFailure.test.js +42 -0
- package/dist/pipeline/__tests__/AgentEngine.orchestratorFailure.test.js.map +1 -0
- package/dist/pipeline/__tests__/coding-pipeline-hooks.test.d.ts +2 -0
- package/dist/pipeline/__tests__/coding-pipeline-hooks.test.d.ts.map +1 -0
- package/dist/pipeline/__tests__/coding-pipeline-hooks.test.js +64 -0
- package/dist/pipeline/__tests__/coding-pipeline-hooks.test.js.map +1 -0
- package/dist/pipeline/__tests__/engine-brief.test.d.ts +2 -0
- package/dist/pipeline/__tests__/engine-brief.test.d.ts.map +1 -0
- package/dist/pipeline/__tests__/engine-brief.test.js +159 -0
- package/dist/pipeline/__tests__/engine-brief.test.js.map +1 -0
- package/dist/pipeline/__tests__/qa-orchestrator.test.d.ts +2 -0
- package/dist/pipeline/__tests__/qa-orchestrator.test.d.ts.map +1 -0
- package/dist/pipeline/__tests__/qa-orchestrator.test.js +276 -0
- package/dist/pipeline/__tests__/qa-orchestrator.test.js.map +1 -0
- package/dist/pipeline/coding-pipeline-hooks.d.ts +28 -0
- package/dist/pipeline/coding-pipeline-hooks.d.ts.map +1 -0
- package/dist/pipeline/coding-pipeline-hooks.js +91 -0
- package/dist/pipeline/coding-pipeline-hooks.js.map +1 -0
- package/dist/pipeline/index.d.ts +13 -0
- package/dist/pipeline/index.d.ts.map +1 -0
- package/dist/pipeline/index.js +44 -0
- package/dist/pipeline/index.js.map +1 -0
- package/dist/pipeline/orchestration/__tests__/agent-id-consistency.test.d.ts +11 -0
- package/dist/pipeline/orchestration/__tests__/agent-id-consistency.test.d.ts.map +1 -0
- package/dist/pipeline/orchestration/__tests__/agent-id-consistency.test.js +105 -0
- package/dist/pipeline/orchestration/__tests__/agent-id-consistency.test.js.map +1 -0
- package/dist/pipeline/orchestration/__tests__/fsm-commit-skipped.test.d.ts +2 -0
- package/dist/pipeline/orchestration/__tests__/fsm-commit-skipped.test.d.ts.map +1 -0
- package/dist/pipeline/orchestration/__tests__/fsm-commit-skipped.test.js +21 -0
- package/dist/pipeline/orchestration/__tests__/fsm-commit-skipped.test.js.map +1 -0
- package/dist/pipeline/orchestration/__tests__/fsm-critical-path.test.d.ts +9 -0
- package/dist/pipeline/orchestration/__tests__/fsm-critical-path.test.d.ts.map +1 -0
- package/dist/pipeline/orchestration/__tests__/fsm-critical-path.test.js +101 -0
- package/dist/pipeline/orchestration/__tests__/fsm-critical-path.test.js.map +1 -0
- package/dist/pipeline/orchestration/__tests__/fsm-rework-and-regression.test.d.ts +2 -0
- package/dist/pipeline/orchestration/__tests__/fsm-rework-and-regression.test.d.ts.map +1 -0
- package/dist/pipeline/orchestration/__tests__/fsm-rework-and-regression.test.js +54 -0
- package/dist/pipeline/orchestration/__tests__/fsm-rework-and-regression.test.js.map +1 -0
- package/dist/pipeline/orchestration/__tests__/intent-detector-llm.test.d.ts +2 -0
- package/dist/pipeline/orchestration/__tests__/intent-detector-llm.test.d.ts.map +1 -0
- package/dist/pipeline/orchestration/__tests__/intent-detector-llm.test.js +57 -0
- package/dist/pipeline/orchestration/__tests__/intent-detector-llm.test.js.map +1 -0
- package/dist/pipeline/orchestration/__tests__/intent-detector-scores.test.d.ts +9 -0
- package/dist/pipeline/orchestration/__tests__/intent-detector-scores.test.d.ts.map +1 -0
- package/dist/pipeline/orchestration/__tests__/intent-detector-scores.test.js +43 -0
- package/dist/pipeline/orchestration/__tests__/intent-detector-scores.test.js.map +1 -0
- package/dist/pipeline/orchestration/__tests__/reflection-cycle.test.d.ts +10 -0
- package/dist/pipeline/orchestration/__tests__/reflection-cycle.test.d.ts.map +1 -0
- package/dist/pipeline/orchestration/__tests__/reflection-cycle.test.js +264 -0
- package/dist/pipeline/orchestration/__tests__/reflection-cycle.test.js.map +1 -0
- package/dist/pipeline/orchestration/audit/audit-ci-blocker.d.ts +31 -0
- package/dist/pipeline/orchestration/audit/audit-ci-blocker.d.ts.map +1 -0
- package/dist/pipeline/orchestration/audit/audit-ci-blocker.js +120 -0
- package/dist/pipeline/orchestration/audit/audit-ci-blocker.js.map +1 -0
- package/dist/pipeline/orchestration/audit/audit-finding-tracer.d.ts +33 -0
- package/dist/pipeline/orchestration/audit/audit-finding-tracer.d.ts.map +1 -0
- package/dist/pipeline/orchestration/audit/audit-finding-tracer.js +126 -0
- package/dist/pipeline/orchestration/audit/audit-finding-tracer.js.map +1 -0
- package/dist/pipeline/orchestration/audit/audit-lessons-learned.d.ts +27 -0
- package/dist/pipeline/orchestration/audit/audit-lessons-learned.d.ts.map +1 -0
- package/dist/pipeline/orchestration/audit/audit-lessons-learned.js +155 -0
- package/dist/pipeline/orchestration/audit/audit-lessons-learned.js.map +1 -0
- package/dist/pipeline/orchestration/audit/audit-pending-issues.d.ts +21 -0
- package/dist/pipeline/orchestration/audit/audit-pending-issues.d.ts.map +1 -0
- package/dist/pipeline/orchestration/audit/audit-pending-issues.js +110 -0
- package/dist/pipeline/orchestration/audit/audit-pending-issues.js.map +1 -0
- package/dist/pipeline/orchestration/audit/audit-reflection-bridge.d.ts +39 -0
- package/dist/pipeline/orchestration/audit/audit-reflection-bridge.d.ts.map +1 -0
- package/dist/pipeline/orchestration/audit/audit-reflection-bridge.js +65 -0
- package/dist/pipeline/orchestration/audit/audit-reflection-bridge.js.map +1 -0
- package/dist/pipeline/orchestration/audit/audit-report-renderer.d.ts +30 -0
- package/dist/pipeline/orchestration/audit/audit-report-renderer.d.ts.map +1 -0
- package/dist/pipeline/orchestration/audit/audit-report-renderer.js +249 -0
- package/dist/pipeline/orchestration/audit/audit-report-renderer.js.map +1 -0
- package/dist/pipeline/orchestration/audit/audit-report-version-manager.d.ts +52 -0
- package/dist/pipeline/orchestration/audit/audit-report-version-manager.d.ts.map +1 -0
- package/dist/pipeline/orchestration/audit/audit-report-version-manager.js +144 -0
- package/dist/pipeline/orchestration/audit/audit-report-version-manager.js.map +1 -0
- package/dist/pipeline/orchestration/audit/audit-silent-gates-buffer.d.ts +37 -0
- package/dist/pipeline/orchestration/audit/audit-silent-gates-buffer.d.ts.map +1 -0
- package/dist/pipeline/orchestration/audit/audit-silent-gates-buffer.js +129 -0
- package/dist/pipeline/orchestration/audit/audit-silent-gates-buffer.js.map +1 -0
- package/dist/pipeline/orchestration/audit/index.d.ts +17 -0
- package/dist/pipeline/orchestration/audit/index.d.ts.map +1 -0
- package/dist/pipeline/orchestration/audit/index.js +26 -0
- package/dist/pipeline/orchestration/audit/index.js.map +1 -0
- package/dist/pipeline/orchestration/audit/types.d.ts +79 -0
- package/dist/pipeline/orchestration/audit/types.d.ts.map +1 -0
- package/dist/pipeline/orchestration/audit/types.js +10 -0
- package/dist/pipeline/orchestration/audit/types.js.map +1 -0
- package/dist/pipeline/orchestration/audit-reporter.d.ts +133 -0
- package/dist/pipeline/orchestration/audit-reporter.d.ts.map +1 -0
- package/dist/pipeline/orchestration/audit-reporter.js +322 -0
- package/dist/pipeline/orchestration/audit-reporter.js.map +1 -0
- package/dist/pipeline/orchestration/config-loader.d.ts +51 -0
- package/dist/pipeline/orchestration/config-loader.d.ts.map +1 -0
- package/dist/pipeline/orchestration/config-loader.js +215 -0
- package/dist/pipeline/orchestration/config-loader.js.map +1 -0
- package/dist/pipeline/orchestration/domain-detector.d.ts +36 -0
- package/dist/pipeline/orchestration/domain-detector.d.ts.map +1 -0
- package/dist/pipeline/orchestration/domain-detector.js +157 -0
- package/dist/pipeline/orchestration/domain-detector.js.map +1 -0
- package/dist/pipeline/orchestration/fsm.d.ts +92 -0
- package/dist/pipeline/orchestration/fsm.d.ts.map +1 -0
- package/dist/pipeline/orchestration/fsm.js +243 -0
- package/dist/pipeline/orchestration/fsm.js.map +1 -0
- package/dist/pipeline/orchestration/gate-resolver.d.ts +52 -0
- package/dist/pipeline/orchestration/gate-resolver.d.ts.map +1 -0
- package/dist/pipeline/orchestration/gate-resolver.js +120 -0
- package/dist/pipeline/orchestration/gate-resolver.js.map +1 -0
- package/dist/pipeline/orchestration/index.d.ts +16 -0
- package/dist/pipeline/orchestration/index.d.ts.map +1 -0
- package/dist/pipeline/orchestration/index.js +32 -0
- package/dist/pipeline/orchestration/index.js.map +1 -0
- package/dist/pipeline/orchestration/intent-detector.d.ts +37 -0
- package/dist/pipeline/orchestration/intent-detector.d.ts.map +1 -0
- package/dist/pipeline/orchestration/intent-detector.js +248 -0
- package/dist/pipeline/orchestration/intent-detector.js.map +1 -0
- package/dist/pipeline/orchestration/keyword-match.d.ts +17 -0
- package/dist/pipeline/orchestration/keyword-match.d.ts.map +1 -0
- package/dist/pipeline/orchestration/keyword-match.js +26 -0
- package/dist/pipeline/orchestration/keyword-match.js.map +1 -0
- package/dist/pipeline/orchestration/orchestrator.d.ts +158 -0
- package/dist/pipeline/orchestration/orchestrator.d.ts.map +1 -0
- package/dist/pipeline/orchestration/orchestrator.js +414 -0
- package/dist/pipeline/orchestration/orchestrator.js.map +1 -0
- package/dist/pipeline/orchestration/policy-engine.d.ts +54 -0
- package/dist/pipeline/orchestration/policy-engine.d.ts.map +1 -0
- package/dist/pipeline/orchestration/policy-engine.js +278 -0
- package/dist/pipeline/orchestration/policy-engine.js.map +1 -0
- package/dist/pipeline/orchestration/risk-scorer.d.ts +38 -0
- package/dist/pipeline/orchestration/risk-scorer.d.ts.map +1 -0
- package/dist/pipeline/orchestration/risk-scorer.js +145 -0
- package/dist/pipeline/orchestration/risk-scorer.js.map +1 -0
- package/dist/pipeline/orchestration/task-context.d.ts +205 -0
- package/dist/pipeline/orchestration/task-context.d.ts.map +1 -0
- package/dist/pipeline/orchestration/task-context.js +162 -0
- package/dist/pipeline/orchestration/task-context.js.map +1 -0
- package/dist/pipeline/orchestration/types.d.ts +111 -0
- package/dist/pipeline/orchestration/types.d.ts.map +1 -0
- package/dist/pipeline/orchestration/types.js +37 -0
- package/dist/pipeline/orchestration/types.js.map +1 -0
- package/dist/pipeline/qa/__tests__/QAService.test.d.ts +2 -0
- package/dist/pipeline/qa/__tests__/QAService.test.d.ts.map +1 -0
- package/dist/pipeline/qa/__tests__/QAService.test.js +170 -0
- package/dist/pipeline/qa/__tests__/QAService.test.js.map +1 -0
- package/dist/pipeline/qa/__tests__/QAService.verdict.test.d.ts +2 -0
- package/dist/pipeline/qa/__tests__/QAService.verdict.test.d.ts.map +1 -0
- package/dist/pipeline/qa/__tests__/QAService.verdict.test.js +39 -0
- package/dist/pipeline/qa/__tests__/QAService.verdict.test.js.map +1 -0
- package/dist/pipeline/qa/index.d.ts +3 -0
- package/dist/pipeline/qa/index.d.ts.map +1 -0
- package/dist/pipeline/qa/index.js +6 -0
- package/dist/pipeline/qa/index.js.map +1 -0
- package/dist/pipeline/qa/qa-service.d.ts +33 -0
- package/dist/pipeline/qa/qa-service.d.ts.map +1 -0
- package/dist/pipeline/qa/qa-service.js +239 -0
- package/dist/pipeline/qa/qa-service.js.map +1 -0
- package/dist/pipeline/qa-orchestrator.d.ts +60 -0
- package/dist/pipeline/qa-orchestrator.d.ts.map +1 -0
- package/dist/pipeline/qa-orchestrator.js +177 -0
- package/dist/pipeline/qa-orchestrator.js.map +1 -0
- package/dist/pipeline/reflection/domains/agent-domain.d.ts +40 -0
- package/dist/pipeline/reflection/domains/agent-domain.d.ts.map +1 -0
- package/dist/pipeline/reflection/domains/agent-domain.js +161 -0
- package/dist/pipeline/reflection/domains/agent-domain.js.map +1 -0
- package/dist/pipeline/reflection/domains/audit-domain.d.ts +46 -0
- package/dist/pipeline/reflection/domains/audit-domain.d.ts.map +1 -0
- package/dist/pipeline/reflection/domains/audit-domain.js +241 -0
- package/dist/pipeline/reflection/domains/audit-domain.js.map +1 -0
- package/dist/pipeline/reflection/domains/bootstrap-domain.d.ts +40 -0
- package/dist/pipeline/reflection/domains/bootstrap-domain.d.ts.map +1 -0
- package/dist/pipeline/reflection/domains/bootstrap-domain.js +156 -0
- package/dist/pipeline/reflection/domains/bootstrap-domain.js.map +1 -0
- package/dist/pipeline/reflection/domains/commit-domain.d.ts +40 -0
- package/dist/pipeline/reflection/domains/commit-domain.d.ts.map +1 -0
- package/dist/pipeline/reflection/domains/commit-domain.js +174 -0
- package/dist/pipeline/reflection/domains/commit-domain.js.map +1 -0
- package/dist/pipeline/reflection/domains/test-domain.d.ts +40 -0
- package/dist/pipeline/reflection/domains/test-domain.d.ts.map +1 -0
- package/dist/pipeline/reflection/domains/test-domain.js +194 -0
- package/dist/pipeline/reflection/domains/test-domain.js.map +1 -0
- package/dist/pipeline/reflection/historical-loader.d.ts +105 -0
- package/dist/pipeline/reflection/historical-loader.d.ts.map +1 -0
- package/dist/pipeline/reflection/historical-loader.js +462 -0
- package/dist/pipeline/reflection/historical-loader.js.map +1 -0
- package/dist/pipeline/reflection/hooks/agent-hook.d.ts +72 -0
- package/dist/pipeline/reflection/hooks/agent-hook.d.ts.map +1 -0
- package/dist/pipeline/reflection/hooks/agent-hook.js +98 -0
- package/dist/pipeline/reflection/hooks/agent-hook.js.map +1 -0
- package/dist/pipeline/reflection/hooks/audit-hook.d.ts +72 -0
- package/dist/pipeline/reflection/hooks/audit-hook.d.ts.map +1 -0
- package/dist/pipeline/reflection/hooks/audit-hook.js +112 -0
- package/dist/pipeline/reflection/hooks/audit-hook.js.map +1 -0
- package/dist/pipeline/reflection/hooks/bootstrap-hook.d.ts +71 -0
- package/dist/pipeline/reflection/hooks/bootstrap-hook.d.ts.map +1 -0
- package/dist/pipeline/reflection/hooks/bootstrap-hook.js +97 -0
- package/dist/pipeline/reflection/hooks/bootstrap-hook.js.map +1 -0
- package/dist/pipeline/reflection/hooks/commit-hook.d.ts +63 -0
- package/dist/pipeline/reflection/hooks/commit-hook.d.ts.map +1 -0
- package/dist/pipeline/reflection/hooks/commit-hook.js +90 -0
- package/dist/pipeline/reflection/hooks/commit-hook.js.map +1 -0
- package/dist/pipeline/reflection/hooks/test-hook.d.ts +65 -0
- package/dist/pipeline/reflection/hooks/test-hook.d.ts.map +1 -0
- package/dist/pipeline/reflection/hooks/test-hook.js +99 -0
- package/dist/pipeline/reflection/hooks/test-hook.js.map +1 -0
- package/dist/pipeline/reflection/lessons-memo-generator.d.ts +60 -0
- package/dist/pipeline/reflection/lessons-memo-generator.d.ts.map +1 -0
- package/dist/pipeline/reflection/lessons-memo-generator.js +286 -0
- package/dist/pipeline/reflection/lessons-memo-generator.js.map +1 -0
- package/dist/store/ProjectStore.d.ts +1 -1
- package/dist/store/ProjectStore.d.ts.map +1 -1
- package/dist/store/types.d.ts +28 -0
- package/dist/store/types.d.ts.map +1 -0
- package/dist/store/types.js +3 -0
- package/dist/store/types.js.map +1 -0
- package/dist/tools/__tests__/command-parser.test.js +1 -1
- package/dist/tools/__tests__/command-parser.test.js.map +1 -1
- package/dist/tools/__tests__/declared-facts.test.d.ts +2 -0
- package/dist/tools/__tests__/declared-facts.test.d.ts.map +1 -0
- package/dist/tools/__tests__/declared-facts.test.js +21 -0
- package/dist/tools/__tests__/declared-facts.test.js.map +1 -0
- package/dist/tools/__tests__/package-install.test.d.ts +2 -0
- package/dist/tools/__tests__/package-install.test.d.ts.map +1 -0
- package/dist/tools/__tests__/package-install.test.js +56 -0
- package/dist/tools/__tests__/package-install.test.js.map +1 -0
- package/dist/tools/__tests__/save-tools.secrets.test.js +1 -1
- package/dist/tools/__tests__/save-tools.secrets.test.js.map +1 -1
- package/dist/tools/edit-file.d.ts.map +1 -1
- package/dist/tools/edit-file.js +1 -0
- package/dist/tools/edit-file.js.map +1 -1
- package/dist/tools/list-directory.d.ts.map +1 -1
- package/dist/tools/list-directory.js +1 -0
- package/dist/tools/list-directory.js.map +1 -1
- package/dist/tools/package-install.d.ts +11 -0
- package/dist/tools/package-install.d.ts.map +1 -0
- package/dist/tools/package-install.js +112 -0
- package/dist/tools/package-install.js.map +1 -0
- package/dist/tools/read-file.d.ts.map +1 -1
- package/dist/tools/read-file.js +1 -0
- package/dist/tools/read-file.js.map +1 -1
- package/dist/tools/run-command.d.ts.map +1 -1
- package/dist/tools/run-command.js +5 -1
- package/dist/tools/run-command.js.map +1 -1
- package/dist/tools/save-audit.d.ts.map +1 -1
- package/dist/tools/save-audit.js +7 -6
- package/dist/tools/save-audit.js.map +1 -1
- package/dist/tools/save-context.d.ts.map +1 -1
- package/dist/tools/save-context.js +3 -2
- package/dist/tools/save-context.js.map +1 -1
- package/dist/tools/save-learning.d.ts.map +1 -1
- package/dist/tools/save-learning.js +4 -3
- package/dist/tools/save-learning.js.map +1 -1
- package/dist/tools/save-user-preference.d.ts.map +1 -1
- package/dist/tools/save-user-preference.js +3 -2
- package/dist/tools/save-user-preference.js.map +1 -1
- package/dist/tools/search-files.d.ts.map +1 -1
- package/dist/tools/search-files.js +1 -0
- package/dist/tools/search-files.js.map +1 -1
- package/dist/tools/update-session.d.ts.map +1 -1
- package/dist/tools/update-session.js +3 -2
- package/dist/tools/update-session.js.map +1 -1
- package/dist/tools/write-file.d.ts.map +1 -1
- package/dist/tools/write-file.js +1 -0
- package/dist/tools/write-file.js.map +1 -1
- package/package.json +63 -44
|
@@ -0,0 +1,414 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* @description Orquestador principal — Pipeline completo de clasificación.
|
|
4
|
+
*
|
|
5
|
+
* Integra: Intent Detection → Domain Detection → Risk Scoring → Policy Engine
|
|
6
|
+
*
|
|
7
|
+
* Cada etapa enriquece el TaskContext progresivamente.
|
|
8
|
+
* El resultado final contiene los agentes seleccionados, políticas aplicadas
|
|
9
|
+
* y gates requeridos para proceder.
|
|
10
|
+
*
|
|
11
|
+
* @example
|
|
12
|
+
* ```ts
|
|
13
|
+
* const orchestrator = new Orchestrator(client, config);
|
|
14
|
+
* const result = await orchestrator.orchestrate('Agregar circuit breaker para ServiceNow');
|
|
15
|
+
* // result.task.actionType === 'implementation'
|
|
16
|
+
* // result.task.domains === ['resilience', 'backend']
|
|
17
|
+
* // result.task.riskLevel === 'high'
|
|
18
|
+
* // result.selectedAgents === ['architecture', 'backend-agent', 'qa-engineer']
|
|
19
|
+
* ```
|
|
20
|
+
*/
|
|
21
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
22
|
+
if (k2 === undefined) k2 = k;
|
|
23
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
24
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
25
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
26
|
+
}
|
|
27
|
+
Object.defineProperty(o, k2, desc);
|
|
28
|
+
}) : (function(o, m, k, k2) {
|
|
29
|
+
if (k2 === undefined) k2 = k;
|
|
30
|
+
o[k2] = m[k];
|
|
31
|
+
}));
|
|
32
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
33
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
34
|
+
}) : function(o, v) {
|
|
35
|
+
o["default"] = v;
|
|
36
|
+
});
|
|
37
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
38
|
+
var ownKeys = function(o) {
|
|
39
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
40
|
+
var ar = [];
|
|
41
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
42
|
+
return ar;
|
|
43
|
+
};
|
|
44
|
+
return ownKeys(o);
|
|
45
|
+
};
|
|
46
|
+
return function (mod) {
|
|
47
|
+
if (mod && mod.__esModule) return mod;
|
|
48
|
+
var result = {};
|
|
49
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
50
|
+
__setModuleDefault(result, mod);
|
|
51
|
+
return result;
|
|
52
|
+
};
|
|
53
|
+
})();
|
|
54
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
55
|
+
exports.Orchestrator = exports.AuditReporter = exports.createTaskContext = exports.TaskFSM = exports.applyPolicies = exports.evaluatePolicies = exports.enrichTaskWithRisk = exports.calculateRisk = exports.enrichTaskWithDomains = exports.detectDomains = exports.enrichTaskWithIntent = exports.detectIntent = exports.defaultOrchestratorConfig = void 0;
|
|
56
|
+
const fs = __importStar(require("fs"));
|
|
57
|
+
const os = __importStar(require("os"));
|
|
58
|
+
const path = __importStar(require("path"));
|
|
59
|
+
const crypto_1 = require("crypto");
|
|
60
|
+
const yaml = __importStar(require("yaml"));
|
|
61
|
+
const pipeline_1 = require("@backendkit-labs/pipeline");
|
|
62
|
+
const task_context_1 = require("./task-context");
|
|
63
|
+
const intent_detector_1 = require("./intent-detector");
|
|
64
|
+
const domain_detector_1 = require("./domain-detector");
|
|
65
|
+
const risk_scorer_1 = require("./risk-scorer");
|
|
66
|
+
const policy_engine_1 = require("./policy-engine");
|
|
67
|
+
const gate_resolver_1 = require("./gate-resolver");
|
|
68
|
+
const fsm_1 = require("./fsm");
|
|
69
|
+
const types_1 = require("./types");
|
|
70
|
+
const audit_reporter_1 = require("./audit-reporter");
|
|
71
|
+
const EMPTY_POLICY_RESULT = {
|
|
72
|
+
mustInclude: [],
|
|
73
|
+
requiredGates: [],
|
|
74
|
+
mustExecute: [],
|
|
75
|
+
customGates: [],
|
|
76
|
+
appliedRules: [],
|
|
77
|
+
};
|
|
78
|
+
// ── Enrichment steps ──────────────────────────────────────────────────────────
|
|
79
|
+
class IntentStep {
|
|
80
|
+
client;
|
|
81
|
+
stepName = 'intent-detection';
|
|
82
|
+
constructor(client) {
|
|
83
|
+
this.client = client;
|
|
84
|
+
}
|
|
85
|
+
async handle(ctx) {
|
|
86
|
+
try {
|
|
87
|
+
return (0, pipeline_1.Ok)({ ...ctx, task: await (0, intent_detector_1.enrichTaskWithIntent)(ctx.task, this.client) });
|
|
88
|
+
}
|
|
89
|
+
catch (e) {
|
|
90
|
+
return (0, pipeline_1.Err)(e instanceof Error ? e : new Error(String(e)));
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
class DomainStep {
|
|
95
|
+
stepName = 'domain-detection';
|
|
96
|
+
async handle(ctx) {
|
|
97
|
+
return (0, pipeline_1.Ok)({ ...ctx, task: (0, domain_detector_1.enrichTaskWithDomains)(ctx.task) });
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
class RiskStep {
|
|
101
|
+
config;
|
|
102
|
+
stepName = 'risk-scoring';
|
|
103
|
+
constructor(config) {
|
|
104
|
+
this.config = config;
|
|
105
|
+
}
|
|
106
|
+
async handle(ctx) {
|
|
107
|
+
return (0, pipeline_1.Ok)({ ...ctx, task: (0, risk_scorer_1.enrichTaskWithRisk)(ctx.task, this.config) });
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
class PolicyStep {
|
|
111
|
+
customRules;
|
|
112
|
+
loadManifest;
|
|
113
|
+
input;
|
|
114
|
+
includeDefaultRules;
|
|
115
|
+
stepName = 'policy-engine';
|
|
116
|
+
constructor(customRules, loadManifest, input, includeDefaultRules) {
|
|
117
|
+
this.customRules = customRules;
|
|
118
|
+
this.loadManifest = loadManifest;
|
|
119
|
+
this.input = input;
|
|
120
|
+
this.includeDefaultRules = includeDefaultRules;
|
|
121
|
+
}
|
|
122
|
+
async handle(ctx) {
|
|
123
|
+
try {
|
|
124
|
+
const manifestRules = await this.loadManifest();
|
|
125
|
+
const mergedRules = [...(this.customRules ?? []), ...manifestRules];
|
|
126
|
+
const result = (0, policy_engine_1.applyPolicies)(ctx.task, mergedRules.length > 0 ? mergedRules : undefined, this.input, this.includeDefaultRules);
|
|
127
|
+
return (0, pipeline_1.Ok)({ task: result.task, policyResult: result.result });
|
|
128
|
+
}
|
|
129
|
+
catch (e) {
|
|
130
|
+
return (0, pipeline_1.Err)(e instanceof Error ? e : new Error(String(e)));
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
const DEFAULT_REVIEW_AGENTS = {
|
|
135
|
+
security: 'security',
|
|
136
|
+
architecture: 'architecture',
|
|
137
|
+
qa: 'qa-engineer',
|
|
138
|
+
};
|
|
139
|
+
var types_2 = require("./types");
|
|
140
|
+
Object.defineProperty(exports, "defaultOrchestratorConfig", { enumerable: true, get: function () { return types_2.defaultOrchestratorConfig; } });
|
|
141
|
+
var intent_detector_2 = require("./intent-detector");
|
|
142
|
+
Object.defineProperty(exports, "detectIntent", { enumerable: true, get: function () { return intent_detector_2.detectIntent; } });
|
|
143
|
+
Object.defineProperty(exports, "enrichTaskWithIntent", { enumerable: true, get: function () { return intent_detector_2.enrichTaskWithIntent; } });
|
|
144
|
+
var domain_detector_2 = require("./domain-detector");
|
|
145
|
+
Object.defineProperty(exports, "detectDomains", { enumerable: true, get: function () { return domain_detector_2.detectDomains; } });
|
|
146
|
+
Object.defineProperty(exports, "enrichTaskWithDomains", { enumerable: true, get: function () { return domain_detector_2.enrichTaskWithDomains; } });
|
|
147
|
+
var risk_scorer_2 = require("./risk-scorer");
|
|
148
|
+
Object.defineProperty(exports, "calculateRisk", { enumerable: true, get: function () { return risk_scorer_2.calculateRisk; } });
|
|
149
|
+
Object.defineProperty(exports, "enrichTaskWithRisk", { enumerable: true, get: function () { return risk_scorer_2.enrichTaskWithRisk; } });
|
|
150
|
+
var policy_engine_2 = require("./policy-engine");
|
|
151
|
+
Object.defineProperty(exports, "evaluatePolicies", { enumerable: true, get: function () { return policy_engine_2.evaluatePolicies; } });
|
|
152
|
+
Object.defineProperty(exports, "applyPolicies", { enumerable: true, get: function () { return policy_engine_2.applyPolicies; } });
|
|
153
|
+
var fsm_2 = require("./fsm");
|
|
154
|
+
Object.defineProperty(exports, "TaskFSM", { enumerable: true, get: function () { return fsm_2.TaskFSM; } });
|
|
155
|
+
var task_context_2 = require("./task-context");
|
|
156
|
+
Object.defineProperty(exports, "createTaskContext", { enumerable: true, get: function () { return task_context_2.createTaskContext; } });
|
|
157
|
+
var audit_reporter_2 = require("./audit-reporter");
|
|
158
|
+
Object.defineProperty(exports, "AuditReporter", { enumerable: true, get: function () { return audit_reporter_2.AuditReporter; } });
|
|
159
|
+
/**
|
|
160
|
+
* @description Orquestador central del sistema multi-agente.
|
|
161
|
+
*
|
|
162
|
+
* Procesa el input del usuario a través de un pipeline de 4 etapas:
|
|
163
|
+
* 1. Intent Detection — clasifica la acción (design, implement, etc.)
|
|
164
|
+
* 2. Domain Detection — identifica bounded contexts
|
|
165
|
+
* 3. Risk Scoring — calcula nivel de riesgo técnico
|
|
166
|
+
* 4. Policy Engine — aplica reglas y determina agentes/gates
|
|
167
|
+
*
|
|
168
|
+
* El resultado es un OrchestrationResult que el AgentLoop puede usar
|
|
169
|
+
* para seleccionar agentes, aplicar gates y controlar el flujo.
|
|
170
|
+
*
|
|
171
|
+
* **Auditoría integrada:**
|
|
172
|
+
* Cada vez que `orchestrate()` se ejecuta, el AuditReporter registra
|
|
173
|
+
* automáticamente un gate de orquestación con los hallazgos detectados.
|
|
174
|
+
*
|
|
175
|
+
* Los gates de QA, security y architecture se registran desde el AgentLoop
|
|
176
|
+
* usando `getAuditReporter()`.
|
|
177
|
+
*/
|
|
178
|
+
class Orchestrator {
|
|
179
|
+
client;
|
|
180
|
+
config;
|
|
181
|
+
customRules;
|
|
182
|
+
capabilityMatrix;
|
|
183
|
+
includeDefaultRules;
|
|
184
|
+
reviewAgents;
|
|
185
|
+
customGateAgents;
|
|
186
|
+
fsm;
|
|
187
|
+
auditReporter;
|
|
188
|
+
appName;
|
|
189
|
+
constructor(options) {
|
|
190
|
+
this.client = options?.client;
|
|
191
|
+
this.config = options?.config ?? (0, types_1.defaultOrchestratorConfig)();
|
|
192
|
+
this.customRules = options?.customRules;
|
|
193
|
+
this.capabilityMatrix = options?.capabilityMatrix;
|
|
194
|
+
this.includeDefaultRules = options?.includeDefaultRules ?? true;
|
|
195
|
+
this.reviewAgents = { ...DEFAULT_REVIEW_AGENTS, ...options?.reviewAgents };
|
|
196
|
+
this.customGateAgents = options?.customGateAgents;
|
|
197
|
+
this.appName = options?.appName ?? 'bk-agent';
|
|
198
|
+
this.fsm = new fsm_1.TaskFSM();
|
|
199
|
+
this.auditReporter = new audit_reporter_1.AuditReporter({
|
|
200
|
+
projectRoot: options?.projectRoot ?? process.cwd(),
|
|
201
|
+
useGlobalDir: true,
|
|
202
|
+
appName: this.appName,
|
|
203
|
+
});
|
|
204
|
+
}
|
|
205
|
+
/**
|
|
206
|
+
* @description Procesa el input del usuario a través del pipeline completo.
|
|
207
|
+
*
|
|
208
|
+
* @param input - Texto del usuario
|
|
209
|
+
* @returns Resultado completo de la orquestación
|
|
210
|
+
*/
|
|
211
|
+
async orchestrate(input) {
|
|
212
|
+
const enrichResult = await (0, pipeline_1.pipeline)()
|
|
213
|
+
.pipeIf(_ => this.config.features.intentDetection, new IntentStep(this.client))
|
|
214
|
+
.pipeIf(_ => this.config.features.domainDetection, new DomainStep())
|
|
215
|
+
.pipeIf(_ => this.config.features.riskScoring, new RiskStep(this.config))
|
|
216
|
+
.pipeIf(_ => this.config.features.policyEngine, new PolicyStep(this.customRules, () => this.loadManifestPolicyRules(), input, this.includeDefaultRules))
|
|
217
|
+
.run({ task: (0, task_context_1.createTaskContext)(input), policyResult: EMPTY_POLICY_RESULT });
|
|
218
|
+
if (!enrichResult.ok) {
|
|
219
|
+
throw enrichResult.error.cause;
|
|
220
|
+
}
|
|
221
|
+
const { task, policyResult } = enrichResult.value;
|
|
222
|
+
const selectedAgents = this.selectAgents(task, policyResult);
|
|
223
|
+
const gateResolution = (0, gate_resolver_1.resolveGates)(task, policyResult, this.config, selectedAgents, this.reviewAgents, this.customGateAgents);
|
|
224
|
+
const agentPipeline = gateResolution.pipeline.length > 0 ? gateResolution.pipeline : undefined;
|
|
225
|
+
const commitAllowed = gateResolution.commitAllowed;
|
|
226
|
+
// Nombres de customGates pendientes, aparte de los 3 built-in (que ya vienen en
|
|
227
|
+
// policyResult.requiredGates) — se preserva el valor exacto de policyResult.requiredGates
|
|
228
|
+
// para no cambiar comportamiento existente de agent-coding.
|
|
229
|
+
const pendingCustomGateNames = Object.entries(task.customGates)
|
|
230
|
+
.filter(([name, required]) => required && !task.completedCustomGates.includes(name))
|
|
231
|
+
.map(([name]) => name);
|
|
232
|
+
await this.recordOrchestrationGate(task, selectedAgents, policyResult);
|
|
233
|
+
return {
|
|
234
|
+
task,
|
|
235
|
+
selectedAgents,
|
|
236
|
+
agentPipeline,
|
|
237
|
+
appliedPolicies: policyResult.appliedRules.map(r => ({ rule: r.rule, reason: r.reason })),
|
|
238
|
+
requiredGates: [...policyResult.requiredGates, ...pendingCustomGateNames],
|
|
239
|
+
commitAllowed,
|
|
240
|
+
};
|
|
241
|
+
}
|
|
242
|
+
// ── Auditoría ──────────────────────────────────────────────────────────
|
|
243
|
+
/**
|
|
244
|
+
* @description Obtiene la instancia del AuditReporter para registrar gates
|
|
245
|
+
* desde el AgentLoop u otros componentes.
|
|
246
|
+
*/
|
|
247
|
+
getAuditReporter() {
|
|
248
|
+
return this.auditReporter;
|
|
249
|
+
}
|
|
250
|
+
/**
|
|
251
|
+
* @description Intenta transicionar el estado de la tarea en el FSM.
|
|
252
|
+
* Expuesto para que el QA orchestrator pueda avanzar estados desde el loop.
|
|
253
|
+
*/
|
|
254
|
+
transitionTask(task, to) {
|
|
255
|
+
return this.fsm.transition(task, to);
|
|
256
|
+
}
|
|
257
|
+
/**
|
|
258
|
+
* @description Registra automáticamente un gate de orquestación después
|
|
259
|
+
* de ejecutar el pipeline completo.
|
|
260
|
+
*/
|
|
261
|
+
async recordOrchestrationGate(task, selectedAgents, policyResult) {
|
|
262
|
+
const hallazgos = [];
|
|
263
|
+
// Hallazgo de riesgos
|
|
264
|
+
if (task.riskLevel === 'high' || task.riskLevel === 'critical') {
|
|
265
|
+
hallazgos.push({
|
|
266
|
+
id: `ORQ-${(0, crypto_1.randomUUID)().slice(0, 8)}`,
|
|
267
|
+
dimension: 'Riesgo',
|
|
268
|
+
hallazgo: `Tarea con nivel de riesgo ${task.riskLevel}`,
|
|
269
|
+
severidad: task.riskLevel === 'critical' ? 'critical' : 'high',
|
|
270
|
+
evidencia: `RiskLevel: ${task.riskLevel}, Factores: ${JSON.stringify(task.riskFactors)}`,
|
|
271
|
+
recomendacion: 'Asegurar que todos los gates requeridos se ejecuten antes del commit',
|
|
272
|
+
agenteResponsable: 'orchestrator',
|
|
273
|
+
});
|
|
274
|
+
}
|
|
275
|
+
// Hallazgo de gates requeridos
|
|
276
|
+
if (policyResult.requiredGates.length > 0) {
|
|
277
|
+
hallazgos.push({
|
|
278
|
+
id: `GATES-${(0, crypto_1.randomUUID)().slice(0, 8)}`,
|
|
279
|
+
dimension: 'Políticas',
|
|
280
|
+
hallazgo: `Gates requeridos: ${policyResult.requiredGates.join(', ')}`,
|
|
281
|
+
severidad: 'medium',
|
|
282
|
+
evidencia: `Reglas aplicadas: ${policyResult.appliedRules.map(r => r.rule).join(', ')}`,
|
|
283
|
+
recomendacion: `Ejecutar gates: ${policyResult.requiredGates.join(', ')} antes del commit`,
|
|
284
|
+
agenteResponsable: 'orchestrator',
|
|
285
|
+
});
|
|
286
|
+
}
|
|
287
|
+
// Hallazgo de agentes seleccionados
|
|
288
|
+
if (selectedAgents.length > 0) {
|
|
289
|
+
hallazgos.push({
|
|
290
|
+
id: `AGENTS-${(0, crypto_1.randomUUID)().slice(0, 8)}`,
|
|
291
|
+
dimension: 'Selección de Agentes',
|
|
292
|
+
hallazgo: `Agentes seleccionados: ${selectedAgents.map(a => a.agentId).join(', ')}`,
|
|
293
|
+
severidad: 'low',
|
|
294
|
+
evidencia: `Top: ${selectedAgents[0]?.agentId} (score: ${selectedAgents[0]?.score})`,
|
|
295
|
+
recomendacion: selectedAgents.length === 1 && selectedAgents[0]?.agentId === 'general'
|
|
296
|
+
? 'Considerar configurar capability matrix para mejor selección'
|
|
297
|
+
: 'Selección automática correcta',
|
|
298
|
+
agenteResponsable: 'orchestrator',
|
|
299
|
+
});
|
|
300
|
+
}
|
|
301
|
+
const veredicto = task.riskLevel === 'critical' ? 'NO-GO condicional' :
|
|
302
|
+
task.riskLevel === 'high' ? 'NO-GO condicional' :
|
|
303
|
+
'GO';
|
|
304
|
+
await this.auditReporter.recordGate('orquestación', 'orchestrator', veredicto, hallazgos, task, `Pipeline ejecutado: intent → domains → risk → policies → agents → gates`, true // skipIfEmpty: No persistir auto-gates sin hallazgos (reduce ruido)
|
|
305
|
+
);
|
|
306
|
+
}
|
|
307
|
+
// ── Selección de Agentes ────────────────────────────────────────────────
|
|
308
|
+
/**
|
|
309
|
+
* Selecciona agentes combinando:
|
|
310
|
+
* - Políticas obligatorias (mustInclude)
|
|
311
|
+
* - Capability matrix (dominios)
|
|
312
|
+
* - Pesos dinámicos
|
|
313
|
+
*/
|
|
314
|
+
selectAgents(task, policyResult) {
|
|
315
|
+
const selected = [];
|
|
316
|
+
const seen = new Set();
|
|
317
|
+
// Fuente única de verdad: task.assignedAgents (ya rellenado por applyPolicies)
|
|
318
|
+
// más cualquier mustInclude adicional que la política reportó
|
|
319
|
+
const mandatoryIds = new Set([
|
|
320
|
+
...task.assignedAgents,
|
|
321
|
+
...policyResult.mustInclude,
|
|
322
|
+
]);
|
|
323
|
+
for (const agentId of mandatoryIds) {
|
|
324
|
+
if (!seen.has(agentId)) {
|
|
325
|
+
seen.add(agentId);
|
|
326
|
+
selected.push({ agentId, score: 100, reason: 'Politica obligatoria' });
|
|
327
|
+
}
|
|
328
|
+
}
|
|
329
|
+
// Agentes por capability matrix (dominios detectados)
|
|
330
|
+
if (this.capabilityMatrix) {
|
|
331
|
+
for (const domain of task.domains) {
|
|
332
|
+
for (const [agentId, capability] of Object.entries(this.capabilityMatrix)) {
|
|
333
|
+
if (seen.has(agentId))
|
|
334
|
+
continue;
|
|
335
|
+
if (capability.owns.includes(domain)) {
|
|
336
|
+
seen.add(agentId);
|
|
337
|
+
const baseWeight = capability.baseWeight ?? 0.8;
|
|
338
|
+
selected.push({
|
|
339
|
+
agentId,
|
|
340
|
+
score: Math.round(baseWeight * 100),
|
|
341
|
+
reason: `Domina el dominio: ${domain}`,
|
|
342
|
+
});
|
|
343
|
+
}
|
|
344
|
+
}
|
|
345
|
+
}
|
|
346
|
+
}
|
|
347
|
+
// Agente general como fallback
|
|
348
|
+
if (selected.length === 0) {
|
|
349
|
+
selected.push({ agentId: 'general', score: 50, reason: 'Fallback: agente general' });
|
|
350
|
+
}
|
|
351
|
+
return selected.sort((a, b) => b.score - a.score);
|
|
352
|
+
}
|
|
353
|
+
// Nota: el pipeline de agentes (review → implement → verify) y la resolución de
|
|
354
|
+
// commitAllowed viven en gate-resolver.ts (resolveGates/resolveCommitAllowed) —
|
|
355
|
+
// única fuente de verdad, invocada desde orchestrate(). No duplicar acá.
|
|
356
|
+
/**
|
|
357
|
+
* @description Obtiene los estados destino válidos desde el estado actual.
|
|
358
|
+
*/
|
|
359
|
+
getAvailableTransitions(status) {
|
|
360
|
+
return this.fsm.getAvailableTransitions(status);
|
|
361
|
+
}
|
|
362
|
+
/**
|
|
363
|
+
* @description Calcula la ruta crítica desde el estado actual hasta commit_allowed.
|
|
364
|
+
*/
|
|
365
|
+
getCriticalPath(task) {
|
|
366
|
+
return this.fsm.getCriticalPath(task);
|
|
367
|
+
}
|
|
368
|
+
/**
|
|
369
|
+
* @description Obtiene la instancia del FSM.
|
|
370
|
+
*/
|
|
371
|
+
getFSM() {
|
|
372
|
+
return this.fsm;
|
|
373
|
+
}
|
|
374
|
+
/**
|
|
375
|
+
* @description Actualiza la configuración en runtime.
|
|
376
|
+
*/
|
|
377
|
+
updateConfig(config) {
|
|
378
|
+
this.config = { ...this.config, ...config };
|
|
379
|
+
}
|
|
380
|
+
/**
|
|
381
|
+
* @description Actualiza las reglas personalizadas en runtime.
|
|
382
|
+
*/
|
|
383
|
+
updateRules(rules) {
|
|
384
|
+
this.customRules = rules;
|
|
385
|
+
}
|
|
386
|
+
/**
|
|
387
|
+
* @description Actualiza la capability matrix en runtime.
|
|
388
|
+
*/
|
|
389
|
+
updateCapabilityMatrix(matrix) {
|
|
390
|
+
this.capabilityMatrix = matrix;
|
|
391
|
+
}
|
|
392
|
+
/**
|
|
393
|
+
* @description Carga las policyRules auto-promovidas desde manifest.yaml.
|
|
394
|
+
* Estas son generadas por el PolicyPromoter del Reflection Engine y se
|
|
395
|
+
* fusionan con las customRules en cada orchestrate().
|
|
396
|
+
*/
|
|
397
|
+
async loadManifestPolicyRules() {
|
|
398
|
+
try {
|
|
399
|
+
const home = process.env.USERPROFILE ?? process.env.HOME ?? os.homedir();
|
|
400
|
+
const manifestPath = path.join(home, `.${this.appName}`, 'manifest.yaml');
|
|
401
|
+
const content = await fs.promises.readFile(manifestPath, 'utf-8');
|
|
402
|
+
const manifest = yaml.parse(content);
|
|
403
|
+
const rules = manifest?.policyRules ?? [];
|
|
404
|
+
return rules
|
|
405
|
+
.filter(r => r.if && r.then)
|
|
406
|
+
.map(r => ({ if: r.if, then: r.then }));
|
|
407
|
+
}
|
|
408
|
+
catch {
|
|
409
|
+
return [];
|
|
410
|
+
}
|
|
411
|
+
}
|
|
412
|
+
}
|
|
413
|
+
exports.Orchestrator = Orchestrator;
|
|
414
|
+
//# sourceMappingURL=orchestrator.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"orchestrator.js","sourceRoot":"","sources":["../../../src/pipeline/orchestration/orchestrator.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;GAkBG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEH,uCAAyB;AACzB,uCAAyB;AACzB,2CAA6B;AAC7B,mCAAoC;AACpC,2CAA6B;AAC7B,wDAA8D;AAG9D,iDAA4E;AAC5E,uDAAwE;AACxE,uDAA0D;AAC1D,+CAAmD;AACnD,mDAAoE;AACpE,mDAA+C;AAC/C,+BAAqD;AACrD,mCAMiB;AACjB,qDAAiD;AAUjD,MAAM,mBAAmB,GAAuB;IAC9C,WAAW,EAAE,EAAE;IACf,aAAa,EAAE,EAAE;IACjB,WAAW,EAAE,EAAE;IACf,WAAW,EAAE,EAAE;IACf,YAAY,EAAE,EAAE;CACjB,CAAC;AAEF,iFAAiF;AAEjF,MAAM,UAAU;IAEM;IADX,QAAQ,GAAG,kBAAkB,CAAC;IACvC,YAAoB,MAAsB;QAAtB,WAAM,GAAN,MAAM,CAAgB;IAAG,CAAC;IAC9C,KAAK,CAAC,MAAM,CAAC,GAAoB;QAC/B,IAAI,CAAC;YACH,OAAO,IAAA,aAAE,EAAC,EAAE,GAAG,GAAG,EAAE,IAAI,EAAE,MAAM,IAAA,sCAAoB,EAAC,GAAG,CAAC,IAAI,EAAE,IAAI,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC;QACjF,CAAC;QAAC,OAAO,CAAC,EAAE,CAAC;YACX,OAAO,IAAA,cAAG,EAAC,CAAC,YAAY,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;QAC5D,CAAC;IACH,CAAC;CAC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,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC,EAAE,EAAE,IAAI,EAAE,CAAC,CAAC,IAAI,EAAE,CAAC,CAAiB,CAAC;QAC5D,CAAC;QAAC,MAAM,CAAC;YACP,OAAO,EAAE,CAAC;QACZ,CAAC;IACH,CAAC;CACF;AAvTD,oCAuTC"}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @description Policy Engine — Motor de reglas para el orquestador.
|
|
3
|
+
*
|
|
4
|
+
* Evalúa reglas contra un TaskContext y determina:
|
|
5
|
+
* - Qué agentes deben participar obligatoriamente
|
|
6
|
+
* - Qué gates son obligatorios
|
|
7
|
+
* - Qué skills deben ejecutarse
|
|
8
|
+
*
|
|
9
|
+
* Las reglas se cargan desde ~/.deepseek-code/policy-rules.yaml
|
|
10
|
+
* y se complementan con reglas built-in por defecto.
|
|
11
|
+
*/
|
|
12
|
+
import { TaskContext } from './task-context';
|
|
13
|
+
import { PolicyRule } from './types';
|
|
14
|
+
export interface PolicyEngineResult {
|
|
15
|
+
/** Agentes que deben incluirse */
|
|
16
|
+
mustInclude: string[];
|
|
17
|
+
/** Gates obligatorios */
|
|
18
|
+
requiredGates: Array<'qa' | 'security' | 'architecture'>;
|
|
19
|
+
/** Skills obligatorios */
|
|
20
|
+
mustExecute: string[];
|
|
21
|
+
/** Nombres de customGates activados por reglas (más allá de qa/security/architecture) */
|
|
22
|
+
customGates: string[];
|
|
23
|
+
/** Reglas que se activaron */
|
|
24
|
+
appliedRules: Array<{
|
|
25
|
+
rule: string;
|
|
26
|
+
reason: string;
|
|
27
|
+
}>;
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* @description Evalúa todas las reglas contra un TaskContext.
|
|
31
|
+
*
|
|
32
|
+
* Las reglas personalizadas (de ~/.deepseek-code/policy-rules.yaml)
|
|
33
|
+
* tienen prioridad sobre las built-in. Si una regla personalizada
|
|
34
|
+
* coincide, se aplica en lugar de la built-in equivalente.
|
|
35
|
+
*
|
|
36
|
+
* @param task - TaskContext enriquecido con actionType, domains, riskLevel
|
|
37
|
+
* @param customRules - Reglas personalizadas (opcional, desde config)
|
|
38
|
+
* @param userInput - Texto original del usuario, para matching de keywords
|
|
39
|
+
* @param includeDefaultRules - Si es false, omite DEFAULT_RULES (que asume agentes de
|
|
40
|
+
* coding: architecture/security/qa-engineer). Default true — no cambia el comportamiento
|
|
41
|
+
* de consumidores existentes. Verticales sin esos agentes (ej. agent-enterprise) deben
|
|
42
|
+
* pasar false y aportar sus propias customRules.
|
|
43
|
+
* @returns Políticas aplicadas: agentes, gates y skills obligatorios
|
|
44
|
+
*/
|
|
45
|
+
export declare function evaluatePolicies(task: TaskContext, customRules?: PolicyRule[], userInput?: string, includeDefaultRules?: boolean): PolicyEngineResult;
|
|
46
|
+
/**
|
|
47
|
+
* @description Aplica políticas a un TaskContext y produce un resultado completo.
|
|
48
|
+
* Es el entry point principal para el orquestador.
|
|
49
|
+
*/
|
|
50
|
+
export declare function applyPolicies(task: TaskContext, customRules?: PolicyRule[], userInput?: string, includeDefaultRules?: boolean): {
|
|
51
|
+
task: TaskContext;
|
|
52
|
+
result: PolicyEngineResult;
|
|
53
|
+
};
|
|
54
|
+
//# sourceMappingURL=policy-engine.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"policy-engine.d.ts","sourceRoot":"","sources":["../../../src/pipeline/orchestration/policy-engine.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,EAAE,WAAW,EAAyB,MAAM,gBAAgB,CAAC;AACpE,OAAO,EAAE,UAAU,EAAsD,MAAM,SAAS,CAAC;AAwGzF,MAAM,WAAW,kBAAkB;IACjC,kCAAkC;IAClC,WAAW,EAAE,MAAM,EAAE,CAAC;IACtB,yBAAyB;IACzB,aAAa,EAAE,KAAK,CAAC,IAAI,GAAG,UAAU,GAAG,cAAc,CAAC,CAAC;IACzD,0BAA0B;IAC1B,WAAW,EAAE,MAAM,EAAE,CAAC;IACtB,yFAAyF;IACzF,WAAW,EAAE,MAAM,EAAE,CAAC;IACtB,8BAA8B;IAC9B,YAAY,EAAE,KAAK,CAAC;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;CACvD;AAED;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,gBAAgB,CAC9B,IAAI,EAAE,WAAW,EACjB,WAAW,CAAC,EAAE,UAAU,EAAE,EAC1B,SAAS,SAAK,EACd,mBAAmB,UAAO,GACzB,kBAAkB,CA8DpB;AAoFD;;;GAGG;AACH,wBAAgB,aAAa,CAC3B,IAAI,EAAE,WAAW,EACjB,WAAW,CAAC,EAAE,UAAU,EAAE,EAC1B,SAAS,SAAK,EACd,mBAAmB,UAAO,GACzB;IAAE,IAAI,EAAE,WAAW,CAAC;IAAC,MAAM,EAAE,kBAAkB,CAAA;CAAE,CAkBnD"}
|