@wirecat/cli-core 0.662.0 → 0.664.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 (247) hide show
  1. package/CHANGELOG.md +213 -0
  2. package/dist/calendar/cli/bodies.js +2 -1
  3. package/dist/calendar/cli/index.js +13 -10
  4. package/dist/calendar/mcp/index.d.ts +3 -1
  5. package/dist/calendar/mcp/index.js +4 -4
  6. package/dist/cli/call-stats-command.d.ts +18 -0
  7. package/dist/cli/call-stats-command.js +52 -0
  8. package/dist/cli/chat-sending-command.d.ts +14 -0
  9. package/dist/cli/chat-sending-command.js +64 -0
  10. package/dist/cli/context.d.ts +7 -0
  11. package/dist/cli/context.js +12 -4
  12. package/dist/cli/contract-templates.js +2 -0
  13. package/dist/cli/envelope.d.ts +0 -5
  14. package/dist/cli/envelope.js +25 -0
  15. package/dist/cli/index.d.ts +4 -1
  16. package/dist/cli/index.js +4 -1
  17. package/dist/cli/meeting-batch.d.ts +2 -1
  18. package/dist/cli/meeting-batch.js +7 -5
  19. package/dist/cli/meeting-meaning-command.d.ts +47 -0
  20. package/dist/cli/meeting-meaning-command.js +136 -0
  21. package/dist/cli/meeting-preparation-answer.d.ts +6 -0
  22. package/dist/cli/meeting-preparation-command.js +5 -5
  23. package/dist/cli/meeting-preparation-projects.d.ts +6 -0
  24. package/dist/cli/meeting-preparation-read.d.ts +11 -5
  25. package/dist/cli/meeting-preparation-read.js +13 -21
  26. package/dist/cli/meeting-series-inventory-command.js +2 -2
  27. package/dist/cli/meeting-series-inventory-read.d.ts +2 -2
  28. package/dist/cli/meeting-series-inventory-read.js +7 -15
  29. package/dist/cli/meeting-tags-command.d.ts +18 -0
  30. package/dist/cli/meeting-tags-command.js +74 -0
  31. package/dist/cli/messenger/admin-statistics-command.js +2 -2
  32. package/dist/cli/messenger/conversation-answers.d.ts +1 -1
  33. package/dist/cli/messenger/conversation-answers.js +1 -0
  34. package/dist/cli/messenger/conversations-command.js +38 -12
  35. package/dist/cli/messenger/counters-command.js +2 -2
  36. package/dist/cli/messenger/media-archive-command.js +5 -4
  37. package/dist/cli/messenger/media-archive-move-command.js +1 -1
  38. package/dist/cli/messenger/media-archive-timer-command.js +5 -4
  39. package/dist/cli/messenger/metadata-command.js +3 -3
  40. package/dist/cli/messenger/models-command.js +7 -0
  41. package/dist/cli/messenger/rankings-command.js +3 -3
  42. package/dist/cli/messenger/records-command.d.ts +4 -1
  43. package/dist/cli/messenger/records-command.js +6 -1
  44. package/dist/cli/messenger/tags-command.js +7 -2
  45. package/dist/cli/messenger/tasks-command.js +2 -2
  46. package/dist/cli/model-catalogue-command.js +2 -0
  47. package/dist/cli/paging.d.ts +10 -0
  48. package/dist/cli/paging.js +29 -0
  49. package/dist/cli/profile-token.d.ts +15 -1
  50. package/dist/cli/profile-token.js +103 -7
  51. package/dist/cli/program.js +2 -2
  52. package/dist/cli/runs/command.js +6 -4
  53. package/dist/cli/runs/search-command.js +9 -5
  54. package/dist/cli/schedule/schedule-command.js +1 -5
  55. package/dist/domain/links.d.ts +11 -0
  56. package/dist/domain/links.js +4 -0
  57. package/dist/domain/moment.d.ts +29 -0
  58. package/dist/domain/moment.js +58 -0
  59. package/dist/domain/providers.d.ts +6 -4
  60. package/dist/domain/providers.js +10 -5
  61. package/dist/domain/send-time.d.ts +3 -4
  62. package/dist/domain/send-time.js +10 -24
  63. package/dist/entities/chat-sending.d.ts +10 -0
  64. package/dist/entities/chat-sending.js +11 -0
  65. package/dist/entities/fields.d.ts +2 -2
  66. package/dist/entities/fields.js +2 -2
  67. package/dist/entities/index.d.ts +135 -2
  68. package/dist/entities/index.js +8 -3
  69. package/dist/entities/meeting-preparation.d.ts +6 -0
  70. package/dist/entities/meeting.d.ts +1 -1
  71. package/dist/entities/meeting.js +1 -1
  72. package/dist/errors/reasons.js +25 -2
  73. package/dist/mail/cli/index.js +4 -2
  74. package/dist/mail/facts.d.ts +5 -2
  75. package/dist/mail/facts.js +6 -3
  76. package/dist/mail/index.d.ts +1 -1
  77. package/dist/mail/meeting-notes.js +1 -1
  78. package/dist/mail/probe.d.ts +5 -2
  79. package/dist/mail/probe.js +9 -5
  80. package/dist/mail/server-search.js +1 -1
  81. package/dist/mail/sync.js +1 -1
  82. package/dist/mcp/meeting-preparation.d.ts +6 -0
  83. package/dist/mcp/meeting-preparation.js +1 -1
  84. package/dist/mcp/meeting-series-inventory.js +1 -1
  85. package/dist/mcp/prompts.js +6 -9
  86. package/dist/meetings/answers.d.ts +7 -0
  87. package/dist/meetings/answers.js +4 -0
  88. package/dist/meetings/call-answers.d.ts +106 -0
  89. package/dist/meetings/call-answers.js +171 -0
  90. package/dist/meetings/call-stats.d.ts +121 -0
  91. package/dist/meetings/call-stats.js +211 -0
  92. package/dist/meetings/calls.d.ts +76 -0
  93. package/dist/meetings/calls.js +78 -0
  94. package/dist/meetings/cli/index.d.ts +8 -0
  95. package/dist/meetings/cli/index.js +10 -22
  96. package/dist/meetings/cli/search.d.ts +9 -2
  97. package/dist/meetings/cli/search.js +16 -26
  98. package/dist/meetings/index.d.ts +4 -0
  99. package/dist/meetings/index.js +4 -0
  100. package/dist/meetings/mcp/index.d.ts +6 -3
  101. package/dist/meetings/mcp/index.js +2 -4
  102. package/dist/meetings/mcp/search.d.ts +12 -1
  103. package/dist/meetings/mcp/search.js +3 -3
  104. package/dist/meetings/project-evidence-answer.d.ts +6 -0
  105. package/dist/meetings/read-through.d.ts +2 -1
  106. package/dist/meetings/read-through.js +10 -1
  107. package/dist/meetings/stats.d.ts +3 -0
  108. package/dist/meetings/stats.js +3 -3
  109. package/dist/meetings/tag-answers.d.ts +43 -0
  110. package/dist/meetings/tag-answers.js +41 -0
  111. package/dist/meetings/testing/index.d.ts +1 -0
  112. package/dist/meetings/testing/index.js +1 -0
  113. package/dist/meetings/testing/paging.d.ts +6 -0
  114. package/dist/meetings/testing/paging.js +5 -0
  115. package/dist/models/chat-sending.d.ts +24 -0
  116. package/dist/models/chat-sending.js +40 -0
  117. package/dist/moderation/rules.d.ts +2 -0
  118. package/dist/moderation/rules.js +16 -2
  119. package/dist/runs/events.d.ts +1 -1
  120. package/dist/search/fusion.d.ts +17 -0
  121. package/dist/search/fusion.js +17 -0
  122. package/dist/search/lucene/resolved.d.ts +2 -0
  123. package/dist/search/question-plan.d.ts +4 -0
  124. package/dist/search/question-plan.js +7 -0
  125. package/dist/search/service-query.d.ts +6 -1
  126. package/dist/search/service-query.js +9 -1
  127. package/dist/search/task-similarity.d.ts +1 -0
  128. package/dist/search/task-similarity.js +1 -1
  129. package/dist/services/agenda-mail.js +2 -1
  130. package/dist/services/agenda.js +5 -3
  131. package/dist/services/attachments.js +4 -2
  132. package/dist/services/call-stats.d.ts +17 -0
  133. package/dist/services/call-stats.js +41 -0
  134. package/dist/services/chats.js +4 -2
  135. package/dist/services/conversations.js +4 -2
  136. package/dist/services/deps.d.ts +1 -1
  137. package/dist/services/document-source.d.ts +1 -1
  138. package/dist/services/document-source.js +4 -3
  139. package/dist/services/documents/ingestion.js +11 -40
  140. package/dist/services/documents/plan.d.ts +1 -1
  141. package/dist/services/documents/plan.js +30 -17
  142. package/dist/services/documents/ports.d.ts +5 -0
  143. package/dist/services/documents/sync.js +1 -1
  144. package/dist/services/embeddings-search.js +39 -9
  145. package/dist/services/embeddings.d.ts +4 -0
  146. package/dist/services/events-search.js +2 -1
  147. package/dist/services/index.d.ts +3 -0
  148. package/dist/services/index.js +3 -0
  149. package/dist/services/mail-search.d.ts +1 -1
  150. package/dist/services/mail-search.js +10 -11
  151. package/dist/services/media-archive-move.js +2 -4
  152. package/dist/services/media-archive.d.ts +0 -1
  153. package/dist/services/media-archive.js +2 -12
  154. package/dist/services/meeting-combined.js +1 -1
  155. package/dist/services/meeting-meaning.d.ts +47 -0
  156. package/dist/services/meeting-meaning.js +158 -0
  157. package/dist/services/meeting-tags.d.ts +27 -0
  158. package/dist/services/meeting-tags.js +81 -0
  159. package/dist/services/messages-combined.js +15 -4
  160. package/dist/services/messages-discovery.js +2 -2
  161. package/dist/services/moderation.js +10 -2
  162. package/dist/services/moment.d.ts +4 -10
  163. package/dist/services/moment.js +16 -44
  164. package/dist/services/notes-search.d.ts +0 -2
  165. package/dist/services/notes-search.js +1 -2
  166. package/dist/services/search-all.js +2 -1
  167. package/dist/services/tags.js +4 -2
  168. package/dist/services/task-stats.js +2 -2
  169. package/dist/services/tasks.js +2 -2
  170. package/dist/sftp/index.d.ts +1 -1
  171. package/dist/sftp/index.js +1 -1
  172. package/dist/sftp/session.d.ts +30 -4
  173. package/dist/sftp/session.js +195 -11
  174. package/dist/sftp/ssh2.d.ts +19 -4
  175. package/dist/sftp/ssh2.js +144 -17
  176. package/dist/speech/cloud.d.ts +47 -0
  177. package/dist/speech/cloud.js +73 -0
  178. package/dist/speech/decode.d.ts +36 -9
  179. package/dist/speech/decode.js +208 -61
  180. package/dist/speech/index.d.ts +2 -1
  181. package/dist/speech/index.js +2 -1
  182. package/dist/speech/openai.d.ts +4 -0
  183. package/dist/speech/openai.js +13 -12
  184. package/dist/sql/index.d.ts +1 -0
  185. package/dist/sql/index.js +1 -0
  186. package/dist/sql/reader.d.ts +95 -0
  187. package/dist/sql/reader.js +214 -0
  188. package/dist/store/accounts.js +2 -1
  189. package/dist/store/sqlite/account-purge.d.ts +3 -0
  190. package/dist/store/sqlite/account-purge.js +143 -0
  191. package/dist/store/sqlite/accounts.d.ts +0 -2
  192. package/dist/store/sqlite/accounts.js +2 -134
  193. package/dist/store/sqlite/calendar.d.ts +1 -0
  194. package/dist/store/sqlite/calendar.js +5 -5
  195. package/dist/store/sqlite/catalog.js +2 -16
  196. package/dist/store/sqlite/chats.js +2 -1
  197. package/dist/store/sqlite/context-document-source.d.ts +3 -3
  198. package/dist/store/sqlite/context-document-source.js +9 -7
  199. package/dist/store/sqlite/context-evidence.js +9 -3
  200. package/dist/store/sqlite/document-listing.js +2 -1
  201. package/dist/store/sqlite/drizzle/bun.js +4 -4
  202. package/dist/store/sqlite/drizzle/bun.js.map +1 -1
  203. package/dist/store/sqlite/drizzle/core.js +5 -5
  204. package/dist/store/sqlite/drizzle/core.js.map +1 -1
  205. package/dist/store/sqlite/drizzle/node.js +4 -4
  206. package/dist/store/sqlite/drizzle/node.js.map +1 -1
  207. package/dist/store/sqlite/drizzle/{shared-55XJMTPA.js → shared-5XR7K42U.js} +58 -58
  208. package/dist/store/sqlite/drizzle/{shared-55XJMTPA.js.map → shared-5XR7K42U.js.map} +1 -1
  209. package/dist/store/sqlite/events.js +2 -1
  210. package/dist/store/sqlite/file-note.d.ts +6 -0
  211. package/dist/store/sqlite/file-note.js +15 -0
  212. package/dist/store/sqlite/files.d.ts +3 -2
  213. package/dist/store/sqlite/files.js +5 -3
  214. package/dist/store/sqlite/identities.js +2 -1
  215. package/dist/store/sqlite/imported-documents.js +2 -2
  216. package/dist/store/sqlite/knowledge.d.ts +1 -1
  217. package/dist/store/sqlite/knowledge.js +27 -23
  218. package/dist/store/sqlite/labelled.d.ts +5 -0
  219. package/dist/store/sqlite/labelled.js +6 -0
  220. package/dist/store/sqlite/link-row.d.ts +1 -0
  221. package/dist/store/sqlite/link-row.js +2 -0
  222. package/dist/store/sqlite/lucene-fields.js +8 -12
  223. package/dist/store/sqlite/mail-rules.js +2 -1
  224. package/dist/store/sqlite/meeting-calls.d.ts +4 -0
  225. package/dist/store/sqlite/meeting-calls.js +66 -0
  226. package/dist/store/sqlite/meetings.d.ts +2 -2
  227. package/dist/store/sqlite/meetings.js +4 -1
  228. package/dist/store/sqlite/mention-sources.js +2 -1
  229. package/dist/store/sqlite/mentions.js +2 -2
  230. package/dist/store/sqlite/messages.js +6 -1
  231. package/dist/store/sqlite/note-search.js +8 -11
  232. package/dist/store/sqlite/notes.d.ts +3 -1
  233. package/dist/store/sqlite/notes.js +25 -14
  234. package/dist/store/sqlite/organizations.js +2 -2
  235. package/dist/store/sqlite/people-list.js +3 -3
  236. package/dist/store/sqlite/query-filter.d.ts +3 -3
  237. package/dist/store/sqlite/query-filter.js +3 -3
  238. package/dist/store/sqlite/reads.d.ts +4 -4
  239. package/dist/store/sqlite/reads.js +4 -4
  240. package/dist/store/sqlite/search.js +11 -7
  241. package/dist/store/sqlite/test-accounts.js +1 -1
  242. package/dist/store/sqlite/trigram-match.d.ts +9 -0
  243. package/dist/store/sqlite/trigram-match.js +28 -0
  244. package/dist/store/sqlite/work-tasks.js +1 -1
  245. package/package.json +18 -3
  246. package/parity.json +20 -1
  247. package/skills/link-conversations/SKILL.md +1 -1
@@ -13,15 +13,29 @@ export interface ProfileTokenStoreOptions {
13
13
  * `token:<profile>` under the app's own service, then a 0600 file (WC-SECR-4). A run with moved folders reads the
14
14
  * owner's entry and never replaces or deletes it: it writes a temporary `<app>:<config folder>` entry instead
15
15
  * (WC-SECR-24, cli-base `Credentials`).
16
+ *
17
+ * A profile that needs a second secret (a database password and an SSH password) keeps it in the same entry, by
18
+ * name: `writeSecret(profile, "ssh", …)`. The entry then holds the token and the named secrets as one value, as an
19
+ * OAuth entry holds its tokens and client secret; the keyring gets no second entry. `<PREFIX>_TOKEN_<NAME>` overrides
20
+ * one for CI, as `<PREFIX>_TOKEN` does the token.
16
21
  */
17
22
  export declare class ProfileTokenStore {
18
23
  #private;
19
24
  readonly variable: string;
20
25
  constructor({ app, env, keyring, warn }: ProfileTokenStoreOptions);
21
26
  read(profile: string): StoredCredential | undefined;
22
- /** `file` also forgets the keyring copy, so a later read cannot find the token the owner asked to keep elsewhere. */
27
+ /** The token; the profile's named secrets stay as they were. */
23
28
  write(profile: string, token: string, storage?: TokenStorage): CredentialSource;
29
+ /** The token and every named secret: the whole entry, as `session end` wants. */
24
30
  remove(profile: string): CredentialSource[];
31
+ /** A named secret: `<PREFIX>_TOKEN_<NAME>`, then the profile's entry. */
32
+ readSecret(profile: string, name: string): StoredCredential | undefined;
33
+ /** A named secret, kept in the profile's one entry beside its token; where the entry is now when not given. */
34
+ writeSecret(profile: string, name: string, secret: string, storage?: TokenStorage): CredentialSource;
35
+ /** Forgets one named secret; the token and the others stay. An entry left empty is removed. */
36
+ removeSecret(profile: string, name: string): CredentialSource[];
37
+ /** The variable that overrides a named secret: `PBX_TOKEN_SSH` for `ssh`. */
38
+ secretVariable(name: string): string;
25
39
  /** The profile's token, or the one "not signed in" refusal every token CLI gives, naming the command to fix it. */
26
40
  need(profile: string): string;
27
41
  /** For `appMcpCommand`'s `signedIn`: a keyring that cannot be read counts as not signed in. */
@@ -1,16 +1,60 @@
1
1
  import { CliError, Credentials, isMovedRun, resolvePaths, } from "@wirecat/cli-base";
2
2
  import { envName } from "../ports/app.js";
3
+ /**
4
+ * What one profile's entry holds when it keeps more than its token: the token and named secrets, as one JSON value
5
+ * after a prefix no typed password starts with. A plain value is the token alone, as every entry written before.
6
+ */
7
+ const ENVELOPE = "wirecat-secrets:v1:";
8
+ const SECRET_NAME = /^[a-z][a-z0-9-]{0,31}$/;
9
+ const checkName = (name) => {
10
+ if (!SECRET_NAME.test(name) || name === "token")
11
+ throw new CliError("validation_error", "a secret's name is a-z, 0-9 and -, up to 32 characters, and not token", {
12
+ reason: "input.invalid",
13
+ });
14
+ };
15
+ const unpack = (value) => {
16
+ if (value === undefined)
17
+ return { secrets: {} };
18
+ if (!value.startsWith(ENVELOPE))
19
+ return { token: value, secrets: {} };
20
+ try {
21
+ const parsed = JSON.parse(value.slice(ENVELOPE.length));
22
+ const secrets = parsed.secrets && typeof parsed.secrets === "object" ? parsed.secrets : {};
23
+ return {
24
+ ...(typeof parsed.token === "string" ? { token: parsed.token } : {}),
25
+ secrets: Object.fromEntries(Object.entries(secrets).filter((entry) => typeof entry[1] === "string")),
26
+ };
27
+ }
28
+ catch {
29
+ throw new CliError("configuration_error", "this profile's stored secrets cannot be read; run session start again", {
30
+ reason: "session.unreadable",
31
+ });
32
+ }
33
+ };
34
+ /** The token alone stays a plain value, so an entry with nothing else in it reads as before. */
35
+ const pack = (held) => {
36
+ if (Object.keys(held.secrets).length === 0)
37
+ return held.token;
38
+ return `${ENVELOPE}${JSON.stringify({ ...(held.token === undefined ? {} : { token: held.token }), secrets: held.secrets })}`;
39
+ };
3
40
  /**
4
41
  * One API token per profile for a CLI that is not a messenger: `<PREFIX>_TOKEN`, then the keyring entry
5
42
  * `token:<profile>` under the app's own service, then a 0600 file (WC-SECR-4). A run with moved folders reads the
6
43
  * owner's entry and never replaces or deletes it: it writes a temporary `<app>:<config folder>` entry instead
7
44
  * (WC-SECR-24, cli-base `Credentials`).
45
+ *
46
+ * A profile that needs a second secret (a database password and an SSH password) keeps it in the same entry, by
47
+ * name: `writeSecret(profile, "ssh", …)`. The entry then holds the token and the named secrets as one value, as an
48
+ * OAuth entry holds its tokens and client secret; the keyring gets no second entry. `<PREFIX>_TOKEN_<NAME>` overrides
49
+ * one for CI, as `<PREFIX>_TOKEN` does the token.
8
50
  */
9
51
  export class ProfileTokenStore {
10
52
  variable;
11
53
  #app;
12
54
  #options;
13
55
  #credentials;
56
+ /** The same entry without the environment variable, for the value a write merges into. */
57
+ #stored;
14
58
  constructor({ app, env = process.env, keyring, warn }) {
15
59
  const where = { appName: app.appName, prefix: app.envPrefix, env };
16
60
  this.#app = app;
@@ -25,15 +69,70 @@ export class ProfileTokenStore {
25
69
  warn: warn ?? ((message) => process.stderr.write(`${message}\n`)),
26
70
  };
27
71
  this.#credentials = new Credentials(this.#options);
72
+ const { envVar: _, ...stored } = this.#options;
73
+ this.#stored = new Credentials(stored);
28
74
  }
29
75
  read(profile) {
30
- return this.#credentials.read(accountOf(profile));
76
+ const found = this.#credentials.read(accountOf(profile));
77
+ if (!found || found.source === "environment")
78
+ return found;
79
+ const { token } = unpack(found.secret);
80
+ return token === undefined ? undefined : { secret: token, source: found.source };
31
81
  }
32
- /** `file` also forgets the keyring copy, so a later read cannot find the token the owner asked to keep elsewhere. */
82
+ /** The token; the profile's named secrets stay as they were. */
33
83
  write(profile, token, storage = "keyring") {
84
+ const held = this.#held(profile);
85
+ return this.#put(profile, { ...held, token }, storage);
86
+ }
87
+ /** The token and every named secret: the whole entry, as `session end` wants. */
88
+ remove(profile) {
89
+ return this.#credentials.remove(accountOf(profile));
90
+ }
91
+ /** A named secret: `<PREFIX>_TOKEN_<NAME>`, then the profile's entry. */
92
+ readSecret(profile, name) {
93
+ checkName(name);
94
+ const variable = this.secretVariable(name);
95
+ const given = this.#options.env?.[variable];
96
+ if (given)
97
+ return { secret: given, source: "environment" };
98
+ const found = this.#stored.read(accountOf(profile));
99
+ const secret = found ? unpack(found.secret).secrets[name] : undefined;
100
+ return found && secret !== undefined ? { secret, source: found.source } : undefined;
101
+ }
102
+ /** A named secret, kept in the profile's one entry beside its token; where the entry is now when not given. */
103
+ writeSecret(profile, name, secret, storage) {
104
+ checkName(name);
105
+ const found = this.#stored.read(accountOf(profile));
106
+ const held = unpack(found?.secret);
107
+ const where = storage ?? (found?.source === "file" ? "file" : "keyring");
108
+ return this.#put(profile, { ...held, secrets: { ...held.secrets, [name]: secret } }, where);
109
+ }
110
+ /** Forgets one named secret; the token and the others stay. An entry left empty is removed. */
111
+ removeSecret(profile, name) {
112
+ checkName(name);
113
+ const held = this.#held(profile);
114
+ if (!(name in held.secrets))
115
+ return [];
116
+ const { [name]: _, ...secrets } = held.secrets;
117
+ const left = { ...held, secrets };
118
+ if (pack(left) === undefined)
119
+ return this.remove(profile);
120
+ const found = this.#stored.read(accountOf(profile));
121
+ return [this.#put(profile, left, found?.source === "file" ? "file" : "keyring")];
122
+ }
123
+ /** The variable that overrides a named secret: `PBX_TOKEN_SSH` for `ssh`. */
124
+ secretVariable(name) {
125
+ return `${this.variable}_${name.toUpperCase().replaceAll("-", "_")}`;
126
+ }
127
+ #held(profile) {
128
+ return unpack(this.#stored.read(accountOf(profile))?.secret);
129
+ }
130
+ /** `file` also forgets the keyring copy, so a later read cannot find the secret the owner asked to keep elsewhere. */
131
+ #put(profile, held, storage) {
132
+ const value = pack(held);
34
133
  if (storage === "keyring")
35
- return this.#credentials.write(accountOf(profile), token, { signIn: true });
36
- const kept = new Credentials({ ...this.#options, storage: "file" }).write(accountOf(profile), token);
134
+ return this.#stored.write(accountOf(profile), value, { signIn: true });
135
+ const kept = new Credentials({ ...this.#options, storage: "file" }).write(accountOf(profile), value);
37
136
  try {
38
137
  new Credentials({ ...this.#options, storage: "keyring" }).remove(accountOf(profile));
39
138
  }
@@ -42,9 +141,6 @@ export class ProfileTokenStore {
42
141
  }
43
142
  return kept;
44
143
  }
45
- remove(profile) {
46
- return this.#credentials.remove(accountOf(profile));
47
- }
48
144
  /** The profile's token, or the one "not signed in" refusal every token CLI gives, naming the command to fix it. */
49
145
  need(profile) {
50
146
  const stored = this.read(profile);
@@ -22,7 +22,7 @@ import { commandPathOf } from "./command-contract.js";
22
22
  import { enterCommandServer } from "./command-server.js";
23
23
  import { exitCodeSet } from "./command-server-request.js";
24
24
  import { entityRows } from "./compact.js";
25
- import { outputFor, provide } from "./context.js";
25
+ import { outputFieldsOf, outputFor, provide } from "./context.js";
26
26
  import { refuseByCommandPermissions, refuseOfflineCommand, refuseWriteBeforeConnecting } from "./early-refusal.js";
27
27
  import { admittedUnderLock, changesAuthorityAt, changesAuthorityNow, fetchesOnlyAt, fileOptionOf, isLogin, isStoreChange, judgedEffects, judgedTargets, storeChangeRefusal, } from "./effects.js";
28
28
  import { itemOf, renderAnswer, snakeKeys } from "./envelope.js";
@@ -316,7 +316,7 @@ const runOnce = async (argv, definition, options) => {
316
316
  checkJson(action, requested, !flags.jsonl && (options.tty ?? process.stdout.isTTY) === true);
317
317
  control.configure({
318
318
  // Beside `--format csv`, `--json=a,b` names the table's columns: a CSV is no JSON to pick fields from.
319
- ...(flags.fields === undefined || action.getOptionValue("format") === "csv" ? {} : { fields: flags.fields }),
319
+ ...(action.getOptionValue("format") === "csv" ? {} : outputFieldsOf(action)),
320
320
  maxOutputBytes: flags.maxOutputBytes === undefined
321
321
  ? machine || (options.tty ?? process.stdout.isTTY) !== true
322
322
  ? DEFAULT_OUTPUT_BYTES
@@ -7,7 +7,7 @@ import { LOCAL_READ, NO_EFFECTS } from "../effects.js";
7
7
  import { itemOf, listOf, renderAnswer, snakeKeys } from "../envelope.js";
8
8
  import { typedQuery, withQuery } from "../list-query.js";
9
9
  import { answerLocally } from "../local-times.js";
10
- import { positiveCount } from "../paging.js";
10
+ import { configuredLimit, positiveCount } from "../paging.js";
11
11
  import { lineOf } from "../steps.js";
12
12
  import { RUNS_QUERY, runListFilter } from "./query.js";
13
13
  /** Reading the log is not itself worth recording, so **nothing here starts a run**. */
@@ -25,11 +25,13 @@ export const runsCommand = (app) => {
25
25
  effects: LOCAL_READ,
26
26
  }), RUNS_QUERY)
27
27
  .description("recorded runs, newest first")
28
- .option("--limit <n>", "how many to show", positiveCount("--limit"), 20)
29
- .option("--page <n>", "which page, starting at 1", positiveCount("--page"), 1)
28
+ .option("--limit <n>", "how many to show", positiveCount("--limit"))
29
+ .option("--page <n>", "which page, starting at 1", positiveCount("--page"))
30
30
  .action(function (words) {
31
31
  const filter = runListFilter(words);
32
- const { limit, page } = this.opts();
32
+ const typed = this.opts();
33
+ const limit = typed.limit ?? configuredLimit(this);
34
+ const page = typed.page ?? 1;
33
35
  const output = outputFor(this);
34
36
  const { renderer } = output;
35
37
  const runs = listRuns(dir(this), { atLeast: page * limit + 1, filter });
@@ -5,22 +5,26 @@ import { environmentOf, outputFor } from "../context.js";
5
5
  import { LOCAL_READ } from "../effects.js";
6
6
  import { renderAnswer } from "../envelope.js";
7
7
  import { typedQuery, withQuery } from "../list-query.js";
8
- import { positiveCount } from "../paging.js";
8
+ import { configuredLimit, positiveCount } from "../paging.js";
9
9
  import { runsFound, searchRuns } from "./search.js";
10
10
  import { RUN_SEARCH_QUERY, runSearchFilter } from "./search-query.js";
11
11
  /** Diagnostic files are independent of linked accounts and never start a recorded run themselves. */
12
12
  export const runsSearchCommand = (app) => annotate(withQuery(new Command("runs")
13
13
  .summary("search recorded diagnostic metadata and events")
14
14
  .description("search recorded diagnostic metadata and events; literal words and field:value terms joined by AND; no message contents")
15
- .option("--limit <n>", "matches per page, at most 100", positiveCount("--limit"), 20)
16
- .option("--page <n>", "result page", positiveCount("--page"), 1), RUN_SEARCH_QUERY), {
15
+ .option("--limit <n>", "matches per page, at most 100", positiveCount("--limit"))
16
+ .option("--page <n>", "result page", positiveCount("--page")), RUN_SEARCH_QUERY), {
17
17
  effects: LOCAL_READ,
18
18
  output: { entity: "run", view: "hit" },
19
19
  examples: [`${app.command} search runs timeout status:failed --limit 10`],
20
20
  }).action(function (words) {
21
21
  const filter = runSearchFilter(words);
22
- const options = this.opts();
22
+ const typed = this.opts();
23
23
  const dir = runsDirFor(app, environmentOf(this).env ?? process.env);
24
- const found = searchRuns(dir, { ...filter, ...options });
24
+ const found = searchRuns(dir, {
25
+ ...filter,
26
+ limit: typed.limit ?? configuredLimit(this, 100),
27
+ page: typed.page ?? 1,
28
+ });
25
29
  renderAnswer(this, outputFor(this), runsFound(found, { query: typedQuery(words) }));
26
30
  });
@@ -53,11 +53,7 @@ const whenOf = ({ every, at = [], atTime }, minimum) => {
53
53
  }
54
54
  if (atTime) {
55
55
  // As messages send --at-time: a date alone would be its midnight, which nobody means by "send on the 20th".
56
- if (/^\d{4}-\d{2}-\d{2}$/.test(atTime.trim()))
57
- throw new CliError("validation_error", `--at-time needs a time of day as well: ${atTime.trim()}T09:00`);
58
- const time = aheadOf(atTime, "--at-time");
59
- if (time <= Date.now())
60
- throw new CliError("validation_error", "--at-time is in the past");
56
+ const time = aheadOf(atTime, "--at-time", Date.now(), { refuseDate: true, soonest: 0 });
61
57
  return { once: new Date(time).toISOString() };
62
58
  }
63
59
  if (at.length > 0) {
@@ -43,6 +43,17 @@ export type DeepLinkTarget = {
43
43
  | {
44
44
  type: "project";
45
45
  id: string;
46
+ }
47
+ /**
48
+ * A call or meeting by the provider's own ids, as a message link names its message: the provider (`asterisk`,
49
+ * `zoom`), the account as the provider knows it, and the meeting's id there. Built only from this target, never from
50
+ * a store reference: `meeting:<account>/<meeting>` names store rows.
51
+ */
52
+ | {
53
+ type: "meeting";
54
+ provider: string;
55
+ account: string;
56
+ meeting: string;
46
57
  };
47
58
  export type LinkForm = "web" | "app";
48
59
  export interface LinkConfig {
@@ -26,6 +26,8 @@ const partsOf = (target) => {
26
26
  return ["digest", target.date];
27
27
  case "sync":
28
28
  return target.account === undefined ? ["sync", target.tool] : ["sync", target.tool, target.account];
29
+ case "meeting":
30
+ return ["meeting", target.provider, target.account, target.meeting];
29
31
  }
30
32
  };
31
33
  /** The path after the version, `msg/max/1001/-2002/3003`: each part percent-encoded, so no id can add a part. */
@@ -56,6 +58,8 @@ const targetOfParts = (parts) => {
56
58
  return rest.length === 1 || rest.length === 2
57
59
  ? { type: "sync", tool: a, ...(rest.length === 2 ? { account: b } : {}) }
58
60
  : null;
61
+ case "meeting":
62
+ return rest.length === 3 ? { type: "meeting", provider: a, account: b, meeting: c } : null;
59
63
  default:
60
64
  return null;
61
65
  }
@@ -6,3 +6,32 @@ export interface MomentZone {
6
6
  }
7
7
  /** A typed date or time as epoch ms, with the flag named when it is not one. */
8
8
  export declare const calendarMoment: (wanted: string, flag: string, { zone, end }?: MomentZone) => number;
9
+ export declare const MINUTE = 60000;
10
+ export declare const YEAR: number;
11
+ export interface Reading {
12
+ time: number;
13
+ /** Read in a zone: a date, `today`, or a time without an offset. A relative or offset time is not. */
14
+ local: boolean;
15
+ dateAlone: boolean;
16
+ }
17
+ /**
18
+ * The shared time grammar: an ISO date or date-time, seconds and zone optional, a space allowed for the `T`; `today`,
19
+ * `yesterday`; or `30m`, `2h`, `7d` counted by `direction` from now. `undefined` when the value has none of these shapes.
20
+ */
21
+ export declare const readMoment: (typed: string, flag: string, { zone, end, now, direction }?: MomentZone & {
22
+ now?: number;
23
+ direction?: 1 | -1;
24
+ }) => Reading | undefined;
25
+ export interface AheadOptions extends MomentZone {
26
+ /** A date alone has no time of day to act at: sending "on the 20th" means nobody knows when. */
27
+ refuseDate?: boolean;
28
+ /** The least lead from now, in ms: 0 refuses the past, a minute is what a messenger schedules at the soonest. */
29
+ soonest?: number;
30
+ /** The most lead from now, in ms, where a messenger caps it. */
31
+ latest?: number;
32
+ }
33
+ /**
34
+ * A time ahead, the one parser of every future flag: the grammar of `readMoment`, relative times counted forward.
35
+ * `none` is not a time; a caller that clears a date checks for it first. The past is allowed unless `soonest` is given.
36
+ */
37
+ export declare const aheadOf: (reference: string, flag: string, now?: number, options?: AheadOptions) => number;
@@ -12,3 +12,61 @@ export const calendarMoment = (wanted, flag, { zone, end = false } = {}) => {
12
12
  throw new CliError("validation_error", `${flag}: "${wanted}" is not a time${alternative ? ` — ${alternative}` : ""}`);
13
13
  }
14
14
  };
15
+ export const MINUTE = 60_000;
16
+ export const YEAR = 365 * 24 * 60 * MINUTE;
17
+ const RELATIVE = /^(\d+)(m|h|d)$/;
18
+ const RELATIVE_MS = { m: MINUTE, h: 60 * MINUTE, d: 24 * 60 * MINUTE };
19
+ const DATE_ALONE = /^\d{4}-\d{2}-\d{2}$/;
20
+ const ZONED = /(?:Z|[+-]\d{2}:?\d{2})$/i;
21
+ /** `today` or `yesterday` as the date it is in `zone` at `now`. */
22
+ const dayWord = (word, zone, now) => {
23
+ const today = new Intl.DateTimeFormat("en-CA", { timeZone: zone }).format(now);
24
+ if (word === "today")
25
+ return today;
26
+ const date = new Date(`${today}T00:00:00Z`);
27
+ date.setUTCDate(date.getUTCDate() - 1);
28
+ return date.toISOString().slice(0, 10);
29
+ };
30
+ /**
31
+ * The shared time grammar: an ISO date or date-time, seconds and zone optional, a space allowed for the `T`; `today`,
32
+ * `yesterday`; or `30m`, `2h`, `7d` counted by `direction` from now. `undefined` when the value has none of these shapes.
33
+ */
34
+ export const readMoment = (typed, flag, { zone, end = false, now = Date.now(), direction = -1 } = {}) => {
35
+ const wanted = typed.trim();
36
+ const [, amount, unit] = RELATIVE.exec(wanted) ?? [];
37
+ if (amount && unit)
38
+ return { time: now + direction * Number(amount) * (RELATIVE_MS[unit] ?? 0), local: false, dateAlone: false };
39
+ const word = wanted.toLowerCase();
40
+ const date = word === "today" || word === "yesterday" ? dayWord(word, timezoneOf(zone), now) : wanted;
41
+ // By shape: `Date.parse("12345")` is the year 12345, so a message id would pass as a date.
42
+ if (!/^\d{4}-\d{2}-\d{2}/.test(date))
43
+ return undefined;
44
+ const iso = date.replace(/^(\d{4}-\d{2}-\d{2}) +(?=\d)/, "$1T");
45
+ return {
46
+ time: calendarMoment(iso, flag, { ...(zone === undefined ? {} : { zone }), end }),
47
+ local: !ZONED.test(iso),
48
+ dateAlone: DATE_ALONE.test(iso),
49
+ };
50
+ };
51
+ const lead = (ms) => (ms === MINUTE ? "a minute" : ms === YEAR ? "a year" : `${Math.ceil(ms / MINUTE)} minutes`);
52
+ /**
53
+ * A time ahead, the one parser of every future flag: the grammar of `readMoment`, relative times counted forward.
54
+ * `none` is not a time; a caller that clears a date checks for it first. The past is allowed unless `soonest` is given.
55
+ */
56
+ export const aheadOf = (reference, flag, now = Date.now(), options = {}) => {
57
+ const { refuseDate = false, soonest, latest, ...at } = options;
58
+ const read = readMoment(reference, flag, { ...at, now, direction: 1 });
59
+ if (read === undefined)
60
+ throw new CliError("validation_error", `${flag} takes an ISO 8601 time, today, or 30m, 2h, 3d from now — not "${reference.trim()}"`);
61
+ if (refuseDate && read.dateAlone)
62
+ throw new CliError("validation_error", DATE_ALONE.test(reference.trim())
63
+ ? `${flag} needs a time of day as well: ${reference.trim()}T09:00`
64
+ : `${flag} needs a time of day as well, like 2026-11-20T09:00`);
65
+ if (soonest === 0 && read.time <= now)
66
+ throw new CliError("validation_error", `${flag} is in the past`);
67
+ if (soonest !== undefined && soonest > 0 && read.time < now + soonest)
68
+ throw new CliError("validation_error", `${flag} has to be at least ${lead(soonest)} from now`);
69
+ if (latest !== undefined && read.time > now + latest)
70
+ throw new CliError("validation_error", `${flag} can be at most ${lead(latest)} from now`);
71
+ return read.time;
72
+ };
@@ -46,11 +46,13 @@ export declare const folderProviderSql: (column?: string) => string;
46
46
  export declare const folderProviderOf: (format: "obsidian" | "markdown") => "obsidian" | "local";
47
47
  /**
48
48
  * Providers whose account holds documents the way a notes folder does: one account per remote principal, its
49
- * files as `documents` rows (store version 31 moved Drive here from a `folder` named `google-drive:<principal>`).
50
- * The provider registry's `documents` kind replaces this list when Drive leaves `notes` (Wave 3 R2).
49
+ * files as `documents` rows. Any registry entry of kind `documents` that a sync fills; an import-only one (`import`)
50
+ * keeps its documents beside its other records instead.
51
51
  */
52
- export declare const DOCUMENT_ACCOUNT_PROVIDERS: readonly ["google-drive"];
53
- export declare const isDocumentAccountProvider: (provider: string) => boolean;
52
+ export declare const documentAccountProviders: () => string[];
53
+ export declare const isDocumentAccountProvider: (provider: unknown) => boolean;
54
+ /** The documents account providers as a SQL list, for `IN (…)`; names are checked words, so they need no binding. */
55
+ export declare const documentAccountProvidersSql: () => string;
54
56
  /**
55
57
  * What the owner adds by hand (`saveAddedSource`): one account, `owner`. Neither a folder nor a documents account, so no
56
58
  * folder can be bound to it and no sync deletes a source whose file is gone.
@@ -20,6 +20,7 @@ export const PROVIDERS = [
20
20
  { name: "added", kind: "notes", aliases: [] },
21
21
  { name: "zoom", kind: "meetings", aliases: [] },
22
22
  { name: "google-meet", kind: "meetings", aliases: [], command: "gmeet" },
23
+ { name: "google-drive", kind: "documents", aliases: [] },
23
24
  // Its meetings come from the notes Telemost mails (`keeper@telemost.yandex.ru`), read by a mail rule.
24
25
  { name: "telemost", kind: "meetings", aliases: [] },
25
26
  // A phone export's records: its SMS and its calls in the one account the import names.
@@ -55,11 +56,15 @@ export const folderProviderSql = (column = "provider") => `${column} IN (${FOLDE
55
56
  export const folderProviderOf = (format) => format === "markdown" ? "local" : "obsidian";
56
57
  /**
57
58
  * Providers whose account holds documents the way a notes folder does: one account per remote principal, its
58
- * files as `documents` rows (store version 31 moved Drive here from a `folder` named `google-drive:<principal>`).
59
- * The provider registry's `documents` kind replaces this list when Drive leaves `notes` (Wave 3 R2).
59
+ * files as `documents` rows. Any registry entry of kind `documents` that a sync fills; an import-only one (`import`)
60
+ * keeps its documents beside its other records instead.
60
61
  */
61
- export const DOCUMENT_ACCOUNT_PROVIDERS = ["google-drive"];
62
- export const isDocumentAccountProvider = (provider) => DOCUMENT_ACCOUNT_PROVIDERS.includes(provider);
62
+ export const documentAccountProviders = () => registry.filter((entry) => entry.kind === "documents" && entry.imported !== true).map(({ name }) => name);
63
+ export const isDocumentAccountProvider = (provider) => typeof provider === "string" && documentAccountProviders().includes(provider);
64
+ /** The documents account providers as a SQL list, for `IN (…)`; names are checked words, so they need no binding. */
65
+ export const documentAccountProvidersSql = () => documentAccountProviders()
66
+ .map((name) => `'${name}'`)
67
+ .join(", ") || "NULL";
63
68
  /**
64
69
  * What the owner adds by hand (`saveAddedSource`): one account, `owner`. Neither a folder nor a documents account, so no
65
70
  * folder can be bound to it and no sync deletes a source whose file is gone.
@@ -69,7 +74,7 @@ export const ADDED_ACCOUNT = "owner";
69
74
  /** Documents `d` outside the added sources: a folder file joined to one would delete it when the file goes. */
70
75
  export const notAdded = `d.account_id NOT IN (SELECT id FROM accounts WHERE provider = '${ADDED_PROVIDER}')`;
71
76
  /** A folder, a documents account or the added sources, in SQL over an `accounts` row's `provider` column. */
72
- export const filesAccountSql = (column = "provider") => `${column} IN (${[...FOLDER_PROVIDERS, ...DOCUMENT_ACCOUNT_PROVIDERS, ADDED_PROVIDER].map((name) => `'${name}'`).join(", ")})`;
77
+ export const filesAccountSql = (column = "provider") => `${column} IN (${[...FOLDER_PROVIDERS, ...documentAccountProviders(), ADDED_PROVIDER].map((name) => `'${name}'`).join(", ")})`;
73
78
  /** Notes written in memo have no account row; this is their account. */
74
79
  export const INTERNAL_NOTES = "internal";
75
80
  /** The reason a search gives for an account whose provider no entry names. */
@@ -1,7 +1,6 @@
1
1
  /**
2
- * `--at-time`: a time like `2026-09-25T09:00`, or a delay like `30m`, `2h`, `1d`, as an ISO time — the
3
- * same words max-cli takes. Rounded down to the minute, because messengers send at the start of it
4
- * (MAX measured, max-cli `FIND-141`), so the time printed is the time it goes. A time without an
5
- * offset is read in `zone`, the computer's zone when none is given.
2
+ * `--at-time`, a mute's `--until`, a link's `--expire-time`: `aheadOf` within the messenger's limits of a minute to a
3
+ * year, and never a date alone. Rounded down to the minute, because messengers send at the start of it (MAX measured,
4
+ * max-cli `FIND-141`), so the time printed is the time it goes.
6
5
  */
7
6
  export declare const sendTime: (value: string, now?: number, flag?: string, zone?: string) => string;
@@ -1,29 +1,15 @@
1
- import { CliError } from "@wirecat/cli-base";
2
- import { calendarMoment } from "./moment.js";
3
- const MINUTE = 60_000;
4
- const YEAR = 365 * 24 * 60 * MINUTE;
5
- const DELAY = /^(\d+)(m|h|d)$/;
6
- const UNIT_MS = { m: MINUTE, h: 60 * MINUTE, d: 24 * 60 * MINUTE };
1
+ import { aheadOf, MINUTE, YEAR } from "./moment.js";
7
2
  /**
8
- * `--at-time`: a time like `2026-09-25T09:00`, or a delay like `30m`, `2h`, `1d`, as an ISO time — the
9
- * same words max-cli takes. Rounded down to the minute, because messengers send at the start of it
10
- * (MAX measured, max-cli `FIND-141`), so the time printed is the time it goes. A time without an
11
- * offset is read in `zone`, the computer's zone when none is given.
3
+ * `--at-time`, a mute's `--until`, a link's `--expire-time`: `aheadOf` within the messenger's limits of a minute to a
4
+ * year, and never a date alone. Rounded down to the minute, because messengers send at the start of it (MAX measured,
5
+ * max-cli `FIND-141`), so the time printed is the time it goes.
12
6
  */
13
7
  export const sendTime = (value, now = Date.now(), flag = "--at-time", zone) => {
14
- const trimmed = value.trim();
15
- const [, amount, unit] = DELAY.exec(trimmed) ?? [];
16
- const at = /^\d{4}-\d{2}-\d{2}[T ]\d{2}:\d{2}/.test(trimmed)
17
- ? calendarMoment(trimmed.replace(" ", "T"), flag, zone === undefined ? {} : { zone })
18
- : amount && unit
19
- ? now + Number(amount) * (UNIT_MS[unit] ?? 0)
20
- : Number.NaN;
21
- if (Number.isNaN(at)) {
22
- throw new CliError("validation_error", `${flag} takes a time like 2026-09-25T09:00 or a delay like 30m, 2h, 1d — not "${value}"`);
23
- }
24
- if (at < now + MINUTE)
25
- throw new CliError("validation_error", `${flag} has to be at least a minute from now`);
26
- if (at > now + YEAR)
27
- throw new CliError("validation_error", `${flag} can be at most a year from now`);
8
+ const at = aheadOf(value, flag, now, {
9
+ ...(zone === undefined ? {} : { zone }),
10
+ refuseDate: true,
11
+ soonest: MINUTE,
12
+ latest: YEAR,
13
+ });
28
14
  return new Date(at - (at % MINUTE)).toISOString();
29
15
  };
@@ -0,0 +1,10 @@
1
+ import * as v from "valibot";
2
+ /** `models chats`: whether chat text may go to a model outside this computer. */
3
+ export declare const chatSending: v.StrictObjectSchema<{
4
+ readonly mode: v.PicklistSchema<["allowed", "ask", "denied"], undefined>;
5
+ readonly meaning: v.StringSchema<undefined>;
6
+ /** When the owner last set it; `null` while it is the default, ask. */
7
+ readonly since: 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>;
8
+ /** `set` only: whether this run changed it. */
9
+ readonly changed: v.OptionalSchema<v.BooleanSchema<undefined>, undefined>;
10
+ }, undefined>;
@@ -0,0 +1,11 @@
1
+ import * as v from "valibot";
2
+ import { text, time } from "./fields.js";
3
+ /** `models chats`: whether chat text may go to a model outside this computer. */
4
+ export const chatSending = v.strictObject({
5
+ mode: v.picklist(["allowed", "ask", "denied"]),
6
+ meaning: text,
7
+ /** When the owner last set it; `null` while it is the default, ask. */
8
+ since: v.nullable(time),
9
+ /** `set` only: whether this run changed it. */
10
+ changed: v.optional(v.boolean()),
11
+ });
@@ -4,8 +4,8 @@ export { reference };
4
4
  export declare const text: v.StringSchema<undefined>;
5
5
  export declare const id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>;
6
6
  export declare const 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`">]>;
7
- /** A time a caller sends: any offset, read as the moment it names. Answers carry `time`, always UTC. */
8
- export declare const zonedTime: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.IsoTimestampAction<string, "an ISO 8601 time with a zone">]>;
7
+ /** A time a caller types, read by the shared past-time grammar (`momentOf`). Answers carry `time`, always UTC. */
8
+ export declare const typedTime: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 64, undefined>, v.DescriptionAction<string, "an ISO 8601 date or time, in the computer's zone without one; or 30m, 2h, 7d ago">]>;
9
9
  export declare const count: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>;
10
10
  /** Fields of an answer item someone other than the owner wrote, as dotted paths: an agent reads them as data. */
11
11
  export declare const untrusted: v.OptionalSchema<v.ArraySchema<v.StringSchema<undefined>, undefined>, undefined>;
@@ -5,8 +5,8 @@ export { reference };
5
5
  export const text = v.string();
6
6
  export const id = v.pipe(v.string(), v.minLength(1));
7
7
  export const time = isoTime;
8
- /** A time a caller sends: any offset, read as the moment it names. Answers carry `time`, always UTC. */
9
- export const zonedTime = v.pipe(v.string(), v.isoTimestamp("an ISO 8601 time with a zone"));
8
+ /** A time a caller types, read by the shared past-time grammar (`momentOf`). Answers carry `time`, always UTC. */
9
+ export const typedTime = v.pipe(v.string(), v.minLength(1), v.maxLength(64), v.description("an ISO 8601 date or time, in the computer's zone without one; or 30m, 2h, 7d ago"));
10
10
  export const count = v.pipe(v.number(), v.integer(), v.minValue(0));
11
11
  /** Fields of an answer item someone other than the owner wrote, as dotted paths: an agent reads them as data. */
12
12
  export const untrusted = v.optional(v.array(text));