chatroom-cli 1.16.1 → 1.16.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/dist/index.js +89 -66
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -11447,6 +11447,30 @@ var init_machine = __esm(() => {
|
|
|
11447
11447
|
init_daemon_state();
|
|
11448
11448
|
});
|
|
11449
11449
|
|
|
11450
|
+
// src/utils/convex-error.ts
|
|
11451
|
+
function getErrorMessage(error) {
|
|
11452
|
+
if (error instanceof ConvexError) {
|
|
11453
|
+
if (typeof error.data === "string") {
|
|
11454
|
+
return error.data;
|
|
11455
|
+
}
|
|
11456
|
+
if (error.data !== null && typeof error.data === "object") {
|
|
11457
|
+
const data = error.data;
|
|
11458
|
+
return data.message ?? data.code ?? String(error.data);
|
|
11459
|
+
}
|
|
11460
|
+
return String(error.data);
|
|
11461
|
+
}
|
|
11462
|
+
if (error instanceof Error) {
|
|
11463
|
+
return error.message;
|
|
11464
|
+
}
|
|
11465
|
+
if (error === null || error === undefined) {
|
|
11466
|
+
return String(error);
|
|
11467
|
+
}
|
|
11468
|
+
return String(error);
|
|
11469
|
+
}
|
|
11470
|
+
var init_convex_error = __esm(() => {
|
|
11471
|
+
init_values();
|
|
11472
|
+
});
|
|
11473
|
+
|
|
11450
11474
|
// src/commands/auth-status/index.ts
|
|
11451
11475
|
var exports_auth_status = {};
|
|
11452
11476
|
__export(exports_auth_status, {
|
|
@@ -11520,9 +11544,8 @@ ${"═".repeat(50)}`);
|
|
|
11520
11544
|
Run: chatroom auth login`);
|
|
11521
11545
|
}
|
|
11522
11546
|
} catch (error) {
|
|
11523
|
-
const err = error;
|
|
11524
11547
|
console.log(`
|
|
11525
|
-
⚠️ Could not validate session: ${
|
|
11548
|
+
⚠️ Could not validate session: ${getErrorMessage(error)}`);
|
|
11526
11549
|
console.log(` Session may still be valid. Try running a command.`);
|
|
11527
11550
|
}
|
|
11528
11551
|
}
|
|
@@ -11532,6 +11555,7 @@ var init_auth_status = __esm(() => {
|
|
|
11532
11555
|
init_client2();
|
|
11533
11556
|
init_machine();
|
|
11534
11557
|
init_version();
|
|
11558
|
+
init_convex_error();
|
|
11535
11559
|
});
|
|
11536
11560
|
|
|
11537
11561
|
// src/commands/update/index.ts
|
|
@@ -11861,13 +11885,14 @@ async function registerAgent(chatroomId, options, deps) {
|
|
|
11861
11885
|
});
|
|
11862
11886
|
console.log(`✅ Registered as custom agent for role "${role}"`);
|
|
11863
11887
|
} catch (error) {
|
|
11864
|
-
console.error(`❌ Registration failed: ${error
|
|
11888
|
+
console.error(`❌ Registration failed: ${getErrorMessage(error)}`);
|
|
11865
11889
|
process.exit(1);
|
|
11866
11890
|
}
|
|
11867
11891
|
}
|
|
11868
11892
|
}
|
|
11869
11893
|
var init_register_agent = __esm(() => {
|
|
11870
11894
|
init_api3();
|
|
11895
|
+
init_convex_error();
|
|
11871
11896
|
init_storage();
|
|
11872
11897
|
init_client2();
|
|
11873
11898
|
init_machine();
|
|
@@ -12090,7 +12115,7 @@ To reconnect, run:`);
|
|
|
12090
12115
|
connectionId: this.connectionId
|
|
12091
12116
|
}, (response) => {
|
|
12092
12117
|
this.handleSubscriptionResponse(response).catch((error) => {
|
|
12093
|
-
console.error(`❌ Error processing task: ${error
|
|
12118
|
+
console.error(`❌ Error processing task: ${getErrorMessage(error)}`);
|
|
12094
12119
|
});
|
|
12095
12120
|
}, (error) => {
|
|
12096
12121
|
this.handleSubscriptionError(error, "task subscription");
|
|
@@ -12235,6 +12260,7 @@ var init_session = __esm(() => {
|
|
|
12235
12260
|
init_values();
|
|
12236
12261
|
init_api3();
|
|
12237
12262
|
init_client2();
|
|
12263
|
+
init_convex_error();
|
|
12238
12264
|
});
|
|
12239
12265
|
|
|
12240
12266
|
// src/commands/get-next-task/index.ts
|
|
@@ -12492,11 +12518,10 @@ How to implement it' | ${classifyCommand({
|
|
|
12492
12518
|
\uD83D\uDCA1 ${result.reminder}`);
|
|
12493
12519
|
}
|
|
12494
12520
|
} catch (error) {
|
|
12495
|
-
const err = error;
|
|
12496
12521
|
console.error(`❌ Failed to acknowledge task`);
|
|
12497
|
-
console.error(` Error: ${
|
|
12498
|
-
if (
|
|
12499
|
-
const stackLines =
|
|
12522
|
+
console.error(` Error: ${getErrorMessage(error)}`);
|
|
12523
|
+
if (error instanceof Error && error.stack) {
|
|
12524
|
+
const stackLines = error.stack.split(`
|
|
12500
12525
|
`).slice(0, 5);
|
|
12501
12526
|
console.error(` Stack trace:`);
|
|
12502
12527
|
stackLines.forEach((line) => console.error(` ${line}`));
|
|
@@ -12515,6 +12540,7 @@ var init_classify = __esm(() => {
|
|
|
12515
12540
|
init_api3();
|
|
12516
12541
|
init_storage();
|
|
12517
12542
|
init_client2();
|
|
12543
|
+
init_convex_error();
|
|
12518
12544
|
});
|
|
12519
12545
|
|
|
12520
12546
|
// src/utils/serialization/decode/index.ts
|
|
@@ -13053,7 +13079,7 @@ async function listBacklog(chatroomId, options, deps) {
|
|
|
13053
13079
|
console.log(`Showing ${backlogItems.length} backlog item(s)`);
|
|
13054
13080
|
console.log("");
|
|
13055
13081
|
} catch (error) {
|
|
13056
|
-
console.error(`❌ Failed to list backlog items: ${error
|
|
13082
|
+
console.error(`❌ Failed to list backlog items: ${getErrorMessage(error)}`);
|
|
13057
13083
|
process.exit(1);
|
|
13058
13084
|
return;
|
|
13059
13085
|
}
|
|
@@ -13080,7 +13106,7 @@ async function addBacklog(chatroomId, options, deps) {
|
|
|
13080
13106
|
console.log(` Status: backlog`);
|
|
13081
13107
|
console.log("");
|
|
13082
13108
|
} catch (error) {
|
|
13083
|
-
console.error(`❌ Failed to add backlog item: ${error
|
|
13109
|
+
console.error(`❌ Failed to add backlog item: ${getErrorMessage(error)}`);
|
|
13084
13110
|
process.exit(1);
|
|
13085
13111
|
return;
|
|
13086
13112
|
}
|
|
@@ -13114,7 +13140,7 @@ async function completeBacklog(chatroomId, options, deps) {
|
|
|
13114
13140
|
}
|
|
13115
13141
|
console.log("");
|
|
13116
13142
|
} catch (error) {
|
|
13117
|
-
console.error(`❌ Failed to complete backlog item: ${error
|
|
13143
|
+
console.error(`❌ Failed to complete backlog item: ${getErrorMessage(error)}`);
|
|
13118
13144
|
process.exit(1);
|
|
13119
13145
|
return;
|
|
13120
13146
|
}
|
|
@@ -13141,7 +13167,7 @@ async function reopenBacklog(chatroomId, options, deps) {
|
|
|
13141
13167
|
console.log("\uD83D\uDCA1 The backlog item is now ready for user review again.");
|
|
13142
13168
|
console.log("");
|
|
13143
13169
|
} catch (error) {
|
|
13144
|
-
console.error(`❌ Failed to reopen backlog item: ${error
|
|
13170
|
+
console.error(`❌ Failed to reopen backlog item: ${getErrorMessage(error)}`);
|
|
13145
13171
|
process.exit(1);
|
|
13146
13172
|
return;
|
|
13147
13173
|
}
|
|
@@ -13203,7 +13229,7 @@ async function patchBacklog(chatroomId, options, deps) {
|
|
|
13203
13229
|
}
|
|
13204
13230
|
console.log("");
|
|
13205
13231
|
} catch (error) {
|
|
13206
|
-
console.error(`❌ Failed to patch backlog item: ${error
|
|
13232
|
+
console.error(`❌ Failed to patch backlog item: ${getErrorMessage(error)}`);
|
|
13207
13233
|
process.exit(1);
|
|
13208
13234
|
return;
|
|
13209
13235
|
}
|
|
@@ -13266,7 +13292,7 @@ async function scoreBacklog(chatroomId, options, deps) {
|
|
|
13266
13292
|
}
|
|
13267
13293
|
console.log("");
|
|
13268
13294
|
} catch (error) {
|
|
13269
|
-
console.error(`❌ Failed to score backlog item: ${error
|
|
13295
|
+
console.error(`❌ Failed to score backlog item: ${getErrorMessage(error)}`);
|
|
13270
13296
|
process.exit(1);
|
|
13271
13297
|
return;
|
|
13272
13298
|
}
|
|
@@ -13293,7 +13319,7 @@ async function markForReviewBacklog(chatroomId, options, deps) {
|
|
|
13293
13319
|
console.log('\uD83D\uDCA1 The backlog item is now visible in the "Pending Review" section for user confirmation.');
|
|
13294
13320
|
console.log("");
|
|
13295
13321
|
} catch (error) {
|
|
13296
|
-
console.error(`❌ Failed to mark backlog item for review: ${error
|
|
13322
|
+
console.error(`❌ Failed to mark backlog item for review: ${getErrorMessage(error)}`);
|
|
13297
13323
|
process.exit(1);
|
|
13298
13324
|
return;
|
|
13299
13325
|
}
|
|
@@ -13388,7 +13414,7 @@ async function historyBacklog(chatroomId, options, deps) {
|
|
|
13388
13414
|
console.log(`Showing ${tasks.length} task(s)`);
|
|
13389
13415
|
console.log("");
|
|
13390
13416
|
} catch (error) {
|
|
13391
|
-
console.error(`❌ Failed to load history: ${error
|
|
13417
|
+
console.error(`❌ Failed to load history: ${getErrorMessage(error)}`);
|
|
13392
13418
|
process.exit(1);
|
|
13393
13419
|
return;
|
|
13394
13420
|
}
|
|
@@ -13420,7 +13446,7 @@ async function closeBacklog(chatroomId, options, deps) {
|
|
|
13420
13446
|
console.log(` Reason: ${options.reason}`);
|
|
13421
13447
|
console.log("");
|
|
13422
13448
|
} catch (error) {
|
|
13423
|
-
console.error(`❌ Failed to close backlog item: ${error
|
|
13449
|
+
console.error(`❌ Failed to close backlog item: ${getErrorMessage(error)}`);
|
|
13424
13450
|
process.exit(1);
|
|
13425
13451
|
return;
|
|
13426
13452
|
}
|
|
@@ -13492,7 +13518,7 @@ async function exportBacklog(chatroomId, options, deps) {
|
|
|
13492
13518
|
console.log(` File: ${filePath}`);
|
|
13493
13519
|
console.log("");
|
|
13494
13520
|
} catch (error) {
|
|
13495
|
-
console.error(`❌ Failed to export backlog items: ${error
|
|
13521
|
+
console.error(`❌ Failed to export backlog items: ${getErrorMessage(error)}`);
|
|
13496
13522
|
process.exit(1);
|
|
13497
13523
|
return;
|
|
13498
13524
|
}
|
|
@@ -13549,7 +13575,7 @@ async function importBacklog(chatroomId, options, deps) {
|
|
|
13549
13575
|
console.log(` Skipped (duplicate): ${skipped}`);
|
|
13550
13576
|
console.log("");
|
|
13551
13577
|
} catch (error) {
|
|
13552
|
-
console.error(`❌ Failed to import backlog items: ${error
|
|
13578
|
+
console.error(`❌ Failed to import backlog items: ${getErrorMessage(error)}`);
|
|
13553
13579
|
process.exit(1);
|
|
13554
13580
|
return;
|
|
13555
13581
|
}
|
|
@@ -13559,6 +13585,7 @@ var init_backlog = __esm(() => {
|
|
|
13559
13585
|
init_api3();
|
|
13560
13586
|
init_storage();
|
|
13561
13587
|
init_client2();
|
|
13588
|
+
init_convex_error();
|
|
13562
13589
|
STALENESS_THRESHOLD_MS = 7 * 24 * 60 * 60 * 1000;
|
|
13563
13590
|
});
|
|
13564
13591
|
|
|
@@ -13769,7 +13796,7 @@ async function createWorkflow(chatroomId, options, deps) {
|
|
|
13769
13796
|
console.log(` Status: draft`);
|
|
13770
13797
|
console.log("");
|
|
13771
13798
|
} catch (error) {
|
|
13772
|
-
console.error(`❌ Failed to create workflow: ${error
|
|
13799
|
+
console.error(`❌ Failed to create workflow: ${getErrorMessage(error)}`);
|
|
13773
13800
|
process.exit(1);
|
|
13774
13801
|
return;
|
|
13775
13802
|
}
|
|
@@ -13802,7 +13829,7 @@ async function specifyWorkflowStep(chatroomId, options, deps) {
|
|
|
13802
13829
|
console.log(` Assignee: ${options.assigneeRole}`);
|
|
13803
13830
|
console.log("");
|
|
13804
13831
|
} catch (error) {
|
|
13805
|
-
console.error(`❌ Failed to specify step: ${error
|
|
13832
|
+
console.error(`❌ Failed to specify step: ${getErrorMessage(error)}`);
|
|
13806
13833
|
process.exit(1);
|
|
13807
13834
|
return;
|
|
13808
13835
|
}
|
|
@@ -13825,7 +13852,7 @@ async function executeWorkflow(chatroomId, options, deps) {
|
|
|
13825
13852
|
console.log("\uD83D\uDCA1 Root steps (no dependencies) are now in_progress.");
|
|
13826
13853
|
console.log("");
|
|
13827
13854
|
} catch (error) {
|
|
13828
|
-
console.error(`❌ Failed to execute workflow: ${error
|
|
13855
|
+
console.error(`❌ Failed to execute workflow: ${getErrorMessage(error)}`);
|
|
13829
13856
|
process.exit(1);
|
|
13830
13857
|
return;
|
|
13831
13858
|
}
|
|
@@ -13931,7 +13958,7 @@ async function getWorkflowStatus(chatroomId, options, deps) {
|
|
|
13931
13958
|
console.log("══════════════════════════════════════════════════");
|
|
13932
13959
|
console.log("");
|
|
13933
13960
|
} catch (error) {
|
|
13934
|
-
console.error(`❌ Failed to get workflow status: ${error
|
|
13961
|
+
console.error(`❌ Failed to get workflow status: ${getErrorMessage(error)}`);
|
|
13935
13962
|
process.exit(1);
|
|
13936
13963
|
return;
|
|
13937
13964
|
}
|
|
@@ -13953,7 +13980,7 @@ async function completeStep(chatroomId, options, deps) {
|
|
|
13953
13980
|
console.log(` Step: ${options.stepKey}`);
|
|
13954
13981
|
console.log("");
|
|
13955
13982
|
} catch (error) {
|
|
13956
|
-
console.error(`❌ Failed to complete step: ${error
|
|
13983
|
+
console.error(`❌ Failed to complete step: ${getErrorMessage(error)}`);
|
|
13957
13984
|
process.exit(1);
|
|
13958
13985
|
return;
|
|
13959
13986
|
}
|
|
@@ -13980,7 +14007,7 @@ async function exitWorkflow(chatroomId, options, deps) {
|
|
|
13980
14007
|
console.log(` Reason: ${options.reason.trim()}`);
|
|
13981
14008
|
console.log("");
|
|
13982
14009
|
} catch (error) {
|
|
13983
|
-
console.error(`❌ Failed to exit workflow: ${error
|
|
14010
|
+
console.error(`❌ Failed to exit workflow: ${getErrorMessage(error)}`);
|
|
13984
14011
|
process.exit(1);
|
|
13985
14012
|
return;
|
|
13986
14013
|
}
|
|
@@ -14069,13 +14096,14 @@ async function viewStep(chatroomId, options, deps) {
|
|
|
14069
14096
|
console.log("══════════════════════════════════════════════════");
|
|
14070
14097
|
console.log("");
|
|
14071
14098
|
} catch (error) {
|
|
14072
|
-
console.error(`❌ Failed to view step: ${error
|
|
14099
|
+
console.error(`❌ Failed to view step: ${getErrorMessage(error)}`);
|
|
14073
14100
|
process.exit(1);
|
|
14074
14101
|
return;
|
|
14075
14102
|
}
|
|
14076
14103
|
}
|
|
14077
14104
|
var init_workflow = __esm(() => {
|
|
14078
14105
|
init_api3();
|
|
14106
|
+
init_convex_error();
|
|
14079
14107
|
init_storage();
|
|
14080
14108
|
init_client2();
|
|
14081
14109
|
});
|
|
@@ -14254,12 +14282,7 @@ async function listSkills(chatroomId, options, deps) {
|
|
|
14254
14282
|
console.log(` ${padded} ${skill.description}`);
|
|
14255
14283
|
}
|
|
14256
14284
|
} catch (error) {
|
|
14257
|
-
|
|
14258
|
-
const msg = typeof error.data === "string" ? error.data : error.data.message ?? String(error.data);
|
|
14259
|
-
console.error(`❌ ${msg}`);
|
|
14260
|
-
} else {
|
|
14261
|
-
console.error(`❌ Failed to list skills: ${error.message}`);
|
|
14262
|
-
}
|
|
14285
|
+
console.error(`❌ Failed to list skills: ${getErrorMessage(error)}`);
|
|
14263
14286
|
process.exit(1);
|
|
14264
14287
|
}
|
|
14265
14288
|
}
|
|
@@ -14280,20 +14303,15 @@ async function activateSkill(chatroomId, skillId, options, deps) {
|
|
|
14280
14303
|
console.log(` The agent will now: ${result.skill.description}`);
|
|
14281
14304
|
console.log("");
|
|
14282
14305
|
} catch (error) {
|
|
14283
|
-
|
|
14284
|
-
const msg = typeof error.data === "string" ? error.data : error.data.message ?? String(error.data);
|
|
14285
|
-
console.error(`❌ ${msg}`);
|
|
14286
|
-
} else {
|
|
14287
|
-
console.error(`❌ Failed to activate skill: ${error.message}`);
|
|
14288
|
-
}
|
|
14306
|
+
console.error(`❌ Failed to activate skill: ${getErrorMessage(error)}`);
|
|
14289
14307
|
process.exit(1);
|
|
14290
14308
|
}
|
|
14291
14309
|
}
|
|
14292
14310
|
var init_skill = __esm(() => {
|
|
14293
|
-
init_values();
|
|
14294
14311
|
init_api3();
|
|
14295
14312
|
init_storage();
|
|
14296
14313
|
init_client2();
|
|
14314
|
+
init_convex_error();
|
|
14297
14315
|
});
|
|
14298
14316
|
|
|
14299
14317
|
// src/commands/messages/index.ts
|
|
@@ -14374,9 +14392,8 @@ ${content.split(`
|
|
|
14374
14392
|
console.log(`\uD83D\uDCA1 Use --full to see complete message content`);
|
|
14375
14393
|
console.log(`\uD83D\uDCA1 Use --since-message-id=<id> to get all messages since a specific message`);
|
|
14376
14394
|
} catch (error) {
|
|
14377
|
-
const errorMessage = error instanceof Error ? error.message : String(error);
|
|
14378
14395
|
console.error(`
|
|
14379
|
-
❌ Error fetching messages: ${
|
|
14396
|
+
❌ Error fetching messages: ${getErrorMessage(error)}`);
|
|
14380
14397
|
process.exit(1);
|
|
14381
14398
|
return;
|
|
14382
14399
|
}
|
|
@@ -14437,9 +14454,8 @@ ${content.split(`
|
|
|
14437
14454
|
` + "─".repeat(60));
|
|
14438
14455
|
console.log(`\uD83D\uDCA1 Use --full to see complete message content`);
|
|
14439
14456
|
} catch (error) {
|
|
14440
|
-
const errorMessage = error instanceof Error ? error.message : String(error);
|
|
14441
14457
|
console.error(`
|
|
14442
|
-
❌ Error fetching messages: ${
|
|
14458
|
+
❌ Error fetching messages: ${getErrorMessage(error)}`);
|
|
14443
14459
|
process.exit(1);
|
|
14444
14460
|
return;
|
|
14445
14461
|
}
|
|
@@ -14448,6 +14464,7 @@ var init_messages = __esm(() => {
|
|
|
14448
14464
|
init_api3();
|
|
14449
14465
|
init_storage();
|
|
14450
14466
|
init_client2();
|
|
14467
|
+
init_convex_error();
|
|
14451
14468
|
});
|
|
14452
14469
|
|
|
14453
14470
|
// src/commands/context/index.ts
|
|
@@ -14582,7 +14599,7 @@ async function readContext(chatroomId, options, deps) {
|
|
|
14582
14599
|
` + "═".repeat(60));
|
|
14583
14600
|
console.log("</context>");
|
|
14584
14601
|
} catch (err) {
|
|
14585
|
-
console.error(`❌ Failed to read context: ${sanitizeUnknownForTerminal(err
|
|
14602
|
+
console.error(`❌ Failed to read context: ${sanitizeUnknownForTerminal(getErrorMessage(err))}`);
|
|
14586
14603
|
process.exit(1);
|
|
14587
14604
|
return;
|
|
14588
14605
|
}
|
|
@@ -14634,7 +14651,7 @@ async function newContext(chatroomId, options, deps) {
|
|
|
14634
14651
|
process.exit(1);
|
|
14635
14652
|
return;
|
|
14636
14653
|
}
|
|
14637
|
-
console.error(`❌ Failed to create context: ${err
|
|
14654
|
+
console.error(`❌ Failed to create context: ${getErrorMessage(err)}`);
|
|
14638
14655
|
process.exit(1);
|
|
14639
14656
|
return;
|
|
14640
14657
|
}
|
|
@@ -14686,7 +14703,7 @@ async function listContexts(chatroomId, options, deps) {
|
|
|
14686
14703
|
console.log(`
|
|
14687
14704
|
` + "═".repeat(60));
|
|
14688
14705
|
} catch (err) {
|
|
14689
|
-
console.error(`❌ Failed to list contexts: ${sanitizeUnknownForTerminal(err
|
|
14706
|
+
console.error(`❌ Failed to list contexts: ${sanitizeUnknownForTerminal(getErrorMessage(err))}`);
|
|
14690
14707
|
process.exit(1);
|
|
14691
14708
|
return;
|
|
14692
14709
|
}
|
|
@@ -14735,7 +14752,7 @@ async function inspectContext(chatroomId, options, deps) {
|
|
|
14735
14752
|
console.log(`
|
|
14736
14753
|
` + "═".repeat(60));
|
|
14737
14754
|
} catch (err) {
|
|
14738
|
-
console.error(`❌ Failed to inspect context: ${sanitizeUnknownForTerminal(err
|
|
14755
|
+
console.error(`❌ Failed to inspect context: ${sanitizeUnknownForTerminal(getErrorMessage(err))}`);
|
|
14739
14756
|
process.exit(1);
|
|
14740
14757
|
return;
|
|
14741
14758
|
}
|
|
@@ -14744,6 +14761,7 @@ var init_context = __esm(() => {
|
|
|
14744
14761
|
init_api3();
|
|
14745
14762
|
init_storage();
|
|
14746
14763
|
init_client2();
|
|
14764
|
+
init_convex_error();
|
|
14747
14765
|
});
|
|
14748
14766
|
|
|
14749
14767
|
// src/commands/guidelines/index.ts
|
|
@@ -15068,8 +15086,7 @@ async function getSystemPrompt(chatroomId, options, deps) {
|
|
|
15068
15086
|
});
|
|
15069
15087
|
console.log(prompt);
|
|
15070
15088
|
} catch (error) {
|
|
15071
|
-
|
|
15072
|
-
console.error(`❌ Error fetching system prompt: ${err.message}`);
|
|
15089
|
+
console.error(`❌ Error fetching system prompt: ${getErrorMessage(error)}`);
|
|
15073
15090
|
process.exit(1);
|
|
15074
15091
|
return;
|
|
15075
15092
|
}
|
|
@@ -15078,6 +15095,7 @@ var init_get_system_prompt = __esm(() => {
|
|
|
15078
15095
|
init_api3();
|
|
15079
15096
|
init_storage();
|
|
15080
15097
|
init_client2();
|
|
15098
|
+
init_convex_error();
|
|
15081
15099
|
});
|
|
15082
15100
|
|
|
15083
15101
|
// ../../services/backend/config/reliability.ts
|
|
@@ -15545,12 +15563,12 @@ function startGitRequestSubscription(ctx, wsClient2) {
|
|
|
15545
15563
|
return;
|
|
15546
15564
|
processing = true;
|
|
15547
15565
|
processRequests(ctx, requests, processedRequestIds, DEDUP_TTL_MS).catch((err) => {
|
|
15548
|
-
console.warn(`[${formatTimestamp()}] ⚠️ Git request processing failed: ${err
|
|
15566
|
+
console.warn(`[${formatTimestamp()}] ⚠️ Git request processing failed: ${getErrorMessage(err)}`);
|
|
15549
15567
|
}).finally(() => {
|
|
15550
15568
|
processing = false;
|
|
15551
15569
|
});
|
|
15552
15570
|
}, (err) => {
|
|
15553
|
-
console.warn(`[${formatTimestamp()}] ⚠️ Git request subscription error: ${err
|
|
15571
|
+
console.warn(`[${formatTimestamp()}] ⚠️ Git request subscription error: ${getErrorMessage(err)}`);
|
|
15554
15572
|
});
|
|
15555
15573
|
console.log(`[${formatTimestamp()}] \uD83D\uDD00 Git request subscription started (reactive)`);
|
|
15556
15574
|
return {
|
|
@@ -15693,7 +15711,7 @@ async function processRequests(ctx, requests, processedRequestIds, dedupTtlMs) {
|
|
|
15693
15711
|
status: "done"
|
|
15694
15712
|
});
|
|
15695
15713
|
} catch (err) {
|
|
15696
|
-
console.warn(`[${formatTimestamp()}] ⚠️ Failed to process ${req.requestType} request: ${err
|
|
15714
|
+
console.warn(`[${formatTimestamp()}] ⚠️ Failed to process ${req.requestType} request: ${getErrorMessage(err)}`);
|
|
15697
15715
|
await ctx.deps.backend.mutation(api.workspaces.updateRequestStatus, {
|
|
15698
15716
|
sessionId: ctx.sessionId,
|
|
15699
15717
|
requestId: req._id,
|
|
@@ -15705,6 +15723,7 @@ async function processRequests(ctx, requests, processedRequestIds, dedupTtlMs) {
|
|
|
15705
15723
|
var init_git_subscription = __esm(() => {
|
|
15706
15724
|
init_api3();
|
|
15707
15725
|
init_git_reader();
|
|
15726
|
+
init_convex_error();
|
|
15708
15727
|
});
|
|
15709
15728
|
|
|
15710
15729
|
// src/commands/machine/daemon-start/git-heartbeat.ts
|
|
@@ -15717,7 +15736,7 @@ async function pushGitState(ctx) {
|
|
|
15717
15736
|
machineId: ctx.machineId
|
|
15718
15737
|
});
|
|
15719
15738
|
} catch (err) {
|
|
15720
|
-
console.warn(`[${formatTimestamp()}] ⚠️ Failed to query workspaces for git sync: ${err
|
|
15739
|
+
console.warn(`[${formatTimestamp()}] ⚠️ Failed to query workspaces for git sync: ${getErrorMessage(err)}`);
|
|
15721
15740
|
return;
|
|
15722
15741
|
}
|
|
15723
15742
|
const uniqueWorkingDirs = new Set(workspaces.map((ws) => ws.workingDir));
|
|
@@ -15727,7 +15746,7 @@ async function pushGitState(ctx) {
|
|
|
15727
15746
|
try {
|
|
15728
15747
|
await pushSingleWorkspaceGitState(ctx, workingDir);
|
|
15729
15748
|
} catch (err) {
|
|
15730
|
-
console.warn(`[${formatTimestamp()}] ⚠️ Git state push failed for ${workingDir}: ${err
|
|
15749
|
+
console.warn(`[${formatTimestamp()}] ⚠️ Git state push failed for ${workingDir}: ${getErrorMessage(err)}`);
|
|
15731
15750
|
}
|
|
15732
15751
|
}
|
|
15733
15752
|
}
|
|
@@ -15796,7 +15815,7 @@ async function pushSingleWorkspaceGitState(ctx, workingDir) {
|
|
|
15796
15815
|
ctx.lastPushedGitState.set(stateKey, stateHash);
|
|
15797
15816
|
console.log(`[${formatTimestamp()}] \uD83D\uDD00 Git state pushed: ${workingDir} (${branch}${isDirty2 ? ", dirty" : ", clean"})`);
|
|
15798
15817
|
prefetchMissingCommitDetails(ctx, workingDir, commits).catch((err) => {
|
|
15799
|
-
console.warn(`[${formatTimestamp()}] ⚠️ Commit pre-fetch failed for ${workingDir}: ${err
|
|
15818
|
+
console.warn(`[${formatTimestamp()}] ⚠️ Commit pre-fetch failed for ${workingDir}: ${getErrorMessage(err)}`);
|
|
15800
15819
|
});
|
|
15801
15820
|
}
|
|
15802
15821
|
async function prefetchMissingCommitDetails(ctx, workingDir, commits) {
|
|
@@ -15816,7 +15835,7 @@ async function prefetchMissingCommitDetails(ctx, workingDir, commits) {
|
|
|
15816
15835
|
try {
|
|
15817
15836
|
await prefetchSingleCommit(ctx, workingDir, sha, commits);
|
|
15818
15837
|
} catch (err) {
|
|
15819
|
-
console.warn(`[${formatTimestamp()}] ⚠️ Pre-fetch failed for ${sha.slice(0, 7)}: ${err
|
|
15838
|
+
console.warn(`[${formatTimestamp()}] ⚠️ Pre-fetch failed for ${sha.slice(0, 7)}: ${getErrorMessage(err)}`);
|
|
15820
15839
|
}
|
|
15821
15840
|
}
|
|
15822
15841
|
}
|
|
@@ -15870,6 +15889,7 @@ var init_git_heartbeat = __esm(() => {
|
|
|
15870
15889
|
init_git_subscription();
|
|
15871
15890
|
init_api3();
|
|
15872
15891
|
init_git_reader();
|
|
15892
|
+
init_convex_error();
|
|
15873
15893
|
});
|
|
15874
15894
|
|
|
15875
15895
|
// src/commands/machine/daemon-start/handlers/ping.ts
|
|
@@ -16615,7 +16635,7 @@ async function registerCapabilities(client2, sessionId, config3, agentServices)
|
|
|
16615
16635
|
availableModels
|
|
16616
16636
|
});
|
|
16617
16637
|
} catch (error) {
|
|
16618
|
-
console.warn(`⚠️ Machine registration update failed: ${error
|
|
16638
|
+
console.warn(`⚠️ Machine registration update failed: ${getErrorMessage(error)}`);
|
|
16619
16639
|
}
|
|
16620
16640
|
return availableModels;
|
|
16621
16641
|
}
|
|
@@ -16631,7 +16651,7 @@ async function connectDaemon(client2, sessionId, machineId, convexUrl) {
|
|
|
16631
16651
|
formatConnectivityError(error, convexUrl);
|
|
16632
16652
|
throw error;
|
|
16633
16653
|
} else {
|
|
16634
|
-
console.error(`❌ Failed to update daemon status: ${error
|
|
16654
|
+
console.error(`❌ Failed to update daemon status: ${getErrorMessage(error)}`);
|
|
16635
16655
|
releaseLock();
|
|
16636
16656
|
process.exit(1);
|
|
16637
16657
|
}
|
|
@@ -16652,7 +16672,7 @@ async function recoverState(ctx) {
|
|
|
16652
16672
|
try {
|
|
16653
16673
|
await recoverAgentState(ctx);
|
|
16654
16674
|
} catch (e) {
|
|
16655
|
-
console.log(` ⚠️ Recovery failed: ${e
|
|
16675
|
+
console.log(` ⚠️ Recovery failed: ${getErrorMessage(e)}`);
|
|
16656
16676
|
console.log(` Continuing with fresh state`);
|
|
16657
16677
|
}
|
|
16658
16678
|
try {
|
|
@@ -16664,7 +16684,7 @@ async function recoverState(ctx) {
|
|
|
16664
16684
|
console.log(` \uD83E\uDDF9 Cleared ${result.clearedCount} stale agent PID(s) from backend`);
|
|
16665
16685
|
}
|
|
16666
16686
|
} catch (e) {
|
|
16667
|
-
console.log(` ⚠️ Failed to clear stale PIDs: ${e
|
|
16687
|
+
console.log(` ⚠️ Failed to clear stale PIDs: ${getErrorMessage(e)}`);
|
|
16668
16688
|
}
|
|
16669
16689
|
}
|
|
16670
16690
|
async function initDaemon() {
|
|
@@ -16740,6 +16760,7 @@ var init_init2 = __esm(() => {
|
|
|
16740
16760
|
init_agent_process_manager();
|
|
16741
16761
|
init_remote_agents();
|
|
16742
16762
|
init_error_formatting();
|
|
16763
|
+
init_convex_error();
|
|
16743
16764
|
init_version();
|
|
16744
16765
|
init_pid();
|
|
16745
16766
|
});
|
|
@@ -16795,7 +16816,7 @@ async function refreshModels(ctx) {
|
|
|
16795
16816
|
});
|
|
16796
16817
|
console.log(`[${formatTimestamp()}] \uD83D\uDD04 Model refresh: ${totalCount > 0 ? `${totalCount} models` : "none discovered"}`);
|
|
16797
16818
|
} catch (error) {
|
|
16798
|
-
console.warn(`[${formatTimestamp()}] ⚠️ Model refresh failed: ${error
|
|
16819
|
+
console.warn(`[${formatTimestamp()}] ⚠️ Model refresh failed: ${getErrorMessage(error)}`);
|
|
16799
16820
|
}
|
|
16800
16821
|
}
|
|
16801
16822
|
function evictStaleDedupEntries(processedCommandIds, processedPingIds, processedGitRefreshIds) {
|
|
@@ -16855,10 +16876,10 @@ async function startCommandLoop(ctx) {
|
|
|
16855
16876
|
heartbeatCount++;
|
|
16856
16877
|
console.log(`[${formatTimestamp()}] \uD83D\uDC93 Daemon heartbeat #${heartbeatCount} OK`);
|
|
16857
16878
|
pushGitState(ctx).catch((err) => {
|
|
16858
|
-
console.warn(`[${formatTimestamp()}] ⚠️ Git state push failed: ${err
|
|
16879
|
+
console.warn(`[${formatTimestamp()}] ⚠️ Git state push failed: ${getErrorMessage(err)}`);
|
|
16859
16880
|
});
|
|
16860
16881
|
}).catch((err) => {
|
|
16861
|
-
console.warn(`[${formatTimestamp()}] ⚠️ Daemon heartbeat failed: ${err
|
|
16882
|
+
console.warn(`[${formatTimestamp()}] ⚠️ Daemon heartbeat failed: ${getErrorMessage(err)}`);
|
|
16862
16883
|
});
|
|
16863
16884
|
}, DAEMON_HEARTBEAT_INTERVAL_MS);
|
|
16864
16885
|
heartbeatTimer.unref();
|
|
@@ -16898,13 +16919,13 @@ Listening for commands...`);
|
|
|
16898
16919
|
console.log(`[${formatTimestamp()}] \uD83D\uDCE1 Stream command event: ${event.type} (id: ${event._id})`);
|
|
16899
16920
|
await dispatchCommandEvent(ctx, event, processedCommandIds, processedPingIds, processedGitRefreshIds);
|
|
16900
16921
|
} catch (err) {
|
|
16901
|
-
console.error(`[${formatTimestamp()}] ❌ Stream command event failed: ${err
|
|
16922
|
+
console.error(`[${formatTimestamp()}] ❌ Stream command event failed: ${getErrorMessage(err)}`);
|
|
16902
16923
|
}
|
|
16903
16924
|
}
|
|
16904
16925
|
});
|
|
16905
16926
|
const modelRefreshTimer = setInterval(() => {
|
|
16906
16927
|
refreshModels(ctx).catch((err) => {
|
|
16907
|
-
console.warn(`[${formatTimestamp()}] ⚠️ Model refresh error: ${err
|
|
16928
|
+
console.warn(`[${formatTimestamp()}] ⚠️ Model refresh error: ${getErrorMessage(err)}`);
|
|
16908
16929
|
});
|
|
16909
16930
|
}, MODEL_REFRESH_INTERVAL_MS);
|
|
16910
16931
|
modelRefreshTimer.unref();
|
|
@@ -16922,6 +16943,7 @@ var init_command_loop = __esm(() => {
|
|
|
16922
16943
|
init_on_daemon_shutdown();
|
|
16923
16944
|
init_client2();
|
|
16924
16945
|
init_machine();
|
|
16946
|
+
init_convex_error();
|
|
16925
16947
|
MODEL_REFRESH_INTERVAL_MS = 5 * 60 * 1000;
|
|
16926
16948
|
});
|
|
16927
16949
|
|
|
@@ -16955,12 +16977,13 @@ async function daemonStop() {
|
|
|
16955
16977
|
removePid();
|
|
16956
16978
|
console.log(`✅ Daemon stopped`);
|
|
16957
16979
|
} catch (error) {
|
|
16958
|
-
console.error(`❌ Failed to stop daemon: ${error
|
|
16980
|
+
console.error(`❌ Failed to stop daemon: ${getErrorMessage(error)}`);
|
|
16959
16981
|
removePid();
|
|
16960
16982
|
}
|
|
16961
16983
|
}
|
|
16962
16984
|
var init_daemon_stop = __esm(() => {
|
|
16963
16985
|
init_pid();
|
|
16986
|
+
init_convex_error();
|
|
16964
16987
|
});
|
|
16965
16988
|
|
|
16966
16989
|
// src/commands/machine/daemon-status.ts
|