@wirecat/cli-core 0.658.0 → 0.660.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 (50) hide show
  1. package/CHANGELOG.md +72 -0
  2. package/dist/cli/ask-before-write.d.ts +8 -0
  3. package/dist/cli/ask-before-write.js +28 -0
  4. package/dist/cli/config-command.js +2 -9
  5. package/dist/cli/config-issues.js +1 -1
  6. package/dist/cli/index.d.ts +1 -0
  7. package/dist/cli/index.js +1 -0
  8. package/dist/cli/messenger/messages-delete-command.d.ts +2 -1
  9. package/dist/cli/messenger/messages-delete-command.js +2 -1
  10. package/dist/{cli → domain}/config-repair.d.ts +7 -0
  11. package/dist/{cli → domain}/config-repair.js +53 -0
  12. package/dist/domain/providers.js +1 -1
  13. package/dist/entities/index.d.ts +33 -93
  14. package/dist/errors/reasons.js +12 -0
  15. package/dist/index.d.ts +1 -1
  16. package/dist/index.js +1 -1
  17. package/dist/kit/sync-after-install.js +5 -0
  18. package/dist/meetings/answers.d.ts +35 -27
  19. package/dist/meetings/answers.js +3 -2
  20. package/dist/meetings/cli/index.d.ts +13 -0
  21. package/dist/meetings/cli/index.js +61 -16
  22. package/dist/meetings/cli/management.d.ts +16 -0
  23. package/dist/meetings/cli/management.js +90 -0
  24. package/dist/meetings/index.d.ts +5 -3
  25. package/dist/meetings/index.js +4 -2
  26. package/dist/meetings/item.d.ts +33 -19
  27. package/dist/meetings/item.js +29 -4
  28. package/dist/meetings/pull.d.ts +27 -2
  29. package/dist/meetings/pull.js +103 -78
  30. package/dist/meetings/read-through.d.ts +74 -0
  31. package/dist/meetings/read-through.js +330 -0
  32. package/dist/meetings/reads.d.ts +1 -0
  33. package/dist/meetings/reads.js +4 -2
  34. package/dist/meetings/result-items.d.ts +31 -0
  35. package/dist/meetings/result-items.js +31 -0
  36. package/dist/meetings/source.d.ts +47 -0
  37. package/dist/meetings/store.d.ts +7 -0
  38. package/dist/meetings/testing/memory.js +8 -1
  39. package/dist/replies/rules.d.ts +1 -1
  40. package/dist/replies/rules.js +1 -1
  41. package/dist/search/service-query.d.ts +63 -0
  42. package/dist/search/service-query.js +57 -0
  43. package/dist/sends/permissions.js +9 -4
  44. package/dist/services/messages-search.js +3 -4
  45. package/dist/services/server-search.d.ts +2 -1
  46. package/dist/services/server-search.js +36 -32
  47. package/dist/store/shared-config.d.ts +2 -0
  48. package/dist/store/shared-config.js +38 -8
  49. package/dist/store/sqlite/meetings.js +15 -1
  50. package/package.json +1 -1
@@ -70,28 +70,31 @@ export declare const meetingSummary: v.StrictObjectSchema<{
70
70
  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`">]>;
71
71
  }, undefined>;
72
72
  /** `meetings show`: the meeting with who took part, what was said in its chat, and what it holds. */
73
- export declare const meetingDetails: v.StrictObjectSchema<{
74
- readonly ref: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, "a reference such as `note:42`">]>;
75
- readonly id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>;
76
- readonly provider: v.StringSchema<undefined>;
77
- readonly account: v.StringSchema<undefined>;
78
- readonly title: v.NullableSchema<v.StringSchema<undefined>, undefined>;
79
- readonly description: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
80
- readonly location: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
81
- readonly url: v.NullableSchema<v.StringSchema<undefined>, undefined>;
82
- readonly started_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>;
83
- readonly ended_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>;
84
- readonly duration_ms: v.NullableSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>, undefined>;
85
- readonly timezone: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
86
- readonly participants_count: v.NullableSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>, undefined>;
87
- readonly issues: v.OptionalSchema<v.ArraySchema<v.PicklistSchema<readonly ["time_without_zone"], undefined>, undefined>, undefined>;
88
- 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`">]>;
89
- 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`">]>;
73
+ declare const meetingDetailsEntries: {
74
+ ref: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, "a reference such as `note:42`">]>;
75
+ id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>;
76
+ provider_id: v.StringSchema<undefined>;
77
+ provider: v.StringSchema<undefined>;
78
+ account: v.StringSchema<undefined>;
79
+ title: v.NullableSchema<v.StringSchema<undefined>, undefined>;
80
+ description: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
81
+ location: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
82
+ url: v.NullableSchema<v.StringSchema<undefined>, undefined>;
83
+ started_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>;
84
+ ended_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>;
85
+ duration_ms: v.NullableSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>, undefined>;
86
+ timezone: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
87
+ participants_count: v.NullableSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>, undefined>;
88
+ issues: v.OptionalSchema<v.ArraySchema<v.PicklistSchema<readonly ["time_without_zone"], undefined>, undefined>, undefined>;
89
+ found_in: v.OptionalSchema<v.PicklistSchema<["archive", "server", "both"], undefined>, undefined>;
90
+ untrusted: v.OptionalSchema<v.ArraySchema<v.StringSchema<undefined>, undefined>, undefined>;
91
+ 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`">]>;
92
+ 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`">]>;
90
93
  /** The stored event and series it belongs to, as `meetings_list` takes them. */
91
- readonly event_id: v.NullableSchema<v.StringSchema<undefined>, undefined>;
92
- readonly series_id: v.NullableSchema<v.StringSchema<undefined>, undefined>;
93
- readonly series_title: v.NullableSchema<v.StringSchema<undefined>, undefined>;
94
- readonly participants: v.ArraySchema<v.StrictObjectSchema<{
94
+ event_id: v.NullableSchema<v.StringSchema<undefined>, undefined>;
95
+ series_id: v.NullableSchema<v.StringSchema<undefined>, undefined>;
96
+ series_title: v.NullableSchema<v.StringSchema<undefined>, undefined>;
97
+ participants: v.ArraySchema<v.StrictObjectSchema<{
95
98
  readonly name: v.NullableSchema<v.StringSchema<undefined>, undefined>;
96
99
  readonly email: v.NullableSchema<v.StringSchema<undefined>, undefined>;
97
100
  readonly role: v.NullableSchema<v.StringSchema<undefined>, undefined>;
@@ -104,19 +107,19 @@ export declare const meetingDetails: v.StrictObjectSchema<{
104
107
  readonly left_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>;
105
108
  readonly duration_ms: v.NullableSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>, undefined>;
106
109
  }, undefined>, undefined>;
107
- readonly transcripts: v.ArraySchema<v.StrictObjectSchema<{
110
+ transcripts: v.ArraySchema<v.StrictObjectSchema<{
108
111
  readonly ref: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, "a reference such as `note:42`">]>;
109
112
  readonly source: v.StringSchema<undefined>;
110
113
  readonly language: v.NullableSchema<v.StringSchema<undefined>, undefined>;
111
114
  readonly lines_count: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>;
112
115
  }, undefined>, undefined>;
113
- readonly chat: v.ArraySchema<v.StrictObjectSchema<{
116
+ chat: v.ArraySchema<v.StrictObjectSchema<{
114
117
  readonly sent_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`">]>;
115
118
  readonly sender: v.NullableSchema<v.StringSchema<undefined>, undefined>;
116
119
  readonly recipient: v.NullableSchema<v.StringSchema<undefined>, undefined>;
117
120
  readonly text: v.StringSchema<undefined>;
118
121
  }, undefined>, undefined>;
119
- readonly summaries: v.ArraySchema<v.StrictObjectSchema<{
122
+ summaries: v.ArraySchema<v.StrictObjectSchema<{
120
123
  readonly id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>;
121
124
  readonly meeting: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, "a reference such as `note:42`">]>;
122
125
  readonly source: v.StringSchema<undefined>;
@@ -132,7 +135,7 @@ export declare const meetingDetails: v.StrictObjectSchema<{
132
135
  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`">]>;
133
136
  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`">]>;
134
137
  }, undefined>, undefined>;
135
- readonly attachments: v.ArraySchema<v.StrictObjectSchema<{
138
+ attachments: v.ArraySchema<v.StrictObjectSchema<{
136
139
  readonly position: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>;
137
140
  readonly kind: v.StringSchema<undefined>;
138
141
  readonly name: v.NullableSchema<v.StringSchema<undefined>, undefined>;
@@ -144,13 +147,17 @@ export declare const meetingDetails: v.StrictObjectSchema<{
144
147
  * The Drive files the meeting service saved for it, by role. `document` is the stored document (`document:<id>`) once
145
148
  * a Drive profile has imported the file, else `null`: then `drive` can fetch it by `file_id`.
146
149
  */
147
- readonly documents: v.ArraySchema<v.StrictObjectSchema<{
150
+ documents: v.ArraySchema<v.StrictObjectSchema<{
148
151
  readonly file_id: v.StringSchema<undefined>;
149
152
  readonly role: v.PicklistSchema<readonly ["transcript", "recording", "notes"], undefined>;
150
153
  readonly title: v.NullableSchema<v.StringSchema<undefined>, undefined>;
151
154
  readonly document: v.NullableSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, "a reference such as `note:42`">]>, undefined>;
152
155
  }, undefined>, undefined>;
153
- }, undefined>;
156
+ };
157
+ type MeetingDetailsEntriesOf = typeof meetingDetailsEntries;
158
+ export interface MeetingDetailsEntries extends MeetingDetailsEntriesOf {
159
+ }
160
+ export declare const meetingDetails: v.StrictObjectSchema<MeetingDetailsEntries, undefined>;
154
161
  export type MeetingHitItem = v.InferOutput<typeof meetingHit>;
155
162
  export type MeetingTranscriptItem = v.InferOutput<typeof meetingTranscript>;
156
163
  export type MeetingSummaryItem = v.InferOutput<typeof meetingSummary>;
@@ -185,3 +192,4 @@ export declare const meetingHitItem: (hit: SearchHit & {
185
192
  export declare const meetingHitsList: (found: MeetingSearchPage, limit: number, command?: string, args?: Record<string, unknown>, meta?: Partial<Meta>) => MeetingListBody<MeetingHitItem> & {
186
193
  meta?: Partial<Meta>;
187
194
  };
195
+ export {};
@@ -67,7 +67,7 @@ export const meetingSummary = v.strictObject({
67
67
  updated_at: isoTime,
68
68
  });
69
69
  /** `meetings show`: the meeting with who took part, what was said in its chat, and what it holds. */
70
- export const meetingDetails = v.strictObject({
70
+ const meetingDetailsEntries = {
71
71
  ...meeting.entries,
72
72
  /** The stored event and series it belongs to, as `meetings_list` takes them. */
73
73
  event_id: v.nullable(text),
@@ -104,7 +104,8 @@ export const meetingDetails = v.strictObject({
104
104
  title: v.nullable(text),
105
105
  document: v.nullable(reference),
106
106
  })),
107
- });
107
+ };
108
+ export const meetingDetails = v.strictObject(meetingDetailsEntries);
108
109
  const meetingRef = (accountId, meetingId) => formatMeetingReference({ type: "meeting", accountId, meetingId });
109
110
  export const meetingTranscriptItem = (accountId, transcript, rows) => ({
110
111
  ref: formatMeetingReference({
@@ -1,5 +1,6 @@
1
1
  import { type Command } from "commander";
2
2
  import { type ImportFile } from "../import.js";
3
+ import type { MeetingManagement } from "../meeting-management.js";
3
4
  import { type MeetingBudget } from "../pull.js";
4
5
  import type { MeetingSource } from "../source.js";
5
6
  import type { MeetingStore } from "../store.js";
@@ -31,6 +32,18 @@ export interface MeetingCommandDeps {
31
32
  */
32
33
  budgetOf?: (command: Command) => MeetingBudget;
33
34
  now?: () => number;
35
+ /** The owner's zone, in which `meetings list` reads a query's dates on both sides; the computer's without it. */
36
+ timezone?: string;
37
+ /**
38
+ * The service's meeting writes, `createMeetingManagement(scope, ports)`: `meetings create|update|cancel|invitation`
39
+ * are mounted for the ports it has.
40
+ */
41
+ management?: MeetingManagement;
42
+ /**
43
+ * Puts the profile's question before a write to the service: `askBeforeWrite` from `@wirecat/cli-core/cli`, which
44
+ * asks when the command's key is at `ask` and refuses when nobody can answer. Without it the writes refuse.
45
+ */
46
+ askFirst?: (command: Command) => Promise<void>;
34
47
  }
35
48
  export { addMeetingPassageCommand, createMeetingPassageCommand, type MeetingPassageFlags, meetingPassageRequest, } from "./passage.js";
36
49
  export { addMeetingProjectEvidenceCommand } from "./project-evidence.js";
@@ -4,11 +4,14 @@ import { InvalidArgumentError, Option } from "commander";
4
4
  import { EVENT_QUERY } from "../event-query.js";
5
5
  import { exportMeeting } from "../export.js";
6
6
  import { importFiles } from "../import.js";
7
+ import { BACKENDS } from "../index.js";
7
8
  import { MEETING_QUERY } from "../item.js";
8
9
  import { pull } from "../pull.js";
9
10
  import { eventItem } from "../read-answers.js";
10
- import { listed, MEETING_QUERY_GUIDE, MeetingError, meetingDetailsAnswer, meetingPeople, meetingSummaryAnswer, meetingsList, meetingsQuery, meetingTranscriptAnswer, } from "../reads.js";
11
+ import { meetingShowThrough, meetingsListThrough } from "../read-through.js";
12
+ import { listed, MEETING_QUERY_GUIDE, MeetingError, meetingDetailsBody, meetingPeople, meetingSummaryAnswer, meetingsQuery, meetingTranscriptAnswer, } from "../reads.js";
11
13
  import { SAVE_HELP } from "../save-hints.js";
14
+ import { addMeetingManagementCommands } from "./management.js";
12
15
  import { queryWordsAfterOptions } from "./query-options.js";
13
16
  const integer = (text) => {
14
17
  if (!/^[1-9]\d*$/.test(text) || !Number.isSafeInteger(Number(text)))
@@ -29,6 +32,17 @@ const date = (text) => {
29
32
  }
30
33
  };
31
34
  const LOCAL_READ = { remote: "none", local: "read" };
35
+ /** Reads the service; what it returns is kept as `sync` keeps it, which counts as a read (WC-CMD-17). */
36
+ const REMOTE_READ = { remote: "read", local: "read" };
37
+ const backendOf = (value) => {
38
+ if (!BACKENDS.includes(value))
39
+ throw new InvalidArgumentError("expected archive, server or both");
40
+ return value;
41
+ };
42
+ // No commander default: an untyped --backend falls back to the store with a `missing` line, a typed one refuses.
43
+ const backendOption = (command) => command.option("--backend <archive|server|both>", "where to read: the store (archive), the service (server), or both, kept in the store (default: both)", backendOf);
44
+ const BACKEND_HELP = "--backend both asks the service with the part of the query it can filter, keeps what it returns, then runs the " +
45
+ "whole query over the store; each item says found_in archive, server or both. --offline reads the store only.";
32
46
  const LOCAL_WRITE = { remote: "none", local: "write" };
33
47
  const FETCH = { remote: "read", local: "write" };
34
48
  const addMeetingCommandsDefinition = (program, deps) => {
@@ -47,27 +61,50 @@ const addMeetingCommandsDefinition = (program, deps) => {
47
61
  const opts = command.optsWithGlobals();
48
62
  deps.write(value, opts.json ? "json" : opts.jsonl ? "jsonl" : "text");
49
63
  };
50
- const list = queryWordsAfterOptions(group.command("list").description("stored meetings, newest first"))
64
+ const access = (command, backend) => ({
65
+ ...(backend === undefined ? {} : { backend }),
66
+ offline: command.optsWithGlobals().offline === true,
67
+ timezone: timezoneOf(deps.timezone),
68
+ ...(deps.now ? { now: deps.now() } : {}),
69
+ });
70
+ const list = queryWordsAfterOptions(group.command("list").description("meetings, newest first: the service's and the stored ones, kept in the store"))
51
71
  .argument("[query...]", "field:value terms that narrow the list — the fields are below")
52
- .addHelpText("after", `\n${fieldsHelp(MEETING_QUERY, MEETING_QUERY_GUIDE)}`);
53
- annotate(list, { effects: LOCAL_READ, query: defineQuery(MEETING_QUERY), output: { entity: "meeting" } });
54
- output(list)
72
+ .addHelpText("after", `\n${fieldsHelp(MEETING_QUERY, MEETING_QUERY_GUIDE)}\n${BACKEND_HELP}`);
73
+ annotate(list, {
74
+ effects: REMOTE_READ,
75
+ partial: true,
76
+ query: defineQuery(MEETING_QUERY),
77
+ output: { entity: "meeting" },
78
+ });
79
+ backendOption(output(list))
55
80
  .option("--limit <n>", "meetings per page", integer, 100)
56
81
  .option("--page <n>", "page number", integer, 1)
57
82
  .action(async (words, opts, command) => {
58
83
  const query = meetingsQuery(words.join(" "));
59
- print(await meetingsList(deps.store, {
60
- accountId: deps.accountId,
61
- limit: opts.limit,
62
- offset: (opts.page - 1) * opts.limit,
63
- ...(query ? { query } : {}),
64
- }), command);
84
+ await deps.inRun(command, async () => {
85
+ // The standard envelope has no place for the counts; what the reader must know is in `missing` and `meta`.
86
+ const { server: _server, ...answer } = await meetingsListThrough(deps.source, deps.store, {
87
+ accountId: deps.accountId,
88
+ limit: opts.limit,
89
+ offset: (opts.page - 1) * opts.limit,
90
+ ...(query ? { query } : {}),
91
+ }, access(command, opts.backend));
92
+ print(answer, command);
93
+ });
65
94
  });
66
- output(annotate(group.command("show"), { effects: LOCAL_READ, output: { entity: "meeting_details" } })
67
- .description("show a stored meeting")
68
- .argument("<meeting>", "stored meeting id", integer)
69
- .addHelpText("after", SAVE_HELP)).action(async (id, _opts, command) => {
70
- print(await meetingDetailsAnswer(deps.store, id, deps.accountId), command);
95
+ backendOption(output(annotate(group.command("show"), { effects: REMOTE_READ, partial: true, output: { entity: "meeting_details" } })
96
+ .description("show a meeting, read again from the service with its people, transcript and documents")
97
+ .argument("<meeting>", "the stored meeting's number, its meeting: ref, or the service's id (provider_id)")
98
+ .addHelpText("after", `${SAVE_HELP}\n${BACKEND_HELP}`))).action(async (meeting, opts, command) => {
99
+ await deps.inRun(command, async () => {
100
+ const shown = await meetingShowThrough(deps.source, deps.store, deps.accountId, meeting, access(command, opts.backend));
101
+ const { item } = await meetingDetailsBody(deps.store, shown.details);
102
+ print({
103
+ item: shown.foundIn ? { ...item, found_in: shown.foundIn } : item,
104
+ ...(shown.missing ? { missing: shown.missing } : {}),
105
+ ...(shown.meta ? { meta: shown.meta } : {}),
106
+ }, command);
107
+ });
71
108
  });
72
109
  output(annotate(group.command("transcript"), { effects: LOCAL_READ, output: { entity: "meeting_transcript" } })
73
110
  .description("show current meeting transcripts")
@@ -178,6 +215,14 @@ const addMeetingCommandsDefinition = (program, deps) => {
178
215
  now: deps.now?.() ?? Date.now(),
179
216
  }), command);
180
217
  });
218
+ if (deps.management)
219
+ addMeetingManagementCommands(group, {
220
+ management: deps.management,
221
+ print,
222
+ output,
223
+ inRun: deps.inRun,
224
+ ...(deps.askFirst ? { askFirst: deps.askFirst } : {}),
225
+ });
181
226
  const eventList = queryWordsAfterOptions(annotate(program.command("events").description("the owner's stored events"), {
182
227
  effects: { remote: "none", local: "none" },
183
228
  }).command("list"))
@@ -0,0 +1,16 @@
1
+ import { type Command } from "commander";
2
+ import type { MeetingManagement } from "../meeting-management.js";
3
+ export interface MeetingManagementCommandDeps {
4
+ management: MeetingManagement;
5
+ print: (value: unknown, command: Command) => void;
6
+ output: (command: Command) => Command;
7
+ inRun: <T>(command: Command, body: () => Promise<T>) => Promise<T>;
8
+ /** The profile's question before a write reaches the service (`MeetingCommandDeps.askFirst`). */
9
+ askFirst?: (command: Command) => Promise<void>;
10
+ }
11
+ /**
12
+ * `meetings create|update|cancel|invitation` for a service that lets the owner change its meetings: each mounted only
13
+ * where the host's ports have it. A write's key is its path (`meetings.create`), asked first by default; `--dry-run`
14
+ * previews it without reaching the service.
15
+ */
16
+ export declare const addMeetingManagementCommands: (group: Command, deps: MeetingManagementCommandDeps) => void;
@@ -0,0 +1,90 @@
1
+ import { CliError } from "@wirecat/cli-base";
2
+ import { annotate } from "@wirecat/cli-base/commands";
3
+ import { InvalidArgumentError, Option } from "commander";
4
+ const REMOTE_READ = { remote: "read", local: "read" };
5
+ const REMOTE_WRITE = { remote: "write", local: "write" };
6
+ const minutes = (text) => {
7
+ if (!/^[1-9]\d*$/.test(text))
8
+ throw new InvalidArgumentError("expected whole minutes");
9
+ return Number(text);
10
+ };
11
+ const changeOptions = (command) => command
12
+ .option("--title <title>", "the meeting's title")
13
+ .addOption(new Option("--kind <kind>", "an instant or a scheduled meeting").choices(["instant", "scheduled"]))
14
+ .option("--start-time <time>", "when it starts: an ISO time with its offset, 2026-11-20T10:00:00+01:00")
15
+ .option("--duration-minutes <minutes>", "how long it lasts, 1–1440", minutes)
16
+ .option("--timezone <zone>", "its IANA time zone, Europe/Madrid")
17
+ .option("--agenda <text>", "its agenda");
18
+ const changeOf = (flags) => Object.fromEntries(["title", "kind", "startTime", "durationMinutes", "timezone", "agenda"].flatMap((key) => flags[key] === undefined ? [] : [[key, flags[key]]]));
19
+ const meetingOf = (one) => ({
20
+ id: one.id,
21
+ title: one.title,
22
+ kind: one.kind,
23
+ start_time: one.startTime,
24
+ duration_minutes: one.durationMinutes,
25
+ timezone: one.timezone,
26
+ agenda: one.agenda,
27
+ join_url: one.joinUrl,
28
+ });
29
+ const receiptItem = (receipt) => {
30
+ const { change } = receipt;
31
+ return {
32
+ action: receipt.action,
33
+ provider: receipt.scope.provider,
34
+ account: receipt.scope.account,
35
+ ...(receipt.id === undefined ? {} : { id: receipt.id }),
36
+ ...(receipt.occurrenceId === undefined ? {} : { occurrence_id: receipt.occurrenceId }),
37
+ ...(change
38
+ ? {
39
+ change: {
40
+ ...(change.title === undefined ? {} : { title: change.title }),
41
+ ...(change.kind === undefined ? {} : { kind: change.kind }),
42
+ ...(change.startTime === undefined ? {} : { start_time: change.startTime }),
43
+ ...(change.durationMinutes === undefined ? {} : { duration_minutes: change.durationMinutes }),
44
+ ...(change.timezone === undefined ? {} : { timezone: change.timezone }),
45
+ ...(change.agenda === undefined ? {} : { agenda: change.agenda }),
46
+ },
47
+ }
48
+ : {}),
49
+ applied: receipt.applied,
50
+ ...(receipt.meeting ? { meeting: meetingOf(receipt.meeting) } : {}),
51
+ };
52
+ };
53
+ /**
54
+ * `meetings create|update|cancel|invitation` for a service that lets the owner change its meetings: each mounted only
55
+ * where the host's ports have it. A write's key is its path (`meetings.create`), asked first by default; `--dry-run`
56
+ * previews it without reaching the service.
57
+ */
58
+ export const addMeetingManagementCommands = (group, deps) => {
59
+ const { management, print, output, inRun, askFirst } = deps;
60
+ const has = (name) => management.capabilities.includes(name);
61
+ // A write the owner could not be asked about never goes: a host that forgets the question gets a refusal.
62
+ const mutation = async (command) => {
63
+ const dryRun = command.optsWithGlobals().dryRun === true;
64
+ if (!dryRun) {
65
+ if (!askFirst)
66
+ throw new CliError("configuration_error", "this tool cannot ask before it changes a meeting on the service");
67
+ await askFirst(command);
68
+ }
69
+ return { apply: true, dryRun };
70
+ };
71
+ const write = (name) => annotate(group.command(name), { effects: REMOTE_WRITE, offline: false, output: { entity: "meeting_change" } });
72
+ const target = (command) => command.argument("<meeting>", "the service's id of the meeting");
73
+ if (has("create"))
74
+ output(changeOptions(write("create").description("create a meeting on the service"))).action(async (flags, command) => inRun(command, async () => print({ item: receiptItem(await management.create(changeOf(flags), await mutation(command))) }, command)));
75
+ if (has("update"))
76
+ output(changeOptions(target(write("update").description("change a meeting on the service")))).action(async (id, flags, command) => inRun(command, async () => print({ item: receiptItem(await management.update(id, changeOf(flags), await mutation(command))) }, command)));
77
+ if (has("cancel"))
78
+ output(target(write("cancel").description("cancel a meeting on the service")).option("--occurrence-id <id>", "cancel only this occurrence of a repeating meeting")).action(async (id, flags, command) => inRun(command, async () => print({
79
+ item: receiptItem(await management.cancel(id, {
80
+ ...(await mutation(command)),
81
+ ...(flags.occurrenceId === undefined ? {} : { occurrenceId: flags.occurrenceId }),
82
+ })),
83
+ }, command)));
84
+ if (has("invitation"))
85
+ output(target(annotate(group.command("invitation"), {
86
+ effects: REMOTE_READ,
87
+ offline: false,
88
+ output: { entity: "meeting_invitation" },
89
+ }).description("the invitation text the service writes for a meeting"))).action(async (id, _flags, command) => inRun(command, async () => print({ item: { ...(await management.invitation(id)), untrusted: ["invitation"] } }, command)));
90
+ };
@@ -1,3 +1,4 @@
1
+ export { BACKENDS, type Backend, type QueryTree, type ServiceCalls, type ServiceCapability, type ServiceOperator, serviceCallsOf, } from "../search/service-query.js";
1
2
  export { MEETING_STEPS, type MeetingDetailsItem, type MeetingHitItem, type MeetingItemBody, type MeetingListBody, type MeetingSummaryItem, type MeetingTranscriptItem, meetingDetails, meetingHit, meetingHitsList, meetingSummary, meetingTranscript, } from "./answers.js";
2
3
  export type { MeetingBatchReader } from "./batch.js";
3
4
  export { calendarText, ENTRY_METADATA_KEYS, entryMetadata, withoutLinkQueries } from "./calendar-text.js";
@@ -31,10 +32,11 @@ export { readMeetingProjectEvidence } from "./project-evidence.js";
31
32
  export { type MeetingProjectEvidenceAnswer, type MeetingProjectEvidenceItem, meetingProjectEvidence, meetingProjectEvidenceAnswer, } from "./project-evidence-answer.js";
32
33
  export { MEETING_PROJECT_EVIDENCE_QUERY, type MeetingProjectEvidenceRequest, prepareMeetingProjectEvidence, } from "./project-evidence-query.js";
33
34
  export { type MeetingProviderScope, snapshotMeetingScope } from "./provider.js";
34
- export { type MeetingBudget, type MeetingBudgetStop, type PullOptions, pull, type RunReport } from "./pull.js";
35
+ export { type MeetingBudget, type MeetingBudgetStop, type PullOptions, pull, type RunReport, type SourceMeetingParts, saveSourceMeeting, } from "./pull.js";
35
36
  export { event, eventItem, meetingCounts, meetingCountsItem, meetingLink, meetingLinkItem, meetingParticipants, meetingPassage, meetingReview, meetingReviewItem, meetingSpeaker, meetingSpeakerItem, meetingStats, meetingStatsItem, } from "./read-answers.js";
36
37
  export type { MeetingContextReadCapabilities, MeetingReadBudget, MeetingReadCapabilities, MeetingReadScope, TranscriptContextInput, TranscriptContextPage, TranscriptPage, TranscriptReadScope, TranscriptRowPage, } from "./read-store.js";
37
- export { listed, MeetingError, meetingDetailsAnswer, meetingPeople, meetingSummaryAnswer, meetingTranscriptAnswer, type TranscriptReadOptions, } from "./reads.js";
38
+ export { askServerForList, MEETING_SERVER_BOUNDS, type MeetingListThrough, type MeetingServerAccess, type MeetingServerReport, type MeetingServerSkip, type MeetingShowThrough, meetingShowThrough, meetingsListThrough, } from "./read-through.js";
39
+ export { listed, MeetingError, meetingDetailsAnswer, meetingDetailsBody, meetingPeople, meetingSummaryAnswer, meetingTranscriptAnswer, type TranscriptReadOptions, } from "./reads.js";
38
40
  export { installRecordingArchiveSchedule, parseRecordingArchiveSchedule, planRecordingArchiveSchedule, type RecordingArchiveSchedule, type RecordingArchiveScheduleInput, type RecordingArchiveScheduler, recordingArchiveScheduleWindow, } from "./recording-schedule.js";
39
41
  export type { ArchivedRecording, RecordingArchiveResult, RecordingAsset, RecordingAssetLocator, RecordingCatalog, RecordingOccurrence, RecordingPage, RecordingScope, RecordingWindow, } from "./recording-source.js";
40
42
  export { parseRecordingSyncCheckpoint, type RecordingSyncCheckpoint, type RecordingSyncCheckpointStore, type RecordingSyncEntry, RecordingSyncError, type RecordingSyncLease, type RecordingSyncOptions, type RecordingSyncReceipt, recordingAssetFingerprint, recordingWindows, syncRecordingArchive, } from "./recording-sync.js";
@@ -50,7 +52,7 @@ export { type MeetingHistoryEntry, type MeetingSeriesContext, type MeetingSeries
50
52
  export { createMeetingSeriesInventoryReader } from "./series-inventory.js";
51
53
  export type { MeetingSeriesCandidate, MeetingSeriesInventoryPage, MeetingSeriesInventoryPort, MeetingSeriesInventoryRead, MeetingSeriesInventoryRequest, MeetingSeriesInventoryResult, } from "./series-inventory-types.js";
52
54
  export { validateMeetingSeriesInventoryCursor } from "./series-inventory-validation.js";
53
- export type { MeetingSource, SourceParticipant } from "./source.js";
55
+ export type { FoundMeeting, FoundMeetings, FullMeeting, MeetingFinds, MeetingSource, MeetingTerm, MeetingWindow, SourceParticipant, } from "./source.js";
54
56
  export { aggregateMeetingCounts, aggregateMeetingStats, MEETING_COUNTS_GROUPINGS, type MeetingCounts, type MeetingCountsGrouping, type MeetingCountsInput, type MeetingCountsMeeting, type MeetingCountsRow, type MeetingSpeakerStats, type MeetingStats, type MeetingStatsInput, type MeetingStatsRow, type MeetingStatsSelection, type MeetingStatsStore, type MeetingWeekStats, NO_SERIES, } from "./stats.js";
55
57
  export type { ChatInput, ContractCase, EventCandidateFilter, IdentityInput, MeetingDetails, MeetingDocument, MeetingDocumentInput, MeetingDocumentRole, MeetingFilter, MeetingHitSource, MeetingInput, MeetingParticipant, MeetingSave, MeetingStore, NewRecord, ParticipantInput, SearchHit, TranscriptInput, TranscriptLanguageFill, TranscriptRowInput, } from "./store.js";
56
58
  export { MEETING_DOCUMENT_ROLES, READ_BUDGET_EXCEEDED } from "./store.js";
@@ -1,3 +1,4 @@
1
+ export { BACKENDS, serviceCallsOf, } from "../search/service-query.js";
1
2
  export { MEETING_STEPS, meetingDetails, meetingHit, meetingHitsList, meetingSummary, meetingTranscript, } from "./answers.js";
2
3
  export { calendarText, ENTRY_METADATA_KEYS, entryMetadata, withoutLinkQueries } from "./calendar-text.js";
3
4
  export { meetingCueFingerprint } from "./cue-fingerprint.js";
@@ -23,9 +24,10 @@ export { readMeetingProjectEvidence } from "./project-evidence.js";
23
24
  export { meetingProjectEvidence, meetingProjectEvidenceAnswer, } from "./project-evidence-answer.js";
24
25
  export { MEETING_PROJECT_EVIDENCE_QUERY, prepareMeetingProjectEvidence, } from "./project-evidence-query.js";
25
26
  export { snapshotMeetingScope } from "./provider.js";
26
- export { pull } from "./pull.js";
27
+ export { pull, saveSourceMeeting, } from "./pull.js";
27
28
  export { event, eventItem, meetingCounts, meetingCountsItem, meetingLink, meetingLinkItem, meetingParticipants, meetingPassage, meetingReview, meetingReviewItem, meetingSpeaker, meetingSpeakerItem, meetingStats, meetingStatsItem, } from "./read-answers.js";
28
- export { listed, MeetingError, meetingDetailsAnswer, meetingPeople, meetingSummaryAnswer, meetingTranscriptAnswer, } from "./reads.js";
29
+ export { askServerForList, MEETING_SERVER_BOUNDS, meetingShowThrough, meetingsListThrough, } from "./read-through.js";
30
+ export { listed, MeetingError, meetingDetailsAnswer, meetingDetailsBody, meetingPeople, meetingSummaryAnswer, meetingTranscriptAnswer, } from "./reads.js";
29
31
  export { installRecordingArchiveSchedule, parseRecordingArchiveSchedule, planRecordingArchiveSchedule, recordingArchiveScheduleWindow, } from "./recording-schedule.js";
30
32
  export { parseRecordingSyncCheckpoint, RecordingSyncError, recordingAssetFingerprint, recordingWindows, syncRecordingArchive, } from "./recording-sync.js";
31
33
  export { RecordingTransferError, strongRecordingValidator, transferRecording, } from "./recording-transfer.js";
@@ -8,27 +8,40 @@ export declare const MEETING_ISSUES: readonly ["time_without_zone"];
8
8
  export type MeetingIssue = (typeof MEETING_ISSUES)[number];
9
9
  /** The issues a provider adapter put in `metadata.issues`, the known ones only, in their listed order. */
10
10
  export declare const meetingIssuesOf: (metadata: Meeting["metadata"]) => MeetingIssue[];
11
- /** A stored meeting as every command and tool answers it; `src/entities/` registers it as `meeting`. */
12
- export declare const meeting: v.StrictObjectSchema<{
13
- readonly ref: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, "a reference such as `note:42`">]>;
14
- readonly id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>;
15
- readonly provider: v.StringSchema<undefined>;
16
- readonly account: v.StringSchema<undefined>;
17
- readonly title: v.NullableSchema<v.StringSchema<undefined>, undefined>;
18
- readonly description: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
19
- readonly location: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
11
+ declare const meetingEntries: {
12
+ ref: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, "a reference such as `note:42`">]>;
13
+ id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>;
14
+ /** The service's own id of this occurrence: what `meetings show` takes besides the store number. */
15
+ provider_id: v.StringSchema<undefined>;
16
+ provider: v.StringSchema<undefined>;
17
+ account: v.StringSchema<undefined>;
18
+ title: v.NullableSchema<v.StringSchema<undefined>, undefined>;
19
+ description: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
20
+ location: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
20
21
  /** The link that joins it. */
21
- readonly url: v.NullableSchema<v.StringSchema<undefined>, undefined>;
22
- readonly started_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>;
23
- readonly ended_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>;
24
- readonly duration_ms: v.NullableSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>, undefined>;
25
- readonly timezone: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
26
- readonly participants_count: v.NullableSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>, undefined>;
22
+ url: v.NullableSchema<v.StringSchema<undefined>, undefined>;
23
+ started_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>;
24
+ ended_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>;
25
+ duration_ms: v.NullableSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>, undefined>;
26
+ timezone: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
27
+ participants_count: v.NullableSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>, undefined>;
27
28
  /** Present only when something about this meeting is doubtful. */
28
- readonly issues: v.OptionalSchema<v.ArraySchema<v.PicklistSchema<readonly ["time_without_zone"], undefined>, undefined>, undefined>;
29
- 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`">]>;
30
- 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`">]>;
31
- }, undefined>;
29
+ issues: v.OptionalSchema<v.ArraySchema<v.PicklistSchema<readonly ["time_without_zone"], undefined>, undefined>, undefined>;
30
+ /**
31
+ * Where a read that asked the service found it, as messages search says it: `archive` (only the store), `server`
32
+ * (new from the service), `both`. Absent when the service was not asked.
33
+ */
34
+ found_in: v.OptionalSchema<v.PicklistSchema<["archive", "server", "both"], undefined>, undefined>;
35
+ /** The service's text, which a reader must not follow as instructions. */
36
+ untrusted: v.OptionalSchema<v.ArraySchema<v.StringSchema<undefined>, undefined>, undefined>;
37
+ 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`">]>;
38
+ 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`">]>;
39
+ };
40
+ type MeetingEntriesOf = typeof meetingEntries;
41
+ export interface MeetingEntries extends MeetingEntriesOf {
42
+ }
43
+ /** A stored meeting as every command and tool answers it; `src/entities/` registers it as `meeting`. */
44
+ export declare const meeting: v.StrictObjectSchema<MeetingEntries, undefined>;
32
45
  export type MeetingItem = v.InferOutput<typeof meeting>;
33
46
  /** Which provider and account a stored meeting account is, as `MeetingStore.account` answers it. */
34
47
  export interface MeetingOwner {
@@ -42,3 +55,4 @@ export declare const MEETING_QUERY: {
42
55
  readonly backend: "sql";
43
56
  readonly fields: import("@wirecat/cli-base/query").FieldSpec[];
44
57
  };
58
+ export {};
@@ -14,10 +14,11 @@ export const meetingIssuesOf = (metadata) => {
14
14
  const listed = metadata?.issues;
15
15
  return Array.isArray(listed) ? MEETING_ISSUES.filter((issue) => listed.includes(issue)) : [];
16
16
  };
17
- /** A stored meeting as every command and tool answers it; `src/entities/` registers it as `meeting`. */
18
- export const meeting = v.strictObject({
17
+ const meetingEntries = {
19
18
  ref: reference,
20
19
  id: v.pipe(v.string(), v.minLength(1)),
20
+ /** The service's own id of this occurrence: what `meetings show` takes besides the store number. */
21
+ provider_id: text,
21
22
  provider: text,
22
23
  account: text,
23
24
  title: v.nullable(text),
@@ -32,15 +33,26 @@ export const meeting = v.strictObject({
32
33
  participants_count: v.nullable(count),
33
34
  /** Present only when something about this meeting is doubtful. */
34
35
  issues: v.optional(v.array(v.picklist(MEETING_ISSUES))),
36
+ /**
37
+ * Where a read that asked the service found it, as messages search says it: `archive` (only the store), `server`
38
+ * (new from the service), `both`. Absent when the service was not asked.
39
+ */
40
+ found_in: v.optional(v.picklist(["archive", "server", "both"])),
41
+ /** The service's text, which a reader must not follow as instructions. */
42
+ untrusted: v.optional(v.array(text)),
35
43
  created_at: isoTime,
36
44
  updated_at: isoTime,
37
- });
45
+ };
46
+ /** A stored meeting as every command and tool answers it; `src/entities/` registers it as `meeting`. */
47
+ export const meeting = v.strictObject(meetingEntries);
48
+ const MEETING_UNTRUSTED = ["title", "description", "location"];
38
49
  const iso = (ms) => (ms === null ? null : new Date(ms).toISOString());
39
50
  export const meetingItem = (row, owner) => {
40
51
  const issues = meetingIssuesOf(row.metadata);
41
52
  return {
42
53
  ref: formatMeetingReference({ type: "meeting", accountId: row.accountId, meetingId: row.id }),
43
54
  id: String(row.id),
55
+ provider_id: row.externalId,
44
56
  provider: owner.provider,
45
57
  account: owner.account,
46
58
  title: row.title,
@@ -53,6 +65,7 @@ export const meetingItem = (row, owner) => {
53
65
  timezone: row.timezone,
54
66
  participants_count: row.participantsCount,
55
67
  ...(issues.length ? { issues } : {}),
68
+ untrusted: [...MEETING_UNTRUSTED],
56
69
  created_at: new Date(row.createdAt).toISOString(),
57
70
  updated_at: new Date(row.updatedAt).toISOString(),
58
71
  };
@@ -62,9 +75,21 @@ export const MEETING_QUERY = {
62
75
  entity: "meeting",
63
76
  backend: "sql",
64
77
  fields: queryFieldsOf(meeting, {
65
- exclude: ["ref", "provider", "account", "description", "location", "url", "timezone", "issues"],
78
+ exclude: [
79
+ "ref",
80
+ "provider",
81
+ "account",
82
+ "description",
83
+ "location",
84
+ "url",
85
+ "timezone",
86
+ "issues",
87
+ "found_in",
88
+ "untrusted",
89
+ ],
66
90
  examples: {
67
91
  id: "id:12",
92
+ provider_id: "provider_id:85746065432",
68
93
  title: "title:*standup*",
69
94
  started_at: "started_at:[2026-10-01 TO 2026-10-31]",
70
95
  duration_ms: "duration_ms>=3600000",
@@ -1,5 +1,6 @@
1
- import type { MeetingSource } from "./source.js";
2
- import type { MeetingStore } from "./store.js";
1
+ import type { Meeting, SourceChatLine, SourceMeeting, SummaryContent, TranscriptLine } from "./model.js";
2
+ import type { MeetingSource, SourceParticipant } from "./source.js";
3
+ import type { MeetingDetails, MeetingDocumentInput, MeetingInput, MeetingSave, MeetingStore } from "./store.js";
3
4
  export interface RunReport {
4
5
  meetings: number;
5
6
  participants: number;
@@ -31,4 +32,28 @@ export interface PullOptions {
31
32
  /** Asked before each meeting; a stop keeps what is saved and moves the cursor to the first meeting not reached. */
32
33
  budget?: MeetingBudget;
33
34
  }
35
+ /** What was read of one meeting besides the meeting itself; `undefined` is not read, `null` is unavailable. */
36
+ export interface SourceMeetingParts {
37
+ participants?: SourceParticipant[] | null;
38
+ transcript?: TranscriptLine[] | null;
39
+ chat?: SourceChatLine[] | null;
40
+ summary?: SummaryContent | null;
41
+ files?: NonNullable<MeetingSave["attachments"]> | null;
42
+ documents?: MeetingDocumentInput[] | null;
43
+ }
44
+ /**
45
+ * The meetings row of a meeting the service returned. With `kept`, the stored row, a field the record leaves empty
46
+ * keeps the stored value and the metadata merges: a live read's record may be thinner than what sync stored.
47
+ */
48
+ export declare const sourceMeetingInput: (m: SourceMeeting, accountId: number, participantsCount: number | null | undefined, kept?: Meeting) => MeetingInput;
49
+ /**
50
+ * Saves one meeting as `meetings sync` does, keyed by its occurrence id, and links its event: `sync` and the reads that
51
+ * keep what the service returned write the same row. It never moves the sync's cursor. A live read passes `kept`, the
52
+ * stored row, so a thinner record does not empty what sync stored (`sourceMeetingInput`).
53
+ */
54
+ export declare const saveSourceMeeting: (source: Pick<MeetingSource, "provider" | "name" | "transcriptFormat" | "createsEvents">, store: MeetingStore, m: SourceMeeting, parts: SourceMeetingParts, { accountId, now, kept }: {
55
+ accountId: number;
56
+ now: number;
57
+ kept?: Meeting;
58
+ }) => Promise<MeetingDetails>;
34
59
  export declare const pull: (source: MeetingSource, store: MeetingStore, options: PullOptions) => Promise<RunReport>;