@wirecat/mail-cli 0.0.0-stage → 0.1.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 (226) hide show
  1. package/CHANGELOG.md +50 -0
  2. package/LICENSE +204 -0
  3. package/README.md +141 -2
  4. package/dist/bin/mail.d.ts +3 -0
  5. package/dist/bin/mail.d.ts.map +1 -0
  6. package/dist/bin/mail.js +36 -0
  7. package/dist/bin/mail.js.map +1 -0
  8. package/dist/bundle/all-profiles-TKMBELRZ.js +286 -0
  9. package/dist/bundle/anthropic-7LMUAEIZ.js +72 -0
  10. package/dist/bundle/app-server-JGMIJDD4.js +229 -0
  11. package/dist/bundle/bun-XRO6XJHQ.js +169 -0
  12. package/dist/bundle/bun-sqlite-Z54LEHVM.js +71 -0
  13. package/dist/bundle/chunk-2LLNPNMB.js +24 -0
  14. package/dist/bundle/chunk-3E3WA2L6.js +1932 -0
  15. package/dist/bundle/chunk-3KEVLSNN.js +138 -0
  16. package/dist/bundle/chunk-3KOA73LS.js +3416 -0
  17. package/dist/bundle/chunk-4E7BN3TC.js +122 -0
  18. package/dist/bundle/chunk-4FEMINO2.js +409 -0
  19. package/dist/bundle/chunk-5BVIWP3S.js +71 -0
  20. package/dist/bundle/chunk-5D4AEUVA.js +24783 -0
  21. package/dist/bundle/chunk-5NYMNSSO.js +264 -0
  22. package/dist/bundle/chunk-5WGEUDE4.js +27 -0
  23. package/dist/bundle/chunk-6MAZWSC3.js +132 -0
  24. package/dist/bundle/chunk-75CWWETH.js +379 -0
  25. package/dist/bundle/chunk-7SXGLT6T.js +444 -0
  26. package/dist/bundle/chunk-BTQX2ZSZ.js +288 -0
  27. package/dist/bundle/chunk-CEW6KIFA.js +1193 -0
  28. package/dist/bundle/chunk-CH6RXYAX.js +82 -0
  29. package/dist/bundle/chunk-D72URWJE.js +532 -0
  30. package/dist/bundle/chunk-DFDN6AUB.js +21 -0
  31. package/dist/bundle/chunk-EOEDICIE.js +6848 -0
  32. package/dist/bundle/chunk-F6D6PJ34.js +100 -0
  33. package/dist/bundle/chunk-FDCGTODC.js +78 -0
  34. package/dist/bundle/chunk-FZ5FXIG6.js +18 -0
  35. package/dist/bundle/chunk-GAH7N7HO.js +8181 -0
  36. package/dist/bundle/chunk-GK4M2SUP.js +195 -0
  37. package/dist/bundle/chunk-GN62YOT5.js +161 -0
  38. package/dist/bundle/chunk-GQQJOH7A.js +7050 -0
  39. package/dist/bundle/chunk-GWDCKUBI.js +781 -0
  40. package/dist/bundle/chunk-HTQTIKWP.js +928 -0
  41. package/dist/bundle/chunk-IK5TH3O7.js +217 -0
  42. package/dist/bundle/chunk-J3QXTBD2.js +2742 -0
  43. package/dist/bundle/chunk-J6MSJLIW.js +45 -0
  44. package/dist/bundle/chunk-JBBZCTTF.js +76 -0
  45. package/dist/bundle/chunk-JVMVLITS.js +260 -0
  46. package/dist/bundle/chunk-K4FVKPDQ.js +525 -0
  47. package/dist/bundle/chunk-KHTO2Q6E.js +886 -0
  48. package/dist/bundle/chunk-KM7Q67Z3.js +63 -0
  49. package/dist/bundle/chunk-LQ37ALDJ.js +2416 -0
  50. package/dist/bundle/chunk-MNOIRJEO.js +2315 -0
  51. package/dist/bundle/chunk-MS53RALV.js +168 -0
  52. package/dist/bundle/chunk-NK7EB63L.js +36225 -0
  53. package/dist/bundle/chunk-NPGVOZVK.js +2 -0
  54. package/dist/bundle/chunk-OTUOZ33L.js +82 -0
  55. package/dist/bundle/chunk-P7P5MNAU.js +46 -0
  56. package/dist/bundle/chunk-QLEUNU6G.js +537 -0
  57. package/dist/bundle/chunk-QQB7WT7R.js +216 -0
  58. package/dist/bundle/chunk-QX7RCLRS.js +23 -0
  59. package/dist/bundle/chunk-T6464KYA.js +35130 -0
  60. package/dist/bundle/chunk-TE5U5OAM.js +73 -0
  61. package/dist/bundle/chunk-TI6VBZKJ.js +166 -0
  62. package/dist/bundle/chunk-TQFCPUIM.js +53 -0
  63. package/dist/bundle/chunk-TVREDYX4.js +3574 -0
  64. package/dist/bundle/chunk-TWPDVUBR.js +106 -0
  65. package/dist/bundle/chunk-TWTATDM7.js +461 -0
  66. package/dist/bundle/chunk-UH4DDRHA.js +2989 -0
  67. package/dist/bundle/chunk-VEIZZRQ5.js +630 -0
  68. package/dist/bundle/chunk-WLFLBWNH.js +54 -0
  69. package/dist/bundle/chunk-WXAXYJJ7.js +486 -0
  70. package/dist/bundle/chunk-XQUUANA2.js +24600 -0
  71. package/dist/bundle/chunk-Y5E2WNWB.js +35 -0
  72. package/dist/bundle/chunk-YO4CUH5E.js +33 -0
  73. package/dist/bundle/chunk-YPQQ5J4X.js +849 -0
  74. package/dist/bundle/chunk-Z34ICZA3.js +1028 -0
  75. package/dist/bundle/chunk-ZANYM66S.js +58 -0
  76. package/dist/bundle/chunk-ZD3WUGR2.js +142 -0
  77. package/dist/bundle/chunk-ZVVMGPBJ.js +50 -0
  78. package/dist/bundle/command-contract-WU434ZUL.js +34 -0
  79. package/dist/bundle/decode-YB3ZDTES.js +162 -0
  80. package/dist/bundle/dispatch-EUKKT3PD.js +411 -0
  81. package/dist/bundle/dist-A6GKSKFC.js +2072 -0
  82. package/dist/bundle/dist-X36THCOF.js +7577 -0
  83. package/dist/bundle/echarts-YNGCOYHW.js +42501 -0
  84. package/dist/bundle/embed-LWNHIRBQ.js +37 -0
  85. package/dist/bundle/embedder-2LYD3U37.js +110 -0
  86. package/dist/bundle/failure-OAIC5VAP.js +24 -0
  87. package/dist/bundle/first-run-N3HJKGU7.js +27 -0
  88. package/dist/bundle/first-screen-4U2DMV3G.js +32 -0
  89. package/dist/bundle/instructions-GJHHFV64.js +11 -0
  90. package/dist/bundle/mail.js +166 -0
  91. package/dist/bundle/mcp-L7SRVDRN.js +167 -0
  92. package/dist/bundle/node-GFOH6FKP.js +176 -0
  93. package/dist/bundle/node-KM3CUABH.js +2340 -0
  94. package/dist/bundle/node-TLZSIHIJ.js +21 -0
  95. package/dist/bundle/node-sqlite-NBXQXBIU.js +63 -0
  96. package/dist/bundle/oauth-56EFO5AQ.js +19 -0
  97. package/dist/bundle/open-2V7QZQJP.js +21 -0
  98. package/dist/bundle/openai-V3SVACVL.js +251 -0
  99. package/dist/bundle/process-XVDX4SPD.js +91 -0
  100. package/dist/bundle/program-ILID6EAT.js +35542 -0
  101. package/dist/bundle/prompt-YKWAI222.js +14 -0
  102. package/dist/bundle/recognize-PAR66KVM.js +25 -0
  103. package/dist/bundle/remote-CE43TKXC.js +28 -0
  104. package/dist/bundle/rerank-M7S7P2TW.js +51 -0
  105. package/dist/bundle/serve-ENPMIV6J.js +197 -0
  106. package/dist/bundle/server-JRTHUCVY.js +63 -0
  107. package/dist/bundle/server-MBEZLVKZ.js +189 -0
  108. package/dist/bundle/sqlite-runtime-HVGDHBJJ.js +18 -0
  109. package/dist/bundle/state-QZSOSKBD.js +35 -0
  110. package/dist/bundle/store-2BUX6LVX.js +124 -0
  111. package/dist/bundle/store-UJ7SNKXI.js +141 -0
  112. package/dist/bundle/store-maintenance-command-I7V5C44K.js +52 -0
  113. package/dist/commands/account.d.ts +3 -0
  114. package/dist/commands/account.d.ts.map +1 -0
  115. package/dist/commands/account.js +47 -0
  116. package/dist/commands/account.js.map +1 -0
  117. package/dist/commands/context.d.ts +41 -0
  118. package/dist/commands/context.d.ts.map +1 -0
  119. package/dist/commands/context.js +52 -0
  120. package/dist/commands/context.js.map +1 -0
  121. package/dist/commands/doctor.d.ts +77 -0
  122. package/dist/commands/doctor.d.ts.map +1 -0
  123. package/dist/commands/doctor.js +74 -0
  124. package/dist/commands/doctor.js.map +1 -0
  125. package/dist/commands/folders.d.ts +3 -0
  126. package/dist/commands/folders.d.ts.map +1 -0
  127. package/dist/commands/folders.js +36 -0
  128. package/dist/commands/folders.js.map +1 -0
  129. package/dist/commands/login.d.ts +5 -0
  130. package/dist/commands/login.d.ts.map +1 -0
  131. package/dist/commands/login.js +21 -0
  132. package/dist/commands/login.js.map +1 -0
  133. package/dist/commands/mailbox.d.ts +16 -0
  134. package/dist/commands/mailbox.d.ts.map +1 -0
  135. package/dist/commands/mailbox.js +54 -0
  136. package/dist/commands/mailbox.js.map +1 -0
  137. package/dist/commands/mcp.d.ts +3 -0
  138. package/dist/commands/mcp.d.ts.map +1 -0
  139. package/dist/commands/mcp.js +97 -0
  140. package/dist/commands/mcp.js.map +1 -0
  141. package/dist/commands/session.d.ts +3 -0
  142. package/dist/commands/session.d.ts.map +1 -0
  143. package/dist/commands/session.js +211 -0
  144. package/dist/commands/session.js.map +1 -0
  145. package/dist/commands/setup.d.ts +3 -0
  146. package/dist/commands/setup.d.ts.map +1 -0
  147. package/dist/commands/setup.js +156 -0
  148. package/dist/commands/setup.js.map +1 -0
  149. package/dist/commands/status.d.ts +3 -0
  150. package/dist/commands/status.d.ts.map +1 -0
  151. package/dist/commands/status.js +89 -0
  152. package/dist/commands/status.js.map +1 -0
  153. package/dist/commands/sync.d.ts +3 -0
  154. package/dist/commands/sync.d.ts.map +1 -0
  155. package/dist/commands/sync.js +190 -0
  156. package/dist/commands/sync.js.map +1 -0
  157. package/dist/config.d.ts +190 -0
  158. package/dist/config.d.ts.map +1 -0
  159. package/dist/config.js +46 -0
  160. package/dist/config.js.map +1 -0
  161. package/dist/discovery.d.ts +42 -0
  162. package/dist/discovery.d.ts.map +1 -0
  163. package/dist/discovery.js +179 -0
  164. package/dist/discovery.js.map +1 -0
  165. package/dist/identity.d.ts +5 -0
  166. package/dist/identity.d.ts.map +1 -0
  167. package/dist/identity.js +16 -0
  168. package/dist/identity.js.map +1 -0
  169. package/dist/index.d.ts +3 -0
  170. package/dist/index.d.ts.map +1 -0
  171. package/dist/index.js +3 -0
  172. package/dist/index.js.map +1 -0
  173. package/dist/mail/imap-errors.d.ts +4 -0
  174. package/dist/mail/imap-errors.d.ts.map +1 -0
  175. package/dist/mail/imap-errors.js +41 -0
  176. package/dist/mail/imap-errors.js.map +1 -0
  177. package/dist/mail/imap-messages.d.ts +18 -0
  178. package/dist/mail/imap-messages.d.ts.map +1 -0
  179. package/dist/mail/imap-messages.js +66 -0
  180. package/dist/mail/imap-messages.js.map +1 -0
  181. package/dist/mail/imap.d.ts +67 -0
  182. package/dist/mail/imap.d.ts.map +1 -0
  183. package/dist/mail/imap.js +348 -0
  184. package/dist/mail/imap.js.map +1 -0
  185. package/dist/mail/parse.d.ts +18 -0
  186. package/dist/mail/parse.d.ts.map +1 -0
  187. package/dist/mail/parse.js +31 -0
  188. package/dist/mail/parse.js.map +1 -0
  189. package/dist/mail/port.d.ts +50 -0
  190. package/dist/mail/port.d.ts.map +1 -0
  191. package/dist/mail/port.js +4 -0
  192. package/dist/mail/port.js.map +1 -0
  193. package/dist/mcp.d.ts +29 -0
  194. package/dist/mcp.d.ts.map +1 -0
  195. package/dist/mcp.js +98 -0
  196. package/dist/mcp.js.map +1 -0
  197. package/dist/profile.d.ts +16 -0
  198. package/dist/profile.d.ts.map +1 -0
  199. package/dist/profile.js +31 -0
  200. package/dist/profile.js.map +1 -0
  201. package/dist/program.d.ts +6 -0
  202. package/dist/program.d.ts.map +1 -0
  203. package/dist/program.js +52 -0
  204. package/dist/program.js.map +1 -0
  205. package/dist/providers.d.ts +53 -0
  206. package/dist/providers.d.ts.map +1 -0
  207. package/dist/providers.js +106 -0
  208. package/dist/providers.js.map +1 -0
  209. package/dist/secret.d.ts +30 -0
  210. package/dist/secret.d.ts.map +1 -0
  211. package/dist/secret.js +68 -0
  212. package/dist/secret.js.map +1 -0
  213. package/dist/store.d.ts +12 -0
  214. package/dist/store.d.ts.map +1 -0
  215. package/dist/store.js +25 -0
  216. package/dist/store.js.map +1 -0
  217. package/dist/sync.d.ts +26 -0
  218. package/dist/sync.d.ts.map +1 -0
  219. package/dist/sync.js +75 -0
  220. package/dist/sync.js.map +1 -0
  221. package/dist/version.d.ts +2 -0
  222. package/dist/version.d.ts.map +1 -0
  223. package/dist/version.js +2 -0
  224. package/dist/version.js.map +1 -0
  225. package/package.json +83 -4
  226. package/skills/mail-cli/SKILL.md +27 -0
@@ -0,0 +1,124 @@
1
+ import { createRequire as __bundleRequire } from "node:module";
2
+ const require = __bundleRequire(import.meta.url);
3
+ import {
4
+ AGENDA_COLUMNS,
5
+ BACKFILL_ON_OPEN,
6
+ CHAT_COLUMNS,
7
+ CHAT_LIST_KEY,
8
+ CONVERSATION_COLUMNS,
9
+ DEFAULT_AGENT_CLOSE,
10
+ DEFAULT_FIRST_PASS_PER_CHAT,
11
+ MENTION_QUERY,
12
+ MENTION_STATUSES,
13
+ OTHER_SOURCES,
14
+ TRACKED_CHAT_COLUMNS,
15
+ accountGroupsOf,
16
+ attachmentColumns,
17
+ drainNoteIndex,
18
+ dropAllUnusedVectors,
19
+ fetchedKey,
20
+ fileFacts,
21
+ fillSearchIndex,
22
+ fillStems,
23
+ firstPassPerChatOf,
24
+ historyStartKey,
25
+ inboxKey,
26
+ involvementStoreOver,
27
+ messageOfEmail,
28
+ noteIndexState,
29
+ openSqlite,
30
+ openStore,
31
+ orphanPointers,
32
+ pendingNormalization,
33
+ queryFilter,
34
+ readStoreTables,
35
+ registerProvider,
36
+ resetAttachmentWords,
37
+ resetNoteIndex,
38
+ resetSearchIndex,
39
+ resetStems,
40
+ rowCounts,
41
+ saveStorePhoneCountries,
42
+ savedAgentClose,
43
+ savedFirstPassPerChat,
44
+ savedPhoneCountries,
45
+ savedStemmers,
46
+ savedTaskCategories,
47
+ searchIndexState,
48
+ stemmerCache,
49
+ stemmersOrigin,
50
+ stemsState,
51
+ storeClients,
52
+ storeContents,
53
+ threadConversation,
54
+ titlePart,
55
+ vectorIndexCounts
56
+ } from "./chunk-NK7EB63L.js";
57
+ import "./chunk-4FEMINO2.js";
58
+ import "./chunk-3KEVLSNN.js";
59
+ import "./chunk-UH4DDRHA.js";
60
+ import "./chunk-NPGVOZVK.js";
61
+ import "./chunk-MNOIRJEO.js";
62
+ import "./chunk-KHTO2Q6E.js";
63
+ import "./chunk-F6D6PJ34.js";
64
+ import "./chunk-EOEDICIE.js";
65
+ import "./chunk-FZ5FXIG6.js";
66
+ import "./chunk-J3QXTBD2.js";
67
+ import "./chunk-LQ37ALDJ.js";
68
+ import "./chunk-Y5E2WNWB.js";
69
+ import "./chunk-5BVIWP3S.js";
70
+ import "./chunk-ZVVMGPBJ.js";
71
+ export {
72
+ AGENDA_COLUMNS,
73
+ BACKFILL_ON_OPEN,
74
+ CHAT_COLUMNS,
75
+ CHAT_LIST_KEY,
76
+ CONVERSATION_COLUMNS,
77
+ DEFAULT_AGENT_CLOSE,
78
+ DEFAULT_FIRST_PASS_PER_CHAT,
79
+ MENTION_QUERY,
80
+ MENTION_STATUSES,
81
+ OTHER_SOURCES,
82
+ TRACKED_CHAT_COLUMNS,
83
+ accountGroupsOf,
84
+ attachmentColumns,
85
+ drainNoteIndex,
86
+ dropAllUnusedVectors,
87
+ fetchedKey,
88
+ fileFacts,
89
+ fillSearchIndex,
90
+ fillStems,
91
+ firstPassPerChatOf,
92
+ historyStartKey,
93
+ inboxKey,
94
+ involvementStoreOver,
95
+ messageOfEmail,
96
+ noteIndexState,
97
+ openSqlite,
98
+ openStore,
99
+ orphanPointers,
100
+ pendingNormalization,
101
+ queryFilter,
102
+ readStoreTables,
103
+ registerProvider,
104
+ resetAttachmentWords,
105
+ resetNoteIndex,
106
+ resetSearchIndex,
107
+ resetStems,
108
+ rowCounts,
109
+ saveStorePhoneCountries,
110
+ savedAgentClose,
111
+ savedFirstPassPerChat,
112
+ savedPhoneCountries,
113
+ savedStemmers,
114
+ savedTaskCategories,
115
+ searchIndexState,
116
+ stemmerCache,
117
+ stemmersOrigin,
118
+ stemsState,
119
+ storeClients,
120
+ storeContents,
121
+ threadConversation,
122
+ titlePart,
123
+ vectorIndexCounts
124
+ };
@@ -0,0 +1,141 @@
1
+ import { createRequire as __bundleRequire } from "node:module";
2
+ const require = __bundleRequire(import.meta.url);
3
+ import {
4
+ ORGANIZATIONS_QUERY,
5
+ PROJECTS_QUERY,
6
+ REMINDERS_QUERY,
7
+ applyDocumentTransfer,
8
+ previewDocumentTransfer,
9
+ previewProjectAnnotationSnapshot,
10
+ snapshotProjectAnnotations
11
+ } from "./chunk-YPQQ5J4X.js";
12
+ import {
13
+ note,
14
+ organization,
15
+ project,
16
+ reminder
17
+ } from "./chunk-6MAZWSC3.js";
18
+ import {
19
+ CATALOG_QUERY,
20
+ EVENT_FIELDS,
21
+ EVIDENCE_FINDINGS_KIND,
22
+ IMPORTED_DOCUMENT_QUERY,
23
+ MENTION_QUERY,
24
+ MENTION_STATUSES,
25
+ MIGRATIONS,
26
+ NOTE_FIELDS,
27
+ ORGANIZATION_KINDS,
28
+ OTHER_SOURCES,
29
+ PROJECT_ANNOTATIONS_MAX_BYTES,
30
+ PROJECT_TYPES,
31
+ PROPOSAL_STATUSES,
32
+ SCOPES,
33
+ TASK_EVENT_KINDS,
34
+ TASK_PAIR_DECISIONS,
35
+ TASK_RELATION_KINDS,
36
+ TASK_ROLES,
37
+ backfillNormalized,
38
+ certaintyOf,
39
+ createTagRedirectIndex,
40
+ decodeProjectAnnotationSnapshot,
41
+ decodeProjectAnnotations,
42
+ fillSearchIndex,
43
+ migrate,
44
+ openStore,
45
+ pendingNormalization,
46
+ planProjectAnnotationSnapshot,
47
+ planProjectAnnotations,
48
+ projectAnnotationSnapshotFingerprint,
49
+ projectAnnotationSnapshotSchema,
50
+ projectAnnotationsFingerprint,
51
+ resetAttachmentWords,
52
+ resetSearchIndex,
53
+ searchIndexState,
54
+ validateEvidenceFindings
55
+ } from "./chunk-NK7EB63L.js";
56
+ import "./chunk-4FEMINO2.js";
57
+ import {
58
+ FACT_STATUSES,
59
+ FACT_TYPES,
60
+ MEMORY_KINDS,
61
+ MEMORY_SCOPES,
62
+ MEMORY_STATUSES,
63
+ TASK_TYPES,
64
+ WORK_TASK_TYPES
65
+ } from "./chunk-3KEVLSNN.js";
66
+ import "./chunk-UH4DDRHA.js";
67
+ import "./chunk-NPGVOZVK.js";
68
+ import "./chunk-MNOIRJEO.js";
69
+ import "./chunk-KHTO2Q6E.js";
70
+ import {
71
+ PRAGMAS,
72
+ openCache
73
+ } from "./chunk-F6D6PJ34.js";
74
+ import "./chunk-EOEDICIE.js";
75
+ import {
76
+ storePath
77
+ } from "./chunk-FZ5FXIG6.js";
78
+ import "./chunk-J3QXTBD2.js";
79
+ import "./chunk-LQ37ALDJ.js";
80
+ import "./chunk-Y5E2WNWB.js";
81
+ import "./chunk-5BVIWP3S.js";
82
+ import "./chunk-ZVVMGPBJ.js";
83
+ export {
84
+ CATALOG_QUERY,
85
+ EVENT_FIELDS,
86
+ EVIDENCE_FINDINGS_KIND,
87
+ FACT_STATUSES,
88
+ FACT_TYPES,
89
+ IMPORTED_DOCUMENT_QUERY,
90
+ MEMORY_KINDS,
91
+ MEMORY_SCOPES,
92
+ MEMORY_STATUSES,
93
+ MENTION_QUERY,
94
+ MENTION_STATUSES,
95
+ MIGRATIONS,
96
+ NOTE_FIELDS,
97
+ ORGANIZATIONS_QUERY,
98
+ ORGANIZATION_KINDS,
99
+ OTHER_SOURCES,
100
+ PRAGMAS,
101
+ PROJECTS_QUERY,
102
+ PROJECT_ANNOTATIONS_MAX_BYTES,
103
+ PROJECT_TYPES,
104
+ PROPOSAL_STATUSES,
105
+ REMINDERS_QUERY,
106
+ SCOPES,
107
+ TASK_EVENT_KINDS,
108
+ TASK_PAIR_DECISIONS,
109
+ TASK_RELATION_KINDS,
110
+ TASK_ROLES,
111
+ TASK_TYPES,
112
+ WORK_TASK_TYPES,
113
+ applyDocumentTransfer,
114
+ backfillNormalized,
115
+ certaintyOf,
116
+ createTagRedirectIndex,
117
+ decodeProjectAnnotationSnapshot,
118
+ decodeProjectAnnotations,
119
+ fillSearchIndex,
120
+ migrate,
121
+ note,
122
+ openCache,
123
+ openStore,
124
+ organization,
125
+ pendingNormalization,
126
+ planProjectAnnotationSnapshot,
127
+ planProjectAnnotations,
128
+ previewDocumentTransfer,
129
+ previewProjectAnnotationSnapshot,
130
+ project,
131
+ projectAnnotationSnapshotFingerprint,
132
+ projectAnnotationSnapshotSchema,
133
+ projectAnnotationsFingerprint,
134
+ reminder,
135
+ resetAttachmentWords,
136
+ resetSearchIndex,
137
+ searchIndexState,
138
+ snapshotProjectAnnotations,
139
+ storePath,
140
+ validateEvidenceFindings
141
+ };
@@ -0,0 +1,52 @@
1
+ import { createRequire as __bundleRequire } from "node:module";
2
+ const require = __bundleRequire(import.meta.url);
3
+ import {
4
+ buildStems,
5
+ storeMaintenanceCommands,
6
+ storeSummary
7
+ } from "./chunk-GAH7N7HO.js";
8
+ import "./chunk-GK4M2SUP.js";
9
+ import "./chunk-3E3WA2L6.js";
10
+ import "./chunk-T6464KYA.js";
11
+ import "./chunk-75CWWETH.js";
12
+ import "./chunk-WXAXYJJ7.js";
13
+ import "./chunk-YO4CUH5E.js";
14
+ import "./chunk-J6MSJLIW.js";
15
+ import "./chunk-OTUOZ33L.js";
16
+ import "./chunk-CH6RXYAX.js";
17
+ import "./chunk-HTQTIKWP.js";
18
+ import "./chunk-GQQJOH7A.js";
19
+ import "./chunk-QLEUNU6G.js";
20
+ import "./chunk-7SXGLT6T.js";
21
+ import "./chunk-ZD3WUGR2.js";
22
+ import "./chunk-P7P5MNAU.js";
23
+ import "./chunk-WLFLBWNH.js";
24
+ import "./chunk-TE5U5OAM.js";
25
+ import "./chunk-KM7Q67Z3.js";
26
+ import "./chunk-4E7BN3TC.js";
27
+ import "./chunk-YPQQ5J4X.js";
28
+ import "./chunk-6MAZWSC3.js";
29
+ import "./chunk-NK7EB63L.js";
30
+ import "./chunk-4FEMINO2.js";
31
+ import "./chunk-3KEVLSNN.js";
32
+ import "./chunk-UH4DDRHA.js";
33
+ import "./chunk-NPGVOZVK.js";
34
+ import "./chunk-MNOIRJEO.js";
35
+ import "./chunk-KHTO2Q6E.js";
36
+ import "./chunk-F6D6PJ34.js";
37
+ import "./chunk-EOEDICIE.js";
38
+ import "./chunk-QX7RCLRS.js";
39
+ import "./chunk-D72URWJE.js";
40
+ import "./chunk-Z34ICZA3.js";
41
+ import "./chunk-5NYMNSSO.js";
42
+ import "./chunk-FZ5FXIG6.js";
43
+ import "./chunk-J3QXTBD2.js";
44
+ import "./chunk-LQ37ALDJ.js";
45
+ import "./chunk-Y5E2WNWB.js";
46
+ import "./chunk-5BVIWP3S.js";
47
+ import "./chunk-ZVVMGPBJ.js";
48
+ export {
49
+ buildStems,
50
+ storeMaintenanceCommands,
51
+ storeSummary
52
+ };
@@ -0,0 +1,3 @@
1
+ import { Command } from "commander";
2
+ export declare const accountCommand: () => Command;
3
+ //# sourceMappingURL=account.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"account.d.ts","sourceRoot":"","sources":["../../src/commands/account.ts"],"names":[],"mappings":"AAUA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AAoDnC,eAAO,MAAM,cAAc,QAAO,OAGH,CAAA"}
@@ -0,0 +1,47 @@
1
+ import { annotate } from "@wirecat/cli-base/commands";
2
+ import { answerEntity, baseContext, itemOf, LOCAL_READ, outputFor, REMOTE_READ, renderAnswer, } from "@wirecat/cli-core/cli";
3
+ import { Command } from "commander";
4
+ import * as v from "valibot";
5
+ import { configuration } from "../config.js";
6
+ import { IDENTITY } from "../identity.js";
7
+ import { contextOf, openSource, refuseOffline } from "./context.js";
8
+ const mailAccountCheck = v.strictObject({
9
+ profile: v.string(),
10
+ host: v.string(),
11
+ port: v.number(),
12
+ security: v.picklist(["tls", "starttls", "plain"]),
13
+ password_from: v.picklist(["environment", "keyring", "himalaya"]),
14
+ login: v.string(),
15
+ capabilities: v.array(v.string()),
16
+ features: v.record(v.string(), v.boolean()),
17
+ folders: v.number(),
18
+ });
19
+ const checkCommand = () => answerEntity(annotate(new Command("check"), {
20
+ effects: REMOTE_READ,
21
+ examples: [`${IDENTITY.command} ya account check`, `${IDENTITY.command} ya account check --json`],
22
+ }), "mail_account_check", mailAccountCheck)
23
+ .summary("log in and list what the server supports")
24
+ .description("log in to the server and list what it supports (IDLE, CONDSTORE, MOVE, Gmail extensions)")
25
+ .action(async function () {
26
+ const context = contextOf(this);
27
+ refuseOffline(context.flags);
28
+ const { source, endpoint, passwordFrom } = await openSource(context);
29
+ try {
30
+ const checked = await baseContext(this, configuration.resolveSettings).run(() => source.check());
31
+ renderAnswer(this, outputFor(this), itemOf({
32
+ profile: context.profile,
33
+ host: endpoint.host,
34
+ port: endpoint.port,
35
+ security: endpoint.security,
36
+ password_from: passwordFrom,
37
+ ...checked,
38
+ }));
39
+ }
40
+ finally {
41
+ await source.close();
42
+ }
43
+ });
44
+ export const accountCommand = () => annotate(new Command("account"), { effects: LOCAL_READ })
45
+ .description("the mailbox behind this profile")
46
+ .addCommand(checkCommand());
47
+ //# sourceMappingURL=account.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"account.js","sourceRoot":"","sources":["../../src/commands/account.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,4BAA4B,CAAA;AACrD,OAAO,EACL,YAAY,EACZ,WAAW,EACX,MAAM,EACN,UAAU,EACV,SAAS,EACT,WAAW,EACX,YAAY,GACb,MAAM,uBAAuB,CAAA;AAC9B,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AACnC,OAAO,KAAK,CAAC,MAAM,SAAS,CAAA;AAC5B,OAAO,EAAE,aAAa,EAAE,MAAM,cAAc,CAAA;AAC5C,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAA;AACzC,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,aAAa,EAAE,MAAM,cAAc,CAAA;AAEnE,MAAM,gBAAgB,GAAG,CAAC,CAAC,YAAY,CAAC;IACtC,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE;IACnB,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE;IAChB,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE;IAChB,QAAQ,EAAE,CAAC,CAAC,QAAQ,CAAC,CAAC,KAAK,EAAE,UAAU,EAAE,OAAO,CAAC,CAAC;IAClD,aAAa,EAAE,CAAC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AI,EAAE,QAAQ,CAAC,IAAI;YACnB,QAAQ,EAAE,QAAQ,CAAC,QAAQ;YAC3B,aAAa,EAAE,YAAY;YAC3B,GAAG,OAAO;SACX,CAAC,CACH,CAAA;IACH,CAAC;YAAS,CAAC;QACT,MAAM,MAAM,CAAC,KAAK,EAAE,CAAA;IACtB,CAAC;AACH,CAAC,CAAC,CAAA;AAEN,MAAM,CAAC,MAAM,cAAc,GAAG,GAAY,EAAE,CAC1C,QAAQ,CAAC,IAAI,OAAO,CAAC,SAAS,CAAC,EAAE,EAAE,OAAO,EAAE,UAAU,EAAE,CAAC;KACtD,WAAW,CAAC,iCAAiC,CAAC;KAC9C,UAAU,CAAC,YAAY,EAAE,CAAC,CAAA"}
@@ -0,0 +1,41 @@
1
+ import type { KeyringStore } from "@wirecat/cli-base";
2
+ import { type BaseEnvironment, type GlobalFlags } from "@wirecat/cli-core/cli";
3
+ import type { Command } from "commander";
4
+ import type { DiscoveryDeps } from "../discovery.js";
5
+ import { type ImapEndpoint, type ImapMailSource, type ImapTuning } from "../mail/imap.js";
6
+ import { type LookupHimalaya } from "../secret.js";
7
+ /** What a test hands `run()` in place of the network, the keyring and `secret-tool`. */
8
+ export interface MailEnvironment extends BaseEnvironment {
9
+ keyring?: KeyringStore;
10
+ himalaya?: LookupHimalaya;
11
+ discovery?: DiscoveryDeps;
12
+ connect?: (endpoint: ImapEndpoint, password: string, tuning?: ImapTuning) => ImapMailSource;
13
+ }
14
+ export declare const contextOf: (command: Command) => {
15
+ environment: MailEnvironment;
16
+ env: NodeJS.ProcessEnv;
17
+ flags: GlobalFlags;
18
+ settings: import("@wirecat/cli-core/cli").Settings & {
19
+ mailbox: import("../config.js").Mailbox;
20
+ };
21
+ profile: string;
22
+ };
23
+ export declare const refuseOffline: (flags: GlobalFlags) => void;
24
+ export declare const endpointOf: (settings: ReturnType<typeof contextOf>["settings"]) => ImapEndpoint;
25
+ export declare const passwordsOf: (context: ReturnType<typeof contextOf>) => {
26
+ read: () => Promise<{
27
+ secret: string;
28
+ source: import("../secret.js").PasswordSource;
29
+ } | undefined>;
30
+ write: (secret: string, storage?: "keyring" | "file") => "keyring" | "file";
31
+ usesOwnersSignIn: () => boolean;
32
+ remove: () => boolean;
33
+ };
34
+ /** An opened source for the profile, with the password read from the keyring; call `close` when done. */
35
+ export declare const openSource: (context: ReturnType<typeof contextOf>, tuning?: ImapTuning) => Promise<{
36
+ source: ImapMailSource;
37
+ endpoint: ImapEndpoint;
38
+ passwordFrom: import("../secret.js").PasswordSource;
39
+ }>;
40
+ export declare const collect: (value: string, previous?: string[]) => string[];
41
+ //# sourceMappingURL=context.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"context.d.ts","sourceRoot":"","sources":["../../src/commands/context.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAA;AAErD,OAAO,EAAE,KAAK,eAAe,EAAiB,KAAK,WAAW,EAAE,MAAM,uBAAuB,CAAA;AAC7F,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AAExC,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAA;AAEpD,OAAO,EAAE,KAAK,YAAY,EAAE,KAAK,cAAc,EAAE,KAAK,UAAU,EAAc,MAAM,iBAAiB,CAAA;AACrG,OAAO,EAAE,KAAK,cAAc,EAAiB,MAAM,cAAc,CAAA;AAEjE,wFAAwF;AACxF,MAAM,WAAW,eAAgB,SAAQ,eAAe;IACtD,OAAO,CAAC,EAAE,YAAY,CAAA;IACtB,QAAQ,CAAC,EAAE,cAAc,CAAA;IACzB,SAAS,CAAC,EAAE,aAAa,CAAA;IACzB,OAAO,CAAC,EAAE,CAAC,QAAQ,EAAE,YAAY,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,UAAU,KAAK,cAAc,CAAA;CAC5F;AAED,eAAO,MAAM,SAAS,YAAa,OAAO;;;;;;;;CAMzC,CAAA;AAED,eAAO,MAAM,aAAa,UAAW,WAAW,SAE/C,CAAA;AAED,eAAO,MAAM,UAAU,aAAc,UAAU,CAAC,OAAO,SAAS,CAAC,CAAC,UAAU,CAAC,KAAG,YAQ/E,CAAA;AAED,eAAO,MAAM,WAAW,YAAa,UAAU,CAAC,OAAO,SAAS,CAAC;;;;;;;;CAM7D,CAAA;AAKJ,yGAAyG;AACzG,eAAO,MAAM,UAAU,YAAmB,UAAU,CAAC,OAAO,SAAS,CAAC,WAAU,UAAU;;;;EAqBzF,CAAA;AAED,eAAO,MAAM,OAAO,UAAW,MAAM,aAAY,MAAM,EAAE,KAAQ,MAAM,EAA0B,CAAA"}
@@ -0,0 +1,52 @@
1
+ import { CliError } from "@wirecat/cli-base";
2
+ import { environmentOf } from "@wirecat/cli-core/cli";
3
+ import { configuration } from "../config.js";
4
+ import { IDENTITY } from "../identity.js";
5
+ import { imapSource } from "../mail/imap.js";
6
+ import { passwordStore } from "../secret.js";
7
+ export const contextOf = (command) => {
8
+ const environment = environmentOf(command);
9
+ const env = environment.env ?? process.env;
10
+ const flags = command.optsWithGlobals();
11
+ const settings = configuration.resolveSettings(flags, { env });
12
+ return { environment, env, flags, settings, profile: settings.profile };
13
+ };
14
+ export const refuseOffline = (flags) => {
15
+ if (flags.offline)
16
+ throw new CliError("permission_error", "this needs the mail server; leave out --offline");
17
+ };
18
+ export const endpointOf = (settings) => {
19
+ const { address, login, host, port, security } = settings.mailbox;
20
+ if (!address || !host || !port || !security)
21
+ throw new CliError("configuration_error", `profile ${settings.profile} has no mail server; run \`${IDENTITY.command} ${settings.profile} session start --address <email>\``);
22
+ return { host, port, security, login: login ?? address };
23
+ };
24
+ export const passwordsOf = (context) => passwordStore({
25
+ env: context.env,
26
+ profile: context.profile,
27
+ keyring: context.environment.keyring,
28
+ himalaya: context.environment.himalaya,
29
+ });
30
+ /** A retry that would end after the run's deadline is not made; this much is kept back for saving and answering. */
31
+ const RETRY_MARGIN_MS = 3_000;
32
+ /** An opened source for the profile, with the password read from the keyring; call `close` when done. */
33
+ export const openSource = async (context, tuning = {}) => {
34
+ const { deadline, signal } = context.environment;
35
+ const endpoint = endpointOf(context.settings);
36
+ const stored = await passwordsOf(context).read();
37
+ if (!stored)
38
+ throw new CliError("authentication_error", `no app password for profile ${context.profile}; run \`${IDENTITY.command} ${context.profile} session start\``, { reason: "mail.no-password" });
39
+ const connect = context.environment.connect ?? imapSource;
40
+ const bounds = {
41
+ timeLeftMs: () => {
42
+ const now = deadline?.();
43
+ return now ? now.endsAt - Date.now() - RETRY_MARGIN_MS : undefined;
44
+ },
45
+ ...(signal ? { signal } : {}),
46
+ };
47
+ const source = connect(endpoint, stored.secret, { ...bounds, ...tuning });
48
+ context.environment.trackCloseable?.(source);
49
+ return { source, endpoint, passwordFrom: stored.source };
50
+ };
51
+ export const collect = (value, previous = []) => [...previous, value];
52
+ //# sourceMappingURL=context.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"context.js","sourceRoot":"","sources":["../../src/commands/context.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAA;AAC5C,OAAO,EAAwB,aAAa,EAAoB,MAAM,uBAAuB,CAAA;AAE7F,OAAO,EAAE,aAAa,EAAE,MAAM,cAAc,CAAA;AAE5C,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAA;AACzC,OAAO,EAA2D,UAAU,EAAE,MAAM,iBAAiB,CAAA;AACrG,OAAO,EAAuB,aAAa,EAAE,MAAM,cAAc,CAAA;AAUjE,MAAM,CAAC,MAAM,SAAS,GAAG,CAAC,OAAgB,EAAE,EAAE;IAC5C,MAAM,WAAW,GAAG,aAAa,CAAkB,OAAO,CAAC,CAAA;IAC3D,MAAM,GAAG,GAAG,WAAW,CAAC,GAAG,IAAI,OAAO,CAAC,GAAG,CAAA;IAC1C,MAAM,KAAK,GAAG,OAAO,CAAC,eAAe,EAAe,CAAA;IACpD,MAAM,QAAQ,GAAG,aAAa,CAAC,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O,GAAG,CAAC,KAAa,EAAE,QAAQ,GAAa,EAAE,EAAY,EAAE,CAAC,CAAC,GAAG,QAAQ,EAAE,KAAK,CAAC,CAAA"}
@@ -0,0 +1,77 @@
1
+ import { Command } from "commander";
2
+ /**
3
+ * It is run when everything else is broken, so a problem in the config file is a field in the answer, never a throw.
4
+ * `fixes` are the `chmod` commands that make the config private; they go to stderr, not into the answer.
5
+ */
6
+ export declare const doctorReport: (env: NodeJS.ProcessEnv) => {
7
+ report: {
8
+ version: string;
9
+ runtime: {
10
+ node: string;
11
+ platform: NodeJS.Platform;
12
+ };
13
+ paths: {
14
+ config: string;
15
+ state: string;
16
+ cache: string;
17
+ };
18
+ config: {
19
+ path: string;
20
+ found: boolean;
21
+ issues: import("@wirecat/cli-core/cli").ConfigIssue[];
22
+ };
23
+ profiles: string[];
24
+ read_only: string | null;
25
+ files: {
26
+ checked: false;
27
+ reason: string;
28
+ } | {
29
+ checked: true;
30
+ ok: boolean;
31
+ problems: {
32
+ path: string;
33
+ mode: string;
34
+ want: string;
35
+ }[];
36
+ };
37
+ };
38
+ fixes: string[] | never[];
39
+ } | {
40
+ report: {
41
+ version: string;
42
+ runtime: {
43
+ node: string;
44
+ platform: NodeJS.Platform;
45
+ };
46
+ paths: {
47
+ config: string;
48
+ state: string;
49
+ cache: string;
50
+ };
51
+ config: {
52
+ path: string;
53
+ found: boolean;
54
+ issues: never[];
55
+ };
56
+ settings: {
57
+ error: string;
58
+ };
59
+ profiles: null;
60
+ read_only: string | null;
61
+ files: {
62
+ checked: false;
63
+ reason: string;
64
+ } | {
65
+ checked: true;
66
+ ok: boolean;
67
+ problems: {
68
+ path: string;
69
+ mode: string;
70
+ want: string;
71
+ }[];
72
+ };
73
+ };
74
+ fixes: string[] | never[];
75
+ };
76
+ export declare const doctorCommand: () => Command;
77
+ //# sourceMappingURL=doctor.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"doctor.d.ts","sourceRoot":"","sources":["../../src/commands/doctor.ts"],"names":[],"mappings":"AAcA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AAenC;;;GAGG;AACH,eAAO,MAAM,YAAY,QAAS,MAAM,CAAC,UAAU;;;;YAIpC,IAAI;YAAyB,QAAQ;;;YACvC,MAAM;YAAgB,KAAK;YAAe,KAAK;;;YAS1C,IAAI;YAAuB,KAAK;YAAwB,MAAM;;;;;;;;;;;;;;;;;;;;;;YAVjE,IAAI;YAAyB,QAAQ;;;YACvC,MAAM;YAAgB,KAAK;YAAe,KAAK;;;YAsB1C,IAAI;YAAQ,KAAK;YAAoB,MAAM;;;YACzC,KAAK;;;;;;;;;;;;;;;;;;CAQxB,CAAA;AAED,eAAO,MAAM,aAAa,QAAO,OAc3B,CAAA"}
@@ -0,0 +1,74 @@
1
+ import { existsSync } from "node:fs";
2
+ import { dirname } from "node:path";
3
+ import { configFilePath, resolvePaths } from "@wirecat/cli-base";
4
+ import { annotate } from "@wirecat/cli-base/commands";
5
+ import { environmentOf, itemOf, LOCAL_READ, outputFor, privateFiles, profileFree, readOnlyLockOf, renderAnswer, } from "@wirecat/cli-core/cli";
6
+ import { Command } from "commander";
7
+ import { configuration } from "../config.js";
8
+ import { IDENTITY } from "../identity.js";
9
+ const failure = (error) => (error instanceof Error ? error.message : String(error));
10
+ const configFiles = (path) => {
11
+ const files = privateFiles({ files: [path], dirs: [dirname(path)] });
12
+ if (!files.checked)
13
+ return { files, fixes: [] };
14
+ return {
15
+ files: { ...files, problems: files.problems.map(({ path, mode, want }) => ({ path, mode, want })) },
16
+ fixes: files.problems.map((problem) => problem.fix),
17
+ };
18
+ };
19
+ /**
20
+ * It is run when everything else is broken, so a problem in the config file is a field in the answer, never a throw.
21
+ * `fixes` are the `chmod` commands that make the config private; they go to stderr, not into the answer.
22
+ */
23
+ export const doctorReport = (env) => {
24
+ const paths = resolvePaths({ appName: IDENTITY.appName, prefix: IDENTITY.envPrefix, env });
25
+ const common = {
26
+ version: IDENTITY.version,
27
+ runtime: { node: process.versions.node, platform: process.platform },
28
+ paths: { config: paths.config, state: paths.state, cache: paths.cache },
29
+ };
30
+ const readOnly = readOnlyLockOf(IDENTITY, env) ?? null;
31
+ try {
32
+ const settings = configuration.resolveSettings({}, { env, readOnly: true, needsProfile: false, withIssues: true });
33
+ const { files, fixes } = configFiles(settings.configPath);
34
+ return {
35
+ report: {
36
+ ...common,
37
+ config: { path: settings.configPath, found: settings.configFound, issues: settings.configIssues ?? [] },
38
+ profiles: settings.configuredProfiles,
39
+ read_only: readOnly,
40
+ files,
41
+ },
42
+ fixes,
43
+ };
44
+ }
45
+ catch (error) {
46
+ const file = configFilePath(paths.config);
47
+ const { files, fixes } = configFiles(file);
48
+ return {
49
+ report: {
50
+ ...common,
51
+ config: { path: file, found: existsSync(file), issues: [] },
52
+ settings: { error: failure(error) },
53
+ profiles: null,
54
+ read_only: readOnly,
55
+ files,
56
+ },
57
+ fixes,
58
+ };
59
+ }
60
+ };
61
+ export const doctorCommand = () => profileFree(annotate(new Command("doctor"), {
62
+ effects: LOCAL_READ,
63
+ examples: [`${IDENTITY.command} doctor`, `${IDENTITY.command} doctor --json`],
64
+ }))
65
+ .description("check this installation: version, paths, config, profiles; no keyring or network")
66
+ .action(function () {
67
+ const env = environmentOf(this).env ?? process.env;
68
+ const { report, fixes } = doctorReport(env);
69
+ const output = outputFor(this);
70
+ renderAnswer(this, output, itemOf(report));
71
+ for (const fix of fixes)
72
+ output.renderer.note(`to make it private: ${fix}`);
73
+ });
74
+ //# sourceMappingURL=doctor.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"doctor.js","sourceRoot":"","sources":["../../src/commands/doctor.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAA;AACpC,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AACnC,OAAO,EAAE,cAAc,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAA;AAChE,OAAO,EAAE,QAAQ,EAAE,MAAM,4BAA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0 +1 @@
1
+ {"version":3,"file":"folders.d.ts","sourceRoot":"","sources":["../../src/commands/folders.ts"],"names":[],"mappings":"AAUA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AAyCnC,eAAO,MAAM,cAAc,QAAO,OAGJ,CAAA"}