@wirecat/cli-core 0.554.0 → 0.556.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 (75) hide show
  1. package/CHANGELOG.md +58 -0
  2. package/dist/calendar/mcp/index.d.ts +12 -12
  3. package/dist/cli/config-command.js +64 -2
  4. package/dist/cli/config-issues.d.ts +2 -0
  5. package/dist/cli/config-issues.js +11 -3
  6. package/dist/cli/config-repair.d.ts +26 -0
  7. package/dist/cli/config-repair.js +252 -0
  8. package/dist/cli/messenger/catch-up-answers.d.ts +50 -1
  9. package/dist/cli/messenger/catch-up-answers.js +2 -1
  10. package/dist/cli/messenger/catch-up.d.ts +6 -2
  11. package/dist/cli/messenger/catch-up.js +11 -2
  12. package/dist/cli/messenger/conversation-answers.d.ts +3 -0
  13. package/dist/cli/messenger/inbox.js +1 -1
  14. package/dist/cli/messenger/message-answers.d.ts +3 -0
  15. package/dist/cli/messenger/message-writes.d.ts +6 -0
  16. package/dist/cli/messenger/points.d.ts +9 -4
  17. package/dist/cli/messenger/points.js +10 -4
  18. package/dist/cli/messenger/review.js +1 -1
  19. package/dist/cli/messenger/store-maintenance-command.d.ts +1 -1
  20. package/dist/cli/messenger/tasks-analysis-command.d.ts +8 -0
  21. package/dist/cli/messenger/tasks-analysis-command.js +184 -0
  22. package/dist/cli/messenger/tasks-command.js +11 -2
  23. package/dist/cli/steps.js +10 -0
  24. package/dist/domain/models.d.ts +4 -0
  25. package/dist/entities/contact-context.d.ts +6 -0
  26. package/dist/entities/conversation-results.d.ts +6 -0
  27. package/dist/entities/evidence.d.ts +24 -0
  28. package/dist/entities/index.d.ts +327 -5
  29. package/dist/entities/index.js +6 -2
  30. package/dist/entities/listener.d.ts +12 -0
  31. package/dist/entities/message-context.d.ts +9 -0
  32. package/dist/entities/message-write.d.ts +12 -0
  33. package/dist/entities/message.d.ts +6 -0
  34. package/dist/entities/message.js +6 -0
  35. package/dist/entities/store-records.d.ts +3 -0
  36. package/dist/entities/task-results.d.ts +72 -0
  37. package/dist/entities/task-results.js +40 -1
  38. package/dist/errors/reasons.d.ts +1 -1
  39. package/dist/errors/reasons.js +9 -0
  40. package/dist/mail/cli/index.d.ts +3 -1
  41. package/dist/mail/cli/index.js +7 -1
  42. package/dist/mail/cli/marks.d.ts +26 -0
  43. package/dist/mail/cli/marks.js +51 -0
  44. package/dist/mail/cli/review.d.ts +24 -0
  45. package/dist/mail/cli/review.js +274 -0
  46. package/dist/mail/index.d.ts +3 -0
  47. package/dist/mail/index.js +3 -0
  48. package/dist/mail/marks.d.ts +56 -0
  49. package/dist/mail/marks.js +178 -0
  50. package/dist/mail/owed.d.ts +11 -0
  51. package/dist/mail/owed.js +14 -0
  52. package/dist/mail/review.d.ts +37 -0
  53. package/dist/mail/review.js +118 -0
  54. package/dist/sends/permissions.js +1 -0
  55. package/dist/services/agenda-mail.d.ts +15 -0
  56. package/dist/services/agenda-mail.js +66 -0
  57. package/dist/services/agenda.d.ts +4 -0
  58. package/dist/services/agenda.js +17 -7
  59. package/dist/services/task-analysis.d.ts +58 -0
  60. package/dist/services/task-analysis.js +125 -0
  61. package/dist/store/exports.d.ts +2 -1
  62. package/dist/store/exports.js +1 -0
  63. package/dist/store/index.d.ts +1 -1
  64. package/dist/store/sqlite/email-activity.d.ts +93 -0
  65. package/dist/store/sqlite/email-activity.js +109 -0
  66. package/dist/store/sqlite/emails.d.ts +9 -3
  67. package/dist/store/sqlite/emails.js +5 -8
  68. package/dist/store/sqlite/task-analysis-marks.d.ts +7 -0
  69. package/dist/store/sqlite/task-analysis-marks.js +27 -0
  70. package/dist/store/sync.d.ts +5 -1
  71. package/dist/store/sync.js +4 -0
  72. package/dist/store/types.d.ts +25 -0
  73. package/package.json +1 -1
  74. package/parity.json +29 -0
  75. package/skills/follow-ups/SKILL.md +22 -2
@@ -219,6 +219,9 @@ export declare const messageThread: v.StrictObjectSchema<{
219
219
  readonly signals: v.ArraySchema<v.StringSchema<undefined>, undefined>;
220
220
  readonly demoted: v.OptionalSchema<v.LiteralSchema<true, undefined>, undefined>;
221
221
  }, undefined>, undefined>;
222
+ readonly bulk: v.OptionalSchema<v.BooleanSchema<undefined>, undefined>;
223
+ readonly list_id: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
224
+ readonly rule_id: v.OptionalSchema<v.NullableSchema<v.NumberSchema<undefined>, undefined>, undefined>;
222
225
  }, undefined>, undefined>;
223
226
  readonly provider_metadata: v.OptionalSchema<v.RecordSchema<v.StringSchema<undefined>, v.UnknownSchema, undefined>, undefined>;
224
227
  }, undefined>, undefined>;
@@ -460,6 +463,9 @@ export declare const messageContext: v.UnionSchema<[v.StrictObjectSchema<{
460
463
  readonly signals: v.ArraySchema<v.StringSchema<undefined>, undefined>;
461
464
  readonly demoted: v.OptionalSchema<v.LiteralSchema<true, undefined>, undefined>;
462
465
  }, undefined>, undefined>;
466
+ readonly bulk: v.OptionalSchema<v.BooleanSchema<undefined>, undefined>;
467
+ readonly list_id: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
468
+ readonly rule_id: v.OptionalSchema<v.NullableSchema<v.NumberSchema<undefined>, undefined>, undefined>;
463
469
  }, undefined>, undefined>;
464
470
  readonly provider_metadata: v.OptionalSchema<v.RecordSchema<v.StringSchema<undefined>, v.UnknownSchema, undefined>, undefined>;
465
471
  }, undefined>, v.StrictObjectSchema<{
@@ -682,6 +688,9 @@ export declare const messageContext: v.UnionSchema<[v.StrictObjectSchema<{
682
688
  readonly signals: v.ArraySchema<v.StringSchema<undefined>, undefined>;
683
689
  readonly demoted: v.OptionalSchema<v.LiteralSchema<true, undefined>, undefined>;
684
690
  }, undefined>, undefined>;
691
+ readonly bulk: v.OptionalSchema<v.BooleanSchema<undefined>, undefined>;
692
+ readonly list_id: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
693
+ readonly rule_id: v.OptionalSchema<v.NullableSchema<v.NumberSchema<undefined>, undefined>, undefined>;
685
694
  }, undefined>, undefined>;
686
695
  readonly provider_metadata: v.OptionalSchema<v.RecordSchema<v.StringSchema<undefined>, v.UnknownSchema, undefined>, undefined>;
687
696
  }, undefined>, undefined>;
@@ -215,6 +215,9 @@ export declare const messageWrite: v.StrictObjectSchema<{
215
215
  readonly signals: v.ArraySchema<v.StringSchema<undefined>, undefined>;
216
216
  readonly demoted: v.OptionalSchema<v.LiteralSchema<true, undefined>, undefined>;
217
217
  }, undefined>, undefined>;
218
+ readonly bulk: v.OptionalSchema<v.BooleanSchema<undefined>, undefined>;
219
+ readonly list_id: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
220
+ readonly rule_id: v.OptionalSchema<v.NullableSchema<v.NumberSchema<undefined>, undefined>, undefined>;
218
221
  }, undefined>, undefined>;
219
222
  readonly provider_metadata: v.OptionalSchema<v.RecordSchema<v.StringSchema<undefined>, v.UnknownSchema, undefined>, undefined>;
220
223
  }, undefined>;
@@ -433,6 +436,9 @@ export declare const messageWrite: v.StrictObjectSchema<{
433
436
  readonly signals: v.ArraySchema<v.StringSchema<undefined>, undefined>;
434
437
  readonly demoted: v.OptionalSchema<v.LiteralSchema<true, undefined>, undefined>;
435
438
  }, undefined>, undefined>;
439
+ readonly bulk: v.OptionalSchema<v.BooleanSchema<undefined>, undefined>;
440
+ readonly list_id: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
441
+ readonly rule_id: v.OptionalSchema<v.NullableSchema<v.NumberSchema<undefined>, undefined>, undefined>;
436
442
  }, undefined>, undefined>;
437
443
  readonly provider_metadata: v.OptionalSchema<v.RecordSchema<v.StringSchema<undefined>, v.UnknownSchema, undefined>, undefined>;
438
444
  }, undefined>, undefined>, undefined>;
@@ -659,6 +665,9 @@ export declare const messageSend: v.UnionSchema<[v.StrictObjectSchema<{
659
665
  readonly signals: v.ArraySchema<v.StringSchema<undefined>, undefined>;
660
666
  readonly demoted: v.OptionalSchema<v.LiteralSchema<true, undefined>, undefined>;
661
667
  }, undefined>, undefined>;
668
+ readonly bulk: v.OptionalSchema<v.BooleanSchema<undefined>, undefined>;
669
+ readonly list_id: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
670
+ readonly rule_id: v.OptionalSchema<v.NullableSchema<v.NumberSchema<undefined>, undefined>, undefined>;
662
671
  }, undefined>, undefined>;
663
672
  readonly provider_metadata: v.OptionalSchema<v.RecordSchema<v.StringSchema<undefined>, v.UnknownSchema, undefined>, undefined>;
664
673
  }, undefined>;
@@ -877,6 +886,9 @@ export declare const messageSend: v.UnionSchema<[v.StrictObjectSchema<{
877
886
  readonly signals: v.ArraySchema<v.StringSchema<undefined>, undefined>;
878
887
  readonly demoted: v.OptionalSchema<v.LiteralSchema<true, undefined>, undefined>;
879
888
  }, undefined>, undefined>;
889
+ readonly bulk: v.OptionalSchema<v.BooleanSchema<undefined>, undefined>;
890
+ readonly list_id: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
891
+ readonly rule_id: v.OptionalSchema<v.NullableSchema<v.NumberSchema<undefined>, undefined>, undefined>;
880
892
  }, undefined>, undefined>;
881
893
  readonly provider_metadata: v.OptionalSchema<v.RecordSchema<v.StringSchema<undefined>, v.UnknownSchema, undefined>, undefined>;
882
894
  }, undefined>, undefined>, undefined>;
@@ -238,6 +238,12 @@ export declare const message: v.StrictObjectSchema<{
238
238
  readonly signals: v.ArraySchema<v.StringSchema<undefined>, undefined>;
239
239
  readonly demoted: v.OptionalSchema<v.LiteralSchema<true, undefined>, undefined>;
240
240
  }, undefined>, undefined>;
241
+ /** Mail `review`: filed in the mailbox of mail sent to many. */
242
+ readonly bulk: v.OptionalSchema<v.BooleanSchema<undefined>, undefined>;
243
+ /** Mail `review`: its List-Id, `null` when it has none. */
244
+ readonly list_id: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
245
+ /** Mail `review`: the mail rule that decided how it is stored, by its id in `rules list`; `null` when none. */
246
+ readonly rule_id: v.OptionalSchema<v.NullableSchema<v.NumberSchema<undefined>, undefined>, undefined>;
241
247
  }, undefined>, undefined>;
242
248
  readonly provider_metadata: v.OptionalSchema<v.RecordSchema<v.StringSchema<undefined>, v.UnknownSchema, undefined>, undefined>;
243
249
  }, undefined>;
@@ -103,6 +103,12 @@ export const message = v.strictObject({
103
103
  flagged: v.nullable(v.boolean()),
104
104
  /** How much the sender's mail looks like spam, a scam or a robot (memo's score), and why; absent when unscored. */
105
105
  sender_score: v.optional(v.strictObject({ score: v.number(), signals: v.array(text), demoted: v.optional(v.literal(true)) })),
106
+ /** Mail `review`: filed in the mailbox of mail sent to many. */
107
+ bulk: v.optional(v.boolean()),
108
+ /** Mail `review`: its List-Id, `null` when it has none. */
109
+ list_id: v.optional(v.nullable(text)),
110
+ /** Mail `review`: the mail rule that decided how it is stored, by its id in `rules list`; `null` when none. */
111
+ rule_id: v.optional(v.nullable(v.number())),
106
112
  })),
107
113
  provider_metadata: providerMetadata,
108
114
  });
@@ -238,6 +238,9 @@ export declare const storeExport: v.UnionSchema<[v.StrictObjectSchema<{
238
238
  readonly signals: v.ArraySchema<v.StringSchema<undefined>, undefined>;
239
239
  readonly demoted: v.OptionalSchema<v.LiteralSchema<true, undefined>, undefined>;
240
240
  }, undefined>, undefined>;
241
+ readonly bulk: v.OptionalSchema<v.BooleanSchema<undefined>, undefined>;
242
+ readonly list_id: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
243
+ readonly rule_id: v.OptionalSchema<v.NullableSchema<v.NumberSchema<undefined>, undefined>, undefined>;
241
244
  }, undefined>, undefined>;
242
245
  readonly provider_metadata: v.OptionalSchema<v.RecordSchema<v.StringSchema<undefined>, v.UnknownSchema, undefined>, undefined>;
243
246
  }, undefined>, v.StrictObjectSchema<{
@@ -587,3 +587,75 @@ export declare const taskScan: v.StrictObjectSchema<{
587
587
  readonly category: v.NullableSchema<v.StringSchema<undefined>, undefined>;
588
588
  }, undefined>, undefined>;
589
589
  }, undefined>;
590
+ export declare const taskAnalysisMark: v.StrictObjectSchema<{
591
+ readonly chat: v.StringSchema<undefined>;
592
+ readonly from: 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`">]>;
593
+ readonly through: 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`">]>;
594
+ readonly through_id: v.StringSchema<undefined>;
595
+ readonly by: v.StringSchema<undefined>;
596
+ 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`">]>;
597
+ readonly checked_through: 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`">]>;
598
+ 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`">]>;
599
+ }, undefined>;
600
+ export declare const taskAnalysisMarkMoved: v.StrictObjectSchema<{
601
+ readonly chat: v.StringSchema<undefined>;
602
+ readonly from: 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`">]>;
603
+ readonly through: 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`">]>;
604
+ readonly through_id: v.StringSchema<undefined>;
605
+ readonly by: v.StringSchema<undefined>;
606
+ 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`">]>;
607
+ readonly checked_through: 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`">]>;
608
+ 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`">]>;
609
+ readonly moved: v.BooleanSchema<undefined>;
610
+ }, undefined>;
611
+ export declare const taskAnalysis: v.StrictObjectSchema<{
612
+ readonly chat: v.StringSchema<undefined>;
613
+ readonly title: v.NullableSchema<v.StringSchema<undefined>, undefined>;
614
+ readonly kind: v.StringSchema<undefined>;
615
+ readonly newest_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>;
616
+ readonly mark: v.NullableSchema<v.StrictObjectSchema<{
617
+ readonly chat: v.StringSchema<undefined>;
618
+ readonly from: 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`">]>;
619
+ readonly through: 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`">]>;
620
+ readonly through_id: v.StringSchema<undefined>;
621
+ readonly by: v.StringSchema<undefined>;
622
+ 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`">]>;
623
+ readonly checked_through: 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`">]>;
624
+ 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`">]>;
625
+ }, undefined>, undefined>;
626
+ readonly waiting: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>;
627
+ readonly late: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>;
628
+ readonly untrusted: v.OptionalSchema<v.ArraySchema<v.StringSchema<undefined>, undefined>, undefined>;
629
+ }, undefined>;
630
+ export declare const taskReview: v.StrictObjectSchema<{
631
+ readonly chat: v.StringSchema<undefined>;
632
+ readonly from: 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`">]>;
633
+ readonly mark: v.NullableSchema<v.StrictObjectSchema<{
634
+ readonly chat: v.StringSchema<undefined>;
635
+ readonly from: 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`">]>;
636
+ readonly through: 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`">]>;
637
+ readonly through_id: v.StringSchema<undefined>;
638
+ readonly by: v.StringSchema<undefined>;
639
+ 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`">]>;
640
+ readonly checked_through: 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`">]>;
641
+ 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`">]>;
642
+ }, undefined>, undefined>;
643
+ readonly late: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>;
644
+ readonly has_more: v.BooleanSchema<undefined>;
645
+ readonly through: v.NullableSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, "a reference such as `note:42`">]>, undefined>;
646
+ readonly messages: v.ArraySchema<v.StrictObjectSchema<{
647
+ readonly ref: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, "a reference such as `note:42`">]>;
648
+ 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`">]>;
649
+ readonly sender: v.NullableSchema<v.StringSchema<undefined>, undefined>;
650
+ readonly outgoing: v.BooleanSchema<undefined>;
651
+ readonly reply_to: v.NullableSchema<v.StringSchema<undefined>, undefined>;
652
+ readonly text: v.StringSchema<undefined>;
653
+ }, undefined>, undefined>;
654
+ readonly open_tasks: v.ArraySchema<v.StrictObjectSchema<{
655
+ readonly key: v.NullableSchema<v.StringSchema<undefined>, undefined>;
656
+ readonly kind: v.StringSchema<undefined>;
657
+ readonly title: v.NullableSchema<v.StringSchema<undefined>, undefined>;
658
+ readonly source: v.NullableSchema<v.StringSchema<undefined>, undefined>;
659
+ }, undefined>, undefined>;
660
+ readonly untrusted: v.OptionalSchema<v.ArraySchema<v.StringSchema<undefined>, undefined>, undefined>;
661
+ }, undefined>;
@@ -2,7 +2,7 @@ import * as v from "valibot";
2
2
  import { TASK_TYPES } from "../domain/knowledge.js";
3
3
  import { LINK_KINDS, LINK_SOURCES } from "../store/sqlite/link-kinds.js";
4
4
  import { PRIORITY_LABELS, TASK_KINDS, TASK_ORIGINS, TASK_STATES, TASK_VERDICTS } from "../tasks/index.js";
5
- import { count, id, reference, text, time } from "./fields.js";
5
+ import { count, id, reference, text, time, untrusted } from "./fields.js";
6
6
  import { closeSuggestion } from "./task.js";
7
7
  import { taskPair } from "./task-pair.js";
8
8
  const nullableTime = v.nullable(time);
@@ -135,3 +135,42 @@ export const taskScan = v.strictObject({
135
135
  held_chats: v.optional(count),
136
136
  tasks: v.array(v.strictObject({ source: text, kind: v.picklist(TASK_KINDS), category: v.nullable(text) })),
137
137
  });
138
+ export const taskAnalysisMark = v.strictObject({
139
+ chat: text,
140
+ from: time,
141
+ through: time,
142
+ through_id: text,
143
+ by: text,
144
+ checked_at: time,
145
+ checked_through: time,
146
+ at: time,
147
+ });
148
+ export const taskAnalysisMarkMoved = v.strictObject({ ...taskAnalysisMark.entries, moved: v.boolean() });
149
+ export const taskAnalysis = v.strictObject({
150
+ chat: text,
151
+ title: v.nullable(text),
152
+ kind: text,
153
+ newest_at: nullableTime,
154
+ mark: v.nullable(taskAnalysisMark),
155
+ waiting: count,
156
+ late: count,
157
+ untrusted,
158
+ });
159
+ export const taskReview = v.strictObject({
160
+ chat: text,
161
+ from: time,
162
+ mark: v.nullable(taskAnalysisMark),
163
+ late: count,
164
+ has_more: v.boolean(),
165
+ through: v.nullable(reference),
166
+ messages: v.array(v.strictObject({
167
+ ref: reference,
168
+ at: time,
169
+ sender: v.nullable(text),
170
+ outgoing: v.boolean(),
171
+ reply_to: v.nullable(text),
172
+ text,
173
+ })),
174
+ open_tasks: v.array(v.strictObject({ key: v.nullable(text), kind: text, title: v.nullable(text), source: v.nullable(text) })),
175
+ untrusted,
176
+ });
@@ -7,7 +7,7 @@ export declare const REASONS: ErrorReason[];
7
7
  * Detail keys an error from this package may carry, until each is registered on its own reason. Not `cause`:
8
8
  * that can hold a provider's or SQLite's raw text.
9
9
  */
10
- export declare const DETAILS: readonly ["contracts", "calendars", "allowed", "alternative", "arguments", "at", "available", "batch", "budget", "built", "candidates", "chat", "chat_id", "cli", "complete", "emitted_bytes", "exact", "forum", "guide", "hint", "id", "index", "kind", "limit", "limit_source", "max_bytes", "model", "name", "operation_id", "operation_ids", "text_limit", "store_refused_in", "subtasks", "partial_output", "parent", "path", "permission", "person_ids", "previous_chat_id", "profiles", "provider_error", "provider", "recovery", "reference", "remembered", "retry_at", "retry_after_ms", "runtime", "saved", "scheduled_for", "script", "sent", "sent_count", "settlement_failed", "span", "sqlite", "stage", "standing", "state", "stderr", "term", "total", "upgraded", "wanted"];
10
+ export declare const DETAILS: readonly ["contracts", "calendars", "allowed", "alternative", "arguments", "at", "available", "batch", "budget", "built", "candidates", "chat", "chat_id", "cli", "column", "complete", "emitted_bytes", "exact", "file", "forum", "guide", "hint", "id", "index", "kind", "limit", "limit_source", "line", "max_bytes", "model", "name", "operation_id", "operation_ids", "text_limit", "store_refused_in", "subtasks", "partial_output", "parent", "path", "permission", "person_ids", "previous_chat_id", "profiles", "provider_error", "provider", "recovery", "reference", "remembered", "retry_at", "retry_after_ms", "runtime", "saved", "scheduled_for", "script", "sent", "sent_count", "settlement_failed", "span", "sqlite", "stage", "standing", "state", "stderr", "term", "total", "upgraded", "wanted"];
11
11
  /** What a CLI adds to the shared registry: its own reasons, and the detail keys its adapters raise. */
12
12
  export interface AppErrors {
13
13
  reasons?: readonly ErrorReason[];
@@ -57,6 +57,11 @@ const OTHERS = [
57
57
  validation("push.too-many-files", "the folder holds more files than one push takes"),
58
58
  validation("push.unreadable", "the folder to push could not be read"),
59
59
  validation("spreadsheet.unreadable", "the workbook could not be read"),
60
+ [
61
+ "config.unrepairable",
62
+ "configuration_error",
63
+ "the settings file's damage has more than one reading; nothing was changed, so it is fixed by hand",
64
+ ],
60
65
  ["state.invalid", "configuration_error", "the saved sync state is unreadable or invalid; it is kept, not reset"],
61
66
  ["sync.partial", "provider_error", "some calendars did not sync; the next sync retries them"],
62
67
  validation("event.conflict", "the event changed at the provider since the last sync; sync and try again"),
@@ -188,6 +193,7 @@ const OTHERS = [
188
193
  validation("task.has-subtasks", "the task has subtasks; move or detach them before it moves to another project"),
189
194
  validation("task.is-subtask", "a subtask moves to another project only when it is detached from its parent in the same write"),
190
195
  validation("task.duplicate-candidates", "open tasks may be the same job: attach to one, or add it as new"),
196
+ validation("task.already-read", "the message was already read for tasks: a read again only updates and closes tasks unless --open-new"),
191
197
  validation("task.certainty-required", "an agent closes a task with its certainty, 0 to 1"),
192
198
  ["task.pair-decided", "permission_error", "the owner already decided the pair; an agent does not change it"],
193
199
  validation("task.no-close-suggestion", "the task has no agent's close waiting on the owner"),
@@ -245,9 +251,11 @@ export const DETAILS = [
245
251
  "chat",
246
252
  "chat_id",
247
253
  "cli",
254
+ "column",
248
255
  "complete",
249
256
  "emitted_bytes",
250
257
  "exact",
258
+ "file",
251
259
  "forum",
252
260
  "guide",
253
261
  "hint",
@@ -256,6 +264,7 @@ export const DETAILS = [
256
264
  "kind",
257
265
  "limit",
258
266
  "limit_source",
267
+ "line",
259
268
  "max_bytes",
260
269
  "model",
261
270
  "name",
@@ -2,6 +2,8 @@ import { Command } from "commander";
2
2
  import { type MailServerAccess } from "../../mail/server-search.js";
3
3
  import type { AppIdentity } from "../../ports/app.js";
4
4
  import { type AccountKey, type MessageStore } from "../../store/store.js";
5
+ export { mailMark, markItem, markText } from "./marks.js";
6
+ export { MAIL_REVIEW_QUERY, MAIL_REVIEW_STEPS } from "./review.js";
5
7
  /** What a mail CLI hands the shared commands: how to open the store for one run, and whose mail it reads. */
6
8
  export interface MailReads {
7
9
  app: AppIdentity;
@@ -21,7 +23,7 @@ export declare const THREAD_QUERY: {
21
23
  readonly fields: import("@wirecat/cli-base/query").FieldSpec[];
22
24
  };
23
25
  /**
24
- * `search messages`, `messages show` and `conversations list|show` over the mail a mail CLI stored: the same
26
+ * `search messages`, `review`, `messages show` and `conversations list|show` over the mail a mail CLI stored: the same
25
27
  * query language, ranking and answers as memo's mail search, read only, scoped to the profile's mailbox.
26
28
  */
27
29
  export declare const mailReadCommands: (mail: MailReads) => Command[];
@@ -18,6 +18,10 @@ import { searchMailServer } from "../../mail/server-search.js";
18
18
  import { atDetail } from "../../output-detail.js";
19
19
  import { sourceKey } from "../../services/server-search.js";
20
20
  import { queryFilter, THREAD_COLUMNS } from "../../store/store.js";
21
+ import { acknowledgeCommand } from "./marks.js";
22
+ import { mailReviewCommand } from "./review.js";
23
+ export { mailMark, markItem, markText } from "./marks.js";
24
+ export { MAIL_REVIEW_QUERY, MAIL_REVIEW_STEPS } from "./review.js";
21
25
  /** A locked or broken store must fail the command, not read as "nothing stored yet". */
22
26
  const absentAccount = (error) => {
23
27
  if (error instanceof CliError && error.code === "not_found")
@@ -224,6 +228,7 @@ const messagesCommand = (mail) => {
224
228
  ? listOf("messages show", { items: shown, limit: Math.max(1, shown.length), has_more: false })
225
229
  : itemOf(shown.find((_, at) => emails[at]?.anchor) ?? shown[0]), () => shownText(emails));
226
230
  });
231
+ messages.addCommand(acknowledgeCommand(mail));
227
232
  return messages;
228
233
  };
229
234
  const mailThread = v.strictObject({
@@ -323,11 +328,12 @@ const conversationsCommand = (mail) => {
323
328
  return conversations;
324
329
  };
325
330
  /**
326
- * `search messages`, `messages show` and `conversations list|show` over the mail a mail CLI stored: the same
331
+ * `search messages`, `review`, `messages show` and `conversations list|show` over the mail a mail CLI stored: the same
327
332
  * query language, ranking and answers as memo's mail search, read only, scoped to the profile's mailbox.
328
333
  */
329
334
  export const mailReadCommands = sharedCommand((mail) => [
330
335
  searchCommand(mail),
336
+ mailReviewCommand(mail),
331
337
  messagesCommand(mail),
332
338
  conversationsCommand(mail),
333
339
  ]);
@@ -0,0 +1,26 @@
1
+ import { Command } from "commander";
2
+ import * as v from "valibot";
3
+ import { type MailMark } from "../marks.js";
4
+ import type { MailReads } from "./index.js";
5
+ /** A holder's mark as `--json`, `mail status` and MCP show it. */
6
+ export declare const mailMark: v.StrictObjectSchema<{
7
+ readonly holder: v.StringSchema<undefined>;
8
+ readonly through_id: v.NumberSchema<undefined>;
9
+ readonly through_received_at: v.NullableSchema<v.StringSchema<undefined>, undefined>;
10
+ readonly held: v.NumberSchema<undefined>;
11
+ readonly read: v.NumberSchema<undefined>;
12
+ readonly skipped: v.StrictObjectSchema<{
13
+ readonly bulk: v.NumberSchema<undefined>;
14
+ readonly envelope: v.NumberSchema<undefined>;
15
+ readonly partial: v.NumberSchema<undefined>;
16
+ readonly draft: v.NumberSchema<undefined>;
17
+ }, undefined>;
18
+ readonly updated_at: v.StringSchema<undefined>;
19
+ }, undefined>;
20
+ export declare const markItem: (mark: MailMark) => v.InferOutput<typeof mailMark>;
21
+ export declare const markText: (mark: MailMark) => string;
22
+ /**
23
+ * `messages acknowledge`: a holder says it is done with what `review --holder` gave it, and its mark moves there. It
24
+ * only moves the holder's own bookkeeping forward, so a read-only scheduled run may do it.
25
+ */
26
+ export declare const acknowledgeCommand: (mail: MailReads) => Command;
@@ -0,0 +1,51 @@
1
+ import { annotate } from "@wirecat/cli-base/commands";
2
+ import { Command } from "commander";
3
+ import * as v from "valibot";
4
+ import { answerEntity } from "../../cli/answer-entity.js";
5
+ import { outputFor } from "../../cli/context.js";
6
+ import { destroysNothing, LOCAL_WRITE } from "../../cli/effects.js";
7
+ import { itemOf, renderAnswer } from "../../cli/envelope.js";
8
+ import { acknowledgeMark } from "../marks.js";
9
+ const iso = (ms) => (ms === null ? null : new Date(ms).toISOString());
10
+ /** A holder's mark as `--json`, `mail status` and MCP show it. */
11
+ export const mailMark = v.strictObject({
12
+ holder: v.string(),
13
+ through_id: v.number(),
14
+ through_received_at: v.nullable(v.string()),
15
+ held: v.number(),
16
+ read: v.number(),
17
+ skipped: v.strictObject({ bulk: v.number(), envelope: v.number(), partial: v.number(), draft: v.number() }),
18
+ updated_at: v.string(),
19
+ });
20
+ export const markItem = (mark) => ({
21
+ holder: mark.holder,
22
+ through_id: mark.throughId,
23
+ through_received_at: iso(mark.throughAt),
24
+ held: mark.held.length,
25
+ read: mark.read,
26
+ skipped: mark.skipped,
27
+ updated_at: iso(mark.updatedAt),
28
+ });
29
+ export const markText = (mark) => `${mark.holder} through ${mark.throughId}${mark.throughAt === null ? "" : ` (${iso(mark.throughAt)})`} ` +
30
+ `read ${mark.read} held ${mark.held.length} skipped bulk ${mark.skipped.bulk}, envelope ${mark.skipped.envelope}, ` +
31
+ `partial ${mark.skipped.partial}, draft ${mark.skipped.draft} updated ${iso(mark.updatedAt)}\n`;
32
+ /**
33
+ * `messages acknowledge`: a holder says it is done with what `review --holder` gave it, and its mark moves there. It
34
+ * only moves the holder's own bookkeeping forward, so a read-only scheduled run may do it.
35
+ */
36
+ export const acknowledgeCommand = (mail) => answerEntity(destroysNothing(annotate(new Command("acknowledge"), {
37
+ effects: LOCAL_WRITE,
38
+ examples: [
39
+ `${mail.app.command} personal messages acknowledge --holder mail-triage --cursor 9123.1762090000000`,
40
+ ],
41
+ })), "mail_mark", mailMark)
42
+ .summary("move a holder's processing mark to what it has read")
43
+ .description("record that a holder — an agent or a pipeline — processed the mail `review --holder` gave it, with the cursor " +
44
+ "that review gave; the mark only moves forward, and mail still partial waits for the next review")
45
+ .requiredOption("--holder <name>", "whose mark: lower-case letters, digits and dashes, such as mail-triage")
46
+ .requiredOption("--cursor <cursor>", "the cursor `review --holder` gave")
47
+ .action(async function () {
48
+ const { holder, cursor } = this.opts();
49
+ const mark = await mail.read(this, (store, mailbox) => acknowledgeMark(store, mailbox, holder, cursor));
50
+ renderAnswer(this, outputFor(this), itemOf(markItem(mark)), () => markText(mark));
51
+ });
@@ -0,0 +1,24 @@
1
+ import { Command } from "commander";
2
+ import type { MailReads } from "./index.js";
3
+ /** Where a mail review starts: a time only; one thread is `conversations show`. */
4
+ export declare const MAIL_REVIEW_QUERY: import("@wirecat/cli-base/query").QueryRegistry;
5
+ /** The mail review's steps; a host lists them beside its own so its step checks know them. */
6
+ export declare const MAIL_REVIEW_STEPS: ({
7
+ id: string;
8
+ kind: "command";
9
+ command: string;
10
+ args: {
11
+ name: string;
12
+ required: boolean;
13
+ }[];
14
+ why: string;
15
+ } | {
16
+ id: string;
17
+ kind: "user_action";
18
+ why: string;
19
+ })[];
20
+ /**
21
+ * `review` over the stored mail of the profile's mailbox, with tg's words: what is new, what the owner owes, what
22
+ * waits for an answer. It reads the store only and opens no task.
23
+ */
24
+ export declare const mailReviewCommand: (mail: MailReads) => Command;