@wirecat/cli-core 0.377.0 → 0.379.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 (74) hide show
  1. package/CHANGELOG.md +37 -0
  2. package/dist/cli/envelope.d.ts +10 -0
  3. package/dist/cli/list-query.js +2 -2
  4. package/dist/cli/meeting-preparation-read.js +5 -5
  5. package/dist/cli/meeting-series-inventory-read.js +3 -4
  6. package/dist/cli/messenger/contacts-command.js +1 -1
  7. package/dist/cli/messenger/stats-command.js +3 -1
  8. package/dist/context/evidence-response.js +2 -2
  9. package/dist/context/evidence.d.ts +5 -2
  10. package/dist/context/evidence.js +21 -6
  11. package/dist/domain/moment.d.ts +8 -0
  12. package/dist/domain/moment.js +14 -0
  13. package/dist/domain/send-time.d.ts +2 -2
  14. package/dist/domain/send-time.js +4 -3
  15. package/dist/entities/account-session.d.ts +2 -2
  16. package/dist/entities/admin-report.d.ts +8 -8
  17. package/dist/entities/agenda.d.ts +12 -12
  18. package/dist/entities/chat-event.d.ts +1 -1
  19. package/dist/entities/chat-stats.d.ts +5 -5
  20. package/dist/entities/chat.d.ts +4 -4
  21. package/dist/entities/contact-note.d.ts +2 -2
  22. package/dist/entities/contact.d.ts +13 -13
  23. package/dist/entities/conversation.d.ts +3 -3
  24. package/dist/entities/counter-reading.d.ts +1 -1
  25. package/dist/entities/counters.d.ts +2 -2
  26. package/dist/entities/document.d.ts +2 -2
  27. package/dist/entities/evidence.d.ts +72 -72
  28. package/dist/entities/fact.d.ts +3 -3
  29. package/dist/entities/fields.d.ts +3 -1
  30. package/dist/entities/fields.js +2 -0
  31. package/dist/entities/hit.d.ts +1 -1
  32. package/dist/entities/index.d.ts +216 -215
  33. package/dist/entities/index.js +1 -0
  34. package/dist/entities/invite-link.d.ts +1 -1
  35. package/dist/entities/job.d.ts +2 -2
  36. package/dist/entities/join-request.d.ts +1 -1
  37. package/dist/entities/meeting-communications.d.ts +4 -4
  38. package/dist/entities/meeting-findings.d.ts +2 -2
  39. package/dist/entities/meeting-preparation-parts.d.ts +9 -9
  40. package/dist/entities/meeting-preparation.d.ts +23 -23
  41. package/dist/entities/meeting-series-inventory.d.ts +3 -3
  42. package/dist/entities/member.d.ts +3 -3
  43. package/dist/entities/memory.d.ts +3 -3
  44. package/dist/entities/message.d.ts +6 -6
  45. package/dist/entities/note.d.ts +3 -3
  46. package/dist/entities/official-stats.d.ts +2 -2
  47. package/dist/entities/poll-vote.d.ts +1 -1
  48. package/dist/entities/ranking.d.ts +2 -2
  49. package/dist/entities/relationship.d.ts +1 -1
  50. package/dist/entities/retention.d.ts +4 -4
  51. package/dist/entities/saved-search.d.ts +2 -2
  52. package/dist/entities/tagging.d.ts +1 -1
  53. package/dist/entities/task.d.ts +7 -7
  54. package/dist/entities/topic.d.ts +2 -2
  55. package/dist/mcp/tools/stats.js +3 -1
  56. package/dist/meetings/answers.d.ts +14 -14
  57. package/dist/meetings/cli/index.js +7 -4
  58. package/dist/meetings/cli/search.js +11 -13
  59. package/dist/meetings/item.d.ts +4 -4
  60. package/dist/meetings/project-evidence-answer.d.ts +3 -3
  61. package/dist/services/admin-statistics.js +2 -2
  62. package/dist/services/context-evidence.js +1 -0
  63. package/dist/services/index.d.ts +1 -1
  64. package/dist/services/meeting-communications-selection.d.ts +1 -0
  65. package/dist/services/messages-archive-search.js +1 -1
  66. package/dist/services/moment.d.ts +4 -2
  67. package/dist/services/moment.js +13 -4
  68. package/dist/services/project-gathering-request.d.ts +30 -8
  69. package/dist/services/project-gathering-request.js +61 -8
  70. package/dist/services/project-gathering.d.ts +5 -2
  71. package/dist/services/project-gathering.js +11 -5
  72. package/dist/store/sqlite/context-evidence.js +24 -12
  73. package/dist/store/sqlite/facts.js +2 -1
  74. package/package.json +3 -3
package/CHANGELOG.md CHANGED
@@ -7,6 +7,43 @@ shape of this file.
7
7
 
8
8
  ## Unreleased
9
9
 
10
+ ## 0.379.0 — 21.10.2026
11
+
12
+ ### Changed — may break callers
13
+
14
+ - **A typed date or time is read in a zone, and a date alone covers the whole local day** (cli-base `WC-TIME-3`,
15
+ `WC-TIME-5`). `--since-time`, `--until-time`, `--at-time`, `--due`, `--remind-time`, `chats mute --until`, fact
16
+ `occurredAt`, `meetings sync --since-time` and `search meetings --since-time`/`--until-time` used `Date.parse`: a date
17
+ alone was UTC midnight, a time without a zone was the process zone, and `--timezone` was ignored. Now a zone the
18
+ value names wins; otherwise the command's `--timezone` (stats, admin statistics, the MCP `stats` tool), else the
19
+ computer's IANA zone. A date alone starts at local midnight; as an end (`--until-time`) it is the last millisecond
20
+ of that local day, so the day is no longer dropped. A local time that daylight saving skips or repeats is refused.
21
+ List-query `time` terms (`timeBounds`) default to the computer's zone, not UTC. What to watch for: `momentOf` and
22
+ `aheadOf` keep their signature and take an optional `{ zone, end }`; a caller that passed a date alone and expected
23
+ UTC midnight now gets local midnight. `search meetings` now takes a time without an offset instead of refusing it.
24
+ The answers do not name the zone used yet (`meta.timezone`); that follows.
25
+ - **cli-base 0.48.0.** `isoTime` refuses offsets other than `Z`; two input schemas that take a caller's time with any
26
+ offset (meeting preparation, meeting series inventory) use the new `zonedTime` instead. The peer range moves to
27
+ `>=0.48.0 <0.49.0`, and `node-ci.yml` runs the tests in `Asia/Vladivostok`.
28
+
29
+ ## 0.378.0 — 21.10.2026
30
+
31
+ ### Added
32
+
33
+ - **`gatherProjectEvidence` reads what a person wrote.** A person given with `senders: [{ provider, id }]` (their
34
+ stored identities, at most 16; an email identity's id is its address) and a `reference` gets a lane of its own
35
+ (`kinds: ["sender"]`, `query: null`, `senders`): every message or mail one of those identities wrote in the window,
36
+ read only through a selected source of that identity's provider. `name` becomes optional for such a person. An
37
+ item found only that way has `context: "sender"`, ranked between `linked-chat` and `person-only`. The context reader
38
+ takes the same filter as `senders` (`coverage.matching: "sender"`). Requests without senders keep their
39
+ fingerprint, so their checkpoints still resume. See [project gathering](docs/dev/PROJECT-GATHERING.md).
40
+
41
+ ### Fixed
42
+
43
+ - **Discovery search accepts thread context.** `search messages --discover --thread` expands the ranked hits
44
+ through the shared bounded thread reader instead of refusing inside candidate search. Reply provenance,
45
+ time context and thread limits are preserved.
46
+
10
47
  ## 0.377.0 — 20.10.2026
11
48
 
12
49
  ### Added
@@ -84,6 +84,11 @@ export declare const answerSchema: (item?: v.GenericSchema) => v.UnionSchema<[v.
84
84
  readonly source: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, "must not be empty">]>;
85
85
  }, undefined>, undefined>, undefined>;
86
86
  readonly truncated: v.OptionalSchema<v.BooleanSchema<undefined>, undefined>;
87
+ readonly timezone: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, "must not be empty">]>, undefined>;
88
+ readonly window: v.OptionalSchema<v.StrictObjectSchema<{
89
+ readonly since: v.OptionalSchema<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>;
90
+ readonly until: v.OptionalSchema<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>;
91
+ }, undefined>, undefined>;
87
92
  }, undefined>;
88
93
  }, undefined>, v.StrictObjectSchema<{
89
94
  readonly item: v.GenericSchema;
@@ -132,6 +137,11 @@ export declare const answerSchema: (item?: v.GenericSchema) => v.UnionSchema<[v.
132
137
  readonly source: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, "must not be empty">]>;
133
138
  }, undefined>, undefined>, undefined>;
134
139
  readonly truncated: v.OptionalSchema<v.BooleanSchema<undefined>, undefined>;
140
+ readonly timezone: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, "must not be empty">]>, undefined>;
141
+ readonly window: v.OptionalSchema<v.StrictObjectSchema<{
142
+ readonly since: v.OptionalSchema<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>;
143
+ readonly until: v.OptionalSchema<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>;
144
+ }, undefined>, undefined>;
135
145
  }, undefined>;
136
146
  }, undefined>], undefined>;
137
147
  /**
@@ -1,5 +1,5 @@
1
1
  import { annotate } from "@wirecat/cli-base/commands";
2
- import { dateRange, defineQuery, fieldsHelp, fieldsNamed, OPERATORS_BY_TYPE, parseLucene, QUERY_LIMITS, queryError, queryFieldsOf, validateQuery, } from "@wirecat/cli-base/query";
2
+ import { dateRange, defineQuery, fieldsHelp, fieldsNamed, OPERATORS_BY_TYPE, parseLucene, QUERY_LIMITS, queryError, queryFieldsOf, timezoneOf, validateQuery, } from "@wirecat/cli-base/query";
3
3
  import * as v from "valibot";
4
4
  import { queryWordsAfterOptions } from "../meetings/cli/index.js";
5
5
  import { listOf } from "./envelope.js";
@@ -131,7 +131,7 @@ export const queryTerms = (words, registry, command) => {
131
131
  return terms;
132
132
  };
133
133
  /** A `time` term as epoch ms bounds: `time>=7d`, `time:[2026-10-01 TO 2026-10-07]`, `time:today`. */
134
- export const timeBounds = (term, zone = "UTC") => {
134
+ export const timeBounds = (term, zone = timezoneOf()) => {
135
135
  if (!term)
136
136
  return {};
137
137
  const upper = term.operator === "range" ? (term.upper ?? "*") : term.value;
@@ -1,7 +1,7 @@
1
1
  import { CliError } from "@wirecat/cli-base";
2
- import { isoTime } from "@wirecat/cli-base/standards";
3
2
  import * as v from "valibot";
4
3
  import { communicationFields } from "../context/communication-selection.js";
4
+ import { zonedTime } from "../entities/index.js";
5
5
  import { validateMeetingChange } from "../meetings/index.js";
6
6
  import { MEETING_PREPARATION_LIMITS, validateMeetingPreparationRequest, } from "../services/index.js";
7
7
  import { validatePreparationCommunications } from "../services/meeting-communications-selection.js";
@@ -12,11 +12,11 @@ const bound = (name) => {
12
12
  };
13
13
  export const meetingPreparationInput = v.strictObject({
14
14
  series_id: v.pipe(v.string(), v.minLength(1), v.maxLength(1000)),
15
- communications: v.optional(v.strictObject({ ...communicationFields, after: v.optional(isoTime), before: v.optional(isoTime) })),
15
+ communications: v.optional(v.strictObject({ ...communicationFields, after: v.optional(zonedTime), before: v.optional(zonedTime) })),
16
16
  project: v.optional(v.pipe(v.string(), v.minLength(1), v.maxLength(200))),
17
- after: v.optional(isoTime),
18
- until: v.optional(isoTime),
19
- history_after: v.optional(isoTime),
17
+ after: v.optional(zonedTime),
18
+ until: v.optional(zonedTime),
19
+ history_after: v.optional(zonedTime),
20
20
  meetings: bound("meetings"),
21
21
  cues: bound("cues"),
22
22
  context_limit: bound("contextLimit"),
@@ -1,13 +1,12 @@
1
1
  import { CliError } from "@wirecat/cli-base";
2
- import { isoTime } from "@wirecat/cli-base/standards";
3
2
  import * as v from "valibot";
4
- import { meetingSeriesInventory } from "../entities/index.js";
3
+ import { meetingSeriesInventory, zonedTime } from "../entities/index.js";
5
4
  import { validateMeetingChange, validateMeetingSeriesInventoryCursor, } from "../meetings/index.js";
6
5
  import { itemOf, metaNow, sealed, snakeKeys } from "./envelope.js";
7
6
  const bounded = (min, max) => v.optional(v.pipe(v.number(), v.integer(), v.minValue(min), v.maxValue(max)));
8
7
  export const meetingSeriesInventoryInput = v.strictObject({
9
- after: v.optional(isoTime),
10
- until: v.optional(isoTime),
8
+ after: v.optional(zonedTime),
9
+ until: v.optional(zonedTime),
11
10
  limit: bounded(1, 100),
12
11
  max_read_bytes: bounded(1, 1048576),
13
12
  bytes: bounded(2048, 1048576),
@@ -153,7 +153,7 @@ export const contactsCommand = (messenger) => {
153
153
  const found = await context.withServices((services) => services.people.timeline(person, {
154
154
  ...(scope === undefined ? {} : { scope: scope }),
155
155
  ...(sinceTime === undefined ? {} : { since: momentOf(sinceTime, "--since-time") }),
156
- ...(untilTime === undefined ? {} : { until: momentOf(untilTime, "--until-time") }),
156
+ ...(untilTime === undefined ? {} : { until: momentOf(untilTime, "--until-time", Date.now(), { end: true }) }),
157
157
  ...(limit === undefined ? {} : { limit }),
158
158
  ...(cursor === undefined ? {} : { cursor }),
159
159
  }));
@@ -64,7 +64,9 @@ export const statsCommand = (messenger, loadRenderer = chartRenderer) => {
64
64
  const found = await context.withServices((services) => services.chats.stats(chat, {
65
65
  by,
66
66
  timezone,
67
- ...(sinceTime === undefined ? {} : { since: momentOf(sinceTime, "--since-time") }),
67
+ ...(sinceTime === undefined
68
+ ? {}
69
+ : { since: momentOf(sinceTime, "--since-time", Date.now(), { zone: timezone }) }),
68
70
  }));
69
71
  const chart = chatChart(found, { kind: chartKind, by, timezone });
70
72
  let chartFile;
@@ -8,7 +8,7 @@ export const validateContextEvidencePage = (page, request) => {
8
8
  throw new CliError("invalid_response", "context reader returned invalid or out-of-scope evidence");
9
9
  };
10
10
  try {
11
- const { source, chat, after, before, limit, maxReadBytes } = contextEvidenceRequest(request);
11
+ const { source, chat, senders, after, before, limit, maxReadBytes } = contextEvidenceRequest(request);
12
12
  if (!page || contextSourceKey(contextSource(page.source)) !== contextSourceKey(source))
13
13
  fail();
14
14
  if (!Array.isArray(page.items) ||
@@ -23,7 +23,7 @@ export const validateContextEvidencePage = (page, request) => {
23
23
  typeof c.hasMore !== "boolean" ||
24
24
  typeof c.hasUndated !== "boolean" ||
25
25
  !["ready", "pending", "missing", "unknown"].includes(c.index) ||
26
- c.matching !== (chat === undefined ? "literal-words" : "chat") ||
26
+ c.matching !== (chat !== undefined ? "chat" : senders !== undefined ? "sender" : "literal-words") ||
27
27
  c.completeness !== "unknown" ||
28
28
  c.consistency !== "snapshot-per-page")
29
29
  fail();
@@ -12,6 +12,8 @@ export interface ContextEvidenceRequest {
12
12
  query?: string;
13
13
  /** One stored chat or mail thread of the source's account, by its external id; refused for documents and meetings. */
14
14
  chat?: string;
15
+ /** Messages or mail written by these identities of the source's provider (mail: addresses); no query or chat. */
16
+ senders?: string[];
15
17
  after: number;
16
18
  before: number;
17
19
  limit?: number;
@@ -55,7 +57,7 @@ export interface ContextEvidencePage {
55
57
  hasMore: boolean;
56
58
  hasUndated: boolean;
57
59
  completeness: "unknown";
58
- matching: "literal-words" | "chat";
60
+ matching: "literal-words" | "chat" | "sender";
59
61
  consistency: "snapshot-per-page";
60
62
  };
61
63
  }
@@ -83,12 +85,13 @@ export declare const fittingRows: (sizes: readonly number[], limit: number, maxR
83
85
  export interface ContextRecordReader {
84
86
  read(ref: string): Promise<Pick<ContextEvidenceItem, "ref" | "title" | "text" | "revision"> | null>;
85
87
  }
86
- export declare const contextCursorScope: (request: Pick<ContextEvidenceRequest, "source" | "query" | "chat" | "after" | "before">) => string;
88
+ export declare const contextCursorScope: (request: Pick<ContextEvidenceRequest, "source" | "query" | "chat" | "senders" | "after" | "before">) => string;
87
89
  export declare const contextSource: (value: ContextSource) => ContextSource;
88
90
  export declare const contextEvidenceRequest: (input: ContextEvidenceRequest) => {
89
91
  source: ContextSource;
90
92
  query: string | undefined;
91
93
  chat: string | undefined;
94
+ senders: string[] | undefined;
92
95
  words: RegExpMatchArray | [];
93
96
  after: number;
94
97
  before: number;
@@ -29,6 +29,7 @@ export const contextCursorScope = (request) => createHash("sha256")
29
29
  request.before,
30
30
  // Only a chat read hashes its chat, so cursors issued before chat reads existed stay valid.
31
31
  ...(request.chat === undefined ? [] : [request.chat]),
32
+ ...(request.senders === undefined ? [] : [["senders", ...request.senders]]),
32
33
  ]))
33
34
  .digest("hex");
34
35
  const fields = (value, allowed, prefix) => {
@@ -53,7 +54,7 @@ export const contextSource = (value) => {
53
54
  };
54
55
  export const contextEvidenceRequest = (input) => {
55
56
  const source = contextSource(input?.source);
56
- fields(input, ["source", "query", "chat", "after", "before", "limit", "maxReadBytes", "cursor", "signal"], "");
57
+ fields(input, ["source", "query", "chat", "senders", "after", "before", "limit", "maxReadBytes", "cursor", "signal"], "");
57
58
  const integer = (value, name, low, high) => {
58
59
  if (!Number.isSafeInteger(value) || value < low || value > high)
59
60
  throw new CliError("validation_error", `${name} must be a whole number from ${low} to ${high}`);
@@ -72,11 +73,25 @@ export const contextEvidenceRequest = (input) => {
72
73
  if (input.query !== undefined)
73
74
  throw new CliError("validation_error", "a chat read takes no query");
74
75
  }
76
+ const senders = input.senders;
77
+ if (senders !== undefined) {
78
+ if (!Array.isArray(senders) ||
79
+ !senders.length ||
80
+ senders.length > 16 ||
81
+ senders.some((id) => typeof id !== "string" || !id.trim() || Buffer.byteLength(id) > 1024) ||
82
+ new Set(senders).size !== senders.length)
83
+ throw new CliError("validation_error", "senders needs 1–16 distinct identity ids");
84
+ if (source.kind !== "message" && source.kind !== "mail")
85
+ throw new CliError("validation_error", "only a message or mail source reads by sender");
86
+ if (input.query !== undefined || chat !== undefined)
87
+ throw new CliError("validation_error", "a sender read takes no query or chat");
88
+ }
89
+ const bare = chat === undefined && senders === undefined;
75
90
  const query = input.query;
76
- if (chat === undefined && (typeof query !== "string" || !query.trim() || Buffer.byteLength(query) > 2048))
91
+ if (bare && (typeof query !== "string" || !query.trim() || Buffer.byteLength(query) > 2048))
77
92
  throw new CliError("validation_error", "query needs 1–2048 UTF-8 bytes of literal words");
78
93
  const words = query?.match(/[\p{L}\p{N}]+/gu) ?? [];
79
- if (chat === undefined && (!words.length || words.length > 16))
94
+ if (bare && (!words.length || words.length > 16))
80
95
  throw new CliError("validation_error", "query needs 1–16 literal words");
81
96
  const limit = integer(input.limit ?? 10, "limit", 1, 20);
82
97
  const maxReadBytes = integer(input.maxReadBytes ?? 65536, "maxReadBytes", 1, CONTEXT_MAX_READ_BYTES);
@@ -91,7 +106,7 @@ export const contextEvidenceRequest = (input) => {
91
106
  id: integer(input.cursor.id, "cursor.id", 1, Number.MAX_SAFE_INTEGER),
92
107
  scope: input.cursor.scope,
93
108
  };
94
- if (cursor && cursor.scope !== contextCursorScope({ source, query, chat, after, before }))
95
- throw new CliError("validation_error", "cursor belongs to another source, query, chat or time window");
96
- return { source, query, chat, words, after, before, limit, maxReadBytes, cursor, signal: input.signal };
109
+ if (cursor && cursor.scope !== contextCursorScope({ source, query, chat, senders, after, before }))
110
+ throw new CliError("validation_error", "cursor belongs to another source, query, chat, senders or time window");
111
+ return { source, query, chat, senders, words, after, before, limit, maxReadBytes, cursor, signal: input.signal };
97
112
  };
@@ -0,0 +1,8 @@
1
+ export interface MomentZone {
2
+ /** The IANA zone a date or a time without a zone is read in; the computer's zone when left out. */
3
+ zone?: string;
4
+ /** A date alone means the last millisecond of that local day, not its first: the end of a range. */
5
+ end?: boolean;
6
+ }
7
+ /** A typed date or time as epoch ms, with the flag named when it is not one. */
8
+ export declare const calendarMoment: (wanted: string, flag: string, { zone, end }?: MomentZone) => number;
@@ -0,0 +1,14 @@
1
+ import { CliError } from "@wirecat/cli-base";
2
+ import { timezoneOf, zonedMoment } from "@wirecat/cli-base/query";
3
+ /** A typed date or time as epoch ms, with the flag named when it is not one. */
4
+ export const calendarMoment = (wanted, flag, { zone, end = false } = {}) => {
5
+ try {
6
+ return zonedMoment(wanted, timezoneOf(zone), { start: 0, end: wanted.length }, { end });
7
+ }
8
+ catch (error) {
9
+ if (!(error instanceof CliError))
10
+ throw error;
11
+ const alternative = error.details?.alternative;
12
+ throw new CliError("validation_error", `${flag}: "${wanted}" is not a time${alternative ? ` — ${alternative}` : ""}`);
13
+ }
14
+ };
@@ -2,6 +2,6 @@
2
2
  * `--at-time`: a time like `2026-09-25T09:00`, or a delay like `30m`, `2h`, `1d`, as an ISO time — the
3
3
  * same words max-cli takes. Rounded down to the minute, because messengers send at the start of it
4
4
  * (MAX measured, max-cli `FIND-141`), so the time printed is the time it goes. A time without an
5
- * offset is local, which is how `Date.parse` reads one with a clock and no zone.
5
+ * offset is read in `zone`, the computer's zone when none is given.
6
6
  */
7
- export declare const sendTime: (value: string, now?: number, flag?: string) => string;
7
+ export declare const sendTime: (value: string, now?: number, flag?: string, zone?: string) => string;
@@ -1,4 +1,5 @@
1
1
  import { CliError } from "@wirecat/cli-base";
2
+ import { calendarMoment } from "./moment.js";
2
3
  const MINUTE = 60_000;
3
4
  const YEAR = 365 * 24 * 60 * MINUTE;
4
5
  const DELAY = /^(\d+)(m|h|d)$/;
@@ -7,13 +8,13 @@ const UNIT_MS = { m: MINUTE, h: 60 * MINUTE, d: 24 * 60 * MINUTE };
7
8
  * `--at-time`: a time like `2026-09-25T09:00`, or a delay like `30m`, `2h`, `1d`, as an ISO time — the
8
9
  * same words max-cli takes. Rounded down to the minute, because messengers send at the start of it
9
10
  * (MAX measured, max-cli `FIND-141`), so the time printed is the time it goes. A time without an
10
- * offset is local, which is how `Date.parse` reads one with a clock and no zone.
11
+ * offset is read in `zone`, the computer's zone when none is given.
11
12
  */
12
- export const sendTime = (value, now = Date.now(), flag = "--at-time") => {
13
+ export const sendTime = (value, now = Date.now(), flag = "--at-time", zone) => {
13
14
  const trimmed = value.trim();
14
15
  const [, amount, unit] = DELAY.exec(trimmed) ?? [];
15
16
  const at = /^\d{4}-\d{2}-\d{2}[T ]\d{2}:\d{2}/.test(trimmed)
16
- ? Date.parse(trimmed.replace(" ", "T"))
17
+ ? calendarMoment(trimmed.replace(" ", "T"), flag, zone === undefined ? {} : { zone })
17
18
  : amount && unit
18
19
  ? now + Number(amount) * (UNIT_MS[unit] ?? 0)
19
20
  : Number.NaN;
@@ -5,6 +5,6 @@ export declare const accountSession: v.StrictObjectSchema<{
5
5
  readonly client: v.NullableSchema<v.StringSchema<undefined>, undefined>;
6
6
  readonly device: v.NullableSchema<v.StringSchema<undefined>, undefined>;
7
7
  readonly location: v.NullableSchema<v.StringSchema<undefined>, undefined>;
8
- readonly last_active_at: v.NullableSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.IsoTimestampAction<string, "an ISO 8601 time with a zone">]>, undefined>;
9
- readonly created_at: v.OptionalSchema<v.NullableSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.IsoTimestampAction<string, "an ISO 8601 time with a zone">]>, undefined>, undefined>;
8
+ readonly last_active_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>;
9
+ readonly created_at: 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>;
10
10
  }, undefined>;
@@ -13,8 +13,8 @@ export declare const adminRow: v.StrictObjectSchema<{
13
13
  readonly median_ms: v.OptionalSchema<v.NullableSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.MinValueAction<number, 0, undefined>]>, undefined>, undefined>;
14
14
  readonly p90_ms: v.OptionalSchema<v.NullableSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.MinValueAction<number, 0, undefined>]>, undefined>, undefined>;
15
15
  readonly age_ms: v.OptionalSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.MinValueAction<number, 0, undefined>]>, undefined>;
16
- readonly joined_at: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.IsoTimestampAction<string, "an ISO 8601 time with a zone">]>, undefined>;
17
- readonly window_end: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.IsoTimestampAction<string, "an ISO 8601 time with a zone">]>, undefined>;
16
+ readonly joined_at: v.OptionalSchema<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>;
17
+ readonly window_end: v.OptionalSchema<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>;
18
18
  readonly pending: v.OptionalSchema<v.BooleanSchema<undefined>, undefined>;
19
19
  readonly views: v.OptionalSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>, undefined>;
20
20
  readonly observed_replies: v.OptionalSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>, undefined>;
@@ -22,7 +22,7 @@ export declare const adminRow: v.StrictObjectSchema<{
22
22
  readonly counters: v.OptionalSchema<v.ArraySchema<v.StrictObjectSchema<{
23
23
  readonly counter: v.PicklistSchema<["views", "reactions", "comments"], undefined>;
24
24
  readonly value: v.NullableSchema<v.NumberSchema<undefined>, undefined>;
25
- readonly observed_at: v.NullableSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.IsoTimestampAction<string, "an ISO 8601 time with a zone">]>, undefined>;
25
+ readonly observed_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>;
26
26
  readonly source: v.NullableSchema<v.StringSchema<undefined>, undefined>;
27
27
  readonly age_ms: v.NullableSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.MinValueAction<number, 0, undefined>]>, undefined>;
28
28
  readonly freshness: v.PicklistSchema<["fresh", "stale", "unknown"], undefined>;
@@ -32,7 +32,7 @@ export declare const adminRow: v.StrictObjectSchema<{
32
32
  /** One administrator report over stored history: unanswered questions, responses, newcomers or discussion. */
33
33
  export declare const adminReport: v.StrictObjectSchema<{
34
34
  readonly report: v.PicklistSchema<["unanswered", "responses", "newcomers", "discussion"], undefined>;
35
- readonly cutoff: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.IsoTimestampAction<string, "an ISO 8601 time with a zone">]>;
35
+ readonly cutoff: 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`">]>;
36
36
  /** Rows the report found; `rows` holds the first `--limit` of them. */
37
37
  readonly total: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>;
38
38
  readonly summary: v.StrictObjectSchema<{
@@ -54,7 +54,7 @@ export declare const adminReport: v.StrictObjectSchema<{
54
54
  readonly archives: v.ArraySchema<v.StrictObjectSchema<{
55
55
  readonly chat_ref: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, "a reference such as `note:42`">]>;
56
56
  readonly state: v.StringSchema<undefined>;
57
- readonly fetched_at: v.NullableSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.IsoTimestampAction<string, "an ISO 8601 time with a zone">]>, undefined>;
57
+ readonly fetched_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>;
58
58
  }, undefined>, undefined>;
59
59
  readonly archives_total: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>;
60
60
  readonly membership: v.StringSchema<undefined>;
@@ -74,8 +74,8 @@ export declare const adminReport: v.StrictObjectSchema<{
74
74
  readonly median_ms: v.OptionalSchema<v.NullableSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.MinValueAction<number, 0, undefined>]>, undefined>, undefined>;
75
75
  readonly p90_ms: v.OptionalSchema<v.NullableSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.MinValueAction<number, 0, undefined>]>, undefined>, undefined>;
76
76
  readonly age_ms: v.OptionalSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.MinValueAction<number, 0, undefined>]>, undefined>;
77
- readonly joined_at: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.IsoTimestampAction<string, "an ISO 8601 time with a zone">]>, undefined>;
78
- readonly window_end: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.IsoTimestampAction<string, "an ISO 8601 time with a zone">]>, undefined>;
77
+ readonly joined_at: v.OptionalSchema<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>;
78
+ readonly window_end: v.OptionalSchema<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>;
79
79
  readonly pending: v.OptionalSchema<v.BooleanSchema<undefined>, undefined>;
80
80
  readonly views: v.OptionalSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>, undefined>;
81
81
  readonly observed_replies: v.OptionalSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>, undefined>;
@@ -83,7 +83,7 @@ export declare const adminReport: v.StrictObjectSchema<{
83
83
  readonly counters: v.OptionalSchema<v.ArraySchema<v.StrictObjectSchema<{
84
84
  readonly counter: v.PicklistSchema<["views", "reactions", "comments"], undefined>;
85
85
  readonly value: v.NullableSchema<v.NumberSchema<undefined>, undefined>;
86
- readonly observed_at: v.NullableSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.IsoTimestampAction<string, "an ISO 8601 time with a zone">]>, undefined>;
86
+ readonly observed_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>;
87
87
  readonly source: v.NullableSchema<v.StringSchema<undefined>, undefined>;
88
88
  readonly age_ms: v.NullableSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.MinValueAction<number, 0, undefined>]>, undefined>;
89
89
  readonly freshness: v.PicklistSchema<["fresh", "stale", "unknown"], undefined>;
@@ -1,9 +1,9 @@
1
1
  import * as v from "valibot";
2
2
  /** What needs a look today, from the store alone and without one message's text. */
3
3
  export declare const agenda: v.StrictObjectSchema<{
4
- readonly at: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.IsoTimestampAction<string, "an ISO 8601 time with a zone">]>;
4
+ 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`">]>;
5
5
  readonly account: v.StringSchema<undefined>;
6
- readonly stored_at: v.NullableSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.IsoTimestampAction<string, "an ISO 8601 time with a zone">]>, undefined>;
6
+ readonly stored_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>;
7
7
  /** The store saved nothing for a day: a chat may look quiet only because nothing was synced. */
8
8
  readonly stale: v.BooleanSchema<undefined>;
9
9
  readonly tasks: v.ArraySchema<v.StrictObjectSchema<{
@@ -14,20 +14,20 @@ export declare const agenda: v.StrictObjectSchema<{
14
14
  readonly category: v.NullableSchema<v.StringSchema<undefined>, undefined>;
15
15
  /** The message or note it came from. */
16
16
  readonly source: v.NullableSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, "a reference such as `note:42`">]>, undefined>;
17
- readonly due_at: v.NullableSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.IsoTimestampAction<string, "an ISO 8601 time with a zone">]>, undefined>;
18
- readonly next_check_at: v.NullableSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.IsoTimestampAction<string, "an ISO 8601 time with a zone">]>, undefined>;
17
+ readonly due_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>;
18
+ readonly next_check_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>;
19
19
  /** Who works on it now; only the asker's own claims are listed unless the query names claimed:. */
20
20
  readonly claimed_by: v.NullableSchema<v.StringSchema<undefined>, undefined>;
21
- readonly claimed_until: v.NullableSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.IsoTimestampAction<string, "an ISO 8601 time with a zone">]>, undefined>;
21
+ readonly claimed_until: 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>;
22
22
  /** An agent's close waiting on the owner: `tasks close` confirms it, `tasks reject` refuses it. */
23
23
  readonly close_suggestion: v.NullableSchema<v.StrictObjectSchema<{
24
24
  readonly as: v.PicklistSchema<["done", "dismissed"], undefined>;
25
25
  readonly by: v.StringSchema<undefined>;
26
26
  readonly certainty: v.NumberSchema<undefined>;
27
27
  readonly reason: v.NullableSchema<v.StringSchema<undefined>, undefined>;
28
- readonly at: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.IsoTimestampAction<string, "an ISO 8601 time with a zone">]>;
28
+ 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`">]>;
29
29
  }, undefined>, undefined>;
30
- readonly created_at: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.IsoTimestampAction<string, "an ISO 8601 time with a zone">]>;
30
+ readonly created_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`">]>;
31
31
  readonly reasons: v.ArraySchema<v.PicklistSchema<["overdue", "due", "check", "unplanned", "close-suggested"], undefined>, undefined>;
32
32
  }, undefined>, undefined>;
33
33
  /** Someone else wrote last, and the owner has not answered. */
@@ -37,7 +37,7 @@ export declare const agenda: v.StrictObjectSchema<{
37
37
  readonly kind: v.PicklistSchema<["dialog", "group", "channel", "saved", "unknown"], undefined>;
38
38
  /** The newest message, never its text; `null` while it is not stored. */
39
39
  readonly last_message: v.NullableSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, "a reference such as `note:42`">]>, undefined>;
40
- readonly last_message_at: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.IsoTimestampAction<string, "an ISO 8601 time with a zone">]>;
40
+ readonly last_message_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`">]>;
41
41
  /** `null` when the newest message is not stored, or the messenger did not say who sent it. */
42
42
  readonly last_from_owner: v.NullableSchema<v.BooleanSchema<undefined>, undefined>;
43
43
  /** Open tasks whose source is in this chat. */
@@ -50,7 +50,7 @@ export declare const agenda: v.StrictObjectSchema<{
50
50
  readonly kind: v.PicklistSchema<["dialog", "group", "channel", "saved", "unknown"], undefined>;
51
51
  /** The newest message, never its text; `null` while it is not stored. */
52
52
  readonly last_message: v.NullableSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, "a reference such as `note:42`">]>, undefined>;
53
- readonly last_message_at: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.IsoTimestampAction<string, "an ISO 8601 time with a zone">]>;
53
+ readonly last_message_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`">]>;
54
54
  /** `null` when the newest message is not stored, or the messenger did not say who sent it. */
55
55
  readonly last_from_owner: v.NullableSchema<v.BooleanSchema<undefined>, undefined>;
56
56
  /** Open tasks whose source is in this chat. */
@@ -63,7 +63,7 @@ export declare const agenda: v.StrictObjectSchema<{
63
63
  readonly kind: v.PicklistSchema<["dialog", "group", "channel", "saved", "unknown"], undefined>;
64
64
  /** The newest message, never its text; `null` while it is not stored. */
65
65
  readonly last_message: v.NullableSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, "a reference such as `note:42`">]>, undefined>;
66
- readonly last_message_at: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.IsoTimestampAction<string, "an ISO 8601 time with a zone">]>;
66
+ readonly last_message_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`">]>;
67
67
  /** `null` when the newest message is not stored, or the messenger did not say who sent it. */
68
68
  readonly last_from_owner: v.NullableSchema<v.BooleanSchema<undefined>, undefined>;
69
69
  /** Open tasks whose source is in this chat. */
@@ -77,8 +77,8 @@ export declare const agenda: v.StrictObjectSchema<{
77
77
  readonly kind: v.PicklistSchema<readonly ["bug", "feature", "chore", "question", "request", "mention", "promise"], undefined>;
78
78
  readonly category: v.NullableSchema<v.StringSchema<undefined>, undefined>;
79
79
  readonly source: v.NullableSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, "a reference such as `note:42`">]>, undefined>;
80
- readonly due_at: v.NullableSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.IsoTimestampAction<string, "an ISO 8601 time with a zone">]>, undefined>;
81
- readonly created_at: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.IsoTimestampAction<string, "an ISO 8601 time with a zone">]>;
80
+ readonly due_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>;
81
+ readonly created_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`">]>;
82
82
  /** `person:<id>`, each one who does it. */
83
83
  readonly assignees: v.ArraySchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, "a reference such as `note:42`">]>, undefined>;
84
84
  }, undefined>, undefined>;
@@ -2,7 +2,7 @@ import * as v from "valibot";
2
2
  /** Somebody joined, left, was added or removed, or changed their profile, in one chat. */
3
3
  export declare const chatEvent: v.StrictObjectSchema<{
4
4
  readonly chat_id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>;
5
- readonly time: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.IsoTimestampAction<string, "an ISO 8601 time with a zone">]>;
5
+ readonly time: 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
6
  /** `join`, `leave`, `add`, `remove`, `create`, `title`, `pin`, `profile`; a messenger may pass others through. */
7
7
  readonly type: v.StringSchema<undefined>;
8
8
  /** The service message that says so, where there is one. */
@@ -5,8 +5,8 @@ import * as v from "valibot";
5
5
  */
6
6
  export declare const chatStats: v.StrictObjectSchema<{
7
7
  readonly chat: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, "a reference such as `note:42`">]>;
8
- readonly since: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.IsoTimestampAction<string, "an ISO 8601 time with a zone">]>;
9
- readonly until: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.IsoTimestampAction<string, "an ISO 8601 time with a zone">]>;
8
+ readonly since: 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`">]>;
9
+ readonly until: 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`">]>;
10
10
  /** The store holds the chat whole and the messenger read every join and leave; otherwise lower bounds. */
11
11
  readonly complete: v.BooleanSchema<undefined>;
12
12
  readonly completeness: v.StrictObjectSchema<{
@@ -14,7 +14,7 @@ export declare const chatStats: v.StrictObjectSchema<{
14
14
  readonly up_to_date: v.NullableSchema<v.BooleanSchema<undefined>, undefined>;
15
15
  readonly gaps: v.BooleanSchema<undefined>;
16
16
  readonly reaches_start: v.BooleanSchema<undefined>;
17
- readonly fetched_at: v.NullableSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.IsoTimestampAction<string, "an ISO 8601 time with a zone">]>, undefined>;
17
+ readonly fetched_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>;
18
18
  }, undefined>;
19
19
  readonly messages: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>;
20
20
  readonly senders: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>;
@@ -26,7 +26,7 @@ export declare const chatStats: v.StrictObjectSchema<{
26
26
  readonly comments: v.OptionalSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>, undefined>;
27
27
  readonly top_posts: v.ArraySchema<v.StrictObjectSchema<{
28
28
  readonly ref: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, "a reference such as `note:42`">]>;
29
- readonly timestamp: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.IsoTimestampAction<string, "an ISO 8601 time with a zone">]>;
29
+ readonly timestamp: 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`">]>;
30
30
  readonly reactions: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>;
31
31
  readonly views: v.OptionalSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>, undefined>;
32
32
  readonly forwards: v.OptionalSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>, undefined>;
@@ -69,7 +69,7 @@ export declare const taskStats: v.StrictObjectSchema<{
69
69
  readonly rows: v.ArraySchema<v.StrictObjectSchema<{
70
70
  readonly chat: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, "a reference such as `note:42`">]>;
71
71
  readonly open: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>;
72
- readonly oldest_open_at: v.NullableSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.IsoTimestampAction<string, "an ISO 8601 time with a zone">]>, undefined>;
72
+ readonly oldest_open_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>;
73
73
  readonly median_close_ms: v.NullableSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.MinValueAction<number, 0, undefined>]>, undefined>;
74
74
  }, undefined>, undefined>;
75
75
  }, undefined>;
@@ -8,7 +8,7 @@ export declare const chat: v.StrictObjectSchema<{
8
8
  readonly kind: v.PicklistSchema<["dialog", "group", "channel", "saved", "unknown"], undefined>;
9
9
  readonly unread_count: v.NullableSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>, undefined>;
10
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 with a zone">]>, 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
12
  readonly participants_count: v.NullableSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>, undefined>;
13
13
  readonly muted: v.OptionalSchema<v.BooleanSchema<undefined>, undefined>;
14
14
  readonly archived: v.OptionalSchema<v.BooleanSchema<undefined>, undefined>;
@@ -36,9 +36,9 @@ export declare const chat: v.StrictObjectSchema<{
36
36
  readonly name: v.NullableSchema<v.StringSchema<undefined>, undefined>;
37
37
  readonly username: v.NullableSchema<v.StringSchema<undefined>, undefined>;
38
38
  readonly role: v.OptionalSchema<v.PicklistSchema<["owner", "admin", "member"], undefined>, undefined>;
39
- readonly last_seen_at: v.OptionalSchema<v.NullableSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.IsoTimestampAction<string, "an ISO 8601 time with a zone">]>, undefined>, undefined>;
40
- readonly registered_at: v.OptionalSchema<v.NullableSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.IsoTimestampAction<string, "an ISO 8601 time with a zone">]>, undefined>, undefined>;
41
- readonly joined_at: v.OptionalSchema<v.NullableSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.IsoTimestampAction<string, "an ISO 8601 time with a zone">]>, undefined>, undefined>;
39
+ readonly last_seen_at: 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>;
40
+ readonly registered_at: 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>;
41
+ readonly joined_at: 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>;
42
42
  readonly invited_by: v.OptionalSchema<v.NullableSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>, undefined>, undefined>;
43
43
  readonly is_bot: v.OptionalSchema<v.BooleanSchema<undefined>, undefined>;
44
44
  readonly deleted: v.OptionalSchema<v.BooleanSchema<undefined>, undefined>;
@@ -7,6 +7,6 @@ export declare const contactNote: v.StrictObjectSchema<{
7
7
  readonly text: v.StringSchema<undefined>;
8
8
  /** Starts at 1; an edit names the revision it read. */
9
9
  readonly revision: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>;
10
- readonly created_at: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.IsoTimestampAction<string, "an ISO 8601 time with a zone">]>;
11
- readonly updated_at: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.IsoTimestampAction<string, "an ISO 8601 time with a zone">]>;
10
+ readonly created_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`">]>;
11
+ readonly updated_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`">]>;
12
12
  }, undefined>;