@scemoon/cdh 1.0.9 → 1.0.10-beta.1
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 +9 -2
- package/ai-dlc-skill/SKILL.md +0 -106
- package/ai-dlc-skill/architecture/project-structure.md +0 -78
- package/ai-dlc-skill/brownfield/README.md +0 -36
- package/ai-dlc-skill/brownfield/entry.md +0 -45
- 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 -47
- package/ai-dlc-skill/components/desktop.md +0 -63
- package/ai-dlc-skill/components/mya.md +0 -219
- package/ai-dlc-skill/components/native.md +0 -73
- package/ai-dlc-skill/components/tta.md +0 -235
- package/ai-dlc-skill/components/web.md +0 -77
- package/ai-dlc-skill/components/wxa.md +0 -219
- package/ai-dlc-skill/contracts/README.md +0 -25
- package/ai-dlc-skill/core/adaptive-flow.md +0 -107
- package/ai-dlc-skill/core/security.md +0 -29
- package/ai-dlc-skill/core/task-registry.md +0 -153
- package/ai-dlc-skill/cross-tool/README.md +0 -20
- package/ai-dlc-skill/cross-tool/cline/export.sh +0 -38
- package/ai-dlc-skill/cross-tool/copilot/export.sh +0 -41
- package/ai-dlc-skill/cross-tool/cursor/export.sh +0 -53
- package/ai-dlc-skill/cross-tool/onecode/export.sh +0 -27
- package/ai-dlc-skill/cross-tool/opencode/export.sh +0 -38
- package/ai-dlc-skill/phases/debug/entry.md +0 -48
- package/ai-dlc-skill/phases/debug/lifecycle.md +0 -284
- package/ai-dlc-skill/phases/deliver/entry.md +0 -35
- package/ai-dlc-skill/phases/deliver/lifecycle.md +0 -185
- package/ai-dlc-skill/phases/deliver/prompt.md +0 -54
- package/ai-dlc-skill/phases/deliver/rules.md +0 -61
- package/ai-dlc-skill/phases/plan/design_system/accessibility.md +0 -268
- package/ai-dlc-skill/phases/plan/design_system/atomic_design.md +0 -341
- package/ai-dlc-skill/phases/plan/design_system/component_spec.md +0 -398
- package/ai-dlc-skill/phases/plan/design_system/design_tokens.md +0 -190
- package/ai-dlc-skill/phases/plan/design_system/iconography.md +0 -299
- package/ai-dlc-skill/phases/plan/design_system/platform_ui/desktop.md +0 -318
- package/ai-dlc-skill/phases/plan/design_system/platform_ui/mya.md +0 -354
- package/ai-dlc-skill/phases/plan/design_system/platform_ui/native.md +0 -328
- package/ai-dlc-skill/phases/plan/design_system/platform_ui/tta.md +0 -394
- package/ai-dlc-skill/phases/plan/design_system/platform_ui/web.md +0 -287
- package/ai-dlc-skill/phases/plan/design_system/platform_ui/wxa.md +0 -374
- package/ai-dlc-skill/phases/plan/design_system/theme_system.md +0 -318
- package/ai-dlc-skill/phases/plan/entry.md +0 -33
- package/ai-dlc-skill/phases/plan/lifecycle.md +0 -260
- package/ai-dlc-skill/phases/plan/prompt.md +0 -75
- package/ai-dlc-skill/phases/plan/rules.md +0 -60
- package/ai-dlc-skill/phases/understand/entry.md +0 -36
- package/ai-dlc-skill/phases/understand/lifecycle.md +0 -184
- package/ai-dlc-skill/phases/understand/prompt.md +0 -58
- package/ai-dlc-skill/phases/understand/rules.md +0 -49
- package/ai-dlc-skill/phases/verify/config/base_url.md +0 -65
- package/ai-dlc-skill/phases/verify/entry.md +0 -59
- package/ai-dlc-skill/phases/verify/gates/browser_e2e.md +0 -96
- package/ai-dlc-skill/phases/verify/lifecycle.md +0 -217
- package/ai-dlc-skill/phases/verify/prompt.md +0 -73
- package/ai-dlc-skill/phases/verify/rules.md +0 -91
- package/ai-dlc-skill/phases/verify/runners/playwright_local.md +0 -103
- package/ai-dlc-skill/practices/bdd.md +0 -119
- package/ai-dlc-skill/practices/sdd.md +0 -84
- package/ai-dlc-skill/practices/tdd.md +0 -128
- package/ai-dlc-skill/providers/README.md +0 -114
- package/ai-dlc-skill/providers/aliyun/SKILL.md +0 -204
- package/ai-dlc-skill/providers/aliyun/api/rest-api.md +0 -214
- package/ai-dlc-skill/providers/aliyun/api/sdk.md +0 -307
- package/ai-dlc-skill/providers/aliyun/best-practices/database-design.md +0 -363
- package/ai-dlc-skill/providers/aliyun/best-practices/function-design.md +0 -424
- package/ai-dlc-skill/providers/aliyun/best-practices/troubleshooting.md +0 -258
- package/ai-dlc-skill/providers/aliyun/cli/database.md +0 -263
- package/ai-dlc-skill/providers/aliyun/cli/functions.md +0 -263
- package/ai-dlc-skill/providers/aliyun/cli/hosting.md +0 -226
- package/ai-dlc-skill/providers/aliyun/cli/setup.md +0 -235
- package/ai-dlc-skill/providers/aliyun/cli/storage.md +0 -315
- package/ai-dlc-skill/providers/aliyun/deployment.yaml +0 -66
- package/ai-dlc-skill/providers/aliyun/integration/ci-cd.md +0 -288
- 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/aliyun/security/authentication.md +0 -254
- package/ai-dlc-skill/providers/aliyun/services/cdn-hosting.md +0 -220
- package/ai-dlc-skill/providers/aliyun/services/database.md +0 -319
- package/ai-dlc-skill/providers/aliyun/services/function-compute.md +0 -273
- package/ai-dlc-skill/providers/aliyun/services/overview.md +0 -163
- package/ai-dlc-skill/providers/aliyun/services/serverless-app-engine.md +0 -266
- package/ai-dlc-skill/providers/aliyun/services/storage.md +0 -269
- package/ai-dlc-skill/providers/tcb/SKILL.md +0 -208
- package/ai-dlc-skill/providers/tcb/api/rest-api.md +0 -338
- package/ai-dlc-skill/providers/tcb/api/sdk.md +0 -288
- package/ai-dlc-skill/providers/tcb/best-practices/database-design.md +0 -452
- package/ai-dlc-skill/providers/tcb/best-practices/function-design.md +0 -502
- package/ai-dlc-skill/providers/tcb/best-practices/troubleshooting.md +0 -462
- package/ai-dlc-skill/providers/tcb/cli/cls.md +0 -133
- package/ai-dlc-skill/providers/tcb/cli/database.md +0 -230
- package/ai-dlc-skill/providers/tcb/cli/env.md +0 -207
- package/ai-dlc-skill/providers/tcb/cli/functions.md +0 -276
- package/ai-dlc-skill/providers/tcb/cli/hosting.md +0 -219
- package/ai-dlc-skill/providers/tcb/cli/setup.md +0 -218
- package/ai-dlc-skill/providers/tcb/cli/storage.md +0 -233
- package/ai-dlc-skill/providers/tcb/deployment.yaml +0 -111
- package/ai-dlc-skill/providers/tcb/integration/ci-cd.md +0 -309
- package/ai-dlc-skill/providers/tcb/integration/mcp-server.md +0 -371
- package/ai-dlc-skill/providers/tcb/preview.yaml +0 -83
- package/ai-dlc-skill/providers/tcb/provider.yaml +0 -172
- package/ai-dlc-skill/providers/tcb/security/authentication.md +0 -241
- package/ai-dlc-skill/providers/tcb/services/cloud-database.md +0 -299
- package/ai-dlc-skill/providers/tcb/services/cloud-functions.md +0 -265
- package/ai-dlc-skill/providers/tcb/services/cloud-hosting.md +0 -264
- package/ai-dlc-skill/providers/tcb/services/cloud-run.md +0 -285
- package/ai-dlc-skill/providers/tcb/services/cloud-storage.md +0 -245
- package/ai-dlc-skill/providers/tcb/services/overview.md +0 -174
- package/ai-dlc-skill/pybdd/README.md +0 -41
- package/ai-dlc-skill/pybdd/conftest.py +0 -17
- package/ai-dlc-skill/pybdd/example/auth/login.feature +0 -32
- package/ai-dlc-skill/pybdd/pytest.ini +0 -5
- package/ai-dlc-skill/pybdd/steps/.gitkeep +0 -1
- package/ai-dlc-skill/pybdd/steps/test_example_steps.py +0 -65
- package/ai-dlc-skill/requirements.md +0 -140
- package/ai-dlc-skill/skill.yaml +0 -135
- package/ai-dlc-skill/templates/brownfield/context.md +0 -78
- 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 -30
- 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/cdh/__init__.py +0 -0
- package/cdh/__main__.py +0 -4
- package/cdh/__pycache__/__init__.cpython-314.pyc +0 -0
- package/cdh/__pycache__/cli.cpython-314.pyc +0 -0
- package/cdh/__pycache__/cli_logging.cpython-314.pyc +0 -0
- package/cdh/__pycache__/config.cpython-314.pyc +0 -0
- package/cdh/__pycache__/project_loader.cpython-314.pyc +0 -0
- package/cdh/__pycache__/scaffold.cpython-314.pyc +0 -0
- package/cdh/__pycache__/session_store.cpython-314.pyc +0 -0
- package/cdh/cdh_session_aggregator.py +0 -258
- package/cdh/cli.py +0 -3000
- package/cdh/cli_logging.py +0 -45
- package/cdh/config.py +0 -28
- package/cdh/event_loop/__init__.py +0 -7
- package/cdh/event_loop/bus.py +0 -123
- package/cdh/event_loop/events.py +0 -25
- package/cdh/event_loop/runner.py +0 -28
- package/cdh/event_loop/scheduler.py +0 -158
- package/cdh/generators/__init__.py +0 -35
- package/cdh/generators/_runtime.py +0 -176
- package/cdh/generators/ada/MANIFEST.toml +0 -14
- package/cdh/generators/ada/template.ads.tmpl +0 -7
- package/cdh/generators/bash/MANIFEST.toml +0 -14
- package/cdh/generators/bash/template.sh.tmpl +0 -16
- package/cdh/generators/builtin_index.json +0 -590
- package/cdh/generators/c/MANIFEST.toml +0 -14
- package/cdh/generators/c/template.h.tmpl +0 -20
- package/cdh/generators/cli.py +0 -379
- package/cdh/generators/clojure/MANIFEST.toml +0 -14
- package/cdh/generators/clojure/template.clj.tmpl +0 -13
- package/cdh/generators/cobol/MANIFEST.toml +0 -14
- package/cdh/generators/cobol/template.cbl.tmpl +0 -14
- package/cdh/generators/cpp/MANIFEST.toml +0 -14
- package/cdh/generators/cpp/template.hpp.tmpl +0 -32
- package/cdh/generators/crystal/MANIFEST.toml +0 -14
- package/cdh/generators/crystal/template.cr.tmpl +0 -11
- package/cdh/generators/csharp/MANIFEST.toml +0 -23
- package/cdh/generators/csharp/template.cs.tmpl +0 -14
- package/cdh/generators/cython/MANIFEST.toml +0 -14
- package/cdh/generators/cython/template.pyx.tmpl +0 -17
- package/cdh/generators/d/MANIFEST.toml +0 -14
- package/cdh/generators/d/template.d.tmpl +0 -24
- package/cdh/generators/dart/MANIFEST.toml +0 -17
- package/cdh/generators/dart/template.dart.tmpl +0 -27
- package/cdh/generators/elixir/MANIFEST.toml +0 -17
- package/cdh/generators/elixir/template.ex.tmpl +0 -27
- package/cdh/generators/elm/MANIFEST.toml +0 -14
- package/cdh/generators/elm/template.elm.tmpl +0 -20
- package/cdh/generators/erlang/MANIFEST.toml +0 -14
- package/cdh/generators/erlang/template.erl.tmpl +0 -18
- package/cdh/generators/fortran/MANIFEST.toml +0 -14
- package/cdh/generators/fortran/template.f90.tmpl +0 -24
- package/cdh/generators/fsharp/MANIFEST.toml +0 -14
- package/cdh/generators/fsharp/template.fs.tmpl +0 -17
- package/cdh/generators/go/MANIFEST.toml +0 -18
- package/cdh/generators/go/imports.go.tmpl +0 -3
- package/cdh/generators/go/template.go.tmpl +0 -9
- package/cdh/generators/graphql-schema/MANIFEST.toml +0 -18
- package/cdh/generators/graphql-schema/template.graphqls.tmpl +0 -12
- package/cdh/generators/groovy/MANIFEST.toml +0 -14
- package/cdh/generators/groovy/template.groovy.tmpl +0 -28
- package/cdh/generators/hack/MANIFEST.toml +0 -14
- package/cdh/generators/hack/template.hh.tmpl +0 -24
- package/cdh/generators/haskell/MANIFEST.toml +0 -14
- package/cdh/generators/haskell/template.hs.tmpl +0 -20
- package/cdh/generators/haxe/MANIFEST.toml +0 -14
- package/cdh/generators/haxe/template.hx.tmpl +0 -20
- package/cdh/generators/idris/MANIFEST.toml +0 -14
- package/cdh/generators/idris/template.idr.tmpl +0 -22
- package/cdh/generators/java/MANIFEST.toml +0 -18
- package/cdh/generators/java/template.java.tmpl +0 -13
- package/cdh/generators/julia/MANIFEST.toml +0 -14
- package/cdh/generators/julia/template.jl.tmpl +0 -27
- package/cdh/generators/kotlin/MANIFEST.toml +0 -18
- package/cdh/generators/kotlin/template.kt.tmpl +0 -12
- package/cdh/generators/lua/MANIFEST.toml +0 -14
- package/cdh/generators/lua/template.lua.tmpl +0 -27
- package/cdh/generators/matlab/MANIFEST.toml +0 -14
- package/cdh/generators/matlab/template.m.tmpl +0 -26
- package/cdh/generators/nim/MANIFEST.toml +0 -14
- package/cdh/generators/nim/template.nim.tmpl +0 -12
- package/cdh/generators/nix/MANIFEST.toml +0 -14
- package/cdh/generators/nix/template.nix.tmpl +0 -8
- package/cdh/generators/objective-c/MANIFEST.toml +0 -14
- package/cdh/generators/objective-c/template.m.tmpl +0 -31
- package/cdh/generators/ocaml/MANIFEST.toml +0 -14
- package/cdh/generators/ocaml/template.ml.tmpl +0 -13
- package/cdh/generators/pascal/MANIFEST.toml +0 -14
- package/cdh/generators/pascal/template.pas.tmpl +0 -5
- package/cdh/generators/perl/MANIFEST.toml +0 -14
- package/cdh/generators/perl/template.pm.tmpl +0 -27
- package/cdh/generators/php/MANIFEST.toml +0 -17
- package/cdh/generators/php/template.php.tmpl +0 -31
- package/cdh/generators/powershell/MANIFEST.toml +0 -14
- package/cdh/generators/powershell/template.ps1.tmpl +0 -20
- package/cdh/generators/protobuf/MANIFEST.toml +0 -18
- package/cdh/generators/protobuf/template.proto.tmpl +0 -13
- package/cdh/generators/python/MANIFEST.toml +0 -18
- package/cdh/generators/python/template.py.tmpl +0 -12
- package/cdh/generators/r/MANIFEST.toml +0 -14
- package/cdh/generators/r/template.R.tmpl +0 -29
- package/cdh/generators/racket/MANIFEST.toml +0 -14
- package/cdh/generators/racket/template.rkt.tmpl +0 -15
- package/cdh/generators/registry.py +0 -211
- package/cdh/generators/ruby/MANIFEST.toml +0 -17
- package/cdh/generators/ruby/template.rb.tmpl +0 -27
- package/cdh/generators/rust/MANIFEST.toml +0 -18
- package/cdh/generators/rust/template.rs.tmpl +0 -16
- package/cdh/generators/scala/MANIFEST.toml +0 -20
- package/cdh/generators/scala/template.scala.tmpl +0 -13
- package/cdh/generators/scheme/MANIFEST.toml +0 -14
- package/cdh/generators/scheme/template.scm.tmpl +0 -16
- package/cdh/generators/solidity/MANIFEST.toml +0 -14
- package/cdh/generators/solidity/template.sol.tmpl +0 -24
- package/cdh/generators/swift/MANIFEST.toml +0 -18
- package/cdh/generators/swift/template.swift.tmpl +0 -10
- package/cdh/generators/typescript/MANIFEST.toml +0 -18
- package/cdh/generators/typescript/template.ts.tmpl +0 -7
- package/cdh/generators/version.py +0 -214
- package/cdh/generators/zig/MANIFEST.toml +0 -14
- package/cdh/generators/zig/template.zig.tmpl +0 -20
- package/cdh/logging.py +0 -314
- package/cdh/optimizer/__init__.py +0 -7
- package/cdh/optimizer/loop.py +0 -201
- package/cdh/optimizer/mutation.py +0 -85
- package/cdh/optimizer/reward.py +0 -51
- package/cdh/optimizer/tracker.py +0 -118
- package/cdh/project_loader.py +0 -1022
- package/cdh/rules/patterns.yaml +0 -132
- package/cdh/rules/spectral.yaml +0 -301
- package/cdh/scaffold.py +0 -1436
- package/cdh/session_store.py +0 -221
- package/cdh/state_schema.py +0 -127
- package/cdh/tools/__init__.py +0 -57
- package/cdh/tools/cls_search.py +0 -406
- package/cdh/tools/contract_diff.py +0 -644
- package/cdh/tools/deploy_stack.py +0 -590
- package/cdh/tools/generate_shared.py +0 -300
- package/cdh/tools/iac_gen.py +0 -224
- package/cdh/tools/otel_export.py +0 -125
- package/cdh/tools/pattern_detect.py +0 -451
- package/cdh/tools/retrofit_labels.py +0 -505
- package/cdh/trace/__init__.py +0 -101
- package/cdh/trace/__pycache__/__init__.cpython-314.pyc +0 -0
- package/cdh/trace/dashboard/__init__.py +0 -61
- package/cdh/trace/dashboard/api.py +0 -1032
- package/cdh/trace/dashboard/app.html +0 -1321
- package/cdh/trace/dashboard/server.py +0 -310
- package/cdh/trace/otel_exporter.py +0 -462
- package/cdh/trace/otel_tracer.py +0 -281
- package/cdh/tui.py +0 -1084
- package/cdh/validators/__init__.py +0 -16
- package/cdh/validators/__pycache__/__init__.cpython-314.pyc +0 -0
- package/cdh/validators/__pycache__/bdd.cpython-314.pyc +0 -0
- package/cdh/validators/__pycache__/dag.cpython-314.pyc +0 -0
- package/cdh/validators/__pycache__/ears.cpython-314.pyc +0 -0
- package/cdh/validators/__pycache__/fr_namespace.cpython-314.pyc +0 -0
- package/cdh/validators/bdd.py +0 -144
- package/cdh/validators/dag.py +0 -179
- package/cdh/validators/ears.py +0 -452
- package/cdh/validators/fr_namespace.py +0 -143
- package/cdh/validators/spectral.py +0 -475
- package/cdh/verification/__init__.py +0 -3
- package/cdh/verification/aggregation.py +0 -53
- package/cdh/verification/gates/__init__.py +0 -5
- package/cdh/verification/gates/base.py +0 -18
- package/cdh/verification/gates/lint_gate.py +0 -37
- package/cdh/verification/gates/test_gate.py +0 -41
- package/cdh/verification/loop.py +0 -93
- package/cdh/verification/policy.py +0 -24
- 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__/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__/checkpoint.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/__pycache__/turn_record.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/prompts/build-agent.md +0 -50
- package/onecode/agent/agents/prompts/compaction-instructions.md +0 -12
- package/onecode/agent/agents/prompts/explore-agent.md +0 -42
- package/onecode/agent/agents/prompts/plan-agent.md +0 -44
- package/onecode/agent/agents/prompts/plan-gate-hard.md +0 -4
- package/onecode/agent/agents/prompts/plan-gate-soft.md +0 -3
- package/onecode/agent/agents/prompts/solo-agent.md +0 -57
- package/onecode/agent/agents/prompts/subagent-constraints.md +0 -10
- package/onecode/agent/agents/prompts/summary-instructions.md +0 -7
- package/onecode/agent/agents/prompts/title-instructions.md +0 -3
- package/onecode/agent/agents/prompts/tool-descriptions.md +0 -129
- package/onecode/agent/agents/types.py +0 -786
- package/onecode/agent/attachments.py +0 -112
- package/onecode/agent/cdh_loader.py +0 -3
- package/onecode/agent/checkpoint.py +0 -285
- package/onecode/agent/context.py +0 -465
- package/onecode/agent/engine.py +0 -3547
- package/onecode/agent/event_bridge.py +0 -75
- package/onecode/agent/hooks.py +0 -86
- package/onecode/agent/onecode_agent_acp.py +0 -2993
- package/onecode/agent/permissions.py +0 -150
- package/onecode/agent/permissions_store.py +0 -73
- package/onecode/agent/project_doc.py +0 -19
- package/onecode/agent/question_detect.py +0 -230
- package/onecode/agent/session.py +0 -3
- 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 -128
- package/onecode/agent/tools/apply_patch_tool.py +0 -138
- package/onecode/agent/tools/bash_tool.py +0 -121
- package/onecode/agent/tools/communication_tools.py +0 -154
- 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 -211
- 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 -210
- package/onecode/agent/tools/sandbox.py +0 -460
- 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 -208
- package/onecode/agent/tools/web_tools.py +0 -530
- package/onecode/agent/turn_record.py +0 -28
- package/onecode/builtin_skills/agent-browser/SKILL.md +0 -212
- package/onecode/builtin_skills/agent-browser/skill.yaml +0 -8
- package/onecode/builtin_skills/cloudbase/SKILL.md +0 -162
- package/onecode/builtin_skills/cloudbase/skill.yaml +0 -7
- 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 -1325
- 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 -154
- package/onecode/codebase/retriever.py +0 -240
- package/onecode/codebase/storage.py +0 -153
- package/onecode/codebase/tools.py +0 -59
- package/onecode/commands.py +0 -673
- package/onecode/config.py +0 -539
- package/onecode/config_screen.py +0 -486
- package/onecode/cron/__init__.py +0 -3
- package/onecode/lsp/__init__.py +0 -3
- package/onecode/mcp/__init__.py +0 -11
- package/onecode/mcp/__pycache__/__init__.cpython-314.pyc +0 -0
- package/onecode/mcp/__pycache__/client.cpython-314.pyc +0 -0
- package/onecode/mcp/__pycache__/cloudbase.cpython-314.pyc +0 -0
- package/onecode/mcp/__pycache__/config.cpython-314.pyc +0 -0
- package/onecode/mcp/__pycache__/manager.cpython-314.pyc +0 -0
- package/onecode/mcp/__pycache__/oauth.cpython-314.pyc +0 -0
- package/onecode/mcp/client.py +0 -305
- package/onecode/mcp/cloudbase.py +0 -188
- package/onecode/mcp/config.py +0 -363
- package/onecode/mcp/manager.py +0 -603
- package/onecode/mcp/oauth.py +0 -199
- package/onecode/memory/__init__.py +0 -106
- package/onecode/memory/__pycache__/__init__.cpython-314.pyc +0 -0
- package/onecode/memory/__pycache__/backend.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/backend.py +0 -179
- package/onecode/memory/pyramid.py +0 -145
- package/onecode/memory/recall.py +0 -322
- 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__/ollama_manager.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 -750
- package/onecode/models/ollama_manager.py +0 -167
- package/onecode/models/provider.py +0 -730
- 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 -286
- package/onecode/models/providers/deepseek_provider.py +0 -221
- package/onecode/models/providers/glm_provider.py +0 -219
- package/onecode/models/providers/minimax_provider.py +0 -182
- package/onecode/models/providers/minimaxi_provider.py +0 -426
- package/onecode/models/providers/ollama_provider.py +0 -183
- package/onecode/models/providers/openai_provider.py +0 -234
- package/onecode/models/registry.py +0 -349
- package/onecode/server/__init__.py +0 -3
- package/onecode/server/app.py +0 -251
- 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__/model.cpython-314.pyc +0 -0
- package/onecode/skills/argument_substitution.py +0 -38
- package/onecode/skills/bootstrap.py +0 -37
- package/onecode/skills/create.py +0 -56
- package/onecode/skills/frontmatter.py +0 -33
- package/onecode/skills/loader.py +0 -215
- 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/onecode/verification/__init__.py +0 -5
- package/onecode/verification/__pycache__/__init__.cpython-314.pyc +0 -0
- package/onecode/verification/__pycache__/aggregation.cpython-314.pyc +0 -0
- package/onecode/verification/__pycache__/loop.cpython-314.pyc +0 -0
- package/onecode/verification/__pycache__/policy.cpython-314.pyc +0 -0
- package/onecode/verification/aggregation.py +0 -53
- package/onecode/verification/gates/__init__.py +0 -6
- package/onecode/verification/gates/__pycache__/__init__.cpython-314.pyc +0 -0
- package/onecode/verification/gates/__pycache__/base.cpython-314.pyc +0 -0
- package/onecode/verification/gates/__pycache__/lint_gate.cpython-314.pyc +0 -0
- package/onecode/verification/gates/__pycache__/test_gate.cpython-314.pyc +0 -0
- package/onecode/verification/gates/__pycache__/type_gate.cpython-314.pyc +0 -0
- package/onecode/verification/gates/base.py +0 -20
- package/onecode/verification/gates/lint_gate.py +0 -45
- package/onecode/verification/gates/test_gate.py +0 -62
- package/onecode/verification/gates/type_gate.py +0 -46
- package/onecode/verification/loop.py +0 -95
- package/onecode/verification/policy.py +0 -29
- package/pyproject.toml +0 -84
- 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__/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__/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_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__/event_tap.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 -1212
- package/tui/acp/api.py +0 -79
- package/tui/acp/encode_tool_call_id.py +0 -12
- package/tui/acp/event_tap.py +0 -107
- package/tui/acp/messages.py +0 -222
- package/tui/acp/prompt.py +0 -53
- package/tui/acp/protocol.py +0 -551
- 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 -1195
- package/tui/atomic.py +0 -37
- package/tui/cli.py +0 -208
- 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 -42
- 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/diff_utils.py +0 -131
- 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 -599
- 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__/diff_screen.cpython-314.pyc +0 -0
- package/tui/screens/__pycache__/main.cpython-314.pyc +0 -0
- package/tui/screens/__pycache__/sessions.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/diff_explorer_screen.py +0 -419
- package/tui/screens/diff_screen.py +0 -84
- package/tui/screens/ide_screen.py +0 -461
- package/tui/screens/main.py +0 -397
- package/tui/screens/main.tcss +0 -662
- package/tui/screens/permissions.py +0 -404
- package/tui/screens/permissions.tcss +0 -72
- package/tui/screens/projects.tcss +0 -84
- package/tui/screens/projects_app.py +0 -341
- package/tui/screens/projects_screen.py +0 -277
- package/tui/screens/session_resume_modal.py +0 -172
- package/tui/screens/session_resume_modal.tcss +0 -35
- package/tui/screens/sessions.py +0 -171
- package/tui/screens/sessions.tcss +0 -119
- package/tui/screens/settings.py +0 -293
- package/tui/screens/settings.tcss +0 -113
- package/tui/screens/store.py +0 -502
- package/tui/screens/store.tcss +0 -274
- package/tui/screens/tool_content_screen.py +0 -59
- package/tui/screens/trace.py +0 -317
- package/tui/session_tracker.py +0 -123
- package/tui/settings.py +0 -353
- package/tui/settings_schema.py +0 -467
- 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__/agent_response.cpython-314.pyc +0 -0
- package/tui/widgets/__pycache__/agent_thought.cpython-314.pyc +0 -0
- package/tui/widgets/__pycache__/aidlc.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__/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__/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__/pending_prompts.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__/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_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__/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/aidlc.py +0 -334
- package/tui/widgets/ask_user.py +0 -604
- 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 -3235
- 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/edit_field.py +0 -206
- 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 -183
- 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/model_status.py +0 -230
- package/tui/widgets/modified_files.py +0 -315
- 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/pending_prompts.py +0 -36
- package/tui/widgets/plan.py +0 -285
- package/tui/widgets/project_directory_tree.py +0 -102
- package/tui/widgets/project_grid_select.py +0 -68
- package/tui/widgets/project_summary.py +0 -33
- package/tui/widgets/prompt.py +0 -935
- 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 -194
- 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 -715
- 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 -432
- package/tui/widgets/user_input.py +0 -23
- package/tui/widgets/version.py +0 -5
- package/tui/widgets/welcome.py +0 -31
|
@@ -1,505 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env python3
|
|
2
|
-
"""retrofit_labels.py — Brownfield migration tool.
|
|
3
|
-
|
|
4
|
-
Scans existing source code for TODO/FIXME/XXX/HACK/REQ/AS-A comments,
|
|
5
|
-
extracts them as candidate requirements, prompts the user to confirm or
|
|
6
|
-
skip each candidate, and emits a spec-delta.md per confirmed candidate.
|
|
7
|
-
Tree-sitter enriches candidates with structural context when available.
|
|
8
|
-
|
|
9
|
-
Usage:
|
|
10
|
-
retrofit_labels.py [--project-root PATH]
|
|
11
|
-
[--extensions .py,.ts,.js,.java,.go]
|
|
12
|
-
[--output-dir PATH]
|
|
13
|
-
[--batch]
|
|
14
|
-
[--from-source PATH]
|
|
15
|
-
[--ast-level none|function|class|module]
|
|
16
|
-
[--use-ast | --no-ast]
|
|
17
|
-
[--include-imports]
|
|
18
|
-
[--include-signatures | --no-include-signatures]
|
|
19
|
-
"""
|
|
20
|
-
|
|
21
|
-
from __future__ import annotations
|
|
22
|
-
|
|
23
|
-
import argparse
|
|
24
|
-
import re
|
|
25
|
-
import sys
|
|
26
|
-
from dataclasses import dataclass, field
|
|
27
|
-
from pathlib import Path
|
|
28
|
-
from typing import Any, Iterator, Optional
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
PATTERN = re.compile(r"(?:TODO|FIXME|XXX|HACK|REQ|AS-A):?\s*(.*)")
|
|
32
|
-
FR_PREFIX = "BE-FR-"
|
|
33
|
-
EARS_PREFIX = "the system shall"
|
|
34
|
-
FUNCTION_NODES = {"function_definition", "function_declaration", "method_definition", "method_declaration"}
|
|
35
|
-
CLASS_NODES = {"class_definition", "class_declaration", "interface_declaration", "enum_declaration"}
|
|
36
|
-
IMPORT_NODES = {"import_statement", "import_from_statement", "import_declaration", "package_clause"}
|
|
37
|
-
LANGUAGE_MODULES = {
|
|
38
|
-
".py": ("tree_sitter_python", "python"),
|
|
39
|
-
".js": ("tree_sitter_javascript", "javascript"),
|
|
40
|
-
".jsx": ("tree_sitter_javascript", "javascript"),
|
|
41
|
-
".ts": ("tree_sitter_typescript", "typescript"),
|
|
42
|
-
".tsx": ("tree_sitter_typescript", "tsx"),
|
|
43
|
-
".java": ("tree_sitter_java", "java"),
|
|
44
|
-
".go": ("tree_sitter_go", "go"),
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
@dataclass
|
|
49
|
-
class Definition:
|
|
50
|
-
kind: str
|
|
51
|
-
name: str
|
|
52
|
-
signature: str = ""
|
|
53
|
-
decorators: list[str] = field(default_factory=list)
|
|
54
|
-
docstring: str = ""
|
|
55
|
-
bases: list[str] = field(default_factory=list)
|
|
56
|
-
start_line: int = 0
|
|
57
|
-
end_line: int = 0
|
|
58
|
-
start_byte: int = 0
|
|
59
|
-
end_byte: int = 0
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
@dataclass
|
|
63
|
-
class SourceContext:
|
|
64
|
-
module: str
|
|
65
|
-
imports: list[str] = field(default_factory=list)
|
|
66
|
-
functions: list[Definition] = field(default_factory=list)
|
|
67
|
-
classes: list[Definition] = field(default_factory=list)
|
|
68
|
-
ast_used: bool = False
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
@dataclass
|
|
72
|
-
class Candidate:
|
|
73
|
-
file: Path
|
|
74
|
-
line: int
|
|
75
|
-
raw: str
|
|
76
|
-
tag: str
|
|
77
|
-
text: str
|
|
78
|
-
ears: str
|
|
79
|
-
context: Optional[Definition] = None
|
|
80
|
-
class_context: Optional[Definition] = None
|
|
81
|
-
source_context: Optional[SourceContext] = None
|
|
82
|
-
snippet: str = ""
|
|
83
|
-
ast_level: str = "function"
|
|
84
|
-
include_imports: bool = False
|
|
85
|
-
include_signatures: bool = True
|
|
86
|
-
|
|
87
|
-
@property
|
|
88
|
-
def rel_path(self) -> str:
|
|
89
|
-
try:
|
|
90
|
-
return str(self.file.resolve().relative_to(Path.cwd().resolve()))
|
|
91
|
-
except ValueError:
|
|
92
|
-
return str(self.file)
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
class TreeSitterAnalyzer:
|
|
96
|
-
def __init__(self) -> None:
|
|
97
|
-
self._languages: dict[str, Any] = {}
|
|
98
|
-
self._parser_class: Any = None
|
|
99
|
-
try:
|
|
100
|
-
from tree_sitter import Language, Parser
|
|
101
|
-
|
|
102
|
-
self._language_class = Language
|
|
103
|
-
self._parser_class = Parser
|
|
104
|
-
except ImportError:
|
|
105
|
-
self._language_class = None
|
|
106
|
-
|
|
107
|
-
@property
|
|
108
|
-
def available(self) -> bool:
|
|
109
|
-
return self._parser_class is not None
|
|
110
|
-
|
|
111
|
-
def _language(self, suffix: str) -> Any:
|
|
112
|
-
if suffix in self._languages:
|
|
113
|
-
return self._languages[suffix]
|
|
114
|
-
module_info = LANGUAGE_MODULES.get(suffix)
|
|
115
|
-
if not module_info or not self.available:
|
|
116
|
-
return None
|
|
117
|
-
module_name, dialect = module_info
|
|
118
|
-
try:
|
|
119
|
-
module = __import__(module_name)
|
|
120
|
-
factory = getattr(module, "language", None)
|
|
121
|
-
if suffix in {".ts", ".tsx"}:
|
|
122
|
-
factory = getattr(module, f"language_{dialect}", factory)
|
|
123
|
-
language = factory() if factory else None
|
|
124
|
-
if language is not None and self._language_class is not None:
|
|
125
|
-
try:
|
|
126
|
-
language = self._language_class(language)
|
|
127
|
-
except (TypeError, ValueError):
|
|
128
|
-
pass
|
|
129
|
-
self._languages[suffix] = language
|
|
130
|
-
return language
|
|
131
|
-
except (ImportError, AttributeError, TypeError, ValueError):
|
|
132
|
-
self._languages[suffix] = None
|
|
133
|
-
return None
|
|
134
|
-
|
|
135
|
-
def _parser(self, suffix: str) -> Any:
|
|
136
|
-
language = self._language(suffix)
|
|
137
|
-
if language is None:
|
|
138
|
-
return None
|
|
139
|
-
try:
|
|
140
|
-
return self._parser_class(language)
|
|
141
|
-
except TypeError:
|
|
142
|
-
parser = self._parser_class()
|
|
143
|
-
try:
|
|
144
|
-
parser.language = language
|
|
145
|
-
except (AttributeError, TypeError):
|
|
146
|
-
parser.set_language(language)
|
|
147
|
-
return parser
|
|
148
|
-
|
|
149
|
-
def analyze(self, path: Path, source: bytes) -> SourceContext:
|
|
150
|
-
result = SourceContext(module=path.stem)
|
|
151
|
-
parser = self._parser(path.suffix.lower())
|
|
152
|
-
if parser is None:
|
|
153
|
-
return result
|
|
154
|
-
try:
|
|
155
|
-
root = parser.parse(source).root_node
|
|
156
|
-
except (AttributeError, TypeError, ValueError):
|
|
157
|
-
return result
|
|
158
|
-
result.ast_used = True
|
|
159
|
-
stack = [root]
|
|
160
|
-
while stack:
|
|
161
|
-
node = stack.pop()
|
|
162
|
-
if node.type in IMPORT_NODES:
|
|
163
|
-
value = _node_text(node, source).strip()
|
|
164
|
-
if value and value not in result.imports:
|
|
165
|
-
result.imports.append(value)
|
|
166
|
-
if node.type in FUNCTION_NODES:
|
|
167
|
-
result.functions.append(self._function(node, source))
|
|
168
|
-
elif node.type in CLASS_NODES:
|
|
169
|
-
result.classes.append(self._class(node, source))
|
|
170
|
-
stack.extend(reversed(node.children))
|
|
171
|
-
return result
|
|
172
|
-
|
|
173
|
-
def _function(self, node: Any, source: bytes) -> Definition:
|
|
174
|
-
name_node = node.child_by_field_name("name")
|
|
175
|
-
name = _node_text(name_node, source).strip() if name_node else "<anonymous>"
|
|
176
|
-
body = node.child_by_field_name("body")
|
|
177
|
-
signature_end = body.start_byte if body else node.end_byte
|
|
178
|
-
signature = source[node.start_byte:signature_end].decode("utf-8", "replace").strip().rstrip("{: ")
|
|
179
|
-
decorators: list[str] = []
|
|
180
|
-
parent = node.parent
|
|
181
|
-
if parent is not None and parent.type in {"decorated_definition", "decorator"}:
|
|
182
|
-
decorators = [
|
|
183
|
-
_node_text(child, source).strip()
|
|
184
|
-
for child in parent.children
|
|
185
|
-
if child.type == "decorator"
|
|
186
|
-
]
|
|
187
|
-
return Definition(
|
|
188
|
-
kind="function",
|
|
189
|
-
name=name,
|
|
190
|
-
signature=" ".join(signature.split()),
|
|
191
|
-
decorators=decorators,
|
|
192
|
-
docstring=_extract_docstring(body, source),
|
|
193
|
-
start_line=node.start_point[0] + 1,
|
|
194
|
-
end_line=node.end_point[0] + 1,
|
|
195
|
-
start_byte=node.start_byte,
|
|
196
|
-
end_byte=node.end_byte,
|
|
197
|
-
)
|
|
198
|
-
|
|
199
|
-
def _class(self, node: Any, source: bytes) -> Definition:
|
|
200
|
-
name_node = node.child_by_field_name("name")
|
|
201
|
-
name = _node_text(name_node, source).strip() if name_node else "<anonymous>"
|
|
202
|
-
bases_node = node.child_by_field_name("superclasses") or node.child_by_field_name("interfaces")
|
|
203
|
-
bases = []
|
|
204
|
-
if bases_node is not None:
|
|
205
|
-
bases = [
|
|
206
|
-
_node_text(child, source).strip()
|
|
207
|
-
for child in bases_node.named_children
|
|
208
|
-
if _node_text(child, source).strip()
|
|
209
|
-
]
|
|
210
|
-
body = node.child_by_field_name("body")
|
|
211
|
-
return Definition(
|
|
212
|
-
kind="class",
|
|
213
|
-
name=name,
|
|
214
|
-
bases=bases,
|
|
215
|
-
docstring=_extract_docstring(body, source),
|
|
216
|
-
start_line=node.start_point[0] + 1,
|
|
217
|
-
end_line=node.end_point[0] + 1,
|
|
218
|
-
start_byte=node.start_byte,
|
|
219
|
-
end_byte=node.end_byte,
|
|
220
|
-
)
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
def _node_text(node: Any, source: bytes) -> str:
|
|
224
|
-
return source[node.start_byte:node.end_byte].decode("utf-8", "replace")
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
def _extract_docstring(body: Any, source: bytes) -> str:
|
|
228
|
-
if body is None:
|
|
229
|
-
return ""
|
|
230
|
-
named = list(body.named_children)
|
|
231
|
-
if not named:
|
|
232
|
-
return ""
|
|
233
|
-
first = named[0]
|
|
234
|
-
expression = first.named_children[0] if first.type == "expression_statement" and first.named_children else first
|
|
235
|
-
if expression.type not in {"string", "string_literal"}:
|
|
236
|
-
return ""
|
|
237
|
-
text = _node_text(expression, source).strip()
|
|
238
|
-
return re.sub(r"^(?:[rubfRUBF]*)(?:'''|\"\"\"|'|\")|(?:'''|\"\"\"|'|\")$", "", text).strip()
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
def _iter_source_files(root: Path, extensions: list[str], from_source: Optional[Path]) -> Iterator[Path]:
|
|
242
|
-
base = (root / from_source) if from_source else root
|
|
243
|
-
if not base.exists():
|
|
244
|
-
return
|
|
245
|
-
ext_set = {e.lower() if e.startswith(".") else f".{e.lower()}" for e in extensions}
|
|
246
|
-
for path in base.rglob("*"):
|
|
247
|
-
if path.is_file() and path.suffix.lower() in ext_set:
|
|
248
|
-
yield path
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
def _strip_comment(text: str) -> str:
|
|
252
|
-
for prefix in ("#", "//", "--", "/*", "*"):
|
|
253
|
-
if text.lstrip().startswith(prefix):
|
|
254
|
-
text = text.lstrip()[len(prefix):]
|
|
255
|
-
break
|
|
256
|
-
return text.strip().rstrip("*/").strip()
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
def _scope_phrase(name: str) -> str:
|
|
260
|
-
words = re.sub(r"([a-z0-9])([A-Z])", r"\1 \2", name)
|
|
261
|
-
words = re.sub(r"[_\-.]+", " ", words).strip().lower()
|
|
262
|
-
return words
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
def _to_ears(text: str, scope: str = "") -> str:
|
|
266
|
-
stripped = text.strip()
|
|
267
|
-
if not stripped:
|
|
268
|
-
return stripped
|
|
269
|
-
lowered = stripped.lower()
|
|
270
|
-
if lowered.startswith(EARS_PREFIX):
|
|
271
|
-
requirement = stripped if stripped.endswith(".") else f"{stripped}."
|
|
272
|
-
else:
|
|
273
|
-
rest = stripped[0].lower() + stripped[1:]
|
|
274
|
-
requirement = f"{EARS_PREFIX} {rest.rstrip('.')} .".replace(" .", ".")
|
|
275
|
-
if scope:
|
|
276
|
-
return f"While {_scope_phrase(scope)}, {requirement}"
|
|
277
|
-
return requirement
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
def _smallest_enclosing(definitions: list[Definition], line: int) -> Optional[Definition]:
|
|
281
|
-
matches = [item for item in definitions if item.start_line <= line <= item.end_line]
|
|
282
|
-
return min(matches, key=lambda item: item.end_line - item.start_line, default=None)
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
def _snippet(lines: list[str], line: int, context: Optional[Definition]) -> str:
|
|
286
|
-
start = max(1, line - 2)
|
|
287
|
-
end = min(len(lines), line + 2)
|
|
288
|
-
if context:
|
|
289
|
-
start = max(context.start_line, start)
|
|
290
|
-
end = min(context.end_line, end)
|
|
291
|
-
width = len(str(end))
|
|
292
|
-
return "\n".join(f"{number:>{width}} | {lines[number - 1]}" for number in range(start, end + 1))
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
def _next_fr_id(output_dir: Path) -> str:
|
|
296
|
-
if not output_dir.exists():
|
|
297
|
-
return f"{FR_PREFIX}001"
|
|
298
|
-
nums: list[int] = []
|
|
299
|
-
for file in output_dir.glob("spec-delta-*.md"):
|
|
300
|
-
match = re.search(r"spec-delta-(\d+)", file.name)
|
|
301
|
-
if match:
|
|
302
|
-
nums.append(int(match.group(1)))
|
|
303
|
-
return f"{FR_PREFIX}{(max(nums) if nums else 0) + 1:03d}"
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
def scan(
|
|
307
|
-
root: Path,
|
|
308
|
-
extensions: list[str],
|
|
309
|
-
from_source: Optional[Path],
|
|
310
|
-
use_ast: bool = True,
|
|
311
|
-
ast_level: str = "function",
|
|
312
|
-
include_imports: bool = False,
|
|
313
|
-
include_signatures: bool = True,
|
|
314
|
-
) -> list[Candidate]:
|
|
315
|
-
found: list[Candidate] = []
|
|
316
|
-
analyzer = TreeSitterAnalyzer() if use_ast else None
|
|
317
|
-
for path in _iter_source_files(root, extensions, from_source):
|
|
318
|
-
try:
|
|
319
|
-
source = path.read_bytes()
|
|
320
|
-
lines = source.decode("utf-8", "replace").splitlines()
|
|
321
|
-
except OSError:
|
|
322
|
-
continue
|
|
323
|
-
source_context = analyzer.analyze(path, source) if analyzer else SourceContext(module=path.stem)
|
|
324
|
-
for idx, line in enumerate(lines, start=1):
|
|
325
|
-
for match in PATTERN.finditer(line):
|
|
326
|
-
raw = match.group(1).strip()
|
|
327
|
-
if not raw:
|
|
328
|
-
continue
|
|
329
|
-
tag = line[match.start():match.end()].split(":", 1)[0].split()[0]
|
|
330
|
-
cleaned = _strip_comment(raw)
|
|
331
|
-
function_context = _smallest_enclosing(source_context.functions, idx)
|
|
332
|
-
class_context = _smallest_enclosing(source_context.classes, idx)
|
|
333
|
-
if ast_level == "function":
|
|
334
|
-
context = function_context or class_context
|
|
335
|
-
elif ast_level == "class":
|
|
336
|
-
context = class_context
|
|
337
|
-
elif ast_level == "module":
|
|
338
|
-
context = Definition("module", source_context.module, start_line=1, end_line=len(lines))
|
|
339
|
-
else:
|
|
340
|
-
context = None
|
|
341
|
-
found.append(
|
|
342
|
-
Candidate(
|
|
343
|
-
file=path,
|
|
344
|
-
line=idx,
|
|
345
|
-
raw=line.strip(),
|
|
346
|
-
tag=tag,
|
|
347
|
-
text=cleaned,
|
|
348
|
-
ears=_to_ears(cleaned, context.name if context else ""),
|
|
349
|
-
context=context,
|
|
350
|
-
class_context=class_context,
|
|
351
|
-
source_context=source_context,
|
|
352
|
-
snippet=_snippet(lines, idx, context),
|
|
353
|
-
ast_level=ast_level,
|
|
354
|
-
include_imports=include_imports,
|
|
355
|
-
include_signatures=include_signatures,
|
|
356
|
-
)
|
|
357
|
-
)
|
|
358
|
-
return found
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
def _confirm(prompt: str, batch: bool) -> bool:
|
|
362
|
-
if batch:
|
|
363
|
-
return True
|
|
364
|
-
try:
|
|
365
|
-
answer = input(f"{prompt} [y/N/q]: ").strip().lower()
|
|
366
|
-
except EOFError:
|
|
367
|
-
return False
|
|
368
|
-
if answer in ("q", "quit"):
|
|
369
|
-
raise KeyboardInterrupt
|
|
370
|
-
return answer in ("y", "yes")
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
def _markdown_value(value: str) -> str:
|
|
374
|
-
return value.replace("`", "\\`").replace("\n", " ")
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
def render_spec_delta(fr_id: str, candidate: Candidate) -> str:
|
|
378
|
-
title = candidate.text[:80].rstrip(".").strip() or candidate.tag
|
|
379
|
-
context = candidate.context
|
|
380
|
-
ast_used = bool(candidate.source_context and candidate.source_context.ast_used)
|
|
381
|
-
parts = [
|
|
382
|
-
"---",
|
|
383
|
-
f"id: {fr_id}",
|
|
384
|
-
f"title: {title}",
|
|
385
|
-
"status: draft",
|
|
386
|
-
f"source: {candidate.rel_path}:{candidate.line}",
|
|
387
|
-
f"tag: {candidate.tag}",
|
|
388
|
-
f"analysis: {'tree-sitter' if ast_used else 'regex'}",
|
|
389
|
-
]
|
|
390
|
-
if context:
|
|
391
|
-
parts.extend((f"scope: {context.kind}", f"scope_name: {context.name}"))
|
|
392
|
-
parts.extend(("---", "", f"# {fr_id}: {title}", ""))
|
|
393
|
-
parts.extend(
|
|
394
|
-
(
|
|
395
|
-
f"**Source**: `{candidate.rel_path}:{candidate.line}`",
|
|
396
|
-
f"**Original**: `{_markdown_value(candidate.raw)}`",
|
|
397
|
-
f"**Analysis**: {'tree-sitter AST' if ast_used else 'regex fallback'}",
|
|
398
|
-
)
|
|
399
|
-
)
|
|
400
|
-
if context:
|
|
401
|
-
parts.append(f"**Scope**: {context.kind} `{context.name}`")
|
|
402
|
-
if candidate.class_context and candidate.class_context is not context:
|
|
403
|
-
parts.append(f"**Enclosing class**: `{candidate.class_context.name}`")
|
|
404
|
-
parts.extend(("", "## Requirement (EARS)", "", candidate.ears, "", "## Source Context", ""))
|
|
405
|
-
if context and candidate.include_signatures and context.signature:
|
|
406
|
-
parts.extend(("### Signature", "", f"```{candidate.file.suffix.lstrip('.')}", context.signature, "```", ""))
|
|
407
|
-
if context and context.decorators:
|
|
408
|
-
parts.extend(("### Decorators", "", *(f"- `{_markdown_value(item)}`" for item in context.decorators), ""))
|
|
409
|
-
if context and context.bases:
|
|
410
|
-
parts.extend(("### Base Classes", "", *(f"- `{_markdown_value(item)}`" for item in context.bases), ""))
|
|
411
|
-
if context and context.docstring:
|
|
412
|
-
parts.extend(("### Docstring", "", context.docstring, ""))
|
|
413
|
-
if candidate.include_imports and candidate.source_context and candidate.source_context.imports:
|
|
414
|
-
parts.extend(("### Imports", "", f"```{candidate.file.suffix.lstrip('.')}", *candidate.source_context.imports, "```", ""))
|
|
415
|
-
parts.extend(("### Code Snippet", "", f"```{candidate.file.suffix.lstrip('.')}", candidate.snippet, "```", ""))
|
|
416
|
-
if candidate.source_context and candidate.ast_level == "module":
|
|
417
|
-
if candidate.source_context.classes:
|
|
418
|
-
parts.extend(("### Classes", "", *(f"- `{item.name}`" for item in candidate.source_context.classes), ""))
|
|
419
|
-
if candidate.source_context.functions:
|
|
420
|
-
parts.extend(("### Functions", "", *(f"- `{item.name}`" for item in candidate.source_context.functions), ""))
|
|
421
|
-
parts.extend(("## Rationale", "", "Recovered from source-level comment during brownfield retrofit.", ""))
|
|
422
|
-
return "\n".join(parts)
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
def _write_delta(output_dir: Path, fr_id: str, body: str) -> Path:
|
|
426
|
-
output_dir.mkdir(parents=True, exist_ok=True)
|
|
427
|
-
number = int(fr_id[len(FR_PREFIX):])
|
|
428
|
-
output = output_dir / f"spec-delta-{number:03d}.md"
|
|
429
|
-
output.write_text(body, encoding="utf-8")
|
|
430
|
-
return output
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
def main(argv: Optional[list[str]] = None) -> int:
|
|
434
|
-
parser = argparse.ArgumentParser(description="Retrofit source-level comments into spec-delta requirements.")
|
|
435
|
-
parser.add_argument("--project-root", default=".", type=Path)
|
|
436
|
-
parser.add_argument(
|
|
437
|
-
"--extensions",
|
|
438
|
-
default=".py,.ts,.tsx,.js,.jsx,.java,.go",
|
|
439
|
-
help="Comma-separated extension list (default: .py,.ts,.tsx,.js,.jsx,.java,.go)",
|
|
440
|
-
)
|
|
441
|
-
parser.add_argument("--output-dir", default="aidlc/openspec/changes/retrofit/", type=Path)
|
|
442
|
-
parser.add_argument("--batch", action="store_true", help="Auto-confirm all candidates without prompting.")
|
|
443
|
-
parser.add_argument("--from-source", default=None, type=Path, help="Scan only this subdirectory of --project-root.")
|
|
444
|
-
parser.add_argument(
|
|
445
|
-
"--ast-level",
|
|
446
|
-
choices=("none", "function", "class", "module"),
|
|
447
|
-
default="function",
|
|
448
|
-
help="Structural scope included in requirements and output (default: function).",
|
|
449
|
-
)
|
|
450
|
-
ast_group = parser.add_mutually_exclusive_group()
|
|
451
|
-
ast_group.add_argument("--use-ast", dest="use_ast", action="store_true", help="Use tree-sitter when available (default).")
|
|
452
|
-
ast_group.add_argument("--no-ast", dest="use_ast", action="store_false", help="Disable tree-sitter analysis.")
|
|
453
|
-
parser.set_defaults(use_ast=True)
|
|
454
|
-
parser.add_argument("--include-imports", action="store_true", help="Include module imports in output.")
|
|
455
|
-
parser.add_argument(
|
|
456
|
-
"--include-signatures",
|
|
457
|
-
action=argparse.BooleanOptionalAction,
|
|
458
|
-
default=True,
|
|
459
|
-
help="Include enclosing function signatures in output (default: true).",
|
|
460
|
-
)
|
|
461
|
-
args = parser.parse_args(argv)
|
|
462
|
-
|
|
463
|
-
root = args.project_root.resolve()
|
|
464
|
-
if not root.exists():
|
|
465
|
-
print(f"project root does not exist: {root}", file=sys.stderr)
|
|
466
|
-
return 2
|
|
467
|
-
|
|
468
|
-
extensions = [extension.strip() for extension in args.extensions.split(",") if extension.strip()]
|
|
469
|
-
output_dir = (root / args.output_dir).resolve() if not args.output_dir.is_absolute() else args.output_dir.resolve()
|
|
470
|
-
candidates = scan(
|
|
471
|
-
root,
|
|
472
|
-
extensions,
|
|
473
|
-
args.from_source,
|
|
474
|
-
use_ast=args.use_ast,
|
|
475
|
-
ast_level=args.ast_level,
|
|
476
|
-
include_imports=args.include_imports,
|
|
477
|
-
include_signatures=args.include_signatures,
|
|
478
|
-
)
|
|
479
|
-
if not candidates:
|
|
480
|
-
print("No candidate comments found.", file=sys.stderr)
|
|
481
|
-
return 0
|
|
482
|
-
|
|
483
|
-
written: list[Path] = []
|
|
484
|
-
try:
|
|
485
|
-
for candidate in candidates:
|
|
486
|
-
scope = f" in {candidate.context.kind} {candidate.context.name}" if candidate.context else ""
|
|
487
|
-
header = f"[{candidate.rel_path}:{candidate.line}] ({candidate.tag}) {candidate.text}{scope}"
|
|
488
|
-
if _confirm(header, args.batch):
|
|
489
|
-
fr_id = _next_fr_id(output_dir)
|
|
490
|
-
output = _write_delta(output_dir, fr_id, render_spec_delta(fr_id, candidate))
|
|
491
|
-
written.append(output)
|
|
492
|
-
try:
|
|
493
|
-
shown = output.relative_to(root)
|
|
494
|
-
except ValueError:
|
|
495
|
-
shown = output
|
|
496
|
-
print(f" wrote {shown}", file=sys.stderr)
|
|
497
|
-
except KeyboardInterrupt:
|
|
498
|
-
print("\nAborted by user.", file=sys.stderr)
|
|
499
|
-
|
|
500
|
-
print(f"\n{len(written)} spec-delta file(s) written to {output_dir}")
|
|
501
|
-
return 0
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
if __name__ == "__main__":
|
|
505
|
-
sys.exit(main())
|
package/cdh/trace/__init__.py
DELETED
|
@@ -1,101 +0,0 @@
|
|
|
1
|
-
"""CDH Trace — centralized agenttrace integration at the ACP protocol layer.
|
|
2
|
-
|
|
3
|
-
Usage:
|
|
4
|
-
from cdh.trace import add_trace
|
|
5
|
-
add_trace("ACP", "agent_message_chunk", session_id=sid, tags={...})
|
|
6
|
-
"""
|
|
7
|
-
|
|
8
|
-
from __future__ import annotations
|
|
9
|
-
|
|
10
|
-
from pathlib import Path
|
|
11
|
-
|
|
12
|
-
from agenttrace import TraceManager
|
|
13
|
-
|
|
14
|
-
_TRACER: TraceManager | None = None
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
def get_tracer() -> TraceManager:
|
|
18
|
-
global _TRACER
|
|
19
|
-
if _TRACER is None:
|
|
20
|
-
db_path = _get_db_path()
|
|
21
|
-
db_path.parent.mkdir(parents=True, exist_ok=True)
|
|
22
|
-
_TRACER = TraceManager(db_path=str(db_path))
|
|
23
|
-
return _TRACER
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
def get_db_path() -> Path:
|
|
27
|
-
return _get_db_path()
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
def _get_db_path() -> Path:
|
|
31
|
-
return Path.home() / ".cdh" / "traces" / "traces.db"
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
def add_trace(
|
|
35
|
-
trace_type: str,
|
|
36
|
-
func_name: str,
|
|
37
|
-
session_id: str | None = None,
|
|
38
|
-
duration: float | None = None,
|
|
39
|
-
parent_span_id: str | None = None,
|
|
40
|
-
note: str | None = None,
|
|
41
|
-
tags: dict | None = None,
|
|
42
|
-
model: str | None = None,
|
|
43
|
-
token_count: int | None = None,
|
|
44
|
-
input_tokens: int | None = None,
|
|
45
|
-
output_tokens: int | None = None,
|
|
46
|
-
cached_input_tokens: int | None = None,
|
|
47
|
-
status: str | None = None,
|
|
48
|
-
error: str | None = None,
|
|
49
|
-
tool_name: str | None = None,
|
|
50
|
-
tool_kind: str | None = None,
|
|
51
|
-
agent_type: str | None = None,
|
|
52
|
-
cost_amount: float | None = None,
|
|
53
|
-
cost_currency: str | None = None,
|
|
54
|
-
lines_added: int | None = None,
|
|
55
|
-
extra_data: dict | None = None,
|
|
56
|
-
) -> None:
|
|
57
|
-
data = {}
|
|
58
|
-
if model is not None:
|
|
59
|
-
data["model"] = model
|
|
60
|
-
if token_count is not None:
|
|
61
|
-
data["token_count"] = token_count
|
|
62
|
-
if input_tokens is not None:
|
|
63
|
-
data["input_tokens"] = input_tokens
|
|
64
|
-
if output_tokens is not None:
|
|
65
|
-
data["output_tokens"] = output_tokens
|
|
66
|
-
if cached_input_tokens is not None:
|
|
67
|
-
data["cached_input_tokens"] = cached_input_tokens
|
|
68
|
-
if status is not None:
|
|
69
|
-
data["status"] = status
|
|
70
|
-
if error is not None:
|
|
71
|
-
data["error"] = error
|
|
72
|
-
if tool_name is not None:
|
|
73
|
-
data["tool_name"] = tool_name
|
|
74
|
-
if tool_kind is not None:
|
|
75
|
-
data["tool_kind"] = tool_kind
|
|
76
|
-
if agent_type is not None:
|
|
77
|
-
data["agent_type"] = agent_type
|
|
78
|
-
if parent_span_id is not None:
|
|
79
|
-
data["parent_span_id"] = parent_span_id
|
|
80
|
-
if note is not None:
|
|
81
|
-
data["note"] = note
|
|
82
|
-
if cost_amount is not None:
|
|
83
|
-
data["cost_amount"] = cost_amount
|
|
84
|
-
if cost_currency is not None:
|
|
85
|
-
data["cost_currency"] = cost_currency
|
|
86
|
-
if lines_added is not None:
|
|
87
|
-
data["lines_added"] = lines_added
|
|
88
|
-
if extra_data:
|
|
89
|
-
data.update(extra_data)
|
|
90
|
-
|
|
91
|
-
try:
|
|
92
|
-
get_tracer().add_trace(
|
|
93
|
-
trace_type=trace_type,
|
|
94
|
-
func_name=func_name,
|
|
95
|
-
kwargs=data if data else None,
|
|
96
|
-
tags=tags,
|
|
97
|
-
session_id=session_id,
|
|
98
|
-
duration=duration,
|
|
99
|
-
)
|
|
100
|
-
except Exception:
|
|
101
|
-
pass
|
|
Binary file
|
|
@@ -1,61 +0,0 @@
|
|
|
1
|
-
"""Trace dashboard — built-in web UI with Chart.js, no npm needed.
|
|
2
|
-
|
|
3
|
-
Usage:
|
|
4
|
-
from cdh.trace.dashboard import run_dashboard
|
|
5
|
-
run_dashboard(port=5173)
|
|
6
|
-
"""
|
|
7
|
-
|
|
8
|
-
from __future__ import annotations
|
|
9
|
-
|
|
10
|
-
import os
|
|
11
|
-
import webbrowser
|
|
12
|
-
from pathlib import Path
|
|
13
|
-
|
|
14
|
-
from cdh.trace import get_db_path
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
def _load_app_html() -> str:
|
|
18
|
-
"""Load the frontend HTML from the app.html file in this package."""
|
|
19
|
-
pkg_dir = Path(__file__).resolve().parent
|
|
20
|
-
html_path = pkg_dir / "app.html"
|
|
21
|
-
return html_path.read_text(encoding="utf-8")
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
def run_dashboard(port: int = 5173, host: str = "127.0.0.1") -> None:
|
|
25
|
-
"""Start the trace dashboard web server.
|
|
26
|
-
|
|
27
|
-
Args:
|
|
28
|
-
port: HTTP port (default 5173).
|
|
29
|
-
host: Bind address (default 127.0.0.1).
|
|
30
|
-
"""
|
|
31
|
-
db_path = get_db_path()
|
|
32
|
-
app_html = _load_app_html()
|
|
33
|
-
|
|
34
|
-
print(f"Trace DB: {db_path}")
|
|
35
|
-
print("")
|
|
36
|
-
print(f"Starting CDH Trace Dashboard at http://{host}:{port}")
|
|
37
|
-
print("Press Ctrl+C to stop.")
|
|
38
|
-
print("")
|
|
39
|
-
|
|
40
|
-
from cdh.trace.dashboard.server import make_server
|
|
41
|
-
|
|
42
|
-
server = make_server(host, port, app_html, db_path)
|
|
43
|
-
|
|
44
|
-
# Don't open browser in headless/CI environments
|
|
45
|
-
_try_open_browser = True
|
|
46
|
-
display = os.environ.get("DISPLAY")
|
|
47
|
-
if display is not None and not display:
|
|
48
|
-
_try_open_browser = False
|
|
49
|
-
if "DISPLAY" not in os.environ:
|
|
50
|
-
_try_open_browser = False
|
|
51
|
-
if _try_open_browser:
|
|
52
|
-
try:
|
|
53
|
-
webbrowser.open(f"http://{host}:{port}")
|
|
54
|
-
except Exception:
|
|
55
|
-
pass
|
|
56
|
-
|
|
57
|
-
try:
|
|
58
|
-
server.serve_forever()
|
|
59
|
-
except KeyboardInterrupt:
|
|
60
|
-
print("\nShutting down...")
|
|
61
|
-
server.server_close()
|