@wirecat/cli-core 0.659.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 (41) hide show
  1. package/CHANGELOG.md +51 -0
  2. package/dist/calendar/mcp/index.d.ts +12 -12
  3. package/dist/cli/ask-before-write.d.ts +8 -0
  4. package/dist/cli/ask-before-write.js +28 -0
  5. package/dist/cli/index.d.ts +1 -0
  6. package/dist/cli/index.js +1 -0
  7. package/dist/domain/providers.js +1 -1
  8. package/dist/entities/index.d.ts +33 -93
  9. package/dist/errors/reasons.js +12 -0
  10. package/dist/index.d.ts +1 -1
  11. package/dist/index.js +1 -1
  12. package/dist/meetings/answers.d.ts +35 -27
  13. package/dist/meetings/answers.js +3 -2
  14. package/dist/meetings/cli/index.d.ts +13 -0
  15. package/dist/meetings/cli/index.js +61 -16
  16. package/dist/meetings/cli/management.d.ts +16 -0
  17. package/dist/meetings/cli/management.js +90 -0
  18. package/dist/meetings/index.d.ts +5 -3
  19. package/dist/meetings/index.js +4 -2
  20. package/dist/meetings/item.d.ts +33 -19
  21. package/dist/meetings/item.js +29 -4
  22. package/dist/meetings/mcp/index.d.ts +15 -15
  23. package/dist/meetings/pull.d.ts +27 -2
  24. package/dist/meetings/pull.js +103 -78
  25. package/dist/meetings/read-through.d.ts +74 -0
  26. package/dist/meetings/read-through.js +330 -0
  27. package/dist/meetings/reads.d.ts +1 -0
  28. package/dist/meetings/reads.js +4 -2
  29. package/dist/meetings/result-items.d.ts +31 -0
  30. package/dist/meetings/result-items.js +31 -0
  31. package/dist/meetings/source.d.ts +47 -0
  32. package/dist/meetings/store.d.ts +7 -0
  33. package/dist/meetings/testing/memory.js +8 -1
  34. package/dist/search/service-query.d.ts +63 -0
  35. package/dist/search/service-query.js +57 -0
  36. package/dist/sends/permissions.js +4 -0
  37. package/dist/services/messages-search.js +3 -4
  38. package/dist/services/server-search.d.ts +2 -1
  39. package/dist/services/server-search.js +36 -32
  40. package/dist/store/sqlite/meetings.js +15 -1
  41. package/package.json +1 -1
@@ -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",
@@ -38,6 +38,7 @@ export declare const meetingTools: ({
38
38
  max_read_bytes?: undefined;
39
39
  cursor?: undefined;
40
40
  } | {
41
+ limit?: undefined;
41
42
  event_id?: undefined;
42
43
  series_id?: undefined;
43
44
  page?: undefined;
@@ -53,11 +54,11 @@ export declare const meetingTools: ({
53
54
  format?: undefined;
54
55
  transcript_id?: undefined;
55
56
  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;
61
62
  event_id?: undefined;
62
63
  series_id?: undefined;
63
64
  page?: undefined;
@@ -75,11 +76,11 @@ export declare const meetingTools: ({
75
76
  format?: undefined;
76
77
  transcript_id?: undefined;
77
78
  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;
83
84
  event_id?: undefined;
84
85
  series_id?: undefined;
85
86
  page?: undefined;
@@ -101,7 +102,6 @@ export declare const meetingTools: ({
101
102
  minimum: number;
102
103
  };
103
104
  query?: undefined;
104
- limit?: undefined;
105
105
  scan_limit?: undefined;
106
106
  max_read_bytes?: undefined;
107
107
  cursor?: undefined;
@@ -188,6 +188,7 @@ export declare const meetingTools: ({
188
188
  max_read_bytes?: undefined;
189
189
  cursor?: undefined;
190
190
  } | {
191
+ limit?: undefined;
191
192
  event_id?: undefined;
192
193
  series_id?: undefined;
193
194
  page?: undefined;
@@ -203,11 +204,11 @@ export declare const meetingTools: ({
203
204
  format?: undefined;
204
205
  transcript_id?: undefined;
205
206
  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;
211
212
  event_id?: undefined;
212
213
  series_id?: undefined;
213
214
  page?: undefined;
@@ -225,11 +226,11 @@ export declare const meetingTools: ({
225
226
  format?: undefined;
226
227
  transcript_id?: undefined;
227
228
  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;
233
234
  event_id?: undefined;
234
235
  series_id?: undefined;
235
236
  page?: undefined;
@@ -251,7 +252,6 @@ export declare const meetingTools: ({
251
252
  minimum: number;
252
253
  };
253
254
  query?: undefined;
254
- limit?: undefined;
255
255
  scan_limit?: undefined;
256
256
  max_read_bytes?: undefined;
257
257
  cursor?: undefined;
@@ -338,6 +338,7 @@ export declare const meetingTools: ({
338
338
  max_read_bytes?: undefined;
339
339
  cursor?: undefined;
340
340
  } | {
341
+ limit?: undefined;
341
342
  event_id?: undefined;
342
343
  series_id?: undefined;
343
344
  page?: undefined;
@@ -353,11 +354,11 @@ export declare const meetingTools: ({
353
354
  format?: undefined;
354
355
  transcript_id?: undefined;
355
356
  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;
361
362
  event_id?: undefined;
362
363
  series_id?: undefined;
363
364
  page?: undefined;
@@ -375,11 +376,11 @@ export declare const meetingTools: ({
375
376
  format?: undefined;
376
377
  transcript_id?: undefined;
377
378
  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;
383
384
  event_id?: undefined;
384
385
  series_id?: undefined;
385
386
  page?: undefined;
@@ -401,7 +402,6 @@ export declare const meetingTools: ({
401
402
  minimum: number;
402
403
  };
403
404
  query?: undefined;
404
- limit?: undefined;
405
405
  scan_limit?: undefined;
406
406
  max_read_bytes?: undefined;
407
407
  cursor?: undefined;
@@ -488,6 +488,7 @@ export declare const meetingTools: ({
488
488
  max_read_bytes?: undefined;
489
489
  cursor?: undefined;
490
490
  } | {
491
+ limit?: undefined;
491
492
  event_id?: undefined;
492
493
  series_id?: undefined;
493
494
  page?: undefined;
@@ -503,11 +504,11 @@ export declare const meetingTools: ({
503
504
  format?: undefined;
504
505
  transcript_id?: undefined;
505
506
  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;
511
512
  event_id?: undefined;
512
513
  series_id?: undefined;
513
514
  page?: undefined;
@@ -525,11 +526,11 @@ export declare const meetingTools: ({
525
526
  format?: undefined;
526
527
  transcript_id?: undefined;
527
528
  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;
533
534
  event_id?: undefined;
534
535
  series_id?: undefined;
535
536
  page?: undefined;
@@ -551,7 +552,6 @@ export declare const meetingTools: ({
551
552
  minimum: number;
552
553
  };
553
554
  query?: undefined;
554
- limit?: undefined;
555
555
  scan_limit?: undefined;
556
556
  max_read_bytes?: undefined;
557
557
  cursor?: undefined;
@@ -638,6 +638,7 @@ export declare const meetingTools: ({
638
638
  max_read_bytes?: undefined;
639
639
  cursor?: undefined;
640
640
  } | {
641
+ limit?: undefined;
641
642
  event_id?: undefined;
642
643
  series_id?: undefined;
643
644
  page?: undefined;
@@ -653,11 +654,11 @@ export declare const meetingTools: ({
653
654
  format?: undefined;
654
655
  transcript_id?: undefined;
655
656
  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;
661
662
  event_id?: undefined;
662
663
  series_id?: undefined;
663
664
  page?: undefined;
@@ -675,11 +676,11 @@ export declare const meetingTools: ({
675
676
  format?: undefined;
676
677
  transcript_id?: undefined;
677
678
  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;
683
684
  event_id?: undefined;
684
685
  series_id?: undefined;
685
686
  page?: undefined;
@@ -701,7 +702,6 @@ export declare const meetingTools: ({
701
702
  minimum: number;
702
703
  };
703
704
  query?: undefined;
704
- limit?: undefined;
705
705
  scan_limit?: undefined;
706
706
  max_read_bytes?: undefined;
707
707
  cursor?: undefined;