pi-link 0.4.1 → 0.5.0
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 +30 -0
- package/README.md +177 -191
- package/bin/pi-link.mjs +11 -15
- package/index.ts +104 -118
- package/package.json +1 -1
- package/skills/pi-link-tools/SKILL.md +63 -0
- package/skills/pi-link-coordination/SKILL.md +0 -124
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: pi-link-tools
|
|
3
|
+
description: "How `link_send`, `link_list` and `link_compact` behave between Pi terminals: delivery, status snapshots, callbacks, groups and remote compaction."
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Pi-Link Tools
|
|
7
|
+
|
|
8
|
+
- Each terminal knows only its own conversation; sending a message does not share the rest of yours.
|
|
9
|
+
- A message asks another terminal to act with its own tools and access, which may differ from yours.
|
|
10
|
+
- Messages that reach another terminal enter its reasoning and can redirect its work.
|
|
11
|
+
|
|
12
|
+
---
|
|
13
|
+
|
|
14
|
+
## Tools
|
|
15
|
+
|
|
16
|
+
### `link_list`
|
|
17
|
+
|
|
18
|
+
- Returns connected terminals with names, status (`idle`, `thinking`, `compacting`, `tool:<name>`), cwd, and (when available) context usage such as `45K/272K (17%)`.
|
|
19
|
+
- Your own entry is marked `(you)` and cannot be a target of `link_send` or `link_compact`; its status and context are computed when listed, while peer values are their latest published snapshots.
|
|
20
|
+
- A missing status means no status has been reported yet, not `idle`.
|
|
21
|
+
- A `?` context value means usage is unknown; it can appear after successful compaction until a new measurement is available.
|
|
22
|
+
- An `idle` snapshot does not reserve the terminal: it may become busy before your next call.
|
|
23
|
+
- `tool:<name>` names one of the running tool calls.
|
|
24
|
+
- `thinking` covers every kind of unsettled work, not just an LLM call, including automatic retries and compactions that run after the visible turn ends.
|
|
25
|
+
- `compacting` means a compaction holds that terminal's delivery gate: messages to it are held, and the sender is not told. An automatic (threshold or overflow) compaction never shows it: it is not gated, and reads `thinking` like the rest of the run it belongs to.
|
|
26
|
+
- Only connected terminals are visible; messages missed while a terminal was disconnected are not replayed.
|
|
27
|
+
|
|
28
|
+
### `link_send`
|
|
29
|
+
|
|
30
|
+
- Messages that reach the receiver close together are batched before entering its model. A batch arrives as one `[Link: N message(s) received]` block, in arrival order, containing one `From "name":` block per message.
|
|
31
|
+
- A delivered message always enters the receiver's reasoning: if the receiver is idle it starts a turn; if it is running, the batch is steered into that run at Pi's next safe boundary — current tool calls finish first, before the next LLM call. The receiver's state is read when the batch is delivered, not when you send and not when you last ran `link_list`.
|
|
32
|
+
- Each call has one recipient; there is no broadcast.
|
|
33
|
+
- The call returns send status, not the receiver's eventual work result. A target absent from your local, group-filtered list — a typo, an offline terminal or a name in another group — fails immediately; the error lists the names currently visible to you. A successful send means the message was accepted for delivery, not that it arrived. For a client, if the target has vanished, the routing failure is shown to the human as a notification and never reaches the sending model. A terminal's queued messages are invisible to you, and silence alone does not tell you whether your message was received or acted on.
|
|
34
|
+
|
|
35
|
+
### `link_compact`
|
|
36
|
+
|
|
37
|
+
- Asks another terminal to compact its context and waits for a result.
|
|
38
|
+
- Has a five-minute ceiling that bounds your wait only:
|
|
39
|
+
- Nothing aborts the target.
|
|
40
|
+
- A timed-out call may mean the compaction is still running.
|
|
41
|
+
- A target accepts only when Pi reports its session idle and no compaction holds its gate.
|
|
42
|
+
- Busy targets decline the request rather than being interrupted; the request is not queued to run later.
|
|
43
|
+
- Optional `instructions` guide the summary; they are not a new task and do not guarantee what survives.
|
|
44
|
+
- Compaction discards detail. Its summary may omit information, so anything the target learned but has not written down or reported can be lost.
|
|
45
|
+
|
|
46
|
+
---
|
|
47
|
+
|
|
48
|
+
## Callbacks
|
|
49
|
+
|
|
50
|
+
- A callback is an ordinary `link_send` from the other terminal back to you. There is no request ID, no automatic response, no delivery receipt, and no protocol timeout — nothing correlates a callback with the request that asked for it except the text of both, and nothing produces one except the receiver choosing to send it.
|
|
51
|
+
- Your ordinary reply stays in your own conversation; use `link_send` to send a result to the requester or the designated recipient. If you need a reply, say who should receive it; a label in the request and reply can help distinguish concurrent exchanges.
|
|
52
|
+
- Waiting for one requires no live run. Keeping a run alive only to wait — by sleeping or polling `link_list` — can postpone delivery to the model until active tool calls end.
|
|
53
|
+
- A callback can be sent before its sender's run settles; receiving it does not prove the sender is idle, so a `link_compact` aimed at it can still decline as busy.
|
|
54
|
+
- An accepted send does not wait for a reply, so several requests can be sent before any callback arrives, and callbacks may arrive separately or batched into one of your turns. The protocol does not decide when an exchange is complete; it supplies no exit condition for an A → B → C → A chain.
|
|
55
|
+
|
|
56
|
+
---
|
|
57
|
+
|
|
58
|
+
## Constraints
|
|
59
|
+
|
|
60
|
+
- **Localhost only.** All terminals run on the same machine.
|
|
61
|
+
- **Cwd is a hint, not proof.** Same cwd does not prove the same workspace, branch, or access. Paths named in a message are only text: they do not change the receiver's cwd, and relative commands resolve from the receiver's own cwd.
|
|
62
|
+
- **Names are identities.** The hub suffixes collisions, so the name you remember may not be the name that is connected; `link_list` shows the current one.
|
|
63
|
+
- **`@group` in a name limits your world.** The text after the first `@` is the group (case-sensitive): `link_list`, `link_send` and `link_compact` only see and reach terminals of your own group, and names without `@` form one group of their own. These tools cannot change your name or group; `/link-name` is the local command for changing them. Groups scope visibility and targeting, not authentication.
|
|
@@ -1,124 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: pi-link-coordination
|
|
3
|
-
description: Mechanics of coordinating work across Pi terminals with link_send, link_list, and link_compact — how delivery, batching, callbacks, and remote compaction actually behave.
|
|
4
|
-
---
|
|
5
|
-
|
|
6
|
-
# Pi-Link Coordination
|
|
7
|
-
|
|
8
|
-
How the pi-link transport behaves between Pi terminals.
|
|
9
|
-
|
|
10
|
-
**Terminals share no conversation.** Each is an independent agent with its own
|
|
11
|
-
context. Nothing you hold — task state, file paths, an approval you were given,
|
|
12
|
-
what you decided a moment ago — is visible to a terminal you message. The message
|
|
13
|
-
is the entire shared state.
|
|
14
|
-
|
|
15
|
-
---
|
|
16
|
-
|
|
17
|
-
## Tools
|
|
18
|
-
|
|
19
|
-
### `link_list`
|
|
20
|
-
|
|
21
|
-
Returns connected terminals with names, status (`idle`, `thinking`,
|
|
22
|
-
`compacting`, `tool:<name>`), cwd, and (when available) context usage such as
|
|
23
|
-
`45K/272K (17%)`. Your own entry is marked `(you)`; its status and context are
|
|
24
|
-
computed when listed, while peer values are their latest published snapshots.
|
|
25
|
-
|
|
26
|
-
Pi runs tools in parallel by default, and `tool:<name>` then names the first
|
|
27
|
-
still-active call it reported rather than all of them. It advances only when that
|
|
28
|
-
call ends, and becomes `thinking` only after the last call ends.
|
|
29
|
-
|
|
30
|
-
`thinking` covers every kind of unsettled work, not just an LLM call: an automatic
|
|
31
|
-
retry, an automatic compaction and a queued continuation all run after the visible
|
|
32
|
-
turn ends, and the terminal reads `thinking` until Pi reports the run settled.
|
|
33
|
-
|
|
34
|
-
`compacting` means a manual compaction has raised that terminal's delivery gate;
|
|
35
|
-
messages sent to it wait until the gate clears. An automatic (threshold or
|
|
36
|
-
overflow) compaction never shows it — it is not gated, and reads `thinking` like
|
|
37
|
-
the rest of the run it belongs to.
|
|
38
|
-
|
|
39
|
-
Only connected terminals are visible; nothing is stored for disconnected
|
|
40
|
-
terminals, so a reconnecting terminal receives no backlog.
|
|
41
|
-
|
|
42
|
-
A terminal's queued messages are invisible to you, and silence is
|
|
43
|
-
indistinguishable from work in progress.
|
|
44
|
-
|
|
45
|
-
### `link_send`
|
|
46
|
-
|
|
47
|
-
The message is delivered to the receiver's model. The first message to arrive opens
|
|
48
|
-
a batching window of about 200ms; later arrivals do not move its deadline, so a
|
|
49
|
-
steady stream is delivered window by window instead of waiting for a pause. A batch
|
|
50
|
-
arrives as one `[Link: N message(s) received]` block, in arrival order, containing
|
|
51
|
-
one `From "name":` block per message.
|
|
52
|
-
|
|
53
|
-
The receiver's state is read when that batch is delivered, not when you send and
|
|
54
|
-
not when you last ran `link_list`. If the receiver is still running then, the batch
|
|
55
|
-
is steered into that run at Pi's next safe boundary — current tool calls finish
|
|
56
|
-
first, before the next LLM call. Otherwise it starts a turn. A receiver can settle
|
|
57
|
-
within the delay, so a message sent to a busy terminal may still arrive as a new
|
|
58
|
-
turn. There is no way to send without entering the receiver's reasoning.
|
|
59
|
-
|
|
60
|
-
Each send has exactly one recipient. There is no fan-out.
|
|
61
|
-
|
|
62
|
-
The call returns send status, not the receiver's eventual work result. A definitely
|
|
63
|
-
absent target fails against the local terminal list; beyond that, for a client a
|
|
64
|
-
successful send means the message was written to its hub connection, not that it
|
|
65
|
-
arrived. If the target has vanished, the routing failure is shown to the human as a
|
|
66
|
-
notification and never reaches the sending model.
|
|
67
|
-
|
|
68
|
-
A terminal reported as `compacting` receives nothing until its gate clears. The
|
|
69
|
-
messages wait and are delivered afterwards. A cancelled compaction has no ending
|
|
70
|
-
pi-link can see, so they wait for the terminal's next agent run, a later
|
|
71
|
-
successful compaction, or a three-minute deadline — whichever comes first. The
|
|
72
|
-
sender is told nothing meanwhile.
|
|
73
|
-
|
|
74
|
-
### `link_compact`
|
|
75
|
-
|
|
76
|
-
Asks another terminal to compact its context and waits for a result, with a
|
|
77
|
-
three-minute ceiling. A target accepts only when Pi reports its session idle and no
|
|
78
|
-
manual compaction holds its gate; anything else declines rather than being
|
|
79
|
-
interrupted, so a target reading `thinking` for a retry or an automatic compaction
|
|
80
|
-
declines exactly as one mid-turn does. Optional `instructions` focus the summary.
|
|
81
|
-
|
|
82
|
-
The timeout bounds your wait only. Nothing aborts the target, so a timed-out call
|
|
83
|
-
may mean the compaction is still running.
|
|
84
|
-
|
|
85
|
-
Compaction discards detail. What survives is whatever the summary keeps, so
|
|
86
|
-
anything the target learned but has not written down or reported can be lost.
|
|
87
|
-
|
|
88
|
-
---
|
|
89
|
-
|
|
90
|
-
## Callbacks
|
|
91
|
-
|
|
92
|
-
A callback is an ordinary `link_send` from the worker back to you. There is no
|
|
93
|
-
request ID, no automatic response, no delivery receipt, and no protocol timeout —
|
|
94
|
-
nothing correlates a callback with the dispatch that asked for it except the text
|
|
95
|
-
of both, and nothing produces one except the receiver choosing to send it.
|
|
96
|
-
|
|
97
|
-
Waiting for one requires no live run: if the terminal is idle when the batch is
|
|
98
|
-
delivered, the message starts a turn by itself. Keeping a run alive only to wait —
|
|
99
|
-
by sleeping or polling `link_list` — is unnecessary and can postpone delivery to
|
|
100
|
-
the model until active tool calls end.
|
|
101
|
-
|
|
102
|
-
A callback can be sent before its sender's run settles; receiving it does not
|
|
103
|
-
prove the sender is idle, so a `link_compact` aimed at it can still decline as
|
|
104
|
-
busy.
|
|
105
|
-
|
|
106
|
-
An accepted send does not wait for a reply, so several tasks can be dispatched
|
|
107
|
-
before any callback arrives, and callbacks may arrive separately or batched into
|
|
108
|
-
one of your turns. For the same reason the protocol supplies no exit condition for
|
|
109
|
-
an A → B → C → A delegation chain.
|
|
110
|
-
|
|
111
|
-
---
|
|
112
|
-
|
|
113
|
-
## Constraints
|
|
114
|
-
|
|
115
|
-
- **Localhost only.** All terminals run on the same machine.
|
|
116
|
-
- **Cwd is a hint, not proof.** Same cwd does not prove the same workspace, branch,
|
|
117
|
-
or access. Paths named in a message are only text: they do not change the
|
|
118
|
-
receiver's cwd, and relative commands resolve from the receiver's own cwd.
|
|
119
|
-
- **Names are identities.** The hub suffixes collisions, so the name you remember
|
|
120
|
-
may not be the name that is connected; `link_list` shows the current one.
|
|
121
|
-
- **Mixed-version meshes are unsupported.** Across the current protocol break, a
|
|
122
|
-
message from a new sender can reach a 0.2.0 receiver as bare text — without the
|
|
123
|
-
`[Link: N message(s) received]` header or the `From "name":` line — and nothing
|
|
124
|
-
reports a fault.
|