@ai-agent-forge/agent-forge 0.86.1 → 0.86.2

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.
@@ -1 +1 @@
1
- {"version":3,"file":"agent-session-internal.d.ts","sourceRoot":"","sources":["../../src/core/agent-session-internal.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,KAAK,EACX,KAAK,EACL,YAAY,EACZ,UAAU,EACV,mBAAmB,EACnB,YAAY,EACZ,SAAS,EACT,sBAAsB,EACtB,aAAa,EACb,MAAM,yBAAyB,CAAC;AACjC,OAAO,KAAK,EACX,GAAG,EACH,gBAAgB,EAChB,YAAY,EACZ,KAAK,EACL,WAAW,EACX,iBAAiB,EACjB,MAAM,wBAAwB,CAAC;AAChC,OAAO,KAAK,EACX,iBAAiB,EACjB,gBAAgB,EAChB,oBAAoB,EACpB,YAAY,EACZ,eAAe,EACf,MAAM,oBAAoB,CAAC;AAC5B,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,+BAA+B,CAAC;AAC/E,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,gCAAgC,CAAC;AACnE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AACrD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAC9D,OAAO,KAAK,EAAE,sBAAsB,EAAE,iBAAiB,EAAE,uBAAuB,EAAE,MAAM,uBAAuB,CAAC;AAChH,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,mCAAmC,CAAC;AAChF,OAAO,KAAK,EAAE,YAAY,EAAE,gBAAgB,EAAE,MAAM,4BAA4B,CAAC;AACjF,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAC9C,OAAO,KAAK,EAAE,oBAAoB,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AACzE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,oBAAoB,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CAAC,EAAE,YAAY,GAAG,SAAS,GAAG,SAAS,GAAG,SAAS,CAAC,EACjF,OAAO,CAAC,EAAE;QAAE,WAAW,CAAC,EAAE,OAAO,CAAC;QAAC,SAAS,CAAC,EAAE,OAAO,GAAG,UAAU,GAAG,UAAU,CAAA;KAAE,GAChF,OAAO,CAAC,IAAI,CAAC,CAAC;IACjB,eAAe,CACd,OAAO,EAAE,MAAM,GAAG,CAAC,WAAW,GAAG,YAAY,CAAC,EAAE,EAChD,OAAO,CAAC,EAAE;QAAE,SAAS,CAAC,EAAE,OAAO,GAAG,UAAU,CAAC;QAAC,qBAAqB,CAAC,EAAE,OAAO,CAAA;KAAE,GAC7E,OAAO,CAAC,IAAI,CAAC,CAAC;IACjB,cAAc,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;IACnC,OAAO,CAAC,kBAAkB,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,gBAAgB,GAAG,yBAAyB,CAAC,CAAC;CAC5F","sourcesContent":["/**\n * Shared internal contract and snapshot helpers for the agent-session\n * submodules (agent-session-bash.ts, agent-session-compaction.ts,\n * agent-session-context.ts, agent-session-lifecycle.ts, agent-session-loop.ts,\n * agent-session-retry.ts, agent-session-tools.ts, agent-session-model.ts;\n * agent-session-runtime.ts consumes the class directly).\n *\n * `AgentSession` satisfies {@link AgentSessionInternals} structurally through a\n * single internal cast; members mirror the private state and helpers that moved\n * into the submodules. Same-name delegates stay on the class so call sites,\n * dynamic dispatch, and test spies keep working unchanged.\n */\n\nimport type {\n\tAgent,\n\tAgentContext,\n\tAgentEvent,\n\tAgentLoopTurnUpdate,\n\tAgentMessage,\n\tAgentTool,\n\tPrepareNextTurnContext,\n\tThinkingLevel,\n} from \"@agent-forge/agent-core\";\nimport type {\n\tApi,\n\tAssistantMessage,\n\tImageContent,\n\tModel,\n\tTextContent,\n\tToolResultMessage,\n} from \"@agent-forge/ai/compat\";\nimport type {\n\tAgentSessionEvent,\n\tModelCycleResult,\n\tModelMutationOptions,\n\tSessionStats,\n\tTurnAbortReason,\n} from \"./agent-session.ts\";\nimport type { CompactionCancelledResult } from \"./agent-session-compaction.ts\";\nimport type { LoopExecutor } from \"./agent-session-loop-runner.ts\";\nimport type { BashResult } from \"./bash-executor.ts\";\nimport type { CompactionResult } from \"./compaction/index.ts\";\nimport type { CapabilityPluginHandle, CapabilityRuntime, ContextOperationOptions } from \"./extensions/index.ts\";\nimport type { ModelStreamEventDataV1 } from \"./extensions/lifecycle-catalog.ts\";\nimport type { ContextUsage, ExecutionFactsV1 } from \"./extensions/public-api.ts\";\nimport type { HostLogger } from \"./logger.ts\";\nimport type { BashExecutionMessage, CustomMessage } from \"./messages.ts\";\nimport type { ModelRuntime } from \"./model-runtime.ts\";\nimport type { PromptTemplate } from \"./prompt-templates.ts\";\nimport type { ResourceLoader } from \"./resource-loader.ts\";\nimport type { BranchSummaryEntry, SessionManager } from \"./session-manager.ts\";\nimport type { SettingsManager } from \"./settings-manager.ts\";\nimport type { Skill } from \"./skills.ts\";\nimport type { SourceInfo } from \"./source-info.ts\";\nimport type { BuildSystemPromptOptions } from \"./system-prompt.ts\";\nimport type { BashOperations } from \"./tools/bash.ts\";\nimport type { ToolDefinition, ToolInfo } from \"./tools/tool-definition.ts\";\n\n/** Registry entry for one tool definition with its source metadata. */\nexport interface ToolDefinitionEntry {\n\tdefinition: ToolDefinition;\n\tsourceInfo: SourceInfo;\n}\n\n/**\n * A session operation was cancelled by user intent (abort, reload barrier) — a\n * normal outcome, never a failure. Host boundaries resolve with structured\n * cancelled results instead of surfacing this as an error.\n */\nexport class SessionCancelledError extends Error {\n\treadonly reason: \"reload\" | \"signal\";\n\n\tconstructor(reason: SessionCancelledError[\"reason\"]) {\n\t\tsuper(`Session operation cancelled: ${reason}`);\n\t\tthis.name = \"SessionCancelledError\";\n\t\tthis.reason = reason;\n\t}\n}\n\n/**\n * Deep-clone a session value and freeze the clone so lifecycle payloads cannot\n * be mutated in place. The implementation lives on the public extension face\n * (`./extensions/public-api.ts`) so first-party and third-party plugins share\n * the same payload-projection contract; re-exported here for the host-internal\n * session submodules.\n */\nexport { detachedSessionSnapshot } from \"./extensions/public-api.ts\";\n\n/** JSON-safe clone for lifecycle payloads that must survive structured clone failures. */\nexport function jsonSafeSessionSnapshot<T>(value: T): T {\n\tconst serialized = JSON.stringify(value);\n\t// v8 ignore next -- 对象消息序列化永远返回字符串,undefined 分支不可达\n\treturn serialized === undefined ? (null as T) : (JSON.parse(serialized) as T);\n}\n\nexport interface AgentSessionInternals {\n\treadonly agent: Agent;\n\treadonly sessionManager: SessionManager;\n\treadonly settingsManager: SettingsManager;\n\treadonly _modelRuntime: ModelRuntime;\n\treadonly model: Model<Api> | undefined;\n\treadonly thinkingLevel: ThinkingLevel;\n\treadonly sessionId: string;\n\treadonly isStreaming: boolean;\n\t/** Idle gate for public context operations (compile-time private getter on AgentSession). */\n\treadonly isIdle: boolean;\n\n\t// Internal session state (compile-time private on AgentSession)\n\t_compactionQueue: Promise<void>;\n\t_compactionAbortController: AbortController | undefined;\n\t_autoCompactionAbortController: AbortController | undefined;\n\t_overflowRecoveryAttempted: boolean;\n\t/** 已完成的溢出裁剪级数(0 = 未裁剪);与 `_overflowRecoveryAttempted` 同点位复位。 */\n\t_overflowTrimStage: number;\n\t_activeCompactionPromise: Promise<unknown> | undefined;\n\t_branchSummaryAbortController: AbortController | undefined;\n\t_branchSummaryPromise: Promise<unknown> | undefined;\n\t_resolveBranchSummaryPromise: (() => void) | undefined;\n\t_reloadInProgress: boolean;\n\t_policyDecisionAbortController: AbortController | undefined;\n\t_retryAbortController: AbortController | undefined;\n\t_retryAttempt: number;\n\t_pendingRetryDecision:\n\t\t| { message: AssistantMessage; decision: Awaited<ReturnType<CapabilityRuntime[\"decideRetry\"]>> }\n\t\t| undefined;\n\t_isAgentRunActive: boolean;\n\t_currentRunAborted: boolean;\n\t_lastAbortReason: TurnAbortReason | undefined;\n\t_lastAssistantMessage: AssistantMessage | undefined;\n\n\t// Lifecycle dispatch state (compile-time private on AgentSession)\n\treadonly _modelStreamState: { streamId: string; sequence: number } | undefined;\n\t/** Correlation id for the active prompt run's lifecycle dispatches; written by the loop-runner via this facade. */\n\t_turnCorrelationId: string | undefined;\n\t_turnCorrelationCounter: number;\n\t/**\n\t * Host-process logger seam (会话轨迹第 2 期,设计 §5.2): one-line process log\n\t * beside lifecycle dispatches that report genuine failures (compaction\n\t * failed). Undefined when no hostLogger was configured; call sites treat it\n\t * as a no-op.\n\t */\n\treadonly _hostLogger?: HostLogger;\n\n\t// Bash execution state (compile-time private on AgentSession)\n\treadonly _bashAbortControllers: Set<AbortController>;\n\treadonly _activeBashPromises: Set<Promise<unknown>>;\n\t_bashEpoch: number;\n\t_pendingBashMessages: BashExecutionMessage[];\n\treadonly isDisposed: boolean;\n\n\t_capabilityRuntime: CapabilityRuntime | undefined;\n\t_compactionPolicyName: string;\n\t_overflowPolicyName: string;\n\t_branchSummaryPolicyName: string;\n\t_retryPolicyName: string;\n\t_runLoopStrategyName: string;\n\t/** Internal loop-executor seam (D-043 G3): set to replace the default prompt/continue drive. No public config; distinct from `_runLoopStrategyName` (a per-continuation veto policy). */\n\t_loopExecutor: LoopExecutor | undefined;\n\n\t// Helpers that remain on AgentSession\n\t_emit(event: AgentSessionEvent): void;\n\t_resolveIdleWaitIfIdle(): void;\n\t_flushPendingCustomMessages(): void;\n\t_emitAgentSettled(): Promise<void>;\n\t_observeLifecycleDeliveryError(error: unknown, extensionPath: string, event: string): void;\n\tabort(): Promise<void>;\n\t_abortInternal(): Promise<void>;\n\n\t// Context-transition state and delegates forwarding to agent-session-context.ts\n\t/** Generation fence for context projections that may outlive a runtime replacement. */\n\t_contextEpoch: number;\n\t_contextTransitionAbortController: AbortController;\n\t/** Serializes context transitions and lets reload/dispose drain them before teardown. */\n\t_activeContextTransition: Promise<unknown> | undefined;\n\t/** Monotonic revision for the public context snapshot/commit facade. */\n\t_contextRevision: number;\n\t/** Serializes public context commits so expectedRevision is a real CAS fence. */\n\t_contextCommitQueue: Promise<void>;\n\t/** Configured external context strategy name, written only by the constructor. */\n\treadonly _contextStrategyName: string | undefined;\n\t_requireContextStrategy(): { runtime: CapabilityRuntime; name: string };\n\t_requireIdleContextOperation(operation: string): void;\n\t_beginContextTransitionFence(): void;\n\t_isContextTransitionCurrent(epoch: number, allowReload: boolean): boolean;\n\t_assertContextTransitionCurrent(epoch: number, allowReload: boolean): void;\n\t_enqueueContextTransition<T>(\n\t\toperation: (epoch: number, signal: AbortSignal) => Promise<T>,\n\t\toptions?: { signal?: AbortSignal; allowReload?: boolean },\n\t): Promise<T>;\n\t_copyContextMessages(value: unknown, strategyName: string, direction: \"input\" | \"result\"): AgentMessage[];\n\t_applyContextTransition(\n\t\tmessages: AgentMessage[],\n\t\treason?: ContextOperationOptions[\"reason\"],\n\t\tsignal?: AbortSignal,\n\t\toptions?: { allowReload?: boolean },\n\t): Promise<AgentMessage[]>;\n\t_restoreContextTransition(\n\t\tsnapshot: unknown,\n\t\treason: NonNullable<ContextOperationOptions[\"reason\"]>,\n\t\toptions?: { allowReload?: boolean },\n\t): Promise<AgentMessage[]>;\n\tsnapshotContext(): Promise<unknown>;\n\trestoreContext(snapshot: unknown): Promise<AgentMessage[]>;\n\treplaceContext(context: AgentMessage[]): Promise<AgentMessage[]>;\n\n\t// Model-scope state and delegates forwarding to agent-session-model.ts\n\t_scopedModels: Array<{ model: Model<Api>; thinkingLevel?: ThinkingLevel }>;\n\t/** Public scoped-models getter (Legacy 迁移 R1): submodules read via this instead of the private field. */\n\treadonly scopedModels: ReadonlyArray<{ model: Model<Api>; thinkingLevel?: ThinkingLevel }>;\n\tsetModel(model: Model<Api>, options?: ModelMutationOptions): Promise<void>;\n\tsetThinkingLevel(level: ThinkingLevel, options?: ModelMutationOptions): void;\n\t_emitModelSelect(\n\t\tnextModel: Model<Api>,\n\t\tpreviousModel: Model<Api> | undefined,\n\t\tsource: \"set\" | \"cycle\" | \"restore\",\n\t): Promise<void>;\n\t_addPersistedDefaultToNonEmptyScope(model: Model<Api>): void;\n\t_getThinkingLevelForModelSwitch(targetModel?: Model<Api>, explicitLevel?: ThinkingLevel): ThinkingLevel;\n\t_cycleScopedModel(\n\t\tdirection: \"forward\" | \"backward\",\n\t\toptions: ModelMutationOptions,\n\t): Promise<ModelCycleResult | undefined>;\n\t_cycleAvailableModel(\n\t\tdirection: \"forward\" | \"backward\",\n\t\toptions: ModelMutationOptions,\n\t): Promise<ModelCycleResult | undefined>;\n\n\t// Run-loop wiring state and delegates forwarding to agent-session-loop.ts\n\t/** The agent's construction-time prepare adapter, captured once by the loop wiring install. */\n\t_initialPrepareNextTurn:\n\t\t| ((\n\t\t\t\tcontext: PrepareNextTurnContext,\n\t\t\t\tsignal?: AbortSignal,\n\t\t ) => Promise<AgentLoopTurnUpdate | undefined> | AgentLoopTurnUpdate | undefined)\n\t\t| undefined;\n\n\t// Delegates forwarding to the submodule functions\n\t_compactBeforeNextAssistantResponse(context: AgentContext, signal?: AbortSignal): Promise<AgentContext>;\n\t_enqueueCompaction<T>(operation: () => Promise<T>): Promise<T>;\n\t_compactInternal(customInstructions?: string): Promise<CompactionResult>;\n\t_checkCompaction(\n\t\tassistantMessage: AssistantMessage,\n\t\tskipAbortedCheck?: boolean,\n\t\tsignal?: AbortSignal,\n\t): Promise<boolean>;\n\t_runAutoCompaction(reason: \"overflow\" | \"threshold\", willRetry: boolean): Promise<boolean>;\n\t_willRetryAfterAgentEnd(event: Extract<AgentEvent, { type: \"agent_end\" }>, signal?: AbortSignal): Promise<boolean>;\n\t_isRetryableError(message: AssistantMessage, execution?: ExecutionFactsV1, signal?: AbortSignal): Promise<boolean>;\n\t_prepareRetry(\n\t\tmessage: AssistantMessage,\n\t\tprecomputedDecision?: Awaited<ReturnType<CapabilityRuntime[\"decideRetry\"]>>,\n\t): Promise<boolean>;\n\tnavigateTree(\n\t\ttargetId: string,\n\t\toptions?: { summarize?: boolean; customInstructions?: string; replaceInstructions?: boolean; label?: string },\n\t): Promise<{ editorText?: string; cancelled: boolean; aborted?: boolean; summaryEntry?: BranchSummaryEntry }>;\n\n\t// Lifecycle delegates forwarding to agent-session-lifecycle.ts\n\t_dispatchModelStreamLifecycle(\n\t\tmessage: AgentMessage,\n\t\teventName: ModelStreamEventDataV1[\"event\"],\n\t\tphase: ModelStreamEventDataV1[\"phase\"],\n\t): Promise<void>;\n\t_dispatchContextReplacedLifecycle(\n\t\treason: NonNullable<ContextOperationOptions[\"reason\"]>,\n\t\tstrategyName?: string,\n\t): Promise<void>;\n\t_dispatchModelResponseLifecycle(message: AssistantMessage, entryId: string): Promise<void>;\n\t_dispatchToolCommitLifecycle(message: ToolResultMessage, entryId: string): Promise<void>;\n\t_dispatchToolResultLifecycle(message: ToolResultMessage, entryId: string): Promise<void>;\n\t_dispatchSessionReloadLifecycle(generation: number): Promise<void>;\n\n\t// Bash delegates forwarding to agent-session-bash.ts\n\tcaptureBashEpoch(): number;\n\tisBashEpochCurrent(epoch: number): boolean;\n\temitUserBash(excludeFromContext: boolean): void;\n\texecuteBash(\n\t\tcommand: string,\n\t\tonChunk?: (chunk: string) => void,\n\t\toptions?: { excludeFromContext?: boolean; id?: string; operations?: BashOperations },\n\t): Promise<BashResult>;\n\trecordBashResult(\n\t\tcommand: string,\n\t\tresult: BashResult,\n\t\toptions?: { excludeFromContext?: boolean; epoch?: number },\n\t): void;\n\tabortBash(): void;\n\t_flushPendingBashMessages(): void;\n\n\t// Tool registry state (compile-time private on AgentSession)\n\t_resourceLoader: ResourceLoader;\n\t_customTools: ToolDefinition[];\n\t_deferredToolPluginIds: ReadonlySet<string>;\n\t_baseToolDefinitions: Map<string, ToolDefinition>;\n\t_baseToolSources: Map<string, SourceInfo>;\n\t_toolRegistry: Map<string, AgentTool>;\n\t_toolDefinitions: Map<string, ToolDefinitionEntry>;\n\t_toolPromptSnippets: Map<string, string>;\n\t_toolPromptGuidelines: Map<string, string[]>;\n\t_allowedToolNames: Set<string> | undefined;\n\t_excludedToolNames: Set<string> | undefined;\n\t_baseSystemPrompt: string;\n\t_baseSystemPromptOptions: BuildSystemPromptOptions;\n\t_systemPromptOverride: string | undefined;\n\t_orientationPrompt: string | undefined;\n\t_preferenceCard: string | undefined;\n\t_capabilitySkillsFilter: ((skills: Skill[]) => Skill[]) | undefined;\n\t_bootstrapSkillsHandle: CapabilityPluginHandle | undefined;\n\t_cwd: string;\n\n\tgetActiveToolNames(): string[];\n\n\t// Tool registry delegates forwarding to agent-session-tools.ts\n\tgetAllTools(): ToolInfo[];\n\tgetToolDefinition(name: string): ToolDefinition | undefined;\n\tsetActiveToolsByName(toolNames: string[]): void;\n\t_rebuildSystemPrompt(toolNames: string[]): string;\n\t_refreshToolRegistry(options?: { activeToolNames?: string[]; includeAllExtensionTools?: boolean }): void;\n\t_syncCapabilityTools(): void;\n\t_getCapabilitySkills(): Skill[];\n\t_getAvailableSkills(): Skill[];\n\t_validateCapabilitySkillConflicts(): void;\n\t_refreshBootstrapSkills(): Promise<void>;\n\n\t// Read-only projections and delegates forwarding to agent-session-projection.ts\n\treadonly sessionFile: string | undefined;\n\treadonly messages: AgentMessage[];\n\treadonly systemPrompt: string;\n\treadonly promptTemplates: ReadonlyArray<PromptTemplate>;\n\treadonly pendingMessageCount: number;\n\tgetSessionStats(): SessionStats;\n\tgetContextUsage(): ContextUsage | undefined;\n\tgetUserMessagesForForking(): Array<{ entryId: string; text: string }>;\n\texportToHtml(outputPath?: string, options?: { themeName?: string }): Promise<string>;\n\texportToJsonl(outputPath?: string): string;\n\tgetLastAssistantText(): string | undefined;\n\n\t// Resource-discovery delegates forwarding to agent-session-extensions.ts\n\textendResourcesFromExtensions(reason: \"startup\" | \"reload\"): Promise<void>;\n\tbuildExtensionResourcePaths(entries: Array<{ path: string; extensionPath: string }>): Array<{\n\t\tpath: string;\n\t\tmetadata: { source: string; scope: \"temporary\"; origin: \"top-level\"; baseDir?: string };\n\t}>;\n\tgetExtensionSourceLabel(extensionPath: string): string;\n\n\t// Prompt/queue surface consumed by the extension binding closures\n\tsendCustomMessage<T = unknown>(\n\t\tmessage: Pick<CustomMessage<T>, \"customType\" | \"content\" | \"display\" | \"details\">,\n\t\toptions?: { triggerTurn?: boolean; deliverAs?: \"steer\" | \"followUp\" | \"nextTurn\" },\n\t): Promise<void>;\n\tsendUserMessage(\n\t\tcontent: string | (TextContent | ImageContent)[],\n\t\toptions?: { deliverAs?: \"steer\" | \"followUp\"; expandPromptTemplates?: boolean },\n\t): Promise<void>;\n\tsetSessionName(name: string): void;\n\tcompact(customInstructions?: string): Promise<CompactionResult | CompactionCancelledResult>;\n}\n"]}
1
+ {"version":3,"file":"agent-session-internal.d.ts","sourceRoot":"","sources":["../../src/core/agent-session-internal.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,KAAK,EACX,KAAK,EACL,YAAY,EACZ,UAAU,EACV,mBAAmB,EACnB,YAAY,EACZ,SAAS,EACT,sBAAsB,EACtB,aAAa,EACb,MAAM,yBAAyB,CAAC;AACjC,OAAO,KAAK,EACX,GAAG,EACH,gBAAgB,EAChB,YAAY,EACZ,KAAK,EACL,WAAW,EACX,iBAAiB,EACjB,MAAM,wBAAwB,CAAC;AAChC,OAAO,KAAK,EACX,iBAAiB,EACjB,gBAAgB,EAChB,oBAAoB,EACpB,YAAY,EACZ,eAAe,EACf,MAAM,oBAAoB,CAAC;AAC5B,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,+BAA+B,CAAC;AAC/E,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,gCAAgC,CAAC;AACnE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AACrD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAC9D,OAAO,KAAK,EAAE,sBAAsB,EAAE,iBAAiB,EAAE,uBAAuB,EAAE,MAAM,uBAAuB,CAAC;AAChH,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,mCAAmC,CAAC;AAChF,OAAO,KAAK,EAA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;YAAC,KAAK,EAAE,WAAW,CAAC;YAAC,MAAM,EAAE,WAAW,CAAC;YAAC,OAAO,CAAC,EAAE,MAAM,CAAA;SAAE,CAAC;KACxF,CAAC,CAAC;IACH,uBAAuB,CAAC,aAAa,EAAE,MAAM,GAAG,MAAM,CAAC;IAGvD,iBAAiB,CAAC,CAAC,GAAG,OAAO,EAC5B,OAAO,EAAE,IAAI,CAAC,aAAa,CAAC,CAAC,CAAC,EAAE,YAAY,GAAG,SAAS,GAAG,SAAS,GAAG,SAAS,CAAC,EACjF,OAAO,CAAC,EAAE;QAAE,WAAW,CAAC,EAAE,OAAO,CAAC;QAAC,SAAS,CAAC,EAAE,OAAO,GAAG,UAAU,GAAG,UAAU,CAAA;KAAE,GAChF,OAAO,CAAC,IAAI,CAAC,CAAC;IACjB,eAAe,CACd,OAAO,EAAE,MAAM,GAAG,CAAC,WAAW,GAAG,YAAY,CAAC,EAAE,EAChD,OAAO,CAAC,EAAE;QAAE,SAAS,CAAC,EAAE,OAAO,GAAG,UAAU,CAAC;QAAC,qBAAqB,CAAC,EAAE,OAAO,CAAA;KAAE,GAC7E,OAAO,CAAC,IAAI,CAAC,CAAC;IACjB,cAAc,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;IACnC,OAAO,CAAC,kBAAkB,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,gBAAgB,GAAG,yBAAyB,CAAC,CAAC;CAC5F","sourcesContent":["/**\n * Shared internal contract and snapshot helpers for the agent-session\n * submodules (agent-session-bash.ts, agent-session-compaction.ts,\n * agent-session-context.ts, agent-session-lifecycle.ts, agent-session-loop.ts,\n * agent-session-retry.ts, agent-session-tools.ts, agent-session-model.ts;\n * agent-session-runtime.ts consumes the class directly).\n *\n * `AgentSession` satisfies {@link AgentSessionInternals} structurally through a\n * single internal cast; members mirror the private state and helpers that moved\n * into the submodules. Same-name delegates stay on the class so call sites,\n * dynamic dispatch, and test spies keep working unchanged.\n */\n\nimport type {\n\tAgent,\n\tAgentContext,\n\tAgentEvent,\n\tAgentLoopTurnUpdate,\n\tAgentMessage,\n\tAgentTool,\n\tPrepareNextTurnContext,\n\tThinkingLevel,\n} from \"@agent-forge/agent-core\";\nimport type {\n\tApi,\n\tAssistantMessage,\n\tImageContent,\n\tModel,\n\tTextContent,\n\tToolResultMessage,\n} from \"@agent-forge/ai/compat\";\nimport type {\n\tAgentSessionEvent,\n\tModelCycleResult,\n\tModelMutationOptions,\n\tSessionStats,\n\tTurnAbortReason,\n} from \"./agent-session.ts\";\nimport type { CompactionCancelledResult } from \"./agent-session-compaction.ts\";\nimport type { LoopExecutor } from \"./agent-session-loop-runner.ts\";\nimport type { BashResult } from \"./bash-executor.ts\";\nimport type { CompactionResult } from \"./compaction/index.ts\";\nimport type { CapabilityPluginHandle, CapabilityRuntime, ContextOperationOptions } from \"./extensions/index.ts\";\nimport type { ModelStreamEventDataV1 } from \"./extensions/lifecycle-catalog.ts\";\nimport type { ContextUsage, ExecutionFactsV1 } from \"./extensions/public-api.ts\";\nimport type { HostLogger } from \"./logger.ts\";\nimport type { BashExecutionMessage, CustomMessage } from \"./messages.ts\";\nimport type { ModelRuntime } from \"./model-runtime.ts\";\nimport type { PromptTemplate } from \"./prompt-templates.ts\";\nimport type { ResourceLoader } from \"./resource-loader.ts\";\nimport type { BranchSummaryEntry, SessionManager } from \"./session-manager.ts\";\nimport type { SettingsManager } from \"./settings-manager.ts\";\nimport type { Skill } from \"./skills.ts\";\nimport type { SourceInfo } from \"./source-info.ts\";\nimport type { BuildSystemPromptOptions } from \"./system-prompt.ts\";\nimport type { BashOperations } from \"./tools/bash.ts\";\nimport type { ToolDefinition, ToolInfo } from \"./tools/tool-definition.ts\";\n\n/** Registry entry for one tool definition with its source metadata. */\nexport interface ToolDefinitionEntry {\n\tdefinition: ToolDefinition;\n\tsourceInfo: SourceInfo;\n}\n\n/**\n * A session operation was cancelled by user intent (abort, reload barrier) — a\n * normal outcome, never a failure. Host boundaries resolve with structured\n * cancelled results instead of surfacing this as an error.\n */\nexport class SessionCancelledError extends Error {\n\treadonly reason: \"reload\" | \"signal\";\n\n\tconstructor(reason: SessionCancelledError[\"reason\"]) {\n\t\tsuper(`Session operation cancelled: ${reason}`);\n\t\tthis.name = \"SessionCancelledError\";\n\t\tthis.reason = reason;\n\t}\n}\n\n/**\n * Deep-clone a session value and freeze the clone so lifecycle payloads cannot\n * be mutated in place. The implementation lives on the public extension face\n * (`./extensions/public-api.ts`) so first-party and third-party plugins share\n * the same payload-projection contract; re-exported here for the host-internal\n * session submodules.\n */\nexport { detachedSessionSnapshot } from \"./extensions/public-api.ts\";\n\n/** JSON-safe clone for lifecycle payloads that must survive structured clone failures. */\nexport function jsonSafeSessionSnapshot<T>(value: T): T {\n\tconst serialized = JSON.stringify(value);\n\t// v8 ignore next -- 对象消息序列化永远返回字符串,undefined 分支不可达\n\treturn serialized === undefined ? (null as T) : (JSON.parse(serialized) as T);\n}\n\nexport interface AgentSessionInternals {\n\treadonly agent: Agent;\n\treadonly sessionManager: SessionManager;\n\treadonly settingsManager: SettingsManager;\n\treadonly _modelRuntime: ModelRuntime;\n\treadonly model: Model<Api> | undefined;\n\treadonly thinkingLevel: ThinkingLevel;\n\treadonly sessionId: string;\n\treadonly isStreaming: boolean;\n\t/** Idle gate for public context operations (compile-time private getter on AgentSession). */\n\treadonly isIdle: boolean;\n\n\t// Internal session state (compile-time private on AgentSession)\n\t_compactionQueue: Promise<void>;\n\t_compactionAbortController: AbortController | undefined;\n\t_autoCompactionAbortController: AbortController | undefined;\n\t_overflowRecoveryAttempted: boolean;\n\t/** 已完成的溢出裁剪级数(0 = 未裁剪);与 `_overflowRecoveryAttempted` 同点位复位。 */\n\t_overflowTrimStage: number;\n\t/**\n\t * microcompact 冷却(按模型请求计数,0 = 不冷却):relief 落地时置满,\n\t * 每次 assistant message_end 减 1(下限 0);冷却期内阈值 decide 以\n\t * `microcompactEnabled: false` 关闭便宜缓解(背景注释见 agent-session.ts)。\n\t */\n\t_microcompactCooldown: number;\n\t_activeCompactionPromise: Promise<unknown> | undefined;\n\t_branchSummaryAbortController: AbortController | undefined;\n\t_branchSummaryPromise: Promise<unknown> | undefined;\n\t_resolveBranchSummaryPromise: (() => void) | undefined;\n\t_reloadInProgress: boolean;\n\t_policyDecisionAbortController: AbortController | undefined;\n\t_retryAbortController: AbortController | undefined;\n\t_retryAttempt: number;\n\t_pendingRetryDecision:\n\t\t| { message: AssistantMessage; decision: Awaited<ReturnType<CapabilityRuntime[\"decideRetry\"]>> }\n\t\t| undefined;\n\t_isAgentRunActive: boolean;\n\t_currentRunAborted: boolean;\n\t_lastAbortReason: TurnAbortReason | undefined;\n\t_lastAssistantMessage: AssistantMessage | undefined;\n\n\t// Lifecycle dispatch state (compile-time private on AgentSession)\n\treadonly _modelStreamState: { streamId: string; sequence: number } | undefined;\n\t/** Correlation id for the active prompt run's lifecycle dispatches; written by the loop-runner via this facade. */\n\t_turnCorrelationId: string | undefined;\n\t_turnCorrelationCounter: number;\n\t/**\n\t * Host-process logger seam (会话轨迹第 2 期,设计 §5.2): one-line process log\n\t * beside lifecycle dispatches that report genuine failures (compaction\n\t * failed). Undefined when no hostLogger was configured; call sites treat it\n\t * as a no-op.\n\t */\n\treadonly _hostLogger?: HostLogger;\n\n\t// Bash execution state (compile-time private on AgentSession)\n\treadonly _bashAbortControllers: Set<AbortController>;\n\treadonly _activeBashPromises: Set<Promise<unknown>>;\n\t_bashEpoch: number;\n\t_pendingBashMessages: BashExecutionMessage[];\n\treadonly isDisposed: boolean;\n\n\t_capabilityRuntime: CapabilityRuntime | undefined;\n\t_compactionPolicyName: string;\n\t_overflowPolicyName: string;\n\t_branchSummaryPolicyName: string;\n\t_retryPolicyName: string;\n\t_runLoopStrategyName: string;\n\t/** Internal loop-executor seam (D-043 G3): set to replace the default prompt/continue drive. No public config; distinct from `_runLoopStrategyName` (a per-continuation veto policy). */\n\t_loopExecutor: LoopExecutor | undefined;\n\n\t// Helpers that remain on AgentSession\n\t_emit(event: AgentSessionEvent): void;\n\t_resolveIdleWaitIfIdle(): void;\n\t_flushPendingCustomMessages(): void;\n\t_emitAgentSettled(): Promise<void>;\n\t_observeLifecycleDeliveryError(error: unknown, extensionPath: string, event: string): void;\n\tabort(): Promise<void>;\n\t_abortInternal(): Promise<void>;\n\n\t// Context-transition state and delegates forwarding to agent-session-context.ts\n\t/** Generation fence for context projections that may outlive a runtime replacement. */\n\t_contextEpoch: number;\n\t_contextTransitionAbortController: AbortController;\n\t/** Serializes context transitions and lets reload/dispose drain them before teardown. */\n\t_activeContextTransition: Promise<unknown> | undefined;\n\t/** Monotonic revision for the public context snapshot/commit facade. */\n\t_contextRevision: number;\n\t/** Serializes public context commits so expectedRevision is a real CAS fence. */\n\t_contextCommitQueue: Promise<void>;\n\t/** Configured external context strategy name, written only by the constructor. */\n\treadonly _contextStrategyName: string | undefined;\n\t_requireContextStrategy(): { runtime: CapabilityRuntime; name: string };\n\t_requireIdleContextOperation(operation: string): void;\n\t_beginContextTransitionFence(): void;\n\t_isContextTransitionCurrent(epoch: number, allowReload: boolean): boolean;\n\t_assertContextTransitionCurrent(epoch: number, allowReload: boolean): void;\n\t_enqueueContextTransition<T>(\n\t\toperation: (epoch: number, signal: AbortSignal) => Promise<T>,\n\t\toptions?: { signal?: AbortSignal; allowReload?: boolean },\n\t): Promise<T>;\n\t_copyContextMessages(value: unknown, strategyName: string, direction: \"input\" | \"result\"): AgentMessage[];\n\t_applyContextTransition(\n\t\tmessages: AgentMessage[],\n\t\treason?: ContextOperationOptions[\"reason\"],\n\t\tsignal?: AbortSignal,\n\t\toptions?: { allowReload?: boolean },\n\t): Promise<AgentMessage[]>;\n\t_restoreContextTransition(\n\t\tsnapshot: unknown,\n\t\treason: NonNullable<ContextOperationOptions[\"reason\"]>,\n\t\toptions?: { allowReload?: boolean },\n\t): Promise<AgentMessage[]>;\n\tsnapshotContext(): Promise<unknown>;\n\trestoreContext(snapshot: unknown): Promise<AgentMessage[]>;\n\treplaceContext(context: AgentMessage[]): Promise<AgentMessage[]>;\n\n\t// Model-scope state and delegates forwarding to agent-session-model.ts\n\t_scopedModels: Array<{ model: Model<Api>; thinkingLevel?: ThinkingLevel }>;\n\t/** Public scoped-models getter (Legacy 迁移 R1): submodules read via this instead of the private field. */\n\treadonly scopedModels: ReadonlyArray<{ model: Model<Api>; thinkingLevel?: ThinkingLevel }>;\n\tsetModel(model: Model<Api>, options?: ModelMutationOptions): Promise<void>;\n\tsetThinkingLevel(level: ThinkingLevel, options?: ModelMutationOptions): void;\n\t_emitModelSelect(\n\t\tnextModel: Model<Api>,\n\t\tpreviousModel: Model<Api> | undefined,\n\t\tsource: \"set\" | \"cycle\" | \"restore\",\n\t): Promise<void>;\n\t_addPersistedDefaultToNonEmptyScope(model: Model<Api>): void;\n\t_getThinkingLevelForModelSwitch(targetModel?: Model<Api>, explicitLevel?: ThinkingLevel): ThinkingLevel;\n\t_cycleScopedModel(\n\t\tdirection: \"forward\" | \"backward\",\n\t\toptions: ModelMutationOptions,\n\t): Promise<ModelCycleResult | undefined>;\n\t_cycleAvailableModel(\n\t\tdirection: \"forward\" | \"backward\",\n\t\toptions: ModelMutationOptions,\n\t): Promise<ModelCycleResult | undefined>;\n\n\t// Run-loop wiring state and delegates forwarding to agent-session-loop.ts\n\t/** The agent's construction-time prepare adapter, captured once by the loop wiring install. */\n\t_initialPrepareNextTurn:\n\t\t| ((\n\t\t\t\tcontext: PrepareNextTurnContext,\n\t\t\t\tsignal?: AbortSignal,\n\t\t ) => Promise<AgentLoopTurnUpdate | undefined> | AgentLoopTurnUpdate | undefined)\n\t\t| undefined;\n\n\t// Delegates forwarding to the submodule functions\n\t_compactBeforeNextAssistantResponse(context: AgentContext, signal?: AbortSignal): Promise<AgentContext>;\n\t_enqueueCompaction<T>(operation: () => Promise<T>): Promise<T>;\n\t_compactInternal(customInstructions?: string): Promise<CompactionResult>;\n\t_checkCompaction(\n\t\tassistantMessage: AssistantMessage,\n\t\tskipAbortedCheck?: boolean,\n\t\tsignal?: AbortSignal,\n\t): Promise<boolean>;\n\t_runAutoCompaction(reason: \"overflow\" | \"threshold\", willRetry: boolean): Promise<boolean>;\n\t_willRetryAfterAgentEnd(event: Extract<AgentEvent, { type: \"agent_end\" }>, signal?: AbortSignal): Promise<boolean>;\n\t_isRetryableError(message: AssistantMessage, execution?: ExecutionFactsV1, signal?: AbortSignal): Promise<boolean>;\n\t_prepareRetry(\n\t\tmessage: AssistantMessage,\n\t\tprecomputedDecision?: Awaited<ReturnType<CapabilityRuntime[\"decideRetry\"]>>,\n\t): Promise<boolean>;\n\tnavigateTree(\n\t\ttargetId: string,\n\t\toptions?: { summarize?: boolean; customInstructions?: string; replaceInstructions?: boolean; label?: string },\n\t): Promise<{ editorText?: string; cancelled: boolean; aborted?: boolean; summaryEntry?: BranchSummaryEntry }>;\n\n\t// Lifecycle delegates forwarding to agent-session-lifecycle.ts\n\t_dispatchModelStreamLifecycle(\n\t\tmessage: AgentMessage,\n\t\teventName: ModelStreamEventDataV1[\"event\"],\n\t\tphase: ModelStreamEventDataV1[\"phase\"],\n\t): Promise<void>;\n\t_dispatchContextReplacedLifecycle(\n\t\treason: NonNullable<ContextOperationOptions[\"reason\"]>,\n\t\tstrategyName?: string,\n\t): Promise<void>;\n\t_dispatchModelResponseLifecycle(message: AssistantMessage, entryId: string): Promise<void>;\n\t_dispatchToolCommitLifecycle(message: ToolResultMessage, entryId: string): Promise<void>;\n\t_dispatchToolResultLifecycle(message: ToolResultMessage, entryId: string): Promise<void>;\n\t_dispatchSessionReloadLifecycle(generation: number): Promise<void>;\n\n\t// Bash delegates forwarding to agent-session-bash.ts\n\tcaptureBashEpoch(): number;\n\tisBashEpochCurrent(epoch: number): boolean;\n\temitUserBash(excludeFromContext: boolean): void;\n\texecuteBash(\n\t\tcommand: string,\n\t\tonChunk?: (chunk: string) => void,\n\t\toptions?: { excludeFromContext?: boolean; id?: string; operations?: BashOperations },\n\t): Promise<BashResult>;\n\trecordBashResult(\n\t\tcommand: string,\n\t\tresult: BashResult,\n\t\toptions?: { excludeFromContext?: boolean; epoch?: number },\n\t): void;\n\tabortBash(): void;\n\t_flushPendingBashMessages(): void;\n\n\t// Tool registry state (compile-time private on AgentSession)\n\t_resourceLoader: ResourceLoader;\n\t_customTools: ToolDefinition[];\n\t_deferredToolPluginIds: ReadonlySet<string>;\n\t_baseToolDefinitions: Map<string, ToolDefinition>;\n\t_baseToolSources: Map<string, SourceInfo>;\n\t_toolRegistry: Map<string, AgentTool>;\n\t_toolDefinitions: Map<string, ToolDefinitionEntry>;\n\t_toolPromptSnippets: Map<string, string>;\n\t_toolPromptGuidelines: Map<string, string[]>;\n\t_allowedToolNames: Set<string> | undefined;\n\t_excludedToolNames: Set<string> | undefined;\n\t_baseSystemPrompt: string;\n\t_baseSystemPromptOptions: BuildSystemPromptOptions;\n\t_systemPromptOverride: string | undefined;\n\t_orientationPrompt: string | undefined;\n\t_preferenceCard: string | undefined;\n\t_capabilitySkillsFilter: ((skills: Skill[]) => Skill[]) | undefined;\n\t_bootstrapSkillsHandle: CapabilityPluginHandle | undefined;\n\t_cwd: string;\n\n\tgetActiveToolNames(): string[];\n\n\t// Tool registry delegates forwarding to agent-session-tools.ts\n\tgetAllTools(): ToolInfo[];\n\tgetToolDefinition(name: string): ToolDefinition | undefined;\n\tsetActiveToolsByName(toolNames: string[]): void;\n\t_rebuildSystemPrompt(toolNames: string[]): string;\n\t_refreshToolRegistry(options?: { activeToolNames?: string[]; includeAllExtensionTools?: boolean }): void;\n\t_syncCapabilityTools(): void;\n\t_getCapabilitySkills(): Skill[];\n\t_getAvailableSkills(): Skill[];\n\t_validateCapabilitySkillConflicts(): void;\n\t_refreshBootstrapSkills(): Promise<void>;\n\n\t// Read-only projections and delegates forwarding to agent-session-projection.ts\n\treadonly sessionFile: string | undefined;\n\treadonly messages: AgentMessage[];\n\treadonly systemPrompt: string;\n\treadonly promptTemplates: ReadonlyArray<PromptTemplate>;\n\treadonly pendingMessageCount: number;\n\tgetSessionStats(): SessionStats;\n\tgetContextUsage(): ContextUsage | undefined;\n\tgetUserMessagesForForking(): Array<{ entryId: string; text: string }>;\n\texportToHtml(outputPath?: string, options?: { themeName?: string }): Promise<string>;\n\texportToJsonl(outputPath?: string): string;\n\tgetLastAssistantText(): string | undefined;\n\n\t// Resource-discovery delegates forwarding to agent-session-extensions.ts\n\textendResourcesFromExtensions(reason: \"startup\" | \"reload\"): Promise<void>;\n\tbuildExtensionResourcePaths(entries: Array<{ path: string; extensionPath: string }>): Array<{\n\t\tpath: string;\n\t\tmetadata: { source: string; scope: \"temporary\"; origin: \"top-level\"; baseDir?: string };\n\t}>;\n\tgetExtensionSourceLabel(extensionPath: string): string;\n\n\t// Prompt/queue surface consumed by the extension binding closures\n\tsendCustomMessage<T = unknown>(\n\t\tmessage: Pick<CustomMessage<T>, \"customType\" | \"content\" | \"display\" | \"details\">,\n\t\toptions?: { triggerTurn?: boolean; deliverAs?: \"steer\" | \"followUp\" | \"nextTurn\" },\n\t): Promise<void>;\n\tsendUserMessage(\n\t\tcontent: string | (TextContent | ImageContent)[],\n\t\toptions?: { deliverAs?: \"steer\" | \"followUp\"; expandPromptTemplates?: boolean },\n\t): Promise<void>;\n\tsetSessionName(name: string): void;\n\tcompact(customInstructions?: string): Promise<CompactionResult | CompactionCancelledResult>;\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"agent-session-internal.js","sourceRoot":"","sources":["../../src/core/agent-session-internal.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAqDH;;;;GAIG;AACH,MAAM,OAAO,qBAAsB,SAAQ,KAAK;IACtC,MAAM,CAAsB;IAErC,YAAY,MAAuC,EAAE;QACpD,KAAK,CAAC,gCAAgC,MAAM,EAAE,CAAC,CAAC;QAChD,IAAI,CAAC,IAAI,GAAG,uBAAuB,CAAC;QACpC,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;IAAA,CACrB;CACD;AAED;;;;;;GAMG;AACH,OAAO,EAAE,uBAAuB,EAAE,MAAM,4BAA4B,CAAC;AAErE,0FAA0F;AAC1F,MAAM,UAAU,uBAAuB,CAAI,KAAQ,EAAK;IACvD,MAAM,UAAU,GAAG,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC;IACzC,2FAAmD;IACnD,OAAO,UAAU,KAAK,SAAS,CAAC,CAAC,CAAE,IAAU,CAAC,CAAC,CAAE,IAAI,CAAC,KAAK,CAAC,UAAU,CAAO,CAAC;AAAA,CAC9E","sourcesContent":["/**\n * Shared internal contract and snapshot helpers for the agent-session\n * submodules (agent-session-bash.ts, agent-session-compaction.ts,\n * agent-session-context.ts, agent-session-lifecycle.ts, agent-session-loop.ts,\n * agent-session-retry.ts, agent-session-tools.ts, agent-session-model.ts;\n * agent-session-runtime.ts consumes the class directly).\n *\n * `AgentSession` satisfies {@link AgentSessionInternals} structurally through a\n * single internal cast; members mirror the private state and helpers that moved\n * into the submodules. Same-name delegates stay on the class so call sites,\n * dynamic dispatch, and test spies keep working unchanged.\n */\n\nimport type {\n\tAgent,\n\tAgentContext,\n\tAgentEvent,\n\tAgentLoopTurnUpdate,\n\tAgentMessage,\n\tAgentTool,\n\tPrepareNextTurnContext,\n\tThinkingLevel,\n} from \"@agent-forge/agent-core\";\nimport type {\n\tApi,\n\tAssistantMessage,\n\tImageContent,\n\tModel,\n\tTextContent,\n\tToolResultMessage,\n} from \"@agent-forge/ai/compat\";\nimport type {\n\tAgentSessionEvent,\n\tModelCycleResult,\n\tModelMutationOptions,\n\tSessionStats,\n\tTurnAbortReason,\n} from \"./agent-session.ts\";\nimport type { CompactionCancelledResult } from \"./agent-session-compaction.ts\";\nimport type { LoopExecutor } from \"./agent-session-loop-runner.ts\";\nimport type { BashResult } from \"./bash-executor.ts\";\nimport type { CompactionResult } from \"./compaction/index.ts\";\nimport type { CapabilityPluginHandle, CapabilityRuntime, ContextOperationOptions } from \"./extensions/index.ts\";\nimport type { ModelStreamEventDataV1 } from \"./extensions/lifecycle-catalog.ts\";\nimport type { ContextUsage, ExecutionFactsV1 } from \"./extensions/public-api.ts\";\nimport type { HostLogger } from \"./logger.ts\";\nimport type { BashExecutionMessage, CustomMessage } from \"./messages.ts\";\nimport type { ModelRuntime } from \"./model-runtime.ts\";\nimport type { PromptTemplate } from \"./prompt-templates.ts\";\nimport type { ResourceLoader } from \"./resource-loader.ts\";\nimport type { BranchSummaryEntry, SessionManager } from \"./session-manager.ts\";\nimport type { SettingsManager } from \"./settings-manager.ts\";\nimport type { Skill } from \"./skills.ts\";\nimport type { SourceInfo } from \"./source-info.ts\";\nimport type { BuildSystemPromptOptions } from \"./system-prompt.ts\";\nimport type { BashOperations } from \"./tools/bash.ts\";\nimport type { ToolDefinition, ToolInfo } from \"./tools/tool-definition.ts\";\n\n/** Registry entry for one tool definition with its source metadata. */\nexport interface ToolDefinitionEntry {\n\tdefinition: ToolDefinition;\n\tsourceInfo: SourceInfo;\n}\n\n/**\n * A session operation was cancelled by user intent (abort, reload barrier) — a\n * normal outcome, never a failure. Host boundaries resolve with structured\n * cancelled results instead of surfacing this as an error.\n */\nexport class SessionCancelledError extends Error {\n\treadonly reason: \"reload\" | \"signal\";\n\n\tconstructor(reason: SessionCancelledError[\"reason\"]) {\n\t\tsuper(`Session operation cancelled: ${reason}`);\n\t\tthis.name = \"SessionCancelledError\";\n\t\tthis.reason = reason;\n\t}\n}\n\n/**\n * Deep-clone a session value and freeze the clone so lifecycle payloads cannot\n * be mutated in place. The implementation lives on the public extension face\n * (`./extensions/public-api.ts`) so first-party and third-party plugins share\n * the same payload-projection contract; re-exported here for the host-internal\n * session submodules.\n */\nexport { detachedSessionSnapshot } from \"./extensions/public-api.ts\";\n\n/** JSON-safe clone for lifecycle payloads that must survive structured clone failures. */\nexport function jsonSafeSessionSnapshot<T>(value: T): T {\n\tconst serialized = JSON.stringify(value);\n\t// v8 ignore next -- 对象消息序列化永远返回字符串,undefined 分支不可达\n\treturn serialized === undefined ? (null as T) : (JSON.parse(serialized) as T);\n}\n\nexport interface AgentSessionInternals {\n\treadonly agent: Agent;\n\treadonly sessionManager: SessionManager;\n\treadonly settingsManager: SettingsManager;\n\treadonly _modelRuntime: ModelRuntime;\n\treadonly model: Model<Api> | undefined;\n\treadonly thinkingLevel: ThinkingLevel;\n\treadonly sessionId: string;\n\treadonly isStreaming: boolean;\n\t/** Idle gate for public context operations (compile-time private getter on AgentSession). */\n\treadonly isIdle: boolean;\n\n\t// Internal session state (compile-time private on AgentSession)\n\t_compactionQueue: Promise<void>;\n\t_compactionAbortController: AbortController | undefined;\n\t_autoCompactionAbortController: AbortController | undefined;\n\t_overflowRecoveryAttempted: boolean;\n\t/** 已完成的溢出裁剪级数(0 = 未裁剪);与 `_overflowRecoveryAttempted` 同点位复位。 */\n\t_overflowTrimStage: number;\n\t_activeCompactionPromise: Promise<unknown> | undefined;\n\t_branchSummaryAbortController: AbortController | undefined;\n\t_branchSummaryPromise: Promise<unknown> | undefined;\n\t_resolveBranchSummaryPromise: (() => void) | undefined;\n\t_reloadInProgress: boolean;\n\t_policyDecisionAbortController: AbortController | undefined;\n\t_retryAbortController: AbortController | undefined;\n\t_retryAttempt: number;\n\t_pendingRetryDecision:\n\t\t| { message: AssistantMessage; decision: Awaited<ReturnType<CapabilityRuntime[\"decideRetry\"]>> }\n\t\t| undefined;\n\t_isAgentRunActive: boolean;\n\t_currentRunAborted: boolean;\n\t_lastAbortReason: TurnAbortReason | undefined;\n\t_lastAssistantMessage: AssistantMessage | undefined;\n\n\t// Lifecycle dispatch state (compile-time private on AgentSession)\n\treadonly _modelStreamState: { streamId: string; sequence: number } | undefined;\n\t/** Correlation id for the active prompt run's lifecycle dispatches; written by the loop-runner via this facade. */\n\t_turnCorrelationId: string | undefined;\n\t_turnCorrelationCounter: number;\n\t/**\n\t * Host-process logger seam (会话轨迹第 2 期,设计 §5.2): one-line process log\n\t * beside lifecycle dispatches that report genuine failures (compaction\n\t * failed). Undefined when no hostLogger was configured; call sites treat it\n\t * as a no-op.\n\t */\n\treadonly _hostLogger?: HostLogger;\n\n\t// Bash execution state (compile-time private on AgentSession)\n\treadonly _bashAbortControllers: Set<AbortController>;\n\treadonly _activeBashPromises: Set<Promise<unknown>>;\n\t_bashEpoch: number;\n\t_pendingBashMessages: BashExecutionMessage[];\n\treadonly isDisposed: boolean;\n\n\t_capabilityRuntime: CapabilityRuntime | undefined;\n\t_compactionPolicyName: string;\n\t_overflowPolicyName: string;\n\t_branchSummaryPolicyName: string;\n\t_retryPolicyName: string;\n\t_runLoopStrategyName: string;\n\t/** Internal loop-executor seam (D-043 G3): set to replace the default prompt/continue drive. No public config; distinct from `_runLoopStrategyName` (a per-continuation veto policy). */\n\t_loopExecutor: LoopExecutor | undefined;\n\n\t// Helpers that remain on AgentSession\n\t_emit(event: AgentSessionEvent): void;\n\t_resolveIdleWaitIfIdle(): void;\n\t_flushPendingCustomMessages(): void;\n\t_emitAgentSettled(): Promise<void>;\n\t_observeLifecycleDeliveryError(error: unknown, extensionPath: string, event: string): void;\n\tabort(): Promise<void>;\n\t_abortInternal(): Promise<void>;\n\n\t// Context-transition state and delegates forwarding to agent-session-context.ts\n\t/** Generation fence for context projections that may outlive a runtime replacement. */\n\t_contextEpoch: number;\n\t_contextTransitionAbortController: AbortController;\n\t/** Serializes context transitions and lets reload/dispose drain them before teardown. */\n\t_activeContextTransition: Promise<unknown> | undefined;\n\t/** Monotonic revision for the public context snapshot/commit facade. */\n\t_contextRevision: number;\n\t/** Serializes public context commits so expectedRevision is a real CAS fence. */\n\t_contextCommitQueue: Promise<void>;\n\t/** Configured external context strategy name, written only by the constructor. */\n\treadonly _contextStrategyName: string | undefined;\n\t_requireContextStrategy(): { runtime: CapabilityRuntime; name: string };\n\t_requireIdleContextOperation(operation: string): void;\n\t_beginContextTransitionFence(): void;\n\t_isContextTransitionCurrent(epoch: number, allowReload: boolean): boolean;\n\t_assertContextTransitionCurrent(epoch: number, allowReload: boolean): void;\n\t_enqueueContextTransition<T>(\n\t\toperation: (epoch: number, signal: AbortSignal) => Promise<T>,\n\t\toptions?: { signal?: AbortSignal; allowReload?: boolean },\n\t): Promise<T>;\n\t_copyContextMessages(value: unknown, strategyName: string, direction: \"input\" | \"result\"): AgentMessage[];\n\t_applyContextTransition(\n\t\tmessages: AgentMessage[],\n\t\treason?: ContextOperationOptions[\"reason\"],\n\t\tsignal?: AbortSignal,\n\t\toptions?: { allowReload?: boolean },\n\t): Promise<AgentMessage[]>;\n\t_restoreContextTransition(\n\t\tsnapshot: unknown,\n\t\treason: NonNullable<ContextOperationOptions[\"reason\"]>,\n\t\toptions?: { allowReload?: boolean },\n\t): Promise<AgentMessage[]>;\n\tsnapshotContext(): Promise<unknown>;\n\trestoreContext(snapshot: unknown): Promise<AgentMessage[]>;\n\treplaceContext(context: AgentMessage[]): Promise<AgentMessage[]>;\n\n\t// Model-scope state and delegates forwarding to agent-session-model.ts\n\t_scopedModels: Array<{ model: Model<Api>; thinkingLevel?: ThinkingLevel }>;\n\t/** Public scoped-models getter (Legacy 迁移 R1): submodules read via this instead of the private field. */\n\treadonly scopedModels: ReadonlyArray<{ model: Model<Api>; thinkingLevel?: ThinkingLevel }>;\n\tsetModel(model: Model<Api>, options?: ModelMutationOptions): Promise<void>;\n\tsetThinkingLevel(level: ThinkingLevel, options?: ModelMutationOptions): void;\n\t_emitModelSelect(\n\t\tnextModel: Model<Api>,\n\t\tpreviousModel: Model<Api> | undefined,\n\t\tsource: \"set\" | \"cycle\" | \"restore\",\n\t): Promise<void>;\n\t_addPersistedDefaultToNonEmptyScope(model: Model<Api>): void;\n\t_getThinkingLevelForModelSwitch(targetModel?: Model<Api>, explicitLevel?: ThinkingLevel): ThinkingLevel;\n\t_cycleScopedModel(\n\t\tdirection: \"forward\" | \"backward\",\n\t\toptions: ModelMutationOptions,\n\t): Promise<ModelCycleResult | undefined>;\n\t_cycleAvailableModel(\n\t\tdirection: \"forward\" | \"backward\",\n\t\toptions: ModelMutationOptions,\n\t): Promise<ModelCycleResult | undefined>;\n\n\t// Run-loop wiring state and delegates forwarding to agent-session-loop.ts\n\t/** The agent's construction-time prepare adapter, captured once by the loop wiring install. */\n\t_initialPrepareNextTurn:\n\t\t| ((\n\t\t\t\tcontext: PrepareNextTurnContext,\n\t\t\t\tsignal?: AbortSignal,\n\t\t ) => Promise<AgentLoopTurnUpdate | undefined> | AgentLoopTurnUpdate | undefined)\n\t\t| undefined;\n\n\t// Delegates forwarding to the submodule functions\n\t_compactBeforeNextAssistantResponse(context: AgentContext, signal?: AbortSignal): Promise<AgentContext>;\n\t_enqueueCompaction<T>(operation: () => Promise<T>): Promise<T>;\n\t_compactInternal(customInstructions?: string): Promise<CompactionResult>;\n\t_checkCompaction(\n\t\tassistantMessage: AssistantMessage,\n\t\tskipAbortedCheck?: boolean,\n\t\tsignal?: AbortSignal,\n\t): Promise<boolean>;\n\t_runAutoCompaction(reason: \"overflow\" | \"threshold\", willRetry: boolean): Promise<boolean>;\n\t_willRetryAfterAgentEnd(event: Extract<AgentEvent, { type: \"agent_end\" }>, signal?: AbortSignal): Promise<boolean>;\n\t_isRetryableError(message: AssistantMessage, execution?: ExecutionFactsV1, signal?: AbortSignal): Promise<boolean>;\n\t_prepareRetry(\n\t\tmessage: AssistantMessage,\n\t\tprecomputedDecision?: Awaited<ReturnType<CapabilityRuntime[\"decideRetry\"]>>,\n\t): Promise<boolean>;\n\tnavigateTree(\n\t\ttargetId: string,\n\t\toptions?: { summarize?: boolean; customInstructions?: string; replaceInstructions?: boolean; label?: string },\n\t): Promise<{ editorText?: string; cancelled: boolean; aborted?: boolean; summaryEntry?: BranchSummaryEntry }>;\n\n\t// Lifecycle delegates forwarding to agent-session-lifecycle.ts\n\t_dispatchModelStreamLifecycle(\n\t\tmessage: AgentMessage,\n\t\teventName: ModelStreamEventDataV1[\"event\"],\n\t\tphase: ModelStreamEventDataV1[\"phase\"],\n\t): Promise<void>;\n\t_dispatchContextReplacedLifecycle(\n\t\treason: NonNullable<ContextOperationOptions[\"reason\"]>,\n\t\tstrategyName?: string,\n\t): Promise<void>;\n\t_dispatchModelResponseLifecycle(message: AssistantMessage, entryId: string): Promise<void>;\n\t_dispatchToolCommitLifecycle(message: ToolResultMessage, entryId: string): Promise<void>;\n\t_dispatchToolResultLifecycle(message: ToolResultMessage, entryId: string): Promise<void>;\n\t_dispatchSessionReloadLifecycle(generation: number): Promise<void>;\n\n\t// Bash delegates forwarding to agent-session-bash.ts\n\tcaptureBashEpoch(): number;\n\tisBashEpochCurrent(epoch: number): boolean;\n\temitUserBash(excludeFromContext: boolean): void;\n\texecuteBash(\n\t\tcommand: string,\n\t\tonChunk?: (chunk: string) => void,\n\t\toptions?: { excludeFromContext?: boolean; id?: string; operations?: BashOperations },\n\t): Promise<BashResult>;\n\trecordBashResult(\n\t\tcommand: string,\n\t\tresult: BashResult,\n\t\toptions?: { excludeFromContext?: boolean; epoch?: number },\n\t): void;\n\tabortBash(): void;\n\t_flushPendingBashMessages(): void;\n\n\t// Tool registry state (compile-time private on AgentSession)\n\t_resourceLoader: ResourceLoader;\n\t_customTools: ToolDefinition[];\n\t_deferredToolPluginIds: ReadonlySet<string>;\n\t_baseToolDefinitions: Map<string, ToolDefinition>;\n\t_baseToolSources: Map<string, SourceInfo>;\n\t_toolRegistry: Map<string, AgentTool>;\n\t_toolDefinitions: Map<string, ToolDefinitionEntry>;\n\t_toolPromptSnippets: Map<string, string>;\n\t_toolPromptGuidelines: Map<string, string[]>;\n\t_allowedToolNames: Set<string> | undefined;\n\t_excludedToolNames: Set<string> | undefined;\n\t_baseSystemPrompt: string;\n\t_baseSystemPromptOptions: BuildSystemPromptOptions;\n\t_systemPromptOverride: string | undefined;\n\t_orientationPrompt: string | undefined;\n\t_preferenceCard: string | undefined;\n\t_capabilitySkillsFilter: ((skills: Skill[]) => Skill[]) | undefined;\n\t_bootstrapSkillsHandle: CapabilityPluginHandle | undefined;\n\t_cwd: string;\n\n\tgetActiveToolNames(): string[];\n\n\t// Tool registry delegates forwarding to agent-session-tools.ts\n\tgetAllTools(): ToolInfo[];\n\tgetToolDefinition(name: string): ToolDefinition | undefined;\n\tsetActiveToolsByName(toolNames: string[]): void;\n\t_rebuildSystemPrompt(toolNames: string[]): string;\n\t_refreshToolRegistry(options?: { activeToolNames?: string[]; includeAllExtensionTools?: boolean }): void;\n\t_syncCapabilityTools(): void;\n\t_getCapabilitySkills(): Skill[];\n\t_getAvailableSkills(): Skill[];\n\t_validateCapabilitySkillConflicts(): void;\n\t_refreshBootstrapSkills(): Promise<void>;\n\n\t// Read-only projections and delegates forwarding to agent-session-projection.ts\n\treadonly sessionFile: string | undefined;\n\treadonly messages: AgentMessage[];\n\treadonly systemPrompt: string;\n\treadonly promptTemplates: ReadonlyArray<PromptTemplate>;\n\treadonly pendingMessageCount: number;\n\tgetSessionStats(): SessionStats;\n\tgetContextUsage(): ContextUsage | undefined;\n\tgetUserMessagesForForking(): Array<{ entryId: string; text: string }>;\n\texportToHtml(outputPath?: string, options?: { themeName?: string }): Promise<string>;\n\texportToJsonl(outputPath?: string): string;\n\tgetLastAssistantText(): string | undefined;\n\n\t// Resource-discovery delegates forwarding to agent-session-extensions.ts\n\textendResourcesFromExtensions(reason: \"startup\" | \"reload\"): Promise<void>;\n\tbuildExtensionResourcePaths(entries: Array<{ path: string; extensionPath: string }>): Array<{\n\t\tpath: string;\n\t\tmetadata: { source: string; scope: \"temporary\"; origin: \"top-level\"; baseDir?: string };\n\t}>;\n\tgetExtensionSourceLabel(extensionPath: string): string;\n\n\t// Prompt/queue surface consumed by the extension binding closures\n\tsendCustomMessage<T = unknown>(\n\t\tmessage: Pick<CustomMessage<T>, \"customType\" | \"content\" | \"display\" | \"details\">,\n\t\toptions?: { triggerTurn?: boolean; deliverAs?: \"steer\" | \"followUp\" | \"nextTurn\" },\n\t): Promise<void>;\n\tsendUserMessage(\n\t\tcontent: string | (TextContent | ImageContent)[],\n\t\toptions?: { deliverAs?: \"steer\" | \"followUp\"; expandPromptTemplates?: boolean },\n\t): Promise<void>;\n\tsetSessionName(name: string): void;\n\tcompact(customInstructions?: string): Promise<CompactionResult | CompactionCancelledResult>;\n}\n"]}
1
+ {"version":3,"file":"agent-session-internal.js","sourceRoot":"","sources":["../../src/core/agent-session-internal.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAqDH;;;;GAIG;AACH,MAAM,OAAO,qBAAsB,SAAQ,KAAK;IACtC,MAAM,CAAsB;IAErC,YAAY,MAAuC,EAAE;QACpD,KAAK,CAAC,gCAAgC,MAAM,EAAE,CAAC,CAAC;QAChD,IAAI,CAAC,IAAI,GAAG,uBAAuB,CAAC;QACpC,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;IAAA,CACrB;CACD;AAED;;;;;;GAMG;AACH,OAAO,EAAE,uBAAuB,EAAE,MAAM,4BAA4B,CAAC;AAErE,0FAA0F;AAC1F,MAAM,UAAU,uBAAuB,CAAI,KAAQ,EAAK;IACvD,MAAM,UAAU,GAAG,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC;IACzC,2FAAmD;IACnD,OAAO,UAAU,KAAK,SAAS,CAAC,CAAC,CAAE,IAAU,CAAC,CAAC,CAAE,IAAI,CAAC,KAAK,CAAC,UAAU,CAAO,CAAC;AAAA,CAC9E","sourcesContent":["/**\n * Shared internal contract and snapshot helpers for the agent-session\n * submodules (agent-session-bash.ts, agent-session-compaction.ts,\n * agent-session-context.ts, agent-session-lifecycle.ts, agent-session-loop.ts,\n * agent-session-retry.ts, agent-session-tools.ts, agent-session-model.ts;\n * agent-session-runtime.ts consumes the class directly).\n *\n * `AgentSession` satisfies {@link AgentSessionInternals} structurally through a\n * single internal cast; members mirror the private state and helpers that moved\n * into the submodules. Same-name delegates stay on the class so call sites,\n * dynamic dispatch, and test spies keep working unchanged.\n */\n\nimport type {\n\tAgent,\n\tAgentContext,\n\tAgentEvent,\n\tAgentLoopTurnUpdate,\n\tAgentMessage,\n\tAgentTool,\n\tPrepareNextTurnContext,\n\tThinkingLevel,\n} from \"@agent-forge/agent-core\";\nimport type {\n\tApi,\n\tAssistantMessage,\n\tImageContent,\n\tModel,\n\tTextContent,\n\tToolResultMessage,\n} from \"@agent-forge/ai/compat\";\nimport type {\n\tAgentSessionEvent,\n\tModelCycleResult,\n\tModelMutationOptions,\n\tSessionStats,\n\tTurnAbortReason,\n} from \"./agent-session.ts\";\nimport type { CompactionCancelledResult } from \"./agent-session-compaction.ts\";\nimport type { LoopExecutor } from \"./agent-session-loop-runner.ts\";\nimport type { BashResult } from \"./bash-executor.ts\";\nimport type { CompactionResult } from \"./compaction/index.ts\";\nimport type { CapabilityPluginHandle, CapabilityRuntime, ContextOperationOptions } from \"./extensions/index.ts\";\nimport type { ModelStreamEventDataV1 } from \"./extensions/lifecycle-catalog.ts\";\nimport type { ContextUsage, ExecutionFactsV1 } from \"./extensions/public-api.ts\";\nimport type { HostLogger } from \"./logger.ts\";\nimport type { BashExecutionMessage, CustomMessage } from \"./messages.ts\";\nimport type { ModelRuntime } from \"./model-runtime.ts\";\nimport type { PromptTemplate } from \"./prompt-templates.ts\";\nimport type { ResourceLoader } from \"./resource-loader.ts\";\nimport type { BranchSummaryEntry, SessionManager } from \"./session-manager.ts\";\nimport type { SettingsManager } from \"./settings-manager.ts\";\nimport type { Skill } from \"./skills.ts\";\nimport type { SourceInfo } from \"./source-info.ts\";\nimport type { BuildSystemPromptOptions } from \"./system-prompt.ts\";\nimport type { BashOperations } from \"./tools/bash.ts\";\nimport type { ToolDefinition, ToolInfo } from \"./tools/tool-definition.ts\";\n\n/** Registry entry for one tool definition with its source metadata. */\nexport interface ToolDefinitionEntry {\n\tdefinition: ToolDefinition;\n\tsourceInfo: SourceInfo;\n}\n\n/**\n * A session operation was cancelled by user intent (abort, reload barrier) — a\n * normal outcome, never a failure. Host boundaries resolve with structured\n * cancelled results instead of surfacing this as an error.\n */\nexport class SessionCancelledError extends Error {\n\treadonly reason: \"reload\" | \"signal\";\n\n\tconstructor(reason: SessionCancelledError[\"reason\"]) {\n\t\tsuper(`Session operation cancelled: ${reason}`);\n\t\tthis.name = \"SessionCancelledError\";\n\t\tthis.reason = reason;\n\t}\n}\n\n/**\n * Deep-clone a session value and freeze the clone so lifecycle payloads cannot\n * be mutated in place. The implementation lives on the public extension face\n * (`./extensions/public-api.ts`) so first-party and third-party plugins share\n * the same payload-projection contract; re-exported here for the host-internal\n * session submodules.\n */\nexport { detachedSessionSnapshot } from \"./extensions/public-api.ts\";\n\n/** JSON-safe clone for lifecycle payloads that must survive structured clone failures. */\nexport function jsonSafeSessionSnapshot<T>(value: T): T {\n\tconst serialized = JSON.stringify(value);\n\t// v8 ignore next -- 对象消息序列化永远返回字符串,undefined 分支不可达\n\treturn serialized === undefined ? (null as T) : (JSON.parse(serialized) as T);\n}\n\nexport interface AgentSessionInternals {\n\treadonly agent: Agent;\n\treadonly sessionManager: SessionManager;\n\treadonly settingsManager: SettingsManager;\n\treadonly _modelRuntime: ModelRuntime;\n\treadonly model: Model<Api> | undefined;\n\treadonly thinkingLevel: ThinkingLevel;\n\treadonly sessionId: string;\n\treadonly isStreaming: boolean;\n\t/** Idle gate for public context operations (compile-time private getter on AgentSession). */\n\treadonly isIdle: boolean;\n\n\t// Internal session state (compile-time private on AgentSession)\n\t_compactionQueue: Promise<void>;\n\t_compactionAbortController: AbortController | undefined;\n\t_autoCompactionAbortController: AbortController | undefined;\n\t_overflowRecoveryAttempted: boolean;\n\t/** 已完成的溢出裁剪级数(0 = 未裁剪);与 `_overflowRecoveryAttempted` 同点位复位。 */\n\t_overflowTrimStage: number;\n\t/**\n\t * microcompact 冷却(按模型请求计数,0 = 不冷却):relief 落地时置满,\n\t * 每次 assistant message_end 减 1(下限 0);冷却期内阈值 decide 以\n\t * `microcompactEnabled: false` 关闭便宜缓解(背景注释见 agent-session.ts)。\n\t */\n\t_microcompactCooldown: number;\n\t_activeCompactionPromise: Promise<unknown> | undefined;\n\t_branchSummaryAbortController: AbortController | undefined;\n\t_branchSummaryPromise: Promise<unknown> | undefined;\n\t_resolveBranchSummaryPromise: (() => void) | undefined;\n\t_reloadInProgress: boolean;\n\t_policyDecisionAbortController: AbortController | undefined;\n\t_retryAbortController: AbortController | undefined;\n\t_retryAttempt: number;\n\t_pendingRetryDecision:\n\t\t| { message: AssistantMessage; decision: Awaited<ReturnType<CapabilityRuntime[\"decideRetry\"]>> }\n\t\t| undefined;\n\t_isAgentRunActive: boolean;\n\t_currentRunAborted: boolean;\n\t_lastAbortReason: TurnAbortReason | undefined;\n\t_lastAssistantMessage: AssistantMessage | undefined;\n\n\t// Lifecycle dispatch state (compile-time private on AgentSession)\n\treadonly _modelStreamState: { streamId: string; sequence: number } | undefined;\n\t/** Correlation id for the active prompt run's lifecycle dispatches; written by the loop-runner via this facade. */\n\t_turnCorrelationId: string | undefined;\n\t_turnCorrelationCounter: number;\n\t/**\n\t * Host-process logger seam (会话轨迹第 2 期,设计 §5.2): one-line process log\n\t * beside lifecycle dispatches that report genuine failures (compaction\n\t * failed). Undefined when no hostLogger was configured; call sites treat it\n\t * as a no-op.\n\t */\n\treadonly _hostLogger?: HostLogger;\n\n\t// Bash execution state (compile-time private on AgentSession)\n\treadonly _bashAbortControllers: Set<AbortController>;\n\treadonly _activeBashPromises: Set<Promise<unknown>>;\n\t_bashEpoch: number;\n\t_pendingBashMessages: BashExecutionMessage[];\n\treadonly isDisposed: boolean;\n\n\t_capabilityRuntime: CapabilityRuntime | undefined;\n\t_compactionPolicyName: string;\n\t_overflowPolicyName: string;\n\t_branchSummaryPolicyName: string;\n\t_retryPolicyName: string;\n\t_runLoopStrategyName: string;\n\t/** Internal loop-executor seam (D-043 G3): set to replace the default prompt/continue drive. No public config; distinct from `_runLoopStrategyName` (a per-continuation veto policy). */\n\t_loopExecutor: LoopExecutor | undefined;\n\n\t// Helpers that remain on AgentSession\n\t_emit(event: AgentSessionEvent): void;\n\t_resolveIdleWaitIfIdle(): void;\n\t_flushPendingCustomMessages(): void;\n\t_emitAgentSettled(): Promise<void>;\n\t_observeLifecycleDeliveryError(error: unknown, extensionPath: string, event: string): void;\n\tabort(): Promise<void>;\n\t_abortInternal(): Promise<void>;\n\n\t// Context-transition state and delegates forwarding to agent-session-context.ts\n\t/** Generation fence for context projections that may outlive a runtime replacement. */\n\t_contextEpoch: number;\n\t_contextTransitionAbortController: AbortController;\n\t/** Serializes context transitions and lets reload/dispose drain them before teardown. */\n\t_activeContextTransition: Promise<unknown> | undefined;\n\t/** Monotonic revision for the public context snapshot/commit facade. */\n\t_contextRevision: number;\n\t/** Serializes public context commits so expectedRevision is a real CAS fence. */\n\t_contextCommitQueue: Promise<void>;\n\t/** Configured external context strategy name, written only by the constructor. */\n\treadonly _contextStrategyName: string | undefined;\n\t_requireContextStrategy(): { runtime: CapabilityRuntime; name: string };\n\t_requireIdleContextOperation(operation: string): void;\n\t_beginContextTransitionFence(): void;\n\t_isContextTransitionCurrent(epoch: number, allowReload: boolean): boolean;\n\t_assertContextTransitionCurrent(epoch: number, allowReload: boolean): void;\n\t_enqueueContextTransition<T>(\n\t\toperation: (epoch: number, signal: AbortSignal) => Promise<T>,\n\t\toptions?: { signal?: AbortSignal; allowReload?: boolean },\n\t): Promise<T>;\n\t_copyContextMessages(value: unknown, strategyName: string, direction: \"input\" | \"result\"): AgentMessage[];\n\t_applyContextTransition(\n\t\tmessages: AgentMessage[],\n\t\treason?: ContextOperationOptions[\"reason\"],\n\t\tsignal?: AbortSignal,\n\t\toptions?: { allowReload?: boolean },\n\t): Promise<AgentMessage[]>;\n\t_restoreContextTransition(\n\t\tsnapshot: unknown,\n\t\treason: NonNullable<ContextOperationOptions[\"reason\"]>,\n\t\toptions?: { allowReload?: boolean },\n\t): Promise<AgentMessage[]>;\n\tsnapshotContext(): Promise<unknown>;\n\trestoreContext(snapshot: unknown): Promise<AgentMessage[]>;\n\treplaceContext(context: AgentMessage[]): Promise<AgentMessage[]>;\n\n\t// Model-scope state and delegates forwarding to agent-session-model.ts\n\t_scopedModels: Array<{ model: Model<Api>; thinkingLevel?: ThinkingLevel }>;\n\t/** Public scoped-models getter (Legacy 迁移 R1): submodules read via this instead of the private field. */\n\treadonly scopedModels: ReadonlyArray<{ model: Model<Api>; thinkingLevel?: ThinkingLevel }>;\n\tsetModel(model: Model<Api>, options?: ModelMutationOptions): Promise<void>;\n\tsetThinkingLevel(level: ThinkingLevel, options?: ModelMutationOptions): void;\n\t_emitModelSelect(\n\t\tnextModel: Model<Api>,\n\t\tpreviousModel: Model<Api> | undefined,\n\t\tsource: \"set\" | \"cycle\" | \"restore\",\n\t): Promise<void>;\n\t_addPersistedDefaultToNonEmptyScope(model: Model<Api>): void;\n\t_getThinkingLevelForModelSwitch(targetModel?: Model<Api>, explicitLevel?: ThinkingLevel): ThinkingLevel;\n\t_cycleScopedModel(\n\t\tdirection: \"forward\" | \"backward\",\n\t\toptions: ModelMutationOptions,\n\t): Promise<ModelCycleResult | undefined>;\n\t_cycleAvailableModel(\n\t\tdirection: \"forward\" | \"backward\",\n\t\toptions: ModelMutationOptions,\n\t): Promise<ModelCycleResult | undefined>;\n\n\t// Run-loop wiring state and delegates forwarding to agent-session-loop.ts\n\t/** The agent's construction-time prepare adapter, captured once by the loop wiring install. */\n\t_initialPrepareNextTurn:\n\t\t| ((\n\t\t\t\tcontext: PrepareNextTurnContext,\n\t\t\t\tsignal?: AbortSignal,\n\t\t ) => Promise<AgentLoopTurnUpdate | undefined> | AgentLoopTurnUpdate | undefined)\n\t\t| undefined;\n\n\t// Delegates forwarding to the submodule functions\n\t_compactBeforeNextAssistantResponse(context: AgentContext, signal?: AbortSignal): Promise<AgentContext>;\n\t_enqueueCompaction<T>(operation: () => Promise<T>): Promise<T>;\n\t_compactInternal(customInstructions?: string): Promise<CompactionResult>;\n\t_checkCompaction(\n\t\tassistantMessage: AssistantMessage,\n\t\tskipAbortedCheck?: boolean,\n\t\tsignal?: AbortSignal,\n\t): Promise<boolean>;\n\t_runAutoCompaction(reason: \"overflow\" | \"threshold\", willRetry: boolean): Promise<boolean>;\n\t_willRetryAfterAgentEnd(event: Extract<AgentEvent, { type: \"agent_end\" }>, signal?: AbortSignal): Promise<boolean>;\n\t_isRetryableError(message: AssistantMessage, execution?: ExecutionFactsV1, signal?: AbortSignal): Promise<boolean>;\n\t_prepareRetry(\n\t\tmessage: AssistantMessage,\n\t\tprecomputedDecision?: Awaited<ReturnType<CapabilityRuntime[\"decideRetry\"]>>,\n\t): Promise<boolean>;\n\tnavigateTree(\n\t\ttargetId: string,\n\t\toptions?: { summarize?: boolean; customInstructions?: string; replaceInstructions?: boolean; label?: string },\n\t): Promise<{ editorText?: string; cancelled: boolean; aborted?: boolean; summaryEntry?: BranchSummaryEntry }>;\n\n\t// Lifecycle delegates forwarding to agent-session-lifecycle.ts\n\t_dispatchModelStreamLifecycle(\n\t\tmessage: AgentMessage,\n\t\teventName: ModelStreamEventDataV1[\"event\"],\n\t\tphase: ModelStreamEventDataV1[\"phase\"],\n\t): Promise<void>;\n\t_dispatchContextReplacedLifecycle(\n\t\treason: NonNullable<ContextOperationOptions[\"reason\"]>,\n\t\tstrategyName?: string,\n\t): Promise<void>;\n\t_dispatchModelResponseLifecycle(message: AssistantMessage, entryId: string): Promise<void>;\n\t_dispatchToolCommitLifecycle(message: ToolResultMessage, entryId: string): Promise<void>;\n\t_dispatchToolResultLifecycle(message: ToolResultMessage, entryId: string): Promise<void>;\n\t_dispatchSessionReloadLifecycle(generation: number): Promise<void>;\n\n\t// Bash delegates forwarding to agent-session-bash.ts\n\tcaptureBashEpoch(): number;\n\tisBashEpochCurrent(epoch: number): boolean;\n\temitUserBash(excludeFromContext: boolean): void;\n\texecuteBash(\n\t\tcommand: string,\n\t\tonChunk?: (chunk: string) => void,\n\t\toptions?: { excludeFromContext?: boolean; id?: string; operations?: BashOperations },\n\t): Promise<BashResult>;\n\trecordBashResult(\n\t\tcommand: string,\n\t\tresult: BashResult,\n\t\toptions?: { excludeFromContext?: boolean; epoch?: number },\n\t): void;\n\tabortBash(): void;\n\t_flushPendingBashMessages(): void;\n\n\t// Tool registry state (compile-time private on AgentSession)\n\t_resourceLoader: ResourceLoader;\n\t_customTools: ToolDefinition[];\n\t_deferredToolPluginIds: ReadonlySet<string>;\n\t_baseToolDefinitions: Map<string, ToolDefinition>;\n\t_baseToolSources: Map<string, SourceInfo>;\n\t_toolRegistry: Map<string, AgentTool>;\n\t_toolDefinitions: Map<string, ToolDefinitionEntry>;\n\t_toolPromptSnippets: Map<string, string>;\n\t_toolPromptGuidelines: Map<string, string[]>;\n\t_allowedToolNames: Set<string> | undefined;\n\t_excludedToolNames: Set<string> | undefined;\n\t_baseSystemPrompt: string;\n\t_baseSystemPromptOptions: BuildSystemPromptOptions;\n\t_systemPromptOverride: string | undefined;\n\t_orientationPrompt: string | undefined;\n\t_preferenceCard: string | undefined;\n\t_capabilitySkillsFilter: ((skills: Skill[]) => Skill[]) | undefined;\n\t_bootstrapSkillsHandle: CapabilityPluginHandle | undefined;\n\t_cwd: string;\n\n\tgetActiveToolNames(): string[];\n\n\t// Tool registry delegates forwarding to agent-session-tools.ts\n\tgetAllTools(): ToolInfo[];\n\tgetToolDefinition(name: string): ToolDefinition | undefined;\n\tsetActiveToolsByName(toolNames: string[]): void;\n\t_rebuildSystemPrompt(toolNames: string[]): string;\n\t_refreshToolRegistry(options?: { activeToolNames?: string[]; includeAllExtensionTools?: boolean }): void;\n\t_syncCapabilityTools(): void;\n\t_getCapabilitySkills(): Skill[];\n\t_getAvailableSkills(): Skill[];\n\t_validateCapabilitySkillConflicts(): void;\n\t_refreshBootstrapSkills(): Promise<void>;\n\n\t// Read-only projections and delegates forwarding to agent-session-projection.ts\n\treadonly sessionFile: string | undefined;\n\treadonly messages: AgentMessage[];\n\treadonly systemPrompt: string;\n\treadonly promptTemplates: ReadonlyArray<PromptTemplate>;\n\treadonly pendingMessageCount: number;\n\tgetSessionStats(): SessionStats;\n\tgetContextUsage(): ContextUsage | undefined;\n\tgetUserMessagesForForking(): Array<{ entryId: string; text: string }>;\n\texportToHtml(outputPath?: string, options?: { themeName?: string }): Promise<string>;\n\texportToJsonl(outputPath?: string): string;\n\tgetLastAssistantText(): string | undefined;\n\n\t// Resource-discovery delegates forwarding to agent-session-extensions.ts\n\textendResourcesFromExtensions(reason: \"startup\" | \"reload\"): Promise<void>;\n\tbuildExtensionResourcePaths(entries: Array<{ path: string; extensionPath: string }>): Array<{\n\t\tpath: string;\n\t\tmetadata: { source: string; scope: \"temporary\"; origin: \"top-level\"; baseDir?: string };\n\t}>;\n\tgetExtensionSourceLabel(extensionPath: string): string;\n\n\t// Prompt/queue surface consumed by the extension binding closures\n\tsendCustomMessage<T = unknown>(\n\t\tmessage: Pick<CustomMessage<T>, \"customType\" | \"content\" | \"display\" | \"details\">,\n\t\toptions?: { triggerTurn?: boolean; deliverAs?: \"steer\" | \"followUp\" | \"nextTurn\" },\n\t): Promise<void>;\n\tsendUserMessage(\n\t\tcontent: string | (TextContent | ImageContent)[],\n\t\toptions?: { deliverAs?: \"steer\" | \"followUp\"; expandPromptTemplates?: boolean },\n\t): Promise<void>;\n\tsetSessionName(name: string): void;\n\tcompact(customInstructions?: string): Promise<CompactionResult | CompactionCancelledResult>;\n}\n"]}
@@ -423,6 +423,14 @@ export declare class AgentSession {
423
423
  private _autoCompactionAbortController;
424
424
  private _overflowRecoveryAttempted;
425
425
  private _overflowTrimStage;
426
+ /**
427
+ * microcompact 冷却(按模型请求计数,0 = 不冷却):relief 落地时置
428
+ * MICROCOMPACT_COOLDOWN_ASSISTANT_RESPONSES,此后每次 assistant message_end
429
+ * (无论 stopReason)减 1、下限 0;user message_start 不复位。冷却期内阈值
430
+ * decide 以 microcompactEnabled:false 关闭便宜缓解。微观经济动机见
431
+ * agent-session-compaction.ts 的常量注释(中部历史改写 × 不稳定前缀缓存)。
432
+ */
433
+ private _microcompactCooldown;
426
434
  private _branchSummaryAbortController;
427
435
  private _branchSummaryPromise;
428
436
  private _resolveBranchSummaryPromise;