@scemoon/cdh 1.0.0
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/ai-dlc-skill/SKILL.md +75 -0
- package/ai-dlc-skill/agents/deliver-agent.md +24 -0
- package/ai-dlc-skill/agents/master.md +44 -0
- package/ai-dlc-skill/agents/plan-agent.md +23 -0
- package/ai-dlc-skill/agents/understand-agent.md +23 -0
- package/ai-dlc-skill/agents/verify-agent.md +27 -0
- package/ai-dlc-skill/architecture/project-structure.md +78 -0
- package/ai-dlc-skill/brownfield/README.md +30 -0
- package/ai-dlc-skill/brownfield/generate-context.sh +64 -0
- package/ai-dlc-skill/brownfield/scripts/deps.sh +27 -0
- package/ai-dlc-skill/brownfield/scripts/discover.sh +34 -0
- package/ai-dlc-skill/brownfield/scripts/extract-api.sh +45 -0
- package/ai-dlc-skill/components/backend.md +34 -0
- package/ai-dlc-skill/components/desktop.md +30 -0
- package/ai-dlc-skill/components/mya.md +29 -0
- package/ai-dlc-skill/components/native.md +30 -0
- package/ai-dlc-skill/components/tta.md +29 -0
- package/ai-dlc-skill/components/web.md +31 -0
- package/ai-dlc-skill/components/wxa.md +29 -0
- package/ai-dlc-skill/contracts/README.md +25 -0
- package/ai-dlc-skill/core/adaptive-flow.md +36 -0
- package/ai-dlc-skill/core/security.md +29 -0
- package/ai-dlc-skill/cross-tool/cline/export.sh +31 -0
- package/ai-dlc-skill/cross-tool/copilot/export.sh +47 -0
- package/ai-dlc-skill/cross-tool/cursor/export.sh +32 -0
- package/ai-dlc-skill/cross-tool/export.sh +22 -0
- package/ai-dlc-skill/cross-tool/onecode/config.yaml.tpl +17 -0
- package/ai-dlc-skill/cross-tool/onecode/export-skills.sh +31 -0
- package/ai-dlc-skill/cross-tool/onecode/export.sh +48 -0
- package/ai-dlc-skill/phases/deliver/entry.md +26 -0
- package/ai-dlc-skill/phases/deliver/lifecycle.md +185 -0
- package/ai-dlc-skill/phases/deliver/prompt.md +40 -0
- package/ai-dlc-skill/phases/deliver/rules.md +61 -0
- package/ai-dlc-skill/phases/plan/entry.md +25 -0
- package/ai-dlc-skill/phases/plan/lifecycle.md +204 -0
- package/ai-dlc-skill/phases/plan/prompt.md +38 -0
- package/ai-dlc-skill/phases/plan/rules.md +25 -0
- package/ai-dlc-skill/phases/understand/entry.md +26 -0
- package/ai-dlc-skill/phases/understand/lifecycle.md +184 -0
- package/ai-dlc-skill/phases/understand/prompt.md +41 -0
- package/ai-dlc-skill/phases/understand/rules.md +37 -0
- package/ai-dlc-skill/phases/verify/entry.md +26 -0
- package/ai-dlc-skill/phases/verify/lifecycle.md +192 -0
- package/ai-dlc-skill/phases/verify/prompt.md +43 -0
- package/ai-dlc-skill/phases/verify/rules.md +73 -0
- package/ai-dlc-skill/practices/bdd.md +91 -0
- package/ai-dlc-skill/practices/sdd.md +84 -0
- package/ai-dlc-skill/practices/tdd.md +95 -0
- package/ai-dlc-skill/providers/README.md +114 -0
- package/ai-dlc-skill/providers/aliyun/deployment.yaml +66 -0
- package/ai-dlc-skill/providers/aliyun/preview.yaml +84 -0
- package/ai-dlc-skill/providers/aliyun/provider.yaml +160 -0
- package/ai-dlc-skill/providers/tcb/deployment.yaml +69 -0
- package/ai-dlc-skill/providers/tcb/preview.yaml +83 -0
- package/ai-dlc-skill/providers/tcb/provider.yaml +172 -0
- package/ai-dlc-skill/requirements.md +140 -0
- package/ai-dlc-skill/skill.yaml +147 -0
- package/ai-dlc-skill/templates/integration/CHANGELOG.md +41 -0
- package/ai-dlc-skill/templates/integration/asyncapi.yaml +43 -0
- package/ai-dlc-skill/templates/integration/contract-diff.md +63 -0
- package/ai-dlc-skill/templates/integration/contract-spec.md +49 -0
- package/ai-dlc-skill/templates/integration/openapi.yaml +18 -0
- package/ai-dlc-skill/templates/integration/runtime-contract.yaml +36 -0
- package/ai-dlc-skill/templates/plan/design.md +49 -0
- package/ai-dlc-skill/templates/plan/task-list.md +32 -0
- package/ai-dlc-skill/templates/project/README.md +127 -0
- package/ai-dlc-skill/templates/project/template.md +119 -0
- package/ai-dlc-skill/templates/understand/feature.feature +23 -0
- package/ai-dlc-skill/templates/understand/intent.md +29 -0
- package/ai-dlc-skill/templates/understand/spec-delta.md +47 -0
- package/ai-dlc-skill/templates/verify/test-unit.py +27 -0
- package/ai-dlc-skill/walkthrough/collect.sh +50 -0
- package/ai-dlc-skill/walkthrough/template.md +54 -0
- package/ai-dlc-skill/workflows/ai-dlc.yaml +110 -0
- package/ai-dlc-skill/workflows/deployment.yaml +199 -0
- package/cdh/__init__.py +0 -0
- package/cdh/__main__.py +4 -0
- package/cdh/__pycache__/__init__.cpython-313.pyc +0 -0
- package/cdh/__pycache__/__init__.cpython-314.pyc +0 -0
- package/cdh/__pycache__/cli.cpython-314.pyc +0 -0
- package/cdh/__pycache__/scaffold.cpython-313.pyc +0 -0
- package/cdh/__pycache__/scaffold.cpython-314.pyc +0 -0
- package/cdh/cli.py +361 -0
- package/cdh/scaffold.py +312 -0
- package/cli.js +2 -0
- package/onecode/__init__.py +1 -0
- package/onecode/__main__.py +4 -0
- 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__/mock_data.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_agent_acp.cpython-313.pyc +0 -0
- package/onecode/agent/__pycache__/cdh_agent_acp.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__/harness_skill.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__/session.cpython-314.pyc +0 -0
- package/onecode/agent/agents/__init__.py +29 -0
- 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 +662 -0
- package/onecode/agent/attachments.py +113 -0
- package/onecode/agent/cdh_loader.py +262 -0
- package/onecode/agent/context.py +338 -0
- package/onecode/agent/engine.py +1894 -0
- package/onecode/agent/hooks.py +86 -0
- package/onecode/agent/onecode_agent_acp.py +2203 -0
- package/onecode/agent/permissions.py +151 -0
- package/onecode/agent/permissions_store.py +62 -0
- package/onecode/agent/session.py +186 -0
- package/onecode/agent/snapshot.py +145 -0
- package/onecode/agent/tools/__init__.py +17 -0
- 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__/task_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 +134 -0
- package/onecode/agent/tools/apply_patch_tool.py +144 -0
- package/onecode/agent/tools/bash_tool.py +91 -0
- package/onecode/agent/tools/communication_tools.py +149 -0
- package/onecode/agent/tools/config_tool.py +130 -0
- package/onecode/agent/tools/cron_tools.py +179 -0
- package/onecode/agent/tools/errors.py +17 -0
- package/onecode/agent/tools/file_ops.py +187 -0
- package/onecode/agent/tools/file_tools.py +226 -0
- package/onecode/agent/tools/git_tools.py +88 -0
- package/onecode/agent/tools/lsp_tools.py +404 -0
- package/onecode/agent/tools/mcp_tools.py +129 -0
- package/onecode/agent/tools/permission_handler.py +46 -0
- package/onecode/agent/tools/permissions.py +77 -0
- package/onecode/agent/tools/protocol.py +20 -0
- package/onecode/agent/tools/registry.py +134 -0
- package/onecode/agent/tools/sandbox.py +264 -0
- package/onecode/agent/tools/schema_validation.py +100 -0
- package/onecode/agent/tools/skill_tools.py +52 -0
- package/onecode/agent/tools/task_tools.py +249 -0
- package/onecode/agent/tools/web_tools.py +170 -0
- package/onecode/builtin_skills/git/SKILL.md +64 -0
- package/onecode/builtin_skills/git/skill.yaml +7 -0
- package/onecode/builtin_skills/shell/SKILL.md +58 -0
- package/onecode/builtin_skills/shell/skill.yaml +8 -0
- package/onecode/cli.py +755 -0
- package/onecode/cloud/__init__.py +0 -0
- package/onecode/cloud/base.py +20 -0
- package/onecode/codebase/__init__.py +69 -0
- package/onecode/codebase/__pycache__/__init__.cpython-314.pyc +0 -0
- package/onecode/codebase/__pycache__/chunker.cpython-314.pyc +0 -0
- package/onecode/codebase/__pycache__/config.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 +130 -0
- package/onecode/codebase/indexer.py +136 -0
- package/onecode/codebase/retriever.py +192 -0
- package/onecode/codebase/storage.py +130 -0
- package/onecode/codebase/tools.py +59 -0
- package/onecode/commands.py +276 -0
- package/onecode/config.py +285 -0
- package/onecode/config_screen.py +594 -0
- package/onecode/cron/__init__.py +3 -0
- package/onecode/lsp/__init__.py +3 -0
- package/onecode/mcp/__init__.py +4 -0
- 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 +193 -0
- package/onecode/mcp/manager.py +191 -0
- package/onecode/memory/__init__.py +95 -0
- 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 +185 -0
- package/onecode/memory/offload.py +114 -0
- package/onecode/memory/pyramid.py +202 -0
- package/onecode/memory/recall.py +168 -0
- package/onecode/memory/symbolic.py +164 -0
- package/onecode/models/__init__.py +4 -0
- 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 +94 -0
- package/onecode/models/messages.py +662 -0
- package/onecode/models/provider.py +450 -0
- package/onecode/models/providers/__init__.py +17 -0
- 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__/mock_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 +224 -0
- package/onecode/models/providers/deepseek_provider.py +210 -0
- package/onecode/models/providers/glm_provider.py +154 -0
- package/onecode/models/providers/minimax_provider.py +154 -0
- package/onecode/models/providers/minimaxi_provider.py +363 -0
- package/onecode/models/providers/ollama_provider.py +96 -0
- package/onecode/models/providers/openai_provider.py +233 -0
- package/onecode/models/registry.py +212 -0
- package/onecode/server/__init__.py +3 -0
- package/onecode/server/app.py +224 -0
- package/onecode/skills/__init__.py +11 -0
- 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__/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 +39 -0
- package/onecode/skills/create.py +56 -0
- package/onecode/skills/frontmatter.py +33 -0
- package/onecode/skills/loader.py +157 -0
- package/onecode/skills/manager.py +75 -0
- package/onecode/skills/model.py +43 -0
- package/onecode/storage/__init__.py +0 -0
- package/onecode/storage/activity.py +64 -0
- package/onecode/storage/project.py +54 -0
- package/onecode/storage/session.py +113 -0
- package/onecode/tasks/__init__.py +26 -0
- package/onecode/tasks/manager.py +219 -0
- package/onecode/tasks/models.py +240 -0
- package/onecode/trace/__init__.py +0 -0
- package/onecode/trace/tracer.py +174 -0
- package/onecode/utils/__init__.py +0 -0
- package/onecode/utils/helpers.py +20 -0
- package/onecode-cli.js +2 -0
- package/package.json +32 -0
- package/pyproject.toml +60 -0
- package/run.js +86 -0
- package/tui/__init__.py +46 -0
- package/tui/__main__.py +4 -0
- 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__/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-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 +86 -0
- package/tui/_path_fuzzy_search.py +48 -0
- package/tui/_path_match.py +141 -0
- package/tui/about.py +95 -0
- 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 +886 -0
- package/tui/acp/api.py +55 -0
- package/tui/acp/encode_tool_call_id.py +12 -0
- package/tui/acp/messages.py +190 -0
- package/tui/acp/prompt.py +110 -0
- package/tui/acp/protocol.py +462 -0
- package/tui/agent.py +70 -0
- package/tui/agent_schema.py +76 -0
- package/tui/agents.py +45 -0
- package/tui/ansi/__init__.py +1 -0
- 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 +1689 -0
- package/tui/ansi/_ansi_colors.py +264 -0
- package/tui/ansi/_control_codes.py +37 -0
- package/tui/ansi/_keys.py +251 -0
- package/tui/ansi/_sgr_styles.py +64 -0
- package/tui/ansi/_stream_parser.py +418 -0
- package/tui/answer.py +12 -0
- package/tui/app.py +1236 -0
- package/tui/atomic.py +37 -0
- package/tui/cli.py +313 -0
- package/tui/code_analyze.py +27 -0
- package/tui/complete.py +38 -0
- package/tui/constants.py +61 -0
- package/tui/conversation_markdown.py +30 -0
- package/tui/danger.py +372 -0
- package/tui/data/agents/ampcode.com.toml +51 -0
- package/tui/data/agents/augmentcode.com.toml +40 -0
- package/tui/data/agents/cdh.cloud-dev-harness.toml +22 -0
- package/tui/data/agents/claude.com.toml +41 -0
- package/tui/data/agents/copilot.github.com.toml +29 -0
- package/tui/data/agents/crowai.dev.toml +35 -0
- package/tui/data/agents/cursor.com.toml +38 -0
- package/tui/data/agents/deepagents.langchain.com +33 -0
- package/tui/data/agents/docker.com.toml +59 -0
- package/tui/data/agents/geminicli.com.toml +28 -0
- package/tui/data/agents/goose.ai.toml +51 -0
- package/tui/data/agents/inference.huggingface.co.toml +41 -0
- package/tui/data/agents/kimi.com.toml +35 -0
- package/tui/data/agents/kiro.dev.toml +42 -0
- package/tui/data/agents/openai.com.toml +53 -0
- package/tui/data/agents/openclaw.ai.toml +37 -0
- package/tui/data/agents/opencode.ai.toml +39 -0
- package/tui/data/agents/openhands.dev.toml +45 -0
- package/tui/data/agents/stakpak.dev.toml +61 -0
- package/tui/data/agents/vibe.mistral.ai.toml +30 -0
- package/tui/data/agents/vtcode.dev.toml +62 -0
- 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 +190 -0
- package/tui/dec.py +332 -0
- package/tui/directory.py +234 -0
- package/tui/directory_suggester.py +93 -0
- package/tui/directory_watcher.py +197 -0
- package/tui/format_path.py +25 -0
- package/tui/fuzzy.py +140 -0
- package/tui/fuzzy_index.py +275 -0
- package/tui/gist.py +33 -0
- package/tui/history.py +138 -0
- package/tui/jsonrpc.py +578 -0
- package/tui/menus.py +14 -0
- package/tui/message_log.py +69 -0
- package/tui/messages.py +139 -0
- package/tui/option_content.py +51 -0
- package/tui/os.py +0 -0
- package/tui/path_complete.py +217 -0
- package/tui/path_filter.py +124 -0
- package/tui/paths.py +71 -0
- package/tui/pill.py +23 -0
- package/tui/platform_commands.py +52 -0
- 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 +19 -0
- package/tui/prompt/resource.py +68 -0
- package/tui/protocol.py +28 -0
- package/tui/screens/__init__.py +0 -0
- package/tui/screens/__pycache__/__init__.cpython-314.pyc +0 -0
- package/tui/screens/__pycache__/log.cpython-314.pyc +0 -0
- package/tui/screens/__pycache__/main.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__/settings.cpython-314.pyc +0 -0
- package/tui/screens/__pycache__/store.cpython-314.pyc +0 -0
- package/tui/screens/action_modal.py +94 -0
- package/tui/screens/agent_modal.py +175 -0
- package/tui/screens/command_edit_modal.py +74 -0
- package/tui/screens/log.py +553 -0
- package/tui/screens/main.py +411 -0
- package/tui/screens/main.tcss +655 -0
- package/tui/screens/permissions.py +404 -0
- package/tui/screens/permissions.tcss +72 -0
- package/tui/screens/projects.tcss +66 -0
- package/tui/screens/projects_app.py +319 -0
- package/tui/screens/projects_screen.py +142 -0
- package/tui/screens/session_resume_modal.py +172 -0
- package/tui/screens/session_resume_modal.tcss +35 -0
- package/tui/screens/sessions.py +166 -0
- package/tui/screens/sessions.tcss +119 -0
- package/tui/screens/settings.py +254 -0
- package/tui/screens/settings.tcss +101 -0
- package/tui/screens/store.py +500 -0
- package/tui/screens/store.tcss +274 -0
- package/tui/screens/tool_content_screen.py +59 -0
- package/tui/session_tracker.py +120 -0
- package/tui/settings.py +353 -0
- package/tui/settings_schema.py +431 -0
- package/tui/shell.py +304 -0
- package/tui/shell_read.py +42 -0
- package/tui/slash_command.py +34 -0
- package/tui/tui.tcss +246 -0
- package/tui/twitter.py +38 -0
- package/tui/version.py +80 -0
- 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 +273 -0
- 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-313.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__/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__/terminal.cpython-313.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-313.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 +70 -0
- package/tui/widgets/agent_response.py +77 -0
- package/tui/widgets/agent_thought.py +168 -0
- package/tui/widgets/ask_user.py +264 -0
- package/tui/widgets/command_pane.py +223 -0
- package/tui/widgets/condensed_path.py +115 -0
- package/tui/widgets/context_stats.py +66 -0
- package/tui/widgets/conversation.py +2441 -0
- package/tui/widgets/danger_warning.py +65 -0
- package/tui/widgets/diff_view.py +59 -0
- package/tui/widgets/directory_input.py +8 -0
- package/tui/widgets/flash.py +81 -0
- package/tui/widgets/future_text.py +126 -0
- package/tui/widgets/grid_select.py +234 -0
- package/tui/widgets/highlighted_textarea.py +180 -0
- package/tui/widgets/mandelbrot.py +294 -0
- package/tui/widgets/markdown_note.py +13 -0
- package/tui/widgets/menu.py +147 -0
- package/tui/widgets/modified_files.py +106 -0
- package/tui/widgets/non_selectable_label.py +5 -0
- package/tui/widgets/note.py +18 -0
- package/tui/widgets/path_search.py +492 -0
- package/tui/widgets/plan.py +263 -0
- package/tui/widgets/project_directory_tree.py +90 -0
- package/tui/widgets/project_grid_select.py +35 -0
- package/tui/widgets/project_summary.py +33 -0
- package/tui/widgets/prompt.py +795 -0
- package/tui/widgets/question.py +360 -0
- package/tui/widgets/session_grid_select.py +224 -0
- package/tui/widgets/session_summary.py +115 -0
- package/tui/widgets/session_tabs.py +188 -0
- package/tui/widgets/shell_result.py +35 -0
- package/tui/widgets/shell_terminal.py +40 -0
- package/tui/widgets/side_bar.py +114 -0
- package/tui/widgets/slash_complete.py +235 -0
- package/tui/widgets/strike_text.py +70 -0
- package/tui/widgets/subagent.py +87 -0
- package/tui/widgets/terminal.py +577 -0
- package/tui/widgets/terminal_tool.py +351 -0
- package/tui/widgets/throbber.py +100 -0
- package/tui/widgets/tool_call.py +368 -0
- package/tui/widgets/user_input.py +23 -0
- package/tui/widgets/version.py +5 -0
- package/tui/widgets/welcome.py +31 -0
|
@@ -0,0 +1,199 @@
|
|
|
1
|
+
# AI-DLC Deliver Deployment Pipeline (Stack)
|
|
2
|
+
|
|
3
|
+
Extends the Deliver phase with a unified stack deploy pipeline, per-component and cross-stack e2e, and stack-level BVT + rollback.
|
|
4
|
+
|
|
5
|
+
## Environments
|
|
6
|
+
|
|
7
|
+
| Environment | Purpose | Deploy Trigger | TTL |
|
|
8
|
+
|-------------|---------|----------------|-----|
|
|
9
|
+
| preview | Per-component + cross-stack e2e verification | Feature branch | 24h, auto-cleanup |
|
|
10
|
+
| staging | Pre-production stack validation | PR merge to main | — |
|
|
11
|
+
| production | Live traffic | Release tag + human approval | — |
|
|
12
|
+
|
|
13
|
+
## Stack Topology
|
|
14
|
+
|
|
15
|
+
```yaml
|
|
16
|
+
stack:
|
|
17
|
+
components:
|
|
18
|
+
- id: backend
|
|
19
|
+
deploy:
|
|
20
|
+
- functions: tcb fn deploy
|
|
21
|
+
- db: tcb db migrate
|
|
22
|
+
exposes: BACKEND_URL
|
|
23
|
+
- id: web
|
|
24
|
+
depends_on: [backend]
|
|
25
|
+
deploy:
|
|
26
|
+
- hosting: tcb hosting deploy --build-env BACKEND_URL=${BACKEND_URL}
|
|
27
|
+
consumes: BACKEND_URL
|
|
28
|
+
- id: native
|
|
29
|
+
depends_on: [backend]
|
|
30
|
+
deploy:
|
|
31
|
+
- build: build with BACKEND_URL injected
|
|
32
|
+
- distribute: upload to internal distribution
|
|
33
|
+
consumes: BACKEND_URL
|
|
34
|
+
- id: desktop
|
|
35
|
+
depends_on: [backend]
|
|
36
|
+
deploy:
|
|
37
|
+
- build: build with BACKEND_URL injected
|
|
38
|
+
- distribute: upload to internal distribution
|
|
39
|
+
consumes: BACKEND_URL
|
|
40
|
+
- id: wxa
|
|
41
|
+
depends_on: [backend]
|
|
42
|
+
deploy:
|
|
43
|
+
- build: build with BACKEND_URL injected
|
|
44
|
+
- distribute: upload to mini-program platform
|
|
45
|
+
consumes: BACKEND_URL
|
|
46
|
+
- id: mya
|
|
47
|
+
depends_on: [backend]
|
|
48
|
+
deploy:
|
|
49
|
+
- build: build with BACKEND_URL injected
|
|
50
|
+
- distribute: upload to mini-program platform
|
|
51
|
+
consumes: BACKEND_URL
|
|
52
|
+
- id: tta
|
|
53
|
+
depends_on: [backend]
|
|
54
|
+
deploy:
|
|
55
|
+
- build: build with BACKEND_URL injected
|
|
56
|
+
- distribute: upload to mini-program platform
|
|
57
|
+
consumes: BACKEND_URL
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
The `deploy_stack` orchestrator:
|
|
61
|
+
1. Resolves the platform (TCB / Aliyun) from the active provider.
|
|
62
|
+
2. Deploys `backend` first; captures `BACKEND_URL`.
|
|
63
|
+
3. Deploys all client components (`web`, `native`, `desktop`, `wxa`, `mya`, `tta`) in parallel with `BACKEND_URL` injected at build time.
|
|
64
|
+
4. Exposes `STACK_URL` (= `BACKEND_URL` for the gateway) and per-component URLs.
|
|
65
|
+
|
|
66
|
+
## Pipeline
|
|
67
|
+
|
|
68
|
+
```yaml
|
|
69
|
+
name: deliver
|
|
70
|
+
version: 3.0.0
|
|
71
|
+
|
|
72
|
+
stages:
|
|
73
|
+
- name: preview
|
|
74
|
+
description: Unified stack preview with per-component + cross-stack e2e
|
|
75
|
+
steps:
|
|
76
|
+
- name: deploy_stack
|
|
77
|
+
command: deploy_stack --preview
|
|
78
|
+
platform: dynamic # TCB or Aliyun
|
|
79
|
+
output:
|
|
80
|
+
- name: stack_url
|
|
81
|
+
- name: backend_url
|
|
82
|
+
- name: web_url
|
|
83
|
+
- name: e2e_backend
|
|
84
|
+
command: pytest apps/backend/tests/e2e/ --base-url ${BACKEND_URL}
|
|
85
|
+
requires: [deploy_stack]
|
|
86
|
+
- name: e2e_web
|
|
87
|
+
command: pytest apps/web/tests/e2e/ --base-url ${WEB_URL} --api-url ${BACKEND_URL}
|
|
88
|
+
requires: [deploy_stack]
|
|
89
|
+
- name: e2e_native
|
|
90
|
+
command: pytest apps/native/tests/e2e/ --backend-url ${BACKEND_URL}
|
|
91
|
+
requires: [deploy_stack]
|
|
92
|
+
when: affects contains native
|
|
93
|
+
- name: e2e_desktop
|
|
94
|
+
command: pytest apps/desktop/tests/e2e/ --backend-url ${BACKEND_URL}
|
|
95
|
+
requires: [deploy_stack]
|
|
96
|
+
when: affects contains desktop
|
|
97
|
+
- name: e2e_wxa
|
|
98
|
+
command: pytest apps/wxa/tests/e2e/ --backend-url ${BACKEND_URL}
|
|
99
|
+
requires: [deploy_stack]
|
|
100
|
+
when: affects contains wxa
|
|
101
|
+
- name: e2e_mya
|
|
102
|
+
command: pytest apps/mya/tests/e2e/ --backend-url ${BACKEND_URL}
|
|
103
|
+
requires: [deploy_stack]
|
|
104
|
+
when: affects contains mya
|
|
105
|
+
- name: e2e_tta
|
|
106
|
+
command: pytest apps/tta/tests/e2e/ --backend-url ${BACKEND_URL}
|
|
107
|
+
requires: [deploy_stack]
|
|
108
|
+
when: affects contains tta
|
|
109
|
+
- name: e2e_cross_stack
|
|
110
|
+
command: pytest tests/cross-stack/ --stack-url ${STACK_URL}
|
|
111
|
+
requires: [e2e_backend, e2e_web, e2e_native, e2e_desktop, e2e_wxa, e2e_mya, e2e_tta]
|
|
112
|
+
when: affects contains >= 2 components
|
|
113
|
+
|
|
114
|
+
- name: staging
|
|
115
|
+
description: Staging stack smoke test
|
|
116
|
+
steps:
|
|
117
|
+
- name: deploy_stack
|
|
118
|
+
command: deploy_stack --env staging
|
|
119
|
+
- name: smoke
|
|
120
|
+
command: smoke-test ${STACK_URL}
|
|
121
|
+
- name: cross_stack
|
|
122
|
+
command: pytest tests/cross-stack/ --stack-url ${STACK_URL}
|
|
123
|
+
|
|
124
|
+
- name: production
|
|
125
|
+
description: Stack production deploy with stack BVT
|
|
126
|
+
conditions:
|
|
127
|
+
branch: main
|
|
128
|
+
steps:
|
|
129
|
+
- name: approve
|
|
130
|
+
command: human-approval-gate
|
|
131
|
+
inputs:
|
|
132
|
+
- per_component_e2e_reports
|
|
133
|
+
- cross_stack_e2e_report
|
|
134
|
+
- staging_smoke_report
|
|
135
|
+
- openspec/changes/{id}/contract-diff.md
|
|
136
|
+
- name: deploy_stack
|
|
137
|
+
command: deploy_stack --env production
|
|
138
|
+
- name: bvt
|
|
139
|
+
command: bvt ${PRODUCTION_URL}
|
|
140
|
+
timeout: 60s
|
|
141
|
+
- name: health_check
|
|
142
|
+
command: curl -f ${PRODUCTION_URL}/health
|
|
143
|
+
timeout: 30s
|
|
144
|
+
- name: archive_contract_diff
|
|
145
|
+
command: cp openspec/changes/{id}/contract-diff.md deploy-artifacts/
|
|
146
|
+
|
|
147
|
+
rollback:
|
|
148
|
+
triggers:
|
|
149
|
+
- condition: BVT failure → automatic stack rollback
|
|
150
|
+
- condition: Health check 5xx → automatic stack rollback
|
|
151
|
+
- condition: Error rate >1% in 5min → manual stack rollback
|
|
152
|
+
action: deploy_stack --rollback ${LAST_STABLE_STACK_VERSION}
|
|
153
|
+
scope: stack # all components roll back together (STK-006)
|
|
154
|
+
```
|
|
155
|
+
|
|
156
|
+
## BVT Checklist (Stack)
|
|
157
|
+
|
|
158
|
+
Executed after every production deployment. BVT operates on the **stack**, not a single component:
|
|
159
|
+
|
|
160
|
+
```bash
|
|
161
|
+
bvt ${PRODUCTION_URL}
|
|
162
|
+
# 1. backend /health returns 200 OK
|
|
163
|
+
# 2. web home page returns 200 (SSR) or shell loads (SPA)
|
|
164
|
+
# 3. native/desktop/mini-program launch probe (deep link resolves against BACKEND_URL)
|
|
165
|
+
# 4. Core cross-stack flow (login) succeeds end-to-end
|
|
166
|
+
# 5. Database reachable
|
|
167
|
+
# 6. Error rate < 0.1%
|
|
168
|
+
# 7. Latency p99 < 500ms
|
|
169
|
+
# 8. Contract diff archived
|
|
170
|
+
```
|
|
171
|
+
|
|
172
|
+
## Build Config Injection
|
|
173
|
+
|
|
174
|
+
All client builds (`web`, `native`, `desktop`, `wxa`, `mya`, `tta`) receive `BACKEND_URL` (and any other stack-level config) at build time. The orchestrator passes the env value; components MUST NOT hardcode URLs (STK-005).
|
|
175
|
+
|
|
176
|
+
```bash
|
|
177
|
+
# web
|
|
178
|
+
pnpm --filter web build --env BACKEND_URL=$BACKEND_URL
|
|
179
|
+
|
|
180
|
+
# native
|
|
181
|
+
cd apps/native && BACKEND_URL=$BACKEND_URL pnpm build
|
|
182
|
+
|
|
183
|
+
# desktop
|
|
184
|
+
cd apps/desktop && BACKEND_URL=$BACKEND_URL pnpm build
|
|
185
|
+
|
|
186
|
+
# mini-programs (wxa, mya, tta)
|
|
187
|
+
cd apps/wxa && BACKEND_URL=$BACKEND_URL pnpm build
|
|
188
|
+
cd apps/mya && BACKEND_URL=$BACKEND_URL pnpm build
|
|
189
|
+
cd apps/tta && BACKEND_URL=$BACKEND_URL pnpm build
|
|
190
|
+
```
|
|
191
|
+
|
|
192
|
+
## Component URL Resolution
|
|
193
|
+
|
|
194
|
+
Per-platform URL patterns (resolved by `deploy_stack`):
|
|
195
|
+
|
|
196
|
+
| Platform | STACK_URL | WEB_URL | NATIVE/DESKTOP distribution | MINI-PROGRAM distribution |
|
|
197
|
+
|----------|-----------|---------|---------------------------|---------------------------|
|
|
198
|
+
| TCB | `https://{env-id}.tcb-preview.com` | `https://{env-id}-{project}.tcb-preview.com` | internal distribution URL | mini-program preview QR |
|
|
199
|
+
| Aliyun | `https://{gateway}.{region}.fc.devs.com` | `https://{bucket}.{region}.oss-website.aliyuncs.com` | internal distribution URL | mini-program preview QR |
|
package/cdh/__init__.py
ADDED
|
File without changes
|
package/cdh/__main__.py
ADDED
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/cdh/cli.py
ADDED
|
@@ -0,0 +1,361 @@
|
|
|
1
|
+
from pathlib import Path
|
|
2
|
+
from typing import Optional
|
|
3
|
+
|
|
4
|
+
import click
|
|
5
|
+
|
|
6
|
+
from cdh.scaffold import scaffold_dlc_project
|
|
7
|
+
from onecode.cli import cli as onecode_cli
|
|
8
|
+
from onecode.cli import setup_logging
|
|
9
|
+
from onecode.config import ensure_dirs, load_config, save_config
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
_CDH_DIR = Path.home() / ".onecode"
|
|
13
|
+
|
|
14
|
+
_COMMON_HELP = """
|
|
15
|
+
\b
|
|
16
|
+
Usage:
|
|
17
|
+
cdh Launch TUI (agent store)
|
|
18
|
+
cdh tui Launch TUI (agent store)
|
|
19
|
+
cdh tui --agent cdh.cloud-dev-harness Launch TUI with agent
|
|
20
|
+
cdh help Show this help message
|
|
21
|
+
cdh config Configuration editor (TUI)
|
|
22
|
+
cdh logs View application logs
|
|
23
|
+
cdh project Project management
|
|
24
|
+
cdh version Show version information
|
|
25
|
+
|
|
26
|
+
\b
|
|
27
|
+
Paths:
|
|
28
|
+
Config ~/.onecode/onecode.config.yaml
|
|
29
|
+
Logs ~/.onecode/logs/
|
|
30
|
+
Projects ~/.onecode/projects/
|
|
31
|
+
"""
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
@click.group(
|
|
35
|
+
invoke_without_command=True,
|
|
36
|
+
cls=type(onecode_cli),
|
|
37
|
+
context_settings=dict(max_content_width=100),
|
|
38
|
+
short_help="Cloud Dev Harness - AI agent framework with TUI.",
|
|
39
|
+
epilog=_COMMON_HELP,
|
|
40
|
+
)
|
|
41
|
+
@click.version_option(version="1.0.0", prog_name="cdh")
|
|
42
|
+
@click.pass_context
|
|
43
|
+
def cli(ctx):
|
|
44
|
+
"""
|
|
45
|
+
CDH (Cloud Dev Harness) is an AI agent framework with LLM provider
|
|
46
|
+
integration, session management, and a Textual-based TUI.
|
|
47
|
+
|
|
48
|
+
Run without arguments to open the agent store. Use cdh tui --agent
|
|
49
|
+
<identity> to launch a specific agent directly.
|
|
50
|
+
"""
|
|
51
|
+
if ctx.invoked_subcommand is None:
|
|
52
|
+
ensure_dirs()
|
|
53
|
+
cfg = load_config()
|
|
54
|
+
setup_logging(cfg.log_level)
|
|
55
|
+
from tui.app import A2TUIApp
|
|
56
|
+
A2TUIApp().run()
|
|
57
|
+
|
|
58
|
+
|
|
59
|
+
# --- config group ---
|
|
60
|
+
|
|
61
|
+
@cli.group(
|
|
62
|
+
invoke_without_command=True,
|
|
63
|
+
short_help="Open configuration editor",
|
|
64
|
+
)
|
|
65
|
+
@click.pass_context
|
|
66
|
+
def config(ctx):
|
|
67
|
+
"""Open the interactive TUI configuration editor.
|
|
68
|
+
|
|
69
|
+
Launches a Textual-based UI for editing all CDH settings
|
|
70
|
+
including providers, models, cloud platforms, agent parameters.
|
|
71
|
+
"""
|
|
72
|
+
if ctx.invoked_subcommand is None:
|
|
73
|
+
from onecode.config_screen import main as config_main
|
|
74
|
+
config_main()
|
|
75
|
+
|
|
76
|
+
|
|
77
|
+
# Reuse subcommands from onecode's config group (mode, model, provider, cloud, log-level, skill, mcp, list)
|
|
78
|
+
for _cfg_cmd in onecode_cli.get_command(None, "config").commands.values():
|
|
79
|
+
if _cfg_cmd.name not in config.commands and _cfg_cmd.name not in ("tui",):
|
|
80
|
+
config.add_command(_cfg_cmd)
|
|
81
|
+
|
|
82
|
+
|
|
83
|
+
# --- logs command ---
|
|
84
|
+
|
|
85
|
+
@cli.command(short_help="View application logs")
|
|
86
|
+
@click.option("--tail", "-t", default=20, help="Number of recent log lines to show")
|
|
87
|
+
@click.option("--follow", "-f", is_flag=True, help="Follow log output")
|
|
88
|
+
def logs(tail, follow):
|
|
89
|
+
"""View CDH application logs.
|
|
90
|
+
|
|
91
|
+
\b
|
|
92
|
+
Examples:
|
|
93
|
+
cdh logs Show last 20 log lines
|
|
94
|
+
cdh logs --tail 100 Show last 100 lines
|
|
95
|
+
cdh logs --follow Follow log output
|
|
96
|
+
"""
|
|
97
|
+
log_file = _CDH_DIR / "logs" / "cdh.log"
|
|
98
|
+
if not log_file.exists():
|
|
99
|
+
click.echo("No log file found.")
|
|
100
|
+
return
|
|
101
|
+
if follow:
|
|
102
|
+
click.echo(f"Following {log_file}...")
|
|
103
|
+
import subprocess
|
|
104
|
+
subprocess.run(["tail", "-f", str(log_file)])
|
|
105
|
+
else:
|
|
106
|
+
import subprocess
|
|
107
|
+
subprocess.run(["tail", "-n", str(tail), str(log_file)])
|
|
108
|
+
|
|
109
|
+
|
|
110
|
+
# --- project command ---
|
|
111
|
+
|
|
112
|
+
def _get_projects():
|
|
113
|
+
projects_dir = _CDH_DIR / "projects"
|
|
114
|
+
projects_dir.mkdir(parents=True, exist_ok=True)
|
|
115
|
+
return sorted(list(projects_dir.glob("*.yaml")) + list(projects_dir.glob("*.json")))
|
|
116
|
+
|
|
117
|
+
|
|
118
|
+
def _load_project_by_name(name: str) -> Optional[tuple]:
|
|
119
|
+
projects_dir = _CDH_DIR / "projects"
|
|
120
|
+
for ext in ["yaml", "yml", "json"]:
|
|
121
|
+
pf = projects_dir / f"{name}.{ext}"
|
|
122
|
+
if pf.exists():
|
|
123
|
+
import yaml
|
|
124
|
+
proj_data = yaml.safe_load(pf.read_text()) if ext in ["yaml", "yml"] else __import__("json").loads(pf.read_text())
|
|
125
|
+
return name, proj_data.get("path", ".")
|
|
126
|
+
return None
|
|
127
|
+
|
|
128
|
+
|
|
129
|
+
def _interactive_select_project():
|
|
130
|
+
project_files = _get_projects()
|
|
131
|
+
if not project_files:
|
|
132
|
+
return None
|
|
133
|
+
click.echo("Projects:")
|
|
134
|
+
for i, pf in enumerate(project_files, 1):
|
|
135
|
+
click.echo(f" {i}) {pf.stem}")
|
|
136
|
+
choice = click.prompt("Select project", type=str, default="").strip().lower()
|
|
137
|
+
try:
|
|
138
|
+
idx = int(choice) - 1
|
|
139
|
+
if 0 <= idx < len(project_files):
|
|
140
|
+
return ("load", project_files[idx].stem)
|
|
141
|
+
except ValueError:
|
|
142
|
+
pass
|
|
143
|
+
return None
|
|
144
|
+
|
|
145
|
+
|
|
146
|
+
@cli.command(short_help="Project management (TUI)")
|
|
147
|
+
@click.argument("action", type=click.Choice(["list", "show", "new", "init", "load", "select"]), default="select")
|
|
148
|
+
@click.argument("name", required=False)
|
|
149
|
+
@click.argument("path", required=False, default=".")
|
|
150
|
+
def project(action, name, path):
|
|
151
|
+
"""Manage CDH projects.
|
|
152
|
+
|
|
153
|
+
\b
|
|
154
|
+
Without arguments, opens the project management TUI.
|
|
155
|
+
Use subcommands for quick CLI operations.
|
|
156
|
+
|
|
157
|
+
\b
|
|
158
|
+
Actions:
|
|
159
|
+
select Open project management TUI (default)
|
|
160
|
+
list List all projects
|
|
161
|
+
show <name> Show project details
|
|
162
|
+
new <name> [path] Create a new project (with ai-dlc-skill scaffold if available)
|
|
163
|
+
init [path] Initialize .cdh in an existing directory (no registration)
|
|
164
|
+
load <name> Load a project (set as current)
|
|
165
|
+
"""
|
|
166
|
+
import yaml
|
|
167
|
+
projects_dir = _CDH_DIR / "projects"
|
|
168
|
+
projects_dir.mkdir(parents=True, exist_ok=True)
|
|
169
|
+
|
|
170
|
+
if action == "select":
|
|
171
|
+
from tui.screens.projects_app import main as projects_main
|
|
172
|
+
result = projects_main()
|
|
173
|
+
if result == "loaded":
|
|
174
|
+
from tui.app import A2TUIApp
|
|
175
|
+
A2TUIApp().run()
|
|
176
|
+
return
|
|
177
|
+
|
|
178
|
+
if action == "list":
|
|
179
|
+
project_files = sorted(list(projects_dir.glob("*.yaml")) + list(projects_dir.glob("*.json")))
|
|
180
|
+
if not project_files:
|
|
181
|
+
click.echo("No projects found.")
|
|
182
|
+
return
|
|
183
|
+
click.echo("Projects:")
|
|
184
|
+
for pf in project_files:
|
|
185
|
+
click.echo(f" {pf.stem}")
|
|
186
|
+
elif action == "show":
|
|
187
|
+
if not name:
|
|
188
|
+
click.echo("Usage: cdh project show <name>")
|
|
189
|
+
return
|
|
190
|
+
for ext in ["yaml", "yml", "json"]:
|
|
191
|
+
pf = projects_dir / f"{name}.{ext}"
|
|
192
|
+
if pf.exists():
|
|
193
|
+
click.echo(pf.read_text())
|
|
194
|
+
return
|
|
195
|
+
click.echo(f"Project '{name}' not found.")
|
|
196
|
+
elif action == "new":
|
|
197
|
+
if not name:
|
|
198
|
+
click.echo("Usage: cdh project new <name> [path]")
|
|
199
|
+
return
|
|
200
|
+
from onecode.agent.cdh_loader import CdhProjectLoader
|
|
201
|
+
ws = Path(path).expanduser().resolve()
|
|
202
|
+
scaffold_dlc_project(ws, name)
|
|
203
|
+
CdhProjectLoader.init_project(ws, name)
|
|
204
|
+
proj_data = {"name": name, "path": str(ws), "description": ""}
|
|
205
|
+
project_file = projects_dir / f"{name}.yaml"
|
|
206
|
+
project_file.write_text(yaml.dump(proj_data))
|
|
207
|
+
cfg = load_config()
|
|
208
|
+
cfg.current_project = name
|
|
209
|
+
cfg.current_project_path = str(ws)
|
|
210
|
+
save_config(cfg)
|
|
211
|
+
click.echo(f"Created project '{name}' at {ws}")
|
|
212
|
+
elif action == "init":
|
|
213
|
+
from onecode.agent.cdh_loader import CdhProjectLoader
|
|
214
|
+
from cdh.scaffold import init_dlc_project
|
|
215
|
+
target = Path(name or ".").expanduser().resolve()
|
|
216
|
+
project_name = target.name
|
|
217
|
+
init_dlc_project(target, project_name)
|
|
218
|
+
CdhProjectLoader.init_project(target, project_name)
|
|
219
|
+
click.echo(f"Initialized .cdh in {target}")
|
|
220
|
+
elif action == "load":
|
|
221
|
+
if not name:
|
|
222
|
+
click.echo("Usage: cdh project load <name>")
|
|
223
|
+
return
|
|
224
|
+
for ext in ["yaml", "yml", "json"]:
|
|
225
|
+
pf = projects_dir / f"{name}.{ext}"
|
|
226
|
+
if pf.exists():
|
|
227
|
+
proj_data = yaml.safe_load(pf.read_text()) if ext in ["yaml", "yml"] else __import__("json").loads(pf.read_text())
|
|
228
|
+
cfg = load_config()
|
|
229
|
+
cfg.current_project = name
|
|
230
|
+
cfg.current_project_path = proj_data.get("path", ".")
|
|
231
|
+
save_config(cfg)
|
|
232
|
+
click.echo(f"Loaded project '{name}' (path: {cfg.current_project_path})")
|
|
233
|
+
return
|
|
234
|
+
click.echo(f"Project '{name}' not found.")
|
|
235
|
+
|
|
236
|
+
|
|
237
|
+
# --- session command ---
|
|
238
|
+
|
|
239
|
+
@cli.command(short_help="Session management")
|
|
240
|
+
@click.argument("action", type=click.Choice(["list", "load"]), default="list")
|
|
241
|
+
@click.argument("session_id", required=False, type=int)
|
|
242
|
+
def session(action, session_id):
|
|
243
|
+
"""Manage CDH sessions.
|
|
244
|
+
|
|
245
|
+
\b
|
|
246
|
+
Actions:
|
|
247
|
+
list List recent sessions
|
|
248
|
+
load <id> Load a session by ID
|
|
249
|
+
|
|
250
|
+
\b
|
|
251
|
+
Examples:
|
|
252
|
+
cdh session List recent sessions
|
|
253
|
+
cdh session list List recent sessions
|
|
254
|
+
cdh session load 5 Load session with ID 5
|
|
255
|
+
"""
|
|
256
|
+
import asyncio
|
|
257
|
+
from tui.db import DB
|
|
258
|
+
|
|
259
|
+
async def run():
|
|
260
|
+
db = DB()
|
|
261
|
+
if action == "list":
|
|
262
|
+
recent = await db.session_get_recent(max_results=20)
|
|
263
|
+
if not recent:
|
|
264
|
+
click.echo("No sessions found.")
|
|
265
|
+
return
|
|
266
|
+
click.echo("Recent sessions:")
|
|
267
|
+
for s in recent:
|
|
268
|
+
title = s.get("title", "Untitled") or "Untitled"
|
|
269
|
+
aid = s.get("agent_identity", "unknown")
|
|
270
|
+
sid = s.get("agent_session_id", "")[:8]
|
|
271
|
+
click.echo(f" session-{s['id']}: {title} ({aid[:30]}... {sid})")
|
|
272
|
+
elif action == "load":
|
|
273
|
+
if session_id is None:
|
|
274
|
+
click.echo("Usage: cdh session load <id>")
|
|
275
|
+
return
|
|
276
|
+
s = await db.session_get(session_id)
|
|
277
|
+
if s is None:
|
|
278
|
+
click.echo(f"Session {session_id} not found.")
|
|
279
|
+
return
|
|
280
|
+
click.echo(f"Session {session_id}:")
|
|
281
|
+
click.echo(f" Title: {s.get('title', 'Untitled')}")
|
|
282
|
+
click.echo(f" Agent: {s.get('agent_identity', 'unknown')}")
|
|
283
|
+
click.echo(f" Agent Session ID: {s.get('agent_session_id', 'N/A')}")
|
|
284
|
+
|
|
285
|
+
asyncio.run(run())
|
|
286
|
+
|
|
287
|
+
|
|
288
|
+
# --- help command ---
|
|
289
|
+
|
|
290
|
+
# --- tui command ---
|
|
291
|
+
|
|
292
|
+
@cli.command(short_help="Launch the TUI")
|
|
293
|
+
@click.option("--project-dir", "-d", default=".", help="Project directory")
|
|
294
|
+
@click.option("--agent", "agent_identity", default=None, help="Agent identity to auto-launch (e.g. cdh.cloud-dev-harness)")
|
|
295
|
+
@click.pass_context
|
|
296
|
+
def tui(ctx, project_dir, agent_identity):
|
|
297
|
+
"""Launch the CDH TUI (Textual User Interface).
|
|
298
|
+
|
|
299
|
+
By default opens the agent store, showing your configured launcher
|
|
300
|
+
agents. Use --agent to skip the store and directly launch an agent.
|
|
301
|
+
"""
|
|
302
|
+
ensure_dirs()
|
|
303
|
+
cfg = load_config()
|
|
304
|
+
setup_logging(cfg.log_level)
|
|
305
|
+
|
|
306
|
+
ws = Path(project_dir).expanduser().resolve()
|
|
307
|
+
|
|
308
|
+
from tui.app import A2TUIApp
|
|
309
|
+
app = A2TUIApp(
|
|
310
|
+
project_dir=str(ws),
|
|
311
|
+
launch_agent_identity=agent_identity,
|
|
312
|
+
)
|
|
313
|
+
app.run()
|
|
314
|
+
|
|
315
|
+
|
|
316
|
+
# --- help command ---
|
|
317
|
+
|
|
318
|
+
@cli.command(short_help="Show help for commands")
|
|
319
|
+
@click.argument("command", required=False)
|
|
320
|
+
def help_cmd(command):
|
|
321
|
+
"""Show help for cdh commands and usage information.
|
|
322
|
+
|
|
323
|
+
\b
|
|
324
|
+
Examples:
|
|
325
|
+
cdh help Show top-level help
|
|
326
|
+
cdh help config Show config subcommand help
|
|
327
|
+
cdh help logs Show logs command help
|
|
328
|
+
"""
|
|
329
|
+
if command:
|
|
330
|
+
cmd = cli.commands.get(command)
|
|
331
|
+
if cmd:
|
|
332
|
+
click.echo(cmd.get_help(click.Context(cmd)))
|
|
333
|
+
else:
|
|
334
|
+
click.echo(f"Unknown command: {command}")
|
|
335
|
+
else:
|
|
336
|
+
click.echo(cli.get_help(click.Context(cli)))
|
|
337
|
+
|
|
338
|
+
|
|
339
|
+
# --- version command ---
|
|
340
|
+
|
|
341
|
+
@cli.command(short_help="Show version info")
|
|
342
|
+
def version():
|
|
343
|
+
"""Show CDH version and build information."""
|
|
344
|
+
from onecode import __version__
|
|
345
|
+
click.echo(f"cdh version {__version__}")
|
|
346
|
+
|
|
347
|
+
|
|
348
|
+
# Attach remaining onecode subcommands selectively
|
|
349
|
+
_skip = {"config", "init", "set", "list", "tui", "help", "version", "mcp"}
|
|
350
|
+
for cmd_name in onecode_cli.commands:
|
|
351
|
+
if cmd_name in _skip:
|
|
352
|
+
continue
|
|
353
|
+
cli.add_command(onecode_cli.get_command(None, cmd_name))
|
|
354
|
+
|
|
355
|
+
|
|
356
|
+
def main():
|
|
357
|
+
cli()
|
|
358
|
+
|
|
359
|
+
|
|
360
|
+
if __name__ == "__main__":
|
|
361
|
+
main()
|