@mcoda/core 0.1.7 → 0.1.9
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 +4 -1
- package/README.md +22 -3
- package/dist/api/AgentsApi.d.ts +8 -1
- package/dist/api/AgentsApi.d.ts.map +1 -1
- package/dist/api/AgentsApi.js +70 -0
- package/dist/api/QaTasksApi.d.ts.map +1 -1
- package/dist/api/QaTasksApi.js +2 -0
- package/dist/api/TasksApi.d.ts.map +1 -1
- package/dist/api/TasksApi.js +1 -0
- package/dist/index.d.ts +4 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +4 -0
- package/dist/prompts/PdrPrompts.d.ts.map +1 -1
- package/dist/prompts/PdrPrompts.js +3 -1
- package/dist/prompts/SdsPrompts.d.ts.map +1 -1
- package/dist/prompts/SdsPrompts.js +2 -0
- package/dist/services/agents/AgentRatingFormula.d.ts +27 -0
- package/dist/services/agents/AgentRatingFormula.d.ts.map +1 -0
- package/dist/services/agents/AgentRatingFormula.js +45 -0
- package/dist/services/agents/AgentRatingService.d.ts +41 -0
- package/dist/services/agents/AgentRatingService.d.ts.map +1 -0
- package/dist/services/agents/AgentRatingService.js +299 -0
- package/dist/services/agents/GatewayAgentService.d.ts +3 -0
- package/dist/services/agents/GatewayAgentService.d.ts.map +1 -1
- package/dist/services/agents/GatewayAgentService.js +68 -24
- package/dist/services/agents/GatewayHandoff.d.ts +7 -0
- package/dist/services/agents/GatewayHandoff.d.ts.map +1 -0
- package/dist/services/agents/GatewayHandoff.js +108 -0
- package/dist/services/backlog/TaskOrderingService.d.ts +1 -0
- package/dist/services/backlog/TaskOrderingService.d.ts.map +1 -1
- package/dist/services/backlog/TaskOrderingService.js +19 -16
- package/dist/services/docs/DocsService.d.ts +11 -1
- package/dist/services/docs/DocsService.d.ts.map +1 -1
- package/dist/services/docs/DocsService.js +240 -52
- package/dist/services/execution/GatewayTrioService.d.ts +133 -0
- package/dist/services/execution/GatewayTrioService.d.ts.map +1 -0
- package/dist/services/execution/GatewayTrioService.js +1125 -0
- package/dist/services/execution/QaFollowupService.d.ts +1 -0
- package/dist/services/execution/QaFollowupService.d.ts.map +1 -1
- package/dist/services/execution/QaFollowupService.js +1 -0
- package/dist/services/execution/QaProfileService.d.ts +6 -0
- package/dist/services/execution/QaProfileService.d.ts.map +1 -1
- package/dist/services/execution/QaProfileService.js +165 -3
- package/dist/services/execution/QaTasksService.d.ts +18 -0
- package/dist/services/execution/QaTasksService.d.ts.map +1 -1
- package/dist/services/execution/QaTasksService.js +712 -34
- package/dist/services/execution/WorkOnTasksService.d.ts +14 -0
- package/dist/services/execution/WorkOnTasksService.d.ts.map +1 -1
- package/dist/services/execution/WorkOnTasksService.js +1497 -240
- package/dist/services/openapi/OpenApiService.d.ts +10 -0
- package/dist/services/openapi/OpenApiService.d.ts.map +1 -1
- package/dist/services/openapi/OpenApiService.js +66 -10
- package/dist/services/planning/CreateTasksService.d.ts +6 -0
- package/dist/services/planning/CreateTasksService.d.ts.map +1 -1
- package/dist/services/planning/CreateTasksService.js +261 -28
- package/dist/services/planning/RefineTasksService.d.ts +5 -0
- package/dist/services/planning/RefineTasksService.d.ts.map +1 -1
- package/dist/services/planning/RefineTasksService.js +184 -35
- package/dist/services/review/CodeReviewService.d.ts +14 -0
- package/dist/services/review/CodeReviewService.d.ts.map +1 -1
- package/dist/services/review/CodeReviewService.js +657 -61
- package/dist/services/shared/ProjectGuidance.d.ts +6 -0
- package/dist/services/shared/ProjectGuidance.d.ts.map +1 -0
- package/dist/services/shared/ProjectGuidance.js +21 -0
- package/dist/services/tasks/TaskCommentFormatter.d.ts +20 -0
- package/dist/services/tasks/TaskCommentFormatter.d.ts.map +1 -0
- package/dist/services/tasks/TaskCommentFormatter.js +54 -0
- package/dist/workspace/WorkspaceManager.d.ts +4 -0
- package/dist/workspace/WorkspaceManager.d.ts.map +1 -1
- package/dist/workspace/WorkspaceManager.js +3 -0
- package/package.json +5 -5
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ProjectGuidance.d.ts","sourceRoot":"","sources":["../../../src/services/shared/ProjectGuidance.ts"],"names":[],"mappings":"AAGA,MAAM,MAAM,eAAe,GAAG;IAC5B,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,MAAM,CAAC;CAChB,CAAC;AAOF,eAAO,MAAM,mBAAmB,GAAU,eAAe,MAAM,KAAG,OAAO,CAAC,eAAe,GAAG,IAAI,CAY/F,CAAC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import fs from "node:fs/promises";
|
|
2
|
+
import path from "node:path";
|
|
3
|
+
const guidanceCandidates = (workspaceRoot) => [
|
|
4
|
+
path.join(workspaceRoot, ".mcoda", "docs", "project-guidance.md"),
|
|
5
|
+
path.join(workspaceRoot, "docs", "project-guidance.md"),
|
|
6
|
+
];
|
|
7
|
+
export const loadProjectGuidance = async (workspaceRoot) => {
|
|
8
|
+
for (const candidate of guidanceCandidates(workspaceRoot)) {
|
|
9
|
+
try {
|
|
10
|
+
const content = (await fs.readFile(candidate, "utf8")).trim();
|
|
11
|
+
if (!content)
|
|
12
|
+
continue;
|
|
13
|
+
return { content, source: candidate };
|
|
14
|
+
}
|
|
15
|
+
catch {
|
|
16
|
+
// ignore missing file
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
console.warn(`[project-guidance] no project guidance found; searched: ${guidanceCandidates(workspaceRoot).join(", ")}`);
|
|
20
|
+
return null;
|
|
21
|
+
};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
export interface TaskCommentSlugInput {
|
|
2
|
+
source: string;
|
|
3
|
+
message: string;
|
|
4
|
+
file?: string | null;
|
|
5
|
+
line?: number | null;
|
|
6
|
+
category?: string | null;
|
|
7
|
+
}
|
|
8
|
+
export interface TaskCommentFormatInput {
|
|
9
|
+
slug: string;
|
|
10
|
+
source: string;
|
|
11
|
+
message: string;
|
|
12
|
+
status?: string | null;
|
|
13
|
+
category?: string | null;
|
|
14
|
+
file?: string | null;
|
|
15
|
+
line?: number | null;
|
|
16
|
+
suggestedFix?: string | null;
|
|
17
|
+
}
|
|
18
|
+
export declare const createTaskCommentSlug: (input: TaskCommentSlugInput) => string;
|
|
19
|
+
export declare const formatTaskCommentBody: (input: TaskCommentFormatInput) => string;
|
|
20
|
+
//# sourceMappingURL=TaskCommentFormatter.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TaskCommentFormatter.d.ts","sourceRoot":"","sources":["../../../src/services/tasks/TaskCommentFormatter.ts"],"names":[],"mappings":"AAEA,MAAM,WAAW,oBAAoB;IACnC,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,IAAI,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,QAAQ,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CAC1B;AAED,MAAM,WAAW,sBAAsB;IACrC,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACvB,QAAQ,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,IAAI,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,IAAI,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,YAAY,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CAC9B;AAiBD,eAAO,MAAM,qBAAqB,GAAI,OAAO,oBAAoB,KAAG,MAiBnE,CAAC;AAEF,eAAO,MAAM,qBAAqB,GAAI,OAAO,sBAAsB,KAAG,MAyBrE,CAAC"}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { createHash } from "node:crypto";
|
|
2
|
+
const slugify = (value) => value
|
|
3
|
+
.toLowerCase()
|
|
4
|
+
.replace(/[^a-z0-9]+/g, "-")
|
|
5
|
+
.replace(/^-+|-+$/g, "")
|
|
6
|
+
.replace(/-{2,}/g, "-");
|
|
7
|
+
const normalizePath = (value) => value
|
|
8
|
+
.replace(/\\/g, "/")
|
|
9
|
+
.replace(/^\.\//, "")
|
|
10
|
+
.replace(/^\/+/, "");
|
|
11
|
+
const buildStableHash = (input) => createHash("sha1").update(input).digest("hex").slice(0, 8);
|
|
12
|
+
export const createTaskCommentSlug = (input) => {
|
|
13
|
+
const baseParts = [
|
|
14
|
+
input.source,
|
|
15
|
+
input.category ?? undefined,
|
|
16
|
+
input.file ? normalizePath(input.file) : undefined,
|
|
17
|
+
typeof input.line === "number" ? `L${input.line}` : undefined,
|
|
18
|
+
].filter(Boolean);
|
|
19
|
+
const base = slugify(baseParts.join("-")) || "comment";
|
|
20
|
+
const trimmedBase = base.length > 60 ? base.slice(0, 60).replace(/-+$/g, "") : base;
|
|
21
|
+
const hashInput = [
|
|
22
|
+
input.source,
|
|
23
|
+
input.category ?? "",
|
|
24
|
+
input.file ?? "",
|
|
25
|
+
typeof input.line === "number" ? String(input.line) : "",
|
|
26
|
+
input.message.trim(),
|
|
27
|
+
].join("|");
|
|
28
|
+
return `${trimmedBase || "comment"}-${buildStableHash(hashInput)}`;
|
|
29
|
+
};
|
|
30
|
+
export const formatTaskCommentBody = (input) => {
|
|
31
|
+
const message = input.message.trim() || "(no details provided)";
|
|
32
|
+
const suggestedFix = input.suggestedFix?.trim();
|
|
33
|
+
const location = input.file && typeof input.line === "number"
|
|
34
|
+
? `${normalizePath(input.file)}:${input.line}`
|
|
35
|
+
: input.file
|
|
36
|
+
? normalizePath(input.file)
|
|
37
|
+
: undefined;
|
|
38
|
+
const lines = [
|
|
39
|
+
"[task-comment]",
|
|
40
|
+
`slug: ${input.slug}`,
|
|
41
|
+
`source: ${input.source}`,
|
|
42
|
+
input.category ? `category: ${input.category}` : undefined,
|
|
43
|
+
`status: ${input.status ?? "open"}`,
|
|
44
|
+
location ? `location: ${location}` : undefined,
|
|
45
|
+
"message:",
|
|
46
|
+
message,
|
|
47
|
+
].filter(Boolean);
|
|
48
|
+
if (suggestedFix) {
|
|
49
|
+
lines.push("");
|
|
50
|
+
lines.push("suggested_fix:");
|
|
51
|
+
lines.push(suggestedFix);
|
|
52
|
+
}
|
|
53
|
+
return lines.join("\n");
|
|
54
|
+
};
|
|
@@ -18,6 +18,10 @@ export interface WorkspaceConfig {
|
|
|
18
18
|
mirrorDocs?: boolean;
|
|
19
19
|
branch?: string;
|
|
20
20
|
docdexUrl?: string;
|
|
21
|
+
projectKey?: string;
|
|
22
|
+
restrictAutoMergeWithoutScope?: boolean;
|
|
23
|
+
autoMerge?: boolean;
|
|
24
|
+
autoPush?: boolean;
|
|
21
25
|
velocity?: {
|
|
22
26
|
implementationSpPerHour?: number;
|
|
23
27
|
reviewSpPerHour?: number;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"WorkspaceManager.d.ts","sourceRoot":"","sources":["../../src/workspace/WorkspaceManager.ts"],"names":[],"mappings":"AAKA,MAAM,WAAW,mBAAmB;IAClC,aAAa,EAAE,MAAM,CAAC;IACtB,WAAW,EAAE,MAAM,CAAC;IACpB,EAAE,EAAE,MAAM,CAAC;IACX,kBAAkB,EAAE,MAAM,EAAE,CAAC;IAC7B,QAAQ,EAAE,MAAM,CAAC;IACjB,eAAe,EAAE,MAAM,CAAC;IACxB,YAAY,EAAE,MAAM,CAAC;IACrB,MAAM,CAAC,EAAE,eAAe,CAAC;CAC1B;AAED,MAAM,WAAW,oBAAoB;IACnC,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,WAAW,eAAe;IAC9B,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,SAAS,CAA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AAK,CAAC,EAAE,MAAM,CAAC;KAChB,CAAC;IACF,SAAS,CAAC,EAAE,oBAAoB,CAAC;CAClC;AAwHD,qBAAa,iBAAiB;WACf,gBAAgB,CAAC,KAAK,EAAE;QAAE,GAAG,CAAC,EAAE,MAAM,CAAC;QAAC,iBAAiB,CAAC,EAAE,MAAM,CAAA;KAAE,GAAG,OAAO,CAAC,mBAAmB,CAAC;CAiFjH"}
|
|
@@ -74,6 +74,9 @@ const looksLikeWorkspaceId = (value) => /^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a
|
|
|
74
74
|
const migrateWorkspaceDbIds = async (workspace, legacyIds) => {
|
|
75
75
|
if (!legacyIds.length)
|
|
76
76
|
return;
|
|
77
|
+
if (!(await fileExists(workspace.workspaceDbPath))) {
|
|
78
|
+
return;
|
|
79
|
+
}
|
|
77
80
|
try {
|
|
78
81
|
const { Connection } = await import("@mcoda/db");
|
|
79
82
|
const conn = await Connection.open(workspace.workspaceDbPath);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mcoda/core",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.9",
|
|
4
4
|
"description": "Core services and APIs for the mcoda CLI.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -32,10 +32,10 @@
|
|
|
32
32
|
"dependencies": {
|
|
33
33
|
"@apidevtools/swagger-parser": "^10.1.0",
|
|
34
34
|
"yaml": "^2.4.2",
|
|
35
|
-
"@mcoda/
|
|
36
|
-
"@mcoda/
|
|
37
|
-
"@mcoda/agents": "0.1.
|
|
38
|
-
"@mcoda/integrations": "0.1.
|
|
35
|
+
"@mcoda/db": "0.1.9",
|
|
36
|
+
"@mcoda/shared": "0.1.9",
|
|
37
|
+
"@mcoda/agents": "0.1.9",
|
|
38
|
+
"@mcoda/integrations": "0.1.9"
|
|
39
39
|
},
|
|
40
40
|
"scripts": {
|
|
41
41
|
"build": "tsc -p tsconfig.json",
|