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,261 +0,0 @@
|
|
|
1
|
-
import { randomUUID } from "node:crypto";
|
|
2
|
-
import path from "node:path";
|
|
3
|
-
import { promises as fs } from "node:fs";
|
|
4
|
-
|
|
5
|
-
export interface DocdexSegment {
|
|
6
|
-
id: string;
|
|
7
|
-
docId: string;
|
|
8
|
-
index: number;
|
|
9
|
-
content: string;
|
|
10
|
-
heading?: string;
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
export interface DocdexDocument {
|
|
14
|
-
id: string;
|
|
15
|
-
docType: string;
|
|
16
|
-
path?: string;
|
|
17
|
-
title?: string;
|
|
18
|
-
content?: string;
|
|
19
|
-
metadata?: Record<string, unknown>;
|
|
20
|
-
createdAt: string;
|
|
21
|
-
updatedAt: string;
|
|
22
|
-
segments?: DocdexSegment[];
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
export interface RegisterDocumentInput {
|
|
26
|
-
docType: string;
|
|
27
|
-
path?: string;
|
|
28
|
-
title?: string;
|
|
29
|
-
content: string;
|
|
30
|
-
metadata?: Record<string, unknown>;
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
interface DocdexStore {
|
|
34
|
-
updatedAt: string;
|
|
35
|
-
documents: DocdexDocument[];
|
|
36
|
-
segments: DocdexSegment[];
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
const nowIso = (): string => new Date().toISOString();
|
|
40
|
-
|
|
41
|
-
const segmentize = (docId: string, content: string): DocdexSegment[] => {
|
|
42
|
-
const lines = content.split(/\r?\n/);
|
|
43
|
-
const segments: DocdexSegment[] = [];
|
|
44
|
-
let buffer: string[] = [];
|
|
45
|
-
let heading = "";
|
|
46
|
-
const flush = () => {
|
|
47
|
-
if (buffer.length === 0) return;
|
|
48
|
-
segments.push({
|
|
49
|
-
id: `${docId}-seg-${segments.length + 1}`,
|
|
50
|
-
docId,
|
|
51
|
-
index: segments.length,
|
|
52
|
-
content: buffer.join("\n").trim(),
|
|
53
|
-
heading: heading || undefined,
|
|
54
|
-
});
|
|
55
|
-
buffer = [];
|
|
56
|
-
heading = "";
|
|
57
|
-
};
|
|
58
|
-
for (const line of lines) {
|
|
59
|
-
if (/^#{1,6}\s+/.test(line)) {
|
|
60
|
-
flush();
|
|
61
|
-
heading = line.replace(/^#{1,6}\s+/, "").trim();
|
|
62
|
-
}
|
|
63
|
-
buffer.push(line);
|
|
64
|
-
if (buffer.join("").length > 1500) {
|
|
65
|
-
flush();
|
|
66
|
-
}
|
|
67
|
-
}
|
|
68
|
-
flush();
|
|
69
|
-
return segments;
|
|
70
|
-
};
|
|
71
|
-
|
|
72
|
-
export class DocdexClient {
|
|
73
|
-
constructor(
|
|
74
|
-
private options: {
|
|
75
|
-
workspaceRoot?: string;
|
|
76
|
-
storePath?: string;
|
|
77
|
-
baseUrl?: string;
|
|
78
|
-
authToken?: string;
|
|
79
|
-
} = {},
|
|
80
|
-
) {}
|
|
81
|
-
|
|
82
|
-
private getStorePath(): string {
|
|
83
|
-
const base = this.options.storePath
|
|
84
|
-
? path.resolve(this.options.storePath)
|
|
85
|
-
: path.join(this.options.workspaceRoot ?? process.cwd(), ".mcoda", "docdex", "documents.json");
|
|
86
|
-
return base;
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
private normalizePath(inputPath?: string): string | undefined {
|
|
90
|
-
if (!inputPath) return undefined;
|
|
91
|
-
const absolute = path.resolve(inputPath);
|
|
92
|
-
if (this.options.workspaceRoot) {
|
|
93
|
-
const root = path.resolve(this.options.workspaceRoot);
|
|
94
|
-
if (absolute.startsWith(root)) {
|
|
95
|
-
return path.relative(root, absolute);
|
|
96
|
-
}
|
|
97
|
-
}
|
|
98
|
-
return absolute;
|
|
99
|
-
}
|
|
100
|
-
|
|
101
|
-
private async loadStore(): Promise<DocdexStore> {
|
|
102
|
-
const storePath = this.getStorePath();
|
|
103
|
-
try {
|
|
104
|
-
const raw = await fs.readFile(storePath, "utf8");
|
|
105
|
-
const parsed = JSON.parse(raw) as DocdexStore;
|
|
106
|
-
parsed.documents = parsed.documents ?? [];
|
|
107
|
-
parsed.segments = parsed.segments ?? [];
|
|
108
|
-
return parsed;
|
|
109
|
-
} catch {
|
|
110
|
-
return { updatedAt: nowIso(), documents: [], segments: [] };
|
|
111
|
-
}
|
|
112
|
-
}
|
|
113
|
-
|
|
114
|
-
private async fetchRemote<T>(pathname: string, init?: RequestInit): Promise<T> {
|
|
115
|
-
if (!this.options.baseUrl) throw new Error("Docdex baseUrl not configured");
|
|
116
|
-
const url = new URL(pathname, this.options.baseUrl);
|
|
117
|
-
const headers: Record<string, string> = { "Content-Type": "application/json" };
|
|
118
|
-
if (this.options.authToken) headers.authorization = `Bearer ${this.options.authToken}`;
|
|
119
|
-
const response = await fetch(url, { ...init, headers: { ...headers, ...(init?.headers as any) } });
|
|
120
|
-
if (!response.ok) {
|
|
121
|
-
throw new Error(`Docdex request failed (${response.status}): ${await response.text()}`);
|
|
122
|
-
}
|
|
123
|
-
return (await response.json()) as T;
|
|
124
|
-
}
|
|
125
|
-
|
|
126
|
-
private async saveStore(store: DocdexStore): Promise<void> {
|
|
127
|
-
const storePath = this.getStorePath();
|
|
128
|
-
await fs.mkdir(path.dirname(storePath), { recursive: true });
|
|
129
|
-
const payload = { ...store, updatedAt: nowIso() };
|
|
130
|
-
await fs.writeFile(storePath, JSON.stringify(payload, null, 2), "utf8");
|
|
131
|
-
}
|
|
132
|
-
|
|
133
|
-
async fetchDocumentById(id: string): Promise<DocdexDocument> {
|
|
134
|
-
if (this.options.baseUrl) {
|
|
135
|
-
try {
|
|
136
|
-
const doc = await this.fetchRemote<DocdexDocument>(`/documents/${id}`);
|
|
137
|
-
return doc;
|
|
138
|
-
} catch (error) {
|
|
139
|
-
// fall through to local if remote fails
|
|
140
|
-
// eslint-disable-next-line no-console
|
|
141
|
-
console.warn(`Docdex remote fetch failed, falling back to local: ${(error as Error).message}`);
|
|
142
|
-
}
|
|
143
|
-
}
|
|
144
|
-
const store = await this.loadStore();
|
|
145
|
-
const doc = store.documents.find((d) => d.id === id);
|
|
146
|
-
if (!doc) {
|
|
147
|
-
throw new Error(`Docdex document not found: ${id}`);
|
|
148
|
-
}
|
|
149
|
-
const segments = store.segments.filter((s) => s.docId === id);
|
|
150
|
-
return { ...doc, segments };
|
|
151
|
-
}
|
|
152
|
-
|
|
153
|
-
async findDocumentByPath(docPath: string, docType?: string): Promise<DocdexDocument | undefined> {
|
|
154
|
-
const normalized = this.normalizePath(docPath);
|
|
155
|
-
const store = await this.loadStore();
|
|
156
|
-
const doc = store.documents.find(
|
|
157
|
-
(d) => d.path === normalized && (!docType || d.docType.toLowerCase() === docType.toLowerCase()),
|
|
158
|
-
);
|
|
159
|
-
if (!doc) return undefined;
|
|
160
|
-
return { ...doc, segments: store.segments.filter((s) => s.docId === doc.id) };
|
|
161
|
-
}
|
|
162
|
-
|
|
163
|
-
async search(filter: { docType?: string; projectKey?: string; query?: string; profile?: string }): Promise<DocdexDocument[]> {
|
|
164
|
-
if (this.options.baseUrl) {
|
|
165
|
-
try {
|
|
166
|
-
const params = new URLSearchParams();
|
|
167
|
-
if (filter.docType) params.set("doc_type", filter.docType);
|
|
168
|
-
if (filter.projectKey) params.set("project_key", filter.projectKey);
|
|
169
|
-
if (filter.query) params.set("q", filter.query);
|
|
170
|
-
if (filter.profile) params.set("profile", filter.profile);
|
|
171
|
-
const path = `/documents?${params.toString()}`;
|
|
172
|
-
const docs = await this.fetchRemote<DocdexDocument[]>(path);
|
|
173
|
-
return docs;
|
|
174
|
-
} catch (error) {
|
|
175
|
-
// eslint-disable-next-line no-console
|
|
176
|
-
console.warn(`Docdex remote search failed, falling back to local: ${(error as Error).message}`);
|
|
177
|
-
}
|
|
178
|
-
}
|
|
179
|
-
const store = await this.loadStore();
|
|
180
|
-
return store.documents
|
|
181
|
-
.filter((doc) => {
|
|
182
|
-
if (filter.docType && doc.docType.toLowerCase() !== filter.docType.toLowerCase()) return false;
|
|
183
|
-
if (filter.projectKey && doc.metadata && (doc.metadata as any).projectKey !== filter.projectKey) return false;
|
|
184
|
-
return true;
|
|
185
|
-
})
|
|
186
|
-
.map((doc) => ({ ...doc, segments: store.segments.filter((s) => s.docId === doc.id) }));
|
|
187
|
-
}
|
|
188
|
-
|
|
189
|
-
async registerDocument(input: RegisterDocumentInput): Promise<DocdexDocument> {
|
|
190
|
-
if (this.options.baseUrl) {
|
|
191
|
-
try {
|
|
192
|
-
const registered = await this.fetchRemote<DocdexDocument>(`/documents`, {
|
|
193
|
-
method: "POST",
|
|
194
|
-
body: JSON.stringify({
|
|
195
|
-
doc_type: input.docType,
|
|
196
|
-
path: input.path,
|
|
197
|
-
title: input.title,
|
|
198
|
-
content: input.content,
|
|
199
|
-
metadata: input.metadata,
|
|
200
|
-
}),
|
|
201
|
-
});
|
|
202
|
-
return registered;
|
|
203
|
-
} catch (error) {
|
|
204
|
-
// eslint-disable-next-line no-console
|
|
205
|
-
console.warn(`Docdex remote register failed, falling back to local: ${(error as Error).message}`);
|
|
206
|
-
}
|
|
207
|
-
}
|
|
208
|
-
const store = await this.loadStore();
|
|
209
|
-
const normalizedPath = this.normalizePath(input.path);
|
|
210
|
-
const existingByPath = normalizedPath
|
|
211
|
-
? store.documents.find(
|
|
212
|
-
(d) =>
|
|
213
|
-
d.path === normalizedPath &&
|
|
214
|
-
d.docType.toLowerCase() === input.docType.toLowerCase() &&
|
|
215
|
-
(input.metadata?.projectKey ? (d.metadata as any)?.projectKey === input.metadata.projectKey : true),
|
|
216
|
-
)
|
|
217
|
-
: undefined;
|
|
218
|
-
const now = nowIso();
|
|
219
|
-
if (existingByPath) {
|
|
220
|
-
const updated: DocdexDocument = {
|
|
221
|
-
...existingByPath,
|
|
222
|
-
content: input.content ?? existingByPath.content,
|
|
223
|
-
metadata: { ...(existingByPath.metadata ?? {}), ...(input.metadata ?? {}) },
|
|
224
|
-
title: input.title ?? existingByPath.title,
|
|
225
|
-
updatedAt: now,
|
|
226
|
-
};
|
|
227
|
-
const segments = segmentize(updated.id, input.content);
|
|
228
|
-
store.documents[store.documents.findIndex((d) => d.id === existingByPath.id)] = updated;
|
|
229
|
-
store.segments = store.segments.filter((s) => s.docId !== updated.id).concat(segments);
|
|
230
|
-
await this.saveStore(store);
|
|
231
|
-
return { ...updated, segments };
|
|
232
|
-
}
|
|
233
|
-
const doc: DocdexDocument = {
|
|
234
|
-
id: randomUUID(),
|
|
235
|
-
docType: input.docType,
|
|
236
|
-
path: normalizedPath,
|
|
237
|
-
content: input.content,
|
|
238
|
-
metadata: input.metadata,
|
|
239
|
-
title: input.title,
|
|
240
|
-
createdAt: now,
|
|
241
|
-
updatedAt: now,
|
|
242
|
-
};
|
|
243
|
-
const segments = segmentize(doc.id, input.content);
|
|
244
|
-
store.documents.push(doc);
|
|
245
|
-
store.segments.push(...segments);
|
|
246
|
-
await this.saveStore(store);
|
|
247
|
-
return { ...doc, segments };
|
|
248
|
-
}
|
|
249
|
-
|
|
250
|
-
async ensureRegisteredFromFile(
|
|
251
|
-
docPath: string,
|
|
252
|
-
docType: string,
|
|
253
|
-
metadata?: Record<string, unknown>,
|
|
254
|
-
): Promise<DocdexDocument> {
|
|
255
|
-
const normalizedPath = this.normalizePath(docPath) ?? docPath;
|
|
256
|
-
const existing = await this.findDocumentByPath(normalizedPath, docType);
|
|
257
|
-
if (existing) return existing;
|
|
258
|
-
const content = await fs.readFile(docPath, "utf8");
|
|
259
|
-
return this.registerDocument({ docType, path: docPath, content, metadata });
|
|
260
|
-
}
|
|
261
|
-
}
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import test from "node:test";
|
|
2
|
-
import assert from "node:assert/strict";
|
|
3
|
-
import fs from "node:fs/promises";
|
|
4
|
-
import os from "node:os";
|
|
5
|
-
import path from "node:path";
|
|
6
|
-
import { DocdexClient } from "../DocdexClient.js";
|
|
7
|
-
|
|
8
|
-
test("DocdexClient registers and searches documents locally", async () => {
|
|
9
|
-
const dir = await fs.mkdtemp(path.join(os.tmpdir(), "mcoda-docdex-"));
|
|
10
|
-
const client = new DocdexClient({ workspaceRoot: dir });
|
|
11
|
-
try {
|
|
12
|
-
const registered = await client.registerDocument({
|
|
13
|
-
docType: "SDS",
|
|
14
|
-
path: path.join(dir, "docs", "sds", "demo.md"),
|
|
15
|
-
title: "Demo",
|
|
16
|
-
content: "# Heading\nContent line",
|
|
17
|
-
metadata: { projectKey: "proj" },
|
|
18
|
-
});
|
|
19
|
-
|
|
20
|
-
const found = await client.fetchDocumentById(registered.id);
|
|
21
|
-
assert.equal(found.id, registered.id);
|
|
22
|
-
assert.ok(found.segments && found.segments.length > 0);
|
|
23
|
-
|
|
24
|
-
const search = await client.search({ docType: "SDS", projectKey: "proj" });
|
|
25
|
-
assert.ok(search.some((doc) => doc.id === registered.id));
|
|
26
|
-
} finally {
|
|
27
|
-
await fs.rm(dir, { recursive: true, force: true });
|
|
28
|
-
}
|
|
29
|
-
});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":"AAAA,cAAc,0BAA0B,CAAC"}
|
|
File without changes
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export class IssuesClient {}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { describe, it } from "node:test";
|
|
2
|
-
import assert from "node:assert/strict";
|
|
3
|
-
import { IssuesClient } from "../IssuesClient.js";
|
|
4
|
-
|
|
5
|
-
describe("IssuesClient", () => {
|
|
6
|
-
it("exports a client class", () => {
|
|
7
|
-
assert.equal(typeof IssuesClient, "function");
|
|
8
|
-
assert.ok(new IssuesClient());
|
|
9
|
-
});
|
|
10
|
-
});
|
|
File without changes
|
|
@@ -1,89 +0,0 @@
|
|
|
1
|
-
import path from 'node:path';
|
|
2
|
-
import { exec as execCb } from 'node:child_process';
|
|
3
|
-
import { promisify } from 'node:util';
|
|
4
|
-
import { QaProfile } from '@mcoda/shared/qa/QaProfile.js';
|
|
5
|
-
import { QaAdapter } from './QaAdapter.js';
|
|
6
|
-
import { QaContext, QaEnsureResult, QaRunResult } from './QaTypes.js';
|
|
7
|
-
import fs from 'node:fs/promises';
|
|
8
|
-
|
|
9
|
-
const exec = promisify(execCb);
|
|
10
|
-
const shouldSkipInstall = (ctx: QaContext) =>
|
|
11
|
-
process.env.MCODA_QA_SKIP_INSTALL === '1' || ctx.env?.MCODA_QA_SKIP_INSTALL === '1';
|
|
12
|
-
|
|
13
|
-
export class ChromiumQaAdapter implements QaAdapter {
|
|
14
|
-
private resolveCwd(profile: QaProfile, ctx: QaContext): string {
|
|
15
|
-
if (profile.working_dir) {
|
|
16
|
-
return path.isAbsolute(profile.working_dir)
|
|
17
|
-
? profile.working_dir
|
|
18
|
-
: path.join(ctx.workspaceRoot, profile.working_dir);
|
|
19
|
-
}
|
|
20
|
-
return ctx.workspaceRoot;
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
async ensureInstalled(profile: QaProfile, ctx: QaContext): Promise<QaEnsureResult> {
|
|
24
|
-
if (shouldSkipInstall(ctx)) return { ok: true, details: { skipped: true } };
|
|
25
|
-
const cwd = this.resolveCwd(profile, ctx);
|
|
26
|
-
try {
|
|
27
|
-
await exec('npx playwright --version', { cwd, env: { ...process.env, ...profile.env, ...ctx.env } });
|
|
28
|
-
return { ok: true };
|
|
29
|
-
} catch (versionError: any) {
|
|
30
|
-
const installCommand = profile.install_command ?? 'npx playwright install chromium';
|
|
31
|
-
try {
|
|
32
|
-
await exec(installCommand, { cwd, env: { ...process.env, ...profile.env, ...ctx.env } });
|
|
33
|
-
return { ok: true, details: { installedVia: installCommand } };
|
|
34
|
-
} catch (error: any) {
|
|
35
|
-
return { ok: false, message: error?.message ?? versionError?.message ?? 'Chromium QA install failed' };
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
private async persistLogs(ctx: QaContext, stdout: string, stderr: string): Promise<string[]> {
|
|
41
|
-
const artifacts: string[] = [];
|
|
42
|
-
if (!ctx.artifactDir) return artifacts;
|
|
43
|
-
await fs.mkdir(ctx.artifactDir, { recursive: true });
|
|
44
|
-
const outPath = path.join(ctx.artifactDir, 'stdout.log');
|
|
45
|
-
const errPath = path.join(ctx.artifactDir, 'stderr.log');
|
|
46
|
-
await fs.writeFile(outPath, stdout ?? '', 'utf8');
|
|
47
|
-
await fs.writeFile(errPath, stderr ?? '', 'utf8');
|
|
48
|
-
artifacts.push(path.relative(ctx.workspaceRoot, outPath), path.relative(ctx.workspaceRoot, errPath));
|
|
49
|
-
return artifacts;
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
async invoke(profile: QaProfile, ctx: QaContext): Promise<QaRunResult> {
|
|
53
|
-
const command = ctx.testCommandOverride ?? profile.test_command ?? 'npx playwright test --reporter=list';
|
|
54
|
-
const startedAt = new Date().toISOString();
|
|
55
|
-
const cwd = this.resolveCwd(profile, ctx);
|
|
56
|
-
try {
|
|
57
|
-
const { stdout, stderr } = await exec(command, {
|
|
58
|
-
cwd,
|
|
59
|
-
env: { ...process.env, ...profile.env, ...ctx.env },
|
|
60
|
-
});
|
|
61
|
-
const finishedAt = new Date().toISOString();
|
|
62
|
-
const artifacts = await this.persistLogs(ctx, stdout, stderr);
|
|
63
|
-
return {
|
|
64
|
-
outcome: 'pass',
|
|
65
|
-
exitCode: 0,
|
|
66
|
-
stdout,
|
|
67
|
-
stderr,
|
|
68
|
-
artifacts,
|
|
69
|
-
startedAt,
|
|
70
|
-
finishedAt,
|
|
71
|
-
};
|
|
72
|
-
} catch (error: any) {
|
|
73
|
-
const stdout = error?.stdout ?? '';
|
|
74
|
-
const stderr = error?.stderr ?? String(error);
|
|
75
|
-
const exitCode = typeof error?.code === 'number' ? error.code : null;
|
|
76
|
-
const finishedAt = new Date().toISOString();
|
|
77
|
-
const artifacts = await this.persistLogs(ctx, stdout, stderr);
|
|
78
|
-
return {
|
|
79
|
-
outcome: exitCode === null ? 'infra_issue' : exitCode === 0 ? 'pass' : 'fail',
|
|
80
|
-
exitCode,
|
|
81
|
-
stdout,
|
|
82
|
-
stderr,
|
|
83
|
-
artifacts,
|
|
84
|
-
startedAt,
|
|
85
|
-
finishedAt,
|
|
86
|
-
};
|
|
87
|
-
}
|
|
88
|
-
}
|
|
89
|
-
}
|
|
@@ -1,95 +0,0 @@
|
|
|
1
|
-
import path from 'node:path';
|
|
2
|
-
import { exec as execCb } from 'node:child_process';
|
|
3
|
-
import { promisify } from 'node:util';
|
|
4
|
-
import { QaProfile } from '@mcoda/shared/qa/QaProfile.js';
|
|
5
|
-
import { QaAdapter } from './QaAdapter.js';
|
|
6
|
-
import { QaContext, QaEnsureResult, QaRunResult } from './QaTypes.js';
|
|
7
|
-
import fs from 'node:fs/promises';
|
|
8
|
-
|
|
9
|
-
const exec = promisify(execCb);
|
|
10
|
-
|
|
11
|
-
export class CliQaAdapter implements QaAdapter {
|
|
12
|
-
private resolveCwd(profile: QaProfile, ctx: QaContext): string {
|
|
13
|
-
if (profile.working_dir) {
|
|
14
|
-
return path.isAbsolute(profile.working_dir)
|
|
15
|
-
? profile.working_dir
|
|
16
|
-
: path.join(ctx.workspaceRoot, profile.working_dir);
|
|
17
|
-
}
|
|
18
|
-
return ctx.workspaceRoot;
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
async ensureInstalled(profile: QaProfile, ctx: QaContext): Promise<QaEnsureResult> {
|
|
22
|
-
if (!profile.install_command) return { ok: true };
|
|
23
|
-
try {
|
|
24
|
-
await exec(profile.install_command, {
|
|
25
|
-
cwd: this.resolveCwd(profile, ctx),
|
|
26
|
-
env: { ...process.env, ...profile.env, ...ctx.env },
|
|
27
|
-
});
|
|
28
|
-
return { ok: true };
|
|
29
|
-
} catch (error: any) {
|
|
30
|
-
return { ok: false, message: error?.message ?? 'QA install failed' };
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
private async persistLogs(ctx: QaContext, stdout: string, stderr: string): Promise<string[]> {
|
|
35
|
-
const artifacts: string[] = [];
|
|
36
|
-
if (!ctx.artifactDir) return artifacts;
|
|
37
|
-
await fs.mkdir(ctx.artifactDir, { recursive: true });
|
|
38
|
-
const outPath = path.join(ctx.artifactDir, 'stdout.log');
|
|
39
|
-
const errPath = path.join(ctx.artifactDir, 'stderr.log');
|
|
40
|
-
await fs.writeFile(outPath, stdout ?? '', 'utf8');
|
|
41
|
-
await fs.writeFile(errPath, stderr ?? '', 'utf8');
|
|
42
|
-
artifacts.push(path.relative(ctx.workspaceRoot, outPath), path.relative(ctx.workspaceRoot, errPath));
|
|
43
|
-
return artifacts;
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
async invoke(profile: QaProfile, ctx: QaContext): Promise<QaRunResult> {
|
|
47
|
-
const command = ctx.testCommandOverride ?? profile.test_command;
|
|
48
|
-
const startedAt = new Date().toISOString();
|
|
49
|
-
if (!command) {
|
|
50
|
-
const finishedAt = new Date().toISOString();
|
|
51
|
-
return {
|
|
52
|
-
outcome: 'infra_issue',
|
|
53
|
-
exitCode: null,
|
|
54
|
-
stdout: '',
|
|
55
|
-
stderr: 'No test_command configured for QA profile',
|
|
56
|
-
artifacts: [],
|
|
57
|
-
startedAt,
|
|
58
|
-
finishedAt,
|
|
59
|
-
};
|
|
60
|
-
}
|
|
61
|
-
const cwd = this.resolveCwd(profile, ctx);
|
|
62
|
-
try {
|
|
63
|
-
const { stdout, stderr } = await exec(command, {
|
|
64
|
-
cwd,
|
|
65
|
-
env: { ...process.env, ...profile.env, ...ctx.env },
|
|
66
|
-
});
|
|
67
|
-
const finishedAt = new Date().toISOString();
|
|
68
|
-
const artifacts = await this.persistLogs(ctx, stdout, stderr);
|
|
69
|
-
return {
|
|
70
|
-
outcome: 'pass',
|
|
71
|
-
exitCode: 0,
|
|
72
|
-
stdout,
|
|
73
|
-
stderr,
|
|
74
|
-
artifacts,
|
|
75
|
-
startedAt,
|
|
76
|
-
finishedAt,
|
|
77
|
-
};
|
|
78
|
-
} catch (error: any) {
|
|
79
|
-
const stdout = error?.stdout ?? '';
|
|
80
|
-
const stderr = error?.stderr ?? String(error);
|
|
81
|
-
const exitCode = typeof error?.code === 'number' ? error.code : null;
|
|
82
|
-
const finishedAt = new Date().toISOString();
|
|
83
|
-
const artifacts = await this.persistLogs(ctx, stdout, stderr);
|
|
84
|
-
return {
|
|
85
|
-
outcome: exitCode === null ? 'infra_issue' : exitCode === 0 ? 'pass' : 'fail',
|
|
86
|
-
exitCode,
|
|
87
|
-
stdout,
|
|
88
|
-
stderr,
|
|
89
|
-
artifacts,
|
|
90
|
-
startedAt,
|
|
91
|
-
finishedAt,
|
|
92
|
-
};
|
|
93
|
-
}
|
|
94
|
-
}
|
|
95
|
-
}
|
|
@@ -1,91 +0,0 @@
|
|
|
1
|
-
import path from 'node:path';
|
|
2
|
-
import { exec as execCb } from 'node:child_process';
|
|
3
|
-
import { promisify } from 'node:util';
|
|
4
|
-
import { QaProfile } from '@mcoda/shared/qa/QaProfile.js';
|
|
5
|
-
import { QaAdapter } from './QaAdapter.js';
|
|
6
|
-
import { QaContext, QaEnsureResult, QaRunResult } from './QaTypes.js';
|
|
7
|
-
import fs from 'node:fs/promises';
|
|
8
|
-
|
|
9
|
-
const exec = promisify(execCb);
|
|
10
|
-
const shouldSkipInstall = (ctx: QaContext) =>
|
|
11
|
-
process.env.MCODA_QA_SKIP_INSTALL === '1' || ctx.env?.MCODA_QA_SKIP_INSTALL === '1';
|
|
12
|
-
|
|
13
|
-
export class MaestroQaAdapter implements QaAdapter {
|
|
14
|
-
private resolveCwd(profile: QaProfile, ctx: QaContext): string {
|
|
15
|
-
if (profile.working_dir) {
|
|
16
|
-
return path.isAbsolute(profile.working_dir)
|
|
17
|
-
? profile.working_dir
|
|
18
|
-
: path.join(ctx.workspaceRoot, profile.working_dir);
|
|
19
|
-
}
|
|
20
|
-
return ctx.workspaceRoot;
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
async ensureInstalled(profile: QaProfile, ctx: QaContext): Promise<QaEnsureResult> {
|
|
24
|
-
if (shouldSkipInstall(ctx)) return { ok: true, details: { skipped: true } };
|
|
25
|
-
const cwd = this.resolveCwd(profile, ctx);
|
|
26
|
-
try {
|
|
27
|
-
await exec('maestro --version', { cwd, env: { ...process.env, ...profile.env, ...ctx.env } });
|
|
28
|
-
return { ok: true };
|
|
29
|
-
} catch (versionError: any) {
|
|
30
|
-
if (!profile.install_command) {
|
|
31
|
-
return { ok: false, message: versionError?.message ?? 'Maestro not available' };
|
|
32
|
-
}
|
|
33
|
-
try {
|
|
34
|
-
await exec(profile.install_command, { cwd, env: { ...process.env, ...profile.env, ...ctx.env } });
|
|
35
|
-
return { ok: true, details: { installedVia: profile.install_command } };
|
|
36
|
-
} catch (error: any) {
|
|
37
|
-
return { ok: false, message: error?.message ?? versionError?.message ?? 'Maestro install failed' };
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
private async persistLogs(ctx: QaContext, stdout: string, stderr: string): Promise<string[]> {
|
|
43
|
-
const artifacts: string[] = [];
|
|
44
|
-
if (!ctx.artifactDir) return artifacts;
|
|
45
|
-
await fs.mkdir(ctx.artifactDir, { recursive: true });
|
|
46
|
-
const outPath = path.join(ctx.artifactDir, 'stdout.log');
|
|
47
|
-
const errPath = path.join(ctx.artifactDir, 'stderr.log');
|
|
48
|
-
await fs.writeFile(outPath, stdout ?? '', 'utf8');
|
|
49
|
-
await fs.writeFile(errPath, stderr ?? '', 'utf8');
|
|
50
|
-
artifacts.push(path.relative(ctx.workspaceRoot, outPath), path.relative(ctx.workspaceRoot, errPath));
|
|
51
|
-
return artifacts;
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
async invoke(profile: QaProfile, ctx: QaContext): Promise<QaRunResult> {
|
|
55
|
-
const command = ctx.testCommandOverride ?? profile.test_command ?? 'maestro test';
|
|
56
|
-
const startedAt = new Date().toISOString();
|
|
57
|
-
const cwd = this.resolveCwd(profile, ctx);
|
|
58
|
-
try {
|
|
59
|
-
const { stdout, stderr } = await exec(command, {
|
|
60
|
-
cwd,
|
|
61
|
-
env: { ...process.env, ...profile.env, ...ctx.env },
|
|
62
|
-
});
|
|
63
|
-
const finishedAt = new Date().toISOString();
|
|
64
|
-
const artifacts = await this.persistLogs(ctx, stdout, stderr);
|
|
65
|
-
return {
|
|
66
|
-
outcome: 'pass',
|
|
67
|
-
exitCode: 0,
|
|
68
|
-
stdout,
|
|
69
|
-
stderr,
|
|
70
|
-
artifacts,
|
|
71
|
-
startedAt,
|
|
72
|
-
finishedAt,
|
|
73
|
-
};
|
|
74
|
-
} catch (error: any) {
|
|
75
|
-
const stdout = error?.stdout ?? '';
|
|
76
|
-
const stderr = error?.stderr ?? String(error);
|
|
77
|
-
const exitCode = typeof error?.code === 'number' ? error.code : null;
|
|
78
|
-
const finishedAt = new Date().toISOString();
|
|
79
|
-
const artifacts = await this.persistLogs(ctx, stdout, stderr);
|
|
80
|
-
return {
|
|
81
|
-
outcome: exitCode === null ? 'infra_issue' : exitCode === 0 ? 'pass' : 'fail',
|
|
82
|
-
exitCode,
|
|
83
|
-
stdout,
|
|
84
|
-
stderr,
|
|
85
|
-
artifacts,
|
|
86
|
-
startedAt,
|
|
87
|
-
finishedAt,
|
|
88
|
-
};
|
|
89
|
-
}
|
|
90
|
-
}
|
|
91
|
-
}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { QaContext, QaEnsureResult, QaRunResult } from './QaTypes.js';
|
|
2
|
-
import { QaProfile } from '@mcoda/shared/qa/QaProfile.js';
|
|
3
|
-
|
|
4
|
-
export interface QaAdapter {
|
|
5
|
-
ensureInstalled(profile: QaProfile, ctx: QaContext): Promise<QaEnsureResult>;
|
|
6
|
-
invoke(profile: QaProfile, ctx: QaContext): Promise<QaRunResult>;
|
|
7
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export class QaClient {}
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
export type QaOutcome = 'pass' | 'fail' | 'infra_issue';
|
|
2
|
-
|
|
3
|
-
export interface QaRunResult {
|
|
4
|
-
outcome: QaOutcome;
|
|
5
|
-
exitCode: number | null;
|
|
6
|
-
stdout: string;
|
|
7
|
-
stderr: string;
|
|
8
|
-
artifacts: string[];
|
|
9
|
-
startedAt: string;
|
|
10
|
-
finishedAt: string;
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
export interface QaEnsureResult {
|
|
14
|
-
ok: boolean;
|
|
15
|
-
message?: string;
|
|
16
|
-
details?: Record<string, unknown>;
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
export interface QaContext {
|
|
20
|
-
workspaceRoot: string;
|
|
21
|
-
jobId: string;
|
|
22
|
-
taskKey: string;
|
|
23
|
-
env: NodeJS.ProcessEnv;
|
|
24
|
-
testCommandOverride?: string;
|
|
25
|
-
artifactDir?: string;
|
|
26
|
-
}
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import test from "node:test";
|
|
2
|
-
import assert from "node:assert/strict";
|
|
3
|
-
import fs from "node:fs/promises";
|
|
4
|
-
import os from "node:os";
|
|
5
|
-
import path from "node:path";
|
|
6
|
-
import { ChromiumQaAdapter } from "../ChromiumQaAdapter.js";
|
|
7
|
-
import { QaProfile } from "@mcoda/shared/qa/QaProfile.js";
|
|
8
|
-
|
|
9
|
-
test("ChromiumQaAdapter runs test command and captures artifacts with install skip", async () => {
|
|
10
|
-
const tmp = await fs.mkdtemp(path.join(os.tmpdir(), "mcoda-qa-chromium-"));
|
|
11
|
-
const adapter = new ChromiumQaAdapter();
|
|
12
|
-
const profile: QaProfile = {
|
|
13
|
-
name: "ui",
|
|
14
|
-
runner: "chromium",
|
|
15
|
-
test_command: 'node -e "console.log(\\"ui ok\\")"',
|
|
16
|
-
};
|
|
17
|
-
const ctx = {
|
|
18
|
-
workspaceRoot: tmp,
|
|
19
|
-
jobId: "job-1",
|
|
20
|
-
taskKey: "task-1",
|
|
21
|
-
env: { ...process.env, MCODA_QA_SKIP_INSTALL: "1" },
|
|
22
|
-
artifactDir: path.join(tmp, ".mcoda", "jobs", "job-1", "qa", "task-1"),
|
|
23
|
-
};
|
|
24
|
-
const ensure = await adapter.ensureInstalled(profile, ctx);
|
|
25
|
-
assert.equal(ensure.ok, true);
|
|
26
|
-
const result = await adapter.invoke(profile, ctx);
|
|
27
|
-
assert.equal(result.outcome, "pass");
|
|
28
|
-
assert.equal(result.exitCode, 0);
|
|
29
|
-
assert.ok(result.artifacts.length >= 2);
|
|
30
|
-
});
|