@meet-ai/cli 0.0.32 → 0.0.34

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.
Files changed (2) hide show
  1. package/dist/index.js +58 -8
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -15736,6 +15736,7 @@ function listen(client, input) {
15736
15736
  }
15737
15737
  process.on("SIGINT", shutdown);
15738
15738
  process.on("SIGTERM", shutdown);
15739
+ process.on("SIGHUP", shutdown);
15739
15740
  return ws;
15740
15741
  }
15741
15742
  var init_usecase6 = __esm(() => {
@@ -16076,7 +16077,7 @@ function registerSession(filePath, data, sessionId) {
16076
16077
  writeFileSync2(filePath, JSON.stringify(data));
16077
16078
  } catch {}
16078
16079
  }
16079
- async function findRoomId(sessionId, teamsDir, transcriptPath) {
16080
+ async function findRoom(sessionId, teamsDir, transcriptPath) {
16080
16081
  const dir = teamsDir ?? `${process.env.HOME}/.claude/teams`;
16081
16082
  if (transcriptPath) {
16082
16083
  const teamName = await extractTeamName(transcriptPath);
@@ -16086,7 +16087,8 @@ async function findRoomId(sessionId, teamsDir, transcriptPath) {
16086
16087
  const raw = readFileSync3(filePath, "utf-8");
16087
16088
  const data = JSON.parse(raw);
16088
16089
  registerSession(filePath, data, sessionId);
16089
- return data.room_id || null;
16090
+ if (data.room_id)
16091
+ return { roomId: data.room_id, teamName: data.team_name || teamName };
16090
16092
  } catch {}
16091
16093
  }
16092
16094
  }
@@ -16103,7 +16105,9 @@ async function findRoomId(sessionId, teamsDir, transcriptPath) {
16103
16105
  const data = JSON.parse(raw);
16104
16106
  const knownIds = data.session_ids ?? [data.session_id];
16105
16107
  if (knownIds.includes(sessionId) || data.session_id === sessionId) {
16106
- return data.room_id || null;
16108
+ if (data.room_id)
16109
+ return { roomId: data.room_id, teamName: data.team_name || entry };
16110
+ return null;
16107
16111
  }
16108
16112
  } catch {
16109
16113
  continue;
@@ -16111,6 +16115,10 @@ async function findRoomId(sessionId, teamsDir, transcriptPath) {
16111
16115
  }
16112
16116
  return null;
16113
16117
  }
16118
+ async function findRoomId(sessionId, teamsDir, transcriptPath) {
16119
+ const result = await findRoom(sessionId, teamsDir, transcriptPath);
16120
+ return result?.roomId ?? null;
16121
+ }
16114
16122
  var init_find_room = () => {};
16115
16123
 
16116
16124
  // src/lib/hooks/summarize.ts
@@ -16512,6 +16520,14 @@ async function sendParentMessage(client, roomId) {
16512
16520
  return null;
16513
16521
  }
16514
16522
  }
16523
+ async function sendTeamMemberUpsert(client, roomId, teamName, member) {
16524
+ try {
16525
+ await client.api.rooms[":id"]["team-info"].members.$patch({
16526
+ param: { id: roomId },
16527
+ json: { team_name: teamName, member }
16528
+ });
16529
+ } catch {}
16530
+ }
16515
16531
  async function sendLogEntry(client, roomId, summary, messageId) {
16516
16532
  try {
16517
16533
  await client.api.rooms[":id"].logs.$post({
@@ -16573,21 +16589,55 @@ async function processHookInput(rawInput, teamsDir) {
16573
16589
  } = input;
16574
16590
  if (!sessionId || !toolName)
16575
16591
  return "skip";
16576
- if (toolName === "SendMessage")
16577
- return "skip";
16578
16592
  if (toolName === "Bash") {
16579
16593
  const cmd = typeof toolInput.command === "string" ? toolInput.command : "";
16580
16594
  if (cmd.startsWith("cd ") || cmd.startsWith("meet-ai "))
16581
16595
  return "skip";
16582
16596
  }
16583
- const roomId = await findRoomId(sessionId, teamsDir, transcriptPath);
16584
- if (!roomId)
16597
+ const room = await findRoom(sessionId, teamsDir, transcriptPath);
16598
+ if (!room)
16585
16599
  return "skip";
16600
+ const { roomId, teamName } = room;
16586
16601
  const url2 = process.env.MEET_AI_URL;
16587
16602
  const key = process.env.MEET_AI_KEY;
16588
16603
  if (!url2 || !key)
16589
16604
  return "skip";
16590
16605
  const client = createHookClient(url2, key);
16606
+ if (toolName === "Agent" && toolResponse) {
16607
+ const status = toolResponse.status;
16608
+ if (status === "teammate_spawned") {
16609
+ await sendTeamMemberUpsert(client, roomId, toolResponse.team_name, {
16610
+ teammate_id: toolResponse.teammate_id,
16611
+ name: toolResponse.name,
16612
+ color: toolResponse.color,
16613
+ role: toolResponse.agent_type || "teammate",
16614
+ model: toolResponse.model || "unknown",
16615
+ status: "active",
16616
+ joinedAt: Date.now()
16617
+ });
16618
+ }
16619
+ }
16620
+ if (toolName === "SendMessage") {
16621
+ const inputType = toolInput.type;
16622
+ const approve = toolInput.approve;
16623
+ if (inputType === "shutdown_response" && approve === true) {
16624
+ const requestId = toolInput.request_id;
16625
+ const agentName = requestId?.split("@")[1];
16626
+ if (agentName) {
16627
+ const teammateId = teamName ? `${agentName}@${teamName}` : agentName;
16628
+ await sendTeamMemberUpsert(client, roomId, teamName, {
16629
+ teammate_id: teammateId,
16630
+ name: agentName,
16631
+ color: "#555",
16632
+ role: "teammate",
16633
+ model: "unknown",
16634
+ status: "inactive",
16635
+ joinedAt: 0
16636
+ });
16637
+ }
16638
+ }
16639
+ return "skip";
16640
+ }
16591
16641
  if (toolName === "Edit" && toolResponse?.structuredPatch) {
16592
16642
  const hunks = toolResponse.structuredPatch;
16593
16643
  const filePath = typeof toolInput.file_path === "string" ? toolInput.file_path : "?";
@@ -56559,7 +56609,7 @@ init_output();
56559
56609
  var main = defineCommand({
56560
56610
  meta: {
56561
56611
  name: "meet-ai",
56562
- version: "0.0.32",
56612
+ version: "0.0.34",
56563
56613
  description: "CLI for meet-ai chat rooms — create rooms, send messages, and stream via WebSocket"
56564
56614
  },
56565
56615
  args: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@meet-ai/cli",
3
- "version": "0.0.32",
3
+ "version": "0.0.34",
4
4
  "description": "CLI for meet-ai chat rooms — create rooms, send messages, and stream via WebSocket",
5
5
  "keywords": [
6
6
  "chat",