@ginkoai/cli 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +230 -0
- package/dist/adapters/ai-adapter.d.ts +25 -0
- package/dist/adapters/ai-adapter.d.ts.map +1 -0
- package/dist/adapters/ai-adapter.js +21 -0
- package/dist/adapters/ai-adapter.js.map +1 -0
- package/dist/adapters/ai-completion.d.ts +35 -0
- package/dist/adapters/ai-completion.d.ts.map +1 -0
- package/dist/adapters/ai-completion.js +118 -0
- package/dist/adapters/ai-completion.js.map +1 -0
- package/dist/adapters/base.d.ts +64 -0
- package/dist/adapters/base.d.ts.map +1 -0
- package/dist/adapters/base.js +48 -0
- package/dist/adapters/base.js.map +1 -0
- package/dist/adapters/claude-adapter.d.ts +18 -0
- package/dist/adapters/claude-adapter.d.ts.map +1 -0
- package/dist/adapters/claude-adapter.js +73 -0
- package/dist/adapters/claude-adapter.js.map +1 -0
- package/dist/adapters/claude.d.ts +20 -0
- package/dist/adapters/claude.d.ts.map +1 -0
- package/dist/adapters/claude.js +91 -0
- package/dist/adapters/claude.js.map +1 -0
- package/dist/adapters/copilot-adapter.d.ts +16 -0
- package/dist/adapters/copilot-adapter.d.ts.map +1 -0
- package/dist/adapters/copilot-adapter.js +288 -0
- package/dist/adapters/copilot-adapter.js.map +1 -0
- package/dist/adapters/cursor-adapter.d.ts +22 -0
- package/dist/adapters/cursor-adapter.d.ts.map +1 -0
- package/dist/adapters/cursor-adapter.js +108 -0
- package/dist/adapters/cursor-adapter.js.map +1 -0
- package/dist/adapters/detector.d.ts +29 -0
- package/dist/adapters/detector.d.ts.map +1 -0
- package/dist/adapters/detector.js +132 -0
- package/dist/adapters/detector.js.map +1 -0
- package/dist/adapters/generic-adapter.d.ts +18 -0
- package/dist/adapters/generic-adapter.d.ts.map +1 -0
- package/dist/adapters/generic-adapter.js +37 -0
- package/dist/adapters/generic-adapter.js.map +1 -0
- package/dist/adapters/gpt4.d.ts +20 -0
- package/dist/adapters/gpt4.d.ts.map +1 -0
- package/dist/adapters/gpt4.js +114 -0
- package/dist/adapters/gpt4.js.map +1 -0
- package/dist/adapters/grok-adapter.d.ts +18 -0
- package/dist/adapters/grok-adapter.d.ts.map +1 -0
- package/dist/adapters/grok-adapter.js +94 -0
- package/dist/adapters/grok-adapter.js.map +1 -0
- package/dist/adapters/index.d.ts +18 -0
- package/dist/adapters/index.d.ts.map +1 -0
- package/dist/adapters/index.js +71 -0
- package/dist/adapters/index.js.map +1 -0
- package/dist/adapters/openai-adapter.d.ts +18 -0
- package/dist/adapters/openai-adapter.d.ts.map +1 -0
- package/dist/adapters/openai-adapter.js +97 -0
- package/dist/adapters/openai-adapter.js.map +1 -0
- package/dist/adapters/universal.d.ts +20 -0
- package/dist/adapters/universal.d.ts.map +1 -0
- package/dist/adapters/universal.js +80 -0
- package/dist/adapters/universal.js.map +1 -0
- package/dist/analysis/deep-analyzer.d.ts +61 -0
- package/dist/analysis/deep-analyzer.d.ts.map +1 -0
- package/dist/analysis/deep-analyzer.js +349 -0
- package/dist/analysis/deep-analyzer.js.map +1 -0
- package/dist/analysis/project-analyzer.d.ts +25 -0
- package/dist/analysis/project-analyzer.d.ts.map +1 -0
- package/dist/analysis/project-analyzer.js +244 -0
- package/dist/analysis/project-analyzer.js.map +1 -0
- package/dist/commands/architecture/architecture-pipeline-enhanced.d.ts +82 -0
- package/dist/commands/architecture/architecture-pipeline-enhanced.d.ts.map +1 -0
- package/dist/commands/architecture/architecture-pipeline-enhanced.js +649 -0
- package/dist/commands/architecture/architecture-pipeline-enhanced.js.map +1 -0
- package/dist/commands/architecture/architecture-pipeline.d.ts +105 -0
- package/dist/commands/architecture/architecture-pipeline.d.ts.map +1 -0
- package/dist/commands/architecture/architecture-pipeline.js +510 -0
- package/dist/commands/architecture/architecture-pipeline.js.map +1 -0
- package/dist/commands/architecture/architecture-reflection.d.ts +67 -0
- package/dist/commands/architecture/architecture-reflection.d.ts.map +1 -0
- package/dist/commands/architecture/architecture-reflection.js +508 -0
- package/dist/commands/architecture/architecture-reflection.js.map +1 -0
- package/dist/commands/architecture/index.d.ts +21 -0
- package/dist/commands/architecture/index.d.ts.map +1 -0
- package/dist/commands/architecture/index.js +41 -0
- package/dist/commands/architecture/index.js.map +1 -0
- package/dist/commands/architecture.d.ts +20 -0
- package/dist/commands/architecture.d.ts.map +1 -0
- package/dist/commands/architecture.js +223 -0
- package/dist/commands/architecture.js.map +1 -0
- package/dist/commands/backlog/ai-enhanced.d.ts +83 -0
- package/dist/commands/backlog/ai-enhanced.d.ts.map +1 -0
- package/dist/commands/backlog/ai-enhanced.js +462 -0
- package/dist/commands/backlog/ai-enhanced.js.map +1 -0
- package/dist/commands/backlog/ai-prompt.d.ts +21 -0
- package/dist/commands/backlog/ai-prompt.d.ts.map +1 -0
- package/dist/commands/backlog/ai-prompt.js +373 -0
- package/dist/commands/backlog/ai-prompt.js.map +1 -0
- package/dist/commands/backlog/ai-template.d.ts +21 -0
- package/dist/commands/backlog/ai-template.d.ts.map +1 -0
- package/dist/commands/backlog/ai-template.js +374 -0
- package/dist/commands/backlog/ai-template.js.map +1 -0
- package/dist/commands/backlog/ai.d.ts +21 -0
- package/dist/commands/backlog/ai.d.ts.map +1 -0
- package/dist/commands/backlog/ai.js +76 -0
- package/dist/commands/backlog/ai.js.map +1 -0
- package/dist/commands/backlog/backlog-pipeline.d.ts +103 -0
- package/dist/commands/backlog/backlog-pipeline.d.ts.map +1 -0
- package/dist/commands/backlog/backlog-pipeline.js +538 -0
- package/dist/commands/backlog/backlog-pipeline.js.map +1 -0
- package/dist/commands/backlog/backlog-reflection.d.ts +48 -0
- package/dist/commands/backlog/backlog-reflection.d.ts.map +1 -0
- package/dist/commands/backlog/backlog-reflection.js +231 -0
- package/dist/commands/backlog/backlog-reflection.js.map +1 -0
- package/dist/commands/backlog/base.d.ts +95 -0
- package/dist/commands/backlog/base.d.ts.map +1 -0
- package/dist/commands/backlog/base.js +291 -0
- package/dist/commands/backlog/base.js.map +1 -0
- package/dist/commands/backlog/complete.d.ts +20 -0
- package/dist/commands/backlog/complete.d.ts.map +1 -0
- package/dist/commands/backlog/complete.js +83 -0
- package/dist/commands/backlog/complete.js.map +1 -0
- package/dist/commands/backlog/context-gatherer.d.ts +76 -0
- package/dist/commands/backlog/context-gatherer.d.ts.map +1 -0
- package/dist/commands/backlog/context-gatherer.js +216 -0
- package/dist/commands/backlog/context-gatherer.js.map +1 -0
- package/dist/commands/backlog/create.d.ts +25 -0
- package/dist/commands/backlog/create.d.ts.map +1 -0
- package/dist/commands/backlog/create.js +131 -0
- package/dist/commands/backlog/create.js.map +1 -0
- package/dist/commands/backlog/index.d.ts +17 -0
- package/dist/commands/backlog/index.d.ts.map +1 -0
- package/dist/commands/backlog/index.js +177 -0
- package/dist/commands/backlog/index.js.map +1 -0
- package/dist/commands/backlog/list.d.ts +25 -0
- package/dist/commands/backlog/list.d.ts.map +1 -0
- package/dist/commands/backlog/list.js +136 -0
- package/dist/commands/backlog/list.js.map +1 -0
- package/dist/commands/backlog/quick-query.d.ts +16 -0
- package/dist/commands/backlog/quick-query.d.ts.map +1 -0
- package/dist/commands/backlog/quick-query.js +126 -0
- package/dist/commands/backlog/quick-query.js.map +1 -0
- package/dist/commands/backlog/show.d.ts +20 -0
- package/dist/commands/backlog/show.d.ts.map +1 -0
- package/dist/commands/backlog/show.js +95 -0
- package/dist/commands/backlog/show.js.map +1 -0
- package/dist/commands/backlog/update.d.ts +25 -0
- package/dist/commands/backlog/update.d.ts.map +1 -0
- package/dist/commands/backlog/update.js +113 -0
- package/dist/commands/backlog/update.js.map +1 -0
- package/dist/commands/bug/bug-context-gatherer.d.ts +58 -0
- package/dist/commands/bug/bug-context-gatherer.d.ts.map +1 -0
- package/dist/commands/bug/bug-context-gatherer.js +228 -0
- package/dist/commands/bug/bug-context-gatherer.js.map +1 -0
- package/dist/commands/bug/bug-reflection.d.ts +70 -0
- package/dist/commands/bug/bug-reflection.d.ts.map +1 -0
- package/dist/commands/bug/bug-reflection.js +343 -0
- package/dist/commands/bug/bug-reflection.js.map +1 -0
- package/dist/commands/capture/capture-reflection.d.ts +139 -0
- package/dist/commands/capture/capture-reflection.d.ts.map +1 -0
- package/dist/commands/capture/capture-reflection.js +583 -0
- package/dist/commands/capture/capture-reflection.js.map +1 -0
- package/dist/commands/capture.d.ts +22 -0
- package/dist/commands/capture.d.ts.map +1 -0
- package/dist/commands/capture.js +301 -0
- package/dist/commands/capture.js.map +1 -0
- package/dist/commands/changelog/changelog-reflection.d.ts +65 -0
- package/dist/commands/changelog/changelog-reflection.d.ts.map +1 -0
- package/dist/commands/changelog/changelog-reflection.js +252 -0
- package/dist/commands/changelog/changelog-reflection.js.map +1 -0
- package/dist/commands/compact.d.ts +15 -0
- package/dist/commands/compact.d.ts.map +1 -0
- package/dist/commands/compact.js +113 -0
- package/dist/commands/compact.js.map +1 -0
- package/dist/commands/config.d.ts +10 -0
- package/dist/commands/config.d.ts.map +1 -0
- package/dist/commands/config.js +85 -0
- package/dist/commands/config.js.map +1 -0
- package/dist/commands/context-new.d.ts +18 -0
- package/dist/commands/context-new.d.ts.map +1 -0
- package/dist/commands/context-new.js +265 -0
- package/dist/commands/context-new.js.map +1 -0
- package/dist/commands/context.d.ts +16 -0
- package/dist/commands/context.d.ts.map +1 -0
- package/dist/commands/context.js +82 -0
- package/dist/commands/context.js.map +1 -0
- package/dist/commands/documentation/documentation-pipeline.d.ts +130 -0
- package/dist/commands/documentation/documentation-pipeline.d.ts.map +1 -0
- package/dist/commands/documentation/documentation-pipeline.js +716 -0
- package/dist/commands/documentation/documentation-pipeline.js.map +1 -0
- package/dist/commands/documentation/documentation-reflection.d.ts +54 -0
- package/dist/commands/documentation/documentation-reflection.d.ts.map +1 -0
- package/dist/commands/documentation/documentation-reflection.js +338 -0
- package/dist/commands/documentation/documentation-reflection.js.map +1 -0
- package/dist/commands/explore/explore-reflection-pipeline.d.ts +117 -0
- package/dist/commands/explore/explore-reflection-pipeline.d.ts.map +1 -0
- package/dist/commands/explore/explore-reflection-pipeline.js +503 -0
- package/dist/commands/explore/explore-reflection-pipeline.js.map +1 -0
- package/dist/commands/explore/index.d.ts +29 -0
- package/dist/commands/explore/index.d.ts.map +1 -0
- package/dist/commands/explore/index.js +30 -0
- package/dist/commands/explore/index.js.map +1 -0
- package/dist/commands/explore.d.ts +20 -0
- package/dist/commands/explore.d.ts.map +1 -0
- package/dist/commands/explore.js +224 -0
- package/dist/commands/explore.js.map +1 -0
- package/dist/commands/git/git-context-gatherer.d.ts +101 -0
- package/dist/commands/git/git-context-gatherer.d.ts.map +1 -0
- package/dist/commands/git/git-context-gatherer.js +284 -0
- package/dist/commands/git/git-context-gatherer.js.map +1 -0
- package/dist/commands/git/git-pipeline.d.ts +75 -0
- package/dist/commands/git/git-pipeline.d.ts.map +1 -0
- package/dist/commands/git/git-pipeline.js +530 -0
- package/dist/commands/git/git-pipeline.js.map +1 -0
- package/dist/commands/git/git-reflection.d.ts +50 -0
- package/dist/commands/git/git-reflection.d.ts.map +1 -0
- package/dist/commands/git/git-reflection.js +193 -0
- package/dist/commands/git/git-reflection.js.map +1 -0
- package/dist/commands/handoff/handoff-reflection-pipeline.d.ts +106 -0
- package/dist/commands/handoff/handoff-reflection-pipeline.d.ts.map +1 -0
- package/dist/commands/handoff/handoff-reflection-pipeline.js +534 -0
- package/dist/commands/handoff/handoff-reflection-pipeline.js.map +1 -0
- package/dist/commands/handoff/handoff-save.d.ts +16 -0
- package/dist/commands/handoff/handoff-save.d.ts.map +1 -0
- package/dist/commands/handoff/handoff-save.js +72 -0
- package/dist/commands/handoff/handoff-save.js.map +1 -0
- package/dist/commands/handoff/index.d.ts +19 -0
- package/dist/commands/handoff/index.d.ts.map +1 -0
- package/dist/commands/handoff/index.js +55 -0
- package/dist/commands/handoff/index.js.map +1 -0
- package/dist/commands/handoff-ai-orig.d.ts +27 -0
- package/dist/commands/handoff-ai-orig.d.ts.map +1 -0
- package/dist/commands/handoff-ai-orig.js +405 -0
- package/dist/commands/handoff-ai-orig.js.map +1 -0
- package/dist/commands/handoff-ai.d.ts +27 -0
- package/dist/commands/handoff-ai.d.ts.map +1 -0
- package/dist/commands/handoff-ai.js +405 -0
- package/dist/commands/handoff-ai.js.map +1 -0
- package/dist/commands/handoff-enhanced-orig.d.ts +25 -0
- package/dist/commands/handoff-enhanced-orig.d.ts.map +1 -0
- package/dist/commands/handoff-enhanced-orig.js +349 -0
- package/dist/commands/handoff-enhanced-orig.js.map +1 -0
- package/dist/commands/handoff-enhanced.d.ts +25 -0
- package/dist/commands/handoff-enhanced.d.ts.map +1 -0
- package/dist/commands/handoff-enhanced.js +349 -0
- package/dist/commands/handoff-enhanced.js.map +1 -0
- package/dist/commands/handoff-orig.d.ts +10 -0
- package/dist/commands/handoff-orig.d.ts.map +1 -0
- package/dist/commands/handoff-orig.js +167 -0
- package/dist/commands/handoff-orig.js.map +1 -0
- package/dist/commands/handoff.d.ts +10 -0
- package/dist/commands/handoff.d.ts.map +1 -0
- package/dist/commands/handoff.js +167 -0
- package/dist/commands/handoff.js.map +1 -0
- package/dist/commands/init-copilot.d.ts +6 -0
- package/dist/commands/init-copilot.d.ts.map +1 -0
- package/dist/commands/init-copilot.js +151 -0
- package/dist/commands/init-copilot.js.map +1 -0
- package/dist/commands/init-cursor.d.ts +5 -0
- package/dist/commands/init-cursor.d.ts.map +1 -0
- package/dist/commands/init-cursor.js +95 -0
- package/dist/commands/init-cursor.js.map +1 -0
- package/dist/commands/init-enhanced.d.ts +20 -0
- package/dist/commands/init-enhanced.d.ts.map +1 -0
- package/dist/commands/init-enhanced.js +430 -0
- package/dist/commands/init-enhanced.js.map +1 -0
- package/dist/commands/init.d.ts +16 -0
- package/dist/commands/init.d.ts.map +1 -0
- package/dist/commands/init.js +213 -0
- package/dist/commands/init.js.map +1 -0
- package/dist/commands/magic-prompt.d.ts +20 -0
- package/dist/commands/magic-prompt.d.ts.map +1 -0
- package/dist/commands/magic-prompt.js +166 -0
- package/dist/commands/magic-prompt.js.map +1 -0
- package/dist/commands/magic-simple.d.ts +20 -0
- package/dist/commands/magic-simple.d.ts.map +1 -0
- package/dist/commands/magic-simple.js +32 -0
- package/dist/commands/magic-simple.js.map +1 -0
- package/dist/commands/magic.d.ts +20 -0
- package/dist/commands/magic.d.ts.map +1 -0
- package/dist/commands/magic.js +144 -0
- package/dist/commands/magic.js.map +1 -0
- package/dist/commands/plan/plan-reflection-pipeline.d.ts +126 -0
- package/dist/commands/plan/plan-reflection-pipeline.d.ts.map +1 -0
- package/dist/commands/plan/plan-reflection-pipeline.js +554 -0
- package/dist/commands/plan/plan-reflection-pipeline.js.map +1 -0
- package/dist/commands/plan.d.ts +20 -0
- package/dist/commands/plan.d.ts.map +1 -0
- package/dist/commands/plan.js +253 -0
- package/dist/commands/plan.js.map +1 -0
- package/dist/commands/prd/index.d.ts +21 -0
- package/dist/commands/prd/index.d.ts.map +1 -0
- package/dist/commands/prd/index.js +41 -0
- package/dist/commands/prd/index.js.map +1 -0
- package/dist/commands/prd/prd-pipeline-enhanced.d.ts +82 -0
- package/dist/commands/prd/prd-pipeline-enhanced.d.ts.map +1 -0
- package/dist/commands/prd/prd-pipeline-enhanced.js +565 -0
- package/dist/commands/prd/prd-pipeline-enhanced.js.map +1 -0
- package/dist/commands/prd/prd-pipeline.d.ts +106 -0
- package/dist/commands/prd/prd-pipeline.d.ts.map +1 -0
- package/dist/commands/prd/prd-pipeline.js +491 -0
- package/dist/commands/prd/prd-pipeline.js.map +1 -0
- package/dist/commands/prd/prd-reflection-enhanced.d.ts +63 -0
- package/dist/commands/prd/prd-reflection-enhanced.d.ts.map +1 -0
- package/dist/commands/prd/prd-reflection-enhanced.js +310 -0
- package/dist/commands/prd/prd-reflection-enhanced.js.map +1 -0
- package/dist/commands/prd/prd-reflection.d.ts +59 -0
- package/dist/commands/prd/prd-reflection.d.ts.map +1 -0
- package/dist/commands/prd/prd-reflection.js +548 -0
- package/dist/commands/prd/prd-reflection.js.map +1 -0
- package/dist/commands/reflect.d.ts +24 -0
- package/dist/commands/reflect.d.ts.map +1 -0
- package/dist/commands/reflect.js +135 -0
- package/dist/commands/reflect.js.map +1 -0
- package/dist/commands/ship/ship-reflection.d.ts +164 -0
- package/dist/commands/ship/ship-reflection.d.ts.map +1 -0
- package/dist/commands/ship/ship-reflection.js +732 -0
- package/dist/commands/ship/ship-reflection.js.map +1 -0
- package/dist/commands/ship-ai.d.ts +28 -0
- package/dist/commands/ship-ai.d.ts.map +1 -0
- package/dist/commands/ship-ai.js +318 -0
- package/dist/commands/ship-ai.js.map +1 -0
- package/dist/commands/ship.d.ts +17 -0
- package/dist/commands/ship.d.ts.map +1 -0
- package/dist/commands/ship.js +175 -0
- package/dist/commands/ship.js.map +1 -0
- package/dist/commands/sprint/index.d.ts +21 -0
- package/dist/commands/sprint/index.d.ts.map +1 -0
- package/dist/commands/sprint/index.js +39 -0
- package/dist/commands/sprint/index.js.map +1 -0
- package/dist/commands/sprint/sprint-pipeline-enhanced.d.ts +142 -0
- package/dist/commands/sprint/sprint-pipeline-enhanced.d.ts.map +1 -0
- package/dist/commands/sprint/sprint-pipeline-enhanced.js +822 -0
- package/dist/commands/sprint/sprint-pipeline-enhanced.js.map +1 -0
- package/dist/commands/sprint/sprint-pipeline.d.ts +72 -0
- package/dist/commands/sprint/sprint-pipeline.d.ts.map +1 -0
- package/dist/commands/sprint/sprint-pipeline.js +363 -0
- package/dist/commands/sprint/sprint-pipeline.js.map +1 -0
- package/dist/commands/start/index.d.ts +19 -0
- package/dist/commands/start/index.d.ts.map +1 -0
- package/dist/commands/start/index.js +41 -0
- package/dist/commands/start/index.js.map +1 -0
- package/dist/commands/start/start-reflection-pipeline.d.ts +99 -0
- package/dist/commands/start/start-reflection-pipeline.d.ts.map +1 -0
- package/dist/commands/start/start-reflection-pipeline.js +458 -0
- package/dist/commands/start/start-reflection-pipeline.js.map +1 -0
- package/dist/commands/start/start-reflection.d.ts +89 -0
- package/dist/commands/start/start-reflection.d.ts.map +1 -0
- package/dist/commands/start/start-reflection.js +572 -0
- package/dist/commands/start/start-reflection.js.map +1 -0
- package/dist/commands/start/start-with-synthesis.d.ts +20 -0
- package/dist/commands/start/start-with-synthesis.d.ts.map +1 -0
- package/dist/commands/start/start-with-synthesis.js +134 -0
- package/dist/commands/start/start-with-synthesis.js.map +1 -0
- package/dist/commands/start-enhanced-orig.d.ts +19 -0
- package/dist/commands/start-enhanced-orig.d.ts.map +1 -0
- package/dist/commands/start-enhanced-orig.js +434 -0
- package/dist/commands/start-enhanced-orig.js.map +1 -0
- package/dist/commands/start-enhanced.d.ts +19 -0
- package/dist/commands/start-enhanced.d.ts.map +1 -0
- package/dist/commands/start-enhanced.js +434 -0
- package/dist/commands/start-enhanced.js.map +1 -0
- package/dist/commands/start-orig.d.ts +10 -0
- package/dist/commands/start-orig.d.ts.map +1 -0
- package/dist/commands/start-orig.js +119 -0
- package/dist/commands/start-orig.js.map +1 -0
- package/dist/commands/start.d.ts +10 -0
- package/dist/commands/start.d.ts.map +1 -0
- package/dist/commands/start.js +119 -0
- package/dist/commands/start.js.map +1 -0
- package/dist/commands/status.d.ts +11 -0
- package/dist/commands/status.d.ts.map +1 -0
- package/dist/commands/status.js +119 -0
- package/dist/commands/status.js.map +1 -0
- package/dist/commands/testing/index.d.ts +21 -0
- package/dist/commands/testing/index.d.ts.map +1 -0
- package/dist/commands/testing/index.js +41 -0
- package/dist/commands/testing/index.js.map +1 -0
- package/dist/commands/testing/testing-pipeline-enhanced.d.ts +94 -0
- package/dist/commands/testing/testing-pipeline-enhanced.d.ts.map +1 -0
- package/dist/commands/testing/testing-pipeline-enhanced.js +760 -0
- package/dist/commands/testing/testing-pipeline-enhanced.js.map +1 -0
- package/dist/commands/testing/testing-pipeline.d.ts +77 -0
- package/dist/commands/testing/testing-pipeline.d.ts.map +1 -0
- package/dist/commands/testing/testing-pipeline.js +479 -0
- package/dist/commands/testing/testing-pipeline.js.map +1 -0
- package/dist/commands/uninstall-copilot.d.ts +5 -0
- package/dist/commands/uninstall-copilot.d.ts.map +1 -0
- package/dist/commands/uninstall-copilot.js +143 -0
- package/dist/commands/uninstall-copilot.js.map +1 -0
- package/dist/commands/uninstall-cursor.d.ts +6 -0
- package/dist/commands/uninstall-cursor.d.ts.map +1 -0
- package/dist/commands/uninstall-cursor.js +124 -0
- package/dist/commands/uninstall-cursor.js.map +1 -0
- package/dist/commands/vibecheck-ai.d.ts +25 -0
- package/dist/commands/vibecheck-ai.d.ts.map +1 -0
- package/dist/commands/vibecheck-ai.js +260 -0
- package/dist/commands/vibecheck-ai.js.map +1 -0
- package/dist/commands/vibecheck-aware.d.ts +19 -0
- package/dist/commands/vibecheck-aware.d.ts.map +1 -0
- package/dist/commands/vibecheck-aware.js +350 -0
- package/dist/commands/vibecheck-aware.js.map +1 -0
- package/dist/commands/vibecheck-final.d.ts +22 -0
- package/dist/commands/vibecheck-final.d.ts.map +1 -0
- package/dist/commands/vibecheck-final.js +132 -0
- package/dist/commands/vibecheck-final.js.map +1 -0
- package/dist/commands/vibecheck-natural.d.ts +18 -0
- package/dist/commands/vibecheck-natural.d.ts.map +1 -0
- package/dist/commands/vibecheck-natural.js +105 -0
- package/dist/commands/vibecheck-natural.js.map +1 -0
- package/dist/commands/vibecheck-simple.d.ts +20 -0
- package/dist/commands/vibecheck-simple.d.ts.map +1 -0
- package/dist/commands/vibecheck-simple.js +136 -0
- package/dist/commands/vibecheck-simple.js.map +1 -0
- package/dist/commands/vibecheck.d.ts +10 -0
- package/dist/commands/vibecheck.d.ts.map +1 -0
- package/dist/commands/vibecheck.js +95 -0
- package/dist/commands/vibecheck.js.map +1 -0
- package/dist/core/adapters/path-adapter.d.ts +144 -0
- package/dist/core/adapters/path-adapter.d.ts.map +1 -0
- package/dist/core/adapters/path-adapter.js +245 -0
- package/dist/core/adapters/path-adapter.js.map +1 -0
- package/dist/core/command-shortcuts.d.ts +62 -0
- package/dist/core/command-shortcuts.d.ts.map +1 -0
- package/dist/core/command-shortcuts.js +124 -0
- package/dist/core/command-shortcuts.js.map +1 -0
- package/dist/core/config/config-aware-reflection.d.ts +37 -0
- package/dist/core/config/config-aware-reflection.d.ts.map +1 -0
- package/dist/core/config/config-aware-reflection.js +97 -0
- package/dist/core/config/config-aware-reflection.js.map +1 -0
- package/dist/core/config/config-loader.d.ts +154 -0
- package/dist/core/config/config-loader.d.ts.map +1 -0
- package/dist/core/config/config-loader.js +424 -0
- package/dist/core/config/config-loader.js.map +1 -0
- package/dist/core/config/config-migrator.d.ts +150 -0
- package/dist/core/config/config-migrator.d.ts.map +1 -0
- package/dist/core/config/config-migrator.js +423 -0
- package/dist/core/config/config-migrator.js.map +1 -0
- package/dist/core/config/config-schema.d.ts +276 -0
- package/dist/core/config/config-schema.d.ts.map +1 -0
- package/dist/core/config/config-schema.js +277 -0
- package/dist/core/config/config-schema.js.map +1 -0
- package/dist/core/config/index.d.ts +260 -0
- package/dist/core/config/index.d.ts.map +1 -0
- package/dist/core/config/index.js +283 -0
- package/dist/core/config/index.js.map +1 -0
- package/dist/core/config/interactive-config.d.ts +76 -0
- package/dist/core/config/interactive-config.d.ts.map +1 -0
- package/dist/core/config/interactive-config.js +315 -0
- package/dist/core/config/interactive-config.js.map +1 -0
- package/dist/core/config/path-config.d.ts +121 -0
- package/dist/core/config/path-config.d.ts.map +1 -0
- package/dist/core/config/path-config.js +210 -0
- package/dist/core/config/path-config.js.map +1 -0
- package/dist/core/config/path-resolver.d.ts +151 -0
- package/dist/core/config/path-resolver.d.ts.map +1 -0
- package/dist/core/config/path-resolver.js +343 -0
- package/dist/core/config/path-resolver.js.map +1 -0
- package/dist/core/config/project-detector.d.ts +58 -0
- package/dist/core/config/project-detector.d.ts.map +1 -0
- package/dist/core/config/project-detector.js +310 -0
- package/dist/core/config/project-detector.js.map +1 -0
- package/dist/core/config-backup/config-aware-reflection.d.ts +37 -0
- package/dist/core/config-backup/config-aware-reflection.d.ts.map +1 -0
- package/dist/core/config-backup/config-aware-reflection.js +97 -0
- package/dist/core/config-backup/config-aware-reflection.js.map +1 -0
- package/dist/core/config-backup/config-loader.d.ts +71 -0
- package/dist/core/config-backup/config-loader.d.ts.map +1 -0
- package/dist/core/config-backup/config-loader.js +288 -0
- package/dist/core/config-backup/config-loader.js.map +1 -0
- package/dist/core/config-backup/interactive-config.d.ts +76 -0
- package/dist/core/config-backup/interactive-config.d.ts.map +1 -0
- package/dist/core/config-backup/interactive-config.js +315 -0
- package/dist/core/config-backup/interactive-config.js.map +1 -0
- package/dist/core/config-backup/path-config.d.ts +121 -0
- package/dist/core/config-backup/path-config.d.ts.map +1 -0
- package/dist/core/config-backup/path-config.js +210 -0
- package/dist/core/config-backup/path-config.js.map +1 -0
- package/dist/core/config-backup/project-detector.d.ts +58 -0
- package/dist/core/config-backup/project-detector.d.ts.map +1 -0
- package/dist/core/config-backup/project-detector.js +310 -0
- package/dist/core/config-backup/project-detector.js.map +1 -0
- package/dist/core/documents/document-manager.d.ts +97 -0
- package/dist/core/documents/document-manager.d.ts.map +1 -0
- package/dist/core/documents/document-manager.js +441 -0
- package/dist/core/documents/document-manager.js.map +1 -0
- package/dist/core/documents/document-migrator.d.ts +138 -0
- package/dist/core/documents/document-migrator.d.ts.map +1 -0
- package/dist/core/documents/document-migrator.js +349 -0
- package/dist/core/documents/document-migrator.js.map +1 -0
- package/dist/core/documents/document-namer.d.ts +111 -0
- package/dist/core/documents/document-namer.d.ts.map +1 -0
- package/dist/core/documents/document-namer.js +225 -0
- package/dist/core/documents/document-namer.js.map +1 -0
- package/dist/core/documents/examples.d.ts +74 -0
- package/dist/core/documents/examples.d.ts.map +1 -0
- package/dist/core/documents/examples.js +273 -0
- package/dist/core/documents/examples.js.map +1 -0
- package/dist/core/documents/file-system.d.ts +93 -0
- package/dist/core/documents/file-system.d.ts.map +1 -0
- package/dist/core/documents/file-system.js +432 -0
- package/dist/core/documents/file-system.js.map +1 -0
- package/dist/core/documents/index.d.ts +97 -0
- package/dist/core/documents/index.d.ts.map +1 -0
- package/dist/core/documents/index.js +119 -0
- package/dist/core/documents/index.js.map +1 -0
- package/dist/core/documents/markdown-processor.d.ts +84 -0
- package/dist/core/documents/markdown-processor.d.ts.map +1 -0
- package/dist/core/documents/markdown-processor.js +302 -0
- package/dist/core/documents/markdown-processor.js.map +1 -0
- package/dist/core/documents/sequence-manager.d.ts +107 -0
- package/dist/core/documents/sequence-manager.d.ts.map +1 -0
- package/dist/core/documents/sequence-manager.js +246 -0
- package/dist/core/documents/sequence-manager.js.map +1 -0
- package/dist/core/documents/template-engine.d.ts +101 -0
- package/dist/core/documents/template-engine.d.ts.map +1 -0
- package/dist/core/documents/template-engine.js +440 -0
- package/dist/core/documents/template-engine.js.map +1 -0
- package/dist/core/handoff-quality.d.ts +164 -0
- package/dist/core/handoff-quality.d.ts.map +1 -0
- package/dist/core/handoff-quality.js +590 -0
- package/dist/core/handoff-quality.js.map +1 -0
- package/dist/core/platform/hook-adapter.d.ts +109 -0
- package/dist/core/platform/hook-adapter.d.ts.map +1 -0
- package/dist/core/platform/hook-adapter.js +527 -0
- package/dist/core/platform/hook-adapter.js.map +1 -0
- package/dist/core/platform/hook-migration.d.ts +73 -0
- package/dist/core/platform/hook-migration.d.ts.map +1 -0
- package/dist/core/platform/hook-migration.js +339 -0
- package/dist/core/platform/hook-migration.js.map +1 -0
- package/dist/core/platform/hook-migrator.d.ts +49 -0
- package/dist/core/platform/hook-migrator.d.ts.map +1 -0
- package/dist/core/platform/hook-migrator.js +305 -0
- package/dist/core/platform/hook-migrator.js.map +1 -0
- package/dist/core/platform/hook-templates.d.ts +60 -0
- package/dist/core/platform/hook-templates.d.ts.map +1 -0
- package/dist/core/platform/hook-templates.js +352 -0
- package/dist/core/platform/hook-templates.js.map +1 -0
- package/dist/core/platform/index.d.ts +82 -0
- package/dist/core/platform/index.d.ts.map +1 -0
- package/dist/core/platform/index.js +173 -0
- package/dist/core/platform/index.js.map +1 -0
- package/dist/core/platform/path-normalizer.d.ts +117 -0
- package/dist/core/platform/path-normalizer.d.ts.map +1 -0
- package/dist/core/platform/path-normalizer.js +333 -0
- package/dist/core/platform/path-normalizer.js.map +1 -0
- package/dist/core/platform/path-resolver.d.ts +120 -0
- package/dist/core/platform/path-resolver.d.ts.map +1 -0
- package/dist/core/platform/path-resolver.js +339 -0
- package/dist/core/platform/path-resolver.js.map +1 -0
- package/dist/core/platform/platform-adapter.d.ts +101 -0
- package/dist/core/platform/platform-adapter.d.ts.map +1 -0
- package/dist/core/platform/platform-adapter.js +243 -0
- package/dist/core/platform/platform-adapter.js.map +1 -0
- package/dist/core/platform/platform-detector.d.ts +122 -0
- package/dist/core/platform/platform-detector.d.ts.map +1 -0
- package/dist/core/platform/platform-detector.js +318 -0
- package/dist/core/platform/platform-detector.js.map +1 -0
- package/dist/core/platform/platform-templates.d.ts +62 -0
- package/dist/core/platform/platform-templates.d.ts.map +1 -0
- package/dist/core/platform/platform-templates.js +364 -0
- package/dist/core/platform/platform-templates.js.map +1 -0
- package/dist/core/platform/types.d.ts +54 -0
- package/dist/core/platform/types.d.ts.map +1 -0
- package/dist/core/platform/types.js +12 -0
- package/dist/core/platform/types.js.map +1 -0
- package/dist/core/polyglot-example.d.ts +115 -0
- package/dist/core/polyglot-example.d.ts.map +1 -0
- package/dist/core/polyglot-example.js +341 -0
- package/dist/core/polyglot-example.js.map +1 -0
- package/dist/core/pressure-monitor.d.ts +76 -0
- package/dist/core/pressure-monitor.d.ts.map +1 -0
- package/dist/core/pressure-monitor.js +156 -0
- package/dist/core/pressure-monitor.js.map +1 -0
- package/dist/core/reflection-pattern.d.ts +99 -0
- package/dist/core/reflection-pattern.d.ts.map +1 -0
- package/dist/core/reflection-pattern.js +294 -0
- package/dist/core/reflection-pattern.js.map +1 -0
- package/dist/core/session-log-manager.d.ts +83 -0
- package/dist/core/session-log-manager.d.ts.map +1 -0
- package/dist/core/session-log-manager.js +288 -0
- package/dist/core/session-log-manager.js.map +1 -0
- package/dist/core/simple-pipeline-base.d.ts +130 -0
- package/dist/core/simple-pipeline-base.d.ts.map +1 -0
- package/dist/core/simple-pipeline-base.js +240 -0
- package/dist/core/simple-pipeline-base.js.map +1 -0
- package/dist/core/simple-pipeline.d.ts +70 -0
- package/dist/core/simple-pipeline.d.ts.map +1 -0
- package/dist/core/simple-pipeline.js +241 -0
- package/dist/core/simple-pipeline.js.map +1 -0
- package/dist/core/utils/paths.d.ts +50 -0
- package/dist/core/utils/paths.d.ts.map +1 -0
- package/dist/core/utils/paths.js +75 -0
- package/dist/core/utils/paths.js.map +1 -0
- package/dist/core/validators/command-argument-validator.d.ts +102 -0
- package/dist/core/validators/command-argument-validator.d.ts.map +1 -0
- package/dist/core/validators/command-argument-validator.js +377 -0
- package/dist/core/validators/command-argument-validator.js.map +1 -0
- package/dist/core/validators/config-validator.d.ts +111 -0
- package/dist/core/validators/config-validator.d.ts.map +1 -0
- package/dist/core/validators/config-validator.js +433 -0
- package/dist/core/validators/config-validator.js.map +1 -0
- package/dist/core/validators/environment-validator.d.ts +138 -0
- package/dist/core/validators/environment-validator.d.ts.map +1 -0
- package/dist/core/validators/environment-validator.js +516 -0
- package/dist/core/validators/environment-validator.js.map +1 -0
- package/dist/core/validators/git-validator.d.ts +100 -0
- package/dist/core/validators/git-validator.d.ts.map +1 -0
- package/dist/core/validators/git-validator.js +288 -0
- package/dist/core/validators/git-validator.js.map +1 -0
- package/dist/core/validators/git-validator.test.d.ts +12 -0
- package/dist/core/validators/git-validator.test.d.ts.map +1 -0
- package/dist/core/validators/git-validator.test.js +40 -0
- package/dist/core/validators/git-validator.test.js.map +1 -0
- package/dist/core/validators/index.d.ts +90 -0
- package/dist/core/validators/index.d.ts.map +1 -0
- package/dist/core/validators/index.js +166 -0
- package/dist/core/validators/index.js.map +1 -0
- package/dist/core/validators/input-validator.d.ts +117 -0
- package/dist/core/validators/input-validator.d.ts.map +1 -0
- package/dist/core/validators/input-validator.js +368 -0
- package/dist/core/validators/input-validator.js.map +1 -0
- package/dist/core/validators/temp_index.d.ts +56 -0
- package/dist/core/validators/temp_index.d.ts.map +1 -0
- package/dist/core/validators/temp_index.js +94 -0
- package/dist/core/validators/temp_index.js.map +1 -0
- package/dist/core/validators/validation-error-handler.d.ts +107 -0
- package/dist/core/validators/validation-error-handler.d.ts.map +1 -0
- package/dist/core/validators/validation-error-handler.js +379 -0
- package/dist/core/validators/validation-error-handler.js.map +1 -0
- package/dist/core/validators/validation-orchestrator.d.ts +128 -0
- package/dist/core/validators/validation-orchestrator.d.ts.map +1 -0
- package/dist/core/validators/validation-orchestrator.js +301 -0
- package/dist/core/validators/validation-orchestrator.js.map +1 -0
- package/dist/index.d.ts +11 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +316 -0
- package/dist/index.js.map +1 -0
- package/dist/services/active-context-manager.d.ts +118 -0
- package/dist/services/active-context-manager.d.ts.map +1 -0
- package/dist/services/active-context-manager.js +435 -0
- package/dist/services/active-context-manager.js.map +1 -0
- package/dist/services/ai-service.d.ts +71 -0
- package/dist/services/ai-service.d.ts.map +1 -0
- package/dist/services/ai-service.js +329 -0
- package/dist/services/ai-service.js.map +1 -0
- package/dist/services/context-search.d.ts +98 -0
- package/dist/services/context-search.d.ts.map +1 -0
- package/dist/services/context-search.js +289 -0
- package/dist/services/context-search.js.map +1 -0
- package/dist/services/insight-extractor.d.ts +69 -0
- package/dist/services/insight-extractor.d.ts.map +1 -0
- package/dist/services/insight-extractor.js +343 -0
- package/dist/services/insight-extractor.js.map +1 -0
- package/dist/services/insight-quality-controller.d.ts +167 -0
- package/dist/services/insight-quality-controller.d.ts.map +1 -0
- package/dist/services/insight-quality-controller.js +543 -0
- package/dist/services/insight-quality-controller.js.map +1 -0
- package/dist/services/module-generator.d.ts +108 -0
- package/dist/services/module-generator.d.ts.map +1 -0
- package/dist/services/module-generator.js +561 -0
- package/dist/services/module-generator.js.map +1 -0
- package/dist/services/statusline-tracker.d.ts +139 -0
- package/dist/services/statusline-tracker.d.ts.map +1 -0
- package/dist/services/statusline-tracker.js +360 -0
- package/dist/services/statusline-tracker.js.map +1 -0
- package/dist/templates/ai-instructions-template.d.ts +39 -0
- package/dist/templates/ai-instructions-template.d.ts.map +1 -0
- package/dist/templates/ai-instructions-template.js +222 -0
- package/dist/templates/ai-instructions-template.js.map +1 -0
- package/dist/types/config.d.ts +128 -0
- package/dist/types/config.d.ts.map +1 -0
- package/dist/types/config.js +49 -0
- package/dist/types/config.js.map +1 -0
- package/dist/types/documents.d.ts +87 -0
- package/dist/types/documents.d.ts.map +1 -0
- package/dist/types/documents.js +12 -0
- package/dist/types/documents.js.map +1 -0
- package/dist/types/session-log.d.ts +83 -0
- package/dist/types/session-log.d.ts.map +1 -0
- package/dist/types/session-log.js +12 -0
- package/dist/types/session-log.js.map +1 -0
- package/dist/types/session.d.ts +257 -0
- package/dist/types/session.d.ts.map +1 -0
- package/dist/types/session.js +12 -0
- package/dist/types/session.js.map +1 -0
- package/dist/utils/ai-templates.d.ts +98 -0
- package/dist/utils/ai-templates.d.ts.map +1 -0
- package/dist/utils/ai-templates.js +179 -0
- package/dist/utils/ai-templates.js.map +1 -0
- package/dist/utils/ginko-root.d.ts +51 -0
- package/dist/utils/ginko-root.d.ts.map +1 -0
- package/dist/utils/ginko-root.js +96 -0
- package/dist/utils/ginko-root.js.map +1 -0
- package/dist/utils/helpers.d.ts +19 -0
- package/dist/utils/helpers.d.ts.map +1 -0
- package/dist/utils/helpers.js +107 -0
- package/dist/utils/helpers.js.map +1 -0
- package/dist/utils/progressive-learning.d.ts +42 -0
- package/dist/utils/progressive-learning.d.ts.map +1 -0
- package/dist/utils/progressive-learning.js +248 -0
- package/dist/utils/progressive-learning.js.map +1 -0
- package/dist/utils/session-collector.d.ts +81 -0
- package/dist/utils/session-collector.d.ts.map +1 -0
- package/dist/utils/session-collector.js +387 -0
- package/dist/utils/session-collector.js.map +1 -0
- package/dist/utils/session-logger.d.ts +125 -0
- package/dist/utils/session-logger.d.ts.map +1 -0
- package/dist/utils/session-logger.js +359 -0
- package/dist/utils/session-logger.js.map +1 -0
- package/dist/utils/session-synthesizer.d.ts +36 -0
- package/dist/utils/session-synthesizer.d.ts.map +1 -0
- package/dist/utils/session-synthesizer.js +239 -0
- package/dist/utils/session-synthesizer.js.map +1 -0
- package/package.json +76 -0
|
@@ -0,0 +1,732 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileType: command
|
|
3
|
+
* @status: current
|
|
4
|
+
* @updated: 2025-10-01
|
|
5
|
+
* @tags: [ship, reflection, pipeline, builder, git, pr]
|
|
6
|
+
* @related: [../../core/simple-pipeline-base.ts, ../ship.ts, ../ship-ai.ts]
|
|
7
|
+
* @priority: high
|
|
8
|
+
* @complexity: high
|
|
9
|
+
* @dependencies: [simple-pipeline-base, simple-git, fs-extra, chalk, ora]
|
|
10
|
+
*/
|
|
11
|
+
import { SimplePipelineBase } from '../../core/simple-pipeline-base.js';
|
|
12
|
+
import simpleGit from 'simple-git';
|
|
13
|
+
import fs from 'fs-extra';
|
|
14
|
+
import * as path from 'path';
|
|
15
|
+
import chalk from 'chalk';
|
|
16
|
+
import ora from 'ora';
|
|
17
|
+
import { execSync } from 'child_process';
|
|
18
|
+
import { getGinkoDir } from '../../utils/helpers.js';
|
|
19
|
+
/**
|
|
20
|
+
* Ship Pipeline using Simple Builder Pattern
|
|
21
|
+
* Implements the Universal Reflection Pattern for ship command
|
|
22
|
+
*
|
|
23
|
+
* This replaces the standalone ship.ts and ship-ai.ts implementations
|
|
24
|
+
* with a unified reflection-based approach.
|
|
25
|
+
*/
|
|
26
|
+
export class ShipReflectionPipeline extends SimplePipelineBase {
|
|
27
|
+
git;
|
|
28
|
+
ginkoDir = '';
|
|
29
|
+
options;
|
|
30
|
+
spinner;
|
|
31
|
+
constructor(message, options = {}) {
|
|
32
|
+
super(message || 'Ship changes with quality commit and PR');
|
|
33
|
+
this.options = options;
|
|
34
|
+
this.withDomain('ship');
|
|
35
|
+
if (options.verbose) {
|
|
36
|
+
this.spinner = ora();
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* Get domain identifier
|
|
41
|
+
*/
|
|
42
|
+
getDomain() {
|
|
43
|
+
return 'ship';
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* Get quality template for ship
|
|
47
|
+
*/
|
|
48
|
+
getQualityTemplate() {
|
|
49
|
+
return {
|
|
50
|
+
commitMessage: {
|
|
51
|
+
requiredElements: ['type', 'subject', 'body'],
|
|
52
|
+
conventionalFormat: true,
|
|
53
|
+
includeBody: true,
|
|
54
|
+
includeBreakingChanges: true
|
|
55
|
+
},
|
|
56
|
+
prDescription: {
|
|
57
|
+
requiredSections: ['Summary', 'What Changed', 'Why', 'How', 'Testing'],
|
|
58
|
+
includeTestResults: !this.options.noTests,
|
|
59
|
+
includeScreenshots: true,
|
|
60
|
+
includeDeploymentNotes: true
|
|
61
|
+
},
|
|
62
|
+
validation: {
|
|
63
|
+
runTests: !this.options.noTests,
|
|
64
|
+
checkUncommitted: true,
|
|
65
|
+
verifyBranch: true
|
|
66
|
+
}
|
|
67
|
+
};
|
|
68
|
+
}
|
|
69
|
+
/**
|
|
70
|
+
* Initialize pipeline
|
|
71
|
+
*/
|
|
72
|
+
async initialize() {
|
|
73
|
+
this.git = simpleGit();
|
|
74
|
+
this.ginkoDir = await getGinkoDir();
|
|
75
|
+
if (this.spinner) {
|
|
76
|
+
this.spinner.start('Initializing ship pipeline...');
|
|
77
|
+
this.spinner.succeed('Ship pipeline initialized');
|
|
78
|
+
}
|
|
79
|
+
else {
|
|
80
|
+
console.log(chalk.cyan('🚢 Initializing ship pipeline...'));
|
|
81
|
+
}
|
|
82
|
+
return this;
|
|
83
|
+
}
|
|
84
|
+
/**
|
|
85
|
+
* Load template
|
|
86
|
+
*/
|
|
87
|
+
loadTemplate() {
|
|
88
|
+
const template = this.getQualityTemplate();
|
|
89
|
+
this.withTemplate(template);
|
|
90
|
+
if (this.spinner) {
|
|
91
|
+
this.spinner.succeed('Template loaded');
|
|
92
|
+
}
|
|
93
|
+
else {
|
|
94
|
+
console.log(chalk.gray(' ✓ Template loaded'));
|
|
95
|
+
}
|
|
96
|
+
return this;
|
|
97
|
+
}
|
|
98
|
+
/**
|
|
99
|
+
* Gather comprehensive context for ship
|
|
100
|
+
*/
|
|
101
|
+
async gatherContext() {
|
|
102
|
+
if (this.spinner) {
|
|
103
|
+
this.spinner.start('Gathering context...');
|
|
104
|
+
}
|
|
105
|
+
else {
|
|
106
|
+
console.log(chalk.cyan('🔍 Gathering context...'));
|
|
107
|
+
}
|
|
108
|
+
// Get git status and diffs
|
|
109
|
+
const status = await this.git.status();
|
|
110
|
+
const currentBranch = status.current;
|
|
111
|
+
const diff = await this.git.diff();
|
|
112
|
+
const diffStat = await this.git.diff(['--stat']);
|
|
113
|
+
const stagedDiff = await this.git.diff(['--staged']);
|
|
114
|
+
const recentCommits = await this.git.log({ maxCount: 10 });
|
|
115
|
+
// Analyze changes
|
|
116
|
+
const changeAnalysis = this.analyzeChanges(diff, diffStat);
|
|
117
|
+
const commitType = this.detectCommitType(changeAnalysis, this.ctx.intent);
|
|
118
|
+
const breakingChanges = this.detectBreakingChanges(diff);
|
|
119
|
+
// Run tests if required
|
|
120
|
+
let testResults = null;
|
|
121
|
+
if (this.ctx.template.validation.runTests) {
|
|
122
|
+
if (this.spinner) {
|
|
123
|
+
this.spinner.text = 'Running tests...';
|
|
124
|
+
}
|
|
125
|
+
testResults = await this.runTests();
|
|
126
|
+
}
|
|
127
|
+
const context = {
|
|
128
|
+
status,
|
|
129
|
+
currentBranch,
|
|
130
|
+
diff,
|
|
131
|
+
diffStat,
|
|
132
|
+
stagedDiff,
|
|
133
|
+
recentCommits: recentCommits.all,
|
|
134
|
+
changeAnalysis,
|
|
135
|
+
commitType,
|
|
136
|
+
breakingChanges,
|
|
137
|
+
testResults,
|
|
138
|
+
userMessage: this.ctx.intent,
|
|
139
|
+
targetBranch: this.options.branch
|
|
140
|
+
};
|
|
141
|
+
this.withContext(context);
|
|
142
|
+
if (this.spinner) {
|
|
143
|
+
this.spinner.succeed('Context gathered');
|
|
144
|
+
}
|
|
145
|
+
else {
|
|
146
|
+
console.log(chalk.gray(' ✓ Context gathered'));
|
|
147
|
+
}
|
|
148
|
+
return this;
|
|
149
|
+
}
|
|
150
|
+
/**
|
|
151
|
+
* Generate prompt for AI enhancement (if needed)
|
|
152
|
+
*/
|
|
153
|
+
generatePrompt() {
|
|
154
|
+
const context = this.ctx.context;
|
|
155
|
+
return `# Ship Content Generation
|
|
156
|
+
|
|
157
|
+
## Context
|
|
158
|
+
- **Files Changed**: ${context.changeAnalysis.fileCount}
|
|
159
|
+
- **Lines Added**: ${context.changeAnalysis.additions}
|
|
160
|
+
- **Lines Removed**: ${context.changeAnalysis.deletions}
|
|
161
|
+
- **Commit Type**: ${context.commitType}
|
|
162
|
+
- **Breaking Changes**: ${context.breakingChanges ? 'Yes' : 'No'}
|
|
163
|
+
- **Tests**: ${context.testResults ? (context.testResults.passed ? 'Passed ✅' : 'Failed ❌') : 'Not run'}
|
|
164
|
+
|
|
165
|
+
## User Intent
|
|
166
|
+
${context.userMessage || '[No message provided - analyze diffs]'}
|
|
167
|
+
|
|
168
|
+
## Recent Commits
|
|
169
|
+
${context.recentCommits.slice(0, 5).map(c => `- ${c.message.split('\n')[0]}`).join('\n')}
|
|
170
|
+
|
|
171
|
+
## Changes
|
|
172
|
+
\`\`\`diff
|
|
173
|
+
${context.diff.slice(0, 2000)}${context.diff.length > 2000 ? '\n... (truncated)' : ''}
|
|
174
|
+
\`\`\`
|
|
175
|
+
|
|
176
|
+
## Instructions
|
|
177
|
+
Generate a high-quality ship package with:
|
|
178
|
+
|
|
179
|
+
1. **Commit Message** (Conventional Commits format):
|
|
180
|
+
- Type: ${context.commitType}
|
|
181
|
+
- Subject: Clear, imperative mood (50 chars)
|
|
182
|
+
- Body: What and why (wrap at 72 chars)
|
|
183
|
+
- Footer: BREAKING CHANGE if applicable
|
|
184
|
+
|
|
185
|
+
2. **Pull Request Description**:
|
|
186
|
+
- Summary: High-level overview
|
|
187
|
+
- What Changed: Bullet points of changes
|
|
188
|
+
- Why: Motivation and context
|
|
189
|
+
- How: Technical approach
|
|
190
|
+
- Testing: Test coverage and results
|
|
191
|
+
- Screenshots: Note if applicable
|
|
192
|
+
- Deploy Notes: Any migration steps
|
|
193
|
+
|
|
194
|
+
3. **Branch Name** (if needed):
|
|
195
|
+
- Format: ${context.commitType}/brief-description
|
|
196
|
+
|
|
197
|
+
Format your response as:
|
|
198
|
+
|
|
199
|
+
## Commit Message
|
|
200
|
+
\`\`\`
|
|
201
|
+
<type>(<scope>): <subject>
|
|
202
|
+
|
|
203
|
+
<body>
|
|
204
|
+
|
|
205
|
+
<footer>
|
|
206
|
+
\`\`\`
|
|
207
|
+
|
|
208
|
+
## Pull Request Description
|
|
209
|
+
<markdown content>
|
|
210
|
+
|
|
211
|
+
## Branch Name
|
|
212
|
+
\`<branch-name>\`
|
|
213
|
+
`;
|
|
214
|
+
}
|
|
215
|
+
/**
|
|
216
|
+
* Generate content (without AI, based on templates)
|
|
217
|
+
*/
|
|
218
|
+
generateContent() {
|
|
219
|
+
if (this.spinner) {
|
|
220
|
+
this.spinner.start('Generating ship content...');
|
|
221
|
+
}
|
|
222
|
+
else {
|
|
223
|
+
console.log(chalk.cyan('📝 Generating ship content...'));
|
|
224
|
+
}
|
|
225
|
+
const context = this.ctx.context;
|
|
226
|
+
// Build commit message
|
|
227
|
+
const commitMessage = this.buildCommitMessage(context);
|
|
228
|
+
// Build PR description
|
|
229
|
+
const prDescription = this.buildPRDescription(context);
|
|
230
|
+
// Build branch name if needed
|
|
231
|
+
const branchName = this.buildBranchName(context);
|
|
232
|
+
const content = {
|
|
233
|
+
commitMessage,
|
|
234
|
+
prDescription,
|
|
235
|
+
branchName
|
|
236
|
+
};
|
|
237
|
+
this.ctx.content = JSON.stringify(content, null, 2);
|
|
238
|
+
this.adjustConfidence(0.85); // Good confidence for generated content
|
|
239
|
+
if (this.spinner) {
|
|
240
|
+
this.spinner.succeed('Content generated');
|
|
241
|
+
}
|
|
242
|
+
else {
|
|
243
|
+
console.log(chalk.gray(' ✓ Content generated'));
|
|
244
|
+
}
|
|
245
|
+
return this;
|
|
246
|
+
}
|
|
247
|
+
/**
|
|
248
|
+
* Validate generated output
|
|
249
|
+
*/
|
|
250
|
+
validateOutput() {
|
|
251
|
+
if (!this.ctx.content) {
|
|
252
|
+
this.addError('No content generated');
|
|
253
|
+
this.adjustConfidence(0.5);
|
|
254
|
+
return this;
|
|
255
|
+
}
|
|
256
|
+
try {
|
|
257
|
+
const content = JSON.parse(this.ctx.content);
|
|
258
|
+
// Validate commit message
|
|
259
|
+
if (!content.commitMessage || content.commitMessage.length < 10) {
|
|
260
|
+
this.addError('Commit message too short');
|
|
261
|
+
this.adjustConfidence(0.7);
|
|
262
|
+
}
|
|
263
|
+
// Validate conventional format
|
|
264
|
+
const conventionalPattern = /^(feat|fix|docs|style|refactor|perf|test|build|ci|chore|revert)(\(.+\))?: .+/;
|
|
265
|
+
if (!conventionalPattern.test(content.commitMessage.split('\n')[0])) {
|
|
266
|
+
this.addError('Commit message does not follow conventional format');
|
|
267
|
+
this.adjustConfidence(0.8);
|
|
268
|
+
}
|
|
269
|
+
// Validate PR description
|
|
270
|
+
if (!content.prDescription || content.prDescription.length < 50) {
|
|
271
|
+
this.addError('PR description too short');
|
|
272
|
+
this.adjustConfidence(0.7);
|
|
273
|
+
}
|
|
274
|
+
// Validate branch name
|
|
275
|
+
if (content.branchName && !/^[a-z-]+\/[a-z0-9-]+$/.test(content.branchName)) {
|
|
276
|
+
this.addError('Branch name format invalid');
|
|
277
|
+
this.adjustConfidence(0.9); // Minor issue
|
|
278
|
+
}
|
|
279
|
+
}
|
|
280
|
+
catch (error) {
|
|
281
|
+
this.addError('Failed to parse generated content');
|
|
282
|
+
this.adjustConfidence(0.3);
|
|
283
|
+
}
|
|
284
|
+
return this;
|
|
285
|
+
}
|
|
286
|
+
/**
|
|
287
|
+
* Execute ship operations
|
|
288
|
+
*/
|
|
289
|
+
async executeShip() {
|
|
290
|
+
const context = this.ctx.context;
|
|
291
|
+
const content = JSON.parse(this.ctx.content || '{}');
|
|
292
|
+
if (this.spinner) {
|
|
293
|
+
this.spinner.start('Shipping changes...');
|
|
294
|
+
}
|
|
295
|
+
else {
|
|
296
|
+
console.log(chalk.bold('\n🚢 Shipping Changes\n'));
|
|
297
|
+
}
|
|
298
|
+
try {
|
|
299
|
+
// 1. Check for uncommitted changes
|
|
300
|
+
if (context.status.files.length > 0) {
|
|
301
|
+
if (this.spinner) {
|
|
302
|
+
this.spinner.text = 'Staging changes...';
|
|
303
|
+
}
|
|
304
|
+
await this.git.add('.');
|
|
305
|
+
// 2. Create commit
|
|
306
|
+
if (this.spinner) {
|
|
307
|
+
this.spinner.text = 'Creating commit...';
|
|
308
|
+
}
|
|
309
|
+
const commitMsg = content.commitMessage + '\n\n🚢 Shipped with Ginko CLI\n\nCo-authored-by: Ginko <ship@ginko.ai>';
|
|
310
|
+
await this.git.commit(commitMsg);
|
|
311
|
+
if (this.spinner) {
|
|
312
|
+
this.spinner.succeed('Changes committed');
|
|
313
|
+
}
|
|
314
|
+
else {
|
|
315
|
+
console.log(chalk.green(' ✅ Changes committed'));
|
|
316
|
+
}
|
|
317
|
+
}
|
|
318
|
+
else {
|
|
319
|
+
if (this.spinner) {
|
|
320
|
+
this.spinner.info('No uncommitted changes');
|
|
321
|
+
}
|
|
322
|
+
else {
|
|
323
|
+
console.log(chalk.gray(' ℹ No uncommitted changes'));
|
|
324
|
+
}
|
|
325
|
+
}
|
|
326
|
+
// 3. Handle branching
|
|
327
|
+
const currentBranch = context.currentBranch;
|
|
328
|
+
let targetBranch = currentBranch;
|
|
329
|
+
if (currentBranch === 'main' || currentBranch === 'master') {
|
|
330
|
+
// Create new branch
|
|
331
|
+
const newBranch = this.options.branch || content.branchName || this.generateBranchName(this.ctx.intent);
|
|
332
|
+
if (this.spinner) {
|
|
333
|
+
this.spinner.start(`Creating branch: ${newBranch}`);
|
|
334
|
+
}
|
|
335
|
+
await this.git.checkoutLocalBranch(newBranch);
|
|
336
|
+
targetBranch = newBranch;
|
|
337
|
+
if (this.spinner) {
|
|
338
|
+
this.spinner.succeed(`Created branch: ${newBranch}`);
|
|
339
|
+
}
|
|
340
|
+
else {
|
|
341
|
+
console.log(chalk.green(` ✅ Created branch: ${newBranch}`));
|
|
342
|
+
}
|
|
343
|
+
}
|
|
344
|
+
// 4. Push to remote (unless disabled)
|
|
345
|
+
if (!this.options.noPush) {
|
|
346
|
+
if (this.spinner) {
|
|
347
|
+
this.spinner.start('Pushing to remote...');
|
|
348
|
+
}
|
|
349
|
+
try {
|
|
350
|
+
await this.git.push('origin', targetBranch, ['--set-upstream']);
|
|
351
|
+
if (this.spinner) {
|
|
352
|
+
this.spinner.succeed('Pushed to remote');
|
|
353
|
+
}
|
|
354
|
+
else {
|
|
355
|
+
console.log(chalk.green(' ✅ Pushed to remote'));
|
|
356
|
+
}
|
|
357
|
+
}
|
|
358
|
+
catch (error) {
|
|
359
|
+
// Try without --set-upstream
|
|
360
|
+
try {
|
|
361
|
+
await this.git.push('origin', targetBranch);
|
|
362
|
+
if (this.spinner) {
|
|
363
|
+
this.spinner.succeed('Pushed to remote');
|
|
364
|
+
}
|
|
365
|
+
else {
|
|
366
|
+
console.log(chalk.green(' ✅ Pushed to remote'));
|
|
367
|
+
}
|
|
368
|
+
}
|
|
369
|
+
catch (pushError) {
|
|
370
|
+
if (this.spinner) {
|
|
371
|
+
this.spinner.fail('Push failed');
|
|
372
|
+
}
|
|
373
|
+
console.log(chalk.yellow(`\n Try manually: git push -u origin ${targetBranch}`));
|
|
374
|
+
}
|
|
375
|
+
}
|
|
376
|
+
}
|
|
377
|
+
// 5. Create PR (if gh CLI available)
|
|
378
|
+
if (this.checkCommand('gh --version')) {
|
|
379
|
+
if (this.spinner) {
|
|
380
|
+
this.spinner.start('Creating pull request...');
|
|
381
|
+
}
|
|
382
|
+
try {
|
|
383
|
+
const prTitle = content.commitMessage.split('\n')[0];
|
|
384
|
+
const prBody = content.prDescription;
|
|
385
|
+
// Escape quotes in PR body
|
|
386
|
+
const escapedBody = prBody.replace(/"/g, '\\"').replace(/\n/g, '\\n');
|
|
387
|
+
const prCmd = `gh pr create --title "${prTitle}" --body "${escapedBody}"`;
|
|
388
|
+
const prOutput = execSync(prCmd, { encoding: 'utf8' });
|
|
389
|
+
if (this.spinner) {
|
|
390
|
+
this.spinner.succeed('Pull request created');
|
|
391
|
+
}
|
|
392
|
+
else {
|
|
393
|
+
console.log(chalk.green(' ✅ Pull request created'));
|
|
394
|
+
}
|
|
395
|
+
// Extract PR URL
|
|
396
|
+
const urlMatch = prOutput.match(/https:\/\/github\.com\/[^\s]+/);
|
|
397
|
+
if (urlMatch) {
|
|
398
|
+
console.log(chalk.green('\n✅ PR URL: ') + chalk.cyan(urlMatch[0]));
|
|
399
|
+
}
|
|
400
|
+
}
|
|
401
|
+
catch (error) {
|
|
402
|
+
if (this.spinner) {
|
|
403
|
+
this.spinner.info('Could not create PR automatically');
|
|
404
|
+
}
|
|
405
|
+
console.log(chalk.dim(' Create manually at GitHub or install gh CLI'));
|
|
406
|
+
// Save PR description for manual use
|
|
407
|
+
const prDescPath = path.join(this.ginkoDir, '.temp', 'pr-description.md');
|
|
408
|
+
await fs.ensureDir(path.dirname(prDescPath));
|
|
409
|
+
await fs.writeFile(prDescPath, content.prDescription);
|
|
410
|
+
console.log(chalk.dim(` PR description saved: ${prDescPath}`));
|
|
411
|
+
}
|
|
412
|
+
}
|
|
413
|
+
else {
|
|
414
|
+
if (this.spinner) {
|
|
415
|
+
this.spinner.info('GitHub CLI not found');
|
|
416
|
+
}
|
|
417
|
+
console.log(chalk.dim(' Install gh CLI for automatic PR creation'));
|
|
418
|
+
}
|
|
419
|
+
// Success summary
|
|
420
|
+
console.log(chalk.green('\n✅ Ship complete!'));
|
|
421
|
+
console.log(chalk.dim('\nNext steps:'));
|
|
422
|
+
console.log(chalk.dim(' • Review PR on GitHub'));
|
|
423
|
+
console.log(chalk.dim(' • Request reviews if needed'));
|
|
424
|
+
console.log(chalk.dim(' • Monitor CI/CD pipeline'));
|
|
425
|
+
}
|
|
426
|
+
catch (error) {
|
|
427
|
+
if (this.spinner) {
|
|
428
|
+
this.spinner.fail('Ship failed');
|
|
429
|
+
}
|
|
430
|
+
this.addError(`Ship execution failed: ${error}`);
|
|
431
|
+
this.adjustConfidence(0.2);
|
|
432
|
+
throw error;
|
|
433
|
+
}
|
|
434
|
+
return this;
|
|
435
|
+
}
|
|
436
|
+
/**
|
|
437
|
+
* Custom validation
|
|
438
|
+
*/
|
|
439
|
+
customValidate() {
|
|
440
|
+
const context = this.ctx.context;
|
|
441
|
+
if (!context) {
|
|
442
|
+
this.addError('Context not gathered');
|
|
443
|
+
this.adjustConfidence(0.5);
|
|
444
|
+
return;
|
|
445
|
+
}
|
|
446
|
+
// Check test results if tests were run
|
|
447
|
+
if (context.testResults && !context.testResults.passed) {
|
|
448
|
+
this.addError('Tests failed');
|
|
449
|
+
this.adjustConfidence(0.6);
|
|
450
|
+
console.log(chalk.red('\n❌ Tests failed - fix before shipping'));
|
|
451
|
+
console.log(chalk.dim('Skip tests with: ginko ship --no-tests'));
|
|
452
|
+
}
|
|
453
|
+
// Warn if breaking changes detected
|
|
454
|
+
if (context.breakingChanges) {
|
|
455
|
+
console.log(chalk.yellow('\n⚠️ Breaking changes detected - ensure they are documented'));
|
|
456
|
+
this.adjustConfidence(0.9); // Minor reduction
|
|
457
|
+
}
|
|
458
|
+
}
|
|
459
|
+
/**
|
|
460
|
+
* Custom recovery
|
|
461
|
+
*/
|
|
462
|
+
customRecover() {
|
|
463
|
+
// If tests failed but user wants to continue, allow it
|
|
464
|
+
if (this.ctx.errors.includes('Tests failed') && this.options.noTests) {
|
|
465
|
+
this.removeError('Tests failed');
|
|
466
|
+
this.adjustConfidence(1.1);
|
|
467
|
+
}
|
|
468
|
+
}
|
|
469
|
+
/**
|
|
470
|
+
* Custom execution
|
|
471
|
+
*/
|
|
472
|
+
async customExecute() {
|
|
473
|
+
// Ensure we have content
|
|
474
|
+
if (!this.ctx.content) {
|
|
475
|
+
this.generateContent();
|
|
476
|
+
}
|
|
477
|
+
// Validate output
|
|
478
|
+
if (!this.getErrors().includes('No content generated')) {
|
|
479
|
+
this.validateOutput();
|
|
480
|
+
}
|
|
481
|
+
}
|
|
482
|
+
/**
|
|
483
|
+
* Main build method
|
|
484
|
+
*/
|
|
485
|
+
async build() {
|
|
486
|
+
try {
|
|
487
|
+
console.log(chalk.bold.cyan('\n🚀 Ship Pipeline Starting\n'));
|
|
488
|
+
await this
|
|
489
|
+
.initialize()
|
|
490
|
+
.then(p => p.loadTemplate())
|
|
491
|
+
.then(p => p.gatherContext())
|
|
492
|
+
.then(p => {
|
|
493
|
+
p.generateContent();
|
|
494
|
+
p.validateOutput();
|
|
495
|
+
return p;
|
|
496
|
+
})
|
|
497
|
+
.then(p => p.validate())
|
|
498
|
+
.then(p => {
|
|
499
|
+
p.recover();
|
|
500
|
+
return p;
|
|
501
|
+
})
|
|
502
|
+
.then(p => p.executeShip())
|
|
503
|
+
.then(p => p.execute());
|
|
504
|
+
console.log(chalk.bold.green('\n✨ Ship pipeline completed successfully!\n'));
|
|
505
|
+
return this.ctx.content || '';
|
|
506
|
+
}
|
|
507
|
+
catch (error) {
|
|
508
|
+
console.error(chalk.red(`\n❌ Ship failed: ${error}`));
|
|
509
|
+
throw error;
|
|
510
|
+
}
|
|
511
|
+
}
|
|
512
|
+
// ======================
|
|
513
|
+
// Helper Methods
|
|
514
|
+
// ======================
|
|
515
|
+
/**
|
|
516
|
+
* Analyze changes from git diff
|
|
517
|
+
*/
|
|
518
|
+
analyzeChanges(diff, diffStat) {
|
|
519
|
+
const lines = diffStat.split('\n');
|
|
520
|
+
const lastLine = lines[lines.length - 2] || '';
|
|
521
|
+
const additions = parseInt(lastLine.match(/(\d+) insertion/)?.[1] || '0');
|
|
522
|
+
const deletions = parseInt(lastLine.match(/(\d+) deletion/)?.[1] || '0');
|
|
523
|
+
const hasNewFiles = diff.includes('new file mode');
|
|
524
|
+
const hasDeletedFiles = diff.includes('deleted file mode');
|
|
525
|
+
const hasRenames = diff.includes('rename from');
|
|
526
|
+
return {
|
|
527
|
+
additions,
|
|
528
|
+
deletions,
|
|
529
|
+
hasNewFiles,
|
|
530
|
+
hasDeletedFiles,
|
|
531
|
+
hasRenames,
|
|
532
|
+
fileCount: lines.length - 2
|
|
533
|
+
};
|
|
534
|
+
}
|
|
535
|
+
/**
|
|
536
|
+
* Detect commit type from changes and message
|
|
537
|
+
*/
|
|
538
|
+
detectCommitType(analysis, message) {
|
|
539
|
+
const msgLower = message?.toLowerCase() || '';
|
|
540
|
+
if (msgLower.includes('fix') || msgLower.includes('bug'))
|
|
541
|
+
return 'fix';
|
|
542
|
+
if (msgLower.includes('feat') || msgLower.includes('add'))
|
|
543
|
+
return 'feat';
|
|
544
|
+
if (msgLower.includes('refactor'))
|
|
545
|
+
return 'refactor';
|
|
546
|
+
if (msgLower.includes('doc'))
|
|
547
|
+
return 'docs';
|
|
548
|
+
if (msgLower.includes('test'))
|
|
549
|
+
return 'test';
|
|
550
|
+
if (msgLower.includes('style') || msgLower.includes('format'))
|
|
551
|
+
return 'style';
|
|
552
|
+
if (msgLower.includes('perf'))
|
|
553
|
+
return 'perf';
|
|
554
|
+
if (msgLower.includes('build'))
|
|
555
|
+
return 'build';
|
|
556
|
+
if (msgLower.includes('ci'))
|
|
557
|
+
return 'ci';
|
|
558
|
+
// Infer from changes
|
|
559
|
+
if (analysis.hasNewFiles)
|
|
560
|
+
return 'feat';
|
|
561
|
+
if (analysis.deletions > analysis.additions)
|
|
562
|
+
return 'refactor';
|
|
563
|
+
return 'chore';
|
|
564
|
+
}
|
|
565
|
+
/**
|
|
566
|
+
* Detect breaking changes in diff
|
|
567
|
+
*/
|
|
568
|
+
detectBreakingChanges(diff) {
|
|
569
|
+
const breakingPatterns = [
|
|
570
|
+
/removed?\s+\w+\s*\(/i,
|
|
571
|
+
/deleted?\s+\w+/i,
|
|
572
|
+
/breaking/i,
|
|
573
|
+
/incompatible/i,
|
|
574
|
+
/migration/i,
|
|
575
|
+
/deprecated/i
|
|
576
|
+
];
|
|
577
|
+
return breakingPatterns.some(pattern => pattern.test(diff));
|
|
578
|
+
}
|
|
579
|
+
/**
|
|
580
|
+
* Run tests
|
|
581
|
+
*/
|
|
582
|
+
async runTests() {
|
|
583
|
+
try {
|
|
584
|
+
// Check if test script exists
|
|
585
|
+
let hasTests = false;
|
|
586
|
+
try {
|
|
587
|
+
const packageJson = JSON.parse(await fs.readFile('package.json', 'utf-8'));
|
|
588
|
+
hasTests = !!(packageJson.scripts?.test &&
|
|
589
|
+
packageJson.scripts.test !== 'echo "Error: no test specified" && exit 1');
|
|
590
|
+
}
|
|
591
|
+
catch {
|
|
592
|
+
// No package.json
|
|
593
|
+
}
|
|
594
|
+
if (!hasTests) {
|
|
595
|
+
return { passed: true, output: 'No tests configured' };
|
|
596
|
+
}
|
|
597
|
+
execSync('npm test', { stdio: 'pipe' });
|
|
598
|
+
return { passed: true, output: 'All tests passed' };
|
|
599
|
+
}
|
|
600
|
+
catch (error) {
|
|
601
|
+
return { passed: false, output: 'Tests failed' };
|
|
602
|
+
}
|
|
603
|
+
}
|
|
604
|
+
/**
|
|
605
|
+
* Build commit message
|
|
606
|
+
*/
|
|
607
|
+
buildCommitMessage(context) {
|
|
608
|
+
const type = context.commitType;
|
|
609
|
+
const subject = context.userMessage || 'Update changes';
|
|
610
|
+
// Extract subject (first line, imperative mood)
|
|
611
|
+
const firstLine = subject.split('\n')[0].slice(0, 50);
|
|
612
|
+
// Build body
|
|
613
|
+
const body = [
|
|
614
|
+
`Files changed: ${context.changeAnalysis.fileCount}`,
|
|
615
|
+
`Lines: +${context.changeAnalysis.additions} -${context.changeAnalysis.deletions}`,
|
|
616
|
+
];
|
|
617
|
+
if (context.changeAnalysis.hasNewFiles) {
|
|
618
|
+
body.push('New files added');
|
|
619
|
+
}
|
|
620
|
+
if (context.changeAnalysis.hasDeletedFiles) {
|
|
621
|
+
body.push('Files removed');
|
|
622
|
+
}
|
|
623
|
+
let message = `${type}: ${firstLine}\n\n${body.join('\n')}`;
|
|
624
|
+
// Add breaking change footer if detected
|
|
625
|
+
if (context.breakingChanges) {
|
|
626
|
+
message += '\n\nBREAKING CHANGE: This update includes breaking changes';
|
|
627
|
+
}
|
|
628
|
+
return message;
|
|
629
|
+
}
|
|
630
|
+
/**
|
|
631
|
+
* Build PR description
|
|
632
|
+
*/
|
|
633
|
+
buildPRDescription(context) {
|
|
634
|
+
const sections = [];
|
|
635
|
+
sections.push('## Summary');
|
|
636
|
+
sections.push(context.userMessage || 'Changes from development session\n');
|
|
637
|
+
sections.push('## What Changed');
|
|
638
|
+
sections.push(`- ${context.changeAnalysis.fileCount} files modified`);
|
|
639
|
+
sections.push(`- ${context.changeAnalysis.additions} lines added`);
|
|
640
|
+
sections.push(`- ${context.changeAnalysis.deletions} lines removed`);
|
|
641
|
+
if (context.changeAnalysis.hasNewFiles)
|
|
642
|
+
sections.push('- New files created');
|
|
643
|
+
if (context.changeAnalysis.hasDeletedFiles)
|
|
644
|
+
sections.push('- Files deleted');
|
|
645
|
+
sections.push('');
|
|
646
|
+
sections.push('## Why');
|
|
647
|
+
sections.push('See commit messages for detailed rationale\n');
|
|
648
|
+
sections.push('## How');
|
|
649
|
+
sections.push('Implementation follows established patterns\n');
|
|
650
|
+
sections.push('## Testing');
|
|
651
|
+
if (context.testResults) {
|
|
652
|
+
sections.push(context.testResults.passed ? '✅ All tests passing' : '❌ Tests need attention');
|
|
653
|
+
}
|
|
654
|
+
else {
|
|
655
|
+
sections.push('Tests not run');
|
|
656
|
+
}
|
|
657
|
+
sections.push('');
|
|
658
|
+
if (context.breakingChanges) {
|
|
659
|
+
sections.push('## ⚠️ Breaking Changes');
|
|
660
|
+
sections.push('This PR includes breaking changes. Review carefully.\n');
|
|
661
|
+
}
|
|
662
|
+
sections.push('---');
|
|
663
|
+
sections.push('🚢 Shipped with Ginko CLI');
|
|
664
|
+
return sections.join('\n');
|
|
665
|
+
}
|
|
666
|
+
/**
|
|
667
|
+
* Build branch name
|
|
668
|
+
*/
|
|
669
|
+
buildBranchName(context) {
|
|
670
|
+
const type = context.commitType;
|
|
671
|
+
const message = context.userMessage || 'update';
|
|
672
|
+
const slug = message
|
|
673
|
+
.toLowerCase()
|
|
674
|
+
.replace(/[^a-z0-9\s]/g, '')
|
|
675
|
+
.split(' ')
|
|
676
|
+
.slice(0, 3)
|
|
677
|
+
.join('-');
|
|
678
|
+
return `${type}/${slug}-${Date.now().toString(36)}`;
|
|
679
|
+
}
|
|
680
|
+
/**
|
|
681
|
+
* Generate branch name from message
|
|
682
|
+
*/
|
|
683
|
+
generateBranchName(message) {
|
|
684
|
+
if (message) {
|
|
685
|
+
const slug = message
|
|
686
|
+
.toLowerCase()
|
|
687
|
+
.replace(/[^a-z0-9\s]/g, '')
|
|
688
|
+
.split(' ')
|
|
689
|
+
.slice(0, 3)
|
|
690
|
+
.join('-');
|
|
691
|
+
return `ship/${slug}-${Date.now().toString(36)}`;
|
|
692
|
+
}
|
|
693
|
+
return `ship/update-${Date.now().toString(36)}`;
|
|
694
|
+
}
|
|
695
|
+
/**
|
|
696
|
+
* Check if command exists
|
|
697
|
+
*/
|
|
698
|
+
checkCommand(cmd) {
|
|
699
|
+
try {
|
|
700
|
+
execSync(cmd, { stdio: 'pipe' });
|
|
701
|
+
return true;
|
|
702
|
+
}
|
|
703
|
+
catch {
|
|
704
|
+
return false;
|
|
705
|
+
}
|
|
706
|
+
}
|
|
707
|
+
}
|
|
708
|
+
/**
|
|
709
|
+
* Adapter for CLI command usage
|
|
710
|
+
* Maintains backward compatibility with existing command structure
|
|
711
|
+
*/
|
|
712
|
+
export class ShipReflectionCommand {
|
|
713
|
+
pipeline;
|
|
714
|
+
constructor(message, options = {}) {
|
|
715
|
+
this.pipeline = new ShipReflectionPipeline(message, options);
|
|
716
|
+
}
|
|
717
|
+
/**
|
|
718
|
+
* Execute the ship command
|
|
719
|
+
*/
|
|
720
|
+
async execute() {
|
|
721
|
+
try {
|
|
722
|
+
await this.pipeline.build();
|
|
723
|
+
}
|
|
724
|
+
catch (error) {
|
|
725
|
+
console.error(chalk.red(`Ship failed: ${error}`));
|
|
726
|
+
throw error;
|
|
727
|
+
}
|
|
728
|
+
}
|
|
729
|
+
}
|
|
730
|
+
// Export for CLI use
|
|
731
|
+
export default ShipReflectionCommand;
|
|
732
|
+
//# sourceMappingURL=ship-reflection.js.map
|