@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,44 @@
1
+ import * as v from "valibot";
2
+ export declare const chatRules: 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 file: v.StringSchema<undefined>;
6
+ readonly saved: v.BooleanSchema<undefined>;
7
+ readonly rules: v.StrictObjectSchema<{
8
+ readonly title: v.NullableSchema<v.StringSchema<undefined>, undefined>;
9
+ readonly trusted: v.ArraySchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>, undefined>;
10
+ readonly blocked: v.ArraySchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>, undefined>;
11
+ readonly blocked_names: v.ArraySchema<v.StringSchema<undefined>, undefined>;
12
+ readonly links: v.PicklistSchema<["report", "delete", "remove"], undefined>;
13
+ readonly invites: v.PicklistSchema<["report", "delete", "remove"], undefined>;
14
+ readonly forwards: v.PicklistSchema<["report", "delete", "remove"], undefined>;
15
+ readonly blocked_people: v.PicklistSchema<["report", "delete", "remove"], undefined>;
16
+ readonly flood: v.StrictObjectSchema<{
17
+ readonly messages: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>;
18
+ readonly minutes: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>;
19
+ readonly action: v.PicklistSchema<["report", "delete", "remove"], undefined>;
20
+ }, undefined>;
21
+ readonly new_account: v.StrictObjectSchema<{
22
+ readonly days: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>;
23
+ readonly action: v.PicklistSchema<["report", "remove"], undefined>;
24
+ }, undefined>;
25
+ readonly consent: v.StrictObjectSchema<{
26
+ readonly delete: v.PicklistSchema<["deny", "readonly", "ask", "allow"], undefined>;
27
+ readonly remove: v.PicklistSchema<["deny", "readonly", "ask", "allow"], undefined>;
28
+ }, undefined>;
29
+ }, undefined>;
30
+ }, undefined>;
31
+ export declare const chatModeration: v.StrictObjectSchema<{
32
+ readonly chat_id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>;
33
+ readonly rows: v.ArraySchema<v.StrictObjectSchema<{
34
+ readonly kind: v.PicklistSchema<["message", "member"], undefined>;
35
+ readonly rule: v.PicklistSchema<["blocked", "invites", "links", "forwards", "flood", "newAccount"], undefined>;
36
+ readonly person_id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>;
37
+ readonly person_name: v.NullableSchema<v.StringSchema<undefined>, undefined>;
38
+ readonly message_id: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>, undefined>;
39
+ readonly action: v.PicklistSchema<["report", "delete", "remove"], undefined>;
40
+ readonly outcome: v.PicklistSchema<["reported", "done", "planned", "forbidden", "declined", "refused", "failed", "skipped"], undefined>;
41
+ readonly reason: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
42
+ readonly command: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
43
+ }, undefined>, undefined>;
44
+ }, undefined>;
@@ -0,0 +1,37 @@
1
+ import * as v from "valibot";
2
+ import { count, id, text } from "./fields.js";
3
+ const action = v.picklist(["report", "delete", "remove"]);
4
+ const level = v.picklist(["deny", "readonly", "ask", "allow"]);
5
+ export const chatRules = v.strictObject({
6
+ chat_id: id,
7
+ title: v.nullable(text),
8
+ file: text,
9
+ saved: v.boolean(),
10
+ rules: v.strictObject({
11
+ title: v.nullable(text),
12
+ trusted: v.array(id),
13
+ blocked: v.array(id),
14
+ blocked_names: v.array(text),
15
+ links: action,
16
+ invites: action,
17
+ forwards: action,
18
+ blocked_people: action,
19
+ flood: v.strictObject({ messages: count, minutes: count, action }),
20
+ new_account: v.strictObject({ days: count, action: v.picklist(["report", "remove"]) }),
21
+ consent: v.strictObject({ delete: level, remove: level }),
22
+ }),
23
+ });
24
+ export const chatModeration = v.strictObject({
25
+ chat_id: id,
26
+ rows: v.array(v.strictObject({
27
+ kind: v.picklist(["message", "member"]),
28
+ rule: v.picklist(["blocked", "invites", "links", "forwards", "flood", "newAccount"]),
29
+ person_id: id,
30
+ person_name: v.nullable(text),
31
+ message_id: v.optional(id),
32
+ action,
33
+ outcome: v.picklist(["reported", "done", "planned", "forbidden", "declined", "refused", "failed", "skipped"]),
34
+ reason: v.optional(text),
35
+ command: v.optional(text),
36
+ })),
37
+ });
@@ -0,0 +1,26 @@
1
+ import * as v from "valibot";
2
+ export declare const trackedChat: 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 tracked_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`">]>;
6
+ readonly last_count: v.NullableSchema<v.StrictObjectSchema<{
7
+ readonly day: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.IsoDateAction<string, undefined>]>;
8
+ readonly participants: v.NullableSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>, undefined>;
9
+ readonly listed: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>;
10
+ readonly complete: v.BooleanSchema<undefined>;
11
+ }, undefined>, undefined>;
12
+ }, undefined>;
13
+ export declare const trackedChatHistory: v.StrictObjectSchema<{
14
+ readonly chat_id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>;
15
+ readonly tracked_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>;
16
+ readonly counts: v.ArraySchema<v.StrictObjectSchema<{
17
+ readonly day: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.IsoDateAction<string, undefined>]>;
18
+ readonly participants: v.NullableSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>, undefined>;
19
+ readonly listed: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>;
20
+ readonly complete: v.BooleanSchema<undefined>;
21
+ }, undefined>, undefined>;
22
+ }, undefined>;
23
+ export declare const chatTracking: v.StrictObjectSchema<{
24
+ readonly chat_id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>;
25
+ readonly tracked: v.BooleanSchema<undefined>;
26
+ }, undefined>;
@@ -0,0 +1,23 @@
1
+ import * as v from "valibot";
2
+ import { count, id, text, time } from "./fields.js";
3
+ const memberCount = v.strictObject({
4
+ day: v.pipe(text, v.isoDate()),
5
+ participants: v.nullable(count),
6
+ listed: count,
7
+ complete: v.boolean(),
8
+ });
9
+ export const trackedChat = v.strictObject({
10
+ chat_id: id,
11
+ title: v.nullable(text),
12
+ tracked_at: time,
13
+ last_count: v.nullable(memberCount),
14
+ });
15
+ export const trackedChatHistory = v.strictObject({
16
+ chat_id: id,
17
+ tracked_at: v.nullable(time),
18
+ counts: v.array(memberCount),
19
+ });
20
+ export const chatTracking = v.strictObject({
21
+ chat_id: id,
22
+ tracked: v.boolean(),
23
+ });
@@ -0,0 +1,52 @@
1
+ import * as v from "valibot";
2
+ export declare const linkedPerson: v.StrictObjectSchema<{
3
+ readonly uid: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>;
4
+ readonly name: v.NullableSchema<v.StringSchema<undefined>, undefined>;
5
+ readonly identities: v.ArraySchema<v.StrictObjectSchema<{
6
+ readonly provider: v.StringSchema<undefined>;
7
+ readonly id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>;
8
+ readonly name: v.NullableSchema<v.StringSchema<undefined>, undefined>;
9
+ readonly username: v.NullableSchema<v.StringSchema<undefined>, undefined>;
10
+ readonly is_bot: v.NullableSchema<v.BooleanSchema<undefined>, undefined>;
11
+ readonly accounts: v.ArraySchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>, undefined>;
12
+ readonly method: v.StringSchema<undefined>;
13
+ readonly linked_by: v.StringSchema<undefined>;
14
+ readonly linked_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`">]>;
15
+ }, undefined>, undefined>;
16
+ }, undefined>;
17
+ export declare const contactActivity: v.StrictObjectSchema<{
18
+ readonly 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`">]>;
19
+ readonly subject: v.StringSchema<undefined>;
20
+ readonly subject_id: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>;
21
+ readonly role: v.StringSchema<undefined>;
22
+ readonly scope: v.StringSchema<undefined>;
23
+ readonly provider: v.NullableSchema<v.StringSchema<undefined>, undefined>;
24
+ readonly account: v.NullableSchema<v.StringSchema<undefined>, undefined>;
25
+ readonly chat_id: v.NullableSchema<v.StringSchema<undefined>, undefined>;
26
+ readonly locator: v.NullableSchema<v.StringSchema<undefined>, undefined>;
27
+ readonly project_id: v.NullableSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>, undefined>;
28
+ }, undefined>;
29
+ export declare const contactCheck: v.StrictObjectSchema<{
30
+ readonly person: v.StrictObjectSchema<{
31
+ readonly id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>;
32
+ readonly name: v.NullableSchema<v.StringSchema<undefined>, undefined>;
33
+ readonly username: v.NullableSchema<v.StringSchema<undefined>, undefined>;
34
+ readonly provider: v.StringSchema<undefined>;
35
+ }, undefined>;
36
+ readonly score: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>;
37
+ readonly reasons: v.ArraySchema<v.StrictObjectSchema<{
38
+ readonly reason: v.PicklistSchema<import("../botcheck/reasons.js").BotReason[], undefined>;
39
+ readonly weight: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>;
40
+ readonly source: v.StringSchema<undefined>;
41
+ readonly detail: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
42
+ }, undefined>, undefined>;
43
+ readonly registries: v.ArraySchema<v.StrictObjectSchema<{
44
+ readonly name: v.PicklistSchema<["cas", "lols"], undefined>;
45
+ readonly answer: v.PicklistSchema<["listed", "clean", "unknown"], undefined>;
46
+ readonly checked_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`">]>;
47
+ readonly detail: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
48
+ readonly reasons: v.OptionalSchema<v.ArraySchema<v.PicklistSchema<["cas_banned", "lols_banned", "lols_scammer"], undefined>, undefined>, undefined>;
49
+ }, undefined>, undefined>;
50
+ readonly unknown: v.ArraySchema<v.PicklistSchema<import("../botcheck/reasons.js").BotReason[], undefined>, undefined>;
51
+ readonly checked_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`">]>;
52
+ }, undefined>;
@@ -0,0 +1,42 @@
1
+ import * as v from "valibot";
2
+ import { WEIGHTS } from "../botcheck/reasons.js";
3
+ import { count, id, text, time } from "./fields.js";
4
+ const linkedIdentity = v.strictObject({
5
+ provider: text,
6
+ id,
7
+ name: v.nullable(text),
8
+ username: v.nullable(text),
9
+ is_bot: v.nullable(v.boolean()),
10
+ accounts: v.array(id),
11
+ method: text,
12
+ linked_by: text,
13
+ linked_at: time,
14
+ });
15
+ export const linkedPerson = v.strictObject({ uid: id, name: v.nullable(text), identities: v.array(linkedIdentity) });
16
+ export const contactActivity = v.strictObject({
17
+ at: time,
18
+ subject: text,
19
+ subject_id: count,
20
+ role: text,
21
+ scope: text,
22
+ provider: v.nullable(text),
23
+ account: v.nullable(text),
24
+ chat_id: v.nullable(text),
25
+ locator: v.nullable(text),
26
+ project_id: v.nullable(count),
27
+ });
28
+ const botReason = v.picklist(Object.keys(WEIGHTS));
29
+ export const contactCheck = v.strictObject({
30
+ person: v.strictObject({ id, name: v.nullable(text), username: v.nullable(text), provider: text }),
31
+ score: count,
32
+ reasons: v.array(v.strictObject({ reason: botReason, weight: count, source: text, detail: v.optional(text) })),
33
+ registries: v.array(v.strictObject({
34
+ name: v.picklist(["cas", "lols"]),
35
+ answer: v.picklist(["listed", "clean", "unknown"]),
36
+ checked_at: time,
37
+ detail: v.optional(text),
38
+ reasons: v.optional(v.array(v.picklist(["cas_banned", "lols_banned", "lols_scammer"]))),
39
+ })),
40
+ unknown: v.array(botReason),
41
+ checked_at: time,
42
+ });