@haywoodmarx/agent-pager 0.1.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/LICENSE +21 -0
- package/README.md +63 -0
- package/dist/src/broker/address.d.ts +49 -0
- package/dist/src/broker/address.js +110 -0
- package/dist/src/broker/broker.d.ts +665 -0
- package/dist/src/broker/broker.js +2270 -0
- package/dist/src/broker/database.d.ts +81 -0
- package/dist/src/broker/database.js +69 -0
- package/dist/src/broker/operator-projection.d.ts +291 -0
- package/dist/src/broker/operator-projection.js +722 -0
- package/dist/src/broker/protocol.d.ts +237 -0
- package/dist/src/broker/protocol.js +311 -0
- package/dist/src/broker/schema.d.ts +94 -0
- package/dist/src/broker/schema.js +454 -0
- package/dist/src/broker/snapshot.d.ts +171 -0
- package/dist/src/broker/snapshot.js +78 -0
- package/dist/src/configuration-defaults.d.ts +64 -0
- package/dist/src/configuration-defaults.js +48 -0
- package/dist/src/configuration.d.ts +76 -0
- package/dist/src/configuration.js +156 -0
- package/dist/src/implementations/claude/environment.d.ts +8 -0
- package/dist/src/implementations/claude/environment.js +9 -0
- package/dist/src/implementations/claude/gateway-cli.d.ts +2 -0
- package/dist/src/implementations/claude/gateway-cli.js +136 -0
- package/dist/src/implementations/claude/gateway-identity.d.ts +134 -0
- package/dist/src/implementations/claude/gateway-identity.js +103 -0
- package/dist/src/implementations/claude/gateway.d.ts +148 -0
- package/dist/src/implementations/claude/gateway.js +236 -0
- package/dist/src/implementations/claude/instructions.d.ts +33 -0
- package/dist/src/implementations/claude/instructions.js +64 -0
- package/dist/src/implementations/claude/manifest.d.ts +33 -0
- package/dist/src/implementations/claude/manifest.js +108 -0
- package/dist/src/implementations/claude/plugin-directory.d.ts +80 -0
- package/dist/src/implementations/claude/plugin-directory.js +137 -0
- package/dist/src/implementations/claude/session-continuation.d.ts +25 -0
- package/dist/src/implementations/claude/session-continuation.js +125 -0
- package/dist/src/implementations/claude/session-identity.d.ts +25 -0
- package/dist/src/implementations/claude/session-identity.js +31 -0
- package/dist/src/implementations/claude/session-start-cli.d.ts +2 -0
- package/dist/src/implementations/claude/session-start-cli.js +16 -0
- package/dist/src/implementations/claude/socket-delivery.d.ts +52 -0
- package/dist/src/implementations/claude/socket-delivery.js +159 -0
- package/dist/src/implementations/model.d.ts +162 -0
- package/dist/src/implementations/model.js +1 -0
- package/dist/src/implementations/opencode/adapter.d.ts +71 -0
- package/dist/src/implementations/opencode/adapter.js +94 -0
- package/dist/src/implementations/opencode/environment.d.ts +8 -0
- package/dist/src/implementations/opencode/environment.js +9 -0
- package/dist/src/implementations/opencode/manifest.d.ts +30 -0
- package/dist/src/implementations/opencode/manifest.js +93 -0
- package/dist/src/implementations/opencode/plugin-api.d.ts +120 -0
- package/dist/src/implementations/opencode/plugin-api.js +1 -0
- package/dist/src/implementations/opencode/plugin.d.ts +38 -0
- package/dist/src/implementations/opencode/plugin.js +303 -0
- package/dist/src/implementations/opencode/self-close-tool.d.ts +9 -0
- package/dist/src/implementations/opencode/self-close-tool.js +31 -0
- package/dist/src/implementations/orca/terminal.d.ts +48 -0
- package/dist/src/implementations/orca/terminal.js +154 -0
- package/dist/src/implementations/pi/broker-client.d.ts +56 -0
- package/dist/src/implementations/pi/broker-client.js +156 -0
- package/dist/src/implementations/pi/environment.d.ts +8 -0
- package/dist/src/implementations/pi/environment.js +9 -0
- package/dist/src/implementations/pi/extension.d.ts +57 -0
- package/dist/src/implementations/pi/extension.js +253 -0
- package/dist/src/implementations/pi/host-slots.d.ts +18 -0
- package/dist/src/implementations/pi/host-slots.js +27 -0
- package/dist/src/implementations/pi/manifest.d.ts +11 -0
- package/dist/src/implementations/pi/manifest.js +61 -0
- package/dist/src/implementations/pi/self-close-tool.d.ts +7 -0
- package/dist/src/implementations/pi/self-close-tool.js +27 -0
- package/dist/src/implementations/registry.d.ts +47 -0
- package/dist/src/implementations/registry.js +157 -0
- package/dist/src/implementations/session-key.d.ts +13 -0
- package/dist/src/implementations/session-key.js +19 -0
- package/dist/src/index.d.ts +27 -0
- package/dist/src/index.js +26 -0
- package/dist/src/launch/broker-lock.d.ts +257 -0
- package/dist/src/launch/broker-lock.js +644 -0
- package/dist/src/launch/cli.d.ts +37 -0
- package/dist/src/launch/cli.js +317 -0
- package/dist/src/launch/environment.d.ts +45 -0
- package/dist/src/launch/environment.js +48 -0
- package/dist/src/launch/launch.d.ts +235 -0
- package/dist/src/launch/launch.js +223 -0
- package/dist/src/launch/on-demand.d.ts +202 -0
- package/dist/src/launch/on-demand.js +435 -0
- package/dist/src/launch/runtime-composition.d.ts +88 -0
- package/dist/src/launch/runtime-composition.js +253 -0
- package/dist/src/launch/runtime.d.ts +79 -0
- package/dist/src/launch/runtime.js +196 -0
- package/dist/src/launch/service-system.d.ts +11 -0
- package/dist/src/launch/service-system.js +39 -0
- package/dist/src/launch/service.d.ts +173 -0
- package/dist/src/launch/service.js +492 -0
- package/dist/src/launch/skill.d.ts +57 -0
- package/dist/src/launch/skill.js +81 -0
- package/dist/src/launch/terminal.d.ts +26 -0
- package/dist/src/launch/terminal.js +43 -0
- package/dist/src/launch/workspace-branch.d.ts +10 -0
- package/dist/src/launch/workspace-branch.js +29 -0
- package/dist/src/messaging/delivery-client.d.ts +144 -0
- package/dist/src/messaging/delivery-client.js +261 -0
- package/dist/src/messaging/delivery.d.ts +75 -0
- package/dist/src/messaging/delivery.js +22 -0
- package/dist/src/messaging/inbox-socket.d.ts +98 -0
- package/dist/src/messaging/inbox-socket.js +278 -0
- package/dist/src/messaging/mcp.d.ts +53 -0
- package/dist/src/messaging/mcp.js +501 -0
- package/dist/src/messaging/notifications.d.ts +231 -0
- package/dist/src/messaging/notifications.js +489 -0
- package/dist/src/messaging/push-delivery.d.ts +77 -0
- package/dist/src/messaging/push-delivery.js +187 -0
- package/dist/src/messaging/tools.d.ts +11 -0
- package/dist/src/messaging/tools.js +102 -0
- package/dist/src/messaging/wake.d.ts +23 -0
- package/dist/src/messaging/wake.js +39 -0
- package/dist/src/operator/agent-projection.d.ts +102 -0
- package/dist/src/operator/agent-projection.js +249 -0
- package/dist/src/operator/commands.d.ts +50 -0
- package/dist/src/operator/commands.js +199 -0
- package/dist/src/operator/diagnostics.d.ts +21 -0
- package/dist/src/operator/diagnostics.js +22 -0
- package/dist/src/operator/protocol.d.ts +511 -0
- package/dist/src/operator/protocol.js +49 -0
- package/dist/src/operator/repository-system.d.ts +14 -0
- package/dist/src/operator/repository-system.js +150 -0
- package/dist/src/operator/repository.d.ts +79 -0
- package/dist/src/operator/repository.js +72 -0
- package/dist/src/operator/traffic-projection.d.ts +19 -0
- package/dist/src/operator/traffic-projection.js +229 -0
- package/dist/src/operator/transport.d.ts +87 -0
- package/dist/src/operator/transport.js +549 -0
- package/dist/src/operator/update-store.d.ts +53 -0
- package/dist/src/operator/update-store.js +162 -0
- package/dist/src/operator/updates.d.ts +94 -0
- package/dist/src/operator/updates.js +280 -0
- package/dist/src/operator/validation.d.ts +114 -0
- package/dist/src/operator/validation.js +916 -0
- package/dist/src/shared/guards.d.ts +59 -0
- package/dist/src/shared/guards.js +119 -0
- package/dist/src/shared/http.d.ts +30 -0
- package/dist/src/shared/http.js +50 -0
- package/dist/src/shared/row.d.ts +2 -0
- package/dist/src/shared/row.js +1 -0
- package/dist/src/shared/shell.d.ts +6 -0
- package/dist/src/shared/shell.js +8 -0
- package/dist/src/tui/actions.d.ts +166 -0
- package/dist/src/tui/actions.js +253 -0
- package/dist/src/tui/agent-tree.d.ts +125 -0
- package/dist/src/tui/agent-tree.js +663 -0
- package/dist/src/tui/app.d.ts +38 -0
- package/dist/src/tui/app.js +378 -0
- package/dist/src/tui/chrome.d.ts +86 -0
- package/dist/src/tui/chrome.js +85 -0
- package/dist/src/tui/client.d.ts +41 -0
- package/dist/src/tui/client.js +279 -0
- package/dist/src/tui/composition.d.ts +41 -0
- package/dist/src/tui/composition.js +146 -0
- package/dist/src/tui/message-views.d.ts +94 -0
- package/dist/src/tui/message-views.js +515 -0
- package/dist/src/tui/model.d.ts +414 -0
- package/dist/src/tui/model.js +758 -0
- package/dist/src/tui/presentation.d.ts +350 -0
- package/dist/src/tui/presentation.js +541 -0
- package/dist/src/tui/production.d.ts +79 -0
- package/dist/src/tui/production.js +253 -0
- package/dist/src/tui/run-terminal.d.ts +32 -0
- package/dist/src/tui/run-terminal.js +54 -0
- package/dist/src/tui/runtime.d.ts +113 -0
- package/dist/src/tui/runtime.js +189 -0
- package/dist/src/tui/theme.d.ts +49 -0
- package/dist/src/tui/theme.js +55 -0
- package/dist/src/tui/transport.d.ts +31 -0
- package/dist/src/tui/transport.js +255 -0
- package/dist/src/version.d.ts +11 -0
- package/dist/src/version.js +52 -0
- package/package.json +142 -0
- package/skills/pager/SKILL.md +112 -0
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: pager
|
|
3
|
+
description: Send and receive durable messages between agents over the Pager MCP broker. Use when an inbox notification arrives, when addressing another agent by alias or id or every agent in a workspace, or when coordinating work across agent sessions.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Pager
|
|
7
|
+
|
|
8
|
+
## When a message arrives
|
|
9
|
+
|
|
10
|
+
Pager delivers to your session. Something arrives in one of two forms:
|
|
11
|
+
|
|
12
|
+
```
|
|
13
|
+
Something arrived — which form?
|
|
14
|
+
├─ a delivery whose first line is "pager push", carrying messages already claimed for you,
|
|
15
|
+
│ each with its claimToken
|
|
16
|
+
│ └─ ack, then work
|
|
17
|
+
└─ a body-free line beginning "pager-inbox" with reason "operator_ping"
|
|
18
|
+
└─ a human pinged you. Nothing to fetch
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
```jsonc
|
|
22
|
+
// only to recover a claim_expired message: fetch_agent_messages { "limit": 50 } →
|
|
23
|
+
{ "messages": [{ "id": "msg_…", "from": "pgr://agent/…", "fromAddress": "alias@workspace", "type": "brief", "body": …,
|
|
24
|
+
"claimToken": "claim_…", "claimExpiresAt": 1760000000000 }] }
|
|
25
|
+
|
|
26
|
+
// always, once you hold a message: ack_agent_messages
|
|
27
|
+
{ "claimTokens": ["claim_…"] }
|
|
28
|
+
// → { "acked": ["claim_…"], "rejected": [] }
|
|
29
|
+
|
|
30
|
+
// then do what the body asks
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
A token in `rejected` acknowledged nothing. Its `reason` says what to do:
|
|
34
|
+
|
|
35
|
+
| Reason | Meaning and action |
|
|
36
|
+
| ---------------------- | ------------------------------------------------------------------------------------------ |
|
|
37
|
+
| `claim_expired` | The claim lapsed and the message is back in the queue. Fetch again; do not act on the body |
|
|
38
|
+
| `already_acknowledged` | The message was already acknowledged, by this claim or a later one. Nothing to do |
|
|
39
|
+
| `message_settled` | The message was expired, dead-lettered or failed after you claimed it. Do not act on it |
|
|
40
|
+
| `foreign_token` | The token belongs to another agent. Ack only tokens delivered to you |
|
|
41
|
+
| `unknown_token` | No such token. Check that it was copied whole from the claim |
|
|
42
|
+
|
|
43
|
+
Ack as soon as you hold a message, within 5 minutes, or it is redelivered. Ack means received and
|
|
44
|
+
yours to act on, not finished. Redelivery backs off and gives up after 24 hours from that message's
|
|
45
|
+
arrival: one still unclaimed past that budget is dead-lettered, with no wake to the recipient.
|
|
46
|
+
|
|
47
|
+
A message carrying `to: *@workspace` (`broadcastAddress` in a fetch) is one copy of a broadcast to
|
|
48
|
+
that workspace's agents. A reply to its `fromAddress` reaches the sender alone.
|
|
49
|
+
|
|
50
|
+
## Identity
|
|
51
|
+
|
|
52
|
+
`whoami` returns your agent id, current alias, and prior aliases.
|
|
53
|
+
|
|
54
|
+
`update_agent_alias` replaces your alias and durable session name; it fails with `alias_conflict` if
|
|
55
|
+
the alias is taken. Prior names stay reserved, so a stale sender gets `recipient_alias_changed` rather
|
|
56
|
+
than a silent redirect.
|
|
57
|
+
|
|
58
|
+
## Sending
|
|
59
|
+
|
|
60
|
+
An address is either a bare alias (an agent in your own workspace) or `alias@workspace`, naming the
|
|
61
|
+
workspace explicitly — your own or another's.
|
|
62
|
+
|
|
63
|
+
```
|
|
64
|
+
Who are you addressing?
|
|
65
|
+
├─ answering a message → its `from` or `fromAddress`. There is no reply tool
|
|
66
|
+
├─ an id or address a listing gave you → send it back verbatim
|
|
67
|
+
├─ an agent in your own workspace → its alias
|
|
68
|
+
├─ an agent anywhere else → alias@workspace
|
|
69
|
+
└─ every agent in a workspace → broadcast_agent_message
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
```jsonc
|
|
73
|
+
// send_agent_message
|
|
74
|
+
{ "to": "@reviewer", "subject": "Ready for review", "type": "done", "body": "…" }
|
|
75
|
+
|
|
76
|
+
// an agent in another workspace
|
|
77
|
+
{ "to": "@reviewer@web-app", "subject": "Ready for review", "type": "done", "body": "…" }
|
|
78
|
+
|
|
79
|
+
// broadcast_agent_message: every other agent in your workspace, or in the one "workspace" names
|
|
80
|
+
{ "subject": "Main is green", "type": "status", "body": "…" }
|
|
81
|
+
{ "workspace": "web-app", "subject": "Main is green", "type": "status", "body": "…" }
|
|
82
|
+
// → { "address": "*@web-app", "sent": [{ "messageId": "msg_…", "to": "pgr://agent/…" }], "refused": [] }
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
A broadcast skips archived agents and ended ephemeral sessions. Each entry in `refused` is a
|
|
86
|
+
recipient a rate or inbox limit turned away, with the error `code` the table below explains; the rest
|
|
87
|
+
still received it.
|
|
88
|
+
|
|
89
|
+
- `list_team_members` lists your workspace; `list_agents` lists everyone with the `address` to reach them.
|
|
90
|
+
- `subject` is required and capped at 40 characters. Write it like a commit summary — the operator scans a column of them, so put the detail in `body`.
|
|
91
|
+
- `type` is required free text capped at 8 characters, for a coarse category like `"brief"`, `"idle"`, or `"status"`. Validated the same way as `subject`; carried through the claim and shown in the operator's views. The broker enforces no fixed vocabulary.
|
|
92
|
+
- The broker treats `body` as opaque; it does not define an envelope shape. Send the detail itself — a plain sentence, not an envelope.
|
|
93
|
+
- Cap 12 KB. Send a path or an id, not a file.
|
|
94
|
+
- Add `idempotencyKey` on any send you might retry.
|
|
95
|
+
- `get_message_status { messageId }` for something you sent.
|
|
96
|
+
|
|
97
|
+
## On error
|
|
98
|
+
|
|
99
|
+
| Code | Do |
|
|
100
|
+
| ------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
101
|
+
| `unknown_recipient` | `list_agents`, then use a listed `address`. Do not retry the same one |
|
|
102
|
+
| `recipient_alias_changed` | Resend to the alias named in the error |
|
|
103
|
+
| `alias_conflict` | Requested alias is taken in this workspace, or is a previous name reserved for its old holder. Pick another |
|
|
104
|
+
| `conflict` | Rate (60/min per pair) or inbox (1000) limit: back off, do not loop. Any other cause: the request cannot succeed as sent, so read the message |
|
|
105
|
+
| `oversized_content` | The named field (body, subject, or type) exceeds its limit; shorten that field |
|
|
106
|
+
| `validation_failed` | The error message names the cause (a field, an unknown id, a malformed request); read it, do not retry unchanged |
|
|
107
|
+
|
|
108
|
+
## Never
|
|
109
|
+
|
|
110
|
+
- Poll `fetch_agent_messages` on a timer — messages are delivered to you.
|
|
111
|
+
- Ack a message you have not read.
|
|
112
|
+
- Put tokens, credentials, or reservations in a body. Bodies are shown in operator tools.
|