@leemour/max-cli 0.1.0 → 0.3.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 (109) hide show
  1. package/README.md +28 -12
  2. package/dist/cache/index.d.ts.map +1 -1
  3. package/dist/cache/index.js +3 -0
  4. package/dist/cache/index.js.map +1 -1
  5. package/dist/cache/schema.d.ts +13 -1
  6. package/dist/cache/schema.d.ts.map +1 -1
  7. package/dist/cache/schema.js +159 -8
  8. package/dist/cache/schema.js.map +1 -1
  9. package/dist/cache/store.d.ts +115 -4
  10. package/dist/cache/store.d.ts.map +1 -1
  11. package/dist/cache/store.js +248 -27
  12. package/dist/cache/store.js.map +1 -1
  13. package/dist/client.d.ts +91 -9
  14. package/dist/client.d.ts.map +1 -1
  15. package/dist/client.js +371 -33
  16. package/dist/client.js.map +1 -1
  17. package/dist/commands/chats.d.ts.map +1 -1
  18. package/dist/commands/chats.js +25 -8
  19. package/dist/commands/chats.js.map +1 -1
  20. package/dist/commands/contacts.d.ts.map +1 -1
  21. package/dist/commands/contacts.js +51 -5
  22. package/dist/commands/contacts.js.map +1 -1
  23. package/dist/commands/context.d.ts +4 -1
  24. package/dist/commands/context.d.ts.map +1 -1
  25. package/dist/commands/context.js +4 -2
  26. package/dist/commands/context.js.map +1 -1
  27. package/dist/commands/login.d.ts +15 -0
  28. package/dist/commands/login.d.ts.map +1 -0
  29. package/dist/commands/login.js +43 -0
  30. package/dist/commands/login.js.map +1 -0
  31. package/dist/commands/logout.d.ts +10 -0
  32. package/dist/commands/logout.d.ts.map +1 -0
  33. package/dist/commands/logout.js +22 -0
  34. package/dist/commands/logout.js.map +1 -0
  35. package/dist/commands/me.d.ts +3 -0
  36. package/dist/commands/me.d.ts.map +1 -0
  37. package/dist/commands/me.js +18 -0
  38. package/dist/commands/me.js.map +1 -0
  39. package/dist/commands/messages.d.ts.map +1 -1
  40. package/dist/commands/messages.js +82 -3
  41. package/dist/commands/messages.js.map +1 -1
  42. package/dist/commands/paging.d.ts +41 -0
  43. package/dist/commands/paging.d.ts.map +1 -0
  44. package/dist/commands/paging.js +54 -0
  45. package/dist/commands/paging.js.map +1 -0
  46. package/dist/commands/send.d.ts +10 -0
  47. package/dist/commands/send.d.ts.map +1 -0
  48. package/dist/commands/send.js +30 -0
  49. package/dist/commands/send.js.map +1 -0
  50. package/dist/commands/session.d.ts.map +1 -1
  51. package/dist/commands/session.js +3 -3
  52. package/dist/commands/session.js.map +1 -1
  53. package/dist/config.d.ts +16 -2
  54. package/dist/config.d.ts.map +1 -1
  55. package/dist/config.js +15 -1
  56. package/dist/config.js.map +1 -1
  57. package/dist/domain/map.d.ts +1 -0
  58. package/dist/domain/map.d.ts.map +1 -1
  59. package/dist/domain/map.js +44 -3
  60. package/dist/domain/map.js.map +1 -1
  61. package/dist/domain/models.d.ts +54 -0
  62. package/dist/domain/models.d.ts.map +1 -1
  63. package/dist/generated/operations.generated.d.ts +1 -0
  64. package/dist/generated/operations.generated.d.ts.map +1 -1
  65. package/dist/output.d.ts +7 -4
  66. package/dist/output.d.ts.map +1 -1
  67. package/dist/output.js +8 -11
  68. package/dist/output.js.map +1 -1
  69. package/dist/program.d.ts.map +1 -1
  70. package/dist/program.js +4 -2
  71. package/dist/program.js.map +1 -1
  72. package/dist/protocol/connection.d.ts +10 -0
  73. package/dist/protocol/connection.d.ts.map +1 -1
  74. package/dist/protocol/connection.js +11 -3
  75. package/dist/protocol/connection.js.map +1 -1
  76. package/dist/protocol/session.d.ts +54 -0
  77. package/dist/protocol/session.d.ts.map +1 -0
  78. package/dist/protocol/session.js +57 -0
  79. package/dist/protocol/session.js.map +1 -0
  80. package/dist/rendering/messages.d.ts +19 -0
  81. package/dist/rendering/messages.d.ts.map +1 -0
  82. package/dist/rendering/messages.js +137 -0
  83. package/dist/rendering/messages.js.map +1 -0
  84. package/dist/runs/events.d.ts +1 -1
  85. package/dist/runs/recording.d.ts +2 -2
  86. package/dist/runs/recording.d.ts.map +1 -1
  87. package/dist/runs/recording.js +3 -3
  88. package/dist/runs/recording.js.map +1 -1
  89. package/dist/session/adopt.d.ts +22 -0
  90. package/dist/session/adopt.d.ts.map +1 -0
  91. package/dist/session/adopt.js +29 -0
  92. package/dist/session/adopt.js.map +1 -0
  93. package/dist/session/handshake.d.ts +14 -1
  94. package/dist/session/handshake.d.ts.map +1 -1
  95. package/dist/session/handshake.js +5 -5
  96. package/dist/session/handshake.js.map +1 -1
  97. package/dist/spec/operations/auth.d.ts +42 -0
  98. package/dist/spec/operations/auth.d.ts.map +1 -0
  99. package/dist/spec/operations/session.d.ts +16 -0
  100. package/dist/spec/operations/session.d.ts.map +1 -1
  101. package/dist/spec/operations/session.js +21 -1
  102. package/dist/spec/operations/session.js.map +1 -1
  103. package/dist/testing/sandbox.d.ts +2 -0
  104. package/dist/testing/sandbox.d.ts.map +1 -0
  105. package/dist/testing/sandbox.js +24 -0
  106. package/dist/testing/sandbox.js.map +1 -0
  107. package/dist/version.d.ts +1 -1
  108. package/dist/version.js +1 -1
  109. package/package.json +9 -5
@@ -1 +1 @@
1
- {"version":3,"file":"connection.js","sourceRoot":"","sources":["../../src/protocol/connection.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,IAAI,CAAA;AAC9B,OAAO,EAAE,OAAO,EAAE,WAAW,EAAE,WAAW,EAAmC,MAAM,YAAY,CAAA;AAE/F,MAAM,CAAC,MAAM,iBAAiB,GAAG,iCAAiC,CAAA;AAClE,iGAAiG;AACjG,MAAM,CAAC,MAAM,UAAU,GAAG,oBAAoB,CAAA;AA2B9C,MAAM,OAAO,aAAc,SAAQ,KAAK;IAC7B,MAAM,CAAQ;IACd,OAAO,CAAgB;IAEhC,YAAY,OAAe,EAAE,MAAc,EAAE,OAAuB;QAClE,KAAK,CAAC,OAAO,CAAC,CAAA;QACd,IAAI,CAAC,IAAI,GAAG,eAAe,CAAA;QAC3B,IAAI,CAAC,MAAM,GAAG,MAAM,CAAA;QACpB,IAAI,C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AAK,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,IAAI,IAAI,CAAC,QAAQ,CAAC,MAAM,EAAE,EAAE,CAAC;YACvD,YAAY,CAAC,KAAK,CAAC,CAAA;YACnB,MAAM,CAAC,KAAK,CAAC,CAAA;QACf,CAAC;QACD,IAAI,CAAC,QAAQ,CAAC,KAAK,EAAE,CAAA;IACvB,CAAC;CACF"}
@@ -0,0 +1,54 @@
1
+ import type { Connection } from "./connection.js";
2
+ import type { Payload } from "./frame.js";
3
+ export declare const Opcode: {
4
+ readonly SESSION_INIT: 6;
5
+ readonly PROFILE: 16;
6
+ readonly LOGIN: 19;
7
+ readonly LOGOUT: 20;
8
+ /**
9
+ * Contact details by id. **Sources disagree about its neighbour**: opcode 36 is `CONTACT_LIST` in
10
+ * tsmax and PyMax, and `GET_BLOCKED` in the protocol documentation. We use 32, which both call the
11
+ * same thing, and stay away from 36 until somebody has watched what it returns.
12
+ */
13
+ readonly CONTACT_INFO: 32;
14
+ readonly CHAT_HISTORY: 49;
15
+ readonly CHATS_LIST: 53;
16
+ readonly MSG_SEND: 64;
17
+ };
18
+ /**
19
+ * What we claim to be. **We imitate MAX's own web client rather than announcing ourselves**
20
+ * (REQUIREMENTS §34), so none of these values names this tool.
21
+ *
22
+ * Shape and field names from `max-api-docs/protocol/auth.md`, cross-checked against tsmax's
23
+ * `createWebAgent`. The device identity is not here: it is generated once per profile and stored,
24
+ * because a client that presents a new device on every command is not imitating anything.
25
+ */
26
+ export declare const WEB_USER_AGENT: {
27
+ readonly deviceType: "WEB";
28
+ readonly pushDeviceType: "WEBPUSH";
29
+ readonly locale: "ru";
30
+ readonly deviceLocale: "ru";
31
+ readonly osVersion: "Linux";
32
+ readonly deviceName: "Chrome";
33
+ readonly headerUserAgent: "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/147.0.0.0 Safari/537.36";
34
+ readonly appVersion: "26.5.5";
35
+ readonly screen: "1080x1920 1.0x";
36
+ readonly timezone: "Europe/Madrid";
37
+ };
38
+ export interface SessionOptions {
39
+ token: string;
40
+ deviceId: string;
41
+ /** How many chats LOGIN should return with the profile. */
42
+ chatsCount?: number;
43
+ }
44
+ /**
45
+ * INIT then LOGIN, in that order, before anything else will be answered
46
+ * (`max-api-docs/protocol/auth.md`).
47
+ *
48
+ * **`interactive` is false.** The web client sends true because a person is looking at it; we are
49
+ * a script reading, and whether that flag moves presence or read state is not settled (`RES-5`).
50
+ * Claiming a human is present when none is, is the kind of small lie that turns into a
51
+ * side effect nobody can trace.
52
+ */
53
+ export declare const startSession: (connection: Connection, { token, deviceId, chatsCount }: SessionOptions) => Promise<Payload>;
54
+ //# sourceMappingURL=session.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"session.d.ts","sourceRoot":"","sources":["../../src/protocol/session.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAA;AACjD,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,YAAY,CAAA;AAEzC,eAAO,MAAM,MAAM;;;;;IAKjB;;;;OAIG;;;;;CAKK,CAAA;AAEV;;;;;;;GAOG;AACH,eAAO,MAAM,cAAc;;;;;;;;;;;CAYjB,CAAA;AAEV,MAAM,WAAW,cAAc;IAC7B,KAAK,EAAE,MAAM,CAAA;IACb,QAAQ,EAAE,MAAM,CAAA;IAChB,2DAA2D;IAC3D,UAAU,CAAC,EAAE,MAAM,CAAA;CACpB;AAED;;;;;;;;GAQG;AACH,eAAO,MAAM,YAAY,GACvB,YAAY,UAAU,EACtB,iCAAsC,cAAc,KACnD,OAAO,CAAC,OAAO,CAYjB,CAAA"}
@@ -0,0 +1,57 @@
1
+ export const Opcode = {
2
+ SESSION_INIT: 6,
3
+ PROFILE: 16,
4
+ LOGIN: 19,
5
+ LOGOUT: 20,
6
+ /**
7
+ * Contact details by id. **Sources disagree about its neighbour**: opcode 36 is `CONTACT_LIST` in
8
+ * tsmax and PyMax, and `GET_BLOCKED` in the protocol documentation. We use 32, which both call the
9
+ * same thing, and stay away from 36 until somebody has watched what it returns.
10
+ */
11
+ CONTACT_INFO: 32,
12
+ CHAT_HISTORY: 49,
13
+ CHATS_LIST: 53,
14
+ MSG_SEND: 64,
15
+ };
16
+ /**
17
+ * What we claim to be. **We imitate MAX's own web client rather than announcing ourselves**
18
+ * (REQUIREMENTS §34), so none of these values names this tool.
19
+ *
20
+ * Shape and field names from `max-api-docs/protocol/auth.md`, cross-checked against tsmax's
21
+ * `createWebAgent`. The device identity is not here: it is generated once per profile and stored,
22
+ * because a client that presents a new device on every command is not imitating anything.
23
+ */
24
+ export const WEB_USER_AGENT = {
25
+ deviceType: "WEB",
26
+ pushDeviceType: "WEBPUSH",
27
+ locale: "ru",
28
+ deviceLocale: "ru",
29
+ osVersion: "Linux",
30
+ deviceName: "Chrome",
31
+ headerUserAgent: "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/147.0.0.0 Safari/537.36",
32
+ appVersion: "26.5.5",
33
+ screen: "1080x1920 1.0x",
34
+ timezone: "Europe/Madrid",
35
+ };
36
+ /**
37
+ * INIT then LOGIN, in that order, before anything else will be answered
38
+ * (`max-api-docs/protocol/auth.md`).
39
+ *
40
+ * **`interactive` is false.** The web client sends true because a person is looking at it; we are
41
+ * a script reading, and whether that flag moves presence or read state is not settled (`RES-5`).
42
+ * Claiming a human is present when none is, is the kind of small lie that turns into a
43
+ * side effect nobody can trace.
44
+ */
45
+ export const startSession = async (connection, { token, deviceId, chatsCount = 40 }) => {
46
+ await connection.invoke(Opcode.SESSION_INIT, { userAgent: WEB_USER_AGENT, deviceId });
47
+ return await connection.invoke(Opcode.LOGIN, {
48
+ token,
49
+ interactive: false,
50
+ chatsCount,
51
+ chatsSync: 0,
52
+ contactsSync: 0,
53
+ presenceSync: 0,
54
+ draftsSync: 0,
55
+ });
56
+ };
57
+ //# sourceMappingURL=session.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"session.js","sourceRoot":"","sources":["../../src/protocol/session.ts"],"names":[],"mappings":"AAGA,MAAM,CAAC,MAAM,MAAM,GAAG;IACpB,YAAY,EAAE,CAAC;IACf,OAAO,EAAE,EAAE;IACX,KAAK,EAAE,EAAE;IACT,MAAM,EAAE,EAAE;IACV;;;;OAIG;IACH,YAAY,EAAE,EAAE;IAChB,YAAY,EAAE,EAAE;IAChB,UAAU,EAAE,EAAE;IACd,QAAQ,EAAE,EAAE;CACJ,CAAA;AAEV;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,cAAc,GAAG;IAC5B,UAAU,EAAE,KAAK;IACjB,cAAc,EAAE,SAAS;IACzB,MAAM,EAAE,IAAI;IACZ,YAAY,EAAE,IAAI;IAClB,SAAS,EAAE,OAAO;IAClB,UAAU,EAAE,QAAQ;IACpB,eAAe,EACb,uGAAuG;IACzG,UAAU,EAAE,QAAQ;IACpB,MAAM,EAAE,gBAAgB;IACxB,QAAQ,EAAE,eAAe;CACjB,CAAA;AASV;;;;;;;;GAQG;AACH,MAAM,CAAC,MAAM,YAAY,GAAG,KAAK,EAC/B,UAAsB,EACtB,EAAE,KAAK,EAAE,QAAQ,EAAE,UAAU,GAAG,EAAE,EAAkB,EAClC,EAAE;IACpB,MAAM,UAAU,CAAC,MAAM,CAAC,MAAM,CAAC,YAAY,EAAE,EAAE,SAAS,EAAE,cAAc,EAAE,QAAQ,EAAE,CAAC,CAAA;IAErF,OAAO,MAAM,UAAU,CAAC,MAAM,CAAC,MAAM,CAAC,KAAK,EAAE;QAC3C,KAAK;QACL,WAAW,EAAE,KAAK;QAClB,UAAU;QACV,SAAS,EAAE,CAAC;QACZ,YAAY,EAAE,CAAC;QACf,YAAY,EAAE,CAAC;QACf,UAAU,EAAE,CAAC;KACd,CAAC,CAAA;AACJ,CAAC,CAAA"}
@@ -0,0 +1,19 @@
1
+ import type { Message, MessageHit } from "../domain/models.js";
2
+ export interface RenderOptions {
3
+ /** 0 — the conversation; 1 — the ids worth searching by; 2 — everything the model knows. */
4
+ verbosity?: 0 | 1 | 2;
5
+ width?: number;
6
+ /**
7
+ * Whether to style at all. **Decided by the caller**: `styleText` checks the stream under Node and
8
+ * not under Bun, which styles a pipe too (measured 2026-09-22).
9
+ */
10
+ color?: boolean;
11
+ /** A colour per sender, `вы` keeping cyan to itself. */
12
+ senderColors?: boolean;
13
+ locale?: string;
14
+ timeZone?: string;
15
+ profile?: string;
16
+ }
17
+ export declare const renderMessages: (messages: (Message | MessageHit)[], options?: RenderOptions) => string;
18
+ export declare const renderMessage: (message: Message | MessageHit, options?: RenderOptions) => string;
19
+ //# sourceMappingURL=messages.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"messages.d.ts","sourceRoot":"","sources":["../../src/rendering/messages.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAc,OAAO,EAAE,UAAU,EAAiB,MAAM,qBAAqB,CAAA;AAEzF,MAAM,WAAW,aAAa;IAC5B,4FAA4F;IAC5F,SAAS,CAAC,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC,CAAA;IACrB,KAAK,CAAC,EAAE,MAAM,CAAA;IACd;;;OAGG;IACH,KAAK,CAAC,EAAE,OAAO,CAAA;IACf,wDAAwD;IACxD,YAAY,CAAC,EAAE,OAAO,CAAA;IACtB,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,OAAO,CAAC,EAAE,MAAM,CAAA;CACjB;AASD,eAAO,MAAM,cAAc,GAAI,UAAU,CAAC,OAAO,GAAG,UAAU,CAAC,EAAE,EAAE,UAAS,aAAkB,KAAG,MAchG,CAAA;AAED,eAAO,MAAM,aAAa,GAAI,SAAS,OAAO,GAAG,UAAU,EAAE,UAAS,aAAkB,KAAG,MA8C1F,CAAA"}
@@ -0,0 +1,137 @@
1
+ import { styleText } from "node:util";
2
+ import stringWidth from "string-width";
3
+ import wrapAnsi from "wrap-ansi";
4
+ const TIME_WIDTH = 8;
5
+ const INDENT = " ".repeat(TIME_WIDTH + 2);
6
+ const MIN_WIDTH = 40;
7
+ const SENDER_COLOURS = ["green", "yellow", "magenta", "blue", "red"];
8
+ export const renderMessages = (messages, options = {}) => {
9
+ if (messages.length === 0)
10
+ return "(nothing)";
11
+ const day = dayFormatter(options);
12
+ const paint = painter(options);
13
+ let previous;
14
+ const blocks = [];
15
+ for (const message of messages) {
16
+ const date = day(message.timestamp);
17
+ if (date !== previous)
18
+ blocks.push(paint("dim", `── ${date} ──`));
19
+ previous = date;
20
+ blocks.push(renderMessage(message, options));
21
+ }
22
+ return blocks.join("\n\n");
23
+ };
24
+ export const renderMessage = (message, options = {}) => {
25
+ const paint = painter(options);
26
+ const width = Math.max(MIN_WIDTH, options.width ?? 80);
27
+ const room = width - INDENT.length;
28
+ const time = timeFormatter(options);
29
+ const verbosity = options.verbosity ?? 0;
30
+ const chat = "chatTitle" in message ? paint("dim", ` · ${message.chatTitle ?? message.chatId}`) : "";
31
+ const lines = [`${paint("dim", time(message.timestamp))} ${senderOf(message, options)}${chat}`];
32
+ const body = (text) => wrapAnsi(text, room, { hard: true }).split("\n");
33
+ if (message.replyTo)
34
+ lines.push(paint("dim", preview("↳", message.replyTo, room)));
35
+ if (message.forwardedFrom) {
36
+ lines.push(paint("dim", `↪ ${nameOf(message.forwardedFrom)}`));
37
+ if (message.forwardedFrom.text)
38
+ lines.push(...body(message.forwardedFrom.text));
39
+ lines.push(...attachmentLines(message.forwardedFrom.attachments, paint, options));
40
+ }
41
+ if (message.text)
42
+ lines.push(...body(message.text));
43
+ lines.push(...attachmentLines(message.attachments, paint, options));
44
+ if (message.editedAt)
45
+ lines.push(paint("dim", `edited ${editedAt(message, options)}`));
46
+ if (verbosity >= 1) {
47
+ const fields = [
48
+ ["message", message.id],
49
+ ["sender", message.senderId],
50
+ ["chat", message.chatId],
51
+ ["reply to", message.replyTo?.id],
52
+ ["forward of", message.forwardedFrom?.id],
53
+ ...message.attachments.map((a) => ["link", a.url]),
54
+ ];
55
+ if (verbosity >= 2) {
56
+ fields.push(["provider", "max"], ["profile", options.profile], ["sent", message.timestamp], ["edited", message.editedAt], ["outgoing", message.outgoing === null ? "unknown" : String(message.outgoing)], ...message.attachments.map((a) => ["attachment", JSON.stringify(a)]));
57
+ }
58
+ const shown = fields.filter((field) => typeof field[1] === "string");
59
+ const label = Math.max(...shown.map(([key]) => key.length));
60
+ lines.push("", ...shown.map(([key, value]) => paint("dim", `${key.padEnd(label)} ${value}`)));
61
+ }
62
+ return lines.map((line, index) => (index === 0 || line === "" ? line : `${INDENT}${line}`)).join("\n");
63
+ };
64
+ const painter = ({ color = false }) => (style, text) => color ? styleText(style, text, { validateStream: false }) : text;
65
+ const senderOf = (message, options) => {
66
+ const paint = painter(options);
67
+ if (message.outgoing === true)
68
+ return paint(["bold", "cyan"], "вы");
69
+ const name = nameOf(message);
70
+ if (!options.senderColors)
71
+ return paint("bold", name);
72
+ const colour = SENDER_COLOURS[hash(message.senderId ?? name) % SENDER_COLOURS.length] ?? "green";
73
+ return paint(["bold", colour], name);
74
+ };
75
+ const nameOf = ({ senderName, senderId, outgoing }) => outgoing === true ? "вы" : (senderName ?? senderId ?? "unknown");
76
+ const hash = (value) => [...value].reduce((sum, char) => (sum * 31 + char.charCodeAt(0)) >>> 0, 7);
77
+ /** One line: it is a pointer to the other message, not a second copy of it. */
78
+ const preview = (mark, quoted, room) => {
79
+ const text = quoted.text.split("\n")[0] || (quoted.attachments[0] ? `📎 ${quoted.attachments[0].kind}` : "");
80
+ const line = text ? `${mark} ${nameOf(quoted)}: ${text}` : `${mark} message ${quoted.id}`;
81
+ if (stringWidth(line) <= room)
82
+ return line;
83
+ return `${wrapAnsi(line, room - 1, { hard: true }).split("\n")[0]}…`;
84
+ };
85
+ /**
86
+ * Compact, and each one a link: `📎 photo`, `📎 photo ×3 1 2 3`, `📎 report.pdf · 24 MB`. The link
87
+ * is an OSC 8 hyperlink where there is colour; without it the address is printed, so it is never
88
+ * out of reach.
89
+ */
90
+ const attachmentLines = (attachments, paint, options) => {
91
+ const link = (label, url) => url === undefined ? label : options.color ? `\u001b]8;;${url}\u0007${label}\u001b]8;;\u0007` : `${label} ${url}`;
92
+ const groups = new Map();
93
+ for (const attachment of attachments) {
94
+ const key = attachment.name ?? attachment.title ?? attachment.kind;
95
+ groups.set(key, [...(groups.get(key) ?? []), attachment]);
96
+ }
97
+ return [...groups].map(([label, same]) => {
98
+ const first = same[0];
99
+ const size = first?.size === undefined ? "" : ` · ${megabytes(first.size)}`;
100
+ if (same.length === 1)
101
+ return paint("dim", `📎 ${link(`${label}${size}`, first?.url)}`);
102
+ const each = same.map((attachment, index) => link(String(index + 1), attachment.url)).join(" ");
103
+ return paint("dim", `📎 ${label} ×${same.length} ${each}`);
104
+ });
105
+ };
106
+ const megabytes = (bytes) => bytes >= 1_000_000 ? `${Math.round(bytes / 1_000_000)} MB` : `${Math.max(1, Math.round(bytes / 1_000))} KB`;
107
+ const parts = (format, iso) => Object.fromEntries(format.formatToParts(new Date(iso)).map(({ type, value }) => [type, value]));
108
+ const timeFormatter = ({ timeZone }) => {
109
+ const format = new Intl.DateTimeFormat("en-GB", {
110
+ hour: "2-digit",
111
+ minute: "2-digit",
112
+ second: "2-digit",
113
+ hourCycle: "h23",
114
+ ...(timeZone ? { timeZone } : {}),
115
+ });
116
+ return (iso) => {
117
+ const { hour, minute, second } = parts(format, iso);
118
+ return `${hour}:${minute}:${second}`;
119
+ };
120
+ };
121
+ /** `3 января 2026` — the `г.` Intl adds for Russian is dropped; the line is a heading, not a date field. */
122
+ const dayFormatter = ({ locale = "ru-RU", timeZone }) => {
123
+ const format = new Intl.DateTimeFormat(locale, {
124
+ day: "numeric",
125
+ month: "long",
126
+ year: "numeric",
127
+ ...(timeZone ? { timeZone } : {}),
128
+ });
129
+ return (iso) => format.format(new Date(iso)).replace(/\s*г\.$/, "");
130
+ };
131
+ const editedAt = (message, options) => {
132
+ const edited = message.editedAt ?? message.timestamp;
133
+ const time = timeFormatter(options)(edited);
134
+ const day = dayFormatter(options);
135
+ return day(edited) === day(message.timestamp) ? time : `${day(edited)} ${time}`;
136
+ };
137
+ //# sourceMappingURL=messages.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"messages.js","sourceRoot":"","sources":["../../src/rendering/messages.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAA;AACrC,OAAO,WAAW,MAAM,cAAc,CAAA;AACtC,OAAO,QAAQ,MAAM,WAAW,CAAA;AAqBhC,MAAM,UAAU,GAAG,CAAC,CAAA;AACpB,MAAM,MAAM,GAAG,GAAG,CAAC,MAAM,CAAC,UAAU,GAAG,CAAC,CAAC,CAAA;AACzC,MAAM,SAAS,GAAG,EAAE,CAAA;AACpB,MAAM,cAAc,GAAG,CAAC,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,EAAE,KAAK,CAAU,CAAA;AAE7E,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,QAAkC,EAAE,UAAyB,EAAE,EAAU,EAAE;IACxG,IAAI,QAAQ,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,WAAW,CAAA;IAC7C,MAAM,GAAG,GAAG,YAAY,CAAC,OAAO,CAAC,CAAA;IACjC,MAAM,KAAK,GAAG,OAAO,CAAC,OAAO,CAAC,CAAA;IAE9B,IAAI,QAA4B,CAAA;IAChC,MAAM,MAAM,GAAa,EAAE,CAAA;IAC3B,KAAK,MAAM,OAAO,IAAI,QAAQ,EAAE,CAAC;QAC/B,MAAM,IAAI,GAAG,GAAG,CAAC,OAAO,CAAC,SAAS,CAAC,CAAA;QACnC,IAAI,IAAI,KAAK,QAAQ;YAAE,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,KAAK,EAAE,MAAM,IAAI,KAAK,CAAC,CAAC,CAAA;QACjE,QAAQ,GAAG,IAAI,CAAA;QACf,MAAM,CAAC,IAAI,CAAC,aAAa,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC,C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AG,OAAO,EAAE,QAAQ,EAAiB,EAAE,EAAE;IACrE,MAAM,MAAM,GAAG,IAAI,IAAI,CAAC,cAAc,CAAC,MAAM,EAAE;QAC7C,GAAG,EAAE,SAAS;QACd,KAAK,EAAE,MAAM;QACb,IAAI,EAAE,SAAS;QACf,GAAG,CAAC,QAAQ,CAAC,CAAC,CAAC,EAAE,QAAQ,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;KAClC,CAAC,CAAA;IACF,OAAO,CAAC,GAAW,EAAE,EAAE,CAAC,MAAM,CAAC,MAAM,CAAC,IAAI,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,OAAO,CAAC,SAAS,EAAE,EAAE,CAAC,CAAA;AAC7E,CAAC,CAAA;AAED,MAAM,QAAQ,GAAG,CAAC,OAAgB,EAAE,OAAsB,EAAU,EAAE;IACpE,MAAM,MAAM,GAAG,OAAO,CAAC,QAAQ,IAAI,OAAO,CAAC,SAAS,CAAA;IACpD,MAAM,IAAI,GAAG,aAAa,CAAC,OAAO,CAAC,CAAC,MAAM,CAAC,CAAA;IAC3C,MAAM,GAAG,GAAG,YAAY,CAAC,OAAO,CAAC,CAAA;IACjC,OAAO,GAAG,CAAC,MAAM,CAAC,KAAK,GAAG,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,GAAG,GAAG,CAAC,MAAM,CAAC,IAAI,IAAI,EAAE,CAAA;AACjF,CAAC,CAAA"}
@@ -1,6 +1,6 @@
1
1
  import type { Payload } from "../protocol/frame.js";
2
2
  /**
3
- * One request, as both sinks see it: `--verbose` renders it, the run log writes it as a line of
3
+ * One request, as both sinks see it: `--trace` renders it, the run log writes it as a line of
4
4
  * JSON. **One object, two sinks** — a second shape for one of them is how the two start disagreeing
5
5
  * about what happened.
6
6
  *
@@ -10,7 +10,7 @@ export interface RecordingOptions {
10
10
  */
11
11
  options: {
12
12
  record?: boolean | undefined;
13
- verbose?: boolean | undefined;
13
+ trace?: boolean | undefined;
14
14
  };
15
15
  /** What `resolveOutput` decided for the data stream. Diagnostics follow it (`NEED-53`). */
16
16
  format: RenderFormat;
@@ -23,7 +23,7 @@ export interface RecordingOptions {
23
23
  /**
24
24
  * Runs one command with the diagnostics turned on, and **finalizes on every path**.
25
25
  *
26
- * Two sinks, one event object (plan §3.1, §3.7): `--verbose` shows it as it happens and keeps
26
+ * Two sinks, one event object (plan §3.1, §3.7): `--trace` shows it as it happens and keeps
27
27
  * nothing, `--record` keeps it and shows nothing. Either, both, or — by default — neither, in
28
28
  * which case this costs a counter.
29
29
  *
@@ -1 +1 @@
1
- {"version":3,"file":"recording.d.ts","sourceRoot":"","sources":["../../src/runs/recording.ts"],"names":[],"mappings":"AAAA,OAAO,EAA4B,KAAK,YAAY,EAAE,KAAK,OAAO,EAAE,MAAM,mBAAmB,CAAA;AAE7F,OAAO,EAAE,KAAK,eAAe,EAAe,MAAM,aAAa,CAAA;AAG/D,MAAM,WAAW,gBAAgB;IAC/B,iFAAiF;IACjF,OAAO,EAAE,MAAM,CAAA;IACf,OAAO,EAAE,MAAM,CAAA;IACf;;;OAGG;IACH,OAAO,EAAE;QAAE,MAAM,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;QAAC,OAAO,CAAC,EAAE,OAAO,GAAG,SAAS,CAAA;KAAE,CAAA;IACxE,2FAA2F;IAC3F,MAAM,EAAE,YAAY,CAAA;IACpB,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,iDAAiD;IACjD,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,GAAG,CAAC,EAAE,MAAM,IAAI,CAAA;CACjB;AAED;;;;;;;;;;GAUG;AACH,eAAO,MAAM,QAAQ,GAAU,CAAC,EAC9B,SAAS,gBAAgB,EACzB,MAAM,CAAC,MAAM,EAAE,CAAC,KAAK,EAAE,eAAe,KAAK,IAAI,KAAK,OAAO,CAAC,CAAC,CAAC,KAC7D,OAAO,CAAC,CAAC,CAsCX,CAAA"}
1
+ {"version":3,"file":"recording.d.ts","sourceRoot":"","sources":["../../src/runs/recording.ts"],"names":[],"mappings":"AAAA,OAAO,EAA4B,KAAK,YAAY,EAAE,KAAK,OAAO,EAAE,MAAM,mBAAmB,CAAA;AAE7F,OAAO,EAAE,KAAK,eAAe,EAAe,MAAM,aAAa,CAAA;AAG/D,MAAM,WAAW,gBAAgB;IAC/B,iFAAiF;IACjF,OAAO,EAAE,MAAM,CAAA;IACf,OAAO,EAAE,MAAM,CAAA;IACf;;;OAGG;IACH,OAAO,EAAE;QAAE,MAAM,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;QAAC,KAAK,CAAC,EAAE,OAAO,GAAG,SAAS,CAAA;KAAE,CAAA;IACtE,2FAA2F;IAC3F,MAAM,EAAE,YAAY,CAAA;IACpB,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,iDAAiD;IACjD,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,GAAG,CAAC,EAAE,MAAM,IAAI,CAAA;CACjB;AAED;;;;;;;;;;GAUG;AACH,eAAO,MAAM,QAAQ,GAAU,CAAC,EAC9B,SAAS,gBAAgB,EACzB,MAAM,CAAC,MAAM,EAAE,CAAC,KAAK,EAAE,eAAe,KAAK,IAAI,KAAK,OAAO,CAAC,CAAC,CAAC,KAC7D,OAAO,CAAC,CAAC,CAsCX,CAAA"}
@@ -5,7 +5,7 @@ import { runsDirFor, startRun } from "./run.js";
5
5
  /**
6
6
  * Runs one command with the diagnostics turned on, and **finalizes on every path**.
7
7
  *
8
- * Two sinks, one event object (plan §3.1, §3.7): `--verbose` shows it as it happens and keeps
8
+ * Two sinks, one event object (plan §3.1, §3.7): `--trace` shows it as it happens and keeps
9
9
  * nothing, `--record` keeps it and shows nothing. Either, both, or — by default — neither, in
10
10
  * which case this costs a counter.
11
11
  *
@@ -15,7 +15,7 @@ import { runsDirFor, startRun } from "./run.js";
15
15
  */
16
16
  export const recorded = async (options, body) => {
17
17
  const streams = options.streams ?? processStreams;
18
- const verbose = options.options.verbose === true;
18
+ const trace = options.options.trace === true;
19
19
  const run = options.options.record === true
20
20
  ? startRun({
21
21
  runsDir: options.runsDir ?? runsDirFor(),
@@ -32,7 +32,7 @@ export const recorded = async (options, body) => {
32
32
  requests += 1;
33
33
  // Text for a person, one JSON object per line for anything else — the rule `resolveOutput`
34
34
  // already applies to the data stream (`NEED-53`). Never stdout, in any mode.
35
- if (verbose)
35
+ if (trace)
36
36
  streams.diagnostic(options.format === "pretty" ? renderEvent(event) : JSON.stringify(event));
37
37
  run?.logger.info(event);
38
38
  };
@@ -1 +1 @@
1
- {"version":3,"file":"recording.js","sourceRoot":"","sources":["../../src/runs/recording.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,cAAc,EAAmC,MAAM,mBAAmB,CAAA;AAC7F,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAA;AACvC,OAAO,EAAwB,WAAW,EAAE,MAAM,aAAa,CAAA;AAC/D,OAAO,EAAY,UAAU,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAA;AAoBzD;;;;;;;;;;GAUG;AACH,MAAM,CAAC,MAAM,QAAQ,GAAG,KAAK,EAC3B,OAAyB,EACzB,IAA8D,EAClD,EAAE;IACd,MAAM,OAAO,GAAG,OAAO,CAAC,OAAO,IAAI,cAAc,CAAA;IACjD,MAAM,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC,OAAO,KAAK,IAAI,CAAA;IAEhD,MAAM,GAAG,GACP,OAAO,CAAC,OAAO,CAAC,MAAM,KAAK,IAAI;QAC7B,CAAC,CAAC,QAAQ,CAAC;YACP,OAAO,EAAE,OAAO,CAAC,OAAO,IAAI,UAAU,EAAE;YACxC,OAAO,EAAE,OAAO,CAAC,OAAO;YACxB,OAAO,EAAE,OAAO,CAAC,OAAO;YACxB,UAAU,EAAE,OAAO;YACnB,GAAG,CAAC,OAA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AI,KAAK,CAAC,KAAK,KAAK,SAAS;YAAE,QAAQ,IAAI,CAAC,CAAA;QAC5C,2FAA2F;QAC3F,6EAA6E;QAC7E,IAAI,KAAK;YAAE,OAAO,CAAC,UAAU,CAAC,OAAO,CAAC,MAAM,KAAK,QAAQ,CAAC,CAAC,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC,CAAA;QACvG,GAAG,EAAE,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAA;IACzB,CAAC,CAAA;IAED,IAAI,CAAC;QACH,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,MAAM,CAAC,CAAA;QACjC,MAAM,GAAG,EAAE,MAAM,CAAC,SAAS,EAAE,EAAE,QAAQ,EAAE,CAAC,CAAA;QAC1C,OAAO,MAAM,CAAA;IACf,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,MAAM,GAAG,EAAE,MAAM,CAAC,QAAQ,EAAE;YAC1B,QAAQ;YACR,4FAA4F;YAC5F,GAAG,CAAC,KAAK,YAAY,QAAQ,CAAC,CAAC,CAAC,EAAE,SAAS,EAAE,KAAK,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;SAChE,CAAC,CAAA;QACF,MAAM,KAAK,CAAA;IACb,CAAC;AACH,CAAC,CAAA"}
@@ -0,0 +1,22 @@
1
+ import type { MaxClient } from "../client.js";
2
+ import type { SessionStore } from "./store.js";
3
+ /**
4
+ * Takes a token into a profile — **logging in first, and writing to the keyring only after.**
5
+ *
6
+ * The order is the whole point, and it is the opposite of what the command did until 2026-09-21.
7
+ * Writing first looks harmless because the login is about to happen anyway; what it actually means
8
+ * is that a typo, an expired token or a browser tab that has been closed replaces a *working*
9
+ * credential with a dead one. There is no way back: `Credentials.write` overwrites unconditionally
10
+ * and a keyring entry cannot be read out again afterwards. The same shape destroyed two working
11
+ * keys in `brazecli` on 2026-09-14 — `cli-core`'s own `credentials.ts` says so.
12
+ *
13
+ * Restoring the old token after a failed login was the obvious alternative and is worse: a process
14
+ * killed between the write and the restore leaves the profile broken. Here nothing is written until
15
+ * there is something worth writing, so there is no window to die in.
16
+ *
17
+ * It lives beside `handshake.ts` rather than in the command for the same reason that one does:
18
+ * `forCommand` builds its own store and its own socket, so anything left inside a command action
19
+ * cannot be driven by a test — and this ordering is too expensive to hold on trust.
20
+ */
21
+ export declare const adoptToken: (client: MaxClient, store: SessionStore, token: string) => Promise<void>;
22
+ //# sourceMappingURL=adopt.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"adopt.d.ts","sourceRoot":"","sources":["../../src/session/adopt.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,cAAc,CAAA;AAC7C,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,YAAY,CAAA;AAE9C;;;;;;;;;;;;;;;;;GAiBG;AACH,eAAO,MAAM,UAAU,GAAU,QAAQ,SAAS,EAAE,OAAO,YAAY,EAAE,OAAO,MAAM,KAAG,OAAO,CAAC,IAAI,CASpG,CAAA"}
@@ -0,0 +1,29 @@
1
+ /**
2
+ * Takes a token into a profile — **logging in first, and writing to the keyring only after.**
3
+ *
4
+ * The order is the whole point, and it is the opposite of what the command did until 2026-09-21.
5
+ * Writing first looks harmless because the login is about to happen anyway; what it actually means
6
+ * is that a typo, an expired token or a browser tab that has been closed replaces a *working*
7
+ * credential with a dead one. There is no way back: `Credentials.write` overwrites unconditionally
8
+ * and a keyring entry cannot be read out again afterwards. The same shape destroyed two working
9
+ * keys in `brazecli` on 2026-09-14 — `cli-core`'s own `credentials.ts` says so.
10
+ *
11
+ * Restoring the old token after a failed login was the obvious alternative and is worse: a process
12
+ * killed between the write and the restore leaves the profile broken. Here nothing is written until
13
+ * there is something worth writing, so there is no window to die in.
14
+ *
15
+ * It lives beside `handshake.ts` rather than in the command for the same reason that one does:
16
+ * `forCommand` builds its own store and its own socket, so anything left inside a command action
17
+ * cannot be driven by a test — and this ordering is too expensive to hold on trust.
18
+ */
19
+ export const adoptToken = async (client, store, token) => {
20
+ await client.connect({ token });
21
+ // ⚠ **Only if the login did not already leave a better one.** MAX answers every login with a
22
+ // fresh token and `connect` now keeps it (`MAX-11`); writing the pasted one here unconditionally
23
+ // would replace that with the credential the person copied out of a browser, which is the older
24
+ // of the two. The check also covers the case where the keyring write failed inside `connect`:
25
+ // then there is nothing stored, and what was pasted is better than nothing.
26
+ if (store.readToken() === undefined)
27
+ store.writeToken(token);
28
+ };
29
+ //# sourceMappingURL=adopt.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"adopt.js","sourceRoot":"","sources":["../../src/session/adopt.ts"],"names":[],"mappings":"AAGA;;;;;;;;;;;;;;;;;GAiBG;AACH,MAAM,CAAC,MAAM,UAAU,GAAG,KAAK,EAAE,MAAiB,EAAE,KAAmB,EAAE,KAAa,EAAiB,EAAE;IACvG,MAAM,MAAM,CAAC,OAAO,CAAC,EAAE,KAAK,EAAE,CAAC,CAAA;IAE/B,6FAA6F;IAC7F,iGAAiG;IACjG,gGAAgG;IAChG,8FAA8F;IAC9F,4EAA4E;IAC5E,IAAI,KAAK,CAAC,SAAS,EAAE,KAAK,SAAS;QAAE,KAAK,CAAC,UAAU,CAAC,KAAK,CAAC,CAAA;AAC9D,CAAC,CAAA"}
@@ -5,6 +5,19 @@ export interface SessionOptions {
5
5
  deviceId: string;
6
6
  /** How many chats LOGIN should return with the profile. The specification caps it at 100. */
7
7
  chatsCount?: number;
8
+ /**
9
+ * The `time` the previous login answered with, or `0` for "send me everything".
10
+ *
11
+ * **The four markers are moments, not flags** — measured 2026-09-20. MAX returns only what
12
+ * changed in each collection since the one given, so a stored marker is the difference between
13
+ * re-fetching every chat and every contact on every invocation and receiving the handful that
14
+ * moved. Where it is kept, and why the merge and the marker share a transaction, is
15
+ * `ARCHITECTURE.md`.
16
+ *
17
+ * All four carry the same value: nothing reads presence or drafts, and sending the marker in
18
+ * those two as well was measured harmless on the real account (`NEED-103`).
19
+ */
20
+ sync?: number;
8
21
  }
9
22
  /**
10
23
  * INIT then LOGIN, in that order, before anything else will be answered
@@ -22,5 +35,5 @@ export interface SessionOptions {
22
35
  * diagnostic hook in `MaxClient` saw nothing of the two requests every single invocation makes,
23
36
  * and `max chats list` answers from the LOGIN response without sending anything else.
24
37
  */
25
- export declare const startSession: (invoke: Invoke, { token, deviceId, chatsCount }: SessionOptions) => Promise<Payload>;
38
+ export declare const startSession: (invoke: Invoke, { token, deviceId, chatsCount, sync }: SessionOptions) => Promise<Payload>;
26
39
  //# sourceMappingURL=handshake.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"handshake.d.ts","sourceRoot":"","sources":["../../src/session/handshake.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,kCAAkC,CAAA;AAC9D,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAA;AAInD,MAAM,WAAW,cAAc;IAC7B,KAAK,EAAE,MAAM,CAAA;IACb,QAAQ,EAAE,MAAM,CAAA;IAChB,6FAA6F;IAC7F,UAAU,CAAC,EAAE,MAAM,CAAA;CACpB;AAED;;;;;;;;;;;;;;;GAeG;AACH,eAAO,MAAM,YAAY,GACvB,QAAQ,MAAM,EACd,iCAAsC,cAAc,KACnD,OAAO,CAAC,OAAO,CAajB,CAAA"}
1
+ {"version":3,"file":"handshake.d.ts","sourceRoot":"","sources":["../../src/session/handshake.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,kCAAkC,CAAA;AAC9D,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAA;AAInD,MAAM,WAAW,cAAc;IAC7B,KAAK,EAAE,MAAM,CAAA;IACb,QAAQ,EAAE,MAAM,CAAA;IAChB,6FAA6F;IAC7F,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB;;;;;;;;;;;OAWG;IACH,IAAI,CAAC,EAAE,MAAM,CAAA;CACd;AAED;;;;;;;;;;;;;;;GAeG;AACH,eAAO,MAAM,YAAY,GACvB,QAAQ,MAAM,EACd,uCAAgD,cAAc,KAC7D,OAAO,CAAC,OAAO,CAajB,CAAA"}
@@ -16,17 +16,17 @@ import { sessionInit, sessionLogin } from "../spec/operations/session.js";
16
16
  * diagnostic hook in `MaxClient` saw nothing of the two requests every single invocation makes,
17
17
  * and `max chats list` answers from the LOGIN response without sending anything else.
18
18
  */
19
- export const startSession = async (invoke, { token, deviceId, chatsCount = 40 }) => {
19
+ export const startSession = async (invoke, { token, deviceId, chatsCount = 40, sync = 0 }) => {
20
20
  await invoke(sessionInit, { userAgent: WEB_USER_AGENT, deviceId });
21
21
  return await invoke(sessionLogin, {
22
22
  token,
23
23
  // A script reading is not a person looking; see the specification for why this is never true.
24
24
  interactive: false,
25
25
  chatsCount,
26
- chatsSync: 0,
27
- contactsSync: 0,
28
- presenceSync: 0,
29
- draftsSync: 0,
26
+ chatsSync: sync,
27
+ contactsSync: sync,
28
+ presenceSync: sync,
29
+ draftsSync: sync,
30
30
  });
31
31
  };
32
32
  //# sourceMappingURL=handshake.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"handshake.js","sourceRoot":"","sources":["../../src/session/handshake.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAA;AACpD,OAAO,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAA;AASzE;;;;;;;;;;;;;;;GAeG;AACH,MAAM,CAAC,MAAM,YAAY,GAAG,KAAK,EAC/B,MAAc,EACd,EAAE,KAAK,EAAE,QAAQ,EAAE,UAAU,GAAG,EAAE,EAAkB,EAClC,EAAE;IACpB,MAAM,MAAM,CAAC,WAAW,EAAE,EAAE,SAAS,EAAE,cAAc,EAAE,QAAQ,EAAE,CAAC,CAAA;IAElE,OAAO,MAAM,MAAM,CAAC,YAAY,EAAE;QAChC,KAAK;QACL,8FAA8F;QAC9F,WAAW,EAAE,KAAK;QAClB,UAAU;QACV,SAAS,EAAE,CAAC;QACZ,YAAY,EAAE,CAAC;QACf,YAAY,EAAE,CAAC;QACf,UAAU,EAAE,CAAC;KACd,CAAC,CAAA;AACJ,CAAC,CAAA"}
1
+ {"version":3,"file":"handshake.js","sourceRoot":"","sources":["../../src/session/handshake.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAA;AACpD,OAAO,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAA;AAsBzE;;;;;;;;;;;;;;;GAeG;AACH,MAAM,CAAC,MAAM,YAAY,GAAG,KAAK,EAC/B,MAAc,EACd,EAAE,KAAK,EAAE,QAAQ,EAAE,UAAU,GAAG,EAAE,EAAE,IAAI,GAAG,CAAC,EAAkB,EAC5C,EAAE;IACpB,MAAM,MAAM,CAAC,WAAW,EAAE,EAAE,SAAS,EAAE,cAAc,EAAE,QAAQ,EAAE,CAAC,CAAA;IAElE,OAAO,MAAM,MAAM,CAAC,YAAY,EAAE;QAChC,KAAK;QACL,8FAA8F;QAC9F,WAAW,EAAE,KAAK;QAClB,UAAU;QACV,SAAS,EAAE,IAAI;QACf,YAAY,EAAE,IAAI;QAClB,YAAY,EAAE,IAAI;QAClB,UAAU,EAAE,IAAI;KACjB,CAAC,CAAA;AACJ,CAAC,CAAA"}
@@ -0,0 +1,42 @@
1
+ import * as v from "valibot";
2
+ export declare const sessionInit: import("../define.js").Operation<v.StrictObjectSchema<{
3
+ readonly userAgent: v.StrictObjectSchema<{
4
+ readonly deviceType: v.LiteralSchema<"WEB", undefined>;
5
+ readonly pushDeviceType: v.LiteralSchema<"WEBPUSH", undefined>;
6
+ readonly locale: v.StringSchema<undefined>;
7
+ readonly deviceLocale: v.StringSchema<undefined>;
8
+ readonly osVersion: v.StringSchema<undefined>;
9
+ readonly deviceName: v.StringSchema<undefined>;
10
+ readonly headerUserAgent: v.StringSchema<undefined>;
11
+ readonly appVersion: v.StringSchema<undefined>;
12
+ readonly screen: v.StringSchema<undefined>;
13
+ readonly timezone: v.StringSchema<undefined>;
14
+ }, undefined>;
15
+ readonly deviceId: v.StringSchema<undefined>;
16
+ }, undefined>, v.LooseObjectSchema<{}, undefined>>;
17
+ export declare const sessionLogin: import("../define.js").Operation<v.StrictObjectSchema<{
18
+ readonly token: v.StringSchema<undefined>;
19
+ /**
20
+ * False, always. The web client sends true because a person is looking at it; we are a script
21
+ * reading, and claiming a human is present is the small lie that becomes a side effect nobody
22
+ * can trace (`RES-5`).
23
+ */
24
+ readonly interactive: v.LiteralSchema<false, undefined>;
25
+ readonly chatsCount: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 1, undefined>, v.MaxValueAction<number, 100, undefined>]>;
26
+ readonly chatsSync: v.NumberSchema<undefined>;
27
+ readonly contactsSync: v.NumberSchema<undefined>;
28
+ readonly presenceSync: v.NumberSchema<undefined>;
29
+ readonly draftsSync: v.NumberSchema<undefined>;
30
+ }, undefined>, v.LooseObjectSchema<{
31
+ readonly profile: v.OptionalSchema<v.LooseObjectSchema<{}, undefined>, undefined>;
32
+ readonly chats: v.OptionalSchema<v.ArraySchema<v.LooseObjectSchema<{}, undefined>, undefined>, undefined>;
33
+ readonly contacts: v.OptionalSchema<v.ArraySchema<v.LooseObjectSchema<{}, undefined>, undefined>, undefined>;
34
+ readonly messages: v.OptionalSchema<v.ArraySchema<v.LooseObjectSchema<{}, undefined>, undefined>, undefined>;
35
+ readonly presence: v.OptionalSchema<v.UnknownSchema, undefined>;
36
+ readonly time: v.OptionalSchema<v.NumberSchema<undefined>, undefined>;
37
+ readonly chatMarker: v.OptionalSchema<v.UnknownSchema, undefined>;
38
+ readonly config: v.OptionalSchema<v.UnknownSchema, undefined>;
39
+ readonly videoChatHistory: v.OptionalSchema<v.UnknownSchema, undefined>;
40
+ }, undefined>>;
41
+ export declare const logout: import("../define.js").Reservation;
42
+ //# sourceMappingURL=auth.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"auth.d.ts","sourceRoot":"","sources":["../../../src/spec/operations/auth.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,SAAS,CAAA;AAsB5B,eAAO,MAAM,WAAW;;;;;;;;;;;;;;kDAYtB,CAAA;AAEF,eAAO,MAAM,YAAY;;IAOrB;;;;OAIG;;;;;;;;;;;;;;;;;cA2BL,CAAA;AAEF,eAAO,MAAM,MAAM,oCAOjB,CAAA"}
@@ -59,6 +59,22 @@ export declare const sessionLogin: import("../define.js").Operation<v.StrictObje
59
59
  * Left as `unknown` until somebody looks (`PROTO-6`). `pnpm probe:ids` reports its type and key count.
60
60
  */
61
61
  readonly messages: v.OptionalSchema<v.UnknownSchema, undefined>;
62
+ /**
63
+ * **A replacement for a credential that has aged** — measured on the real account 2026-09-22
64
+ * (`pnpm probe:token`). Logging in with a token pasted months earlier answers with a different
65
+ * one; logging in with *that* one answers with the same one back. So it is an exchange that
66
+ * happens once, not a rotation on every login.
67
+ *
68
+ * It was undeclared until then, so the exchange happened on every login and the client threw
69
+ * the result away, leaving the profile on whatever was pasted in months ago (`MAX-11`,
70
+ * `NEED-106`). The old token goes on working, which is why this is hygiene rather than repair.
71
+ * `NEED-8` had asserted the rotation in 2026-09-18 on the strength of `tsmax/src/app.ts:99` —
72
+ * somebody else's client — which is a claim; this is the measurement.
73
+ *
74
+ * ⚠ **It is a credential.** Nothing may print it, log it or put it in a fixture. `MaxClient`
75
+ * writes it to the keyring and never returns it.
76
+ */
77
+ readonly token: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
62
78
  readonly presence: v.OptionalSchema<v.UnknownSchema, undefined>;
63
79
  readonly time: v.OptionalSchema<v.NumberSchema<undefined>, undefined>;
64
80
  readonly chatMarker: v.OptionalSchema<v.UnknownSchema, undefined>;
@@ -1 +1 @@
1
- {"version":3,"file":"session.d.ts","sourceRoot":"","sources":["../../../src/spec/operations/session.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,SAAS,CAAA;AAsB5B,eAAO,MAAM,WAAW;;;;;;;;;;;;;;kDAYtB,CAAA;AAEF,eAAO,MAAM,YAAY;;IAOrB;;;;OAIG;;;IAKH;;;;;;;;;;;OAWG;;;;;;;;;IAUH;;;;;;;;;;;;;;OAcG;;;;;;;cAcL,CAAA;AAEF,eAAO,MAAM,MAAM,oCAOjB,CAAA"}
1
+ {"version":3,"file":"session.d.ts","sourceRoot":"","sources":["../../../src/spec/operations/session.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,SAAS,CAAA;AAsB5B,eAAO,MAAM,WAAW;;;;;;;;;;;;;;kDAYtB,CAAA;AAEF,eAAO,MAAM,YAAY;;IAOrB;;;;OAIG;;;IAKH;;;;;;;;;;;OAWG;;;;;;;;;IAUH;;;;;;;;;;;;;;OAcG;;IAEH;;;;;;;;;;;;;;OAcG;;;;;;;cAkBL,CAAA;AAEF,eAAO,MAAM,MAAM,oCAOjB,CAAA"}