@wirecat/cli-core 0.617.0 → 0.619.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 (306) hide show
  1. package/CHANGELOG.md +406 -1
  2. package/README.md +1 -1
  3. package/THIRD_PARTY_NOTICES +3 -0
  4. package/dist/background/backfill.d.ts +21 -0
  5. package/dist/background/backfill.js +41 -0
  6. package/dist/background/daily-archive-timer.d.ts +1 -1
  7. package/dist/background/deliver.d.ts +5 -2
  8. package/dist/background/deliver.js +30 -12
  9. package/dist/background/report/messages.js +4 -1
  10. package/dist/background/report/render.d.ts +3 -1
  11. package/dist/background/report/render.js +3 -1
  12. package/dist/background/report/view.js +4 -1
  13. package/dist/background/schedules.d.ts +17 -0
  14. package/dist/background/schedules.js +21 -8
  15. package/dist/calendar/cli/answers.d.ts +1 -0
  16. package/dist/calendar/cli/answers.js +6 -1
  17. package/dist/calendar/cli/index.js +2 -14
  18. package/dist/calendar/cli/people-link.d.ts +3 -0
  19. package/dist/calendar/cli/people-link.js +23 -0
  20. package/dist/calendar/index.d.ts +1 -1
  21. package/dist/calendar/index.js +1 -1
  22. package/dist/calendar/mcp/index.d.ts +12 -12
  23. package/dist/cli/base-stages-command.d.ts +22 -0
  24. package/dist/cli/base-stages-command.js +174 -0
  25. package/dist/cli/command-runs.d.ts +2 -0
  26. package/dist/cli/command-runs.js +3 -1
  27. package/dist/cli/config-command.js +6 -1
  28. package/dist/cli/context.d.ts +5 -0
  29. package/dist/cli/context.js +1 -0
  30. package/dist/cli/group-lock.d.ts +42 -0
  31. package/dist/cli/group-lock.js +130 -0
  32. package/dist/cli/index.d.ts +10 -4
  33. package/dist/cli/index.js +10 -4
  34. package/dist/cli/messenger/backfill-command.js +27 -15
  35. package/dist/cli/messenger/contacts-command.js +10 -3
  36. package/dist/cli/messenger/context.js +1 -0
  37. package/dist/cli/messenger/doctor-command.js +3 -1
  38. package/dist/cli/messenger/models-command.js +1 -1
  39. package/dist/cli/messenger/serve-command.js +24 -2
  40. package/dist/cli/messenger/serve-outdated.d.ts +22 -0
  41. package/dist/cli/messenger/serve-outdated.js +100 -0
  42. package/dist/cli/messenger/store-maintenance-command.d.ts +22 -2
  43. package/dist/cli/messenger/store-maintenance-command.js +9 -4
  44. package/dist/cli/model-catalogue-command.d.ts +3 -1
  45. package/dist/cli/model-catalogue-command.js +46 -2
  46. package/dist/cli/profile.d.ts +8 -0
  47. package/dist/cli/profile.js +25 -0
  48. package/dist/cli/program.js +2 -0
  49. package/dist/cli/runs/search-query.d.ts +1 -1
  50. package/dist/cli/runs/search-query.js +4 -0
  51. package/dist/cli/runs/search.d.ts +5 -1
  52. package/dist/cli/runs/search.js +12 -1
  53. package/dist/cli/schedule/schedule-command.d.ts +9 -0
  54. package/dist/cli/schedule/schedule-command.js +13 -0
  55. package/dist/cli/search-left-out.d.ts +6 -1
  56. package/dist/cli/search-left-out.js +9 -4
  57. package/dist/cli/settings.d.ts +8 -0
  58. package/dist/cli/settings.js +17 -2
  59. package/dist/cli/shared-command-exports.d.ts +16 -0
  60. package/dist/cli/store-recover.d.ts +3 -3
  61. package/dist/cli/store-recover.js +47 -23
  62. package/dist/cli/store-settings.d.ts +2 -0
  63. package/dist/cli/store-settings.js +37 -9
  64. package/dist/crm/cli/index.js +38 -6
  65. package/dist/crm/group-hint.d.ts +8 -0
  66. package/dist/crm/group-hint.js +13 -0
  67. package/dist/crm/source.d.ts +12 -1
  68. package/dist/crm/sync.d.ts +31 -2
  69. package/dist/crm/sync.js +110 -3
  70. package/dist/crm/testing/acme-scenario.d.ts +40 -0
  71. package/dist/crm/testing/acme-scenario.js +170 -0
  72. package/dist/crm/testing/index.d.ts +1 -0
  73. package/dist/crm/testing/index.js +1 -0
  74. package/dist/crm/testing/source-contract.js +12 -0
  75. package/dist/crm/testing/source.d.ts +2 -0
  76. package/dist/crm/testing/source.js +1 -0
  77. package/dist/domain/addresses.d.ts +13 -0
  78. package/dist/domain/addresses.js +63 -0
  79. package/dist/domain/categories.d.ts +3 -0
  80. package/dist/domain/categories.js +2 -0
  81. package/dist/domain/crm.d.ts +23 -0
  82. package/dist/domain/crm.js +7 -0
  83. package/dist/domain/links.d.ts +17 -4
  84. package/dist/domain/links.js +20 -7
  85. package/dist/domain/mentions.d.ts +2 -12
  86. package/dist/domain/mentions.js +2 -19
  87. package/dist/domain/orders.d.ts +8 -1
  88. package/dist/domain/orders.js +6 -2
  89. package/dist/domain/phones.d.ts +26 -0
  90. package/dist/domain/phones.js +48 -0
  91. package/dist/domain/record-types.d.ts +1 -1
  92. package/dist/domain/record-types.js +1 -0
  93. package/dist/domain/records.d.ts +5 -0
  94. package/dist/domain/ref-summaries.d.ts +39 -0
  95. package/dist/domain/ref-summaries.js +51 -3
  96. package/dist/domain/relations.d.ts +27 -2
  97. package/dist/domain/relations.js +37 -3
  98. package/dist/domain/vcard.d.ts +2 -2
  99. package/dist/domain/vcard.js +4 -10
  100. package/dist/embeddings/models.d.ts +11 -3
  101. package/dist/embeddings/models.js +28 -4
  102. package/dist/entities/business-context.d.ts +149 -0
  103. package/dist/entities/business-context.js +192 -0
  104. package/dist/entities/contact-activity.d.ts +2 -0
  105. package/dist/entities/contact-activity.js +7 -1
  106. package/dist/entities/contact-context.d.ts +157 -0
  107. package/dist/entities/contact-context.js +2 -0
  108. package/dist/entities/deal.d.ts +10 -0
  109. package/dist/entities/deal.js +2 -0
  110. package/dist/entities/index.d.ts +23 -3
  111. package/dist/entities/index.js +5 -0
  112. package/dist/entities/mention.d.ts +4 -3
  113. package/dist/entities/mention.js +2 -1
  114. package/dist/entities/message-transfer.d.ts +4 -2
  115. package/dist/entities/message-transfer.js +2 -2
  116. package/dist/entities/model.d.ts +2 -2
  117. package/dist/entities/model.js +1 -1
  118. package/dist/entities/relationship.d.ts +4 -0
  119. package/dist/entities/relationship.js +4 -0
  120. package/dist/errors/reasons.js +44 -4
  121. package/dist/fetch/page.js +2 -1
  122. package/dist/index.d.ts +4 -3
  123. package/dist/index.js +4 -3
  124. package/dist/meetings/context-store.d.ts +2 -0
  125. package/dist/meetings/findings-rules.d.ts +4 -0
  126. package/dist/meetings/findings-rules.js +5 -2
  127. package/dist/meetings/mcp/index.d.ts +15 -15
  128. package/dist/meetings/result-items.d.ts +1 -0
  129. package/dist/meetings/result-items.js +1 -0
  130. package/dist/models/index.js +22 -5
  131. package/dist/runs/events.d.ts +11 -1
  132. package/dist/runs/events.js +3 -1
  133. package/dist/runs/log-attributes.js +4 -0
  134. package/dist/runs/log-events.js +2 -0
  135. package/dist/runs/recording.d.ts +3 -0
  136. package/dist/runs/recording.js +36 -12
  137. package/dist/runs/run.d.ts +12 -3
  138. package/dist/runs/run.js +32 -13
  139. package/dist/search/account-list.d.ts +6 -0
  140. package/dist/search/account-list.js +9 -3
  141. package/dist/search/groups.d.ts +68 -0
  142. package/dist/search/groups.js +172 -0
  143. package/dist/services/account-groups.d.ts +28 -0
  144. package/dist/services/account-groups.js +89 -0
  145. package/dist/services/archive.d.ts +7 -1
  146. package/dist/services/archive.js +19 -3
  147. package/dist/services/business-context.d.ts +113 -0
  148. package/dist/services/business-context.js +156 -0
  149. package/dist/services/communications.d.ts +50 -0
  150. package/dist/services/communications.js +140 -0
  151. package/dist/services/deal-context.d.ts +90 -0
  152. package/dist/services/deal-context.js +131 -0
  153. package/dist/services/deps.d.ts +2 -0
  154. package/dist/services/enrichment.d.ts +7 -2
  155. package/dist/services/enrichment.js +46 -5
  156. package/dist/services/events-search.js +2 -1
  157. package/dist/services/group-guard.d.ts +28 -0
  158. package/dist/services/group-guard.js +131 -0
  159. package/dist/services/index.d.ts +15 -2
  160. package/dist/services/index.js +9 -2
  161. package/dist/services/ingest.d.ts +12 -0
  162. package/dist/services/ingest.js +4 -0
  163. package/dist/services/link-scorers/chat-senders.js +39 -29
  164. package/dist/services/link-scorers/member-chats.js +4 -3
  165. package/dist/services/link-scorers/member-dialog.js +5 -7
  166. package/dist/services/link-scorers/scan.js +17 -8
  167. package/dist/services/link-scorers/shared.d.ts +6 -2
  168. package/dist/services/link-scorers/shared.js +6 -2
  169. package/dist/services/link-scorers/types.d.ts +2 -0
  170. package/dist/services/meaning-model.d.ts +7 -0
  171. package/dist/services/meaning-model.js +20 -0
  172. package/dist/services/meeting-context.d.ts +6 -1
  173. package/dist/services/meeting-context.js +12 -5
  174. package/dist/services/message-resolution.js +2 -3
  175. package/dist/services/messages-meaning.js +4 -5
  176. package/dist/services/messages-search.d.ts +5 -1
  177. package/dist/services/messages-search.js +1 -1
  178. package/dist/services/model-downloads.d.ts +1 -1
  179. package/dist/services/model-downloads.js +6 -4
  180. package/dist/services/money-context.d.ts +73 -0
  181. package/dist/services/money-context.js +77 -0
  182. package/dist/services/notes-search.d.ts +4 -1
  183. package/dist/services/notes-search.js +19 -7
  184. package/dist/services/organization-context.d.ts +80 -0
  185. package/dist/services/organization-context.js +154 -0
  186. package/dist/services/people.d.ts +22 -6
  187. package/dist/services/people.js +38 -8
  188. package/dist/services/person-business.d.ts +43 -0
  189. package/dist/services/person-business.js +67 -0
  190. package/dist/services/person-context.d.ts +9 -1
  191. package/dist/services/person-context.js +5 -3
  192. package/dist/services/proposals/kinds/identity-link.d.ts +4 -0
  193. package/dist/services/proposals/kinds/identity-link.js +48 -0
  194. package/dist/services/proposals/kinds/orders.js +1 -1
  195. package/dist/services/proposals/registry.js +2 -0
  196. package/dist/services/search-kind.d.ts +12 -5
  197. package/dist/services/search-kind.js +49 -10
  198. package/dist/services/text-model-choice.js +1 -1
  199. package/dist/store/accounts.d.ts +18 -0
  200. package/dist/store/accounts.js +18 -3
  201. package/dist/store/damage.d.ts +43 -10
  202. package/dist/store/damage.js +119 -36
  203. package/dist/store/decisions.js +3 -1
  204. package/dist/store/evidence-findings.d.ts +14 -0
  205. package/dist/store/evidence-findings.js +2 -0
  206. package/dist/store/exports.d.ts +2 -1
  207. package/dist/store/identity-links.d.ts +92 -0
  208. package/dist/store/identity-links.js +6 -0
  209. package/dist/store/index.d.ts +11 -5
  210. package/dist/store/index.js +5 -2
  211. package/dist/store/journal.d.ts +10 -0
  212. package/dist/store/journal.js +33 -0
  213. package/dist/store/marks.d.ts +19 -1
  214. package/dist/store/marks.js +23 -1
  215. package/dist/store/migrations.d.ts +1 -1
  216. package/dist/store/migrations.js +35 -12
  217. package/dist/store/people.d.ts +22 -0
  218. package/dist/store/people.js +15 -1
  219. package/dist/store/recover.d.ts +34 -0
  220. package/dist/store/recover.js +188 -6
  221. package/dist/store/refill.d.ts +28 -0
  222. package/dist/store/refill.js +120 -0
  223. package/dist/store/sqlite/accounts.js +2 -0
  224. package/dist/store/sqlite/base-stages.d.ts +122 -0
  225. package/dist/store/sqlite/base-stages.js +443 -0
  226. package/dist/store/sqlite/base-suggest.d.ts +13 -0
  227. package/dist/store/sqlite/base-suggest.js +62 -0
  228. package/dist/store/sqlite/business-contracts.js +10 -1
  229. package/dist/store/sqlite/clients.d.ts +7 -3
  230. package/dist/store/sqlite/clients.js +11 -7
  231. package/dist/store/sqlite/crm-settings.d.ts +12 -2
  232. package/dist/store/sqlite/crm-settings.js +56 -13
  233. package/dist/store/sqlite/crm.d.ts +13 -1
  234. package/dist/store/sqlite/crm.js +20 -4
  235. package/dist/store/sqlite/deals.d.ts +33 -0
  236. package/dist/store/sqlite/deals.js +42 -4
  237. package/dist/store/sqlite/decision-requests.js +7 -3
  238. package/dist/store/sqlite/email-index.js +17 -15
  239. package/dist/store/sqlite/evidence-findings.js +29 -5
  240. package/dist/store/sqlite/findings-core.js +4 -2
  241. package/dist/store/sqlite/identity-link-rows.d.ts +50 -0
  242. package/dist/store/sqlite/identity-link-rows.js +146 -0
  243. package/dist/store/sqlite/identity-proposals.d.ts +53 -0
  244. package/dist/store/sqlite/identity-proposals.js +234 -0
  245. package/dist/store/sqlite/knowledge.js +5 -3
  246. package/dist/store/sqlite/link-kinds.d.ts +1 -0
  247. package/dist/store/sqlite/link-kinds.js +1 -0
  248. package/dist/store/sqlite/link-row.d.ts +6 -0
  249. package/dist/store/sqlite/link-row.js +35 -0
  250. package/dist/store/sqlite/link-source.d.ts +10 -0
  251. package/dist/store/sqlite/link-source.js +16 -0
  252. package/dist/store/sqlite/manifest.js +1 -0
  253. package/dist/store/sqlite/meeting-context-links.js +9 -6
  254. package/dist/store/sqlite/memories.js +9 -7
  255. package/dist/store/sqlite/mentions.d.ts +4 -1
  256. package/dist/store/sqlite/mentions.js +14 -9
  257. package/dist/store/sqlite/migrations.generated.js +8 -0
  258. package/dist/store/sqlite/note-index.js +9 -7
  259. package/dist/store/sqlite/notes.d.ts +2 -3
  260. package/dist/store/sqlite/notes.js +6 -29
  261. package/dist/store/sqlite/open-store.js +3 -0
  262. package/dist/store/sqlite/open.js +11 -2
  263. package/dist/store/sqlite/orders.d.ts +2 -0
  264. package/dist/store/sqlite/orders.js +9 -3
  265. package/dist/store/sqlite/organization-categories.d.ts +18 -0
  266. package/dist/store/sqlite/organization-categories.js +34 -0
  267. package/dist/store/sqlite/organizations.d.ts +5 -1
  268. package/dist/store/sqlite/organizations.js +14 -4
  269. package/dist/store/sqlite/person-links.d.ts +19 -4
  270. package/dist/store/sqlite/person-links.js +49 -11
  271. package/dist/store/sqlite/person-match-scan.d.ts +13 -0
  272. package/dist/store/sqlite/person-match-scan.js +251 -0
  273. package/dist/store/sqlite/person-matcher.d.ts +16 -0
  274. package/dist/store/sqlite/person-matcher.js +32 -0
  275. package/dist/store/sqlite/proposed-actions.js +6 -0
  276. package/dist/store/sqlite/record-matching.d.ts +2 -8
  277. package/dist/store/sqlite/record-matching.js +8 -40
  278. package/dist/store/sqlite/record-projectors-phone.js +2 -1
  279. package/dist/store/sqlite/record-relationships.d.ts +52 -0
  280. package/dist/store/sqlite/record-relationships.js +243 -0
  281. package/dist/store/sqlite/record-run.d.ts +5 -0
  282. package/dist/store/sqlite/record-run.js +62 -2
  283. package/dist/store/sqlite/record-writes.d.ts +1 -1
  284. package/dist/store/sqlite/record-writes.js +4 -2
  285. package/dist/store/sqlite/records.js +27 -2
  286. package/dist/store/sqlite/ref-accounts.d.ts +13 -0
  287. package/dist/store/sqlite/ref-accounts.js +117 -0
  288. package/dist/store/sqlite/ref-summaries.js +5 -1
  289. package/dist/store/sqlite/relation-list.d.ts +4 -1
  290. package/dist/store/sqlite/relation-list.js +20 -2
  291. package/dist/store/sqlite/relation-proposals.d.ts +18 -1
  292. package/dist/store/sqlite/relation-proposals.js +53 -11
  293. package/dist/store/sqlite/relation-roles.js +12 -6
  294. package/dist/store/sqlite/reported-relations.d.ts +11 -1
  295. package/dist/store/sqlite/reported-relations.js +59 -18
  296. package/dist/store/sqlite/schema.d.ts +32 -0
  297. package/dist/store/sqlite/schema.js +3 -0
  298. package/dist/store/sqlite/transaction.d.ts +13 -0
  299. package/dist/store/sqlite/transaction.js +33 -15
  300. package/dist/store/store.d.ts +3 -0
  301. package/dist/store/store.js +5 -0
  302. package/dist/store/write-events.d.ts +18 -0
  303. package/dist/store/write-events.js +88 -0
  304. package/package.json +3 -3
  305. package/parity.json +11 -4
  306. package/schemas/records-envelope.v1.schema.json +3 -0
@@ -254,10 +254,11 @@ export declare const messageSyncAll: v.StrictObjectSchema<{
254
254
  }, v.UnknownSchema, undefined>, undefined>;
255
255
  readonly limited: v.OptionalSchema<v.PicklistSchema<["group_too_large", "older_than_window"], undefined>, undefined>;
256
256
  }, undefined>, undefined>;
257
- /** How many chats the history limits left unread (big groups) or read only to the window's start. */
257
+ /** How many chats the history limits left unread (big groups) or read only to the window's start; muted, unread. */
258
258
  readonly limited: v.OptionalSchema<v.StrictObjectSchema<{
259
259
  readonly group_too_large: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>;
260
260
  readonly older_than_window: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>;
261
+ readonly muted: v.OptionalSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>, undefined>;
261
262
  }, undefined>, undefined>;
262
263
  readonly tasks: v.OptionalSchema<v.StrictObjectSchema<{
263
264
  readonly added: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>;
@@ -387,10 +388,11 @@ export declare const messageSync: v.UnionSchema<[v.StrictObjectSchema<{
387
388
  }, v.UnknownSchema, undefined>, undefined>;
388
389
  readonly limited: v.OptionalSchema<v.PicklistSchema<["group_too_large", "older_than_window"], undefined>, undefined>;
389
390
  }, undefined>, undefined>;
390
- /** How many chats the history limits left unread (big groups) or read only to the window's start. */
391
+ /** How many chats the history limits left unread (big groups) or read only to the window's start; muted, unread. */
391
392
  readonly limited: v.OptionalSchema<v.StrictObjectSchema<{
392
393
  readonly group_too_large: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>;
393
394
  readonly older_than_window: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>;
395
+ readonly muted: v.OptionalSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>, undefined>;
394
396
  }, undefined>, undefined>;
395
397
  readonly tasks: v.OptionalSchema<v.StrictObjectSchema<{
396
398
  readonly added: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>;
@@ -83,8 +83,8 @@ export const messageSyncAll = v.strictObject({
83
83
  issue: v.optional(actionableError),
84
84
  limited: v.optional(historyLimited),
85
85
  })),
86
- /** How many chats the history limits left unread (big groups) or read only to the window's start. */
87
- limited: v.optional(v.strictObject({ group_too_large: count, older_than_window: count })),
86
+ /** How many chats the history limits left unread (big groups) or read only to the window's start; muted, unread. */
87
+ limited: v.optional(v.strictObject({ group_too_large: count, older_than_window: count, muted: v.optional(count) })),
88
88
  tasks,
89
89
  });
90
90
  export const messageSyncStarted = v.strictObject({ job: id, pid: count, chat: text, log: text });
@@ -10,7 +10,7 @@ export declare const model: v.StrictObjectSchema<{
10
10
  /** Which languages it reads, in words. */
11
11
  readonly languages: v.StringSchema<undefined>;
12
12
  readonly licence: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
13
- /** A text model's licence terms to accept with `models download --accept-terms`. */
13
+ /** A text model's licence page, for a model under conditions of its own (`NOTICE` beside its files says the same). */
14
14
  readonly terms: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
15
15
  /** A text model's size next to the others: small is fastest, large reads best. */
16
16
  readonly size: v.OptionalSchema<v.PicklistSchema<["small", "medium", "large"], undefined>, undefined>;
@@ -36,7 +36,7 @@ export declare const chosenModel: v.StrictObjectSchema<{
36
36
  /** Which languages it reads, in words. */
37
37
  readonly languages: v.StringSchema<undefined>;
38
38
  readonly licence: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
39
- /** A text model's licence terms to accept with `models download --accept-terms`. */
39
+ /** A text model's licence page, for a model under conditions of its own (`NOTICE` beside its files says the same). */
40
40
  readonly terms: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
41
41
  /** A text model's size next to the others: small is fastest, large reads best. */
42
42
  readonly size: v.OptionalSchema<v.PicklistSchema<["small", "medium", "large"], undefined>, undefined>;
@@ -11,7 +11,7 @@ export const model = v.strictObject({
11
11
  /** Which languages it reads, in words. */
12
12
  languages: text,
13
13
  licence: v.optional(text),
14
- /** A text model's licence terms to accept with `models download --accept-terms`. */
14
+ /** A text model's licence page, for a model under conditions of its own (`NOTICE` beside its files says the same). */
15
15
  terms: v.optional(text),
16
16
  /** A text model's size next to the others: small is fastest, large reads best. */
17
17
  size: v.optional(v.picklist(["small", "medium", "large"])),
@@ -19,5 +19,9 @@ export declare const relationship: v.StrictObjectSchema<{
19
19
  readonly position: v.NullableSchema<v.StringSchema<undefined>, undefined>;
20
20
  readonly starts_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>;
21
21
  readonly ends_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>;
22
+ /** The source account that reported it, `<provider>:<account>`. */
23
+ readonly account: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
24
+ /** How a source made it when it stated none, such as `department-head`. */
25
+ readonly derived: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
22
26
  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`">]>;
23
27
  }, undefined>;
@@ -21,5 +21,9 @@ export const relationship = v.strictObject({
21
21
  position: v.nullable(text),
22
22
  starts_at: v.nullable(time),
23
23
  ends_at: v.nullable(time),
24
+ /** The source account that reported it, `<provider>:<account>`. */
25
+ account: v.optional(text),
26
+ /** How a source made it when it stated none, such as `department-head`. */
27
+ derived: v.optional(text),
24
28
  created_at: time,
25
29
  });
@@ -60,6 +60,8 @@ const OTHERS = [
60
60
  ["query.time-limit", "timeout", "the search took longer than its time limit; the query itself is valid"],
61
61
  ["enrichment.owner-only", "permission_error", "only the owner turns enrichment on, not an agent"],
62
62
  ["model.offline", "permission_error", "downloading a model needs the network; --offline was requested"],
63
+ ["model.key-rejected", "invalid_response", "the model provider refused the API key (401 or 403)"],
64
+ ["model.unreachable", "invalid_response", "the model provider could not be reached over the network"],
63
65
  [
64
66
  "contract.unacknowledged-override",
65
67
  "configuration_error",
@@ -82,6 +84,7 @@ const OTHERS = [
82
84
  validation("mail-findings.invalid", "a checked mail findings batch would be refused; details.problems names why, finding by finding"),
83
85
  validation("mail-findings.key-used", "the findings batch key was already used for different input"),
84
86
  validation("finding.unknown-field", "a finding has a field its kind does not take"),
87
+ validation("finding.quote-not-found", "a finding's quote is not in the text it cites, word for word"),
85
88
  validation("finding.missing-field", "a finding leaves out a field its kind needs"),
86
89
  validation("document.changed", "the document changed while it was read; nothing was saved"),
87
90
  ["document.not-imported", "not_found", "the document is not imported in this source account"],
@@ -153,7 +156,7 @@ const OTHERS = [
153
156
  [
154
157
  "source.needs-sign-in",
155
158
  "authentication_error",
156
- "the page asks for a sign-in; a private Google document is read through Drive",
159
+ "the page asks for a sign-in; add a private Google document with drive documents add <url> --profiles <names|all>",
157
160
  ],
158
161
  validation("source.too-large", "the source is larger than one read takes"),
159
162
  validation("source.unsupported", "no reader takes this kind of source"),
@@ -194,6 +197,11 @@ const OTHERS = [
194
197
  "configuration_error",
195
198
  "the store file is damaged; store recover says what is lost and recovers it",
196
199
  ],
200
+ [
201
+ "store.journal-replaced",
202
+ "conflict",
203
+ "another program deleted or replaced the store's journal file while it was open; store recover says what to do",
204
+ ],
197
205
  validation("store.file-damaged", "the named store file is damaged or not a database"),
198
206
  [
199
207
  "store.unreadable",
@@ -207,6 +215,11 @@ const OTHERS = [
207
215
  "recovering the store needs the sqlite3 program, 3.43 or newer, with its .recover command",
208
216
  ],
209
217
  validation("store.recovery-failed", "the recovered store did not pass its check, so the store was left as it was"),
218
+ [
219
+ "serve.outdated",
220
+ "configuration_error",
221
+ "the store or the installed version is newer than this serve; it stopped so its unit starts the installed one",
222
+ ],
210
223
  validation("store.recovering", "another recovery of the store is running; wait for it to finish"),
211
224
  validation("store.changed-during-recovery", "the store was written to during the recovery, so it was left as it was"),
212
225
  [
@@ -277,8 +290,18 @@ const OTHERS = [
277
290
  validation("deal.closed", "a deleted deal or lead does not move or close"),
278
291
  validation("deal.copy", "a CRM's copy changes in the CRM; its next sync brings the change here"),
279
292
  validation("deal.field", "a field of the deal or lead is not valid"),
293
+ ["deal.denied", "permission_error", "the profile denies listing deals or leads, so none is answered"],
294
+ ["deal.out-of-scope", "not_found", "the deal or lead is a copy from an account outside the accounts asked for"],
280
295
  validation("deal.ref", "the reference names no deal or lead"),
281
296
  validation("deal.stage", "no stage of that name, or a stage name more than one pipeline has"),
297
+ validation("stage.base-field", "a base stage needs a name its set has once and a position within the set"),
298
+ validation("stage.base-outcome", "a base set keeps at least one stage of each outcome: open, won and lost"),
299
+ validation("stage.base-in-use", "the owner's own deals or leads stand or stood in that base stage"),
300
+ validation("stage.choice-required", "more than one stage of the row's pipeline maps to that base stage; move to one of the candidates"),
301
+ validation("stage.ref", "a stage is named by its stage:<id> reference"),
302
+ ["stage.owner-only", "permission_error", "only the owner confirms mappings and edits a base set, not an agent"],
303
+ validation("stage.unmapped", "no stage of the row's pipeline maps to that base stage; map one first"),
304
+ ["stage.not-found", "not_found", "no stored stage has that reference or name"],
282
305
  validation("pipeline.ambiguous", "more than one pipeline has that name; name it by its pipeline: reference"),
283
306
  validation("pipeline.duplicate", "a pipeline of that name and kind is already stored"),
284
307
  validation("pipeline.field", "a pipeline needs a name and at least one stage, each named once"),
@@ -292,6 +315,7 @@ const OTHERS = [
292
315
  validation("field.unknown-kind", "fields are listed for deals, leads, people and organizations only"),
293
316
  validation("crm.write-unsupported", "the CRM does not take this write, or does not recognise a repeated one"),
294
317
  validation("crm.unlisted-held", "a list of every id would mark most of a kind deleted; nothing was, until --rescan"),
318
+ validation("crm.narrowing-held", "the default scope mine would mark most of a kind's stored rows deleted; none is, until the owner sets the scope"),
295
319
  validation("crm.not-reported", "the CRM did not list users or departments; what they would say is unknown, nothing withdrawn"),
296
320
  validation("crm.reference-unknown", "a CRM row names a contact, company or user the store does not hold; that link was not made"),
297
321
  validation("crm.pending-dropped", "relationships waited too long for an end that never came; they were dropped"),
@@ -338,12 +362,25 @@ const OTHERS = [
338
362
  "conflict",
339
363
  "the owner separated this identity from that person; only the owner links it again",
340
364
  ],
341
- ["identity.owner-only", "permission_error", "only the owner undoes a merge or splits a person"],
365
+ [
366
+ "identity.owner-only",
367
+ "permission_error",
368
+ "only the owner undoes a merge, splits a person, confirms or undoes a link, or links an identity to themselves",
369
+ ],
342
370
  [
343
371
  "identity.stale",
344
372
  "conflict",
345
- "an identity of the merge was merged on into another person since; undo that merge first",
373
+ "the people a merge or a proposed link names changed since; undo the later merge, or propose the link again",
374
+ ],
375
+ [
376
+ "identity.rejected",
377
+ "conflict",
378
+ "the owner rejected linking these people on this evidence; only a new signal or identity proposes them again",
346
379
  ],
380
+ validation("identity.same", "the two identities are one person already"),
381
+ validation("identity.shared-phone", "more than six people share the phone number, so it proposes no one"),
382
+ validation("identity.shared-email", "more than six people share the address, so it proposes no one"),
383
+ validation("identity-link.dedicated-review", "an identity link is staged and decided through the people review"),
347
384
  ["transcription.no-key", "authentication_error", "no OpenAI key is set for transcription"],
348
385
  validation("transcription.too-large", "the audio is over the transcription provider's size limit"),
349
386
  [
@@ -359,7 +396,7 @@ const OTHERS = [
359
396
  validation("name.taken", "the name is already used"),
360
397
  validation("period.ambiguous", "the period can be read more than one way"),
361
398
  validation("proposal.wrong-state", "the proposal is not in a state that allows this"),
362
- validation("proposal.reason-required", "an agent deciding for the owner gives a reason"),
399
+ validation("proposal.reason-required", "an agent deciding for the owner, or proposing a link, gives a reason"),
363
400
  validation("decision.request-invalid", "a decision request needs its batch, message, owner and distinct known actions"),
364
401
  ["decision.token-unknown", "not_found", "no button has this token"],
365
402
  ["decision.token-used", "permission_error", "this button was already pressed"],
@@ -376,6 +413,7 @@ const OTHERS = [
376
413
  ],
377
414
  validation("proposal.decider-required", "a decision names who decides: the owner or an agent with a reason"),
378
415
  validation("proposal.ids", "the proposal ids cannot be read"),
416
+ ["group.outside", "permission_error", "the process is locked to a group, and this belongs to accounts outside it"],
379
417
  ["proposal.own", "permission_error", "an agent never decides its own proposal"],
380
418
  ["proposal.owner-only", "permission_error", "only the owner decides this proposal"],
381
419
  ["proposals.agent-decisions-off", "permission_error", "agent decisions are turned off; the owner decides"],
@@ -385,6 +423,8 @@ const OTHERS = [
385
423
  validation("relationship.role-built-in", "a built-in role stays on its list"),
386
424
  validation("relationship.role-in-use", "relationships still hold that role; change them first (details.count)"),
387
425
  validation("relationship.role-unknown", "the role is not one the relationship takes; the message lists them"),
426
+ validation("relationship.engagement-ends", "only a person's member-of a project takes an engagement level"),
427
+ validation("relationship.engagement-unknown", "the engagement level is not none, low, medium or high"),
388
428
  validation("ranking.invalid", "the ranking is not valid"),
389
429
  validation("ref.malformed", "the reference has a known kind but not its shape"),
390
430
  validation("ref.unknown-kind", "the text names no kind of reference"),
@@ -106,7 +106,8 @@ const readBody = async (response, limit) => {
106
106
  }
107
107
  return bytes;
108
108
  };
109
- const needsSignIn = (url) => new CliError("authentication_error", `${url.hostname} asks for a sign-in: read a private Google document through Drive`, {
109
+ const needsSignIn = (url) => new CliError("authentication_error", `${url.hostname} asks for a sign-in: add a private Google document through Drive, with ` +
110
+ "drive documents add <url> --profiles <names|all>", {
110
111
  reason: "source.needs-sign-in",
111
112
  });
112
113
  /**
package/dist/index.d.ts CHANGED
@@ -1,12 +1,13 @@
1
+ export { isNoReplyAddress, isRoleAddress, ROLE_ADDRESS_WORDS } from "./domain/addresses.js";
1
2
  export { CATALOG_KINDS, type CatalogKind, CONTRACT_KINDS, CONTRACT_STATUSES, type ContractKind, type ContractStatus, type Interval, intervalOf, intervalText, ORDER_DIRECTIONS, type OrderDirection, PERIOD_UNITS, type PeriodUnit, SUBSCRIPTION_STATUSES, type SubscriptionStatus, TRANSACTION_STATUSES, type TransactionStatus, WALLET_KINDS, type WalletKind, } from "./domain/business.js";
2
3
  export { bareCheck, type CheckWords, checkWords } from "./domain/checks.js";
3
4
  export type { CounterField, CounterObservation, CounterObservations, CounterState } from "./domain/counters.js";
4
5
  export { COUNTER_FIELDS, counterValue, observedCounters } from "./domain/counters.js";
5
- export { CRM_KINDS, type CrmDepartment, type CrmField, type CrmItem, type CrmKind, type CrmOrganization, type CrmPerson, type CrmPipeline, type CrmRecords, type CrmStage, type CrmUser, type CrmValue, isItemKind, } from "./domain/crm.js";
6
+ export { CRM_KINDS, type CrmDepartment, type CrmField, type CrmItem, type CrmKind, type CrmOrganization, type CrmPerson, type CrmPipeline, type CrmRecords, type CrmScope, type CrmScopeSetting, type CrmStage, type CrmUser, type CrmValue, isCrmUserId, isItemKind, normalCrmUserId, } from "./domain/crm.js";
6
7
  export { DEAL_KINDS, DEAL_ROLES, DEAL_STATUSES, type DealKind, type DealRole, type DealStatus, STAGE_OUTCOMES, type StageOutcome, } from "./domain/deals.js";
7
8
  export { FINANCE_REVIEWS, type FinanceReview, INVOICE_DIRECTIONS, INVOICE_STATUSES, type InvoiceDirection, type InvoiceStatus, MONEY_DIRECTIONS, type MoneyDirection, } from "./domain/finance.js";
8
9
  export { type FormattedText, type HtmlFormatting, type MarkdownFormatting, type TextSpan, validateFormattedText, } from "./domain/formatting.js";
9
- export { DEFAULT_LINK_CONFIG, type DeepLinkTarget, formatLink, LINK_VERSION, type LinkConfig, type LinkForm, linkConfigOf, linkFor, linkTargetOf, parseLink, } from "./domain/links.js";
10
+ export { DEFAULT_LINK_CONFIG, type DeepLinkTarget, formatLink, LINK_VERSION, type LinkConfig, type LinkForm, linkConfigOf, linkFor, linkTargetOf, parseLink, refsForLink, } from "./domain/links.js";
10
11
  export { formatLocator, isLocator, type MessageLocator, parseLocator } from "./domain/locator.js";
11
12
  export { type Markup, parseMarkdown } from "./domain/markdown.js";
12
13
  export { parseMarkdownSpans } from "./domain/markdown-spans.js";
@@ -21,7 +22,7 @@ export type { RankingComponent, RankingInput, RankingMeasure, RankingOptions, Ra
21
22
  export { rankingOptions } from "./domain/rankings-options.js";
22
23
  export { type EnvelopeOptions, type EnvelopeRecord, type EnvelopeSource, envelopeOfJsonl, envelopeOfText, type IngestError, RECORD_ENTITY_TYPES, RECORD_OPERATIONS, RECORDS_ENVELOPE_SCHEMA, RECORDS_SCHEMA_VERSION, type RecordEntityType, type RecordOperation, type RecordRelation, type RecordsEnvelope, } from "./domain/records.js";
23
24
  export { canonicalReference, formatReference, looksLikeReference, parseReference, REF_KINDS, type Reference, type RefKindName, type RefKindSpec, } from "./domain/references.js";
24
- export { inverseOf, isUsable, ORGANIZATION_ROLES, PROJECT_ROLES, RELATION_KINDS, RELATIONS, type RelationKind, ROLE_LISTS, type RoleList, rolesOf, STANDINGS, type Standing, standingOf, usableLink, } from "./domain/relations.js";
25
+ export { byEngagement, CONTRACT_ROLES, ENGAGEMENT_LEVELS, type Engagement, engagementRank, inverseOf, isUsable, ORGANIZATION_ROLES, PROJECT_ROLES, RELATION_KINDS, RELATIONS, type RelationKind, ROLE_LISTS, type RoleList, rolesOf, STANDINGS, type Standing, standingOf, usableLink, } from "./domain/relations.js";
25
26
  export { normalizeTag, TAG_TYPES, type TagType } from "./domain/tags.js";
26
27
  export { envelopeOfVcard, isVcard, type VcardIssue, type VcardOptions } from "./domain/vcard.js";
27
28
  export { type AppErrors, DETAILS as CORE_DETAILS, failureContext, REASONS as CORE_REASONS } from "./errors/reasons.js";
package/dist/index.js CHANGED
@@ -1,11 +1,12 @@
1
+ export { isNoReplyAddress, isRoleAddress, ROLE_ADDRESS_WORDS } from "./domain/addresses.js";
1
2
  export { CATALOG_KINDS, CONTRACT_KINDS, CONTRACT_STATUSES, intervalOf, intervalText, ORDER_DIRECTIONS, PERIOD_UNITS, SUBSCRIPTION_STATUSES, TRANSACTION_STATUSES, WALLET_KINDS, } from "./domain/business.js";
2
3
  export { bareCheck, checkWords } from "./domain/checks.js";
3
4
  export { COUNTER_FIELDS, counterValue, observedCounters } from "./domain/counters.js";
4
- export { CRM_KINDS, isItemKind, } from "./domain/crm.js";
5
+ export { CRM_KINDS, isCrmUserId, isItemKind, normalCrmUserId, } from "./domain/crm.js";
5
6
  export { DEAL_KINDS, DEAL_ROLES, DEAL_STATUSES, STAGE_OUTCOMES, } from "./domain/deals.js";
6
7
  export { FINANCE_REVIEWS, INVOICE_DIRECTIONS, INVOICE_STATUSES, MONEY_DIRECTIONS, } from "./domain/finance.js";
7
8
  export { validateFormattedText, } from "./domain/formatting.js";
8
- export { DEFAULT_LINK_CONFIG, formatLink, LINK_VERSION, linkConfigOf, linkFor, linkTargetOf, parseLink, } from "./domain/links.js";
9
+ export { DEFAULT_LINK_CONFIG, formatLink, LINK_VERSION, linkConfigOf, linkFor, linkTargetOf, parseLink, refsForLink, } from "./domain/links.js";
9
10
  export { formatLocator, isLocator, parseLocator } from "./domain/locator.js";
10
11
  export { parseMarkdown } from "./domain/markdown.js";
11
12
  export { parseMarkdownSpans } from "./domain/markdown-spans.js";
@@ -16,7 +17,7 @@ export { ADDED_ACCOUNT, ADDED_PROVIDER, CRM_OPENS, FOLDER_PROVIDERS, holdsKind,
16
17
  export { rankingOptions } from "./domain/rankings-options.js";
17
18
  export { envelopeOfJsonl, envelopeOfText, RECORD_ENTITY_TYPES, RECORD_OPERATIONS, RECORDS_ENVELOPE_SCHEMA, RECORDS_SCHEMA_VERSION, } from "./domain/records.js";
18
19
  export { canonicalReference, formatReference, looksLikeReference, parseReference, REF_KINDS, } from "./domain/references.js";
19
- export { inverseOf, isUsable, ORGANIZATION_ROLES, PROJECT_ROLES, RELATION_KINDS, RELATIONS, ROLE_LISTS, rolesOf, STANDINGS, standingOf, usableLink, } from "./domain/relations.js";
20
+ export { byEngagement, CONTRACT_ROLES, ENGAGEMENT_LEVELS, engagementRank, inverseOf, isUsable, ORGANIZATION_ROLES, PROJECT_ROLES, RELATION_KINDS, RELATIONS, ROLE_LISTS, rolesOf, STANDINGS, standingOf, usableLink, } from "./domain/relations.js";
20
21
  export { normalizeTag, TAG_TYPES } from "./domain/tags.js";
21
22
  export { envelopeOfVcard, isVcard } from "./domain/vcard.js";
22
23
  export { DETAILS as CORE_DETAILS, failureContext, REASONS as CORE_REASONS } from "./errors/reasons.js";
@@ -36,6 +36,8 @@ export interface ParticipantPersonLinkReceipt extends ParticipantPerson {
36
36
  personUid: string;
37
37
  previousPersonUid: string | null;
38
38
  changed: boolean;
39
+ /** An agent's association waits for the owner as this `identity_link` proposal; nothing moved. */
40
+ proposal?: string;
39
41
  }
40
42
  /** Mutations must check live scoped ownership, preconditions and targets in the same transaction. */
41
43
  export interface MeetingContextStore {
@@ -3,6 +3,8 @@ declare const TASK_TYPES: readonly ["bug", "feature", "chore"];
3
3
  export interface FindingEvidence {
4
4
  reference: string;
5
5
  fingerprint: string;
6
+ /** The words of the cited text the finding rests on, checked word for word when it is staged. */
7
+ quote?: string;
6
8
  }
7
9
  interface FindingBase {
8
10
  id: string;
@@ -91,6 +93,8 @@ export interface FindingsRules {
91
93
  payments?: boolean;
92
94
  /** A task finding may name no project: it goes in its account's inbox. */
93
95
  inboxTasks?: boolean;
96
+ /** Evidence may carry a quote of at most this many characters. */
97
+ quotes?: number;
94
98
  }
95
99
  /** A finding's cited evidence: 1–8 distinct references in `rules`' form, each with a 64-hex fingerprint. */
96
100
  export declare const validEvidence: (raw: unknown, rules: FindingsRules) => FindingEvidence[];
@@ -53,13 +53,16 @@ export const validEvidence = (raw, rules) => {
53
53
  .map((item) => {
54
54
  if (!item || typeof item !== "object")
55
55
  return invalid("finding evidence is a reference and fingerprint");
56
- findingFields(item, ["reference", "fingerprint"], rules.singular);
56
+ findingFields(item, rules.quotes ? ["reference", "fingerprint", "quote"] : ["reference", "fingerprint"], rules.singular);
57
57
  if (typeof item.reference !== "string" || typeof item.fingerprint !== "string")
58
58
  return invalid("evidence requires a reference and fingerprint");
59
59
  const reference = rules.reference(item.reference);
60
60
  if (!/^[a-f0-9]{64}$/.test(item.fingerprint))
61
61
  return invalid(`finding evidence requires exact ${rules.cited} references and fingerprints`);
62
- return { reference, fingerprint: item.fingerprint };
62
+ // Absent, not empty: a finding without a quote keeps the fingerprint it had before quotes existed.
63
+ if (item.quote === undefined)
64
+ return { reference, fingerprint: item.fingerprint };
65
+ return { reference, fingerprint: item.fingerprint, quote: findingText(item.quote, rules.quotes ?? 0) };
63
66
  })
64
67
  .sort((a, b) => a.reference.localeCompare(b.reference));
65
68
  if (new Set(evidence.map((item) => item.reference)).size !== evidence.length)
@@ -38,7 +38,6 @@ export declare const meetingTools: ({
38
38
  max_read_bytes?: undefined;
39
39
  cursor?: undefined;
40
40
  } | {
41
- limit?: undefined;
42
41
  event_id?: undefined;
43
42
  series_id?: undefined;
44
43
  page?: undefined;
@@ -54,11 +53,11 @@ export declare const meetingTools: ({
54
53
  format?: undefined;
55
54
  transcript_id?: undefined;
56
55
  query?: undefined;
56
+ limit?: undefined;
57
57
  scan_limit?: undefined;
58
58
  max_read_bytes?: undefined;
59
59
  cursor?: undefined;
60
60
  } | {
61
- limit?: undefined;
62
61
  event_id?: undefined;
63
62
  series_id?: undefined;
64
63
  page?: undefined;
@@ -76,11 +75,11 @@ export declare const meetingTools: ({
76
75
  format?: undefined;
77
76
  transcript_id?: undefined;
78
77
  query?: undefined;
78
+ limit?: undefined;
79
79
  scan_limit?: undefined;
80
80
  max_read_bytes?: undefined;
81
81
  cursor?: undefined;
82
82
  } | {
83
- limit?: undefined;
84
83
  event_id?: undefined;
85
84
  series_id?: undefined;
86
85
  page?: undefined;
@@ -102,6 +101,7 @@ export declare const meetingTools: ({
102
101
  minimum: number;
103
102
  };
104
103
  query?: undefined;
104
+ limit?: undefined;
105
105
  scan_limit?: undefined;
106
106
  max_read_bytes?: undefined;
107
107
  cursor?: undefined;
@@ -188,7 +188,6 @@ export declare const meetingTools: ({
188
188
  max_read_bytes?: undefined;
189
189
  cursor?: undefined;
190
190
  } | {
191
- limit?: undefined;
192
191
  event_id?: undefined;
193
192
  series_id?: undefined;
194
193
  page?: undefined;
@@ -204,11 +203,11 @@ export declare const meetingTools: ({
204
203
  format?: undefined;
205
204
  transcript_id?: undefined;
206
205
  query?: undefined;
206
+ limit?: undefined;
207
207
  scan_limit?: undefined;
208
208
  max_read_bytes?: undefined;
209
209
  cursor?: undefined;
210
210
  } | {
211
- limit?: undefined;
212
211
  event_id?: undefined;
213
212
  series_id?: undefined;
214
213
  page?: undefined;
@@ -226,11 +225,11 @@ export declare const meetingTools: ({
226
225
  format?: undefined;
227
226
  transcript_id?: undefined;
228
227
  query?: undefined;
228
+ limit?: undefined;
229
229
  scan_limit?: undefined;
230
230
  max_read_bytes?: undefined;
231
231
  cursor?: undefined;
232
232
  } | {
233
- limit?: undefined;
234
233
  event_id?: undefined;
235
234
  series_id?: undefined;
236
235
  page?: undefined;
@@ -252,6 +251,7 @@ export declare const meetingTools: ({
252
251
  minimum: number;
253
252
  };
254
253
  query?: undefined;
254
+ limit?: undefined;
255
255
  scan_limit?: undefined;
256
256
  max_read_bytes?: undefined;
257
257
  cursor?: undefined;
@@ -338,7 +338,6 @@ export declare const meetingTools: ({
338
338
  max_read_bytes?: undefined;
339
339
  cursor?: undefined;
340
340
  } | {
341
- limit?: undefined;
342
341
  event_id?: undefined;
343
342
  series_id?: undefined;
344
343
  page?: undefined;
@@ -354,11 +353,11 @@ export declare const meetingTools: ({
354
353
  format?: undefined;
355
354
  transcript_id?: undefined;
356
355
  query?: undefined;
356
+ limit?: undefined;
357
357
  scan_limit?: undefined;
358
358
  max_read_bytes?: undefined;
359
359
  cursor?: undefined;
360
360
  } | {
361
- limit?: undefined;
362
361
  event_id?: undefined;
363
362
  series_id?: undefined;
364
363
  page?: undefined;
@@ -376,11 +375,11 @@ export declare const meetingTools: ({
376
375
  format?: undefined;
377
376
  transcript_id?: undefined;
378
377
  query?: undefined;
378
+ limit?: undefined;
379
379
  scan_limit?: undefined;
380
380
  max_read_bytes?: undefined;
381
381
  cursor?: undefined;
382
382
  } | {
383
- limit?: undefined;
384
383
  event_id?: undefined;
385
384
  series_id?: undefined;
386
385
  page?: undefined;
@@ -402,6 +401,7 @@ export declare const meetingTools: ({
402
401
  minimum: number;
403
402
  };
404
403
  query?: undefined;
404
+ limit?: undefined;
405
405
  scan_limit?: undefined;
406
406
  max_read_bytes?: undefined;
407
407
  cursor?: undefined;
@@ -488,7 +488,6 @@ export declare const meetingTools: ({
488
488
  max_read_bytes?: undefined;
489
489
  cursor?: undefined;
490
490
  } | {
491
- limit?: undefined;
492
491
  event_id?: undefined;
493
492
  series_id?: undefined;
494
493
  page?: undefined;
@@ -504,11 +503,11 @@ export declare const meetingTools: ({
504
503
  format?: undefined;
505
504
  transcript_id?: undefined;
506
505
  query?: undefined;
506
+ limit?: undefined;
507
507
  scan_limit?: undefined;
508
508
  max_read_bytes?: undefined;
509
509
  cursor?: undefined;
510
510
  } | {
511
- limit?: undefined;
512
511
  event_id?: undefined;
513
512
  series_id?: undefined;
514
513
  page?: undefined;
@@ -526,11 +525,11 @@ export declare const meetingTools: ({
526
525
  format?: undefined;
527
526
  transcript_id?: undefined;
528
527
  query?: undefined;
528
+ limit?: undefined;
529
529
  scan_limit?: undefined;
530
530
  max_read_bytes?: undefined;
531
531
  cursor?: undefined;
532
532
  } | {
533
- limit?: undefined;
534
533
  event_id?: undefined;
535
534
  series_id?: undefined;
536
535
  page?: undefined;
@@ -552,6 +551,7 @@ export declare const meetingTools: ({
552
551
  minimum: number;
553
552
  };
554
553
  query?: undefined;
554
+ limit?: undefined;
555
555
  scan_limit?: undefined;
556
556
  max_read_bytes?: undefined;
557
557
  cursor?: undefined;
@@ -638,7 +638,6 @@ export declare const meetingTools: ({
638
638
  max_read_bytes?: undefined;
639
639
  cursor?: undefined;
640
640
  } | {
641
- limit?: undefined;
642
641
  event_id?: undefined;
643
642
  series_id?: undefined;
644
643
  page?: undefined;
@@ -654,11 +653,11 @@ export declare const meetingTools: ({
654
653
  format?: undefined;
655
654
  transcript_id?: undefined;
656
655
  query?: undefined;
656
+ limit?: undefined;
657
657
  scan_limit?: undefined;
658
658
  max_read_bytes?: undefined;
659
659
  cursor?: undefined;
660
660
  } | {
661
- limit?: undefined;
662
661
  event_id?: undefined;
663
662
  series_id?: undefined;
664
663
  page?: undefined;
@@ -676,11 +675,11 @@ export declare const meetingTools: ({
676
675
  format?: undefined;
677
676
  transcript_id?: undefined;
678
677
  query?: undefined;
678
+ limit?: undefined;
679
679
  scan_limit?: undefined;
680
680
  max_read_bytes?: undefined;
681
681
  cursor?: undefined;
682
682
  } | {
683
- limit?: undefined;
684
683
  event_id?: undefined;
685
684
  series_id?: undefined;
686
685
  page?: undefined;
@@ -702,6 +701,7 @@ export declare const meetingTools: ({
702
701
  minimum: number;
703
702
  };
704
703
  query?: undefined;
704
+ limit?: undefined;
705
705
  scan_limit?: undefined;
706
706
  max_read_bytes?: undefined;
707
707
  cursor?: undefined;
@@ -51,6 +51,7 @@ export declare const MEETING_RESULT_ENTITIES: {
51
51
  readonly person_uid: v.StringSchema<undefined>;
52
52
  readonly previous_person_uid: v.NullableSchema<v.StringSchema<undefined>, undefined>;
53
53
  readonly changed: v.BooleanSchema<undefined>;
54
+ readonly proposal: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
54
55
  }, undefined>], undefined>, undefined>;
55
56
  }, undefined>;
56
57
  readonly meeting_transcription: v.UnionSchema<[v.StrictObjectSchema<{
@@ -41,6 +41,7 @@ const personResult = v.strictObject({
41
41
  person_uid: text,
42
42
  previous_person_uid: nullableText,
43
43
  changed: flag,
44
+ proposal: v.optional(text),
44
45
  });
45
46
  const meetingChange = v.strictObject({
46
47
  scope,
@@ -36,14 +36,25 @@ export const modelGateway = (deps) => ({
36
36
  throw new CliError("cancelled", "model request cancelled");
37
37
  const fetcher = deps.fetch ?? fetch;
38
38
  let limited = false;
39
+ let unreachable = false;
40
+ let refused = false;
39
41
  const cancellable = async (input, init) => {
40
42
  const signal = init?.signal ?? (input instanceof Request ? input.signal : undefined);
41
- const response = await fetcher(input, {
42
- ...init,
43
- signal: deps.signal ? AbortSignal.any([deps.signal, ...(signal ? [signal] : [])]) : signal,
44
- });
43
+ let response;
44
+ try {
45
+ response = await fetcher(input, {
46
+ ...init,
47
+ signal: deps.signal ? AbortSignal.any([deps.signal, ...(signal ? [signal] : [])]) : signal,
48
+ });
49
+ }
50
+ catch (error) {
51
+ unreachable = true;
52
+ throw error;
53
+ }
45
54
  if (response.status === 429)
46
55
  limited = true;
56
+ if (response.status === 401 || response.status === 403)
57
+ refused = true;
47
58
  return response;
48
59
  };
49
60
  try {
@@ -57,7 +68,13 @@ export const modelGateway = (deps) => ({
57
68
  catch {
58
69
  if (limited)
59
70
  throw new CliError("rate_limited", `${request.purpose} provider rate limit reached; no result was stored`);
60
- throw new CliError("invalid_response", `${request.purpose} provider failed or returned an incomplete response; no result was stored`);
71
+ // The message stays one for every failure; the reason tells a refused key and a network failure apart.
72
+ const reason = refused
73
+ ? "model.key-rejected"
74
+ : unreachable && !deps.signal?.aborted
75
+ ? "model.unreachable"
76
+ : undefined;
77
+ throw new CliError("invalid_response", `${request.purpose} provider failed or returned an incomplete response; no result was stored`, reason === undefined ? undefined : { reason });
61
78
  }
62
79
  },
63
80
  });
@@ -63,7 +63,17 @@ export interface CacheEvent {
63
63
  /** How old the kept answer was. */
64
64
  ageMs?: number;
65
65
  }
66
- export type DiagnosticEvent = RequestEvent | CacheEvent | WarningEvent;
66
+ /** Rows one committed write transaction changed in one table: a count, never a row. */
67
+ export interface StoreEvent {
68
+ event: "store";
69
+ /** Always `store.write`; typed wide so an object spread into a request event still narrows by `event`. */
70
+ operation: string;
71
+ kind: "store";
72
+ table: string;
73
+ op: "insert" | "update" | "delete";
74
+ n: number;
75
+ }
76
+ export type DiagnosticEvent = RequestEvent | CacheEvent | WarningEvent | StoreEvent;
67
77
  export type EventSink = (event: DiagnosticEvent) => void;
68
78
  /** A sentence for a person, and the warning event it stands for when there is one: a log record keeps only the event. */
69
79
  export type Warn = (message: string, warning?: WarningEvent) => void;