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,371 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* REPL Interface for PM Orchestrator Runner
|
|
3
|
+
* Provides an interactive CLI experience with slash commands
|
|
4
|
+
*
|
|
5
|
+
* Supports two execution modes (per spec 10_REPL_UX.md):
|
|
6
|
+
* - Interactive mode: TTY connected, readline with prompt
|
|
7
|
+
* - Non-interactive mode: stdin script / heredoc / pipe
|
|
8
|
+
*
|
|
9
|
+
* Non-interactive mode guarantees:
|
|
10
|
+
* - Sequential Processing: Each command completes before next starts
|
|
11
|
+
* - Output Flush: All stdout is flushed before exit
|
|
12
|
+
* - Deterministic Exit Code: 0=COMPLETE, 1=ERROR, 2=INCOMPLETE
|
|
13
|
+
*
|
|
14
|
+
* Project Mode (per spec 10_REPL_UX.md, Property 32, 33):
|
|
15
|
+
* - temp: Use temporary directory (default, cleaned up on exit)
|
|
16
|
+
* - fixed: Use specified directory (persists after exit)
|
|
17
|
+
*/
|
|
18
|
+
import { EventEmitter } from 'events';
|
|
19
|
+
import { RunnerCore } from '../core/runner-core';
|
|
20
|
+
import { ExecutorSupervisor } from '../supervisor/executor-supervisor';
|
|
21
|
+
/**
|
|
22
|
+
* Project Mode - per spec 10_REPL_UX.md
|
|
23
|
+
* Controls how verification_root is determined
|
|
24
|
+
* - temp: Use temporary directory (default)
|
|
25
|
+
* - fixed: Use specified --project-root directory
|
|
26
|
+
*/
|
|
27
|
+
export type ProjectMode = 'temp' | 'fixed';
|
|
28
|
+
/**
|
|
29
|
+
* Verified File record - per spec 06_CORRECTNESS_PROPERTIES.md Property 33
|
|
30
|
+
* Records file verification result with traceability information
|
|
31
|
+
*/
|
|
32
|
+
export interface VerifiedFile {
|
|
33
|
+
/** Path relative to verification_root */
|
|
34
|
+
path: string;
|
|
35
|
+
/** Whether the file exists */
|
|
36
|
+
exists: boolean;
|
|
37
|
+
/** ISO 8601 timestamp when detection occurred */
|
|
38
|
+
detected_at: string;
|
|
39
|
+
/** Method used to detect the file */
|
|
40
|
+
detection_method: 'diff' | 'executor_claim';
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* Task Log structure with verification info - per spec 05_DATA_MODELS.md
|
|
44
|
+
*/
|
|
45
|
+
export interface TaskLog {
|
|
46
|
+
task_id: string;
|
|
47
|
+
description: string;
|
|
48
|
+
verification_root: string;
|
|
49
|
+
verified_files?: VerifiedFile[];
|
|
50
|
+
created_at: string;
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* REPL configuration - extended for Property 32, 33
|
|
54
|
+
*/
|
|
55
|
+
export interface REPLConfig {
|
|
56
|
+
projectPath?: string;
|
|
57
|
+
evidenceDir?: string;
|
|
58
|
+
prompt?: string;
|
|
59
|
+
authMode?: 'claude-code' | 'api-key';
|
|
60
|
+
/** Timeout for Claude Code execution in milliseconds (default: 120000) */
|
|
61
|
+
timeout?: number;
|
|
62
|
+
/** Force non-interactive mode (for testing) */
|
|
63
|
+
forceNonInteractive?: boolean;
|
|
64
|
+
/**
|
|
65
|
+
* Project mode - per spec 10_REPL_UX.md
|
|
66
|
+
* - 'temp': Use temporary directory for verification_root (default)
|
|
67
|
+
* - 'fixed': Use projectRoot as verification_root
|
|
68
|
+
*/
|
|
69
|
+
projectMode?: ProjectMode;
|
|
70
|
+
/**
|
|
71
|
+
* Project root for fixed mode - per spec 10_REPL_UX.md
|
|
72
|
+
* Required when projectMode is 'fixed'
|
|
73
|
+
* Must be an existing directory
|
|
74
|
+
*/
|
|
75
|
+
projectRoot?: string;
|
|
76
|
+
/**
|
|
77
|
+
* Print project path on startup - per spec 10_REPL_UX.md
|
|
78
|
+
* Outputs PROJECT_PATH=<path> for machine-readable parsing
|
|
79
|
+
*/
|
|
80
|
+
printProjectPath?: boolean;
|
|
81
|
+
}
|
|
82
|
+
/**
|
|
83
|
+
* REPL Execution Mode - per spec 05_DATA_MODELS.md
|
|
84
|
+
* Detected at startup, determines I/O behavior
|
|
85
|
+
*/
|
|
86
|
+
export type ReplExecutionMode = 'interactive' | 'non_interactive';
|
|
87
|
+
/**
|
|
88
|
+
* Exit codes for non-interactive mode - per spec 10_REPL_UX.md
|
|
89
|
+
* These are deterministic based on session state
|
|
90
|
+
*/
|
|
91
|
+
export declare const EXIT_CODES: {
|
|
92
|
+
readonly COMPLETE: 0;
|
|
93
|
+
readonly ERROR: 1;
|
|
94
|
+
readonly INCOMPLETE: 2;
|
|
95
|
+
};
|
|
96
|
+
/**
|
|
97
|
+
* Command result - per spec 10_REPL_UX.md L66
|
|
98
|
+
* All commands must return a status (fail-closed principle)
|
|
99
|
+
*/
|
|
100
|
+
export interface CommandResult {
|
|
101
|
+
success: boolean;
|
|
102
|
+
message?: string;
|
|
103
|
+
error?: {
|
|
104
|
+
code: string;
|
|
105
|
+
message: string;
|
|
106
|
+
};
|
|
107
|
+
}
|
|
108
|
+
/**
|
|
109
|
+
* REPL session state
|
|
110
|
+
*/
|
|
111
|
+
interface REPLSession {
|
|
112
|
+
sessionId: string | null;
|
|
113
|
+
projectPath: string;
|
|
114
|
+
runner: RunnerCore | null;
|
|
115
|
+
supervisor: ExecutorSupervisor | null;
|
|
116
|
+
status: 'idle' | 'running' | 'paused';
|
|
117
|
+
}
|
|
118
|
+
/**
|
|
119
|
+
* REPL Interface class
|
|
120
|
+
*/
|
|
121
|
+
export declare class REPLInterface extends EventEmitter {
|
|
122
|
+
private readonly config;
|
|
123
|
+
private rl;
|
|
124
|
+
private session;
|
|
125
|
+
private running;
|
|
126
|
+
private initOnlyMode;
|
|
127
|
+
private inputQueue;
|
|
128
|
+
private isProcessingInput;
|
|
129
|
+
private executionMode;
|
|
130
|
+
private exitCode;
|
|
131
|
+
private hasError;
|
|
132
|
+
private hasIncompleteTasks;
|
|
133
|
+
private sessionCompleted;
|
|
134
|
+
private projectMode;
|
|
135
|
+
private verificationRoot;
|
|
136
|
+
private tempVerificationRoot;
|
|
137
|
+
private initCommand;
|
|
138
|
+
private modelCommand;
|
|
139
|
+
private sessionCommands;
|
|
140
|
+
private statusCommands;
|
|
141
|
+
private providerCommand;
|
|
142
|
+
private modelsCommand;
|
|
143
|
+
private keysCommand;
|
|
144
|
+
private logsCommand;
|
|
145
|
+
constructor(config?: REPLConfig);
|
|
146
|
+
/**
|
|
147
|
+
* Get project mode - per spec 10_REPL_UX.md
|
|
148
|
+
* @returns Current project mode ('temp' or 'fixed')
|
|
149
|
+
*/
|
|
150
|
+
getProjectMode(): ProjectMode;
|
|
151
|
+
/**
|
|
152
|
+
* Get verification root - per spec Property 32, 33
|
|
153
|
+
* @returns Absolute path to verification root directory
|
|
154
|
+
*/
|
|
155
|
+
getVerificationRoot(): string;
|
|
156
|
+
/**
|
|
157
|
+
* Initialize for use - called by start() or manually for testing
|
|
158
|
+
* Handles project path setup and PROJECT_PATH output
|
|
159
|
+
*/
|
|
160
|
+
initialize(): Promise<void>;
|
|
161
|
+
/**
|
|
162
|
+
* Initialize temporary project root - per spec Property 32
|
|
163
|
+
* Creates a temporary directory for verification_root in temp mode
|
|
164
|
+
* Also creates minimal .claude structure to avoid init-only mode
|
|
165
|
+
*/
|
|
166
|
+
initializeTempProjectRoot(): Promise<void>;
|
|
167
|
+
/**
|
|
168
|
+
* Verify files and return verification records - per spec Property 33
|
|
169
|
+
* @param absolutePaths - Array of absolute file paths to verify
|
|
170
|
+
* @returns Array of VerifiedFile records with relative paths
|
|
171
|
+
*/
|
|
172
|
+
verifyFiles(absolutePaths: string[]): VerifiedFile[];
|
|
173
|
+
/**
|
|
174
|
+
* Create a TaskLog with verification info - per spec Property 33
|
|
175
|
+
* @param taskId - Task identifier
|
|
176
|
+
* @param description - Task description
|
|
177
|
+
* @returns TaskLog with verification_root populated
|
|
178
|
+
*/
|
|
179
|
+
createTaskLog(taskId: string, description: string): TaskLog;
|
|
180
|
+
/**
|
|
181
|
+
* Cleanup resources - handles temp directory cleanup
|
|
182
|
+
* Per spec Property 32: temp mode directories may be cleaned up
|
|
183
|
+
*/
|
|
184
|
+
cleanup(): Promise<void>;
|
|
185
|
+
/**
|
|
186
|
+
* Start the REPL
|
|
187
|
+
* Per spec 10_REPL_UX.md L45: validate project structure on startup
|
|
188
|
+
*
|
|
189
|
+
* If .claude is missing, enter init-only mode instead of throwing.
|
|
190
|
+
* In init-only mode, only /help, /init, /exit are available.
|
|
191
|
+
*/
|
|
192
|
+
start(): Promise<void>;
|
|
193
|
+
/**
|
|
194
|
+
* Process input line
|
|
195
|
+
*/
|
|
196
|
+
private processInput;
|
|
197
|
+
/**
|
|
198
|
+
* Enqueue input for sequential processing
|
|
199
|
+
* This prevents race conditions when piped input arrives faster than processing
|
|
200
|
+
*/
|
|
201
|
+
private enqueueInput;
|
|
202
|
+
/**
|
|
203
|
+
* Process queued inputs sequentially
|
|
204
|
+
* Ensures each input completes before the next one starts
|
|
205
|
+
* Per spec 10_REPL_UX.md: Sequential Processing Guarantee
|
|
206
|
+
*/
|
|
207
|
+
private processQueue;
|
|
208
|
+
/**
|
|
209
|
+
* Process slash command
|
|
210
|
+
* Per spec 10_REPL_UX.md L66: All commands must return a status (fail-closed)
|
|
211
|
+
*
|
|
212
|
+
* In init-only mode, only /help, /init, /exit are allowed.
|
|
213
|
+
* Other commands return ERROR with instruction to run /init first.
|
|
214
|
+
*/
|
|
215
|
+
processCommand(input: string): Promise<CommandResult>;
|
|
216
|
+
/**
|
|
217
|
+
* Process natural language input
|
|
218
|
+
* Per spec 10_REPL_UX.md L117-118: Model selection is REPL-local
|
|
219
|
+
* Model is read from .claude/repl.json and passed to executor via runner
|
|
220
|
+
*/
|
|
221
|
+
private processNaturalLanguage;
|
|
222
|
+
/**
|
|
223
|
+
* Print welcome message
|
|
224
|
+
*/
|
|
225
|
+
private printWelcome;
|
|
226
|
+
/**
|
|
227
|
+
* Print help
|
|
228
|
+
*/
|
|
229
|
+
private printHelp;
|
|
230
|
+
/**
|
|
231
|
+
* Handle /init command
|
|
232
|
+
*/
|
|
233
|
+
private handleInit;
|
|
234
|
+
/**
|
|
235
|
+
* Handle /model command
|
|
236
|
+
* Per spec 10_REPL_UX.md L113-143:
|
|
237
|
+
* - /model displays current model or "UNSET"
|
|
238
|
+
* - /model <name> sets model and generates Evidence
|
|
239
|
+
* - .claude/ missing -> E101 ERROR
|
|
240
|
+
* - JSON parse error -> E105 ERROR
|
|
241
|
+
*/
|
|
242
|
+
private handleModel;
|
|
243
|
+
/**
|
|
244
|
+
* Handle /provider command
|
|
245
|
+
* Per spec 10_REPL_UX.md Section 2.1
|
|
246
|
+
*/
|
|
247
|
+
private handleProvider;
|
|
248
|
+
/**
|
|
249
|
+
* Handle /models command
|
|
250
|
+
* Per spec 10_REPL_UX.md Section 2.2
|
|
251
|
+
*/
|
|
252
|
+
private handleModels;
|
|
253
|
+
/**
|
|
254
|
+
* Handle /keys command
|
|
255
|
+
* Per spec 10_REPL_UX.md Section 2.3
|
|
256
|
+
*/
|
|
257
|
+
private handleKeys;
|
|
258
|
+
/**
|
|
259
|
+
* Handle /logs command
|
|
260
|
+
* Per spec 10_REPL_UX.md Section 2.4
|
|
261
|
+
*/
|
|
262
|
+
private handleLogs;
|
|
263
|
+
/**
|
|
264
|
+
* Handle /tasks command
|
|
265
|
+
*/
|
|
266
|
+
private handleTasks;
|
|
267
|
+
/**
|
|
268
|
+
* Handle /status command
|
|
269
|
+
*/
|
|
270
|
+
private handleStatus;
|
|
271
|
+
/**
|
|
272
|
+
* Handle /start command
|
|
273
|
+
* Per spec Property 32, 33: Use verification_root for file operations in temp mode
|
|
274
|
+
*/
|
|
275
|
+
private handleStart;
|
|
276
|
+
/**
|
|
277
|
+
* Handle /continue command
|
|
278
|
+
*/
|
|
279
|
+
private handleContinue;
|
|
280
|
+
/**
|
|
281
|
+
* Handle /approve command
|
|
282
|
+
*/
|
|
283
|
+
private handleApprove;
|
|
284
|
+
/**
|
|
285
|
+
* Handle /exit command
|
|
286
|
+
* Per spec 10_REPL_UX.md: Ensure clean exit with flushed output
|
|
287
|
+
*
|
|
288
|
+
* Guarantees:
|
|
289
|
+
* - Session state is persisted before exit
|
|
290
|
+
* - All output is flushed before readline closes
|
|
291
|
+
* - Double-completion is prevented via sessionCompleted flag
|
|
292
|
+
*/
|
|
293
|
+
private handleExit;
|
|
294
|
+
/**
|
|
295
|
+
* Print execution result
|
|
296
|
+
* Per spec 10_REPL_UX.md: Error details must be visible for fail-closed debugging
|
|
297
|
+
*/
|
|
298
|
+
private printExecutionResult;
|
|
299
|
+
/**
|
|
300
|
+
* Print message with flush guarantee for non-interactive mode
|
|
301
|
+
* Per spec 10_REPL_UX.md: Output Flush Guarantee
|
|
302
|
+
*/
|
|
303
|
+
private print;
|
|
304
|
+
/**
|
|
305
|
+
* Flush stdout - ensures all output is written before continuing
|
|
306
|
+
* Critical for non-interactive mode where process may exit immediately after
|
|
307
|
+
*/
|
|
308
|
+
private flushStdout;
|
|
309
|
+
/**
|
|
310
|
+
* Print error
|
|
311
|
+
*/
|
|
312
|
+
private printError;
|
|
313
|
+
/**
|
|
314
|
+
* Validate project structure - per spec 10_REPL_UX.md L45
|
|
315
|
+
* "REPL の起動時点で validate 相当の検証を行い、必須構造がなければ即 ERROR とする。"
|
|
316
|
+
*
|
|
317
|
+
* @returns Validation result with valid flag and errors array
|
|
318
|
+
*/
|
|
319
|
+
validateProjectStructure(): Promise<{
|
|
320
|
+
valid: boolean;
|
|
321
|
+
errors: string[];
|
|
322
|
+
}>;
|
|
323
|
+
/**
|
|
324
|
+
* Check if REPL is in init-only mode
|
|
325
|
+
* Init-only mode is active when .claude directory is missing
|
|
326
|
+
* In this mode, only /help, /init, /exit are allowed
|
|
327
|
+
*
|
|
328
|
+
* @returns true if in init-only mode (rechecks file system)
|
|
329
|
+
*/
|
|
330
|
+
isInitOnlyMode(): Promise<boolean>;
|
|
331
|
+
/**
|
|
332
|
+
* Tab completion for slash commands
|
|
333
|
+
* Per spec 10_REPL_UX.md: Tab completion support
|
|
334
|
+
*
|
|
335
|
+
* @param line - Current input line
|
|
336
|
+
* @returns Tuple of [completions, original line]
|
|
337
|
+
*/
|
|
338
|
+
private completer;
|
|
339
|
+
/**
|
|
340
|
+
* Detect execution mode based on TTY, environment, or config
|
|
341
|
+
* Per spec 10_REPL_UX.md: Non-interactive mode detection
|
|
342
|
+
*/
|
|
343
|
+
private detectExecutionMode;
|
|
344
|
+
/**
|
|
345
|
+
* Check if running in non-interactive mode
|
|
346
|
+
*/
|
|
347
|
+
isNonInteractiveMode(): boolean;
|
|
348
|
+
/**
|
|
349
|
+
* Get the current execution mode
|
|
350
|
+
*/
|
|
351
|
+
getExecutionMode(): ReplExecutionMode;
|
|
352
|
+
/**
|
|
353
|
+
* Set exit code based on current state
|
|
354
|
+
* Per spec 10_REPL_UX.md: Deterministic exit codes
|
|
355
|
+
*/
|
|
356
|
+
private updateExitCode;
|
|
357
|
+
/**
|
|
358
|
+
* Get the exit code (for non-interactive mode)
|
|
359
|
+
*/
|
|
360
|
+
getExitCode(): number;
|
|
361
|
+
/**
|
|
362
|
+
* Get session state (for testing)
|
|
363
|
+
*/
|
|
364
|
+
getSessionState(): REPLSession;
|
|
365
|
+
/**
|
|
366
|
+
* Check if running (for testing)
|
|
367
|
+
*/
|
|
368
|
+
isRunning(): boolean;
|
|
369
|
+
}
|
|
370
|
+
export {};
|
|
371
|
+
//# sourceMappingURL=repl-interface.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"repl-interface.d.ts","sourceRoot":"","sources":["../../src/repl/repl-interface.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAMH,OAAO,EAAE,YAAY,EAAE,MAAM,QAAQ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