koder 0.5.3__tar.gz → 0.5.4__tar.gz
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.
- {koder-0.5.3 → koder-0.5.4}/PKG-INFO +30 -26
- {koder-0.5.3 → koder-0.5.4}/README.md +13 -9
- {koder-0.5.3 → koder-0.5.4}/koder_agent/agentic/agent.py +125 -43
- {koder-0.5.3 → koder-0.5.4}/koder_agent/agentic/approval_hooks.py +59 -4
- {koder-0.5.3 → koder-0.5.4}/koder_agent/auth/codex_prompts.py +0 -1
- {koder-0.5.3 → koder-0.5.4}/koder_agent/auth/providers/antigravity.py +3 -2
- {koder-0.5.3 → koder-0.5.4}/koder_agent/auth/providers/chatgpt.py +3 -3
- {koder-0.5.3 → koder-0.5.4}/koder_agent/auth/providers/claude.py +4 -1
- {koder-0.5.3 → koder-0.5.4}/koder_agent/auth/providers/google.py +4 -1
- {koder-0.5.3 → koder-0.5.4}/koder_agent/auth/tool_utils.py +0 -2
- {koder-0.5.3 → koder-0.5.4}/koder_agent/config/models.py +6 -0
- {koder-0.5.3 → koder-0.5.4}/koder_agent/core/bash_security.py +12 -3
- {koder-0.5.3 → koder-0.5.4}/koder_agent/core/file_index.py +4 -1
- koder-0.5.4/koder_agent/core/goal_display.py +121 -0
- koder-0.5.4/koder_agent/core/goal_prompts.py +151 -0
- koder-0.5.4/koder_agent/core/goal_runtime.py +181 -0
- koder-0.5.4/koder_agent/core/goals.py +544 -0
- {koder-0.5.3 → koder-0.5.4}/koder_agent/core/interactive.py +304 -39
- koder-0.5.4/koder_agent/core/queued_input.py +112 -0
- {koder-0.5.3 → koder-0.5.4}/koder_agent/core/scheduler.py +383 -88
- {koder-0.5.3 → koder-0.5.4}/koder_agent/core/session.py +28 -178
- {koder-0.5.3 → koder-0.5.4}/koder_agent/core/streaming_display.py +4 -1
- {koder-0.5.3 → koder-0.5.4}/koder_agent/core/usage_tracker.py +4 -0
- {koder-0.5.3 → koder-0.5.4}/koder_agent/data/model_prices_and_context_window.json +5092 -1115
- {koder-0.5.3 → koder-0.5.4}/koder_agent/harness/agents/service.py +1 -0
- {koder-0.5.3 → koder-0.5.4}/koder_agent/harness/auth/commands.py +6 -4
- {koder-0.5.3 → koder-0.5.4}/koder_agent/harness/commands/builtins/runtime_commands.py +2 -0
- {koder-0.5.3 → koder-0.5.4}/koder_agent/harness/commands/interactive.py +271 -3
- koder-0.5.4/koder_agent/harness/cron/expression.py +152 -0
- koder-0.5.4/koder_agent/harness/cron/loop.py +170 -0
- koder-0.5.4/koder_agent/harness/cron/runtime.py +116 -0
- koder-0.5.4/koder_agent/harness/cron/scheduler.py +121 -0
- {koder-0.5.3 → koder-0.5.4}/koder_agent/harness/cron/storage.py +16 -0
- {koder-0.5.3 → koder-0.5.4}/koder_agent/harness/hooks/runtime.py +5 -1
- {koder-0.5.3 → koder-0.5.4}/koder_agent/harness/memory/compact.py +1 -1
- {koder-0.5.3 → koder-0.5.4}/koder_agent/harness/memory/post_compact.py +7 -0
- {koder-0.5.3 → koder-0.5.4}/koder_agent/harness/onboarding.py +4 -1
- {koder-0.5.3 → koder-0.5.4}/koder_agent/harness/pr_status.py +1 -1
- {koder-0.5.3 → koder-0.5.4}/koder_agent/harness/session_flow.py +48 -10
- {koder-0.5.3 → koder-0.5.4}/koder_agent/harness/skills/bundled.py +4 -2
- {koder-0.5.3 → koder-0.5.4}/koder_agent/harness/statusline_setup.py +4 -0
- {koder-0.5.3 → koder-0.5.4}/koder_agent/mcp/oauth.py +3 -2
- {koder-0.5.3 → koder-0.5.4}/koder_agent/mcp/server_factory.py +2 -2
- {koder-0.5.3 → koder-0.5.4}/koder_agent/mcp/server_manager.py +82 -40
- {koder-0.5.3 → koder-0.5.4}/koder_agent/tools/__init__.py +8 -35
- {koder-0.5.3 → koder-0.5.4}/koder_agent/tools/agent.py +4 -2
- koder-0.5.4/koder_agent/tools/compat.py +102 -0
- {koder-0.5.3 → koder-0.5.4}/koder_agent/tools/cron.py +10 -52
- koder-0.5.4/koder_agent/tools/engine.py +30 -0
- {koder-0.5.3 → koder-0.5.4}/koder_agent/tools/file.py +3 -1
- koder-0.5.4/koder_agent/tools/goal.py +210 -0
- koder-0.5.4/koder_agent/tools/permission_context.py +171 -0
- {koder-0.5.3 → koder-0.5.4}/koder_agent/tools/shell.py +31 -5
- {koder-0.5.3 → koder-0.5.4}/koder_agent/tools/skill.py +148 -17
- {koder-0.5.3 → koder-0.5.4}/koder_agent/tools/skill_context.py +8 -2
- {koder-0.5.3 → koder-0.5.4}/koder_agent/utils/client.py +78 -9
- {koder-0.5.3 → koder-0.5.4}/koder_agent/utils/prompts.py +1 -1
- {koder-0.5.3 → koder-0.5.4}/koder_agent/utils/sessions.py +4 -0
- {koder-0.5.3 → koder-0.5.4}/koder_agent/utils/terminal_theme.py +9 -0
- {koder-0.5.3 → koder-0.5.4}/pyproject.toml +17 -17
- koder-0.5.3/koder_agent/harness/cron/scheduler.py +0 -140
- koder-0.5.3/koder_agent/tools/compat.py +0 -44
- koder-0.5.3/koder_agent/tools/engine.py +0 -165
- {koder-0.5.3 → koder-0.5.4}/.claude/settings.local.json +0 -0
- {koder-0.5.3 → koder-0.5.4}/.gitignore +0 -0
- {koder-0.5.3 → koder-0.5.4}/LICENSE +0 -0
- {koder-0.5.3 → koder-0.5.4}/koder_agent/__init__.py +0 -0
- {koder-0.5.3 → koder-0.5.4}/koder_agent/agentic/__init__.py +0 -0
- {koder-0.5.3 → koder-0.5.4}/koder_agent/agentic/api_errors.py +0 -0
- {koder-0.5.3 → koder-0.5.4}/koder_agent/agentic/hook_guardrail.py +0 -0
- {koder-0.5.3 → koder-0.5.4}/koder_agent/agentic/hooks.py +0 -0
- {koder-0.5.3 → koder-0.5.4}/koder_agent/agentic/plan_guardrail.py +0 -0
- {koder-0.5.3 → koder-0.5.4}/koder_agent/agentic/skill_guardrail.py +0 -0
- {koder-0.5.3 → koder-0.5.4}/koder_agent/auth/__init__.py +0 -0
- {koder-0.5.3 → koder-0.5.4}/koder_agent/auth/base.py +0 -0
- {koder-0.5.3 → koder-0.5.4}/koder_agent/auth/callback_server.py +0 -0
- {koder-0.5.3 → koder-0.5.4}/koder_agent/auth/client_integration.py +0 -0
- {koder-0.5.3 → koder-0.5.4}/koder_agent/auth/constants.py +0 -0
- {koder-0.5.3 → koder-0.5.4}/koder_agent/auth/litellm_oauth.py +0 -0
- {koder-0.5.3 → koder-0.5.4}/koder_agent/auth/providers/__init__.py +0 -0
- {koder-0.5.3 → koder-0.5.4}/koder_agent/auth/secure_storage.py +0 -0
- {koder-0.5.3 → koder-0.5.4}/koder_agent/auth/token_storage.py +0 -0
- {koder-0.5.3 → koder-0.5.4}/koder_agent/cli.py +0 -0
- {koder-0.5.3 → koder-0.5.4}/koder_agent/config/__init__.py +0 -0
- {koder-0.5.3 → koder-0.5.4}/koder_agent/config/manager.py +0 -0
- {koder-0.5.3 → koder-0.5.4}/koder_agent/core/__init__.py +0 -0
- {koder-0.5.3 → koder-0.5.4}/koder_agent/core/at_completer.py +0 -0
- {koder-0.5.3 → koder-0.5.4}/koder_agent/core/at_mentions.py +0 -0
- {koder-0.5.3 → koder-0.5.4}/koder_agent/core/auto_suggest.py +0 -0
- {koder-0.5.3 → koder-0.5.4}/koder_agent/core/keybindings.py +0 -0
- {koder-0.5.3 → koder-0.5.4}/koder_agent/core/keyboard_listener.py +0 -0
- {koder-0.5.3 → koder-0.5.4}/koder_agent/core/notifications.py +0 -0
- {koder-0.5.3 → koder-0.5.4}/koder_agent/core/security.py +0 -0
- {koder-0.5.3 → koder-0.5.4}/koder_agent/core/shell_completer.py +0 -0
- {koder-0.5.3 → koder-0.5.4}/koder_agent/core/skill_usage.py +0 -0
- {koder-0.5.3 → koder-0.5.4}/koder_agent/core/status_line.py +0 -0
- {koder-0.5.3 → koder-0.5.4}/koder_agent/core/terminal_reflow.py +0 -0
- {koder-0.5.3 → koder-0.5.4}/koder_agent/core/vim_mode.py +0 -0
- {koder-0.5.3 → koder-0.5.4}/koder_agent/data/__init__.py +0 -0
- {koder-0.5.3 → koder-0.5.4}/koder_agent/harness/__init__.py +0 -0
- {koder-0.5.3 → koder-0.5.4}/koder_agent/harness/add_dir_validation.py +0 -0
- {koder-0.5.3 → koder-0.5.4}/koder_agent/harness/agents/__init__.py +0 -0
- {koder-0.5.3 → koder-0.5.4}/koder_agent/harness/agents/commands.py +0 -0
- {koder-0.5.3 → koder-0.5.4}/koder_agent/harness/agents/definitions.py +0 -0
- {koder-0.5.3 → koder-0.5.4}/koder_agent/harness/agents/hooks.py +0 -0
- {koder-0.5.3 → koder-0.5.4}/koder_agent/harness/agents/messages.py +0 -0
- {koder-0.5.3 → koder-0.5.4}/koder_agent/harness/agents/models.py +0 -0
- {koder-0.5.3 → koder-0.5.4}/koder_agent/harness/agents/summary.py +0 -0
- {koder-0.5.3 → koder-0.5.4}/koder_agent/harness/agents/teams/__init__.py +0 -0
- {koder-0.5.3 → koder-0.5.4}/koder_agent/harness/agents/teams/context.py +0 -0
- {koder-0.5.3 → koder-0.5.4}/koder_agent/harness/agents/teams/in_process.py +0 -0
- {koder-0.5.3 → koder-0.5.4}/koder_agent/harness/agents/teams/memory_sync.py +0 -0
- {koder-0.5.3 → koder-0.5.4}/koder_agent/harness/agents/teams/models.py +0 -0
- {koder-0.5.3 → koder-0.5.4}/koder_agent/harness/agents/teams/permission_bridge.py +0 -0
- {koder-0.5.3 → koder-0.5.4}/koder_agent/harness/agents/teams/routing.py +0 -0
- {koder-0.5.3 → koder-0.5.4}/koder_agent/harness/agents/teams/runtime.py +0 -0
- {koder-0.5.3 → koder-0.5.4}/koder_agent/harness/agents/teams/service.py +0 -0
- {koder-0.5.3 → koder-0.5.4}/koder_agent/harness/agents/teams/task_service.py +0 -0
- {koder-0.5.3 → koder-0.5.4}/koder_agent/harness/agents/teams/tmux_backend.py +0 -0
- {koder-0.5.3 → koder-0.5.4}/koder_agent/harness/auth/__init__.py +0 -0
- {koder-0.5.3 → koder-0.5.4}/koder_agent/harness/bootstrap.py +0 -0
- {koder-0.5.3 → koder-0.5.4}/koder_agent/harness/buddy.py +0 -0
- {koder-0.5.3 → koder-0.5.4}/koder_agent/harness/channels/__init__.py +0 -0
- {koder-0.5.3 → koder-0.5.4}/koder_agent/harness/channels/gate.py +0 -0
- {koder-0.5.3 → koder-0.5.4}/koder_agent/harness/channels/interceptor.py +0 -0
- {koder-0.5.3 → koder-0.5.4}/koder_agent/harness/channels/notification.py +0 -0
- {koder-0.5.3 → koder-0.5.4}/koder_agent/harness/channels/permissions.py +0 -0
- {koder-0.5.3 → koder-0.5.4}/koder_agent/harness/channels/state.py +0 -0
- {koder-0.5.3 → koder-0.5.4}/koder_agent/harness/channels/types.py +0 -0
- {koder-0.5.3 → koder-0.5.4}/koder_agent/harness/cli/__init__.py +0 -0
- {koder-0.5.3 → koder-0.5.4}/koder_agent/harness/cli/entrypoint.py +0 -0
- {koder-0.5.3 → koder-0.5.4}/koder_agent/harness/code_intelligence.py +0 -0
- {koder-0.5.3 → koder-0.5.4}/koder_agent/harness/commands/__init__.py +0 -0
- {koder-0.5.3 → koder-0.5.4}/koder_agent/harness/commands/advisor.py +0 -0
- {koder-0.5.3 → koder-0.5.4}/koder_agent/harness/commands/agents_view.py +0 -0
- {koder-0.5.3 → koder-0.5.4}/koder_agent/harness/commands/brief.py +0 -0
- {koder-0.5.3 → koder-0.5.4}/koder_agent/harness/commands/buddy.py +0 -0
- {koder-0.5.3 → koder-0.5.4}/koder_agent/harness/commands/builtins/__init__.py +0 -0
- {koder-0.5.3 → koder-0.5.4}/koder_agent/harness/commands/builtins/config_commands.py +0 -0
- {koder-0.5.3 → koder-0.5.4}/koder_agent/harness/commands/builtins/inspection_commands.py +0 -0
- {koder-0.5.3 → koder-0.5.4}/koder_agent/harness/commands/builtins/plugin_commands.py +0 -0
- {koder-0.5.3 → koder-0.5.4}/koder_agent/harness/commands/builtins/session_commands.py +0 -0
- {koder-0.5.3 → koder-0.5.4}/koder_agent/harness/commands/builtins/workflow_review_commands.py +0 -0
- {koder-0.5.3 → koder-0.5.4}/koder_agent/harness/commands/builtins/workflow_state_commands.py +0 -0
- {koder-0.5.3 → koder-0.5.4}/koder_agent/harness/commands/internal/__init__.py +0 -0
- {koder-0.5.3 → koder-0.5.4}/koder_agent/harness/commands/internal/debug_commands.py +0 -0
- {koder-0.5.3 → koder-0.5.4}/koder_agent/harness/commands/internal/diagnostic_commands.py +0 -0
- {koder-0.5.3 → koder-0.5.4}/koder_agent/harness/commands/pr_comments.py +0 -0
- {koder-0.5.3 → koder-0.5.4}/koder_agent/harness/commands/registry.py +0 -0
- {koder-0.5.3 → koder-0.5.4}/koder_agent/harness/commands/review_context.py +0 -0
- {koder-0.5.3 → koder-0.5.4}/koder_agent/harness/commands/security_review.py +0 -0
- {koder-0.5.3 → koder-0.5.4}/koder_agent/harness/commands/workflow_helpers.py +0 -0
- {koder-0.5.3 → koder-0.5.4}/koder_agent/harness/config/__init__.py +0 -0
- {koder-0.5.3 → koder-0.5.4}/koder_agent/harness/config/backup.py +0 -0
- {koder-0.5.3 → koder-0.5.4}/koder_agent/harness/config/commands.py +0 -0
- {koder-0.5.3 → koder-0.5.4}/koder_agent/harness/config/migration.py +0 -0
- {koder-0.5.3 → koder-0.5.4}/koder_agent/harness/config/schema.py +0 -0
- {koder-0.5.3 → koder-0.5.4}/koder_agent/harness/config/service.py +0 -0
- {koder-0.5.3 → koder-0.5.4}/koder_agent/harness/config/settings_bundle.py +0 -0
- {koder-0.5.3 → koder-0.5.4}/koder_agent/harness/cron/__init__.py +0 -0
- {koder-0.5.3 → koder-0.5.4}/koder_agent/harness/github_actions.py +0 -0
- {koder-0.5.3 → koder-0.5.4}/koder_agent/harness/ide.py +0 -0
- {koder-0.5.3 → koder-0.5.4}/koder_agent/harness/magic_docs.py +0 -0
- {koder-0.5.3 → koder-0.5.4}/koder_agent/harness/managed_settings.py +0 -0
- {koder-0.5.3 → koder-0.5.4}/koder_agent/harness/mcp/__init__.py +0 -0
- {koder-0.5.3 → koder-0.5.4}/koder_agent/harness/mcp/commands.py +0 -0
- {koder-0.5.3 → koder-0.5.4}/koder_agent/harness/memory/__init__.py +0 -0
- {koder-0.5.3 → koder-0.5.4}/koder_agent/harness/memory/auto_compact.py +0 -0
- {koder-0.5.3 → koder-0.5.4}/koder_agent/harness/memory/auto_dream.py +0 -0
- {koder-0.5.3 → koder-0.5.4}/koder_agent/harness/memory/budget.py +0 -0
- {koder-0.5.3 → koder-0.5.4}/koder_agent/harness/memory/extraction.py +0 -0
- {koder-0.5.3 → koder-0.5.4}/koder_agent/harness/memory/legacy_db.py +0 -0
- {koder-0.5.3 → koder-0.5.4}/koder_agent/harness/memory/memory_files.py +0 -0
- {koder-0.5.3 → koder-0.5.4}/koder_agent/harness/memory/micro_compact.py +0 -0
- {koder-0.5.3 → koder-0.5.4}/koder_agent/harness/memory/models.py +0 -0
- {koder-0.5.3 → koder-0.5.4}/koder_agent/harness/memory/pruning.py +0 -0
- {koder-0.5.3 → koder-0.5.4}/koder_agent/harness/memory/recovery.py +0 -0
- {koder-0.5.3 → koder-0.5.4}/koder_agent/harness/memory/retrieval.py +0 -0
- {koder-0.5.3 → koder-0.5.4}/koder_agent/harness/memory/session_memory.py +0 -0
- {koder-0.5.3 → koder-0.5.4}/koder_agent/harness/memory/transcript_store.py +0 -0
- {koder-0.5.3 → koder-0.5.4}/koder_agent/harness/memory/writer_lock.py +0 -0
- {koder-0.5.3 → koder-0.5.4}/koder_agent/harness/paths.py +0 -0
- {koder-0.5.3 → koder-0.5.4}/koder_agent/harness/permissions/__init__.py +0 -0
- {koder-0.5.3 → koder-0.5.4}/koder_agent/harness/permissions/ai_classifier.py +0 -0
- {koder-0.5.3 → koder-0.5.4}/koder_agent/harness/permissions/denial_log.py +0 -0
- {koder-0.5.3 → koder-0.5.4}/koder_agent/harness/permissions/modes.py +0 -0
- {koder-0.5.3 → koder-0.5.4}/koder_agent/harness/permissions/path_policy.py +0 -0
- {koder-0.5.3 → koder-0.5.4}/koder_agent/harness/permissions/persistence.py +0 -0
- {koder-0.5.3 → koder-0.5.4}/koder_agent/harness/permissions/powershell_classifier.py +0 -0
- {koder-0.5.3 → koder-0.5.4}/koder_agent/harness/permissions/propagation.py +0 -0
- {koder-0.5.3 → koder-0.5.4}/koder_agent/harness/permissions/results.py +0 -0
- {koder-0.5.3 → koder-0.5.4}/koder_agent/harness/permissions/rule_sources.py +0 -0
- {koder-0.5.3 → koder-0.5.4}/koder_agent/harness/permissions/rules.py +0 -0
- {koder-0.5.3 → koder-0.5.4}/koder_agent/harness/permissions/service.py +0 -0
- {koder-0.5.3 → koder-0.5.4}/koder_agent/harness/permissions/shell_classifier.py +0 -0
- {koder-0.5.3 → koder-0.5.4}/koder_agent/harness/plan/__init__.py +0 -0
- {koder-0.5.3 → koder-0.5.4}/koder_agent/harness/plan/mode.py +0 -0
- {koder-0.5.3 → koder-0.5.4}/koder_agent/harness/plugins/__init__.py +0 -0
- {koder-0.5.3 → koder-0.5.4}/koder_agent/harness/plugins/catalog.py +0 -0
- {koder-0.5.3 → koder-0.5.4}/koder_agent/harness/plugins/commands.py +0 -0
- {koder-0.5.3 → koder-0.5.4}/koder_agent/harness/plugins/env.py +0 -0
- {koder-0.5.3 → koder-0.5.4}/koder_agent/harness/plugins/lifecycle.py +0 -0
- {koder-0.5.3 → koder-0.5.4}/koder_agent/harness/plugins/manifest.py +0 -0
- {koder-0.5.3 → koder-0.5.4}/koder_agent/harness/plugins/marketplace.py +0 -0
- {koder-0.5.3 → koder-0.5.4}/koder_agent/harness/plugins/name_validation.py +0 -0
- {koder-0.5.3 → koder-0.5.4}/koder_agent/harness/plugins/options.py +0 -0
- {koder-0.5.3 → koder-0.5.4}/koder_agent/harness/plugins/registry.py +0 -0
- {koder-0.5.3 → koder-0.5.4}/koder_agent/harness/plugins/session_root.py +0 -0
- {koder-0.5.3 → koder-0.5.4}/koder_agent/harness/plugins/state.py +0 -0
- {koder-0.5.3 → koder-0.5.4}/koder_agent/harness/plugins/validator.py +0 -0
- {koder-0.5.3 → koder-0.5.4}/koder_agent/harness/policy_limits.py +0 -0
- {koder-0.5.3 → koder-0.5.4}/koder_agent/harness/prompt_suggestion.py +0 -0
- {koder-0.5.3 → koder-0.5.4}/koder_agent/harness/reasoning_display.py +0 -0
- {koder-0.5.3 → koder-0.5.4}/koder_agent/harness/release_notes.py +0 -0
- {koder-0.5.3 → koder-0.5.4}/koder_agent/harness/runtime.py +0 -0
- {koder-0.5.3 → koder-0.5.4}/koder_agent/harness/sandbox/__init__.py +0 -0
- {koder-0.5.3 → koder-0.5.4}/koder_agent/harness/sandbox/backend.py +0 -0
- {koder-0.5.3 → koder-0.5.4}/koder_agent/harness/sandbox/policy.py +0 -0
- {koder-0.5.3 → koder-0.5.4}/koder_agent/harness/sandbox/registry.py +0 -0
- {koder-0.5.3 → koder-0.5.4}/koder_agent/harness/sandbox/sdk_backend.py +0 -0
- {koder-0.5.3 → koder-0.5.4}/koder_agent/harness/sandbox/smoke.py +0 -0
- {koder-0.5.3 → koder-0.5.4}/koder_agent/harness/sandbox/workspace.py +0 -0
- {koder-0.5.3 → koder-0.5.4}/koder_agent/harness/sandbox_settings.py +0 -0
- {koder-0.5.3 → koder-0.5.4}/koder_agent/harness/session_env.py +0 -0
- {koder-0.5.3 → koder-0.5.4}/koder_agent/harness/skills/discovery.py +0 -0
- {koder-0.5.3 → koder-0.5.4}/koder_agent/harness/state/__init__.py +0 -0
- {koder-0.5.3 → koder-0.5.4}/koder_agent/harness/state/actions.py +0 -0
- {koder-0.5.3 → koder-0.5.4}/koder_agent/harness/state/models.py +0 -0
- {koder-0.5.3 → koder-0.5.4}/koder_agent/harness/state/selectors.py +0 -0
- {koder-0.5.3 → koder-0.5.4}/koder_agent/harness/state/store.py +0 -0
- {koder-0.5.3 → koder-0.5.4}/koder_agent/harness/statusline_settings.py +0 -0
- {koder-0.5.3 → koder-0.5.4}/koder_agent/harness/tasks/__init__.py +0 -0
- {koder-0.5.3 → koder-0.5.4}/koder_agent/harness/tasks/models.py +0 -0
- {koder-0.5.3 → koder-0.5.4}/koder_agent/harness/tasks/output.py +0 -0
- {koder-0.5.3 → koder-0.5.4}/koder_agent/harness/tasks/service.py +0 -0
- {koder-0.5.3 → koder-0.5.4}/koder_agent/harness/tasks/storage.py +0 -0
- {koder-0.5.3 → koder-0.5.4}/koder_agent/harness/tips.py +0 -0
- {koder-0.5.3 → koder-0.5.4}/koder_agent/harness/tools/__init__.py +0 -0
- {koder-0.5.3 → koder-0.5.4}/koder_agent/harness/tools/code_intelligence_ops.py +0 -0
- {koder-0.5.3 → koder-0.5.4}/koder_agent/harness/tools/file_ops.py +0 -0
- {koder-0.5.3 → koder-0.5.4}/koder_agent/harness/tools/mcp_ops.py +0 -0
- {koder-0.5.3 → koder-0.5.4}/koder_agent/harness/tools/registry.py +0 -0
- {koder-0.5.3 → koder-0.5.4}/koder_agent/harness/tools/search_ops.py +0 -0
- {koder-0.5.3 → koder-0.5.4}/koder_agent/harness/tools/shell.py +0 -0
- {koder-0.5.3 → koder-0.5.4}/koder_agent/harness/tools/shell_executor.py +0 -0
- {koder-0.5.3 → koder-0.5.4}/koder_agent/harness/tools/web_ops.py +0 -0
- {koder-0.5.3 → koder-0.5.4}/koder_agent/harness/ui/__init__.py +0 -0
- {koder-0.5.3 → koder-0.5.4}/koder_agent/harness/ui/app.py +0 -0
- {koder-0.5.3 → koder-0.5.4}/koder_agent/harness/ui/permissions/__init__.py +0 -0
- {koder-0.5.3 → koder-0.5.4}/koder_agent/harness/ui/permissions/dialog.py +0 -0
- {koder-0.5.3 → koder-0.5.4}/koder_agent/harness/ui/screens/__init__.py +0 -0
- {koder-0.5.3 → koder-0.5.4}/koder_agent/harness/ui/screens/main.py +0 -0
- {koder-0.5.3 → koder-0.5.4}/koder_agent/harness/ui/screens/plugins.py +0 -0
- {koder-0.5.3 → koder-0.5.4}/koder_agent/harness/ui/widgets/__init__.py +0 -0
- {koder-0.5.3 → koder-0.5.4}/koder_agent/harness/ui/widgets/prompt_buffer.py +0 -0
- {koder-0.5.3 → koder-0.5.4}/koder_agent/harness/ui/widgets/status_line.py +0 -0
- {koder-0.5.3 → koder-0.5.4}/koder_agent/harness/version_info.py +0 -0
- {koder-0.5.3 → koder-0.5.4}/koder_agent/harness/voice/__init__.py +0 -0
- {koder-0.5.3 → koder-0.5.4}/koder_agent/harness/voice/keyterms.py +0 -0
- {koder-0.5.3 → koder-0.5.4}/koder_agent/harness/voice/service.py +0 -0
- {koder-0.5.3 → koder-0.5.4}/koder_agent/harness/worktree/__init__.py +0 -0
- {koder-0.5.3 → koder-0.5.4}/koder_agent/harness/worktree/conflicts.py +0 -0
- {koder-0.5.3 → koder-0.5.4}/koder_agent/harness/worktree/service.py +0 -0
- {koder-0.5.3 → koder-0.5.4}/koder_agent/litellm_cost_map.py +0 -0
- {koder-0.5.3 → koder-0.5.4}/koder_agent/mcp/__init__.py +0 -0
- {koder-0.5.3 → koder-0.5.4}/koder_agent/mcp/elicitation.py +0 -0
- {koder-0.5.3 → koder-0.5.4}/koder_agent/mcp/limits.py +0 -0
- {koder-0.5.3 → koder-0.5.4}/koder_agent/mcp/notifications.py +0 -0
- {koder-0.5.3 → koder-0.5.4}/koder_agent/mcp/project_approvals.py +0 -0
- {koder-0.5.3 → koder-0.5.4}/koder_agent/mcp/prompts.py +0 -0
- {koder-0.5.3 → koder-0.5.4}/koder_agent/mcp/reconnection.py +0 -0
- {koder-0.5.3 → koder-0.5.4}/koder_agent/mcp/serve.py +0 -0
- {koder-0.5.3 → koder-0.5.4}/koder_agent/mcp/server_config.py +0 -0
- {koder-0.5.3 → koder-0.5.4}/koder_agent/providers/__init__.py +0 -0
- {koder-0.5.3 → koder-0.5.4}/koder_agent/providers/compat.py +0 -0
- {koder-0.5.3 → koder-0.5.4}/koder_agent/providers/models.py +0 -0
- {koder-0.5.3 → koder-0.5.4}/koder_agent/tools/ask_user.py +0 -0
- {koder-0.5.3 → koder-0.5.4}/koder_agent/tools/code_intelligence.py +0 -0
- {koder-0.5.3 → koder-0.5.4}/koder_agent/tools/config_tool.py +0 -0
- {koder-0.5.3 → koder-0.5.4}/koder_agent/tools/file_state.py +0 -0
- {koder-0.5.3 → koder-0.5.4}/koder_agent/tools/fork_agent.py +0 -0
- {koder-0.5.3 → koder-0.5.4}/koder_agent/tools/mcp_resource.py +0 -0
- {koder-0.5.3 → koder-0.5.4}/koder_agent/tools/notebook_edit.py +0 -0
- {koder-0.5.3 → koder-0.5.4}/koder_agent/tools/orchestration.py +0 -0
- {koder-0.5.3 → koder-0.5.4}/koder_agent/tools/plan_mode.py +0 -0
- {koder-0.5.3 → koder-0.5.4}/koder_agent/tools/powershell.py +0 -0
- {koder-0.5.3 → koder-0.5.4}/koder_agent/tools/search.py +0 -0
- {koder-0.5.3 → koder-0.5.4}/koder_agent/tools/send_message.py +0 -0
- {koder-0.5.3 → koder-0.5.4}/koder_agent/tools/sleep.py +0 -0
- {koder-0.5.3 → koder-0.5.4}/koder_agent/tools/structured_output.py +0 -0
- {koder-0.5.3 → koder-0.5.4}/koder_agent/tools/task.py +0 -0
- {koder-0.5.3 → koder-0.5.4}/koder_agent/tools/task_lifecycle.py +0 -0
- {koder-0.5.3 → koder-0.5.4}/koder_agent/tools/task_output.py +0 -0
- {koder-0.5.3 → koder-0.5.4}/koder_agent/tools/task_stop.py +0 -0
- {koder-0.5.3 → koder-0.5.4}/koder_agent/tools/team.py +0 -0
- {koder-0.5.3 → koder-0.5.4}/koder_agent/tools/todo.py +0 -0
- {koder-0.5.3 → koder-0.5.4}/koder_agent/tools/tool_search.py +0 -0
- {koder-0.5.3 → koder-0.5.4}/koder_agent/tools/web.py +0 -0
- {koder-0.5.3 → koder-0.5.4}/koder_agent/tools/worktree.py +0 -0
- {koder-0.5.3 → koder-0.5.4}/koder_agent/utils/__init__.py +0 -0
- {koder-0.5.3 → koder-0.5.4}/koder_agent/utils/model_deprecation.py +0 -0
- {koder-0.5.3 → koder-0.5.4}/koder_agent/utils/model_info.py +0 -0
- {koder-0.5.3 → koder-0.5.4}/koder_agent/utils/queue.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: koder
|
|
3
|
-
Version: 0.5.
|
|
3
|
+
Version: 0.5.4
|
|
4
4
|
Summary: An intuitive AI coding assistant and interactive CLI tool that boosts developer productivity with intelligent automation and context-aware support.
|
|
5
5
|
Project-URL: Homepage, https://github.com/feiskyer/koder
|
|
6
6
|
Project-URL: Repository, https://github.com/feiskyer/koder
|
|
@@ -9,37 +9,37 @@ License-File: LICENSE
|
|
|
9
9
|
Keywords: agent,agentic,ai,copilot,litellm,openai,vibe coding
|
|
10
10
|
Requires-Python: >=3.10
|
|
11
11
|
Requires-Dist: aiosqlite>=0.22.1
|
|
12
|
-
Requires-Dist: anthropic>=0.
|
|
13
|
-
Requires-Dist: apscheduler>=3.11.
|
|
12
|
+
Requires-Dist: anthropic>=0.116.0
|
|
13
|
+
Requires-Dist: apscheduler>=3.11.3
|
|
14
14
|
Requires-Dist: backoff>=2.2.1
|
|
15
|
-
Requires-Dist: beautifulsoup4>=4.
|
|
16
|
-
Requires-Dist: boto3>=1.43.
|
|
17
|
-
Requires-Dist: cryptography>=
|
|
15
|
+
Requires-Dist: beautifulsoup4>=4.15.0
|
|
16
|
+
Requires-Dist: boto3>=1.43.40
|
|
17
|
+
Requires-Dist: cryptography>=49.0.0
|
|
18
18
|
Requires-Dist: ddgs>=9.14.4
|
|
19
19
|
Requires-Dist: docker>=7.1.0
|
|
20
|
-
Requires-Dist: e2b-code-interpreter>=2.
|
|
21
|
-
Requires-Dist: e2b>=2.
|
|
22
|
-
Requires-Dist: fastapi-sso>=0.21.
|
|
23
|
-
Requires-Dist: fastapi>=0.
|
|
24
|
-
Requires-Dist: google-cloud-aiplatform>=1.
|
|
20
|
+
Requires-Dist: e2b-code-interpreter>=2.8.1
|
|
21
|
+
Requires-Dist: e2b>=2.30.0
|
|
22
|
+
Requires-Dist: fastapi-sso>=0.21.1
|
|
23
|
+
Requires-Dist: fastapi>=0.139.0
|
|
24
|
+
Requires-Dist: google-cloud-aiplatform>=1.159.0
|
|
25
25
|
Requires-Dist: httpx[socks]>=0.28.1
|
|
26
26
|
Requires-Dist: jsonschema>=4.26.0
|
|
27
|
-
Requires-Dist: litellm>=1.
|
|
28
|
-
Requires-Dist: modal>=1.
|
|
29
|
-
Requires-Dist: openai-agents[litellm]>=0.17.
|
|
30
|
-
Requires-Dist: openai==2.
|
|
27
|
+
Requires-Dist: litellm>=1.90.2
|
|
28
|
+
Requires-Dist: modal>=1.5.1
|
|
29
|
+
Requires-Dist: openai-agents[litellm]>=0.17.7
|
|
30
|
+
Requires-Dist: openai==2.44.0
|
|
31
31
|
Requires-Dist: orjson>=3.11.9
|
|
32
32
|
Requires-Dist: prompt-toolkit>=3.0.52
|
|
33
33
|
Requires-Dist: pydantic>=2.13.4
|
|
34
34
|
Requires-Dist: pyjwt>=2.13.0
|
|
35
35
|
Requires-Dist: pynacl>=1.6.2
|
|
36
|
-
Requires-Dist: python-multipart>=0.0.
|
|
36
|
+
Requires-Dist: python-multipart>=0.0.32
|
|
37
37
|
Requires-Dist: pyyaml>=6.0.3
|
|
38
38
|
Requires-Dist: requests>=2.34.2
|
|
39
39
|
Requires-Dist: rich>=15.0.0
|
|
40
40
|
Requires-Dist: sounddevice>=0.5.5
|
|
41
41
|
Requires-Dist: tiktoken>=0.13.0
|
|
42
|
-
Requires-Dist: vercel>=0.
|
|
42
|
+
Requires-Dist: vercel>=0.6.0
|
|
43
43
|
Requires-Dist: websockets>=16.0
|
|
44
44
|
Requires-Dist: whatthepatch>=1.0.7
|
|
45
45
|
Description-Content-Type: text/markdown
|
|
@@ -52,7 +52,7 @@ Description-Content-Type: text/markdown
|
|
|
52
52
|
[](https://github.com/psf/black)
|
|
53
53
|
[](https://github.com/astral-sh/ruff)
|
|
54
54
|
|
|
55
|
-
Koder is an experimental, open-source AI coding assistant for the terminal. It combines a streaming TUI, persistent local sessions, repository-aware tools, extensible skills, MCP integrations, sandbox-aware permissions, and multi-agent workflows in one Python runtime.
|
|
55
|
+
Koder is an experimental, open-source AI coding assistant for the terminal. It combines a streaming TUI, persistent local sessions, durable goals and scheduled loops, repository-aware tools, extensible skills, MCP integrations, sandbox-aware permissions, and multi-agent workflows in one Python runtime.
|
|
56
56
|
|
|
57
57
|
Status: Alpha. Koder is a learning-focused project for exploring agentic coding systems. Expect rapid iteration and occasional sharp edges.
|
|
58
58
|
|
|
@@ -73,6 +73,7 @@ Koder is designed for developers who want a local-first coding agent they can in
|
|
|
73
73
|
|
|
74
74
|
- Bring your own model: OpenAI, Anthropic, Google/Gemini, GitHub Copilot, Azure, OAuth-backed subscriptions, OpenRouter, and 100+ LiteLLM providers.
|
|
75
75
|
- Stay in the terminal: use slash commands, file mentions, shell mode, history search, live usage output, and optional voice dictation.
|
|
76
|
+
- Keep long work honest: set session goals with optional token budgets, pause or resume them, and schedule recurring prompts with local cron-backed loops.
|
|
76
77
|
- Keep runtime state local: sessions, transcripts, memories, task records, settings, skills, agents, and team state live under Koder-owned local paths. Model requests still go to the provider you configure.
|
|
77
78
|
- Extend the runtime: add project skills, user skills, plugins, MCP servers, channels, and Magic Docs.
|
|
78
79
|
- Delegate carefully: run background subagents and local teams while the main session stays responsible for integration.
|
|
@@ -86,7 +87,8 @@ Koder is in the same broad family as terminal-first and open-source AI coding ag
|
|
|
86
87
|
|---|---|
|
|
87
88
|
| Provider choice | Universal `KODER_*` variables, provider-specific keys, OAuth-backed subscriptions, custom base URLs, and LiteLLM provider routing. |
|
|
88
89
|
| Terminal ergonomics | A persistent Rich TUI with slash commands, shell mode, file mentions, usage/cost output, voice input, and resume. |
|
|
89
|
-
|
|
|
90
|
+
| Long-running work | Session goals, token budgets, automatic continuation, and cron-backed loop prompts. |
|
|
91
|
+
| Local inspectability | SQLite sessions, local goals, local memory, local settings, local tokens, and documented privacy boundaries. |
|
|
90
92
|
| Extension experiments | Skills, verifier skills, plugins, MCP servers, channels, Magic Docs, and project instructions. |
|
|
91
93
|
| Multi-agent workflows | Background subagents, local teams, tmux teammates, mailbox/task records, and team memory. |
|
|
92
94
|
| Safety research | Permission rules, managed settings, sandbox policy, backend diagnostics, and explicit local/remote data boundaries. |
|
|
@@ -97,9 +99,9 @@ Koder is in the same broad family as terminal-first and open-source AI coding ag
|
|
|
97
99
|
|---|---|
|
|
98
100
|
| Interactive TUI | Streaming output, slash completion, shell mode, file mentions, status line, reverse history search, and multi-line prompts. |
|
|
99
101
|
| Model routing | Universal `KODER_*` variables, provider-specific keys, custom base URLs, reasoning effort, and subscription-backed OAuth providers. |
|
|
100
|
-
| Durable context | SQLite sessions, named sessions, resume, export, compaction, rewind, thinkback, local memories, and AutoDream consolidation. |
|
|
102
|
+
| Durable context | SQLite sessions, named sessions, goals, resume, export, compaction, rewind, thinkback, local memories, and AutoDream consolidation. |
|
|
101
103
|
| Coding tools | File operations, search, shell execution, git helpers, notebooks, web fetch/search, todos, and local code intelligence. |
|
|
102
|
-
| Workflows |
|
|
104
|
+
| Workflows | Goals, scheduled loops, review, security review, advisor, planning, commit readiness, PR comments, GitHub Actions setup, release notes, and verification summaries. |
|
|
103
105
|
| Agents and teams | Project/user agents, `task_delegate`, `/fork`, `/peers`, in-process teammates, tmux teammates, mailbox routing, tasks, and team memory. |
|
|
104
106
|
| Extensions | Skills, verifier skills, plugins, MCP servers, channels, and Magic Docs. |
|
|
105
107
|
| Safety controls | Permission rules, sandbox policy, managed settings, workspace roots, privacy diagnostics, and local storage boundaries. |
|
|
@@ -186,6 +188,7 @@ Review the current diff for correctness and missing verification.
|
|
|
186
188
|
| Review changes | `/diff`, `/review`, `/security-review` |
|
|
187
189
|
| Check usage and cost | `/usage`, `/cost` |
|
|
188
190
|
| Manage agents and teams | `/agents`, `/fork`, `/peers`, `/tasks` |
|
|
191
|
+
| Manage goals and loops | `/goal`, `/loop`, `/schedule` |
|
|
189
192
|
| Manage extensions | `/skills`, `/plugin`, `/mcp`, `/channels` |
|
|
190
193
|
| Manage permissions | `/permissions`, `/sandbox`, `/add-dir` |
|
|
191
194
|
|
|
@@ -198,6 +201,7 @@ Koder is local-first, not offline-only:
|
|
|
198
201
|
- Koder stores product state under `~/.koder/` and project `.koder/` paths by default.
|
|
199
202
|
- Koder does not upload sessions to a Koder-hosted service.
|
|
200
203
|
- Prompts, selected context, and tool results needed for a turn are sent to the model provider you configure.
|
|
204
|
+
- Goals are stored with local session state, and scheduled loop prompts are stored locally before they are run.
|
|
201
205
|
- MCP servers, plugins, shell commands, and teammate processes can access whatever their local permissions allow unless constrained by Koder policy and sandbox settings.
|
|
202
206
|
- OAuth tokens are stored under `~/.koder/tokens/`; avoid committing secrets into project files.
|
|
203
207
|
|
|
@@ -354,8 +358,8 @@ koder_agent/
|
|
|
354
358
|
├── auth/ # OAuth providers, token storage, provider-specific routing
|
|
355
359
|
├── cli.py # Main CLI entry point
|
|
356
360
|
├── config/ # YAML, environment, and settings management
|
|
357
|
-
├── core/ # Scheduler, sessions, streaming, security, TUI prompt
|
|
358
|
-
├── harness/ # Runtime commands, plugins, memory, permissions, teams, UI scaffolding
|
|
361
|
+
├── core/ # Scheduler, sessions, goals, streaming, security, TUI prompt
|
|
362
|
+
├── harness/ # Runtime commands, cron loops, plugins, memory, permissions, teams, UI scaffolding
|
|
359
363
|
├── mcp/ # Model Context Protocol integration
|
|
360
364
|
├── providers/ # Provider routing metadata
|
|
361
365
|
├── tools/ # Tool implementations
|
|
@@ -367,7 +371,7 @@ Runtime flow:
|
|
|
367
371
|
1. `cli.py` parses arguments and builds a runtime request.
|
|
368
372
|
2. `HarnessRuntime` loads permissions and dispatches interactive, prompt, and subcommand modes.
|
|
369
373
|
3. Session flow wires context, hooks, plugins, agents, slash commands, and scheduler execution.
|
|
370
|
-
4. `AgentScheduler` streams model execution and
|
|
374
|
+
4. `AgentScheduler` streams model execution, usage tracking, queued input, and goal continuations.
|
|
371
375
|
5. Tool and permission layers validate file, shell, MCP, skill, and teammate operations.
|
|
372
376
|
6. `EnhancedSQLiteSession` persists transcripts and session metadata in `~/.koder/koder.db`.
|
|
373
377
|
|
|
@@ -398,7 +402,7 @@ uv run pytest -v -k "test_name"
|
|
|
398
402
|
|
|
399
403
|
- API keys should live in environment variables or local user config, not project files.
|
|
400
404
|
- OAuth tokens and cached provider model lists are stored under `~/.koder/tokens/`.
|
|
401
|
-
- Sessions, transcripts, memories, tasks, agents, and teams are stored locally under `~/.koder/` and project `.koder/` paths.
|
|
405
|
+
- Sessions, transcripts, goals, memories, scheduled tasks, agents, and teams are stored locally under `~/.koder/` and project `.koder/` paths.
|
|
402
406
|
- Koder does not upload sessions to a Koder-hosted service. Model requests still go to the provider you configure.
|
|
403
407
|
- Shell, file, MCP, and teammate operations are mediated by local permission and sandbox policy. Foreground shell commands can use a real sandbox backend when `/sandbox status` reports that backend as available.
|
|
404
408
|
|
|
@@ -421,7 +425,7 @@ See [Sandbox Guide](docs/sandbox.md) and [Permissions and Privacy](docs/permissi
|
|
|
421
425
|
- [Getting Started](docs/getting-started.md) - first install, provider setup, and a safe first session
|
|
422
426
|
- [Interactive TUI](docs/interactive-tui.md) - prompt controls, slash commands, mentions, shell mode, and voice input
|
|
423
427
|
- [Configuration Guide](docs/configuration.md) - config files, environment variables, providers, OAuth, and settings bundles
|
|
424
|
-
- [Sessions and Memory](docs/sessions-and-memory.md) - named sessions, resume, compaction, rewind, memory, and local storage
|
|
428
|
+
- [Sessions and Memory](docs/sessions-and-memory.md) - named sessions, goals, scheduled loops, resume, compaction, rewind, memory, and local storage
|
|
425
429
|
- [Agents and Teams](docs/agents-and-teams.md) - background subagents, project agents, teams, teammate modes, and team memory
|
|
426
430
|
- [Workflows](docs/workflows.md) - review, planning, Git, GitHub, release, and verification workflows
|
|
427
431
|
- [Skills, Plugins, and MCP](docs/extensions.md) - extending Koder with skills, plugins, MCP servers, channels, and Magic Docs
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
[](https://github.com/psf/black)
|
|
7
7
|
[](https://github.com/astral-sh/ruff)
|
|
8
8
|
|
|
9
|
-
Koder is an experimental, open-source AI coding assistant for the terminal. It combines a streaming TUI, persistent local sessions, repository-aware tools, extensible skills, MCP integrations, sandbox-aware permissions, and multi-agent workflows in one Python runtime.
|
|
9
|
+
Koder is an experimental, open-source AI coding assistant for the terminal. It combines a streaming TUI, persistent local sessions, durable goals and scheduled loops, repository-aware tools, extensible skills, MCP integrations, sandbox-aware permissions, and multi-agent workflows in one Python runtime.
|
|
10
10
|
|
|
11
11
|
Status: Alpha. Koder is a learning-focused project for exploring agentic coding systems. Expect rapid iteration and occasional sharp edges.
|
|
12
12
|
|
|
@@ -27,6 +27,7 @@ Koder is designed for developers who want a local-first coding agent they can in
|
|
|
27
27
|
|
|
28
28
|
- Bring your own model: OpenAI, Anthropic, Google/Gemini, GitHub Copilot, Azure, OAuth-backed subscriptions, OpenRouter, and 100+ LiteLLM providers.
|
|
29
29
|
- Stay in the terminal: use slash commands, file mentions, shell mode, history search, live usage output, and optional voice dictation.
|
|
30
|
+
- Keep long work honest: set session goals with optional token budgets, pause or resume them, and schedule recurring prompts with local cron-backed loops.
|
|
30
31
|
- Keep runtime state local: sessions, transcripts, memories, task records, settings, skills, agents, and team state live under Koder-owned local paths. Model requests still go to the provider you configure.
|
|
31
32
|
- Extend the runtime: add project skills, user skills, plugins, MCP servers, channels, and Magic Docs.
|
|
32
33
|
- Delegate carefully: run background subagents and local teams while the main session stays responsible for integration.
|
|
@@ -40,7 +41,8 @@ Koder is in the same broad family as terminal-first and open-source AI coding ag
|
|
|
40
41
|
|---|---|
|
|
41
42
|
| Provider choice | Universal `KODER_*` variables, provider-specific keys, OAuth-backed subscriptions, custom base URLs, and LiteLLM provider routing. |
|
|
42
43
|
| Terminal ergonomics | A persistent Rich TUI with slash commands, shell mode, file mentions, usage/cost output, voice input, and resume. |
|
|
43
|
-
|
|
|
44
|
+
| Long-running work | Session goals, token budgets, automatic continuation, and cron-backed loop prompts. |
|
|
45
|
+
| Local inspectability | SQLite sessions, local goals, local memory, local settings, local tokens, and documented privacy boundaries. |
|
|
44
46
|
| Extension experiments | Skills, verifier skills, plugins, MCP servers, channels, Magic Docs, and project instructions. |
|
|
45
47
|
| Multi-agent workflows | Background subagents, local teams, tmux teammates, mailbox/task records, and team memory. |
|
|
46
48
|
| Safety research | Permission rules, managed settings, sandbox policy, backend diagnostics, and explicit local/remote data boundaries. |
|
|
@@ -51,9 +53,9 @@ Koder is in the same broad family as terminal-first and open-source AI coding ag
|
|
|
51
53
|
|---|---|
|
|
52
54
|
| Interactive TUI | Streaming output, slash completion, shell mode, file mentions, status line, reverse history search, and multi-line prompts. |
|
|
53
55
|
| Model routing | Universal `KODER_*` variables, provider-specific keys, custom base URLs, reasoning effort, and subscription-backed OAuth providers. |
|
|
54
|
-
| Durable context | SQLite sessions, named sessions, resume, export, compaction, rewind, thinkback, local memories, and AutoDream consolidation. |
|
|
56
|
+
| Durable context | SQLite sessions, named sessions, goals, resume, export, compaction, rewind, thinkback, local memories, and AutoDream consolidation. |
|
|
55
57
|
| Coding tools | File operations, search, shell execution, git helpers, notebooks, web fetch/search, todos, and local code intelligence. |
|
|
56
|
-
| Workflows |
|
|
58
|
+
| Workflows | Goals, scheduled loops, review, security review, advisor, planning, commit readiness, PR comments, GitHub Actions setup, release notes, and verification summaries. |
|
|
57
59
|
| Agents and teams | Project/user agents, `task_delegate`, `/fork`, `/peers`, in-process teammates, tmux teammates, mailbox routing, tasks, and team memory. |
|
|
58
60
|
| Extensions | Skills, verifier skills, plugins, MCP servers, channels, and Magic Docs. |
|
|
59
61
|
| Safety controls | Permission rules, sandbox policy, managed settings, workspace roots, privacy diagnostics, and local storage boundaries. |
|
|
@@ -140,6 +142,7 @@ Review the current diff for correctness and missing verification.
|
|
|
140
142
|
| Review changes | `/diff`, `/review`, `/security-review` |
|
|
141
143
|
| Check usage and cost | `/usage`, `/cost` |
|
|
142
144
|
| Manage agents and teams | `/agents`, `/fork`, `/peers`, `/tasks` |
|
|
145
|
+
| Manage goals and loops | `/goal`, `/loop`, `/schedule` |
|
|
143
146
|
| Manage extensions | `/skills`, `/plugin`, `/mcp`, `/channels` |
|
|
144
147
|
| Manage permissions | `/permissions`, `/sandbox`, `/add-dir` |
|
|
145
148
|
|
|
@@ -152,6 +155,7 @@ Koder is local-first, not offline-only:
|
|
|
152
155
|
- Koder stores product state under `~/.koder/` and project `.koder/` paths by default.
|
|
153
156
|
- Koder does not upload sessions to a Koder-hosted service.
|
|
154
157
|
- Prompts, selected context, and tool results needed for a turn are sent to the model provider you configure.
|
|
158
|
+
- Goals are stored with local session state, and scheduled loop prompts are stored locally before they are run.
|
|
155
159
|
- MCP servers, plugins, shell commands, and teammate processes can access whatever their local permissions allow unless constrained by Koder policy and sandbox settings.
|
|
156
160
|
- OAuth tokens are stored under `~/.koder/tokens/`; avoid committing secrets into project files.
|
|
157
161
|
|
|
@@ -308,8 +312,8 @@ koder_agent/
|
|
|
308
312
|
├── auth/ # OAuth providers, token storage, provider-specific routing
|
|
309
313
|
├── cli.py # Main CLI entry point
|
|
310
314
|
├── config/ # YAML, environment, and settings management
|
|
311
|
-
├── core/ # Scheduler, sessions, streaming, security, TUI prompt
|
|
312
|
-
├── harness/ # Runtime commands, plugins, memory, permissions, teams, UI scaffolding
|
|
315
|
+
├── core/ # Scheduler, sessions, goals, streaming, security, TUI prompt
|
|
316
|
+
├── harness/ # Runtime commands, cron loops, plugins, memory, permissions, teams, UI scaffolding
|
|
313
317
|
├── mcp/ # Model Context Protocol integration
|
|
314
318
|
├── providers/ # Provider routing metadata
|
|
315
319
|
├── tools/ # Tool implementations
|
|
@@ -321,7 +325,7 @@ Runtime flow:
|
|
|
321
325
|
1. `cli.py` parses arguments and builds a runtime request.
|
|
322
326
|
2. `HarnessRuntime` loads permissions and dispatches interactive, prompt, and subcommand modes.
|
|
323
327
|
3. Session flow wires context, hooks, plugins, agents, slash commands, and scheduler execution.
|
|
324
|
-
4. `AgentScheduler` streams model execution and
|
|
328
|
+
4. `AgentScheduler` streams model execution, usage tracking, queued input, and goal continuations.
|
|
325
329
|
5. Tool and permission layers validate file, shell, MCP, skill, and teammate operations.
|
|
326
330
|
6. `EnhancedSQLiteSession` persists transcripts and session metadata in `~/.koder/koder.db`.
|
|
327
331
|
|
|
@@ -352,7 +356,7 @@ uv run pytest -v -k "test_name"
|
|
|
352
356
|
|
|
353
357
|
- API keys should live in environment variables or local user config, not project files.
|
|
354
358
|
- OAuth tokens and cached provider model lists are stored under `~/.koder/tokens/`.
|
|
355
|
-
- Sessions, transcripts, memories, tasks, agents, and teams are stored locally under `~/.koder/` and project `.koder/` paths.
|
|
359
|
+
- Sessions, transcripts, goals, memories, scheduled tasks, agents, and teams are stored locally under `~/.koder/` and project `.koder/` paths.
|
|
356
360
|
- Koder does not upload sessions to a Koder-hosted service. Model requests still go to the provider you configure.
|
|
357
361
|
- Shell, file, MCP, and teammate operations are mediated by local permission and sandbox policy. Foreground shell commands can use a real sandbox backend when `/sandbox status` reports that backend as available.
|
|
358
362
|
|
|
@@ -375,7 +379,7 @@ See [Sandbox Guide](docs/sandbox.md) and [Permissions and Privacy](docs/permissi
|
|
|
375
379
|
- [Getting Started](docs/getting-started.md) - first install, provider setup, and a safe first session
|
|
376
380
|
- [Interactive TUI](docs/interactive-tui.md) - prompt controls, slash commands, mentions, shell mode, and voice input
|
|
377
381
|
- [Configuration Guide](docs/configuration.md) - config files, environment variables, providers, OAuth, and settings bundles
|
|
378
|
-
- [Sessions and Memory](docs/sessions-and-memory.md) - named sessions, resume, compaction, rewind, memory, and local storage
|
|
382
|
+
- [Sessions and Memory](docs/sessions-and-memory.md) - named sessions, goals, scheduled loops, resume, compaction, rewind, memory, and local storage
|
|
379
383
|
- [Agents and Teams](docs/agents-and-teams.md) - background subagents, project agents, teams, teammate modes, and team memory
|
|
380
384
|
- [Workflows](docs/workflows.md) - review, planning, Git, GitHub, release, and verification workflows
|
|
381
385
|
- [Skills, Plugins, and MCP](docs/extensions.md) - extending Koder with skills, plugins, MCP servers, channels, and Magic Docs
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
"""Agent definitions and hooks for Koder."""
|
|
2
2
|
|
|
3
|
+
import asyncio
|
|
3
4
|
import logging
|
|
4
5
|
import os
|
|
5
6
|
import uuid
|
|
@@ -36,6 +37,18 @@ from ..utils.prompts import KODER_SYSTEM_PROMPT
|
|
|
36
37
|
console = Console()
|
|
37
38
|
logger = logging.getLogger(__name__)
|
|
38
39
|
|
|
40
|
+
# GitHub Copilot spoof headers (shared constant, excludes x-request-id which
|
|
41
|
+
# ideally should rotate per-request).
|
|
42
|
+
GITHUB_COPILOT_HEADERS: dict[str, str] = {
|
|
43
|
+
"copilot-integration-id": "vscode-chat",
|
|
44
|
+
"editor-version": "vscode/1.98.1",
|
|
45
|
+
"editor-plugin-version": "copilot-chat/0.26.7",
|
|
46
|
+
"user-agent": "GitHubCopilotChat/0.26.7",
|
|
47
|
+
"openai-intent": "conversation-panel",
|
|
48
|
+
"x-github-api-version": "2025-04-01",
|
|
49
|
+
"x-vscode-user-agent-library-version": "electron-fetch",
|
|
50
|
+
}
|
|
51
|
+
|
|
39
52
|
|
|
40
53
|
def _log_api_error_on_retry(details):
|
|
41
54
|
"""Log user-friendly error messages before retry attempts.
|
|
@@ -284,45 +297,24 @@ class RetryingLitellmModel(LitellmModel):
|
|
|
284
297
|
response_id=getattr(response, "id", None),
|
|
285
298
|
)
|
|
286
299
|
|
|
287
|
-
|
|
288
|
-
backoff.expo,
|
|
289
|
-
LITELLM_RETRYABLE_ERRORS,
|
|
290
|
-
max_tries=5,
|
|
291
|
-
jitter=backoff.full_jitter,
|
|
292
|
-
on_backoff=_log_api_error_on_retry,
|
|
293
|
-
)
|
|
294
|
-
async def stream_response(
|
|
300
|
+
async def _stream_via_responses_api(
|
|
295
301
|
self,
|
|
296
302
|
system_instructions: str | None,
|
|
297
303
|
input: str | list,
|
|
298
304
|
model_settings: ModelSettings,
|
|
299
|
-
|
|
305
|
+
cleaned_tools: list,
|
|
300
306
|
output_schema,
|
|
301
307
|
handoffs: list,
|
|
302
308
|
tracing,
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
prompt: Any | None
|
|
309
|
+
*,
|
|
310
|
+
previous_response_id: str | None,
|
|
311
|
+
prompt: Any | None,
|
|
306
312
|
):
|
|
307
|
-
|
|
308
|
-
cleaned_tools = self._clean_tools_for_github_copilot(tools)
|
|
309
|
-
|
|
310
|
-
if not self._should_use_responses_api():
|
|
311
|
-
async for chunk in super().stream_response(
|
|
312
|
-
system_instructions,
|
|
313
|
-
input,
|
|
314
|
-
model_settings,
|
|
315
|
-
cleaned_tools,
|
|
316
|
-
output_schema,
|
|
317
|
-
handoffs,
|
|
318
|
-
tracing,
|
|
319
|
-
previous_response_id=previous_response_id,
|
|
320
|
-
conversation_id=conversation_id,
|
|
321
|
-
prompt=prompt,
|
|
322
|
-
):
|
|
323
|
-
yield chunk
|
|
324
|
-
return
|
|
313
|
+
"""Stream via the custom LiteLLM Responses API path.
|
|
325
314
|
|
|
315
|
+
Yields ``TResponseStreamEvent`` objects identical to the original
|
|
316
|
+
implementation. The caller is responsible for retry handling.
|
|
317
|
+
"""
|
|
326
318
|
with generation_span(
|
|
327
319
|
model=str(self.model),
|
|
328
320
|
model_config=model_settings.to_json_dict()
|
|
@@ -381,6 +373,92 @@ class RetryingLitellmModel(LitellmModel):
|
|
|
381
373
|
except Exception:
|
|
382
374
|
pass
|
|
383
375
|
|
|
376
|
+
async def stream_response(
|
|
377
|
+
self,
|
|
378
|
+
system_instructions: str | None,
|
|
379
|
+
input: str | list,
|
|
380
|
+
model_settings: ModelSettings,
|
|
381
|
+
tools: list,
|
|
382
|
+
output_schema,
|
|
383
|
+
handoffs: list,
|
|
384
|
+
tracing,
|
|
385
|
+
previous_response_id: str | None = None,
|
|
386
|
+
conversation_id: str | None = None, # unused for LiteLLM responses
|
|
387
|
+
prompt: Any | None = None,
|
|
388
|
+
):
|
|
389
|
+
"""Stream model output with retry-before-first-chunk semantics.
|
|
390
|
+
|
|
391
|
+
``backoff.on_exception`` cannot wrap an async-generator function: it
|
|
392
|
+
only detects coroutine functions, so for an async generator it would
|
|
393
|
+
return the generator object without ever wrapping the iteration, and
|
|
394
|
+
retries would never fire. Instead we implement the retry loop manually
|
|
395
|
+
here.
|
|
396
|
+
|
|
397
|
+
A retryable error is only retried while NO chunk has been yielded
|
|
398
|
+
downstream yet. Once any chunk has reached the consumer, retrying would
|
|
399
|
+
replay partial output (duplicate tokens), so the error is re-raised
|
|
400
|
+
instead.
|
|
401
|
+
"""
|
|
402
|
+
# Clean tools for GitHub Copilot compatibility
|
|
403
|
+
cleaned_tools = self._clean_tools_for_github_copilot(tools)
|
|
404
|
+
|
|
405
|
+
max_tries = 5
|
|
406
|
+
attempt = 0
|
|
407
|
+
# backoff.expo yields 1, 2, 4, 8, ... seconds; full_jitter randomizes
|
|
408
|
+
# each wait within [0, value]. We mirror that timing manually.
|
|
409
|
+
wait_gen = backoff.expo()
|
|
410
|
+
next(wait_gen) # prime the generator (first value is the base)
|
|
411
|
+
|
|
412
|
+
while True:
|
|
413
|
+
attempt += 1
|
|
414
|
+
yielded_any = False
|
|
415
|
+
try:
|
|
416
|
+
if self._should_use_responses_api():
|
|
417
|
+
source = self._stream_via_responses_api(
|
|
418
|
+
system_instructions,
|
|
419
|
+
input,
|
|
420
|
+
model_settings,
|
|
421
|
+
cleaned_tools,
|
|
422
|
+
output_schema,
|
|
423
|
+
handoffs,
|
|
424
|
+
tracing,
|
|
425
|
+
previous_response_id=previous_response_id,
|
|
426
|
+
prompt=prompt,
|
|
427
|
+
)
|
|
428
|
+
else:
|
|
429
|
+
source = super().stream_response(
|
|
430
|
+
system_instructions,
|
|
431
|
+
input,
|
|
432
|
+
model_settings,
|
|
433
|
+
cleaned_tools,
|
|
434
|
+
output_schema,
|
|
435
|
+
handoffs,
|
|
436
|
+
tracing,
|
|
437
|
+
previous_response_id=previous_response_id,
|
|
438
|
+
conversation_id=conversation_id,
|
|
439
|
+
prompt=prompt,
|
|
440
|
+
)
|
|
441
|
+
|
|
442
|
+
async for chunk in source:
|
|
443
|
+
yielded_any = True
|
|
444
|
+
yield chunk
|
|
445
|
+
return
|
|
446
|
+
except LITELLM_RETRYABLE_ERRORS as exc:
|
|
447
|
+
# Once any chunk has been emitted downstream, a retry would
|
|
448
|
+
# replay partial output. Propagate instead.
|
|
449
|
+
if yielded_any or attempt >= max_tries:
|
|
450
|
+
raise
|
|
451
|
+
_log_api_error_on_retry(
|
|
452
|
+
{
|
|
453
|
+
"exception": exc,
|
|
454
|
+
"tries": attempt,
|
|
455
|
+
"max_tries": max_tries,
|
|
456
|
+
}
|
|
457
|
+
)
|
|
458
|
+
wait = backoff.full_jitter(next(wait_gen))
|
|
459
|
+
await asyncio.sleep(wait)
|
|
460
|
+
continue
|
|
461
|
+
|
|
384
462
|
|
|
385
463
|
def _get_skills_metadata(config) -> str:
|
|
386
464
|
"""Load and return skills metadata from configured directories.
|
|
@@ -464,12 +542,17 @@ async def create_dev_agent(
|
|
|
464
542
|
)
|
|
465
543
|
|
|
466
544
|
all_deferred = list(tools) # Start with regular tools
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
545
|
+
# Start all MCP servers in parallel for faster initialization
|
|
546
|
+
if mcp_servers:
|
|
547
|
+
results = await asyncio.gather(
|
|
548
|
+
*[server.list_tools() for server in mcp_servers], return_exceptions=True
|
|
549
|
+
)
|
|
550
|
+
for server, result in zip(mcp_servers, results):
|
|
551
|
+
if isinstance(result, BaseException):
|
|
552
|
+
server_name = getattr(server, "name", "unknown")
|
|
553
|
+
logger.warning("MCP server '%s' failed to list tools: %s", server_name, result)
|
|
554
|
+
else:
|
|
555
|
+
all_deferred.extend(result)
|
|
473
556
|
_set_deferred_tools(all_deferred if tool_search_mode != "false" else None)
|
|
474
557
|
|
|
475
558
|
model_override_value = None if model_override in (None, "", "inherit") else str(model_override)
|
|
@@ -539,15 +622,14 @@ async def create_dev_agent(
|
|
|
539
622
|
)
|
|
540
623
|
|
|
541
624
|
if "github_copilot" in model_name_str:
|
|
625
|
+
# NOTE: x-request-id is generated once here and reused for all requests
|
|
626
|
+
# in this agent's lifetime. The openai-agents SDK applies extra_headers
|
|
627
|
+
# statically — it does not support per-request dynamic header generation.
|
|
628
|
+
# A truly rotating request id would require SDK-level support (e.g. a
|
|
629
|
+
# callable header factory). This is a known limitation.
|
|
542
630
|
dev_agent.model_settings.extra_headers = {
|
|
543
|
-
|
|
544
|
-
"editor-version": "vscode/1.98.1",
|
|
545
|
-
"editor-plugin-version": "copilot-chat/0.26.7",
|
|
546
|
-
"user-agent": "GitHubCopilotChat/0.26.7",
|
|
547
|
-
"openai-intent": "conversation-panel",
|
|
548
|
-
"x-github-api-version": "2025-04-01",
|
|
631
|
+
**GITHUB_COPILOT_HEADERS,
|
|
549
632
|
"x-request-id": str(uuid.uuid4()),
|
|
550
|
-
"x-vscode-user-agent-library-version": "electron-fetch",
|
|
551
633
|
}
|
|
552
634
|
|
|
553
635
|
# planner.handoffs.append(dev_agent)
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
from __future__ import annotations
|
|
4
4
|
|
|
5
|
+
import json
|
|
5
6
|
import logging
|
|
6
7
|
from pathlib import Path
|
|
7
8
|
from typing import TYPE_CHECKING, Any
|
|
@@ -16,6 +17,20 @@ if TYPE_CHECKING:
|
|
|
16
17
|
logger = logging.getLogger(__name__)
|
|
17
18
|
|
|
18
19
|
|
|
20
|
+
class ToolPermissionError(PermissionError):
|
|
21
|
+
"""Raised by :meth:`ApprovalHooks.on_tool_start` when a tool is denied.
|
|
22
|
+
|
|
23
|
+
A dedicated subclass lets callers (e.g. the scheduler) classify and present
|
|
24
|
+
permission denials distinctly from arbitrary ``PermissionError``s raised by
|
|
25
|
+
tool bodies, without corrupting any run state.
|
|
26
|
+
"""
|
|
27
|
+
|
|
28
|
+
def __init__(self, tool_name: str, reason: str | None):
|
|
29
|
+
self.tool_name = tool_name
|
|
30
|
+
self.reason = reason
|
|
31
|
+
super().__init__(f"Permission denied for {tool_name}: {reason}")
|
|
32
|
+
|
|
33
|
+
|
|
19
34
|
class ApprovalHooks(RunHooks):
|
|
20
35
|
"""RunHooks implementation that checks permissions before tool execution."""
|
|
21
36
|
|
|
@@ -34,9 +49,16 @@ class ApprovalHooks(RunHooks):
|
|
|
34
49
|
"""
|
|
35
50
|
self.wrapped_hooks = wrapped_hooks
|
|
36
51
|
self._permission_service = permission_service
|
|
52
|
+
# Tracks whether the previous agent completion was blocked by a Stop
|
|
53
|
+
# hook. Initialized here (and reset in on_agent_start) so a one-time
|
|
54
|
+
# block cannot permanently wedge the scheduler for its entire lifetime.
|
|
55
|
+
self._stop_hook_active = False
|
|
37
56
|
|
|
38
57
|
async def on_agent_start(self, context: RunContextWrapper, agent: Agent) -> None:
|
|
39
58
|
"""Called before the agent is invoked."""
|
|
59
|
+
# Reset the Stop-hook flag at the start of every agent run so a block
|
|
60
|
+
# from a prior run does not persist across independent runs.
|
|
61
|
+
self._stop_hook_active = False
|
|
40
62
|
if self.wrapped_hooks:
|
|
41
63
|
await self.wrapped_hooks.on_agent_start(context, agent)
|
|
42
64
|
|
|
@@ -52,10 +74,14 @@ class ApprovalHooks(RunHooks):
|
|
|
52
74
|
"event": "Stop",
|
|
53
75
|
"agent_type": getattr(agent, "name", None),
|
|
54
76
|
"last_assistant_message": str(output),
|
|
55
|
-
"stop_hook_active":
|
|
77
|
+
"stop_hook_active": self._stop_hook_active,
|
|
56
78
|
},
|
|
57
79
|
)
|
|
58
80
|
if result.blocked:
|
|
81
|
+
# A Stop hook is *meant* to block completion, so we keep raising to
|
|
82
|
+
# halt the turn. We record the block so a re-entrant Stop hook can
|
|
83
|
+
# see stop_hook_active=True; on_agent_start resets it for the next
|
|
84
|
+
# independent run so this cannot permanently wedge the scheduler.
|
|
59
85
|
self._stop_hook_active = True
|
|
60
86
|
raise RuntimeError(result.block_reason or "Blocked by Stop hook")
|
|
61
87
|
|
|
@@ -69,8 +95,21 @@ class ApprovalHooks(RunHooks):
|
|
|
69
95
|
async def on_tool_start(self, context: RunContextWrapper, agent: Agent, tool: Tool) -> None:
|
|
70
96
|
"""Check permissions, then forward to wrapped hooks for tool display.
|
|
71
97
|
|
|
98
|
+
The openai-agents ``RunHooks.on_tool_start`` contract returns ``None``
|
|
99
|
+
and provides no mechanism to substitute a tool result from inside the
|
|
100
|
+
hook: the runner awaits ``on_tool_start`` (via ``asyncio.gather``)
|
|
101
|
+
*before* invoking the tool, and only the tool body — not the hook — is
|
|
102
|
+
wrapped in the try/except that converts failures into a tool message.
|
|
103
|
+
The only SDK-supported way to turn a denial into a tool result is the
|
|
104
|
+
approval flow (``needs_approval`` / ``ToolApprovalItem``), which is
|
|
105
|
+
driven by the tool/run-config and runs *before* hooks, not by a
|
|
106
|
+
``RunHooks`` object. Therefore raising is the only supported way to
|
|
107
|
+
stop a denied tool from here; we raise a dedicated, classified
|
|
108
|
+
exception and hold no mutable state on this path, so a denial cannot
|
|
109
|
+
corrupt scheduler state.
|
|
110
|
+
|
|
72
111
|
Raises:
|
|
73
|
-
|
|
112
|
+
ToolPermissionError: When the permission service denies the tool.
|
|
74
113
|
"""
|
|
75
114
|
if self._permission_service is not None:
|
|
76
115
|
# on_tool_start receives the Tool but NOT its arguments,
|
|
@@ -83,7 +122,7 @@ class ApprovalHooks(RunHooks):
|
|
|
83
122
|
)
|
|
84
123
|
if not result.allowed and not result.requires_approval:
|
|
85
124
|
logger.warning("Permission denied for tool %s: %s", tool.name, result.reason)
|
|
86
|
-
raise
|
|
125
|
+
raise ToolPermissionError(tool.name, result.reason)
|
|
87
126
|
if result.requires_approval:
|
|
88
127
|
# In non-interactive contexts approval cannot be obtained;
|
|
89
128
|
# log and allow so the existing interactive approval flow
|
|
@@ -99,6 +138,22 @@ class ApprovalHooks(RunHooks):
|
|
|
99
138
|
"""Called after a tool is invoked."""
|
|
100
139
|
if self.wrapped_hooks:
|
|
101
140
|
await self.wrapped_hooks.on_tool_end(context, agent, tool, result)
|
|
141
|
+
|
|
142
|
+
# The SDK's ToolContext (a RunContextWrapper subclass) carries
|
|
143
|
+
# tool_arguments as a raw JSON string. We parse it to pass structured
|
|
144
|
+
# input to PostToolUse hooks so they can write rules based on what the
|
|
145
|
+
# tool was actually called with. If the context is not a ToolContext or
|
|
146
|
+
# parsing fails, we fall back to an empty dict gracefully.
|
|
147
|
+
tool_input: dict[str, Any] = {}
|
|
148
|
+
raw_args = getattr(context, "tool_arguments", None)
|
|
149
|
+
if raw_args:
|
|
150
|
+
try:
|
|
151
|
+
parsed = json.loads(raw_args)
|
|
152
|
+
if isinstance(parsed, dict):
|
|
153
|
+
tool_input = parsed
|
|
154
|
+
except (json.JSONDecodeError, TypeError):
|
|
155
|
+
pass
|
|
156
|
+
|
|
102
157
|
dispatch_command_hooks(
|
|
103
158
|
cwd=Path.cwd(),
|
|
104
159
|
event_name="PostToolUse",
|
|
@@ -106,7 +161,7 @@ class ApprovalHooks(RunHooks):
|
|
|
106
161
|
payload={
|
|
107
162
|
"event": "PostToolUse",
|
|
108
163
|
"tool_name": tool.name,
|
|
109
|
-
"tool_input":
|
|
164
|
+
"tool_input": tool_input,
|
|
110
165
|
"result": str(result),
|
|
111
166
|
},
|
|
112
167
|
)
|
|
@@ -164,7 +164,7 @@ class AntigravityOAuthProvider(OAuthProvider):
|
|
|
164
164
|
if response.ok:
|
|
165
165
|
return await response.json()
|
|
166
166
|
except Exception:
|
|
167
|
-
|
|
167
|
+
logger.debug("Failed to fetch Antigravity user info", exc_info=True)
|
|
168
168
|
return None
|
|
169
169
|
|
|
170
170
|
async def revoke_token(self, token: str) -> bool:
|
|
@@ -253,7 +253,7 @@ class AntigravityOAuthProvider(OAuthProvider):
|
|
|
253
253
|
tier_id = paid_tier.get("id") or current_tier.get("id")
|
|
254
254
|
return project_id, tier_id
|
|
255
255
|
except Exception:
|
|
256
|
-
|
|
256
|
+
logger.debug("Failed to fetch Antigravity project context", exc_info=True)
|
|
257
257
|
return None, None
|
|
258
258
|
|
|
259
259
|
async def _fetch_available_models(
|
|
@@ -743,6 +743,7 @@ class AntigravityOAuthLLM(CustomLLM):
|
|
|
743
743
|
if isinstance(project, dict) and project.get("id"):
|
|
744
744
|
return project["id"]
|
|
745
745
|
except Exception:
|
|
746
|
+
logger.debug("Failed to discover Antigravity project ID", exc_info=True)
|
|
746
747
|
continue
|
|
747
748
|
|
|
748
749
|
return None
|
|
@@ -471,9 +471,9 @@ class ChatGPTOAuthLLM(CustomLLM):
|
|
|
471
471
|
self,
|
|
472
472
|
messages: List[Dict[str, Any]],
|
|
473
473
|
) -> List[Dict[str, Any]]:
|
|
474
|
-
"""Convert OpenAI-style messages to
|
|
474
|
+
"""Convert OpenAI-style messages to the provider input format.
|
|
475
475
|
|
|
476
|
-
|
|
476
|
+
The provider API uses an 'input' array with a different structure:
|
|
477
477
|
- type: "message"
|
|
478
478
|
- role: "user" | "assistant" | "developer" (instead of "system")
|
|
479
479
|
- content: array of content objects
|
|
@@ -482,7 +482,7 @@ class ChatGPTOAuthLLM(CustomLLM):
|
|
|
482
482
|
messages: OpenAI-style messages
|
|
483
483
|
|
|
484
484
|
Returns:
|
|
485
|
-
|
|
485
|
+
Provider input array
|
|
486
486
|
"""
|
|
487
487
|
input_items = []
|
|
488
488
|
|