@giladbarnea/pi-simple-team 2.0.23 → 2.0.24
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/README.md +5 -1
- package/index.ts +171 -33
- package/package.json +1 -1
- package/team-selection.ts +1 -1
package/README.md
CHANGED
|
@@ -221,7 +221,7 @@ Kept minimal:
|
|
|
221
221
|
| | With team | `team_send_message` |
|
|
222
222
|
| | On team | `team_status`, `team_log` |
|
|
223
223
|
| | On everyone | `get_context_window_usage` |
|
|
224
|
-
| | On self | `schedule_reminder` |
|
|
224
|
+
| | On self | `schedule_reminder`, `list_reminders`, `cancel_reminders` |
|
|
225
225
|
| **Managing teammate** | On self and own teams | Same tools as the main agent |
|
|
226
226
|
| | With parent team | `team_send_message`, `team_status`, `send_main_message` |
|
|
227
227
|
| **Teammates** | With team | `team_send_message` |
|
|
@@ -239,6 +239,10 @@ Existing teammates can be selected by name or Pi session ID in the same input fi
|
|
|
239
239
|
|
|
240
240
|
`team_update_teammates` changes a live teammate's model, thinking level or extensions in its own conversation. An idle teammate restarts at once, in its pane if it has one; a busy one keeps working and is updated when its run settles, or at once with `interrupt: true`. A managing teammate is never held: while it or any of its own teammates works, the call fails and tells main to ask it to soft-pause them, and the same call succeeds once they are idle. The restarted teammate gets a message with its new settings and the teams its restart stopped, so it can resume them. Main gets a message when a held update applies; `team_shutdown` lists any it drops. `team_resume` takes the same changes in `teammateUpdates` for the teammates it resumes. Instructions and `forkContext` stay as created.
|
|
241
241
|
|
|
242
|
+
`team_list` shows active teams as short rows, newest created first, 20 per page by default (`limit` up to 100, then `cursor`). Pass `includeDormantTeams: true` to include dormant teams, or `team` for one team's full records. Pages follow creation order, so a team that changes state or activity between pages is neither repeated nor skipped.
|
|
243
|
+
|
|
244
|
+
`list_reminders` shows this session's pending reminders with their IDs, slugs and times. `cancel_reminders` cancels reminders by ID or slug, or every pending one with `all: true`; a call with neither cancels nothing.
|
|
245
|
+
|
|
242
246
|
Spawn, resume, and add return the complete roster. Results distinguish a live runtime from active work, including work that was already underway before the call.
|
|
243
247
|
|
|
244
248
|
Set `showOnHerdrPane: true` on individual teammates to open their panes. An explicit `showOnHerdrPanes` value on spawn overrides all individual settings.
|
package/index.ts
CHANGED
|
@@ -149,6 +149,46 @@ function toolResult(payload: JsonRecord, viewDetails: JsonRecord = {}) {
|
|
|
149
149
|
};
|
|
150
150
|
}
|
|
151
151
|
|
|
152
|
+
const defaultTeamListLimit = 20;
|
|
153
|
+
|
|
154
|
+
/** A team_list position: a team's place in creation order, which no state change or activity moves, so paging neither skips nor repeats a team. */
|
|
155
|
+
interface TeamListCursor {
|
|
156
|
+
createdAt: string;
|
|
157
|
+
id: string;
|
|
158
|
+
includeDormantTeams: boolean;
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
/** @example newestCreatedFirst({ createdAt: "2026-01-02", id: "b" }, { createdAt: "2026-01-01", id: "a" }) < 0 // true */
|
|
162
|
+
function newestCreatedFirst(first: { createdAt: string; id: string }, second: { createdAt: string; id: string }): number {
|
|
163
|
+
return second.createdAt.localeCompare(first.createdAt) || second.id.localeCompare(first.id);
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
/** @example decodeTeamListCursor(encodeTeamListCursor({ createdAt: "t", id: "a", includeDormantTeams: false })).id // "a" */
|
|
167
|
+
function encodeTeamListCursor(cursor: TeamListCursor): string {
|
|
168
|
+
return Buffer.from(JSON.stringify(cursor)).toString("base64url");
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
function decodeTeamListCursor(cursor: string): TeamListCursor {
|
|
172
|
+
let decoded: Partial<TeamListCursor>;
|
|
173
|
+
try {
|
|
174
|
+
decoded = JSON.parse(Buffer.from(cursor, "base64url").toString("utf8")) as Partial<TeamListCursor>;
|
|
175
|
+
} catch {
|
|
176
|
+
decoded = {};
|
|
177
|
+
}
|
|
178
|
+
if (typeof decoded.createdAt !== "string" || typeof decoded.id !== "string" || typeof decoded.includeDormantTeams !== "boolean") throw new Error("Invalid team_list cursor. Pass nextCursor from the previous team_list result.");
|
|
179
|
+
return decoded as TeamListCursor;
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
interface Reminder {
|
|
183
|
+
id: string;
|
|
184
|
+
slug: string;
|
|
185
|
+
message: string;
|
|
186
|
+
armedAt: Date;
|
|
187
|
+
wakeAt: Date;
|
|
188
|
+
timer: ReturnType<typeof setTimeout>;
|
|
189
|
+
state: "pending" | "delivered" | "cancelled";
|
|
190
|
+
}
|
|
191
|
+
|
|
152
192
|
const reminderSlugWords = {
|
|
153
193
|
adjectives: ["amber", "brisk", "calm", "clever", "dusty", "eager", "fuzzy", "gentle", "golden", "hollow", "jolly", "lively", "mellow", "misty", "nimble", "plucky", "quiet", "rapid", "rusty", "silver", "steady", "sunny", "swift", "witty"],
|
|
154
194
|
nouns: ["badger", "beacon", "cedar", "comet", "falcon", "fern", "harbor", "heron", "lantern", "maple", "meadow", "otter", "pebble", "pine", "quail", "raven", "river", "robin", "sparrow", "spruce", "thistle", "tulip", "walrus", "willow"],
|
|
@@ -229,6 +269,33 @@ function lifecycleInstruction(startIdle: boolean): string {
|
|
|
229
269
|
return nextAction;
|
|
230
270
|
}
|
|
231
271
|
|
|
272
|
+
/** A listed team's full records: the saved definitions, with live runtime values for a team this process runs. */
|
|
273
|
+
function fullTeamListRow(manifest: TeamManifest): JsonRecord {
|
|
274
|
+
const liveTeam = teams.get(manifest.id);
|
|
275
|
+
return {
|
|
276
|
+
...teamIdentity(manifest),
|
|
277
|
+
state: manifest.state,
|
|
278
|
+
leaseState: readTeamLeaseState(manifest.id).state,
|
|
279
|
+
teammates: manifest.members.map(({ sessionMaterialized, ...member }) => {
|
|
280
|
+
const runtime = liveTeam?.members.get(member.name);
|
|
281
|
+
return runtime ? teammateRecord(runtime) : member;
|
|
282
|
+
}),
|
|
283
|
+
createdAt: manifest.createdAt,
|
|
284
|
+
updatedAt: manifest.updatedAt,
|
|
285
|
+
shutdownAt: manifest.shutdownAt,
|
|
286
|
+
expiresAt: manifest.expiresAt,
|
|
287
|
+
};
|
|
288
|
+
}
|
|
289
|
+
|
|
290
|
+
/** The short row team_list shows the model by default: the team, its state, and each teammate's identity, model and liveness, without prompts or settings. */
|
|
291
|
+
function compactTeamListRow(manifest: TeamManifest): JsonRecord {
|
|
292
|
+
const full = fullTeamListRow(manifest);
|
|
293
|
+
return {
|
|
294
|
+
teamName: full.teamName, teamId: full.teamId, state: full.state,
|
|
295
|
+
teammates: (full.teammates as TeammateRecord[]).map(({ name, teammateId, model, live, active }) => ({ name, teammateId, model, live, active })),
|
|
296
|
+
};
|
|
297
|
+
}
|
|
298
|
+
|
|
232
299
|
/** @example lifecycleResult(emptyTeam).started // false */
|
|
233
300
|
function lifecycleResult(team: TeamState): JsonRecord {
|
|
234
301
|
const teammates = [...team.members.values()].map(teammateRecord);
|
|
@@ -485,7 +552,7 @@ function resolveTeam(owner: symbol, teamIdentifier?: string): TeamState {
|
|
|
485
552
|
const ownedTeams = [...teams.values()].filter((team) => team.owner === owner);
|
|
486
553
|
if (teamIdentifier) {
|
|
487
554
|
const team = resolveTeamIdentifier(ownedTeams, teamIdentifier);
|
|
488
|
-
if (!team) throw new Error(`Unknown team: ${JSON.stringify(teamIdentifier)}. Available owned team IDs by name: ${JSON.stringify(teamChoices(ownedTeams))}. Use team_list to find dormant teams, or pass an owned active team name or ID in the team parameter.`);
|
|
555
|
+
if (!team) throw new Error(`Unknown team: ${JSON.stringify(teamIdentifier)}. Available owned team IDs by name: ${JSON.stringify(teamChoices(ownedTeams))}. Use team_list with includeDormantTeams: true to find dormant teams, or pass an owned active team name or ID in the team parameter.`);
|
|
489
556
|
return team;
|
|
490
557
|
}
|
|
491
558
|
|
|
@@ -754,13 +821,19 @@ function restartWithSettings(team: TeamState, teammate: TeammateState, update: T
|
|
|
754
821
|
});
|
|
755
822
|
}
|
|
756
823
|
|
|
824
|
+
/** Whether a living process of this session holds the team's lease. Another main that resumed the team holds it under its own session. */
|
|
825
|
+
function isLeaseHeldBy(teamId: string, sessionId: string | undefined): boolean {
|
|
826
|
+
const lease = readTeamLeaseState(teamId);
|
|
827
|
+
return lease.state === "claimed" && lease.mainSessionId === sessionId;
|
|
828
|
+
}
|
|
829
|
+
|
|
757
830
|
/**
|
|
758
831
|
* A managing teammate's running teams, which a restart would stop: its shutdown stops every team it owns.
|
|
759
|
-
* A running team's manifest is active and
|
|
832
|
+
* A running team's manifest is active and a living process of the manager's own session holds its lease. A manager that died abruptly leaves its manifests active behind a stale lease, and a team another main resumed is that main's, so neither counts.
|
|
760
833
|
*/
|
|
761
834
|
function activeManagedTeams(team: TeamState, teammate: TeammateState): TeamManifest[] {
|
|
762
835
|
if (!teammate.canManageOwnTeams || !team.projectDirectory) return [];
|
|
763
|
-
return listTeamManifests(team.projectDirectory).manifests.filter((manifest) => manifest.originMainSessionId === teammate.sessionId && manifest.state === "active" &&
|
|
836
|
+
return listTeamManifests(team.projectDirectory).manifests.filter((manifest) => manifest.originMainSessionId === teammate.sessionId && manifest.state === "active" && isLeaseHeldBy(manifest.id, teammate.sessionId));
|
|
764
837
|
}
|
|
765
838
|
|
|
766
839
|
/** The managing teammate's own teammates that are working, as their teams' manifests record them, named for main. */
|
|
@@ -1328,7 +1401,9 @@ export default function (pi: ExtensionAPI) {
|
|
|
1328
1401
|
|
|
1329
1402
|
const parentPiCommand = piCommand(process.argv[1], process.execPath, getPackageDir());
|
|
1330
1403
|
const owner = Symbol("pi-simple-team-owner");
|
|
1331
|
-
|
|
1404
|
+
/** This session's reminders by ID. They live in memory, so after Pi restarts every earlier reminder is unknown. */
|
|
1405
|
+
const reminders = new Map<string, Reminder>();
|
|
1406
|
+
let reminderCount = 0;
|
|
1332
1407
|
const sessionTeammateRoster = childRuntimeConfig?.participants ?? [];
|
|
1333
1408
|
|
|
1334
1409
|
/** Current-project manifests that team_resume can select: all for main, only its own for a managing teammate. */
|
|
@@ -1362,8 +1437,8 @@ export default function (pi: ExtensionAPI) {
|
|
|
1362
1437
|
});
|
|
1363
1438
|
|
|
1364
1439
|
pi.on("session_shutdown", async () => {
|
|
1365
|
-
for (const
|
|
1366
|
-
|
|
1440
|
+
for (const reminder of reminders.values()) clearTimeout(reminder.timer);
|
|
1441
|
+
reminders.clear();
|
|
1367
1442
|
const ownedTeams = [...teams.values()].filter((team) => team.owner === owner);
|
|
1368
1443
|
for (const team of ownedTeams) team.stopping = true;
|
|
1369
1444
|
for (const team of ownedTeams) await shutdownTeam(team);
|
|
@@ -1503,15 +1578,18 @@ export default function (pi: ExtensionAPI) {
|
|
|
1503
1578
|
const delaySeconds = Math.round(delayMilliseconds / 1000);
|
|
1504
1579
|
const armedAt = new Date();
|
|
1505
1580
|
const wakeAt = new Date(armedAt.getTime() + delayMilliseconds);
|
|
1506
|
-
const
|
|
1581
|
+
const pendingSlugs = new Set([...reminders.values()].filter((reminder) => reminder.state === "pending").map((reminder) => reminder.slug));
|
|
1582
|
+
let slug = reminderSlug();
|
|
1583
|
+
while (pendingSlugs.has(slug)) slug = reminderSlug();
|
|
1584
|
+
const id = `reminder-${++reminderCount}`;
|
|
1507
1585
|
const timer = setTimeout(() => {
|
|
1508
|
-
|
|
1586
|
+
reminders.get(id)!.state = "delivered";
|
|
1509
1587
|
pi.sendMessage(
|
|
1510
1588
|
{ customType: "pi-simple-team-reminder", content: `Reminder ${slug} wake up: it's ${humanTime(new Date())} now.\n\n${params.message}`, display: false },
|
|
1511
1589
|
{ deliverAs: "followUp", triggerTurn: true },
|
|
1512
1590
|
);
|
|
1513
1591
|
}, delayMilliseconds);
|
|
1514
|
-
|
|
1592
|
+
reminders.set(id, { id, slug, message: params.message, armedAt, wakeAt, timer, state: "pending" });
|
|
1515
1593
|
timer.unref();
|
|
1516
1594
|
return {
|
|
1517
1595
|
content: [{ type: "text" as const, text: `Armed reminder ${slug}: It's ${humanTime(armedAt)} now. Reminder set in ${delaySeconds} seconds (${humanDuration(delaySeconds)}) for ${humanTime(wakeAt)}.` }],
|
|
@@ -1521,19 +1599,75 @@ export default function (pi: ExtensionAPI) {
|
|
|
1521
1599
|
}),
|
|
1522
1600
|
);
|
|
1523
1601
|
|
|
1602
|
+
pi.registerTool(
|
|
1603
|
+
defineTool({
|
|
1604
|
+
name: "list_reminders",
|
|
1605
|
+
label: "List Reminders",
|
|
1606
|
+
description: "List your pending reminders in this session: ID, slug, and when each was armed and wakes, in absolute and relative time. Delivered and cancelled reminders are left out.",
|
|
1607
|
+
parameters: Type.Object({}, { additionalProperties: false }),
|
|
1608
|
+
async execute() {
|
|
1609
|
+
const now = Date.now();
|
|
1610
|
+
const pending = [...reminders.values()].filter((reminder) => reminder.state === "pending").sort((first, second) => first.wakeAt.getTime() - second.wakeAt.getTime());
|
|
1611
|
+
return toolResult({
|
|
1612
|
+
now: humanTime(new Date(now)),
|
|
1613
|
+
reminders: pending.map((reminder) => ({
|
|
1614
|
+
id: reminder.id, slug: reminder.slug,
|
|
1615
|
+
armedAt: `${humanTime(reminder.armedAt)} (${humanDuration(Math.round((now - reminder.armedAt.getTime()) / 1000))} ago)`,
|
|
1616
|
+
wakeAt: `${humanTime(reminder.wakeAt)} (in ${humanDuration(Math.max(0, Math.round((reminder.wakeAt.getTime() - now) / 1000)))})`,
|
|
1617
|
+
})),
|
|
1618
|
+
});
|
|
1619
|
+
},
|
|
1620
|
+
}),
|
|
1621
|
+
);
|
|
1622
|
+
|
|
1623
|
+
pi.registerTool(
|
|
1624
|
+
defineTool({
|
|
1625
|
+
name: "cancel_reminders",
|
|
1626
|
+
label: "Cancel Reminders",
|
|
1627
|
+
description: "Cancel your pending reminders in this session, by ID or slug, or all of them with all: true. Each result says cancelled, delivered or unknown; a cancelled one returns its message and wake time, so you can set it again with schedule_reminder.",
|
|
1628
|
+
parameters: Type.Object({
|
|
1629
|
+
reminders: Type.Optional(Type.Array(Type.String({ minLength: 1 }), { minItems: 1, description: "Reminder IDs or slugs to cancel" })),
|
|
1630
|
+
all: Type.Optional(Type.Boolean({ description: "Cancel every pending reminder. Leaving out reminders without all: true cancels nothing." })),
|
|
1631
|
+
}, { additionalProperties: false }),
|
|
1632
|
+
async execute(_toolCallId, params) {
|
|
1633
|
+
if (params.reminders && params.all) throw new Error("Pass either reminders or all: true to cancel_reminders, not both. Nothing was cancelled.");
|
|
1634
|
+
if (!params.reminders && params.all !== true) throw new Error("Pass the reminder IDs or slugs to cancel, or all: true to cancel every pending reminder. Nothing was cancelled.");
|
|
1635
|
+
const cancel = (reminder: Reminder): JsonRecord => {
|
|
1636
|
+
if (reminder.state === "pending") {
|
|
1637
|
+
clearTimeout(reminder.timer);
|
|
1638
|
+
reminder.state = "cancelled";
|
|
1639
|
+
}
|
|
1640
|
+
return { id: reminder.id, slug: reminder.slug, result: reminder.state, ...(reminder.state === "cancelled" ? { message: reminder.message, wakeAt: humanTime(reminder.wakeAt) } : {}) };
|
|
1641
|
+
};
|
|
1642
|
+
const results = params.reminders
|
|
1643
|
+
? params.reminders.map((identifier) => {
|
|
1644
|
+
const matches = [...reminders.values()].filter((reminder) => reminder.id === identifier || reminder.slug === identifier);
|
|
1645
|
+
const reminder = matches.find((candidate) => candidate.state === "pending") ?? matches.at(-1);
|
|
1646
|
+
return reminder ? { reminder: identifier, ...cancel(reminder) } : { reminder: identifier, result: "unknown" };
|
|
1647
|
+
})
|
|
1648
|
+
: [...reminders.values()].filter((reminder) => reminder.state === "pending").map(cancel);
|
|
1649
|
+
return toolResult({ results });
|
|
1650
|
+
},
|
|
1651
|
+
}),
|
|
1652
|
+
);
|
|
1653
|
+
|
|
1524
1654
|
pi.registerTool(
|
|
1525
1655
|
defineTool({
|
|
1526
1656
|
name: "team_list",
|
|
1527
|
-
// TODO: Make listing dormant teams opt-in with includeDormantTeams: boolean.
|
|
1528
1657
|
label: "Team List",
|
|
1529
1658
|
description: childRuntimeConfig
|
|
1530
|
-
? "List active
|
|
1531
|
-
: "List active
|
|
1659
|
+
? "List the active teams in the current project that this managing teammate's Pi session created, newest first, as short rows. Pass includeDormantTeams to include dormant teams, or team for one team's full records."
|
|
1660
|
+
: "List the active teams in the current project, newest first, as short rows. Pass includeDormantTeams to include dormant teams, or team for one team's full records.",
|
|
1532
1661
|
renderShell: "self",
|
|
1533
1662
|
renderCall: (_args, theme, context) => renderTeamToolCall("team_list", {}, theme, context, sessionTeammateRoster),
|
|
1534
1663
|
renderResult: (result, options, theme, context) => renderTeamToolResult("team_list", result, options, theme, context, undefined, sessionTeammateRoster),
|
|
1535
|
-
parameters: Type.Object({
|
|
1536
|
-
|
|
1664
|
+
parameters: Type.Object({
|
|
1665
|
+
team: Type.Optional(Type.String({ minLength: 1, description: "Team name or persistent ID. Returns that team's full records, active or dormant, without paging." })),
|
|
1666
|
+
includeDormantTeams: Type.Optional(Type.Boolean({ default: false, description: "Also list dormant teams. Defaults to false: active teams only." })),
|
|
1667
|
+
limit: Type.Optional(Type.Integer({ minimum: 1, maximum: 100, description: "Max teams to return, default 20, maximum 100" })),
|
|
1668
|
+
cursor: Type.Optional(Type.String({ description: "nextCursor from the previous team_list result. Keep the same includeDormantTeams when paging." })),
|
|
1669
|
+
}, { additionalProperties: false }),
|
|
1670
|
+
async execute(_toolCallId, params, _signal, _onUpdate, context) {
|
|
1537
1671
|
const projectDirectory = context.sessionManager?.getCwd?.() ?? context.cwd;
|
|
1538
1672
|
if (!projectDirectory) throw new Error("team_list requires a project directory");
|
|
1539
1673
|
const managerSessionId = childRuntimeConfig ? context.sessionManager?.getSessionId?.() : undefined;
|
|
@@ -1542,25 +1676,29 @@ export default function (pi: ExtensionAPI) {
|
|
|
1542
1676
|
const manifests = listing.manifests.filter(
|
|
1543
1677
|
(manifest) => !managerSessionId || manifest.originMainSessionId === managerSessionId,
|
|
1544
1678
|
);
|
|
1679
|
+
const unreadable = listing.unreadable.length > 0 ? { unreadableManifests: listing.unreadable } : {};
|
|
1680
|
+
if (params.team) {
|
|
1681
|
+
if (params.cursor) throw new Error("Pass either team or cursor to team_list, not both.");
|
|
1682
|
+
const manifest = resolveTeamIdentifier(manifests, params.team);
|
|
1683
|
+
if (!manifest) throw new Error(`Unknown current-project team: ${JSON.stringify(params.team)}. Call team_list with includeDormantTeams: true to see every team.`);
|
|
1684
|
+
return toolResult({ ...unreadable, teams: [fullTeamListRow(manifest)] });
|
|
1685
|
+
}
|
|
1686
|
+
const includeDormantTeams = Boolean(params.includeDormantTeams);
|
|
1687
|
+
const after = params.cursor === undefined ? undefined : decodeTeamListCursor(params.cursor);
|
|
1688
|
+
if (after && after.includeDormantTeams !== includeDormantTeams) throw new Error("Keep the same includeDormantTeams when paging team_list with cursor.");
|
|
1689
|
+
const listed = manifests
|
|
1690
|
+
.filter((manifest) => includeDormantTeams || manifest.state === "active")
|
|
1691
|
+
.sort(newestCreatedFirst)
|
|
1692
|
+
.filter((manifest) => !after || newestCreatedFirst(manifest, after) > 0);
|
|
1693
|
+
const page = listed.slice(0, params.limit ?? defaultTeamListLimit);
|
|
1694
|
+
const last = page.at(-1);
|
|
1695
|
+
const hiddenDormantTeams = includeDormantTeams ? 0 : manifests.filter((manifest) => manifest.state === "dormant").length;
|
|
1545
1696
|
return toolResult({
|
|
1546
|
-
...
|
|
1547
|
-
teams:
|
|
1548
|
-
|
|
1549
|
-
|
|
1550
|
-
|
|
1551
|
-
state: manifest.state,
|
|
1552
|
-
leaseState: readTeamLeaseState(manifest.id).state,
|
|
1553
|
-
teammates: manifest.members.map(({ sessionMaterialized, ...member }) => {
|
|
1554
|
-
const runtime = liveTeam?.members.get(member.name);
|
|
1555
|
-
return runtime ? teammateRecord(runtime) : member;
|
|
1556
|
-
}),
|
|
1557
|
-
createdAt: manifest.createdAt,
|
|
1558
|
-
updatedAt: manifest.updatedAt,
|
|
1559
|
-
shutdownAt: manifest.shutdownAt,
|
|
1560
|
-
expiresAt: manifest.expiresAt,
|
|
1561
|
-
};
|
|
1562
|
-
}),
|
|
1563
|
-
});
|
|
1697
|
+
...unreadable,
|
|
1698
|
+
teams: page.map(compactTeamListRow),
|
|
1699
|
+
...(listed.length > page.length && last ? { nextCursor: encodeTeamListCursor({ createdAt: last.createdAt, id: last.id, includeDormantTeams }) } : {}),
|
|
1700
|
+
...(hiddenDormantTeams > 0 ? { dormantTeamsHidden: hiddenDormantTeams, instruction: "Pass includeDormantTeams: true to list dormant teams too." } : {}),
|
|
1701
|
+
}, { teams: page.map(fullTeamListRow) });
|
|
1564
1702
|
},
|
|
1565
1703
|
}),
|
|
1566
1704
|
);
|
|
@@ -1587,7 +1725,7 @@ export default function (pi: ExtensionAPI) {
|
|
|
1587
1725
|
async execute(_toolCallId, params, signal, _onUpdate, context) {
|
|
1588
1726
|
signal?.throwIfAborted();
|
|
1589
1727
|
const manifest = resolveTeamIdentifier(resumableTeamManifests(context, "team_resume"), params.team);
|
|
1590
|
-
if (!manifest) throw new Error(`Unknown current-project team: ${JSON.stringify(params.team)}. Call team_list and pass a listed teamId or unique teamName in the team parameter.`);
|
|
1728
|
+
if (!manifest) throw new Error(`Unknown current-project team: ${JSON.stringify(params.team)}. Call team_list with includeDormantTeams: true and pass a listed teamId or unique teamName in the team parameter.`);
|
|
1591
1729
|
const members = manifest.members;
|
|
1592
1730
|
const requestedNames = resolveTeammates(members, params.teammates ?? members.map((member) => member.teammateId)).map((member) => member.name);
|
|
1593
1731
|
const showOnHerdrPanes = Boolean(params.showOnHerdrPanes);
|
package/package.json
CHANGED
package/team-selection.ts
CHANGED
|
@@ -64,7 +64,7 @@ export function unknownTargetMessage(identifier: string, teams: readonly Selecta
|
|
|
64
64
|
"Resume the intended teammate with team_resume, then retry team_send_message.",
|
|
65
65
|
].join("\n");
|
|
66
66
|
const choices = targetCandidates(teams).map(({ name, id }) => ({ name, id }));
|
|
67
|
-
return `Unknown target ${name}. Available choices: ${JSON.stringify(choices)}. No active target matches. Use team_list to find active
|
|
67
|
+
return `Unknown target ${name}. Available choices: ${JSON.stringify(choices)}. No active target matches. Use team_list to find active teams, with includeDormantTeams: true for dormant teams; resume the intended teammate before retrying.`;
|
|
68
68
|
}
|
|
69
69
|
|
|
70
70
|
/** @example resolveTargets([{ teamName: "review", teamId: "team-1", teammates: [{ name: "scout", teammateId: "session-1" }] }], ["review", "session-1"])[0].teammates.length // 1 */
|