thinkncollab-shell 0.0.9 → 0.0.12

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "thinkncollab-shell",
3
- "version": "0.0.9",
3
+ "version": "0.0.12",
4
4
  "description": "ThinkNCollab Custom Shell with WebSocket collaboration",
5
5
  "main": "src/core/shell.js",
6
6
  "bin": {
@@ -41,5 +41,8 @@
41
41
  "bin/",
42
42
  "src/",
43
43
  "README.md"
44
- ]
44
+ ],
45
+ "devDependencies": {
46
+ "playwright": "^1.59.1"
47
+ }
45
48
  }
@@ -1,9 +1,7 @@
1
1
  /*
2
2
  Say Command
3
-
4
3
  Usage: say <message>
5
- */
6
-
4
+ */
7
5
  const chalk = require('chalk');
8
6
 
9
7
  module.exports = {
@@ -12,30 +10,38 @@ module.exports = {
12
10
  aliases: ['msg', 'm', 'send'],
13
11
  requiresAuth: true,
14
12
  requiresRoom: true,
15
-
13
+
16
14
  async execute(args, shell) {
17
- const message = args.join(' ');
18
-
15
+ const message = args.join(' ').trim();
19
16
  if (!message) {
20
17
  console.log(chalk.red('❌ Usage: say <message>'));
21
18
  return;
22
19
  }
23
-
20
+
21
+ const room = shell.ws.getCurrentRoom?.();
22
+ if (!room) {
23
+ console.log(chalk.red('❌ Not in any room. Use: join <room-id>'));
24
+ return;
25
+ }
26
+
24
27
  try {
25
- await shell.api.sendMessage(message);
26
-
27
- // Clear typing indicator
28
+ // Stop typing indicator if active
28
29
  if (shell.isTyping) {
29
- shell.api.sendTyping(false);
30
+ shell.ws.socket?.emit('thinknsh:typing', { roomId: room, typing: false });
30
31
  shell.isTyping = false;
31
32
  clearTimeout(shell.typingTimeout);
32
33
  }
33
-
34
- // Echo locally (server will also broadcast)
34
+
35
+ await shell.ws.sendMessage(message);
36
+
35
37
  const user = shell.api.getUser();
36
38
  const time = new Date().toLocaleTimeString();
37
- console.log(chalk.dim(`[${time}] `) + chalk.green(`You: ${message}`));
38
-
39
+ console.log(
40
+ chalk.dim(`[${time}] `) +
41
+ chalk.green(`${user?.name || 'You'}: `) +
42
+ chalk.white(message)
43
+ );
44
+
39
45
  } catch (error) {
40
46
  console.log(chalk.red(`❌ Failed to send: ${error.message}`));
41
47
  }