profclaw 0.0.1-beta.1 → 0.0.1-beta.2
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/README.md +1 -1
- package/dist/adapters/openclaw.js +1 -1
- package/dist/agents/executor.js +38 -6
- package/dist/auth/auth-service.js +8 -6
- package/dist/auth/device-identity.js +7 -5
- package/dist/auth/github-oauth.js +3 -1
- package/dist/auth/pairing-codes.js +6 -4
- package/dist/browser/service.js +5 -3
- package/dist/chat/execution/guardrails.js +3 -1
- package/dist/chat/execution/workflows/executor.js +4 -2
- package/dist/chat/memory.js +3 -1
- package/dist/chat/proactive/index.js +13 -11
- package/dist/chat/tools.js +8 -7
- package/dist/cli/commands/auth.js +22 -13
- package/dist/cli/commands/onboard.js +248 -59
- package/dist/cli/commands/setup.js +180 -104
- package/dist/cron/issue-poller.js +1 -1
- package/dist/hooks/agent-webhook.js +10 -7
- package/dist/hooks/prompt-submit.js +5 -6
- package/dist/hooks/session-end.js +10 -6
- package/dist/hooks/tool-use.js +9 -6
- package/dist/integrations/github-ticket-sync.js +8 -6
- package/dist/integrations/github.js +8 -6
- package/dist/integrations/jira.js +5 -3
- package/dist/mcp/server.js +12 -9
- package/dist/memory/experience-store.js +15 -14
- package/dist/notifications/slack.js +4 -2
- package/dist/providers/types.d.ts +2 -2
- package/dist/queue/failure-handler.js +15 -13
- package/dist/queue/index.js +6 -4
- package/dist/queue/memory-queue.js +23 -27
- package/dist/queue/task-queue.js +18 -22
- package/dist/routes/agents.js +3 -1
- package/dist/routes/auth.js +11 -9
- package/dist/routes/devices.js +17 -15
- package/dist/routes/gateway.js +3 -1
- package/dist/routes/hooks.js +7 -5
- package/dist/routes/import.js +10 -8
- package/dist/routes/labels.js +11 -9
- package/dist/routes/oobe.js +8 -6
- package/dist/routes/openapi.js +1 -1
- package/dist/routes/projects.js +27 -25
- package/dist/routes/settings.js +7 -5
- package/dist/routes/setup.js +12 -11
- package/dist/routes/slack.js +28 -27
- package/dist/routes/stats.js +6 -4
- package/dist/routes/summaries.js +4 -3
- package/dist/routes/sync.js +7 -5
- package/dist/routes/tasks.js +10 -8
- package/dist/routes/tickets.js +26 -26
- package/dist/routes/tokens.js +5 -3
- package/dist/routes/users.js +14 -12
- package/dist/routes/webhooks.js +5 -3
- package/dist/settings/index.js +3 -1
- package/dist/storage/index.d.ts +2 -1
- package/dist/storage/index.js +9 -4
- package/dist/storage/libsql.js +29 -21
- package/dist/storage/schema.d.ts +107 -46
- package/dist/summaries/storage.js +3 -1
- package/dist/tickets/index.js +10 -8
- package/dist/utils/circuit-breaker.js +10 -5
- package/dist/utils/logger.d.ts +5 -1
- package/dist/utils/logger.js +23 -7
- package/package.json +4 -3
- package/ui/dist/assets/{ActivityView-CkPgKhwm.js → ActivityView-DIPQSJ_d.js} +1 -1
- package/ui/dist/assets/{AgentList-C3SVdeEz.js → AgentList-CqyaYrcq.js} +1 -1
- package/ui/dist/assets/{AnalyticsDashboard-DVU--vlP.js → AnalyticsDashboard-C-mjuGHT.js} +1 -1
- package/ui/dist/assets/{AreaChart-B5qMEGWj.js → AreaChart-CfYWmbtr.js} +1 -1
- package/ui/dist/assets/{CartesianChart-B50bcUJi.js → CartesianChart-BaQ3It0c.js} +1 -1
- package/ui/dist/assets/{ChatView-BZFJs7w_.js → ChatView-DxxQy6pl.js} +1 -1
- package/ui/dist/assets/CostsDashboard-CDBBcGkg.js +1 -0
- package/ui/dist/assets/{EstimateSelect-CLpB4NQO.js → EstimateSelect-CDjf5qKl.js} +1 -1
- package/ui/dist/assets/{FloatingChatbot-CBzBY9a0.js → FloatingChatbot-CZHjvJIe.js} +1 -1
- package/ui/dist/assets/{InviteCodeManagement-DsbdPa6W.js → InviteCodeManagement-DTm-IPTm.js} +1 -1
- package/ui/dist/assets/{ProjectDetail-BEM3tFXg.js → ProjectDetail-DlYUcOss.js} +1 -1
- package/ui/dist/assets/{ProjectIcon-CN1FmFAk.js → ProjectIcon-BMRpnM04.js} +1 -1
- package/ui/dist/assets/{ProjectList-DSDaNhxQ.js → ProjectList-D85TN0i0.js} +1 -1
- package/ui/dist/assets/{Settings-dPVcqC_d.js → Settings-CgPqzUvj.js} +3 -3
- package/ui/dist/assets/{StatusIndicator-DA3NAo_b.js → StatusIndicator-yig0uZEA.js} +1 -1
- package/ui/dist/assets/{SummaryDetail-Bjnf9lT8.js → SummaryDetail-CwLAfHgJ.js} +1 -1
- package/ui/dist/assets/{SummaryList-ENwKDBKW.js → SummaryList-BvS5Idnu.js} +1 -1
- package/ui/dist/assets/{TaskDetail-DnwG6MzB.js → TaskDetail-zarC1fOt.js} +1 -1
- package/ui/dist/assets/{TaskList-D9Ug_HiV.js → TaskList-CyJq3ANE.js} +1 -1
- package/ui/dist/assets/{TicketBoard-CviH1571.js → TicketBoard-BlWr3-iH.js} +1 -1
- package/ui/dist/assets/{TicketDetail-8Jk8O-33.js → TicketDetail-DmqWKj2W.js} +1 -1
- package/ui/dist/assets/{TicketList-B-iV4rRA.js → TicketList-Scj4pMWa.js} +1 -1
- package/ui/dist/assets/{UserManagement-CPZ8s7s2.js → UserManagement-BH7uG7dw.js} +1 -1
- package/ui/dist/assets/{ViewSwitcher-BUyOOWDI.js → ViewSwitcher-3HzZUdWn.js} +1 -1
- package/ui/dist/assets/{alert-dialog-BOmnTkN-.js → alert-dialog-DWPb2IfQ.js} +1 -1
- package/ui/dist/assets/{archive-D5my9zOG.js → archive-CGck7gxR.js} +1 -1
- package/ui/dist/assets/{badge-B4ov81_m.js → badge-DEmc3Z_l.js} +1 -1
- package/ui/dist/assets/{brain-C53ElFLD.js → brain-CfFdLVqb.js} +1 -1
- package/ui/dist/assets/{bug-D0TJoCYn.js → bug-DqSGPUUE.js} +1 -1
- package/ui/dist/assets/{calendar-BkWIhKa1.js → calendar-BuZ4zbPW.js} +1 -1
- package/ui/dist/assets/{chevron-up-BRTtndUZ.js → chevron-up-DcJ4LL_N.js} +1 -1
- package/ui/dist/assets/{circle-x-BN89YhbS.js → circle-x-C78PNZjF.js} +1 -1
- package/ui/dist/assets/{constants-fc7TFI7u.js → constants-DhDjZe4P.js} +1 -1
- package/ui/dist/assets/{cpu-B41x1-vV.js → cpu-Ck6AoG8c.js} +1 -1
- package/ui/dist/assets/{database-D9Cnfmzj.js → database-CA2w8Lvt.js} +1 -1
- package/ui/dist/assets/{dialog-DrWB4EYD.js → dialog-BOdGWhgE.js} +1 -1
- package/ui/dist/assets/{ellipsis-NuUWekvu.js → ellipsis-FhHKRbfl.js} +1 -1
- package/ui/dist/assets/{ellipsis-vertical-BueMfuCw.js → ellipsis-vertical-CO0UqE4-.js} +1 -1
- package/ui/dist/assets/{file-code-HR9829Jc.js → file-code-ChnhYYj1.js} +1 -1
- package/ui/dist/assets/{folder-open-C_7oYEqe.js → folder-open-CHwA1-ve.js} +1 -1
- package/ui/dist/assets/{funnel-B5gmNXGf.js → funnel-ByEjRFNB.js} +1 -1
- package/ui/dist/assets/{git-branch-BRMiJmV3.js → git-branch-GTOPQgU4.js} +1 -1
- package/ui/dist/assets/{git-commit-horizontal-CXOUQeJI.js → git-commit-horizontal-F5M84Kut.js} +1 -1
- package/ui/dist/assets/{globe-CCspjvus.js → globe-CQWfr7hT.js} +1 -1
- package/ui/dist/assets/{hash-g3102kPC.js → hash-nKC9gtLg.js} +1 -1
- package/ui/dist/assets/{history-CNqcBBrV.js → history-DfFSA9xJ.js} +1 -1
- package/ui/dist/assets/{index-kb4AJXUB.js → index--JkIxVXb.js} +3 -3
- package/ui/dist/assets/index-Ca3vk7Gq.js +1 -0
- package/ui/dist/assets/{index-C9jNQXzL.js → index-DHGvP9mp.js} +1 -1
- package/ui/dist/assets/index-DeI8lKRR.js +1 -0
- package/ui/dist/assets/{index-DURTouJI.js → index-Z4-RtZcs.js} +1 -1
- package/ui/dist/assets/{index-CEZ6R2Uw.js → index-a4Fxq0Hb.js} +1 -1
- package/ui/dist/assets/{layers-CLXiHN6o.js → layers-DFeLExSa.js} +1 -1
- package/ui/dist/assets/{layout-dashboard-B07MFhBs.js → layout-dashboard-WmgjMhWF.js} +1 -1
- package/ui/dist/assets/{lightbulb-B2dgG5ks.js → lightbulb-Bo8hEr7B.js} +1 -1
- package/ui/dist/assets/{link-2-BxNmr9hL.js → link-2-YqrpQXBH.js} +1 -1
- package/ui/dist/assets/{markdown-renderer-CjU6hBcW.js → markdown-renderer-Croje6Xe.js} +1 -1
- package/ui/dist/assets/{message-square-Bf2-CVbt.js → message-square-CD0H5hot.js} +1 -1
- package/ui/dist/assets/{pencil-D096Ey62.js → pencil-DpFnj5dn.js} +1 -1
- package/ui/dist/assets/{play-DfdcSI3x.js → play-DVgea_jT.js} +1 -1
- package/ui/dist/assets/{popover-BV0QJDQq.js → popover-JXecfWG5.js} +1 -1
- package/ui/dist/assets/{progress-DjPEDJfI.js → progress-C1ghf1Fu.js} +1 -1
- package/ui/dist/assets/{rocket-CPsTc-5G.js → rocket-BFxPYGx9.js} +1 -1
- package/ui/dist/assets/{select-LsO16slr.js → select-MADP8m6Q.js} +1 -1
- package/ui/dist/assets/{send-BDYBZDUZ.js → send-eYnW_7n-.js} +1 -1
- package/ui/dist/assets/{server-B3k6noce.js → server-CPMaysH8.js} +1 -1
- package/ui/dist/assets/{settings-2-Cu4xTjhG.js → settings-2-scXUOuE_.js} +1 -1
- package/ui/dist/assets/{sheet-BScLnPKX.js → sheet-r6NSOxi-.js} +1 -1
- package/ui/dist/assets/{shield-check-CQqkwufI.js → shield-check-PEr7nmVw.js} +1 -1
- package/ui/dist/assets/{shield-off-ZFruH9KO.js → shield-off-CLtXio62.js} +1 -1
- package/ui/dist/assets/{skeleton-CtkIA_MU.js → skeleton-C9oEzNlU.js} +1 -1
- package/ui/dist/assets/{smartphone-DnoksVkc.js → smartphone-DusFfY0U.js} +1 -1
- package/ui/dist/assets/{square-uD9ZHMfW.js → square-e1yxB2eR.js} +1 -1
- package/ui/dist/assets/{switch-MQPnwGJK.js → switch-tNs0n-kz.js} +1 -1
- package/ui/dist/assets/{table-B8cqlywA.js → table-CXxtLicg.js} +1 -1
- package/ui/dist/assets/{tag-wEJQRWlV.js → tag-tAwMmQ9G.js} +1 -1
- package/ui/dist/assets/{textarea-D5LJCOGl.js → textarea-BjiEeIWh.js} +1 -1
- package/ui/dist/assets/{timer-mbGHegmr.js → timer-Vel1N3RP.js} +1 -1
- package/ui/dist/assets/{tooltip-Df1CunSp.js → tooltip-ZMwtfr1J.js} +1 -1
- package/ui/dist/assets/{trash-2-B4oAXsX-.js → trash-2-eM-CNwsZ.js} +1 -1
- package/ui/dist/assets/{trending-up-BGWxvlmZ.js → trending-up-BGafmjRo.js} +1 -1
- package/ui/dist/assets/{wand-sparkles-CZy4xvL3.js → wand-sparkles-DPvcd9Pi.js} +1 -1
- package/ui/dist/assets/{wrench-ByZkjO6m.js → wrench-B8s3zYVV.js} +1 -1
- package/ui/dist/index.html +1 -1
- package/ui/dist/assets/CostsDashboard-ChfH8BlG.js +0 -1
- package/ui/dist/assets/index-27mTPKuh.js +0 -1
- package/ui/dist/assets/index-BMx3fH-e.js +0 -1
|
@@ -6,7 +6,8 @@
|
|
|
6
6
|
* Persists tasks to the same SQLite storage as the BullMQ queue.
|
|
7
7
|
*/
|
|
8
8
|
import { randomUUID } from 'crypto';
|
|
9
|
-
import {
|
|
9
|
+
import { createContextualLogger } from '../utils/logger.js';
|
|
10
|
+
const log = createContextualLogger('MemoryQueue');
|
|
10
11
|
import { getStorage, initStorage } from '../storage/index.js';
|
|
11
12
|
import { getConcurrency } from '../core/deployment.js';
|
|
12
13
|
// Lazy-loaded heavy modules (deferred to first task execution for lower cold-start footprint)
|
|
@@ -67,10 +68,7 @@ async function persistTask(task) {
|
|
|
67
68
|
}
|
|
68
69
|
}
|
|
69
70
|
catch (error) {
|
|
70
|
-
|
|
71
|
-
taskId: task.id,
|
|
72
|
-
error,
|
|
73
|
-
});
|
|
71
|
+
log.error('Failed to persist task to DB', { taskId: task.id, error: error instanceof Error ? error.message : String(error) });
|
|
74
72
|
}
|
|
75
73
|
}
|
|
76
74
|
async function loadTasksFromDB() {
|
|
@@ -91,12 +89,10 @@ async function loadTasksFromDB() {
|
|
|
91
89
|
loaded++;
|
|
92
90
|
}
|
|
93
91
|
}
|
|
94
|
-
|
|
92
|
+
log.info('Loaded tasks from database', { loaded, skipped: tasks.length - loaded });
|
|
95
93
|
}
|
|
96
94
|
catch (error) {
|
|
97
|
-
|
|
98
|
-
error,
|
|
99
|
-
});
|
|
95
|
+
log.warn('Failed to load tasks from DB, starting fresh', { error: error instanceof Error ? error.message : String(error) });
|
|
100
96
|
}
|
|
101
97
|
}
|
|
102
98
|
// SSE broadcast callback
|
|
@@ -107,7 +103,7 @@ function emitEvent(event) {
|
|
|
107
103
|
callback(event);
|
|
108
104
|
}
|
|
109
105
|
catch (error) {
|
|
110
|
-
|
|
106
|
+
log.error('Error in event callback', error instanceof Error ? error : new Error(String(error)));
|
|
111
107
|
}
|
|
112
108
|
}
|
|
113
109
|
if (sseBroadcaster) {
|
|
@@ -136,21 +132,21 @@ function emitEvent(event) {
|
|
|
136
132
|
});
|
|
137
133
|
}
|
|
138
134
|
catch (error) {
|
|
139
|
-
|
|
135
|
+
log.error('Error broadcasting SSE event', error instanceof Error ? error : new Error(String(error)));
|
|
140
136
|
}
|
|
141
137
|
}
|
|
142
138
|
if (event.type === 'completed' || event.type === 'failed') {
|
|
143
139
|
lazyCreateTaskNotification(event).then((id) => {
|
|
144
140
|
if (id && sseBroadcaster)
|
|
145
141
|
sseBroadcaster('notification:new', { id });
|
|
146
|
-
}).catch(
|
|
142
|
+
}).catch((err) => log.error('Notification creation failed', err instanceof Error ? err : new Error(String(err))));
|
|
147
143
|
}
|
|
148
144
|
}
|
|
149
145
|
/**
|
|
150
146
|
* Process a single task (same logic as BullMQ worker).
|
|
151
147
|
*/
|
|
152
148
|
async function processTask(task) {
|
|
153
|
-
|
|
149
|
+
log.info('Processing task', { taskId: task.id, title: task.title });
|
|
154
150
|
task.status = 'in_progress';
|
|
155
151
|
task.startedAt = new Date();
|
|
156
152
|
task.attempts += 1;
|
|
@@ -173,7 +169,7 @@ async function processTask(task) {
|
|
|
173
169
|
emitEvent({ type: 'failed', taskId: task.id, task, result });
|
|
174
170
|
return result;
|
|
175
171
|
}
|
|
176
|
-
|
|
172
|
+
log.info('Using adapter', { adapter: adapter.name });
|
|
177
173
|
try {
|
|
178
174
|
const result = await adapter.executeTask(task);
|
|
179
175
|
task.result = result;
|
|
@@ -192,14 +188,14 @@ async function processTask(task) {
|
|
|
192
188
|
});
|
|
193
189
|
}
|
|
194
190
|
catch (error) {
|
|
195
|
-
|
|
191
|
+
log.error('Failed to create summary', { taskId: task.id, error: error instanceof Error ? error.message : String(error) });
|
|
196
192
|
}
|
|
197
193
|
// Post results back to source
|
|
198
194
|
try {
|
|
199
195
|
await lazyPostResultToSource(task, result);
|
|
200
196
|
}
|
|
201
197
|
catch (error) {
|
|
202
|
-
|
|
198
|
+
log.error('Failed to post result to source', { taskId: task.id, error: error instanceof Error ? error.message : String(error) });
|
|
203
199
|
}
|
|
204
200
|
emitEvent({ type: 'completed', taskId: task.id, task, result });
|
|
205
201
|
}
|
|
@@ -209,7 +205,7 @@ async function processTask(task) {
|
|
|
209
205
|
task.status = 'queued';
|
|
210
206
|
taskStore.set(task.id, task);
|
|
211
207
|
await persistTask(task);
|
|
212
|
-
|
|
208
|
+
log.info('Task failed, retrying', { taskId: task.id, attempt: task.attempts, maxAttempts: task.maxAttempts });
|
|
213
209
|
}
|
|
214
210
|
else {
|
|
215
211
|
task.status = 'failed';
|
|
@@ -222,7 +218,7 @@ async function processTask(task) {
|
|
|
222
218
|
await handleTaskFailure(task, new Error(result.error?.message || 'Task failed'));
|
|
223
219
|
}
|
|
224
220
|
catch (dlqError) {
|
|
225
|
-
|
|
221
|
+
log.error('DLQ error', { taskId: task.id, error: dlqError instanceof Error ? dlqError.message : String(dlqError) });
|
|
226
222
|
}
|
|
227
223
|
}
|
|
228
224
|
}
|
|
@@ -239,7 +235,7 @@ async function processTask(task) {
|
|
|
239
235
|
task.status = 'queued';
|
|
240
236
|
taskStore.set(task.id, task);
|
|
241
237
|
await persistTask(task);
|
|
242
|
-
|
|
238
|
+
log.info('Task errored, retrying', { taskId: task.id, attempt: task.attempts, maxAttempts: task.maxAttempts });
|
|
243
239
|
}
|
|
244
240
|
else {
|
|
245
241
|
task.status = 'failed';
|
|
@@ -252,7 +248,7 @@ async function processTask(task) {
|
|
|
252
248
|
await handleTaskFailure(task, new Error(errorMessage));
|
|
253
249
|
}
|
|
254
250
|
catch (dlqError) {
|
|
255
|
-
|
|
251
|
+
log.error('DLQ error', { taskId: task.id, error: dlqError instanceof Error ? dlqError.message : String(dlqError) });
|
|
256
252
|
}
|
|
257
253
|
}
|
|
258
254
|
return result;
|
|
@@ -278,7 +274,7 @@ async function processNext() {
|
|
|
278
274
|
finally {
|
|
279
275
|
activeCount--;
|
|
280
276
|
// Check for more work
|
|
281
|
-
processNext().catch(
|
|
277
|
+
processNext().catch((err) => log.error('processNext error', err instanceof Error ? err : new Error(String(err))));
|
|
282
278
|
}
|
|
283
279
|
}
|
|
284
280
|
/**
|
|
@@ -300,7 +296,7 @@ function evictStaleTasks() {
|
|
|
300
296
|
}
|
|
301
297
|
}
|
|
302
298
|
if (evicted > 0) {
|
|
303
|
-
|
|
299
|
+
log.info('Evicted stale tasks', { evicted, storeSize: taskStore.size });
|
|
304
300
|
}
|
|
305
301
|
}
|
|
306
302
|
// -- Exported interface (matches task-queue.ts) --
|
|
@@ -313,12 +309,12 @@ export async function initTaskQueue() {
|
|
|
313
309
|
// Poll for queued tasks every 500ms
|
|
314
310
|
pollInterval = setInterval(() => {
|
|
315
311
|
if (processing) {
|
|
316
|
-
processNext().catch(
|
|
312
|
+
processNext().catch((err) => log.error('processNext error', err instanceof Error ? err : new Error(String(err))));
|
|
317
313
|
}
|
|
318
314
|
}, 500);
|
|
319
315
|
// Periodic eviction of completed/failed tasks to bound memory
|
|
320
316
|
evictionInterval = setInterval(evictStaleTasks, TASK_EVICTION_INTERVAL_MS);
|
|
321
|
-
|
|
317
|
+
log.info('In-memory queue initialized', { concurrency: maxConcurrency });
|
|
322
318
|
}
|
|
323
319
|
export async function addTask(input) {
|
|
324
320
|
const task = {
|
|
@@ -340,9 +336,9 @@ export async function addTask(input) {
|
|
|
340
336
|
taskStore.set(task.id, task);
|
|
341
337
|
await persistTask(task);
|
|
342
338
|
emitEvent({ type: 'queued', taskId: task.id, task });
|
|
343
|
-
|
|
339
|
+
log.info('Task added to queue', { taskId: task.id });
|
|
344
340
|
// Trigger processing
|
|
345
|
-
processNext().catch(
|
|
341
|
+
processNext().catch((err) => log.error('processNext error', err instanceof Error ? err : new Error(String(err))));
|
|
346
342
|
return task;
|
|
347
343
|
}
|
|
348
344
|
export function getTask(id) {
|
|
@@ -424,6 +420,6 @@ export async function closeTaskQueue() {
|
|
|
424
420
|
clearInterval(evictionInterval);
|
|
425
421
|
evictionInterval = null;
|
|
426
422
|
}
|
|
427
|
-
|
|
423
|
+
log.info('In-memory queue closed');
|
|
428
424
|
}
|
|
429
425
|
//# sourceMappingURL=memory-queue.js.map
|
package/dist/queue/task-queue.js
CHANGED
|
@@ -4,7 +4,8 @@ import { randomUUID } from "crypto";
|
|
|
4
4
|
import { postResultToSource } from "./notifications.js";
|
|
5
5
|
import { createTaskNotification } from "../notifications/in-app.js";
|
|
6
6
|
import { extractFromTaskResult, createSummary } from "../summaries/index.js";
|
|
7
|
-
import {
|
|
7
|
+
import { createContextualLogger } from "../utils/logger.js";
|
|
8
|
+
const log = createContextualLogger('TaskQueue');
|
|
8
9
|
import { getStorage, initStorage } from "../storage/index.js";
|
|
9
10
|
import { handleTaskFailure, setTaskQueueRef, initDeadLetterQueue, } from "./failure-handler.js";
|
|
10
11
|
/**
|
|
@@ -71,10 +72,7 @@ async function persistTask(task) {
|
|
|
71
72
|
}
|
|
72
73
|
}
|
|
73
74
|
catch (error) {
|
|
74
|
-
|
|
75
|
-
taskId: task.id,
|
|
76
|
-
error,
|
|
77
|
-
});
|
|
75
|
+
log.error('Failed to persist task to DB', { taskId: task.id, error: error instanceof Error ? error.message : String(error) });
|
|
78
76
|
}
|
|
79
77
|
}
|
|
80
78
|
/**
|
|
@@ -87,12 +85,10 @@ async function loadTasksFromDB() {
|
|
|
87
85
|
for (const task of tasks) {
|
|
88
86
|
taskStore.set(task.id, task);
|
|
89
87
|
}
|
|
90
|
-
|
|
88
|
+
log.info('Loaded tasks from database', { count: tasks.length });
|
|
91
89
|
}
|
|
92
90
|
catch (error) {
|
|
93
|
-
|
|
94
|
-
error,
|
|
95
|
-
});
|
|
91
|
+
log.warn('Failed to load tasks from DB, starting fresh', { error: error instanceof Error ? error.message : String(error) });
|
|
96
92
|
}
|
|
97
93
|
}
|
|
98
94
|
/**
|
|
@@ -148,7 +144,7 @@ export async function initTaskQueue() {
|
|
|
148
144
|
result,
|
|
149
145
|
});
|
|
150
146
|
}
|
|
151
|
-
|
|
147
|
+
log.info('Task completed', { taskId: job.data.id });
|
|
152
148
|
});
|
|
153
149
|
taskWorker.on("failed", async (job, err) => {
|
|
154
150
|
if (!job)
|
|
@@ -159,7 +155,7 @@ export async function initTaskQueue() {
|
|
|
159
155
|
await handleTaskFailure(task, err);
|
|
160
156
|
}
|
|
161
157
|
catch (handlerError) {
|
|
162
|
-
|
|
158
|
+
log.error('Failure handler error', { taskId: task.id, error: handlerError instanceof Error ? handlerError.message : String(handlerError) });
|
|
163
159
|
}
|
|
164
160
|
// Update local state
|
|
165
161
|
if (task.attempts >= task.maxAttempts) {
|
|
@@ -182,7 +178,7 @@ export async function initTaskQueue() {
|
|
|
182
178
|
result: task.result,
|
|
183
179
|
});
|
|
184
180
|
}
|
|
185
|
-
|
|
181
|
+
log.error('Task failed', { taskId: job.data.id, attempt: task.attempts, maxAttempts: task.maxAttempts, error: err.message });
|
|
186
182
|
});
|
|
187
183
|
taskWorker.on("progress", (job, progress) => {
|
|
188
184
|
const task = taskStore.get(job.data.id);
|
|
@@ -215,14 +211,14 @@ export async function initTaskQueue() {
|
|
|
215
211
|
connection,
|
|
216
212
|
concurrency: 5, // Higher concurrency for IO bound tasks
|
|
217
213
|
});
|
|
218
|
-
|
|
214
|
+
log.info('Task queue initialized');
|
|
219
215
|
}
|
|
220
216
|
/**
|
|
221
217
|
* Process a task
|
|
222
218
|
*/
|
|
223
219
|
export async function processTask(job) {
|
|
224
220
|
const task = job.data;
|
|
225
|
-
|
|
221
|
+
log.info('Processing task', { taskId: task.id, title: task.title });
|
|
226
222
|
// Update status
|
|
227
223
|
task.status = "in_progress";
|
|
228
224
|
task.startedAt = new Date();
|
|
@@ -240,7 +236,7 @@ export async function processTask(job) {
|
|
|
240
236
|
if (!adapter) {
|
|
241
237
|
throw new Error("No suitable agent adapter found for task");
|
|
242
238
|
}
|
|
243
|
-
|
|
239
|
+
log.info('Using adapter', { adapter: adapter.name });
|
|
244
240
|
// Execute the task
|
|
245
241
|
const result = await adapter.executeTask(task);
|
|
246
242
|
// Update task with result
|
|
@@ -257,14 +253,14 @@ export async function processTask(job) {
|
|
|
257
253
|
await createSummary(summaryInput);
|
|
258
254
|
}
|
|
259
255
|
catch (error) {
|
|
260
|
-
|
|
256
|
+
log.error('Failed to create summary', { taskId: task.id, error: error instanceof Error ? error.message : String(error) });
|
|
261
257
|
}
|
|
262
258
|
// 2. Post results back to source (e.g., GitHub comment)
|
|
263
259
|
if (notificationQueue) {
|
|
264
260
|
await notificationQueue.add("notify-source", { task, result });
|
|
265
261
|
}
|
|
266
262
|
else {
|
|
267
|
-
|
|
263
|
+
log.warn('Notification queue not initialized, falling back to direct call');
|
|
268
264
|
// Fallback for safety/testing without queue init
|
|
269
265
|
await postResultToSource(task, result);
|
|
270
266
|
}
|
|
@@ -312,7 +308,7 @@ export async function addTask(input) {
|
|
|
312
308
|
taskId: task.id,
|
|
313
309
|
task,
|
|
314
310
|
});
|
|
315
|
-
|
|
311
|
+
log.info('Task added to queue', { taskId: task.id });
|
|
316
312
|
return task;
|
|
317
313
|
}
|
|
318
314
|
/**
|
|
@@ -372,7 +368,7 @@ function emitEvent(event) {
|
|
|
372
368
|
callback(event);
|
|
373
369
|
}
|
|
374
370
|
catch (error) {
|
|
375
|
-
|
|
371
|
+
log.error('Error in event callback', error instanceof Error ? error : new Error(String(error)));
|
|
376
372
|
}
|
|
377
373
|
}
|
|
378
374
|
// Broadcast to SSE clients
|
|
@@ -402,7 +398,7 @@ function emitEvent(event) {
|
|
|
402
398
|
});
|
|
403
399
|
}
|
|
404
400
|
catch (error) {
|
|
405
|
-
|
|
401
|
+
log.error('Error broadcasting SSE event', error instanceof Error ? error : new Error(String(error)));
|
|
406
402
|
}
|
|
407
403
|
}
|
|
408
404
|
// Write to notifications DB for bell dropdown
|
|
@@ -410,7 +406,7 @@ function emitEvent(event) {
|
|
|
410
406
|
createTaskNotification(event).then((id) => {
|
|
411
407
|
if (id && sseBroadcaster)
|
|
412
408
|
sseBroadcaster('notification:new', { id });
|
|
413
|
-
}).catch(
|
|
409
|
+
}).catch((err) => log.error('Notification creation failed', err instanceof Error ? err : new Error(String(err))));
|
|
414
410
|
}
|
|
415
411
|
}
|
|
416
412
|
/**
|
|
@@ -513,6 +509,6 @@ export async function closeTaskQueue() {
|
|
|
513
509
|
await notificationQueue.close();
|
|
514
510
|
notificationQueue = null;
|
|
515
511
|
}
|
|
516
|
-
|
|
512
|
+
log.info('Task queue closed');
|
|
517
513
|
}
|
|
518
514
|
//# sourceMappingURL=task-queue.js.map
|
package/dist/routes/agents.js
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import { Hono } from 'hono';
|
|
2
2
|
import { getAgentRegistry } from '../adapters/registry.js';
|
|
3
3
|
import { getStorage } from '../storage/index.js';
|
|
4
|
+
import { createContextualLogger } from '../utils/logger.js';
|
|
4
5
|
const agents = new Hono();
|
|
6
|
+
const log = createContextualLogger('Agents');
|
|
5
7
|
// List available agents with detailed status
|
|
6
8
|
agents.get('/', async (c) => {
|
|
7
9
|
const registry = getAgentRegistry();
|
|
@@ -12,7 +14,7 @@ agents.get('/', async (c) => {
|
|
|
12
14
|
agentStats = await storage.getAgentStats();
|
|
13
15
|
}
|
|
14
16
|
catch (error) {
|
|
15
|
-
|
|
17
|
+
log.warn('Could not fetch agent stats', { error: error instanceof Error ? error.message : String(error) });
|
|
16
18
|
}
|
|
17
19
|
const agentList = await Promise.all(adapters.map(async (adapter) => {
|
|
18
20
|
const health = await adapter.healthCheck();
|
package/dist/routes/auth.js
CHANGED
|
@@ -20,6 +20,7 @@ import { getSettingsRaw, updateSettings } from '../settings/index.js';
|
|
|
20
20
|
import { getDb } from '../storage/index.js';
|
|
21
21
|
import { inviteCodes, users } from '../storage/schema.js';
|
|
22
22
|
import { invalidateLocalAdminCache } from '../auth/middleware.js';
|
|
23
|
+
import { createContextualLogger } from '../utils/logger.js';
|
|
23
24
|
// RATE LIMITERS
|
|
24
25
|
const loginLimiter = rateLimit({ windowMs: 60_000, max: 10, message: 'Too many login attempts. Try again in a minute.' });
|
|
25
26
|
const signupLimiter = rateLimit({ windowMs: 60_000, max: 5, message: 'Too many signup attempts. Try again in a minute.' });
|
|
@@ -52,6 +53,7 @@ const setAccessKeySchema = z.object({
|
|
|
52
53
|
key: z.string().max(128).nullable(),
|
|
53
54
|
});
|
|
54
55
|
export const authRoutes = new Hono();
|
|
56
|
+
const log = createContextualLogger('AuthRoutes');
|
|
55
57
|
const COOKIE_OPTIONS = {
|
|
56
58
|
httpOnly: true,
|
|
57
59
|
secure: process.env.NODE_ENV === 'production',
|
|
@@ -146,7 +148,7 @@ authRoutes.post('/signup', signupLimiter, async (c) => {
|
|
|
146
148
|
});
|
|
147
149
|
}
|
|
148
150
|
catch (error) {
|
|
149
|
-
|
|
151
|
+
log.error('Signup error', error instanceof Error ? error : new Error(String(error)));
|
|
150
152
|
return c.json({ error: 'Signup failed' }, 500);
|
|
151
153
|
}
|
|
152
154
|
});
|
|
@@ -178,7 +180,7 @@ authRoutes.post('/login', loginLimiter, async (c) => {
|
|
|
178
180
|
});
|
|
179
181
|
}
|
|
180
182
|
catch (error) {
|
|
181
|
-
|
|
183
|
+
log.error('Login error', error instanceof Error ? error : new Error(String(error)));
|
|
182
184
|
return c.json({ error: 'Login failed' }, 500);
|
|
183
185
|
}
|
|
184
186
|
});
|
|
@@ -196,7 +198,7 @@ authRoutes.post('/logout', async (c) => {
|
|
|
196
198
|
return c.json({ message: 'Logged out successfully' });
|
|
197
199
|
}
|
|
198
200
|
catch (error) {
|
|
199
|
-
|
|
201
|
+
log.error('Logout error', error instanceof Error ? error : new Error(String(error)));
|
|
200
202
|
return c.json({ error: 'Logout failed' }, 500);
|
|
201
203
|
}
|
|
202
204
|
});
|
|
@@ -249,7 +251,7 @@ authRoutes.get('/github/callback', async (c) => {
|
|
|
249
251
|
return c.redirect('/');
|
|
250
252
|
}
|
|
251
253
|
catch (error) {
|
|
252
|
-
|
|
254
|
+
log.error('GitHub callback error', error instanceof Error ? error : new Error(String(error)));
|
|
253
255
|
return c.redirect('/login?error=callback_failed');
|
|
254
256
|
}
|
|
255
257
|
});
|
|
@@ -291,7 +293,7 @@ authRoutes.post('/github/token', async (c) => {
|
|
|
291
293
|
});
|
|
292
294
|
}
|
|
293
295
|
catch (error) {
|
|
294
|
-
|
|
296
|
+
log.error('GitHub token exchange error', error instanceof Error ? error : new Error(String(error)));
|
|
295
297
|
return c.json({ error: 'Authentication failed' }, 500);
|
|
296
298
|
}
|
|
297
299
|
});
|
|
@@ -361,7 +363,7 @@ authRoutes.get('/me', async (c) => {
|
|
|
361
363
|
});
|
|
362
364
|
}
|
|
363
365
|
catch (error) {
|
|
364
|
-
|
|
366
|
+
log.error('Get user error', error instanceof Error ? error : new Error(String(error)));
|
|
365
367
|
return c.json({ authenticated: false }, 500);
|
|
366
368
|
}
|
|
367
369
|
});
|
|
@@ -392,7 +394,7 @@ authRoutes.patch('/me', async (c) => {
|
|
|
392
394
|
return c.json({ user: updatedUser });
|
|
393
395
|
}
|
|
394
396
|
catch (error) {
|
|
395
|
-
|
|
397
|
+
log.error('Update user error', error instanceof Error ? error : new Error(String(error)));
|
|
396
398
|
return c.json({ error: 'Update failed' }, 500);
|
|
397
399
|
}
|
|
398
400
|
});
|
|
@@ -438,7 +440,7 @@ authRoutes.post('/verify-access-key', loginLimiter, async (c) => {
|
|
|
438
440
|
return c.json({ success: true, message: 'Access verified' });
|
|
439
441
|
}
|
|
440
442
|
catch (error) {
|
|
441
|
-
|
|
443
|
+
log.error('Access key verification error', error instanceof Error ? error : new Error(String(error)));
|
|
442
444
|
return c.json({ error: 'Verification failed' }, 500);
|
|
443
445
|
}
|
|
444
446
|
});
|
|
@@ -478,7 +480,7 @@ authRoutes.put('/access-key', async (c) => {
|
|
|
478
480
|
});
|
|
479
481
|
}
|
|
480
482
|
catch (error) {
|
|
481
|
-
|
|
483
|
+
log.error('Access key update error', error instanceof Error ? error : new Error(String(error)));
|
|
482
484
|
return c.json({ error: 'Failed to update access key' }, 500);
|
|
483
485
|
}
|
|
484
486
|
});
|
package/dist/routes/devices.js
CHANGED
|
@@ -10,7 +10,9 @@ import { loadOrCreateDeviceIdentity, exportPublicIdentity, createDeviceAttestati
|
|
|
10
10
|
import { requestPairingCode, approvePairingCode, rejectPairingCode, checkPairingStatus, listPendingPairingRequests, cleanupExpiredPairingRequests, validatePairingToken, formatPairingCode, parsePairingCode, initPairingCodesTable, } from '../auth/pairing-codes.js';
|
|
11
11
|
import { generatePairingQR, generatePairingUrl, generateQRSvg } from '../auth/qr-pairing.js';
|
|
12
12
|
import { getStorage } from '../storage/index.js';
|
|
13
|
+
import { createContextualLogger } from '../utils/logger.js';
|
|
13
14
|
const app = new Hono();
|
|
15
|
+
const log = createContextualLogger('Devices');
|
|
14
16
|
const attestBodySchema = z.object({
|
|
15
17
|
data: z.record(z.string(), z.unknown()).optional(),
|
|
16
18
|
});
|
|
@@ -76,7 +78,7 @@ app.get('/identity', async (c) => {
|
|
|
76
78
|
});
|
|
77
79
|
}
|
|
78
80
|
catch (error) {
|
|
79
|
-
|
|
81
|
+
log.error('Failed to get identity', error instanceof Error ? error : new Error(String(error)));
|
|
80
82
|
return c.json({
|
|
81
83
|
success: false,
|
|
82
84
|
error: error instanceof Error ? error.message : 'Unknown error',
|
|
@@ -105,7 +107,7 @@ app.post('/attest', async (c) => {
|
|
|
105
107
|
});
|
|
106
108
|
}
|
|
107
109
|
catch (error) {
|
|
108
|
-
|
|
110
|
+
log.error('Failed to create attestation', error instanceof Error ? error : new Error(String(error)));
|
|
109
111
|
return c.json({
|
|
110
112
|
success: false,
|
|
111
113
|
error: error instanceof Error ? error.message : 'Unknown error',
|
|
@@ -136,7 +138,7 @@ app.post('/verify', async (c) => {
|
|
|
136
138
|
});
|
|
137
139
|
}
|
|
138
140
|
catch (error) {
|
|
139
|
-
|
|
141
|
+
log.error('Failed to verify attestation', error instanceof Error ? error : new Error(String(error)));
|
|
140
142
|
return c.json({
|
|
141
143
|
success: false,
|
|
142
144
|
error: error instanceof Error ? error.message : 'Unknown error',
|
|
@@ -182,7 +184,7 @@ app.post('/pairing/request', async (c) => {
|
|
|
182
184
|
});
|
|
183
185
|
}
|
|
184
186
|
catch (error) {
|
|
185
|
-
|
|
187
|
+
log.error('Failed to request pairing code', error instanceof Error ? error : new Error(String(error)));
|
|
186
188
|
return c.json({
|
|
187
189
|
success: false,
|
|
188
190
|
error: error instanceof Error ? error.message : 'Unknown error',
|
|
@@ -206,7 +208,7 @@ app.get('/pairing/status/:code', async (c) => {
|
|
|
206
208
|
});
|
|
207
209
|
}
|
|
208
210
|
catch (error) {
|
|
209
|
-
|
|
211
|
+
log.error('Failed to check pairing status', error instanceof Error ? error : new Error(String(error)));
|
|
210
212
|
return c.json({
|
|
211
213
|
success: false,
|
|
212
214
|
error: error instanceof Error ? error.message : 'Unknown error',
|
|
@@ -252,7 +254,7 @@ app.post('/pairing/approve', async (c) => {
|
|
|
252
254
|
});
|
|
253
255
|
}
|
|
254
256
|
catch (error) {
|
|
255
|
-
|
|
257
|
+
log.error('Failed to approve pairing code', error instanceof Error ? error : new Error(String(error)));
|
|
256
258
|
return c.json({
|
|
257
259
|
success: false,
|
|
258
260
|
error: error instanceof Error ? error.message : 'Unknown error',
|
|
@@ -290,7 +292,7 @@ app.post('/pairing/reject', async (c) => {
|
|
|
290
292
|
return c.json({ success: true });
|
|
291
293
|
}
|
|
292
294
|
catch (error) {
|
|
293
|
-
|
|
295
|
+
log.error('Failed to reject pairing code', error instanceof Error ? error : new Error(String(error)));
|
|
294
296
|
return c.json({
|
|
295
297
|
success: false,
|
|
296
298
|
error: error instanceof Error ? error.message : 'Unknown error',
|
|
@@ -318,7 +320,7 @@ app.get('/pairing/pending', async (c) => {
|
|
|
318
320
|
});
|
|
319
321
|
}
|
|
320
322
|
catch (error) {
|
|
321
|
-
|
|
323
|
+
log.error('Failed to list pending requests', error instanceof Error ? error : new Error(String(error)));
|
|
322
324
|
return c.json({
|
|
323
325
|
success: false,
|
|
324
326
|
error: error instanceof Error ? error.message : 'Unknown error',
|
|
@@ -347,7 +349,7 @@ app.post('/pairing/validate', async (c) => {
|
|
|
347
349
|
});
|
|
348
350
|
}
|
|
349
351
|
catch (error) {
|
|
350
|
-
|
|
352
|
+
log.error('Failed to validate token', error instanceof Error ? error : new Error(String(error)));
|
|
351
353
|
return c.json({
|
|
352
354
|
success: false,
|
|
353
355
|
error: error instanceof Error ? error.message : 'Unknown error',
|
|
@@ -368,7 +370,7 @@ app.post('/pairing/cleanup', async (c) => {
|
|
|
368
370
|
});
|
|
369
371
|
}
|
|
370
372
|
catch (error) {
|
|
371
|
-
|
|
373
|
+
log.error('Failed to cleanup pairing requests', error instanceof Error ? error : new Error(String(error)));
|
|
372
374
|
return c.json({
|
|
373
375
|
success: false,
|
|
374
376
|
error: error instanceof Error ? error.message : 'Unknown error',
|
|
@@ -391,7 +393,7 @@ app.get('/pairing/qr/:code', async (c) => {
|
|
|
391
393
|
return c.json({ success: true, ...qr });
|
|
392
394
|
}
|
|
393
395
|
catch (error) {
|
|
394
|
-
|
|
396
|
+
log.error('Failed to generate QR code', error instanceof Error ? error : new Error(String(error)));
|
|
395
397
|
return c.json({ error: 'Failed to generate QR code' }, 500);
|
|
396
398
|
}
|
|
397
399
|
});
|
|
@@ -414,7 +416,7 @@ app.get('/pairing/qr/:code/svg', async (c) => {
|
|
|
414
416
|
return c.body(svg);
|
|
415
417
|
}
|
|
416
418
|
catch (error) {
|
|
417
|
-
|
|
419
|
+
log.error('Failed to generate QR SVG', error instanceof Error ? error : new Error(String(error)));
|
|
418
420
|
return c.text('Failed to generate QR', 500);
|
|
419
421
|
}
|
|
420
422
|
});
|
|
@@ -450,7 +452,7 @@ app.get('/paired', async (c) => {
|
|
|
450
452
|
});
|
|
451
453
|
}
|
|
452
454
|
catch (error) {
|
|
453
|
-
|
|
455
|
+
log.error('Failed to list paired devices', error instanceof Error ? error : new Error(String(error)));
|
|
454
456
|
return c.json({
|
|
455
457
|
success: false,
|
|
456
458
|
error: error instanceof Error ? error.message : 'Unknown error',
|
|
@@ -475,11 +477,11 @@ app.delete('/paired/:id', async (c) => {
|
|
|
475
477
|
await storage.execute(`UPDATE pairing_requests SET status = 'rejected', token = NULL WHERE id = ?`, [
|
|
476
478
|
id,
|
|
477
479
|
]);
|
|
478
|
-
|
|
480
|
+
log.info('Revoked device', { id });
|
|
479
481
|
return c.json({ success: true });
|
|
480
482
|
}
|
|
481
483
|
catch (error) {
|
|
482
|
-
|
|
484
|
+
log.error('Failed to revoke device', error instanceof Error ? error : new Error(String(error)));
|
|
483
485
|
return c.json({
|
|
484
486
|
success: false,
|
|
485
487
|
error: error instanceof Error ? error.message : 'Unknown error',
|
package/dist/routes/gateway.js
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import { Hono } from 'hono';
|
|
2
|
+
import { createContextualLogger } from '../utils/logger.js';
|
|
3
|
+
const log = createContextualLogger('Gateway');
|
|
2
4
|
import { CreateTaskSchema } from '../types/task.js';
|
|
3
5
|
import { addTask } from '../queue/index.js';
|
|
4
6
|
import { tokenAuthMiddleware } from '../auth/api-tokens.js';
|
|
@@ -95,7 +97,7 @@ gateway.post('/execute', async (c) => {
|
|
|
95
97
|
});
|
|
96
98
|
}
|
|
97
99
|
catch (error) {
|
|
98
|
-
|
|
100
|
+
log.error('Execute error', error instanceof Error ? error : new Error(String(error)));
|
|
99
101
|
return c.json({
|
|
100
102
|
error: 'Gateway execution failed',
|
|
101
103
|
message: error instanceof Error ? error.message : 'Unknown error',
|
package/dist/routes/hooks.js
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import { Hono } from 'hono';
|
|
2
|
+
import { createContextualLogger } from '../utils/logger.js';
|
|
3
|
+
const log = createContextualLogger('Hooks');
|
|
2
4
|
import { handlePostToolUse, handleSessionEnd, handlePromptSubmit, handleOpenClawWebhook, handleGenericAgentWebhook, getSessionEvents, getSessionSummary, getRecentSessions, getRecentReports, getTaskReports, } from '../hooks/index.js';
|
|
3
5
|
const hooks = new Hono();
|
|
4
6
|
// PostToolUse hook - receives tool usage events from Claude Code
|
|
@@ -18,7 +20,7 @@ hooks.post('/tool-use', async (c) => {
|
|
|
18
20
|
});
|
|
19
21
|
}
|
|
20
22
|
catch (error) {
|
|
21
|
-
|
|
23
|
+
log.error('PostToolUse error', error instanceof Error ? error : new Error(String(error)));
|
|
22
24
|
return c.json({
|
|
23
25
|
error: 'Hook processing failed',
|
|
24
26
|
message: error instanceof Error ? error.message : 'Unknown error',
|
|
@@ -42,7 +44,7 @@ hooks.post('/session-end', async (c) => {
|
|
|
42
44
|
});
|
|
43
45
|
}
|
|
44
46
|
catch (error) {
|
|
45
|
-
|
|
47
|
+
log.error('Session end error', error instanceof Error ? error : new Error(String(error)));
|
|
46
48
|
return c.json({
|
|
47
49
|
error: 'Hook processing failed',
|
|
48
50
|
message: error instanceof Error ? error.message : 'Unknown error',
|
|
@@ -65,7 +67,7 @@ hooks.post('/prompt-submit', async (c) => {
|
|
|
65
67
|
});
|
|
66
68
|
}
|
|
67
69
|
catch (error) {
|
|
68
|
-
|
|
70
|
+
log.error('Prompt submit error', error instanceof Error ? error : new Error(String(error)));
|
|
69
71
|
return c.json({
|
|
70
72
|
error: 'Hook processing failed',
|
|
71
73
|
message: error instanceof Error ? error.message : 'Unknown error',
|
|
@@ -115,7 +117,7 @@ hooks.post('/webhook/openclaw', async (c) => {
|
|
|
115
117
|
});
|
|
116
118
|
}
|
|
117
119
|
catch (error) {
|
|
118
|
-
|
|
120
|
+
log.error('OpenClaw webhook error', error instanceof Error ? error : new Error(String(error)));
|
|
119
121
|
return c.json({
|
|
120
122
|
error: 'Webhook processing failed',
|
|
121
123
|
message: error instanceof Error ? error.message : 'Unknown error',
|
|
@@ -137,7 +139,7 @@ hooks.post('/webhook/agent', async (c) => {
|
|
|
137
139
|
});
|
|
138
140
|
}
|
|
139
141
|
catch (error) {
|
|
140
|
-
|
|
142
|
+
log.error('Agent webhook error', error instanceof Error ? error : new Error(String(error)));
|
|
141
143
|
return c.json({
|
|
142
144
|
error: 'Webhook processing failed',
|
|
143
145
|
message: error instanceof Error ? error.message : 'Unknown error',
|