amd-gaia 0.14.1__py3-none-any.whl
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.
- amd_gaia-0.14.1.dist-info/METADATA +768 -0
- amd_gaia-0.14.1.dist-info/RECORD +800 -0
- amd_gaia-0.14.1.dist-info/WHEEL +5 -0
- amd_gaia-0.14.1.dist-info/entry_points.txt +5 -0
- amd_gaia-0.14.1.dist-info/licenses/LICENSE.md +21 -0
- amd_gaia-0.14.1.dist-info/top_level.txt +1 -0
- gaia/__init__.py +2 -0
- gaia/agents/__init__.py +19 -0
- gaia/agents/base/__init__.py +9 -0
- gaia/agents/base/agent.py +2072 -0
- gaia/agents/base/api_agent.py +120 -0
- gaia/agents/base/console.py +1457 -0
- gaia/agents/base/mcp_agent.py +86 -0
- gaia/agents/base/tools.py +83 -0
- gaia/agents/blender/agent.py +556 -0
- gaia/agents/blender/agent_simple.py +135 -0
- gaia/agents/blender/app.py +211 -0
- gaia/agents/blender/app_simple.py +41 -0
- gaia/agents/blender/core/__init__.py +16 -0
- gaia/agents/blender/core/materials.py +506 -0
- gaia/agents/blender/core/objects.py +316 -0
- gaia/agents/blender/core/rendering.py +225 -0
- gaia/agents/blender/core/scene.py +220 -0
- gaia/agents/blender/core/view.py +146 -0
- gaia/agents/chat/__init__.py +9 -0
- gaia/agents/chat/agent.py +975 -0
- gaia/agents/chat/app.py +1058 -0
- gaia/agents/chat/session.py +508 -0
- gaia/agents/chat/tools/__init__.py +15 -0
- gaia/agents/chat/tools/file_tools.py +96 -0
- gaia/agents/chat/tools/rag_tools.py +1729 -0
- gaia/agents/chat/tools/shell_tools.py +436 -0
- gaia/agents/code/__init__.py +7 -0
- gaia/agents/code/agent.py +547 -0
- gaia/agents/code/app.py +266 -0
- gaia/agents/code/models.py +135 -0
- gaia/agents/code/orchestration/__init__.py +24 -0
- gaia/agents/code/orchestration/checklist_executor.py +1739 -0
- gaia/agents/code/orchestration/checklist_generator.py +709 -0
- gaia/agents/code/orchestration/factories/__init__.py +9 -0
- gaia/agents/code/orchestration/factories/base.py +63 -0
- gaia/agents/code/orchestration/factories/nextjs_factory.py +118 -0
- gaia/agents/code/orchestration/factories/python_factory.py +106 -0
- gaia/agents/code/orchestration/orchestrator.py +610 -0
- gaia/agents/code/orchestration/project_analyzer.py +391 -0
- gaia/agents/code/orchestration/steps/__init__.py +67 -0
- gaia/agents/code/orchestration/steps/base.py +188 -0
- gaia/agents/code/orchestration/steps/error_handler.py +314 -0
- gaia/agents/code/orchestration/steps/nextjs.py +828 -0
- gaia/agents/code/orchestration/steps/python.py +307 -0
- gaia/agents/code/orchestration/template_catalog.py +463 -0
- gaia/agents/code/orchestration/workflows/__init__.py +14 -0
- gaia/agents/code/orchestration/workflows/base.py +80 -0
- gaia/agents/code/orchestration/workflows/nextjs.py +186 -0
- gaia/agents/code/orchestration/workflows/python.py +94 -0
- gaia/agents/code/prompts/__init__.py +11 -0
- gaia/agents/code/prompts/base_prompt.py +77 -0
- gaia/agents/code/prompts/code_patterns.py +1925 -0
- gaia/agents/code/prompts/nextjs_prompt.py +40 -0
- gaia/agents/code/prompts/python_prompt.py +109 -0
- gaia/agents/code/schema_inference.py +365 -0
- gaia/agents/code/system_prompt.py +41 -0
- gaia/agents/code/tools/__init__.py +42 -0
- gaia/agents/code/tools/cli_tools.py +1138 -0
- gaia/agents/code/tools/code_formatting.py +319 -0
- gaia/agents/code/tools/code_tools.py +769 -0
- gaia/agents/code/tools/error_fixing.py +1347 -0
- gaia/agents/code/tools/external_tools.py +180 -0
- gaia/agents/code/tools/file_io.py +845 -0
- gaia/agents/code/tools/prisma_tools.py +190 -0
- gaia/agents/code/tools/project_management.py +1016 -0
- gaia/agents/code/tools/testing.py +321 -0
- gaia/agents/code/tools/typescript_tools.py +122 -0
- gaia/agents/code/tools/validation_parsing.py +461 -0
- gaia/agents/code/tools/validation_tools.py +803 -0
- gaia/agents/code/tools/web_dev_tools.py +1744 -0
- gaia/agents/code/validators/__init__.py +16 -0
- gaia/agents/code/validators/antipattern_checker.py +241 -0
- gaia/agents/code/validators/ast_analyzer.py +197 -0
- gaia/agents/code/validators/requirements_validator.py +145 -0
- gaia/agents/code/validators/syntax_validator.py +171 -0
- gaia/agents/docker/__init__.py +7 -0
- gaia/agents/docker/agent.py +642 -0
- gaia/agents/jira/__init__.py +11 -0
- gaia/agents/jira/agent.py +894 -0
- gaia/agents/jira/jql_templates.py +299 -0
- gaia/agents/routing/__init__.py +7 -0
- gaia/agents/routing/agent.py +512 -0
- gaia/agents/routing/system_prompt.py +75 -0
- gaia/api/__init__.py +23 -0
- gaia/api/agent_registry.py +238 -0
- gaia/api/app.py +305 -0
- gaia/api/openai_server.py +575 -0
- gaia/api/schemas.py +186 -0
- gaia/api/sse_handler.py +370 -0
- gaia/apps/__init__.py +4 -0
- gaia/apps/llm/__init__.py +6 -0
- gaia/apps/llm/app.py +169 -0
- gaia/apps/summarize/app.py +633 -0
- gaia/apps/summarize/html_viewer.py +133 -0
- gaia/apps/summarize/pdf_formatter.py +284 -0
- gaia/audio/__init__.py +2 -0
- gaia/audio/audio_client.py +439 -0
- gaia/audio/audio_recorder.py +269 -0
- gaia/audio/kokoro_tts.py +599 -0
- gaia/audio/whisper_asr.py +432 -0
- gaia/chat/__init__.py +16 -0
- gaia/chat/app.py +430 -0
- gaia/chat/prompts.py +522 -0
- gaia/chat/sdk.py +1200 -0
- gaia/cli.py +5621 -0
- gaia/eval/batch_experiment.py +2332 -0
- gaia/eval/claude.py +542 -0
- gaia/eval/config.py +37 -0
- gaia/eval/email_generator.py +512 -0
- gaia/eval/eval.py +3179 -0
- gaia/eval/groundtruth.py +1130 -0
- gaia/eval/transcript_generator.py +582 -0
- gaia/eval/webapp/README.md +168 -0
- gaia/eval/webapp/node_modules/.bin/mime +16 -0
- gaia/eval/webapp/node_modules/.bin/mime.cmd +17 -0
- gaia/eval/webapp/node_modules/.bin/mime.ps1 +28 -0
- gaia/eval/webapp/node_modules/.package-lock.json +865 -0
- gaia/eval/webapp/node_modules/accepts/HISTORY.md +243 -0
- gaia/eval/webapp/node_modules/accepts/LICENSE +23 -0
- gaia/eval/webapp/node_modules/accepts/README.md +140 -0
- gaia/eval/webapp/node_modules/accepts/index.js +238 -0
- gaia/eval/webapp/node_modules/accepts/package.json +47 -0
- gaia/eval/webapp/node_modules/array-flatten/LICENSE +21 -0
- gaia/eval/webapp/node_modules/array-flatten/README.md +43 -0
- gaia/eval/webapp/node_modules/array-flatten/array-flatten.js +64 -0
- gaia/eval/webapp/node_modules/array-flatten/package.json +39 -0
- gaia/eval/webapp/node_modules/body-parser/HISTORY.md +672 -0
- gaia/eval/webapp/node_modules/body-parser/LICENSE +23 -0
- gaia/eval/webapp/node_modules/body-parser/README.md +476 -0
- gaia/eval/webapp/node_modules/body-parser/SECURITY.md +25 -0
- gaia/eval/webapp/node_modules/body-parser/index.js +156 -0
- gaia/eval/webapp/node_modules/body-parser/lib/read.js +205 -0
- gaia/eval/webapp/node_modules/body-parser/lib/types/json.js +247 -0
- gaia/eval/webapp/node_modules/body-parser/lib/types/raw.js +101 -0
- gaia/eval/webapp/node_modules/body-parser/lib/types/text.js +121 -0
- gaia/eval/webapp/node_modules/body-parser/lib/types/urlencoded.js +307 -0
- gaia/eval/webapp/node_modules/body-parser/package.json +56 -0
- gaia/eval/webapp/node_modules/bytes/History.md +97 -0
- gaia/eval/webapp/node_modules/bytes/LICENSE +23 -0
- gaia/eval/webapp/node_modules/bytes/Readme.md +152 -0
- gaia/eval/webapp/node_modules/bytes/index.js +170 -0
- gaia/eval/webapp/node_modules/bytes/package.json +42 -0
- gaia/eval/webapp/node_modules/call-bind-apply-helpers/.eslintrc +17 -0
- gaia/eval/webapp/node_modules/call-bind-apply-helpers/.github/FUNDING.yml +12 -0
- gaia/eval/webapp/node_modules/call-bind-apply-helpers/.nycrc +9 -0
- gaia/eval/webapp/node_modules/call-bind-apply-helpers/CHANGELOG.md +30 -0
- gaia/eval/webapp/node_modules/call-bind-apply-helpers/LICENSE +21 -0
- gaia/eval/webapp/node_modules/call-bind-apply-helpers/README.md +62 -0
- gaia/eval/webapp/node_modules/call-bind-apply-helpers/actualApply.d.ts +1 -0
- gaia/eval/webapp/node_modules/call-bind-apply-helpers/actualApply.js +10 -0
- gaia/eval/webapp/node_modules/call-bind-apply-helpers/applyBind.d.ts +19 -0
- gaia/eval/webapp/node_modules/call-bind-apply-helpers/applyBind.js +10 -0
- gaia/eval/webapp/node_modules/call-bind-apply-helpers/functionApply.d.ts +1 -0
- gaia/eval/webapp/node_modules/call-bind-apply-helpers/functionApply.js +4 -0
- gaia/eval/webapp/node_modules/call-bind-apply-helpers/functionCall.d.ts +1 -0
- gaia/eval/webapp/node_modules/call-bind-apply-helpers/functionCall.js +4 -0
- gaia/eval/webapp/node_modules/call-bind-apply-helpers/index.d.ts +64 -0
- gaia/eval/webapp/node_modules/call-bind-apply-helpers/index.js +15 -0
- gaia/eval/webapp/node_modules/call-bind-apply-helpers/package.json +85 -0
- gaia/eval/webapp/node_modules/call-bind-apply-helpers/reflectApply.d.ts +3 -0
- gaia/eval/webapp/node_modules/call-bind-apply-helpers/reflectApply.js +4 -0
- gaia/eval/webapp/node_modules/call-bind-apply-helpers/test/index.js +63 -0
- gaia/eval/webapp/node_modules/call-bind-apply-helpers/tsconfig.json +9 -0
- gaia/eval/webapp/node_modules/call-bound/.eslintrc +13 -0
- gaia/eval/webapp/node_modules/call-bound/.github/FUNDING.yml +12 -0
- gaia/eval/webapp/node_modules/call-bound/.nycrc +9 -0
- gaia/eval/webapp/node_modules/call-bound/CHANGELOG.md +42 -0
- gaia/eval/webapp/node_modules/call-bound/LICENSE +21 -0
- gaia/eval/webapp/node_modules/call-bound/README.md +53 -0
- gaia/eval/webapp/node_modules/call-bound/index.d.ts +94 -0
- gaia/eval/webapp/node_modules/call-bound/index.js +19 -0
- gaia/eval/webapp/node_modules/call-bound/package.json +99 -0
- gaia/eval/webapp/node_modules/call-bound/test/index.js +61 -0
- gaia/eval/webapp/node_modules/call-bound/tsconfig.json +10 -0
- gaia/eval/webapp/node_modules/content-disposition/HISTORY.md +60 -0
- gaia/eval/webapp/node_modules/content-disposition/LICENSE +22 -0
- gaia/eval/webapp/node_modules/content-disposition/README.md +142 -0
- gaia/eval/webapp/node_modules/content-disposition/index.js +458 -0
- gaia/eval/webapp/node_modules/content-disposition/package.json +44 -0
- gaia/eval/webapp/node_modules/content-type/HISTORY.md +29 -0
- gaia/eval/webapp/node_modules/content-type/LICENSE +22 -0
- gaia/eval/webapp/node_modules/content-type/README.md +94 -0
- gaia/eval/webapp/node_modules/content-type/index.js +225 -0
- gaia/eval/webapp/node_modules/content-type/package.json +42 -0
- gaia/eval/webapp/node_modules/cookie/LICENSE +24 -0
- gaia/eval/webapp/node_modules/cookie/README.md +317 -0
- gaia/eval/webapp/node_modules/cookie/SECURITY.md +25 -0
- gaia/eval/webapp/node_modules/cookie/index.js +334 -0
- gaia/eval/webapp/node_modules/cookie/package.json +44 -0
- gaia/eval/webapp/node_modules/cookie-signature/.npmignore +4 -0
- gaia/eval/webapp/node_modules/cookie-signature/History.md +38 -0
- gaia/eval/webapp/node_modules/cookie-signature/Readme.md +42 -0
- gaia/eval/webapp/node_modules/cookie-signature/index.js +51 -0
- gaia/eval/webapp/node_modules/cookie-signature/package.json +18 -0
- gaia/eval/webapp/node_modules/debug/.coveralls.yml +1 -0
- gaia/eval/webapp/node_modules/debug/.eslintrc +11 -0
- gaia/eval/webapp/node_modules/debug/.npmignore +9 -0
- gaia/eval/webapp/node_modules/debug/.travis.yml +14 -0
- gaia/eval/webapp/node_modules/debug/CHANGELOG.md +362 -0
- gaia/eval/webapp/node_modules/debug/LICENSE +19 -0
- gaia/eval/webapp/node_modules/debug/Makefile +50 -0
- gaia/eval/webapp/node_modules/debug/README.md +312 -0
- gaia/eval/webapp/node_modules/debug/component.json +19 -0
- gaia/eval/webapp/node_modules/debug/karma.conf.js +70 -0
- gaia/eval/webapp/node_modules/debug/node.js +1 -0
- gaia/eval/webapp/node_modules/debug/package.json +49 -0
- gaia/eval/webapp/node_modules/debug/src/browser.js +185 -0
- gaia/eval/webapp/node_modules/debug/src/debug.js +202 -0
- gaia/eval/webapp/node_modules/debug/src/index.js +10 -0
- gaia/eval/webapp/node_modules/debug/src/inspector-log.js +15 -0
- gaia/eval/webapp/node_modules/debug/src/node.js +248 -0
- gaia/eval/webapp/node_modules/depd/History.md +103 -0
- gaia/eval/webapp/node_modules/depd/LICENSE +22 -0
- gaia/eval/webapp/node_modules/depd/Readme.md +280 -0
- gaia/eval/webapp/node_modules/depd/index.js +538 -0
- gaia/eval/webapp/node_modules/depd/lib/browser/index.js +77 -0
- gaia/eval/webapp/node_modules/depd/package.json +45 -0
- gaia/eval/webapp/node_modules/destroy/LICENSE +23 -0
- gaia/eval/webapp/node_modules/destroy/README.md +63 -0
- gaia/eval/webapp/node_modules/destroy/index.js +209 -0
- gaia/eval/webapp/node_modules/destroy/package.json +48 -0
- gaia/eval/webapp/node_modules/dunder-proto/.eslintrc +5 -0
- gaia/eval/webapp/node_modules/dunder-proto/.github/FUNDING.yml +12 -0
- gaia/eval/webapp/node_modules/dunder-proto/.nycrc +13 -0
- gaia/eval/webapp/node_modules/dunder-proto/CHANGELOG.md +24 -0
- gaia/eval/webapp/node_modules/dunder-proto/LICENSE +21 -0
- gaia/eval/webapp/node_modules/dunder-proto/README.md +54 -0
- gaia/eval/webapp/node_modules/dunder-proto/get.d.ts +5 -0
- gaia/eval/webapp/node_modules/dunder-proto/get.js +30 -0
- gaia/eval/webapp/node_modules/dunder-proto/package.json +76 -0
- gaia/eval/webapp/node_modules/dunder-proto/set.d.ts +5 -0
- gaia/eval/webapp/node_modules/dunder-proto/set.js +35 -0
- gaia/eval/webapp/node_modules/dunder-proto/test/get.js +34 -0
- gaia/eval/webapp/node_modules/dunder-proto/test/index.js +4 -0
- gaia/eval/webapp/node_modules/dunder-proto/test/set.js +50 -0
- gaia/eval/webapp/node_modules/dunder-proto/tsconfig.json +9 -0
- gaia/eval/webapp/node_modules/ee-first/LICENSE +22 -0
- gaia/eval/webapp/node_modules/ee-first/README.md +80 -0
- gaia/eval/webapp/node_modules/ee-first/index.js +95 -0
- gaia/eval/webapp/node_modules/ee-first/package.json +29 -0
- gaia/eval/webapp/node_modules/encodeurl/LICENSE +22 -0
- gaia/eval/webapp/node_modules/encodeurl/README.md +109 -0
- gaia/eval/webapp/node_modules/encodeurl/index.js +60 -0
- gaia/eval/webapp/node_modules/encodeurl/package.json +40 -0
- gaia/eval/webapp/node_modules/es-define-property/.eslintrc +13 -0
- gaia/eval/webapp/node_modules/es-define-property/.github/FUNDING.yml +12 -0
- gaia/eval/webapp/node_modules/es-define-property/.nycrc +9 -0
- gaia/eval/webapp/node_modules/es-define-property/CHANGELOG.md +29 -0
- gaia/eval/webapp/node_modules/es-define-property/LICENSE +21 -0
- gaia/eval/webapp/node_modules/es-define-property/README.md +49 -0
- gaia/eval/webapp/node_modules/es-define-property/index.d.ts +3 -0
- gaia/eval/webapp/node_modules/es-define-property/index.js +14 -0
- gaia/eval/webapp/node_modules/es-define-property/package.json +81 -0
- gaia/eval/webapp/node_modules/es-define-property/test/index.js +56 -0
- gaia/eval/webapp/node_modules/es-define-property/tsconfig.json +10 -0
- gaia/eval/webapp/node_modules/es-errors/.eslintrc +5 -0
- gaia/eval/webapp/node_modules/es-errors/.github/FUNDING.yml +12 -0
- gaia/eval/webapp/node_modules/es-errors/CHANGELOG.md +40 -0
- gaia/eval/webapp/node_modules/es-errors/LICENSE +21 -0
- gaia/eval/webapp/node_modules/es-errors/README.md +55 -0
- gaia/eval/webapp/node_modules/es-errors/eval.d.ts +3 -0
- gaia/eval/webapp/node_modules/es-errors/eval.js +4 -0
- gaia/eval/webapp/node_modules/es-errors/index.d.ts +3 -0
- gaia/eval/webapp/node_modules/es-errors/index.js +4 -0
- gaia/eval/webapp/node_modules/es-errors/package.json +80 -0
- gaia/eval/webapp/node_modules/es-errors/range.d.ts +3 -0
- gaia/eval/webapp/node_modules/es-errors/range.js +4 -0
- gaia/eval/webapp/node_modules/es-errors/ref.d.ts +3 -0
- gaia/eval/webapp/node_modules/es-errors/ref.js +4 -0
- gaia/eval/webapp/node_modules/es-errors/syntax.d.ts +3 -0
- gaia/eval/webapp/node_modules/es-errors/syntax.js +4 -0
- gaia/eval/webapp/node_modules/es-errors/test/index.js +19 -0
- gaia/eval/webapp/node_modules/es-errors/tsconfig.json +49 -0
- gaia/eval/webapp/node_modules/es-errors/type.d.ts +3 -0
- gaia/eval/webapp/node_modules/es-errors/type.js +4 -0
- gaia/eval/webapp/node_modules/es-errors/uri.d.ts +3 -0
- gaia/eval/webapp/node_modules/es-errors/uri.js +4 -0
- gaia/eval/webapp/node_modules/es-object-atoms/.eslintrc +16 -0
- gaia/eval/webapp/node_modules/es-object-atoms/.github/FUNDING.yml +12 -0
- gaia/eval/webapp/node_modules/es-object-atoms/CHANGELOG.md +37 -0
- gaia/eval/webapp/node_modules/es-object-atoms/LICENSE +21 -0
- gaia/eval/webapp/node_modules/es-object-atoms/README.md +63 -0
- gaia/eval/webapp/node_modules/es-object-atoms/RequireObjectCoercible.d.ts +3 -0
- gaia/eval/webapp/node_modules/es-object-atoms/RequireObjectCoercible.js +11 -0
- gaia/eval/webapp/node_modules/es-object-atoms/ToObject.d.ts +7 -0
- gaia/eval/webapp/node_modules/es-object-atoms/ToObject.js +10 -0
- gaia/eval/webapp/node_modules/es-object-atoms/index.d.ts +3 -0
- gaia/eval/webapp/node_modules/es-object-atoms/index.js +4 -0
- gaia/eval/webapp/node_modules/es-object-atoms/isObject.d.ts +3 -0
- gaia/eval/webapp/node_modules/es-object-atoms/isObject.js +6 -0
- gaia/eval/webapp/node_modules/es-object-atoms/package.json +80 -0
- gaia/eval/webapp/node_modules/es-object-atoms/test/index.js +38 -0
- gaia/eval/webapp/node_modules/es-object-atoms/tsconfig.json +6 -0
- gaia/eval/webapp/node_modules/escape-html/LICENSE +24 -0
- gaia/eval/webapp/node_modules/escape-html/Readme.md +43 -0
- gaia/eval/webapp/node_modules/escape-html/index.js +78 -0
- gaia/eval/webapp/node_modules/escape-html/package.json +24 -0
- gaia/eval/webapp/node_modules/etag/HISTORY.md +83 -0
- gaia/eval/webapp/node_modules/etag/LICENSE +22 -0
- gaia/eval/webapp/node_modules/etag/README.md +159 -0
- gaia/eval/webapp/node_modules/etag/index.js +131 -0
- gaia/eval/webapp/node_modules/etag/package.json +47 -0
- gaia/eval/webapp/node_modules/express/History.md +3656 -0
- gaia/eval/webapp/node_modules/express/LICENSE +24 -0
- gaia/eval/webapp/node_modules/express/Readme.md +260 -0
- gaia/eval/webapp/node_modules/express/index.js +11 -0
- gaia/eval/webapp/node_modules/express/lib/application.js +661 -0
- gaia/eval/webapp/node_modules/express/lib/express.js +116 -0
- gaia/eval/webapp/node_modules/express/lib/middleware/init.js +43 -0
- gaia/eval/webapp/node_modules/express/lib/middleware/query.js +47 -0
- gaia/eval/webapp/node_modules/express/lib/request.js +525 -0
- gaia/eval/webapp/node_modules/express/lib/response.js +1179 -0
- gaia/eval/webapp/node_modules/express/lib/router/index.js +673 -0
- gaia/eval/webapp/node_modules/express/lib/router/layer.js +181 -0
- gaia/eval/webapp/node_modules/express/lib/router/route.js +230 -0
- gaia/eval/webapp/node_modules/express/lib/utils.js +303 -0
- gaia/eval/webapp/node_modules/express/lib/view.js +182 -0
- gaia/eval/webapp/node_modules/express/package.json +102 -0
- gaia/eval/webapp/node_modules/finalhandler/HISTORY.md +210 -0
- gaia/eval/webapp/node_modules/finalhandler/LICENSE +22 -0
- gaia/eval/webapp/node_modules/finalhandler/README.md +147 -0
- gaia/eval/webapp/node_modules/finalhandler/SECURITY.md +25 -0
- gaia/eval/webapp/node_modules/finalhandler/index.js +341 -0
- gaia/eval/webapp/node_modules/finalhandler/package.json +47 -0
- gaia/eval/webapp/node_modules/forwarded/HISTORY.md +21 -0
- gaia/eval/webapp/node_modules/forwarded/LICENSE +22 -0
- gaia/eval/webapp/node_modules/forwarded/README.md +57 -0
- gaia/eval/webapp/node_modules/forwarded/index.js +90 -0
- gaia/eval/webapp/node_modules/forwarded/package.json +45 -0
- gaia/eval/webapp/node_modules/fresh/HISTORY.md +70 -0
- gaia/eval/webapp/node_modules/fresh/LICENSE +23 -0
- gaia/eval/webapp/node_modules/fresh/README.md +119 -0
- gaia/eval/webapp/node_modules/fresh/index.js +137 -0
- gaia/eval/webapp/node_modules/fresh/package.json +46 -0
- gaia/eval/webapp/node_modules/fs/README.md +9 -0
- gaia/eval/webapp/node_modules/fs/package.json +20 -0
- gaia/eval/webapp/node_modules/function-bind/.eslintrc +21 -0
- gaia/eval/webapp/node_modules/function-bind/.github/FUNDING.yml +12 -0
- gaia/eval/webapp/node_modules/function-bind/.github/SECURITY.md +3 -0
- gaia/eval/webapp/node_modules/function-bind/.nycrc +13 -0
- gaia/eval/webapp/node_modules/function-bind/CHANGELOG.md +136 -0
- gaia/eval/webapp/node_modules/function-bind/LICENSE +20 -0
- gaia/eval/webapp/node_modules/function-bind/README.md +46 -0
- gaia/eval/webapp/node_modules/function-bind/implementation.js +84 -0
- gaia/eval/webapp/node_modules/function-bind/index.js +5 -0
- gaia/eval/webapp/node_modules/function-bind/package.json +87 -0
- gaia/eval/webapp/node_modules/function-bind/test/.eslintrc +9 -0
- gaia/eval/webapp/node_modules/function-bind/test/index.js +252 -0
- gaia/eval/webapp/node_modules/get-intrinsic/.eslintrc +42 -0
- gaia/eval/webapp/node_modules/get-intrinsic/.github/FUNDING.yml +12 -0
- gaia/eval/webapp/node_modules/get-intrinsic/.nycrc +9 -0
- gaia/eval/webapp/node_modules/get-intrinsic/CHANGELOG.md +186 -0
- gaia/eval/webapp/node_modules/get-intrinsic/LICENSE +21 -0
- gaia/eval/webapp/node_modules/get-intrinsic/README.md +71 -0
- gaia/eval/webapp/node_modules/get-intrinsic/index.js +378 -0
- gaia/eval/webapp/node_modules/get-intrinsic/package.json +97 -0
- gaia/eval/webapp/node_modules/get-intrinsic/test/GetIntrinsic.js +274 -0
- gaia/eval/webapp/node_modules/get-proto/.eslintrc +10 -0
- gaia/eval/webapp/node_modules/get-proto/.github/FUNDING.yml +12 -0
- gaia/eval/webapp/node_modules/get-proto/.nycrc +9 -0
- gaia/eval/webapp/node_modules/get-proto/CHANGELOG.md +21 -0
- gaia/eval/webapp/node_modules/get-proto/LICENSE +21 -0
- gaia/eval/webapp/node_modules/get-proto/Object.getPrototypeOf.d.ts +5 -0
- gaia/eval/webapp/node_modules/get-proto/Object.getPrototypeOf.js +6 -0
- gaia/eval/webapp/node_modules/get-proto/README.md +50 -0
- gaia/eval/webapp/node_modules/get-proto/Reflect.getPrototypeOf.d.ts +3 -0
- gaia/eval/webapp/node_modules/get-proto/Reflect.getPrototypeOf.js +4 -0
- gaia/eval/webapp/node_modules/get-proto/index.d.ts +5 -0
- gaia/eval/webapp/node_modules/get-proto/index.js +27 -0
- gaia/eval/webapp/node_modules/get-proto/package.json +81 -0
- gaia/eval/webapp/node_modules/get-proto/test/index.js +68 -0
- gaia/eval/webapp/node_modules/get-proto/tsconfig.json +9 -0
- gaia/eval/webapp/node_modules/gopd/.eslintrc +16 -0
- gaia/eval/webapp/node_modules/gopd/.github/FUNDING.yml +12 -0
- gaia/eval/webapp/node_modules/gopd/CHANGELOG.md +45 -0
- gaia/eval/webapp/node_modules/gopd/LICENSE +21 -0
- gaia/eval/webapp/node_modules/gopd/README.md +40 -0
- gaia/eval/webapp/node_modules/gopd/gOPD.d.ts +1 -0
- gaia/eval/webapp/node_modules/gopd/gOPD.js +4 -0
- gaia/eval/webapp/node_modules/gopd/index.d.ts +5 -0
- gaia/eval/webapp/node_modules/gopd/index.js +15 -0
- gaia/eval/webapp/node_modules/gopd/package.json +77 -0
- gaia/eval/webapp/node_modules/gopd/test/index.js +36 -0
- gaia/eval/webapp/node_modules/gopd/tsconfig.json +9 -0
- gaia/eval/webapp/node_modules/has-symbols/.eslintrc +11 -0
- gaia/eval/webapp/node_modules/has-symbols/.github/FUNDING.yml +12 -0
- gaia/eval/webapp/node_modules/has-symbols/.nycrc +9 -0
- gaia/eval/webapp/node_modules/has-symbols/CHANGELOG.md +91 -0
- gaia/eval/webapp/node_modules/has-symbols/LICENSE +21 -0
- gaia/eval/webapp/node_modules/has-symbols/README.md +46 -0
- gaia/eval/webapp/node_modules/has-symbols/index.d.ts +3 -0
- gaia/eval/webapp/node_modules/has-symbols/index.js +14 -0
- gaia/eval/webapp/node_modules/has-symbols/package.json +111 -0
- gaia/eval/webapp/node_modules/has-symbols/shams.d.ts +3 -0
- gaia/eval/webapp/node_modules/has-symbols/shams.js +45 -0
- gaia/eval/webapp/node_modules/has-symbols/test/index.js +22 -0
- gaia/eval/webapp/node_modules/has-symbols/test/shams/core-js.js +29 -0
- gaia/eval/webapp/node_modules/has-symbols/test/shams/get-own-property-symbols.js +29 -0
- gaia/eval/webapp/node_modules/has-symbols/test/tests.js +58 -0
- gaia/eval/webapp/node_modules/has-symbols/tsconfig.json +10 -0
- gaia/eval/webapp/node_modules/hasown/.eslintrc +5 -0
- gaia/eval/webapp/node_modules/hasown/.github/FUNDING.yml +12 -0
- gaia/eval/webapp/node_modules/hasown/.nycrc +13 -0
- gaia/eval/webapp/node_modules/hasown/CHANGELOG.md +40 -0
- gaia/eval/webapp/node_modules/hasown/LICENSE +21 -0
- gaia/eval/webapp/node_modules/hasown/README.md +40 -0
- gaia/eval/webapp/node_modules/hasown/index.d.ts +3 -0
- gaia/eval/webapp/node_modules/hasown/index.js +8 -0
- gaia/eval/webapp/node_modules/hasown/package.json +92 -0
- gaia/eval/webapp/node_modules/hasown/tsconfig.json +6 -0
- gaia/eval/webapp/node_modules/http-errors/HISTORY.md +180 -0
- gaia/eval/webapp/node_modules/http-errors/LICENSE +23 -0
- gaia/eval/webapp/node_modules/http-errors/README.md +169 -0
- gaia/eval/webapp/node_modules/http-errors/index.js +289 -0
- gaia/eval/webapp/node_modules/http-errors/package.json +50 -0
- gaia/eval/webapp/node_modules/iconv-lite/Changelog.md +162 -0
- gaia/eval/webapp/node_modules/iconv-lite/LICENSE +21 -0
- gaia/eval/webapp/node_modules/iconv-lite/README.md +156 -0
- gaia/eval/webapp/node_modules/iconv-lite/encodings/dbcs-codec.js +555 -0
- gaia/eval/webapp/node_modules/iconv-lite/encodings/dbcs-data.js +176 -0
- gaia/eval/webapp/node_modules/iconv-lite/encodings/index.js +22 -0
- gaia/eval/webapp/node_modules/iconv-lite/encodings/internal.js +188 -0
- gaia/eval/webapp/node_modules/iconv-lite/encodings/sbcs-codec.js +72 -0
- gaia/eval/webapp/node_modules/iconv-lite/encodings/sbcs-data-generated.js +451 -0
- gaia/eval/webapp/node_modules/iconv-lite/encodings/sbcs-data.js +174 -0
- gaia/eval/webapp/node_modules/iconv-lite/encodings/tables/big5-added.json +122 -0
- gaia/eval/webapp/node_modules/iconv-lite/encodings/tables/cp936.json +264 -0
- gaia/eval/webapp/node_modules/iconv-lite/encodings/tables/cp949.json +273 -0
- gaia/eval/webapp/node_modules/iconv-lite/encodings/tables/cp950.json +177 -0
- gaia/eval/webapp/node_modules/iconv-lite/encodings/tables/eucjp.json +182 -0
- gaia/eval/webapp/node_modules/iconv-lite/encodings/tables/gb18030-ranges.json +1 -0
- gaia/eval/webapp/node_modules/iconv-lite/encodings/tables/gbk-added.json +55 -0
- gaia/eval/webapp/node_modules/iconv-lite/encodings/tables/shiftjis.json +125 -0
- gaia/eval/webapp/node_modules/iconv-lite/encodings/utf16.js +177 -0
- gaia/eval/webapp/node_modules/iconv-lite/encodings/utf7.js +290 -0
- gaia/eval/webapp/node_modules/iconv-lite/lib/bom-handling.js +52 -0
- gaia/eval/webapp/node_modules/iconv-lite/lib/extend-node.js +217 -0
- gaia/eval/webapp/node_modules/iconv-lite/lib/index.d.ts +24 -0
- gaia/eval/webapp/node_modules/iconv-lite/lib/index.js +153 -0
- gaia/eval/webapp/node_modules/iconv-lite/lib/streams.js +121 -0
- gaia/eval/webapp/node_modules/iconv-lite/package.json +46 -0
- gaia/eval/webapp/node_modules/inherits/LICENSE +16 -0
- gaia/eval/webapp/node_modules/inherits/README.md +42 -0
- gaia/eval/webapp/node_modules/inherits/inherits.js +9 -0
- gaia/eval/webapp/node_modules/inherits/inherits_browser.js +27 -0
- gaia/eval/webapp/node_modules/inherits/package.json +29 -0
- gaia/eval/webapp/node_modules/ipaddr.js/LICENSE +19 -0
- gaia/eval/webapp/node_modules/ipaddr.js/README.md +233 -0
- gaia/eval/webapp/node_modules/ipaddr.js/ipaddr.min.js +1 -0
- gaia/eval/webapp/node_modules/ipaddr.js/lib/ipaddr.js +673 -0
- gaia/eval/webapp/node_modules/ipaddr.js/lib/ipaddr.js.d.ts +68 -0
- gaia/eval/webapp/node_modules/ipaddr.js/package.json +35 -0
- gaia/eval/webapp/node_modules/math-intrinsics/.eslintrc +16 -0
- gaia/eval/webapp/node_modules/math-intrinsics/.github/FUNDING.yml +12 -0
- gaia/eval/webapp/node_modules/math-intrinsics/CHANGELOG.md +24 -0
- gaia/eval/webapp/node_modules/math-intrinsics/LICENSE +21 -0
- gaia/eval/webapp/node_modules/math-intrinsics/README.md +50 -0
- gaia/eval/webapp/node_modules/math-intrinsics/abs.d.ts +1 -0
- gaia/eval/webapp/node_modules/math-intrinsics/abs.js +4 -0
- gaia/eval/webapp/node_modules/math-intrinsics/constants/maxArrayLength.d.ts +3 -0
- gaia/eval/webapp/node_modules/math-intrinsics/constants/maxArrayLength.js +4 -0
- gaia/eval/webapp/node_modules/math-intrinsics/constants/maxSafeInteger.d.ts +3 -0
- gaia/eval/webapp/node_modules/math-intrinsics/constants/maxSafeInteger.js +5 -0
- gaia/eval/webapp/node_modules/math-intrinsics/constants/maxValue.d.ts +3 -0
- gaia/eval/webapp/node_modules/math-intrinsics/constants/maxValue.js +5 -0
- gaia/eval/webapp/node_modules/math-intrinsics/floor.d.ts +1 -0
- gaia/eval/webapp/node_modules/math-intrinsics/floor.js +4 -0
- gaia/eval/webapp/node_modules/math-intrinsics/isFinite.d.ts +3 -0
- gaia/eval/webapp/node_modules/math-intrinsics/isFinite.js +12 -0
- gaia/eval/webapp/node_modules/math-intrinsics/isInteger.d.ts +3 -0
- gaia/eval/webapp/node_modules/math-intrinsics/isInteger.js +16 -0
- gaia/eval/webapp/node_modules/math-intrinsics/isNaN.d.ts +1 -0
- gaia/eval/webapp/node_modules/math-intrinsics/isNaN.js +6 -0
- gaia/eval/webapp/node_modules/math-intrinsics/isNegativeZero.d.ts +3 -0
- gaia/eval/webapp/node_modules/math-intrinsics/isNegativeZero.js +6 -0
- gaia/eval/webapp/node_modules/math-intrinsics/max.d.ts +1 -0
- gaia/eval/webapp/node_modules/math-intrinsics/max.js +4 -0
- gaia/eval/webapp/node_modules/math-intrinsics/min.d.ts +1 -0
- gaia/eval/webapp/node_modules/math-intrinsics/min.js +4 -0
- gaia/eval/webapp/node_modules/math-intrinsics/mod.d.ts +3 -0
- gaia/eval/webapp/node_modules/math-intrinsics/mod.js +9 -0
- gaia/eval/webapp/node_modules/math-intrinsics/package.json +86 -0
- gaia/eval/webapp/node_modules/math-intrinsics/pow.d.ts +1 -0
- gaia/eval/webapp/node_modules/math-intrinsics/pow.js +4 -0
- gaia/eval/webapp/node_modules/math-intrinsics/round.d.ts +1 -0
- gaia/eval/webapp/node_modules/math-intrinsics/round.js +4 -0
- gaia/eval/webapp/node_modules/math-intrinsics/sign.d.ts +3 -0
- gaia/eval/webapp/node_modules/math-intrinsics/sign.js +11 -0
- gaia/eval/webapp/node_modules/math-intrinsics/test/index.js +192 -0
- gaia/eval/webapp/node_modules/math-intrinsics/tsconfig.json +3 -0
- gaia/eval/webapp/node_modules/media-typer/HISTORY.md +22 -0
- gaia/eval/webapp/node_modules/media-typer/LICENSE +22 -0
- gaia/eval/webapp/node_modules/media-typer/README.md +81 -0
- gaia/eval/webapp/node_modules/media-typer/index.js +270 -0
- gaia/eval/webapp/node_modules/media-typer/package.json +26 -0
- gaia/eval/webapp/node_modules/merge-descriptors/HISTORY.md +21 -0
- gaia/eval/webapp/node_modules/merge-descriptors/LICENSE +23 -0
- gaia/eval/webapp/node_modules/merge-descriptors/README.md +49 -0
- gaia/eval/webapp/node_modules/merge-descriptors/index.js +60 -0
- gaia/eval/webapp/node_modules/merge-descriptors/package.json +39 -0
- gaia/eval/webapp/node_modules/methods/HISTORY.md +29 -0
- gaia/eval/webapp/node_modules/methods/LICENSE +24 -0
- gaia/eval/webapp/node_modules/methods/README.md +51 -0
- gaia/eval/webapp/node_modules/methods/index.js +69 -0
- gaia/eval/webapp/node_modules/methods/package.json +36 -0
- gaia/eval/webapp/node_modules/mime/.npmignore +0 -0
- gaia/eval/webapp/node_modules/mime/CHANGELOG.md +164 -0
- gaia/eval/webapp/node_modules/mime/LICENSE +21 -0
- gaia/eval/webapp/node_modules/mime/README.md +90 -0
- gaia/eval/webapp/node_modules/mime/cli.js +8 -0
- gaia/eval/webapp/node_modules/mime/mime.js +108 -0
- gaia/eval/webapp/node_modules/mime/package.json +44 -0
- gaia/eval/webapp/node_modules/mime/src/build.js +53 -0
- gaia/eval/webapp/node_modules/mime/src/test.js +60 -0
- gaia/eval/webapp/node_modules/mime/types.json +1 -0
- gaia/eval/webapp/node_modules/mime-db/HISTORY.md +507 -0
- gaia/eval/webapp/node_modules/mime-db/LICENSE +23 -0
- gaia/eval/webapp/node_modules/mime-db/README.md +100 -0
- gaia/eval/webapp/node_modules/mime-db/db.json +8519 -0
- gaia/eval/webapp/node_modules/mime-db/index.js +12 -0
- gaia/eval/webapp/node_modules/mime-db/package.json +60 -0
- gaia/eval/webapp/node_modules/mime-types/HISTORY.md +397 -0
- gaia/eval/webapp/node_modules/mime-types/LICENSE +23 -0
- gaia/eval/webapp/node_modules/mime-types/README.md +113 -0
- gaia/eval/webapp/node_modules/mime-types/index.js +188 -0
- gaia/eval/webapp/node_modules/mime-types/package.json +44 -0
- gaia/eval/webapp/node_modules/ms/index.js +152 -0
- gaia/eval/webapp/node_modules/ms/license.md +21 -0
- gaia/eval/webapp/node_modules/ms/package.json +37 -0
- gaia/eval/webapp/node_modules/ms/readme.md +51 -0
- gaia/eval/webapp/node_modules/negotiator/HISTORY.md +108 -0
- gaia/eval/webapp/node_modules/negotiator/LICENSE +24 -0
- gaia/eval/webapp/node_modules/negotiator/README.md +203 -0
- gaia/eval/webapp/node_modules/negotiator/index.js +82 -0
- gaia/eval/webapp/node_modules/negotiator/lib/charset.js +169 -0
- gaia/eval/webapp/node_modules/negotiator/lib/encoding.js +184 -0
- gaia/eval/webapp/node_modules/negotiator/lib/language.js +179 -0
- gaia/eval/webapp/node_modules/negotiator/lib/mediaType.js +294 -0
- gaia/eval/webapp/node_modules/negotiator/package.json +42 -0
- gaia/eval/webapp/node_modules/object-inspect/.eslintrc +53 -0
- gaia/eval/webapp/node_modules/object-inspect/.github/FUNDING.yml +12 -0
- gaia/eval/webapp/node_modules/object-inspect/.nycrc +13 -0
- gaia/eval/webapp/node_modules/object-inspect/CHANGELOG.md +424 -0
- gaia/eval/webapp/node_modules/object-inspect/LICENSE +21 -0
- gaia/eval/webapp/node_modules/object-inspect/example/all.js +23 -0
- gaia/eval/webapp/node_modules/object-inspect/example/circular.js +6 -0
- gaia/eval/webapp/node_modules/object-inspect/example/fn.js +5 -0
- gaia/eval/webapp/node_modules/object-inspect/example/inspect.js +10 -0
- gaia/eval/webapp/node_modules/object-inspect/index.js +544 -0
- gaia/eval/webapp/node_modules/object-inspect/package-support.json +20 -0
- gaia/eval/webapp/node_modules/object-inspect/package.json +105 -0
- gaia/eval/webapp/node_modules/object-inspect/readme.markdown +84 -0
- gaia/eval/webapp/node_modules/object-inspect/test/bigint.js +58 -0
- gaia/eval/webapp/node_modules/object-inspect/test/browser/dom.js +15 -0
- gaia/eval/webapp/node_modules/object-inspect/test/circular.js +16 -0
- gaia/eval/webapp/node_modules/object-inspect/test/deep.js +12 -0
- gaia/eval/webapp/node_modules/object-inspect/test/element.js +53 -0
- gaia/eval/webapp/node_modules/object-inspect/test/err.js +48 -0
- gaia/eval/webapp/node_modules/object-inspect/test/fakes.js +29 -0
- gaia/eval/webapp/node_modules/object-inspect/test/fn.js +76 -0
- gaia/eval/webapp/node_modules/object-inspect/test/global.js +17 -0
- gaia/eval/webapp/node_modules/object-inspect/test/has.js +15 -0
- gaia/eval/webapp/node_modules/object-inspect/test/holes.js +15 -0
- gaia/eval/webapp/node_modules/object-inspect/test/indent-option.js +271 -0
- gaia/eval/webapp/node_modules/object-inspect/test/inspect.js +139 -0
- gaia/eval/webapp/node_modules/object-inspect/test/lowbyte.js +12 -0
- gaia/eval/webapp/node_modules/object-inspect/test/number.js +58 -0
- gaia/eval/webapp/node_modules/object-inspect/test/quoteStyle.js +26 -0
- gaia/eval/webapp/node_modules/object-inspect/test/toStringTag.js +40 -0
- gaia/eval/webapp/node_modules/object-inspect/test/undef.js +12 -0
- gaia/eval/webapp/node_modules/object-inspect/test/values.js +261 -0
- gaia/eval/webapp/node_modules/object-inspect/test-core-js.js +26 -0
- gaia/eval/webapp/node_modules/object-inspect/util.inspect.js +1 -0
- gaia/eval/webapp/node_modules/on-finished/HISTORY.md +98 -0
- gaia/eval/webapp/node_modules/on-finished/LICENSE +23 -0
- gaia/eval/webapp/node_modules/on-finished/README.md +162 -0
- gaia/eval/webapp/node_modules/on-finished/index.js +234 -0
- gaia/eval/webapp/node_modules/on-finished/package.json +39 -0
- gaia/eval/webapp/node_modules/parseurl/HISTORY.md +58 -0
- gaia/eval/webapp/node_modules/parseurl/LICENSE +24 -0
- gaia/eval/webapp/node_modules/parseurl/README.md +133 -0
- gaia/eval/webapp/node_modules/parseurl/index.js +158 -0
- gaia/eval/webapp/node_modules/parseurl/package.json +40 -0
- gaia/eval/webapp/node_modules/path/.npmignore +1 -0
- gaia/eval/webapp/node_modules/path/LICENSE +18 -0
- gaia/eval/webapp/node_modules/path/README.md +15 -0
- gaia/eval/webapp/node_modules/path/package.json +24 -0
- gaia/eval/webapp/node_modules/path/path.js +628 -0
- gaia/eval/webapp/node_modules/path-to-regexp/LICENSE +21 -0
- gaia/eval/webapp/node_modules/path-to-regexp/Readme.md +35 -0
- gaia/eval/webapp/node_modules/path-to-regexp/index.js +156 -0
- gaia/eval/webapp/node_modules/path-to-regexp/package.json +30 -0
- gaia/eval/webapp/node_modules/process/.eslintrc +21 -0
- gaia/eval/webapp/node_modules/process/LICENSE +22 -0
- gaia/eval/webapp/node_modules/process/README.md +26 -0
- gaia/eval/webapp/node_modules/process/browser.js +184 -0
- gaia/eval/webapp/node_modules/process/index.js +2 -0
- gaia/eval/webapp/node_modules/process/package.json +27 -0
- gaia/eval/webapp/node_modules/process/test.js +199 -0
- gaia/eval/webapp/node_modules/proxy-addr/HISTORY.md +161 -0
- gaia/eval/webapp/node_modules/proxy-addr/LICENSE +22 -0
- gaia/eval/webapp/node_modules/proxy-addr/README.md +139 -0
- gaia/eval/webapp/node_modules/proxy-addr/index.js +327 -0
- gaia/eval/webapp/node_modules/proxy-addr/package.json +47 -0
- gaia/eval/webapp/node_modules/qs/.editorconfig +46 -0
- gaia/eval/webapp/node_modules/qs/.eslintrc +38 -0
- gaia/eval/webapp/node_modules/qs/.github/FUNDING.yml +12 -0
- gaia/eval/webapp/node_modules/qs/.nycrc +13 -0
- gaia/eval/webapp/node_modules/qs/CHANGELOG.md +600 -0
- gaia/eval/webapp/node_modules/qs/LICENSE.md +29 -0
- gaia/eval/webapp/node_modules/qs/README.md +709 -0
- gaia/eval/webapp/node_modules/qs/dist/qs.js +90 -0
- gaia/eval/webapp/node_modules/qs/lib/formats.js +23 -0
- gaia/eval/webapp/node_modules/qs/lib/index.js +11 -0
- gaia/eval/webapp/node_modules/qs/lib/parse.js +296 -0
- gaia/eval/webapp/node_modules/qs/lib/stringify.js +351 -0
- gaia/eval/webapp/node_modules/qs/lib/utils.js +265 -0
- gaia/eval/webapp/node_modules/qs/package.json +91 -0
- gaia/eval/webapp/node_modules/qs/test/empty-keys-cases.js +267 -0
- gaia/eval/webapp/node_modules/qs/test/parse.js +1170 -0
- gaia/eval/webapp/node_modules/qs/test/stringify.js +1298 -0
- gaia/eval/webapp/node_modules/qs/test/utils.js +136 -0
- gaia/eval/webapp/node_modules/range-parser/HISTORY.md +56 -0
- gaia/eval/webapp/node_modules/range-parser/LICENSE +23 -0
- gaia/eval/webapp/node_modules/range-parser/README.md +84 -0
- gaia/eval/webapp/node_modules/range-parser/index.js +162 -0
- gaia/eval/webapp/node_modules/range-parser/package.json +44 -0
- gaia/eval/webapp/node_modules/raw-body/HISTORY.md +308 -0
- gaia/eval/webapp/node_modules/raw-body/LICENSE +22 -0
- gaia/eval/webapp/node_modules/raw-body/README.md +223 -0
- gaia/eval/webapp/node_modules/raw-body/SECURITY.md +24 -0
- gaia/eval/webapp/node_modules/raw-body/index.d.ts +87 -0
- gaia/eval/webapp/node_modules/raw-body/index.js +336 -0
- gaia/eval/webapp/node_modules/raw-body/package.json +49 -0
- gaia/eval/webapp/node_modules/safe-buffer/LICENSE +21 -0
- gaia/eval/webapp/node_modules/safe-buffer/README.md +584 -0
- gaia/eval/webapp/node_modules/safe-buffer/index.d.ts +187 -0
- gaia/eval/webapp/node_modules/safe-buffer/index.js +65 -0
- gaia/eval/webapp/node_modules/safe-buffer/package.json +51 -0
- gaia/eval/webapp/node_modules/safer-buffer/LICENSE +21 -0
- gaia/eval/webapp/node_modules/safer-buffer/Porting-Buffer.md +268 -0
- gaia/eval/webapp/node_modules/safer-buffer/Readme.md +156 -0
- gaia/eval/webapp/node_modules/safer-buffer/dangerous.js +58 -0
- gaia/eval/webapp/node_modules/safer-buffer/package.json +34 -0
- gaia/eval/webapp/node_modules/safer-buffer/safer.js +77 -0
- gaia/eval/webapp/node_modules/safer-buffer/tests.js +406 -0
- gaia/eval/webapp/node_modules/send/HISTORY.md +526 -0
- gaia/eval/webapp/node_modules/send/LICENSE +23 -0
- gaia/eval/webapp/node_modules/send/README.md +327 -0
- gaia/eval/webapp/node_modules/send/SECURITY.md +24 -0
- gaia/eval/webapp/node_modules/send/index.js +1142 -0
- gaia/eval/webapp/node_modules/send/node_modules/encodeurl/HISTORY.md +14 -0
- gaia/eval/webapp/node_modules/send/node_modules/encodeurl/LICENSE +22 -0
- gaia/eval/webapp/node_modules/send/node_modules/encodeurl/README.md +128 -0
- gaia/eval/webapp/node_modules/send/node_modules/encodeurl/index.js +60 -0
- gaia/eval/webapp/node_modules/send/node_modules/encodeurl/package.json +40 -0
- gaia/eval/webapp/node_modules/send/node_modules/ms/index.js +162 -0
- gaia/eval/webapp/node_modules/send/node_modules/ms/license.md +21 -0
- gaia/eval/webapp/node_modules/send/node_modules/ms/package.json +38 -0
- gaia/eval/webapp/node_modules/send/node_modules/ms/readme.md +59 -0
- gaia/eval/webapp/node_modules/send/package.json +62 -0
- gaia/eval/webapp/node_modules/serve-static/HISTORY.md +487 -0
- gaia/eval/webapp/node_modules/serve-static/LICENSE +25 -0
- gaia/eval/webapp/node_modules/serve-static/README.md +257 -0
- gaia/eval/webapp/node_modules/serve-static/index.js +209 -0
- gaia/eval/webapp/node_modules/serve-static/package.json +42 -0
- gaia/eval/webapp/node_modules/setprototypeof/LICENSE +13 -0
- gaia/eval/webapp/node_modules/setprototypeof/README.md +31 -0
- gaia/eval/webapp/node_modules/setprototypeof/index.d.ts +2 -0
- gaia/eval/webapp/node_modules/setprototypeof/index.js +17 -0
- gaia/eval/webapp/node_modules/setprototypeof/package.json +38 -0
- gaia/eval/webapp/node_modules/setprototypeof/test/index.js +24 -0
- gaia/eval/webapp/node_modules/side-channel/.editorconfig +9 -0
- gaia/eval/webapp/node_modules/side-channel/.eslintrc +12 -0
- gaia/eval/webapp/node_modules/side-channel/.github/FUNDING.yml +12 -0
- gaia/eval/webapp/node_modules/side-channel/.nycrc +13 -0
- gaia/eval/webapp/node_modules/side-channel/CHANGELOG.md +110 -0
- gaia/eval/webapp/node_modules/side-channel/LICENSE +21 -0
- gaia/eval/webapp/node_modules/side-channel/README.md +61 -0
- gaia/eval/webapp/node_modules/side-channel/index.d.ts +14 -0
- gaia/eval/webapp/node_modules/side-channel/index.js +43 -0
- gaia/eval/webapp/node_modules/side-channel/package.json +85 -0
- gaia/eval/webapp/node_modules/side-channel/test/index.js +104 -0
- gaia/eval/webapp/node_modules/side-channel/tsconfig.json +9 -0
- gaia/eval/webapp/node_modules/side-channel-list/.editorconfig +9 -0
- gaia/eval/webapp/node_modules/side-channel-list/.eslintrc +11 -0
- gaia/eval/webapp/node_modules/side-channel-list/.github/FUNDING.yml +12 -0
- gaia/eval/webapp/node_modules/side-channel-list/.nycrc +13 -0
- gaia/eval/webapp/node_modules/side-channel-list/CHANGELOG.md +15 -0
- gaia/eval/webapp/node_modules/side-channel-list/LICENSE +21 -0
- gaia/eval/webapp/node_modules/side-channel-list/README.md +62 -0
- gaia/eval/webapp/node_modules/side-channel-list/index.d.ts +13 -0
- gaia/eval/webapp/node_modules/side-channel-list/index.js +113 -0
- gaia/eval/webapp/node_modules/side-channel-list/list.d.ts +14 -0
- gaia/eval/webapp/node_modules/side-channel-list/package.json +77 -0
- gaia/eval/webapp/node_modules/side-channel-list/test/index.js +104 -0
- gaia/eval/webapp/node_modules/side-channel-list/tsconfig.json +9 -0
- gaia/eval/webapp/node_modules/side-channel-map/.editorconfig +9 -0
- gaia/eval/webapp/node_modules/side-channel-map/.eslintrc +11 -0
- gaia/eval/webapp/node_modules/side-channel-map/.github/FUNDING.yml +12 -0
- gaia/eval/webapp/node_modules/side-channel-map/.nycrc +13 -0
- gaia/eval/webapp/node_modules/side-channel-map/CHANGELOG.md +22 -0
- gaia/eval/webapp/node_modules/side-channel-map/LICENSE +21 -0
- gaia/eval/webapp/node_modules/side-channel-map/README.md +62 -0
- gaia/eval/webapp/node_modules/side-channel-map/index.d.ts +15 -0
- gaia/eval/webapp/node_modules/side-channel-map/index.js +68 -0
- gaia/eval/webapp/node_modules/side-channel-map/package.json +80 -0
- gaia/eval/webapp/node_modules/side-channel-map/test/index.js +114 -0
- gaia/eval/webapp/node_modules/side-channel-map/tsconfig.json +9 -0
- gaia/eval/webapp/node_modules/side-channel-weakmap/.editorconfig +9 -0
- gaia/eval/webapp/node_modules/side-channel-weakmap/.eslintrc +12 -0
- gaia/eval/webapp/node_modules/side-channel-weakmap/.github/FUNDING.yml +12 -0
- gaia/eval/webapp/node_modules/side-channel-weakmap/.nycrc +13 -0
- gaia/eval/webapp/node_modules/side-channel-weakmap/CHANGELOG.md +28 -0
- gaia/eval/webapp/node_modules/side-channel-weakmap/LICENSE +21 -0
- gaia/eval/webapp/node_modules/side-channel-weakmap/README.md +62 -0
- gaia/eval/webapp/node_modules/side-channel-weakmap/index.d.ts +15 -0
- gaia/eval/webapp/node_modules/side-channel-weakmap/index.js +84 -0
- gaia/eval/webapp/node_modules/side-channel-weakmap/package.json +87 -0
- gaia/eval/webapp/node_modules/side-channel-weakmap/test/index.js +114 -0
- gaia/eval/webapp/node_modules/side-channel-weakmap/tsconfig.json +9 -0
- gaia/eval/webapp/node_modules/statuses/HISTORY.md +82 -0
- gaia/eval/webapp/node_modules/statuses/LICENSE +23 -0
- gaia/eval/webapp/node_modules/statuses/README.md +136 -0
- gaia/eval/webapp/node_modules/statuses/codes.json +65 -0
- gaia/eval/webapp/node_modules/statuses/index.js +146 -0
- gaia/eval/webapp/node_modules/statuses/package.json +49 -0
- gaia/eval/webapp/node_modules/toidentifier/HISTORY.md +9 -0
- gaia/eval/webapp/node_modules/toidentifier/LICENSE +21 -0
- gaia/eval/webapp/node_modules/toidentifier/README.md +61 -0
- gaia/eval/webapp/node_modules/toidentifier/index.js +32 -0
- gaia/eval/webapp/node_modules/toidentifier/package.json +38 -0
- gaia/eval/webapp/node_modules/type-is/HISTORY.md +259 -0
- gaia/eval/webapp/node_modules/type-is/LICENSE +23 -0
- gaia/eval/webapp/node_modules/type-is/README.md +170 -0
- gaia/eval/webapp/node_modules/type-is/index.js +266 -0
- gaia/eval/webapp/node_modules/type-is/package.json +45 -0
- gaia/eval/webapp/node_modules/unpipe/HISTORY.md +4 -0
- gaia/eval/webapp/node_modules/unpipe/LICENSE +22 -0
- gaia/eval/webapp/node_modules/unpipe/README.md +43 -0
- gaia/eval/webapp/node_modules/unpipe/index.js +69 -0
- gaia/eval/webapp/node_modules/unpipe/package.json +27 -0
- gaia/eval/webapp/node_modules/util/LICENSE +18 -0
- gaia/eval/webapp/node_modules/util/README.md +15 -0
- gaia/eval/webapp/node_modules/util/node_modules/inherits/LICENSE +16 -0
- gaia/eval/webapp/node_modules/util/node_modules/inherits/README.md +42 -0
- gaia/eval/webapp/node_modules/util/node_modules/inherits/inherits.js +7 -0
- gaia/eval/webapp/node_modules/util/node_modules/inherits/inherits_browser.js +23 -0
- gaia/eval/webapp/node_modules/util/node_modules/inherits/package.json +29 -0
- gaia/eval/webapp/node_modules/util/package.json +35 -0
- gaia/eval/webapp/node_modules/util/support/isBuffer.js +3 -0
- gaia/eval/webapp/node_modules/util/support/isBufferBrowser.js +6 -0
- gaia/eval/webapp/node_modules/util/util.js +586 -0
- gaia/eval/webapp/node_modules/utils-merge/.npmignore +9 -0
- gaia/eval/webapp/node_modules/utils-merge/LICENSE +20 -0
- gaia/eval/webapp/node_modules/utils-merge/README.md +34 -0
- gaia/eval/webapp/node_modules/utils-merge/index.js +23 -0
- gaia/eval/webapp/node_modules/utils-merge/package.json +40 -0
- gaia/eval/webapp/node_modules/vary/HISTORY.md +39 -0
- gaia/eval/webapp/node_modules/vary/LICENSE +22 -0
- gaia/eval/webapp/node_modules/vary/README.md +101 -0
- gaia/eval/webapp/node_modules/vary/index.js +149 -0
- gaia/eval/webapp/node_modules/vary/package.json +43 -0
- gaia/eval/webapp/package-lock.json +875 -0
- gaia/eval/webapp/package.json +21 -0
- gaia/eval/webapp/public/app.js +3403 -0
- gaia/eval/webapp/public/index.html +88 -0
- gaia/eval/webapp/public/styles.css +3661 -0
- gaia/eval/webapp/server.js +416 -0
- gaia/eval/webapp/test-setup.js +73 -0
- gaia/llm/__init__.py +2 -0
- gaia/llm/lemonade_client.py +3083 -0
- gaia/llm/lemonade_manager.py +269 -0
- gaia/llm/llm_client.py +729 -0
- gaia/llm/vlm_client.py +307 -0
- gaia/logger.py +189 -0
- gaia/mcp/agent_mcp_server.py +245 -0
- gaia/mcp/blender_mcp_client.py +138 -0
- gaia/mcp/blender_mcp_server.py +648 -0
- gaia/mcp/context7_cache.py +332 -0
- gaia/mcp/external_services.py +518 -0
- gaia/mcp/mcp_bridge.py +550 -0
- gaia/mcp/servers/__init__.py +6 -0
- gaia/mcp/servers/docker_mcp.py +83 -0
- gaia/rag/__init__.py +10 -0
- gaia/rag/app.py +293 -0
- gaia/rag/demo.py +304 -0
- gaia/rag/pdf_utils.py +235 -0
- gaia/rag/sdk.py +2194 -0
- gaia/security.py +163 -0
- gaia/talk/app.py +289 -0
- gaia/talk/sdk.py +538 -0
- gaia/util.py +46 -0
- gaia/version.py +100 -0
|
@@ -0,0 +1,1457 @@
|
|
|
1
|
+
# Copyright(C) 2024-2025 Advanced Micro Devices, Inc. All rights reserved.
|
|
2
|
+
# SPDX-License-Identifier: MIT
|
|
3
|
+
|
|
4
|
+
import json
|
|
5
|
+
import threading
|
|
6
|
+
import time
|
|
7
|
+
from abc import ABC, abstractmethod
|
|
8
|
+
from typing import Any, Dict, List, Optional
|
|
9
|
+
|
|
10
|
+
# Import Rich library for pretty printing and syntax highlighting
|
|
11
|
+
try:
|
|
12
|
+
from rich import print as rprint
|
|
13
|
+
from rich.console import Console
|
|
14
|
+
from rich.live import Live
|
|
15
|
+
from rich.panel import Panel
|
|
16
|
+
from rich.spinner import Spinner
|
|
17
|
+
from rich.syntax import Syntax
|
|
18
|
+
from rich.table import Table
|
|
19
|
+
|
|
20
|
+
RICH_AVAILABLE = True
|
|
21
|
+
except ImportError:
|
|
22
|
+
RICH_AVAILABLE = False
|
|
23
|
+
print(
|
|
24
|
+
"Rich library not found. Install with 'pip install rich' for syntax highlighting."
|
|
25
|
+
)
|
|
26
|
+
|
|
27
|
+
# Display configuration constants
|
|
28
|
+
MAX_DISPLAY_LINE_LENGTH = 120
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
# ANSI Color Codes for fallback when Rich is not available
|
|
32
|
+
ANSI_RESET = "\033[0m"
|
|
33
|
+
ANSI_BOLD = "\033[1m"
|
|
34
|
+
ANSI_DIM = "\033[90m" # Dark Gray
|
|
35
|
+
ANSI_RED = "\033[91m"
|
|
36
|
+
ANSI_GREEN = "\033[92m"
|
|
37
|
+
ANSI_YELLOW = "\033[93m"
|
|
38
|
+
ANSI_BLUE = "\033[94m"
|
|
39
|
+
ANSI_MAGENTA = "\033[95m"
|
|
40
|
+
ANSI_CYAN = "\033[96m"
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
class OutputHandler(ABC):
|
|
44
|
+
"""
|
|
45
|
+
Abstract base class for handling agent output.
|
|
46
|
+
|
|
47
|
+
Defines the minimal interface that agents use to report their progress.
|
|
48
|
+
Each implementation handles the output differently:
|
|
49
|
+
- AgentConsole: Rich console output for CLI
|
|
50
|
+
- SilentConsole: Suppressed output for testing
|
|
51
|
+
- SSEOutputHandler: Server-Sent Events for API streaming
|
|
52
|
+
|
|
53
|
+
This interface focuses on WHAT agents need to report, not HOW
|
|
54
|
+
each handler chooses to display it.
|
|
55
|
+
"""
|
|
56
|
+
|
|
57
|
+
# === Core Progress/State Methods (Required) ===
|
|
58
|
+
|
|
59
|
+
@abstractmethod
|
|
60
|
+
def print_processing_start(self, query: str, max_steps: int):
|
|
61
|
+
"""Print processing start message."""
|
|
62
|
+
...
|
|
63
|
+
|
|
64
|
+
@abstractmethod
|
|
65
|
+
def print_step_header(self, step_num: int, step_limit: int):
|
|
66
|
+
"""Print step header."""
|
|
67
|
+
...
|
|
68
|
+
|
|
69
|
+
@abstractmethod
|
|
70
|
+
def print_state_info(self, state_message: str):
|
|
71
|
+
"""Print current execution state."""
|
|
72
|
+
...
|
|
73
|
+
|
|
74
|
+
@abstractmethod
|
|
75
|
+
def print_thought(self, thought: str):
|
|
76
|
+
"""Print agent's reasoning/thought."""
|
|
77
|
+
...
|
|
78
|
+
|
|
79
|
+
@abstractmethod
|
|
80
|
+
def print_goal(self, goal: str):
|
|
81
|
+
"""Print agent's current goal."""
|
|
82
|
+
...
|
|
83
|
+
|
|
84
|
+
@abstractmethod
|
|
85
|
+
def print_plan(self, plan: List[Any], current_step: int = None):
|
|
86
|
+
"""Print agent's plan with optional current step highlight."""
|
|
87
|
+
...
|
|
88
|
+
|
|
89
|
+
# === Tool Execution Methods (Required) ===
|
|
90
|
+
|
|
91
|
+
@abstractmethod
|
|
92
|
+
def print_tool_usage(self, tool_name: str):
|
|
93
|
+
"""Print tool being called."""
|
|
94
|
+
...
|
|
95
|
+
|
|
96
|
+
@abstractmethod
|
|
97
|
+
def print_tool_complete(self):
|
|
98
|
+
"""Print tool completion."""
|
|
99
|
+
...
|
|
100
|
+
|
|
101
|
+
@abstractmethod
|
|
102
|
+
def pretty_print_json(self, data: Dict[str, Any], title: str = None):
|
|
103
|
+
"""Print JSON data (tool args/results)."""
|
|
104
|
+
...
|
|
105
|
+
|
|
106
|
+
# === Status Messages (Required) ===
|
|
107
|
+
|
|
108
|
+
@abstractmethod
|
|
109
|
+
def print_error(self, error_message: str):
|
|
110
|
+
"""Print error message."""
|
|
111
|
+
...
|
|
112
|
+
|
|
113
|
+
@abstractmethod
|
|
114
|
+
def print_warning(self, warning_message: str):
|
|
115
|
+
"""Print warning message."""
|
|
116
|
+
...
|
|
117
|
+
|
|
118
|
+
@abstractmethod
|
|
119
|
+
def print_info(self, message: str):
|
|
120
|
+
"""Print informational message."""
|
|
121
|
+
...
|
|
122
|
+
|
|
123
|
+
# === Progress Indicators (Required) ===
|
|
124
|
+
|
|
125
|
+
@abstractmethod
|
|
126
|
+
def start_progress(self, message: str):
|
|
127
|
+
"""Start progress indicator."""
|
|
128
|
+
...
|
|
129
|
+
|
|
130
|
+
@abstractmethod
|
|
131
|
+
def stop_progress(self):
|
|
132
|
+
"""Stop progress indicator."""
|
|
133
|
+
...
|
|
134
|
+
|
|
135
|
+
# === Completion Methods (Required) ===
|
|
136
|
+
|
|
137
|
+
@abstractmethod
|
|
138
|
+
def print_final_answer(self, answer: str):
|
|
139
|
+
"""Print final answer/result."""
|
|
140
|
+
...
|
|
141
|
+
|
|
142
|
+
@abstractmethod
|
|
143
|
+
def print_repeated_tool_warning(self):
|
|
144
|
+
"""Print warning about repeated tool calls (loop detection)."""
|
|
145
|
+
...
|
|
146
|
+
|
|
147
|
+
@abstractmethod
|
|
148
|
+
def print_completion(self, steps_taken: int, steps_limit: int):
|
|
149
|
+
"""Print completion summary."""
|
|
150
|
+
...
|
|
151
|
+
|
|
152
|
+
@abstractmethod
|
|
153
|
+
def print_step_paused(self, description: str):
|
|
154
|
+
"""Print step paused message."""
|
|
155
|
+
...
|
|
156
|
+
|
|
157
|
+
@abstractmethod
|
|
158
|
+
def print_command_executing(self, command: str):
|
|
159
|
+
"""Print command executing message."""
|
|
160
|
+
...
|
|
161
|
+
|
|
162
|
+
@abstractmethod
|
|
163
|
+
def print_agent_selected(self, agent_name: str, language: str, project_type: str):
|
|
164
|
+
"""Print agent selected message."""
|
|
165
|
+
...
|
|
166
|
+
|
|
167
|
+
# === Optional Methods (with default no-op implementations) ===
|
|
168
|
+
|
|
169
|
+
def print_prompt(
|
|
170
|
+
self, prompt: str, title: str = "Prompt"
|
|
171
|
+
): # pylint: disable=unused-argument
|
|
172
|
+
"""Print prompt (for debugging). Optional - default no-op."""
|
|
173
|
+
...
|
|
174
|
+
|
|
175
|
+
def print_response(
|
|
176
|
+
self, response: str, title: str = "Response"
|
|
177
|
+
): # pylint: disable=unused-argument
|
|
178
|
+
"""Print response (for debugging). Optional - default no-op."""
|
|
179
|
+
...
|
|
180
|
+
|
|
181
|
+
def print_streaming_text(
|
|
182
|
+
self, text_chunk: str, end_of_stream: bool = False
|
|
183
|
+
): # pylint: disable=unused-argument
|
|
184
|
+
"""Print streaming text. Optional - default no-op."""
|
|
185
|
+
...
|
|
186
|
+
|
|
187
|
+
def display_stats(self, stats: Dict[str, Any]): # pylint: disable=unused-argument
|
|
188
|
+
"""Display performance statistics. Optional - default no-op."""
|
|
189
|
+
...
|
|
190
|
+
|
|
191
|
+
def print_header(self, text: str): # pylint: disable=unused-argument
|
|
192
|
+
"""Print header. Optional - default no-op."""
|
|
193
|
+
...
|
|
194
|
+
|
|
195
|
+
def print_separator(self, length: int = 50): # pylint: disable=unused-argument
|
|
196
|
+
"""Print separator. Optional - default no-op."""
|
|
197
|
+
...
|
|
198
|
+
|
|
199
|
+
def print_tool_info(
|
|
200
|
+
self, name: str, params_str: str, description: str
|
|
201
|
+
): # pylint: disable=unused-argument
|
|
202
|
+
"""Print tool info. Optional - default no-op."""
|
|
203
|
+
...
|
|
204
|
+
|
|
205
|
+
|
|
206
|
+
class ProgressIndicator:
|
|
207
|
+
"""A simple progress indicator that shows a spinner or dots animation."""
|
|
208
|
+
|
|
209
|
+
def __init__(self, message="Processing"):
|
|
210
|
+
"""Initialize the progress indicator.
|
|
211
|
+
|
|
212
|
+
Args:
|
|
213
|
+
message: The message to display before the animation
|
|
214
|
+
"""
|
|
215
|
+
self.message = message
|
|
216
|
+
self.is_running = False
|
|
217
|
+
self.thread = None
|
|
218
|
+
self.spinner_chars = ["ā ", "ā ", "ā ¹", "ā ø", "ā ¼", "ā “", "ā ¦", "ā §", "ā ", "ā "]
|
|
219
|
+
self.dot_chars = [".", "..", "..."]
|
|
220
|
+
self.spinner_idx = 0
|
|
221
|
+
self.dot_idx = 0
|
|
222
|
+
self.rich_spinner = None
|
|
223
|
+
if RICH_AVAILABLE:
|
|
224
|
+
self.rich_spinner = Spinner("dots", text=message)
|
|
225
|
+
self.live = None
|
|
226
|
+
|
|
227
|
+
def _animate(self):
|
|
228
|
+
"""Animation loop that runs in a separate thread."""
|
|
229
|
+
while self.is_running:
|
|
230
|
+
if RICH_AVAILABLE:
|
|
231
|
+
# Rich handles the animation internally
|
|
232
|
+
time.sleep(0.1)
|
|
233
|
+
else:
|
|
234
|
+
# Simple terminal-based animation
|
|
235
|
+
self.dot_idx = (self.dot_idx + 1) % len(self.dot_chars)
|
|
236
|
+
self.spinner_idx = (self.spinner_idx + 1) % len(self.spinner_chars)
|
|
237
|
+
|
|
238
|
+
# Determine if we should use Unicode spinner or simple dots
|
|
239
|
+
try:
|
|
240
|
+
# Try to print a Unicode character to see if the terminal supports it
|
|
241
|
+
print(self.spinner_chars[0], end="", flush=True)
|
|
242
|
+
print(
|
|
243
|
+
"\b", end="", flush=True
|
|
244
|
+
) # Backspace to remove the test character
|
|
245
|
+
|
|
246
|
+
# If we got here, Unicode is supported
|
|
247
|
+
print(
|
|
248
|
+
f"\r{self.message} {self.spinner_chars[self.spinner_idx]}",
|
|
249
|
+
end="",
|
|
250
|
+
flush=True,
|
|
251
|
+
)
|
|
252
|
+
except (UnicodeError, OSError):
|
|
253
|
+
# Fallback to simple dots
|
|
254
|
+
print(
|
|
255
|
+
f"\r{self.message}{self.dot_chars[self.dot_idx]}",
|
|
256
|
+
end="",
|
|
257
|
+
flush=True,
|
|
258
|
+
)
|
|
259
|
+
|
|
260
|
+
time.sleep(0.1)
|
|
261
|
+
|
|
262
|
+
def start(self, message=None):
|
|
263
|
+
"""Start the progress indicator.
|
|
264
|
+
|
|
265
|
+
Args:
|
|
266
|
+
message: Optional new message to display
|
|
267
|
+
"""
|
|
268
|
+
if message:
|
|
269
|
+
self.message = message
|
|
270
|
+
|
|
271
|
+
if self.is_running:
|
|
272
|
+
return
|
|
273
|
+
|
|
274
|
+
self.is_running = True
|
|
275
|
+
|
|
276
|
+
if RICH_AVAILABLE:
|
|
277
|
+
if self.rich_spinner:
|
|
278
|
+
self.rich_spinner.text = self.message
|
|
279
|
+
# Use transient=True to auto-clear when done
|
|
280
|
+
self.live = Live(
|
|
281
|
+
self.rich_spinner, refresh_per_second=10, transient=True
|
|
282
|
+
)
|
|
283
|
+
self.live.start()
|
|
284
|
+
else:
|
|
285
|
+
self.thread = threading.Thread(target=self._animate)
|
|
286
|
+
self.thread.daemon = True
|
|
287
|
+
self.thread.start()
|
|
288
|
+
|
|
289
|
+
def stop(self):
|
|
290
|
+
"""Stop the progress indicator."""
|
|
291
|
+
if not self.is_running:
|
|
292
|
+
return
|
|
293
|
+
|
|
294
|
+
self.is_running = False
|
|
295
|
+
|
|
296
|
+
if RICH_AVAILABLE and self.live:
|
|
297
|
+
self.live.stop()
|
|
298
|
+
elif self.thread:
|
|
299
|
+
self.thread.join(timeout=0.2)
|
|
300
|
+
# Clear the animation line
|
|
301
|
+
print("\r" + " " * (len(self.message) + 5) + "\r", end="", flush=True)
|
|
302
|
+
|
|
303
|
+
|
|
304
|
+
class AgentConsole(OutputHandler):
|
|
305
|
+
"""
|
|
306
|
+
A class to handle all display-related functionality for the agent.
|
|
307
|
+
Provides rich text formatting and progress indicators when available.
|
|
308
|
+
Implements OutputHandler for CLI-based output.
|
|
309
|
+
"""
|
|
310
|
+
|
|
311
|
+
def __init__(self):
|
|
312
|
+
"""Initialize the AgentConsole with appropriate display capabilities."""
|
|
313
|
+
self.rich_available = RICH_AVAILABLE
|
|
314
|
+
self.console = Console() if self.rich_available else None
|
|
315
|
+
self.progress = ProgressIndicator()
|
|
316
|
+
self.rprint = rprint
|
|
317
|
+
self.Panel = Panel
|
|
318
|
+
self.streaming_buffer = "" # Buffer for accumulating streaming text
|
|
319
|
+
self.file_preview_live: Optional[Live] = None
|
|
320
|
+
self.file_preview_content = ""
|
|
321
|
+
self.file_preview_filename = ""
|
|
322
|
+
self.file_preview_max_lines = 15
|
|
323
|
+
self._paused_preview = False # Track if preview was paused for progress
|
|
324
|
+
self._last_preview_update_time = 0 # Throttle preview updates
|
|
325
|
+
self._preview_update_interval = 0.25 # Minimum seconds between updates
|
|
326
|
+
|
|
327
|
+
def print(self, *args, **kwargs):
|
|
328
|
+
"""
|
|
329
|
+
Print method that delegates to Rich Console or standard print.
|
|
330
|
+
|
|
331
|
+
This allows code to call console.print() directly on AgentConsole instances.
|
|
332
|
+
|
|
333
|
+
Args:
|
|
334
|
+
*args: Arguments to print
|
|
335
|
+
**kwargs: Keyword arguments (style, etc.) for Rich Console
|
|
336
|
+
"""
|
|
337
|
+
if self.rich_available and self.console:
|
|
338
|
+
self.console.print(*args, **kwargs)
|
|
339
|
+
else:
|
|
340
|
+
# Fallback to standard print
|
|
341
|
+
print(*args, **kwargs)
|
|
342
|
+
|
|
343
|
+
# Implementation of OutputHandler abstract methods
|
|
344
|
+
|
|
345
|
+
def pretty_print_json(self, data: Dict[str, Any], title: str = None) -> None:
|
|
346
|
+
"""
|
|
347
|
+
Pretty print JSON data with syntax highlighting if Rich is available.
|
|
348
|
+
If data contains a "command" field, shows it prominently.
|
|
349
|
+
|
|
350
|
+
Args:
|
|
351
|
+
data: Dictionary data to print
|
|
352
|
+
title: Optional title for the panel
|
|
353
|
+
"""
|
|
354
|
+
if self.rich_available:
|
|
355
|
+
# Check if this is a command execution result
|
|
356
|
+
if "command" in data and "stdout" in data:
|
|
357
|
+
# Show command execution in a special format
|
|
358
|
+
command = data.get("command", "")
|
|
359
|
+
stdout = data.get("stdout", "")
|
|
360
|
+
stderr = data.get("stderr", "")
|
|
361
|
+
return_code = data.get("return_code", 0)
|
|
362
|
+
|
|
363
|
+
# Build preview text
|
|
364
|
+
preview = f"$ {command}\n\n"
|
|
365
|
+
if stdout:
|
|
366
|
+
preview += stdout[:500] # First 500 chars
|
|
367
|
+
if len(stdout) > 500:
|
|
368
|
+
preview += "\n... (output truncated)"
|
|
369
|
+
if stderr:
|
|
370
|
+
preview += f"\n\nSTDERR:\n{stderr[:200]}"
|
|
371
|
+
if return_code != 0:
|
|
372
|
+
preview += f"\n\n[Return code: {return_code}]"
|
|
373
|
+
|
|
374
|
+
self.console.print(
|
|
375
|
+
Panel(
|
|
376
|
+
preview,
|
|
377
|
+
title=title or "Command Output",
|
|
378
|
+
border_style="blue",
|
|
379
|
+
expand=False,
|
|
380
|
+
)
|
|
381
|
+
)
|
|
382
|
+
else:
|
|
383
|
+
# Regular JSON output
|
|
384
|
+
# Convert to formatted JSON string
|
|
385
|
+
json_str = json.dumps(data, indent=2)
|
|
386
|
+
# Create a syntax object with JSON highlighting
|
|
387
|
+
syntax = Syntax(json_str, "json", theme="monokai", line_numbers=False)
|
|
388
|
+
# Create a panel with a title if provided
|
|
389
|
+
if title:
|
|
390
|
+
self.console.print(Panel(syntax, title=title, border_style="blue"))
|
|
391
|
+
else:
|
|
392
|
+
self.console.print(syntax)
|
|
393
|
+
else:
|
|
394
|
+
# Fallback to standard pretty printing without highlighting
|
|
395
|
+
if title:
|
|
396
|
+
print(f"\n--- {title} ---")
|
|
397
|
+
# Check if this is a command execution
|
|
398
|
+
if "command" in data and "stdout" in data:
|
|
399
|
+
print(f"\n$ {data.get('command', '')}")
|
|
400
|
+
stdout = data.get("stdout", "")
|
|
401
|
+
if stdout:
|
|
402
|
+
print(stdout[:500])
|
|
403
|
+
if len(stdout) > 500:
|
|
404
|
+
print("... (output truncated)")
|
|
405
|
+
else:
|
|
406
|
+
print(json.dumps(data, indent=2))
|
|
407
|
+
|
|
408
|
+
def print_header(self, text: str) -> None:
|
|
409
|
+
"""
|
|
410
|
+
Print a header with appropriate styling.
|
|
411
|
+
|
|
412
|
+
Args:
|
|
413
|
+
text: The header text to display
|
|
414
|
+
"""
|
|
415
|
+
if self.rich_available:
|
|
416
|
+
self.console.print(f"\n[bold blue]{text}[/bold blue]")
|
|
417
|
+
else:
|
|
418
|
+
print(f"\n{text}")
|
|
419
|
+
|
|
420
|
+
def print_step_paused(self, description: str) -> None:
|
|
421
|
+
"""
|
|
422
|
+
Print step paused message.
|
|
423
|
+
|
|
424
|
+
Args:
|
|
425
|
+
description: Description of the step being paused after
|
|
426
|
+
"""
|
|
427
|
+
if self.rich_available:
|
|
428
|
+
self.console.print(
|
|
429
|
+
f"\n[bold yellow]āøļø Paused after step:[/bold yellow] {description}"
|
|
430
|
+
)
|
|
431
|
+
self.console.print("Press Enter to continue, or 'n'/'q' to stop...")
|
|
432
|
+
else:
|
|
433
|
+
print(f"\nāøļø Paused after step: {description}")
|
|
434
|
+
print("Press Enter to continue, or 'n'/'q' to stop...")
|
|
435
|
+
|
|
436
|
+
def print_processing_start(self, query: str, max_steps: int) -> None:
|
|
437
|
+
"""
|
|
438
|
+
Print the initial processing message with max steps info.
|
|
439
|
+
|
|
440
|
+
Args:
|
|
441
|
+
query: The user query being processed
|
|
442
|
+
max_steps: Maximum number of steps allowed
|
|
443
|
+
"""
|
|
444
|
+
if self.rich_available:
|
|
445
|
+
self.console.print(f"\n[bold blue]š¤ Processing:[/bold blue] '{query}'")
|
|
446
|
+
self.console.print("=" * 50)
|
|
447
|
+
self.console.print(f"[dim]Max steps: {max_steps}[/dim]\n")
|
|
448
|
+
else:
|
|
449
|
+
print(f"\nš¤ Processing: '{query}'")
|
|
450
|
+
print("=" * 50)
|
|
451
|
+
print(f"Max steps: {max_steps}\n")
|
|
452
|
+
|
|
453
|
+
def print_separator(self, length: int = 50) -> None:
|
|
454
|
+
"""
|
|
455
|
+
Print a separator line.
|
|
456
|
+
|
|
457
|
+
Args:
|
|
458
|
+
length: Length of the separator line
|
|
459
|
+
"""
|
|
460
|
+
if self.rich_available:
|
|
461
|
+
self.console.print("=" * length, style="dim")
|
|
462
|
+
else:
|
|
463
|
+
print("=" * length)
|
|
464
|
+
|
|
465
|
+
def print_step_header(self, step_num: int, step_limit: int) -> None:
|
|
466
|
+
"""
|
|
467
|
+
Print a step header.
|
|
468
|
+
|
|
469
|
+
Args:
|
|
470
|
+
step_num: Current step number
|
|
471
|
+
step_limit: Maximum number of steps (unused, kept for compatibility)
|
|
472
|
+
"""
|
|
473
|
+
_ = step_limit # Mark as intentionally unused
|
|
474
|
+
if self.rich_available:
|
|
475
|
+
self.console.print(
|
|
476
|
+
f"\n[bold cyan]š Step {step_num}:[/bold cyan] Thinking...",
|
|
477
|
+
highlight=False,
|
|
478
|
+
)
|
|
479
|
+
else:
|
|
480
|
+
print(f"\nš Step {step_num}: Thinking...")
|
|
481
|
+
|
|
482
|
+
def print_thought(self, thought: str) -> None:
|
|
483
|
+
"""
|
|
484
|
+
Print the agent's thought with appropriate styling.
|
|
485
|
+
|
|
486
|
+
Args:
|
|
487
|
+
thought: The thought to display
|
|
488
|
+
"""
|
|
489
|
+
if self.rich_available:
|
|
490
|
+
self.console.print(f"[bold green]š§ Thought:[/bold green] {thought}")
|
|
491
|
+
else:
|
|
492
|
+
print(f"š§ Thought: {thought}")
|
|
493
|
+
|
|
494
|
+
def print_goal(self, goal: str) -> None:
|
|
495
|
+
"""
|
|
496
|
+
Print the agent's goal with appropriate styling.
|
|
497
|
+
|
|
498
|
+
Args:
|
|
499
|
+
goal: The goal to display
|
|
500
|
+
"""
|
|
501
|
+
if self.rich_available:
|
|
502
|
+
self.console.print(f"[bold yellow]šÆ Goal:[/bold yellow] {goal}")
|
|
503
|
+
else:
|
|
504
|
+
print(f"šÆ Goal: {goal}")
|
|
505
|
+
|
|
506
|
+
def print_plan(self, plan: List[Any], current_step: int = None) -> None:
|
|
507
|
+
"""
|
|
508
|
+
Print the agent's plan with appropriate styling.
|
|
509
|
+
|
|
510
|
+
Args:
|
|
511
|
+
plan: List of plan steps
|
|
512
|
+
current_step: Optional index of the current step being executed (0-based)
|
|
513
|
+
"""
|
|
514
|
+
if self.rich_available:
|
|
515
|
+
self.console.print("\n[bold magenta]š Plan:[/bold magenta]")
|
|
516
|
+
for i, step in enumerate(plan):
|
|
517
|
+
step_text = step
|
|
518
|
+
# Convert dict steps to string representation if needed
|
|
519
|
+
if isinstance(step, dict):
|
|
520
|
+
if "tool" in step and "tool_args" in step:
|
|
521
|
+
args_str = json.dumps(step["tool_args"], sort_keys=True)
|
|
522
|
+
step_text = f"Use tool '{step['tool']}' with args: {args_str}"
|
|
523
|
+
else:
|
|
524
|
+
step_text = json.dumps(step)
|
|
525
|
+
|
|
526
|
+
# Highlight the current step being executed
|
|
527
|
+
if current_step is not None and i == current_step:
|
|
528
|
+
self.console.print(
|
|
529
|
+
f" [dim]{i+1}.[/dim] [bold green]āŗ[/bold green] [bold yellow]{step_text}[/bold yellow] [bold green]ā[/bold green] [cyan](current step)[/cyan]"
|
|
530
|
+
)
|
|
531
|
+
else:
|
|
532
|
+
self.console.print(f" [dim]{i+1}.[/dim] {step_text}")
|
|
533
|
+
# Add an extra newline for better readability
|
|
534
|
+
self.console.print("")
|
|
535
|
+
else:
|
|
536
|
+
print("\nš Plan:")
|
|
537
|
+
for i, step in enumerate(plan):
|
|
538
|
+
step_text = step
|
|
539
|
+
# Convert dict steps to string representation if needed
|
|
540
|
+
if isinstance(step, dict):
|
|
541
|
+
if "tool" in step and "tool_args" in step:
|
|
542
|
+
args_str = json.dumps(step["tool_args"], sort_keys=True)
|
|
543
|
+
step_text = f"Use tool '{step['tool']}' with args: {args_str}"
|
|
544
|
+
else:
|
|
545
|
+
step_text = json.dumps(step)
|
|
546
|
+
|
|
547
|
+
# Highlight the current step being executed
|
|
548
|
+
if current_step is not None and i == current_step:
|
|
549
|
+
print(f" {i+1}. āŗ {step_text} ā (current step)")
|
|
550
|
+
else:
|
|
551
|
+
print(f" {i+1}. {step_text}")
|
|
552
|
+
|
|
553
|
+
def print_plan_progress(
|
|
554
|
+
self, current_step: int, total_steps: int, completed_steps: int = None
|
|
555
|
+
):
|
|
556
|
+
"""
|
|
557
|
+
Print progress in plan execution
|
|
558
|
+
|
|
559
|
+
Args:
|
|
560
|
+
current_step: Current step being executed (1-based)
|
|
561
|
+
total_steps: Total number of steps in the plan
|
|
562
|
+
completed_steps: Optional number of already completed steps
|
|
563
|
+
"""
|
|
564
|
+
if completed_steps is None:
|
|
565
|
+
completed_steps = current_step - 1
|
|
566
|
+
|
|
567
|
+
progress_str = f"[Step {current_step}/{total_steps}]"
|
|
568
|
+
progress_bar = ""
|
|
569
|
+
|
|
570
|
+
# Create a simple progress bar
|
|
571
|
+
if total_steps > 0:
|
|
572
|
+
bar_width = 20
|
|
573
|
+
completed_chars = int((completed_steps / total_steps) * bar_width)
|
|
574
|
+
current_char = 1 if current_step <= total_steps else 0
|
|
575
|
+
remaining_chars = bar_width - completed_chars - current_char
|
|
576
|
+
|
|
577
|
+
progress_bar = (
|
|
578
|
+
"ā" * completed_chars + "ā¶" * current_char + "ā" * remaining_chars
|
|
579
|
+
)
|
|
580
|
+
|
|
581
|
+
if self.rich_available:
|
|
582
|
+
self.rprint(f"[cyan]{progress_str}[/cyan] {progress_bar}")
|
|
583
|
+
else:
|
|
584
|
+
print(f"{progress_str} {progress_bar}")
|
|
585
|
+
|
|
586
|
+
def print_checklist(self, items: List[Any], current_idx: int) -> None:
|
|
587
|
+
"""Print the checklist with current item highlighted.
|
|
588
|
+
|
|
589
|
+
Args:
|
|
590
|
+
items: List of checklist items (must have .description attribute)
|
|
591
|
+
current_idx: Index of the item currently being executed (0-based)
|
|
592
|
+
"""
|
|
593
|
+
if self.rich_available:
|
|
594
|
+
self.console.print("\n[bold magenta]š EXECUTION PLAN[/bold magenta]")
|
|
595
|
+
self.console.print("=" * 60, style="dim")
|
|
596
|
+
|
|
597
|
+
for i, item in enumerate(items):
|
|
598
|
+
desc = getattr(item, "description", str(item))
|
|
599
|
+
|
|
600
|
+
if i < current_idx:
|
|
601
|
+
# Completed
|
|
602
|
+
self.console.print(f" [green]ā {desc}[/green]")
|
|
603
|
+
elif i == current_idx:
|
|
604
|
+
# Current
|
|
605
|
+
self.console.print(f" [bold blue]ā {desc}[/bold blue]")
|
|
606
|
+
else:
|
|
607
|
+
# Pending
|
|
608
|
+
self.console.print(f" [dim]ā {desc}[/dim]")
|
|
609
|
+
|
|
610
|
+
self.console.print("=" * 60, style="dim")
|
|
611
|
+
self.console.print("")
|
|
612
|
+
else:
|
|
613
|
+
print("\n" + "=" * 60)
|
|
614
|
+
print(f"{ANSI_BOLD}š EXECUTION PLAN{ANSI_RESET}")
|
|
615
|
+
print("=" * 60)
|
|
616
|
+
|
|
617
|
+
for i, item in enumerate(items):
|
|
618
|
+
desc = getattr(item, "description", str(item))
|
|
619
|
+
if i < current_idx:
|
|
620
|
+
print(f" {ANSI_GREEN}ā {desc}{ANSI_RESET}")
|
|
621
|
+
elif i == current_idx:
|
|
622
|
+
print(f" {ANSI_BLUE}{ANSI_BOLD}ā {desc}{ANSI_RESET}")
|
|
623
|
+
else:
|
|
624
|
+
print(f" {ANSI_DIM}ā {desc}{ANSI_RESET}")
|
|
625
|
+
|
|
626
|
+
print("=" * 60 + "\n")
|
|
627
|
+
|
|
628
|
+
def print_checklist_reasoning(self, reasoning: str) -> None:
|
|
629
|
+
"""
|
|
630
|
+
Print checklist reasoning.
|
|
631
|
+
|
|
632
|
+
Args:
|
|
633
|
+
reasoning: The reasoning text to display
|
|
634
|
+
"""
|
|
635
|
+
if self.rich_available:
|
|
636
|
+
self.console.print("\n[bold]š CHECKLIST REASONING[/bold]")
|
|
637
|
+
self.console.print("=" * 60, style="dim")
|
|
638
|
+
self.console.print(f"{reasoning}")
|
|
639
|
+
self.console.print("=" * 60, style="dim")
|
|
640
|
+
self.console.print("")
|
|
641
|
+
else:
|
|
642
|
+
print("\n" + "=" * 60)
|
|
643
|
+
print(f"{ANSI_BOLD}š CHECKLIST REASONING{ANSI_RESET}")
|
|
644
|
+
print("=" * 60)
|
|
645
|
+
print(f"{reasoning}")
|
|
646
|
+
print("=" * 60 + "\n")
|
|
647
|
+
|
|
648
|
+
def print_command_executing(self, command: str) -> None:
|
|
649
|
+
"""
|
|
650
|
+
Print command executing message.
|
|
651
|
+
|
|
652
|
+
Args:
|
|
653
|
+
command: The command being executed
|
|
654
|
+
"""
|
|
655
|
+
if self.rich_available:
|
|
656
|
+
self.console.print(f"\n[bold]Executing Command:[/bold] {command}")
|
|
657
|
+
else:
|
|
658
|
+
print(f"\nExecuting Command: {command}")
|
|
659
|
+
|
|
660
|
+
def print_agent_selected(
|
|
661
|
+
self, agent_name: str, language: str, project_type: str
|
|
662
|
+
) -> None:
|
|
663
|
+
"""
|
|
664
|
+
Print agent selected message.
|
|
665
|
+
|
|
666
|
+
Args:
|
|
667
|
+
agent_name: The name of the selected agent
|
|
668
|
+
language: The detected programming language
|
|
669
|
+
project_type: The detected project type
|
|
670
|
+
"""
|
|
671
|
+
if self.rich_available:
|
|
672
|
+
self.console.print(
|
|
673
|
+
f"[bold]š¤ Agent Selected:[/bold] [blue]{agent_name}[/blue] (language={language}, project_type={project_type})\n"
|
|
674
|
+
)
|
|
675
|
+
else:
|
|
676
|
+
print(
|
|
677
|
+
f"{ANSI_BOLD}š¤ Agent Selected:{ANSI_RESET} {ANSI_BLUE}{agent_name}{ANSI_RESET} (language={language}, project_type={project_type})\n"
|
|
678
|
+
)
|
|
679
|
+
|
|
680
|
+
def print_tool_usage(self, tool_name: str) -> None:
|
|
681
|
+
"""
|
|
682
|
+
Print tool usage information with user-friendly descriptions.
|
|
683
|
+
|
|
684
|
+
Args:
|
|
685
|
+
tool_name: Name of the tool being used
|
|
686
|
+
"""
|
|
687
|
+
# Map tool names to user-friendly action descriptions
|
|
688
|
+
tool_descriptions = {
|
|
689
|
+
# RAG Tools
|
|
690
|
+
"list_indexed_documents": "š Checking which documents are currently indexed",
|
|
691
|
+
"query_documents": "š Searching through indexed documents for relevant information",
|
|
692
|
+
"query_specific_file": "š Searching within a specific document",
|
|
693
|
+
"search_indexed_chunks": "š Performing exact text search in indexed content",
|
|
694
|
+
"index_document": "š„ Adding document to the knowledge base",
|
|
695
|
+
"index_directory": "š Indexing all documents in a directory",
|
|
696
|
+
"dump_document": "š Exporting document content for analysis",
|
|
697
|
+
"summarize_document": "š Creating a summary of the document",
|
|
698
|
+
"rag_status": "ā¹ļø Retrieving RAG system status",
|
|
699
|
+
# File System Tools
|
|
700
|
+
"search_file": "š Searching for files on your system",
|
|
701
|
+
"search_directory": "š Looking for directories on your system",
|
|
702
|
+
"search_file_content": "š Searching for content within files",
|
|
703
|
+
"read_file": "š Reading file contents",
|
|
704
|
+
"write_file": "āļø Writing content to a file",
|
|
705
|
+
"add_watch_directory": "šļø Starting to monitor a directory for changes",
|
|
706
|
+
# Shell Tools
|
|
707
|
+
"run_shell_command": "š» Executing shell command",
|
|
708
|
+
# Default for unknown tools
|
|
709
|
+
"default": "š§ Executing operation",
|
|
710
|
+
}
|
|
711
|
+
|
|
712
|
+
# Get the description or use the tool name if not found
|
|
713
|
+
action_desc = tool_descriptions.get(tool_name, tool_descriptions["default"])
|
|
714
|
+
|
|
715
|
+
if self.rich_available:
|
|
716
|
+
self.console.print(f"\n[bold blue]{action_desc}[/bold blue]")
|
|
717
|
+
if action_desc == tool_descriptions["default"]:
|
|
718
|
+
# If using default, also show the tool name
|
|
719
|
+
self.console.print(f" [dim]Tool: {tool_name}[/dim]")
|
|
720
|
+
else:
|
|
721
|
+
print(f"\n{action_desc}")
|
|
722
|
+
if action_desc == tool_descriptions["default"]:
|
|
723
|
+
print(f" Tool: {tool_name}")
|
|
724
|
+
|
|
725
|
+
def print_tool_complete(self) -> None:
|
|
726
|
+
"""Print that tool execution is complete."""
|
|
727
|
+
if self.rich_available:
|
|
728
|
+
self.console.print("[green]ā
Tool execution complete[/green]")
|
|
729
|
+
else:
|
|
730
|
+
print("ā
Tool execution complete")
|
|
731
|
+
|
|
732
|
+
def print_error(self, error_message: str) -> None:
|
|
733
|
+
"""
|
|
734
|
+
Print an error message with appropriate styling.
|
|
735
|
+
|
|
736
|
+
Args:
|
|
737
|
+
error_message: The error message to display
|
|
738
|
+
"""
|
|
739
|
+
# Handle None error messages
|
|
740
|
+
if error_message is None:
|
|
741
|
+
error_message = "Unknown error occurred (received None)"
|
|
742
|
+
|
|
743
|
+
if self.rich_available:
|
|
744
|
+
self.console.print(
|
|
745
|
+
Panel(str(error_message), title="ā ļø Error", border_style="red")
|
|
746
|
+
)
|
|
747
|
+
else:
|
|
748
|
+
print(f"\nā ļø ERROR: {error_message}\n")
|
|
749
|
+
|
|
750
|
+
def print_info(self, message: str) -> None:
|
|
751
|
+
"""
|
|
752
|
+
Print an information message.
|
|
753
|
+
|
|
754
|
+
Args:
|
|
755
|
+
message: The information message to display
|
|
756
|
+
"""
|
|
757
|
+
if self.rich_available:
|
|
758
|
+
self.console.print() # Add newline before
|
|
759
|
+
self.console.print(Panel(message, title="ā¹ļø Info", border_style="blue"))
|
|
760
|
+
else:
|
|
761
|
+
print(f"\nā¹ļø INFO: {message}\n")
|
|
762
|
+
|
|
763
|
+
def print_success(self, message: str) -> None:
|
|
764
|
+
"""
|
|
765
|
+
Print a success message.
|
|
766
|
+
|
|
767
|
+
Args:
|
|
768
|
+
message: The success message to display
|
|
769
|
+
"""
|
|
770
|
+
if self.rich_available:
|
|
771
|
+
self.console.print() # Add newline before
|
|
772
|
+
self.console.print(Panel(message, title="ā
Success", border_style="green"))
|
|
773
|
+
else:
|
|
774
|
+
print(f"\nā
SUCCESS: {message}\n")
|
|
775
|
+
|
|
776
|
+
def print_diff(self, diff: str, filename: str) -> None:
|
|
777
|
+
"""
|
|
778
|
+
Print a code diff with syntax highlighting.
|
|
779
|
+
|
|
780
|
+
Args:
|
|
781
|
+
diff: The diff content to display
|
|
782
|
+
filename: Name of the file being changed
|
|
783
|
+
"""
|
|
784
|
+
if self.rich_available:
|
|
785
|
+
from rich.syntax import Syntax
|
|
786
|
+
|
|
787
|
+
self.console.print() # Add newline before
|
|
788
|
+
diff_panel = Panel(
|
|
789
|
+
Syntax(diff, "diff", theme="monokai", line_numbers=True),
|
|
790
|
+
title=f"š§ Changes to {filename}",
|
|
791
|
+
border_style="yellow",
|
|
792
|
+
)
|
|
793
|
+
self.console.print(diff_panel)
|
|
794
|
+
else:
|
|
795
|
+
print(f"\nš§ DIFF for {filename}:")
|
|
796
|
+
print("=" * 50)
|
|
797
|
+
print(diff)
|
|
798
|
+
print("=" * 50 + "\n")
|
|
799
|
+
|
|
800
|
+
def print_repeated_tool_warning(self) -> None:
|
|
801
|
+
"""Print a warning about repeated tool calls."""
|
|
802
|
+
message = "Detected repetitive tool call pattern. Agent execution paused to avoid an infinite loop. Try adjusting your prompt or agent configuration if this persists."
|
|
803
|
+
|
|
804
|
+
if self.rich_available:
|
|
805
|
+
self.console.print(
|
|
806
|
+
Panel(
|
|
807
|
+
f"[bold yellow]{message}[/bold yellow]",
|
|
808
|
+
title="ā ļø Warning",
|
|
809
|
+
border_style="yellow",
|
|
810
|
+
padding=(1, 2),
|
|
811
|
+
highlight=True,
|
|
812
|
+
)
|
|
813
|
+
)
|
|
814
|
+
else:
|
|
815
|
+
print(f"\nā ļø WARNING: {message}\n")
|
|
816
|
+
|
|
817
|
+
def print_final_answer(
|
|
818
|
+
self, answer: str, streaming: bool = True # pylint: disable=unused-argument
|
|
819
|
+
) -> None:
|
|
820
|
+
"""
|
|
821
|
+
Print the final answer with appropriate styling.
|
|
822
|
+
|
|
823
|
+
Args:
|
|
824
|
+
answer: The final answer to display
|
|
825
|
+
streaming: Not used (kept for compatibility)
|
|
826
|
+
"""
|
|
827
|
+
# Use the "š§ gaia:" prefix for consistency
|
|
828
|
+
if self.rich_available:
|
|
829
|
+
self.console.print(f"\n[bold blue]š§ gaia:[/bold blue] {answer}")
|
|
830
|
+
else:
|
|
831
|
+
print(f"\nš§ gaia: {answer}")
|
|
832
|
+
|
|
833
|
+
def print_completion(self, steps_taken: int, steps_limit: int) -> None:
|
|
834
|
+
"""
|
|
835
|
+
Print completion information.
|
|
836
|
+
|
|
837
|
+
Args:
|
|
838
|
+
steps_taken: Number of steps taken
|
|
839
|
+
steps_limit: Maximum number of steps allowed
|
|
840
|
+
"""
|
|
841
|
+
self.print_separator()
|
|
842
|
+
if self.rich_available:
|
|
843
|
+
self.console.print(
|
|
844
|
+
f"[bold blue]⨠Processing complete![/bold blue] Steps taken: {steps_taken}/{steps_limit}"
|
|
845
|
+
)
|
|
846
|
+
else:
|
|
847
|
+
print(f"⨠Processing complete! Steps taken: {steps_taken}/{steps_limit}")
|
|
848
|
+
|
|
849
|
+
def print_prompt(self, prompt: str, title: str = "Prompt") -> None:
|
|
850
|
+
"""
|
|
851
|
+
Print a prompt with appropriate styling for debugging.
|
|
852
|
+
|
|
853
|
+
Args:
|
|
854
|
+
prompt: The prompt to display
|
|
855
|
+
title: Optional title for the panel
|
|
856
|
+
"""
|
|
857
|
+
if self.rich_available:
|
|
858
|
+
from rich.syntax import Syntax
|
|
859
|
+
|
|
860
|
+
# Use plain text instead of markdown to avoid any parsing issues
|
|
861
|
+
# and ensure the full content is displayed
|
|
862
|
+
syntax = Syntax(prompt, "text", theme="monokai", line_numbers=False)
|
|
863
|
+
|
|
864
|
+
# Use expand=False to prevent Rich from trying to fit to terminal width
|
|
865
|
+
# This ensures the full prompt is shown even if it's very long
|
|
866
|
+
self.console.print(
|
|
867
|
+
Panel(
|
|
868
|
+
syntax,
|
|
869
|
+
title=f"š {title}",
|
|
870
|
+
border_style="cyan",
|
|
871
|
+
padding=(1, 2),
|
|
872
|
+
expand=False,
|
|
873
|
+
)
|
|
874
|
+
)
|
|
875
|
+
else:
|
|
876
|
+
print(f"\nš {title}:\n{'-' * 80}\n{prompt}\n{'-' * 80}\n")
|
|
877
|
+
|
|
878
|
+
def display_stats(self, stats: Dict[str, Any]) -> None:
|
|
879
|
+
"""
|
|
880
|
+
Display LLM performance statistics or query execution stats.
|
|
881
|
+
|
|
882
|
+
Args:
|
|
883
|
+
stats: Dictionary containing performance statistics
|
|
884
|
+
Can include: duration, steps_taken, total_tokens (query stats)
|
|
885
|
+
Or: time_to_first_token, tokens_per_second, etc. (LLM stats)
|
|
886
|
+
"""
|
|
887
|
+
if not stats:
|
|
888
|
+
return
|
|
889
|
+
|
|
890
|
+
# Check if we have query-level stats or LLM-level stats
|
|
891
|
+
has_query_stats = any(
|
|
892
|
+
key in stats for key in ["duration", "steps_taken", "total_tokens"]
|
|
893
|
+
)
|
|
894
|
+
has_llm_stats = any(
|
|
895
|
+
key in stats for key in ["time_to_first_token", "tokens_per_second"]
|
|
896
|
+
)
|
|
897
|
+
|
|
898
|
+
# Skip if there's no meaningful stats
|
|
899
|
+
if not has_query_stats and not has_llm_stats:
|
|
900
|
+
return
|
|
901
|
+
|
|
902
|
+
# Create a table for the stats
|
|
903
|
+
title = "š Query Stats" if has_query_stats else "š LLM Performance Stats"
|
|
904
|
+
table = Table(
|
|
905
|
+
title=title,
|
|
906
|
+
show_header=True,
|
|
907
|
+
header_style="bold cyan",
|
|
908
|
+
)
|
|
909
|
+
table.add_column("Metric", style="dim")
|
|
910
|
+
table.add_column("Value", justify="right")
|
|
911
|
+
|
|
912
|
+
# Add query-level stats (timing and steps)
|
|
913
|
+
if "duration" in stats and stats["duration"] is not None:
|
|
914
|
+
table.add_row("Duration", f"{stats['duration']:.2f}s")
|
|
915
|
+
|
|
916
|
+
if "steps_taken" in stats and stats["steps_taken"] is not None:
|
|
917
|
+
table.add_row("Steps", f"{stats['steps_taken']}")
|
|
918
|
+
|
|
919
|
+
# Add LLM performance stats (timing)
|
|
920
|
+
if "time_to_first_token" in stats and stats["time_to_first_token"] is not None:
|
|
921
|
+
table.add_row("Time to First Token", f"{stats['time_to_first_token']:.2f}s")
|
|
922
|
+
|
|
923
|
+
if "tokens_per_second" in stats and stats["tokens_per_second"] is not None:
|
|
924
|
+
table.add_row("Tokens/Second", f"{stats['tokens_per_second']:.1f}")
|
|
925
|
+
|
|
926
|
+
# Add token usage stats (always show in consistent format)
|
|
927
|
+
if "input_tokens" in stats and stats["input_tokens"] is not None:
|
|
928
|
+
table.add_row("Input Tokens", f"{stats['input_tokens']:,}")
|
|
929
|
+
|
|
930
|
+
if "output_tokens" in stats and stats["output_tokens"] is not None:
|
|
931
|
+
table.add_row("Output Tokens", f"{stats['output_tokens']:,}")
|
|
932
|
+
|
|
933
|
+
if "total_tokens" in stats and stats["total_tokens"] is not None:
|
|
934
|
+
table.add_row("Total Tokens", f"{stats['total_tokens']:,}")
|
|
935
|
+
|
|
936
|
+
# Print the table in a panel
|
|
937
|
+
self.console.print(Panel(table, border_style="blue"))
|
|
938
|
+
|
|
939
|
+
def start_progress(self, message: str) -> None:
|
|
940
|
+
"""
|
|
941
|
+
Start the progress indicator.
|
|
942
|
+
|
|
943
|
+
Args:
|
|
944
|
+
message: Message to display with the indicator
|
|
945
|
+
"""
|
|
946
|
+
# If file preview is active, pause it temporarily
|
|
947
|
+
self._paused_preview = False
|
|
948
|
+
if self.file_preview_live is not None:
|
|
949
|
+
try:
|
|
950
|
+
self.file_preview_live.stop()
|
|
951
|
+
self._paused_preview = True
|
|
952
|
+
self.file_preview_live = None
|
|
953
|
+
# Small delay to ensure clean transition
|
|
954
|
+
time.sleep(0.05)
|
|
955
|
+
except Exception:
|
|
956
|
+
pass
|
|
957
|
+
|
|
958
|
+
self.progress.start(message)
|
|
959
|
+
|
|
960
|
+
def stop_progress(self) -> None:
|
|
961
|
+
"""Stop the progress indicator."""
|
|
962
|
+
self.progress.stop()
|
|
963
|
+
|
|
964
|
+
# Ensure clean line separation after progress stops
|
|
965
|
+
if self.rich_available:
|
|
966
|
+
# Longer delay to ensure the transient display is FULLY cleared
|
|
967
|
+
time.sleep(0.15)
|
|
968
|
+
# Explicitly move to a new line
|
|
969
|
+
print() # Use print() instead of console.print() to avoid Live display conflicts
|
|
970
|
+
|
|
971
|
+
# NOTE: Do NOT create Live display here - let update_file_preview() handle it
|
|
972
|
+
# This prevents double panels from appearing when both stop_progress and update_file_preview execute
|
|
973
|
+
|
|
974
|
+
# Reset the paused flag
|
|
975
|
+
if hasattr(self, "_paused_preview"):
|
|
976
|
+
self._paused_preview = False
|
|
977
|
+
|
|
978
|
+
def print_state_info(self, state_message: str):
|
|
979
|
+
"""
|
|
980
|
+
Print the current execution state
|
|
981
|
+
|
|
982
|
+
Args:
|
|
983
|
+
state_message: Message describing the current state
|
|
984
|
+
"""
|
|
985
|
+
if self.rich_available:
|
|
986
|
+
self.console.print(
|
|
987
|
+
self.Panel(
|
|
988
|
+
f"š [bold cyan]{state_message}[/bold cyan]",
|
|
989
|
+
border_style="cyan",
|
|
990
|
+
padding=(0, 1),
|
|
991
|
+
)
|
|
992
|
+
)
|
|
993
|
+
else:
|
|
994
|
+
print(f"š STATE: {state_message}")
|
|
995
|
+
|
|
996
|
+
def print_warning(self, warning_message: str):
|
|
997
|
+
"""
|
|
998
|
+
Print a warning message
|
|
999
|
+
|
|
1000
|
+
Args:
|
|
1001
|
+
warning_message: Warning message to display
|
|
1002
|
+
"""
|
|
1003
|
+
if self.rich_available:
|
|
1004
|
+
self.console.print() # Add newline before
|
|
1005
|
+
self.console.print(
|
|
1006
|
+
self.Panel(
|
|
1007
|
+
f"ā ļø [bold yellow] {warning_message} [/bold yellow]",
|
|
1008
|
+
border_style="yellow",
|
|
1009
|
+
padding=(0, 1),
|
|
1010
|
+
)
|
|
1011
|
+
)
|
|
1012
|
+
else:
|
|
1013
|
+
print(f"ā ļø WARNING: {warning_message}")
|
|
1014
|
+
|
|
1015
|
+
def print_streaming_text(
|
|
1016
|
+
self, text_chunk: str, end_of_stream: bool = False
|
|
1017
|
+
) -> None:
|
|
1018
|
+
"""
|
|
1019
|
+
Print text content as it streams in, without newlines between chunks.
|
|
1020
|
+
|
|
1021
|
+
Args:
|
|
1022
|
+
text_chunk: The chunk of text from the stream
|
|
1023
|
+
end_of_stream: Whether this is the last chunk
|
|
1024
|
+
"""
|
|
1025
|
+
# Accumulate text in the buffer
|
|
1026
|
+
self.streaming_buffer += text_chunk
|
|
1027
|
+
|
|
1028
|
+
# Print the chunk directly to console
|
|
1029
|
+
if self.rich_available:
|
|
1030
|
+
# Use low-level print to avoid adding newlines
|
|
1031
|
+
print(text_chunk, end="", flush=True)
|
|
1032
|
+
else:
|
|
1033
|
+
print(text_chunk, end="", flush=True)
|
|
1034
|
+
|
|
1035
|
+
# If this is the end of the stream, add a newline
|
|
1036
|
+
if end_of_stream:
|
|
1037
|
+
print()
|
|
1038
|
+
|
|
1039
|
+
def get_streaming_buffer(self) -> str:
|
|
1040
|
+
"""
|
|
1041
|
+
Get the accumulated streaming text and reset buffer.
|
|
1042
|
+
|
|
1043
|
+
Returns:
|
|
1044
|
+
The complete accumulated text from streaming
|
|
1045
|
+
"""
|
|
1046
|
+
result = self.streaming_buffer
|
|
1047
|
+
self.streaming_buffer = "" # Reset buffer
|
|
1048
|
+
return result
|
|
1049
|
+
|
|
1050
|
+
def print_response(self, response: str, title: str = "Response") -> None:
|
|
1051
|
+
"""
|
|
1052
|
+
Print an LLM response with appropriate styling.
|
|
1053
|
+
|
|
1054
|
+
Args:
|
|
1055
|
+
response: The response text to display
|
|
1056
|
+
title: Optional title for the panel
|
|
1057
|
+
"""
|
|
1058
|
+
if self.rich_available:
|
|
1059
|
+
from rich.syntax import Syntax
|
|
1060
|
+
|
|
1061
|
+
syntax = Syntax(response, "markdown", theme="monokai", line_numbers=False)
|
|
1062
|
+
self.console.print(
|
|
1063
|
+
Panel(syntax, title=f"š¤ {title}", border_style="green", padding=(1, 2))
|
|
1064
|
+
)
|
|
1065
|
+
else:
|
|
1066
|
+
print(f"\nš¤ {title}:\n{'-' * 80}\n{response}\n{'-' * 80}\n")
|
|
1067
|
+
|
|
1068
|
+
def print_tool_info(self, name: str, params_str: str, description: str) -> None:
|
|
1069
|
+
"""
|
|
1070
|
+
Print information about a tool with appropriate styling.
|
|
1071
|
+
|
|
1072
|
+
Args:
|
|
1073
|
+
name: Name of the tool
|
|
1074
|
+
params_str: Formatted string of parameters
|
|
1075
|
+
description: Tool description
|
|
1076
|
+
"""
|
|
1077
|
+
if self.rich_available:
|
|
1078
|
+
self.console.print(
|
|
1079
|
+
f"[bold cyan]š {name}[/bold cyan]([italic]{params_str}[/italic])"
|
|
1080
|
+
)
|
|
1081
|
+
self.console.print(f" [dim]{description}[/dim]")
|
|
1082
|
+
else:
|
|
1083
|
+
print(f"\nš {name}({params_str})")
|
|
1084
|
+
print(f" {description}")
|
|
1085
|
+
|
|
1086
|
+
def start_file_preview(
|
|
1087
|
+
self, filename: str, max_lines: int = 15, title_prefix: str = "š"
|
|
1088
|
+
) -> None:
|
|
1089
|
+
"""
|
|
1090
|
+
Start a live streaming file preview window.
|
|
1091
|
+
|
|
1092
|
+
Args:
|
|
1093
|
+
filename: Name of the file being generated
|
|
1094
|
+
max_lines: Maximum number of lines to show (default: 15)
|
|
1095
|
+
title_prefix: Emoji/prefix for the title (default: š)
|
|
1096
|
+
"""
|
|
1097
|
+
# CRITICAL: Stop progress indicator if running to prevent overlapping Live displays
|
|
1098
|
+
if self.progress.is_running:
|
|
1099
|
+
self.stop_progress()
|
|
1100
|
+
|
|
1101
|
+
# Stop any existing preview first to prevent stacking
|
|
1102
|
+
if self.file_preview_live is not None:
|
|
1103
|
+
try:
|
|
1104
|
+
self.file_preview_live.stop()
|
|
1105
|
+
except Exception:
|
|
1106
|
+
pass # Ignore errors if already stopped
|
|
1107
|
+
finally:
|
|
1108
|
+
self.file_preview_live = None
|
|
1109
|
+
# Small delay to ensure display cleanup
|
|
1110
|
+
time.sleep(0.1)
|
|
1111
|
+
# Ensure we're on a new line after stopping the previous preview
|
|
1112
|
+
if self.rich_available:
|
|
1113
|
+
self.console.print()
|
|
1114
|
+
|
|
1115
|
+
# Reset state for new file
|
|
1116
|
+
self.file_preview_filename = filename
|
|
1117
|
+
self.file_preview_content = ""
|
|
1118
|
+
self.file_preview_max_lines = max_lines
|
|
1119
|
+
|
|
1120
|
+
if self.rich_available:
|
|
1121
|
+
# DON'T start the live preview here - wait for first content
|
|
1122
|
+
pass
|
|
1123
|
+
else:
|
|
1124
|
+
# For non-rich mode, just print a header
|
|
1125
|
+
print(f"\n{title_prefix} Generating {filename}...")
|
|
1126
|
+
print("=" * 80)
|
|
1127
|
+
|
|
1128
|
+
def update_file_preview(self, content_chunk: str) -> None:
|
|
1129
|
+
"""
|
|
1130
|
+
Update the live file preview with new content.
|
|
1131
|
+
|
|
1132
|
+
Args:
|
|
1133
|
+
content_chunk: New content to append to the preview
|
|
1134
|
+
"""
|
|
1135
|
+
self.file_preview_content += content_chunk
|
|
1136
|
+
|
|
1137
|
+
if self.rich_available:
|
|
1138
|
+
# Only process if we have a filename set (preview has been started)
|
|
1139
|
+
if not self.file_preview_filename:
|
|
1140
|
+
return
|
|
1141
|
+
|
|
1142
|
+
# Check if enough time has passed for throttling
|
|
1143
|
+
current_time = time.time()
|
|
1144
|
+
time_since_last_update = current_time - self._last_preview_update_time
|
|
1145
|
+
|
|
1146
|
+
# Start the live preview on first content if not already started
|
|
1147
|
+
if self.file_preview_live is None and self.file_preview_content:
|
|
1148
|
+
preview = self._generate_file_preview_panel("š")
|
|
1149
|
+
self.file_preview_live = Live(
|
|
1150
|
+
preview,
|
|
1151
|
+
console=self.console,
|
|
1152
|
+
refresh_per_second=4,
|
|
1153
|
+
transient=False, # Keep False to prevent double rendering
|
|
1154
|
+
)
|
|
1155
|
+
self.file_preview_live.start()
|
|
1156
|
+
self._last_preview_update_time = current_time
|
|
1157
|
+
elif (
|
|
1158
|
+
self.file_preview_live
|
|
1159
|
+
and time_since_last_update >= self._preview_update_interval
|
|
1160
|
+
):
|
|
1161
|
+
try:
|
|
1162
|
+
# Update existing live display with new content
|
|
1163
|
+
preview = self._generate_file_preview_panel("š")
|
|
1164
|
+
# Just update, don't force refresh
|
|
1165
|
+
self.file_preview_live.update(preview)
|
|
1166
|
+
self._last_preview_update_time = current_time
|
|
1167
|
+
except Exception:
|
|
1168
|
+
# If update fails, continue accumulating content
|
|
1169
|
+
# (silently ignore preview update failures)
|
|
1170
|
+
pass
|
|
1171
|
+
else:
|
|
1172
|
+
# For non-rich mode, print new content directly
|
|
1173
|
+
print(content_chunk, end="", flush=True)
|
|
1174
|
+
|
|
1175
|
+
def stop_file_preview(self) -> None:
|
|
1176
|
+
"""Stop the live file preview and show final summary."""
|
|
1177
|
+
if self.rich_available:
|
|
1178
|
+
# Only stop if it was started
|
|
1179
|
+
if self.file_preview_live:
|
|
1180
|
+
try:
|
|
1181
|
+
self.file_preview_live.stop()
|
|
1182
|
+
except Exception:
|
|
1183
|
+
pass
|
|
1184
|
+
finally:
|
|
1185
|
+
self.file_preview_live = None
|
|
1186
|
+
|
|
1187
|
+
# Show completion message only if we generated content
|
|
1188
|
+
if self.file_preview_content:
|
|
1189
|
+
total_lines = len(self.file_preview_content.splitlines())
|
|
1190
|
+
self.console.print(
|
|
1191
|
+
f"[green]ā
Generated {self.file_preview_filename} ({total_lines} lines)[/green]\n"
|
|
1192
|
+
)
|
|
1193
|
+
else:
|
|
1194
|
+
print("\n" + "=" * 80)
|
|
1195
|
+
total_lines = len(self.file_preview_content.splitlines())
|
|
1196
|
+
print(f"ā
Generated {self.file_preview_filename} ({total_lines} lines)\n")
|
|
1197
|
+
|
|
1198
|
+
# Reset state - IMPORTANT: Clear filename first to prevent updates
|
|
1199
|
+
self.file_preview_filename = ""
|
|
1200
|
+
self.file_preview_content = ""
|
|
1201
|
+
|
|
1202
|
+
def _generate_file_preview_panel(self, title_prefix: str) -> Panel:
|
|
1203
|
+
"""
|
|
1204
|
+
Generate a Rich Panel with the current file preview content.
|
|
1205
|
+
|
|
1206
|
+
Args:
|
|
1207
|
+
title_prefix: Emoji/prefix for the title
|
|
1208
|
+
|
|
1209
|
+
Returns:
|
|
1210
|
+
Rich Panel with syntax-highlighted content
|
|
1211
|
+
"""
|
|
1212
|
+
lines = self.file_preview_content.splitlines()
|
|
1213
|
+
total_lines = len(lines)
|
|
1214
|
+
|
|
1215
|
+
# Truncate extremely long lines to prevent display issues
|
|
1216
|
+
truncated_lines = []
|
|
1217
|
+
for line in lines:
|
|
1218
|
+
if len(line) > MAX_DISPLAY_LINE_LENGTH:
|
|
1219
|
+
truncated_lines.append(line[:MAX_DISPLAY_LINE_LENGTH] + "...")
|
|
1220
|
+
else:
|
|
1221
|
+
truncated_lines.append(line)
|
|
1222
|
+
|
|
1223
|
+
# Show last N lines
|
|
1224
|
+
if total_lines <= self.file_preview_max_lines:
|
|
1225
|
+
preview_lines = truncated_lines
|
|
1226
|
+
line_info = f"All {total_lines} lines"
|
|
1227
|
+
else:
|
|
1228
|
+
preview_lines = truncated_lines[-self.file_preview_max_lines :]
|
|
1229
|
+
line_info = f"Last {self.file_preview_max_lines} of {total_lines} lines"
|
|
1230
|
+
|
|
1231
|
+
# Determine syntax highlighting
|
|
1232
|
+
ext = (
|
|
1233
|
+
self.file_preview_filename.split(".")[-1]
|
|
1234
|
+
if "." in self.file_preview_filename
|
|
1235
|
+
else "txt"
|
|
1236
|
+
)
|
|
1237
|
+
syntax_map = {
|
|
1238
|
+
"py": "python",
|
|
1239
|
+
"js": "javascript",
|
|
1240
|
+
"ts": "typescript",
|
|
1241
|
+
"jsx": "jsx",
|
|
1242
|
+
"tsx": "tsx",
|
|
1243
|
+
"json": "json",
|
|
1244
|
+
"md": "markdown",
|
|
1245
|
+
"yml": "yaml",
|
|
1246
|
+
"yaml": "yaml",
|
|
1247
|
+
"toml": "toml",
|
|
1248
|
+
"ini": "ini",
|
|
1249
|
+
"sh": "bash",
|
|
1250
|
+
"bash": "bash",
|
|
1251
|
+
"ps1": "powershell",
|
|
1252
|
+
"sql": "sql",
|
|
1253
|
+
"html": "html",
|
|
1254
|
+
"css": "css",
|
|
1255
|
+
"xml": "xml",
|
|
1256
|
+
"c": "c",
|
|
1257
|
+
"cpp": "cpp",
|
|
1258
|
+
"java": "java",
|
|
1259
|
+
"go": "go",
|
|
1260
|
+
"rs": "rust",
|
|
1261
|
+
}
|
|
1262
|
+
syntax_lang = syntax_map.get(ext.lower(), "text")
|
|
1263
|
+
|
|
1264
|
+
# Create syntax-highlighted preview
|
|
1265
|
+
preview_content = (
|
|
1266
|
+
"\n".join(preview_lines) if preview_lines else "[dim]Generating...[/dim]"
|
|
1267
|
+
)
|
|
1268
|
+
|
|
1269
|
+
if preview_lines:
|
|
1270
|
+
# Calculate starting line number for the preview
|
|
1271
|
+
if total_lines <= self.file_preview_max_lines:
|
|
1272
|
+
start_line = 1
|
|
1273
|
+
else:
|
|
1274
|
+
start_line = total_lines - self.file_preview_max_lines + 1
|
|
1275
|
+
|
|
1276
|
+
syntax = Syntax(
|
|
1277
|
+
preview_content,
|
|
1278
|
+
syntax_lang,
|
|
1279
|
+
theme="monokai",
|
|
1280
|
+
line_numbers=True,
|
|
1281
|
+
start_line=start_line,
|
|
1282
|
+
word_wrap=False, # Prevent line wrapping that causes display issues
|
|
1283
|
+
)
|
|
1284
|
+
else:
|
|
1285
|
+
syntax = preview_content
|
|
1286
|
+
|
|
1287
|
+
return Panel(
|
|
1288
|
+
syntax,
|
|
1289
|
+
title=f"{title_prefix} {self.file_preview_filename} ({line_info})",
|
|
1290
|
+
border_style="cyan",
|
|
1291
|
+
padding=(1, 2),
|
|
1292
|
+
)
|
|
1293
|
+
|
|
1294
|
+
|
|
1295
|
+
class SilentConsole(OutputHandler):
|
|
1296
|
+
"""
|
|
1297
|
+
A silent console that suppresses all output for JSON-only mode.
|
|
1298
|
+
Provides the same interface as AgentConsole but with no-op methods.
|
|
1299
|
+
Implements OutputHandler for silent/suppressed output.
|
|
1300
|
+
"""
|
|
1301
|
+
|
|
1302
|
+
def __init__(self, silence_final_answer: bool = False):
|
|
1303
|
+
"""Initialize the silent console.
|
|
1304
|
+
|
|
1305
|
+
Args:
|
|
1306
|
+
silence_final_answer: If True, suppress even the final answer (for JSON-only mode)
|
|
1307
|
+
"""
|
|
1308
|
+
self.streaming_buffer = "" # Maintain compatibility
|
|
1309
|
+
self.silence_final_answer = silence_final_answer
|
|
1310
|
+
|
|
1311
|
+
# Implementation of OutputHandler abstract methods - all no-ops
|
|
1312
|
+
def print_final_answer(
|
|
1313
|
+
self, answer: str, streaming: bool = True # pylint: disable=unused-argument
|
|
1314
|
+
) -> None:
|
|
1315
|
+
"""
|
|
1316
|
+
Print the final answer.
|
|
1317
|
+
Only suppressed if silence_final_answer is True.
|
|
1318
|
+
|
|
1319
|
+
Args:
|
|
1320
|
+
answer: The final answer to display
|
|
1321
|
+
streaming: Not used (kept for compatibility)
|
|
1322
|
+
"""
|
|
1323
|
+
if self.silence_final_answer:
|
|
1324
|
+
return # Completely silent
|
|
1325
|
+
|
|
1326
|
+
# Print the final answer directly
|
|
1327
|
+
print(f"\nš§ gaia: {answer}")
|
|
1328
|
+
|
|
1329
|
+
def display_stats(self, stats: Dict[str, Any]) -> None:
|
|
1330
|
+
"""
|
|
1331
|
+
Display stats even in silent mode (since explicitly requested).
|
|
1332
|
+
Uses the same Rich table format as AgentConsole.
|
|
1333
|
+
|
|
1334
|
+
Args:
|
|
1335
|
+
stats: Dictionary containing performance statistics
|
|
1336
|
+
"""
|
|
1337
|
+
if not stats:
|
|
1338
|
+
return
|
|
1339
|
+
|
|
1340
|
+
# Check if we have query-level stats or LLM-level stats
|
|
1341
|
+
has_query_stats = any(
|
|
1342
|
+
key in stats for key in ["duration", "steps_taken", "total_tokens"]
|
|
1343
|
+
)
|
|
1344
|
+
has_llm_stats = any(
|
|
1345
|
+
key in stats for key in ["time_to_first_token", "tokens_per_second"]
|
|
1346
|
+
)
|
|
1347
|
+
|
|
1348
|
+
# Skip if there's no meaningful stats
|
|
1349
|
+
if not has_query_stats and not has_llm_stats:
|
|
1350
|
+
return
|
|
1351
|
+
|
|
1352
|
+
# Use Rich table format (same as AgentConsole)
|
|
1353
|
+
from rich.console import Console
|
|
1354
|
+
from rich.panel import Panel
|
|
1355
|
+
from rich.table import Table
|
|
1356
|
+
|
|
1357
|
+
console = Console()
|
|
1358
|
+
|
|
1359
|
+
title = "š Query Stats" if has_query_stats else "š LLM Performance Stats"
|
|
1360
|
+
table = Table(
|
|
1361
|
+
title=title,
|
|
1362
|
+
show_header=True,
|
|
1363
|
+
header_style="bold cyan",
|
|
1364
|
+
)
|
|
1365
|
+
table.add_column("Metric", style="dim")
|
|
1366
|
+
table.add_column("Value", justify="right")
|
|
1367
|
+
|
|
1368
|
+
# Add query-level stats (timing and steps)
|
|
1369
|
+
if "duration" in stats and stats["duration"] is not None:
|
|
1370
|
+
table.add_row("Duration", f"{stats['duration']:.2f}s")
|
|
1371
|
+
|
|
1372
|
+
if "steps_taken" in stats and stats["steps_taken"] is not None:
|
|
1373
|
+
table.add_row("Steps", f"{stats['steps_taken']}")
|
|
1374
|
+
|
|
1375
|
+
# Add LLM performance stats (timing)
|
|
1376
|
+
if "time_to_first_token" in stats and stats["time_to_first_token"] is not None:
|
|
1377
|
+
table.add_row("Time to First Token", f"{stats['time_to_first_token']:.2f}s")
|
|
1378
|
+
|
|
1379
|
+
if "tokens_per_second" in stats and stats["tokens_per_second"] is not None:
|
|
1380
|
+
table.add_row("Tokens/Second", f"{stats['tokens_per_second']:.1f}")
|
|
1381
|
+
|
|
1382
|
+
# Add token usage stats (always show in consistent format)
|
|
1383
|
+
if "input_tokens" in stats and stats["input_tokens"] is not None:
|
|
1384
|
+
table.add_row("Input Tokens", f"{stats['input_tokens']:,}")
|
|
1385
|
+
|
|
1386
|
+
if "output_tokens" in stats and stats["output_tokens"] is not None:
|
|
1387
|
+
table.add_row("Output Tokens", f"{stats['output_tokens']:,}")
|
|
1388
|
+
|
|
1389
|
+
if "total_tokens" in stats and stats["total_tokens"] is not None:
|
|
1390
|
+
table.add_row("Total Tokens", f"{stats['total_tokens']:,}")
|
|
1391
|
+
|
|
1392
|
+
# Print the table in a panel
|
|
1393
|
+
console.print(Panel(table, border_style="blue"))
|
|
1394
|
+
|
|
1395
|
+
# All other abstract methods as no-ops
|
|
1396
|
+
def print_processing_start(self, query: str, max_steps: int):
|
|
1397
|
+
"""No-op implementation."""
|
|
1398
|
+
|
|
1399
|
+
def print_step_header(self, step_num: int, step_limit: int):
|
|
1400
|
+
"""No-op implementation."""
|
|
1401
|
+
|
|
1402
|
+
def print_state_info(self, state_message: str):
|
|
1403
|
+
"""No-op implementation."""
|
|
1404
|
+
|
|
1405
|
+
def print_thought(self, thought: str):
|
|
1406
|
+
"""No-op implementation."""
|
|
1407
|
+
|
|
1408
|
+
def print_goal(self, goal: str):
|
|
1409
|
+
"""No-op implementation."""
|
|
1410
|
+
|
|
1411
|
+
def print_plan(self, plan: List[Any], current_step: int = None):
|
|
1412
|
+
"""No-op implementation."""
|
|
1413
|
+
|
|
1414
|
+
def print_step_paused(self, description: str):
|
|
1415
|
+
"""No-op implementation."""
|
|
1416
|
+
|
|
1417
|
+
def print_checklist(self, items: List[Any], current_idx: int):
|
|
1418
|
+
"""No-op implementation."""
|
|
1419
|
+
|
|
1420
|
+
def print_checklist_reasoning(self, reasoning: str):
|
|
1421
|
+
"""No-op implementation."""
|
|
1422
|
+
|
|
1423
|
+
def print_command_executing(self, command: str):
|
|
1424
|
+
"""No-op implementation."""
|
|
1425
|
+
|
|
1426
|
+
def print_agent_selected(self, agent_name: str, language: str, project_type: str):
|
|
1427
|
+
"""No-op implementation."""
|
|
1428
|
+
|
|
1429
|
+
def print_tool_usage(self, tool_name: str):
|
|
1430
|
+
"""No-op implementation."""
|
|
1431
|
+
|
|
1432
|
+
def print_tool_complete(self):
|
|
1433
|
+
"""No-op implementation."""
|
|
1434
|
+
|
|
1435
|
+
def pretty_print_json(self, data: Dict[str, Any], title: str = None):
|
|
1436
|
+
"""No-op implementation."""
|
|
1437
|
+
|
|
1438
|
+
def print_error(self, error_message: str):
|
|
1439
|
+
"""No-op implementation."""
|
|
1440
|
+
|
|
1441
|
+
def print_warning(self, warning_message: str):
|
|
1442
|
+
"""No-op implementation."""
|
|
1443
|
+
|
|
1444
|
+
def print_info(self, message: str):
|
|
1445
|
+
"""No-op implementation."""
|
|
1446
|
+
|
|
1447
|
+
def start_progress(self, message: str):
|
|
1448
|
+
"""No-op implementation."""
|
|
1449
|
+
|
|
1450
|
+
def stop_progress(self):
|
|
1451
|
+
"""No-op implementation."""
|
|
1452
|
+
|
|
1453
|
+
def print_repeated_tool_warning(self):
|
|
1454
|
+
"""No-op implementation."""
|
|
1455
|
+
|
|
1456
|
+
def print_completion(self, steps_taken: int, steps_limit: int):
|
|
1457
|
+
"""No-op implementation."""
|