@poolzin/pool-bot 2026.2.21 → 2026.2.22
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 +17 -0
- package/dist/agents/api-key-rotation.js +47 -0
- package/dist/agents/apply-patch-update.js +19 -9
- package/dist/agents/apply-patch.js +72 -47
- package/dist/agents/bash-tools.exec.js +141 -559
- package/dist/agents/cli-backends.js +49 -6
- package/dist/agents/cli-runner/helpers.js +69 -152
- package/dist/agents/cli-runner.js +70 -19
- package/dist/agents/identity.js +20 -1
- package/dist/agents/image-sanitization.js +9 -0
- package/dist/agents/live-auth-keys.js +123 -26
- package/dist/agents/live-model-filter.js +13 -4
- package/dist/agents/model-catalog.js +40 -9
- package/dist/agents/model-forward-compat.js +60 -23
- package/dist/agents/model-selection.js +134 -41
- package/dist/agents/pi-auth-json.js +2 -2
- package/dist/agents/pi-embedded-helpers/bootstrap.js +65 -15
- package/dist/agents/pi-embedded-helpers/errors.js +140 -15
- package/dist/agents/pi-embedded-helpers/images.js +22 -12
- package/dist/agents/pi-embedded-helpers.js +2 -2
- package/dist/agents/pi-embedded-runner/abort.js +10 -3
- package/dist/agents/pi-embedded-runner/compact.js +230 -32
- package/dist/agents/pi-embedded-runner/extra-params.js +203 -12
- package/dist/agents/pi-embedded-runner/google.js +109 -19
- package/dist/agents/pi-embedded-runner/history.js +35 -17
- package/dist/agents/pi-embedded-runner/run/attempt.js +386 -95
- package/dist/agents/pi-embedded-runner/run/images.js +81 -55
- package/dist/agents/pi-embedded-runner/run/payloads.js +89 -39
- package/dist/agents/pi-embedded-runner/run.js +193 -25
- package/dist/agents/pi-embedded-runner/run.overflow-compaction.mocks.shared.js +2 -2
- package/dist/agents/pi-embedded-runner/runs.js +17 -8
- package/dist/agents/pi-embedded-runner/tool-result-context-guard.js +262 -0
- package/dist/agents/pi-embedded-runner.js +1 -1
- package/dist/agents/pi-embedded-subscribe.handlers.tools.js +180 -10
- package/dist/agents/pi-embedded-subscribe.js +37 -0
- package/dist/agents/pi-embedded-subscribe.tools.js +127 -30
- package/dist/agents/pi-model-discovery.js +9 -2
- package/dist/agents/pi-tool-definition-adapter.js +60 -8
- package/dist/agents/pi-tools.before-tool-call.js +1 -1
- package/dist/agents/pi-tools.js +113 -94
- package/dist/agents/pi-tools.read.js +337 -38
- package/dist/agents/poolbot-tools.js +14 -5
- package/dist/agents/sandbox/docker.js +10 -5
- package/dist/agents/sandbox/registry.js +96 -46
- package/dist/agents/sandbox/sanitize-env-vars.js +82 -0
- package/dist/agents/sandbox-paths.js +43 -10
- package/dist/agents/session-tool-result-guard-wrapper.js +23 -11
- package/dist/agents/session-tool-result-guard.js +39 -39
- package/dist/agents/session-transcript-repair.js +36 -33
- package/dist/agents/session-write-lock.js +62 -44
- package/dist/agents/skills/frontmatter.js +49 -88
- package/dist/agents/skills/workspace.js +335 -28
- package/dist/agents/subagent-announce.js +508 -174
- package/dist/agents/subagent-registry.js +45 -4
- package/dist/agents/subagent-spawn.js +16 -33
- package/dist/agents/system-prompt-report.js +27 -10
- package/dist/agents/system-prompt.js +26 -32
- package/dist/agents/tool-call-id.js +69 -17
- package/dist/agents/tool-display-common.js +1 -1
- package/dist/agents/tool-images.js +64 -31
- package/dist/agents/tools/canvas-tool.js +17 -11
- package/dist/agents/tools/common.js +37 -19
- package/dist/agents/tools/cron-tool.js +40 -38
- package/dist/agents/tools/gateway.js +70 -2
- package/dist/agents/tools/message-tool.js +181 -40
- package/dist/agents/tools/nodes-tool.js +128 -36
- package/dist/agents/tools/nodes-utils.js +12 -38
- package/dist/agents/tools/session-status-tool.js +24 -71
- package/dist/agents/tools/sessions-helpers.js +38 -210
- package/dist/agents/tools/sessions-spawn-tool.js +28 -198
- package/dist/agents/tools/telegram-actions.js +58 -7
- package/dist/agents/tools/web-fetch-utils.js +112 -7
- package/dist/agents/tools/web-fetch.js +279 -175
- package/dist/agents/tools/web-shared.js +71 -8
- package/dist/agents/usage.js +25 -16
- package/dist/auto-reply/commands-registry.data.js +85 -11
- package/dist/auto-reply/dispatch.js +40 -21
- package/dist/auto-reply/reply/abort.js +102 -33
- package/dist/auto-reply/reply/commands-core.js +82 -33
- package/dist/auto-reply/reply/commands-export-session.js +1 -1
- package/dist/auto-reply/reply/commands-info.js +41 -12
- package/dist/auto-reply/reply/commands-subagents.js +352 -100
- package/dist/auto-reply/reply/commands-system-prompt.js +2 -2
- package/dist/auto-reply/reply/dispatch-from-config.js +100 -29
- package/dist/auto-reply/reply/elevated-unavailable.js +1 -1
- package/dist/auto-reply/reply/inbound-meta.js +12 -1
- package/dist/auto-reply/reply/mentions.js +18 -11
- package/dist/auto-reply/reply/normalize-reply.js +17 -8
- package/dist/auto-reply/reply/reply-dispatcher.js +62 -10
- package/dist/auto-reply/reply/session.js +102 -21
- package/dist/auto-reply/reply/streaming-directives.js +16 -5
- package/dist/auto-reply/status.js +73 -50
- package/dist/browser/extension-relay.js +3 -3
- package/dist/browser/http-auth.js +1 -1
- package/dist/browser/paths.js +2 -2
- package/dist/build-info.json +3 -3
- package/dist/channels/allowlist-match.js +20 -0
- package/dist/channels/allowlists/resolve-utils.js +65 -2
- package/dist/channels/chat-type.js +8 -4
- package/dist/channels/dock.js +127 -35
- package/dist/channels/draft-stream-loop.js +6 -2
- package/dist/channels/plugins/actions/telegram.js +42 -18
- package/dist/channels/plugins/allowlist-match.js +1 -1
- package/dist/channels/plugins/group-mentions.js +51 -41
- package/dist/channels/plugins/message-action-names.js +2 -0
- package/dist/channels/plugins/message-actions.js +24 -5
- package/dist/channels/plugins/normalize/discord.js +26 -4
- package/dist/channels/plugins/normalize/signal.js +35 -22
- package/dist/channels/plugins/onboarding/helpers.js +8 -26
- package/dist/channels/plugins/outbound/imessage.js +15 -14
- package/dist/channels/registry.js +20 -7
- package/dist/cli/acp-cli.js +7 -5
- package/dist/cli/browser-cli-extension.js +25 -12
- package/dist/cli/browser-cli-state.cookies-storage.js +25 -6
- package/dist/cli/browser-cli-state.js +101 -145
- package/dist/cli/command-options.js +28 -0
- package/dist/cli/completion-cli.js +6 -6
- package/dist/cli/cron-cli/register.cron-add.js +25 -1
- package/dist/cli/cron-cli/register.cron-edit.js +44 -0
- package/dist/cli/cron-cli/shared.js +7 -1
- package/dist/cli/daemon-cli/lifecycle-core.js +23 -21
- package/dist/cli/daemon-cli/lifecycle.js +23 -247
- package/dist/cli/daemon-cli/register-service-commands.js +25 -4
- package/dist/cli/daemon-cli.js +1 -0
- package/dist/cli/devices-cli.js +33 -20
- package/dist/cli/gateway-cli/register.js +37 -105
- package/dist/cli/gateway-cli/run.js +49 -11
- package/dist/cli/nodes-camera.js +59 -4
- package/dist/cli/nodes-cli/register.camera.js +27 -24
- package/dist/cli/nodes-cli/rpc.js +21 -38
- package/dist/cli/qr-cli.js +2 -2
- package/dist/cli/skills-cli.format.js +2 -2
- package/dist/cli/update-cli/progress.js +2 -2
- package/dist/cli/update-cli/restart-helper.js +28 -7
- package/dist/cli/update-cli/shared.js +7 -7
- package/dist/cli/update-cli/status.js +1 -1
- package/dist/cli/update-cli/update-command.js +14 -8
- package/dist/cli/update-cli/wizard.js +2 -2
- package/dist/cli/update-cli.js +21 -1027
- package/dist/commands/auth-choice.apply.anthropic.js +10 -2
- package/dist/commands/channels/add-mutators.js +3 -35
- package/dist/commands/channels/add.js +39 -51
- package/dist/commands/config-validation.js +1 -1
- package/dist/commands/configure.gateway-auth.js +52 -15
- package/dist/commands/configure.gateway.js +84 -40
- package/dist/commands/doctor-completion.js +3 -3
- package/dist/commands/doctor-config-flow.js +536 -16
- package/dist/commands/doctor-gateway-services.js +103 -79
- package/dist/commands/doctor-memory-search.js +9 -9
- package/dist/commands/doctor-platform-notes.js +57 -30
- package/dist/commands/doctor-prompter.js +26 -15
- package/dist/commands/doctor-session-locks.js +1 -1
- package/dist/commands/doctor.js +21 -9
- package/dist/commands/model-picker.js +120 -95
- package/dist/commands/models/set.js +2 -21
- package/dist/commands/models/shared.js +65 -37
- package/dist/commands/onboard-helpers.js +81 -39
- package/dist/commands/openai-codex-oauth.js +1 -1
- package/dist/commands/sessions.js +52 -53
- package/dist/commands/status.summary.js +52 -34
- package/dist/commands/test-wizard-helpers.js +2 -2
- package/dist/config/defaults.js +79 -42
- package/dist/config/group-policy.js +50 -18
- package/dist/config/includes.js +37 -10
- package/dist/config/schema.help.js +5 -4
- package/dist/config/schema.hints.js +2 -2
- package/dist/config/schema.labels.js +1 -0
- package/dist/config/sessions/group.js +12 -11
- package/dist/config/sessions/paths.js +137 -11
- package/dist/config/sessions/store.js +185 -65
- package/dist/config/sessions/types.js +15 -1
- package/dist/config/sessions.js +1 -0
- package/dist/config/telegram-custom-commands.js +3 -2
- package/dist/config/types.js +2 -0
- package/dist/config/zod-schema.agent-defaults.js +6 -27
- package/dist/config/zod-schema.agent-runtime.js +171 -79
- package/dist/config/zod-schema.providers-core.js +138 -65
- package/dist/config/zod-schema.session.js +49 -22
- package/dist/control-ui/assets/index-HRr1grwl.js.map +1 -1
- package/dist/cron/isolated-agent/run.js +224 -57
- package/dist/cron/normalize.js +48 -45
- package/dist/cron/run-log.js +14 -0
- package/dist/cron/service/jobs.js +190 -28
- package/dist/cron/service/normalize.js +29 -11
- package/dist/cron/service/store.js +30 -44
- package/dist/cron/service/timer.js +182 -96
- package/dist/cron/service.js +3 -0
- package/dist/cron/stagger.js +37 -0
- package/dist/daemon/inspect.js +132 -92
- package/dist/daemon/runtime-paths.js +25 -4
- package/dist/daemon/service-audit.js +47 -16
- package/dist/discord/accounts.js +23 -20
- package/dist/discord/monitor/agent-components.js +1115 -219
- package/dist/discord/monitor/allow-list.js +114 -34
- package/dist/discord/monitor/listeners.js +204 -97
- package/dist/discord/monitor/message-handler.js +21 -10
- package/dist/discord/monitor/message-handler.preflight.js +195 -101
- package/dist/discord/monitor/message-handler.process.js +384 -123
- package/dist/discord/monitor/message-utils.js +86 -23
- package/dist/discord/monitor/native-command.js +77 -57
- package/dist/discord/monitor/provider.js +122 -117
- package/dist/discord/monitor/reply-context.js +20 -16
- package/dist/discord/monitor/reply-delivery.js +40 -8
- package/dist/discord/monitor/rest-fetch.js +22 -0
- package/dist/discord/monitor/threading.js +117 -24
- package/dist/discord/send.js +2 -1
- package/dist/discord/send.outbound.js +124 -11
- package/dist/discord/send.shared.js +112 -72
- package/dist/discord/voice-message.js +3 -3
- package/dist/gateway/auth.js +119 -44
- package/dist/gateway/call.js +76 -34
- package/dist/gateway/channel-health-monitor.js +57 -50
- package/dist/gateway/client.js +63 -29
- package/dist/gateway/control-ui-contract.js +1 -1
- package/dist/gateway/gateway-config-prompts.shared.js +2 -2
- package/dist/gateway/net.js +109 -1
- package/dist/gateway/protocol/index.js +5 -8
- package/dist/gateway/protocol/schema/agent.js +19 -1
- package/dist/gateway/protocol/schema/channels.js +21 -0
- package/dist/gateway/protocol/schema/cron.js +43 -30
- package/dist/gateway/protocol/schema/protocol-schemas.js +6 -11
- package/dist/gateway/protocol/schema/sessions.js +5 -1
- package/dist/gateway/protocol/schema.js +0 -1
- package/dist/gateway/server/presence-events.js +12 -0
- package/dist/gateway/server/ws-connection/message-handler.js +203 -212
- package/dist/gateway/server/ws-connection.js +58 -21
- package/dist/gateway/server-broadcast.js +18 -13
- package/dist/gateway/server-cron.js +177 -10
- package/dist/gateway/server-methods/agent-job.js +131 -38
- package/dist/gateway/server-methods/send.js +60 -14
- package/dist/gateway/server-methods/sessions.js +160 -96
- package/dist/gateway/server-methods/system.js +5 -7
- package/dist/gateway/server-methods-list.js +8 -0
- package/dist/gateway/server-methods.js +24 -8
- package/dist/gateway/server-node-events.js +278 -68
- package/dist/gateway/session-utils.fs.js +316 -75
- package/dist/gateway/session-utils.js +224 -70
- package/dist/gateway/sessions-patch.js +63 -20
- package/dist/gateway/test-temp-config.js +1 -1
- package/dist/gateway/tools-invoke-http.js +118 -70
- package/dist/gateway/ws-log.js +135 -107
- package/dist/hooks/frontmatter.js +36 -82
- package/dist/hooks/install.js +149 -139
- package/dist/hooks/internal-hooks.js +29 -4
- package/dist/hooks/plugin-hooks.js +2 -1
- package/dist/imessage/monitor/deliver.js +10 -4
- package/dist/imessage/monitor/monitor-provider.js +138 -375
- package/dist/imessage/monitor/runtime.js +4 -8
- package/dist/imessage/send.js +65 -19
- package/dist/infra/exec-approvals-allowlist.js +7 -0
- package/dist/infra/exec-approvals.js +35 -920
- package/dist/infra/exec-safe-bin-trust.js +64 -0
- package/dist/infra/heartbeat-runner.js +207 -134
- package/dist/infra/heartbeat-wake.js +183 -22
- package/dist/infra/install-source-utils.js +47 -0
- package/dist/infra/net/ssrf.js +170 -36
- package/dist/infra/outbound/deliver.js +224 -58
- package/dist/infra/outbound/message-action-spec.js +12 -5
- package/dist/infra/outbound/outbound-session.js +27 -25
- package/dist/infra/poolbot-root.js +32 -22
- package/dist/infra/ports.js +14 -11
- package/dist/infra/skills-remote.js +48 -37
- package/dist/infra/system-events.js +25 -11
- package/dist/infra/system-presence.js +26 -33
- package/dist/infra/tmp-poolbot-dir.js +81 -2
- package/dist/infra/wsl.js +37 -1
- package/dist/line/bot-message-context.js +163 -191
- package/dist/logging/subsystem.js +59 -22
- package/dist/markdown/ir.js +124 -50
- package/dist/media/store.js +1 -1
- package/dist/media-understanding/runner.entries.js +42 -25
- package/dist/media-understanding/runner.js +53 -488
- package/dist/memory/embeddings-gemini.js +53 -38
- package/dist/memory/manager-embedding-ops.js +48 -69
- package/dist/pairing/pairing-store.js +178 -119
- package/dist/plugin-sdk/index.js +34 -6
- package/dist/plugins/hooks.js +135 -14
- package/dist/plugins/install.js +190 -152
- package/dist/polls.js +11 -0
- package/dist/routing/resolve-route.js +190 -56
- package/dist/routing/session-key.js +38 -22
- package/dist/runtime.js +35 -9
- package/dist/security/audit-channel.js +1 -1
- package/dist/sessions/session-key-utils.js +29 -11
- package/dist/shared/frontmatter.js +5 -5
- package/dist/shared/node-list-types.js +1 -0
- package/dist/shared/string-normalization.js +15 -0
- package/dist/signal/monitor/event-handler.js +68 -36
- package/dist/signal/send.js +29 -37
- package/dist/slack/monitor/allow-list.js +10 -11
- package/dist/slack/monitor/commands.js +14 -3
- package/dist/slack/monitor/events/interactions.js +4 -4
- package/dist/slack/monitor/media.js +224 -16
- package/dist/slack/monitor/message-handler/dispatch.js +247 -13
- package/dist/slack/monitor/message-handler/prepare.js +128 -45
- package/dist/slack/monitor/slash.js +357 -144
- package/dist/slack/streaming.js +77 -0
- package/dist/telegram/accounts.js +40 -13
- package/dist/telegram/allowed-updates.js +3 -0
- package/dist/telegram/bot/delivery.js +129 -66
- package/dist/telegram/bot/helpers.js +136 -122
- package/dist/telegram/bot-handlers.js +600 -339
- package/dist/telegram/bot-message-context.js +115 -73
- package/dist/telegram/bot-message-dispatch.js +235 -104
- package/dist/telegram/bot-native-command-menu.js +3 -1
- package/dist/telegram/bot-native-commands.js +213 -193
- package/dist/telegram/bot.js +24 -132
- package/dist/telegram/draft-stream.js +84 -75
- package/dist/telegram/format.js +150 -6
- package/dist/telegram/send.js +415 -255
- package/dist/telegram/targets.js +21 -2
- package/dist/telegram/update-offset-store.js +19 -3
- package/dist/terminal/restore.js +5 -2
- package/dist/test-utils/fetch-mock.js +5 -0
- package/dist/version.js +18 -5
- package/dist/web/auto-reply/monitor/broadcast.js +7 -3
- package/dist/web/auto-reply/monitor/on-message.js +6 -3
- package/dist/web/inbound/media.js +34 -8
- package/dist/web/inbound/monitor.js +34 -17
- package/dist/web/inbound/send-api.js +18 -17
- package/dist/web/outbound.js +12 -5
- package/dist/wizard/clack-prompter.js +40 -7
- package/extensions/bluebubbles/package.json +1 -1
- package/extensions/copilot-proxy/package.json +1 -1
- package/extensions/diagnostics-otel/package.json +1 -1
- package/extensions/discord/package.json +1 -1
- package/extensions/feishu/package.json +1 -1
- package/extensions/google-antigravity-auth/package.json +1 -1
- package/extensions/google-gemini-cli-auth/package.json +1 -1
- package/extensions/googlechat/package.json +1 -1
- package/extensions/imessage/package.json +1 -1
- package/extensions/irc/package.json +1 -1
- package/extensions/line/package.json +1 -1
- package/extensions/llm-task/package.json +1 -1
- package/extensions/lobster/package.json +1 -1
- package/extensions/matrix/CHANGELOG.md +5 -0
- package/extensions/matrix/package.json +1 -1
- package/extensions/mattermost/package.json +1 -1
- package/extensions/memory-core/package.json +1 -1
- package/extensions/memory-lancedb/package.json +1 -1
- package/extensions/minimax-portal-auth/package.json +1 -1
- package/extensions/msteams/CHANGELOG.md +5 -0
- package/extensions/msteams/package.json +1 -1
- package/extensions/nextcloud-talk/package.json +1 -1
- package/extensions/nostr/CHANGELOG.md +5 -0
- package/extensions/nostr/package.json +1 -1
- package/extensions/open-prose/package.json +1 -1
- package/extensions/openai-codex-auth/package.json +1 -1
- package/extensions/signal/package.json +1 -1
- package/extensions/slack/package.json +1 -1
- package/extensions/telegram/package.json +1 -1
- package/extensions/tlon/package.json +1 -1
- package/extensions/twitch/CHANGELOG.md +5 -0
- package/extensions/twitch/package.json +1 -1
- package/extensions/voice-call/CHANGELOG.md +5 -0
- package/extensions/voice-call/package.json +1 -1
- package/extensions/whatsapp/package.json +1 -1
- package/extensions/zalo/CHANGELOG.md +5 -0
- package/extensions/zalo/package.json +1 -1
- package/extensions/zalouser/CHANGELOG.md +5 -0
- package/extensions/zalouser/package.json +1 -1
- package/package.json +1 -1
- package/skills/apple-reminders/SKILL.md +100 -49
- package/skills/coding-agent/SKILL.md +34 -28
- package/skills/github/SKILL.md +131 -16
- package/skills/imsg/SKILL.md +112 -15
- package/skills/openhue/SKILL.md +101 -19
- package/skills/tmux/SKILL.md +111 -79
- package/skills/weather/SKILL.md +88 -25
|
@@ -1,9 +1,16 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
|
-
import {
|
|
2
|
+
import { normalizeTelegramCommandDescription, normalizeTelegramCommandName, resolveTelegramCustomCommands, } from "./telegram-custom-commands.js";
|
|
3
3
|
import { ToolPolicySchema } from "./zod-schema.agent-runtime.js";
|
|
4
4
|
import { ChannelHeartbeatVisibilitySchema } from "./zod-schema.channels.js";
|
|
5
|
-
import {
|
|
5
|
+
import { BlockStreamingChunkSchema, BlockStreamingCoalesceSchema, DmConfigSchema, DmPolicySchema, ExecutableTokenSchema, GroupPolicySchema, HexColorSchema, MarkdownConfigSchema, MSTeamsReplyStyleSchema, ProviderCommandsSchema, ReplyToModeSchema, RetryConfigSchema, requireOpenAllowFrom, } from "./zod-schema.core.js";
|
|
6
|
+
import { sensitive } from "./zod-schema.sensitive.js";
|
|
6
7
|
const ToolPolicyBySenderSchema = z.record(z.string(), ToolPolicySchema).optional();
|
|
8
|
+
const DiscordIdSchema = z
|
|
9
|
+
.union([z.string(), z.number()])
|
|
10
|
+
.refine((value) => typeof value === "string", {
|
|
11
|
+
message: "Discord IDs must be strings (wrap numeric IDs in quotes).",
|
|
12
|
+
});
|
|
13
|
+
const DiscordIdListSchema = z.array(DiscordIdSchema);
|
|
7
14
|
const TelegramInlineButtonsScopeSchema = z.enum(["off", "dm", "group", "all", "allowlist"]);
|
|
8
15
|
const TelegramCapabilitiesSchema = z.union([
|
|
9
16
|
z.array(z.string()),
|
|
@@ -16,6 +23,7 @@ const TelegramCapabilitiesSchema = z.union([
|
|
|
16
23
|
export const TelegramTopicSchema = z
|
|
17
24
|
.object({
|
|
18
25
|
requireMention: z.boolean().optional(),
|
|
26
|
+
groupPolicy: GroupPolicySchema.optional(),
|
|
19
27
|
skills: z.array(z.string()).optional(),
|
|
20
28
|
enabled: z.boolean().optional(),
|
|
21
29
|
allowFrom: z.array(z.union([z.string(), z.number()])).optional(),
|
|
@@ -42,8 +50,9 @@ const TelegramCustomCommandSchema = z
|
|
|
42
50
|
})
|
|
43
51
|
.strict();
|
|
44
52
|
const validateTelegramCustomCommands = (value, ctx) => {
|
|
45
|
-
if (!value.customCommands || value.customCommands.length === 0)
|
|
53
|
+
if (!value.customCommands || value.customCommands.length === 0) {
|
|
46
54
|
return;
|
|
55
|
+
}
|
|
47
56
|
const { issues } = resolveTelegramCustomCommands({
|
|
48
57
|
commands: value.customCommands,
|
|
49
58
|
checkReserved: false,
|
|
@@ -67,7 +76,7 @@ export const TelegramAccountSchemaBase = z
|
|
|
67
76
|
customCommands: z.array(TelegramCustomCommandSchema).optional(),
|
|
68
77
|
configWrites: z.boolean().optional(),
|
|
69
78
|
dmPolicy: DmPolicySchema.optional().default("pairing"),
|
|
70
|
-
botToken: z.string().optional(),
|
|
79
|
+
botToken: z.string().optional().register(sensitive),
|
|
71
80
|
tokenFile: z.string().optional(),
|
|
72
81
|
replyToMode: ReplyToModeSchema.optional(),
|
|
73
82
|
groups: z.record(z.string(), TelegramGroupSchema.optional()).optional(),
|
|
@@ -94,8 +103,9 @@ export const TelegramAccountSchemaBase = z
|
|
|
94
103
|
.optional(),
|
|
95
104
|
proxy: z.string().optional(),
|
|
96
105
|
webhookUrl: z.string().optional(),
|
|
97
|
-
webhookSecret: z.string().optional(),
|
|
106
|
+
webhookSecret: z.string().optional().register(sensitive),
|
|
98
107
|
webhookPath: z.string().optional(),
|
|
108
|
+
webhookHost: z.string().optional(),
|
|
99
109
|
actions: z
|
|
100
110
|
.object({
|
|
101
111
|
reactions: z.boolean().optional(),
|
|
@@ -110,6 +120,7 @@ export const TelegramAccountSchemaBase = z
|
|
|
110
120
|
heartbeat: ChannelHeartbeatVisibilitySchema,
|
|
111
121
|
linkPreview: z.boolean().optional(),
|
|
112
122
|
responsePrefix: z.string().optional(),
|
|
123
|
+
ackReaction: z.string().optional(),
|
|
113
124
|
})
|
|
114
125
|
.strict();
|
|
115
126
|
export const TelegramAccountSchema = TelegramAccountSchemaBase.superRefine((value, ctx) => {
|
|
@@ -169,21 +180,12 @@ export const TelegramConfigSchema = TelegramAccountSchemaBase.extend({
|
|
|
169
180
|
export const DiscordDmSchema = z
|
|
170
181
|
.object({
|
|
171
182
|
enabled: z.boolean().optional(),
|
|
172
|
-
policy: DmPolicySchema.optional()
|
|
173
|
-
allowFrom:
|
|
183
|
+
policy: DmPolicySchema.optional(),
|
|
184
|
+
allowFrom: DiscordIdListSchema.optional(),
|
|
174
185
|
groupEnabled: z.boolean().optional(),
|
|
175
|
-
groupChannels:
|
|
186
|
+
groupChannels: DiscordIdListSchema.optional(),
|
|
176
187
|
})
|
|
177
|
-
.strict()
|
|
178
|
-
.superRefine((value, ctx) => {
|
|
179
|
-
requireOpenAllowFrom({
|
|
180
|
-
policy: value.policy,
|
|
181
|
-
allowFrom: value.allowFrom,
|
|
182
|
-
ctx,
|
|
183
|
-
path: ["allowFrom"],
|
|
184
|
-
message: 'channels.discord.dm.policy="open" requires channels.discord.dm.allowFrom to include "*"',
|
|
185
|
-
});
|
|
186
|
-
});
|
|
188
|
+
.strict();
|
|
187
189
|
export const DiscordGuildChannelSchema = z
|
|
188
190
|
.object({
|
|
189
191
|
allow: z.boolean().optional(),
|
|
@@ -192,7 +194,8 @@ export const DiscordGuildChannelSchema = z
|
|
|
192
194
|
toolsBySender: ToolPolicyBySenderSchema,
|
|
193
195
|
skills: z.array(z.string()).optional(),
|
|
194
196
|
enabled: z.boolean().optional(),
|
|
195
|
-
users:
|
|
197
|
+
users: DiscordIdListSchema.optional(),
|
|
198
|
+
roles: DiscordIdListSchema.optional(),
|
|
196
199
|
systemPrompt: z.string().optional(),
|
|
197
200
|
includeThreadStarter: z.boolean().optional(),
|
|
198
201
|
autoThread: z.boolean().optional(),
|
|
@@ -205,10 +208,22 @@ export const DiscordGuildSchema = z
|
|
|
205
208
|
tools: ToolPolicySchema,
|
|
206
209
|
toolsBySender: ToolPolicyBySenderSchema,
|
|
207
210
|
reactionNotifications: z.enum(["off", "own", "all", "allowlist"]).optional(),
|
|
208
|
-
users:
|
|
211
|
+
users: DiscordIdListSchema.optional(),
|
|
212
|
+
roles: DiscordIdListSchema.optional(),
|
|
209
213
|
channels: z.record(z.string(), DiscordGuildChannelSchema.optional()).optional(),
|
|
210
214
|
})
|
|
211
215
|
.strict();
|
|
216
|
+
const DiscordUiSchema = z
|
|
217
|
+
.object({
|
|
218
|
+
components: z
|
|
219
|
+
.object({
|
|
220
|
+
accentColor: HexColorSchema.optional(),
|
|
221
|
+
})
|
|
222
|
+
.strict()
|
|
223
|
+
.optional(),
|
|
224
|
+
})
|
|
225
|
+
.strict()
|
|
226
|
+
.optional();
|
|
212
227
|
export const DiscordAccountSchema = z
|
|
213
228
|
.object({
|
|
214
229
|
name: z.string().optional(),
|
|
@@ -217,7 +232,8 @@ export const DiscordAccountSchema = z
|
|
|
217
232
|
enabled: z.boolean().optional(),
|
|
218
233
|
commands: ProviderCommandsSchema,
|
|
219
234
|
configWrites: z.boolean().optional(),
|
|
220
|
-
token: z.string().optional(),
|
|
235
|
+
token: z.string().optional().register(sensitive),
|
|
236
|
+
proxy: z.string().optional(),
|
|
221
237
|
allowBots: z.boolean().optional(),
|
|
222
238
|
groupPolicy: GroupPolicySchema.optional().default("allowlist"),
|
|
223
239
|
historyLimit: z.number().int().min(0).optional(),
|
|
@@ -255,19 +271,25 @@ export const DiscordAccountSchema = z
|
|
|
255
271
|
.strict()
|
|
256
272
|
.optional(),
|
|
257
273
|
replyToMode: ReplyToModeSchema.optional(),
|
|
274
|
+
// Aliases for channels.discord.dm.policy / channels.discord.dm.allowFrom. Prefer these for
|
|
275
|
+
// inheritance in multi-account setups (shallow merge works; nested dm object doesn't).
|
|
276
|
+
dmPolicy: DmPolicySchema.optional(),
|
|
277
|
+
allowFrom: DiscordIdListSchema.optional(),
|
|
258
278
|
dm: DiscordDmSchema.optional(),
|
|
259
279
|
guilds: z.record(z.string(), DiscordGuildSchema.optional()).optional(),
|
|
260
280
|
heartbeat: ChannelHeartbeatVisibilitySchema,
|
|
261
281
|
execApprovals: z
|
|
262
282
|
.object({
|
|
263
283
|
enabled: z.boolean().optional(),
|
|
264
|
-
approvers:
|
|
284
|
+
approvers: DiscordIdListSchema.optional(),
|
|
265
285
|
agentFilter: z.array(z.string()).optional(),
|
|
266
286
|
sessionFilter: z.array(z.string()).optional(),
|
|
267
287
|
cleanupAfterResolve: z.boolean().optional(),
|
|
288
|
+
target: z.enum(["dm", "channel", "both"]).optional(),
|
|
268
289
|
})
|
|
269
290
|
.strict()
|
|
270
291
|
.optional(),
|
|
292
|
+
ui: DiscordUiSchema,
|
|
271
293
|
intents: z
|
|
272
294
|
.object({
|
|
273
295
|
presence: z.boolean().optional(),
|
|
@@ -278,13 +300,58 @@ export const DiscordAccountSchema = z
|
|
|
278
300
|
pluralkit: z
|
|
279
301
|
.object({
|
|
280
302
|
enabled: z.boolean().optional(),
|
|
281
|
-
token: z.string().optional(),
|
|
303
|
+
token: z.string().optional().register(sensitive),
|
|
282
304
|
})
|
|
283
305
|
.strict()
|
|
284
306
|
.optional(),
|
|
285
307
|
responsePrefix: z.string().optional(),
|
|
308
|
+
ackReaction: z.string().optional(),
|
|
309
|
+
activity: z.string().optional(),
|
|
310
|
+
status: z.enum(["online", "dnd", "idle", "invisible"]).optional(),
|
|
311
|
+
activityType: z
|
|
312
|
+
.union([z.literal(0), z.literal(1), z.literal(2), z.literal(3), z.literal(4), z.literal(5)])
|
|
313
|
+
.optional(),
|
|
314
|
+
activityUrl: z.string().url().optional(),
|
|
286
315
|
})
|
|
287
|
-
.strict()
|
|
316
|
+
.strict()
|
|
317
|
+
.superRefine((value, ctx) => {
|
|
318
|
+
const activityText = typeof value.activity === "string" ? value.activity.trim() : "";
|
|
319
|
+
const hasActivity = Boolean(activityText);
|
|
320
|
+
const hasActivityType = value.activityType !== undefined;
|
|
321
|
+
const activityUrl = typeof value.activityUrl === "string" ? value.activityUrl.trim() : "";
|
|
322
|
+
const hasActivityUrl = Boolean(activityUrl);
|
|
323
|
+
if ((hasActivityType || hasActivityUrl) && !hasActivity) {
|
|
324
|
+
ctx.addIssue({
|
|
325
|
+
code: z.ZodIssueCode.custom,
|
|
326
|
+
message: "channels.discord.activity is required when activityType or activityUrl is set",
|
|
327
|
+
path: ["activity"],
|
|
328
|
+
});
|
|
329
|
+
}
|
|
330
|
+
if (value.activityType === 1 && !hasActivityUrl) {
|
|
331
|
+
ctx.addIssue({
|
|
332
|
+
code: z.ZodIssueCode.custom,
|
|
333
|
+
message: "channels.discord.activityUrl is required when activityType is 1 (Streaming)",
|
|
334
|
+
path: ["activityUrl"],
|
|
335
|
+
});
|
|
336
|
+
}
|
|
337
|
+
if (hasActivityUrl && value.activityType !== 1) {
|
|
338
|
+
ctx.addIssue({
|
|
339
|
+
code: z.ZodIssueCode.custom,
|
|
340
|
+
message: "channels.discord.activityType must be 1 (Streaming) when activityUrl is set",
|
|
341
|
+
path: ["activityType"],
|
|
342
|
+
});
|
|
343
|
+
}
|
|
344
|
+
const dmPolicy = value.dmPolicy ?? value.dm?.policy ?? "pairing";
|
|
345
|
+
const allowFrom = value.allowFrom ?? value.dm?.allowFrom;
|
|
346
|
+
const allowFromPath = value.allowFrom !== undefined ? ["allowFrom"] : ["dm", "allowFrom"];
|
|
347
|
+
requireOpenAllowFrom({
|
|
348
|
+
policy: dmPolicy,
|
|
349
|
+
allowFrom,
|
|
350
|
+
ctx,
|
|
351
|
+
path: [...allowFromPath],
|
|
352
|
+
message: 'channels.discord.dmPolicy="open" requires channels.discord.allowFrom (or channels.discord.dm.allowFrom) to include "*"',
|
|
353
|
+
});
|
|
354
|
+
});
|
|
288
355
|
export const DiscordConfigSchema = DiscordAccountSchema.extend({
|
|
289
356
|
accounts: z.record(z.string(), DiscordAccountSchema.optional()).optional(),
|
|
290
357
|
});
|
|
@@ -338,6 +405,7 @@ export const GoogleChatAccountSchema = z
|
|
|
338
405
|
chunkMode: z.enum(["length", "newline"]).optional(),
|
|
339
406
|
blockStreaming: z.boolean().optional(),
|
|
340
407
|
blockStreamingCoalesce: BlockStreamingCoalesceSchema.optional(),
|
|
408
|
+
streamMode: z.enum(["replace", "status_final", "append"]).optional().default("replace"),
|
|
341
409
|
mediaMaxMb: z.number().positive().optional(),
|
|
342
410
|
replyToMode: ReplyToModeSchema.optional(),
|
|
343
411
|
actions: z
|
|
@@ -358,22 +426,13 @@ export const GoogleChatConfigSchema = GoogleChatAccountSchema.extend({
|
|
|
358
426
|
export const SlackDmSchema = z
|
|
359
427
|
.object({
|
|
360
428
|
enabled: z.boolean().optional(),
|
|
361
|
-
policy: DmPolicySchema.optional()
|
|
429
|
+
policy: DmPolicySchema.optional(),
|
|
362
430
|
allowFrom: z.array(z.union([z.string(), z.number()])).optional(),
|
|
363
431
|
groupEnabled: z.boolean().optional(),
|
|
364
432
|
groupChannels: z.array(z.union([z.string(), z.number()])).optional(),
|
|
365
433
|
replyToMode: ReplyToModeSchema.optional(),
|
|
366
434
|
})
|
|
367
|
-
.strict()
|
|
368
|
-
.superRefine((value, ctx) => {
|
|
369
|
-
requireOpenAllowFrom({
|
|
370
|
-
policy: value.policy,
|
|
371
|
-
allowFrom: value.allowFrom,
|
|
372
|
-
ctx,
|
|
373
|
-
path: ["allowFrom"],
|
|
374
|
-
message: 'channels.slack.dm.policy="open" requires channels.slack.dm.allowFrom to include "*"',
|
|
375
|
-
});
|
|
376
|
-
});
|
|
435
|
+
.strict();
|
|
377
436
|
export const SlackChannelSchema = z
|
|
378
437
|
.object({
|
|
379
438
|
enabled: z.boolean().optional(),
|
|
@@ -391,6 +450,7 @@ export const SlackThreadSchema = z
|
|
|
391
450
|
.object({
|
|
392
451
|
historyScope: z.enum(["thread", "channel"]).optional(),
|
|
393
452
|
inheritParent: z.boolean().optional(),
|
|
453
|
+
initialHistoryLimit: z.number().int().min(0).optional(),
|
|
394
454
|
})
|
|
395
455
|
.strict();
|
|
396
456
|
const SlackReplyToModeByChatTypeSchema = z
|
|
@@ -404,16 +464,16 @@ export const SlackAccountSchema = z
|
|
|
404
464
|
.object({
|
|
405
465
|
name: z.string().optional(),
|
|
406
466
|
mode: z.enum(["socket", "http"]).optional(),
|
|
407
|
-
signingSecret: z.string().optional(),
|
|
467
|
+
signingSecret: z.string().optional().register(sensitive),
|
|
408
468
|
webhookPath: z.string().optional(),
|
|
409
469
|
capabilities: z.array(z.string()).optional(),
|
|
410
470
|
markdown: MarkdownConfigSchema,
|
|
411
471
|
enabled: z.boolean().optional(),
|
|
412
472
|
commands: ProviderCommandsSchema,
|
|
413
473
|
configWrites: z.boolean().optional(),
|
|
414
|
-
botToken: z.string().optional(),
|
|
415
|
-
appToken: z.string().optional(),
|
|
416
|
-
userToken: z.string().optional(),
|
|
474
|
+
botToken: z.string().optional().register(sensitive),
|
|
475
|
+
appToken: z.string().optional().register(sensitive),
|
|
476
|
+
userToken: z.string().optional().register(sensitive),
|
|
417
477
|
userTokenReadOnly: z.boolean().optional().default(true),
|
|
418
478
|
allowBots: z.boolean().optional(),
|
|
419
479
|
requireMention: z.boolean().optional(),
|
|
@@ -425,6 +485,7 @@ export const SlackAccountSchema = z
|
|
|
425
485
|
chunkMode: z.enum(["length", "newline"]).optional(),
|
|
426
486
|
blockStreaming: z.boolean().optional(),
|
|
427
487
|
blockStreamingCoalesce: BlockStreamingCoalesceSchema.optional(),
|
|
488
|
+
streaming: z.boolean().optional(),
|
|
428
489
|
mediaMaxMb: z.number().positive().optional(),
|
|
429
490
|
reactionNotifications: z.enum(["off", "own", "all", "allowlist"]).optional(),
|
|
430
491
|
reactionAllowlist: z.array(z.union([z.string(), z.number()])).optional(),
|
|
@@ -453,15 +514,32 @@ export const SlackAccountSchema = z
|
|
|
453
514
|
})
|
|
454
515
|
.strict()
|
|
455
516
|
.optional(),
|
|
517
|
+
// Aliases for channels.slack.dm.policy / channels.slack.dm.allowFrom. Prefer these for
|
|
518
|
+
// inheritance in multi-account setups (shallow merge works; nested dm object doesn't).
|
|
519
|
+
dmPolicy: DmPolicySchema.optional(),
|
|
520
|
+
allowFrom: z.array(z.union([z.string(), z.number()])).optional(),
|
|
456
521
|
dm: SlackDmSchema.optional(),
|
|
457
522
|
channels: z.record(z.string(), SlackChannelSchema.optional()).optional(),
|
|
458
523
|
heartbeat: ChannelHeartbeatVisibilitySchema,
|
|
459
524
|
responsePrefix: z.string().optional(),
|
|
525
|
+
ackReaction: z.string().optional(),
|
|
460
526
|
})
|
|
461
|
-
.strict()
|
|
462
|
-
|
|
527
|
+
.strict()
|
|
528
|
+
.superRefine((value, ctx) => {
|
|
529
|
+
const dmPolicy = value.dmPolicy ?? value.dm?.policy ?? "pairing";
|
|
530
|
+
const allowFrom = value.allowFrom ?? value.dm?.allowFrom;
|
|
531
|
+
const allowFromPath = value.allowFrom !== undefined ? ["allowFrom"] : ["dm", "allowFrom"];
|
|
532
|
+
requireOpenAllowFrom({
|
|
533
|
+
policy: dmPolicy,
|
|
534
|
+
allowFrom,
|
|
535
|
+
ctx,
|
|
536
|
+
path: [...allowFromPath],
|
|
537
|
+
message: 'channels.slack.dmPolicy="open" requires channels.slack.allowFrom (or channels.slack.dm.allowFrom) to include "*"',
|
|
538
|
+
});
|
|
539
|
+
});
|
|
540
|
+
export const SlackConfigSchema = SlackAccountSchema.safeExtend({
|
|
463
541
|
mode: z.enum(["socket", "http"]).optional().default("socket"),
|
|
464
|
-
signingSecret: z.string().optional(),
|
|
542
|
+
signingSecret: z.string().optional().register(sensitive),
|
|
465
543
|
webhookPath: z.string().optional().default("/slack/events"),
|
|
466
544
|
accounts: z.record(z.string(), SlackAccountSchema.optional()).optional(),
|
|
467
545
|
}).superRefine((value, ctx) => {
|
|
@@ -473,16 +551,20 @@ export const SlackConfigSchema = SlackAccountSchema.extend({
|
|
|
473
551
|
path: ["signingSecret"],
|
|
474
552
|
});
|
|
475
553
|
}
|
|
476
|
-
if (!value.accounts)
|
|
554
|
+
if (!value.accounts) {
|
|
477
555
|
return;
|
|
556
|
+
}
|
|
478
557
|
for (const [accountId, account] of Object.entries(value.accounts)) {
|
|
479
|
-
if (!account)
|
|
558
|
+
if (!account) {
|
|
480
559
|
continue;
|
|
481
|
-
|
|
560
|
+
}
|
|
561
|
+
if (account.enabled === false) {
|
|
482
562
|
continue;
|
|
563
|
+
}
|
|
483
564
|
const accountMode = account.mode ?? baseMode;
|
|
484
|
-
if (accountMode !== "http")
|
|
565
|
+
if (accountMode !== "http") {
|
|
485
566
|
continue;
|
|
567
|
+
}
|
|
486
568
|
const accountSecret = account.signingSecret ?? value.signingSecret;
|
|
487
569
|
if (!accountSecret) {
|
|
488
570
|
ctx.addIssue({
|
|
@@ -571,7 +653,7 @@ export const IrcNickServSchema = z
|
|
|
571
653
|
.object({
|
|
572
654
|
enabled: z.boolean().optional(),
|
|
573
655
|
service: z.string().optional(),
|
|
574
|
-
password: z.string().optional(),
|
|
656
|
+
password: z.string().optional().register(sensitive),
|
|
575
657
|
passwordFile: z.string().optional(),
|
|
576
658
|
register: z.boolean().optional(),
|
|
577
659
|
registerEmail: z.string().optional(),
|
|
@@ -590,7 +672,7 @@ export const IrcAccountSchemaBase = z
|
|
|
590
672
|
nick: z.string().optional(),
|
|
591
673
|
username: z.string().optional(),
|
|
592
674
|
realname: z.string().optional(),
|
|
593
|
-
password: z.string().optional(),
|
|
675
|
+
password: z.string().optional().register(sensitive),
|
|
594
676
|
passwordFile: z.string().optional(),
|
|
595
677
|
nickserv: IrcNickServSchema.optional(),
|
|
596
678
|
channels: z.array(z.string()).optional(),
|
|
@@ -612,7 +694,7 @@ export const IrcAccountSchemaBase = z
|
|
|
612
694
|
responsePrefix: z.string().optional(),
|
|
613
695
|
})
|
|
614
696
|
.strict();
|
|
615
|
-
|
|
697
|
+
function refineIrcAllowFromAndNickserv(value, ctx) {
|
|
616
698
|
requireOpenAllowFrom({
|
|
617
699
|
policy: value.dmPolicy,
|
|
618
700
|
allowFrom: value.allowFrom,
|
|
@@ -627,24 +709,14 @@ export const IrcAccountSchema = IrcAccountSchemaBase.superRefine((value, ctx) =>
|
|
|
627
709
|
message: "channels.irc.nickserv.register=true requires channels.irc.nickserv.registerEmail",
|
|
628
710
|
});
|
|
629
711
|
}
|
|
712
|
+
}
|
|
713
|
+
export const IrcAccountSchema = IrcAccountSchemaBase.superRefine((value, ctx) => {
|
|
714
|
+
refineIrcAllowFromAndNickserv(value, ctx);
|
|
630
715
|
});
|
|
631
716
|
export const IrcConfigSchema = IrcAccountSchemaBase.extend({
|
|
632
717
|
accounts: z.record(z.string(), IrcAccountSchema.optional()).optional(),
|
|
633
718
|
}).superRefine((value, ctx) => {
|
|
634
|
-
|
|
635
|
-
policy: value.dmPolicy,
|
|
636
|
-
allowFrom: value.allowFrom,
|
|
637
|
-
ctx,
|
|
638
|
-
path: ["allowFrom"],
|
|
639
|
-
message: 'channels.irc.dmPolicy="open" requires channels.irc.allowFrom to include "*"',
|
|
640
|
-
});
|
|
641
|
-
if (value.nickserv?.register && !value.nickserv.registerEmail?.trim()) {
|
|
642
|
-
ctx.addIssue({
|
|
643
|
-
code: z.ZodIssueCode.custom,
|
|
644
|
-
path: ["nickserv", "registerEmail"],
|
|
645
|
-
message: "channels.irc.nickserv.register=true requires channels.irc.nickserv.registerEmail",
|
|
646
|
-
});
|
|
647
|
-
}
|
|
719
|
+
refineIrcAllowFromAndNickserv(value, ctx);
|
|
648
720
|
});
|
|
649
721
|
export const IMessageAccountSchemaBase = z
|
|
650
722
|
.object({
|
|
@@ -737,7 +809,7 @@ export const BlueBubblesAccountSchemaBase = z
|
|
|
737
809
|
configWrites: z.boolean().optional(),
|
|
738
810
|
enabled: z.boolean().optional(),
|
|
739
811
|
serverUrl: z.string().optional(),
|
|
740
|
-
password: z.string().optional(),
|
|
812
|
+
password: z.string().optional().register(sensitive),
|
|
741
813
|
webhookPath: z.string().optional(),
|
|
742
814
|
dmPolicy: DmPolicySchema.optional().default("pairing"),
|
|
743
815
|
allowFrom: z.array(BlueBubblesAllowFromEntry).optional(),
|
|
@@ -749,6 +821,7 @@ export const BlueBubblesAccountSchemaBase = z
|
|
|
749
821
|
textChunkLimit: z.number().int().positive().optional(),
|
|
750
822
|
chunkMode: z.enum(["length", "newline"]).optional(),
|
|
751
823
|
mediaMaxMb: z.number().int().positive().optional(),
|
|
824
|
+
mediaLocalRoots: z.array(z.string()).optional(),
|
|
752
825
|
sendReadReceipts: z.boolean().optional(),
|
|
753
826
|
blockStreaming: z.boolean().optional(),
|
|
754
827
|
blockStreamingCoalesce: BlockStreamingCoalesceSchema.optional(),
|
|
@@ -802,7 +875,7 @@ export const MSTeamsConfigSchema = z
|
|
|
802
875
|
markdown: MarkdownConfigSchema,
|
|
803
876
|
configWrites: z.boolean().optional(),
|
|
804
877
|
appId: z.string().optional(),
|
|
805
|
-
appPassword: z.string().optional(),
|
|
878
|
+
appPassword: z.string().optional().register(sensitive),
|
|
806
879
|
tenantId: z.string().optional(),
|
|
807
880
|
webhook: z
|
|
808
881
|
.object({
|
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
|
+
import { parseByteSize } from "../cli/parse-bytes.js";
|
|
3
|
+
import { parseDurationMs } from "../cli/parse-duration.js";
|
|
2
4
|
import { ElevatedAllowFromSchema } from "./zod-schema.agent-runtime.js";
|
|
5
|
+
import { createAllowDenyChannelRulesSchema } from "./zod-schema.allowdeny.js";
|
|
3
6
|
import { GroupChatSchema, InboundDebounceSchema, NativeCommandsSettingSchema, QueueSchema, TtsConfigSchema, } from "./zod-schema.core.js";
|
|
4
7
|
const SessionResetConfigSchema = z
|
|
5
8
|
.object({
|
|
@@ -8,11 +11,17 @@ const SessionResetConfigSchema = z
|
|
|
8
11
|
idleMinutes: z.number().int().positive().optional(),
|
|
9
12
|
})
|
|
10
13
|
.strict();
|
|
14
|
+
export const SessionSendPolicySchema = createAllowDenyChannelRulesSchema();
|
|
11
15
|
export const SessionSchema = z
|
|
12
16
|
.object({
|
|
13
17
|
scope: z.union([z.literal("per-sender"), z.literal("global")]).optional(),
|
|
14
18
|
dmScope: z
|
|
15
|
-
.union([
|
|
19
|
+
.union([
|
|
20
|
+
z.literal("main"),
|
|
21
|
+
z.literal("per-peer"),
|
|
22
|
+
z.literal("per-channel-peer"),
|
|
23
|
+
z.literal("per-account-channel-peer"),
|
|
24
|
+
])
|
|
16
25
|
.optional(),
|
|
17
26
|
identityLinks: z.record(z.string(), z.array(z.string())).optional(),
|
|
18
27
|
resetTriggers: z.array(z.string()).optional(),
|
|
@@ -20,6 +29,8 @@ export const SessionSchema = z
|
|
|
20
29
|
reset: SessionResetConfigSchema.optional(),
|
|
21
30
|
resetByType: z
|
|
22
31
|
.object({
|
|
32
|
+
direct: SessionResetConfigSchema.optional(),
|
|
33
|
+
/** @deprecated Use `direct` instead. Kept for backward compatibility. */
|
|
23
34
|
dm: SessionResetConfigSchema.optional(),
|
|
24
35
|
group: SessionResetConfigSchema.optional(),
|
|
25
36
|
thread: SessionResetConfigSchema.optional(),
|
|
@@ -38,34 +49,49 @@ export const SessionSchema = z
|
|
|
38
49
|
])
|
|
39
50
|
.optional(),
|
|
40
51
|
mainKey: z.string().optional(),
|
|
41
|
-
sendPolicy:
|
|
52
|
+
sendPolicy: SessionSendPolicySchema.optional(),
|
|
53
|
+
agentToAgent: z
|
|
42
54
|
.object({
|
|
43
|
-
|
|
44
|
-
rules: z
|
|
45
|
-
.array(z
|
|
46
|
-
.object({
|
|
47
|
-
action: z.union([z.literal("allow"), z.literal("deny")]),
|
|
48
|
-
match: z
|
|
49
|
-
.object({
|
|
50
|
-
channel: z.string().optional(),
|
|
51
|
-
chatType: z
|
|
52
|
-
.union([z.literal("direct"), z.literal("group"), z.literal("channel")])
|
|
53
|
-
.optional(),
|
|
54
|
-
keyPrefix: z.string().optional(),
|
|
55
|
-
})
|
|
56
|
-
.strict()
|
|
57
|
-
.optional(),
|
|
58
|
-
})
|
|
59
|
-
.strict())
|
|
60
|
-
.optional(),
|
|
55
|
+
maxPingPongTurns: z.number().int().min(0).max(5).optional(),
|
|
61
56
|
})
|
|
62
57
|
.strict()
|
|
63
58
|
.optional(),
|
|
64
|
-
|
|
59
|
+
maintenance: z
|
|
65
60
|
.object({
|
|
66
|
-
|
|
61
|
+
mode: z.enum(["enforce", "warn"]).optional(),
|
|
62
|
+
pruneAfter: z.union([z.string(), z.number()]).optional(),
|
|
63
|
+
/** @deprecated Use pruneAfter instead. */
|
|
64
|
+
pruneDays: z.number().int().positive().optional(),
|
|
65
|
+
maxEntries: z.number().int().positive().optional(),
|
|
66
|
+
rotateBytes: z.union([z.string(), z.number()]).optional(),
|
|
67
67
|
})
|
|
68
68
|
.strict()
|
|
69
|
+
.superRefine((val, ctx) => {
|
|
70
|
+
if (val.pruneAfter !== undefined) {
|
|
71
|
+
try {
|
|
72
|
+
parseDurationMs(String(val.pruneAfter).trim(), { defaultUnit: "d" });
|
|
73
|
+
}
|
|
74
|
+
catch {
|
|
75
|
+
ctx.addIssue({
|
|
76
|
+
code: z.ZodIssueCode.custom,
|
|
77
|
+
path: ["pruneAfter"],
|
|
78
|
+
message: "invalid duration (use ms, s, m, h, d)",
|
|
79
|
+
});
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
if (val.rotateBytes !== undefined) {
|
|
83
|
+
try {
|
|
84
|
+
parseByteSize(String(val.rotateBytes).trim(), { defaultUnit: "b" });
|
|
85
|
+
}
|
|
86
|
+
catch {
|
|
87
|
+
ctx.addIssue({
|
|
88
|
+
code: z.ZodIssueCode.custom,
|
|
89
|
+
path: ["rotateBytes"],
|
|
90
|
+
message: "invalid size (use b, kb, mb, gb, tb)",
|
|
91
|
+
});
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
})
|
|
69
95
|
.optional(),
|
|
70
96
|
})
|
|
71
97
|
.strict()
|
|
@@ -80,6 +106,7 @@ export const MessagesSchema = z
|
|
|
80
106
|
ackReaction: z.string().optional(),
|
|
81
107
|
ackReactionScope: z.enum(["group-mentions", "group-all", "direct", "all"]).optional(),
|
|
82
108
|
removeAckAfterReply: z.boolean().optional(),
|
|
109
|
+
suppressToolErrors: z.boolean().optional(),
|
|
83
110
|
tts: TtsConfigSchema,
|
|
84
111
|
})
|
|
85
112
|
.strict()
|