@wirecat/cli-core 0.411.0 → 0.412.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 +18 -0
- package/dist/cli/bot/command.js +3 -3
- package/dist/cli/bot/messages-sync.d.ts +7 -0
- package/dist/cli/bot/{store.js → messages-sync.js} +4 -5
- package/dist/cli/bot/port.d.ts +3 -3
- package/dist/cli/config-command.js +1 -0
- package/dist/cli/messenger/store-maintenance-command.d.ts +1 -1
- package/dist/cli/messenger/tasks-command.js +2 -2
- package/dist/cli/moved.js +1 -0
- package/dist/cli/settings.d.ts +2 -0
- package/dist/cli/settings.js +5 -1
- package/dist/domain/providers.d.ts +25 -3
- package/dist/domain/providers.js +89 -5
- package/dist/entities/index.d.ts +29 -1
- package/dist/entities/index.js +5 -1
- package/dist/entities/knowledge-lists.d.ts +28 -0
- package/dist/entities/knowledge-lists.js +29 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/dist/search/account-list.d.ts +5 -2
- package/dist/search/account-list.js +27 -11
- package/dist/search/query.js +3 -1
- package/dist/sends/permission-aliases.js +1 -0
- package/dist/services/documents/knowledge.d.ts +5 -3
- package/dist/services/documents/knowledge.js +4 -4
- package/dist/services/meeting-links.d.ts +3 -1
- package/dist/services/meeting-links.js +2 -2
- package/dist/services/messages-search.js +15 -3
- package/dist/services/search-all.js +5 -2
- package/dist/store/accounts.d.ts +3 -0
- package/dist/store/accounts.js +2 -0
- package/dist/store/exports.d.ts +1 -0
- package/dist/store/exports.js +1 -0
- package/dist/store/index.d.ts +3 -1
- package/dist/store/index.js +2 -0
- package/dist/store/knowledge-query.d.ts +6 -0
- package/dist/store/knowledge-query.js +34 -0
- package/dist/store/providers.d.ts +7 -0
- package/dist/store/providers.js +5 -0
- package/dist/store/sqlite/knowledge.d.ts +5 -4
- package/dist/store/sqlite/knowledge.js +50 -17
- package/dist/store/sqlite/mail-rules.d.ts +2 -1
- package/dist/store/sqlite/mail-rules.js +12 -2
- package/dist/store/sqlite/notes.d.ts +11 -5
- package/dist/store/sqlite/notes.js +9 -2
- package/dist/store/sqlite/open-store.js +2 -0
- package/dist/store/sqlite/providers.d.ts +12 -0
- package/dist/store/sqlite/providers.js +45 -0
- package/dist/store/sqlite/tags.d.ts +1 -1
- package/dist/store/sqlite/tags.js +3 -3
- package/package.json +1 -1
- package/parity.json +31 -35
- package/dist/cli/bot/store.d.ts +0 -7
package/CHANGELOG.md
CHANGED
|
@@ -6,6 +6,24 @@ minor version may break callers, and says how under "Changed — may break calle
|
|
|
6
6
|
shape of this file.
|
|
7
7
|
|
|
8
8
|
|
|
9
|
+
## 0.412.0 — 24.10.2026
|
|
10
|
+
|
|
11
|
+
### Added
|
|
12
|
+
|
|
13
|
+
- **A stored provider registry** (available from cli-core 0.413.0). `registerProvider(store, { name, kind, aliases, command })` (from `@wirecat/cli-core/store`) writes a CLI's entry into `store_settings` under the key `providers`; every store handle loads the stored entries when it opens, so `kindOf`, `providerNamed` and `--source` in every CLI know a provider cli-core does not list. The built-ins stay the seed. `useProviders(entries)`, `kindIn(provider)`, `providerNamed`, `kindOf`, `providers()`, `KINDS` and `PROVIDERS` are exported from `@wirecat/cli-core`. Two entries that disagree on a kind, or an alias another provider has, are a `validation_error` naming both; a stored entry that clashes with a built-in is left out when the store opens, so it never stops the store opening.
|
|
14
|
+
- **Knowledge lists filter at their native readers.** Organizations, projects, reminders and mail rules accept optional queries before SQL list bounds. Document tags and links accept native selectors, and meeting-link reads can select one URL before aggregation. Existing unfiltered calls keep their behavior.
|
|
15
|
+
|
|
16
|
+
### Changed — may break callers
|
|
17
|
+
|
|
18
|
+
- **A provider no registry entry names is skipped, never searched as messages** (available from cli-core 0.413.0). `search messages`, `search all` and `--source` lists report each of its accounts under `skipped` with the reason "unknown provider — run its CLI once" (code `not_found`). The account the search runs as is still read, whatever its provider. `kindOf` keeps its signature and its `messages` default; `kindIn` answers `undefined` for such a provider. `ListedAccount.kind` is now `Kind | undefined`.
|
|
19
|
+
- **`KINDS` and `Kind` gain `events`** (available from cli-core 0.413.0). No search reads events yet; `--source events` says so.
|
|
20
|
+
- **`bot store fetch` is now `bot messages sync`, and the `bot store` group is gone** (tg and max). It does what the personal `messages sync` does, so it carries the same name; `store` is for the local database. The old path answers with a pointer to the new one, and a saved `permissions.bot.store.fetch` is refused until it is renamed to `permissions.bot.messages.sync`. A CLI that customizes the command must move its override to the new path.
|
|
21
|
+
|
|
22
|
+
### Fixed
|
|
23
|
+
|
|
24
|
+
- **`config set` and `config unset` work while a moved permission key is saved.** Every other command still refuses the old key and names its replacement; `config unset permissions.<old>` and `config set permissions.<new>` now fix it instead of failing with the same error.
|
|
25
|
+
- **`tasks update <task> --parent none` clears the parent.** The CLI keeps the sentinel through option parsing and converts it to null when building the plan, so Commander cannot turn it into an empty task id.
|
|
26
|
+
|
|
9
27
|
## 0.411.0 — 24.10.2026
|
|
10
28
|
|
|
11
29
|
### Added
|
package/dist/cli/bot/command.js
CHANGED
|
@@ -16,12 +16,12 @@ import { botExamples } from "./examples.js";
|
|
|
16
16
|
import { BOT_CHATS_QUERY, BOT_PROFILES_QUERY, botChatFilter, botProfileName } from "./list-queries.js";
|
|
17
17
|
import { botMcpCommand } from "./mcp.js";
|
|
18
18
|
import { botCan, botIdOf, botMessagesCommand } from "./messages.js";
|
|
19
|
+
import { botMessagesSyncCommand } from "./messages-sync.js";
|
|
19
20
|
import { botModerateCommand, botRulesCommand } from "./moderation.js";
|
|
20
21
|
import { addBotCopyReads, botContactsCommand, botSearchCommand } from "./people.js";
|
|
21
22
|
import { BOT_ACTIONS } from "./port.js";
|
|
22
23
|
import { registryProfiles } from "./registry.js";
|
|
23
24
|
import { botCallbacksCommand, botMenuCommand, botWebhooksCommand } from "./setup.js";
|
|
24
|
-
import { botStoreCommand } from "./store.js";
|
|
25
25
|
import { BotTokenStore } from "./token.js";
|
|
26
26
|
import { botWatchCommand } from "./watch.js";
|
|
27
27
|
/** Where each of the messenger's other secrets comes from, `null` when it is not set; never the value. */
|
|
@@ -289,6 +289,8 @@ const chatsCommand = (bot) => {
|
|
|
289
289
|
*/
|
|
290
290
|
const withCopyReads = (messages, bot) => {
|
|
291
291
|
addBotCopyReads(messages, bot);
|
|
292
|
+
if (bot.fetching)
|
|
293
|
+
messages.addCommand(botMessagesSyncCommand(bot, bot.fetching));
|
|
292
294
|
return messages;
|
|
293
295
|
};
|
|
294
296
|
export const botCommand = (bot) => {
|
|
@@ -310,7 +312,5 @@ export const botCommand = (bot) => {
|
|
|
310
312
|
.addCommand(botContactsCommand(bot));
|
|
311
313
|
if (bot.identity)
|
|
312
314
|
command.addCommand(meCommand(bot));
|
|
313
|
-
if (bot.fetching)
|
|
314
|
-
command.addCommand(botStoreCommand(bot, bot.fetching));
|
|
315
315
|
return bot.mcp ? command.addCommand(botMcpCommand(bot)) : command;
|
|
316
316
|
};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { Command } from "commander";
|
|
2
|
+
import type { BotMessenger } from "./port.js";
|
|
3
|
+
/**
|
|
4
|
+
* `bot messages sync`: a chat's history into the bot's local copy, newest to oldest and resumable, as the
|
|
5
|
+
* personal `messages sync` does. Mounted for a messenger whose Bot API pages back through a chat.
|
|
6
|
+
*/
|
|
7
|
+
export declare const botMessagesSyncCommand: (bot: BotMessenger, fetching: NonNullable<BotMessenger["fetching"]>) => Command;
|
|
@@ -16,12 +16,11 @@ const wholeNumber = (value) => {
|
|
|
16
16
|
return parsed;
|
|
17
17
|
};
|
|
18
18
|
/**
|
|
19
|
-
* `bot
|
|
19
|
+
* `bot messages sync`: a chat's history into the bot's local copy, newest to oldest and resumable, as the
|
|
20
20
|
* personal `messages sync` does. Mounted for a messenger whose Bot API pages back through a chat.
|
|
21
21
|
*/
|
|
22
|
-
export const
|
|
23
|
-
const
|
|
24
|
-
const fetch = annotate(command.command("fetch"), { effects: FETCH })
|
|
22
|
+
export const botMessagesSyncCommand = (bot, fetching) => {
|
|
23
|
+
const fetch = annotate(new Command("sync"), { effects: FETCH })
|
|
25
24
|
.description("fetch a chat's history into the bot's local copy, newest first; run it again to continue")
|
|
26
25
|
.argument("<chat>", "a chat id, or the title of a chat this bot has seen")
|
|
27
26
|
.option("--limit <n>", `at most this many messages in this run; ${fetching.maxPages * fetching.page} if not given`, wholeNumber)
|
|
@@ -85,5 +84,5 @@ export const botStoreCommand = (bot, fetching) => {
|
|
|
85
84
|
stop.release();
|
|
86
85
|
}
|
|
87
86
|
});
|
|
88
|
-
return
|
|
87
|
+
return fetch;
|
|
89
88
|
};
|
package/dist/cli/bot/port.d.ts
CHANGED
|
@@ -53,7 +53,7 @@ export interface BotHistory {
|
|
|
53
53
|
messages: Message[];
|
|
54
54
|
more: boolean;
|
|
55
55
|
}>;
|
|
56
|
-
/** One page back from `before` (or from now), newest first: what `bot
|
|
56
|
+
/** One page back from `before` (or from now), newest first: what `bot messages sync` walks. */
|
|
57
57
|
historyBefore(chat: BotChatRef, window: {
|
|
58
58
|
limit: number;
|
|
59
59
|
before?: string;
|
|
@@ -250,7 +250,7 @@ export interface BotNativeApi {
|
|
|
250
250
|
export interface BotConnectOptions {
|
|
251
251
|
stop?: AbortSignal;
|
|
252
252
|
events?: EventSink;
|
|
253
|
-
/** Only `bot
|
|
253
|
+
/** Only `bot messages sync` asks for a history reader; other commands stay on the Bot API. */
|
|
254
254
|
history?: {
|
|
255
255
|
from?: string;
|
|
256
256
|
pauseMs: number;
|
|
@@ -295,7 +295,7 @@ export interface BotMessenger {
|
|
|
295
295
|
readSecret?: (command: Command, prompt: string) => Promise<string>;
|
|
296
296
|
/** What kind of chat a stored message came from; without it a positive id is a dialog, a negative one a group. */
|
|
297
297
|
chatKindOf?: (hit: StoredHit) => ChatKind;
|
|
298
|
-
/** How its history pages, for `bot
|
|
298
|
+
/** How its history pages, for `bot messages sync`, which is mounted only when this is set. */
|
|
299
299
|
/** `from`: the help of `--until-id`, the message the fetch starts at; the option is mounted only when set. */
|
|
300
300
|
fetching?: Fetching & {
|
|
301
301
|
from?: string;
|
|
@@ -64,6 +64,7 @@ export const configCommand = (app, config, { permissionKey } = {}) => {
|
|
|
64
64
|
const context = baseContext(this, (flags, options) => config.resolveSettings(flags, {
|
|
65
65
|
...options,
|
|
66
66
|
needsProfile: !everyone && setting !== "default_profile" && !isStoreSetting(setting),
|
|
67
|
+
skipMovedPermissions: true,
|
|
67
68
|
}));
|
|
68
69
|
const { settings, renderer, env } = context;
|
|
69
70
|
if (isStoreSetting(setting)) {
|
|
@@ -3,9 +3,9 @@ import type { CacheDatabase } from "../../store/driver.js";
|
|
|
3
3
|
import type { Messenger } from "./context.js";
|
|
4
4
|
/** `doctor`'s short summary of the store. Must answer for a broken file, so an error is a field. */
|
|
5
5
|
export declare const storeSummary: (env: NodeJS.ProcessEnv) => Promise<{
|
|
6
|
+
error?: undefined;
|
|
6
7
|
path: string;
|
|
7
8
|
exists: boolean;
|
|
8
|
-
error?: undefined;
|
|
9
9
|
} | {
|
|
10
10
|
path: string;
|
|
11
11
|
exists: boolean;
|
|
@@ -111,7 +111,7 @@ const planFrom = (options) => {
|
|
|
111
111
|
if (options.priority !== undefined)
|
|
112
112
|
plan.priority = options.priority;
|
|
113
113
|
if (options.parent !== undefined)
|
|
114
|
-
plan.parent = options.parent;
|
|
114
|
+
plan.parent = options.parent === "none" ? null : options.parent;
|
|
115
115
|
if (options.category !== undefined)
|
|
116
116
|
plan.category = options.category;
|
|
117
117
|
if (options.title !== undefined)
|
|
@@ -203,7 +203,7 @@ export const tasksCommand = (messenger) => {
|
|
|
203
203
|
throw new CliError("validation_error", "--priority takes 0 through 4");
|
|
204
204
|
return Number(value);
|
|
205
205
|
})
|
|
206
|
-
.option("--parent <id>", "parent task in the same project; none clears it"
|
|
206
|
+
.option("--parent <id>", "parent task in the same project; none clears it"), "send Alex the API token").action(async function (id) {
|
|
207
207
|
const context = messengerContext(this, messenger);
|
|
208
208
|
refuseLocalWrite(context, messenger.app.command, "tasks.update");
|
|
209
209
|
const plan = planFrom(this.opts());
|
package/dist/cli/moved.js
CHANGED
|
@@ -32,6 +32,7 @@ export const RENAMED_COMMANDS = {
|
|
|
32
32
|
"mcp setup": "mcp add",
|
|
33
33
|
"mcp doctor": "mcp check",
|
|
34
34
|
"commands schema": "commands info",
|
|
35
|
+
"bot store fetch": "bot messages sync",
|
|
35
36
|
"store gaps plan": "store gaps show",
|
|
36
37
|
"store reindex": "store rebuild",
|
|
37
38
|
"stats messages counters refresh": "stats messages counters sync",
|
package/dist/cli/settings.d.ts
CHANGED
|
@@ -140,6 +140,8 @@ export interface ResolveOptions {
|
|
|
140
140
|
needsProfile?: boolean;
|
|
141
141
|
/** Read the config file without writing it: no default file. For a dry run. */
|
|
142
142
|
readOnly?: boolean;
|
|
143
|
+
/** Skip moved permission keys instead of refusing them, so `config set` and `unset` can fix one. */
|
|
144
|
+
skipMovedPermissions?: boolean;
|
|
143
145
|
}
|
|
144
146
|
/** Where `profile` came from when none was named and the command needs none. */
|
|
145
147
|
export declare const NONE_NAMED = "none named";
|
package/dist/cli/settings.js
CHANGED
|
@@ -4,6 +4,7 @@ import * as v from "valibot";
|
|
|
4
4
|
import { AI_ENTRIES, resolveAISettings } from "../analysis/settings.js";
|
|
5
5
|
import { parseDuration } from "../domain/duration.js";
|
|
6
6
|
import { envName, readOnlyLockOf } from "../ports/app.js";
|
|
7
|
+
import { canonicalPermissionKey } from "../sends/permission-aliases.js";
|
|
7
8
|
import { assertOverridesTighten, CEILING_KEY, LEVELS, layerPermissions, permissionOverrides, RESOURCES, } from "../sends/permissions.js";
|
|
8
9
|
import { storePath } from "../store/path.js";
|
|
9
10
|
import { sharedConfigPath } from "../store/shared-config.js";
|
|
@@ -77,6 +78,7 @@ const SHARED_DEFAULTS_ONLY = {
|
|
|
77
78
|
update_check: v.optional(flag),
|
|
78
79
|
skill_hint: v.optional(flag),
|
|
79
80
|
};
|
|
81
|
+
const withoutMoved = (levels) => levels && Object.fromEntries(Object.entries(levels).filter(([key]) => canonicalPermissionKey(key) === key));
|
|
80
82
|
/** Where `profile` came from when none was named and the command needs none. */
|
|
81
83
|
export const NONE_NAMED = "none named";
|
|
82
84
|
/** A name for a command that speaks for no account; never chosen for one that does. */
|
|
@@ -230,7 +232,9 @@ export const settingsFor = (app, extension = {}) => {
|
|
|
230
232
|
: { value: false, from: "default" };
|
|
231
233
|
const fileLayers = layers.map(([from, scope]) => [
|
|
232
234
|
from,
|
|
233
|
-
|
|
235
|
+
options.skipMovedPermissions
|
|
236
|
+
? withoutMoved(scope?.permissions)
|
|
237
|
+
: scope?.permissions,
|
|
234
238
|
]);
|
|
235
239
|
const overrides = permissionOverrides(flags.permission);
|
|
236
240
|
assertOverridesTighten(overrides, layerPermissions(fileLayers).levels);
|
|
@@ -1,20 +1,42 @@
|
|
|
1
1
|
import type { Provider } from "./models.js";
|
|
2
2
|
/** What a search reads; the same names `--only`, `searched` and `skipped` use. */
|
|
3
|
-
export declare const KINDS: readonly ["messages", "mail", "notes", "documents", "meetings"];
|
|
3
|
+
export declare const KINDS: readonly ["messages", "mail", "notes", "documents", "meetings", "events"];
|
|
4
4
|
export type Kind = (typeof KINDS)[number];
|
|
5
5
|
export interface ProviderEntry {
|
|
6
6
|
name: Provider;
|
|
7
7
|
kind: Kind;
|
|
8
8
|
aliases: readonly string[];
|
|
9
|
+
/** The CLI that wrote the entry (`zm`, `drive`). One CLI may write several providers, so it is not an alias. */
|
|
10
|
+
command?: string;
|
|
9
11
|
}
|
|
10
|
-
/**
|
|
12
|
+
/** The seed: what cli-core knows before any CLI has written its entry into the store. */
|
|
11
13
|
export declare const PROVIDERS: readonly ProviderEntry[];
|
|
12
14
|
/** The store keeps a notes folder as an `accounts` row of this provider; people call it `notes`. */
|
|
13
15
|
export declare const FOLDER_PROVIDER = "folder";
|
|
14
16
|
/** Notes written in memo have no account row; this is their account. */
|
|
15
17
|
export declare const INTERNAL_NOTES = "internal";
|
|
18
|
+
/** The reason a search gives for an account whose provider no entry names. */
|
|
19
|
+
export declare const UNKNOWN_PROVIDER = "unknown provider \u2014 run its CLI once";
|
|
20
|
+
/** An entry as a CLI or the store gives it, checked: anything else is a `validation_error`. */
|
|
21
|
+
export declare const providerEntryOf: (value: unknown) => ProviderEntry;
|
|
22
|
+
/** The built-ins and the entries the store or the CLI running gave; what `kindOf` and `providerNamed` read. */
|
|
23
|
+
export declare const providers: () => readonly ProviderEntry[];
|
|
24
|
+
/**
|
|
25
|
+
* Replaces the entries beyond the built-ins. Opening the store calls it with the stored entries; a test or a CLI
|
|
26
|
+
* with no store may call it too. Two entries that disagree on a kind, or one word naming two providers, throw.
|
|
27
|
+
*/
|
|
28
|
+
export declare const useProviders: (entries: readonly ProviderEntry[]) => void;
|
|
29
|
+
/**
|
|
30
|
+
* Like `useProviders`, but an entry that clashes is left out instead of failing: what the store holds was written
|
|
31
|
+
* by CLIs of other versions, and one stale entry must not stop the store opening. Answers the entries left out.
|
|
32
|
+
*/
|
|
33
|
+
export declare const useStoredProviders: (entries: readonly unknown[]) => unknown[];
|
|
34
|
+
/** Adds one entry to those in use, strictly: a clash throws and leaves the registry as it was. */
|
|
35
|
+
export declare const addProvider: (entry: ProviderEntry) => void;
|
|
16
36
|
export declare const isKind: (word: string) => word is Kind;
|
|
17
37
|
/** The registry's provider a name or alias stands for. */
|
|
18
38
|
export declare const providerNamed: (word: string) => ProviderEntry | undefined;
|
|
19
|
-
/**
|
|
39
|
+
/** The kind of a provider the registry knows; `undefined` for one no entry names, which a search skips. */
|
|
40
|
+
export declare const kindIn: (provider: Provider) => Kind | undefined;
|
|
41
|
+
/** A provider the registry does not list counts as a messenger here; a search asks `kindIn` and skips it. */
|
|
20
42
|
export declare const kindOf: (provider: Provider) => Kind;
|
package/dist/domain/providers.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
|
+
import { CliError } from "@wirecat/cli-base";
|
|
1
2
|
/** What a search reads; the same names `--only`, `searched` and `skipped` use. */
|
|
2
|
-
export const KINDS = ["messages", "mail", "notes", "documents", "meetings"];
|
|
3
|
-
/**
|
|
3
|
+
export const KINDS = ["messages", "mail", "notes", "documents", "meetings", "events"];
|
|
4
|
+
/** The seed: what cli-core knows before any CLI has written its entry into the store. */
|
|
4
5
|
export const PROVIDERS = [
|
|
5
6
|
{ name: "telegram", kind: "messages", aliases: ["tg"] },
|
|
6
7
|
{ name: "telegram-bot", kind: "messages", aliases: ["tg-bot"] },
|
|
@@ -16,11 +17,94 @@ export const PROVIDERS = [
|
|
|
16
17
|
export const FOLDER_PROVIDER = "folder";
|
|
17
18
|
/** Notes written in memo have no account row; this is their account. */
|
|
18
19
|
export const INTERNAL_NOTES = "internal";
|
|
20
|
+
/** The reason a search gives for an account whose provider no entry names. */
|
|
21
|
+
export const UNKNOWN_PROVIDER = "unknown provider — run its CLI once";
|
|
22
|
+
const WORD = /^[a-z0-9][a-z0-9_-]*$/;
|
|
23
|
+
const invalid = (message) => {
|
|
24
|
+
throw new CliError("validation_error", message);
|
|
25
|
+
};
|
|
26
|
+
const wordOf = (value, what) => typeof value === "string" && WORD.test(value)
|
|
27
|
+
? value
|
|
28
|
+
: invalid(`${what} is lowercase letters, digits, - and _ — not ${JSON.stringify(value)}`);
|
|
29
|
+
/** An entry as a CLI or the store gives it, checked: anything else is a `validation_error`. */
|
|
30
|
+
export const providerEntryOf = (value) => {
|
|
31
|
+
if (typeof value !== "object" || value === null || Array.isArray(value))
|
|
32
|
+
return invalid("a provider entry is an object");
|
|
33
|
+
const { name, kind, aliases = [], command } = value;
|
|
34
|
+
const named = wordOf(name, "a provider's name");
|
|
35
|
+
if (typeof kind !== "string" || !KINDS.includes(kind))
|
|
36
|
+
invalid(`provider ${named}'s kind is one of ${KINDS.join(", ")} — not ${JSON.stringify(kind)}`);
|
|
37
|
+
if (!Array.isArray(aliases))
|
|
38
|
+
invalid(`provider ${named}'s aliases are a list`);
|
|
39
|
+
return {
|
|
40
|
+
name: named,
|
|
41
|
+
kind: kind,
|
|
42
|
+
aliases: [...new Set(aliases.map((alias) => wordOf(alias, `an alias of ${named}`)))],
|
|
43
|
+
...(command === undefined ? {} : { command: wordOf(command, `the command of ${named}`) }),
|
|
44
|
+
};
|
|
45
|
+
};
|
|
46
|
+
const describe = ({ name, kind, command }) => `${name} (${kind}${command ? `, from ${command}` : ""})`;
|
|
47
|
+
const wordsOf = ({ name, aliases }) => [name, ...aliases];
|
|
48
|
+
/** `entry` joined to `known`: the same name keeps one entry with both entries' aliases; a clash is an error. */
|
|
49
|
+
const joined = (known, entry) => {
|
|
50
|
+
const same = known.find(({ name }) => name === entry.name);
|
|
51
|
+
if (same && same.kind !== entry.kind)
|
|
52
|
+
invalid(`two provider entries disagree on the kind: ${describe(same)} and ${describe(entry)}`);
|
|
53
|
+
const merged = same
|
|
54
|
+
? {
|
|
55
|
+
...same,
|
|
56
|
+
aliases: [...new Set([...same.aliases, ...entry.aliases])],
|
|
57
|
+
...(entry.command ? { command: entry.command } : {}),
|
|
58
|
+
}
|
|
59
|
+
: entry;
|
|
60
|
+
const others = known.filter((one) => one !== same);
|
|
61
|
+
for (const word of wordsOf(merged)) {
|
|
62
|
+
const owner = others.find((one) => wordsOf(one).includes(word));
|
|
63
|
+
if (owner)
|
|
64
|
+
invalid(`"${word}" names two providers: ${describe(owner)} and ${describe(merged)}`);
|
|
65
|
+
}
|
|
66
|
+
return same ? known.map((one) => (one === same ? merged : one)) : [...known, merged];
|
|
67
|
+
};
|
|
68
|
+
let registry = PROVIDERS;
|
|
69
|
+
/** The built-ins and the entries the store or the CLI running gave; what `kindOf` and `providerNamed` read. */
|
|
70
|
+
export const providers = () => registry;
|
|
71
|
+
/**
|
|
72
|
+
* Replaces the entries beyond the built-ins. Opening the store calls it with the stored entries; a test or a CLI
|
|
73
|
+
* with no store may call it too. Two entries that disagree on a kind, or one word naming two providers, throw.
|
|
74
|
+
*/
|
|
75
|
+
export const useProviders = (entries) => {
|
|
76
|
+
registry = entries.map(providerEntryOf).reduce(joined, PROVIDERS);
|
|
77
|
+
};
|
|
78
|
+
/**
|
|
79
|
+
* Like `useProviders`, but an entry that clashes is left out instead of failing: what the store holds was written
|
|
80
|
+
* by CLIs of other versions, and one stale entry must not stop the store opening. Answers the entries left out.
|
|
81
|
+
*/
|
|
82
|
+
export const useStoredProviders = (entries) => {
|
|
83
|
+
const left = [];
|
|
84
|
+
registry = entries.reduce((known, entry) => {
|
|
85
|
+
try {
|
|
86
|
+
return joined(known, providerEntryOf(entry));
|
|
87
|
+
}
|
|
88
|
+
catch (error) {
|
|
89
|
+
if (!(error instanceof CliError))
|
|
90
|
+
throw error;
|
|
91
|
+
left.push(entry);
|
|
92
|
+
return known;
|
|
93
|
+
}
|
|
94
|
+
}, PROVIDERS);
|
|
95
|
+
return left;
|
|
96
|
+
};
|
|
97
|
+
/** Adds one entry to those in use, strictly: a clash throws and leaves the registry as it was. */
|
|
98
|
+
export const addProvider = (entry) => {
|
|
99
|
+
registry = joined(registry, providerEntryOf(entry));
|
|
100
|
+
};
|
|
19
101
|
export const isKind = (word) => KINDS.includes(word.toLowerCase());
|
|
20
102
|
/** The registry's provider a name or alias stands for. */
|
|
21
103
|
export const providerNamed = (word) => {
|
|
22
104
|
const wanted = word.toLowerCase();
|
|
23
|
-
return
|
|
105
|
+
return registry.find((entry) => wordsOf(entry).includes(wanted));
|
|
24
106
|
};
|
|
25
|
-
/**
|
|
26
|
-
export const
|
|
107
|
+
/** The kind of a provider the registry knows; `undefined` for one no entry names, which a search skips. */
|
|
108
|
+
export const kindIn = (provider) => provider === FOLDER_PROVIDER ? "notes" : registry.find(({ name }) => name === provider)?.kind;
|
|
109
|
+
/** A provider the registry does not list counts as a messenger here; a search asks `kindIn` and skips it. */
|
|
110
|
+
export const kindOf = (provider) => kindIn(provider) ?? "messages";
|
package/dist/entities/index.d.ts
CHANGED
|
@@ -39,6 +39,7 @@ import { imageEmbedding } from "./image-embedding.js";
|
|
|
39
39
|
import { inviteLink } from "./invite-link.js";
|
|
40
40
|
import { job } from "./job.js";
|
|
41
41
|
import { joinRequest } from "./join-request.js";
|
|
42
|
+
import { organization, project, reminder } from "./knowledge-lists.js";
|
|
42
43
|
import { botAdmin, botMenuEntry, botProfile, botSeenChat, botTemplate, botWebhook, callRecord, scheduledJob, stickerInventory } from "./list-results.js";
|
|
43
44
|
import { messageEvent, serveSummary, watchedMessage, watchItem } from "./listener.js";
|
|
44
45
|
import { mediaArchive, mediaArchiveCheck, mediaArchiveMove, mediaArchiveTimer } from "./media-archive.js";
|
|
@@ -85,7 +86,7 @@ import { topic } from "./topic.js";
|
|
|
85
86
|
* subset of its fields, never a renamed one. Commands move onto these one by one; until then, a schema
|
|
86
87
|
* is the target, not a description of today's output.
|
|
87
88
|
*/
|
|
88
|
-
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, 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, contactProfile, 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, 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, person, place, poll, pollChange, pollVote, ranking, reactionChange, recipient, recipientAdded, recipientChange, recipientOff, recipientRemoved, recordedRun, reference, relationship, removedModelKey, retention, runDetails, runHit, runLocation, savedSearch, scheduledJob, searchHistoryClear, sendAttempt, serveSummary, stickerInventory, storeBackup, storeChatStatus, storeCheck, storeClear, storeCopyRemoval, storeDecrypt, storedModelKey, storeExport, storeGapPlan, storeGapRepair, storeInfo, storeJobCancel, storeJobClear, storeJobDetails, storeJobRetry, storeMigration, storeReindex, storeRepair, storeReset, storeRestore, tagChange, tagging, task, taskCard, taskCategories, taskClosed, taskCreated, taskLinks, taskMerge, taskPair, taskScan, taskSimilar, taskStats, taskUnmerge, topic, trackedChat, trackedChatHistory, watchedMessage, watchItem, };
|
|
89
|
+
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, 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, contactProfile, 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, 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, reactionChange, recipient, recipientAdded, recipientChange, recipientOff, recipientRemoved, recordedRun, reference, relationship, reminder, removedModelKey, retention, runDetails, runHit, runLocation, savedSearch, scheduledJob, searchHistoryClear, sendAttempt, serveSummary, stickerInventory, storeBackup, storeChatStatus, storeCheck, storeClear, storeCopyRemoval, storeDecrypt, storedModelKey, storeExport, storeGapPlan, storeGapRepair, storeInfo, storeJobCancel, storeJobClear, storeJobDetails, storeJobRetry, storeMigration, storeReindex, storeRepair, storeReset, storeRestore, tagChange, tagging, task, taskCard, taskCategories, taskClosed, taskCreated, taskLinks, taskMerge, taskPair, taskScan, taskSimilar, taskStats, taskUnmerge, topic, trackedChat, trackedChatHistory, watchedMessage, watchItem, };
|
|
89
90
|
export declare const ENTITIES: {
|
|
90
91
|
readonly meeting_ingestion: v.StrictObjectSchema<{
|
|
91
92
|
readonly meetings: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>;
|
|
@@ -4742,6 +4743,33 @@ export declare const ENTITIES: {
|
|
|
4742
4743
|
readonly account: v.NullableSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>, undefined>;
|
|
4743
4744
|
readonly name: v.NullableSchema<v.StringSchema<undefined>, undefined>;
|
|
4744
4745
|
}, undefined>;
|
|
4746
|
+
readonly organization: v.StrictObjectSchema<{
|
|
4747
|
+
readonly id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>;
|
|
4748
|
+
readonly ref: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, "a reference such as `note:42`">]>;
|
|
4749
|
+
readonly kind: v.PicklistSchema<["company", "team", "family", "community"], undefined>;
|
|
4750
|
+
readonly name: v.StringSchema<undefined>;
|
|
4751
|
+
readonly scope: v.PicklistSchema<["personal", "work"], undefined>;
|
|
4752
|
+
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`">]>;
|
|
4753
|
+
}, undefined>;
|
|
4754
|
+
readonly project: v.StrictObjectSchema<{
|
|
4755
|
+
readonly id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>;
|
|
4756
|
+
readonly ref: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, "a reference such as `note:42`">]>;
|
|
4757
|
+
readonly key: v.StringSchema<undefined>;
|
|
4758
|
+
readonly name: v.StringSchema<undefined>;
|
|
4759
|
+
readonly type: v.PicklistSchema<["work", "client", "personal", "oss", "other"], undefined>;
|
|
4760
|
+
readonly organization_id: v.NullableSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>, undefined>;
|
|
4761
|
+
readonly scope: v.PicklistSchema<["personal", "work"], undefined>;
|
|
4762
|
+
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`">]>;
|
|
4763
|
+
}, undefined>;
|
|
4764
|
+
readonly reminder: v.StrictObjectSchema<{
|
|
4765
|
+
readonly id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>;
|
|
4766
|
+
readonly task: v.StringSchema<undefined>;
|
|
4767
|
+
readonly due_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`">]>;
|
|
4768
|
+
readonly timezone: v.StringSchema<undefined>;
|
|
4769
|
+
readonly state: v.PicklistSchema<["pending", "leased", "delivered", "cancelled"], undefined>;
|
|
4770
|
+
readonly revision: v.NumberSchema<undefined>;
|
|
4771
|
+
readonly receipt: v.NullableSchema<v.StringSchema<undefined>, undefined>;
|
|
4772
|
+
}, undefined>;
|
|
4745
4773
|
readonly bot_profile: v.StrictObjectSchema<{
|
|
4746
4774
|
readonly name: v.StringSchema<undefined>;
|
|
4747
4775
|
readonly token: v.StringSchema<undefined>;
|
package/dist/entities/index.js
CHANGED
|
@@ -41,6 +41,7 @@ import { imageEmbedding } from "./image-embedding.js";
|
|
|
41
41
|
import { inviteLink } from "./invite-link.js";
|
|
42
42
|
import { job } from "./job.js";
|
|
43
43
|
import { joinRequest } from "./join-request.js";
|
|
44
|
+
import { organization, project, reminder } from "./knowledge-lists.js";
|
|
44
45
|
import { botAdmin, botMenuEntry, botProfile, botSeenChat, botTemplate, botWebhook, callRecord, scheduledJob, stickerInventory, } from "./list-results.js";
|
|
45
46
|
import { messageEvent, serveSummary, watchedMessage, watchItem } from "./listener.js";
|
|
46
47
|
import { mediaArchive, mediaArchiveCheck, mediaArchiveMove, mediaArchiveTimer } from "./media-archive.js";
|
|
@@ -91,7 +92,7 @@ import { topic } from "./topic.js";
|
|
|
91
92
|
* subset of its fields, never a renamed one. Commands move onto these one by one; until then, a schema
|
|
92
93
|
* is the target, not a description of today's output.
|
|
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, 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, contactProfile, 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, 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, person, place, poll, pollChange, pollVote, ranking, reactionChange, recipient, recipientAdded, recipientChange, recipientOff, recipientRemoved, recordedRun, reference, relationship, removedModelKey, retention, runDetails, runHit, runLocation, savedSearch, scheduledJob, searchHistoryClear, sendAttempt, serveSummary, stickerInventory, storeBackup, storeChatStatus, storeCheck, storeClear, storeCopyRemoval, storeDecrypt, storedModelKey, storeExport, storeGapPlan, storeGapRepair, storeInfo, storeJobCancel, storeJobClear, storeJobDetails, storeJobRetry, storeMigration, storeReindex, storeRepair, storeReset, storeRestore, tagChange, tagging, task, taskCard, taskCategories, taskClosed, taskCreated, taskLinks, taskMerge, taskPair, taskScan, taskSimilar, taskStats, taskUnmerge, topic, trackedChat, trackedChatHistory, watchedMessage, watchItem, };
|
|
95
|
+
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, 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, contactProfile, 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, 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, reactionChange, recipient, recipientAdded, recipientChange, recipientOff, recipientRemoved, recordedRun, reference, relationship, reminder, removedModelKey, retention, runDetails, runHit, runLocation, savedSearch, scheduledJob, searchHistoryClear, sendAttempt, serveSummary, stickerInventory, storeBackup, storeChatStatus, storeCheck, storeClear, storeCopyRemoval, storeDecrypt, storedModelKey, storeExport, storeGapPlan, storeGapRepair, storeInfo, storeJobCancel, storeJobClear, storeJobDetails, storeJobRetry, storeMigration, storeReindex, storeRepair, storeReset, storeRestore, tagChange, tagging, task, taskCard, taskCategories, taskClosed, taskCreated, taskLinks, taskMerge, taskPair, taskScan, taskSimilar, taskStats, taskUnmerge, topic, trackedChat, trackedChatHistory, watchedMessage, watchItem, };
|
|
95
96
|
export const ENTITIES = {
|
|
96
97
|
sync_progress: syncProgress,
|
|
97
98
|
...MEETING_RESULT_ENTITIES,
|
|
@@ -167,6 +168,9 @@ export const ENTITIES = {
|
|
|
167
168
|
account_privacy: accountPrivacy,
|
|
168
169
|
account_privacy_change: accountPrivacyChange,
|
|
169
170
|
account_profile: accountProfile,
|
|
171
|
+
organization,
|
|
172
|
+
project,
|
|
173
|
+
reminder,
|
|
170
174
|
bot_profile: botProfile,
|
|
171
175
|
bot_template: botTemplate,
|
|
172
176
|
bot_seen_chat: botSeenChat,
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import * as v from "valibot";
|
|
2
|
+
export declare const organization: v.StrictObjectSchema<{
|
|
3
|
+
readonly id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>;
|
|
4
|
+
readonly ref: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, "a reference such as `note:42`">]>;
|
|
5
|
+
readonly kind: v.PicklistSchema<["company", "team", "family", "community"], undefined>;
|
|
6
|
+
readonly name: v.StringSchema<undefined>;
|
|
7
|
+
readonly scope: v.PicklistSchema<["personal", "work"], undefined>;
|
|
8
|
+
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`">]>;
|
|
9
|
+
}, undefined>;
|
|
10
|
+
export declare const project: v.StrictObjectSchema<{
|
|
11
|
+
readonly id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>;
|
|
12
|
+
readonly ref: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, "a reference such as `note:42`">]>;
|
|
13
|
+
readonly key: v.StringSchema<undefined>;
|
|
14
|
+
readonly name: v.StringSchema<undefined>;
|
|
15
|
+
readonly type: v.PicklistSchema<["work", "client", "personal", "oss", "other"], undefined>;
|
|
16
|
+
readonly organization_id: v.NullableSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>, undefined>;
|
|
17
|
+
readonly scope: v.PicklistSchema<["personal", "work"], undefined>;
|
|
18
|
+
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`">]>;
|
|
19
|
+
}, undefined>;
|
|
20
|
+
export declare const reminder: v.StrictObjectSchema<{
|
|
21
|
+
readonly id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>;
|
|
22
|
+
readonly task: v.StringSchema<undefined>;
|
|
23
|
+
readonly due_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`">]>;
|
|
24
|
+
readonly timezone: v.StringSchema<undefined>;
|
|
25
|
+
readonly state: v.PicklistSchema<["pending", "leased", "delivered", "cancelled"], undefined>;
|
|
26
|
+
readonly revision: v.NumberSchema<undefined>;
|
|
27
|
+
readonly receipt: v.NullableSchema<v.StringSchema<undefined>, undefined>;
|
|
28
|
+
}, undefined>;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import * as v from "valibot";
|
|
2
|
+
import { id, reference, text, time } from "./fields.js";
|
|
3
|
+
export const organization = v.strictObject({
|
|
4
|
+
id,
|
|
5
|
+
ref: reference,
|
|
6
|
+
kind: v.picklist(["company", "team", "family", "community"]),
|
|
7
|
+
name: text,
|
|
8
|
+
scope: v.picklist(["personal", "work"]),
|
|
9
|
+
created_at: time,
|
|
10
|
+
});
|
|
11
|
+
export const project = v.strictObject({
|
|
12
|
+
id,
|
|
13
|
+
ref: reference,
|
|
14
|
+
key: text,
|
|
15
|
+
name: text,
|
|
16
|
+
type: v.picklist(["work", "client", "personal", "oss", "other"]),
|
|
17
|
+
organization_id: v.nullable(id),
|
|
18
|
+
scope: v.picklist(["personal", "work"]),
|
|
19
|
+
created_at: time,
|
|
20
|
+
});
|
|
21
|
+
export const reminder = v.strictObject({
|
|
22
|
+
id,
|
|
23
|
+
task: text,
|
|
24
|
+
due_at: time,
|
|
25
|
+
timezone: text,
|
|
26
|
+
state: v.picklist(["pending", "leased", "delivered", "cancelled"]),
|
|
27
|
+
revision: v.number(),
|
|
28
|
+
receipt: v.nullable(text),
|
|
29
|
+
});
|
package/dist/index.d.ts
CHANGED
|
@@ -8,6 +8,7 @@ export { parseMarkdownSpans } from "./domain/markdown-spans.js";
|
|
|
8
8
|
export type { MessageLink, MessagePermalink } from "./domain/message-link.js";
|
|
9
9
|
export type * from "./domain/models.js";
|
|
10
10
|
export { countedPoll } from "./domain/polls.js";
|
|
11
|
+
export { isKind, KINDS, type Kind, kindIn, kindOf, PROVIDERS, type ProviderEntry, providerNamed, providers, UNKNOWN_PROVIDER, useProviders, } from "./domain/providers.js";
|
|
11
12
|
export type { RankingGraphEvidence, RankingGraphLink } from "./domain/rankings-graph.js";
|
|
12
13
|
export type { RankingComponent, RankingInput, RankingMeasure, RankingOptions, RankingTarget, RankingWeights, ScorePreset, } from "./domain/rankings-options.js";
|
|
13
14
|
export { rankingOptions } from "./domain/rankings-options.js";
|
package/dist/index.js
CHANGED
|
@@ -5,6 +5,7 @@ export { formatLocator, isLocator, parseLocator } from "./domain/locator.js";
|
|
|
5
5
|
export { parseMarkdown } from "./domain/markdown.js";
|
|
6
6
|
export { parseMarkdownSpans } from "./domain/markdown-spans.js";
|
|
7
7
|
export { countedPoll } from "./domain/polls.js";
|
|
8
|
+
export { isKind, KINDS, kindIn, kindOf, PROVIDERS, providerNamed, providers, UNKNOWN_PROVIDER, useProviders, } from "./domain/providers.js";
|
|
8
9
|
export { rankingOptions } from "./domain/rankings-options.js";
|
|
9
10
|
export { canonicalReference, formatReference, parseReference } from "./domain/references.js";
|
|
10
11
|
export { normalizeTag, TAG_TYPES } from "./domain/tags.js";
|
|
@@ -24,9 +24,12 @@ export interface ListContext {
|
|
|
24
24
|
command?: string;
|
|
25
25
|
};
|
|
26
26
|
}
|
|
27
|
-
/**
|
|
27
|
+
/**
|
|
28
|
+
* An account as `--source` and a hit name it: a notes folder is `notes:<its id>`, never the store's ulid. The kind is
|
|
29
|
+
* `undefined` for a provider no registry entry names: no search reads it, and `fitting` reports it.
|
|
30
|
+
*/
|
|
28
31
|
export interface ListedAccount extends AccountKey {
|
|
29
|
-
kind: Kind;
|
|
32
|
+
kind: Kind | undefined;
|
|
30
33
|
}
|
|
31
34
|
/** One entry of the list as written, a group's member included, and the accounts it named. */
|
|
32
35
|
export interface ListedEntry {
|