pi-link 0.1.9 → 0.1.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/CHANGELOG.md +171 -159
- package/README.md +589 -580
- package/bin/pi-link.mjs +75 -65
- package/index.ts +1480 -1424
- package/package.json +1 -1
- package/skills/pi-link-coordination/SKILL.md +16 -9
package/package.json
CHANGED
|
@@ -29,7 +29,7 @@ Pick one mode per terminal per task. Mixing sync and async on the same terminal
|
|
|
29
29
|
|
|
30
30
|
### `link_list`
|
|
31
31
|
|
|
32
|
-
Returns connected terminals with names, live status (`idle`, `thinking`, `tool:<name>`), and working directory (cwd). Use before delegating when availability or path context is uncertain.
|
|
32
|
+
Returns connected terminals with names, live status (`idle`, `thinking`, `tool:<name>`), and working directory (cwd). Use before delegating when availability or path context is uncertain. Your own entry is marked `(you)` — use this to discover your link name when replying to broadcast tasks.
|
|
33
33
|
|
|
34
34
|
### `link_prompt`
|
|
35
35
|
|
|
@@ -44,13 +44,17 @@ Synchronous RPC. Send a prompt, wait for the response.
|
|
|
44
44
|
|
|
45
45
|
Fire-and-forget. Send to one terminal or `to: "*"` to broadcast (excludes sender).
|
|
46
46
|
|
|
47
|
-
Set `triggerTurn: true` to
|
|
47
|
+
Set `triggerTurn: true` to queue async work on the receiver. Delivery happens at turn boundaries: pending messages are batched and surface together when the receiver next becomes idle. The sender does **not** get the response back.
|
|
48
|
+
|
|
49
|
+
Batched callback shape: `[Link: N message(s) received]` then one or more `From "name":` / `content` blocks.
|
|
48
50
|
|
|
49
51
|
**Callback contract for `triggerTurn: true`:** ask the receiver to reply via `link_send` with:
|
|
50
52
|
|
|
51
|
-
- `DONE`
|
|
53
|
+
- `DONE` / `BLOCKED`
|
|
52
54
|
- Output paths / artifacts created
|
|
53
|
-
-
|
|
55
|
+
- Short result summary or next question
|
|
56
|
+
|
|
57
|
+
Keep callbacks concise. Put long details in files and return the paths.
|
|
54
58
|
|
|
55
59
|
---
|
|
56
60
|
|
|
@@ -73,11 +77,11 @@ For answers, review, analysis you need back now. One terminal at a time. Keep sc
|
|
|
73
77
|
|
|
74
78
|
### Async delegate — `link_send(triggerTurn: true)`
|
|
75
79
|
|
|
76
|
-
For autonomous work. Require the callback contract (DONE + paths +
|
|
80
|
+
For autonomous work. Require the callback contract (DONE/BLOCKED + paths + short summary). Do your own work in parallel. Expect the callback at a turn boundary, possibly batched with others. Don't `link_prompt` the target until the callback arrives.
|
|
77
81
|
|
|
78
82
|
### Parallel batch — async to multiple terminals
|
|
79
83
|
|
|
80
|
-
Distribute independent tasks. Use explicit paths (absolute if cwds differ)
|
|
84
|
+
Distribute independent tasks. Worker callbacks may return together in one batched turn when you become idle. Use explicit paths (absolute if cwds differ), require short callbacks + artifact paths, wait for all callbacks, then synthesize. Don't prompt any dispatched terminal until its callback arrives.
|
|
81
85
|
|
|
82
86
|
---
|
|
83
87
|
|
|
@@ -86,14 +90,14 @@ Distribute independent tasks. Use explicit paths (absolute if cwds differ). Wait
|
|
|
86
90
|
**❌ Mixing async and sync on the same terminal**
|
|
87
91
|
Dispatched with `link_send(triggerTurn: true)` then sent a `link_prompt` → rejected as busy. See Golden Rule.
|
|
88
92
|
|
|
89
|
-
**❌ Using `link_send` when you need the response**
|
|
90
|
-
|
|
93
|
+
**❌ Using `link_send` when you need the response now**
|
|
94
|
+
No direct response comes back to the sender. Use `link_prompt` when you need the answer in the same turn.
|
|
91
95
|
|
|
92
96
|
**❌ Vague prompts**
|
|
93
97
|
"Fix the bug" is useless. Include file, line, root cause, expected fix.
|
|
94
98
|
|
|
95
99
|
**❌ No completion callback on async work**
|
|
96
|
-
Always require DONE + artifact paths +
|
|
100
|
+
Always require DONE/BLOCKED + artifact paths + short summary.
|
|
97
101
|
|
|
98
102
|
**❌ Circular delegation**
|
|
99
103
|
A → B → C → A = deadlock. Maintain clear hierarchy.
|
|
@@ -101,6 +105,9 @@ A → B → C → A = deadlock. Maintain clear hierarchy.
|
|
|
101
105
|
**❌ Skipping `link_list` before retrying a busy target**
|
|
102
106
|
Check status before re-sending.
|
|
103
107
|
|
|
108
|
+
**❌ Long async callbacks**
|
|
109
|
+
Long callbacks crowd a whole batched turn. Ask workers to write detailed output to files and return paths + short summaries.
|
|
110
|
+
|
|
104
111
|
---
|
|
105
112
|
|
|
106
113
|
## Quick Reference
|