@meet-ai/cli 0.0.32 → 0.0.33

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