granttap-mcp 0.8.195 → 0.8.197

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 (41) hide show
  1. package/README.md +133 -39
  2. package/THIRD_PARTY_LICENSES.txt +28 -0
  3. package/THIRD_PARTY_NOTICES.md +13 -0
  4. package/apps/bridge/src/approvals/cancellation/README.md +2 -0
  5. package/apps/bridge/src/approvals/cancellation/index.ts +4 -1
  6. package/apps/bridge/src/claude-open-questions/README.md +4 -0
  7. package/apps/bridge/src/codex-questions/README.md +6 -0
  8. package/apps/bridge/src/codex-questions/index.ts +8 -4
  9. package/apps/bridge/src/live-map/README.md +71 -0
  10. package/apps/bridge/src/live-map/classification/shell.ts +284 -0
  11. package/apps/bridge/src/live-map/classification/tools.ts +123 -0
  12. package/apps/bridge/src/live-map/index.ts +36 -0
  13. package/apps/bridge/src/live-map/observe.ts +119 -0
  14. package/apps/bridge/src/live-map/readers/claude.ts +84 -0
  15. package/apps/bridge/src/live-map/readers/codex.ts +98 -0
  16. package/apps/bridge/src/live-map/readers/entries.ts +44 -0
  17. package/apps/bridge/src/live-map/readers/shared.ts +108 -0
  18. package/apps/bridge/src/live-map/stream.ts +134 -0
  19. package/apps/bridge/src/live-map/tracker.ts +125 -0
  20. package/apps/bridge/src/monitor/handlers/inbound.ts +3 -0
  21. package/apps/bridge/src/monitor/support/runtime.ts +2 -0
  22. package/apps/bridge/src/provider-model-catalog/README.md +4 -2
  23. package/apps/bridge/src/provider-model-catalog/index.ts +11 -0
  24. package/apps/bridge/src/reply/README.md +12 -0
  25. package/apps/bridge/src/reply/index.ts +2 -2
  26. package/apps/bridge/src/reply/process/codex-headless.ts +3 -2
  27. package/apps/bridge/src/reply/process/provider-effort.ts +16 -0
  28. package/apps/mcp/src/mcp-tools/README.md +5 -1
  29. package/apps/mcp/src/mcp-tools/connect/relay.ts +71 -9
  30. package/apps/mcp/src/mcp-tools/interaction/questions.ts +16 -11
  31. package/cursor-plugin/.cursor-plugin/plugin.json +1 -1
  32. package/cursor-plugin/README.md +13 -5
  33. package/cursor-plugin/mcp.json +1 -1
  34. package/cursor-plugin/stdio-bootstrap.cjs +1 -1
  35. package/package.json +5 -2
  36. package/packages/protocol/messages/README.md +13 -0
  37. package/packages/protocol/messages/approvals.ts +3 -1
  38. package/packages/protocol/messages/interaction/index.ts +5 -1
  39. package/packages/protocol/messages/live-map/index.ts +84 -0
  40. package/packages/protocol/messages/primitives.ts +8 -0
  41. package/packages/protocol/schema.ts +4 -0
package/README.md CHANGED
@@ -6,11 +6,120 @@
6
6
 
7
7
  > **See what your coding agents are doing. Step in when they need you.**
8
8
 
9
- GrantTap connects local Claude Code and Codex work to a live control center on
10
- Mac, iPhone, iPad, and Apple Watch. See the Task and its latest activity, answer
11
- an approval or question with context, and continue the same goal as sessions or
12
- computers change. Cursor and Grok Build join the view where their local
13
- integrations support it.
9
+ GrantTap puts the coding agents running on your computer in your pocket. Approve
10
+ a tool call, answer a question, read the latest reply and send the next message
11
+ from iPhone, iPad or Apple Watch, while the agents and your provider sign-ins
12
+ stay on the computer. Claude Code and Codex have the full control path;
13
+ Cursor (Beta) and Grok Build join where their local integrations support it.
14
+
15
+ `granttap-mcp` is the part that runs on the computer: the `granttap` CLI, the MCP
16
+ server and connection card, provider hooks and a background helper. Pair it with
17
+ the GrantTap app, a free download on the App Store for iPhone and iPad.
18
+
19
+ <a href="https://apps.apple.com/app/id6809739366"><img src="https://toolbox.marketingtools.apple.com/api/v2/badges/download-on-the-app-store/black/en-us" alt="Download GrantTap on the App Store" height="40"></a>
20
+
21
+ **iPhone and iPad:** on the App Store, version 1.0.2. Plans are bought in the
22
+ app through Apple. **Apple Watch:** a companion to the iPhone app. **Mac:**
23
+ TestFlight now; on the Mac App Store after Apple approves it.
24
+
25
+ [Website](https://granttap.com) ·
26
+ [App Store](https://apps.apple.com/app/id6809739366) ·
27
+ [npm](https://www.npmjs.com/package/granttap-mcp) ·
28
+ [Security model](SECURITY.md) ·
29
+ [Relay source](https://github.com/sergii-ziborov/granttap-relay)
30
+
31
+ ## Quick start
32
+
33
+ On the computer where your agents run, with Node.js 22.13.0 or newer:
34
+
35
+ ```bash
36
+ npm install -g granttap-mcp
37
+ granttap setup
38
+ ```
39
+
40
+ 1. `granttap setup` finds Claude Code, Codex, Cursor and Grok Build on this
41
+ computer, installs or repairs their GrantTap hooks, starts the background
42
+ helper and, in an interactive terminal, shows a one-time pairing QR.
43
+ 2. Install [GrantTap from the App Store](https://apps.apple.com/app/id6809739366)
44
+ and scan that QR in **Devices → Add a device → Scan QR**. QR pairing needs no
45
+ account. With a GrantTap account, sign in with your passkey instead and use
46
+ **Connect with passkey** on the connection card to link this computer.
47
+ 3. Add the plugin for your coding app (see [Install](#install)) to get the
48
+ connection card and the tools in chat, and run `granttap status` at any time
49
+ for a read-only readiness check.
50
+
51
+ `npx granttap-mcp` only starts the stdio MCP server that the plugins launch. Run
52
+ `granttap setup` from the global install: the background helper and the local MCP
53
+ service need a durable path, not npm's temporary `npx` cache.
54
+
55
+ ## How the pieces fit
56
+
57
+ ```text
58
+ Your computer GrantTap Relay Your devices
59
+ Claude Code · Codex · Cursor · <=> ciphertext only: <=> GrantTap for iPhone and iPad
60
+ Grok Build + granttap-mcp routes, queues, wakes Apple Watch through iPhone
61
+ ```
62
+
63
+ - **GrantTap app** — where you see the work and decide: Now, Tasks, chats,
64
+ approvals, questions, Mesh and usage. iPhone and iPad on the App Store, Apple
65
+ Watch through iPhone, Mac in TestFlight.
66
+ - **GrantTap MCP** (this package) — runs beside your agents. It reads their
67
+ native sessions, enforces approvals in their hooks, delivers your messages and
68
+ answers, and serves the MCP tools and connection card.
69
+ - **[GrantTap Relay](https://github.com/sergii-ziborov/granttap-relay)** —
70
+ carries end-to-end encrypted traffic between the two and keeps it while a
71
+ device is asleep or offline. It sees routing metadata and ciphertext, never the
72
+ content. Its source is public.
73
+
74
+ ## What's new
75
+
76
+ Available now, with GrantTap MCP 0.8.197 on npm and GrantTap 1.0.2 on the App Store:
77
+
78
+ - **Phones on the connection card.** In Claude (including the Claude desktop app),
79
+ Codex, Cursor and Grok Build, the GrantTap card lists every phone paired with
80
+ this computer and when it last reached it, and removes unused ones after a yes
81
+ on a phone.
82
+ - **Runs linked to the chat that started them.** A `codex exec`, `claude -p` or
83
+ `grok -p` run that a chat starts, directly or from a script such as an image
84
+ job, names that chat, and its end is spelled out: `Codex stopped: …` with
85
+ Codex's reason, such as a usage limit, or `Picture saved: …`.
86
+ - **Passkey link.** `connect_with_passkey` links this computer to your GrantTap
87
+ account through granttap.com; existing QR pairings stay as they are.
88
+ - **Automatic runtime updates.** The helper checks for a new version every hour
89
+ and switches when running work allows, usually taking a chat's running turn
90
+ along and never dropping a waiting message. Switch it off on the connection
91
+ card.
92
+ - **End-to-end encrypted relay.** Messages, approvals and catalogs travel as
93
+ ciphertext; a relay wake carries no task content.
94
+ - **In the app (1.0.2):** rename, star and flag chats; edit a Mesh's
95
+ repositories from the phone; choose a New Task's Mesh from a searchable list;
96
+ see a chat's reasoning effort on the model button.
97
+
98
+ Coming in the next iPhone and iPad update (1.0.3), after Apple approves it. This
99
+ package already supports the computer side:
100
+
101
+ - runs a chat started hang beneath it in Now, Tasks and History, with how each ended;
102
+ - review a chat's uncommitted changes and commit chosen files from the phone;
103
+ - **Devices** lists every phone a computer accepts and everything signed in to
104
+ your account, with Remove and Sign out;
105
+ - passkey sign-in on the app's first screen, and sign-in on granttap.com by
106
+ scanning the QR on its account page.
107
+
108
+ ## Start here
109
+
110
+ - [What the runtime does](#what-the-runtime-does)
111
+ - [Connect your computer and devices](#account-mesh-and-devices)
112
+ - [Choose a connection mode and plan](#plans-and-what-you-pay-for)
113
+ - [Provider support](#supported-providers)
114
+ - [Install provider integrations](#install)
115
+ - [Messages, queues and decisions](#messages-queues-and-decisions)
116
+ - [Project Mesh and task transfer](#project-mesh-and-task-handoff)
117
+ - [Approvals and questions](#decisions-and-claude-questions)
118
+ - [Security and relay boundary](#relay-boundary)
119
+ - [Troubleshooting and help](#troubleshooting-and-help)
120
+ - [License](#license)
121
+
122
+ ## What the runtime does
14
123
 
15
124
  This repository supplies the local runtime: CLI, MCP server, provider hooks,
16
125
  adapters, and wire contracts. It powers Project Mesh, Governance, and observed
@@ -43,28 +152,9 @@ Managed service use requires authorized GrantTap account access; official TestFl
43
152
  access remains free. Earlier releases through 0.8.75 retain their Apache-2.0
44
153
  permissions. The Apple apps, Engine, relay, and website have their own terms.
45
154
 
46
- [Website](https://granttap.com) ·
47
- [App Store](https://apps.apple.com/app/id6809739366) ·
48
- [npm](https://www.npmjs.com/package/granttap-mcp) ·
49
- [Security model](SECURITY.md) ·
50
- [Relay source](https://github.com/sergii-ziborov/granttap-relay)
51
-
52
- ## Start here
53
-
54
- - [Connect your computer and devices](#account-mesh-and-devices)
55
- - [Choose a connection mode and plan](#plans-and-what-you-pay-for)
56
- - [Provider support](#supported-providers)
57
- - [Install provider integrations](#install)
58
- - [Messages, queues and decisions](#messages-queues-and-decisions)
59
- - [Project Mesh and task transfer](#project-mesh-and-task-handoff)
60
- - [Approvals and questions](#decisions-and-claude-questions)
61
- - [Security and relay boundary](#relay-boundary)
62
- - [Troubleshooting and help](#troubleshooting-and-help)
63
- - [License](#license)
64
-
65
155
  ## Plans and what you pay for
66
156
 
67
- Planned US prices for the first commercial release:
157
+ US prices, sold through Apple in GrantTap for iPhone and iPad:
68
158
 
69
159
  | Plan | Monthly price | Managed publishing computers |
70
160
  | --- | ---: | ---: |
@@ -83,16 +173,17 @@ monthly at the price shown by Apple. To avoid renewal, cancel at least 24 hours
83
173
  before the trial ends in Apple's subscription settings.
84
174
  A local cache is not deleted when managed access ends.
85
175
 
86
- **GrantTap for iPhone and iPad is on the
87
- [App Store](https://apps.apple.com/app/id6809739366)** as a free download;
88
- subscriptions and Mac Local are sold through Apple. The Mac app is available by
89
- TestFlight invitation. Official TestFlight builds include all features without a
90
- purchase or subscription; a trial and TestFlight access are different forms of
91
- access. The App Store purchase sheet determines availability, localized prices,
92
- eligibility and terms.
176
+ **GrantTap for iPhone and iPad is a free download on the
177
+ [App Store](https://apps.apple.com/app/id6809739366)**; subscriptions are bought
178
+ in the app through Apple. GrantTap for Mac is in TestFlight now and comes to the
179
+ Mac App Store after Apple approves it. Official TestFlight builds include all
180
+ features without a purchase or subscription; a trial and TestFlight access are
181
+ different forms of access. The App Store purchase sheet determines availability,
182
+ localized prices, eligibility and terms.
93
183
  Models, AI tokens and coding-provider plans are purchased separately.
94
184
 
95
- **Mac Local is a separate $39.99 one-time purchase** for local control and an
185
+ **Mac Local is a separate $39.99 one-time purchase** in the Mac app, offered once
186
+ the Mac app is on the App Store, for local control and an
96
187
  own relay. Hosted managed delivery is not included in that purchase. An active
97
188
  Personal subscription already covers a managed Mac client; both purchases are
98
189
  not required for the same managed mode. npm distributes the computer runtime;
@@ -653,8 +744,8 @@ trust.
653
744
  | `reconnect` | After explicit confirmation, show a one-time QR to reconnect or add an independent controller device while retaining the current room |
654
745
  | `remove_phones` | Ask the person to remove paired phones that are no longer used, by `notSeenForDays` (never the phone heard from most recently; `connection_status` marks the 30-day ones `stale`) and/or `phoneIds` from `connection_status`; nothing is removed without a yes on a phone, and the phone that answers, any phone heard from while the question is open, and the last phone stay |
655
746
  | `notify` | Send a non-blocking status of at most 2,000 characters that nobody answers, and/or one task-scoped Mesh event |
656
- | `ask_yes_no` | Ask a yes/no question and wait about three minutes for the explicit answer; a timeout is neither yes nor no |
657
- | `ask` | Ask an open question and wait about three minutes for typed or spoken text |
747
+ | `ask_yes_no` | Ask a yes/no question and wait about three minutes for the explicit answer; a timeout, or the person declining to answer, is neither yes nor no |
748
+ | `ask` | Ask an open question and wait about three minutes for typed or spoken text; the person may decline, and the agent hears so at once |
658
749
  | `request_sign_in` | Send an https sign-in page to the phone, wait for the person, and deliver the browser's loopback redirect once to the port the CLI listens on; returns `completed`, `cancelled` or `timed_out`, never the page or the redirect's contents |
659
750
  | `offload_task` | Request moving the calling Task to a compatible computer in its Mesh, keeping provider, model, effort and visible conversation; requires Automatic computer transfers, and `action=status` or `action=cancel` acts only on the caller's own request |
660
751
 
@@ -959,8 +1050,9 @@ metadata and ciphertext, not provider credentials or task plaintext. Pairing
959
1050
  handoff uses a relay-visible random mailbox ID plus an independent transfer key
960
1051
  that stays in the QR.
961
1052
 
962
- APNs carries a content-neutral wake only. It contains no prompt, task title,
963
- command, path, request ID, or ciphertext. See [SECURITY.md](SECURITY.md) for the
1053
+ An APNs wake is content-neutral. It contains no prompt, task title, command,
1054
+ path, request ID, or ciphertext. A task Live Activity update carries its
1055
+ preview to APNs only as ciphertext, which the phone decrypts. See [SECURITY.md](SECURITY.md) for the
964
1056
  complete boundary and reporting instructions.
965
1057
 
966
1058
  ## Troubleshooting and help
@@ -982,8 +1074,10 @@ complete boundary and reporting instructions.
982
1074
  - **Health has no current architecture:** check the reported checkout and Engine
983
1075
  on the publishing computer, then request a rebuild. An old or partial report
984
1076
  remains inspectable and must not be treated as verified current architecture.
985
- - **No purchase shown:** the product may not be released in that storefront.
986
- TestFlight does not require a purchase. Use Restore Purchases for an existing
1077
+ - **No purchase shown:** plans are sold in the iPhone and iPad app; Mac Local
1078
+ appears in the Mac app once it is on the App Store. A storefront where
1079
+ GrantTap is not offered shows no purchase, and TestFlight does not require
1080
+ one. Use Restore Purchases for an existing
987
1081
  Apple purchase and the same GrantTap passkey for account access.
988
1082
 
989
1083
  Update the helper with `npm install -g granttap-mcp@latest`, then reopen the
@@ -2832,3 +2832,31 @@ Redistributions in binary form must reproduce the above copyright notice, this l
2832
2832
 
2833
2833
  THIS IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS,
2834
2834
  EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
2835
+
2836
+
2837
+ lot-map 340b98505c66372ecac13314a82ef4df92ff8640 — MIT (ported source, not a dependency)
2838
+ Source: https://github.com/alexeyw/lot-map
2839
+ The station names and the rules that read a tool call or a shell command line for its station are
2840
+ ported into apps/bridge/src/live-map/classification/ and packages/protocol/messages/live-map/.
2841
+
2842
+ MIT License
2843
+
2844
+ Copyright (c) 2026 Aleksei Volodin
2845
+
2846
+ Permission is hereby granted, free of charge, to any person obtaining a copy
2847
+ of this software and associated documentation files (the "Software"), to deal
2848
+ in the Software without restriction, including without limitation the rights
2849
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
2850
+ copies of the Software, and to permit persons to whom the Software is
2851
+ furnished to do so, subject to the following conditions:
2852
+
2853
+ The above copyright notice and this permission notice shall be included in all
2854
+ copies or substantial portions of the Software.
2855
+
2856
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
2857
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
2858
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
2859
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
2860
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
2861
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
2862
+ SOFTWARE.
@@ -29,6 +29,19 @@ including `mcport` (MIT), `blazingly-json` (MIT), `serde` (MIT OR Apache-2.0), a
29
29
  BlindPlane crates (MIT OR Apache-2.0). Binary distributions must retain the
30
30
  complete license texts required by the exact dependency versions they contain.
31
31
 
32
+ ## Ported source: lot-map
33
+
34
+ The live map's ten stations and the rules that read a tool call or a shell
35
+ command line for its station are ported from
36
+ [lot-map](https://github.com/alexeyw/lot-map) by Aleksei Volodin (MIT,
37
+ commit `340b985`), a Claude Code mod that draws the same map in a pane beside
38
+ the chat. The ported code is in `apps/bridge/src/live-map/classification/`
39
+ and the station list in `packages/protocol/messages/live-map/`; each file
40
+ names its origin, and `THIRD_PARTY_LICENSES.txt` keeps lot-map's copyright and
41
+ license text. Those portions remain under the MIT license; the GrantTap
42
+ first-party license does not apply to them. GrantTap does not ship or run the
43
+ mod itself.
44
+
32
45
  ## Optional SweepLoom integration
33
46
 
34
47
  Provider storage inspection may invoke a separately installed SweepLoom CLI
@@ -4,5 +4,7 @@
4
4
  Ending that process cancels the durable request, publishes its terminal state
5
5
  and releases the waiter. Cancellation never manufactures an Allow or answers a
6
6
  question. Other live approval registrations and shared clients remain intact.
7
+ A string abort reason, such as a phone declining a yes/no question, becomes the
8
+ terminal note; otherwise the note says the agent stopped waiting.
7
9
 
8
10
  License: GrantTap Commercial Source License, in the repository-root `LICENSE`.
@@ -7,9 +7,12 @@ export function attachApprovalCancellation(client: RelayClient, request: Approva
7
7
  signal?: AbortSignal; handle?: ApprovalRegistrationHandle; cancel: () => void; close?: () => void;
8
8
  }): () => void {
9
9
  const abort = () => {
10
+ // The owner may say why it stopped waiting, such as the person declining on the phone.
11
+ const reason = options.signal?.reason;
12
+ const note = typeof reason === "string" && reason ? reason : "The agent stopped waiting for this answer.";
10
13
  try {
11
14
  const terminal = markApprovalTerminal(request.requestId, "cancelled", { decision: "deny",
12
- decidedBy: "cancelled", note: "The agent stopped waiting for this answer.", sessionId: request.sessionId }, Date.now(), options.handle);
15
+ decidedBy: "cancelled", note, sessionId: request.sessionId }, Date.now(), options.handle);
13
16
  if (terminal.outcome) void sendApprovalResolved(client, resolvedFromOutcome(terminal.outcome, terminal.request)).catch(() => {});
14
17
  } catch { /* Storage failure must still release the owned provider waiter. */ }
15
18
  finally { options.cancel(); options.close?.(); }
@@ -12,6 +12,10 @@ trailing `• ` choices; desktop app actions (commit, merge…) are left out bec
12
12
  only the desktop app runs them. The answer is an ordinary message to that chat,
13
13
  so current provider, pause, Task policy, the queue and receipts all apply.
14
14
 
15
+ These cards do not advertise a decline: the chat has already ended its turn, so
16
+ no agent waits for one. A phone may hide the card for itself; the chat still
17
+ holds the question until the person answers it.
18
+
15
19
  A later message from the person closes the card on every device: typed at the
16
20
  computer, a desktop button, or the phone reply itself. A newer question replaces
17
21
  an older one. Records survive monitor restart and are replayed when a phone
@@ -13,6 +13,12 @@ wake notification. A native answer clears the corresponding card across devices.
13
13
  After a day, a GrantTap card expires without claiming the native question was
14
14
  answered. The Codex conversation remains the source of truth.
15
15
 
16
+ Cards advertise `questionDecline: decline-v1`. A phone that declines sends that
17
+ marker on its reply; Codex then receives a fixed answer saying the person chose
18
+ not to answer, through the same native item and delivery, never the phone's own
19
+ text or files. An older phone never sends the marker; an older computer never
20
+ advertises it, so the phone offers only its local hide.
21
+
16
22
  Replies use the original host question item ID and normal scoped phone delivery,
17
23
  including current provider, pause and Task policy. Native admission uses one
18
24
  stable delivery ID per question, so concurrent controllers cannot submit two
@@ -9,6 +9,8 @@ import { observedQuestions } from './source';
9
9
  export { codexQuestionText } from './observations';
10
10
 
11
11
  const RETENTION_MS = 24 * 60 * 60_000;
12
+ /** What Codex is told when the person declines: the native question still needs an answer to go on. */
13
+ export const DECLINED_ANSWER = 'The person chose not to answer this question. Continue without their answer.';
12
14
 
13
15
  /** Phone questions travel as device-encrypted control events, independently of task-key grants. */
14
16
  export async function publishCodexQuestions(client: RelayClient, sessions: SessionInfo[],
@@ -54,7 +56,7 @@ export async function publishCodexQuestions(client: RelayClient, sessions: Sessi
54
56
  } else if (!record.announced || options.replay) {
55
57
  const text = [record.question, ...record.options.map(value => '• ' + value)].join('\n');
56
58
  await client.send({ type: 'agent.event', kind: 'question', requestId: record.requestId,
57
- questionReplyFormat: 'attachments-v1',
59
+ questionReplyFormat: 'attachments-v1', questionDecline: 'decline-v1',
58
60
  sessionId: session.sessionId, agent: 'codex', projectId: session.projectId,
59
61
  taskId: session.taskId, computerId: session.computerId, text, createdAt: record.createdAt },
60
62
  'phone', { ttlMs: Math.max(1, record.createdAt + RETENTION_MS - Date.now()),
@@ -103,11 +105,13 @@ export async function handleCodexQuestionReply(client: RelayClient, message: Use
103
105
  return true;
104
106
  }
105
107
  const hasAttachments = !!(message.attachments?.length || message.attachmentRefs?.length);
106
- if (!message.text.trim() || message.text.length > 4_000
108
+ // A decline carries no words or files of the person's; Codex gets the fixed answer instead.
109
+ const declined = message.questionDecline === 'decline-v1';
110
+ if (declined ? hasAttachments : !message.text.trim() || message.text.length > 4_000
107
111
  || (hasAttachments && message.questionReplyFormat !== 'attachments-v1')) return false;
108
- return deliver(client, { ...message, requestId: undefined,
112
+ return deliver(client, { ...message, requestId: undefined, questionDecline: undefined,
109
113
  messageId: message.messageId ?? 'codex-answer-' + record.requestId,
110
- text: nativeAnswerEnvelope(record, message.text) }, publish, peerPublicKey,
114
+ text: nativeAnswerEnvelope(record, declined ? DECLINED_ANSWER : message.text) }, publish, peerPublicKey,
111
115
  { messageId: record.requestId, questionReply: true });
112
116
  }
113
117
 
@@ -0,0 +1,71 @@
1
+ # Live map
2
+
3
+ Public entry: `index.ts`. While a phone has a chat's live map open, this computer
4
+ sends it a compact stream of what the chat's agent does, by name only, and the
5
+ phone draws it: the agent in the centre, ten stations around it, a pulse along a
6
+ spoke for each call. The idea and the station rules come from
7
+ [lot-map](https://github.com/alexeyw/lot-map) (MIT, Aleksei Volodin), a Claude
8
+ Code mod that draws the same map beside the chat on the same computer. GrantTap
9
+ does not ship or run the mod; it reads the records it already reads for every
10
+ provider and the phone draws the map. See `THIRD_PARTY_NOTICES.md`.
11
+
12
+ ## Contract
13
+
14
+ The phone sends `session.pulses.subscribe { sessionId, active }` in its device
15
+ box when the map opens and renews it every few seconds; `active: false` or
16
+ twenty seconds without a renewal ends it. A renewal after more than ten seconds
17
+ of silence is a map opened again whose close was lost, and starts from a replay.
18
+ At most four maps are fed at once, a fifth taking the place of the oldest. Only the routing monitor answers.
19
+
20
+ Each open map gets at most one `session.pulses` frame a second, and one every
21
+ five seconds when nothing happens, so the phone can tell the map is live. A
22
+ frame holds at most 48 pulses and 12 KB; what does not fit is counted in
23
+ `dropped`, the newest kept. `running` names every call still at work, so a
24
+ phone that missed a frame ends what no longer runs; `counts` are each station's
25
+ calls in the chat's window, for the worn spokes. The first frame of a
26
+ subscription is a `replay` of the chat's last 24 pulses.
27
+
28
+ A pulse is a station, a name, `start`/`end`/`done`, `run`/`ok`/`error`/`blocked`,
29
+ its time and duration, a subagent's digest, how many run at that station at
30
+ once, and a `mark` for moments that are not calls: the person's message, the
31
+ answer, a model step or change, a compaction, the hook asking for approval.
32
+ The frame adds the model's name and, where the provider reports the window
33
+ (Codex), the share of the context window; for Claude only its tokens.
34
+
35
+ Frames travel under the chat's own key to the phone that asked, `reliable:
36
+ false` with a ten-second lifetime: never into the relay's mailbox, and in the
37
+ replaceable lane, so they cannot go ahead of an answer and are the first to
38
+ give way when the upload backs up. The chat's key is granted once per
39
+ subscription.
40
+
41
+ ## What leaves and what does not
42
+
43
+ The readers (`readers/`) take a chat's recent records: the last 768 KB of a
44
+ Claude or Codex file and 256 KB of each of up to three Claude subagent files
45
+ written in the last fifteen minutes, read again only when the file's size or
46
+ time changed; Cursor and Grok Build from the rows GrantTap already reads. The
47
+ classifiers (`classification/`) read a call's input to choose its station:
48
+ a shell line for the command it runs (`curl` is Network, `rg` is Files), a path
49
+ for Claude's or Codex's memory folder. A result is read only for an exit code or
50
+ for words that say a hook or the person refused it.
51
+
52
+ What leaves is a tool's name (`Bash`, `exec command`, `github: create issue`), a
53
+ skill's or agent type's name when it is a plain identifier, and a model's id.
54
+ Never an argument, path, host, command line, description, prompt, result or
55
+ message text. Provider call and subagent ids are replaced by digests.
56
+
57
+ ## Stations
58
+
59
+ `you` (messages, questions, plans and to-dos, GrantTap's own ask and notify),
60
+ `model` (each step, a compaction, a change of model), `memory`, `files`,
61
+ `shell`, `web` (Network: fetch, search, MCP servers, network commands),
62
+ `browser`, `agents`, `skills`, `hooks` (an approval GrantTap's hook asked for).
63
+ lot-map's Claude Code names are kept, and Codex (`exec_command`, `apply_patch`,
64
+ `update_plan`, `spawn_agent`, `web_search_call`), Cursor (`Shell`, `StrReplace`,
65
+ `CallMcpTool`) and Grok Build (`bash`, `read_file`) names are added.
66
+
67
+ Tests live in `tests/`, including a round trip between a real computer and
68
+ phone `RelayClient` through a relay that sees only ciphertext.
69
+
70
+ GrantTap Commercial Source License, except the ported lot-map portions, which
71
+ remain MIT; see the repository LICENSE and THIRD_PARTY_NOTICES.md.