@wirecat/cli-core 0.661.0 → 0.663.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 +109 -0
- package/dist/background/daily-archive-timer.d.ts +1 -1
- 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/ai-model-command.js +3 -3
- package/dist/cli/call-stats-command.d.ts +18 -0
- package/dist/cli/call-stats-command.js +52 -0
- package/dist/cli/command-availability.d.ts +1 -1
- package/dist/cli/command-availability.js +4 -4
- package/dist/cli/contract-templates.js +2 -0
- package/dist/cli/dry-run-guard.js +7 -5
- package/dist/cli/early-refusal.d.ts +1 -1
- package/dist/cli/early-refusal.js +2 -2
- package/dist/cli/effects.d.ts +9 -2
- package/dist/cli/effects.js +16 -4
- package/dist/cli/envelope.d.ts +0 -5
- package/dist/cli/envelope.js +25 -0
- package/dist/cli/index.d.ts +3 -2
- package/dist/cli/index.js +3 -2
- package/dist/cli/meeting-batch.d.ts +2 -1
- package/dist/cli/meeting-batch.js +7 -5
- package/dist/cli/meeting-preparation-command.js +5 -5
- package/dist/cli/meeting-preparation-read.d.ts +5 -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/messenger/admin-moderation-command.js +2 -2
- package/dist/cli/messenger/admin-statistics-command.js +2 -2
- package/dist/cli/messenger/archive-commands.js +2 -2
- package/dist/cli/messenger/context.d.ts +2 -2
- package/dist/cli/messenger/context.js +5 -3
- 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/rankings-command.js +3 -3
- package/dist/cli/messenger/tags-command.js +7 -2
- package/dist/cli/messenger/tasks-command.js +4 -3
- package/dist/cli/paging.d.ts +10 -0
- package/dist/cli/paging.js +29 -0
- package/dist/cli/preview.js +3 -5
- 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/cli/shadowed-options.d.ts +7 -0
- package/dist/cli/shadowed-options.js +26 -0
- package/dist/crm/cli/index.js +4 -2
- 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/fields.d.ts +2 -2
- package/dist/entities/fields.js +2 -2
- package/dist/entities/index.d.ts +92 -1
- package/dist/entities/index.js +3 -2
- package/dist/entities/meeting.d.ts +1 -1
- package/dist/entities/meeting.js +1 -1
- package/dist/errors/reasons.js +0 -1
- package/dist/kit/sync-after-install.d.ts +10 -1
- package/dist/kit/sync-after-install.js +35 -11
- 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 +4 -4
- package/dist/mail/sync.js +1 -1
- 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/mcp/server.js +4 -4
- package/dist/mcp/tool.js +3 -3
- 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 +3 -0
- package/dist/meetings/index.js +3 -0
- package/dist/meetings/mcp/index.d.ts +21 -18
- package/dist/meetings/mcp/index.js +2 -4
- package/dist/meetings/mcp/search.d.ts +6 -1
- package/dist/meetings/mcp/search.js +3 -3
- 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/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/moderation/rules.d.ts +2 -0
- package/dist/moderation/rules.js +16 -2
- 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 +2 -0
- package/dist/search/question-plan.js +5 -0
- package/dist/search/service-query.d.ts +6 -1
- package/dist/search/service-query.js +9 -1
- package/dist/sends/guard.js +4 -20
- package/dist/sends/keyed-guard.d.ts +1 -1
- package/dist/sends/keyed-guard.js +2 -1
- package/dist/sends/permissions.d.ts +14 -0
- package/dist/sends/permissions.js +32 -0
- 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 +20 -4
- package/dist/services/events-search.js +2 -1
- package/dist/services/index.d.ts +1 -0
- package/dist/services/index.js +1 -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/messages-combined.js +15 -4
- 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/server-search.js +1 -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/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/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.js +19 -19
- 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 +2 -0
- package/dist/store/sqlite/notes.js +24 -13
- 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 +3 -3
- package/parity.json +2 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
export { event, meeting, meetingCounts, meetingDetails, meetingHit, meetingLink, meetingParticipants, meetingPassage, meetingProjectEvidence, meetingReview, meetingSpeaker, meetingStats, meetingSummary, meetingTranscript, } from "../meetings/index.js";
|
|
1
|
+
export { callStats, event, meeting, meetingCounts, meetingDetails, meetingHit, meetingLink, meetingParticipants, meetingPassage, meetingProjectEvidence, meetingReview, meetingSpeaker, meetingStats, meetingSummary, meetingTranscript, } from "../meetings/index.js";
|
package/dist/entities/meeting.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { event, meeting, meetingCounts, meetingDetails, meetingHit, meetingLink, meetingParticipants, meetingPassage, meetingProjectEvidence, meetingReview, meetingSpeaker, meetingStats, meetingSummary, meetingTranscript, } from "../meetings/index.js";
|
|
1
|
+
export { callStats, event, meeting, meetingCounts, meetingDetails, meetingHit, meetingLink, meetingParticipants, meetingPassage, meetingProjectEvidence, meetingReview, meetingSpeaker, meetingStats, meetingSummary, meetingTranscript, } from "../meetings/index.js";
|
package/dist/errors/reasons.js
CHANGED
|
@@ -312,7 +312,6 @@ const OTHERS = [
|
|
|
312
312
|
],
|
|
313
313
|
["store.vector-extension-failed", "configuration_error", "the sqlite-vec extension did not load; reinstall the CLI"],
|
|
314
314
|
validation("store.vector-invalid", "a vector to store had a non-finite value"),
|
|
315
|
-
validation("catalog.scope-limit", "the selected catalog exceeds its entry limit"),
|
|
316
315
|
validation("evidence.quote-length", "a quote from the evidence is empty or over 500 characters"),
|
|
317
316
|
validation("evidence.quote-not-found", "the cited source does not say the quoted words"),
|
|
318
317
|
validation("evidence.row-too-large", "one evidence row is over its size limit"),
|
|
@@ -15,8 +15,17 @@ export interface SyncAfterInstallOptions {
|
|
|
15
15
|
err: string;
|
|
16
16
|
out?: string;
|
|
17
17
|
}>;
|
|
18
|
-
/** Words of a
|
|
18
|
+
/** Words of a change that a `readonly` level must still refuse, as a check it opens no more. */
|
|
19
19
|
refusedUnderReadOnly?: readonly string[];
|
|
20
|
+
/**
|
|
21
|
+
* The profile's own levels, set in a config of its own: `variable` names the CLI's config folder
|
|
22
|
+
* (`TG_CONFIG_DIR`), and each of `keys` (`messages`, the key the sync's command names) is set to `readonly`, which
|
|
23
|
+
* the sync must pass, and to `deny`, which must refuse it.
|
|
24
|
+
*/
|
|
25
|
+
profileLevels?: {
|
|
26
|
+
variable: string;
|
|
27
|
+
keys: readonly string[];
|
|
28
|
+
};
|
|
20
29
|
}
|
|
21
30
|
/**
|
|
22
31
|
* Cases that a CLI's sync runs right after install, whatever state the shared config is in. The kit points
|
|
@@ -4,7 +4,8 @@ import { tmpdir } from "node:os";
|
|
|
4
4
|
import { join } from "node:path";
|
|
5
5
|
/**
|
|
6
6
|
* The shared config (`~/.config/WireCat/config.json`) as a fresh or damaged machine has it. Only an explicit
|
|
7
|
-
* "read only" answer limits a tool, and even then a sync runs: it only reads the service (owner
|
|
7
|
+
* "read only" answer limits a tool, and even then a sync runs: it only reads the service (owner rulings, 2026-11-13
|
|
8
|
+
* and 2026-11-14, which extends it to a profile's own `readonly`).
|
|
8
9
|
* A slip with one reading is mended in place (2026-11-14), so only `broken` states may fail a step.
|
|
9
10
|
*/
|
|
10
11
|
const SHARED_CONFIGS = [
|
|
@@ -51,15 +52,32 @@ const errorCodeOf = (text) => {
|
|
|
51
52
|
* the CLI's own harness gives.
|
|
52
53
|
*/
|
|
53
54
|
export const syncAfterInstallCases = (options) => {
|
|
54
|
-
const { sync, refusedUnderReadOnly } = options;
|
|
55
|
-
const
|
|
55
|
+
const { sync, refusedUnderReadOnly, profileLevels } = options;
|
|
56
|
+
const profile = sync[0];
|
|
57
|
+
const cli = async (argv, shared, levels) => {
|
|
56
58
|
const configDir = mkdtempSync(join(tmpdir(), "sync-after-install-"));
|
|
57
59
|
shared.write?.(configDir);
|
|
60
|
+
const own = {};
|
|
61
|
+
if (levels && profileLevels) {
|
|
62
|
+
const dir = mkdtempSync(join(tmpdir(), "sync-after-install-own-"));
|
|
63
|
+
writeFileSync(join(dir, "config.json"), JSON.stringify({ profiles: { [profile]: { permissions: levels } } }));
|
|
64
|
+
own[profileLevels.variable] = dir;
|
|
65
|
+
}
|
|
58
66
|
const ran = await options.run(argv.includes("--json") ? [...argv] : [...argv, "--json"], {
|
|
59
67
|
WIRECAT_CONFIG_DIR: configDir,
|
|
68
|
+
...own,
|
|
60
69
|
});
|
|
61
70
|
return { code: ran.code, out: ran.out ?? "", err: ran.err };
|
|
62
71
|
};
|
|
72
|
+
const fresh = SHARED_CONFIGS[0];
|
|
73
|
+
const readOnly = SHARED_CONFIGS.find((one) => one.readOnly);
|
|
74
|
+
const refused = (name, argv, shared, levels) => ({
|
|
75
|
+
name,
|
|
76
|
+
run: async () => {
|
|
77
|
+
const ran = await cli(argv, shared, levels);
|
|
78
|
+
assert.equal(errorCodeOf(ran.err), "permission_error", `it was not refused: ${ran.out}${ran.err}`);
|
|
79
|
+
},
|
|
80
|
+
});
|
|
63
81
|
return [
|
|
64
82
|
...SHARED_CONFIGS.map((shared) => ({
|
|
65
83
|
name: `${sync.join(" ")} runs with ${shared.state}`,
|
|
@@ -71,16 +89,22 @@ export const syncAfterInstallCases = (options) => {
|
|
|
71
89
|
assert.equal(ran.code, 0, `sync exited ${ran.code}: ${ran.out}${ran.err}`);
|
|
72
90
|
},
|
|
73
91
|
})),
|
|
92
|
+
...(profileLevels?.keys ?? []).flatMap((key) => [
|
|
93
|
+
{
|
|
94
|
+
name: `${sync.join(" ")} runs with permissions.${key} readonly in the profile`,
|
|
95
|
+
run: async () => {
|
|
96
|
+
const ran = await cli(sync, fresh, { [key]: "readonly" });
|
|
97
|
+
assert.notEqual(errorCodeOf(ran.err), "permission_error", `sync was refused: ${ran.err}`);
|
|
98
|
+
assert.equal(ran.code, 0, `sync exited ${ran.code}: ${ran.out}${ran.err}`);
|
|
99
|
+
},
|
|
100
|
+
},
|
|
101
|
+
refused(`${sync.join(" ")} is refused with permissions.${key} deny in the profile`, sync, fresh, {
|
|
102
|
+
[key]: "deny",
|
|
103
|
+
}),
|
|
104
|
+
]),
|
|
74
105
|
...(refusedUnderReadOnly
|
|
75
106
|
? [
|
|
76
|
-
{
|
|
77
|
-
name: `${refusedUnderReadOnly.join(" ")} is still refused under the explicit "read only" answer`,
|
|
78
|
-
run: async () => {
|
|
79
|
-
const readOnly = SHARED_CONFIGS.find((one) => one.readOnly);
|
|
80
|
-
const ran = await cli(refusedUnderReadOnly, readOnly);
|
|
81
|
-
assert.equal(errorCodeOf(ran.err), "permission_error", `it was not refused: ${ran.out}${ran.err}`);
|
|
82
|
-
},
|
|
83
|
-
},
|
|
107
|
+
refused(`${refusedUnderReadOnly.join(" ")} is still refused under the explicit "read only" answer`, refusedUnderReadOnly, readOnly),
|
|
84
108
|
]
|
|
85
109
|
: []),
|
|
86
110
|
];
|
package/dist/mail/cli/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { CliError } from "@wirecat/cli-base";
|
|
2
2
|
import { annotate, sharedCommand } from "@wirecat/cli-base/commands";
|
|
3
|
-
import { queryFieldsOf } from "@wirecat/cli-base/query";
|
|
3
|
+
import { queryFieldsOf, timezoneOf } from "@wirecat/cli-base/query";
|
|
4
4
|
import { Command, InvalidArgumentError } from "commander";
|
|
5
5
|
import * as v from "valibot";
|
|
6
6
|
import { answerEntity } from "../../cli/answer-entity.js";
|
|
@@ -301,7 +301,9 @@ const conversationsCommand = (mail) => {
|
|
|
301
301
|
const account = await store.accounts.storedAccount(mailbox).catch(absentAccount);
|
|
302
302
|
if (!account)
|
|
303
303
|
return { threads: [], mailbox };
|
|
304
|
-
const where = query
|
|
304
|
+
const where = query
|
|
305
|
+
? queryFilter(query, THREAD_COLUMNS, { command: "conversations list", zone: timezoneOf() })
|
|
306
|
+
: undefined;
|
|
305
307
|
const threads = await store.mail.threads({
|
|
306
308
|
accountId: account.id,
|
|
307
309
|
limit: limit + 1,
|
package/dist/mail/facts.d.ts
CHANGED
|
@@ -1,9 +1,12 @@
|
|
|
1
1
|
import type { MailFacts, MailRule } from "./rules.js";
|
|
2
2
|
import type { DomainAge } from "./score.js";
|
|
3
3
|
import type { Listed } from "./source.js";
|
|
4
|
+
/** Of these addresses, the ones the owner wrote to in mail the store holds: `store.mail.writtenTo`. */
|
|
5
|
+
export type WrittenTo = (addresses: readonly string[]) => Promise<ReadonlySet<string>>;
|
|
4
6
|
/**
|
|
5
7
|
* What a rule can know of each listed email. A score and "the owner wrote to this sender" come from the sender's
|
|
6
8
|
* whole group in this listing, so they are worked out only when a rule needs them; a run that lists only new mail
|
|
7
|
-
* judges
|
|
9
|
+
* judges the score from that mail. "Wrote to" also reads the stored outgoing mail, so a resumed run or an account
|
|
10
|
+
* synced without Sent still knows a correspondent.
|
|
8
11
|
*/
|
|
9
|
-
export declare const factsOf: (listed: Listed[], rules: readonly MailRule[], ages?: ReadonlyMap<string, DomainAge>) => (
|
|
12
|
+
export declare const factsOf: (listed: Listed[], rules: readonly MailRule[], writtenTo: WrittenTo, ages?: ReadonlyMap<string, DomainAge>) => Promise<(item: Listed) => MailFacts>;
|
package/dist/mail/facts.js
CHANGED
|
@@ -2,13 +2,16 @@ import { groupKey, probeMail } from "./probe.js";
|
|
|
2
2
|
/**
|
|
3
3
|
* What a rule can know of each listed email. A score and "the owner wrote to this sender" come from the sender's
|
|
4
4
|
* whole group in this listing, so they are worked out only when a rule needs them; a run that lists only new mail
|
|
5
|
-
* judges
|
|
5
|
+
* judges the score from that mail. "Wrote to" also reads the stored outgoing mail, so a resumed run or an account
|
|
6
|
+
* synced without Sent still knows a correspondent.
|
|
6
7
|
*/
|
|
7
|
-
export const factsOf = (listed, rules, ages = new Map()) => {
|
|
8
|
+
export const factsOf = async (listed, rules, writtenTo, ages = new Map()) => {
|
|
8
9
|
const grouped = rules.some(({ match }) => match.score_at_least !== undefined || match.preset !== undefined);
|
|
9
10
|
if (!grouped)
|
|
10
11
|
return (item) => item;
|
|
11
|
-
const
|
|
12
|
+
const senders = [...new Set(listed.flatMap((item) => item.headers?.from ?? []))];
|
|
13
|
+
const written = await writtenTo(senders);
|
|
14
|
+
const groups = new Map(probeMail(listed, Number.POSITIVE_INFINITY, ages, written).items.map((group) => [
|
|
12
15
|
groupKey({
|
|
13
16
|
...(group.from === null ? {} : { from: group.from }),
|
|
14
17
|
...(group.listId === null ? {} : { listId: group.listId }),
|
package/dist/mail/index.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ export { mailOwnText } from "../conversations/mail-text.js";
|
|
|
2
2
|
export { mailAccountKey } from "./account-key.js";
|
|
3
3
|
export { DEFAULT_ATTACHMENT_POLICY, type MailAttachmentPolicy, POLICY_SKIPS } from "./attachments.js";
|
|
4
4
|
export { BULK, bulkBox } from "./bulk.js";
|
|
5
|
-
export { factsOf } from "./facts.js";
|
|
5
|
+
export { factsOf, type WrittenTo } from "./facts.js";
|
|
6
6
|
export { MAIL_FINDING_FIELDS, MAIL_FINDINGS_KIND, MAIL_FINDINGS_PER_RUN, MAIL_FINDINGS_PER_SENDER, type MailFinding, type MailFindingsInput, mailFindingFieldsHelp, mailFindingFingerprint, validateMailFindings, } from "./findings.js";
|
|
7
7
|
export { GMAIL_ALL_MAIL, mailFolders } from "./folders.js";
|
|
8
8
|
export { dropMissing, type Gone, tooManyGone } from "./gone.js";
|
|
@@ -116,7 +116,7 @@ export const mailMeetingSource = ({ store, meetings, address, rules, provider, a
|
|
|
116
116
|
if (stored === null)
|
|
117
117
|
return [];
|
|
118
118
|
const listed = (await candidateFacts(store, stored.id, Date.parse(since), ruling)).map(listedOf);
|
|
119
|
-
const factsFor = factsOf(listed, ruling);
|
|
119
|
+
const factsFor = await factsOf(listed, ruling, (addresses) => store.mail.writtenTo(addresses));
|
|
120
120
|
const saved = accountId === undefined ? [] : await meetings.meetings({ accountId, includeDeleted: true });
|
|
121
121
|
const linked = new Map(saved.flatMap(({ externalId, eventId }) => (eventId === null ? [] : [[externalId, eventId]])));
|
|
122
122
|
const events = new Map(linked.size ? (await meetings.events()).map((event) => [event.id, event]) : []);
|
package/dist/mail/probe.d.ts
CHANGED
|
@@ -43,7 +43,10 @@ export declare const groupKey: (headers: {
|
|
|
43
43
|
from?: string;
|
|
44
44
|
listId?: string;
|
|
45
45
|
}) => string;
|
|
46
|
-
/**
|
|
47
|
-
|
|
46
|
+
/**
|
|
47
|
+
* Groups mail by List-Id when it has one, else by sender address; largest groups first. `written` holds addresses the
|
|
48
|
+
* owner wrote to outside this listing (stored outgoing mail), so a listing without Sent still knows a correspondent.
|
|
49
|
+
*/
|
|
50
|
+
export declare const probeMail: (items: Listed[], limit: number, ages?: ReadonlyMap<string, DomainAge>, written?: ReadonlySet<string>) => Probe;
|
|
48
51
|
/** The sender domains of the groups worth asking a registry about: not a big mailbox provider, never replied to. */
|
|
49
52
|
export declare const domainsToAge: (groups: ProbeGroup[], skip: ReadonlySet<string>) => string[];
|
package/dist/mail/probe.js
CHANGED
|
@@ -6,10 +6,14 @@ const share = (part, whole) => Math.round((part / whole) * 100) / 100;
|
|
|
6
6
|
const isSent = (item) => item.labels?.includes("Sent") || /(^|\/)sent\b/i.test(item.folder ?? "");
|
|
7
7
|
/** A list's mail is one group whoever sends it; other mail is grouped by sender. */
|
|
8
8
|
export const groupKey = (headers) => headers.listId === undefined ? `from:${headers.from}` : `list:${headers.listId}`;
|
|
9
|
-
/**
|
|
10
|
-
|
|
9
|
+
/**
|
|
10
|
+
* Groups mail by List-Id when it has one, else by sender address; largest groups first. `written` holds addresses the
|
|
11
|
+
* owner wrote to outside this listing (stored outgoing mail), so a listing without Sent still knows a correspondent.
|
|
12
|
+
*/
|
|
13
|
+
export const probeMail = (items, limit, ages = new Map(), written = new Set()) => {
|
|
11
14
|
const sent = items.filter(isSent);
|
|
12
|
-
const recipients = new Set(sent.flatMap((item) => item.headers?.to ?? []));
|
|
15
|
+
const recipients = new Set([...written, ...sent.flatMap((item) => item.headers?.to ?? [])].map((to) => to.toLowerCase()));
|
|
16
|
+
const wrote = (sender) => recipients.has(sender.toLowerCase());
|
|
13
17
|
const groups = new Map();
|
|
14
18
|
let withoutHeaders = 0;
|
|
15
19
|
for (const item of items) {
|
|
@@ -32,7 +36,7 @@ export const probeMail = (items, limit, ages = new Map()) => {
|
|
|
32
36
|
const known = group.filter((item) => item.seen !== undefined);
|
|
33
37
|
const years = group.map((item) => new Date(item.receivedAt).getUTCFullYear());
|
|
34
38
|
const bulk = share(group.filter((item) => item.headers?.bulk).length, group.length);
|
|
35
|
-
const replied = [...senders].some(
|
|
39
|
+
const replied = [...senders].some(wrote);
|
|
36
40
|
return {
|
|
37
41
|
from: [...senders][0] ?? null,
|
|
38
42
|
listId: group[0]?.headers?.listId ?? null,
|
|
@@ -49,7 +53,7 @@ export const probeMail = (items, limit, ages = new Map()) => {
|
|
|
49
53
|
});
|
|
50
54
|
const presets = PRESET_NAMES.map((preset) => {
|
|
51
55
|
const hit = [...groups.values()].filter((group) => {
|
|
52
|
-
const replied = group.some((item) => item.headers?.from !== undefined &&
|
|
56
|
+
const replied = group.some((item) => item.headers?.from !== undefined && wrote(item.headers.from));
|
|
53
57
|
return presetMatches(preset, { ...group[0], replied });
|
|
54
58
|
});
|
|
55
59
|
return {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { CliError } from "@wirecat/cli-base";
|
|
2
2
|
import { importEngine } from "../attachments/extract.js";
|
|
3
3
|
import { deadlineMargin } from "../background/budget.js";
|
|
4
|
-
import { levelFor } from "../sends/permissions.js";
|
|
4
|
+
import { fetchesAt, levelFor } from "../sends/permissions.js";
|
|
5
5
|
import { DEFAULT_BACKEND, SERVER_BOUNDS, SERVER_SEARCH_KEY, sourceKey, } from "../services/server-search.js";
|
|
6
6
|
import { MAX_ATTACHMENT_CHARS, readAttachments } from "./attachments.js";
|
|
7
7
|
import { bulkBox } from "./bulk.js";
|
|
@@ -60,8 +60,8 @@ export const searchMailServer = async (store, mailbox, access, request) => {
|
|
|
60
60
|
};
|
|
61
61
|
if (access.offline)
|
|
62
62
|
return skip("offline");
|
|
63
|
-
// As tg's: `ask`
|
|
64
|
-
if (access.readOnly || levelFor(access.permissions, SERVER_SEARCH_KEY, access.defaults).level
|
|
63
|
+
// As tg's: `ask` gives the archive's answer, since nobody is asked before a search; `readonly` still reads the server.
|
|
64
|
+
if (access.readOnly || !fetchesAt(levelFor(access.permissions, SERVER_SEARCH_KEY, access.defaults).level))
|
|
65
65
|
return skip("not_allowed");
|
|
66
66
|
const { branches, partial } = mailCriteriaOf(request.text, {
|
|
67
67
|
...(request.exact ? { exact: true } : {}),
|
|
@@ -138,7 +138,7 @@ export const searchMailServer = async (store, mailbox, access, request) => {
|
|
|
138
138
|
return;
|
|
139
139
|
const unique = [...new Map(listed.map((item) => [item.messageId, item])).values()];
|
|
140
140
|
rules = await storedMailRules(store, { address: mailbox.account });
|
|
141
|
-
const facts = factsOf(unique, rules);
|
|
141
|
+
const facts = await factsOf(unique, rules, (addresses) => store.mail.writtenTo(addresses));
|
|
142
142
|
for (const item of unique) {
|
|
143
143
|
const held = (await store.mail.email(accountId, item.messageId)) !== null;
|
|
144
144
|
const rule = decide(rules, facts(item));
|
package/dist/mail/sync.js
CHANGED
|
@@ -397,7 +397,7 @@ const syncRound = async (source, store, { account, since, max = 200, maxBodyChar
|
|
|
397
397
|
// By the instant, not the text: a source may give times with an offset, and "+02:00" sorts as text, not as time.
|
|
398
398
|
const listed = [...new Map(collected.map((item) => [item.messageId, item])).values()].sort((a, b) => Date.parse(b.receivedAt) - Date.parse(a.receivedAt));
|
|
399
399
|
const present = new Set(listed.map(({ messageId }) => messageId));
|
|
400
|
-
const factsFor = factsOf(listed, rules, ages);
|
|
400
|
+
const factsFor = await factsOf(listed, rules, (addresses) => store.mail.writtenTo(addresses), ages);
|
|
401
401
|
// A rule's tag goes on mail this run stores or records; mail stored earlier gets it from memo mail rules apply.
|
|
402
402
|
const tagger = ruleTagger(store, key);
|
|
403
403
|
const tagStored = async (item) => {
|
|
@@ -17,7 +17,7 @@ const inputs = {
|
|
|
17
17
|
/** `communications: true` from a host that connects a messages source; without one the argument could only refuse. */
|
|
18
18
|
export const meetingPreparationTool = ({ communications = false } = {}) => ({
|
|
19
19
|
name: "meeting_prepare",
|
|
20
|
-
description: `Prepare cited context for one exact provider series in the server's selected account. Reads remote upcoming proof and bounded stored history, related meeting transcripts through explicit people/confirmed project links, accepted meeting facts and directly sourced tasks; performs no writes. Optional project selects one existing project name/key/alias for up to four bounded word-evidence pages across the selected account and history window; matches remain unconfirmed and do not infer membership. ${communications ? "Optional communications searches only explicit host-captured source IDs with literal words, bounded excerpts and independent index/read/output coverage; it does not infer identity or project membership. Each source may resume with its opaque cursor; restart_required means narrow or restart that selection rather than advancing. " : ""}Optional ISO
|
|
20
|
+
description: `Prepare cited context for one exact provider series in the server's selected account. Reads remote upcoming proof and bounded stored history, related meeting transcripts through explicit people/confirmed project links, accepted meeting facts and directly sourced tasks; performs no writes. Optional project selects one existing project name/key/alias for up to four bounded word-evidence pages across the selected account and history window; matches remain unconfirmed and do not infer membership. ${communications ? "Optional communications searches only explicit host-captured source IDs with literal words, bounded excerpts and independent index/read/output coverage; it does not infer identity or project membership. Each source may resume with its opaque cursor; restart_required means narrow or restart that selection rather than advancing. " : ""}Optional windows (an ISO date or time, local without a zone, or 7d ago) default to now, seven days ahead and thirty days of history. Coverage identifies incomplete and unqueried context. ${UNTRUSTED_NEUTRAL}`,
|
|
21
21
|
annotations: { readOnlyHint: true, destructiveHint: false, idempotentHint: true, openWorldHint: true },
|
|
22
22
|
inputSchema: { ...(communications ? inputs.with : inputs.without), type: "object" },
|
|
23
23
|
outputSchema: { ...outputSchema, type: "object" },
|
|
@@ -10,7 +10,7 @@ const outputSchema = {
|
|
|
10
10
|
};
|
|
11
11
|
export const meetingSeriesInventoryTool = {
|
|
12
12
|
name: "meeting_series_inventory",
|
|
13
|
-
description: `Discover one bounded page of series candidates in the host's selected provider/account.
|
|
13
|
+
description: `Discover one bounded page of series candidates in the host's selected provider/account. after/until (an ISO date or time, local without a zone, or 7d ago) default to now and seven days ahead. Provider inventory may contain undated or past recurring start hints; these never prove the next occurrence or calendar completeness. Continue with page.next_cursor and the returned absolute after/until. No store writes or automatic selection. ${UNTRUSTED_NEUTRAL}`,
|
|
14
14
|
annotations: { readOnlyHint: true, destructiveHint: false, idempotentHint: true, openWorldHint: true },
|
|
15
15
|
inputSchema: { ...inputSchema, type: "object" },
|
|
16
16
|
outputSchema: { ...outputSchema, type: "object" },
|
package/dist/mcp/prompts.js
CHANGED
|
@@ -14,16 +14,13 @@ const asked = (text) => ({
|
|
|
14
14
|
*/
|
|
15
15
|
const call = (tool, command, args = {}) => `${tool} with ${JSON.stringify(Object.keys(args).length > 0 ? { command, arguments: args } : { command })}`;
|
|
16
16
|
/**
|
|
17
|
-
* The owner's time as a query term
|
|
18
|
-
*
|
|
19
|
-
*
|
|
17
|
+
* The owner's time as a query term every query language version reads: the full UTC instant, whatever the owner
|
|
18
|
+
* typed (`1d ago`, `today`, a time without seconds or a zone). A time that does not read stays as typed, so the
|
|
19
|
+
* tool's error names it.
|
|
20
20
|
*/
|
|
21
21
|
const after = (time) => {
|
|
22
|
-
const ago = /^(\d+[mhd])(?:\s+ago)?$/.exec(time.trim())?.[1];
|
|
23
|
-
if (ago)
|
|
24
|
-
return `date>${ago}`;
|
|
25
22
|
try {
|
|
26
|
-
return `date>${JSON.stringify(new Date(momentOf(time)).toISOString())}`;
|
|
23
|
+
return `date>${JSON.stringify(new Date(momentOf(time.trim().replace(/\s+ago$/i, ""))).toISOString())}`;
|
|
27
24
|
}
|
|
28
25
|
catch {
|
|
29
26
|
return `date>${JSON.stringify(time)}`;
|
|
@@ -50,7 +47,7 @@ export const registerPrompts = (server, { command, name }) => {
|
|
|
50
47
|
argsSchema: toStandardJsonSchema(v.object({
|
|
51
48
|
kind: v.optional(v.pipe(v.string(), v.description("dialog, group or channel, comma-separated; every kind if not given"))),
|
|
52
49
|
mode: v.optional(v.pipe(v.string(), v.description("unread (the messenger's read marks, the default), new (since the last catch-up with new), " +
|
|
53
|
-
"or a time: ISO 8601, or 2h / 1d ago"))),
|
|
50
|
+
"or a time: ISO 8601, today, yesterday, or 2h / 1d ago"))),
|
|
54
51
|
})),
|
|
55
52
|
}, ({ kind, mode }) => {
|
|
56
53
|
const kinds = kind
|
|
@@ -107,7 +104,7 @@ export const registerPrompts = (server, { command, name }) => {
|
|
|
107
104
|
description: "What the owner owes, what others owe, what needs clarifying — since the last review. Reads only; " +
|
|
108
105
|
"reminders are drafts until the owner approves each one.",
|
|
109
106
|
argsSchema: toStandardJsonSchema(v.object({
|
|
110
|
-
since: v.optional(v.pipe(v.string(), v.description("where the last review ended: an ISO 8601 time, or 2h / 1d ago"))),
|
|
107
|
+
since: v.optional(v.pipe(v.string(), v.description("where the last review ended: an ISO 8601 time, today, yesterday, or 2h / 1d ago"))),
|
|
111
108
|
groups: v.optional(v.pipe(v.string(), v.description("group chats where work gets done, by name or id, comma-separated"))),
|
|
112
109
|
})),
|
|
113
110
|
}, ({ since, groups }) => asked([
|
package/dist/mcp/server.js
CHANGED
|
@@ -22,7 +22,7 @@ import { warmEmbedders } from "../embeddings/embed.js";
|
|
|
22
22
|
import { mcpUrlOf } from "../http/public-url.js";
|
|
23
23
|
import { readOnlyLockOf } from "../ports/app.js";
|
|
24
24
|
import { guardFor } from "../sends/guard.js";
|
|
25
|
-
import { levelFor, readKeysForCommand } from "../sends/permissions.js";
|
|
25
|
+
import { fetchesAt, levelFor, readKeysForCommand } from "../sends/permissions.js";
|
|
26
26
|
import { openStore } from "../store/store.js";
|
|
27
27
|
import { runCommandForAgent, toolsFromCommands } from "./agent.js";
|
|
28
28
|
import { agentLog } from "./agent-log.js";
|
|
@@ -114,8 +114,8 @@ export const createServer = (command, context, messenger, sessionOptions) => {
|
|
|
114
114
|
}
|
|
115
115
|
};
|
|
116
116
|
const syncAllowed = (path) => syncsFirst(messenger) &&
|
|
117
|
-
levelOf("messages.sync-first")
|
|
118
|
-
(path[0] !== "stats" || levelOf(`${path.join(".")}.sync-first`)
|
|
117
|
+
fetchesAt(levelOf("messages.sync-first")) &&
|
|
118
|
+
(path[0] !== "stats" || fetchesAt(levelOf(`${path.join(".")}.sync-first`)));
|
|
119
119
|
// Discovery stays complete while availability follows changes to the profile.
|
|
120
120
|
const generated = toolsFromCommands(program.commands, {
|
|
121
121
|
includeUnavailable: true,
|
|
@@ -317,7 +317,7 @@ export const createServer = (command, context, messenger, sessionOptions) => {
|
|
|
317
317
|
spawnJob: sessionOptions.spawnJob,
|
|
318
318
|
limit: settings.limit,
|
|
319
319
|
get syncAllowed() {
|
|
320
|
-
return syncsFirst(messenger) && levelOf("messages.sync-first")
|
|
320
|
+
return syncsFirst(messenger) && fetchesAt(levelOf("messages.sync-first"));
|
|
321
321
|
},
|
|
322
322
|
guard,
|
|
323
323
|
settings,
|
package/dist/mcp/tool.js
CHANGED
|
@@ -14,7 +14,7 @@ import { startRecording } from "../runs/recording.js";
|
|
|
14
14
|
import { newRunId } from "../runs/run.js";
|
|
15
15
|
import { keepsSuccess, runContextOf } from "../runs/run-context.js";
|
|
16
16
|
import { inRun } from "../runs/scope.js";
|
|
17
|
-
import { keyForCommand, levelFor, readKeysForCommand } from "../sends/permissions.js";
|
|
17
|
+
import { fetchesAt, keyForCommand, levelFor, readKeysForCommand } from "../sends/permissions.js";
|
|
18
18
|
import { onlineDeps, storeModeDeps } from "../services/deps.js";
|
|
19
19
|
import { servicesFor } from "../services/index.js";
|
|
20
20
|
import { callerOf, currentCaller, withCaller } from "./caller.js";
|
|
@@ -94,9 +94,9 @@ export const inputOf = (definition, syncAllowed) => v.strictObject(syncAllowed |
|
|
|
94
94
|
/** Whether a profile may sync before answering this entry. */
|
|
95
95
|
export const syncAllowedFor = (key, defaults) => {
|
|
96
96
|
const permissions = defaults.settings.permissions ?? {};
|
|
97
|
-
const shared = defaults.syncAllowed ?? levelFor(permissions, "messages.sync-first").level
|
|
97
|
+
const shared = defaults.syncAllowed ?? fetchesAt(levelFor(permissions, "messages.sync-first").level);
|
|
98
98
|
return (shared &&
|
|
99
|
-
(!key.startsWith("stats_") || levelFor(permissions, `${key.replaceAll("_", ".")}.sync-first`).level
|
|
99
|
+
(!key.startsWith("stats_") || fetchesAt(levelFor(permissions, `${key.replaceAll("_", ".")}.sync-first`).level)));
|
|
100
100
|
};
|
|
101
101
|
export const entryRunner = (registration) => {
|
|
102
102
|
const run = callRunner(registration);
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
import * as v from "valibot";
|
|
2
|
+
import type { CallStats } from "./call-stats.js";
|
|
3
|
+
/**
|
|
4
|
+
* `stats calls show`: layer-1 numbers over stored phone calls. Counts are over the calls that give the field, and
|
|
5
|
+
* `known` says how many do; a key no call gives is absent, never zero.
|
|
6
|
+
*/
|
|
7
|
+
declare const callStatsSchema: v.StrictObjectSchema<{
|
|
8
|
+
readonly time_zone: v.StringSchema<undefined>;
|
|
9
|
+
readonly callback_within_ms: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>;
|
|
10
|
+
readonly short_call_under_ms: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>;
|
|
11
|
+
readonly calls: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>;
|
|
12
|
+
/** Selected meetings that are not calls. */
|
|
13
|
+
readonly not_calls: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>;
|
|
14
|
+
/** How many calls give each field; `roles` says who placed, answered and rang. */
|
|
15
|
+
readonly known: v.StrictObjectSchema<{
|
|
16
|
+
readonly direction: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>;
|
|
17
|
+
readonly outcome: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>;
|
|
18
|
+
readonly wait_ms: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>;
|
|
19
|
+
readonly talk_ms: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>;
|
|
20
|
+
readonly duration_ms: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>;
|
|
21
|
+
readonly roles: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>;
|
|
22
|
+
}, undefined>;
|
|
23
|
+
readonly by_direction: v.ExactOptionalSchema<v.StrictObjectSchema<Record<string, v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>>, undefined>, undefined>;
|
|
24
|
+
readonly by_outcome: v.ExactOptionalSchema<v.StrictObjectSchema<Record<string, v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>>, undefined>, undefined>;
|
|
25
|
+
readonly talk_ms: v.ExactOptionalSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>, undefined>;
|
|
26
|
+
readonly mean_talk_ms: v.ExactOptionalSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>, undefined>;
|
|
27
|
+
readonly duration_ms: v.ExactOptionalSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>, undefined>;
|
|
28
|
+
readonly mean_wait_ms: v.ExactOptionalSchema<v.NullableSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>, undefined>, undefined>;
|
|
29
|
+
readonly max_wait_ms: v.ExactOptionalSchema<v.NullableSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>, undefined>, undefined>;
|
|
30
|
+
readonly short_calls: v.ExactOptionalSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>, undefined>;
|
|
31
|
+
readonly employees: v.ArraySchema<v.StrictObjectSchema<{
|
|
32
|
+
/** `extension:<number>`, or `identity:<id>` where the provider names no extension. */
|
|
33
|
+
readonly key: v.StringSchema<undefined>;
|
|
34
|
+
readonly name: v.NullableSchema<v.StringSchema<undefined>, undefined>;
|
|
35
|
+
readonly identity_id: v.NullableSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 1, undefined>]>, undefined>;
|
|
36
|
+
readonly extension: v.NullableSchema<v.StringSchema<undefined>, undefined>;
|
|
37
|
+
readonly calls: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>;
|
|
38
|
+
readonly incoming: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>;
|
|
39
|
+
readonly outgoing: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>;
|
|
40
|
+
readonly internal: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>;
|
|
41
|
+
readonly placed: v.ExactOptionalSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>, undefined>;
|
|
42
|
+
readonly answered: v.ExactOptionalSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>, undefined>;
|
|
43
|
+
readonly rang_not_answered: v.ExactOptionalSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>, undefined>;
|
|
44
|
+
readonly talk_ms: v.ExactOptionalSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>, undefined>;
|
|
45
|
+
readonly mean_talk_ms: v.ExactOptionalSchema<v.NullableSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>, undefined>, undefined>;
|
|
46
|
+
readonly mean_wait_ms: v.ExactOptionalSchema<v.NullableSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>, undefined>, undefined>;
|
|
47
|
+
readonly max_wait_ms: v.ExactOptionalSchema<v.NullableSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>, undefined>, undefined>;
|
|
48
|
+
}, undefined>, undefined>;
|
|
49
|
+
/** Hours 0–23 in `time_zone`. */
|
|
50
|
+
readonly hours: v.ArraySchema<v.StrictObjectSchema<{
|
|
51
|
+
readonly calls: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>;
|
|
52
|
+
readonly incoming: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>;
|
|
53
|
+
readonly outgoing: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>;
|
|
54
|
+
readonly internal: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>;
|
|
55
|
+
readonly answered: v.ExactOptionalSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>, undefined>;
|
|
56
|
+
readonly missed: v.ExactOptionalSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>, undefined>;
|
|
57
|
+
readonly talk_ms: v.ExactOptionalSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>, undefined>;
|
|
58
|
+
readonly hour: v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>, v.MaxValueAction<number, 23, undefined>]>;
|
|
59
|
+
}, undefined>, undefined>;
|
|
60
|
+
/** `YYYY-MM-DD` in `time_zone`, the days with a call. */
|
|
61
|
+
readonly days: v.ArraySchema<v.StrictObjectSchema<{
|
|
62
|
+
readonly calls: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>;
|
|
63
|
+
readonly incoming: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>;
|
|
64
|
+
readonly outgoing: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>;
|
|
65
|
+
readonly internal: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>;
|
|
66
|
+
readonly answered: v.ExactOptionalSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>, undefined>;
|
|
67
|
+
readonly missed: v.ExactOptionalSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>, undefined>;
|
|
68
|
+
readonly talk_ms: v.ExactOptionalSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>, undefined>;
|
|
69
|
+
readonly date: v.StringSchema<undefined>;
|
|
70
|
+
}, undefined>, undefined>;
|
|
71
|
+
readonly missed: v.ExactOptionalSchema<v.StrictObjectSchema<{
|
|
72
|
+
readonly calls: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>;
|
|
73
|
+
readonly called_back: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>;
|
|
74
|
+
readonly not_called_back: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>;
|
|
75
|
+
readonly unknown_callback: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>;
|
|
76
|
+
readonly unknown_outcome: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>;
|
|
77
|
+
/** Newest first. */
|
|
78
|
+
readonly items: v.ArraySchema<v.StrictObjectSchema<{
|
|
79
|
+
readonly ref: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, "a reference such as `note:42`">]>;
|
|
80
|
+
readonly meeting_id: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 1, undefined>]>;
|
|
81
|
+
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>;
|
|
82
|
+
readonly outcome: v.PicklistSchema<["voicemail", "busy", "no_answer"], undefined>;
|
|
83
|
+
readonly client: v.NullableSchema<v.StrictObjectSchema<{
|
|
84
|
+
readonly key: v.StringSchema<undefined>;
|
|
85
|
+
readonly name: v.NullableSchema<v.StringSchema<undefined>, undefined>;
|
|
86
|
+
}, undefined>, undefined>;
|
|
87
|
+
readonly rang: v.ArraySchema<v.StringSchema<undefined>, undefined>;
|
|
88
|
+
readonly called_back: v.ExactOptionalSchema<v.BooleanSchema<undefined>, undefined>;
|
|
89
|
+
readonly callback: v.ExactOptionalSchema<v.NullableSchema<v.StrictObjectSchema<{
|
|
90
|
+
readonly ref: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, "a reference such as `note:42`">]>;
|
|
91
|
+
readonly meeting_id: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 1, undefined>]>;
|
|
92
|
+
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>;
|
|
93
|
+
readonly after_ms: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>;
|
|
94
|
+
readonly direction: v.PicklistSchema<["outgoing", "incoming"], undefined>;
|
|
95
|
+
}, undefined>, undefined>, undefined>;
|
|
96
|
+
}, undefined>, undefined>;
|
|
97
|
+
readonly has_more: v.BooleanSchema<undefined>;
|
|
98
|
+
}, undefined>, undefined>;
|
|
99
|
+
}, undefined>;
|
|
100
|
+
export type CallStatsItem = v.InferOutput<typeof callStatsSchema>;
|
|
101
|
+
export declare const callStats: v.GenericSchema<CallStatsItem>;
|
|
102
|
+
export declare const callStatsItem: (found: CallStats & {
|
|
103
|
+
accountId: number;
|
|
104
|
+
notCalls: number;
|
|
105
|
+
}) => CallStatsItem;
|
|
106
|
+
export {};
|