mcoda 0.1.2 → 0.1.4
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 +2 -2
- package/README.md +9 -300
- package/dist/bin/McodaEntrypoint.d.ts +5 -0
- package/dist/bin/McodaEntrypoint.d.ts.map +1 -0
- package/dist/bin/McodaEntrypoint.js +175 -0
- package/dist/commands/agents/AgentsCommands.d.ts +4 -0
- package/dist/commands/agents/AgentsCommands.d.ts.map +1 -0
- package/dist/commands/agents/AgentsCommands.js +376 -0
- package/dist/commands/agents/GatewayAgentCommand.d.ts +4 -0
- package/dist/commands/agents/GatewayAgentCommand.d.ts.map +1 -0
- package/dist/commands/agents/GatewayAgentCommand.js +583 -0
- package/dist/commands/agents/TestAgentCommand.d.ts +4 -0
- package/dist/commands/agents/TestAgentCommand.d.ts.map +1 -0
- package/dist/commands/agents/TestAgentCommand.js +57 -0
- package/dist/commands/backlog/BacklogCommands.d.ts +17 -0
- package/dist/commands/backlog/BacklogCommands.d.ts.map +1 -0
- package/dist/commands/backlog/BacklogCommands.js +260 -0
- package/dist/commands/backlog/OrderTasksCommand.d.ts +16 -0
- package/dist/commands/backlog/OrderTasksCommand.d.ts.map +1 -0
- package/dist/commands/backlog/OrderTasksCommand.js +211 -0
- package/dist/commands/backlog/TaskShowCommands.d.ts +16 -0
- package/dist/commands/backlog/TaskShowCommands.d.ts.map +1 -0
- package/dist/commands/backlog/TaskShowCommands.js +275 -0
- package/dist/commands/docs/DocsCommands.d.ts +37 -0
- package/dist/commands/docs/DocsCommands.d.ts.map +1 -0
- package/dist/commands/docs/DocsCommands.js +381 -0
- package/dist/commands/estimate/EstimateCommands.d.ts +24 -0
- package/dist/commands/estimate/EstimateCommands.d.ts.map +1 -0
- package/dist/commands/estimate/EstimateCommands.js +259 -0
- package/dist/commands/jobs/JobsCommands.d.ts +24 -0
- package/dist/commands/jobs/JobsCommands.d.ts.map +1 -0
- package/dist/commands/jobs/JobsCommands.js +535 -0
- package/dist/commands/openapi/OpenapiCommands.d.ts +14 -0
- package/dist/commands/openapi/OpenapiCommands.d.ts.map +1 -0
- package/dist/commands/openapi/OpenapiCommands.js +157 -0
- package/dist/commands/planning/CreateTasksCommand.d.ts +17 -0
- package/dist/commands/planning/CreateTasksCommand.d.ts.map +1 -0
- package/dist/commands/planning/CreateTasksCommand.js +134 -0
- package/dist/commands/planning/MigrateTasksCommand.d.ts +15 -0
- package/dist/commands/planning/MigrateTasksCommand.d.ts.map +1 -0
- package/dist/commands/planning/MigrateTasksCommand.js +95 -0
- package/dist/commands/planning/PlanningCommands.d.ts +3 -0
- package/dist/commands/planning/PlanningCommands.d.ts.map +1 -0
- package/dist/commands/planning/PlanningCommands.js +2 -0
- package/dist/commands/planning/QaTasksCommand.d.ts +30 -0
- package/dist/commands/planning/QaTasksCommand.d.ts.map +1 -0
- package/dist/commands/planning/QaTasksCommand.js +293 -0
- package/dist/commands/planning/RefineTasksCommand.d.ts +30 -0
- package/dist/commands/planning/RefineTasksCommand.d.ts.map +1 -0
- package/dist/commands/planning/RefineTasksCommand.js +365 -0
- package/dist/commands/review/CodeReviewCommand.d.ts +21 -0
- package/dist/commands/review/CodeReviewCommand.d.ts.map +1 -0
- package/dist/commands/review/CodeReviewCommand.js +236 -0
- package/dist/commands/routing/RoutingCommands.d.ts +7 -0
- package/dist/commands/routing/RoutingCommands.d.ts.map +1 -0
- package/dist/commands/routing/RoutingCommands.js +484 -0
- package/dist/commands/telemetry/TelemetryCommands.d.ts +26 -0
- package/dist/commands/telemetry/TelemetryCommands.d.ts.map +1 -0
- package/dist/commands/telemetry/TelemetryCommands.js +313 -0
- package/dist/commands/update/UpdateCommands.d.ts +4 -0
- package/dist/commands/update/UpdateCommands.d.ts.map +1 -0
- package/dist/commands/update/UpdateCommands.js +280 -0
- package/dist/commands/work/WorkOnTasksCommand.d.ts +21 -0
- package/dist/commands/work/WorkOnTasksCommand.d.ts.map +1 -0
- package/dist/commands/work/WorkOnTasksCommand.js +238 -0
- package/dist/commands/workspace/SetWorkspaceCommand.d.ts +9 -0
- package/dist/commands/workspace/SetWorkspaceCommand.d.ts.map +1 -0
- package/dist/commands/workspace/SetWorkspaceCommand.js +128 -0
- package/dist/index.d.ts +19 -0
- package/dist/index.d.ts.map +1 -0
- package/package.json +31 -16
- package/.editorconfig +0 -9
- package/.eslintrc.cjs +0 -12
- package/.github/ISSUE_TEMPLATE/bug_report.md +0 -29
- package/.github/ISSUE_TEMPLATE/config.yml +0 -5
- package/.github/ISSUE_TEMPLATE/feature_request.md +0 -19
- package/.github/workflows/ci.yml +0 -37
- package/.github/workflows/nightly.yml +0 -38
- package/.github/workflows/release-dry-run.yml +0 -40
- package/.github/workflows/release-please.yml +0 -22
- package/.github/workflows/release.yml +0 -139
- package/.prettierrc +0 -5
- package/.release-please-manifest.json +0 -8
- package/CLA.md +0 -42
- package/CONTRIBUTING.md +0 -38
- package/docs/oss_publishing_plan.md +0 -41
- package/docs/pdr/.gitkeep +0 -0
- package/docs/quality_gates.md +0 -32
- package/docs/rfp/.gitkeep +0 -0
- package/docs/sds/sds.md +0 -11963
- package/docs/usage.md +0 -72
- package/openapi/gen-openapi.ts +0 -1
- package/openapi/generated/clients/.gitkeep +0 -0
- package/openapi/generated/types/.gitkeep +0 -0
- package/openapi/generated/types/index.ts +0 -118
- package/openapi/mcoda.yaml +0 -2063
- package/pack-mcoda.sh +0 -88
- package/packages/agents/CHANGELOG.md +0 -7
- package/packages/agents/LICENSE +0 -21
- package/packages/agents/README.md +0 -9
- package/packages/agents/package.json +0 -41
- package/packages/agents/src/AgentService/.gitkeep +0 -0
- package/packages/agents/src/AgentService/AgentService.d.ts +0 -21
- package/packages/agents/src/AgentService/AgentService.d.ts.map +0 -1
- package/packages/agents/src/AgentService/AgentService.js +0 -141
- package/packages/agents/src/AgentService/AgentService.ts +0 -308
- package/packages/agents/src/__tests__/AgentService.test.ts +0 -284
- package/packages/agents/src/adapters/AdapterTypes.d.ts +0 -29
- package/packages/agents/src/adapters/AdapterTypes.d.ts.map +0 -1
- package/packages/agents/src/adapters/AdapterTypes.js +0 -1
- package/packages/agents/src/adapters/AdapterTypes.ts +0 -32
- package/packages/agents/src/adapters/codex/.gitkeep +0 -0
- package/packages/agents/src/adapters/codex/CodexAdapter.d.ts +0 -11
- package/packages/agents/src/adapters/codex/CodexAdapter.d.ts.map +0 -1
- package/packages/agents/src/adapters/codex/CodexAdapter.js +0 -43
- package/packages/agents/src/adapters/codex/CodexAdapter.ts +0 -63
- package/packages/agents/src/adapters/codex/CodexCliRunner.ts +0 -154
- package/packages/agents/src/adapters/gemini/.gitkeep +0 -0
- package/packages/agents/src/adapters/gemini/GeminiAdapter.d.ts +0 -11
- package/packages/agents/src/adapters/gemini/GeminiAdapter.d.ts.map +0 -1
- package/packages/agents/src/adapters/gemini/GeminiAdapter.js +0 -42
- package/packages/agents/src/adapters/gemini/GeminiAdapter.ts +0 -58
- package/packages/agents/src/adapters/gemini/GeminiCliRunner.ts +0 -75
- package/packages/agents/src/adapters/local/.gitkeep +0 -0
- package/packages/agents/src/adapters/local/LocalAdapter.d.ts +0 -11
- package/packages/agents/src/adapters/local/LocalAdapter.d.ts.map +0 -1
- package/packages/agents/src/adapters/local/LocalAdapter.js +0 -38
- package/packages/agents/src/adapters/local/LocalAdapter.ts +0 -43
- package/packages/agents/src/adapters/ollama/OllamaCliAdapter.ts +0 -58
- package/packages/agents/src/adapters/ollama/OllamaCliRunner.ts +0 -70
- package/packages/agents/src/adapters/ollama/OllamaRemoteAdapter.ts +0 -205
- package/packages/agents/src/adapters/openai/.gitkeep +0 -0
- package/packages/agents/src/adapters/openai/OpenAiAdapter.d.ts +0 -11
- package/packages/agents/src/adapters/openai/OpenAiAdapter.d.ts.map +0 -1
- package/packages/agents/src/adapters/openai/OpenAiAdapter.js +0 -51
- package/packages/agents/src/adapters/openai/OpenAiAdapter.ts +0 -56
- package/packages/agents/src/adapters/openai/OpenAiCliAdapter.ts +0 -62
- package/packages/agents/src/adapters/qa/.gitkeep +0 -0
- package/packages/agents/src/adapters/qa/QaAdapter.d.ts +0 -11
- package/packages/agents/src/adapters/qa/QaAdapter.d.ts.map +0 -1
- package/packages/agents/src/adapters/qa/QaAdapter.js +0 -37
- package/packages/agents/src/adapters/qa/QaAdapter.ts +0 -42
- package/packages/agents/src/adapters/zhipu/ZhipuApiAdapter.ts +0 -273
- package/packages/agents/src/index.d.ts +0 -8
- package/packages/agents/src/index.d.ts.map +0 -1
- package/packages/agents/src/index.js +0 -7
- package/packages/agents/src/index.ts +0 -11
- package/packages/agents/tsconfig.json +0 -14
- package/packages/cli/CHANGELOG.md +0 -7
- package/packages/cli/LICENSE +0 -21
- package/packages/cli/README.md +0 -23
- package/packages/cli/package.json +0 -61
- package/packages/cli/src/__tests__/AgentsCommands.test.ts +0 -137
- package/packages/cli/src/__tests__/BacklogCommands.test.ts +0 -40
- package/packages/cli/src/__tests__/CodeReviewCommand.test.ts +0 -594
- package/packages/cli/src/__tests__/CreateTasksCommand.test.ts +0 -40
- package/packages/cli/src/__tests__/DocsCommands.test.ts +0 -41
- package/packages/cli/src/__tests__/EstimateCommands.test.ts +0 -54
- package/packages/cli/src/__tests__/JobsCommands.behavior.test.ts +0 -311
- package/packages/cli/src/__tests__/JobsCommands.test.ts +0 -49
- package/packages/cli/src/__tests__/MigrateTasksCommand.test.ts +0 -36
- package/packages/cli/src/__tests__/OpenapiCommands.test.ts +0 -34
- package/packages/cli/src/__tests__/OrderTasksCommand.test.ts +0 -150
- package/packages/cli/src/__tests__/PlanningCommands.test.ts +0 -9
- package/packages/cli/src/__tests__/QaTasksCommand.test.ts +0 -58
- package/packages/cli/src/__tests__/RefineTasksCommand.test.ts +0 -63
- package/packages/cli/src/__tests__/RoutingCommands.test.ts +0 -302
- package/packages/cli/src/__tests__/SetWorkspaceCommand.test.ts +0 -18
- package/packages/cli/src/__tests__/TaskShowCommands.test.ts +0 -130
- package/packages/cli/src/__tests__/TelemetryCommands.test.ts +0 -35
- package/packages/cli/src/__tests__/TestAgentCommand.test.ts +0 -41
- package/packages/cli/src/__tests__/UpdateCommands.test.ts +0 -292
- package/packages/cli/src/__tests__/WorkOnTasksCommand.test.ts +0 -42
- package/packages/cli/src/bin/.gitkeep +0 -0
- package/packages/cli/src/bin/McodaEntrypoint.ts +0 -180
- package/packages/cli/src/commands/agents/.gitkeep +0 -0
- package/packages/cli/src/commands/agents/AgentsCommands.ts +0 -374
- package/packages/cli/src/commands/agents/GatewayAgentCommand.ts +0 -621
- package/packages/cli/src/commands/agents/TestAgentCommand.ts +0 -63
- package/packages/cli/src/commands/backlog/.gitkeep +0 -0
- package/packages/cli/src/commands/backlog/BacklogCommands.ts +0 -286
- package/packages/cli/src/commands/backlog/OrderTasksCommand.ts +0 -237
- package/packages/cli/src/commands/backlog/TaskShowCommands.ts +0 -289
- package/packages/cli/src/commands/docs/.gitkeep +0 -0
- package/packages/cli/src/commands/docs/DocsCommands.ts +0 -413
- package/packages/cli/src/commands/estimate/EstimateCommands.ts +0 -290
- package/packages/cli/src/commands/jobs/.gitkeep +0 -0
- package/packages/cli/src/commands/jobs/JobsCommands.ts +0 -595
- package/packages/cli/src/commands/openapi/OpenapiCommands.ts +0 -167
- package/packages/cli/src/commands/planning/.gitkeep +0 -0
- package/packages/cli/src/commands/planning/CreateTasksCommand.ts +0 -149
- package/packages/cli/src/commands/planning/MigrateTasksCommand.ts +0 -105
- package/packages/cli/src/commands/planning/PlanningCommands.ts +0 -1
- package/packages/cli/src/commands/planning/QaTasksCommand.ts +0 -320
- package/packages/cli/src/commands/planning/RefineTasksCommand.ts +0 -408
- package/packages/cli/src/commands/review/CodeReviewCommand.ts +0 -262
- package/packages/cli/src/commands/routing/.gitkeep +0 -0
- package/packages/cli/src/commands/routing/RoutingCommands.ts +0 -554
- package/packages/cli/src/commands/telemetry/.gitkeep +0 -0
- package/packages/cli/src/commands/telemetry/TelemetryCommands.ts +0 -348
- package/packages/cli/src/commands/update/.gitkeep +0 -0
- package/packages/cli/src/commands/update/UpdateCommands.ts +0 -301
- package/packages/cli/src/commands/work/WorkOnTasksCommand.ts +0 -264
- package/packages/cli/src/commands/workspace/SetWorkspaceCommand.ts +0 -132
- package/packages/cli/test/packaging_guardrails.test.js +0 -75
- package/packages/cli/tsconfig.json +0 -20
- package/packages/core/CHANGELOG.md +0 -7
- package/packages/core/LICENSE +0 -21
- package/packages/core/README.md +0 -9
- package/packages/core/package.json +0 -45
- package/packages/core/src/__tests__/SmokeClasses.test.ts +0 -32
- package/packages/core/src/api/AgentsApi.ts +0 -219
- package/packages/core/src/api/QaTasksApi.ts +0 -38
- package/packages/core/src/api/TasksApi.ts +0 -35
- package/packages/core/src/api/__tests__/AgentsApi.test.ts +0 -203
- package/packages/core/src/api/__tests__/QaTasksApi.test.ts +0 -51
- package/packages/core/src/api/__tests__/TasksApi.test.ts +0 -56
- package/packages/core/src/config/.gitkeep +0 -0
- package/packages/core/src/config/ConfigService.ts +0 -1
- package/packages/core/src/domain/dependencies/.gitkeep +0 -0
- package/packages/core/src/domain/dependencies/Dependency.ts +0 -1
- package/packages/core/src/domain/epics/.gitkeep +0 -0
- package/packages/core/src/domain/epics/Epic.ts +0 -1
- package/packages/core/src/domain/projects/.gitkeep +0 -0
- package/packages/core/src/domain/projects/Project.ts +0 -1
- package/packages/core/src/domain/tasks/.gitkeep +0 -0
- package/packages/core/src/domain/tasks/Task.ts +0 -1
- package/packages/core/src/domain/userStories/.gitkeep +0 -0
- package/packages/core/src/domain/userStories/UserStory.ts +0 -1
- package/packages/core/src/index.ts +0 -27
- package/packages/core/src/prompts/.gitkeep +0 -0
- package/packages/core/src/prompts/PdrPrompts.ts +0 -23
- package/packages/core/src/prompts/PromptLoader.ts +0 -1
- package/packages/core/src/prompts/SdsPrompts.ts +0 -47
- package/packages/core/src/services/agents/.gitkeep +0 -0
- package/packages/core/src/services/agents/AgentManagementService.ts +0 -1
- package/packages/core/src/services/agents/GatewayAgentService.ts +0 -956
- package/packages/core/src/services/agents/RoutingService.ts +0 -461
- package/packages/core/src/services/agents/__tests__/GatewayAgentService.test.ts +0 -72
- package/packages/core/src/services/agents/__tests__/RoutingService.test.ts +0 -267
- package/packages/core/src/services/agents/generated/RoutingApiClient.ts +0 -89
- package/packages/core/src/services/backlog/.gitkeep +0 -0
- package/packages/core/src/services/backlog/BacklogService.ts +0 -580
- package/packages/core/src/services/backlog/TaskOrderingService.ts +0 -868
- package/packages/core/src/services/backlog/__tests__/BacklogService.test.ts +0 -219
- package/packages/core/src/services/backlog/__tests__/TaskOrderingService.test.ts +0 -268
- package/packages/core/src/services/docs/.gitkeep +0 -0
- package/packages/core/src/services/docs/DocsService.ts +0 -1913
- package/packages/core/src/services/docs/__tests__/DocsService.test.ts +0 -350
- package/packages/core/src/services/estimate/EstimateService.ts +0 -111
- package/packages/core/src/services/estimate/VelocityService.ts +0 -272
- package/packages/core/src/services/estimate/__tests__/VelocityAndEstimate.test.ts +0 -209
- package/packages/core/src/services/estimate/types.ts +0 -41
- package/packages/core/src/services/execution/.gitkeep +0 -0
- package/packages/core/src/services/execution/ExecutionService.ts +0 -1
- package/packages/core/src/services/execution/QaFollowupService.ts +0 -289
- package/packages/core/src/services/execution/QaProfileService.ts +0 -160
- package/packages/core/src/services/execution/QaTasksService.ts +0 -1303
- package/packages/core/src/services/execution/TaskSelectionService.ts +0 -362
- package/packages/core/src/services/execution/TaskStateService.ts +0 -64
- package/packages/core/src/services/execution/WorkOnTasksService.ts +0 -2023
- package/packages/core/src/services/execution/__tests__/QaFollowupService.test.ts +0 -58
- package/packages/core/src/services/execution/__tests__/QaProfileService.test.ts +0 -49
- package/packages/core/src/services/execution/__tests__/QaTasksService.test.ts +0 -157
- package/packages/core/src/services/execution/__tests__/TaskSelectionService.test.ts +0 -179
- package/packages/core/src/services/execution/__tests__/TaskStateService.test.ts +0 -51
- package/packages/core/src/services/execution/__tests__/WorkOnTasksService.test.ts +0 -285
- package/packages/core/src/services/jobs/.gitkeep +0 -0
- package/packages/core/src/services/jobs/JobInsightsService.ts +0 -355
- package/packages/core/src/services/jobs/JobResumeService.ts +0 -119
- package/packages/core/src/services/jobs/JobService.ts +0 -648
- package/packages/core/src/services/jobs/JobsApiClient.ts +0 -113
- package/packages/core/src/services/jobs/__tests__/JobInsightsService.test.ts +0 -17
- package/packages/core/src/services/jobs/__tests__/JobResumeService.test.ts +0 -45
- package/packages/core/src/services/jobs/__tests__/JobService.test.ts +0 -44
- package/packages/core/src/services/openapi/OpenApiService.ts +0 -558
- package/packages/core/src/services/openapi/__tests__/OpenApiService.test.ts +0 -57
- package/packages/core/src/services/planning/.gitkeep +0 -0
- package/packages/core/src/services/planning/CreateTasksService.ts +0 -1280
- package/packages/core/src/services/planning/KeyHelpers.ts +0 -80
- package/packages/core/src/services/planning/PlanningService.ts +0 -1
- package/packages/core/src/services/planning/RefineTasksService.ts +0 -1552
- package/packages/core/src/services/planning/__tests__/CreateTasksService.test.ts +0 -288
- package/packages/core/src/services/planning/__tests__/KeyHelpers.test.ts +0 -16
- package/packages/core/src/services/planning/__tests__/RefineTasksService.test.ts +0 -172
- package/packages/core/src/services/review/CodeReviewService.ts +0 -1386
- package/packages/core/src/services/review/__tests__/CodeReviewService.test.ts +0 -89
- package/packages/core/src/services/system/SystemUpdateService.ts +0 -177
- package/packages/core/src/services/system/__tests__/SystemUpdateService.test.ts +0 -40
- package/packages/core/src/services/tasks/TaskApiResolver.ts +0 -37
- package/packages/core/src/services/tasks/TaskDetailService.ts +0 -494
- package/packages/core/src/services/tasks/__tests__/TaskApiResolver.test.ts +0 -41
- package/packages/core/src/services/tasks/__tests__/TaskDetailService.test.ts +0 -178
- package/packages/core/src/services/telemetry/.gitkeep +0 -0
- package/packages/core/src/services/telemetry/TelemetryService.ts +0 -515
- package/packages/core/src/services/telemetry/__tests__/TelemetryService.test.ts +0 -160
- package/packages/core/src/workspace/.gitkeep +0 -0
- package/packages/core/src/workspace/WorkspaceManager.ts +0 -234
- package/packages/core/tsconfig.json +0 -20
- package/packages/db/CHANGELOG.md +0 -7
- package/packages/db/LICENSE +0 -21
- package/packages/db/README.md +0 -9
- package/packages/db/package.json +0 -42
- package/packages/db/src/__tests__/GlobalRepository.test.ts +0 -109
- package/packages/db/src/__tests__/SchemaAlignment.test.ts +0 -80
- package/packages/db/src/__tests__/WorkspaceRepository.test.ts +0 -19
- package/packages/db/src/index.d.ts +0 -6
- package/packages/db/src/index.d.ts.map +0 -1
- package/packages/db/src/index.js +0 -5
- package/packages/db/src/index.ts +0 -6
- package/packages/db/src/migrations/global/.gitkeep +0 -0
- package/packages/db/src/migrations/global/GlobalMigrations.d.ts +0 -9
- package/packages/db/src/migrations/global/GlobalMigrations.d.ts.map +0 -1
- package/packages/db/src/migrations/global/GlobalMigrations.js +0 -68
- package/packages/db/src/migrations/global/GlobalMigrations.ts +0 -336
- package/packages/db/src/migrations/workspace/.gitkeep +0 -0
- package/packages/db/src/migrations/workspace/WorkspaceMigrations.d.ts +0 -9
- package/packages/db/src/migrations/workspace/WorkspaceMigrations.d.ts.map +0 -1
- package/packages/db/src/migrations/workspace/WorkspaceMigrations.js +0 -251
- package/packages/db/src/migrations/workspace/WorkspaceMigrations.ts +0 -248
- package/packages/db/src/repositories/global/.gitkeep +0 -0
- package/packages/db/src/repositories/global/GlobalRepository.d.ts +0 -30
- package/packages/db/src/repositories/global/GlobalRepository.d.ts.map +0 -1
- package/packages/db/src/repositories/global/GlobalRepository.js +0 -209
- package/packages/db/src/repositories/global/GlobalRepository.ts +0 -492
- package/packages/db/src/repositories/workspace/.gitkeep +0 -0
- package/packages/db/src/repositories/workspace/WorkspaceRepository.d.ts +0 -282
- package/packages/db/src/repositories/workspace/WorkspaceRepository.d.ts.map +0 -1
- package/packages/db/src/repositories/workspace/WorkspaceRepository.js +0 -773
- package/packages/db/src/repositories/workspace/WorkspaceRepository.ts +0 -1511
- package/packages/db/src/sqlite/connection.d.ts +0 -11
- package/packages/db/src/sqlite/connection.d.ts.map +0 -1
- package/packages/db/src/sqlite/connection.js +0 -31
- package/packages/db/src/sqlite/connection.ts +0 -35
- package/packages/db/src/sqlite/pragmas.d.ts +0 -5
- package/packages/db/src/sqlite/pragmas.d.ts.map +0 -1
- package/packages/db/src/sqlite/pragmas.js +0 -6
- package/packages/db/src/sqlite/pragmas.ts +0 -10
- package/packages/db/tsconfig.json +0 -13
- package/packages/generators/package.json +0 -21
- package/packages/generators/src/__tests__/Generators.test.ts +0 -19
- package/packages/generators/src/index.ts +0 -1
- package/packages/generators/src/openapi/generateTypes.ts +0 -1
- package/packages/generators/src/openapi/validateSchema.ts +0 -1
- package/packages/generators/src/scaffolding/docs/.gitkeep +0 -0
- package/packages/generators/src/scaffolding/docs/DocsScaffolder.ts +0 -1
- package/packages/generators/src/scaffolding/global/.gitkeep +0 -0
- package/packages/generators/src/scaffolding/global/GlobalScaffolder.ts +0 -1
- package/packages/generators/src/scaffolding/workspace/.gitkeep +0 -0
- package/packages/generators/src/scaffolding/workspace/WorkspaceScaffolder.ts +0 -1
- package/packages/generators/tsconfig.json +0 -10
- package/packages/integrations/CHANGELOG.md +0 -7
- package/packages/integrations/LICENSE +0 -21
- package/packages/integrations/README.md +0 -9
- package/packages/integrations/package.json +0 -47
- package/packages/integrations/src/docdex/.gitkeep +0 -0
- package/packages/integrations/src/docdex/DocdexClient.d.ts +0 -50
- package/packages/integrations/src/docdex/DocdexClient.d.ts.map +0 -1
- package/packages/integrations/src/docdex/DocdexClient.js +0 -216
- package/packages/integrations/src/docdex/DocdexClient.ts +0 -261
- package/packages/integrations/src/docdex/__tests__/DocdexClient.test.ts +0 -29
- package/packages/integrations/src/index.d.ts +0 -2
- package/packages/integrations/src/index.d.ts.map +0 -1
- package/packages/integrations/src/index.js +0 -4
- package/packages/integrations/src/index.ts +0 -5
- package/packages/integrations/src/issues/.gitkeep +0 -0
- package/packages/integrations/src/issues/IssuesClient.ts +0 -1
- package/packages/integrations/src/issues/__tests__/IssuesClient.test.ts +0 -10
- package/packages/integrations/src/qa/.gitkeep +0 -0
- package/packages/integrations/src/qa/ChromiumQaAdapter.ts +0 -89
- package/packages/integrations/src/qa/CliQaAdapter.ts +0 -95
- package/packages/integrations/src/qa/MaestroQaAdapter.ts +0 -91
- package/packages/integrations/src/qa/QaAdapter.ts +0 -7
- package/packages/integrations/src/qa/QaClient.ts +0 -1
- package/packages/integrations/src/qa/QaTypes.ts +0 -26
- package/packages/integrations/src/qa/__tests__/ChromiumQaAdapter.test.ts +0 -30
- package/packages/integrations/src/qa/__tests__/CliQaAdapter.test.ts +0 -33
- package/packages/integrations/src/qa/__tests__/MaestroQaAdapter.test.ts +0 -30
- package/packages/integrations/src/qa/index.ts +0 -5
- package/packages/integrations/src/system/SystemClient.ts +0 -50
- package/packages/integrations/src/system/__tests__/SystemClient.test.ts +0 -40
- package/packages/integrations/src/telemetry/TelemetryClient.ts +0 -139
- package/packages/integrations/src/telemetry/__tests__/TelemetryClient.test.ts +0 -41
- package/packages/integrations/src/vcs/.gitkeep +0 -0
- package/packages/integrations/src/vcs/VcsClient.ts +0 -211
- package/packages/integrations/src/vcs/__tests__/VcsClient.test.ts +0 -26
- package/packages/integrations/tsconfig.json +0 -14
- package/packages/shared/CHANGELOG.md +0 -7
- package/packages/shared/LICENSE +0 -21
- package/packages/shared/README.md +0 -9
- package/packages/shared/package.json +0 -40
- package/packages/shared/src/__tests__/CommandMetadata.test.ts +0 -15
- package/packages/shared/src/__tests__/ServiceShells.test.ts +0 -16
- package/packages/shared/src/crypto/.gitkeep +0 -0
- package/packages/shared/src/crypto/CryptoHelper.d.ts +0 -15
- package/packages/shared/src/crypto/CryptoHelper.d.ts.map +0 -1
- package/packages/shared/src/crypto/CryptoHelper.js +0 -54
- package/packages/shared/src/crypto/CryptoHelper.ts +0 -57
- package/packages/shared/src/errors/.gitkeep +0 -0
- package/packages/shared/src/errors/ErrorFactory.ts +0 -1
- package/packages/shared/src/index.d.ts +0 -6
- package/packages/shared/src/index.d.ts.map +0 -1
- package/packages/shared/src/index.js +0 -4
- package/packages/shared/src/index.ts +0 -35
- package/packages/shared/src/logging/.gitkeep +0 -0
- package/packages/shared/src/logging/Logger.ts +0 -1
- package/packages/shared/src/metadata/CommandMetadata.ts +0 -165
- package/packages/shared/src/openapi/.gitkeep +0 -0
- package/packages/shared/src/openapi/OpenApiTypes.d.ts +0 -216
- package/packages/shared/src/openapi/OpenApiTypes.d.ts.map +0 -1
- package/packages/shared/src/openapi/OpenApiTypes.js +0 -1
- package/packages/shared/src/openapi/OpenApiTypes.ts +0 -312
- package/packages/shared/src/paths/.gitkeep +0 -0
- package/packages/shared/src/paths/PathHelper.d.ts +0 -12
- package/packages/shared/src/paths/PathHelper.d.ts.map +0 -1
- package/packages/shared/src/paths/PathHelper.js +0 -24
- package/packages/shared/src/paths/PathHelper.ts +0 -29
- package/packages/shared/src/qa/QaProfile.ts +0 -14
- package/packages/shared/src/utils/.gitkeep +0 -0
- package/packages/shared/src/utils/UtilityService.ts +0 -1
- package/packages/shared/tsconfig.json +0 -10
- package/packages/testing/package.json +0 -26
- package/packages/testing/src/__tests__/TestingFakes.test.ts +0 -15
- package/packages/testing/src/cli/e2e/.gitkeep +0 -0
- package/packages/testing/src/cli/e2e/E2eSuite.ts +0 -1
- package/packages/testing/src/fakes/agents/.gitkeep +0 -0
- package/packages/testing/src/fakes/agents/FakeAgents.ts +0 -1
- package/packages/testing/src/fakes/docdex/.gitkeep +0 -0
- package/packages/testing/src/fakes/docdex/FakeDocdexClient.ts +0 -1
- package/packages/testing/src/fakes/qa/.gitkeep +0 -0
- package/packages/testing/src/fakes/qa/FakeQaClient.ts +0 -1
- package/packages/testing/src/fakes/vcs/.gitkeep +0 -0
- package/packages/testing/src/fakes/vcs/FakeVcsClient.ts +0 -1
- package/packages/testing/src/fixtures/db/.gitkeep +0 -0
- package/packages/testing/src/fixtures/db/DbFixtures.ts +0 -1
- package/packages/testing/src/fixtures/workspaces/.gitkeep +0 -0
- package/packages/testing/src/fixtures/workspaces/WorkspaceFixtures.ts +0 -1
- package/packages/testing/src/index.ts +0 -1
- package/packages/testing/tsconfig.json +0 -10
- package/pnpm-workspace.yaml +0 -2
- package/prompts/README.md +0 -5
- package/prompts/code-reviewer.md +0 -23
- package/prompts/code-writer.md +0 -35
- package/prompts/gateway-agent.md +0 -27
- package/prompts/qa-agent.md +0 -21
- package/release-please-config.json +0 -39
- package/scripts/build-all.ts +0 -1
- package/scripts/dev.ts +0 -1
- package/scripts/install-local-cli.sh +0 -28
- package/scripts/pack-npm-tarballs.js +0 -63
- package/scripts/release.ts +0 -1
- package/scripts/run-node-tests.js +0 -37
- package/tests/all.js +0 -127
- package/tests/api/openapi_spec.test.js +0 -21
- package/tests/artifacts.md +0 -31
- package/tests/component/cli_version.test.js +0 -38
- package/tests/integration/workspace_resolver.test.js +0 -44
- package/tests/unit/crypto_helper.test.js +0 -36
- package/tests/unit/path_helper.test.js +0 -20
- package/tsconfig.base.json +0 -32
- /package/{packages/cli/src/index.ts → dist/index.js} +0 -0
|
@@ -1,167 +0,0 @@
|
|
|
1
|
-
import path from "node:path";
|
|
2
|
-
import { createRequire } from "node:module";
|
|
3
|
-
import { OpenApiService, WorkspaceResolver } from "@mcoda/core";
|
|
4
|
-
|
|
5
|
-
const usage =
|
|
6
|
-
"mcoda openapi-from-docs [--workspace-root <PATH>] [--agent <NAME>] [--agent-stream <true|false>] [--force] [--dry-run] [--validate-only] [--no-telemetry]";
|
|
7
|
-
|
|
8
|
-
export interface ParsedOpenapiArgs {
|
|
9
|
-
workspaceRoot?: string;
|
|
10
|
-
agentName?: string;
|
|
11
|
-
agentStream: boolean;
|
|
12
|
-
force: boolean;
|
|
13
|
-
dryRun: boolean;
|
|
14
|
-
validateOnly: boolean;
|
|
15
|
-
noTelemetry: boolean;
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
const parseBooleanFlag = (value: string | undefined, defaultValue: boolean): boolean => {
|
|
19
|
-
if (value === undefined) return defaultValue;
|
|
20
|
-
const normalized = value.toLowerCase();
|
|
21
|
-
if (["false", "0", "no"].includes(normalized)) return false;
|
|
22
|
-
if (["true", "1", "yes"].includes(normalized)) return true;
|
|
23
|
-
return defaultValue;
|
|
24
|
-
};
|
|
25
|
-
|
|
26
|
-
export const parseOpenapiArgs = (argv: string[]): ParsedOpenapiArgs => {
|
|
27
|
-
let workspaceRoot: string | undefined;
|
|
28
|
-
let agentName: string | undefined;
|
|
29
|
-
let agentStream: boolean | undefined;
|
|
30
|
-
let force = false;
|
|
31
|
-
let dryRun = false;
|
|
32
|
-
let validateOnly = false;
|
|
33
|
-
let noTelemetry = false;
|
|
34
|
-
|
|
35
|
-
for (let i = 0; i < argv.length; i += 1) {
|
|
36
|
-
const arg = argv[i];
|
|
37
|
-
if (arg.startsWith("--agent-stream=")) {
|
|
38
|
-
const [, raw] = arg.split("=", 2);
|
|
39
|
-
agentStream = parseBooleanFlag(raw, true);
|
|
40
|
-
continue;
|
|
41
|
-
}
|
|
42
|
-
switch (arg) {
|
|
43
|
-
case "--workspace-root":
|
|
44
|
-
workspaceRoot = argv[i + 1] ? path.resolve(argv[i + 1]) : undefined;
|
|
45
|
-
i += 1;
|
|
46
|
-
break;
|
|
47
|
-
case "--agent":
|
|
48
|
-
agentName = argv[i + 1];
|
|
49
|
-
i += 1;
|
|
50
|
-
break;
|
|
51
|
-
case "--agent-stream": {
|
|
52
|
-
const next = argv[i + 1];
|
|
53
|
-
if (next && !next.startsWith("--")) {
|
|
54
|
-
agentStream = parseBooleanFlag(next, true);
|
|
55
|
-
i += 1;
|
|
56
|
-
} else {
|
|
57
|
-
agentStream = true;
|
|
58
|
-
}
|
|
59
|
-
break;
|
|
60
|
-
}
|
|
61
|
-
case "--force":
|
|
62
|
-
force = true;
|
|
63
|
-
break;
|
|
64
|
-
case "--dry-run":
|
|
65
|
-
dryRun = true;
|
|
66
|
-
break;
|
|
67
|
-
case "--validate-only":
|
|
68
|
-
validateOnly = true;
|
|
69
|
-
break;
|
|
70
|
-
case "--no-telemetry":
|
|
71
|
-
noTelemetry = true;
|
|
72
|
-
break;
|
|
73
|
-
case "--help":
|
|
74
|
-
case "-h":
|
|
75
|
-
// eslint-disable-next-line no-console
|
|
76
|
-
console.log(usage);
|
|
77
|
-
process.exit(0);
|
|
78
|
-
break;
|
|
79
|
-
default:
|
|
80
|
-
break;
|
|
81
|
-
}
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
return {
|
|
85
|
-
workspaceRoot,
|
|
86
|
-
agentName,
|
|
87
|
-
agentStream: agentStream ?? true,
|
|
88
|
-
force,
|
|
89
|
-
dryRun,
|
|
90
|
-
validateOnly,
|
|
91
|
-
noTelemetry,
|
|
92
|
-
};
|
|
93
|
-
};
|
|
94
|
-
|
|
95
|
-
const readCliVersion = (): string => {
|
|
96
|
-
const require = createRequire(import.meta.url);
|
|
97
|
-
try {
|
|
98
|
-
// Resolve the package version from the CLI package.json
|
|
99
|
-
// eslint-disable-next-line @typescript-eslint/no-var-requires
|
|
100
|
-
const pkg = require("../../package.json") as { version?: string };
|
|
101
|
-
return pkg.version ?? "0.0.0";
|
|
102
|
-
} catch {
|
|
103
|
-
return "0.0.0";
|
|
104
|
-
}
|
|
105
|
-
};
|
|
106
|
-
|
|
107
|
-
export class OpenapiCommands {
|
|
108
|
-
static async run(argv: string[]): Promise<void> {
|
|
109
|
-
const parsed = parseOpenapiArgs(argv);
|
|
110
|
-
const workspace = await WorkspaceResolver.resolveWorkspace({
|
|
111
|
-
cwd: process.cwd(),
|
|
112
|
-
explicitWorkspace: parsed.workspaceRoot,
|
|
113
|
-
});
|
|
114
|
-
const service = await OpenApiService.create(workspace, { noTelemetry: parsed.noTelemetry });
|
|
115
|
-
try {
|
|
116
|
-
const cliVersion = readCliVersion();
|
|
117
|
-
const shouldStream = parsed.agentStream;
|
|
118
|
-
const onToken = shouldStream ? (token: string) => process.stdout.write(token) : undefined;
|
|
119
|
-
const result = await service.generateFromDocs({
|
|
120
|
-
workspace,
|
|
121
|
-
agentName: parsed.agentName,
|
|
122
|
-
agentStream: parsed.agentStream,
|
|
123
|
-
force: parsed.force,
|
|
124
|
-
dryRun: parsed.dryRun,
|
|
125
|
-
validateOnly: parsed.validateOnly,
|
|
126
|
-
cliVersion,
|
|
127
|
-
onToken,
|
|
128
|
-
});
|
|
129
|
-
if (shouldStream) {
|
|
130
|
-
// separate streamed content from the summary
|
|
131
|
-
// eslint-disable-next-line no-console
|
|
132
|
-
console.log("\n");
|
|
133
|
-
}
|
|
134
|
-
// eslint-disable-next-line no-console
|
|
135
|
-
console.log(`OpenAPI job ${result.jobId} ${parsed.validateOnly ? "validated" : "completed"}.`);
|
|
136
|
-
if (result.outputPath) {
|
|
137
|
-
// eslint-disable-next-line no-console
|
|
138
|
-
console.log(`Output: ${result.outputPath}${parsed.dryRun ? " (dry run, not written)" : ""}`);
|
|
139
|
-
} else if (parsed.dryRun) {
|
|
140
|
-
// eslint-disable-next-line no-console
|
|
141
|
-
console.log("Dry run: spec not written to disk.");
|
|
142
|
-
}
|
|
143
|
-
if (result.docdexId) {
|
|
144
|
-
// eslint-disable-next-line no-console
|
|
145
|
-
console.log(`Docdex ID: ${result.docdexId}`);
|
|
146
|
-
}
|
|
147
|
-
if (result.warnings.length) {
|
|
148
|
-
const banner = result.warnings.map((w) => `! ${w}`).join("\n");
|
|
149
|
-
// eslint-disable-next-line no-console
|
|
150
|
-
console.warn(banner);
|
|
151
|
-
}
|
|
152
|
-
if (parsed.dryRun) {
|
|
153
|
-
// eslint-disable-next-line no-console
|
|
154
|
-
console.log("\n--- Generated OpenAPI ---\n");
|
|
155
|
-
// eslint-disable-next-line no-console
|
|
156
|
-
console.log(result.spec);
|
|
157
|
-
}
|
|
158
|
-
} catch (error) {
|
|
159
|
-
const message = error instanceof Error ? error.message : String(error);
|
|
160
|
-
// eslint-disable-next-line no-console
|
|
161
|
-
console.error(`ERROR: ${message}`);
|
|
162
|
-
process.exitCode = 1;
|
|
163
|
-
} finally {
|
|
164
|
-
await service.close();
|
|
165
|
-
}
|
|
166
|
-
}
|
|
167
|
-
}
|
|
File without changes
|
|
@@ -1,149 +0,0 @@
|
|
|
1
|
-
import path from "node:path";
|
|
2
|
-
import { CreateTasksService, WorkspaceResolver } from "@mcoda/core";
|
|
3
|
-
import { PathHelper } from "@mcoda/shared";
|
|
4
|
-
|
|
5
|
-
interface ParsedArgs {
|
|
6
|
-
workspaceRoot?: string;
|
|
7
|
-
projectKey?: string;
|
|
8
|
-
agentName?: string;
|
|
9
|
-
agentStream: boolean;
|
|
10
|
-
maxEpics?: number;
|
|
11
|
-
maxStoriesPerEpic?: number;
|
|
12
|
-
maxTasksPerStory?: number;
|
|
13
|
-
quiet?: boolean;
|
|
14
|
-
inputs: string[];
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
const usage = `mcoda create-tasks [INPUT...] [--workspace-root <path>] [--project-key <key>] [--agent <name>] [--agent-stream [true|false]] [--max-epics N] [--max-stories-per-epic N] [--max-tasks-per-story N] [--quiet]`;
|
|
18
|
-
|
|
19
|
-
const parseBooleanFlag = (value: string | undefined, defaultValue: boolean): boolean => {
|
|
20
|
-
if (value === undefined) return defaultValue;
|
|
21
|
-
const normalized = value.toLowerCase();
|
|
22
|
-
if (["false", "0", "no"].includes(normalized)) return false;
|
|
23
|
-
if (["true", "1", "yes"].includes(normalized)) return true;
|
|
24
|
-
return defaultValue;
|
|
25
|
-
};
|
|
26
|
-
|
|
27
|
-
export const parseCreateTasksArgs = (argv: string[]): ParsedArgs => {
|
|
28
|
-
const inputs: string[] = [];
|
|
29
|
-
let workspaceRoot: string | undefined;
|
|
30
|
-
let projectKey: string | undefined;
|
|
31
|
-
let agentName: string | undefined;
|
|
32
|
-
let agentStream: boolean | undefined;
|
|
33
|
-
let maxEpics: number | undefined;
|
|
34
|
-
let maxStoriesPerEpic: number | undefined;
|
|
35
|
-
let maxTasksPerStory: number | undefined;
|
|
36
|
-
let quiet = false;
|
|
37
|
-
|
|
38
|
-
for (let i = 0; i < argv.length; i += 1) {
|
|
39
|
-
const arg = argv[i];
|
|
40
|
-
if (arg.startsWith("--")) {
|
|
41
|
-
switch (arg) {
|
|
42
|
-
case "--workspace-root":
|
|
43
|
-
workspaceRoot = argv[i + 1] ? path.resolve(argv[i + 1]) : undefined;
|
|
44
|
-
i += 1;
|
|
45
|
-
break;
|
|
46
|
-
case "--project-key":
|
|
47
|
-
case "--project":
|
|
48
|
-
projectKey = argv[i + 1];
|
|
49
|
-
i += 1;
|
|
50
|
-
break;
|
|
51
|
-
case "--agent":
|
|
52
|
-
agentName = argv[i + 1];
|
|
53
|
-
i += 1;
|
|
54
|
-
break;
|
|
55
|
-
case "--agent-stream": {
|
|
56
|
-
const next = argv[i + 1];
|
|
57
|
-
if (next && !next.startsWith("--")) {
|
|
58
|
-
agentStream = parseBooleanFlag(next, true);
|
|
59
|
-
i += 1;
|
|
60
|
-
} else {
|
|
61
|
-
agentStream = true;
|
|
62
|
-
}
|
|
63
|
-
break;
|
|
64
|
-
}
|
|
65
|
-
case "--max-epics":
|
|
66
|
-
maxEpics = Number(argv[i + 1]);
|
|
67
|
-
i += 1;
|
|
68
|
-
break;
|
|
69
|
-
case "--max-stories-per-epic":
|
|
70
|
-
maxStoriesPerEpic = Number(argv[i + 1]);
|
|
71
|
-
i += 1;
|
|
72
|
-
break;
|
|
73
|
-
case "--max-tasks-per-story":
|
|
74
|
-
maxTasksPerStory = Number(argv[i + 1]);
|
|
75
|
-
i += 1;
|
|
76
|
-
break;
|
|
77
|
-
case "--quiet":
|
|
78
|
-
quiet = true;
|
|
79
|
-
break;
|
|
80
|
-
case "--help":
|
|
81
|
-
case "-h":
|
|
82
|
-
// eslint-disable-next-line no-console
|
|
83
|
-
console.log(usage);
|
|
84
|
-
process.exit(0);
|
|
85
|
-
break;
|
|
86
|
-
default:
|
|
87
|
-
break;
|
|
88
|
-
}
|
|
89
|
-
} else {
|
|
90
|
-
inputs.push(arg);
|
|
91
|
-
}
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
return {
|
|
95
|
-
workspaceRoot,
|
|
96
|
-
projectKey,
|
|
97
|
-
agentName,
|
|
98
|
-
agentStream: agentStream ?? true,
|
|
99
|
-
maxEpics: Number.isFinite(maxEpics) ? maxEpics : undefined,
|
|
100
|
-
maxStoriesPerEpic: Number.isFinite(maxStoriesPerEpic) ? maxStoriesPerEpic : undefined,
|
|
101
|
-
maxTasksPerStory: Number.isFinite(maxTasksPerStory) ? maxTasksPerStory : undefined,
|
|
102
|
-
quiet,
|
|
103
|
-
inputs,
|
|
104
|
-
};
|
|
105
|
-
};
|
|
106
|
-
|
|
107
|
-
export class CreateTasksCommand {
|
|
108
|
-
static async run(argv: string[]): Promise<void> {
|
|
109
|
-
const parsed = parseCreateTasksArgs(argv);
|
|
110
|
-
const workspace = await WorkspaceResolver.resolveWorkspace({
|
|
111
|
-
cwd: process.cwd(),
|
|
112
|
-
explicitWorkspace: parsed.workspaceRoot,
|
|
113
|
-
});
|
|
114
|
-
const derivedKey = path.basename(workspace.workspaceRoot).replace(/[^a-z0-9]+/gi, "").toLowerCase();
|
|
115
|
-
const projectKey = parsed.projectKey ?? (derivedKey || "proj");
|
|
116
|
-
const service = await CreateTasksService.create(workspace);
|
|
117
|
-
|
|
118
|
-
try {
|
|
119
|
-
const result = await service.createTasks({
|
|
120
|
-
workspace,
|
|
121
|
-
projectKey,
|
|
122
|
-
inputs: parsed.inputs,
|
|
123
|
-
agentName: parsed.agentName,
|
|
124
|
-
agentStream: parsed.agentStream,
|
|
125
|
-
maxEpics: parsed.maxEpics,
|
|
126
|
-
maxStoriesPerEpic: parsed.maxStoriesPerEpic,
|
|
127
|
-
maxTasksPerStory: parsed.maxTasksPerStory,
|
|
128
|
-
});
|
|
129
|
-
|
|
130
|
-
const dbPath = PathHelper.getWorkspaceDbPath(workspace.workspaceRoot);
|
|
131
|
-
if (!parsed.quiet) {
|
|
132
|
-
// eslint-disable-next-line no-console
|
|
133
|
-
console.log(
|
|
134
|
-
[
|
|
135
|
-
`Created ${result.epics.length} epics, ${result.stories.length} stories, ${result.tasks.length} tasks, ${result.dependencies.length} dependencies.`,
|
|
136
|
-
`Stored in ${dbPath}.`,
|
|
137
|
-
`Job ID: ${result.jobId}, Command Run: ${result.commandRunId}`,
|
|
138
|
-
].join("\n"),
|
|
139
|
-
);
|
|
140
|
-
}
|
|
141
|
-
} catch (error) {
|
|
142
|
-
// eslint-disable-next-line no-console
|
|
143
|
-
console.error(`create-tasks failed: ${(error as Error).message}`);
|
|
144
|
-
process.exitCode = 1;
|
|
145
|
-
} finally {
|
|
146
|
-
await service.close();
|
|
147
|
-
}
|
|
148
|
-
}
|
|
149
|
-
}
|
|
@@ -1,105 +0,0 @@
|
|
|
1
|
-
import path from "node:path";
|
|
2
|
-
import { CreateTasksService, WorkspaceResolver } from "@mcoda/core";
|
|
3
|
-
|
|
4
|
-
const usage = `mcoda migrate-tasks [--workspace-root <path>] [--project-key <key>] [--plan-dir <path>] [--refine-plan <path>] [--refine-plans-dir <path>] [--quiet]`;
|
|
5
|
-
|
|
6
|
-
export interface ParsedMigrateTasksArgs {
|
|
7
|
-
workspaceRoot?: string;
|
|
8
|
-
projectKey?: string;
|
|
9
|
-
planDir?: string;
|
|
10
|
-
refinePlans: string[];
|
|
11
|
-
refinePlansDir?: string;
|
|
12
|
-
force: boolean;
|
|
13
|
-
quiet: boolean;
|
|
14
|
-
help: boolean;
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
export const parseMigrateTasksArgs = (argv: string[]): ParsedMigrateTasksArgs => {
|
|
18
|
-
const args: ParsedMigrateTasksArgs = {
|
|
19
|
-
refinePlans: [],
|
|
20
|
-
force: false,
|
|
21
|
-
quiet: false,
|
|
22
|
-
help: false,
|
|
23
|
-
};
|
|
24
|
-
for (let i = 0; i < argv.length; i++) {
|
|
25
|
-
const arg = argv[i];
|
|
26
|
-
if (arg === "--workspace-root" && argv[i + 1]) {
|
|
27
|
-
args.workspaceRoot = argv[++i];
|
|
28
|
-
} else if ((arg === "--project" || arg === "--project-key") && argv[i + 1]) {
|
|
29
|
-
args.projectKey = argv[++i];
|
|
30
|
-
} else if (arg === "--plan-dir" && argv[i + 1]) {
|
|
31
|
-
args.planDir = argv[++i];
|
|
32
|
-
} else if (arg === "--refine-plan" && argv[i + 1]) {
|
|
33
|
-
args.refinePlans.push(argv[++i]);
|
|
34
|
-
} else if (arg === "--refine-plans-dir" && argv[i + 1]) {
|
|
35
|
-
args.refinePlansDir = argv[++i];
|
|
36
|
-
} else if (arg === "--force") {
|
|
37
|
-
args.force = true;
|
|
38
|
-
} else if (arg === "--quiet") {
|
|
39
|
-
args.quiet = true;
|
|
40
|
-
} else if (arg === "--help" || arg === "-h") {
|
|
41
|
-
args.help = true;
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
return args;
|
|
45
|
-
};
|
|
46
|
-
|
|
47
|
-
export class MigrateTasksCommand {
|
|
48
|
-
static async run(argv: string[]): Promise<void> {
|
|
49
|
-
const args = parseMigrateTasksArgs(argv);
|
|
50
|
-
if (args.help) {
|
|
51
|
-
console.log(usage);
|
|
52
|
-
return;
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
const workspace = await WorkspaceResolver.resolveWorkspace({
|
|
56
|
-
cwd: process.cwd(),
|
|
57
|
-
explicitWorkspace: args.workspaceRoot ?? undefined,
|
|
58
|
-
});
|
|
59
|
-
const workspaceRoot = workspace.workspaceRoot;
|
|
60
|
-
const derivedKey = path.basename(workspaceRoot).replace(/[^a-z0-9]+/gi, "").toLowerCase();
|
|
61
|
-
const projectKey = args.projectKey ?? (derivedKey || "proj");
|
|
62
|
-
const planDir = args.planDir;
|
|
63
|
-
|
|
64
|
-
if (!projectKey) {
|
|
65
|
-
console.error("Project key is required. Use --project-key <key>.");
|
|
66
|
-
process.exitCode = 1;
|
|
67
|
-
return;
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
const service = await CreateTasksService.create(workspace);
|
|
71
|
-
|
|
72
|
-
try {
|
|
73
|
-
const result = await service.migratePlanFromFolder({
|
|
74
|
-
projectKey,
|
|
75
|
-
planDir,
|
|
76
|
-
force: args.force,
|
|
77
|
-
refinePlanPaths: args.refinePlans.length ? args.refinePlans : undefined,
|
|
78
|
-
refinePlansDir: args.refinePlansDir,
|
|
79
|
-
});
|
|
80
|
-
if (!args.quiet) {
|
|
81
|
-
console.log(
|
|
82
|
-
[
|
|
83
|
-
`Migrated plan from ${planDir ?? path.join(workspaceRoot, ".mcoda", "tasks", projectKey)}`,
|
|
84
|
-
`Epics: ${result.epics.length}`,
|
|
85
|
-
`Stories: ${result.stories.length}`,
|
|
86
|
-
`Tasks: ${result.tasks.length}`,
|
|
87
|
-
`Dependencies: ${result.dependencies.length}`,
|
|
88
|
-
].join("\n"),
|
|
89
|
-
);
|
|
90
|
-
}
|
|
91
|
-
} catch (error) {
|
|
92
|
-
console.error(`migrate-tasks failed: ${(error as Error).message}`);
|
|
93
|
-
process.exitCode = 1;
|
|
94
|
-
} finally {
|
|
95
|
-
try {
|
|
96
|
-
await service.close();
|
|
97
|
-
} catch (error) {
|
|
98
|
-
const msg = (error as Error).message ?? "";
|
|
99
|
-
if (!msg.includes("database is closed")) {
|
|
100
|
-
throw error;
|
|
101
|
-
}
|
|
102
|
-
}
|
|
103
|
-
}
|
|
104
|
-
}
|
|
105
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export class PlanningCommands {}
|