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 +5 -2
- package/src/commands/message/say.js +21 -15
- package/src/commands/tasks/complete.js +563 -43
- package/src/commands/tasks/create-task.js +2 -2
- package/src/commands/tasks/task.js +162 -65
- package/src/commands/tasks/tasks.js +4 -3
- package/src/core/api-client.js +1 -1
- package/src/core/shell.js +339 -301
- package/src/core/websocket.js +17 -13
- package/src/events/notifications.js +3 -4
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "thinkncollab-shell",
|
|
3
|
-
"version": "0.0.
|
|
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
|
-
|
|
26
|
-
|
|
27
|
-
// Clear typing indicator
|
|
28
|
+
// Stop typing indicator if active
|
|
28
29
|
if (shell.isTyping) {
|
|
29
|
-
shell.
|
|
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
|
-
|
|
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(
|
|
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
|
}
|