ManagedQueryOptions
This content is not available in your language yet.
托管/令牌档单轮选项(工具/权限缝与 CreateSessionOptions 同名同义)
adjudication?
Section titled “adjudication?”optional adjudication?: AdjudicationOptions;裁决人(仅令牌档;语义同 CreateSessionOptions.adjudication)
baseUrl?
Section titled “baseUrl?”optional baseUrl?: string;平台 API 基址(令牌档必填,如 https://api.example.com)
capabilities?
Section titled “capabilities?”optional capabilities?: AppCapabilities;能力位档;缺省 DEFAULT_APP_CAPABILITIES(令牌档由 bundle 供给)
cleanupTimeoutMs?
Section titled “cleanupTimeoutMs?”optional cleanupTimeoutMs?: number;Default 30 seconds. Bounds cleanup observation, not model execution.
QueryLifecycleOptions.cleanupTimeoutMs
compaction?
Section titled “compaction?”optional compaction?: false | QueryCompactionOptions;上下文压缩:缺省 {}(自动压缩,仅上下文窗口已知时 生效——阈值代数依赖窗口,与 TUI/serve 同守卫);false 显式禁用。
config?
Section titled “config?”optional config?: LoadedConfig;已装载配置注入缝:提供时跳过 loadConfig
optional cwd?: string;项目层配置发现起点与工具 cwd;缺省 process.cwd()
optional env?: Record<string, string | undefined>;环境变量注入缝;缺省 process.env
fetchImpl?
Section titled “fetchImpl?”optional fetchImpl?: any;fetch 注入缝(透传协议适配器)
initialMessages?
Section titled “initialMessages?”optional initialMessages?: readonly IRMessage[];历史前缀(续跑/恢复);与 prompt 至少给一个非空
loadOptions?
Section titled “loadOptions?”optional loadOptions?: Omit<LoadConfigOptions, "cwd" | "env">;loadConfig 其余注入缝(fs/homedir/platform;测试 hermetic 用)
maxConsecutiveErrors?
Section titled “maxConsecutiveErrors?”optional maxConsecutiveErrors?: number;连续可恢复错误熔断上限;缺省 3(内核缺省)
maxTokens?
Section titled “maxTokens?”optional maxTokens?: number;缺省 8192
maxToolRounds?
Section titled “maxToolRounds?”optional maxToolRounds?: number;toolRounds 上限;缺省不设
maxTurns?
Section titled “maxTurns?”optional maxTurns?: number;modelTurns 护栏;缺省 200(托管便捷面失控保护,与 serve 对齐)
optional mcp?: McpSessionOption;显式MCP材料;配置对象为本次自有,McpHost实例为借用。
model?
Section titled “model?”optional model?: string;模型别名(main/fast/reasoning/自定义)或 ref(provider/model);缺省 ‘main’
onLifecycleError?
Section titled “onLifecycleError?”optional onLifecycleError?: (error) => void;Required error channel when AsyncIteratorClose preserves a consumer’s own throw.
void
QueryLifecycleOptions.onLifecycleError
onPlatformWarning?
Section titled “onPlatformWarning?”optional onPlatformWarning?: (warning) => void;平台提示帧承接(S-ARCH;语义同 CreateSessionOptions.onPlatformWarning): 缺席缺省 console.warn 每码一次,在场即全量接管。
warning
Section titled “warning”void
onWarning?
Section titled “onWarning?”optional onWarning?: (warning) => void;SDK装配警告;平台子集仍沿onPlatformWarning旧出口。
warning
Section titled “warning”void
permission?
Section titled “permission?”optional permission?: PermissionOptions;权限模式与确认通道(语义同 CreateSessionOptions.permission)
prompt?
Section titled “prompt?”optional prompt?: string;单轮输入(追加在 initialMessages 之后作最后一条 user 消息)
promptChannel?
Section titled “promptChannel?”optional promptChannel?: PromptChannel;AskUser 工具交互通道;缺省 UnavailableChannel(结构化降级,不挂起)
sessionId?
Section titled “sessionId?”optional sessionId?: string;缺省 randomUUID()
signal?
Section titled “signal?”optional signal?: any;外部中断信号(全链透传:模型流 / 工具执行 / 压缩均立即响应)
skills?
Section titled “skills?”optional skills?: SdkSkillsOptions;显式技能材料;缺席时不扫描CLI技能目录。与createSession同义。
stopSequences?
Section titled “stopSequences?”optional stopSequences?: string[];system?
Section titled “system?”optional system?: IRSystemSegment[];业务提示词:平台 fallback 策略下显式值(含 [])覆盖;prepend 策略保留平台段在前。创建时固定。
systemAppend?
Section titled “systemAppend?”optional systemAppend?: IRSystemSegment[];业务段选定后追加的宿主指南,不触发平台默认覆盖;权限与工具指南仍独立装配。
temperature?
Section titled “temperature?”optional temperature?: number;采样参数直通
thinking?
Section titled “thinking?”optional thinking?: { budget?: number;};budget?
Section titled “budget?”optional budget?: number;token?
Section titled “token?”optional token?: string;app_user 短期令牌(开发者服务端换发;模型与能力位由 bundle 供给)
tools?
Section titled “tools?”optional tools?: SdkToolsOptions;三环工具入口(S-B3):builtin(环2 内置,词表逐名)/ platform(环3
平台能力,现只校验位)/ custom(环1 defineTool 产物)。缺席 = 装配
能力位放行的全部内置工具;tools: { builtin: [] } = 零内置。
Was this page helpful?
Thanks for your feedback.