@wirecat/cli-core 0.659.0 → 0.661.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 +119 -0
- package/dist/attachments/markup.js +2 -11
- package/dist/calendar/mcp/index.d.ts +12 -12
- package/dist/calendar/mcp/index.js +23 -17
- package/dist/cli/ask-before-write.d.ts +8 -0
- package/dist/cli/ask-before-write.js +28 -0
- package/dist/cli/bot/api-http.d.ts +43 -0
- package/dist/cli/bot/api-http.js +160 -0
- package/dist/cli/index.d.ts +2 -0
- package/dist/cli/index.js +2 -0
- package/dist/cli/messenger/rankings-command.js +2 -1
- package/dist/cli/messenger/serve-command.js +7 -2
- package/dist/cli/messenger/tasks-command.d.ts +7 -2
- package/dist/cli/messenger/tasks-command.js +6 -3
- package/dist/cli/schedule/schedule-command.js +3 -0
- package/dist/domain/html-entities.d.ts +5 -0
- package/dist/domain/html-entities.js +56 -0
- package/dist/domain/locator.js +12 -4
- package/dist/domain/providers.js +1 -1
- package/dist/domain/references.js +11 -3
- package/dist/entities/index.d.ts +33 -93
- package/dist/entities/listings.d.ts +4 -4
- package/dist/entities/listings.js +2 -2
- package/dist/errors/reasons.js +12 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/mail/headers.js +3 -3
- package/dist/mail/parse.js +9 -8
- package/dist/mail/resume.d.ts +4 -1
- package/dist/mail/resume.js +11 -2
- package/dist/mail/retry.d.ts +2 -1
- package/dist/mail/retry.js +6 -4
- package/dist/mail/sender-scores.js +1 -6
- package/dist/mail/stored.d.ts +4 -1
- package/dist/mail/stored.js +6 -1
- package/dist/mail/sync.js +8 -3
- package/dist/mail/testing/fake.d.ts +2 -0
- package/dist/mail/testing/fake.js +3 -1
- package/dist/mcp/all-profiles.js +8 -18
- package/dist/mcp/app-server.js +1 -16
- package/dist/mcp/bot/server.js +9 -7
- package/dist/mcp/caller.js +2 -1
- package/dist/mcp/prompts.js +17 -2
- package/dist/mcp/server.js +10 -16
- package/dist/mcp/stdio-wire.d.ts +5 -2
- package/dist/mcp/stdio-wire.js +39 -12
- package/dist/mcp/tool.js +3 -1
- package/dist/mcp/tools/messages-photo.js +4 -2
- package/dist/meetings/answers.d.ts +35 -27
- package/dist/meetings/answers.js +3 -2
- package/dist/meetings/cli/index.d.ts +13 -0
- package/dist/meetings/cli/index.js +61 -16
- package/dist/meetings/cli/management.d.ts +16 -0
- package/dist/meetings/cli/management.js +90 -0
- package/dist/meetings/cli/search.js +8 -2
- package/dist/meetings/hit-query.js +11 -6
- package/dist/meetings/index.d.ts +5 -3
- package/dist/meetings/index.js +4 -2
- package/dist/meetings/item.d.ts +33 -19
- package/dist/meetings/item.js +29 -4
- package/dist/meetings/mcp/index.d.ts +15 -15
- package/dist/meetings/pull.d.ts +27 -2
- package/dist/meetings/pull.js +103 -78
- package/dist/meetings/read-through.d.ts +74 -0
- package/dist/meetings/read-through.js +330 -0
- package/dist/meetings/reads.d.ts +1 -0
- package/dist/meetings/reads.js +4 -2
- package/dist/meetings/result-items.d.ts +31 -0
- package/dist/meetings/result-items.js +31 -0
- package/dist/meetings/source.d.ts +47 -0
- package/dist/meetings/store.d.ts +7 -0
- package/dist/meetings/testing/memory.js +8 -1
- package/dist/search/service-query.d.ts +63 -0
- package/dist/search/service-query.js +57 -0
- package/dist/sends/guard.js +7 -1
- package/dist/sends/permissions.js +4 -0
- package/dist/services/listings.js +2 -1
- package/dist/services/message-resolution.js +6 -3
- package/dist/services/messages-search.js +3 -4
- package/dist/services/server-search.d.ts +2 -1
- package/dist/services/server-search.js +36 -32
- package/dist/store/sqlite/meetings.js +15 -1
- package/dist/store/sqlite/mention-drain.d.ts +4 -1
- package/dist/store/sqlite/mention-drain.js +7 -3
- package/dist/store/sqlite/messages.js +12 -1
- package/dist/store/sqlite/query-filter.d.ts +1 -0
- package/dist/store/sqlite/query-filter.js +2 -2
- package/dist/store/sqlite/tags.js +1 -1
- package/package.json +1 -1
package/dist/cli/index.d.ts
CHANGED
|
@@ -53,9 +53,11 @@ export { answerEntity } from "./answer-entity.js";
|
|
|
53
53
|
export { type AppDoctorOptions, appDoctorReport } from "./app-doctor-command.js";
|
|
54
54
|
export type { AppMcpOptions } from "./app-mcp-command.js";
|
|
55
55
|
export { openAppStore } from "./app-store.js";
|
|
56
|
+
export { askBeforeWrite } from "./ask-before-write.js";
|
|
56
57
|
export { actorOf } from "./author.js";
|
|
57
58
|
export { type BaseStagesCommandOptions, baseStagesCommand } from "./base-stages-command.js";
|
|
58
59
|
export type { ApiCommandInput, ApiCommands } from "./bot/api.js";
|
|
60
|
+
export { type HttpApiExecutorOptions, type HttpApiRequest, httpApiExecutor, httpApiRequest } from "./bot/api-http.js";
|
|
59
61
|
export { apiFlagOf, apiJson, apiOptionKey, apiPlainJson, checkApiBody, checkApiParameter, parseApiJson, readApiBody, } from "./bot/api-input.js";
|
|
60
62
|
export { prepareRpcApiBody, type RpcApiBody } from "./bot/api-rpc.js";
|
|
61
63
|
export { type BotContext, botContext, botWords } from "./bot/context.js";
|
package/dist/cli/index.js
CHANGED
|
@@ -47,8 +47,10 @@ export { evaluateAgent, } from "./agent-evaluation.js";
|
|
|
47
47
|
export { answerEntity } from "./answer-entity.js";
|
|
48
48
|
export { appDoctorReport } from "./app-doctor-command.js";
|
|
49
49
|
export { openAppStore } from "./app-store.js";
|
|
50
|
+
export { askBeforeWrite } from "./ask-before-write.js";
|
|
50
51
|
export { actorOf } from "./author.js";
|
|
51
52
|
export { baseStagesCommand } from "./base-stages-command.js";
|
|
53
|
+
export { httpApiExecutor, httpApiRequest } from "./bot/api-http.js";
|
|
52
54
|
export { apiFlagOf, apiJson, apiOptionKey, apiPlainJson, checkApiBody, checkApiParameter, parseApiJson, readApiBody, } from "./bot/api-input.js";
|
|
53
55
|
export { prepareRpcApiBody } from "./bot/api-rpc.js";
|
|
54
56
|
export { botContext, botWords } from "./bot/context.js";
|
|
@@ -61,7 +61,8 @@ export const rankingsTopCommand = (messenger, target) => {
|
|
|
61
61
|
return services.rankings.top(target, {
|
|
62
62
|
...params,
|
|
63
63
|
...sync,
|
|
64
|
-
|
|
64
|
+
// A configured limit is a listing's page; a ranking takes at most 100 rows, so it is capped, not refused.
|
|
65
|
+
limit: params.limit ?? Math.min(context.settings.limit, 100),
|
|
65
66
|
signal: environmentOf(this).commandSignal ?? environmentOf(this).signal,
|
|
66
67
|
...(saved ? { saved } : {}),
|
|
67
68
|
});
|
|
@@ -80,7 +80,7 @@ export const serveCommand = (messenger) => {
|
|
|
80
80
|
});
|
|
81
81
|
};
|
|
82
82
|
const counts = {};
|
|
83
|
-
const rules = replying(context, messenger, Date.parse(startedAt));
|
|
83
|
+
const rules = replying(context, messenger, Date.parse(startedAt), () => messenger.resolveSettings(this.optsWithGlobals(), { env: context.env }));
|
|
84
84
|
const tasks = tasking(context, warn);
|
|
85
85
|
const { handled, startSyncDelayMs, outdated: outdatedHook } = environmentOf(this);
|
|
86
86
|
const count = (event) => {
|
|
@@ -226,7 +226,7 @@ const NO_REPLIES = {
|
|
|
226
226
|
stop: () => { },
|
|
227
227
|
summary: () => ({}),
|
|
228
228
|
};
|
|
229
|
-
const replying = (context, messenger, since) => {
|
|
229
|
+
const replying = (context, messenger, since, reload) => {
|
|
230
230
|
if (messenger.autoReplies === false)
|
|
231
231
|
return NO_REPLIES;
|
|
232
232
|
const controller = new AbortController();
|
|
@@ -252,6 +252,11 @@ const replying = (context, messenger, since) => {
|
|
|
252
252
|
if (connection === undefined || controller.signal.aborted)
|
|
253
253
|
return;
|
|
254
254
|
const open = connection;
|
|
255
|
+
// serve runs for days: `config set permissions.replies.send deny` must stop the next reply, as it stops the next
|
|
256
|
+
// MCP call. The send guard reads the same settings.
|
|
257
|
+
const current = reload();
|
|
258
|
+
settings.permissions = current.permissions;
|
|
259
|
+
settings.permissionSources = current.permissionSources;
|
|
255
260
|
const answer = await replyTo({
|
|
256
261
|
rulesPath: repliesPathFor(app, profile, env),
|
|
257
262
|
statePath: repliesStatePathFor(app, profile, env),
|
|
@@ -1,7 +1,12 @@
|
|
|
1
1
|
import { Command } from "commander";
|
|
2
2
|
import { type Messenger } from "./context.js";
|
|
3
|
-
/**
|
|
4
|
-
|
|
3
|
+
/**
|
|
4
|
+
* `none` clears a date; anything else is a time ahead. Not `null`: commander stores a parser's `null` as "". With
|
|
5
|
+
* `end`, a date alone is the end of that day: a task due on the 20th is not overdue all of the 20th.
|
|
6
|
+
*/
|
|
7
|
+
export declare const dateOrNone: (flag: string, { end }?: {
|
|
8
|
+
end?: boolean;
|
|
9
|
+
}) => (typed: string) => "none" | Date;
|
|
5
10
|
/** What waits on the owner — kept in the local store by `src/tasks/`; nothing here reaches the messenger. */
|
|
6
11
|
export declare const tasksCommand: (messenger: Messenger) => Command;
|
|
7
12
|
export declare const tasksStatsCommand: (messenger: Messenger) => Command;
|
|
@@ -96,8 +96,11 @@ const pairLine = (pair) => [
|
|
|
96
96
|
`${pair.task?.title ?? ""} | ${pair.other.title}`,
|
|
97
97
|
`(${pair.reasons.join(", ")})`,
|
|
98
98
|
].join(" ");
|
|
99
|
-
/**
|
|
100
|
-
|
|
99
|
+
/**
|
|
100
|
+
* `none` clears a date; anything else is a time ahead. Not `null`: commander stores a parser's `null` as "". With
|
|
101
|
+
* `end`, a date alone is the end of that day: a task due on the 20th is not overdue all of the 20th.
|
|
102
|
+
*/
|
|
103
|
+
export const dateOrNone = (flag, { end = false } = {}) => (typed) => typed.trim().toLowerCase() === "none" ? "none" : new Date(aheadOf(typed, flag, Date.now(), { end }));
|
|
101
104
|
const durationOf = (flag) => (typed) => {
|
|
102
105
|
const wanted = typed.trim();
|
|
103
106
|
const ms = Date.now() - momentOf(wanted, flag);
|
|
@@ -108,7 +111,7 @@ const durationOf = (flag) => (typed) => {
|
|
|
108
111
|
const planOptions = (command, verb) => command
|
|
109
112
|
.option("--title <title>", `one line: the action and its object — ${verb}`)
|
|
110
113
|
.option("--description <text>", "the detail, in Markdown: who owes whom, done when, next step, keywords")
|
|
111
|
-
.option("--due <time>", "when it must be done: an ISO 8601 time or 2h, 3d from now; none clears it", dateOrNone("--due"))
|
|
114
|
+
.option("--due <time>", "when it must be done: an ISO 8601 time or 2h, 3d from now; none clears it", dateOrNone("--due", { end: true }))
|
|
112
115
|
.option("--remind-time <time>", "when to look at it again: an ISO 8601 time or 2h, 3d from now; none clears it", dateOrNone("--remind-time"))
|
|
113
116
|
.option("--assignee <person...>", "who does it: sender (whoever sent the task's message) or person:<id>; none clears it. Leave it out when " +
|
|
114
117
|
"unsure: a task with no assignee is better than none");
|
|
@@ -52,6 +52,9 @@ const whenOf = ({ every, at = [], atTime }, minimum) => {
|
|
|
52
52
|
throw new CliError("validation_error", "say when: --every <30m|2h|1d>, --at HH:MM (daily) or --at 'mon HH:MM' (weekly), repeated for more times, or --at-time <30m|2d|ISO time>");
|
|
53
53
|
}
|
|
54
54
|
if (atTime) {
|
|
55
|
+
// As messages send --at-time: a date alone would be its midnight, which nobody means by "send on the 20th".
|
|
56
|
+
if (/^\d{4}-\d{2}-\d{2}$/.test(atTime.trim()))
|
|
57
|
+
throw new CliError("validation_error", `--at-time needs a time of day as well: ${atTime.trim()}T09:00`);
|
|
55
58
|
const time = aheadOf(atTime, "--at-time");
|
|
56
59
|
if (time <= Date.now())
|
|
57
60
|
throw new CliError("validation_error", "--at-time is in the past");
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* HTML character references as text, in one pass so `&lt;` stays the text `<`. Numeric ones are all decoded;
|
|
3
|
+
* of the named ones, those that mail and calendar invitations use. An unknown name stays as written.
|
|
4
|
+
*/
|
|
5
|
+
export declare const decodeEntities: (text: string) => string;
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
const NAMED = {
|
|
2
|
+
amp: "&",
|
|
3
|
+
lt: "<",
|
|
4
|
+
gt: ">",
|
|
5
|
+
quot: '"',
|
|
6
|
+
apos: "'",
|
|
7
|
+
nbsp: "\u00a0",
|
|
8
|
+
shy: "\u00ad",
|
|
9
|
+
ensp: "\u2002",
|
|
10
|
+
emsp: "\u2003",
|
|
11
|
+
thinsp: "\u2009",
|
|
12
|
+
zwnj: "\u200c",
|
|
13
|
+
zwj: "\u200d",
|
|
14
|
+
lsquo: "‘",
|
|
15
|
+
rsquo: "’",
|
|
16
|
+
sbquo: "‚",
|
|
17
|
+
ldquo: "“",
|
|
18
|
+
rdquo: "”",
|
|
19
|
+
bdquo: "„",
|
|
20
|
+
laquo: "«",
|
|
21
|
+
raquo: "»",
|
|
22
|
+
lsaquo: "‹",
|
|
23
|
+
rsaquo: "›",
|
|
24
|
+
ndash: "–",
|
|
25
|
+
mdash: "—",
|
|
26
|
+
hellip: "…",
|
|
27
|
+
bull: "•",
|
|
28
|
+
middot: "·",
|
|
29
|
+
copy: "©",
|
|
30
|
+
reg: "®",
|
|
31
|
+
trade: "™",
|
|
32
|
+
euro: "€",
|
|
33
|
+
pound: "£",
|
|
34
|
+
yen: "¥",
|
|
35
|
+
cent: "¢",
|
|
36
|
+
deg: "°",
|
|
37
|
+
plusmn: "±",
|
|
38
|
+
times: "×",
|
|
39
|
+
divide: "÷",
|
|
40
|
+
sect: "§",
|
|
41
|
+
para: "¶",
|
|
42
|
+
iexcl: "¡",
|
|
43
|
+
iquest: "¿",
|
|
44
|
+
};
|
|
45
|
+
const character = (code, entity) => code > 0 && code <= 0x10ffff ? String.fromCodePoint(code) : entity;
|
|
46
|
+
/**
|
|
47
|
+
* HTML character references as text, in one pass so `&lt;` stays the text `<`. Numeric ones are all decoded;
|
|
48
|
+
* of the named ones, those that mail and calendar invitations use. An unknown name stays as written.
|
|
49
|
+
*/
|
|
50
|
+
export const decodeEntities = (text) => text.replace(/&(#x[0-9a-f]{1,6}|#\d{1,7}|[a-z]{2,8});/gi, (entity, body) => {
|
|
51
|
+
if (body[0] !== "#")
|
|
52
|
+
return NAMED[body] ?? NAMED[body.toLowerCase()] ?? entity;
|
|
53
|
+
return body[1] === "x" || body[1] === "X"
|
|
54
|
+
? character(Number.parseInt(body.slice(2), 16), entity)
|
|
55
|
+
: character(Number(body.slice(1)), entity);
|
|
56
|
+
});
|
package/dist/domain/locator.js
CHANGED
|
@@ -6,9 +6,17 @@ export const isLocator = (reference) => reference.trim().startsWith(SCHEME);
|
|
|
6
6
|
export const parseLocator = (reference) => {
|
|
7
7
|
const trimmed = reference.trim();
|
|
8
8
|
const parts = trimmed.startsWith(SCHEME) ? trimmed.slice(SCHEME.length).split("/") : [];
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
const
|
|
9
|
+
const malformed = () => new CliError("validation_error", `"${singleLine(reference)}" is not a message locator — expected msg:<provider>/<account>/<chat>/<message>`);
|
|
10
|
+
if (parts.length !== 4 || parts.some((part) => part === ""))
|
|
11
|
+
throw malformed();
|
|
12
|
+
const decoded = (part) => {
|
|
13
|
+
try {
|
|
14
|
+
return decodeURIComponent(part);
|
|
15
|
+
}
|
|
16
|
+
catch {
|
|
17
|
+
throw malformed();
|
|
18
|
+
}
|
|
19
|
+
};
|
|
20
|
+
const [provider, account, chat, message] = parts.map(decoded);
|
|
13
21
|
return { provider, account, chat, message };
|
|
14
22
|
};
|
package/dist/domain/providers.js
CHANGED
|
@@ -19,7 +19,7 @@ export const PROVIDERS = [
|
|
|
19
19
|
{ name: "obsidian", kind: "notes", aliases: [] },
|
|
20
20
|
{ name: "added", kind: "notes", aliases: [] },
|
|
21
21
|
{ name: "zoom", kind: "meetings", aliases: [] },
|
|
22
|
-
{ name: "google-meet", kind: "meetings", aliases: [], command: "
|
|
22
|
+
{ name: "google-meet", kind: "meetings", aliases: [], command: "gmeet" },
|
|
23
23
|
// Its meetings come from the notes Telemost mails (`keeper@telemost.yandex.ru`), read by a mail rule.
|
|
24
24
|
{ name: "telemost", kind: "meetings", aliases: [] },
|
|
25
25
|
// A phone export's records: its SMS and its calls in the one account the import names.
|
|
@@ -32,11 +32,19 @@ export const SIMPLE_REFERENCES = [
|
|
|
32
32
|
const malformed = (text, shape) => new CliError("validation_error", `"${singleLine(text)}" is not a reference — expected ${shape}`, {
|
|
33
33
|
reason: "ref.malformed",
|
|
34
34
|
});
|
|
35
|
+
const decoded = (part, text, shape) => {
|
|
36
|
+
try {
|
|
37
|
+
return decodeURIComponent(part);
|
|
38
|
+
}
|
|
39
|
+
catch {
|
|
40
|
+
throw malformed(text, shape);
|
|
41
|
+
}
|
|
42
|
+
};
|
|
35
43
|
const parts = (rest, count, text, shape) => {
|
|
36
44
|
const split = rest.split("/");
|
|
37
45
|
if (split.length !== count || split.some((part) => part === ""))
|
|
38
46
|
throw malformed(text, shape);
|
|
39
|
-
return split.map(
|
|
47
|
+
return split.map((part) => decoded(part, text, shape));
|
|
40
48
|
};
|
|
41
49
|
const encoded = (...values) => values.map(encodeURIComponent).join("/");
|
|
42
50
|
/** A subfolder spelled one way: no leading, trailing or doubled slash, and `.` for the folder itself. */
|
|
@@ -104,8 +112,8 @@ export const REF_KINDS = [
|
|
|
104
112
|
shape: "folder:<id>[/<path>]",
|
|
105
113
|
parse: (rest, text) => {
|
|
106
114
|
const slash = rest.indexOf("/");
|
|
107
|
-
const id =
|
|
108
|
-
const path = slash < 0 ? null : folderPath(
|
|
115
|
+
const id = decoded(slash < 0 ? rest : rest.slice(0, slash), text, "folder:<id>[/<path>]");
|
|
116
|
+
const path = slash < 0 ? null : folderPath(decoded(rest.slice(slash + 1), text, "folder:<id>[/<path>]"));
|
|
109
117
|
if (!id.trim() || path === "")
|
|
110
118
|
throw malformed(text, "folder:<id>[/<path>]");
|
|
111
119
|
return { type: "folder", id, path };
|
package/dist/entities/index.d.ts
CHANGED
|
@@ -93,6 +93,37 @@ import { topic } from "./topic.js";
|
|
|
93
93
|
*/
|
|
94
94
|
export { account, accountChange, accountPrivacy, accountPrivacyChange, accountProfile, accountSession, adminReport, agenda, analysisConsent, analysisConsentRevocation, attachment, attachmentBytes, attachmentExtraction, attachmentTextChange, automaticTags, botAdmin, botMenuEntry, botProfile, botSeenChat, botTemplate, botWebhook, cachedChatMetadata, callRecord, chart, chat, chatAdminChange, chatArchive, chatCoverage, chatEvent, chatFolderChange, chatFolderOrder, chatFolderRemoval, chatGroupChange, chatInspection, chatInvite, chatInviteChange, chatMembersChange, chatMembersFetch, chatMetadata, chatMetadataRefresh, chatModeration, chatMuting, chatPin, chatRead, chatRemoval, chatRequestChange, chatRules, chatSender, chatStats, chatTracking, chatUnread, contact, contactActivity, contactAlias, contactCheck, contactContext, contactImport, contactLookup, contactNote, contactNoteRemoval, contactPreparation, contactStateChange, contactSync, contactUpdate, conversation, conversationBatch, conversationBatchStatus, conversationBuildResult, conversationChange, conversationDetails, conversationEmbedding, conversationEmbeddingStatus, conversationHit, conversationPreparation, conversationReadiness, counterRefresh, counters, document, documentLink, endedAccountSessions, evidence, evidencePacket, fact, folder, hit, identity, imageEmbedding, inviteLink, job, joinRequest, linkedPerson, mailCounts, mediaArchive, mediaArchiveCheck, mediaArchiveMove, mediaArchiveTimer, meeting, meetingProjectCandidates, meetingSeriesInventory, member, memory, mention, mentionDecision, mentionDetails, mentionDomain, mentionRebuild, message, messageContext, messageCounts, messageDeletion, messageDownload, messageEvent, messageLink, messageLinks, messagePin, messageStar, messageSync, messageTranscript, messageWrite, model, modelKey, note, officialStats, organization, person, place, poll, pollChange, pollVote, project, ranking, reaction, reactionChange, recipient, recipientAdded, recipientChange, recipientOff, recipientRemoved, recordedRun, reference, relationship, reminder, removedModelKey, responseTimes, retention, runDetails, runHit, runLocation, savedSearch, scheduledJob, scheduleHarness, searchHistoryClear, sendAttempt, serveSummary, stickerInventory, storeBackup, storeChatStatus, storeCheck, storeClear, storeCopyRemoval, storeDecrypt, storedModelKey, storeExport, storeGapPlan, storeGapRepair, storeImport, storeInfo, storeJobCancel, storeJobClear, storeJobDetails, storeJobRetry, storeMigration, storeReindex, storeRepair, storeReset, storeRestore, storeTable, tagChange, tagging, task, taskAnalysis, taskAnalysisMark, taskCard, taskCategories, taskClosed, taskCreated, taskLinks, taskMerge, taskPair, taskScan, taskSimilar, taskStats, taskUnmerge, template, topic, topicIcon, trackedChat, trackedChatHistory, waitingChats, watchedMessage, watchItem, };
|
|
95
95
|
export declare const ENTITIES: {
|
|
96
|
+
readonly meeting_change: v.StrictObjectSchema<{
|
|
97
|
+
readonly action: v.PicklistSchema<["create", "update", "cancel"], undefined>;
|
|
98
|
+
readonly provider: v.StringSchema<undefined>;
|
|
99
|
+
readonly account: v.StringSchema<undefined>;
|
|
100
|
+
readonly id: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>, undefined>;
|
|
101
|
+
readonly occurrence_id: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>, undefined>;
|
|
102
|
+
readonly change: v.OptionalSchema<v.StrictObjectSchema<{
|
|
103
|
+
readonly title: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
104
|
+
readonly kind: v.OptionalSchema<v.PicklistSchema<["instant", "scheduled"], undefined>, undefined>;
|
|
105
|
+
readonly start_time: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
106
|
+
readonly duration_minutes: v.OptionalSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>, undefined>;
|
|
107
|
+
readonly timezone: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
108
|
+
readonly agenda: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
109
|
+
}, undefined>, undefined>;
|
|
110
|
+
readonly applied: v.BooleanSchema<undefined>;
|
|
111
|
+
readonly meeting: v.OptionalSchema<v.StrictObjectSchema<{
|
|
112
|
+
readonly id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>;
|
|
113
|
+
readonly title: v.NullableSchema<v.StringSchema<undefined>, undefined>;
|
|
114
|
+
readonly kind: v.NullableSchema<v.PicklistSchema<["instant", "scheduled"], undefined>, undefined>;
|
|
115
|
+
readonly start_time: v.NullableSchema<v.StringSchema<undefined>, undefined>;
|
|
116
|
+
readonly duration_minutes: v.NullableSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>, undefined>;
|
|
117
|
+
readonly timezone: v.NullableSchema<v.StringSchema<undefined>, undefined>;
|
|
118
|
+
readonly agenda: v.NullableSchema<v.StringSchema<undefined>, undefined>;
|
|
119
|
+
readonly join_url: v.NullableSchema<v.StringSchema<undefined>, undefined>;
|
|
120
|
+
}, undefined>, undefined>;
|
|
121
|
+
}, undefined>;
|
|
122
|
+
readonly meeting_invitation: v.StrictObjectSchema<{
|
|
123
|
+
readonly id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>;
|
|
124
|
+
readonly invitation: v.StringSchema<undefined>;
|
|
125
|
+
readonly untrusted: v.OptionalSchema<v.ArraySchema<v.StringSchema<undefined>, undefined>, undefined>;
|
|
126
|
+
}, undefined>;
|
|
96
127
|
readonly meeting_ingestion: v.StrictObjectSchema<{
|
|
97
128
|
readonly meetings: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>;
|
|
98
129
|
readonly participants: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>;
|
|
@@ -5413,99 +5444,8 @@ export declare const ENTITIES: {
|
|
|
5413
5444
|
readonly created_at: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.IsoTimestampAction<string, "an ISO 8601 time in UTC">, v.EndsWithAction<string, "Z", "an ISO 8601 time in UTC, ending in `Z`">]>;
|
|
5414
5445
|
readonly updated_at: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.IsoTimestampAction<string, "an ISO 8601 time in UTC">, v.EndsWithAction<string, "Z", "an ISO 8601 time in UTC, ending in `Z`">]>;
|
|
5415
5446
|
}, undefined>;
|
|
5416
|
-
readonly meeting: v.StrictObjectSchema<
|
|
5417
|
-
|
|
5418
|
-
readonly id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>;
|
|
5419
|
-
readonly provider: v.StringSchema<undefined>;
|
|
5420
|
-
readonly account: v.StringSchema<undefined>;
|
|
5421
|
-
readonly title: v.NullableSchema<v.StringSchema<undefined>, undefined>;
|
|
5422
|
-
readonly description: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
|
|
5423
|
-
readonly location: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
|
|
5424
|
-
readonly url: v.NullableSchema<v.StringSchema<undefined>, undefined>;
|
|
5425
|
-
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>;
|
|
5426
|
-
readonly ended_at: v.NullableSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.IsoTimestampAction<string, "an ISO 8601 time in UTC">, v.EndsWithAction<string, "Z", "an ISO 8601 time in UTC, ending in `Z`">]>, undefined>;
|
|
5427
|
-
readonly duration_ms: v.NullableSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>, undefined>;
|
|
5428
|
-
readonly timezone: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
|
|
5429
|
-
readonly participants_count: v.NullableSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>, undefined>;
|
|
5430
|
-
readonly issues: v.OptionalSchema<v.ArraySchema<v.PicklistSchema<readonly ["time_without_zone"], undefined>, undefined>, undefined>;
|
|
5431
|
-
readonly created_at: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.IsoTimestampAction<string, "an ISO 8601 time in UTC">, v.EndsWithAction<string, "Z", "an ISO 8601 time in UTC, ending in `Z`">]>;
|
|
5432
|
-
readonly updated_at: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.IsoTimestampAction<string, "an ISO 8601 time in UTC">, v.EndsWithAction<string, "Z", "an ISO 8601 time in UTC, ending in `Z`">]>;
|
|
5433
|
-
}, undefined>;
|
|
5434
|
-
readonly meeting_details: v.StrictObjectSchema<{
|
|
5435
|
-
readonly ref: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, "a reference such as `note:42`">]>;
|
|
5436
|
-
readonly id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>;
|
|
5437
|
-
readonly provider: v.StringSchema<undefined>;
|
|
5438
|
-
readonly account: v.StringSchema<undefined>;
|
|
5439
|
-
readonly title: v.NullableSchema<v.StringSchema<undefined>, undefined>;
|
|
5440
|
-
readonly description: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
|
|
5441
|
-
readonly location: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
|
|
5442
|
-
readonly url: v.NullableSchema<v.StringSchema<undefined>, undefined>;
|
|
5443
|
-
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>;
|
|
5444
|
-
readonly ended_at: v.NullableSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.IsoTimestampAction<string, "an ISO 8601 time in UTC">, v.EndsWithAction<string, "Z", "an ISO 8601 time in UTC, ending in `Z`">]>, undefined>;
|
|
5445
|
-
readonly duration_ms: v.NullableSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>, undefined>;
|
|
5446
|
-
readonly timezone: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
|
|
5447
|
-
readonly participants_count: v.NullableSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>, undefined>;
|
|
5448
|
-
readonly issues: v.OptionalSchema<v.ArraySchema<v.PicklistSchema<readonly ["time_without_zone"], undefined>, undefined>, undefined>;
|
|
5449
|
-
readonly created_at: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.IsoTimestampAction<string, "an ISO 8601 time in UTC">, v.EndsWithAction<string, "Z", "an ISO 8601 time in UTC, ending in `Z`">]>;
|
|
5450
|
-
readonly updated_at: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.IsoTimestampAction<string, "an ISO 8601 time in UTC">, v.EndsWithAction<string, "Z", "an ISO 8601 time in UTC, ending in `Z`">]>;
|
|
5451
|
-
readonly event_id: v.NullableSchema<v.StringSchema<undefined>, undefined>;
|
|
5452
|
-
readonly series_id: v.NullableSchema<v.StringSchema<undefined>, undefined>;
|
|
5453
|
-
readonly series_title: v.NullableSchema<v.StringSchema<undefined>, undefined>;
|
|
5454
|
-
readonly participants: v.ArraySchema<v.StrictObjectSchema<{
|
|
5455
|
-
readonly name: v.NullableSchema<v.StringSchema<undefined>, undefined>;
|
|
5456
|
-
readonly email: v.NullableSchema<v.StringSchema<undefined>, undefined>;
|
|
5457
|
-
readonly role: v.NullableSchema<v.StringSchema<undefined>, undefined>;
|
|
5458
|
-
readonly person: v.NullableSchema<v.StrictObjectSchema<{
|
|
5459
|
-
readonly ref: v.StringSchema<undefined>;
|
|
5460
|
-
readonly name: v.NullableSchema<v.StringSchema<undefined>, undefined>;
|
|
5461
|
-
}, undefined>, undefined>;
|
|
5462
|
-
readonly joined_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>;
|
|
5463
|
-
readonly left_at: v.NullableSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.IsoTimestampAction<string, "an ISO 8601 time in UTC">, v.EndsWithAction<string, "Z", "an ISO 8601 time in UTC, ending in `Z`">]>, undefined>;
|
|
5464
|
-
readonly duration_ms: v.NullableSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>, undefined>;
|
|
5465
|
-
}, undefined>, undefined>;
|
|
5466
|
-
readonly transcripts: v.ArraySchema<v.StrictObjectSchema<{
|
|
5467
|
-
readonly ref: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, "a reference such as `note:42`">]>;
|
|
5468
|
-
readonly source: v.StringSchema<undefined>;
|
|
5469
|
-
readonly language: v.NullableSchema<v.StringSchema<undefined>, undefined>;
|
|
5470
|
-
readonly lines_count: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>;
|
|
5471
|
-
}, undefined>, undefined>;
|
|
5472
|
-
readonly chat: v.ArraySchema<v.StrictObjectSchema<{
|
|
5473
|
-
readonly sent_at: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.IsoTimestampAction<string, "an ISO 8601 time in UTC">, v.EndsWithAction<string, "Z", "an ISO 8601 time in UTC, ending in `Z`">]>;
|
|
5474
|
-
readonly sender: v.NullableSchema<v.StringSchema<undefined>, undefined>;
|
|
5475
|
-
readonly recipient: v.NullableSchema<v.StringSchema<undefined>, undefined>;
|
|
5476
|
-
readonly text: v.StringSchema<undefined>;
|
|
5477
|
-
}, undefined>, undefined>;
|
|
5478
|
-
readonly summaries: v.ArraySchema<v.StrictObjectSchema<{
|
|
5479
|
-
readonly id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>;
|
|
5480
|
-
readonly meeting: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, "a reference such as `note:42`">]>;
|
|
5481
|
-
readonly source: v.StringSchema<undefined>;
|
|
5482
|
-
readonly title: v.NullableSchema<v.StringSchema<undefined>, undefined>;
|
|
5483
|
-
readonly overview: v.NullableSchema<v.StringSchema<undefined>, undefined>;
|
|
5484
|
-
readonly sections: v.ArraySchema<v.StrictObjectSchema<{
|
|
5485
|
-
readonly label: v.StringSchema<undefined>;
|
|
5486
|
-
readonly text: v.StringSchema<undefined>;
|
|
5487
|
-
}, undefined>, undefined>;
|
|
5488
|
-
readonly next_steps: v.ArraySchema<v.StringSchema<undefined>, undefined>;
|
|
5489
|
-
readonly content: v.NullableSchema<v.StringSchema<undefined>, undefined>;
|
|
5490
|
-
readonly url: v.NullableSchema<v.StringSchema<undefined>, undefined>;
|
|
5491
|
-
readonly created_at: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.IsoTimestampAction<string, "an ISO 8601 time in UTC">, v.EndsWithAction<string, "Z", "an ISO 8601 time in UTC, ending in `Z`">]>;
|
|
5492
|
-
readonly updated_at: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.IsoTimestampAction<string, "an ISO 8601 time in UTC">, v.EndsWithAction<string, "Z", "an ISO 8601 time in UTC, ending in `Z`">]>;
|
|
5493
|
-
}, undefined>, undefined>;
|
|
5494
|
-
readonly attachments: v.ArraySchema<v.StrictObjectSchema<{
|
|
5495
|
-
readonly position: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>;
|
|
5496
|
-
readonly kind: v.StringSchema<undefined>;
|
|
5497
|
-
readonly name: v.NullableSchema<v.StringSchema<undefined>, undefined>;
|
|
5498
|
-
readonly mime: v.NullableSchema<v.StringSchema<undefined>, undefined>;
|
|
5499
|
-
readonly size: v.NullableSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>, undefined>;
|
|
5500
|
-
readonly url: v.NullableSchema<v.StringSchema<undefined>, undefined>;
|
|
5501
|
-
}, undefined>, undefined>;
|
|
5502
|
-
readonly documents: v.ArraySchema<v.StrictObjectSchema<{
|
|
5503
|
-
readonly file_id: v.StringSchema<undefined>;
|
|
5504
|
-
readonly role: v.PicklistSchema<readonly ["transcript", "recording", "notes"], undefined>;
|
|
5505
|
-
readonly title: v.NullableSchema<v.StringSchema<undefined>, undefined>;
|
|
5506
|
-
readonly document: v.NullableSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, "a reference such as `note:42`">]>, undefined>;
|
|
5507
|
-
}, undefined>, undefined>;
|
|
5508
|
-
}, undefined>;
|
|
5447
|
+
readonly meeting: v.StrictObjectSchema<import("../meetings/item.js").MeetingEntries, undefined>;
|
|
5448
|
+
readonly meeting_details: v.StrictObjectSchema<import("../meetings/answers.js").MeetingDetailsEntries, undefined>;
|
|
5509
5449
|
readonly meeting_hit: v.StrictObjectSchema<{
|
|
5510
5450
|
readonly ref: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, "a reference such as `note:42`">]>;
|
|
5511
5451
|
readonly meeting: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, "a reference such as `note:42`">]>;
|
|
@@ -59,9 +59,9 @@ export declare const documentEntryDetails: v.StrictObjectSchema<{
|
|
|
59
59
|
readonly has_text: v.BooleanSchema<undefined>;
|
|
60
60
|
readonly untrusted: v.OptionalSchema<v.ArraySchema<v.StringSchema<undefined>, undefined>, undefined>;
|
|
61
61
|
readonly text: v.NullableSchema<v.StringSchema<undefined>, undefined>;
|
|
62
|
-
/** Where `text` starts in the whole text, in
|
|
62
|
+
/** Where `text` starts in the whole text, in Unicode code points: an emoji counts once, a combining mark apart. */
|
|
63
63
|
readonly text_offset: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>;
|
|
64
|
-
/** The whole text's length, in
|
|
64
|
+
/** The whole text's length, in code points. The next part starts at `text_offset` plus the code points of `text`. */
|
|
65
65
|
readonly text_length: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>;
|
|
66
66
|
/** More text follows `text`: read it with a larger offset. */
|
|
67
67
|
readonly has_more: v.BooleanSchema<undefined>;
|
|
@@ -318,9 +318,9 @@ export declare const LISTING_ENTITIES: {
|
|
|
318
318
|
readonly has_text: v.BooleanSchema<undefined>;
|
|
319
319
|
readonly untrusted: v.OptionalSchema<v.ArraySchema<v.StringSchema<undefined>, undefined>, undefined>;
|
|
320
320
|
readonly text: v.NullableSchema<v.StringSchema<undefined>, undefined>;
|
|
321
|
-
/** Where `text` starts in the whole text, in
|
|
321
|
+
/** Where `text` starts in the whole text, in Unicode code points: an emoji counts once, a combining mark apart. */
|
|
322
322
|
readonly text_offset: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>;
|
|
323
|
-
/** The whole text's length, in
|
|
323
|
+
/** The whole text's length, in code points. The next part starts at `text_offset` plus the code points of `text`. */
|
|
324
324
|
readonly text_length: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>;
|
|
325
325
|
/** More text follows `text`: read it with a larger offset. */
|
|
326
326
|
readonly has_more: v.BooleanSchema<undefined>;
|
|
@@ -40,9 +40,9 @@ const linked = v.strictObject({ ref: reference, title: v.nullable(text), at: v.n
|
|
|
40
40
|
export const documentEntryDetails = v.strictObject({
|
|
41
41
|
...documentEntry.entries,
|
|
42
42
|
text: v.nullable(text),
|
|
43
|
-
/** Where `text` starts in the whole text, in
|
|
43
|
+
/** Where `text` starts in the whole text, in Unicode code points: an emoji counts once, a combining mark apart. */
|
|
44
44
|
text_offset: count,
|
|
45
|
-
/** The whole text's length, in
|
|
45
|
+
/** The whole text's length, in code points. The next part starts at `text_offset` plus the code points of `text`. */
|
|
46
46
|
text_length: count,
|
|
47
47
|
/** More text follows `text`: read it with a larger offset. */
|
|
48
48
|
has_more: v.boolean(),
|
package/dist/errors/reasons.js
CHANGED
|
@@ -56,6 +56,8 @@ const PROVIDER_API = [
|
|
|
56
56
|
validation("api.unknown-method", "the provider has no method by this name"),
|
|
57
57
|
["api.disabled", "configuration_error", "the provider's API is turned off for this OAuth project"],
|
|
58
58
|
["provider.usage-limit", "rate_limited", "the account's usage limit at the provider is reached; wait, do not retry"],
|
|
59
|
+
["access.denied", "permission_error", "the provider refused this account access to the item"],
|
|
60
|
+
["item.not-found", "not_found", "the provider has no item by this id, or this account cannot see it"],
|
|
59
61
|
["file.not-found", "not_found", "the file named, or its folder, does not exist"],
|
|
60
62
|
validation("file.not-a-file", "the path names a folder or another thing that is not a file"),
|
|
61
63
|
["file.denied", "permission_error", "the file cannot be opened: permission denied"],
|
|
@@ -239,6 +241,16 @@ const OTHERS = [
|
|
|
239
241
|
["calendar.no-upcoming", "not_found", "no upcoming meeting with other attendees is stored for this account"],
|
|
240
242
|
["chat.not-read", "not_found", "a chat shared with this person is not held whole in the store"],
|
|
241
243
|
["meetings.index-pending", "not_found", "some stored meetings are not indexed by person yet"],
|
|
244
|
+
["meetings.server-offline", "permission_error", "meetings list and show ask the service; --offline was given"],
|
|
245
|
+
["meetings.server-unreachable", "network_error", "the meetings service could not be reached"],
|
|
246
|
+
["meetings.server-signed-out", "authentication_error", "the meetings service needs a sign-in"],
|
|
247
|
+
["meetings.server-refused", "permission_error", "the meetings service refused the request"],
|
|
248
|
+
["meetings.server-failed", "provider_error", "the meetings service could not be read, or what it returned kept"],
|
|
249
|
+
[
|
|
250
|
+
"meetings.server-capped",
|
|
251
|
+
"outcome_unknown",
|
|
252
|
+
"the meetings service may hold more matches than the calls and pages one list asks",
|
|
253
|
+
],
|
|
242
254
|
["profile.locked", "permission_error", "a profile lock pins this process to its own account"],
|
|
243
255
|
["busy.offline", "permission_error", "calendars busy asks the provider; --offline was given"],
|
|
244
256
|
["busy.unanswered", "provider_error", "the provider gave no busy times for a calendar or person that was asked"],
|
package/dist/index.d.ts
CHANGED
|
@@ -30,7 +30,7 @@ export { byEngagement, CONTRACT_ROLES, ENGAGEMENT_LEVELS, type Engagement, engag
|
|
|
30
30
|
export { normalizeTag, TAG_TYPES, type TagType } from "./domain/tags.js";
|
|
31
31
|
export { envelopeOfVcard, isVcard, type VcardIssue, type VcardOptions } from "./domain/vcard.js";
|
|
32
32
|
export { type AppErrors, DETAILS as CORE_DETAILS, failureContext, REASONS as CORE_REASONS } from "./errors/reasons.js";
|
|
33
|
-
export { canonicalMeetingReference, formatMeetingReference, type MeetingReference, parseMeetingReference, } from "./meetings/index.js";
|
|
33
|
+
export { BACKENDS, type Backend, canonicalMeetingReference, formatMeetingReference, type MeetingReference, parseMeetingReference, type QueryTree, type ServiceCalls, type ServiceCapability, type ServiceOperator, serviceCallsOf, } from "./meetings/index.js";
|
|
34
34
|
export type { CheckRow, Finding, Moderator } from "./moderation/check.js";
|
|
35
35
|
export { act, judge } from "./moderation/check.js";
|
|
36
36
|
export type { GroupRules } from "./moderation/rules.js";
|
package/dist/index.js
CHANGED
|
@@ -25,7 +25,7 @@ export { byEngagement, CONTRACT_ROLES, ENGAGEMENT_LEVELS, engagementRank, invers
|
|
|
25
25
|
export { normalizeTag, TAG_TYPES } from "./domain/tags.js";
|
|
26
26
|
export { envelopeOfVcard, isVcard } from "./domain/vcard.js";
|
|
27
27
|
export { DETAILS as CORE_DETAILS, failureContext, REASONS as CORE_REASONS } from "./errors/reasons.js";
|
|
28
|
-
export { canonicalMeetingReference, formatMeetingReference, parseMeetingReference, } from "./meetings/index.js";
|
|
28
|
+
export { BACKENDS, canonicalMeetingReference, formatMeetingReference, parseMeetingReference, serviceCallsOf, } from "./meetings/index.js";
|
|
29
29
|
export { act, judge } from "./moderation/check.js";
|
|
30
30
|
export { defaultRules, ModerationRules, moderationPathFor } from "./moderation/rules.js";
|
|
31
31
|
export { resolveOutput } from "./output.js";
|
package/dist/mail/headers.js
CHANGED
|
@@ -31,9 +31,9 @@ export const authOf = (unfolded) => {
|
|
|
31
31
|
export const addressesOf = (value) => {
|
|
32
32
|
if (value === undefined)
|
|
33
33
|
return [];
|
|
34
|
-
|
|
35
|
-
const
|
|
36
|
-
return
|
|
34
|
+
// A display name may itself look like an address ("bob@y.com" <real@z.com>), so quoted names and comments go first.
|
|
35
|
+
const bare = value.replace(/"(?:[^"\\]|\\.)*"/g, " ").replace(/\([^()]*\)/g, " ");
|
|
36
|
+
return [...bare.matchAll(/<([^<>\s]+@[^<>\s]+)>|([^\s<>,;:"()]+@[^\s<>,;:"()]+)/g)].map(([, bracketed, plain]) => String(bracketed ?? plain).toLowerCase());
|
|
37
37
|
};
|
|
38
38
|
const nameOf = (value) => {
|
|
39
39
|
const before = /^\s*(.*?)\s*<[^<>]+>\s*$/.exec(value)?.[1];
|
package/dist/mail/parse.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { CliError } from "@wirecat/cli-base";
|
|
2
2
|
import PostalMime, {} from "postal-mime";
|
|
3
|
+
import { decodeEntities } from "../domain/html-entities.js";
|
|
3
4
|
// The store cuts a body into pieces itself; this only guards against a pathological one, like a pasted log.
|
|
4
5
|
export const MAX_BODY_CHARS = 1_000_000;
|
|
5
6
|
/** What sync stores; a command that shows the files of one message passes its own limit. */
|
|
@@ -10,7 +11,6 @@ const addresses = (list) => list
|
|
|
10
11
|
.flatMap(({ address, name }) => (address ? [{ email: address.toLowerCase(), name: name || null }] : []));
|
|
11
12
|
const HIDDEN_OPEN = /<(script|style)/gi;
|
|
12
13
|
const HIDDEN_CLOSE = { script: /<\/script>/gi, style: /<\/style>/gi };
|
|
13
|
-
const ENTITIES = { nbsp: " ", amp: "&", lt: "<", gt: ">", quot: '"', "#39": "'" };
|
|
14
14
|
// `<script[\s\S]*?</script>` as one regex rescans to the end from every unclosed opener; a tag found
|
|
15
15
|
// unclosed once stays unclosed for every later opener, so each close is searched for at most once.
|
|
16
16
|
const dropHidden = (html) => {
|
|
@@ -40,13 +40,14 @@ const stripTags = (html) => {
|
|
|
40
40
|
};
|
|
41
41
|
// Comments go first: a tag inside one, like a commented-out link, would leave its text and a stray `-->` behind.
|
|
42
42
|
const dropComments = (html) => html.replace(/<!--[\s\S]*?(-->|$)/g, "");
|
|
43
|
-
export const htmlToText = (html) =>
|
|
44
|
-
|
|
45
|
-
.replace(/&
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
43
|
+
export const htmlToText = (html) => {
|
|
44
|
+
const text = stripTags(dropHidden(dropComments(html)).replace(/<br\s*\/?>|<\/(p|div|li|tr|h\d)>/gi, "\n"));
|
|
45
|
+
return (decodeEntities(text.replace(/ /gi, " "))
|
|
46
|
+
// From the start of a run only: `[ \t]+\n` alone rescans a long run of spaces from each of them.
|
|
47
|
+
.replace(/(?<![ \t])[ \t]+\n/g, "\n")
|
|
48
|
+
.replace(/\n{3,}/g, "\n\n")
|
|
49
|
+
.trim());
|
|
50
|
+
};
|
|
50
51
|
/** Some senders put their HTML in the text/plain part; its first tag gives it away. */
|
|
51
52
|
export const looksLikeHtml = (text) => /^\s*<(!doctype\s+html|html|head|body|table|div|center|meta|style)\b/i.test(text);
|
|
52
53
|
const bytesOf = (content) => typeof content === "string"
|
package/dist/mail/resume.d.ts
CHANGED
|
@@ -62,6 +62,9 @@ export interface MboxPoint extends FileStamp {
|
|
|
62
62
|
export declare const rangesOf: (values: Iterable<number>) => Ranges;
|
|
63
63
|
export declare const mergeRanges: (a: Ranges, b: Ranges) => Ranges;
|
|
64
64
|
export declare const within: (ranges: Ranges, value: number) => boolean;
|
|
65
|
-
/**
|
|
65
|
+
/**
|
|
66
|
+
* Only what decides mail: the action, whether it is protected, and every match field (subject, to, preset, age… as
|
|
67
|
+
* well as the sender). A changed reason or date is the same rule.
|
|
68
|
+
*/
|
|
66
69
|
export declare const rulesKey: (rules: readonly MailRule[]) => string;
|
|
67
70
|
export declare const parsePoint: <T>(value: string | undefined) => T | undefined;
|
package/dist/mail/resume.js
CHANGED
|
@@ -42,10 +42,19 @@ export const within = (ranges, value) => {
|
|
|
42
42
|
}
|
|
43
43
|
return false;
|
|
44
44
|
};
|
|
45
|
-
/**
|
|
45
|
+
/**
|
|
46
|
+
* Only what decides mail: the action, whether it is protected, and every match field (subject, to, preset, age… as
|
|
47
|
+
* well as the sender). A changed reason or date is the same rule.
|
|
48
|
+
*/
|
|
46
49
|
export const rulesKey = (rules) => createHash("sha256")
|
|
47
50
|
.update(JSON.stringify(rules
|
|
48
|
-
.map(({ match, action }) => JSON.stringify([
|
|
51
|
+
.map(({ match, action, protected: guarded }) => JSON.stringify([
|
|
52
|
+
action,
|
|
53
|
+
guarded === true,
|
|
54
|
+
Object.entries(match)
|
|
55
|
+
.filter(([, value]) => value !== undefined)
|
|
56
|
+
.sort(([a], [b]) => a.localeCompare(b)),
|
|
57
|
+
]))
|
|
49
58
|
.sort()))
|
|
50
59
|
.digest("hex")
|
|
51
60
|
.slice(0, 16);
|
package/dist/mail/retry.d.ts
CHANGED
|
@@ -10,7 +10,7 @@ export declare const RETRYABLE_ATTACHMENTS: string[];
|
|
|
10
10
|
* attachment file, so the email comes from the source again. Nothing is listed, so no deletion is proved and no
|
|
11
11
|
* resume point moves; the email keeps its stored mailboxes, flags and rule.
|
|
12
12
|
*/
|
|
13
|
-
export declare const retryUnread: ({ store, source, account, since, max, maxBodyChars, maxAttachmentChars, policy, now, loadEngine, index, }: {
|
|
13
|
+
export declare const retryUnread: ({ store, source, account, since, max, maxBodyChars, maxAttachmentChars, policy, now, loadEngine, index, signal, }: {
|
|
14
14
|
store: MessageStore;
|
|
15
15
|
source: MailSource;
|
|
16
16
|
account: MailAccount;
|
|
@@ -22,4 +22,5 @@ export declare const retryUnread: ({ store, source, account, since, max, maxBody
|
|
|
22
22
|
now: () => number;
|
|
23
23
|
loadEngine: LoadEngine;
|
|
24
24
|
index: MailSyncOptions["index"];
|
|
25
|
+
signal?: AbortSignal;
|
|
25
26
|
}) => Promise<MailSyncResult>;
|