kolega-code 0.4.0__tar.gz → 0.5.1__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.
- {kolega_code-0.4.0 → kolega_code-0.5.1}/PKG-INFO +1 -1
- {kolega_code-0.4.0 → kolega_code-0.5.1}/docs/astro.config.mjs +5 -1
- {kolega_code-0.4.0 → kolega_code-0.5.1}/docs/src/content/docs/concepts/agents.md +4 -0
- kolega_code-0.5.1/docs/src/content/docs/gigacode.mdx +108 -0
- kolega_code-0.4.0/docs/src/content/docs/getting-started/introduction.md → kolega_code-0.5.1/docs/src/content/docs/index.mdx +35 -6
- {kolega_code-0.4.0 → kolega_code-0.5.1}/docs/src/content/docs/tui/modes.md +7 -1
- {kolega_code-0.4.0 → kolega_code-0.5.1}/docs/src/content/docs/tui/slash-commands.md +1 -0
- {kolega_code-0.4.0 → kolega_code-0.5.1}/kolega_code/__init__.py +1 -1
- {kolega_code-0.4.0 → kolega_code-0.5.1}/kolega_code/agent/__init__.py +1 -1
- {kolega_code-0.4.0 → kolega_code-0.5.1}/kolega_code/agent/baseagent.py +21 -0
- {kolega_code-0.4.0 → kolega_code-0.5.1}/kolega_code/agent/coder.py +0 -1
- {kolega_code-0.4.0 → kolega_code-0.5.1}/kolega_code/agent/generalagent.py +0 -1
- kolega_code-0.5.1/kolega_code/agent/orchestration/__init__.py +46 -0
- kolega_code-0.5.1/kolega_code/agent/orchestration/budget.py +46 -0
- kolega_code-0.5.1/kolega_code/agent/orchestration/errors.py +22 -0
- kolega_code-0.5.1/kolega_code/agent/orchestration/executor.py +118 -0
- kolega_code-0.5.1/kolega_code/agent/orchestration/guide.py +143 -0
- kolega_code-0.5.1/kolega_code/agent/orchestration/journal.py +123 -0
- kolega_code-0.5.1/kolega_code/agent/orchestration/runtime.py +244 -0
- kolega_code-0.5.1/kolega_code/agent/orchestration/tests/test_orchestration.py +257 -0
- kolega_code-0.5.1/kolega_code/agent/orchestration/types.py +80 -0
- {kolega_code-0.4.0 → kolega_code-0.5.1}/kolega_code/agent/planningagent.py +3 -0
- {kolega_code-0.4.0 → kolega_code-0.5.1}/kolega_code/agent/prompt_provider.py +4 -0
- kolega_code-0.5.1/kolega_code/agent/prompt_templates/extensions/cli/shared_task_list.md +8 -0
- kolega_code-0.5.1/kolega_code/agent/prompt_templates/user_tasks/cli/implement_plan.md.j2 +7 -0
- {kolega_code-0.4.0 → kolega_code-0.5.1}/kolega_code/agent/prompts.py +4 -2
- kolega_code-0.5.1/kolega_code/agent/tests/services/test_sandbox_terminal_input.py +129 -0
- kolega_code-0.5.1/kolega_code/agent/tests/services/test_terminal.py +139 -0
- kolega_code-0.5.1/kolega_code/agent/tests/services/test_terminal_buffer.py +71 -0
- {kolega_code-0.4.0 → kolega_code-0.5.1}/kolega_code/agent/tests/test_agent_tools_inventory.py +2 -2
- kolega_code-0.5.1/kolega_code/agent/tests/test_gigacode_gating.py +214 -0
- {kolega_code-0.4.0 → kolega_code-0.5.1}/kolega_code/agent/tests/test_permissions.py +6 -6
- {kolega_code-0.4.0 → kolega_code-0.5.1}/kolega_code/agent/tests/test_prompts.py +17 -0
- {kolega_code-0.4.0 → kolega_code-0.5.1}/kolega_code/agent/tests/test_tool_registry.py +1 -1
- {kolega_code-0.4.0 → kolega_code-0.5.1}/kolega_code/agent/tests/test_tools.py +9 -8
- kolega_code-0.5.1/kolega_code/agent/tests/tool_backend/test_terminal_tool.py +244 -0
- kolega_code-0.5.1/kolega_code/agent/tests/tool_backend/test_workflow_tool.py +175 -0
- {kolega_code-0.4.0 → kolega_code-0.5.1}/kolega_code/agent/tool_backend/agent_tool.py +293 -2
- kolega_code-0.5.1/kolega_code/agent/tool_backend/terminal_tool.py +395 -0
- kolega_code-0.5.1/kolega_code/agent/tool_backend/workflow_tool.py +300 -0
- {kolega_code-0.4.0 → kolega_code-0.5.1}/kolega_code/agent/tools.py +145 -204
- {kolega_code-0.4.0 → kolega_code-0.5.1}/kolega_code/cli/app.py +104 -4
- {kolega_code-0.4.0 → kolega_code-0.5.1}/kolega_code/cli/slash_commands.py +1 -0
- {kolega_code-0.4.0 → kolega_code-0.5.1}/kolega_code/cli/tests/test_app.py +167 -11
- {kolega_code-0.4.0 → kolega_code-0.5.1}/kolega_code/permissions.py +1 -2
- {kolega_code-0.4.0 → kolega_code-0.5.1}/kolega_code/sandbox/terminal.py +157 -1
- {kolega_code-0.4.0 → kolega_code-0.5.1}/kolega_code/services/base.py +66 -88
- kolega_code-0.5.1/kolega_code/services/terminal.py +495 -0
- kolega_code-0.5.1/kolega_code/services/terminal_buffer.py +164 -0
- kolega_code-0.5.1/kolega_code/tools/tests/__init__.py +0 -0
- {kolega_code-0.4.0 → kolega_code-0.5.1}/pyproject.toml +1 -1
- {kolega_code-0.4.0 → kolega_code-0.5.1}/uv.lock +2 -2
- kolega_code-0.4.0/docs/src/content/docs/index.mdx +0 -52
- kolega_code-0.4.0/kolega_code/agent/prompt_templates/extensions/cli/shared_task_list.md +0 -7
- kolega_code-0.4.0/kolega_code/agent/prompt_templates/user_tasks/cli/implement_plan.md.j2 +0 -3
- kolega_code-0.4.0/kolega_code/agent/tests/services/test_sandbox_terminal_input.py +0 -98
- kolega_code-0.4.0/kolega_code/agent/tests/services/test_terminal.py +0 -154
- kolega_code-0.4.0/kolega_code/agent/tests/services/test_terminal_command_tracking.py +0 -385
- kolega_code-0.4.0/kolega_code/agent/tests/tool_backend/test_terminal_tool.py +0 -482
- kolega_code-0.4.0/kolega_code/agent/tool_backend/terminal_tool.py +0 -643
- kolega_code-0.4.0/kolega_code/services/terminal.py +0 -903
- {kolega_code-0.4.0 → kolega_code-0.5.1}/.env.example +0 -0
- {kolega_code-0.4.0 → kolega_code-0.5.1}/.github/workflows/ci.yml +0 -0
- {kolega_code-0.4.0 → kolega_code-0.5.1}/.github/workflows/docs.yml +0 -0
- {kolega_code-0.4.0 → kolega_code-0.5.1}/.github/workflows/release.yml +0 -0
- {kolega_code-0.4.0 → kolega_code-0.5.1}/.gitignore +0 -0
- {kolega_code-0.4.0 → kolega_code-0.5.1}/CONTRIBUTING.md +0 -0
- {kolega_code-0.4.0 → kolega_code-0.5.1}/LICENSE +0 -0
- {kolega_code-0.4.0 → kolega_code-0.5.1}/README.md +0 -0
- {kolega_code-0.4.0 → kolega_code-0.5.1}/RELEASING.md +0 -0
- {kolega_code-0.4.0 → kolega_code-0.5.1}/SECURITY.md +0 -0
- {kolega_code-0.4.0 → kolega_code-0.5.1}/conftest.py +0 -0
- {kolega_code-0.4.0 → kolega_code-0.5.1}/docs/.gitignore +0 -0
- {kolega_code-0.4.0 → kolega_code-0.5.1}/docs/README.md +0 -0
- {kolega_code-0.4.0 → kolega_code-0.5.1}/docs/package-lock.json +0 -0
- {kolega_code-0.4.0 → kolega_code-0.5.1}/docs/package.json +0 -0
- {kolega_code-0.4.0 → kolega_code-0.5.1}/docs/public/favicon.svg +0 -0
- {kolega_code-0.4.0 → kolega_code-0.5.1}/docs/src/assets/kolega-dark.svg +0 -0
- {kolega_code-0.4.0 → kolega_code-0.5.1}/docs/src/assets/kolega-light.svg +0 -0
- {kolega_code-0.4.0 → kolega_code-0.5.1}/docs/src/content/docs/cli/ask.md +0 -0
- {kolega_code-0.4.0 → kolega_code-0.5.1}/docs/src/content/docs/cli/doctor.md +0 -0
- {kolega_code-0.4.0 → kolega_code-0.5.1}/docs/src/content/docs/cli/overview.md +0 -0
- {kolega_code-0.4.0 → kolega_code-0.5.1}/docs/src/content/docs/cli/sessions.md +0 -0
- {kolega_code-0.4.0 → kolega_code-0.5.1}/docs/src/content/docs/concepts/how-it-works.md +0 -0
- {kolega_code-0.4.0 → kolega_code-0.5.1}/docs/src/content/docs/concepts/tools.md +0 -0
- {kolega_code-0.4.0 → kolega_code-0.5.1}/docs/src/content/docs/configuration/environment-variables.md +0 -0
- {kolega_code-0.4.0 → kolega_code-0.5.1}/docs/src/content/docs/configuration/providers-and-models.mdx +0 -0
- {kolega_code-0.4.0 → kolega_code-0.5.1}/docs/src/content/docs/configuration/settings-and-api-keys.mdx +0 -0
- {kolega_code-0.4.0 → kolega_code-0.5.1}/docs/src/content/docs/getting-started/installation.mdx +0 -0
- {kolega_code-0.4.0 → kolega_code-0.5.1}/docs/src/content/docs/getting-started/quick-start.mdx +0 -0
- {kolega_code-0.4.0 → kolega_code-0.5.1}/docs/src/content/docs/hooks.md +0 -0
- {kolega_code-0.4.0 → kolega_code-0.5.1}/docs/src/content/docs/skills.mdx +0 -0
- {kolega_code-0.4.0 → kolega_code-0.5.1}/docs/src/content/docs/tui/composer.md +0 -0
- {kolega_code-0.4.0 → kolega_code-0.5.1}/docs/src/content/docs/tui/interface.md +0 -0
- {kolega_code-0.4.0 → kolega_code-0.5.1}/docs/src/content/docs/tui/sessions-and-resume.md +0 -0
- {kolega_code-0.4.0 → kolega_code-0.5.1}/docs/src/content.config.ts +0 -0
- {kolega_code-0.4.0 → kolega_code-0.5.1}/docs/src/styles/brand.css +0 -0
- {kolega_code-0.4.0 → kolega_code-0.5.1}/docs/tsconfig.json +0 -0
- {kolega_code-0.4.0 → kolega_code-0.5.1}/kolega_code/agent/browseragent.py +0 -0
- {kolega_code-0.4.0 → kolega_code-0.5.1}/kolega_code/agent/common.py +0 -0
- {kolega_code-0.4.0 → kolega_code-0.5.1}/kolega_code/agent/compression.py +0 -0
- {kolega_code-0.4.0 → kolega_code-0.5.1}/kolega_code/agent/context.py +0 -0
- {kolega_code-0.4.0 → kolega_code-0.5.1}/kolega_code/agent/conversation.py +0 -0
- {kolega_code-0.4.0 → kolega_code-0.5.1}/kolega_code/agent/investigationagent.py +0 -0
- {kolega_code-0.4.0/kolega_code/agent → kolega_code-0.5.1/kolega_code/agent/orchestration}/tests/__init__.py +0 -0
- {kolega_code-0.4.0 → kolega_code-0.5.1}/kolega_code/agent/prompt_templates/auxiliary/compression/summary.system.md +0 -0
- {kolega_code-0.4.0 → kolega_code-0.5.1}/kolega_code/agent/prompt_templates/auxiliary/compression/summary.user.md.j2 +0 -0
- {kolega_code-0.4.0 → kolega_code-0.5.1}/kolega_code/agent/prompt_templates/auxiliary/terminal/output_summary.system.md +0 -0
- {kolega_code-0.4.0 → kolega_code-0.5.1}/kolega_code/agent/prompt_templates/auxiliary/terminal/safety.system.md +0 -0
- {kolega_code-0.4.0 → kolega_code-0.5.1}/kolega_code/agent/prompt_templates/auxiliary/tools/think_hard.system.md +0 -0
- {kolega_code-0.4.0 → kolega_code-0.5.1}/kolega_code/agent/prompt_templates/extensions/cli/planning_questions.md +0 -0
- {kolega_code-0.4.0 → kolega_code-0.5.1}/kolega_code/agent/prompt_templates/extensions/skills/catalog.md.j2 +0 -0
- {kolega_code-0.4.0 → kolega_code-0.5.1}/kolega_code/agent/prompt_templates/system/agents/browser.md.j2 +0 -0
- {kolega_code-0.4.0 → kolega_code-0.5.1}/kolega_code/agent/prompt_templates/system/agents/coder_cli.md.j2 +0 -0
- {kolega_code-0.4.0 → kolega_code-0.5.1}/kolega_code/agent/prompt_templates/system/agents/general.md.j2 +0 -0
- {kolega_code-0.4.0 → kolega_code-0.5.1}/kolega_code/agent/prompt_templates/system/agents/investigation.md.j2 +0 -0
- {kolega_code-0.4.0 → kolega_code-0.5.1}/kolega_code/agent/prompt_templates/system/agents/planning.md.j2 +0 -0
- {kolega_code-0.4.0 → kolega_code-0.5.1}/kolega_code/agent/prompt_templates/system/includes/agents_md_instructions.md +0 -0
- {kolega_code-0.4.0 → kolega_code-0.5.1}/kolega_code/agent/prompt_templates/system/includes/environment_variables/workspace_env_vars.md +0 -0
- {kolega_code-0.4.0 → kolega_code-0.5.1}/kolega_code/agent/prompt_templates/system/includes/frontend_guidance.md +0 -0
- {kolega_code-0.4.0 → kolega_code-0.5.1}/kolega_code/agent/prompt_templates/system/includes/starter_templates/expo.md +0 -0
- {kolega_code-0.4.0 → kolega_code-0.5.1}/kolega_code/agent/prompt_templates/system/includes/starter_templates/html_website.md +0 -0
- {kolega_code-0.4.0 → kolega_code-0.5.1}/kolega_code/agent/prompt_templates/system/includes/starter_templates/mern_stack.md +0 -0
- {kolega_code-0.4.0 → kolega_code-0.5.1}/kolega_code/agent/prompt_templates/system/includes/starter_templates/react_vite_shadcdn.md +0 -0
- {kolega_code-0.4.0 → kolega_code-0.5.1}/kolega_code/agent/prompt_templates/user_tasks/cli/init_agents.md.j2 +0 -0
- {kolega_code-0.4.0/kolega_code/agent/tests/llm → kolega_code-0.5.1/kolega_code/agent/tests}/__init__.py +0 -0
- {kolega_code-0.4.0/kolega_code/agent/tests/tool_backend → kolega_code-0.5.1/kolega_code/agent/tests/llm}/__init__.py +0 -0
- {kolega_code-0.4.0 → kolega_code-0.5.1}/kolega_code/agent/tests/llm/test_anthropic_token_counting.py +0 -0
- {kolega_code-0.4.0 → kolega_code-0.5.1}/kolega_code/agent/tests/llm/test_billing_openai_cache.py +0 -0
- {kolega_code-0.4.0 → kolega_code-0.5.1}/kolega_code/agent/tests/llm/test_client.py +0 -0
- {kolega_code-0.4.0 → kolega_code-0.5.1}/kolega_code/agent/tests/llm/test_dashscope_mapping.py +0 -0
- {kolega_code-0.4.0 → kolega_code-0.5.1}/kolega_code/agent/tests/llm/test_error_boundary.py +0 -0
- {kolega_code-0.4.0 → kolega_code-0.5.1}/kolega_code/agent/tests/llm/test_exceptions.py +0 -0
- {kolega_code-0.4.0 → kolega_code-0.5.1}/kolega_code/agent/tests/llm/test_google_thought_signature.py +0 -0
- {kolega_code-0.4.0 → kolega_code-0.5.1}/kolega_code/agent/tests/llm/test_google_tool_signature_live.py +0 -0
- {kolega_code-0.4.0 → kolega_code-0.5.1}/kolega_code/agent/tests/llm/test_instrumented_client.py +0 -0
- {kolega_code-0.4.0 → kolega_code-0.5.1}/kolega_code/agent/tests/llm/test_instrumented_client_integration.py +0 -0
- {kolega_code-0.4.0 → kolega_code-0.5.1}/kolega_code/agent/tests/llm/test_langfuse_normalization.py +0 -0
- {kolega_code-0.4.0 → kolega_code-0.5.1}/kolega_code/agent/tests/llm/test_live_providers.py +0 -0
- {kolega_code-0.4.0 → kolega_code-0.5.1}/kolega_code/agent/tests/llm/test_model_specs.py +0 -0
- {kolega_code-0.4.0 → kolega_code-0.5.1}/kolega_code/agent/tests/llm/test_openai_cached_tokens.py +0 -0
- {kolega_code-0.4.0 → kolega_code-0.5.1}/kolega_code/agent/tests/llm/test_openai_cached_tokens_stream.py +0 -0
- {kolega_code-0.4.0 → kolega_code-0.5.1}/kolega_code/agent/tests/llm/test_openai_message_conversion.py +0 -0
- {kolega_code-0.4.0 → kolega_code-0.5.1}/kolega_code/agent/tests/llm/test_openai_token_counting.py +0 -0
- {kolega_code-0.4.0 → kolega_code-0.5.1}/kolega_code/agent/tests/llm/test_thinking_effort.py +0 -0
- {kolega_code-0.4.0 → kolega_code-0.5.1}/kolega_code/agent/tests/llm/test_tool_execution_ids.py +0 -0
- {kolega_code-0.4.0 → kolega_code-0.5.1}/kolega_code/agent/tests/services/__init__.py +0 -0
- {kolega_code-0.4.0 → kolega_code-0.5.1}/kolega_code/agent/tests/services/test_browser.py +0 -0
- {kolega_code-0.4.0 → kolega_code-0.5.1}/kolega_code/agent/tests/services/test_browser_parity.py +0 -0
- {kolega_code-0.4.0 → kolega_code-0.5.1}/kolega_code/agent/tests/services/test_file_system.py +0 -0
- {kolega_code-0.4.0 → kolega_code-0.5.1}/kolega_code/agent/tests/services/test_terminal_state_serializer.py +0 -0
- {kolega_code-0.4.0 → kolega_code-0.5.1}/kolega_code/agent/tests/test_base_agent.py +0 -0
- {kolega_code-0.4.0 → kolega_code-0.5.1}/kolega_code/agent/tests/test_coder_attachments.py +0 -0
- {kolega_code-0.4.0 → kolega_code-0.5.1}/kolega_code/agent/tests/test_coder_prompt_extensions.py +0 -0
- {kolega_code-0.4.0 → kolega_code-0.5.1}/kolega_code/agent/tests/test_commands.py +0 -0
- {kolega_code-0.4.0 → kolega_code-0.5.1}/kolega_code/agent/tests/test_duplicate_tool_results.py +0 -0
- {kolega_code-0.4.0 → kolega_code-0.5.1}/kolega_code/agent/tests/test_empty_message_handling.py +0 -0
- {kolega_code-0.4.0 → kolega_code-0.5.1}/kolega_code/agent/tests/test_general_agent.py +0 -0
- {kolega_code-0.4.0 → kolega_code-0.5.1}/kolega_code/agent/tests/test_hooks_integration.py +0 -0
- {kolega_code-0.4.0 → kolega_code-0.5.1}/kolega_code/agent/tests/test_html.py +0 -0
- {kolega_code-0.4.0 → kolega_code-0.5.1}/kolega_code/agent/tests/test_parallel_tool_calls.py +0 -0
- {kolega_code-0.4.0 → kolega_code-0.5.1}/kolega_code/agent/tests/test_planning_agent.py +0 -0
- {kolega_code-0.4.0 → kolega_code-0.5.1}/kolega_code/agent/tests/test_prompt_provider.py +0 -0
- {kolega_code-0.4.0/kolega_code/hooks/tests → kolega_code-0.5.1/kolega_code/agent/tests/tool_backend}/__init__.py +0 -0
- {kolega_code-0.4.0 → kolega_code-0.5.1}/kolega_code/agent/tests/tool_backend/test_agent_tool.py +0 -0
- {kolega_code-0.4.0 → kolega_code-0.5.1}/kolega_code/agent/tests/tool_backend/test_base_tool.py +0 -0
- {kolega_code-0.4.0 → kolega_code-0.5.1}/kolega_code/agent/tests/tool_backend/test_browser_tool.py +0 -0
- {kolega_code-0.4.0 → kolega_code-0.5.1}/kolega_code/agent/tests/tool_backend/test_build_tool.py +0 -0
- {kolega_code-0.4.0 → kolega_code-0.5.1}/kolega_code/agent/tests/tool_backend/test_create_file_tool.py +0 -0
- {kolega_code-0.4.0 → kolega_code-0.5.1}/kolega_code/agent/tests/tool_backend/test_glob_tool.py +0 -0
- {kolega_code-0.4.0 → kolega_code-0.5.1}/kolega_code/agent/tests/tool_backend/test_glob_tool_sandbox_parity.py +0 -0
- {kolega_code-0.4.0 → kolega_code-0.5.1}/kolega_code/agent/tests/tool_backend/test_list_directory_tool.py +0 -0
- {kolega_code-0.4.0 → kolega_code-0.5.1}/kolega_code/agent/tests/tool_backend/test_read_file_tool.py +0 -0
- {kolega_code-0.4.0 → kolega_code-0.5.1}/kolega_code/agent/tests/tool_backend/test_replace_entire_file_tool.py +0 -0
- {kolega_code-0.4.0 → kolega_code-0.5.1}/kolega_code/agent/tests/tool_backend/test_replace_lines_tool.py +0 -0
- {kolega_code-0.4.0 → kolega_code-0.5.1}/kolega_code/agent/tests/tool_backend/test_search_and_replace_tool.py +0 -0
- {kolega_code-0.4.0 → kolega_code-0.5.1}/kolega_code/agent/tests/tool_backend/test_search_codebase_tool.py +0 -0
- {kolega_code-0.4.0 → kolega_code-0.5.1}/kolega_code/agent/tests/tool_backend/test_think_hard_integration.py +0 -0
- {kolega_code-0.4.0 → kolega_code-0.5.1}/kolega_code/agent/tests/tool_backend/test_think_hard_streaming.py +0 -0
- {kolega_code-0.4.0 → kolega_code-0.5.1}/kolega_code/agent/tests/tool_backend/test_web_fetch_tool.py +0 -0
- {kolega_code-0.4.0 → kolega_code-0.5.1}/kolega_code/agent/tool_backend/apply_patch_tool.py +0 -0
- {kolega_code-0.4.0 → kolega_code-0.5.1}/kolega_code/agent/tool_backend/base_tool.py +0 -0
- {kolega_code-0.4.0 → kolega_code-0.5.1}/kolega_code/agent/tool_backend/browser_tool.py +0 -0
- {kolega_code-0.4.0 → kolega_code-0.5.1}/kolega_code/agent/tool_backend/build_tool.py +0 -0
- {kolega_code-0.4.0 → kolega_code-0.5.1}/kolega_code/agent/tool_backend/create_file_tool.py +0 -0
- {kolega_code-0.4.0 → kolega_code-0.5.1}/kolega_code/agent/tool_backend/glob_tool.py +0 -0
- {kolega_code-0.4.0 → kolega_code-0.5.1}/kolega_code/agent/tool_backend/list_directory_tool.py +0 -0
- {kolega_code-0.4.0 → kolega_code-0.5.1}/kolega_code/agent/tool_backend/memory_tool.py +0 -0
- {kolega_code-0.4.0 → kolega_code-0.5.1}/kolega_code/agent/tool_backend/read_file_tool.py +0 -0
- {kolega_code-0.4.0 → kolega_code-0.5.1}/kolega_code/agent/tool_backend/replace_entire_file_tool.py +0 -0
- {kolega_code-0.4.0 → kolega_code-0.5.1}/kolega_code/agent/tool_backend/replace_lines_tool.py +0 -0
- {kolega_code-0.4.0 → kolega_code-0.5.1}/kolega_code/agent/tool_backend/search_and_replace_tool.py +0 -0
- {kolega_code-0.4.0 → kolega_code-0.5.1}/kolega_code/agent/tool_backend/search_codebase_tool.py +0 -0
- {kolega_code-0.4.0 → kolega_code-0.5.1}/kolega_code/agent/tool_backend/streaming_tool.py +0 -0
- {kolega_code-0.4.0 → kolega_code-0.5.1}/kolega_code/agent/tool_backend/think_hard_tool.py +0 -0
- {kolega_code-0.4.0 → kolega_code-0.5.1}/kolega_code/agent/tool_backend/web_fetch_tool.py +0 -0
- {kolega_code-0.4.0 → kolega_code-0.5.1}/kolega_code/agent/utils/commands.py +0 -0
- {kolega_code-0.4.0 → kolega_code-0.5.1}/kolega_code/cli/__init__.py +0 -0
- {kolega_code-0.4.0 → kolega_code-0.5.1}/kolega_code/cli/config.py +0 -0
- {kolega_code-0.4.0 → kolega_code-0.5.1}/kolega_code/cli/connection.py +0 -0
- {kolega_code-0.4.0 → kolega_code-0.5.1}/kolega_code/cli/file_index.py +0 -0
- {kolega_code-0.4.0 → kolega_code-0.5.1}/kolega_code/cli/main.py +0 -0
- {kolega_code-0.4.0 → kolega_code-0.5.1}/kolega_code/cli/mentions.py +0 -0
- {kolega_code-0.4.0 → kolega_code-0.5.1}/kolega_code/cli/messages.py +0 -0
- {kolega_code-0.4.0 → kolega_code-0.5.1}/kolega_code/cli/provider_registry.py +0 -0
- {kolega_code-0.4.0 → kolega_code-0.5.1}/kolega_code/cli/session_store.py +0 -0
- {kolega_code-0.4.0 → kolega_code-0.5.1}/kolega_code/cli/settings.py +0 -0
- {kolega_code-0.4.0 → kolega_code-0.5.1}/kolega_code/cli/skills.py +0 -0
- {kolega_code-0.4.0 → kolega_code-0.5.1}/kolega_code/cli/tests/__init__.py +0 -0
- {kolega_code-0.4.0 → kolega_code-0.5.1}/kolega_code/cli/tests/test_cli_config.py +0 -0
- {kolega_code-0.4.0 → kolega_code-0.5.1}/kolega_code/cli/tests/test_connection.py +0 -0
- {kolega_code-0.4.0 → kolega_code-0.5.1}/kolega_code/cli/tests/test_file_index.py +0 -0
- {kolega_code-0.4.0 → kolega_code-0.5.1}/kolega_code/cli/tests/test_main.py +0 -0
- {kolega_code-0.4.0 → kolega_code-0.5.1}/kolega_code/cli/tests/test_mentions.py +0 -0
- {kolega_code-0.4.0 → kolega_code-0.5.1}/kolega_code/cli/tests/test_session_store.py +0 -0
- {kolega_code-0.4.0 → kolega_code-0.5.1}/kolega_code/cli/tests/test_settings.py +0 -0
- {kolega_code-0.4.0 → kolega_code-0.5.1}/kolega_code/cli/tests/test_skills.py +0 -0
- {kolega_code-0.4.0 → kolega_code-0.5.1}/kolega_code/cli/tests/test_slash_commands.py +0 -0
- {kolega_code-0.4.0 → kolega_code-0.5.1}/kolega_code/cli/tests/test_themes.py +0 -0
- {kolega_code-0.4.0 → kolega_code-0.5.1}/kolega_code/cli/tests/test_updater.py +0 -0
- {kolega_code-0.4.0 → kolega_code-0.5.1}/kolega_code/cli/theme.py +0 -0
- {kolega_code-0.4.0 → kolega_code-0.5.1}/kolega_code/cli/updater.py +0 -0
- {kolega_code-0.4.0 → kolega_code-0.5.1}/kolega_code/config.py +0 -0
- {kolega_code-0.4.0 → kolega_code-0.5.1}/kolega_code/events.py +0 -0
- {kolega_code-0.4.0 → kolega_code-0.5.1}/kolega_code/hooks/__init__.py +0 -0
- {kolega_code-0.4.0 → kolega_code-0.5.1}/kolega_code/hooks/backends.py +0 -0
- {kolega_code-0.4.0 → kolega_code-0.5.1}/kolega_code/hooks/config.py +0 -0
- {kolega_code-0.4.0 → kolega_code-0.5.1}/kolega_code/hooks/dispatcher.py +0 -0
- {kolega_code-0.4.0 → kolega_code-0.5.1}/kolega_code/hooks/events.py +0 -0
- {kolega_code-0.4.0 → kolega_code-0.5.1}/kolega_code/hooks/matcher.py +0 -0
- {kolega_code-0.4.0 → kolega_code-0.5.1}/kolega_code/hooks/outcome.py +0 -0
- {kolega_code-0.4.0/kolega_code/llm/providers → kolega_code-0.5.1/kolega_code/hooks/tests}/__init__.py +0 -0
- {kolega_code-0.4.0 → kolega_code-0.5.1}/kolega_code/hooks/tests/test_hooks.py +0 -0
- {kolega_code-0.4.0 → kolega_code-0.5.1}/kolega_code/llm/client.py +0 -0
- {kolega_code-0.4.0 → kolega_code-0.5.1}/kolega_code/llm/exceptions.py +0 -0
- {kolega_code-0.4.0 → kolega_code-0.5.1}/kolega_code/llm/instrumented_client.py +0 -0
- {kolega_code-0.4.0 → kolega_code-0.5.1}/kolega_code/llm/models.py +0 -0
- {kolega_code-0.4.0/kolega_code/tools/tests → kolega_code-0.5.1/kolega_code/llm/providers}/__init__.py +0 -0
- {kolega_code-0.4.0 → kolega_code-0.5.1}/kolega_code/llm/providers/anthropic.py +0 -0
- {kolega_code-0.4.0 → kolega_code-0.5.1}/kolega_code/llm/providers/base.py +0 -0
- {kolega_code-0.4.0 → kolega_code-0.5.1}/kolega_code/llm/providers/google.py +0 -0
- {kolega_code-0.4.0 → kolega_code-0.5.1}/kolega_code/llm/providers/models.py +0 -0
- {kolega_code-0.4.0 → kolega_code-0.5.1}/kolega_code/llm/providers/openai.py +0 -0
- {kolega_code-0.4.0 → kolega_code-0.5.1}/kolega_code/llm/ratelimit.py +0 -0
- {kolega_code-0.4.0 → kolega_code-0.5.1}/kolega_code/llm/specs.py +0 -0
- {kolega_code-0.4.0 → kolega_code-0.5.1}/kolega_code/llm/tool_execution_ids.py +0 -0
- {kolega_code-0.4.0 → kolega_code-0.5.1}/kolega_code/models/__init__.py +0 -0
- {kolega_code-0.4.0 → kolega_code-0.5.1}/kolega_code/models/sandbox_terminal_state.py +0 -0
- {kolega_code-0.4.0 → kolega_code-0.5.1}/kolega_code/runtime.py +0 -0
- {kolega_code-0.4.0 → kolega_code-0.5.1}/kolega_code/sandbox/README.md +0 -0
- {kolega_code-0.4.0 → kolega_code-0.5.1}/kolega_code/sandbox/__init__.py +0 -0
- {kolega_code-0.4.0 → kolega_code-0.5.1}/kolega_code/sandbox/async_filesystem.py +0 -0
- {kolega_code-0.4.0 → kolega_code-0.5.1}/kolega_code/sandbox/base.py +0 -0
- {kolega_code-0.4.0 → kolega_code-0.5.1}/kolega_code/sandbox/browser.py +0 -0
- {kolega_code-0.4.0 → kolega_code-0.5.1}/kolega_code/sandbox/event_loop.py +0 -0
- {kolega_code-0.4.0 → kolega_code-0.5.1}/kolega_code/sandbox/filesystem.py +0 -0
- {kolega_code-0.4.0 → kolega_code-0.5.1}/kolega_code/sandbox/local.py +0 -0
- {kolega_code-0.4.0 → kolega_code-0.5.1}/kolega_code/sandbox/serializer.py +0 -0
- {kolega_code-0.4.0 → kolega_code-0.5.1}/kolega_code/sandbox/utils.py +0 -0
- {kolega_code-0.4.0 → kolega_code-0.5.1}/kolega_code/services/browser.py +0 -0
- {kolega_code-0.4.0 → kolega_code-0.5.1}/kolega_code/services/file_system.py +0 -0
- {kolega_code-0.4.0 → kolega_code-0.5.1}/kolega_code/services/html.py +0 -0
- {kolega_code-0.4.0 → kolega_code-0.5.1}/kolega_code/tools/__init__.py +0 -0
- {kolega_code-0.4.0 → kolega_code-0.5.1}/kolega_code/tools/core.py +0 -0
- {kolega_code-0.4.0 → kolega_code-0.5.1}/kolega_code/tools/definitions.py +0 -0
- {kolega_code-0.4.0 → kolega_code-0.5.1}/kolega_code/tools/registry.py +0 -0
- {kolega_code-0.4.0 → kolega_code-0.5.1}/kolega_code/tools/tests/test_definitions.py +0 -0
- {kolega_code-0.4.0 → kolega_code-0.5.1}/run_tests.sh +0 -0
- {kolega_code-0.4.0 → kolega_code-0.5.1}/scripts/install-kolega-code.sh +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: kolega-code
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.5.1
|
|
4
4
|
Summary: Local-first AI coding agent for the terminal
|
|
5
5
|
Project-URL: Homepage, https://kolega-ai.github.io/kolega-code/
|
|
6
6
|
Project-URL: Documentation, https://kolega-ai.github.io/kolega-code/
|
|
@@ -44,7 +44,7 @@ export default defineConfig({
|
|
|
44
44
|
{
|
|
45
45
|
label: "Getting Started",
|
|
46
46
|
items: [
|
|
47
|
-
{ label: "Introduction",
|
|
47
|
+
{ label: "Introduction", link: "/" },
|
|
48
48
|
{ label: "Installation", slug: "getting-started/installation" },
|
|
49
49
|
{ label: "Quick Start", slug: "getting-started/quick-start" },
|
|
50
50
|
],
|
|
@@ -93,6 +93,10 @@ export default defineConfig({
|
|
|
93
93
|
label: "Hooks",
|
|
94
94
|
items: [{ label: "Lifecycle Hooks", slug: "hooks" }],
|
|
95
95
|
},
|
|
96
|
+
{
|
|
97
|
+
label: "Gigacode",
|
|
98
|
+
items: [{ label: "Workflow Orchestration", slug: "gigacode" }],
|
|
99
|
+
},
|
|
96
100
|
{
|
|
97
101
|
label: "How It Works",
|
|
98
102
|
items: [
|
|
@@ -27,6 +27,10 @@ findings. The available dispatch targets include:
|
|
|
27
27
|
- `dispatch_coding_agent` — hand off a self-contained coding task.
|
|
28
28
|
- `dispatch_general_agent` — a general-purpose helper.
|
|
29
29
|
|
|
30
|
+
When [gigacode](../../gigacode/) is enabled, the main agent can also orchestrate
|
|
31
|
+
**many** of these sub-agents at once through a workflow — running them in parallel
|
|
32
|
+
or in pipelines and collecting the results.
|
|
33
|
+
|
|
30
34
|
Sub-agent activity is reported live. In the TUI each sub-agent gets a live card in
|
|
31
35
|
the conversation, and pressing `Ctrl+G` opens the
|
|
32
36
|
[sub-agent inspector](../../tui/interface/#sub-agent-inspector) — a full-screen view
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: Gigacode
|
|
3
|
+
description: Dynamic multi-agent workflow orchestration — fan out many sub-agents with one command.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
import { Aside } from '@astrojs/starlight/components';
|
|
7
|
+
|
|
8
|
+
**Gigacode** lets the agent take on work that's too big for a single pass by
|
|
9
|
+
**orchestrating many sub-agents at once**. When it's enabled and a task calls for
|
|
10
|
+
it, the agent writes a small workflow that fans sub-agents out in parallel,
|
|
11
|
+
pipelines them, or loops over them — then collects the results.
|
|
12
|
+
|
|
13
|
+
It's built for work that's wide rather than deep:
|
|
14
|
+
|
|
15
|
+
- Broad audits and multi-file reviews.
|
|
16
|
+
- Large migrations or mechanical changes spread across many files.
|
|
17
|
+
- Judge panels and adversarial verification, where several agents cross-check each
|
|
18
|
+
other.
|
|
19
|
+
- Implementing a plan whose parts are independent, in parallel.
|
|
20
|
+
|
|
21
|
+
For a quick question or a small, focused edit, the agent just does it directly —
|
|
22
|
+
gigacode is for genuine fan-out.
|
|
23
|
+
|
|
24
|
+
## Turning it on
|
|
25
|
+
|
|
26
|
+
Gigacode is **off by default**. Toggle it with the `/gigacode`
|
|
27
|
+
[slash command](../tui/slash-commands/):
|
|
28
|
+
|
|
29
|
+
| Command | Effect |
|
|
30
|
+
| --- | --- |
|
|
31
|
+
| `/gigacode` | Toggle gigacode on or off |
|
|
32
|
+
| `/gigacode on` | Enable workflow orchestration for the session |
|
|
33
|
+
| `/gigacode off` | Disable it |
|
|
34
|
+
|
|
35
|
+
Once on, it stays on for the session, and the agent decides when a task is worth
|
|
36
|
+
orchestrating. It works in both [Build and Plan modes](../tui/modes/) — see
|
|
37
|
+
[Behavior and safety](#behavior-and-safety) for how each differs.
|
|
38
|
+
|
|
39
|
+
## What you'll see
|
|
40
|
+
|
|
41
|
+
When the agent runs a workflow, the transcript shows **phase headers** and short
|
|
42
|
+
**progress lines** as it works. Each sub-agent it launches appears in the
|
|
43
|
+
[sub-agent inspector](../tui/interface/#sub-agent-inspector) — press `Ctrl+G` to
|
|
44
|
+
watch every agent's live trajectory, grouped by phase.
|
|
45
|
+
|
|
46
|
+
## How it works
|
|
47
|
+
|
|
48
|
+
Under the hood, the agent authors a short **Python script** and runs it with a
|
|
49
|
+
single `run_workflow` tool call. The script uses a handful of primitives:
|
|
50
|
+
|
|
51
|
+
| Primitive | What it does |
|
|
52
|
+
| --- | --- |
|
|
53
|
+
| `agent(...)` | Dispatch one sub-agent and get its result back |
|
|
54
|
+
| `parallel([...])` | Run several sub-agents at once and wait for all of them |
|
|
55
|
+
| `pipeline(items, ...)` | Run each item through a series of stages independently |
|
|
56
|
+
| `phase(...)` / `log(...)` | Report progress to the UI |
|
|
57
|
+
|
|
58
|
+
You don't write these scripts — the agent does. A sketch of what it generates:
|
|
59
|
+
|
|
60
|
+
```python
|
|
61
|
+
# Review three areas in parallel, then synthesize.
|
|
62
|
+
phase("Review")
|
|
63
|
+
findings = await parallel([
|
|
64
|
+
(lambda area=area: agent(f"Review the {area} module for bugs"))
|
|
65
|
+
for area in ["auth", "api", "cli"]
|
|
66
|
+
])
|
|
67
|
+
return findings
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
<Aside type="note">
|
|
71
|
+
Workflows are deterministic and **resumable**. Each run is saved under Kolega
|
|
72
|
+
Code's state directory (`workflows/<run-id>/`) with its script, a journal, and each
|
|
73
|
+
sub-agent's transcript, so an interrupted run can pick up where it left off instead
|
|
74
|
+
of redoing finished work.
|
|
75
|
+
</Aside>
|
|
76
|
+
|
|
77
|
+
## Behavior and safety
|
|
78
|
+
|
|
79
|
+
How workflow sub-agents behave depends on the mode you're in.
|
|
80
|
+
|
|
81
|
+
**Plan mode** — every workflow sub-agent is **read-only** (an investigation agent),
|
|
82
|
+
no matter what the workflow asks for. Use it to fan out parallel research and
|
|
83
|
+
synthesis while planning; it never edits your code.
|
|
84
|
+
|
|
85
|
+
**Build mode** — sub-agents have the full toolset and can edit files and run
|
|
86
|
+
commands.
|
|
87
|
+
|
|
88
|
+
<Aside type="caution" title="Workflows run unattended">
|
|
89
|
+
In Build mode, workflow sub-agents run in **auto permission mode** — they execute
|
|
90
|
+
shell commands and file edits **without prompting**, even when your session is set
|
|
91
|
+
to `ask`. A workflow is a deliberate batch operation, and pausing dozens of
|
|
92
|
+
parallel agents for individual approvals isn't practical. Keep this in mind before
|
|
93
|
+
running a workflow for risky changes.
|
|
94
|
+
</Aside>
|
|
95
|
+
|
|
96
|
+
A few more guarantees:
|
|
97
|
+
|
|
98
|
+
- Workflow sub-agents don't touch your [task list](../tui/modes/) — only the main
|
|
99
|
+
agent manages it, so agents running in parallel can't clobber it.
|
|
100
|
+
- Concurrency is capped, and there's a hard ceiling on the total number of agents a
|
|
101
|
+
single workflow can spawn, as a runaway-loop backstop.
|
|
102
|
+
|
|
103
|
+
## See also
|
|
104
|
+
|
|
105
|
+
- [Build & Plan Modes](../tui/modes/) — how modes shape what agents can do.
|
|
106
|
+
- [Agents](../concepts/agents/) — the sub-agent types a workflow draws on.
|
|
107
|
+
- [Slash Commands](../tui/slash-commands/) — the full command reference.
|
|
108
|
+
- [Interface Tour](../tui/interface/#sub-agent-inspector) — the sub-agent inspector.
|
|
@@ -24,8 +24,11 @@ and your sessions, settings, and API keys are stored on your own machine.
|
|
|
24
24
|
- **Dispatches sub-agents.** For larger tasks, the main agent can hand off to
|
|
25
25
|
specialized agents (investigation, browser, coding, general) and track their
|
|
26
26
|
activity live.
|
|
27
|
+
- **Orchestrates workflows.** With [gigacode](gigacode/), the agent can fan out
|
|
28
|
+
many sub-agents in parallel — for broad audits, large migrations, or
|
|
29
|
+
implementing a plan's independent parts at once.
|
|
27
30
|
- **Works non-interactively too.** Run a single prompt with
|
|
28
|
-
[`kolega-code ask`](
|
|
31
|
+
[`kolega-code ask`](cli/ask/), get JSON output, and save or resume
|
|
29
32
|
sessions.
|
|
30
33
|
|
|
31
34
|
## Two ways to use it
|
|
@@ -36,8 +39,8 @@ and your sessions, settings, and API keys are stored on your own machine.
|
|
|
36
39
|
| **One-shot** | `kolega-code ask "…"` | Scripting, automation, quick questions, CI |
|
|
37
40
|
|
|
38
41
|
There are also helper commands for managing
|
|
39
|
-
[sessions](
|
|
40
|
-
[configuration](
|
|
42
|
+
[sessions](cli/sessions/) and checking your
|
|
43
|
+
[configuration](cli/doctor/).
|
|
41
44
|
|
|
42
45
|
## Bring your own model
|
|
43
46
|
|
|
@@ -45,7 +48,7 @@ Kolega Code talks to a range of LLM providers — including Anthropic, OpenAI,
|
|
|
45
48
|
Google, Moonshot, and DeepSeek — and lets you assign **different models to
|
|
46
49
|
different roles** (a strong long-context model for coding, a fast cheap model for
|
|
47
50
|
small utility calls, and one for extended "thinking"). See
|
|
48
|
-
[Providers & Models](
|
|
51
|
+
[Providers & Models](configuration/providers-and-models/).
|
|
49
52
|
|
|
50
53
|
## What you need
|
|
51
54
|
|
|
@@ -53,5 +56,31 @@ small utility calls, and one for extended "thinking"). See
|
|
|
53
56
|
- An **API key** for at least one supported provider
|
|
54
57
|
- A terminal that supports a modern TUI (most do)
|
|
55
58
|
|
|
56
|
-
|
|
57
|
-
|
|
59
|
+
## Install
|
|
60
|
+
|
|
61
|
+
Install with the script:
|
|
62
|
+
|
|
63
|
+
```bash
|
|
64
|
+
curl -fsSL https://kolega.dev/install-kolega-code.sh | sh
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
Or with [uv](https://docs.astral.sh/uv/):
|
|
68
|
+
|
|
69
|
+
```bash
|
|
70
|
+
uv tool install kolega-code
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
Verify the install and start a session in your project:
|
|
74
|
+
|
|
75
|
+
```bash
|
|
76
|
+
kolega-code --version
|
|
77
|
+
kolega-code .
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
See [Installation](getting-started/installation/) for requirements, other install
|
|
81
|
+
methods, and upgrade/uninstall commands.
|
|
82
|
+
|
|
83
|
+
## Next steps
|
|
84
|
+
|
|
85
|
+
Once you're installed and have a provider key set, head to the
|
|
86
|
+
[Quick Start](getting-started/quick-start/) to run your first session.
|
|
@@ -22,6 +22,10 @@ default to `ask`, so shell commands and file edits prompt before they run. Press
|
|
|
22
22
|
When you choose an “always allow” approval, Kolega Code stores the local rule in
|
|
23
23
|
`.kolega/permissions.json` for that project.
|
|
24
24
|
|
|
25
|
+
If [gigacode](../../gigacode/) is enabled, the sub-agents inside a workflow run in
|
|
26
|
+
`auto` permission mode regardless of this setting — see
|
|
27
|
+
[Behavior and safety](../../gigacode/#behavior-and-safety).
|
|
28
|
+
|
|
25
29
|
## Plan mode
|
|
26
30
|
|
|
27
31
|
A **read-only** planning pass. Plan mode uses a standalone planning agent that does
|
|
@@ -39,7 +43,9 @@ happens next — typically to **implement the plan** or to **keep discussing** i
|
|
|
39
43
|
The decision is presented as a vertical, arrow-key-selectable option list.
|
|
40
44
|
|
|
41
45
|
Use Plan mode when a change is non-trivial and you want to agree on the approach
|
|
42
|
-
before any files are touched.
|
|
46
|
+
before any files are touched. With [gigacode](../../gigacode/) on, a planning agent
|
|
47
|
+
can fan out parallel research across the codebase; those workflow sub-agents stay
|
|
48
|
+
read-only too.
|
|
43
49
|
|
|
44
50
|
## A typical loop
|
|
45
51
|
|
|
@@ -40,6 +40,7 @@ These control the app and your session.
|
|
|
40
40
|
| `/permissions` | Show or switch the shell/edit permission mode |
|
|
41
41
|
| `/model` | Choose the active model |
|
|
42
42
|
| `/effort` | Choose the active model's thinking effort |
|
|
43
|
+
| `/gigacode` | Toggle [gigacode](../../gigacode/) workflow orchestration on or off |
|
|
43
44
|
| `/copy` | Copy the last response to the clipboard |
|
|
44
45
|
| `/version` | Show the Kolega Code version |
|
|
45
46
|
| `/update` | Update Kolega Code to the latest version |
|
|
@@ -231,6 +231,11 @@ class BaseAgent(LogMixin):
|
|
|
231
231
|
self.usage_recorder = context.telemetry.usage_recorder
|
|
232
232
|
self.sub_agent_recorder = context.telemetry.sub_agent_recorder
|
|
233
233
|
|
|
234
|
+
# gigacode (workflow orchestration) opt-in. Off by default; the host toggles
|
|
235
|
+
# it via apply_gigacode(). The run_workflow tool gate reads this live, so
|
|
236
|
+
# toggling takes effect on the next turn without rebuilding the agent.
|
|
237
|
+
self.gigacode_enabled = False
|
|
238
|
+
|
|
234
239
|
self.available_ports = "9001-9999"
|
|
235
240
|
|
|
236
241
|
# Validate that the project path exists and is a directory using the filesystem
|
|
@@ -364,6 +369,22 @@ class BaseAgent(LogMixin):
|
|
|
364
369
|
"""Serializes the message history into a list of dictionaries using custom methods."""
|
|
365
370
|
return self.conversation.dump()
|
|
366
371
|
|
|
372
|
+
def apply_gigacode(self, enabled: bool, prompt_extension=None) -> None:
|
|
373
|
+
"""Enable or disable gigacode workflow orchestration for this session.
|
|
374
|
+
|
|
375
|
+
Flips the ``run_workflow`` tool gate and refreshes the system prompt to
|
|
376
|
+
include or drop the authoring guide. Safe to call mid-session; the tool
|
|
377
|
+
registry and the next turn pick up the change.
|
|
378
|
+
"""
|
|
379
|
+
self.gigacode_enabled = enabled
|
|
380
|
+
extensions = [ext for ext in (self.prompt_extensions or []) if getattr(ext, "id", None) != "gigacode"]
|
|
381
|
+
if enabled and prompt_extension is not None:
|
|
382
|
+
extensions.append(prompt_extension)
|
|
383
|
+
self.prompt_extensions = extensions
|
|
384
|
+
initialize = getattr(self, "_initialize_system_prompt", None)
|
|
385
|
+
if callable(initialize):
|
|
386
|
+
initialize()
|
|
387
|
+
|
|
367
388
|
def restore_message_history(self, serialized_history: List[Dict[str, Any]]) -> None:
|
|
368
389
|
"""Restores the message history from a list of dictionaries using custom methods."""
|
|
369
390
|
self.conversation.restore(serialized_history)
|
|
@@ -116,7 +116,6 @@ class CoderAgent(BaseAgent, LogMixin):
|
|
|
116
116
|
"get_tool_list",
|
|
117
117
|
"log_error",
|
|
118
118
|
"log_info",
|
|
119
|
-
"run_command", # Disabled: unreliable completion detection, use run_command_tracked instead
|
|
120
119
|
# Exclude task-specific dispatch tools since coder shouldn't call itself or other agents
|
|
121
120
|
"dispatch_coding_agent",
|
|
122
121
|
]
|
|
@@ -112,7 +112,6 @@ class GeneralAgent(BaseAgent):
|
|
|
112
112
|
"get_tool_list",
|
|
113
113
|
"log_error",
|
|
114
114
|
"log_info",
|
|
115
|
-
"run_command", # Disabled: unreliable completion detection, use run_command_tracked instead
|
|
116
115
|
# Recursion guard: a general sub-agent may not spawn further sub-agents
|
|
117
116
|
*ToolCollection.agent_dispatch_tools,
|
|
118
117
|
]
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
"""gigacode — dynamic multi-agent workflow orchestration.
|
|
2
|
+
|
|
3
|
+
A workflow is a short authored Python script whose primitives (``agent``,
|
|
4
|
+
``parallel``, ``pipeline``, ``phase``, ``log``) fan out sub-agents with real
|
|
5
|
+
control flow. The pieces:
|
|
6
|
+
|
|
7
|
+
- :mod:`executor` — validate ``meta``, wrap the body, run it in a curated namespace
|
|
8
|
+
- :mod:`runtime` — the primitives, concurrency caps, and resume
|
|
9
|
+
- :mod:`budget` — token ceiling shared across the run
|
|
10
|
+
- :mod:`journal` — state-dir artifacts and the resume journal
|
|
11
|
+
- :mod:`types` — the dispatch/emit interface the production adapter implements
|
|
12
|
+
"""
|
|
13
|
+
|
|
14
|
+
from .budget import Budget
|
|
15
|
+
from .errors import (
|
|
16
|
+
WorkflowAgentCapExceeded,
|
|
17
|
+
WorkflowBudgetExceeded,
|
|
18
|
+
WorkflowError,
|
|
19
|
+
WorkflowScriptError,
|
|
20
|
+
)
|
|
21
|
+
from .executor import extract_meta, run_script, safe_builtins
|
|
22
|
+
from .journal import RunJournal, saved_workflows_dir, workflows_root
|
|
23
|
+
from .runtime import DEFAULT_AGENT_CAP, MAX_FANOUT, WorkflowRuntime, default_concurrency
|
|
24
|
+
from .types import AgentRunResult, AgentRunSpec, DispatchFn, EmitFn
|
|
25
|
+
|
|
26
|
+
__all__ = [
|
|
27
|
+
"Budget",
|
|
28
|
+
"WorkflowError",
|
|
29
|
+
"WorkflowScriptError",
|
|
30
|
+
"WorkflowBudgetExceeded",
|
|
31
|
+
"WorkflowAgentCapExceeded",
|
|
32
|
+
"extract_meta",
|
|
33
|
+
"run_script",
|
|
34
|
+
"safe_builtins",
|
|
35
|
+
"RunJournal",
|
|
36
|
+
"workflows_root",
|
|
37
|
+
"saved_workflows_dir",
|
|
38
|
+
"WorkflowRuntime",
|
|
39
|
+
"default_concurrency",
|
|
40
|
+
"MAX_FANOUT",
|
|
41
|
+
"DEFAULT_AGENT_CAP",
|
|
42
|
+
"AgentRunSpec",
|
|
43
|
+
"AgentRunResult",
|
|
44
|
+
"DispatchFn",
|
|
45
|
+
"EmitFn",
|
|
46
|
+
]
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
"""Token budget for a workflow run.
|
|
2
|
+
|
|
3
|
+
Mirrors the ultracode ``budget`` global: a hard ceiling on output tokens spent
|
|
4
|
+
across every sub-agent the run dispatches. ``total`` of ``None`` means unbounded
|
|
5
|
+
(``remaining()`` is ``inf``), which is the common case when no ``+Nk`` directive
|
|
6
|
+
was given.
|
|
7
|
+
"""
|
|
8
|
+
|
|
9
|
+
from __future__ import annotations
|
|
10
|
+
|
|
11
|
+
from typing import Optional, Union
|
|
12
|
+
|
|
13
|
+
from .errors import WorkflowBudgetExceeded
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
class Budget:
|
|
17
|
+
"""Aggregate token accounting shared across all agents in a run."""
|
|
18
|
+
|
|
19
|
+
def __init__(self, total: Optional[int] = None) -> None:
|
|
20
|
+
self.total: Optional[int] = total
|
|
21
|
+
self._spent: int = 0
|
|
22
|
+
|
|
23
|
+
def add(self, tokens: Optional[int]) -> None:
|
|
24
|
+
"""Fold one sub-agent's token usage into the running total."""
|
|
25
|
+
try:
|
|
26
|
+
self._spent += max(0, int(tokens or 0))
|
|
27
|
+
except (TypeError, ValueError):
|
|
28
|
+
# Defensive: a provider that doesn't report usage shouldn't crash a run.
|
|
29
|
+
pass
|
|
30
|
+
|
|
31
|
+
def spent(self) -> int:
|
|
32
|
+
"""Output tokens spent so far across the whole run."""
|
|
33
|
+
return self._spent
|
|
34
|
+
|
|
35
|
+
def remaining(self) -> Union[int, float]:
|
|
36
|
+
"""Tokens left before the ceiling, or ``inf`` when unbounded."""
|
|
37
|
+
if self.total is None:
|
|
38
|
+
return float("inf")
|
|
39
|
+
return max(0, self.total - self._spent)
|
|
40
|
+
|
|
41
|
+
def check(self) -> None:
|
|
42
|
+
"""Raise if the ceiling has been reached. Called before each dispatch."""
|
|
43
|
+
if self.total is not None and self._spent >= self.total:
|
|
44
|
+
raise WorkflowBudgetExceeded(
|
|
45
|
+
f"workflow token budget exhausted: spent {self._spent} of {self.total}"
|
|
46
|
+
)
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"""Exceptions raised by the gigacode workflow runtime."""
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
class WorkflowError(RuntimeError):
|
|
5
|
+
"""Base class for all workflow orchestration failures."""
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
class WorkflowScriptError(WorkflowError):
|
|
9
|
+
"""The authored script is malformed or used a primitive incorrectly.
|
|
10
|
+
|
|
11
|
+
Raised for problems the model can fix by rewriting the script: a missing or
|
|
12
|
+
non-literal ``meta`` block, a non-string prompt, an over-large fan-out, or an
|
|
13
|
+
illegally nested ``workflow()`` call.
|
|
14
|
+
"""
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
class WorkflowBudgetExceeded(WorkflowError):
|
|
18
|
+
"""The run reached its token budget ceiling; further ``agent()`` calls abort."""
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
class WorkflowAgentCapExceeded(WorkflowError):
|
|
22
|
+
"""The run exceeded the lifetime agent-count backstop (runaway-loop guard)."""
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
"""Load and run an authored Python orchestration script.
|
|
2
|
+
|
|
3
|
+
The script runs in-process in a *curated namespace*: a restricted ``__builtins__``
|
|
4
|
+
(no ``import``/``open``/``eval``/``exec``, no ``time``/``random`` so resume stays
|
|
5
|
+
deterministic) plus the injected primitives (``agent``/``parallel``/``pipeline``/
|
|
6
|
+
``phase``/``log``/``workflow``) and the ``args``/``budget`` globals.
|
|
7
|
+
|
|
8
|
+
This is a *soft* sandbox, not a security boundary — the agent already runs
|
|
9
|
+
arbitrary shell via its command tools. The restrictions exist to keep scripts
|
|
10
|
+
deterministic (a hard requirement for resume) and to fail loudly on the easy
|
|
11
|
+
mistakes rather than to contain a hostile script.
|
|
12
|
+
"""
|
|
13
|
+
|
|
14
|
+
from __future__ import annotations
|
|
15
|
+
|
|
16
|
+
import ast
|
|
17
|
+
import builtins
|
|
18
|
+
from typing import Any, Dict
|
|
19
|
+
|
|
20
|
+
from .errors import WorkflowScriptError
|
|
21
|
+
|
|
22
|
+
WRAPPER_NAME = "__workflow_main__"
|
|
23
|
+
|
|
24
|
+
# Builtins the script may use. Deliberately omits __import__, open, eval, exec,
|
|
25
|
+
# compile, input, and the time/random surface. __build_class__ is included so a
|
|
26
|
+
# script that defines a helper class doesn't crash.
|
|
27
|
+
_SAFE_BUILTIN_NAMES = (
|
|
28
|
+
"abs", "all", "any", "ascii", "bin", "bool", "bytearray", "bytes", "callable",
|
|
29
|
+
"chr", "dict", "divmod", "enumerate", "filter", "float", "format", "frozenset",
|
|
30
|
+
"getattr", "hasattr", "hash", "hex", "int", "isinstance", "issubclass", "iter",
|
|
31
|
+
"len", "list", "map", "max", "min", "next", "oct", "ord", "pow", "range",
|
|
32
|
+
"repr", "reversed", "round", "set", "setattr", "slice", "sorted", "str", "sum",
|
|
33
|
+
"tuple", "type", "zip",
|
|
34
|
+
# exception types scripts may raise/catch
|
|
35
|
+
"Exception", "ValueError", "KeyError", "IndexError", "TypeError", "RuntimeError",
|
|
36
|
+
"StopIteration", "StopAsyncIteration", "ArithmeticError", "ZeroDivisionError",
|
|
37
|
+
"AttributeError", "NotImplementedError", "AssertionError",
|
|
38
|
+
# class definition support
|
|
39
|
+
"__build_class__",
|
|
40
|
+
)
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
def safe_builtins() -> Dict[str, Any]:
|
|
44
|
+
"""A restricted ``__builtins__`` mapping for workflow script execution."""
|
|
45
|
+
table: Dict[str, Any] = {name: getattr(builtins, name) for name in _SAFE_BUILTIN_NAMES if hasattr(builtins, name)}
|
|
46
|
+
table["True"] = True
|
|
47
|
+
table["False"] = False
|
|
48
|
+
table["None"] = None
|
|
49
|
+
return table
|
|
50
|
+
|
|
51
|
+
|
|
52
|
+
def extract_meta(source: str) -> Dict[str, Any]:
|
|
53
|
+
"""Parse and validate the module-level ``meta = {...}`` literal.
|
|
54
|
+
|
|
55
|
+
Mirrors the ultracode rule that ``meta`` must be a pure literal (no variables,
|
|
56
|
+
calls, or interpolation) so it can be read without executing the script.
|
|
57
|
+
"""
|
|
58
|
+
try:
|
|
59
|
+
tree = ast.parse(source)
|
|
60
|
+
except SyntaxError as exc:
|
|
61
|
+
raise WorkflowScriptError(f"workflow script has a syntax error: {exc}") from exc
|
|
62
|
+
|
|
63
|
+
for node in tree.body:
|
|
64
|
+
if isinstance(node, ast.Assign):
|
|
65
|
+
for target in node.targets:
|
|
66
|
+
if isinstance(target, ast.Name) and target.id == "meta":
|
|
67
|
+
try:
|
|
68
|
+
value = ast.literal_eval(node.value)
|
|
69
|
+
except (ValueError, SyntaxError) as exc:
|
|
70
|
+
raise WorkflowScriptError(
|
|
71
|
+
"`meta` must be a pure literal dict (no variables, calls, or f-strings)."
|
|
72
|
+
) from exc
|
|
73
|
+
if not isinstance(value, dict):
|
|
74
|
+
raise WorkflowScriptError("`meta` must be a dict literal.")
|
|
75
|
+
if not value.get("name") or not value.get("description"):
|
|
76
|
+
raise WorkflowScriptError("`meta` must include non-empty `name` and `description`.")
|
|
77
|
+
return value
|
|
78
|
+
|
|
79
|
+
raise WorkflowScriptError(
|
|
80
|
+
"workflow script must define a top-level `meta = {\"name\": ..., \"description\": ...}` literal."
|
|
81
|
+
)
|
|
82
|
+
|
|
83
|
+
|
|
84
|
+
def _wrap_as_coroutine(source: str) -> ast.Module:
|
|
85
|
+
"""Wrap the whole script body in an ``async def`` so top-level ``await`` and
|
|
86
|
+
``return`` are legal. Done at the AST level (not by text indentation) so
|
|
87
|
+
multi-line string literals are never corrupted.
|
|
88
|
+
"""
|
|
89
|
+
tree = ast.parse(source)
|
|
90
|
+
func = ast.AsyncFunctionDef(
|
|
91
|
+
name=WRAPPER_NAME,
|
|
92
|
+
args=ast.arguments(
|
|
93
|
+
posonlyargs=[], args=[], vararg=None, kwonlyargs=[], kw_defaults=[], kwarg=None, defaults=[]
|
|
94
|
+
),
|
|
95
|
+
body=tree.body or [ast.Pass()],
|
|
96
|
+
decorator_list=[],
|
|
97
|
+
returns=None,
|
|
98
|
+
type_comment=None,
|
|
99
|
+
)
|
|
100
|
+
module = ast.Module(body=[func], type_ignores=[])
|
|
101
|
+
ast.fix_missing_locations(module)
|
|
102
|
+
return module
|
|
103
|
+
|
|
104
|
+
|
|
105
|
+
async def run_script(source: str, namespace: Dict[str, Any]) -> Any:
|
|
106
|
+
"""Compile and run ``source`` in ``namespace``; return the script's value.
|
|
107
|
+
|
|
108
|
+
``namespace`` must already carry ``__builtins__`` and the injected globals.
|
|
109
|
+
"""
|
|
110
|
+
try:
|
|
111
|
+
module = _wrap_as_coroutine(source)
|
|
112
|
+
code = compile(module, "<workflow>", "exec")
|
|
113
|
+
except SyntaxError as exc:
|
|
114
|
+
raise WorkflowScriptError(f"workflow script has a syntax error: {exc}") from exc
|
|
115
|
+
|
|
116
|
+
exec(code, namespace) # noqa: S102 - curated namespace; see module docstring
|
|
117
|
+
main = namespace[WRAPPER_NAME]
|
|
118
|
+
return await main()
|