@litmers/cursorflow-orchestrator 0.1.40 → 0.2.2
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/CHANGELOG.md +0 -2
- package/README.md +7 -3
- package/commands/cursorflow-init.md +0 -4
- package/dist/cli/logs.js +108 -9
- package/dist/cli/logs.js.map +1 -1
- package/dist/cli/models.js +20 -3
- package/dist/cli/models.js.map +1 -1
- package/dist/cli/monitor.d.ts +7 -10
- package/dist/cli/monitor.js +1088 -1240
- package/dist/cli/monitor.js.map +1 -1
- package/dist/cli/resume.js +21 -1
- package/dist/cli/resume.js.map +1 -1
- package/dist/cli/run.js +28 -9
- package/dist/cli/run.js.map +1 -1
- package/dist/cli/signal.d.ts +6 -1
- package/dist/cli/signal.js +94 -12
- package/dist/cli/signal.js.map +1 -1
- package/dist/cli/tasks.js +3 -46
- package/dist/cli/tasks.js.map +1 -1
- package/dist/core/agent-supervisor.d.ts +23 -0
- package/dist/core/agent-supervisor.js +42 -0
- package/dist/core/agent-supervisor.js.map +1 -0
- package/dist/core/auto-recovery.d.ts +2 -1
- package/dist/core/auto-recovery.js +6 -1
- package/dist/core/auto-recovery.js.map +1 -1
- package/dist/core/failure-policy.d.ts +0 -1
- package/dist/core/failure-policy.js +0 -1
- package/dist/core/failure-policy.js.map +1 -1
- package/dist/core/git-lifecycle-manager.d.ts +284 -0
- package/dist/core/git-lifecycle-manager.js +778 -0
- package/dist/core/git-lifecycle-manager.js.map +1 -0
- package/dist/core/git-pipeline-coordinator.d.ts +21 -0
- package/dist/core/git-pipeline-coordinator.js +205 -0
- package/dist/core/git-pipeline-coordinator.js.map +1 -0
- package/dist/core/intervention.d.ts +176 -0
- package/dist/core/intervention.js +424 -0
- package/dist/core/intervention.js.map +1 -0
- package/dist/core/lane-state-machine.d.ts +423 -0
- package/dist/core/lane-state-machine.js +890 -0
- package/dist/core/lane-state-machine.js.map +1 -0
- package/dist/core/orchestrator.d.ts +4 -1
- package/dist/core/orchestrator.js +29 -62
- package/dist/core/orchestrator.js.map +1 -1
- package/dist/core/runner/agent.d.ts +7 -1
- package/dist/core/runner/agent.js +45 -30
- package/dist/core/runner/agent.js.map +1 -1
- package/dist/core/runner/pipeline.js +283 -123
- package/dist/core/runner/pipeline.js.map +1 -1
- package/dist/core/runner/task.d.ts +4 -5
- package/dist/core/runner/task.js +6 -80
- package/dist/core/runner/task.js.map +1 -1
- package/dist/core/runner.js +8 -2
- package/dist/core/runner.js.map +1 -1
- package/dist/core/stall-detection.d.ts +11 -4
- package/dist/core/stall-detection.js +62 -27
- package/dist/core/stall-detection.js.map +1 -1
- package/dist/hooks/contexts/index.d.ts +104 -0
- package/dist/hooks/contexts/index.js +134 -0
- package/dist/hooks/contexts/index.js.map +1 -0
- package/dist/hooks/data-accessor.d.ts +86 -0
- package/dist/hooks/data-accessor.js +410 -0
- package/dist/hooks/data-accessor.js.map +1 -0
- package/dist/hooks/flow-controller.d.ts +136 -0
- package/dist/hooks/flow-controller.js +351 -0
- package/dist/hooks/flow-controller.js.map +1 -0
- package/dist/hooks/index.d.ts +68 -0
- package/dist/hooks/index.js +105 -0
- package/dist/hooks/index.js.map +1 -0
- package/dist/hooks/manager.d.ts +129 -0
- package/dist/hooks/manager.js +389 -0
- package/dist/hooks/manager.js.map +1 -0
- package/dist/hooks/types.d.ts +463 -0
- package/dist/hooks/types.js +45 -0
- package/dist/hooks/types.js.map +1 -0
- package/dist/services/logging/buffer.d.ts +2 -2
- package/dist/services/logging/buffer.js +95 -42
- package/dist/services/logging/buffer.js.map +1 -1
- package/dist/services/logging/console.js +6 -1
- package/dist/services/logging/console.js.map +1 -1
- package/dist/services/logging/formatter.d.ts +9 -4
- package/dist/services/logging/formatter.js +64 -18
- package/dist/services/logging/formatter.js.map +1 -1
- package/dist/services/logging/index.d.ts +0 -1
- package/dist/services/logging/index.js +0 -1
- package/dist/services/logging/index.js.map +1 -1
- package/dist/services/logging/paths.d.ts +8 -0
- package/dist/services/logging/paths.js +48 -0
- package/dist/services/logging/paths.js.map +1 -0
- package/dist/services/logging/raw-log.d.ts +6 -0
- package/dist/services/logging/raw-log.js +37 -0
- package/dist/services/logging/raw-log.js.map +1 -0
- package/dist/services/process/index.js +1 -1
- package/dist/services/process/index.js.map +1 -1
- package/dist/types/agent.d.ts +15 -0
- package/dist/types/config.d.ts +22 -1
- package/dist/types/event-categories.d.ts +601 -0
- package/dist/types/event-categories.js +233 -0
- package/dist/types/event-categories.js.map +1 -0
- package/dist/types/events.d.ts +0 -20
- package/dist/types/flow.d.ts +10 -6
- package/dist/types/index.d.ts +1 -1
- package/dist/types/index.js +17 -3
- package/dist/types/index.js.map +1 -1
- package/dist/types/lane.d.ts +1 -1
- package/dist/types/logging.d.ts +1 -1
- package/dist/types/task.d.ts +12 -1
- package/dist/ui/log-viewer.d.ts +3 -0
- package/dist/ui/log-viewer.js +3 -0
- package/dist/ui/log-viewer.js.map +1 -1
- package/dist/utils/config.js +10 -1
- package/dist/utils/config.js.map +1 -1
- package/dist/utils/cursor-agent.d.ts +11 -1
- package/dist/utils/cursor-agent.js +63 -16
- package/dist/utils/cursor-agent.js.map +1 -1
- package/dist/utils/enhanced-logger.d.ts +5 -1
- package/dist/utils/enhanced-logger.js +98 -19
- package/dist/utils/enhanced-logger.js.map +1 -1
- package/dist/utils/event-registry.d.ts +222 -0
- package/dist/utils/event-registry.js +463 -0
- package/dist/utils/event-registry.js.map +1 -0
- package/dist/utils/events.d.ts +1 -13
- package/dist/utils/events.js.map +1 -1
- package/dist/utils/flow.d.ts +10 -0
- package/dist/utils/flow.js +75 -0
- package/dist/utils/flow.js.map +1 -1
- package/dist/utils/log-constants.d.ts +1 -0
- package/dist/utils/log-constants.js +2 -1
- package/dist/utils/log-constants.js.map +1 -1
- package/dist/utils/log-formatter.d.ts +2 -1
- package/dist/utils/log-formatter.js +10 -10
- package/dist/utils/log-formatter.js.map +1 -1
- package/dist/utils/logger.d.ts +11 -0
- package/dist/utils/logger.js +82 -3
- package/dist/utils/logger.js.map +1 -1
- package/dist/utils/repro-thinking-logs.js +0 -13
- package/dist/utils/repro-thinking-logs.js.map +1 -1
- package/dist/utils/run-service.js +1 -1
- package/dist/utils/run-service.js.map +1 -1
- package/examples/README.md +0 -2
- package/examples/demo-project/README.md +1 -2
- package/package.json +18 -28
- package/scripts/setup-security.sh +0 -1
- package/scripts/test-log-parser.ts +171 -0
- package/scripts/verify-change.sh +272 -0
- package/src/cli/logs.ts +121 -10
- package/src/cli/models.ts +20 -3
- package/src/cli/monitor.ts +1257 -1342
- package/src/cli/resume.ts +27 -1
- package/src/cli/run.ts +29 -11
- package/src/cli/signal.ts +115 -17
- package/src/cli/tasks.ts +2 -59
- package/src/core/agent-supervisor.ts +64 -0
- package/src/core/auto-recovery.ts +7 -1
- package/src/core/failure-policy.ts +0 -1
- package/src/core/git-lifecycle-manager.ts +1011 -0
- package/src/core/git-pipeline-coordinator.ts +221 -0
- package/src/core/intervention.ts +481 -0
- package/src/core/lane-state-machine.ts +1097 -0
- package/src/core/orchestrator.ts +35 -61
- package/src/core/runner/agent.ts +66 -33
- package/src/core/runner/pipeline.ts +318 -138
- package/src/core/runner/task.ts +12 -97
- package/src/core/runner.ts +8 -2
- package/src/core/stall-detection.ts +72 -27
- package/src/hooks/contexts/index.ts +256 -0
- package/src/hooks/data-accessor.ts +488 -0
- package/src/hooks/flow-controller.ts +425 -0
- package/src/hooks/index.ts +154 -0
- package/src/hooks/manager.ts +434 -0
- package/src/hooks/types.ts +544 -0
- package/src/services/logging/buffer.ts +104 -43
- package/src/services/logging/console.ts +7 -1
- package/src/services/logging/formatter.ts +74 -18
- package/src/services/logging/index.ts +0 -2
- package/src/services/logging/paths.ts +14 -0
- package/src/services/logging/raw-log.ts +43 -0
- package/src/services/process/index.ts +1 -1
- package/src/types/agent.ts +15 -0
- package/src/types/config.ts +23 -1
- package/src/types/event-categories.ts +663 -0
- package/src/types/events.ts +0 -25
- package/src/types/flow.ts +10 -6
- package/src/types/index.ts +50 -4
- package/src/types/lane.ts +1 -2
- package/src/types/logging.ts +2 -1
- package/src/types/task.ts +12 -1
- package/src/ui/log-viewer.ts +3 -0
- package/src/utils/config.ts +11 -1
- package/src/utils/cursor-agent.ts +68 -16
- package/src/utils/enhanced-logger.ts +105 -19
- package/src/utils/event-registry.ts +595 -0
- package/src/utils/events.ts +0 -16
- package/src/utils/flow.ts +83 -0
- package/src/utils/log-constants.ts +2 -1
- package/src/utils/log-formatter.ts +10 -11
- package/src/utils/logger.ts +49 -3
- package/src/utils/repro-thinking-logs.ts +0 -15
- package/src/utils/run-service.ts +1 -1
- package/dist/services/logging/file-writer.d.ts +0 -71
- package/dist/services/logging/file-writer.js +0 -516
- package/dist/services/logging/file-writer.js.map +0 -1
- package/dist/types/review.d.ts +0 -17
- package/dist/types/review.js +0 -6
- package/dist/types/review.js.map +0 -1
- package/scripts/ai-security-check.js +0 -233
- package/src/services/logging/file-writer.ts +0 -526
- package/src/types/review.ts +0 -20
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* CursorFlow Hook System - Context Builders
|
|
3
|
+
*
|
|
4
|
+
* 각 Hook Point에 대한 컨텍스트를 생성하는 빌더 함수들입니다.
|
|
5
|
+
*/
|
|
6
|
+
import { BeforeTaskContext, AfterTaskContext, OnErrorContext, OnStallContext, OnLaneEndContext, TaskDefinition, TaskResult, DependencyResult } from '../types';
|
|
7
|
+
import { FlowControllerImpl } from '../flow-controller';
|
|
8
|
+
export interface BaseContextOptions {
|
|
9
|
+
/** Lane 이름 */
|
|
10
|
+
laneName: string;
|
|
11
|
+
/** Run ID */
|
|
12
|
+
runId: string;
|
|
13
|
+
/** 현재 태스크 인덱스 */
|
|
14
|
+
taskIndex: number;
|
|
15
|
+
/** 전체 태스크 수 */
|
|
16
|
+
totalTasks: number;
|
|
17
|
+
/** 현재 태스크 */
|
|
18
|
+
task: {
|
|
19
|
+
name: string;
|
|
20
|
+
prompt: string;
|
|
21
|
+
model: string;
|
|
22
|
+
dependsOn?: string[];
|
|
23
|
+
};
|
|
24
|
+
/** Worktree 디렉토리 */
|
|
25
|
+
worktreeDir: string;
|
|
26
|
+
/** Run 디렉토리 */
|
|
27
|
+
runDir: string;
|
|
28
|
+
/** 태스크 브랜치 */
|
|
29
|
+
taskBranch: string;
|
|
30
|
+
/** 파이프라인 브랜치 */
|
|
31
|
+
pipelineBranch: string;
|
|
32
|
+
/** 태스크 파일 경로 */
|
|
33
|
+
tasksFile: string;
|
|
34
|
+
/** Chat ID */
|
|
35
|
+
chatId: string;
|
|
36
|
+
/** 태스크 목록 (수정 가능 참조) */
|
|
37
|
+
tasks: TaskDefinition[];
|
|
38
|
+
/** 완료된 태스크 목록 */
|
|
39
|
+
completedTasks: TaskResult[];
|
|
40
|
+
/** 의존성 결과 */
|
|
41
|
+
dependencyResults: DependencyResult[];
|
|
42
|
+
/** 태스크 시작 시간 */
|
|
43
|
+
taskStartTime: number;
|
|
44
|
+
/** Lane 시작 시간 */
|
|
45
|
+
laneStartTime: number;
|
|
46
|
+
/** AgentSupervisor 인스턴스 */
|
|
47
|
+
agentSupervisor?: any;
|
|
48
|
+
/** Run Root */
|
|
49
|
+
runRoot?: string;
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* beforeTask 컨텍스트 생성
|
|
53
|
+
*/
|
|
54
|
+
export declare function createBeforeTaskContext(options: BaseContextOptions): {
|
|
55
|
+
context: BeforeTaskContext;
|
|
56
|
+
flowController: FlowControllerImpl;
|
|
57
|
+
};
|
|
58
|
+
/**
|
|
59
|
+
* afterTask 컨텍스트 생성
|
|
60
|
+
*/
|
|
61
|
+
export declare function createAfterTaskContext(options: BaseContextOptions, result: {
|
|
62
|
+
status: 'success' | 'error' | 'blocked';
|
|
63
|
+
exitCode?: number;
|
|
64
|
+
error?: string;
|
|
65
|
+
}): {
|
|
66
|
+
context: AfterTaskContext;
|
|
67
|
+
flowController: FlowControllerImpl;
|
|
68
|
+
};
|
|
69
|
+
/**
|
|
70
|
+
* onError 컨텍스트 생성
|
|
71
|
+
*/
|
|
72
|
+
export declare function createOnErrorContext(options: BaseContextOptions, error: {
|
|
73
|
+
type: 'agent_error' | 'git_error' | 'timeout' | 'unknown';
|
|
74
|
+
message: string;
|
|
75
|
+
stack?: string;
|
|
76
|
+
retryable: boolean;
|
|
77
|
+
}): {
|
|
78
|
+
context: OnErrorContext;
|
|
79
|
+
flowController: FlowControllerImpl;
|
|
80
|
+
};
|
|
81
|
+
/**
|
|
82
|
+
* onStall 컨텍스트 생성
|
|
83
|
+
*/
|
|
84
|
+
export declare function createOnStallContext(options: BaseContextOptions, stall: {
|
|
85
|
+
idleTimeMs: number;
|
|
86
|
+
lastActivity: string;
|
|
87
|
+
bytesReceived: number;
|
|
88
|
+
phase: 'initial' | 'warning' | 'critical';
|
|
89
|
+
}): {
|
|
90
|
+
context: OnStallContext;
|
|
91
|
+
flowController: FlowControllerImpl;
|
|
92
|
+
};
|
|
93
|
+
/**
|
|
94
|
+
* onLaneEnd 컨텍스트 생성
|
|
95
|
+
*/
|
|
96
|
+
export declare function createOnLaneEndContext(options: BaseContextOptions, summary: {
|
|
97
|
+
status: 'completed' | 'failed' | 'aborted';
|
|
98
|
+
completedTasks: number;
|
|
99
|
+
failedTasks: number;
|
|
100
|
+
totalDuration: number;
|
|
101
|
+
}): {
|
|
102
|
+
context: OnLaneEndContext;
|
|
103
|
+
flowController: FlowControllerImpl;
|
|
104
|
+
};
|
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* CursorFlow Hook System - Context Builders
|
|
4
|
+
*
|
|
5
|
+
* 각 Hook Point에 대한 컨텍스트를 생성하는 빌더 함수들입니다.
|
|
6
|
+
*/
|
|
7
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8
|
+
exports.createBeforeTaskContext = createBeforeTaskContext;
|
|
9
|
+
exports.createAfterTaskContext = createAfterTaskContext;
|
|
10
|
+
exports.createOnErrorContext = createOnErrorContext;
|
|
11
|
+
exports.createOnStallContext = createOnStallContext;
|
|
12
|
+
exports.createOnLaneEndContext = createOnLaneEndContext;
|
|
13
|
+
const data_accessor_1 = require("../data-accessor");
|
|
14
|
+
const flow_controller_1 = require("../flow-controller");
|
|
15
|
+
// ============================================================================
|
|
16
|
+
// Context Builders
|
|
17
|
+
// ============================================================================
|
|
18
|
+
/**
|
|
19
|
+
* 기본 컨텍스트 생성
|
|
20
|
+
*/
|
|
21
|
+
function createBaseContext(options) {
|
|
22
|
+
// FlowController 생성
|
|
23
|
+
const flowControllerOptions = {
|
|
24
|
+
laneName: options.laneName,
|
|
25
|
+
runDir: options.runDir,
|
|
26
|
+
worktreeDir: options.worktreeDir,
|
|
27
|
+
currentTaskIndex: options.taskIndex,
|
|
28
|
+
tasks: options.tasks,
|
|
29
|
+
tasksFile: options.tasksFile,
|
|
30
|
+
chatId: options.chatId,
|
|
31
|
+
agentSupervisor: options.agentSupervisor,
|
|
32
|
+
};
|
|
33
|
+
const flowController = (0, flow_controller_1.createFlowController)(flowControllerOptions);
|
|
34
|
+
// DataAccessor 생성
|
|
35
|
+
const dataAccessorOptions = {
|
|
36
|
+
worktreeDir: options.worktreeDir,
|
|
37
|
+
runDir: options.runDir,
|
|
38
|
+
taskBranch: options.taskBranch,
|
|
39
|
+
pipelineBranch: options.pipelineBranch,
|
|
40
|
+
laneName: options.laneName,
|
|
41
|
+
taskName: options.task.name,
|
|
42
|
+
completedTasks: options.completedTasks,
|
|
43
|
+
pendingTasks: options.tasks.slice(options.taskIndex + 1),
|
|
44
|
+
dependencyResults: options.dependencyResults,
|
|
45
|
+
taskStartTime: options.taskStartTime,
|
|
46
|
+
laneStartTime: options.laneStartTime,
|
|
47
|
+
runRoot: options.runRoot,
|
|
48
|
+
};
|
|
49
|
+
const dataAccessor = (0, data_accessor_1.createDataAccessor)(dataAccessorOptions);
|
|
50
|
+
// 기본 컨텍스트
|
|
51
|
+
const context = {
|
|
52
|
+
laneName: options.laneName,
|
|
53
|
+
runId: options.runId,
|
|
54
|
+
taskIndex: options.taskIndex,
|
|
55
|
+
totalTasks: options.totalTasks,
|
|
56
|
+
task: options.task,
|
|
57
|
+
};
|
|
58
|
+
return { context, flowController, dataAccessor };
|
|
59
|
+
}
|
|
60
|
+
/**
|
|
61
|
+
* beforeTask 컨텍스트 생성
|
|
62
|
+
*/
|
|
63
|
+
function createBeforeTaskContext(options) {
|
|
64
|
+
const { context, flowController, dataAccessor } = createBaseContext(options);
|
|
65
|
+
return {
|
|
66
|
+
context: {
|
|
67
|
+
...context,
|
|
68
|
+
flow: flowController,
|
|
69
|
+
getData: dataAccessor,
|
|
70
|
+
},
|
|
71
|
+
flowController,
|
|
72
|
+
};
|
|
73
|
+
}
|
|
74
|
+
/**
|
|
75
|
+
* afterTask 컨텍스트 생성
|
|
76
|
+
*/
|
|
77
|
+
function createAfterTaskContext(options, result) {
|
|
78
|
+
const { context, flowController, dataAccessor } = createBaseContext(options);
|
|
79
|
+
return {
|
|
80
|
+
context: {
|
|
81
|
+
...context,
|
|
82
|
+
flow: flowController,
|
|
83
|
+
getData: dataAccessor,
|
|
84
|
+
result,
|
|
85
|
+
},
|
|
86
|
+
flowController,
|
|
87
|
+
};
|
|
88
|
+
}
|
|
89
|
+
/**
|
|
90
|
+
* onError 컨텍스트 생성
|
|
91
|
+
*/
|
|
92
|
+
function createOnErrorContext(options, error) {
|
|
93
|
+
const { context, flowController, dataAccessor } = createBaseContext(options);
|
|
94
|
+
return {
|
|
95
|
+
context: {
|
|
96
|
+
...context,
|
|
97
|
+
flow: flowController,
|
|
98
|
+
getData: dataAccessor,
|
|
99
|
+
error,
|
|
100
|
+
},
|
|
101
|
+
flowController,
|
|
102
|
+
};
|
|
103
|
+
}
|
|
104
|
+
/**
|
|
105
|
+
* onStall 컨텍스트 생성
|
|
106
|
+
*/
|
|
107
|
+
function createOnStallContext(options, stall) {
|
|
108
|
+
const { context, flowController, dataAccessor } = createBaseContext(options);
|
|
109
|
+
return {
|
|
110
|
+
context: {
|
|
111
|
+
...context,
|
|
112
|
+
flow: flowController,
|
|
113
|
+
getData: dataAccessor,
|
|
114
|
+
stall,
|
|
115
|
+
},
|
|
116
|
+
flowController,
|
|
117
|
+
};
|
|
118
|
+
}
|
|
119
|
+
/**
|
|
120
|
+
* onLaneEnd 컨텍스트 생성
|
|
121
|
+
*/
|
|
122
|
+
function createOnLaneEndContext(options, summary) {
|
|
123
|
+
const { context, flowController, dataAccessor } = createBaseContext(options);
|
|
124
|
+
return {
|
|
125
|
+
context: {
|
|
126
|
+
...context,
|
|
127
|
+
flow: flowController,
|
|
128
|
+
getData: dataAccessor,
|
|
129
|
+
summary,
|
|
130
|
+
},
|
|
131
|
+
flowController,
|
|
132
|
+
};
|
|
133
|
+
}
|
|
134
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/hooks/contexts/index.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;AA6HH,0DAcC;AAKD,wDAsBC;AAKD,oDAuBC;AAKD,oDAuBC;AAKD,wDAuBC;AA3OD,oDAA2E;AAC3E,wDAAqG;AAkDrG,+EAA+E;AAC/E,mBAAmB;AACnB,+EAA+E;AAE/E;;GAEG;AACH,SAAS,iBAAiB,CAAC,OAA2B;IAKpD,oBAAoB;IACpB,MAAM,qBAAqB,GAA0B;QACnD,QAAQ,EAAE,OAAO,CAAC,QAAQ;QAC1B,MAAM,EAAE,OAAO,CAAC,MAAM;QACtB,WAAW,EAAE,OAAO,CAAC,WAAW;QAChC,gBAAgB,EAAE,OAAO,CAAC,SAAS;QACnC,KAAK,EAAE,OAAO,CAAC,KAAK;QACpB,SAAS,EAAE,OAAO,CAAC,SAAS;QAC5B,MAAM,EAAE,OAAO,CAAC,MAAM;QACtB,eAAe,EAAE,OAAO,CAAC,eAAe;KACzC,CAAC;IAEF,MAAM,cAAc,GAAG,IAAA,sCAAoB,EAAC,qBAAqB,CAAC,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Flow Hook System - Data Accessor Implementation
|
|
3
|
+
*
|
|
4
|
+
* Hook에서 Git, 대화 기록, 로그 등의 데이터에 접근하기 위한 구현체입니다.
|
|
5
|
+
* 모든 메서드는 Lazy Loading으로 필요할 때만 데이터를 로드합니다.
|
|
6
|
+
*/
|
|
7
|
+
import { HookDataAccessor, ChangedFile, Commit, Message, TaskResult, TaskDefinition, ToolCall, ErrorLog, DependencyResult } from './types';
|
|
8
|
+
export interface DataAccessorOptions {
|
|
9
|
+
/** Worktree 디렉토리 */
|
|
10
|
+
worktreeDir: string;
|
|
11
|
+
/** Run 디렉토리 (로그 파일 위치) */
|
|
12
|
+
runDir: string;
|
|
13
|
+
/** 현재 태스크 브랜치 */
|
|
14
|
+
taskBranch: string;
|
|
15
|
+
/** 파이프라인 브랜치 */
|
|
16
|
+
pipelineBranch: string;
|
|
17
|
+
/** Lane 이름 */
|
|
18
|
+
laneName: string;
|
|
19
|
+
/** 현재 태스크 이름 */
|
|
20
|
+
taskName: string;
|
|
21
|
+
/** 완료된 태스크 목록 */
|
|
22
|
+
completedTasks: TaskResult[];
|
|
23
|
+
/** 남은 태스크 목록 */
|
|
24
|
+
pendingTasks: TaskDefinition[];
|
|
25
|
+
/** 의존성 결과 */
|
|
26
|
+
dependencyResults: DependencyResult[];
|
|
27
|
+
/** 태스크 시작 시간 */
|
|
28
|
+
taskStartTime: number;
|
|
29
|
+
/** Lane 시작 시간 */
|
|
30
|
+
laneStartTime: number;
|
|
31
|
+
/** Run Root (lanes 디렉토리의 부모) */
|
|
32
|
+
runRoot?: string;
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* HookDataAccessor 구현체
|
|
36
|
+
*/
|
|
37
|
+
export declare class HookDataAccessorImpl implements HookDataAccessor {
|
|
38
|
+
private options;
|
|
39
|
+
private cachedChangedFiles;
|
|
40
|
+
private cachedDiff;
|
|
41
|
+
private cachedMessages;
|
|
42
|
+
private cachedToolCalls;
|
|
43
|
+
private cachedRawOutput;
|
|
44
|
+
constructor(options: DataAccessorOptions);
|
|
45
|
+
git: {
|
|
46
|
+
getChangedFiles: () => Promise<ChangedFile[]>;
|
|
47
|
+
getDiff: () => Promise<string>;
|
|
48
|
+
getRecentCommits: (count?: number) => Promise<Commit[]>;
|
|
49
|
+
getCurrentBranch: () => string;
|
|
50
|
+
getConflictFiles: () => Promise<string[]>;
|
|
51
|
+
};
|
|
52
|
+
conversation: {
|
|
53
|
+
getCurrentTaskMessages: () => Promise<Message[]>;
|
|
54
|
+
getAllMessages: () => Promise<Message[]>;
|
|
55
|
+
getRecentMessages: (count?: number) => Promise<Message[]>;
|
|
56
|
+
getLastResponse: () => Promise<string | null>;
|
|
57
|
+
};
|
|
58
|
+
tasks: {
|
|
59
|
+
getCompletedTasks: () => TaskResult[];
|
|
60
|
+
getPendingTasks: () => TaskDefinition[];
|
|
61
|
+
getTaskResult: (taskName: string) => TaskResult | null;
|
|
62
|
+
getDependencyResults: () => DependencyResult[];
|
|
63
|
+
};
|
|
64
|
+
logs: {
|
|
65
|
+
getRawOutput: () => Promise<string>;
|
|
66
|
+
getToolCalls: () => Promise<ToolCall[]>;
|
|
67
|
+
getErrors: () => Promise<ErrorLog[]>;
|
|
68
|
+
};
|
|
69
|
+
get timing(): {
|
|
70
|
+
taskStartTime: number;
|
|
71
|
+
laneStartTime: number;
|
|
72
|
+
getElapsedTime: () => number;
|
|
73
|
+
};
|
|
74
|
+
/**
|
|
75
|
+
* 캐시 초기화
|
|
76
|
+
*/
|
|
77
|
+
clearCache(): void;
|
|
78
|
+
/**
|
|
79
|
+
* 옵션 업데이트 (태스크 변경 시)
|
|
80
|
+
*/
|
|
81
|
+
updateOptions(updates: Partial<DataAccessorOptions>): void;
|
|
82
|
+
}
|
|
83
|
+
/**
|
|
84
|
+
* HookDataAccessor 인스턴스 생성
|
|
85
|
+
*/
|
|
86
|
+
export declare function createDataAccessor(options: DataAccessorOptions): HookDataAccessor;
|