@wirecat/max-cli 0.0.0-stage → 0.42.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 (546) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +530 -2
  3. package/dist/adapter/max-adapter.d.ts +17 -0
  4. package/dist/adapter/max-adapter.d.ts.map +1 -0
  5. package/dist/adapter/max-adapter.js +364 -0
  6. package/dist/adapter/max-adapter.js.map +1 -0
  7. package/dist/app.d.ts +3 -0
  8. package/dist/app.d.ts.map +1 -0
  9. package/dist/app.js +9 -0
  10. package/dist/app.js.map +1 -0
  11. package/dist/bin/max.d.ts +3 -0
  12. package/dist/bin/max.d.ts.map +1 -0
  13. package/dist/bin/max.js +20 -0
  14. package/dist/bin/max.js.map +1 -0
  15. package/dist/bot/adapter.d.ts +25 -0
  16. package/dist/bot/adapter.d.ts.map +1 -0
  17. package/dist/bot/adapter.js +404 -0
  18. package/dist/bot/adapter.js.map +1 -0
  19. package/dist/bot/auth.d.ts +13 -0
  20. package/dist/bot/auth.d.ts.map +1 -0
  21. package/dist/bot/auth.js +9 -0
  22. package/dist/bot/auth.js.map +1 -0
  23. package/dist/bot/client.d.ts +26 -0
  24. package/dist/bot/client.d.ts.map +1 -0
  25. package/dist/bot/client.js +105 -0
  26. package/dist/bot/client.js.map +1 -0
  27. package/dist/bot/generated/manifest.d.ts +3 -0
  28. package/dist/bot/generated/manifest.d.ts.map +1 -0
  29. package/dist/bot/generated/manifest.js +1232 -0
  30. package/dist/bot/generated/manifest.js.map +1 -0
  31. package/dist/bot/generated/schemas.d.ts +271 -0
  32. package/dist/bot/generated/schemas.d.ts.map +1 -0
  33. package/dist/bot/generated/schemas.js +869 -0
  34. package/dist/bot/generated/schemas.js.map +1 -0
  35. package/dist/bot/generated/types.d.ts +1088 -0
  36. package/dist/bot/generated/types.d.ts.map +1 -0
  37. package/dist/bot/generated/types.js +5 -0
  38. package/dist/bot/generated/types.js.map +1 -0
  39. package/dist/bot/input.d.ts +6 -0
  40. package/dist/bot/input.d.ts.map +1 -0
  41. package/dist/bot/input.js +6 -0
  42. package/dist/bot/input.js.map +1 -0
  43. package/dist/bot/joins.d.ts +26 -0
  44. package/dist/bot/joins.d.ts.map +1 -0
  45. package/dist/bot/joins.js +56 -0
  46. package/dist/bot/joins.js.map +1 -0
  47. package/dist/bot/keep.d.ts +25 -0
  48. package/dist/bot/keep.d.ts.map +1 -0
  49. package/dist/bot/keep.js +98 -0
  50. package/dist/bot/keep.js.map +1 -0
  51. package/dist/bot/map.d.ts +14 -0
  52. package/dist/bot/map.d.ts.map +1 -0
  53. package/dist/bot/map.js +101 -0
  54. package/dist/bot/map.js.map +1 -0
  55. package/dist/bot/mcp-tools.d.ts +4 -0
  56. package/dist/bot/mcp-tools.d.ts.map +1 -0
  57. package/dist/bot/mcp-tools.js +78 -0
  58. package/dist/bot/mcp-tools.js.map +1 -0
  59. package/dist/bot/permissions.d.ts +14 -0
  60. package/dist/bot/permissions.d.ts.map +1 -0
  61. package/dist/bot/permissions.js +88 -0
  62. package/dist/bot/permissions.js.map +1 -0
  63. package/dist/bot/registry.d.ts +11 -0
  64. package/dist/bot/registry.d.ts.map +1 -0
  65. package/dist/bot/registry.js +13 -0
  66. package/dist/bot/registry.js.map +1 -0
  67. package/dist/bot/russian-trusted-root.d.ts +8 -0
  68. package/dist/bot/russian-trusted-root.d.ts.map +1 -0
  69. package/dist/bot/russian-trusted-root.js +41 -0
  70. package/dist/bot/russian-trusted-root.js.map +1 -0
  71. package/dist/bot/transport.d.ts +46 -0
  72. package/dist/bot/transport.d.ts.map +1 -0
  73. package/dist/bot/transport.js +252 -0
  74. package/dist/bot/transport.js.map +1 -0
  75. package/dist/bot/uploads.d.ts +42 -0
  76. package/dist/bot/uploads.d.ts.map +1 -0
  77. package/dist/bot/uploads.js +145 -0
  78. package/dist/bot/uploads.js.map +1 -0
  79. package/dist/client.d.ts +650 -0
  80. package/dist/client.d.ts.map +1 -0
  81. package/dist/client.js +2836 -0
  82. package/dist/client.js.map +1 -0
  83. package/dist/commands/account.d.ts +3 -0
  84. package/dist/commands/account.d.ts.map +1 -0
  85. package/dist/commands/account.js +4 -0
  86. package/dist/commands/account.js.map +1 -0
  87. package/dist/commands/bot-comments.d.ts +3 -0
  88. package/dist/commands/bot-comments.d.ts.map +1 -0
  89. package/dist/commands/bot-comments.js +74 -0
  90. package/dist/commands/bot-comments.js.map +1 -0
  91. package/dist/commands/bot-context.d.ts +38 -0
  92. package/dist/commands/bot-context.d.ts.map +1 -0
  93. package/dist/commands/bot-context.js +121 -0
  94. package/dist/commands/bot-context.js.map +1 -0
  95. package/dist/commands/bot-members.d.ts +14 -0
  96. package/dist/commands/bot-members.d.ts.map +1 -0
  97. package/dist/commands/bot-members.js +64 -0
  98. package/dist/commands/bot-members.js.map +1 -0
  99. package/dist/commands/bot-messenger.d.ts +10 -0
  100. package/dist/commands/bot-messenger.d.ts.map +1 -0
  101. package/dist/commands/bot-messenger.js +101 -0
  102. package/dist/commands/bot-messenger.js.map +1 -0
  103. package/dist/commands/bot-reads.d.ts +4 -0
  104. package/dist/commands/bot-reads.d.ts.map +1 -0
  105. package/dist/commands/bot-reads.js +13 -0
  106. package/dist/commands/bot-reads.js.map +1 -0
  107. package/dist/commands/bot-sends.d.ts +13 -0
  108. package/dist/commands/bot-sends.d.ts.map +1 -0
  109. package/dist/commands/bot-sends.js +103 -0
  110. package/dist/commands/bot-sends.js.map +1 -0
  111. package/dist/commands/bot-setup.d.ts +3 -0
  112. package/dist/commands/bot-setup.d.ts.map +1 -0
  113. package/dist/commands/bot-setup.js +20 -0
  114. package/dist/commands/bot-setup.js.map +1 -0
  115. package/dist/commands/bot.d.ts +3 -0
  116. package/dist/commands/bot.d.ts.map +1 -0
  117. package/dist/commands/bot.js +60 -0
  118. package/dist/commands/bot.js.map +1 -0
  119. package/dist/commands/calls.d.ts +3 -0
  120. package/dist/commands/calls.d.ts.map +1 -0
  121. package/dist/commands/calls.js +4 -0
  122. package/dist/commands/calls.js.map +1 -0
  123. package/dist/commands/chats.d.ts +3 -0
  124. package/dist/commands/chats.d.ts.map +1 -0
  125. package/dist/commands/chats.js +46 -0
  126. package/dist/commands/chats.js.map +1 -0
  127. package/dist/commands/commands.d.ts +2 -0
  128. package/dist/commands/commands.d.ts.map +1 -0
  129. package/dist/commands/commands.js +4 -0
  130. package/dist/commands/commands.js.map +1 -0
  131. package/dist/commands/complete.d.ts +2 -0
  132. package/dist/commands/complete.d.ts.map +1 -0
  133. package/dist/commands/complete.js +34 -0
  134. package/dist/commands/complete.js.map +1 -0
  135. package/dist/commands/config.d.ts +3 -0
  136. package/dist/commands/config.d.ts.map +1 -0
  137. package/dist/commands/config.js +170 -0
  138. package/dist/commands/config.js.map +1 -0
  139. package/dist/commands/contacts.d.ts +10 -0
  140. package/dist/commands/contacts.d.ts.map +1 -0
  141. package/dist/commands/contacts.js +80 -0
  142. package/dist/commands/contacts.js.map +1 -0
  143. package/dist/commands/context.d.ts +126 -0
  144. package/dist/commands/context.d.ts.map +1 -0
  145. package/dist/commands/context.js +137 -0
  146. package/dist/commands/context.js.map +1 -0
  147. package/dist/commands/doctor.d.ts +24 -0
  148. package/dist/commands/doctor.d.ts.map +1 -0
  149. package/dist/commands/doctor.js +308 -0
  150. package/dist/commands/doctor.js.map +1 -0
  151. package/dist/commands/mcp.d.ts +36 -0
  152. package/dist/commands/mcp.d.ts.map +1 -0
  153. package/dist/commands/mcp.js +214 -0
  154. package/dist/commands/mcp.js.map +1 -0
  155. package/dist/commands/messages.d.ts +3 -0
  156. package/dist/commands/messages.d.ts.map +1 -0
  157. package/dist/commands/messages.js +105 -0
  158. package/dist/commands/messages.js.map +1 -0
  159. package/dist/commands/models.d.ts +3 -0
  160. package/dist/commands/models.d.ts.map +1 -0
  161. package/dist/commands/models.js +4 -0
  162. package/dist/commands/models.js.map +1 -0
  163. package/dist/commands/paging.d.ts +59 -0
  164. package/dist/commands/paging.d.ts.map +1 -0
  165. package/dist/commands/paging.js +77 -0
  166. package/dist/commands/paging.js.map +1 -0
  167. package/dist/commands/recipients.d.ts +9 -0
  168. package/dist/commands/recipients.d.ts.map +1 -0
  169. package/dist/commands/recipients.js +74 -0
  170. package/dist/commands/recipients.js.map +1 -0
  171. package/dist/commands/runs.d.ts +2 -0
  172. package/dist/commands/runs.d.ts.map +1 -0
  173. package/dist/commands/runs.js +4 -0
  174. package/dist/commands/runs.js.map +1 -0
  175. package/dist/commands/sends.d.ts +3 -0
  176. package/dist/commands/sends.d.ts.map +1 -0
  177. package/dist/commands/sends.js +4 -0
  178. package/dist/commands/sends.js.map +1 -0
  179. package/dist/commands/serve-members.d.ts +14 -0
  180. package/dist/commands/serve-members.d.ts.map +1 -0
  181. package/dist/commands/serve-members.js +54 -0
  182. package/dist/commands/serve-members.js.map +1 -0
  183. package/dist/commands/serve-stems.d.ts +9 -0
  184. package/dist/commands/serve-stems.d.ts.map +1 -0
  185. package/dist/commands/serve-stems.js +26 -0
  186. package/dist/commands/serve-stems.js.map +1 -0
  187. package/dist/commands/serve.d.ts +10 -0
  188. package/dist/commands/serve.d.ts.map +1 -0
  189. package/dist/commands/serve.js +79 -0
  190. package/dist/commands/serve.js.map +1 -0
  191. package/dist/commands/server.d.ts +16 -0
  192. package/dist/commands/server.d.ts.map +1 -0
  193. package/dist/commands/server.js +51 -0
  194. package/dist/commands/server.js.map +1 -0
  195. package/dist/commands/session.d.ts +15 -0
  196. package/dist/commands/session.d.ts.map +1 -0
  197. package/dist/commands/session.js +169 -0
  198. package/dist/commands/session.js.map +1 -0
  199. package/dist/commands/setup.d.ts +3 -0
  200. package/dist/commands/setup.d.ts.map +1 -0
  201. package/dist/commands/setup.js +168 -0
  202. package/dist/commands/setup.js.map +1 -0
  203. package/dist/commands/skill.d.ts +3 -0
  204. package/dist/commands/skill.d.ts.map +1 -0
  205. package/dist/commands/skill.js +7 -0
  206. package/dist/commands/skill.js.map +1 -0
  207. package/dist/commands/stickers.d.ts +3 -0
  208. package/dist/commands/stickers.d.ts.map +1 -0
  209. package/dist/commands/stickers.js +4 -0
  210. package/dist/commands/stickers.js.map +1 -0
  211. package/dist/commands/upgrade.d.ts +2 -0
  212. package/dist/commands/upgrade.d.ts.map +1 -0
  213. package/dist/commands/upgrade.js +14 -0
  214. package/dist/commands/upgrade.js.map +1 -0
  215. package/dist/commands/watch.d.ts +27 -0
  216. package/dist/commands/watch.d.ts.map +1 -0
  217. package/dist/commands/watch.js +105 -0
  218. package/dist/commands/watch.js.map +1 -0
  219. package/dist/config.d.ts +385 -0
  220. package/dist/config.d.ts.map +1 -0
  221. package/dist/config.js +372 -0
  222. package/dist/config.js.map +1 -0
  223. package/dist/deadline.d.ts +2 -0
  224. package/dist/deadline.d.ts.map +1 -0
  225. package/dist/deadline.js +2 -0
  226. package/dist/deadline.js.map +1 -0
  227. package/dist/diagnose.d.ts +143 -0
  228. package/dist/diagnose.d.ts.map +1 -0
  229. package/dist/diagnose.js +183 -0
  230. package/dist/diagnose.js.map +1 -0
  231. package/dist/domain/map.d.ts +65 -0
  232. package/dist/domain/map.d.ts.map +1 -0
  233. package/dist/domain/map.js +431 -0
  234. package/dist/domain/map.js.map +1 -0
  235. package/dist/domain/models.d.ts +238 -0
  236. package/dist/domain/models.d.ts.map +1 -0
  237. package/dist/domain/models.js +17 -0
  238. package/dist/domain/models.js.map +1 -0
  239. package/dist/download.d.ts +38 -0
  240. package/dist/download.d.ts.map +1 -0
  241. package/dist/download.js +199 -0
  242. package/dist/download.js.map +1 -0
  243. package/dist/format-markdown.d.ts +13 -0
  244. package/dist/format-markdown.d.ts.map +1 -0
  245. package/dist/format-markdown.js +241 -0
  246. package/dist/format-markdown.js.map +1 -0
  247. package/dist/generated/client.generated.d.ts +95 -0
  248. package/dist/generated/client.generated.d.ts.map +1 -0
  249. package/dist/generated/client.generated.js +91 -0
  250. package/dist/generated/client.generated.js.map +1 -0
  251. package/dist/generated/opcodes.generated.d.ts +76 -0
  252. package/dist/generated/opcodes.generated.d.ts.map +1 -0
  253. package/dist/generated/opcodes.generated.js +76 -0
  254. package/dist/generated/opcodes.generated.js.map +1 -0
  255. package/dist/generated/operations.generated.d.ts +502 -0
  256. package/dist/generated/operations.generated.d.ts.map +1 -0
  257. package/dist/generated/operations.generated.js +72 -0
  258. package/dist/generated/operations.generated.js.map +1 -0
  259. package/dist/inbox-point.d.ts +3 -0
  260. package/dist/inbox-point.d.ts.map +1 -0
  261. package/dist/inbox-point.js +17 -0
  262. package/dist/inbox-point.js.map +1 -0
  263. package/dist/install/postinstall.d.ts +8 -0
  264. package/dist/install/postinstall.d.ts.map +1 -0
  265. package/dist/install/postinstall.js +62 -0
  266. package/dist/install/postinstall.js.map +1 -0
  267. package/dist/install.d.ts +43 -0
  268. package/dist/install.d.ts.map +1 -0
  269. package/dist/install.js +142 -0
  270. package/dist/install.js.map +1 -0
  271. package/dist/markdown.d.ts +13 -0
  272. package/dist/markdown.d.ts.map +1 -0
  273. package/dist/markdown.js +6 -0
  274. package/dist/markdown.js.map +1 -0
  275. package/dist/mcp/instructions.d.ts +13 -0
  276. package/dist/mcp/instructions.d.ts.map +1 -0
  277. package/dist/mcp/instructions.js +16 -0
  278. package/dist/mcp/instructions.js.map +1 -0
  279. package/dist/mcp/legacy-check.d.ts +12 -0
  280. package/dist/mcp/legacy-check.d.ts.map +1 -0
  281. package/dist/mcp/legacy-check.js +44 -0
  282. package/dist/mcp/legacy-check.js.map +1 -0
  283. package/dist/mcp/photo.d.ts +9 -0
  284. package/dist/mcp/photo.d.ts.map +1 -0
  285. package/dist/mcp/photo.js +38 -0
  286. package/dist/mcp/photo.js.map +1 -0
  287. package/dist/mcp/prompts.d.ts +7 -0
  288. package/dist/mcp/prompts.d.ts.map +1 -0
  289. package/dist/mcp/prompts.js +100 -0
  290. package/dist/mcp/prompts.js.map +1 -0
  291. package/dist/mcp/resources.d.ts +15 -0
  292. package/dist/mcp/resources.d.ts.map +1 -0
  293. package/dist/mcp/resources.js +56 -0
  294. package/dist/mcp/resources.js.map +1 -0
  295. package/dist/mcp/server.d.ts +31 -0
  296. package/dist/mcp/server.d.ts.map +1 -0
  297. package/dist/mcp/server.js +116 -0
  298. package/dist/mcp/server.js.map +1 -0
  299. package/dist/mcp/session.d.ts +30 -0
  300. package/dist/mcp/session.d.ts.map +1 -0
  301. package/dist/mcp/session.js +109 -0
  302. package/dist/mcp/session.js.map +1 -0
  303. package/dist/mcp/shared.d.ts +14 -0
  304. package/dist/mcp/shared.d.ts.map +1 -0
  305. package/dist/mcp/shared.js +46 -0
  306. package/dist/mcp/shared.js.map +1 -0
  307. package/dist/mcp/tools.d.ts +30 -0
  308. package/dist/mcp/tools.d.ts.map +1 -0
  309. package/dist/mcp/tools.js +248 -0
  310. package/dist/mcp/tools.js.map +1 -0
  311. package/dist/messenger.d.ts +15 -0
  312. package/dist/messenger.d.ts.map +1 -0
  313. package/dist/messenger.js +149 -0
  314. package/dist/messenger.js.map +1 -0
  315. package/dist/moderation/check.d.ts +103 -0
  316. package/dist/moderation/check.d.ts.map +1 -0
  317. package/dist/moderation/check.js +273 -0
  318. package/dist/moderation/check.js.map +1 -0
  319. package/dist/moderation/points.d.ts +8 -0
  320. package/dist/moderation/points.d.ts.map +1 -0
  321. package/dist/moderation/points.js +21 -0
  322. package/dist/moderation/points.js.map +1 -0
  323. package/dist/moderation/rules.d.ts +7 -0
  324. package/dist/moderation/rules.d.ts.map +1 -0
  325. package/dist/moderation/rules.js +24 -0
  326. package/dist/moderation/rules.js.map +1 -0
  327. package/dist/online.d.ts +23 -0
  328. package/dist/online.d.ts.map +1 -0
  329. package/dist/online.js +87 -0
  330. package/dist/online.js.map +1 -0
  331. package/dist/output.d.ts +2 -0
  332. package/dist/output.d.ts.map +1 -0
  333. package/dist/output.js +2 -0
  334. package/dist/output.js.map +1 -0
  335. package/dist/permissions.d.ts +20 -0
  336. package/dist/permissions.d.ts.map +1 -0
  337. package/dist/permissions.js +76 -0
  338. package/dist/permissions.js.map +1 -0
  339. package/dist/profile.d.ts +33 -0
  340. package/dist/profile.d.ts.map +1 -0
  341. package/dist/profile.js +60 -0
  342. package/dist/profile.js.map +1 -0
  343. package/dist/program.d.ts +10 -0
  344. package/dist/program.d.ts.map +1 -0
  345. package/dist/program.js +172 -0
  346. package/dist/program.js.map +1 -0
  347. package/dist/protocol/connection.d.ts +83 -0
  348. package/dist/protocol/connection.d.ts.map +1 -0
  349. package/dist/protocol/connection.js +301 -0
  350. package/dist/protocol/connection.js.map +1 -0
  351. package/dist/protocol/frame.d.ts +55 -0
  352. package/dist/protocol/frame.d.ts.map +1 -0
  353. package/dist/protocol/frame.js +149 -0
  354. package/dist/protocol/frame.js.map +1 -0
  355. package/dist/protocol/lz4.d.ts +15 -0
  356. package/dist/protocol/lz4.d.ts.map +1 -0
  357. package/dist/protocol/lz4.js +157 -0
  358. package/dist/protocol/lz4.js.map +1 -0
  359. package/dist/record.d.ts +41 -0
  360. package/dist/record.d.ts.map +1 -0
  361. package/dist/record.js +104 -0
  362. package/dist/record.js.map +1 -0
  363. package/dist/rendering/messages.d.ts +24 -0
  364. package/dist/rendering/messages.d.ts.map +1 -0
  365. package/dist/rendering/messages.js +172 -0
  366. package/dist/rendering/messages.js.map +1 -0
  367. package/dist/report.d.ts +43 -0
  368. package/dist/report.d.ts.map +1 -0
  369. package/dist/report.js +104 -0
  370. package/dist/report.js.map +1 -0
  371. package/dist/resolve.d.ts +6 -0
  372. package/dist/resolve.d.ts.map +1 -0
  373. package/dist/resolve.js +5 -0
  374. package/dist/resolve.js.map +1 -0
  375. package/dist/sends.d.ts +17 -0
  376. package/dist/sends.d.ts.map +1 -0
  377. package/dist/sends.js +97 -0
  378. package/dist/sends.js.map +1 -0
  379. package/dist/server/lines.d.ts +23 -0
  380. package/dist/server/lines.d.ts.map +1 -0
  381. package/dist/server/lines.js +56 -0
  382. package/dist/server/lines.js.map +1 -0
  383. package/dist/server/replies.d.ts +31 -0
  384. package/dist/server/replies.d.ts.map +1 -0
  385. package/dist/server/replies.js +95 -0
  386. package/dist/server/replies.js.map +1 -0
  387. package/dist/server/server-connection.d.ts +55 -0
  388. package/dist/server/server-connection.d.ts.map +1 -0
  389. package/dist/server/server-connection.js +245 -0
  390. package/dist/server/server-connection.js.map +1 -0
  391. package/dist/server/server.d.ts +88 -0
  392. package/dist/server/server.d.ts.map +1 -0
  393. package/dist/server/server.js +634 -0
  394. package/dist/server/server.js.map +1 -0
  395. package/dist/server/start.d.ts +37 -0
  396. package/dist/server/start.d.ts.map +1 -0
  397. package/dist/server/start.js +102 -0
  398. package/dist/server/start.js.map +1 -0
  399. package/dist/server/subscribe.d.ts +9 -0
  400. package/dist/server/subscribe.d.ts.map +1 -0
  401. package/dist/server/subscribe.js +26 -0
  402. package/dist/server/subscribe.js.map +1 -0
  403. package/dist/session/adopt.d.ts +22 -0
  404. package/dist/session/adopt.d.ts.map +1 -0
  405. package/dist/session/adopt.js +34 -0
  406. package/dist/session/adopt.js.map +1 -0
  407. package/dist/session/browser.d.ts +55 -0
  408. package/dist/session/browser.d.ts.map +1 -0
  409. package/dist/session/browser.js +321 -0
  410. package/dist/session/browser.js.map +1 -0
  411. package/dist/session/handshake.d.ts +57 -0
  412. package/dist/session/handshake.d.ts.map +1 -0
  413. package/dist/session/handshake.js +40 -0
  414. package/dist/session/handshake.js.map +1 -0
  415. package/dist/session/login.d.ts +20 -0
  416. package/dist/session/login.d.ts.map +1 -0
  417. package/dist/session/login.js +66 -0
  418. package/dist/session/login.js.map +1 -0
  419. package/dist/session/prompt.d.ts +2 -0
  420. package/dist/session/prompt.d.ts.map +1 -0
  421. package/dist/session/prompt.js +2 -0
  422. package/dist/session/prompt.js.map +1 -0
  423. package/dist/session/qr-terminal.d.ts +9 -0
  424. package/dist/session/qr-terminal.d.ts.map +1 -0
  425. package/dist/session/qr-terminal.js +34 -0
  426. package/dist/session/qr-terminal.js.map +1 -0
  427. package/dist/session/store.d.ts +76 -0
  428. package/dist/session/store.d.ts.map +1 -0
  429. package/dist/session/store.js +134 -0
  430. package/dist/session/store.js.map +1 -0
  431. package/dist/skill.d.ts +7 -0
  432. package/dist/skill.d.ts.map +1 -0
  433. package/dist/skill.js +8 -0
  434. package/dist/skill.js.map +1 -0
  435. package/dist/spec/check.d.ts +16 -0
  436. package/dist/spec/check.d.ts.map +1 -0
  437. package/dist/spec/check.js +44 -0
  438. package/dist/spec/check.js.map +1 -0
  439. package/dist/spec/define.d.ts +108 -0
  440. package/dist/spec/define.d.ts.map +1 -0
  441. package/dist/spec/define.js +47 -0
  442. package/dist/spec/define.js.map +1 -0
  443. package/dist/spec/guards.d.ts +16 -0
  444. package/dist/spec/guards.d.ts.map +1 -0
  445. package/dist/spec/guards.js +30 -0
  446. package/dist/spec/guards.js.map +1 -0
  447. package/dist/spec/identity.d.ts +57 -0
  448. package/dist/spec/identity.d.ts.map +1 -0
  449. package/dist/spec/identity.js +53 -0
  450. package/dist/spec/identity.js.map +1 -0
  451. package/dist/spec/index.d.ts +15 -0
  452. package/dist/spec/index.d.ts.map +1 -0
  453. package/dist/spec/index.js +84 -0
  454. package/dist/spec/index.js.map +1 -0
  455. package/dist/spec/operations/account.d.ts +39 -0
  456. package/dist/spec/operations/account.d.ts.map +1 -0
  457. package/dist/spec/operations/account.js +103 -0
  458. package/dist/spec/operations/account.js.map +1 -0
  459. package/dist/spec/operations/assets.d.ts +17 -0
  460. package/dist/spec/operations/assets.d.ts.map +1 -0
  461. package/dist/spec/operations/assets.js +43 -0
  462. package/dist/spec/operations/assets.js.map +1 -0
  463. package/dist/spec/operations/attachments.d.ts +15 -0
  464. package/dist/spec/operations/attachments.d.ts.map +1 -0
  465. package/dist/spec/operations/attachments.js +40 -0
  466. package/dist/spec/operations/attachments.js.map +1 -0
  467. package/dist/spec/operations/banners.d.ts +7 -0
  468. package/dist/spec/operations/banners.d.ts.map +1 -0
  469. package/dist/spec/operations/banners.js +16 -0
  470. package/dist/spec/operations/banners.js.map +1 -0
  471. package/dist/spec/operations/calls.d.ts +8 -0
  472. package/dist/spec/operations/calls.d.ts.map +1 -0
  473. package/dist/spec/operations/calls.js +25 -0
  474. package/dist/spec/operations/calls.js.map +1 -0
  475. package/dist/spec/operations/chats.d.ts +115 -0
  476. package/dist/spec/operations/chats.d.ts.map +1 -0
  477. package/dist/spec/operations/chats.js +331 -0
  478. package/dist/spec/operations/chats.js.map +1 -0
  479. package/dist/spec/operations/contacts.d.ts +39 -0
  480. package/dist/spec/operations/contacts.d.ts.map +1 -0
  481. package/dist/spec/operations/contacts.js +135 -0
  482. package/dist/spec/operations/contacts.js.map +1 -0
  483. package/dist/spec/operations/folders.d.ts +31 -0
  484. package/dist/spec/operations/folders.d.ts.map +1 -0
  485. package/dist/spec/operations/folders.js +94 -0
  486. package/dist/spec/operations/folders.js.map +1 -0
  487. package/dist/spec/operations/login.d.ts +64 -0
  488. package/dist/spec/operations/login.d.ts.map +1 -0
  489. package/dist/spec/operations/login.js +105 -0
  490. package/dist/spec/operations/login.js.map +1 -0
  491. package/dist/spec/operations/messages.d.ts +142 -0
  492. package/dist/spec/operations/messages.d.ts.map +1 -0
  493. package/dist/spec/operations/messages.js +347 -0
  494. package/dist/spec/operations/messages.js.map +1 -0
  495. package/dist/spec/operations/session.d.ts +120 -0
  496. package/dist/spec/operations/session.d.ts.map +1 -0
  497. package/dist/spec/operations/session.js +202 -0
  498. package/dist/spec/operations/session.js.map +1 -0
  499. package/dist/spec/operations/uploads.d.ts +31 -0
  500. package/dist/spec/operations/uploads.d.ts.map +1 -0
  501. package/dist/spec/operations/uploads.js +59 -0
  502. package/dist/spec/operations/uploads.js.map +1 -0
  503. package/dist/spec/scalars.d.ts +17 -0
  504. package/dist/spec/scalars.d.ts.map +1 -0
  505. package/dist/spec/scalars.js +33 -0
  506. package/dist/spec/scalars.js.map +1 -0
  507. package/dist/transcribe/index.d.ts +70 -0
  508. package/dist/transcribe/index.d.ts.map +1 -0
  509. package/dist/transcribe/index.js +127 -0
  510. package/dist/transcribe/index.js.map +1 -0
  511. package/dist/transcribe/install.d.ts +2 -0
  512. package/dist/transcribe/install.d.ts.map +1 -0
  513. package/dist/transcribe/install.js +2 -0
  514. package/dist/transcribe/install.js.map +1 -0
  515. package/dist/transcribe/models.d.ts +5 -0
  516. package/dist/transcribe/models.d.ts.map +1 -0
  517. package/dist/transcribe/models.js +6 -0
  518. package/dist/transcribe/models.js.map +1 -0
  519. package/dist/transcribe/speech.d.ts +25 -0
  520. package/dist/transcribe/speech.d.ts.map +1 -0
  521. package/dist/transcribe/speech.js +107 -0
  522. package/dist/transcribe/speech.js.map +1 -0
  523. package/dist/update.d.ts +31 -0
  524. package/dist/update.d.ts.map +1 -0
  525. package/dist/update.js +69 -0
  526. package/dist/update.js.map +1 -0
  527. package/dist/upload.d.ts +15 -0
  528. package/dist/upload.d.ts.map +1 -0
  529. package/dist/upload.js +97 -0
  530. package/dist/upload.js.map +1 -0
  531. package/dist/version.d.ts +2 -0
  532. package/dist/version.d.ts.map +1 -0
  533. package/dist/version.js +2 -0
  534. package/dist/version.js.map +1 -0
  535. package/dist/voice.d.ts +9 -0
  536. package/dist/voice.d.ts.map +1 -0
  537. package/dist/voice.js +36 -0
  538. package/dist/voice.js.map +1 -0
  539. package/dist/wire-events.d.ts +23 -0
  540. package/dist/wire-events.d.ts.map +1 -0
  541. package/dist/wire-events.js +47 -0
  542. package/dist/wire-events.js.map +1 -0
  543. package/install/postinstall.mjs +3 -0
  544. package/install/windows.ps1 +160 -0
  545. package/package.json +125 -4
  546. package/skills/max-cli/SKILL.md +518 -0
@@ -0,0 +1,76 @@
1
+ import { type CredentialSource, type KeyringStore } from "@wirecat/cli-core";
2
+ /**
3
+ * What a MAX session actually is: a token, and an identity for this installation.
4
+ *
5
+ * **The token lives in the OS keyring; the rest lives in a file.** The split is not decoration —
6
+ * the token is the credential, and the device identity is merely identifying, but it must be
7
+ * *stable*: a client that presents a new device on every command is not imitating a real client
8
+ * (REQUIREMENTS §34), and MAX ties sessions to it.
9
+ */
10
+ export interface SessionState {
11
+ deviceId: string;
12
+ /** Set once the account is known; only used to tell our own messages from other people's. */
13
+ viewerId?: string;
14
+ /** Counts logins so a token that stops working can be explained rather than guessed at (NEED-8). */
15
+ logins: number;
16
+ lastLoginAt?: string;
17
+ /** Where `max inbox` starts next time: the newest message it has read (`NEED-162`). */
18
+ lastCheckAt?: string;
19
+ /** Legacy moderation checkpoints, copied once into the rules file by the shared CLI. */
20
+ checkedUntil?: Record<string, string>;
21
+ /** Logins MAX refused for too many attempts in a row; a login that succeeds clears it (`MAX-38`). */
22
+ loginRefusals?: number;
23
+ /** No login before this time, ISO 8601. */
24
+ loginPausedUntil?: string;
25
+ }
26
+ /**
27
+ * **How long a profile stays out after each refusal in a row** (owner, `NEED-265`). In PyMax a
28
+ * login retried after the limit error kept the account locked (PyMax #106), so the wait grows.
29
+ */
30
+ export declare const LOGIN_PAUSES_MS: number[];
31
+ /** When the pause ends, or `undefined` if a login may go out now. */
32
+ export declare const loginPausedUntil: (state: SessionState, now?: number) => string | undefined;
33
+ export declare const withLoginRefused: (state: SessionState, now?: number) => SessionState;
34
+ export declare const withoutLoginPause: ({ loginRefusals, loginPausedUntil, ...state }: SessionState) => SessionState;
35
+ export interface SessionStoreOptions {
36
+ profile?: string;
37
+ env?: NodeJS.ProcessEnv;
38
+ keyring?: KeyringStore;
39
+ /** Overrides the config and state directories; tests pass a temporary one. */
40
+ configDir?: string;
41
+ stateDir?: string;
42
+ }
43
+ export declare class SessionStore {
44
+ #private;
45
+ readonly profile: string;
46
+ constructor({ profile, env, keyring, configDir, stateDir }?: SessionStoreOptions);
47
+ /** `undefined` means nobody has logged in on this profile. */
48
+ readToken(): string | undefined;
49
+ /** Where `readToken` found it: `MAX_TOKEN`, the keyring, or the file that stands in for one. */
50
+ tokenSource(): CredentialSource | undefined;
51
+ writeToken(token: string): void;
52
+ /**
53
+ * Reads the state, inventing a device identity the first time and keeping it thereafter.
54
+ *
55
+ * **A new identity is written out immediately, before it is used for anything.** Returning one
56
+ * without saving it looks harmless and is not: a login that fails, or simply a second call,
57
+ * would then present MAX with a different device every time — which is the "new device on every
58
+ * command" that §34 exists to prevent. Found by a test, not by a user.
59
+ */
60
+ readState(): SessionState;
61
+ /** The same name holds a bot (`bots/<profile>.json`, written by `max <p> bot auth set`). Files only. */
62
+ isBot(): boolean;
63
+ /** Whether this profile has logged in on this machine. Reads only: unlike `readState`, never creates the file. */
64
+ hasLoggedIn(): boolean;
65
+ writeState(state: SessionState): void;
66
+ /** Forgets everything about this profile. Returns whether there was a token to forget. */
67
+ forget(): boolean;
68
+ /**
69
+ * Where `max serve` listens for this profile. Beside the state file, so a sandbox moves both. On
70
+ * Windows a socket cannot be a file, so it is a named pipe named after the state directory.
71
+ */
72
+ socketPath(): string;
73
+ /** A file of the server's beside the state file: `<profile>.sock.refused`, `<profile>.serve.log`. */
74
+ serverFile(suffix: string): string;
75
+ }
76
+ //# sourceMappingURL=store.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"store.d.ts","sourceRoot":"","sources":["../../src/session/store.ts"],"names":[],"mappings":"AAGA,OAAO,EACL,KAAK,gBAAgB,EAErB,KAAK,YAAY,EAIlB,MAAM,mBAAmB,CAAA;AAE1B;;;;;;;GAOG;AACH,MAAM,WAAW,YAAY;IAC3B,QAAQ,EAAE,MAAM,CAAA;IAChB,6FAA6F;IAC7F,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,oGAAoG;IACpG,MAAM,EAAE,MAAM,CAAA;IACd,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,uFAAuF;IACvF,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,wFAAwF;IACxF,YAAY,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;IACrC,qGAAqG;IACrG,aAAa,CAAC,EAAE,MAAM,CAAA;IACtB,2CAA2C;IAC3C,gBAAgB,CAAC,EAAE,MAAM,CAAA;CAC1B;AAED;;;GAGG;AACH,eAAO,MAAM,eAAe,UAAqE,CAAA;AAEjG,qEAAqE;AACrE,eAAO,MAAM,gBAAgB,UAAW,YAAY,mBAAqB,MAAM,GAAG,SACqC,CAAA;AAEvH,eAAO,MAAM,gBAAgB,UAAW,YAAY,mBAAqB,YAIxE,CAAA;AAED,eAAO,MAAM,iBAAiB,kDAAmD,YAAY,KAAG,YAAqB,CAAA;AAErH,MAAM,WAAW,mBAAmB;IAClC,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,GAAG,CAAC,EAAE,MAAM,CAAC,UAAU,CAAA;IACvB,OAAO,CAAC,EAAE,YAAY,CAAA;IACtB,8EAA8E;IAC9E,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,QAAQ,CAAC,EAAE,MAAM,CAAA;CAClB;AAID,qBAAa,YAAY;;IACvB,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAA;IAIxB,YAAY,EAAE,OAAmB,EAAE,GAAiB,EAAE,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,GAAE,mBAAwB,EAa7G;IAED,8DAA8D;IAC9D,SAAS,IAAI,MAAM,GAAG,SAAS,CAE9B;IAED,gGAAgG;IAChG,WAAW,IAAI,gBAAgB,GAAG,SAAS,CAE1C;IAED,UAAU,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,CAE9B;IAED;;;;;;;OAOG;IACH,SAAS,IAAI,YAAY,CAaxB;IAED,wGAAwG;IACxG,KAAK,IAAI,OAAO,CAEf;IAED,kHAAkH;IAClH,WAAW,IAAI,OAAO,CAOrB;IAED,UAAU,CAAC,KAAK,EAAE,YAAY,GAAG,IAAI,CAEpC;IAED,0FAA0F;IAC1F,MAAM,IAAI,OAAO,CAShB;IAED;;;OAGG;IACH,UAAU,IAAI,MAAM,CAMnB;IAED,qGAAqG;IACrG,UAAU,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAEjC;CAKF"}
@@ -0,0 +1,134 @@
1
+ import { createHash, randomUUID } from "node:crypto";
2
+ import { existsSync, readFileSync } from "node:fs";
3
+ import { join } from "node:path";
4
+ import { Credentials, pathsAreOverridden, resolvePaths, writeSecurely, } from "@wirecat/cli-core";
5
+ /**
6
+ * **How long a profile stays out after each refusal in a row** (owner, `NEED-265`). In PyMax a
7
+ * login retried after the limit error kept the account locked (PyMax #106), so the wait grows.
8
+ */
9
+ export const LOGIN_PAUSES_MS = [1, 5, 30, 60, 6 * 60, 24 * 60].map((minutes) => minutes * 60_000);
10
+ /** When the pause ends, or `undefined` if a login may go out now. */
11
+ export const loginPausedUntil = (state, now = Date.now()) => state.loginPausedUntil !== undefined && Date.parse(state.loginPausedUntil) > now ? state.loginPausedUntil : undefined;
12
+ export const withLoginRefused = (state, now = Date.now()) => {
13
+ const refusals = (state.loginRefusals ?? 0) + 1;
14
+ const wait = LOGIN_PAUSES_MS[Math.min(refusals, LOGIN_PAUSES_MS.length) - 1] ?? 0;
15
+ return { ...state, loginRefusals: refusals, loginPausedUntil: new Date(now + wait).toISOString() };
16
+ };
17
+ export const withoutLoginPause = ({ loginRefusals, loginPausedUntil, ...state }) => state;
18
+ const APP = "max-cli";
19
+ export class SessionStore {
20
+ profile;
21
+ #stateDir;
22
+ #credentials;
23
+ constructor({ profile = "default", env = process.env, keyring, configDir, stateDir } = {}) {
24
+ const paths = resolvePaths({ appName: APP, prefix: "MAX", env });
25
+ this.profile = profile;
26
+ this.#stateDir = stateDir ?? paths.state;
27
+ this.#credentials = new Credentials({
28
+ configDir: configDir ?? paths.config,
29
+ service: APP,
30
+ envVar: "MAX_TOKEN",
31
+ isolated: pathsAreOverridden({ appName: APP, prefix: "MAX", env }),
32
+ ...(keyring ? { keyring } : {}),
33
+ env,
34
+ warn: (message) => process.stderr.write(`${message}\n`),
35
+ });
36
+ }
37
+ /** `undefined` means nobody has logged in on this profile. */
38
+ readToken() {
39
+ return this.#credentials.read(this.profile)?.secret;
40
+ }
41
+ /** Where `readToken` found it: `MAX_TOKEN`, the keyring, or the file that stands in for one. */
42
+ tokenSource() {
43
+ return this.#credentials.read(this.profile)?.source;
44
+ }
45
+ writeToken(token) {
46
+ this.#credentials.write(this.profile, token);
47
+ }
48
+ /**
49
+ * Reads the state, inventing a device identity the first time and keeping it thereafter.
50
+ *
51
+ * **A new identity is written out immediately, before it is used for anything.** Returning one
52
+ * without saving it looks harmless and is not: a login that fails, or simply a second call,
53
+ * would then present MAX with a different device every time — which is the "new device on every
54
+ * command" that §34 exists to prevent. Found by a test, not by a user.
55
+ */
56
+ readState() {
57
+ try {
58
+ const parsed = JSON.parse(readFileSync(this.#statePath(), "utf8"));
59
+ if (typeof parsed.deviceId === "string" && parsed.deviceId !== "") {
60
+ return { deviceId: parsed.deviceId, logins: parsed.logins ?? 0, ...pick(parsed) };
61
+ }
62
+ }
63
+ catch {
64
+ // No state yet, or a file we cannot read: either way the answer is a fresh identity.
65
+ }
66
+ const fresh = { deviceId: randomUUID(), logins: 0 };
67
+ this.writeState(fresh);
68
+ return fresh;
69
+ }
70
+ /** The same name holds a bot (`bots/<profile>.json`, written by `max <p> bot auth set`). Files only. */
71
+ isBot() {
72
+ return existsSync(join(this.#stateDir, "bots", `${this.profile}.json`));
73
+ }
74
+ /** Whether this profile has logged in on this machine. Reads only: unlike `readState`, never creates the file. */
75
+ hasLoggedIn() {
76
+ try {
77
+ const parsed = JSON.parse(readFileSync(this.#statePath(), "utf8"));
78
+ return (parsed.logins ?? 0) > 0 || typeof parsed.viewerId === "string";
79
+ }
80
+ catch {
81
+ return false;
82
+ }
83
+ }
84
+ writeState(state) {
85
+ writeSecurely(this.#statePath(), `${JSON.stringify(state, null, 2)}\n`, 0o600);
86
+ }
87
+ /** Forgets everything about this profile. Returns whether there was a token to forget. */
88
+ forget() {
89
+ const had = this.readToken() !== undefined;
90
+ this.#credentials.remove(this.profile);
91
+ try {
92
+ writeSecurely(this.#statePath(), `${JSON.stringify({ deviceId: randomUUID(), logins: 0 }, null, 2)}\n`, 0o600);
93
+ }
94
+ catch {
95
+ // Nothing to reset.
96
+ }
97
+ return had;
98
+ }
99
+ /**
100
+ * Where `max serve` listens for this profile. Beside the state file, so a sandbox moves both. On
101
+ * Windows a socket cannot be a file, so it is a named pipe named after the state directory.
102
+ */
103
+ socketPath() {
104
+ if (process.platform === "win32") {
105
+ const directory = createHash("sha256").update(this.#stateDir).digest("hex").slice(0, 16);
106
+ return `\\\\.\\pipe\\max-cli-${directory}-${this.profile}`;
107
+ }
108
+ return this.serverFile(".sock");
109
+ }
110
+ /** A file of the server's beside the state file: `<profile>.sock.refused`, `<profile>.serve.log`. */
111
+ serverFile(suffix) {
112
+ return join(this.#stateDir, "profiles", `${this.profile}${suffix}`);
113
+ }
114
+ #statePath() {
115
+ return join(this.#stateDir, "profiles", `${this.profile}.json`);
116
+ }
117
+ }
118
+ const pick = (state) => {
119
+ const extra = {};
120
+ if (typeof state.viewerId === "string")
121
+ extra.viewerId = state.viewerId;
122
+ if (typeof state.lastLoginAt === "string")
123
+ extra.lastLoginAt = state.lastLoginAt;
124
+ if (typeof state.lastCheckAt === "string")
125
+ extra.lastCheckAt = state.lastCheckAt;
126
+ if (state.checkedUntil && typeof state.checkedUntil === "object")
127
+ extra.checkedUntil = state.checkedUntil;
128
+ if (typeof state.loginRefusals === "number")
129
+ extra.loginRefusals = state.loginRefusals;
130
+ if (typeof state.loginPausedUntil === "string")
131
+ extra.loginPausedUntil = state.loginPausedUntil;
132
+ return extra;
133
+ };
134
+ //# sourceMappingURL=store.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"store.js","sourceRoot":"","sources":["../../src/session/store.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,aAAa,CAAA;AACpD,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,SAAS,CAAA;AAClD,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAA;AAChC,OAAO,EAEL,WAAW,EAEX,kBAAkB,EAClB,YAAY,EACZ,aAAa,GACd,MAAM,mBAAmB,CAAA;AA2B1B;;;GAGG;AACH,MAAM,CAAC,MAAM,eAAe,GAAG,CAAC,CAAC,E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,GAAG,CAAC,KAA4B,EAAE,EAAE;IAC5C,MAAM,KAAK,GAA0B,EAAE,CAAA;IACvC,IAAI,OAAO,KAAK,CAAC,QAAQ,KAAK,QAAQ;QAAE,KAAK,CAAC,QAAQ,GAAG,KAAK,CAAC,QAAQ,CAAA;IACvE,IAAI,OAAO,KAAK,CAAC,WAAW,KAAK,QAAQ;QAAE,KAAK,CAAC,WAAW,GAAG,KAAK,CAAC,WAAW,CAAA;IAChF,IAAI,OAAO,KAAK,CAAC,WAAW,KAAK,QAAQ;QAAE,KAAK,CAAC,WAAW,GAAG,KAAK,CAAC,WAAW,CAAA;IAChF,IAAI,KAAK,CAAC,YAAY,IAAI,OAAO,KAAK,CAAC,YAAY,KAAK,QAAQ;QAAE,KAAK,CAAC,YAAY,GAAG,KAAK,CAAC,YAAY,CAAA;IACzG,IAAI,OAAO,KAAK,CAAC,aAAa,KAAK,QAAQ;QAAE,KAAK,CAAC,aAAa,GAAG,KAAK,CAAC,aAAa,CAAA;IACtF,IAAI,OAAO,KAAK,CAAC,gBAAgB,KAAK,QAAQ;QAAE,KAAK,CAAC,gBAAgB,GAAG,KAAK,CAAC,gBAAgB,CAAA;IAC/F,OAAO,KAAK,CAAA;AACd,CAAC,CAAA"}
@@ -0,0 +1,7 @@
1
+ import { type SkillApp } from "@wirecat/cli-core/skill";
2
+ /** Beside `dist/` in the package and in a checkout alike, so the skill is always this version's. */
3
+ export declare const SKILL: import("url").URL;
4
+ export declare const SKILL_APP: SkillApp;
5
+ /** `max://skill` for both MCP servers, and the line their instructions end with. */
6
+ export declare const SKILL_RESOURCE: import("@wirecat/cli-core/skill").SkillResource;
7
+ //# sourceMappingURL=skill.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"skill.d.ts","sourceRoot":"","sources":["../src/skill.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,QAAQ,EAAiB,MAAM,yBAAyB,CAAA;AAGtE,oGAAoG;AACpG,eAAO,MAAM,KAAK,mBAAyD,CAAA;AAE3E,eAAO,MAAM,SAAS,EAAE,QAAmE,CAAA;AAE3F,oFAAoF;AACpF,eAAO,MAAM,cAAc,iDAAkC,CAAA"}
package/dist/skill.js ADDED
@@ -0,0 +1,8 @@
1
+ import { skillResource } from "@wirecat/cli-core/skill";
2
+ import { VERSION } from "./version.js";
3
+ /** Beside `dist/` in the package and in a checkout alike, so the skill is always this version's. */
4
+ export const SKILL = new URL("../skills/max-cli/SKILL.md", import.meta.url);
5
+ export const SKILL_APP = { command: "max", appName: "max-cli", version: VERSION };
6
+ /** `max://skill` for both MCP servers, and the line their instructions end with. */
7
+ export const SKILL_RESOURCE = skillResource(SKILL_APP, SKILL);
8
+ //# sourceMappingURL=skill.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"skill.js","sourceRoot":"","sources":["../src/skill.ts"],"names":[],"mappings":"AAAA,OAAO,EAAiB,aAAa,EAAE,MAAM,yBAAyB,CAAA;AACtE,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAA;AAEtC,oGAAoG;AACpG,MAAM,CAAC,MAAM,KAAK,GAAG,IAAI,GAAG,CAAC,4BAA4B,EAAE,OAAO,IAAI,CAAC,GAAG,CAAC,CAAA;AAE3E,MAAM,CAAC,MAAM,SAAS,GAAa,EAAE,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,OAAO,EAAE,CAAA;AAE3F,oFAAoF;AACpF,MAAM,CAAC,MAAM,cAAc,GAAG,aAAa,CAAC,SAAS,EAAE,KAAK,CAAC,CAAA"}
@@ -0,0 +1,16 @@
1
+ import type { Payload } from "../protocol/frame.js";
2
+ import { type Operation } from "./define.js";
3
+ /**
4
+ * Compares MAX's answer with what we declared, and **reports without deciding**.
5
+ *
6
+ * Checking is not enforcing. An unofficial protocol changes without telling anyone, so a response
7
+ * never fails a command, never changes an exit code and never alters what the caller gets back
8
+ * (`NEED-35`). Unknown fields are not mismatches at all — response shapes are loose, and a field
9
+ * MAX adds passes straight through.
10
+ *
11
+ * What is left is the case worth hearing about: a field we said we rely on stopped being what it
12
+ * was. The failure this prevents is the quiet one — `max chats` printing a column of blanks
13
+ * because something was renamed, and nobody learning why for a week.
14
+ */
15
+ export declare const checkResponse: (operation: Operation, payload: Payload) => string | undefined;
16
+ //# sourceMappingURL=check.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"check.d.ts","sourceRoot":"","sources":["../../src/spec/check.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAA;AACnD,OAAO,EAAa,KAAK,SAAS,EAAE,MAAM,aAAa,CAAA;AAEvD;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,aAAa,cAAe,SAAS,WAAW,OAAO,KAAG,MAAM,GAAG,SAgB/E,CAAA"}
@@ -0,0 +1,44 @@
1
+ import * as v from "valibot";
2
+ import { fieldPath } from "./define.js";
3
+ /**
4
+ * Compares MAX's answer with what we declared, and **reports without deciding**.
5
+ *
6
+ * Checking is not enforcing. An unofficial protocol changes without telling anyone, so a response
7
+ * never fails a command, never changes an exit code and never alters what the caller gets back
8
+ * (`NEED-35`). Unknown fields are not mismatches at all — response shapes are loose, and a field
9
+ * MAX adds passes straight through.
10
+ *
11
+ * What is left is the case worth hearing about: a field we said we rely on stopped being what it
12
+ * was. The failure this prevents is the quiet one — `max chats` printing a column of blanks
13
+ * because something was renamed, and nobody learning why for a week.
14
+ */
15
+ export const checkResponse = (operation, payload) => {
16
+ try {
17
+ const result = v.safeParse(operation.response, payload);
18
+ if (result.success)
19
+ return undefined;
20
+ const shown = result.issues.slice(0, MOST);
21
+ const rest = result.issues.length - shown.length;
22
+ const detail = shown.map(describe).join("; ");
23
+ return `${operation.name}: MAX answered with something we did not expect — ${detail}${rest > 0 ? ` (and ${rest} more)` : ""}`;
24
+ }
25
+ catch {
26
+ // A diagnostic that breaks the command it was describing is worse than no diagnostic.
27
+ return undefined;
28
+ }
29
+ };
30
+ const MOST = 3;
31
+ /**
32
+ * ⚠ **Built by hand, never from `issue.message`.** Valibot's own text quotes the value it saw —
33
+ * `Invalid type: Expected number but received "…"` — and the value may be somebody's message. Only
34
+ * the field path, the expected type and the *kind* of what arrived leave this function.
35
+ */
36
+ const describe = (issue) => `${fieldPath(issue)} — expected ${issue.expected ?? "something else"}, got ${kindOf(issue.input)}`;
37
+ const kindOf = (value) => {
38
+ if (value === null)
39
+ return "null";
40
+ if (Array.isArray(value))
41
+ return "a list";
42
+ return typeof value;
43
+ };
44
+ //# sourceMappingURL=check.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"check.js","sourceRoot":"","sources":["../../src/spec/check.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,SAAS,CAAA;AAE5B,OAAO,EAAE,SAAS,EAAkB,MAAM,aAAa,CAAA;AAEvD;;;;;;;;;;;GAWG;AACH,MAAM,CAAC,MAAM,aAAa,GAAG,CAAC,SAAoB,EAAE,OAAgB,EAAsB,EAAE;IAC1F,IAAI,CAAC;QACH,MAAM,MAAM,GAAG,CAAC,CAAC,SAAS,CAAC,SAAS,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAA;QACvD,IAAI,MAAM,CAAC,OAAO;YAAE,OAAO,SAAS,CAAA;QAEpC,MAAM,KAAK,GAAG,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,EAAE,IAAI,CAAC,CAAA;QAC1C,MAAM,IAAI,GAAG,MAAM,CAAC,MAAM,CAAC,MAAM,GAAG,KAAK,CAAC,MAAM,CAAA;QAChD,MAAM,MAAM,GAAG,KAAK,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;QAE7C,OAAO,GAAG,SAAS,CAAC,IAAI,qDAAqD,MAAM,GACjF,IAAI,GAAG,CAAC,CAAC,CAAC,CAAC,SAAS,IAAI,QAAQ,CAAC,CAAC,CAAC,EACrC,EAAE,CAAA;IACJ,CAAC;IAAC,MAAM,CAAC;QACP,sFAAsF;QACtF,OAAO,SAAS,CAAA;IAClB,CAAC;AACH,CAAC,CAAA;AAED,MAAM,IAAI,GAAG,CAAC,CAAA;AAEd;;;;GAIG;AACH,MAAM,QAAQ,GAAG,CAAC,KAAoE,EAAU,EAAE,CAChG,GAAG,SAAS,CAAC,KAAK,CAAC,eAAe,KAAK,CAAC,QAAQ,IAAI,gBAAgB,SAAS,MAAM,CAAC,KAAK,CAAC,KAAK,CAAC,EAAE,CAAA;AAEpG,MAAM,MAAM,GAAG,CAAC,KAAc,EAAU,EAAE;IACxC,IAAI,KAAK,KAAK,IAAI;QAAE,OAAO,MAAM,CAAA;IACjC,IAAI,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC;QAAE,OAAO,QAAQ,CAAA;IACzC,OAAO,OAAO,KAAK,CAAA;AACrB,CAAC,CAAA"}
@@ -0,0 +1,108 @@
1
+ import type { SendEntry } from "@wirecat/cli-messaging/sends";
2
+ import * as v from "valibot";
3
+ import type { Payload } from "../protocol/frame.js";
4
+ /**
5
+ * How much we actually know about a shape.
6
+ *
7
+ * `REQUIREMENTS.md` §10 asks for four levels. There are five, because most of what this CLI sends
8
+ * is stronger than all four of them: we watched MAX answer it. A claim in a README, a line in
9
+ * somebody's source and a frame we captured are three different things, and flattening the third
10
+ * into "confirmed" loses the one distinction the field exists for.
11
+ *
12
+ * The case this has to express: opcode 36 is `CONTACT_LIST` in two clients and `GET_BLOCKED` in
13
+ * the documentation. "Two sources agree" and "one client does this" must not be the same value.
14
+ */
15
+ export type Confidence =
16
+ /** We sent it and read the answer. The source says when. */
17
+ "measured"
18
+ /** Two or more independent implementations agree, and we have not run it. */
19
+ | "confirmed"
20
+ /** One implementation does this. */
21
+ | "observed"
22
+ /** Nobody states it; it follows from something next to it. */
23
+ | "inferred"
24
+ /** Named here so that a gap is recorded rather than implied. */
25
+ | "unknown";
26
+ export interface Provenance {
27
+ confidence: Confidence;
28
+ /** Where it came from: a file in another project, a document, or a dated measurement. */
29
+ sources: [string, ...string[]];
30
+ /** Anything a reader needs that the sources do not say. */
31
+ notes?: string;
32
+ }
33
+ export interface Operation<TRequest extends v.GenericSchema = v.GenericSchema, TResponse extends v.GenericSchema = v.GenericSchema> {
34
+ readonly kind: "operation";
35
+ /** Dotted and grouped by subject: `chats.list`, `messages.send`. The generator splits on the dot. */
36
+ readonly name: string;
37
+ /**
38
+ * MAX's own name for the number, as captured traffic and other clients spell it — `MSG_SEND`,
39
+ * not `MESSAGES_SEND`. Written out rather than derived from `name`, because the two vocabularies
40
+ * are not the same one: ours groups by subject, MAX's has to match what a frame is called
41
+ * everywhere else (`CONVENTIONS.md`, wire names below the adapter).
42
+ */
43
+ readonly constant: string;
44
+ readonly opcode: number;
45
+ /** Whether it may only be sent after LOGIN. */
46
+ readonly auth: boolean;
47
+ /** Strict: a request must not carry a field nobody has seen. */
48
+ readonly request: TRequest;
49
+ /** Loose: a response that gained a field must not break a command (§29). */
50
+ readonly response: TResponse;
51
+ /**
52
+ * What the send guard is asked before this goes to MAX, read from the request as it goes on the
53
+ * wire — or `null` for an operation nobody else sees. Required, so a new operation cannot reach
54
+ * `max serve`'s socket unguarded because somebody forgot to say it writes.
55
+ */
56
+ readonly guard: ((request: Payload) => Guarded) | null;
57
+ readonly provenance: Provenance;
58
+ }
59
+ /** One guarded write as the journal will record it; the outcome comes after. */
60
+ export type Guarded = Omit<SendEntry, "at" | "profile" | "outcome" | "errorCode" | "kind"> & Required<Pick<SendEntry, "kind">> & {
61
+ /** Who a new group or an added member is: the recipient list is asked about each. Not journaled. */
62
+ key?: string;
63
+ personIds?: string[];
64
+ };
65
+ /**
66
+ * A number we know and will not send.
67
+ *
68
+ * Not a `callable: false` flag on an operation, because a reserved opcode has no request shape and
69
+ * half an empty operation invites somebody to fill it in. The generator gives these a registry
70
+ * entry and no method, which is what turns "never call an opcode because it is in the enum" from a
71
+ * rule somebody has to remember into a property of the generated code.
72
+ */
73
+ export interface Reservation {
74
+ readonly kind: "reservation";
75
+ readonly name: string;
76
+ readonly constant: string;
77
+ readonly opcode: number;
78
+ /** Why it is known and still never sent. This is the whole value of the entry. */
79
+ readonly reason: string;
80
+ readonly provenance: Provenance;
81
+ }
82
+ export type Entry = Operation | Reservation;
83
+ export declare const defineOperation: <TRequest extends v.GenericSchema, TResponse extends v.GenericSchema>(operation: Omit<Operation<TRequest, TResponse>, "kind">) => Operation<TRequest, TResponse>;
84
+ export declare const reserveOpcode: (reservation: Omit<Reservation, "kind">) => Reservation;
85
+ /** What a caller passes: a domain string for an id, not a `bigint`. */
86
+ export type RequestOf<TOperation extends Operation> = v.InferInput<TOperation["request"]>;
87
+ /** What goes on the wire once the schema has encoded it. */
88
+ export type WireRequestOf<TOperation extends Operation> = v.InferOutput<TOperation["request"]>;
89
+ export type ResponseOf<TOperation extends Operation> = v.InferOutput<TOperation["response"]>;
90
+ /**
91
+ * Checks and encodes in one step, so a conversion cannot be forgotten in a second place.
92
+ *
93
+ * A refusal here is ours, before anything reaches the socket. **The message names the field and
94
+ * never the value** — a request carries message text, and a validation error is not a place for
95
+ * it to appear.
96
+ */
97
+ export declare const buildRequest: <TOperation extends Operation>(operation: TOperation, input: RequestOf<TOperation>) => Payload;
98
+ /**
99
+ * The dotted path of the field an issue is about, and nothing else.
100
+ *
101
+ * ⚠ **Never `issue.message` and never `issue.received`.** Valibot's own text quotes the value it
102
+ * saw — `Invalid type: Expected number but received "…"` — so printing it puts a message body on
103
+ * the screen and into any log that collects the stream (`REQUIREMENTS.md` §14, §24).
104
+ */
105
+ export declare const fieldPath: (issue: {
106
+ path?: unknown;
107
+ }) => string;
108
+ //# sourceMappingURL=define.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"define.d.ts","sourceRoot":"","sources":["../../src/spec/define.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,8BAA8B,CAAA;AAC7D,OAAO,KAAK,CAAC,MAAM,SAAS,CAAA;AAC5B,OAAO,KAAK,EAAE,O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,CAAA;AAE5F;;;;;;GAMG;AACH,eAAO,MAAM,YAAY,GAAI,UAAU,SAAS,SAAS,aAC5C,UAAU,SACd,SAAS,CAAC,UAAU,CAAC,KAC3B,OAQF,CAAA;AAaD;;;;;;GAMG;AACH,eAAO,MAAM,SAAS,UAAW;IAAE,IAAI,CAAC,EAAE,OAAO,CAAA;CAAE,KAAG,MAIrD,CAAA"}
@@ -0,0 +1,47 @@
1
+ import { CliError } from "@wirecat/cli-core";
2
+ import * as v from "valibot";
3
+ export const defineOperation = (operation) => ({ kind: "operation", ...operation });
4
+ export const reserveOpcode = (reservation) => ({
5
+ kind: "reservation",
6
+ ...reservation,
7
+ });
8
+ /**
9
+ * Checks and encodes in one step, so a conversion cannot be forgotten in a second place.
10
+ *
11
+ * A refusal here is ours, before anything reaches the socket. **The message names the field and
12
+ * never the value** — a request carries message text, and a validation error is not a place for
13
+ * it to appear.
14
+ */
15
+ export const buildRequest = (operation, input) => {
16
+ const result = v.safeParse(operation.request, input);
17
+ if (result.success)
18
+ return result.output;
19
+ const fields = closestIssues(operation.request, input, result.issues)
20
+ .map((issue) => fieldPath(issue))
21
+ .join(", ");
22
+ throw new CliError("validation_error", `${operation.name}: cannot send this request — ${fields}`);
23
+ };
24
+ /**
25
+ * A request with several shapes (`messages.send` is a message or a new group) fails in all of
26
+ * them, and Valibot reports every shape's complaints at once. The shape nearest to what was
27
+ * built is the one its author meant, so only its fields are named.
28
+ */
29
+ const closestIssues = (schema, input, issues) => {
30
+ if (!("options" in schema) || !Array.isArray(schema.options))
31
+ return issues;
32
+ const attempts = schema.options.map((option) => v.safeParse(option, input).issues ?? []);
33
+ return attempts.reduce((best, attempt) => (attempt.length < best.length ? attempt : best));
34
+ };
35
+ /**
36
+ * The dotted path of the field an issue is about, and nothing else.
37
+ *
38
+ * ⚠ **Never `issue.message` and never `issue.received`.** Valibot's own text quotes the value it
39
+ * saw — `Invalid type: Expected number but received "…"` — so printing it puts a message body on
40
+ * the screen and into any log that collects the stream (`REQUIREMENTS.md` §14, §24).
41
+ */
42
+ export const fieldPath = (issue) => {
43
+ const path = Array.isArray(issue.path) ? issue.path : [];
44
+ const segments = path.map((step) => String(step?.key ?? "?"));
45
+ return segments.length > 0 ? segments.join(".") : "(the payload itself)";
46
+ };
47
+ //# sourceMappingURL=define.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"define.js","sourceRoot":"","sources":["../../src/spec/define.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAA;AAE5C,OAAO,KAAK,CAAC,MAAM,SAAS,CAAA;AA4F5B,MAAM,CAAC,MAAM,eAAe,GAAG,CAC7B,SAAuD,EACvB,EAAE,CAAC,CAAC,EAAE,IAAI,EAAE,WAAW,EAAE,GAAG,SAAS,EAAE,CAAC,CAAA;AAE1E,MAAM,CAAC,MAAM,aAAa,GAAG,CAAC,WAAsC,EAAe,EAAE,CAAC,CAAC;IACrF,IAAI,EAAE,aAAa;IACnB,GAAG,WAAW;CACf,CAAC,CAAA;AAUF;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,YAAY,GAAG,CAC1B,SAAqB,EACrB,KAA4B,EACnB,EAAE;IACX,MAAM,MAAM,GAAG,CAAC,CAAC,SAAS,CAAC,SAAS,CAAC,OAAO,EAAE,KAAK,CAAC,CAAA;IACpD,IAAI,MAAM,CAAC,OAAO;QAAE,OAAO,MAAM,CAAC,MAAiB,CAAA;IAEnD,MAAM,MAAM,GAAG,aAAa,CAAC,SAAS,CAAC,OAAO,EAAE,KAAK,EAAE,MAAM,CAAC,MAAM,CAAC;SAClE,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC;SAChC,IAAI,CAAC,IAAI,CAAC,CAAA;IACb,MAAM,IAAI,QAAQ,CAAC,kBAAkB,EAAE,GAAG,SAAS,CAAC,IAAI,gCAAgC,MAAM,EAAE,CAAC,CAAA;AACnG,CAAC,CAAA;AAED;;;;GAIG;AACH,MAAM,aAAa,GAAG,CAAC,MAAuB,EAAE,KAAc,EAAE,MAAuC,EAAE,EAAE;IACzG,IAAI,CAAC,CAAC,SAAS,IAAI,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,OAAO,CAAC;QAAE,OAAO,MAAM,CAAA;IAC3E,MAAM,QAAQ,GAAI,MAAM,CAAC,OAA6B,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC,CAAC,SAAS,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC,MAAM,IAAI,EAAE,CAAC,CAAA;IAC/G,OAAO,QAAQ,CAAC,MAAM,CAAC,CAAC,IAAI,EAAE,OAAO,EAAE,EAAE,CAAC,CAAC,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAA;AAC5F,CAAC,CAAA;AAED;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,SAAS,GAAG,CAAC,KAAyB,EAAU,EAAE;IAC7D,MAAM,IAAI,GAAG,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAA;IACxD,MAAM,QAAQ,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,IAAuB,EAAE,EAAE,CAAC,MAAM,CAAC,IAAI,EAAE,GAAG,IAAI,GAAG,CAAC,CAAC,CAAA;IAChF,OAAO,QAAQ,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,sBAAsB,CAAA;AAC1E,CAAC,CAAA"}
@@ -0,0 +1,16 @@
1
+ import { type Payload } from "../protocol/frame.js";
2
+ /**
3
+ * The chat a guarded request goes to. **Missing is a refusal, never `null`**: a `null` chat skips
4
+ * the recipient list, so only the shapes that create or join a chat may have one.
5
+ */
6
+ export declare const chatOf: (request: Payload, field?: string) => string;
7
+ export declare const messageOf: (request: Payload, field?: string) => {
8
+ messageId?: string;
9
+ };
10
+ export declare const objectOf: (value: unknown) => Payload;
11
+ export declare const countOf: (value: unknown) => number;
12
+ /** The people a request puts into a chat; one that cannot be read as an id is refused. */
13
+ export declare const peopleOf: (value: unknown) => string[];
14
+ /** A request that could be read as two different changes is refused rather than guarded as one of them. */
15
+ export declare const ambiguous: (operation: string) => never;
16
+ //# sourceMappingURL=guards.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"guards.d.ts","sourceRoot":"","sources":["../../src/spec/guards.ts"],"names":[],"mappings":"AACA,OAAO,EAAQ,KAAK,OAAO,EAAE,MAAM,sBAAsB,CAAA;AAEzD;;;GAGG;AACH,eAAO,MAAM,MAAM,YAAa,OAAO,qBAAqB,MAI3D,CAAA;AAED,eAAO,MAAM,SAAS,YAAa,OAAO,qBAAwB;IAAE,SAAS,CAAC,EAAE,MAAM,CAAA;CAGrF,CAAA;AAED,eAAO,MAAM,QAAQ,UAAW,OAAO,KAAG,OACsD,CAAA;AAEhG,eAAO,MAAM,OAAO,UAAW,OAAO,KAAG,MAAmD,CAAA;AAE5F,0FAA0F;AAC1F,eAAO,MAAM,QAAQ,UAAW,OAAO,KAAG,MAAM,EAM5C,CAAA;AAEJ,2GAA2G;AAC3G,eAAO,MAAM,SAAS,cAAe,MAAM,KAAG,KAE7C,CAAA"}
@@ -0,0 +1,30 @@
1
+ import { CliError } from "@wirecat/cli-core";
2
+ import { asId } from "../protocol/frame.js";
3
+ /**
4
+ * The chat a guarded request goes to. **Missing is a refusal, never `null`**: a `null` chat skips
5
+ * the recipient list, so only the shapes that create or join a chat may have one.
6
+ */
7
+ export const chatOf = (request, field = "chatId") => {
8
+ const chatId = asId(request[field]);
9
+ if (chatId === undefined)
10
+ throw new CliError("validation_error", `a guarded request without its ${field}`);
11
+ return chatId;
12
+ };
13
+ export const messageOf = (request, field = "messageId") => {
14
+ const messageId = asId(request[field]);
15
+ return messageId === undefined ? {} : { messageId };
16
+ };
17
+ export const objectOf = (value) => typeof value === "object" && value !== null && !Array.isArray(value) ? value : {};
18
+ export const countOf = (value) => (Array.isArray(value) ? value.length : 0);
19
+ /** The people a request puts into a chat; one that cannot be read as an id is refused. */
20
+ export const peopleOf = (value) => (Array.isArray(value) ? value : []).map((one) => {
21
+ const person = asId(one);
22
+ if (person === undefined)
23
+ throw new CliError("validation_error", "a guarded request with a person that is not an id");
24
+ return person;
25
+ });
26
+ /** A request that could be read as two different changes is refused rather than guarded as one of them. */
27
+ export const ambiguous = (operation) => {
28
+ throw new CliError("validation_error", `${operation}: one change per request`);
29
+ };
30
+ //# sourceMappingURL=guards.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"guards.js","sourceRoot":"","sources":["../../src/spec/guards.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAA;AAC5C,OAAO,EAAE,IAAI,EAAgB,MAAM,sBAAsB,CAAA;AAEzD;;;GAGG;AACH,MAAM,CAAC,MAAM,MAAM,GAAG,CAAC,OAAgB,EAAE,KAAK,GAAG,QAAQ,EAAU,EAAE;IACnE,MAAM,MAAM,GAAG,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,CAAA;IACnC,IAAI,MAAM,KAAK,SAAS;QAAE,MAAM,IAAI,QAAQ,CAAC,kBAAkB,EAAE,iCAAiC,KAAK,EAAE,CAAC,CAAA;IAC1G,OAAO,MAAM,CAAA;AACf,CAAC,CAAA;AAED,MAAM,CAAC,MAAM,SAAS,GAAG,CAAC,OAAgB,EAAE,KAAK,GAAG,WAAW,EAA0B,EAAE;IACzF,MAAM,SAAS,GAAG,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,CAAA;IACtC,OAAO,SAAS,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,SAAS,EAAE,CAAA;AACrD,CAAC,CAAA;AAED,MAAM,CAAC,MAAM,QAAQ,GAAG,CAAC,KAAc,EAAW,EAAE,CAClD,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,KAAK,IAAI,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,CAAE,KAAiB,CAAC,CAAC,CAAC,EAAE,CAAA;AAEhG,MAAM,CAAC,MAAM,OAAO,GAAG,CAAC,KAAc,EAAU,EAAE,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,CAAA;AAE5F,0FAA0F;AAC1F,MAAM,CAAC,MAAM,QAAQ,GAAG,CAAC,KAAc,EAAY,EAAE,CACnD,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE;IAC9C,MAAM,MAAM,GAAG,IAAI,CAAC,GAAG,CAAC,CAAA;IACxB,IAAI,MAAM,KAAK,SAAS;QACtB,MAAM,IAAI,QAAQ,CAAC,kBAAkB,EAAE,mDAAmD,CAAC,CAAA;IAC7F,OAAO,MAAM,CAAA;AACf,CAAC,CAAC,CAAA;AAEJ,2GAA2G;AAC3G,MAAM,CAAC,MAAM,SAAS,GAAG,CAAC,SAAiB,EAAS,EAAE;IACpD,MAAM,IAAI,QAAQ,CAAC,kBAAkB,EAAE,GAAG,SAAS,0BAA0B,CAAC,CAAA;AAChF,CAAC,CAAA"}
@@ -0,0 +1,57 @@
1
+ /**
2
+ * What we claim to be on the wire.
3
+ *
4
+ * **We imitate MAX's own web client rather than announcing ourselves** (`REQUIREMENTS.md` §34), so
5
+ * none of these values names this tool. Fields, their order and the versions are what web.max.ru
6
+ * sent on 2026-09-25 (`src/testing/fixtures/web-capture-2026-09-25.json`, the INIT frame).
7
+ *
8
+ * **Built from this machine, as the web client builds it from the browser** (`MAX-55`): timezone
9
+ * from `Intl`, the language from the system, the OS and the matching Chrome user agent from the
10
+ * platform. A fixed value would give every install of a public package the same Madrid-and-Linux
11
+ * browser. How web.max.ru fills each field: `docs/dev/capture/2026-09-25-web-tab.md`.
12
+ *
13
+ * The device identity is deliberately not here: it is generated once per profile and stored,
14
+ * because a client presenting a new device on every command is not imitating anything.
15
+ */
16
+ /**
17
+ * When `APP_VERSION` and `CHROME` were read from a live tab. MAX refuses a client version it has
18
+ * dropped (PyMax #86), so `max doctor` reports their age (`MAX-39`); a release updates all three.
19
+ */
20
+ export declare const CLIENT: {
21
+ readonly appVersion: "26.9.8";
22
+ readonly chrome: "Chrome/151.0.0.0";
23
+ readonly readOn: "2026-09-25";
24
+ };
25
+ export interface Host {
26
+ platform: string;
27
+ timeZone: string | undefined;
28
+ locale: string | undefined;
29
+ }
30
+ export declare const thisHost: () => Host;
31
+ export declare const webUserAgent: ({ platform, timeZone, locale }: Host) => {
32
+ readonly deviceType: "WEB";
33
+ readonly pushDeviceType: "WEBPUSH";
34
+ readonly locale: string;
35
+ readonly deviceLocale: string;
36
+ readonly osVersion: "Linux" | "Windows" | "macOS";
37
+ readonly deviceName: "Chrome";
38
+ readonly headerUserAgent: "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/151.0.0.0 Safari/537.36" | "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/151.0.0.0 Safari/537.36" | "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/151.0.0.0 Safari/537.36";
39
+ readonly isPwa: false;
40
+ readonly appVersion: "26.9.8";
41
+ readonly screen: "1080x1920 1.0x" | "900x1440 2.0x";
42
+ readonly timezone: string;
43
+ };
44
+ export declare const WEB_USER_AGENT: {
45
+ readonly deviceType: "WEB";
46
+ readonly pushDeviceType: "WEBPUSH";
47
+ readonly locale: string;
48
+ readonly deviceLocale: string;
49
+ readonly osVersion: "Linux" | "Windows" | "macOS";
50
+ readonly deviceName: "Chrome";
51
+ readonly headerUserAgent: "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/151.0.0.0 Safari/537.36" | "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/151.0.0.0 Safari/537.36" | "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/151.0.0.0 Safari/537.36";
52
+ readonly isPwa: false;
53
+ readonly appVersion: "26.9.8";
54
+ readonly screen: "1080x1920 1.0x" | "900x1440 2.0x";
55
+ readonly timezone: string;
56
+ };
57
+ //# sourceMappingURL=identity.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"identity.d.ts","sourceRoot":"","sources":["../../src/spec/identity.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAKH;;;GAGG;AACH,eAAO,MAAM,MAAM;aAAK,UAAU;aAAe,MAAM;aAAU,MAAM,EAAE,YAAY;CAAW,CAAA;AAYhG,MAAM,WAAW,IAAI;IACnB,QAAQ,EAAE,MAAM,CAAA;IAChB,QAAQ,EAAE,MAAM,GAAG,SAAS,CAAA;IAC5B,MAAM,EAAE,MAAM,GAAG,SAAS,CAAA;CAC3B;AAED,eAAO,MAAM,QAAQ,QAAO,IAG3B,CAAA;AAED,eAAO,MAAM,YAAY,mCAAoC,IAAI;aAI7D,UAAU,EAAE,KAAK;aACjB,cAAc,EAAE,SAAS;aACzB,MAAM;aACN,YAAY;aACZ,SAAS;aACT,UAAU,EAAE,QAAQ;aACpB,eAAe;aACf,KAAK;aACL,UAAU;aACV,MAAM;aACN,QAAQ;CAEX,CAAA;AAED,eAAO,MAAM,cAAc;yBAdX,KAAK;6BACD,SAAS;;;;yBAIb,QAAQ;;;;;;CAS8B,CAAA"}