prjct-cli 0.11.4 → 0.12.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/CHANGELOG.md +72 -0
- package/README.md +81 -25
- package/bin/dev.js +1 -1
- package/bin/generate-views.js +209 -0
- package/bin/migrate-to-json.js +742 -0
- package/bin/prjct +5 -5
- package/bin/serve.js +246 -54
- package/core/__tests__/agentic/{memory-system.test.js → memory-system.test.ts} +12 -23
- package/core/__tests__/agentic/{plan-mode.test.js → plan-mode.test.ts} +26 -24
- package/core/__tests__/agentic/{prompt-builder.test.js → prompt-builder.test.ts} +3 -8
- package/core/__tests__/utils/date-helper.test.ts +405 -0
- package/core/__tests__/utils/{output.test.js → output.test.ts} +12 -24
- package/core/agentic/agent-router.ts +137 -0
- package/core/agentic/chain-of-thought.ts +228 -0
- package/core/agentic/command-executor/command-executor.ts +384 -0
- package/core/agentic/command-executor/index.ts +16 -0
- package/core/agentic/command-executor/status-signal.ts +38 -0
- package/core/agentic/command-executor/types.ts +79 -0
- package/core/agentic/command-executor.ts +8 -0
- package/core/agentic/{context-builder.js → context-builder.ts} +99 -89
- package/core/agentic/context-filter.ts +365 -0
- package/core/agentic/ground-truth/index.ts +76 -0
- package/core/agentic/ground-truth/types.ts +33 -0
- package/core/agentic/ground-truth/utils.ts +48 -0
- package/core/agentic/ground-truth/verifiers/analyze.ts +54 -0
- package/core/agentic/ground-truth/verifiers/done.ts +75 -0
- package/core/agentic/ground-truth/verifiers/feature.ts +70 -0
- package/core/agentic/ground-truth/verifiers/index.ts +37 -0
- package/core/agentic/ground-truth/verifiers/init.ts +52 -0
- package/core/agentic/ground-truth/verifiers/now.ts +57 -0
- package/core/agentic/ground-truth/verifiers/ship.ts +85 -0
- package/core/agentic/ground-truth/verifiers/spec.ts +45 -0
- package/core/agentic/ground-truth/verifiers/sync.ts +47 -0
- package/core/agentic/ground-truth/verifiers.ts +6 -0
- package/core/agentic/ground-truth.ts +8 -0
- package/core/agentic/loop-detector/error-analysis.ts +97 -0
- package/core/agentic/loop-detector/hallucination.ts +71 -0
- package/core/agentic/loop-detector/index.ts +41 -0
- package/core/agentic/loop-detector/loop-detector.ts +222 -0
- package/core/agentic/loop-detector/types.ts +66 -0
- package/core/agentic/loop-detector.ts +8 -0
- package/core/agentic/memory-system/history.ts +53 -0
- package/core/agentic/memory-system/index.ts +192 -0
- package/core/agentic/memory-system/patterns.ts +156 -0
- package/core/agentic/memory-system/semantic-memories.ts +277 -0
- package/core/agentic/memory-system/session.ts +21 -0
- package/core/agentic/memory-system/types.ts +159 -0
- package/core/agentic/memory-system.ts +8 -0
- package/core/agentic/parallel-tools.ts +165 -0
- package/core/agentic/plan-mode/approval.ts +57 -0
- package/core/agentic/plan-mode/constants.ts +44 -0
- package/core/agentic/plan-mode/index.ts +28 -0
- package/core/agentic/plan-mode/plan-mode.ts +406 -0
- package/core/agentic/plan-mode/types.ts +193 -0
- package/core/agentic/plan-mode.ts +8 -0
- package/core/agentic/prompt-builder.ts +566 -0
- package/core/agentic/response-templates.ts +164 -0
- package/core/agentic/semantic-compression.ts +273 -0
- package/core/agentic/services.ts +206 -0
- package/core/agentic/smart-context.ts +476 -0
- package/core/agentic/{template-loader.js → template-loader.ts} +35 -18
- package/core/agentic/think-blocks.ts +202 -0
- package/core/agentic/tool-registry.ts +119 -0
- package/core/agentic/validation-rules.ts +313 -0
- package/core/agents/index.ts +28 -0
- package/core/agents/performance.ts +444 -0
- package/core/agents/types.ts +126 -0
- package/core/bus/{index.js → index.ts} +57 -61
- package/core/command-registry/categories.ts +23 -0
- package/core/command-registry/commands.ts +15 -0
- package/core/command-registry/core-commands.ts +319 -0
- package/core/command-registry/index.ts +158 -0
- package/core/command-registry/optional-commands.ts +119 -0
- package/core/command-registry/setup-commands.ts +53 -0
- package/core/command-registry/types.ts +59 -0
- package/core/command-registry.ts +9 -0
- package/core/commands/analysis.ts +298 -0
- package/core/commands/analytics.ts +288 -0
- package/core/commands/base.ts +273 -0
- package/core/commands/index.ts +211 -0
- package/core/commands/maintenance.ts +226 -0
- package/core/commands/planning.ts +311 -0
- package/core/commands/setup.ts +309 -0
- package/core/commands/shipping.ts +188 -0
- package/core/commands/types.ts +183 -0
- package/core/commands/workflow.ts +226 -0
- package/core/commands.ts +11 -0
- package/core/constants/formats.ts +187 -0
- package/core/constants/index.ts +7 -0
- package/core/{context-sync.js → context-sync.ts} +59 -26
- package/core/data/agents-manager.ts +76 -0
- package/core/data/analysis-manager.ts +83 -0
- package/core/data/base-manager.ts +156 -0
- package/core/data/ideas-manager.ts +81 -0
- package/core/data/index.ts +32 -0
- package/core/data/outcomes-manager.ts +96 -0
- package/core/data/project-manager.ts +75 -0
- package/core/data/roadmap-manager.ts +118 -0
- package/core/data/shipped-manager.ts +65 -0
- package/core/data/state-manager.ts +214 -0
- package/core/domain/{agent-generator.js → agent-generator.ts} +77 -57
- package/core/domain/{agent-loader.js → agent-loader.ts} +65 -56
- package/core/domain/{agent-matcher.js → agent-matcher.ts} +51 -24
- package/core/domain/{agent-validator.js → agent-validator.ts} +70 -37
- package/core/domain/{analyzer.js → analyzer.ts} +91 -85
- package/core/domain/{architect-session.js → architect-session.ts} +49 -34
- package/core/domain/{architecture-generator.js → architecture-generator.ts} +25 -13
- package/core/domain/{context-estimator.js → context-estimator.ts} +57 -36
- package/core/domain/{product-standards.js → product-standards.ts} +40 -26
- package/core/domain/{smart-cache.js → smart-cache.ts} +39 -30
- package/core/domain/{snapshot-manager.js → snapshot-manager.ts} +103 -100
- package/core/domain/{task-analyzer.js → task-analyzer.ts} +82 -43
- package/core/domain/task-stack/index.ts +19 -0
- package/core/domain/task-stack/parser.ts +86 -0
- package/core/domain/task-stack/storage.ts +123 -0
- package/core/domain/task-stack/task-stack.ts +340 -0
- package/core/domain/task-stack/types.ts +51 -0
- package/core/domain/task-stack.ts +8 -0
- package/core/{index.js → index.ts} +61 -18
- package/core/infrastructure/{agent-detector.js → agent-detector.ts} +62 -23
- package/core/infrastructure/agents/{claude-agent.js → claude-agent.ts} +61 -21
- package/core/infrastructure/{author-detector.js → author-detector.ts} +42 -49
- package/core/infrastructure/{capability-installer.js → capability-installer.ts} +51 -27
- package/core/infrastructure/{command-installer.js → command-installer/command-installer.ts} +43 -144
- package/core/infrastructure/command-installer/global-config.ts +106 -0
- package/core/infrastructure/command-installer/index.ts +25 -0
- package/core/infrastructure/command-installer/types.ts +41 -0
- package/core/infrastructure/command-installer.ts +8 -0
- package/core/infrastructure/{config-manager.js → config-manager.ts} +60 -80
- package/core/infrastructure/{editors-config.js → editors-config.ts} +33 -31
- package/core/infrastructure/legacy-installer-detector/cleanup.ts +216 -0
- package/core/infrastructure/legacy-installer-detector/detection.ts +95 -0
- package/core/infrastructure/legacy-installer-detector/index.ts +171 -0
- package/core/infrastructure/legacy-installer-detector/migration.ts +87 -0
- package/core/infrastructure/legacy-installer-detector/types.ts +42 -0
- package/core/infrastructure/legacy-installer-detector.ts +7 -0
- package/core/infrastructure/migrator/file-operations.ts +125 -0
- package/core/infrastructure/migrator/index.ts +288 -0
- package/core/infrastructure/migrator/project-scanner.ts +89 -0
- package/core/infrastructure/migrator/reports.ts +117 -0
- package/core/infrastructure/migrator/types.ts +124 -0
- package/core/infrastructure/migrator/validation.ts +94 -0
- package/core/infrastructure/migrator/version-migration.ts +117 -0
- package/core/infrastructure/migrator.ts +10 -0
- package/core/infrastructure/{path-manager.js → path-manager.ts} +51 -91
- package/core/infrastructure/session-manager/index.ts +23 -0
- package/core/infrastructure/session-manager/migration.ts +88 -0
- package/core/infrastructure/session-manager/session-manager.ts +307 -0
- package/core/infrastructure/session-manager/types.ts +45 -0
- package/core/infrastructure/session-manager.ts +8 -0
- package/core/infrastructure/{setup.js → setup.ts} +29 -21
- package/core/infrastructure/{update-checker.js → update-checker.ts} +40 -18
- package/core/outcomes/analyzer.ts +333 -0
- package/core/outcomes/index.ts +34 -0
- package/core/outcomes/recorder.ts +194 -0
- package/core/outcomes/types.ts +145 -0
- package/core/plugin/{hooks.js → hooks.ts} +56 -58
- package/core/plugin/{index.js → index.ts} +19 -8
- package/core/plugin/{loader.js → loader.ts} +87 -69
- package/core/plugin/{registry.js → registry.ts} +49 -45
- package/core/plugins/{webhook.js → webhook.ts} +43 -27
- package/core/schemas/agents.ts +27 -0
- package/core/schemas/analysis.ts +41 -0
- package/core/schemas/ideas.ts +83 -0
- package/core/schemas/index.ts +73 -0
- package/core/schemas/outcomes.ts +22 -0
- package/core/schemas/project.ts +26 -0
- package/core/schemas/roadmap.ts +90 -0
- package/core/schemas/shipped.ts +82 -0
- package/core/schemas/state.ts +107 -0
- package/core/session/index.ts +17 -0
- package/core/session/{metrics.js → metrics.ts} +64 -46
- package/core/session/{index.js → session-manager.ts} +51 -117
- package/core/session/types.ts +29 -0
- package/core/session/utils.ts +57 -0
- package/core/state/index.ts +25 -0
- package/core/state/manager.ts +376 -0
- package/core/state/types.ts +185 -0
- package/core/tsconfig.json +22 -0
- package/core/types/index.ts +506 -0
- package/core/utils/{animations.js → animations.ts} +74 -28
- package/core/utils/{branding.js → branding.ts} +29 -4
- package/core/utils/{date-helper.js → date-helper.ts} +31 -74
- package/core/utils/file-helper.ts +262 -0
- package/core/utils/{jsonl-helper.js → jsonl-helper.ts} +71 -107
- package/core/utils/{logger.js → logger.ts} +24 -12
- package/core/utils/{output.js → output.ts} +25 -13
- package/core/utils/{project-capabilities.js → project-capabilities.ts} +31 -18
- package/core/utils/{session-helper.js → session-helper.ts} +79 -66
- package/core/utils/{version.js → version.ts} +23 -31
- package/core/view-generator.ts +536 -0
- package/package.json +23 -17
- package/packages/shared/.turbo/turbo-build.log +14 -0
- package/packages/shared/dist/index.d.ts +8 -613
- package/packages/shared/dist/index.d.ts.map +1 -0
- package/packages/shared/dist/index.js +4110 -118
- package/packages/shared/dist/schemas.d.ts +408 -0
- package/packages/shared/dist/schemas.d.ts.map +1 -0
- package/packages/shared/dist/types.d.ts +144 -0
- package/packages/shared/dist/types.d.ts.map +1 -0
- package/packages/shared/dist/unified.d.ts +139 -0
- package/packages/shared/dist/unified.d.ts.map +1 -0
- package/packages/shared/dist/utils.d.ts +60 -0
- package/packages/shared/dist/utils.d.ts.map +1 -0
- package/packages/shared/package.json +4 -4
- package/packages/shared/src/index.ts +1 -0
- package/packages/shared/src/unified.ts +174 -0
- package/packages/web/app/api/claude/sessions/route.ts +1 -1
- package/packages/web/app/api/claude/status/route.ts +1 -1
- package/packages/web/app/api/migrate/route.ts +46 -0
- package/packages/web/app/api/projects/[id]/route.ts +1 -1
- package/packages/web/app/api/projects/[id]/stats/route.ts +30 -2
- package/packages/web/app/api/projects/[id]/status/route.ts +1 -1
- package/packages/web/app/api/projects/route.ts +1 -1
- package/packages/web/app/api/settings/route.ts +97 -0
- package/packages/web/app/api/v2/projects/[id]/unified/route.ts +57 -0
- package/packages/web/app/globals.css +38 -0
- package/packages/web/app/layout.tsx +10 -2
- package/packages/web/app/page.tsx +9 -224
- package/packages/web/app/project/[id]/page.tsx +191 -63
- package/packages/web/app/project/[id]/stats/loading.tsx +43 -0
- package/packages/web/app/project/[id]/stats/page.tsx +203 -403
- package/packages/web/app/settings/page.tsx +222 -2
- package/packages/web/components/ActivityTimeline/ActivityTimeline.constants.ts +2 -0
- package/packages/web/components/ActivityTimeline/ActivityTimeline.tsx +50 -0
- package/packages/web/components/ActivityTimeline/ActivityTimeline.types.ts +8 -0
- package/packages/web/components/ActivityTimeline/hooks/index.ts +2 -0
- package/packages/web/components/ActivityTimeline/hooks/useExpandable.ts +9 -0
- package/packages/web/components/ActivityTimeline/hooks/useGroupedEvents.ts +23 -0
- package/packages/web/components/ActivityTimeline/index.ts +2 -0
- package/packages/web/components/AgentsCard/AgentsCard.tsx +63 -0
- package/packages/web/components/AgentsCard/AgentsCard.types.ts +13 -0
- package/packages/web/components/AgentsCard/index.ts +2 -0
- package/packages/web/components/AppSidebar/AppSidebar.tsx +134 -0
- package/packages/web/components/AppSidebar/index.ts +1 -0
- package/packages/web/components/BackLink/BackLink.tsx +18 -0
- package/packages/web/components/BackLink/BackLink.types.ts +5 -0
- package/packages/web/components/BackLink/index.ts +2 -0
- package/packages/web/components/BentoCard/BentoCard.constants.ts +16 -0
- package/packages/web/components/BentoCard/BentoCard.tsx +47 -0
- package/packages/web/components/BentoCard/BentoCard.types.ts +15 -0
- package/packages/web/components/BentoCard/index.ts +2 -0
- package/packages/web/components/BentoCardSkeleton/BentoCardSkeleton.constants.ts +9 -0
- package/packages/web/components/BentoCardSkeleton/BentoCardSkeleton.tsx +18 -0
- package/packages/web/components/BentoCardSkeleton/BentoCardSkeleton.types.ts +5 -0
- package/packages/web/components/BentoCardSkeleton/index.ts +2 -0
- package/packages/web/components/BentoGrid/BentoGrid.tsx +18 -0
- package/packages/web/components/BentoGrid/BentoGrid.types.ts +4 -0
- package/packages/web/components/BentoGrid/index.ts +2 -0
- package/packages/web/components/CommandButton/index.ts +1 -0
- package/packages/web/components/ConnectionStatus/index.ts +1 -0
- package/packages/web/components/DashboardContent/DashboardContent.tsx +254 -0
- package/packages/web/components/DashboardContent/index.ts +1 -0
- package/packages/web/components/DateGroup/DateGroup.tsx +18 -0
- package/packages/web/components/DateGroup/DateGroup.types.ts +6 -0
- package/packages/web/components/DateGroup/DateGroup.utils.ts +11 -0
- package/packages/web/components/DateGroup/index.ts +2 -0
- package/packages/web/components/EmptyState/EmptyState.tsx +58 -0
- package/packages/web/components/EmptyState/EmptyState.types.ts +10 -0
- package/packages/web/components/EmptyState/index.ts +2 -0
- package/packages/web/components/EventRow/EventRow.constants.ts +10 -0
- package/packages/web/components/EventRow/EventRow.tsx +49 -0
- package/packages/web/components/EventRow/EventRow.types.ts +7 -0
- package/packages/web/components/EventRow/EventRow.utils.ts +49 -0
- package/packages/web/components/EventRow/index.ts +2 -0
- package/packages/web/components/ExpandButton/ExpandButton.tsx +18 -0
- package/packages/web/components/ExpandButton/ExpandButton.types.ts +6 -0
- package/packages/web/components/ExpandButton/index.ts +2 -0
- package/packages/web/components/HealthGradientBackground/HealthGradientBackground.tsx +14 -0
- package/packages/web/components/HealthGradientBackground/HealthGradientBackground.types.ts +5 -0
- package/packages/web/components/HealthGradientBackground/HealthGradientBackground.utils.ts +13 -0
- package/packages/web/components/HealthGradientBackground/index.ts +2 -0
- package/packages/web/components/HeroSection/HeroSection.tsx +55 -0
- package/packages/web/components/HeroSection/HeroSection.types.ts +14 -0
- package/packages/web/components/HeroSection/HeroSection.utils.ts +7 -0
- package/packages/web/components/HeroSection/hooks/index.ts +2 -0
- package/packages/web/components/HeroSection/hooks/useCountUp.ts +45 -0
- package/packages/web/components/HeroSection/hooks/useWeeklyActivity.ts +18 -0
- package/packages/web/components/HeroSection/index.ts +2 -0
- package/packages/web/components/IdeasCard/IdeasCard.tsx +48 -0
- package/packages/web/components/IdeasCard/IdeasCard.types.ts +9 -0
- package/packages/web/components/IdeasCard/index.ts +2 -0
- package/packages/web/components/InsightMessage/InsightMessage.tsx +9 -0
- package/packages/web/components/InsightMessage/InsightMessage.types.ts +3 -0
- package/packages/web/components/InsightMessage/index.ts +2 -0
- package/packages/web/components/Logo/index.ts +1 -0
- package/packages/web/components/MarkdownContent/index.ts +1 -0
- package/packages/web/components/NowCard/NowCard.tsx +93 -0
- package/packages/web/components/NowCard/NowCard.types.ts +15 -0
- package/packages/web/components/NowCard/index.ts +2 -0
- package/packages/web/components/ProgressRing/ProgressRing.constants.ts +20 -0
- package/packages/web/components/ProgressRing/ProgressRing.tsx +51 -0
- package/packages/web/components/ProgressRing/ProgressRing.types.ts +11 -0
- package/packages/web/components/ProgressRing/index.ts +2 -0
- package/packages/web/components/ProjectAvatar/index.ts +1 -0
- package/packages/web/components/Providers/index.ts +1 -0
- package/packages/web/components/QueueCard/QueueCard.tsx +72 -0
- package/packages/web/components/QueueCard/QueueCard.types.ts +11 -0
- package/packages/web/components/QueueCard/QueueCard.utils.ts +12 -0
- package/packages/web/components/QueueCard/index.ts +2 -0
- package/packages/web/components/RoadmapCard/RoadmapCard.tsx +77 -0
- package/packages/web/components/RoadmapCard/RoadmapCard.types.ts +15 -0
- package/packages/web/components/RoadmapCard/index.ts +2 -0
- package/packages/web/components/ShipsCard/ShipsCard.tsx +52 -0
- package/packages/web/components/ShipsCard/ShipsCard.types.ts +12 -0
- package/packages/web/components/ShipsCard/ShipsCard.utils.ts +4 -0
- package/packages/web/components/ShipsCard/index.ts +2 -0
- package/packages/web/components/SparklineChart/SparklineChart.tsx +38 -0
- package/packages/web/components/SparklineChart/SparklineChart.types.ts +6 -0
- package/packages/web/components/SparklineChart/index.ts +2 -0
- package/packages/web/components/StreakCard/StreakCard.constants.ts +2 -0
- package/packages/web/components/StreakCard/StreakCard.tsx +53 -0
- package/packages/web/components/StreakCard/StreakCard.types.ts +4 -0
- package/packages/web/components/StreakCard/index.ts +2 -0
- package/packages/web/components/TasksCounter/TasksCounter.tsx +14 -0
- package/packages/web/components/TasksCounter/TasksCounter.types.ts +3 -0
- package/packages/web/components/TasksCounter/index.ts +2 -0
- package/packages/web/components/TechStackBadges/index.ts +1 -0
- package/packages/web/components/{TerminalTab.tsx → TerminalTabs/TerminalTab.tsx} +11 -0
- package/packages/web/components/{TerminalTabs.tsx → TerminalTabs/TerminalTabs.tsx} +29 -28
- package/packages/web/components/TerminalTabs/index.ts +1 -0
- package/packages/web/components/VelocityBadge/VelocityBadge.tsx +27 -0
- package/packages/web/components/VelocityBadge/VelocityBadge.types.ts +3 -0
- package/packages/web/components/VelocityBadge/index.ts +2 -0
- package/packages/web/components/VelocityCard/VelocityCard.tsx +71 -0
- package/packages/web/components/VelocityCard/VelocityCard.types.ts +7 -0
- package/packages/web/components/VelocityCard/index.ts +2 -0
- package/packages/web/components/WeeklySparkline/WeeklySparkline.tsx +13 -0
- package/packages/web/components/WeeklySparkline/WeeklySparkline.types.ts +3 -0
- package/packages/web/components/WeeklySparkline/index.ts +2 -0
- package/packages/web/components/ui/input.tsx +21 -0
- package/packages/web/components/ui/tooltip.tsx +2 -2
- package/packages/web/context/TerminalTabsContext.tsx +46 -1
- package/packages/web/hooks/useClaudeTerminal.ts +71 -21
- package/packages/web/hooks/useProjectStats.ts +55 -0
- package/packages/web/hooks/useProjects.ts +6 -6
- package/packages/web/lib/actions/projects.ts +15 -0
- package/packages/web/lib/json-loader.ts +630 -0
- package/packages/web/lib/services/index.ts +9 -0
- package/packages/web/lib/services/migration.server.ts +598 -0
- package/packages/web/lib/services/projects.server.ts +52 -0
- package/packages/web/lib/services/stats.server.ts +264 -0
- package/packages/web/lib/unified-loader.ts +396 -0
- package/packages/web/next-env.d.ts +1 -1
- package/packages/web/package.json +10 -6
- package/packages/web/server.ts +36 -6
- package/templates/commands/done.md +76 -32
- package/templates/commands/feature.md +121 -47
- package/templates/commands/idea.md +81 -8
- package/templates/commands/now.md +41 -17
- package/templates/commands/ship.md +64 -25
- package/templates/commands/sync.md +28 -3
- package/core/agentic/agent-router.js +0 -128
- package/core/agentic/chain-of-thought.js +0 -578
- package/core/agentic/command-executor.js +0 -421
- package/core/agentic/context-filter.js +0 -354
- package/core/agentic/ground-truth.js +0 -591
- package/core/agentic/loop-detector.js +0 -406
- package/core/agentic/memory-system.js +0 -850
- package/core/agentic/parallel-tools.js +0 -366
- package/core/agentic/plan-mode.js +0 -572
- package/core/agentic/prompt-builder.js +0 -338
- package/core/agentic/response-templates.js +0 -290
- package/core/agentic/semantic-compression.js +0 -517
- package/core/agentic/think-blocks.js +0 -657
- package/core/agentic/tool-registry.js +0 -184
- package/core/agentic/validation-rules.js +0 -380
- package/core/command-registry.js +0 -698
- package/core/commands.js +0 -2237
- package/core/domain/task-stack.js +0 -497
- package/core/infrastructure/legacy-installer-detector.js +0 -546
- package/core/infrastructure/migrator.js +0 -799
- package/core/infrastructure/session-manager.js +0 -390
- package/core/utils/file-helper.js +0 -329
- package/packages/web/app/api/projects/[id]/delete/route.ts +0 -21
- package/packages/web/app/api/stats/route.ts +0 -38
- package/packages/web/components/AppSidebar.tsx +0 -113
- package/packages/web/hooks/useStats.ts +0 -28
- /package/packages/web/components/{CommandButton.tsx → CommandButton/CommandButton.tsx} +0 -0
- /package/packages/web/components/{ConnectionStatus.tsx → ConnectionStatus/ConnectionStatus.tsx} +0 -0
- /package/packages/web/components/{Logo.tsx → Logo/Logo.tsx} +0 -0
- /package/packages/web/components/{MarkdownContent.tsx → MarkdownContent/MarkdownContent.tsx} +0 -0
- /package/packages/web/components/{ProjectAvatar.tsx → ProjectAvatar/ProjectAvatar.tsx} +0 -0
- /package/packages/web/components/{providers.tsx → Providers/Providers.tsx} +0 -0
- /package/packages/web/components/{TechStackBadges.tsx → TechStackBadges/TechStackBadges.tsx} +0 -0
|
@@ -6,12 +6,30 @@
|
|
|
6
6
|
* @version 1.0.0
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
9
|
+
import fs from 'fs/promises'
|
|
10
|
+
import path from 'path'
|
|
11
|
+
import pathManager from '../infrastructure/path-manager'
|
|
12
|
+
import { pluginLoader } from './loader'
|
|
13
|
+
|
|
14
|
+
type PluginSource = 'builtin' | 'global' | 'project'
|
|
15
|
+
|
|
16
|
+
interface PluginMetadata {
|
|
17
|
+
name: string
|
|
18
|
+
version: string
|
|
19
|
+
description: string
|
|
20
|
+
path?: string
|
|
21
|
+
source?: PluginSource
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
interface PluginInfo extends PluginMetadata {
|
|
25
|
+
loaded: boolean
|
|
26
|
+
active: boolean
|
|
27
|
+
}
|
|
13
28
|
|
|
14
29
|
class PluginRegistry {
|
|
30
|
+
private availablePlugins: Map<string, PluginMetadata>
|
|
31
|
+
private initialized: boolean
|
|
32
|
+
|
|
15
33
|
constructor() {
|
|
16
34
|
this.availablePlugins = new Map()
|
|
17
35
|
this.initialized = false
|
|
@@ -20,7 +38,7 @@ class PluginRegistry {
|
|
|
20
38
|
/**
|
|
21
39
|
* Initialize registry and discover available plugins
|
|
22
40
|
*/
|
|
23
|
-
async initialize() {
|
|
41
|
+
async initialize(): Promise<void> {
|
|
24
42
|
if (this.initialized) return
|
|
25
43
|
|
|
26
44
|
await this.discoverPlugins()
|
|
@@ -30,7 +48,7 @@ class PluginRegistry {
|
|
|
30
48
|
/**
|
|
31
49
|
* Discover all available plugins (not necessarily loaded)
|
|
32
50
|
*/
|
|
33
|
-
async discoverPlugins() {
|
|
51
|
+
async discoverPlugins(): Promise<void> {
|
|
34
52
|
// Built-in plugins
|
|
35
53
|
await this.discoverFromPath(
|
|
36
54
|
path.join(__dirname, '..', 'plugins'),
|
|
@@ -46,18 +64,16 @@ class PluginRegistry {
|
|
|
46
64
|
|
|
47
65
|
/**
|
|
48
66
|
* Discover plugins from a path
|
|
49
|
-
* @param {string} dir
|
|
50
|
-
* @param {string} source
|
|
51
67
|
*/
|
|
52
|
-
async discoverFromPath(dir, source) {
|
|
68
|
+
async discoverFromPath(dir: string, source: PluginSource): Promise<void> {
|
|
53
69
|
try {
|
|
54
70
|
const entries = await fs.readdir(dir, { withFileTypes: true })
|
|
55
71
|
|
|
56
72
|
for (const entry of entries) {
|
|
57
73
|
try {
|
|
58
|
-
let pluginPath
|
|
74
|
+
let pluginPath: string
|
|
59
75
|
|
|
60
|
-
if (entry.isFile() && entry.name.endsWith('.js')) {
|
|
76
|
+
if (entry.isFile() && (entry.name.endsWith('.js') || entry.name.endsWith('.ts'))) {
|
|
61
77
|
pluginPath = path.join(dir, entry.name)
|
|
62
78
|
} else if (entry.isDirectory()) {
|
|
63
79
|
pluginPath = path.join(dir, entry.name, 'index.js')
|
|
@@ -88,10 +104,8 @@ class PluginRegistry {
|
|
|
88
104
|
|
|
89
105
|
/**
|
|
90
106
|
* Read plugin metadata without fully loading
|
|
91
|
-
* @param {string} pluginPath
|
|
92
|
-
* @returns {Object|null}
|
|
93
107
|
*/
|
|
94
|
-
async readPluginMetadata(pluginPath) {
|
|
108
|
+
async readPluginMetadata(pluginPath: string): Promise<PluginMetadata | null> {
|
|
95
109
|
try {
|
|
96
110
|
const content = await fs.readFile(pluginPath, 'utf-8')
|
|
97
111
|
|
|
@@ -128,52 +142,43 @@ class PluginRegistry {
|
|
|
128
142
|
|
|
129
143
|
/**
|
|
130
144
|
* Get all available plugins
|
|
131
|
-
* @returns {Object[]}
|
|
132
145
|
*/
|
|
133
|
-
getAvailable() {
|
|
146
|
+
getAvailable(): PluginMetadata[] {
|
|
134
147
|
return Array.from(this.availablePlugins.values())
|
|
135
148
|
}
|
|
136
149
|
|
|
137
150
|
/**
|
|
138
151
|
* Get available plugins by source
|
|
139
|
-
* @param {string} source
|
|
140
|
-
* @returns {Object[]}
|
|
141
152
|
*/
|
|
142
|
-
getAvailableBySource(source) {
|
|
153
|
+
getAvailableBySource(source: PluginSource): PluginMetadata[] {
|
|
143
154
|
return this.getAvailable().filter(p => p.source === source)
|
|
144
155
|
}
|
|
145
156
|
|
|
146
157
|
/**
|
|
147
158
|
* Check if a plugin is available
|
|
148
|
-
* @param {string} name
|
|
149
|
-
* @returns {boolean}
|
|
150
159
|
*/
|
|
151
|
-
isAvailable(name) {
|
|
160
|
+
isAvailable(name: string): boolean {
|
|
152
161
|
return this.availablePlugins.has(name)
|
|
153
162
|
}
|
|
154
163
|
|
|
155
164
|
/**
|
|
156
165
|
* Check if a plugin is loaded
|
|
157
|
-
* @param {string} name
|
|
158
|
-
* @returns {boolean}
|
|
159
166
|
*/
|
|
160
|
-
isLoaded(name) {
|
|
167
|
+
isLoaded(name: string): boolean {
|
|
161
168
|
return pluginLoader.getPlugin(name) !== null
|
|
162
169
|
}
|
|
163
170
|
|
|
164
171
|
/**
|
|
165
172
|
* Get plugin info
|
|
166
|
-
* @param {string} name
|
|
167
|
-
* @returns {Object|null}
|
|
168
173
|
*/
|
|
169
|
-
getPluginInfo(name) {
|
|
174
|
+
getPluginInfo(name: string): PluginInfo | null {
|
|
170
175
|
const available = this.availablePlugins.get(name)
|
|
171
176
|
const loaded = pluginLoader.getPlugin(name)
|
|
172
177
|
|
|
173
178
|
if (!available && !loaded) return null
|
|
174
179
|
|
|
175
180
|
return {
|
|
176
|
-
...(available || {}),
|
|
181
|
+
...(available || { name, version: '1.0.0', description: '' }),
|
|
177
182
|
loaded: !!loaded,
|
|
178
183
|
active: loaded ? true : false
|
|
179
184
|
}
|
|
@@ -181,10 +186,8 @@ class PluginRegistry {
|
|
|
181
186
|
|
|
182
187
|
/**
|
|
183
188
|
* Install a plugin (copy to global plugins)
|
|
184
|
-
* @param {string} sourcePath - Path to plugin file/directory
|
|
185
|
-
* @param {string} [name] - Optional name override
|
|
186
189
|
*/
|
|
187
|
-
async install(sourcePath, name = null) {
|
|
190
|
+
async install(sourcePath: string, name: string | null = null): Promise<void> {
|
|
188
191
|
const globalPluginsPath = path.join(pathManager.getGlobalStoragePath(), 'plugins')
|
|
189
192
|
await fs.mkdir(globalPluginsPath, { recursive: true })
|
|
190
193
|
|
|
@@ -208,9 +211,8 @@ class PluginRegistry {
|
|
|
208
211
|
|
|
209
212
|
/**
|
|
210
213
|
* Uninstall a plugin
|
|
211
|
-
* @param {string} name
|
|
212
214
|
*/
|
|
213
|
-
async uninstall(name) {
|
|
215
|
+
async uninstall(name: string): Promise<void> {
|
|
214
216
|
const plugin = this.availablePlugins.get(name)
|
|
215
217
|
|
|
216
218
|
if (!plugin) {
|
|
@@ -227,8 +229,7 @@ class PluginRegistry {
|
|
|
227
229
|
}
|
|
228
230
|
|
|
229
231
|
// Delete plugin file/directory
|
|
230
|
-
const pluginPath = plugin.path
|
|
231
|
-
const stat = await fs.stat(path.dirname(pluginPath))
|
|
232
|
+
const pluginPath = plugin.path!
|
|
232
233
|
|
|
233
234
|
if (path.basename(pluginPath) === 'index.js') {
|
|
234
235
|
// Directory plugin
|
|
@@ -244,10 +245,8 @@ class PluginRegistry {
|
|
|
244
245
|
|
|
245
246
|
/**
|
|
246
247
|
* Copy directory recursively
|
|
247
|
-
* @param {string} src
|
|
248
|
-
* @param {string} dest
|
|
249
248
|
*/
|
|
250
|
-
async copyDirectory(src, dest) {
|
|
249
|
+
async copyDirectory(src: string, dest: string): Promise<void> {
|
|
251
250
|
await fs.mkdir(dest, { recursive: true })
|
|
252
251
|
const entries = await fs.readdir(src, { withFileTypes: true })
|
|
253
252
|
|
|
@@ -265,9 +264,8 @@ class PluginRegistry {
|
|
|
265
264
|
|
|
266
265
|
/**
|
|
267
266
|
* Generate plugin list for display
|
|
268
|
-
* @returns {string}
|
|
269
267
|
*/
|
|
270
|
-
generatePluginList() {
|
|
268
|
+
generatePluginList(): string {
|
|
271
269
|
const available = this.getAvailable()
|
|
272
270
|
|
|
273
271
|
if (available.length === 0) {
|
|
@@ -276,14 +274,16 @@ class PluginRegistry {
|
|
|
276
274
|
|
|
277
275
|
let output = '## Installed Plugins\n\n'
|
|
278
276
|
|
|
279
|
-
const bySource = {
|
|
277
|
+
const bySource: Record<PluginSource, PluginMetadata[]> = {
|
|
280
278
|
builtin: [],
|
|
281
279
|
global: [],
|
|
282
280
|
project: []
|
|
283
281
|
}
|
|
284
282
|
|
|
285
283
|
for (const plugin of available) {
|
|
286
|
-
|
|
284
|
+
if (plugin.source) {
|
|
285
|
+
bySource[plugin.source].push(plugin)
|
|
286
|
+
}
|
|
287
287
|
}
|
|
288
288
|
|
|
289
289
|
if (bySource.builtin.length > 0) {
|
|
@@ -319,7 +319,11 @@ class PluginRegistry {
|
|
|
319
319
|
// Singleton instance
|
|
320
320
|
const pluginRegistry = new PluginRegistry()
|
|
321
321
|
|
|
322
|
-
|
|
322
|
+
export {
|
|
323
323
|
PluginRegistry,
|
|
324
|
-
pluginRegistry
|
|
324
|
+
pluginRegistry,
|
|
325
|
+
PluginMetadata,
|
|
326
|
+
PluginInfo
|
|
325
327
|
}
|
|
328
|
+
|
|
329
|
+
export default { PluginRegistry, pluginRegistry }
|
|
@@ -17,8 +17,26 @@
|
|
|
17
17
|
* }
|
|
18
18
|
*/
|
|
19
19
|
|
|
20
|
-
|
|
21
|
-
|
|
20
|
+
import crypto from 'crypto'
|
|
21
|
+
import { EventTypes } from '../bus'
|
|
22
|
+
import { HookPoints } from '../plugin/hooks'
|
|
23
|
+
|
|
24
|
+
interface WebhookConfig {
|
|
25
|
+
url?: string
|
|
26
|
+
events?: string[]
|
|
27
|
+
secret?: string
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
interface PluginContext {
|
|
31
|
+
config: WebhookConfig
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
interface WebhookPayload {
|
|
35
|
+
event: string
|
|
36
|
+
timestamp: string
|
|
37
|
+
source: string
|
|
38
|
+
data: unknown
|
|
39
|
+
}
|
|
22
40
|
|
|
23
41
|
const plugin = {
|
|
24
42
|
name: 'webhook',
|
|
@@ -26,22 +44,23 @@ const plugin = {
|
|
|
26
44
|
description: 'Send HTTP webhooks on events',
|
|
27
45
|
|
|
28
46
|
// Plugin state
|
|
29
|
-
config: null,
|
|
47
|
+
config: null as WebhookConfig | null,
|
|
30
48
|
enabled: false,
|
|
49
|
+
events: [] as string[],
|
|
31
50
|
|
|
32
51
|
/**
|
|
33
52
|
* Activate plugin
|
|
34
53
|
*/
|
|
35
|
-
async activate({ config }) {
|
|
36
|
-
|
|
54
|
+
async activate({ config }: PluginContext): Promise<void> {
|
|
55
|
+
plugin.config = config
|
|
37
56
|
|
|
38
57
|
if (!config.url) {
|
|
39
58
|
console.warn('[webhook] No URL configured, plugin disabled')
|
|
40
59
|
return
|
|
41
60
|
}
|
|
42
61
|
|
|
43
|
-
|
|
44
|
-
|
|
62
|
+
plugin.enabled = true
|
|
63
|
+
plugin.events = config.events || [
|
|
45
64
|
EventTypes.SESSION_COMPLETED,
|
|
46
65
|
EventTypes.FEATURE_SHIPPED,
|
|
47
66
|
EventTypes.SNAPSHOT_CREATED
|
|
@@ -51,27 +70,27 @@ const plugin = {
|
|
|
51
70
|
/**
|
|
52
71
|
* Deactivate plugin
|
|
53
72
|
*/
|
|
54
|
-
async deactivate() {
|
|
55
|
-
|
|
73
|
+
async deactivate(): Promise<void> {
|
|
74
|
+
plugin.enabled = false
|
|
56
75
|
},
|
|
57
76
|
|
|
58
77
|
/**
|
|
59
78
|
* Event handlers
|
|
60
79
|
*/
|
|
61
80
|
events: {
|
|
62
|
-
[EventTypes.SESSION_COMPLETED]: async function(data) {
|
|
81
|
+
[EventTypes.SESSION_COMPLETED]: async function(data: unknown): Promise<void> {
|
|
63
82
|
await plugin.sendWebhook('session.completed', data)
|
|
64
83
|
},
|
|
65
84
|
|
|
66
|
-
[EventTypes.FEATURE_SHIPPED]: async function(data) {
|
|
85
|
+
[EventTypes.FEATURE_SHIPPED]: async function(data: unknown): Promise<void> {
|
|
67
86
|
await plugin.sendWebhook('feature.shipped', data)
|
|
68
87
|
},
|
|
69
88
|
|
|
70
|
-
[EventTypes.SNAPSHOT_CREATED]: async function(data) {
|
|
89
|
+
[EventTypes.SNAPSHOT_CREATED]: async function(data: unknown): Promise<void> {
|
|
71
90
|
await plugin.sendWebhook('snapshot.created', data)
|
|
72
91
|
},
|
|
73
92
|
|
|
74
|
-
[EventTypes.TASK_COMPLETED]: async function(data) {
|
|
93
|
+
[EventTypes.TASK_COMPLETED]: async function(data: unknown): Promise<void> {
|
|
75
94
|
await plugin.sendWebhook('task.completed', data)
|
|
76
95
|
}
|
|
77
96
|
},
|
|
@@ -80,7 +99,7 @@ const plugin = {
|
|
|
80
99
|
* Hook handlers
|
|
81
100
|
*/
|
|
82
101
|
hooks: {
|
|
83
|
-
[HookPoints.AFTER_FEATURE_SHIP]: async function(data) {
|
|
102
|
+
[HookPoints.AFTER_FEATURE_SHIP]: async function(data: { feature: string; version: string; timestamp: string }): Promise<void> {
|
|
84
103
|
await plugin.sendWebhook('feature.shipped', {
|
|
85
104
|
feature: data.feature,
|
|
86
105
|
version: data.version,
|
|
@@ -91,18 +110,16 @@ const plugin = {
|
|
|
91
110
|
|
|
92
111
|
/**
|
|
93
112
|
* Send webhook request
|
|
94
|
-
* @param {string} event - Event type
|
|
95
|
-
* @param {Object} data - Event data
|
|
96
113
|
*/
|
|
97
|
-
async sendWebhook(event, data) {
|
|
98
|
-
if (!
|
|
114
|
+
async sendWebhook(event: string, data: unknown): Promise<void> {
|
|
115
|
+
if (!plugin.enabled || !plugin.config?.url) return
|
|
99
116
|
|
|
100
117
|
// Check if this event should be sent
|
|
101
|
-
if (
|
|
118
|
+
if (plugin.config.events && !plugin.config.events.includes(event)) {
|
|
102
119
|
return
|
|
103
120
|
}
|
|
104
121
|
|
|
105
|
-
const payload = {
|
|
122
|
+
const payload: WebhookPayload = {
|
|
106
123
|
event,
|
|
107
124
|
timestamp: new Date().toISOString(),
|
|
108
125
|
source: 'prjct-cli',
|
|
@@ -110,22 +127,21 @@ const plugin = {
|
|
|
110
127
|
}
|
|
111
128
|
|
|
112
129
|
try {
|
|
113
|
-
const headers = {
|
|
130
|
+
const headers: Record<string, string> = {
|
|
114
131
|
'Content-Type': 'application/json',
|
|
115
132
|
'User-Agent': 'prjct-cli/webhook'
|
|
116
133
|
}
|
|
117
134
|
|
|
118
135
|
// Add signature if secret is configured
|
|
119
|
-
if (
|
|
120
|
-
const crypto = require('crypto')
|
|
136
|
+
if (plugin.config.secret) {
|
|
121
137
|
const signature = crypto
|
|
122
|
-
.createHmac('sha256',
|
|
138
|
+
.createHmac('sha256', plugin.config.secret)
|
|
123
139
|
.update(JSON.stringify(payload))
|
|
124
140
|
.digest('hex')
|
|
125
141
|
headers['X-Prjct-Signature'] = `sha256=${signature}`
|
|
126
142
|
}
|
|
127
143
|
|
|
128
|
-
const response = await fetch(
|
|
144
|
+
const response = await fetch(plugin.config.url, {
|
|
129
145
|
method: 'POST',
|
|
130
146
|
headers,
|
|
131
147
|
body: JSON.stringify(payload)
|
|
@@ -135,9 +151,9 @@ const plugin = {
|
|
|
135
151
|
console.error(`[webhook] Request failed: ${response.status}`)
|
|
136
152
|
}
|
|
137
153
|
} catch (error) {
|
|
138
|
-
console.error(`[webhook] Error sending webhook:`, error.message)
|
|
154
|
+
console.error(`[webhook] Error sending webhook:`, (error as Error).message)
|
|
139
155
|
}
|
|
140
156
|
}
|
|
141
157
|
}
|
|
142
158
|
|
|
143
|
-
|
|
159
|
+
export default plugin
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Agents Schema
|
|
3
|
+
*
|
|
4
|
+
* Defines the structure for agents.json - specialized AI agents.
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
export interface AgentSchema {
|
|
8
|
+
name: string
|
|
9
|
+
description: string
|
|
10
|
+
skills: string[]
|
|
11
|
+
patterns: string[]
|
|
12
|
+
filesOwned: string[]
|
|
13
|
+
successRate?: number
|
|
14
|
+
tasksCompleted?: number
|
|
15
|
+
bestFor: string[]
|
|
16
|
+
avoidFor: string[]
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export type AgentsSchema = AgentSchema[]
|
|
20
|
+
|
|
21
|
+
export const DEFAULT_AGENT: Omit<AgentSchema, 'name' | 'description'> = {
|
|
22
|
+
skills: [],
|
|
23
|
+
patterns: [],
|
|
24
|
+
filesOwned: [],
|
|
25
|
+
bestFor: [],
|
|
26
|
+
avoidFor: []
|
|
27
|
+
}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Analysis Schema
|
|
3
|
+
*
|
|
4
|
+
* Defines the structure for analysis.json - repository analysis.
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
export interface CodePattern {
|
|
8
|
+
name: string
|
|
9
|
+
description: string
|
|
10
|
+
location?: string
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export interface AntiPattern {
|
|
14
|
+
issue: string
|
|
15
|
+
file: string
|
|
16
|
+
suggestion: string
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export interface AnalysisSchema {
|
|
20
|
+
projectId: string
|
|
21
|
+
languages: string[]
|
|
22
|
+
frameworks: string[]
|
|
23
|
+
packageManager?: string
|
|
24
|
+
sourceDir?: string
|
|
25
|
+
testDir?: string
|
|
26
|
+
configFiles: string[]
|
|
27
|
+
fileCount: number
|
|
28
|
+
patterns: CodePattern[]
|
|
29
|
+
antiPatterns: AntiPattern[]
|
|
30
|
+
analyzedAt: string // ISO8601
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
export const DEFAULT_ANALYSIS: Omit<AnalysisSchema, 'projectId'> = {
|
|
34
|
+
languages: [],
|
|
35
|
+
frameworks: [],
|
|
36
|
+
configFiles: [],
|
|
37
|
+
fileCount: 0,
|
|
38
|
+
patterns: [],
|
|
39
|
+
antiPatterns: [],
|
|
40
|
+
analyzedAt: new Date().toISOString()
|
|
41
|
+
}
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Ideas Schema
|
|
3
|
+
*
|
|
4
|
+
* Defines the structure for ideas.json - idea backlog.
|
|
5
|
+
* Matches json-loader.ts types exactly.
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
export type IdeaPriority = 'low' | 'medium' | 'high'
|
|
9
|
+
export type IdeaStatus = 'pending' | 'converted' | 'completed' | 'archived'
|
|
10
|
+
|
|
11
|
+
export interface ImpactEffort {
|
|
12
|
+
impact: 'high' | 'medium' | 'low'
|
|
13
|
+
effort: 'high' | 'medium' | 'low'
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
// Tech stack definition for idea specs
|
|
17
|
+
export interface TechStack {
|
|
18
|
+
frontend?: string // "Next.js 14, HeroUI"
|
|
19
|
+
backend?: string // "Supabase (Auth, DB, RLS, Realtime)"
|
|
20
|
+
payments?: string // "Stripe Billing"
|
|
21
|
+
ai?: string // "Vercel AI SDK"
|
|
22
|
+
deploy?: string // "Vercel"
|
|
23
|
+
other?: string[] // Additional stack items
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
// Module definition for complex ideas
|
|
27
|
+
export interface IdeaModule {
|
|
28
|
+
name: string // "Multi-tenant"
|
|
29
|
+
description: string // "Empresas con RLS estricto"
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
// Role definition
|
|
33
|
+
export interface IdeaRole {
|
|
34
|
+
name: string // "SUPER_ADMIN"
|
|
35
|
+
description?: string // "(global, impersonation)"
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
export interface IdeaSchema {
|
|
39
|
+
id: string // idea_xxxxxxxx
|
|
40
|
+
text: string // Title/summary
|
|
41
|
+
details?: string // Expanded description
|
|
42
|
+
priority: IdeaPriority
|
|
43
|
+
status: IdeaStatus
|
|
44
|
+
tags: string[]
|
|
45
|
+
addedAt: string // ISO8601
|
|
46
|
+
completedAt?: string // ISO8601 if status=completed
|
|
47
|
+
convertedTo?: string // featureId if status=converted
|
|
48
|
+
// Source documentation
|
|
49
|
+
source?: string // "docs/technical-spec-v1.md, docs/edr-v1.md"
|
|
50
|
+
sourceFiles?: string[] // Array of source files
|
|
51
|
+
// Enriched fields from MD
|
|
52
|
+
painPoints?: string[] // from ### Pain Points section
|
|
53
|
+
solutions?: string[] // from ### Solutions section
|
|
54
|
+
filesAffected?: string[] // from **Files:** section
|
|
55
|
+
impactEffort?: ImpactEffort
|
|
56
|
+
implementationNotes?: string
|
|
57
|
+
// Technical spec fields for ZERO DATA LOSS
|
|
58
|
+
stack?: TechStack // Tech stack definition
|
|
59
|
+
modules?: IdeaModule[] // V1 modules list
|
|
60
|
+
roles?: IdeaRole[] // User roles
|
|
61
|
+
risks?: string[] // Critical risks/pitfalls
|
|
62
|
+
risksCount?: number // "33 pitfalls documented"
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
export interface IdeasJson {
|
|
66
|
+
ideas: IdeaSchema[]
|
|
67
|
+
lastUpdated: string
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
// Legacy type for backwards compatibility
|
|
71
|
+
export type IdeasSchema = IdeaSchema[]
|
|
72
|
+
|
|
73
|
+
export const DEFAULT_IDEA: Omit<IdeaSchema, 'id' | 'text'> = {
|
|
74
|
+
priority: 'medium',
|
|
75
|
+
status: 'pending',
|
|
76
|
+
tags: [],
|
|
77
|
+
createdAt: new Date().toISOString()
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
export const DEFAULT_IDEAS: IdeasJson = {
|
|
81
|
+
ideas: [],
|
|
82
|
+
lastUpdated: ''
|
|
83
|
+
}
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Schemas Module
|
|
3
|
+
*
|
|
4
|
+
* TypeScript types and defaults for all JSON data files.
|
|
5
|
+
* These schemas define the source-of-truth for all project data.
|
|
6
|
+
*
|
|
7
|
+
* Data lives in: ~/.prjct-cli/projects/{projectId}/data/
|
|
8
|
+
* Views are generated in: ~/.prjct-cli/projects/{projectId}/views/
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
// State (current task + queue)
|
|
12
|
+
export * from './state'
|
|
13
|
+
|
|
14
|
+
// Project metadata
|
|
15
|
+
export * from './project'
|
|
16
|
+
|
|
17
|
+
// Agents
|
|
18
|
+
export * from './agents'
|
|
19
|
+
|
|
20
|
+
// Ideas
|
|
21
|
+
export * from './ideas'
|
|
22
|
+
|
|
23
|
+
// Roadmap (features)
|
|
24
|
+
export * from './roadmap'
|
|
25
|
+
|
|
26
|
+
// Shipped items
|
|
27
|
+
export * from './shipped'
|
|
28
|
+
|
|
29
|
+
// Analysis
|
|
30
|
+
export * from './analysis'
|
|
31
|
+
|
|
32
|
+
// Outcomes
|
|
33
|
+
export * from './outcomes'
|
|
34
|
+
|
|
35
|
+
// ============================================
|
|
36
|
+
// ID GENERATORS
|
|
37
|
+
// ============================================
|
|
38
|
+
|
|
39
|
+
function generateId(prefix: string): string {
|
|
40
|
+
const chars = 'abcdefghijklmnopqrstuvwxyz0123456789'
|
|
41
|
+
let id = ''
|
|
42
|
+
for (let i = 0; i < 8; i++) {
|
|
43
|
+
id += chars[Math.floor(Math.random() * chars.length)]
|
|
44
|
+
}
|
|
45
|
+
return `${prefix}_${id}`
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
export const generateTaskId = (): string => generateId('task')
|
|
49
|
+
export const generateFeatureId = (): string => generateId('feat')
|
|
50
|
+
export const generateIdeaId = (): string => generateId('idea')
|
|
51
|
+
export const generateShipId = (): string => generateId('ship')
|
|
52
|
+
export const generateSessionId = (): string => generateId('sess')
|
|
53
|
+
|
|
54
|
+
// ============================================
|
|
55
|
+
// PATH HELPERS
|
|
56
|
+
// ============================================
|
|
57
|
+
|
|
58
|
+
import { join } from 'path'
|
|
59
|
+
import { homedir } from 'os'
|
|
60
|
+
|
|
61
|
+
export const GLOBAL_STORAGE = join(homedir(), '.prjct-cli', 'projects')
|
|
62
|
+
|
|
63
|
+
export function getProjectPath(projectId: string): string {
|
|
64
|
+
return join(GLOBAL_STORAGE, projectId)
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
export function getDataPath(projectId: string): string {
|
|
68
|
+
return join(GLOBAL_STORAGE, projectId, 'data')
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
export function getViewsPath(projectId: string): string {
|
|
72
|
+
return join(GLOBAL_STORAGE, projectId, 'views')
|
|
73
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Outcomes Schema
|
|
3
|
+
*
|
|
4
|
+
* Defines the structure for outcomes.json - task completion metrics.
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
export type QualityScore = 1 | 2 | 3 | 4 | 5
|
|
8
|
+
|
|
9
|
+
export interface OutcomeSchema {
|
|
10
|
+
id: string
|
|
11
|
+
taskId: string
|
|
12
|
+
description: string
|
|
13
|
+
estimatedDuration?: string
|
|
14
|
+
actualDuration: string
|
|
15
|
+
completedAsPlanned: boolean
|
|
16
|
+
qualityScore: QualityScore
|
|
17
|
+
blockers: string[]
|
|
18
|
+
agentUsed?: string
|
|
19
|
+
completedAt: string // ISO8601
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
export type OutcomesSchema = OutcomeSchema[]
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Project Schema
|
|
3
|
+
*
|
|
4
|
+
* Defines the structure for project.json - project metadata.
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
export interface ProjectSchema {
|
|
8
|
+
projectId: string
|
|
9
|
+
name: string
|
|
10
|
+
repoPath: string
|
|
11
|
+
description?: string
|
|
12
|
+
version?: string
|
|
13
|
+
techStack: string[]
|
|
14
|
+
fileCount: number
|
|
15
|
+
commitCount: number
|
|
16
|
+
createdAt: string // ISO8601
|
|
17
|
+
lastSync: string // ISO8601
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export const DEFAULT_PROJECT: Omit<ProjectSchema, 'projectId' | 'name' | 'repoPath'> = {
|
|
21
|
+
techStack: [],
|
|
22
|
+
fileCount: 0,
|
|
23
|
+
commitCount: 0,
|
|
24
|
+
createdAt: new Date().toISOString(),
|
|
25
|
+
lastSync: new Date().toISOString()
|
|
26
|
+
}
|