@leemour/max-cli 0.4.0 → 0.6.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 (190) hide show
  1. package/README.md +14 -5
  2. package/dist/bin/max.js +0 -0
  3. package/dist/cache/store.d.ts +14 -8
  4. package/dist/cache/store.d.ts.map +1 -1
  5. package/dist/cache/store.js +30 -5
  6. package/dist/cache/store.js.map +1 -1
  7. package/dist/client.d.ts +93 -5
  8. package/dist/client.d.ts.map +1 -1
  9. package/dist/client.js +347 -59
  10. package/dist/client.js.map +1 -1
  11. package/dist/commands/chats.d.ts.map +1 -1
  12. package/dist/commands/chats.js +20 -0
  13. package/dist/commands/chats.js.map +1 -1
  14. package/dist/commands/commands.d.ts +8 -0
  15. package/dist/commands/commands.d.ts.map +1 -0
  16. package/dist/commands/commands.js +36 -0
  17. package/dist/commands/commands.js.map +1 -0
  18. package/dist/commands/config.d.ts.map +1 -1
  19. package/dist/commands/config.js +29 -0
  20. package/dist/commands/config.js.map +1 -1
  21. package/dist/commands/contacts.d.ts.map +1 -1
  22. package/dist/commands/contacts.js +18 -0
  23. package/dist/commands/contacts.js.map +1 -1
  24. package/dist/commands/context.d.ts +18 -0
  25. package/dist/commands/context.d.ts.map +1 -1
  26. package/dist/commands/context.js +22 -0
  27. package/dist/commands/context.js.map +1 -1
  28. package/dist/commands/inbox.d.ts +14 -0
  29. package/dist/commands/inbox.d.ts.map +1 -0
  30. package/dist/commands/inbox.js +90 -0
  31. package/dist/commands/inbox.js.map +1 -0
  32. package/dist/commands/messages.d.ts.map +1 -1
  33. package/dist/commands/messages.js +55 -4
  34. package/dist/commands/messages.js.map +1 -1
  35. package/dist/commands/reactions.d.ts +3 -0
  36. package/dist/commands/reactions.d.ts.map +1 -0
  37. package/dist/commands/reactions.js +26 -0
  38. package/dist/commands/reactions.js.map +1 -0
  39. package/dist/commands/recipients.d.ts +9 -0
  40. package/dist/commands/recipients.d.ts.map +1 -0
  41. package/dist/commands/recipients.js +68 -0
  42. package/dist/commands/recipients.js.map +1 -0
  43. package/dist/commands/sends.d.ts +4 -0
  44. package/dist/commands/sends.d.ts.map +1 -0
  45. package/dist/commands/sends.js +21 -0
  46. package/dist/commands/sends.js.map +1 -0
  47. package/dist/commands/session.d.ts.map +1 -1
  48. package/dist/commands/session.js +80 -15
  49. package/dist/commands/session.js.map +1 -1
  50. package/dist/commands/skill.d.ts.map +1 -1
  51. package/dist/commands/skill.js +2 -1
  52. package/dist/commands/skill.js.map +1 -1
  53. package/dist/config.d.ts +54 -13
  54. package/dist/config.d.ts.map +1 -1
  55. package/dist/config.js +98 -16
  56. package/dist/config.js.map +1 -1
  57. package/dist/domain/map.d.ts +3 -1
  58. package/dist/domain/map.d.ts.map +1 -1
  59. package/dist/domain/map.js +15 -1
  60. package/dist/domain/map.js.map +1 -1
  61. package/dist/domain/models.d.ts +55 -1
  62. package/dist/domain/models.d.ts.map +1 -1
  63. package/dist/domain/models.js.map +1 -1
  64. package/dist/download.d.ts +15 -0
  65. package/dist/download.d.ts.map +1 -0
  66. package/dist/download.js +60 -0
  67. package/dist/download.js.map +1 -0
  68. package/dist/generated/client.generated.d.ts +14 -0
  69. package/dist/generated/client.generated.d.ts.map +1 -1
  70. package/dist/generated/client.generated.js +14 -0
  71. package/dist/generated/client.generated.js.map +1 -1
  72. package/dist/generated/opcodes.generated.d.ts +15 -0
  73. package/dist/generated/opcodes.generated.d.ts.map +1 -1
  74. package/dist/generated/opcodes.generated.js +15 -0
  75. package/dist/generated/opcodes.generated.js.map +1 -1
  76. package/dist/generated/operations.generated.d.ts +99 -1
  77. package/dist/generated/operations.generated.d.ts.map +1 -1
  78. package/dist/generated/operations.generated.js +13 -1
  79. package/dist/generated/operations.generated.js.map +1 -1
  80. package/dist/markdown.d.ts +18 -0
  81. package/dist/markdown.d.ts.map +1 -0
  82. package/dist/markdown.js +52 -0
  83. package/dist/markdown.js.map +1 -0
  84. package/dist/program.d.ts.map +1 -1
  85. package/dist/program.js +10 -0
  86. package/dist/program.js.map +1 -1
  87. package/dist/rendering/messages.d.ts.map +1 -1
  88. package/dist/rendering/messages.js +6 -0
  89. package/dist/rendering/messages.js.map +1 -1
  90. package/dist/resolve.d.ts +15 -0
  91. package/dist/resolve.d.ts.map +1 -0
  92. package/dist/resolve.js +48 -0
  93. package/dist/resolve.js.map +1 -0
  94. package/dist/runs/recording.d.ts.map +1 -1
  95. package/dist/runs/recording.js +7 -0
  96. package/dist/runs/recording.js.map +1 -1
  97. package/dist/runs/run.d.ts +2 -0
  98. package/dist/runs/run.d.ts.map +1 -1
  99. package/dist/runs/run.js +1 -0
  100. package/dist/runs/run.js.map +1 -1
  101. package/dist/sends/guard.d.ts +26 -0
  102. package/dist/sends/guard.d.ts.map +1 -0
  103. package/dist/sends/guard.js +48 -0
  104. package/dist/sends/guard.js.map +1 -0
  105. package/dist/sends/journal.d.ts +29 -0
  106. package/dist/sends/journal.d.ts.map +1 -0
  107. package/dist/sends/journal.js +40 -0
  108. package/dist/sends/journal.js.map +1 -0
  109. package/dist/sends/recipients.d.ts +29 -0
  110. package/dist/sends/recipients.d.ts.map +1 -0
  111. package/dist/sends/recipients.js +62 -0
  112. package/dist/sends/recipients.js.map +1 -0
  113. package/dist/session/adopt.d.ts.map +1 -1
  114. package/dist/session/adopt.js +7 -6
  115. package/dist/session/adopt.js.map +1 -1
  116. package/dist/session/browser.d.ts +55 -0
  117. package/dist/session/browser.d.ts.map +1 -0
  118. package/dist/session/browser.js +292 -0
  119. package/dist/session/browser.js.map +1 -0
  120. package/dist/session/handshake.d.ts +3 -1
  121. package/dist/session/handshake.d.ts.map +1 -1
  122. package/dist/session/handshake.js +3 -1
  123. package/dist/session/handshake.js.map +1 -1
  124. package/dist/session/login.d.ts +20 -0
  125. package/dist/session/login.d.ts.map +1 -0
  126. package/dist/session/login.js +66 -0
  127. package/dist/session/login.js.map +1 -0
  128. package/dist/session/prompt.d.ts +3 -1
  129. package/dist/session/prompt.d.ts.map +1 -1
  130. package/dist/session/prompt.js +2 -2
  131. package/dist/session/prompt.js.map +1 -1
  132. package/dist/session/qr-terminal.d.ts +9 -0
  133. package/dist/session/qr-terminal.d.ts.map +1 -0
  134. package/dist/session/qr-terminal.js +34 -0
  135. package/dist/session/qr-terminal.js.map +1 -0
  136. package/dist/session/store.d.ts +2 -0
  137. package/dist/session/store.d.ts.map +1 -1
  138. package/dist/session/store.js +2 -0
  139. package/dist/session/store.js.map +1 -1
  140. package/dist/spec/index.d.ts.map +1 -1
  141. package/dist/spec/index.js +14 -1
  142. package/dist/spec/index.js.map +1 -1
  143. package/dist/spec/operations/attachments.d.ts +15 -0
  144. package/dist/spec/operations/attachments.d.ts.map +1 -0
  145. package/dist/spec/operations/attachments.js +38 -0
  146. package/dist/spec/operations/attachments.js.map +1 -0
  147. package/dist/spec/operations/login.d.ts +64 -0
  148. package/dist/spec/operations/login.d.ts.map +1 -0
  149. package/dist/spec/operations/login.js +99 -0
  150. package/dist/spec/operations/login.js.map +1 -0
  151. package/dist/spec/operations/messages.d.ts +27 -1
  152. package/dist/spec/operations/messages.d.ts.map +1 -1
  153. package/dist/spec/operations/messages.js +46 -2
  154. package/dist/spec/operations/messages.js.map +1 -1
  155. package/dist/testing/mock-max.d.ts +10 -4
  156. package/dist/testing/mock-max.d.ts.map +1 -1
  157. package/dist/testing/mock-max.js +5 -1
  158. package/dist/testing/mock-max.js.map +1 -1
  159. package/dist/testing/sandbox.js +3 -0
  160. package/dist/testing/sandbox.js.map +1 -1
  161. package/dist/testing/unscripted.d.ts +2 -0
  162. package/dist/testing/unscripted.d.ts.map +1 -0
  163. package/dist/testing/unscripted.js +18 -0
  164. package/dist/testing/unscripted.js.map +1 -0
  165. package/dist/version.d.ts +1 -1
  166. package/dist/version.js +1 -1
  167. package/package.json +31 -22
  168. package/skills/max-cli/SKILL.md +25 -6
  169. package/dist/commands/login.d.ts +0 -15
  170. package/dist/commands/login.d.ts.map +0 -1
  171. package/dist/commands/login.js +0 -43
  172. package/dist/commands/login.js.map +0 -1
  173. package/dist/commands/logout.d.ts +0 -10
  174. package/dist/commands/logout.d.ts.map +0 -1
  175. package/dist/commands/logout.js +0 -22
  176. package/dist/commands/logout.js.map +0 -1
  177. package/dist/commands/me.d.ts +0 -3
  178. package/dist/commands/me.d.ts.map +0 -1
  179. package/dist/commands/me.js +0 -18
  180. package/dist/commands/me.js.map +0 -1
  181. package/dist/commands/send.d.ts +0 -10
  182. package/dist/commands/send.d.ts.map +0 -1
  183. package/dist/commands/send.js +0 -30
  184. package/dist/commands/send.js.map +0 -1
  185. package/dist/protocol/session.d.ts +0 -54
  186. package/dist/protocol/session.d.ts.map +0 -1
  187. package/dist/protocol/session.js +0 -57
  188. package/dist/protocol/session.js.map +0 -1
  189. package/dist/spec/operations/auth.d.ts +0 -42
  190. package/dist/spec/operations/auth.d.ts.map +0 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@leemour/max-cli",
3
- "version": "0.4.0",
3
+ "version": "0.6.0",
4
4
  "description": "A local command line interface for a personal MAX Messenger account, built for agents and scripts",
5
5
  "license": "MIT",
6
6
  "author": "Viacheslav Ptsarev",
@@ -12,6 +12,7 @@
12
12
  "engines": {
13
13
  "node": ">=22"
14
14
  },
15
+ "packageManager": "pnpm@11.20.0",
15
16
  "bin": {
16
17
  "max": "dist/bin/max.js"
17
18
  },
@@ -21,10 +22,37 @@
21
22
  "README.md",
22
23
  "LICENSE"
23
24
  ],
25
+ "scripts": {
26
+ "build": "tsc --build",
27
+ "generate": "pnpm build && node --experimental-strip-types scripts/generate.ts && node --experimental-strip-types scripts/commands.ts",
28
+ "typecheck": "tsc --build --force --emitDeclarationOnly && tsc -p tsconfig.test.json && tsc -p tsconfig.scripts.json",
29
+ "lint": "biome check .",
30
+ "lint:fix": "biome check --write .",
31
+ "test": "vitest run",
32
+ "test:watch": "vitest",
33
+ "smoke:bun": "bun run scripts/smoke.ts",
34
+ "version:check": "node --experimental-strip-types scripts/version.ts",
35
+ "version:sync": "node --experimental-strip-types scripts/version.ts --sync",
36
+ "probe:ids": "pnpm build && node --experimental-strip-types scripts/id-shape.ts",
37
+ "probe:download": "pnpm build && node --experimental-strip-types scripts/probe-download.ts",
38
+ "probe:reply": "pnpm build && node --experimental-strip-types scripts/probe-reply.ts",
39
+ "probe:edits": "pnpm build && node --experimental-strip-types scripts/probe-edits.ts",
40
+ "probe:attachments": "pnpm build && node --experimental-strip-types scripts/probe-attachments.ts",
41
+ "verify:live": "pnpm build && node --experimental-strip-types scripts/verify-commands.ts",
42
+ "prepare": "lefthook install || true",
43
+ "secrets:scan": "gitleaks git --no-banner --redact .",
44
+ "prepublishOnly": "pnpm build",
45
+ "probe:contacts": "pnpm build && node --experimental-strip-types scripts/probe-contacts.ts",
46
+ "probe:reactions": "pnpm build && node --experimental-strip-types scripts/probe-reactions.ts",
47
+ "probe:message-shapes": "pnpm build && node --experimental-strip-types scripts/probe-message-shapes.ts",
48
+ "probe:token": "pnpm build && node --experimental-strip-types scripts/probe-token.ts",
49
+ "probe:inbox": "pnpm build && node --experimental-strip-types scripts/probe-inbox.ts"
50
+ },
24
51
  "dependencies": {
25
- "@leemour/cli-core": "^0.1.0",
52
+ "@leemour/cli-core": "^0.2.0",
26
53
  "commander": "^15.0.0",
27
54
  "lossless-json": "^4.3.1",
55
+ "qrcode-generator": "2.0.4",
28
56
  "string-width": "^8.2.2",
29
57
  "valibot": "^1.5.0",
30
58
  "wrap-ansi": "^10.0.2",
@@ -40,24 +68,5 @@
40
68
  },
41
69
  "publishConfig": {
42
70
  "access": "public"
43
- },
44
- "scripts": {
45
- "build": "tsc --build",
46
- "generate": "pnpm build && node --experimental-strip-types scripts/generate.ts && node --experimental-strip-types scripts/commands.ts",
47
- "typecheck": "tsc --build --force --emitDeclarationOnly && tsc -p tsconfig.test.json && tsc -p tsconfig.scripts.json",
48
- "lint": "biome check .",
49
- "lint:fix": "biome check --write .",
50
- "test": "vitest run",
51
- "test:watch": "vitest",
52
- "smoke:bun": "bun run scripts/smoke.ts",
53
- "version:check": "node --experimental-strip-types scripts/version.ts",
54
- "version:sync": "node --experimental-strip-types scripts/version.ts --sync",
55
- "probe:ids": "pnpm build && node --experimental-strip-types scripts/id-shape.ts",
56
- "probe:edits": "pnpm build && node --experimental-strip-types scripts/probe-edits.ts",
57
- "probe:attachments": "pnpm build && node --experimental-strip-types scripts/probe-attachments.ts",
58
- "verify:live": "pnpm build && node --experimental-strip-types scripts/verify-commands.ts",
59
- "secrets:scan": "gitleaks git --no-banner --redact .",
60
- "probe:contacts": "pnpm build && node --experimental-strip-types scripts/probe-contacts.ts",
61
- "probe:token": "pnpm build && node --experimental-strip-types scripts/probe-token.ts"
62
71
  }
63
- }
72
+ }
@@ -8,14 +8,19 @@ description: Читать и отправлять сообщения в личн
8
8
  `max` работает с **настоящим личным аккаунтом** владельца. Ошибка здесь не роняет тест, а пишет
9
9
  живому человеку. Один вызов — одно действие: подключиться, сделать, напечатать, выйти.
10
10
 
11
- Полный список команд и флагов — `max --help` и `max <команда> --help`. Здесь — то, что справка не
12
- скажет: ловушки и границы.
11
+ Полный список команд и флагов — **`max commands --json`**: всё дерево одним ответом — аргументы,
12
+ флаги (берёт ли значение, обязателен ли), коды выхода и пометка `mutates: true` на командах, которые
13
+ что-то меняют в MAX. `max --help` — то же для человека. Здесь — то, что справка не скажет: ловушки и
14
+ границы.
13
15
 
14
16
  ## Границы
15
17
 
16
18
  - **Ничего не отправлять без прямой просьбы владельца.** `max messages send` — только когда он
17
19
  сам попросил отправить конкретный текст в конкретный чат. Черновик, «наверное стоит ответить»,
18
20
  вывод из прочитанного — это не просьба.
21
+ - **Отказ `5`, `7` или `8` на отправке или реакции — это решение владельца, а не сбой.** Не обходить его: не
22
+ менять настройки, не звать `max recipients add`, не ждать и не повторять. Сказать владельцу, что
23
+ отправка не прошла и почему.
19
24
  - **Чтение ничего не отмечает прочитанным** и не показывает собеседнику, что вы заходили. Читать
20
25
  можно свободно.
21
26
  - **Не для:** ботов MAX, рассылок, автоответов, слежения в реальном времени, чужих аккаунтов.
@@ -30,7 +35,8 @@ description: Читать и отправлять сообщения в личн
30
35
  - **Список — это объект**, а не массив: `{ "items": [...], "page": 1, "limit": 20, "hasMore": true }`.
31
36
  - **`--jsonl`** — по объекту на строку, удобно для `jq`. Есть ли ещё, пишется только в stderr.
32
37
  - **Ветвиться по коду возврата, а не по тексту**: `0` — успех, `2` — неверный ввод, `4` — нет
33
- входа, `6` — не найдено, `14` — **неизвестно, ушло ли сообщение** (см. отправку).
38
+ входа, `5` — профиль только для чтения, `6` — не найдено, `7` — чата нет в списке разрешённых,
39
+ `8` — лимит отправок за час, `14` — **неизвестно, ушло ли сообщение** (см. отправку).
34
40
  - `-v` и `-vv` добавляют подробности в вывод для человека. Версия — `max -V`. Строки о каждом
35
41
  запросе к MAX — `--trace`, в stderr.
36
42
 
@@ -44,7 +50,9 @@ description: Читать и отправлять сообщения в личн
44
50
  алфавите отвергается **как имя** (код `2`), и это не то же самое, что профиль, в который никто
45
51
  не входил (код `4`).
46
52
  3. **Имя чата, подходящее к нескольким чатам, — ошибка, а не выбор.** В JSON у неё есть
47
- `candidates: [{ id, title }]`. Взять оттуда id и повторить с ним, а не угадывать.
53
+ `candidates: [{ id, title }]`. Взять оттуда id и повторить с ним, а не угадывать. То же у
54
+ `max contacts show` — человек по id, `@username` или части имени, кандидаты
55
+ `[{ id, name, username }]`.
48
56
  4. **Повтор отправки — только с тем же `--cid`.** Код `14` значит, что сообщение, возможно, ушло.
49
57
  В тексте ошибки есть `--cid <n>`; повтор с ним MAX схлопнет, повтор без него — второе сообщение
50
58
  человеку.
@@ -55,12 +63,14 @@ description: Читать и отправлять сообщения в личн
55
63
  а не пустой список.
56
64
  6. **`messages show` и `messages context` требуют и чат, и id сообщения.** Искомое сообщение в
57
65
  JSON помечено `"anchor": true`. Если сообщения нет, это `not_found`, а не соседнее сообщение.
58
- 7. **Время сообщения зашито в его id**: `id >> 16` — миллисекунды. Поэтому `--before <id>`
59
- работает для любого id, даже не прочитанного раньше.
66
+ 7. **Время сообщения зашито в его id**: `id >> 16` — миллисекунды. Поэтому `--before <id>` и
67
+ `--after <id>` работают для любого id, даже не прочитанного раньше. `--before` включает само
68
+ сообщение, `--after` — нет. Вместе они — отказ с кодом `2`.
60
69
  8. **`MAX_CONFIG_DIR`, `MAX_STATE_DIR`, `MAX_CACHE_DIR` меняют и запись в ключнице.** С ними
61
70
  профиль ищет другой токен и может ответить «нет сессии», хотя владелец вошёл. `max config show`
62
71
  говорит, заданы ли они, и какой профиль и какие настройки действуют.
63
72
  9. **`--offline` отвечает из локальной копии** и не подключается. Если там ничего нет — ошибка.
73
+ Отправка с `--offline` — всегда отказ.
64
74
  10. **Многострочный текст передаётся только через stdin.** Аргумент командной строки перевод
65
75
  строки не несёт вовсе, а тело в аргументе видно в `ps` и остаётся в истории оболочки. Последний
66
76
  аргумент опускается, и тело читается со входа: `printf 'первая\n\nтретья' | max messages send
@@ -68,6 +78,9 @@ description: Читать и отправлять сообщения в личн
68
78
  11. **Номер страницы на живом списке может повторить или пропустить строку.** Сверху самое свежее,
69
79
  поэтому сообщение, пришедшее между первой страницей и второй, сдвигает кого-то через границу.
70
80
  Для переписки этого нет: `--before` привязан ко времени и точен.
81
+ 12. **`max inbox --new` сдвигает место, где владелец остановился.** После него следующий
82
+ `--new` владельца не покажет того, что уже увидел агент. Без сдвига: просто `max inbox`
83
+ (непрочитанное) или `max inbox --since <время>`.
71
84
 
72
85
  ## Типичный путь
73
86
 
@@ -75,7 +88,13 @@ Id ниже выдуманные — подставить настоящие и
75
88
 
76
89
  ```sh
77
90
  max chats list --search "проект" --json # найти чат, взять его id
91
+ max chats list --unread --json # где есть непрочитанное
92
+ max inbox --json # непрочитанное во всех чатах
93
+ max inbox --new --json # что пришло с прошлой проверки, один раз
94
+ max chats show -1000 --json # один чат и кто в нём
95
+ max contacts show @ivan --json # один человек и общие чаты
78
96
  max messages list -1000 --limit 20 --json # последние сообщения, от старых к новым
97
+ max messages list -1000 --after 100000000000000001 --json # что было после этого сообщения
79
98
  max messages context -1000 100000000000000001 --before 3 --after 3 --json
80
99
  ```
81
100
 
@@ -1,15 +0,0 @@
1
- import { Command } from "commander";
2
- /**
3
- * For now, importing a token obtained elsewhere — from `web.max.ru`, or from another client.
4
- *
5
- * This is not a stopgap: it is the escape hatch that keeps every other command usable when our own
6
- * login flow meets a captcha or an unusual second factor, and it is how the slice is tested
7
- * without an SMS per run. The interactive phone-and-code flow lands beside it, not instead of it.
8
- *
9
- * **The token is asked for, not passed.** `--token` puts it in `ps` output and shell history, and a
10
- * file leaves a copy nobody deletes, so with neither given it is read from the terminal without
11
- * being echoed — or from a pipe, for `pass show max | max login`. From there it goes to the OS
12
- * keyring and nowhere else.
13
- */
14
- export declare const loginCommand: () => Command;
15
- //# sourceMappingURL=login.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"login.d.ts","sourceRoot":"","sources":["../../src/commands/login.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AAMnC;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,YAAY,QAAO,OA2B1B,CAAA"}
@@ -1,43 +0,0 @@
1
- import { Command } from "commander";
2
- import { MaxClient } from "../client.js";
3
- import { resolveOutput } from "../output.js";
4
- import { readSecret } from "../session/prompt.js";
5
- import { SessionStore } from "../session/store.js";
6
- /**
7
- * For now, importing a token obtained elsewhere — from `web.max.ru`, or from another client.
8
- *
9
- * This is not a stopgap: it is the escape hatch that keeps every other command usable when our own
10
- * login flow meets a captcha or an unusual second factor, and it is how the slice is tested
11
- * without an SMS per run. The interactive phone-and-code flow lands beside it, not instead of it.
12
- *
13
- * **The token is asked for, not passed.** `--token` puts it in `ps` output and shell history, and a
14
- * file leaves a copy nobody deletes, so with neither given it is read from the terminal without
15
- * being echoed — or from a pipe, for `pass show max | max login`. From there it goes to the OS
16
- * keyring and nowhere else.
17
- */
18
- export const loginCommand = () => new Command("login")
19
- .description("store a MAX session for this profile")
20
- .option("--token <token>", "a session token; prompted for, or read from a pipe, when omitted")
21
- .action(async function () {
22
- const options = this.optsWithGlobals();
23
- const { renderer } = resolveOutput(options);
24
- const token = options.token ?? process.env.MAX_TOKEN?.trim() ?? (await readSecret("MAX token: "));
25
- if (!token) {
26
- renderer.failure("no token given");
27
- process.exitCode = 2;
28
- return;
29
- }
30
- const store = new SessionStore({ profile: options.profile });
31
- store.writeToken(token);
32
- const client = new MaxClient({ store });
33
- try {
34
- await client.connect();
35
- const profile = client.account.me();
36
- renderer.result({ profile, stored: true });
37
- renderer.success(`logged in as ${profile.name ?? profile.id}`);
38
- }
39
- finally {
40
- await client.close();
41
- }
42
- });
43
- //# sourceMappingURL=login.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"login.js","sourceRoot":"","sources":["../../src/commands/login.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AACnC,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAA;AACxC,OAAO,EAAE,aAAa,EAAE,MAAM,cAAc,CAAA;AAC5C,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAA;AACjD,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAA;AAElD;;;;;;;;;;;GAWG;AACH,MAAM,CAAC,MAAM,YAAY,GAAG,GAAY,EAAE,CACxC,IAAI,OAAO,CAAC,OAAO,CAAC;KACjB,WAAW,CAAC,sCAAsC,CAAC;KACnD,MAAM,CAAC,iBAAiB,EAAE,kEAAkE,CAAC;KAC7F,MAAM,CAAC,KAAK;IACX,MAAM,OAAO,GAAG,IAAI,CAAC,eAAe,EAAE,CAAA;IACtC,MAAM,EAAE,QAAQ,EAAE,GAAG,aAAa,CAAC,OAAO,CAAC,CAAA;IAC3C,MAAM,KAAK,GAAG,OAAO,CAAC,KAAK,IAAI,OAAO,CAAC,GAAG,CAAC,SAAS,EAAE,IAAI,EAAE,IAAI,CAAC,MAAM,UAAU,CAAC,aAAa,CAAC,CAAC,CAAA;IAEjG,IAAI,CAAC,KAAK,EAAE,CAAC;QACX,QAAQ,CAAC,OAAO,CAAC,gBAAgB,CAAC,CAAA;QAClC,OAAO,CAAC,QAAQ,GAAG,CAAC,CAAA;QACpB,OAAM;IACR,CAAC;IAED,MAAM,KAAK,GAAG,IAAI,YAAY,CAAC,EAAE,OAAO,EAAE,OAAO,CAAC,OAAO,EAAE,CAAC,CAAA;IAC5D,KAAK,CAAC,UAAU,CAAC,KAAK,CAAC,CAAA;IAEvB,MAAM,MAAM,GAAG,IAAI,SAAS,CAAC,EAAE,KAAK,EAAE,CAAC,CAAA;IACvC,IAAI,CAAC;QACH,MAAM,MAAM,CAAC,OAAO,EAAE,CAAA;QACtB,MAAM,OAAO,GAAG,MAAM,CAAC,OAAO,CAAC,EAAE,EAAE,CAAA;QACnC,QAAQ,CAAC,MAAM,CAAC,EAAE,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC,CAAA;QAC1C,QAAQ,CAAC,OAAO,CAAC,gBAAgB,OAAO,CAAC,IAAI,IAAI,OAAO,CAAC,EAAE,EAAE,CAAC,CAAA;IAChE,CAAC;YAAS,CAAC;QACT,MAAM,MAAM,CAAC,KAAK,EAAE,CAAA;IACtB,CAAC;AACH,CAAC,CAAC,CAAA"}
@@ -1,10 +0,0 @@
1
- import { Command } from "commander";
2
- /**
3
- * Local only, for now: it forgets the token and the device identity on this machine.
4
- *
5
- * It does **not** yet send LOGOUT (opcode 20), which would end the session on MAX's side too. That
6
- * distinction is in the output rather than glossed over: a forgotten token that is still live
7
- * elsewhere is a different thing from a revoked one.
8
- */
9
- export declare const logoutCommand: () => Command;
10
- //# sourceMappingURL=logout.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"logout.d.ts","sourceRoot":"","sources":["../../src/commands/logout.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AAInC;;;;;;GAMG;AACH,eAAO,MAAM,aAAa,QAAO,OAU7B,CAAA"}
@@ -1,22 +0,0 @@
1
- import { Command } from "commander";
2
- import { resolveOutput } from "../output.js";
3
- import { SessionStore } from "../session/store.js";
4
- /**
5
- * Local only, for now: it forgets the token and the device identity on this machine.
6
- *
7
- * It does **not** yet send LOGOUT (opcode 20), which would end the session on MAX's side too. That
8
- * distinction is in the output rather than glossed over: a forgotten token that is still live
9
- * elsewhere is a different thing from a revoked one.
10
- */
11
- export const logoutCommand = () => new Command("logout").description("forget the stored session for this profile").action(function () {
12
- const options = this.optsWithGlobals();
13
- const { renderer } = resolveOutput(options);
14
- const store = new SessionStore({ profile: options.profile });
15
- const had = store.forget();
16
- renderer.result({ profile: store.profile, forgotten: had, revokedOnServer: false });
17
- if (had)
18
- renderer.success(`forgot the session for "${store.profile}" on this machine`);
19
- else
20
- renderer.note(`there was no session for "${store.profile}"`);
21
- });
22
- //# sourceMappingURL=logout.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"logout.js","sourceRoot":"","sources":["../../src/commands/logout.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AACnC,OAAO,EAAE,aAAa,EAAE,MAAM,cAAc,CAAA;AAC5C,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAA;AAElD;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,aAAa,GAAG,GAAY,EAAE,CACzC,IAAI,OAAO,CAAC,QAAQ,CAAC,CAAC,WAAW,CAAC,4CAA4C,CAAC,CAAC,MAAM,CAAC;IACrF,MAAM,OAAO,GAAG,IAAI,CAAC,eAAe,EAAE,CAAA;IACtC,MAAM,EAAE,QAAQ,EAAE,GAAG,aAAa,CAAC,OAAO,CAAC,CAAA;IAC3C,MAAM,KAAK,GAAG,IAAI,YAAY,CAAC,EAAE,OAAO,EAAE,OAAO,CAAC,OAAO,EAAE,CAAC,CAAA;IAC5D,MAAM,GAAG,GAAG,KAAK,CAAC,MAAM,EAAE,CAAA;IAE1B,QAAQ,CAAC,MAAM,CAAC,EAAE,OAAO,EAAE,KAAK,CAAC,OAAO,EAAE,SAAS,EAAE,GAAG,EAAE,eAAe,EAAE,KAAK,EAAE,CAAC,CAAA;IACnF,IAAI,GAAG;QAAE,QAAQ,CAAC,OAAO,CAAC,2BAA2B,KAAK,CAAC,OAAO,mBAAmB,CAAC,CAAA;;QACjF,QAAQ,CAAC,IAAI,CAAC,6BAA6B,KAAK,CAAC,OAAO,GAAG,CAAC,CAAA;AACnE,CAAC,CAAC,CAAA"}
@@ -1,3 +0,0 @@
1
- import { Command } from "commander";
2
- export declare const meCommand: () => Command;
3
- //# sourceMappingURL=me.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"me.d.ts","sourceRoot":"","sources":["../../src/commands/me.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AAKnC,eAAO,MAAM,SAAS,QAAO,OAazB,CAAA"}
@@ -1,18 +0,0 @@
1
- import { Command } from "commander";
2
- import { MaxClient } from "../client.js";
3
- import { resolveOutput } from "../output.js";
4
- import { SessionStore } from "../session/store.js";
5
- export const meCommand = () => new Command("me").description("who this profile is logged in as").action(async function () {
6
- const options = this.optsWithGlobals();
7
- const { renderer } = resolveOutput(options);
8
- const client = new MaxClient({ store: new SessionStore({ profile: options.profile }) });
9
- try {
10
- await client.connect();
11
- renderer.result(client.account.me());
12
- }
13
- finally {
14
- // Nothing below this line: an open socket keeps the process alive after the answer printed.
15
- await client.close();
16
- }
17
- });
18
- //# sourceMappingURL=me.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"me.js","sourceRoot":"","sources":["../../src/commands/me.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AACnC,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAA;AACxC,OAAO,EAAE,aAAa,EAAE,MAAM,cAAc,CAAA;AAC5C,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAA;AAElD,MAAM,CAAC,MAAM,SAAS,GAAG,GAAY,EAAE,CACrC,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC,WAAW,CAAC,kCAAkC,CAAC,CAAC,MAAM,CAAC,KAAK;IAC5E,MAAM,OAAO,GAAG,IAAI,CAAC,eAAe,EAAE,CAAA;IACtC,MAAM,EAAE,QAAQ,EAAE,GAAG,aAAa,CAAC,OAAO,CAAC,CAAA;IAC3C,MAAM,MAAM,GAAG,IAAI,SAAS,CAAC,EAAE,KAAK,EAAE,IAAI,YAAY,CAAC,EAAE,OAAO,EAAE,OAAO,CAAC,OAAO,EAAE,CAAC,EAAE,CAAC,CAAA;IAEvF,IAAI,CAAC;QACH,MAAM,MAAM,CAAC,OAAO,EAAE,CAAA;QACtB,QAAQ,CAAC,MAAM,CAAC,MAAM,CAAC,OAAO,CAAC,EAAE,EAAE,CAAC,CAAA;IACtC,CAAC;YAAS,CAAC;QACT,4FAA4F;QAC5F,MAAM,MAAM,CAAC,KAAK,EAAE,CAAA;IACtB,CAAC;AACH,CAAC,CAAC,CAAA"}
@@ -1,10 +0,0 @@
1
- import { Command } from "commander";
2
- /**
3
- * One message, one command, no retry.
4
- *
5
- * There is no `--dry-run` here: the target and the text are both in the line the person typed, so
6
- * a preview would restate the command back at them (REQUIREMENTS §21). What this command does owe
7
- * the caller is honesty about an outcome it does not know — see `MaxClient.sendMessage`.
8
- */
9
- export declare const sendCommand: () => Command;
10
- //# sourceMappingURL=send.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"send.d.ts","sourceRoot":"","sources":["../../src/commands/send.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AAKnC;;;;;;GAMG;AACH,eAAO,MAAM,WAAW,QAAO,OAoBzB,CAAA"}
@@ -1,30 +0,0 @@
1
- import { Command } from "commander";
2
- import { MaxClient } from "../client.js";
3
- import { resolveOutput } from "../output.js";
4
- import { SessionStore } from "../session/store.js";
5
- /**
6
- * One message, one command, no retry.
7
- *
8
- * There is no `--dry-run` here: the target and the text are both in the line the person typed, so
9
- * a preview would restate the command back at them (REQUIREMENTS §21). What this command does owe
10
- * the caller is honesty about an outcome it does not know — see `MaxClient.sendMessage`.
11
- */
12
- export const sendCommand = () => new Command("send")
13
- .argument("<chat>", "chat id, or part of a chat name")
14
- .argument("<text>", "what to say")
15
- .description("send one text message")
16
- .option("--cid <n>", "reuse a client id from an earlier ambiguous send; MAX collapses the duplicate", (value) => Number.parseInt(value, 10))
17
- .action(async function (chat, text) {
18
- const options = this.optsWithGlobals();
19
- const { renderer } = resolveOutput(options);
20
- const client = new MaxClient({ store: new SessionStore({ profile: options.profile }) });
21
- try {
22
- await client.connect();
23
- const chatId = await client.chats.resolve(chat);
24
- renderer.result(await client.messages.send(chatId, text, options.cid === undefined ? {} : { cid: options.cid }));
25
- }
26
- finally {
27
- await client.close();
28
- }
29
- });
30
- //# sourceMappingURL=send.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"send.js","sourceRoot":"","sources":["../../src/commands/send.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AACnC,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAA;AACxC,OAAO,EAAE,aAAa,EAAE,MAAM,cAAc,CAAA;AAC5C,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAA;AAElD;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,WAAW,GAAG,GAAY,EAAE,CACvC,IAAI,OAAO,CAAC,MAAM,CAAC;KAChB,QAAQ,CAAC,QAAQ,EAAE,iCAAiC,CAAC;KACrD,QAAQ,CAAC,QAAQ,EAAE,aAAa,CAAC;KACjC,WAAW,CAAC,uBAAuB,CAAC;KACpC,MAAM,CAAC,WAAW,EAAE,+EAA+E,EAAE,CAAC,KAAK,EAAE,EAAE,CAC9G,MAAM,CAAC,QAAQ,CAAC,KAAK,EAAE,EAAE,CAAC,CAC3B;KACA,MAAM,CAAC,KAAK,WAA0B,IAAY,EAAE,IAAY;IAC/D,MAAM,OAAO,GAAG,IAAI,CAAC,eAAe,EAAE,CAAA;IACtC,MAAM,EAAE,QAAQ,EAAE,GAAG,aAAa,CAAC,OAAO,CAAC,CAAA;IAC3C,MAAM,MAAM,GAAG,IAAI,SAAS,CAAC,EAAE,KAAK,EAAE,IAAI,YAAY,CAAC,EAAE,OAAO,EAAE,OAAO,CAAC,OAAO,EAAE,CAAC,EAAE,CAAC,CAAA;IAEvF,IAAI,CAAC;QACH,MAAM,MAAM,CAAC,OAAO,EAAE,CAAA;QACtB,MAAM,MAAM,GAAG,MAAM,MAAM,CAAC,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,CAAA;QAC/C,QAAQ,CAAC,MAAM,CAAC,MAAM,MAAM,CAAC,QAAQ,CAAC,IAAI,CAAC,MAAM,EAAE,IAAI,EAAE,OAAO,CAAC,GAAG,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,GAAG,EAAE,OAAO,CAAC,GAAG,EAAE,CAAC,CAAC,CAAA;IAClH,CAAC;YAAS,CAAC;QACT,MAAM,MAAM,CAAC,KAAK,EAAE,CAAA;IACtB,CAAC;AACH,CAAC,CAAC,CAAA"}
@@ -1,54 +0,0 @@
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
@@ -1 +0,0 @@
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"}
@@ -1,57 +0,0 @@
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
@@ -1 +0,0 @@
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"}
@@ -1,42 +0,0 @@
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
@@ -1 +0,0 @@
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"}