@leemour/max-cli 0.1.0 → 0.2.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.
Files changed (78) hide show
  1. package/README.md +25 -9
  2. package/dist/cache/schema.d.ts +10 -1
  3. package/dist/cache/schema.d.ts.map +1 -1
  4. package/dist/cache/schema.js +71 -7
  5. package/dist/cache/schema.js.map +1 -1
  6. package/dist/cache/store.d.ts +84 -3
  7. package/dist/cache/store.d.ts.map +1 -1
  8. package/dist/cache/store.js +155 -25
  9. package/dist/cache/store.js.map +1 -1
  10. package/dist/client.d.ts +68 -9
  11. package/dist/client.d.ts.map +1 -1
  12. package/dist/client.js +286 -31
  13. package/dist/client.js.map +1 -1
  14. package/dist/commands/chats.d.ts.map +1 -1
  15. package/dist/commands/chats.js +5 -9
  16. package/dist/commands/chats.js.map +1 -1
  17. package/dist/commands/contacts.d.ts.map +1 -1
  18. package/dist/commands/contacts.js +46 -5
  19. package/dist/commands/contacts.js.map +1 -1
  20. package/dist/commands/login.d.ts +15 -0
  21. package/dist/commands/login.d.ts.map +1 -0
  22. package/dist/commands/login.js +43 -0
  23. package/dist/commands/login.js.map +1 -0
  24. package/dist/commands/logout.d.ts +10 -0
  25. package/dist/commands/logout.d.ts.map +1 -0
  26. package/dist/commands/logout.js +22 -0
  27. package/dist/commands/logout.js.map +1 -0
  28. package/dist/commands/me.d.ts +3 -0
  29. package/dist/commands/me.d.ts.map +1 -0
  30. package/dist/commands/me.js +18 -0
  31. package/dist/commands/me.js.map +1 -0
  32. package/dist/commands/messages.d.ts.map +1 -1
  33. package/dist/commands/messages.js +18 -3
  34. package/dist/commands/messages.js.map +1 -1
  35. package/dist/commands/paging.d.ts +38 -0
  36. package/dist/commands/paging.d.ts.map +1 -0
  37. package/dist/commands/paging.js +43 -0
  38. package/dist/commands/paging.js.map +1 -0
  39. package/dist/commands/send.d.ts +10 -0
  40. package/dist/commands/send.d.ts.map +1 -0
  41. package/dist/commands/send.js +30 -0
  42. package/dist/commands/send.js.map +1 -0
  43. package/dist/commands/session.d.ts.map +1 -1
  44. package/dist/commands/session.js +3 -3
  45. package/dist/commands/session.js.map +1 -1
  46. package/dist/config.d.ts +6 -0
  47. package/dist/config.d.ts.map +1 -1
  48. package/dist/config.js +10 -0
  49. package/dist/config.js.map +1 -1
  50. package/dist/domain/map.d.ts +1 -0
  51. package/dist/domain/map.d.ts.map +1 -1
  52. package/dist/domain/map.js +2 -0
  53. package/dist/domain/map.js.map +1 -1
  54. package/dist/domain/models.d.ts +18 -0
  55. package/dist/domain/models.d.ts.map +1 -1
  56. package/dist/generated/operations.generated.d.ts +1 -0
  57. package/dist/generated/operations.generated.d.ts.map +1 -1
  58. package/dist/protocol/session.d.ts +54 -0
  59. package/dist/protocol/session.d.ts.map +1 -0
  60. package/dist/protocol/session.js +57 -0
  61. package/dist/protocol/session.js.map +1 -0
  62. package/dist/session/adopt.d.ts +22 -0
  63. package/dist/session/adopt.d.ts.map +1 -0
  64. package/dist/session/adopt.js +29 -0
  65. package/dist/session/adopt.js.map +1 -0
  66. package/dist/session/handshake.d.ts +14 -1
  67. package/dist/session/handshake.d.ts.map +1 -1
  68. package/dist/session/handshake.js +5 -5
  69. package/dist/session/handshake.js.map +1 -1
  70. package/dist/spec/operations/auth.d.ts +42 -0
  71. package/dist/spec/operations/auth.d.ts.map +1 -0
  72. package/dist/spec/operations/session.d.ts +16 -0
  73. package/dist/spec/operations/session.d.ts.map +1 -1
  74. package/dist/spec/operations/session.js +21 -1
  75. package/dist/spec/operations/session.js.map +1 -1
  76. package/dist/version.d.ts +1 -1
  77. package/dist/version.js +1 -1
  78. package/package.json +4 -3
package/dist/client.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- import type { CacheStore } from "./cache/store.js";
2
- import type { Chat, Contact, Id, Message, Profile } from "./domain/models.js";
1
+ import type { CacheStore, PersonOrder, SyncSummary } from "./cache/store.js";
2
+ import type { Chat, Contact, Id, Message, Page, Profile } from "./domain/models.js";
3
3
  import { Connection } from "./protocol/connection.js";
4
4
  import { type DiagnosticEvent } from "./runs/events.js";
5
5
  import type { SessionStore } from "./session/store.js";
@@ -57,7 +57,7 @@ export declare class MaxClient {
57
57
  * time, and the name is filled in. Without this, `max chats` shows a column of blanks for
58
58
  * exactly the chats a person recognises by name.
59
59
  */
60
- list: (limit?: number) => Promise<Chat[]>;
60
+ list: (options?: PageRequest) => Promise<Page<Chat>>;
61
61
  /**
62
62
  * Turns what the person typed into a chat id.
63
63
  *
@@ -68,11 +68,59 @@ export declare class MaxClient {
68
68
  resolve: (reference: string) => Promise<Id>;
69
69
  };
70
70
  readonly contacts: {
71
- /** The people this account has a one-to-one chat with, named. */
72
- list: () => Promise<Contact[]>;
71
+ /**
72
+ * The people this account has a one-to-one chat with, named, newest conversation first.
73
+ *
74
+ * **It answers from the store**, which the login has just brought up to date (`#mergeLogin`),
75
+ * so the order and the paging happen in SQL over every person we know rather than over the
76
+ * handful this particular login mentioned. A delta carries almost nothing after the first run;
77
+ * rendering the response instead of the store would show an empty list on the second command.
78
+ *
79
+ * ⚠ **A group member is not in this answer** and nothing marks them as excluded: the query
80
+ * asks for people a *dialog* exists with, and they are outside it (`NEED-105`). They are in
81
+ * the store, with the chats they share with us, for the commands that will want them.
82
+ */
83
+ list: (options?: PageRequest) => Promise<Page<Contact>>;
84
+ /**
85
+ * **Start again from zero**: forget the marker, so this login asks for the whole collection
86
+ * rather than for what changed, and name everybody it mentions.
87
+ *
88
+ * It is a repair tool, not the way contacts arrive. The delta rides on the login every command
89
+ * already performs, so there is nothing to schedule and no budget to spend — what this is for
90
+ * is a store that has drifted, or a full re-take after a schema rebuild threw the rows away.
91
+ * It is also the only thing that could ever prune somebody MAX has stopped returning, which is
92
+ * the second reason it exists.
93
+ */
94
+ sync: () => Promise<SyncSummary & {
95
+ full: true;
96
+ }>;
73
97
  };
74
98
  readonly messages: {
75
- list: (chatId: Id, limit?: number) => Promise<Message[]>;
99
+ /**
100
+ * **Paged backwards through time, not by page number.** MAX's history is already anchored —
101
+ * it takes a moment and answers with what came before it — so `--before` is exact where a page
102
+ * number over a live conversation would repeat and skip rows.
103
+ *
104
+ * `hasMore` here is a claim about the copy we hold, never about the chat: a full page back is
105
+ * the only evidence there is that another page exists.
106
+ */
107
+ list: (chatId: Id, options?: {
108
+ limit?: number;
109
+ before?: number;
110
+ }) => Promise<Page<Message>>;
111
+ /**
112
+ * Turns what `--before` was given into a moment.
113
+ *
114
+ * **ISO 8601 is a time; a bare integer is a message id.** Both a millisecond timestamp and a
115
+ * message id are runs of digits — 13 and 18 of them on this account — and deciding between
116
+ * them by length is a trap that fires the first time either changes size. So the rule is what
117
+ * the string looks like, not how big it is.
118
+ *
119
+ * An id we have never stored is exactly what a deleted message looks like, because it is gone
120
+ * from the history MAX returns too. That is a refusal naming the way round it rather than a
121
+ * guess: read as milliseconds, an 18-digit id points six hundred million years from now.
122
+ */
123
+ before: (reference: string) => number;
76
124
  /**
77
125
  * Sends one message, retrying **only with the same `cid`**.
78
126
  *
@@ -84,7 +132,7 @@ export declare class MaxClient {
84
132
  * So one retry, same `cid`, and nothing beyond that. What is still unmeasured is how long the
85
133
  * server remembers a `cid`; the two probes were seconds apart. If the retry also fails the
86
134
  * answer is `outcome_unknown` — never failed, never sent — and it names the `cid`, because
87
- * `max send --cid <n>` can then repeat the attempt without risking a second message.
135
+ * `max messages send … --cid <n>` can then repeat the attempt without risking a second message.
88
136
  */
89
137
  send: (chatId: Id, text: string, options?: {
90
138
  cid?: number;
@@ -92,12 +140,23 @@ export declare class MaxClient {
92
140
  }) => Promise<Message>;
93
141
  };
94
142
  /**
95
- * Opens the connection and logs in with the stored token.
143
+ * Opens the connection and logs in with the stored token, or with one offered for trial.
96
144
  *
97
145
  * The login response carries the profile, the chats, the contacts and recent messages, so most
98
146
  * commands need no further request — measured against MAX on 2026-09-19.
147
+ *
148
+ * **A candidate token is tried and not stored**, which is what lets `adoptToken` write to the
149
+ * keyring only after MAX has accepted it. Nothing here writes a token; see `session/adopt.ts`.
99
150
  */
100
- connect(): Promise<void>;
151
+ connect({ token: candidate }?: {
152
+ token?: string;
153
+ }): Promise<void>;
101
154
  close(): Promise<void>;
102
155
  }
156
+ /** What every listing takes. Absent means "the caller did not say", never a number chosen here. */
157
+ export interface PageRequest {
158
+ order?: PersonOrder;
159
+ limit?: number;
160
+ offset?: number;
161
+ }
103
162
  //# sourceMappingURL=client.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAA;AAElD,OAAO,KAAK,EAAE,IAAI,EAAE,OAAO,EAAE,EAAE,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAA;AAG7E,OAAO,EAAE,UAAU,EAAiB,MAAM,0BAA0B,CAAA;AAEpE,OAAO,EAAY,KAAK,eAAe,EAAS,MAAM,kBAAkB,CAAA;AAExE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAA;AAGtD,MAAM,WAAW,gBAAgB;IAC/B,KAAK,EAAE,YAAY,CAAA;IACnB,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,kEAAkE;IAClE,UAAU,CAAC,EAAE,UAAU,CAAA;IACvB;;;OAGG;IACH,IAAI,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,CAAA;IAChC,gFAAgF;IAChF,KAAK,CAAC,EAAE,UAAU,CAAA;IAClB;;;;;;;OAOG;IACH,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB;;;OAGG;IACH,MAAM,CAAC,EAAE,CAAC,KAAK,EAAE,eAAe,KAAK,IAAI,CAAA;CAC1C;AAED;;;;;;;;;;;GAWG;AACH,qBAAa,SAAS;;gBAaR,EAAE,KAAK,EAAE,SAAS,EAAE,UAAU,EAAE,IAAI,EAAE,KAAK,EAAE,OAAe,EAAE,MAAM,EAAE,EAAE,gBA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CAAA;SAAE,KAAQ,OAAO,CAAC,OAAO,CAAC;MAuC3G;IAED;;;;;;;;OAQG;IACG,OAAO,CAAC,EAAE,KAAK,EAAE,SAAS,EAAE,GAAE;QAAE,KAAK,CAAC,EAAE,MAAM,CAAA;KAAO,GAAG,OAAO,CAAC,IAAI,CAAC;IAmJrE,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;CAyK7B;AAED,mGAAmG;AACnG,MAAM,WAAW,WAAW;IAC1B,KAAK,CAAC,EAAE,WAAW,CAAA;IACnB,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,MAAM,CAAC,EAAE,MAAM,CAAA;CAChB"}
package/dist/client.js CHANGED
@@ -30,6 +30,7 @@ export class MaxClient {
30
30
  #login;
31
31
  #previousCid = 0;
32
32
  #people;
33
+ #merged;
33
34
  constructor({ store, timeoutMs, connection, warn, cache, offline = false, events }) {
34
35
  this.#store = store;
35
36
  this.#connection = connection ?? new Connection(timeoutMs === undefined ? {} : { timeoutMs });
@@ -50,14 +51,17 @@ export class MaxClient {
50
51
  * time, and the name is filled in. Without this, `max chats` shows a column of blanks for
51
52
  * exactly the chats a person recognises by name.
52
53
  */
53
- list: async (limit) => {
54
+ list: async (options = {}) => {
55
+ const { limit, offset = 0 } = options;
54
56
  if (this.#offline) {
55
- const cached = this.#recorded(this.#cache?.chats.read(ANY_AGE), "chats");
56
- return limit === undefined ? cached : cached.slice(0, limit);
57
+ return paged(this.#recorded(this.#cache?.chats.read(ANY_AGE), "chats"), limit, offset);
57
58
  }
58
59
  await this.#connectOnce();
59
60
  const raw = asArray(this.#session().chats);
60
61
  const people = await this.#peopleFor(raw);
62
+ // A one-to-one chat has no title of its own — its name is the other person's, and MAX does
63
+ // not put it in the chat object. Without this, the chats a person recognises by name are a
64
+ // column of blanks.
61
65
  const chats = raw.map((chat) => {
62
66
  const mapped = toChat(chat);
63
67
  if (mapped.title !== null || mapped.kind !== "dialog")
@@ -66,8 +70,15 @@ export class MaxClient {
66
70
  const name = partner === undefined ? null : (people.get(partner)?.name ?? null);
67
71
  return { ...mapped, title: name };
68
72
  });
69
- this.#cache?.chats.write(chats);
70
- return limit === undefined ? chats : chats.slice(0, limit);
73
+ const cache = this.#cache;
74
+ if (!cache)
75
+ return paged(chats, limit, offset);
76
+ // Written first, then read back: the titles just resolved have to be in the store before it
77
+ // is asked to order and page over them, and the delta this login carried is only a slice of
78
+ // what it now holds.
79
+ cache.chats.write(chats);
80
+ const items = cache.chats.page({ limit: limit ?? Number.MAX_SAFE_INTEGER, offset });
81
+ return { items, hasMore: offset + items.length < cache.chats.count() };
71
82
  },
72
83
  /**
73
84
  * Turns what the person typed into a chat id.
@@ -79,7 +90,7 @@ export class MaxClient {
79
90
  resolve: async (reference) => {
80
91
  if (/^-?\d+$/.test(reference.trim()))
81
92
  return reference.trim();
82
- const chats = await this.chats.list();
93
+ const { items: chats } = await this.chats.list();
83
94
  const wanted = reference.trim().toLowerCase();
84
95
  const titled = chats.filter((chat) => chat.title !== null);
85
96
  const exact = titled.filter((chat) => chat.title?.toLowerCase() === wanted);
@@ -93,27 +104,85 @@ export class MaxClient {
93
104
  },
94
105
  };
95
106
  contacts = {
96
- /** The people this account has a one-to-one chat with, named. */
97
- list: async () => {
98
- if (this.#offline)
99
- return this.#recorded(this.#cache?.contacts.read(ANY_AGE), "contacts");
107
+ /**
108
+ * The people this account has a one-to-one chat with, named, newest conversation first.
109
+ *
110
+ * **It answers from the store**, which the login has just brought up to date (`#mergeLogin`),
111
+ * so the order and the paging happen in SQL over every person we know rather than over the
112
+ * handful this particular login mentioned. A delta carries almost nothing after the first run;
113
+ * rendering the response instead of the store would show an empty list on the second command.
114
+ *
115
+ * ⚠ **A group member is not in this answer** and nothing marks them as excluded: the query
116
+ * asks for people a *dialog* exists with, and they are outside it (`NEED-105`). They are in
117
+ * the store, with the chats they share with us, for the commands that will want them.
118
+ */
119
+ list: async (options = {}) => {
120
+ const { order = "recent", limit, offset = 0 } = options;
121
+ // The same query as the online path, so `--offline` cannot answer with people the other
122
+ // one deliberately leaves out — a group member is not a contact in either mode.
123
+ if (this.#offline) {
124
+ const recorded = this.#cache;
125
+ if (!recorded || recorded.people.countContacts() === 0)
126
+ this.#recorded(undefined, "contacts");
127
+ return this.#pageOfContacts(recorded, order, limit, offset);
128
+ }
100
129
  await this.#connectOnce();
101
130
  const people = await this.#peopleFor(asArray(this.#session().chats));
102
- const contacts = [...people.values()].filter((contact) => contact.id !== "");
103
- this.#cache?.contacts.write(contacts);
104
- return contacts;
131
+ const cache = this.#cache;
132
+ // No store — it failed to open, and that is not a reason to lose the answer MAX just gave.
133
+ // What is lost is only the ordering and the paging the store does better.
134
+ if (!cache)
135
+ return paged([...people.values()].filter((contact) => contact.id !== ""), limit, offset);
136
+ return this.#pageOfContacts(cache, order, limit, offset);
137
+ },
138
+ /**
139
+ * **Start again from zero**: forget the marker, so this login asks for the whole collection
140
+ * rather than for what changed, and name everybody it mentions.
141
+ *
142
+ * It is a repair tool, not the way contacts arrive. The delta rides on the login every command
143
+ * already performs, so there is nothing to schedule and no budget to spend — what this is for
144
+ * is a store that has drifted, or a full re-take after a schema rebuild threw the rows away.
145
+ * It is also the only thing that could ever prune somebody MAX has stopped returning, which is
146
+ * the second reason it exists.
147
+ */
148
+ sync: async () => {
149
+ if (this.#offline) {
150
+ throw new CliError("validation_error", "`--offline` reads what was recorded; it cannot sync");
151
+ }
152
+ const cache = this.#cache;
153
+ if (!cache) {
154
+ throw new CliError("configuration_error", `there is no local store for profile "${this.#store.profile}" to sync into — the note above says why`);
155
+ }
156
+ // Before connecting, or the login would carry the marker this is meant to discard.
157
+ cache.forgetSyncMarker();
158
+ await this.#connectOnce();
159
+ // The login names a fraction of the people in its own chats, so a full take that stopped
160
+ // here would store ids without names for most of them.
161
+ await this.#peopleFor(asArray(this.#session().chats));
162
+ return { ...(this.#merged ?? { known: 0, added: 0, changed: 0 }), known: cache.people.count(), full: true };
105
163
  },
106
164
  };
107
165
  messages = {
108
- list: async (chatId, limit = 20) => {
109
- if (this.#offline)
110
- return this.#recorded(this.#cache?.messages.read(chatId, limit, ANY_AGE), "messages");
166
+ /**
167
+ * **Paged backwards through time, not by page number.** MAX's history is already anchored —
168
+ * it takes a moment and answers with what came before it — so `--before` is exact where a page
169
+ * number over a live conversation would repeat and skip rows.
170
+ *
171
+ * `hasMore` here is a claim about the copy we hold, never about the chat: a full page back is
172
+ * the only evidence there is that another page exists.
173
+ */
174
+ list: async (chatId, options = {}) => {
175
+ const limit = options.limit ?? 20;
176
+ if (this.#offline) {
177
+ const stored = this.#recorded(this.#cache?.messages.read(chatId, limit, ANY_AGE), "messages");
178
+ return { items: stored, hasMore: stored.length >= limit };
179
+ }
111
180
  await this.#connectOnce();
112
181
  const session = this.#session();
113
182
  // `interactive: false` and no CHAT_MARK: reading history must not mark anything read (§19).
114
183
  const answer = await this.#wire.chats.history({
115
184
  chatId,
116
- from: Date.now(),
185
+ from: options.before ?? Date.now(),
117
186
  forward: 0,
118
187
  backward: limit,
119
188
  forwardTime: 0,
@@ -126,7 +195,34 @@ export class MaxClient {
126
195
  const lookup = { names: namesFrom(session.contacts), ...viewer(this.#store) };
127
196
  const messages = asArray(answer.messages).map((raw) => toMessage(raw, chatId, lookup));
128
197
  this.#cache?.messages.write(chatId, messages);
129
- return messages;
198
+ return { items: messages, hasMore: messages.length >= limit };
199
+ },
200
+ /**
201
+ * Turns what `--before` was given into a moment.
202
+ *
203
+ * **ISO 8601 is a time; a bare integer is a message id.** Both a millisecond timestamp and a
204
+ * message id are runs of digits — 13 and 18 of them on this account — and deciding between
205
+ * them by length is a trap that fires the first time either changes size. So the rule is what
206
+ * the string looks like, not how big it is.
207
+ *
208
+ * An id we have never stored is exactly what a deleted message looks like, because it is gone
209
+ * from the history MAX returns too. That is a refusal naming the way round it rather than a
210
+ * guess: read as milliseconds, an 18-digit id points six hundred million years from now.
211
+ */
212
+ before: (reference) => {
213
+ const wanted = reference.trim();
214
+ if (!/^\d+$/.test(wanted)) {
215
+ const time = Date.parse(wanted);
216
+ if (Number.isNaN(time)) {
217
+ throw new CliError("validation_error", `--before takes a message id or an ISO 8601 time, not "${wanted}"`);
218
+ }
219
+ return time;
220
+ }
221
+ const time = this.#cache?.messages.timeOf(wanted);
222
+ if (time === undefined) {
223
+ throw new CliError("not_found", `no message ${wanted} in this profile's record — read the chat once first, or give --before an ISO 8601 time`);
224
+ }
225
+ return time;
130
226
  },
131
227
  /**
132
228
  * Sends one message, retrying **only with the same `cid`**.
@@ -139,7 +235,7 @@ export class MaxClient {
139
235
  * So one retry, same `cid`, and nothing beyond that. What is still unmeasured is how long the
140
236
  * server remembers a `cid`; the two probes were seconds apart. If the retry also fails the
141
237
  * answer is `outcome_unknown` — never failed, never sent — and it names the `cid`, because
142
- * `max send --cid <n>` can then repeat the attempt without risking a second message.
238
+ * `max messages send … --cid <n>` can then repeat the attempt without risking a second message.
143
239
  */
144
240
  send: async (chatId, text, options = {}) => {
145
241
  if (this.#offline)
@@ -167,7 +263,7 @@ export class MaxClient {
167
263
  }
168
264
  catch {
169
265
  throw new CliError("outcome_unknown", `the message may or may not have been sent (${failure.message}) — ` +
170
- `\`max send --cid ${cid}\` repeats the attempt without risking a second copy`, { cid });
266
+ `\`max messages send <chat> <text> --cid ${cid}\` repeats the attempt without risking a second copy`, { cid });
171
267
  }
172
268
  }
173
269
  // What the cache holds for this chat is now one message short of the truth.
@@ -177,33 +273,146 @@ export class MaxClient {
177
273
  },
178
274
  };
179
275
  /**
180
- * Opens the connection and logs in with the stored token.
276
+ * Opens the connection and logs in with the stored token, or with one offered for trial.
181
277
  *
182
278
  * The login response carries the profile, the chats, the contacts and recent messages, so most
183
279
  * commands need no further request — measured against MAX on 2026-09-19.
280
+ *
281
+ * **A candidate token is tried and not stored**, which is what lets `adoptToken` write to the
282
+ * keyring only after MAX has accepted it. Nothing here writes a token; see `session/adopt.ts`.
184
283
  */
185
- async connect() {
186
- const token = this.#store.readToken();
284
+ async connect({ token: candidate } = {}) {
285
+ const token = candidate ?? this.#store.readToken();
187
286
  if (!token) {
188
287
  // The fix has to carry the profile, or it logs the wrong one in: a name nobody has logged
189
288
  // in under is the ordinary shape of this failure now that the first word is the profile.
190
289
  throw new CliError("authentication_error", `no session for profile "${this.#store.profile}" — run \`max ${asFirstWord(this.#store.profile)}session start\``);
191
290
  }
192
291
  const state = this.#store.readState();
292
+ const sync = this.#cache?.syncMarker();
193
293
  try {
194
294
  await this.#connection.open();
195
- this.#login = await startSession(this.#invoke, { token, deviceId: state.deviceId });
295
+ this.#login = await startSession(this.#invoke, {
296
+ token,
297
+ deviceId: state.deviceId,
298
+ ...(sync === undefined ? {} : { sync }),
299
+ });
196
300
  }
197
301
  catch (error) {
198
302
  throw asCliError(error);
199
303
  }
200
304
  const viewerId = toProfile(record(this.#login.profile) ?? {}).id;
305
+ // **Before `writeState`**, so a login we are about to refuse does not count itself or move
306
+ // `lastLoginAt`. A profile is a person, not a directory name: if this token belongs to someone
307
+ // else, every later command in this process would send as them and nothing would say so.
308
+ // Switching accounts has a door already — `session end` clears the id along with the token.
309
+ if (viewerId && state.viewerId && viewerId !== state.viewerId) {
310
+ throw new CliError("authentication_error", `this token is for a different account than profile "${this.#store.profile}" was set up with — ` +
311
+ `run \`max ${asFirstWord(this.#store.profile)}session end\` first if you meant to switch`);
312
+ }
201
313
  this.#store.writeState({
202
314
  ...state,
203
315
  ...(viewerId ? { viewerId } : {}),
204
316
  logins: state.logins + 1,
205
317
  lastLoginAt: new Date().toISOString(),
206
318
  });
319
+ this.#keepRotatedToken(token);
320
+ this.#mergeLogin(viewerId);
321
+ }
322
+ /**
323
+ * **MAX offers a replacement for a credential that has aged, and until 2026-09-22 we threw it
324
+ * away** — measured, `pnpm probe:token`. Presenting a token pasted months earlier answers with a
325
+ * different one; presenting *that* one answers with the same one back, so this writes once and
326
+ * then stops rather than on every command.
327
+ *
328
+ * The old token keeps working — the last months are the proof — so this is hygiene, not repair.
329
+ *
330
+ * ⚠ **After the identity refusal above, never before it.** A token belonging to somebody else
331
+ * reaches this method only if that check has already let it through; persisting it earlier would
332
+ * overwrite the owner's working credential with a stranger's — a worse version of the defect
333
+ * `MAX-12` exists to fix.
334
+ *
335
+ * **A keyring that will not take it does not fail the command.** The write can fail for reasons
336
+ * that have nothing to do with the command being run — a locked keyring, no session bus — and
337
+ * the old token still works, which is what makes carrying on correct. The reason goes to the
338
+ * diagnostic stream, because failing quietly is not failing invisibly (`NEED-97`).
339
+ *
340
+ * Nothing here prints, returns or compares-aloud the value: the only comparison is against the
341
+ * token we sent, and the only thing that leaves is whether a write failed.
342
+ */
343
+ #keepRotatedToken(sent) {
344
+ const rotated = this.#session().token;
345
+ if (typeof rotated !== "string" || rotated === "" || rotated === sent)
346
+ return;
347
+ try {
348
+ this.#store.writeToken(rotated);
349
+ }
350
+ catch (error) {
351
+ this.#warn(`the refreshed session could not be saved, so the previous one is still in use: ${reasonOf(error)}`);
352
+ }
353
+ }
354
+ /**
355
+ * Writes what the login just told us into the store, **before the command renders**, so a
356
+ * listing prints the names this run brought rather than the previous run's.
357
+ *
358
+ * ⚠ **A delta is mostly empty and that is correct.** After the first login MAX sends only what
359
+ * changed, so an absent person is an unchanged person — never a departed one. Nothing here
360
+ * deletes, with the single exception of a chat's membership, which MAX restates in full whenever
361
+ * it sends that chat at all.
362
+ *
363
+ * **It never fails the command.** Nobody asked for the store; a locked database or a full disk
364
+ * must not lose an answer MAX has already given. The reason goes to the diagnostic stream,
365
+ * because failing quietly is not the same as failing invisibly (`NEED-97`) — and the marker
366
+ * stays where it was, so the next login asks for the same delta again rather than for changes
367
+ * since rows that were never written.
368
+ */
369
+ #mergeLogin(viewerId) {
370
+ const cache = this.#cache;
371
+ const marker = asMarker(this.#session().time);
372
+ if (!cache || marker === undefined)
373
+ return;
374
+ const chats = asArray(this.#session().chats);
375
+ const members = new Map();
376
+ for (const raw of chats) {
377
+ const chat = toChat(raw);
378
+ // A channel lists four of its hundred and seventy-eight thousand subscribers, so its
379
+ // `participants` is not a membership — storing it would be storing a wrong answer.
380
+ if (!chat.id || chat.kind === "channel")
381
+ continue;
382
+ const participants = this.#participantsOf(raw, viewerId);
383
+ if (participants !== undefined)
384
+ members.set(chat.id, participants);
385
+ }
386
+ try {
387
+ this.#merged = cache.mergeDelta({
388
+ chats: chats.map(toChat).filter((chat) => chat.id !== ""),
389
+ people: asArray(this.#session().contacts)
390
+ .map(toContact)
391
+ .filter((contact) => contact.id !== ""),
392
+ members,
393
+ marker,
394
+ });
395
+ }
396
+ catch (error) {
397
+ this.#warn(`the local record did not take this login, so nothing was kept from it: ${reasonOf(error)}`);
398
+ }
399
+ }
400
+ /** One page of contacts out of the store — the same query online and offline. */
401
+ #pageOfContacts(cache, order, limit, offset) {
402
+ const items = cache.people.contacts({ order, limit: limit ?? Number.MAX_SAFE_INTEGER, offset });
403
+ return { items, hasMore: offset + items.length < cache.people.countContacts() };
404
+ }
405
+ /**
406
+ * Everyone in the chat except us, or **`undefined` when MAX did not say who is in it**.
407
+ *
408
+ * ⚠ The difference is the whole of it. A delta re-sends a chat because a message arrived and
409
+ * carries no `participants`; read as "nobody is in this chat", that empties the membership and
410
+ * the person on the other side stops being a contact. "Did not say" is not "nobody", and only
411
+ * the first of the two may replace anything.
412
+ */
413
+ #participantsOf(chat, viewerId) {
414
+ const participants = record(chat.participants);
415
+ return participants === undefined ? undefined : Object.keys(participants).filter((id) => id !== viewerId);
207
416
  }
208
417
  async close() {
209
418
  await this.#connection.close();
@@ -318,20 +527,37 @@ export class MaxClient {
318
527
  if (contact.id)
319
528
  people.set(contact.id, contact);
320
529
  }
530
+ const viewerId = this.#store.readState().viewerId;
321
531
  const missing = new Set();
322
532
  for (const chat of chats) {
323
- const partner = this.#partnerOf(chat);
324
- if (partner !== undefined && !people.has(partner))
325
- missing.add(partner);
533
+ if (toChat(chat).kind === "channel")
534
+ continue;
535
+ for (const id of this.#participantsOf(chat, viewerId) ?? [])
536
+ if (!people.has(id))
537
+ missing.add(id);
326
538
  }
327
- if (missing.size > 0) {
328
- const answer = await this.#wire.contacts.info({ contactIds: [...missing] });
539
+ const named = [];
540
+ for (const batch of batched([...missing], CONTACT_INFO_BATCH)) {
541
+ const answer = await this.#wire.contacts.info({ contactIds: batch });
329
542
  for (const raw of asArray(answer.contacts)) {
330
543
  const contact = toContact(raw);
331
- if (contact.id)
332
- people.set(contact.id, contact);
544
+ if (!contact.id)
545
+ continue;
546
+ people.set(contact.id, contact);
547
+ named.push(contact);
333
548
  }
334
549
  }
550
+ // Written here rather than left in memory: the process ends in a moment, and the next one
551
+ // should not pay for these names again.
552
+ //
553
+ // ⚠ **And the order is recomputed after**, not before. These people did not exist when the
554
+ // login's chats were written, so the recency that was set then reached only the handful the
555
+ // login itself named — 6 of 22 on the real account, with every other dialog partner sorting
556
+ // as never-messaged.
557
+ if (named.length > 0) {
558
+ this.#cache?.people.upsert(named, "info");
559
+ this.#cache?.people.refreshRecency();
560
+ }
335
561
  this.#people = people;
336
562
  return people;
337
563
  }
@@ -350,8 +576,37 @@ export class MaxClient {
350
576
  return this.#login;
351
577
  }
352
578
  }
579
+ /**
580
+ * **One `CONTACT_INFO` for a hundred people.** The bound is unmeasured; the comparable one is
581
+ * `chatsCount`, where 100 is accepted and 200 comes back out of range (`PROTO-3`). Somebody in
582
+ * forty groups is the case that will find the real number, and it will find it as a refusal that
583
+ * names itself rather than as a wrong answer.
584
+ */
585
+ const CONTACT_INFO_BATCH = 100;
586
+ const batched = (items, size) => {
587
+ const batches = [];
588
+ for (let at = 0; at < items.length; at += size)
589
+ batches.push(items.slice(at, at + size));
590
+ return batches;
591
+ };
592
+ /** Paging over a list already in hand — the fallback for when there is no store to page in SQL. */
593
+ const paged = (items, limit, offset) => {
594
+ const page = limit === undefined ? items.slice(offset) : items.slice(offset, offset + limit);
595
+ return { items: page, hasMore: offset + page.length < items.length };
596
+ };
353
597
  /** `--offline` was asked for explicitly, so age is not a reason to refuse what was recorded. */
354
598
  const ANY_AGE = Number.POSITIVE_INFINITY;
599
+ /**
600
+ * The marker only means anything if MAX gave us one. A login without a `time` is not a reason to
601
+ * store `0` — that would tell the next login to send everything, which is exactly what a stored
602
+ * marker exists to stop.
603
+ */
604
+ const asMarker = (time) => typeof time === "number" && Number.isFinite(time) && time > 0 ? time : undefined;
605
+ /** The reason, never the payload: a store's failure is a code, and the rows are people's names. */
606
+ const reasonOf = (error) => {
607
+ const code = error?.code;
608
+ return typeof code === "string" ? code : error instanceof Error ? error.name : "an unknown problem";
609
+ };
355
610
  const viewer = (store) => {
356
611
  const viewerId = store.readState().viewerId;
357
612
  return viewerId === undefined ? {} : { viewerId };
@@ -1 +1 @@
1
- {"version":3,"file":"client.js","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAA;AAE5C,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAA;AAEpF,OAAO,EAAe,UAAU,EAAE,MAAM,iCAAiC,CAAA;AACzE,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAA;AAC1C,OAAO,EAAE,UAAU,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAA;AAEpE,OAAO,EAAE,QAAQ,EAAwB,KAAK,EAAE,MAAM,kBAAkB,CAAA;AACxE,OAAO,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAA;AAErD,OAAO,EAAE,YAAY,EAAE,aAAa,EAAkC,MAAM,iBAAiB,CAAA;AA8B7F;;;;;;;;;;;GAWG;AACH,MAAM,OAAO,SAAS;IACX,MAAM,CAAc;IACpB,WAAW,CAAY;IACvB,KAAK,CAA2B;IAChC,MAAM,CAAwB;IAC9B,QAAQ,CAAS;IACjB,OAAO,CAAkC;IACzC,OAAO,GAAG,CAAC,CAAC,SAAS,EAAE,OAAO,EAAE,EAAE,CAAC,IAAI,CAAC,KAAK,CAAC,SAAS,EAAE,OAAO,CAAC,CAAW,CAAA;IAC5E,KAAK,GAAG,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@@ -1 +1 @@
1
- {"version":3,"file":"chats.d.ts","sourceRoot":"","sources":["../../src/commands/chats.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AAInC,eAAO,MAAM,YAAY,QAAO,OA0B/B,CAAA"}
1
+ {"version":3,"file":"chats.d.ts","sourceRoot":"","sources":["../../src/commands/chats.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AAKnC,eAAO,MAAM,YAAY,QAAO,OAuB/B,CAAA"}