chatroom-cli 1.9.0 → 1.10.0
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 +352 -42
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -11589,14 +11589,14 @@ var init_register_agent = __esm(() => {
|
|
|
11589
11589
|
init_client2();
|
|
11590
11590
|
init_machine();
|
|
11591
11591
|
});
|
|
11592
|
-
// ../../services/backend/prompts/cli/
|
|
11593
|
-
function
|
|
11592
|
+
// ../../services/backend/prompts/cli/classify/command.ts
|
|
11593
|
+
function classifyCommand(params) {
|
|
11594
11594
|
const prefix = params.cliEnvPrefix || "";
|
|
11595
11595
|
const chatroomId = params.chatroomId || "<chatroom-id>";
|
|
11596
11596
|
const role = params.role || "<role>";
|
|
11597
11597
|
const taskId = params.taskId || "<task-id>";
|
|
11598
11598
|
const classification = params.classification || "<question|new_feature|follow_up>";
|
|
11599
|
-
const baseCmd = `${prefix}chatroom
|
|
11599
|
+
const baseCmd = `${prefix}chatroom classify --chatroom-id="${chatroomId}" --role="${role}" --task-id="${taskId}" --origin-message-classification=${classification}`;
|
|
11600
11600
|
if (params.classification === "new_feature" || classification === "new_feature") {
|
|
11601
11601
|
const title = params.title || "[Feature title]";
|
|
11602
11602
|
const description = params.description || "[Feature description]";
|
|
@@ -11619,6 +11619,30 @@ var init_new_feature = () => {};
|
|
|
11619
11619
|
var init_classification = __esm(() => {
|
|
11620
11620
|
init_new_feature();
|
|
11621
11621
|
});
|
|
11622
|
+
|
|
11623
|
+
// ../../services/backend/prompts/cli/task-started/command.ts
|
|
11624
|
+
function taskStartedCommand(params) {
|
|
11625
|
+
const prefix = params.cliEnvPrefix || "";
|
|
11626
|
+
const chatroomId = params.chatroomId || "<chatroom-id>";
|
|
11627
|
+
const role = params.role || "<role>";
|
|
11628
|
+
const taskId = params.taskId || "<task-id>";
|
|
11629
|
+
const classification = params.classification || "<question|new_feature|follow_up>";
|
|
11630
|
+
const baseCmd = `${prefix}chatroom task-started --chatroom-id="${chatroomId}" --role="${role}" --task-id="${taskId}" --origin-message-classification=${classification}`;
|
|
11631
|
+
if (params.classification === "new_feature" || classification === "new_feature") {
|
|
11632
|
+
const title = params.title || "[Feature title]";
|
|
11633
|
+
const description = params.description || "[Feature description]";
|
|
11634
|
+
const techSpecs = params.techSpecs || "[Technical specifications]";
|
|
11635
|
+
return `${baseCmd} << 'EOF'
|
|
11636
|
+
---TITLE---
|
|
11637
|
+
${title}
|
|
11638
|
+
---DESCRIPTION---
|
|
11639
|
+
${description}
|
|
11640
|
+
---TECH_SPECS---
|
|
11641
|
+
${techSpecs}
|
|
11642
|
+
EOF`;
|
|
11643
|
+
}
|
|
11644
|
+
return baseCmd;
|
|
11645
|
+
}
|
|
11622
11646
|
// ../../services/backend/prompts/cli/task-started/main-prompt.ts
|
|
11623
11647
|
var init_main_prompt = () => {};
|
|
11624
11648
|
|
|
@@ -12259,6 +12283,169 @@ var init_task_started2 = __esm(() => {
|
|
|
12259
12283
|
init_client2();
|
|
12260
12284
|
});
|
|
12261
12285
|
|
|
12286
|
+
// src/commands/classify/index.ts
|
|
12287
|
+
var exports_classify = {};
|
|
12288
|
+
__export(exports_classify, {
|
|
12289
|
+
classify: () => classify
|
|
12290
|
+
});
|
|
12291
|
+
async function createDefaultDeps8() {
|
|
12292
|
+
const client2 = await getConvexClient();
|
|
12293
|
+
return {
|
|
12294
|
+
backend: {
|
|
12295
|
+
mutation: (endpoint, args) => client2.mutation(endpoint, args),
|
|
12296
|
+
query: (endpoint, args) => client2.query(endpoint, args)
|
|
12297
|
+
},
|
|
12298
|
+
session: {
|
|
12299
|
+
getSessionId,
|
|
12300
|
+
getConvexUrl,
|
|
12301
|
+
getOtherSessionUrls
|
|
12302
|
+
}
|
|
12303
|
+
};
|
|
12304
|
+
}
|
|
12305
|
+
async function classify(chatroomId, options, deps) {
|
|
12306
|
+
const d = deps ?? await createDefaultDeps8();
|
|
12307
|
+
const { role, originMessageClassification, rawStdin, taskId } = options;
|
|
12308
|
+
const convexUrl = d.session.getConvexUrl();
|
|
12309
|
+
const cliEnvPrefix = getCliEnvPrefix(convexUrl);
|
|
12310
|
+
const sessionId = d.session.getSessionId();
|
|
12311
|
+
if (!sessionId) {
|
|
12312
|
+
const otherUrls = d.session.getOtherSessionUrls();
|
|
12313
|
+
console.error(`❌ Not authenticated for: ${convexUrl}`);
|
|
12314
|
+
if (otherUrls.length > 0) {
|
|
12315
|
+
console.error(`
|
|
12316
|
+
\uD83D\uDCA1 You have sessions for other environments:`);
|
|
12317
|
+
for (const url of otherUrls) {
|
|
12318
|
+
console.error(` • ${url}`);
|
|
12319
|
+
}
|
|
12320
|
+
console.error(`
|
|
12321
|
+
To use a different environment, set CHATROOM_CONVEX_URL:`);
|
|
12322
|
+
console.error(` CHATROOM_CONVEX_URL=${otherUrls[0]} chatroom classify ...`);
|
|
12323
|
+
console.error(`
|
|
12324
|
+
Or to authenticate for the current environment:`);
|
|
12325
|
+
}
|
|
12326
|
+
console.error(` chatroom auth login`);
|
|
12327
|
+
process.exit(1);
|
|
12328
|
+
}
|
|
12329
|
+
if (!chatroomId || typeof chatroomId !== "string" || chatroomId.length < 20 || chatroomId.length > 40) {
|
|
12330
|
+
console.error(`❌ Invalid chatroom ID format: ID must be 20-40 characters (got ${chatroomId?.length || 0})`);
|
|
12331
|
+
process.exit(1);
|
|
12332
|
+
}
|
|
12333
|
+
const chatroom = await d.backend.query(api.chatrooms.get, {
|
|
12334
|
+
sessionId,
|
|
12335
|
+
chatroomId
|
|
12336
|
+
});
|
|
12337
|
+
if (!chatroom) {
|
|
12338
|
+
console.error(`❌ Chatroom not found: ${chatroomId}`);
|
|
12339
|
+
console.error(` Verify the chatroom ID is correct and you have access.`);
|
|
12340
|
+
process.exit(1);
|
|
12341
|
+
}
|
|
12342
|
+
const entryPoint = chatroom?.teamEntryPoint ?? chatroom?.teamRoles?.[0];
|
|
12343
|
+
if (entryPoint && role.toLowerCase() !== entryPoint.toLowerCase()) {
|
|
12344
|
+
console.error(`❌ \`classify\` is only available to the entry point role (${entryPoint}). Your role is ${role}.`);
|
|
12345
|
+
console.error("");
|
|
12346
|
+
console.error(" Entry point roles receive user messages and must classify them.");
|
|
12347
|
+
console.error(" Other roles receive handoffs and should use:");
|
|
12348
|
+
console.error(` ${cliEnvPrefix}chatroom task-started --chatroom-id=${chatroomId} --role=${role} --task-id=<task-id> --no-classify`);
|
|
12349
|
+
process.exit(1);
|
|
12350
|
+
}
|
|
12351
|
+
if (originMessageClassification === "new_feature") {
|
|
12352
|
+
if (!rawStdin || rawStdin.trim().length === 0) {
|
|
12353
|
+
console.error(`❌ new_feature classification requires stdin with feature metadata`);
|
|
12354
|
+
console.error(" Provide structured stdin with TITLE, DESCRIPTION, and TECH_SPECS");
|
|
12355
|
+
console.error("");
|
|
12356
|
+
console.error(" Example:");
|
|
12357
|
+
console.error(` echo '---TITLE---
|
|
12358
|
+
Feature title
|
|
12359
|
+
---DESCRIPTION---
|
|
12360
|
+
What this feature does
|
|
12361
|
+
---TECH_SPECS---
|
|
12362
|
+
How to implement it' | ${classifyCommand({
|
|
12363
|
+
chatroomId,
|
|
12364
|
+
role,
|
|
12365
|
+
taskId: "<task-id>",
|
|
12366
|
+
classification: "new_feature",
|
|
12367
|
+
cliEnvPrefix
|
|
12368
|
+
})}`);
|
|
12369
|
+
process.exit(1);
|
|
12370
|
+
}
|
|
12371
|
+
}
|
|
12372
|
+
if (!taskId) {
|
|
12373
|
+
console.error(`❌ --task-id is required for classify`);
|
|
12374
|
+
console.error(` Usage: ${classifyCommand({
|
|
12375
|
+
chatroomId: "<chatroomId>",
|
|
12376
|
+
role: "<role>",
|
|
12377
|
+
taskId: "<task-id>",
|
|
12378
|
+
classification: "question",
|
|
12379
|
+
cliEnvPrefix
|
|
12380
|
+
})}`);
|
|
12381
|
+
process.exit(1);
|
|
12382
|
+
}
|
|
12383
|
+
const targetTask = await d.backend.query(api.tasks.getTask, {
|
|
12384
|
+
sessionId,
|
|
12385
|
+
chatroomId,
|
|
12386
|
+
taskId
|
|
12387
|
+
});
|
|
12388
|
+
if (!targetTask) {
|
|
12389
|
+
console.error(`❌ Task with ID "${taskId}" not found in this chatroom`);
|
|
12390
|
+
console.error(` Verify the task ID is correct and you have access to this chatroom`);
|
|
12391
|
+
process.exit(1);
|
|
12392
|
+
}
|
|
12393
|
+
try {
|
|
12394
|
+
await d.backend.mutation(api.tasks.startTask, {
|
|
12395
|
+
sessionId,
|
|
12396
|
+
chatroomId,
|
|
12397
|
+
role,
|
|
12398
|
+
taskId
|
|
12399
|
+
});
|
|
12400
|
+
} catch (error) {
|
|
12401
|
+
const err = error;
|
|
12402
|
+
console.error(`❌ Failed to start task`);
|
|
12403
|
+
console.error(` Error: ${err.message}`);
|
|
12404
|
+
process.exit(1);
|
|
12405
|
+
}
|
|
12406
|
+
try {
|
|
12407
|
+
const result = await d.backend.mutation(api.messages.taskStarted, {
|
|
12408
|
+
sessionId,
|
|
12409
|
+
chatroomId,
|
|
12410
|
+
role,
|
|
12411
|
+
taskId,
|
|
12412
|
+
originMessageClassification,
|
|
12413
|
+
convexUrl: d.session.getConvexUrl(),
|
|
12414
|
+
...rawStdin && { rawStdin }
|
|
12415
|
+
});
|
|
12416
|
+
console.log(`✅ Task acknowledged and classified`);
|
|
12417
|
+
console.log(` Classification: ${originMessageClassification}`);
|
|
12418
|
+
console.log(` Task: ${targetTask.content}`);
|
|
12419
|
+
if (result.reminder) {
|
|
12420
|
+
console.log(`
|
|
12421
|
+
\uD83D\uDCA1 ${result.reminder}`);
|
|
12422
|
+
}
|
|
12423
|
+
} catch (error) {
|
|
12424
|
+
const err = error;
|
|
12425
|
+
console.error(`❌ Failed to acknowledge task`);
|
|
12426
|
+
console.error(` Error: ${err.message}`);
|
|
12427
|
+
if ("stack" in err && err.stack) {
|
|
12428
|
+
const stackLines = err.stack.split(`
|
|
12429
|
+
`).slice(0, 5);
|
|
12430
|
+
console.error(` Stack trace:`);
|
|
12431
|
+
stackLines.forEach((line) => console.error(` ${line}`));
|
|
12432
|
+
}
|
|
12433
|
+
if (typeof error === "object" && error !== null && "data" in error) {
|
|
12434
|
+
const errData = error.data;
|
|
12435
|
+
if (errData) {
|
|
12436
|
+
console.error(` Server details:`, JSON.stringify(errData, null, 2));
|
|
12437
|
+
}
|
|
12438
|
+
}
|
|
12439
|
+
process.exit(1);
|
|
12440
|
+
}
|
|
12441
|
+
}
|
|
12442
|
+
var init_classify = __esm(() => {
|
|
12443
|
+
init_env();
|
|
12444
|
+
init_api3();
|
|
12445
|
+
init_storage();
|
|
12446
|
+
init_client2();
|
|
12447
|
+
});
|
|
12448
|
+
|
|
12262
12449
|
// src/utils/serialization/decode/index.ts
|
|
12263
12450
|
var exports_decode = {};
|
|
12264
12451
|
__export(exports_decode, {
|
|
@@ -12399,7 +12586,7 @@ var exports_handoff = {};
|
|
|
12399
12586
|
__export(exports_handoff, {
|
|
12400
12587
|
handoff: () => handoff
|
|
12401
12588
|
});
|
|
12402
|
-
async function
|
|
12589
|
+
async function createDefaultDeps9() {
|
|
12403
12590
|
const client2 = await getConvexClient();
|
|
12404
12591
|
return {
|
|
12405
12592
|
backend: {
|
|
@@ -12414,7 +12601,7 @@ async function createDefaultDeps8() {
|
|
|
12414
12601
|
};
|
|
12415
12602
|
}
|
|
12416
12603
|
async function handoff(chatroomId, options, deps) {
|
|
12417
|
-
const d = deps ?? await
|
|
12604
|
+
const d = deps ?? await createDefaultDeps9();
|
|
12418
12605
|
const { role, message, nextRole, attachedArtifactIds = [] } = options;
|
|
12419
12606
|
const sessionId = d.session.getSessionId();
|
|
12420
12607
|
if (!sessionId) {
|
|
@@ -12447,7 +12634,7 @@ async function handoff(chatroomId, options, deps) {
|
|
|
12447
12634
|
}
|
|
12448
12635
|
let result;
|
|
12449
12636
|
try {
|
|
12450
|
-
result = await d.backend.mutation(api.messages.
|
|
12637
|
+
result = await d.backend.mutation(api.messages.handoff, {
|
|
12451
12638
|
sessionId,
|
|
12452
12639
|
chatroomId,
|
|
12453
12640
|
senderRole: role,
|
|
@@ -12548,7 +12735,7 @@ var exports_report_progress = {};
|
|
|
12548
12735
|
__export(exports_report_progress, {
|
|
12549
12736
|
reportProgress: () => reportProgress
|
|
12550
12737
|
});
|
|
12551
|
-
async function
|
|
12738
|
+
async function createDefaultDeps10() {
|
|
12552
12739
|
const client2 = await getConvexClient();
|
|
12553
12740
|
return {
|
|
12554
12741
|
backend: {
|
|
@@ -12563,7 +12750,7 @@ async function createDefaultDeps9() {
|
|
|
12563
12750
|
};
|
|
12564
12751
|
}
|
|
12565
12752
|
async function reportProgress(chatroomId, options, deps) {
|
|
12566
|
-
const d = deps ?? await
|
|
12753
|
+
const d = deps ?? await createDefaultDeps10();
|
|
12567
12754
|
const { role, message } = options;
|
|
12568
12755
|
const sessionId = d.session.getSessionId();
|
|
12569
12756
|
if (!sessionId) {
|
|
@@ -12656,7 +12843,7 @@ __export(exports_backlog, {
|
|
|
12656
12843
|
completeBacklog: () => completeBacklog,
|
|
12657
12844
|
addBacklog: () => addBacklog
|
|
12658
12845
|
});
|
|
12659
|
-
async function
|
|
12846
|
+
async function createDefaultDeps11() {
|
|
12660
12847
|
const client2 = await getConvexClient();
|
|
12661
12848
|
return {
|
|
12662
12849
|
backend: {
|
|
@@ -12685,7 +12872,7 @@ function validateChatroomId(chatroomId) {
|
|
|
12685
12872
|
}
|
|
12686
12873
|
}
|
|
12687
12874
|
async function listBacklog(chatroomId, options, deps) {
|
|
12688
|
-
const d = deps ?? await
|
|
12875
|
+
const d = deps ?? await createDefaultDeps11();
|
|
12689
12876
|
const sessionId = requireAuth2(d);
|
|
12690
12877
|
validateChatroomId(chatroomId);
|
|
12691
12878
|
const limit = options.limit ?? 100;
|
|
@@ -12742,7 +12929,7 @@ async function listBacklog(chatroomId, options, deps) {
|
|
|
12742
12929
|
}
|
|
12743
12930
|
}
|
|
12744
12931
|
async function addBacklog(chatroomId, options, deps) {
|
|
12745
|
-
const d = deps ?? await
|
|
12932
|
+
const d = deps ?? await createDefaultDeps11();
|
|
12746
12933
|
const sessionId = requireAuth2(d);
|
|
12747
12934
|
validateChatroomId(chatroomId);
|
|
12748
12935
|
if (!options.content || options.content.trim().length === 0) {
|
|
@@ -12769,7 +12956,7 @@ async function addBacklog(chatroomId, options, deps) {
|
|
|
12769
12956
|
}
|
|
12770
12957
|
}
|
|
12771
12958
|
async function completeBacklog(chatroomId, options, deps) {
|
|
12772
|
-
const d = deps ?? await
|
|
12959
|
+
const d = deps ?? await createDefaultDeps11();
|
|
12773
12960
|
const sessionId = requireAuth2(d);
|
|
12774
12961
|
validateChatroomId(chatroomId);
|
|
12775
12962
|
if (!options.backlogItemId || options.backlogItemId.trim().length === 0) {
|
|
@@ -12803,7 +12990,7 @@ async function completeBacklog(chatroomId, options, deps) {
|
|
|
12803
12990
|
}
|
|
12804
12991
|
}
|
|
12805
12992
|
async function reopenBacklog(chatroomId, options, deps) {
|
|
12806
|
-
const d = deps ?? await
|
|
12993
|
+
const d = deps ?? await createDefaultDeps11();
|
|
12807
12994
|
const sessionId = requireAuth2(d);
|
|
12808
12995
|
validateChatroomId(chatroomId);
|
|
12809
12996
|
if (!options.backlogItemId || options.backlogItemId.trim().length === 0) {
|
|
@@ -12830,7 +13017,7 @@ async function reopenBacklog(chatroomId, options, deps) {
|
|
|
12830
13017
|
}
|
|
12831
13018
|
}
|
|
12832
13019
|
async function patchBacklog(chatroomId, options, deps) {
|
|
12833
|
-
const d = deps ?? await
|
|
13020
|
+
const d = deps ?? await createDefaultDeps11();
|
|
12834
13021
|
const sessionId = requireAuth2(d);
|
|
12835
13022
|
validateChatroomId(chatroomId);
|
|
12836
13023
|
if (!options.backlogItemId || options.backlogItemId.trim().length === 0) {
|
|
@@ -12892,7 +13079,7 @@ async function patchBacklog(chatroomId, options, deps) {
|
|
|
12892
13079
|
}
|
|
12893
13080
|
}
|
|
12894
13081
|
async function scoreBacklog(chatroomId, options, deps) {
|
|
12895
|
-
const d = deps ?? await
|
|
13082
|
+
const d = deps ?? await createDefaultDeps11();
|
|
12896
13083
|
const sessionId = requireAuth2(d);
|
|
12897
13084
|
validateChatroomId(chatroomId);
|
|
12898
13085
|
if (!options.backlogItemId || options.backlogItemId.trim().length === 0) {
|
|
@@ -12955,7 +13142,7 @@ async function scoreBacklog(chatroomId, options, deps) {
|
|
|
12955
13142
|
}
|
|
12956
13143
|
}
|
|
12957
13144
|
async function markForReviewBacklog(chatroomId, options, deps) {
|
|
12958
|
-
const d = deps ?? await
|
|
13145
|
+
const d = deps ?? await createDefaultDeps11();
|
|
12959
13146
|
const sessionId = requireAuth2(d);
|
|
12960
13147
|
validateChatroomId(chatroomId);
|
|
12961
13148
|
if (!options.backlogItemId || options.backlogItemId.trim().length === 0) {
|
|
@@ -12982,7 +13169,7 @@ async function markForReviewBacklog(chatroomId, options, deps) {
|
|
|
12982
13169
|
}
|
|
12983
13170
|
}
|
|
12984
13171
|
async function historyBacklog(chatroomId, options, deps) {
|
|
12985
|
-
const d = deps ?? await
|
|
13172
|
+
const d = deps ?? await createDefaultDeps11();
|
|
12986
13173
|
const sessionId = requireAuth2(d);
|
|
12987
13174
|
validateChatroomId(chatroomId);
|
|
12988
13175
|
const now = Date.now();
|
|
@@ -13131,13 +13318,99 @@ function resolveContent(content, filePath, optionName) {
|
|
|
13131
13318
|
}
|
|
13132
13319
|
var init_file_content = () => {};
|
|
13133
13320
|
|
|
13321
|
+
// src/commands/task/read/index.ts
|
|
13322
|
+
var exports_read = {};
|
|
13323
|
+
__export(exports_read, {
|
|
13324
|
+
taskRead: () => taskRead
|
|
13325
|
+
});
|
|
13326
|
+
async function createDefaultDeps12() {
|
|
13327
|
+
const client2 = await getConvexClient();
|
|
13328
|
+
return {
|
|
13329
|
+
backend: {
|
|
13330
|
+
mutation: (endpoint, args) => client2.mutation(endpoint, args),
|
|
13331
|
+
query: (endpoint, args) => client2.query(endpoint, args)
|
|
13332
|
+
},
|
|
13333
|
+
session: {
|
|
13334
|
+
getSessionId,
|
|
13335
|
+
getConvexUrl,
|
|
13336
|
+
getOtherSessionUrls
|
|
13337
|
+
}
|
|
13338
|
+
};
|
|
13339
|
+
}
|
|
13340
|
+
async function taskRead(chatroomId, options, deps) {
|
|
13341
|
+
const d = deps ?? await createDefaultDeps12();
|
|
13342
|
+
const { role, taskId } = options;
|
|
13343
|
+
const convexUrl = d.session.getConvexUrl();
|
|
13344
|
+
const sessionId = d.session.getSessionId();
|
|
13345
|
+
if (!sessionId) {
|
|
13346
|
+
const otherUrls = d.session.getOtherSessionUrls();
|
|
13347
|
+
console.error(`❌ Not authenticated for: ${convexUrl}`);
|
|
13348
|
+
if (otherUrls.length > 0) {
|
|
13349
|
+
console.error(`
|
|
13350
|
+
\uD83D\uDCA1 You have sessions for other environments:`);
|
|
13351
|
+
for (const url of otherUrls) {
|
|
13352
|
+
console.error(` • ${url}`);
|
|
13353
|
+
}
|
|
13354
|
+
console.error(`
|
|
13355
|
+
To use a different environment, set CHATROOM_CONVEX_URL:`);
|
|
13356
|
+
console.error(` CHATROOM_CONVEX_URL=${otherUrls[0]} chatroom task read ...`);
|
|
13357
|
+
console.error(`
|
|
13358
|
+
Or to authenticate for the current environment:`);
|
|
13359
|
+
}
|
|
13360
|
+
console.error(` chatroom auth login`);
|
|
13361
|
+
process.exit(1);
|
|
13362
|
+
}
|
|
13363
|
+
if (!chatroomId || typeof chatroomId !== "string" || chatroomId.length < 20 || chatroomId.length > 40) {
|
|
13364
|
+
console.error(`❌ Invalid chatroom ID format: ID must be 20-40 characters (got ${chatroomId?.length || 0})`);
|
|
13365
|
+
process.exit(1);
|
|
13366
|
+
}
|
|
13367
|
+
if (!taskId || typeof taskId !== "string" || taskId.length < 20 || taskId.length > 40) {
|
|
13368
|
+
console.error(`❌ Invalid task ID format: ID must be 20-40 characters (got ${taskId?.length || 0})`);
|
|
13369
|
+
process.exit(1);
|
|
13370
|
+
}
|
|
13371
|
+
try {
|
|
13372
|
+
const result = await d.backend.mutation(api.tasks.readTask, {
|
|
13373
|
+
sessionId,
|
|
13374
|
+
chatroomId,
|
|
13375
|
+
role,
|
|
13376
|
+
taskId
|
|
13377
|
+
});
|
|
13378
|
+
console.log(`✅ Task content:`);
|
|
13379
|
+
console.log(` Task ID: ${result.taskId}`);
|
|
13380
|
+
console.log(` Status: ${result.status}`);
|
|
13381
|
+
console.log(`
|
|
13382
|
+
${result.content}`);
|
|
13383
|
+
} catch (error) {
|
|
13384
|
+
const err = error;
|
|
13385
|
+
console.error(`❌ Failed to read task`);
|
|
13386
|
+
console.error(` Error: ${err.message}`);
|
|
13387
|
+
if (err.message.includes("not found")) {
|
|
13388
|
+
console.error(`
|
|
13389
|
+
Verify the task ID is correct and you have access to this chatroom.`);
|
|
13390
|
+
} else if (err.message.includes("assigned to")) {
|
|
13391
|
+
console.error(`
|
|
13392
|
+
This task is not assigned to your role. Use the correct --role flag.`);
|
|
13393
|
+
} else if (err.message.includes("acknowledged")) {
|
|
13394
|
+
console.error(`
|
|
13395
|
+
Tasks must be in 'acknowledged' status to be read.`);
|
|
13396
|
+
console.error(` If this task is already in_progress, this might be a recovery situation.`);
|
|
13397
|
+
}
|
|
13398
|
+
process.exit(1);
|
|
13399
|
+
}
|
|
13400
|
+
}
|
|
13401
|
+
var init_read = __esm(() => {
|
|
13402
|
+
init_api3();
|
|
13403
|
+
init_storage();
|
|
13404
|
+
init_client2();
|
|
13405
|
+
});
|
|
13406
|
+
|
|
13134
13407
|
// src/commands/skill/index.ts
|
|
13135
13408
|
var exports_skill = {};
|
|
13136
13409
|
__export(exports_skill, {
|
|
13137
13410
|
listSkills: () => listSkills,
|
|
13138
13411
|
activateSkill: () => activateSkill
|
|
13139
13412
|
});
|
|
13140
|
-
async function
|
|
13413
|
+
async function createDefaultDeps13() {
|
|
13141
13414
|
const client2 = await getConvexClient();
|
|
13142
13415
|
return {
|
|
13143
13416
|
backend: {
|
|
@@ -13160,7 +13433,7 @@ function requireAuth3(d) {
|
|
|
13160
13433
|
return sessionId;
|
|
13161
13434
|
}
|
|
13162
13435
|
async function listSkills(chatroomId, options, deps) {
|
|
13163
|
-
const d = deps ?? await
|
|
13436
|
+
const d = deps ?? await createDefaultDeps13();
|
|
13164
13437
|
const sessionId = requireAuth3(d);
|
|
13165
13438
|
try {
|
|
13166
13439
|
const skills = await d.backend.query(api.skills.list, {
|
|
@@ -13188,7 +13461,7 @@ async function listSkills(chatroomId, options, deps) {
|
|
|
13188
13461
|
}
|
|
13189
13462
|
}
|
|
13190
13463
|
async function activateSkill(chatroomId, skillId, options, deps) {
|
|
13191
|
-
const d = deps ?? await
|
|
13464
|
+
const d = deps ?? await createDefaultDeps13();
|
|
13192
13465
|
const sessionId = requireAuth3(d);
|
|
13193
13466
|
try {
|
|
13194
13467
|
const convexUrl = d.session.getConvexUrl();
|
|
@@ -13226,7 +13499,7 @@ __export(exports_messages, {
|
|
|
13226
13499
|
listSinceMessage: () => listSinceMessage,
|
|
13227
13500
|
listBySenderRole: () => listBySenderRole
|
|
13228
13501
|
});
|
|
13229
|
-
async function
|
|
13502
|
+
async function createDefaultDeps14() {
|
|
13230
13503
|
const client2 = await getConvexClient();
|
|
13231
13504
|
return {
|
|
13232
13505
|
backend: {
|
|
@@ -13241,7 +13514,7 @@ async function createDefaultDeps12() {
|
|
|
13241
13514
|
};
|
|
13242
13515
|
}
|
|
13243
13516
|
async function listBySenderRole(chatroomId, options, deps) {
|
|
13244
|
-
const d = deps ?? await
|
|
13517
|
+
const d = deps ?? await createDefaultDeps14();
|
|
13245
13518
|
const sessionId = d.session.getSessionId();
|
|
13246
13519
|
if (!sessionId) {
|
|
13247
13520
|
console.error(`❌ Not authenticated. Please run: chatroom auth login`);
|
|
@@ -13306,7 +13579,7 @@ ${content.split(`
|
|
|
13306
13579
|
}
|
|
13307
13580
|
}
|
|
13308
13581
|
async function listSinceMessage(chatroomId, options, deps) {
|
|
13309
|
-
const d = deps ?? await
|
|
13582
|
+
const d = deps ?? await createDefaultDeps14();
|
|
13310
13583
|
const sessionId = d.session.getSessionId();
|
|
13311
13584
|
if (!sessionId) {
|
|
13312
13585
|
console.error(`❌ Not authenticated. Please run: chatroom auth login`);
|
|
@@ -13382,7 +13655,7 @@ __export(exports_context, {
|
|
|
13382
13655
|
listContexts: () => listContexts,
|
|
13383
13656
|
inspectContext: () => inspectContext
|
|
13384
13657
|
});
|
|
13385
|
-
async function
|
|
13658
|
+
async function createDefaultDeps15() {
|
|
13386
13659
|
const client2 = await getConvexClient();
|
|
13387
13660
|
return {
|
|
13388
13661
|
backend: {
|
|
@@ -13397,7 +13670,7 @@ async function createDefaultDeps13() {
|
|
|
13397
13670
|
};
|
|
13398
13671
|
}
|
|
13399
13672
|
async function readContext(chatroomId, options, deps) {
|
|
13400
|
-
const d = deps ?? await
|
|
13673
|
+
const d = deps ?? await createDefaultDeps15();
|
|
13401
13674
|
const sessionId = d.session.getSessionId();
|
|
13402
13675
|
if (!sessionId) {
|
|
13403
13676
|
console.error(`❌ Not authenticated. Please run: chatroom auth login`);
|
|
@@ -13512,7 +13785,7 @@ async function readContext(chatroomId, options, deps) {
|
|
|
13512
13785
|
}
|
|
13513
13786
|
}
|
|
13514
13787
|
async function newContext(chatroomId, options, deps) {
|
|
13515
|
-
const d = deps ?? await
|
|
13788
|
+
const d = deps ?? await createDefaultDeps15();
|
|
13516
13789
|
const sessionId = d.session.getSessionId();
|
|
13517
13790
|
if (!sessionId) {
|
|
13518
13791
|
console.error(`❌ Not authenticated. Please run: chatroom auth login`);
|
|
@@ -13564,7 +13837,7 @@ async function newContext(chatroomId, options, deps) {
|
|
|
13564
13837
|
}
|
|
13565
13838
|
}
|
|
13566
13839
|
async function listContexts(chatroomId, options, deps) {
|
|
13567
|
-
const d = deps ?? await
|
|
13840
|
+
const d = deps ?? await createDefaultDeps15();
|
|
13568
13841
|
const sessionId = d.session.getSessionId();
|
|
13569
13842
|
if (!sessionId) {
|
|
13570
13843
|
console.error(`❌ Not authenticated. Please run: chatroom auth login`);
|
|
@@ -13616,7 +13889,7 @@ async function listContexts(chatroomId, options, deps) {
|
|
|
13616
13889
|
}
|
|
13617
13890
|
}
|
|
13618
13891
|
async function inspectContext(chatroomId, options, deps) {
|
|
13619
|
-
const d = deps ?? await
|
|
13892
|
+
const d = deps ?? await createDefaultDeps15();
|
|
13620
13893
|
const sessionId = d.session.getSessionId();
|
|
13621
13894
|
if (!sessionId) {
|
|
13622
13895
|
console.error(`❌ Not authenticated. Please run: chatroom auth login`);
|
|
@@ -13676,7 +13949,7 @@ __export(exports_guidelines, {
|
|
|
13676
13949
|
viewGuidelines: () => viewGuidelines,
|
|
13677
13950
|
listGuidelineTypes: () => listGuidelineTypes
|
|
13678
13951
|
});
|
|
13679
|
-
async function
|
|
13952
|
+
async function createDefaultDeps16() {
|
|
13680
13953
|
const client2 = await getConvexClient();
|
|
13681
13954
|
return {
|
|
13682
13955
|
backend: {
|
|
@@ -13691,7 +13964,7 @@ async function createDefaultDeps14() {
|
|
|
13691
13964
|
};
|
|
13692
13965
|
}
|
|
13693
13966
|
async function viewGuidelines(options, deps) {
|
|
13694
|
-
const d = deps ?? await
|
|
13967
|
+
const d = deps ?? await createDefaultDeps16();
|
|
13695
13968
|
const { type } = options;
|
|
13696
13969
|
if (!VALID_TYPES.includes(type)) {
|
|
13697
13970
|
console.error(`❌ Invalid guideline type: "${type}"`);
|
|
@@ -13726,7 +13999,7 @@ ${"═".repeat(60)}
|
|
|
13726
13999
|
}
|
|
13727
14000
|
}
|
|
13728
14001
|
async function listGuidelineTypes(deps) {
|
|
13729
|
-
const d = deps ?? await
|
|
14002
|
+
const d = deps ?? await createDefaultDeps16();
|
|
13730
14003
|
const sessionId = d.session.getSessionId();
|
|
13731
14004
|
if (!sessionId) {
|
|
13732
14005
|
console.error(`❌ Not authenticated. Please run: chatroom auth login`);
|
|
@@ -13768,7 +14041,7 @@ __export(exports_artifact, {
|
|
|
13768
14041
|
viewArtifact: () => viewArtifact,
|
|
13769
14042
|
createArtifact: () => createArtifact
|
|
13770
14043
|
});
|
|
13771
|
-
async function
|
|
14044
|
+
async function createDefaultDeps17() {
|
|
13772
14045
|
const client2 = await getConvexClient();
|
|
13773
14046
|
return {
|
|
13774
14047
|
backend: {
|
|
@@ -13783,7 +14056,7 @@ async function createDefaultDeps15() {
|
|
|
13783
14056
|
};
|
|
13784
14057
|
}
|
|
13785
14058
|
async function createArtifact(chatroomId, options, deps) {
|
|
13786
|
-
const d = deps ?? await
|
|
14059
|
+
const d = deps ?? await createDefaultDeps17();
|
|
13787
14060
|
const sessionId = d.session.getSessionId();
|
|
13788
14061
|
if (!sessionId) {
|
|
13789
14062
|
formatAuthError(d.session.getConvexUrl(), d.session.getOtherSessionUrls());
|
|
@@ -13837,7 +14110,7 @@ async function createArtifact(chatroomId, options, deps) {
|
|
|
13837
14110
|
}
|
|
13838
14111
|
}
|
|
13839
14112
|
async function viewArtifact(chatroomId, options, deps) {
|
|
13840
|
-
const d = deps ?? await
|
|
14113
|
+
const d = deps ?? await createDefaultDeps17();
|
|
13841
14114
|
const sessionId = d.session.getSessionId();
|
|
13842
14115
|
if (!sessionId) {
|
|
13843
14116
|
formatAuthError(d.session.getConvexUrl(), d.session.getOtherSessionUrls());
|
|
@@ -13881,7 +14154,7 @@ async function viewArtifact(chatroomId, options, deps) {
|
|
|
13881
14154
|
}
|
|
13882
14155
|
}
|
|
13883
14156
|
async function viewManyArtifacts(chatroomId, options, deps) {
|
|
13884
|
-
const d = deps ?? await
|
|
14157
|
+
const d = deps ?? await createDefaultDeps17();
|
|
13885
14158
|
const sessionId = d.session.getSessionId();
|
|
13886
14159
|
if (!sessionId) {
|
|
13887
14160
|
formatAuthError(d.session.getConvexUrl(), d.session.getOtherSessionUrls());
|
|
@@ -13947,7 +14220,7 @@ var exports_get_system_prompt = {};
|
|
|
13947
14220
|
__export(exports_get_system_prompt, {
|
|
13948
14221
|
getSystemPrompt: () => getSystemPrompt
|
|
13949
14222
|
});
|
|
13950
|
-
async function
|
|
14223
|
+
async function createDefaultDeps18() {
|
|
13951
14224
|
const client2 = await getConvexClient();
|
|
13952
14225
|
return {
|
|
13953
14226
|
backend: {
|
|
@@ -13962,7 +14235,7 @@ async function createDefaultDeps16() {
|
|
|
13962
14235
|
};
|
|
13963
14236
|
}
|
|
13964
14237
|
async function getSystemPrompt(chatroomId, options, deps) {
|
|
13965
|
-
const d = deps ?? await
|
|
14238
|
+
const d = deps ?? await createDefaultDeps18();
|
|
13966
14239
|
const { role } = options;
|
|
13967
14240
|
const sessionId = d.session.getSessionId();
|
|
13968
14241
|
if (!sessionId) {
|
|
@@ -14484,7 +14757,7 @@ async function discoverModels(agentServices) {
|
|
|
14484
14757
|
}
|
|
14485
14758
|
return results;
|
|
14486
14759
|
}
|
|
14487
|
-
function
|
|
14760
|
+
function createDefaultDeps19() {
|
|
14488
14761
|
return {
|
|
14489
14762
|
backend: {
|
|
14490
14763
|
mutation: async () => {
|
|
@@ -14622,7 +14895,7 @@ async function initDaemon() {
|
|
|
14622
14895
|
const agentServices = new Map(getAllHarnesses().map((s) => [s.id, s]));
|
|
14623
14896
|
const availableModels = await registerCapabilities(client2, typedSessionId, config3, agentServices);
|
|
14624
14897
|
await connectDaemon(client2, typedSessionId, machineId, convexUrl);
|
|
14625
|
-
const deps =
|
|
14898
|
+
const deps = createDefaultDeps19();
|
|
14626
14899
|
deps.backend.mutation = (endpoint, args) => client2.mutation(endpoint, args);
|
|
14627
14900
|
deps.backend.query = (endpoint, args) => client2.query(endpoint, args);
|
|
14628
14901
|
const events = new DaemonEventBus;
|
|
@@ -15688,7 +15961,7 @@ async function isChatroomInstalledDefault() {
|
|
|
15688
15961
|
return false;
|
|
15689
15962
|
}
|
|
15690
15963
|
}
|
|
15691
|
-
async function
|
|
15964
|
+
async function createDefaultDeps20() {
|
|
15692
15965
|
const client2 = await getConvexClient();
|
|
15693
15966
|
const fs = await import("fs/promises");
|
|
15694
15967
|
return {
|
|
@@ -15716,7 +15989,7 @@ async function createDefaultDeps18() {
|
|
|
15716
15989
|
};
|
|
15717
15990
|
}
|
|
15718
15991
|
async function installTool(options = {}, deps) {
|
|
15719
|
-
const d = deps ?? await
|
|
15992
|
+
const d = deps ?? await createDefaultDeps20();
|
|
15720
15993
|
const { checkExisting = true } = options;
|
|
15721
15994
|
const os = await import("os");
|
|
15722
15995
|
const path2 = await import("path");
|
|
@@ -16220,7 +16493,8 @@ program2.command("get-next-task").description("Join a chatroom and get the next
|
|
|
16220
16493
|
role: options.role
|
|
16221
16494
|
});
|
|
16222
16495
|
});
|
|
16223
|
-
program2.command("task-started").description("Acknowledge a task and optionally classify the user message").requiredOption("--chatroom-id <id>", "Chatroom identifier").requiredOption("--role <role>", "Your role").option("--origin-message-classification <type>", "Original message classification: question, new_feature, or follow_up (for entry point roles)").option("--no-classify", "Skip classification (for handoff recipients - classification already done by entry point)").requiredOption("--task-id <taskId>", "Task ID to acknowledge").action(async (options) => {
|
|
16496
|
+
program2.command("task-started").description("[LEGACY] Acknowledge a task and optionally classify the user message. Use classify instead for entry-point roles.").requiredOption("--chatroom-id <id>", "Chatroom identifier").requiredOption("--role <role>", "Your role").option("--origin-message-classification <type>", "Original message classification: question, new_feature, or follow_up (for entry point roles)").option("--no-classify", "Skip classification (for handoff recipients - classification already done by entry point)").requiredOption("--task-id <taskId>", "Task ID to acknowledge").action(async (options) => {
|
|
16497
|
+
console.error("⚠️ DEPRECATED: task-started is legacy. Use chatroom classify for entry-point roles.");
|
|
16224
16498
|
await maybeRequireAuth();
|
|
16225
16499
|
const skipClassification = options.classify === false;
|
|
16226
16500
|
if (!skipClassification && !options.originMessageClassification) {
|
|
@@ -16269,6 +16543,36 @@ program2.command("task-started").description("Acknowledge a task and optionally
|
|
|
16269
16543
|
noClassify: skipClassification
|
|
16270
16544
|
});
|
|
16271
16545
|
});
|
|
16546
|
+
program2.command("classify").description("Classify a task's origin message (entry-point role only). Use task-started --no-classify for handoffs.").requiredOption("--chatroom-id <id>", "Chatroom identifier").requiredOption("--role <role>", "Your role (must be entry-point role)").requiredOption("--task-id <taskId>", "Task ID to acknowledge").requiredOption("--origin-message-classification <type>", "Original message classification: question, new_feature, or follow_up").action(async (options) => {
|
|
16547
|
+
await maybeRequireAuth();
|
|
16548
|
+
const validClassifications = ["question", "new_feature", "follow_up"];
|
|
16549
|
+
if (!validClassifications.includes(options.originMessageClassification)) {
|
|
16550
|
+
console.error(`❌ Invalid classification: ${options.originMessageClassification}. Must be one of: ${validClassifications.join(", ")}`);
|
|
16551
|
+
process.exit(1);
|
|
16552
|
+
}
|
|
16553
|
+
let rawStdin;
|
|
16554
|
+
if (options.originMessageClassification === "new_feature") {
|
|
16555
|
+
const stdinContent = await readStdin();
|
|
16556
|
+
if (!stdinContent.trim()) {
|
|
16557
|
+
console.error(`❌ Stdin is empty. For new_feature classification, provide:
|
|
16558
|
+
---TITLE---
|
|
16559
|
+
[title]
|
|
16560
|
+
---DESCRIPTION---
|
|
16561
|
+
[description]
|
|
16562
|
+
---TECH_SPECS---
|
|
16563
|
+
[specs]`);
|
|
16564
|
+
process.exit(1);
|
|
16565
|
+
}
|
|
16566
|
+
rawStdin = stdinContent;
|
|
16567
|
+
}
|
|
16568
|
+
const { classify: classify2 } = await Promise.resolve().then(() => (init_classify(), exports_classify));
|
|
16569
|
+
await classify2(options.chatroomId, {
|
|
16570
|
+
role: options.role,
|
|
16571
|
+
originMessageClassification: options.originMessageClassification,
|
|
16572
|
+
taskId: options.taskId,
|
|
16573
|
+
rawStdin
|
|
16574
|
+
});
|
|
16575
|
+
});
|
|
16272
16576
|
program2.command("handoff").description("Complete your task and hand off to the next role").requiredOption("--chatroom-id <id>", "Chatroom identifier").requiredOption("--role <role>", "Your role").requiredOption("--next-role <nextRole>", "Role to hand off to").option("--attach-artifact <artifactId>", "Attach artifact to handoff (can be used multiple times)", (value, previous) => {
|
|
16273
16577
|
return previous ? [...previous, value] : [value];
|
|
16274
16578
|
}, []).action(async (options) => {
|
|
@@ -16380,6 +16684,12 @@ backlogCommand.command("history").description("View completed and closed backlog
|
|
|
16380
16684
|
limit: options.limit ? parseInt(options.limit, 10) : undefined
|
|
16381
16685
|
});
|
|
16382
16686
|
});
|
|
16687
|
+
var taskCommand = program2.command("task").description("Manage tasks");
|
|
16688
|
+
taskCommand.command("read").description("Read a task and mark it as in_progress").requiredOption("--chatroom-id <id>", "Chatroom identifier").requiredOption("--role <role>", "Your role in the chatroom").requiredOption("--task-id <taskId>", "Task ID to read").action(async (options) => {
|
|
16689
|
+
await maybeRequireAuth();
|
|
16690
|
+
const { taskRead: taskRead2 } = await Promise.resolve().then(() => (init_read(), exports_read));
|
|
16691
|
+
await taskRead2(options.chatroomId, { role: options.role, taskId: options.taskId });
|
|
16692
|
+
});
|
|
16383
16693
|
var skillCommand = program2.command("skill").description("Manage and activate chatroom skills");
|
|
16384
16694
|
skillCommand.command("list").description("List available skills for a chatroom").requiredOption("--chatroom-id <id>", "Chatroom identifier").requiredOption("--role <role>", "Your role").action(async (options) => {
|
|
16385
16695
|
await maybeRequireAuth();
|