pm-orchestrator-runner 1.0.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/LICENSE +21 -0
- package/README.md +108 -0
- package/dist/cli/cli-interface.d.ts +150 -0
- package/dist/cli/cli-interface.d.ts.map +1 -0
- package/dist/cli/cli-interface.js +606 -0
- package/dist/cli/cli-interface.js.map +1 -0
- package/dist/cli/index.d.ts +13 -0
- package/dist/cli/index.d.ts.map +1 -0
- package/dist/cli/index.js +243 -0
- package/dist/cli/index.js.map +1 -0
- package/dist/cli/llm-sentinel.d.ts +15 -0
- package/dist/cli/llm-sentinel.d.ts.map +1 -0
- package/dist/cli/llm-sentinel.js +184 -0
- package/dist/cli/llm-sentinel.js.map +1 -0
- package/dist/config/configuration-manager.d.ts +149 -0
- package/dist/config/configuration-manager.d.ts.map +1 -0
- package/dist/config/configuration-manager.js +241 -0
- package/dist/config/configuration-manager.js.map +1 -0
- package/dist/continuation/continuation-control-manager.d.ts +154 -0
- package/dist/continuation/continuation-control-manager.d.ts.map +1 -0
- package/dist/continuation/continuation-control-manager.js +303 -0
- package/dist/continuation/continuation-control-manager.js.map +1 -0
- package/dist/core/runner-core.d.ts +474 -0
- package/dist/core/runner-core.d.ts.map +1 -0
- package/dist/core/runner-core.js +1311 -0
- package/dist/core/runner-core.js.map +1 -0
- package/dist/errors/error-codes.d.ts +105 -0
- package/dist/errors/error-codes.d.ts.map +1 -0
- package/dist/errors/error-codes.js +198 -0
- package/dist/errors/error-codes.js.map +1 -0
- package/dist/errors/runner-error.d.ts +14 -0
- package/dist/errors/runner-error.d.ts.map +1 -0
- package/dist/errors/runner-error.js +33 -0
- package/dist/errors/runner-error.js.map +1 -0
- package/dist/evidence/evidence-manager.d.ts +112 -0
- package/dist/evidence/evidence-manager.d.ts.map +1 -0
- package/dist/evidence/evidence-manager.js +337 -0
- package/dist/evidence/evidence-manager.js.map +1 -0
- package/dist/executor/claude-code-executor.d.ts +136 -0
- package/dist/executor/claude-code-executor.d.ts.map +1 -0
- package/dist/executor/claude-code-executor.js +643 -0
- package/dist/executor/claude-code-executor.js.map +1 -0
- package/dist/executor/deterministic-executor.d.ts +40 -0
- package/dist/executor/deterministic-executor.d.ts.map +1 -0
- package/dist/executor/deterministic-executor.js +269 -0
- package/dist/executor/deterministic-executor.js.map +1 -0
- package/dist/lifecycle/lifecycle-controller.d.ts +270 -0
- package/dist/lifecycle/lifecycle-controller.d.ts.map +1 -0
- package/dist/lifecycle/lifecycle-controller.js +596 -0
- package/dist/lifecycle/lifecycle-controller.js.map +1 -0
- package/dist/limits/resource-limit-manager.d.ts +200 -0
- package/dist/limits/resource-limit-manager.d.ts.map +1 -0
- package/dist/limits/resource-limit-manager.js +376 -0
- package/dist/limits/resource-limit-manager.js.map +1 -0
- package/dist/locks/lock-manager.d.ts +116 -0
- package/dist/locks/lock-manager.d.ts.map +1 -0
- package/dist/locks/lock-manager.js +306 -0
- package/dist/locks/lock-manager.js.map +1 -0
- package/dist/logging/index.d.ts +8 -0
- package/dist/logging/index.d.ts.map +1 -0
- package/dist/logging/index.js +22 -0
- package/dist/logging/index.js.map +1 -0
- package/dist/logging/sensitive-data-masker.d.ts +90 -0
- package/dist/logging/sensitive-data-masker.d.ts.map +1 -0
- package/dist/logging/sensitive-data-masker.js +228 -0
- package/dist/logging/sensitive-data-masker.js.map +1 -0
- package/dist/logging/task-log-manager.d.ts +215 -0
- package/dist/logging/task-log-manager.d.ts.map +1 -0
- package/dist/logging/task-log-manager.js +743 -0
- package/dist/logging/task-log-manager.js.map +1 -0
- package/dist/mediation/fail-closed-runner.d.ts +131 -0
- package/dist/mediation/fail-closed-runner.d.ts.map +1 -0
- package/dist/mediation/fail-closed-runner.js +245 -0
- package/dist/mediation/fail-closed-runner.js.map +1 -0
- package/dist/mediation/llm-client-with-evidence.d.ts +123 -0
- package/dist/mediation/llm-client-with-evidence.d.ts.map +1 -0
- package/dist/mediation/llm-client-with-evidence.js +245 -0
- package/dist/mediation/llm-client-with-evidence.js.map +1 -0
- package/dist/mediation/llm-client.d.ts +102 -0
- package/dist/mediation/llm-client.d.ts.map +1 -0
- package/dist/mediation/llm-client.js +206 -0
- package/dist/mediation/llm-client.js.map +1 -0
- package/dist/mediation/llm-evidence-manager.d.ts +108 -0
- package/dist/mediation/llm-evidence-manager.d.ts.map +1 -0
- package/dist/mediation/llm-evidence-manager.js +230 -0
- package/dist/mediation/llm-evidence-manager.js.map +1 -0
- package/dist/mediation/llm-mediation-layer.d.ts +175 -0
- package/dist/mediation/llm-mediation-layer.d.ts.map +1 -0
- package/dist/mediation/llm-mediation-layer.js +315 -0
- package/dist/mediation/llm-mediation-layer.js.map +1 -0
- package/dist/mediation/llm-sentinel.d.ts +107 -0
- package/dist/mediation/llm-sentinel.d.ts.map +1 -0
- package/dist/mediation/llm-sentinel.js +187 -0
- package/dist/mediation/llm-sentinel.js.map +1 -0
- package/dist/mediation/real-llm-mediation-layer.d.ts +104 -0
- package/dist/mediation/real-llm-mediation-layer.d.ts.map +1 -0
- package/dist/mediation/real-llm-mediation-layer.js +322 -0
- package/dist/mediation/real-llm-mediation-layer.js.map +1 -0
- package/dist/mediation/verdict-reporter.d.ts +61 -0
- package/dist/mediation/verdict-reporter.d.ts.map +1 -0
- package/dist/mediation/verdict-reporter.js +178 -0
- package/dist/mediation/verdict-reporter.js.map +1 -0
- package/dist/models/enums.d.ts +133 -0
- package/dist/models/enums.d.ts.map +1 -0
- package/dist/models/enums.js +201 -0
- package/dist/models/enums.js.map +1 -0
- package/dist/models/evidence.d.ts +60 -0
- package/dist/models/evidence.d.ts.map +1 -0
- package/dist/models/evidence.js +135 -0
- package/dist/models/evidence.js.map +1 -0
- package/dist/models/execution-result.d.ts +89 -0
- package/dist/models/execution-result.d.ts.map +1 -0
- package/dist/models/execution-result.js +197 -0
- package/dist/models/execution-result.js.map +1 -0
- package/dist/models/file-lock.d.ts +62 -0
- package/dist/models/file-lock.d.ts.map +1 -0
- package/dist/models/file-lock.js +133 -0
- package/dist/models/file-lock.js.map +1 -0
- package/dist/models/index.d.ts +12 -0
- package/dist/models/index.d.ts.map +1 -0
- package/dist/models/index.js +91 -0
- package/dist/models/index.js.map +1 -0
- package/dist/models/repl/index.d.ts +7 -0
- package/dist/models/repl/index.d.ts.map +1 -0
- package/dist/models/repl/index.js +32 -0
- package/dist/models/repl/index.js.map +1 -0
- package/dist/models/repl/model-registry.d.ts +73 -0
- package/dist/models/repl/model-registry.d.ts.map +1 -0
- package/dist/models/repl/model-registry.js +116 -0
- package/dist/models/repl/model-registry.js.map +1 -0
- package/dist/models/repl/repl-state.d.ts +86 -0
- package/dist/models/repl/repl-state.d.ts.map +1 -0
- package/dist/models/repl/repl-state.js +152 -0
- package/dist/models/repl/repl-state.js.map +1 -0
- package/dist/models/repl/task-log.d.ts +247 -0
- package/dist/models/repl/task-log.d.ts.map +1 -0
- package/dist/models/repl/task-log.js +178 -0
- package/dist/models/repl/task-log.js.map +1 -0
- package/dist/models/session.d.ts +71 -0
- package/dist/models/session.d.ts.map +1 -0
- package/dist/models/session.js +140 -0
- package/dist/models/session.js.map +1 -0
- package/dist/models/supporting.d.ts +97 -0
- package/dist/models/supporting.d.ts.map +1 -0
- package/dist/models/supporting.js +208 -0
- package/dist/models/supporting.js.map +1 -0
- package/dist/models/task.d.ts +77 -0
- package/dist/models/task.d.ts.map +1 -0
- package/dist/models/task.js +170 -0
- package/dist/models/task.js.map +1 -0
- package/dist/output/output-control-manager.d.ts +217 -0
- package/dist/output/output-control-manager.d.ts.map +1 -0
- package/dist/output/output-control-manager.js +378 -0
- package/dist/output/output-control-manager.js.map +1 -0
- package/dist/pool/agent-pool.d.ts +284 -0
- package/dist/pool/agent-pool.d.ts.map +1 -0
- package/dist/pool/agent-pool.js +451 -0
- package/dist/pool/agent-pool.js.map +1 -0
- package/dist/repl/commands/index.d.ts +12 -0
- package/dist/repl/commands/index.d.ts.map +1 -0
- package/dist/repl/commands/index.js +26 -0
- package/dist/repl/commands/index.js.map +1 -0
- package/dist/repl/commands/init.d.ts +31 -0
- package/dist/repl/commands/init.d.ts.map +1 -0
- package/dist/repl/commands/init.js +234 -0
- package/dist/repl/commands/init.js.map +1 -0
- package/dist/repl/commands/keys.d.ts +63 -0
- package/dist/repl/commands/keys.d.ts.map +1 -0
- package/dist/repl/commands/keys.js +114 -0
- package/dist/repl/commands/keys.js.map +1 -0
- package/dist/repl/commands/logs.d.ts +91 -0
- package/dist/repl/commands/logs.d.ts.map +1 -0
- package/dist/repl/commands/logs.js +200 -0
- package/dist/repl/commands/logs.js.map +1 -0
- package/dist/repl/commands/model.d.ts +85 -0
- package/dist/repl/commands/model.d.ts.map +1 -0
- package/dist/repl/commands/model.js +225 -0
- package/dist/repl/commands/model.js.map +1 -0
- package/dist/repl/commands/models.d.ts +50 -0
- package/dist/repl/commands/models.d.ts.map +1 -0
- package/dist/repl/commands/models.js +180 -0
- package/dist/repl/commands/models.js.map +1 -0
- package/dist/repl/commands/provider.d.ts +79 -0
- package/dist/repl/commands/provider.d.ts.map +1 -0
- package/dist/repl/commands/provider.js +291 -0
- package/dist/repl/commands/provider.js.map +1 -0
- package/dist/repl/commands/session.d.ts +50 -0
- package/dist/repl/commands/session.d.ts.map +1 -0
- package/dist/repl/commands/session.js +152 -0
- package/dist/repl/commands/session.js.map +1 -0
- package/dist/repl/commands/status.d.ts +55 -0
- package/dist/repl/commands/status.d.ts.map +1 -0
- package/dist/repl/commands/status.js +182 -0
- package/dist/repl/commands/status.js.map +1 -0
- package/dist/repl/index.d.ts +6 -0
- package/dist/repl/index.d.ts.map +1 -0
- package/dist/repl/index.js +25 -0
- package/dist/repl/index.js.map +1 -0
- package/dist/repl/repl-interface.d.ts +371 -0
- package/dist/repl/repl-interface.d.ts.map +1 -0
- package/dist/repl/repl-interface.js +1214 -0
- package/dist/repl/repl-interface.js.map +1 -0
- package/dist/session/session-manager.d.ts +85 -0
- package/dist/session/session-manager.d.ts.map +1 -0
- package/dist/session/session-manager.js +217 -0
- package/dist/session/session-manager.js.map +1 -0
- package/dist/supervisor/executor-supervisor.d.ts +90 -0
- package/dist/supervisor/executor-supervisor.d.ts.map +1 -0
- package/dist/supervisor/executor-supervisor.js +223 -0
- package/dist/supervisor/executor-supervisor.js.map +1 -0
- package/dist/supervisor/index.d.ts +5 -0
- package/dist/supervisor/index.d.ts.map +1 -0
- package/dist/supervisor/index.js +9 -0
- package/dist/supervisor/index.js.map +1 -0
- package/package.json +57 -0
|
@@ -0,0 +1,217 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Output Control Manager
|
|
3
|
+
* Based on 06_CORRECTNESS_PROPERTIES.md L141-147 (Property 15)
|
|
4
|
+
*
|
|
5
|
+
* Property 15: Output Control and Validation
|
|
6
|
+
* - All Claude Code output must be validated by Runner
|
|
7
|
+
* - Output without evidence, speculative expressions, direct communication are rejected
|
|
8
|
+
*
|
|
9
|
+
* Responsible for:
|
|
10
|
+
* - JSON-structured output
|
|
11
|
+
* - next_action field determination
|
|
12
|
+
* - incomplete_task_reasons
|
|
13
|
+
* - Output validation
|
|
14
|
+
* - Evidence summary
|
|
15
|
+
* - Error output formatting
|
|
16
|
+
* - Progress output
|
|
17
|
+
* - Output streaming (NDJSON)
|
|
18
|
+
* - Output destinations
|
|
19
|
+
* - Report generation
|
|
20
|
+
* - Output redaction
|
|
21
|
+
* - Exit codes
|
|
22
|
+
*/
|
|
23
|
+
import { OverallStatus, TaskStatus } from '../models/enums';
|
|
24
|
+
import { ErrorCode } from '../errors/error-codes';
|
|
25
|
+
/**
|
|
26
|
+
* Output Control Manager Error
|
|
27
|
+
*/
|
|
28
|
+
export declare class OutputControlError extends Error {
|
|
29
|
+
readonly code: ErrorCode;
|
|
30
|
+
readonly details?: Record<string, unknown>;
|
|
31
|
+
constructor(code: ErrorCode, message?: string, details?: Record<string, unknown>);
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Format options interface
|
|
35
|
+
*/
|
|
36
|
+
interface FormatOptions {
|
|
37
|
+
compact?: boolean;
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* Incomplete task interface
|
|
41
|
+
*/
|
|
42
|
+
interface IncompleteTask {
|
|
43
|
+
task_id: string;
|
|
44
|
+
reason: string;
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* Evidence interface
|
|
48
|
+
*/
|
|
49
|
+
interface Evidence {
|
|
50
|
+
files_collected: number;
|
|
51
|
+
hash: string;
|
|
52
|
+
index_hash?: string;
|
|
53
|
+
location: string;
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* Error info interface
|
|
57
|
+
*/
|
|
58
|
+
interface ErrorInfo {
|
|
59
|
+
code: ErrorCode;
|
|
60
|
+
message: string;
|
|
61
|
+
stack?: string;
|
|
62
|
+
}
|
|
63
|
+
/**
|
|
64
|
+
* Output result interface
|
|
65
|
+
*/
|
|
66
|
+
interface OutputResult {
|
|
67
|
+
session_id: string;
|
|
68
|
+
overall_status: OverallStatus;
|
|
69
|
+
tasks_completed?: number;
|
|
70
|
+
tasks_total?: number;
|
|
71
|
+
evidence_hash?: string;
|
|
72
|
+
incomplete_tasks?: IncompleteTask[];
|
|
73
|
+
evidence?: Evidence;
|
|
74
|
+
error?: ErrorInfo;
|
|
75
|
+
error_message?: string;
|
|
76
|
+
config?: Record<string, unknown>;
|
|
77
|
+
}
|
|
78
|
+
/**
|
|
79
|
+
* Progress update interface
|
|
80
|
+
*/
|
|
81
|
+
interface ProgressUpdate {
|
|
82
|
+
session_id: string;
|
|
83
|
+
current_phase: string;
|
|
84
|
+
tasks_completed: number;
|
|
85
|
+
tasks_total: number;
|
|
86
|
+
elapsed_seconds?: number;
|
|
87
|
+
estimated_remaining_seconds?: number;
|
|
88
|
+
}
|
|
89
|
+
/**
|
|
90
|
+
* Phase info interface
|
|
91
|
+
*/
|
|
92
|
+
interface PhaseInfo {
|
|
93
|
+
name: string;
|
|
94
|
+
status: string;
|
|
95
|
+
duration_seconds: number;
|
|
96
|
+
}
|
|
97
|
+
/**
|
|
98
|
+
* Task info interface
|
|
99
|
+
*/
|
|
100
|
+
interface TaskInfo {
|
|
101
|
+
id: string;
|
|
102
|
+
status: TaskStatus;
|
|
103
|
+
duration_seconds: number;
|
|
104
|
+
}
|
|
105
|
+
/**
|
|
106
|
+
* Execution result interface
|
|
107
|
+
*/
|
|
108
|
+
interface ExecutionResult {
|
|
109
|
+
session_id: string;
|
|
110
|
+
overall_status: OverallStatus;
|
|
111
|
+
started_at: string;
|
|
112
|
+
completed_at: string;
|
|
113
|
+
tasks_completed: number;
|
|
114
|
+
tasks_total: number;
|
|
115
|
+
phases?: PhaseInfo[];
|
|
116
|
+
tasks?: TaskInfo[];
|
|
117
|
+
}
|
|
118
|
+
/**
|
|
119
|
+
* Report interface
|
|
120
|
+
*/
|
|
121
|
+
interface Report {
|
|
122
|
+
session_id: string;
|
|
123
|
+
overall_status: OverallStatus;
|
|
124
|
+
duration_seconds: number;
|
|
125
|
+
phases?: PhaseInfo[];
|
|
126
|
+
task_summary?: {
|
|
127
|
+
completed: number;
|
|
128
|
+
total: number;
|
|
129
|
+
};
|
|
130
|
+
}
|
|
131
|
+
/**
|
|
132
|
+
* Output callback type
|
|
133
|
+
*/
|
|
134
|
+
type OutputCallback = (output: string) => void;
|
|
135
|
+
/**
|
|
136
|
+
* Output Control Manager class
|
|
137
|
+
*/
|
|
138
|
+
export declare class OutputControlManager {
|
|
139
|
+
private debugMode;
|
|
140
|
+
private redactionEnabled;
|
|
141
|
+
private streamingEnabled;
|
|
142
|
+
private destination;
|
|
143
|
+
private outputCallbacks;
|
|
144
|
+
/**
|
|
145
|
+
* Create a new OutputControlManager
|
|
146
|
+
*/
|
|
147
|
+
constructor();
|
|
148
|
+
/**
|
|
149
|
+
* Set debug mode
|
|
150
|
+
*/
|
|
151
|
+
setDebugMode(enabled: boolean): void;
|
|
152
|
+
/**
|
|
153
|
+
* Set redaction enabled
|
|
154
|
+
*/
|
|
155
|
+
setRedactionEnabled(enabled: boolean): void;
|
|
156
|
+
/**
|
|
157
|
+
* Enable streaming output
|
|
158
|
+
*/
|
|
159
|
+
enableStreaming(enabled: boolean): void;
|
|
160
|
+
/**
|
|
161
|
+
* Register output callback
|
|
162
|
+
*/
|
|
163
|
+
onOutput(callback: OutputCallback): void;
|
|
164
|
+
/**
|
|
165
|
+
* Get default destination
|
|
166
|
+
*/
|
|
167
|
+
getDefaultDestination(): string;
|
|
168
|
+
/**
|
|
169
|
+
* Set output destination
|
|
170
|
+
* @throws OutputControlError if path is not writable
|
|
171
|
+
*/
|
|
172
|
+
setDestination(filePath: string): void;
|
|
173
|
+
/**
|
|
174
|
+
* Get current destination
|
|
175
|
+
*/
|
|
176
|
+
getDestination(): string;
|
|
177
|
+
/**
|
|
178
|
+
* Validate output result
|
|
179
|
+
* @throws OutputControlError if validation fails
|
|
180
|
+
*/
|
|
181
|
+
private validateResult;
|
|
182
|
+
/**
|
|
183
|
+
* Determine next_action based on status
|
|
184
|
+
*/
|
|
185
|
+
private determineNextAction;
|
|
186
|
+
/**
|
|
187
|
+
* Get reason for next_action
|
|
188
|
+
*/
|
|
189
|
+
private getNextActionReason;
|
|
190
|
+
/**
|
|
191
|
+
* Redact sensitive information from an object
|
|
192
|
+
*/
|
|
193
|
+
private redactSensitiveData;
|
|
194
|
+
/**
|
|
195
|
+
* Format output result as JSON
|
|
196
|
+
* @throws OutputControlError if validation fails
|
|
197
|
+
*/
|
|
198
|
+
formatOutput(result: OutputResult, options?: FormatOptions): string;
|
|
199
|
+
/**
|
|
200
|
+
* Format progress update
|
|
201
|
+
*/
|
|
202
|
+
formatProgress(progressUpdate: ProgressUpdate): string;
|
|
203
|
+
/**
|
|
204
|
+
* Emit progress in streaming mode
|
|
205
|
+
*/
|
|
206
|
+
emitProgress(progressUpdate: ProgressUpdate): void;
|
|
207
|
+
/**
|
|
208
|
+
* Generate final execution report
|
|
209
|
+
*/
|
|
210
|
+
generateReport(executionResult: ExecutionResult): Report;
|
|
211
|
+
/**
|
|
212
|
+
* Get exit code for a status
|
|
213
|
+
*/
|
|
214
|
+
getExitCode(status: OverallStatus): number;
|
|
215
|
+
}
|
|
216
|
+
export {};
|
|
217
|
+
//# sourceMappingURL=output-control-manager.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"output-control-manager.d.ts","sourceRoot":"","sources":["../../src/output/output-control-manager.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAIH,OAAO,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAC5D,OAAO,EAAE,SAAS,EAAmB,MAAM,uBAAuB,CAAC;AAEnE;;GAEG;AACH,qBAAa,kBAAmB,SAAQ,KAAK;IAC3C,SAAgB,IAAI,EAAE,SAAS,CAAC;IAChC,SAAgB,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;gBAEtC,IAAI,EAAE,SAAS,EAAE,OAAO,CAAC,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;CAMjF;AAED;;GAEG;AACH,UAAU,aAAa;IACrB,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AAED;;GAEG;AACH,UAAU,cAAc;IACtB,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,MAAM,CAAC;CAChB;AAED;;GAEG;AACH,UAAU,QAAQ;IAChB,eAAe,EAAE,MAAM,CAAC;IACxB,IAAI,EAAE,MAAM,CAAC;IACb,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED;;GAEG;AACH,UAAU,SAAS;IACjB,IAAI,EAAE,SAAS,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED;;GAEG;AACH,UAAU,YAAY;IACpB,UAAU,EAAE,MAAM,CAAC;IACnB,cAAc,EAAE,aAAa,CAAC;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IACH,cAAc,CAAC,eAAe,EAAE,eAAe,GAAG,MAAM;IAyBxD;;OAEG;IACH,WAAW,CAAC,MAAM,EAAE,aAAa,GAAG,MAAM;CAG3C"}
|
|
@@ -0,0 +1,378 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Output Control Manager
|
|
4
|
+
* Based on 06_CORRECTNESS_PROPERTIES.md L141-147 (Property 15)
|
|
5
|
+
*
|
|
6
|
+
* Property 15: Output Control and Validation
|
|
7
|
+
* - All Claude Code output must be validated by Runner
|
|
8
|
+
* - Output without evidence, speculative expressions, direct communication are rejected
|
|
9
|
+
*
|
|
10
|
+
* Responsible for:
|
|
11
|
+
* - JSON-structured output
|
|
12
|
+
* - next_action field determination
|
|
13
|
+
* - incomplete_task_reasons
|
|
14
|
+
* - Output validation
|
|
15
|
+
* - Evidence summary
|
|
16
|
+
* - Error output formatting
|
|
17
|
+
* - Progress output
|
|
18
|
+
* - Output streaming (NDJSON)
|
|
19
|
+
* - Output destinations
|
|
20
|
+
* - Report generation
|
|
21
|
+
* - Output redaction
|
|
22
|
+
* - Exit codes
|
|
23
|
+
*/
|
|
24
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
25
|
+
if (k2 === undefined) k2 = k;
|
|
26
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
27
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
28
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
29
|
+
}
|
|
30
|
+
Object.defineProperty(o, k2, desc);
|
|
31
|
+
}) : (function(o, m, k, k2) {
|
|
32
|
+
if (k2 === undefined) k2 = k;
|
|
33
|
+
o[k2] = m[k];
|
|
34
|
+
}));
|
|
35
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
36
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
37
|
+
}) : function(o, v) {
|
|
38
|
+
o["default"] = v;
|
|
39
|
+
});
|
|
40
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
41
|
+
var ownKeys = function(o) {
|
|
42
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
43
|
+
var ar = [];
|
|
44
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
45
|
+
return ar;
|
|
46
|
+
};
|
|
47
|
+
return ownKeys(o);
|
|
48
|
+
};
|
|
49
|
+
return function (mod) {
|
|
50
|
+
if (mod && mod.__esModule) return mod;
|
|
51
|
+
var result = {};
|
|
52
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
53
|
+
__setModuleDefault(result, mod);
|
|
54
|
+
return result;
|
|
55
|
+
};
|
|
56
|
+
})();
|
|
57
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
58
|
+
exports.OutputControlManager = exports.OutputControlError = void 0;
|
|
59
|
+
const fs = __importStar(require("fs"));
|
|
60
|
+
const path = __importStar(require("path"));
|
|
61
|
+
const enums_1 = require("../models/enums");
|
|
62
|
+
const error_codes_1 = require("../errors/error-codes");
|
|
63
|
+
/**
|
|
64
|
+
* Output Control Manager Error
|
|
65
|
+
*/
|
|
66
|
+
class OutputControlError extends Error {
|
|
67
|
+
code;
|
|
68
|
+
details;
|
|
69
|
+
constructor(code, message, details) {
|
|
70
|
+
super(message || (0, error_codes_1.getErrorMessage)(code));
|
|
71
|
+
this.name = 'OutputControlError';
|
|
72
|
+
this.code = code;
|
|
73
|
+
this.details = details;
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
exports.OutputControlError = OutputControlError;
|
|
77
|
+
/**
|
|
78
|
+
* Sensitive field patterns for redaction
|
|
79
|
+
*/
|
|
80
|
+
const SENSITIVE_PATTERNS = [
|
|
81
|
+
'api_key',
|
|
82
|
+
'apikey',
|
|
83
|
+
'token',
|
|
84
|
+
'secret',
|
|
85
|
+
'password',
|
|
86
|
+
'credential',
|
|
87
|
+
'auth',
|
|
88
|
+
'bearer',
|
|
89
|
+
];
|
|
90
|
+
/**
|
|
91
|
+
* Exit codes for different statuses
|
|
92
|
+
*/
|
|
93
|
+
const EXIT_CODES = {
|
|
94
|
+
[enums_1.OverallStatus.COMPLETE]: 0,
|
|
95
|
+
[enums_1.OverallStatus.INCOMPLETE]: 1,
|
|
96
|
+
[enums_1.OverallStatus.NO_EVIDENCE]: 2,
|
|
97
|
+
[enums_1.OverallStatus.ERROR]: 3,
|
|
98
|
+
[enums_1.OverallStatus.INVALID]: 4,
|
|
99
|
+
};
|
|
100
|
+
/**
|
|
101
|
+
* Valid OverallStatus values
|
|
102
|
+
*/
|
|
103
|
+
const VALID_STATUSES = Object.values(enums_1.OverallStatus);
|
|
104
|
+
/**
|
|
105
|
+
* Output Control Manager class
|
|
106
|
+
*/
|
|
107
|
+
class OutputControlManager {
|
|
108
|
+
debugMode = false;
|
|
109
|
+
redactionEnabled = true;
|
|
110
|
+
streamingEnabled = false;
|
|
111
|
+
destination = 'stdout';
|
|
112
|
+
outputCallbacks = [];
|
|
113
|
+
/**
|
|
114
|
+
* Create a new OutputControlManager
|
|
115
|
+
*/
|
|
116
|
+
constructor() {
|
|
117
|
+
// Default configuration
|
|
118
|
+
}
|
|
119
|
+
/**
|
|
120
|
+
* Set debug mode
|
|
121
|
+
*/
|
|
122
|
+
setDebugMode(enabled) {
|
|
123
|
+
this.debugMode = enabled;
|
|
124
|
+
}
|
|
125
|
+
/**
|
|
126
|
+
* Set redaction enabled
|
|
127
|
+
*/
|
|
128
|
+
setRedactionEnabled(enabled) {
|
|
129
|
+
this.redactionEnabled = enabled;
|
|
130
|
+
}
|
|
131
|
+
/**
|
|
132
|
+
* Enable streaming output
|
|
133
|
+
*/
|
|
134
|
+
enableStreaming(enabled) {
|
|
135
|
+
this.streamingEnabled = enabled;
|
|
136
|
+
}
|
|
137
|
+
/**
|
|
138
|
+
* Register output callback
|
|
139
|
+
*/
|
|
140
|
+
onOutput(callback) {
|
|
141
|
+
this.outputCallbacks.push(callback);
|
|
142
|
+
}
|
|
143
|
+
/**
|
|
144
|
+
* Get default destination
|
|
145
|
+
*/
|
|
146
|
+
getDefaultDestination() {
|
|
147
|
+
return 'stdout';
|
|
148
|
+
}
|
|
149
|
+
/**
|
|
150
|
+
* Set output destination
|
|
151
|
+
* @throws OutputControlError if path is not writable
|
|
152
|
+
*/
|
|
153
|
+
setDestination(filePath) {
|
|
154
|
+
// Validate that the directory exists and is writable
|
|
155
|
+
const dir = path.dirname(filePath);
|
|
156
|
+
try {
|
|
157
|
+
fs.accessSync(dir, fs.constants.W_OK);
|
|
158
|
+
}
|
|
159
|
+
catch {
|
|
160
|
+
throw new OutputControlError(error_codes_1.ErrorCode.E208_OUTPUT_VALIDATION_FAILED, `Output destination is not writable: ${filePath}`, { path: filePath });
|
|
161
|
+
}
|
|
162
|
+
this.destination = filePath;
|
|
163
|
+
}
|
|
164
|
+
/**
|
|
165
|
+
* Get current destination
|
|
166
|
+
*/
|
|
167
|
+
getDestination() {
|
|
168
|
+
return this.destination;
|
|
169
|
+
}
|
|
170
|
+
/**
|
|
171
|
+
* Validate output result
|
|
172
|
+
* @throws OutputControlError if validation fails
|
|
173
|
+
*/
|
|
174
|
+
validateResult(result, strict = false) {
|
|
175
|
+
// Check required fields
|
|
176
|
+
if (!result.session_id) {
|
|
177
|
+
throw new OutputControlError(error_codes_1.ErrorCode.E208_OUTPUT_VALIDATION_FAILED, 'Missing required field: session_id', { result });
|
|
178
|
+
}
|
|
179
|
+
if (result.overall_status === undefined) {
|
|
180
|
+
throw new OutputControlError(error_codes_1.ErrorCode.E208_OUTPUT_VALIDATION_FAILED, 'Missing required field: overall_status', { result });
|
|
181
|
+
}
|
|
182
|
+
// Validate overall_status is a valid enum value
|
|
183
|
+
if (!VALID_STATUSES.includes(result.overall_status)) {
|
|
184
|
+
throw new OutputControlError(error_codes_1.ErrorCode.E208_OUTPUT_VALIDATION_FAILED, `Invalid overall_status: ${result.overall_status}`, { result });
|
|
185
|
+
}
|
|
186
|
+
// In strict mode, require tasks_completed and tasks_total
|
|
187
|
+
if (strict) {
|
|
188
|
+
if (result.tasks_completed === undefined) {
|
|
189
|
+
throw new OutputControlError(error_codes_1.ErrorCode.E208_OUTPUT_VALIDATION_FAILED, 'Missing required field: tasks_completed', { result });
|
|
190
|
+
}
|
|
191
|
+
if (result.tasks_total === undefined) {
|
|
192
|
+
throw new OutputControlError(error_codes_1.ErrorCode.E208_OUTPUT_VALIDATION_FAILED, 'Missing required field: tasks_total', { result });
|
|
193
|
+
}
|
|
194
|
+
}
|
|
195
|
+
// Validate tasks_completed <= tasks_total when both are provided
|
|
196
|
+
if (result.tasks_completed !== undefined && result.tasks_total !== undefined) {
|
|
197
|
+
if (result.tasks_completed > result.tasks_total) {
|
|
198
|
+
throw new OutputControlError(error_codes_1.ErrorCode.E208_OUTPUT_VALIDATION_FAILED, `tasks_completed (${result.tasks_completed}) cannot exceed tasks_total (${result.tasks_total})`, { result });
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
}
|
|
202
|
+
/**
|
|
203
|
+
* Determine next_action based on status
|
|
204
|
+
*/
|
|
205
|
+
determineNextAction(status) {
|
|
206
|
+
return status === enums_1.OverallStatus.COMPLETE;
|
|
207
|
+
}
|
|
208
|
+
/**
|
|
209
|
+
* Get reason for next_action
|
|
210
|
+
*/
|
|
211
|
+
getNextActionReason(status, errorMessage) {
|
|
212
|
+
switch (status) {
|
|
213
|
+
case enums_1.OverallStatus.COMPLETE:
|
|
214
|
+
return 'All tasks completed successfully';
|
|
215
|
+
case enums_1.OverallStatus.INCOMPLETE:
|
|
216
|
+
return 'Some tasks are incomplete';
|
|
217
|
+
case enums_1.OverallStatus.ERROR:
|
|
218
|
+
return errorMessage || 'An error occurred during execution';
|
|
219
|
+
case enums_1.OverallStatus.INVALID:
|
|
220
|
+
return 'Session status is invalid';
|
|
221
|
+
case enums_1.OverallStatus.NO_EVIDENCE:
|
|
222
|
+
return 'No evidence collected';
|
|
223
|
+
default:
|
|
224
|
+
return 'Unknown status';
|
|
225
|
+
}
|
|
226
|
+
}
|
|
227
|
+
/**
|
|
228
|
+
* Redact sensitive information from an object
|
|
229
|
+
*/
|
|
230
|
+
redactSensitiveData(obj) {
|
|
231
|
+
if (!this.redactionEnabled) {
|
|
232
|
+
return obj;
|
|
233
|
+
}
|
|
234
|
+
const result = {};
|
|
235
|
+
for (const [key, value] of Object.entries(obj)) {
|
|
236
|
+
const lowerKey = key.toLowerCase();
|
|
237
|
+
const isSensitive = SENSITIVE_PATTERNS.some(pattern => lowerKey.includes(pattern));
|
|
238
|
+
if (isSensitive && typeof value === 'string') {
|
|
239
|
+
result[key] = '[REDACTED]';
|
|
240
|
+
}
|
|
241
|
+
else if (value && typeof value === 'object' && !Array.isArray(value)) {
|
|
242
|
+
result[key] = this.redactSensitiveData(value);
|
|
243
|
+
}
|
|
244
|
+
else {
|
|
245
|
+
result[key] = value;
|
|
246
|
+
}
|
|
247
|
+
}
|
|
248
|
+
return result;
|
|
249
|
+
}
|
|
250
|
+
/**
|
|
251
|
+
* Format output result as JSON
|
|
252
|
+
* @throws OutputControlError if validation fails
|
|
253
|
+
*/
|
|
254
|
+
formatOutput(result, options) {
|
|
255
|
+
// Validate the result
|
|
256
|
+
this.validateResult(result);
|
|
257
|
+
// Build output object
|
|
258
|
+
const output = {
|
|
259
|
+
timestamp: new Date().toISOString(),
|
|
260
|
+
session_id: result.session_id,
|
|
261
|
+
overall_status: result.overall_status,
|
|
262
|
+
tasks_completed: result.tasks_completed,
|
|
263
|
+
tasks_total: result.tasks_total,
|
|
264
|
+
next_action: this.determineNextAction(result.overall_status),
|
|
265
|
+
next_action_reason: this.getNextActionReason(result.overall_status, result.error_message),
|
|
266
|
+
};
|
|
267
|
+
// Add evidence_hash if provided
|
|
268
|
+
if (result.evidence_hash) {
|
|
269
|
+
output.evidence_hash = result.evidence_hash;
|
|
270
|
+
}
|
|
271
|
+
// Add incomplete_task_reasons
|
|
272
|
+
if (result.incomplete_tasks) {
|
|
273
|
+
output.incomplete_task_reasons = result.incomplete_tasks;
|
|
274
|
+
}
|
|
275
|
+
else {
|
|
276
|
+
output.incomplete_task_reasons = [];
|
|
277
|
+
}
|
|
278
|
+
// Add evidence_summary if provided
|
|
279
|
+
if (result.evidence) {
|
|
280
|
+
output.evidence_summary = {
|
|
281
|
+
files_collected: result.evidence.files_collected,
|
|
282
|
+
hash: result.evidence.hash,
|
|
283
|
+
...(result.evidence.index_hash && { index_hash: result.evidence.index_hash }),
|
|
284
|
+
location: result.evidence.location,
|
|
285
|
+
};
|
|
286
|
+
}
|
|
287
|
+
// Add error if provided
|
|
288
|
+
if (result.error) {
|
|
289
|
+
output.error = {
|
|
290
|
+
code: result.error.code,
|
|
291
|
+
message: result.error.message,
|
|
292
|
+
...(this.debugMode && result.error.stack && { stack: result.error.stack }),
|
|
293
|
+
};
|
|
294
|
+
}
|
|
295
|
+
// Add config (redacted if needed)
|
|
296
|
+
if (result.config) {
|
|
297
|
+
output.config = this.redactSensitiveData(result.config);
|
|
298
|
+
}
|
|
299
|
+
// Format as JSON
|
|
300
|
+
const indent = options?.compact ? 0 : 2;
|
|
301
|
+
return JSON.stringify(output, null, indent);
|
|
302
|
+
}
|
|
303
|
+
/**
|
|
304
|
+
* Format progress update
|
|
305
|
+
*/
|
|
306
|
+
formatProgress(progressUpdate) {
|
|
307
|
+
const progressPercent = progressUpdate.tasks_total > 0
|
|
308
|
+
? Math.round((progressUpdate.tasks_completed / progressUpdate.tasks_total) * 100)
|
|
309
|
+
: 0;
|
|
310
|
+
const output = {
|
|
311
|
+
timestamp: new Date().toISOString(),
|
|
312
|
+
type: 'progress',
|
|
313
|
+
session_id: progressUpdate.session_id,
|
|
314
|
+
current_phase: progressUpdate.current_phase,
|
|
315
|
+
tasks_completed: progressUpdate.tasks_completed,
|
|
316
|
+
tasks_total: progressUpdate.tasks_total,
|
|
317
|
+
progress_percent: progressPercent,
|
|
318
|
+
};
|
|
319
|
+
if (progressUpdate.elapsed_seconds !== undefined) {
|
|
320
|
+
output.elapsed_seconds = progressUpdate.elapsed_seconds;
|
|
321
|
+
}
|
|
322
|
+
if (progressUpdate.estimated_remaining_seconds !== undefined) {
|
|
323
|
+
output.eta_seconds = progressUpdate.estimated_remaining_seconds;
|
|
324
|
+
}
|
|
325
|
+
return JSON.stringify(output, null, 2);
|
|
326
|
+
}
|
|
327
|
+
/**
|
|
328
|
+
* Emit progress in streaming mode
|
|
329
|
+
*/
|
|
330
|
+
emitProgress(progressUpdate) {
|
|
331
|
+
if (!this.streamingEnabled) {
|
|
332
|
+
return;
|
|
333
|
+
}
|
|
334
|
+
const output = JSON.stringify({
|
|
335
|
+
timestamp: new Date().toISOString(),
|
|
336
|
+
type: 'progress',
|
|
337
|
+
session_id: progressUpdate.session_id,
|
|
338
|
+
current_phase: progressUpdate.current_phase,
|
|
339
|
+
tasks_completed: progressUpdate.tasks_completed,
|
|
340
|
+
tasks_total: progressUpdate.tasks_total,
|
|
341
|
+
});
|
|
342
|
+
// Notify all callbacks
|
|
343
|
+
for (const callback of this.outputCallbacks) {
|
|
344
|
+
callback(output);
|
|
345
|
+
}
|
|
346
|
+
}
|
|
347
|
+
/**
|
|
348
|
+
* Generate final execution report
|
|
349
|
+
*/
|
|
350
|
+
generateReport(executionResult) {
|
|
351
|
+
const startedAt = new Date(executionResult.started_at);
|
|
352
|
+
const completedAt = new Date(executionResult.completed_at);
|
|
353
|
+
const durationSeconds = Math.round((completedAt.getTime() - startedAt.getTime()) / 1000);
|
|
354
|
+
const report = {
|
|
355
|
+
session_id: executionResult.session_id,
|
|
356
|
+
overall_status: executionResult.overall_status,
|
|
357
|
+
duration_seconds: durationSeconds,
|
|
358
|
+
};
|
|
359
|
+
if (executionResult.phases) {
|
|
360
|
+
report.phases = executionResult.phases;
|
|
361
|
+
}
|
|
362
|
+
if (executionResult.tasks || executionResult.tasks_total !== undefined) {
|
|
363
|
+
report.task_summary = {
|
|
364
|
+
completed: executionResult.tasks_completed,
|
|
365
|
+
total: executionResult.tasks_total,
|
|
366
|
+
};
|
|
367
|
+
}
|
|
368
|
+
return report;
|
|
369
|
+
}
|
|
370
|
+
/**
|
|
371
|
+
* Get exit code for a status
|
|
372
|
+
*/
|
|
373
|
+
getExitCode(status) {
|
|
374
|
+
return EXIT_CODES[status];
|
|
375
|
+
}
|
|
376
|
+
}
|
|
377
|
+
exports.OutputControlManager = OutputControlManager;
|
|
378
|
+
//# sourceMappingURL=output-control-manager.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"output-control-manager.js","sourceRoot":"","sources":["../../src/output/output-control-manager.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEH,uCAAyB;AACzB,2CAA6B;AAC7B,2CAA4D;AAC5D,uDAAmE;AAEnE;;GAEG;AACH,MAAa,kBAAmB,SAAQ,KAAK;IAC3B,IAAI,CAAY;IAChB,OAAO,CAA2B;IAElD,YAAY,IAAe,EAAE,OAAgB,EAAE,OAAiC;QAC9E,KAAK,CAAC,OAAO,IAAI,IAAA,6BAAe,EAAC,IAAI,CAAC,CAAC,CAAC;QACxC,IAAI,CAAC,IAAI,GAAG,oBAAoB,CAAC;QACjC,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;QACjB,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;IACzB,CAAC;CACF;AAVD,gDAUC;AAmHD;;GAEG;AACH,MAAM,kBAAkB,GAAG;IACzB,SAAS;IACT,QAAQ;IACR,OAAO;IACP,QAAQ;IACR,UAAU;IACV,YAAY;IACZ,MAAM;IACN,QAAQ;CACT,CAAC;AAEF;;GAEG;AACH,MAAM,UAAU,GAAkC;IAChD,CAAC,qBAAa,CAAC,QAAQ,CAAC,EAAE,CAAC;IAC3B,CAAC,qBAAa,CAAC,UAAU,CAAC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