@giladbarnea/pi-simple-team 2.0.8 → 2.0.10

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 (3) hide show
  1. package/README.md +13 -20
  2. package/child-tools.ts +18 -1
  3. package/package.json +1 -1
package/README.md CHANGED
@@ -1,4 +1,4 @@
1
- <img src="screenshots/pi-simple-team-banner.png" alt="A dark wireframe room in a starry void" width="100%">
1
+ ![A dark wireframe room in a starry void](https://raw.githubusercontent.com/giladbarnea/pi-simple-team/main/screenshots/pi-simple-team-banner.png)
2
2
 
3
3
  <div align="center">
4
4
 
@@ -6,14 +6,12 @@
6
6
 
7
7
  > **The team extension with no features.**
8
8
 
9
- <p align="center">
10
- <a href="https://github.com/earendil-works/pi"><img alt="Pi extension" src="https://shieldcn.dev/badge/pi-extension.svg?variant=outline" /></a>
11
- <a href="https://www.npmjs.com/package/@giladbarnea/pi-simple-team"><img alt="npm version" src="https://shieldcn.dev/npm/%40giladbarnea%2Fpi-simple-team.svg?variant=outline" /></a>
12
- <a href="https://github.com/giladbarnea/pi-simple-team/actions/workflows/test.yml"><img alt="test status" src="https://shieldcn.dev/github/ci/giladbarnea/pi-simple-team.svg?workflow=test.yml&amp;branch=main&amp;variant=outline" /></a>
13
- <a href="LICENSE"><img alt="license" src="https://shieldcn.dev/github/license/giladbarnea/pi-simple-team.svg?variant=outline" /></a>
14
- <a href="https://www.typescriptlang.org/"><img alt="TypeScript" src="https://shieldcn.dev/badge/typescript.svg?logo=typescript&amp;variant=outline" /></a>
15
- <a href="https://bun.sh/"><img alt="tested with Bun" src="https://shieldcn.dev/badge/tested_with-Bun.svg?logo=bun&amp;variant=outline" /></a>
16
- </p>
9
+ [![Pi extension](https://shieldcn.dev/badge/pi-extension.svg?variant=outline)](https://github.com/earendil-works/pi)
10
+ [![npm version](https://shieldcn.dev/npm/%40giladbarnea%2Fpi-simple-team.svg?variant=outline)](https://www.npmjs.com/package/@giladbarnea/pi-simple-team)
11
+ [![test status](https://shieldcn.dev/github/ci/giladbarnea/pi-simple-team.svg?workflow=test.yml&branch=main&variant=outline)](https://github.com/giladbarnea/pi-simple-team/actions/workflows/test.yml)
12
+ [![license](https://shieldcn.dev/github/license/giladbarnea/pi-simple-team.svg?variant=outline)](https://github.com/giladbarnea/pi-simple-team/blob/main/LICENSE)
13
+ [![TypeScript](https://shieldcn.dev/badge/typescript.svg?logo=typescript&variant=outline)](https://www.typescriptlang.org/)
14
+ [![tested with Bun](https://shieldcn.dev/badge/tested_with-Bun.svg?logo=bun&variant=outline)](https://bun.sh/)
17
15
 
18
16
  **No roles. No org chart. No mailboxes. No routing rules.**
19
17
 
@@ -63,7 +61,7 @@ Main agent:
63
61
  > - `implementer` will keep fixing until `reviewer` is satisfied.
64
62
  > - I will let you know when they are done.
65
63
 
66
- [![A team appears, receives direction, and starts working](screenshots/abstract-tool-output-preview-640.png)](screenshots/abstract-tool-output-preview.png)
64
+ [![A team appears, receives direction, and starts working](https://raw.githubusercontent.com/giladbarnea/pi-simple-team/main/screenshots/abstract-tool-output-preview-640.png)](https://raw.githubusercontent.com/giladbarnea/pi-simple-team/main/screenshots/abstract-tool-output-preview.png)
67
65
 
68
66
  <div align="center"><em>Spawn, direct, and follow a team from the normal Pi conversation.</em></div>
69
67
 
@@ -74,12 +72,9 @@ Main agent:
74
72
 
75
73
  <br>
76
74
 
77
- <p align="center">
78
- <a href="screenshots/team-status-multiple.png"><img src="screenshots/team-status-multiple.png" width="100%" alt="Status outputs for several parallel teams"></a>
79
- </p>
80
- <p align="center">
81
- <a href="screenshots/team-log-multiple.png"><img src="screenshots/team-log-multiple.png" width="100%" alt="Event log outputs for two parallel teams"></a>
82
- </p>
75
+ [![Status outputs for several parallel teams](https://raw.githubusercontent.com/giladbarnea/pi-simple-team/main/screenshots/team-status-multiple.png)](https://raw.githubusercontent.com/giladbarnea/pi-simple-team/main/screenshots/team-status-multiple.png)
76
+
77
+ [![Event log outputs for two parallel teams](https://raw.githubusercontent.com/giladbarnea/pi-simple-team/main/screenshots/team-log-multiple.png)](https://raw.githubusercontent.com/giladbarnea/pi-simple-team/main/screenshots/team-log-multiple.png)
83
78
 
84
79
  </details>
85
80
 
@@ -91,9 +86,7 @@ The command opens an overlay rolling recent statuses, messages, and a separate e
91
86
 
92
87
  Up/Down select the messages or log widget. Enter zooms it to the full overlay. Esc goes back.
93
88
 
94
- <a href="screenshots/team-view.png">
95
- <img src="screenshots/team-view.png" width="100%" alt="The live team dashboard showing statuses, messages, and recent events">
96
- </a>
89
+ [![The live team dashboard showing statuses, messages, and recent events](https://raw.githubusercontent.com/giladbarnea/pi-simple-team/main/screenshots/team-view.png)](https://raw.githubusercontent.com/giladbarnea/pi-simple-team/main/screenshots/team-view.png)
97
90
 
98
91
  <div align="center"><em>The live, read-only <code>/team</code> dashboard.</em></div>
99
92
 
@@ -212,7 +205,7 @@ Or give main a concrete team goal:
212
205
 
213
206
  That prompt creates this graph:
214
207
 
215
- ![The team graph: 1-map (Scout and Devil’s advocate) feeding subagent dispatch, feeding 3-eval (Engineer and Performance watcher)](screenshots/team-graph.png)
208
+ ![The team graph: 1-map (Scout and Devil’s advocate) feeding subagent dispatch, feeding 3-eval (Engineer and Performance watcher)](https://raw.githubusercontent.com/giladbarnea/pi-simple-team/main/screenshots/team-graph.png)
216
209
 
217
210
  ## Tools
218
211
 
package/child-tools.ts CHANGED
@@ -13,6 +13,19 @@ const teamMessageType = "pi-simple-team";
13
13
  const defaultInterruptWaitTimeoutMilliseconds = 25_000;
14
14
  const lifecycleCallbackRetryAttempts = 3;
15
15
 
16
+ /** Every tool a teammate registers in registerChildTools. */
17
+ export const childToolNames = ["get_context_window_usage", "team_send_message", "send_main_message", "team_status"] as const;
18
+
19
+ /**
20
+ * Pi 1.3 restores the tool loadout recorded in a resumed or forked transcript, and again after /tree. A teammate
21
+ * forked from main inherits main's loadout, which never declared teammate-only tools such as send_main_message.
22
+ */
23
+ function activateChildTools(pi: ExtensionAPI): void {
24
+ const activeTools = pi.getActiveTools();
25
+ const missingTools = childToolNames.filter((name) => !activeTools.includes(name));
26
+ if (missingTools.length > 0) pi.setActiveTools([...activeTools, ...missingTools]);
27
+ }
28
+
16
29
  export interface ChildRuntimeConfig {
17
30
  callbackUrl: string;
18
31
  callbackToken: string;
@@ -185,7 +198,10 @@ function startChildRuntime(pi: ExtensionAPI, config: ChildRuntimeConfig): void {
185
198
  pi.on("session_compact", (_event, context) => { void reportRuntimeFacts(context); });
186
199
  pi.on("model_select", (_event, context) => { void reportRuntimeFacts(context); });
187
200
  pi.on("thinking_level_select", (_event, context) => { void reportRuntimeFacts(context); });
188
- pi.on("session_tree", (_event, context) => { void reportRuntimeFacts(context); });
201
+ pi.on("session_tree", (_event, context) => {
202
+ activateChildTools(pi);
203
+ void reportRuntimeFacts(context);
204
+ });
189
205
  pi.on("tool_execution_start", (event) => {
190
206
  notifyParent({ type: "tool_execution_start", toolCallId: event.toolCallId, toolName: event.toolName, args: event.args });
191
207
  });
@@ -193,6 +209,7 @@ function startChildRuntime(pi: ExtensionAPI, config: ChildRuntimeConfig): void {
193
209
  notifyParent({ type: "tool_execution_end", toolCallId: event.toolCallId, toolName: event.toolName, isError: event.isError, result: event.result });
194
210
  });
195
211
  pi.on("session_start", async (_event, context) => {
212
+ activateChildTools(pi);
196
213
  server = http.createServer((request, response) => {
197
214
  void (async () => {
198
215
  try {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@giladbarnea/pi-simple-team",
3
- "version": "2.0.8",
3
+ "version": "2.0.10",
4
4
  "description": "A flat, live team of Pi agents.",
5
5
  "keywords": [
6
6
  "pi-package",