import { EvidenceRef, KnowledgeKind, KnowledgeScope, MemoryMutationOptions, MemoryQuery, MemoryRecord, MemoryService, NewMemoryRecord, ProducerMessageSource, RpcResult, projectIdFromCwd as projectIdFromCwd$1 } from "@klarkxy/dsh-plugin-kit/contracts"; //#region src/contracts.d.ts declare const CHAT_EVENTS_SLOT = "dsh-editor.chat.events"; declare const projectIdFromCwd: typeof projectIdFromCwd$1; declare const SELF_IMPROVEMENT_RPC_CHANNEL = "/dsh-self-improvement"; declare const SELF_IMPROVEMENT_PLUGIN = "@klarkxy/dsh-self-improvement"; declare const SELF_IMPROVEMENT_REVIEW_SERVICE = "dshSelfImprovementReview"; declare const SELF_IMPROVEMENT_SOURCE_KIND: "plugin:@klarkxy/dsh-self-improvement"; /** Production activate identity. Core owns the scoped pluginName regex. */ declare const SELF_IMPROVEMENT_ACTIVATE_ID = "@klarkxy/dsh-self-improvement"; declare const EXTRACT_PURPOSE = "self-improvement.extract"; declare const LESSON_INJECTION_SECTION = "dsh-self-improvement:lessons"; declare const LESSON_SCHEMA_TAG = "lesson-schema:1"; declare const LESSON_SCHEMA_VERSION = 1; declare const MAX_INJECTED_LESSONS = 5; declare const MAX_INJECTION_TOKENS = 800; declare const MAX_PROJECT_ID_CHARS = 32768; declare const MAX_RECALL_QUERY_CHARS = 200; /** Plugin-page settings row key. */ declare const SETTINGS_KEY = "current"; /** Plugin-page model selection. Empty provider/model means "follow the default". */ interface SelfImprovementModelRoute { readonly provider: string; readonly model: string; readonly reasoningEffort?: string; } interface SelfImprovementSettings { readonly revision: number; readonly model: SelfImprovementModelRoute; } declare const defaultModelRoute: () => SelfImprovementModelRoute; declare const defaultSettings: () => SelfImprovementSettings; /** Untrusted stored routes collapse to the default so a bad row never breaks a run. */ declare function normalizeModelRoute(value: unknown): SelfImprovementModelRoute; type SkillStatus = 'preview' | 'accepted' | 'rejected' | 'revoked'; type SkillExportState = 'none' | 'recorded' | 'revoked'; interface SkillAuditEntry { at: number; action: string; detail?: string; } interface SkillSourceRef { id: string; revision: number; status: MemoryRecord['status']; scope: KnowledgeScope; expiresAt?: number; } interface SkillRecord { id: string; revision: number; status: SkillStatus; lessonIds: string[]; sources: SkillSourceRef[]; title: string; markdown: string; createdAt: number; updatedAt: number; exportState: SkillExportState; exportedAt?: number; exportRevokedAt?: number; exportFilename?: string; audit: SkillAuditEntry[]; } interface SessionWatermark { sessionId: string; seq: number; projectId?: string; updatedAt: number; } type LessonTriggerKind = 'human-correction' | 'human-instruction' | 'human-feedback' | 'tool-recovery' | 'verified-tool-fix' | 'manual'; interface LessonTrigger { kind: LessonTriggerKind; evidence: EvidenceRef[]; titleHint: string; contentHint: string; toolName?: string; } interface LessonInjectPayload { source: ProducerMessageSource & { kind: typeof SELF_IMPROVEMENT_SOURCE_KIND; plugin: typeof SELF_IMPROVEMENT_PLUGIN; form: 'snapshot'; sections: Array<{ name: string; text: string; }>; }; content: Array<{ type: 'text'; text: string; }>; } interface PreStepEnter { kind: 'enter'; messages: unknown[]; startsRequestSeries?: true; } type PreStepDecision = { kind: 'reject'; } | PreStepEnter; interface ReviewSnapshot { memoryAvailable: boolean; memoryMessage?: string; projectId?: string; generation: number; storageFailed: boolean; lessons: MemoryRecord[]; skills: SkillRecord[]; /** True while an extract for this session (or any session, if none requested) is queued or in flight. */ extracting?: boolean; } declare function evidenceWatermark(refs: readonly EvidenceRef[]): string; declare function sessionCwd(session: unknown): string | undefined; declare function fail(code: string, message: string): RpcResult; declare const MEMORY_UNAVAILABLE_MESSAGE = "记忆服务不可用。请先单独启用「长期记忆」插件;启用经验学习不会自动打开记忆。"; declare const MEMORY_UNAVAILABLE_MESSAGE_EN = "Memory is unavailable. Enable the Long-term Memory plugin separately; turning on Experience Learning does not enable Long-term Memory."; //#endregion export { CHAT_EVENTS_SLOT, EXTRACT_PURPOSE, type EvidenceRef, type KnowledgeKind, type KnowledgeScope, LESSON_INJECTION_SECTION, LESSON_SCHEMA_TAG, LESSON_SCHEMA_VERSION, LessonInjectPayload, LessonTrigger, LessonTriggerKind, MAX_INJECTED_LESSONS, MAX_INJECTION_TOKENS, MAX_PROJECT_ID_CHARS, MAX_RECALL_QUERY_CHARS, MEMORY_UNAVAILABLE_MESSAGE, MEMORY_UNAVAILABLE_MESSAGE_EN, type MemoryMutationOptions, type MemoryQuery, type MemoryRecord, type MemoryService, type NewMemoryRecord, PreStepDecision, PreStepEnter, type ProducerMessageSource, ReviewSnapshot, type RpcResult, SELF_IMPROVEMENT_ACTIVATE_ID, SELF_IMPROVEMENT_PLUGIN, SELF_IMPROVEMENT_REVIEW_SERVICE, SELF_IMPROVEMENT_RPC_CHANNEL, SELF_IMPROVEMENT_SOURCE_KIND, SETTINGS_KEY, SelfImprovementModelRoute, SelfImprovementSettings, SessionWatermark, SkillAuditEntry, SkillExportState, SkillRecord, SkillSourceRef, SkillStatus, defaultModelRoute, defaultSettings, evidenceWatermark, fail, normalizeModelRoute, projectIdFromCwd, sessionCwd }; //# sourceMappingURL=contracts.d.ts.map