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