@mindfoldhq/trellis 0.3.10 → 0.4.0-beta.10
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/README.md +19 -5
- package/dist/cli/index.js +5 -0
- package/dist/cli/index.js.map +1 -1
- package/dist/commands/init.d.ts +4 -0
- package/dist/commands/init.d.ts.map +1 -1
- package/dist/commands/init.js +240 -43
- package/dist/commands/init.js.map +1 -1
- package/dist/commands/update.d.ts.map +1 -1
- package/dist/commands/update.js +206 -47
- package/dist/commands/update.js.map +1 -1
- package/dist/configurators/codebuddy.d.ts +11 -0
- package/dist/configurators/codebuddy.d.ts.map +1 -0
- package/dist/configurators/codebuddy.js +58 -0
- package/dist/configurators/codebuddy.js.map +1 -0
- package/dist/configurators/codex.d.ts +7 -4
- package/dist/configurators/codex.d.ts.map +1 -1
- package/dist/configurators/codex.js +40 -10
- package/dist/configurators/codex.js.map +1 -1
- package/dist/configurators/copilot.d.ts +9 -0
- package/dist/configurators/copilot.d.ts.map +1 -0
- package/dist/configurators/copilot.js +34 -0
- package/dist/configurators/copilot.js.map +1 -0
- package/dist/configurators/index.d.ts +11 -1
- package/dist/configurators/index.d.ts.map +1 -1
- package/dist/configurators/index.js +72 -4
- package/dist/configurators/index.js.map +1 -1
- package/dist/configurators/opencode.d.ts +1 -1
- package/dist/configurators/opencode.js +1 -1
- package/dist/configurators/windsurf.d.ts +8 -0
- package/dist/configurators/windsurf.d.ts.map +1 -0
- package/dist/configurators/windsurf.js +18 -0
- package/dist/configurators/windsurf.js.map +1 -0
- package/dist/configurators/workflow.d.ts +6 -2
- package/dist/configurators/workflow.d.ts.map +1 -1
- package/dist/configurators/workflow.js +90 -58
- package/dist/configurators/workflow.js.map +1 -1
- package/dist/migrations/index.d.ts +1 -0
- package/dist/migrations/index.d.ts.map +1 -1
- package/dist/migrations/index.js +2 -0
- package/dist/migrations/index.js.map +1 -1
- package/dist/migrations/manifests/0.4.0-beta.1.json +228 -0
- package/dist/migrations/manifests/0.4.0-beta.10.json +9 -0
- package/dist/migrations/manifests/0.4.0-beta.2.json +9 -0
- package/dist/migrations/manifests/0.4.0-beta.3.json +9 -0
- package/dist/migrations/manifests/0.4.0-beta.4.json +9 -0
- package/dist/migrations/manifests/0.4.0-beta.5.json +9 -0
- package/dist/migrations/manifests/0.4.0-beta.6.json +9 -0
- package/dist/migrations/manifests/0.4.0-beta.7.json +9 -0
- package/dist/migrations/manifests/0.4.0-beta.8.json +34 -0
- package/dist/migrations/manifests/0.4.0-beta.9.json +9 -0
- package/dist/templates/claude/agents/dispatch.md +1 -2
- package/dist/templates/claude/agents/implement.md +2 -3
- package/dist/templates/claude/commands/trellis/before-dev.md +29 -0
- package/dist/templates/claude/commands/trellis/check.md +25 -0
- package/dist/templates/claude/commands/trellis/create-command.md +2 -2
- package/dist/templates/claude/commands/trellis/onboard.md +13 -13
- package/dist/templates/claude/commands/trellis/parallel.md +1 -2
- package/dist/templates/claude/commands/trellis/record-session.md +3 -2
- package/dist/templates/claude/commands/trellis/start.md +8 -4
- package/dist/templates/claude/hooks/inject-subagent-context.py +29 -14
- package/dist/templates/claude/hooks/ralph-loop.py +18 -10
- package/dist/templates/claude/hooks/session-start.py +201 -9
- package/dist/templates/claude/hooks/statusline.py +211 -0
- package/dist/templates/claude/settings.json +4 -0
- package/dist/templates/codebuddy/commands/trellis/before-dev.md +29 -0
- package/dist/templates/codebuddy/commands/trellis/brainstorm.md +487 -0
- package/dist/templates/codebuddy/commands/trellis/break-loop.md +107 -0
- package/dist/templates/codebuddy/commands/trellis/check-cross-layer.md +153 -0
- package/dist/templates/codebuddy/commands/trellis/check.md +25 -0
- package/dist/templates/codebuddy/commands/trellis/create-command.md +154 -0
- package/dist/templates/codebuddy/commands/trellis/finish-work.md +143 -0
- package/dist/templates/codebuddy/commands/trellis/integrate-skill.md +219 -0
- package/dist/templates/codebuddy/commands/trellis/onboard.md +358 -0
- package/dist/templates/codebuddy/commands/trellis/record-session.md +61 -0
- package/dist/templates/codebuddy/commands/trellis/start.md +373 -0
- package/dist/templates/codebuddy/commands/trellis/update-spec.md +354 -0
- package/dist/templates/codebuddy/index.d.ts +25 -0
- package/dist/templates/codebuddy/index.d.ts.map +1 -0
- package/dist/templates/codebuddy/index.js +45 -0
- package/dist/templates/codebuddy/index.js.map +1 -0
- package/dist/templates/codex/agents/check.toml +23 -0
- package/dist/templates/codex/agents/implement.toml +19 -0
- package/dist/templates/codex/agents/research.toml +26 -0
- package/dist/templates/codex/codex-skills/parallel/SKILL.md +194 -0
- package/dist/templates/codex/config.toml +5 -0
- package/dist/templates/codex/hooks/session-start.py +228 -0
- package/dist/templates/codex/hooks.json +16 -0
- package/dist/templates/codex/index.d.ts +27 -5
- package/dist/templates/codex/index.d.ts.map +1 -1
- package/dist/templates/codex/index.js +60 -8
- package/dist/templates/codex/index.js.map +1 -1
- package/dist/templates/codex/skills/before-dev/SKILL.md +34 -0
- package/dist/templates/codex/skills/brainstorm/SKILL.md +1 -1
- package/dist/templates/codex/skills/break-loop/SKILL.md +1 -1
- package/dist/templates/codex/skills/check/SKILL.md +30 -0
- package/dist/templates/codex/skills/check-cross-layer/SKILL.md +1 -1
- package/dist/templates/codex/skills/create-command/SKILL.md +3 -3
- package/dist/templates/codex/skills/finish-work/SKILL.md +1 -1
- package/dist/templates/codex/skills/improve-ut/SKILL.md +69 -0
- package/dist/templates/codex/skills/integrate-skill/SKILL.md +1 -1
- package/dist/templates/codex/skills/onboard/SKILL.md +12 -12
- package/dist/templates/codex/skills/record-session/SKILL.md +4 -3
- package/dist/templates/codex/skills/start/SKILL.md +9 -4
- package/dist/templates/codex/skills/update-spec/SKILL.md +1 -1
- package/dist/templates/copilot/hooks/session-start.py +218 -0
- package/dist/templates/copilot/hooks.json +11 -0
- package/dist/templates/copilot/index.d.ts +23 -0
- package/dist/templates/copilot/index.d.ts.map +1 -0
- package/dist/templates/copilot/index.js +54 -0
- package/dist/templates/copilot/index.js.map +1 -0
- package/dist/templates/copilot/prompts/before-dev.prompt.md +33 -0
- package/dist/templates/copilot/prompts/brainstorm.prompt.md +491 -0
- package/dist/templates/copilot/prompts/break-loop.prompt.md +129 -0
- package/dist/templates/copilot/prompts/check-cross-layer.prompt.md +157 -0
- package/dist/templates/copilot/prompts/check.prompt.md +29 -0
- package/dist/templates/copilot/prompts/create-command.prompt.md +116 -0
- package/dist/templates/copilot/prompts/finish-work.prompt.md +157 -0
- package/dist/templates/copilot/prompts/integrate-skill.prompt.md +223 -0
- package/dist/templates/copilot/prompts/onboard.prompt.md +362 -0
- package/dist/templates/copilot/prompts/parallel.prompt.md +196 -0
- package/dist/templates/copilot/prompts/record-session.prompt.md +66 -0
- package/dist/templates/copilot/prompts/start.prompt.md +397 -0
- package/dist/templates/copilot/prompts/update-spec.prompt.md +358 -0
- package/dist/templates/cursor/commands/trellis-before-dev.md +29 -0
- package/dist/templates/cursor/commands/trellis-check.md +25 -0
- package/dist/templates/cursor/commands/trellis-create-command.md +2 -2
- package/dist/templates/cursor/commands/trellis-onboard.md +13 -13
- package/dist/templates/cursor/commands/trellis-record-session.md +3 -2
- package/dist/templates/cursor/commands/trellis-start.md +7 -16
- package/dist/templates/extract.d.ts +36 -0
- package/dist/templates/extract.d.ts.map +1 -1
- package/dist/templates/extract.js +64 -0
- package/dist/templates/extract.js.map +1 -1
- package/dist/templates/gemini/commands/trellis/before-dev.toml +33 -0
- package/dist/templates/gemini/commands/trellis/check.toml +29 -0
- package/dist/templates/gemini/commands/trellis/create-command.toml +2 -2
- package/dist/templates/gemini/commands/trellis/onboard.toml +2 -2
- package/dist/templates/gemini/commands/trellis/record-session.toml +3 -2
- package/dist/templates/gemini/commands/trellis/start.toml +9 -4
- package/dist/templates/iflow/agents/dispatch.md +1 -2
- package/dist/templates/iflow/agents/implement.md +2 -3
- package/dist/templates/iflow/commands/trellis/before-dev.md +29 -0
- package/dist/templates/iflow/commands/trellis/check.md +25 -0
- package/dist/templates/iflow/commands/trellis/create-command.md +2 -2
- package/dist/templates/iflow/commands/trellis/onboard.md +13 -13
- package/dist/templates/iflow/commands/trellis/parallel.md +1 -2
- package/dist/templates/iflow/commands/trellis/record-session.md +3 -2
- package/dist/templates/iflow/commands/trellis/start.md +8 -4
- package/dist/templates/iflow/hooks/inject-subagent-context.py +29 -14
- package/dist/templates/iflow/hooks/ralph-loop.py +8 -1
- package/dist/templates/iflow/hooks/session-start.py +187 -8
- package/dist/templates/kilo/workflows/before-dev.md +29 -0
- package/dist/templates/kilo/workflows/check.md +25 -0
- package/dist/templates/kilo/workflows/create-command.md +2 -2
- package/dist/templates/kilo/workflows/onboard.md +13 -13
- package/dist/templates/kilo/workflows/parallel.md +1 -2
- package/dist/templates/kilo/workflows/record-session.md +3 -2
- package/dist/templates/kilo/workflows/start.md +8 -3
- package/dist/templates/kiro/skills/before-dev/SKILL.md +34 -0
- package/dist/templates/kiro/skills/brainstorm/SKILL.md +1 -1
- package/dist/templates/kiro/skills/break-loop/SKILL.md +1 -1
- package/dist/templates/kiro/skills/check/SKILL.md +30 -0
- package/dist/templates/kiro/skills/check-cross-layer/SKILL.md +1 -1
- package/dist/templates/kiro/skills/create-command/SKILL.md +3 -3
- package/dist/templates/kiro/skills/finish-work/SKILL.md +1 -1
- package/dist/templates/kiro/skills/integrate-skill/SKILL.md +1 -1
- package/dist/templates/kiro/skills/onboard/SKILL.md +12 -12
- package/dist/templates/kiro/skills/record-session/SKILL.md +4 -3
- package/dist/templates/kiro/skills/start/SKILL.md +9 -4
- package/dist/templates/kiro/skills/update-spec/SKILL.md +1 -1
- package/dist/templates/markdown/agents.md +4 -0
- package/dist/templates/markdown/spec/backend/directory-structure.md +1 -1
- package/dist/templates/markdown/spec/backend/script-conventions.md +93 -0
- package/dist/templates/markdown/workspace-index.md +2 -0
- package/dist/templates/opencode/agents/dispatch.md +21 -21
- package/dist/templates/opencode/agents/implement.md +2 -2
- package/dist/templates/opencode/agents/research.md +1 -2
- package/dist/templates/opencode/commands/trellis/before-dev.md +29 -0
- package/dist/templates/opencode/commands/trellis/check.md +25 -0
- package/dist/templates/opencode/commands/trellis/create-command.md +2 -2
- package/dist/templates/opencode/commands/trellis/onboard.md +13 -13
- package/dist/templates/opencode/commands/trellis/parallel.md +1 -2
- package/dist/templates/opencode/commands/trellis/record-session.md +3 -2
- package/dist/templates/opencode/commands/trellis/start.md +8 -3
- package/dist/templates/opencode/lib/trellis-context.js +42 -2
- package/dist/templates/opencode/{plugin → plugins}/inject-subagent-context.js +45 -18
- package/dist/templates/opencode/{plugin → plugins}/session-start.js +156 -28
- package/dist/templates/qoder/skills/before-dev/SKILL.md +34 -0
- package/dist/templates/qoder/skills/brainstorm/SKILL.md +1 -1
- package/dist/templates/qoder/skills/break-loop/SKILL.md +1 -1
- package/dist/templates/qoder/skills/check/SKILL.md +30 -0
- package/dist/templates/qoder/skills/check-cross-layer/SKILL.md +1 -1
- package/dist/templates/qoder/skills/create-command/SKILL.md +3 -3
- package/dist/templates/qoder/skills/finish-work/SKILL.md +1 -1
- package/dist/templates/qoder/skills/integrate-skill/SKILL.md +1 -1
- package/dist/templates/qoder/skills/onboard/SKILL.md +14 -14
- package/dist/templates/qoder/skills/record-session/SKILL.md +4 -3
- package/dist/templates/qoder/skills/start/SKILL.md +9 -4
- package/dist/templates/qoder/skills/update-spec/SKILL.md +1 -1
- package/dist/templates/trellis/config.yaml +20 -0
- package/dist/templates/trellis/index.d.ts +11 -0
- package/dist/templates/trellis/index.d.ts.map +1 -1
- package/dist/templates/trellis/index.js +22 -0
- package/dist/templates/trellis/index.js.map +1 -1
- package/dist/templates/trellis/scripts/add_session.py +111 -13
- package/dist/templates/trellis/scripts/common/__init__.py +2 -0
- package/dist/templates/trellis/scripts/common/cli_adapter.py +164 -64
- package/dist/templates/trellis/scripts/common/config.py +192 -0
- package/dist/templates/trellis/scripts/common/developer.py +2 -2
- package/dist/templates/trellis/scripts/common/git.py +31 -0
- package/dist/templates/trellis/scripts/common/git_context.py +23 -586
- package/dist/templates/trellis/scripts/common/io.py +37 -0
- package/dist/templates/trellis/scripts/common/log.py +45 -0
- package/dist/templates/trellis/scripts/common/packages_context.py +238 -0
- package/dist/templates/trellis/scripts/common/paths.py +103 -6
- package/dist/templates/trellis/scripts/common/phase.py +50 -49
- package/dist/templates/trellis/scripts/common/registry.py +41 -72
- package/dist/templates/trellis/scripts/common/session_context.py +562 -0
- package/dist/templates/trellis/scripts/common/task_context.py +410 -0
- package/dist/templates/trellis/scripts/common/task_queue.py +27 -98
- package/dist/templates/trellis/scripts/common/task_store.py +536 -0
- package/dist/templates/trellis/scripts/common/task_utils.py +106 -10
- package/dist/templates/trellis/scripts/common/tasks.py +109 -0
- package/dist/templates/trellis/scripts/common/types.py +112 -0
- package/dist/templates/trellis/scripts/create_bootstrap.py +32 -27
- package/dist/templates/trellis/scripts/hooks/linear_sync.py +243 -0
- package/dist/templates/trellis/scripts/multi_agent/_bootstrap.py +17 -0
- package/dist/templates/trellis/scripts/multi_agent/cleanup.py +43 -48
- package/dist/templates/trellis/scripts/multi_agent/create_pr.py +336 -45
- package/dist/templates/trellis/scripts/multi_agent/plan.py +9 -32
- package/dist/templates/trellis/scripts/multi_agent/start.py +142 -68
- package/dist/templates/trellis/scripts/multi_agent/status.py +12 -753
- package/dist/templates/trellis/scripts/multi_agent/status_display.py +542 -0
- package/dist/templates/trellis/scripts/multi_agent/status_monitor.py +225 -0
- package/dist/templates/trellis/scripts/task.py +51 -976
- package/dist/templates/trellis/scripts-shell-archive/create-bootstrap.sh +1 -1
- package/dist/templates/trellis/workflow.md +38 -38
- package/dist/templates/windsurf/index.d.ts +21 -0
- package/dist/templates/windsurf/index.d.ts.map +1 -0
- package/dist/templates/windsurf/index.js +44 -0
- package/dist/templates/windsurf/index.js.map +1 -0
- package/dist/templates/windsurf/workflows/trellis-before-dev.md +31 -0
- package/dist/templates/windsurf/workflows/trellis-brainstorm.md +491 -0
- package/dist/templates/windsurf/workflows/trellis-break-loop.md +111 -0
- package/dist/templates/windsurf/workflows/trellis-check-cross-layer.md +157 -0
- package/dist/templates/windsurf/workflows/trellis-check.md +27 -0
- package/dist/templates/windsurf/workflows/trellis-create-command.md +154 -0
- package/dist/templates/windsurf/workflows/trellis-finish-work.md +147 -0
- package/dist/templates/windsurf/workflows/trellis-integrate-skill.md +220 -0
- package/dist/templates/windsurf/workflows/trellis-onboard.md +362 -0
- package/dist/templates/windsurf/workflows/trellis-record-session.md +66 -0
- package/dist/templates/windsurf/workflows/trellis-start.md +373 -0
- package/dist/templates/windsurf/workflows/trellis-update-spec.md +358 -0
- package/dist/types/ai-tools.d.ts +15 -3
- package/dist/types/ai-tools.d.ts.map +1 -1
- package/dist/types/ai-tools.js +42 -2
- package/dist/types/ai-tools.js.map +1 -1
- package/dist/types/migration.d.ts +3 -1
- package/dist/types/migration.d.ts.map +1 -1
- package/dist/utils/project-detector.d.ts +28 -0
- package/dist/utils/project-detector.d.ts.map +1 -1
- package/dist/utils/project-detector.js +371 -0
- package/dist/utils/project-detector.js.map +1 -1
- package/dist/utils/template-fetcher.d.ts +19 -6
- package/dist/utils/template-fetcher.d.ts.map +1 -1
- package/dist/utils/template-fetcher.js +99 -17
- package/dist/utils/template-fetcher.js.map +1 -1
- package/package.json +1 -1
- package/dist/templates/claude/commands/trellis/before-backend-dev.md +0 -13
- package/dist/templates/claude/commands/trellis/before-frontend-dev.md +0 -13
- package/dist/templates/claude/commands/trellis/check-backend.md +0 -13
- package/dist/templates/claude/commands/trellis/check-frontend.md +0 -13
- package/dist/templates/codex/skills/before-backend-dev/SKILL.md +0 -18
- package/dist/templates/codex/skills/before-frontend-dev/SKILL.md +0 -18
- package/dist/templates/codex/skills/check-backend/SKILL.md +0 -18
- package/dist/templates/codex/skills/check-frontend/SKILL.md +0 -18
- package/dist/templates/cursor/commands/trellis-before-backend-dev.md +0 -13
- package/dist/templates/cursor/commands/trellis-before-frontend-dev.md +0 -13
- package/dist/templates/cursor/commands/trellis-check-backend.md +0 -13
- package/dist/templates/cursor/commands/trellis-check-frontend.md +0 -13
- package/dist/templates/gemini/commands/trellis/before-backend-dev.toml +0 -17
- package/dist/templates/gemini/commands/trellis/before-frontend-dev.toml +0 -17
- package/dist/templates/gemini/commands/trellis/check-backend.toml +0 -17
- package/dist/templates/gemini/commands/trellis/check-frontend.toml +0 -17
- package/dist/templates/iflow/commands/trellis/before-backend-dev.md +0 -13
- package/dist/templates/iflow/commands/trellis/before-frontend-dev.md +0 -13
- package/dist/templates/iflow/commands/trellis/check-backend.md +0 -13
- package/dist/templates/iflow/commands/trellis/check-frontend.md +0 -13
- package/dist/templates/kilo/workflows/before-backend-dev.md +0 -13
- package/dist/templates/kilo/workflows/before-frontend-dev.md +0 -13
- package/dist/templates/kilo/workflows/check-backend.md +0 -13
- package/dist/templates/kilo/workflows/check-frontend.md +0 -13
- package/dist/templates/kiro/skills/before-backend-dev/SKILL.md +0 -18
- package/dist/templates/kiro/skills/before-frontend-dev/SKILL.md +0 -18
- package/dist/templates/kiro/skills/check-backend/SKILL.md +0 -18
- package/dist/templates/kiro/skills/check-frontend/SKILL.md +0 -18
- package/dist/templates/opencode/commands/trellis/before-backend-dev.md +0 -13
- package/dist/templates/opencode/commands/trellis/before-frontend-dev.md +0 -13
- package/dist/templates/opencode/commands/trellis/check-backend.md +0 -13
- package/dist/templates/opencode/commands/trellis/check-frontend.md +0 -13
- package/dist/templates/qoder/skills/before-backend-dev/SKILL.md +0 -18
- package/dist/templates/qoder/skills/before-frontend-dev/SKILL.md +0 -18
- package/dist/templates/qoder/skills/check-backend/SKILL.md +0 -18
- package/dist/templates/qoder/skills/check-frontend/SKILL.md +0 -18
|
@@ -22,16 +22,17 @@ This script:
|
|
|
22
22
|
from __future__ import annotations
|
|
23
23
|
|
|
24
24
|
import argparse
|
|
25
|
+
import json
|
|
25
26
|
import shutil
|
|
26
27
|
import subprocess
|
|
27
28
|
import sys
|
|
28
29
|
from pathlib import Path
|
|
29
30
|
|
|
30
|
-
#
|
|
31
|
-
sys.path.insert(0, str(Path(__file__).parent.parent))
|
|
31
|
+
import _bootstrap # noqa: F401 — adds parent scripts/ dir to sys.path
|
|
32
32
|
|
|
33
|
-
from common.
|
|
34
|
-
from common.
|
|
33
|
+
from common.git import run_git
|
|
34
|
+
from common.log import Colors, log_info, log_success, log_warn, log_error
|
|
35
|
+
from common.paths import FILE_TASK_JSON, get_repo_root
|
|
35
36
|
from common.registry import (
|
|
36
37
|
registry_get_file,
|
|
37
38
|
registry_get_task_dir,
|
|
@@ -44,38 +45,8 @@ from common.task_utils import (
|
|
|
44
45
|
is_safe_task_path,
|
|
45
46
|
)
|
|
46
47
|
|
|
47
|
-
#
|
|
48
|
-
#
|
|
49
|
-
# =============================================================================
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
class Colors:
|
|
53
|
-
RED = "\033[0;31m"
|
|
54
|
-
GREEN = "\033[0;32m"
|
|
55
|
-
YELLOW = "\033[1;33m"
|
|
56
|
-
BLUE = "\033[0;34m"
|
|
57
|
-
NC = "\033[0m"
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
def log_info(msg: str) -> None:
|
|
61
|
-
print(f"{Colors.BLUE}[INFO]{Colors.NC} {msg}")
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
def log_success(msg: str) -> None:
|
|
65
|
-
print(f"{Colors.GREEN}[SUCCESS]{Colors.NC} {msg}")
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
def log_warn(msg: str) -> None:
|
|
69
|
-
print(f"{Colors.YELLOW}[WARN]{Colors.NC} {msg}")
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
def log_error(msg: str) -> None:
|
|
73
|
-
print(f"{Colors.RED}[ERROR]{Colors.NC} {msg}")
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
# =============================================================================
|
|
77
|
-
# Helper Functions
|
|
78
|
-
# =============================================================================
|
|
48
|
+
# Colors, log_info, log_success, log_warn, log_error
|
|
49
|
+
# are now imported from common.log above.
|
|
79
50
|
|
|
80
51
|
|
|
81
52
|
def confirm(prompt: str, skip_confirm: bool) -> bool:
|
|
@@ -91,6 +62,26 @@ def confirm(prompt: str, skip_confirm: bool) -> bool:
|
|
|
91
62
|
return response.lower() in ("y", "yes")
|
|
92
63
|
|
|
93
64
|
|
|
65
|
+
def _warn_submodule_prs(task_dir_abs: Path) -> None:
|
|
66
|
+
"""Print reminders for any open submodule PRs found in task.json."""
|
|
67
|
+
task_json = task_dir_abs / FILE_TASK_JSON
|
|
68
|
+
if not task_json.is_file():
|
|
69
|
+
return
|
|
70
|
+
|
|
71
|
+
try:
|
|
72
|
+
task_data = json.loads(task_json.read_text(encoding="utf-8"))
|
|
73
|
+
except (json.JSONDecodeError, OSError):
|
|
74
|
+
return
|
|
75
|
+
|
|
76
|
+
submodule_prs = task_data.get("submodule_prs")
|
|
77
|
+
if not isinstance(submodule_prs, dict) or not submodule_prs:
|
|
78
|
+
return
|
|
79
|
+
|
|
80
|
+
for name, url in submodule_prs.items():
|
|
81
|
+
log_warn(f"Submodule PR still open: {name} -> {url}")
|
|
82
|
+
log_info("Remember to close/merge submodule PRs before cleanup")
|
|
83
|
+
|
|
84
|
+
|
|
94
85
|
# =============================================================================
|
|
95
86
|
# Commands
|
|
96
87
|
# =============================================================================
|
|
@@ -110,8 +101,6 @@ def cmd_list(repo_root: Path) -> int:
|
|
|
110
101
|
print(f"{Colors.BLUE}=== Registered Agents ==={Colors.NC}")
|
|
111
102
|
print()
|
|
112
103
|
|
|
113
|
-
import json
|
|
114
|
-
|
|
115
104
|
data = json.loads(registry_file.read_text(encoding="utf-8"))
|
|
116
105
|
agents = data.get("agents", [])
|
|
117
106
|
|
|
@@ -165,10 +154,11 @@ def cleanup_registry_only(search: str, repo_root: Path, skip_confirm: bool) -> i
|
|
|
165
154
|
log_info("Aborted")
|
|
166
155
|
return 0
|
|
167
156
|
|
|
168
|
-
#
|
|
157
|
+
# Check for submodule PRs and archive task directory
|
|
169
158
|
if task_dir and is_safe_task_path(task_dir, repo_root):
|
|
170
159
|
task_dir_abs = repo_root / task_dir
|
|
171
160
|
if task_dir_abs.is_dir():
|
|
161
|
+
_warn_submodule_prs(task_dir_abs)
|
|
172
162
|
result = archive_task_complete(task_dir_abs, repo_root)
|
|
173
163
|
if "archived_to" in result:
|
|
174
164
|
dest = Path(result["archived_to"])
|
|
@@ -191,7 +181,7 @@ def cleanup_worktree(
|
|
|
191
181
|
) -> int:
|
|
192
182
|
"""Cleanup single worktree."""
|
|
193
183
|
# Find worktree path for branch
|
|
194
|
-
_, worktree_list, _ =
|
|
184
|
+
_, worktree_list, _ = run_git(
|
|
195
185
|
["worktree", "list", "--porcelain"], cwd=repo_root
|
|
196
186
|
)
|
|
197
187
|
|
|
@@ -223,7 +213,12 @@ def cleanup_worktree(
|
|
|
223
213
|
log_info("Aborted")
|
|
224
214
|
return 0
|
|
225
215
|
|
|
226
|
-
# 1. Archive task
|
|
216
|
+
# 1. Archive task (and check for submodule PRs)
|
|
217
|
+
task_dir = registry_get_task_dir(worktree_path, repo_root)
|
|
218
|
+
if task_dir and is_safe_task_path(task_dir, repo_root):
|
|
219
|
+
task_dir_abs_for_warn = repo_root / task_dir
|
|
220
|
+
if task_dir_abs_for_warn.is_dir():
|
|
221
|
+
_warn_submodule_prs(task_dir_abs_for_warn)
|
|
227
222
|
archive_task(worktree_path, repo_root)
|
|
228
223
|
|
|
229
224
|
# 2. Remove from registry
|
|
@@ -232,7 +227,7 @@ def cleanup_worktree(
|
|
|
232
227
|
|
|
233
228
|
# 3. Remove worktree
|
|
234
229
|
log_info("Removing worktree...")
|
|
235
|
-
ret, _, _ =
|
|
230
|
+
ret, _, _ = run_git(
|
|
236
231
|
["worktree", "remove", worktree_path, "--force"], cwd=repo_root
|
|
237
232
|
)
|
|
238
233
|
if ret != 0:
|
|
@@ -247,7 +242,7 @@ def cleanup_worktree(
|
|
|
247
242
|
# 4. Delete branch (optional)
|
|
248
243
|
if not keep_branch:
|
|
249
244
|
log_info("Deleting branch...")
|
|
250
|
-
ret, _, _ =
|
|
245
|
+
ret, _, _ = run_git(["branch", "-D", branch], cwd=repo_root)
|
|
251
246
|
if ret != 0:
|
|
252
247
|
log_warn("Could not delete branch (may be checked out elsewhere)")
|
|
253
248
|
|
|
@@ -258,7 +253,7 @@ def cleanup_worktree(
|
|
|
258
253
|
def cmd_merged(repo_root: Path, skip_confirm: bool, keep_branch: bool) -> int:
|
|
259
254
|
"""Cleanup merged worktrees."""
|
|
260
255
|
# Get main branch
|
|
261
|
-
_, head_out, _ =
|
|
256
|
+
_, head_out, _ = run_git(
|
|
262
257
|
["symbolic-ref", "refs/remotes/origin/HEAD"], cwd=repo_root
|
|
263
258
|
)
|
|
264
259
|
main_branch = head_out.strip().replace("refs/remotes/origin/", "") or "main"
|
|
@@ -267,7 +262,7 @@ def cmd_merged(repo_root: Path, skip_confirm: bool, keep_branch: bool) -> int:
|
|
|
267
262
|
print()
|
|
268
263
|
|
|
269
264
|
# Get merged branches
|
|
270
|
-
_, merged_out, _ =
|
|
265
|
+
_, merged_out, _ = run_git(
|
|
271
266
|
["branch", "--merged", main_branch], cwd=repo_root
|
|
272
267
|
)
|
|
273
268
|
merged_branches = []
|
|
@@ -281,7 +276,7 @@ def cmd_merged(repo_root: Path, skip_confirm: bool, keep_branch: bool) -> int:
|
|
|
281
276
|
return 0
|
|
282
277
|
|
|
283
278
|
# Get worktree list
|
|
284
|
-
_, worktree_list, _ =
|
|
279
|
+
_, worktree_list, _ = run_git(["worktree", "list"], cwd=repo_root)
|
|
285
280
|
|
|
286
281
|
worktree_branches = []
|
|
287
282
|
for branch in merged_branches:
|
|
@@ -310,7 +305,7 @@ def cmd_all(repo_root: Path, skip_confirm: bool, keep_branch: bool) -> int:
|
|
|
310
305
|
print()
|
|
311
306
|
|
|
312
307
|
# Get worktree list
|
|
313
|
-
_, worktree_list, _ =
|
|
308
|
+
_, worktree_list, _ = run_git(
|
|
314
309
|
["worktree", "list", "--porcelain"], cwd=repo_root
|
|
315
310
|
)
|
|
316
311
|
|
|
@@ -340,7 +335,7 @@ def cmd_all(repo_root: Path, skip_confirm: bool, keep_branch: bool) -> int:
|
|
|
340
335
|
# Get branch for each worktree
|
|
341
336
|
for wt in worktrees:
|
|
342
337
|
# Find branch name from worktree list
|
|
343
|
-
_, wt_list, _ =
|
|
338
|
+
_, wt_list, _ = run_git(["worktree", "list"], cwd=repo_root)
|
|
344
339
|
for line in wt_list.splitlines():
|
|
345
340
|
if wt in line:
|
|
346
341
|
# Extract branch from [branch] format
|