pi-harness-runtime 0.10.25 → 0.10.27

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 (94) hide show
  1. package/CHANGELOG.md +43 -0
  2. package/package.json +1 -1
  3. package/packages/architecture-generator/dist/adr.d.ts +15 -0
  4. package/packages/architecture-generator/dist/adr.d.ts.map +1 -0
  5. package/packages/architecture-generator/dist/adr.js +42 -0
  6. package/packages/architecture-generator/dist/adr.js.map +1 -0
  7. package/packages/architecture-generator/dist/index.d.ts +9 -0
  8. package/packages/architecture-generator/dist/index.d.ts.map +1 -0
  9. package/packages/architecture-generator/dist/index.js +9 -0
  10. package/packages/architecture-generator/dist/index.js.map +1 -0
  11. package/packages/architecture-generator/dist/mermaid.d.ts +30 -0
  12. package/packages/architecture-generator/dist/mermaid.d.ts.map +1 -0
  13. package/packages/architecture-generator/dist/mermaid.js +58 -0
  14. package/packages/architecture-generator/dist/mermaid.js.map +1 -0
  15. package/packages/architecture-generator/dist/types.d.ts +30 -0
  16. package/packages/architecture-generator/dist/types.d.ts.map +1 -0
  17. package/packages/architecture-generator/dist/types.js +7 -0
  18. package/packages/architecture-generator/dist/types.js.map +1 -0
  19. package/packages/architecture-generator/src/adr.ts +51 -0
  20. package/packages/architecture-generator/src/index.ts +9 -0
  21. package/packages/architecture-generator/src/mermaid.ts +82 -0
  22. package/packages/architecture-generator/src/types.ts +30 -0
  23. package/packages/file-copy-helper/src/extension.js +51 -0
  24. package/packages/file-copy-helper/src/extension.ts +61 -0
  25. package/packages/knowledge-graph/dist/graph-extractor.d.ts +27 -0
  26. package/packages/knowledge-graph/dist/graph-extractor.d.ts.map +1 -0
  27. package/packages/knowledge-graph/dist/graph-extractor.js +285 -0
  28. package/packages/knowledge-graph/dist/graph-extractor.js.map +1 -0
  29. package/packages/knowledge-graph/dist/index.d.ts +27 -0
  30. package/packages/knowledge-graph/dist/index.d.ts.map +1 -0
  31. package/packages/knowledge-graph/dist/index.js +27 -0
  32. package/packages/knowledge-graph/dist/index.js.map +1 -0
  33. package/packages/knowledge-graph/dist/mcp-client.d.ts +38 -0
  34. package/packages/knowledge-graph/dist/mcp-client.d.ts.map +1 -0
  35. package/packages/knowledge-graph/dist/mcp-client.js +157 -0
  36. package/packages/knowledge-graph/dist/mcp-client.js.map +1 -0
  37. package/packages/knowledge-graph/dist/provenance-linker.d.ts +19 -0
  38. package/packages/knowledge-graph/dist/provenance-linker.d.ts.map +1 -0
  39. package/packages/knowledge-graph/dist/provenance-linker.js +92 -0
  40. package/packages/knowledge-graph/dist/provenance-linker.js.map +1 -0
  41. package/packages/knowledge-graph/dist/types.d.ts +53 -0
  42. package/packages/knowledge-graph/dist/types.d.ts.map +1 -0
  43. package/packages/knowledge-graph/dist/types.js +7 -0
  44. package/packages/knowledge-graph/dist/types.js.map +1 -0
  45. package/packages/knowledge-graph/src/graph-extractor.ts +355 -0
  46. package/packages/knowledge-graph/src/index.ts +27 -0
  47. package/packages/knowledge-graph/src/mcp-client.ts +246 -0
  48. package/packages/knowledge-graph/src/provenance-linker.ts +105 -0
  49. package/packages/knowledge-graph/src/types.ts +86 -0
  50. package/packages/milestone-manager/dist/engine.d.ts +27 -0
  51. package/packages/milestone-manager/dist/engine.d.ts.map +1 -0
  52. package/packages/milestone-manager/dist/engine.js +80 -0
  53. package/packages/milestone-manager/dist/engine.js.map +1 -0
  54. package/packages/milestone-manager/dist/index.d.ts +6 -0
  55. package/packages/milestone-manager/dist/index.d.ts.map +1 -0
  56. package/packages/milestone-manager/dist/index.js +6 -0
  57. package/packages/milestone-manager/dist/index.js.map +1 -0
  58. package/packages/milestone-manager/dist/types.d.ts +25 -0
  59. package/packages/milestone-manager/dist/types.d.ts.map +1 -0
  60. package/packages/milestone-manager/dist/types.js +7 -0
  61. package/packages/milestone-manager/dist/types.js.map +1 -0
  62. package/packages/milestone-manager/src/engine.ts +113 -0
  63. package/packages/milestone-manager/src/index.ts +6 -0
  64. package/packages/milestone-manager/src/types.ts +28 -0
  65. package/packages/project-bootstrap/dist/bootstrap.d.ts +23 -0
  66. package/packages/project-bootstrap/dist/bootstrap.d.ts.map +1 -0
  67. package/packages/project-bootstrap/dist/bootstrap.js +136 -0
  68. package/packages/project-bootstrap/dist/bootstrap.js.map +1 -0
  69. package/packages/project-bootstrap/dist/frappe.d.ts +8 -0
  70. package/packages/project-bootstrap/dist/frappe.d.ts.map +1 -0
  71. package/packages/project-bootstrap/dist/frappe.js +82 -0
  72. package/packages/project-bootstrap/dist/frappe.js.map +1 -0
  73. package/packages/project-bootstrap/dist/index.d.ts +27 -0
  74. package/packages/project-bootstrap/dist/index.d.ts.map +1 -0
  75. package/packages/project-bootstrap/dist/index.js +27 -0
  76. package/packages/project-bootstrap/dist/index.js.map +1 -0
  77. package/packages/project-bootstrap/dist/minimal.d.ts +8 -0
  78. package/packages/project-bootstrap/dist/minimal.d.ts.map +1 -0
  79. package/packages/project-bootstrap/dist/minimal.js +35 -0
  80. package/packages/project-bootstrap/dist/minimal.js.map +1 -0
  81. package/packages/project-bootstrap/dist/types.d.ts +61 -0
  82. package/packages/project-bootstrap/dist/types.d.ts.map +1 -0
  83. package/packages/project-bootstrap/dist/types.js +7 -0
  84. package/packages/project-bootstrap/dist/types.js.map +1 -0
  85. package/packages/project-bootstrap/dist/typescript.d.ts +8 -0
  86. package/packages/project-bootstrap/dist/typescript.d.ts.map +1 -0
  87. package/packages/project-bootstrap/dist/typescript.js +103 -0
  88. package/packages/project-bootstrap/dist/typescript.js.map +1 -0
  89. package/packages/project-bootstrap/src/bootstrap.ts +181 -0
  90. package/packages/project-bootstrap/src/frappe.ts +103 -0
  91. package/packages/project-bootstrap/src/index.ts +27 -0
  92. package/packages/project-bootstrap/src/minimal.ts +45 -0
  93. package/packages/project-bootstrap/src/types.ts +66 -0
  94. package/packages/project-bootstrap/src/typescript.ts +123 -0
package/CHANGELOG.md CHANGED
@@ -2,6 +2,49 @@
2
2
 
3
3
  All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
4
4
 
5
+ ### [0.10.27](https://github.com/ManotLuijiu/pi-harness-runtime/compare/v0.10.14...v0.10.27) (2026-08-10)
6
+
7
+
8
+ ### Features
9
+
10
+ * create packages for missing RFC implementations ([e6ce2ff](https://github.com/ManotLuijiu/pi-harness-runtime/commit/e6ce2ffdd455b33c55212ec2b61eedcdcfb43b5e))
11
+ * **file-copy-helper:** inject cp rule when user asks to mimic/copy files ([f089f0d](https://github.com/ManotLuijiu/pi-harness-runtime/commit/f089f0d5e3e933231c99ee38cf18fa208c8eb8b2))
12
+
13
+
14
+ ### Bug Fixes
15
+
16
+ * align TS formatting with main (remove 3-line logError) ([2515ad5](https://github.com/ManotLuijiu/pi-harness-runtime/commit/2515ad54f43f0566123c686d3ec4f92ad363ea13))
17
+ * correct import paths for notification-center dist files ([f248722](https://github.com/ManotLuijiu/pi-harness-runtime/commit/f24872240c07bf115f69530a3bdabedf73e3c858))
18
+ * **file-copy-helper:** inject rule for import errors - copy missing files, don't fix one-by-one ([03a5b0a](https://github.com/ManotLuijiu/pi-harness-runtime/commit/03a5b0a1bd899866f76fbd6482b52097c7d27a5b))
19
+ * **file-copy-helper:** strengthen rule - agent must NOT read source files before copying ([5bbf7f7](https://github.com/ManotLuijiu/pi-harness-runtime/commit/5bbf7f70f19213f4e08059aa3766301d5966daa8))
20
+ * handle array/object content in pi-usage-status build detection ([68b07a8](https://github.com/ManotLuijiu/pi-harness-runtime/commit/68b07a8e8167a95ab1b519782a07ec3a582eec5a))
21
+ * skip publish-time scripts in release workflow ([b385148](https://github.com/ManotLuijiu/pi-harness-runtime/commit/b38514835dc3f6fd717ca8c71dbb6d131de4887f))
22
+ * suppress noisy stack traces in harness agents ([34bbe98](https://github.com/ManotLuijiu/pi-harness-runtime/commit/34bbe98f59e740fcfcd8622f1dcc09c379f6f3df))
23
+ * **todo-bd-sync:** disable auto-injection completely - was causing noisy output ([699d6de](https://github.com/ManotLuijiu/pi-harness-runtime/commit/699d6de5e7f3b062799a0f791b386d1ecd452b00))
24
+ * **todo-bd-sync:** silence all console output - no startup warnings ([2d29bcf](https://github.com/ManotLuijiu/pi-harness-runtime/commit/2d29bcf51b25fe1b1253aa965e370852f3cae289))
25
+ * update bd install URL to correct repo ([5800f30](https://github.com/ManotLuijiu/pi-harness-runtime/commit/5800f304913912a84c34d3f42a29b01bb2d87b24))
26
+
27
+ ### [0.10.26](https://github.com/ManotLuijiu/pi-harness-runtime/compare/v0.10.14...v0.10.26) (2026-08-10)
28
+
29
+
30
+ ### Features
31
+
32
+ * **file-copy-helper:** inject cp rule when user asks to mimic/copy files ([f089f0d](https://github.com/ManotLuijiu/pi-harness-runtime/commit/f089f0d5e3e933231c99ee38cf18fa208c8eb8b2))
33
+
34
+
35
+ ### Bug Fixes
36
+
37
+ * align TS formatting with main (remove 3-line logError) ([2515ad5](https://github.com/ManotLuijiu/pi-harness-runtime/commit/2515ad54f43f0566123c686d3ec4f92ad363ea13))
38
+ * correct import paths for notification-center dist files ([f248722](https://github.com/ManotLuijiu/pi-harness-runtime/commit/f24872240c07bf115f69530a3bdabedf73e3c858))
39
+ * **file-copy-helper:** inject rule for import errors - copy missing files, don't fix one-by-one ([03a5b0a](https://github.com/ManotLuijiu/pi-harness-runtime/commit/03a5b0a1bd899866f76fbd6482b52097c7d27a5b))
40
+ * **file-copy-helper:** strengthen rule - agent must NOT read source files before copying ([5bbf7f7](https://github.com/ManotLuijiu/pi-harness-runtime/commit/5bbf7f70f19213f4e08059aa3766301d5966daa8))
41
+ * handle array/object content in pi-usage-status build detection ([68b07a8](https://github.com/ManotLuijiu/pi-harness-runtime/commit/68b07a8e8167a95ab1b519782a07ec3a582eec5a))
42
+ * skip publish-time scripts in release workflow ([b385148](https://github.com/ManotLuijiu/pi-harness-runtime/commit/b38514835dc3f6fd717ca8c71dbb6d131de4887f))
43
+ * suppress noisy stack traces in harness agents ([34bbe98](https://github.com/ManotLuijiu/pi-harness-runtime/commit/34bbe98f59e740fcfcd8622f1dcc09c379f6f3df))
44
+ * **todo-bd-sync:** disable auto-injection completely - was causing noisy output ([699d6de](https://github.com/ManotLuijiu/pi-harness-runtime/commit/699d6de5e7f3b062799a0f791b386d1ecd452b00))
45
+ * **todo-bd-sync:** silence all console output - no startup warnings ([2d29bcf](https://github.com/ManotLuijiu/pi-harness-runtime/commit/2d29bcf51b25fe1b1253aa965e370852f3cae289))
46
+ * update bd install URL to correct repo ([5800f30](https://github.com/ManotLuijiu/pi-harness-runtime/commit/5800f304913912a84c34d3f42a29b01bb2d87b24))
47
+
5
48
  ### [0.10.25](https://github.com/ManotLuijiu/pi-harness-runtime/compare/v0.10.14...v0.10.25) (2026-08-10)
6
49
 
7
50
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pi-harness-runtime",
3
- "version": "0.10.25",
3
+ "version": "0.10.27",
4
4
  "description": "[BETA] Codex-style /usage status + autonomous coding harness for pi. Not production ready — expect breaking changes.",
5
5
  "type": "module",
6
6
  "scripts": {
@@ -0,0 +1,15 @@
1
+ /**
2
+ * Architecture Generator - RFC-0073
3
+ *
4
+ * Generate Architecture Decision Records.
5
+ */
6
+ import type { ADR } from "./types.js";
7
+ /**
8
+ * Generate an ADR file
9
+ */
10
+ export declare function generateADR(adr: ADR): string;
11
+ /**
12
+ * Create a new ADR
13
+ */
14
+ export declare function createADR(id: string, title: string, context: string, decision: string, consequences: string): ADR;
15
+ //# sourceMappingURL=adr.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"adr.d.ts","sourceRoot":"","sources":["../src/adr.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,YAAY,CAAC;AAEtC;;GAEG;AACH,wBAAgB,WAAW,CAAC,GAAG,EAAE,GAAG,GAAG,MAAM,CAkB5C;AAED;;GAEG;AACH,wBAAgB,SAAS,CACxB,EAAE,EAAE,MAAM,EACV,KAAK,EAAE,MAAM,EACb,OAAO,EAAE,MAAM,EACf,QAAQ,EAAE,MAAM,EAChB,YAAY,EAAE,MAAM,GAClB,GAAG,CAUL"}
@@ -0,0 +1,42 @@
1
+ /**
2
+ * Architecture Generator - RFC-0073
3
+ *
4
+ * Generate Architecture Decision Records.
5
+ */
6
+ /**
7
+ * Generate an ADR file
8
+ */
9
+ export function generateADR(adr) {
10
+ return `# ${adr.id}: ${adr.title}
11
+
12
+ ## Status
13
+ ${adr.status}
14
+
15
+ ## Context
16
+ ${adr.context}
17
+
18
+ ## Decision
19
+ ${adr.decision}
20
+
21
+ ## Consequences
22
+ ${adr.consequences}
23
+
24
+ ---
25
+ *Created: ${adr.createdAt}*
26
+ `;
27
+ }
28
+ /**
29
+ * Create a new ADR
30
+ */
31
+ export function createADR(id, title, context, decision, consequences) {
32
+ return {
33
+ id,
34
+ title,
35
+ status: "proposed",
36
+ context,
37
+ decision,
38
+ consequences,
39
+ createdAt: new Date().toISOString().split("T")[0],
40
+ };
41
+ }
42
+ //# sourceMappingURL=adr.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"adr.js","sourceRoot":"","sources":["../src/adr.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAIH;;GAEG;AACH,MAAM,UAAU,WAAW,CAAC,GAAQ;IACnC,OAAO,KAAK,GAAG,CAAC,EAAE,KAAK,GAAG,CAAC,KAAK;;;EAG/B,GAAG,CAAC,MAAM;;;EAGV,GAAG,CAAC,OAAO;;;EAGX,GAAG,CAAC,QAAQ;;;EAGZ,GAAG,CAAC,YAAY;;;YAGN,GAAG,CAAC,SAAS;CACxB,CAAC;AACF,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,SAAS,CACxB,EAAU,EACV,KAAa,EACb,OAAe,EACf,QAAgB,EAChB,YAAoB;IAEpB,OAAO;QACN,EAAE;QACF,KAAK;QACL,MAAM,EAAE,UAAU;QAClB,OAAO;QACP,QAAQ;QACR,YAAY;QACZ,SAAS,EAAE,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;KACjD,CAAC;AACH,CAAC"}
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Architecture Generator - RFC-0073
3
+ *
4
+ * Generate ADR and Mermaid diagrams from project analysis.
5
+ */
6
+ export * from "./types.js";
7
+ export * from "./mermaid.js";
8
+ export * from "./adr.js";
9
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,cAAc,YAAY,CAAC;AAC3B,cAAc,cAAc,CAAC;AAC7B,cAAc,UAAU,CAAC"}
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Architecture Generator - RFC-0073
3
+ *
4
+ * Generate ADR and Mermaid diagrams from project analysis.
5
+ */
6
+ export * from "./types.js";
7
+ export * from "./mermaid.js";
8
+ export * from "./adr.js";
9
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,cAAc,YAAY,CAAC;AAC3B,cAAc,cAAc,CAAC;AAC7B,cAAc,UAAU,CAAC"}
@@ -0,0 +1,30 @@
1
+ /**
2
+ * Architecture Generator - RFC-0073
3
+ *
4
+ * Generate Mermaid diagrams.
5
+ */
6
+ import type { ArchitectureDiagram, ArchitectureAnalysis } from "./types.js";
7
+ /**
8
+ * Generate component diagram
9
+ */
10
+ export declare function generateComponentDiagram(analysis: ArchitectureAnalysis): ArchitectureDiagram;
11
+ /**
12
+ * Generate sequence diagram
13
+ */
14
+ export declare function generateSequenceDiagram(title: string, steps: {
15
+ actor: string;
16
+ action: string;
17
+ target: string;
18
+ }[]): ArchitectureDiagram;
19
+ /**
20
+ * Generate flow diagram
21
+ */
22
+ export declare function generateFlowDiagram(title: string, nodes: {
23
+ id: string;
24
+ label: string;
25
+ }[], edges: {
26
+ from: string;
27
+ to: string;
28
+ label?: string;
29
+ }[]): ArchitectureDiagram;
30
+ //# sourceMappingURL=mermaid.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mermaid.d.ts","sourceRoot":"","sources":["../src/mermaid.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EACX,mBAAmB,EAEnB,oBAAoB,EACpB,MAAM,YAAY,CAAC;AAEpB;;GAEG;AACH,wBAAgB,wBAAwB,CACvC,QAAQ,EAAE,oBAAoB,GAC5B,mBAAmB,CAoBrB;AAED;;GAEG;AACH,wBAAgB,uBAAuB,CACtC,KAAK,EAAE,MAAM,EACb,KAAK,EAAE;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,EAAE,GACxD,mBAAmB,CAYrB;AAED;;GAEG;AACH,wBAAgB,mBAAmB,CAClC,KAAK,EAAE,MAAM,EACb,KAAK,EAAE;IAAE,EAAE,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,EAAE,EACtC,KAAK,EAAE;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,EAAE,EAAE,MAAM,CAAC;IAAC,KAAK,CAAC,EAAE,MAAM,CAAA;CAAE,EAAE,GACnD,mBAAmB,CAerB"}
@@ -0,0 +1,58 @@
1
+ /**
2
+ * Architecture Generator - RFC-0073
3
+ *
4
+ * Generate Mermaid diagrams.
5
+ */
6
+ /**
7
+ * Generate component diagram
8
+ */
9
+ export function generateComponentDiagram(analysis) {
10
+ const mermaid = [
11
+ "graph TB",
12
+ " subgraph Layers",
13
+ ...analysis.layers.map((layer, i) => {
14
+ const nodes = analysis.components.filter((_, j) => j % analysis.layers.length === i);
15
+ return ` ${nodes.join(" --> ")}`;
16
+ }),
17
+ " end",
18
+ ...analysis.dependencies.map((d) => ` ${d.from} --> ${d.to}`),
19
+ ].join("\n");
20
+ return {
21
+ type: "component",
22
+ title: "Architecture Components",
23
+ mermaid,
24
+ description: "Component diagram showing layers and dependencies",
25
+ };
26
+ }
27
+ /**
28
+ * Generate sequence diagram
29
+ */
30
+ export function generateSequenceDiagram(title, steps) {
31
+ const mermaid = [
32
+ "sequenceDiagram",
33
+ ...steps.map((s) => ` ${s.actor}->>+${s.target}: ${s.action}`),
34
+ ].join("\n");
35
+ return {
36
+ type: "sequence",
37
+ title,
38
+ mermaid,
39
+ description: "Sequence diagram showing interaction flow",
40
+ };
41
+ }
42
+ /**
43
+ * Generate flow diagram
44
+ */
45
+ export function generateFlowDiagram(title, nodes, edges) {
46
+ const mermaid = [
47
+ "flowchart LR",
48
+ ...nodes.map((n) => ` ${n.id}[${n.label}]`),
49
+ ...edges.map((e) => ` ${e.from}${e.label ? `-->|"${e.label}"|` : "->>"}${e.to}`),
50
+ ].join("\n");
51
+ return {
52
+ type: "flow",
53
+ title,
54
+ mermaid,
55
+ description: "Flow diagram showing process flow",
56
+ };
57
+ }
58
+ //# sourceMappingURL=mermaid.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mermaid.js","sourceRoot":"","sources":["../src/mermaid.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAQH;;GAEG;AACH,MAAM,UAAU,wBAAwB,CACvC,QAA8B;IAE9B,MAAM,OAAO,GAAG;QACf,UAAU;QACV,qBAAqB;QACrB,GAAG,QAAQ,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,CAAC,EAAE,EAAE;YACnC,MAAM,KAAK,GAAG,QAAQ,CAAC,UAAU,CAAC,MAAM,CACvC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,GAAG,QAAQ,CAAC,MAAM,CAAC,MAAM,KAAK,CAAC,CAC1C,CAAC;YACF,OAAO,WAAW,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,EAAE,CAAC;QACzC,CAAC,CAAC;QACF,SAAS;QACT,GAAG,QAAQ,CAAC,YAAY,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,OAAO,CAAC,CAAC,IAAI,QAAQ,CAAC,CAAC,EAAE,EAAE,CAAC;KAChE,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAEb,OAAO;QACN,IAAI,EAAE,WAAW;QACjB,KAAK,EAAE,yBAAyB;QAChC,OAAO;QACP,WAAW,EAAE,mDAAmD;KAChE,CAAC;AACH,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,uBAAuB,CACtC,KAAa,EACb,KAA0D;IAE1D,MAAM,OAAO,GAAG;QACf,iBAAiB;QACjB,GAAG,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,OAAO,CAAC,CAAC,KAAK,OAAO,CAAC,CAAC,MAAM,KAAK,CAAC,CAAC,MAAM,EAAE,CAAC;KACjE,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAEb,OAAO;QACN,IAAI,EAAE,UAAU;QAChB,KAAK;QACL,OAAO;QACP,WAAW,EAAE,2CAA2C;KACxD,CAAC;AACH,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,mBAAmB,CAClC,KAAa,EACb,KAAsC,EACtC,KAAqD;IAErD,MAAM,OAAO,GAAG;QACf,cAAc;QACd,GAAG,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,OAAO,CAAC,CAAC,EAAE,IAAI,CAAC,CAAC,KAAK,GAAG,CAAC;QAC9C,GAAG,KAAK,CAAC,GAAG,CACX,CAAC,CAAC,EAAE,EAAE,CAAC,OAAO,CAAC,CAAC,IAAI,GAAG,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,KAAK,IAAI,CAAC,CAAC,CAAC,KAAK,GAAG,CAAC,CAAC,EAAE,EAAE,CACrE;KACD,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAEb,OAAO;QACN,IAAI,EAAE,MAAM;QACZ,KAAK;QACL,OAAO;QACP,WAAW,EAAE,mCAAmC;KAChD,CAAC;AACH,CAAC"}
@@ -0,0 +1,30 @@
1
+ /**
2
+ * Architecture Generator - RFC-0073
3
+ *
4
+ * Generate ADR and Mermaid diagrams from project analysis.
5
+ */
6
+ export type DiagramType = "component" | "flow" | "sequence" | "er" | "class";
7
+ export interface ArchitectureDiagram {
8
+ type: DiagramType;
9
+ title: string;
10
+ mermaid: string;
11
+ description?: string;
12
+ }
13
+ export interface ADR {
14
+ id: string;
15
+ title: string;
16
+ status: "proposed" | "accepted" | "deprecated";
17
+ context: string;
18
+ decision: string;
19
+ consequences: string;
20
+ createdAt: string;
21
+ }
22
+ export interface ArchitectureAnalysis {
23
+ components: string[];
24
+ dependencies: {
25
+ from: string;
26
+ to: string;
27
+ }[];
28
+ layers: string[];
29
+ }
30
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,MAAM,MAAM,WAAW,GAAG,WAAW,GAAG,MAAM,GAAG,UAAU,GAAG,IAAI,GAAG,OAAO,CAAC;AAE7E,MAAM,WAAW,mBAAmB;IACnC,IAAI,EAAE,WAAW,CAAC;IAClB,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,MAAM,CAAC;IAChB,WAAW,CAAC,EAAE,MAAM,CAAC;CACrB;AAED,MAAM,WAAW,GAAG;IACnB,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,UAAU,GAAG,UAAU,GAAG,YAAY,CAAC;IAC/C,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,MAAM,CAAC;IACjB,YAAY,EAAE,MAAM,CAAC;IACrB,SAAS,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,WAAW,oBAAoB;IACpC,UAAU,EAAE,MAAM,EAAE,CAAC;IACrB,YAAY,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,EAAE,EAAE,MAAM,CAAA;KAAE,EAAE,CAAC;IAC7C,MAAM,EAAE,MAAM,EAAE,CAAC;CACjB"}
@@ -0,0 +1,7 @@
1
+ /**
2
+ * Architecture Generator - RFC-0073
3
+ *
4
+ * Generate ADR and Mermaid diagrams from project analysis.
5
+ */
6
+ export {};
7
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA;;;;GAIG"}
@@ -0,0 +1,51 @@
1
+ /**
2
+ * Architecture Generator - RFC-0073
3
+ *
4
+ * Generate Architecture Decision Records.
5
+ */
6
+
7
+ import type { ADR } from "./types.js";
8
+
9
+ /**
10
+ * Generate an ADR file
11
+ */
12
+ export function generateADR(adr: ADR): string {
13
+ return `# ${adr.id}: ${adr.title}
14
+
15
+ ## Status
16
+ ${adr.status}
17
+
18
+ ## Context
19
+ ${adr.context}
20
+
21
+ ## Decision
22
+ ${adr.decision}
23
+
24
+ ## Consequences
25
+ ${adr.consequences}
26
+
27
+ ---
28
+ *Created: ${adr.createdAt}*
29
+ `;
30
+ }
31
+
32
+ /**
33
+ * Create a new ADR
34
+ */
35
+ export function createADR(
36
+ id: string,
37
+ title: string,
38
+ context: string,
39
+ decision: string,
40
+ consequences: string,
41
+ ): ADR {
42
+ return {
43
+ id,
44
+ title,
45
+ status: "proposed",
46
+ context,
47
+ decision,
48
+ consequences,
49
+ createdAt: new Date().toISOString().split("T")[0],
50
+ };
51
+ }
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Architecture Generator - RFC-0073
3
+ *
4
+ * Generate ADR and Mermaid diagrams from project analysis.
5
+ */
6
+
7
+ export * from "./types.js";
8
+ export * from "./mermaid.js";
9
+ export * from "./adr.js";
@@ -0,0 +1,82 @@
1
+ /**
2
+ * Architecture Generator - RFC-0073
3
+ *
4
+ * Generate Mermaid diagrams.
5
+ */
6
+
7
+ import type {
8
+ ArchitectureDiagram,
9
+ DiagramType,
10
+ ArchitectureAnalysis,
11
+ } from "./types.js";
12
+
13
+ /**
14
+ * Generate component diagram
15
+ */
16
+ export function generateComponentDiagram(
17
+ analysis: ArchitectureAnalysis,
18
+ ): ArchitectureDiagram {
19
+ const mermaid = [
20
+ "graph TB",
21
+ " subgraph Layers",
22
+ ...analysis.layers.map((layer, i) => {
23
+ const nodes = analysis.components.filter(
24
+ (_, j) => j % analysis.layers.length === i,
25
+ );
26
+ return ` ${nodes.join(" --> ")}`;
27
+ }),
28
+ " end",
29
+ ...analysis.dependencies.map((d) => ` ${d.from} --> ${d.to}`),
30
+ ].join("\n");
31
+
32
+ return {
33
+ type: "component",
34
+ title: "Architecture Components",
35
+ mermaid,
36
+ description: "Component diagram showing layers and dependencies",
37
+ };
38
+ }
39
+
40
+ /**
41
+ * Generate sequence diagram
42
+ */
43
+ export function generateSequenceDiagram(
44
+ title: string,
45
+ steps: { actor: string; action: string; target: string }[],
46
+ ): ArchitectureDiagram {
47
+ const mermaid = [
48
+ "sequenceDiagram",
49
+ ...steps.map((s) => ` ${s.actor}->>+${s.target}: ${s.action}`),
50
+ ].join("\n");
51
+
52
+ return {
53
+ type: "sequence",
54
+ title,
55
+ mermaid,
56
+ description: "Sequence diagram showing interaction flow",
57
+ };
58
+ }
59
+
60
+ /**
61
+ * Generate flow diagram
62
+ */
63
+ export function generateFlowDiagram(
64
+ title: string,
65
+ nodes: { id: string; label: string }[],
66
+ edges: { from: string; to: string; label?: string }[],
67
+ ): ArchitectureDiagram {
68
+ const mermaid = [
69
+ "flowchart LR",
70
+ ...nodes.map((n) => ` ${n.id}[${n.label}]`),
71
+ ...edges.map(
72
+ (e) => ` ${e.from}${e.label ? `-->|"${e.label}"|` : "->>"}${e.to}`,
73
+ ),
74
+ ].join("\n");
75
+
76
+ return {
77
+ type: "flow",
78
+ title,
79
+ mermaid,
80
+ description: "Flow diagram showing process flow",
81
+ };
82
+ }
@@ -0,0 +1,30 @@
1
+ /**
2
+ * Architecture Generator - RFC-0073
3
+ *
4
+ * Generate ADR and Mermaid diagrams from project analysis.
5
+ */
6
+
7
+ export type DiagramType = "component" | "flow" | "sequence" | "er" | "class";
8
+
9
+ export interface ArchitectureDiagram {
10
+ type: DiagramType;
11
+ title: string;
12
+ mermaid: string;
13
+ description?: string;
14
+ }
15
+
16
+ export interface ADR {
17
+ id: string;
18
+ title: string;
19
+ status: "proposed" | "accepted" | "deprecated";
20
+ context: string;
21
+ decision: string;
22
+ consequences: string;
23
+ createdAt: string;
24
+ }
25
+
26
+ export interface ArchitectureAnalysis {
27
+ components: string[];
28
+ dependencies: { from: string; to: string }[];
29
+ layers: string[];
30
+ }
@@ -21,6 +21,21 @@ var READ_SOURCE_TRIGGERS = [
21
21
  "reading file",
22
22
  "lets read"
23
23
  ];
24
+ var IMPORT_ERROR_TRIGGERS = [
25
+ "import error",
26
+ "import errors",
27
+ "cannot find module",
28
+ "cannot resolve",
29
+ "module not found",
30
+ "missing import",
31
+ "missing file",
32
+ "does not exist",
33
+ "@repo/",
34
+ "error one by one",
35
+ "fix errors one by one",
36
+ "fix imports one by one",
37
+ "roll back"
38
+ ];
24
39
  var COPY_RULE = `
25
40
  ## COPY FILES DIRECTLY (CRITICAL)
26
41
 
@@ -55,6 +70,32 @@ Just run: sudo cp /path/to/source /path/to/dest
55
70
 
56
71
  Copying is instant and preserves exact code. Reading is unnecessary.
57
72
  `;
73
+ var IMPORT_ERROR_RULE = `
74
+ ## IMPORT ERRORS? COPY THOSE FILES TOO!
75
+
76
+ When you see import/module errors after copying a file:
77
+
78
+ 1. **STOP fixing imports one by one**
79
+ 2. **STOP rolling back**
80
+ 3. **LIST all missing import files** for the user
81
+ 4. **Ask user which to copy**, then copy them via sudo cp
82
+
83
+ Example:
84
+ \`\`\`bash
85
+ # If error shows missing:
86
+ # - @repo/auth/server
87
+ # - @repo/design-system/components/ui/sidebar
88
+ # - ./components/notifications-provider
89
+
90
+ # Then copy these files the same way:
91
+ sudo cp /source/path/@repo/auth/server.ts /dest/path/@repo/auth/server.ts
92
+ sudo cp -r /source/path/@repo/design-system/components/ui/sidebar /dest/path/@repo/design-system/components/ui/sidebar
93
+ sudo cp /source/path/components/notifications-provider.tsx /dest/path/components/notifications-provider.tsx
94
+ \`\`\`
95
+
96
+ **NEVER fix imports one by one** - copy the missing files instead!
97
+ **NEVER roll back** - keep the copied file and copy its dependencies!
98
+ `;
58
99
  function shouldInjectCopyRule(text) {
59
100
  const lower = text.toLowerCase();
60
101
  return COPY_KEYWORDS.some((keyword) => lower.includes(keyword));
@@ -65,6 +106,10 @@ function shouldInjectReadWarning(text) {
65
106
  const hasReadIntent = READ_SOURCE_TRIGGERS.some((t) => lower.includes(t));
66
107
  return hasSourcePath && hasReadIntent;
67
108
  }
109
+ function shouldInjectImportErrorRule(text) {
110
+ const lower = text.toLowerCase();
111
+ return IMPORT_ERROR_TRIGGERS.some((t) => lower.includes(t));
112
+ }
68
113
  function registerFileCopyHelper(pi) {
69
114
  pi.on("input", (event) => {
70
115
  if (event.source !== "interactive") {
@@ -86,6 +131,12 @@ function registerFileCopyHelper(pi) {
86
131
  text: text + READ_WARNING
87
132
  };
88
133
  }
134
+ if (shouldInjectImportErrorRule(text)) {
135
+ return {
136
+ action: "transform",
137
+ text: text + IMPORT_ERROR_RULE
138
+ };
139
+ }
89
140
  return;
90
141
  });
91
142
  }
@@ -37,6 +37,23 @@ const READ_SOURCE_TRIGGERS = [
37
37
  "lets read",
38
38
  ];
39
39
 
40
+ // When agent sees import/module errors (needs to copy those files too)
41
+ const IMPORT_ERROR_TRIGGERS = [
42
+ "import error",
43
+ "import errors",
44
+ "cannot find module",
45
+ "cannot resolve",
46
+ "module not found",
47
+ "missing import",
48
+ "missing file",
49
+ "does not exist",
50
+ "@repo/",
51
+ "error one by one",
52
+ "fix errors one by one",
53
+ "fix imports one by one",
54
+ "roll back",
55
+ ];
56
+
40
57
  // Extract source and destination from user request
41
58
  const COPY_RULE = `
42
59
  ## COPY FILES DIRECTLY (CRITICAL)
@@ -75,6 +92,34 @@ Just run: sudo cp /path/to/source /path/to/dest
75
92
  Copying is instant and preserves exact code. Reading is unnecessary.
76
93
  `;
77
94
 
95
+ // When agent sees import errors - copy those files too!
96
+ const IMPORT_ERROR_RULE = `
97
+ ## IMPORT ERRORS? COPY THOSE FILES TOO!
98
+
99
+ When you see import/module errors after copying a file:
100
+
101
+ 1. **STOP fixing imports one by one**
102
+ 2. **STOP rolling back**
103
+ 3. **LIST all missing import files** for the user
104
+ 4. **Ask user which to copy**, then copy them via sudo cp
105
+
106
+ Example:
107
+ \`\`\`bash
108
+ # If error shows missing:
109
+ # - @repo/auth/server
110
+ # - @repo/design-system/components/ui/sidebar
111
+ # - ./components/notifications-provider
112
+
113
+ # Then copy these files the same way:
114
+ sudo cp /source/path/@repo/auth/server.ts /dest/path/@repo/auth/server.ts
115
+ sudo cp -r /source/path/@repo/design-system/components/ui/sidebar /dest/path/@repo/design-system/components/ui/sidebar
116
+ sudo cp /source/path/components/notifications-provider.tsx /dest/path/components/notifications-provider.tsx
117
+ \`\`\`
118
+
119
+ **NEVER fix imports one by one** - copy the missing files instead!
120
+ **NEVER roll back** - keep the copied file and copy its dependencies!
121
+ `;
122
+
78
123
  /**
79
124
  * Check if text contains copy-related keywords
80
125
  */
@@ -94,6 +139,14 @@ function shouldInjectReadWarning(text: string): boolean {
94
139
  return hasSourcePath && hasReadIntent;
95
140
  }
96
141
 
142
+ /**
143
+ * Check if text contains import error triggers
144
+ */
145
+ function shouldInjectImportErrorRule(text: string): boolean {
146
+ const lower = text.toLowerCase();
147
+ return IMPORT_ERROR_TRIGGERS.some((t) => lower.includes(t));
148
+ }
149
+
97
150
  /**
98
151
  * Register the file-copy-helper extension
99
152
  */
@@ -125,6 +178,14 @@ export function registerFileCopyHelper(pi: ExtensionAPI): void {
125
178
  };
126
179
  }
127
180
 
181
+ // Inject import error rule when agent sees missing imports
182
+ if (shouldInjectImportErrorRule(text)) {
183
+ return {
184
+ action: "transform",
185
+ text: text + IMPORT_ERROR_RULE,
186
+ };
187
+ }
188
+
128
189
  return;
129
190
  });
130
191
  }
@@ -0,0 +1,27 @@
1
+ /**
2
+ * Knowledge Graph - RFC-0106
3
+ *
4
+ * Extract nodes and edges from SKILL.md files.
5
+ */
6
+ import type { KnowledgeNode, KnowledgeEdge, KnowledgeGraph } from "./types.js";
7
+ /**
8
+ * Extract a knowledge node from a SKILL.md file
9
+ */
10
+ export declare function extractSkillNode(filePath: string, content: string, frontmatter: Record<string, unknown>): KnowledgeNode;
11
+ /**
12
+ * Extract edges from a SKILL.md file
13
+ */
14
+ export declare function extractSkillEdges(filePath: string, content: string, frontmatter: Record<string, unknown>): KnowledgeEdge[];
15
+ /**
16
+ * Extract RFC nodes from RFC markdown files
17
+ */
18
+ export declare function extractRFCNode(filePath: string, content: string, title: string): KnowledgeNode;
19
+ /**
20
+ * Extract edges between RFCs
21
+ */
22
+ export declare function extractRFCEdges(filePath: string, content: string): KnowledgeEdge[];
23
+ /**
24
+ * Build complete knowledge graph from directory
25
+ */
26
+ export declare function extractKnowledgeGraph(skillsPath: string, rfcPath: string): Promise<KnowledgeGraph>;
27
+ //# sourceMappingURL=graph-extractor.d.ts.map