@sudocode-ai/local-server 0.1.6 → 0.1.7
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/dist/execution/process/builders/claude.d.ts +1 -1
- package/dist/execution/process/builders/claude.d.ts.map +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +70 -11
- package/dist/index.js.map +1 -1
- package/dist/public/assets/index-B3SEMufD.js +580 -0
- package/dist/public/assets/{index-BvlblDHK.js.map → index-B3SEMufD.js.map} +1 -1
- package/dist/public/assets/index-D2YGL3gX.css +1 -0
- package/dist/public/index.html +2 -2
- package/dist/routes/feedback.d.ts.map +1 -1
- package/dist/routes/feedback.js +20 -12
- package/dist/routes/feedback.js.map +1 -1
- package/dist/services/db.d.ts.map +1 -1
- package/dist/services/db.js +19 -14
- package/dist/services/db.js.map +1 -1
- package/dist/services/execution-service.d.ts.map +1 -1
- package/dist/services/execution-service.js +43 -22
- package/dist/services/execution-service.js.map +1 -1
- package/dist/services/executions.d.ts.map +1 -1
- package/dist/services/executions.js +15 -0
- package/dist/services/executions.js.map +1 -1
- package/dist/services/feedback.d.ts +16 -0
- package/dist/services/feedback.d.ts.map +1 -1
- package/dist/services/feedback.js +25 -1
- package/dist/services/feedback.js.map +1 -1
- package/dist/services/repo-info.d.ts +17 -0
- package/dist/services/repo-info.d.ts.map +1 -0
- package/dist/services/repo-info.js +53 -0
- package/dist/services/repo-info.js.map +1 -0
- package/dist/services/websocket.d.ts +25 -3
- package/dist/services/websocket.d.ts.map +1 -1
- package/dist/services/websocket.js +71 -7
- package/dist/services/websocket.js.map +1 -1
- package/package.json +4 -3
- package/dist/execution/engine/engine.d.ts +0 -103
- package/dist/execution/engine/engine.d.ts.map +0 -1
- package/dist/execution/engine/engine.js +0 -10
- package/dist/execution/engine/engine.js.map +0 -1
- package/dist/execution/engine/simple-engine.d.ts +0 -190
- package/dist/execution/engine/simple-engine.d.ts.map +0 -1
- package/dist/execution/engine/simple-engine.js +0 -611
- package/dist/execution/engine/simple-engine.js.map +0 -1
- package/dist/execution/engine/types.d.ts +0 -116
- package/dist/execution/engine/types.d.ts.map +0 -1
- package/dist/execution/engine/types.js +0 -10
- package/dist/execution/engine/types.js.map +0 -1
- package/dist/execution/process/index.d.ts +0 -15
- package/dist/execution/process/index.d.ts.map +0 -1
- package/dist/execution/process/index.js +0 -15
- package/dist/execution/process/index.js.map +0 -1
- package/dist/execution/process/manager.d.ts +0 -133
- package/dist/execution/process/manager.d.ts.map +0 -1
- package/dist/execution/process/manager.js +0 -10
- package/dist/execution/process/manager.js.map +0 -1
- package/dist/execution/process/simple-manager.d.ts +0 -102
- package/dist/execution/process/simple-manager.d.ts.map +0 -1
- package/dist/execution/process/simple-manager.js +0 -336
- package/dist/execution/process/simple-manager.js.map +0 -1
- package/dist/execution/process/types.d.ts +0 -105
- package/dist/execution/process/types.d.ts.map +0 -1
- package/dist/execution/process/types.js +0 -10
- package/dist/execution/process/types.js.map +0 -1
- package/dist/execution/process/utils.d.ts +0 -53
- package/dist/execution/process/utils.d.ts.map +0 -1
- package/dist/execution/process/utils.js +0 -97
- package/dist/execution/process/utils.js.map +0 -1
- package/dist/execution/resilience/circuit-breaker.d.ts +0 -170
- package/dist/execution/resilience/circuit-breaker.d.ts.map +0 -1
- package/dist/execution/resilience/circuit-breaker.js +0 -291
- package/dist/execution/resilience/circuit-breaker.js.map +0 -1
- package/dist/execution/resilience/executor.d.ts +0 -109
- package/dist/execution/resilience/executor.d.ts.map +0 -1
- package/dist/execution/resilience/executor.js +0 -10
- package/dist/execution/resilience/executor.js.map +0 -1
- package/dist/execution/resilience/index.d.ts +0 -14
- package/dist/execution/resilience/index.d.ts.map +0 -1
- package/dist/execution/resilience/index.js +0 -15
- package/dist/execution/resilience/index.js.map +0 -1
- package/dist/execution/resilience/resilient-executor.d.ts +0 -86
- package/dist/execution/resilience/resilient-executor.d.ts.map +0 -1
- package/dist/execution/resilience/resilient-executor.js +0 -261
- package/dist/execution/resilience/resilient-executor.js.map +0 -1
- package/dist/execution/resilience/retry.d.ts +0 -161
- package/dist/execution/resilience/retry.d.ts.map +0 -1
- package/dist/execution/resilience/retry.js +0 -234
- package/dist/execution/resilience/retry.js.map +0 -1
- package/dist/execution/resilience/types.d.ts +0 -226
- package/dist/execution/resilience/types.d.ts.map +0 -1
- package/dist/execution/resilience/types.js +0 -30
- package/dist/execution/resilience/types.js.map +0 -1
- package/dist/execution/workflow/index.d.ts +0 -13
- package/dist/execution/workflow/index.d.ts.map +0 -1
- package/dist/execution/workflow/index.js +0 -13
- package/dist/execution/workflow/index.js.map +0 -1
- package/dist/execution/workflow/linear-orchestrator.d.ts +0 -216
- package/dist/execution/workflow/linear-orchestrator.d.ts.map +0 -1
- package/dist/execution/workflow/linear-orchestrator.js +0 -683
- package/dist/execution/workflow/linear-orchestrator.js.map +0 -1
- package/dist/execution/workflow/memory-storage.d.ts +0 -54
- package/dist/execution/workflow/memory-storage.d.ts.map +0 -1
- package/dist/execution/workflow/memory-storage.js +0 -68
- package/dist/execution/workflow/memory-storage.js.map +0 -1
- package/dist/execution/workflow/orchestrator.d.ts +0 -158
- package/dist/execution/workflow/orchestrator.d.ts.map +0 -1
- package/dist/execution/workflow/orchestrator.js +0 -9
- package/dist/execution/workflow/orchestrator.js.map +0 -1
- package/dist/execution/workflow/types.d.ts +0 -172
- package/dist/execution/workflow/types.d.ts.map +0 -1
- package/dist/execution/workflow/types.js +0 -9
- package/dist/execution/workflow/types.js.map +0 -1
- package/dist/execution/workflow/utils.d.ts +0 -89
- package/dist/execution/workflow/utils.d.ts.map +0 -1
- package/dist/execution/workflow/utils.js +0 -152
- package/dist/execution/workflow/utils.js.map +0 -1
- package/dist/public/assets/index-BvlblDHK.js +0 -570
- package/dist/public/assets/index-BwuKdLgN.css +0 -1
|
@@ -1,190 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Simple Execution Engine
|
|
3
|
-
*
|
|
4
|
-
* Queue-based execution engine that spawns a process per task
|
|
5
|
-
* with concurrency limits. Implements the "simple first" approach.
|
|
6
|
-
*
|
|
7
|
-
* @module execution/engine/simple-engine
|
|
8
|
-
*/
|
|
9
|
-
import type { IExecutionEngine } from "./engine.js";
|
|
10
|
-
import type { ExecutionTask, ExecutionResult, TaskStatus, EngineMetrics, TaskCompleteHandler, TaskFailedHandler, EngineConfig } from "./types.js";
|
|
11
|
-
import type { IProcessManager } from "../process/manager.js";
|
|
12
|
-
/**
|
|
13
|
-
* SimpleExecutionEngine - Queue-based task execution with concurrency control
|
|
14
|
-
*
|
|
15
|
-
* Key features:
|
|
16
|
-
* - FIFO queue for task ordering
|
|
17
|
-
* - Configurable concurrency limit (default: 3)
|
|
18
|
-
* - Automatic retry on failure
|
|
19
|
-
* - Event emission for task lifecycle
|
|
20
|
-
* - Promise-based waiting
|
|
21
|
-
* - Graceful shutdown
|
|
22
|
-
*/
|
|
23
|
-
export declare class SimpleExecutionEngine implements IExecutionEngine {
|
|
24
|
-
private _processManager;
|
|
25
|
-
private _config;
|
|
26
|
-
private taskQueue;
|
|
27
|
-
private runningTasks;
|
|
28
|
-
private completedResults;
|
|
29
|
-
private taskResolvers;
|
|
30
|
-
private metrics;
|
|
31
|
-
private completeHandlers;
|
|
32
|
-
private failedHandlers;
|
|
33
|
-
private pollingIntervals;
|
|
34
|
-
/**
|
|
35
|
-
* Create a new SimpleExecutionEngine
|
|
36
|
-
*
|
|
37
|
-
* @param processManager - Process manager for spawning Claude processes
|
|
38
|
-
* @param config - Engine configuration options
|
|
39
|
-
*/
|
|
40
|
-
constructor(_processManager: IProcessManager, _config?: EngineConfig);
|
|
41
|
-
/**
|
|
42
|
-
* Submit a single task for execution
|
|
43
|
-
*
|
|
44
|
-
* Adds task to queue and attempts to start execution if capacity available.
|
|
45
|
-
*
|
|
46
|
-
* @param task - The task to execute
|
|
47
|
-
* @returns Promise resolving to the task ID
|
|
48
|
-
*/
|
|
49
|
-
submitTask(task: ExecutionTask): Promise<string>;
|
|
50
|
-
/**
|
|
51
|
-
* Submit multiple tasks for execution
|
|
52
|
-
*
|
|
53
|
-
* @param tasks - Array of tasks to execute
|
|
54
|
-
* @returns Promise resolving to array of task IDs
|
|
55
|
-
*/
|
|
56
|
-
submitTasks(tasks: ExecutionTask[]): Promise<string[]>;
|
|
57
|
-
/**
|
|
58
|
-
* Process the task queue
|
|
59
|
-
*
|
|
60
|
-
* Dequeues tasks and starts execution while capacity is available.
|
|
61
|
-
* Checks dependencies before execution and re-queues if not met.
|
|
62
|
-
*
|
|
63
|
-
* @private
|
|
64
|
-
*/
|
|
65
|
-
private processQueue;
|
|
66
|
-
/**
|
|
67
|
-
* Check if all task dependencies are met
|
|
68
|
-
*
|
|
69
|
-
* @param task - Task to check
|
|
70
|
-
* @returns True if all dependencies completed successfully
|
|
71
|
-
* @private
|
|
72
|
-
*/
|
|
73
|
-
private areDependenciesMet;
|
|
74
|
-
/**
|
|
75
|
-
* Check if any task dependency has failed
|
|
76
|
-
*
|
|
77
|
-
* @param task - Task to check
|
|
78
|
-
* @returns True if any dependency failed
|
|
79
|
-
* @private
|
|
80
|
-
*/
|
|
81
|
-
private hasFailedDependency;
|
|
82
|
-
/**
|
|
83
|
-
* Track task as running and update capacity metrics
|
|
84
|
-
*
|
|
85
|
-
* @param task - Task to start tracking
|
|
86
|
-
* @private
|
|
87
|
-
*/
|
|
88
|
-
private trackTaskStart;
|
|
89
|
-
/**
|
|
90
|
-
* Track task completion and release capacity
|
|
91
|
-
*
|
|
92
|
-
* @param taskId - ID of completed task
|
|
93
|
-
* @private
|
|
94
|
-
*/
|
|
95
|
-
private trackTaskComplete;
|
|
96
|
-
/**
|
|
97
|
-
* Execute a task
|
|
98
|
-
*
|
|
99
|
-
* Acquires a process, sends the prompt, collects output, and builds the result.
|
|
100
|
-
*
|
|
101
|
-
* @param task - Task to execute
|
|
102
|
-
* @private
|
|
103
|
-
*/
|
|
104
|
-
private executeTask;
|
|
105
|
-
/**
|
|
106
|
-
* Wait for a process to exit
|
|
107
|
-
*
|
|
108
|
-
* @param process - The managed process to wait for
|
|
109
|
-
* @param timeoutMs - Optional timeout in milliseconds
|
|
110
|
-
* @private
|
|
111
|
-
*/
|
|
112
|
-
private waitForProcessExit;
|
|
113
|
-
/**
|
|
114
|
-
* Parse metadata from stream-json output
|
|
115
|
-
*
|
|
116
|
-
* Extracts tools used, files changed, tokens, etc. from the output.
|
|
117
|
-
*
|
|
118
|
-
* @param output - Raw output from Claude Code
|
|
119
|
-
* @returns Parsed metadata
|
|
120
|
-
* @private
|
|
121
|
-
*/
|
|
122
|
-
private parseMetadata;
|
|
123
|
-
/**
|
|
124
|
-
* Handle task failure
|
|
125
|
-
*
|
|
126
|
-
* Implements automatic retry logic if maxRetries is configured.
|
|
127
|
-
* Re-queues failed tasks at front of queue for priority retry.
|
|
128
|
-
*
|
|
129
|
-
* @param taskId - ID of failed task
|
|
130
|
-
* @param error - Error that occurred
|
|
131
|
-
* @private
|
|
132
|
-
*/
|
|
133
|
-
private handleTaskFailure;
|
|
134
|
-
/**
|
|
135
|
-
* Cancel a queued or running task
|
|
136
|
-
*
|
|
137
|
-
* Removes task from queue if still queued, or terminates process if running.
|
|
138
|
-
* Idempotent - safe to call multiple times or for non-existent tasks.
|
|
139
|
-
*
|
|
140
|
-
* @param taskId - ID of task to cancel
|
|
141
|
-
*/
|
|
142
|
-
cancelTask(taskId: string): Promise<void>;
|
|
143
|
-
/**
|
|
144
|
-
* Get current status of a task
|
|
145
|
-
*/
|
|
146
|
-
getTaskStatus(taskId: string): TaskStatus | null;
|
|
147
|
-
/**
|
|
148
|
-
* Wait for a task to complete
|
|
149
|
-
*
|
|
150
|
-
* Returns a promise that resolves with the task result when complete.
|
|
151
|
-
* Supports multiple concurrent waiters for the same task.
|
|
152
|
-
*
|
|
153
|
-
* @param taskId - ID of the task to wait for
|
|
154
|
-
* @returns Promise resolving to the execution result
|
|
155
|
-
*/
|
|
156
|
-
waitForTask(taskId: string): Promise<ExecutionResult>;
|
|
157
|
-
/**
|
|
158
|
-
* Wait for multiple tasks to complete
|
|
159
|
-
*
|
|
160
|
-
* Returns a promise that resolves when all tasks complete.
|
|
161
|
-
*
|
|
162
|
-
* @param taskIds - Array of task IDs to wait for
|
|
163
|
-
* @returns Promise resolving to array of execution results
|
|
164
|
-
*/
|
|
165
|
-
waitForTasks(taskIds: string[]): Promise<ExecutionResult[]>;
|
|
166
|
-
/**
|
|
167
|
-
* Get current engine metrics
|
|
168
|
-
*
|
|
169
|
-
* Returns defensive copy of current metrics.
|
|
170
|
-
*
|
|
171
|
-
* @returns Current engine metrics
|
|
172
|
-
*/
|
|
173
|
-
getMetrics(): EngineMetrics;
|
|
174
|
-
/**
|
|
175
|
-
* Register handler for task completion events
|
|
176
|
-
*/
|
|
177
|
-
onTaskComplete(handler: TaskCompleteHandler): void;
|
|
178
|
-
/**
|
|
179
|
-
* Register handler for task failure events
|
|
180
|
-
*/
|
|
181
|
-
onTaskFailed(handler: TaskFailedHandler): void;
|
|
182
|
-
/**
|
|
183
|
-
* Gracefully shutdown the engine
|
|
184
|
-
*
|
|
185
|
-
* Cancels all running tasks, clears the queue, and shuts down the process manager.
|
|
186
|
-
* Idempotent - safe to call multiple times.
|
|
187
|
-
*/
|
|
188
|
-
shutdown(): Promise<void>;
|
|
189
|
-
}
|
|
190
|
-
//# sourceMappingURL=simple-engine.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"simple-engine.d.ts","sourceRoot":"","sources":["../../../src/execution/engine/simple-engine.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AACpD,OAAO,KAAK,EACV,aAAa,EACb,eAAe,EACf,UAAU,EACV,aAAa,EACb,mBAAmB,EACnB,iBAAiB,EACjB,YAAY,EAGb,MAAM,YAAY,CAAC;AACpB,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAI7D;;;;;;;;;;GAUG;A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