import type { Solution } from "./solution"; export declare const SessionStatus: import("arktype/internal/variants/string.ts").StringType<"completed" | "created" | "failed" | "interrupted" | "running" | "waiting_for_input", {}>; export type SessionStatus = typeof SessionStatus.infer; export type TemplateId = "default" | "skill_editor" | "ship_attack"; export type SkillEditorTemplateId = "skill_editor"; export type ModeId = "planning" | "executing"; export type PublishedSolutionRef = { source: "builtin"; name: string; } | { source: "hub"; org: string; name: string; }; /** 回放时录制内容的播放倍速。 */ export type ReplaySpeed = 1 | 2 | 5; /** * 新建回放会话时的默认倍速。 * * 所有创建入口都用它——曾经侧栏走 API 默认 5x、设置菜单初始化成 1x, * 同一个源对话从不同入口开出来速度不一样。 */ export declare const DEFAULT_REPLAY_SPEED: ReplaySpeed; export interface ReplayState { source_session_id?: string; status?: "replay" | "autonomous"; speed?: ReplaySpeed; next_source_entry_id?: string | null; ended_at?: string | null; autonomous_reason?: string | null; } /** 某个会话能否作为回放来源。 */ export interface ReplayPreview { session_id: string; intent?: string | null; supported: boolean; /** supported 为 false 时给出的原因,可直接展示给用户。 */ reason?: string | null; } export interface SessionPortMapping { container_port: number; host_port: number; } /** * 列表搜索时单条会话的命中信息。 * - field='title':关键词出现在 intent 里,snippet 为 null(标题本身就在 UI 上) * - field='content':关键词出现在历史消息里,snippet 含截窗预览与角色 */ export interface SessionSearchMatch { field: "title" | "content"; snippet: { role: string; text: string; } | null; } export declare const SessionInfo: import("arktype/internal/variants/object.ts").ObjectType<{ id: string; intent: string; status: "completed" | "created" | "failed" | "interrupted" | "running" | "waiting_for_input"; created_at: string; updated_at: string; shared?: boolean | undefined; memory_enabled?: boolean | undefined; is_persistent?: boolean | undefined; initiator?: "sdk" | "ui" | "unknown" | null | undefined; is_headless?: boolean | undefined; viewer_role?: "owner" | "viewer" | undefined; template_id?: string | null | undefined; model?: string | null | undefined; enable_thinking?: boolean | null | undefined; solution_id?: string | null | undefined; solution_ref?: unknown; biz_role_id?: string | null | undefined; solution?: unknown; plan_summary?: string | null | undefined; primary_skill_id?: string | null | undefined; bound_skill_id?: string | null | undefined; replay_state?: unknown; is_pinned?: boolean | undefined; pinned_at?: string | null | undefined; is_example?: boolean | undefined; ports?: unknown; disable_tools?: string[] | undefined; runtime_type?: string | null | undefined; daemon_id?: string | null | undefined; agent_runtime_id?: string | null | undefined; workspace_path?: string | null | undefined; ba_version?: string | null | undefined; sandbox_version?: string | null | undefined; chat_group_id?: string | null | undefined; match?: unknown; }, {}>; export type SessionInfo = Omit & { shared?: boolean; memory_enabled?: boolean; is_persistent?: boolean; is_headless?: boolean; viewer_role?: "owner" | "viewer"; template_id?: TemplateId | null; model?: string | null; enable_thinking?: boolean | null; solution_id?: string | null; solution_ref?: PublishedSolutionRef | null; biz_role_id?: string | null; solution?: Solution | null; primary_skill_id?: string | null; bound_skill_id?: string | null; replay_state?: ReplayState | null; is_pinned?: boolean; pinned_at?: string | null; is_example?: boolean; ports?: SessionPortMapping[]; disable_tools?: string[]; runtime_type?: "sandbox" | "daemon" | "native" | string | null; daemon_id?: string | null; agent_runtime_id?: string | null; workspace_path?: string | null; ba_version?: string | null; sandbox_version?: string | null; chat_group_id?: string | null; /** 仅在带 q 搜索的列表响应中出现;普通列表里此字段缺省。 */ match?: SessionSearchMatch | null; }; /** * 主 skill 配置快照(v2)。创建 session 时从 SKILL.md frontmatter 抽出并 * 固化到 session_root/.blade/primary-skill.json;ship-attack 页面骨架的唯 * 一数据源。 */ export interface PrimarySkillStepSpec { n: number; label: string; } export interface PrimarySkillStageSpec { id: string; name: string; steps: PrimarySkillStepSpec[]; } export interface PrimarySkillParallelMode { id: string; name: string; prompt_hint: string; } export interface PrimarySkillSnapshot { version: number; skill_id: string; title: string; description: string; stages: PrimarySkillStageSpec[]; parallel_modes: PrimarySkillParallelMode[]; captured_at: string; } /** * 单 session detail(GET /api/sessions/:id)。列表接口返回 SessionInfo, * detail 在此基础上附加 primary_skill_snapshot。 */ export interface SessionDetail extends SessionInfo { primary_skill_snapshot?: PrimarySkillSnapshot | null; preview_url?: string | null; /** * 会话级环境变量(owner-only)。后端仅在 GET detail 和 PUT /env 响应中返回, * 列表/搜索响应不带此字段。调用 setSessionEnv 后可类型安全地读回。 */ env?: Record; }