@prestyj/cli 5.17.0 → 5.20.0
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.
- package/README.md +2 -1
- package/assets/skills/refactoring/SKILL.md +64 -0
- package/assets/skills/refactoring/references/agent-pitfalls.md +43 -0
- package/assets/skills/refactoring/references/legacy.md +49 -0
- package/assets/skills/refactoring/references/smells.md +71 -0
- package/dist/app-sidecar-sessions.d.ts +0 -1
- package/dist/app-sidecar.d.ts +0 -1
- package/dist/app-sidecar.js +13 -2
- package/dist/app-sidecar.js.map +1 -1
- package/dist/chat-agents/general.d.ts +0 -1
- package/dist/chat-agents/index.d.ts +0 -1
- package/dist/chat-agents/jiwa.d.ts +0 -1
- package/dist/chat-agents/memory.d.ts +0 -1
- package/dist/chat-agents/research.d.ts +0 -1
- package/dist/chat-agents/shared.d.ts +0 -1
- package/dist/chat-agents/therapist.d.ts +0 -1
- package/dist/chat-agents/types.d.ts +0 -1
- package/dist/cli/auth.d.ts +0 -1
- package/dist/cli/command-routing.d.ts +0 -1
- package/dist/cli/mcp.d.ts +0 -1
- package/dist/cli/mcp.js.map +1 -1
- package/dist/cli/pixel.d.ts +0 -1
- package/dist/cli/shared.d.ts +0 -1
- package/dist/cli.d.ts +0 -1
- package/dist/config.d.ts +0 -1
- package/dist/core/agent-notifications.d.ts +0 -1
- package/dist/core/agent-session.d.ts +40 -2
- package/dist/core/agent-session.js +320 -29
- package/dist/core/agent-session.js.map +1 -1
- package/dist/core/agents.d.ts +0 -1
- package/dist/core/api-benchmark.d.ts +0 -1
- package/dist/core/ask-user.d.ts +0 -1
- package/dist/core/auth/index.d.ts +0 -1
- package/dist/core/auth-providers.d.ts +0 -1
- package/dist/core/auth-storage.d.ts +0 -1
- package/dist/core/auto-update.d.ts +0 -1
- package/dist/core/autopilot-cycle.d.ts +0 -1
- package/dist/core/autopilot-gate.d.ts +0 -1
- package/dist/core/autopilot-gate.js.map +1 -1
- package/dist/core/autopilot-verdict.d.ts +0 -1
- package/dist/core/bash-spawn-benchmark.d.ts +0 -1
- package/dist/core/bundled-agents.d.ts +0 -1
- package/dist/core/cache-warm-benchmark.d.ts +0 -1
- package/dist/core/checkpoint-store.d.ts +0 -1
- package/dist/core/claude-code-version.d.ts +0 -1
- package/dist/core/code-retrieval-chunkers.d.ts +0 -1
- package/dist/core/code-retrieval.d.ts +0 -1
- package/dist/core/compaction/active-context.d.ts +0 -1
- package/dist/core/compaction/compactor.d.ts +34 -1
- package/dist/core/compaction/compactor.js +161 -2
- package/dist/core/compaction/compactor.js.map +1 -1
- package/dist/core/compaction/policy.d.ts +0 -1
- package/dist/core/compaction/query-aware-selector.d.ts +0 -1
- package/dist/core/compaction/token-estimator.d.ts +0 -1
- package/dist/core/compaction/tool-result-pruner.d.ts +0 -1
- package/dist/core/context-limits.d.ts +0 -1
- package/dist/core/custom-commands.d.ts +0 -1
- package/dist/core/encode-cwd.d.ts +0 -1
- package/dist/core/env-delta.d.ts +0 -1
- package/dist/core/event-bus.d.ts +5 -2
- package/dist/core/event-bus.js.map +1 -1
- package/dist/core/extensions/loader.d.ts +0 -1
- package/dist/core/extensions/plugin-bundles.d.ts +0 -1
- package/dist/core/extensions/types.d.ts +0 -1
- package/dist/core/fast-apply-benchmark.d.ts +0 -1
- package/dist/core/file-lock.d.ts +0 -1
- package/dist/core/foreign-session-import.d.ts +0 -1
- package/dist/core/foreign-transcript-blocks.d.ts +0 -1
- package/dist/core/goal-controller.d.ts +0 -1
- package/dist/core/goal-prerequisites.d.ts +0 -1
- package/dist/core/goal-store.d.ts +0 -1
- package/dist/core/goal-store.js.map +1 -1
- package/dist/core/goal-verifier.d.ts +0 -1
- package/dist/core/goal-verifier.js.map +1 -1
- package/dist/core/goal-worker.d.ts +0 -1
- package/dist/core/goal-worker.js.map +1 -1
- package/dist/core/hashline-edit-benchmark.d.ts +0 -1
- package/dist/core/hashline.d.ts +0 -1
- package/dist/core/ideal-review-subagent.d.ts +0 -1
- package/dist/core/ideal-review.d.ts +0 -1
- package/dist/core/index.d.ts +0 -1
- package/dist/core/internal-diagnostics.d.ts +142 -0
- package/dist/core/internal-diagnostics.js +450 -0
- package/dist/core/internal-diagnostics.js.map +1 -0
- package/dist/core/language-detector.d.ts +0 -1
- package/dist/core/local-endpoint-store.d.ts +0 -1
- package/dist/core/logger.d.ts +0 -1
- package/dist/core/loop-breaker.d.ts +0 -1
- package/dist/core/lsp/client.d.ts +8 -6
- package/dist/core/lsp/client.js +68 -18
- package/dist/core/lsp/client.js.map +1 -1
- package/dist/core/lsp/edit-telemetry.d.ts +0 -1
- package/dist/core/lsp/format.d.ts +0 -1
- package/dist/core/lsp/jsonrpc.d.ts +0 -1
- package/dist/core/lsp/manager.d.ts +16 -2
- package/dist/core/lsp/manager.js +170 -9
- package/dist/core/lsp/manager.js.map +1 -1
- package/dist/core/lsp/pool.d.ts +0 -1
- package/dist/core/lsp/pool.js.map +1 -1
- package/dist/core/lsp/servers.d.ts +0 -1
- package/dist/core/lsp/test-support.d.ts +0 -1
- package/dist/core/mcp/catalog-cache.d.ts +0 -1
- package/dist/core/mcp/client.d.ts +0 -1
- package/dist/core/mcp/content.d.ts +0 -1
- package/dist/core/mcp/defaults.d.ts +0 -1
- package/dist/core/mcp/deferred-catalog.d.ts +0 -1
- package/dist/core/mcp/elicitation-bridge.d.ts +0 -1
- package/dist/core/mcp/index.d.ts +0 -1
- package/dist/core/mcp/loopback.d.ts +0 -1
- package/dist/core/mcp/oauth-provider.d.ts +0 -1
- package/dist/core/mcp/oauth-store.d.ts +0 -1
- package/dist/core/mcp/parse-add-command.d.ts +0 -1
- package/dist/core/mcp/resolve-stdio.d.ts +0 -1
- package/dist/core/mcp/shared-pool.d.ts +0 -1
- package/dist/core/mcp/store.d.ts +0 -1
- package/dist/core/mcp/types.d.ts +0 -1
- package/dist/core/message-images.d.ts +0 -1
- package/dist/core/model-registry.d.ts +0 -1
- package/dist/core/network-guard.d.ts +0 -1
- package/dist/core/nolan-context.d.ts +5 -1
- package/dist/core/nolan-context.js +9 -2
- package/dist/core/nolan-context.js.map +1 -1
- package/dist/core/nolan-model.d.ts +0 -1
- package/dist/core/nolan-prompt.d.ts +0 -1
- package/dist/core/oauth/anthropic.d.ts +0 -1
- package/dist/core/oauth/gemini.d.ts +0 -1
- package/dist/core/oauth/kimi.d.ts +0 -1
- package/dist/core/oauth/openai.d.ts +0 -1
- package/dist/core/oauth/pkce.d.ts +0 -1
- package/dist/core/oauth/types.d.ts +0 -1
- package/dist/core/oauth/xai.d.ts +0 -1
- package/dist/core/parked-requests.d.ts +0 -1
- package/dist/core/persistent-shell.d.ts +0 -1
- package/dist/core/pixel-fix-agent.d.ts +0 -1
- package/dist/core/pixel-fix.d.ts +0 -1
- package/dist/core/pixel.d.ts +0 -1
- package/dist/core/platform-clis.d.ts +0 -1
- package/dist/core/process-gate.d.ts +0 -1
- package/dist/core/process-manager.d.ts +7 -4
- package/dist/core/process-manager.js +23 -7
- package/dist/core/process-manager.js.map +1 -1
- package/dist/core/progress/engine.d.ts +0 -1
- package/dist/core/progress/git-xp.d.ts +0 -1
- package/dist/core/progress/ranks.d.ts +0 -1
- package/dist/core/progress/rebuild.d.ts +0 -1
- package/dist/core/progress/store.d.ts +0 -1
- package/dist/core/progress/types.d.ts +0 -1
- package/dist/core/project-discovery.d.ts +0 -1
- package/dist/core/prompt-commands.d.ts +0 -1
- package/dist/core/radio.d.ts +0 -1
- package/dist/core/regrounding.d.ts +0 -1
- package/dist/core/resolve-start.d.ts +0 -1
- package/dist/core/run-claim.d.ts +0 -1
- package/dist/core/run-lifecycle.d.ts +0 -1
- package/dist/core/runtime-mode.d.ts +0 -1
- package/dist/core/sandbox-domains.d.ts +0 -1
- package/dist/core/sandbox-feedback.d.ts +0 -1
- package/dist/core/sandbox.d.ts +0 -1
- package/dist/core/semantic-loop-check.d.ts +0 -1
- package/dist/core/semantic-search-benchmark.d.ts +0 -1
- package/dist/core/session-compaction.d.ts +0 -1
- package/dist/core/session-export.d.ts +0 -1
- package/dist/core/session-history.d.ts +0 -1
- package/dist/core/session-manager.d.ts +0 -1
- package/dist/core/session-preview.d.ts +0 -1
- package/dist/core/session-storage.d.ts +0 -1
- package/dist/core/settings-manager.d.ts +0 -1
- package/dist/core/setup-history.d.ts +0 -1
- package/dist/core/shell-path.d.ts +0 -1
- package/dist/core/shell.d.ts +0 -1
- package/dist/core/shutdown.d.ts +0 -1
- package/dist/core/skills.d.ts +0 -1
- package/dist/core/slash-commands.d.ts +3 -2
- package/dist/core/slash-commands.js +6 -4
- package/dist/core/slash-commands.js.map +1 -1
- package/dist/core/source-maps.d.ts +0 -1
- package/dist/core/speed-benchmark.d.ts +0 -1
- package/dist/core/steering.d.ts +0 -1
- package/dist/core/steroids.d.ts +0 -1
- package/dist/core/style-packs/index.d.ts +0 -1
- package/dist/core/style-packs/packs.d.ts +0 -1
- package/dist/core/subagent-manager.d.ts +0 -1
- package/dist/core/subagent-manager.js.map +1 -1
- package/dist/core/subagent-policy.d.ts +0 -1
- package/dist/core/subagent-store.d.ts +0 -1
- package/dist/core/subagent-turn-record.d.ts +0 -1
- package/dist/core/task-store.d.ts +0 -1
- package/dist/core/telegram-config.d.ts +0 -1
- package/dist/core/telegram.d.ts +0 -1
- package/dist/core/thinking-level.d.ts +1 -2
- package/dist/core/thinking-level.js +1 -1
- package/dist/core/thinking-level.js.map +1 -1
- package/dist/core/verification-evidence.d.ts +4 -1
- package/dist/core/verification-evidence.js +28 -4
- package/dist/core/verification-evidence.js.map +1 -1
- package/dist/core/verification-gate.d.ts +17 -18
- package/dist/core/verification-gate.js +66 -35
- package/dist/core/verification-gate.js.map +1 -1
- package/dist/core/verification-snapshot.d.ts +7 -0
- package/dist/core/verification-snapshot.js +111 -0
- package/dist/core/verification-snapshot.js.map +1 -0
- package/dist/core/verify-commands.d.ts +0 -1
- package/dist/core/voice-transcriber.d.ts +0 -1
- package/dist/core/workspace-guard.d.ts +0 -1
- package/dist/hf-pull.d.ts +0 -1
- package/dist/index.d.ts +0 -1
- package/dist/interactive.d.ts +0 -1
- package/dist/modes/acp-mode.d.ts +0 -1
- package/dist/modes/agent-home-mode.d.ts +0 -1
- package/dist/modes/index.d.ts +0 -1
- package/dist/modes/json-mode.d.ts +0 -1
- package/dist/modes/print-mode.d.ts +0 -1
- package/dist/modes/rpc-mode.d.ts +0 -1
- package/dist/modes/serve-mode.d.ts +0 -1
- package/dist/modes/subagent-worker-mode.d.ts +0 -1
- package/dist/session.d.ts +0 -1
- package/dist/system-prompt.d.ts +0 -1
- package/dist/system-prompt.js +53 -122
- package/dist/system-prompt.js.map +1 -1
- package/dist/test-support/fake-home.d.ts +0 -1
- package/dist/tools/ask-user.d.ts +0 -1
- package/dist/tools/bash.d.ts +0 -1
- package/dist/tools/bash.js +6 -3
- package/dist/tools/bash.js.map +1 -1
- package/dist/tools/code-nav.d.ts +0 -1
- package/dist/tools/code-skeleton.d.ts +0 -1
- package/dist/tools/compress.d.ts +0 -1
- package/dist/tools/edit-diff.d.ts +19 -2
- package/dist/tools/edit-diff.js +16 -3
- package/dist/tools/edit-diff.js.map +1 -1
- package/dist/tools/edit.d.ts +1 -2
- package/dist/tools/edit.js +36 -12
- package/dist/tools/edit.js.map +1 -1
- package/dist/tools/enter-plan.d.ts +0 -1
- package/dist/tools/exit-plan.d.ts +0 -1
- package/dist/tools/find.d.ts +0 -1
- package/dist/tools/generate-image.d.ts +5 -1
- package/dist/tools/generate-image.js +25 -7
- package/dist/tools/generate-image.js.map +1 -1
- package/dist/tools/goals.d.ts +0 -1
- package/dist/tools/grep.d.ts +0 -1
- package/dist/tools/html-extract.d.ts +0 -1
- package/dist/tools/index.d.ts +3 -2
- package/dist/tools/index.js +3 -1
- package/dist/tools/index.js.map +1 -1
- package/dist/tools/ls.d.ts +0 -1
- package/dist/tools/operations.d.ts +0 -1
- package/dist/tools/overflow.d.ts +0 -1
- package/dist/tools/path-utils.d.ts +0 -1
- package/dist/tools/pdf-extract.d.ts +0 -1
- package/dist/tools/prompt-hints.d.ts +0 -1
- package/dist/tools/prompt-hints.js +1 -1
- package/dist/tools/prompt-hints.js.map +1 -1
- package/dist/tools/read-only-bash.d.ts +0 -1
- package/dist/tools/read-tracker.d.ts +0 -1
- package/dist/tools/read.d.ts +0 -1
- package/dist/tools/safe-env.d.ts +0 -1
- package/dist/tools/screenshot.d.ts +0 -1
- package/dist/tools/search-code.d.ts +0 -1
- package/dist/tools/session-stats.d.ts +26 -0
- package/dist/tools/session-stats.js +51 -0
- package/dist/tools/session-stats.js.map +1 -0
- package/dist/tools/skill.d.ts +0 -1
- package/dist/tools/skill.js +3 -5
- package/dist/tools/skill.js.map +1 -1
- package/dist/tools/source-path.d.ts +0 -1
- package/dist/tools/steroids.d.ts +0 -1
- package/dist/tools/steroids.js +1 -1
- package/dist/tools/subagent-control.d.ts +0 -1
- package/dist/tools/subagent-shared.d.ts +0 -1
- package/dist/tools/subagent.d.ts +0 -1
- package/dist/tools/task-output.d.ts +0 -1
- package/dist/tools/task-output.js +13 -6
- package/dist/tools/task-output.js.map +1 -1
- package/dist/tools/task-send.d.ts +0 -1
- package/dist/tools/task-stop.d.ts +0 -1
- package/dist/tools/tasks.d.ts +0 -1
- package/dist/tools/tool-search.d.ts +0 -1
- package/dist/tools/tool-tiers.d.ts +0 -1
- package/dist/tools/truncate.d.ts +0 -1
- package/dist/tools/web-fetch.d.ts +0 -1
- package/dist/tools/web-search.d.ts +0 -1
- package/dist/tools/write.d.ts +0 -1
- package/dist/types.d.ts +0 -1
- package/dist/ui/App.d.ts +0 -1
- package/dist/ui/App.js +6 -1
- package/dist/ui/App.js.map +1 -1
- package/dist/ui/activity-phrases.d.ts +0 -1
- package/dist/ui/app-items.d.ts +0 -1
- package/dist/ui/components/ActivityIndicator.d.ts +0 -1
- package/dist/ui/components/AnimationContext.d.ts +0 -1
- package/dist/ui/components/AssistantMessage.d.ts +0 -1
- package/dist/ui/components/BackgroundTasksBar.d.ts +0 -1
- package/dist/ui/components/Banner.d.ts +0 -1
- package/dist/ui/components/ChatFooterPane.d.ts +0 -1
- package/dist/ui/components/ChatInputStack.d.ts +0 -1
- package/dist/ui/components/ChatLayout.d.ts +0 -1
- package/dist/ui/components/ChatLivePane.d.ts +0 -1
- package/dist/ui/components/ChatScreen.d.ts +0 -1
- package/dist/ui/components/ChatStatusRow.d.ts +0 -1
- package/dist/ui/components/CompactionNotice.d.ts +0 -1
- package/dist/ui/components/DiffFrame.d.ts +0 -1
- package/dist/ui/components/DiffView.d.ts +0 -1
- package/dist/ui/components/Footer.d.ts +0 -1
- package/dist/ui/components/FooterStatusRow.d.ts +0 -1
- package/dist/ui/components/FullScreenOverlayRouter.d.ts +0 -1
- package/dist/ui/components/GoalOverlay.d.ts +0 -1
- package/dist/ui/components/GoalStatusBar.d.ts +0 -1
- package/dist/ui/components/IdealHookMessage.d.ts +0 -1
- package/dist/ui/components/InputArea.d.ts +0 -1
- package/dist/ui/components/LiveToolPanel.d.ts +0 -1
- package/dist/ui/components/Markdown.d.ts +0 -1
- package/dist/ui/components/MessageResponse.d.ts +0 -1
- package/dist/ui/components/ModelSelector.d.ts +0 -1
- package/dist/ui/components/NoSelect.d.ts +0 -1
- package/dist/ui/components/Overlay.d.ts +0 -1
- package/dist/ui/components/PixelOverlay.d.ts +0 -1
- package/dist/ui/components/PlanApproval.d.ts +0 -1
- package/dist/ui/components/PlanBanner.d.ts +0 -1
- package/dist/ui/components/PlanModeLogo.d.ts +0 -1
- package/dist/ui/components/PlanOverlay.d.ts +0 -1
- package/dist/ui/components/PlanProgress.d.ts +0 -1
- package/dist/ui/components/QueueIndicator.d.ts +0 -1
- package/dist/ui/components/Ratchet.d.ts +0 -1
- package/dist/ui/components/RewindOverlay.d.ts +0 -1
- package/dist/ui/components/SelectList.d.ts +0 -1
- package/dist/ui/components/ServerToolExecution.d.ts +0 -1
- package/dist/ui/components/SessionSelector.d.ts +0 -1
- package/dist/ui/components/SessionSummary.d.ts +0 -1
- package/dist/ui/components/SettingsSelector.d.ts +0 -1
- package/dist/ui/components/SkillsOverlay.d.ts +0 -1
- package/dist/ui/components/SlashCommandMenu.d.ts +0 -1
- package/dist/ui/components/SlashStyledSelectList.d.ts +0 -1
- package/dist/ui/components/Spinner.d.ts +0 -1
- package/dist/ui/components/StreamingArea.d.ts +0 -1
- package/dist/ui/components/SubAgentPanel.d.ts +0 -1
- package/dist/ui/components/TaskOverlay.d.ts +0 -1
- package/dist/ui/components/TaskPickerMenu.d.ts +0 -1
- package/dist/ui/components/ThemeSelector.d.ts +0 -1
- package/dist/ui/components/ThinkingBlock.d.ts +0 -1
- package/dist/ui/components/ToolExecution.d.ts +0 -1
- package/dist/ui/components/ToolGroupExecution.d.ts +0 -1
- package/dist/ui/components/ToolUseLoader.d.ts +0 -1
- package/dist/ui/components/TranscriptViewport.d.ts +0 -1
- package/dist/ui/components/UserMessage.d.ts +0 -1
- package/dist/ui/components/force-color.d.ts +0 -1
- package/dist/ui/components/index.d.ts +0 -1
- package/dist/ui/constants/figures.d.ts +0 -1
- package/dist/ui/duration-format.d.ts +0 -1
- package/dist/ui/duration-summary.d.ts +0 -1
- package/dist/ui/error-item.d.ts +0 -1
- package/dist/ui/goal-events.d.ts +0 -1
- package/dist/ui/goal-events.js.map +1 -1
- package/dist/ui/goal-summary.d.ts +0 -1
- package/dist/ui/hooks/useAgentLoop.d.ts +0 -1
- package/dist/ui/hooks/useBlink.d.ts +0 -1
- package/dist/ui/hooks/useChatLayoutMeasurements.d.ts +0 -1
- package/dist/ui/hooks/useContextCompaction.d.ts +0 -1
- package/dist/ui/hooks/useDoublePress.d.ts +0 -1
- package/dist/ui/hooks/useMinDisplayTime.d.ts +0 -1
- package/dist/ui/hooks/useModeState.d.ts +0 -1
- package/dist/ui/hooks/usePixelFixFlow.d.ts +0 -1
- package/dist/ui/hooks/useSessionManager.d.ts +0 -1
- package/dist/ui/hooks/useSessionPersistence.d.ts +0 -1
- package/dist/ui/hooks/useSlashCommands.d.ts +0 -1
- package/dist/ui/hooks/useTaskPickerController.d.ts +0 -1
- package/dist/ui/hooks/useTerminalSize.d.ts +0 -1
- package/dist/ui/hooks/useTerminalTitle.d.ts +0 -1
- package/dist/ui/hooks/useTranscriptHistory.d.ts +0 -1
- package/dist/ui/hooks/useTranscriptScroll.d.ts +0 -1
- package/dist/ui/item-helpers.d.ts +0 -1
- package/dist/ui/layout-decisions.d.ts +0 -1
- package/dist/ui/live-area-height.d.ts +0 -1
- package/dist/ui/live-item-flush.d.ts +0 -1
- package/dist/ui/login.d.ts +0 -1
- package/dist/ui/mcp.d.ts +0 -1
- package/dist/ui/pixel.d.ts +0 -1
- package/dist/ui/prompt-routing.d.ts +0 -1
- package/dist/ui/render.d.ts +0 -1
- package/dist/ui/session-summary.d.ts +0 -1
- package/dist/ui/sessions.d.ts +0 -1
- package/dist/ui/spinner-frames.d.ts +0 -1
- package/dist/ui/stores/create-store.d.ts +0 -1
- package/dist/ui/stores/index.d.ts +0 -1
- package/dist/ui/stores/taskbar-store.d.ts +0 -1
- package/dist/ui/stores/transcript-scroll-store.d.ts +0 -1
- package/dist/ui/submit-prompt-command.d.ts +0 -1
- package/dist/ui/submit-slash-commands.d.ts +0 -1
- package/dist/ui/terminal-history-format.d.ts +0 -1
- package/dist/ui/terminal-history-spacing.d.ts +0 -1
- package/dist/ui/terminal-history-status-renderers.d.ts +0 -1
- package/dist/ui/terminal-history.d.ts +0 -1
- package/dist/ui/testing/screen-recorder.d.ts +0 -1
- package/dist/ui/theme/detect-theme.d.ts +0 -1
- package/dist/ui/theme/theme.d.ts +0 -1
- package/dist/ui/theme/theme.js.map +1 -1
- package/dist/ui/thinking-level.d.ts +0 -1
- package/dist/ui/tool-group-summary.d.ts +0 -1
- package/dist/ui/tool-line-summary.d.ts +0 -1
- package/dist/ui/transcript/MiscRows.d.ts +0 -1
- package/dist/ui/transcript/StatusRow.d.ts +0 -1
- package/dist/ui/transcript/ToolRows.d.ts +0 -1
- package/dist/ui/transcript/TranscriptItemFrame.d.ts +0 -1
- package/dist/ui/transcript/TranscriptRenderer.d.ts +0 -1
- package/dist/ui/transcript/presentation.d.ts +0 -1
- package/dist/ui/transcript/spacing.d.ts +0 -1
- package/dist/ui/transcript/tool-presentation.d.ts +0 -1
- package/dist/ui/transcript/tool-presentation.js.map +1 -1
- package/dist/ui/transcript/transcript-lines.d.ts +0 -1
- package/dist/ui/utils/assistant-stream-split.d.ts +0 -1
- package/dist/ui/utils/highlight.d.ts +0 -1
- package/dist/ui/utils/hyperlink.d.ts +0 -1
- package/dist/ui/utils/latex-to-unicode.d.ts +0 -1
- package/dist/ui/utils/markdown-cache.d.ts +0 -1
- package/dist/ui/utils/markdown-renderer.d.ts +0 -1
- package/dist/ui/utils/markdown-table.d.ts +0 -1
- package/dist/ui/utils/signal.d.ts +0 -1
- package/dist/ui/utils/supports-hyperlinks.d.ts +0 -1
- package/dist/ui/utils/table-text.d.ts +0 -1
- package/dist/ui/utils/terminal-graphics.d.ts +0 -1
- package/dist/ui/utils/terminal-input.d.ts +0 -1
- package/dist/ui/utils/text-utils.d.ts +0 -1
- package/dist/ui/utils/token-to-ansi.d.ts +0 -1
- package/dist/ui/utils/user-message-display.d.ts +0 -1
- package/dist/ui/utils/word-diff.d.ts +0 -1
- package/dist/utils/error-handler.d.ts +0 -1
- package/dist/utils/format.d.ts +0 -1
- package/dist/utils/git.d.ts +0 -1
- package/dist/utils/github-ci.d.ts +0 -1
- package/dist/utils/github.d.ts +0 -1
- package/dist/utils/http-body.d.ts +0 -1
- package/dist/utils/image.d.ts +0 -1
- package/dist/utils/open-browser.d.ts +0 -1
- package/dist/utils/plan-steps.d.ts +0 -1
- package/dist/utils/plan-steps.js.map +1 -1
- package/dist/utils/process.d.ts +0 -1
- package/dist/utils/prompt-enhancer.d.ts +6 -3
- package/dist/utils/prompt-enhancer.js +61 -13
- package/dist/utils/prompt-enhancer.js.map +1 -1
- package/dist/utils/shell.d.ts +0 -1
- package/dist/utils/sound.d.ts +0 -1
- package/dist/utils/text.d.ts +0 -1
- package/package.json +7 -7
- package/dist/app-sidecar-sessions.d.ts.map +0 -1
- package/dist/app-sidecar.d.ts.map +0 -1
- package/dist/chat-agents/general.d.ts.map +0 -1
- package/dist/chat-agents/index.d.ts.map +0 -1
- package/dist/chat-agents/jiwa.d.ts.map +0 -1
- package/dist/chat-agents/memory.d.ts.map +0 -1
- package/dist/chat-agents/research.d.ts.map +0 -1
- package/dist/chat-agents/shared.d.ts.map +0 -1
- package/dist/chat-agents/therapist.d.ts.map +0 -1
- package/dist/chat-agents/types.d.ts.map +0 -1
- package/dist/cli/auth.d.ts.map +0 -1
- package/dist/cli/command-routing.d.ts.map +0 -1
- package/dist/cli/mcp.d.ts.map +0 -1
- package/dist/cli/pixel.d.ts.map +0 -1
- package/dist/cli/shared.d.ts.map +0 -1
- package/dist/cli.d.ts.map +0 -1
- package/dist/config.d.ts.map +0 -1
- package/dist/core/agent-notifications.d.ts.map +0 -1
- package/dist/core/agent-session.d.ts.map +0 -1
- package/dist/core/agents.d.ts.map +0 -1
- package/dist/core/api-benchmark.d.ts.map +0 -1
- package/dist/core/ask-user.d.ts.map +0 -1
- package/dist/core/auth/index.d.ts.map +0 -1
- package/dist/core/auth-providers.d.ts.map +0 -1
- package/dist/core/auth-storage.d.ts.map +0 -1
- package/dist/core/auto-update.d.ts.map +0 -1
- package/dist/core/autopilot-cycle.d.ts.map +0 -1
- package/dist/core/autopilot-gate.d.ts.map +0 -1
- package/dist/core/autopilot-verdict.d.ts.map +0 -1
- package/dist/core/bash-spawn-benchmark.d.ts.map +0 -1
- package/dist/core/bundled-agents.d.ts.map +0 -1
- package/dist/core/cache-warm-benchmark.d.ts.map +0 -1
- package/dist/core/checkpoint-store.d.ts.map +0 -1
- package/dist/core/claude-code-version.d.ts.map +0 -1
- package/dist/core/code-retrieval-chunkers.d.ts.map +0 -1
- package/dist/core/code-retrieval.d.ts.map +0 -1
- package/dist/core/compaction/active-context.d.ts.map +0 -1
- package/dist/core/compaction/compactor.d.ts.map +0 -1
- package/dist/core/compaction/policy.d.ts.map +0 -1
- package/dist/core/compaction/query-aware-selector.d.ts.map +0 -1
- package/dist/core/compaction/token-estimator.d.ts.map +0 -1
- package/dist/core/compaction/tool-result-pruner.d.ts.map +0 -1
- package/dist/core/context-limits.d.ts.map +0 -1
- package/dist/core/custom-commands.d.ts.map +0 -1
- package/dist/core/encode-cwd.d.ts.map +0 -1
- package/dist/core/env-delta.d.ts.map +0 -1
- package/dist/core/event-bus.d.ts.map +0 -1
- package/dist/core/extensions/loader.d.ts.map +0 -1
- package/dist/core/extensions/plugin-bundles.d.ts.map +0 -1
- package/dist/core/extensions/types.d.ts.map +0 -1
- package/dist/core/fast-apply-benchmark.d.ts.map +0 -1
- package/dist/core/file-lock.d.ts.map +0 -1
- package/dist/core/foreign-session-import.d.ts.map +0 -1
- package/dist/core/foreign-transcript-blocks.d.ts.map +0 -1
- package/dist/core/goal-controller.d.ts.map +0 -1
- package/dist/core/goal-prerequisites.d.ts.map +0 -1
- package/dist/core/goal-store.d.ts.map +0 -1
- package/dist/core/goal-verifier.d.ts.map +0 -1
- package/dist/core/goal-worker.d.ts.map +0 -1
- package/dist/core/hashline-edit-benchmark.d.ts.map +0 -1
- package/dist/core/hashline.d.ts.map +0 -1
- package/dist/core/ideal-review-subagent.d.ts.map +0 -1
- package/dist/core/ideal-review.d.ts.map +0 -1
- package/dist/core/index.d.ts.map +0 -1
- package/dist/core/language-detector.d.ts.map +0 -1
- package/dist/core/local-endpoint-store.d.ts.map +0 -1
- package/dist/core/logger.d.ts.map +0 -1
- package/dist/core/loop-breaker.d.ts.map +0 -1
- package/dist/core/lsp/client.d.ts.map +0 -1
- package/dist/core/lsp/edit-telemetry.d.ts.map +0 -1
- package/dist/core/lsp/format.d.ts.map +0 -1
- package/dist/core/lsp/jsonrpc.d.ts.map +0 -1
- package/dist/core/lsp/manager.d.ts.map +0 -1
- package/dist/core/lsp/pool.d.ts.map +0 -1
- package/dist/core/lsp/servers.d.ts.map +0 -1
- package/dist/core/lsp/test-support.d.ts.map +0 -1
- package/dist/core/mcp/catalog-cache.d.ts.map +0 -1
- package/dist/core/mcp/client.d.ts.map +0 -1
- package/dist/core/mcp/content.d.ts.map +0 -1
- package/dist/core/mcp/defaults.d.ts.map +0 -1
- package/dist/core/mcp/deferred-catalog.d.ts.map +0 -1
- package/dist/core/mcp/elicitation-bridge.d.ts.map +0 -1
- package/dist/core/mcp/index.d.ts.map +0 -1
- package/dist/core/mcp/loopback.d.ts.map +0 -1
- package/dist/core/mcp/oauth-provider.d.ts.map +0 -1
- package/dist/core/mcp/oauth-store.d.ts.map +0 -1
- package/dist/core/mcp/parse-add-command.d.ts.map +0 -1
- package/dist/core/mcp/resolve-stdio.d.ts.map +0 -1
- package/dist/core/mcp/shared-pool.d.ts.map +0 -1
- package/dist/core/mcp/store.d.ts.map +0 -1
- package/dist/core/mcp/types.d.ts.map +0 -1
- package/dist/core/message-images.d.ts.map +0 -1
- package/dist/core/model-registry.d.ts.map +0 -1
- package/dist/core/network-guard.d.ts.map +0 -1
- package/dist/core/nolan-context.d.ts.map +0 -1
- package/dist/core/nolan-model.d.ts.map +0 -1
- package/dist/core/nolan-prompt.d.ts.map +0 -1
- package/dist/core/oauth/anthropic.d.ts.map +0 -1
- package/dist/core/oauth/gemini.d.ts.map +0 -1
- package/dist/core/oauth/kimi.d.ts.map +0 -1
- package/dist/core/oauth/openai.d.ts.map +0 -1
- package/dist/core/oauth/pkce.d.ts.map +0 -1
- package/dist/core/oauth/types.d.ts.map +0 -1
- package/dist/core/oauth/xai.d.ts.map +0 -1
- package/dist/core/parked-requests.d.ts.map +0 -1
- package/dist/core/persistent-shell.d.ts.map +0 -1
- package/dist/core/pixel-fix-agent.d.ts.map +0 -1
- package/dist/core/pixel-fix.d.ts.map +0 -1
- package/dist/core/pixel.d.ts.map +0 -1
- package/dist/core/platform-clis.d.ts.map +0 -1
- package/dist/core/process-gate.d.ts.map +0 -1
- package/dist/core/process-manager.d.ts.map +0 -1
- package/dist/core/progress/engine.d.ts.map +0 -1
- package/dist/core/progress/git-xp.d.ts.map +0 -1
- package/dist/core/progress/ranks.d.ts.map +0 -1
- package/dist/core/progress/rebuild.d.ts.map +0 -1
- package/dist/core/progress/store.d.ts.map +0 -1
- package/dist/core/progress/types.d.ts.map +0 -1
- package/dist/core/project-discovery.d.ts.map +0 -1
- package/dist/core/prompt-commands.d.ts.map +0 -1
- package/dist/core/radio.d.ts.map +0 -1
- package/dist/core/regrounding.d.ts.map +0 -1
- package/dist/core/resolve-start.d.ts.map +0 -1
- package/dist/core/run-claim.d.ts.map +0 -1
- package/dist/core/run-lifecycle.d.ts.map +0 -1
- package/dist/core/runtime-mode.d.ts.map +0 -1
- package/dist/core/sandbox-domains.d.ts.map +0 -1
- package/dist/core/sandbox-feedback.d.ts.map +0 -1
- package/dist/core/sandbox.d.ts.map +0 -1
- package/dist/core/semantic-loop-check.d.ts.map +0 -1
- package/dist/core/semantic-search-benchmark.d.ts.map +0 -1
- package/dist/core/session-compaction.d.ts.map +0 -1
- package/dist/core/session-export.d.ts.map +0 -1
- package/dist/core/session-history.d.ts.map +0 -1
- package/dist/core/session-manager.d.ts.map +0 -1
- package/dist/core/session-preview.d.ts.map +0 -1
- package/dist/core/session-storage.d.ts.map +0 -1
- package/dist/core/settings-manager.d.ts.map +0 -1
- package/dist/core/setup-history.d.ts.map +0 -1
- package/dist/core/shell-path.d.ts.map +0 -1
- package/dist/core/shell.d.ts.map +0 -1
- package/dist/core/shutdown.d.ts.map +0 -1
- package/dist/core/skills.d.ts.map +0 -1
- package/dist/core/slash-commands.d.ts.map +0 -1
- package/dist/core/source-maps.d.ts.map +0 -1
- package/dist/core/speed-benchmark.d.ts.map +0 -1
- package/dist/core/steering.d.ts.map +0 -1
- package/dist/core/steroids.d.ts.map +0 -1
- package/dist/core/style-packs/index.d.ts.map +0 -1
- package/dist/core/style-packs/packs.d.ts.map +0 -1
- package/dist/core/subagent-manager.d.ts.map +0 -1
- package/dist/core/subagent-policy.d.ts.map +0 -1
- package/dist/core/subagent-store.d.ts.map +0 -1
- package/dist/core/subagent-turn-record.d.ts.map +0 -1
- package/dist/core/task-store.d.ts.map +0 -1
- package/dist/core/telegram-config.d.ts.map +0 -1
- package/dist/core/telegram.d.ts.map +0 -1
- package/dist/core/thinking-level.d.ts.map +0 -1
- package/dist/core/verification-evidence.d.ts.map +0 -1
- package/dist/core/verification-gate.d.ts.map +0 -1
- package/dist/core/verify-commands.d.ts.map +0 -1
- package/dist/core/voice-transcriber.d.ts.map +0 -1
- package/dist/core/workspace-guard.d.ts.map +0 -1
- package/dist/hf-pull.d.ts.map +0 -1
- package/dist/index.d.ts.map +0 -1
- package/dist/interactive.d.ts.map +0 -1
- package/dist/modes/acp-mode.d.ts.map +0 -1
- package/dist/modes/agent-home-mode.d.ts.map +0 -1
- package/dist/modes/index.d.ts.map +0 -1
- package/dist/modes/json-mode.d.ts.map +0 -1
- package/dist/modes/print-mode.d.ts.map +0 -1
- package/dist/modes/rpc-mode.d.ts.map +0 -1
- package/dist/modes/serve-mode.d.ts.map +0 -1
- package/dist/modes/subagent-worker-mode.d.ts.map +0 -1
- package/dist/session.d.ts.map +0 -1
- package/dist/system-prompt.d.ts.map +0 -1
- package/dist/test-support/fake-home.d.ts.map +0 -1
- package/dist/tools/ask-user.d.ts.map +0 -1
- package/dist/tools/bash.d.ts.map +0 -1
- package/dist/tools/code-nav.d.ts.map +0 -1
- package/dist/tools/code-skeleton.d.ts.map +0 -1
- package/dist/tools/compress.d.ts.map +0 -1
- package/dist/tools/edit-diff.d.ts.map +0 -1
- package/dist/tools/edit.d.ts.map +0 -1
- package/dist/tools/enter-plan.d.ts.map +0 -1
- package/dist/tools/exit-plan.d.ts.map +0 -1
- package/dist/tools/find.d.ts.map +0 -1
- package/dist/tools/generate-image.d.ts.map +0 -1
- package/dist/tools/goals.d.ts.map +0 -1
- package/dist/tools/grep.d.ts.map +0 -1
- package/dist/tools/html-extract.d.ts.map +0 -1
- package/dist/tools/index.d.ts.map +0 -1
- package/dist/tools/ls.d.ts.map +0 -1
- package/dist/tools/operations.d.ts.map +0 -1
- package/dist/tools/overflow.d.ts.map +0 -1
- package/dist/tools/path-utils.d.ts.map +0 -1
- package/dist/tools/pdf-extract.d.ts.map +0 -1
- package/dist/tools/prompt-hints.d.ts.map +0 -1
- package/dist/tools/read-only-bash.d.ts.map +0 -1
- package/dist/tools/read-tracker.d.ts.map +0 -1
- package/dist/tools/read.d.ts.map +0 -1
- package/dist/tools/safe-env.d.ts.map +0 -1
- package/dist/tools/screenshot.d.ts.map +0 -1
- package/dist/tools/search-code.d.ts.map +0 -1
- package/dist/tools/skill.d.ts.map +0 -1
- package/dist/tools/source-path.d.ts.map +0 -1
- package/dist/tools/steroids.d.ts.map +0 -1
- package/dist/tools/subagent-control.d.ts.map +0 -1
- package/dist/tools/subagent-shared.d.ts.map +0 -1
- package/dist/tools/subagent.d.ts.map +0 -1
- package/dist/tools/task-output.d.ts.map +0 -1
- package/dist/tools/task-send.d.ts.map +0 -1
- package/dist/tools/task-stop.d.ts.map +0 -1
- package/dist/tools/tasks.d.ts.map +0 -1
- package/dist/tools/tool-search.d.ts.map +0 -1
- package/dist/tools/tool-tiers.d.ts.map +0 -1
- package/dist/tools/truncate.d.ts.map +0 -1
- package/dist/tools/web-fetch.d.ts.map +0 -1
- package/dist/tools/web-search.d.ts.map +0 -1
- package/dist/tools/write.d.ts.map +0 -1
- package/dist/types.d.ts.map +0 -1
- package/dist/ui/App.d.ts.map +0 -1
- package/dist/ui/activity-phrases.d.ts.map +0 -1
- package/dist/ui/app-items.d.ts.map +0 -1
- package/dist/ui/components/ActivityIndicator.d.ts.map +0 -1
- package/dist/ui/components/AnimationContext.d.ts.map +0 -1
- package/dist/ui/components/AssistantMessage.d.ts.map +0 -1
- package/dist/ui/components/BackgroundTasksBar.d.ts.map +0 -1
- package/dist/ui/components/Banner.d.ts.map +0 -1
- package/dist/ui/components/ChatFooterPane.d.ts.map +0 -1
- package/dist/ui/components/ChatInputStack.d.ts.map +0 -1
- package/dist/ui/components/ChatLayout.d.ts.map +0 -1
- package/dist/ui/components/ChatLivePane.d.ts.map +0 -1
- package/dist/ui/components/ChatScreen.d.ts.map +0 -1
- package/dist/ui/components/ChatStatusRow.d.ts.map +0 -1
- package/dist/ui/components/CompactionNotice.d.ts.map +0 -1
- package/dist/ui/components/DiffFrame.d.ts.map +0 -1
- package/dist/ui/components/DiffView.d.ts.map +0 -1
- package/dist/ui/components/Footer.d.ts.map +0 -1
- package/dist/ui/components/FooterStatusRow.d.ts.map +0 -1
- package/dist/ui/components/FullScreenOverlayRouter.d.ts.map +0 -1
- package/dist/ui/components/GoalOverlay.d.ts.map +0 -1
- package/dist/ui/components/GoalStatusBar.d.ts.map +0 -1
- package/dist/ui/components/IdealHookMessage.d.ts.map +0 -1
- package/dist/ui/components/InputArea.d.ts.map +0 -1
- package/dist/ui/components/LiveToolPanel.d.ts.map +0 -1
- package/dist/ui/components/Markdown.d.ts.map +0 -1
- package/dist/ui/components/MessageResponse.d.ts.map +0 -1
- package/dist/ui/components/ModelSelector.d.ts.map +0 -1
- package/dist/ui/components/NoSelect.d.ts.map +0 -1
- package/dist/ui/components/Overlay.d.ts.map +0 -1
- package/dist/ui/components/PixelOverlay.d.ts.map +0 -1
- package/dist/ui/components/PlanApproval.d.ts.map +0 -1
- package/dist/ui/components/PlanBanner.d.ts.map +0 -1
- package/dist/ui/components/PlanModeLogo.d.ts.map +0 -1
- package/dist/ui/components/PlanOverlay.d.ts.map +0 -1
- package/dist/ui/components/PlanProgress.d.ts.map +0 -1
- package/dist/ui/components/QueueIndicator.d.ts.map +0 -1
- package/dist/ui/components/Ratchet.d.ts.map +0 -1
- package/dist/ui/components/RewindOverlay.d.ts.map +0 -1
- package/dist/ui/components/SelectList.d.ts.map +0 -1
- package/dist/ui/components/ServerToolExecution.d.ts.map +0 -1
- package/dist/ui/components/SessionSelector.d.ts.map +0 -1
- package/dist/ui/components/SessionSummary.d.ts.map +0 -1
- package/dist/ui/components/SettingsSelector.d.ts.map +0 -1
- package/dist/ui/components/SkillsOverlay.d.ts.map +0 -1
- package/dist/ui/components/SlashCommandMenu.d.ts.map +0 -1
- package/dist/ui/components/SlashStyledSelectList.d.ts.map +0 -1
- package/dist/ui/components/Spinner.d.ts.map +0 -1
- package/dist/ui/components/StreamingArea.d.ts.map +0 -1
- package/dist/ui/components/SubAgentPanel.d.ts.map +0 -1
- package/dist/ui/components/TaskOverlay.d.ts.map +0 -1
- package/dist/ui/components/TaskPickerMenu.d.ts.map +0 -1
- package/dist/ui/components/ThemeSelector.d.ts.map +0 -1
- package/dist/ui/components/ThinkingBlock.d.ts.map +0 -1
- package/dist/ui/components/ToolExecution.d.ts.map +0 -1
- package/dist/ui/components/ToolGroupExecution.d.ts.map +0 -1
- package/dist/ui/components/ToolUseLoader.d.ts.map +0 -1
- package/dist/ui/components/TranscriptViewport.d.ts.map +0 -1
- package/dist/ui/components/UserMessage.d.ts.map +0 -1
- package/dist/ui/components/force-color.d.ts.map +0 -1
- package/dist/ui/components/index.d.ts.map +0 -1
- package/dist/ui/constants/figures.d.ts.map +0 -1
- package/dist/ui/duration-format.d.ts.map +0 -1
- package/dist/ui/duration-summary.d.ts.map +0 -1
- package/dist/ui/error-item.d.ts.map +0 -1
- package/dist/ui/goal-events.d.ts.map +0 -1
- package/dist/ui/goal-summary.d.ts.map +0 -1
- package/dist/ui/hooks/useAgentLoop.d.ts.map +0 -1
- package/dist/ui/hooks/useBlink.d.ts.map +0 -1
- package/dist/ui/hooks/useChatLayoutMeasurements.d.ts.map +0 -1
- package/dist/ui/hooks/useContextCompaction.d.ts.map +0 -1
- package/dist/ui/hooks/useDoublePress.d.ts.map +0 -1
- package/dist/ui/hooks/useMinDisplayTime.d.ts.map +0 -1
- package/dist/ui/hooks/useModeState.d.ts.map +0 -1
- package/dist/ui/hooks/usePixelFixFlow.d.ts.map +0 -1
- package/dist/ui/hooks/useSessionManager.d.ts.map +0 -1
- package/dist/ui/hooks/useSessionPersistence.d.ts.map +0 -1
- package/dist/ui/hooks/useSlashCommands.d.ts.map +0 -1
- package/dist/ui/hooks/useTaskPickerController.d.ts.map +0 -1
- package/dist/ui/hooks/useTerminalSize.d.ts.map +0 -1
- package/dist/ui/hooks/useTerminalTitle.d.ts.map +0 -1
- package/dist/ui/hooks/useTranscriptHistory.d.ts.map +0 -1
- package/dist/ui/hooks/useTranscriptScroll.d.ts.map +0 -1
- package/dist/ui/item-helpers.d.ts.map +0 -1
- package/dist/ui/layout-decisions.d.ts.map +0 -1
- package/dist/ui/live-area-height.d.ts.map +0 -1
- package/dist/ui/live-item-flush.d.ts.map +0 -1
- package/dist/ui/login.d.ts.map +0 -1
- package/dist/ui/mcp.d.ts.map +0 -1
- package/dist/ui/pixel.d.ts.map +0 -1
- package/dist/ui/prompt-routing.d.ts.map +0 -1
- package/dist/ui/render.d.ts.map +0 -1
- package/dist/ui/session-summary.d.ts.map +0 -1
- package/dist/ui/sessions.d.ts.map +0 -1
- package/dist/ui/spinner-frames.d.ts.map +0 -1
- package/dist/ui/stores/create-store.d.ts.map +0 -1
- package/dist/ui/stores/index.d.ts.map +0 -1
- package/dist/ui/stores/taskbar-store.d.ts.map +0 -1
- package/dist/ui/stores/transcript-scroll-store.d.ts.map +0 -1
- package/dist/ui/submit-prompt-command.d.ts.map +0 -1
- package/dist/ui/submit-slash-commands.d.ts.map +0 -1
- package/dist/ui/terminal-history-format.d.ts.map +0 -1
- package/dist/ui/terminal-history-spacing.d.ts.map +0 -1
- package/dist/ui/terminal-history-status-renderers.d.ts.map +0 -1
- package/dist/ui/terminal-history.d.ts.map +0 -1
- package/dist/ui/testing/screen-recorder.d.ts.map +0 -1
- package/dist/ui/theme/detect-theme.d.ts.map +0 -1
- package/dist/ui/theme/theme.d.ts.map +0 -1
- package/dist/ui/thinking-level.d.ts.map +0 -1
- package/dist/ui/tool-group-summary.d.ts.map +0 -1
- package/dist/ui/tool-line-summary.d.ts.map +0 -1
- package/dist/ui/transcript/MiscRows.d.ts.map +0 -1
- package/dist/ui/transcript/StatusRow.d.ts.map +0 -1
- package/dist/ui/transcript/ToolRows.d.ts.map +0 -1
- package/dist/ui/transcript/TranscriptItemFrame.d.ts.map +0 -1
- package/dist/ui/transcript/TranscriptRenderer.d.ts.map +0 -1
- package/dist/ui/transcript/presentation.d.ts.map +0 -1
- package/dist/ui/transcript/spacing.d.ts.map +0 -1
- package/dist/ui/transcript/tool-presentation.d.ts.map +0 -1
- package/dist/ui/transcript/transcript-lines.d.ts.map +0 -1
- package/dist/ui/utils/assistant-stream-split.d.ts.map +0 -1
- package/dist/ui/utils/highlight.d.ts.map +0 -1
- package/dist/ui/utils/hyperlink.d.ts.map +0 -1
- package/dist/ui/utils/latex-to-unicode.d.ts.map +0 -1
- package/dist/ui/utils/markdown-cache.d.ts.map +0 -1
- package/dist/ui/utils/markdown-renderer.d.ts.map +0 -1
- package/dist/ui/utils/markdown-table.d.ts.map +0 -1
- package/dist/ui/utils/signal.d.ts.map +0 -1
- package/dist/ui/utils/supports-hyperlinks.d.ts.map +0 -1
- package/dist/ui/utils/table-text.d.ts.map +0 -1
- package/dist/ui/utils/terminal-graphics.d.ts.map +0 -1
- package/dist/ui/utils/terminal-input.d.ts.map +0 -1
- package/dist/ui/utils/text-utils.d.ts.map +0 -1
- package/dist/ui/utils/token-to-ansi.d.ts.map +0 -1
- package/dist/ui/utils/user-message-display.d.ts.map +0 -1
- package/dist/ui/utils/word-diff.d.ts.map +0 -1
- package/dist/utils/error-handler.d.ts.map +0 -1
- package/dist/utils/format.d.ts.map +0 -1
- package/dist/utils/git.d.ts.map +0 -1
- package/dist/utils/github-ci.d.ts.map +0 -1
- package/dist/utils/github.d.ts.map +0 -1
- package/dist/utils/http-body.d.ts.map +0 -1
- package/dist/utils/image.d.ts.map +0 -1
- package/dist/utils/open-browser.d.ts.map +0 -1
- package/dist/utils/plan-steps.d.ts.map +0 -1
- package/dist/utils/process.d.ts.map +0 -1
- package/dist/utils/prompt-enhancer.d.ts.map +0 -1
- package/dist/utils/shell.d.ts.map +0 -1
- package/dist/utils/sound.d.ts.map +0 -1
- package/dist/utils/text.d.ts.map +0 -1
|
@@ -31,10 +31,13 @@ import { CONTEXT_LIMITS, resolveContextLimits } from "./context-limits.js";
|
|
|
31
31
|
import { McpCatalogCache } from "./mcp/catalog-cache.js";
|
|
32
32
|
import { describeDropped, importForeignSession, } from "./foreign-session-import.js";
|
|
33
33
|
import { createToolSearchTool } from "../tools/tool-search.js";
|
|
34
|
+
import { createSessionStatsTool } from "../tools/session-stats.js";
|
|
35
|
+
import { createDiagnoseCommand, isInternalDiagnosticsEnabled, SessionDiagnosticsRecorder, } from "./internal-diagnostics.js";
|
|
34
36
|
import { log } from "./logger.js";
|
|
35
37
|
import { setEstimatorModel, calibrateEstimatorFromUsage } from "./compaction/token-estimator.js";
|
|
36
38
|
import { calculateActiveContextTokens } from "./compaction/active-context.js";
|
|
37
39
|
import { resolveCompactionPolicy } from "./compaction/policy.js";
|
|
40
|
+
import { clampThinkingForPlanMode } from "./thinking-level.js";
|
|
38
41
|
import { pruneStaleToolResults } from "./compaction/tool-result-pruner.js";
|
|
39
42
|
import { discoverAgents } from "./agents.js";
|
|
40
43
|
import { enhancePrompt } from "../utils/prompt-enhancer.js";
|
|
@@ -49,6 +52,7 @@ import { wrapSteeringText, buildNotificationSteeringText, STEERING_PREFIX } from
|
|
|
49
52
|
import { AgentNotificationQueue } from "./agent-notifications.js";
|
|
50
53
|
import { VerificationGate, extractAddedLines, isCheckOwnFile, isCodeFilePath, VERIFICATION_STATE_KIND, isVerificationCommand, } from "./verification-gate.js";
|
|
51
54
|
import { classifyVerificationCommand } from "./verification-evidence.js";
|
|
55
|
+
import { captureVerificationSnapshot } from "./verification-snapshot.js";
|
|
52
56
|
import { findUserSessionPrompt, getUserSessionPrompt } from "./session-preview.js";
|
|
53
57
|
import { normalizeMessageImages } from "./message-images.js";
|
|
54
58
|
import crypto from "node:crypto";
|
|
@@ -124,6 +128,9 @@ export class AgentSession {
|
|
|
124
128
|
// transcript rows the live run showed.
|
|
125
129
|
appMarkers = [];
|
|
126
130
|
turnMetrics = [];
|
|
131
|
+
/** Internal-only (EZ_INTERNAL): live per-session cost/reliability recorder.
|
|
132
|
+
* Absent entirely in public builds — see core/internal-diagnostics.ts. */
|
|
133
|
+
diagnosticsRecorder;
|
|
127
134
|
tools = [];
|
|
128
135
|
/** Rebuilds the read tool for a new model (video byte cap is baked in at
|
|
129
136
|
* creation). Called from switchModel so video-capable models get the
|
|
@@ -193,6 +200,15 @@ export class AgentSession {
|
|
|
193
200
|
* only on a real edge. */
|
|
194
201
|
verificationArmed = false;
|
|
195
202
|
compactionOccurred = false;
|
|
203
|
+
/**
|
|
204
|
+
* Re-grounding carry-over for post-turn compaction. `resetHookState` clears
|
|
205
|
+
* `compactionOccurred` at run start — before the injection point — so a
|
|
206
|
+
* background compaction that finished after the final response parks its
|
|
207
|
+
* "re-ground next turn" signal here for pickup at the next run start.
|
|
208
|
+
*/
|
|
209
|
+
compactionArmedForNextRun = false;
|
|
210
|
+
/** In-flight post-turn (background) compaction, if any. */
|
|
211
|
+
postTurnCompaction;
|
|
196
212
|
lastCompactionCompacted = false;
|
|
197
213
|
compactionRetryAfter = 0;
|
|
198
214
|
/** A restored oversized checkpoint must be canonicalized before its first prompt is persisted. */
|
|
@@ -221,6 +237,7 @@ export class AgentSession {
|
|
|
221
237
|
notifications = new AgentNotificationQueue();
|
|
222
238
|
managerAbortSignal;
|
|
223
239
|
managerAbortHandler = () => {
|
|
240
|
+
this.lspManager?.clearPendingDiagnostics();
|
|
224
241
|
void this.subAgentManager?.interruptAll();
|
|
225
242
|
};
|
|
226
243
|
mcpManager;
|
|
@@ -375,6 +392,7 @@ export class AgentSession {
|
|
|
375
392
|
provider: this.provider,
|
|
376
393
|
model: this.model,
|
|
377
394
|
lspDiagnostics: this.settingsManager.get("lspDiagnostics"),
|
|
395
|
+
deferLspDiagnostics: true,
|
|
378
396
|
getWriteGuardSettings: () => ({
|
|
379
397
|
allowOutsideWorkspaceWrites: this.settingsManager.get("allowOutsideWorkspaceWrites"),
|
|
380
398
|
additionalRoots: this.additionalRoots,
|
|
@@ -429,6 +447,11 @@ export class AgentSession {
|
|
|
429
447
|
: {}),
|
|
430
448
|
});
|
|
431
449
|
const tools = [...builtInTools, ...(this.opts.additionalTools ?? [])];
|
|
450
|
+
// Internal-only tool, appended last so public sessions keep a
|
|
451
|
+
// byte-identical tool block (prefix-cache stability).
|
|
452
|
+
if (isInternalDiagnosticsEnabled()) {
|
|
453
|
+
tools.push(createSessionStatsTool(() => this.diagnosticsRecorder));
|
|
454
|
+
}
|
|
432
455
|
// Apply the optional tool allow-list (read-only advisory sessions). Filtering
|
|
433
456
|
// here means the excluded tools are never registered with the agent loop, so
|
|
434
457
|
// a hallucinated call can't mutate the repo — and buildSystemPrompt below is
|
|
@@ -528,6 +551,20 @@ export class AgentSession {
|
|
|
528
551
|
const builtins = createBuiltinCommands();
|
|
529
552
|
for (const cmd of builtins)
|
|
530
553
|
this.slashCommands.register(cmd);
|
|
554
|
+
// Internal-only diagnostics: recorder + /diagnose exist exclusively when
|
|
555
|
+
// the internal flag is on. Public sessions never see either, so the
|
|
556
|
+
// command list and prompt stay identical to a build without this code.
|
|
557
|
+
if (isInternalDiagnosticsEnabled()) {
|
|
558
|
+
this.diagnosticsRecorder = new SessionDiagnosticsRecorder({
|
|
559
|
+
// Lazy: the session id is assigned at first prompt, not init.
|
|
560
|
+
sessionId: () => this.sessionId,
|
|
561
|
+
cwd: this.cwd,
|
|
562
|
+
provider: this.provider,
|
|
563
|
+
model: this.model,
|
|
564
|
+
});
|
|
565
|
+
this.diagnosticsRecorder.attach(this.eventBus);
|
|
566
|
+
this.slashCommands.register(createDiagnoseCommand());
|
|
567
|
+
}
|
|
531
568
|
// Wire up /help to show all registered + prompt + custom commands.
|
|
532
569
|
const helpCmd = this.slashCommands.get("help");
|
|
533
570
|
if (helpCmd) {
|
|
@@ -862,6 +899,7 @@ export class AgentSession {
|
|
|
862
899
|
kind: "prompt",
|
|
863
900
|
visibility: "transcript",
|
|
864
901
|
}, options = {}) {
|
|
902
|
+
await this.settlePostTurnCompaction();
|
|
865
903
|
await this.adoptDeferredCheckpointBeforePrompt();
|
|
866
904
|
const slash = await this.resolveSlashInput(content);
|
|
867
905
|
if (slash?.kind === "template") {
|
|
@@ -896,6 +934,7 @@ export class AgentSession {
|
|
|
896
934
|
* attachments are always a direct conversational turn.
|
|
897
935
|
*/
|
|
898
936
|
async promptWithAttachments(text, attachments) {
|
|
937
|
+
await this.settlePostTurnCompaction();
|
|
899
938
|
await this.adoptDeferredCheckpointBeforePrompt();
|
|
900
939
|
const parts = this.buildAttachmentParts(text, attachments);
|
|
901
940
|
if (parts.length === 0)
|
|
@@ -991,6 +1030,7 @@ export class AgentSession {
|
|
|
991
1030
|
* is the verbatim user ask, pinned for post-compaction re-grounding.
|
|
992
1031
|
*/
|
|
993
1032
|
resetHookState(originalRequest) {
|
|
1033
|
+
this.lspManager?.clearPendingDiagnostics();
|
|
994
1034
|
this.hookStats = {
|
|
995
1035
|
changedLines: 0,
|
|
996
1036
|
toolCalls: 0,
|
|
@@ -1035,6 +1075,13 @@ export class AgentSession {
|
|
|
1035
1075
|
this.backgroundVerification.delete(id);
|
|
1036
1076
|
}
|
|
1037
1077
|
this.compactionOccurred = false;
|
|
1078
|
+
// Post-turn compaction may have landed between runs — adopt its armed
|
|
1079
|
+
// signal so the re-grounding hook fires for this run exactly as it would
|
|
1080
|
+
// after a pre-run compaction.
|
|
1081
|
+
if (this.compactionArmedForNextRun) {
|
|
1082
|
+
this.compactionArmedForNextRun = false;
|
|
1083
|
+
this.compactionOccurred = true;
|
|
1084
|
+
}
|
|
1038
1085
|
this.originalRequest = originalRequest;
|
|
1039
1086
|
}
|
|
1040
1087
|
/**
|
|
@@ -1064,7 +1111,17 @@ export class AgentSession {
|
|
|
1064
1111
|
// it poisoned the gate on green output and re-armed the hook into
|
|
1065
1112
|
// every later question turn.
|
|
1066
1113
|
const classification = classifyVerificationCommand(event.args.command);
|
|
1067
|
-
|
|
1114
|
+
if (classification.snapshotEligible && event.args.persist !== true) {
|
|
1115
|
+
const call = this.hookToolCalls.get(event.toolCallId);
|
|
1116
|
+
call.sourceSnapshot = await captureVerificationSnapshot(this.opts.cwd, [
|
|
1117
|
+
...this.hookFileEditCounts.keys(),
|
|
1118
|
+
]);
|
|
1119
|
+
if (call.sourceSnapshot === null)
|
|
1120
|
+
this.verificationGate.requireFreshVerification(true, event.args.command);
|
|
1121
|
+
}
|
|
1122
|
+
else {
|
|
1123
|
+
this.verificationGate.requireFreshVerification(!classification.accepted && classification.mayMutate, event.args.command);
|
|
1124
|
+
}
|
|
1068
1125
|
await this.persistVerificationState();
|
|
1069
1126
|
}
|
|
1070
1127
|
break;
|
|
@@ -1124,20 +1181,32 @@ export class AgentSession {
|
|
|
1124
1181
|
if (args && call && name === "bash") {
|
|
1125
1182
|
const command = typeof args.command === "string" ? args.command : "";
|
|
1126
1183
|
const classification = classifyVerificationCommand(command);
|
|
1127
|
-
if (classification.accepted) {
|
|
1184
|
+
if (classification.accepted || classification.snapshotEligible) {
|
|
1128
1185
|
if (args.run_in_background === true && !event.isError && args.persist !== true) {
|
|
1129
1186
|
const id = /^ID:\s*(\S+)/m.exec(event.result)?.[1];
|
|
1130
1187
|
// No parseable ID means the check cannot be tracked to a real exit
|
|
1131
1188
|
// code — no evidence either way. Recording a FAILURE here made
|
|
1132
1189
|
// every later green run of a different spelling look owed.
|
|
1133
1190
|
if (id)
|
|
1134
|
-
this.backgroundVerification.set(id, {
|
|
1191
|
+
this.backgroundVerification.set(id, {
|
|
1192
|
+
revision: call.revision,
|
|
1193
|
+
command,
|
|
1194
|
+
...(classification.snapshotEligible
|
|
1195
|
+
? { sourceSnapshot: call.sourceSnapshot ?? null }
|
|
1196
|
+
: {}),
|
|
1197
|
+
});
|
|
1198
|
+
else if (classification.snapshotEligible)
|
|
1199
|
+
this.verificationGate.requireFreshVerification(true, command);
|
|
1135
1200
|
}
|
|
1136
1201
|
else if (args.persist === true) {
|
|
1137
1202
|
// Persistent-shell checks are not bounded evidence (steering can
|
|
1138
1203
|
// interleave): neither a pass nor a failure. A recorded failure
|
|
1139
1204
|
// here blocked approval for sessions that prefer the shell.
|
|
1140
1205
|
}
|
|
1206
|
+
else if (classification.snapshotEligible) {
|
|
1207
|
+
await this.finishSnapshotVerification({ command, revision: call.revision, sourceSnapshot: call.sourceSnapshot ?? null }, !event.isError && /^Exit code:\s*0(?:\s|$)/i.test(event.result.trim()));
|
|
1208
|
+
verificationChanged = true;
|
|
1209
|
+
}
|
|
1141
1210
|
else {
|
|
1142
1211
|
if (!event.isError && /^Exit code:\s*0(?:\s|$)/i.test(event.result.trim())) {
|
|
1143
1212
|
this.verificationGate.recordVerification(call.revision, command);
|
|
@@ -1147,6 +1216,7 @@ export class AgentSession {
|
|
|
1147
1216
|
}
|
|
1148
1217
|
verificationChanged = true;
|
|
1149
1218
|
}
|
|
1219
|
+
delete call.sourceSnapshot;
|
|
1150
1220
|
}
|
|
1151
1221
|
else if (classification.candidate) {
|
|
1152
1222
|
// Green but untrusted: remember WHY so the demand can tell the
|
|
@@ -1155,18 +1225,8 @@ export class AgentSession {
|
|
|
1155
1225
|
}
|
|
1156
1226
|
}
|
|
1157
1227
|
if (!event.isError && args && name === "task_output" && typeof args.id === "string") {
|
|
1158
|
-
|
|
1159
|
-
|
|
1160
|
-
if (started && proc && proc.exitCode !== null) {
|
|
1161
|
-
if (proc.exitCode === 0) {
|
|
1162
|
-
this.verificationGate.recordVerification(started.revision, started.command);
|
|
1163
|
-
}
|
|
1164
|
-
else {
|
|
1165
|
-
this.verificationGate.recordFailedVerification(started.command, started.revision);
|
|
1166
|
-
}
|
|
1167
|
-
this.backgroundVerification.delete(args.id);
|
|
1168
|
-
verificationChanged = true;
|
|
1169
|
-
}
|
|
1228
|
+
verificationChanged =
|
|
1229
|
+
(await this.recordFinishedBackgroundVerification(args.id)) || verificationChanged;
|
|
1170
1230
|
}
|
|
1171
1231
|
if (verificationChanged)
|
|
1172
1232
|
await this.persistVerificationState();
|
|
@@ -1257,11 +1317,18 @@ export class AgentSession {
|
|
|
1257
1317
|
// it in the very next turn instead of discovering it at the pre-stop
|
|
1258
1318
|
// completion gate — but it never displaces user steering, which rides out
|
|
1259
1319
|
// in the same batch when both are pending.
|
|
1320
|
+
const diagnosticText = this.lspManager?.drainDiagnostics(this.getVerificationProblem() !== null, { deferUnverified: true });
|
|
1321
|
+
if (diagnosticText)
|
|
1322
|
+
this.eventBus.emit("diagnostics", { text: diagnosticText });
|
|
1323
|
+
this.refreshVerificationArmed();
|
|
1260
1324
|
const notified = this.notifications.drain();
|
|
1261
|
-
const notificationMessage = notified.length > 0
|
|
1325
|
+
const notificationMessage = notified.length > 0 || diagnosticText
|
|
1262
1326
|
? {
|
|
1263
1327
|
role: "user",
|
|
1264
|
-
content: buildNotificationSteeringText(
|
|
1328
|
+
content: buildNotificationSteeringText([
|
|
1329
|
+
...notified.map((entry) => entry.text),
|
|
1330
|
+
...(diagnosticText ? [diagnosticText] : []),
|
|
1331
|
+
]),
|
|
1265
1332
|
provenance: { source: "runtime", kind: "notification", visibility: "hidden" },
|
|
1266
1333
|
}
|
|
1267
1334
|
: null;
|
|
@@ -1611,6 +1678,8 @@ export class AgentSession {
|
|
|
1611
1678
|
/** Would a stop right now inject the verification gate? Same conditions as
|
|
1612
1679
|
* the pre-stop branch below, so arming and injection cannot disagree. */
|
|
1613
1680
|
wouldInjectVerification() {
|
|
1681
|
+
if (this.lspManager?.hasQueuedDiagnostics())
|
|
1682
|
+
return true;
|
|
1614
1683
|
if (this.opts.selfCorrectionHooks === false)
|
|
1615
1684
|
return false;
|
|
1616
1685
|
if (!this.settingsManager.get("verificationGateEnabled"))
|
|
@@ -1632,6 +1701,11 @@ export class AgentSession {
|
|
|
1632
1701
|
if (!this.settingsManager)
|
|
1633
1702
|
return;
|
|
1634
1703
|
this.refreshIdealReviewArmed();
|
|
1704
|
+
this.refreshVerificationArmed();
|
|
1705
|
+
}
|
|
1706
|
+
refreshVerificationArmed() {
|
|
1707
|
+
if (!this.settingsManager)
|
|
1708
|
+
return;
|
|
1635
1709
|
const armed = this.wouldInjectVerification();
|
|
1636
1710
|
if (armed === this.verificationArmed)
|
|
1637
1711
|
return;
|
|
@@ -1650,9 +1724,36 @@ export class AgentSession {
|
|
|
1650
1724
|
* blocked until harness-owned post-injection reads cover every changed file.
|
|
1651
1725
|
*/
|
|
1652
1726
|
async getHookFollowUpMessages() {
|
|
1727
|
+
// Exit notifications and task_output refer to the same host process record.
|
|
1728
|
+
// Do not force an extra polling tool/turn merely to acknowledge a known exit.
|
|
1729
|
+
let backgroundChanged = false;
|
|
1730
|
+
for (const id of this.backgroundVerification.keys()) {
|
|
1731
|
+
backgroundChanged =
|
|
1732
|
+
(await this.recordFinishedBackgroundVerification(id)) || backgroundChanged;
|
|
1733
|
+
}
|
|
1734
|
+
if (backgroundChanged)
|
|
1735
|
+
await this.persistVerificationState();
|
|
1736
|
+
// Edits return immediately; only the completion boundary waits for remaining
|
|
1737
|
+
// checks. Queued timeouts stay explicitly unverified, never a false all-clear.
|
|
1738
|
+
await this.lspManager?.flushDiagnostics(this.opts.signal);
|
|
1739
|
+
if (this.opts.signal?.aborted)
|
|
1740
|
+
return null;
|
|
1741
|
+
const diagnosticText = this.lspManager?.drainDiagnostics(this.getVerificationProblem() !== null);
|
|
1742
|
+
if (diagnosticText)
|
|
1743
|
+
this.eventBus.emit("diagnostics", { text: diagnosticText });
|
|
1744
|
+
this.refreshVerificationArmed();
|
|
1745
|
+
const diagnosticMessages = diagnosticText
|
|
1746
|
+
? [
|
|
1747
|
+
{
|
|
1748
|
+
role: "user",
|
|
1749
|
+
content: buildNotificationSteeringText([diagnosticText]),
|
|
1750
|
+
provenance: { source: "runtime", kind: "notification", visibility: "hidden" },
|
|
1751
|
+
},
|
|
1752
|
+
]
|
|
1753
|
+
: [];
|
|
1653
1754
|
const childCompletionFollowUp = buildSubAgentCompletionFollowUp(this.subAgentManager);
|
|
1654
1755
|
if (childCompletionFollowUp)
|
|
1655
|
-
return childCompletionFollowUp;
|
|
1756
|
+
return [...diagnosticMessages, ...childCompletionFollowUp];
|
|
1656
1757
|
// Background processes started this run and never read block completion:
|
|
1657
1758
|
// their progress/exit checkpoints only land on the steering path, which an
|
|
1658
1759
|
// agent about to stop never reaches.
|
|
@@ -1662,7 +1763,7 @@ export class AgentSession {
|
|
|
1662
1763
|
log("INFO", "process-gate", "Injecting background-process completion gate", {
|
|
1663
1764
|
injected: String(this.processGateInjected),
|
|
1664
1765
|
});
|
|
1665
|
-
return processFollowUp;
|
|
1766
|
+
return [...diagnosticMessages, ...processFollowUp];
|
|
1666
1767
|
}
|
|
1667
1768
|
// Verification gate: code was edited but nothing verified since the last
|
|
1668
1769
|
// edit. Above the Ideal review so checks RUN before the read-based review
|
|
@@ -1679,12 +1780,20 @@ export class AgentSession {
|
|
|
1679
1780
|
// flash arming exists to prevent.
|
|
1680
1781
|
this.eventBus.emit("hook", {
|
|
1681
1782
|
kind: "verification",
|
|
1682
|
-
...(verificationReason === "
|
|
1783
|
+
...(verificationReason === "tamper"
|
|
1784
|
+
? { verificationReason: "check_review" }
|
|
1785
|
+
: verificationReason === "recheck"
|
|
1786
|
+
? { verificationReason }
|
|
1787
|
+
: {}),
|
|
1683
1788
|
});
|
|
1684
1789
|
this.refreshHookArming();
|
|
1685
|
-
return verificationFollowUp;
|
|
1790
|
+
return [...diagnosticMessages, ...verificationFollowUp];
|
|
1686
1791
|
}
|
|
1687
1792
|
}
|
|
1793
|
+
// Address real errors before review; unavailable checks share the existing
|
|
1794
|
+
// verification demand above instead of manufacturing a separate hook.
|
|
1795
|
+
if (diagnosticMessages.length > 0)
|
|
1796
|
+
return diagnosticMessages;
|
|
1688
1797
|
if (this.opts.selfCorrectionHooks === false || this.idealReviewSuppressed)
|
|
1689
1798
|
return null;
|
|
1690
1799
|
if (this.idealReviewPhase === "reviewing") {
|
|
@@ -1743,7 +1852,6 @@ export class AgentSession {
|
|
|
1743
1852
|
// Independent reviewer first (async, bounded): its findings ride in the
|
|
1744
1853
|
// SAME follow-up batch as the in-thread review + coverage requirements, so
|
|
1745
1854
|
// addressing everything still costs one extra turn.
|
|
1746
|
-
const independentMessages = await this.runIndependentReview(decision);
|
|
1747
1855
|
this.reviewCoverage.start(this.hookFileEditCounts.keys());
|
|
1748
1856
|
this.idealReviewPhase = "reviewing";
|
|
1749
1857
|
const coverage = this.reviewCoverage.evidence();
|
|
@@ -1760,6 +1868,8 @@ export class AgentSession {
|
|
|
1760
1868
|
// coverage is outstanding injects again. Disarm lands later, on the read
|
|
1761
1869
|
// that closes the last gap (or when the retry budget escalates).
|
|
1762
1870
|
this.refreshIdealReviewArmed();
|
|
1871
|
+
// Announce the phase before the reviewer starts, not after its bounded wait.
|
|
1872
|
+
const independentMessages = await this.runIndependentReview(decision);
|
|
1763
1873
|
log("INFO", "ideal", "Injecting ideal review before final response", {
|
|
1764
1874
|
coverageExpected: coverage.expected,
|
|
1765
1875
|
coverageMissing: coverage.missing,
|
|
@@ -1839,6 +1949,11 @@ export class AgentSession {
|
|
|
1839
1949
|
// of the public API model window. Failed/no-op attempts cool down across
|
|
1840
1950
|
// prompts; provider overflow recovery still bypasses this path entirely.
|
|
1841
1951
|
if (this.settingsManager.get("autoCompact") && Date.now() >= this.compactionRetryAfter) {
|
|
1952
|
+
// A post-turn compaction may still be running in the background. Let it
|
|
1953
|
+
// settle first: it usually already compacted this history, so the
|
|
1954
|
+
// decision below turns into a no-op instead of duplicate work.
|
|
1955
|
+
if (this.postTurnCompaction)
|
|
1956
|
+
await this.postTurnCompaction;
|
|
1842
1957
|
const contextWindow = getContextWindow(this.model, {
|
|
1843
1958
|
provider: this.provider,
|
|
1844
1959
|
accountId: creds.accountId,
|
|
@@ -1906,7 +2021,13 @@ export class AgentSession {
|
|
|
1906
2021
|
maxTokens: this.maxTokens,
|
|
1907
2022
|
maxTurns: this.opts.maxTurns,
|
|
1908
2023
|
maxTurnExtensions: this.opts.maxTurnExtensions,
|
|
1909
|
-
|
|
2024
|
+
// Plan mode caps effort at medium (Codex `plan_mode_reasoning_effort`
|
|
2025
|
+
// preset): read-only exploration doesn't need xhigh/max reasoning, and
|
|
2026
|
+
// deep-reasoning models left at the ceiling burn enormous thinking
|
|
2027
|
+
// budgets re-deriving context they cannot act on.
|
|
2028
|
+
thinking: this.planModeRef.current
|
|
2029
|
+
? clampThinkingForPlanMode(this.thinkingLevel)
|
|
2030
|
+
: this.thinkingLevel,
|
|
1910
2031
|
apiKey,
|
|
1911
2032
|
// Per-turn credential resolution. A run can span many minutes; if any
|
|
1912
2033
|
// process sharing auth.json refreshes this grant meanwhile, the token
|
|
@@ -2172,8 +2293,15 @@ export class AgentSession {
|
|
|
2172
2293
|
await this.persistMessage(this.messages[i]);
|
|
2173
2294
|
}
|
|
2174
2295
|
this.lastPersistedIndex = this.messages.length;
|
|
2296
|
+
// Final response is delivered — compact in the background while the user
|
|
2297
|
+
// reads it, instead of charging the summarizer latency to their next
|
|
2298
|
+
// prompt. Detached by design; the pre-run path above remains the backstop.
|
|
2299
|
+
this.maybeCompactPostTurn(creds);
|
|
2175
2300
|
}
|
|
2176
2301
|
async switchModel(provider, model) {
|
|
2302
|
+
// The model-switch note is appended to `this.messages`; settle any
|
|
2303
|
+
// background compaction first so the note cannot be swapped out.
|
|
2304
|
+
await this.settlePostTurnCompaction();
|
|
2177
2305
|
const prevProvider = this.provider;
|
|
2178
2306
|
const prevModel = this.model;
|
|
2179
2307
|
// Diff gate: a "switch" to the model already in use is not state change.
|
|
@@ -2374,7 +2502,104 @@ export class AgentSession {
|
|
|
2374
2502
|
newCount: result.newCount,
|
|
2375
2503
|
});
|
|
2376
2504
|
}
|
|
2377
|
-
|
|
2505
|
+
/**
|
|
2506
|
+
* Wait out any in-flight post-turn background compaction before a new
|
|
2507
|
+
* entry point mutates `this.messages` (prompt, attachments, model switch).
|
|
2508
|
+
* The background compact() snapshots and then REPLACES the array, so a
|
|
2509
|
+
* message pushed while it runs would be silently dropped from the live
|
|
2510
|
+
* history — the pre-run await in runLoop() sits after the push and cannot
|
|
2511
|
+
* protect it.
|
|
2512
|
+
*/
|
|
2513
|
+
async settlePostTurnCompaction() {
|
|
2514
|
+
if (this.postTurnCompaction)
|
|
2515
|
+
await this.postTurnCompaction;
|
|
2516
|
+
}
|
|
2517
|
+
/**
|
|
2518
|
+
* Post-turn compaction: once the final response has been delivered, compact
|
|
2519
|
+
* in the background while the user reads the answer, instead of making the
|
|
2520
|
+
* next prompt pay the summarizer latency up front (the pre-run path stays as
|
|
2521
|
+
* the backstop, so a skipped or failed attempt costs nothing). Mirrors the
|
|
2522
|
+
* Codex `model_post_turn_compact_threshold_percent` guards: skip when user
|
|
2523
|
+
* input is already queued (it would race the next turn), when the run was
|
|
2524
|
+
* aborted, or during the failure cooldown — and never let a compaction
|
|
2525
|
+
* error surface in the completed turn.
|
|
2526
|
+
*/
|
|
2527
|
+
maybeCompactPostTurn(creds) {
|
|
2528
|
+
if (!this.settingsManager.get("autoCompact"))
|
|
2529
|
+
return;
|
|
2530
|
+
if (this.opts.signal?.aborted)
|
|
2531
|
+
return;
|
|
2532
|
+
if (this.userQueue.length > 0)
|
|
2533
|
+
return;
|
|
2534
|
+
if (this.postTurnCompaction)
|
|
2535
|
+
return;
|
|
2536
|
+
if (Date.now() < this.compactionRetryAfter)
|
|
2537
|
+
return;
|
|
2538
|
+
// One compaction per turn boundary: a pre-run or overflow-recovery
|
|
2539
|
+
// compaction already shrank this run's history — re-probing right after
|
|
2540
|
+
// the final response would only re-derive that decision.
|
|
2541
|
+
if (this.compactionOccurred)
|
|
2542
|
+
return;
|
|
2543
|
+
const contextWindow = getContextWindow(this.model, {
|
|
2544
|
+
provider: this.provider,
|
|
2545
|
+
accountId: creds.accountId,
|
|
2546
|
+
});
|
|
2547
|
+
const policy = resolveCompactionPolicy({
|
|
2548
|
+
provider: this.provider,
|
|
2549
|
+
model: this.model,
|
|
2550
|
+
contextWindow,
|
|
2551
|
+
threshold: this.settingsManager.get("compactThreshold"),
|
|
2552
|
+
accountId: creds.accountId,
|
|
2553
|
+
approvedPlanPath: this.approvedPlanPath,
|
|
2554
|
+
});
|
|
2555
|
+
let activeTokens;
|
|
2556
|
+
if (this.providerContext) {
|
|
2557
|
+
const anchorIndex = this.messages.lastIndexOf(this.providerContext.anchor);
|
|
2558
|
+
if (anchorIndex >= 0) {
|
|
2559
|
+
activeTokens = calculateActiveContextTokens(this.messages, {
|
|
2560
|
+
usage: this.providerContext.usage,
|
|
2561
|
+
pendingMessages: this.messages.slice(anchorIndex + 1),
|
|
2562
|
+
});
|
|
2563
|
+
}
|
|
2564
|
+
}
|
|
2565
|
+
if (!shouldCompact(this.messages, contextWindow, policy.threshold, activeTokens))
|
|
2566
|
+
return;
|
|
2567
|
+
log("INFO", "compaction", "Post-turn compaction decision — compacting in background", {
|
|
2568
|
+
provider: this.provider,
|
|
2569
|
+
model: this.model,
|
|
2570
|
+
transport: this.provider === "openai" && creds.accountId ? "codex_oauth" : "public_api",
|
|
2571
|
+
contextWindow: String(contextWindow),
|
|
2572
|
+
activeTokens: activeTokens === undefined ? "estimated" : String(activeTokens),
|
|
2573
|
+
triggerLimit: String(policy.targetTokens),
|
|
2574
|
+
});
|
|
2575
|
+
this.postTurnCompaction = (async () => {
|
|
2576
|
+
try {
|
|
2577
|
+
await this.compact(creds, "automatic");
|
|
2578
|
+
if (this.lastCompactionCompacted) {
|
|
2579
|
+
// Arm re-grounding for the next turn. resetHookState clears
|
|
2580
|
+
// compactionOccurred at run start, before the injection point, so
|
|
2581
|
+
// park the signal for pickup there.
|
|
2582
|
+
this.compactionArmedForNextRun = true;
|
|
2583
|
+
this.compactionRetryAfter = 0;
|
|
2584
|
+
}
|
|
2585
|
+
else {
|
|
2586
|
+
this.compactionRetryAfter = Date.now() + 30_000;
|
|
2587
|
+
}
|
|
2588
|
+
}
|
|
2589
|
+
catch (error) {
|
|
2590
|
+
this.compactionRetryAfter = Date.now() + 30_000;
|
|
2591
|
+
if (isAbortError(error) || this.opts.signal?.aborted)
|
|
2592
|
+
return;
|
|
2593
|
+
log("WARN", "compaction", `Post-turn compaction failed; cooling down for 30s: ${error instanceof Error ? error.message : String(error)}`);
|
|
2594
|
+
}
|
|
2595
|
+
finally {
|
|
2596
|
+
this.postTurnCompaction = undefined;
|
|
2597
|
+
}
|
|
2598
|
+
})();
|
|
2599
|
+
}
|
|
2600
|
+
async compact(existingCredentials, mode = "manual",
|
|
2601
|
+
/** User-stated focus (`/compact <focus>`): what must survive verbatim. */
|
|
2602
|
+
focus) {
|
|
2378
2603
|
this.lastCompactionCompacted = false;
|
|
2379
2604
|
const creds = existingCredentials ??
|
|
2380
2605
|
(await this.authStorage.resolveCredentials(this.provider, {
|
|
@@ -2407,6 +2632,7 @@ export class AgentSession {
|
|
|
2407
2632
|
targetTokens: policy.targetTokens,
|
|
2408
2633
|
signal: this.opts.signal,
|
|
2409
2634
|
approvedPlanPath: this.approvedPlanPath,
|
|
2635
|
+
focus,
|
|
2410
2636
|
});
|
|
2411
2637
|
contextSelection = output.result.contextSelection;
|
|
2412
2638
|
return output;
|
|
@@ -2968,6 +3194,9 @@ export class AgentSession {
|
|
|
2968
3194
|
},
|
|
2969
3195
|
};
|
|
2970
3196
|
this.turnMetrics.push(payload);
|
|
3197
|
+
// Internal diagnostics piggyback on the authoritative per-turn metric —
|
|
3198
|
+
// one source of truth, and the record flushes to disk every turn.
|
|
3199
|
+
this.diagnosticsRecorder?.recordTurnMetric(payload);
|
|
2971
3200
|
if (this.sessionPath)
|
|
2972
3201
|
await this.sessionManager.appendTurnMetric(this.sessionPath, payload);
|
|
2973
3202
|
}
|
|
@@ -3066,7 +3295,55 @@ export class AgentSession {
|
|
|
3066
3295
|
* instead of dropping the marker or falling back to a raw verdict string.
|
|
3067
3296
|
* No-op persistence for transient sessions (kept in memory only).
|
|
3068
3297
|
*/
|
|
3298
|
+
async recordFinishedBackgroundVerification(id) {
|
|
3299
|
+
const started = this.backgroundVerification.get(id);
|
|
3300
|
+
const proc = this.processManager?.list().find((entry) => entry.id === id);
|
|
3301
|
+
if (!started || !proc || proc.exitCode === null)
|
|
3302
|
+
return false;
|
|
3303
|
+
if (started.sourceSnapshot !== undefined) {
|
|
3304
|
+
await this.finishSnapshotVerification(started, proc.exitCode === 0);
|
|
3305
|
+
}
|
|
3306
|
+
else if (proc.exitCode === 0) {
|
|
3307
|
+
this.verificationGate.recordVerification(started.revision, started.command);
|
|
3308
|
+
}
|
|
3309
|
+
else {
|
|
3310
|
+
this.verificationGate.recordFailedVerification(started.command, started.revision);
|
|
3311
|
+
}
|
|
3312
|
+
this.backgroundVerification.delete(id);
|
|
3313
|
+
return true;
|
|
3314
|
+
}
|
|
3315
|
+
getVerificationEvidence() {
|
|
3316
|
+
return this.verificationGate.evidence();
|
|
3317
|
+
}
|
|
3318
|
+
async finishSnapshotVerification(check, passed) {
|
|
3319
|
+
const after = check.sourceSnapshot
|
|
3320
|
+
? await captureVerificationSnapshot(this.opts.cwd, [...this.hookFileEditCounts.keys()])
|
|
3321
|
+
: null;
|
|
3322
|
+
if (after === null || after !== check.sourceSnapshot) {
|
|
3323
|
+
this.verificationGate.requireFreshVerification(true, check.command);
|
|
3324
|
+
this.verificationGate.recordRejectedCheck(check.command, after === null
|
|
3325
|
+
? "Workspace inputs could not be compared; run a read-only check after the command"
|
|
3326
|
+
: "Command changed workspace inputs; run checks against the changed source");
|
|
3327
|
+
if (!passed)
|
|
3328
|
+
this.verificationGate.recordFailedVerification(check.command);
|
|
3329
|
+
}
|
|
3330
|
+
else if (passed) {
|
|
3331
|
+
const classification = classifyVerificationCommand(check.command);
|
|
3332
|
+
if (classification.snapshotPreserveOnly) {
|
|
3333
|
+
this.verificationGate.recordRejectedCheck(check.command, classification.reason);
|
|
3334
|
+
}
|
|
3335
|
+
else {
|
|
3336
|
+
this.verificationGate.recordVerification(check.revision, check.command);
|
|
3337
|
+
}
|
|
3338
|
+
}
|
|
3339
|
+
else {
|
|
3340
|
+
this.verificationGate.recordFailedVerification(check.command, check.revision);
|
|
3341
|
+
}
|
|
3342
|
+
}
|
|
3069
3343
|
getVerificationProblem() {
|
|
3344
|
+
if ([...this.hookToolCalls.values()].some((call) => call.sourceSnapshot !== undefined)) {
|
|
3345
|
+
return "Unverified: a build is still running or its workspace comparison is pending.";
|
|
3346
|
+
}
|
|
3070
3347
|
return (this.verificationGate.verificationProblem() ??
|
|
3071
3348
|
(this.backgroundVerification.size > 0
|
|
3072
3349
|
? "Unverified: a background check is still running or its result has not been confirmed."
|
|
@@ -3214,7 +3491,10 @@ export class AgentSession {
|
|
|
3214
3491
|
async enhancePrompt(text) {
|
|
3215
3492
|
if (!text.trim())
|
|
3216
3493
|
return { enhanced: text, segments: [{ kind: "text", text }] };
|
|
3217
|
-
|
|
3494
|
+
// Keep credentials and settings on the model selected at click time, even
|
|
3495
|
+
// if the user switches models while credential resolution is pending.
|
|
3496
|
+
const { provider, model, thinkingLevel, maxTokens, baseUrl } = this;
|
|
3497
|
+
const creds = await this.authStorage.resolveCredentials(provider, {
|
|
3218
3498
|
storageKeys: this.currentAuthStorageKeys(),
|
|
3219
3499
|
});
|
|
3220
3500
|
// Cheap, best-effort stack detection from the project root so terminology is
|
|
@@ -3227,12 +3507,16 @@ export class AgentSession {
|
|
|
3227
3507
|
/* detection is best-effort — fall back to no stack hint */
|
|
3228
3508
|
}
|
|
3229
3509
|
return enhancePrompt({
|
|
3230
|
-
provider
|
|
3231
|
-
model
|
|
3510
|
+
provider,
|
|
3511
|
+
model,
|
|
3512
|
+
thinking: thinkingLevel,
|
|
3513
|
+
maxTokens,
|
|
3514
|
+
userAgent: provider === "anthropic" ? await getClaudeCliUserAgent() : undefined,
|
|
3515
|
+
projectId: creds.projectId,
|
|
3232
3516
|
prompt: text,
|
|
3233
3517
|
stack,
|
|
3234
3518
|
apiKey: creds.accessToken,
|
|
3235
|
-
baseUrl:
|
|
3519
|
+
baseUrl: baseUrl ?? creds.baseUrl,
|
|
3236
3520
|
accountId: creds.accountId,
|
|
3237
3521
|
signal: this.opts.signal,
|
|
3238
3522
|
});
|
|
@@ -3287,6 +3571,13 @@ export class AgentSession {
|
|
|
3287
3571
|
return this.getPromptCacheKey();
|
|
3288
3572
|
}
|
|
3289
3573
|
async dispose() {
|
|
3574
|
+
// Quiesce any in-flight post-turn compaction BEFORE tearing down state:
|
|
3575
|
+
// the background compact() snapshots and replaces `this.messages`, so
|
|
3576
|
+
// letting it run past this point would checkpoint a near-empty history
|
|
3577
|
+
// and leak a junk session file after teardown.
|
|
3578
|
+
if (this.postTurnCompaction)
|
|
3579
|
+
await this.postTurnCompaction;
|
|
3580
|
+
this.diagnosticsRecorder?.finalize();
|
|
3290
3581
|
this.managerAbortSignal?.removeEventListener("abort", this.managerAbortHandler);
|
|
3291
3582
|
this.processManager?.shutdownAll();
|
|
3292
3583
|
this.lspManager?.shutdownAll();
|
|
@@ -3489,7 +3780,7 @@ export class AgentSession {
|
|
|
3489
3780
|
createSlashCommandContext() {
|
|
3490
3781
|
return {
|
|
3491
3782
|
switchModel: (provider, model) => this.switchModel(provider, model),
|
|
3492
|
-
compact: () => this.compact(undefined, "manual"),
|
|
3783
|
+
compact: (focus) => this.compact(undefined, "manual", focus),
|
|
3493
3784
|
newSession: () => this.newSession(),
|
|
3494
3785
|
listSessions: async () => {
|
|
3495
3786
|
const sessions = await this.sessionManager.list(this.cwd);
|