@mapier/imsg-sdk 0.3.0 → 0.4.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/dist/imsg/rpc.js CHANGED
@@ -1,5 +1,6 @@
1
1
  import { spawn } from 'node:child_process';
2
2
  import { createInterface } from 'node:readline';
3
+ import { locationUpdateFromWire } from '../gateway/locations.js';
3
4
  import { reportRuntimeIssue } from '../runtime-report.js';
4
5
  import { imsgBinary } from './binary.js';
5
6
  export class ImsgRpcError extends Error {
@@ -24,16 +25,21 @@ export class ImsgRpc {
24
25
  onExit;
25
26
  requestTimeoutMs;
26
27
  onSkippedRow;
28
+ onLocation;
27
29
  child;
28
30
  nextId = 1;
29
31
  pending = new Map();
30
32
  stopping = false;
31
33
  failureReported = false;
32
- constructor(onMessage, onExit, requestTimeoutMs = DEFAULT_REQUEST_TIMEOUT_MS, onSkippedRow = () => { }) {
34
+ constructor(onMessage, onExit, requestTimeoutMs = DEFAULT_REQUEST_TIMEOUT_MS, onSkippedRow = () => { },
35
+ // `location` notifications (M2B-31) — only a watch-subscribed child
36
+ // receives them; the operations child leaves this at the no-op.
37
+ onLocation = () => { }) {
33
38
  this.onMessage = onMessage;
34
39
  this.onExit = onExit;
35
40
  this.requestTimeoutMs = requestTimeoutMs;
36
41
  this.onSkippedRow = onSkippedRow;
42
+ this.onLocation = onLocation;
37
43
  if (!Number.isFinite(requestTimeoutMs) || requestTimeoutMs <= 0) {
38
44
  throw new Error('imsg rpc request timeout must be positive');
39
45
  }
@@ -83,6 +89,16 @@ export class ImsgRpc {
83
89
  this.onSkippedRow(msg.params.rowid);
84
90
  }
85
91
  }
92
+ else if (msg.method === 'location' && msg.params) {
93
+ const update = locationUpdateFromWire(msg.params);
94
+ // A row the mapper cannot vouch for (no handle, unknown event, a
95
+ // "valid" fix missing a coordinate) is dropped, visibly: silently
96
+ // eating it would hide a wire drift behind "no updates arrived".
97
+ if (update)
98
+ this.onLocation(update);
99
+ else
100
+ reportRuntimeIssue('imsg_watch_location_malformed');
101
+ }
86
102
  }
87
103
  request(method, params) {
88
104
  const id = this.nextId++;
@@ -103,16 +119,17 @@ export class ImsgRpc {
103
119
  });
104
120
  }
105
121
  // since_rowid is an exclusive cursor — pass the last rowid already handled.
106
- async subscribe(sinceRowid) {
122
+ async subscribe(sinceRowid, options = {}) {
107
123
  const res = await this.request('watch.subscribe', {
108
124
  ...(sinceRowid ? { since_rowid: sinceRowid } : {}),
109
125
  include_reactions: true,
110
126
  attachments: true,
127
+ ...(options.locationIntervalS === undefined ? {} : { location_interval_s: options.locationIntervalS }),
111
128
  });
112
129
  return res.subscription;
113
130
  }
114
- send(target, text) {
115
- const params = 'chatId' in target ? { chat_id: target.chatId, text } : { to: target.to, text };
131
+ send(target, text, service = 'imessage') {
132
+ const params = 'chatId' in target ? { chat_id: target.chatId, text, service } : { to: target.to, text, service };
116
133
  return this.request('send', params);
117
134
  }
118
135
  async history(chatId, limit = 30) {
@@ -149,6 +166,10 @@ export class ImsgRpc {
149
166
  const res = await this.request('chats.list', { limit });
150
167
  return res.chats;
151
168
  }
169
+ async findDmChat(identifier) {
170
+ const res = await this.request('chats.find', { identifier });
171
+ return res.chat_id ?? null;
172
+ }
152
173
  createChat(addresses, text) {
153
174
  return this.request('chats.create', { addresses, service: 'iMessage', text });
154
175
  }
@@ -295,6 +316,16 @@ export class ImsgRpc {
295
316
  ...(expectedBackgroundGuid !== undefined ? { background_guid: expectedBackgroundGuid } : {}),
296
317
  });
297
318
  }
319
+ // ---- Find My locations (M2B-31). Wire per the location contract: rows are
320
+ // snake_case SharedLocation, mapped by the gateway (gateway/locations.ts).
321
+ locationsRead(chatGuid) {
322
+ return this.request('locations.read', chatGuid ? { chat_guid: chatGuid } : {});
323
+ }
324
+ // Resolves chat_id / chat_guid / chat_identifier like every other bridge
325
+ // method (resolveChatGUIDParam); the SDK passes the local chat id.
326
+ sendLocationRequest(chatId) {
327
+ return this.request('location_request.send', { chat_id: chatId });
328
+ }
298
329
  stop() {
299
330
  this.stopping = true;
300
331
  this.child.stdin.end();
@@ -1 +1 @@
1
- {"version":3,"file":"rpc.js","sourceRoot":"","sources":["../../src/imsg/rpc.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAA4B,MAAM,oBAAoB,CAAC;AACrE,OAAO,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAGhD,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAE1D,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAwBzC,MAAM,OAAO,YAAa,SAAQ,KAAK;IAE1B;IAKA;IANX,YACW,IAAY,EACrB,OAAe;IACf,0EAA0E;IAC1E,uEAAuE;IACvE,oBAAoB;IACX,IAAa;QAEtB,KAAK,CAAC,YAAY,IAAI,KAAK,OAAO,GAAG,IAAI,CAAC,CAAC,CAAC,KAAK,IAAI,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;QAPxD,SAAI,GAAJ,IAAI,CAAQ;QAKZ,SAAI,GAAJ,IAAI,CAAS;QAGtB,IAAI,CAAC,IAAI,GAAG,cAAc,CAAC;IAC7B,CAAC;CACF;AA0ID,wEAAwE;AACxE,sEAAsE;AACtE,MAAM,0BAA0B,GAAG,MAAM,CAAC;AAE1C,MAAM,OAAO,OAAO;IAQR;IACA;IACA;IACA;IAVF,KAAK,CAAgD;IACrD,MAAM,GAAG,CAAC,CAAC;IACX,OAAO,GAAG,IAAI,GAAG,EAAmB,CAAC;IACrC,QAAQ,GAAG,KAAK,CAAC;IACjB,eAAe,GAAG,KAAK,CAAC;IAEhC,YACU,SAAqC,EACrC,MAAqC,EACrC,mBAAmB,0BAA0B,EAC7C,eAAwC,GAAG,EAAE,GAAE,CAAC;QAHhD,cAAS,GAAT,SAAS,CAA4B;QACrC,WAAM,GAAN,MAAM,CAA+B;QACrC,qBAAgB,GAAhB,gBAAgB,CAA6B;QAC7C,iBAAY,GAAZ,YAAY,CAAoC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OAAO,IAAI,CAAC,OAAO,CAAC,uBAAuB,EAAE,EAAE,OAAO,EAAE,MAAM,EAAE,CAAC,CAAC;IACpE,CAAC;IAED,IAAI;QACF,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC;QACrB,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,GAAG,EAAE,CAAC;QACvB,IAAI,CAAC,KAAK,CAAC,IAAI,EAAE,CAAC;IACpB,CAAC;CACF"}
@@ -11,6 +11,8 @@ export const NO_PATCHED_GATEWAY_CAPABILITIES = {
11
11
  chatBackgroundRemove: false,
12
12
  editMessage: false,
13
13
  mentionFormatting: false,
14
+ sharedLocations: false,
15
+ locationRequest: false,
14
16
  };
15
17
  export function patchedCapabilitiesFromStatus(status) {
16
18
  const selectors = status.selectors ?? {};
@@ -33,6 +35,12 @@ export function patchedCapabilitiesFromStatus(status) {
33
35
  // IMsgMentionFormatting.m: true only when the IMSharedUtilities
34
36
  // confirmed-mention attribute key resolved in the running Messages.
35
37
  mentionFormatting: selectors.mentionFormatting === true,
38
+ // M2B-31 Find My: the read path (locations.read + watch `location`
39
+ // notifications) and the request card are separate helper features and
40
+ // advertised separately; the card shares polls' extension-balloon
41
+ // initializer (IMsgInjected.m `locationRequest`).
42
+ sharedLocations: selectors.sharedLocations === true,
43
+ locationRequest: selectors.locationRequest === true,
36
44
  };
37
45
  }
38
46
  export function readPatchedGatewayCapabilities() {
@@ -1 +1 @@
1
- {"version":3,"file":"status.js","sourceRoot":"","sources":["../../src/imsg/status.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAElD,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAC1D,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAOzC,MAAM,CAAC,MAAM,+BAA+B,GAAwB;IAClE,YAAY,EAAE,KAAK;IACnB,WAAW,EAAE,KAAK;IAClB,UAAU,EAAE,KAAK;IACjB,iBAAiB,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} from './rpc.js';
2
3
  interface WatchRpc {
3
- subscribe(sinceRowid?: number): Promise<number>;
4
+ subscribe(sinceRowid?: number, options?: SubscribeOptions): Promise<number>;
4
5
  stop(): void;
5
6
  }
6
7
  type WatchRpcFactory = (onMessage: (message: ImsgMessage) => void, onExit: (code: number | null) => void, onSkippedRow: (rowid: number) => void) => WatchRpc;
@@ -58,7 +58,13 @@ export class ImsgWatch {
58
58
  // Supervision cannot depend on the native subscribe acknowledgement: the
59
59
  // request itself can remain pending while the child process stays alive.
60
60
  this.#scheduleRotation(generation);
61
- void rpc.subscribe(this.#cursor).catch(() => this.#handleSubscribeFailure(generation, rpc));
61
+ // No shared-location poll on the message stream: this session discards
62
+ // `location` notifications, and rotating every 10 s would re-prime the
63
+ // native differ each time, re-reading every known fix from Find My.
64
+ // ImsgLocationWatch owns the one session that actually wants the poll.
65
+ void rpc
66
+ .subscribe(this.#cursor, { locationIntervalS: 0 })
67
+ .catch(() => this.#handleSubscribeFailure(generation, rpc));
62
68
  }
63
69
  #handleSubscribeFailure(generation, rpc) {
64
70
  if (this.#stopped || generation !== this.#generation || this.#active !== rpc)
@@ -1 +1 @@
1
- {"version":3,"file":"watch.js","sourceRoot":"","sources":["../../src/imsg/watch.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,MAAM,UAAU,CAAC;AAEnC,0EAA0E;AAC1E,0EAA0E;AAC1E,6EAA6E;AAC7E,MAAM,gBAAgB,GAAG,MAAM,CAAC;AAChC,MAAM,sBAAsB,GAAG,GAAG,CAAC;AAmBnC;;;GAGG;AACH,MAAM,OAAO,SAAS;IACX,UAAU,CAAiC;IAC3C,UAAU,CAAS;IACnB,eAAe,CAAS;IACxB,UAAU,CAAkB;IACrC,OAAO,GAAoB,IAAI,CAAC;IAChC,OAAO,CAAqB;IAC5B,WAAW,GAAG,CAAC,CAAC;IAChB,QAAQ,GAAG,KAAK,CAAC;IACjB,QAAQ,GAAG,KAAK,CAAC;IACjB,cAAc,GAAyC,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I,CAAC,WAAW,EAAE,CAAC;QACnB,IAAI,IAAI,CAAC,cAAc,KAAK,IAAI;YAAE,YAAY,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC;QACpE,IAAI,IAAI,CAAC,aAAa,KAAK,IAAI;YAAE,YAAY,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC;QAClE,IAAI,CAAC,cAAc,GAAG,IAAI,CAAC;QAC3B,IAAI,CAAC,aAAa,GAAG,IAAI,CAAC;QAC1B,IAAI,CAAC,OAAO,EAAE,IAAI,EAAE,CAAC;QACrB,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC;IACtB,CAAC;CACF"}
package/dist/index.d.ts CHANGED
@@ -3,6 +3,7 @@ export { ImsgGateway } from './gateway/imsg.js';
3
3
  export * from './gateway/types.js';
4
4
  export * from './gateway/portable-chat.js';
5
5
  export * from './gateway/external-ids.js';
6
+ export * from './gateway/locations.js';
6
7
  export * from './polls.js';
7
8
  export * from './doctor.js';
8
9
  export { reportRuntimeIssue, setRuntimeIssueReporter, type RuntimeIssueReporter } from './runtime-report.js';
package/dist/index.js CHANGED
@@ -3,6 +3,7 @@ export { ImsgGateway } from './gateway/imsg.js';
3
3
  export * from './gateway/types.js';
4
4
  export * from './gateway/portable-chat.js';
5
5
  export * from './gateway/external-ids.js';
6
+ export * from './gateway/locations.js';
6
7
  export * from './polls.js';
7
8
  export * from './doctor.js';
8
9
  export { reportRuntimeIssue, setRuntimeIssueReporter } from './runtime-report.js';
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAChD,cAAc,oBAAoB,CAAC;AACnC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,2BAA2B,CAAC;AAC1C,cAAc,YAAY,CAAC;AAC3B,cAAc,aAAa,CAAC;AAC5B,OAAO,EAAE,kBAAkB,EAAE,uBAAuB,EAA6B,MAAM,qBAAqB,CAAC;AAE7G,cAAc,yBAAyB,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAChD,cAAc,oBAAoB,CAAC;AACnC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,2BAA2B,CAAC;AAC1C,cAAc,wBAAwB,CAAC;AACvC,cAAc,YAAY,CAAC;AAC3B,cAAc,aAAa,CAAC;AAC5B,OAAO,EAAE,kBAAkB,EAAE,uBAAuB,EAA6B,MAAM,qBAAqB,CAAC;AAE7G,cAAc,yBAAyB,CAAC"}
package/docs/api.md CHANGED
@@ -23,6 +23,7 @@ const gateway: Gateway = new ImsgGateway((code) => {
23
23
  | Mutation | `editMessage`, `unsendMessage`, `deleteMessage`, `setTyping`, `markRead` |
24
24
  | Group and identity | `renameGroup`, `setGroupPhoto`, `addParticipant`, `removeParticipant`, `leaveGroup`, `shareNamePhoto` |
25
25
  | Chat backgrounds | `chatBackgroundStatus`, `setChatBackground`, `removeChatBackground` |
26
+ | Find My locations | `readSharedLocations`, `watchLocations`, `sendLocationRequest` |
26
27
 
27
28
  `Gateway.capabilities` is a runtime descriptor, not an optimistic feature
28
29
  list. Check it before presenting a patched action to a user. A false capability
@@ -13,6 +13,8 @@ contract; “capability-gated” means the selected binary must prove it at star
13
13
  | Edit message | Available, capability-gated (host-verified 2026-09-03) | Any of the `editMessageItemTranslation` (macOS 27, imsg#3) / `editMessageItem` / `editMessage` selector markers present; `tier2-smoke.ts <chatId> --only-edit-message` on the host, recorded in the contract ledger |
14
14
  | Custom emoji, stickers, group photo, group membership, Name & Photo | Available | Corresponding Mapier selector marker is present |
15
15
  | Chat background set (Gradient) / remove | Available, capability-gated (host-verified 2026-09-03) | `chatBackgroundSetGradient` / `chatBackgroundRemove` selector markers present (imsg#12 build); `tier2-smoke.ts <chatId> --only-chat-background` on the host, recorded in the contract ledger; status read needs no marker |
16
+ | Find My shared locations read / live updates (`readSharedLocations`, `watchLocations`) | Available, capability-gated (host-verified 2026-09-13: SDK read leg; live fix and update stream verified at the native layer on a second Mac, `watchLocations()` end to end pending the relay e2e) | `sharedLocations` selector marker present (M2B-31 helper); `tier2-smoke.ts <chatId> --only-location` on the host, recorded in the contract ledger |
17
+ | Find My "Request Location" card (`sendLocationRequest`) | Available, capability-gated (host-verified 2026-09-13, receiver-visible card with a Share button observed) | `locationRequest` selector marker present (M2B-31 helper); `tier2-smoke.ts <chatId> --only-location --location-request` on the host, chat.db Find My balloon row, recorded in the contract ledger |
16
18
  | Rich links | Present but conservative | Build must carry the rich-link fix; receiver-visible release smoke required |
17
19
  | Leave group | Present but unavailable on the verified host | Do not advertise until a native build restores and smokes it |
18
20
  | Mark unread, force notify, delete chat | Not exposed by this SDK | Current upstream `imsg` has RPC actions; first port them into the Mapier fork, then host-verify, capability-gate, document, and add conformance coverage |
@@ -61,6 +61,8 @@ interface Gateway {
61
61
  chatBackgroundRemove: boolean;
62
62
  editMessage: boolean;
63
63
  mentionFormatting: boolean;
64
+ sharedLocations: boolean;
65
+ locationRequest: boolean;
64
66
  };
65
67
  subscribe(sinceId?: number): AsyncIterable<GatewayEvent>;
66
68
  history(chatId: number, limit?: number): Promise<ImsgMessage[]>;
@@ -129,8 +131,30 @@ interface Gateway {
129
131
  skipped?: 'no-background';
130
132
  effectStarted?: boolean;
131
133
  }>;
134
+
135
+ // Find My locations (M2B-31). See "Location" below.
136
+ readSharedLocations(chatGuid?: string): Promise<SharedLocation[]>;
137
+ sendLocationRequest(chatId: number): Promise<SendResult>;
138
+ watchLocations(): AsyncIterable<LocationUpdate>;
139
+ }
140
+
141
+ interface SharedLocation {
142
+ handle: string; // IMFindMyHandle.identifier: E.164 phone or Apple ID email
143
+ chatGuid?: string; // the handle's DM chat when resolvable
144
+ latitude?: number; // present together with longitude, only on a valid fix
145
+ longitude?: number;
146
+ horizontalAccuracyM?: number;
147
+ altitudeM?: number;
148
+ speedMps?: number; // -1 = unknown
149
+ locationType?: number; // FMLLocation.locationType raw
150
+ coarseAddress?: string;
151
+ capturedAt?: string; // ISO8601 UTC, FMLLocation.timestamp
152
+ isValid: boolean; // false = sharing, no fix yet (no coordinates)
132
153
  }
133
154
 
155
+ type LocationShareEvent = 'location_update' | 'share_started' | 'share_ended';
156
+ type LocationUpdate = SharedLocation & { event: LocationShareEvent };
157
+
134
158
  interface ReactionNote {
135
159
  id: number; // the reaction's global rowid
136
160
  // 'custom' covers an arbitrary-emoji tapback (iOS 18+, imsg surfaces it as
@@ -145,7 +169,12 @@ interface ReactResult {
145
169
  skipped?: 'already-reacted' | 'stale-target' | 'not-reacted';
146
170
  }
147
171
 
148
- type GatewayEvent = ImsgMessage; // message or reaction; see §2 shape
172
+ // message or reaction; see §2 shape. Deliberately NOT widened to a union
173
+ // for Find My updates (0.4.0): every pinned consumer reads `.id`/`.chat_guid`
174
+ // straight off the subscribe value (imsg-relay mac-daemon, imsg-agent
175
+ // runtime-event-source), so live location changes have their own stream,
176
+ // `watchLocations()`, and this type stays exactly what it was.
177
+ type GatewayEvent = ImsgMessage;
149
178
 
150
179
  type Reaction = 'love' | 'like' | 'dislike' | 'laugh' | 'emphasis' | 'question';
151
180
 
@@ -520,10 +549,80 @@ both implementations — none of Apple's group primitives apply to a 1:1 chat.
520
549
  imsg#12 merged. The SDK verbs were **host-verified 2026-09-03** through
521
550
  `ImsgGateway` on the shared Mac (`--only-chat-background` leg of
522
551
  `scripts/tier2-smoke.ts`; see the ledger below); recipient-side rendering,
523
- group chats and the replace path remain unobserved. The leg
552
+ group chats and the replace path were **eyeballed 2026-09-04** (ledger
553
+ entry below), with one receiver-side condition: a brand-new thread from a
554
+ sender the iPhone has never seen may render no background until the
555
+ thread is "known" (see the entry). The leg
524
556
  (`scripts/tier2-chat-background-leg.ts`) stops at the first failed check
525
557
  and never clears a background whose guid it did not read back.
526
558
 
559
+ - **Location** — `readSharedLocations` / `watchLocations` /
560
+ `sendLocationRequest` (M2B-31; the shared wire contract lives with the
561
+ Mac and relay tracks, `location-wire.md`). Find My shares are
562
+ account-scoped state on the host Mac — the handles in
563
+ `findMyHandlesSharingLocationWithMe` and each handle's latest
564
+ `FMLLocation` — not message rows: no `subscribe()` event, no history row
565
+ on either implementation. Two separate helper markers gate the surface,
566
+ read from `imsg status --json` like every other patched verb:
567
+ `sharedLocations` (the read path) and `locationRequest` (the request
568
+ card, which reuses polls' extension-balloon initializer); neither implies
569
+ the other.
570
+ `readSharedLocations(chatGuid?)` is the native `locations.read`
571
+ (`{chat_guid?}` → `{locations, read_at}`): every sharing handle, or only
572
+ the one whose DM chat is `chatGuid`. The helper turns tracking on for a
573
+ handle's DM chat once per process and reads the current fix; a handle
574
+ that shares but has no fix yet comes back `isValid:false` with **no
575
+ coordinates** — never a zero fix. The mapping (`src/gateway/locations.ts`)
576
+ is total over malformed rows and drops what it cannot vouch for (no
577
+ handle; a "valid" row missing a coordinate). **It throws** — on both
578
+ implementations — when the bridge does not advertise `sharedLocations`
579
+ and on any rpc failure: an empty list is a positive claim ("nobody is
580
+ sharing") that a bridge which could not read must not make.
581
+ `sendLocationRequest(chatId)` is `location_request.send` (`{chat_id}`;
582
+ the handler resolves `chat_id`/`chat_guid`/`chat_identifier` alike, so the
583
+ Gateway keeps its numeric local id like every other verb): Apple's native
584
+ "Request Location" card, the one Messages sends from + › Location ›
585
+ Request, built by the helper with a fresh payload id. Targets an
586
+ **existing** chat only. **Fire-and-forget like `sendPoll`**: `ok:true`
587
+ means the helper dispatched the card; `guid` is the balloon row when
588
+ Messages exposed it synchronously and is absent otherwise (documented on
589
+ the native side). The recipient's answer, if any, arrives as a location
590
+ share — a `location` update below, or a decoded Find My share card on a
591
+ message row (imsg `docs/json.md` "Location card"), which this Gateway
592
+ does not model yet. FakeGateway emits the bare outbound row (like
593
+ `sendSticker`; `ImsgMessage` models nothing of the card) and returns only
594
+ the guid.
595
+ `watchLocations()` streams one `LocationUpdate` per change the native
596
+ watch reports — the `location` notification the watch stream emits
597
+ alongside `message`: a new fix (`location_update`), a handle starting
598
+ (`share_started`) or stopping (`share_ended`, which may carry no
599
+ coordinates) to share; on the native side this is a 30 s poll of
600
+ `locations.read` inside the watch session. `ImsgGateway` therefore holds
601
+ a **dedicated, non-rotated, cursorless** native watch session for it
602
+ (`src/imsg/location-watch.ts`, opened on the first `watchLocations()`
603
+ call): the message watch retires its process every 10 s once it has a
604
+ cursor, which would starve that poll. Its `message` notifications are
605
+ ignored. That poll runs in *every* subscription unless the subscriber
606
+ turns it off, so the message watch subscribes with `location_interval_s:
607
+ 0` and this session is the only one that leaves the interval unset — one
608
+ Find My reader per connector, not one per watch session.
609
+ Location updates carry no rowid, so there is no catch-up: a
610
+ restarted session (child death) resumes nothing and a consumer takes the
611
+ baseline from `readSharedLocations()`, then applies updates. Malformed
612
+ notifications are dropped and reported as
613
+ `imsg_watch_location_malformed`, never forwarded. Single consumer, like
614
+ `subscribe()`, with the same documented divergence (FakeGateway allows
615
+ sequential re-watch). `GatewayEvent` is unchanged: see the note on it in
616
+ §1. FakeGateway's `injectSharedLocation(update)` is the fixture driver —
617
+ it goes through the real wire mapper, updates the in-memory share list
618
+ (`share_ended` removes the handle) and feeds `watchLocations()`.
619
+ **Host-verified 2026-09-13** (ledger below): `scripts/tier2-smoke.ts
620
+ <chatId> --only-location` (read leg, sends nothing) and
621
+ `--location-request` (posts the card; opt-in, the recipient sees it) are
622
+ the gate. Still open on the native side, to be confirmed in the relay
623
+ e2e: whether a fresh watch session emits the current snapshot
624
+ immediately or only diffs after its first poll.
625
+
527
626
  **Host-verification ledger.** Exercised through `ImsgGateway` on the host Mac
528
627
  2026-07-14 (`scripts/tier2-smoke.ts`, chat 3996):
529
628
 
@@ -605,6 +704,81 @@ three phone-handle participants; `scripts/tier2-smoke.ts 12 --only-mention
605
704
  receiving device rendering "Edited" (the inbound echo carried the original
606
705
  text, which is the partner's copy, not evidence either way).
607
706
 
707
+ Exercised 2026-09-13 on the host (SDK `d6fecca` against the deployed M2B-31
708
+ helper, imsg `0071842` built on the host, `sharedLocations true` /
709
+ `locationRequest true`; `scripts/tier2-smoke.ts 7 --only-location
710
+ --location-request`, bench `~/imsg-sdk-location-e2e-d6fecca`):
711
+
712
+ - **`readSharedLocations` / `sendLocationRequest`** — live-verified: both
713
+ capability rows; `readSharedLocations()` returned a list (0 handles: no
714
+ share was active during the run, so the fix shape was not exercised
715
+ through the SDK here); `sendLocationRequest(7)` returned
716
+ `{ok:true, guid:23DB6804-EAAC-476D-8CA5-7AE71642B960}` and the row read
717
+ back from `chat.db` as a Find My balloon
718
+ (`…:0000000000:com.apple.findmy.FindMyMessagesApp`); an unknown chat
719
+ (`999999999`) → `ok:false` (native `-32602`). 6/6 PASS, `ALL PASS`, exit
720
+ 0; the audit recorded exactly one event, in chat 7 ("Requested your
721
+ location"). Recipient-side, same helper build on a second Mac (macOS
722
+ 26.6.2, 2026-09-13): the card rendered with a Share button on an iPhone
723
+ for a sender NOT in contacts, a 1 h share came back as a valid fix from
724
+ `imsg locations --json`, and `imsg watch --json --location-interval 30`
725
+ emitted `share_started` / `location_update` / `share_ended` — native
726
+ layer only; `ImsgGateway.watchLocations()` end to end is the relay e2e.
727
+ Not covered: group chats, email-handle shares, share expiry vs. Apple's
728
+ handle drop.
729
+
730
+ Eyeballed 2026-09-04 on the same host (SDK `5826316` = v0.3.0, deployed
731
+ `imsg` 0.13.0 helper, all four 0.3.0 capability flags true) with a human
732
+ watching the receiving iPhone (iOS 26.6.1) between steps, one gateway call
733
+ per invocation (`scripts/eyeball.ts`, checked into no branch — it is an
734
+ observation aid, not a check). Fixtures: DM chat 13 (the host's account →
735
+ the phone, created that day) and group chat 12 (three phone handles):
736
+
737
+ - **`setChatBackground` → receiver** — observed on the phone in the DM and
738
+ in the group: the conversation switched to the Gradient background and
739
+ Messages posted "<sender> changed the background." The phone's own
740
+ `imagent` log (Console.app, device streaming) showed the full inbound
741
+ path each time: `Received incoming transcript background` → asset fetch
742
+ → `Successfully blastdoor'd data` → `Writing poster` → `Update type:
743
+ setNewBackground`, ~6 s after the call. **Receiver-side condition (sticky,
744
+ trigger not isolated):** the first four Sets into the brand-new DM were
745
+ processed by the phone's `imagent` exactly the same way but Messages
746
+ rendered nothing and offered no Backgrounds entry in that DM; the host's
747
+ account was an email the phone had never seen. Right after that account
748
+ was saved as a contact the next Set rendered — and every later Set kept
749
+ rendering after the contact was deleted again, in the DM and in the
750
+ group, so whatever flips the thread from "does not render" to "renders"
751
+ stays flipped. Saving the contact is the time-correlated candidate, and
752
+ the phone's own background action in the group (before the group's first
753
+ successful Set) the other; separating them needs a fresh DM to a fresh
754
+ number. The Mac side gives no hint of any of this: chat.db, the upload
755
+ and the IDS send
756
+ (command 138, sealed for every endpoint of the number that advertises
757
+ `supports-transcript-backgrounds`) all succeed either way, so a
758
+ `setChatBackground` `ok:true` is proof the Mac set it, not that the
759
+ recipient can see it.
760
+ - **`removeChatBackground` → receiver** — observed in the DM and the group:
761
+ the background returned to default on the phone. The compare-and-clear
762
+ guard was exercised for real along the way: the phone had cleared and the
763
+ host re-set the background between two steps, so a Remove carrying the
764
+ earlier guid answered `ok:false, effectStarted:false` (the helper's
765
+ "does not match expected GUID" refusal) and left the live background in
766
+ place; the Remove with the live guid cleared it.
767
+ - **Reverse direction** — a background set and a background cleared from
768
+ the phone both arrived in the host's chat.db (`item_type 3`,
769
+ `group_action_type 4` / `6`, `handle_id` = the phone) and
770
+ `chatBackgroundStatus` tracked them. Host-initiated actions land as
771
+ `is_from_me 0, handle_id 0` rows; the status read keys off the chat's
772
+ live background guid, not that column.
773
+ - **`editMessage` → receiver** — observed in the DM: the phone showed the
774
+ SAME bubble with the new text and the "Edited" label, no new bubble
775
+ (marker `6026CE4C-1CF1-4B97-8C90-925834F59272`).
776
+ - Three IDS endpoints are registered for the receiving number; one of them
777
+ (a macOS 15 Mac, which has no transcript backgrounds) is dropped by the
778
+ sender's capability policy on every Set (`IF lacks(supports-transcript-
779
+ backgrounds) THEN failure`). That is per-endpoint pruning, not a failure
780
+ of the send, and the phone's endpoints are unaffected.
781
+
608
782
  - **subscribe(sinceId?)** — long-lived event stream of new messages/reactions across all
609
783
  chats the host Mac's Messages account can see. `sinceId` is an **exclusive** cursor: only
610
784
  events with `id > sinceId` are delivered (catch-up semantics, not "starting at"). Today
@@ -1056,9 +1230,18 @@ harness (`tsx --test`, see `package.json`). Required cases:
1056
1230
  unknown chat never starts an effect
1057
1231
  - `recentReactions` surfaces an inbound custom-emoji reaction (`reaction: 'custom'`) with the
1058
1232
  real `emoji` intact
1233
+ - `readSharedLocations` lists every sharing handle, narrows by chat guid, replaces (never
1234
+ accumulates) a handle's row on a newer fix, and keeps a no-fix handle coordinate-free;
1235
+ it throws without the `sharedLocations` marker
1236
+ - `watchLocations` streams `share_started` → `location_update` → `share_ended` in order,
1237
+ `share_ended` drops the handle from the read, and a second concurrent consumer is refused
1238
+ - `sendLocationRequest` posts the card as its own outbound row to an existing chat, returns
1239
+ the balloon guid, refuses an unknown chat (no find-or-create), and fails closed without
1240
+ the `locationRequest` marker (no row written)
1059
1241
  - Fake-only restart coverage snapshots and restores a world, then proves
1060
1242
  `sendStatus`, `checkHandle`, Name & Photo idempotency, chat backgrounds (and their
1061
- guid sequence), current group metadata, fixture state, and monotonic IDs survive exactly
1243
+ guid sequence), Find My shares, current group metadata, fixture state, and monotonic IDs
1244
+ survive exactly; a snapshot carrying a share the wire mapper would refuse does not restore
1062
1245
 
1063
1246
  FakeGateway runs this suite in CI on every PR. ImsgGateway runs it as a manual runbook step on
1064
1247
  the host Mac (see `docs/host-mac-control.md`) until a host-Mac CI runner exists — at that point
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mapier/imsg-sdk",
3
- "version": "0.3.0",
3
+ "version": "0.4.0",
4
4
  "description": "TypeScript SDK for iMessage automation on macOS: the Gateway contract, ImsgGateway (real), and a device-free FakeGateway.",
5
5
  "license": "MIT",
6
6
  "repository": {