@miguelduran14/knowflow 0.1.1

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 (192) hide show
  1. package/LICENSE +201 -0
  2. package/README.md +182 -0
  3. package/dist/advisories.d.ts +16 -0
  4. package/dist/advisories.js +364 -0
  5. package/dist/advisories.js.map +1 -0
  6. package/dist/cli.d.ts +2 -0
  7. package/dist/cli.js +104 -0
  8. package/dist/cli.js.map +1 -0
  9. package/dist/copy-resolver.d.ts +22 -0
  10. package/dist/copy-resolver.js +74 -0
  11. package/dist/copy-resolver.js.map +1 -0
  12. package/dist/dataflow.d.ts +2 -0
  13. package/dist/dataflow.js +88 -0
  14. package/dist/dataflow.js.map +1 -0
  15. package/dist/dossier.d.ts +20 -0
  16. package/dist/dossier.js +331 -0
  17. package/dist/dossier.js.map +1 -0
  18. package/dist/explain/claude.d.ts +14 -0
  19. package/dist/explain/claude.js +91 -0
  20. package/dist/explain/claude.js.map +1 -0
  21. package/dist/explain/explain.d.ts +72 -0
  22. package/dist/explain/explain.js +126 -0
  23. package/dist/explain/explain.js.map +1 -0
  24. package/dist/explain/facts.d.ts +23 -0
  25. package/dist/explain/facts.js +266 -0
  26. package/dist/explain/facts.js.map +1 -0
  27. package/dist/explain/fake.d.ts +14 -0
  28. package/dist/explain/fake.js +27 -0
  29. package/dist/explain/fake.js.map +1 -0
  30. package/dist/explain/openai.d.ts +42 -0
  31. package/dist/explain/openai.js +102 -0
  32. package/dist/explain/openai.js.map +1 -0
  33. package/dist/explain/provider.d.ts +19 -0
  34. package/dist/explain/provider.js +2 -0
  35. package/dist/explain/provider.js.map +1 -0
  36. package/dist/explain/sse.d.ts +10 -0
  37. package/dist/explain/sse.js +44 -0
  38. package/dist/explain/sse.js.map +1 -0
  39. package/dist/flow-parser.d.ts +10 -0
  40. package/dist/flow-parser.js +503 -0
  41. package/dist/flow-parser.js.map +1 -0
  42. package/dist/glossary.d.ts +54 -0
  43. package/dist/glossary.js +340 -0
  44. package/dist/glossary.js.map +1 -0
  45. package/dist/index.d.ts +17 -0
  46. package/dist/index.js +16 -0
  47. package/dist/index.js.map +1 -0
  48. package/dist/inventory.d.ts +7 -0
  49. package/dist/inventory.js +453 -0
  50. package/dist/inventory.js.map +1 -0
  51. package/dist/lines.d.ts +15 -0
  52. package/dist/lines.js +53 -0
  53. package/dist/lines.js.map +1 -0
  54. package/dist/linker.d.ts +17 -0
  55. package/dist/linker.js +56 -0
  56. package/dist/linker.js.map +1 -0
  57. package/dist/mermaid.d.ts +27 -0
  58. package/dist/mermaid.js +133 -0
  59. package/dist/mermaid.js.map +1 -0
  60. package/dist/parser.d.ts +19 -0
  61. package/dist/parser.js +442 -0
  62. package/dist/parser.js.map +1 -0
  63. package/dist/pic.d.ts +29 -0
  64. package/dist/pic.js +197 -0
  65. package/dist/pic.js.map +1 -0
  66. package/dist/references.d.ts +24 -0
  67. package/dist/references.js +906 -0
  68. package/dist/references.js.map +1 -0
  69. package/dist/source-lines.d.ts +56 -0
  70. package/dist/source-lines.js +114 -0
  71. package/dist/source-lines.js.map +1 -0
  72. package/dist/types.d.ts +499 -0
  73. package/dist/types.js +2 -0
  74. package/dist/types.js.map +1 -0
  75. package/gui/dist/assets/ChainCanvas-C37KyhnE.js +1 -0
  76. package/gui/dist/assets/FlowCanvas-BRklWBCp.js +3 -0
  77. package/gui/dist/assets/RobotProfessor-BtTDTBDq.js +4220 -0
  78. package/gui/dist/assets/fira-code-cyrillic-400-normal-UC0NFL4U.woff2 +0 -0
  79. package/gui/dist/assets/fira-code-cyrillic-400-normal-dc1q3VD7.woff +0 -0
  80. package/gui/dist/assets/fira-code-cyrillic-500-normal-Bu7VCL72.woff +0 -0
  81. package/gui/dist/assets/fira-code-cyrillic-500-normal-CX35h3Mg.woff2 +0 -0
  82. package/gui/dist/assets/fira-code-cyrillic-600-normal-BD56RyRT.woff +0 -0
  83. package/gui/dist/assets/fira-code-cyrillic-600-normal-CPRdbepc.woff2 +0 -0
  84. package/gui/dist/assets/fira-code-cyrillic-ext-400-normal-Buh61xzB.woff +0 -0
  85. package/gui/dist/assets/fira-code-cyrillic-ext-400-normal-txZ9Fk_1.woff2 +0 -0
  86. package/gui/dist/assets/fira-code-cyrillic-ext-500-normal-CYRspHgm.woff2 +0 -0
  87. package/gui/dist/assets/fira-code-cyrillic-ext-500-normal-CwtLmSFD.woff +0 -0
  88. package/gui/dist/assets/fira-code-cyrillic-ext-600-normal-B9wE0zmr.woff2 +0 -0
  89. package/gui/dist/assets/fira-code-cyrillic-ext-600-normal-DldcyWhZ.woff +0 -0
  90. package/gui/dist/assets/fira-code-greek-400-normal-B2Gh_Y8s.woff2 +0 -0
  91. package/gui/dist/assets/fira-code-greek-400-normal-DobhaxvF.woff +0 -0
  92. package/gui/dist/assets/fira-code-greek-500-normal-CVO0IRNt.woff2 +0 -0
  93. package/gui/dist/assets/fira-code-greek-500-normal-DEXIWiey.woff +0 -0
  94. package/gui/dist/assets/fira-code-greek-600-normal-D_h3X2X5.woff +0 -0
  95. package/gui/dist/assets/fira-code-greek-600-normal-Dxp52_By.woff2 +0 -0
  96. package/gui/dist/assets/fira-code-greek-ext-400-normal-DR7mBgIM.woff2 +0 -0
  97. package/gui/dist/assets/fira-code-greek-ext-400-normal-DSPUheWg.woff +0 -0
  98. package/gui/dist/assets/fira-code-greek-ext-500-normal-BO3iq16n.woff2 +0 -0
  99. package/gui/dist/assets/fira-code-greek-ext-500-normal-CMiNLXER.woff +0 -0
  100. package/gui/dist/assets/fira-code-greek-ext-600-normal-C-cQDoOk.woff +0 -0
  101. package/gui/dist/assets/fira-code-greek-ext-600-normal-DtBpFRLc.woff2 +0 -0
  102. package/gui/dist/assets/fira-code-latin-400-normal-C-QZfXAs.woff +0 -0
  103. package/gui/dist/assets/fira-code-latin-400-normal-DGosTW8U.woff2 +0 -0
  104. package/gui/dist/assets/fira-code-latin-500-normal-B6gioGu8.woff2 +0 -0
  105. package/gui/dist/assets/fira-code-latin-500-normal-aMLC2AMm.woff +0 -0
  106. package/gui/dist/assets/fira-code-latin-600-normal-BmSSHshu.woff +0 -0
  107. package/gui/dist/assets/fira-code-latin-600-normal-CvYZpPHg.woff2 +0 -0
  108. package/gui/dist/assets/fira-code-latin-ext-400-normal-DG73JjOf.woff +0 -0
  109. package/gui/dist/assets/fira-code-latin-ext-400-normal-KSMg0QLl.woff2 +0 -0
  110. package/gui/dist/assets/fira-code-latin-ext-500-normal-CaANqXjI.woff +0 -0
  111. package/gui/dist/assets/fira-code-latin-ext-500-normal-Crd9e_oI.woff2 +0 -0
  112. package/gui/dist/assets/fira-code-latin-ext-600-normal-0PFQL1eg.woff +0 -0
  113. package/gui/dist/assets/fira-code-latin-ext-600-normal-Cb7jxoAi.woff2 +0 -0
  114. package/gui/dist/assets/fira-code-symbols2-400-normal-_QEZCEwe.woff +0 -0
  115. package/gui/dist/assets/fira-code-symbols2-500-normal-DwsgbIjQ.woff +0 -0
  116. package/gui/dist/assets/fira-code-symbols2-600-normal-Dvq6IQE5.woff +0 -0
  117. package/gui/dist/assets/fira-sans-cyrillic-300-normal-BO7tmGom.woff2 +0 -0
  118. package/gui/dist/assets/fira-sans-cyrillic-300-normal-BtNmWoqn.woff +0 -0
  119. package/gui/dist/assets/fira-sans-cyrillic-400-normal-CKu2TFQr.woff2 +0 -0
  120. package/gui/dist/assets/fira-sans-cyrillic-400-normal-D9eUeF-O.woff +0 -0
  121. package/gui/dist/assets/fira-sans-cyrillic-500-normal-CXfldnQ8.woff2 +0 -0
  122. package/gui/dist/assets/fira-sans-cyrillic-500-normal-Daski1k2.woff +0 -0
  123. package/gui/dist/assets/fira-sans-cyrillic-600-normal-CJ5P9t7t.woff +0 -0
  124. package/gui/dist/assets/fira-sans-cyrillic-600-normal-JSBvCpTs.woff2 +0 -0
  125. package/gui/dist/assets/fira-sans-cyrillic-700-normal-Bl-HczEO.woff2 +0 -0
  126. package/gui/dist/assets/fira-sans-cyrillic-700-normal-KyW5QH4H.woff +0 -0
  127. package/gui/dist/assets/fira-sans-cyrillic-ext-300-normal-BRn8Tsce.woff2 +0 -0
  128. package/gui/dist/assets/fira-sans-cyrillic-ext-300-normal-DOtRq9zH.woff +0 -0
  129. package/gui/dist/assets/fira-sans-cyrillic-ext-400-normal-Cycyekte.woff2 +0 -0
  130. package/gui/dist/assets/fira-sans-cyrillic-ext-400-normal-Dd5dApAy.woff +0 -0
  131. package/gui/dist/assets/fira-sans-cyrillic-ext-500-normal-Cixivk4R.woff +0 -0
  132. package/gui/dist/assets/fira-sans-cyrillic-ext-500-normal-Dkk5LlrU.woff2 +0 -0
  133. package/gui/dist/assets/fira-sans-cyrillic-ext-600-normal-BKgjRriM.woff +0 -0
  134. package/gui/dist/assets/fira-sans-cyrillic-ext-600-normal-CE6oUZE1.woff2 +0 -0
  135. package/gui/dist/assets/fira-sans-cyrillic-ext-700-normal-BfO9TR-w.woff2 +0 -0
  136. package/gui/dist/assets/fira-sans-cyrillic-ext-700-normal-Gcpdxicj.woff +0 -0
  137. package/gui/dist/assets/fira-sans-greek-300-normal-D3JfF3y9.woff2 +0 -0
  138. package/gui/dist/assets/fira-sans-greek-300-normal-DSgcXl_1.woff +0 -0
  139. package/gui/dist/assets/fira-sans-greek-400-normal-BFCFncbp.woff2 +0 -0
  140. package/gui/dist/assets/fira-sans-greek-400-normal-DQ8sF22y.woff +0 -0
  141. package/gui/dist/assets/fira-sans-greek-500-normal-C9KT8sAy.woff +0 -0
  142. package/gui/dist/assets/fira-sans-greek-500-normal-Cy-TUuxE.woff2 +0 -0
  143. package/gui/dist/assets/fira-sans-greek-600-normal-BlqpLOpF.woff2 +0 -0
  144. package/gui/dist/assets/fira-sans-greek-600-normal-DfHu91YF.woff +0 -0
  145. package/gui/dist/assets/fira-sans-greek-700-normal-BVfcrbV7.woff2 +0 -0
  146. package/gui/dist/assets/fira-sans-greek-700-normal-CJu31rC4.woff +0 -0
  147. package/gui/dist/assets/fira-sans-greek-ext-300-normal-CodlqOxk.woff +0 -0
  148. package/gui/dist/assets/fira-sans-greek-ext-300-normal-DVDwbKuK.woff2 +0 -0
  149. package/gui/dist/assets/fira-sans-greek-ext-400-normal-ByG7UNQ2.woff2 +0 -0
  150. package/gui/dist/assets/fira-sans-greek-ext-400-normal-ClCfNE6D.woff +0 -0
  151. package/gui/dist/assets/fira-sans-greek-ext-500-normal-Bem4H9fH.woff +0 -0
  152. package/gui/dist/assets/fira-sans-greek-ext-500-normal-nq-cjB3m.woff2 +0 -0
  153. package/gui/dist/assets/fira-sans-greek-ext-600-normal-DPxZoeHL.woff +0 -0
  154. package/gui/dist/assets/fira-sans-greek-ext-600-normal-fS0evUH3.woff2 +0 -0
  155. package/gui/dist/assets/fira-sans-greek-ext-700-normal-C1m6bE4Q.woff2 +0 -0
  156. package/gui/dist/assets/fira-sans-greek-ext-700-normal-C8J5qYMq.woff +0 -0
  157. package/gui/dist/assets/fira-sans-latin-300-normal-B2LrTgQS.woff2 +0 -0
  158. package/gui/dist/assets/fira-sans-latin-300-normal-Dwkm-oZ7.woff +0 -0
  159. package/gui/dist/assets/fira-sans-latin-400-normal-66xCkunx.woff +0 -0
  160. package/gui/dist/assets/fira-sans-latin-400-normal-a0AnQzuD.woff2 +0 -0
  161. package/gui/dist/assets/fira-sans-latin-500-normal-Bkfzcwmr.woff +0 -0
  162. package/gui/dist/assets/fira-sans-latin-500-normal-Bvbxc8ch.woff2 +0 -0
  163. package/gui/dist/assets/fira-sans-latin-600-normal-CXKlxLG9.woff2 +0 -0
  164. package/gui/dist/assets/fira-sans-latin-600-normal-DtSgd811.woff +0 -0
  165. package/gui/dist/assets/fira-sans-latin-700-normal-CRhwpWTq.woff2 +0 -0
  166. package/gui/dist/assets/fira-sans-latin-700-normal-DgqLm3Fi.woff +0 -0
  167. package/gui/dist/assets/fira-sans-latin-ext-300-normal-CAROBYR0.woff +0 -0
  168. package/gui/dist/assets/fira-sans-latin-ext-300-normal-GNF4Ac3G.woff2 +0 -0
  169. package/gui/dist/assets/fira-sans-latin-ext-400-normal-BCUwhuGB.woff +0 -0
  170. package/gui/dist/assets/fira-sans-latin-ext-400-normal-BLG_mAEf.woff2 +0 -0
  171. package/gui/dist/assets/fira-sans-latin-ext-500-normal-CFRf4jcC.woff +0 -0
  172. package/gui/dist/assets/fira-sans-latin-ext-500-normal-OO1QnNpY.woff2 +0 -0
  173. package/gui/dist/assets/fira-sans-latin-ext-600-normal-DLMQsaV4.woff +0 -0
  174. package/gui/dist/assets/fira-sans-latin-ext-600-normal-DTQBTt1m.woff2 +0 -0
  175. package/gui/dist/assets/fira-sans-latin-ext-700-normal-cfTxGFzJ.woff +0 -0
  176. package/gui/dist/assets/fira-sans-latin-ext-700-normal-g2Yrd4J5.woff2 +0 -0
  177. package/gui/dist/assets/fira-sans-vietnamese-300-normal-BO7He0nF.woff2 +0 -0
  178. package/gui/dist/assets/fira-sans-vietnamese-300-normal-CeyOCBN-.woff +0 -0
  179. package/gui/dist/assets/fira-sans-vietnamese-400-normal-DUVG35gE.woff +0 -0
  180. package/gui/dist/assets/fira-sans-vietnamese-400-normal-ljDTQFsx.woff2 +0 -0
  181. package/gui/dist/assets/fira-sans-vietnamese-500-normal-ChEXCnJy.woff2 +0 -0
  182. package/gui/dist/assets/fira-sans-vietnamese-500-normal-UV7M6ot_.woff +0 -0
  183. package/gui/dist/assets/fira-sans-vietnamese-600-normal-Bxjaclsw.woff +0 -0
  184. package/gui/dist/assets/fira-sans-vietnamese-600-normal-Dh2KAvU8.woff2 +0 -0
  185. package/gui/dist/assets/fira-sans-vietnamese-700-normal-DFi88MGY.woff +0 -0
  186. package/gui/dist/assets/fira-sans-vietnamese-700-normal-j5oLGLJY.woff2 +0 -0
  187. package/gui/dist/assets/index-CwQzep9r.js +413 -0
  188. package/gui/dist/assets/index-DUFjnEFT.css +1 -0
  189. package/gui/dist/assets/theme-BnuhLJ6X.css +1 -0
  190. package/gui/dist/assets/theme-G7EkTZY2.js +30 -0
  191. package/gui/dist/index.html +13 -0
  192. package/package.json +62 -0
package/LICENSE ADDED
@@ -0,0 +1,201 @@
1
+ Apache License
2
+ Version 2.0, January 2004
3
+ http://www.apache.org/licenses/
4
+
5
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
+
7
+ 1. Definitions.
8
+
9
+ "License" shall mean the terms and conditions for use, reproduction,
10
+ and distribution as defined by Sections 1 through 9 of this document.
11
+
12
+ "Licensor" shall mean the copyright owner or entity authorized by
13
+ the copyright owner that is granting the License.
14
+
15
+ "Legal Entity" shall mean the union of the acting entity and all
16
+ other entities that control, are controlled by, or are under common
17
+ control with that entity. For the purposes of this definition,
18
+ "control" means (i) the power, direct or indirect, to cause the
19
+ direction or management of such entity, whether by contract or
20
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
21
+ outstanding shares, or (iii) beneficial ownership of such entity.
22
+
23
+ "You" (or "Your") shall mean an individual or Legal Entity
24
+ exercising permissions granted by this License.
25
+
26
+ "Source" form shall mean the preferred form for making modifications,
27
+ including but not limited to software source code, documentation
28
+ source, and configuration files.
29
+
30
+ "Object" form shall mean any form resulting from mechanical
31
+ transformation or translation of a Source form, including but
32
+ not limited to compiled object code, generated documentation,
33
+ and conversions to other media types.
34
+
35
+ "Work" shall mean the work of authorship, whether in Source or
36
+ Object form, made available under the License, as indicated by a
37
+ copyright notice that is included in or attached to the work
38
+ (an example is provided in the Appendix below).
39
+
40
+ "Derivative Works" shall mean any work, whether in Source or Object
41
+ form, that is based on (or derived from) the Work and for which the
42
+ editorial revisions, annotations, elaborations, or other modifications
43
+ represent, as a whole, an original work of authorship. For the purposes
44
+ of this License, Derivative Works shall not include works that remain
45
+ separable from, or merely link (or bind by name) to the interfaces of,
46
+ the Work and Derivative Works thereof.
47
+
48
+ "Contribution" shall mean any work of authorship, including
49
+ the original version of the Work and any modifications or additions
50
+ to that Work or Derivative Works thereof, that is intentionally
51
+ submitted to Licensor for inclusion in the Work by the copyright owner
52
+ or by an individual or Legal Entity authorized to submit on behalf of
53
+ the copyright owner. For the purposes of this definition, "submitted"
54
+ means any form of electronic, verbal, or written communication sent
55
+ to the Licensor or its representatives, including but not limited to
56
+ communication on electronic mailing lists, source code control systems,
57
+ and issue tracking systems that are managed by, or on behalf of, the
58
+ Licensor for the purpose of discussing and improving the Work, but
59
+ excluding communication that is conspicuously marked or otherwise
60
+ designated in writing by the copyright owner as "Not a Contribution."
61
+
62
+ "Contributor" shall mean Licensor and any individual or Legal Entity
63
+ on behalf of whom a Contribution has been received by Licensor and
64
+ subsequently incorporated within the Work.
65
+
66
+ 2. Grant of Copyright License. Subject to the terms and conditions of
67
+ this License, each Contributor hereby grants to You a perpetual,
68
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69
+ copyright license to reproduce, prepare Derivative Works of,
70
+ publicly display, publicly perform, sublicense, and distribute the
71
+ Work and such Derivative Works in Source or Object form.
72
+
73
+ 3. Grant of Patent License. Subject to the terms and conditions of
74
+ this License, each Contributor hereby grants to You a perpetual,
75
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76
+ (except as stated in this section) patent license to make, have made,
77
+ use, offer to sell, sell, import, and otherwise transfer the Work,
78
+ where such license applies only to those patent claims licensable
79
+ by such Contributor that are necessarily infringed by their
80
+ Contribution(s) alone or by combination of their Contribution(s)
81
+ with the Work to which such Contribution(s) was submitted. If You
82
+ institute patent litigation against any entity (including a
83
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
84
+ or a Contribution incorporated within the Work constitutes direct
85
+ or contributory patent infringement, then any patent licenses
86
+ granted to You under this License for that Work shall terminate
87
+ as of the date such litigation is filed.
88
+
89
+ 4. Redistribution. You may reproduce and distribute copies of the
90
+ Work or Derivative Works thereof in any medium, with or without
91
+ modifications, and in Source or Object form, provided that You
92
+ meet the following conditions:
93
+
94
+ (a) You must give any other recipients of the Work or
95
+ Derivative Works a copy of this License; and
96
+
97
+ (b) You must cause any modified files to carry prominent notices
98
+ stating that You changed the files; and
99
+
100
+ (c) You must retain, in the Source form of any Derivative Works
101
+ that You distribute, all copyright, patent, trademark, and
102
+ attribution notices from the Source form of the Work,
103
+ excluding those notices that do not pertain to any part of
104
+ the Derivative Works; and
105
+
106
+ (d) If the Work includes a "NOTICE" text file as part of its
107
+ distribution, then any Derivative Works that You distribute must
108
+ include a readable copy of the attribution notices contained
109
+ within such NOTICE file, excluding those notices that do not
110
+ pertain to any part of the Derivative Works, in at least one
111
+ of the following places: within a NOTICE text file distributed
112
+ as part of the Derivative Works; within the Source form or
113
+ documentation, if provided along with the Derivative Works; or,
114
+ within a display generated by the Derivative Works, if and
115
+ wherever such third-party notices normally appear. The contents
116
+ of the NOTICE file are for informational purposes only and
117
+ do not modify the License. You may add Your own attribution
118
+ notices within Derivative Works that You distribute, alongside
119
+ or as an addendum to the NOTICE text from the Work, provided
120
+ that such additional attribution notices cannot be construed
121
+ as modifying the License.
122
+
123
+ You may add Your own copyright statement to Your modifications and
124
+ may provide additional or different license terms and conditions
125
+ for use, reproduction, or distribution of Your modifications, or
126
+ for any such Derivative Works as a whole, provided Your use,
127
+ reproduction, and distribution of the Work otherwise complies with
128
+ the conditions stated in this License.
129
+
130
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
131
+ any Contribution intentionally submitted for inclusion in the Work
132
+ by You to the Licensor shall be under the terms and conditions of
133
+ this License, without any additional terms or conditions.
134
+ Notwithstanding the above, nothing herein shall supersede or modify
135
+ the terms of any separate license agreement you may have executed
136
+ with Licensor regarding such Contributions.
137
+
138
+ 6. Trademarks. This License does not grant permission to use the trade
139
+ names, trademarks, service marks, or product names of the Licensor,
140
+ except as required for reasonable and customary use in describing the
141
+ origin of the Work and reproducing the content of the NOTICE file.
142
+
143
+ 7. Disclaimer of Warranty. Unless required by applicable law or
144
+ agreed to in writing, Licensor provides the Work (and each
145
+ Contributor provides its Contributions) on an "AS IS" BASIS,
146
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147
+ implied, including, without limitation, any warranties or conditions
148
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149
+ PARTICULAR PURPOSE. You are solely responsible for determining the
150
+ appropriateness of using or redistributing the Work and assume any
151
+ risks associated with Your exercise of permissions under this License.
152
+
153
+ 8. Limitation of Liability. In no event and under no legal theory,
154
+ whether in tort (including negligence), contract, or otherwise,
155
+ unless required by applicable law (such as deliberate and grossly
156
+ negligent acts) or agreed to in writing, shall any Contributor be
157
+ liable to You for damages, including any direct, indirect, special,
158
+ incidental, or consequential damages of any character arising as a
159
+ result of this License or out of the use or inability to use the
160
+ Work (including but not limited to damages for loss of goodwill,
161
+ work stoppage, computer failure or malfunction, or any and all
162
+ other commercial damages or losses), even if such Contributor
163
+ has been advised of the possibility of such damages.
164
+
165
+ 9. Accepting Warranty or Additional Liability. While redistributing
166
+ the Work or Derivative Works thereof, You may choose to offer,
167
+ and charge a fee for, acceptance of support, warranty, indemnity,
168
+ or other liability obligations and/or rights consistent with this
169
+ License. However, in accepting such obligations, You may act only
170
+ on Your own behalf and on Your sole responsibility, not on behalf
171
+ of any other Contributor, and only if You agree to indemnify,
172
+ defend, and hold each Contributor harmless for any liability
173
+ incurred by, or claims asserted against, such Contributor by reason
174
+ of your accepting any such warranty or additional liability.
175
+
176
+ END OF TERMS AND CONDITIONS
177
+
178
+ APPENDIX: How to apply the Apache License to your work.
179
+
180
+ To apply the Apache License to your work, attach the following
181
+ boilerplate notice, with the fields enclosed by brackets "[]"
182
+ replaced with your own identifying information. (Don't include
183
+ the brackets!) The text should be enclosed in the appropriate
184
+ comment syntax for the file format. We also recommend that a
185
+ file or class name and description of purpose be included on the
186
+ same "printed page" as the copyright notice for easier
187
+ identification within third-party archives.
188
+
189
+ Copyright 2026 Miguel Ángel Durán
190
+
191
+ Licensed under the Apache License, Version 2.0 (the "License");
192
+ you may not use this file except in compliance with the License.
193
+ You may obtain a copy of the License at
194
+
195
+ http://www.apache.org/licenses/LICENSE-2.0
196
+
197
+ Unless required by applicable law or agreed to in writing, software
198
+ distributed under the License is distributed on an "AS IS" BASIS,
199
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
200
+ See the License for the specific language governing permissions and
201
+ limitations under the License.
package/README.md ADDED
@@ -0,0 +1,182 @@
1
+ <div align="center">
2
+
3
+ # KnowFlow
4
+
5
+ **Entiende un programa COBOL sin leer el código.**
6
+
7
+ Le das un `.cbl` y sus copybooks `.cpy`, y KnowFlow te devuelve el flujo de ejecución, el
8
+ esquema de datos byte a byte, qué toca (ficheros, DB2, CICS), dónde se usa cada campo y una
9
+ explicación en lenguaje llano — todo anclado a la línea del fuente que lo demuestra.
10
+
11
+ Pensado para el desarrollador **junior que hereda** un programa de mainframe cuando el veterano
12
+ que lo escribió ya no está.
13
+
14
+ `local-first` · `BYOK` · `Apache-2.0` · `sin backend`
15
+
16
+ [![CI](https://github.com/miguelduran14/KnowFlow/actions/workflows/ci.yml/badge.svg)](https://github.com/miguelduran14/KnowFlow/actions/workflows/ci.yml)
17
+ [![License](https://img.shields.io/badge/license-Apache--2.0-blue.svg)](https://github.com/miguelduran14/KnowFlow/blob/master/LICENSE)
18
+ ![Node](https://img.shields.io/badge/node-%E2%89%A518-informational)
19
+
20
+ <br>
21
+
22
+ <img src="https://raw.githubusercontent.com/miguelduran14/KnowFlow/master/docs/hero.png" alt="Pantalla de inicio de KnowFlow" width="860">
23
+
24
+ </div>
25
+
26
+ ---
27
+
28
+ ## Por qué existe
29
+
30
+ Las herramientas de análisis COBOL existentes están pensadas para *proyectos de migración*
31
+ (IBM watsonx, AWS Transform, consultoras): pesadas, caras, y no resuelven el problema real del
32
+ día a día — entender un programa concreto para mantenerlo. La alternativa real de un junior hoy
33
+ es pegar el código en un chat genérico, que **alucina** en dialecto mainframe (confunde
34
+ `SYSCAT.COLUMNS` con `SYSIBM.SYSCOLUMNS` en DB2 z/OS, por ejemplo) y no verifica nada de lo que
35
+ dice.
36
+
37
+ KnowFlow separa las dos cosas:
38
+
39
+ - Un **parser determinista** extrae los hechos estructurales exactos: divisiones, párrafos,
40
+ grafo `PERFORM`/`CALL`/`GO TO`, resolución de `COPY`, niveles/`PIC`/`OCCURS`/`REDEFINES`/`COMP`,
41
+ bloques `EXEC SQL`/`EXEC CICS`, y de dónde viene y a dónde va cada dato.
42
+ - La **IA solo narra** esos hechos ya verificados, en lenguaje llano — nunca ve el código fuente
43
+ crudo, así que no puede inventar estructura que no esté verificada.
44
+
45
+ Todo resultado lleva su **nivel de fidelidad**: lo que el parser verificó, y lo que queda marcado
46
+ como hueco (copybook ausente, `CALL` dinámica, destino no encontrado) en vez de rellenarse con una
47
+ suposición. Es el principio de no-invención del proyecto ([ADR-0003](docs/adr/0003-niveles-de-fidelidad-y-no-invencion.md)).
48
+
49
+ ## Requisitos
50
+
51
+ Solo **[Node.js](https://nodejs.org) 18 o superior** (incluye `npm`). Para comprobar si ya lo
52
+ tienes: `node --version`. Si no, instálalo con el instalador LTS de nodejs.org o por línea de
53
+ comandos:
54
+
55
+ ```bash
56
+ # Windows
57
+ winget install OpenJS.NodeJS.LTS
58
+ # macOS
59
+ brew install node
60
+ # con nvm (cualquier SO)
61
+ nvm install --lts
62
+ ```
63
+
64
+ ## Empezar en 30 segundos
65
+
66
+ Sin instalar nada, con un solo comando:
67
+
68
+ ```bash
69
+ npx @miguelduran14/knowflow
70
+ ```
71
+
72
+ O desde el código, si quieres trastear:
73
+
74
+ ```bash
75
+ git clone https://github.com/miguelduran14/KnowFlow.git
76
+ cd KnowFlow
77
+ npm install
78
+ npm run build
79
+ npm start
80
+ ```
81
+
82
+ Abre `http://localhost:4173` en tu navegador. Pulsa **«Cargar ejemplo»** para ver la herramienta
83
+ en marcha con una cadena de programas de banca sintéticos (`examples/`) — sin subir nada tuyo — o
84
+ arrastra tu propio `.cbl` y sus `.cpy`.
85
+
86
+ > **Local-first / BYOK.** Tu código nunca sale de tu máquina salvo la llamada al proveedor de IA
87
+ > que tú mismo configures (Claude, o un endpoint corporativo compatible con OpenAI) para la capa de
88
+ > explicación. Esa clave se guarda solo en tu navegador. Todo lo demás —flujo, datos, inventario,
89
+ > usos, trazabilidad, avisos— corre siempre local y no necesita ninguna clave. No hay backend
90
+ > propio ([ADR-0002](docs/adr/0002-gui-web-local-motor-como-libreria.md)).
91
+
92
+ ## Qué ves
93
+
94
+ | Vista | Qué responde |
95
+ |---|---|
96
+ | **Explicación** | Resumen y recorrido en lenguaje llano, generado por IA sobre los hechos del parser — cada etapa enlaza al párrafo real que la demuestra. |
97
+ | **Flujo** | Cómo se recorre el programa: párrafos y secciones, `PERFORM`/`CALL`/`GO TO`, la condición bajo la que ocurre cada arista, caídas naturales. Lienzo interactivo: clic en un nodo abre su ficha (a qué llama, quién lo llama, qué EXEC/E-S contiene), busca párrafos, pliega secciones y **exporta a Mermaid, SVG o PNG**. |
98
+ | **Datos** | El esquema como memoria: un mapa de bytes proporcional (cada campo ocupa el ancho de sus bytes reales) con `PIC`, `OCCURS`, `REDEFINES`, `COMP-3`, niveles 88/66 y offsets. Fija un campo (clic) para ver, en la misma ficha, **dónde se usa** y su **trazabilidad**. Tabla clásica siempre disponible como alternativa. |
99
+ | **Qué toca** | Ficheros con su E/S, tablas DB2, cursores y su ciclo `DECLARE`/`OPEN`/`FETCH`/`CLOSE`, comandos CICS — extracción literal, sin interpretar qué hace una consulta. |
100
+ | **Avisos** | Trampas de mantenimiento verificadas contra el fuente: `STOP RUN` en un subprograma, `UPDATE`/`DELETE` sin `WHERE`, `GO TO` que cruza de sección, fichero o cursor sin cerrar, párrafo inalcanzable, `ALTER`… No son huecos de fidelidad: son cosas que *sí* están, pero muerden. |
101
+ | **Cadena** | Qué `CALL` cruza a qué programa, cuando aportas varios fuentes a la vez. |
102
+
103
+ ### Dónde se usa cada campo (where-used)
104
+
105
+ Fija un campo en el mapa de bytes y KnowFlow lista cada punto de la `PROCEDURE DIVISION` donde se
106
+ **lee** o se **escribe**, con verbo, párrafo y línea, incluyendo las host variables de `EXEC SQL`.
107
+ Cada uso salta al diagrama de Flujo o al código. Lo que el reparto de roles no puede afirmar con
108
+ certeza (`CALL … USING` por referencia, `MOVE CORRESPONDING`, un homónimo) va **marcado**, no
109
+ adivinado.
110
+
111
+ ### Trazabilidad de datos
112
+
113
+ Desde ese mismo campo, sigue **de dónde viene** su valor y **a dónde va**, encadenando
114
+ `MOVE`/`COMPUTE`/aritmética/`STRING` y los solapes `REDEFINES`:
115
+
116
+ ```
117
+ MOV-IMPORTE → WS-BRUTO → WS-INTERES → WS-TOTAL → WS-TOTAL-ED → RPT-REGISTRO
118
+ ```
119
+
120
+ Es insensible al orden de ejecución (cada tramo es un flujo *posible*, no el que gana al final):
121
+ una respuesta honesta y acotada a «¿de dónde sale este importe del informe?».
122
+
123
+ ### Dossier de onboarding
124
+
125
+ Un botón exporta todo el análisis a un `.md` autocontenido —prosa de IA (si la hay) + diagrama
126
+ Mermaid + esquema + usos + trazabilidad + inventario + avisos + límites de lo verificado— listo
127
+ para pegar en una wiki o un PR. Se arma en el navegador; nada sale de tu máquina.
128
+
129
+ ### Modo aprendiz
130
+
131
+ Resalta los términos COBOL (`COMP-3`, `REDEFINES`, `EVALUATE`…) con una ficha explicativa al pasar
132
+ el ratón — no la genera un modelo, es un glosario propio.
133
+
134
+ ## Qué NO es
135
+
136
+ - No es un traductor/migrador COBOL→Java.
137
+ - No es una plataforma de análisis de *estate* completo.
138
+ - No genera código ni tipos a partir de copybooks.
139
+
140
+ Cuanto más estrecho el propósito —entender UN programa para mantenerlo— mejor. El contexto
141
+ completo del producto, la arquitectura y las decisiones están en [`CONTEXT.md`](CONTEXT.md) y en
142
+ [`docs/adr/`](docs/adr/).
143
+
144
+ ## El ejemplo
145
+
146
+ `examples/` contiene una cadena de banca **sintética** (`ctamov01` → `valida01` / `fecha01` +
147
+ copybooks) escrita desde patrones típicos, no copiada de nadie. Ejercita todas las vistas y lleva
148
+ dos avisos plantados a propósito. Ver [`examples/README.md`](examples/README.md).
149
+
150
+ ## Restricción importante
151
+
152
+ **Nunca** proceses COBOL de clientes/empleador con esta herramienta ni con ningún agente de IA
153
+ sobre este repo. La herramienta y cualquier agente envían lo que leen a un proveedor de IA: la
154
+ violación ocurre en el primer *read*, no en el *push*. Usa solo COBOL sintético o público
155
+ (GnuCOBOL, suite NIST, repos abiertos). Es una cuestión de propiedad intelectual, no negociable.
156
+
157
+ ## Desarrollo
158
+
159
+ ```bash
160
+ npm install
161
+ npm run dev --prefix gui # servidor de desarrollo con recarga en caliente (Vite)
162
+ ```
163
+
164
+ ```bash
165
+ npm test # suite de tests del motor (parser, flujo, inventario, usos, trazabilidad, cadena)
166
+ npm run verify # typecheck + tests + build completo (motor + GUI) — lo que corre antes de publicar
167
+ ```
168
+
169
+ El motor (`src/`) es una librería TypeScript independiente de la GUI (`gui/`) y se puede ejercitar
170
+ sin interfaz con el arnés de desarrollo: `npx tsx harness/flow.ts <fichero.cbl>`.
171
+
172
+ ```ts
173
+ import { parse, parseFlow, parseInventory, collectReferences, traceField } from '@miguelduran14/knowflow'
174
+ ```
175
+
176
+ Para sacar una versión nueva (subir versión, alinear GitHub y npm, publicar), ver
177
+ [`RELEASING.md`](RELEASING.md).
178
+
179
+ ## Licencia
180
+
181
+ Apache-2.0. Ver [ADR-0004](docs/adr/0004-licencia-apache-2.md) para el porqué (cláusula de
182
+ patentes + pasa revisiones legales corporativas; AGPL está prohibido por política en banca).
@@ -0,0 +1,16 @@
1
+ import type { Advisory, FlowResult, Inventory, ParseResult } from './types.js';
2
+ /**
3
+ * Trampas de mantenimiento COBOL conocidas, detectadas sobre hechos YA
4
+ * verificados por el parser (datos, flujo, inventario) — nunca sobre una
5
+ * interpretación nueva. Es una pasada determinista más, hermana de
6
+ * `factsFidelity`: mientras esa marca lo que NO se pudo verificar, esta
7
+ * marca lo que SÍ está verificado pero es arriesgado. Ver el tipo
8
+ * `Advisory` en `types.ts` para la distinción completa.
9
+ *
10
+ * Cada regla es independiente y de alta confianza — prefiere no avisar a
11
+ * avisar con un falso positivo. Ninguna regla necesita el fuente crudo
12
+ * salvo la de STOP RUN (que masca literales y recorta columnas fijas con
13
+ * las mismas utilidades que ya usan flow-parser/inventory, para no
14
+ * duplicar esa lógica con una regex ingenua).
15
+ */
16
+ export declare function checkAdvisories(source: string, data: ParseResult | undefined, flow: FlowResult | undefined, inventory: Inventory | undefined): Advisory[];