@kaddo/cli 3.114.0 → 3.115.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.
Files changed (34) hide show
  1. package/dist/admin-dist/assets/{architectureDiagram-3BPJPVTR-eYr0CQIi.js → architectureDiagram-3BPJPVTR-YcMJYo0g.js} +1 -1
  2. package/dist/admin-dist/assets/{chunk-727SXJPM-DrnpGnui.js → chunk-727SXJPM-BVnKaPXl.js} +1 -1
  3. package/dist/admin-dist/assets/{chunk-AQP2D5EJ-CEGy8SpK.js → chunk-AQP2D5EJ-D_Hcj3zm.js} +1 -1
  4. package/dist/admin-dist/assets/{classDiagram-v2-Q7XG4LA2-DA001cdf.js → classDiagram-4FO5ZUOK-C1j2IJF8.js} +1 -1
  5. package/dist/admin-dist/assets/{classDiagram-4FO5ZUOK-DA001cdf.js → classDiagram-v2-Q7XG4LA2-C1j2IJF8.js} +1 -1
  6. package/dist/admin-dist/assets/{dagre-BM42HDAG-BRJ0nXQb.js → dagre-BM42HDAG-ADdKf6j1.js} +1 -1
  7. package/dist/admin-dist/assets/{diagram-2AECGRRQ-xd6Livp4.js → diagram-2AECGRRQ-Z_xeHBlY.js} +1 -1
  8. package/dist/admin-dist/assets/{diagram-5GNKFQAL-o9d2ix0l.js → diagram-5GNKFQAL-Wgzw55l3.js} +1 -1
  9. package/dist/admin-dist/assets/{diagram-LMA3HP47-DcnWjF35.js → diagram-LMA3HP47-Dj6c7SSM.js} +1 -1
  10. package/dist/admin-dist/assets/{diagram-OG6HWLK6-Cw5XQicu.js → diagram-OG6HWLK6-hHqRSSZr.js} +1 -1
  11. package/dist/admin-dist/assets/{erDiagram-TEJ5UH35-DRxLZQPp.js → erDiagram-TEJ5UH35-BTGBIaZr.js} +1 -1
  12. package/dist/admin-dist/assets/{flowDiagram-I6XJVG4X-Pb5MivY8.js → flowDiagram-I6XJVG4X-RZJDjzR6.js} +1 -1
  13. package/dist/admin-dist/assets/{ganttDiagram-6RSMTGT7-Cm7UHfMW.js → ganttDiagram-6RSMTGT7-DI5Lr-xB.js} +1 -1
  14. package/dist/admin-dist/assets/{index-M8TdCEku.js → index-RwMAZcWr.js} +4 -4
  15. package/dist/admin-dist/assets/{infoDiagram-5YYISTIA-Bwq-Ae1z.js → infoDiagram-5YYISTIA-T5KZWjTy.js} +1 -1
  16. package/dist/admin-dist/assets/{ishikawaDiagram-YF4QCWOH-CN8u3lkW.js → ishikawaDiagram-YF4QCWOH-C6Gyb7TQ.js} +1 -1
  17. package/dist/admin-dist/assets/{kanban-definition-UN3LZRKU-DFp13Kfy.js → kanban-definition-UN3LZRKU-Dg8kSuqH.js} +1 -1
  18. package/dist/admin-dist/assets/{linear-sB0c581b.js → linear-NG3wfuct.js} +1 -1
  19. package/dist/admin-dist/assets/{mindmap-definition-RKZ34NQL-Ds_AH-UF.js → mindmap-definition-RKZ34NQL-B1dMo93T.js} +1 -1
  20. package/dist/admin-dist/assets/{pieDiagram-4H26LBE5-CT6aVbJD.js → pieDiagram-4H26LBE5-iIbw9aCq.js} +1 -1
  21. package/dist/admin-dist/assets/{quadrantDiagram-W4KKPZXB-QacGkpjr.js → quadrantDiagram-W4KKPZXB-CBsaVubF.js} +1 -1
  22. package/dist/admin-dist/assets/{requirementDiagram-4Y6WPE33-UjzvMQAY.js → requirementDiagram-4Y6WPE33-CobNACNF.js} +1 -1
  23. package/dist/admin-dist/assets/{sequenceDiagram-3UESZ5HK-Drii4Z9H.js → sequenceDiagram-3UESZ5HK-CpE56jux.js} +1 -1
  24. package/dist/admin-dist/assets/{stateDiagram-AJRCARHV-Cu5M1jgm.js → stateDiagram-AJRCARHV-pSzN5IAu.js} +1 -1
  25. package/dist/admin-dist/assets/{stateDiagram-v2-BHNVJYJU-Dnkqr8wc.js → stateDiagram-v2-BHNVJYJU-LhQFrdKp.js} +1 -1
  26. package/dist/admin-dist/assets/{timeline-definition-PNZ67QCA-BmCLa1NQ.js → timeline-definition-PNZ67QCA-q4yUdZjI.js} +1 -1
  27. package/dist/admin-dist/assets/{vennDiagram-CIIHVFJN-BhHRtC9_.js → vennDiagram-CIIHVFJN-D5DxPuNK.js} +1 -1
  28. package/dist/admin-dist/assets/{wardleyDiagram-YWT4CUSO-BzHZzKlk.js → wardleyDiagram-YWT4CUSO-451b1uEN.js} +1 -1
  29. package/dist/admin-dist/assets/{xychartDiagram-2RQKCTM6-uU2Utuv0.js → xychartDiagram-2RQKCTM6-DnOwq6Mk.js} +1 -1
  30. package/dist/admin-dist/index.html +1 -1
  31. package/dist/admin-server/index.js +2 -0
  32. package/dist/core.js +228 -37
  33. package/dist/index.js +262 -45
  34. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -2499,8 +2499,13 @@ dependencies.
2499
2499
  flags, content/copy, authentication/authorization, notifications, analytics, documentation,
2500
2500
  operations/release \u2014 as affected, reviewed-not-affected, unknown, or not-applicable.
2501
2501
  4. **Module review** \u2014 for multirepo, evaluate each mapped module with the same statuses.
2502
- 5. **Completeness review** \u2014 confirm: outcome covered, journey covered, modules assessed, unknowns
2503
- visible, acceptance criteria end-to-end, scope and out-of-scope coherent.
2502
+ 5. **Resource review** \u2014 ask: does this change need to observe, modify, validate or deliver against a
2503
+ known external resource of the project (a Project Resource under \`knowledge/tech/resources/\` \u2014
2504
+ database, cloud, API, queue, storage\u2026)? If so, declare it in the WI front matter \`resources:\` with
2505
+ a role (\`affected\`, \`implementation\`, \`validation\`, \`delivery\`). Resources are external systems,
2506
+ distinct from \`affected_modules\` (code). Not every WI needs resources (e.g. a CSS change does not).
2507
+ 6. **Completeness review** \u2014 confirm: outcome covered, journey covered, modules assessed, resources
2508
+ assessed, unknowns visible, acceptance criteria end-to-end, scope and out-of-scope coherent.
2504
2509
 
2505
2510
  ## Rules
2506
2511
 
@@ -2511,6 +2516,8 @@ dependencies.
2511
2516
  - Include at least one end-to-end acceptance criterion for user-facing changes.
2512
2517
  - Do not reduce a product intent to the first technical implementation found.
2513
2518
  - Evaluate surfaces and modules before proposing files.
2519
+ - Consider Project Resources when the scope justifies it; never invent resources not backed by
2520
+ project knowledge, and keep \`resources\` (external systems) separate from \`affected_modules\` (code).
2514
2521
  - This skill refines scope and acceptance criteria but does not approve implementation readiness.
2515
2522
  Readiness requires human confirmation through \`kaddo ready\` or the MCP \`mark_work_item_ready\` action.
2516
2523
 
@@ -8363,7 +8370,7 @@ function runIgnoreRemove(artifactId) {
8363
8370
  }
8364
8371
 
8365
8372
  // src/commands/explain.ts
8366
- import matter7 from "gray-matter";
8373
+ import matter8 from "gray-matter";
8367
8374
  import { parse as parseYaml13 } from "yaml";
8368
8375
 
8369
8376
  // src/core/delivery-phase.ts
@@ -11097,8 +11104,117 @@ function computeInitiativeProgress(dir, ini) {
11097
11104
  };
11098
11105
  }
11099
11106
 
11107
+ // src/core/resources.ts
11108
+ import matter5 from "gray-matter";
11109
+ var RESOURCE_ARTIFACT_TYPE = "project-resource";
11110
+ function str(v) {
11111
+ return typeof v === "string" && v.trim() ? v.trim() : null;
11112
+ }
11113
+ function strArray(v) {
11114
+ if (Array.isArray(v)) return v.map((x) => String(x).trim()).filter(Boolean);
11115
+ if (typeof v === "string" && v.trim()) return [v.trim()];
11116
+ return [];
11117
+ }
11118
+ function parseInterfaces(v) {
11119
+ if (!Array.isArray(v)) return [];
11120
+ const out = [];
11121
+ for (const raw of v) {
11122
+ if (!raw || typeof raw !== "object") continue;
11123
+ const o = raw;
11124
+ const type = str(o.type);
11125
+ if (!type) continue;
11126
+ out.push({
11127
+ type,
11128
+ tool: str(o.tool),
11129
+ provider: str(o.provider),
11130
+ purpose: str(o.purpose),
11131
+ operations: strArray(o.operations),
11132
+ environments: strArray(o.environments),
11133
+ constraints: str(o.constraints)
11134
+ });
11135
+ }
11136
+ return out;
11137
+ }
11138
+ function parseBoundaries(v) {
11139
+ if (!v || typeof v !== "object" || Array.isArray(v)) return {};
11140
+ const out = {};
11141
+ for (const [env, val] of Object.entries(v)) {
11142
+ const list2 = strArray(val);
11143
+ if (list2.length > 0) out[env] = list2;
11144
+ }
11145
+ return out;
11146
+ }
11147
+ function parseAuth(v) {
11148
+ if (!v || typeof v !== "object" || Array.isArray(v)) return { mode: null, refs: [] };
11149
+ const o = v;
11150
+ const refs = strArray(o.refs).filter((r) => !r.includes("=") && /^[A-Za-z0-9_.-]+$/.test(r));
11151
+ return { mode: str(o.mode), refs };
11152
+ }
11153
+ function toDetail(filePath, relPath, raw) {
11154
+ const parsed = matter5(raw);
11155
+ const fm2 = parsed.data ?? {};
11156
+ const body = parsed.content.trim();
11157
+ const id = str(fm2.id) ?? "";
11158
+ return {
11159
+ id,
11160
+ title: str(fm2.title) ?? id,
11161
+ resourceType: str(fm2.resource_type),
11162
+ provider: str(fm2.provider),
11163
+ environments: strArray(fm2.environments),
11164
+ path: relPath,
11165
+ purpose: str(fm2.purpose),
11166
+ interfaces: parseInterfaces(fm2.access_interfaces),
11167
+ boundaries: parseBoundaries(fm2.access_boundaries),
11168
+ ...(() => {
11169
+ const a = parseAuth(fm2.authentication);
11170
+ return { authRefs: a.refs, authMode: a.mode };
11171
+ })(),
11172
+ markdownBody: body
11173
+ };
11174
+ }
11175
+ function getResources(dir) {
11176
+ return discoverKnowledge(dir).filter((a) => a.type === RESOURCE_ARTIFACT_TYPE).map((a) => {
11177
+ const fm2 = a.rawFrontmatter;
11178
+ return {
11179
+ id: a.id || str(fm2.id) || a.title,
11180
+ title: a.title || str(fm2.title) || a.id,
11181
+ resourceType: str(fm2.resource_type),
11182
+ provider: str(fm2.provider),
11183
+ environments: strArray(fm2.environments),
11184
+ path: a.relPath
11185
+ };
11186
+ }).sort((x, y) => x.id.localeCompare(y.id));
11187
+ }
11188
+ function getResource(dir, id) {
11189
+ const match = discoverKnowledge(dir).find(
11190
+ (a) => a.type === RESOURCE_ARTIFACT_TYPE && (a.id === id || a.title === id)
11191
+ );
11192
+ if (!match) return null;
11193
+ const raw = readFile(match.filePath);
11194
+ return toDetail(match.filePath, match.relPath, raw);
11195
+ }
11196
+ function parseWorkItemResources(fm2) {
11197
+ const v = fm2.resources;
11198
+ if (!Array.isArray(v)) return [];
11199
+ const out = [];
11200
+ for (const raw of v) {
11201
+ if (!raw || typeof raw !== "object" || Array.isArray(raw)) continue;
11202
+ const o = raw;
11203
+ const id = str(o.id);
11204
+ if (!id) continue;
11205
+ out.push({ id, role: str(o.role) ?? "affected" });
11206
+ }
11207
+ return out;
11208
+ }
11209
+
11100
11210
  // src/core/graph.ts
11101
11211
  var KNOWLEDGE3 = "knowledge";
11212
+ var RESOURCE_ROLE_EDGE = {
11213
+ affected: "affects",
11214
+ implementation: "uses",
11215
+ validation: "validates_with",
11216
+ delivery: "delivers_through"
11217
+ };
11102
11218
  var ACTIVE_STATUSES = ["draft", "ready", "in-progress", "blocked"];
11103
11219
  var ALL_STATUSES = ["draft", "ready", "in-progress", "blocked", "completed"];
11104
11220
  function scopeStatuses(scope) {
@@ -11177,6 +11293,16 @@ function buildGraph(dir, config, opts = {}, now = /* @__PURE__ */ new Date()) {
11177
11293
  if (cand.materializedAs) addEdge(candId, `wi:${cand.materializedAs}`, "materialized_as");
11178
11294
  }
11179
11295
  }
11296
+ const resourceTitleById = /* @__PURE__ */ new Map();
11297
+ for (const r of getResources(dir)) {
11298
+ resourceTitleById.set(r.id, r.title);
11299
+ addNode({
11300
+ id: `resource:${r.id}`,
11301
+ type: "project-resource",
11302
+ label: r.title ? `${r.id} ${r.title}`.trim() : r.id,
11303
+ path: r.path
11304
+ });
11305
+ }
11180
11306
  for (const wi of selectedWIs) {
11181
11307
  const id = wi.id || wi.title;
11182
11308
  if (!id || !id.trim()) continue;
@@ -11201,6 +11327,12 @@ function buildGraph(dir, config, opts = {}, now = /* @__PURE__ */ new Date()) {
11201
11327
  addNode({ id: capId, type: "capability", label: cap });
11202
11328
  addEdge(wiNodeId, capId, "implements");
11203
11329
  }
11330
+ for (const rel of parseWorkItemResources(wi.rawFrontmatter)) {
11331
+ const resId = `resource:${rel.id}`;
11332
+ const title = resourceTitleById.get(rel.id);
11333
+ addNode({ id: resId, type: "project-resource", label: title ? `${rel.id} ${title}`.trim() : rel.id });
11334
+ addEdge(wiNodeId, resId, RESOURCE_ROLE_EDGE[rel.role] ?? "uses");
11335
+ }
11204
11336
  for (const dec of wi.decisions) {
11205
11337
  if (!dec || !dec.trim()) continue;
11206
11338
  const adrId = `adr:${dec}`;
@@ -11579,7 +11711,7 @@ function loadGraphHints(dir) {
11579
11711
  }
11580
11712
 
11581
11713
  // src/services/installed-skills.ts
11582
- import matter5 from "gray-matter";
11714
+ import matter6 from "gray-matter";
11583
11715
  var SKILLS_DIR = join("knowledge", "skills");
11584
11716
  function discoverInstalledSkills(dir) {
11585
11717
  const base = join(dir, SKILLS_DIR);
@@ -11589,7 +11721,7 @@ function discoverInstalledSkills(dir) {
11589
11721
  const skillFile = join(base, entry, "skill.md");
11590
11722
  if (!isFile(skillFile)) continue;
11591
11723
  try {
11592
- const { data } = matter5(readFile(skillFile));
11724
+ const { data } = matter6(readFile(skillFile));
11593
11725
  if (data.type && String(data.type) !== "skill") continue;
11594
11726
  const id = String(data.id ?? entry);
11595
11727
  out.push({
@@ -13133,7 +13265,7 @@ function deriveDeliveryCompletedStatus(dir) {
13133
13265
  }
13134
13266
 
13135
13267
  // src/core/assets.ts
13136
- import matter6 from "gray-matter";
13268
+ import matter7 from "gray-matter";
13137
13269
  function canonicalAgents() {
13138
13270
  return AGENT_PROMPTS.map((a) => ({
13139
13271
  name: a.fileName.replace(/\.md$/, ""),
@@ -13146,7 +13278,7 @@ function canonicalSkills() {
13146
13278
  }
13147
13279
  function versionOf(content) {
13148
13280
  try {
13149
- const v = matter6(content).data.version;
13281
+ const v = matter7(content).data.version;
13150
13282
  return v === void 0 || v === null ? null : String(v);
13151
13283
  } catch {
13152
13284
  return null;
@@ -14629,7 +14761,7 @@ function readKnowledge(dir) {
14629
14761
  if (!exists(knowledgePath)) return null;
14630
14762
  try {
14631
14763
  const raw = readFile(knowledgePath);
14632
- const { data, content } = matter7(raw);
14764
+ const { data, content } = matter8(raw);
14633
14765
  return { content, data };
14634
14766
  } catch {
14635
14767
  return null;
@@ -14640,7 +14772,7 @@ function readRoadmap(dir) {
14640
14772
  if (!exists(roadmapPath)) return null;
14641
14773
  try {
14642
14774
  const raw = readFile(roadmapPath);
14643
- const { content } = matter7(raw);
14775
+ const { content } = matter8(raw);
14644
14776
  return content.trim();
14645
14777
  } catch {
14646
14778
  return null;
@@ -14809,7 +14941,7 @@ function runExplain(opts) {
14809
14941
  }
14810
14942
 
14811
14943
  // src/core/context-pack.ts
14812
- import matter8 from "gray-matter";
14944
+ import matter9 from "gray-matter";
14813
14945
  var CONTEXT_PACK_VERSION = "1";
14814
14946
  var ARCH_DIR6 = "knowledge";
14815
14947
  function readScanJson(dir) {
@@ -14822,7 +14954,7 @@ function readScanJson(dir) {
14822
14954
  }
14823
14955
  }
14824
14956
  function firstParagraph2(markdown) {
14825
- const body = matter8(markdown).content.trim();
14957
+ const body = matter9(markdown).content.trim();
14826
14958
  const para = body.split("\n\n").map((p) => p.trim()).find((p) => p && !p.startsWith("#"));
14827
14959
  return para ?? "";
14828
14960
  }
@@ -14876,6 +15008,8 @@ function toContextWorkItem(a) {
14876
15008
  wi.validationStatus = a.validationStatus || (isHistorical ? "not-assessed" : void 0);
14877
15009
  wi.releaseStatus = a.releaseStatus || (isHistorical ? "not-assessed" : void 0);
14878
15010
  if (a.affectedModules.length > 0) wi.affectedModules = a.affectedModules;
15011
+ const wiResources = parseWorkItemResources(a.rawFrontmatter);
15012
+ if (wiResources.length > 0) wi.resources = wiResources;
14879
15013
  if (a.scopeConfidence) wi.scopeConfidence = a.scopeConfidence;
14880
15014
  if (a.moduleCoverage) wi.moduleCoverage = a.moduleCoverage;
14881
15015
  if (a.impactAnalysis) wi.impactAnalysis = a.impactAnalysis;
@@ -16444,7 +16578,7 @@ function runStatus() {
16444
16578
  // src/commands/learn.ts
16445
16579
  import fs3 from "fs";
16446
16580
  import path7 from "path";
16447
- import matter9 from "gray-matter";
16581
+ import matter10 from "gray-matter";
16448
16582
  var ARCH_DIR9 = "knowledge";
16449
16583
  var WORK_ITEMS_DIR2 = "knowledge/delivery/work-items";
16450
16584
  function completedPathFor(filePath) {
@@ -16459,7 +16593,7 @@ function completedPathFor(filePath) {
16459
16593
  }
16460
16594
  function updateWorkItemFile(filePath, learning) {
16461
16595
  const raw = readFile(filePath);
16462
- const { data, content } = matter9(raw);
16596
+ const { data, content } = matter10(raw);
16463
16597
  data.status = "completed";
16464
16598
  data.completed_at = (/* @__PURE__ */ new Date()).toISOString().split("T")[0];
16465
16599
  let updatedContent = content;
@@ -16484,7 +16618,7 @@ ${learning.trim()}
16484
16618
  ${learning.trim()}
16485
16619
  `;
16486
16620
  }
16487
- const newRaw = matter9.stringify(updatedContent, data);
16621
+ const newRaw = matter10.stringify(updatedContent, data);
16488
16622
  const newPath = completedPathFor(filePath);
16489
16623
  if (newPath !== filePath) {
16490
16624
  ensureDir(path7.dirname(newPath));
@@ -16536,7 +16670,7 @@ async function runLearn(artifactId, opts = {}) {
16536
16670
  process.exit(1);
16537
16671
  }
16538
16672
  const wiRaw = readFile(filePath);
16539
- const wiData = matter9(wiRaw).data;
16673
+ const wiData = matter10(wiRaw).data;
16540
16674
  if (!opts.force) {
16541
16675
  const completionBlockers = [];
16542
16676
  const releaseGates = Array.isArray(wiData.release_gates) ? wiData.release_gates : [];
@@ -16792,7 +16926,7 @@ function runAdd(moduleName, opts = {}, dir = cwd()) {
16792
16926
  }
16793
16927
 
16794
16928
  // src/core/ownership-suggest.ts
16795
- import matter10 from "gray-matter";
16929
+ import matter11 from "gray-matter";
16796
16930
  var SCAN_PATH = ".kaddo/scan.json";
16797
16931
  function normalizeGlob(input) {
16798
16932
  let g = input.trim().replace(/\\/g, "/");
@@ -16914,11 +17048,11 @@ function suggestGlobs(artifact, signals) {
16914
17048
  return [...new Set(out)];
16915
17049
  }
16916
17050
  function applyOwnership(raw, globs, mode = "replace") {
16917
- const parsed = matter10(raw);
17051
+ const parsed = matter11(raw);
16918
17052
  const existing = toStringArray3(parsed.data.code);
16919
17053
  const next = mode === "append" ? [.../* @__PURE__ */ new Set([...existing, ...globs])] : [...new Set(globs)];
16920
17054
  const data = { ...parsed.data, code: next };
16921
- return matter10.stringify(parsed.content, data);
17055
+ return matter11.stringify(parsed.content, data);
16922
17056
  }
16923
17057
 
16924
17058
  // src/commands/owners.ts
@@ -18008,15 +18142,93 @@ async function runTopologyApply(file, opts = {}) {
18008
18142
  }
18009
18143
  }
18010
18144
 
18145
+ // src/commands/resources.ts
18146
+ function runResourcesList(dir = cwd(), opts = {}) {
18147
+ const resources = getResources(dir);
18148
+ if (opts.json) {
18149
+ console.log(JSON.stringify(resources, null, 2));
18150
+ return;
18151
+ }
18152
+ if (resources.length === 0) {
18153
+ console.log("");
18154
+ console.log("No Project Resources are defined for this project.");
18155
+ console.log("");
18156
+ console.log("Add one under:");
18157
+ console.log(" knowledge/tech/resources/");
18158
+ console.log("");
18159
+ return;
18160
+ }
18161
+ console.log("");
18162
+ console.log("Project Resources:");
18163
+ for (const r of resources) {
18164
+ const type = r.resourceType ?? "\u2014";
18165
+ const provider = r.provider ? ` (${r.provider})` : "";
18166
+ const envs = r.environments.length > 0 ? ` [${r.environments.join(", ")}]` : "";
18167
+ console.log(` ${r.id.padEnd(22)} ${type.padEnd(12)}${provider}${envs}`);
18168
+ }
18169
+ console.log("");
18170
+ }
18171
+ function runResourcesGet(id, dir = cwd(), opts = {}) {
18172
+ const resource = getResource(dir, id);
18173
+ if (!resource) {
18174
+ if (opts.json) {
18175
+ console.log(JSON.stringify({ error: `Resource "${id}" not found.` }, null, 2));
18176
+ } else {
18177
+ console.error(`Project Resource "${id}" not found under knowledge/tech/resources/.`);
18178
+ }
18179
+ process.exit(1);
18180
+ }
18181
+ if (opts.json) {
18182
+ console.log(JSON.stringify(resource, null, 2));
18183
+ return;
18184
+ }
18185
+ const r = resource;
18186
+ console.log("");
18187
+ console.log(`${r.id} \u2014 ${r.title}`);
18188
+ console.log("");
18189
+ console.log(` Type: ${r.resourceType ?? "\u2014"}`);
18190
+ console.log(` Provider: ${r.provider ?? "\u2014"}`);
18191
+ if (r.environments.length > 0) console.log(` Environments: ${r.environments.join(", ")}`);
18192
+ if (r.purpose) console.log(` Purpose: ${r.purpose}`);
18193
+ if (r.interfaces.length > 0) {
18194
+ console.log("");
18195
+ console.log(" Access interfaces:");
18196
+ for (const i of r.interfaces) {
18197
+ const tool = i.tool ?? i.provider ?? "";
18198
+ const label = tool ? `${i.type} (${tool})` : i.type;
18199
+ console.log(` - ${label}`);
18200
+ if (i.purpose) console.log(` purpose: ${i.purpose}`);
18201
+ if (i.operations.length > 0) console.log(` operations: ${i.operations.join(", ")}`);
18202
+ if (i.environments.length > 0) console.log(` environments: ${i.environments.join(", ")}`);
18203
+ if (i.constraints) console.log(` constraints: ${i.constraints}`);
18204
+ }
18205
+ }
18206
+ const boundaryEnvs = Object.keys(r.boundaries);
18207
+ if (boundaryEnvs.length > 0) {
18208
+ console.log("");
18209
+ console.log(" Access boundaries:");
18210
+ for (const env of boundaryEnvs) {
18211
+ console.log(` - ${env}: ${r.boundaries[env].join(", ")}`);
18212
+ }
18213
+ }
18214
+ if (r.authRefs.length > 0 || r.authMode) {
18215
+ console.log("");
18216
+ console.log(" Authentication (references only \u2014 never values):");
18217
+ if (r.authMode) console.log(` mode: ${r.authMode}`);
18218
+ if (r.authRefs.length > 0) console.log(` refs: ${r.authRefs.join(", ")}`);
18219
+ }
18220
+ console.log("");
18221
+ }
18222
+
18011
18223
  // src/services/integrations.ts
18012
- import matter12 from "gray-matter";
18224
+ import matter13 from "gray-matter";
18013
18225
  import { parse as parseYaml18, stringify as stringifyYaml9 } from "yaml";
18014
18226
 
18015
18227
  // src/core/work-item-write.ts
18016
18228
  import fs5 from "fs";
18017
18229
  import path9 from "path";
18018
18230
  import crypto2 from "crypto";
18019
- import matter11 from "gray-matter";
18231
+ import matter12 from "gray-matter";
18020
18232
  var WORK_ITEMS_DIR3 = "knowledge/delivery/work-items";
18021
18233
  var WorkItemWriteError = class extends Error {
18022
18234
  constructor(code, message) {
@@ -18120,7 +18332,7 @@ function ensureH1(body, title) {
18120
18332
  ${trimmed}`;
18121
18333
  }
18122
18334
  function serialize(data, body) {
18123
- return matter11.stringify(`
18335
+ return matter12.stringify(`
18124
18336
  ${body.trim()}
18125
18337
  `, data);
18126
18338
  }
@@ -19197,7 +19409,7 @@ function findLinkedWorkItem(dir, integrationId, externalId) {
19197
19409
  for (const art of discoverWorkItems(dir)) {
19198
19410
  let data;
19199
19411
  try {
19200
- data = matter12(readFile(art.filePath)).data;
19412
+ data = matter13(readFile(art.filePath)).data;
19201
19413
  } catch {
19202
19414
  continue;
19203
19415
  }
@@ -19410,7 +19622,7 @@ async function runIntegrationsImport(dir, id, externalId, opts) {
19410
19622
  }
19411
19623
 
19412
19624
  // src/core/impact-report.ts
19413
- import matter13 from "gray-matter";
19625
+ import matter14 from "gray-matter";
19414
19626
  function isBroadGlob(glob) {
19415
19627
  if (!glob.endsWith("/**")) return false;
19416
19628
  const prefix = glob.slice(0, -3);
@@ -19479,7 +19691,7 @@ function buildImpactReport(dir, opts = {}, now = /* @__PURE__ */ new Date()) {
19479
19691
  }
19480
19692
  }
19481
19693
  try {
19482
- const body = matter13(readFile(wi.filePath)).content;
19694
+ const body = matter14(readFile(wi.filePath)).content;
19483
19695
  if (hasSection(body, /acceptance|criterios de aceptaci/i)) withAcceptance++;
19484
19696
  else gaps.missing_acceptance_criteria.push(gapItem(wi, "Add an `## Acceptance Criteria` section."));
19485
19697
  if (hasSection(body, /definition of done|^#{1,6}\s*dod\b|definici[oó]n de (terminado|hecho)/i)) withDoD++;
@@ -20657,7 +20869,7 @@ function runAssetsUpdate(kind, opts = {}) {
20657
20869
  // src/commands/ready.ts
20658
20870
  import fs7 from "fs";
20659
20871
  import path10 from "path";
20660
- import matter14 from "gray-matter";
20872
+ import matter15 from "gray-matter";
20661
20873
  function validateReadiness(content, frontmatter) {
20662
20874
  const warnings = [];
20663
20875
  const body = content.replace(/^---[\s\S]*?---/, "").trim();
@@ -20711,11 +20923,11 @@ function isResolvedSection(text2) {
20711
20923
  }
20712
20924
  function transitionToReady(filePath) {
20713
20925
  const raw = readFile(filePath);
20714
- const { data, content } = matter14(raw);
20926
+ const { data, content } = matter15(raw);
20715
20927
  const today3 = (/* @__PURE__ */ new Date()).toISOString().slice(0, 10);
20716
20928
  data.status = "ready";
20717
20929
  data.ready_at = today3;
20718
- const newContent = matter14.stringify(content, data);
20930
+ const newContent = matter15.stringify(content, data);
20719
20931
  const posix = filePath.replace(/\\/g, "/");
20720
20932
  let newPath = filePath;
20721
20933
  if (posix.includes("/work-items/draft/")) {
@@ -20755,7 +20967,7 @@ async function runReady(id, opts = {}) {
20755
20967
  process.exit(1);
20756
20968
  }
20757
20969
  const raw = readFile(wi.filePath);
20758
- const { data } = matter14(raw);
20970
+ const { data } = matter15(raw);
20759
20971
  const source = parseWorkItemSource(data);
20760
20972
  const warnings = validateReadiness(raw, data);
20761
20973
  log.info(`Work Item found:`);
@@ -20931,10 +21143,10 @@ async function runAdmin(opts = {}) {
20931
21143
  // src/core/work-item-import.ts
20932
21144
  import crypto3 from "crypto";
20933
21145
  import fs8 from "fs";
20934
- import matter16 from "gray-matter";
21146
+ import matter17 from "gray-matter";
20935
21147
 
20936
21148
  // src/core/work-items.ts
20937
- import matter15 from "gray-matter";
21149
+ import matter16 from "gray-matter";
20938
21150
  function computeRefinementStatus(wi) {
20939
21151
  const aspects = {
20940
21152
  outcome: Boolean(wi.currentBehavior?.trim() || wi.targetBehavior?.trim()),
@@ -21002,6 +21214,8 @@ function getWorkItem(dir, workItemId) {
21002
21214
  path: match.relPath,
21003
21215
  // Faithful source of truth: the artifact body already read above, not reconstructed (WI-025).
21004
21216
  markdownBody: body.trim(),
21217
+ // External systems this WI relates to (WI-030), separate from affectedModules (code).
21218
+ resources: parseWorkItemResources(fm2),
21005
21219
  ...parseSystemImpact(dir, fm2)
21006
21220
  };
21007
21221
  return { ...detail, refinement: computeRefinementStatus(detail) };
@@ -21066,7 +21280,7 @@ function parseOriginalSnapshot(fm2) {
21066
21280
  function readBody(filePath) {
21067
21281
  try {
21068
21282
  const raw = readFile(filePath);
21069
- return matter15(raw).content;
21283
+ return matter16(raw).content;
21070
21284
  } catch {
21071
21285
  return "";
21072
21286
  }
@@ -21525,7 +21739,7 @@ function detectFormat(raw) {
21525
21739
  if (!trimmed) throw new ImportError("EMPTY_INPUT", "Import content is empty.");
21526
21740
  if (trimmed.startsWith("---")) {
21527
21741
  try {
21528
- const { data } = matter16(trimmed);
21742
+ const { data } = matter17(trimmed);
21529
21743
  if (data && typeof data === "object" && Object.keys(data).length > 0) {
21530
21744
  const d = data;
21531
21745
  if (d.type === "work-item" || d.id && typeof d.id === "string" && /^WI-\d+/.test(d.id)) {
@@ -21547,7 +21761,7 @@ function parseContent(raw) {
21547
21761
  let bodyText = trimmed;
21548
21762
  if (format === "kaddo-frontmatter" || format === "markdown-frontmatter") {
21549
21763
  try {
21550
- const parsed = matter16(trimmed);
21764
+ const parsed = matter17(trimmed);
21551
21765
  frontmatterFields = parsed.data ?? {};
21552
21766
  bodyText = parsed.content.trim();
21553
21767
  } catch {
@@ -21644,7 +21858,7 @@ function findDuplicateByHash(dir, hash) {
21644
21858
  const raw = readFile(item.filePath);
21645
21859
  if (!raw) continue;
21646
21860
  try {
21647
- const { data } = matter16(raw);
21861
+ const { data } = matter17(raw);
21648
21862
  const source = data?.source;
21649
21863
  if (source && typeof source === "object" && !Array.isArray(source)) {
21650
21864
  const s = source;
@@ -21860,7 +22074,7 @@ async function runWorkItemImport(dir, fileOrText, opts) {
21860
22074
  }
21861
22075
 
21862
22076
  // src/commands/verify.ts
21863
- import matter17 from "gray-matter";
22077
+ import matter18 from "gray-matter";
21864
22078
 
21865
22079
  // src/core/implementation-evidence.ts
21866
22080
  var WorkItemNotInProgressError = class extends Error {
@@ -22137,7 +22351,7 @@ async function runVerify(workItemId, opts = {}) {
22137
22351
  }
22138
22352
  const changedPaths = await getModifiedFiles("head");
22139
22353
  const raw = readFile(match.filePath);
22140
- const parsed = matter17(raw);
22354
+ const parsed = matter18(raw);
22141
22355
  const fm2 = parsed.data;
22142
22356
  const acs = extractACsFromBody(parsed.content);
22143
22357
  const existingEvidence = fm2.implementation_evidence;
@@ -22254,13 +22468,13 @@ async function runVerify(workItemId, opts = {}) {
22254
22468
  if (shouldPersist) {
22255
22469
  const filePath = match.filePath;
22256
22470
  const wiRaw = readFile(filePath);
22257
- const wiParsed = matter17(wiRaw);
22471
+ const wiParsed = matter18(wiRaw);
22258
22472
  const data = wiParsed.data;
22259
22473
  data.implementation_evidence = verification.implementationEvidence;
22260
22474
  data.implementation_status = verification.implementationStatus;
22261
22475
  data.validation_status = verification.validationStatus;
22262
22476
  data.verified_at = (/* @__PURE__ */ new Date()).toISOString().split("T")[0];
22263
- const newRaw = matter17.stringify(wiParsed.content, data);
22477
+ const newRaw = matter18.stringify(wiParsed.content, data);
22264
22478
  writeFile(filePath, newRaw);
22265
22479
  log.success("Work Item frontmatter updated with verification evidence.");
22266
22480
  }
@@ -22538,7 +22752,7 @@ function runTelemetryDisable() {
22538
22752
  }
22539
22753
 
22540
22754
  // src/core/initiative-write.ts
22541
- import matter18 from "gray-matter";
22755
+ import matter19 from "gray-matter";
22542
22756
  var WORK_ITEMS_DIR4 = "knowledge/delivery/work-items";
22543
22757
  var DRAFT_DIR2 = `${WORK_ITEMS_DIR4}/draft`;
22544
22758
  var InitiativeWriteError = class extends Error {
@@ -22650,7 +22864,7 @@ function buildInitiativeContent(id, input) {
22650
22864
  if (input.priority) data.priority = input.priority;
22651
22865
  if (input.source) data.source = input.source;
22652
22866
  if (input.sourceId) data.source_id = input.sourceId;
22653
- return matter18.stringify("\n" + (input.body ?? defaultBody(input.title.trim())), data);
22867
+ return matter19.stringify("\n" + (input.body ?? defaultBody(input.title.trim())), data);
22654
22868
  }
22655
22869
  function createInitiative(dir, input) {
22656
22870
  if (!input.title?.trim()) throw new InitiativeWriteError("Initiative title is required.");
@@ -22674,10 +22888,10 @@ function transitionInitiative(dir, id, to) {
22674
22888
  throw new InitiativeWriteError(`Invalid transition ${ini.status} \u2192 ${to}.`);
22675
22889
  }
22676
22890
  const raw = readFile(ini.filePath);
22677
- const { data, content } = matter18(raw, {});
22891
+ const { data, content } = matter19(raw, {});
22678
22892
  data.status = to;
22679
22893
  if (to === "completed") data.completed_at = today2();
22680
- const newContent = matter18.stringify(content, data);
22894
+ const newContent = matter19.stringify(content, data);
22681
22895
  writeFile(ini.filePath, newContent);
22682
22896
  const updated = parseInitiative(dir, ini.filePath, newContent);
22683
22897
  if (!updated) throw new InitiativeWriteError("Failed to parse the Initiative after transition.");
@@ -22746,7 +22960,7 @@ function buildWorkItemContent(wiId, iniId, candidate) {
22746
22960
  "_What did we learn? Update after completion._",
22747
22961
  ""
22748
22962
  ].join("\n");
22749
- return matter18.stringify("\n" + body, data);
22963
+ return matter19.stringify("\n" + body, data);
22750
22964
  }
22751
22965
  function materializeCandidate(dir, id, candidateId) {
22752
22966
  const ini = getInitiative(dir, id);
@@ -22763,13 +22977,13 @@ function materializeCandidate(dir, id, candidateId) {
22763
22977
  ensureDir(join(dir, DRAFT_DIR2));
22764
22978
  writeFile(join(dir, DRAFT_DIR2, fileName), buildWorkItemContent(wiId, ini.id, candidate));
22765
22979
  const raw = readFile(ini.filePath);
22766
- const { data, content } = matter18(raw, {});
22980
+ const { data, content } = matter19(raw, {});
22767
22981
  const cands = Array.isArray(data.candidates) ? data.candidates : [];
22768
22982
  for (const c of cands) {
22769
22983
  if (c && typeof c === "object" && String(c.id) === candidateId) c.materialized_as = wiId;
22770
22984
  }
22771
22985
  data.candidates = cands;
22772
- const newContent = matter18.stringify(content, data);
22986
+ const newContent = matter19.stringify(content, data);
22773
22987
  writeFile(ini.filePath, newContent);
22774
22988
  const updated = parseInitiative(dir, ini.filePath, newContent);
22775
22989
  if (!updated) throw new InitiativeWriteError("Failed to parse the Initiative after materialization.");
@@ -23137,6 +23351,9 @@ topologyCmd.command("validate <file>").description("Validate a topology proposal
23137
23351
  topologyCmd.command("apply <file>").description("Apply a validated topology proposal to the canonical artifact after human confirmation").option("-y, --yes", "Skip the confirmation prompt (for already-approved automation)").action((file, opts) => {
23138
23352
  runTopologyApply(file, opts);
23139
23353
  });
23354
+ var resourcesCmd = program.command("resources").description("List and inspect Project Resources \u2014 external systems the project uses (read-only, no secrets)");
23355
+ resourcesCmd.command("list").description("List Project Resources defined under knowledge/tech/resources/").option("--json", "Output JSON").action((opts) => runResourcesList(cwd(), opts));
23356
+ resourcesCmd.command("get <id>").description("Show one Project Resource: purpose, interfaces, boundaries and auth references").option("--json", "Output JSON").action((id, opts) => runResourcesGet(id, cwd(), opts));
23140
23357
  var integrationsCmd = program.command("integrations").description("Connect Kaddo to external work systems (read-first; import requires human confirmation)");
23141
23358
  integrationsCmd.command("list").description("List configured integrations and their capabilities").option("--json", "Output JSON").action((opts) => runIntegrationsList(cwd(), opts));
23142
23359
  integrationsCmd.command("status").description("Verify each enabled integration and report its connection status").option("--json", "Output JSON").action(async (opts) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kaddo/cli",
3
- "version": "3.114.0",
3
+ "version": "3.115.0",
4
4
  "description": "Knowledge Driven Development toolkit",
5
5
  "license": "MIT",
6
6
  "repository": {