rafcode 1.2.0 → 2.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CLAUDE.md +118 -22
- package/RAF/aaaabt-verbose-chronicle/decisions.md +25 -0
- package/RAF/aaaabt-verbose-chronicle/input.md +3 -0
- package/RAF/aaaabt-verbose-chronicle/outcomes/01-amend-iteration-references.md +25 -0
- package/RAF/aaaabt-verbose-chronicle/outcomes/02-verbose-task-name-display.md +31 -0
- package/RAF/aaaabt-verbose-chronicle/outcomes/03-verbose-streaming-fix.md +48 -0
- package/RAF/aaaabt-verbose-chronicle/outcomes/04-commit-verification-before-halt.md +56 -0
- package/RAF/aaaabt-verbose-chronicle/plans/01-amend-iteration-references.md +35 -0
- package/RAF/aaaabt-verbose-chronicle/plans/02-verbose-task-name-display.md +38 -0
- package/RAF/aaaabt-verbose-chronicle/plans/03-verbose-streaming-fix.md +45 -0
- package/RAF/aaaabt-verbose-chronicle/plans/04-commit-verification-before-halt.md +62 -0
- package/RAF/aaaacu-worktree-weaver/decisions.md +88 -0
- package/RAF/aaaacu-worktree-weaver/input.md +27 -0
- package/RAF/aaaacu-worktree-weaver/outcomes/01-git-worktree-utilities.md +41 -0
- package/RAF/aaaacu-worktree-weaver/outcomes/02-worktree-plan-command.md +44 -0
- package/RAF/aaaacu-worktree-weaver/outcomes/03-worktree-do-command.md +58 -0
- package/RAF/aaaacu-worktree-weaver/outcomes/04-auto-merge-and-cleanup.md +40 -0
- package/RAF/aaaacu-worktree-weaver/outcomes/05-worktree-tests.md +43 -0
- package/RAF/aaaacu-worktree-weaver/outcomes/06-update-documentation.md +33 -0
- package/RAF/aaaacu-worktree-weaver/plans/01-git-worktree-utilities.md +51 -0
- package/RAF/aaaacu-worktree-weaver/plans/02-worktree-plan-command.md +93 -0
- package/RAF/aaaacu-worktree-weaver/plans/03-worktree-do-command.md +81 -0
- package/RAF/aaaacu-worktree-weaver/plans/04-auto-merge-and-cleanup.md +51 -0
- package/RAF/aaaacu-worktree-weaver/plans/05-worktree-tests.md +52 -0
- package/RAF/aaaacu-worktree-weaver/plans/06-update-documentation.md +55 -0
- package/RAF/aaaacv-trim-the-fat/decisions.md +34 -0
- package/RAF/aaaacv-trim-the-fat/input.md +5 -0
- package/RAF/aaaacv-trim-the-fat/outcomes/01-add-worktree-support-to-status.md +43 -0
- package/RAF/aaaacv-trim-the-fat/outcomes/02-remove-multi-project-from-do.md +50 -0
- package/RAF/aaaacv-trim-the-fat/outcomes/03-commit-artifacts-on-amend.md +35 -0
- package/RAF/aaaacv-trim-the-fat/outcomes/04-worktree-aware-exit-messages.md +36 -0
- package/RAF/aaaacv-trim-the-fat/plans/01-add-worktree-support-to-status.md +43 -0
- package/RAF/aaaacv-trim-the-fat/plans/02-remove-multi-project-from-do.md +44 -0
- package/RAF/aaaacv-trim-the-fat/plans/03-commit-artifacts-on-amend.md +38 -0
- package/RAF/aaaacv-trim-the-fat/plans/04-worktree-aware-exit-messages.md +38 -0
- package/RAF/aaaacw-prune-cycle/decisions.md +25 -0
- package/RAF/aaaacw-prune-cycle/input.md +5 -0
- package/RAF/aaaacw-prune-cycle/outcomes/01-create-worktree-from-branch.md +32 -0
- package/RAF/aaaacw-prune-cycle/outcomes/02-cleanup-worktree-on-success.md +33 -0
- package/RAF/aaaacw-prune-cycle/outcomes/03-amend-recreate-worktree.md +40 -0
- package/RAF/aaaacw-prune-cycle/plans/01-create-worktree-from-branch.md +31 -0
- package/RAF/aaaacw-prune-cycle/plans/02-cleanup-worktree-on-success.md +38 -0
- package/RAF/aaaacw-prune-cycle/plans/03-amend-recreate-worktree.md +50 -0
- package/RAF/aaaacx-epoch-shift/decisions.md +25 -0
- package/RAF/aaaacx-epoch-shift/input.md +1 -0
- package/RAF/aaaacx-epoch-shift/outcomes/01-epoch-id-generation.md +34 -0
- package/RAF/aaaacx-epoch-shift/outcomes/02-update-pattern-matching.md +32 -0
- package/RAF/aaaacx-epoch-shift/outcomes/03-update-tests.md +59 -0
- package/RAF/aaaacx-epoch-shift/outcomes/04-update-documentation.md +30 -0
- package/RAF/aaaacx-epoch-shift/plans/01-epoch-id-generation.md +40 -0
- package/RAF/aaaacx-epoch-shift/plans/02-update-pattern-matching.md +60 -0
- package/RAF/aaaacx-epoch-shift/plans/03-update-tests.md +48 -0
- package/RAF/aaaacx-epoch-shift/plans/04-update-documentation.md +44 -0
- package/RAF/ahmpro-merge-guardian/decisions.md +25 -0
- package/RAF/ahmpro-merge-guardian/input.md +4 -0
- package/RAF/ahmpro-merge-guardian/outcomes/001-fix-amend-worktree-commit.md +45 -0
- package/RAF/ahmpro-merge-guardian/outcomes/002-base36-task-ids.md +55 -0
- package/RAF/ahmpro-merge-guardian/outcomes/003-worktree-pr-creation.md +41 -0
- package/RAF/ahmpro-merge-guardian/outcomes/004-post-execution-picker.md +53 -0
- package/RAF/ahmpro-merge-guardian/plans/001-fix-amend-worktree-commit.md +39 -0
- package/RAF/ahmpro-merge-guardian/plans/002-base36-task-ids.md +43 -0
- package/RAF/ahmpro-merge-guardian/plans/003-worktree-pr-creation.md +43 -0
- package/RAF/ahmpro-merge-guardian/plans/004-post-execution-picker.md +51 -0
- package/RAF/ahnbcu-letterjam/decisions.md +13 -0
- package/RAF/ahnbcu-letterjam/input.md +3 -0
- package/RAF/ahnbcu-letterjam/outcomes/01-base26-encoding.md +42 -0
- package/RAF/ahnbcu-letterjam/outcomes/02-update-tests.md +38 -0
- package/RAF/ahnbcu-letterjam/outcomes/03-migrate-command.md +51 -0
- package/RAF/ahnbcu-letterjam/outcomes/04-update-documentation.md +29 -0
- package/RAF/ahnbcu-letterjam/plans/01-base26-encoding.md +36 -0
- package/RAF/ahnbcu-letterjam/plans/02-update-tests.md +37 -0
- package/RAF/ahnbcu-letterjam/plans/03-migrate-command.md +49 -0
- package/RAF/ahnbcu-letterjam/plans/04-update-documentation.md +39 -0
- package/RAF/ahnwrk-worktree-weaver/decisions.md +19 -0
- package/RAF/ahnwrk-worktree-weaver/input.md +4 -0
- package/RAF/ahnwrk-worktree-weaver/outcomes/01-remove-co-authored-by.md +20 -0
- package/RAF/ahnwrk-worktree-weaver/outcomes/02-update-task-status-format.md +21 -0
- package/RAF/ahnwrk-worktree-weaver/outcomes/03-worktree-auto-discovery.md +34 -0
- package/RAF/ahnwrk-worktree-weaver/outcomes/04-fix-pr-description.md +30 -0
- package/RAF/ahnwrk-worktree-weaver/plans/01-remove-co-authored-by.md +26 -0
- package/RAF/ahnwrk-worktree-weaver/plans/02-update-task-status-format.md +27 -0
- package/RAF/ahnwrk-worktree-weaver/plans/03-worktree-auto-discovery.md +37 -0
- package/RAF/ahnwrk-worktree-weaver/plans/04-fix-pr-description.md +50 -0
- package/README.md +56 -10
- package/dist/commands/do.d.ts +15 -0
- package/dist/commands/do.d.ts.map +1 -1
- package/dist/commands/do.js +400 -131
- package/dist/commands/do.js.map +1 -1
- package/dist/commands/migrate.d.ts +14 -0
- package/dist/commands/migrate.d.ts.map +1 -0
- package/dist/commands/migrate.js +228 -0
- package/dist/commands/migrate.js.map +1 -0
- package/dist/commands/plan.d.ts.map +1 -1
- package/dist/commands/plan.js +237 -40
- package/dist/commands/plan.js.map +1 -1
- package/dist/commands/status.d.ts.map +1 -1
- package/dist/commands/status.js +221 -47
- package/dist/commands/status.js.map +1 -1
- package/dist/core/claude-runner.d.ts +52 -1
- package/dist/core/claude-runner.d.ts.map +1 -1
- package/dist/core/claude-runner.js +195 -17
- package/dist/core/claude-runner.js.map +1 -1
- package/dist/core/git.d.ts +29 -5
- package/dist/core/git.d.ts.map +1 -1
- package/dist/core/git.js +95 -18
- package/dist/core/git.js.map +1 -1
- package/dist/core/project-manager.d.ts.map +1 -1
- package/dist/core/project-manager.js +2 -2
- package/dist/core/project-manager.js.map +1 -1
- package/dist/core/pull-request.d.ts +84 -0
- package/dist/core/pull-request.d.ts.map +1 -0
- package/dist/core/pull-request.js +414 -0
- package/dist/core/pull-request.js.map +1 -0
- package/dist/core/state-derivation.d.ts +3 -3
- package/dist/core/state-derivation.d.ts.map +1 -1
- package/dist/core/state-derivation.js +18 -14
- package/dist/core/state-derivation.js.map +1 -1
- package/dist/core/worktree.d.ts +120 -0
- package/dist/core/worktree.d.ts.map +1 -0
- package/dist/core/worktree.js +322 -0
- package/dist/core/worktree.js.map +1 -0
- package/dist/index.js +2 -0
- package/dist/index.js.map +1 -1
- package/dist/parsers/stream-renderer.d.ts +42 -0
- package/dist/parsers/stream-renderer.d.ts.map +1 -0
- package/dist/parsers/stream-renderer.js +100 -0
- package/dist/parsers/stream-renderer.js.map +1 -0
- package/dist/prompts/amend.d.ts +1 -0
- package/dist/prompts/amend.d.ts.map +1 -1
- package/dist/prompts/amend.js +25 -10
- package/dist/prompts/amend.js.map +1 -1
- package/dist/prompts/execution.js +5 -5
- package/dist/prompts/execution.js.map +1 -1
- package/dist/prompts/planning.d.ts +1 -0
- package/dist/prompts/planning.d.ts.map +1 -1
- package/dist/prompts/planning.js +11 -10
- package/dist/prompts/planning.js.map +1 -1
- package/dist/types/config.d.ts +5 -0
- package/dist/types/config.d.ts.map +1 -1
- package/dist/ui/project-picker.d.ts +34 -3
- package/dist/ui/project-picker.d.ts.map +1 -1
- package/dist/ui/project-picker.js +78 -10
- package/dist/ui/project-picker.js.map +1 -1
- package/dist/utils/paths.d.ts +38 -43
- package/dist/utils/paths.d.ts.map +1 -1
- package/dist/utils/paths.js +123 -193
- package/dist/utils/paths.js.map +1 -1
- package/dist/utils/terminal-symbols.d.ts +2 -2
- package/dist/utils/terminal-symbols.js +3 -3
- package/dist/utils/terminal-symbols.js.map +1 -1
- package/dist/utils/validation.d.ts.map +1 -1
- package/dist/utils/validation.js +2 -8
- package/dist/utils/validation.js.map +1 -1
- package/package.json +1 -1
- package/src/commands/do.ts +471 -142
- package/src/commands/migrate.ts +269 -0
- package/src/commands/plan.ts +264 -40
- package/src/commands/status.ts +252 -45
- package/src/core/claude-runner.ts +270 -17
- package/src/core/git.ts +99 -19
- package/src/core/project-manager.ts +2 -1
- package/src/core/pull-request.ts +480 -0
- package/src/core/state-derivation.ts +18 -14
- package/src/core/worktree.ts +357 -0
- package/src/index.ts +2 -0
- package/src/parsers/stream-renderer.ts +139 -0
- package/src/prompts/amend.ts +27 -9
- package/src/prompts/execution.ts +5 -5
- package/src/prompts/planning.ts +12 -10
- package/src/types/config.ts +6 -0
- package/src/ui/project-picker.ts +110 -10
- package/src/utils/paths.ts +129 -214
- package/src/utils/terminal-symbols.ts +3 -3
- package/src/utils/validation.ts +2 -9
- package/tests/unit/amend-prompt.test.ts +85 -0
- package/tests/unit/claude-runner.test.ts +567 -1
- package/tests/unit/commit-planning-artifacts-worktree.test.ts +327 -0
- package/tests/unit/commit-planning-artifacts.test.ts +303 -35
- package/tests/unit/dependency-integration.test.ts +95 -95
- package/tests/unit/do-blocked-tasks.test.ts +53 -53
- package/tests/unit/do-command.test.ts +39 -132
- package/tests/unit/do-rerun.test.ts +65 -65
- package/tests/unit/do-worktree-cleanup.test.ts +151 -0
- package/tests/unit/execution-prompt.test.ts +71 -60
- package/tests/unit/failure-history.test.ts +19 -19
- package/tests/unit/git-commit-helpers.test.ts +103 -0
- package/tests/unit/git-stash.test.ts +4 -4
- package/tests/unit/migrate-command.test.ts +197 -0
- package/tests/unit/outcome-content.test.ts +20 -20
- package/tests/unit/paths.test.ts +269 -467
- package/tests/unit/plan-amend-worktree-recreate.test.ts +246 -0
- package/tests/unit/plan-command.test.ts +144 -93
- package/tests/unit/planning-prompt.test.ts +41 -4
- package/tests/unit/post-execution-picker.test.ts +251 -0
- package/tests/unit/project-manager.test.ts +20 -8
- package/tests/unit/project-picker.test.ts +425 -42
- package/tests/unit/pull-request.test.ts +852 -0
- package/tests/unit/state-derivation.test.ts +138 -137
- package/tests/unit/status-command.test.ts +344 -76
- package/tests/unit/stream-renderer.test.ts +286 -0
- package/tests/unit/terminal-symbols.test.ts +4 -4
- package/tests/unit/worktree-integration.test.ts +405 -0
- package/tests/unit/worktree.test.ts +523 -0
- package/tests/unit/do-multiproject.test.ts +0 -270
- /package/RAF/{001-raf-task-improvements → aaaaab-raf-task-improvements}/input.md +0 -0
- /package/RAF/{001-raf-task-improvements/outcomes/001-add-decisions-folder.md → aaaaab-raf-task-improvements/outcomes/01-add-decisions-folder.md} +0 -0
- /package/RAF/{001-raf-task-improvements/outcomes/002-fix-write-error-on-shutdown.md → aaaaab-raf-task-improvements/outcomes/02-fix-write-error-on-shutdown.md} +0 -0
- /package/RAF/{001-raf-task-improvements/outcomes/003-stash-changes-on-failure.md → aaaaab-raf-task-improvements/outcomes/03-stash-changes-on-failure.md} +0 -0
- /package/RAF/{001-raf-task-improvements/outcomes/004-add-project-name-to-commits.md → aaaaab-raf-task-improvements/outcomes/04-add-project-name-to-commits.md} +0 -0
- /package/RAF/{001-raf-task-improvements/outcomes/005-add-running-time-display.md → aaaaab-raf-task-improvements/outcomes/05-add-running-time-display.md} +0 -0
- /package/RAF/{001-raf-task-improvements/outcomes/006-add-task-name-to-logs.md → aaaaab-raf-task-improvements/outcomes/06-add-task-name-to-logs.md} +0 -0
- /package/RAF/{001-raf-task-improvements/outcomes/007-show-model-at-task-start.md → aaaaab-raf-task-improvements/outcomes/07-show-model-at-task-start.md} +0 -0
- /package/RAF/{001-raf-task-improvements/outcomes/009-remove-editor-placeholder-text.md → aaaaab-raf-task-improvements/outcomes/09-remove-editor-placeholder-text.md} +0 -0
- /package/RAF/{001-raf-task-improvements → aaaaab-raf-task-improvements}/outcomes/SUMMARY.md +0 -0
- /package/RAF/{001-raf-task-improvements/plans/001-add-decisions-folder.md → aaaaab-raf-task-improvements/plans/01-add-decisions-folder.md} +0 -0
- /package/RAF/{001-raf-task-improvements/plans/002-fix-write-error-on-shutdown.md → aaaaab-raf-task-improvements/plans/02-fix-write-error-on-shutdown.md} +0 -0
- /package/RAF/{001-raf-task-improvements/plans/003-stash-changes-on-failure.md → aaaaab-raf-task-improvements/plans/03-stash-changes-on-failure.md} +0 -0
- /package/RAF/{001-raf-task-improvements/plans/004-add-project-name-to-commits.md → aaaaab-raf-task-improvements/plans/04-add-project-name-to-commits.md} +0 -0
- /package/RAF/{001-raf-task-improvements/plans/005-add-running-time-display.md → aaaaab-raf-task-improvements/plans/05-add-running-time-display.md} +0 -0
- /package/RAF/{001-raf-task-improvements/plans/006-add-task-name-to-logs.md → aaaaab-raf-task-improvements/plans/06-add-task-name-to-logs.md} +0 -0
- /package/RAF/{001-raf-task-improvements/plans/009-remove-editor-placeholder-text.md → aaaaab-raf-task-improvements/plans/09-remove-editor-placeholder-text.md} +0 -0
- /package/RAF/{002-raf-task-improvements-execution → aaaaac-raf-task-improvements-execution}/decisions/DECISIONS.md +0 -0
- /package/RAF/{002-raf-task-improvements-execution → aaaaac-raf-task-improvements-execution}/input.md +0 -0
- /package/RAF/{002-raf-task-improvements-execution/outcomes/001-commit-show-model-at-task-start.md → aaaaac-raf-task-improvements-execution/outcomes/01-commit-show-model-at-task-start.md} +0 -0
- /package/RAF/{002-raf-task-improvements-execution/outcomes/002-delete-skipped-plan.md → aaaaac-raf-task-improvements-execution/outcomes/02-delete-skipped-plan.md} +0 -0
- /package/RAF/{002-raf-task-improvements-execution → aaaaac-raf-task-improvements-execution}/outcomes/SUMMARY.md +0 -0
- /package/RAF/{002-raf-task-improvements-execution/plans/001-commit-show-model-at-task-start.md → aaaaac-raf-task-improvements-execution/plans/01-commit-show-model-at-task-start.md} +0 -0
- /package/RAF/{002-raf-task-improvements-execution/plans/002-delete-skipped-plan.md → aaaaac-raf-task-improvements-execution/plans/02-delete-skipped-plan.md} +0 -0
- /package/RAF/{003-multi-project-execution → aaaaad-multi-project-execution}/decisions/DECISIONS.md +0 -0
- /package/RAF/{003-multi-project-execution → aaaaad-multi-project-execution}/input.md +0 -0
- /package/RAF/{003-multi-project-execution/outcomes/001-remove-state-json.md → aaaaad-multi-project-execution/outcomes/01-remove-state-json.md} +0 -0
- /package/RAF/{003-multi-project-execution/outcomes/002-update-raf-status.md → aaaaad-multi-project-execution/outcomes/02-update-raf-status.md} +0 -0
- /package/RAF/{003-multi-project-execution/outcomes/003-simplify-git-logic.md → aaaaad-multi-project-execution/outcomes/03-simplify-git-logic.md} +0 -0
- /package/RAF/{003-multi-project-execution/outcomes/004-auto-commit-planning.md → aaaaad-multi-project-execution/outcomes/04-auto-commit-planning.md} +0 -0
- /package/RAF/{003-multi-project-execution/outcomes/005-rerun-failed-tasks.md → aaaaad-multi-project-execution/outcomes/05-rerun-failed-tasks.md} +0 -0
- /package/RAF/{003-multi-project-execution/outcomes/006-multi-project-execution.md → aaaaad-multi-project-execution/outcomes/06-multi-project-execution.md} +0 -0
- /package/RAF/{003-multi-project-execution/outcomes/007-verify-timeout.md → aaaaad-multi-project-execution/outcomes/07-verify-timeout.md} +0 -0
- /package/RAF/{003-multi-project-execution/outcomes/008-move-decisions-file.md → aaaaad-multi-project-execution/outcomes/08-move-decisions-file.md} +0 -0
- /package/RAF/{003-multi-project-execution → aaaaad-multi-project-execution}/outcomes/SUMMARY.md +0 -0
- /package/RAF/{003-multi-project-execution/plans/001-remove-state-json.md → aaaaad-multi-project-execution/plans/01-remove-state-json.md} +0 -0
- /package/RAF/{003-multi-project-execution/plans/002-update-raf-status.md → aaaaad-multi-project-execution/plans/02-update-raf-status.md} +0 -0
- /package/RAF/{003-multi-project-execution/plans/003-simplify-git-logic.md → aaaaad-multi-project-execution/plans/03-simplify-git-logic.md} +0 -0
- /package/RAF/{003-multi-project-execution/plans/004-auto-commit-planning.md → aaaaad-multi-project-execution/plans/04-auto-commit-planning.md} +0 -0
- /package/RAF/{003-multi-project-execution/plans/005-rerun-failed-tasks.md → aaaaad-multi-project-execution/plans/05-rerun-failed-tasks.md} +0 -0
- /package/RAF/{003-multi-project-execution/plans/006-multi-project-execution.md → aaaaad-multi-project-execution/plans/06-multi-project-execution.md} +0 -0
- /package/RAF/{003-multi-project-execution/plans/007-verify-timeout.md → aaaaad-multi-project-execution/plans/07-verify-timeout.md} +0 -0
- /package/RAF/{003-multi-project-execution/plans/008-move-decisions-file.md → aaaaad-multi-project-execution/plans/08-move-decisions-file.md} +0 -0
- /package/RAF/{004-task-naming-optimization → aaaaae-task-naming-optimization}/decisions.md +0 -0
- /package/RAF/{004-task-naming-optimization → aaaaae-task-naming-optimization}/input.md +0 -0
- /package/RAF/{004-task-naming-optimization/outcomes/001-remove-summary-file.md → aaaaae-task-naming-optimization/outcomes/01-remove-summary-file.md} +0 -0
- /package/RAF/{004-task-naming-optimization/outcomes/002-base36-project-numbering.md → aaaaae-task-naming-optimization/outcomes/02-base36-project-numbering.md} +0 -0
- /package/RAF/{004-task-naming-optimization/outcomes/003-improve-haiku-prompt.md → aaaaae-task-naming-optimization/outcomes/03-improve-haiku-prompt.md} +0 -0
- /package/RAF/{004-task-naming-optimization → aaaaae-task-naming-optimization}/outcomes/SUMMARY.md +0 -0
- /package/RAF/{004-task-naming-optimization/plans/001-remove-summary-file.md → aaaaae-task-naming-optimization/plans/01-remove-summary-file.md} +0 -0
- /package/RAF/{004-task-naming-optimization/plans/002-base36-project-numbering.md → aaaaae-task-naming-optimization/plans/02-base36-project-numbering.md} +0 -0
- /package/RAF/{004-task-naming-optimization/plans/003-improve-haiku-prompt.md → aaaaae-task-naming-optimization/plans/03-improve-haiku-prompt.md} +0 -0
- /package/RAF/{005-task-naming-improvements → aaaaaf-task-naming-improvements}/decisions.md +0 -0
- /package/RAF/{005-task-naming-improvements → aaaaaf-task-naming-improvements}/input.md +0 -0
- /package/RAF/{005-task-naming-improvements/outcomes/001-enhance-identifier-resolution.md → aaaaaf-task-naming-improvements/outcomes/01-enhance-identifier-resolution.md} +0 -0
- /package/RAF/{005-task-naming-improvements/outcomes/002-add-identifier-support-to-status.md → aaaaaf-task-naming-improvements/outcomes/02-add-identifier-support-to-status.md} +0 -0
- /package/RAF/{005-task-naming-improvements/outcomes/003-update-do-for-full-folder-names.md → aaaaaf-task-naming-improvements/outcomes/03-update-do-for-full-folder-names.md} +0 -0
- /package/RAF/{005-task-naming-improvements/outcomes/004-implement-amend-flag-for-plan.md → aaaaaf-task-naming-improvements/outcomes/04-implement-amend-flag-for-plan.md} +0 -0
- /package/RAF/{005-task-naming-improvements/outcomes/005-commit-outcomes-on-complete.md → aaaaaf-task-naming-improvements/outcomes/05-commit-outcomes-on-complete.md} +0 -0
- /package/RAF/{005-task-naming-improvements/outcomes/006-update-execution-prompt-commit-schema.md → aaaaaf-task-naming-improvements/outcomes/06-update-execution-prompt-commit-schema.md} +0 -0
- /package/RAF/{005-task-naming-improvements/outcomes/007-allow-pending-task-amendments.md → aaaaaf-task-naming-improvements/outcomes/07-allow-pending-task-amendments.md} +0 -0
- /package/RAF/{005-task-naming-improvements/outcomes/008-fix-timeout-label.md → aaaaaf-task-naming-improvements/outcomes/08-fix-timeout-label.md} +0 -0
- /package/RAF/{005-task-naming-improvements/plans/001-enhance-identifier-resolution.md → aaaaaf-task-naming-improvements/plans/01-enhance-identifier-resolution.md} +0 -0
- /package/RAF/{005-task-naming-improvements/plans/002-add-identifier-support-to-status.md → aaaaaf-task-naming-improvements/plans/02-add-identifier-support-to-status.md} +0 -0
- /package/RAF/{005-task-naming-improvements/plans/003-update-do-for-full-folder-names.md → aaaaaf-task-naming-improvements/plans/03-update-do-for-full-folder-names.md} +0 -0
- /package/RAF/{005-task-naming-improvements/plans/004-implement-amend-flag-for-plan.md → aaaaaf-task-naming-improvements/plans/04-implement-amend-flag-for-plan.md} +0 -0
- /package/RAF/{005-task-naming-improvements/plans/005-commit-outcomes-on-complete.md → aaaaaf-task-naming-improvements/plans/05-commit-outcomes-on-complete.md} +0 -0
- /package/RAF/{005-task-naming-improvements/plans/006-update-execution-prompt-commit-schema.md → aaaaaf-task-naming-improvements/plans/06-update-execution-prompt-commit-schema.md} +0 -0
- /package/RAF/{005-task-naming-improvements/plans/007-allow-pending-task-amendments.md → aaaaaf-task-naming-improvements/plans/07-allow-pending-task-amendments.md} +0 -0
- /package/RAF/{005-task-naming-improvements/plans/008-fix-timeout-label.md → aaaaaf-task-naming-improvements/plans/08-fix-timeout-label.md} +0 -0
- /package/RAF/{006-fix-double-summary-headers → aaaaag-fix-double-summary-headers}/decisions.md +0 -0
- /package/RAF/{006-fix-double-summary-headers → aaaaag-fix-double-summary-headers}/input.md +0 -0
- /package/RAF/{006-fix-double-summary-headers/outcomes/001-fix-double-summary-headers.md → aaaaag-fix-double-summary-headers/outcomes/01-fix-double-summary-headers.md} +0 -0
- /package/RAF/{006-fix-double-summary-headers/outcomes/002-update-readme-for-npm.md → aaaaag-fix-double-summary-headers/outcomes/02-update-readme-for-npm.md} +0 -0
- /package/RAF/{006-fix-double-summary-headers/outcomes/003-npm-publish-instructions.md → aaaaag-fix-double-summary-headers/outcomes/03-npm-publish-instructions.md} +0 -0
- /package/RAF/{006-fix-double-summary-headers/outcomes/004-flexible-project-lookup.md → aaaaag-fix-double-summary-headers/outcomes/04-flexible-project-lookup.md} +0 -0
- /package/RAF/{006-fix-double-summary-headers/plans/001-fix-double-summary-headers.md → aaaaag-fix-double-summary-headers/plans/01-fix-double-summary-headers.md} +0 -0
- /package/RAF/{006-fix-double-summary-headers/plans/002-update-readme-for-npm.md → aaaaag-fix-double-summary-headers/plans/02-update-readme-for-npm.md} +0 -0
- /package/RAF/{006-fix-double-summary-headers/plans/003-npm-publish-instructions.md → aaaaag-fix-double-summary-headers/plans/03-npm-publish-instructions.md} +0 -0
- /package/RAF/{006-fix-double-summary-headers/plans/004-flexible-project-lookup.md → aaaaag-fix-double-summary-headers/plans/04-flexible-project-lookup.md} +0 -0
- /package/RAF/{007-improve-outcome-format → aaaaah-improve-outcome-format}/decisions.md +0 -0
- /package/RAF/{007-improve-outcome-format → aaaaah-improve-outcome-format}/input.md +0 -0
- /package/RAF/{007-improve-outcome-format/outcomes/001-update-execution-prompt.md → aaaaah-improve-outcome-format/outcomes/01-update-execution-prompt.md} +0 -0
- /package/RAF/{007-improve-outcome-format/outcomes/002-update-state-derivation.md → aaaaah-improve-outcome-format/outcomes/02-update-state-derivation.md} +0 -0
- /package/RAF/{007-improve-outcome-format/outcomes/003-update-do-command-outcome-handling.md → aaaaah-improve-outcome-format/outcomes/03-update-do-command-outcome-handling.md} +0 -0
- /package/RAF/{007-improve-outcome-format/outcomes/004-implement-failure-analysis.md → aaaaah-improve-outcome-format/outcomes/04-implement-failure-analysis.md} +0 -0
- /package/RAF/{007-improve-outcome-format/outcomes/005-update-documentation.md → aaaaah-improve-outcome-format/outcomes/05-update-documentation.md} +0 -0
- /package/RAF/{007-improve-outcome-format/plans/001-update-execution-prompt.md → aaaaah-improve-outcome-format/plans/01-update-execution-prompt.md} +0 -0
- /package/RAF/{007-improve-outcome-format/plans/002-update-state-derivation.md → aaaaah-improve-outcome-format/plans/02-update-state-derivation.md} +0 -0
- /package/RAF/{007-improve-outcome-format/plans/003-update-do-command-outcome-handling.md → aaaaah-improve-outcome-format/plans/03-update-do-command-outcome-handling.md} +0 -0
- /package/RAF/{007-improve-outcome-format/plans/004-implement-failure-analysis.md → aaaaah-improve-outcome-format/plans/04-implement-failure-analysis.md} +0 -0
- /package/RAF/{007-improve-outcome-format/plans/005-update-documentation.md → aaaaah-improve-outcome-format/plans/05-update-documentation.md} +0 -0
- /package/RAF/{008-beautiful-do → aaaaai-beautiful-do}/decisions.md +0 -0
- /package/RAF/{008-beautiful-do → aaaaai-beautiful-do}/input.md +0 -0
- /package/RAF/{008-beautiful-do/outcomes/001-terminal-symbols.md → aaaaai-beautiful-do/outcomes/01-terminal-symbols.md} +0 -0
- /package/RAF/{008-beautiful-do/outcomes/002-refactor-do-output.md → aaaaai-beautiful-do/outcomes/02-refactor-do-output.md} +0 -0
- /package/RAF/{008-beautiful-do/outcomes/003-refactor-status-output.md → aaaaai-beautiful-do/outcomes/03-refactor-status-output.md} +0 -0
- /package/RAF/{008-beautiful-do/outcomes/004-simplify-logger.md → aaaaai-beautiful-do/outcomes/04-simplify-logger.md} +0 -0
- /package/RAF/{008-beautiful-do/outcomes/005-add-tests.md → aaaaai-beautiful-do/outcomes/05-add-tests.md} +0 -0
- /package/RAF/{008-beautiful-do/plans/001-terminal-symbols.md → aaaaai-beautiful-do/plans/01-terminal-symbols.md} +0 -0
- /package/RAF/{008-beautiful-do/plans/002-refactor-do-output.md → aaaaai-beautiful-do/plans/02-refactor-do-output.md} +0 -0
- /package/RAF/{008-beautiful-do/plans/003-refactor-status-output.md → aaaaai-beautiful-do/plans/03-refactor-status-output.md} +0 -0
- /package/RAF/{008-beautiful-do/plans/004-simplify-logger.md → aaaaai-beautiful-do/plans/04-simplify-logger.md} +0 -0
- /package/RAF/{008-beautiful-do/plans/005-add-tests.md → aaaaai-beautiful-do/plans/05-add-tests.md} +0 -0
- /package/RAF/{009-system-promt-ammend → aaaaaj-system-promt-ammend}/decisions.md +0 -0
- /package/RAF/{009-system-promt-ammend → aaaaaj-system-promt-ammend}/input.md +0 -0
- /package/RAF/{009-system-promt-ammend/outcomes/001-model-override.md → aaaaaj-system-promt-ammend/outcomes/01-model-override.md} +0 -0
- /package/RAF/{009-system-promt-ammend/outcomes/002-system-prompt-append.md → aaaaaj-system-promt-ammend/outcomes/02-system-prompt-append.md} +0 -0
- /package/RAF/{009-system-promt-ammend/outcomes/003-retry-context.md → aaaaaj-system-promt-ammend/outcomes/03-retry-context.md} +0 -0
- /package/RAF/{009-system-promt-ammend/plans/001-model-override.md → aaaaaj-system-promt-ammend/plans/01-model-override.md} +0 -0
- /package/RAF/{009-system-promt-ammend/plans/002-system-prompt-append.md → aaaaaj-system-promt-ammend/plans/02-system-prompt-append.md} +0 -0
- /package/RAF/{009-system-promt-ammend/plans/003-retry-context.md → aaaaaj-system-promt-ammend/plans/03-retry-context.md} +0 -0
- /package/RAF/{010-outcome-marker-fallback → aaaabk-outcome-marker-fallback}/decisions.md +0 -0
- /package/RAF/{010-outcome-marker-fallback → aaaabk-outcome-marker-fallback}/input.md +0 -0
- /package/RAF/{010-outcome-marker-fallback/outcomes/001-outcome-file-marker-fallback.md → aaaabk-outcome-marker-fallback/outcomes/01-outcome-file-marker-fallback.md} +0 -0
- /package/RAF/{010-outcome-marker-fallback/outcomes/002-creative-project-naming.md → aaaabk-outcome-marker-fallback/outcomes/02-creative-project-naming.md} +0 -0
- /package/RAF/{010-outcome-marker-fallback/plans/001-outcome-file-marker-fallback.md → aaaabk-outcome-marker-fallback/plans/01-outcome-file-marker-fallback.md} +0 -0
- /package/RAF/{010-outcome-marker-fallback/plans/002-creative-project-naming.md → aaaabk-outcome-marker-fallback/plans/02-creative-project-naming.md} +0 -0
- /package/RAF/{011-do-task-in-commit → aaaabl-do-task-in-commit}/decisions.md +0 -0
- /package/RAF/{011-do-task-in-commit → aaaabl-do-task-in-commit}/input.md +0 -0
- /package/RAF/{011-do-task-in-commit/outcomes/001-update-execution-prompt.md → aaaabl-do-task-in-commit/outcomes/01-update-execution-prompt.md} +0 -0
- /package/RAF/{011-do-task-in-commit/outcomes/002-update-tests.md → aaaabl-do-task-in-commit/outcomes/02-update-tests.md} +0 -0
- /package/RAF/{011-do-task-in-commit/outcomes/003-update-documentation.md → aaaabl-do-task-in-commit/outcomes/03-update-documentation.md} +0 -0
- /package/RAF/{011-do-task-in-commit/plans/001-update-execution-prompt.md → aaaabl-do-task-in-commit/plans/01-update-execution-prompt.md} +0 -0
- /package/RAF/{011-do-task-in-commit/plans/002-update-tests.md → aaaabl-do-task-in-commit/plans/02-update-tests.md} +0 -0
- /package/RAF/{011-do-task-in-commit/plans/003-update-documentation.md → aaaabl-do-task-in-commit/plans/03-update-documentation.md} +0 -0
- /package/RAF/{012-name-picker-buffet → aaaabm-name-picker-buffet}/decisions.md +0 -0
- /package/RAF/{012-name-picker-buffet → aaaabm-name-picker-buffet}/input.md +0 -0
- /package/RAF/{012-name-picker-buffet/outcomes/001-name-picker-for-raf-plan.md → aaaabm-name-picker-buffet/outcomes/01-name-picker-for-raf-plan.md} +0 -0
- /package/RAF/{012-name-picker-buffet/outcomes/002-interactive-project-picker-for-raf-do.md → aaaabm-name-picker-buffet/outcomes/02-interactive-project-picker-for-raf-do.md} +0 -0
- /package/RAF/{012-name-picker-buffet/outcomes/003-raf-status-truncation.md → aaaabm-name-picker-buffet/outcomes/03-raf-status-truncation.md} +0 -0
- /package/RAF/{012-name-picker-buffet/outcomes/004-failure-reason-details.md → aaaabm-name-picker-buffet/outcomes/04-failure-reason-details.md} +0 -0
- /package/RAF/{012-name-picker-buffet/outcomes/005-remove-raf-commits.md → aaaabm-name-picker-buffet/outcomes/05-remove-raf-commits.md} +0 -0
- /package/RAF/{012-name-picker-buffet/outcomes/006-update-execution-prompt-for-commits.md → aaaabm-name-picker-buffet/outcomes/06-update-execution-prompt-for-commits.md} +0 -0
- /package/RAF/{012-name-picker-buffet/outcomes/007-fix-plan-mode-user-prompt.md → aaaabm-name-picker-buffet/outcomes/07-fix-plan-mode-user-prompt.md} +0 -0
- /package/RAF/{012-name-picker-buffet/outcomes/008-add-auto-flag-for-plan-mode.md → aaaabm-name-picker-buffet/outcomes/08-add-auto-flag-for-plan-mode.md} +0 -0
- /package/RAF/{012-name-picker-buffet/plans/001-name-picker-for-raf-plan.md → aaaabm-name-picker-buffet/plans/01-name-picker-for-raf-plan.md} +0 -0
- /package/RAF/{012-name-picker-buffet/plans/002-interactive-project-picker-for-raf-do.md → aaaabm-name-picker-buffet/plans/02-interactive-project-picker-for-raf-do.md} +0 -0
- /package/RAF/{012-name-picker-buffet/plans/003-raf-status-truncation.md → aaaabm-name-picker-buffet/plans/03-raf-status-truncation.md} +0 -0
- /package/RAF/{012-name-picker-buffet/plans/004-failure-reason-details.md → aaaabm-name-picker-buffet/plans/04-failure-reason-details.md} +0 -0
- /package/RAF/{012-name-picker-buffet/plans/005-remove-raf-commits.md → aaaabm-name-picker-buffet/plans/05-remove-raf-commits.md} +0 -0
- /package/RAF/{012-name-picker-buffet/plans/006-update-execution-prompt-for-commits.md → aaaabm-name-picker-buffet/plans/06-update-execution-prompt-for-commits.md} +0 -0
- /package/RAF/{012-name-picker-buffet/plans/007-fix-plan-mode-user-prompt.md → aaaabm-name-picker-buffet/plans/07-fix-plan-mode-user-prompt.md} +0 -0
- /package/RAF/{012-name-picker-buffet/plans/008-add-auto-flag-for-plan-mode.md → aaaabm-name-picker-buffet/plans/08-add-auto-flag-for-plan-mode.md} +0 -0
- /package/RAF/{013-dependencies-watchdog → aaaabn-dependencies-watchdog}/decisions.md +0 -0
- /package/RAF/{013-dependencies-watchdog → aaaabn-dependencies-watchdog}/input.md +0 -0
- /package/RAF/{013-dependencies-watchdog/outcomes/001-define-dependency-syntax.md → aaaabn-dependencies-watchdog/outcomes/01-define-dependency-syntax.md} +0 -0
- /package/RAF/{013-dependencies-watchdog/outcomes/002-update-planning-prompts.md → aaaabn-dependencies-watchdog/outcomes/02-update-planning-prompts.md} +0 -0
- /package/RAF/{013-dependencies-watchdog/outcomes/003-parse-dependencies-update-state.md → aaaabn-dependencies-watchdog/outcomes/03-parse-dependencies-update-state.md} +0 -0
- /package/RAF/{013-dependencies-watchdog/outcomes/004-implement-dependency-checking-in-do.md → aaaabn-dependencies-watchdog/outcomes/04-implement-dependency-checking-in-do.md} +0 -0
- /package/RAF/{013-dependencies-watchdog/outcomes/005-update-execution-prompts.md → aaaabn-dependencies-watchdog/outcomes/05-update-execution-prompts.md} +0 -0
- /package/RAF/{013-dependencies-watchdog/outcomes/006-add-tests.md → aaaabn-dependencies-watchdog/outcomes/06-add-tests.md} +0 -0
- /package/RAF/{013-dependencies-watchdog/outcomes/007-add-act-alias.md → aaaabn-dependencies-watchdog/outcomes/07-add-act-alias.md} +0 -0
- /package/RAF/{013-dependencies-watchdog/outcomes/008-add-exit-message.md → aaaabn-dependencies-watchdog/outcomes/08-add-exit-message.md} +0 -0
- /package/RAF/{013-dependencies-watchdog/plans/001-define-dependency-syntax.md → aaaabn-dependencies-watchdog/plans/01-define-dependency-syntax.md} +0 -0
- /package/RAF/{013-dependencies-watchdog/plans/002-update-planning-prompts.md → aaaabn-dependencies-watchdog/plans/02-update-planning-prompts.md} +0 -0
- /package/RAF/{013-dependencies-watchdog/plans/003-parse-dependencies-update-state.md → aaaabn-dependencies-watchdog/plans/03-parse-dependencies-update-state.md} +0 -0
- /package/RAF/{013-dependencies-watchdog/plans/004-implement-dependency-checking-in-do.md → aaaabn-dependencies-watchdog/plans/04-implement-dependency-checking-in-do.md} +0 -0
- /package/RAF/{013-dependencies-watchdog/plans/005-update-execution-prompts.md → aaaabn-dependencies-watchdog/plans/05-update-execution-prompts.md} +0 -0
- /package/RAF/{013-dependencies-watchdog/plans/006-add-tests.md → aaaabn-dependencies-watchdog/plans/06-add-tests.md} +0 -0
- /package/RAF/{013-dependencies-watchdog/plans/007-add-act-alias.md → aaaabn-dependencies-watchdog/plans/07-add-act-alias.md} +0 -0
- /package/RAF/{013-dependencies-watchdog/plans/008-add-exit-message.md → aaaabn-dependencies-watchdog/plans/08-add-exit-message.md} +0 -0
- /package/RAF/{014-watchdog → aaaabo-watchdog}/decisions.md +0 -0
- /package/RAF/{014-watchdog → aaaabo-watchdog}/input.md +0 -0
- /package/RAF/{014-watchdog/outcomes/001-amend-flag-position.md → aaaabo-watchdog/outcomes/01-amend-flag-position.md} +0 -0
- /package/RAF/{014-watchdog/outcomes/002-details-only-on-failure.md → aaaabo-watchdog/outcomes/02-details-only-on-failure.md} +0 -0
- /package/RAF/{014-watchdog/plans/001-amend-flag-position.md → aaaabo-watchdog/plans/01-amend-flag-position.md} +0 -0
- /package/RAF/{014-watchdog/plans/002-details-only-on-failure.md → aaaabo-watchdog/plans/02-details-only-on-failure.md} +0 -0
- /package/RAF/{015-name-lottery → aaaabp-name-lottery}/decisions.md +0 -0
- /package/RAF/{015-name-lottery → aaaabp-name-lottery}/input.md +0 -0
- /package/RAF/{015-name-lottery/outcomes/001-auto-pick-project-name.md → aaaabp-name-lottery/outcomes/01-auto-pick-project-name.md} +0 -0
- /package/RAF/{015-name-lottery/outcomes/002-mention-plan-files-in-commit.md → aaaabp-name-lottery/outcomes/02-mention-plan-files-in-commit.md} +0 -0
- /package/RAF/{015-name-lottery/outcomes/003-fix-input-md-in-amend-flow.md → aaaabp-name-lottery/outcomes/03-fix-input-md-in-amend-flow.md} +0 -0
- /package/RAF/{015-name-lottery/plans/001-auto-pick-project-name.md → aaaabp-name-lottery/plans/01-auto-pick-project-name.md} +0 -0
- /package/RAF/{015-name-lottery/plans/002-mention-plan-files-in-commit.md → aaaabp-name-lottery/plans/02-mention-plan-files-in-commit.md} +0 -0
- /package/RAF/{015-name-lottery/plans/003-fix-input-md-in-amend-flow.md → aaaabp-name-lottery/plans/03-fix-input-md-in-amend-flow.md} +0 -0
- /package/RAF/{016-planning-scalpel → aaaabq-planning-scalpel}/decisions.md +0 -0
- /package/RAF/{016-planning-scalpel → aaaabq-planning-scalpel}/input.md +0 -0
- /package/RAF/{016-planning-scalpel/outcomes/001-update-git-commit-instructions.md → aaaabq-planning-scalpel/outcomes/01-update-git-commit-instructions.md} +0 -0
- /package/RAF/{016-planning-scalpel/plans/001-update-git-commit-instructions.md → aaaabq-planning-scalpel/plans/01-update-git-commit-instructions.md} +0 -0
- /package/RAF/{017-decision-vault → aaaabr-decision-vault}/decisions.md +0 -0
- /package/RAF/{017-decision-vault → aaaabr-decision-vault}/input.md +0 -0
- /package/RAF/{017-decision-vault/outcomes/001-create-git-commit-utility.md → aaaabr-decision-vault/outcomes/01-create-git-commit-utility.md} +0 -0
- /package/RAF/{017-decision-vault/outcomes/002-integrate-commit-into-plan.md → aaaabr-decision-vault/outcomes/02-integrate-commit-into-plan.md} +0 -0
- /package/RAF/{017-decision-vault/outcomes/003-add-tests-for-planning-commit.md → aaaabr-decision-vault/outcomes/03-add-tests-for-planning-commit.md} +0 -0
- /package/RAF/{017-decision-vault/plans/001-create-git-commit-utility.md → aaaabr-decision-vault/plans/01-create-git-commit-utility.md} +0 -0
- /package/RAF/{017-decision-vault/plans/002-integrate-commit-into-plan.md → aaaabr-decision-vault/plans/02-integrate-commit-into-plan.md} +0 -0
- /package/RAF/{017-decision-vault/plans/003-add-tests-for-planning-commit.md → aaaabr-decision-vault/plans/03-add-tests-for-planning-commit.md} +0 -0
- /package/RAF/{018-workflow-forge → aaaabs-workflow-forge}/decisions.md +0 -0
- /package/RAF/{018-workflow-forge → aaaabs-workflow-forge}/input.md +0 -0
- /package/RAF/{018-workflow-forge/outcomes/001-add-task-number-progress.md → aaaabs-workflow-forge/outcomes/01-add-task-number-progress.md} +0 -0
- /package/RAF/{018-workflow-forge/outcomes/002-update-plan-do-prompts.md → aaaabs-workflow-forge/outcomes/02-update-plan-do-prompts.md} +0 -0
- /package/RAF/{018-workflow-forge/plans/001-add-task-number-progress.md → aaaabs-workflow-forge/plans/01-add-task-number-progress.md} +0 -0
- /package/RAF/{018-workflow-forge/plans/002-update-plan-do-prompts.md → aaaabs-workflow-forge/plans/02-update-plan-do-prompts.md} +0 -0
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import * as fs from 'node:fs';
|
|
2
2
|
import * as path from 'node:path';
|
|
3
|
-
import { getPlansDir, getOutcomesDir, getInputPath } from '../utils/paths.js';
|
|
3
|
+
import { getPlansDir, getOutcomesDir, getInputPath, decodeBase26, TASK_ID_PATTERN } from '../utils/paths.js';
|
|
4
4
|
/**
|
|
5
5
|
* Discover all projects in the RAF directory.
|
|
6
|
-
* Projects are directories matching the pattern
|
|
6
|
+
* Projects are directories matching the pattern XXXXXX-project-name (6-char base26 prefix).
|
|
7
7
|
*/
|
|
8
8
|
export function discoverProjects(rafDir) {
|
|
9
9
|
if (!fs.existsSync(rafDir)) {
|
|
@@ -13,13 +13,16 @@ export function discoverProjects(rafDir) {
|
|
|
13
13
|
const projects = [];
|
|
14
14
|
for (const entry of entries) {
|
|
15
15
|
if (entry.isDirectory()) {
|
|
16
|
-
const match = entry.name.match(/^(
|
|
16
|
+
const match = entry.name.match(/^([a-z]{6})-(.+)$/i);
|
|
17
17
|
if (match && match[1] && match[2]) {
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
18
|
+
const decoded = decodeBase26(match[1].toLowerCase());
|
|
19
|
+
if (decoded !== null) {
|
|
20
|
+
projects.push({
|
|
21
|
+
number: decoded,
|
|
22
|
+
name: match[2],
|
|
23
|
+
path: path.join(rafDir, entry.name),
|
|
24
|
+
});
|
|
25
|
+
}
|
|
23
26
|
}
|
|
24
27
|
}
|
|
25
28
|
}
|
|
@@ -27,7 +30,7 @@ export function discoverProjects(rafDir) {
|
|
|
27
30
|
}
|
|
28
31
|
/**
|
|
29
32
|
* Parse the Dependencies section from plan file content.
|
|
30
|
-
* Format: `## Dependencies\
|
|
33
|
+
* Format: `## Dependencies\n01, 02` → ["01", "02"]
|
|
31
34
|
* Returns empty array if no Dependencies section exists.
|
|
32
35
|
*/
|
|
33
36
|
export function parseDependencies(content) {
|
|
@@ -39,11 +42,12 @@ export function parseDependencies(content) {
|
|
|
39
42
|
if (!dependenciesLine) {
|
|
40
43
|
return [];
|
|
41
44
|
}
|
|
42
|
-
// Parse comma-separated task IDs
|
|
45
|
+
// Parse comma-separated task IDs (2-char base36)
|
|
46
|
+
const taskIdRegex = new RegExp(`^${TASK_ID_PATTERN}$`);
|
|
43
47
|
return dependenciesLine
|
|
44
48
|
.split(',')
|
|
45
49
|
.map((id) => id.trim())
|
|
46
|
-
.filter((id) =>
|
|
50
|
+
.filter((id) => taskIdRegex.test(id));
|
|
47
51
|
}
|
|
48
52
|
/**
|
|
49
53
|
* Parse an outcome file to extract its status.
|
|
@@ -120,7 +124,7 @@ export function deriveProjectStatus(projectPath, tasks) {
|
|
|
120
124
|
/**
|
|
121
125
|
* Derive project state from the folder structure.
|
|
122
126
|
* Scans plans/ for plan files and outcomes/ for outcome files.
|
|
123
|
-
* Matches them by task ID (
|
|
127
|
+
* Matches them by task ID (2-char base36 prefix for tasks) and determines status.
|
|
124
128
|
* Also parses dependencies and derives blocked status.
|
|
125
129
|
*/
|
|
126
130
|
export function deriveProjectState(projectPath) {
|
|
@@ -142,7 +146,7 @@ export function deriveProjectState(projectPath) {
|
|
|
142
146
|
.filter((f) => f.endsWith('.md'))
|
|
143
147
|
.sort();
|
|
144
148
|
for (const outcomeFile of outcomeFiles) {
|
|
145
|
-
const match = outcomeFile.match(
|
|
149
|
+
const match = outcomeFile.match(new RegExp(`^(${TASK_ID_PATTERN})-`));
|
|
146
150
|
if (match && match[1]) {
|
|
147
151
|
const taskId = match[1];
|
|
148
152
|
const content = fs.readFileSync(path.join(outcomesDir, outcomeFile), 'utf-8');
|
|
@@ -155,7 +159,7 @@ export function deriveProjectState(projectPath) {
|
|
|
155
159
|
}
|
|
156
160
|
// First pass: Match plan files to outcomes and parse dependencies
|
|
157
161
|
for (const planFile of planFiles) {
|
|
158
|
-
const match = planFile.match(
|
|
162
|
+
const match = planFile.match(new RegExp(`^(${TASK_ID_PATTERN})-(.+)\\.md$`));
|
|
159
163
|
if (match && match[1]) {
|
|
160
164
|
const taskId = match[1];
|
|
161
165
|
const status = outcomeStatuses.get(taskId) ?? 'pending';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"state-derivation.js","sourceRoot":"","sources":["../../src/core/state-derivation.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,SAAS,CAAC;AAC9B,OAAO,KAAK,IAAI,MAAM,WAAW,CAAC;AAClC,OAAO,EAAE,WAAW,EAAE,cAAc,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;
|
|
1
|
+
{"version":3,"file":"state-derivation.js","sourceRoot":"","sources":["../../src/core/state-derivation.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,SAAS,CAAC;AAC9B,OAAO,KAAK,IAAI,MAAM,WAAW,CAAC;AAClC,OAAO,EAAE,WAAW,EAAE,cAAc,EAAE,YAAY,EAAE,YAAY,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAqC7G;;;GAGG;AACH,MAAM,UAAU,gBAAgB,CAAC,MAAc;IAC7C,IAAI,CAAC,EAAE,CAAC,UAAU,CAAC,MAAM,CAAC,EAAE,CAAC;QAC3B,OAAO,EAAE,CAAC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B,OAAO,KAAK,CAAC;IACf,CAAC;IAED,KAAK,MAAM,IAAI,IAAI,KAAK,CAAC,KAAK,EAAE,CAAC;QAC/B,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC,EAAE,CAAC;YACxB,SAAS;QACX,CAAC;QACD,KAAK,CAAC,KAAK,EAAE,CAAC;QACd,QAAQ,IAAI,CAAC,MAAM,EAAE,CAAC;YACpB,KAAK,SAAS;gBACZ,KAAK,CAAC,OAAO,EAAE,CAAC;gBAChB,MAAM;YACR,KAAK,WAAW;gBACd,KAAK,CAAC,SAAS,EAAE,CAAC;gBAClB,MAAM;YACR,KAAK,QAAQ;gBACX,KAAK,CAAC,MAAM,EAAE,CAAC;gBACf,MAAM;YACR,KAAK,SAAS;gBACZ,KAAK,CAAC,OAAO,EAAE,CAAC;gBAChB,MAAM;QACV,CAAC;IACH,CAAC;IAED,OAAO,KAAK,CAAC;AACf,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,iBAAiB,CAAC,KAA0B;IAC1D,OAAO,KAAK,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,MAAM,KAAK,WAAW,CAAC,CAAC;AAC5D,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,gBAAgB,CAAC,KAA0B;IACzD,OAAO,KAAK,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,MAAM,KAAK,QAAQ,CAAC,CAAC;AACxD,CAAC"}
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
export interface WorktreeCreateResult {
|
|
2
|
+
success: boolean;
|
|
3
|
+
worktreePath: string;
|
|
4
|
+
branch: string;
|
|
5
|
+
error?: string;
|
|
6
|
+
}
|
|
7
|
+
export interface WorktreeMergeResult {
|
|
8
|
+
success: boolean;
|
|
9
|
+
merged: boolean;
|
|
10
|
+
fastForward: boolean;
|
|
11
|
+
error?: string;
|
|
12
|
+
}
|
|
13
|
+
export interface WorktreeValidation {
|
|
14
|
+
exists: boolean;
|
|
15
|
+
isValidWorktree: boolean;
|
|
16
|
+
hasProjectFolder: boolean;
|
|
17
|
+
hasPlans: boolean;
|
|
18
|
+
projectPath: string | null;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Get the git toplevel directory (repo root).
|
|
22
|
+
* Returns null if not in a git repo.
|
|
23
|
+
*/
|
|
24
|
+
export declare function getRepoRoot(): string | null;
|
|
25
|
+
/**
|
|
26
|
+
* Get the basename of the repo root directory.
|
|
27
|
+
* E.g., "/Users/me/projects/myapp" -> "myapp"
|
|
28
|
+
* Returns null if not in a git repo.
|
|
29
|
+
*/
|
|
30
|
+
export declare function getRepoBasename(): string | null;
|
|
31
|
+
/**
|
|
32
|
+
* Get the current branch name.
|
|
33
|
+
* Returns null if not in a git repo or in detached HEAD state.
|
|
34
|
+
*/
|
|
35
|
+
export declare function getCurrentBranch(): string | null;
|
|
36
|
+
/**
|
|
37
|
+
* Compute the worktree path for a project.
|
|
38
|
+
* Returns `~/.raf/worktrees/<repo-basename>/<project-id>`.
|
|
39
|
+
*
|
|
40
|
+
* @param repoBasename - The basename of the repo root directory
|
|
41
|
+
* @param projectId - The full project folder name (e.g., "020-worktree-weaver")
|
|
42
|
+
*/
|
|
43
|
+
export declare function computeWorktreePath(repoBasename: string, projectId: string): string;
|
|
44
|
+
/**
|
|
45
|
+
* Compute the worktree base directory for a repo.
|
|
46
|
+
* Returns `~/.raf/worktrees/<repo-basename>/`.
|
|
47
|
+
*
|
|
48
|
+
* @param repoBasename - The basename of the repo root directory
|
|
49
|
+
*/
|
|
50
|
+
export declare function computeWorktreeBaseDir(repoBasename: string): string;
|
|
51
|
+
/**
|
|
52
|
+
* Get the project path inside a worktree.
|
|
53
|
+
* The project folder is at the same relative path from repo root as in the main repo.
|
|
54
|
+
*
|
|
55
|
+
* @param worktreePath - The worktree root directory
|
|
56
|
+
* @param projectRelativePath - The relative path from repo root to the project folder (e.g., "RAF/020-worktree-weaver")
|
|
57
|
+
*/
|
|
58
|
+
export declare function getWorktreeProjectPath(worktreePath: string, projectRelativePath: string): string;
|
|
59
|
+
/**
|
|
60
|
+
* Create a git worktree at the computed path with a new branch.
|
|
61
|
+
*
|
|
62
|
+
* @param repoBasename - The basename of the repo root directory
|
|
63
|
+
* @param projectId - The full project folder name (used as both directory name and branch name)
|
|
64
|
+
*/
|
|
65
|
+
export declare function createWorktree(repoBasename: string, projectId: string): WorktreeCreateResult;
|
|
66
|
+
/**
|
|
67
|
+
* Validate that a worktree exists, is a valid git worktree, and contains the expected project content.
|
|
68
|
+
*
|
|
69
|
+
* @param worktreePath - The worktree root directory
|
|
70
|
+
* @param projectRelativePath - The relative path from repo root to the project folder
|
|
71
|
+
*/
|
|
72
|
+
export declare function validateWorktree(worktreePath: string, projectRelativePath: string): WorktreeValidation;
|
|
73
|
+
/**
|
|
74
|
+
* Merge a worktree branch into the current branch.
|
|
75
|
+
* Attempts fast-forward first; falls back to merge commit.
|
|
76
|
+
* On conflicts, aborts merge and returns failure.
|
|
77
|
+
*
|
|
78
|
+
* MUST be called from the original repo (not the worktree).
|
|
79
|
+
*
|
|
80
|
+
* @param branch - The branch name to merge (typically the project folder name)
|
|
81
|
+
* @param originalBranch - The branch to merge into (the branch that was active when worktree was created)
|
|
82
|
+
*/
|
|
83
|
+
export declare function mergeWorktreeBranch(branch: string, originalBranch: string): WorktreeMergeResult;
|
|
84
|
+
/**
|
|
85
|
+
* Remove a single worktree.
|
|
86
|
+
* Used for failed-plan cleanup and post-completion cleanup.
|
|
87
|
+
* The git branch is preserved — only the worktree directory is removed.
|
|
88
|
+
*
|
|
89
|
+
* @param worktreePath - The worktree directory to remove
|
|
90
|
+
* @returns true if removal succeeded, false otherwise
|
|
91
|
+
*/
|
|
92
|
+
export declare function removeWorktree(worktreePath: string): {
|
|
93
|
+
success: boolean;
|
|
94
|
+
error?: string;
|
|
95
|
+
};
|
|
96
|
+
/**
|
|
97
|
+
* Check if a local branch exists.
|
|
98
|
+
*
|
|
99
|
+
* @param branchName - The branch name to check
|
|
100
|
+
* @returns true if the branch exists locally
|
|
101
|
+
*/
|
|
102
|
+
export declare function branchExists(branchName: string): boolean;
|
|
103
|
+
/**
|
|
104
|
+
* Create a git worktree at the computed path from an existing branch.
|
|
105
|
+
* Unlike `createWorktree()`, this does NOT create a new branch — it attaches
|
|
106
|
+
* to a branch that already exists locally.
|
|
107
|
+
*
|
|
108
|
+
* @param repoBasename - The basename of the repo root directory
|
|
109
|
+
* @param projectId - The full project folder name (used as both directory name and branch name)
|
|
110
|
+
*/
|
|
111
|
+
export declare function createWorktreeFromBranch(repoBasename: string, projectId: string): WorktreeCreateResult;
|
|
112
|
+
/**
|
|
113
|
+
* List all worktree project directories for the current repo.
|
|
114
|
+
* Scans `~/.raf/worktrees/<repo-basename>/` and returns the list of project folder names.
|
|
115
|
+
*
|
|
116
|
+
* @param repoBasename - The basename of the repo root directory
|
|
117
|
+
* @returns Sorted array of project folder names (e.g., ['020-worktree-weaver', '021-another-feature'])
|
|
118
|
+
*/
|
|
119
|
+
export declare function listWorktreeProjects(repoBasename: string): string[];
|
|
120
|
+
//# sourceMappingURL=worktree.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"worktree.d.ts","sourceRoot":"","sources":["../../src/core/worktree.ts"],"names":[],"mappings":"AAMA,MAAM,WAAW,oBAAoB;IACnC,OAAO,EAAE,OAAO,CAAC;IACjB,YAAY,EAAE,MAAM,CAAC;IACrB,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,mBAAmB;IAClC,OAAO,EAAE,OAAO,CAAC;IACjB,MAAM,EAAE,OAAO,CAAC;IAChB,WAAW,EAAE,OAAO,CAAC;IACrB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,kBAAkB;IACjC,MAAM,EAAE,OA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AwB,CAAC,YAAY,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,oBAAoB,CA0CtG;AAED;;;;;;GAMG;AACH,wBAAgB,oBAAoB,CAAC,YAAY,EAAE,MAAM,GAAG,MAAM,EAAE,CAiBnE"}
|
|
@@ -0,0 +1,322 @@
|
|
|
1
|
+
import { execSync } from 'node:child_process';
|
|
2
|
+
import * as fs from 'node:fs';
|
|
3
|
+
import * as os from 'node:os';
|
|
4
|
+
import * as path from 'node:path';
|
|
5
|
+
import { logger } from '../utils/logger.js';
|
|
6
|
+
/**
|
|
7
|
+
* Get the git toplevel directory (repo root).
|
|
8
|
+
* Returns null if not in a git repo.
|
|
9
|
+
*/
|
|
10
|
+
export function getRepoRoot() {
|
|
11
|
+
try {
|
|
12
|
+
return execSync('git rev-parse --show-toplevel', { encoding: 'utf-8', stdio: 'pipe' }).trim() || null;
|
|
13
|
+
}
|
|
14
|
+
catch {
|
|
15
|
+
return null;
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Get the basename of the repo root directory.
|
|
20
|
+
* E.g., "/Users/me/projects/myapp" -> "myapp"
|
|
21
|
+
* Returns null if not in a git repo.
|
|
22
|
+
*/
|
|
23
|
+
export function getRepoBasename() {
|
|
24
|
+
const root = getRepoRoot();
|
|
25
|
+
if (!root) {
|
|
26
|
+
return null;
|
|
27
|
+
}
|
|
28
|
+
return path.basename(root);
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Get the current branch name.
|
|
32
|
+
* Returns null if not in a git repo or in detached HEAD state.
|
|
33
|
+
*/
|
|
34
|
+
export function getCurrentBranch() {
|
|
35
|
+
try {
|
|
36
|
+
const branch = execSync('git branch --show-current', { encoding: 'utf-8', stdio: 'pipe' }).trim();
|
|
37
|
+
return branch || null;
|
|
38
|
+
}
|
|
39
|
+
catch {
|
|
40
|
+
return null;
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* Compute the worktree path for a project.
|
|
45
|
+
* Returns `~/.raf/worktrees/<repo-basename>/<project-id>`.
|
|
46
|
+
*
|
|
47
|
+
* @param repoBasename - The basename of the repo root directory
|
|
48
|
+
* @param projectId - The full project folder name (e.g., "020-worktree-weaver")
|
|
49
|
+
*/
|
|
50
|
+
export function computeWorktreePath(repoBasename, projectId) {
|
|
51
|
+
return path.join(os.homedir(), '.raf', 'worktrees', repoBasename, projectId);
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* Compute the worktree base directory for a repo.
|
|
55
|
+
* Returns `~/.raf/worktrees/<repo-basename>/`.
|
|
56
|
+
*
|
|
57
|
+
* @param repoBasename - The basename of the repo root directory
|
|
58
|
+
*/
|
|
59
|
+
export function computeWorktreeBaseDir(repoBasename) {
|
|
60
|
+
return path.join(os.homedir(), '.raf', 'worktrees', repoBasename);
|
|
61
|
+
}
|
|
62
|
+
/**
|
|
63
|
+
* Get the project path inside a worktree.
|
|
64
|
+
* The project folder is at the same relative path from repo root as in the main repo.
|
|
65
|
+
*
|
|
66
|
+
* @param worktreePath - The worktree root directory
|
|
67
|
+
* @param projectRelativePath - The relative path from repo root to the project folder (e.g., "RAF/020-worktree-weaver")
|
|
68
|
+
*/
|
|
69
|
+
export function getWorktreeProjectPath(worktreePath, projectRelativePath) {
|
|
70
|
+
return path.join(worktreePath, projectRelativePath);
|
|
71
|
+
}
|
|
72
|
+
/**
|
|
73
|
+
* Create a git worktree at the computed path with a new branch.
|
|
74
|
+
*
|
|
75
|
+
* @param repoBasename - The basename of the repo root directory
|
|
76
|
+
* @param projectId - The full project folder name (used as both directory name and branch name)
|
|
77
|
+
*/
|
|
78
|
+
export function createWorktree(repoBasename, projectId) {
|
|
79
|
+
const worktreePath = computeWorktreePath(repoBasename, projectId);
|
|
80
|
+
const branch = projectId;
|
|
81
|
+
// Ensure parent directory exists
|
|
82
|
+
const baseDir = computeWorktreeBaseDir(repoBasename);
|
|
83
|
+
try {
|
|
84
|
+
fs.mkdirSync(baseDir, { recursive: true });
|
|
85
|
+
}
|
|
86
|
+
catch (error) {
|
|
87
|
+
return {
|
|
88
|
+
success: false,
|
|
89
|
+
worktreePath,
|
|
90
|
+
branch,
|
|
91
|
+
error: `Failed to create parent directory ${baseDir}: ${error}`,
|
|
92
|
+
};
|
|
93
|
+
}
|
|
94
|
+
try {
|
|
95
|
+
execSync(`git worktree add "${worktreePath}" -b "${branch}"`, {
|
|
96
|
+
encoding: 'utf-8',
|
|
97
|
+
stdio: 'pipe',
|
|
98
|
+
});
|
|
99
|
+
return { success: true, worktreePath, branch };
|
|
100
|
+
}
|
|
101
|
+
catch (error) {
|
|
102
|
+
const msg = error instanceof Error ? error.message : String(error);
|
|
103
|
+
return {
|
|
104
|
+
success: false,
|
|
105
|
+
worktreePath,
|
|
106
|
+
branch,
|
|
107
|
+
error: `Failed to create worktree: ${msg}`,
|
|
108
|
+
};
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
/**
|
|
112
|
+
* Validate that a worktree exists, is a valid git worktree, and contains the expected project content.
|
|
113
|
+
*
|
|
114
|
+
* @param worktreePath - The worktree root directory
|
|
115
|
+
* @param projectRelativePath - The relative path from repo root to the project folder
|
|
116
|
+
*/
|
|
117
|
+
export function validateWorktree(worktreePath, projectRelativePath) {
|
|
118
|
+
const result = {
|
|
119
|
+
exists: false,
|
|
120
|
+
isValidWorktree: false,
|
|
121
|
+
hasProjectFolder: false,
|
|
122
|
+
hasPlans: false,
|
|
123
|
+
projectPath: null,
|
|
124
|
+
};
|
|
125
|
+
// Check directory exists
|
|
126
|
+
if (!fs.existsSync(worktreePath)) {
|
|
127
|
+
return result;
|
|
128
|
+
}
|
|
129
|
+
result.exists = true;
|
|
130
|
+
// Check it appears in git worktree list
|
|
131
|
+
try {
|
|
132
|
+
const listOutput = execSync('git worktree list --porcelain', { encoding: 'utf-8', stdio: 'pipe' });
|
|
133
|
+
const normalizedWorktreePath = path.resolve(worktreePath);
|
|
134
|
+
const isListed = listOutput.split('\n').some(line => {
|
|
135
|
+
if (line.startsWith('worktree ')) {
|
|
136
|
+
const listedPath = path.resolve(line.slice('worktree '.length).trim());
|
|
137
|
+
return listedPath === normalizedWorktreePath;
|
|
138
|
+
}
|
|
139
|
+
return false;
|
|
140
|
+
});
|
|
141
|
+
result.isValidWorktree = isListed;
|
|
142
|
+
}
|
|
143
|
+
catch {
|
|
144
|
+
return result;
|
|
145
|
+
}
|
|
146
|
+
// Check project folder exists in worktree
|
|
147
|
+
const projectPath = getWorktreeProjectPath(worktreePath, projectRelativePath);
|
|
148
|
+
if (fs.existsSync(projectPath)) {
|
|
149
|
+
result.hasProjectFolder = true;
|
|
150
|
+
result.projectPath = projectPath;
|
|
151
|
+
// Check for plans directory
|
|
152
|
+
const plansDir = path.join(projectPath, 'plans');
|
|
153
|
+
if (fs.existsSync(plansDir)) {
|
|
154
|
+
result.hasPlans = true;
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
return result;
|
|
158
|
+
}
|
|
159
|
+
/**
|
|
160
|
+
* Merge a worktree branch into the current branch.
|
|
161
|
+
* Attempts fast-forward first; falls back to merge commit.
|
|
162
|
+
* On conflicts, aborts merge and returns failure.
|
|
163
|
+
*
|
|
164
|
+
* MUST be called from the original repo (not the worktree).
|
|
165
|
+
*
|
|
166
|
+
* @param branch - The branch name to merge (typically the project folder name)
|
|
167
|
+
* @param originalBranch - The branch to merge into (the branch that was active when worktree was created)
|
|
168
|
+
*/
|
|
169
|
+
export function mergeWorktreeBranch(branch, originalBranch) {
|
|
170
|
+
// Switch to the original branch
|
|
171
|
+
try {
|
|
172
|
+
execSync(`git checkout "${originalBranch}"`, { encoding: 'utf-8', stdio: 'pipe' });
|
|
173
|
+
}
|
|
174
|
+
catch (error) {
|
|
175
|
+
const msg = error instanceof Error ? error.message : String(error);
|
|
176
|
+
return {
|
|
177
|
+
success: false,
|
|
178
|
+
merged: false,
|
|
179
|
+
fastForward: false,
|
|
180
|
+
error: `Failed to checkout ${originalBranch}: ${msg}`,
|
|
181
|
+
};
|
|
182
|
+
}
|
|
183
|
+
// Try fast-forward merge first
|
|
184
|
+
try {
|
|
185
|
+
execSync(`git merge --ff-only "${branch}"`, { encoding: 'utf-8', stdio: 'pipe' });
|
|
186
|
+
return { success: true, merged: true, fastForward: true };
|
|
187
|
+
}
|
|
188
|
+
catch {
|
|
189
|
+
// Fast-forward not possible, try regular merge
|
|
190
|
+
}
|
|
191
|
+
// Try regular merge
|
|
192
|
+
try {
|
|
193
|
+
execSync(`git merge "${branch}"`, { encoding: 'utf-8', stdio: 'pipe' });
|
|
194
|
+
return { success: true, merged: true, fastForward: false };
|
|
195
|
+
}
|
|
196
|
+
catch {
|
|
197
|
+
// Merge conflicts - abort
|
|
198
|
+
try {
|
|
199
|
+
execSync('git merge --abort', { encoding: 'utf-8', stdio: 'pipe' });
|
|
200
|
+
}
|
|
201
|
+
catch {
|
|
202
|
+
logger.warn('Failed to abort merge - repo may be in an inconsistent state');
|
|
203
|
+
}
|
|
204
|
+
return {
|
|
205
|
+
success: false,
|
|
206
|
+
merged: false,
|
|
207
|
+
fastForward: false,
|
|
208
|
+
error: `Merge conflicts detected. Please merge branch "${branch}" into "${originalBranch}" manually.`,
|
|
209
|
+
};
|
|
210
|
+
}
|
|
211
|
+
}
|
|
212
|
+
/**
|
|
213
|
+
* Remove a single worktree.
|
|
214
|
+
* Used for failed-plan cleanup and post-completion cleanup.
|
|
215
|
+
* The git branch is preserved — only the worktree directory is removed.
|
|
216
|
+
*
|
|
217
|
+
* @param worktreePath - The worktree directory to remove
|
|
218
|
+
* @returns true if removal succeeded, false otherwise
|
|
219
|
+
*/
|
|
220
|
+
export function removeWorktree(worktreePath) {
|
|
221
|
+
try {
|
|
222
|
+
execSync(`git worktree remove "${worktreePath}"`, { encoding: 'utf-8', stdio: 'pipe' });
|
|
223
|
+
return { success: true };
|
|
224
|
+
}
|
|
225
|
+
catch (error) {
|
|
226
|
+
const msg = error instanceof Error ? error.message : String(error);
|
|
227
|
+
return {
|
|
228
|
+
success: false,
|
|
229
|
+
error: `Failed to remove worktree at ${worktreePath}: ${msg}`,
|
|
230
|
+
};
|
|
231
|
+
}
|
|
232
|
+
}
|
|
233
|
+
/**
|
|
234
|
+
* Check if a local branch exists.
|
|
235
|
+
*
|
|
236
|
+
* @param branchName - The branch name to check
|
|
237
|
+
* @returns true if the branch exists locally
|
|
238
|
+
*/
|
|
239
|
+
export function branchExists(branchName) {
|
|
240
|
+
try {
|
|
241
|
+
const output = execSync(`git branch --list "${branchName}"`, { encoding: 'utf-8', stdio: 'pipe' }).trim();
|
|
242
|
+
return output.length > 0;
|
|
243
|
+
}
|
|
244
|
+
catch {
|
|
245
|
+
return false;
|
|
246
|
+
}
|
|
247
|
+
}
|
|
248
|
+
/**
|
|
249
|
+
* Create a git worktree at the computed path from an existing branch.
|
|
250
|
+
* Unlike `createWorktree()`, this does NOT create a new branch — it attaches
|
|
251
|
+
* to a branch that already exists locally.
|
|
252
|
+
*
|
|
253
|
+
* @param repoBasename - The basename of the repo root directory
|
|
254
|
+
* @param projectId - The full project folder name (used as both directory name and branch name)
|
|
255
|
+
*/
|
|
256
|
+
export function createWorktreeFromBranch(repoBasename, projectId) {
|
|
257
|
+
const worktreePath = computeWorktreePath(repoBasename, projectId);
|
|
258
|
+
const branch = projectId;
|
|
259
|
+
// Check branch exists
|
|
260
|
+
if (!branchExists(branch)) {
|
|
261
|
+
return {
|
|
262
|
+
success: false,
|
|
263
|
+
worktreePath,
|
|
264
|
+
branch,
|
|
265
|
+
error: `Branch "${branch}" does not exist locally`,
|
|
266
|
+
};
|
|
267
|
+
}
|
|
268
|
+
// Ensure parent directory exists
|
|
269
|
+
const baseDir = computeWorktreeBaseDir(repoBasename);
|
|
270
|
+
try {
|
|
271
|
+
fs.mkdirSync(baseDir, { recursive: true });
|
|
272
|
+
}
|
|
273
|
+
catch (error) {
|
|
274
|
+
return {
|
|
275
|
+
success: false,
|
|
276
|
+
worktreePath,
|
|
277
|
+
branch,
|
|
278
|
+
error: `Failed to create parent directory ${baseDir}: ${error}`,
|
|
279
|
+
};
|
|
280
|
+
}
|
|
281
|
+
try {
|
|
282
|
+
execSync(`git worktree add "${worktreePath}" "${branch}"`, {
|
|
283
|
+
encoding: 'utf-8',
|
|
284
|
+
stdio: 'pipe',
|
|
285
|
+
});
|
|
286
|
+
return { success: true, worktreePath, branch };
|
|
287
|
+
}
|
|
288
|
+
catch (error) {
|
|
289
|
+
const msg = error instanceof Error ? error.message : String(error);
|
|
290
|
+
return {
|
|
291
|
+
success: false,
|
|
292
|
+
worktreePath,
|
|
293
|
+
branch,
|
|
294
|
+
error: `Failed to create worktree: ${msg}`,
|
|
295
|
+
};
|
|
296
|
+
}
|
|
297
|
+
}
|
|
298
|
+
/**
|
|
299
|
+
* List all worktree project directories for the current repo.
|
|
300
|
+
* Scans `~/.raf/worktrees/<repo-basename>/` and returns the list of project folder names.
|
|
301
|
+
*
|
|
302
|
+
* @param repoBasename - The basename of the repo root directory
|
|
303
|
+
* @returns Sorted array of project folder names (e.g., ['020-worktree-weaver', '021-another-feature'])
|
|
304
|
+
*/
|
|
305
|
+
export function listWorktreeProjects(repoBasename) {
|
|
306
|
+
const baseDir = computeWorktreeBaseDir(repoBasename);
|
|
307
|
+
if (!fs.existsSync(baseDir)) {
|
|
308
|
+
return [];
|
|
309
|
+
}
|
|
310
|
+
try {
|
|
311
|
+
const entries = fs.readdirSync(baseDir, { withFileTypes: true });
|
|
312
|
+
const projects = entries
|
|
313
|
+
.filter(entry => entry.isDirectory())
|
|
314
|
+
.map(entry => entry.name)
|
|
315
|
+
.sort();
|
|
316
|
+
return projects;
|
|
317
|
+
}
|
|
318
|
+
catch {
|
|
319
|
+
return [];
|
|
320
|
+
}
|
|
321
|
+
}
|
|
322
|
+
//# sourceMappingURL=worktree.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"worktree.js","sourceRoot":"","sources":["../../src/core/worktree.ts"],"names":[],"mappings":"AAAA,OAAO,E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AAI,EAAE,YAAY,EAAE,MAAM,EAAE,CAAC;IACjD,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,MAAM,GAAG,GAAG,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;QACnE,OAAO;YACL,OAAO,EAAE,KAAK;YACd,YAAY;YACZ,MAAM;YACN,KAAK,EAAE,8BAA8B,GAAG,EAAE;SAC3C,CAAC;IACJ,CAAC;AACH,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,oBAAoB,CAAC,YAAoB;IACvD,MAAM,OAAO,GAAG,sBAAsB,CAAC,YAAY,CAAC,CAAC;IAErD,IAAI,CAAC,EAAE,CAAC,UAAU,CAAC,OAAO,CAAC,EAAE,CAAC;QAC5B,OAAO,EAAE,CAAC;IACZ,CAAC;IAED,IAAI,CAAC;QACH,MAAM,OAAO,GAAG,EAAE,CAAC,WAAW,CAAC,OAAO,EAAE,EAAE,aAAa,EAAE,IAAI,EAAE,CAAC,CAAC;QACjE,MAAM,QAAQ,GAAG,OAAO;aACrB,MAAM,CAAC,KAAK,CAAC,EAAE,CAAC,KAAK,CAAC,WAAW,EAAE,CAAC;aACpC,GAAG,CAAC,KAAK,CAAC,EAAE,CAAC,KAAK,CAAC,IAAI,CAAC;aACxB,IAAI,EAAE,CAAC;QACV,OAAO,QAAQ,CAAC;IAClB,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,EAAE,CAAC;IACZ,CAAC;AACH,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -3,6 +3,7 @@ import { Command } from 'commander';
|
|
|
3
3
|
import { createPlanCommand } from './commands/plan.js';
|
|
4
4
|
import { createDoCommand } from './commands/do.js';
|
|
5
5
|
import { createStatusCommand } from './commands/status.js';
|
|
6
|
+
import { createMigrateCommand } from './commands/migrate.js';
|
|
6
7
|
import { getVersion } from './utils/version.js';
|
|
7
8
|
const program = new Command();
|
|
8
9
|
program
|
|
@@ -12,5 +13,6 @@ program
|
|
|
12
13
|
program.addCommand(createPlanCommand());
|
|
13
14
|
program.addCommand(createDoCommand());
|
|
14
15
|
program.addCommand(createStatusCommand());
|
|
16
|
+
program.addCommand(createMigrateCommand());
|
|
15
17
|
program.parse();
|
|
16
18
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAEA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AACvD,OAAO,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AACnD,OAAO,EAAE,mBAAmB,EAAE,MAAM,sBAAsB,CAAC;AAC3D,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAEhD,MAAM,OAAO,GAAG,IAAI,OAAO,EAAE,CAAC;AAE9B,OAAO;KACJ,IAAI,CAAC,KAAK,CAAC;KACX,WAAW,CAAC,4DAA4D,CAAC;KACzE,OAAO,CAAC,UAAU,EAAE,CAAC,CAAC;AAEzB,OAAO,CAAC,UAAU,CAAC,iBAAiB,EAAE,CAAC,CAAC;AACxC,OAAO,CAAC,UAAU,CAAC,eAAe,EAAE,CAAC,CAAC;AACtC,OAAO,CAAC,UAAU,CAAC,mBAAmB,EAAE,CAAC,CAAC;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAEA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AACvD,OAAO,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AACnD,OAAO,EAAE,mBAAmB,EAAE,MAAM,sBAAsB,CAAC;AAC3D,OAAO,EAAE,oBAAoB,EAAE,MAAM,uBAAuB,CAAC;AAC7D,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAEhD,MAAM,OAAO,GAAG,IAAI,OAAO,EAAE,CAAC;AAE9B,OAAO;KACJ,IAAI,CAAC,KAAK,CAAC;KACX,WAAW,CAAC,4DAA4D,CAAC;KACzE,OAAO,CAAC,UAAU,EAAE,CAAC,CAAC;AAEzB,OAAO,CAAC,UAAU,CAAC,iBAAiB,EAAE,CAAC,CAAC;AACxC,OAAO,CAAC,UAAU,CAAC,eAAe,EAAE,CAAC,CAAC;AACtC,OAAO,CAAC,UAAU,CAAC,mBAAmB,EAAE,CAAC,CAAC;AAC1C,OAAO,CAAC,UAAU,CAAC,oBAAoB,EAAE,CAAC,CAAC;AAE3C,OAAO,CAAC,KAAK,EAAE,CAAC"}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Renders stream-json events from Claude CLI into human-readable verbose output.
|
|
3
|
+
*
|
|
4
|
+
* Event types from `claude -p --output-format stream-json --verbose`:
|
|
5
|
+
* - system (init): Session initialization info
|
|
6
|
+
* - assistant: Claude's response with text or tool_use content blocks
|
|
7
|
+
* - user: Tool results (tool_result content blocks)
|
|
8
|
+
* - result: Final result with success/failure status
|
|
9
|
+
*/
|
|
10
|
+
export interface StreamEvent {
|
|
11
|
+
type: string;
|
|
12
|
+
subtype?: string;
|
|
13
|
+
message?: {
|
|
14
|
+
content?: ContentBlock[];
|
|
15
|
+
};
|
|
16
|
+
result?: string;
|
|
17
|
+
tool_use_result?: {
|
|
18
|
+
type?: string;
|
|
19
|
+
file?: {
|
|
20
|
+
filePath?: string;
|
|
21
|
+
};
|
|
22
|
+
};
|
|
23
|
+
}
|
|
24
|
+
interface ContentBlock {
|
|
25
|
+
type: string;
|
|
26
|
+
text?: string;
|
|
27
|
+
name?: string;
|
|
28
|
+
input?: Record<string, unknown>;
|
|
29
|
+
}
|
|
30
|
+
export interface RenderResult {
|
|
31
|
+
/** Text to display to stdout (may be empty if no display needed) */
|
|
32
|
+
display: string;
|
|
33
|
+
/** Text content to accumulate for output parsing (completion markers, etc.) */
|
|
34
|
+
textContent: string;
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* Parse and render a single NDJSON line from stream-json output.
|
|
38
|
+
* Returns display text for stdout and text content for output accumulation.
|
|
39
|
+
*/
|
|
40
|
+
export declare function renderStreamEvent(line: string): RenderResult;
|
|
41
|
+
export {};
|
|
42
|
+
//# sourceMappingURL=stream-renderer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"stream-renderer.d.ts","sourceRoot":"","sources":["../../src/parsers/stream-renderer.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,MAAM,WAAW,WAAW;IAC1B,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE;QACR,OAAO,CAAC,EAAE,YAAY,EAAE,CAAC;KAC1B,CAAC;IACF,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,eAAe,CAAC,EAAE;QAChB,IAAI,CAAC,EAAE,MAAM,CAAC;QACd,IAAI,CAAC,EAAE;YACL,QAAQ,CAAC,EAAE,MAAM,CAAC;SACnB,CAAC;KACH,CAAC;CACH;AAED,UAAU,YAAY;IACpB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACjC;AAuCD,MAAM,WAAW,YAAY;IAC3B,oEAAoE;IACpE,OAAO,EAAE,MAAM,CAAC;IAChB,+EAA+E;IAC/E,WAAW,EAAE,MAAM,CAAC;CACrB;AAED;;;GAGG;AACH,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,MAAM,GAAG,YAAY,CA8B5D"}
|