@testany/hephos 0.3.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 +8 -0
- package/README.md +79 -0
- package/out/LocalExecutionEnvironment.d.ts +23 -0
- package/out/LocalExecutionEnvironment.d.ts.map +1 -0
- package/out/LocalExecutionEnvironment.js +124 -0
- package/out/LocalExecutionEnvironment.js.map +1 -0
- package/out/adapters/AdapterFactory.d.ts +55 -0
- package/out/adapters/AdapterFactory.d.ts.map +1 -0
- package/out/adapters/AdapterFactory.js +117 -0
- package/out/adapters/AdapterFactory.js.map +1 -0
- package/out/adapters/ClaudeCodeAdapter.d.ts +28 -0
- package/out/adapters/ClaudeCodeAdapter.d.ts.map +1 -0
- package/out/adapters/ClaudeCodeAdapter.js +95 -0
- package/out/adapters/ClaudeCodeAdapter.js.map +1 -0
- package/out/adapters/GenericShellAdapter.d.ts +51 -0
- package/out/adapters/GenericShellAdapter.d.ts.map +1 -0
- package/out/adapters/GenericShellAdapter.js +162 -0
- package/out/adapters/GenericShellAdapter.js.map +1 -0
- package/out/adapters/OpenAICodexAdapter.d.ts +36 -0
- package/out/adapters/OpenAICodexAdapter.d.ts.map +1 -0
- package/out/adapters/OpenAICodexAdapter.js +155 -0
- package/out/adapters/OpenAICodexAdapter.js.map +1 -0
- package/out/adapters/index.d.ts +12 -0
- package/out/adapters/index.d.ts.map +1 -0
- package/out/adapters/index.js +12 -0
- package/out/adapters/index.js.map +1 -0
- package/out/cli-layer-index.d.ts +14 -0
- package/out/cli-layer-index.d.ts.map +1 -0
- package/out/cli-layer-index.js +15 -0
- package/out/cli-layer-index.js.map +1 -0
- package/out/cli.d.ts +8 -0
- package/out/cli.d.ts.map +1 -0
- package/out/cli.js +297 -0
- package/out/cli.js.map +1 -0
- package/out/commands/AgentsCommand.d.ts +47 -0
- package/out/commands/AgentsCommand.d.ts.map +1 -0
- package/out/commands/AgentsCommand.js +487 -0
- package/out/commands/AgentsCommand.js.map +1 -0
- package/out/config/ConfigAdapter.d.ts +58 -0
- package/out/config/ConfigAdapter.d.ts.map +1 -0
- package/out/config/ConfigAdapter.js +95 -0
- package/out/config/ConfigAdapter.js.map +1 -0
- package/out/config/UIPreferences.d.ts +24 -0
- package/out/config/UIPreferences.d.ts.map +1 -0
- package/out/config/UIPreferences.js +18 -0
- package/out/config/UIPreferences.js.map +1 -0
- package/out/config/index.d.ts +9 -0
- package/out/config/index.d.ts.map +1 -0
- package/out/config/index.js +9 -0
- package/out/config/index.js.map +1 -0
- package/out/outputs/ConsoleLogger.d.ts +30 -0
- package/out/outputs/ConsoleLogger.d.ts.map +1 -0
- package/out/outputs/ConsoleLogger.js +54 -0
- package/out/outputs/ConsoleLogger.js.map +1 -0
- package/out/outputs/ConsoleOutput.d.ts +30 -0
- package/out/outputs/ConsoleOutput.d.ts.map +1 -0
- package/out/outputs/ConsoleOutput.js +49 -0
- package/out/outputs/ConsoleOutput.js.map +1 -0
- package/out/outputs/IOutput.d.ts +38 -0
- package/out/outputs/IOutput.d.ts.map +1 -0
- package/out/outputs/IOutput.js +13 -0
- package/out/outputs/IOutput.js.map +1 -0
- package/out/outputs/InkOutput.d.ts +24 -0
- package/out/outputs/InkOutput.d.ts.map +1 -0
- package/out/outputs/InkOutput.js +38 -0
- package/out/outputs/InkOutput.js.map +1 -0
- package/out/repl/ReplModeInk.d.ts +8 -0
- package/out/repl/ReplModeInk.d.ts.map +1 -0
- package/out/repl/ReplModeInk.js +1486 -0
- package/out/repl/ReplModeInk.js.map +1 -0
- package/out/repl/components/AgentsMenu.d.ts +7 -0
- package/out/repl/components/AgentsMenu.d.ts.map +1 -0
- package/out/repl/components/AgentsMenu.js +565 -0
- package/out/repl/components/AgentsMenu.js.map +1 -0
- package/out/repl/components/LoadingIndicator.d.ts +5 -0
- package/out/repl/components/LoadingIndicator.d.ts.map +1 -0
- package/out/repl/components/LoadingIndicator.js +14 -0
- package/out/repl/components/LoadingIndicator.js.map +1 -0
- package/out/repl/components/QueueDisplay.d.ts +18 -0
- package/out/repl/components/QueueDisplay.d.ts.map +1 -0
- package/out/repl/components/QueueDisplay.js +16 -0
- package/out/repl/components/QueueDisplay.js.map +1 -0
- package/out/repl/components/RestorePrompt.d.ts +25 -0
- package/out/repl/components/RestorePrompt.d.ts.map +1 -0
- package/out/repl/components/RestorePrompt.js +32 -0
- package/out/repl/components/RestorePrompt.js.map +1 -0
- package/out/repl/components/StreamingDisplay.d.ts +5 -0
- package/out/repl/components/StreamingDisplay.d.ts.map +1 -0
- package/out/repl/components/StreamingDisplay.js +27 -0
- package/out/repl/components/StreamingDisplay.js.map +1 -0
- package/out/repl/components/ThinkingIndicator.d.ts +19 -0
- package/out/repl/components/ThinkingIndicator.d.ts.map +1 -0
- package/out/repl/components/ThinkingIndicator.js +35 -0
- package/out/repl/components/ThinkingIndicator.js.map +1 -0
- package/out/repl/wizard/wizardStep1Reducer.d.ts +30 -0
- package/out/repl/wizard/wizardStep1Reducer.d.ts.map +1 -0
- package/out/repl/wizard/wizardStep1Reducer.js +189 -0
- package/out/repl/wizard/wizardStep1Reducer.js.map +1 -0
- package/package.json +62 -0
|
@@ -0,0 +1,162 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* GenericShellAdapter - Generic adapter for shell scripts and custom commands
|
|
3
|
+
*
|
|
4
|
+
* Stateless adapter that executes commands once per message:
|
|
5
|
+
* - Executes command with prompt as CLI argument
|
|
6
|
+
* - Each message spawns a new process (one-shot execution)
|
|
7
|
+
* - Prepends [SYSTEM] section to messages
|
|
8
|
+
* - Suitable for custom agents, Gemini CLI, or any other CLI tool
|
|
9
|
+
*/
|
|
10
|
+
import { exec } from 'child_process';
|
|
11
|
+
import { access } from 'fs/promises';
|
|
12
|
+
import { constants } from 'fs';
|
|
13
|
+
import { promisify } from 'util';
|
|
14
|
+
const execAsync = promisify(exec);
|
|
15
|
+
export class GenericShellAdapter {
|
|
16
|
+
executionEnv;
|
|
17
|
+
agentType;
|
|
18
|
+
command;
|
|
19
|
+
executionMode = 'stateless';
|
|
20
|
+
defaultArgs;
|
|
21
|
+
constructor(executionEnv, config) {
|
|
22
|
+
this.executionEnv = executionEnv;
|
|
23
|
+
this.agentType = config.agentType;
|
|
24
|
+
this.command = config.command;
|
|
25
|
+
this.defaultArgs = config.defaultArgs || [];
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Get default arguments for this adapter
|
|
29
|
+
*/
|
|
30
|
+
getDefaultArgs() {
|
|
31
|
+
return [...this.defaultArgs];
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Spawn a generic shell process with stdout interception
|
|
35
|
+
*/
|
|
36
|
+
async spawn(config) {
|
|
37
|
+
const args = [...this.getDefaultArgs()];
|
|
38
|
+
// Add additional arguments from member config
|
|
39
|
+
if (config.additionalArgs && config.additionalArgs.length > 0) {
|
|
40
|
+
args.push(...config.additionalArgs);
|
|
41
|
+
}
|
|
42
|
+
// NOTE: systemInstruction is not injected here; prompt is pre-built upstream
|
|
43
|
+
// Spawn the process using IExecutionEnvironment
|
|
44
|
+
const iProcess = this.executionEnv.spawn(this.command, args, {
|
|
45
|
+
cwd: config.workDir,
|
|
46
|
+
env: config.env,
|
|
47
|
+
inheritEnv: true
|
|
48
|
+
});
|
|
49
|
+
// Return spawn result with cleanup function
|
|
50
|
+
return {
|
|
51
|
+
process: iProcess,
|
|
52
|
+
cleanup: async () => {
|
|
53
|
+
return new Promise((resolve) => {
|
|
54
|
+
try {
|
|
55
|
+
if (iProcess.pid !== undefined) {
|
|
56
|
+
process.kill(iProcess.pid, 0);
|
|
57
|
+
iProcess.on('exit', () => resolve());
|
|
58
|
+
iProcess.kill();
|
|
59
|
+
// Force kill after 5 seconds if still running
|
|
60
|
+
setTimeout(() => {
|
|
61
|
+
try {
|
|
62
|
+
if (iProcess.pid !== undefined) {
|
|
63
|
+
process.kill(iProcess.pid, 0);
|
|
64
|
+
iProcess.kill('SIGKILL');
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
catch {
|
|
68
|
+
// Process already dead
|
|
69
|
+
}
|
|
70
|
+
}, 5000);
|
|
71
|
+
}
|
|
72
|
+
else {
|
|
73
|
+
resolve();
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
catch {
|
|
77
|
+
resolve();
|
|
78
|
+
}
|
|
79
|
+
});
|
|
80
|
+
}
|
|
81
|
+
};
|
|
82
|
+
}
|
|
83
|
+
/**
|
|
84
|
+
* Validate that the command exists and is executable
|
|
85
|
+
*/
|
|
86
|
+
async validate() {
|
|
87
|
+
try {
|
|
88
|
+
// For absolute paths, check if file exists and is executable
|
|
89
|
+
if (this.command.startsWith('/') || this.command.startsWith('./')) {
|
|
90
|
+
await access(this.command, constants.X_OK);
|
|
91
|
+
return true;
|
|
92
|
+
}
|
|
93
|
+
// For commands in PATH, try to execute with --version or --help
|
|
94
|
+
// This is a basic check and may not work for all commands
|
|
95
|
+
try {
|
|
96
|
+
await execAsync(`${this.command} --version`, { timeout: 3000 });
|
|
97
|
+
return true;
|
|
98
|
+
}
|
|
99
|
+
catch {
|
|
100
|
+
// If --version fails, try --help
|
|
101
|
+
try {
|
|
102
|
+
await execAsync(`${this.command} --help`, { timeout: 3000 });
|
|
103
|
+
return true;
|
|
104
|
+
}
|
|
105
|
+
catch {
|
|
106
|
+
// If both fail, assume command doesn't exist
|
|
107
|
+
return false;
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
catch {
|
|
112
|
+
return false;
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
/**
|
|
116
|
+
* Execute a one-shot command (stateless mode)
|
|
117
|
+
* Spawns a new process for each message, passes message as CLI argument
|
|
118
|
+
*/
|
|
119
|
+
async executeOneShot(message, config) {
|
|
120
|
+
const args = [...this.getDefaultArgs()];
|
|
121
|
+
// Add additional arguments from member config
|
|
122
|
+
if (config.additionalArgs && config.additionalArgs.length > 0) {
|
|
123
|
+
args.push(...config.additionalArgs);
|
|
124
|
+
}
|
|
125
|
+
// Add the message as the final argument
|
|
126
|
+
args.push(message);
|
|
127
|
+
return new Promise((resolve, reject) => {
|
|
128
|
+
const iProcess = this.executionEnv.spawn(this.command, args, {
|
|
129
|
+
cwd: config.workDir,
|
|
130
|
+
env: config.env,
|
|
131
|
+
inheritEnv: true
|
|
132
|
+
});
|
|
133
|
+
let stdout = '';
|
|
134
|
+
let stderr = '';
|
|
135
|
+
if (iProcess.stdout) {
|
|
136
|
+
iProcess.stdout.on('data', (chunk) => {
|
|
137
|
+
stdout += chunk.toString();
|
|
138
|
+
});
|
|
139
|
+
}
|
|
140
|
+
if (iProcess.stderr) {
|
|
141
|
+
iProcess.stderr.on('data', (chunk) => {
|
|
142
|
+
stderr += chunk.toString();
|
|
143
|
+
});
|
|
144
|
+
}
|
|
145
|
+
iProcess.on('error', (error) => {
|
|
146
|
+
reject(new Error(`Failed to spawn process: ${error.message}`));
|
|
147
|
+
});
|
|
148
|
+
iProcess.on('exit', (code) => {
|
|
149
|
+
if (code !== 0) {
|
|
150
|
+
reject(new Error(`Process exited with code ${code}. stderr: ${stderr}`));
|
|
151
|
+
return;
|
|
152
|
+
}
|
|
153
|
+
// Append [DONE] marker if not present
|
|
154
|
+
if (!stdout.trim().endsWith('[DONE]')) {
|
|
155
|
+
stdout += '\n[DONE]\n';
|
|
156
|
+
}
|
|
157
|
+
resolve(stdout);
|
|
158
|
+
});
|
|
159
|
+
});
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
//# sourceMappingURL=GenericShellAdapter.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"GenericShellAdapter.js","sourceRoot":"","sources":["../../src/adapters/GenericShellAdapter.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAE,IAAI,EAAE,MAAM,eAAe,CAAC;AACrC,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AACrC,OAAO,EAAE,SAAS,EAAE,MAAM,IAAI,CAAC;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|
|
6
|
+
* - We execute it with the prompt as a command-line argument
|
|
7
|
+
* - Each message spawns a new process (one-shot execution)
|
|
8
|
+
* - No dependency on external wrapper scripts
|
|
9
|
+
*/
|
|
10
|
+
import type { IAgentAdapter, AgentSpawnConfig, AgentSpawnResult } from '@testany/agent-chatter-core';
|
|
11
|
+
import type { IExecutionEnvironment } from '@testany/agent-chatter-core';
|
|
12
|
+
export declare class OpenAICodexAdapter implements IAgentAdapter {
|
|
13
|
+
private executionEnv;
|
|
14
|
+
readonly command: string;
|
|
15
|
+
readonly agentType = "openai-codex";
|
|
16
|
+
readonly executionMode: "stateless";
|
|
17
|
+
constructor(executionEnv: IExecutionEnvironment, command: string);
|
|
18
|
+
/**
|
|
19
|
+
* Get default arguments for Codex CLI
|
|
20
|
+
*/
|
|
21
|
+
getDefaultArgs(): string[];
|
|
22
|
+
/**
|
|
23
|
+
* Spawn a Codex process with stdout interception
|
|
24
|
+
*/
|
|
25
|
+
spawn(config: AgentSpawnConfig): Promise<AgentSpawnResult>;
|
|
26
|
+
/**
|
|
27
|
+
* Validate that the Codex CLI exists and is executable
|
|
28
|
+
*/
|
|
29
|
+
validate(): Promise<boolean>;
|
|
30
|
+
/**
|
|
31
|
+
* Execute a one-shot command (stateless mode)
|
|
32
|
+
* Spawns a new Codex process for each message, passes message as CLI argument
|
|
33
|
+
*/
|
|
34
|
+
executeOneShot(message: string, config: AgentSpawnConfig): Promise<string>;
|
|
35
|
+
}
|
|
36
|
+
//# sourceMappingURL=OpenAICodexAdapter.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"OpenAICodexAdapter.d.ts","sourceRoot":"","sources":["../../src/adapters/OpenAICodexAdapter.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAKH,OAAO,KAAK,EAAE,aAAa,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAC;AACrG,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,6BAA6B,CAAC;AAEzE,qBAAa,kBAAmB,YAAW,aAAa;IAKpD,OAAO,CAAC,YAAY;aACJ,OAAO,EAAE,MAAM;IALjC,QAAQ,CAAC,SAAS,kBAAkB;IACpC,QAAQ,CAAC,aAAa,EAAG,WAAW,CAAU;gBAGpC,YAAY,EAAE,qBAAqB,EAC3B,OAAO,EAAE,MAAM;IAGjC;;OAEG;IACH,cAAc,IAAI,MAAM,EAAE;IAK1B;;OAEG;IACG,KAAK,CAAC,MAAM,EAAE,gBAAgB,GAAG,OAAO,CAAC,gBAAgB,CAAC;IA0EhE;;OAEG;IACG,QAAQ,IAAI,OAAO,CAAC,OAAO,CAAC;IAUlC;;;OAGG;IACG,cAAc,CAAC,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,gBAAgB,GAAG,OAAO,CAAC,MAAM,CAAC;CA8CjF"}
|
|
@@ -0,0 +1,155 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* OpenAICodexAdapter - Adapter for OpenAI Codex CLI
|
|
3
|
+
*
|
|
4
|
+
* Stateless adapter that executes Codex CLI once per message:
|
|
5
|
+
* - Codex CLI requires TTY for interactive mode
|
|
6
|
+
* - We execute it with the prompt as a command-line argument
|
|
7
|
+
* - Each message spawns a new process (one-shot execution)
|
|
8
|
+
* - No dependency on external wrapper scripts
|
|
9
|
+
*/
|
|
10
|
+
import { PassThrough } from 'stream';
|
|
11
|
+
import { access } from 'fs/promises';
|
|
12
|
+
import { constants } from 'fs';
|
|
13
|
+
export class OpenAICodexAdapter {
|
|
14
|
+
executionEnv;
|
|
15
|
+
command;
|
|
16
|
+
agentType = 'openai-codex';
|
|
17
|
+
executionMode = 'stateless';
|
|
18
|
+
constructor(executionEnv, command) {
|
|
19
|
+
this.executionEnv = executionEnv;
|
|
20
|
+
this.command = command;
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Get default arguments for Codex CLI
|
|
24
|
+
*/
|
|
25
|
+
getDefaultArgs() {
|
|
26
|
+
// Keep defaults empty; use registry/config args to avoid duplication (e.g., multiple --json flags)
|
|
27
|
+
return [];
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Spawn a Codex process with stdout interception
|
|
31
|
+
*/
|
|
32
|
+
async spawn(config) {
|
|
33
|
+
const args = [...this.getDefaultArgs()];
|
|
34
|
+
// Add additional arguments from member config
|
|
35
|
+
if (config.additionalArgs && config.additionalArgs.length > 0) {
|
|
36
|
+
args.push(...config.additionalArgs);
|
|
37
|
+
}
|
|
38
|
+
// NOTE: systemInstruction is not injected here; prompt is pre-built upstream
|
|
39
|
+
// Spawn the process using IExecutionEnvironment
|
|
40
|
+
const iProcess = this.executionEnv.spawn(this.command, args, {
|
|
41
|
+
cwd: config.workDir,
|
|
42
|
+
env: config.env,
|
|
43
|
+
inheritEnv: true
|
|
44
|
+
});
|
|
45
|
+
// Create PassThrough stream to intercept stdout and append [DONE]
|
|
46
|
+
const transformedStdout = new PassThrough();
|
|
47
|
+
// Pipe original stdout to transformed stream
|
|
48
|
+
if (iProcess.stdout) {
|
|
49
|
+
iProcess.stdout.pipe(transformedStdout, { end: false });
|
|
50
|
+
let buffer = '';
|
|
51
|
+
iProcess.stdout.on('data', (chunk) => {
|
|
52
|
+
buffer += chunk.toString();
|
|
53
|
+
});
|
|
54
|
+
// When original stdout ends, append [DONE] if not present
|
|
55
|
+
iProcess.stdout.on('end', () => {
|
|
56
|
+
if (!buffer.trim().endsWith('[DONE]')) {
|
|
57
|
+
transformedStdout.write('\n[DONE]\n');
|
|
58
|
+
}
|
|
59
|
+
transformedStdout.end();
|
|
60
|
+
});
|
|
61
|
+
}
|
|
62
|
+
// Return spawn result with cleanup function and custom stdout
|
|
63
|
+
return {
|
|
64
|
+
process: iProcess,
|
|
65
|
+
cleanup: async () => {
|
|
66
|
+
return new Promise((resolve) => {
|
|
67
|
+
try {
|
|
68
|
+
if (iProcess.pid !== undefined) {
|
|
69
|
+
process.kill(iProcess.pid, 0);
|
|
70
|
+
iProcess.on('exit', () => resolve());
|
|
71
|
+
iProcess.kill();
|
|
72
|
+
// Force kill after 5 seconds if still running
|
|
73
|
+
setTimeout(() => {
|
|
74
|
+
try {
|
|
75
|
+
if (iProcess.pid !== undefined) {
|
|
76
|
+
process.kill(iProcess.pid, 0);
|
|
77
|
+
iProcess.kill('SIGKILL');
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
catch {
|
|
81
|
+
// Process already dead
|
|
82
|
+
}
|
|
83
|
+
}, 5000);
|
|
84
|
+
}
|
|
85
|
+
else {
|
|
86
|
+
resolve();
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
catch {
|
|
90
|
+
resolve();
|
|
91
|
+
}
|
|
92
|
+
});
|
|
93
|
+
},
|
|
94
|
+
customStreams: {
|
|
95
|
+
stdout: transformedStdout
|
|
96
|
+
}
|
|
97
|
+
};
|
|
98
|
+
}
|
|
99
|
+
/**
|
|
100
|
+
* Validate that the Codex CLI exists and is executable
|
|
101
|
+
*/
|
|
102
|
+
async validate() {
|
|
103
|
+
try {
|
|
104
|
+
// Check if file exists and is executable
|
|
105
|
+
await access(this.command, constants.X_OK);
|
|
106
|
+
return true;
|
|
107
|
+
}
|
|
108
|
+
catch {
|
|
109
|
+
return false;
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
/**
|
|
113
|
+
* Execute a one-shot command (stateless mode)
|
|
114
|
+
* Spawns a new Codex process for each message, passes message as CLI argument
|
|
115
|
+
*/
|
|
116
|
+
async executeOneShot(message, config) {
|
|
117
|
+
const args = [...this.getDefaultArgs()];
|
|
118
|
+
// Add additional arguments from member config
|
|
119
|
+
if (config.additionalArgs && config.additionalArgs.length > 0) {
|
|
120
|
+
args.push(...config.additionalArgs);
|
|
121
|
+
}
|
|
122
|
+
// Add the message as the final argument
|
|
123
|
+
args.push(message);
|
|
124
|
+
return new Promise((resolve, reject) => {
|
|
125
|
+
const iProcess = this.executionEnv.spawn(this.command, args, {
|
|
126
|
+
cwd: config.workDir,
|
|
127
|
+
env: config.env,
|
|
128
|
+
inheritEnv: true
|
|
129
|
+
});
|
|
130
|
+
let stdout = '';
|
|
131
|
+
let stderr = '';
|
|
132
|
+
if (iProcess.stdout) {
|
|
133
|
+
iProcess.stdout.on('data', (chunk) => {
|
|
134
|
+
stdout += chunk.toString();
|
|
135
|
+
});
|
|
136
|
+
}
|
|
137
|
+
if (iProcess.stderr) {
|
|
138
|
+
iProcess.stderr.on('data', (chunk) => {
|
|
139
|
+
stderr += chunk.toString();
|
|
140
|
+
});
|
|
141
|
+
}
|
|
142
|
+
iProcess.on('error', (error) => {
|
|
143
|
+
reject(new Error(`Failed to spawn Codex process: ${error.message}`));
|
|
144
|
+
});
|
|
145
|
+
iProcess.on('exit', (code) => {
|
|
146
|
+
if (code !== 0) {
|
|
147
|
+
reject(new Error(`Codex process exited with code ${code}. stderr: ${stderr}`));
|
|
148
|
+
return;
|
|
149
|
+
}
|
|
150
|
+
resolve(stdout);
|
|
151
|
+
});
|
|
152
|
+
});
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
//# sourceMappingURL=OpenAICodexAdapter.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"OpenAICodexAdapter.js","sourceRoot":"","sources":["../../src/adapters/OpenAICodexAdapter.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAE,WAAW,EAAE,MAAM,QAAQ,CAAC;AACrC,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AACrC,OAAO,EAAE,SAAS,EAAE,MAAM,IAAI,CAAC;AAI/B,MAAM,OAAO,kBAAkB;IAKnB;IACQ;IALT,SAAS,GAAG,cAAc,CAAC;IAC3B,aAAa,GAAG,WAAoB,CAAC;IAE9C,YACU,YAAmC,EAC3B,OAAe;QADvB,iBAAY,GAAZ,YAAY,CAAuB;QAC3B,YAAO,GAAP,OAAO,CAAQ;IAC9B,CAAC;IAEJ;;OAEG;IACH,cAAc;QACZ,mGAAmG;QAC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;gBAC7B,CAAC,CAAC,CAAC;YACL,CAAC;YAED,QAAQ,CAAC,EAAE,CAAC,OAAO,EAAE,CAAC,KAAK,EAAE,EAAE;gBAC7B,MAAM,CAAC,IAAI,KAAK,CAAC,kCAAkC,KAAK,CAAC,OAAO,EAAE,CAAC,CAAC,CAAC;YACvE,CAAC,CAAC,CAAC;YAEH,QAAQ,CAAC,EAAE,CAAC,MAAM,EAAE,CAAC,IAAI,EAAE,EAAE;gBAC3B,IAAI,IAAI,KAAK,CAAC,EAAE,CAAC;oBACf,MAAM,CAAC,IAAI,KAAK,CAAC,kCAAkC,IAAI,aAAa,MAAM,EAAE,CAAC,CAAC,CAAC;oBAC/E,OAAO;gBACT,CAAC;gBACD,OAAO,CAAC,MAAM,CAAC,CAAC;YAClB,CAAC,CAAC,CAAC;QACL,CAAC,CAAC,CAAC;IACL,CAAC;CACF"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* CLI Adapter Implementations
|
|
3
|
+
*
|
|
4
|
+
* This module exports concrete adapter implementations for the CLI layer.
|
|
5
|
+
* Core only depends on interfaces (IAgentAdapter, IAdapterFactory).
|
|
6
|
+
*/
|
|
7
|
+
export { ClaudeCodeAdapter } from './ClaudeCodeAdapter.js';
|
|
8
|
+
export { OpenAICodexAdapter } from './OpenAICodexAdapter.js';
|
|
9
|
+
export { GenericShellAdapter } from './GenericShellAdapter.js';
|
|
10
|
+
export type { GenericShellAdapterConfig } from './GenericShellAdapter.js';
|
|
11
|
+
export { AdapterFactory } from './AdapterFactory.js';
|
|
12
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/adapters/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAC3D,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAC7D,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAC/D,YAAY,EAAE,yBAAyB,EAAE,MAAM,0BAA0B,CAAC;AAC1E,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* CLI Adapter Implementations
|
|
3
|
+
*
|
|
4
|
+
* This module exports concrete adapter implementations for the CLI layer.
|
|
5
|
+
* Core only depends on interfaces (IAgentAdapter, IAdapterFactory).
|
|
6
|
+
*/
|
|
7
|
+
// Export adapter implementations
|
|
8
|
+
export { ClaudeCodeAdapter } from './ClaudeCodeAdapter.js';
|
|
9
|
+
export { OpenAICodexAdapter } from './OpenAICodexAdapter.js';
|
|
10
|
+
export { GenericShellAdapter } from './GenericShellAdapter.js';
|
|
11
|
+
export { AdapterFactory } from './AdapterFactory.js';
|
|
12
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/adapters/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,iCAAiC;AACjC,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAC3D,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAC7D,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAE/D,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* CLI Layer - Concrete Implementations
|
|
3
|
+
*
|
|
4
|
+
* This module exports all CLI layer implementations.
|
|
5
|
+
* These are the concrete implementations of Core interfaces.
|
|
6
|
+
*
|
|
7
|
+
* LLD-04: Core only depends on interfaces; CLI provides implementations.
|
|
8
|
+
*/
|
|
9
|
+
export { LocalExecutionEnvironment } from './LocalExecutionEnvironment.js';
|
|
10
|
+
export { ClaudeCodeAdapter, OpenAICodexAdapter, GenericShellAdapter, AdapterFactory } from './adapters/index.js';
|
|
11
|
+
export type { GenericShellAdapterConfig } from './adapters/index.js';
|
|
12
|
+
export { ConfigAdapter, splitConfig, mergeConfig, DEFAULT_UI_PREFERENCES } from './config/index.js';
|
|
13
|
+
export type { UIPreferences } from './config/index.js';
|
|
14
|
+
//# sourceMappingURL=cli-layer-index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cli-layer-index.d.ts","sourceRoot":"","sources":["../src/cli-layer-index.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAGH,OAAO,EAAE,yBAAyB,EAAE,MAAM,gCAAgC,CAAC;AAG3E,OAAO,EACL,iBAAiB,EACjB,kBAAkB,EAClB,mBAAmB,EACnB,cAAc,EACf,MAAM,qBAAqB,CAAC;AAE7B,YAAY,EAAE,yBAAyB,EAAE,MAAM,qBAAqB,CAAC;AAGrE,OAAO,EACL,aAAa,EACb,WAAW,EACX,WAAW,EACX,sBAAsB,EACvB,MAAM,mBAAmB,CAAC;AAE3B,YAAY,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* CLI Layer - Concrete Implementations
|
|
3
|
+
*
|
|
4
|
+
* This module exports all CLI layer implementations.
|
|
5
|
+
* These are the concrete implementations of Core interfaces.
|
|
6
|
+
*
|
|
7
|
+
* LLD-04: Core only depends on interfaces; CLI provides implementations.
|
|
8
|
+
*/
|
|
9
|
+
// Execution environment implementation
|
|
10
|
+
export { LocalExecutionEnvironment } from './LocalExecutionEnvironment.js';
|
|
11
|
+
// Adapter implementations
|
|
12
|
+
export { ClaudeCodeAdapter, OpenAICodexAdapter, GenericShellAdapter, AdapterFactory } from './adapters/index.js';
|
|
13
|
+
// Config utilities (LLD-05)
|
|
14
|
+
export { ConfigAdapter, splitConfig, mergeConfig, DEFAULT_UI_PREFERENCES } from './config/index.js';
|
|
15
|
+
//# sourceMappingURL=cli-layer-index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cli-layer-index.js","sourceRoot":"","sources":["../src/cli-layer-index.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,uCAAuC;AACvC,OAAO,EAAE,yBAAyB,EAAE,MAAM,gCAAgC,CAAC;AAE3E,0BAA0B;AAC1B,OAAO,EACL,iBAAiB,EACjB,kBAAkB,EAClB,mBAAmB,EACnB,cAAc,EACf,MAAM,qBAAqB,CAAC;AAI7B,4BAA4B;AAC5B,OAAO,EACL,aAAa,EACb,WAAW,EACX,WAAW,EACX,sBAAsB,EACvB,MAAM,mBAAmB,CAAC"}
|
package/out/cli.d.ts
ADDED
package/out/cli.d.ts.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cli.d.ts","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":";AAEA;;;;GAIG;AAoSH,wBAAsB,GAAG,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAqBvD"}
|