import type { Context } from "@deepseek-ai/cordis"; import z from "@deepseek-ai/schemastery"; import { ConnectService } from "./service.js"; import type { ConnectConfig } from "./runner.js"; import { type ChannelName } from "./settings/channels.js"; export { ConnectService } from "./service.js"; export { AgentRunner, resolveConnectConfig } from "./runner.js"; export { MenuController } from "./menu-controller.js"; export type { MenuHost } from "./menu-controller.js"; export type { ConnectConfig, ResolvedConnectConfig } from "./runner.js"; export { applyStreamChunk, applyToolCall, classifyError, questionTextOf, showsLiveStatus, summarizeTurn, toolCallSummary } from "./stream.js"; export type { ErrorCategory, NotifyLevel, StreamChunkLike, StreamState } from "./stream.js"; export { InteractionBridge, decodeTextAnswer } from "./interaction.js"; export type { AskQuestionLike } from "./interaction.js"; export { BindingStore } from "./binding.js"; export type { ChatBinding, ChatSessionRecord } from "./binding.js"; export { createAsyncQueue } from "./stream.js"; export { menuTitle, rootMenuSections, reasonLabel, goalPhaseLabel, listWorkspaces, menuRender } from "./menus.js"; export type { MenuId, MenuItem } from "./menus.js"; export { InboundDedup } from "./dedup.js"; export { retry, withOutboundRetry } from "./retry.js"; export type { RetryOptions } from "./retry.js"; export { acquire as acquireLock, canWrite as lockCanWrite, isLockTimedOut, release as releaseLockState, DEFAULT_LOCK_TIMEOUT_MS } from "./mirror-lock.js"; export type { LockState, QueuedMessage } from "./mirror-lock.js"; export { ReminderStore, formatRemindAt, parseRemindTime } from "./scheduler.js"; export type { ScheduledReminder } from "./scheduler.js"; export { parseCommand, helpText } from "./commands.js"; export type { Command } from "./commands.js"; export { messages } from "./i18n.js"; export type { Language, Messages } from "./i18n.js"; export type { ChatType, ChoiceOption, ChoicePrompt, ChoiceResult, InboundMessage, OutboundTarget, SummaryCard, TurnReason, TurnOutcome, AsyncQueue, ChannelAdapter, } from "./types.js"; export * as feishu from "./channels/feishu/index.js"; export * as telegram from "./channels/telegram/index.js"; export * as dingtalk from "./channels/dingtalk/index.js"; export * as web from "./channels/web/index.js"; export * as settings from "./settings/index.js"; /** Cordis plugin name used by loader diagnostics. */ export declare const name = "connect"; /** * Host-plane services this plugin must wait for before `apply` runs. All four * are rows in the always-loaded `@deepseek-ai/dsh-base` bundle — the shared core * of every base-backed profile — so requiring them cannot stall the plugin in * any profile that can load `dsh-connect` at all. * * `credentials` must be listed here, not read lazily inside `apply`: a * `ctx.get("credentials")` at apply time returns `undefined`, because this * plugin activates before the credentials row does. That silently disabled the * whole credential path — `migrateConfigSecrets` never seeded the store (so an * upgraded user's working channels displayed "未配置凭据"), `injectSecrets` * never merged store-backed secrets into a channel config, and * `settings.saveCredentials` threw `not-configured` for every pane save. Note * cordis v4 has no `?` optional-inject marker, so `"credentials?"` would be read * as a required service literally named `"credentials?"` — that is a syntax * hazard, not a reason the service itself is unavailable. */ export declare const inject: string[]; /** * Full plugin config: the channel-agnostic core fields plus the channel * selector (`channels`), shared `channelDefaults`, per-channel config, and the * web-settings state path. Each channel's own `Config` schema is also exported * (as `feishu.Config`, etc.) for reference; the merged entry validates loosely. * * Two families of key carry `.volatile()`, and *only* these two: * * - the **general settings** below (`language`, `workDir`, `allowUsers`, …) — * the values the pane's 通用设置 view edits, which the chat commands set; * - the **pane fields** spread from `paneConfigFields()` at the bottom. * * `.volatile()` is what makes a field hot-committable: the loader replaces the * reference in place when the profile entry changes, and `sectionOf` is what * projects it back out on a write. A general key left non-volatile would still * be *stored* by `replace()` — and then silently dropped by the next write, * because only volatile paths survive the reset. Keep the two lists in step. * * The declaration stays end-to-end on the leaves; no container is volatile (a * volatile container would copy `appSecret` into the profile). `stateDir`, * `visionModel` and `settingsStatePath` are deliberately *not* volatile: they * are advanced or non-scalar, and the pane does not offer them. */ export declare const Config: z; /** Agent preset id composed into each bound session; omit for the roster default. */ agentPreset: z; /** Absolute working directory per agent; defaults to the process cwd. */ workDir: z; /** Optional workspace directories offered by the `/dir` chooser. */ workspaces: z, NoInfer, "volatile">; /** Vision-capable model used to describe images when the main model can't see them. */ visionModel: z; model: z; }>>, Schemastery.ObjectT; model: z; }>>, "plain">; /** User-facing message language: `zh` (default) or `en`. */ language: z<"zh" | "en", "zh" | "en", "volatile">; /** Sender allowlist; empty = all senders allowed. */ allowUsers: z, NoInfer, "volatile">; /** Chat allowlist; empty = all chats allowed. */ allowChats: z, NoInfer, "volatile">; /** * Per-channel access control. Identifiers are channel-specific — a Feishu * `ou_…` open id is meaningless to Telegram, whose user ids are numeric — so a * single global list cannot be correct for two channels at once. A channel * declared here overrides `allowUsers`/`allowChats` for itself. */ channelAccess: z; /** Directory for the bindings.json routing store. */ stateDir: z; /** Automatically create a Web mirror for new sessions (default: true). */ autoMirror: z; /** Liveness heartbeat interval ms for the streaming card; 0 disables it (default: 60000). */ streamHeartbeatMs: z; /** Default notification level for streaming replies. Default 'result' (final answer only) keeps cards short. */ notifyLevel: z<"full" | "important" | "result", "full" | "important" | "result", "volatile">; /** Proactive progress-notice interval ms when a turn stays silent (default: 300000 = 5 min; 0 disables). */ progressTimeoutMs: z; /** Compact the session automatically when context usage crosses `autoCompactThresholdPct` (default: false). */ autoCompact: z; /** * Context-window usage (`inputTokens / contextWindow`, as a percentage) at * which `autoCompact` fires (default: 80). */ autoCompactThresholdPct: z; }>>, Schemastery.ObjectT; /** Agent preset id composed into each bound session; omit for the roster default. */ agentPreset: z; /** Absolute working directory per agent; defaults to the process cwd. */ workDir: z; /** Optional workspace directories offered by the `/dir` chooser. */ workspaces: z, NoInfer, "volatile">; /** Vision-capable model used to describe images when the main model can't see them. */ visionModel: z; model: z; }>>, Schemastery.ObjectT; model: z; }>>, "plain">; /** User-facing message language: `zh` (default) or `en`. */ language: z<"zh" | "en", "zh" | "en", "volatile">; /** Sender allowlist; empty = all senders allowed. */ allowUsers: z, NoInfer, "volatile">; /** Chat allowlist; empty = all chats allowed. */ allowChats: z, NoInfer, "volatile">; /** * Per-channel access control. Identifiers are channel-specific — a Feishu * `ou_…` open id is meaningless to Telegram, whose user ids are numeric — so a * single global list cannot be correct for two channels at once. A channel * declared here overrides `allowUsers`/`allowChats` for itself. */ channelAccess: z; /** Directory for the bindings.json routing store. */ stateDir: z; /** Automatically create a Web mirror for new sessions (default: true). */ autoMirror: z; /** Liveness heartbeat interval ms for the streaming card; 0 disables it (default: 60000). */ streamHeartbeatMs: z; /** Default notification level for streaming replies. Default 'result' (final answer only) keeps cards short. */ notifyLevel: z<"full" | "important" | "result", "full" | "important" | "result", "volatile">; /** Proactive progress-notice interval ms when a turn stays silent (default: 300000 = 5 min; 0 disables). */ progressTimeoutMs: z; /** Compact the session automatically when context usage crosses `autoCompactThresholdPct` (default: false). */ autoCompact: z; /** * Context-window usage (`inputTokens / contextWindow`, as a percentage) at * which `autoCompact` fires (default: 80). */ autoCompactThresholdPct: z; }>>, "plain">; /** The merged plugin's config type (core fields + channel selector + settings). */ export interface ConnectSettingsConfig extends ConnectConfig { /** Channels to activate; default: all built-in channels. */ channels?: ChannelName[]; /** Keys applied to every channel that doesn't set its own (e.g. a shared `language`). */ channelDefaults?: Record; feishu?: Record; telegram?: Record; dingtalk?: Record; web?: Record; /** Optional path to persist web-settings edits (non-secret). */ settingsStatePath?: string; } /** Convenience alias for the settings stack's channel-orchestration config. */ export type { ChannelsConfig, ChannelApply } from "./settings/channels.js"; declare module "@deepseek-ai/cordis" { interface Context { connect: ConnectService; } } /** * Register the `connect` service and start the enabled channel adapters, then * expose the web-settings RPC. `connect` is constructed first and passed *by * instance* into each channel's `register` — never resolved via * `ctx.get("connect")`, which returns undefined inside this plugin's own * `apply` (the fiber is still LOADING until this function resolves). */ export declare function apply(ctx: Context, config?: ConnectSettingsConfig | null): Promise; declare const _default: { apply: typeof apply; name: string; inject: string[]; Config: z; /** Agent preset id composed into each bound session; omit for the roster default. */ agentPreset: z; /** Absolute working directory per agent; defaults to the process cwd. */ workDir: z; /** Optional workspace directories offered by the `/dir` chooser. */ workspaces: z, NoInfer, "volatile">; /** Vision-capable model used to describe images when the main model can't see them. */ visionModel: z; model: z; }>>, Schemastery.ObjectT; model: z; }>>, "plain">; /** User-facing message language: `zh` (default) or `en`. */ language: z<"zh" | "en", "zh" | "en", "volatile">; /** Sender allowlist; empty = all senders allowed. */ allowUsers: z, NoInfer, "volatile">; /** Chat allowlist; empty = all chats allowed. */ allowChats: z, NoInfer, "volatile">; /** * Per-channel access control. Identifiers are channel-specific — a Feishu * `ou_…` open id is meaningless to Telegram, whose user ids are numeric — so a * single global list cannot be correct for two channels at once. A channel * declared here overrides `allowUsers`/`allowChats` for itself. */ channelAccess: z; /** Directory for the bindings.json routing store. */ stateDir: z; /** Automatically create a Web mirror for new sessions (default: true). */ autoMirror: z; /** Liveness heartbeat interval ms for the streaming card; 0 disables it (default: 60000). */ streamHeartbeatMs: z; /** Default notification level for streaming replies. Default 'result' (final answer only) keeps cards short. */ notifyLevel: z<"full" | "important" | "result", "full" | "important" | "result", "volatile">; /** Proactive progress-notice interval ms when a turn stays silent (default: 300000 = 5 min; 0 disables). */ progressTimeoutMs: z; /** Compact the session automatically when context usage crosses `autoCompactThresholdPct` (default: false). */ autoCompact: z; /** * Context-window usage (`inputTokens / contextWindow`, as a percentage) at * which `autoCompact` fires (default: 80). */ autoCompactThresholdPct: z; }>>, Schemastery.ObjectT; /** Agent preset id composed into each bound session; omit for the roster default. */ agentPreset: z; /** Absolute working directory per agent; defaults to the process cwd. */ workDir: z; /** Optional workspace directories offered by the `/dir` chooser. */ workspaces: z, NoInfer, "volatile">; /** Vision-capable model used to describe images when the main model can't see them. */ visionModel: z; model: z; }>>, Schemastery.ObjectT; model: z; }>>, "plain">; /** User-facing message language: `zh` (default) or `en`. */ language: z<"zh" | "en", "zh" | "en", "volatile">; /** Sender allowlist; empty = all senders allowed. */ allowUsers: z, NoInfer, "volatile">; /** Chat allowlist; empty = all chats allowed. */ allowChats: z, NoInfer, "volatile">; /** * Per-channel access control. Identifiers are channel-specific — a Feishu * `ou_…` open id is meaningless to Telegram, whose user ids are numeric — so a * single global list cannot be correct for two channels at once. A channel * declared here overrides `allowUsers`/`allowChats` for itself. */ channelAccess: z; /** Directory for the bindings.json routing store. */ stateDir: z; /** Automatically create a Web mirror for new sessions (default: true). */ autoMirror: z; /** Liveness heartbeat interval ms for the streaming card; 0 disables it (default: 60000). */ streamHeartbeatMs: z; /** Default notification level for streaming replies. Default 'result' (final answer only) keeps cards short. */ notifyLevel: z<"full" | "important" | "result", "full" | "important" | "result", "volatile">; /** Proactive progress-notice interval ms when a turn stays silent (default: 300000 = 5 min; 0 disables). */ progressTimeoutMs: z; /** Compact the session automatically when context usage crosses `autoCompactThresholdPct` (default: false). */ autoCompact: z; /** * Context-window usage (`inputTokens / contextWindow`, as a percentage) at * which `autoCompact` fires (default: 80). */ autoCompactThresholdPct: z; }>>, "plain">; }; export default _default; //# sourceMappingURL=index.d.ts.map