@celljs/ta-channels 4.20.0 → 4.21.0

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/package.json +4 -4
  2. package/web/index.js +66 -51
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@celljs/ta-channels",
3
- "version": "4.20.0",
3
+ "version": "4.21.0",
4
4
  "description": "A pi package for Ta: agents with roles of their own and channels where the user, Ta and the agents talk; Ta builds the team for what the user wants",
5
5
  "keywords": [
6
6
  "pi-package"
@@ -27,9 +27,9 @@
27
27
  "watch": "tsc -b -w --preserveWatchOutput"
28
28
  },
29
29
  "devDependencies": {
30
- "@celljs/ta-protocol": "4.20.0",
31
- "@celljs/ta-relay": "4.20.0",
32
- "@celljs/ta-web": "4.20.0",
30
+ "@celljs/ta-protocol": "4.21.0",
31
+ "@celljs/ta-relay": "4.21.0",
32
+ "@celljs/ta-web": "4.21.0",
33
33
  "@types/react": "^19.3.0"
34
34
  },
35
35
  "publishConfig": {
package/web/index.js CHANGED
@@ -1413,8 +1413,9 @@ var JA = {
1413
1413
  noAgentsYet: "まだエージェントがありません",
1414
1414
  noAgentsYetHint: "+ で作成するか、Ta にチームを組ませて",
1415
1415
  partners: "仲間",
1416
- groupsSection: "グループチャット",
1416
+ groupsSection: "チャット",
1417
1417
  agentsSection: "エージェント",
1418
+ agentTag: "エージェント",
1418
1419
  noPartners: "まだ仲間がいません",
1419
1420
  noPartnersHint: "+ でエージェントやグループチャットを作るか、友だちを追加して",
1420
1421
  inviteFriends: "友だちを招待",
@@ -1655,8 +1656,9 @@ var ZH = {
1655
1656
  noAgentsYet: "还没有智能体",
1656
1657
  noAgentsYetHint: "点 + 新建,或让 Ta 组个团队",
1657
1658
  partners: "伙伴",
1658
- groupsSection: "群聊",
1659
+ groupsSection: "聊天",
1659
1660
  agentsSection: "智能体",
1661
+ agentTag: "智能体",
1660
1662
  noPartners: "还没有伙伴",
1661
1663
  noPartnersHint: "点 + 新建智能体或群聊,或加个好友",
1662
1664
  inviteFriends: "邀请好友",
@@ -1897,8 +1899,9 @@ var ZH_TW = {
1897
1899
  noAgentsYet: "還沒有智慧體",
1898
1900
  noAgentsYetHint: "點 + 新建,或讓 Ta 組個團隊",
1899
1901
  partners: "夥伴",
1900
- groupsSection: "群聊",
1902
+ groupsSection: "聊天",
1901
1903
  agentsSection: "智慧體",
1904
+ agentTag: "智慧體",
1902
1905
  noPartners: "還沒有夥伴",
1903
1906
  noPartnersHint: "點 + 新建智慧體或群聊,或加個好友",
1904
1907
  inviteFriends: "邀請好友",
@@ -2139,8 +2142,9 @@ var EN = {
2139
2142
  noAgentsYet: "No agents yet",
2140
2143
  noAgentsYetHint: "Create one with +, or ask Ta for a team",
2141
2144
  partners: "Partners",
2142
- groupsSection: "Group chats",
2145
+ groupsSection: "Chats",
2143
2146
  agentsSection: "Agents",
2147
+ agentTag: "Agent",
2144
2148
  noPartners: "No one to work with yet",
2145
2149
  noPartnersHint: "Create an agent or a group chat with +, or add a friend",
2146
2150
  inviteFriends: "Invite friends",
@@ -6480,6 +6484,53 @@ function AgentsSidebar({ context, partners = false }) {
6480
6484
  fresh > 0 ? ChannelWords.format(w.freshCount, { count: String(fresh) }) : "",
6481
6485
  running > 0 ? ChannelWords.format(w.runningCount, { count: String(running) }) : ""
6482
6486
  ].filter(Boolean).join(" · ");
6487
+ const agentRow = (agent, tag = false) => {
6488
+ const where = team.channels.find((channel) => working[channel.id]?.includes(agent.id));
6489
+ const cwd = agent.cwd ?? serverCwd;
6490
+ const last = lastLines?.get(agent.id);
6491
+ const line = lastLines ? last?.text ?? w.noMessages : "";
6492
+ const busy = !!where || answering.has(agent.id);
6493
+ const needsYou = asking.has(agent.id);
6494
+ const unseen = !busy && needsLook(agent.id);
6495
+ return /* @__PURE__ */ React.createElement(Row, {
6496
+ pi,
6497
+ key: agent.id,
6498
+ avatar: /* @__PURE__ */ React.createElement(AgentAvatar, {
6499
+ agent,
6500
+ faces,
6501
+ size: 40,
6502
+ working: busy
6503
+ }),
6504
+ title: agent.name,
6505
+ badge: /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(PinMark, {
6506
+ pi,
6507
+ pinned: agent.pinned
6508
+ }), tag && /* @__PURE__ */ React.createElement("span", {
6509
+ className: "tac-kind"
6510
+ }, w.agentTag)),
6511
+ place: /* @__PURE__ */ React.createElement(HostTag, {
6512
+ location: cwd
6513
+ }),
6514
+ preview: needsYou ? w.needsYou : where ? ChannelWords.format(w.answeringIn, { channel: where.name }) : line,
6515
+ live: busy && !needsYou,
6516
+ waiting: needsYou,
6517
+ fresh: unseen,
6518
+ dot: needsYou ? "ask" : busy ? "running" : unseen ? "attention" : undefined,
6519
+ time: lastLines ? SidebarUtil.time(last?.at ?? agent.createdAt, pi.ui.language) : "",
6520
+ hint: SidebarUtil.where(cwd),
6521
+ selected: agentSelected(agent),
6522
+ deleting: state.deleting.includes(agent.id),
6523
+ onSelect: () => openAgent(agent),
6524
+ more: /* @__PURE__ */ React.createElement(AgentMenu, {
6525
+ context,
6526
+ agent,
6527
+ cwd,
6528
+ working: !!where
6529
+ }),
6530
+ swipe: swipePinDelete(pi, !!agent.pinned, (pinned) => context.service.updateAgent(agent.id, { pinned }), () => deleteAgent(context, agent))
6531
+ });
6532
+ };
6533
+ const chatAgents = partners && lastLines ? agents.filter((agent) => lastLines.has(agent.id)) : [];
6483
6534
  return /* @__PURE__ */ React.createElement("div", {
6484
6535
  className: "tac-view"
6485
6536
  }, /* @__PURE__ */ React.createElement("div", {
@@ -6574,10 +6625,10 @@ function AgentsSidebar({ context, partners = false }) {
6574
6625
  type: "button",
6575
6626
  className: "tac-show-all",
6576
6627
  onClick: () => setAllEnded(!allEnded)
6577
- }, allEnded ? w.showFewer : ChannelWords.format(w.showAll, { count: String(groups.ended.length) }))), (channels.length > 0 || groupItems.length > 0) && /* @__PURE__ */ React.createElement(Section, {
6628
+ }, allEnded ? w.showFewer : ChannelWords.format(w.showAll, { count: String(groups.ended.length) }))), (channels.length > 0 || groupItems.length > 0 || chatAgents.length > 0) && /* @__PURE__ */ React.createElement(Section, {
6578
6629
  id: "channels",
6579
6630
  title: partners ? w.groupsSection : w.channelsSection,
6580
- count: channels.length + groupItems.length,
6631
+ count: channels.length + groupItems.length + chatAgents.length,
6581
6632
  folded,
6582
6633
  onFold: fold,
6583
6634
  alert: channels.some((channel) => unread.includes(channel.id)) || groupItems.some((item) => item.unseen)
@@ -6587,8 +6638,14 @@ function AgentsSidebar({ context, partners = false }) {
6587
6638
  pinned: !!channel.pinned,
6588
6639
  at: SidebarUtil.channelAt(channel, state.messages[channel.id])
6589
6640
  })),
6590
- ...groupItems.map((item) => ({ item, pinned: false, at: item.at ?? 0 }))
6641
+ ...groupItems.map((item) => ({ item, pinned: false, at: item.at ?? 0 })),
6642
+ ...chatAgents.map((agent) => ({ agent, pinned: !!agent.pinned, at: latest.get(agent.id) ?? agent.createdAt }))
6591
6643
  ], partners).map((entry) => {
6644
+ if ("agent" in entry) {
6645
+ return /* @__PURE__ */ React.createElement(React.Fragment, {
6646
+ key: `agent:${entry.agent.id}`
6647
+ }, agentRow(entry.agent, true));
6648
+ }
6592
6649
  if (!("channel" in entry)) {
6593
6650
  return /* @__PURE__ */ React.createElement(HomeRow, {
6594
6651
  key: entry.item.key,
@@ -6657,50 +6714,7 @@ function AgentsSidebar({ context, partners = false }) {
6657
6714
  size: 12
6658
6715
  }), /* @__PURE__ */ React.createElement("span", null, SidebarUtil.folder(group.cwd)), /* @__PURE__ */ React.createElement(HostTag, {
6659
6716
  location: group.cwd
6660
- })), group.agents.map((agent) => {
6661
- const where = team.channels.find((channel) => working[channel.id]?.includes(agent.id));
6662
- const cwd = agent.cwd ?? serverCwd;
6663
- const last = lastLines?.get(agent.id);
6664
- const line = lastLines ? last?.text ?? w.noMessages : "";
6665
- const busy = !!where || answering.has(agent.id);
6666
- const needsYou = asking.has(agent.id);
6667
- const unseen = !busy && needsLook(agent.id);
6668
- return /* @__PURE__ */ React.createElement(Row, {
6669
- pi,
6670
- key: agent.id,
6671
- avatar: /* @__PURE__ */ React.createElement(AgentAvatar, {
6672
- agent,
6673
- faces,
6674
- size: 40,
6675
- working: busy
6676
- }),
6677
- title: agent.name,
6678
- badge: /* @__PURE__ */ React.createElement(PinMark, {
6679
- pi,
6680
- pinned: agent.pinned
6681
- }),
6682
- place: /* @__PURE__ */ React.createElement(HostTag, {
6683
- location: cwd
6684
- }),
6685
- preview: needsYou ? w.needsYou : where ? ChannelWords.format(w.answeringIn, { channel: where.name }) : line,
6686
- live: busy && !needsYou,
6687
- waiting: needsYou,
6688
- fresh: unseen,
6689
- dot: needsYou ? "ask" : busy ? "running" : unseen ? "attention" : undefined,
6690
- time: lastLines ? SidebarUtil.time(last?.at ?? agent.createdAt, pi.ui.language) : "",
6691
- hint: SidebarUtil.where(cwd),
6692
- selected: agentSelected(agent),
6693
- deleting: state.deleting.includes(agent.id),
6694
- onSelect: () => openAgent(agent),
6695
- more: /* @__PURE__ */ React.createElement(AgentMenu, {
6696
- context,
6697
- agent,
6698
- cwd,
6699
- working: !!where
6700
- }),
6701
- swipe: swipePinDelete(pi, !!agent.pinned, (pinned) => context.service.updateAgent(agent.id, { pinned }), () => deleteAgent(context, agent))
6702
- });
6703
- })))), homeSections.map((section) => /* @__PURE__ */ React.createElement(Section, {
6717
+ })), group.agents.map((agent) => agentRow(agent))))), homeSections.map((section) => /* @__PURE__ */ React.createElement(Section, {
6704
6718
  key: section.id,
6705
6719
  id: section.id,
6706
6720
  title: section.title,
@@ -6831,6 +6845,7 @@ function SidebarHead({ context }) {
6831
6845
 
6832
6846
  // web-src/style.ts
6833
6847
  var STYLE = `
6848
+ .tac-kind { flex: none; margin-left: 6px; padding: 0 5px; border-radius: 4px; background: var(--ta-hover); color: var(--ta-muted); font-size: calc(10.5px * var(--ta-font-scale)); line-height: 16px; font-weight: 500; }
6834
6849
  .tac-view { display: flex; flex-direction: column; height: 100%; min-height: 0; color: var(--ta-text); font-size: calc(13px * var(--ta-font-scale)); }
6835
6850
  .tac-action { display: inline-flex; align-items: center; justify-content: center; width: 24px; height: 24px; flex: none; padding: 0; border: 0; border-radius: 6px; background: none; color: var(--ta-muted); cursor: pointer; }
6836
6851
  .tac-action:hover { background: var(--ta-hover); color: var(--ta-text); }