tau-coding-agent 0.3.0__tar.gz → 0.3.5__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.
- {tau_coding_agent-0.3.0/tau_coding_agent.egg-info → tau_coding_agent-0.3.5}/PKG-INFO +1 -1
- {tau_coding_agent-0.3.0 → tau_coding_agent-0.3.5}/docs/extensions.md +5 -3
- {tau_coding_agent-0.3.0 → tau_coding_agent-0.3.5}/pyproject.toml +12 -1
- tau_coding_agent-0.3.5/tau/agent/__init__.py +11 -0
- {tau_coding_agent-0.3.0 → tau_coding_agent-0.3.5}/tau/agent/prompt/__init__.py +4 -4
- {tau_coding_agent-0.3.0 → tau_coding_agent-0.3.5}/tau/agent/prompt/builder.py +111 -17
- {tau_coding_agent-0.3.0 → tau_coding_agent-0.3.5}/tau/agent/prompt/types.py +4 -1
- {tau_coding_agent-0.3.0 → tau_coding_agent-0.3.5}/tau/agent/service.py +69 -33
- {tau_coding_agent-0.3.0 → tau_coding_agent-0.3.5}/tau/agent/types.py +11 -9
- {tau_coding_agent-0.3.0 → tau_coding_agent-0.3.5}/tau/auth/manager.py +54 -21
- {tau_coding_agent-0.3.0 → tau_coding_agent-0.3.5}/tau/auth/storage.py +20 -8
- {tau_coding_agent-0.3.0 → tau_coding_agent-0.3.5}/tau/auth/types.py +11 -6
- {tau_coding_agent-0.3.0 → tau_coding_agent-0.3.5}/tau/builtins/commands/__init__.py +4 -4
- {tau_coding_agent-0.3.0 → tau_coding_agent-0.3.5}/tau/builtins/commands/clear.py +1 -0
- {tau_coding_agent-0.3.0 → tau_coding_agent-0.3.5}/tau/builtins/commands/compact.py +2 -0
- {tau_coding_agent-0.3.0 → tau_coding_agent-0.3.5}/tau/builtins/commands/reload.py +1 -0
- {tau_coding_agent-0.3.0 → tau_coding_agent-0.3.5}/tau/builtins/extensions/footer/__init__.py +3 -2
- {tau_coding_agent-0.3.0 → tau_coding_agent-0.3.5}/tau/builtins/extensions/footer/git.py +2 -0
- {tau_coding_agent-0.3.0 → tau_coding_agent-0.3.5}/tau/builtins/extensions/footer/model.py +2 -0
- {tau_coding_agent-0.3.0 → tau_coding_agent-0.3.5}/tau/builtins/extensions/footer/utils.py +6 -5
- {tau_coding_agent-0.3.0 → tau_coding_agent-0.3.5}/tau/builtins/extensions/header/__init__.py +1 -0
- tau_coding_agent-0.3.5/tau/builtins/models/audio.py +260 -0
- tau_coding_agent-0.3.5/tau/builtins/models/image.py +228 -0
- tau_coding_agent-0.3.5/tau/builtins/models/text.py +6480 -0
- tau_coding_agent-0.3.5/tau/builtins/models/video.py +239 -0
- tau_coding_agent-0.3.5/tau/builtins/providers/audio.py +10 -0
- tau_coding_agent-0.3.5/tau/builtins/providers/image.py +15 -0
- tau_coding_agent-0.3.5/tau/builtins/providers/text.py +91 -0
- tau_coding_agent-0.3.5/tau/builtins/providers/video.py +8 -0
- {tau_coding_agent-0.3.0 → tau_coding_agent-0.3.5}/tau/builtins/tools/edit.py +69 -28
- {tau_coding_agent-0.3.0 → tau_coding_agent-0.3.5}/tau/builtins/tools/glob.py +31 -13
- {tau_coding_agent-0.3.0 → tau_coding_agent-0.3.5}/tau/builtins/tools/grep.py +53 -20
- {tau_coding_agent-0.3.0 → tau_coding_agent-0.3.5}/tau/builtins/tools/ls.py +31 -15
- {tau_coding_agent-0.3.0 → tau_coding_agent-0.3.5}/tau/builtins/tools/read.py +40 -15
- {tau_coding_agent-0.3.0 → tau_coding_agent-0.3.5}/tau/builtins/tools/terminal.py +37 -15
- {tau_coding_agent-0.3.0 → tau_coding_agent-0.3.5}/tau/builtins/tools/write.py +31 -14
- {tau_coding_agent-0.3.0 → tau_coding_agent-0.3.5}/tau/commands/__init__.py +4 -4
- {tau_coding_agent-0.3.0 → tau_coding_agent-0.3.5}/tau/commands/registry.py +2 -1
- {tau_coding_agent-0.3.0 → tau_coding_agent-0.3.5}/tau/commands/types.py +7 -4
- {tau_coding_agent-0.3.0 → tau_coding_agent-0.3.5}/tau/console/cli.py +107 -47
- {tau_coding_agent-0.3.0 → tau_coding_agent-0.3.5}/tau/console/commands/auth.py +15 -4
- {tau_coding_agent-0.3.0 → tau_coding_agent-0.3.5}/tau/console/commands/packages.py +15 -11
- {tau_coding_agent-0.3.0 → tau_coding_agent-0.3.5}/tau/console/commands/update.py +5 -5
- {tau_coding_agent-0.3.0 → tau_coding_agent-0.3.5}/tau/core/registry.py +5 -4
- {tau_coding_agent-0.3.0 → tau_coding_agent-0.3.5}/tau/engine/__init__.py +17 -13
- {tau_coding_agent-0.3.0 → tau_coding_agent-0.3.5}/tau/engine/service.py +183 -106
- {tau_coding_agent-0.3.0 → tau_coding_agent-0.3.5}/tau/engine/types.py +61 -36
- {tau_coding_agent-0.3.0 → tau_coding_agent-0.3.5}/tau/extensions/__init__.py +7 -2
- {tau_coding_agent-0.3.0 → tau_coding_agent-0.3.5}/tau/extensions/api.py +79 -40
- {tau_coding_agent-0.3.0 → tau_coding_agent-0.3.5}/tau/extensions/context.py +23 -7
- {tau_coding_agent-0.3.0 → tau_coding_agent-0.3.5}/tau/extensions/events.py +2 -1
- {tau_coding_agent-0.3.0 → tau_coding_agent-0.3.5}/tau/extensions/loader.py +39 -22
- {tau_coding_agent-0.3.0 → tau_coding_agent-0.3.5}/tau/extensions/runtime.py +37 -24
- {tau_coding_agent-0.3.0 → tau_coding_agent-0.3.5}/tau/extensions/settings.py +5 -8
- {tau_coding_agent-0.3.0 → tau_coding_agent-0.3.5}/tau/hooks/__init__.py +117 -81
- {tau_coding_agent-0.3.0 → tau_coding_agent-0.3.5}/tau/hooks/engine.py +84 -44
- {tau_coding_agent-0.3.0 → tau_coding_agent-0.3.5}/tau/hooks/inference.py +4 -2
- {tau_coding_agent-0.3.0 → tau_coding_agent-0.3.5}/tau/hooks/runtime.py +36 -16
- {tau_coding_agent-0.3.0 → tau_coding_agent-0.3.5}/tau/hooks/service.py +7 -6
- {tau_coding_agent-0.3.0 → tau_coding_agent-0.3.5}/tau/hooks/session.py +45 -28
- {tau_coding_agent-0.3.0 → tau_coding_agent-0.3.5}/tau/hooks/tui.py +14 -8
- {tau_coding_agent-0.3.0 → tau_coding_agent-0.3.5}/tau/hooks/types.py +49 -17
- {tau_coding_agent-0.3.0 → tau_coding_agent-0.3.5}/tau/inference/__init__.py +40 -30
- {tau_coding_agent-0.3.0 → tau_coding_agent-0.3.5}/tau/inference/api/audio/builtins.py +3 -3
- {tau_coding_agent-0.3.0 → tau_coding_agent-0.3.5}/tau/inference/api/audio/elevenlabs_audio.py +6 -9
- {tau_coding_agent-0.3.0 → tau_coding_agent-0.3.5}/tau/inference/api/audio/gemini_audio.py +4 -2
- {tau_coding_agent-0.3.0 → tau_coding_agent-0.3.5}/tau/inference/api/audio/openai_audio.py +3 -6
- {tau_coding_agent-0.3.0 → tau_coding_agent-0.3.5}/tau/inference/api/audio/registry.py +3 -1
- {tau_coding_agent-0.3.0 → tau_coding_agent-0.3.5}/tau/inference/api/audio/sarvam_audio.py +1 -2
- {tau_coding_agent-0.3.0 → tau_coding_agent-0.3.5}/tau/inference/api/audio/service.py +31 -16
- {tau_coding_agent-0.3.0 → tau_coding_agent-0.3.5}/tau/inference/api/audio/utils.py +16 -15
- {tau_coding_agent-0.3.0 → tau_coding_agent-0.3.5}/tau/inference/api/image/base.py +1 -0
- {tau_coding_agent-0.3.0 → tau_coding_agent-0.3.5}/tau/inference/api/image/builtins.py +2 -2
- {tau_coding_agent-0.3.0 → tau_coding_agent-0.3.5}/tau/inference/api/image/gemini_image.py +3 -3
- {tau_coding_agent-0.3.0 → tau_coding_agent-0.3.5}/tau/inference/api/image/openai_image.py +8 -4
- {tau_coding_agent-0.3.0 → tau_coding_agent-0.3.5}/tau/inference/api/image/openrouter.py +17 -8
- {tau_coding_agent-0.3.0 → tau_coding_agent-0.3.5}/tau/inference/api/image/registry.py +3 -1
- {tau_coding_agent-0.3.0 → tau_coding_agent-0.3.5}/tau/inference/api/image/service.py +11 -9
- {tau_coding_agent-0.3.0 → tau_coding_agent-0.3.5}/tau/inference/api/registry.py +7 -6
- {tau_coding_agent-0.3.0 → tau_coding_agent-0.3.5}/tau/inference/api/text/anthropic_claude_code.py +73 -33
- {tau_coding_agent-0.3.0 → tau_coding_agent-0.3.5}/tau/inference/api/text/anthropic_messages.py +70 -31
- {tau_coding_agent-0.3.0 → tau_coding_agent-0.3.5}/tau/inference/api/text/base.py +5 -4
- tau_coding_agent-0.3.5/tau/inference/api/text/builtins.py +25 -0
- {tau_coding_agent-0.3.0 → tau_coding_agent-0.3.5}/tau/inference/api/text/gemini_generate.py +100 -40
- {tau_coding_agent-0.3.0 → tau_coding_agent-0.3.5}/tau/inference/api/text/github_copilot_chat.py +58 -27
- {tau_coding_agent-0.3.0 → tau_coding_agent-0.3.5}/tau/inference/api/text/google_antigravity.py +212 -139
- {tau_coding_agent-0.3.0 → tau_coding_agent-0.3.5}/tau/inference/api/text/mistral_chat.py +121 -58
- {tau_coding_agent-0.3.0 → tau_coding_agent-0.3.5}/tau/inference/api/text/ollama_chat.py +88 -31
- {tau_coding_agent-0.3.0 → tau_coding_agent-0.3.5}/tau/inference/api/text/openai_codex_responses.py +99 -49
- {tau_coding_agent-0.3.0 → tau_coding_agent-0.3.5}/tau/inference/api/text/openai_completions.py +74 -30
- {tau_coding_agent-0.3.0 → tau_coding_agent-0.3.5}/tau/inference/api/text/openai_responses.py +143 -49
- {tau_coding_agent-0.3.0 → tau_coding_agent-0.3.5}/tau/inference/api/text/registry.py +7 -5
- {tau_coding_agent-0.3.0 → tau_coding_agent-0.3.5}/tau/inference/api/text/service.py +113 -58
- {tau_coding_agent-0.3.0 → tau_coding_agent-0.3.5}/tau/inference/api/text/utils.py +103 -34
- {tau_coding_agent-0.3.0 → tau_coding_agent-0.3.5}/tau/inference/api/video/base.py +0 -1
- {tau_coding_agent-0.3.0 → tau_coding_agent-0.3.5}/tau/inference/api/video/fal_video.py +16 -3
- {tau_coding_agent-0.3.0 → tau_coding_agent-0.3.5}/tau/inference/api/video/openrouter_video.py +16 -3
- {tau_coding_agent-0.3.0 → tau_coding_agent-0.3.5}/tau/inference/api/video/registry.py +2 -0
- {tau_coding_agent-0.3.0 → tau_coding_agent-0.3.5}/tau/inference/api/video/service.py +14 -12
- {tau_coding_agent-0.3.0 → tau_coding_agent-0.3.5}/tau/inference/model/registry.py +8 -2
- {tau_coding_agent-0.3.0 → tau_coding_agent-0.3.5}/tau/inference/model/types.py +24 -7
- {tau_coding_agent-0.3.0 → tau_coding_agent-0.3.5}/tau/inference/provider/oauth/__init__.py +18 -4
- {tau_coding_agent-0.3.0 → tau_coding_agent-0.3.5}/tau/inference/provider/oauth/anthropic_claude_code.py +85 -42
- {tau_coding_agent-0.3.0 → tau_coding_agent-0.3.5}/tau/inference/provider/oauth/github_copilot.py +67 -36
- {tau_coding_agent-0.3.0 → tau_coding_agent-0.3.5}/tau/inference/provider/oauth/google_antigravity.py +85 -46
- {tau_coding_agent-0.3.0 → tau_coding_agent-0.3.5}/tau/inference/provider/oauth/openai_codex.py +80 -42
- {tau_coding_agent-0.3.0 → tau_coding_agent-0.3.5}/tau/inference/provider/oauth/types.py +7 -7
- {tau_coding_agent-0.3.0 → tau_coding_agent-0.3.5}/tau/inference/provider/oauth/utils.py +21 -13
- {tau_coding_agent-0.3.0 → tau_coding_agent-0.3.5}/tau/inference/provider/registry.py +16 -3
- {tau_coding_agent-0.3.0 → tau_coding_agent-0.3.5}/tau/inference/provider/types.py +31 -18
- {tau_coding_agent-0.3.0 → tau_coding_agent-0.3.5}/tau/inference/types.py +127 -94
- tau_coding_agent-0.3.5/tau/inference/utils.py +350 -0
- {tau_coding_agent-0.3.0 → tau_coding_agent-0.3.5}/tau/message/types.py +63 -16
- {tau_coding_agent-0.3.0 → tau_coding_agent-0.3.5}/tau/message/utils.py +13 -8
- {tau_coding_agent-0.3.0 → tau_coding_agent-0.3.5}/tau/packages/__init__.py +2 -2
- {tau_coding_agent-0.3.0 → tau_coding_agent-0.3.5}/tau/packages/manager.py +15 -13
- {tau_coding_agent-0.3.0 → tau_coding_agent-0.3.5}/tau/packages/types.py +4 -5
- {tau_coding_agent-0.3.0 → tau_coding_agent-0.3.5}/tau/packages/utils.py +19 -3
- {tau_coding_agent-0.3.0 → tau_coding_agent-0.3.5}/tau/prompts/expand.py +5 -1
- {tau_coding_agent-0.3.0 → tau_coding_agent-0.3.5}/tau/prompts/loader.py +1 -1
- {tau_coding_agent-0.3.0 → tau_coding_agent-0.3.5}/tau/prompts/registry.py +4 -1
- {tau_coding_agent-0.3.0 → tau_coding_agent-0.3.5}/tau/rpc/mode.py +166 -72
- {tau_coding_agent-0.3.0 → tau_coding_agent-0.3.5}/tau/rpc/types.py +42 -1
- {tau_coding_agent-0.3.0 → tau_coding_agent-0.3.5}/tau/runtime/service.py +27 -17
- {tau_coding_agent-0.3.0 → tau_coding_agent-0.3.5}/tau/runtime/types.py +42 -32
- {tau_coding_agent-0.3.0 → tau_coding_agent-0.3.5}/tau/session/branch_summarization.py +23 -10
- {tau_coding_agent-0.3.0 → tau_coding_agent-0.3.5}/tau/session/compaction.py +87 -49
- {tau_coding_agent-0.3.0 → tau_coding_agent-0.3.5}/tau/session/manager.py +67 -36
- {tau_coding_agent-0.3.0 → tau_coding_agent-0.3.5}/tau/session/types.py +12 -17
- {tau_coding_agent-0.3.0 → tau_coding_agent-0.3.5}/tau/session/utils.py +44 -23
- {tau_coding_agent-0.3.0 → tau_coding_agent-0.3.5}/tau/settings/manager.py +167 -96
- {tau_coding_agent-0.3.0 → tau_coding_agent-0.3.5}/tau/settings/paths.py +22 -1
- tau_coding_agent-0.3.5/tau/settings/storage.py +68 -0
- tau_coding_agent-0.3.5/tau/settings/types.py +192 -0
- {tau_coding_agent-0.3.0 → tau_coding_agent-0.3.5}/tau/settings/utils.py +3 -1
- {tau_coding_agent-0.3.0 → tau_coding_agent-0.3.5}/tau/skills/loader.py +4 -2
- {tau_coding_agent-0.3.0 → tau_coding_agent-0.3.5}/tau/skills/registry.py +11 -5
- {tau_coding_agent-0.3.0 → tau_coding_agent-0.3.5}/tau/themes/loader.py +155 -86
- {tau_coding_agent-0.3.0 → tau_coding_agent-0.3.5}/tau/themes/registry.py +10 -10
- {tau_coding_agent-0.3.0 → tau_coding_agent-0.3.5}/tau/themes/types.py +2 -2
- {tau_coding_agent-0.3.0 → tau_coding_agent-0.3.5}/tau/tool/registry.py +1 -0
- {tau_coding_agent-0.3.0 → tau_coding_agent-0.3.5}/tau/tool/types.py +29 -20
- {tau_coding_agent-0.3.0 → tau_coding_agent-0.3.5}/tau/trust/__init__.py +2 -2
- {tau_coding_agent-0.3.0 → tau_coding_agent-0.3.5}/tau/trust/manager.py +4 -2
- {tau_coding_agent-0.3.0 → tau_coding_agent-0.3.5}/tau/trust/types.py +1 -0
- {tau_coding_agent-0.3.0 → tau_coding_agent-0.3.5}/tau/trust/utils.py +8 -6
- {tau_coding_agent-0.3.0 → tau_coding_agent-0.3.5}/tau/tui/__init__.py +10 -10
- {tau_coding_agent-0.3.0 → tau_coding_agent-0.3.5}/tau/tui/agent_hooks.py +37 -25
- {tau_coding_agent-0.3.0 → tau_coding_agent-0.3.5}/tau/tui/ansi.py +83 -40
- {tau_coding_agent-0.3.0 → tau_coding_agent-0.3.5}/tau/tui/app.py +140 -66
- {tau_coding_agent-0.3.0 → tau_coding_agent-0.3.5}/tau/tui/autocomplete.py +7 -4
- {tau_coding_agent-0.3.0 → tau_coding_agent-0.3.5}/tau/tui/capabilities.py +7 -2
- {tau_coding_agent-0.3.0 → tau_coding_agent-0.3.5}/tau/tui/commands/appearance.py +58 -32
- {tau_coding_agent-0.3.0 → tau_coding_agent-0.3.5}/tau/tui/commands/auth.py +54 -25
- {tau_coding_agent-0.3.0 → tau_coding_agent-0.3.5}/tau/tui/commands/context.py +7 -4
- {tau_coding_agent-0.3.0 → tau_coding_agent-0.3.5}/tau/tui/commands/misc.py +9 -3
- {tau_coding_agent-0.3.0 → tau_coding_agent-0.3.5}/tau/tui/commands/model.py +15 -4
- {tau_coding_agent-0.3.0 → tau_coding_agent-0.3.5}/tau/tui/commands/session.py +49 -27
- {tau_coding_agent-0.3.0 → tau_coding_agent-0.3.5}/tau/tui/component.py +13 -23
- {tau_coding_agent-0.3.0 → tau_coding_agent-0.3.5}/tau/tui/components/autocomplete_manager.py +14 -10
- {tau_coding_agent-0.3.0 → tau_coding_agent-0.3.5}/tau/tui/components/autocomplete_picker.py +17 -12
- {tau_coding_agent-0.3.0 → tau_coding_agent-0.3.5}/tau/tui/components/box.py +9 -8
- {tau_coding_agent-0.3.0 → tau_coding_agent-0.3.5}/tau/tui/components/command_palette.py +18 -12
- {tau_coding_agent-0.3.0 → tau_coding_agent-0.3.5}/tau/tui/components/dynamic_border.py +1 -1
- {tau_coding_agent-0.3.0 → tau_coding_agent-0.3.5}/tau/tui/components/file_picker.py +32 -26
- {tau_coding_agent-0.3.0 → tau_coding_agent-0.3.5}/tau/tui/components/image.py +9 -4
- {tau_coding_agent-0.3.0 → tau_coding_agent-0.3.5}/tau/tui/components/inline_selector.py +6 -4
- {tau_coding_agent-0.3.0 → tau_coding_agent-0.3.5}/tau/tui/components/layout.py +87 -47
- {tau_coding_agent-0.3.0 → tau_coding_agent-0.3.5}/tau/tui/components/message_list.py +118 -88
- {tau_coding_agent-0.3.0 → tau_coding_agent-0.3.5}/tau/tui/components/modal.py +8 -8
- {tau_coding_agent-0.3.0 → tau_coding_agent-0.3.5}/tau/tui/components/model_palette.py +29 -12
- {tau_coding_agent-0.3.0 → tau_coding_agent-0.3.5}/tau/tui/components/picker_overlay.py +6 -2
- {tau_coding_agent-0.3.0 → tau_coding_agent-0.3.5}/tau/tui/components/prompt_overlay.py +8 -6
- {tau_coding_agent-0.3.0 → tau_coding_agent-0.3.5}/tau/tui/components/resume_modal.py +30 -27
- {tau_coding_agent-0.3.0 → tau_coding_agent-0.3.5}/tau/tui/components/select_list.py +29 -23
- {tau_coding_agent-0.3.0 → tau_coding_agent-0.3.5}/tau/tui/components/settings_modal.py +12 -9
- {tau_coding_agent-0.3.0 → tau_coding_agent-0.3.5}/tau/tui/components/settings_schema.py +45 -25
- {tau_coding_agent-0.3.0 → tau_coding_agent-0.3.5}/tau/tui/components/spinner.py +18 -10
- {tau_coding_agent-0.3.0 → tau_coding_agent-0.3.5}/tau/tui/components/text_input.py +27 -10
- {tau_coding_agent-0.3.0 → tau_coding_agent-0.3.5}/tau/tui/components/text_prompt.py +2 -1
- {tau_coding_agent-0.3.0 → tau_coding_agent-0.3.5}/tau/tui/components/tree_select_list.py +54 -35
- {tau_coding_agent-0.3.0 → tau_coding_agent-0.3.5}/tau/tui/components/trust_screen.py +14 -9
- {tau_coding_agent-0.3.0 → tau_coding_agent-0.3.5}/tau/tui/diff.py +7 -7
- {tau_coding_agent-0.3.0 → tau_coding_agent-0.3.5}/tau/tui/input.py +225 -90
- {tau_coding_agent-0.3.0 → tau_coding_agent-0.3.5}/tau/tui/input_handler.py +51 -24
- {tau_coding_agent-0.3.0 → tau_coding_agent-0.3.5}/tau/tui/keybindings.py +20 -20
- {tau_coding_agent-0.3.0 → tau_coding_agent-0.3.5}/tau/tui/markdown.py +13 -11
- {tau_coding_agent-0.3.0 → tau_coding_agent-0.3.5}/tau/tui/message_renderers.py +4 -3
- {tau_coding_agent-0.3.0 → tau_coding_agent-0.3.5}/tau/tui/overlay.py +27 -20
- {tau_coding_agent-0.3.0 → tau_coding_agent-0.3.5}/tau/tui/renderer.py +22 -15
- {tau_coding_agent-0.3.0 → tau_coding_agent-0.3.5}/tau/tui/terminal.py +27 -4
- tau_coding_agent-0.3.5/tau/tui/theme.py +171 -0
- {tau_coding_agent-0.3.0 → tau_coding_agent-0.3.5}/tau/tui/tui.py +19 -7
- {tau_coding_agent-0.3.0 → tau_coding_agent-0.3.5}/tau/tui/ui_context.py +38 -24
- {tau_coding_agent-0.3.0 → tau_coding_agent-0.3.5}/tau/utils/http_proxy.py +13 -12
- {tau_coding_agent-0.3.0 → tau_coding_agent-0.3.5}/tau/utils/image_processing.py +13 -13
- {tau_coding_agent-0.3.0 → tau_coding_agent-0.3.5}/tau/utils/secrets.py +2 -4
- {tau_coding_agent-0.3.0 → tau_coding_agent-0.3.5}/tau/utils/version_check.py +3 -3
- {tau_coding_agent-0.3.0 → tau_coding_agent-0.3.5/tau_coding_agent.egg-info}/PKG-INFO +1 -1
- {tau_coding_agent-0.3.0 → tau_coding_agent-0.3.5}/tau_coding_agent.egg-info/SOURCES.txt +53 -40
- tau_coding_agent-0.3.5/tests/test_agent_prompt.py +287 -0
- tau_coding_agent-0.3.5/tests/test_agent_types.py +92 -0
- tau_coding_agent-0.3.5/tests/test_ansi.py +236 -0
- tau_coding_agent-0.3.5/tests/test_auth_manager.py +173 -0
- tau_coding_agent-0.3.5/tests/test_auth_storage.py +43 -0
- tau_coding_agent-0.3.5/tests/test_branch_summarization.py +125 -0
- tau_coding_agent-0.3.5/tests/test_builtin_tools.py +333 -0
- tau_coding_agent-0.3.5/tests/test_command_registry.py +167 -0
- tau_coding_agent-0.3.5/tests/test_compaction.py +214 -0
- tau_coding_agent-0.3.5/tests/test_diff.py +134 -0
- tau_coding_agent-0.3.5/tests/test_engine_types.py +110 -0
- tau_coding_agent-0.3.5/tests/test_footer_utils.py +69 -0
- tau_coding_agent-0.3.5/tests/test_fuzzy.py +98 -0
- tau_coding_agent-0.3.5/tests/test_http_proxy.py +168 -0
- tau_coding_agent-0.3.5/tests/test_image_processing.py +127 -0
- tau_coding_agent-0.3.5/tests/test_inference_error_utils.py +197 -0
- tau_coding_agent-0.3.5/tests/test_inference_types.py +81 -0
- tau_coding_agent-0.3.5/tests/test_inference_utils.py +192 -0
- tau_coding_agent-0.3.5/tests/test_keybindings.py +137 -0
- tau_coding_agent-0.3.5/tests/test_markdown.py +199 -0
- tau_coding_agent-0.3.5/tests/test_message_types.py +218 -0
- tau_coding_agent-0.3.5/tests/test_message_utils.py +179 -0
- tau_coding_agent-0.3.5/tests/test_model_registry.py +137 -0
- tau_coding_agent-0.3.5/tests/test_model_types.py +110 -0
- tau_coding_agent-0.3.5/tests/test_oauth_utils.py +88 -0
- tau_coding_agent-0.3.5/tests/test_packages_utils.py +114 -0
- tau_coding_agent-0.3.5/tests/test_pkce.py +45 -0
- tau_coding_agent-0.3.5/tests/test_prompts_expand.py +69 -0
- tau_coding_agent-0.3.5/tests/test_prompts_loader.py +133 -0
- tau_coding_agent-0.3.5/tests/test_prompts_registry.py +84 -0
- tau_coding_agent-0.3.5/tests/test_provider_registry.py +135 -0
- tau_coding_agent-0.3.5/tests/test_rpc_mode.py +208 -0
- tau_coding_agent-0.3.5/tests/test_secrets.py +77 -0
- tau_coding_agent-0.3.5/tests/test_session_types.py +219 -0
- tau_coding_agent-0.3.5/tests/test_session_utils.py +169 -0
- tau_coding_agent-0.3.5/tests/test_settings_manager.py +150 -0
- tau_coding_agent-0.3.5/tests/test_settings_paths.py +146 -0
- tau_coding_agent-0.3.5/tests/test_settings_storage.py +88 -0
- tau_coding_agent-0.3.5/tests/test_settings_utils.py +75 -0
- tau_coding_agent-0.3.5/tests/test_skills_loader.py +124 -0
- tau_coding_agent-0.3.5/tests/test_skills_registry.py +127 -0
- tau_coding_agent-0.3.5/tests/test_theme_loader.py +192 -0
- tau_coding_agent-0.3.5/tests/test_themes_registry.py +167 -0
- tau_coding_agent-0.3.5/tests/test_tool_registry.py +145 -0
- tau_coding_agent-0.3.5/tests/test_tool_render.py +91 -0
- tau_coding_agent-0.3.5/tests/test_trust_manager.py +121 -0
- tau_coding_agent-0.3.5/tests/test_trust_utils.py +95 -0
- tau_coding_agent-0.3.5/tests/test_tui_capabilities.py +165 -0
- tau_coding_agent-0.3.5/tests/test_tui_input.py +211 -0
- tau_coding_agent-0.3.5/tests/test_tui_theme.py +228 -0
- tau_coding_agent-0.3.5/tests/test_tui_utils.py +26 -0
- tau_coding_agent-0.3.5/tests/test_version_check.py +50 -0
- tau_coding_agent-0.3.0/tau/agent/__init__.py +0 -11
- tau_coding_agent-0.3.0/tau/builtins/__pycache__/__init__.cpython-313.pyc +0 -0
- tau_coding_agent-0.3.0/tau/builtins/__pycache__/__init__.cpython-314.pyc +0 -0
- tau_coding_agent-0.3.0/tau/builtins/commands/__pycache__/__init__.cpython-313.pyc +0 -0
- tau_coding_agent-0.3.0/tau/builtins/commands/__pycache__/__init__.cpython-314.pyc +0 -0
- tau_coding_agent-0.3.0/tau/builtins/commands/__pycache__/clear.cpython-313.pyc +0 -0
- tau_coding_agent-0.3.0/tau/builtins/commands/__pycache__/clear.cpython-314.pyc +0 -0
- tau_coding_agent-0.3.0/tau/builtins/commands/__pycache__/compact.cpython-313.pyc +0 -0
- tau_coding_agent-0.3.0/tau/builtins/commands/__pycache__/compact.cpython-314.pyc +0 -0
- tau_coding_agent-0.3.0/tau/builtins/commands/__pycache__/reload.cpython-313.pyc +0 -0
- tau_coding_agent-0.3.0/tau/builtins/commands/__pycache__/reload.cpython-314.pyc +0 -0
- tau_coding_agent-0.3.0/tau/builtins/commands/__pycache__/session.cpython-313.pyc +0 -0
- tau_coding_agent-0.3.0/tau/builtins/commands/__pycache__/session.cpython-314.pyc +0 -0
- tau_coding_agent-0.3.0/tau/builtins/extensions/footer/__pycache__/__init__.cpython-313.pyc +0 -0
- tau_coding_agent-0.3.0/tau/builtins/extensions/footer/__pycache__/git.cpython-313.pyc +0 -0
- tau_coding_agent-0.3.0/tau/builtins/extensions/footer/__pycache__/model.cpython-313.pyc +0 -0
- tau_coding_agent-0.3.0/tau/builtins/extensions/footer/__pycache__/utils.cpython-313.pyc +0 -0
- tau_coding_agent-0.3.0/tau/builtins/extensions/header/__pycache__/__init__.cpython-313.pyc +0 -0
- tau_coding_agent-0.3.0/tau/builtins/models/__pycache__/__init__.cpython-313.pyc +0 -0
- tau_coding_agent-0.3.0/tau/builtins/models/__pycache__/text.cpython-313.pyc +0 -0
- tau_coding_agent-0.3.0/tau/builtins/models/audio.py +0 -43
- tau_coding_agent-0.3.0/tau/builtins/models/image.py +0 -43
- tau_coding_agent-0.3.0/tau/builtins/models/text.py +0 -482
- tau_coding_agent-0.3.0/tau/builtins/models/video.py +0 -40
- tau_coding_agent-0.3.0/tau/builtins/providers/__pycache__/__init__.cpython-313.pyc +0 -0
- tau_coding_agent-0.3.0/tau/builtins/providers/__pycache__/text.cpython-313.pyc +0 -0
- tau_coding_agent-0.3.0/tau/builtins/providers/audio.py +0 -10
- tau_coding_agent-0.3.0/tau/builtins/providers/image.py +0 -9
- tau_coding_agent-0.3.0/tau/builtins/providers/text.py +0 -33
- tau_coding_agent-0.3.0/tau/builtins/providers/video.py +0 -6
- tau_coding_agent-0.3.0/tau/builtins/tools/__pycache__/__init__.cpython-313.pyc +0 -0
- tau_coding_agent-0.3.0/tau/builtins/tools/__pycache__/__init__.cpython-314.pyc +0 -0
- tau_coding_agent-0.3.0/tau/builtins/tools/__pycache__/bash.cpython-313.pyc +0 -0
- tau_coding_agent-0.3.0/tau/builtins/tools/__pycache__/bash.cpython-314.pyc +0 -0
- tau_coding_agent-0.3.0/tau/builtins/tools/__pycache__/edit.cpython-313.pyc +0 -0
- tau_coding_agent-0.3.0/tau/builtins/tools/__pycache__/edit.cpython-314.pyc +0 -0
- tau_coding_agent-0.3.0/tau/builtins/tools/__pycache__/glob.cpython-313.pyc +0 -0
- tau_coding_agent-0.3.0/tau/builtins/tools/__pycache__/glob.cpython-314.pyc +0 -0
- tau_coding_agent-0.3.0/tau/builtins/tools/__pycache__/grep.cpython-313.pyc +0 -0
- tau_coding_agent-0.3.0/tau/builtins/tools/__pycache__/grep.cpython-314.pyc +0 -0
- tau_coding_agent-0.3.0/tau/builtins/tools/__pycache__/ls.cpython-313.pyc +0 -0
- tau_coding_agent-0.3.0/tau/builtins/tools/__pycache__/ls.cpython-314.pyc +0 -0
- tau_coding_agent-0.3.0/tau/builtins/tools/__pycache__/read.cpython-313.pyc +0 -0
- tau_coding_agent-0.3.0/tau/builtins/tools/__pycache__/read.cpython-314.pyc +0 -0
- tau_coding_agent-0.3.0/tau/builtins/tools/__pycache__/terminal.cpython-313.pyc +0 -0
- tau_coding_agent-0.3.0/tau/builtins/tools/__pycache__/terminal.cpython-314.pyc +0 -0
- tau_coding_agent-0.3.0/tau/builtins/tools/__pycache__/write.cpython-313.pyc +0 -0
- tau_coding_agent-0.3.0/tau/builtins/tools/__pycache__/write.cpython-314.pyc +0 -0
- tau_coding_agent-0.3.0/tau/inference/api/text/builtins.py +0 -19
- tau_coding_agent-0.3.0/tau/inference/utils.py +0 -219
- tau_coding_agent-0.3.0/tau/settings/storage.py +0 -63
- tau_coding_agent-0.3.0/tau/settings/types.py +0 -173
- tau_coding_agent-0.3.0/tau/tui/theme.py +0 -151
- {tau_coding_agent-0.3.0 → tau_coding_agent-0.3.5}/LICENSE +0 -0
- {tau_coding_agent-0.3.0 → tau_coding_agent-0.3.5}/MANIFEST.in +0 -0
- {tau_coding_agent-0.3.0 → tau_coding_agent-0.3.5}/README.md +0 -0
- {tau_coding_agent-0.3.0 → tau_coding_agent-0.3.5}/docs/IMPLEMENTATION_SUMMARY.md +0 -0
- {tau_coding_agent-0.3.0 → tau_coding_agent-0.3.5}/docs/architecture.md +0 -0
- {tau_coding_agent-0.3.0 → tau_coding_agent-0.3.5}/docs/auth.md +0 -0
- {tau_coding_agent-0.3.0 → tau_coding_agent-0.3.5}/docs/cli-reference.md +0 -0
- {tau_coding_agent-0.3.0 → tau_coding_agent-0.3.5}/docs/development.md +0 -0
- {tau_coding_agent-0.3.0 → tau_coding_agent-0.3.5}/docs/docs.json +0 -0
- {tau_coding_agent-0.3.0 → tau_coding_agent-0.3.5}/docs/extension-settings.md +0 -0
- {tau_coding_agent-0.3.0 → tau_coding_agent-0.3.5}/docs/http-proxy.md +0 -0
- {tau_coding_agent-0.3.0 → tau_coding_agent-0.3.5}/docs/index.md +0 -0
- {tau_coding_agent-0.3.0 → tau_coding_agent-0.3.5}/docs/inference-providers.md +0 -0
- {tau_coding_agent-0.3.0 → tau_coding_agent-0.3.5}/docs/installation.md +0 -0
- {tau_coding_agent-0.3.0 → tau_coding_agent-0.3.5}/docs/keybindings.md +0 -0
- {tau_coding_agent-0.3.0 → tau_coding_agent-0.3.5}/docs/messages.md +0 -0
- {tau_coding_agent-0.3.0 → tau_coding_agent-0.3.5}/docs/project-context.md +0 -0
- {tau_coding_agent-0.3.0 → tau_coding_agent-0.3.5}/docs/project-structure.md +0 -0
- {tau_coding_agent-0.3.0 → tau_coding_agent-0.3.5}/docs/prompts.md +0 -0
- {tau_coding_agent-0.3.0 → tau_coding_agent-0.3.5}/docs/python-api.md +0 -0
- {tau_coding_agent-0.3.0 → tau_coding_agent-0.3.5}/docs/quickstart.md +0 -0
- {tau_coding_agent-0.3.0 → tau_coding_agent-0.3.5}/docs/sessions.md +0 -0
- {tau_coding_agent-0.3.0 → tau_coding_agent-0.3.5}/docs/settings.md +0 -0
- {tau_coding_agent-0.3.0 → tau_coding_agent-0.3.5}/docs/skills.md +0 -0
- {tau_coding_agent-0.3.0 → tau_coding_agent-0.3.5}/docs/themes.md +0 -0
- {tau_coding_agent-0.3.0 → tau_coding_agent-0.3.5}/docs/tools.md +0 -0
- {tau_coding_agent-0.3.0 → tau_coding_agent-0.3.5}/docs/usage.md +0 -0
- {tau_coding_agent-0.3.0 → tau_coding_agent-0.3.5}/setup.cfg +0 -0
- {tau_coding_agent-0.3.0 → tau_coding_agent-0.3.5}/tau/__init__.py +0 -0
- {tau_coding_agent-0.3.0 → tau_coding_agent-0.3.5}/tau/builtins/__init__.py +0 -0
- {tau_coding_agent-0.3.0 → tau_coding_agent-0.3.5}/tau/builtins/commands/session.py +0 -0
- {tau_coding_agent-0.3.0 → tau_coding_agent-0.3.5}/tau/builtins/models/__init__.py +0 -0
- {tau_coding_agent-0.3.0 → tau_coding_agent-0.3.5}/tau/builtins/prompts/commit.md +0 -0
- {tau_coding_agent-0.3.0 → tau_coding_agent-0.3.5}/tau/builtins/prompts/docs.md +0 -0
- {tau_coding_agent-0.3.0 → tau_coding_agent-0.3.5}/tau/builtins/prompts/explain.md +0 -0
- {tau_coding_agent-0.3.0 → tau_coding_agent-0.3.5}/tau/builtins/prompts/fix.md +0 -0
- {tau_coding_agent-0.3.0 → tau_coding_agent-0.3.5}/tau/builtins/prompts/refactor.md +0 -0
- {tau_coding_agent-0.3.0 → tau_coding_agent-0.3.5}/tau/builtins/prompts/review.md +0 -0
- {tau_coding_agent-0.3.0 → tau_coding_agent-0.3.5}/tau/builtins/prompts/test.md +0 -0
- {tau_coding_agent-0.3.0 → tau_coding_agent-0.3.5}/tau/builtins/providers/__init__.py +0 -0
- {tau_coding_agent-0.3.0 → tau_coding_agent-0.3.5}/tau/builtins/skills/code-review/SKILL.md +0 -0
- {tau_coding_agent-0.3.0 → tau_coding_agent-0.3.5}/tau/builtins/skills/debug/SKILL.md +0 -0
- {tau_coding_agent-0.3.0 → tau_coding_agent-0.3.5}/tau/builtins/skills/git-commit/SKILL.md +0 -0
- {tau_coding_agent-0.3.0 → tau_coding_agent-0.3.5}/tau/builtins/themes/dark.yaml +0 -0
- {tau_coding_agent-0.3.0 → tau_coding_agent-0.3.5}/tau/builtins/themes/light.yaml +0 -0
- {tau_coding_agent-0.3.0 → tau_coding_agent-0.3.5}/tau/builtins/tools/__init__.py +3 -3
- {tau_coding_agent-0.3.0 → tau_coding_agent-0.3.5}/tau/console/__init__.py +0 -0
- {tau_coding_agent-0.3.0 → tau_coding_agent-0.3.5}/tau/console/commands/__init__.py +0 -0
- {tau_coding_agent-0.3.0 → tau_coding_agent-0.3.5}/tau/core/__init__.py +0 -0
- {tau_coding_agent-0.3.0 → tau_coding_agent-0.3.5}/tau/inference/api/__init__.py +0 -0
- {tau_coding_agent-0.3.0 → tau_coding_agent-0.3.5}/tau/inference/api/audio/__init__.py +0 -0
- {tau_coding_agent-0.3.0 → tau_coding_agent-0.3.5}/tau/inference/api/audio/base.py +2 -2
- {tau_coding_agent-0.3.0 → tau_coding_agent-0.3.5}/tau/inference/api/image/__init__.py +0 -0
- {tau_coding_agent-0.3.0 → tau_coding_agent-0.3.5}/tau/inference/api/text/__init__.py +0 -0
- {tau_coding_agent-0.3.0 → tau_coding_agent-0.3.5}/tau/inference/api/text/types.py +0 -0
- {tau_coding_agent-0.3.0 → tau_coding_agent-0.3.5}/tau/inference/api/video/__init__.py +0 -0
- {tau_coding_agent-0.3.0 → tau_coding_agent-0.3.5}/tau/inference/api/video/builtins.py +0 -0
- {tau_coding_agent-0.3.0 → tau_coding_agent-0.3.5}/tau/inference/model/__init__.py +0 -0
- {tau_coding_agent-0.3.0 → tau_coding_agent-0.3.5}/tau/inference/provider/__init__.py +0 -0
- {tau_coding_agent-0.3.0 → tau_coding_agent-0.3.5}/tau/inference/provider/oauth/pkce.py +0 -0
- {tau_coding_agent-0.3.0 → tau_coding_agent-0.3.5}/tau/message/__init__.py +0 -0
- {tau_coding_agent-0.3.0 → tau_coding_agent-0.3.5}/tau/prompts/types.py +0 -0
- {tau_coding_agent-0.3.0 → tau_coding_agent-0.3.5}/tau/rpc/__init__.py +1 -1
- {tau_coding_agent-0.3.0 → tau_coding_agent-0.3.5}/tau/skills/types.py +0 -0
- {tau_coding_agent-0.3.0 → tau_coding_agent-0.3.5}/tau/tool/__init__.py +0 -0
- {tau_coding_agent-0.3.0 → tau_coding_agent-0.3.5}/tau/tool/render.py +0 -0
- {tau_coding_agent-0.3.0 → tau_coding_agent-0.3.5}/tau/tui/commands/__init__.py +0 -0
- {tau_coding_agent-0.3.0 → tau_coding_agent-0.3.5}/tau/tui/components/__init__.py +0 -0
- {tau_coding_agent-0.3.0 → tau_coding_agent-0.3.5}/tau/tui/fuzzy.py +0 -0
- {tau_coding_agent-0.3.0 → tau_coding_agent-0.3.5}/tau/tui/utils.py +0 -0
- {tau_coding_agent-0.3.0 → tau_coding_agent-0.3.5}/tau/utils/__init__.py +0 -0
- {tau_coding_agent-0.3.0 → tau_coding_agent-0.3.5}/tau_coding_agent.egg-info/dependency_links.txt +0 -0
- {tau_coding_agent-0.3.0 → tau_coding_agent-0.3.5}/tau_coding_agent.egg-info/entry_points.txt +0 -0
- {tau_coding_agent-0.3.0 → tau_coding_agent-0.3.5}/tau_coding_agent.egg-info/requires.txt +0 -0
- {tau_coding_agent-0.3.0 → tau_coding_agent-0.3.5}/tau_coding_agent.egg-info/top_level.txt +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: tau-coding-agent
|
|
3
|
-
Version: 0.3.
|
|
3
|
+
Version: 0.3.5
|
|
4
4
|
Summary: A self-extensible agent CLI with terminal UI, multi-provider LLM support, session management with branching, and a plugin system for tools and commands
|
|
5
5
|
Requires-Python: >=3.12
|
|
6
6
|
Description-Content-Type: text/markdown
|
|
@@ -30,9 +30,11 @@ A subdirectory under `extensions/` is loaded if it has either:
|
|
|
30
30
|
|
|
31
31
|
Before the entry file is executed, these specs are installed into the project or
|
|
32
32
|
global packages venv (`uv pip install`, falling back to `pip` when `uv` isn't on
|
|
33
|
-
PATH) and the venv's site-packages directory is
|
|
34
|
-
|
|
35
|
-
|
|
33
|
+
PATH) and the venv's site-packages directory is appended to `sys.path`. Tau's
|
|
34
|
+
runtime environment keeps precedence, so an extension cannot replace Tau's own
|
|
35
|
+
dependencies with incompatible versions. The install only runs once — a hash of
|
|
36
|
+
the dependency list is cached, so unchanged manifests are a no-op on subsequent
|
|
37
|
+
launches.
|
|
36
38
|
|
|
37
39
|
## Entry point
|
|
38
40
|
|
|
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "tau-coding-agent"
|
|
7
|
-
version = "0.3.
|
|
7
|
+
version = "0.3.5"
|
|
8
8
|
description = "A self-extensible agent CLI with terminal UI, multi-provider LLM support, session management with branching, and a plugin system for tools and commands"
|
|
9
9
|
readme = "README.md"
|
|
10
10
|
requires-python = ">=3.12"
|
|
@@ -64,3 +64,14 @@ include = ["tau*"]
|
|
|
64
64
|
tau = [
|
|
65
65
|
"builtins/**/*",
|
|
66
66
|
]
|
|
67
|
+
|
|
68
|
+
[tool.pytest.ini_options]
|
|
69
|
+
testpaths = ["tests"]
|
|
70
|
+
|
|
71
|
+
[dependency-groups]
|
|
72
|
+
dev = [
|
|
73
|
+
"pytest>=9.1.1",
|
|
74
|
+
"ruff>=0.4.0",
|
|
75
|
+
"mypy>=1.10.0",
|
|
76
|
+
"pyright>=1.1.360",
|
|
77
|
+
]
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
"""System prompt assembly for the coding agent."""
|
|
2
2
|
|
|
3
|
-
from tau.agent.prompt.types import PromptOptions
|
|
4
3
|
from tau.agent.prompt.builder import PromptBuilder, build_prompt
|
|
4
|
+
from tau.agent.prompt.types import PromptOptions
|
|
5
5
|
|
|
6
6
|
__all__ = [
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
7
|
+
"PromptOptions",
|
|
8
|
+
"PromptBuilder",
|
|
9
|
+
"build_prompt",
|
|
10
10
|
]
|
|
@@ -8,10 +8,11 @@ from pathlib import Path
|
|
|
8
8
|
|
|
9
9
|
from tau.agent.prompt.types import PromptOptions
|
|
10
10
|
from tau.settings.paths import (
|
|
11
|
-
get_system_prompt_path,
|
|
12
11
|
get_append_system_prompt_path,
|
|
13
12
|
get_docs_dir,
|
|
13
|
+
get_examples_path,
|
|
14
14
|
get_readme_path,
|
|
15
|
+
get_system_prompt_path,
|
|
15
16
|
)
|
|
16
17
|
|
|
17
18
|
|
|
@@ -32,14 +33,80 @@ def load_project_context_file(cwd: Path) -> tuple[str, Path] | None:
|
|
|
32
33
|
pass
|
|
33
34
|
return None
|
|
34
35
|
|
|
36
|
+
|
|
37
|
+
def _find_git_root(cwd: Path) -> Path | None:
|
|
38
|
+
"""Walk up from cwd and return the first directory containing .git, or None."""
|
|
39
|
+
current = cwd.resolve()
|
|
40
|
+
while True:
|
|
41
|
+
if (current / ".git").exists():
|
|
42
|
+
return current
|
|
43
|
+
parent = current.parent
|
|
44
|
+
if parent == current:
|
|
45
|
+
return None
|
|
46
|
+
current = parent
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
def load_project_context_files(cwd: Path) -> list[tuple[str, Path]]:
|
|
50
|
+
"""Walk from git root (or cwd if not in a repo) down to cwd, collecting context files.
|
|
51
|
+
|
|
52
|
+
Returns (content, path) tuples ordered root-first so cwd instructions appear
|
|
53
|
+
last and take highest precedence when the model reads top-to-bottom.
|
|
54
|
+
"""
|
|
55
|
+
candidates = ["AGENTS.md", "AGENTS.MD", "CLAUDE.md", "CLAUDE.MD"]
|
|
56
|
+
|
|
57
|
+
def _load(directory: Path) -> tuple[str, Path] | None:
|
|
58
|
+
for filename in candidates:
|
|
59
|
+
path = directory / filename
|
|
60
|
+
if path.is_file():
|
|
61
|
+
try:
|
|
62
|
+
content = path.read_text(encoding="utf-8").strip()
|
|
63
|
+
return (content, path) if content else None
|
|
64
|
+
except OSError:
|
|
65
|
+
pass
|
|
66
|
+
return None
|
|
67
|
+
|
|
68
|
+
resolved = cwd.resolve()
|
|
69
|
+
git_root = _find_git_root(resolved)
|
|
70
|
+
stop_at = git_root if git_root else resolved
|
|
71
|
+
|
|
72
|
+
# Collect directories from stop_at down to cwd
|
|
73
|
+
dirs: list[Path] = []
|
|
74
|
+
current = resolved
|
|
75
|
+
while True:
|
|
76
|
+
dirs.append(current)
|
|
77
|
+
if current == stop_at:
|
|
78
|
+
break
|
|
79
|
+
parent = current.parent
|
|
80
|
+
if parent == current:
|
|
81
|
+
break
|
|
82
|
+
current = parent
|
|
83
|
+
|
|
84
|
+
seen: set[Path] = set()
|
|
85
|
+
results: list[tuple[str, Path]] = []
|
|
86
|
+
for directory in reversed(dirs):
|
|
87
|
+
entry = _load(directory)
|
|
88
|
+
if entry and entry[1] not in seen:
|
|
89
|
+
seen.add(entry[1])
|
|
90
|
+
results.append(entry)
|
|
91
|
+
|
|
92
|
+
return results
|
|
93
|
+
|
|
94
|
+
|
|
35
95
|
_DEFAULT_IDENTITY = """\
|
|
36
|
-
You are a coding agent. You help users
|
|
96
|
+
You are a coding agent operating inside Tau, a coding agent harness. You help users by reading files, executing commands, editing code, and writing new files.
|
|
37
97
|
|
|
38
98
|
You have strong software engineering skills. You think carefully before making changes,
|
|
39
99
|
and follow the existing style and conventions of the project.
|
|
40
|
-
If a task is ambiguous, ask a clarifying question before proceeding.\
|
|
41
100
|
"""
|
|
42
101
|
|
|
102
|
+
_GENERAL_GUIDELINES = [
|
|
103
|
+
"If a task is ambiguous, ask a precise, clarifying question before proceeding.",
|
|
104
|
+
"Do only what the task asks; don't add features, refactors, or abstractions beyond scope.",
|
|
105
|
+
"Write comments when the *why* is non-obvious — well-named code explains itself.",
|
|
106
|
+
"Keep responses short, concise, and direct; don't summarize what you just did.",
|
|
107
|
+
"Prioritize accuracy over agreement — investigate before confirming, and disagree when the evidence calls for it.",
|
|
108
|
+
]
|
|
109
|
+
|
|
43
110
|
|
|
44
111
|
_GIT_STATUS_MAX_LINES = 30
|
|
45
112
|
_GIT_LOG_COUNT = 5
|
|
@@ -136,7 +203,8 @@ class PromptBuilder:
|
|
|
136
203
|
Assembles the system prompt from layered sources.
|
|
137
204
|
|
|
138
205
|
Layers in order:
|
|
139
|
-
Identity — SYSTEM.md if present, else built-in identity;
|
|
206
|
+
Identity — SYSTEM.md if present, else built-in identity;
|
|
207
|
+
--system bypasses entirely
|
|
140
208
|
Tools section — auto-generated from tool list (descriptions + guidelines)
|
|
141
209
|
Tau docs — tau documentation and examples
|
|
142
210
|
Project Instructions — AGENTS.md or CLAUDE.md from project (if present)
|
|
@@ -155,6 +223,7 @@ class PromptBuilder:
|
|
|
155
223
|
def build(self) -> str:
|
|
156
224
|
"""Build the complete system prompt."""
|
|
157
225
|
identity = self._identity()
|
|
226
|
+
guidelines = self._guidelines_section()
|
|
158
227
|
tools = self._tools_section()
|
|
159
228
|
docs = self._docs_section()
|
|
160
229
|
project_context = self._project_context_section()
|
|
@@ -162,7 +231,7 @@ class PromptBuilder:
|
|
|
162
231
|
append = self._append()
|
|
163
232
|
git = self._git_section()
|
|
164
233
|
footer = self._footer()
|
|
165
|
-
return identity + tools + docs + project_context + skills + append + git + footer
|
|
234
|
+
return identity + guidelines + tools + docs + project_context + skills + append + git + footer
|
|
166
235
|
|
|
167
236
|
# ------------------------------------------------------------------
|
|
168
237
|
# Layers
|
|
@@ -178,6 +247,10 @@ class PromptBuilder:
|
|
|
178
247
|
|
|
179
248
|
return _DEFAULT_IDENTITY
|
|
180
249
|
|
|
250
|
+
def _guidelines_section(self) -> str:
|
|
251
|
+
bullets = "\n".join(f"- {g}" for g in _GENERAL_GUIDELINES)
|
|
252
|
+
return f"\n\n# Guidelines\n\n{bullets}"
|
|
253
|
+
|
|
181
254
|
def _tools_section(self) -> str:
|
|
182
255
|
tools = self._opts.tools
|
|
183
256
|
if not tools:
|
|
@@ -194,6 +267,7 @@ class PromptBuilder:
|
|
|
194
267
|
if guideline:
|
|
195
268
|
guidelines.append(f"- **{t.name}**: {guideline.strip()}")
|
|
196
269
|
section = "\n\n# Available Tools\n\n" + "\n".join(lines)
|
|
270
|
+
section+="\nIn addition to the tools above, you may have access to other custom tools depending on the project."
|
|
197
271
|
if guidelines:
|
|
198
272
|
section += "\n\n## Tool Guidelines\n\n" + "\n".join(guidelines)
|
|
199
273
|
return section
|
|
@@ -201,6 +275,10 @@ class PromptBuilder:
|
|
|
201
275
|
def _project_context_section(self) -> str:
|
|
202
276
|
"""Include project-specific context from AGENTS.md or CLAUDE.md if present.
|
|
203
277
|
|
|
278
|
+
Walks from git root down to cwd, loading one file per directory.
|
|
279
|
+
Each file is wrapped in <project_instructions path="..."> so the model
|
|
280
|
+
knows which directory each set of rules comes from.
|
|
281
|
+
|
|
204
282
|
Skipped if:
|
|
205
283
|
- disable_context_files is True (--no-context-files flag)
|
|
206
284
|
- project is not trusted (--no-approve flag or trust store)
|
|
@@ -209,36 +287,52 @@ class PromptBuilder:
|
|
|
209
287
|
return ""
|
|
210
288
|
if self._opts.project_trusted is False:
|
|
211
289
|
return ""
|
|
212
|
-
|
|
213
|
-
if not
|
|
290
|
+
files = load_project_context_files(self._opts.cwd)
|
|
291
|
+
if not files:
|
|
214
292
|
return ""
|
|
215
|
-
|
|
293
|
+
blocks = "".join(
|
|
294
|
+
f'<project_instructions path="{path}">\n{content}\n</project_instructions>\n\n'
|
|
295
|
+
for content, path in files
|
|
296
|
+
)
|
|
216
297
|
return (
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
298
|
+
"\n\n# Project Instructions\n\n"
|
|
299
|
+
"Project-specific guidelines (follow before general Tau guidelines):\n\n"
|
|
300
|
+
"<project_context>\n\n"
|
|
301
|
+
+ blocks
|
|
302
|
+
+ "</project_context>"
|
|
221
303
|
)
|
|
222
304
|
|
|
223
305
|
def _docs_section(self) -> str:
|
|
224
306
|
readme = get_readme_path()
|
|
225
307
|
docs = get_docs_dir()
|
|
308
|
+
examples = get_examples_path()
|
|
226
309
|
return (
|
|
227
310
|
"\n\nTau documentation (read only when the user asks about Tau itself, its"
|
|
228
311
|
" settings, extensions, themes, skills, tools, sessions, or keybindings):\n"
|
|
229
312
|
f"- README: {readme}\n"
|
|
230
313
|
f"- Docs directory: {docs}\n"
|
|
231
|
-
"-
|
|
314
|
+
f"- Examples directory: {examples} (extensions, custom tools, themes, skills)\n"
|
|
315
|
+
"- When asked about: quickstart (docs/quickstart.md),"
|
|
316
|
+
" installation (docs/installation.md),"
|
|
317
|
+
" usage (docs/usage.md), CLI flags (docs/cli-reference.md),"
|
|
318
|
+
" architecture (docs/architecture.md),"
|
|
319
|
+
" settings (docs/settings.md), tools (docs/tools.md),"
|
|
232
320
|
" extensions (docs/extensions.md), themes (docs/themes.md),"
|
|
233
|
-
" skills (docs/skills.md),
|
|
234
|
-
"
|
|
235
|
-
"
|
|
236
|
-
"
|
|
321
|
+
" skills (docs/skills.md), prompts (docs/prompts.md),"
|
|
322
|
+
" keybindings (docs/keybindings.md),"
|
|
323
|
+
" sessions (docs/sessions.md), messages (docs/messages.md),"
|
|
324
|
+
" Python API (docs/python-api.md),"
|
|
325
|
+
" inference providers (docs/inference-providers.md),"
|
|
326
|
+
" auth (docs/auth.md)\n"
|
|
327
|
+
"- Resolve all doc paths under the Docs directory above,"
|
|
328
|
+
" not the current working directory\n"
|
|
329
|
+
"- Resolve all example paths under the Examples directory above\n"
|
|
237
330
|
"- Read .md files completely and follow cross-references before answering"
|
|
238
331
|
)
|
|
239
332
|
|
|
240
333
|
def _skills_section(self) -> str:
|
|
241
334
|
from tau.skills.registry import skill_registry
|
|
335
|
+
|
|
242
336
|
block = skill_registry.format_for_system_prompt(self._opts.skills)
|
|
243
337
|
return f"\n\n{block}" if block else ""
|
|
244
338
|
|
|
@@ -2,13 +2,16 @@ from __future__ import annotations
|
|
|
2
2
|
|
|
3
3
|
from pathlib import Path
|
|
4
4
|
from typing import Any
|
|
5
|
+
|
|
5
6
|
from pydantic import BaseModel, Field
|
|
7
|
+
|
|
6
8
|
from tau.tool.types import Tool
|
|
7
9
|
|
|
8
10
|
|
|
9
11
|
class PromptOptions(BaseModel):
|
|
10
12
|
"""Options for constructing the system prompt."""
|
|
11
|
-
|
|
13
|
+
|
|
14
|
+
model_config = {"arbitrary_types_allowed": True}
|
|
12
15
|
|
|
13
16
|
cwd: Path
|
|
14
17
|
tools: list[Tool] = Field(default_factory=list)
|
|
@@ -4,19 +4,26 @@ import asyncio
|
|
|
4
4
|
from pathlib import Path
|
|
5
5
|
from typing import TYPE_CHECKING
|
|
6
6
|
|
|
7
|
-
from tau.agent.types import AgentConfig, AgentContext, AgentPhase,
|
|
8
|
-
from tau.hooks.service import Hooks
|
|
7
|
+
from tau.agent.types import AgentConfig, AgentContext, AgentPhase, ContextUsage, PromptOptions
|
|
9
8
|
from tau.hooks.engine import MessageEndEvent, MessageRollbackEvent, SavePointEvent, SettledEvent
|
|
10
|
-
from tau.
|
|
9
|
+
from tau.hooks.service import Hooks
|
|
10
|
+
from tau.message.types import (
|
|
11
|
+
AgentMessage,
|
|
12
|
+
AssistantMessage,
|
|
13
|
+
LLMMessage,
|
|
14
|
+
TerminalExecutionMessage,
|
|
15
|
+
TextContent,
|
|
16
|
+
ToolMessage,
|
|
17
|
+
UserMessage,
|
|
18
|
+
)
|
|
11
19
|
from tau.message.utils import strip_unusable_trailing_assistant
|
|
12
20
|
from tau.tool.types import ToolInvocation, ToolResult
|
|
13
21
|
|
|
14
22
|
if TYPE_CHECKING:
|
|
15
23
|
from tau.engine.service import Engine
|
|
16
|
-
from tau.session.manager import SessionManager
|
|
17
24
|
from tau.runtime.service import Runtime
|
|
18
25
|
from tau.session.compaction import CompactionPreparation
|
|
19
|
-
|
|
26
|
+
from tau.session.manager import SessionManager
|
|
20
27
|
|
|
21
28
|
|
|
22
29
|
def _to_llm_messages(messages: list[AgentMessage]) -> list[LLMMessage]:
|
|
@@ -29,7 +36,8 @@ def _to_llm_messages(messages: list[AgentMessage]) -> list[LLMMessage]:
|
|
|
29
36
|
errors) and are skipped — an assistant turn with neither content nor tool
|
|
30
37
|
calls is invalid to send back and triggers provider 400s.
|
|
31
38
|
"""
|
|
32
|
-
from tau.message.types import CompactionSummaryMessage,
|
|
39
|
+
from tau.message.types import CompactionSummaryMessage, ThinkingContent, ToolCallContent
|
|
40
|
+
|
|
33
41
|
result: list[LLMMessage] = []
|
|
34
42
|
for msg in messages:
|
|
35
43
|
if isinstance(msg, CompactionSummaryMessage):
|
|
@@ -40,8 +48,7 @@ def _to_llm_messages(messages: list[AgentMessage]) -> list[LLMMessage]:
|
|
|
40
48
|
result.append(msg.to_user_message())
|
|
41
49
|
elif isinstance(msg, AssistantMessage):
|
|
42
50
|
has_usable = any(
|
|
43
|
-
isinstance(c, (TextContent, ToolCallContent, ThinkingContent))
|
|
44
|
-
for c in msg.contents
|
|
51
|
+
isinstance(c, (TextContent, ToolCallContent, ThinkingContent)) for c in msg.contents
|
|
45
52
|
)
|
|
46
53
|
if has_usable:
|
|
47
54
|
result.append(msg)
|
|
@@ -114,6 +121,7 @@ class Agent:
|
|
|
114
121
|
def update_context_tokens(self) -> None:
|
|
115
122
|
"""Recalculate context token usage."""
|
|
116
123
|
from tau.session.compaction import estimate_context_tokens
|
|
124
|
+
|
|
117
125
|
session_ctx = self._session_manager.build_session_context()
|
|
118
126
|
llm_messages = _to_llm_messages(session_ctx.messages)
|
|
119
127
|
usage = estimate_context_tokens(llm_messages)
|
|
@@ -122,7 +130,9 @@ class Agent:
|
|
|
122
130
|
def get_context_usage(self) -> ContextUsage | None:
|
|
123
131
|
"""Get current context token usage and limits."""
|
|
124
132
|
self.update_context_tokens()
|
|
125
|
-
percent = (
|
|
133
|
+
percent = (
|
|
134
|
+
(self._context_tokens / self._context_window * 100) if self._context_window else None
|
|
135
|
+
)
|
|
126
136
|
return ContextUsage(
|
|
127
137
|
tokens=self._context_tokens,
|
|
128
138
|
context_window=self._context_window,
|
|
@@ -191,7 +201,7 @@ class Agent:
|
|
|
191
201
|
case _:
|
|
192
202
|
pass
|
|
193
203
|
|
|
194
|
-
async def _on_message_rollback(self, event:
|
|
204
|
+
async def _on_message_rollback(self, event: MessageRollbackEvent) -> None:
|
|
195
205
|
"""Retract the last ``event.count`` persisted messages from the session.
|
|
196
206
|
|
|
197
207
|
Fired when an interrupted tool turn is dropped: the assistant tool-call
|
|
@@ -209,22 +219,26 @@ class Agent:
|
|
|
209
219
|
async def compact(self, custom_instructions: str | None = None) -> bool:
|
|
210
220
|
"""Manually trigger context compaction. Returns True if compaction ran."""
|
|
211
221
|
from tau.session.compaction import prepare_compaction
|
|
222
|
+
|
|
212
223
|
entries = self._session_manager.get_branch()
|
|
213
224
|
preparation = prepare_compaction(entries, self._config.compaction)
|
|
214
225
|
if preparation is None:
|
|
215
226
|
return False
|
|
216
|
-
await self._apply_compaction(
|
|
227
|
+
await self._apply_compaction(
|
|
228
|
+
preparation, entries, manual=True, custom_instructions=custom_instructions
|
|
229
|
+
)
|
|
217
230
|
return True
|
|
218
231
|
|
|
219
232
|
async def _apply_compaction(
|
|
220
233
|
self,
|
|
221
|
-
preparation:
|
|
234
|
+
preparation: CompactionPreparation,
|
|
222
235
|
entries: list,
|
|
223
236
|
manual: bool,
|
|
224
237
|
custom_instructions: str | None = None,
|
|
225
238
|
) -> None:
|
|
226
239
|
"""Run a prepared compaction, persist the summary, and emit the end event."""
|
|
227
240
|
from tau.hooks.engine import CompactionEndEvent
|
|
241
|
+
|
|
228
242
|
result, from_extension = await self._run_compaction(
|
|
229
243
|
preparation, entries, manual=manual, custom_instructions=custom_instructions
|
|
230
244
|
)
|
|
@@ -234,16 +248,19 @@ class Agent:
|
|
|
234
248
|
tokens_before=result.tokens_before,
|
|
235
249
|
)
|
|
236
250
|
self._compaction_failures = 0
|
|
237
|
-
await self.hooks.emit(
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
251
|
+
await self.hooks.emit(
|
|
252
|
+
CompactionEndEvent(
|
|
253
|
+
manual=manual,
|
|
254
|
+
tokens_before=result.tokens_before,
|
|
255
|
+
summary_length=len(result.summary),
|
|
256
|
+
from_extension=from_extension,
|
|
257
|
+
)
|
|
258
|
+
)
|
|
243
259
|
|
|
244
260
|
def _latest_compaction_timestamp(self) -> float | None:
|
|
245
261
|
"""Timestamp of the most recent compaction in the active branch, if any."""
|
|
246
262
|
from tau.session.types import CompactionEntry
|
|
263
|
+
|
|
247
264
|
for entry in reversed(self._session_manager.get_branch()):
|
|
248
265
|
if isinstance(entry, CompactionEntry):
|
|
249
266
|
return entry.timestamp
|
|
@@ -252,8 +269,9 @@ class Agent:
|
|
|
252
269
|
async def _check_compaction(self) -> None:
|
|
253
270
|
"""Auto-compact if context usage exceeds the threshold. Circuit-breaks after 3 failures."""
|
|
254
271
|
from tau.session.compaction import (
|
|
255
|
-
estimate_context_tokens,
|
|
272
|
+
estimate_context_tokens,
|
|
256
273
|
prepare_compaction,
|
|
274
|
+
should_compact,
|
|
257
275
|
)
|
|
258
276
|
|
|
259
277
|
if self._compaction_failures >= 3:
|
|
@@ -305,6 +323,7 @@ class Agent:
|
|
|
305
323
|
leaving no room to generate, so it stops with zero output.
|
|
306
324
|
"""
|
|
307
325
|
from tau.inference.types import StopReason
|
|
326
|
+
|
|
308
327
|
cw = self._context_window
|
|
309
328
|
if cw <= 0:
|
|
310
329
|
return False
|
|
@@ -312,9 +331,9 @@ class Agent:
|
|
|
312
331
|
inp = u.input_tokens + u.cache_read_tokens
|
|
313
332
|
if message.stop_reason == StopReason.Stop and inp > cw:
|
|
314
333
|
return True
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
334
|
+
return bool(
|
|
335
|
+
message.stop_reason == StopReason.Length and u.output_tokens == 0 and inp >= cw * 0.99
|
|
336
|
+
)
|
|
318
337
|
|
|
319
338
|
async def _try_overflow_recovery(self) -> bool:
|
|
320
339
|
"""If the last turn died with a context-overflow error, compact once and signal a retry.
|
|
@@ -358,11 +377,18 @@ class Agent:
|
|
|
358
377
|
if self._runtime is None:
|
|
359
378
|
return
|
|
360
379
|
from tau.extensions.context import ExtensionContext
|
|
380
|
+
|
|
361
381
|
ctx = ExtensionContext.from_runtime(self._runtime)
|
|
362
382
|
if ctx.ui is not None:
|
|
363
383
|
ctx.ui.notify(message)
|
|
364
384
|
|
|
365
|
-
async def _run_compaction(
|
|
385
|
+
async def _run_compaction(
|
|
386
|
+
self,
|
|
387
|
+
preparation: CompactionPreparation,
|
|
388
|
+
entries: list,
|
|
389
|
+
manual: bool,
|
|
390
|
+
custom_instructions: str | None = None,
|
|
391
|
+
) -> tuple:
|
|
366
392
|
"""Emit before_compaction (allowing interception), then run the default algorithm.
|
|
367
393
|
|
|
368
394
|
Returns (CompactionResult, from_extension: bool).
|
|
@@ -370,14 +396,20 @@ class Agent:
|
|
|
370
396
|
Exceptions in before_compaction handlers are swallowed — first non-error result wins,
|
|
371
397
|
consistent with error-fallthrough behaviour.
|
|
372
398
|
"""
|
|
399
|
+
from tau.hooks.engine import (
|
|
400
|
+
BeforeCompactionEvent,
|
|
401
|
+
BeforeCompactionResult,
|
|
402
|
+
CompactionStartEvent,
|
|
403
|
+
)
|
|
373
404
|
from tau.session.compaction import compact as _compact
|
|
374
|
-
from tau.hooks.engine import BeforeCompactionEvent, BeforeCompactionResult, CompactionStartEvent
|
|
375
405
|
|
|
376
|
-
before_results = await self.hooks.emit(
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
406
|
+
before_results = await self.hooks.emit(
|
|
407
|
+
BeforeCompactionEvent(
|
|
408
|
+
preparation=preparation,
|
|
409
|
+
entries=entries,
|
|
410
|
+
manual=manual,
|
|
411
|
+
)
|
|
412
|
+
)
|
|
381
413
|
|
|
382
414
|
for res in before_results:
|
|
383
415
|
if not isinstance(res, BeforeCompactionResult):
|
|
@@ -388,7 +420,9 @@ class Agent:
|
|
|
388
420
|
return res.compaction, True
|
|
389
421
|
|
|
390
422
|
await self.hooks.emit(CompactionStartEvent(manual=manual))
|
|
391
|
-
result = await _compact(
|
|
423
|
+
result = await _compact(
|
|
424
|
+
preparation, self._engine.llm, custom_instructions=custom_instructions
|
|
425
|
+
) # type: ignore[arg-type]
|
|
392
426
|
return result, False
|
|
393
427
|
|
|
394
428
|
# -------------------------------------------------------------------------
|
|
@@ -398,7 +432,9 @@ class Agent:
|
|
|
398
432
|
async def invoke(self, text: str, options: PromptOptions | None = None) -> None:
|
|
399
433
|
"""Run one user turn."""
|
|
400
434
|
if self._phase != AgentPhase.IDLE:
|
|
401
|
-
raise RuntimeError(
|
|
435
|
+
raise RuntimeError(
|
|
436
|
+
f"Agent is busy (phase={self._phase!r}). Wait for the current operation to finish."
|
|
437
|
+
)
|
|
402
438
|
|
|
403
439
|
opts = options or PromptOptions()
|
|
404
440
|
|
|
@@ -452,11 +488,11 @@ class Agent:
|
|
|
452
488
|
|
|
453
489
|
async def _run(self, ctx: AgentContext) -> None:
|
|
454
490
|
unsubscribe = self.hooks.register(
|
|
455
|
-
|
|
491
|
+
"message_end",
|
|
456
492
|
lambda event: self._on_message_end(event),
|
|
457
493
|
)
|
|
458
494
|
unsubscribe_rollback = self.hooks.register(
|
|
459
|
-
|
|
495
|
+
"message_rollback",
|
|
460
496
|
lambda event: self._on_message_rollback(event),
|
|
461
497
|
)
|
|
462
498
|
try:
|
|
@@ -1,21 +1,23 @@
|
|
|
1
1
|
from __future__ import annotations
|
|
2
2
|
|
|
3
3
|
from dataclasses import dataclass, field
|
|
4
|
-
from enum import
|
|
4
|
+
from enum import StrEnum
|
|
5
5
|
from pathlib import Path
|
|
6
6
|
from typing import TYPE_CHECKING, Any
|
|
7
7
|
|
|
8
8
|
from pydantic import BaseModel
|
|
9
|
+
|
|
9
10
|
from tau.message.types import LLMMessage
|
|
11
|
+
from tau.session.compaction import DEFAULT_COMPACTION_SETTINGS, CompactionSettings
|
|
10
12
|
from tau.session.types import MessageMeta
|
|
11
|
-
from tau.session.compaction import CompactionSettings, DEFAULT_COMPACTION_SETTINGS
|
|
12
13
|
|
|
13
14
|
if TYPE_CHECKING:
|
|
14
15
|
from tau.tool.types import Tool
|
|
15
16
|
|
|
16
17
|
|
|
17
|
-
class AgentPhase(
|
|
18
|
+
class AgentPhase(StrEnum):
|
|
18
19
|
"""Agent execution phase."""
|
|
20
|
+
|
|
19
21
|
IDLE = "idle"
|
|
20
22
|
TURN = "turn"
|
|
21
23
|
|
|
@@ -23,6 +25,7 @@ class AgentPhase(str, Enum):
|
|
|
23
25
|
@dataclass
|
|
24
26
|
class AgentContext:
|
|
25
27
|
"""Snapshot of everything the LLM receives for one turn."""
|
|
28
|
+
|
|
26
29
|
system_prompt: str
|
|
27
30
|
messages: list[LLMMessage]
|
|
28
31
|
tools: list[Tool] = field(default_factory=list)
|
|
@@ -30,7 +33,8 @@ class AgentContext:
|
|
|
30
33
|
|
|
31
34
|
class AgentConfig(BaseModel):
|
|
32
35
|
"""Internal runtime config passed to Agent.__init__."""
|
|
33
|
-
|
|
36
|
+
|
|
37
|
+
model_config = {"arbitrary_types_allowed": True}
|
|
34
38
|
|
|
35
39
|
cwd: Path
|
|
36
40
|
system_prompt: str = ""
|
|
@@ -39,11 +43,10 @@ class AgentConfig(BaseModel):
|
|
|
39
43
|
compaction: CompactionSettings = DEFAULT_COMPACTION_SETTINGS
|
|
40
44
|
|
|
41
45
|
|
|
42
|
-
|
|
43
|
-
|
|
44
46
|
class PromptOptions(BaseModel):
|
|
45
47
|
"""Configuration options for prompt submission."""
|
|
46
|
-
|
|
48
|
+
|
|
49
|
+
model_config = {"arbitrary_types_allowed": True}
|
|
47
50
|
|
|
48
51
|
meta: MessageMeta | None = None
|
|
49
52
|
images: list[bytes] = []
|
|
@@ -54,8 +57,7 @@ class PromptOptions(BaseModel):
|
|
|
54
57
|
@dataclass
|
|
55
58
|
class ContextUsage:
|
|
56
59
|
"""Token usage and context window statistics."""
|
|
60
|
+
|
|
57
61
|
tokens: int
|
|
58
62
|
context_window: int
|
|
59
63
|
percent: float | None = None
|
|
60
|
-
|
|
61
|
-
|