@wirecat/cli-core 0.662.0 → 0.664.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +213 -0
- package/dist/calendar/cli/bodies.js +2 -1
- package/dist/calendar/cli/index.js +13 -10
- package/dist/calendar/mcp/index.d.ts +3 -1
- package/dist/calendar/mcp/index.js +4 -4
- package/dist/cli/call-stats-command.d.ts +18 -0
- package/dist/cli/call-stats-command.js +52 -0
- package/dist/cli/chat-sending-command.d.ts +14 -0
- package/dist/cli/chat-sending-command.js +64 -0
- package/dist/cli/context.d.ts +7 -0
- package/dist/cli/context.js +12 -4
- package/dist/cli/contract-templates.js +2 -0
- package/dist/cli/envelope.d.ts +0 -5
- package/dist/cli/envelope.js +25 -0
- package/dist/cli/index.d.ts +4 -1
- package/dist/cli/index.js +4 -1
- package/dist/cli/meeting-batch.d.ts +2 -1
- package/dist/cli/meeting-batch.js +7 -5
- package/dist/cli/meeting-meaning-command.d.ts +47 -0
- package/dist/cli/meeting-meaning-command.js +136 -0
- package/dist/cli/meeting-preparation-answer.d.ts +6 -0
- package/dist/cli/meeting-preparation-command.js +5 -5
- package/dist/cli/meeting-preparation-projects.d.ts +6 -0
- package/dist/cli/meeting-preparation-read.d.ts +11 -5
- package/dist/cli/meeting-preparation-read.js +13 -21
- package/dist/cli/meeting-series-inventory-command.js +2 -2
- package/dist/cli/meeting-series-inventory-read.d.ts +2 -2
- package/dist/cli/meeting-series-inventory-read.js +7 -15
- package/dist/cli/meeting-tags-command.d.ts +18 -0
- package/dist/cli/meeting-tags-command.js +74 -0
- package/dist/cli/messenger/admin-statistics-command.js +2 -2
- package/dist/cli/messenger/conversation-answers.d.ts +1 -1
- package/dist/cli/messenger/conversation-answers.js +1 -0
- package/dist/cli/messenger/conversations-command.js +38 -12
- package/dist/cli/messenger/counters-command.js +2 -2
- package/dist/cli/messenger/media-archive-command.js +5 -4
- package/dist/cli/messenger/media-archive-move-command.js +1 -1
- package/dist/cli/messenger/media-archive-timer-command.js +5 -4
- package/dist/cli/messenger/metadata-command.js +3 -3
- package/dist/cli/messenger/models-command.js +7 -0
- package/dist/cli/messenger/rankings-command.js +3 -3
- package/dist/cli/messenger/records-command.d.ts +4 -1
- package/dist/cli/messenger/records-command.js +6 -1
- package/dist/cli/messenger/tags-command.js +7 -2
- package/dist/cli/messenger/tasks-command.js +2 -2
- package/dist/cli/model-catalogue-command.js +2 -0
- package/dist/cli/paging.d.ts +10 -0
- package/dist/cli/paging.js +29 -0
- package/dist/cli/profile-token.d.ts +15 -1
- package/dist/cli/profile-token.js +103 -7
- package/dist/cli/program.js +2 -2
- package/dist/cli/runs/command.js +6 -4
- package/dist/cli/runs/search-command.js +9 -5
- package/dist/cli/schedule/schedule-command.js +1 -5
- package/dist/domain/links.d.ts +11 -0
- package/dist/domain/links.js +4 -0
- package/dist/domain/moment.d.ts +29 -0
- package/dist/domain/moment.js +58 -0
- package/dist/domain/providers.d.ts +6 -4
- package/dist/domain/providers.js +10 -5
- package/dist/domain/send-time.d.ts +3 -4
- package/dist/domain/send-time.js +10 -24
- package/dist/entities/chat-sending.d.ts +10 -0
- package/dist/entities/chat-sending.js +11 -0
- package/dist/entities/fields.d.ts +2 -2
- package/dist/entities/fields.js +2 -2
- package/dist/entities/index.d.ts +135 -2
- package/dist/entities/index.js +8 -3
- package/dist/entities/meeting-preparation.d.ts +6 -0
- package/dist/entities/meeting.d.ts +1 -1
- package/dist/entities/meeting.js +1 -1
- package/dist/errors/reasons.js +25 -2
- package/dist/mail/cli/index.js +4 -2
- package/dist/mail/facts.d.ts +5 -2
- package/dist/mail/facts.js +6 -3
- package/dist/mail/index.d.ts +1 -1
- package/dist/mail/meeting-notes.js +1 -1
- package/dist/mail/probe.d.ts +5 -2
- package/dist/mail/probe.js +9 -5
- package/dist/mail/server-search.js +1 -1
- package/dist/mail/sync.js +1 -1
- package/dist/mcp/meeting-preparation.d.ts +6 -0
- package/dist/mcp/meeting-preparation.js +1 -1
- package/dist/mcp/meeting-series-inventory.js +1 -1
- package/dist/mcp/prompts.js +6 -9
- package/dist/meetings/answers.d.ts +7 -0
- package/dist/meetings/answers.js +4 -0
- package/dist/meetings/call-answers.d.ts +106 -0
- package/dist/meetings/call-answers.js +171 -0
- package/dist/meetings/call-stats.d.ts +121 -0
- package/dist/meetings/call-stats.js +211 -0
- package/dist/meetings/calls.d.ts +76 -0
- package/dist/meetings/calls.js +78 -0
- package/dist/meetings/cli/index.d.ts +8 -0
- package/dist/meetings/cli/index.js +10 -22
- package/dist/meetings/cli/search.d.ts +9 -2
- package/dist/meetings/cli/search.js +16 -26
- package/dist/meetings/index.d.ts +4 -0
- package/dist/meetings/index.js +4 -0
- package/dist/meetings/mcp/index.d.ts +6 -3
- package/dist/meetings/mcp/index.js +2 -4
- package/dist/meetings/mcp/search.d.ts +12 -1
- package/dist/meetings/mcp/search.js +3 -3
- package/dist/meetings/project-evidence-answer.d.ts +6 -0
- package/dist/meetings/read-through.d.ts +2 -1
- package/dist/meetings/read-through.js +10 -1
- package/dist/meetings/stats.d.ts +3 -0
- package/dist/meetings/stats.js +3 -3
- package/dist/meetings/tag-answers.d.ts +43 -0
- package/dist/meetings/tag-answers.js +41 -0
- package/dist/meetings/testing/index.d.ts +1 -0
- package/dist/meetings/testing/index.js +1 -0
- package/dist/meetings/testing/paging.d.ts +6 -0
- package/dist/meetings/testing/paging.js +5 -0
- package/dist/models/chat-sending.d.ts +24 -0
- package/dist/models/chat-sending.js +40 -0
- package/dist/moderation/rules.d.ts +2 -0
- package/dist/moderation/rules.js +16 -2
- package/dist/runs/events.d.ts +1 -1
- package/dist/search/fusion.d.ts +17 -0
- package/dist/search/fusion.js +17 -0
- package/dist/search/lucene/resolved.d.ts +2 -0
- package/dist/search/question-plan.d.ts +4 -0
- package/dist/search/question-plan.js +7 -0
- package/dist/search/service-query.d.ts +6 -1
- package/dist/search/service-query.js +9 -1
- package/dist/search/task-similarity.d.ts +1 -0
- package/dist/search/task-similarity.js +1 -1
- package/dist/services/agenda-mail.js +2 -1
- package/dist/services/agenda.js +5 -3
- package/dist/services/attachments.js +4 -2
- package/dist/services/call-stats.d.ts +17 -0
- package/dist/services/call-stats.js +41 -0
- package/dist/services/chats.js +4 -2
- package/dist/services/conversations.js +4 -2
- package/dist/services/deps.d.ts +1 -1
- package/dist/services/document-source.d.ts +1 -1
- package/dist/services/document-source.js +4 -3
- package/dist/services/documents/ingestion.js +11 -40
- package/dist/services/documents/plan.d.ts +1 -1
- package/dist/services/documents/plan.js +30 -17
- package/dist/services/documents/ports.d.ts +5 -0
- package/dist/services/documents/sync.js +1 -1
- package/dist/services/embeddings-search.js +39 -9
- package/dist/services/embeddings.d.ts +4 -0
- package/dist/services/events-search.js +2 -1
- package/dist/services/index.d.ts +3 -0
- package/dist/services/index.js +3 -0
- package/dist/services/mail-search.d.ts +1 -1
- package/dist/services/mail-search.js +10 -11
- package/dist/services/media-archive-move.js +2 -4
- package/dist/services/media-archive.d.ts +0 -1
- package/dist/services/media-archive.js +2 -12
- package/dist/services/meeting-combined.js +1 -1
- package/dist/services/meeting-meaning.d.ts +47 -0
- package/dist/services/meeting-meaning.js +158 -0
- package/dist/services/meeting-tags.d.ts +27 -0
- package/dist/services/meeting-tags.js +81 -0
- package/dist/services/messages-combined.js +15 -4
- package/dist/services/messages-discovery.js +2 -2
- package/dist/services/moderation.js +10 -2
- package/dist/services/moment.d.ts +4 -10
- package/dist/services/moment.js +16 -44
- package/dist/services/notes-search.d.ts +0 -2
- package/dist/services/notes-search.js +1 -2
- package/dist/services/search-all.js +2 -1
- package/dist/services/tags.js +4 -2
- package/dist/services/task-stats.js +2 -2
- package/dist/services/tasks.js +2 -2
- package/dist/sftp/index.d.ts +1 -1
- package/dist/sftp/index.js +1 -1
- package/dist/sftp/session.d.ts +30 -4
- package/dist/sftp/session.js +195 -11
- package/dist/sftp/ssh2.d.ts +19 -4
- package/dist/sftp/ssh2.js +144 -17
- package/dist/speech/cloud.d.ts +47 -0
- package/dist/speech/cloud.js +73 -0
- package/dist/speech/decode.d.ts +36 -9
- package/dist/speech/decode.js +208 -61
- package/dist/speech/index.d.ts +2 -1
- package/dist/speech/index.js +2 -1
- package/dist/speech/openai.d.ts +4 -0
- package/dist/speech/openai.js +13 -12
- package/dist/sql/index.d.ts +1 -0
- package/dist/sql/index.js +1 -0
- package/dist/sql/reader.d.ts +95 -0
- package/dist/sql/reader.js +214 -0
- package/dist/store/accounts.js +2 -1
- package/dist/store/sqlite/account-purge.d.ts +3 -0
- package/dist/store/sqlite/account-purge.js +143 -0
- package/dist/store/sqlite/accounts.d.ts +0 -2
- package/dist/store/sqlite/accounts.js +2 -134
- package/dist/store/sqlite/calendar.d.ts +1 -0
- package/dist/store/sqlite/calendar.js +5 -5
- package/dist/store/sqlite/catalog.js +2 -16
- package/dist/store/sqlite/chats.js +2 -1
- package/dist/store/sqlite/context-document-source.d.ts +3 -3
- package/dist/store/sqlite/context-document-source.js +9 -7
- package/dist/store/sqlite/context-evidence.js +9 -3
- package/dist/store/sqlite/document-listing.js +2 -1
- package/dist/store/sqlite/drizzle/bun.js +4 -4
- package/dist/store/sqlite/drizzle/bun.js.map +1 -1
- package/dist/store/sqlite/drizzle/core.js +5 -5
- package/dist/store/sqlite/drizzle/core.js.map +1 -1
- package/dist/store/sqlite/drizzle/node.js +4 -4
- package/dist/store/sqlite/drizzle/node.js.map +1 -1
- package/dist/store/sqlite/drizzle/{shared-55XJMTPA.js → shared-5XR7K42U.js} +58 -58
- package/dist/store/sqlite/drizzle/{shared-55XJMTPA.js.map → shared-5XR7K42U.js.map} +1 -1
- package/dist/store/sqlite/events.js +2 -1
- package/dist/store/sqlite/file-note.d.ts +6 -0
- package/dist/store/sqlite/file-note.js +15 -0
- package/dist/store/sqlite/files.d.ts +3 -2
- package/dist/store/sqlite/files.js +5 -3
- package/dist/store/sqlite/identities.js +2 -1
- package/dist/store/sqlite/imported-documents.js +2 -2
- package/dist/store/sqlite/knowledge.d.ts +1 -1
- package/dist/store/sqlite/knowledge.js +27 -23
- package/dist/store/sqlite/labelled.d.ts +5 -0
- package/dist/store/sqlite/labelled.js +6 -0
- package/dist/store/sqlite/link-row.d.ts +1 -0
- package/dist/store/sqlite/link-row.js +2 -0
- package/dist/store/sqlite/lucene-fields.js +8 -12
- package/dist/store/sqlite/mail-rules.js +2 -1
- package/dist/store/sqlite/meeting-calls.d.ts +4 -0
- package/dist/store/sqlite/meeting-calls.js +66 -0
- package/dist/store/sqlite/meetings.d.ts +2 -2
- package/dist/store/sqlite/meetings.js +4 -1
- package/dist/store/sqlite/mention-sources.js +2 -1
- package/dist/store/sqlite/mentions.js +2 -2
- package/dist/store/sqlite/messages.js +6 -1
- package/dist/store/sqlite/note-search.js +8 -11
- package/dist/store/sqlite/notes.d.ts +3 -1
- package/dist/store/sqlite/notes.js +25 -14
- package/dist/store/sqlite/organizations.js +2 -2
- package/dist/store/sqlite/people-list.js +3 -3
- package/dist/store/sqlite/query-filter.d.ts +3 -3
- package/dist/store/sqlite/query-filter.js +3 -3
- package/dist/store/sqlite/reads.d.ts +4 -4
- package/dist/store/sqlite/reads.js +4 -4
- package/dist/store/sqlite/search.js +11 -7
- package/dist/store/sqlite/test-accounts.js +1 -1
- package/dist/store/sqlite/trigram-match.d.ts +9 -0
- package/dist/store/sqlite/trigram-match.js +28 -0
- package/dist/store/sqlite/work-tasks.js +1 -1
- package/package.json +18 -3
- package/parity.json +20 -1
- package/skills/link-conversations/SKILL.md +1 -1
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import type { MeetingStatsSelection } from "./stats.js";
|
|
2
|
+
export declare const CALL_DIRECTIONS: readonly ["incoming", "outgoing", "internal"];
|
|
3
|
+
export type CallDirection = (typeof CALL_DIRECTIONS)[number];
|
|
4
|
+
export declare const CALL_OUTCOMES: readonly ["answered", "voicemail", "busy", "no_answer", "failed"];
|
|
5
|
+
export type CallOutcome = (typeof CALL_OUTCOMES)[number];
|
|
6
|
+
/** The outcomes of an incoming call nobody took: what a business calls back. */
|
|
7
|
+
export declare const MISSED_OUTCOMES: readonly CallOutcome[];
|
|
8
|
+
/** One participant of a stored call, as the store keeps it. */
|
|
9
|
+
export interface StoredCallParticipant {
|
|
10
|
+
identityId: number;
|
|
11
|
+
/** The identity's external id: `phone:+34…`, `number:…`, `extension:<profile>/101`, `abonent:…`. */
|
|
12
|
+
identityKey: string;
|
|
13
|
+
role: string | null;
|
|
14
|
+
name: string | null;
|
|
15
|
+
/** The provider's own id for the participant; a PBX gives the extension number. */
|
|
16
|
+
externalId: string | null;
|
|
17
|
+
}
|
|
18
|
+
/** One stored meeting as the call reader needs it: its metadata unparsed, its people. */
|
|
19
|
+
export interface StoredCall {
|
|
20
|
+
meetingId: number;
|
|
21
|
+
startedAt: number | null;
|
|
22
|
+
/** The meeting's own duration column. */
|
|
23
|
+
durationMs: number | null;
|
|
24
|
+
metadata: unknown;
|
|
25
|
+
participants: readonly StoredCallParticipant[];
|
|
26
|
+
}
|
|
27
|
+
/** An employee on a call: by extension where the provider names one, else by the stored identity. */
|
|
28
|
+
export interface CallEmployee {
|
|
29
|
+
/** `extension:<number>` or `identity:<id>`. */
|
|
30
|
+
key: string;
|
|
31
|
+
name: string | null;
|
|
32
|
+
identityId: number | null;
|
|
33
|
+
extension: string | null;
|
|
34
|
+
}
|
|
35
|
+
export interface CallClient {
|
|
36
|
+
/** The identity's external id, `phone:+E164` or `number:<raw>`: the same client on every call. */
|
|
37
|
+
key: string;
|
|
38
|
+
name: string | null;
|
|
39
|
+
identityId: number;
|
|
40
|
+
}
|
|
41
|
+
/** A meeting read as a phone call. A field the provider does not give is `null`, never a guess. */
|
|
42
|
+
export interface Call {
|
|
43
|
+
meetingId: number;
|
|
44
|
+
startedAt: number | null;
|
|
45
|
+
direction: CallDirection | null;
|
|
46
|
+
outcome: CallOutcome | null;
|
|
47
|
+
/** From the first ring to the first answer. */
|
|
48
|
+
waitMs: number | null;
|
|
49
|
+
/** From the first answer to the end. */
|
|
50
|
+
talkMs: number | null;
|
|
51
|
+
durationMs: number | null;
|
|
52
|
+
client: CallClient | null;
|
|
53
|
+
placedBy: CallEmployee | null;
|
|
54
|
+
/** Whether the provider says who placed, answered and rang; when not, those three are empty and unknown. */
|
|
55
|
+
roles: boolean;
|
|
56
|
+
/** In the order they answered. */
|
|
57
|
+
answeredBy: CallEmployee[];
|
|
58
|
+
/** Rang and did not answer. */
|
|
59
|
+
rang: CallEmployee[];
|
|
60
|
+
/** Everyone of the business on the call: who placed it, answered, rang, or the provider lists as its manager. */
|
|
61
|
+
employees: CallEmployee[];
|
|
62
|
+
}
|
|
63
|
+
/**
|
|
64
|
+
* A stored meeting as a call, or `null` when it is not one: a call has a direction or an outcome a phone system
|
|
65
|
+
* writes, or a participant whose role is `client`. Keys may be missing or of the wrong type; each such field is
|
|
66
|
+
* `null`. Wait and talk come only from the provider's own `waitMs` and `talkMs`: a recording's length is not talk.
|
|
67
|
+
*/
|
|
68
|
+
export declare const callOf: (stored: StoredCall) => Call | null;
|
|
69
|
+
export interface MeetingCallsInput extends MeetingStatsSelection {
|
|
70
|
+
/** Most meetings to read (default 200000); more is an error, never a silent cut. */
|
|
71
|
+
maxRows?: number;
|
|
72
|
+
}
|
|
73
|
+
export interface MeetingCallsStore {
|
|
74
|
+
/** The selected meetings with their metadata and people, oldest first; the caller reads which are calls. */
|
|
75
|
+
meetingCalls(input: MeetingCallsInput): Promise<StoredCall[]>;
|
|
76
|
+
}
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
export const CALL_DIRECTIONS = ["incoming", "outgoing", "internal"];
|
|
2
|
+
export const CALL_OUTCOMES = ["answered", "voicemail", "busy", "no_answer", "failed"];
|
|
3
|
+
/** The outcomes of an incoming call nobody took: what a business calls back. */
|
|
4
|
+
export const MISSED_OUTCOMES = ["voicemail", "busy", "no_answer"];
|
|
5
|
+
const isRecord = (value) => typeof value === "object" && value !== null && !Array.isArray(value);
|
|
6
|
+
const milliseconds = (value) => typeof value === "number" && Number.isFinite(value) && value >= 0 ? Math.round(value) : null;
|
|
7
|
+
const word = (value) => (typeof value === "string" && value.trim() ? value.trim() : null);
|
|
8
|
+
// Beeline writes INBOUND and OUTBOUND.
|
|
9
|
+
const DIRECTION_WORDS = {
|
|
10
|
+
incoming: "incoming",
|
|
11
|
+
inbound: "incoming",
|
|
12
|
+
outgoing: "outgoing",
|
|
13
|
+
outbound: "outgoing",
|
|
14
|
+
internal: "internal",
|
|
15
|
+
};
|
|
16
|
+
const directionOf = (value) => {
|
|
17
|
+
const found = word(value)?.toLowerCase();
|
|
18
|
+
return found === undefined ? null : (DIRECTION_WORDS[found] ?? null);
|
|
19
|
+
};
|
|
20
|
+
const outcomeOf = (value) => {
|
|
21
|
+
const found = word(value);
|
|
22
|
+
return found && CALL_OUTCOMES.includes(found) ? found : null;
|
|
23
|
+
};
|
|
24
|
+
const numbers = (value) => Array.isArray(value) ? value.map(word).filter((one) => one !== null) : [];
|
|
25
|
+
/**
|
|
26
|
+
* A stored meeting as a call, or `null` when it is not one: a call has a direction or an outcome a phone system
|
|
27
|
+
* writes, or a participant whose role is `client`. Keys may be missing or of the wrong type; each such field is
|
|
28
|
+
* `null`. Wait and talk come only from the provider's own `waitMs` and `talkMs`: a recording's length is not talk.
|
|
29
|
+
*/
|
|
30
|
+
export const callOf = (stored) => {
|
|
31
|
+
const metadata = isRecord(stored.metadata) ? stored.metadata : {};
|
|
32
|
+
const direction = directionOf(metadata.direction);
|
|
33
|
+
const outcome = outcomeOf(metadata.outcome);
|
|
34
|
+
const clientParticipant = stored.participants.find((one) => one.role === "client");
|
|
35
|
+
if (direction === null && outcome === null && !clientParticipant)
|
|
36
|
+
return null;
|
|
37
|
+
const managers = stored.participants.filter((one) => one.role === "manager");
|
|
38
|
+
const byExtension = (number) => {
|
|
39
|
+
const found = managers.find((one) => one.externalId === number);
|
|
40
|
+
return {
|
|
41
|
+
key: `extension:${number}`,
|
|
42
|
+
name: found?.name ?? null,
|
|
43
|
+
identityId: found?.identityId ?? null,
|
|
44
|
+
extension: number,
|
|
45
|
+
};
|
|
46
|
+
};
|
|
47
|
+
const placed = word(metadata.placedBy);
|
|
48
|
+
const answeredBy = numbers(metadata.answeredBy).map(byExtension);
|
|
49
|
+
const rang = numbers(metadata.rang).map(byExtension);
|
|
50
|
+
const placedBy = placed === null ? null : byExtension(placed);
|
|
51
|
+
const named = [placedBy, ...answeredBy, ...rang].filter((one) => one !== null);
|
|
52
|
+
const listed = managers
|
|
53
|
+
.filter((one) => !named.some((employee) => employee.identityId === one.identityId))
|
|
54
|
+
.map((one) => ({
|
|
55
|
+
key: `identity:${one.identityId}`,
|
|
56
|
+
name: one.name,
|
|
57
|
+
identityId: one.identityId,
|
|
58
|
+
extension: one.externalId,
|
|
59
|
+
}));
|
|
60
|
+
const employees = [...new Map([...named, ...listed].map((one) => [one.key, one])).values()];
|
|
61
|
+
return {
|
|
62
|
+
meetingId: stored.meetingId,
|
|
63
|
+
startedAt: stored.startedAt,
|
|
64
|
+
direction,
|
|
65
|
+
outcome,
|
|
66
|
+
waitMs: milliseconds(metadata.waitMs),
|
|
67
|
+
talkMs: milliseconds(metadata.talkMs),
|
|
68
|
+
durationMs: milliseconds(metadata.durationMs) ?? milliseconds(stored.durationMs),
|
|
69
|
+
client: clientParticipant
|
|
70
|
+
? { key: clientParticipant.identityKey, name: clientParticipant.name, identityId: clientParticipant.identityId }
|
|
71
|
+
: null,
|
|
72
|
+
placedBy,
|
|
73
|
+
roles: ["placedBy", "answeredBy", "rang"].some((key) => key in metadata),
|
|
74
|
+
answeredBy,
|
|
75
|
+
rang,
|
|
76
|
+
employees,
|
|
77
|
+
};
|
|
78
|
+
};
|
|
@@ -31,6 +31,14 @@ export interface MeetingCommandDeps {
|
|
|
31
31
|
* keeps the one-shot deadline.
|
|
32
32
|
*/
|
|
33
33
|
budgetOf?: (command: Command) => MeetingBudget;
|
|
34
|
+
/**
|
|
35
|
+
* `meetings list`'s page from its flags and the profile's `defaults.limit`: `pagingOf` from `@wirecat/cli-core/cli`.
|
|
36
|
+
* Required, since this module cannot reach the profile's settings itself.
|
|
37
|
+
*/
|
|
38
|
+
pagingOf: (command: Command) => {
|
|
39
|
+
limit: number;
|
|
40
|
+
page: number;
|
|
41
|
+
};
|
|
34
42
|
now?: () => number;
|
|
35
43
|
/** The owner's zone, in which `meetings list` reads a query's dates on both sides; the computer's without it. */
|
|
36
44
|
timezone?: string;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { annotate, annotateOption, sharedCommand } from "@wirecat/cli-base/commands";
|
|
2
|
-
import { defineQuery, fieldsHelp, parseLucene, timezoneOf, validateQuery
|
|
2
|
+
import { defineQuery, fieldsHelp, parseLucene, timezoneOf, validateQuery } from "@wirecat/cli-base/query";
|
|
3
3
|
import { InvalidArgumentError, Option } from "commander";
|
|
4
|
+
import { dateWindow } from "../../services/moment.js";
|
|
4
5
|
import { EVENT_QUERY } from "../event-query.js";
|
|
5
6
|
import { exportMeeting } from "../export.js";
|
|
6
7
|
import { importFiles } from "../import.js";
|
|
@@ -23,14 +24,6 @@ const lookbackDays = (text) => {
|
|
|
23
24
|
throw new InvalidArgumentError("expected an integer from 0 through 31 days");
|
|
24
25
|
return Number(text);
|
|
25
26
|
};
|
|
26
|
-
const date = (text) => {
|
|
27
|
-
try {
|
|
28
|
-
return zonedMoment(text, timezoneOf(), { start: 0, end: text.length });
|
|
29
|
-
}
|
|
30
|
-
catch {
|
|
31
|
-
throw new InvalidArgumentError("expected an ISO date, or a time with or without an offset");
|
|
32
|
-
}
|
|
33
|
-
};
|
|
34
27
|
const LOCAL_READ = { remote: "none", local: "read" };
|
|
35
28
|
/** Reads the service; what it returns is kept as `sync` keeps it, which counts as a read (WC-CMD-17). */
|
|
36
29
|
const REMOTE_READ = { remote: "read", local: "read" };
|
|
@@ -49,14 +42,8 @@ const addMeetingCommandsDefinition = (program, deps) => {
|
|
|
49
42
|
const group = annotate(program.command("meetings").description("stored meetings and their records"), {
|
|
50
43
|
effects: { remote: "none", local: "none" },
|
|
51
44
|
});
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
.option("--jsonl", "one JSON object per item")
|
|
55
|
-
.hook("preAction", (cmd) => {
|
|
56
|
-
const opts = cmd.optsWithGlobals();
|
|
57
|
-
if (opts.json && opts.jsonl)
|
|
58
|
-
throw new MeetingError("validation_error", "choose --json or --jsonl");
|
|
59
|
-
});
|
|
45
|
+
// The host's root gives `--json [fields]` and `--jsonl`; a leaf of its own would shadow them.
|
|
46
|
+
const output = (command) => command;
|
|
60
47
|
const print = (value, command) => {
|
|
61
48
|
const opts = command.optsWithGlobals();
|
|
62
49
|
deps.write(value, opts.json ? "json" : opts.jsonl ? "jsonl" : "text");
|
|
@@ -77,16 +64,17 @@ const addMeetingCommandsDefinition = (program, deps) => {
|
|
|
77
64
|
output: { entity: "meeting" },
|
|
78
65
|
});
|
|
79
66
|
backendOption(output(list))
|
|
80
|
-
.option("--limit <n>", "meetings per page", integer
|
|
81
|
-
.option("--page <n>", "page
|
|
67
|
+
.option("--limit <n>", "meetings per page; the profile's defaults.limit when absent", integer)
|
|
68
|
+
.option("--page <n>", "which page, starting at 1", integer)
|
|
82
69
|
.action(async (words, opts, command) => {
|
|
83
70
|
const query = meetingsQuery(words.join(" "));
|
|
71
|
+
const { limit, page } = deps.pagingOf(command);
|
|
84
72
|
await deps.inRun(command, async () => {
|
|
85
73
|
// The standard envelope has no place for the counts; what the reader must know is in `missing` and `meta`.
|
|
86
74
|
const { server: _server, ...answer } = await meetingsListThrough(deps.source, deps.store, {
|
|
87
75
|
accountId: deps.accountId,
|
|
88
|
-
limit
|
|
89
|
-
offset: (
|
|
76
|
+
limit,
|
|
77
|
+
offset: (page - 1) * limit,
|
|
90
78
|
...(query ? { query } : {}),
|
|
91
79
|
}, access(command, opts.backend));
|
|
92
80
|
print(answer, command);
|
|
@@ -169,7 +157,7 @@ const addMeetingCommandsDefinition = (program, deps) => {
|
|
|
169
157
|
...(deps.budgetOf ? { cooperative: true, partial: true } : {}),
|
|
170
158
|
}).description("bring the stored meetings up to date from the connected account, oldest first; a run that stops before its " +
|
|
171
159
|
"deadline keeps what it saved and the next one goes on from there"))
|
|
172
|
-
.option("--since-time <time>", "fetch meetings starting at or after this ISO 8601 date or time",
|
|
160
|
+
.option("--since-time <time>", "fetch meetings starting at or after this ISO 8601 date or time, or 30m, 2h, 7d ago", (text) => dateWindow({ sinceTime: text, ...(deps.timezone ? { zone: deps.timezone } : {}), now: deps.now?.() }).since)
|
|
173
161
|
.option("--lookback-days <days>", "revisit recent occurrences for late transcripts (0–31)", lookbackDays)
|
|
174
162
|
.option("--rescan", "read the last 30 days again, not only what came after the last sync")
|
|
175
163
|
.action(async (opts, command) => {
|
|
@@ -21,8 +21,11 @@ export interface MeetingSearchFlags {
|
|
|
21
21
|
cursor?: string;
|
|
22
22
|
maxReadBytes?: number;
|
|
23
23
|
}
|
|
24
|
-
/**
|
|
25
|
-
|
|
24
|
+
/**
|
|
25
|
+
* Transport fields become one validated word request before a host opens its selected source. `limit` is the page
|
|
26
|
+
* without `--limit`: the profile's `defaults.limit`, which `pagingOf` from `@wirecat/cli-core/cli` reads.
|
|
27
|
+
*/
|
|
28
|
+
export declare const meetingHitSearchRequest: (query: string, options: MeetingSearchFlags, limit: number, signal?: AbortSignal) => MeetingHitSearchOptions;
|
|
26
29
|
/** Parsed dates must become ISO values again so the CLI can replay its own continuation. */
|
|
27
30
|
export declare const meetingSearchArguments: (query: string, options: MeetingSearchFlags) => Record<string, unknown>;
|
|
28
31
|
/** What `meta` says about the dates: the zone one without its own was read in, and the window in UTC. */
|
|
@@ -31,5 +34,9 @@ export declare const createMeetingSearchCommand: (program: Command) => Command;
|
|
|
31
34
|
export declare const addMeetingSearchCommand: (program: Command, deps: {
|
|
32
35
|
search: (query: string, request: MeetingHitSearchOptions, options: MeetingSearchFlags & Record<string, unknown>) => Promise<MeetingSearchPage>;
|
|
33
36
|
signal: () => AbortSignal | undefined;
|
|
37
|
+
/** The page without `--limit`: `pagingOf` from `@wirecat/cli-core/cli`, which reads the profile's limit. */
|
|
38
|
+
pagingOf: (command: Command) => {
|
|
39
|
+
limit: number;
|
|
40
|
+
};
|
|
34
41
|
output: (value: unknown) => void;
|
|
35
42
|
}) => Command;
|
|
@@ -1,29 +1,16 @@
|
|
|
1
1
|
import { CliError } from "@wirecat/cli-base";
|
|
2
2
|
import { annotate, sharedCommand } from "@wirecat/cli-base/commands";
|
|
3
|
-
import { timezoneOf, zonedMoment } from "@wirecat/cli-base/query";
|
|
4
3
|
import { Command } from "commander";
|
|
4
|
+
import { dateWindow } from "../../services/moment.js";
|
|
5
5
|
import { meetingHitsList } from "../answers.js";
|
|
6
6
|
import { validateMeetingHitSearch } from "../search-validation.js";
|
|
7
7
|
export { validateMeetingHitSearch } from "../search-validation.js";
|
|
8
|
-
|
|
9
|
-
// `30m`, `2h`, `7d` ago, as the messenger commands' --since-time reads them and this command's `date>=7d` does.
|
|
10
|
-
const AGO = /^(\d+)(m|h|d)$/;
|
|
11
|
-
const AGO_MS = { m: 60_000, h: 3_600_000, d: 86_400_000 };
|
|
8
|
+
/** One bound of the shared past-time grammar; `readIn` hears the zone a value without its own was read in. */
|
|
12
9
|
const moment = (flag, end, readIn) => (value) => {
|
|
13
|
-
const
|
|
14
|
-
if (
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
let time;
|
|
18
|
-
try {
|
|
19
|
-
time = zonedMoment(value, zone, { start: 0, end: value.length }, { end });
|
|
20
|
-
}
|
|
21
|
-
catch {
|
|
22
|
-
throw new CliError("validation_error", `${flag} takes an ISO date, a time with or without an offset, or 30m, 2h, 7d ago`);
|
|
23
|
-
}
|
|
24
|
-
if (!ZONED.test(value.trim()))
|
|
25
|
-
readIn(zone);
|
|
26
|
-
return time;
|
|
10
|
+
const { since, until, meta } = dateWindow(end ? { untilTime: value, names: [flag, flag] } : { sinceTime: value, names: [flag, flag] });
|
|
11
|
+
if (meta.timezone)
|
|
12
|
+
readIn(meta.timezone);
|
|
13
|
+
return (end ? until : since);
|
|
27
14
|
};
|
|
28
15
|
const integer = (value) => {
|
|
29
16
|
if (!/^[1-9]\d*$/.test(value) || !Number.isSafeInteger(Number(value)))
|
|
@@ -52,7 +39,7 @@ const createMeetingSearchCommandDefinition = (program) => {
|
|
|
52
39
|
.option("--topic-name <name>", "meetings with this topic, by name or alias")
|
|
53
40
|
.option("--since-time <time>", "meetings starting at or after this ISO 8601 date or time, or 30m, 2h, 7d ago", moment("--since-time", false, readIn))
|
|
54
41
|
.option("--until-time <time>", "meetings starting at or before this ISO 8601 date or time; a date alone covers that whole local day", moment("--until-time", true, readIn))
|
|
55
|
-
.option("--limit <n>", "how many hits, 1 through 1000
|
|
42
|
+
.option("--limit <n>", "how many hits, 1 through 1000; the profile's defaults.limit when absent", integer)
|
|
56
43
|
.option("--cursor <cursor>", "continue from the previous page's page.next_cursor, with the same query and filters")
|
|
57
44
|
.option("--max-read-bytes <bytes>", "most stored bytes to read, 1 through 67108864 (default 4194304)", integer);
|
|
58
45
|
annotate(command, {
|
|
@@ -62,8 +49,11 @@ const createMeetingSearchCommandDefinition = (program) => {
|
|
|
62
49
|
});
|
|
63
50
|
return command;
|
|
64
51
|
};
|
|
65
|
-
/**
|
|
66
|
-
|
|
52
|
+
/**
|
|
53
|
+
* Transport fields become one validated word request before a host opens its selected source. `limit` is the page
|
|
54
|
+
* without `--limit`: the profile's `defaults.limit`, which `pagingOf` from `@wirecat/cli-core/cli` reads.
|
|
55
|
+
*/
|
|
56
|
+
export const meetingHitSearchRequest = (query, options, limit, signal) => {
|
|
67
57
|
const request = {
|
|
68
58
|
meetingId: options.meetingId,
|
|
69
59
|
participantIdentityId: options.identityId,
|
|
@@ -75,7 +65,7 @@ export const meetingHitSearchRequest = (query, options, signal) => {
|
|
|
75
65
|
topic: options.topicName ?? options.topic,
|
|
76
66
|
since: options.sinceTime,
|
|
77
67
|
until: options.untilTime,
|
|
78
|
-
limit: options.limit,
|
|
68
|
+
limit: options.limit ?? limit,
|
|
79
69
|
after: options.cursor,
|
|
80
70
|
maxReadBytes: options.maxReadBytes,
|
|
81
71
|
signal,
|
|
@@ -110,9 +100,9 @@ export const meetingSearchMeta = (options) => {
|
|
|
110
100
|
...(Object.keys(window).length === 0 ? {} : { window }),
|
|
111
101
|
};
|
|
112
102
|
};
|
|
113
|
-
const addMeetingSearchCommandDefinition = (program, deps) => createMeetingSearchCommand(program).action(async (query, options) => {
|
|
114
|
-
const request = meetingHitSearchRequest(query, options, deps.signal());
|
|
115
|
-
deps.output(meetingHitsList(await deps.search(query, request, options), request.limit
|
|
103
|
+
const addMeetingSearchCommandDefinition = (program, deps) => createMeetingSearchCommand(program).action(async (query, options, command) => {
|
|
104
|
+
const request = meetingHitSearchRequest(query, options, deps.pagingOf(command).limit, deps.signal());
|
|
105
|
+
deps.output(meetingHitsList(await deps.search(query, request, options), request.limit, "search meetings", meetingSearchArguments(query, options), meetingSearchMeta(options)));
|
|
116
106
|
});
|
|
117
107
|
export const createMeetingSearchCommand = sharedCommand(createMeetingSearchCommandDefinition);
|
|
118
108
|
export const addMeetingSearchCommand = sharedCommand(addMeetingSearchCommandDefinition);
|
package/dist/meetings/index.d.ts
CHANGED
|
@@ -2,6 +2,9 @@ export { BACKENDS, type Backend, type QueryTree, type ServiceCalls, type Service
|
|
|
2
2
|
export { MEETING_STEPS, type MeetingDetailsItem, type MeetingHitItem, type MeetingItemBody, type MeetingListBody, type MeetingSummaryItem, type MeetingTranscriptItem, meetingDetails, meetingHit, meetingHitsList, meetingSummary, meetingTranscript, } from "./answers.js";
|
|
3
3
|
export type { MeetingBatchReader } from "./batch.js";
|
|
4
4
|
export { calendarText, ENTRY_METADATA_KEYS, entryMetadata, withoutLinkQueries } from "./calendar-text.js";
|
|
5
|
+
export { type CallStatsItem, callStats, callStatsItem } from "./call-answers.js";
|
|
6
|
+
export { aggregateCallStats, CALLBACK_WITHIN_MS, type CallCallback, type CallEmployeeStats, type CallPeriodStats, type CallStats, type CallStatsOptions, type MissedCall, SHORT_CALL_UNDER_MS, } from "./call-stats.js";
|
|
7
|
+
export { CALL_DIRECTIONS, CALL_OUTCOMES, type Call, type CallClient, type CallDirection, type CallEmployee, type CallOutcome, callOf, type MeetingCallsInput, type MeetingCallsStore, MISSED_OUTCOMES, type StoredCall, type StoredCallParticipant, } from "./calls.js";
|
|
5
8
|
export type { MeetingContextStore, MeetingEventLinkInput, MeetingEventLinkReceipt, ParticipantPerson, ParticipantPersonInput, ParticipantPersonLinkInput, ParticipantPersonLinkReceipt, } from "./context-store.js";
|
|
6
9
|
export { type MeetingCueIdentity, meetingCueFingerprint } from "./cue-fingerprint.js";
|
|
7
10
|
export { EVENT_QUERY } from "./event-query.js";
|
|
@@ -56,6 +59,7 @@ export type { FoundMeeting, FoundMeetings, FullMeeting, MeetingFinds, MeetingSou
|
|
|
56
59
|
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";
|
|
57
60
|
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";
|
|
58
61
|
export { MEETING_DOCUMENT_ROLES, READ_BUDGET_EXCEEDED } from "./store.js";
|
|
62
|
+
export { type MeetingTagChange, type MeetingTagChangeItem, type MeetingTagged, type MeetingTaggingItem, meetingTagChange, meetingTagChangeItem, meetingTagging, meetingTaggingItem, } from "./tag-answers.js";
|
|
59
63
|
export { meetingTimestamp } from "./timestamp.js";
|
|
60
64
|
export type { DocumentMeeting, MeetingTranscriptDocumentStore, MeetingTranscriptReceiptStore, MeetingTranscriptStore, TranscriptAppend, TranscriptAppendReceipt, UnlinkedTranscriptInput, } from "./transcript-store.js";
|
|
61
65
|
export { parseTranscriptText, TranscriptTextError, type TranscriptTextHeader } from "./transcript-text.js";
|
package/dist/meetings/index.js
CHANGED
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
export { BACKENDS, serviceCallsOf, } from "../search/service-query.js";
|
|
2
2
|
export { MEETING_STEPS, meetingDetails, meetingHit, meetingHitsList, meetingSummary, meetingTranscript, } from "./answers.js";
|
|
3
3
|
export { calendarText, ENTRY_METADATA_KEYS, entryMetadata, withoutLinkQueries } from "./calendar-text.js";
|
|
4
|
+
export { callStats, callStatsItem } from "./call-answers.js";
|
|
5
|
+
export { aggregateCallStats, CALLBACK_WITHIN_MS, SHORT_CALL_UNDER_MS, } from "./call-stats.js";
|
|
6
|
+
export { CALL_DIRECTIONS, CALL_OUTCOMES, callOf, MISSED_OUTCOMES, } from "./calls.js";
|
|
4
7
|
export { meetingCueFingerprint } from "./cue-fingerprint.js";
|
|
5
8
|
export { EVENT_QUERY } from "./event-query.js";
|
|
6
9
|
export { entryInWindow, eventChange } from "./event-store.js";
|
|
@@ -42,6 +45,7 @@ export { createMeetingSeriesInventoryReader } from "./series-inventory.js";
|
|
|
42
45
|
export { validateMeetingSeriesInventoryCursor } from "./series-inventory-validation.js";
|
|
43
46
|
export { aggregateMeetingCounts, aggregateMeetingStats, MEETING_COUNTS_GROUPINGS, NO_SERIES, } from "./stats.js";
|
|
44
47
|
export { MEETING_DOCUMENT_ROLES, READ_BUDGET_EXCEEDED } from "./store.js";
|
|
48
|
+
export { meetingTagChange, meetingTagChangeItem, meetingTagging, meetingTaggingItem, } from "./tag-answers.js";
|
|
45
49
|
export { meetingTimestamp } from "./timestamp.js";
|
|
46
50
|
export { parseTranscriptText, TranscriptTextError } from "./transcript-text.js";
|
|
47
51
|
export { transcribeMeeting, } from "./transcription.js";
|
|
@@ -751,9 +751,12 @@ export declare const meetingTools: ({
|
|
|
751
751
|
openWorldHint: boolean;
|
|
752
752
|
};
|
|
753
753
|
})[];
|
|
754
|
-
export declare const callMeetingTool: (store: MeetingStore, name: string, input: unknown,
|
|
755
|
-
/**
|
|
756
|
-
|
|
754
|
+
export declare const callMeetingTool: (store: MeetingStore, name: string, input: unknown, { limit: configured, failure, }: {
|
|
755
|
+
/** A list's page without `limit`: the profile's `defaults.limit`, as the messenger MCP lists take it. */
|
|
756
|
+
limit: number;
|
|
757
|
+
/** The host's error registry (`failureContext`), so its reasons and detail keys survive. */
|
|
758
|
+
failure?: FailureContext;
|
|
759
|
+
}) => Promise<{
|
|
757
760
|
content: {
|
|
758
761
|
type: "text";
|
|
759
762
|
text: string;
|
|
@@ -105,9 +105,7 @@ const argumentsOf = (name, input) => {
|
|
|
105
105
|
}
|
|
106
106
|
return args;
|
|
107
107
|
};
|
|
108
|
-
export const callMeetingTool = async (store, name, input,
|
|
109
|
-
/** The host's error registry (`failureContext`), so its reasons and detail keys survive. */
|
|
110
|
-
failure = {}) => {
|
|
108
|
+
export const callMeetingTool = async (store, name, input, { limit: configured, failure = {}, }) => {
|
|
111
109
|
try {
|
|
112
110
|
const args = argumentsOf(name, input);
|
|
113
111
|
const filter = {
|
|
@@ -118,7 +116,7 @@ failure = {}) => {
|
|
|
118
116
|
let result;
|
|
119
117
|
switch (name) {
|
|
120
118
|
case "meetings_list": {
|
|
121
|
-
const limit = args.limit ??
|
|
119
|
+
const limit = args.limit ?? configured;
|
|
122
120
|
result = await meetingsList(store, {
|
|
123
121
|
...filter,
|
|
124
122
|
limit,
|
|
@@ -87,7 +87,12 @@ export declare const meetingSearchTool: {
|
|
|
87
87
|
additionalProperties: boolean;
|
|
88
88
|
};
|
|
89
89
|
};
|
|
90
|
-
export declare const callMeetingSearchTool: (search: MeetingHitSearch, input: unknown,
|
|
90
|
+
export declare const callMeetingSearchTool: (search: MeetingHitSearch, input: unknown, { limit, signal, failure, }: {
|
|
91
|
+
/** The page without `limit`: the profile's `defaults.limit`, as the messenger MCP lists take it. */
|
|
92
|
+
limit: number;
|
|
93
|
+
signal?: AbortSignal;
|
|
94
|
+
failure?: FailureContext;
|
|
95
|
+
}) => Promise<({
|
|
91
96
|
content: {
|
|
92
97
|
type: "text";
|
|
93
98
|
text: string;
|
|
@@ -147,6 +152,12 @@ export declare const callMeetingSearchTool: (search: MeetingHitSearch, input: un
|
|
|
147
152
|
from: string;
|
|
148
153
|
to: string[];
|
|
149
154
|
}[] | undefined;
|
|
155
|
+
by?: ("meaning" | "words")[] | undefined;
|
|
156
|
+
score?: number | null | undefined;
|
|
157
|
+
passage?: {
|
|
158
|
+
first: string;
|
|
159
|
+
last: string;
|
|
160
|
+
} | undefined;
|
|
150
161
|
source?: {
|
|
151
162
|
ref: string;
|
|
152
163
|
title: string | null;
|
|
@@ -34,7 +34,7 @@ export const meetingSearchTool = {
|
|
|
34
34
|
additionalProperties: false,
|
|
35
35
|
},
|
|
36
36
|
};
|
|
37
|
-
export const callMeetingSearchTool = async (search, input, signal, failure = {}) => {
|
|
37
|
+
export const callMeetingSearchTool = async (search, input, { limit, signal, failure = {}, }) => {
|
|
38
38
|
try {
|
|
39
39
|
if (!input || typeof input !== "object" || Array.isArray(input))
|
|
40
40
|
throw new CliError("validation_error", "expected search argument object");
|
|
@@ -52,7 +52,7 @@ export const callMeetingSearchTool = async (search, input, signal, failure = {})
|
|
|
52
52
|
topic: args.topic,
|
|
53
53
|
since: args.since_time,
|
|
54
54
|
until: args.until_time,
|
|
55
|
-
limit: args.limit,
|
|
55
|
+
limit: args.limit ?? limit,
|
|
56
56
|
after: args.cursor,
|
|
57
57
|
maxReadBytes: args.max_read_bytes,
|
|
58
58
|
signal,
|
|
@@ -64,7 +64,7 @@ export const callMeetingSearchTool = async (search, input, signal, failure = {})
|
|
|
64
64
|
...(options.since === undefined ? {} : { since: new Date(options.since).toISOString() }),
|
|
65
65
|
...(options.until === undefined ? {} : { until: new Date(options.until).toISOString() }),
|
|
66
66
|
};
|
|
67
|
-
const result = meetingHitsList(await search(query, options), options.limit
|
|
67
|
+
const result = meetingHitsList(await search(query, options), options.limit, "search meetings", { ...args, max_read_bytes: options.maxReadBytes ?? 4194304 }, Object.keys(window).length === 0 ? {} : { window });
|
|
68
68
|
signal?.throwIfAborted();
|
|
69
69
|
return agentResult({
|
|
70
70
|
content: [{ type: "text", text: JSON.stringify(result) }],
|
|
@@ -32,6 +32,12 @@ export declare const meetingProjectEvidence: v.StrictObjectSchema<{
|
|
|
32
32
|
readonly from: v.StringSchema<undefined>;
|
|
33
33
|
readonly to: v.ArraySchema<v.StringSchema<undefined>, undefined>;
|
|
34
34
|
}, undefined>, undefined>, undefined>;
|
|
35
|
+
readonly by: v.OptionalSchema<v.ArraySchema<v.PicklistSchema<["words", "meaning"], undefined>, undefined>, undefined>;
|
|
36
|
+
readonly score: v.OptionalSchema<v.NullableSchema<v.NumberSchema<undefined>, undefined>, undefined>;
|
|
37
|
+
readonly passage: v.OptionalSchema<v.StrictObjectSchema<{
|
|
38
|
+
readonly first: v.StringSchema<undefined>;
|
|
39
|
+
readonly last: v.StringSchema<undefined>;
|
|
40
|
+
}, undefined>, undefined>;
|
|
35
41
|
readonly source: v.OptionalSchema<v.StrictObjectSchema<{
|
|
36
42
|
readonly ref: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, "a reference such as `note:42`">]>;
|
|
37
43
|
readonly title: v.NullableSchema<v.StringSchema<undefined>, undefined>;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { type QueryAst } from "@wirecat/cli-base/query";
|
|
2
2
|
import type { Meta, Missing } from "@wirecat/cli-base/standards";
|
|
3
3
|
import { type Backend } from "../search/service-query.js";
|
|
4
|
-
import type
|
|
4
|
+
import { type MeetingItem } from "./item.js";
|
|
5
5
|
import { type MeetingList } from "./reads.js";
|
|
6
6
|
import type { MeetingSource } from "./source.js";
|
|
7
7
|
import type { MeetingDetails, MeetingFilter, MeetingStore } from "./store.js";
|
|
@@ -56,6 +56,7 @@ export type MeetingListThrough = MeetingList & {
|
|
|
56
56
|
server?: MeetingServerReport;
|
|
57
57
|
meta?: Partial<Meta>;
|
|
58
58
|
};
|
|
59
|
+
/** As `listThrough`, with `meta.timezone` when the query read a date in a zone, as every store list says it. */
|
|
59
60
|
export declare const meetingsListThrough: (source: MeetingSource | undefined, store: MeetingStore, filter: MeetingFilter & {
|
|
60
61
|
accountId: number;
|
|
61
62
|
}, access: MeetingServerAccess) => Promise<MeetingListThrough>;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { CliError } from "@wirecat/cli-base";
|
|
2
2
|
import { timezoneOf } from "@wirecat/cli-base/query";
|
|
3
|
-
import { rangeOf, serviceCallsOf, windowOf } from "../search/service-query.js";
|
|
3
|
+
import { rangeOf, readsZone, serviceCallsOf, windowOf, } from "../search/service-query.js";
|
|
4
|
+
import { MEETING_QUERY } from "./item.js";
|
|
4
5
|
import { saveSourceMeeting, sourceMeetingInput } from "./pull.js";
|
|
5
6
|
import { MeetingError, meetingsList } from "./reads.js";
|
|
6
7
|
import { parseMeetingReference } from "./reference.js";
|
|
@@ -233,7 +234,15 @@ export const askServerForList = async (source, store, accountId, query, access)
|
|
|
233
234
|
}
|
|
234
235
|
return step;
|
|
235
236
|
};
|
|
237
|
+
/** As `listThrough`, with `meta.timezone` when the query read a date in a zone, as every store list says it. */
|
|
236
238
|
export const meetingsListThrough = async (source, store, filter, access) => {
|
|
239
|
+
const listed = await listThrough(source, store, filter, access);
|
|
240
|
+
if (!filter.query || !readsZone(filter.query, MEETING_TIMES))
|
|
241
|
+
return listed;
|
|
242
|
+
return { ...listed, meta: { ...listed.meta, timezone: timezoneOf(access.timezone) } };
|
|
243
|
+
};
|
|
244
|
+
const MEETING_TIMES = new Set(MEETING_QUERY.fields.filter(({ type }) => type === "time").map(({ name }) => name));
|
|
245
|
+
const listThrough = async (source, store, filter, access) => {
|
|
237
246
|
const now = access.now ?? Date.now();
|
|
238
247
|
const zoned = { ...filter, timezone: timezoneOf(access.timezone), now };
|
|
239
248
|
const step = await askServerForList(source, store, filter.accountId, filter.query, { ...access, now });
|
package/dist/meetings/stats.d.ts
CHANGED
|
@@ -87,6 +87,9 @@ export interface MeetingStatsStore {
|
|
|
87
87
|
meetingStats(input: MeetingStatsInput): Promise<MeetingStats>;
|
|
88
88
|
meetingCounts(input: MeetingCountsInput): Promise<MeetingCounts>;
|
|
89
89
|
}
|
|
90
|
+
export declare const zoneOf: (timeZone: string | undefined) => string;
|
|
91
|
+
export declare const dayKey: (at: number, format: Intl.DateTimeFormat) => string;
|
|
92
|
+
export declare const zoneFormat: (zone: string) => Intl.DateTimeFormat;
|
|
90
93
|
/** The row of meetings outside any series, under `--by series`; a constant for the same reason as `UNKNOWN_SPEAKER`. */
|
|
91
94
|
export declare const NO_SERIES = "no-series";
|
|
92
95
|
/**
|
package/dist/meetings/stats.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { CliError } from "@wirecat/cli-base";
|
|
2
2
|
export const MEETING_COUNTS_GROUPINGS = ["day", "week", "series"];
|
|
3
|
-
const zoneOf = (timeZone) => {
|
|
3
|
+
export const zoneOf = (timeZone) => {
|
|
4
4
|
const zone = timeZone ?? "UTC";
|
|
5
5
|
try {
|
|
6
6
|
new Intl.DateTimeFormat("en", { timeZone: zone });
|
|
@@ -16,11 +16,11 @@ const weekStart = (at, format) => {
|
|
|
16
16
|
const day = Date.UTC(Number(parts.year), Number(parts.month) - 1, Number(parts.day));
|
|
17
17
|
return new Date(day - DAYS.indexOf(parts.weekday ?? "Mon") * 86_400_000).toISOString().slice(0, 10);
|
|
18
18
|
};
|
|
19
|
-
const dayKey = (at, format) => {
|
|
19
|
+
export const dayKey = (at, format) => {
|
|
20
20
|
const parts = Object.fromEntries(format.formatToParts(new Date(at)).map((part) => [part.type, part.value]));
|
|
21
21
|
return `${parts.year}-${parts.month}-${parts.day}`;
|
|
22
22
|
};
|
|
23
|
-
const zoneFormat = (zone) => new Intl.DateTimeFormat("en-US", {
|
|
23
|
+
export const zoneFormat = (zone) => new Intl.DateTimeFormat("en-US", {
|
|
24
24
|
timeZone: zone,
|
|
25
25
|
year: "numeric",
|
|
26
26
|
month: "2-digit",
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import * as v from "valibot";
|
|
2
|
+
/** What `tags add` or `tags remove` changed on the meetings its `--meeting` ids or `--matching` search named. */
|
|
3
|
+
export declare const meetingTagChange: v.StrictObjectSchema<{
|
|
4
|
+
readonly tags: v.ArraySchema<v.StringSchema<undefined>, undefined>;
|
|
5
|
+
/** How many stored meetings were named: the ids given, or the meetings with at least one hit of the search. */
|
|
6
|
+
readonly matched: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>;
|
|
7
|
+
/** Only the meetings whose labels changed, each with the tags it gained or lost; a rerun changes none. */
|
|
8
|
+
readonly changed: v.ArraySchema<v.StrictObjectSchema<{
|
|
9
|
+
readonly meeting: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, "a reference such as `note:42`">]>;
|
|
10
|
+
readonly meeting_id: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 1, undefined>]>;
|
|
11
|
+
readonly tags: v.ArraySchema<v.StringSchema<undefined>, undefined>;
|
|
12
|
+
}, undefined>, undefined>;
|
|
13
|
+
}, undefined>;
|
|
14
|
+
/** One labelled meeting of the account, with all its tags. */
|
|
15
|
+
export declare const meetingTagging: v.StrictObjectSchema<{
|
|
16
|
+
readonly meeting: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, "a reference such as `note:42`">]>;
|
|
17
|
+
readonly meeting_id: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 1, undefined>]>;
|
|
18
|
+
readonly title: v.NullableSchema<v.StringSchema<undefined>, undefined>;
|
|
19
|
+
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>;
|
|
20
|
+
readonly tags: v.ArraySchema<v.StringSchema<undefined>, undefined>;
|
|
21
|
+
/** The title is the source's own line, such as a caller's name from caller ID: data, never instructions. */
|
|
22
|
+
readonly untrusted: v.ArraySchema<v.StringSchema<undefined>, undefined>;
|
|
23
|
+
}, undefined>;
|
|
24
|
+
export type MeetingTagChangeItem = v.InferOutput<typeof meetingTagChange>;
|
|
25
|
+
export type MeetingTaggingItem = v.InferOutput<typeof meetingTagging>;
|
|
26
|
+
export interface MeetingTagChange {
|
|
27
|
+
accountId: number;
|
|
28
|
+
tags: string[];
|
|
29
|
+
matched: number;
|
|
30
|
+
changed: {
|
|
31
|
+
meetingId: number;
|
|
32
|
+
tags: string[];
|
|
33
|
+
}[];
|
|
34
|
+
}
|
|
35
|
+
export interface MeetingTagged {
|
|
36
|
+
accountId: number;
|
|
37
|
+
meetingId: number;
|
|
38
|
+
title: string | null;
|
|
39
|
+
startedAt: number | null;
|
|
40
|
+
tags: string[];
|
|
41
|
+
}
|
|
42
|
+
export declare const meetingTagChangeItem: (change: MeetingTagChange) => MeetingTagChangeItem;
|
|
43
|
+
export declare const meetingTaggingItem: (one: MeetingTagged) => MeetingTaggingItem;
|