@wirecat/cli-core 0.666.0 → 0.668.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 (47) hide show
  1. package/CHANGELOG.md +88 -0
  2. package/dist/calendar/cli/conference.d.ts +3 -0
  3. package/dist/calendar/cli/conference.js +7 -0
  4. package/dist/calendar/cli/index.d.ts +1 -0
  5. package/dist/calendar/cli/index.js +4 -2
  6. package/dist/calendar/mcp/index.d.ts +2944 -171
  7. package/dist/calendar/mcp/index.js +22 -3
  8. package/dist/calendar/testing/writer-contract.js +34 -0
  9. package/dist/calendar/testing/writer.d.ts +3 -0
  10. package/dist/calendar/testing/writer.js +9 -1
  11. package/dist/calendar/writer.d.ts +13 -0
  12. package/dist/calendar/writes.d.ts +3 -0
  13. package/dist/calendar/writes.js +21 -1
  14. package/dist/cli/documents/words.d.ts +1 -1
  15. package/dist/cli/meeting-batch.js +2 -2
  16. package/dist/domain/providers.js +2 -1
  17. package/dist/entities/index.d.ts +7 -0
  18. package/dist/errors/reasons.js +2 -0
  19. package/dist/meetings/answers.d.ts +12 -0
  20. package/dist/meetings/answers.js +27 -1
  21. package/dist/meetings/cli/index.d.ts +2 -0
  22. package/dist/meetings/cli/index.js +7 -3
  23. package/dist/meetings/cli/management.d.ts +3 -1
  24. package/dist/meetings/cli/management.js +73 -26
  25. package/dist/meetings/cli/passage.js +2 -2
  26. package/dist/meetings/export.d.ts +2 -0
  27. package/dist/meetings/export.js +1 -0
  28. package/dist/meetings/index.d.ts +3 -3
  29. package/dist/meetings/index.js +3 -3
  30. package/dist/meetings/mcp/passage.js +2 -2
  31. package/dist/meetings/meeting-management.d.ts +68 -3
  32. package/dist/meetings/meeting-management.js +134 -17
  33. package/dist/meetings/passage.d.ts +5 -0
  34. package/dist/meetings/passage.js +10 -0
  35. package/dist/meetings/read-answers.d.ts +3 -0
  36. package/dist/meetings/read-answers.js +3 -0
  37. package/dist/meetings/read-through.d.ts +1 -1
  38. package/dist/meetings/read-through.js +4 -0
  39. package/dist/meetings/reads.d.ts +16 -3
  40. package/dist/meetings/reads.js +12 -2
  41. package/dist/meetings/result-items.d.ts +3 -0
  42. package/dist/meetings/result-items.js +9 -1
  43. package/dist/meetings/store.d.ts +6 -0
  44. package/dist/meetings/store.js +13 -0
  45. package/dist/meetings/testing/management-contract.js +27 -5
  46. package/dist/store/sqlite/meeting-listing.js +28 -7
  47. package/package.json +3 -3
@@ -93,6 +93,15 @@ const fields = {
93
93
  attendees: { type: "array", items: text, description: "email addresses; on a change, the whole new list" },
94
94
  repeat: { ...text, description: `how it repeats: ${REPEAT_HELP}; on a change, only with series` },
95
95
  };
96
+ const conferenceOf = (services) => services.length
97
+ ? {
98
+ conference: {
99
+ ...text,
100
+ enum: [...services],
101
+ description: "a meeting service to make a new meeting link with; never replaces a link",
102
+ },
103
+ }
104
+ : {};
96
105
  const target = {
97
106
  account_id: integer,
98
107
  event: text,
@@ -100,9 +109,10 @@ const target = {
100
109
  };
101
110
  /**
102
111
  * The calendar writes, offered only by a host that has a writer. Over MCP `ask` goes ahead (WC-MCP-7); `deny`,
103
- * `readonly`, `events.notify` and the extra keys still refuse.
112
+ * `readonly`, `events.notify` and the extra keys still refuse. `conference` is offered only with the services the
113
+ * writer declares (`CalendarWriter.conferences`).
104
114
  */
105
- export const calendarWriteTools = [
115
+ export const calendarWriteToolsFor = (conferences = []) => [
106
116
  {
107
117
  name: "event_create",
108
118
  description: "add an event to a calendar, one that repeats with repeat",
@@ -110,6 +120,7 @@ export const calendarWriteTools = [
110
120
  account_id: integer,
111
121
  calendar: text,
112
122
  ...fields,
123
+ ...conferenceOf(conferences),
113
124
  notify,
114
125
  operation_id: operationId("the operation_id a create that ended in outcome_unknown named: a retry finds that event"),
115
126
  },
@@ -123,6 +134,7 @@ export const calendarWriteTools = [
123
134
  properties: {
124
135
  ...target,
125
136
  ...fields,
137
+ ...conferenceOf(conferences),
126
138
  series: flag,
127
139
  following,
128
140
  notify,
@@ -164,9 +176,13 @@ export const calendarWriteTools = [
164
176
  inputSchema: { type: "object", properties, required, additionalProperties: false },
165
177
  annotations: { readOnlyHint: false, destructiveHint: destructive, idempotentHint: false, openWorldHint: true },
166
178
  }));
179
+ /** The write tools of a writer that makes no meeting links. */
180
+ export const calendarWriteTools = calendarWriteToolsFor();
181
+ // Any host's call may name a conference; the account's writer refuses a service it does not offer.
182
+ const ACCEPTED_WRITES = calendarWriteToolsFor(["any"]);
167
183
  const WRITES = new Set(calendarWriteTools.map(({ name }) => name));
168
184
  const argumentsOf = (name, input) => {
169
- const tool = calendarTools.find((one) => one.name === name) ?? calendarWriteTools.find((one) => one.name === name);
185
+ const tool = calendarTools.find((one) => one.name === name) ?? ACCEPTED_WRITES.find((one) => one.name === name);
170
186
  if (!tool)
171
187
  throw new CliError("validation_error", "unknown calendar tool");
172
188
  if (typeof input !== "object" || input === null || Array.isArray(input))
@@ -197,6 +213,7 @@ const argumentsOf = (name, input) => {
197
213
  "operation_id",
198
214
  "repeat",
199
215
  "to_calendar",
216
+ "conference",
200
217
  ].includes(key) &&
201
218
  (typeof value !== "string" || !value.trim()))
202
219
  throw new CliError("validation_error", `${key} must not be empty`);
@@ -323,6 +340,7 @@ const fieldsOf = (args) => ({
323
340
  ...(args.description === undefined ? {} : { description: args.description }),
324
341
  ...(args.attendees === undefined ? {} : { attendees: args.attendees }),
325
342
  ...(args.repeat === undefined ? {} : { repeat: args.repeat }),
343
+ ...(args.conference === undefined ? {} : { conference: args.conference }),
326
344
  });
327
345
  /** The one account a write acts in: the one named, or the only one that holds what it names; never a guess. */
328
346
  const accountFor = async (accounts, asked, holds, what) => {
@@ -370,6 +388,7 @@ const writeTool = async (store, name, args, { asked, accounts, now, writes, }) =
370
388
  series: "series",
371
389
  following: "following",
372
390
  repeat: "repeat",
391
+ conference: "conference",
373
392
  },
374
393
  };
375
394
  const choice = args.notify === undefined ? {} : { notify: args.notify };
@@ -1,4 +1,5 @@
1
1
  import assert from "node:assert/strict";
2
+ import { randomUUID } from "node:crypto";
2
3
  import { mkdtempSync } from "node:fs";
3
4
  import { tmpdir } from "node:os";
4
5
  import { join } from "node:path";
@@ -51,6 +52,7 @@ const contextOver = async (f, permissions) => {
51
52
  id: "id",
52
53
  calendar: "calendar",
53
54
  series: "series",
55
+ conference: "conference",
54
56
  following: "following",
55
57
  repeat: "repeat",
56
58
  },
@@ -259,9 +261,41 @@ export const calendarWriterContract = (fixture) => {
259
261
  },
260
262
  },
261
263
  ...moveCases(fixture),
264
+ ...conferenceCases(fixture, draft),
262
265
  ];
263
266
  return cases;
264
267
  };
268
+ /** A writer that declares `conferences` returns the new meeting link on the event; its cases are skipped without. */
269
+ const conferenceCases = (fixture, draft) => {
270
+ const ready = async () => {
271
+ const f = await fixture();
272
+ const provider = f.writer.conferences?.[0];
273
+ return provider ? { ...f, provider } : undefined;
274
+ };
275
+ return [
276
+ {
277
+ name: "conference: a create with a meeting service returns the event with its new link",
278
+ run: async () => {
279
+ const f = await ready();
280
+ if (!f)
281
+ return;
282
+ const made = await f.writer.create(f.calendar, { ...draft(f.at), conference: { provider: f.provider, requestId: randomUUID() } }, { id: ID, notify: false });
283
+ assert.match(made.joinUrl ?? "", /^https:\/\//);
284
+ },
285
+ },
286
+ {
287
+ name: "conference: a change that adds one returns the event with its new link and a new etag",
288
+ run: async () => {
289
+ const f = await ready();
290
+ if (!f)
291
+ return;
292
+ const changed = await f.writer.update(f.calendar, f.existing.externalId, { conference: { provider: f.provider, requestId: randomUUID() } }, { scope: "this", etag: f.existing.etag, notify: false });
293
+ assert.match(changed.joinUrl ?? "", /^https:\/\//);
294
+ assert.notEqual(changed.etag, f.existing.etag);
295
+ },
296
+ },
297
+ ];
298
+ };
265
299
  const moveCases = (fixture) => {
266
300
  const ready = async () => {
267
301
  const f = await fixture();
@@ -22,8 +22,11 @@ export interface FakeCalendarWriter extends CalendarWriter {
22
22
  loseNextAnswer(): void;
23
23
  held(calendar: string): EntryInput[];
24
24
  readonly calls: FakeCalendarWriterCall[];
25
+ /** Every conference request id it was sent, in order. */
26
+ readonly conferenceRequests: string[];
25
27
  }
26
28
  export declare const fakeCalendarWriter: (options?: {
27
29
  provider?: string;
28
30
  now?: () => number;
31
+ conferences?: readonly string[];
29
32
  }) => FakeCalendarWriter;
@@ -5,6 +5,7 @@ export const fakeCalendarWriter = (options = {}) => {
5
5
  const calendars = new Map();
6
6
  const made = new Map();
7
7
  const calls = [];
8
+ const conferenceRequests = [];
8
9
  let version = 0;
9
10
  let lose = false;
10
11
  const of = (calendar) => {
@@ -28,9 +29,14 @@ export const fakeCalendarWriter = (options = {}) => {
28
29
  return found;
29
30
  };
30
31
  const fields = (patch) => {
31
- const { attendees, title, ...rest } = patch;
32
+ const { attendees, title, conference, ...rest } = patch;
33
+ if (conference)
34
+ conferenceRequests.push(conference.requestId);
32
35
  return {
33
36
  ...rest,
37
+ ...(conference
38
+ ? { conference: conference.provider, joinUrl: `https://meet.example.com/${conference.requestId.slice(0, 8)}` }
39
+ : {}),
34
40
  ...(title === undefined ? {} : { title }),
35
41
  ...(patch.startDate === undefined ? {} : { allDay: true, startsAt: null, endsAt: null }),
36
42
  ...(patch.startsAt === undefined ? {} : { allDay: false, startDate: null, endDate: null }),
@@ -41,7 +47,9 @@ export const fakeCalendarWriter = (options = {}) => {
41
47
  };
42
48
  return {
43
49
  provider: options.provider ?? "example-calendar",
50
+ ...(options.conferences ? { conferences: options.conferences } : {}),
44
51
  calls,
52
+ conferenceRequests,
45
53
  put(calendar, ...entries) {
46
54
  return entries.map((entry) => {
47
55
  const held = entry.etag ? entry : stamp(entry);
@@ -21,6 +21,14 @@ export interface EventDraft {
21
21
  optional?: boolean;
22
22
  }[];
23
23
  recurrence?: string[];
24
+ /**
25
+ * A new meeting link to make and attach, from one of the writer's `conferences`. `requestId` is new for every write:
26
+ * Google ignores a request id it has seen. A create retry stays safe through the event's own id.
27
+ */
28
+ conference?: {
29
+ provider: string;
30
+ requestId: string;
31
+ };
24
32
  }
25
33
  /**
26
34
  * Only the fields to change; `null` clears one. `attendees` and `recurrence` replace the whole list. A patch with
@@ -42,6 +50,11 @@ export type EventResponse = Extract<ParticipantResponse, "accepted" | "tentative
42
50
  */
43
51
  export interface CalendarWriter {
44
52
  readonly provider: string;
53
+ /**
54
+ * The meeting services this writer can make a link with on an event (`google-meet` for Calendar's
55
+ * `conferenceData.createRequest`); `events create|update --conference` takes one of them.
56
+ */
57
+ readonly conferences?: readonly string[];
45
58
  /**
46
59
  * `id` is chosen here and journaled before the call: a create with an id the provider already holds returns that
47
60
  * event instead of making a second one, so a retry after `outcome_unknown` is safe.
@@ -32,6 +32,8 @@ export interface EventFields {
32
32
  attendees?: string[];
33
33
  /** An RFC 5545 rule, with or without `RRULE:`; on a change, only with the series' scope. */
34
34
  repeat?: string;
35
+ /** A meeting service to make a new meeting link with, one of the writer's `conferences`. */
36
+ conference?: string;
35
37
  }
36
38
  export interface WriteContext {
37
39
  store: EventStore;
@@ -49,6 +51,7 @@ export interface WriteContext {
49
51
  series: string;
50
52
  following: string;
51
53
  repeat: string;
54
+ conference: string;
52
55
  };
53
56
  }
54
57
  /**
@@ -82,10 +82,26 @@ export const draftOf = (fields, zone, { whole, allDay = false }) => {
82
82
  allDay: patch.startDate !== undefined || (patch.startsAt === undefined && allDay),
83
83
  }),
84
84
  ];
85
+ if (fields.conference !== undefined)
86
+ patch.conference = { provider: fields.conference, requestId: randomUUID() };
85
87
  if (!whole && Object.keys(patch).length === 0)
86
88
  throw new CliError("validation_error", "nothing to change");
87
89
  return patch;
88
90
  };
91
+ /** A meeting link only from a service the writer names, and never over a link the attendees already have. */
92
+ const checkConference = (context, fields, existing = []) => {
93
+ const wanted = fields.conference;
94
+ if (wanted === undefined)
95
+ return;
96
+ const offered = context.writes.writer.conferences ?? [];
97
+ const flag = context.names.conference;
98
+ if (!offered.includes(wanted))
99
+ throw new CliError("validation_error", offered.length
100
+ ? `${flag} takes ${offered.join(", ")}, not ${wanted}`
101
+ : `this calendar cannot add a meeting link; leave out ${flag}`, { param: flag });
102
+ if (existing.some(({ joinUrl }) => joinUrl))
103
+ throw new CliError("validation_error", `the event already has a meeting link, which its attendees use; leave out ${flag}`, { reason: "event.conference-exists", param: flag });
104
+ };
89
105
  /** The profile's guard over the write's main key and its other keys (`keyedGuard`). */
90
106
  const writeGuard = (context, extra) => {
91
107
  const settings = context.writes.settings();
@@ -155,6 +171,7 @@ const writable = (calendar) => {
155
171
  };
156
172
  export const createEvent = async (context, calendarReference, fields, options = {}) => {
157
173
  const calendar = writable(await calendarIn(context.store, context.accountId, calendarReference));
174
+ checkConference(context, fields);
158
175
  const draft = draftOf(fields, context.zone, { whole: true });
159
176
  const id = idOf(context, options.id);
160
177
  const notify = notifyOf(context, options.notify, (draft.attendees?.length ?? 0) > 0);
@@ -352,7 +369,8 @@ export const updateEvent = async (context, reference, fields, options = {}) => {
352
369
  throw new CliError("validation_error", `a repeat rule belongs to the whole series: add ${context.names.series}`, {
353
370
  param: context.names.series,
354
371
  });
355
- const { calendar, target, participants } = await targetOf(context, reference, { ...options, scope });
372
+ const { calendar, entry: named, target, participants } = await targetOf(context, reference, { ...options, scope });
373
+ checkConference(context, fields, [named, target]);
356
374
  const patch = draftOf(fields, context.zone, { whole: false, allDay: target.allDay });
357
375
  const kept = (target.recurrence ?? []).filter((line) => !/^RRULE:/iu.test(line));
358
376
  if (patch.recurrence)
@@ -451,6 +469,8 @@ const afterCreate = async (context, id, write) => {
451
469
  * later slots show twice, never none.
452
470
  */
453
471
  const updateFollowing = async (context, reference, fields, options) => {
472
+ if (fields.conference !== undefined)
473
+ throw new CliError("validation_error", `${context.names.conference} goes with one occurrence or ${context.names.series}, not ${context.names.following}`, { param: context.names.conference });
454
474
  const found = await targetOf(context, reference, { ...options, scope: "following" });
455
475
  const { calendar, entry, target, participants } = found;
456
476
  const split = splitOf(context, reference, found);
@@ -56,9 +56,9 @@ export interface CopyAge {
56
56
  }
57
57
  export declare const ageOf: (lastSync: string | undefined, now?: number) => CopyAge;
58
58
  export declare const staleCopy: (provider: string, lastSync: string | undefined, now?: number) => {
59
+ next?: undefined;
59
60
  readonly missing?: undefined;
60
61
  meta?: undefined;
61
- next?: undefined;
62
62
  } | {
63
63
  missing: {
64
64
  field: string;
@@ -6,7 +6,7 @@ import * as v from "valibot";
6
6
  import { ENTITIES } from "../entities/index.js";
7
7
  import { failureContext } from "../errors/reasons.js";
8
8
  import { createMeetingPassageCommand, createMeetingSearchCommand, meetingHitSearchRequest, meetingPassageRequest, meetingSearchArguments, meetingSearchMeta, } from "../meetings/cli/index.js";
9
- import { meetingHitsList, parseMeetingReference, } from "../meetings/index.js";
9
+ import { markedPassage, meetingHitsList, parseMeetingReference, } from "../meetings/index.js";
10
10
  import { formatMeetingEvidenceText, formatMeetingPassage } from "../services/meeting-passage-format.js";
11
11
  import { answerEntity } from "./answer-entity.js";
12
12
  import { destroysNothing } from "./effects.js";
@@ -81,7 +81,7 @@ const handlers = (reader, meta, limit) => {
81
81
  return {
82
82
  run: async (ctx) => {
83
83
  ctx.reserveReadBytes(request.max_read_bytes ?? 4194304);
84
- const result = await reader.passage(reference, { ...request, signal: ctx.signal });
84
+ const result = markedPassage(await reader.passage(reference, { ...request, signal: ctx.signal }));
85
85
  const complete = result.packet.coverage.truncated_by === null;
86
86
  return {
87
87
  answer: {
@@ -19,7 +19,8 @@ export const PROVIDERS = [
19
19
  { name: "obsidian", kind: "notes", aliases: [] },
20
20
  { name: "added", kind: "notes", aliases: [] },
21
21
  { name: "zoom", kind: "meetings", aliases: [] },
22
- { name: "google-meet", kind: "meetings", aliases: [], command: "gmeet" },
22
+ // Google Meet has no tool of its own: its meetings are gcal's, since every meeting is on the calendar.
23
+ { name: "google-meet", kind: "meetings", aliases: [], command: "gcal" },
23
24
  { name: "google-drive", kind: "documents", aliases: [] },
24
25
  // Its meetings come from the notes Telemost mails (`keeper@telemost.yandex.ru`), read by a mail rule.
25
26
  { name: "telemost", kind: "meetings", aliases: [] },
@@ -107,6 +107,7 @@ export declare const ENTITIES: {
107
107
  readonly duration_minutes: v.OptionalSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>, undefined>;
108
108
  readonly timezone: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
109
109
  readonly agenda: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
110
+ readonly settings: v.OptionalSchema<v.RecordSchema<v.StringSchema<undefined>, v.UnionSchema<[v.StringSchema<undefined>, v.BooleanSchema<undefined>], undefined>, undefined>, undefined>;
110
111
  }, undefined>, undefined>;
111
112
  readonly applied: v.BooleanSchema<undefined>;
112
113
  readonly meeting: v.OptionalSchema<v.StrictObjectSchema<{
@@ -119,6 +120,7 @@ export declare const ENTITIES: {
119
120
  readonly agenda: v.NullableSchema<v.StringSchema<undefined>, undefined>;
120
121
  readonly join_url: v.NullableSchema<v.StringSchema<undefined>, undefined>;
121
122
  }, undefined>, undefined>;
123
+ readonly untrusted: v.OptionalSchema<v.ArraySchema<v.StringSchema<undefined>, undefined>, undefined>;
122
124
  }, undefined>;
123
125
  readonly meeting_invitation: v.StrictObjectSchema<{
124
126
  readonly id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>;
@@ -141,6 +143,7 @@ export declare const ENTITIES: {
141
143
  readonly format: v.PicklistSchema<["markdown", "vtt"], undefined>;
142
144
  readonly filename: v.StringSchema<undefined>;
143
145
  readonly content: v.StringSchema<undefined>;
146
+ readonly untrusted: v.OptionalSchema<v.ArraySchema<v.StringSchema<undefined>, undefined>, undefined>;
144
147
  }, undefined>, v.StrictObjectSchema<{
145
148
  readonly meeting_id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>;
146
149
  readonly format: v.PicklistSchema<["markdown", "vtt"], undefined>;
@@ -6396,6 +6399,7 @@ export declare const ENTITIES: {
6396
6399
  readonly speaker: v.NullableSchema<v.StringSchema<undefined>, undefined>;
6397
6400
  readonly text: v.StringSchema<undefined>;
6398
6401
  }, undefined>, undefined>;
6402
+ readonly untrusted: v.OptionalSchema<v.ArraySchema<v.StringSchema<undefined>, undefined>, undefined>;
6399
6403
  }, undefined>;
6400
6404
  readonly meeting_summary: v.StrictObjectSchema<{
6401
6405
  readonly id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>;
@@ -6412,6 +6416,7 @@ export declare const ENTITIES: {
6412
6416
  readonly url: v.NullableSchema<v.StringSchema<undefined>, undefined>;
6413
6417
  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`">]>;
6414
6418
  readonly updated_at: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.IsoTimestampAction<string, "an ISO 8601 time in UTC">, v.EndsWithAction<string, "Z", "an ISO 8601 time in UTC, ending in `Z`">]>;
6419
+ readonly untrusted: v.OptionalSchema<v.ArraySchema<v.StringSchema<undefined>, undefined>, undefined>;
6415
6420
  }, undefined>;
6416
6421
  readonly meeting_evidence: v.StrictObjectSchema<{
6417
6422
  readonly schema_version: v.LiteralSchema<1, undefined>;
@@ -6732,6 +6737,7 @@ export declare const ENTITIES: {
6732
6737
  readonly ref: v.StringSchema<undefined>;
6733
6738
  readonly name: v.NullableSchema<v.StringSchema<undefined>, undefined>;
6734
6739
  }, undefined>, undefined>;
6740
+ readonly untrusted: v.OptionalSchema<v.ArraySchema<v.StringSchema<undefined>, undefined>, undefined>;
6735
6741
  }, undefined>, undefined>;
6736
6742
  readonly ambiguity: v.StrictObjectSchema<{
6737
6743
  readonly scope: v.LiteralSchema<"page", undefined>;
@@ -6791,6 +6797,7 @@ export declare const ENTITIES: {
6791
6797
  readonly speaker_name: v.NullableSchema<v.StringSchema<undefined>, undefined>;
6792
6798
  readonly text: v.StringSchema<undefined>;
6793
6799
  readonly revision: v.PicklistSchema<["current", "superseded"], undefined>;
6800
+ readonly untrusted: v.OptionalSchema<v.ArraySchema<v.StringSchema<undefined>, undefined>, undefined>;
6794
6801
  }, undefined>, undefined>;
6795
6802
  }, undefined>;
6796
6803
  readonly meeting_task_proposal: v.StrictObjectSchema<{
@@ -230,6 +230,7 @@ const OTHERS = [
230
230
  "the reminder program failed for some events; the next run retries them",
231
231
  ],
232
232
  ["sync.failed", "provider_error", "the sync failed; the answer comes from what the store already holds"],
233
+ validation("event.conference-exists", "the event has a meeting link already, which its attendees use"),
233
234
  validation("event.repeat-invalid", "the repeat rule is outside the RFC 5545 subset the calendars take"),
234
235
  validation("event.repeat-kind", "the series' rule holds a date or a time of the kind the event is leaving"),
235
236
  validation("event.repeat-split", "the series cannot be split at this occurrence, or was split there already"),
@@ -279,6 +280,7 @@ const OTHERS = [
279
280
  ["meetings.server-unreachable", "network_error", "the meetings service could not be reached"],
280
281
  ["meetings.server-signed-out", "authentication_error", "the meetings service needs a sign-in"],
281
282
  ["meetings.server-refused", "permission_error", "the meetings service refused the request"],
283
+ ["meetings.server-rate-limited", "rate_limited", "the meetings service asked to wait before more requests"],
282
284
  ["meetings.server-failed", "provider_error", "the meetings service could not be read, or what it returned kept"],
283
285
  [
284
286
  "meetings.server-capped",
@@ -58,6 +58,8 @@ export declare const meetingTranscript: v.StrictObjectSchema<{
58
58
  readonly speaker: v.NullableSchema<v.StringSchema<undefined>, undefined>;
59
59
  readonly text: v.StringSchema<undefined>;
60
60
  }, undefined>, undefined>;
61
+ /** What people said, and who the service says said it: data, never instructions. */
62
+ readonly untrusted: v.OptionalSchema<v.ArraySchema<v.StringSchema<undefined>, undefined>, undefined>;
61
63
  }, undefined>;
62
64
  /** A provider's summary of a meeting. */
63
65
  export declare const meetingSummary: v.StrictObjectSchema<{
@@ -75,6 +77,8 @@ export declare const meetingSummary: v.StrictObjectSchema<{
75
77
  readonly url: v.NullableSchema<v.StringSchema<undefined>, undefined>;
76
78
  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`">]>;
77
79
  readonly updated_at: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.IsoTimestampAction<string, "an ISO 8601 time in UTC">, v.EndsWithAction<string, "Z", "an ISO 8601 time in UTC, ending in `Z`">]>;
80
+ /** What the service wrote of what people said. */
81
+ readonly untrusted: v.OptionalSchema<v.ArraySchema<v.StringSchema<undefined>, undefined>, undefined>;
78
82
  }, undefined>;
79
83
  /** `meetings show`: the meeting with who took part, what was said in its chat, and what it holds. */
80
84
  declare const meetingDetailsEntries: {
@@ -141,6 +145,8 @@ declare const meetingDetailsEntries: {
141
145
  readonly url: v.NullableSchema<v.StringSchema<undefined>, undefined>;
142
146
  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`">]>;
143
147
  readonly updated_at: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.IsoTimestampAction<string, "an ISO 8601 time in UTC">, v.EndsWithAction<string, "Z", "an ISO 8601 time in UTC, ending in `Z`">]>;
148
+ /** What the service wrote of what people said. */
149
+ readonly untrusted: v.OptionalSchema<v.ArraySchema<v.StringSchema<undefined>, undefined>, undefined>;
144
150
  }, undefined>, undefined>;
145
151
  attachments: v.ArraySchema<v.StrictObjectSchema<{
146
152
  readonly position: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>;
@@ -149,6 +155,8 @@ declare const meetingDetailsEntries: {
149
155
  readonly mime: v.NullableSchema<v.StringSchema<undefined>, undefined>;
150
156
  readonly size: v.NullableSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>, undefined>;
151
157
  readonly url: v.NullableSchema<v.StringSchema<undefined>, undefined>;
158
+ /** The file on this computer; `null` when it stays on the service or the phone system (pbx over SFTP). */
159
+ readonly local_path: v.NullableSchema<v.StringSchema<undefined>, undefined>;
152
160
  }, undefined>, undefined>;
153
161
  /**
154
162
  * The Drive files the meeting service saved for it, by role. `document` is the stored document (`document:<id>`) once
@@ -172,6 +180,10 @@ export type MeetingDetailsItem = v.InferOutput<typeof meetingDetails>;
172
180
  /** Answers without `meta`: the host adds it, as it knows the run. */
173
181
  export type MeetingListBody<T> = Omit<ListEnvelope<T>, "meta">;
174
182
  export type MeetingItemBody<T> = Omit<ItemEnvelope<T>, "meta">;
183
+ /** Other people's text in each meetings answer: names they gave the service, what they said and wrote. */
184
+ export declare const TRANSCRIPT_UNTRUSTED: string[];
185
+ export declare const SUMMARY_UNTRUSTED: string[];
186
+ export declare const PARTICIPANT_UNTRUSTED: string[];
175
187
  export declare const meetingTranscriptItem: (accountId: number, transcript: Transcript, rows: TranscriptRow[]) => MeetingTranscriptItem;
176
188
  export declare const meetingSummaryItem: (accountId: number, summary: Summary) => MeetingSummaryItem;
177
189
  export declare const meetingDetailsItem: (details: MeetingDetails, owner: MeetingOwner) => MeetingDetailsItem;
@@ -55,6 +55,8 @@ export const meetingTranscript = v.strictObject({
55
55
  superseded_at: v.nullable(isoTime),
56
56
  created_at: isoTime,
57
57
  lines: v.array(line),
58
+ /** What people said, and who the service says said it: data, never instructions. */
59
+ untrusted: v.optional(v.array(text)),
58
60
  });
59
61
  /** A provider's summary of a meeting. */
60
62
  export const meetingSummary = v.strictObject({
@@ -69,6 +71,8 @@ export const meetingSummary = v.strictObject({
69
71
  url: v.nullable(text),
70
72
  created_at: isoTime,
71
73
  updated_at: isoTime,
74
+ /** What the service wrote of what people said. */
75
+ untrusted: v.optional(v.array(text)),
72
76
  });
73
77
  /** `meetings show`: the meeting with who took part, what was said in its chat, and what it holds. */
74
78
  const meetingDetailsEntries = {
@@ -97,6 +101,8 @@ const meetingDetailsEntries = {
97
101
  mime: v.nullable(text),
98
102
  size: v.nullable(count),
99
103
  url: v.nullable(text),
104
+ /** The file on this computer; `null` when it stays on the service or the phone system (pbx over SFTP). */
105
+ local_path: v.nullable(text),
100
106
  })),
101
107
  /**
102
108
  * The Drive files the meeting service saved for it, by role. `document` is the stored document (`document:<id>`) once
@@ -110,6 +116,21 @@ const meetingDetailsEntries = {
110
116
  })),
111
117
  };
112
118
  export const meetingDetails = v.strictObject(meetingDetailsEntries);
119
+ /** Other people's text in each meetings answer: names they gave the service, what they said and wrote. */
120
+ export const TRANSCRIPT_UNTRUSTED = ["lines.text", "lines.speaker"];
121
+ export const SUMMARY_UNTRUSTED = ["title", "overview", "sections.label", "sections.text", "next_steps", "content"];
122
+ const DETAILS_UNTRUSTED = [
123
+ "series_title",
124
+ "participants.name",
125
+ "participants.email",
126
+ "participants.person.name",
127
+ "chat.sender",
128
+ "chat.recipient",
129
+ "chat.text",
130
+ "attachments.name",
131
+ "documents.title",
132
+ ];
133
+ export const PARTICIPANT_UNTRUSTED = ["display_name", "email", "person.name"];
113
134
  const meetingRef = (accountId, meetingId) => formatMeetingReference({ type: "meeting", accountId, meetingId });
114
135
  export const meetingTranscriptItem = (accountId, transcript, rows) => ({
115
136
  ref: formatMeetingReference({
@@ -130,6 +151,7 @@ export const meetingTranscriptItem = (accountId, transcript, rows) => ({
130
151
  speaker: row.speakerName,
131
152
  text: row.text,
132
153
  })),
154
+ untrusted: [...TRANSCRIPT_UNTRUSTED],
133
155
  });
134
156
  export const meetingSummaryItem = (accountId, summary) => ({
135
157
  id: String(summary.id),
@@ -143,11 +165,14 @@ export const meetingSummaryItem = (accountId, summary) => ({
143
165
  url: summary.docUrl,
144
166
  created_at: new Date(summary.externalCreatedAt ?? summary.createdAt).toISOString(),
145
167
  updated_at: new Date(summary.externalUpdatedAt ?? summary.updatedAt).toISOString(),
168
+ untrusted: [...SUMMARY_UNTRUSTED],
146
169
  });
147
170
  export const meetingDetailsItem = (details, owner) => {
148
171
  const { accountId } = details.meeting;
172
+ const item = meetingItem(details.meeting, owner);
149
173
  return {
150
- ...meetingItem(details.meeting, owner),
174
+ ...item,
175
+ untrusted: [...(item.untrusted ?? []), ...DETAILS_UNTRUSTED],
151
176
  event_id: details.meeting.eventId === null ? null : String(details.meeting.eventId),
152
177
  series_id: details.meeting.meetingSeriesId === null ? null : String(details.meeting.meetingSeriesId),
153
178
  series_title: details.series?.title ?? null,
@@ -187,6 +212,7 @@ export const meetingDetailsItem = (details, owner) => {
187
212
  mime: one.mime,
188
213
  size: one.size,
189
214
  url: one.url,
215
+ local_path: one.localPath,
190
216
  })),
191
217
  documents: (details.documents ?? []).map((one) => ({
192
218
  file_id: one.fileId,
@@ -52,6 +52,8 @@ export interface MeetingCommandDeps {
52
52
  * asks when the command's key is at `ask` and refuses when nobody can answer. Without it the writes refuse.
53
53
  */
54
54
  askFirst?: (command: Command) => Promise<void>;
55
+ /** The run's stop signal; the meeting writes and `meetings invitation` pass it to the service. */
56
+ signal?: () => AbortSignal | undefined;
55
57
  }
56
58
  export { addMeetingPassageCommand, createMeetingPassageCommand, type MeetingPassageFlags, meetingPassageRequest, } from "./passage.js";
57
59
  export { addMeetingProjectEvidenceCommand } from "./project-evidence.js";
@@ -14,6 +14,8 @@ import { listed, MEETING_QUERY_GUIDE, MeetingError, meetingDetailsBody, meetingP
14
14
  import { SAVE_HELP } from "../save-hints.js";
15
15
  import { addMeetingManagementCommands } from "./management.js";
16
16
  import { queryWordsAfterOptions } from "./query-options.js";
17
+ // Whoever sent the invitation wrote these, as on a calendar CLI's `events list`.
18
+ const EVENT_UNTRUSTED = ["title", "description", "location"];
17
19
  const integer = (text) => {
18
20
  if (!/^[1-9]\d*$/.test(text) || !Number.isSafeInteger(Number(text)))
19
21
  throw new InvalidArgumentError("expected a positive integer");
@@ -142,12 +144,13 @@ const addMeetingCommandsDefinition = (program, deps) => {
142
144
  .option("--max-read-bytes <bytes>", "most stored name and email bytes to read (default 1048576)", integer)
143
145
  .option("--cursor <cursor>", "continue with the same name query and selected account")
144
146
  .action(async (query, opts, command) => {
145
- print(await meetingPeople(deps.store, query, deps.accountId, {
147
+ const found = await meetingPeople(deps.store, query, deps.accountId, {
146
148
  limit: opts.limit,
147
149
  scanLimit: opts.scanLimit,
148
150
  maxReadBytes: opts.maxReadBytes,
149
151
  cursor: opts.cursor,
150
- }), command);
152
+ });
153
+ print(found, command);
151
154
  });
152
155
  output(annotate(group.command("sync"), {
153
156
  effects: FETCH,
@@ -210,6 +213,7 @@ const addMeetingCommandsDefinition = (program, deps) => {
210
213
  output,
211
214
  inRun: deps.inRun,
212
215
  ...(deps.askFirst ? { askFirst: deps.askFirst } : {}),
216
+ ...(deps.signal ? { signal: deps.signal } : {}),
213
217
  });
214
218
  const eventList = queryWordsAfterOptions(annotate(program.command("events").description("the owner's stored events"), {
215
219
  effects: { remote: "none", local: "none" },
@@ -227,7 +231,7 @@ const addMeetingCommandsDefinition = (program, deps) => {
227
231
  if (query && !deps.store.queryEvents)
228
232
  throw new MeetingError("validation_error", "this store cannot filter events");
229
233
  const events = query ? await deps.store.queryEvents?.(query) : await deps.store.events();
230
- print(listed((events ?? []).map(eventItem)), command);
234
+ print(listed((events ?? []).map((one) => ({ ...eventItem(one), untrusted: [...EVENT_UNTRUSTED] }))), command);
231
235
  });
232
236
  };
233
237
  export { addMeetingPassageCommand, createMeetingPassageCommand, meetingPassageRequest, } from "./passage.js";
@@ -1,5 +1,5 @@
1
1
  import { type Command } from "commander";
2
- import type { MeetingManagement } from "../meeting-management.js";
2
+ import { type MeetingManagement } from "../meeting-management.js";
3
3
  export interface MeetingManagementCommandDeps {
4
4
  management: MeetingManagement;
5
5
  print: (value: unknown, command: Command) => void;
@@ -7,6 +7,8 @@ export interface MeetingManagementCommandDeps {
7
7
  inRun: <T>(command: Command, body: () => Promise<T>) => Promise<T>;
8
8
  /** The profile's question before a write reaches the service (`MeetingCommandDeps.askFirst`). */
9
9
  askFirst?: (command: Command) => Promise<void>;
10
+ /** The run's stop signal (`MeetingCommandDeps.signal`), passed to the service so `--timeout` and Ctrl-C end a call. */
11
+ signal?: () => AbortSignal | undefined;
10
12
  }
11
13
  /**
12
14
  * `meetings create|update|cancel|invitation` for a service that lets the owner change its meetings: each mounted only