chatroom-cli 1.0.26 → 1.0.27

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.
@@ -1 +1 @@
1
- {"version":3,"file":"handoff.d.ts","sourceRoot":"","sources":["../../src/commands/handoff.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAQH,UAAU,cAAc;IACtB,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,CAAC,EAAE,OAAO,CAAC;CAClB;AAED,wBAAsB,OAAO,CAAC,UAAU,EAAE,MAAM,EAAE,OAAO,EAAE,cAAc,GAAG,OAAO,CAAC,IAAI,CAAC,CA8ExF"}
1
+ {"version":3,"file":"handoff.d.ts","sourceRoot":"","sources":["../../src/commands/handoff.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAQH,UAAU,cAAc;IACtB,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,CAAC,EAAE,OAAO,CAAC;CAClB;AAED,wBAAsB,OAAO,CAAC,UAAU,EAAE,MAAM,EAAE,OAAO,EAAE,cAAc,GAAG,OAAO,CAAC,IAAI,CAAC,CAqFxF"}
@@ -31,40 +31,36 @@ export async function handoff(chatroomId, options) {
31
31
  console.error(`❌ Invalid chatroom ID format: ID must be 20-40 characters (got ${chatroomId?.length || 0})`);
32
32
  process.exit(1);
33
33
  }
34
- try {
35
- // Use atomic handoff mutation - performs all operations in one transaction:
36
- // - Validates handoff is allowed (classification rules for user handoff)
37
- // - Completes all in_progress tasks
38
- // - Sends the handoff message
39
- // - Creates a task for target agent (if not user)
40
- // - Updates sender's participant status to waiting
41
- // - Promotes next queued task to pending
42
- //
43
- // Note: We use sendHandoff here for backward compatibility with deployed backend.
44
- // Once backend is deployed with the new 'handoff' mutation, this can be changed to api.messages.handoff
45
- await client.mutation(api.messages.sendHandoff, {
46
- sessionId,
47
- chatroomId: chatroomId,
48
- senderRole: role,
49
- content: message,
50
- targetRole: nextRole,
51
- });
52
- console.log(`✅ Task completed and handed off to ${nextRole}`);
53
- console.log(`📋 Summary: ${message.substring(0, 100)}${message.length > 100 ? '...' : ''}`);
54
- }
55
- catch (error) {
56
- // Handle handoff validation errors with helpful messages
57
- const errorMessage = error instanceof Error ? error.message : String(error);
58
- if (errorMessage.includes('Cannot hand off directly to user')) {
59
- console.error(`\n❌ Cannot hand off directly to user`);
60
- console.error(` Reason: new_feature requests must be reviewed before returning to user`);
61
- console.error(`\n💡 Please hand off to: reviewer`);
62
- console.error(` Example: chatroom handoff ${chatroomId} --role=${role} --message="<summary>" --next-role=reviewer`);
63
- process.exit(1);
34
+ // Use atomic handoff mutation - performs all operations in one transaction:
35
+ // - Validates handoff is allowed (classification rules for user handoff)
36
+ // - Completes all in_progress tasks
37
+ // - Sends the handoff message
38
+ // - Creates a task for target agent (if not user)
39
+ // - Updates sender's participant status to waiting
40
+ // - Promotes next queued task to pending
41
+ //
42
+ // Note: We use sendHandoff here for backward compatibility with deployed backend.
43
+ // Once backend is deployed with the new 'handoff' mutation, this can be changed to api.messages.handoff
44
+ const result = (await client.mutation(api.messages.sendHandoff, {
45
+ sessionId,
46
+ chatroomId: chatroomId,
47
+ senderRole: role,
48
+ content: message,
49
+ targetRole: nextRole,
50
+ }));
51
+ // Check for handoff restriction errors
52
+ if (!result.success && result.error) {
53
+ console.error(`\n❌ ERROR: ${result.error.message}`);
54
+ if (result.error.suggestedTarget) {
55
+ console.error(`\n💡 Try this instead:`);
56
+ console.error('```');
57
+ console.error(`chatroom handoff ${chatroomId} --role=${role} --message="<summary>" --next-role=${result.error.suggestedTarget}`);
58
+ console.error('```');
64
59
  }
65
- // Re-throw other errors
66
- throw error;
60
+ process.exit(1);
67
61
  }
62
+ console.log(`✅ Task completed and handed off to ${nextRole}`);
63
+ console.log(`📋 Summary: ${message.substring(0, 100)}${message.length > 100 ? '...' : ''}`);
68
64
  // Check if handing off to user (workflow completion)
69
65
  if (nextRole.toLowerCase() === 'user') {
70
66
  console.log(`\n🎉 Workflow complete! Control returned to user.`);
@@ -1 +1 @@
1
- {"version":3,"file":"handoff.js","sourceRoot":"","sources":["../../src/commands/handoff.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AACjD,OAAO,EAAE,GAAG,EAAE,MAAM,WAAW,CAAC;AAEhC,OAAO,EAAE,YAAY,EAAE,MAAM,mCAAmC,CAAC;AACjE,OAAO,EAAE,eAAe,EAAE,MAAM,oCAAoC,CAAC;AASrE,MAAM,CAAC,KAAK,UAAU,OAAO,CAAC,UAAkB,EAAE,OAAuB;IACvE,MAAM,MAAM,GAAG,MAAM,eAAe,EAAE,CAAC;IACvC,MAAM,EAAE,IAAI,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC;IAEpD,oCAAoC;IACpC,MAAM,SAAS,GAAG,YAAY,EAAE,CAAC;IACjC,IAAI,CAAC,SAAS,EAAE,CAAC;QACf,OAAO,CAAC,KAAK,CAAC,sDAAsD,CAAC,CAAC;QACtE,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAClB,CAAC;IAED,8BAA8B;IAC9B,IACE,CAAC,UAAU;QACX,OAAO,UAAU,KAAK,QAAQ;QAC9B,UAAU,CAAC,MAAM,GAAG,EAAE;QACtB,UAAU,CAAC,MAAM,GAAG,EAAE,EACtB,CAAC;QACD,OAAO,CAAC,KAAK,CACX,kEAAkE,UAAU,EAAE,MAAM,IAAI,CAAC,GAAG,CAC7F,CAAC;QACF,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAClB,CAAC;IAED,IAAI,CAAC;QACH,4EAA4E;QAC5E,yEAAyE;QACzE,oCAAoC;QACpC,8BAA8B;QAC9B,kDAAkD;QACl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,CAAC,CAAC,EAAE,GAAG,CAAC,GAAG,OAAO,CAAC,MAAM,GAAG,GAAG,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;IAE5F,qDAAqD;IACrD,IAAI,QAAQ,CAAC,WAAW,EAAE,KAAK,MAAM,EAAE,CAAC;QACtC,OAAO,CAAC,GAAG,CAAC,mDAAmD,CAAC,CAAC;QACjE,IAAI,CAAC,MAAM,EAAE,CAAC;YACZ,OAAO,CAAC,GAAG,CAAC,oCAAoC,CAAC,CAAC;YAClD,MAAM,WAAW,CAAC,UAAU,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC,CAAC;QACxD,CAAC;QACD,OAAO;IACT,CAAC;IAED,wDAAwD;IACxD,IAAI,CAAC,MAAM,EAAE,CAAC;QACZ,OAAO,CAAC,GAAG,CAAC,oCAAoC,CAAC,CAAC;QAClD,MAAM,WAAW,CAAC,UAAU,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC,CAAC;IACxD,CAAC;AACH,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "chatroom-cli",
3
- "version": "1.0.26",
3
+ "version": "1.0.27",
4
4
  "description": "CLI for multi-agent chatroom collaboration",
5
5
  "type": "module",
6
6
  "bin": {