openpaean 0.7.12 → 0.7.13

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.
Files changed (45) hide show
  1. package/dist/api/worker-api.d.ts +6 -76
  2. package/dist/api/worker-api.d.ts.map +1 -1
  3. package/dist/api/worker-api.js +6 -63
  4. package/dist/api/worker-api.js.map +1 -1
  5. package/package.json +1 -1
  6. package/dist/commands/worker.d.ts +0 -7
  7. package/dist/commands/worker.d.ts.map +0 -1
  8. package/dist/commands/worker.js +0 -284
  9. package/dist/commands/worker.js.map +0 -1
  10. package/dist/ui/terminal/ErrorDisplay.d.ts +0 -63
  11. package/dist/ui/terminal/ErrorDisplay.d.ts.map +0 -1
  12. package/dist/ui/terminal/ErrorDisplay.js +0 -113
  13. package/dist/ui/terminal/ErrorDisplay.js.map +0 -1
  14. package/dist/ui/terminal/HelpDisplay.d.ts +0 -21
  15. package/dist/ui/terminal/HelpDisplay.d.ts.map +0 -1
  16. package/dist/ui/terminal/HelpDisplay.js +0 -89
  17. package/dist/ui/terminal/HelpDisplay.js.map +0 -1
  18. package/dist/worker/executors/articulate.d.ts +0 -19
  19. package/dist/worker/executors/articulate.d.ts.map +0 -1
  20. package/dist/worker/executors/articulate.js +0 -147
  21. package/dist/worker/executors/articulate.js.map +0 -1
  22. package/dist/worker/executors/claude.d.ts +0 -17
  23. package/dist/worker/executors/claude.d.ts.map +0 -1
  24. package/dist/worker/executors/claude.js +0 -102
  25. package/dist/worker/executors/claude.js.map +0 -1
  26. package/dist/worker/executors/index.d.ts +0 -26
  27. package/dist/worker/executors/index.d.ts.map +0 -1
  28. package/dist/worker/executors/index.js +0 -81
  29. package/dist/worker/executors/index.js.map +0 -1
  30. package/dist/worker/executors/paeanclaw.d.ts +0 -22
  31. package/dist/worker/executors/paeanclaw.d.ts.map +0 -1
  32. package/dist/worker/executors/paeanclaw.js +0 -182
  33. package/dist/worker/executors/paeanclaw.js.map +0 -1
  34. package/dist/worker/index.d.ts +0 -10
  35. package/dist/worker/index.d.ts.map +0 -1
  36. package/dist/worker/index.js +0 -10
  37. package/dist/worker/index.js.map +0 -1
  38. package/dist/worker/service.d.ts +0 -48
  39. package/dist/worker/service.d.ts.map +0 -1
  40. package/dist/worker/service.js +0 -559
  41. package/dist/worker/service.js.map +0 -1
  42. package/dist/worker/types.d.ts +0 -134
  43. package/dist/worker/types.d.ts.map +0 -1
  44. package/dist/worker/types.js +0 -71
  45. package/dist/worker/types.js.map +0 -1
@@ -1,113 +0,0 @@
1
- /**
2
- * Error Display
3
- * Structured error messages with cause and suggestions
4
- */
5
- import { styledMessage, warning, info, muted } from '../theme/index.js';
6
- /**
7
- * Format an error for display
8
- */
9
- export function formatError(detail) {
10
- let output = '';
11
- // Main error message
12
- output += styledMessage('error', detail.message) + '\n';
13
- // Error code if present
14
- if (detail.code) {
15
- output += muted(` Code: ${detail.code}\n`);
16
- }
17
- // Cause
18
- if (detail.cause) {
19
- output += ` ${warning('Cause:')} ${detail.cause}\n`;
20
- }
21
- // Suggestion
22
- if (detail.suggestion) {
23
- output += ` ${info('Suggestion:')} ${detail.suggestion}\n`;
24
- }
25
- return output;
26
- }
27
- /**
28
- * Display an error and return the formatted string
29
- */
30
- export function displayError(detail) {
31
- return formatError(detail);
32
- }
33
- /**
34
- * Common error templates
35
- */
36
- export const Errors = {
37
- /**
38
- * Network error
39
- */
40
- network: (cause) => ({
41
- message: 'Network connection failed',
42
- cause: cause || 'Could not reach the server',
43
- suggestion: 'Check your internet connection and try again',
44
- }),
45
- /**
46
- * Authentication error
47
- */
48
- auth: () => ({
49
- message: 'Authentication failed',
50
- cause: 'Your session may have expired',
51
- suggestion: 'Run `openpaean login` to re-authenticate',
52
- }),
53
- /**
54
- * MCP connection error
55
- */
56
- mcpConnection: (serverName, cause) => ({
57
- message: `Failed to connect to MCP server "${serverName}"`,
58
- cause: cause || 'Server may be unavailable or already in use',
59
- suggestion: 'Check if the server is running and not used by another client',
60
- }),
61
- /**
62
- * MCP tool error
63
- */
64
- mcpTool: (toolName, cause) => ({
65
- message: `MCP tool "${toolName}" failed`,
66
- cause: cause || 'Tool execution returned an error',
67
- suggestion: 'Check the tool configuration and try again',
68
- }),
69
- /**
70
- * File not found
71
- */
72
- fileNotFound: (path) => ({
73
- message: `File not found: ${path}`,
74
- suggestion: 'Check the file path and try again',
75
- }),
76
- /**
77
- * Invalid input
78
- */
79
- invalidInput: (field) => ({
80
- message: field ? `Invalid ${field}` : 'Invalid input',
81
- suggestion: 'Please check your input and try again',
82
- }),
83
- /**
84
- * Generic error
85
- */
86
- generic: (message, suggestion) => ({
87
- message,
88
- suggestion,
89
- }),
90
- };
91
- /**
92
- * Parse an Error object into ErrorDetail
93
- */
94
- export function parseError(err) {
95
- if (err instanceof Error) {
96
- return {
97
- message: err.message,
98
- cause: err.cause,
99
- };
100
- }
101
- if (typeof err === 'string') {
102
- return { message: err };
103
- }
104
- return { message: 'An unknown error occurred' };
105
- }
106
- /**
107
- * Display error from caught exception
108
- */
109
- export function showError(err) {
110
- const detail = parseError(err);
111
- return displayError(detail);
112
- }
113
- //# sourceMappingURL=ErrorDisplay.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ErrorDisplay.js","sourceRoot":"","sources":["../../../src/ui/terminal/ErrorDisplay.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,aAAa,EAAE,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAYxE;;GAEG;AACH,MAAM,UAAU,WAAW,CAAC,MAAmB;IAC3C,IAAI,MAAM,GAAG,EAAE,CAAC;IAEhB,qBAAqB;IACrB,MAAM,IAAI,aAAa,CAAC,OAAO,EAAE,MAAM,CAAC,OAAO,CAAC,GAAG,IAAI,CAAC;IAExD,wBAAwB;IACxB,IAAI,MAAM,CAAC,IAAI,EAAE,CAAC;QACd,MAAM,IAAI,KAAK,CAAC,WAAW,MAAM,CAAC,IAAI,IAAI,CAAC,CAAC;IAChD,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CAAC,IAAY,EAAe,EAAE,CAAC,CAAC;QAC1C,OAAO,EAAE,mBAAmB,IAAI,EAAE;QAClC,UAAU,EAAE,mCAAmC;KAClD,CAAC;IAEF;;OAEG;IACH,YAAY,EAAE,CAAC,KAAc,EAAe,EAAE,CAAC,CAAC;QAC5C,OAAO,EAAE,KAAK,CAAC,CAAC,CAAC,WAAW,KAAK,EAAE,CAAC,CAAC,CAAC,eAAe;QACrD,UAAU,EAAE,uCAAuC;KACtD,CAAC;IAEF;;OAEG;IACH,OAAO,EAAE,CAAC,OAAe,EAAE,UAAmB,EAAe,EAAE,CAAC,CAAC;QAC7D,OAAO;QACP,UAAU;KACb,CAAC;CACL,CAAC;AAEF;;GAEG;AACH,MAAM,UAAU,UAAU,CAAC,GAAY;IACnC,IAAI,GAAG,YAAY,KAAK,EAAE,CAAC;QACvB,OAAO;YACH,OAAO,EAAE,GAAG,CAAC,OAAO;YACpB,KAAK,EAAE,GAAG,CAAC,KAA2B;SACzC,CAAC;IACN,CAAC;IAED,IAAI,OAAO,GAAG,KAAK,QAAQ,EAAE,CAAC;QAC1B,OAAO,EAAE,OAAO,EAAE,GAAG,EAAE,CAAC;IAC5B,CAAC;IAED,OAAO,EAAE,OAAO,EAAE,2BAA2B,EAAE,CAAC;AACpD,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,SAAS,CAAC,GAAY;IAClC,MAAM,MAAM,GAAG,UAAU,CAAC,GAAG,CAAC,CAAC;IAC/B,OAAO,YAAY,CAAC,MAAM,CAAC,CAAC;AAChC,CAAC"}
@@ -1,21 +0,0 @@
1
- /**
2
- * Help Display
3
- * Centralized help content for the CLI
4
- */
5
- /**
6
- * Get full help text
7
- */
8
- export declare function getFullHelp(): string;
9
- /**
10
- * Get quick help (one-line hints)
11
- */
12
- export declare function getQuickHelp(): string;
13
- /**
14
- * Get command-specific help
15
- */
16
- export declare function getCommandHelp(command: string): string | null;
17
- /**
18
- * Get keybinding help table
19
- */
20
- export declare function getKeyBindings(): string;
21
- //# sourceMappingURL=HelpDisplay.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"HelpDisplay.d.ts","sourceRoot":"","sources":["../../../src/ui/terminal/HelpDisplay.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH;;GAEG;AACH,wBAAgB,WAAW,IAAI,MAAM,CAqCpC;AAED;;GAEG;AACH,wBAAgB,YAAY,IAAI,MAAM,CAErC;AAED;;GAEG;AACH,wBAAgB,cAAc,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAc7D;AAED;;GAEG;AACH,wBAAgB,cAAc,IAAI,MAAM,CAgBvC"}
@@ -1,89 +0,0 @@
1
- /**
2
- * Help Display
3
- * Centralized help content for the CLI
4
- */
5
- import { success, info, warning, primary, muted } from '../theme/index.js';
6
- /**
7
- * Get full help text
8
- */
9
- export function getFullHelp() {
10
- return `
11
- ${info('Available Commands:')}
12
-
13
- ${success('/exit, /quit, /q')} Exit the chat session
14
- ${success('/clear, /cls')} Clear the screen
15
- ${success('/help, /h, /?')} Show this help message
16
- ${success('/debug')} Toggle debug mode
17
- ${success('/raw')} Toggle raw output mode (no markdown)
18
- ${success('/mcp')} Show MCP connection status
19
-
20
- ${info('Keyboard Shortcuts:')}
21
-
22
- ${warning('Ctrl+C')} Exit or abort current operation
23
- ${warning('Ctrl+D')} Exit (alternative)
24
- ${warning('Tab')} Command completion
25
- ${warning('↑/↓')} Navigate command history
26
- ${warning('Ctrl+L')} Clear screen
27
-
28
- ${info('Chat Features:')}
29
-
30
- ${primary('MCP Tools')} Local tool calling via Model Context Protocol
31
- ${primary('Streaming')} Real-time response streaming
32
- ${primary('Markdown')} Rich formatted responses (unless in raw mode)
33
-
34
- ${info('Modes:')}
35
-
36
- ${success('Raw Mode')} Disable markdown formatting for plain text output
37
- ${success('Debug Mode')} Show detailed logging for troubleshooting
38
-
39
- ${info('Terminal:')}
40
-
41
- Use your terminal's scroll to view message history.
42
- All messages remain visible after exit.
43
-
44
- ${muted('For more information, visit: https://github.com/paean-ai/openpaean')}
45
- `;
46
- }
47
- /**
48
- * Get quick help (one-line hints)
49
- */
50
- export function getQuickHelp() {
51
- return `${primary('[/]')} Commands ${primary('[?]')} Help ${primary('[Tab]')} Complete ${primary('[Ctrl+C]')} Exit`;
52
- }
53
- /**
54
- * Get command-specific help
55
- */
56
- export function getCommandHelp(command) {
57
- const commands = {
58
- '/exit': 'Exit the chat session',
59
- '/quit': 'Exit the chat session (alias for /exit)',
60
- '/q': 'Exit the chat session (short alias)',
61
- '/clear': 'Clear the screen',
62
- '/cls': 'Clear the screen (alias)',
63
- '/help': 'Show this help message',
64
- '/debug': 'Toggle debug mode for detailed logging',
65
- '/raw': 'Toggle raw mode (plain text output, no markdown)',
66
- '/mcp': 'Show MCP server connection status and available tools',
67
- };
68
- return commands[command.toLowerCase()] || null;
69
- }
70
- /**
71
- * Get keybinding help table
72
- */
73
- export function getKeyBindings() {
74
- const bindings = [
75
- { key: 'Ctrl+C', action: 'Exit / Abort' },
76
- { key: 'Ctrl+D', action: 'Exit' },
77
- { key: 'Ctrl+L', action: 'Clear screen' },
78
- { key: 'Tab', action: 'Complete command' },
79
- { key: '↑ / ↓', action: 'History navigation' },
80
- { key: 'Enter', action: 'Send message' },
81
- { key: '?', action: 'Show keybindings' },
82
- ];
83
- let output = '\n' + info('Keybindings:') + '\n\n';
84
- for (const binding of bindings) {
85
- output += ` ${warning(binding.key.padEnd(12))} ${binding.action}\n`;
86
- }
87
- return output;
88
- }
89
- //# sourceMappingURL=HelpDisplay.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"HelpDisplay.js","sourceRoot":"","sources":["../../../src/ui/terminal/HelpDisplay.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAE3E;;GAEG;AACH,MAAM,UAAU,WAAW;IACvB,OAAO;EACT,IAAI,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AC;IAEF,OAAO,QAAQ,CAAC,OAAO,CAAC,WAAW,EAAE,CAAC,IAAI,IAAI,CAAC;AACnD,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,cAAc;IAC1B,MAAM,QAAQ,GAAG;QACb,EAAE,GAAG,EAAE,QAAQ,EAAE,MAAM,EAAE,cAAc,EAAE;QACzC,EAAE,GAAG,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,EAAE;QACjC,EAAE,GAAG,EAAE,QAAQ,EAAE,MAAM,EAAE,cAAc,EAAE;QACzC,EAAE,GAAG,EAAE,KAAK,EAAE,MAAM,EAAE,kBAAkB,EAAE;QAC1C,EAAE,GAAG,EAAE,OAAO,EAAE,MAAM,EAAE,oBAAoB,EAAE;QAC9C,EAAE,GAAG,EAAE,OAAO,EAAE,MAAM,EAAE,cAAc,EAAE;QACxC,EAAE,GAAG,EAAE,GAAG,EAAE,MAAM,EAAE,kBAAkB,EAAE;KAC3C,CAAC;IAEF,IAAI,MAAM,GAAG,IAAI,GAAG,IAAI,CAAC,cAAc,CAAC,GAAG,MAAM,CAAC;IAClD,KAAK,MAAM,OAAO,IAAI,QAAQ,EAAE,CAAC;QAC7B,MAAM,IAAI,KAAK,OAAO,CAAC,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC,IAAI,OAAO,CAAC,MAAM,IAAI,CAAC;IACzE,CAAC;IACD,OAAO,MAAM,CAAC;AAClB,CAAC"}
@@ -1,19 +0,0 @@
1
- /**
2
- * Articulate (a8e) CLI Executor
3
- * Integrates with the Articulate CLI for local-first AI-assisted coding tasks
4
- * https://github.com/a8e-ai/a8e
5
- */
6
- import type { ExecutorOptions, ExecutorResult, AvailabilityStatus } from '../types.js';
7
- import type { AgentExecutor } from './index.js';
8
- export declare class ArticulateExecutor implements AgentExecutor {
9
- readonly type: "articulate";
10
- private process;
11
- private binaryPath;
12
- constructor(binaryPath?: string);
13
- isAvailable(): Promise<boolean>;
14
- checkAvailability(): Promise<AvailabilityStatus>;
15
- execute(prompt: string, options?: ExecutorOptions): Promise<ExecutorResult>;
16
- private buildArgs;
17
- abort(): void;
18
- }
19
- //# sourceMappingURL=articulate.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"articulate.d.ts","sourceRoot":"","sources":["../../../src/worker/executors/articulate.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAKH,OAAO,KAAK,EAAE,eAAe,EAAE,cAAc,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AACvF,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAIhD,qBAAa,kBAAmB,YAAW,aAAa;IACpD,QAAQ,CAAC,IAAI,EAAG,YAAY,CAAU;IACtC,OAAO,CAAC,OAAO,CAA6B;IAC5C,OAAO,CAAC,UAAU,CAAS;gBAEf,UAAU,GAAE,MAAc;IAIhC,WAAW,IAAI,OAAO,CAAC,OAAO,CAAC;IAS/B,iBAAiB,IAAI,OAAO,CAAC,kBAAkB,CAAC;IAmChD,OAAO,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,eAAe,GAAG,OAAO,CAAC,cAAc,CAAC;IA4EjF,OAAO,CAAC,SAAS;IAejB,KAAK,IAAI,IAAI;CAMhB"}
@@ -1,147 +0,0 @@
1
- /**
2
- * Articulate (a8e) CLI Executor
3
- * Integrates with the Articulate CLI for local-first AI-assisted coding tasks
4
- * https://github.com/a8e-ai/a8e
5
- */
6
- import { spawn } from 'child_process';
7
- import { promisify } from 'util';
8
- import { exec as execCallback } from 'child_process';
9
- const exec = promisify(execCallback);
10
- export class ArticulateExecutor {
11
- type = 'articulate';
12
- process = null;
13
- binaryPath;
14
- constructor(binaryPath = 'a8e') {
15
- this.binaryPath = binaryPath;
16
- }
17
- async isAvailable() {
18
- try {
19
- await exec(`which ${this.binaryPath}`);
20
- return true;
21
- }
22
- catch {
23
- return false;
24
- }
25
- }
26
- async checkAvailability() {
27
- try {
28
- const { stdout: whichOut } = await exec(`which ${this.binaryPath}`);
29
- const binaryPath = whichOut.trim();
30
- try {
31
- const { stdout } = await exec(`${this.binaryPath} info`, { timeout: 10000 });
32
- const versionMatch = stdout.match(/(?:v(?:ersion)?\s*)?(\d+\.\d+(?:\.\d+)?)/i);
33
- return {
34
- available: true,
35
- binaryExists: true,
36
- binaryPath,
37
- authStatus: 'authenticated',
38
- version: versionMatch?.[1],
39
- };
40
- }
41
- catch {
42
- return {
43
- available: true,
44
- binaryExists: true,
45
- binaryPath,
46
- authStatus: 'unknown',
47
- authMessage: 'a8e uses BYOK (Bring Your Own Key) — ensure a provider is configured',
48
- };
49
- }
50
- }
51
- catch {
52
- return {
53
- available: false,
54
- binaryExists: false,
55
- authStatus: 'unknown',
56
- error: `Binary '${this.binaryPath}' not found in PATH. Install: curl -fsSL https://a8e.ai/install.sh | bash`,
57
- };
58
- }
59
- }
60
- async execute(prompt, options) {
61
- const startTime = Date.now();
62
- const args = this.buildArgs(prompt, options);
63
- return new Promise((resolve) => {
64
- let stdout = '';
65
- let stderr = '';
66
- const timeout = options?.timeout ?? 600000;
67
- this.process = spawn(this.binaryPath, args, {
68
- cwd: options?.cwd,
69
- env: { ...process.env, ...options?.env },
70
- stdio: ['ignore', 'pipe', 'pipe'],
71
- });
72
- const timeoutId = setTimeout(() => {
73
- if (this.process) {
74
- this.process.kill('SIGTERM');
75
- resolve({
76
- success: false,
77
- output: stdout,
78
- error: `Execution timed out after ${timeout}ms`,
79
- durationMs: Date.now() - startTime,
80
- });
81
- }
82
- }, timeout);
83
- this.process.stdout?.on('data', (data) => {
84
- const text = data.toString();
85
- stdout += text;
86
- options?.onOutput?.(text, 'stdout');
87
- });
88
- this.process.stderr?.on('data', (data) => {
89
- const text = data.toString();
90
- stderr += text;
91
- options?.onOutput?.(text, 'stderr');
92
- });
93
- this.process.on('close', (code) => {
94
- clearTimeout(timeoutId);
95
- this.process = null;
96
- let structured;
97
- try {
98
- if (stdout.trim().startsWith('{')) {
99
- structured = JSON.parse(stdout);
100
- }
101
- }
102
- catch {
103
- // Not JSON
104
- }
105
- resolve({
106
- success: code === 0,
107
- output: stdout,
108
- error: code !== 0 ? stderr || `Exit code: ${code}` : undefined,
109
- exitCode: code ?? undefined,
110
- durationMs: Date.now() - startTime,
111
- structured,
112
- });
113
- });
114
- this.process.on('error', (err) => {
115
- clearTimeout(timeoutId);
116
- this.process = null;
117
- resolve({
118
- success: false,
119
- output: stdout,
120
- error: err.message,
121
- durationMs: Date.now() - startTime,
122
- });
123
- });
124
- });
125
- }
126
- buildArgs(prompt, options) {
127
- const args = ['run'];
128
- args.push('--text', prompt);
129
- if (options?.captureOutput) {
130
- args.push('--output-format', 'json');
131
- }
132
- if (options?.skipPermissions) {
133
- args.push('--no-session');
134
- }
135
- if (options?.args) {
136
- args.push(...options.args);
137
- }
138
- return args;
139
- }
140
- abort() {
141
- if (this.process) {
142
- this.process.kill('SIGTERM');
143
- this.process = null;
144
- }
145
- }
146
- }
147
- //# sourceMappingURL=articulate.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"articulate.js","sourceRoot":"","sources":["../../../src/worker/executors/articulate.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,KAAK,EAAqB,MAAM,eAAe,CAAC;AACzD,OAAO,EAAE,SAAS,EAAE,MAAM,MAAM,CAAC;AACjC,OAAO,EAAE,IAAI,IAAI,YAAY,EAAE,MAAM,eAAe,CAAC;AAIrD,MAAM,IAAI,GAAG,SAAS,CAAC,YAAY,CAAC,CAAC;AAErC,MAAM,OAAO,kBAAkB;IAClB,IAAI,GAAG,YAAqB,CAAC;IAC9B,OAAO,GAAwB,IAAI,CAAC;IACpC,UAAU,CAAS;IAE3B,YAAY,aAAqB,KAAK;QAClC,IAAI,CAAC,UAAU,GAAG,UAAU,CAAC;IACjC,CAAC;IAED,KAAK,CAAC,WAAW;QACb,IAAI,CAAC;YACD,MAAM,IAAI,CAAC,SAAS,IAAI,CAAC,UAAU,EAAE,CAAC,CAAC;YAC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I,CAAC,GAAG,EAAE,GAAG,SAAS;iBACrC,CAAC,CAAC;YACP,CAAC,CAAC,CAAC;QACP,CAAC,CAAC,CAAC;IACP,CAAC;IAEO,SAAS,CAAC,MAAc,EAAE,OAAyB;QACvD,MAAM,IAAI,GAAa,CAAC,KAAK,CAAC,CAAC;QAC/B,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAC;QAC5B,IAAI,OAAO,EAAE,aAAa,EAAE,CAAC;YACzB,IAAI,CAAC,IAAI,CAAC,iBAAiB,EAAE,MAAM,CAAC,CAAC;QACzC,CAAC;QACD,IAAI,OAAO,EAAE,eAAe,EAAE,CAAC;YAC3B,IAAI,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC;QAC9B,CAAC;QACD,IAAI,OAAO,EAAE,IAAI,EAAE,CAAC;YAChB,IAAI,CAAC,IAAI,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;QAC/B,CAAC;QACD,OAAO,IAAI,CAAC;IAChB,CAAC;IAED,KAAK;QACD,IAAI,IAAI,CAAC,OAAO,EAAE,CAAC;YACf,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;YAC7B,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC;QACxB,CAAC;IACL,CAAC;CACJ"}
@@ -1,17 +0,0 @@
1
- /**
2
- * Claude Code CLI Executor
3
- * Integrates with Claude Code CLI for complex refactoring and code understanding
4
- */
5
- import type { ExecutorOptions, ExecutorResult } from '../types.js';
6
- import type { AgentExecutor } from './index.js';
7
- export declare class ClaudeExecutor implements AgentExecutor {
8
- readonly type: "claude";
9
- private process;
10
- private binaryPath;
11
- constructor(binaryPath?: string);
12
- isAvailable(): Promise<boolean>;
13
- execute(prompt: string, options?: ExecutorOptions): Promise<ExecutorResult>;
14
- private buildArgs;
15
- abort(): void;
16
- }
17
- //# sourceMappingURL=claude.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"claude.d.ts","sourceRoot":"","sources":["../../../src/worker/executors/claude.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAKH,OAAO,KAAK,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AACnE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAIhD,qBAAa,cAAe,YAAW,aAAa;IAChD,QAAQ,CAAC,IAAI,EAAG,QAAQ,CAAU;IAClC,OAAO,CAAC,OAAO,CAA6B;IAC5C,OAAO,CAAC,UAAU,CAAS;gBAEf,UAAU,GAAE,MAAiB;IAInC,WAAW,IAAI,OAAO,CAAC,OAAO,CAAC;IAS/B,OAAO,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,eAAe,GAAG,OAAO,CAAC,cAAc,CAAC;IAkEjF,OAAO,CAAC,SAAS;IAcjB,KAAK,IAAI,IAAI;CAMhB"}
@@ -1,102 +0,0 @@
1
- /**
2
- * Claude Code CLI Executor
3
- * Integrates with Claude Code CLI for complex refactoring and code understanding
4
- */
5
- import { spawn } from 'child_process';
6
- import { promisify } from 'util';
7
- import { exec as execCallback } from 'child_process';
8
- const exec = promisify(execCallback);
9
- export class ClaudeExecutor {
10
- type = 'claude';
11
- process = null;
12
- binaryPath;
13
- constructor(binaryPath = 'claude') {
14
- this.binaryPath = binaryPath;
15
- }
16
- async isAvailable() {
17
- try {
18
- await exec(`which ${this.binaryPath}`);
19
- return true;
20
- }
21
- catch {
22
- return false;
23
- }
24
- }
25
- async execute(prompt, options) {
26
- const startTime = Date.now();
27
- const args = this.buildArgs(prompt, options);
28
- return new Promise((resolve) => {
29
- let stdout = '';
30
- let stderr = '';
31
- const timeout = options?.timeout ?? 900000;
32
- this.process = spawn(this.binaryPath, args, {
33
- cwd: options?.cwd,
34
- env: { ...process.env, ...options?.env },
35
- stdio: ['ignore', 'pipe', 'pipe'],
36
- });
37
- const timeoutId = setTimeout(() => {
38
- if (this.process) {
39
- this.process.kill('SIGTERM');
40
- resolve({
41
- success: false,
42
- output: stdout,
43
- error: `Execution timed out after ${timeout}ms`,
44
- durationMs: Date.now() - startTime,
45
- });
46
- }
47
- }, timeout);
48
- this.process.stdout?.on('data', (data) => {
49
- const text = data.toString();
50
- stdout += text;
51
- options?.onOutput?.(text, 'stdout');
52
- });
53
- this.process.stderr?.on('data', (data) => {
54
- const text = data.toString();
55
- stderr += text;
56
- options?.onOutput?.(text, 'stderr');
57
- });
58
- this.process.on('close', (code) => {
59
- clearTimeout(timeoutId);
60
- this.process = null;
61
- resolve({
62
- success: code === 0,
63
- output: stdout,
64
- error: code !== 0 ? stderr || `Exit code: ${code}` : undefined,
65
- exitCode: code ?? undefined,
66
- durationMs: Date.now() - startTime,
67
- });
68
- });
69
- this.process.on('error', (err) => {
70
- clearTimeout(timeoutId);
71
- this.process = null;
72
- resolve({
73
- success: false,
74
- output: stdout,
75
- error: err.message,
76
- durationMs: Date.now() - startTime,
77
- });
78
- });
79
- });
80
- }
81
- buildArgs(prompt, options) {
82
- const args = [];
83
- args.push('-p', prompt);
84
- if (options?.skipPermissions) {
85
- args.push('--dangerously-skip-permissions');
86
- }
87
- else {
88
- args.push('--permission-mode', 'acceptEdits');
89
- }
90
- if (options?.args) {
91
- args.push(...options.args);
92
- }
93
- return args;
94
- }
95
- abort() {
96
- if (this.process) {
97
- this.process.kill('SIGTERM');
98
- this.process = null;
99
- }
100
- }
101
- }
102
- //# sourceMappingURL=claude.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"claude.js","sourceRoot":"","sources":["../../../src/worker/executors/claude.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,KAAK,EAAqB,MAAM,eAAe,CAAC;AACzD,OAAO,EAAE,SAAS,EAAE,MAAM,MAAM,CAAC;AACjC,OAAO,EAAE,IAAI,IAAI,YAAY,EAAE,MAAM,eAAe,CAAC;AAIrD,MAAM,IAAI,GAAG,SAAS,CAAC,YAAY,CAAC,CAAC;AAErC,MAAM,OAAO,cAAc;IACd,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EAAE,CAAC,OAAO,EAAE,CAAC,GAAG,EAAE,EAAE;gBAC7B,YAAY,CAAC,SAAS,CAAC,CAAC;gBACxB,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC;gBAEpB,OAAO,CAAC;oBACJ,OAAO,EAAE,KAAK;oBACd,MAAM,EAAE,MAAM;oBACd,KAAK,EAAE,GAAG,CAAC,OAAO;oBAClB,UAAU,EAAE,IAAI,CAAC,GAAG,EAAE,GAAG,SAAS;iBACrC,CAAC,CAAC;YACP,CAAC,CAAC,CAAC;QACP,CAAC,CAAC,CAAC;IACP,CAAC;IAEO,SAAS,CAAC,MAAc,EAAE,OAAyB;QACvD,MAAM,IAAI,GAAa,EAAE,CAAC;QAC1B,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;QACxB,IAAI,OAAO,EAAE,eAAe,EAAE,CAAC;YAC3B,IAAI,CAAC,IAAI,CAAC,gCAAgC,CAAC,CAAC;QAChD,CAAC;aAAM,CAAC;YACJ,IAAI,CAAC,IAAI,CAAC,mBAAmB,EAAE,aAAa,CAAC,CAAC;QAClD,CAAC;QACD,IAAI,OAAO,EAAE,IAAI,EAAE,CAAC;YAChB,IAAI,CAAC,IAAI,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;QAC/B,CAAC;QACD,OAAO,IAAI,CAAC;IAChB,CAAC;IAED,KAAK;QACD,IAAI,IAAI,CAAC,OAAO,EAAE,CAAC;YACf,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;YAC7B,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC;QACxB,CAAC;IACL,CAAC;CACJ"}
@@ -1,26 +0,0 @@
1
- /**
2
- * Executor Framework
3
- * Base interface and registry for multi-agent executors
4
- */
5
- import type { ExecutorType, ExecutorOptions, ExecutorResult, ExecutorConfig, AvailabilityStatus } from '../types.js';
6
- export interface AgentExecutor {
7
- readonly type: ExecutorType;
8
- isAvailable(): Promise<boolean>;
9
- execute(prompt: string, options?: ExecutorOptions): Promise<ExecutorResult>;
10
- abort(): void;
11
- checkAvailability?(): Promise<AvailabilityStatus>;
12
- }
13
- export declare class ExecutorRegistry {
14
- private executors;
15
- private configs;
16
- register(executor: AgentExecutor, config?: ExecutorConfig): void;
17
- get(type: ExecutorType): AgentExecutor | undefined;
18
- getConfig(type: ExecutorType): ExecutorConfig | undefined;
19
- isEnabled(type: ExecutorType): boolean;
20
- getAvailable(): Promise<ExecutorType[]>;
21
- getRegistered(): ExecutorType[];
22
- execute(type: ExecutorType, prompt: string, options?: ExecutorOptions): Promise<ExecutorResult>;
23
- }
24
- export declare function getExecutorRegistry(): ExecutorRegistry;
25
- export declare function resetExecutorRegistry(): void;
26
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/worker/executors/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,YAAY,EAAE,eAAe,EAAE,cAAc,EAAE,cAAc,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AAErH,MAAM,WAAW,aAAa;IAC1B,QAAQ,CAAC,IAAI,EAAE,YAAY,CAAC;IAC5B,WAAW,IAAI,OAAO,CAAC,OAAO,CAAC,CAAC;IAChC,OAAO,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,eAAe,GAAG,OAAO,CAAC,cAAc,CAAC,CAAC;IAC5E,KAAK,IAAI,IAAI,CAAC;IACd,iBAAiB,CAAC,IAAI,OAAO,CAAC,kBAAkB,CAAC,CAAC;CACrD;AAED,qBAAa,gBAAgB;IACzB,OAAO,CAAC,SAAS,CAA+C;IAChE,OAAO,CAAC,OAAO,CAAgD;IAE/D,QAAQ,CAAC,QAAQ,EAAE,aAAa,EAAE,MAAM,CAAC,EAAE,cAAc,GAAG,IAAI;IAOhE,GAAG,CAAC,IAAI,EAAE,YAAY,GAAG,aAAa,GAAG,SAAS;IAIlD,SAAS,CAAC,IAAI,EAAE,YAAY,GAAG,cAAc,GAAG,SAAS;IAIzD,SAAS,CAAC,IAAI,EAAE,YAAY,GAAG,OAAO;IAKhC,YAAY,IAAI,OAAO,CAAC,YAAY,EAAE,CAAC;IAe7C,aAAa,IAAI,YAAY,EAAE;IAIzB,OAAO,CACT,IAAI,EAAE,YAAY,EAClB,MAAM,EAAE,MAAM,EACd,OAAO,CAAC,EAAE,eAAe,GAC1B,OAAO,CAAC,cAAc,CAAC;CA8B7B;AAID,wBAAgB,mBAAmB,IAAI,gBAAgB,CAKtD;AAED,wBAAgB,qBAAqB,IAAI,IAAI,CAE5C"}
@@ -1,81 +0,0 @@
1
- /**
2
- * Executor Framework
3
- * Base interface and registry for multi-agent executors
4
- */
5
- export class ExecutorRegistry {
6
- executors = new Map();
7
- configs = new Map();
8
- register(executor, config) {
9
- this.executors.set(executor.type, executor);
10
- if (config) {
11
- this.configs.set(executor.type, config);
12
- }
13
- }
14
- get(type) {
15
- return this.executors.get(type);
16
- }
17
- getConfig(type) {
18
- return this.configs.get(type);
19
- }
20
- isEnabled(type) {
21
- const config = this.configs.get(type);
22
- return config?.enabled !== false;
23
- }
24
- async getAvailable() {
25
- const available = [];
26
- for (const [type, executor] of this.executors) {
27
- if (!this.isEnabled(type))
28
- continue;
29
- try {
30
- if (await executor.isAvailable()) {
31
- available.push(type);
32
- }
33
- }
34
- catch {
35
- // Not available
36
- }
37
- }
38
- return available;
39
- }
40
- getRegistered() {
41
- return Array.from(this.executors.keys());
42
- }
43
- async execute(type, prompt, options) {
44
- const executor = this.executors.get(type);
45
- if (!executor) {
46
- return {
47
- success: false,
48
- output: '',
49
- error: `Executor '${type}' not registered`,
50
- durationMs: 0,
51
- };
52
- }
53
- const available = await executor.isAvailable();
54
- if (!available) {
55
- return {
56
- success: false,
57
- output: '',
58
- error: `Executor '${type}' is not available on this system`,
59
- durationMs: 0,
60
- };
61
- }
62
- const config = this.configs.get(type);
63
- const mergedOptions = {
64
- timeout: config?.timeout,
65
- args: config?.defaultArgs,
66
- ...options,
67
- };
68
- return executor.execute(prompt, mergedOptions);
69
- }
70
- }
71
- let registryInstance = null;
72
- export function getExecutorRegistry() {
73
- if (!registryInstance) {
74
- registryInstance = new ExecutorRegistry();
75
- }
76
- return registryInstance;
77
- }
78
- export function resetExecutorRegistry() {
79
- registryInstance = null;
80
- }
81
- //# sourceMappingURL=index.js.map