@wirecat/cli-core 0.399.0 → 0.400.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 (221) hide show
  1. package/CHANGELOG.md +82 -0
  2. package/dist/analysis/consents.d.ts +11 -6
  3. package/dist/analysis/consents.js +5 -2
  4. package/dist/cli/bot/mcp.js +2 -1
  5. package/dist/cli/config-command.js +20 -1
  6. package/dist/cli/context.d.ts +2 -0
  7. package/dist/cli/context.js +1 -1
  8. package/dist/cli/effects.d.ts +4 -1
  9. package/dist/cli/effects.js +10 -2
  10. package/dist/cli/index.d.ts +1 -1
  11. package/dist/cli/index.js +1 -1
  12. package/dist/cli/json-fields.js +12 -1
  13. package/dist/cli/messenger/account-command.js +15 -6
  14. package/dist/cli/messenger/account-profile-query.d.ts +2 -0
  15. package/dist/cli/messenger/account-profile-query.js +13 -0
  16. package/dist/cli/messenger/account-sessions-command.js +1 -0
  17. package/dist/cli/messenger/admin-commands.js +12 -12
  18. package/dist/cli/messenger/admin-contacts-command.js +6 -3
  19. package/dist/cli/messenger/admin-folders-command.js +5 -5
  20. package/dist/cli/messenger/admin-moderation-command.js +4 -4
  21. package/dist/cli/messenger/admin-statistics-command.js +6 -14
  22. package/dist/cli/messenger/analysis-consents-query.d.ts +5 -0
  23. package/dist/cli/messenger/analysis-consents-query.js +20 -0
  24. package/dist/cli/messenger/archive-commands.js +3 -3
  25. package/dist/cli/messenger/attachments-command.js +3 -0
  26. package/dist/cli/messenger/backfill-command.js +5 -4
  27. package/dist/cli/messenger/chat-queries.d.ts +1 -0
  28. package/dist/cli/messenger/chat-queries.js +12 -2
  29. package/dist/cli/messenger/chats-command.js +2 -2
  30. package/dist/cli/messenger/chats-documents-command.js +7 -5
  31. package/dist/cli/messenger/chats-members-command.js +7 -3
  32. package/dist/cli/messenger/chats-read-command.js +1 -1
  33. package/dist/cli/messenger/chats-tracking-command.js +14 -6
  34. package/dist/cli/messenger/contacts-command.js +9 -5
  35. package/dist/cli/messenger/conversations-command.js +20 -16
  36. package/dist/cli/messenger/doctor-command.js +5 -1
  37. package/dist/cli/messenger/document-links-query.d.ts +2 -0
  38. package/dist/cli/messenger/document-links-query.js +9 -0
  39. package/dist/cli/messenger/download-command.js +1 -0
  40. package/dist/cli/messenger/flood-command.d.ts +2 -2
  41. package/dist/cli/messenger/flood-command.js +3 -3
  42. package/dist/cli/messenger/gaps-command.js +2 -2
  43. package/dist/cli/messenger/guard-commands.js +35 -13
  44. package/dist/cli/messenger/images-command.js +1 -0
  45. package/dist/cli/messenger/media-archive-command.js +2 -0
  46. package/dist/cli/messenger/media-archive-move-command.js +1 -0
  47. package/dist/cli/messenger/media-archive-timer-command.js +1 -1
  48. package/dist/cli/messenger/mentions-command.js +15 -2
  49. package/dist/cli/messenger/messages-command.js +2 -0
  50. package/dist/cli/messenger/messages-delete-command.js +1 -0
  51. package/dist/cli/messenger/messages-edit-command.js +1 -0
  52. package/dist/cli/messenger/messages-evidence-command.js +3 -1
  53. package/dist/cli/messenger/messages-forward-command.js +1 -0
  54. package/dist/cli/messenger/messages-pin-command.js +3 -0
  55. package/dist/cli/messenger/messages-send-command.js +1 -0
  56. package/dist/cli/messenger/metadata-command.js +6 -1
  57. package/dist/cli/messenger/models-command.js +10 -2
  58. package/dist/cli/messenger/polls-command.js +4 -0
  59. package/dist/cli/messenger/private-people-command.js +3 -3
  60. package/dist/cli/messenger/rankings-command.js +6 -11
  61. package/dist/cli/messenger/reactions-command.js +2 -0
  62. package/dist/cli/messenger/recipients-query.d.ts +5 -0
  63. package/dist/cli/messenger/recipients-query.js +18 -0
  64. package/dist/cli/messenger/records-command.js +13 -6
  65. package/dist/cli/messenger/search-command.js +3 -1
  66. package/dist/cli/messenger/searches-command.js +5 -1
  67. package/dist/cli/messenger/sends-query.d.ts +5 -0
  68. package/dist/cli/messenger/sends-query.js +33 -0
  69. package/dist/cli/messenger/serve-command.js +1 -0
  70. package/dist/cli/messenger/statistics-query.d.ts +14 -0
  71. package/dist/cli/messenger/statistics-query.js +143 -0
  72. package/dist/cli/messenger/stats-command.js +5 -5
  73. package/dist/cli/messenger/store-maintenance-command.d.ts +1 -1
  74. package/dist/cli/messenger/store-maintenance-command.js +10 -10
  75. package/dist/cli/messenger/tags-command.js +7 -1
  76. package/dist/cli/messenger/tasks-command.js +47 -8
  77. package/dist/cli/messenger/transcribe-command.js +1 -0
  78. package/dist/cli/messenger/watch-answers.d.ts +6 -0
  79. package/dist/cli/messenger/watch-answers.js +69 -0
  80. package/dist/cli/messenger/watch-command.d.ts +1 -1
  81. package/dist/cli/messenger/watch-command.js +56 -7
  82. package/dist/cli/program.js +5 -1
  83. package/dist/cli/runs/command.js +25 -38
  84. package/dist/cli/runs/query.d.ts +5 -0
  85. package/dist/cli/runs/query.js +32 -0
  86. package/dist/cli/runs/search-command.d.ts +4 -0
  87. package/dist/cli/runs/search-command.js +27 -0
  88. package/dist/cli/runs/search-query.d.ts +4 -0
  89. package/dist/cli/runs/search-query.js +50 -0
  90. package/dist/cli/runs/search.d.ts +2 -1
  91. package/dist/cli/runs/search.js +6 -6
  92. package/dist/domain/attachments.js +9 -1
  93. package/dist/domain/rankings-options.js +3 -3
  94. package/dist/entities/account-change.d.ts +89 -0
  95. package/dist/entities/account-change.js +20 -0
  96. package/dist/entities/account-profile.d.ts +7 -0
  97. package/dist/entities/account-profile.js +8 -0
  98. package/dist/entities/analysis-consent.d.ts +9 -0
  99. package/dist/entities/analysis-consent.js +4 -0
  100. package/dist/entities/attachment-results.d.ts +96 -0
  101. package/dist/entities/attachment-results.js +31 -0
  102. package/dist/entities/batch-result.d.ts +27 -0
  103. package/dist/entities/batch-result.js +18 -0
  104. package/dist/entities/chat-admin.d.ts +234 -0
  105. package/dist/entities/chat-admin.js +84 -0
  106. package/dist/entities/chat-change.d.ts +25 -0
  107. package/dist/entities/chat-change.js +11 -0
  108. package/dist/entities/chat-metadata.d.ts +34 -0
  109. package/dist/entities/chat-metadata.js +15 -0
  110. package/dist/entities/chat-moderation.d.ts +44 -0
  111. package/dist/entities/chat-moderation.js +37 -0
  112. package/dist/entities/chat-tracking.d.ts +26 -0
  113. package/dist/entities/chat-tracking.js +23 -0
  114. package/dist/entities/contact-activity.d.ts +52 -0
  115. package/dist/entities/contact-activity.js +42 -0
  116. package/dist/entities/contact-context.d.ts +1568 -0
  117. package/dist/entities/contact-context.js +191 -0
  118. package/dist/entities/contact-write.d.ts +22 -0
  119. package/dist/entities/contact-write.js +6 -0
  120. package/dist/entities/conversation-preparation.d.ts +63 -0
  121. package/dist/entities/conversation-preparation.js +23 -0
  122. package/dist/entities/conversation-results.d.ts +567 -0
  123. package/dist/entities/conversation-results.js +94 -0
  124. package/dist/entities/document-link.d.ts +13 -0
  125. package/dist/entities/document-link.js +11 -0
  126. package/dist/entities/extraction-report.d.ts +95 -0
  127. package/dist/entities/extraction-report.js +34 -0
  128. package/dist/entities/image-embedding.d.ts +9 -0
  129. package/dist/entities/image-embedding.js +10 -0
  130. package/dist/entities/index.d.ts +8006 -1928
  131. package/dist/entities/index.js +174 -3
  132. package/dist/entities/listener.d.ts +2150 -0
  133. package/dist/entities/listener.js +46 -0
  134. package/dist/entities/media-archive.d.ts +43 -0
  135. package/dist/entities/media-archive.js +32 -0
  136. package/dist/entities/meeting-task-proposal.d.ts +14 -0
  137. package/dist/entities/meeting-task-proposal.js +19 -0
  138. package/dist/entities/meeting.d.ts +1 -1
  139. package/dist/entities/meeting.js +1 -1
  140. package/dist/entities/mention.d.ts +63 -0
  141. package/dist/entities/mention.js +44 -0
  142. package/dist/entities/message-change.d.ts +19 -0
  143. package/dist/entities/message-change.js +6 -0
  144. package/dist/entities/message-context.d.ts +617 -0
  145. package/dist/entities/message-context.js +20 -0
  146. package/dist/entities/message-read.d.ts +73 -0
  147. package/dist/entities/message-read.js +58 -0
  148. package/dist/entities/message-transfer.d.ts +379 -0
  149. package/dist/entities/message-transfer.js +83 -0
  150. package/dist/entities/message-write.d.ts +191 -0
  151. package/dist/entities/message-write.js +8 -0
  152. package/dist/entities/model-key.d.ts +14 -0
  153. package/dist/entities/model-key.js +10 -0
  154. package/dist/entities/poll.d.ts +40 -0
  155. package/dist/entities/poll.js +16 -0
  156. package/dist/entities/private-contact.d.ts +10 -0
  157. package/dist/entities/private-contact.js +4 -0
  158. package/dist/entities/reaction-change.d.ts +7 -0
  159. package/dist/entities/reaction-change.js +8 -0
  160. package/dist/entities/recipient.d.ts +29 -0
  161. package/dist/entities/recipient.js +11 -0
  162. package/dist/entities/recorded-run.d.ts +103 -0
  163. package/dist/entities/recorded-run.js +44 -0
  164. package/dist/entities/saved-search.d.ts +4 -0
  165. package/dist/entities/saved-search.js +2 -0
  166. package/dist/entities/send-attempt.d.ts +31 -0
  167. package/dist/entities/send-attempt.js +29 -0
  168. package/dist/entities/store-maintenance.d.ts +319 -0
  169. package/dist/entities/store-maintenance.js +145 -0
  170. package/dist/entities/store-records.d.ts +442 -0
  171. package/dist/entities/store-records.js +99 -0
  172. package/dist/entities/tag-change.d.ts +74 -0
  173. package/dist/entities/tag-change.js +31 -0
  174. package/dist/entities/task-pair.d.ts +31 -0
  175. package/dist/entities/task-pair.js +23 -0
  176. package/dist/entities/task-results.d.ts +524 -0
  177. package/dist/entities/task-results.js +142 -0
  178. package/dist/errors/reasons.js +1 -0
  179. package/dist/mcp/agent.d.ts +3 -1
  180. package/dist/mcp/agent.js +9 -6
  181. package/dist/mcp/bot/server.d.ts +2 -0
  182. package/dist/mcp/bot/server.js +1 -0
  183. package/dist/mcp/server.js +3 -1
  184. package/dist/mcp/tools/attachments.js +1 -0
  185. package/dist/meetings/cli/index.js +1 -1
  186. package/dist/meetings/cli/passage.js +1 -0
  187. package/dist/meetings/index.d.ts +2 -1
  188. package/dist/meetings/index.js +1 -0
  189. package/dist/meetings/links.d.ts +16 -0
  190. package/dist/meetings/mcp/index.d.ts +15 -15
  191. package/dist/meetings/read-answers.d.ts +167 -0
  192. package/dist/meetings/read-answers.js +183 -0
  193. package/dist/runs/run.d.ts +10 -2
  194. package/dist/runs/run.js +11 -3
  195. package/dist/sends/journal.d.ts +8 -1
  196. package/dist/sends/journal.js +9 -2
  197. package/dist/sends/permissions.d.ts +5 -1
  198. package/dist/sends/permissions.js +11 -1
  199. package/dist/sends/recipients.d.ts +8 -0
  200. package/dist/sends/recipients.js +9 -0
  201. package/dist/services/admin-statistics.js +3 -3
  202. package/dist/services/chat-documents.d.ts +1 -0
  203. package/dist/services/chat-documents.js +9 -3
  204. package/dist/services/chats.d.ts +1 -1
  205. package/dist/services/chats.js +5 -2
  206. package/dist/services/meeting-links.d.ts +2 -17
  207. package/dist/store/exports.d.ts +1 -1
  208. package/dist/store/exports.js +1 -1
  209. package/dist/store/messages.d.ts +3 -1
  210. package/dist/store/messages.js +2 -2
  211. package/dist/store/roster.d.ts +4 -1
  212. package/dist/store/roster.js +2 -2
  213. package/dist/store/sqlite/chats.d.ts +12 -0
  214. package/dist/store/sqlite/chats.js +1 -0
  215. package/dist/store/sqlite/document-links.d.ts +1 -1
  216. package/dist/store/sqlite/document-links.js +5 -5
  217. package/dist/store/sqlite/involvements.js +2 -1
  218. package/dist/store/sqlite/roster.d.ts +2 -1
  219. package/dist/store/sqlite/roster.js +3 -2
  220. package/package.json +1 -1
  221. package/parity.json +8 -66
@@ -0,0 +1,96 @@
1
+ import * as v from "valibot";
2
+ /** Resource/image MCP responses put bytes in a separate content block; CLI JSON carries base64 here. */
3
+ export declare const attachmentBytes: v.StrictObjectSchema<{
4
+ readonly ref: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, "a reference such as `note:42`">]>;
5
+ readonly attachment: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>;
6
+ readonly name: v.NullableSchema<v.StringSchema<undefined>, undefined>;
7
+ readonly mime_type: v.StringSchema<undefined>;
8
+ readonly total_bytes: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>;
9
+ readonly sha256: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, undefined>]>;
10
+ readonly offset_bytes: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>;
11
+ readonly read_bytes: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>;
12
+ readonly next_offset_bytes: v.NullableSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>, undefined>;
13
+ readonly complete: v.BooleanSchema<undefined>;
14
+ readonly base64: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
15
+ readonly pdf: v.OptionalSchema<v.StrictObjectSchema<{
16
+ readonly page: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>;
17
+ readonly page_count: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>;
18
+ readonly source_sha256: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, undefined>]>;
19
+ readonly source_bytes: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>;
20
+ }, undefined>, undefined>;
21
+ }, undefined>;
22
+ /** JSON reports all files and totals; JSONL streams each extraction item. */
23
+ export declare const attachmentExtraction: v.UnionSchema<[v.StrictObjectSchema<{
24
+ readonly extracted: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>;
25
+ readonly failed: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>;
26
+ readonly needs_agent: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>;
27
+ readonly complete: v.BooleanSchema<undefined>;
28
+ readonly batch: v.OptionalSchema<v.StrictObjectSchema<{
29
+ readonly attempted: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>;
30
+ readonly succeeded: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>;
31
+ readonly failed: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>;
32
+ readonly error_rate: v.NumberSchema<undefined>;
33
+ readonly failures: v.ArraySchema<v.StrictObjectSchema<{
34
+ readonly id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>;
35
+ readonly stage: v.StringSchema<undefined>;
36
+ readonly error: v.ObjectWithRestSchema<{
37
+ readonly code: v.StringSchema<undefined>;
38
+ readonly message: v.StringSchema<undefined>;
39
+ readonly retryable: v.BooleanSchema<undefined>;
40
+ readonly retry_after_ms: v.OptionalSchema<v.NumberSchema<undefined>, undefined>;
41
+ }, v.UnknownSchema, undefined>;
42
+ readonly attachment: v.OptionalSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>, undefined>;
43
+ }, undefined>, undefined>;
44
+ readonly stop_reason: v.OptionalSchema<v.PicklistSchema<["rate_limited", "authentication", "error_rate", "cancelled"], undefined>, undefined>;
45
+ readonly max_error_percent: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>;
46
+ }, undefined>, undefined>;
47
+ readonly unchanged: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>;
48
+ readonly not_downloaded: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>;
49
+ readonly unsupported: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>;
50
+ readonly engines_missing: v.ArraySchema<v.StringSchema<undefined>, undefined>;
51
+ readonly cursor: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
52
+ readonly files: v.ArraySchema<v.StrictObjectSchema<{
53
+ readonly ref: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, "a reference such as `note:42`">]>;
54
+ readonly attachment: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>;
55
+ readonly kind: v.StringSchema<undefined>;
56
+ readonly name: v.NullableSchema<v.StringSchema<undefined>, undefined>;
57
+ readonly status: v.PicklistSchema<["extracted", "needs-agent", "unreadable", "engine-missing", "too-large", "missing"], undefined>;
58
+ readonly extractor: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
59
+ readonly chars: v.OptionalSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>, undefined>;
60
+ readonly local_path: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
61
+ readonly pages: v.OptionalSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>, undefined>;
62
+ readonly ocr_pages: v.OptionalSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>, undefined>;
63
+ readonly error: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
64
+ readonly issue: v.OptionalSchema<v.ObjectWithRestSchema<{
65
+ readonly code: v.StringSchema<undefined>;
66
+ readonly message: v.StringSchema<undefined>;
67
+ readonly retryable: v.BooleanSchema<undefined>;
68
+ readonly retry_after_ms: v.OptionalSchema<v.NumberSchema<undefined>, undefined>;
69
+ }, v.UnknownSchema, undefined>, undefined>;
70
+ }, undefined>, undefined>;
71
+ }, undefined>, v.StrictObjectSchema<{
72
+ readonly ref: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, "a reference such as `note:42`">]>;
73
+ readonly attachment: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>;
74
+ readonly kind: v.StringSchema<undefined>;
75
+ readonly name: v.NullableSchema<v.StringSchema<undefined>, undefined>;
76
+ readonly status: v.PicklistSchema<["extracted", "needs-agent", "unreadable", "engine-missing", "too-large", "missing"], undefined>;
77
+ readonly extractor: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
78
+ readonly chars: v.OptionalSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>, undefined>;
79
+ readonly local_path: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
80
+ readonly pages: v.OptionalSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>, undefined>;
81
+ readonly ocr_pages: v.OptionalSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>, undefined>;
82
+ readonly error: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
83
+ readonly issue: v.OptionalSchema<v.ObjectWithRestSchema<{
84
+ readonly code: v.StringSchema<undefined>;
85
+ readonly message: v.StringSchema<undefined>;
86
+ readonly retryable: v.BooleanSchema<undefined>;
87
+ readonly retry_after_ms: v.OptionalSchema<v.NumberSchema<undefined>, undefined>;
88
+ }, v.UnknownSchema, undefined>, undefined>;
89
+ }, undefined>], undefined>;
90
+ export declare const attachmentTextChange: v.StrictObjectSchema<{
91
+ readonly ref: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, "a reference such as `note:42`">]>;
92
+ readonly attachment: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>;
93
+ readonly origin: v.LiteralSchema<"agent", undefined>;
94
+ readonly chars: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>;
95
+ readonly replaced: v.NullableSchema<v.PicklistSchema<["extracted", "agent"], undefined>, undefined>;
96
+ }, undefined>;
@@ -0,0 +1,31 @@
1
+ import * as v from "valibot";
2
+ import { extractionItem, extractionReport } from "./extraction-report.js";
3
+ import { count, reference, text } from "./fields.js";
4
+ const fingerprint = v.pipe(text, v.regex(/^[a-f0-9]{64}$/));
5
+ /** Resource/image MCP responses put bytes in a separate content block; CLI JSON carries base64 here. */
6
+ export const attachmentBytes = v.strictObject({
7
+ ref: reference,
8
+ attachment: count,
9
+ name: v.nullable(text),
10
+ mime_type: text,
11
+ total_bytes: count,
12
+ sha256: fingerprint,
13
+ offset_bytes: count,
14
+ read_bytes: count,
15
+ next_offset_bytes: v.nullable(count),
16
+ complete: v.boolean(),
17
+ base64: v.optional(text),
18
+ pdf: v.optional(v.strictObject({ page: count, page_count: count, source_sha256: fingerprint, source_bytes: count })),
19
+ });
20
+ /** JSON reports all files and totals; JSONL streams each extraction item. */
21
+ export const attachmentExtraction = v.union([
22
+ v.strictObject({ ...v.omit(extractionReport, ["items"]).entries, files: v.array(extractionItem) }),
23
+ extractionItem,
24
+ ]);
25
+ export const attachmentTextChange = v.strictObject({
26
+ ref: reference,
27
+ attachment: count,
28
+ origin: v.literal("agent"),
29
+ chars: count,
30
+ replaced: v.nullable(v.picklist(["extracted", "agent"])),
31
+ });
@@ -0,0 +1,27 @@
1
+ import * as v from "valibot";
2
+ /** Per-item recovery retains the diagnostic fields the provider supplied. */
3
+ export declare const actionableError: v.ObjectWithRestSchema<{
4
+ readonly code: v.StringSchema<undefined>;
5
+ readonly message: v.StringSchema<undefined>;
6
+ readonly retryable: v.BooleanSchema<undefined>;
7
+ readonly retry_after_ms: v.OptionalSchema<v.NumberSchema<undefined>, undefined>;
8
+ }, v.UnknownSchema, undefined>;
9
+ export declare const batchResult: v.StrictObjectSchema<{
10
+ readonly attempted: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>;
11
+ readonly succeeded: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>;
12
+ readonly failed: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>;
13
+ readonly error_rate: v.NumberSchema<undefined>;
14
+ readonly failures: v.ArraySchema<v.StrictObjectSchema<{
15
+ readonly id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>;
16
+ readonly stage: v.StringSchema<undefined>;
17
+ readonly error: v.ObjectWithRestSchema<{
18
+ readonly code: v.StringSchema<undefined>;
19
+ readonly message: v.StringSchema<undefined>;
20
+ readonly retryable: v.BooleanSchema<undefined>;
21
+ readonly retry_after_ms: v.OptionalSchema<v.NumberSchema<undefined>, undefined>;
22
+ }, v.UnknownSchema, undefined>;
23
+ readonly attachment: v.OptionalSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>, undefined>;
24
+ }, undefined>, undefined>;
25
+ readonly stop_reason: v.OptionalSchema<v.PicklistSchema<["rate_limited", "authentication", "error_rate", "cancelled"], undefined>, undefined>;
26
+ readonly max_error_percent: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>;
27
+ }, undefined>;
@@ -0,0 +1,18 @@
1
+ import * as v from "valibot";
2
+ import { count, id, text } from "./fields.js";
3
+ /** Per-item recovery retains the diagnostic fields the provider supplied. */
4
+ export const actionableError = v.objectWithRest({
5
+ code: text,
6
+ message: text,
7
+ retryable: v.boolean(),
8
+ retry_after_ms: v.optional(v.number()),
9
+ }, v.unknown());
10
+ export const batchResult = v.strictObject({
11
+ attempted: count,
12
+ succeeded: count,
13
+ failed: count,
14
+ error_rate: v.number(),
15
+ failures: v.array(v.strictObject({ id, stage: text, error: actionableError, attachment: v.optional(count) })),
16
+ stop_reason: v.optional(v.picklist(["rate_limited", "authentication", "error_rate", "cancelled"])),
17
+ max_error_percent: count,
18
+ });
@@ -0,0 +1,234 @@
1
+ import * as v from "valibot";
2
+ /** Administrative receipts retain their raw group card, distinct from a formatted chats show item. */
3
+ export declare const chatGroupChange: v.UnionSchema<[v.StrictObjectSchema<{
4
+ readonly operation_id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>;
5
+ readonly chat: v.StrictObjectSchema<{
6
+ readonly id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>;
7
+ readonly title: v.NullableSchema<v.StringSchema<undefined>, undefined>;
8
+ readonly kind: v.PicklistSchema<["dialog", "group", "channel", "saved", "unknown"], undefined>;
9
+ readonly unread_count: v.NullableSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>, undefined>;
10
+ readonly unread_mentions: v.OptionalSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>, undefined>;
11
+ readonly last_message_at: v.NullableSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.IsoTimestampAction<string, "an ISO 8601 time in UTC">, v.EndsWithAction<string, "Z", "an ISO 8601 time in UTC, ending in `Z`">]>, undefined>;
12
+ readonly participants_count: v.NullableSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>, undefined>;
13
+ readonly muted: v.OptionalSchema<v.BooleanSchema<undefined>, undefined>;
14
+ readonly archived: v.OptionalSchema<v.BooleanSchema<undefined>, undefined>;
15
+ readonly marked_unread: v.OptionalSchema<v.BooleanSchema<undefined>, undefined>;
16
+ readonly membership_state: v.OptionalSchema<v.PicklistSchema<["joined", "left", "public", "imported", "archived", "external"], undefined>, undefined>;
17
+ readonly scope: v.OptionalSchema<v.PicklistSchema<["personal", "work"], undefined>, undefined>;
18
+ readonly provider_metadata: v.OptionalSchema<v.RecordSchema<v.StringSchema<undefined>, v.UnknownSchema, undefined>, undefined>;
19
+ readonly parent_chat_id: v.OptionalSchema<v.NullableSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>, undefined>, undefined>;
20
+ readonly muted_until: v.OptionalSchema<v.NullableSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.IsoTimestampAction<string, "an ISO 8601 time in UTC">, v.EndsWithAction<string, "Z", "an ISO 8601 time in UTC, ending in `Z`">]>, undefined>, undefined>;
21
+ readonly description: v.NullableSchema<v.StringSchema<undefined>, undefined>;
22
+ readonly link: v.NullableSchema<v.StringSchema<undefined>, undefined>;
23
+ readonly settings: v.StrictObjectSchema<{
24
+ readonly join_approval: v.OptionalSchema<v.NullableSchema<v.BooleanSchema<undefined>, undefined>, undefined>;
25
+ readonly only_admins_send: v.OptionalSchema<v.NullableSchema<v.BooleanSchema<undefined>, undefined>, undefined>;
26
+ readonly only_admins_edit_info: v.OptionalSchema<v.NullableSchema<v.BooleanSchema<undefined>, undefined>, undefined>;
27
+ readonly disappearing_seconds: v.OptionalSchema<v.NullableSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>, undefined>, undefined>;
28
+ readonly all_can_pin: v.NullableSchema<v.BooleanSchema<undefined>, undefined>;
29
+ readonly only_admins_add: v.NullableSchema<v.BooleanSchema<undefined>, undefined>;
30
+ readonly only_admins_call: v.NullableSchema<v.BooleanSchema<undefined>, undefined>;
31
+ readonly only_owner_edits_info: v.NullableSchema<v.BooleanSchema<undefined>, undefined>;
32
+ readonly members_see_link: v.NullableSchema<v.BooleanSchema<undefined>, undefined>;
33
+ }, undefined>;
34
+ }, undefined>;
35
+ }, undefined>, v.StrictObjectSchema<{
36
+ readonly operation_id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>;
37
+ readonly requested: v.LiteralSchema<true, undefined>;
38
+ }, undefined>], undefined>;
39
+ export declare const chatInspection: v.StrictObjectSchema<{
40
+ readonly kind: v.PicklistSchema<["dialog", "group", "channel", "saved", "unknown"], undefined>;
41
+ readonly title: v.NullableSchema<v.StringSchema<undefined>, undefined>;
42
+ readonly id: v.NullableSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>, undefined>;
43
+ readonly username: v.NullableSchema<v.StringSchema<undefined>, undefined>;
44
+ readonly participants_count: v.NullableSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>, undefined>;
45
+ readonly description: v.NullableSchema<v.StringSchema<undefined>, undefined>;
46
+ readonly member: v.NullableSchema<v.BooleanSchema<undefined>, undefined>;
47
+ readonly approval_needed: v.OptionalSchema<v.BooleanSchema<undefined>, undefined>;
48
+ }, undefined>;
49
+ export declare const chatSender: v.StrictObjectSchema<{
50
+ readonly id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>;
51
+ readonly title: v.StringSchema<undefined>;
52
+ readonly kind: v.PicklistSchema<["self", "channel", "group"], undefined>;
53
+ readonly premium_required: v.BooleanSchema<undefined>;
54
+ readonly default: v.BooleanSchema<undefined>;
55
+ }, undefined>;
56
+ export declare const chatRead: v.StrictObjectSchema<{
57
+ readonly operation_id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>;
58
+ readonly chat_id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>;
59
+ readonly until: v.NullableSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>, undefined>;
60
+ readonly thread_id: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>, undefined>;
61
+ }, undefined>;
62
+ export declare const chatMembersFetch: v.StrictObjectSchema<{
63
+ readonly chat_id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>;
64
+ readonly joined: v.ArraySchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>, undefined>;
65
+ readonly gone: v.ArraySchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>, undefined>;
66
+ readonly changed: v.ArraySchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>, undefined>;
67
+ readonly read: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>;
68
+ readonly participants: v.NullableSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>, undefined>;
69
+ readonly complete: v.BooleanSchema<undefined>;
70
+ readonly more: v.BooleanSchema<undefined>;
71
+ readonly tracked: v.BooleanSchema<undefined>;
72
+ }, undefined>;
73
+ export declare const chatMembersChange: v.UnionSchema<[v.StrictObjectSchema<{
74
+ readonly operation_id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>;
75
+ readonly chat_id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>;
76
+ readonly added: v.ArraySchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>, undefined>;
77
+ readonly not_added: v.ArraySchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>, undefined>;
78
+ }, undefined>, v.StrictObjectSchema<{
79
+ readonly operation_id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>;
80
+ readonly chat_id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>;
81
+ readonly removed: v.ArraySchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>, undefined>;
82
+ }, undefined>], undefined>;
83
+ export declare const chatInvite: v.StrictObjectSchema<{
84
+ readonly chat_id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>;
85
+ readonly title: v.NullableSchema<v.StringSchema<undefined>, undefined>;
86
+ readonly link: v.StringSchema<undefined>;
87
+ }, undefined>;
88
+ export declare const chatInviteChange: v.StrictObjectSchema<{
89
+ readonly link: v.StringSchema<undefined>;
90
+ readonly approval: v.BooleanSchema<undefined>;
91
+ readonly expires_at: v.NullableSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.IsoTimestampAction<string, "an ISO 8601 time in UTC">, v.EndsWithAction<string, "Z", "an ISO 8601 time in UTC, ending in `Z`">]>, undefined>;
92
+ readonly max_uses: v.NullableSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>, undefined>;
93
+ readonly primary: v.OptionalSchema<v.BooleanSchema<undefined>, undefined>;
94
+ readonly revoked: v.OptionalSchema<v.BooleanSchema<undefined>, undefined>;
95
+ readonly operation_id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>;
96
+ readonly chat_id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>;
97
+ readonly pending: v.OptionalSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>, undefined>;
98
+ readonly joined: v.OptionalSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>, undefined>;
99
+ }, undefined>;
100
+ export declare const chatRequestChange: v.UnionSchema<[v.StrictObjectSchema<{
101
+ readonly operation_id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>;
102
+ readonly chat_id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>;
103
+ readonly person_id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>;
104
+ readonly accepted: v.BooleanSchema<undefined>;
105
+ readonly already: v.BooleanSchema<undefined>;
106
+ }, undefined>, v.StrictObjectSchema<{
107
+ readonly chat_id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>;
108
+ readonly accepted: v.BooleanSchema<undefined>;
109
+ readonly counted: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>;
110
+ readonly operation_id: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>, undefined>;
111
+ }, undefined>], undefined>;
112
+ export declare const chatAdminChange: v.StrictObjectSchema<{
113
+ readonly operation_id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>;
114
+ readonly chat_id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>;
115
+ readonly person_id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>;
116
+ readonly rights: v.OptionalSchema<v.ArraySchema<v.PicklistSchema<["read", "members", "admins", "info", "pin", "link", "post", "edit", "delete"], undefined>, undefined>, undefined>;
117
+ }, undefined>;
118
+ export declare const chatFolderChange: v.StrictObjectSchema<{
119
+ readonly operation_id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>;
120
+ readonly folder: Omit<v.StrictObjectSchema<{
121
+ readonly id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>;
122
+ readonly title: v.StringSchema<undefined>;
123
+ readonly chat_ids: v.ArraySchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>, undefined>;
124
+ readonly emoji: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
125
+ readonly include: v.OptionalSchema<v.ArraySchema<v.PicklistSchema<["contacts", "non-contacts", "groups", "channels", "bots"], undefined>, undefined>, undefined>;
126
+ readonly skip: v.OptionalSchema<v.ArraySchema<v.PicklistSchema<["muted", "read", "archived"], undefined>, undefined>, undefined>;
127
+ readonly excluded_chat_ids: v.OptionalSchema<v.ArraySchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>, undefined>, undefined>;
128
+ readonly pinned_chat_ids: v.OptionalSchema<v.ArraySchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>, undefined>, undefined>;
129
+ readonly chats: v.OptionalSchema<v.ArraySchema<v.StrictObjectSchema<{
130
+ readonly id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>;
131
+ readonly title: v.NullableSchema<v.StringSchema<undefined>, undefined>;
132
+ readonly kind: v.NullableSchema<v.PicklistSchema<["dialog", "group", "channel", "saved", "unknown"], undefined>, undefined>;
133
+ }, undefined>, undefined>, undefined>;
134
+ readonly pinned_chats: v.OptionalSchema<v.ArraySchema<v.StrictObjectSchema<{
135
+ readonly id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>;
136
+ readonly title: v.NullableSchema<v.StringSchema<undefined>, undefined>;
137
+ readonly kind: v.NullableSchema<v.PicklistSchema<["dialog", "group", "channel", "saved", "unknown"], undefined>, undefined>;
138
+ }, undefined>, undefined>, undefined>;
139
+ readonly excluded_chats: v.OptionalSchema<v.ArraySchema<v.StrictObjectSchema<{
140
+ readonly id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>;
141
+ readonly title: v.NullableSchema<v.StringSchema<undefined>, undefined>;
142
+ readonly kind: v.NullableSchema<v.PicklistSchema<["dialog", "group", "channel", "saved", "unknown"], undefined>, undefined>;
143
+ }, undefined>, undefined>, undefined>;
144
+ }, undefined>, "entries" | "~run" | "~standard" | "~types"> & {
145
+ readonly entries: Omit<{
146
+ readonly id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>;
147
+ readonly title: v.StringSchema<undefined>;
148
+ readonly chat_ids: v.ArraySchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>, undefined>;
149
+ readonly emoji: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
150
+ readonly include: v.OptionalSchema<v.ArraySchema<v.PicklistSchema<["contacts", "non-contacts", "groups", "channels", "bots"], undefined>, undefined>, undefined>;
151
+ readonly skip: v.OptionalSchema<v.ArraySchema<v.PicklistSchema<["muted", "read", "archived"], undefined>, undefined>, undefined>;
152
+ readonly excluded_chat_ids: v.OptionalSchema<v.ArraySchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>, undefined>, undefined>;
153
+ readonly pinned_chat_ids: v.OptionalSchema<v.ArraySchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>, undefined>, undefined>;
154
+ readonly chats: v.OptionalSchema<v.ArraySchema<v.StrictObjectSchema<{
155
+ readonly id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>;
156
+ readonly title: v.NullableSchema<v.StringSchema<undefined>, undefined>;
157
+ readonly kind: v.NullableSchema<v.PicklistSchema<["dialog", "group", "channel", "saved", "unknown"], undefined>, undefined>;
158
+ }, undefined>, undefined>, undefined>;
159
+ readonly pinned_chats: v.OptionalSchema<v.ArraySchema<v.StrictObjectSchema<{
160
+ readonly id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>;
161
+ readonly title: v.NullableSchema<v.StringSchema<undefined>, undefined>;
162
+ readonly kind: v.NullableSchema<v.PicklistSchema<["dialog", "group", "channel", "saved", "unknown"], undefined>, undefined>;
163
+ }, undefined>, undefined>, undefined>;
164
+ readonly excluded_chats: v.OptionalSchema<v.ArraySchema<v.StrictObjectSchema<{
165
+ readonly id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>;
166
+ readonly title: v.NullableSchema<v.StringSchema<undefined>, undefined>;
167
+ readonly kind: v.NullableSchema<v.PicklistSchema<["dialog", "group", "channel", "saved", "unknown"], undefined>, undefined>;
168
+ }, undefined>, undefined>, undefined>;
169
+ }, "chats" | "excluded_chats" | "pinned_chats">;
170
+ readonly "~standard": v.StandardProps<{
171
+ id: string;
172
+ title: string;
173
+ chat_ids: string[];
174
+ emoji?: string | undefined;
175
+ include?: ("bots" | "channels" | "contacts" | "groups" | "non-contacts")[] | undefined;
176
+ skip?: ("archived" | "muted" | "read")[] | undefined;
177
+ excluded_chat_ids?: string[] | undefined;
178
+ pinned_chat_ids?: string[] | undefined;
179
+ }, {
180
+ id: string;
181
+ title: string;
182
+ chat_ids: string[];
183
+ emoji?: string | undefined;
184
+ include?: ("bots" | "channels" | "contacts" | "groups" | "non-contacts")[] | undefined;
185
+ skip?: ("archived" | "muted" | "read")[] | undefined;
186
+ excluded_chat_ids?: string[] | undefined;
187
+ pinned_chat_ids?: string[] | undefined;
188
+ }>;
189
+ readonly "~run": (dataset: v.UnknownDataset, config: v.Config<v.BaseIssue<unknown>>) => v.OutputDataset<{
190
+ id: string;
191
+ title: string;
192
+ chat_ids: string[];
193
+ emoji?: string | undefined;
194
+ include?: ("bots" | "channels" | "contacts" | "groups" | "non-contacts")[] | undefined;
195
+ skip?: ("archived" | "muted" | "read")[] | undefined;
196
+ excluded_chat_ids?: string[] | undefined;
197
+ pinned_chat_ids?: string[] | undefined;
198
+ }, v.ArrayIssue | v.MinLengthIssue<string, 1> | v.PicklistIssue | v.StrictObjectIssue | v.StringIssue>;
199
+ readonly "~types"?: {
200
+ readonly input: {
201
+ id: string;
202
+ title: string;
203
+ chat_ids: string[];
204
+ emoji?: string | undefined;
205
+ include?: ("bots" | "channels" | "contacts" | "groups" | "non-contacts")[] | undefined;
206
+ skip?: ("archived" | "muted" | "read")[] | undefined;
207
+ excluded_chat_ids?: string[] | undefined;
208
+ pinned_chat_ids?: string[] | undefined;
209
+ };
210
+ readonly output: {
211
+ id: string;
212
+ title: string;
213
+ chat_ids: string[];
214
+ emoji?: string | undefined;
215
+ include?: ("bots" | "channels" | "contacts" | "groups" | "non-contacts")[] | undefined;
216
+ skip?: ("archived" | "muted" | "read")[] | undefined;
217
+ excluded_chat_ids?: string[] | undefined;
218
+ pinned_chat_ids?: string[] | undefined;
219
+ };
220
+ readonly issue: v.ArrayIssue | v.MinLengthIssue<string, 1> | v.PicklistIssue | v.StrictObjectIssue | v.StringIssue;
221
+ } | undefined;
222
+ };
223
+ }, undefined>;
224
+ export declare const chatFolderRemoval: v.StrictObjectSchema<{
225
+ readonly operation_id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>;
226
+ readonly folder_id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>;
227
+ }, undefined>;
228
+ export declare const chatFolderOrder: v.StrictObjectSchema<{
229
+ readonly operation_id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>;
230
+ readonly folders: v.ArraySchema<v.StrictObjectSchema<{
231
+ readonly id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>;
232
+ readonly title: v.StringSchema<undefined>;
233
+ }, undefined>, undefined>;
234
+ }, undefined>;
@@ -0,0 +1,84 @@
1
+ import * as v from "valibot";
2
+ import { chat } from "./chat.js";
3
+ import { count, id, text, time } from "./fields.js";
4
+ import { folder } from "./folder.js";
5
+ import { inviteLink } from "./invite-link.js";
6
+ const operated = { operation_id: id, chat_id: id };
7
+ const group = v.strictObject({
8
+ ...v.omit(chat, ["ref", "provider", "account", "invite_link", "members"]).entries,
9
+ parent_chat_id: v.optional(v.nullable(id)),
10
+ muted_until: v.optional(v.nullable(time)),
11
+ description: v.nullable(text),
12
+ link: v.nullable(text),
13
+ settings: v.strictObject({
14
+ ...v.unwrap(chat.entries.settings).entries,
15
+ all_can_pin: v.nullable(v.boolean()),
16
+ only_admins_add: v.nullable(v.boolean()),
17
+ only_admins_call: v.nullable(v.boolean()),
18
+ only_owner_edits_info: v.nullable(v.boolean()),
19
+ members_see_link: v.nullable(v.boolean()),
20
+ }),
21
+ });
22
+ /** Administrative receipts retain their raw group card, distinct from a formatted chats show item. */
23
+ export const chatGroupChange = v.union([
24
+ v.strictObject({ operation_id: id, chat: group }),
25
+ v.strictObject({ operation_id: id, requested: v.literal(true) }),
26
+ ]);
27
+ export const chatInspection = v.strictObject({
28
+ kind: chat.entries.kind,
29
+ title: v.nullable(text),
30
+ id: v.nullable(id),
31
+ username: v.nullable(text),
32
+ participants_count: v.nullable(count),
33
+ description: v.nullable(text),
34
+ member: v.nullable(v.boolean()),
35
+ approval_needed: v.optional(v.boolean()),
36
+ });
37
+ export const chatSender = v.strictObject({
38
+ id,
39
+ title: text,
40
+ kind: v.picklist(["self", "channel", "group"]),
41
+ premium_required: v.boolean(),
42
+ default: v.boolean(),
43
+ });
44
+ export const chatRead = v.strictObject({ ...operated, until: v.nullable(id), thread_id: v.optional(id) });
45
+ export const chatMembersFetch = v.strictObject({
46
+ chat_id: id,
47
+ joined: v.array(id),
48
+ gone: v.array(id),
49
+ changed: v.array(id),
50
+ read: count,
51
+ participants: v.nullable(count),
52
+ complete: v.boolean(),
53
+ more: v.boolean(),
54
+ tracked: v.boolean(),
55
+ });
56
+ export const chatMembersChange = v.union([
57
+ v.strictObject({ ...operated, added: v.array(id), not_added: v.array(id) }),
58
+ v.strictObject({ ...operated, removed: v.array(id) }),
59
+ ]);
60
+ export const chatInvite = v.strictObject({ chat_id: id, title: v.nullable(text), link: text });
61
+ export const chatInviteChange = v.strictObject({
62
+ ...operated,
63
+ ...v.omit(inviteLink, ["pending_count", "joined_count"]).entries,
64
+ pending: v.optional(count),
65
+ joined: v.optional(count),
66
+ });
67
+ export const chatRequestChange = v.union([
68
+ v.strictObject({ ...operated, person_id: id, accepted: v.boolean(), already: v.boolean() }),
69
+ v.strictObject({ chat_id: id, accepted: v.boolean(), counted: count, operation_id: v.optional(id) }),
70
+ ]);
71
+ export const chatAdminChange = v.strictObject({
72
+ ...operated,
73
+ person_id: id,
74
+ rights: v.optional(v.array(v.picklist(["read", "members", "admins", "info", "pin", "link", "post", "edit", "delete"]))),
75
+ });
76
+ export const chatFolderChange = v.strictObject({
77
+ operation_id: id,
78
+ folder: v.omit(folder, ["chats", "pinned_chats", "excluded_chats"]),
79
+ });
80
+ export const chatFolderRemoval = v.strictObject({ operation_id: id, folder_id: id });
81
+ export const chatFolderOrder = v.strictObject({
82
+ operation_id: id,
83
+ folders: v.array(v.strictObject({ id, title: text })),
84
+ });
@@ -0,0 +1,25 @@
1
+ import * as v from "valibot";
2
+ export declare const chatRemoval: v.StrictObjectSchema<{
3
+ operation_id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>;
4
+ chat_id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>;
5
+ }, undefined>;
6
+ export declare const chatMuting: v.StrictObjectSchema<{
7
+ readonly operation_id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>;
8
+ readonly chat_id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>;
9
+ readonly muted_until: v.NullableSchema<v.UnionSchema<[v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.IsoTimestampAction<string, "an ISO 8601 time in UTC">, v.EndsWithAction<string, "Z", "an ISO 8601 time in UTC, ending in `Z`">]>, v.LiteralSchema<"forever", undefined>], undefined>, undefined>;
10
+ }, undefined>;
11
+ export declare const chatArchive: v.StrictObjectSchema<{
12
+ readonly operation_id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>;
13
+ readonly chat_id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>;
14
+ readonly archived: v.BooleanSchema<undefined>;
15
+ }, undefined>;
16
+ export declare const chatPin: v.StrictObjectSchema<{
17
+ readonly operation_id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>;
18
+ readonly chat_id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>;
19
+ readonly pinned: v.BooleanSchema<undefined>;
20
+ }, undefined>;
21
+ export declare const chatUnread: v.StrictObjectSchema<{
22
+ readonly operation_id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>;
23
+ readonly chat_id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>;
24
+ readonly unread: v.LiteralSchema<true, undefined>;
25
+ }, undefined>;
@@ -0,0 +1,11 @@
1
+ import * as v from "valibot";
2
+ import { id, time } from "./fields.js";
3
+ const operated = { operation_id: id, chat_id: id };
4
+ export const chatRemoval = v.strictObject(operated);
5
+ export const chatMuting = v.strictObject({
6
+ ...operated,
7
+ muted_until: v.nullable(v.union([time, v.literal("forever")])),
8
+ });
9
+ export const chatArchive = v.strictObject({ ...operated, archived: v.boolean() });
10
+ export const chatPin = v.strictObject({ ...operated, pinned: v.boolean() });
11
+ export const chatUnread = v.strictObject({ ...operated, unread: v.literal(true) });
@@ -0,0 +1,34 @@
1
+ import * as v from "valibot";
2
+ export declare const chatMetadata: v.StrictObjectSchema<{
3
+ readonly chat_id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>;
4
+ readonly title: v.NullableSchema<v.StringSchema<undefined>, undefined>;
5
+ readonly username: v.NullableSchema<v.StringSchema<undefined>, undefined>;
6
+ readonly description: v.NullableSchema<v.StringSchema<undefined>, undefined>;
7
+ readonly fetched_at: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.IsoTimestampAction<string, "an ISO 8601 time in UTC">, v.EndsWithAction<string, "Z", "an ISO 8601 time in UTC, ending in `Z`">]>;
8
+ }, undefined>;
9
+ export declare const cachedChatMetadata: v.StrictObjectSchema<{
10
+ readonly chat_id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>;
11
+ readonly metadata: v.NullableSchema<v.StrictObjectSchema<{
12
+ readonly chat_id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>;
13
+ readonly title: v.NullableSchema<v.StringSchema<undefined>, undefined>;
14
+ readonly username: v.NullableSchema<v.StringSchema<undefined>, undefined>;
15
+ readonly description: v.NullableSchema<v.StringSchema<undefined>, undefined>;
16
+ readonly fetched_at: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.IsoTimestampAction<string, "an ISO 8601 time in UTC">, v.EndsWithAction<string, "Z", "an ISO 8601 time in UTC, ending in `Z`">]>;
17
+ }, undefined>, undefined>;
18
+ }, undefined>;
19
+ export declare const chatMetadataRefresh: v.StrictObjectSchema<{
20
+ readonly chats: v.ArraySchema<v.UnionSchema<[v.StrictObjectSchema<{
21
+ readonly chat_id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>;
22
+ readonly title: v.NullableSchema<v.StringSchema<undefined>, undefined>;
23
+ readonly username: v.NullableSchema<v.StringSchema<undefined>, undefined>;
24
+ readonly description: v.NullableSchema<v.StringSchema<undefined>, undefined>;
25
+ readonly fetched_at: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.IsoTimestampAction<string, "an ISO 8601 time in UTC">, v.EndsWithAction<string, "Z", "an ISO 8601 time in UTC, ending in `Z`">]>;
26
+ }, undefined>, v.StrictObjectSchema<{
27
+ readonly chat_id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>;
28
+ readonly error: v.StrictObjectSchema<{
29
+ readonly code: v.StringSchema<undefined>;
30
+ readonly message: v.StringSchema<undefined>;
31
+ }, undefined>;
32
+ }, undefined>], undefined>, undefined>;
33
+ readonly has_more: v.BooleanSchema<undefined>;
34
+ }, undefined>;
@@ -0,0 +1,15 @@
1
+ import * as v from "valibot";
2
+ import { id, text, time } from "./fields.js";
3
+ export const chatMetadata = v.strictObject({
4
+ chat_id: id,
5
+ title: v.nullable(text),
6
+ username: v.nullable(text),
7
+ description: v.nullable(text),
8
+ fetched_at: time,
9
+ });
10
+ export const cachedChatMetadata = v.strictObject({ chat_id: id, metadata: v.nullable(chatMetadata) });
11
+ const failedChatMetadata = v.strictObject({ chat_id: id, error: v.strictObject({ code: text, message: text }) });
12
+ export const chatMetadataRefresh = v.strictObject({
13
+ chats: v.array(v.union([chatMetadata, failedChatMetadata])),
14
+ has_more: v.boolean(),
15
+ });