@wirecat/cli-core 0.407.0 → 0.409.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (50) hide show
  1. package/CHANGELOG.md +22 -0
  2. package/dist/background/schedules.d.ts +1 -1
  3. package/dist/background/schedules.js +3 -1
  4. package/dist/cli/bot/admins.js +5 -3
  5. package/dist/cli/bot/command.js +21 -11
  6. package/dist/cli/bot/list-queries.d.ts +27 -0
  7. package/dist/cli/bot/list-queries.js +83 -0
  8. package/dist/cli/bot/messages.js +14 -8
  9. package/dist/cli/bot/registry.d.ts +1 -1
  10. package/dist/cli/bot/registry.js +4 -2
  11. package/dist/cli/bot/setup.js +8 -4
  12. package/dist/cli/command-availability.d.ts +14 -0
  13. package/dist/cli/command-availability.js +25 -0
  14. package/dist/cli/commands-command.d.ts +1 -1
  15. package/dist/cli/commands-command.js +17 -4
  16. package/dist/cli/context.d.ts +1 -0
  17. package/dist/cli/effects.d.ts +1 -1
  18. package/dist/cli/effects.js +1 -1
  19. package/dist/cli/help/command-help.js +18 -1
  20. package/dist/cli/help/commands-text.d.ts +1 -1
  21. package/dist/cli/help/commands-text.js +3 -2
  22. package/dist/cli/index.d.ts +2 -0
  23. package/dist/cli/index.js +1 -0
  24. package/dist/cli/messenger/list-result-queries.d.ts +9 -0
  25. package/dist/cli/messenger/list-result-queries.js +30 -0
  26. package/dist/cli/messenger/recipients-query.d.ts +1 -1
  27. package/dist/cli/messenger/recipients-query.js +2 -2
  28. package/dist/cli/messenger/records-command.js +14 -4
  29. package/dist/cli/messenger/schedule-command.js +6 -3
  30. package/dist/cli/messenger/sends-query.d.ts +1 -1
  31. package/dist/cli/messenger/sends-query.js +2 -2
  32. package/dist/cli/messenger/topics-command.js +10 -6
  33. package/dist/cli/program.d.ts +2 -1
  34. package/dist/cli/program.js +24 -1
  35. package/dist/entities/index.d.ts +84 -1
  36. package/dist/entities/index.js +11 -1
  37. package/dist/entities/list-results.d.ts +83 -0
  38. package/dist/entities/list-results.js +69 -0
  39. package/dist/mcp/agent.d.ts +11 -11
  40. package/dist/mcp/agent.js +13 -27
  41. package/dist/mcp/bot/instructions.js +2 -1
  42. package/dist/mcp/bot/server.d.ts +2 -2
  43. package/dist/mcp/bot/server.js +29 -7
  44. package/dist/mcp/index.d.ts +1 -1
  45. package/dist/mcp/instructions.js +2 -1
  46. package/dist/mcp/server.js +33 -7
  47. package/dist/mcp/surface.d.ts +3 -1
  48. package/dist/mcp/surface.js +8 -2
  49. package/dist/meetings/mcp/index.d.ts +15 -15
  50. package/package.json +1 -1
@@ -0,0 +1,9 @@
1
+ import { type QueryRegistry } from "@wirecat/cli-base/query";
2
+ import type { Schedule } from "../../background/schedules.js";
3
+ import { type QueryWords } from "../list-query.js";
4
+ export declare const SCHEDULES_QUERY: QueryRegistry;
5
+ export declare const scheduleFilter: (words: QueryWords) => Partial<Pick<Schedule, "name" | "kind">>;
6
+ export declare const TOPICS_QUERY: QueryRegistry;
7
+ export declare const topicTitle: (words: QueryWords) => string | undefined;
8
+ export declare const CALLS_QUERY: QueryRegistry;
9
+ export declare const STICKERS_QUERY: QueryRegistry;
@@ -0,0 +1,30 @@
1
+ import { queryFieldsOf } from "@wirecat/cli-base/query";
2
+ import { callRecord, scheduledJob, stickerInventory, topic } from "../../entities/index.js";
3
+ import { queryTerms, unfilteredQuery } from "../list-query.js";
4
+ const termsOnly = (registry) => ({
5
+ ...registry,
6
+ fields: registry.fields.map((field) => field.native
7
+ ? { ...field, operators: field.operators.filter((operator) => operator === "term" || operator === "phrase") }
8
+ : field),
9
+ });
10
+ export const SCHEDULES_QUERY = termsOnly({
11
+ entity: "scheduled_job",
12
+ backend: "native",
13
+ fields: queryFieldsOf(scheduledJob, {
14
+ native: ["name", "kind"],
15
+ examples: { name: "name:daily", kind: "kind:command" },
16
+ }),
17
+ });
18
+ export const scheduleFilter = (words) => {
19
+ const terms = queryTerms(words, SCHEDULES_QUERY, "schedule list");
20
+ const name = terms.get("name"), kind = terms.get("kind");
21
+ return { ...(name === undefined ? {} : { name }), ...(kind === "agent" || kind === "command" ? { kind } : {}) };
22
+ };
23
+ export const TOPICS_QUERY = termsOnly({
24
+ entity: "topic",
25
+ backend: "native",
26
+ fields: queryFieldsOf(topic, { native: ["title"], examples: { title: 'title:"Book club"' } }),
27
+ });
28
+ export const topicTitle = (words) => queryTerms(words, TOPICS_QUERY, "topics list").get("title");
29
+ export const CALLS_QUERY = unfilteredQuery("call_record", callRecord);
30
+ export const STICKERS_QUERY = unfilteredQuery("sticker_inventory", stickerInventory);
@@ -2,4 +2,4 @@ import { type QueryRegistry } from "@wirecat/cli-base/query";
2
2
  import type { RecipientFilter } from "../../sends/recipients.js";
3
3
  import { type QueryWords } from "../list-query.js";
4
4
  export declare const RECIPIENTS_QUERY: QueryRegistry;
5
- export declare const recipientFilter: (words: QueryWords) => RecipientFilter;
5
+ export declare const recipientFilter: (words: QueryWords, command?: string) => RecipientFilter;
@@ -11,8 +11,8 @@ export const RECIPIENTS_QUERY = {
11
11
  ? { ...field, operators: field.operators.filter((operator) => operator === "term" || operator === "phrase") }
12
12
  : field),
13
13
  };
14
- export const recipientFilter = (words) => {
15
- const terms = queryTerms(words, RECIPIENTS_QUERY, "recipients list");
14
+ export const recipientFilter = (words, command = "recipients list") => {
15
+ const terms = queryTerms(words, RECIPIENTS_QUERY, command);
16
16
  const id = terms.get("id"), title = terms.get("title");
17
17
  return { ...(id === undefined ? {} : { id }), ...(title === undefined ? {} : { title }) };
18
18
  };
@@ -6,8 +6,10 @@ import { sendTime } from "../../domain/send-time.js";
6
6
  import { capability } from "../../ports/messenger.js";
7
7
  import { ownerOnlyOption, REMOTE_READ, REMOTE_WRITE } from "../effects.js";
8
8
  import { itemOf, listOf, renderAnswer, snakeKeys } from "../envelope.js";
9
+ import { listQuery, typedQuery, withQuery } from "../list-query.js";
9
10
  import { positiveCount } from "../paging.js";
10
11
  import { messengerContext } from "./context.js";
12
+ import { CALLS_QUERY, STICKERS_QUERY } from "./list-result-queries.js";
11
13
  const kindsOf = (typed) => {
12
14
  const kinds = typed === undefined ? [...MEDIA_KINDS] : typed.split(",").map((kind) => kind.trim());
13
15
  for (const kind of kinds) {
@@ -49,10 +51,14 @@ export const mediaCommand = (messenger) => annotate(new Command("media"), { effe
49
51
  /** `stickers list` — the sets the account added, or one set's stickers with the ids `messages send --sticker` takes. */
50
52
  export const stickersCommand = (messenger) => {
51
53
  const stickers = new Command("stickers").description("the stickers the account has added");
52
- annotate(stickers.command("list"), { effects: REMOTE_READ })
54
+ withQuery(annotate(stickers.command("list"), {
55
+ effects: REMOTE_READ,
56
+ examples: [`${messenger.app.command} personal stickers list`],
57
+ }), STICKERS_QUERY)
53
58
  .description("sticker sets, or with --set the stickers in one; reading changes nothing")
54
59
  .option("--set <id>", "the stickers in this set")
55
- .action(async function () {
60
+ .action(async function (words) {
61
+ listQuery(typedQuery(words), STICKERS_QUERY, "stickers list");
56
62
  const context = messengerContext(this, messenger);
57
63
  const { set } = this.opts();
58
64
  const items = await context.withMessenger((adapter) => set === undefined
@@ -69,10 +75,14 @@ export const stickersCommand = (messenger) => {
69
75
  /** `calls list` — the account's call history, newest first. */
70
76
  export const callsCommand = (messenger) => {
71
77
  const calls = new Command("calls").description("the account's calls");
72
- annotate(calls.command("list"), { effects: REMOTE_READ })
78
+ withQuery(annotate(calls.command("list"), {
79
+ effects: REMOTE_READ,
80
+ examples: [`${messenger.app.command} personal calls list`],
81
+ }), CALLS_QUERY)
73
82
  .description("calls made and received, newest first; reading changes nothing")
74
83
  .option("--limit <n>", "how many to show", positiveCount("--limit"))
75
- .action(async function () {
84
+ .action(async function (words) {
85
+ listQuery(typedQuery(words), CALLS_QUERY, "calls list");
76
86
  const context = messengerContext(this, messenger);
77
87
  const limit = context.settings.limit;
78
88
  const page = await context.withMessenger((adapter) => capability(adapter, "calls", "list calls")({ limit }));
@@ -13,8 +13,10 @@ import { storePath } from "../../store/path.js";
13
13
  import { environmentOf, setExitCode } from "../context.js";
14
14
  import { grantsAuthority, LOCAL_READ, LOCAL_WRITE, REMOTE_WRITE } from "../effects.js";
15
15
  import { itemOf, listOf, renderAnswer, snakeKeys } from "../envelope.js";
16
+ import { withQuery } from "../list-query.js";
16
17
  import { lineOf } from "../steps.js";
17
18
  import { messengerContext } from "./context.js";
19
+ import { SCHEDULES_QUERY, scheduleFilter } from "./list-result-queries.js";
18
20
  /** Each run of an agent is a paid model call that reads chats; keeping the store current is `serve`'s job. */
19
21
  const AGENT_MINIMUM_MINUTES = 60;
20
22
  const COMMAND_MINIMUM_MINUTES = 1;
@@ -156,11 +158,12 @@ export const scheduleCommand = (messenger) => {
156
158
  createdAt: new Date().toISOString(),
157
159
  });
158
160
  });
159
- annotate(command.command("list"), { effects: LOCAL_READ })
161
+ withQuery(annotate(command.command("list"), { effects: LOCAL_READ }), SCHEDULES_QUERY)
160
162
  .description("the schedules, when they run and how their last run went")
161
- .action(function () {
163
+ .action(function (words) {
164
+ const filter = scheduleFilter(words);
162
165
  const { context, state } = prepare(this);
163
- const rows = listSchedules(state).map((schedule) => ({
166
+ const rows = listSchedules(state, filter).map((schedule) => ({
164
167
  name: schedule.name,
165
168
  kind: schedule.kind,
166
169
  when: describeWhen(schedule.when),
@@ -2,4 +2,4 @@ import { type QueryRegistry } from "@wirecat/cli-base/query";
2
2
  import type { SendFilter } from "../../sends/journal.js";
3
3
  import { type QueryWords } from "../list-query.js";
4
4
  export declare const SENDS_QUERY: QueryRegistry;
5
- export declare const sendFilter: (words: QueryWords) => SendFilter | undefined;
5
+ export declare const sendFilter: (words: QueryWords, command?: string) => SendFilter | undefined;
@@ -17,8 +17,8 @@ export const SENDS_QUERY = {
17
17
  ? { ...field, operators: field.operators.filter((operator) => operator === "term" || operator === "phrase") }
18
18
  : field),
19
19
  };
20
- export const sendFilter = (words) => {
21
- const terms = queryTerms(words, SENDS_QUERY, "sends list");
20
+ export const sendFilter = (words, command = "sends list") => {
21
+ const terms = queryTerms(words, SENDS_QUERY, command);
22
22
  if (terms.size === 0)
23
23
  return undefined;
24
24
  const outcome = sendAttempt.entries.outcome.options.find((value) => value === terms.get("outcome"));
@@ -4,22 +4,26 @@ import { Command } from "commander";
4
4
  import { capability } from "../../ports/messenger.js";
5
5
  import { ownerOnlyOption, REMOTE_READ, REMOTE_WRITE } from "../effects.js";
6
6
  import { itemOf, listOf, renderAnswer, snakeKeys } from "../envelope.js";
7
+ import { typedQuery, withQuery } from "../list-query.js";
7
8
  import { window, withPaging } from "../paging.js";
8
9
  import { lines, pageOf, topicAnswer } from "./chat-answers.js";
9
10
  import { messengerContext } from "./context.js";
10
- const listed = (messenger) => async function (chat) {
11
- const [, query] = this.args;
11
+ import { TOPICS_QUERY, topicTitle } from "./list-result-queries.js";
12
+ const listed = (messenger) => async function (chat, value) {
13
+ const searching = this.name() === "topics";
14
+ const words = !searching && Array.isArray(value) ? value : [];
15
+ const query = searching && typeof value === "string" ? value : topicTitle(words);
12
16
  const context = messengerContext(this, messenger);
13
17
  if (context.settings.offline) {
14
18
  throw new CliError("validation_error", "`topics` asks the messenger; not with --offline");
15
19
  }
16
20
  const wanted = { ...window(context.settings), ...(query ? { search: query } : {}) };
17
21
  const found = await context.withMessenger((adapter) => capability(adapter, "topics", "list forum topics")(chat, wanted));
18
- const command = query === undefined ? "topics list" : "search topics";
22
+ const command = searching ? "search topics" : "topics list";
19
23
  renderAnswer(this, context, listOf(command, {
20
24
  items: found.items.map(topicAnswer),
21
25
  ...pageOf(context.settings, found),
22
- args: { chat, ...(query === undefined ? {} : { text: query }) },
26
+ args: { chat, ...(searching ? { text: query } : typedQuery(words) ? { query: typedQuery(words) } : {}) },
23
27
  }), lines(({ id, title, closed, pinned, unread_count }) => [id, title, closed ? "closed" : "", pinned ? "pinned" : "", unread_count ? `${unread_count} unread` : ""].join(" ")));
24
28
  };
25
29
  /** `search topics`: a forum group's topics whose title matches, asked of the messenger. */
@@ -30,9 +34,9 @@ export const topicsSearchCommand = (messenger) => withPaging(annotate(new Comman
30
34
  /** `topics list` and the writes — a forum group's topics, with the ids its messages carry as `threadId`. */
31
35
  export const topicsCommand = (messenger) => {
32
36
  const topics = annotate(new Command("topics"), { offline: false }).description("the topics of a forum group");
33
- topics.addCommand(withPaging(annotate(new Command("list"), { effects: REMOTE_READ })
37
+ topics.addCommand(withQuery(withPaging(annotate(new Command("list"), { effects: REMOTE_READ })
34
38
  .description("a forum group's topics, newest activity first")
35
- .argument("<chat>", messenger.chatArgument)).action(listed(messenger)));
39
+ .argument("<chat>", messenger.chatArgument)), TOPICS_QUERY).action(listed(messenger)));
36
40
  if (messenger.topicShow)
37
41
  annotate(topics.command("show"), { effects: REMOTE_READ })
38
42
  .description("one forum topic: its title, state and last activity")
@@ -9,7 +9,8 @@ export interface ProgramDefinition {
9
9
  commands: () => Command[];
10
10
  /** The CLI's own settings, for keeping a failure that happened before its command could; plain ones without. */
11
11
  configuration?: {
12
- resolveSettings: (flags?: GlobalFlags, options?: ResolveOptions) => Pick<Settings, "profile" | "keepFailedRuns" | "keepRunsForDays" | "skillHint">;
12
+ permissionKey?: (path: readonly string[]) => string | null | undefined;
13
+ resolveSettings: (flags?: GlobalFlags, options?: ResolveOptions) => Pick<Settings, "profile" | "keepFailedRuns" | "keepRunsForDays" | "skillHint"> & Partial<Pick<Settings, "permissions">>;
13
14
  };
14
15
  configure?: (program: Command) => void;
15
16
  /** The tool's pitch and "what you can do" lines on `--help` and a bare run. */
@@ -13,10 +13,11 @@ import { recorded, wasSettled } from "../runs/recording.js";
13
13
  import { processRun, useAsProcessRun } from "../runs/scope.js";
14
14
  import { AUTHORITY_KEY, BOT_API_KEY, isBotApi, keyForCommand } from "../sends/permissions.js";
15
15
  import { logParsedArgv, logVersion } from "./argv-log.js";
16
+ import { commandAvailability } from "./command-availability.js";
16
17
  import { commandPathOf } from "./command-contract.js";
17
18
  import { outputFor, provide } from "./context.js";
18
19
  import { refuseWriteBeforeConnecting } from "./early-refusal.js";
19
- import { changesAuthorityNow, isLogin, isStoreChange, judgedEffects, judgedTargets, STORE_CHANGE_REFUSAL, } from "./effects.js";
20
+ import { changesAuthorityAt, changesAuthorityNow, isLogin, isStoreChange, judgedEffects, judgedTargets, STORE_CHANGE_REFUSAL, } from "./effects.js";
20
21
  import { itemOf, renderAnswer, snakeKeys } from "./envelope.js";
21
22
  import { byteCount, DEFAULT_COMMAND_MS, DEFAULT_OUTPUT_BYTES, execution } from "./execution.js";
22
23
  import { setupAtStart } from "./first-run.js";
@@ -193,6 +194,28 @@ const runOnce = async (argv, definition, options) => {
193
194
  platform: options.platform ?? process.platform,
194
195
  exit,
195
196
  runCommand: (words, given) => run(words, definition, given),
197
+ discoveryAvailability: (info) => {
198
+ const inspected = info.path.reduce((parent, word) => parent?.commands.find((one) => one.name() === word), program);
199
+ const flags = (inspected ?? program).optsWithGlobals();
200
+ const env = options.env ?? process.env;
201
+ if (!flags.profile && !env[envName(definition.app, "PROFILE")])
202
+ return undefined;
203
+ try {
204
+ const overrides = options.agent?.overrides ?? [];
205
+ const settings = (definition.configuration ?? settingsFor(definition.app)).resolveSettings(overrides.length ? { ...flags, permission: [...overrides, ...(flags.permission ?? [])] } : flags, {
206
+ env,
207
+ needsProfile: false,
208
+ kind: info.path[0] === "bot" || flags.bot ? "bot" : "personal",
209
+ });
210
+ if (!settings.permissions)
211
+ return undefined;
212
+ return commandAvailability(info, settings.permissions, definition.configuration?.permissionKey, changesAuthorityAt(program), readOnlyLockOf(definition.app, env) !== undefined, options.agent !== undefined);
213
+ }
214
+ catch {
215
+ // Help must still work when the configuration needs repair.
216
+ return undefined;
217
+ }
218
+ },
196
219
  untilStopped: () => {
197
220
  if (phased || finished)
198
221
  return phase.signal;
@@ -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 { botAdmin, botMenuEntry, botProfile, botSeenChat, botTemplate, botWebhook, callRecord, scheduledJob, stickerInventory } from "./list-results.js";
42
43
  import { messageEvent, serveSummary, watchedMessage, watchItem } from "./listener.js";
43
44
  import { mediaArchive, mediaArchiveCheck, mediaArchiveMove, mediaArchiveTimer } from "./media-archive.js";
44
45
  import { meeting } from "./meeting.js";
@@ -84,7 +85,7 @@ import { topic } from "./topic.js";
84
85
  * subset of its fields, never a renamed one. Commands move onto these one by one; until then, a schema
85
86
  * is the target, not a description of today's output.
86
87
  */
87
- export { account, accountChange, accountPrivacy, accountPrivacyChange, accountProfile, accountSession, adminReport, agenda, analysisConsent, analysisConsentRevocation, attachment, attachmentBytes, attachmentExtraction, attachmentTextChange, automaticTags, cachedChatMetadata, 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, searchHistoryClear, sendAttempt, serveSummary, 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, };
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, };
88
89
  export declare const ENTITIES: {
89
90
  readonly meeting_ingestion: v.StrictObjectSchema<{
90
91
  readonly meetings: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>;
@@ -4741,6 +4742,88 @@ export declare const ENTITIES: {
4741
4742
  readonly account: v.NullableSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>, undefined>;
4742
4743
  readonly name: v.NullableSchema<v.StringSchema<undefined>, undefined>;
4743
4744
  }, undefined>;
4745
+ readonly bot_profile: v.StrictObjectSchema<{
4746
+ readonly name: v.StringSchema<undefined>;
4747
+ readonly token: v.StringSchema<undefined>;
4748
+ readonly bot: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
4749
+ readonly id: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>, undefined>;
4750
+ readonly problem: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
4751
+ }, undefined>;
4752
+ readonly bot_template: v.StrictObjectSchema<{
4753
+ readonly name: v.NullableSchema<v.StringSchema<undefined>, undefined>;
4754
+ readonly status: v.NullableSchema<v.StringSchema<undefined>, undefined>;
4755
+ readonly language: v.NullableSchema<v.StringSchema<undefined>, undefined>;
4756
+ readonly category: v.NullableSchema<v.StringSchema<undefined>, undefined>;
4757
+ }, undefined>;
4758
+ readonly bot_seen_chat: v.StrictObjectSchema<{
4759
+ readonly title: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
4760
+ readonly kind: v.OptionalSchema<v.PicklistSchema<["dialog", "group", "channel", "saved", "unknown"], undefined>, undefined>;
4761
+ readonly unread_count: v.OptionalSchema<v.NullableSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>, undefined>, undefined>;
4762
+ readonly unread_mentions: v.OptionalSchema<v.OptionalSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>, undefined>, undefined>;
4763
+ readonly last_message_at: v.OptionalSchema<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>, undefined>;
4764
+ readonly participants_count: v.OptionalSchema<v.NullableSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>, undefined>, undefined>;
4765
+ readonly muted: v.OptionalSchema<v.OptionalSchema<v.BooleanSchema<undefined>, undefined>, undefined>;
4766
+ readonly archived: v.OptionalSchema<v.OptionalSchema<v.BooleanSchema<undefined>, undefined>, undefined>;
4767
+ readonly marked_unread: v.OptionalSchema<v.OptionalSchema<v.BooleanSchema<undefined>, undefined>, undefined>;
4768
+ readonly membership_state: v.OptionalSchema<v.OptionalSchema<v.PicklistSchema<["joined", "left", "public", "imported", "archived", "external"], undefined>, undefined>, undefined>;
4769
+ readonly scope: v.OptionalSchema<v.OptionalSchema<v.PicklistSchema<["personal", "work"], undefined>, undefined>, undefined>;
4770
+ readonly provider_metadata: v.OptionalSchema<v.OptionalSchema<v.RecordSchema<v.StringSchema<undefined>, v.UnknownSchema, undefined>, undefined>, undefined>;
4771
+ readonly id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>;
4772
+ readonly parent_chat_id: v.OptionalSchema<v.NullableSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>, undefined>, undefined>;
4773
+ readonly muted_until: v.OptionalSchema<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>, undefined>;
4774
+ readonly first_seen_at: v.OptionalSchema<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>;
4775
+ readonly last_seen_at: v.OptionalSchema<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>;
4776
+ }, undefined>;
4777
+ readonly bot_admin: v.StrictObjectSchema<{
4778
+ readonly id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>;
4779
+ readonly name: v.NullableSchema<v.StringSchema<undefined>, undefined>;
4780
+ readonly username: v.NullableSchema<v.StringSchema<undefined>, undefined>;
4781
+ readonly role: v.PicklistSchema<["owner", "admin"], undefined>;
4782
+ readonly rights: v.ArraySchema<v.PicklistSchema<["read", "members", "admins", "info", "pin", "link", "post", "edit", "delete"], undefined>, undefined>;
4783
+ readonly title: v.NullableSchema<v.StringSchema<undefined>, undefined>;
4784
+ }, undefined>;
4785
+ readonly bot_menu_entry: v.StrictObjectSchema<{
4786
+ readonly name: v.StringSchema<undefined>;
4787
+ readonly description: v.NullableSchema<v.StringSchema<undefined>, undefined>;
4788
+ }, undefined>;
4789
+ readonly bot_webhook: v.StrictObjectSchema<{
4790
+ readonly url: v.StringSchema<undefined>;
4791
+ readonly types: v.NullableSchema<v.ArraySchema<v.StringSchema<undefined>, undefined>, undefined>;
4792
+ }, undefined>;
4793
+ readonly scheduled_job: v.StrictObjectSchema<{
4794
+ readonly name: v.StringSchema<undefined>;
4795
+ readonly kind: v.PicklistSchema<["command", "agent"], undefined>;
4796
+ readonly when: v.StringSchema<undefined>;
4797
+ readonly last: v.NullableSchema<v.StrictObjectSchema<{
4798
+ readonly 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`">]>;
4799
+ readonly exit_code: v.NumberSchema<undefined>;
4800
+ readonly output: v.StringSchema<undefined>;
4801
+ readonly trace_id: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
4802
+ readonly reason: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
4803
+ readonly error_code: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
4804
+ readonly failing_since: v.OptionalSchema<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>;
4805
+ readonly failures: v.OptionalSchema<v.NumberSchema<undefined>, undefined>;
4806
+ }, undefined>, undefined>;
4807
+ }, undefined>;
4808
+ readonly call_record: v.StrictObjectSchema<{
4809
+ readonly id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>;
4810
+ readonly chat_id: v.NullableSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>, undefined>;
4811
+ readonly caller_id: v.NullableSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>, undefined>;
4812
+ readonly direction: v.PicklistSchema<["incoming", "outgoing"], undefined>;
4813
+ readonly outcome: v.PicklistSchema<["answered", "missed", "declined"], undefined>;
4814
+ readonly kind: v.PicklistSchema<["audio", "video"], undefined>;
4815
+ readonly 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`">]>;
4816
+ readonly duration_seconds: v.NullableSchema<v.NumberSchema<undefined>, undefined>;
4817
+ }, undefined>;
4818
+ readonly sticker_inventory: v.StrictObjectSchema<{
4819
+ readonly id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>;
4820
+ readonly title: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
4821
+ readonly count: v.OptionalSchema<v.NumberSchema<undefined>, undefined>;
4822
+ readonly link: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
4823
+ readonly set_id: v.OptionalSchema<v.NullableSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>, undefined>, undefined>;
4824
+ readonly emoji: v.OptionalSchema<v.ArraySchema<v.StringSchema<undefined>, undefined>, undefined>;
4825
+ readonly url: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
4826
+ }, undefined>;
4744
4827
  readonly note: v.StrictObjectSchema<{
4745
4828
  readonly ref: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, "a reference such as `note:42`">]>;
4746
4829
  readonly kind: v.OptionalSchema<v.PicklistSchema<["note", "document"], undefined>, undefined>;
@@ -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 { botAdmin, botMenuEntry, botProfile, botSeenChat, botTemplate, botWebhook, callRecord, scheduledJob, stickerInventory, } from "./list-results.js";
44
45
  import { messageEvent, serveSummary, watchedMessage, watchItem } from "./listener.js";
45
46
  import { mediaArchive, mediaArchiveCheck, mediaArchiveMove, mediaArchiveTimer } from "./media-archive.js";
46
47
  import { event, meeting, meetingDetails, meetingHit, meetingLink, meetingParticipants, meetingPassage, meetingProjectEvidence, meetingReview, meetingSpeaker, meetingStats, meetingSummary, meetingTranscript, } from "./meeting.js";
@@ -90,7 +91,7 @@ import { topic } from "./topic.js";
90
91
  * subset of its fields, never a renamed one. Commands move onto these one by one; until then, a schema
91
92
  * is the target, not a description of today's output.
92
93
  */
93
- export { account, accountChange, accountPrivacy, accountPrivacyChange, accountProfile, accountSession, adminReport, agenda, analysisConsent, analysisConsentRevocation, attachment, attachmentBytes, attachmentExtraction, attachmentTextChange, automaticTags, cachedChatMetadata, 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, searchHistoryClear, sendAttempt, serveSummary, 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, };
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, };
94
95
  export const ENTITIES = {
95
96
  sync_progress: syncProgress,
96
97
  ...MEETING_RESULT_ENTITIES,
@@ -166,6 +167,15 @@ export const ENTITIES = {
166
167
  account_privacy: accountPrivacy,
167
168
  account_privacy_change: accountPrivacyChange,
168
169
  account_profile: accountProfile,
170
+ bot_profile: botProfile,
171
+ bot_template: botTemplate,
172
+ bot_seen_chat: botSeenChat,
173
+ bot_admin: botAdmin,
174
+ bot_menu_entry: botMenuEntry,
175
+ bot_webhook: botWebhook,
176
+ scheduled_job: scheduledJob,
177
+ call_record: callRecord,
178
+ sticker_inventory: stickerInventory,
169
179
  note,
170
180
  "note.hit": v.pick(note, [
171
181
  "kind",
@@ -0,0 +1,83 @@
1
+ import * as v from "valibot";
2
+ export declare const botProfile: v.StrictObjectSchema<{
3
+ readonly name: v.StringSchema<undefined>;
4
+ readonly token: v.StringSchema<undefined>;
5
+ readonly bot: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
6
+ readonly id: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>, undefined>;
7
+ readonly problem: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
8
+ }, undefined>;
9
+ export declare const botSeenChat: v.StrictObjectSchema<{
10
+ readonly title: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
11
+ readonly kind: v.OptionalSchema<v.PicklistSchema<["dialog", "group", "channel", "saved", "unknown"], undefined>, undefined>;
12
+ readonly unread_count: v.OptionalSchema<v.NullableSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>, undefined>, undefined>;
13
+ readonly unread_mentions: v.OptionalSchema<v.OptionalSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>, undefined>, undefined>;
14
+ readonly last_message_at: v.OptionalSchema<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>, undefined>;
15
+ readonly participants_count: v.OptionalSchema<v.NullableSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>, undefined>, undefined>;
16
+ readonly muted: v.OptionalSchema<v.OptionalSchema<v.BooleanSchema<undefined>, undefined>, undefined>;
17
+ readonly archived: v.OptionalSchema<v.OptionalSchema<v.BooleanSchema<undefined>, undefined>, undefined>;
18
+ readonly marked_unread: v.OptionalSchema<v.OptionalSchema<v.BooleanSchema<undefined>, undefined>, undefined>;
19
+ readonly membership_state: v.OptionalSchema<v.OptionalSchema<v.PicklistSchema<["joined", "left", "public", "imported", "archived", "external"], undefined>, undefined>, undefined>;
20
+ readonly scope: v.OptionalSchema<v.OptionalSchema<v.PicklistSchema<["personal", "work"], undefined>, undefined>, undefined>;
21
+ readonly provider_metadata: v.OptionalSchema<v.OptionalSchema<v.RecordSchema<v.StringSchema<undefined>, v.UnknownSchema, undefined>, undefined>, undefined>;
22
+ readonly id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>;
23
+ readonly parent_chat_id: v.OptionalSchema<v.NullableSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>, undefined>, undefined>;
24
+ readonly muted_until: v.OptionalSchema<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>, undefined>;
25
+ readonly first_seen_at: v.OptionalSchema<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>;
26
+ readonly last_seen_at: v.OptionalSchema<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>;
27
+ }, undefined>;
28
+ export declare const botAdmin: v.StrictObjectSchema<{
29
+ readonly id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>;
30
+ readonly name: v.NullableSchema<v.StringSchema<undefined>, undefined>;
31
+ readonly username: v.NullableSchema<v.StringSchema<undefined>, undefined>;
32
+ readonly role: v.PicklistSchema<["owner", "admin"], undefined>;
33
+ readonly rights: v.ArraySchema<v.PicklistSchema<["read", "members", "admins", "info", "pin", "link", "post", "edit", "delete"], undefined>, undefined>;
34
+ readonly title: v.NullableSchema<v.StringSchema<undefined>, undefined>;
35
+ }, undefined>;
36
+ export declare const botMenuEntry: v.StrictObjectSchema<{
37
+ readonly name: v.StringSchema<undefined>;
38
+ readonly description: v.NullableSchema<v.StringSchema<undefined>, undefined>;
39
+ }, undefined>;
40
+ export declare const botWebhook: v.StrictObjectSchema<{
41
+ readonly url: v.StringSchema<undefined>;
42
+ readonly types: v.NullableSchema<v.ArraySchema<v.StringSchema<undefined>, undefined>, undefined>;
43
+ }, undefined>;
44
+ export declare const scheduledJob: v.StrictObjectSchema<{
45
+ readonly name: v.StringSchema<undefined>;
46
+ readonly kind: v.PicklistSchema<["command", "agent"], undefined>;
47
+ readonly when: v.StringSchema<undefined>;
48
+ readonly last: v.NullableSchema<v.StrictObjectSchema<{
49
+ readonly 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`">]>;
50
+ readonly exit_code: v.NumberSchema<undefined>;
51
+ readonly output: v.StringSchema<undefined>;
52
+ readonly trace_id: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
53
+ readonly reason: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
54
+ readonly error_code: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
55
+ readonly failing_since: v.OptionalSchema<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>;
56
+ readonly failures: v.OptionalSchema<v.NumberSchema<undefined>, undefined>;
57
+ }, undefined>, undefined>;
58
+ }, undefined>;
59
+ export declare const botTemplate: v.StrictObjectSchema<{
60
+ readonly name: v.NullableSchema<v.StringSchema<undefined>, undefined>;
61
+ readonly status: v.NullableSchema<v.StringSchema<undefined>, undefined>;
62
+ readonly language: v.NullableSchema<v.StringSchema<undefined>, undefined>;
63
+ readonly category: v.NullableSchema<v.StringSchema<undefined>, undefined>;
64
+ }, undefined>;
65
+ export declare const callRecord: v.StrictObjectSchema<{
66
+ readonly id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>;
67
+ readonly chat_id: v.NullableSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>, undefined>;
68
+ readonly caller_id: v.NullableSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>, undefined>;
69
+ readonly direction: v.PicklistSchema<["incoming", "outgoing"], undefined>;
70
+ readonly outcome: v.PicklistSchema<["answered", "missed", "declined"], undefined>;
71
+ readonly kind: v.PicklistSchema<["audio", "video"], undefined>;
72
+ readonly 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`">]>;
73
+ readonly duration_seconds: v.NullableSchema<v.NumberSchema<undefined>, undefined>;
74
+ }, undefined>;
75
+ export declare const stickerInventory: v.StrictObjectSchema<{
76
+ readonly id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>;
77
+ readonly title: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
78
+ readonly count: v.OptionalSchema<v.NumberSchema<undefined>, undefined>;
79
+ readonly link: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
80
+ readonly set_id: v.OptionalSchema<v.NullableSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>, undefined>, undefined>;
81
+ readonly emoji: v.OptionalSchema<v.ArraySchema<v.StringSchema<undefined>, undefined>, undefined>;
82
+ readonly url: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
83
+ }, undefined>;
@@ -0,0 +1,69 @@
1
+ import * as v from "valibot";
2
+ import { chat } from "./chat.js";
3
+ import { id, text, time } from "./fields.js";
4
+ export const botProfile = v.strictObject({
5
+ name: text,
6
+ token: text,
7
+ bot: v.optional(text),
8
+ id: v.optional(id),
9
+ problem: v.optional(text),
10
+ });
11
+ export const botSeenChat = v.strictObject({
12
+ ...v.partial(v.omit(chat, ["ref", "provider", "account", "description", "invite_link", "settings", "members"]))
13
+ .entries,
14
+ id,
15
+ parent_chat_id: v.optional(v.nullable(id)),
16
+ muted_until: v.optional(v.nullable(time)),
17
+ first_seen_at: v.optional(time),
18
+ last_seen_at: v.optional(time),
19
+ });
20
+ export const botAdmin = v.strictObject({
21
+ id,
22
+ name: v.nullable(text),
23
+ username: v.nullable(text),
24
+ role: v.picklist(["owner", "admin"]),
25
+ rights: v.array(v.picklist(["read", "members", "admins", "info", "pin", "link", "post", "edit", "delete"])),
26
+ title: v.nullable(text),
27
+ });
28
+ export const botMenuEntry = v.strictObject({ name: text, description: v.nullable(text) });
29
+ export const botWebhook = v.strictObject({ url: text, types: v.nullable(v.array(text)) });
30
+ export const scheduledJob = v.strictObject({
31
+ name: text,
32
+ kind: v.picklist(["command", "agent"]),
33
+ when: text,
34
+ last: v.nullable(v.strictObject({
35
+ at: time,
36
+ exit_code: v.number(),
37
+ output: text,
38
+ trace_id: v.optional(text),
39
+ reason: v.optional(text),
40
+ error_code: v.optional(text),
41
+ failing_since: v.optional(time),
42
+ failures: v.optional(v.number()),
43
+ })),
44
+ });
45
+ export const botTemplate = v.strictObject({
46
+ name: v.nullable(text),
47
+ status: v.nullable(text),
48
+ language: v.nullable(text),
49
+ category: v.nullable(text),
50
+ });
51
+ export const callRecord = v.strictObject({
52
+ id,
53
+ chat_id: v.nullable(id),
54
+ caller_id: v.nullable(id),
55
+ direction: v.picklist(["incoming", "outgoing"]),
56
+ outcome: v.picklist(["answered", "missed", "declined"]),
57
+ kind: v.picklist(["audio", "video"]),
58
+ at: time,
59
+ duration_seconds: v.nullable(v.number()),
60
+ });
61
+ export const stickerInventory = v.strictObject({
62
+ id,
63
+ title: v.optional(text),
64
+ count: v.optional(v.number()),
65
+ link: v.optional(v.nullable(text)),
66
+ set_id: v.optional(v.nullable(id)),
67
+ emoji: v.optional(v.array(text)),
68
+ url: v.optional(v.nullable(text)),
69
+ });