micro-cc 0.2.134__tar.gz → 0.2.136__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {micro_cc-0.2.134/src/micro_cc.egg-info → micro_cc-0.2.136}/PKG-INFO +1 -1
- {micro_cc-0.2.134 → micro_cc-0.2.136}/pyproject.toml +1 -1
- {micro_cc-0.2.134 → micro_cc-0.2.136}/src/micro_cc/claude_loop_.py +2 -3
- {micro_cc-0.2.134 → micro_cc-0.2.136}/src/micro_cc/skills/graph-orchestration/SKILL.md +16 -13
- {micro_cc-0.2.134 → micro_cc-0.2.136}/src/micro_cc/start_live_tui_.py +31 -1
- {micro_cc-0.2.134 → micro_cc-0.2.136}/src/micro_cc/tools/ask_user_tool.py +2 -0
- micro_cc-0.2.136/src/micro_cc/tools/chart_tool_.py +52 -0
- {micro_cc-0.2.134 → micro_cc-0.2.136}/src/micro_cc/tools/mcp_client_.py +78 -16
- micro_cc-0.2.136/src/micro_cc/tools/mcp_login_.py +112 -0
- {micro_cc-0.2.134 → micro_cc-0.2.136}/src/micro_cc/tools/mcp_oauth.py +23 -0
- {micro_cc-0.2.134 → micro_cc-0.2.136}/src/micro_cc/tools/search_tool_.py +2 -0
- {micro_cc-0.2.134 → micro_cc-0.2.136}/src/micro_cc/tui_native/pollers_.py +22 -0
- {micro_cc-0.2.134 → micro_cc-0.2.136}/src/micro_cc/tui_native/prompt_input_.py +7 -0
- {micro_cc-0.2.134 → micro_cc-0.2.136}/src/micro_cc/tui_native/question_ui_.py +20 -4
- {micro_cc-0.2.134 → micro_cc-0.2.136}/src/micro_cc/tui_native/renderers_.py +21 -1
- {micro_cc-0.2.134 → micro_cc-0.2.136}/src/micro_cc/tui_native/screen_cmds_.py +66 -43
- micro_cc-0.2.136/src/micro_cc/utils/chart_.py +297 -0
- {micro_cc-0.2.134 → micro_cc-0.2.136}/src/micro_cc/utils/command_registry.py +2 -14
- {micro_cc-0.2.134 → micro_cc-0.2.136}/src/micro_cc/utils/helpers.py +38 -0
- {micro_cc-0.2.134 → micro_cc-0.2.136}/src/micro_cc/utils/hidden_prompts.py +8 -209
- {micro_cc-0.2.134 → micro_cc-0.2.136}/src/micro_cc/utils/hints.py +1 -2
- {micro_cc-0.2.134 → micro_cc-0.2.136}/src/micro_cc/utils/whats_new.py +10 -0
- micro_cc-0.2.136/src/micro_cc/webui/dist/assets/index-0z2x29t1.js +309 -0
- micro_cc-0.2.136/src/micro_cc/webui/dist/assets/index-CGkzu_1O.css +1 -0
- {micro_cc-0.2.134 → micro_cc-0.2.136}/src/micro_cc/webui/dist/index.html +2 -2
- {micro_cc-0.2.134 → micro_cc-0.2.136}/src/micro_cc/webui/launch.py +44 -15
- {micro_cc-0.2.134 → micro_cc-0.2.136}/src/micro_cc/webui/server.py +208 -52
- {micro_cc-0.2.134 → micro_cc-0.2.136}/src/micro_cc/webui/session.py +19 -0
- {micro_cc-0.2.134 → micro_cc-0.2.136/src/micro_cc.egg-info}/PKG-INFO +1 -1
- {micro_cc-0.2.134 → micro_cc-0.2.136}/src/micro_cc.egg-info/SOURCES.txt +6 -2
- micro_cc-0.2.136/tests/test_chart.py +60 -0
- {micro_cc-0.2.134 → micro_cc-0.2.136}/tests/test_webui.py +137 -12
- micro_cc-0.2.134/src/micro_cc/webui/dist/assets/index-DcUp-FVr.css +0 -1
- micro_cc-0.2.134/src/micro_cc/webui/dist/assets/index-urI63sQw.js +0 -309
- {micro_cc-0.2.134 → micro_cc-0.2.136}/LICENSE +0 -0
- {micro_cc-0.2.134 → micro_cc-0.2.136}/README.md +0 -0
- {micro_cc-0.2.134 → micro_cc-0.2.136}/setup.cfg +0 -0
- {micro_cc-0.2.134 → micro_cc-0.2.136}/src/micro_cc/__init__.py +0 -0
- {micro_cc-0.2.134 → micro_cc-0.2.136}/src/micro_cc/browser/__init__.py +0 -0
- {micro_cc-0.2.134 → micro_cc-0.2.136}/src/micro_cc/browser/_cookies.py +0 -0
- {micro_cc-0.2.134 → micro_cc-0.2.136}/src/micro_cc/browser/_md_convert.py +0 -0
- {micro_cc-0.2.134 → micro_cc-0.2.136}/src/micro_cc/browser/browser_manager.py +0 -0
- {micro_cc-0.2.134 → micro_cc-0.2.136}/src/micro_cc/browser/simpletextbrowser.py +0 -0
- {micro_cc-0.2.134 → micro_cc-0.2.136}/src/micro_cc/cache/__init__.py +0 -0
- {micro_cc-0.2.134 → micro_cc-0.2.136}/src/micro_cc/cache/state_store.py +0 -0
- {micro_cc-0.2.134 → micro_cc-0.2.136}/src/micro_cc/execute_tool.py +0 -0
- {micro_cc-0.2.134 → micro_cc-0.2.136}/src/micro_cc/models/__init__.py +0 -0
- {micro_cc-0.2.134 → micro_cc-0.2.136}/src/micro_cc/models/adapters/__init__.py +0 -0
- {micro_cc-0.2.134 → micro_cc-0.2.136}/src/micro_cc/models/adapters/anthropic.py +0 -0
- {micro_cc-0.2.134 → micro_cc-0.2.136}/src/micro_cc/models/adapters/chat.py +0 -0
- {micro_cc-0.2.134 → micro_cc-0.2.136}/src/micro_cc/models/adapters/responses.py +0 -0
- {micro_cc-0.2.134 → micro_cc-0.2.136}/src/micro_cc/models/apis/__init__.py +0 -0
- {micro_cc-0.2.134 → micro_cc-0.2.136}/src/micro_cc/models/apis/anthropic_messages.py +0 -0
- {micro_cc-0.2.134 → micro_cc-0.2.136}/src/micro_cc/models/apis/openai_chat.py +0 -0
- {micro_cc-0.2.134 → micro_cc-0.2.136}/src/micro_cc/models/apis/openai_responses.py +0 -0
- {micro_cc-0.2.134 → micro_cc-0.2.136}/src/micro_cc/models/catalog.json +0 -0
- {micro_cc-0.2.134 → micro_cc-0.2.136}/src/micro_cc/models/catalog.py +0 -0
- {micro_cc-0.2.134 → micro_cc-0.2.136}/src/micro_cc/models/catalog_sync.py +0 -0
- {micro_cc-0.2.134 → micro_cc-0.2.136}/src/micro_cc/models/client.py +0 -0
- {micro_cc-0.2.134 → micro_cc-0.2.136}/src/micro_cc/models/providers.py +0 -0
- {micro_cc-0.2.134 → micro_cc-0.2.136}/src/micro_cc/models/retry.py +0 -0
- {micro_cc-0.2.134 → micro_cc-0.2.136}/src/micro_cc/models/schema.py +0 -0
- {micro_cc-0.2.134 → micro_cc-0.2.136}/src/micro_cc/models/types.py +0 -0
- {micro_cc-0.2.134 → micro_cc-0.2.136}/src/micro_cc/mods_.py +0 -0
- {micro_cc-0.2.134 → micro_cc-0.2.136}/src/micro_cc/postgres_store/__init__.py +0 -0
- {micro_cc-0.2.134 → micro_cc-0.2.136}/src/micro_cc/postgres_store/pg_store_.py +0 -0
- {micro_cc-0.2.134 → micro_cc-0.2.136}/src/micro_cc/postgres_store/schema_.py +0 -0
- {micro_cc-0.2.134 → micro_cc-0.2.136}/src/micro_cc/self_heal_.py +0 -0
- {micro_cc-0.2.134 → micro_cc-0.2.136}/src/micro_cc/skills/customizing-micro-cc/SKILL.md +0 -0
- {micro_cc-0.2.134 → micro_cc-0.2.136}/src/micro_cc/skills/design/SKILL.md +0 -0
- {micro_cc-0.2.134 → micro_cc-0.2.136}/src/micro_cc/skills/design/canvas-fonts/ArsenalSC-OFL.txt +0 -0
- {micro_cc-0.2.134 → micro_cc-0.2.136}/src/micro_cc/skills/design/canvas-fonts/ArsenalSC-Regular.ttf +0 -0
- {micro_cc-0.2.134 → micro_cc-0.2.136}/src/micro_cc/skills/design/canvas-fonts/BigShoulders-Bold.ttf +0 -0
- {micro_cc-0.2.134 → micro_cc-0.2.136}/src/micro_cc/skills/design/canvas-fonts/BigShoulders-OFL.txt +0 -0
- {micro_cc-0.2.134 → micro_cc-0.2.136}/src/micro_cc/skills/design/canvas-fonts/BigShoulders-Regular.ttf +0 -0
- {micro_cc-0.2.134 → micro_cc-0.2.136}/src/micro_cc/skills/design/canvas-fonts/Boldonse-OFL.txt +0 -0
- {micro_cc-0.2.134 → micro_cc-0.2.136}/src/micro_cc/skills/design/canvas-fonts/Boldonse-Regular.ttf +0 -0
- {micro_cc-0.2.134 → micro_cc-0.2.136}/src/micro_cc/skills/design/canvas-fonts/BricolageGrotesque-Bold.ttf +0 -0
- {micro_cc-0.2.134 → micro_cc-0.2.136}/src/micro_cc/skills/design/canvas-fonts/BricolageGrotesque-OFL.txt +0 -0
- {micro_cc-0.2.134 → micro_cc-0.2.136}/src/micro_cc/skills/design/canvas-fonts/BricolageGrotesque-Regular.ttf +0 -0
- {micro_cc-0.2.134 → micro_cc-0.2.136}/src/micro_cc/skills/design/canvas-fonts/CrimsonPro-Bold.ttf +0 -0
- {micro_cc-0.2.134 → micro_cc-0.2.136}/src/micro_cc/skills/design/canvas-fonts/CrimsonPro-Italic.ttf +0 -0
- {micro_cc-0.2.134 → micro_cc-0.2.136}/src/micro_cc/skills/design/canvas-fonts/CrimsonPro-OFL.txt +0 -0
- {micro_cc-0.2.134 → micro_cc-0.2.136}/src/micro_cc/skills/design/canvas-fonts/CrimsonPro-Regular.ttf +0 -0
- {micro_cc-0.2.134 → micro_cc-0.2.136}/src/micro_cc/skills/design/canvas-fonts/DMMono-OFL.txt +0 -0
- {micro_cc-0.2.134 → micro_cc-0.2.136}/src/micro_cc/skills/design/canvas-fonts/DMMono-Regular.ttf +0 -0
- {micro_cc-0.2.134 → micro_cc-0.2.136}/src/micro_cc/skills/design/canvas-fonts/EricaOne-OFL.txt +0 -0
- {micro_cc-0.2.134 → micro_cc-0.2.136}/src/micro_cc/skills/design/canvas-fonts/EricaOne-Regular.ttf +0 -0
- {micro_cc-0.2.134 → micro_cc-0.2.136}/src/micro_cc/skills/design/canvas-fonts/GeistMono-Bold.ttf +0 -0
- {micro_cc-0.2.134 → micro_cc-0.2.136}/src/micro_cc/skills/design/canvas-fonts/GeistMono-OFL.txt +0 -0
- {micro_cc-0.2.134 → micro_cc-0.2.136}/src/micro_cc/skills/design/canvas-fonts/GeistMono-Regular.ttf +0 -0
- {micro_cc-0.2.134 → micro_cc-0.2.136}/src/micro_cc/skills/design/canvas-fonts/Gloock-OFL.txt +0 -0
- {micro_cc-0.2.134 → micro_cc-0.2.136}/src/micro_cc/skills/design/canvas-fonts/Gloock-Regular.ttf +0 -0
- {micro_cc-0.2.134 → micro_cc-0.2.136}/src/micro_cc/skills/design/canvas-fonts/IBMPlexMono-Bold.ttf +0 -0
- {micro_cc-0.2.134 → micro_cc-0.2.136}/src/micro_cc/skills/design/canvas-fonts/IBMPlexMono-OFL.txt +0 -0
- {micro_cc-0.2.134 → micro_cc-0.2.136}/src/micro_cc/skills/design/canvas-fonts/IBMPlexMono-Regular.ttf +0 -0
- {micro_cc-0.2.134 → micro_cc-0.2.136}/src/micro_cc/skills/design/canvas-fonts/IBMPlexSerif-Bold.ttf +0 -0
- {micro_cc-0.2.134 → micro_cc-0.2.136}/src/micro_cc/skills/design/canvas-fonts/IBMPlexSerif-BoldItalic.ttf +0 -0
- {micro_cc-0.2.134 → micro_cc-0.2.136}/src/micro_cc/skills/design/canvas-fonts/IBMPlexSerif-Italic.ttf +0 -0
- {micro_cc-0.2.134 → micro_cc-0.2.136}/src/micro_cc/skills/design/canvas-fonts/IBMPlexSerif-Regular.ttf +0 -0
- {micro_cc-0.2.134 → micro_cc-0.2.136}/src/micro_cc/skills/design/canvas-fonts/InstrumentSans-Bold.ttf +0 -0
- {micro_cc-0.2.134 → micro_cc-0.2.136}/src/micro_cc/skills/design/canvas-fonts/InstrumentSans-BoldItalic.ttf +0 -0
- {micro_cc-0.2.134 → micro_cc-0.2.136}/src/micro_cc/skills/design/canvas-fonts/InstrumentSans-Italic.ttf +0 -0
- {micro_cc-0.2.134 → micro_cc-0.2.136}/src/micro_cc/skills/design/canvas-fonts/InstrumentSans-OFL.txt +0 -0
- {micro_cc-0.2.134 → micro_cc-0.2.136}/src/micro_cc/skills/design/canvas-fonts/InstrumentSans-Regular.ttf +0 -0
- {micro_cc-0.2.134 → micro_cc-0.2.136}/src/micro_cc/skills/design/canvas-fonts/InstrumentSerif-Italic.ttf +0 -0
- {micro_cc-0.2.134 → micro_cc-0.2.136}/src/micro_cc/skills/design/canvas-fonts/InstrumentSerif-Regular.ttf +0 -0
- {micro_cc-0.2.134 → micro_cc-0.2.136}/src/micro_cc/skills/design/canvas-fonts/Italiana-OFL.txt +0 -0
- {micro_cc-0.2.134 → micro_cc-0.2.136}/src/micro_cc/skills/design/canvas-fonts/Italiana-Regular.ttf +0 -0
- {micro_cc-0.2.134 → micro_cc-0.2.136}/src/micro_cc/skills/design/canvas-fonts/JetBrainsMono-Bold.ttf +0 -0
- {micro_cc-0.2.134 → micro_cc-0.2.136}/src/micro_cc/skills/design/canvas-fonts/JetBrainsMono-OFL.txt +0 -0
- {micro_cc-0.2.134 → micro_cc-0.2.136}/src/micro_cc/skills/design/canvas-fonts/JetBrainsMono-Regular.ttf +0 -0
- {micro_cc-0.2.134 → micro_cc-0.2.136}/src/micro_cc/skills/design/canvas-fonts/Jura-Light.ttf +0 -0
- {micro_cc-0.2.134 → micro_cc-0.2.136}/src/micro_cc/skills/design/canvas-fonts/Jura-Medium.ttf +0 -0
- {micro_cc-0.2.134 → micro_cc-0.2.136}/src/micro_cc/skills/design/canvas-fonts/Jura-OFL.txt +0 -0
- {micro_cc-0.2.134 → micro_cc-0.2.136}/src/micro_cc/skills/design/canvas-fonts/LibreBaskerville-OFL.txt +0 -0
- {micro_cc-0.2.134 → micro_cc-0.2.136}/src/micro_cc/skills/design/canvas-fonts/LibreBaskerville-Regular.ttf +0 -0
- {micro_cc-0.2.134 → micro_cc-0.2.136}/src/micro_cc/skills/design/canvas-fonts/Lora-Bold.ttf +0 -0
- {micro_cc-0.2.134 → micro_cc-0.2.136}/src/micro_cc/skills/design/canvas-fonts/Lora-BoldItalic.ttf +0 -0
- {micro_cc-0.2.134 → micro_cc-0.2.136}/src/micro_cc/skills/design/canvas-fonts/Lora-Italic.ttf +0 -0
- {micro_cc-0.2.134 → micro_cc-0.2.136}/src/micro_cc/skills/design/canvas-fonts/Lora-OFL.txt +0 -0
- {micro_cc-0.2.134 → micro_cc-0.2.136}/src/micro_cc/skills/design/canvas-fonts/Lora-Regular.ttf +0 -0
- {micro_cc-0.2.134 → micro_cc-0.2.136}/src/micro_cc/skills/design/canvas-fonts/NationalPark-Bold.ttf +0 -0
- {micro_cc-0.2.134 → micro_cc-0.2.136}/src/micro_cc/skills/design/canvas-fonts/NationalPark-OFL.txt +0 -0
- {micro_cc-0.2.134 → micro_cc-0.2.136}/src/micro_cc/skills/design/canvas-fonts/NationalPark-Regular.ttf +0 -0
- {micro_cc-0.2.134 → micro_cc-0.2.136}/src/micro_cc/skills/design/canvas-fonts/NothingYouCouldDo-OFL.txt +0 -0
- {micro_cc-0.2.134 → micro_cc-0.2.136}/src/micro_cc/skills/design/canvas-fonts/NothingYouCouldDo-Regular.ttf +0 -0
- {micro_cc-0.2.134 → micro_cc-0.2.136}/src/micro_cc/skills/design/canvas-fonts/Outfit-Bold.ttf +0 -0
- {micro_cc-0.2.134 → micro_cc-0.2.136}/src/micro_cc/skills/design/canvas-fonts/Outfit-OFL.txt +0 -0
- {micro_cc-0.2.134 → micro_cc-0.2.136}/src/micro_cc/skills/design/canvas-fonts/Outfit-Regular.ttf +0 -0
- {micro_cc-0.2.134 → micro_cc-0.2.136}/src/micro_cc/skills/design/canvas-fonts/PixelifySans-Medium.ttf +0 -0
- {micro_cc-0.2.134 → micro_cc-0.2.136}/src/micro_cc/skills/design/canvas-fonts/PixelifySans-OFL.txt +0 -0
- {micro_cc-0.2.134 → micro_cc-0.2.136}/src/micro_cc/skills/design/canvas-fonts/PoiretOne-OFL.txt +0 -0
- {micro_cc-0.2.134 → micro_cc-0.2.136}/src/micro_cc/skills/design/canvas-fonts/PoiretOne-Regular.ttf +0 -0
- {micro_cc-0.2.134 → micro_cc-0.2.136}/src/micro_cc/skills/design/canvas-fonts/RedHatMono-Bold.ttf +0 -0
- {micro_cc-0.2.134 → micro_cc-0.2.136}/src/micro_cc/skills/design/canvas-fonts/RedHatMono-OFL.txt +0 -0
- {micro_cc-0.2.134 → micro_cc-0.2.136}/src/micro_cc/skills/design/canvas-fonts/RedHatMono-Regular.ttf +0 -0
- {micro_cc-0.2.134 → micro_cc-0.2.136}/src/micro_cc/skills/design/canvas-fonts/Silkscreen-OFL.txt +0 -0
- {micro_cc-0.2.134 → micro_cc-0.2.136}/src/micro_cc/skills/design/canvas-fonts/Silkscreen-Regular.ttf +0 -0
- {micro_cc-0.2.134 → micro_cc-0.2.136}/src/micro_cc/skills/design/canvas-fonts/SmoochSans-Medium.ttf +0 -0
- {micro_cc-0.2.134 → micro_cc-0.2.136}/src/micro_cc/skills/design/canvas-fonts/SmoochSans-OFL.txt +0 -0
- {micro_cc-0.2.134 → micro_cc-0.2.136}/src/micro_cc/skills/design/canvas-fonts/Tektur-Medium.ttf +0 -0
- {micro_cc-0.2.134 → micro_cc-0.2.136}/src/micro_cc/skills/design/canvas-fonts/Tektur-OFL.txt +0 -0
- {micro_cc-0.2.134 → micro_cc-0.2.136}/src/micro_cc/skills/design/canvas-fonts/Tektur-Regular.ttf +0 -0
- {micro_cc-0.2.134 → micro_cc-0.2.136}/src/micro_cc/skills/design/canvas-fonts/WorkSans-Bold.ttf +0 -0
- {micro_cc-0.2.134 → micro_cc-0.2.136}/src/micro_cc/skills/design/canvas-fonts/WorkSans-BoldItalic.ttf +0 -0
- {micro_cc-0.2.134 → micro_cc-0.2.136}/src/micro_cc/skills/design/canvas-fonts/WorkSans-Italic.ttf +0 -0
- {micro_cc-0.2.134 → micro_cc-0.2.136}/src/micro_cc/skills/design/canvas-fonts/WorkSans-OFL.txt +0 -0
- {micro_cc-0.2.134 → micro_cc-0.2.136}/src/micro_cc/skills/design/canvas-fonts/WorkSans-Regular.ttf +0 -0
- {micro_cc-0.2.134 → micro_cc-0.2.136}/src/micro_cc/skills/design/canvas-fonts/YoungSerif-OFL.txt +0 -0
- {micro_cc-0.2.134 → micro_cc-0.2.136}/src/micro_cc/skills/design/canvas-fonts/YoungSerif-Regular.ttf +0 -0
- {micro_cc-0.2.134 → micro_cc-0.2.136}/src/micro_cc/skills/design/references/blueprint-tokens.md +0 -0
- {micro_cc-0.2.134 → micro_cc-0.2.136}/src/micro_cc/skills/docx/SKILL.md +0 -0
- {micro_cc-0.2.134 → micro_cc-0.2.136}/src/micro_cc/skills/docx/docx-js.md +0 -0
- {micro_cc-0.2.134 → micro_cc-0.2.136}/src/micro_cc/skills/docx/ooxml.md +0 -0
- {micro_cc-0.2.134 → micro_cc-0.2.136}/src/micro_cc/skills/github/SKILL.md +0 -0
- {micro_cc-0.2.134 → micro_cc-0.2.136}/src/micro_cc/skills/hairline-create/LICENSE-lib +0 -0
- {micro_cc-0.2.134 → micro_cc-0.2.136}/src/micro_cc/skills/hairline-create/SKILL.md +0 -0
- {micro_cc-0.2.134 → micro_cc-0.2.136}/src/micro_cc/skills/hairline-create/bench.html +0 -0
- {micro_cc-0.2.134 → micro_cc-0.2.136}/src/micro_cc/skills/hairline-create/build.mjs +0 -0
- {micro_cc-0.2.134 → micro_cc-0.2.136}/src/micro_cc/skills/hairline-create/concepts.md +0 -0
- {micro_cc-0.2.134 → micro_cc-0.2.136}/src/micro_cc/skills/hairline-create/examples/contour.js +0 -0
- {micro_cc-0.2.134 → micro_cc-0.2.136}/src/micro_cc/skills/hairline-create/examples/riffle.js +0 -0
- {micro_cc-0.2.134 → micro_cc-0.2.136}/src/micro_cc/skills/hairline-create/examples/terrain.js +0 -0
- {micro_cc-0.2.134 → micro_cc-0.2.136}/src/micro_cc/skills/hairline-create/free.js +0 -0
- {micro_cc-0.2.134 → micro_cc-0.2.136}/src/micro_cc/skills/hairline-create/kernel.js +0 -0
- {micro_cc-0.2.134 → micro_cc-0.2.136}/src/micro_cc/skills/hairline-create/look.md +0 -0
- {micro_cc-0.2.134 → micro_cc-0.2.136}/src/micro_cc/skills/hairline-create/look.mjs +0 -0
- {micro_cc-0.2.134 → micro_cc-0.2.136}/src/micro_cc/skills/hairline-create/rules.md +0 -0
- {micro_cc-0.2.134 → micro_cc-0.2.136}/src/micro_cc/skills/hairline-create/stamp.mjs +0 -0
- {micro_cc-0.2.134 → micro_cc-0.2.136}/src/micro_cc/skills/hairline-create/validate.mjs +0 -0
- {micro_cc-0.2.134 → micro_cc-0.2.136}/src/micro_cc/skills/keep-checking/SKILL.md +0 -0
- {micro_cc-0.2.134 → micro_cc-0.2.136}/src/micro_cc/skills/painted-video/RENDERER.md +0 -0
- {micro_cc-0.2.134 → micro_cc-0.2.136}/src/micro_cc/skills/painted-video/SKILL.md +0 -0
- {micro_cc-0.2.134 → micro_cc-0.2.136}/src/micro_cc/skills/painted-video/TIMING.md +0 -0
- {micro_cc-0.2.134 → micro_cc-0.2.136}/src/micro_cc/skills/painted-video/lib/lib.js +0 -0
- {micro_cc-0.2.134 → micro_cc-0.2.136}/src/micro_cc/skills/painted-video/lib/paint.js +0 -0
- {micro_cc-0.2.134 → micro_cc-0.2.136}/src/micro_cc/skills/painted-video/scripts/analysis/align.py +0 -0
- {micro_cc-0.2.134 → micro_cc-0.2.136}/src/micro_cc/skills/painted-video/scripts/analysis/build_data.py +0 -0
- {micro_cc-0.2.134 → micro_cc-0.2.136}/src/micro_cc/skills/painted-video/scripts/analysis/features.py +0 -0
- {micro_cc-0.2.134 → micro_cc-0.2.136}/src/micro_cc/skills/painted-video/scripts/analysis/transcribe.py +0 -0
- {micro_cc-0.2.134 → micro_cc-0.2.136}/src/micro_cc/skills/painted-video/scripts/check.mjs +0 -0
- {micro_cc-0.2.134 → micro_cc-0.2.136}/src/micro_cc/skills/painted-video/scripts/install_stack.sh +0 -0
- {micro_cc-0.2.134 → micro_cc-0.2.136}/src/micro_cc/skills/painted-video/scripts/render.mjs +0 -0
- {micro_cc-0.2.134 → micro_cc-0.2.136}/src/micro_cc/skills/painted-video/scripts/scaffold.py +0 -0
- {micro_cc-0.2.134 → micro_cc-0.2.136}/src/micro_cc/skills/pptx/SKILL.md +0 -0
- {micro_cc-0.2.134 → micro_cc-0.2.136}/src/micro_cc/skills/pptx/brief.md +0 -0
- {micro_cc-0.2.134 → micro_cc-0.2.136}/src/micro_cc/skills/pptx/scripts/build_deck.py +0 -0
- {micro_cc-0.2.134 → micro_cc-0.2.136}/src/micro_cc/skills/pptx/scripts/deck_to_images.py +0 -0
- {micro_cc-0.2.134 → micro_cc-0.2.136}/src/micro_cc/skills/pptx/scripts/inspect_template.py +0 -0
- {micro_cc-0.2.134 → micro_cc-0.2.136}/src/micro_cc/skills/pptx/scripts/office/__init__.py +0 -0
- {micro_cc-0.2.134 → micro_cc-0.2.136}/src/micro_cc/skills/pptx/scripts/office/soffice.py +0 -0
- {micro_cc-0.2.134 → micro_cc-0.2.136}/src/micro_cc/skills/pptx/scripts/render_svg.py +0 -0
- {micro_cc-0.2.134 → micro_cc-0.2.136}/src/micro_cc/skills/pptx/scripts/template_ops.py +0 -0
- {micro_cc-0.2.134 → micro_cc-0.2.136}/src/micro_cc/skills/pptx/svg-slides.md +0 -0
- {micro_cc-0.2.134 → micro_cc-0.2.136}/src/micro_cc/skills/pptx/template.md +0 -0
- {micro_cc-0.2.134 → micro_cc-0.2.136}/src/micro_cc/skills/skill_loader.py +0 -0
- {micro_cc-0.2.134 → micro_cc-0.2.136}/src/micro_cc/skills/xlsx/SKILL.md +0 -0
- {micro_cc-0.2.134 → micro_cc-0.2.136}/src/micro_cc/start_headless_.py +0 -0
- {micro_cc-0.2.134 → micro_cc-0.2.136}/src/micro_cc/tools/__init__.py +0 -0
- {micro_cc-0.2.134 → micro_cc-0.2.136}/src/micro_cc/tools/bash_tool.py +0 -0
- {micro_cc-0.2.134 → micro_cc-0.2.136}/src/micro_cc/tools/browser_tool_.py +0 -0
- {micro_cc-0.2.134 → micro_cc-0.2.136}/src/micro_cc/tools/computer_tool_.py +0 -0
- {micro_cc-0.2.134 → micro_cc-0.2.136}/src/micro_cc/tools/file_tools_.py +0 -0
- {micro_cc-0.2.134 → micro_cc-0.2.136}/src/micro_cc/tools/memory_tool_.py +0 -0
- {micro_cc-0.2.134 → micro_cc-0.2.136}/src/micro_cc/tools/message_session_.py +0 -0
- {micro_cc-0.2.134 → micro_cc-0.2.136}/src/micro_cc/tools/monitor_.py +0 -0
- {micro_cc-0.2.134 → micro_cc-0.2.136}/src/micro_cc/tools/monitor_poll_.py +0 -0
- {micro_cc-0.2.134 → micro_cc-0.2.136}/src/micro_cc/tools/monitor_schedule_.py +0 -0
- {micro_cc-0.2.134 → micro_cc-0.2.136}/src/micro_cc/tools/monitor_schedule_runtime.py +0 -0
- {micro_cc-0.2.134 → micro_cc-0.2.136}/src/micro_cc/tools/monitor_store_.py +0 -0
- {micro_cc-0.2.134 → micro_cc-0.2.136}/src/micro_cc/tools/monitor_watch_.py +0 -0
- {micro_cc-0.2.134 → micro_cc-0.2.136}/src/micro_cc/tools/reload_tool_.py +0 -0
- {micro_cc-0.2.134 → micro_cc-0.2.136}/src/micro_cc/tools/search_history_tool_.py +0 -0
- {micro_cc-0.2.134 → micro_cc-0.2.136}/src/micro_cc/tools/skill_tools_.py +0 -0
- {micro_cc-0.2.134 → micro_cc-0.2.136}/src/micro_cc/tools/todo_tools_.py +0 -0
- {micro_cc-0.2.134 → micro_cc-0.2.136}/src/micro_cc/tools/use_tool_.py +0 -0
- {micro_cc-0.2.134 → micro_cc-0.2.136}/src/micro_cc/tools/vision_tools_.py +0 -0
- {micro_cc-0.2.134 → micro_cc-0.2.136}/src/micro_cc/tools/web_tools_.py +0 -0
- {micro_cc-0.2.134 → micro_cc-0.2.136}/src/micro_cc/tui_native/__init__.py +0 -0
- {micro_cc-0.2.134 → micro_cc-0.2.136}/src/micro_cc/tui_native/alt_screen_.py +0 -0
- {micro_cc-0.2.134 → micro_cc-0.2.136}/src/micro_cc/tui_native/approval_ui_.py +0 -0
- {micro_cc-0.2.134 → micro_cc-0.2.136}/src/micro_cc/tui_native/banner_fx_.py +0 -0
- {micro_cc-0.2.134 → micro_cc-0.2.136}/src/micro_cc/tui_native/detect_images_.py +0 -0
- {micro_cc-0.2.134 → micro_cc-0.2.136}/src/micro_cc/tui_native/diff_viewer_.py +0 -0
- {micro_cc-0.2.134 → micro_cc-0.2.136}/src/micro_cc/tui_native/etype_handler_.py +0 -0
- {micro_cc-0.2.134 → micro_cc-0.2.136}/src/micro_cc/tui_native/glyphs_.py +0 -0
- {micro_cc-0.2.134 → micro_cc-0.2.136}/src/micro_cc/tui_native/keys_.py +0 -0
- {micro_cc-0.2.134 → micro_cc-0.2.136}/src/micro_cc/tui_native/kill_ring_.py +0 -0
- {micro_cc-0.2.134 → micro_cc-0.2.136}/src/micro_cc/tui_native/login_ui_.py +0 -0
- {micro_cc-0.2.134 → micro_cc-0.2.136}/src/micro_cc/tui_native/md_render_.py +0 -0
- {micro_cc-0.2.134 → micro_cc-0.2.136}/src/micro_cc/tui_native/message_row_.py +0 -0
- {micro_cc-0.2.134 → micro_cc-0.2.136}/src/micro_cc/tui_native/option_panel_.py +0 -0
- {micro_cc-0.2.134 → micro_cc-0.2.136}/src/micro_cc/tui_native/pane_.py +0 -0
- {micro_cc-0.2.134 → micro_cc-0.2.136}/src/micro_cc/tui_native/panel_layout_.py +0 -0
- {micro_cc-0.2.134 → micro_cc-0.2.136}/src/micro_cc/tui_native/scroll_view_.py +0 -0
- {micro_cc-0.2.134 → micro_cc-0.2.136}/src/micro_cc/tui_native/self_reload_ui_.py +0 -0
- {micro_cc-0.2.134 → micro_cc-0.2.136}/src/micro_cc/tui_native/self_terminal_setup_.py +0 -0
- {micro_cc-0.2.134 → micro_cc-0.2.136}/src/micro_cc/tui_native/self_update_.py +0 -0
- {micro_cc-0.2.134 → micro_cc-0.2.136}/src/micro_cc/tui_native/stack_.py +0 -0
- {micro_cc-0.2.134 → micro_cc-0.2.136}/src/micro_cc/tui_native/status_bar_.py +0 -0
- {micro_cc-0.2.134 → micro_cc-0.2.136}/src/micro_cc/tui_native/stdin_buffer_.py +0 -0
- {micro_cc-0.2.134 → micro_cc-0.2.136}/src/micro_cc/tui_native/terminal_.py +0 -0
- {micro_cc-0.2.134 → micro_cc-0.2.136}/src/micro_cc/tui_native/text_.py +0 -0
- {micro_cc-0.2.134 → micro_cc-0.2.136}/src/micro_cc/tui_native/text_utils_.py +0 -0
- {micro_cc-0.2.134 → micro_cc-0.2.136}/src/micro_cc/tui_native/theme_.py +0 -0
- {micro_cc-0.2.134 → micro_cc-0.2.136}/src/micro_cc/tui_native/truncated_text_.py +0 -0
- {micro_cc-0.2.134 → micro_cc-0.2.136}/src/micro_cc/tui_native/ui_api_.py +0 -0
- {micro_cc-0.2.134 → micro_cc-0.2.136}/src/micro_cc/tui_native/undo_stack_.py +0 -0
- {micro_cc-0.2.134 → micro_cc-0.2.136}/src/micro_cc/tui_native/word_navigation_.py +0 -0
- {micro_cc-0.2.134 → micro_cc-0.2.136}/src/micro_cc/utils/__init__.py +0 -0
- {micro_cc-0.2.134 → micro_cc-0.2.136}/src/micro_cc/utils/annotate_.py +0 -0
- {micro_cc-0.2.134 → micro_cc-0.2.136}/src/micro_cc/utils/banner_.py +0 -0
- {micro_cc-0.2.134 → micro_cc-0.2.136}/src/micro_cc/utils/claude_md_loader.py +0 -0
- {micro_cc-0.2.134 → micro_cc-0.2.136}/src/micro_cc/utils/claude_subscription.py +0 -0
- {micro_cc-0.2.134 → micro_cc-0.2.136}/src/micro_cc/utils/default_status_sh.py +0 -0
- {micro_cc-0.2.134 → micro_cc-0.2.136}/src/micro_cc/utils/gate_check_.py +0 -0
- {micro_cc-0.2.134 → micro_cc-0.2.136}/src/micro_cc/utils/history_mount_.py +0 -0
- {micro_cc-0.2.134 → micro_cc-0.2.136}/src/micro_cc/utils/inbox_store_.py +0 -0
- {micro_cc-0.2.134 → micro_cc-0.2.136}/src/micro_cc/utils/keep_awake_.py +0 -0
- {micro_cc-0.2.134 → micro_cc-0.2.136}/src/micro_cc/utils/legacy_status_sh.py +0 -0
- {micro_cc-0.2.134 → micro_cc-0.2.136}/src/micro_cc/utils/loop_events_.py +0 -0
- {micro_cc-0.2.134 → micro_cc-0.2.136}/src/micro_cc/utils/memory_store_.py +0 -0
- {micro_cc-0.2.134 → micro_cc-0.2.136}/src/micro_cc/utils/msg_normalize_.py +0 -0
- {micro_cc-0.2.134 → micro_cc-0.2.136}/src/micro_cc/utils/msg_store_.py +0 -0
- {micro_cc-0.2.134 → micro_cc-0.2.136}/src/micro_cc/utils/project_files_.py +0 -0
- {micro_cc-0.2.134 → micro_cc-0.2.136}/src/micro_cc/utils/self_reload_.py +0 -0
- {micro_cc-0.2.134 → micro_cc-0.2.136}/src/micro_cc/utils/session_ipc_.py +0 -0
- {micro_cc-0.2.134 → micro_cc-0.2.136}/src/micro_cc/utils/settings_store_.py +0 -0
- {micro_cc-0.2.134 → micro_cc-0.2.136}/src/micro_cc/utils/status_marker.py +0 -0
- {micro_cc-0.2.134 → micro_cc-0.2.136}/src/micro_cc/utils/statusline_.py +0 -0
- {micro_cc-0.2.134 → micro_cc-0.2.136}/src/micro_cc/utils/subagent_notice_.py +0 -0
- {micro_cc-0.2.134 → micro_cc-0.2.136}/src/micro_cc/utils/subagent_tracker_.py +0 -0
- {micro_cc-0.2.134 → micro_cc-0.2.136}/src/micro_cc/utils/system_prompt_.py +0 -0
- {micro_cc-0.2.134 → micro_cc-0.2.136}/src/micro_cc/utils/terminal_setup.py +0 -0
- {micro_cc-0.2.134 → micro_cc-0.2.136}/src/micro_cc/utils/theme_store_.py +0 -0
- {micro_cc-0.2.134 → micro_cc-0.2.136}/src/micro_cc/utils/tokenization_simple.py +0 -0
- {micro_cc-0.2.134 → micro_cc-0.2.136}/src/micro_cc/utils/tool_limits.py +0 -0
- {micro_cc-0.2.134 → micro_cc-0.2.136}/src/micro_cc/utils/tool_result_storage.py +0 -0
- {micro_cc-0.2.134 → micro_cc-0.2.136}/src/micro_cc/utils/tool_safety_.py +0 -0
- {micro_cc-0.2.134 → micro_cc-0.2.136}/src/micro_cc/webui/__init__.py +0 -0
- {micro_cc-0.2.134 → micro_cc-0.2.136}/src/micro_cc/webui/bridge.py +0 -0
- {micro_cc-0.2.134 → micro_cc-0.2.136}/src/micro_cc/webui/history.py +0 -0
- {micro_cc-0.2.134 → micro_cc-0.2.136}/src/micro_cc/webui/live.py +0 -0
- {micro_cc-0.2.134 → micro_cc-0.2.136}/src/micro_cc.egg-info/dependency_links.txt +0 -0
- {micro_cc-0.2.134 → micro_cc-0.2.136}/src/micro_cc.egg-info/entry_points.txt +0 -0
- {micro_cc-0.2.134 → micro_cc-0.2.136}/src/micro_cc.egg-info/requires.txt +0 -0
- {micro_cc-0.2.134 → micro_cc-0.2.136}/src/micro_cc.egg-info/top_level.txt +0 -0
- {micro_cc-0.2.134 → micro_cc-0.2.136}/tests/test_gate_check.py +0 -0
- {micro_cc-0.2.134 → micro_cc-0.2.136}/tests/test_interrupted_run.py +0 -0
- {micro_cc-0.2.134 → micro_cc-0.2.136}/tests/test_keep_awake.py +0 -0
- {micro_cc-0.2.134 → micro_cc-0.2.136}/tests/test_mcp.py +0 -0
- {micro_cc-0.2.134 → micro_cc-0.2.136}/tests/test_mod_pane.py +0 -0
- {micro_cc-0.2.134 → micro_cc-0.2.136}/tests/test_model_catalog.py +0 -0
- {micro_cc-0.2.134 → micro_cc-0.2.136}/tests/test_mods.py +0 -0
- {micro_cc-0.2.134 → micro_cc-0.2.136}/tests/test_monitor_poll.py +0 -0
- {micro_cc-0.2.134 → micro_cc-0.2.136}/tests/test_pg_theme_row.py +0 -0
- {micro_cc-0.2.134 → micro_cc-0.2.136}/tests/test_reply_thinking.py +0 -0
- {micro_cc-0.2.134 → micro_cc-0.2.136}/tests/test_schedule.py +0 -0
- {micro_cc-0.2.134 → micro_cc-0.2.136}/tests/test_self_reload.py +0 -0
- {micro_cc-0.2.134 → micro_cc-0.2.136}/tests/test_subagent_lifecycle.py +0 -0
- {micro_cc-0.2.134 → micro_cc-0.2.136}/tests/test_subagent_notice.py +0 -0
- {micro_cc-0.2.134 → micro_cc-0.2.136}/tests/test_thinking_origin.py +0 -0
- {micro_cc-0.2.134 → micro_cc-0.2.136}/tests/test_tui_render_golden.py +0 -0
- {micro_cc-0.2.134 → micro_cc-0.2.136}/tests/test_turn_recovery.py +0 -0
- {micro_cc-0.2.134 → micro_cc-0.2.136}/tests/test_use_tool_dispatcher.py +0 -0
- {micro_cc-0.2.134 → micro_cc-0.2.136}/tests/test_write_ahead.py +0 -0
|
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "micro-cc"
|
|
7
|
-
version = "0.2.
|
|
7
|
+
version = "0.2.136"
|
|
8
8
|
description = "Harness that gives frontier models full system access — shell, filesystem, browser, MCP — running directly on the metal."
|
|
9
9
|
readme = "README.md"
|
|
10
10
|
requires-python = ">=3.12"
|
|
@@ -278,9 +278,8 @@ async def claude_loop(
|
|
|
278
278
|
|
|
279
279
|
orchestration_line = (
|
|
280
280
|
"- Multi-subagent orchestration: read_skill('graph-orchestration') to "
|
|
281
|
-
"
|
|
282
|
-
"
|
|
283
|
-
"doesn't have to type /graph first."
|
|
281
|
+
"orchestrate headless subagents any time you judge a task benefits "
|
|
282
|
+
"from parallel or sequenced work."
|
|
284
283
|
) if surface == "tui" else ""
|
|
285
284
|
|
|
286
285
|
def _build_memory_manifest() -> str | None:
|
|
@@ -1,18 +1,22 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: graph-orchestration
|
|
3
|
-
description: Reference for
|
|
3
|
+
description: Reference for subagent orchestration — how spawning headless subagents (bash_ + microcc-headless), the ambient tracked-subagent status line, checkpoint wakeups (DONE/FAILED/PAUSED/NEEDS_INPUT), and message_session_ coordination between subagents actually work. re-read THIS skill any time during an orchestration (especially right after a checkpoint wakeup) to reload the full mechanism.
|
|
4
4
|
---
|
|
5
5
|
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
6
|
+
Orchestrate multiple headless subagents (microcc-headless) toward a larger
|
|
7
|
+
goal. There is no manifest or JSON graph format — design it turn-by-turn and
|
|
8
|
+
adjust as results come in. If the goal isn't clear, ask the user first.
|
|
9
|
+
|
|
10
|
+
Before spawning anything:
|
|
11
|
+
1. Draw a plain ASCII diagram (subagents, jobs, dependencies, parallel vs
|
|
12
|
+
blocking) and show it to the user — cheap to redraw, expensive to redo.
|
|
13
|
+
2. write_ the plan to GRAPH_PLAN.md in the project directory: a one-line
|
|
14
|
+
mechanism reminder (bash_ + microcc-headless to spawn, monitor_ to check,
|
|
15
|
+
message_session_ to coordinate, checkpoint wakeups) plus each subagent's
|
|
16
|
+
project_dir, job, dependencies and stage. Keep it current after every
|
|
17
|
+
decision — it survives context compression, this turn does not.
|
|
18
|
+
|
|
19
|
+
For exact ground truth, read_ the file named next to each mechanism below.
|
|
16
20
|
|
|
17
21
|
## Spawning
|
|
18
22
|
|
|
@@ -38,8 +42,7 @@ must end its reply with STATUS: DONE/NEEDS_INPUT/FAILED); that's where the
|
|
|
38
42
|
DONE/FAILED/PAUSED/NEEDS_INPUT checkpoints below come from — you don't add
|
|
39
43
|
that instruction yourself (start_headless_.py has the exact mechanism). Give
|
|
40
44
|
each subagent its own project_dir — a fresh path is a clean isolated
|
|
41
|
-
conversation scope, decided by you turn-by-turn
|
|
42
|
-
of named tasks predeclared upfront in one manifest file).
|
|
45
|
+
conversation scope, decided by you turn-by-turn.
|
|
43
46
|
|
|
44
47
|
You can pick a different --model per subagent if the task calls for it (e.g.
|
|
45
48
|
a cheaper/faster model for a simple fan-out step, a stronger one for the
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import asyncio
|
|
2
|
+
import functools
|
|
2
3
|
import traceback
|
|
3
4
|
import os
|
|
4
5
|
import re
|
|
@@ -15,6 +16,7 @@ from micro_cc.utils.helpers import (
|
|
|
15
16
|
ollama_daemon_up,
|
|
16
17
|
start_ollama_daemon,
|
|
17
18
|
extract_image_paths,
|
|
19
|
+
read_clipboard_image,
|
|
18
20
|
sanitize_and_encode_image_,
|
|
19
21
|
)
|
|
20
22
|
from micro_cc.cache import state_store
|
|
@@ -24,7 +26,7 @@ from micro_cc.tui_native.theme_ import shimmer
|
|
|
24
26
|
from micro_cc.tui_native.glyphs_ import glyph
|
|
25
27
|
|
|
26
28
|
# Theme tokens read live via theme_store_.get() to allow /theme switch.
|
|
27
|
-
from micro_cc.tui_native.screen_cmds_ import SLASH_COMMANDS, PREFIX_COMMANDS
|
|
29
|
+
from micro_cc.tui_native.screen_cmds_ import SLASH_COMMANDS, PREFIX_COMMANDS, ARG_COMMANDS
|
|
28
30
|
from micro_cc import mods_
|
|
29
31
|
from micro_cc.utils import command_registry, statusline_
|
|
30
32
|
from micro_cc.tui_native.ui_api_ import make_ui
|
|
@@ -134,6 +136,7 @@ class MicroTui():
|
|
|
134
136
|
## ask user
|
|
135
137
|
self._ask_questions = None
|
|
136
138
|
self._ask_stage = None
|
|
139
|
+
self._ask_picked = None
|
|
137
140
|
self._ask_answers = {}
|
|
138
141
|
## Esc-Esc-to-clear (only while idle — see action_cancel_query)
|
|
139
142
|
self._esc_clear_armed = False
|
|
@@ -436,6 +439,9 @@ class MicroTui():
|
|
|
436
439
|
if mods_.handle_key(data):
|
|
437
440
|
self.request_render()
|
|
438
441
|
return
|
|
442
|
+
if key_id == "ctrl+v" and self.get_focus() is self.prompt and self._paste_clipboard_image():
|
|
443
|
+
self.request_render()
|
|
444
|
+
return
|
|
439
445
|
if key_id == "escape":
|
|
440
446
|
# App-level so it fires regardless of focus; action_cancel_query also closes pickers.
|
|
441
447
|
self.action_cancel_query()
|
|
@@ -671,8 +677,17 @@ class MicroTui():
|
|
|
671
677
|
# Always route paste to prompt, stealing focus if needed.
|
|
672
678
|
if self.get_focus() is not self.prompt:
|
|
673
679
|
self.set_focus(self.prompt)
|
|
680
|
+
if not text.strip() and self._paste_clipboard_image(): # Cmd+V on an image sends an empty paste
|
|
681
|
+
return
|
|
674
682
|
self.prompt._handle_paste(text)
|
|
675
683
|
|
|
684
|
+
def _paste_clipboard_image(self) -> bool:
|
|
685
|
+
path = read_clipboard_image()
|
|
686
|
+
if path is None:
|
|
687
|
+
return False
|
|
688
|
+
self.prompt.paste_image(path)
|
|
689
|
+
return True
|
|
690
|
+
|
|
676
691
|
# ============================================= clipboard + paste monkey patching + double paste unravel full paste # TODO
|
|
677
692
|
|
|
678
693
|
# ============================================= statusbar
|
|
@@ -1064,6 +1079,17 @@ class MicroTui():
|
|
|
1064
1079
|
)
|
|
1065
1080
|
self.prompt._paste_store.clear()
|
|
1066
1081
|
self.prompt._paste_id = 0
|
|
1082
|
+
pasted_images: list[str] = []
|
|
1083
|
+
|
|
1084
|
+
def _take_image(m):
|
|
1085
|
+
path = self.prompt._image_store.get(int(m.group(1)))
|
|
1086
|
+
if path is None:
|
|
1087
|
+
return m.group(0)
|
|
1088
|
+
pasted_images.append(path)
|
|
1089
|
+
return ""
|
|
1090
|
+
|
|
1091
|
+
query = re.sub(r'\[image:(\d+)\]', _take_image, query).strip()
|
|
1092
|
+
self.prompt._image_store.clear()
|
|
1067
1093
|
|
|
1068
1094
|
# The browser owns the conversation during /gui; two writers would corrupt the jsonl.
|
|
1069
1095
|
if self._input_mode == "gui":
|
|
@@ -1103,6 +1129,9 @@ class MicroTui():
|
|
|
1103
1129
|
None,
|
|
1104
1130
|
)
|
|
1105
1131
|
handler = None if literal or mod_cmd or matched_prefix is not None else SLASH_COMMANDS.get(lower_q)
|
|
1132
|
+
head, _, cmd_arg = query.partition(" ")
|
|
1133
|
+
if handler is None and not (literal or mod_cmd or matched_prefix) and head.lower() in ARG_COMMANDS:
|
|
1134
|
+
handler = functools.partial(ARG_COMMANDS[head.lower()], arg=cmd_arg.strip())
|
|
1106
1135
|
|
|
1107
1136
|
# Gate builtins mid-stream: they mutate message_list/_loop_msgs that the in-flight turn writes to.
|
|
1108
1137
|
# Mod commands only reach the api, whose send_prompt queues, so they run mid-stream.
|
|
@@ -1146,6 +1175,7 @@ class MicroTui():
|
|
|
1146
1175
|
|
|
1147
1176
|
# Encode image paths now so they ride this turn as content blocks.
|
|
1148
1177
|
query, image_paths = extract_image_paths(query)
|
|
1178
|
+
image_paths = pasted_images + image_paths
|
|
1149
1179
|
encoded_image = [e for e in (sanitize_and_encode_image_(p) for p in image_paths) if e] or None
|
|
1150
1180
|
if image_paths and not query:
|
|
1151
1181
|
names = ", ".join(os.path.basename(p) for p in image_paths)
|
|
@@ -51,6 +51,8 @@ async def ask_user_question_tool_(
|
|
|
51
51
|
- single-choice: options set, multiSelect=false — user picks exactly one
|
|
52
52
|
- multi-choice: options set, multiSelect=true — user toggles any number
|
|
53
53
|
of options, then confirms
|
|
54
|
+
An "Other" option for typing a custom answer is always added to option
|
|
55
|
+
lists automatically — never add your own.
|
|
54
56
|
|
|
55
57
|
Args:
|
|
56
58
|
questions: Each question shown to the user in order. Leave `options`
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
from typing import List, Literal, NotRequired, Optional, TypedDict
|
|
2
|
+
|
|
3
|
+
from micro_cc.utils import chart_ as charts
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
class ChartSeries(TypedDict):
|
|
7
|
+
name: str
|
|
8
|
+
values: List[float]
|
|
9
|
+
x: NotRequired[List[float]]
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
def chart_(
|
|
13
|
+
kind: Literal["line", "area", "scatter", "bar", "hbar", "histogram", "heatmap", "share"],
|
|
14
|
+
series: List[ChartSeries],
|
|
15
|
+
title: str = "",
|
|
16
|
+
labels: Optional[List[str]] = None,
|
|
17
|
+
split: bool = False,
|
|
18
|
+
bins: Optional[int] = None,
|
|
19
|
+
height: int = 10,
|
|
20
|
+
) -> str:
|
|
21
|
+
"""Draw a chart for the user right in the terminal (braille/block glyphs, theme colors). Use it when numbers over time or across categories read better as a picture. The user sees the chart; you only get summary stats back, so don't restate the data. Aggregate first: thousands of points are fine, raw millions are not.
|
|
22
|
+
|
|
23
|
+
Kinds and how to pass data:
|
|
24
|
+
line/area: values per series over labels (x axis names, one per value; optional).
|
|
25
|
+
scatter: each series has x and values of equal length.
|
|
26
|
+
bar: grouped vertical bars; labels = categories, one series per group member, values >= 0.
|
|
27
|
+
hbar: like bar but horizontal; best for long category names and rankings.
|
|
28
|
+
histogram: raw numbers in series[0].values; bins optional.
|
|
29
|
+
heatmap: one series per row, values across columns, labels name the columns.
|
|
30
|
+
share: parts of a whole; labels + one series, values >= 0.
|
|
31
|
+
|
|
32
|
+
Args:
|
|
33
|
+
kind: chart type, see above.
|
|
34
|
+
series: list of {name, values, x?}; all series of bar/hbar/heatmap must be equally long.
|
|
35
|
+
title: short heading.
|
|
36
|
+
labels: category or x-axis labels, one per value.
|
|
37
|
+
split: line/area/scatter only: one panel per series with its own scale instead of sharing one axis.
|
|
38
|
+
bins: histogram bin count (default ~sqrt(n)).
|
|
39
|
+
height: plot rows, 4-30.
|
|
40
|
+
"""
|
|
41
|
+
spec = {"kind": kind, "series": series, "title": title, "labels": labels, "split": split, "bins": bins, "height": height}
|
|
42
|
+
if err := charts.validate(spec):
|
|
43
|
+
return f"Error: {err}"
|
|
44
|
+
lines = []
|
|
45
|
+
for s in series[:1] if kind in ("histogram", "share") else series:
|
|
46
|
+
st = charts.stats(s, labels)
|
|
47
|
+
at = f" at {st['at']}" if st["at"] is not None else ""
|
|
48
|
+
lines.append(
|
|
49
|
+
f"{st['name']}: n={st['n']} max {charts.fmt(st['max'])}{at}, last {charts.fmt(st['last'])}, "
|
|
50
|
+
f"min {charts.fmt(st['min'])}, mean {charts.fmt(st['mean'])}"
|
|
51
|
+
)
|
|
52
|
+
return f"Chart ({kind}) shown to the user.\n" + "\n".join(lines)
|
|
@@ -6,6 +6,7 @@ fallback (SSE first for `"type": "sse"`). Local: stdio, one long-lived process p
|
|
|
6
6
|
|
|
7
7
|
import asyncio
|
|
8
8
|
from contextlib import asynccontextmanager
|
|
9
|
+
import contextvars
|
|
9
10
|
import json
|
|
10
11
|
import os
|
|
11
12
|
import re
|
|
@@ -137,32 +138,61 @@ LIST_TIMEOUT = 30 # connect + tools/list (stdio servers get STDIO_LIST_TIMEOU
|
|
|
137
138
|
STDIO_LIST_TIMEOUT = 90
|
|
138
139
|
|
|
139
140
|
|
|
141
|
+
# Statuses 401/403 seen on the wire inside the current _guarded() call (survives a timeout/cancel).
|
|
142
|
+
_wire_auth: contextvars.ContextVar[list[int] | None] = contextvars.ContextVar("mcp_wire_auth", default=None)
|
|
143
|
+
|
|
144
|
+
|
|
140
145
|
async def _guarded(coro, timeout: float):
|
|
141
146
|
"""Await with a timeout; a CancelledError leaked by an inner anyio scope (dead server) becomes
|
|
142
|
-
a RuntimeError, while a real outer cancel still propagates."""
|
|
147
|
+
a RuntimeError, while a real outer cancel still propagates. A hang after a 401/403 is AuthRejected."""
|
|
148
|
+
seen: list[int] = []
|
|
149
|
+
token = _wire_auth.set(seen)
|
|
143
150
|
try:
|
|
144
151
|
return await asyncio.wait_for(coro, timeout)
|
|
145
152
|
except TimeoutError:
|
|
153
|
+
if seen:
|
|
154
|
+
raise AuthRejected(seen[0], "server") from None
|
|
146
155
|
raise RuntimeError(f"timed out after {timeout:g}s (server unreachable or unresponsive)") from None
|
|
147
156
|
except asyncio.CancelledError:
|
|
148
157
|
task = asyncio.current_task()
|
|
149
158
|
if task and task.cancelling():
|
|
150
159
|
raise
|
|
160
|
+
if seen:
|
|
161
|
+
raise AuthRejected(seen[0], "server") from None
|
|
151
162
|
raise RuntimeError("connection cancelled (server unreachable)") from None
|
|
163
|
+
finally:
|
|
164
|
+
_wire_auth.reset(token)
|
|
165
|
+
|
|
152
166
|
|
|
167
|
+
class AuthRejected(RuntimeError):
|
|
168
|
+
"""The server answered 401/403 at the HTTP layer (seen by our response hook, whatever the SDK raised)."""
|
|
169
|
+
def __init__(self, status: int, url: str):
|
|
170
|
+
super().__init__(f"HTTP {status} from {url} (auth rejected)")
|
|
171
|
+
self.status = status
|
|
153
172
|
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
173
|
+
|
|
174
|
+
def _chain(e: BaseException | None, _seen: set | None = None):
|
|
175
|
+
"""e, its causes/contexts and grouped sub-exceptions, each once."""
|
|
157
176
|
_seen = _seen if _seen is not None else set()
|
|
158
177
|
if e is None or id(e) in _seen:
|
|
159
|
-
return
|
|
178
|
+
return
|
|
160
179
|
_seen.add(id(e))
|
|
180
|
+
yield e
|
|
181
|
+
for x in (e.__cause__, e.__context__, *getattr(e, "exceptions", ())):
|
|
182
|
+
yield from _chain(x, _seen)
|
|
183
|
+
|
|
184
|
+
|
|
185
|
+
def _auth_failed(e: BaseException, strict: bool = False) -> bool:
|
|
186
|
+
"""Auth rejection anywhere in the chain: HTTP status first (AuthRejected, httpx HTTPStatusError),
|
|
187
|
+
text only as a fallback. `strict`: 401 only, not 403/expired."""
|
|
188
|
+
errs = list(_chain(e))
|
|
189
|
+
codes = {401} if strict else {401, 403}
|
|
190
|
+
for x in errs:
|
|
191
|
+
status = getattr(x, "status", None) or getattr(getattr(x, "response", None), "status_code", None)
|
|
192
|
+
if isinstance(status, int) and status in codes:
|
|
193
|
+
return True
|
|
161
194
|
words = ("401", "unauthor", "invalid_token") if strict else ("401", "403", "unauthor", "expired", "forbidden", "invalid_token")
|
|
162
|
-
|
|
163
|
-
return True
|
|
164
|
-
subs = [e.__cause__, e.__context__, *getattr(e, "exceptions", ())]
|
|
165
|
-
return any(_auth_failed(x, _seen, strict) for x in subs)
|
|
195
|
+
return any(w in str(x).lower() for x in errs for w in words)
|
|
166
196
|
|
|
167
197
|
|
|
168
198
|
def _leaf(e: BaseException) -> BaseException:
|
|
@@ -177,15 +207,33 @@ def _leaf(e: BaseException) -> BaseException:
|
|
|
177
207
|
return e
|
|
178
208
|
|
|
179
209
|
|
|
210
|
+
def _hooked_factory(on_response):
|
|
211
|
+
"""SDK http-client factory with our response hook attached (sees real status codes)."""
|
|
212
|
+
from mcp.shared._httpx_utils import create_mcp_http_client
|
|
213
|
+
|
|
214
|
+
def factory(*args, **kwargs):
|
|
215
|
+
client = create_mcp_http_client(*args, **kwargs)
|
|
216
|
+
client.event_hooks["response"].append(on_response)
|
|
217
|
+
return client
|
|
218
|
+
return factory
|
|
219
|
+
|
|
220
|
+
|
|
221
|
+
def _factory_kw(fn, on_response) -> dict:
|
|
222
|
+
"""{"httpx_client_factory": ...} if this SDK version's transport accepts one."""
|
|
223
|
+
import inspect
|
|
224
|
+
ok = "httpx_client_factory" in inspect.signature(fn).parameters
|
|
225
|
+
return {"httpx_client_factory": _hooked_factory(on_response)} if ok else {}
|
|
226
|
+
|
|
227
|
+
|
|
180
228
|
@asynccontextmanager
|
|
181
|
-
async def _streamable_streams(server_url: str, headers: dict):
|
|
229
|
+
async def _streamable_streams(server_url: str, headers: dict, on_response):
|
|
182
230
|
"""Streamable-HTTP transport; supports mcp 1.x and 2.x (2.x renamed the client, dropped the
|
|
183
231
|
headers kwarg, and changed the yielded tuple)."""
|
|
184
232
|
import mcp.client.streamable_http as sh
|
|
185
233
|
|
|
186
234
|
new = getattr(sh, "streamable_http_client", None)
|
|
187
235
|
if new is not None:
|
|
188
|
-
client =
|
|
236
|
+
client = _hooked_factory(on_response)(headers=headers or None)
|
|
189
237
|
try:
|
|
190
238
|
async with new(server_url, http_client=client) as (read, write):
|
|
191
239
|
yield read, write
|
|
@@ -199,32 +247,40 @@ async def _streamable_streams(server_url: str, headers: dict):
|
|
|
199
247
|
"installed `mcp` exposes neither streamable_http_client nor "
|
|
200
248
|
"streamablehttp_client — no streamable-HTTP transport available"
|
|
201
249
|
)
|
|
202
|
-
async with old(server_url, headers=headers or None) as (read, write, _):
|
|
250
|
+
async with old(server_url, headers=headers or None, **_factory_kw(old, on_response)) as (read, write, _):
|
|
203
251
|
yield read, write
|
|
204
252
|
|
|
205
253
|
|
|
206
254
|
@asynccontextmanager
|
|
207
|
-
async def _sse_streams(server_url: str, headers: dict):
|
|
255
|
+
async def _sse_streams(server_url: str, headers: dict, on_response):
|
|
208
256
|
"""SSE transport, the older protocol; same signature in mcp 1.x and 2.x."""
|
|
209
257
|
from mcp.client.sse import sse_client
|
|
210
|
-
async with sse_client(server_url, headers=headers or None) as (read, write):
|
|
258
|
+
async with sse_client(server_url, headers=headers or None, **_factory_kw(sse_client, on_response)) as (read, write):
|
|
211
259
|
yield read, write
|
|
212
260
|
|
|
213
261
|
|
|
214
262
|
@asynccontextmanager
|
|
215
263
|
async def _connect(server_url: str, headers: dict = None, sse_first: bool = False):
|
|
216
264
|
"""Connect via streamable HTTP, falling back to SSE (reversed with `sse_first`). Only setup is
|
|
217
|
-
guarded; errors raised in the consumer body propagate.
|
|
265
|
+
guarded; errors raised in the consumer body propagate. A 401/403 seen on the wire becomes
|
|
266
|
+
AuthRejected, since the SDK masks it (e.g. as a generic JSON-RPC INTERNAL_ERROR)."""
|
|
218
267
|
from mcp import ClientSession
|
|
219
268
|
|
|
220
269
|
headers = dict(headers or {})
|
|
221
270
|
errors = []
|
|
271
|
+
rejected: list[int] = []
|
|
272
|
+
|
|
273
|
+
async def on_response(r):
|
|
274
|
+
if r.status_code in (401, 403):
|
|
275
|
+
rejected.append(r.status_code)
|
|
276
|
+
if (outer := _wire_auth.get()) is not None:
|
|
277
|
+
outer.append(r.status_code)
|
|
222
278
|
|
|
223
279
|
openers = (_sse_streams, _streamable_streams) if sse_first else (_streamable_streams, _sse_streams)
|
|
224
280
|
for opener in openers:
|
|
225
281
|
opened = []
|
|
226
282
|
try:
|
|
227
|
-
transport = opener(server_url, headers)
|
|
283
|
+
transport = opener(server_url, headers, on_response)
|
|
228
284
|
read, write = await transport.__aenter__()
|
|
229
285
|
opened.append(transport)
|
|
230
286
|
session_cm = ClientSession(read, write)
|
|
@@ -241,9 +297,15 @@ async def _connect(server_url: str, headers: dict = None, sse_first: bool = Fals
|
|
|
241
297
|
task = asyncio.current_task()
|
|
242
298
|
if isinstance(e, asyncio.CancelledError) and task and task.cancelling():
|
|
243
299
|
raise # a real outer cancel, not the transport's own
|
|
300
|
+
if rejected: # same token on the fallback transport would fail too
|
|
301
|
+
raise AuthRejected(rejected[0], server_url) from e
|
|
244
302
|
continue
|
|
245
303
|
try:
|
|
246
304
|
yield session
|
|
305
|
+
except Exception as e:
|
|
306
|
+
if rejected:
|
|
307
|
+
raise AuthRejected(rejected[0], server_url) from e
|
|
308
|
+
raise
|
|
247
309
|
finally:
|
|
248
310
|
for cm in reversed(opened):
|
|
249
311
|
try:
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
"""/mcp-login and /mcp-logout core, shared by TUI and GUI: find OAuth MCP servers, log in, forget tokens."""
|
|
2
|
+
|
|
3
|
+
import asyncio
|
|
4
|
+
import time
|
|
5
|
+
from pathlib import Path
|
|
6
|
+
from typing import Callable, TypedDict
|
|
7
|
+
|
|
8
|
+
from micro_cc.tools import mcp_oauth
|
|
9
|
+
from micro_cc.tools.mcp_client_ import _has_static_auth, _is_stdio
|
|
10
|
+
from micro_cc.tools.search_tool_ import GLOBAL_MCPS_DIR, MCP_CATALOG, _scan_mcps_dir
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
class OAuthServer(TypedDict):
|
|
14
|
+
name: str
|
|
15
|
+
url: str # raw catalog url = token store key
|
|
16
|
+
cfg: dict | None # entry["oauth"] when it is a dict (client_id, scope, ...)
|
|
17
|
+
status: str # "logged in · expires in 42m", "not logged in", ...
|
|
18
|
+
has_token: bool
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
_pending: dict[str, asyncio.Task] = {} # url -> running login
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
def _catalog(project_dir: str) -> dict:
|
|
25
|
+
"""Fresh scan (not the cached one) so servers added to mcps/ show up without a restart."""
|
|
26
|
+
merged = dict(MCP_CATALOG)
|
|
27
|
+
merged.update(_scan_mcps_dir(GLOBAL_MCPS_DIR))
|
|
28
|
+
if project_dir:
|
|
29
|
+
merged.update(_scan_mcps_dir(Path(project_dir) / "mcps"))
|
|
30
|
+
return merged
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
def _status(url: str, tok: dict) -> str:
|
|
34
|
+
if url in _pending and not _pending[url].done():
|
|
35
|
+
return "login in progress"
|
|
36
|
+
if not tok.get("access_token"):
|
|
37
|
+
return "not logged in"
|
|
38
|
+
left = (tok.get("expires_at") or 0) - time.time()
|
|
39
|
+
if not tok.get("expires_at"):
|
|
40
|
+
return "logged in"
|
|
41
|
+
if left > 0:
|
|
42
|
+
return f"logged in · expires in {int(left // 3600)}h{int(left % 3600 // 60)}m" if left >= 3600 else f"logged in · expires in {int(left // 60)}m"
|
|
43
|
+
return "expired · will refresh on next use" if tok.get("refresh_token") else "expired · login needed"
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
async def oauth_servers(project_dir: str) -> list[OAuthServer]:
|
|
47
|
+
"""Servers that use OAuth: `"oauth"` set, a stored token, or (no auth configured) a 401 on probe."""
|
|
48
|
+
store = mcp_oauth.stored_tokens()
|
|
49
|
+
sure, maybe = [], []
|
|
50
|
+
for name, entry in _catalog(project_dir).items():
|
|
51
|
+
server = entry["server"]
|
|
52
|
+
if _is_stdio(server) or entry.get("oauth") is False:
|
|
53
|
+
continue
|
|
54
|
+
url = server["url"]
|
|
55
|
+
if entry.get("oauth") or url in store:
|
|
56
|
+
sure.append((name, entry))
|
|
57
|
+
elif not _has_static_auth(entry):
|
|
58
|
+
maybe.append((name, entry))
|
|
59
|
+
probed = await asyncio.gather(*(mcp_oauth.requires_auth(e["server"]["url"]) for _, e in maybe))
|
|
60
|
+
rows: list[OAuthServer] = []
|
|
61
|
+
for name, entry in sure + [m for m, ok in zip(maybe, probed) if ok]:
|
|
62
|
+
url = entry["server"]["url"]
|
|
63
|
+
oauth = entry.get("oauth")
|
|
64
|
+
tok = store.get(url, {})
|
|
65
|
+
rows.append({"name": name, "url": url, "cfg": oauth if isinstance(oauth, dict) else None,
|
|
66
|
+
"status": _status(url, tok), "has_token": bool(tok.get("access_token"))})
|
|
67
|
+
return sorted(rows, key=lambda r: r["name"])
|
|
68
|
+
|
|
69
|
+
|
|
70
|
+
async def _find(project_dir: str, name: str) -> tuple[OAuthServer | None, list[OAuthServer]]:
|
|
71
|
+
rows = await oauth_servers(project_dir)
|
|
72
|
+
return next((r for r in rows if r["name"].lower() == name.lower()), None), rows
|
|
73
|
+
|
|
74
|
+
|
|
75
|
+
def format_list(rows: list[OAuthServer]) -> str:
|
|
76
|
+
if not rows:
|
|
77
|
+
return "No OAuth MCP servers found (global ~/.micro-cc/mcps or the project's mcps/)."
|
|
78
|
+
return "OAuth MCP servers:\n" + "\n".join(f" {r['name']} — {r['status']}" for r in rows)
|
|
79
|
+
|
|
80
|
+
|
|
81
|
+
async def start_login(project_dir: str, name: str, notify: Callable[[str], None]) -> str:
|
|
82
|
+
"""Start a browser login in the background; login prompts and the outcome go to notify.
|
|
83
|
+
Returns an immediate message (started / unknown server / already running)."""
|
|
84
|
+
row, rows = await _find(project_dir, name)
|
|
85
|
+
if row is None:
|
|
86
|
+
names = ", ".join(r["name"] for r in rows) or "none"
|
|
87
|
+
return f"'{name}' is not an OAuth MCP server (OAuth servers: {names})"
|
|
88
|
+
url = row["url"]
|
|
89
|
+
if url in _pending and not _pending[url].done():
|
|
90
|
+
return f"login for {row['name']} already in progress — finish it in the browser"
|
|
91
|
+
|
|
92
|
+
async def run():
|
|
93
|
+
with mcp_oauth.auth_listener(notify):
|
|
94
|
+
try:
|
|
95
|
+
await mcp_oauth.force_login(url, row["cfg"])
|
|
96
|
+
notify(f"MCP login for {row['name']} succeeded — its tools use the new token on the next call")
|
|
97
|
+
except Exception as e:
|
|
98
|
+
notify(f"MCP login for {row['name']} failed: {e}")
|
|
99
|
+
finally:
|
|
100
|
+
_pending.pop(url, None)
|
|
101
|
+
|
|
102
|
+
_pending[url] = asyncio.get_running_loop().create_task(run())
|
|
103
|
+
return f"starting MCP login for {row['name']}…"
|
|
104
|
+
|
|
105
|
+
|
|
106
|
+
async def logout(project_dir: str, name: str) -> str:
|
|
107
|
+
row, rows = await _find(project_dir, name)
|
|
108
|
+
if row is None or not row["has_token"]:
|
|
109
|
+
names = ", ".join(r["name"] for r in rows if r["has_token"]) or "none"
|
|
110
|
+
return f"no stored login for '{name}' (logged in: {names})"
|
|
111
|
+
mcp_oauth.clear_oauth(row["url"])
|
|
112
|
+
return f"forgot the OAuth login for {row['name']} — its next call will ask you to log in"
|
|
@@ -331,6 +331,29 @@ async def login(server_url: str, cfg: dict | None = None) -> dict:
|
|
|
331
331
|
token_endpoint_auth_methods_supported=meta.get("token_endpoint_auth_methods_supported"))
|
|
332
332
|
|
|
333
333
|
|
|
334
|
+
async def requires_auth(server_url: str, timeout: float = 5) -> bool:
|
|
335
|
+
"""True if an unauthenticated probe gets 401 / WWW-Authenticate (False when unreachable)."""
|
|
336
|
+
try:
|
|
337
|
+
async with httpx.AsyncClient(timeout=timeout, follow_redirects=True) as http:
|
|
338
|
+
if await _challenge(http, server_url):
|
|
339
|
+
return True
|
|
340
|
+
r = await http.post(server_url, json={}, headers={"Accept": "application/json, text/event-stream"})
|
|
341
|
+
return r.status_code == 401
|
|
342
|
+
except Exception:
|
|
343
|
+
return False
|
|
344
|
+
|
|
345
|
+
|
|
346
|
+
def stored_tokens() -> dict:
|
|
347
|
+
"""{server_url: {"access_token", "expires_at", "refresh_token", ...}} from the store."""
|
|
348
|
+
return _load()
|
|
349
|
+
|
|
350
|
+
|
|
351
|
+
async def force_login(server_url: str, cfg: dict | None = None) -> dict:
|
|
352
|
+
"""Interactive login regardless of stored tokens; shares the per-server lock with oauth_headers."""
|
|
353
|
+
async with _locks.setdefault(server_url, asyncio.Lock()):
|
|
354
|
+
return await login(server_url, cfg)
|
|
355
|
+
|
|
356
|
+
|
|
334
357
|
async def _refresh(server_url: str, entry: dict) -> dict | None:
|
|
335
358
|
"""Refresh grant; None when it fails so the caller can fall back to login."""
|
|
336
359
|
if not (entry.get("refresh_token") and entry.get("token_endpoint")):
|
|
@@ -9,6 +9,7 @@ from micro_cc.tools.mcp_client_ import normalize_config, resolve_mcp_tools
|
|
|
9
9
|
|
|
10
10
|
# Import all discoverable tools
|
|
11
11
|
from micro_cc.tools.browser_tool_ import browser
|
|
12
|
+
from micro_cc.tools.chart_tool_ import chart_
|
|
12
13
|
from micro_cc.tools.computer_tool_ import computer
|
|
13
14
|
from micro_cc.tools.message_session_ import message_session_
|
|
14
15
|
from micro_cc.tools.monitor_ import monitor_
|
|
@@ -62,6 +63,7 @@ async def timer_(delay: str, prompt: str, *, project_dir: str, repeat: bool = Fa
|
|
|
62
63
|
_register(timer_, "timer alarm wake remind reminder later delay wait schedule sleep cron interval follow up check back in")
|
|
63
64
|
_register(message_session_, "message notify tell list find discover other running micro-cc sessions peers terminal cross-session communicate")
|
|
64
65
|
_register(reload_harness_, "reload restart relaunch harness self apply changes edited source mods mod modification")
|
|
66
|
+
_register(chart_, "chart graph plot diagram visualize visualise line bar histogram scatter heatmap trend timeseries distribution compare numbers over time")
|
|
65
67
|
_register(browser, "browser chrome playwright navigate click type web automation interact page form")
|
|
66
68
|
# Screenshot capture and AX scoping are mac-only: keep the tool out of the catalog elsewhere.
|
|
67
69
|
if platform.system() == "Darwin":
|
|
@@ -164,3 +164,25 @@ def poll_schedule_tick(app) -> None:
|
|
|
164
164
|
_schedule_rt.tick(app._project_dir)
|
|
165
165
|
except Exception as e:
|
|
166
166
|
app._show_error_row(f"schedule tick crashed: {type(e).__name__}: {e}")
|
|
167
|
+
|
|
168
|
+
|
|
169
|
+
# --- /gui watchdog -------------------------------------------------------
|
|
170
|
+
GUI_TICK_S = 5.0
|
|
171
|
+
GUI_AWAY_S = 90.0 # > Chrome's once-a-minute timer cap for hidden tabs, so a backgrounded tab still counts
|
|
172
|
+
GUI_HANDBACK_S = 600.0 # this long with no tab and nothing in flight: the terminal takes the session back
|
|
173
|
+
|
|
174
|
+
|
|
175
|
+
async def gui_watchdog_loop(app) -> None:
|
|
176
|
+
"""Hand the session back to the TUI when the browser is gone (tab closed, Esc forgotten).
|
|
177
|
+
Counts its own ticks, so time asleep never counts — waking the laptop can't trigger it."""
|
|
178
|
+
from micro_cc.webui import session as gui_session
|
|
179
|
+
|
|
180
|
+
away = 0.0
|
|
181
|
+
while app._input_mode == "gui" and app._gui_shutdown is not None:
|
|
182
|
+
await asyncio.sleep(GUI_TICK_S)
|
|
183
|
+
idle = gui_session.browser_away(GUI_AWAY_S) and not gui_session.busy()
|
|
184
|
+
away = away + GUI_TICK_S if idle else 0.0
|
|
185
|
+
if away >= GUI_HANDBACK_S and app._input_mode == "gui" and app._gui_shutdown is not None:
|
|
186
|
+
await app._resume_after_gui() # flashes its own line; ours replaces it with the reason
|
|
187
|
+
app._flash_status("< no browser for 10 min — GUI stopped, terminal is live again", seconds=10)
|
|
188
|
+
return
|
|
@@ -34,6 +34,7 @@ class PromptInput:
|
|
|
34
34
|
|
|
35
35
|
self._paste_store: dict[int, str] = {}
|
|
36
36
|
self._paste_id = 0
|
|
37
|
+
self._image_store: dict[int, str] = {}
|
|
37
38
|
|
|
38
39
|
self._cached_width: int | None = None
|
|
39
40
|
self._cached_lines: list[str] | None = None
|
|
@@ -219,6 +220,12 @@ class PromptInput:
|
|
|
219
220
|
else:
|
|
220
221
|
self.insert(text)
|
|
221
222
|
|
|
223
|
+
def paste_image(self, path: str) -> None:
|
|
224
|
+
"""Insert an [image:N] marker; the file path is resolved at submit."""
|
|
225
|
+
pid = len(self._image_store) + 1
|
|
226
|
+
self._image_store[pid] = path
|
|
227
|
+
self.insert(f"[image:{pid}]")
|
|
228
|
+
|
|
222
229
|
# --- slash-command suggestion ------------------------------------------
|
|
223
230
|
def update_suggestion(self) -> None:
|
|
224
231
|
text = self.text
|