@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.
- package/README.md +13 -20
- package/child-tools.ts +18 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+

|
|
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
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
<a href="https://bun.sh/"><img alt="tested with Bun" src="https://shieldcn.dev/badge/tested_with-Bun.svg?logo=bun&variant=outline" /></a>
|
|
16
|
-
</p>
|
|
9
|
+
[](https://github.com/earendil-works/pi)
|
|
10
|
+
[](https://www.npmjs.com/package/@giladbarnea/pi-simple-team)
|
|
11
|
+
[](https://github.com/giladbarnea/pi-simple-team/actions/workflows/test.yml)
|
|
12
|
+
[](https://github.com/giladbarnea/pi-simple-team/blob/main/LICENSE)
|
|
13
|
+
[](https://www.typescriptlang.org/)
|
|
14
|
+
[](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
|
-
[](screenshots/abstract-tool-output-preview.png)
|
|
64
|
+
[](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
|
-
|
|
78
|
-
|
|
79
|
-
|
|
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
|
+
[](https://raw.githubusercontent.com/giladbarnea/pi-simple-team/main/screenshots/team-status-multiple.png)
|
|
76
|
+
|
|
77
|
+
[](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
|
-
|
|
95
|
-
<img src="screenshots/team-view.png" width="100%" alt="The live team dashboard showing statuses, messages, and recent events">
|
|
96
|
-
</a>
|
|
89
|
+
[](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
|
-

|
|
208
|
+

|
|
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) => {
|
|
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 {
|