@wirecat/mail-cli 0.1.1 → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (183) hide show
  1. package/CHANGELOG.md +44 -0
  2. package/README.md +4 -3
  3. package/dist/bin/mail.js +2 -2
  4. package/dist/bundle/{all-profiles-TKMBELRZ.js → all-profiles-7WILOT5E.js} +5 -5
  5. package/dist/bundle/{anthropic-7LMUAEIZ.js → anthropic-NHWLIMEZ.js} +3 -3
  6. package/dist/bundle/{app-server-JGMIJDD4.js → app-server-XDMYCJLV.js} +39 -39
  7. package/dist/bundle/{bun-XRO6XJHQ.js → bun-GTG5IYLQ.js} +2 -2
  8. package/dist/bundle/{bun-sqlite-Z54LEHVM.js → bun-sqlite-KGH5F33G.js} +2 -2
  9. package/dist/bundle/{chunk-JVMVLITS.js → chunk-2X4WYZPA.js} +4 -2
  10. package/dist/bundle/{chunk-GN62YOT5.js → chunk-4I3YT5KK.js} +4 -4
  11. package/dist/bundle/{chunk-MS53RALV.js → chunk-5FLW25US.js} +5 -5
  12. package/dist/bundle/{chunk-FZ5FXIG6.js → chunk-5JOKRFWE.js} +1 -1
  13. package/dist/bundle/{chunk-KHTO2Q6E.js → chunk-6HIW7IJL.js} +4 -4
  14. package/dist/bundle/{chunk-TVREDYX4.js → chunk-76IKLP2M.js} +95 -91
  15. package/dist/bundle/{chunk-ZANYM66S.js → chunk-77VHMI3A.js} +1 -1
  16. package/dist/bundle/{chunk-TQFCPUIM.js → chunk-7LKJDJNS.js} +1 -1
  17. package/dist/bundle/{chunk-WLFLBWNH.js → chunk-7QEE5I7H.js} +2 -2
  18. package/dist/bundle/{chunk-6MAZWSC3.js → chunk-7REG25RM.js} +3 -3
  19. package/dist/bundle/{chunk-TWTATDM7.js → chunk-AJIT2T3F.js} +6 -6
  20. package/dist/bundle/{chunk-JBBZCTTF.js → chunk-AROBJF5P.js} +1 -1
  21. package/dist/bundle/{chunk-NK7EB63L.js → chunk-BKZEYTLU.js} +849 -440
  22. package/dist/bundle/{chunk-4FEMINO2.js → chunk-BPF7IXJT.js} +5 -5
  23. package/dist/bundle/{chunk-BTQX2ZSZ.js → chunk-BUOSCMCD.js} +2 -2
  24. package/dist/bundle/{chunk-5NYMNSSO.js → chunk-CT7NG7BI.js} +3 -3
  25. package/dist/bundle/{chunk-TWPDVUBR.js → chunk-D7UZXUSB.js} +2 -2
  26. package/dist/bundle/{chunk-OTUOZ33L.js → chunk-DDMJ3RVO.js} +2 -2
  27. package/dist/bundle/{chunk-3KEVLSNN.js → chunk-EKE3R36Y.js} +46 -8
  28. package/dist/bundle/{chunk-YO4CUH5E.js → chunk-ETPT7TPW.js} +1 -1
  29. package/dist/bundle/{chunk-3KOA73LS.js → chunk-GPAAQ6LY.js} +14 -14
  30. package/dist/bundle/{chunk-GQQJOH7A.js → chunk-GQKYSGIA.js} +58 -46
  31. package/dist/bundle/{chunk-QLEUNU6G.js → chunk-H5BW7454.js} +4 -4
  32. package/dist/bundle/{chunk-KM7Q67Z3.js → chunk-H66ZMBDD.js} +1 -1
  33. package/dist/bundle/{chunk-VEIZZRQ5.js → chunk-H7NUGJPV.js} +12 -3
  34. package/dist/bundle/{chunk-2LLNPNMB.js → chunk-H7XOHNRY.js} +1 -1
  35. package/dist/bundle/{chunk-F6D6PJ34.js → chunk-HJRUFT5Y.js} +5 -5
  36. package/dist/bundle/{chunk-52F5DWS5.js → chunk-MABCR67K.js} +1 -1
  37. package/dist/bundle/{chunk-IK5TH3O7.js → chunk-MDVXIPA3.js} +10 -10
  38. package/dist/bundle/{chunk-YPQQ5J4X.js → chunk-QJHCKFFC.js} +16 -16
  39. package/dist/bundle/{chunk-Z34ICZA3.js → chunk-QLYHLW54.js} +5 -5
  40. package/dist/bundle/{chunk-7SXGLT6T.js → chunk-QUGFBY7O.js} +9 -8
  41. package/dist/bundle/{chunk-CEW6KIFA.js → chunk-QUSZWBZF.js} +21 -21
  42. package/dist/bundle/{chunk-FDCGTODC.js → chunk-R5JD4GMA.js} +1 -1
  43. package/dist/bundle/{chunk-K4FVKPDQ.js → chunk-S2GSU4MT.js} +9 -9
  44. package/dist/bundle/{chunk-T6464KYA.js → chunk-STC45HZX.js} +204 -203
  45. package/dist/bundle/{chunk-75CWWETH.js → chunk-SVNTRF5O.js} +11 -11
  46. package/dist/bundle/{chunk-GWDCKUBI.js → chunk-THVLMTH7.js} +30 -29
  47. package/dist/bundle/{chunk-4E7BN3TC.js → chunk-TMVIQJCG.js} +2 -2
  48. package/dist/bundle/{chunk-EOEDICIE.js → chunk-UZR3IKS7.js} +1 -1
  49. package/dist/bundle/{chunk-CH6RXYAX.js → chunk-VBLFQJY3.js} +1 -1
  50. package/dist/bundle/{chunk-GAH7N7HO.js → chunk-VRQRBVKT.js} +44 -44
  51. package/dist/bundle/{chunk-GK4M2SUP.js → chunk-VWO3XXSF.js} +1 -1
  52. package/dist/bundle/{chunk-QQB7WT7R.js → chunk-WJ3LUWRN.js} +3 -3
  53. package/dist/bundle/{chunk-3E3WA2L6.js → chunk-Y5WA7AOA.js} +21 -21
  54. package/dist/bundle/{chunk-TE5U5OAM.js → chunk-Y6KUKIQZ.js} +2 -2
  55. package/dist/bundle/{chunk-J6MSJLIW.js → chunk-YQAUH3PN.js} +1 -1
  56. package/dist/bundle/{chunk-MNOIRJEO.js → chunk-Z6F7EXT2.js} +7 -7
  57. package/dist/bundle/{chunk-WXAXYJJ7.js → chunk-ZKH5CHGI.js} +5 -5
  58. package/dist/bundle/{chunk-UH4DDRHA.js → chunk-ZNYJG4AY.js} +42 -42
  59. package/dist/bundle/{command-contract-WU434ZUL.js → command-contract-Y42ULKE5.js} +13 -13
  60. package/dist/bundle/{decode-YB3ZDTES.js → decode-L4X542L3.js} +2 -2
  61. package/dist/bundle/{dist-A6GKSKFC.js → dist-WKIRHOLK.js} +14 -14
  62. package/dist/bundle/{echarts-YNGCOYHW.js → echarts-G6QLXR4X.js} +2 -2
  63. package/dist/bundle/{embed-LWNHIRBQ.js → embed-E33ZBHQR.js} +3 -3
  64. package/dist/bundle/{embedder-2LYD3U37.js → embedder-EMBCIVGF.js} +6 -6
  65. package/dist/bundle/{first-run-N3HJKGU7.js → first-run-WF2HF5FI.js} +5 -5
  66. package/dist/bundle/{first-screen-4U2DMV3G.js → first-screen-DZFOUUZC.js} +14 -14
  67. package/dist/bundle/{instructions-GJHHFV64.js → instructions-DUH7265J.js} +1 -1
  68. package/dist/bundle/mail.js +2 -2
  69. package/dist/bundle/{node-GFOH6FKP.js → node-73PKCCE7.js} +2 -2
  70. package/dist/bundle/{node-sqlite-NBXQXBIU.js → node-sqlite-FDD5N6GC.js} +2 -2
  71. package/dist/bundle/{oauth-56EFO5AQ.js → oauth-ND3K2F7B.js} +4 -4
  72. package/dist/bundle/{open-2V7QZQJP.js → open-FZYY6TKE.js} +1 -1
  73. package/dist/bundle/{openai-V3SVACVL.js → openai-BXOF6XIM.js} +10 -10
  74. package/dist/bundle/{process-XVDX4SPD.js → process-TXIK4VJP.js} +1 -1
  75. package/dist/bundle/{program-JTJB26P3.js → program-2SUR4WOS.js} +1699 -1458
  76. package/dist/bundle/{prompt-YKWAI222.js → prompt-I5GCP73M.js} +2 -2
  77. package/dist/bundle/{recognize-PAR66KVM.js → recognize-ILYEKXVB.js} +1 -1
  78. package/dist/bundle/{remote-CE43TKXC.js → remote-SSPZEAJ7.js} +4 -4
  79. package/dist/bundle/{rerank-M7S7P2TW.js → rerank-NAO5RMGB.js} +4 -4
  80. package/dist/bundle/{serve-ENPMIV6J.js → serve-UDXIEQKC.js} +6 -6
  81. package/dist/bundle/{server-MBEZLVKZ.js → server-KTPELKAN.js} +31 -31
  82. package/dist/bundle/server-UZFSEKNJ.js +63 -0
  83. package/dist/bundle/{sqlite-runtime-HVGDHBJJ.js → sqlite-runtime-AONFLND6.js} +2 -2
  84. package/dist/bundle/{state-QZSOSKBD.js → state-I4PLX3UB.js} +3 -3
  85. package/dist/bundle/{store-UJ7SNKXI.js → store-OHQH3MGN.js} +30 -12
  86. package/dist/bundle/{store-2BUX6LVX.js → store-ZPPRXGPY.js} +9 -9
  87. package/dist/bundle/store-maintenance-command-QOYXEBT6.js +52 -0
  88. package/dist/commands/account.d.ts.map +1 -1
  89. package/dist/commands/account.js +6 -5
  90. package/dist/commands/account.js.map +1 -1
  91. package/dist/commands/context.d.ts +19 -8
  92. package/dist/commands/context.d.ts.map +1 -1
  93. package/dist/commands/context.js +14 -10
  94. package/dist/commands/context.js.map +1 -1
  95. package/dist/commands/folders.js +4 -4
  96. package/dist/commands/folders.js.map +1 -1
  97. package/dist/commands/login.d.ts +2 -2
  98. package/dist/commands/login.d.ts.map +1 -1
  99. package/dist/commands/login.js +3 -5
  100. package/dist/commands/login.js.map +1 -1
  101. package/dist/commands/mailbox.d.ts +2 -1
  102. package/dist/commands/mailbox.d.ts.map +1 -1
  103. package/dist/commands/mailbox.js.map +1 -1
  104. package/dist/commands/session-start.d.ts +3 -0
  105. package/dist/commands/session-start.d.ts.map +1 -0
  106. package/dist/commands/session-start.js +117 -0
  107. package/dist/commands/session-start.js.map +1 -0
  108. package/dist/commands/session.d.ts.map +1 -1
  109. package/dist/commands/session.js +9 -117
  110. package/dist/commands/session.js.map +1 -1
  111. package/dist/commands/status.d.ts.map +1 -1
  112. package/dist/commands/status.js +8 -20
  113. package/dist/commands/status.js.map +1 -1
  114. package/dist/commands/sync.d.ts.map +1 -1
  115. package/dist/commands/sync.js +49 -26
  116. package/dist/commands/sync.js.map +1 -1
  117. package/dist/config.d.ts +2 -0
  118. package/dist/config.d.ts.map +1 -1
  119. package/dist/config.js +4 -0
  120. package/dist/config.js.map +1 -1
  121. package/dist/discovery.d.ts +4 -15
  122. package/dist/discovery.d.ts.map +1 -1
  123. package/dist/discovery.js +19 -92
  124. package/dist/discovery.js.map +1 -1
  125. package/dist/mail/backend.d.ts +36 -0
  126. package/dist/mail/backend.d.ts.map +1 -0
  127. package/dist/mail/backend.js +2 -0
  128. package/dist/mail/backend.js.map +1 -0
  129. package/dist/mail/imap/account.d.ts +5 -0
  130. package/dist/mail/imap/account.d.ts.map +1 -0
  131. package/dist/mail/imap/account.js +41 -0
  132. package/dist/mail/imap/account.js.map +1 -0
  133. package/dist/mail/imap/connection.d.ts +62 -0
  134. package/dist/mail/imap/connection.d.ts.map +1 -0
  135. package/dist/mail/imap/connection.js +188 -0
  136. package/dist/mail/imap/connection.js.map +1 -0
  137. package/dist/mail/{imap-errors.d.ts → imap/errors.d.ts} +1 -1
  138. package/dist/mail/imap/errors.d.ts.map +1 -0
  139. package/dist/mail/{imap-errors.js → imap/errors.js} +1 -1
  140. package/dist/mail/imap/errors.js.map +1 -0
  141. package/dist/mail/imap/index.d.ts +7 -0
  142. package/dist/mail/imap/index.d.ts.map +1 -0
  143. package/dist/mail/imap/index.js +11 -0
  144. package/dist/mail/imap/index.js.map +1 -0
  145. package/dist/mail/{imap-messages.d.ts → imap/messages.d.ts} +9 -9
  146. package/dist/mail/imap/messages.d.ts.map +1 -0
  147. package/dist/mail/imap/messages.js +66 -0
  148. package/dist/mail/imap/messages.js.map +1 -0
  149. package/dist/mail/imap/read.d.ts +7 -0
  150. package/dist/mail/imap/read.d.ts.map +1 -0
  151. package/dist/mail/imap/read.js +164 -0
  152. package/dist/mail/imap/read.js.map +1 -0
  153. package/dist/mail/rethread.d.ts +15 -0
  154. package/dist/mail/rethread.d.ts.map +1 -0
  155. package/dist/mail/rethread.js +52 -0
  156. package/dist/mail/rethread.js.map +1 -0
  157. package/dist/profile.d.ts +2 -1
  158. package/dist/profile.d.ts.map +1 -1
  159. package/dist/profile.js +1 -0
  160. package/dist/profile.js.map +1 -1
  161. package/dist/providers.d.ts +126 -26
  162. package/dist/providers.d.ts.map +1 -1
  163. package/dist/providers.js +141 -72
  164. package/dist/providers.js.map +1 -1
  165. package/dist/secret.d.ts +2 -1
  166. package/dist/secret.d.ts.map +1 -1
  167. package/dist/secret.js +1 -0
  168. package/dist/secret.js.map +1 -1
  169. package/dist/version.d.ts +1 -1
  170. package/dist/version.js +1 -1
  171. package/package.json +3 -2
  172. package/skills/mail-cli/SKILL.md +8 -0
  173. package/dist/bundle/server-JRTHUCVY.js +0 -63
  174. package/dist/bundle/store-maintenance-command-I7V5C44K.js +0 -52
  175. package/dist/mail/imap-errors.d.ts.map +0 -1
  176. package/dist/mail/imap-errors.js.map +0 -1
  177. package/dist/mail/imap-messages.d.ts.map +0 -1
  178. package/dist/mail/imap-messages.js +0 -66
  179. package/dist/mail/imap-messages.js.map +0 -1
  180. package/dist/mail/imap.d.ts +0 -67
  181. package/dist/mail/imap.d.ts.map +0 -1
  182. package/dist/mail/imap.js +0 -348
  183. package/dist/mail/imap.js.map +0 -1
@@ -0,0 +1 @@
1
+ {"version":3,"file":"read.js","sourceRoot":"","sources":["../../../src/mail/imap/read.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAA;AAG5C,OAAO,EAAoB,aAAa,EAAmB,MAAM,iBAAiB,CAAA;AAClF,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAA;AAC1C,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAA;AAE1E,MAAM,MAAM,GAAG,CAAI,KAAU,EAAE,IAAY,EAAS,EAAE;IACpD,MAAM,GAAG,GAAU,EAAE,CAAA;IACrB,KAAK,IAAI,KAAK,GAAG,CAAC,EAAE,KAAK,GAAG,KAAK,CAAC,MAAM,EAAE,KAAK,IAAI,IAAI;QAAE,GAAG,CAAC,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,KAAK,EAAE,KAAK,GAAG,IAAI,CAAC,CAAC,CAAA;IACnG,OAAO,GAAG,CAAA;AACZ,CAAC,CAAA;AAED,+GAA+G;AAC/G,MAAM,WAAW,GAAG,CAAC,KAAc,EAAE,KAAa,EAAE,KAAa,EAAa,EAAE;IAC9E,MAAM,GAAG,GAAc,EAAE,CAAA;IACzB,IAAI,OAAO,GAA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AI,EACJ,KAAK;4BACH,CAAC,MAAM,YAAY,KAAK,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,SAAS,CAAC;4BAC9C,IAAI,QAAQ,CAAC,WAAW,EAAE,SAAS,IAAI,CAAC,GAAG,mBAAmB,EAAE,EAAE,MAAM,EAAE,mBAAmB,EAAE,CAAC,CACnG,CAAA;oBACH,CAAC;gBACH,CAAC;YACH,CAAC;YACD,OAAO,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,GAAG,CAAC,IAAI,CAAuB,CAAC,CAAA;QAClE,CAAC;KACF,CAAA;AACH,CAAC,CAAA"}
@@ -0,0 +1,15 @@
1
+ import type { AccountKey, MessageStore } from "@wirecat/cli-core/store";
2
+ import type { MailBackend } from "./backend.js";
3
+ export interface Rethreaded {
4
+ /** Stored emails moved to the thread their References name. */
5
+ moved: number;
6
+ /** False when the budget or the deadline stopped it; a later `--rescan` goes on. */
7
+ complete: boolean;
8
+ }
9
+ /**
10
+ * Mail stored before thread ids came from References kept a thread of its own, and the sync skips stored mail, so
11
+ * only a listing of its headers can move it. Only a server without thread ids is read: Gmail's and OBJECTID's ids
12
+ * are already the server's.
13
+ */
14
+ export declare const rethreadStored: (backend: MailBackend, store: MessageStore, key: AccountKey, folders: string[], since: Date, mayGoOn: () => boolean) => Promise<Rethreaded>;
15
+ //# sourceMappingURL=rethread.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"rethread.d.ts","sourceRoot":"","sources":["../../src/mail/rethread.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAA;AACvE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,cAAc,CAAA;AAE/C,MAAM,WAAW,UAAU;IACzB,+DAA+D;IAC/D,KAAK,EAAE,MAAM,CAAA;IACb,oFAAoF;IACpF,QAAQ,EAAE,OAAO,CAAA;CAClB;AAED;;;;GAIG;AACH,eAAO,MAAM,cAAc,YAChB,WAAW,SACb,YAAY,OACd,UAAU,WACN,MAAM,EAAE,SACV,IAAI,WACF,MAAM,OAAO,KACrB,OAAO,CAAC,UAAU,CAyCpB,CAAA"}
@@ -0,0 +1,52 @@
1
+ /**
2
+ * Mail stored before thread ids came from References kept a thread of its own, and the sync skips stored mail, so
3
+ * only a listing of its headers can move it. Only a server without thread ids is read: Gmail's and OBJECTID's ids
4
+ * are already the server's.
5
+ */
6
+ export const rethreadStored = async (backend, store, key, folders, since, mayGoOn) => {
7
+ const account = await store.accounts.storedAccount(key).catch(() => null);
8
+ if (account === null || backend.search === undefined)
9
+ return { moved: 0, complete: true };
10
+ let moved = 0;
11
+ for (const folder of folders) {
12
+ const searched = await backend.search(since, folder);
13
+ if (!searched.quick)
14
+ continue;
15
+ const slice = backend.listBatch ?? 200;
16
+ for (let start = 0; start < searched.uids.length; start += slice) {
17
+ if (!mayGoOn())
18
+ return { moved, complete: false };
19
+ const listed = await backend.list(since, folder, {
20
+ searched: { ...searched, uids: searched.uids.slice(start, start + slice) },
21
+ });
22
+ const wanted = new Map(listed.map(({ messageId, threadId }) => [messageId, threadId]));
23
+ const placed = await store.mail.inThreads(account.id, [...wanted.keys()]);
24
+ const astray = placed.filter(({ externalId, threadExternalId }) => wanted.get(externalId) !== threadExternalId);
25
+ const now = Date.now();
26
+ for (const { externalId } of astray) {
27
+ const email = await store.mail.email(account.id, externalId);
28
+ const threadId = wanted.get(externalId);
29
+ if (email === null || threadId === undefined)
30
+ continue;
31
+ // The required fields are written back as stored; the rest is left out, so it is kept.
32
+ await store.mail.saveThread({
33
+ accountId: account.id,
34
+ externalId: threadId,
35
+ now,
36
+ emails: [
37
+ {
38
+ externalId,
39
+ subject: email.subject,
40
+ from: email.fromAddress === null ? null : { address: email.fromAddress, name: email.fromName },
41
+ sentAt: email.sentAt,
42
+ bodyText: email.bodyText,
43
+ },
44
+ ],
45
+ });
46
+ moved++;
47
+ }
48
+ }
49
+ }
50
+ return { moved, complete: true };
51
+ };
52
+ //# sourceMappingURL=rethread.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"rethread.js","sourceRoot":"","sources":["../../src/mail/rethread.ts"],"names":[],"mappings":"AAUA;;;;GAIG;AACH,MAAM,CAAC,MAAM,cAAc,GAAG,KAAK,EACjC,OAAoB,EACpB,KAAmB,EACnB,GAAe,EACf,OAAiB,EACjB,KAAW,EACX,OAAsB,EACD,EAAE;IACvB,MAAM,OAAO,GAAG,MAAM,KAAK,CAAC,QAAQ,CAAC,aAAa,CAAC,GAAG,CAAC,CAAC,KAAK,CAAC,GAAG,EAAE,CAAC,IAAI,CAAC,CAAA;IACzE,IAAI,OAAO,KAAK,IAAI,IAAI,OAAO,CAAC,MAAM,KAAK,SAAS;QAAE,OAAO,EAAE,KAAK,EAAE,CAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAA;IACzF,IAAI,KAAK,GAAG,CAAC,CAAA;IACb,KAAK,MAAM,MAAM,IAAI,OAAO,EAAE,CAAC;QAC7B,MAAM,QAAQ,GAAG,MAAM,OAAO,CAAC,MAAM,CAAC,KAAK,EAAE,MAAM,CAAC,CAAA;QACpD,IAAI,CAAC,QAAQ,CAAC,KAAK;YAAE,SAAQ;QAC7B,MAAM,KAAK,GAAG,OAAO,CAAC,SAAS,IAAI,GAAG,CAAA;QACtC,KAAK,IAAI,KAAK,GAAG,CAAC,EAAE,KAAK,GAAG,QAAQ,CAAC,IAAI,CAAC,MAAM,EAAE,KAAK,IAAI,KAAK,EAAE,CAAC;YACjE,IAAI,CAAC,OAAO,EAAE;gBAAE,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,KAAK,EAAE,CAAA;YACjD,MAAM,MAAM,GAAG,MAAM,OAAO,CAAC,IAAI,CAAC,KAAK,EAAE,MAAM,EAAE;gBAC/C,QAAQ,EAAE,EAAE,GAAG,QAAQ,EAAE,IAAI,EAAE,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,KA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AAK,CAAC,WAAW,EAAE,IAAI,EAAE,KAAK,CAAC,QAAQ,EAAE;4BAC9F,MAAM,EAAE,KAAK,CAAC,MAAM;4BACpB,QAAQ,EAAE,KAAK,CAAC,QAAQ;yBACzB;qBACF;iBACF,CAAC,CAAA;gBACF,KAAK,EAAE,CAAA;YACT,CAAC;QACH,CAAC;IACH,CAAC;IACD,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAA;AAClC,CAAC,CAAA"}
package/dist/profile.d.ts CHANGED
@@ -5,7 +5,8 @@ export declare const profileOf: (discovery: Discovery, folders?: string[]) => {
5
5
  login?: string | undefined;
6
6
  imap_host: string;
7
7
  imap_port: number;
8
- imap_security: import("./discovery.js").Security;
8
+ imap_security: import("./providers.js").Security;
9
+ auth: "app-password" | "oauth";
9
10
  folders?: string[] | undefined;
10
11
  };
11
12
  /** Adds one profile to the config file; an existing profile is replaced only when `replace` is true. */
@@ -1 +1 @@
1
- {"version":3,"file":"profile.d.ts","sourceRoot":"","sources":["../src/profile.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAA;AAM/C,eAAO,MAAM,UAAU,QAAS,MAAM,CAAC,UAAU,KAAG,MACiD,CAAA;AAErG,eAAO,MAAM,SAAS,cAAe,SAAS,YAAY,MAAM,EAAE;;;;;;;CAOhE,CAAA;AAEF,wGAAwG;AACxG,eAAO,MAAM,YAAY,QAClB,MAAM,CAAC,UAAU,QAChB,MAAM,WACH,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,WACvB,OAAO,KACf;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,OAAO,CAAA;CAelC,CAAA"}
1
+ {"version":3,"file":"profile.d.ts","sourceRoot":"","sources":["../src/profile.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAA;AAM/C,eAAO,MAAM,UAAU,QAAS,MAAM,CAAC,UAAU,KAAG,MACiD,CAAA;AAErG,eAAO,MAAM,SAAS,cAAe,SAAS,YAAY,MAAM,EAAE;;;;;;;;CAQhE,CAAA;AAEF,wGAAwG;AACxG,eAAO,MAAM,YAAY,QAClB,MAAM,CAAC,UAAU,QAChB,MAAM,WACH,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,WACvB,OAAO,KACf;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,OAAO,CAAA;CAelC,CAAA"}
package/dist/profile.js CHANGED
@@ -9,6 +9,7 @@ export const profileOf = (discovery, folders) => ({
9
9
  imap_host: discovery.imap.host,
10
10
  imap_port: discovery.imap.port,
11
11
  imap_security: discovery.imap.security,
12
+ auth: discovery.auth,
12
13
  ...(folders?.length ? { folders } : {}),
13
14
  });
14
15
  /** Adds one profile to the config file; an existing profile is replaced only when `replace` is true. */
@@ -1 +1 @@
1
- {"version":3,"file":"profile.js","sourceRoot":"","sources":["../src/profile.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,cAAc,EAAE,YAAY,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAA;AAC1F,OAAO,EAAE,cAAc,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAA;AAEzE,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAA;AAExC,MAAM,QAAQ,GAAG,CAAC,KAAc,EAAoC,EAAE,CACpE,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,KAAK,IAAI,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,CAAA;AAEtE,MAAM,CAAC,MAAM,UAAU,GAAG,CAAC,GAAsB,EAAU,EAAE,CAC3D,cAAc,CAAC,YAAY,CAAC,EAAE,OAAO,EAAE,QAAQ,CAAC,OAAO,EAAE,MAAM,EAAE,QAAQ,CAAC,SAAS,EAAE,GAAG,EAAE,CAAC,CAAC,MAAM,CAAC,CAAA;AAErG,MAAM,CAAC,MAAM,SAAS,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AC,IAAI,EAAE,EAAE,GAAG,MAAM,EAAE,QAAQ,EAAE,EAAE,GAAG,QAAQ,EAAE,CAAC,IAAI,CAAC,EAAE,OAAO,EAAE,EAAE,CAAC,CAAA;IAC/E,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC,OAAO,EAAE,CAAA;AACpC,CAAC,CAAA"}
@@ -1,4 +1,10 @@
1
1
  export declare const PROVIDERS_URL = "https://github.com/WireCatLabs/mail-cli/blob/main/docs/providers.md";
2
+ export type Security = "tls" | "starttls";
3
+ export interface Endpoint {
4
+ host: string;
5
+ port: number;
6
+ security: Security;
7
+ }
2
8
  export interface Prepare {
3
9
  /** What the person does in the provider's own settings, in order. UI labels are quoted in the provider's language. */
4
10
  steps: string[];
@@ -8,46 +14,140 @@ export interface Prepare {
8
14
  /** The official help pages the steps were read from. */
9
15
  sources: string[];
10
16
  }
11
- export declare const PROVIDER_PREPARE: {
17
+ /** Which folders `sync` reads when neither the profile nor `--folder` names any: by role, else the named one. */
18
+ export interface SyncFolders {
19
+ /** `gmail`: one All Mail with labels, as memo syncs it, so both tools keep the same saved position. */
20
+ mode?: "gmail";
21
+ roles: string[];
22
+ otherwise: string;
23
+ }
24
+ export interface Provider {
25
+ name: string;
26
+ /** Address domains it hosts; every provider here logs in with the full address. */
27
+ domains: string[];
28
+ /** A domain with its own name can still be hosted here: its MX record says where. */
29
+ mx?: RegExp;
30
+ imap: Endpoint;
31
+ /** Not used until sending comes; check it against the provider's help page then. */
32
+ smtp: Endpoint;
33
+ auth: "app-password" | "oauth";
34
+ note?: string;
35
+ sync?: SyncFolders;
36
+ prepare: Prepare;
37
+ }
38
+ declare const TABLE: {
12
39
  yandex: {
13
- steps: string[];
14
- notes: string[];
15
- refused: string;
16
- sources: string[];
40
+ name: string;
41
+ domains: string[];
42
+ mx: RegExp;
43
+ imap: Endpoint;
44
+ smtp: Endpoint;
45
+ auth: "app-password";
46
+ note: string;
47
+ prepare: {
48
+ steps: string[];
49
+ notes: string[];
50
+ refused: string;
51
+ sources: string[];
52
+ };
17
53
  };
18
54
  gmail: {
19
- steps: string[];
20
- notes: string[];
21
- refused: string;
22
- sources: string[];
55
+ name: string;
56
+ domains: string[];
57
+ mx: RegExp;
58
+ imap: Endpoint;
59
+ smtp: Endpoint;
60
+ auth: "app-password";
61
+ note: string;
62
+ sync: {
63
+ mode: "gmail";
64
+ roles: string[];
65
+ otherwise: string;
66
+ };
67
+ prepare: {
68
+ steps: string[];
69
+ notes: string[];
70
+ refused: string;
71
+ sources: string[];
72
+ };
23
73
  };
24
74
  icloud: {
25
- steps: string[];
26
- notes: string[];
27
- refused: string;
28
- sources: string[];
75
+ name: string;
76
+ domains: string[];
77
+ imap: Endpoint;
78
+ smtp: {
79
+ host: string;
80
+ port: number;
81
+ security: "starttls";
82
+ };
83
+ auth: "app-password";
84
+ note: string;
85
+ prepare: {
86
+ steps: string[];
87
+ notes: string[];
88
+ refused: string;
89
+ sources: string[];
90
+ };
29
91
  };
30
92
  mailru: {
31
- steps: string[];
32
- notes: string[];
33
- refused: string;
34
- sources: string[];
93
+ name: string;
94
+ domains: string[];
95
+ mx: RegExp;
96
+ imap: Endpoint;
97
+ smtp: Endpoint;
98
+ auth: "app-password";
99
+ note: string;
100
+ prepare: {
101
+ steps: string[];
102
+ notes: string[];
103
+ refused: string;
104
+ sources: string[];
105
+ };
35
106
  };
36
107
  fastmail: {
37
- steps: string[];
38
- notes: string[];
39
- refused: string;
40
- sources: string[];
108
+ name: string;
109
+ domains: string[];
110
+ mx: RegExp;
111
+ imap: Endpoint;
112
+ smtp: Endpoint;
113
+ auth: "app-password";
114
+ prepare: {
115
+ steps: string[];
116
+ notes: string[];
117
+ refused: string;
118
+ sources: string[];
119
+ };
41
120
  };
42
121
  outlook: {
43
- steps: string[];
44
- notes: string[];
45
- refused: string;
46
- sources: string[];
122
+ name: string;
123
+ domains: string[];
124
+ mx: RegExp;
125
+ imap: Endpoint;
126
+ smtp: {
127
+ host: string;
128
+ port: number;
129
+ security: "starttls";
130
+ };
131
+ auth: "oauth";
132
+ note: string;
133
+ prepare: {
134
+ steps: string[];
135
+ notes: string[];
136
+ refused: string;
137
+ sources: string[];
138
+ };
47
139
  };
48
140
  };
49
- export type ProviderKey = keyof typeof PROVIDER_PREPARE;
141
+ export type ProviderKey = keyof typeof TABLE;
142
+ /** One entry per built-in provider: how it is found, its servers, how it signs in and how to prepare it. */
143
+ export declare const PROVIDERS: Record<ProviderKey, Provider>;
144
+ export declare const PROVIDER_KEYS: ProviderKey[];
145
+ export declare const providerByDomain: (domain: string) => ProviderKey | undefined;
146
+ export declare const DEFAULT_SYNC: SyncFolders;
147
+ /** The provider of a saved profile: its address domain first, then its server host (a domain of its own on Yandex). */
148
+ export declare const providerFor: (address: string, host: string | undefined) => Provider | undefined;
50
149
  export declare const GENERIC_PREPARE: Prepare;
51
150
  /** The human text for `setup` and `session start`; nothing in it comes from the mailbox or the password. */
52
151
  export declare const prepareText: (provider: string, prepare: Prepare) => string;
152
+ export {};
53
153
  //# sourceMappingURL=providers.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"providers.d.ts","sourceRoot":"","sources":["../src/providers.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,aAAa,wEAAwE,CAAA;AAElG,MAAM,WAAW,OAAO;IACtB,sHAAsH;IACtH,KAAK,EAAE,MAAM,EAAE,CAAA;IACf,KAAK,EAAE,MAAM,EAAE,CAAA;IACf,6EAA6E;IAC7E,OAAO,EAAE,MAAM,CAAA;IACf,wDAAwD;IACxD,OAAO,EAAE,MAAM,EAAE,CAAA;CAClB;AAED,eAAO,MAAM,gBAAgB;;QAEzB,KAAK;QAQL,KAAK;QAIL,OAAO;QAEP,OAAO;;;QAMP,KAAK;QAML,KAAK;QAGL,OAAO;QAEP,OAAO;;;QAGP,KAAK;QAOL,KAAK;QAGL,OAAO;QAEP,OAAO;;;QAGP,KAAK;QAOL,KAAK;QAGL,OAAO;QACP,OAAO;;;QAGP,KAAK;QAOL,KAAK;Q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ACb,IAAI,CAAC,EAAE,WAAW,CAAA;IAClB,OAAO,EAAE,OAAO,CAAA;CACjB;AAID,QAAA,MAAM,KAAK;;;;;;;;;;YAUL,KAAK;YAQL,KAAK;YAIL,OAAO;YAEP,OAAO;;;;;;;;;;;;;;;;;YAiBP,KAAK;YAML,KAAK;YAGL,OAAO;YAEP,OAAO;;;;;;;;;;;;;;;YAWP,KAAK;YAOL,KAAK;YAGL,OAAO;YAEP,OAAO;;;;;;;;;;;;YAYP,KAAK;YAOL,KAAK;YAGL,OAAO;YACP,OAAO;;;;;;;;;;;YAWP,KAAK;YAOL,KAAK;YACL,OAAO;YAEP,OAAO;;;;;;;;;;;;;;;;YAYP,KAAK;YAIL,KAAK;YAGL,OAAO;YACP,OAAO;;;CAKuB,CAAA;AAEpC,MAAM,MAAM,WAAW,GAAG,MAAM,OAAO,KAAK,CAAA;AAE5C,4GAA4G;AAC5G,eAAO,MAAM,SAAS,EAAE,MAAM,CAAC,WAAW,EAAE,QAAQ,CAAS,CAAA;AAE7D,eAAO,MAAM,aAAa,EAA6B,WAAW,EAAE,CAAA;AAEpE,eAAO,MAAM,gBAAgB,WAAY,MAAM,KAAG,WAAW,GAAG,SACM,CAAA;AAEtE,eAAO,MAAM,YAAY,EAAE,WAA8D,CAAA;AAEzF,uHAAuH;AACvH,eAAO,MAAM,WAAW,YAAa,MAAM,QAAQ,MAAM,GAAG,SAAS,KAAG,QAAQ,GAAG,SAIlF,CAAA;AAED,eAAO,MAAM,eAAe,EAAE,OAO7B,CAAA;AAED,4GAA4G;AAC5G,eAAO,MAAM,WAAW,aAAc,MAAM,WAAW,OAAO,KAAG,MAShE,CAAA"}
package/dist/providers.js CHANGED
@@ -1,89 +1,158 @@
1
+ import { GMAIL_ALL_MAIL } from "@wirecat/cli-core/mail";
1
2
  export const PROVIDERS_URL = "https://github.com/WireCatLabs/mail-cli/blob/main/docs/providers.md";
2
- export const PROVIDER_PREPARE = {
3
+ const tls = (host, port = 993) => ({ host, port, security: "tls" });
4
+ const TABLE = {
3
5
  yandex: {
4
- steps: [
5
- "Open https://mail.yandex.ru/#setup/client (or the gear, «Все настройки», «Почтовые программы»).",
6
- "Under «Разрешить доступ к почтовому ящику с помощью почтовых клиентов» turn on «С сервера imap.yandex.ru по протоколу IMAP».",
7
- "Make sure «Пароли приложений и OAuth токены» is on, then save.",
8
- "Open https://id.yandex.ru/security, tab «Безопасность», section «Доступ к вашим данным», «Пароли приложений».",
9
- "Under «Создать пароль приложения» choose the type «Почта», give the password a name and click «Далее».",
10
- "Copy the password at once: Yandex shows it only once.",
11
- ],
12
- notes: [
13
- "A new app password starts working 2 to 3 hours after it is created (Yandex ID help).",
14
- "On a Yandex 360 business domain an administrator setting might block app passwords. The help pages do not confirm this; ask the domain administrator if the login keeps failing.",
15
- ],
16
- refused: "IMAP may be off, the password may not be of type «Почта», or it may be under 2 to 3 hours old. Yandex 360 domains may also block app passwords.",
17
- sources: [
18
- "https://yandex.ru/support/yandex-360/customers/mail/ru/mail-clients/others",
19
- "https://yandex.ru/support/id/ru/authorization/app-passwords",
20
- ],
6
+ name: "Yandex",
7
+ domains: ["yandex.ru", "yandex.com", "ya.ru", "yandex.by", "yandex.kz", "yandex.ua"],
8
+ mx: /(^|\.)mx\.yandex\.(net|ru)$|(^|\.)yandex\.(net|ru)$/,
9
+ imap: tls("imap.yandex.com"),
10
+ smtp: tls("smtp.yandex.com", 465),
11
+ auth: "app-password",
12
+ note: "turn on IMAP and app passwords in Yandex settings, then make a password of type Mail",
13
+ prepare: {
14
+ steps: [
15
+ "Open https://mail.yandex.ru/#setup/client (or the gear, «Все настройки», «Почтовые программы»).",
16
+ "Under «Разрешить доступ к почтовому ящику с помощью почтовых клиентов» turn on «С сервера imap.yandex.ru по протоколу IMAP».",
17
+ "Make sure «Пароли приложений и OAuth токены» is on, then save.",
18
+ "Open https://id.yandex.ru/security, tab «Безопасность», section «Доступ к вашим данным», «Пароли приложений».",
19
+ "Under «Создать пароль приложения» choose the type «Почта», give the password a name and click «Далее».",
20
+ "Copy the password at once: Yandex shows it only once.",
21
+ ],
22
+ notes: [
23
+ "A new app password starts working 2 to 3 hours after it is created (Yandex ID help).",
24
+ "On a Yandex 360 business domain an administrator setting might block app passwords. The help pages do not confirm this; ask the domain administrator if the login keeps failing.",
25
+ ],
26
+ refused: "IMAP may be off, the password may not be of type «Почта», or it may be under 2 to 3 hours old. Yandex 360 domains may also block app passwords.",
27
+ sources: [
28
+ "https://yandex.ru/support/yandex-360/customers/mail/ru/mail-clients/others",
29
+ "https://yandex.ru/support/id/ru/authorization/app-passwords",
30
+ ],
31
+ },
21
32
  },
22
33
  gmail: {
23
- steps: [
24
- 'Personal Google Account: IMAP is always on, nothing to switch. Google Workspace: the administrator controls it, and the "Forwarding and POP/IMAP" tab in Gmail Settings, "See all settings", may be missing.',
25
- "Turn on 2-Step Verification for the Google Account.",
26
- "Open https://myaccount.google.com/apppasswords and create an app password. Google's help page does not list the labels of that screen, so none are quoted here.",
27
- "Copy the 16 digit password and use it instead of the account password.",
28
- ],
29
- notes: [
30
- "App passwords are not offered if 2-Step Verification is set up only for security keys, on a work or school account, or with Advanced Protection on.",
31
- ],
32
- refused: "2-Step Verification may be off, the password may be the account password instead of an app password, or the account type may not offer app passwords.",
33
- sources: ["https://support.google.com/mail/answer/7126229", "https://support.google.com/accounts/answer/185833"],
34
+ name: "Gmail",
35
+ domains: ["gmail.com", "googlemail.com"],
36
+ mx: /(^|\.)(aspmx\.l\.google\.com|googlemail\.com|google\.com)$/,
37
+ imap: tls("imap.gmail.com"),
38
+ smtp: tls("smtp.gmail.com", 465),
39
+ auth: "app-password",
40
+ note: "needs 2-step verification and an app password; IMAP downloads are capped at 2500 MB a day",
41
+ // Archived mail leaves INBOX; read from INBOX alone it would look deleted.
42
+ sync: { mode: "gmail", roles: ["all"], otherwise: GMAIL_ALL_MAIL },
43
+ prepare: {
44
+ steps: [
45
+ 'Personal Google Account: IMAP is always on, nothing to switch. Google Workspace: the administrator controls it, and the "Forwarding and POP/IMAP" tab in Gmail Settings, "See all settings", may be missing.',
46
+ "Turn on 2-Step Verification for the Google Account.",
47
+ "Open https://myaccount.google.com/apppasswords and create an app password. Google's help page does not list the labels of that screen, so none are quoted here.",
48
+ "Copy the 16 digit password and use it instead of the account password.",
49
+ ],
50
+ notes: [
51
+ "App passwords are not offered if 2-Step Verification is set up only for security keys, on a work or school account, or with Advanced Protection on.",
52
+ ],
53
+ refused: "2-Step Verification may be off, the password may be the account password instead of an app password, or the account type may not offer app passwords.",
54
+ sources: ["https://support.google.com/mail/answer/7126229", "https://support.google.com/accounts/answer/185833"],
55
+ },
34
56
  },
35
57
  icloud: {
36
- steps: [
37
- "Turn on two-factor authentication for the Apple Account.",
38
- "Go to https://account.apple.com and sign in.",
39
- 'In the "Sign In and Security" section select "App Specific Passwords".',
40
- 'Select "Generate an app specific password" and follow the on-screen steps.',
41
- "Copy the password when it appears; Apple's page does not say whether it can be shown again.",
42
- ],
43
- notes: [
44
- "`mail` logs in with the full address. Apple says the name before @icloud.com is the usual login; if the full address is refused, sign in with a new profile name: `mail <profile> session start --address <address> --login <name>`.",
45
- ],
46
- refused: "the password may be the Apple Account password instead of an app specific password, or the login may need the name before @icloud.com (--login).",
47
- sources: ["https://support.apple.com/en-us/102654", "https://support.apple.com/en-us/102525"],
58
+ name: "iCloud",
59
+ domains: ["icloud.com", "me.com", "mac.com"],
60
+ imap: tls("imap.mail.me.com"),
61
+ smtp: { host: "smtp.mail.me.com", port: 587, security: "starttls" },
62
+ auth: "app-password",
63
+ note: "needs an app-specific password",
64
+ prepare: {
65
+ steps: [
66
+ "Turn on two-factor authentication for the Apple Account.",
67
+ "Go to https://account.apple.com and sign in.",
68
+ 'In the "Sign In and Security" section select "App Specific Passwords".',
69
+ 'Select "Generate an app specific password" and follow the on-screen steps.',
70
+ "Copy the password when it appears; Apple's page does not say whether it can be shown again.",
71
+ ],
72
+ notes: [
73
+ "`mail` logs in with the full address. Apple says the name before @icloud.com is the usual login; if the full address is refused, sign in with a new profile name: `mail <profile> session start --address <address> --login <name>`.",
74
+ ],
75
+ refused: "the password may be the Apple Account password instead of an app specific password, or the login may need the name before @icloud.com (--login).",
76
+ sources: ["https://support.apple.com/en-us/102654", "https://support.apple.com/en-us/102525"],
77
+ },
48
78
  },
49
79
  mailru: {
50
- steps: [
51
- "Open https://e.mail.ru/inbox.",
52
- "Bottom left click «Настройки», then «Все настройки», «Безопасность», «Пароли для внешних приложений».",
53
- "Click «Создать», enter a name and click «Продолжить».",
54
- "Choose «Полный доступ к Почте» as the protocol type and click «Продолжить».",
55
- "Copy the password: Mail.ru does not keep it, so it cannot be viewed later.",
56
- ],
57
- notes: [
58
- "Mail.ru's help page requires a phone number linked to the mailbox (check it under «Контакты и адреса»). It lists no separate IMAP switch, only the server data.",
59
- ],
60
- refused: "the password may not be one made under «Пароли для внешних приложений» with «Полный доступ к Почте».",
61
- sources: ["https://help.mail.ru/mail/login/mailer/"],
80
+ name: "Mail.ru",
81
+ domains: ["mail.ru", "inbox.ru", "list.ru", "bk.ru", "internet.ru"],
82
+ mx: /(^|\.)mail\.ru$/,
83
+ imap: tls("imap.mail.ru"),
84
+ smtp: tls("smtp.mail.ru", 465),
85
+ auth: "app-password",
86
+ note: "needs an app password for external programs",
87
+ prepare: {
88
+ steps: [
89
+ "Open https://e.mail.ru/inbox.",
90
+ "Bottom left click «Настройки», then «Все настройки», «Безопасность», «Пароли для внешних приложений».",
91
+ "Click «Создать», enter a name and click «Продолжить».",
92
+ "Choose «Полный доступ к Почте» as the protocol type and click «Продолжить».",
93
+ "Copy the password: Mail.ru does not keep it, so it cannot be viewed later.",
94
+ ],
95
+ notes: [
96
+ "Mail.ru's help page requires a phone number linked to the mailbox (check it under «Контакты и адреса»). It lists no separate IMAP switch, only the server data.",
97
+ ],
98
+ refused: "the password may not be one made under «Пароли для внешних приложений» with «Полный доступ к Почте».",
99
+ sources: ["https://help.mail.ru/mail/login/mailer/"],
100
+ },
62
101
  },
63
102
  fastmail: {
64
- steps: [
65
- 'In the Fastmail web interface go to Settings, "Privacy & Security".',
66
- 'In "Connected apps & API tokens" click "Manage app passwords and access".',
67
- 'Click "New app password" (if "Verify it\'s you" appears, enter your password and click "Continue").',
68
- 'Pick a name, and keep the access "Mail, Contacts & Calendars", which includes IMAP.',
69
- 'Click "Generate password", copy it, then click "Done".',
70
- ],
71
- notes: ["Fastmail's Basic plans cannot create app passwords."],
72
- refused: "the password may be the account password instead of an app password, or the plan may not allow app passwords.",
73
- sources: ["https://www.fastmail.help/hc/en-us/articles/360058752854-App-passwords"],
103
+ name: "Fastmail",
104
+ domains: ["fastmail.com", "fastmail.fm"],
105
+ mx: /(^|\.)messagingengine\.com$/,
106
+ imap: tls("imap.fastmail.com"),
107
+ smtp: tls("smtp.fastmail.com", 465),
108
+ auth: "app-password",
109
+ prepare: {
110
+ steps: [
111
+ 'In the Fastmail web interface go to Settings, "Privacy & Security".',
112
+ 'In "Connected apps & API tokens" click "Manage app passwords and access".',
113
+ 'Click "New app password" (if "Verify it\'s you" appears, enter your password and click "Continue").',
114
+ 'Pick a name, and keep the access "Mail, Contacts & Calendars", which includes IMAP.',
115
+ 'Click "Generate password", copy it, then click "Done".',
116
+ ],
117
+ notes: ["Fastmail's Basic plans cannot create app passwords."],
118
+ refused: "the password may be the account password instead of an app password, or the plan may not allow app passwords.",
119
+ sources: ["https://www.fastmail.help/hc/en-us/articles/360058752854-App-passwords"],
120
+ },
74
121
  },
75
122
  outlook: {
76
- steps: [
77
- 'Outlook.com: open Settings (the cog), "Mail", "Forwarding and IMAP", turn on "Let devices and apps use IMAP" and save.',
78
- "Microsoft's page lists only OAuth2 (Modern Auth) for IMAP and does not list app passwords for it. OAuth sign-in comes in a later phase of `mail`, so a profile cannot be saved yet.",
79
- ],
80
- notes: ["Microsoft 365 work and school accounts were not read from an official page: their steps are unverified."],
81
- refused: "Microsoft accepts only OAuth for IMAP, which this version cannot do yet.",
82
- sources: [
83
- "https://support.microsoft.com/en-us/office/pop-imap-and-smtp-settings-for-outlook-com-d088b986-291d-42b8-9564-9c414e2aa040",
84
- ],
123
+ name: "Outlook",
124
+ domains: ["outlook.com", "hotmail.com", "live.com"],
125
+ mx: /\.mail\.protection\.outlook\.com$/,
126
+ imap: tls("outlook.office365.com"),
127
+ smtp: { host: "smtp-mail.outlook.com", port: 587, security: "starttls" },
128
+ auth: "oauth",
129
+ note: "Microsoft accepts only OAuth for IMAP; an app password cannot work, wait for OAuth sign-in",
130
+ prepare: {
131
+ steps: [
132
+ 'Outlook.com: open Settings (the cog), "Mail", "Forwarding and IMAP", turn on "Let devices and apps use IMAP" and save.',
133
+ "Microsoft's page lists only OAuth2 (Modern Auth) for IMAP and does not list app passwords for it. OAuth sign-in comes in a later phase of `mail`, so a profile cannot be saved yet.",
134
+ ],
135
+ notes: [
136
+ "Microsoft 365 work and school accounts were not read from an official page: their steps are unverified.",
137
+ ],
138
+ refused: "Microsoft accepts only OAuth for IMAP, which this version cannot do yet.",
139
+ sources: [
140
+ "https://support.microsoft.com/en-us/office/pop-imap-and-smtp-settings-for-outlook-com-d088b986-291d-42b8-9564-9c414e2aa040",
141
+ ],
142
+ },
85
143
  },
86
144
  };
145
+ /** One entry per built-in provider: how it is found, its servers, how it signs in and how to prepare it. */
146
+ export const PROVIDERS = TABLE;
147
+ export const PROVIDER_KEYS = Object.keys(PROVIDERS);
148
+ export const providerByDomain = (domain) => PROVIDER_KEYS.find((key) => PROVIDERS[key].domains.includes(domain));
149
+ export const DEFAULT_SYNC = { roles: ["inbox", "sent"], otherwise: "INBOX" };
150
+ /** The provider of a saved profile: its address domain first, then its server host (a domain of its own on Yandex). */
151
+ export const providerFor = (address, host) => {
152
+ const domain = address.split("@")[1]?.toLowerCase() ?? "";
153
+ const key = providerByDomain(domain) ?? PROVIDER_KEYS.find((name) => PROVIDERS[name].imap.host === host);
154
+ return key === undefined ? undefined : PROVIDERS[key];
155
+ };
87
156
  export const GENERIC_PREPARE = {
88
157
  steps: [],
89
158
  notes: [
@@ -1 +1 @@
1
- {"version":3,"file":"providers.js","sourceRoot":"","sources":["../src/providers.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,aAAa,GAAG,qEAAqE,CAAA;AAYlG,MAAM,CAAC,MAAM,gBAAgB,GAAG;IAC9B,MAAM,EAAE;QACN,KAAK,EAAE;YACL,iGAAiG;YACjG,8HAA8H;YAC9H,gEAAgE;YAChE,+GAA+G;YAC/G,wGAAwG;YACxG,uDAAuD;SACxD;QACD,KAAK,EAAE;YACL,sFAAsF;YACtF,kLAAkL;SACnL;QACD,OAAO,EACL,iJAAiJ;QACnJ,OAAO,EAAE;YACP,4EAA4E;YAC5E,6DAA6D;SAC9D;KACF;IACD,KAAK,EAAE;QACL,KAAK,EAAE;YACL,8MAA8M;YAC9M,qDAAqD;YACrD,iKAAiK;YACjK,wEAAwE;SACzE;QACD,KAAK,EAAE;YACL,qJAAqJ;SACtJ;QACD,OAAO,EACL,uJAAuJ;QACzJ,OAAO,EAAE,CAAC,gDAAgD,EAAE,mDAAmD,CAAC;KACjH;IACD,MAAM,EAAE;QACN,KAAK,EAAE;YACL,0DAA0D;YAC1D,8CAA8C;YAC9C,wEAAwE;YACxE,4EAA4E;YAC5E,6FAA6F;SAC9F;QACD,KAAK,EAAE;YACL,sOAAsO;SACvO;QACD,OAAO,EACL,kJAAkJ;QACpJ,OAAO,EAAE,CAAC,wCAAwC,EAAE,wCAAwC,CAAC;KAC9F;IACD,MAAM,EAAE;QACN,KAAK,EAAE;YACL,+BAA+B;YAC/B,uGAAuG;YACvG,uDAAuD;YACvD,6EAA6E;YAC7E,4EAA4E;SAC7E;QACD,KAAK,EAAE;YACL,iKAAiK;SAClK;QACD,OAAO,EAAE,sGAAsG;QAC/G,OAAO,EAAE,CAAC,yCAAyC,CAAC;KACrD;IACD,QAAQ,EAAE;QACR,KAAK,EAAE;YACL,qEAAqE;YACrE,2EAA2E;YAC3E,qGAAqG;YACrG,qFAAqF;YACrF,wDAAwD;SACzD;QACD,KAAK,EAAE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CAAC,aAAa,QAAQ,WAAW,CAAA;IAC/G,OAAO;QACL,IAAI;QACJ,GAAG,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,KAAK,EAAE,EAAE,CAAC,KAAK,KAAK,GAAG,CAAC,KAAK,IAAI,EAAE,CAAC;QAChE,GAAG,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,WAAW,IAAI,EAAE,CAAC;QACjD,GAAG,CAAC,OAAO,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,cAAc,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;QAC9E,oBAAoB,aAAa,EAAE;KACpC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;AACd,CAAC,CAAA"}
package/dist/secret.d.ts CHANGED
@@ -1,5 +1,6 @@
1
1
  import { type KeyringStore } from "@wirecat/cli-base";
2
- export type PasswordSource = "environment" | "keyring" | "file" | "himalaya";
2
+ export declare const PASSWORD_SOURCES: readonly ["environment", "keyring", "file", "himalaya"];
3
+ export type PasswordSource = (typeof PASSWORD_SOURCES)[number];
3
4
  export type LookupHimalaya = (account: string) => Promise<string | undefined>;
4
5
  /** Reads the entry Himalaya's setup left (`secret-tool … service himalaya account <name>`); no shell, no secret in argv. */
5
6
  export declare const secretToolLookup: LookupHimalaya;
@@ -1 +1 @@
1
- {"version":3,"file":"secret.d.ts","sourceRoot":"","sources":["../src/secret.ts"],"names":[],"mappings":"AACA,OAAO,EAA2B,KAAK,YAAY,EAA+B,MAAM,mBAAmB,CAAA;AAG3G,MAAM,MAAM,cAAc,GAAG,aAAa,GAAG,SAAS,GAAG,MAAM,GAAG,UAAU,CAAA;AAE5E,MAAM,MAAM,cAAc,GAAG,CAAC,OAAO,EAAE,MAAM,KAAK,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC,CAAA;AAE7E,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c,GAAG,SAAS,CAAA;CACtC;AAED;;;GAGG;AACH,eAAO,MAAM,aAAa,wCAAyD,eAAe;IAgB9F,IAAI,QAAY,OAAO,CAAC;QAAE,MAAM,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,cAAc,CAAA;KAAE,GAAG,SAAS,CAAC;IAM/E,+BAA+B;IAC/B,KAAK,WAAW,MAAM,YAAW,SAAS,GAAG,MAAM,KAAe,SAAS,GAAG,MAAM;IAOpF;;;OAGG;IACH,gBAAgB,QAAM,OAAO;IAS7B,MAAM,QAAM,OAAO;CAQtB,CAAA"}
package/dist/secret.js CHANGED
@@ -1,6 +1,7 @@
1
1
  import { execFile } from "node:child_process";
2
2
  import { Credentials, isMovedRun, resolvePaths, systemKeyring } from "@wirecat/cli-base";
3
3
  import { IDENTITY } from "./identity.js";
4
+ export const PASSWORD_SOURCES = ["environment", "keyring", "file", "himalaya"];
4
5
  /** Reads the entry Himalaya's setup left (`secret-tool … service himalaya account <name>`); no shell, no secret in argv. */
5
6
  export const secretToolLookup = (account) => new Promise((resolve) => {
6
7
  execFile("secret-tool", ["lookup", "service", "himalaya", "account", account], { timeout: 5000, maxBuffer: 64 * 1024, encoding: "utf8" }, (error, stdout) => resolve(error ? undefined : stdout.replace(/\r?\n$/, "") || undefined));