@kaddo/mcp 3.124.5 → 3.126.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/index.js +83 -81
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -12121,7 +12121,7 @@ function getPrompt(root, name) {
|
|
|
12121
12121
|
}
|
|
12122
12122
|
|
|
12123
12123
|
// src/tools.ts
|
|
12124
|
-
import
|
|
12124
|
+
import matter24 from "gray-matter";
|
|
12125
12125
|
|
|
12126
12126
|
// ../cli/dist/core.js
|
|
12127
12127
|
import fs3 from "fs";
|
|
@@ -12165,6 +12165,8 @@ import { parse as parseYaml11, stringify as stringifyYaml7 } from "yaml";
|
|
|
12165
12165
|
import matter16 from "gray-matter";
|
|
12166
12166
|
import matter17 from "gray-matter";
|
|
12167
12167
|
import matter18 from "gray-matter";
|
|
12168
|
+
import matter19 from "gray-matter";
|
|
12169
|
+
import matter20 from "gray-matter";
|
|
12168
12170
|
function exists2(p) {
|
|
12169
12171
|
return fs3.existsSync(p);
|
|
12170
12172
|
}
|
|
@@ -12283,8 +12285,8 @@ function loadConfig2(dir) {
|
|
|
12283
12285
|
const parsed = configSchema2.safeParse(raw ?? {});
|
|
12284
12286
|
if (!parsed.success) {
|
|
12285
12287
|
const issues = parsed.error.issues.map((i) => {
|
|
12286
|
-
const
|
|
12287
|
-
return
|
|
12288
|
+
const path82 = i.path.join(".");
|
|
12289
|
+
return path82 ? ` - ${path82}: ${i.message}` : ` - ${i.message}`;
|
|
12288
12290
|
}).join("\n");
|
|
12289
12291
|
throw new ConfigError2(`Invalid .kaddo/config.yml:
|
|
12290
12292
|
${issues}`);
|
|
@@ -12488,11 +12490,11 @@ function moduleArtifactCoverage2(dir, id) {
|
|
|
12488
12490
|
};
|
|
12489
12491
|
}
|
|
12490
12492
|
function loadMappedModules2(dir) {
|
|
12491
|
-
const
|
|
12492
|
-
if (!exists2(
|
|
12493
|
+
const path82 = join3(dir, DESCRIPTOR_PATH2);
|
|
12494
|
+
if (!exists2(path82)) return [];
|
|
12493
12495
|
let parsed;
|
|
12494
12496
|
try {
|
|
12495
|
-
parsed = parseYaml32(readFile2(
|
|
12497
|
+
parsed = parseYaml32(readFile2(path82));
|
|
12496
12498
|
} catch {
|
|
12497
12499
|
return [];
|
|
12498
12500
|
}
|
|
@@ -14225,9 +14227,9 @@ function buildGraph2(dir, config, opts = {}, now = /* @__PURE__ */ new Date()) {
|
|
|
14225
14227
|
];
|
|
14226
14228
|
const presentLayers = [];
|
|
14227
14229
|
for (const layer2 of layerDocs) {
|
|
14228
|
-
const
|
|
14229
|
-
if (
|
|
14230
|
-
addNode({ id: layer2.id, type: layer2.type, label: layer2.label, path:
|
|
14230
|
+
const path82 = layer2.files.map((f3) => `${KNOWLEDGE22}/${f3}`).find((rel) => exists2(join3(dir, rel)));
|
|
14231
|
+
if (path82) {
|
|
14232
|
+
addNode({ id: layer2.id, type: layer2.type, label: layer2.label, path: path82 });
|
|
14231
14233
|
presentLayers.push(layer2.id);
|
|
14232
14234
|
}
|
|
14233
14235
|
}
|
|
@@ -14706,13 +14708,13 @@ function meaningful2(text22) {
|
|
|
14706
14708
|
});
|
|
14707
14709
|
}
|
|
14708
14710
|
function readPocSummary2(dir) {
|
|
14709
|
-
const
|
|
14710
|
-
if (!exists2(
|
|
14711
|
+
const path82 = join3(dir, POC_ARTIFACT_PATH2);
|
|
14712
|
+
if (!exists2(path82)) {
|
|
14711
14713
|
return { exists: false, hypothesisDefined: false, successCriteriaCount: 0, constraintsDefined: false, nonGoalsDefined: false, conclusion: "pending" };
|
|
14712
14714
|
}
|
|
14713
14715
|
let markdown = "";
|
|
14714
14716
|
try {
|
|
14715
|
-
markdown = readFile2(
|
|
14717
|
+
markdown = readFile2(path82);
|
|
14716
14718
|
} catch {
|
|
14717
14719
|
return { exists: false, hypothesisDefined: false, successCriteriaCount: 0, constraintsDefined: false, nonGoalsDefined: false, conclusion: "pending" };
|
|
14718
14720
|
}
|
|
@@ -14743,11 +14745,11 @@ function redactSecrets2(value) {
|
|
|
14743
14745
|
return line.replace(/([:=]\s*)\S+.*/, "$1[redacted]");
|
|
14744
14746
|
}).join("\n");
|
|
14745
14747
|
}
|
|
14746
|
-
function source2(dir,
|
|
14747
|
-
const absolute = join3(dir,
|
|
14748
|
+
function source2(dir, path82, kind) {
|
|
14749
|
+
const absolute = join3(dir, path82);
|
|
14748
14750
|
if (!exists2(absolute)) return null;
|
|
14749
14751
|
const raw = readFile2(absolute);
|
|
14750
|
-
return { path: posix2(
|
|
14752
|
+
return { path: posix2(path82), kind, digest: sha2(raw), content: redactSecrets2(raw) };
|
|
14751
14753
|
}
|
|
14752
14754
|
function reportFiles2(dir) {
|
|
14753
14755
|
const delivery = join3(dir, "knowledge", "delivery");
|
|
@@ -14787,9 +14789,9 @@ function buildPocReportContext2(dir) {
|
|
|
14787
14789
|
};
|
|
14788
14790
|
}
|
|
14789
14791
|
const sources = [];
|
|
14790
|
-
const add = (
|
|
14791
|
-
if (sources.some((item2) => item2.path === posix2(
|
|
14792
|
-
const item = source2(dir,
|
|
14792
|
+
const add = (path82, kind) => {
|
|
14793
|
+
if (sources.some((item2) => item2.path === posix2(path82))) return;
|
|
14794
|
+
const item = source2(dir, path82, kind);
|
|
14793
14795
|
if (item) sources.push(item);
|
|
14794
14796
|
};
|
|
14795
14797
|
add(POC_ARTIFACT_PATH2, "poc");
|
|
@@ -14817,7 +14819,7 @@ function buildPocReportContext2(dir) {
|
|
|
14817
14819
|
const sourceFingerprint = sha2(sources.map((item) => `${item.path}\0${item.digest}`).join("\n"));
|
|
14818
14820
|
const status = !latestReport ? "missing" : latestReport.sourceFingerprint === sourceFingerprint ? "current" : "stale";
|
|
14819
14821
|
const currentManifest = Object.fromEntries(sources.map((item) => [item.path, item.digest]));
|
|
14820
|
-
const changesSinceLatest = status === "stale" ? [.../* @__PURE__ */ new Set([...Object.keys(currentManifest), ...Object.keys(latestReport?.sourceManifest ?? {})])].filter((
|
|
14822
|
+
const changesSinceLatest = status === "stale" ? [.../* @__PURE__ */ new Set([...Object.keys(currentManifest), ...Object.keys(latestReport?.sourceManifest ?? {})])].filter((path82) => currentManifest[path82] !== latestReport?.sourceManifest[path82]).sort() : [];
|
|
14821
14823
|
const sourceList = sources.map((item) => `- ${item.path} (${item.kind})`).join("\n") || "- No sources selected.";
|
|
14822
14824
|
return {
|
|
14823
14825
|
eligible: true,
|
|
@@ -15970,8 +15972,8 @@ function withResponsibilityTrace2(fileName, content) {
|
|
|
15970
15972
|
const skills = renderSkillsSection2(agent);
|
|
15971
15973
|
const skillsBlock = skills ? `${skills}
|
|
15972
15974
|
` : "";
|
|
15973
|
-
const
|
|
15974
|
-
const frontmatterBlock =
|
|
15975
|
+
const frontmatter2 = renderFrontmatterRules2(agent);
|
|
15976
|
+
const frontmatterBlock = frontmatter2 ? `${frontmatter2}
|
|
15975
15977
|
` : "";
|
|
15976
15978
|
return `${content.trimEnd()}
|
|
15977
15979
|
|
|
@@ -18163,23 +18165,23 @@ var VALID_SOURCES3 = [
|
|
|
18163
18165
|
function isValidSource2(s) {
|
|
18164
18166
|
return VALID_SOURCES3.includes(s);
|
|
18165
18167
|
}
|
|
18166
|
-
function parseWorkItemSource2(
|
|
18167
|
-
const rawSource =
|
|
18168
|
+
function parseWorkItemSource2(frontmatter2) {
|
|
18169
|
+
const rawSource = frontmatter2.source;
|
|
18168
18170
|
if (rawSource != null && typeof rawSource === "object" && !Array.isArray(rawSource)) {
|
|
18169
18171
|
const obj = rawSource;
|
|
18170
18172
|
const t = optStr22(obj.type);
|
|
18171
18173
|
const type = t && isValidSource2(t) ? t : "unknown";
|
|
18172
18174
|
return {
|
|
18173
18175
|
type,
|
|
18174
|
-
id: optStr22(obj.id) ?? optStr22(
|
|
18175
|
-
title: optStr22(obj.title) ?? optStr22(
|
|
18176
|
-
context: optStr22(obj.context) ?? optStr22(
|
|
18177
|
-
provider: optStr22(obj.provider) ?? optStr22(
|
|
18178
|
-
integration: optStr22(obj.integration) ?? optStr22(
|
|
18179
|
-
url: optStr22(obj.url) ?? optStr22(
|
|
18180
|
-
imported_at: optStr22(obj.imported_at) ?? optStr22(
|
|
18181
|
-
external_updated_at: optStr22(obj.external_updated_at) ?? optStr22(
|
|
18182
|
-
synced_at: optStr22(obj.synced_at) ?? optStr22(
|
|
18176
|
+
id: optStr22(obj.id) ?? optStr22(frontmatter2.source_id),
|
|
18177
|
+
title: optStr22(obj.title) ?? optStr22(frontmatter2.source_title),
|
|
18178
|
+
context: optStr22(obj.context) ?? optStr22(frontmatter2.source_context),
|
|
18179
|
+
provider: optStr22(obj.provider) ?? optStr22(frontmatter2.source_provider),
|
|
18180
|
+
integration: optStr22(obj.integration) ?? optStr22(frontmatter2.source_integration),
|
|
18181
|
+
url: optStr22(obj.url) ?? optStr22(frontmatter2.source_url),
|
|
18182
|
+
imported_at: optStr22(obj.imported_at) ?? optStr22(frontmatter2.source_imported_at),
|
|
18183
|
+
external_updated_at: optStr22(obj.external_updated_at) ?? optStr22(frontmatter2.source_external_updated_at),
|
|
18184
|
+
synced_at: optStr22(obj.synced_at) ?? optStr22(frontmatter2.source_synced_at),
|
|
18183
18185
|
inferred: obj.inferred === true || obj.inferred === "true",
|
|
18184
18186
|
reason: t && !isValidSource2(t) ? `Invalid source type in object: "${t}".` : void 0
|
|
18185
18187
|
};
|
|
@@ -18188,45 +18190,45 @@ function parseWorkItemSource2(frontmatter) {
|
|
|
18188
18190
|
if (raw && isValidSource2(raw)) {
|
|
18189
18191
|
return {
|
|
18190
18192
|
type: raw,
|
|
18191
|
-
id: optStr22(
|
|
18192
|
-
title: optStr22(
|
|
18193
|
-
context: optStr22(
|
|
18194
|
-
provider: optStr22(
|
|
18195
|
-
url: optStr22(
|
|
18196
|
-
imported_at: optStr22(
|
|
18197
|
-
external_updated_at: optStr22(
|
|
18198
|
-
synced_at: optStr22(
|
|
18193
|
+
id: optStr22(frontmatter2.source_id),
|
|
18194
|
+
title: optStr22(frontmatter2.source_title),
|
|
18195
|
+
context: optStr22(frontmatter2.source_context),
|
|
18196
|
+
provider: optStr22(frontmatter2.source_provider),
|
|
18197
|
+
url: optStr22(frontmatter2.source_url),
|
|
18198
|
+
imported_at: optStr22(frontmatter2.source_imported_at),
|
|
18199
|
+
external_updated_at: optStr22(frontmatter2.source_external_updated_at),
|
|
18200
|
+
synced_at: optStr22(frontmatter2.source_synced_at),
|
|
18199
18201
|
inferred: false
|
|
18200
18202
|
};
|
|
18201
18203
|
}
|
|
18202
18204
|
if (raw && !isValidSource2(raw)) {
|
|
18203
18205
|
return {
|
|
18204
18206
|
type: "unknown",
|
|
18205
|
-
id: optStr22(
|
|
18206
|
-
title: optStr22(
|
|
18207
|
-
context: optStr22(
|
|
18208
|
-
provider: optStr22(
|
|
18209
|
-
url: optStr22(
|
|
18210
|
-
imported_at: optStr22(
|
|
18211
|
-
external_updated_at: optStr22(
|
|
18212
|
-
synced_at: optStr22(
|
|
18207
|
+
id: optStr22(frontmatter2.source_id),
|
|
18208
|
+
title: optStr22(frontmatter2.source_title),
|
|
18209
|
+
context: optStr22(frontmatter2.source_context),
|
|
18210
|
+
provider: optStr22(frontmatter2.source_provider),
|
|
18211
|
+
url: optStr22(frontmatter2.source_url),
|
|
18212
|
+
imported_at: optStr22(frontmatter2.source_imported_at),
|
|
18213
|
+
external_updated_at: optStr22(frontmatter2.source_external_updated_at),
|
|
18214
|
+
synced_at: optStr22(frontmatter2.source_synced_at),
|
|
18213
18215
|
inferred: true,
|
|
18214
18216
|
reason: `Invalid source value: "${raw}".`
|
|
18215
18217
|
};
|
|
18216
18218
|
}
|
|
18217
|
-
if (
|
|
18219
|
+
if (frontmatter2.source_work_item_candidate || frontmatter2.source_roadmap_initiative) {
|
|
18218
18220
|
return {
|
|
18219
18221
|
type: "roadmap",
|
|
18220
|
-
id: optStr22(
|
|
18221
|
-
title: optStr22(
|
|
18222
|
+
id: optStr22(frontmatter2.source_id) ?? optStr22(frontmatter2.source_work_item_candidate),
|
|
18223
|
+
title: optStr22(frontmatter2.source_initiative_title),
|
|
18222
18224
|
inferred: true,
|
|
18223
18225
|
reason: "Inferred from legacy roadmap fields."
|
|
18224
18226
|
};
|
|
18225
18227
|
}
|
|
18226
|
-
if (
|
|
18228
|
+
if (frontmatter2.source_id) {
|
|
18227
18229
|
return {
|
|
18228
18230
|
type: "unknown",
|
|
18229
|
-
id: optStr22(
|
|
18231
|
+
id: optStr22(frontmatter2.source_id),
|
|
18230
18232
|
inferred: true,
|
|
18231
18233
|
reason: "Has source_id but no source type."
|
|
18232
18234
|
};
|
|
@@ -18833,8 +18835,8 @@ function parseGraphReason(v) {
|
|
|
18833
18835
|
if (!v || typeof v !== "object") return null;
|
|
18834
18836
|
const o2 = v;
|
|
18835
18837
|
const relationship = typeof o2.relationship === "string" && o2.relationship.trim() ? o2.relationship.trim() : null;
|
|
18836
|
-
const
|
|
18837
|
-
return relationship ||
|
|
18838
|
+
const path82 = Array.isArray(o2.path) ? o2.path.map(String).filter(Boolean) : [];
|
|
18839
|
+
return relationship || path82.length ? { relationship, path: path82 } : null;
|
|
18838
18840
|
}
|
|
18839
18841
|
function parseExplain(o2) {
|
|
18840
18842
|
const refs = Array.isArray(o2.evidence) ? o2.evidence : Array.isArray(o2.evidence_refs) ? o2.evidence_refs : [];
|
|
@@ -19089,7 +19091,7 @@ function slugify22(s) {
|
|
|
19089
19091
|
function nextWorkItemId(dir) {
|
|
19090
19092
|
const wiDir = join3(dir, WORK_ITEMS_DIR);
|
|
19091
19093
|
let max = 0;
|
|
19092
|
-
const
|
|
19094
|
+
const walk2 = (d3) => {
|
|
19093
19095
|
if (!exists2(d3)) return;
|
|
19094
19096
|
for (const entry of fs4.readdirSync(d3)) {
|
|
19095
19097
|
const full = join3(d3, entry);
|
|
@@ -19097,11 +19099,11 @@ function nextWorkItemId(dir) {
|
|
|
19097
19099
|
const m2 = entry.match(/WI-(\d+)/);
|
|
19098
19100
|
if (m2) max = Math.max(max, parseInt(m2[1], 10));
|
|
19099
19101
|
} else if (!entry.startsWith(".")) {
|
|
19100
|
-
|
|
19102
|
+
walk2(full);
|
|
19101
19103
|
}
|
|
19102
19104
|
}
|
|
19103
19105
|
};
|
|
19104
|
-
|
|
19106
|
+
walk2(wiDir);
|
|
19105
19107
|
return `WI-${String(max + 1).padStart(3, "0")}`;
|
|
19106
19108
|
}
|
|
19107
19109
|
function atomicWrite3(filePath, content) {
|
|
@@ -20716,8 +20718,8 @@ async function handleJiraResponse(res) {
|
|
|
20716
20718
|
}
|
|
20717
20719
|
return await res.json();
|
|
20718
20720
|
}
|
|
20719
|
-
async function jiraFetch(baseUrl,
|
|
20720
|
-
const url = new URL(
|
|
20721
|
+
async function jiraFetch(baseUrl, path82, auth, timeoutMs, params) {
|
|
20722
|
+
const url = new URL(path82, baseUrl + "/");
|
|
20721
20723
|
if (params) for (const [k2, v] of Object.entries(params)) url.searchParams.set(k2, v);
|
|
20722
20724
|
const controller = new AbortController();
|
|
20723
20725
|
const timer = setTimeout(() => controller.abort(), timeoutMs);
|
|
@@ -20735,8 +20737,8 @@ async function jiraFetch(baseUrl, path62, auth, timeoutMs, params) {
|
|
|
20735
20737
|
clearTimeout(timer);
|
|
20736
20738
|
}
|
|
20737
20739
|
}
|
|
20738
|
-
async function jiraPost(baseUrl,
|
|
20739
|
-
const url = new URL(
|
|
20740
|
+
async function jiraPost(baseUrl, path82, auth, timeoutMs, body) {
|
|
20741
|
+
const url = new URL(path82, baseUrl + "/");
|
|
20740
20742
|
const controller = new AbortController();
|
|
20741
20743
|
const timer = setTimeout(() => controller.abort(), timeoutMs);
|
|
20742
20744
|
try {
|
|
@@ -21197,7 +21199,7 @@ function addExternalLink(dir, id, link) {
|
|
|
21197
21199
|
function nextWorkItemId2(dir) {
|
|
21198
21200
|
const wiDir = join3(dir, WORK_ITEMS_DIR2);
|
|
21199
21201
|
let max = 0;
|
|
21200
|
-
const
|
|
21202
|
+
const walk2 = (d3) => {
|
|
21201
21203
|
if (!exists2(d3)) return;
|
|
21202
21204
|
for (const entry of readDir2(d3)) {
|
|
21203
21205
|
const full = join3(d3, entry);
|
|
@@ -21205,11 +21207,11 @@ function nextWorkItemId2(dir) {
|
|
|
21205
21207
|
const m2 = entry.match(/WI-(\d+)/);
|
|
21206
21208
|
if (m2) max = Math.max(max, parseInt(m2[1], 10));
|
|
21207
21209
|
} else if (!entry.startsWith(".")) {
|
|
21208
|
-
|
|
21210
|
+
walk2(full);
|
|
21209
21211
|
}
|
|
21210
21212
|
}
|
|
21211
21213
|
};
|
|
21212
|
-
|
|
21214
|
+
walk2(wiDir);
|
|
21213
21215
|
return `WI-${String(max + 1).padStart(3, "0")}`;
|
|
21214
21216
|
}
|
|
21215
21217
|
function buildWorkItemContent(wiId, iniId, candidate) {
|
|
@@ -21394,7 +21396,7 @@ function evaluateInitiativeCompletion(dir, ini) {
|
|
|
21394
21396
|
// ../cli/src/core/resource-write.ts
|
|
21395
21397
|
import fs6 from "fs";
|
|
21396
21398
|
import path5 from "path";
|
|
21397
|
-
import
|
|
21399
|
+
import matter21 from "gray-matter";
|
|
21398
21400
|
var RESOURCES_DIR = "knowledge/tech/resources";
|
|
21399
21401
|
var ResourceWriteError = class extends Error {
|
|
21400
21402
|
constructor(code, message) {
|
|
@@ -21474,7 +21476,7 @@ function buildFrontmatter(id, input, base = {}) {
|
|
|
21474
21476
|
return data;
|
|
21475
21477
|
}
|
|
21476
21478
|
function serialize(data, body) {
|
|
21477
|
-
return
|
|
21479
|
+
return matter21.stringify(`
|
|
21478
21480
|
${body.trim()}
|
|
21479
21481
|
`, data);
|
|
21480
21482
|
}
|
|
@@ -21514,7 +21516,7 @@ function updateResource(dir, id, input) {
|
|
|
21514
21516
|
throw new ResourceWriteError("VALIDATION_FAILED", findings.filter((f3) => f3.level === "error").map((f3) => f3.message).join("; "));
|
|
21515
21517
|
}
|
|
21516
21518
|
const raw = readFile(match.filePath);
|
|
21517
|
-
const parsed =
|
|
21519
|
+
const parsed = matter21(raw);
|
|
21518
21520
|
const base = parsed.data ?? {};
|
|
21519
21521
|
const data = buildFrontmatter(match.id || id, input, base);
|
|
21520
21522
|
let body = parsed.content.trim();
|
|
@@ -21747,7 +21749,7 @@ var CANDIDATE_DISCOVERY_GUIDANCE2 = [
|
|
|
21747
21749
|
// ../cli/src/core/deprecation-write.ts
|
|
21748
21750
|
import fs7 from "fs";
|
|
21749
21751
|
import path6 from "path";
|
|
21750
|
-
import
|
|
21752
|
+
import matter23 from "gray-matter";
|
|
21751
21753
|
var DeprecationWriteError = class extends Error {
|
|
21752
21754
|
constructor(code, message) {
|
|
21753
21755
|
super(message);
|
|
@@ -21765,7 +21767,7 @@ function atomicWrite2(filePath, content) {
|
|
|
21765
21767
|
fs7.renameSync(tmp, filePath);
|
|
21766
21768
|
}
|
|
21767
21769
|
function serialize3(data, body) {
|
|
21768
|
-
return
|
|
21770
|
+
return matter23.stringify(`
|
|
21769
21771
|
${body.trim()}
|
|
21770
21772
|
`, data);
|
|
21771
21773
|
}
|
|
@@ -21831,7 +21833,7 @@ function validateTargetInput(dir, raw) {
|
|
|
21831
21833
|
function loadPlanRaw(dir, planId) {
|
|
21832
21834
|
const match = allPlanArtifacts(dir).find((a2) => a2.id === planId || a2.title === planId);
|
|
21833
21835
|
if (!match) throw new DeprecationWriteError("NOT_FOUND", `Deprecation Plan "${planId}" not found.`);
|
|
21834
|
-
const parsed =
|
|
21836
|
+
const parsed = matter23(readFile(match.filePath));
|
|
21835
21837
|
const data = { ...parsed.data ?? {} };
|
|
21836
21838
|
return { filePath: match.filePath, data, body: parsed.content.trim() };
|
|
21837
21839
|
}
|
|
@@ -22019,12 +22021,12 @@ function markWorkItemReady(root, id, confirm2) {
|
|
|
22019
22021
|
}
|
|
22020
22022
|
const raw = readText(root, item.path);
|
|
22021
22023
|
if (!raw) return fail(`Could not read Work Item file: ${item.path}`);
|
|
22022
|
-
const parsed =
|
|
22024
|
+
const parsed = matter24(raw);
|
|
22023
22025
|
const data = { ...parsed.data };
|
|
22024
22026
|
const today3 = (/* @__PURE__ */ new Date()).toISOString().slice(0, 10);
|
|
22025
22027
|
data.status = "ready";
|
|
22026
22028
|
data.ready_at = today3;
|
|
22027
|
-
const newContent =
|
|
22029
|
+
const newContent = matter24.stringify(parsed.content, data);
|
|
22028
22030
|
const posixPath = item.path.replace(/\\/g, "/");
|
|
22029
22031
|
let newRelPath = item.path;
|
|
22030
22032
|
if (posixPath.includes("/work-items/draft/")) {
|
|
@@ -22319,7 +22321,7 @@ function removeDeprecationTargetTool(root, planId, targetId, confirm2) {
|
|
|
22319
22321
|
// src/multirepo.ts
|
|
22320
22322
|
import fs8 from "fs";
|
|
22321
22323
|
import path7 from "path";
|
|
22322
|
-
import
|
|
22324
|
+
import matter25 from "gray-matter";
|
|
22323
22325
|
import { parse as parseYaml12, stringify as stringifyYaml8 } from "yaml";
|
|
22324
22326
|
var ok2 = (data) => ({ ok: true, data });
|
|
22325
22327
|
var fail2 = (message) => ({ ok: false, message });
|
|
@@ -22471,7 +22473,7 @@ function validateWorkItemModulesTool(root, args) {
|
|
|
22471
22473
|
if (!wi) return fail2(`Work Item "${args.workItemId}" not found.`);
|
|
22472
22474
|
const raw = readText(root, wi.path);
|
|
22473
22475
|
if (!raw) return fail2(`Could not read Work Item file.`);
|
|
22474
|
-
const parsed =
|
|
22476
|
+
const parsed = matter25(raw);
|
|
22475
22477
|
const data = parsed.data;
|
|
22476
22478
|
const affectedModules = Array.isArray(data.affected_modules) ? data.affected_modules.map(String) : [];
|
|
22477
22479
|
const codeEntries = Array.isArray(data.code) ? data.code.filter((c) => typeof c === "object" && c !== null).map((c) => ({ repo: typeof c.repo === "string" ? c.repo : void 0, paths: Array.isArray(c.paths) ? c.paths.map(String) : [] })) : [];
|
|
@@ -22524,7 +22526,7 @@ function getWorkItemContextTool(root, args) {
|
|
|
22524
22526
|
if (!wi) return fail2(`Work Item "${args.workItemId}" not found.`);
|
|
22525
22527
|
const raw = readText(root, wi.path);
|
|
22526
22528
|
if (!raw) return fail2(`Could not read Work Item file.`);
|
|
22527
|
-
const parsed =
|
|
22529
|
+
const parsed = matter25(raw);
|
|
22528
22530
|
const data = parsed.data;
|
|
22529
22531
|
const affectedModules = Array.isArray(data.affected_modules) ? data.affected_modules.map(String) : [];
|
|
22530
22532
|
const codeEntries = Array.isArray(data.code) ? data.code.filter((c) => typeof c === "object" && c !== null).map((c) => ({ repo: typeof c.repo === "string" ? c.repo : void 0, paths: Array.isArray(c.paths) ? c.paths.map(String) : [] })) : [];
|
|
@@ -22610,7 +22612,7 @@ function suggestBranchStrategyTool(root, args) {
|
|
|
22610
22612
|
if (!wi) return fail2(`Work Item "${args.workItemId}" not found.`);
|
|
22611
22613
|
const raw = readText(root, wi.path);
|
|
22612
22614
|
if (!raw) return fail2(`Could not read Work Item file.`);
|
|
22613
|
-
const parsed =
|
|
22615
|
+
const parsed = matter25(raw);
|
|
22614
22616
|
const data = parsed.data;
|
|
22615
22617
|
const affectedModules = Array.isArray(data.affected_modules) ? data.affected_modules.map(String) : [];
|
|
22616
22618
|
const codeEntries = Array.isArray(data.code) ? data.code.filter((c) => typeof c === "object" && c !== null).map((c) => ({ repo: typeof c.repo === "string" ? c.repo : void 0, paths: Array.isArray(c.paths) ? c.paths.map(String) : [] })) : [];
|
|
@@ -23370,14 +23372,14 @@ function systemImpactCandidatesTool(root, args) {
|
|
|
23370
23372
|
}
|
|
23371
23373
|
|
|
23372
23374
|
// ../cli/src/services/integrations.ts
|
|
23373
|
-
import
|
|
23375
|
+
import matter27 from "gray-matter";
|
|
23374
23376
|
import { parse as parseYaml14, stringify as stringifyYaml10 } from "yaml";
|
|
23375
23377
|
|
|
23376
23378
|
// ../cli/src/core/work-item-write.ts
|
|
23377
23379
|
import fs10 from "fs";
|
|
23378
23380
|
import path9 from "path";
|
|
23379
23381
|
import crypto4 from "crypto";
|
|
23380
|
-
import
|
|
23382
|
+
import matter26 from "gray-matter";
|
|
23381
23383
|
var SECTION_ORDER2 = [
|
|
23382
23384
|
"Actor",
|
|
23383
23385
|
"Outcome",
|
|
@@ -24425,7 +24427,7 @@ async function integrationsWorkItemTool(root, args) {
|
|
|
24425
24427
|
}
|
|
24426
24428
|
|
|
24427
24429
|
// ../cli/src/core/context-pack.ts
|
|
24428
|
-
import
|
|
24430
|
+
import matter28 from "gray-matter";
|
|
24429
24431
|
var CONTEXT_PACK_VERSION = "1";
|
|
24430
24432
|
var ARCH_DIR4 = "knowledge";
|
|
24431
24433
|
function readScanJson(dir) {
|
|
@@ -24438,7 +24440,7 @@ function readScanJson(dir) {
|
|
|
24438
24440
|
}
|
|
24439
24441
|
}
|
|
24440
24442
|
function firstParagraph4(markdown) {
|
|
24441
|
-
const body =
|
|
24443
|
+
const body = matter28(markdown).content.trim();
|
|
24442
24444
|
const para = body.split("\n\n").map((p) => p.trim()).find((p) => p && !p.startsWith("#"));
|
|
24443
24445
|
return para ?? "";
|
|
24444
24446
|
}
|
package/package.json
CHANGED