tlc-claude-code 1.4.4 → 1.4.6
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/dashboard/dist/App.js +28 -2
- package/dashboard/dist/api/health-diagnostics.d.ts +26 -0
- package/dashboard/dist/api/health-diagnostics.js +85 -0
- package/dashboard/dist/api/health-diagnostics.test.d.ts +1 -0
- package/dashboard/dist/api/health-diagnostics.test.js +126 -0
- package/dashboard/dist/api/index.d.ts +5 -0
- package/dashboard/dist/api/index.js +5 -0
- package/dashboard/dist/api/notes-api.d.ts +18 -0
- package/dashboard/dist/api/notes-api.js +68 -0
- package/dashboard/dist/api/notes-api.test.d.ts +1 -0
- package/dashboard/dist/api/notes-api.test.js +113 -0
- package/dashboard/dist/api/safeFetch.d.ts +50 -0
- package/dashboard/dist/api/safeFetch.js +135 -0
- package/dashboard/dist/api/safeFetch.test.d.ts +1 -0
- package/dashboard/dist/api/safeFetch.test.js +215 -0
- package/dashboard/dist/api/tasks-api.d.ts +32 -0
- package/dashboard/dist/api/tasks-api.js +98 -0
- package/dashboard/dist/api/tasks-api.test.d.ts +1 -0
- package/dashboard/dist/api/tasks-api.test.js +383 -0
- package/dashboard/dist/components/BugsPane.d.ts +20 -0
- package/dashboard/dist/components/BugsPane.js +210 -0
- package/dashboard/dist/components/BugsPane.test.d.ts +1 -0
- package/dashboard/dist/components/BugsPane.test.js +256 -0
- package/dashboard/dist/components/HealthPane.d.ts +3 -1
- package/dashboard/dist/components/HealthPane.js +44 -6
- package/dashboard/dist/components/HealthPane.test.js +105 -2
- package/dashboard/dist/components/RouterPane.d.ts +4 -3
- package/dashboard/dist/components/RouterPane.js +60 -57
- package/dashboard/dist/components/RouterPane.test.js +150 -96
- package/dashboard/dist/components/UpdateBanner.d.ts +26 -0
- package/dashboard/dist/components/UpdateBanner.js +30 -0
- package/dashboard/dist/components/UpdateBanner.test.d.ts +1 -0
- package/dashboard/dist/components/UpdateBanner.test.js +96 -0
- package/dashboard/dist/components/ui/EmptyState.d.ts +14 -0
- package/dashboard/dist/components/ui/EmptyState.js +58 -0
- package/dashboard/dist/components/ui/EmptyState.test.d.ts +1 -0
- package/dashboard/dist/components/ui/EmptyState.test.js +97 -0
- package/dashboard/dist/components/ui/ErrorState.d.ts +17 -0
- package/dashboard/dist/components/ui/ErrorState.js +80 -0
- package/dashboard/dist/components/ui/ErrorState.test.d.ts +1 -0
- package/dashboard/dist/components/ui/ErrorState.test.js +166 -0
- package/dashboard/package.json +3 -0
- package/package.json +4 -1
- package/server/dashboard/index.html +284 -13
- package/server/dashboard/login.html +262 -0
- package/server/index.js +304 -0
- package/server/lib/api-provider.js +104 -186
- package/server/lib/api-provider.test.js +238 -336
- package/server/lib/cli-detector.js +90 -166
- package/server/lib/cli-detector.test.js +114 -269
- package/server/lib/cli-provider.js +142 -212
- package/server/lib/cli-provider.test.js +196 -349
- package/server/lib/debug.test.js +3 -3
- package/server/lib/devserver-router-api.js +54 -249
- package/server/lib/devserver-router-api.test.js +126 -426
- package/server/lib/introspect.js +309 -0
- package/server/lib/introspect.test.js +286 -0
- package/server/lib/model-router.js +107 -245
- package/server/lib/model-router.test.js +122 -313
- package/server/lib/output-schemas.js +146 -269
- package/server/lib/output-schemas.test.js +106 -307
- package/server/lib/plan-parser.js +59 -16
- package/server/lib/provider-interface.js +99 -153
- package/server/lib/provider-interface.test.js +228 -394
- package/server/lib/provider-queue.js +164 -158
- package/server/lib/provider-queue.test.js +186 -315
- package/server/lib/router-config.js +99 -221
- package/server/lib/router-config.test.js +83 -237
- package/server/lib/router-setup-command.js +94 -419
- package/server/lib/router-setup-command.test.js +96 -375
- package/server/lib/router-status-api.js +93 -0
- package/server/lib/router-status-api.test.js +270 -0
|
@@ -1,158 +1,164 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Provider Queue - Queue concurrent provider tasks
|
|
3
|
-
*
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
.
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
.
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
}
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
}
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
}
|
|
158
|
-
|
|
1
|
+
/**
|
|
2
|
+
* Provider Queue - Queue concurrent provider tasks
|
|
3
|
+
* Phase 33, Task 8
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
export const Priority = {
|
|
7
|
+
URGENT: 'urgent',
|
|
8
|
+
NORMAL: 'normal',
|
|
9
|
+
LOW: 'low',
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
const PRIORITY_ORDER = {
|
|
13
|
+
[Priority.URGENT]: 0,
|
|
14
|
+
[Priority.NORMAL]: 1,
|
|
15
|
+
[Priority.LOW]: 2,
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
let taskIdCounter = 0;
|
|
19
|
+
|
|
20
|
+
export class ProviderQueue {
|
|
21
|
+
constructor(options = {}) {
|
|
22
|
+
this.maxConcurrent = options.maxConcurrent || 3;
|
|
23
|
+
this.timeout = options.timeout || 30000;
|
|
24
|
+
this.pending = [];
|
|
25
|
+
this.running = new Map();
|
|
26
|
+
this.completed = new Map();
|
|
27
|
+
this.processing = false;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
enqueue(task) {
|
|
31
|
+
const id = task.id || `task-${++taskIdCounter}`;
|
|
32
|
+
const queuedTask = {
|
|
33
|
+
id,
|
|
34
|
+
priority: task.priority || Priority.NORMAL,
|
|
35
|
+
execute: task.execute || (() => Promise.resolve()),
|
|
36
|
+
prompt: task.prompt,
|
|
37
|
+
status: 'pending',
|
|
38
|
+
enqueuedAt: Date.now(),
|
|
39
|
+
};
|
|
40
|
+
|
|
41
|
+
this.pending.push(queuedTask);
|
|
42
|
+
this._sortPending();
|
|
43
|
+
|
|
44
|
+
if (this.processing) {
|
|
45
|
+
this._processNext();
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
return id;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
_sortPending() {
|
|
52
|
+
this.pending.sort((a, b) => {
|
|
53
|
+
const priorityDiff = PRIORITY_ORDER[a.priority] - PRIORITY_ORDER[b.priority];
|
|
54
|
+
if (priorityDiff !== 0) return priorityDiff;
|
|
55
|
+
return a.enqueuedAt - b.enqueuedAt;
|
|
56
|
+
});
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
process() {
|
|
60
|
+
this.processing = true;
|
|
61
|
+
this._processNext();
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
async _processNext() {
|
|
65
|
+
while (
|
|
66
|
+
this.processing &&
|
|
67
|
+
this.pending.length > 0 &&
|
|
68
|
+
this.running.size < this.maxConcurrent
|
|
69
|
+
) {
|
|
70
|
+
const task = this.pending.shift();
|
|
71
|
+
if (!task) break;
|
|
72
|
+
|
|
73
|
+
task.status = 'running';
|
|
74
|
+
task.startedAt = Date.now();
|
|
75
|
+
this.running.set(task.id, task);
|
|
76
|
+
|
|
77
|
+
this._executeTask(task);
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
async _executeTask(task) {
|
|
82
|
+
const timeoutId = setTimeout(() => {
|
|
83
|
+
if (this.running.has(task.id)) {
|
|
84
|
+
task.status = 'cancelled';
|
|
85
|
+
task.error = 'Timeout';
|
|
86
|
+
this.running.delete(task.id);
|
|
87
|
+
this.completed.set(task.id, task);
|
|
88
|
+
this._processNext();
|
|
89
|
+
}
|
|
90
|
+
}, this.timeout);
|
|
91
|
+
|
|
92
|
+
try {
|
|
93
|
+
const result = await task.execute();
|
|
94
|
+
clearTimeout(timeoutId);
|
|
95
|
+
|
|
96
|
+
if (this.running.has(task.id)) {
|
|
97
|
+
task.status = 'completed';
|
|
98
|
+
task.result = result;
|
|
99
|
+
task.completedAt = Date.now();
|
|
100
|
+
this.running.delete(task.id);
|
|
101
|
+
this.completed.set(task.id, task);
|
|
102
|
+
}
|
|
103
|
+
} catch (error) {
|
|
104
|
+
clearTimeout(timeoutId);
|
|
105
|
+
|
|
106
|
+
if (this.running.has(task.id)) {
|
|
107
|
+
task.status = 'failed';
|
|
108
|
+
task.error = error.message;
|
|
109
|
+
task.completedAt = Date.now();
|
|
110
|
+
this.running.delete(task.id);
|
|
111
|
+
this.completed.set(task.id, task);
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
this._processNext();
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
getStatus() {
|
|
119
|
+
return {
|
|
120
|
+
pending: this.pending.length,
|
|
121
|
+
running: this.running.size,
|
|
122
|
+
completed: this.completed.size,
|
|
123
|
+
};
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
getTaskStatus(taskId) {
|
|
127
|
+
if (this.running.has(taskId)) {
|
|
128
|
+
return this.running.get(taskId).status;
|
|
129
|
+
}
|
|
130
|
+
if (this.completed.has(taskId)) {
|
|
131
|
+
return this.completed.get(taskId).status;
|
|
132
|
+
}
|
|
133
|
+
const pending = this.pending.find(t => t.id === taskId);
|
|
134
|
+
if (pending) {
|
|
135
|
+
return pending.status;
|
|
136
|
+
}
|
|
137
|
+
return null;
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
clearQueue() {
|
|
141
|
+
this.pending = [];
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
async drainQueue() {
|
|
145
|
+
this.process();
|
|
146
|
+
|
|
147
|
+
return new Promise((resolve) => {
|
|
148
|
+
const check = () => {
|
|
149
|
+
if (this.pending.length === 0 && this.running.size === 0) {
|
|
150
|
+
resolve();
|
|
151
|
+
} else {
|
|
152
|
+
setTimeout(check, 10);
|
|
153
|
+
}
|
|
154
|
+
};
|
|
155
|
+
check();
|
|
156
|
+
});
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
stop() {
|
|
160
|
+
this.processing = false;
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
export default { ProviderQueue, Priority };
|