@meet-ai/cli 0.0.6 → 0.0.8
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 +61 -0
- package/package.json +23 -22
package/dist/index.js
CHANGED
|
@@ -185,6 +185,34 @@ function createClient(baseUrl, apiKey) {
|
|
|
185
185
|
}
|
|
186
186
|
return connect();
|
|
187
187
|
},
|
|
188
|
+
async sendLog(roomId, sender, content, color, messageId) {
|
|
189
|
+
return withRetry(async () => {
|
|
190
|
+
const res = await fetch(`${baseUrl}/api/rooms/${roomId}/logs`, {
|
|
191
|
+
method: "POST",
|
|
192
|
+
headers: headers(),
|
|
193
|
+
body: JSON.stringify({ sender, content, ...color && { color }, ...messageId && { message_id: messageId } })
|
|
194
|
+
});
|
|
195
|
+
if (!res.ok) {
|
|
196
|
+
const err = await res.json().catch(() => ({}));
|
|
197
|
+
throw new Error(err.error ?? `HTTP ${res.status}`);
|
|
198
|
+
}
|
|
199
|
+
return res.json();
|
|
200
|
+
});
|
|
201
|
+
},
|
|
202
|
+
async sendTeamInfo(roomId, payload) {
|
|
203
|
+
return withRetry(async () => {
|
|
204
|
+
const res = await fetch(`${baseUrl}/api/rooms/${roomId}/team-info`, {
|
|
205
|
+
method: "POST",
|
|
206
|
+
headers: headers(),
|
|
207
|
+
body: payload
|
|
208
|
+
});
|
|
209
|
+
if (!res.ok) {
|
|
210
|
+
const err = await res.json().catch(() => ({}));
|
|
211
|
+
throw new Error(err.error ?? `HTTP ${res.status}`);
|
|
212
|
+
}
|
|
213
|
+
return res.text();
|
|
214
|
+
});
|
|
215
|
+
},
|
|
188
216
|
async generateKey() {
|
|
189
217
|
const res = await fetch(`${baseUrl}/api/keys`, {
|
|
190
218
|
method: "POST",
|
|
@@ -379,6 +407,35 @@ switch (command) {
|
|
|
379
407
|
process.on("SIGTERM", shutdown);
|
|
380
408
|
break;
|
|
381
409
|
}
|
|
410
|
+
case "send-log": {
|
|
411
|
+
const { positional: slPos, flags: slFlags } = parseFlags(args);
|
|
412
|
+
const [slRoomId, slSender, ...slRest] = slPos;
|
|
413
|
+
const slContent = slRest.join(" ").replace(/\\n/g, `
|
|
414
|
+
`);
|
|
415
|
+
if (!slRoomId || !slSender || !slContent) {
|
|
416
|
+
console.error("Usage: cli send-log <roomId> <sender> <content> [--color <color>] [--message-id <id>]");
|
|
417
|
+
process.exit(1);
|
|
418
|
+
}
|
|
419
|
+
const log = await client.sendLog(slRoomId, slSender, slContent, slFlags.color, slFlags["message-id"]);
|
|
420
|
+
console.log(`Log sent: ${log.id}`);
|
|
421
|
+
break;
|
|
422
|
+
}
|
|
423
|
+
case "send-team-info": {
|
|
424
|
+
const [tiRoomId, tiPayload] = args;
|
|
425
|
+
if (!tiRoomId || !tiPayload) {
|
|
426
|
+
console.error("Usage: cli send-team-info <roomId> '<json-payload>'");
|
|
427
|
+
process.exit(1);
|
|
428
|
+
}
|
|
429
|
+
try {
|
|
430
|
+
JSON.parse(tiPayload);
|
|
431
|
+
} catch {
|
|
432
|
+
console.error("Error: payload must be valid JSON");
|
|
433
|
+
process.exit(1);
|
|
434
|
+
}
|
|
435
|
+
await client.sendTeamInfo(tiRoomId, tiPayload);
|
|
436
|
+
console.log("Team info sent");
|
|
437
|
+
break;
|
|
438
|
+
}
|
|
382
439
|
case "generate-key": {
|
|
383
440
|
const result = await client.generateKey();
|
|
384
441
|
console.log(`API Key: ${result.key}`);
|
|
@@ -396,6 +453,9 @@ Commands:
|
|
|
396
453
|
create-room <name> Create a new chat room
|
|
397
454
|
send-message <roomId> <sender> <content> Send a message to a room
|
|
398
455
|
--color <color> Set sender name color (e.g. #ff0000, red)
|
|
456
|
+
send-log <roomId> <sender> <content> Send a log entry to a room
|
|
457
|
+
--color <color> Set sender name color (e.g. #ff0000, red)
|
|
458
|
+
--message-id <id> Associate log with a parent message
|
|
399
459
|
poll <roomId> [options] Fetch messages from a room
|
|
400
460
|
--after <id> Only messages after this ID
|
|
401
461
|
--exclude <sender> Exclude messages from sender
|
|
@@ -405,5 +465,6 @@ Commands:
|
|
|
405
465
|
--sender-type <type> Filter by sender_type (human|agent)
|
|
406
466
|
--team <name> Write to Claude Code team inbox
|
|
407
467
|
--inbox <agent> Target agent inbox (requires --team)
|
|
468
|
+
send-team-info <roomId> '<json>' Send team info to a room
|
|
408
469
|
generate-key Generate a new API key`);
|
|
409
470
|
}
|
package/package.json
CHANGED
|
@@ -1,42 +1,43 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@meet-ai/cli",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.8",
|
|
4
4
|
"description": "CLI for meet-ai chat rooms — create rooms, send messages, and stream via WebSocket",
|
|
5
|
-
"
|
|
5
|
+
"keywords": [
|
|
6
|
+
"chat",
|
|
7
|
+
"cli",
|
|
8
|
+
"meet-ai",
|
|
9
|
+
"real-time",
|
|
10
|
+
"websocket"
|
|
11
|
+
],
|
|
12
|
+
"license": "MIT",
|
|
13
|
+
"repository": {
|
|
14
|
+
"type": "git",
|
|
15
|
+
"url": "https://github.com/SoftWare-A-G/meet-ai",
|
|
16
|
+
"directory": "packages/cli"
|
|
17
|
+
},
|
|
6
18
|
"bin": {
|
|
7
19
|
"meet-ai": "./dist/index.js"
|
|
8
20
|
},
|
|
21
|
+
"files": [
|
|
22
|
+
"dist"
|
|
23
|
+
],
|
|
24
|
+
"type": "module",
|
|
9
25
|
"main": "./dist/index.js",
|
|
10
26
|
"exports": {
|
|
11
27
|
".": "./dist/index.js"
|
|
12
28
|
},
|
|
13
|
-
"files": [
|
|
14
|
-
"dist"
|
|
15
|
-
],
|
|
16
29
|
"scripts": {
|
|
17
30
|
"start": "bun run src/index.ts",
|
|
18
31
|
"build": "bun build src/index.ts --outdir dist --target node --format esm",
|
|
19
32
|
"prepublishOnly": "bun run build",
|
|
20
|
-
"test": "bun test"
|
|
33
|
+
"test": "bun test",
|
|
34
|
+
"typecheck": "tsc --noEmit"
|
|
21
35
|
},
|
|
22
|
-
"
|
|
23
|
-
"
|
|
24
|
-
"
|
|
25
|
-
"chat",
|
|
26
|
-
"websocket",
|
|
27
|
-
"real-time"
|
|
28
|
-
],
|
|
29
|
-
"license": "MIT",
|
|
30
|
-
"repository": {
|
|
31
|
-
"type": "git",
|
|
32
|
-
"url": "https://github.com/SoftWare-A-G/meet-ai",
|
|
33
|
-
"directory": "packages/cli"
|
|
36
|
+
"devDependencies": {
|
|
37
|
+
"@types/node": "25.0.10",
|
|
38
|
+
"typescript": "5.9.3"
|
|
34
39
|
},
|
|
35
40
|
"engines": {
|
|
36
41
|
"node": ">=22"
|
|
37
|
-
},
|
|
38
|
-
"devDependencies": {
|
|
39
|
-
"@types/node": "^22.0.0",
|
|
40
|
-
"typescript": "5.9.3"
|
|
41
42
|
}
|
|
42
43
|
}
|