@kenkaiiii/ggcoder 6.4.0 → 7.0.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 +9 -8
- package/dist/app-sidecar/app-settings.d.ts +1 -1
- package/dist/app-sidecar/app-settings.js +3 -4
- package/dist/app-sidecar/app-settings.js.map +1 -1
- package/dist/app-sidecar/attachments.js +1 -1
- package/dist/app-sidecar/attachments.js.map +1 -1
- package/dist/app-sidecar/auth-routes.js +2 -5
- package/dist/app-sidecar/auth-routes.js.map +1 -1
- package/dist/app-sidecar/autopilot-runner.d.ts +8 -8
- package/dist/app-sidecar/autopilot-runner.js +8 -8
- package/dist/app-sidecar/autopilot-runner.js.map +1 -1
- package/dist/app-sidecar/branch-routes.d.ts +8 -1
- package/dist/app-sidecar/branch-routes.js +154 -2
- package/dist/app-sidecar/branch-routes.js.map +1 -1
- package/dist/app-sidecar/detached-sessions.d.ts +2 -10
- package/dist/app-sidecar/detached-sessions.js.map +1 -1
- package/dist/app-sidecar/file-search.js +1 -1
- package/dist/app-sidecar/file-search.js.map +1 -1
- package/dist/app-sidecar/git-branches.d.ts +18 -1
- package/dist/app-sidecar/git-branches.js +24 -6
- package/dist/app-sidecar/git-branches.js.map +1 -1
- package/dist/app-sidecar/git-ship.d.ts +42 -0
- package/dist/app-sidecar/git-ship.js +349 -0
- package/dist/app-sidecar/git-ship.js.map +1 -0
- package/dist/app-sidecar/git-target.d.ts +2 -2
- package/dist/app-sidecar/git-target.js +2 -2
- package/dist/app-sidecar/git-target.js.map +1 -1
- package/dist/app-sidecar/goal-routes.d.ts +1 -1
- package/dist/app-sidecar/goal-routes.js +5 -6
- package/dist/app-sidecar/goal-routes.js.map +1 -1
- package/dist/app-sidecar/hf-pull-manager.d.ts +5 -4
- package/dist/app-sidecar/hf-pull-manager.js +1 -1
- package/dist/app-sidecar/hf-pull-manager.js.map +1 -1
- package/dist/app-sidecar/history-routes.js +6 -6
- package/dist/app-sidecar/history-routes.js.map +1 -1
- package/dist/app-sidecar/history.d.ts +2 -2
- package/dist/app-sidecar/integration-routes.js +4 -6
- package/dist/app-sidecar/integration-routes.js.map +1 -1
- package/dist/app-sidecar/keep-awake.d.ts +1 -1
- package/dist/app-sidecar/keep-awake.js +1 -1
- package/dist/app-sidecar/keep-awake.js.map +1 -1
- package/dist/app-sidecar/ken-context.d.ts +2 -2
- package/dist/app-sidecar/ken-context.js +1 -1
- package/dist/app-sidecar/ken-context.js.map +1 -1
- package/dist/app-sidecar/live-preview/dev-url.d.ts +1 -1
- package/dist/app-sidecar/live-preview/manager.d.ts +2 -14
- package/dist/app-sidecar/live-preview/manager.js.map +1 -1
- package/dist/app-sidecar/live-preview/routes.js +1 -1
- package/dist/app-sidecar/live-preview/routes.js.map +1 -1
- package/dist/app-sidecar/live-preview/servers.js +1 -1
- package/dist/app-sidecar/live-preview/servers.js.map +1 -1
- package/dist/app-sidecar/mcp-routes.js +2 -2
- package/dist/app-sidecar/mcp-routes.js.map +1 -1
- package/dist/app-sidecar/mcp-rows.d.ts +3 -15
- package/dist/app-sidecar/mcp-rows.js +7 -2
- package/dist/app-sidecar/mcp-rows.js.map +1 -1
- package/dist/app-sidecar/mcp-shell-command.d.ts +1 -1
- package/dist/app-sidecar/mcp-shell-command.js +3 -3
- package/dist/app-sidecar/mcp-shell-command.js.map +1 -1
- package/dist/app-sidecar/mcp-sync.d.ts +2 -2
- package/dist/app-sidecar/mcp-sync.js +3 -3
- package/dist/app-sidecar/mcp-sync.js.map +1 -1
- package/dist/app-sidecar/progress-manager.d.ts +1 -1
- package/dist/app-sidecar/progress-manager.js +6 -6
- package/dist/app-sidecar/progress-manager.js.map +1 -1
- package/dist/app-sidecar/prompt-routes.js +5 -5
- package/dist/app-sidecar/prompt-routes.js.map +1 -1
- package/dist/app-sidecar/repo-polls.d.ts +3 -3
- package/dist/app-sidecar/repo-polls.js +4 -4
- package/dist/app-sidecar/repo-polls.js.map +1 -1
- package/dist/app-sidecar/route-context.d.ts +17 -17
- package/dist/app-sidecar/run-control-routes.js +2 -5
- package/dist/app-sidecar/run-control-routes.js.map +1 -1
- package/dist/app-sidecar/session-file-routes.d.ts +1 -1
- package/dist/app-sidecar/session-file-routes.js +2 -2
- package/dist/app-sidecar/session-file-routes.js.map +1 -1
- package/dist/app-sidecar/session-routes.js +3 -4
- package/dist/app-sidecar/session-routes.js.map +1 -1
- package/dist/app-sidecar/session-types.d.ts +5 -13
- package/dist/app-sidecar/shell-routes.js +1 -1
- package/dist/app-sidecar/shell-routes.js.map +1 -1
- package/dist/app-sidecar/shell-runs.js +2 -2
- package/dist/app-sidecar/shell-runs.js.map +1 -1
- package/dist/app-sidecar/shell-suggestions.d.ts +2 -8
- package/dist/app-sidecar/shell-suggestions.js +1 -1
- package/dist/app-sidecar/shell-suggestions.js.map +1 -1
- package/dist/app-sidecar/task-routes.js +5 -5
- package/dist/app-sidecar/task-routes.js.map +1 -1
- package/dist/app-sidecar/trophy-manager.d.ts +2 -2
- package/dist/app-sidecar/trophy-manager.js +3 -3
- package/dist/app-sidecar/trophy-manager.js.map +1 -1
- package/dist/app-sidecar/usage.d.ts +1 -1
- package/dist/app-sidecar/usage.js +3 -2
- package/dist/app-sidecar/usage.js.map +1 -1
- package/dist/app-sidecar/workspace-routes.js +4 -4
- package/dist/app-sidecar/workspace-routes.js.map +1 -1
- package/dist/app-sidecar/worktrees.js +1 -1
- package/dist/app-sidecar/worktrees.js.map +1 -1
- package/dist/app-sidecar-sessions.d.ts +2 -5
- package/dist/app-sidecar-sessions.js +1 -1
- package/dist/app-sidecar-sessions.js.map +1 -1
- package/dist/app-sidecar.d.ts +1 -1
- package/dist/app-sidecar.js +47 -45
- package/dist/app-sidecar.js.map +1 -1
- package/dist/chat-agents/general.d.ts +1 -1
- package/dist/chat-agents/index.d.ts +1 -1
- package/dist/chat-agents/jiwa.d.ts +2 -9
- package/dist/chat-agents/jiwa.js +1 -0
- package/dist/chat-agents/jiwa.js.map +1 -1
- package/dist/chat-agents/memory.d.ts +2 -9
- package/dist/chat-agents/memory.js +1 -0
- package/dist/chat-agents/memory.js.map +1 -1
- package/dist/chat-agents/research.d.ts +1 -1
- package/dist/chat-agents/shared.d.ts +1 -1
- package/dist/chat-agents/shared.js +1 -1
- package/dist/chat-agents/shared.js.map +1 -1
- package/dist/chat-agents/therapist.d.ts +1 -1
- package/dist/chat-agents/types.d.ts +2 -1
- package/dist/chat-agents/types.js +6 -1
- package/dist/chat-agents/types.js.map +1 -1
- package/dist/cli/auth.js +3 -6
- package/dist/cli/auth.js.map +1 -1
- package/dist/cli/mcp.js +4 -3
- package/dist/cli/mcp.js.map +1 -1
- package/dist/cli.d.ts +1 -0
- package/dist/cli.js +26 -27
- package/dist/cli.js.map +1 -1
- package/dist/goals-agent/goal-team.d.ts +1 -1
- package/dist/goals-agent/goals-agent.d.ts +3 -3
- package/dist/goals-agent/goals-agent.js +5 -5
- package/dist/goals-agent/goals-agent.js.map +1 -1
- package/dist/hf-pull.d.ts +2 -1
- package/dist/hf-pull.js +0 -1
- package/dist/hf-pull.js.map +1 -1
- package/dist/index.d.ts +0 -8
- package/dist/index.js +1 -14
- package/dist/index.js.map +1 -1
- package/dist/modes/acp-autopilot.js +3 -3
- package/dist/modes/acp-autopilot.js.map +1 -1
- package/dist/modes/acp-goals.d.ts +2 -2
- package/dist/modes/acp-goals.js +3 -3
- package/dist/modes/acp-goals.js.map +1 -1
- package/dist/modes/acp-mode.d.ts +6 -6
- package/dist/modes/acp-mode.js +22 -23
- package/dist/modes/acp-mode.js.map +1 -1
- package/dist/modes/agent-home-mode.js +7 -8
- package/dist/modes/agent-home-mode.js.map +1 -1
- package/dist/modes/json-mode.js +4 -4
- package/dist/modes/json-mode.js.map +1 -1
- package/dist/modes/print-mode.js +4 -3
- package/dist/modes/print-mode.js.map +1 -1
- package/dist/modes/rpc-mode.js +2 -2
- package/dist/modes/rpc-mode.js.map +1 -1
- package/dist/modes/serve-mode.js +10 -11
- package/dist/modes/serve-mode.js.map +1 -1
- package/dist/modes/subagent-worker-mode.d.ts +1 -1
- package/dist/modes/subagent-worker-mode.js +8 -8
- package/dist/modes/subagent-worker-mode.js.map +1 -1
- package/dist/motion-agent/motion-agent.d.ts +3 -2
- package/dist/motion-agent/motion-agent.js +3 -2
- package/dist/motion-agent/motion-agent.js.map +1 -1
- package/dist/motion-agent/motion-bundle.d.ts +18 -0
- package/dist/motion-agent/motion-bundle.js +34 -0
- package/dist/motion-agent/motion-bundle.js.map +1 -0
- package/dist/subagent-entry-path.d.ts +1 -0
- package/dist/subagent-entry-path.js +13 -0
- package/dist/subagent-entry-path.js.map +1 -0
- package/dist/subagent-entry.d.ts +1 -1
- package/dist/subagent-entry.js +2 -1
- package/dist/subagent-entry.js.map +1 -1
- package/dist/ui/App.d.ts +8 -8
- package/dist/ui/App.js +20 -21
- package/dist/ui/App.js.map +1 -1
- package/dist/ui/app-items.d.ts +1 -1
- package/dist/ui/components/BackgroundTasksBar.d.ts +1 -1
- package/dist/ui/components/Banner.js +1 -1
- package/dist/ui/components/Banner.js.map +1 -1
- package/dist/ui/components/ChatFooterPane.d.ts +1 -1
- package/dist/ui/components/ChatScreen.d.ts +4 -4
- package/dist/ui/components/Footer.d.ts +1 -1
- package/dist/ui/components/Footer.js +1 -1
- package/dist/ui/components/Footer.js.map +1 -1
- package/dist/ui/components/FooterStatusRow.d.ts +1 -1
- package/dist/ui/components/InputArea.d.ts +2 -2
- package/dist/ui/components/InputArea.js +2 -2
- package/dist/ui/components/InputArea.js.map +1 -1
- package/dist/ui/components/ModelSelector.js +1 -1
- package/dist/ui/components/ModelSelector.js.map +1 -1
- package/dist/ui/components/RewindOverlay.d.ts +1 -1
- package/dist/ui/components/RewindOverlay.js.map +1 -1
- package/dist/ui/components/SessionSelector.d.ts +1 -1
- package/dist/ui/components/SettingsSelector.d.ts +1 -1
- package/dist/ui/components/SkillsOverlay.js +2 -2
- package/dist/ui/components/SkillsOverlay.js.map +1 -1
- package/dist/ui/components/StreamingArea.js +1 -1
- package/dist/ui/components/StreamingArea.js.map +1 -1
- package/dist/ui/components/TaskPickerMenu.d.ts +1 -1
- package/dist/ui/components/ToolExecution.js +1 -1
- package/dist/ui/components/ToolExecution.js.map +1 -1
- package/dist/ui/error-item.js +2 -2
- package/dist/ui/error-item.js.map +1 -1
- package/dist/ui/hooks/useAgentLoop.d.ts +2 -2
- package/dist/ui/hooks/useAgentLoop.js +8 -8
- package/dist/ui/hooks/useAgentLoop.js.map +1 -1
- package/dist/ui/hooks/useChatLayoutMeasurements.d.ts +1 -1
- package/dist/ui/hooks/useContextCompaction.d.ts +3 -3
- package/dist/ui/hooks/useContextCompaction.js +6 -7
- package/dist/ui/hooks/useContextCompaction.js.map +1 -1
- package/dist/ui/hooks/useModeState.d.ts +2 -2
- package/dist/ui/hooks/useModeState.js +2 -2
- package/dist/ui/hooks/useModeState.js.map +1 -1
- package/dist/ui/hooks/useSessionPersistence.d.ts +1 -1
- package/dist/ui/hooks/useSessionPersistence.js +3 -3
- package/dist/ui/hooks/useSessionPersistence.js.map +1 -1
- package/dist/ui/hooks/useTaskPickerController.d.ts +1 -1
- package/dist/ui/hooks/useTaskPickerController.js +1 -1
- package/dist/ui/hooks/useTaskPickerController.js.map +1 -1
- package/dist/ui/hooks/useTranscriptHistory.d.ts +1 -1
- package/dist/ui/item-helpers.js +1 -1
- package/dist/ui/item-helpers.js.map +1 -1
- package/dist/ui/language-pack-update.d.ts +1 -1
- package/dist/ui/language-pack-update.js +1 -1
- package/dist/ui/language-pack-update.js.map +1 -1
- package/dist/ui/login.js +1 -1
- package/dist/ui/login.js.map +1 -1
- package/dist/ui/mcp.d.ts +1 -1
- package/dist/ui/prompt-routing.d.ts +3 -3
- package/dist/ui/prompt-routing.js +3 -3
- package/dist/ui/prompt-routing.js.map +1 -1
- package/dist/ui/render.d.ts +8 -8
- package/dist/ui/sessions.js +1 -1
- package/dist/ui/sessions.js.map +1 -1
- package/dist/ui/stores/taskbar-store.d.ts +1 -1
- package/dist/ui/stores/taskbar-store.js.map +1 -1
- package/dist/ui/submit-prompt-command.d.ts +2 -2
- package/dist/ui/submit-prompt-command.js +2 -3
- package/dist/ui/submit-prompt-command.js.map +1 -1
- package/dist/ui/terminal-history-status-renderers.d.ts +1 -1
- package/dist/ui/terminal-history.js +2 -3
- package/dist/ui/terminal-history.js.map +1 -1
- package/dist/ui/theme/theme.d.ts +2 -1
- package/dist/ui/theme/theme.js.map +1 -1
- package/dist/ui/thinking-level.d.ts +1 -1
- package/dist/ui/thinking-level.js +1 -1
- package/dist/ui/thinking-level.js.map +1 -1
- package/dist/ui/tool-line-summary.js +1 -1
- package/dist/ui/tool-line-summary.js.map +1 -1
- package/dist/ui/transcript/presentation.js +1 -1
- package/dist/ui/transcript/presentation.js.map +1 -1
- package/dist/ui/utils/text-utils.js +1 -1
- package/dist/ui/utils/text-utils.js.map +1 -1
- package/dist/utils/git-overview.d.ts +2 -23
- package/dist/utils/git-overview.js +8 -1
- package/dist/utils/git-overview.js.map +1 -1
- package/package.json +13 -103
- package/assets/skills/bulletproof/SKILL.md +0 -132
- package/assets/skills/bulletproof/references/agent-surface.md +0 -113
- package/assets/skills/bulletproof/references/attack-classes.md +0 -226
- package/assets/skills/bulletproof/references/audit-protocol.md +0 -232
- package/assets/skills/bulletproof/references/platform-playbooks.md +0 -196
- package/assets/skills/bulletproof/references/provenance.md +0 -146
- package/assets/skills/bulletproof/references/secure-defaults.md +0 -137
- package/assets/skills/bulletproof/references/supply-chain.md +0 -84
- package/assets/skills/bulletproof/references/threat-landscape.md +0 -66
- package/assets/skills/bulletproof/references/verification.md +0 -74
- package/assets/skills/compliance-guard/SKILL.md +0 -115
- package/assets/skills/compliance-guard/references/artifacts.md +0 -199
- package/assets/skills/compliance-guard/references/eu-uk.md +0 -162
- package/assets/skills/compliance-guard/references/exposure-triage.md +0 -177
- package/assets/skills/compliance-guard/references/full-review.md +0 -155
- package/assets/skills/compliance-guard/references/lawsuit-vectors.md +0 -153
- package/assets/skills/compliance-guard/references/provenance.md +0 -135
- package/assets/skills/compliance-guard/references/sector-gates.md +0 -187
- package/assets/skills/compliance-guard/references/security-baseline.md +0 -117
- package/assets/skills/compliance-guard/references/trigger-map.md +0 -177
- package/assets/skills/compliance-guard/references/us.md +0 -194
- package/assets/skills/durable/SKILL.md +0 -114
- package/assets/skills/durable/references/agent-db-safety.md +0 -76
- package/assets/skills/durable/references/backups-and-runtime.md +0 -93
- package/assets/skills/durable/references/migrations-and-schema.md +0 -87
- package/assets/skills/gg-guide/SKILL.md +0 -43
- package/assets/skills/gg-guide/references/chat-motion-goals.md +0 -217
- package/assets/skills/gg-guide/references/checklist-and-safety.md +0 -177
- package/assets/skills/gg-guide/references/code-mode.md +0 -268
- package/assets/skills/gg-guide/references/getting-started.md +0 -290
- package/assets/skills/gg-guide/references/ken-and-autopilot.md +0 -172
- package/assets/skills/gg-guide/references/mcp-and-skills.md +0 -204
- package/assets/skills/gg-guide/references/models-and-sign-in.md +0 -200
- package/assets/skills/gg-guide/references/sessions-and-history.md +0 -213
- package/assets/skills/gg-guide/references/settings.md +0 -193
- package/assets/skills/gg-guide/references/troubleshooting-and-data.md +0 -186
- package/assets/skills/lean/SKILL.md +0 -117
- package/assets/skills/lean/references/memory-and-processes.md +0 -99
- package/assets/skills/lean/references/playbooks.md +0 -134
- package/dist/app-error.d.ts +0 -22
- package/dist/app-error.js +0 -41
- package/dist/app-error.js.map +0 -1
- package/dist/config.d.ts +0 -90
- package/dist/config.js +0 -240
- package/dist/config.js.map +0 -1
- package/dist/core/acceptance-checks.d.ts +0 -48
- package/dist/core/acceptance-checks.js +0 -151
- package/dist/core/acceptance-checks.js.map +0 -1
- package/dist/core/action-threats.d.ts +0 -68
- package/dist/core/action-threats.js +0 -894
- package/dist/core/action-threats.js.map +0 -1
- package/dist/core/agent-notifications.d.ts +0 -79
- package/dist/core/agent-notifications.js +0 -125
- package/dist/core/agent-notifications.js.map +0 -1
- package/dist/core/agent-session/helpers.d.ts +0 -26
- package/dist/core/agent-session/helpers.js +0 -47
- package/dist/core/agent-session/helpers.js.map +0 -1
- package/dist/core/agent-session/mcp-tools.d.ts +0 -87
- package/dist/core/agent-session/mcp-tools.js +0 -227
- package/dist/core/agent-session/mcp-tools.js.map +0 -1
- package/dist/core/agent-session/run-loop-monitor.d.ts +0 -63
- package/dist/core/agent-session/run-loop-monitor.js +0 -164
- package/dist/core/agent-session/run-loop-monitor.js.map +0 -1
- package/dist/core/agent-session/transcript-markers.d.ts +0 -57
- package/dist/core/agent-session/transcript-markers.js +0 -166
- package/dist/core/agent-session/transcript-markers.js.map +0 -1
- package/dist/core/agent-session/verification-tracker.d.ts +0 -71
- package/dist/core/agent-session/verification-tracker.js +0 -295
- package/dist/core/agent-session/verification-tracker.js.map +0 -1
- package/dist/core/agent-session.d.ts +0 -1398
- package/dist/core/agent-session.js +0 -5123
- package/dist/core/agent-session.js.map +0 -1
- package/dist/core/agents.d.ts +0 -63
- package/dist/core/agents.js +0 -160
- package/dist/core/agents.js.map +0 -1
- package/dist/core/ask-user.d.ts +0 -163
- package/dist/core/ask-user.js +0 -178
- package/dist/core/ask-user.js.map +0 -1
- package/dist/core/auth/index.d.ts +0 -11
- package/dist/core/auth/index.js +0 -11
- package/dist/core/auth/index.js.map +0 -1
- package/dist/core/auth-providers.d.ts +0 -2
- package/dist/core/auth-providers.js +0 -5
- package/dist/core/auth-providers.js.map +0 -1
- package/dist/core/auth-storage.d.ts +0 -1
- package/dist/core/auth-storage.js +0 -4
- package/dist/core/auth-storage.js.map +0 -1
- package/dist/core/auto-update.d.ts +0 -6
- package/dist/core/auto-update.js +0 -15
- package/dist/core/auto-update.js.map +0 -1
- package/dist/core/autopilot-cycle.d.ts +0 -127
- package/dist/core/autopilot-cycle.js +0 -182
- package/dist/core/autopilot-cycle.js.map +0 -1
- package/dist/core/autopilot-gate.d.ts +0 -106
- package/dist/core/autopilot-gate.js +0 -192
- package/dist/core/autopilot-gate.js.map +0 -1
- package/dist/core/autopilot-verdict.d.ts +0 -55
- package/dist/core/autopilot-verdict.js +0 -226
- package/dist/core/autopilot-verdict.js.map +0 -1
- package/dist/core/blocked-packages-file.d.ts +0 -33
- package/dist/core/blocked-packages-file.js +0 -274
- package/dist/core/blocked-packages-file.js.map +0 -1
- package/dist/core/bundled-agents.d.ts +0 -2
- package/dist/core/bundled-agents.js +0 -253
- package/dist/core/bundled-agents.js.map +0 -1
- package/dist/core/cache-diagnostics.d.ts +0 -72
- package/dist/core/cache-diagnostics.js +0 -200
- package/dist/core/cache-diagnostics.js.map +0 -1
- package/dist/core/cache-expiry.d.ts +0 -89
- package/dist/core/cache-expiry.js +0 -117
- package/dist/core/cache-expiry.js.map +0 -1
- package/dist/core/checklist-detection.d.ts +0 -11
- package/dist/core/checklist-detection.js +0 -238
- package/dist/core/checklist-detection.js.map +0 -1
- package/dist/core/checklist-git.d.ts +0 -19
- package/dist/core/checklist-git.js +0 -54
- package/dist/core/checklist-git.js.map +0 -1
- package/dist/core/checklist-items.d.ts +0 -181
- package/dist/core/checklist-items.js +0 -230
- package/dist/core/checklist-items.js.map +0 -1
- package/dist/core/checklist-prompt.d.ts +0 -14
- package/dist/core/checklist-prompt.js +0 -64
- package/dist/core/checklist-prompt.js.map +0 -1
- package/dist/core/checklist-snapshot.d.ts +0 -17
- package/dist/core/checklist-snapshot.js +0 -46
- package/dist/core/checklist-snapshot.js.map +0 -1
- package/dist/core/checklist-store.d.ts +0 -63
- package/dist/core/checklist-store.js +0 -273
- package/dist/core/checklist-store.js.map +0 -1
- package/dist/core/checkout-record.d.ts +0 -22
- package/dist/core/checkout-record.js +0 -68
- package/dist/core/checkout-record.js.map +0 -1
- package/dist/core/checkpoint-store.d.ts +0 -109
- package/dist/core/checkpoint-store.js +0 -260
- package/dist/core/checkpoint-store.js.map +0 -1
- package/dist/core/claude-code/complete.d.ts +0 -35
- package/dist/core/claude-code/complete.js +0 -125
- package/dist/core/claude-code/complete.js.map +0 -1
- package/dist/core/claude-code/events.d.ts +0 -67
- package/dist/core/claude-code/events.js +0 -460
- package/dist/core/claude-code/events.js.map +0 -1
- package/dist/core/claude-code/live-session.d.ts +0 -94
- package/dist/core/claude-code/live-session.js +0 -525
- package/dist/core/claude-code/live-session.js.map +0 -1
- package/dist/core/claude-code/loop.d.ts +0 -9
- package/dist/core/claude-code/loop.js +0 -15
- package/dist/core/claude-code/loop.js.map +0 -1
- package/dist/core/claude-code/session-sync.d.ts +0 -28
- package/dist/core/claude-code/session-sync.js +0 -53
- package/dist/core/claude-code/session-sync.js.map +0 -1
- package/dist/core/claude-code/tool-bridge.d.ts +0 -49
- package/dist/core/claude-code/tool-bridge.js +0 -352
- package/dist/core/claude-code/tool-bridge.js.map +0 -1
- package/dist/core/claude-code/transcripts.d.ts +0 -39
- package/dist/core/claude-code/transcripts.js +0 -195
- package/dist/core/claude-code/transcripts.js.map +0 -1
- package/dist/core/code-retrieval-chunkers.d.ts +0 -26
- package/dist/core/code-retrieval-chunkers.js +0 -264
- package/dist/core/code-retrieval-chunkers.js.map +0 -1
- package/dist/core/code-retrieval.d.ts +0 -18
- package/dist/core/code-retrieval.js +0 -124
- package/dist/core/code-retrieval.js.map +0 -1
- package/dist/core/codex-request-shape.d.ts +0 -7
- package/dist/core/codex-request-shape.js +0 -19
- package/dist/core/codex-request-shape.js.map +0 -1
- package/dist/core/compaction/active-context.d.ts +0 -16
- package/dist/core/compaction/active-context.js +0 -20
- package/dist/core/compaction/active-context.js.map +0 -1
- package/dist/core/compaction/compactor.d.ts +0 -281
- package/dist/core/compaction/compactor.js +0 -1452
- package/dist/core/compaction/compactor.js.map +0 -1
- package/dist/core/compaction/plan-step-policy.d.ts +0 -46
- package/dist/core/compaction/plan-step-policy.js +0 -57
- package/dist/core/compaction/plan-step-policy.js.map +0 -1
- package/dist/core/compaction/policy.d.ts +0 -36
- package/dist/core/compaction/policy.js +0 -144
- package/dist/core/compaction/policy.js.map +0 -1
- package/dist/core/compaction/query-aware-selector.d.ts +0 -32
- package/dist/core/compaction/query-aware-selector.js +0 -202
- package/dist/core/compaction/query-aware-selector.js.map +0 -1
- package/dist/core/compaction/token-estimator.d.ts +0 -36
- package/dist/core/compaction/token-estimator.js +0 -180
- package/dist/core/compaction/token-estimator.js.map +0 -1
- package/dist/core/compaction/tool-result-pruner.d.ts +0 -90
- package/dist/core/compaction/tool-result-pruner.js +0 -238
- package/dist/core/compaction/tool-result-pruner.js.map +0 -1
- package/dist/core/completion-review.d.ts +0 -24
- package/dist/core/completion-review.js +0 -2
- package/dist/core/completion-review.js.map +0 -1
- package/dist/core/context-files.d.ts +0 -8
- package/dist/core/context-files.js +0 -46
- package/dist/core/context-files.js.map +0 -1
- package/dist/core/context-limits.d.ts +0 -40
- package/dist/core/context-limits.js +0 -43
- package/dist/core/context-limits.js.map +0 -1
- package/dist/core/custom-commands.d.ts +0 -18
- package/dist/core/custom-commands.js +0 -57
- package/dist/core/custom-commands.js.map +0 -1
- package/dist/core/destructive-git-guard.d.ts +0 -113
- package/dist/core/destructive-git-guard.js +0 -874
- package/dist/core/destructive-git-guard.js.map +0 -1
- package/dist/core/encode-cwd.d.ts +0 -41
- package/dist/core/encode-cwd.js +0 -53
- package/dist/core/encode-cwd.js.map +0 -1
- package/dist/core/env-delta.d.ts +0 -34
- package/dist/core/env-delta.js +0 -84
- package/dist/core/env-delta.js.map +0 -1
- package/dist/core/event-bus.d.ts +0 -178
- package/dist/core/event-bus.js +0 -171
- package/dist/core/event-bus.js.map +0 -1
- package/dist/core/extensions/loader.d.ts +0 -7
- package/dist/core/extensions/loader.js +0 -68
- package/dist/core/extensions/loader.js.map +0 -1
- package/dist/core/extensions/plugin-bundles.d.ts +0 -13
- package/dist/core/extensions/plugin-bundles.js +0 -45
- package/dist/core/extensions/plugin-bundles.js.map +0 -1
- package/dist/core/extensions/types.d.ts +0 -18
- package/dist/core/extensions/types.js +0 -2
- package/dist/core/extensions/types.js.map +0 -1
- package/dist/core/foreign-session-import.d.ts +0 -119
- package/dist/core/foreign-session-import.js +0 -598
- package/dist/core/foreign-session-import.js.map +0 -1
- package/dist/core/foreign-transcript-blocks.d.ts +0 -50
- package/dist/core/foreign-transcript-blocks.js +0 -151
- package/dist/core/foreign-transcript-blocks.js.map +0 -1
- package/dist/core/frontmatter.d.ts +0 -22
- package/dist/core/frontmatter.js +0 -90
- package/dist/core/frontmatter.js.map +0 -1
- package/dist/core/goal-run-marker.d.ts +0 -32
- package/dist/core/goal-run-marker.js +0 -178
- package/dist/core/goal-run-marker.js.map +0 -1
- package/dist/core/goal-summary.d.ts +0 -32
- package/dist/core/goal-summary.js +0 -110
- package/dist/core/goal-summary.js.map +0 -1
- package/dist/core/goals-store.d.ts +0 -215
- package/dist/core/goals-store.js +0 -577
- package/dist/core/goals-store.js.map +0 -1
- package/dist/core/hashline.d.ts +0 -51
- package/dist/core/hashline.js +0 -76
- package/dist/core/hashline.js.map +0 -1
- package/dist/core/idle-wake.d.ts +0 -62
- package/dist/core/idle-wake.js +0 -103
- package/dist/core/idle-wake.js.map +0 -1
- package/dist/core/index.d.ts +0 -14
- package/dist/core/index.js +0 -14
- package/dist/core/index.js.map +0 -1
- package/dist/core/injection-detect.d.ts +0 -39
- package/dist/core/injection-detect.js +0 -241
- package/dist/core/injection-detect.js.map +0 -1
- package/dist/core/installed-threats.d.ts +0 -23
- package/dist/core/installed-threats.js +0 -71
- package/dist/core/installed-threats.js.map +0 -1
- package/dist/core/internal-diagnostics.d.ts +0 -159
- package/dist/core/internal-diagnostics.js +0 -495
- package/dist/core/internal-diagnostics.js.map +0 -1
- package/dist/core/keep-awake.d.ts +0 -88
- package/dist/core/keep-awake.js +0 -251
- package/dist/core/keep-awake.js.map +0 -1
- package/dist/core/ken-ask-answer.d.ts +0 -24
- package/dist/core/ken-ask-answer.js +0 -96
- package/dist/core/ken-ask-answer.js.map +0 -1
- package/dist/core/ken-context.d.ts +0 -119
- package/dist/core/ken-context.js +0 -447
- package/dist/core/ken-context.js.map +0 -1
- package/dist/core/ken-model.d.ts +0 -45
- package/dist/core/ken-model.js +0 -26
- package/dist/core/ken-model.js.map +0 -1
- package/dist/core/ken-prompt.d.ts +0 -21
- package/dist/core/ken-prompt.js +0 -370
- package/dist/core/ken-prompt.js.map +0 -1
- package/dist/core/language-detector.d.ts +0 -41
- package/dist/core/language-detector.js +0 -293
- package/dist/core/language-detector.js.map +0 -1
- package/dist/core/live-preview.d.ts +0 -26
- package/dist/core/live-preview.js +0 -80
- package/dist/core/live-preview.js.map +0 -1
- package/dist/core/local-endpoint-store.d.ts +0 -53
- package/dist/core/local-endpoint-store.js +0 -221
- package/dist/core/local-endpoint-store.js.map +0 -1
- package/dist/core/logger.d.ts +0 -22
- package/dist/core/logger.js +0 -95
- package/dist/core/logger.js.map +0 -1
- package/dist/core/loop-breaker.d.ts +0 -89
- package/dist/core/loop-breaker.js +0 -204
- package/dist/core/loop-breaker.js.map +0 -1
- package/dist/core/lsp/client.d.ts +0 -206
- package/dist/core/lsp/client.js +0 -685
- package/dist/core/lsp/client.js.map +0 -1
- package/dist/core/lsp/edit-telemetry.d.ts +0 -26
- package/dist/core/lsp/edit-telemetry.js +0 -52
- package/dist/core/lsp/edit-telemetry.js.map +0 -1
- package/dist/core/lsp/format.d.ts +0 -11
- package/dist/core/lsp/format.js +0 -30
- package/dist/core/lsp/format.js.map +0 -1
- package/dist/core/lsp/jsonrpc.d.ts +0 -68
- package/dist/core/lsp/jsonrpc.js +0 -153
- package/dist/core/lsp/jsonrpc.js.map +0 -1
- package/dist/core/lsp/manager.d.ts +0 -188
- package/dist/core/lsp/manager.js +0 -576
- package/dist/core/lsp/manager.js.map +0 -1
- package/dist/core/lsp/pool.d.ts +0 -114
- package/dist/core/lsp/pool.js +0 -259
- package/dist/core/lsp/pool.js.map +0 -1
- package/dist/core/lsp/project-root.d.ts +0 -9
- package/dist/core/lsp/project-root.js +0 -75
- package/dist/core/lsp/project-root.js.map +0 -1
- package/dist/core/lsp/reference-project.d.ts +0 -6
- package/dist/core/lsp/reference-project.js +0 -110
- package/dist/core/lsp/reference-project.js.map +0 -1
- package/dist/core/lsp/servers.d.ts +0 -44
- package/dist/core/lsp/servers.js +0 -289
- package/dist/core/lsp/servers.js.map +0 -1
- package/dist/core/lsp/test-support.d.ts +0 -17
- package/dist/core/lsp/test-support.js +0 -27
- package/dist/core/lsp/test-support.js.map +0 -1
- package/dist/core/mcp/catalog-cache.d.ts +0 -64
- package/dist/core/mcp/catalog-cache.js +0 -167
- package/dist/core/mcp/catalog-cache.js.map +0 -1
- package/dist/core/mcp/client.d.ts +0 -317
- package/dist/core/mcp/client.js +0 -1168
- package/dist/core/mcp/client.js.map +0 -1
- package/dist/core/mcp/content.d.ts +0 -23
- package/dist/core/mcp/content.js +0 -194
- package/dist/core/mcp/content.js.map +0 -1
- package/dist/core/mcp/defaults.d.ts +0 -26
- package/dist/core/mcp/defaults.js +0 -81
- package/dist/core/mcp/defaults.js.map +0 -1
- package/dist/core/mcp/deferred-catalog.d.ts +0 -53
- package/dist/core/mcp/deferred-catalog.js +0 -117
- package/dist/core/mcp/deferred-catalog.js.map +0 -1
- package/dist/core/mcp/elicitation-bridge.d.ts +0 -40
- package/dist/core/mcp/elicitation-bridge.js +0 -36
- package/dist/core/mcp/elicitation-bridge.js.map +0 -1
- package/dist/core/mcp/index.d.ts +0 -16
- package/dist/core/mcp/index.js +0 -10
- package/dist/core/mcp/index.js.map +0 -1
- package/dist/core/mcp/loopback.d.ts +0 -26
- package/dist/core/mcp/loopback.js +0 -66
- package/dist/core/mcp/loopback.js.map +0 -1
- package/dist/core/mcp/oauth-provider.d.ts +0 -55
- package/dist/core/mcp/oauth-provider.js +0 -106
- package/dist/core/mcp/oauth-provider.js.map +0 -1
- package/dist/core/mcp/oauth-store.d.ts +0 -44
- package/dist/core/mcp/oauth-store.js +0 -77
- package/dist/core/mcp/oauth-store.js.map +0 -1
- package/dist/core/mcp/parse-add-command.d.ts +0 -50
- package/dist/core/mcp/parse-add-command.js +0 -391
- package/dist/core/mcp/parse-add-command.js.map +0 -1
- package/dist/core/mcp/resolve-stdio.d.ts +0 -77
- package/dist/core/mcp/resolve-stdio.js +0 -359
- package/dist/core/mcp/resolve-stdio.js.map +0 -1
- package/dist/core/mcp/shared-pool.d.ts +0 -157
- package/dist/core/mcp/shared-pool.js +0 -236
- package/dist/core/mcp/shared-pool.js.map +0 -1
- package/dist/core/mcp/store.d.ts +0 -100
- package/dist/core/mcp/store.js +0 -202
- package/dist/core/mcp/store.js.map +0 -1
- package/dist/core/mcp/tool-guard.d.ts +0 -58
- package/dist/core/mcp/tool-guard.js +0 -215
- package/dist/core/mcp/tool-guard.js.map +0 -1
- package/dist/core/mcp/types.d.ts +0 -57
- package/dist/core/mcp/types.js +0 -2
- package/dist/core/mcp/types.js.map +0 -1
- package/dist/core/message-images.d.ts +0 -11
- package/dist/core/message-images.js +0 -52
- package/dist/core/message-images.js.map +0 -1
- package/dist/core/model-registry.d.ts +0 -1
- package/dist/core/model-registry.js +0 -5
- package/dist/core/model-registry.js.map +0 -1
- package/dist/core/model-unavailable.d.ts +0 -14
- package/dist/core/model-unavailable.js +0 -23
- package/dist/core/model-unavailable.js.map +0 -1
- package/dist/core/network-guard.d.ts +0 -28
- package/dist/core/network-guard.js +0 -251
- package/dist/core/network-guard.js.map +0 -1
- package/dist/core/node-debugger.d.ts +0 -148
- package/dist/core/node-debugger.js +0 -642
- package/dist/core/node-debugger.js.map +0 -1
- package/dist/core/oauth/openai.d.ts +0 -1
- package/dist/core/oauth/openai.js +0 -3
- package/dist/core/oauth/openai.js.map +0 -1
- package/dist/core/oauth/types.d.ts +0 -1
- package/dist/core/oauth/types.js +0 -2
- package/dist/core/oauth/types.js.map +0 -1
- package/dist/core/opencode-catalog-store.d.ts +0 -20
- package/dist/core/opencode-catalog-store.js +0 -82
- package/dist/core/opencode-catalog-store.js.map +0 -1
- package/dist/core/openrouter-catalog-store.d.ts +0 -24
- package/dist/core/openrouter-catalog-store.js +0 -140
- package/dist/core/openrouter-catalog-store.js.map +0 -1
- package/dist/core/package-cooldown.d.ts +0 -69
- package/dist/core/package-cooldown.js +0 -297
- package/dist/core/package-cooldown.js.map +0 -1
- package/dist/core/package-threats.d.ts +0 -92
- package/dist/core/package-threats.js +0 -1340
- package/dist/core/package-threats.js.map +0 -1
- package/dist/core/parked-requests.d.ts +0 -43
- package/dist/core/parked-requests.js +0 -34
- package/dist/core/parked-requests.js.map +0 -1
- package/dist/core/persistent-shell.d.ts +0 -81
- package/dist/core/persistent-shell.js +0 -452
- package/dist/core/persistent-shell.js.map +0 -1
- package/dist/core/plan-delta.d.ts +0 -23
- package/dist/core/plan-delta.js +0 -36
- package/dist/core/plan-delta.js.map +0 -1
- package/dist/core/plan-handoff.d.ts +0 -38
- package/dist/core/plan-handoff.js +0 -21
- package/dist/core/plan-handoff.js.map +0 -1
- package/dist/core/plan-submission-gate.d.ts +0 -28
- package/dist/core/plan-submission-gate.js +0 -27
- package/dist/core/plan-submission-gate.js.map +0 -1
- package/dist/core/platform-clis.d.ts +0 -15
- package/dist/core/platform-clis.js +0 -299
- package/dist/core/platform-clis.js.map +0 -1
- package/dist/core/process-gate.d.ts +0 -61
- package/dist/core/process-gate.js +0 -103
- package/dist/core/process-gate.js.map +0 -1
- package/dist/core/process-manager.d.ts +0 -242
- package/dist/core/process-manager.js +0 -902
- package/dist/core/process-manager.js.map +0 -1
- package/dist/core/progress/engine.d.ts +0 -22
- package/dist/core/progress/engine.js +0 -131
- package/dist/core/progress/engine.js.map +0 -1
- package/dist/core/progress/git-xp.d.ts +0 -15
- package/dist/core/progress/git-xp.js +0 -100
- package/dist/core/progress/git-xp.js.map +0 -1
- package/dist/core/progress/ranks.d.ts +0 -31
- package/dist/core/progress/ranks.js +0 -310
- package/dist/core/progress/ranks.js.map +0 -1
- package/dist/core/progress/rebuild.d.ts +0 -8
- package/dist/core/progress/rebuild.js +0 -125
- package/dist/core/progress/rebuild.js.map +0 -1
- package/dist/core/progress/store.d.ts +0 -34
- package/dist/core/progress/store.js +0 -200
- package/dist/core/progress/store.js.map +0 -1
- package/dist/core/progress/types.d.ts +0 -108
- package/dist/core/progress/types.js +0 -3
- package/dist/core/progress/types.js.map +0 -1
- package/dist/core/project-discovery.d.ts +0 -88
- package/dist/core/project-discovery.js +0 -907
- package/dist/core/project-discovery.js.map +0 -1
- package/dist/core/project-files.d.ts +0 -15
- package/dist/core/project-files.js +0 -37
- package/dist/core/project-files.js.map +0 -1
- package/dist/core/project-health-scan.d.ts +0 -109
- package/dist/core/project-health-scan.js +0 -673
- package/dist/core/project-health-scan.js.map +0 -1
- package/dist/core/project-health-score.d.ts +0 -41
- package/dist/core/project-health-score.js +0 -257
- package/dist/core/project-health-score.js.map +0 -1
- package/dist/core/prompt-command-expansion.d.ts +0 -13
- package/dist/core/prompt-command-expansion.js +0 -48
- package/dist/core/prompt-command-expansion.js.map +0 -1
- package/dist/core/prompt-commands.d.ts +0 -13
- package/dist/core/prompt-commands.js +0 -370
- package/dist/core/prompt-commands.js.map +0 -1
- package/dist/core/radio-players.d.ts +0 -28
- package/dist/core/radio-players.js +0 -133
- package/dist/core/radio-players.js.map +0 -1
- package/dist/core/radio.d.ts +0 -50
- package/dist/core/radio.js +0 -480
- package/dist/core/radio.js.map +0 -1
- package/dist/core/regrounding.d.ts +0 -37
- package/dist/core/regrounding.js +0 -89
- package/dist/core/regrounding.js.map +0 -1
- package/dist/core/resolve-start.d.ts +0 -28
- package/dist/core/resolve-start.js +0 -35
- package/dist/core/resolve-start.js.map +0 -1
- package/dist/core/run-claim.d.ts +0 -36
- package/dist/core/run-claim.js +0 -46
- package/dist/core/run-claim.js.map +0 -1
- package/dist/core/run-lifecycle.d.ts +0 -58
- package/dist/core/run-lifecycle.js +0 -104
- package/dist/core/run-lifecycle.js.map +0 -1
- package/dist/core/run-status.d.ts +0 -17
- package/dist/core/run-status.js +0 -28
- package/dist/core/run-status.js.map +0 -1
- package/dist/core/runtime-mode.d.ts +0 -21
- package/dist/core/runtime-mode.js +0 -43
- package/dist/core/runtime-mode.js.map +0 -1
- package/dist/core/sandbox-domains.d.ts +0 -13
- package/dist/core/sandbox-domains.js +0 -76
- package/dist/core/sandbox-domains.js.map +0 -1
- package/dist/core/sandbox-feedback.d.ts +0 -21
- package/dist/core/sandbox-feedback.js +0 -69
- package/dist/core/sandbox-feedback.js.map +0 -1
- package/dist/core/sandbox.d.ts +0 -106
- package/dist/core/sandbox.js +0 -383
- package/dist/core/sandbox.js.map +0 -1
- package/dist/core/semantic-loop-check.d.ts +0 -58
- package/dist/core/semantic-loop-check.js +0 -103
- package/dist/core/semantic-loop-check.js.map +0 -1
- package/dist/core/session-compaction.d.ts +0 -23
- package/dist/core/session-compaction.js +0 -54
- package/dist/core/session-compaction.js.map +0 -1
- package/dist/core/session-export.d.ts +0 -97
- package/dist/core/session-export.js +0 -368
- package/dist/core/session-export.js.map +0 -1
- package/dist/core/session-history.d.ts +0 -160
- package/dist/core/session-history.js +0 -467
- package/dist/core/session-history.js.map +0 -1
- package/dist/core/session-manager.d.ts +0 -509
- package/dist/core/session-manager.js +0 -1367
- package/dist/core/session-manager.js.map +0 -1
- package/dist/core/session-preview.d.ts +0 -12
- package/dist/core/session-preview.js +0 -58
- package/dist/core/session-preview.js.map +0 -1
- package/dist/core/session-storage.d.ts +0 -78
- package/dist/core/session-storage.js +0 -659
- package/dist/core/session-storage.js.map +0 -1
- package/dist/core/session-summary-index.d.ts +0 -51
- package/dist/core/session-summary-index.js +0 -192
- package/dist/core/session-summary-index.js.map +0 -1
- package/dist/core/settings-manager.d.ts +0 -113
- package/dist/core/settings-manager.js +0 -281
- package/dist/core/settings-manager.js.map +0 -1
- package/dist/core/shared-checkout-guard.d.ts +0 -78
- package/dist/core/shared-checkout-guard.js +0 -219
- package/dist/core/shared-checkout-guard.js.map +0 -1
- package/dist/core/shell-path.d.ts +0 -13
- package/dist/core/shell-path.js +0 -175
- package/dist/core/shell-path.js.map +0 -1
- package/dist/core/shell-threats-popular-packages.d.ts +0 -11
- package/dist/core/shell-threats-popular-packages.js +0 -675
- package/dist/core/shell-threats-popular-packages.js.map +0 -1
- package/dist/core/shell-threats.d.ts +0 -21
- package/dist/core/shell-threats.js +0 -235
- package/dist/core/shell-threats.js.map +0 -1
- package/dist/core/shell.d.ts +0 -54
- package/dist/core/shell.js +0 -99
- package/dist/core/shell.js.map +0 -1
- package/dist/core/shutdown.d.ts +0 -70
- package/dist/core/shutdown.js +0 -144
- package/dist/core/shutdown.js.map +0 -1
- package/dist/core/skill-scan.d.ts +0 -112
- package/dist/core/skill-scan.js +0 -781
- package/dist/core/skill-scan.js.map +0 -1
- package/dist/core/skills.d.ts +0 -100
- package/dist/core/skills.js +0 -299
- package/dist/core/skills.js.map +0 -1
- package/dist/core/slash-commands.d.ts +0 -58
- package/dist/core/slash-commands.js +0 -242
- package/dist/core/slash-commands.js.map +0 -1
- package/dist/core/steering.d.ts +0 -47
- package/dist/core/steering.js +0 -65
- package/dist/core/steering.js.map +0 -1
- package/dist/core/steroids.d.ts +0 -66
- package/dist/core/steroids.js +0 -243
- package/dist/core/steroids.js.map +0 -1
- package/dist/core/stream-diag-level.d.ts +0 -3
- package/dist/core/stream-diag-level.js +0 -24
- package/dist/core/stream-diag-level.js.map +0 -1
- package/dist/core/stream-rules.d.ts +0 -30
- package/dist/core/stream-rules.js +0 -151
- package/dist/core/stream-rules.js.map +0 -1
- package/dist/core/subagent-manager.d.ts +0 -239
- package/dist/core/subagent-manager.js +0 -1060
- package/dist/core/subagent-manager.js.map +0 -1
- package/dist/core/subagent-policy.d.ts +0 -9
- package/dist/core/subagent-policy.js +0 -41
- package/dist/core/subagent-policy.js.map +0 -1
- package/dist/core/subagent-receipt.d.ts +0 -54
- package/dist/core/subagent-receipt.js +0 -274
- package/dist/core/subagent-receipt.js.map +0 -1
- package/dist/core/subagent-store.d.ts +0 -41
- package/dist/core/subagent-store.js +0 -284
- package/dist/core/subagent-store.js.map +0 -1
- package/dist/core/subagent-turn-record.d.ts +0 -18
- package/dist/core/subagent-turn-record.js +0 -82
- package/dist/core/subagent-turn-record.js.map +0 -1
- package/dist/core/tasks-store.d.ts +0 -31
- package/dist/core/tasks-store.js +0 -97
- package/dist/core/tasks-store.js.map +0 -1
- package/dist/core/telegram-config.d.ts +0 -20
- package/dist/core/telegram-config.js +0 -52
- package/dist/core/telegram-config.js.map +0 -1
- package/dist/core/telegram.d.ts +0 -1
- package/dist/core/telegram.js +0 -3
- package/dist/core/telegram.js.map +0 -1
- package/dist/core/temp-paths.d.ts +0 -5
- package/dist/core/temp-paths.js +0 -50
- package/dist/core/temp-paths.js.map +0 -1
- package/dist/core/test-impact.d.ts +0 -73
- package/dist/core/test-impact.js +0 -467
- package/dist/core/test-impact.js.map +0 -1
- package/dist/core/thinking-level.d.ts +0 -1
- package/dist/core/thinking-level.js +0 -4
- package/dist/core/thinking-level.js.map +0 -1
- package/dist/core/threat-feed.d.ts +0 -65
- package/dist/core/threat-feed.js +0 -335
- package/dist/core/threat-feed.js.map +0 -1
- package/dist/core/trophies/catalog-more.d.ts +0 -2
- package/dist/core/trophies/catalog-more.js +0 -837
- package/dist/core/trophies/catalog-more.js.map +0 -1
- package/dist/core/trophies/catalog.d.ts +0 -4
- package/dist/core/trophies/catalog.js +0 -649
- package/dist/core/trophies/catalog.js.map +0 -1
- package/dist/core/trophies/engine.d.ts +0 -70
- package/dist/core/trophies/engine.js +0 -347
- package/dist/core/trophies/engine.js.map +0 -1
- package/dist/core/trophies/store.d.ts +0 -17
- package/dist/core/trophies/store.js +0 -113
- package/dist/core/trophies/store.js.map +0 -1
- package/dist/core/trophies/types.d.ts +0 -119
- package/dist/core/trophies/types.js +0 -76
- package/dist/core/trophies/types.js.map +0 -1
- package/dist/core/ui-adoption.d.ts +0 -32
- package/dist/core/ui-adoption.js +0 -302
- package/dist/core/ui-adoption.js.map +0 -1
- package/dist/core/ui-compatibility.d.ts +0 -10
- package/dist/core/ui-compatibility.js +0 -51
- package/dist/core/ui-compatibility.js.map +0 -1
- package/dist/core/ui-registry.d.ts +0 -101
- package/dist/core/ui-registry.js +0 -292
- package/dist/core/ui-registry.js.map +0 -1
- package/dist/core/user-shell-context.d.ts +0 -8
- package/dist/core/user-shell-context.js +0 -12
- package/dist/core/user-shell-context.js.map +0 -1
- package/dist/core/verification-evidence.d.ts +0 -49
- package/dist/core/verification-evidence.js +0 -816
- package/dist/core/verification-evidence.js.map +0 -1
- package/dist/core/verification-gate.d.ts +0 -77
- package/dist/core/verification-gate.js +0 -504
- package/dist/core/verification-gate.js.map +0 -1
- package/dist/core/verification-snapshot.d.ts +0 -7
- package/dist/core/verification-snapshot.js +0 -109
- package/dist/core/verification-snapshot.js.map +0 -1
- package/dist/core/verify-commands.d.ts +0 -34
- package/dist/core/verify-commands.js +0 -203
- package/dist/core/verify-commands.js.map +0 -1
- package/dist/core/voice-transcriber.d.ts +0 -1
- package/dist/core/voice-transcriber.js +0 -4
- package/dist/core/voice-transcriber.js.map +0 -1
- package/dist/core/workspace-guard.d.ts +0 -56
- package/dist/core/workspace-guard.js +0 -334
- package/dist/core/workspace-guard.js.map +0 -1
- package/dist/session.d.ts +0 -44
- package/dist/session.js +0 -105
- package/dist/session.js.map +0 -1
- package/dist/system-prompt.d.ts +0 -104
- package/dist/system-prompt.js +0 -480
- package/dist/system-prompt.js.map +0 -1
- package/dist/test-support/fake-home.d.ts +0 -19
- package/dist/test-support/fake-home.js +0 -37
- package/dist/test-support/fake-home.js.map +0 -1
- package/dist/test-support/keep-alive.d.ts +0 -14
- package/dist/test-support/keep-alive.js +0 -17
- package/dist/test-support/keep-alive.js.map +0 -1
- package/dist/test-support/slow-git.d.ts +0 -1
- package/dist/test-support/slow-git.js +0 -21
- package/dist/test-support/slow-git.js.map +0 -1
- package/dist/test-support/system-tools.d.ts +0 -6
- package/dist/test-support/system-tools.js +0 -36
- package/dist/test-support/system-tools.js.map +0 -1
- package/dist/tools/ask-user.d.ts +0 -34
- package/dist/tools/ask-user.js +0 -99
- package/dist/tools/ask-user.js.map +0 -1
- package/dist/tools/background-watch-lint.d.ts +0 -18
- package/dist/tools/background-watch-lint.js +0 -102
- package/dist/tools/background-watch-lint.js.map +0 -1
- package/dist/tools/bash-read-evidence.d.ts +0 -23
- package/dist/tools/bash-read-evidence.js +0 -180
- package/dist/tools/bash-read-evidence.js.map +0 -1
- package/dist/tools/bash.d.ts +0 -64
- package/dist/tools/bash.js +0 -552
- package/dist/tools/bash.js.map +0 -1
- package/dist/tools/browser-api.d.ts +0 -27
- package/dist/tools/browser-api.js +0 -449
- package/dist/tools/browser-api.js.map +0 -1
- package/dist/tools/browser-sandbox.d.ts +0 -16
- package/dist/tools/browser-sandbox.js +0 -158
- package/dist/tools/browser-sandbox.js.map +0 -1
- package/dist/tools/browser-session.d.ts +0 -84
- package/dist/tools/browser-session.js +0 -304
- package/dist/tools/browser-session.js.map +0 -1
- package/dist/tools/browser-snapshot.d.ts +0 -19
- package/dist/tools/browser-snapshot.js +0 -109
- package/dist/tools/browser-snapshot.js.map +0 -1
- package/dist/tools/browser.d.ts +0 -11
- package/dist/tools/browser.js +0 -106
- package/dist/tools/browser.js.map +0 -1
- package/dist/tools/checklist.d.ts +0 -49
- package/dist/tools/checklist.js +0 -154
- package/dist/tools/checklist.js.map +0 -1
- package/dist/tools/compress.d.ts +0 -56
- package/dist/tools/compress.js +0 -226
- package/dist/tools/compress.js.map +0 -1
- package/dist/tools/debug.d.ts +0 -54
- package/dist/tools/debug.js +0 -230
- package/dist/tools/debug.js.map +0 -1
- package/dist/tools/document-text.d.ts +0 -6
- package/dist/tools/document-text.js +0 -154
- package/dist/tools/document-text.js.map +0 -1
- package/dist/tools/edit-diff.d.ts +0 -123
- package/dist/tools/edit-diff.js +0 -476
- package/dist/tools/edit-diff.js.map +0 -1
- package/dist/tools/edit-targets.d.ts +0 -10
- package/dist/tools/edit-targets.js +0 -31
- package/dist/tools/edit-targets.js.map +0 -1
- package/dist/tools/edit.d.ts +0 -38
- package/dist/tools/edit.js +0 -695
- package/dist/tools/edit.js.map +0 -1
- package/dist/tools/enter-plan.d.ts +0 -7
- package/dist/tools/enter-plan.js +0 -20
- package/dist/tools/enter-plan.js.map +0 -1
- package/dist/tools/exit-plan.d.ts +0 -7
- package/dist/tools/exit-plan.js +0 -51
- package/dist/tools/exit-plan.js.map +0 -1
- package/dist/tools/find.d.ts +0 -17
- package/dist/tools/find.js +0 -100
- package/dist/tools/find.js.map +0 -1
- package/dist/tools/generate-image.d.ts +0 -83
- package/dist/tools/generate-image.js +0 -625
- package/dist/tools/generate-image.js.map +0 -1
- package/dist/tools/grep-scan.d.ts +0 -96
- package/dist/tools/grep-scan.js +0 -283
- package/dist/tools/grep-scan.js.map +0 -1
- package/dist/tools/grep.d.ts +0 -48
- package/dist/tools/grep.js +0 -1013
- package/dist/tools/grep.js.map +0 -1
- package/dist/tools/html-extract.d.ts +0 -57
- package/dist/tools/html-extract.js +0 -130
- package/dist/tools/html-extract.js.map +0 -1
- package/dist/tools/index.d.ts +0 -198
- package/dist/tools/index.js +0 -216
- package/dist/tools/index.js.map +0 -1
- package/dist/tools/live-preview.d.ts +0 -23
- package/dist/tools/live-preview.js +0 -41
- package/dist/tools/live-preview.js.map +0 -1
- package/dist/tools/ls.d.ts +0 -9
- package/dist/tools/ls.js +0 -59
- package/dist/tools/ls.js.map +0 -1
- package/dist/tools/operations.d.ts +0 -86
- package/dist/tools/operations.js +0 -117
- package/dist/tools/operations.js.map +0 -1
- package/dist/tools/overflow.d.ts +0 -17
- package/dist/tools/overflow.js +0 -68
- package/dist/tools/overflow.js.map +0 -1
- package/dist/tools/path-utils.d.ts +0 -30
- package/dist/tools/path-utils.js +0 -74
- package/dist/tools/path-utils.js.map +0 -1
- package/dist/tools/pdf-extract.d.ts +0 -17
- package/dist/tools/pdf-extract.js +0 -43
- package/dist/tools/pdf-extract.js.map +0 -1
- package/dist/tools/prompt-hints.d.ts +0 -46
- package/dist/tools/prompt-hints.js +0 -171
- package/dist/tools/prompt-hints.js.map +0 -1
- package/dist/tools/read-only-bash.d.ts +0 -31
- package/dist/tools/read-only-bash.js +0 -338
- package/dist/tools/read-only-bash.js.map +0 -1
- package/dist/tools/read-tracker.d.ts +0 -43
- package/dist/tools/read-tracker.js +0 -120
- package/dist/tools/read-tracker.js.map +0 -1
- package/dist/tools/read.d.ts +0 -18
- package/dist/tools/read.js +0 -316
- package/dist/tools/read.js.map +0 -1
- package/dist/tools/redaction-guard.d.ts +0 -10
- package/dist/tools/redaction-guard.js +0 -55
- package/dist/tools/redaction-guard.js.map +0 -1
- package/dist/tools/routine-output.d.ts +0 -39
- package/dist/tools/routine-output.js +0 -281
- package/dist/tools/routine-output.js.map +0 -1
- package/dist/tools/safe-env.d.ts +0 -1
- package/dist/tools/safe-env.js +0 -79
- package/dist/tools/safe-env.js.map +0 -1
- package/dist/tools/session-stats.d.ts +0 -26
- package/dist/tools/session-stats.js +0 -51
- package/dist/tools/session-stats.js.map +0 -1
- package/dist/tools/side-web-search.d.ts +0 -34
- package/dist/tools/side-web-search.js +0 -146
- package/dist/tools/side-web-search.js.map +0 -1
- package/dist/tools/skill.d.ts +0 -12
- package/dist/tools/skill.js +0 -94
- package/dist/tools/skill.js.map +0 -1
- package/dist/tools/source-path.d.ts +0 -8
- package/dist/tools/source-path.js +0 -128
- package/dist/tools/source-path.js.map +0 -1
- package/dist/tools/steroids.d.ts +0 -44
- package/dist/tools/steroids.js +0 -356
- package/dist/tools/steroids.js.map +0 -1
- package/dist/tools/subagent-control.d.ts +0 -5
- package/dist/tools/subagent-control.js +0 -211
- package/dist/tools/subagent-control.js.map +0 -1
- package/dist/tools/subagent-shared.d.ts +0 -110
- package/dist/tools/subagent-shared.js +0 -180
- package/dist/tools/subagent-shared.js.map +0 -1
- package/dist/tools/subagent.d.ts +0 -37
- package/dist/tools/subagent.js +0 -406
- package/dist/tools/subagent.js.map +0 -1
- package/dist/tools/task-output.d.ts +0 -10
- package/dist/tools/task-output.js +0 -74
- package/dist/tools/task-output.js.map +0 -1
- package/dist/tools/task-send.d.ts +0 -11
- package/dist/tools/task-send.js +0 -36
- package/dist/tools/task-send.js.map +0 -1
- package/dist/tools/task-stop.d.ts +0 -8
- package/dist/tools/task-stop.js +0 -15
- package/dist/tools/task-stop.js.map +0 -1
- package/dist/tools/tasks.d.ts +0 -15
- package/dist/tools/tasks.js +0 -94
- package/dist/tools/tasks.js.map +0 -1
- package/dist/tools/tool-search.d.ts +0 -26
- package/dist/tools/tool-search.js +0 -81
- package/dist/tools/tool-search.js.map +0 -1
- package/dist/tools/tool-tiers.d.ts +0 -65
- package/dist/tools/tool-tiers.js +0 -121
- package/dist/tools/tool-tiers.js.map +0 -1
- package/dist/tools/truncate.d.ts +0 -39
- package/dist/tools/truncate.js +0 -242
- package/dist/tools/truncate.js.map +0 -1
- package/dist/tools/ui-adopt.d.ts +0 -16
- package/dist/tools/ui-adopt.js +0 -66
- package/dist/tools/ui-adopt.js.map +0 -1
- package/dist/tools/ui-registry.d.ts +0 -15
- package/dist/tools/ui-registry.js +0 -39
- package/dist/tools/ui-registry.js.map +0 -1
- package/dist/tools/verification-review.d.ts +0 -2
- package/dist/tools/verification-review.js +0 -41
- package/dist/tools/verification-review.js.map +0 -1
- package/dist/tools/web-fetch.d.ts +0 -52
- package/dist/tools/web-fetch.js +0 -986
- package/dist/tools/web-fetch.js.map +0 -1
- package/dist/tools/web-search.d.ts +0 -35
- package/dist/tools/web-search.js +0 -926
- package/dist/tools/web-search.js.map +0 -1
- package/dist/tools/write.d.ts +0 -16
- package/dist/tools/write.js +0 -196
- package/dist/tools/write.js.map +0 -1
- package/dist/types.d.ts +0 -44
- package/dist/types.js +0 -2
- package/dist/types.js.map +0 -1
- package/dist/utils/git.d.ts +0 -102
- package/dist/utils/git.js +0 -325
- package/dist/utils/git.js.map +0 -1
- package/dist/utils/github-ci.d.ts +0 -18
- package/dist/utils/github-ci.js +0 -138
- package/dist/utils/github-ci.js.map +0 -1
- package/dist/utils/github.d.ts +0 -19
- package/dist/utils/github.js +0 -67
- package/dist/utils/github.js.map +0 -1
- package/dist/utils/image.d.ts +0 -166
- package/dist/utils/image.js +0 -673
- package/dist/utils/image.js.map +0 -1
- package/dist/utils/open-browser.d.ts +0 -13
- package/dist/utils/open-browser.js +0 -31
- package/dist/utils/open-browser.js.map +0 -1
- package/dist/utils/plan-steps.d.ts +0 -90
- package/dist/utils/plan-steps.js +0 -209
- package/dist/utils/plan-steps.js.map +0 -1
- package/dist/utils/process.d.ts +0 -48
- package/dist/utils/process.js +0 -175
- package/dist/utils/process.js.map +0 -1
- package/dist/utils/prompt-enhancer.d.ts +0 -53
- package/dist/utils/prompt-enhancer.js +0 -178
- package/dist/utils/prompt-enhancer.js.map +0 -1
- package/dist/utils/text.d.ts +0 -61
- package/dist/utils/text.js +0 -68
- package/dist/utils/text.js.map +0 -1
- package/dist/web.d.ts +0 -5
- package/dist/web.js +0 -5
- package/dist/web.js.map +0 -1
|
@@ -1,338 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Conservative read-only command classifier for plan mode.
|
|
3
|
-
*
|
|
4
|
-
* Deny-by-default: false negatives are safe (a read-only command merely stays
|
|
5
|
-
* blocked), false positives are not (a mutating command would slip through).
|
|
6
|
-
* Plan mode gates bash on `isReadOnlyCommand`; anything this function cannot
|
|
7
|
-
* prove is read-only falls back to the existing plan-mode block.
|
|
8
|
-
*
|
|
9
|
-
* A command-name allowlist alone is not proof: several allowlisted utilities
|
|
10
|
-
* mutate through flags (`git branch -D`, `find -delete`, `date -s`,
|
|
11
|
-
* `sort -o file`), take create-shaped operands (`git tag v1`), or execute
|
|
12
|
-
* repo-configured code (`git diff --ext-diff`). Each carries a per-flag
|
|
13
|
-
* policy below.
|
|
14
|
-
*/
|
|
15
|
-
/** Read-only utilities allowed as the leading command word of every segment. */
|
|
16
|
-
const READ_ONLY_COMMANDS = new Set([
|
|
17
|
-
"ls",
|
|
18
|
-
"cat",
|
|
19
|
-
"head",
|
|
20
|
-
"tail",
|
|
21
|
-
"wc",
|
|
22
|
-
"grep",
|
|
23
|
-
"egrep",
|
|
24
|
-
"fgrep",
|
|
25
|
-
"rg",
|
|
26
|
-
"find",
|
|
27
|
-
"fd",
|
|
28
|
-
"tree",
|
|
29
|
-
"stat",
|
|
30
|
-
"file",
|
|
31
|
-
"du",
|
|
32
|
-
"df",
|
|
33
|
-
"pwd",
|
|
34
|
-
"echo",
|
|
35
|
-
"printf",
|
|
36
|
-
"which",
|
|
37
|
-
"type",
|
|
38
|
-
"date",
|
|
39
|
-
"whoami",
|
|
40
|
-
"hostname",
|
|
41
|
-
"uname",
|
|
42
|
-
"printenv",
|
|
43
|
-
"sort",
|
|
44
|
-
"uniq",
|
|
45
|
-
"cut",
|
|
46
|
-
"tr",
|
|
47
|
-
"column",
|
|
48
|
-
"nl",
|
|
49
|
-
"comm",
|
|
50
|
-
"diff",
|
|
51
|
-
"basename",
|
|
52
|
-
"dirname",
|
|
53
|
-
"realpath",
|
|
54
|
-
"readlink",
|
|
55
|
-
"jq",
|
|
56
|
-
"yq",
|
|
57
|
-
// No awk: its `system()` built-in is arbitrary shell execution and cannot
|
|
58
|
-
// be screened by flags. Deny-by-default costs a blocked read-only call at
|
|
59
|
-
// worst; allowing it costs plan mode running `rm`.
|
|
60
|
-
]);
|
|
61
|
-
/** Read-only git subcommands. Everything else (commit, push, …) is rejected. */
|
|
62
|
-
const READ_ONLY_GIT_SUBCOMMANDS = new Set([
|
|
63
|
-
"status",
|
|
64
|
-
"log",
|
|
65
|
-
"diff",
|
|
66
|
-
"show",
|
|
67
|
-
"branch",
|
|
68
|
-
"remote",
|
|
69
|
-
"tag",
|
|
70
|
-
"describe",
|
|
71
|
-
"blame",
|
|
72
|
-
"ls-files",
|
|
73
|
-
"rev-parse",
|
|
74
|
-
"shortlog",
|
|
75
|
-
"cat-file",
|
|
76
|
-
"config",
|
|
77
|
-
"for-each-ref",
|
|
78
|
-
"reflog",
|
|
79
|
-
]);
|
|
80
|
-
/**
|
|
81
|
-
* Shell tokens that can hide writes or execute arbitrary commands. If any
|
|
82
|
-
* segment contains one of these, the whole command is rejected.
|
|
83
|
-
*/
|
|
84
|
-
const DANGEROUS_TOKENS = [
|
|
85
|
-
">", // output redirection (covers >>, >|, &>, <> via substring)
|
|
86
|
-
"<>",
|
|
87
|
-
"$(", // command substitution
|
|
88
|
-
"`", // backtick command substitution
|
|
89
|
-
"<(", // process substitution
|
|
90
|
-
">(",
|
|
91
|
-
];
|
|
92
|
-
/** Split a command on shell control operators into individual segments. */
|
|
93
|
-
export function splitShellCommandSegments(command) {
|
|
94
|
-
// Split on ; && || | and newlines. The pipe split also covers |& since the
|
|
95
|
-
// trailing & becomes its own (empty/garbage) segment that fails the allowlist.
|
|
96
|
-
return command
|
|
97
|
-
.split(/(?:&&|\|\||[;|\n])/)
|
|
98
|
-
.map((segment) => segment.trim())
|
|
99
|
-
.filter((segment) => segment.length > 0);
|
|
100
|
-
}
|
|
101
|
-
/** Extract the leading command word from a segment (ignores nothing special). */
|
|
102
|
-
function leadingWord(segment) {
|
|
103
|
-
const match = segment.match(/^(\S+)/);
|
|
104
|
-
return match ? match[1] : "";
|
|
105
|
-
}
|
|
106
|
-
/** Tokenize a segment on whitespace for flag inspection. */
|
|
107
|
-
function tokens(segment) {
|
|
108
|
-
return segment.split(/\s+/).filter((token) => token.length > 0);
|
|
109
|
-
}
|
|
110
|
-
/** True if any token equals `flag` or is `flag=value`. */
|
|
111
|
-
function hasFlag(parts, ...flags) {
|
|
112
|
-
return parts.some((part) => flags.some((flag) => part === flag || part.startsWith(`${flag}=`)));
|
|
113
|
-
}
|
|
114
|
-
/** Non-flag tokens of `parts`. */
|
|
115
|
-
function positionals(parts) {
|
|
116
|
-
return parts.filter((part) => !part.startsWith("-"));
|
|
117
|
-
}
|
|
118
|
-
/**
|
|
119
|
-
* True if any token is a cluster of short flags containing one of `letters`
|
|
120
|
-
* (`-df` = `-d -f`; GNU getopt and git parse-options both accept clusters, so
|
|
121
|
-
* exact-token flag checks alone can be bypassed with `sort -ro`, `date -su`,
|
|
122
|
-
* `git branch -df`). Long flags (`--…`) never match: two leading dashes fail
|
|
123
|
-
* the letter run.
|
|
124
|
-
*/
|
|
125
|
-
function hasClusteredShortFlag(parts, letters) {
|
|
126
|
-
return parts.some((part) => {
|
|
127
|
-
const match = /^-([a-zA-Z]+)\d*$/.exec(part);
|
|
128
|
-
return match !== null && [...match[1]].some((ch) => letters.has(ch));
|
|
129
|
-
});
|
|
130
|
-
}
|
|
131
|
-
// --- git subcommand flag policies -------------------------------------------
|
|
132
|
-
/** Listing flags that make `git branch`/`git tag` operands filters rather
|
|
133
|
-
* than create/delete targets. Without one, a positional operand creates. */
|
|
134
|
-
const GIT_LIST_FLAGS = ["--list", "-l"];
|
|
135
|
-
/** Short-flag letters that make `git branch` mutate or execute (d/D delete, m/M
|
|
136
|
-
* move, c/C copy, f force, u upstream). `a`/`v` listing letters excluded. */
|
|
137
|
-
const GIT_BRANCH_DANGEROUS_LETTERS = new Set(["d", "D", "m", "M", "c", "C", "f", "u"]);
|
|
138
|
-
/** Same for `git tag` (d/D delete, f force, a annotate, s sign, u local-user,
|
|
139
|
-
* m message, e edit). `n`/`l` listing letters excluded. */
|
|
140
|
-
const GIT_TAG_DANGEROUS_LETTERS = new Set(["d", "D", "f", "a", "s", "u", "m", "e"]);
|
|
141
|
-
function isReadOnlyGitBranch(rest) {
|
|
142
|
-
if (hasFlag(rest, "-d", "-D", "--delete", "-m", "-M", "--move", "-c", "-C", "--copy", "-f", "--force", "-u", "--set-upstream-to", "--unset-upstream", "--edit-description") ||
|
|
143
|
-
hasClusteredShortFlag(rest, GIT_BRANCH_DANGEROUS_LETTERS)) {
|
|
144
|
-
return false;
|
|
145
|
-
}
|
|
146
|
-
return positionals(rest).length === 0 || hasFlag(rest, ...GIT_LIST_FLAGS);
|
|
147
|
-
}
|
|
148
|
-
function isReadOnlyGitTag(rest) {
|
|
149
|
-
if (hasFlag(rest, "-d", "--delete", "-f", "--force", "-a", "--annotate", "-s", "--sign", "-u", "--local-user", "-m", "--message", "-e", "--edit") ||
|
|
150
|
-
hasClusteredShortFlag(rest, GIT_TAG_DANGEROUS_LETTERS)) {
|
|
151
|
-
return false;
|
|
152
|
-
}
|
|
153
|
-
return positionals(rest).length === 0 || hasFlag(rest, ...GIT_LIST_FLAGS);
|
|
154
|
-
}
|
|
155
|
-
function isReadOnlyGitRemote(rest) {
|
|
156
|
-
const operands = positionals(rest);
|
|
157
|
-
if (operands.length === 0)
|
|
158
|
-
return true; // bare `git remote [-v]` lists
|
|
159
|
-
const sub = operands[0];
|
|
160
|
-
if (sub === "get-url")
|
|
161
|
-
return true;
|
|
162
|
-
// `git remote show` contacts the remote (network, askpass helpers);
|
|
163
|
-
// read-only only with --no-query.
|
|
164
|
-
if (sub === "show")
|
|
165
|
-
return hasFlag(rest, "-n", "--no-query");
|
|
166
|
-
return false; // add, rename, remove, set-url, set-head, prune, update …
|
|
167
|
-
}
|
|
168
|
-
function isReadOnlyGitReflog(rest) {
|
|
169
|
-
// `expire` and `delete` rewrite reflog history.
|
|
170
|
-
const sub = positionals(rest)[0];
|
|
171
|
-
return sub !== "expire" && sub !== "delete";
|
|
172
|
-
}
|
|
173
|
-
function isReadOnlyGit(segment) {
|
|
174
|
-
const parts = tokens(segment);
|
|
175
|
-
// parts[0] === "git"; find the first non-flag token as the subcommand. A
|
|
176
|
-
// global flag with a value (`git -C /tmp branch`) puts the value here and
|
|
177
|
-
// denies — fail-closed, and `-C` escapes the workspace anyway.
|
|
178
|
-
let subcommand = "";
|
|
179
|
-
for (let i = 1; i < parts.length; i += 1) {
|
|
180
|
-
const part = parts[i];
|
|
181
|
-
if (part.startsWith("-"))
|
|
182
|
-
continue;
|
|
183
|
-
subcommand = part;
|
|
184
|
-
break;
|
|
185
|
-
}
|
|
186
|
-
if (!READ_ONLY_GIT_SUBCOMMANDS.has(subcommand))
|
|
187
|
-
return false;
|
|
188
|
-
const rest = parts.slice(parts.indexOf(subcommand) + 1);
|
|
189
|
-
if (subcommand === "config") {
|
|
190
|
-
// `git config` is read-only only with --get (or --list / --get-all).
|
|
191
|
-
return hasFlag(rest, "--get", "--get-all", "--list", "-l");
|
|
192
|
-
}
|
|
193
|
-
// log/show/diff can execute repo-configured external diff/textconv
|
|
194
|
-
// drivers. The --no- forms (which disable them) stay allowed: exact match.
|
|
195
|
-
if (subcommand === "log" || subcommand === "show" || subcommand === "diff") {
|
|
196
|
-
if (rest.includes("--ext-diff") || rest.includes("--textconv"))
|
|
197
|
-
return false;
|
|
198
|
-
}
|
|
199
|
-
if (subcommand === "branch")
|
|
200
|
-
return isReadOnlyGitBranch(rest);
|
|
201
|
-
if (subcommand === "tag")
|
|
202
|
-
return isReadOnlyGitTag(rest);
|
|
203
|
-
if (subcommand === "remote")
|
|
204
|
-
return isReadOnlyGitRemote(rest);
|
|
205
|
-
if (subcommand === "reflog")
|
|
206
|
-
return isReadOnlyGitReflog(rest);
|
|
207
|
-
return true;
|
|
208
|
-
}
|
|
209
|
-
/**
|
|
210
|
-
* sed script text that could execute a command or write a file: GNU's `e`
|
|
211
|
-
* command (`e cmd`, `1e`, `/re/e`, `{ e ...`), the `s///...e` exec flag, or
|
|
212
|
-
* the `w`/`W` write commands. Applied to ALL candidate script text - every
|
|
213
|
-
* non-flag token joined plus long-flag `=values` - so quoting or splitting a
|
|
214
|
-
* script across whitespace cannot hide the command from it. False positives
|
|
215
|
-
* (a filename shaped like `1e`) merely block a read-only call.
|
|
216
|
-
*/
|
|
217
|
-
function sedScriptUnsafe(text) {
|
|
218
|
-
// `e`/`w`/`W` at a command position: script start, after `;` `{` `}`/`)`, or
|
|
219
|
-
// directly after an address (`1e`, `$e`, `/re/e`, `2w out`).
|
|
220
|
-
if (/(^|[\s;{}()])([0-9,$~/\\][^\s;{}]*)?[ewW](\s|$|\\)/.test(text))
|
|
221
|
-
return true;
|
|
222
|
-
// Exec flag on a substitution, any delimiter: `s/x/y/e`, `s#x#y#ge`.
|
|
223
|
-
if (/s(.).*\1[0-9A-Za-z]*e/.test(text))
|
|
224
|
-
return true;
|
|
225
|
-
return false;
|
|
226
|
-
}
|
|
227
|
-
function isReadOnlySed(segment) {
|
|
228
|
-
const rest = tokens(segment).slice(1);
|
|
229
|
-
// In-place edit (`-i`, `-i.bak`, `--in-place`) or a script read from a file
|
|
230
|
-
// (`-f`, `--file`) - the file's contents cannot be inspected here.
|
|
231
|
-
if (rest.some((part) => part.startsWith("-i") ||
|
|
232
|
-
part.startsWith("--in-place") ||
|
|
233
|
-
part.startsWith("-f") ||
|
|
234
|
-
part.startsWith("--file"))) {
|
|
235
|
-
return false;
|
|
236
|
-
}
|
|
237
|
-
// A short-flag cluster longer than two characters carries an attached value
|
|
238
|
-
// that cannot be attributed (`-es/a/b/`, `-i.bak`, even the pure `-nE`);
|
|
239
|
-
// only single-letter flags pass. Long `--flags` are words, not clusters.
|
|
240
|
-
if (rest.some((part) => /^-[a-zA-Z]./.test(part)))
|
|
241
|
-
return false;
|
|
242
|
-
// Fail closed on compound scripts: `;`/`{`/`}` chain commands across token
|
|
243
|
-
// boundaries (`sed 's/a/b/; e x' f`), so compound scripts are never provably
|
|
244
|
-
// read-only here.
|
|
245
|
-
const scriptText = rest
|
|
246
|
-
.filter((part) => !part.startsWith("-"))
|
|
247
|
-
.map((part) => part.replace(/^['"]|['"]$/g, ""))
|
|
248
|
-
.join(" ");
|
|
249
|
-
const flagValues = rest
|
|
250
|
-
.filter((part) => part.startsWith("--") && part.includes("="))
|
|
251
|
-
.map((part) => part.slice(part.indexOf("=") + 1).replace(/^['"]|['"]$/g, ""))
|
|
252
|
-
.join(" ");
|
|
253
|
-
const all = `${scriptText} ${flagValues}`;
|
|
254
|
-
if (/;|\{|\}/.test(all))
|
|
255
|
-
return false;
|
|
256
|
-
return !sedScriptUnsafe(all);
|
|
257
|
-
}
|
|
258
|
-
// --- plain-utility flag policies --------------------------------------------
|
|
259
|
-
function isReadOnlyUtility(command, parts) {
|
|
260
|
-
const rest = parts.slice(1);
|
|
261
|
-
switch (command) {
|
|
262
|
-
case "date":
|
|
263
|
-
// `-s`/`--set` sets the system clock, also when clustered (`-su`).
|
|
264
|
-
return !hasFlag(rest, "-s", "--set") && !hasClusteredShortFlag(rest, new Set(["s"]));
|
|
265
|
-
case "find":
|
|
266
|
-
// -exec/-ok (and their -dir variants) run arbitrary commands; the rest
|
|
267
|
-
// write files.
|
|
268
|
-
return !rest.some((part) => part === "-delete" ||
|
|
269
|
-
part.startsWith("-exec") ||
|
|
270
|
-
part.startsWith("-ok") ||
|
|
271
|
-
part.startsWith("-fprint") ||
|
|
272
|
-
part === "-fls");
|
|
273
|
-
case "rg":
|
|
274
|
-
// `--pre` runs a command on every file searched (`--pre-glob` only scopes it).
|
|
275
|
-
return !hasFlag(rest, "--pre");
|
|
276
|
-
case "sort":
|
|
277
|
-
// `-o` writes a file, also when clustered (`-ro`).
|
|
278
|
-
return !hasFlag(rest, "-o", "--output") && !hasClusteredShortFlag(rest, new Set(["o"]));
|
|
279
|
-
case "tree":
|
|
280
|
-
return !hasFlag(rest, "-o", "--output-file") && !hasClusteredShortFlag(rest, new Set(["o"]));
|
|
281
|
-
case "yq":
|
|
282
|
-
// -i edits in place; --split-exp/-s write one file per document.
|
|
283
|
-
return !hasFlag(rest, "-i", "--in-place", "-s", "--split-exp");
|
|
284
|
-
default:
|
|
285
|
-
return true;
|
|
286
|
-
}
|
|
287
|
-
}
|
|
288
|
-
export function hasUnsafeShellSyntax(segment) {
|
|
289
|
-
return DANGEROUS_TOKENS.some((token) => segment.includes(token)) || /&\s*$/.test(segment);
|
|
290
|
-
}
|
|
291
|
-
function isReadOnlySegment(segment) {
|
|
292
|
-
// Keep shell-syntax policy shared with semantic verification classification.
|
|
293
|
-
if (hasUnsafeShellSyntax(segment))
|
|
294
|
-
return false;
|
|
295
|
-
const parts = tokens(segment);
|
|
296
|
-
const command = leadingWord(segment);
|
|
297
|
-
if (command === "git")
|
|
298
|
-
return isReadOnlyGit(segment);
|
|
299
|
-
if (command === "sed")
|
|
300
|
-
return isReadOnlySed(segment);
|
|
301
|
-
return READ_ONLY_COMMANDS.has(command) && isReadOnlyUtility(command, parts);
|
|
302
|
-
}
|
|
303
|
-
/**
|
|
304
|
-
* Returns true only when every segment of the command is provably read-only.
|
|
305
|
-
*/
|
|
306
|
-
export function isReadOnlyCommand(command) {
|
|
307
|
-
const trimmed = command.trim();
|
|
308
|
-
if (trimmed.length === 0)
|
|
309
|
-
return false;
|
|
310
|
-
const segments = splitShellCommandSegments(trimmed);
|
|
311
|
-
if (segments.length === 0)
|
|
312
|
-
return false;
|
|
313
|
-
return segments.every(isReadOnlySegment);
|
|
314
|
-
}
|
|
315
|
-
const SLEEP_UNIT_SECONDS = { s: 1, m: 60, h: 3600, d: 86400 };
|
|
316
|
-
/**
|
|
317
|
-
* Total seconds a command sleeps when it does nothing else (`sleep 5`,
|
|
318
|
-
* `sleep 2; sleep 3`), or null when it does any real work.
|
|
319
|
-
*
|
|
320
|
-
* Used to catch a guessed wait on a background process, which now has a real
|
|
321
|
-
* answer in `task_output`'s `wait_ms`. Callers care about the duration because
|
|
322
|
-
* a brief settle before poking a dev server is legitimate, while a long nap is
|
|
323
|
-
* always a guess at a finish time.
|
|
324
|
-
*/
|
|
325
|
-
export function sleepOnlySeconds(command) {
|
|
326
|
-
const segments = splitShellCommandSegments(command.trim());
|
|
327
|
-
if (segments.length === 0)
|
|
328
|
-
return null;
|
|
329
|
-
let total = 0;
|
|
330
|
-
for (const segment of segments) {
|
|
331
|
-
const match = /^sleep\s+(\d+(?:\.\d+)?)([smhd])?$/.exec(segment.trim());
|
|
332
|
-
if (!match)
|
|
333
|
-
return null;
|
|
334
|
-
total += Number(match[1]) * (match[2] ? SLEEP_UNIT_SECONDS[match[2]] : 1);
|
|
335
|
-
}
|
|
336
|
-
return total;
|
|
337
|
-
}
|
|
338
|
-
//# sourceMappingURL=read-only-bash.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"read-only-bash.js","sourceRoot":"","sources":["../../src/tools/read-only-bash.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,gFAAgF;AA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AC;QAAE,OAAO,KAAK,CAAC;IACvC,MAAM,QAAQ,GAAG,yBAAyB,CAAC,OAAO,CAAC,CAAC;IACpD,IAAI,QAAQ,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,KAAK,CAAC;IACxC,OAAO,QAAQ,CAAC,KAAK,CAAC,iBAAiB,CAAC,CAAC;AAC3C,CAAC;AAED,MAAM,kBAAkB,GAA2B,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,IAAI,EAAE,CAAC,EAAE,KAAK,EAAE,CAAC;AAEtF;;;;;;;;GAQG;AACH,MAAM,UAAU,gBAAgB,CAAC,OAAe;IAC9C,MAAM,QAAQ,GAAG,yBAAyB,CAAC,OAAO,CAAC,IAAI,EAAE,CAAC,CAAC;IAC3D,IAAI,QAAQ,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,IAAI,CAAC;IACvC,IAAI,KAAK,GAAG,CAAC,CAAC;IACd,KAAK,MAAM,OAAO,IAAI,QAAQ,EAAE,CAAC;QAC/B,MAAM,KAAK,GAAG,oCAAoC,CAAC,IAAI,CAAC,OAAO,CAAC,IAAI,EAAE,CAAC,CAAC;QACxE,IAAI,CAAC,KAAK;YAAE,OAAO,IAAI,CAAC;QACxB,KAAK,IAAI,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,kBAAkB,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;IAC5E,CAAC;IACD,OAAO,KAAK,CAAC;AACf,CAAC"}
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
import type { ToolOperations } from "./operations.js";
|
|
2
|
-
/** A 1-based, inclusive range of line numbers. */
|
|
3
|
-
export type LineRange = readonly [start: number, end: number];
|
|
4
|
-
export interface ReadEntry {
|
|
5
|
-
mtimeMs: number;
|
|
6
|
-
hash: string;
|
|
7
|
-
/** Lines in the content `hash` covers (a trailing newline does not add one). */
|
|
8
|
-
lineCount: number;
|
|
9
|
-
/**
|
|
10
|
-
* How much of that content the model has been shown: `"all"`, or the merged,
|
|
11
|
-
* sorted line ranges seen so far. A full-file `write` requires `"all"`.
|
|
12
|
-
*/
|
|
13
|
-
seen: "all" | readonly LineRange[];
|
|
14
|
-
}
|
|
15
|
-
export type ReadTracker = Map<string, ReadEntry>;
|
|
16
|
-
export declare function hashContent(content: string): string;
|
|
17
|
-
/** Line count as the read tool numbers lines, not counting the empty "line" after a final newline. */
|
|
18
|
-
export declare function countLines(content: string): number;
|
|
19
|
-
/**
|
|
20
|
-
* Record that the model was shown `shown` (default: every line) of `content`.
|
|
21
|
-
* Reads of unchanged content accumulate, so paging through a long file with
|
|
22
|
-
* offset/limit eventually counts as having seen all of it.
|
|
23
|
-
*/
|
|
24
|
-
export declare function recordRead(tracker: ReadTracker | undefined, resolvedPath: string, content: string, mtimeMs: number, shown?: LineRange): void;
|
|
25
|
-
/**
|
|
26
|
-
* Record the model's own change to a file. `write` supplies every line itself,
|
|
27
|
-
* so the model knows the whole result. `edit` changes only part of a file, so
|
|
28
|
-
* it knows the whole result only if it had already seen all of the original.
|
|
29
|
-
*/
|
|
30
|
-
export declare function recordWrite(tracker: ReadTracker | undefined, resolvedPath: string, content: string, ops: ToolOperations, scope?: "whole" | "edit"): Promise<void>;
|
|
31
|
-
/**
|
|
32
|
-
* Lines of the file as it is on disk now that the model has not been shown:
|
|
33
|
-
* `"all"` when it never read the file or the file changed since its last
|
|
34
|
-
* read/write (mtime, else content hash), otherwise the gaps between the ranges
|
|
35
|
-
* it has seen (empty when it has seen every line). A full-file `write` uses
|
|
36
|
-
* this to report which lines it removed without the model having seen them.
|
|
37
|
-
*/
|
|
38
|
-
export declare function unseenLines(tracker: ReadTracker | undefined, resolvedPath: string, ops: ToolOperations): Promise<"all" | readonly LineRange[]>;
|
|
39
|
-
/**
|
|
40
|
-
* True when the recorded read still matches disk (mtime, else content hash).
|
|
41
|
-
* A hash match after an mtime-only change refreshes the recorded mtime.
|
|
42
|
-
*/
|
|
43
|
-
export declare function isFresh(tracker: ReadTracker, resolvedPath: string, ops: ToolOperations): Promise<boolean>;
|
|
@@ -1,120 +0,0 @@
|
|
|
1
|
-
import crypto from "node:crypto";
|
|
2
|
-
export function hashContent(content) {
|
|
3
|
-
return crypto.createHash("sha256").update(content).digest("hex");
|
|
4
|
-
}
|
|
5
|
-
/** Line count as the read tool numbers lines, not counting the empty "line" after a final newline. */
|
|
6
|
-
export function countLines(content) {
|
|
7
|
-
if (content === "")
|
|
8
|
-
return 0;
|
|
9
|
-
const lines = content.split("\n").length;
|
|
10
|
-
return content.endsWith("\n") ? lines - 1 : lines;
|
|
11
|
-
}
|
|
12
|
-
function mergeRanges(ranges) {
|
|
13
|
-
const sorted = [...ranges].sort((a, b) => a[0] - b[0]);
|
|
14
|
-
const merged = [];
|
|
15
|
-
for (const [start, end] of sorted) {
|
|
16
|
-
const last = merged[merged.length - 1];
|
|
17
|
-
if (last && start <= last[1] + 1) {
|
|
18
|
-
last[1] = Math.max(last[1], end);
|
|
19
|
-
}
|
|
20
|
-
else {
|
|
21
|
-
merged.push([start, end]);
|
|
22
|
-
}
|
|
23
|
-
}
|
|
24
|
-
return merged;
|
|
25
|
-
}
|
|
26
|
-
/** Clamp `ranges` to the file and collapse them to `"all"` once they cover every line. */
|
|
27
|
-
function toSeen(ranges, lineCount) {
|
|
28
|
-
if (lineCount === 0)
|
|
29
|
-
return "all";
|
|
30
|
-
const merged = mergeRanges(ranges
|
|
31
|
-
.map(([start, end]) => [Math.max(1, start), Math.min(lineCount, end)])
|
|
32
|
-
.filter(([start, end]) => start <= end));
|
|
33
|
-
const only = merged.length === 1 ? merged[0] : undefined;
|
|
34
|
-
return only && only[0] === 1 && only[1] === lineCount ? "all" : merged;
|
|
35
|
-
}
|
|
36
|
-
/**
|
|
37
|
-
* Record that the model was shown `shown` (default: every line) of `content`.
|
|
38
|
-
* Reads of unchanged content accumulate, so paging through a long file with
|
|
39
|
-
* offset/limit eventually counts as having seen all of it.
|
|
40
|
-
*/
|
|
41
|
-
export function recordRead(tracker, resolvedPath, content, mtimeMs, shown) {
|
|
42
|
-
if (!tracker)
|
|
43
|
-
return;
|
|
44
|
-
const hash = hashContent(content);
|
|
45
|
-
const lineCount = countLines(content);
|
|
46
|
-
const previous = tracker.get(resolvedPath);
|
|
47
|
-
let seen;
|
|
48
|
-
if (!shown) {
|
|
49
|
-
seen = "all";
|
|
50
|
-
}
|
|
51
|
-
else if (previous?.hash === hash) {
|
|
52
|
-
seen = previous.seen === "all" ? "all" : toSeen([...previous.seen, shown], lineCount);
|
|
53
|
-
}
|
|
54
|
-
else {
|
|
55
|
-
seen = toSeen([shown], lineCount);
|
|
56
|
-
}
|
|
57
|
-
tracker.set(resolvedPath, { mtimeMs, hash, lineCount, seen });
|
|
58
|
-
}
|
|
59
|
-
/**
|
|
60
|
-
* Record the model's own change to a file. `write` supplies every line itself,
|
|
61
|
-
* so the model knows the whole result. `edit` changes only part of a file, so
|
|
62
|
-
* it knows the whole result only if it had already seen all of the original.
|
|
63
|
-
*/
|
|
64
|
-
export async function recordWrite(tracker, resolvedPath, content, ops, scope = "whole") {
|
|
65
|
-
if (!tracker)
|
|
66
|
-
return;
|
|
67
|
-
const stat = await ops.stat(resolvedPath);
|
|
68
|
-
const knewAll = scope === "whole" || tracker.get(resolvedPath)?.seen === "all";
|
|
69
|
-
tracker.set(resolvedPath, {
|
|
70
|
-
mtimeMs: stat.mtimeMs,
|
|
71
|
-
hash: hashContent(content),
|
|
72
|
-
lineCount: countLines(content),
|
|
73
|
-
// An edit shifts line numbers, so ranges seen before it no longer line up.
|
|
74
|
-
seen: knewAll ? "all" : [],
|
|
75
|
-
});
|
|
76
|
-
}
|
|
77
|
-
/**
|
|
78
|
-
* Lines of the file as it is on disk now that the model has not been shown:
|
|
79
|
-
* `"all"` when it never read the file or the file changed since its last
|
|
80
|
-
* read/write (mtime, else content hash), otherwise the gaps between the ranges
|
|
81
|
-
* it has seen (empty when it has seen every line). A full-file `write` uses
|
|
82
|
-
* this to report which lines it removed without the model having seen them.
|
|
83
|
-
*/
|
|
84
|
-
export async function unseenLines(tracker, resolvedPath, ops) {
|
|
85
|
-
if (!tracker)
|
|
86
|
-
return [];
|
|
87
|
-
if (!tracker.has(resolvedPath) || !(await isFresh(tracker, resolvedPath, ops)))
|
|
88
|
-
return "all";
|
|
89
|
-
const entry = tracker.get(resolvedPath);
|
|
90
|
-
if (!entry || entry.seen === "all")
|
|
91
|
-
return [];
|
|
92
|
-
const gaps = [];
|
|
93
|
-
let next = 1;
|
|
94
|
-
for (const [start, end] of entry.seen) {
|
|
95
|
-
if (start > next)
|
|
96
|
-
gaps.push([next, start - 1]);
|
|
97
|
-
next = end + 1;
|
|
98
|
-
}
|
|
99
|
-
if (next <= entry.lineCount)
|
|
100
|
-
gaps.push([next, entry.lineCount]);
|
|
101
|
-
return gaps;
|
|
102
|
-
}
|
|
103
|
-
/**
|
|
104
|
-
* True when the recorded read still matches disk (mtime, else content hash).
|
|
105
|
-
* A hash match after an mtime-only change refreshes the recorded mtime.
|
|
106
|
-
*/
|
|
107
|
-
export async function isFresh(tracker, resolvedPath, ops) {
|
|
108
|
-
const entry = tracker.get(resolvedPath);
|
|
109
|
-
if (!entry)
|
|
110
|
-
return false;
|
|
111
|
-
const stat = await ops.stat(resolvedPath);
|
|
112
|
-
if (stat.mtimeMs === entry.mtimeMs)
|
|
113
|
-
return true;
|
|
114
|
-
const current = await ops.readFile(resolvedPath);
|
|
115
|
-
if (hashContent(current) !== entry.hash)
|
|
116
|
-
return false;
|
|
117
|
-
tracker.set(resolvedPath, { ...entry, mtimeMs: stat.mtimeMs });
|
|
118
|
-
return true;
|
|
119
|
-
}
|
|
120
|
-
//# sourceMappingURL=read-tracker.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"read-tracker.js","sourceRoot":"","sources":["../../src/tools/read-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CAAC,KAAK,KAAK,CAAC,IAAI;QAAE,OAAO,KAAK,CAAC;IACtD,OAAO,CAAC,GAAG,CAAC,YAAY,EAAE,EAAE,GAAG,KAAK,EAAE,OAAO,EAAE,IAAI,CAAC,OAAO,EAAE,CAAC,CAAC;IAC/D,OAAO,IAAI,CAAC;AACd,CAAC"}
|
package/dist/tools/read.d.ts
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { z } from "zod";
|
|
2
|
-
import type { AgentTool } from "@kenkaiiii/gg-agent";
|
|
3
|
-
import { type ToolOperations } from "./operations.js";
|
|
4
|
-
import { type ReadTracker } from "./read-tracker.js";
|
|
5
|
-
export declare const BINARY_EXTENSIONS: Set<string>;
|
|
6
|
-
declare const ReadParams: z.ZodObject<{
|
|
7
|
-
file_path: z.ZodString;
|
|
8
|
-
offset: z.ZodOptional<z.ZodNumber>;
|
|
9
|
-
limit: z.ZodOptional<z.ZodNumber>;
|
|
10
|
-
anchors: z.ZodOptional<z.ZodBoolean>;
|
|
11
|
-
}, z.core.$strip>;
|
|
12
|
-
export declare function createReadTool(cwd: string, readFiles?: ReadTracker, ops?: ToolOperations, onFileRead?: (filePath: string) => void | Promise<void>,
|
|
13
|
-
/** Max video payload (bytes) the active model accepts, or `undefined` for
|
|
14
|
-
* models without video support. When set, video files are returned as a
|
|
15
|
-
* native `video` content part (compressed to fit this cap); when undefined
|
|
16
|
-
* they fall through to the generic binary-file notice. */
|
|
17
|
-
videoByteLimit?: number): AgentTool<typeof ReadParams>;
|
|
18
|
-
export {};
|