ac-teams 0.0.5 → 0.0.6

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ac-teams",
3
- "version": "0.0.5",
3
+ "version": "0.0.6",
4
4
  "description": "Small, persistent teams for Pi",
5
5
  "type": "module",
6
6
  "license": "MIT",
package/src/index.ts CHANGED
@@ -211,11 +211,6 @@ export default function teams(pi: ExtensionAPI) {
211
211
  await connection.open();
212
212
  await connection.request("join", { sessionId: ctx.sessionManager.getSessionId(), sessionFile: ctx.sessionManager.getSessionFile(), tools: pi.getAllTools().map(tool => tool.name), trusted: ctx.isProjectTrusted() });
213
213
  }
214
- if (ctx.mode === "tui") {
215
- try { Object.assign(display, readDisplaySettings()); }
216
- catch (error) { Object.assign(display, defaultDisplaySettings); warn(String(error)); }
217
- disposeUI?.(); disposeUI = installTeamFooter(pi, ctx, host(ctx), display);
218
- }
219
214
  startTelemetry(ctx);
220
215
  if (!warned) {
221
216
  warned = true;
@@ -223,6 +218,13 @@ export default function teams(pi: ExtensionAPI) {
223
218
  if (competitors.length) warn(`Other delegation tools are active (${competitors.map(tool => tool.name).join(", ")}). ac-teams limits do not cover them; disable competing launchers for a single team authority.`);
224
219
  }
225
220
  });
221
+ // CLI-loaded teammates run session_start before other extensions install their editors.
222
+ pi.on("resources_discover", (_event, ctx) => {
223
+ if (ctx.mode !== "tui") return;
224
+ try { Object.assign(display, readDisplaySettings()); }
225
+ catch (error) { Object.assign(display, defaultDisplaySettings); warn(String(error)); }
226
+ disposeUI?.(); disposeUI = installTeamFooter(pi, ctx, host(ctx), display);
227
+ });
226
228
  pi.on("session_shutdown", close);
227
229
  const switchGuard = () => {
228
230
  if (child || coordinator?.live().length) {
@@ -94,7 +94,7 @@ export function installTeamFooter(_pi: ExtensionAPI, ctx: ExtensionContext, host
94
94
  }
95
95
  const next = await host.snapshot();
96
96
  if (disposed) return;
97
- members = next.members; tasks = next.tasks;
97
+ members = next.members.filter(isLive); tasks = next.tasks;
98
98
  const count = ids().length;
99
99
  ctx.ui.setStatus("ac-teams", `Teams ${[
100
100
  ...(display.agents ? [`${count} ${count === 1 ? "agent" : "agents"}`, `${members.filter(member => member.status === "busy").length} working`] : []),
@@ -126,14 +126,15 @@ export function installTeamFooter(_pi: ExtensionAPI, ctx: ExtensionContext, host
126
126
  const titleRow = theme.fg(color, `${selected === id ? ">" : " "} ${host.self === id ? "●" : "○"} ${cleanText(title).replaceAll("\n", " ")}`);
127
127
  const attention = member?.needsInput ? theme.fg("error", " · Needs input") : "";
128
128
  const description = ` ${id === "root" ? "" : status + " · "}${modelContext(metrics)}${assigned ? ` · ${taskName(assigned)}` : ""}${member?.error || member?.activity ? ` · ${member.error || member.activity}` : ""}`;
129
- return titleRow + attention + theme.fg(color, cleanText(description).replaceAll("\n", " "));
129
+ const shortcut = id === "root" && host.self !== "root" ? theme.fg("dim", " [Ctrl+Shift+Left]") : "";
130
+ return titleRow + shortcut + attention + theme.fg(color, cleanText(description).replaceAll("\n", " "));
130
131
  };
131
132
  const peers = ids().slice(1);
132
133
  return [
133
- ...(host.self !== "root" ? [theme.fg("dim", "Ctrl+Shift+Left: Main (keeps questions open)")] : []),
134
134
  ...(display.agents ? [row("root"), ...peers.slice(start, start + slots()).map(row),
135
- ...(peers.length > 4 ? [theme.fg("dim", ` ↑ ${start} above · ↓ ${Math.max(0, peers.length - start - slots())} below`)] : [])] : []),
136
- ].map(line => truncateToWidth(line, width));
135
+ ...(peers.length > 4 ? [theme.fg("dim", ` ↑ ${start} above · ↓ ${Math.max(0, peers.length - start - slots())} below`)] : [])] :
136
+ host.self !== "root" ? [row("root")] : []),
137
+ ].map(line => truncateToWidth(line, width, "..."));
137
138
  },
138
139
  invalidate() {},
139
140
  };