@astrosheep/square 0.4.0 → 0.4.2

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 (196) hide show
  1. package/dist/artifact.d.ts +1 -3
  2. package/dist/artifact.js +12 -36
  3. package/dist/attention-presentation.d.ts +2 -22
  4. package/dist/attention-presentation.js +9 -12
  5. package/dist/boundary-presentation.d.ts +3 -14
  6. package/dist/boundary-presentation.js +29 -104
  7. package/dist/card-presentation.d.ts +1 -0
  8. package/dist/card-presentation.js +2 -0
  9. package/dist/catch-decisions.js +1 -7
  10. package/dist/claude-boundary-state.d.ts +20 -0
  11. package/dist/claude-boundary-state.js +84 -0
  12. package/dist/claude-hook.d.ts +2 -0
  13. package/dist/claude-hook.js +231 -0
  14. package/dist/claude-mcp-context.d.ts +1 -1
  15. package/dist/claude-mcp-context.js +12 -3
  16. package/dist/cli/context.js +7 -9
  17. package/dist/cli/observation-commands.d.ts +4 -1
  18. package/dist/cli/observation-commands.js +37 -4
  19. package/dist/cli/registry.js +5 -2
  20. package/dist/codex-address.d.ts +2 -2
  21. package/dist/codex-boundary-state.d.ts +1 -5
  22. package/dist/codex-boundary-state.js +0 -4
  23. package/dist/codex-hook.d.ts +7 -10
  24. package/dist/codex-hook.js +69 -33
  25. package/dist/codex-queue.d.ts +10 -11
  26. package/dist/codex-queue.js +32 -32
  27. package/dist/codex-watch.d.ts +2 -0
  28. package/dist/codex-watch.js +100 -0
  29. package/dist/decisions.js +2 -2
  30. package/dist/delivery-deferral.d.ts +8 -17
  31. package/dist/delivery-deferral.js +0 -28
  32. package/dist/delivery-frame.d.ts +7 -0
  33. package/dist/delivery-frame.js +11 -0
  34. package/dist/delivery-ledger-sqlite.d.ts +97 -0
  35. package/dist/delivery-ledger-sqlite.js +496 -0
  36. package/dist/delivery-ledger.d.ts +196 -0
  37. package/dist/delivery-ledger.js +268 -0
  38. package/dist/delivery-lifetime.d.ts +6 -0
  39. package/dist/delivery-lifetime.js +45 -0
  40. package/dist/harness-claude.js +3 -4
  41. package/dist/harness-links.js +63 -7
  42. package/dist/harness.js +12 -17
  43. package/dist/help.js +4 -1
  44. package/dist/http-delivery.d.ts +5 -9
  45. package/dist/http-delivery.js +20 -77
  46. package/dist/inbox.d.ts +6 -49
  47. package/dist/inbox.js +24 -371
  48. package/dist/index.d.ts +6 -3
  49. package/dist/index.js +4 -1
  50. package/dist/mcp.js +2 -3
  51. package/dist/model.d.ts +7 -47
  52. package/dist/model.js +1 -7
  53. package/dist/notifications.d.ts +24 -20
  54. package/dist/notifications.js +39 -108
  55. package/dist/operation-control.d.ts +4 -0
  56. package/dist/operation-control.js +20 -0
  57. package/dist/packages/agent-delivery/src/claude-native.d.ts +2 -0
  58. package/dist/packages/agent-delivery/src/claude-native.js +5 -0
  59. package/dist/packages/agent-delivery/src/codex-boundary.d.ts +11 -6
  60. package/dist/packages/agent-delivery/src/codex-boundary.js +31 -40
  61. package/dist/packages/agent-delivery/src/codex-hook.d.ts +17 -12
  62. package/dist/packages/agent-delivery/src/codex-hook.js +26 -39
  63. package/dist/packages/agent-delivery/src/codex.d.ts +3 -0
  64. package/dist/packages/agent-delivery/src/codex.js +41 -4
  65. package/dist/packages/agent-delivery/src/index.d.ts +3 -1
  66. package/dist/packages/agent-delivery/src/index.js +1 -1
  67. package/dist/packages/agent-delivery/src/paseo.js +11 -2
  68. package/dist/packages/agent-delivery/src/types.d.ts +1 -0
  69. package/dist/paseo-delivery.d.ts +5 -5
  70. package/dist/paseo-delivery.js +19 -97
  71. package/dist/paseo.d.ts +1 -1
  72. package/dist/paseo.js +1 -1
  73. package/dist/plugins/opencode/index.d.ts +5 -3
  74. package/dist/plugins/opencode/index.js +99 -21
  75. package/dist/plugins/opencode-shared/delivery.d.ts +23 -0
  76. package/dist/plugins/opencode-shared/delivery.js +109 -0
  77. package/dist/plugins/opencode-v1/index.d.ts +28 -0
  78. package/dist/plugins/opencode-v1/index.js +41 -0
  79. package/dist/plugins/opencode-v1/runtime.d.ts +56 -0
  80. package/dist/plugins/opencode-v1/runtime.js +152 -0
  81. package/dist/plugins/opencode-v1/transport.d.ts +13 -0
  82. package/dist/plugins/opencode-v1/transport.js +50 -0
  83. package/dist/plugins/paseo/shared/card-presentation.d.ts +10 -0
  84. package/dist/plugins/paseo/shared/card-presentation.js +7 -0
  85. package/dist/ports.d.ts +31 -90
  86. package/dist/session-lifecycle.d.ts +8 -7
  87. package/dist/session-lifecycle.js +40 -42
  88. package/dist/sqlite-square.d.ts +14 -23
  89. package/dist/sqlite-square.js +132 -139
  90. package/dist/square-api.js +4 -7
  91. package/dist/square-core.d.ts +0 -1
  92. package/dist/square-domain.d.ts +5 -17
  93. package/dist/square-domain.js +104 -221
  94. package/dist/square-facade.d.ts +18 -15
  95. package/dist/square-post.d.ts +53 -0
  96. package/dist/square-post.js +4 -0
  97. package/dist/square-posting.d.ts +13 -0
  98. package/dist/square-posting.js +174 -0
  99. package/dist/square-producer-sqlite.d.ts +11 -0
  100. package/dist/square-producer-sqlite.js +210 -0
  101. package/dist/square-sqlite.d.ts +15 -25
  102. package/dist/square-sqlite.js +150 -226
  103. package/dist/views.d.ts +2 -2
  104. package/dist/views.js +0 -1
  105. package/dist/wake-sink.d.ts +4 -11
  106. package/dist/wake-sink.js +8 -32
  107. package/dist/wake-transports.d.ts +4 -7
  108. package/dist/wake-transports.js +7 -39
  109. package/examples/symmetric-domains.mjs +29 -249
  110. package/guides/change-waits.md +13 -53
  111. package/guides/claude-native.md +7 -171
  112. package/guides/codex-delivery.md +55 -80
  113. package/guides/delivery-primitives.md +48 -207
  114. package/guides/mcp.md +1 -1
  115. package/guides/operation-cancellation.md +2 -5
  116. package/guides/participant-ownership.md +25 -89
  117. package/guides/pi-native-delivery.md +19 -56
  118. package/guides/pi-tools.md +6 -8
  119. package/guides/square-api.md +113 -615
  120. package/package.json +8 -8
  121. package/plugins/claude/.claude-plugin/plugin.json +2 -3
  122. package/plugins/claude/hooks/hooks.json +11 -1
  123. package/plugins/codex/.codex-plugin/plugin.json +1 -1
  124. package/plugins/codex/hooks/hooks.json +11 -23
  125. package/plugins/opencode/index.ts +91 -23
  126. package/plugins/opencode-shared/delivery.ts +91 -0
  127. package/plugins/opencode-v1/index.ts +36 -0
  128. package/plugins/opencode-v1/runtime.ts +134 -0
  129. package/plugins/opencode-v1/transport.ts +41 -0
  130. package/plugins/paseo/OVERVIEW.md +5 -5
  131. package/plugins/paseo/README.md +7 -6
  132. package/plugins/paseo/client/markdown.tsx +5 -5
  133. package/plugins/paseo/client/square-message.tsx +28 -24
  134. package/plugins/paseo/client/transform.ts +8 -5
  135. package/plugins/paseo/shared/card-presentation.ts +16 -0
  136. package/plugins/paseo/shared/message.ts +6 -11
  137. package/plugins/pi/square-pi.js +156 -417
  138. package/dist/channel-artifact.d.ts +0 -10
  139. package/dist/channel-artifact.js +0 -55
  140. package/dist/channel-delivery.d.ts +0 -11
  141. package/dist/channel-delivery.js +0 -51
  142. package/dist/channel-domain.d.ts +0 -3
  143. package/dist/channel-domain.js +0 -83
  144. package/dist/channel-facade.d.ts +0 -76
  145. package/dist/channel-facade.js +0 -1
  146. package/dist/channel-internal.d.ts +0 -126
  147. package/dist/channel-internal.js +0 -440
  148. package/dist/channel-metadata.d.ts +0 -11
  149. package/dist/channel-metadata.js +0 -1
  150. package/dist/channel-ports.d.ts +0 -241
  151. package/dist/channel-ports.js +0 -1
  152. package/dist/channel-presentation.d.ts +0 -17
  153. package/dist/channel-presentation.js +0 -22
  154. package/dist/channel-sqlite-schema.d.ts +0 -13
  155. package/dist/channel-sqlite-schema.js +0 -81
  156. package/dist/channel-transport.d.ts +0 -62
  157. package/dist/channel-transport.js +0 -1
  158. package/dist/channel.d.ts +0 -84
  159. package/dist/channel.js +0 -60
  160. package/dist/claude-delivery-status.d.ts +0 -13
  161. package/dist/claude-delivery-status.js +0 -46
  162. package/dist/claude-delivery.d.ts +0 -12
  163. package/dist/claude-delivery.js +0 -108
  164. package/dist/claude-mod.d.ts +0 -8
  165. package/dist/claude-mod.js +0 -172
  166. package/dist/claude-transport.d.ts +0 -5
  167. package/dist/claude-transport.js +0 -58
  168. package/dist/cmd/notify-once.d.ts +0 -2
  169. package/dist/cmd/notify-once.js +0 -29
  170. package/dist/delivery-attempts.d.ts +0 -52
  171. package/dist/delivery-attempts.js +0 -73
  172. package/dist/delivery-effects.d.ts +0 -139
  173. package/dist/delivery-effects.js +0 -163
  174. package/dist/delivery-health.d.ts +0 -51
  175. package/dist/delivery-health.js +0 -173
  176. package/dist/delivery-operations.d.ts +0 -22
  177. package/dist/delivery-operations.js +0 -198
  178. package/dist/delivery-primitives.d.ts +0 -5
  179. package/dist/delivery-primitives.js +0 -3
  180. package/dist/delivery.d.ts +0 -56
  181. package/dist/delivery.js +0 -80
  182. package/dist/plugins/opencode/delivery.d.ts +0 -19
  183. package/dist/plugins/opencode/delivery.js +0 -223
  184. package/dist/presentation-operations.d.ts +0 -5
  185. package/dist/presentation-operations.js +0 -86
  186. package/dist/sqlite-channel.d.ts +0 -15
  187. package/dist/sqlite-channel.js +0 -600
  188. package/dist/square-index.d.ts +0 -16
  189. package/dist/square-index.js +0 -106
  190. package/dist/wake-preview.d.ts +0 -7
  191. package/dist/wake-preview.js +0 -15
  192. package/plugins/claude/hooks/register.js +0 -132
  193. package/plugins/claude/types.d.ts +0 -7
  194. package/plugins/opencode/delivery.ts +0 -198
  195. /package/dist/{channel-values.d.ts → square-values.d.ts} +0 -0
  196. /package/dist/{channel-values.js → square-values.js} +0 -0
package/guides/mcp.md CHANGED
@@ -6,7 +6,7 @@ Set `SQUARE_LOCATION` to the default `.square` artifact path; calls may override
6
6
 
7
7
  The server exposes `join`, `express`, `catch`, `history`, `attention`, `done`, and `status`. `attention` takes `action: listen | unlisten | ignore`; `status` also reports who you listen to when a name resolves. `catch` consumes activities. `history` is read-only and accepts stable `act/<index>` cursors. All seven tools return the same human-readable text as the CLI in `content`, without `outputSchema` or `structuredContent`. Square failures set `isError: true` and return readable refusal and recovery text in `content`. Clients keep their native MCP result envelope; machine-readable domain results remain available through the SDK.
8
8
 
9
- Claude's bundled plugin configures this server automatically. Its mod supplies live session/cwd/subagent attribution through an out-of-band tool-use-ID association, not AI-visible arguments; see [Claude call identity](claude-native.md#mcp-tools-and-call-identity). The bundled endpoint requires that association rather than falling back to its startup environment.
9
+ Claude's bundled plugin configures this server automatically. Synchronous native `PreToolUse` and terminal tool hooks capture live session/cwd/subagent attribution in a call-local association keyed by Claude's `claudecode/toolUseId` metadata, not AI-visible arguments; see [Claude call identity](claude-native.md). Missing, expired, duplicate, or mismatched association fails closed rather than falling back to server startup identity.
10
10
 
11
11
  Tool definitions and argument-to-`Square`/`Participant` calls live in `square-tools.ts`, shared with the [Pi native tools](pi-tools.md). Domain receipts stay internal to these adapters; tools return only their rendered text. All callers use the [same concrete resource API](square-api.md), with no alternate factory or generic outcome envelope. `express.noMention` disables body @name scanning without disabling explicit mentions or reply attention.
12
12
 
@@ -14,11 +14,8 @@ but the committed activity remains recoverable through `history` or a later `cat
14
14
  require a second acknowledgement. The separate `pending` query never consumes; its optional
15
15
  follow-up `ack(ids)` commits exact receipts with the same cancellation boundary.
16
16
 
17
- The single catch lease and independent delivery-deferral leases have distinct lifetimes. Cancelling
18
- an active catch releases only that catch's lease. Cancelling a deferral operation before commit
19
- prevents its mutation; once creation or renewal commits, the lease survives caller cancellation
20
- until explicit release, expiry or retirement of its captured seat. A committed release is likewise
21
- not undone. There is no automatic rollback lease or per-message cancellation timer.
17
+ Cancelling an active catch releases its catch lease, permitting still-unconsumed activity to proceed
18
+ at the next ordinary posting opportunity. It cannot recall export ownership already committed.
22
19
 
23
20
  Ownership and delivery have the same limitation: cancellation can stop work that has not entered the boundary, but it cannot withdraw an ownership effect or a transport send that already happened. The returned committed result and existing degradation classification remain authoritative.
24
21
 
@@ -1,91 +1,27 @@
1
1
  # Participant ownership
2
2
 
3
- Membership and host attachment are different facts. Membership says a participant is in the
4
- square; it owns their join history, read horizon and outgoing listens. Attachment says whether
5
- an exact opaque owner is executing for that participant now.
6
- A standing seat may be attached or detached. The artifact transaction is the sole custody
7
- authority; display spelling, wake addresses and the rebuildable HOME discovery index never
8
- grant ownership. There is no writable HostLedger ownership layer.
9
-
10
- Owners are opaque non-secret strings, not harness coordinates or authentication. Harness adapters
11
- encode their own identity; terminal owners use `user:<OS user>@<host>` and are never automatically
12
- detached or ended by a harness. A seat's optional wake route is self-contained transport readiness,
13
- not an owner or an alternative custody fact.
14
-
15
- ## Three endings
16
-
17
- - **The participant leaves:** `Participant.done()` ends membership, removes its seat, catch
18
- lease and delivery deferrals, and removes outgoing listens. A later explicit `join` establishes
19
- a fresh generation and read horizon. No host start or resume brings a voluntary leave back.
20
- - **The host session ends:** `detach(name, {owner, generation})` detaches only that exact owner and
21
- join generation. It clears wake readiness, catch ownership and delivery deferrals, without landing
22
- an activity or changing membership, listens or the read horizon. A detached participant is
23
- **away**, still receives normal landed audience and accumulates unread activity, but cannot write
24
- or receive proactive delivery. Away has no timeout; a session that never returns simply stays away.
25
- - **The host confirms permanent deletion:** `endHeld(name, {owner, generation})` ends membership
26
- with a fenced `done`, including for a detached seat. OpenCode's `session.deleted` uses this path.
27
- Pi shutdown, Codex SessionEnd and Claude session end do not prove permanent deletion and therefore
28
- detach.
29
-
30
- An explicit takeover remains `done -> join` in one transaction, whether the old seat is attached
31
- or detached. It transfers the name to the new owner with a fresh generation; old cleanup and
32
- recovery cannot reclaim it.
33
-
34
- ## Captured handles and restoration
35
-
36
- A `Square` captures no participant identity. `participant(name, {owner})` selects an attached,
37
- standing seat held by that exact owner without joining; never-joined, done, foreign and detached
38
- seats refuse with join recovery facts, not ghost handles. `seatsOf(owner)` is a read-only discovery
39
- surface for the owner's standing seats as `{name, generation, attachment}`. It includes attached and
40
- detached seats, but does not join or return done participants. See [square-api.md](square-api.md)
41
- for resource lifetimes and adapter selection.
42
-
43
- - `join(name, {owner, wakeAddress?})` atomically establishes membership and its seat when absent.
44
- A same-owner reconnect preserves the establishing generation. On a detached seat it also
45
- reattaches, using the operation's supplied wake address, and returns `reconnected`, with no
46
- activity, new read horizon or listening changes. A foreign owner gets `already_joined`; takeover
47
- must be explicit.
48
- - `reattach(name, {owner, wakeAddress?})` returns a handle for an exact-owner standing seat, or
49
- `null` for absent, foreign or done custody; it never creates membership. A foreign takeover racing
50
- the transaction can instead refuse. It can also refresh an attached seat's wake address subject to
51
- native-route preference. Host start/resume restores only detached seats found through
52
- `seatsOf(owner)` before arming delivery. One unavailable location or
53
- failed reattachment does not block the others. A new or forked session has a different owner and
54
- restores nothing. Hosts never infer restoration from a historical departure.
55
- - Participant mutations require both the captured generation and an attached current seat.
56
- Detach suspends existing handles; they cannot express, catch, listen, leave or change
57
- deferrals until reattachment. Rejoin/takeover fences old handles permanently, even if the same
58
- owner later reacquires the name. Host cleanup checks owner and generation inside its transaction;
59
- stale, foreign, done or already-detached detach changes nothing. Host `cancelDeliveries` also
60
- requires the captured owner/generation and an attached current seat; it does not consume activity.
61
-
62
- The HOME index supplies candidate paths only. Successful file-backed joins and non-null
63
- reattachments attempt best-effort publication; opening or expressing does not publish. Losing the
64
- index may delay restoration or delivery but cannot transfer a seat, erase delivery evidence or
65
- consume unread activity. A wake address is transport readiness for an attached seat, not an
66
- alternative ownership fact.
67
-
68
- ## Independent delivery deferrals
69
-
70
- `deferDelivery`, `renewDeliveryDeferral`, and `releaseDeliveryDeferral` require the same captured,
71
- attached current seat. Independent artifact-owned leases belong to one participant and generation,
72
- separately from catch ownership, delivery claims and receipts. Each has a fresh opaque ID, validated
73
- metadata match and expiry. It is not an acknowledgement intent or an activity.
74
-
75
- Each lease's nested own-property scalar equalities combine with AND; matching active leases combine
76
- with OR. Renewal cannot revive an expired lease. Release touches only its named live lease and
77
- returns false for an absent/expired ID. A current owner cannot use another participant's ID.
78
- Expiry is checked live. Detach, done, takeover and rejoin clear deferrals in the same transaction;
79
- reattachment never revives an old lease.
80
-
81
- Deferrals change only proactive eligibility. They preserve audience, history, unread counts and
82
- explicit catch. A caught record is not replayed after release. Producers, observers, claims and
83
- final send/presentation gates all require attached current custody and apply the same deferral
84
- policy. Neither detach nor a deferral can recall an already-dispatched external message.
85
-
86
- ## Acceptance boundaries
87
-
88
- Tests exercise foreign/stale/detached handles, same-owner restoration with unread activity intact,
89
- voluntary leave, explicit takeover, permanent deletion, exact-owner adapter lifecycle, generation
90
- fences and delivery eligibility. Assertions belong to authoritative facts, not helper ordering or
91
- display copy.
3
+ Membership and host attachment are distinct. Square owns the standing participant, opaque owner,
4
+ join generation, listens and read horizon. The host delivery ledger owns session attachment and
5
+ routes; it does not own membership. An owner is not an authentication credential.
6
+
7
+ `done` ends membership and outgoing listens. After the leave commits, Square best-effort withdraws
8
+ matching posted cards for that captured participant and join generation when they are not already in
9
+ ledger custody. It does not consume producer history or recall an in-custody effect. Cleanup failure
10
+ does not undo the leave or make it retry. A later join establishes a fresh generation; explicit takeover fences the
11
+ previous owner and generation. Host end only detaches the ledger session:
12
+ the participant remains away without a timeout, retains audience and unread activity, and cannot
13
+ write or receive proactive delivery. Start/resume attaches the ledger session, not individual seats;
14
+ there are no seat restore or detach hooks. A voluntary departure or takeover is never resurrected.
15
+ Host-confirmed deletion marks the ledger session deleted; the next privileged mutating Square
16
+ operation reconciles it and lands a generation-fenced `done`. Read-only history, status and
17
+ participants do not perform that mutation.
18
+
19
+ Participant handles capture owner and join generation; stale, departed or replaced custody refuses.
20
+ Sandbox selection and exact ACK authorize against locally known World custody alone,
21
+ without requiring access to the user ledger. This is not proof of current host attachment: a ledger-only
22
+ detach or deletion is learned at the next privileged producer reconciliation. A local control never
23
+ grants host delivery authority or revives a deleted session; export checks the actual ledger state.
24
+
25
+ Exact future ACK is producer-owned and recipient-scoped; see [square-api.md](square-api.md).
26
+ Proactive delivery suppression belongs in the host delivery ledger; see
27
+ [delivery-primitives.md](delivery-primitives.md).
@@ -1,58 +1,21 @@
1
1
  # Pi shared native delivery
2
2
 
3
- The shipped `plugins/pi/square-pi.js` remains the **only Square Pi extension**.
4
- Both its activity steer and advisory `nextTurn` send call the SDK-free shared
5
- `sendPiMessage` leaf compiled from `packages/agent-delivery/src`. Square keeps
6
- framing, custom type, display, preview/UI, observation/presentation evidence,
7
- uncertain-landing and canceled-batch suppression; the leaf neither schedules nor tracks.
8
-
9
- Pi injection and external wake injection acquire mutually exclusive artifact-owned content custody.
10
- An accepted or uncertain Paseo wake suppresses native Pi reinjection without asserting presentation
11
- or consumption. Only proven failed/released attempts can return to the automatic queue. Missing
12
- landing events, thrown sinks and expired claims do not authorize replay. Renderer details describe
13
- only the batch that won custody, not the earlier observed inbox. Budget-omitted activities belong to
14
- that same delivered batch: the omission line settles their presentation as `clipped`, without a
15
- full-consumption receipt. They stay available to explicit catch, but never get paged into later
16
- model completions or replayed on extension reload. See `delivery-primitives.md`.
17
-
18
- For independent existing-session delivery, opt into its local receiver:
19
-
20
- ```sh
21
- mkdir -m 700 /private/path/delivery
22
- pi --agent-delivery-socket /private/path/delivery/p.sock
23
- ```
24
-
25
- The parent must already be private and caller-owned. Explicit macOS Unix endpoint
26
- only; no discovery, registry, daemon or second extension. The flag is read lazily
27
- at session start. Missing flag creates no socket. Occupied paths fail closed.
28
- Session replacement closes outstanding connections and rebinds the same endpoint
29
- to the new identity; old targets reject.
30
-
31
- `observed` / `message_end` means only the matching native extension event was seen.
32
- Pi 1.1.0 emits that event before final append. It is **not durable admission,
33
- final append, model processing, completion or display**. No branch polling or
34
- cross-extension transform compatibility is promised.
35
-
36
- Standalone extensions can register `createPiReceiver` from the package's `./pi`
37
- subpath and use `sendPiMessage` directly. Factory registration creates no
38
- resources; start/shutdown own them. Session replacement and shutdown await the
39
- pending observer's retirement, including cleanup already begun by run cancellation.
40
- Cancellation releases native landing waits; it does not leave the observer running
41
- behind a completed lifecycle hook. Restart after cancellation waits for the old
42
- observer before opening its successor. Shutdown waits for in-flight automatic
43
- startup before ending that session, and awaits the session-end work. Raw SDK hosts
44
- must emit and await `session_shutdown` before `dispose()`;
45
- disposal alone does not retire extension-owned observers or receivers.
46
-
47
- Transport frame/key constraints, client
48
- `connectExisting`/`sendText` usage, receipt states, bounds and the exact validated
49
- runtime evidence live in `@astrosheep/agent-delivery` `README.md` and
50
- `VALIDATION.md`. Reproducer:
51
-
52
- ```sh
53
- npm run build
54
- node --import ./test/sandbox-env.js packages/agent-delivery/test/pi-runtime.mjs /absolute/installed/pi-1.1.0-package-root
55
- ```
56
-
57
- No real accounts/settings/sessions are used. Terminal keystrokes/rendering, other
58
- Pi builds and platforms are not dynamically validated.
3
+ `plugins/pi/square-pi.js` is the Square Pi extension. It watches the host delivery ledger and uses
4
+ the shared Pi send leaf for native injection. A receiver-pull presentation and producer-push handoff
5
+ compete through ledger attempt state, not route declarations. Accepted or uncertain handoff is not a
6
+ presentation receipt and must not be blindly replayed. The boundary's bounded batch renderer records
7
+ receipts only for presented cards. Square folds a receipt into read state only when its activity card
8
+ contained the full body; shortened cards point to catch.
9
+
10
+ Display items come directly from validated producer-neutral card details (`origin`, optional `author`,
11
+ `ref` and `badge`, and full Markdown `body`). Display never opens Square history. Missing or invalid
12
+ details fall back to card text. Model-facing reminder text is unchanged, and a full display body does
13
+ not make a shortened model-facing card eligible to consume producer unread activity.
14
+
15
+ Pi session start and shutdown attach and detach the ledger session, not Square seats. Interactive
16
+ cancellation suppresses outstanding local deliveries without marking activity seen; activity after
17
+ cancellation can notify normally. A send already past its final check cannot be recalled.
18
+
19
+ The `message_end` event is a native observation, not proof of model comprehension or final durable
20
+ append. Independent existing-session Pi delivery, socket constraints and runtime evidence are in
21
+ [agent-delivery's README](../packages/agent-delivery/README.md) and `VALIDATION.md`.
@@ -37,14 +37,12 @@ Use `catch` for consumption or `history` for archives. Exact parameters and sema
37
37
  come from the tool descriptions, shared with MCP through `square-tools.ts`.
38
38
 
39
39
  Each operation owns and closes its connection through the facade, including cancellation cleanup.
40
- Pi `session_shutdown` detaches that exact owner's seats, not membership: no `done` lands, listens
41
- and the read horizon remain, and mentions received while away stay unread. Catch ownership,
42
- deferrals and wake readiness are cleared. Detached participants cannot write or receive proactive
43
- delivery. On `session_start`, before watching, the extension uses `seatsOf(owner)` to discover only
44
- that exact owner's detached standing seats and `reattach(name, {owner, wakeAddress?})` to restore them.
45
- One failed seat/location does not block the others. New/forked harness owners restore nothing, voluntary
46
- `done` is never revived, and away has no timeout. Permanent deletion is a separate host-confirmed
47
- membership ending; Pi shutdown is not such proof. See [participant-ownership.md](participant-ownership.md).
40
+ Pi `session_shutdown` detaches that exact owner's ledger session without ending membership: no `done`
41
+ lands, listens and the read horizon remain, and mentions received while away stay unread. Detached
42
+ participants cannot write or receive proactive delivery. `session_start` attaches the same owner in the
43
+ ledger before watching; it does not restore individual seats. New/forked harness owners do not inherit
44
+ another owner's membership, voluntary `done` is never revived, and away has no timeout. Permanent
45
+ deletion is a separate host-confirmed membership ending; Pi shutdown is not such proof. See [participant-ownership.md](participant-ownership.md).
48
46
 
49
47
  Notification rendering remains independent of tool calls. Reload the extension after installing
50
48
  an updated package to register the tools in an existing Pi session.