@harness-engineering/cli 1.18.0 → 1.20.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{agents-md-DUYNKHJZ.js → agents-md-WHXVPOK2.js} +1 -1
- package/dist/{architecture-UBO5KKUV.js → architecture-45YCLD26.js} +2 -2
- package/dist/bin/harness-mcp.js +11 -11
- package/dist/bin/harness.js +13 -13
- package/dist/{check-phase-gate-OSHN2AEL.js → check-phase-gate-2VXVOUJ5.js} +3 -3
- package/dist/{chunk-UX3JHYEA.js → chunk-45ZJPG24.js} +1 -1
- package/dist/{chunk-APNPXLB2.js → chunk-4U4V7A6U.js} +2 -2
- package/dist/{chunk-GWXP3JVA.js → chunk-A33LHIRD.js} +1 -1
- package/dist/{chunk-QSRRBNLY.js → chunk-H6KZAGHZ.js} +4 -4
- package/dist/{chunk-VF23UTNB.js → chunk-IC5CZSHF.js} +160 -28
- package/dist/{chunk-TG7IUJ3J.js → chunk-LEWXD6PR.js} +1 -1
- package/dist/{chunk-5FM64G6D.js → chunk-LVJ7SCD7.js} +2 -2
- package/dist/{chunk-TZIHFNEG.js → chunk-PDEEQJHH.js} +5 -5
- package/dist/{chunk-ABQUCXRE.js → chunk-PDOSLTWP.js} +1 -1
- package/dist/{chunk-OA3MOZGG.js → chunk-RJFWCL6M.js} +14 -14
- package/dist/{chunk-OHZVGIPE.js → chunk-V73TEHIF.js} +3 -3
- package/dist/{chunk-ZA2I7S3E.js → chunk-YDOGGQSF.js} +1 -1
- package/dist/{chunk-2DMIQ35P.js → chunk-YL4UHE52.js} +67 -62
- package/dist/{ci-workflow-FJZMNZPT.js → ci-workflow-HWX5OVLI.js} +1 -1
- package/dist/{dist-MF5BK5AD.js → dist-WHL3NN5S.js} +1 -1
- package/dist/{docs-WZHW4N4P.js → docs-FJFY7GF2.js} +3 -3
- package/dist/{engine-VS6ZJ2VZ.js → engine-R5BZHIZB.js} +1 -1
- package/dist/{entropy-FCIGJIIT.js → entropy-Y2GE4MYS.js} +2 -2
- package/dist/{feedback-O3FYTZIE.js → feedback-FKZ7GMPO.js} +1 -1
- package/dist/{generate-agent-definitions-EYG263XD.js → generate-agent-definitions-LN3A45OL.js} +1 -1
- package/dist/index.js +13 -13
- package/dist/{loader-B4XWX4K6.js → loader-2TBQUFWX.js} +1 -1
- package/dist/{mcp-DVVUODN7.js → mcp-I7UP73GV.js} +11 -11
- package/dist/{performance-NMJDV6HF.js → performance-BSOMMWK5.js} +3 -3
- package/dist/{review-pipeline-MSEJWTKM.js → review-pipeline-KUBHP3RV.js} +1 -1
- package/dist/{runtime-YHVLJNPG.js → runtime-BN7KGJAO.js} +1 -1
- package/dist/{security-HTDKKGMX.js → security-3T4JGDZP.js} +1 -1
- package/dist/{validate-SPSTH2YW.js → validate-R5WGB2AV.js} +2 -2
- package/dist/{validate-cross-check-YTDWIMFI.js → validate-cross-check-76Z5P6EX.js} +1 -1
- package/package.json +5 -5
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import {
|
|
2
2
|
checkDependenciesDefinition,
|
|
3
3
|
handleCheckDependencies
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-A33LHIRD.js";
|
|
5
5
|
import "./chunk-H7Y5CKTM.js";
|
|
6
6
|
import "./chunk-IDZNPTYD.js";
|
|
7
7
|
import "./chunk-W6Y7ZW3Y.js";
|
|
8
|
-
import "./chunk-
|
|
8
|
+
import "./chunk-IC5CZSHF.js";
|
|
9
9
|
import "./chunk-ERS5EVUZ.js";
|
|
10
10
|
export {
|
|
11
11
|
checkDependenciesDefinition,
|
package/dist/bin/harness-mcp.js
CHANGED
|
@@ -1,25 +1,25 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import {
|
|
3
3
|
startServer
|
|
4
|
-
} from "../chunk-
|
|
5
|
-
import "../chunk-
|
|
6
|
-
import "../chunk-
|
|
7
|
-
import "../chunk-
|
|
8
|
-
import "../chunk-
|
|
9
|
-
import "../chunk-
|
|
4
|
+
} from "../chunk-YL4UHE52.js";
|
|
5
|
+
import "../chunk-4U4V7A6U.js";
|
|
6
|
+
import "../chunk-PDEEQJHH.js";
|
|
7
|
+
import "../chunk-V73TEHIF.js";
|
|
8
|
+
import "../chunk-LEWXD6PR.js";
|
|
9
|
+
import "../chunk-45ZJPG24.js";
|
|
10
10
|
import "../chunk-CJDVBBPB.js";
|
|
11
|
-
import "../chunk-
|
|
11
|
+
import "../chunk-LVJ7SCD7.js";
|
|
12
12
|
import "../chunk-CZZXE6BL.js";
|
|
13
|
-
import "../chunk-
|
|
13
|
+
import "../chunk-A33LHIRD.js";
|
|
14
14
|
import "../chunk-H7Y5CKTM.js";
|
|
15
|
-
import "../chunk-
|
|
16
|
-
import "../chunk-
|
|
15
|
+
import "../chunk-H6KZAGHZ.js";
|
|
16
|
+
import "../chunk-YDOGGQSF.js";
|
|
17
17
|
import "../chunk-IDZNPTYD.js";
|
|
18
18
|
import "../chunk-W6Y7ZW3Y.js";
|
|
19
19
|
import "../chunk-N5G5QMS3.js";
|
|
20
20
|
import "../chunk-3WGJMBKH.js";
|
|
21
21
|
import "../chunk-HKUX2X7O.js";
|
|
22
|
-
import "../chunk-
|
|
22
|
+
import "../chunk-IC5CZSHF.js";
|
|
23
23
|
import "../chunk-ERS5EVUZ.js";
|
|
24
24
|
|
|
25
25
|
// src/bin/harness-mcp.ts
|
package/dist/bin/harness.js
CHANGED
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
import {
|
|
3
3
|
createProgram,
|
|
4
4
|
printFirstRunWelcome
|
|
5
|
-
} from "../chunk-
|
|
5
|
+
} from "../chunk-RJFWCL6M.js";
|
|
6
6
|
import "../chunk-SD3SQOZ2.js";
|
|
7
|
-
import "../chunk-
|
|
7
|
+
import "../chunk-PDOSLTWP.js";
|
|
8
8
|
import "../chunk-6KWBH4EO.js";
|
|
9
9
|
import "../chunk-YQ6KC6TE.js";
|
|
10
10
|
import "../chunk-TRAPF4IX.js";
|
|
@@ -16,22 +16,22 @@ import "../chunk-DBSOCI3G.js";
|
|
|
16
16
|
import "../chunk-FIAPHX37.js";
|
|
17
17
|
import "../chunk-KET4QQZB.js";
|
|
18
18
|
import "../chunk-OD3S2NHN.js";
|
|
19
|
-
import "../chunk-
|
|
20
|
-
import "../chunk-
|
|
21
|
-
import "../chunk-
|
|
22
|
-
import "../chunk-
|
|
23
|
-
import "../chunk-
|
|
24
|
-
import "../chunk-
|
|
19
|
+
import "../chunk-YL4UHE52.js";
|
|
20
|
+
import "../chunk-4U4V7A6U.js";
|
|
21
|
+
import "../chunk-PDEEQJHH.js";
|
|
22
|
+
import "../chunk-V73TEHIF.js";
|
|
23
|
+
import "../chunk-LEWXD6PR.js";
|
|
24
|
+
import "../chunk-45ZJPG24.js";
|
|
25
25
|
import "../chunk-CJDVBBPB.js";
|
|
26
|
-
import "../chunk-
|
|
26
|
+
import "../chunk-LVJ7SCD7.js";
|
|
27
27
|
import "../chunk-CZZXE6BL.js";
|
|
28
|
-
import "../chunk-
|
|
28
|
+
import "../chunk-A33LHIRD.js";
|
|
29
29
|
import "../chunk-H7Y5CKTM.js";
|
|
30
|
-
import "../chunk-
|
|
30
|
+
import "../chunk-H6KZAGHZ.js";
|
|
31
31
|
import {
|
|
32
32
|
findConfigFile,
|
|
33
33
|
loadConfig
|
|
34
|
-
} from "../chunk-
|
|
34
|
+
} from "../chunk-YDOGGQSF.js";
|
|
35
35
|
import "../chunk-IDZNPTYD.js";
|
|
36
36
|
import "../chunk-W6Y7ZW3Y.js";
|
|
37
37
|
import "../chunk-N5G5QMS3.js";
|
|
@@ -50,7 +50,7 @@ import {
|
|
|
50
50
|
readCheckState,
|
|
51
51
|
shouldRunCheck,
|
|
52
52
|
spawnBackgroundCheck
|
|
53
|
-
} from "../chunk-
|
|
53
|
+
} from "../chunk-IC5CZSHF.js";
|
|
54
54
|
import "../chunk-ERS5EVUZ.js";
|
|
55
55
|
|
|
56
56
|
// src/bin/harness.ts
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import {
|
|
2
2
|
createCheckPhaseGateCommand,
|
|
3
3
|
runCheckPhaseGate
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-PDOSLTWP.js";
|
|
5
5
|
import "./chunk-EBJQ6N4M.js";
|
|
6
|
-
import "./chunk-
|
|
6
|
+
import "./chunk-YDOGGQSF.js";
|
|
7
7
|
import "./chunk-3WGJMBKH.js";
|
|
8
|
-
import "./chunk-
|
|
8
|
+
import "./chunk-IC5CZSHF.js";
|
|
9
9
|
import "./chunk-ERS5EVUZ.js";
|
|
10
10
|
export {
|
|
11
11
|
createCheckPhaseGateCommand,
|
|
@@ -45,7 +45,7 @@ var runCodeReviewDefinition = {
|
|
|
45
45
|
};
|
|
46
46
|
async function handleRunCodeReview(input) {
|
|
47
47
|
try {
|
|
48
|
-
const { parseDiff, runReviewPipeline } = await import("./dist-
|
|
48
|
+
const { parseDiff, runReviewPipeline } = await import("./dist-WHL3NN5S.js");
|
|
49
49
|
const parseResult = parseDiff(input.diff);
|
|
50
50
|
if (!parseResult.ok) {
|
|
51
51
|
return {
|
|
@@ -123,7 +123,7 @@ function buildSummaryResponse(report) {
|
|
|
123
123
|
}
|
|
124
124
|
async function handleDetectEntropy(input) {
|
|
125
125
|
try {
|
|
126
|
-
const { EntropyAnalyzer } = await import("./dist-
|
|
126
|
+
const { EntropyAnalyzer } = await import("./dist-WHL3NN5S.js");
|
|
127
127
|
const typeFilter = input.type ?? "all";
|
|
128
128
|
const analyzer = new EntropyAnalyzer({
|
|
129
129
|
rootDir: sanitizePath(input.path),
|
|
@@ -142,7 +142,7 @@ async function handleDetectEntropy(input) {
|
|
|
142
142
|
return resultToMcpResponse(result);
|
|
143
143
|
}
|
|
144
144
|
if (!result.ok) return resultToMcpResponse(result);
|
|
145
|
-
const { createFixes, applyFixes, generateSuggestions } = await import("./dist-
|
|
145
|
+
const { createFixes, applyFixes, generateSuggestions } = await import("./dist-WHL3NN5S.js");
|
|
146
146
|
const report = result.value;
|
|
147
147
|
const deadCode = report.deadCode;
|
|
148
148
|
const fixTypesConfig = input.fixTypes ? { fixTypes: input.fixTypes } : void 0;
|
|
@@ -38,7 +38,7 @@ async function handleCheckDependencies(input) {
|
|
|
38
38
|
const configResult = resolveProjectConfig(projectPath);
|
|
39
39
|
if (!configResult.ok) return resultToMcpResponse(configResult);
|
|
40
40
|
try {
|
|
41
|
-
const { validateDependencies, TypeScriptParser } = await import("./dist-
|
|
41
|
+
const { validateDependencies, TypeScriptParser } = await import("./dist-WHL3NN5S.js");
|
|
42
42
|
const config = configResult.value;
|
|
43
43
|
const rawLayers = Array.isArray(config.layers) ? config.layers : [];
|
|
44
44
|
const layers = rawLayers.map((l) => ({
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
2
|
findConfigFile,
|
|
3
3
|
loadConfig
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-YDOGGQSF.js";
|
|
5
5
|
import {
|
|
6
6
|
resultToMcpResponse
|
|
7
7
|
} from "./chunk-IDZNPTYD.js";
|
|
@@ -46,12 +46,12 @@ async function handleCheckDocs(input) {
|
|
|
46
46
|
const projectPath = sanitizePath(input.path);
|
|
47
47
|
const scope = input.scope ?? "coverage";
|
|
48
48
|
if (scope === "integrity") {
|
|
49
|
-
const { validateKnowledgeMap } = await import("./dist-
|
|
49
|
+
const { validateKnowledgeMap } = await import("./dist-WHL3NN5S.js");
|
|
50
50
|
const result2 = await validateKnowledgeMap(projectPath);
|
|
51
51
|
return resultToMcpResponse(result2);
|
|
52
52
|
}
|
|
53
53
|
if (scope === "all") {
|
|
54
|
-
const { checkDocCoverage: checkDocCoverage2, validateKnowledgeMap } = await import("./dist-
|
|
54
|
+
const { checkDocCoverage: checkDocCoverage2, validateKnowledgeMap } = await import("./dist-WHL3NN5S.js");
|
|
55
55
|
const domain2 = input.domain ?? "src";
|
|
56
56
|
const { loadGraphStore: loadGraphStore2 } = await import("./graph-loader-KMHDQYDT.js");
|
|
57
57
|
const store2 = await loadGraphStore2(projectPath);
|
|
@@ -90,7 +90,7 @@ async function handleCheckDocs(input) {
|
|
|
90
90
|
}
|
|
91
91
|
return resultToMcpResponse(Ok({ coverage, integrity }));
|
|
92
92
|
}
|
|
93
|
-
const { checkDocCoverage } = await import("./dist-
|
|
93
|
+
const { checkDocCoverage } = await import("./dist-WHL3NN5S.js");
|
|
94
94
|
const domain = input.domain ?? "src";
|
|
95
95
|
const { loadGraphStore } = await import("./graph-loader-KMHDQYDT.js");
|
|
96
96
|
const store = await loadGraphStore(projectPath);
|
|
@@ -11979,6 +11979,29 @@ function labelsForStatus(status, config) {
|
|
|
11979
11979
|
}
|
|
11980
11980
|
return [...base];
|
|
11981
11981
|
}
|
|
11982
|
+
var RETRY_DEFAULTS = { maxRetries: 5, baseDelayMs: 1e3 };
|
|
11983
|
+
function sleep(ms) {
|
|
11984
|
+
return new Promise((resolve5) => setTimeout(resolve5, ms));
|
|
11985
|
+
}
|
|
11986
|
+
async function fetchWithRetry(fetchFn, input, init, opts = RETRY_DEFAULTS) {
|
|
11987
|
+
let lastResponse;
|
|
11988
|
+
for (let attempt = 0; attempt <= opts.maxRetries; attempt++) {
|
|
11989
|
+
const response = await fetchFn(input, init);
|
|
11990
|
+
if (response.status !== 403 && response.status !== 429) return response;
|
|
11991
|
+
lastResponse = response;
|
|
11992
|
+
if (attempt === opts.maxRetries) break;
|
|
11993
|
+
const retryAfter = response.headers.get("Retry-After");
|
|
11994
|
+
let delayMs;
|
|
11995
|
+
if (retryAfter) {
|
|
11996
|
+
const seconds = parseInt(retryAfter, 10);
|
|
11997
|
+
delayMs = isNaN(seconds) ? opts.baseDelayMs : seconds * 1e3;
|
|
11998
|
+
} else {
|
|
11999
|
+
delayMs = opts.baseDelayMs * Math.pow(2, attempt) + Math.random() * 500;
|
|
12000
|
+
}
|
|
12001
|
+
await sleep(delayMs);
|
|
12002
|
+
}
|
|
12003
|
+
return lastResponse;
|
|
12004
|
+
}
|
|
11982
12005
|
var GitHubIssuesSyncAdapter = class {
|
|
11983
12006
|
token;
|
|
11984
12007
|
config;
|
|
@@ -11986,11 +12009,20 @@ var GitHubIssuesSyncAdapter = class {
|
|
|
11986
12009
|
apiBase;
|
|
11987
12010
|
owner;
|
|
11988
12011
|
repo;
|
|
12012
|
+
retryOpts;
|
|
12013
|
+
/** Cached GitHub milestone name -> ID mapping */
|
|
12014
|
+
milestoneCache = null;
|
|
12015
|
+
/** Cached authenticated user login (e.g., "@octocat") */
|
|
12016
|
+
authenticatedUserCache = null;
|
|
11989
12017
|
constructor(options) {
|
|
11990
12018
|
this.token = options.token;
|
|
11991
12019
|
this.config = options.config;
|
|
11992
12020
|
this.fetchFn = options.fetchFn ?? globalThis.fetch;
|
|
11993
12021
|
this.apiBase = options.apiBase ?? "https://api.github.com";
|
|
12022
|
+
this.retryOpts = {
|
|
12023
|
+
maxRetries: options.maxRetries ?? RETRY_DEFAULTS.maxRetries,
|
|
12024
|
+
baseDelayMs: options.baseDelayMs ?? RETRY_DEFAULTS.baseDelayMs
|
|
12025
|
+
};
|
|
11994
12026
|
const repoParts = (options.config.repo ?? "").split("/");
|
|
11995
12027
|
if (repoParts.length !== 2 || !repoParts[0] || !repoParts[1]) {
|
|
11996
12028
|
throw new Error(`Invalid repo format: "${options.config.repo}". Expected "owner/repo".`);
|
|
@@ -11998,6 +12030,63 @@ var GitHubIssuesSyncAdapter = class {
|
|
|
11998
12030
|
this.owner = repoParts[0];
|
|
11999
12031
|
this.repo = repoParts[1];
|
|
12000
12032
|
}
|
|
12033
|
+
/**
|
|
12034
|
+
* Fetch all GitHub milestones and build the name -> ID cache.
|
|
12035
|
+
*/
|
|
12036
|
+
async loadMilestones() {
|
|
12037
|
+
if (this.milestoneCache) return this.milestoneCache;
|
|
12038
|
+
this.milestoneCache = /* @__PURE__ */ new Map();
|
|
12039
|
+
const response = await fetchWithRetry(
|
|
12040
|
+
this.fetchFn,
|
|
12041
|
+
`${this.apiBase}/repos/${this.owner}/${this.repo}/milestones?state=all&per_page=100`,
|
|
12042
|
+
{ method: "GET", headers: this.headers() },
|
|
12043
|
+
this.retryOpts
|
|
12044
|
+
);
|
|
12045
|
+
if (response.ok) {
|
|
12046
|
+
const data = await response.json();
|
|
12047
|
+
for (const m of data) {
|
|
12048
|
+
this.milestoneCache.set(m.title, m.number);
|
|
12049
|
+
}
|
|
12050
|
+
}
|
|
12051
|
+
return this.milestoneCache;
|
|
12052
|
+
}
|
|
12053
|
+
/**
|
|
12054
|
+
* Get or create a GitHub milestone by name. Returns the milestone number.
|
|
12055
|
+
*/
|
|
12056
|
+
async ensureMilestone(name) {
|
|
12057
|
+
const cache = await this.loadMilestones();
|
|
12058
|
+
if (cache.has(name)) return cache.get(name);
|
|
12059
|
+
const response = await fetchWithRetry(
|
|
12060
|
+
this.fetchFn,
|
|
12061
|
+
`${this.apiBase}/repos/${this.owner}/${this.repo}/milestones`,
|
|
12062
|
+
{ method: "POST", headers: this.headers(), body: JSON.stringify({ title: name }) },
|
|
12063
|
+
this.retryOpts
|
|
12064
|
+
);
|
|
12065
|
+
if (!response.ok) return null;
|
|
12066
|
+
const data = await response.json();
|
|
12067
|
+
cache.set(name, data.number);
|
|
12068
|
+
return data.number;
|
|
12069
|
+
}
|
|
12070
|
+
async getAuthenticatedUser() {
|
|
12071
|
+
if (this.authenticatedUserCache) return Ok(this.authenticatedUserCache);
|
|
12072
|
+
try {
|
|
12073
|
+
const response = await fetchWithRetry(
|
|
12074
|
+
this.fetchFn,
|
|
12075
|
+
`${this.apiBase}/user`,
|
|
12076
|
+
{ method: "GET", headers: this.headers() },
|
|
12077
|
+
this.retryOpts
|
|
12078
|
+
);
|
|
12079
|
+
if (!response.ok) {
|
|
12080
|
+
const text = await response.text();
|
|
12081
|
+
return Err(new Error(`GitHub API error ${response.status}: ${text}`));
|
|
12082
|
+
}
|
|
12083
|
+
const data = await response.json();
|
|
12084
|
+
this.authenticatedUserCache = `@${data.login}`;
|
|
12085
|
+
return Ok(this.authenticatedUserCache);
|
|
12086
|
+
} catch (error) {
|
|
12087
|
+
return Err(error instanceof Error ? error : new Error(String(error)));
|
|
12088
|
+
}
|
|
12089
|
+
}
|
|
12001
12090
|
headers() {
|
|
12002
12091
|
return {
|
|
12003
12092
|
Authorization: `Bearer ${this.token}`,
|
|
@@ -12006,26 +12095,36 @@ var GitHubIssuesSyncAdapter = class {
|
|
|
12006
12095
|
"X-GitHub-Api-Version": "2022-11-28"
|
|
12007
12096
|
};
|
|
12008
12097
|
}
|
|
12098
|
+
/**
|
|
12099
|
+
* Close an issue if the feature status maps to 'closed'.
|
|
12100
|
+
* GitHub Issues API doesn't accept state on POST — requires a follow-up PATCH.
|
|
12101
|
+
*/
|
|
12102
|
+
async closeIfDone(issueNumber, featureStatus) {
|
|
12103
|
+
const externalStatus = this.config.statusMap[featureStatus];
|
|
12104
|
+
if (externalStatus !== "closed") return;
|
|
12105
|
+
await fetchWithRetry(
|
|
12106
|
+
this.fetchFn,
|
|
12107
|
+
`${this.apiBase}/repos/${this.owner}/${this.repo}/issues/${issueNumber}`,
|
|
12108
|
+
{ method: "PATCH", headers: this.headers(), body: JSON.stringify({ state: "closed" }) },
|
|
12109
|
+
this.retryOpts
|
|
12110
|
+
);
|
|
12111
|
+
}
|
|
12009
12112
|
async createTicket(feature, milestone) {
|
|
12010
12113
|
try {
|
|
12011
|
-
const labels = labelsForStatus(feature.status, this.config);
|
|
12012
|
-
const body = [
|
|
12013
|
-
|
|
12014
|
-
|
|
12015
|
-
|
|
12016
|
-
|
|
12017
|
-
|
|
12018
|
-
|
|
12114
|
+
const labels = [...labelsForStatus(feature.status, this.config), "feature"];
|
|
12115
|
+
const body = [feature.summary, "", feature.spec ? `**Spec:** ${feature.spec}` : ""].filter(Boolean).join("\n");
|
|
12116
|
+
const milestoneId = await this.ensureMilestone(milestone);
|
|
12117
|
+
const issuePayload = { title: feature.name, body, labels };
|
|
12118
|
+
if (milestoneId) issuePayload.milestone = milestoneId;
|
|
12119
|
+
if (feature.assignee) {
|
|
12120
|
+
const login = feature.assignee.startsWith("@") ? feature.assignee.slice(1) : feature.assignee;
|
|
12121
|
+
issuePayload.assignees = [login];
|
|
12122
|
+
}
|
|
12123
|
+
const response = await fetchWithRetry(
|
|
12124
|
+
this.fetchFn,
|
|
12019
12125
|
`${this.apiBase}/repos/${this.owner}/${this.repo}/issues`,
|
|
12020
|
-
{
|
|
12021
|
-
|
|
12022
|
-
headers: this.headers(),
|
|
12023
|
-
body: JSON.stringify({
|
|
12024
|
-
title: feature.name,
|
|
12025
|
-
body,
|
|
12026
|
-
labels
|
|
12027
|
-
})
|
|
12028
|
-
}
|
|
12126
|
+
{ method: "POST", headers: this.headers(), body: JSON.stringify(issuePayload) },
|
|
12127
|
+
this.retryOpts
|
|
12029
12128
|
);
|
|
12030
12129
|
if (!response.ok) {
|
|
12031
12130
|
const text = await response.text();
|
|
@@ -12033,12 +12132,13 @@ var GitHubIssuesSyncAdapter = class {
|
|
|
12033
12132
|
}
|
|
12034
12133
|
const data = await response.json();
|
|
12035
12134
|
const externalId = buildExternalId(this.owner, this.repo, data.number);
|
|
12135
|
+
await this.closeIfDone(data.number, feature.status);
|
|
12036
12136
|
return Ok({ externalId, url: data.html_url });
|
|
12037
12137
|
} catch (error) {
|
|
12038
12138
|
return Err(error instanceof Error ? error : new Error(String(error)));
|
|
12039
12139
|
}
|
|
12040
12140
|
}
|
|
12041
|
-
async updateTicket(externalId, changes) {
|
|
12141
|
+
async updateTicket(externalId, changes, milestone) {
|
|
12042
12142
|
try {
|
|
12043
12143
|
const parsed = parseExternalId(externalId);
|
|
12044
12144
|
if (!parsed) return Err(new Error(`Invalid externalId format: "${externalId}"`));
|
|
@@ -12051,15 +12151,29 @@ var GitHubIssuesSyncAdapter = class {
|
|
|
12051
12151
|
if (changes.status !== void 0) {
|
|
12052
12152
|
const externalStatus = this.config.statusMap[changes.status];
|
|
12053
12153
|
patch.state = externalStatus;
|
|
12054
|
-
patch.labels = labelsForStatus(changes.status, this.config);
|
|
12154
|
+
patch.labels = [...labelsForStatus(changes.status, this.config), "feature"];
|
|
12155
|
+
}
|
|
12156
|
+
if (changes.assignee !== void 0) {
|
|
12157
|
+
if (changes.assignee) {
|
|
12158
|
+
const login = changes.assignee.startsWith("@") ? changes.assignee.slice(1) : changes.assignee;
|
|
12159
|
+
patch.assignees = [login];
|
|
12160
|
+
} else {
|
|
12161
|
+
patch.assignees = [];
|
|
12162
|
+
}
|
|
12163
|
+
}
|
|
12164
|
+
if (milestone) {
|
|
12165
|
+
const milestoneId = await this.ensureMilestone(milestone);
|
|
12166
|
+
if (milestoneId) patch.milestone = milestoneId;
|
|
12055
12167
|
}
|
|
12056
|
-
const response = await
|
|
12168
|
+
const response = await fetchWithRetry(
|
|
12169
|
+
this.fetchFn,
|
|
12057
12170
|
`${this.apiBase}/repos/${parsed.owner}/${parsed.repo}/issues/${parsed.number}`,
|
|
12058
12171
|
{
|
|
12059
12172
|
method: "PATCH",
|
|
12060
12173
|
headers: this.headers(),
|
|
12061
12174
|
body: JSON.stringify(patch)
|
|
12062
|
-
}
|
|
12175
|
+
},
|
|
12176
|
+
this.retryOpts
|
|
12063
12177
|
);
|
|
12064
12178
|
if (!response.ok) {
|
|
12065
12179
|
const text = await response.text();
|
|
@@ -12075,12 +12189,14 @@ var GitHubIssuesSyncAdapter = class {
|
|
|
12075
12189
|
try {
|
|
12076
12190
|
const parsed = parseExternalId(externalId);
|
|
12077
12191
|
if (!parsed) return Err(new Error(`Invalid externalId format: "${externalId}"`));
|
|
12078
|
-
const response = await
|
|
12192
|
+
const response = await fetchWithRetry(
|
|
12193
|
+
this.fetchFn,
|
|
12079
12194
|
`${this.apiBase}/repos/${parsed.owner}/${parsed.repo}/issues/${parsed.number}`,
|
|
12080
12195
|
{
|
|
12081
12196
|
method: "GET",
|
|
12082
12197
|
headers: this.headers()
|
|
12083
|
-
}
|
|
12198
|
+
},
|
|
12199
|
+
this.retryOpts
|
|
12084
12200
|
);
|
|
12085
12201
|
if (!response.ok) {
|
|
12086
12202
|
const text = await response.text();
|
|
@@ -12105,12 +12221,14 @@ var GitHubIssuesSyncAdapter = class {
|
|
|
12105
12221
|
let page = 1;
|
|
12106
12222
|
const perPage = 100;
|
|
12107
12223
|
while (true) {
|
|
12108
|
-
const response = await
|
|
12224
|
+
const response = await fetchWithRetry(
|
|
12225
|
+
this.fetchFn,
|
|
12109
12226
|
`${this.apiBase}/repos/${this.owner}/${this.repo}/issues?state=all&per_page=${perPage}&page=${page}${labelsParam}`,
|
|
12110
12227
|
{
|
|
12111
12228
|
method: "GET",
|
|
12112
12229
|
headers: this.headers()
|
|
12113
|
-
}
|
|
12230
|
+
},
|
|
12231
|
+
this.retryOpts
|
|
12114
12232
|
);
|
|
12115
12233
|
if (!response.ok) {
|
|
12116
12234
|
const text = await response.text();
|
|
@@ -12139,13 +12257,15 @@ var GitHubIssuesSyncAdapter = class {
|
|
|
12139
12257
|
const parsed = parseExternalId(externalId);
|
|
12140
12258
|
if (!parsed) return Err(new Error(`Invalid externalId format: "${externalId}"`));
|
|
12141
12259
|
const login = assignee.startsWith("@") ? assignee.slice(1) : assignee;
|
|
12142
|
-
const response = await
|
|
12260
|
+
const response = await fetchWithRetry(
|
|
12261
|
+
this.fetchFn,
|
|
12143
12262
|
`${this.apiBase}/repos/${parsed.owner}/${parsed.repo}/issues/${parsed.number}/assignees`,
|
|
12144
12263
|
{
|
|
12145
12264
|
method: "POST",
|
|
12146
12265
|
headers: this.headers(),
|
|
12147
12266
|
body: JSON.stringify({ assignees: [login] })
|
|
12148
|
-
}
|
|
12267
|
+
},
|
|
12268
|
+
this.retryOpts
|
|
12149
12269
|
);
|
|
12150
12270
|
if (!response.ok) {
|
|
12151
12271
|
const text = await response.text();
|
|
@@ -12162,8 +12282,16 @@ function emptySyncResult() {
|
|
|
12162
12282
|
}
|
|
12163
12283
|
async function syncToExternal(roadmap, adapter, _config) {
|
|
12164
12284
|
const result = emptySyncResult();
|
|
12285
|
+
let defaultAssignee = null;
|
|
12286
|
+
const userResult = await adapter.getAuthenticatedUser();
|
|
12287
|
+
if (userResult.ok) {
|
|
12288
|
+
defaultAssignee = userResult.value;
|
|
12289
|
+
}
|
|
12165
12290
|
for (const milestone of roadmap.milestones) {
|
|
12166
12291
|
for (const feature of milestone.features) {
|
|
12292
|
+
if (!feature.assignee && defaultAssignee) {
|
|
12293
|
+
feature.assignee = defaultAssignee;
|
|
12294
|
+
}
|
|
12167
12295
|
if (!feature.externalId) {
|
|
12168
12296
|
const createResult = await adapter.createTicket(feature, milestone.name);
|
|
12169
12297
|
if (createResult.ok) {
|
|
@@ -12173,7 +12301,11 @@ async function syncToExternal(roadmap, adapter, _config) {
|
|
|
12173
12301
|
result.errors.push({ featureOrId: feature.name, error: createResult.error });
|
|
12174
12302
|
}
|
|
12175
12303
|
} else {
|
|
12176
|
-
const updateResult = await adapter.updateTicket(
|
|
12304
|
+
const updateResult = await adapter.updateTicket(
|
|
12305
|
+
feature.externalId,
|
|
12306
|
+
feature,
|
|
12307
|
+
milestone.name
|
|
12308
|
+
);
|
|
12177
12309
|
if (updateResult.ok) {
|
|
12178
12310
|
result.updated.push(feature.externalId);
|
|
12179
12311
|
} else {
|
|
@@ -26,7 +26,7 @@ var runSecurityScanDefinition = {
|
|
|
26
26
|
};
|
|
27
27
|
async function handleRunSecurityScan(input) {
|
|
28
28
|
try {
|
|
29
|
-
const core = await import("./dist-
|
|
29
|
+
const core = await import("./dist-WHL3NN5S.js");
|
|
30
30
|
const projectRoot = sanitizePath(input.path);
|
|
31
31
|
let configData = {};
|
|
32
32
|
try {
|
|
@@ -49,7 +49,7 @@ async function handleValidateProject(input) {
|
|
|
49
49
|
checks.config = "pass";
|
|
50
50
|
const config = configResult.value;
|
|
51
51
|
try {
|
|
52
|
-
const core = await import("./dist-
|
|
52
|
+
const core = await import("./dist-WHL3NN5S.js");
|
|
53
53
|
if (typeof core.validateFileStructure === "function" && Array.isArray(config.conventions)) {
|
|
54
54
|
const conventions = config.conventions;
|
|
55
55
|
const structureResult = await core.validateFileStructure(projectPath, conventions);
|
|
@@ -68,7 +68,7 @@ async function handleValidateProject(input) {
|
|
|
68
68
|
} catch {
|
|
69
69
|
}
|
|
70
70
|
try {
|
|
71
|
-
const core = await import("./dist-
|
|
71
|
+
const core = await import("./dist-WHL3NN5S.js");
|
|
72
72
|
if (typeof core.validateAgentsMap === "function") {
|
|
73
73
|
const agentsMapPath = path.join(projectPath, "AGENTS.md");
|
|
74
74
|
const agentsResult = await core.validateAgentsMap(agentsMapPath);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
2
|
findConfigFile,
|
|
3
3
|
loadConfig
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-YDOGGQSF.js";
|
|
5
5
|
import {
|
|
6
6
|
resultToMcpResponse
|
|
7
7
|
} from "./chunk-IDZNPTYD.js";
|
|
@@ -31,7 +31,7 @@ var checkPerformanceDefinition = {
|
|
|
31
31
|
};
|
|
32
32
|
async function handleCheckPerformance(input) {
|
|
33
33
|
try {
|
|
34
|
-
const { EntropyAnalyzer } = await import("./dist-
|
|
34
|
+
const { EntropyAnalyzer } = await import("./dist-WHL3NN5S.js");
|
|
35
35
|
const typeFilter = input.type ?? "all";
|
|
36
36
|
const projectPath = sanitizePath(input.path);
|
|
37
37
|
let entryPoints;
|
|
@@ -94,7 +94,7 @@ var getPerfBaselinesDefinition = {
|
|
|
94
94
|
};
|
|
95
95
|
async function handleGetPerfBaselines(input) {
|
|
96
96
|
try {
|
|
97
|
-
const { BaselineManager } = await import("./dist-
|
|
97
|
+
const { BaselineManager } = await import("./dist-WHL3NN5S.js");
|
|
98
98
|
const manager = new BaselineManager(sanitizePath(input.path));
|
|
99
99
|
const baselines = manager.load();
|
|
100
100
|
return resultToMcpResponse(
|
|
@@ -142,7 +142,7 @@ var updatePerfBaselinesDefinition = {
|
|
|
142
142
|
};
|
|
143
143
|
async function handleUpdatePerfBaselines(input) {
|
|
144
144
|
try {
|
|
145
|
-
const { BaselineManager } = await import("./dist-
|
|
145
|
+
const { BaselineManager } = await import("./dist-WHL3NN5S.js");
|
|
146
146
|
const manager = new BaselineManager(sanitizePath(input.path));
|
|
147
147
|
manager.save(input.results, input.commitHash);
|
|
148
148
|
const updated = manager.load();
|
|
@@ -172,7 +172,7 @@ var getCriticalPathsDefinition = {
|
|
|
172
172
|
};
|
|
173
173
|
async function handleGetCriticalPaths(input) {
|
|
174
174
|
try {
|
|
175
|
-
const { CriticalPathResolver } = await import("./dist-
|
|
175
|
+
const { CriticalPathResolver } = await import("./dist-WHL3NN5S.js");
|
|
176
176
|
const resolver = new CriticalPathResolver(sanitizePath(input.path));
|
|
177
177
|
const result = await resolver.resolve();
|
|
178
178
|
return resultToMcpResponse(Ok(result));
|