@kaddo/mcp 3.124.4 → 3.124.5
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 +53 -48
- 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 matter21 from "gray-matter";
|
|
12125
12125
|
|
|
12126
12126
|
// ../cli/dist/core.js
|
|
12127
12127
|
import fs3 from "fs";
|
|
@@ -12148,21 +12148,23 @@ import { dirname as dirname2, join as join22, parse as parse2 } from "path";
|
|
|
12148
12148
|
import { existsSync as existsSync2, readFileSync as readFileSync2 } from "fs";
|
|
12149
12149
|
import matter92 from "gray-matter";
|
|
12150
12150
|
import matter102 from "gray-matter";
|
|
12151
|
+
import { parse as parseYaml82 } from "yaml";
|
|
12151
12152
|
import matter112 from "gray-matter";
|
|
12152
|
-
import
|
|
12153
|
+
import matter122 from "gray-matter";
|
|
12154
|
+
import { parse as parseYaml92, stringify as stringifyYaml52 } from "yaml";
|
|
12153
12155
|
import fs4 from "fs";
|
|
12154
12156
|
import path4 from "path";
|
|
12155
12157
|
import crypto2 from "crypto";
|
|
12156
|
-
import
|
|
12158
|
+
import matter132 from "gray-matter";
|
|
12157
12159
|
import crypto3 from "crypto";
|
|
12158
12160
|
import fs5 from "fs";
|
|
12159
|
-
import matter132 from "gray-matter";
|
|
12160
12161
|
import matter142 from "gray-matter";
|
|
12161
|
-
import { parse as parseYaml92, stringify as stringifyYaml6 } from "yaml";
|
|
12162
|
-
import { parse as parseYaml102, stringify as stringifyYaml7 } from "yaml";
|
|
12163
12162
|
import matter15 from "gray-matter";
|
|
12163
|
+
import { parse as parseYaml102, stringify as stringifyYaml6 } from "yaml";
|
|
12164
|
+
import { parse as parseYaml11, stringify as stringifyYaml7 } from "yaml";
|
|
12164
12165
|
import matter16 from "gray-matter";
|
|
12165
12166
|
import matter17 from "gray-matter";
|
|
12167
|
+
import matter18 from "gray-matter";
|
|
12166
12168
|
function exists2(p) {
|
|
12167
12169
|
return fs3.existsSync(p);
|
|
12168
12170
|
}
|
|
@@ -18479,6 +18481,9 @@ var LEGACY_STEPS2 = [
|
|
|
18479
18481
|
runGuard2,
|
|
18480
18482
|
captureLearning2
|
|
18481
18483
|
];
|
|
18484
|
+
var HISTORY_DIR2 = ".kaddo/history";
|
|
18485
|
+
var RUNS_PATH2 = `${HISTORY_DIR2}/guard-runs.jsonl`;
|
|
18486
|
+
var SUMMARY_PATH2 = `${HISTORY_DIR2}/guard-summary.json`;
|
|
18482
18487
|
var USER_FACING_KEYWORDS_EN = [
|
|
18483
18488
|
"user",
|
|
18484
18489
|
"visitor",
|
|
@@ -18665,7 +18670,7 @@ function loadSystemTopology(dir) {
|
|
|
18665
18670
|
function parseTopologyContent(raw, dir) {
|
|
18666
18671
|
let parsed;
|
|
18667
18672
|
try {
|
|
18668
|
-
parsed =
|
|
18673
|
+
parsed = parseYaml92(raw) ?? {};
|
|
18669
18674
|
} catch {
|
|
18670
18675
|
return { entities: [], relationships: [], findings: [{ level: "blocking", message: "The topology could not be parsed." }] };
|
|
18671
18676
|
}
|
|
@@ -18884,7 +18889,7 @@ function parseOriginalSnapshot(fm) {
|
|
|
18884
18889
|
function readBody(filePath) {
|
|
18885
18890
|
try {
|
|
18886
18891
|
const raw = readFile2(filePath);
|
|
18887
|
-
return
|
|
18892
|
+
return matter122(raw).content;
|
|
18888
18893
|
} catch {
|
|
18889
18894
|
return "";
|
|
18890
18895
|
}
|
|
@@ -19169,7 +19174,7 @@ function ensureH1(body, title) {
|
|
|
19169
19174
|
${trimmed}`;
|
|
19170
19175
|
}
|
|
19171
19176
|
function serialize2(data, body) {
|
|
19172
|
-
return
|
|
19177
|
+
return matter132.stringify(`
|
|
19173
19178
|
${body.trim()}
|
|
19174
19179
|
`, data);
|
|
19175
19180
|
}
|
|
@@ -20083,7 +20088,7 @@ function detectFormat(raw) {
|
|
|
20083
20088
|
if (!trimmed) throw new ImportError("EMPTY_INPUT", "Import content is empty.");
|
|
20084
20089
|
if (trimmed.startsWith("---")) {
|
|
20085
20090
|
try {
|
|
20086
|
-
const { data } =
|
|
20091
|
+
const { data } = matter142(trimmed);
|
|
20087
20092
|
if (data && typeof data === "object" && Object.keys(data).length > 0) {
|
|
20088
20093
|
const d3 = data;
|
|
20089
20094
|
if (d3.type === "work-item" || d3.id && typeof d3.id === "string" && /^WI-\d+/.test(d3.id)) {
|
|
@@ -20105,7 +20110,7 @@ function parseContent(raw) {
|
|
|
20105
20110
|
let bodyText = trimmed;
|
|
20106
20111
|
if (format === "kaddo-frontmatter" || format === "markdown-frontmatter") {
|
|
20107
20112
|
try {
|
|
20108
|
-
const parsed =
|
|
20113
|
+
const parsed = matter142(trimmed);
|
|
20109
20114
|
frontmatterFields = parsed.data ?? {};
|
|
20110
20115
|
bodyText = parsed.content.trim();
|
|
20111
20116
|
} catch {
|
|
@@ -20202,7 +20207,7 @@ function findDuplicateByHash(dir, hash) {
|
|
|
20202
20207
|
const raw = readFile2(item.filePath);
|
|
20203
20208
|
if (!raw) continue;
|
|
20204
20209
|
try {
|
|
20205
|
-
const { data } =
|
|
20210
|
+
const { data } = matter142(raw);
|
|
20206
20211
|
const source22 = data?.source;
|
|
20207
20212
|
if (source22 && typeof source22 === "object" && !Array.isArray(source22)) {
|
|
20208
20213
|
const s = source22;
|
|
@@ -20918,7 +20923,7 @@ function persistConsent(dir, consent) {
|
|
|
20918
20923
|
const configPath = join3(dir, ".kaddo", "config.yml");
|
|
20919
20924
|
if (!exists2(configPath)) return;
|
|
20920
20925
|
const raw = readFile2(configPath);
|
|
20921
|
-
const doc =
|
|
20926
|
+
const doc = parseYaml11(raw) ?? {};
|
|
20922
20927
|
const prev = doc.telemetry ?? {};
|
|
20923
20928
|
delete prev.enabled;
|
|
20924
20929
|
doc.telemetry = { ...prev, consent, consentVersion: CURRENT_CONSENT_VERSION };
|
|
@@ -21097,7 +21102,7 @@ function buildInitiativeContent(id, input) {
|
|
|
21097
21102
|
if (input.priority) data.priority = input.priority;
|
|
21098
21103
|
if (input.source) data.source = input.source;
|
|
21099
21104
|
if (input.sourceId) data.source_id = input.sourceId;
|
|
21100
|
-
return
|
|
21105
|
+
return matter16.stringify("\n" + (input.body ?? defaultBody(input.title.trim())), data);
|
|
21101
21106
|
}
|
|
21102
21107
|
function createInitiative(dir, input) {
|
|
21103
21108
|
if (!input.title?.trim()) throw new InitiativeWriteError("Initiative title is required.");
|
|
@@ -21121,10 +21126,10 @@ function transitionInitiative(dir, id, to) {
|
|
|
21121
21126
|
throw new InitiativeWriteError(`Invalid transition ${ini.status} \u2192 ${to}.`);
|
|
21122
21127
|
}
|
|
21123
21128
|
const raw = readFile2(ini.filePath);
|
|
21124
|
-
const { data, content } =
|
|
21129
|
+
const { data, content } = matter16(raw, {});
|
|
21125
21130
|
data.status = to;
|
|
21126
21131
|
if (to === "completed") data.completed_at = today2();
|
|
21127
|
-
const newContent =
|
|
21132
|
+
const newContent = matter16.stringify(content, data);
|
|
21128
21133
|
writeFile2(ini.filePath, newContent);
|
|
21129
21134
|
const updated = parseInitiative2(dir, ini.filePath, newContent);
|
|
21130
21135
|
if (!updated) throw new InitiativeWriteError("Failed to parse the Initiative after transition.");
|
|
@@ -21134,7 +21139,7 @@ function addCandidate(dir, id, candidate) {
|
|
|
21134
21139
|
const ini = getInitiative(dir, id);
|
|
21135
21140
|
if (!ini) throw new InitiativeWriteError(`Initiative ${id} not found.`);
|
|
21136
21141
|
const raw = readFile2(ini.filePath);
|
|
21137
|
-
const { data, content } =
|
|
21142
|
+
const { data, content } = matter16(raw, {});
|
|
21138
21143
|
const existing = Array.isArray(data.candidates) ? data.candidates : [];
|
|
21139
21144
|
const fallbackId = `WI-CANDIDATE-${String(existing.length + 1).padStart(3, "0")}`;
|
|
21140
21145
|
const normalized = normalizeCandidate(candidate, fallbackId);
|
|
@@ -21142,7 +21147,7 @@ function addCandidate(dir, id, candidate) {
|
|
|
21142
21147
|
throw new InitiativeWriteError(`Candidate ${normalized.id} already exists in ${id}.`);
|
|
21143
21148
|
}
|
|
21144
21149
|
data.candidates = [...existing, candidateToData(normalized)];
|
|
21145
|
-
const newContent =
|
|
21150
|
+
const newContent = matter16.stringify(content, data);
|
|
21146
21151
|
writeFile2(ini.filePath, newContent);
|
|
21147
21152
|
const updated = parseInitiative2(dir, ini.filePath, newContent);
|
|
21148
21153
|
if (!updated) throw new InitiativeWriteError("Failed to parse the Initiative after adding a candidate.");
|
|
@@ -21152,7 +21157,7 @@ function updateInitiative(dir, id, patch) {
|
|
|
21152
21157
|
const ini = getInitiative(dir, id);
|
|
21153
21158
|
if (!ini) throw new InitiativeWriteError(`Initiative ${id} not found.`);
|
|
21154
21159
|
const raw = readFile2(ini.filePath);
|
|
21155
|
-
const { data, content } =
|
|
21160
|
+
const { data, content } = matter16(raw, {});
|
|
21156
21161
|
if (patch.title !== void 0) {
|
|
21157
21162
|
if (!patch.title.trim()) throw new InitiativeWriteError("Initiative title cannot be empty.");
|
|
21158
21163
|
data.title = patch.title.trim();
|
|
@@ -21162,7 +21167,7 @@ function updateInitiative(dir, id, patch) {
|
|
|
21162
21167
|
if (patch.knowledgeLevel !== void 0) data.knowledge_level = patch.knowledgeLevel;
|
|
21163
21168
|
if (patch.domains !== void 0) data.domains = patch.domains;
|
|
21164
21169
|
if (patch.relatedCapabilities !== void 0) data.related_capabilities = patch.relatedCapabilities;
|
|
21165
|
-
const newContent =
|
|
21170
|
+
const newContent = matter16.stringify(content, data);
|
|
21166
21171
|
writeFile2(ini.filePath, newContent);
|
|
21167
21172
|
const updated = parseInitiative2(dir, ini.filePath, newContent);
|
|
21168
21173
|
if (!updated) throw new InitiativeWriteError("Failed to parse the Initiative after update.");
|
|
@@ -21180,10 +21185,10 @@ function addExternalLink(dir, id, link) {
|
|
|
21180
21185
|
throw new InitiativeWriteError(`External link ${link.integration}:${link.externalId} already exists on ${id}.`);
|
|
21181
21186
|
}
|
|
21182
21187
|
const raw = readFile2(ini.filePath);
|
|
21183
|
-
const { data, content } =
|
|
21188
|
+
const { data, content } = matter16(raw, {});
|
|
21184
21189
|
const existing = Array.isArray(data.external_links) ? data.external_links : [];
|
|
21185
21190
|
data.external_links = [...existing, externalLinkToData(link)];
|
|
21186
|
-
const newContent =
|
|
21191
|
+
const newContent = matter16.stringify(content, data);
|
|
21187
21192
|
writeFile2(ini.filePath, newContent);
|
|
21188
21193
|
const updated = parseInitiative2(dir, ini.filePath, newContent);
|
|
21189
21194
|
if (!updated) throw new InitiativeWriteError("Failed to parse the Initiative after adding an external link.");
|
|
@@ -21252,7 +21257,7 @@ function buildWorkItemContent(wiId, iniId, candidate) {
|
|
|
21252
21257
|
"_What did we learn? Update after completion._",
|
|
21253
21258
|
""
|
|
21254
21259
|
].join("\n");
|
|
21255
|
-
return
|
|
21260
|
+
return matter16.stringify("\n" + body, data);
|
|
21256
21261
|
}
|
|
21257
21262
|
function materializeCandidate(dir, id, candidateId) {
|
|
21258
21263
|
const ini = getInitiative(dir, id);
|
|
@@ -21269,13 +21274,13 @@ function materializeCandidate(dir, id, candidateId) {
|
|
|
21269
21274
|
ensureDir2(join3(dir, DRAFT_DIR));
|
|
21270
21275
|
writeFile2(join3(dir, DRAFT_DIR, fileName), buildWorkItemContent(wiId, ini.id, candidate));
|
|
21271
21276
|
const raw = readFile2(ini.filePath);
|
|
21272
|
-
const { data, content } =
|
|
21277
|
+
const { data, content } = matter16(raw, {});
|
|
21273
21278
|
const cands = Array.isArray(data.candidates) ? data.candidates : [];
|
|
21274
21279
|
for (const c of cands) {
|
|
21275
21280
|
if (c && typeof c === "object" && String(c.id) === candidateId) c.materialized_as = wiId;
|
|
21276
21281
|
}
|
|
21277
21282
|
data.candidates = cands;
|
|
21278
|
-
const newContent =
|
|
21283
|
+
const newContent = matter16.stringify(content, data);
|
|
21279
21284
|
writeFile2(ini.filePath, newContent);
|
|
21280
21285
|
const updated = parseInitiative2(dir, ini.filePath, newContent);
|
|
21281
21286
|
if (!updated) throw new InitiativeWriteError("Failed to parse the Initiative after materialization.");
|
|
@@ -21389,7 +21394,7 @@ function evaluateInitiativeCompletion(dir, ini) {
|
|
|
21389
21394
|
// ../cli/src/core/resource-write.ts
|
|
21390
21395
|
import fs6 from "fs";
|
|
21391
21396
|
import path5 from "path";
|
|
21392
|
-
import
|
|
21397
|
+
import matter19 from "gray-matter";
|
|
21393
21398
|
var RESOURCES_DIR = "knowledge/tech/resources";
|
|
21394
21399
|
var ResourceWriteError = class extends Error {
|
|
21395
21400
|
constructor(code, message) {
|
|
@@ -21469,7 +21474,7 @@ function buildFrontmatter(id, input, base = {}) {
|
|
|
21469
21474
|
return data;
|
|
21470
21475
|
}
|
|
21471
21476
|
function serialize(data, body) {
|
|
21472
|
-
return
|
|
21477
|
+
return matter19.stringify(`
|
|
21473
21478
|
${body.trim()}
|
|
21474
21479
|
`, data);
|
|
21475
21480
|
}
|
|
@@ -21509,7 +21514,7 @@ function updateResource(dir, id, input) {
|
|
|
21509
21514
|
throw new ResourceWriteError("VALIDATION_FAILED", findings.filter((f3) => f3.level === "error").map((f3) => f3.message).join("; "));
|
|
21510
21515
|
}
|
|
21511
21516
|
const raw = readFile(match.filePath);
|
|
21512
|
-
const parsed =
|
|
21517
|
+
const parsed = matter19(raw);
|
|
21513
21518
|
const base = parsed.data ?? {};
|
|
21514
21519
|
const data = buildFrontmatter(match.id || id, input, base);
|
|
21515
21520
|
let body = parsed.content.trim();
|
|
@@ -21742,7 +21747,7 @@ var CANDIDATE_DISCOVERY_GUIDANCE2 = [
|
|
|
21742
21747
|
// ../cli/src/core/deprecation-write.ts
|
|
21743
21748
|
import fs7 from "fs";
|
|
21744
21749
|
import path6 from "path";
|
|
21745
|
-
import
|
|
21750
|
+
import matter20 from "gray-matter";
|
|
21746
21751
|
var DeprecationWriteError = class extends Error {
|
|
21747
21752
|
constructor(code, message) {
|
|
21748
21753
|
super(message);
|
|
@@ -21760,7 +21765,7 @@ function atomicWrite2(filePath, content) {
|
|
|
21760
21765
|
fs7.renameSync(tmp, filePath);
|
|
21761
21766
|
}
|
|
21762
21767
|
function serialize3(data, body) {
|
|
21763
|
-
return
|
|
21768
|
+
return matter20.stringify(`
|
|
21764
21769
|
${body.trim()}
|
|
21765
21770
|
`, data);
|
|
21766
21771
|
}
|
|
@@ -21826,7 +21831,7 @@ function validateTargetInput(dir, raw) {
|
|
|
21826
21831
|
function loadPlanRaw(dir, planId) {
|
|
21827
21832
|
const match = allPlanArtifacts(dir).find((a2) => a2.id === planId || a2.title === planId);
|
|
21828
21833
|
if (!match) throw new DeprecationWriteError("NOT_FOUND", `Deprecation Plan "${planId}" not found.`);
|
|
21829
|
-
const parsed =
|
|
21834
|
+
const parsed = matter20(readFile(match.filePath));
|
|
21830
21835
|
const data = { ...parsed.data ?? {} };
|
|
21831
21836
|
return { filePath: match.filePath, data, body: parsed.content.trim() };
|
|
21832
21837
|
}
|
|
@@ -22014,12 +22019,12 @@ function markWorkItemReady(root, id, confirm2) {
|
|
|
22014
22019
|
}
|
|
22015
22020
|
const raw = readText(root, item.path);
|
|
22016
22021
|
if (!raw) return fail(`Could not read Work Item file: ${item.path}`);
|
|
22017
|
-
const parsed =
|
|
22022
|
+
const parsed = matter21(raw);
|
|
22018
22023
|
const data = { ...parsed.data };
|
|
22019
22024
|
const today3 = (/* @__PURE__ */ new Date()).toISOString().slice(0, 10);
|
|
22020
22025
|
data.status = "ready";
|
|
22021
22026
|
data.ready_at = today3;
|
|
22022
|
-
const newContent =
|
|
22027
|
+
const newContent = matter21.stringify(parsed.content, data);
|
|
22023
22028
|
const posixPath = item.path.replace(/\\/g, "/");
|
|
22024
22029
|
let newRelPath = item.path;
|
|
22025
22030
|
if (posixPath.includes("/work-items/draft/")) {
|
|
@@ -22314,8 +22319,8 @@ function removeDeprecationTargetTool(root, planId, targetId, confirm2) {
|
|
|
22314
22319
|
// src/multirepo.ts
|
|
22315
22320
|
import fs8 from "fs";
|
|
22316
22321
|
import path7 from "path";
|
|
22317
|
-
import
|
|
22318
|
-
import { parse as
|
|
22322
|
+
import matter23 from "gray-matter";
|
|
22323
|
+
import { parse as parseYaml12, stringify as stringifyYaml8 } from "yaml";
|
|
22319
22324
|
var ok2 = (data) => ({ ok: true, data });
|
|
22320
22325
|
var fail2 = (message) => ({ ok: false, message });
|
|
22321
22326
|
function moduleRepoPath(m2) {
|
|
@@ -22351,7 +22356,7 @@ function detectModuleStatus2(root, repoPath) {
|
|
|
22351
22356
|
}
|
|
22352
22357
|
let parsed = null;
|
|
22353
22358
|
try {
|
|
22354
|
-
parsed =
|
|
22359
|
+
parsed = parseYaml12(fs8.readFileSync(configPath, "utf-8"));
|
|
22355
22360
|
} catch {
|
|
22356
22361
|
}
|
|
22357
22362
|
const role = parsed?.project?.role ?? parsed?.multirepo?.role;
|
|
@@ -22466,7 +22471,7 @@ function validateWorkItemModulesTool(root, args) {
|
|
|
22466
22471
|
if (!wi) return fail2(`Work Item "${args.workItemId}" not found.`);
|
|
22467
22472
|
const raw = readText(root, wi.path);
|
|
22468
22473
|
if (!raw) return fail2(`Could not read Work Item file.`);
|
|
22469
|
-
const parsed =
|
|
22474
|
+
const parsed = matter23(raw);
|
|
22470
22475
|
const data = parsed.data;
|
|
22471
22476
|
const affectedModules = Array.isArray(data.affected_modules) ? data.affected_modules.map(String) : [];
|
|
22472
22477
|
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) : [] })) : [];
|
|
@@ -22519,7 +22524,7 @@ function getWorkItemContextTool(root, args) {
|
|
|
22519
22524
|
if (!wi) return fail2(`Work Item "${args.workItemId}" not found.`);
|
|
22520
22525
|
const raw = readText(root, wi.path);
|
|
22521
22526
|
if (!raw) return fail2(`Could not read Work Item file.`);
|
|
22522
|
-
const parsed =
|
|
22527
|
+
const parsed = matter23(raw);
|
|
22523
22528
|
const data = parsed.data;
|
|
22524
22529
|
const affectedModules = Array.isArray(data.affected_modules) ? data.affected_modules.map(String) : [];
|
|
22525
22530
|
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) : [] })) : [];
|
|
@@ -22605,7 +22610,7 @@ function suggestBranchStrategyTool(root, args) {
|
|
|
22605
22610
|
if (!wi) return fail2(`Work Item "${args.workItemId}" not found.`);
|
|
22606
22611
|
const raw = readText(root, wi.path);
|
|
22607
22612
|
if (!raw) return fail2(`Could not read Work Item file.`);
|
|
22608
|
-
const parsed =
|
|
22613
|
+
const parsed = matter23(raw);
|
|
22609
22614
|
const data = parsed.data;
|
|
22610
22615
|
const affectedModules = Array.isArray(data.affected_modules) ? data.affected_modules.map(String) : [];
|
|
22611
22616
|
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) : [] })) : [];
|
|
@@ -22778,7 +22783,7 @@ function modulesDiscoverTool(root, args) {
|
|
|
22778
22783
|
}
|
|
22779
22784
|
let parsed = null;
|
|
22780
22785
|
try {
|
|
22781
|
-
parsed =
|
|
22786
|
+
parsed = parseYaml12(fs8.readFileSync(cfgPath, "utf-8"));
|
|
22782
22787
|
} catch {
|
|
22783
22788
|
}
|
|
22784
22789
|
const role = parsed?.project?.role ?? parsed?.multirepo?.role;
|
|
@@ -22851,7 +22856,7 @@ ${list3(data.owners)}
|
|
|
22851
22856
|
}
|
|
22852
22857
|
|
|
22853
22858
|
// ../cli/src/core/system-topology.ts
|
|
22854
|
-
import { parse as
|
|
22859
|
+
import { parse as parseYaml13, stringify as stringifyYaml9 } from "yaml";
|
|
22855
22860
|
import fs9 from "fs";
|
|
22856
22861
|
import path8 from "path";
|
|
22857
22862
|
import crypto from "crypto";
|
|
@@ -22898,7 +22903,7 @@ function loadSystemTopology2(dir) {
|
|
|
22898
22903
|
function parseTopologyContent2(raw, dir) {
|
|
22899
22904
|
let parsed;
|
|
22900
22905
|
try {
|
|
22901
|
-
parsed =
|
|
22906
|
+
parsed = parseYaml13(raw) ?? {};
|
|
22902
22907
|
} catch {
|
|
22903
22908
|
return { entities: [], relationships: [], findings: [{ level: "blocking", message: "The topology could not be parsed." }] };
|
|
22904
22909
|
}
|
|
@@ -23365,14 +23370,14 @@ function systemImpactCandidatesTool(root, args) {
|
|
|
23365
23370
|
}
|
|
23366
23371
|
|
|
23367
23372
|
// ../cli/src/services/integrations.ts
|
|
23368
|
-
import
|
|
23369
|
-
import { parse as
|
|
23373
|
+
import matter25 from "gray-matter";
|
|
23374
|
+
import { parse as parseYaml14, stringify as stringifyYaml10 } from "yaml";
|
|
23370
23375
|
|
|
23371
23376
|
// ../cli/src/core/work-item-write.ts
|
|
23372
23377
|
import fs10 from "fs";
|
|
23373
23378
|
import path9 from "path";
|
|
23374
23379
|
import crypto4 from "crypto";
|
|
23375
|
-
import
|
|
23380
|
+
import matter24 from "gray-matter";
|
|
23376
23381
|
var SECTION_ORDER2 = [
|
|
23377
23382
|
"Actor",
|
|
23378
23383
|
"Outcome",
|
|
@@ -24247,7 +24252,7 @@ function loadRaw(dir) {
|
|
|
24247
24252
|
const abs = join(dir, INTEGRATIONS_FILE);
|
|
24248
24253
|
if (!exists(abs)) return { integrations: [] };
|
|
24249
24254
|
try {
|
|
24250
|
-
return
|
|
24255
|
+
return parseYaml14(readFile(abs)) ?? { integrations: [] };
|
|
24251
24256
|
} catch {
|
|
24252
24257
|
return { integrations: [] };
|
|
24253
24258
|
}
|
|
@@ -24420,7 +24425,7 @@ async function integrationsWorkItemTool(root, args) {
|
|
|
24420
24425
|
}
|
|
24421
24426
|
|
|
24422
24427
|
// ../cli/src/core/context-pack.ts
|
|
24423
|
-
import
|
|
24428
|
+
import matter26 from "gray-matter";
|
|
24424
24429
|
var CONTEXT_PACK_VERSION = "1";
|
|
24425
24430
|
var ARCH_DIR4 = "knowledge";
|
|
24426
24431
|
function readScanJson(dir) {
|
|
@@ -24433,7 +24438,7 @@ function readScanJson(dir) {
|
|
|
24433
24438
|
}
|
|
24434
24439
|
}
|
|
24435
24440
|
function firstParagraph4(markdown) {
|
|
24436
|
-
const body =
|
|
24441
|
+
const body = matter26(markdown).content.trim();
|
|
24437
24442
|
const para = body.split("\n\n").map((p) => p.trim()).find((p) => p && !p.startsWith("#"));
|
|
24438
24443
|
return para ?? "";
|
|
24439
24444
|
}
|
package/package.json
CHANGED