@scemoon/cdh 1.0.6 → 1.0.7
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.
- package/package.json +2 -2
- package/ai-dlc-skill/SKILL.md +0 -77
- package/ai-dlc-skill/agents/deliver-agent.md +0 -24
- package/ai-dlc-skill/agents/master.md +0 -50
- package/ai-dlc-skill/agents/plan-agent.md +0 -23
- package/ai-dlc-skill/agents/understand-agent.md +0 -23
- package/ai-dlc-skill/agents/verify-agent.md +0 -27
- package/ai-dlc-skill/architecture/project-structure.md +0 -78
- package/ai-dlc-skill/brownfield/README.md +0 -30
- package/ai-dlc-skill/brownfield/generate-context.sh +0 -64
- package/ai-dlc-skill/brownfield/scripts/deps.sh +0 -27
- package/ai-dlc-skill/brownfield/scripts/discover.sh +0 -34
- package/ai-dlc-skill/brownfield/scripts/extract-api.sh +0 -45
- package/ai-dlc-skill/components/backend.md +0 -34
- package/ai-dlc-skill/components/desktop.md +0 -30
- package/ai-dlc-skill/components/mya.md +0 -29
- package/ai-dlc-skill/components/native.md +0 -30
- package/ai-dlc-skill/components/tta.md +0 -29
- package/ai-dlc-skill/components/web.md +0 -31
- package/ai-dlc-skill/components/wxa.md +0 -29
- package/ai-dlc-skill/contracts/README.md +0 -25
- package/ai-dlc-skill/core/adaptive-flow.md +0 -36
- package/ai-dlc-skill/core/security.md +0 -29
- package/ai-dlc-skill/cross-tool/cline/export.sh +0 -31
- package/ai-dlc-skill/cross-tool/copilot/export.sh +0 -47
- package/ai-dlc-skill/cross-tool/cursor/export.sh +0 -32
- package/ai-dlc-skill/cross-tool/export.sh +0 -22
- package/ai-dlc-skill/cross-tool/onecode/config.yaml.tpl +0 -17
- package/ai-dlc-skill/cross-tool/onecode/export-skills.sh +0 -35
- package/ai-dlc-skill/cross-tool/onecode/export.sh +0 -54
- package/ai-dlc-skill/phases/deliver/entry.md +0 -26
- package/ai-dlc-skill/phases/deliver/lifecycle.md +0 -185
- package/ai-dlc-skill/phases/deliver/prompt.md +0 -40
- package/ai-dlc-skill/phases/deliver/rules.md +0 -61
- package/ai-dlc-skill/phases/plan/entry.md +0 -25
- package/ai-dlc-skill/phases/plan/lifecycle.md +0 -204
- package/ai-dlc-skill/phases/plan/prompt.md +0 -38
- package/ai-dlc-skill/phases/plan/rules.md +0 -25
- package/ai-dlc-skill/phases/understand/entry.md +0 -26
- package/ai-dlc-skill/phases/understand/lifecycle.md +0 -184
- package/ai-dlc-skill/phases/understand/prompt.md +0 -41
- package/ai-dlc-skill/phases/understand/rules.md +0 -37
- package/ai-dlc-skill/phases/verify/entry.md +0 -26
- package/ai-dlc-skill/phases/verify/lifecycle.md +0 -192
- package/ai-dlc-skill/phases/verify/prompt.md +0 -43
- package/ai-dlc-skill/phases/verify/rules.md +0 -73
- package/ai-dlc-skill/practices/bdd.md +0 -91
- package/ai-dlc-skill/practices/sdd.md +0 -84
- package/ai-dlc-skill/practices/tdd.md +0 -95
- package/ai-dlc-skill/providers/README.md +0 -114
- package/ai-dlc-skill/providers/aliyun/deployment.yaml +0 -66
- package/ai-dlc-skill/providers/aliyun/preview.yaml +0 -84
- package/ai-dlc-skill/providers/aliyun/provider.yaml +0 -160
- package/ai-dlc-skill/providers/tcb/deployment.yaml +0 -69
- package/ai-dlc-skill/providers/tcb/preview.yaml +0 -83
- package/ai-dlc-skill/providers/tcb/provider.yaml +0 -172
- package/ai-dlc-skill/requirements.md +0 -140
- package/ai-dlc-skill/skill.yaml +0 -147
- package/ai-dlc-skill/templates/integration/CHANGELOG.md +0 -41
- package/ai-dlc-skill/templates/integration/asyncapi.yaml +0 -43
- package/ai-dlc-skill/templates/integration/contract-diff.md +0 -63
- package/ai-dlc-skill/templates/integration/contract-spec.md +0 -49
- package/ai-dlc-skill/templates/integration/openapi.yaml +0 -18
- package/ai-dlc-skill/templates/integration/runtime-contract.yaml +0 -36
- package/ai-dlc-skill/templates/plan/design.md +0 -49
- package/ai-dlc-skill/templates/plan/task-list.md +0 -32
- package/ai-dlc-skill/templates/project/README.md +0 -126
- package/ai-dlc-skill/templates/project/template.md +0 -119
- package/ai-dlc-skill/templates/understand/feature.feature +0 -23
- package/ai-dlc-skill/templates/understand/intent.md +0 -29
- package/ai-dlc-skill/templates/understand/spec-delta.md +0 -47
- package/ai-dlc-skill/templates/verify/test-unit.py +0 -27
- package/ai-dlc-skill/walkthrough/collect.sh +0 -50
- package/ai-dlc-skill/walkthrough/template.md +0 -54
- package/ai-dlc-skill/workflows/ai-dlc.yaml +0 -110
- package/ai-dlc-skill/workflows/deployment.yaml +0 -199
- package/cdh/__init__.py +0 -0
- package/cdh/__main__.py +0 -4
- package/cdh/__pycache__/__init__.cpython-314.pyc +0 -0
- package/cdh/__pycache__/cdh_mcp_injector.cpython-314.pyc +0 -0
- package/cdh/__pycache__/cdh_mcp_loader.cpython-314.pyc +0 -0
- package/cdh/__pycache__/cdh_mcp_manager.cpython-314.pyc +0 -0
- package/cdh/__pycache__/cdh_session_aggregator.cpython-314.pyc +0 -0
- package/cdh/__pycache__/cdh_skill_loader.cpython-314.pyc +0 -0
- package/cdh/__pycache__/cdh_skill_manager.cpython-314.pyc +0 -0
- package/cdh/__pycache__/cli.cpython-313.pyc +0 -0
- package/cdh/__pycache__/cli.cpython-314.pyc +0 -0
- package/cdh/__pycache__/scaffold.cpython-314.pyc +0 -0
- package/cdh/cdh_mcp_injector.py +0 -115
- package/cdh/cdh_mcp_loader.py +0 -67
- package/cdh/cdh_mcp_manager.py +0 -73
- package/cdh/cdh_session_aggregator.py +0 -258
- package/cdh/cdh_skill_manager.py +0 -105
- package/cdh/cli.py +0 -807
- package/cdh/scaffold.py +0 -728
- package/onecode/__init__.py +0 -1
- package/onecode/__main__.py +0 -4
- package/onecode/__pycache__/__init__.cpython-314.pyc +0 -0
- package/onecode/__pycache__/cli.cpython-314.pyc +0 -0
- package/onecode/__pycache__/commands.cpython-314.pyc +0 -0
- package/onecode/__pycache__/config.cpython-314.pyc +0 -0
- package/onecode/__pycache__/config_screen.cpython-314.pyc +0 -0
- package/onecode/__pycache__/migrate.cpython-314.pyc +0 -0
- package/onecode/agent/__init__.py +0 -0
- package/onecode/agent/__pycache__/__init__.cpython-314.pyc +0 -0
- package/onecode/agent/__pycache__/cdh_loader.cpython-314.pyc +0 -0
- package/onecode/agent/__pycache__/context.cpython-314.pyc +0 -0
- package/onecode/agent/__pycache__/engine.cpython-314.pyc +0 -0
- package/onecode/agent/__pycache__/hooks.cpython-314.pyc +0 -0
- package/onecode/agent/__pycache__/onecode_agent_acp.cpython-314.pyc +0 -0
- package/onecode/agent/__pycache__/permissions.cpython-314.pyc +0 -0
- package/onecode/agent/__pycache__/permissions_store.cpython-314.pyc +0 -0
- package/onecode/agent/__pycache__/project_doc.cpython-314.pyc +0 -0
- package/onecode/agent/__pycache__/session.cpython-314.pyc +0 -0
- package/onecode/agent/agents/__init__.py +0 -29
- package/onecode/agent/agents/__pycache__/__init__.cpython-314.pyc +0 -0
- package/onecode/agent/agents/__pycache__/types.cpython-314.pyc +0 -0
- package/onecode/agent/agents/types.py +0 -589
- package/onecode/agent/attachments.py +0 -112
- package/onecode/agent/cdh_loader.py +0 -267
- package/onecode/agent/context.py +0 -343
- package/onecode/agent/engine.py +0 -2700
- package/onecode/agent/hooks.py +0 -86
- package/onecode/agent/onecode_agent_acp.py +0 -2743
- package/onecode/agent/onecode_agent_acp.py.bak +0 -2447
- package/onecode/agent/permissions.py +0 -150
- package/onecode/agent/permissions_store.py +0 -62
- package/onecode/agent/project_doc.py +0 -19
- package/onecode/agent/session.py +0 -195
- package/onecode/agent/snapshot.py +0 -144
- package/onecode/agent/tools/__init__.py +0 -17
- package/onecode/agent/tools/__pycache__/__init__.cpython-314.pyc +0 -0
- package/onecode/agent/tools/__pycache__/agent_tools.cpython-314.pyc +0 -0
- package/onecode/agent/tools/__pycache__/apply_patch_tool.cpython-314.pyc +0 -0
- package/onecode/agent/tools/__pycache__/bash_tool.cpython-314.pyc +0 -0
- package/onecode/agent/tools/__pycache__/communication_tools.cpython-314.pyc +0 -0
- package/onecode/agent/tools/__pycache__/config_tool.cpython-314.pyc +0 -0
- package/onecode/agent/tools/__pycache__/cron_tools.cpython-314.pyc +0 -0
- package/onecode/agent/tools/__pycache__/errors.cpython-314.pyc +0 -0
- package/onecode/agent/tools/__pycache__/file_ops.cpython-314.pyc +0 -0
- package/onecode/agent/tools/__pycache__/file_tools.cpython-314.pyc +0 -0
- package/onecode/agent/tools/__pycache__/git_tools.cpython-314.pyc +0 -0
- package/onecode/agent/tools/__pycache__/lsp_tools.cpython-314.pyc +0 -0
- package/onecode/agent/tools/__pycache__/mcp_tools.cpython-314.pyc +0 -0
- package/onecode/agent/tools/__pycache__/permission_handler.cpython-314.pyc +0 -0
- package/onecode/agent/tools/__pycache__/permissions.cpython-314.pyc +0 -0
- package/onecode/agent/tools/__pycache__/protocol.cpython-314.pyc +0 -0
- package/onecode/agent/tools/__pycache__/registry.cpython-314.pyc +0 -0
- package/onecode/agent/tools/__pycache__/sandbox.cpython-314.pyc +0 -0
- package/onecode/agent/tools/__pycache__/schema_validation.cpython-314.pyc +0 -0
- package/onecode/agent/tools/__pycache__/skill_tools.cpython-314.pyc +0 -0
- package/onecode/agent/tools/__pycache__/todo_tools.cpython-314.pyc +0 -0
- package/onecode/agent/tools/__pycache__/web_tools.cpython-314.pyc +0 -0
- package/onecode/agent/tools/agent_tools.py +0 -132
- package/onecode/agent/tools/apply_patch_tool.py +0 -138
- package/onecode/agent/tools/bash_tool.py +0 -111
- package/onecode/agent/tools/communication_tools.py +0 -148
- package/onecode/agent/tools/config_tool.py +0 -130
- package/onecode/agent/tools/cron_tools.py +0 -178
- package/onecode/agent/tools/errors.py +0 -17
- package/onecode/agent/tools/file_ops.py +0 -221
- package/onecode/agent/tools/file_tools.py +0 -225
- package/onecode/agent/tools/git_tools.py +0 -88
- package/onecode/agent/tools/lsp_tools.py +0 -404
- package/onecode/agent/tools/mcp_tools.py +0 -127
- package/onecode/agent/tools/permission_handler.py +0 -46
- package/onecode/agent/tools/permissions.py +0 -77
- package/onecode/agent/tools/protocol.py +0 -20
- package/onecode/agent/tools/registry.py +0 -201
- package/onecode/agent/tools/sandbox.py +0 -358
- package/onecode/agent/tools/schema_validation.py +0 -100
- package/onecode/agent/tools/skill_tools.py +0 -52
- package/onecode/agent/tools/todo_tools.py +0 -207
- package/onecode/agent/tools/web_tools.py +0 -169
- package/onecode/builtin_skills/agent-browser/SKILL.md +0 -212
- package/onecode/builtin_skills/agent-browser/skill.yaml +0 -8
- package/onecode/builtin_skills/git/SKILL.md +0 -64
- package/onecode/builtin_skills/git/skill.yaml +0 -7
- package/onecode/builtin_skills/shell/SKILL.md +0 -58
- package/onecode/builtin_skills/shell/skill.yaml +0 -8
- package/onecode/builtin_skills/skill-creator/SKILL.md +0 -106
- package/onecode/builtin_skills/skill-creator/skill.yaml +0 -8
- package/onecode/cli.py +0 -935
- package/onecode/cloud/__init__.py +0 -0
- package/onecode/cloud/base.py +0 -20
- package/onecode/codebase/__init__.py +0 -69
- package/onecode/codebase/__pycache__/__init__.cpython-314.pyc +0 -0
- package/onecode/codebase/__pycache__/chunker.cpython-314.pyc +0 -0
- package/onecode/codebase/__pycache__/indexer.cpython-314.pyc +0 -0
- package/onecode/codebase/__pycache__/retriever.cpython-314.pyc +0 -0
- package/onecode/codebase/__pycache__/storage.cpython-314.pyc +0 -0
- package/onecode/codebase/__pycache__/tools.cpython-314.pyc +0 -0
- package/onecode/codebase/chunker.py +0 -125
- package/onecode/codebase/indexer.py +0 -149
- package/onecode/codebase/retriever.py +0 -203
- package/onecode/codebase/storage.py +0 -131
- package/onecode/codebase/tools.py +0 -59
- package/onecode/commands.py +0 -596
- package/onecode/config.py +0 -314
- package/onecode/config_screen.py +0 -600
- package/onecode/cron/__init__.py +0 -3
- package/onecode/lsp/__init__.py +0 -3
- package/onecode/mcp/__init__.py +0 -4
- package/onecode/mcp/__pycache__/__init__.cpython-314.pyc +0 -0
- package/onecode/mcp/__pycache__/client.cpython-314.pyc +0 -0
- package/onecode/mcp/__pycache__/manager.cpython-314.pyc +0 -0
- package/onecode/mcp/client.py +0 -193
- package/onecode/mcp/manager.py +0 -190
- package/onecode/memory/__init__.py +0 -49
- package/onecode/memory/__pycache__/__init__.cpython-314.pyc +0 -0
- package/onecode/memory/__pycache__/backend.cpython-314.pyc +0 -0
- package/onecode/memory/__pycache__/offload.cpython-314.pyc +0 -0
- package/onecode/memory/__pycache__/pyramid.cpython-314.pyc +0 -0
- package/onecode/memory/__pycache__/recall.cpython-314.pyc +0 -0
- package/onecode/memory/__pycache__/symbolic.cpython-314.pyc +0 -0
- package/onecode/memory/backend.py +0 -159
- package/onecode/memory/pyramid.py +0 -133
- package/onecode/memory/recall.py +0 -203
- package/onecode/migrate.py +0 -122
- package/onecode/models/__init__.py +0 -4
- package/onecode/models/__pycache__/__init__.cpython-314.pyc +0 -0
- package/onecode/models/__pycache__/errors.cpython-314.pyc +0 -0
- package/onecode/models/__pycache__/messages.cpython-314.pyc +0 -0
- package/onecode/models/__pycache__/provider.cpython-314.pyc +0 -0
- package/onecode/models/__pycache__/registry.cpython-314.pyc +0 -0
- package/onecode/models/errors.py +0 -104
- package/onecode/models/messages.py +0 -739
- package/onecode/models/provider.py +0 -699
- package/onecode/models/providers/__init__.py +0 -17
- package/onecode/models/providers/__pycache__/__init__.cpython-314.pyc +0 -0
- package/onecode/models/providers/__pycache__/anthropic_provider.cpython-314.pyc +0 -0
- package/onecode/models/providers/__pycache__/deepseek_provider.cpython-314.pyc +0 -0
- package/onecode/models/providers/__pycache__/glm_provider.cpython-314.pyc +0 -0
- package/onecode/models/providers/__pycache__/minimax_provider.cpython-314.pyc +0 -0
- package/onecode/models/providers/__pycache__/minimaxi_provider.cpython-314.pyc +0 -0
- package/onecode/models/providers/__pycache__/ollama_provider.cpython-314.pyc +0 -0
- package/onecode/models/providers/__pycache__/openai_provider.cpython-314.pyc +0 -0
- package/onecode/models/providers/anthropic_provider.py +0 -273
- package/onecode/models/providers/deepseek_provider.py +0 -212
- package/onecode/models/providers/glm_provider.py +0 -195
- package/onecode/models/providers/minimax_provider.py +0 -158
- package/onecode/models/providers/minimaxi_provider.py +0 -417
- package/onecode/models/providers/ollama_provider.py +0 -100
- package/onecode/models/providers/openai_provider.py +0 -237
- package/onecode/models/registry.py +0 -212
- package/onecode/server/__init__.py +0 -3
- package/onecode/server/app.py +0 -224
- package/onecode/skills/__init__.py +0 -11
- package/onecode/skills/__pycache__/__init__.cpython-314.pyc +0 -0
- package/onecode/skills/__pycache__/argument_substitution.cpython-314.pyc +0 -0
- package/onecode/skills/__pycache__/bootstrap.cpython-314.pyc +0 -0
- package/onecode/skills/__pycache__/create.cpython-314.pyc +0 -0
- package/onecode/skills/__pycache__/frontmatter.cpython-314.pyc +0 -0
- package/onecode/skills/__pycache__/loader.cpython-314.pyc +0 -0
- package/onecode/skills/__pycache__/manager.cpython-314.pyc +0 -0
- package/onecode/skills/__pycache__/model.cpython-314.pyc +0 -0
- package/onecode/skills/argument_substitution.py +0 -38
- package/onecode/skills/bootstrap.py +0 -124
- package/onecode/skills/create.py +0 -56
- package/onecode/skills/frontmatter.py +0 -33
- package/onecode/skills/loader.py +0 -139
- package/onecode/skills/manager.py +0 -75
- package/onecode/skills/model.py +0 -43
- package/onecode/storage/__init__.py +0 -0
- package/onecode/storage/activity.py +0 -63
- package/onecode/storage/project.py +0 -54
- package/onecode/storage/session.py +0 -112
- package/onecode/tasks/__init__.py +0 -26
- package/onecode/tasks/manager.py +0 -232
- package/onecode/tasks/models.py +0 -240
- package/onecode/trace/__init__.py +0 -0
- package/onecode/trace/tracer.py +0 -173
- package/onecode/utils/__init__.py +0 -0
- package/onecode/utils/helpers.py +0 -20
- package/pyproject.toml +0 -74
- package/tui/__init__.py +0 -46
- package/tui/__main__.py +0 -4
- package/tui/__pycache__/__init__.cpython-314.pyc +0 -0
- package/tui/__pycache__/_loop.cpython-314.pyc +0 -0
- package/tui/__pycache__/_path_fuzzy_search.cpython-314.pyc +0 -0
- package/tui/__pycache__/_path_match.cpython-314.pyc +0 -0
- package/tui/__pycache__/about.cpython-314.pyc +0 -0
- package/tui/__pycache__/agent.cpython-314.pyc +0 -0
- package/tui/__pycache__/agent_schema.cpython-314.pyc +0 -0
- package/tui/__pycache__/agents.cpython-314.pyc +0 -0
- package/tui/__pycache__/answer.cpython-314.pyc +0 -0
- package/tui/__pycache__/app.cpython-313.pyc +0 -0
- package/tui/__pycache__/app.cpython-314.pyc +0 -0
- package/tui/__pycache__/atomic.cpython-314.pyc +0 -0
- package/tui/__pycache__/complete.cpython-314.pyc +0 -0
- package/tui/__pycache__/constants.cpython-314.pyc +0 -0
- package/tui/__pycache__/conversation_markdown.cpython-314.pyc +0 -0
- package/tui/__pycache__/danger.cpython-314.pyc +0 -0
- package/tui/__pycache__/db.cpython-314.pyc +0 -0
- package/tui/__pycache__/dec.cpython-314.pyc +0 -0
- package/tui/__pycache__/directory.cpython-314.pyc +0 -0
- package/tui/__pycache__/directory_suggester.cpython-314.pyc +0 -0
- package/tui/__pycache__/directory_watcher.cpython-314.pyc +0 -0
- package/tui/__pycache__/format_path.cpython-314.pyc +0 -0
- package/tui/__pycache__/fuzzy.cpython-314.pyc +0 -0
- package/tui/__pycache__/fuzzy_index.cpython-314.pyc +0 -0
- package/tui/__pycache__/history.cpython-314.pyc +0 -0
- package/tui/__pycache__/jsonrpc.cpython-314.pyc +0 -0
- package/tui/__pycache__/menus.cpython-314.pyc +0 -0
- package/tui/__pycache__/message_log.cpython-314.pyc +0 -0
- package/tui/__pycache__/messages.cpython-314.pyc +0 -0
- package/tui/__pycache__/path_complete.cpython-314.pyc +0 -0
- package/tui/__pycache__/path_filter.cpython-314.pyc +0 -0
- package/tui/__pycache__/paths.cpython-314.pyc +0 -0
- package/tui/__pycache__/pill.cpython-314.pyc +0 -0
- package/tui/__pycache__/platform_commands.cpython-314.pyc +0 -0
- package/tui/__pycache__/protocol.cpython-314.pyc +0 -0
- package/tui/__pycache__/session_tracker.cpython-314.pyc +0 -0
- package/tui/__pycache__/settings.cpython-314.pyc +0 -0
- package/tui/__pycache__/settings_schema.cpython-314.pyc +0 -0
- package/tui/__pycache__/shell.cpython-314.pyc +0 -0
- package/tui/__pycache__/shell_read.cpython-314.pyc +0 -0
- package/tui/__pycache__/slash_command.cpython-314.pyc +0 -0
- package/tui/__pycache__/version.cpython-314.pyc +0 -0
- package/tui/_loop.py +0 -86
- package/tui/_path_fuzzy_search.py +0 -48
- package/tui/_path_match.py +0 -141
- package/tui/about.py +0 -95
- package/tui/acp/__pycache__/agent.cpython-314.pyc +0 -0
- package/tui/acp/__pycache__/api.cpython-314.pyc +0 -0
- package/tui/acp/__pycache__/encode_tool_call_id.cpython-314.pyc +0 -0
- package/tui/acp/__pycache__/messages.cpython-314.pyc +0 -0
- package/tui/acp/__pycache__/prompt.cpython-314.pyc +0 -0
- package/tui/acp/__pycache__/protocol.cpython-314.pyc +0 -0
- package/tui/acp/agent.py +0 -1002
- package/tui/acp/api.py +0 -73
- package/tui/acp/encode_tool_call_id.py +0 -12
- package/tui/acp/messages.py +0 -203
- package/tui/acp/prompt.py +0 -53
- package/tui/acp/protocol.py +0 -499
- package/tui/agent.py +0 -70
- package/tui/agent_schema.py +0 -76
- package/tui/agents.py +0 -46
- package/tui/ansi/__init__.py +0 -1
- package/tui/ansi/__pycache__/__init__.cpython-314.pyc +0 -0
- package/tui/ansi/__pycache__/_ansi.cpython-314.pyc +0 -0
- package/tui/ansi/__pycache__/_ansi_colors.cpython-314.pyc +0 -0
- package/tui/ansi/__pycache__/_control_codes.cpython-314.pyc +0 -0
- package/tui/ansi/__pycache__/_keys.cpython-314.pyc +0 -0
- package/tui/ansi/__pycache__/_sgr_styles.cpython-314.pyc +0 -0
- package/tui/ansi/__pycache__/_stream_parser.cpython-314.pyc +0 -0
- package/tui/ansi/_ansi.py +0 -1689
- package/tui/ansi/_ansi_colors.py +0 -264
- package/tui/ansi/_control_codes.py +0 -37
- package/tui/ansi/_keys.py +0 -251
- package/tui/ansi/_sgr_styles.py +0 -64
- package/tui/ansi/_stream_parser.py +0 -418
- package/tui/answer.py +0 -12
- package/tui/app.py +0 -1266
- package/tui/atomic.py +0 -37
- package/tui/cli.py +0 -313
- package/tui/code_analyze.py +0 -27
- package/tui/complete.py +0 -38
- package/tui/constants.py +0 -61
- package/tui/conversation_markdown.py +0 -30
- package/tui/danger.py +0 -372
- package/tui/data/agents/ampcode.com.toml +0 -52
- package/tui/data/agents/augmentcode.com.toml +0 -41
- package/tui/data/agents/cdh.cloud-dev-harness.toml +0 -23
- package/tui/data/agents/claude.com.toml +0 -41
- package/tui/data/agents/copilot.github.com.toml +0 -29
- package/tui/data/agents/crowai.dev.toml +0 -36
- package/tui/data/agents/cursor.com.toml +0 -38
- package/tui/data/agents/deepagents.langchain.com +0 -34
- package/tui/data/agents/docker.com.toml +0 -60
- package/tui/data/agents/geminicli.com.toml +0 -28
- package/tui/data/agents/goose.ai.toml +0 -52
- package/tui/data/agents/inference.huggingface.co.toml +0 -41
- package/tui/data/agents/kimi.com.toml +0 -35
- package/tui/data/agents/kiro.dev.toml +0 -43
- package/tui/data/agents/onecode.dev.toml +0 -22
- package/tui/data/agents/openai.com.toml +0 -53
- package/tui/data/agents/openclaw.ai.toml +0 -37
- package/tui/data/agents/opencode.ai.toml +0 -39
- package/tui/data/agents/openhands.dev.toml +0 -46
- package/tui/data/agents/stakpak.dev.toml +0 -62
- package/tui/data/agents/vibe.mistral.ai.toml +0 -31
- package/tui/data/agents/vtcode.dev.toml +0 -63
- package/tui/data/images/frog.png +0 -0
- package/tui/data/sounds/question.wav +0 -0
- package/tui/data/sounds/turn-over.wav +0 -0
- package/tui/db.py +0 -213
- package/tui/dec.py +0 -332
- package/tui/directory.py +0 -234
- package/tui/directory_suggester.py +0 -93
- package/tui/directory_watcher.py +0 -231
- package/tui/format_path.py +0 -25
- package/tui/fuzzy.py +0 -140
- package/tui/fuzzy_index.py +0 -275
- package/tui/gist.py +0 -33
- package/tui/history.py +0 -138
- package/tui/jsonrpc.py +0 -578
- package/tui/menus.py +0 -14
- package/tui/message_log.py +0 -69
- package/tui/messages.py +0 -144
- package/tui/option_content.py +0 -51
- package/tui/os.py +0 -0
- package/tui/path_complete.py +0 -217
- package/tui/path_filter.py +0 -124
- package/tui/paths.py +0 -87
- package/tui/pill.py +0 -23
- package/tui/platform_commands.py +0 -52
- package/tui/prompt/__pycache__/extract.cpython-314.pyc +0 -0
- package/tui/prompt/__pycache__/resource.cpython-314.pyc +0 -0
- package/tui/prompt/extract.py +0 -19
- package/tui/prompt/resource.py +0 -68
- package/tui/protocol.py +0 -28
- package/tui/screens/__init__.py +0 -0
- package/tui/screens/__pycache__/__init__.cpython-314.pyc +0 -0
- package/tui/screens/__pycache__/agent_modal.cpython-314.pyc +0 -0
- package/tui/screens/__pycache__/component_picker.cpython-314.pyc +0 -0
- package/tui/screens/__pycache__/diff_screen.cpython-314.pyc +0 -0
- package/tui/screens/__pycache__/log.cpython-314.pyc +0 -0
- package/tui/screens/__pycache__/main.cpython-313.pyc +0 -0
- package/tui/screens/__pycache__/main.cpython-314.pyc +0 -0
- package/tui/screens/__pycache__/permissions.cpython-314.pyc +0 -0
- package/tui/screens/__pycache__/projects_app.cpython-314.pyc +0 -0
- package/tui/screens/__pycache__/projects_screen.cpython-314.pyc +0 -0
- package/tui/screens/__pycache__/sessions.cpython-314.pyc +0 -0
- package/tui/screens/__pycache__/store.cpython-314.pyc +0 -0
- package/tui/screens/__pycache__/tool_content_screen.cpython-314.pyc +0 -0
- package/tui/screens/action_modal.py +0 -94
- package/tui/screens/agent_modal.py +0 -175
- package/tui/screens/command_edit_modal.py +0 -74
- package/tui/screens/component_picker.py +0 -168
- package/tui/screens/diff_screen.py +0 -84
- package/tui/screens/log.py +0 -553
- package/tui/screens/main.py +0 -385
- package/tui/screens/main.tcss +0 -655
- package/tui/screens/permissions.py +0 -404
- package/tui/screens/permissions.tcss +0 -72
- package/tui/screens/projects.tcss +0 -80
- package/tui/screens/projects_app.py +0 -347
- package/tui/screens/projects_screen.py +0 -284
- package/tui/screens/session_resume_modal.py +0 -172
- package/tui/screens/session_resume_modal.tcss +0 -35
- package/tui/screens/sessions.py +0 -164
- package/tui/screens/sessions.tcss +0 -119
- package/tui/screens/settings.py +0 -254
- package/tui/screens/settings.tcss +0 -101
- package/tui/screens/store.py +0 -500
- package/tui/screens/store.tcss +0 -274
- package/tui/screens/tool_content_screen.py +0 -59
- package/tui/session_tracker.py +0 -123
- package/tui/settings.py +0 -353
- package/tui/settings_schema.py +0 -431
- package/tui/shell.py +0 -304
- package/tui/shell_read.py +0 -42
- package/tui/slash_command.py +0 -34
- package/tui/tui.tcss +0 -246
- package/tui/twitter.py +0 -38
- package/tui/version.py +0 -80
- package/tui/visuals/__init__.py +0 -0
- package/tui/visuals/__pycache__/__init__.cpython-314.pyc +0 -0
- package/tui/visuals/__pycache__/columns.cpython-314.pyc +0 -0
- package/tui/visuals/columns.py +0 -272
- package/tui/widgets/__init__.py +0 -0
- package/tui/widgets/__pycache__/__init__.cpython-314.pyc +0 -0
- package/tui/widgets/__pycache__/acp_content.cpython-314.pyc +0 -0
- package/tui/widgets/__pycache__/agent_response.cpython-314.pyc +0 -0
- package/tui/widgets/__pycache__/agent_thought.cpython-314.pyc +0 -0
- package/tui/widgets/__pycache__/ask_user.cpython-314.pyc +0 -0
- package/tui/widgets/__pycache__/condensed_path.cpython-314.pyc +0 -0
- package/tui/widgets/__pycache__/context_stats.cpython-314.pyc +0 -0
- package/tui/widgets/__pycache__/conversation.cpython-314.pyc +0 -0
- package/tui/widgets/__pycache__/diff_view.cpython-314.pyc +0 -0
- package/tui/widgets/__pycache__/directory_input.cpython-314.pyc +0 -0
- package/tui/widgets/__pycache__/flash.cpython-314.pyc +0 -0
- package/tui/widgets/__pycache__/future_text.cpython-314.pyc +0 -0
- package/tui/widgets/__pycache__/grid_select.cpython-314.pyc +0 -0
- package/tui/widgets/__pycache__/highlighted_textarea.cpython-314.pyc +0 -0
- package/tui/widgets/__pycache__/load_more.cpython-314.pyc +0 -0
- package/tui/widgets/__pycache__/mandelbrot.cpython-314.pyc +0 -0
- package/tui/widgets/__pycache__/markdown_note.cpython-314.pyc +0 -0
- package/tui/widgets/__pycache__/menu.cpython-314.pyc +0 -0
- package/tui/widgets/__pycache__/modified_files.cpython-314.pyc +0 -0
- package/tui/widgets/__pycache__/non_selectable_label.cpython-314.pyc +0 -0
- package/tui/widgets/__pycache__/note.cpython-314.pyc +0 -0
- package/tui/widgets/__pycache__/path_search.cpython-314.pyc +0 -0
- package/tui/widgets/__pycache__/plan.cpython-314.pyc +0 -0
- package/tui/widgets/__pycache__/project_directory_tree.cpython-314.pyc +0 -0
- package/tui/widgets/__pycache__/project_grid_select.cpython-314.pyc +0 -0
- package/tui/widgets/__pycache__/project_summary.cpython-314.pyc +0 -0
- package/tui/widgets/__pycache__/prompt.cpython-314.pyc +0 -0
- package/tui/widgets/__pycache__/question.cpython-314.pyc +0 -0
- package/tui/widgets/__pycache__/session_grid_select.cpython-314.pyc +0 -0
- package/tui/widgets/__pycache__/session_summary.cpython-314.pyc +0 -0
- package/tui/widgets/__pycache__/session_tabs.cpython-314.pyc +0 -0
- package/tui/widgets/__pycache__/shell_result.cpython-314.pyc +0 -0
- package/tui/widgets/__pycache__/shell_terminal.cpython-314.pyc +0 -0
- package/tui/widgets/__pycache__/side_bar.cpython-314.pyc +0 -0
- package/tui/widgets/__pycache__/slash_complete.cpython-314.pyc +0 -0
- package/tui/widgets/__pycache__/strike_text.cpython-314.pyc +0 -0
- package/tui/widgets/__pycache__/subagent.cpython-314.pyc +0 -0
- package/tui/widgets/__pycache__/subagent_screen.cpython-314.pyc +0 -0
- package/tui/widgets/__pycache__/terminal.cpython-314.pyc +0 -0
- package/tui/widgets/__pycache__/throbber.cpython-314.pyc +0 -0
- package/tui/widgets/__pycache__/tool_call.cpython-314.pyc +0 -0
- package/tui/widgets/__pycache__/user_input.cpython-314.pyc +0 -0
- package/tui/widgets/acp_content.py +0 -70
- package/tui/widgets/agent_response.py +0 -76
- package/tui/widgets/agent_thought.py +0 -167
- package/tui/widgets/ask_user.py +0 -264
- package/tui/widgets/command_pane.py +0 -223
- package/tui/widgets/condensed_path.py +0 -115
- package/tui/widgets/context_stats.py +0 -66
- package/tui/widgets/conversation.py +0 -2641
- package/tui/widgets/danger_warning.py +0 -65
- package/tui/widgets/diff_view.py +0 -69
- package/tui/widgets/directory_input.py +0 -8
- package/tui/widgets/flash.py +0 -81
- package/tui/widgets/future_text.py +0 -126
- package/tui/widgets/grid_select.py +0 -234
- package/tui/widgets/highlighted_textarea.py +0 -180
- package/tui/widgets/load_more.py +0 -24
- package/tui/widgets/mandelbrot.py +0 -294
- package/tui/widgets/markdown_note.py +0 -13
- package/tui/widgets/menu.py +0 -147
- package/tui/widgets/modified_files.py +0 -306
- package/tui/widgets/non_selectable_label.py +0 -5
- package/tui/widgets/note.py +0 -18
- package/tui/widgets/path_search.py +0 -492
- package/tui/widgets/plan.py +0 -285
- package/tui/widgets/project_directory_tree.py +0 -102
- package/tui/widgets/project_grid_select.py +0 -64
- package/tui/widgets/project_summary.py +0 -33
- package/tui/widgets/prompt.py +0 -795
- package/tui/widgets/question.py +0 -360
- package/tui/widgets/session_grid_select.py +0 -230
- package/tui/widgets/session_summary.py +0 -115
- package/tui/widgets/session_tabs.py +0 -188
- package/tui/widgets/shell_result.py +0 -35
- package/tui/widgets/shell_terminal.py +0 -40
- package/tui/widgets/side_bar.py +0 -124
- package/tui/widgets/slash_complete.py +0 -235
- package/tui/widgets/strike_text.py +0 -70
- package/tui/widgets/subagent.py +0 -287
- package/tui/widgets/subagent_screen.py +0 -709
- package/tui/widgets/terminal.py +0 -576
- package/tui/widgets/terminal_tool.py +0 -360
- package/tui/widgets/throbber.py +0 -100
- package/tui/widgets/tool_call.py +0 -398
- package/tui/widgets/user_input.py +0 -23
- package/tui/widgets/version.py +0 -5
- package/tui/widgets/welcome.py +0 -31
package/onecode/commands.py
DELETED
|
@@ -1,596 +0,0 @@
|
|
|
1
|
-
from __future__ import annotations
|
|
2
|
-
|
|
3
|
-
from typing import TYPE_CHECKING
|
|
4
|
-
|
|
5
|
-
from tui import platform_commands
|
|
6
|
-
|
|
7
|
-
if TYPE_CHECKING:
|
|
8
|
-
from tui.widgets.conversation import Conversation
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
_KNOWN_PROVIDERS = {
|
|
12
|
-
"anthropic": ["claude-3-opus", "claude-3-sonnet", "claude-3-haiku"],
|
|
13
|
-
"openai": ["gpt-4o", "gpt-4-turbo", "gpt-4o-mini"],
|
|
14
|
-
"deepseek": ["deepseek-chat", "deepseek-reasoner"],
|
|
15
|
-
"minimax": ["MiniMax-M2.7", "MiniMax-M2.5"],
|
|
16
|
-
"minimaxi": ["MiniMax-M2.7", "MiniMax-M2.5", "MiniMax-M3"],
|
|
17
|
-
"glm": ["glm-4-plus", "glm-4-flash"],
|
|
18
|
-
"ollama": [],
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
# ── small helpers ──────────────────────────────────────────────────────
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
def _load_cfg():
|
|
26
|
-
from onecode.config import load_config
|
|
27
|
-
return load_config()
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
def _save_cfg(cfg):
|
|
31
|
-
from onecode.config import save_config
|
|
32
|
-
save_config(cfg)
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
def _post_note(conversation, text):
|
|
36
|
-
from tui.widgets.markdown_note import MarkdownNote
|
|
37
|
-
return conversation.post(MarkdownNote(text))
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
async def _post(conversation, text):
|
|
41
|
-
await _post_note(conversation, text)
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
# ── status: one-shot snapshot of every onecode: setting ───────────────
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
async def _status(conversation: "Conversation", parameters: str) -> None:
|
|
48
|
-
"""Render a single capability panel: provider, model, mode, skills, MCP."""
|
|
49
|
-
cfg = _load_cfg()
|
|
50
|
-
from onecode.skills.loader import SkillLoader
|
|
51
|
-
from onecode.mcp.manager import MCPManager
|
|
52
|
-
|
|
53
|
-
skills = SkillLoader().get_all()
|
|
54
|
-
enabled_skills = sorted(n for n, s in skills.items() if s.enabled)
|
|
55
|
-
disabled_skills = sorted(n for n, s in skills.items() if not s.enabled)
|
|
56
|
-
|
|
57
|
-
servers = MCPManager().list()
|
|
58
|
-
enabled_mcps = sorted(s["name"] for s in servers if s.get("enabled", True))
|
|
59
|
-
disabled_mcps = sorted(s["name"] for s in servers if not s.get("enabled", True))
|
|
60
|
-
|
|
61
|
-
lines = [
|
|
62
|
-
"**onecode — current state**\n",
|
|
63
|
-
f"- **provider**: `{cfg.default_provider}`",
|
|
64
|
-
f"- **model**: `{cfg.default_model}`",
|
|
65
|
-
f"- **mode**: `{cfg.default_mode}` (build | plan | solo)",
|
|
66
|
-
f"- **log level**: `{cfg.log_level}`",
|
|
67
|
-
f"- **skills**: {len(enabled_skills)} enabled, {len(disabled_skills)} disabled",
|
|
68
|
-
]
|
|
69
|
-
if enabled_skills:
|
|
70
|
-
lines.append(f" - enabled: {', '.join(f'`{n}`' for n in enabled_skills)}")
|
|
71
|
-
if disabled_skills:
|
|
72
|
-
lines.append(f" - disabled: {', '.join(f'`{n}`' for n in disabled_skills)}")
|
|
73
|
-
lines.append(f"- **mcp servers**: {len(enabled_mcps)} enabled, {len(disabled_mcps)} disabled")
|
|
74
|
-
if enabled_mcps:
|
|
75
|
-
lines.append(f" - enabled: {', '.join(f'`{n}`' for n in enabled_mcps)}")
|
|
76
|
-
if disabled_mcps:
|
|
77
|
-
lines.append(f" - disabled: {', '.join(f'`{n}`' for n in disabled_mcps)}")
|
|
78
|
-
|
|
79
|
-
lines += [
|
|
80
|
-
"\n**What can I do here?**",
|
|
81
|
-
"- `/onecode:provider [set <name|n>]` — show / change LLM provider",
|
|
82
|
-
"- `/onecode:model [set <name|n>]` — show / change LLM model",
|
|
83
|
-
"- `/onecode:skill list|enable|disable|add|remove [name]`",
|
|
84
|
-
"- `/onecode:mcp list|enable|disable|add|remove [name|url]`",
|
|
85
|
-
"- `/onecode:help` — show this overview",
|
|
86
|
-
]
|
|
87
|
-
await _post(conversation, "\n".join(lines))
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
# ── provider ───────────────────────────────────────────────────────────
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
async def _provider(conversation: "Conversation", parameters: str) -> None:
|
|
94
|
-
cfg = _load_cfg()
|
|
95
|
-
args = parameters.strip().split()
|
|
96
|
-
sub = args[0].lower() if args else ""
|
|
97
|
-
|
|
98
|
-
if sub in ("", "show", "list"):
|
|
99
|
-
registered = sorted(_KNOWN_PROVIDERS.keys())
|
|
100
|
-
lines = [
|
|
101
|
-
"**LLM Provider**\n",
|
|
102
|
-
f"- current: `{cfg.default_provider}`",
|
|
103
|
-
f"- available ({len(registered)}):",
|
|
104
|
-
]
|
|
105
|
-
for i, name in enumerate(registered, 1):
|
|
106
|
-
marker = " ← active" if name == cfg.default_provider else ""
|
|
107
|
-
models = _KNOWN_PROVIDERS[name]
|
|
108
|
-
model_hint = f" models: {', '.join(models)}" if models else " models: (any local)"
|
|
109
|
-
lines.append(f" `{i}) {name}`{marker}{model_hint}")
|
|
110
|
-
lines += [
|
|
111
|
-
"\n**How to switch**",
|
|
112
|
-
"- `/onecode:provider set <name>` — e.g. `set minimaxi`",
|
|
113
|
-
"- `/onecode:provider set <n>` — by number from the list above",
|
|
114
|
-
"\n*Tip:* the provider change applies to new sessions; the current session keeps the active model until you start a new conversation.",
|
|
115
|
-
]
|
|
116
|
-
await _post(conversation, "\n".join(lines))
|
|
117
|
-
return
|
|
118
|
-
|
|
119
|
-
if sub == "set":
|
|
120
|
-
if len(args) < 2:
|
|
121
|
-
conversation.notify("Usage: /onecode:provider set <name|n>", title="/onecode:provider", severity="error")
|
|
122
|
-
return
|
|
123
|
-
target = args[1].strip()
|
|
124
|
-
registered = sorted(_KNOWN_PROVIDERS.keys())
|
|
125
|
-
if target.isdigit():
|
|
126
|
-
idx = int(target)
|
|
127
|
-
if 1 <= idx <= len(registered):
|
|
128
|
-
target = registered[idx - 1]
|
|
129
|
-
if target not in registered:
|
|
130
|
-
conversation.notify(
|
|
131
|
-
f"Unknown provider '{target}'. Use /onecode:provider to list available ones.",
|
|
132
|
-
title="/onecode:provider",
|
|
133
|
-
severity="error",
|
|
134
|
-
)
|
|
135
|
-
return
|
|
136
|
-
cfg.default_provider = target
|
|
137
|
-
_save_cfg(cfg)
|
|
138
|
-
try:
|
|
139
|
-
conversation.app.settings.set("provider", target)
|
|
140
|
-
except Exception:
|
|
141
|
-
pass
|
|
142
|
-
conversation.flash(f"onecode provider set to [b]{target}")
|
|
143
|
-
await _status(conversation, "")
|
|
144
|
-
return
|
|
145
|
-
|
|
146
|
-
await _post(conversation, _HELP_PROVIDER)
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
_HELP_PROVIDER = (
|
|
150
|
-
"**/onecode:provider** — show / switch the LLM provider\n\n"
|
|
151
|
-
"**Sub-commands**\n"
|
|
152
|
-
"- `(none)` or `show` — list registered providers with current marker\n"
|
|
153
|
-
"- `set <name>` — switch provider (name or list-number)\n\n"
|
|
154
|
-
"**Examples**\n"
|
|
155
|
-
"- `/onecode:provider` — show the picker\n"
|
|
156
|
-
"- `/onecode:provider set minimaxi` — switch by name\n"
|
|
157
|
-
"- `/onecode:provider set 3` — switch by list number"
|
|
158
|
-
)
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
# ── model ──────────────────────────────────────────────────────────────
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
async def _model(conversation: "Conversation", parameters: str) -> None:
|
|
165
|
-
cfg = _load_cfg()
|
|
166
|
-
args = parameters.strip().split()
|
|
167
|
-
sub = args[0].lower() if args else ""
|
|
168
|
-
|
|
169
|
-
provider = cfg.default_provider
|
|
170
|
-
known = _KNOWN_PROVIDERS.get(provider, [])
|
|
171
|
-
|
|
172
|
-
if sub in ("", "show", "list"):
|
|
173
|
-
lines = [
|
|
174
|
-
"**LLM Model**\n",
|
|
175
|
-
f"- provider: `{provider}`",
|
|
176
|
-
f"- current: `{cfg.default_model}`",
|
|
177
|
-
]
|
|
178
|
-
if known:
|
|
179
|
-
lines.append(f"- known models for `{provider}` ({len(known)}):")
|
|
180
|
-
for i, name in enumerate(known, 1):
|
|
181
|
-
marker = " ← active" if name == cfg.default_model else ""
|
|
182
|
-
lines.append(f" `{i}) {name}`{marker}")
|
|
183
|
-
else:
|
|
184
|
-
lines.append("- *(no preset list — type any model name)*")
|
|
185
|
-
lines += [
|
|
186
|
-
"\n**How to switch**",
|
|
187
|
-
"- `/onecode:model set <name>` — e.g. `set MiniMax-M2.7`",
|
|
188
|
-
"- `/onecode:model set <n>` — by number from the list above",
|
|
189
|
-
"- `/onecode:model set <any-string>` — for providers without a preset",
|
|
190
|
-
"\n*Tip:* changing the model mid-session does not retroactively update the active request; new turns will use the new model.",
|
|
191
|
-
]
|
|
192
|
-
await _post(conversation, "\n".join(lines))
|
|
193
|
-
return
|
|
194
|
-
|
|
195
|
-
if sub == "set":
|
|
196
|
-
if len(args) < 2:
|
|
197
|
-
conversation.notify("Usage: /onecode:model set <name|n>", title="/onecode:model", severity="error")
|
|
198
|
-
return
|
|
199
|
-
target = args[1].strip()
|
|
200
|
-
if target.isdigit() and known:
|
|
201
|
-
idx = int(target)
|
|
202
|
-
if 1 <= idx <= len(known):
|
|
203
|
-
target = known[idx - 1]
|
|
204
|
-
if not target:
|
|
205
|
-
conversation.notify("Model name required", title="/onecode:model", severity="error")
|
|
206
|
-
return
|
|
207
|
-
cfg.default_model = target
|
|
208
|
-
_save_cfg(cfg)
|
|
209
|
-
try:
|
|
210
|
-
conversation.app.settings.set("model", target)
|
|
211
|
-
except Exception:
|
|
212
|
-
pass
|
|
213
|
-
conversation.flash(f"onecode model set to [b]{target}")
|
|
214
|
-
await _status(conversation, "")
|
|
215
|
-
return
|
|
216
|
-
|
|
217
|
-
await _post(conversation, _HELP_MODEL)
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
_HELP_MODEL = (
|
|
221
|
-
"**/onecode:model** — show / switch the LLM model\n\n"
|
|
222
|
-
"**Sub-commands**\n"
|
|
223
|
-
"- `(none)` or `show` — list known models for the current provider\n"
|
|
224
|
-
"- `set <name>` — switch model (name or list-number)\n\n"
|
|
225
|
-
"**Examples**\n"
|
|
226
|
-
"- `/onecode:model` — show the picker for the current provider\n"
|
|
227
|
-
"- `/onecode:model set MiniMax-M2.7` — switch by name\n"
|
|
228
|
-
"- `/onecode:model set 1` — switch by list number"
|
|
229
|
-
)
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
# ── skill ──────────────────────────────────────────────────────────────
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
async def _skill(conversation: "Conversation", parameters: str) -> None:
|
|
236
|
-
from onecode.skills.manager import SkillManager
|
|
237
|
-
from onecode.skills.loader import SkillLoader
|
|
238
|
-
from onecode.skills.create import create_skill_scaffold
|
|
239
|
-
|
|
240
|
-
parts = parameters.strip().split()
|
|
241
|
-
sub = parts[0].lower() if parts else ""
|
|
242
|
-
rest = " ".join(parts[1:]) if len(parts) > 1 else ""
|
|
243
|
-
|
|
244
|
-
if sub in ("", "list", "show"):
|
|
245
|
-
skills = SkillLoader().get_all()
|
|
246
|
-
if not skills:
|
|
247
|
-
await _post(conversation, "**Skills**\n\n_No skills installed._\n\nUse `/onecode:skill add <name>` to scaffold a new one.")
|
|
248
|
-
return
|
|
249
|
-
lines = ["**Skills**\n"]
|
|
250
|
-
names = sorted(skills.keys())
|
|
251
|
-
for i, name in enumerate(names, 1):
|
|
252
|
-
s = skills[name]
|
|
253
|
-
marker = "✓" if s.enabled else "✗"
|
|
254
|
-
desc = s.description or "(no description)"
|
|
255
|
-
lines.append(f"- `{i}) {marker}` **{name}** — {desc}")
|
|
256
|
-
lines += [
|
|
257
|
-
"\n**How to manage**",
|
|
258
|
-
"- `/onecode:skill enable <name|n>` — turn on",
|
|
259
|
-
"- `/onecode:skill disable <name|n>` — turn off",
|
|
260
|
-
"- `/onecode:skill add <name>` — scaffold a new skill",
|
|
261
|
-
"- `/onecode:skill remove <name|n>` — delete a skill",
|
|
262
|
-
]
|
|
263
|
-
await _post(conversation, "\n".join(lines))
|
|
264
|
-
return
|
|
265
|
-
|
|
266
|
-
if sub == "enable" or sub == "disable":
|
|
267
|
-
if not rest.strip():
|
|
268
|
-
conversation.notify(f"Usage: /onecode:skill {sub} <name|n>", title=f"/onecode:skill {sub}", severity="error")
|
|
269
|
-
return
|
|
270
|
-
target = _resolve_indexed_name(conversation, rest.strip(), SkillLoader().get_all(), sub)
|
|
271
|
-
if target is None:
|
|
272
|
-
return
|
|
273
|
-
mgr = SkillManager()
|
|
274
|
-
mgr.enable(target, sub == "enable")
|
|
275
|
-
conversation.flash(f"skill [b]{target}[/b] {sub}d")
|
|
276
|
-
await _skill(conversation, "list")
|
|
277
|
-
return
|
|
278
|
-
|
|
279
|
-
if sub == "add":
|
|
280
|
-
name = rest.strip()
|
|
281
|
-
if not name:
|
|
282
|
-
conversation.notify("Usage: /onecode:skill add <name>", title="/onecode:skill add", severity="error")
|
|
283
|
-
return
|
|
284
|
-
mgr = SkillManager()
|
|
285
|
-
if mgr.get(name):
|
|
286
|
-
conversation.notify(f"Skill '{name}' already exists", title="/onecode:skill add", severity="error")
|
|
287
|
-
return
|
|
288
|
-
err = create_skill_scaffold(mgr.skills_dir, name, f"A skill for {name}")
|
|
289
|
-
if err:
|
|
290
|
-
conversation.notify(f"Error: {err}", title="/onecode:skill add", severity="error")
|
|
291
|
-
return
|
|
292
|
-
await _post(
|
|
293
|
-
conversation,
|
|
294
|
-
f"**Skill '{name}' created**\n\n"
|
|
295
|
-
f"- location: `{mgr.skills_dir / name}`\n"
|
|
296
|
-
f"- edit `SKILL.md` to add instructions\n"
|
|
297
|
-
f"- then `/onecode:skill list` to confirm it shows up",
|
|
298
|
-
)
|
|
299
|
-
return
|
|
300
|
-
|
|
301
|
-
if sub == "remove":
|
|
302
|
-
if not rest.strip():
|
|
303
|
-
conversation.notify("Usage: /onecode:skill remove <name|n>", title="/onecode:skill remove", severity="error")
|
|
304
|
-
return
|
|
305
|
-
target = _resolve_indexed_name(conversation, rest.strip(), SkillLoader().get_all(), sub)
|
|
306
|
-
if target is None:
|
|
307
|
-
return
|
|
308
|
-
SkillManager().remove(target)
|
|
309
|
-
conversation.flash(f"skill [b]{target}[/b] removed")
|
|
310
|
-
await _skill(conversation, "list")
|
|
311
|
-
return
|
|
312
|
-
|
|
313
|
-
if sub == "create":
|
|
314
|
-
name = rest.strip()
|
|
315
|
-
if not name:
|
|
316
|
-
conversation.notify("Usage: /onecode:skill create <name>", title="/onecode:skill create", severity="error")
|
|
317
|
-
return
|
|
318
|
-
from onecode.skills.model import Skill as SkillModel
|
|
319
|
-
valid, err_msg = SkillModel.validate_name(name)
|
|
320
|
-
if not valid:
|
|
321
|
-
conversation.notify(f"Invalid name: {err_msg}", title="/onecode:skill create", severity="error")
|
|
322
|
-
return
|
|
323
|
-
mgr = SkillManager()
|
|
324
|
-
if mgr.get(name):
|
|
325
|
-
conversation.notify(f"Skill '{name}' already exists", title="/onecode:skill create", severity="error")
|
|
326
|
-
return
|
|
327
|
-
err = create_skill_scaffold(mgr.skills_dir, name, f"A skill for {name}")
|
|
328
|
-
if err:
|
|
329
|
-
conversation.notify(f"Error: {err}", title="/onecode:skill create", severity="error")
|
|
330
|
-
return
|
|
331
|
-
await _post(
|
|
332
|
-
conversation,
|
|
333
|
-
f"**Skill '{name}' created**\n\n"
|
|
334
|
-
f"- location: `{mgr.skills_dir / name}`\n"
|
|
335
|
-
f"- edit `SKILL.md` to add instructions\n"
|
|
336
|
-
f"- then `/onecode:skill list` to confirm",
|
|
337
|
-
)
|
|
338
|
-
return
|
|
339
|
-
|
|
340
|
-
if sub in ("search", "find"):
|
|
341
|
-
keyword = rest.strip()
|
|
342
|
-
if not keyword:
|
|
343
|
-
conversation.notify("Usage: /onecode:skill search <keyword>", title="/onecode:skill search", severity="error")
|
|
344
|
-
return
|
|
345
|
-
results = SkillLoader().search(keyword)
|
|
346
|
-
if not results:
|
|
347
|
-
await _post(conversation, f"**Skill Search: `{keyword}`**\n\n_No matches found._")
|
|
348
|
-
return
|
|
349
|
-
lines = [f"**Skill Search: `{keyword}`**\n"]
|
|
350
|
-
for i, s in enumerate(results, 1):
|
|
351
|
-
marker = "✓" if s.enabled else "✗"
|
|
352
|
-
desc = s.description or "(no description)"
|
|
353
|
-
lines.append(f"- `{i}) {marker}` **{s.name}** — {desc}")
|
|
354
|
-
lines.append(f"\n{len(results)} match(es)")
|
|
355
|
-
await _post(conversation, "\n".join(lines))
|
|
356
|
-
return
|
|
357
|
-
|
|
358
|
-
await _post(conversation, _HELP_SKILL)
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
_HELP_SKILL = (
|
|
362
|
-
"**/onecode:skill** — manage installed skills\n\n"
|
|
363
|
-
"**Sub-commands**\n"
|
|
364
|
-
"- `(none)` or `list` — show all skills with status\n"
|
|
365
|
-
"- `create <name>` — scaffold a new skill\n"
|
|
366
|
-
"- `search <keyword>` — search skills by keyword\n"
|
|
367
|
-
"- `enable <name|n>` — turn a skill on\n"
|
|
368
|
-
"- `disable <name|n>` — turn a skill off\n"
|
|
369
|
-
"- `add <name>` — scaffold a new skill (alias for create)\n"
|
|
370
|
-
"- `remove <name|n>` — delete a skill\n\n"
|
|
371
|
-
"**Examples**\n"
|
|
372
|
-
"- `/onecode:skill` — list\n"
|
|
373
|
-
"- `/onecode:skill create my-skill` — scaffold a new skill\n"
|
|
374
|
-
"- `/onecode:skill search browser` — find browser-related skills\n"
|
|
375
|
-
"- `/onecode:skill enable 2` — enable the skill at index 2"
|
|
376
|
-
)
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
# ── mcp ────────────────────────────────────────────────────────────────
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
async def _mcp(conversation: "Conversation", parameters: str) -> None:
|
|
383
|
-
from onecode.mcp.manager import MCPManager
|
|
384
|
-
|
|
385
|
-
parts = parameters.strip().split()
|
|
386
|
-
sub = parts[0].lower() if parts else ""
|
|
387
|
-
rest = " ".join(parts[1:]) if len(parts) > 1 else ""
|
|
388
|
-
|
|
389
|
-
if sub in ("", "list", "show"):
|
|
390
|
-
servers = MCPManager().list()
|
|
391
|
-
if not servers:
|
|
392
|
-
await _post(
|
|
393
|
-
conversation,
|
|
394
|
-
"**MCP Servers**\n\n_None configured._\n\n"
|
|
395
|
-
"Use `/onecode:mcp add <name> <url>` for an SSE server, or "
|
|
396
|
-
"`/onecode:mcp add <name> --type stdio --command <cmd>` for stdio.",
|
|
397
|
-
)
|
|
398
|
-
return
|
|
399
|
-
lines = ["**MCP Servers**\n"]
|
|
400
|
-
for i, s in enumerate(servers, 1):
|
|
401
|
-
name = s.get("name", "?")
|
|
402
|
-
transport = s.get("transport", "sse")
|
|
403
|
-
enabled = s.get("enabled", True)
|
|
404
|
-
marker = "✓" if enabled else "✗"
|
|
405
|
-
if transport == "sse":
|
|
406
|
-
lines.append(f"- `{i}) {marker}` **{name}** (SSE) — `{s.get('url', '')}`")
|
|
407
|
-
else:
|
|
408
|
-
cmd = s.get("command", "")
|
|
409
|
-
args = " ".join(s.get("args") or [])
|
|
410
|
-
lines.append(f"- `{i}) {marker}` **{name}** (stdio) — `{cmd} {args}`".rstrip())
|
|
411
|
-
lines += [
|
|
412
|
-
"\n**How to manage**",
|
|
413
|
-
"- `/onecode:mcp enable <name|n>`",
|
|
414
|
-
"- `/onecode:mcp disable <name|n>`",
|
|
415
|
-
"- `/onecode:mcp remove <name|n>`",
|
|
416
|
-
]
|
|
417
|
-
await _post(conversation, "\n".join(lines))
|
|
418
|
-
return
|
|
419
|
-
|
|
420
|
-
if sub == "enable" or sub == "disable":
|
|
421
|
-
if not rest.strip():
|
|
422
|
-
conversation.notify(f"Usage: /onecode:mcp {sub} <name|n>", title=f"/onecode:mcp {sub}", severity="error")
|
|
423
|
-
return
|
|
424
|
-
mgr = MCPManager()
|
|
425
|
-
target = _resolve_indexed_name(conversation, rest.strip(), {s["name"]: s for s in mgr.list()}, sub)
|
|
426
|
-
if target is None:
|
|
427
|
-
return
|
|
428
|
-
err = mgr.enable(target, sub == "enable")
|
|
429
|
-
if err:
|
|
430
|
-
conversation.notify(f"Error: {err}", title=f"/onecode:mcp {sub}", severity="error")
|
|
431
|
-
return
|
|
432
|
-
conversation.flash(f"mcp server [b]{target}[/b] {sub}d")
|
|
433
|
-
await _mcp(conversation, "list")
|
|
434
|
-
return
|
|
435
|
-
|
|
436
|
-
if sub == "add":
|
|
437
|
-
args_parts = rest.split()
|
|
438
|
-
if len(args_parts) < 2:
|
|
439
|
-
await _post(
|
|
440
|
-
conversation,
|
|
441
|
-
"**/onecode:mcp add** — register a new MCP server\n\n"
|
|
442
|
-
"- **SSE** (default): `/onecode:mcp add <name> <url>`\n"
|
|
443
|
-
"- **stdio**: `/onecode:mcp add <name> --type stdio --command <cmd> --args a,b`",
|
|
444
|
-
)
|
|
445
|
-
return
|
|
446
|
-
name = args_parts[0]
|
|
447
|
-
url = args_parts[1]
|
|
448
|
-
mgr = MCPManager()
|
|
449
|
-
if mgr.get(name):
|
|
450
|
-
conversation.notify(f"MCP server '{name}' already exists", title="/onecode:mcp add", severity="error")
|
|
451
|
-
return
|
|
452
|
-
mgr.add(name, url, transport="sse")
|
|
453
|
-
await _post(
|
|
454
|
-
conversation,
|
|
455
|
-
f"**MCP Server '{name}' added**\n\n- transport: SSE\n- URL: `{url}`\n\nUse `/onecode:mcp list` to confirm.",
|
|
456
|
-
)
|
|
457
|
-
return
|
|
458
|
-
|
|
459
|
-
if sub == "remove":
|
|
460
|
-
if not rest.strip():
|
|
461
|
-
conversation.notify("Usage: /onecode:mcp remove <name|n>", title="/onecode:mcp remove", severity="error")
|
|
462
|
-
return
|
|
463
|
-
mgr = MCPManager()
|
|
464
|
-
target = _resolve_indexed_name(conversation, rest.strip(), {s["name"]: s for s in mgr.list()}, sub)
|
|
465
|
-
if target is None:
|
|
466
|
-
return
|
|
467
|
-
mgr.remove(target)
|
|
468
|
-
conversation.flash(f"mcp server [b]{target}[/b] removed")
|
|
469
|
-
await _mcp(conversation, "list")
|
|
470
|
-
return
|
|
471
|
-
|
|
472
|
-
await _post(conversation, _HELP_MCP)
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
_HELP_MCP = (
|
|
476
|
-
"**/onecode:mcp** — manage MCP (Model Context Protocol) servers\n\n"
|
|
477
|
-
"**Sub-commands**\n"
|
|
478
|
-
"- `(none)` or `list` — show configured servers\n"
|
|
479
|
-
"- `add <name> <url>` — add an SSE server\n"
|
|
480
|
-
"- `enable <name|n>` / `disable <name|n>`\n"
|
|
481
|
-
"- `remove <name|n>`\n\n"
|
|
482
|
-
"**Examples**\n"
|
|
483
|
-
"- `/onecode:mcp` — list servers\n"
|
|
484
|
-
"- `/onecode:mcp add my-server https://example.com/mcp`\n"
|
|
485
|
-
"- `/onecode:mcp disable 1` — disable the first server in the list"
|
|
486
|
-
)
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
# ── helpers ────────────────────────────────────────────────────────────
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
def _resolve_indexed_name(conversation, raw, items, sub_label):
|
|
493
|
-
"""Accept either a literal name or a 1-based index from the most recent list.
|
|
494
|
-
|
|
495
|
-
``items`` is either a ``dict[name, ...]`` (skills) or already indexed
|
|
496
|
-
by name (MCP). Returns the resolved name or ``None`` after notifying
|
|
497
|
-
the user on error.
|
|
498
|
-
"""
|
|
499
|
-
raw = (raw or "").strip()
|
|
500
|
-
if not raw:
|
|
501
|
-
return None
|
|
502
|
-
keys = list(items.keys())
|
|
503
|
-
if raw.isdigit():
|
|
504
|
-
idx = int(raw)
|
|
505
|
-
if 1 <= idx <= len(keys):
|
|
506
|
-
return keys[idx - 1]
|
|
507
|
-
conversation.notify(
|
|
508
|
-
f"Index {idx} out of range (1..{len(keys)}). Run `/onecode:{sub_label}` first to see numbers.",
|
|
509
|
-
title=f"/onecode:{sub_label}",
|
|
510
|
-
severity="error",
|
|
511
|
-
)
|
|
512
|
-
return None
|
|
513
|
-
if raw in items:
|
|
514
|
-
return raw
|
|
515
|
-
conversation.notify(
|
|
516
|
-
f"Unknown name '{raw}'. Run `/onecode:{sub_label}` first to see available names.",
|
|
517
|
-
title=f"/onecode:{sub_label}",
|
|
518
|
-
severity="error",
|
|
519
|
-
)
|
|
520
|
-
return None
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
# ── clear-todos ──────────────────────────────────────────────────────────
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
async def _clear_todos(conversation: "Conversation", parameters: str) -> None:
|
|
527
|
-
"""Clear all todos via the agent's session/clear_todos RPC."""
|
|
528
|
-
agent = conversation.agent
|
|
529
|
-
if agent is None:
|
|
530
|
-
conversation.notify("No active agent session", title="/clear-todos", severity="error")
|
|
531
|
-
return
|
|
532
|
-
if not hasattr(agent, "acp_session_clear_todos"):
|
|
533
|
-
conversation.notify("Agent does not support clear-todos", title="/clear-todos", severity="error")
|
|
534
|
-
return
|
|
535
|
-
try:
|
|
536
|
-
result = await agent.acp_session_clear_todos()
|
|
537
|
-
if result and result.get("cleared"):
|
|
538
|
-
conversation.notify("All todos cleared", title="/clear-todos")
|
|
539
|
-
else:
|
|
540
|
-
conversation.notify("Failed to clear todos", title="/clear-todos", severity="error")
|
|
541
|
-
except Exception as e:
|
|
542
|
-
conversation.notify(f"Failed to clear todos: {e}", title="/clear-todos", severity="error")
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
# ── registration ──────────────────────────────────────────────────────
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
def register_commands() -> None:
|
|
549
|
-
"""Register the slash commands exposed to the TUI prompt.
|
|
550
|
-
|
|
551
|
-
The help text intentionally covers both **what** the command does and
|
|
552
|
-
**how** to invoke it (sub-command + index syntax), so the
|
|
553
|
-
autocomplete panel is self-documenting.
|
|
554
|
-
"""
|
|
555
|
-
platform_commands.register(
|
|
556
|
-
"help",
|
|
557
|
-
"Show onecode: command overview and current state",
|
|
558
|
-
_status,
|
|
559
|
-
"(no args)",
|
|
560
|
-
)
|
|
561
|
-
platform_commands.register(
|
|
562
|
-
"status",
|
|
563
|
-
"Show current provider, model, mode, skills, and MCP servers",
|
|
564
|
-
_status,
|
|
565
|
-
"(no args)",
|
|
566
|
-
)
|
|
567
|
-
platform_commands.register(
|
|
568
|
-
"provider",
|
|
569
|
-
"Show / switch the LLM provider (current + numbered list)",
|
|
570
|
-
_provider,
|
|
571
|
-
"[set <name|n>]",
|
|
572
|
-
)
|
|
573
|
-
platform_commands.register(
|
|
574
|
-
"model",
|
|
575
|
-
"Show / switch the LLM model for the current provider",
|
|
576
|
-
_model,
|
|
577
|
-
"[set <name|n>]",
|
|
578
|
-
)
|
|
579
|
-
platform_commands.register(
|
|
580
|
-
"skill",
|
|
581
|
-
"Manage skills: list, create, search, enable, disable, add, remove (accepts name or list number)",
|
|
582
|
-
_skill,
|
|
583
|
-
"list|create|search|enable|disable|add|remove [name|n]",
|
|
584
|
-
)
|
|
585
|
-
platform_commands.register(
|
|
586
|
-
"mcp",
|
|
587
|
-
"Manage MCP servers: list, add, enable, disable, remove (accepts name or list number)",
|
|
588
|
-
_mcp,
|
|
589
|
-
"list|add|enable|disable|remove [name|n]",
|
|
590
|
-
)
|
|
591
|
-
platform_commands.register(
|
|
592
|
-
"clear-todos",
|
|
593
|
-
"Clear all plan todos — starts a fresh blank plan",
|
|
594
|
-
_clear_todos,
|
|
595
|
-
"(no args)",
|
|
596
|
-
)
|