@aiready/core 0.24.4 → 0.24.6

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 (106) hide show
  1. package/dist/{chunk-RCZSMGCX.mjs → chunk-2IUCKF4Z.mjs} +1 -1
  2. package/dist/{chunk-WYOW6O3P.mjs → chunk-3D3I5K5W.mjs} +33 -7
  3. package/dist/{chunk-GTS642BQ.mjs → chunk-3FAI4YNO.mjs} +1 -1
  4. package/dist/{chunk-EZ7ECLAZ.mjs → chunk-5IVDH26E.mjs} +21 -16
  5. package/dist/{chunk-SWZOT67M.mjs → chunk-6T5O7OAY.mjs} +1 -1
  6. package/dist/{chunk-L6BKANJC.mjs → chunk-DHFOYNMW.mjs} +12 -8
  7. package/dist/{chunk-QZNY7B2N.mjs → chunk-EHUK4VMH.mjs} +16 -8
  8. package/dist/{chunk-MTK2IIDZ.mjs → chunk-EJ74KPCV.mjs} +1 -1
  9. package/dist/{chunk-2ILVUVRK.mjs → chunk-FAESSLG7.mjs} +44 -17
  10. package/dist/{chunk-UTCRW3N7.mjs → chunk-Q4LOPVH6.mjs} +18 -14
  11. package/dist/{chunk-WH4ZGRVF.mjs → chunk-QY5YG2AZ.mjs} +12 -9
  12. package/dist/{chunk-IXPY5J4K.mjs → chunk-X63YJX5G.mjs} +16 -8
  13. package/dist/client/index.d.mts +1 -1
  14. package/dist/client/index.d.ts +1 -1
  15. package/dist/client/index.js +44 -17
  16. package/dist/client/index.mjs +1 -1
  17. package/dist/{csharp-parser-4ZKCSX5B.mjs → csharp-parser-C52DNAKT.mjs} +2 -2
  18. package/dist/{csharp-parser-5HKICCRR.mjs → csharp-parser-XW7WHE77.mjs} +2 -2
  19. package/dist/{go-parser-TKXL3DVH.mjs → go-parser-GO4BIRDD.mjs} +2 -2
  20. package/dist/{go-parser-XOM232XZ.mjs → go-parser-KTG4CGF5.mjs} +2 -2
  21. package/dist/{index-CkM98qn1.d.mts → index-ChiWzeQs.d.mts} +188 -180
  22. package/dist/{index-CkM98qn1.d.ts → index-ChiWzeQs.d.ts} +188 -180
  23. package/dist/{index-EQ2jRSlB.d.mts → index-PI6qMP2H.d.mts} +182 -178
  24. package/dist/{index-EQ2jRSlB.d.ts → index-PI6qMP2H.d.ts} +182 -178
  25. package/dist/index.d.mts +50 -15
  26. package/dist/index.d.ts +50 -15
  27. package/dist/index.js +272 -114
  28. package/dist/index.mjs +161 -66
  29. package/dist/{java-parser-MASGS4WB.mjs → java-parser-EOKMGQ6B.mjs} +2 -2
  30. package/dist/{java-parser-T5LXD63J.mjs → java-parser-G47O53QP.mjs} +2 -2
  31. package/dist/{python-parser-FNFK2473.mjs → python-parser-BCI7JVLF.mjs} +1 -1
  32. package/dist/{typescript-parser-2GGNRNB5.mjs → typescript-parser-4BA4VYAF.mjs} +1 -1
  33. package/dist/{typescript-parser-3ENJ6C7H.mjs → typescript-parser-WFGH52WB.mjs} +1 -1
  34. package/package.json +1 -1
  35. package/dist/chunk-ARUIZO7M.mjs +0 -297
  36. package/dist/chunk-AZRUQG5T.mjs +0 -537
  37. package/dist/chunk-CYC5EGEI.mjs +0 -297
  38. package/dist/chunk-DBOPSRBC.mjs +0 -884
  39. package/dist/chunk-E55RNGGK.mjs +0 -852
  40. package/dist/chunk-FNPULWG7.mjs +0 -248
  41. package/dist/chunk-FZTFKZUQ.mjs +0 -250
  42. package/dist/chunk-G4Z45SMK.mjs +0 -852
  43. package/dist/chunk-JJQLYW6Z.mjs +0 -111
  44. package/dist/chunk-LEITCMH3.mjs +0 -535
  45. package/dist/chunk-LTAZ7Z62.mjs +0 -855
  46. package/dist/chunk-LXEO5PG3.mjs +0 -292
  47. package/dist/chunk-LZHO636W.mjs +0 -501
  48. package/dist/chunk-MPWWAAHQ.mjs +0 -548
  49. package/dist/chunk-QDCQETSI.mjs +0 -262
  50. package/dist/chunk-SM6INS52.mjs +0 -501
  51. package/dist/chunk-UBCM5Y6R.mjs +0 -275
  52. package/dist/chunk-UYLH35LA.mjs +0 -884
  53. package/dist/chunk-WVNVC2PP.mjs +0 -852
  54. package/dist/chunk-XQSEJ7WN.mjs +0 -547
  55. package/dist/chunk-YRSSR4KN.mjs +0 -850
  56. package/dist/client-2xbeKnrg.d.mts +0 -1291
  57. package/dist/client-2xbeKnrg.d.ts +0 -1291
  58. package/dist/client-4HLAGzFg.d.mts +0 -1291
  59. package/dist/client-4HLAGzFg.d.ts +0 -1291
  60. package/dist/client-B4TQwNa7.d.mts +0 -1290
  61. package/dist/client-B4TQwNa7.d.ts +0 -1290
  62. package/dist/client-Bdi4ty0v.d.mts +0 -1294
  63. package/dist/client-Bdi4ty0v.d.ts +0 -1294
  64. package/dist/client-BsKpUH3H.d.mts +0 -1339
  65. package/dist/client-BsKpUH3H.d.ts +0 -1339
  66. package/dist/client-Bv1zOaWF.d.mts +0 -1291
  67. package/dist/client-Bv1zOaWF.d.ts +0 -1291
  68. package/dist/client-Bz9YJMIX.d.mts +0 -1290
  69. package/dist/client-Bz9YJMIX.d.ts +0 -1290
  70. package/dist/client-CBpzm34X.d.mts +0 -1291
  71. package/dist/client-CBpzm34X.d.ts +0 -1291
  72. package/dist/client-CNu_tCZZ.d.mts +0 -1305
  73. package/dist/client-CNu_tCZZ.d.ts +0 -1305
  74. package/dist/client-CmEvxxQu.d.mts +0 -1339
  75. package/dist/client-CmEvxxQu.d.ts +0 -1339
  76. package/dist/client-Ctl_0z6F.d.mts +0 -1294
  77. package/dist/client-Ctl_0z6F.d.ts +0 -1294
  78. package/dist/client-DGMAxkZc.d.mts +0 -1339
  79. package/dist/client-DGMAxkZc.d.ts +0 -1339
  80. package/dist/client-DZq-CqcD.d.mts +0 -1292
  81. package/dist/client-DZq-CqcD.d.ts +0 -1292
  82. package/dist/client-DcqGfDTt.d.mts +0 -1284
  83. package/dist/client-DcqGfDTt.d.ts +0 -1284
  84. package/dist/client-O8RvSRm0.d.mts +0 -1261
  85. package/dist/client-O8RvSRm0.d.ts +0 -1261
  86. package/dist/client.d.mts +0 -2
  87. package/dist/client.d.ts +0 -2
  88. package/dist/client.js +0 -922
  89. package/dist/client.mjs +0 -104
  90. package/dist/csharp-parser-JCKXIAJW.mjs +0 -9
  91. package/dist/go-parser-J4KIH4RG.mjs +0 -9
  92. package/dist/index-Ctl_0z6F.d.mts +0 -1294
  93. package/dist/index-Ctl_0z6F.d.ts +0 -1294
  94. package/dist/index-DLHCsiAk.d.mts +0 -1294
  95. package/dist/index-DLHCsiAk.d.ts +0 -1294
  96. package/dist/java-parser-3KHXOXRQ.mjs +0 -9
  97. package/dist/python-parser-7QISP7LK.mjs +0 -8
  98. package/dist/python-parser-PDCO35VN.mjs +0 -8
  99. package/dist/python-parser-QAAL56MC.mjs +0 -8
  100. package/dist/python-parser-R7HLPNZK.mjs +0 -8
  101. package/dist/python-parser-SJ3LFZFJ.mjs +0 -8
  102. package/dist/python-parser-UFLCDT6L.mjs +0 -8
  103. package/dist/typescript-parser-4GI7DPSW.mjs +0 -7
  104. package/dist/typescript-parser-4H3HUBO4.mjs +0 -7
  105. package/dist/typescript-parser-K63IVZMF.mjs +0 -7
  106. package/dist/typescript-parser-ZJKROMQG.mjs +0 -7
@@ -1,262 +0,0 @@
1
- import {
2
- analyzeGeneralMetadata,
3
- extractParameterNames
4
- } from "./chunk-JJQLYW6Z.mjs";
5
- import {
6
- BaseLanguageParser
7
- } from "./chunk-2N7ISIKE.mjs";
8
-
9
- // src/parsers/go-parser.ts
10
- var GoParser = class extends BaseLanguageParser {
11
- constructor() {
12
- super(...arguments);
13
- this.language = "go" /* Go */;
14
- this.extensions = [".go"];
15
- }
16
- getParserName() {
17
- return "go";
18
- }
19
- /**
20
- * Analyze metadata for a Go node (purity, side effects).
21
- *
22
- * @param node - Tree-sitter node to analyze.
23
- * @param code - Source code for context.
24
- * @returns Partial ExportInfo containing discovered metadata.
25
- */
26
- analyzeMetadata(node, code) {
27
- return analyzeGeneralMetadata(node, code, {
28
- sideEffectSignatures: ["<-", "fmt.Print", "fmt.Fprintf", "os.Exit"]
29
- });
30
- }
31
- /**
32
- * Fallback regex-based parsing when tree-sitter is unavailable.
33
- *
34
- * @param code - Source code content.
35
- * @returns Consolidated ParseResult.
36
- */
37
- parseRegex(code) {
38
- const lines = code.split("\n");
39
- const exports = [];
40
- const imports = [];
41
- const importRegex = /^import\s+"([^"]+)"/;
42
- const funcRegex = /^func\s+([A-Z][a-zA-Z0-9_]*)\s*\(/;
43
- const typeRegex = /^type\s+([A-Z][a-zA-Z0-9_]*)\s+(struct|interface)/;
44
- lines.forEach((line, idx) => {
45
- const importMatch = line.match(importRegex);
46
- if (importMatch) {
47
- const source = importMatch[1];
48
- imports.push({
49
- source,
50
- specifiers: [source.split("/").pop() || source],
51
- loc: {
52
- start: { line: idx + 1, column: 0 },
53
- end: { line: idx + 1, column: line.length }
54
- }
55
- });
56
- }
57
- const funcMatch = line.match(funcRegex);
58
- if (funcMatch) {
59
- const name = funcMatch[1];
60
- const isPublic = /^[A-Z]/.test(name);
61
- let docContent;
62
- const prevLines = lines.slice(Math.max(0, idx - 3), idx);
63
- for (let i = prevLines.length - 1; i >= 0; i--) {
64
- const prevLine = prevLines[i].trim();
65
- if (prevLine.startsWith("//")) {
66
- const content = prevLine.slice(2).trim();
67
- docContent = docContent ? content + "\n" + docContent : content;
68
- } else if (prevLine.endsWith("*/")) {
69
- const blockMatch = prevLine.match(/\/\*([\s\S]*)\*\//);
70
- if (blockMatch) docContent = blockMatch[1].trim();
71
- break;
72
- } else if (!prevLine) {
73
- if (docContent) break;
74
- } else {
75
- break;
76
- }
77
- }
78
- const isImpure = name.toLowerCase().includes("impure") || line.includes("fmt.Print");
79
- exports.push({
80
- name,
81
- type: "function",
82
- visibility: isPublic ? "public" : "private",
83
- isPure: !isImpure,
84
- hasSideEffects: isImpure,
85
- documentation: docContent ? { content: docContent, type: "comment" } : void 0,
86
- loc: {
87
- start: { line: idx + 1, column: 0 },
88
- end: { line: idx + 1, column: line.length }
89
- }
90
- });
91
- }
92
- const typeMatch = line.match(typeRegex);
93
- if (typeMatch) {
94
- exports.push({
95
- name: typeMatch[1],
96
- type: typeMatch[2] === "struct" ? "class" : "interface",
97
- visibility: "public",
98
- isPure: true,
99
- hasSideEffects: false,
100
- loc: {
101
- start: { line: idx + 1, column: 0 },
102
- end: { line: idx + 1, column: line.length }
103
- }
104
- });
105
- }
106
- });
107
- return {
108
- exports,
109
- imports,
110
- language: "go" /* Go */,
111
- warnings: ["Parser falling back to regex-based analysis"]
112
- };
113
- }
114
- /**
115
- * Extract import information using AST walk.
116
- *
117
- * @param rootNode - Root node of the Go AST.
118
- * @returns Array of discovered FileImport objects.
119
- */
120
- extractImportsAST(rootNode) {
121
- const imports = [];
122
- const findImports = (node) => {
123
- if (node.type === "import_spec") {
124
- const pathNode = node.children.find(
125
- (c) => c.type === "interpreted_string_literal"
126
- );
127
- if (pathNode) {
128
- const source = pathNode.text.replace(/"/g, "");
129
- imports.push({
130
- source,
131
- specifiers: [source.split("/").pop() || source],
132
- loc: {
133
- start: {
134
- line: node.startPosition.row + 1,
135
- column: node.startPosition.column
136
- },
137
- end: {
138
- line: node.endPosition.row + 1,
139
- column: node.endPosition.column
140
- }
141
- }
142
- });
143
- }
144
- }
145
- for (let i = 0; i < node.childCount; i++) {
146
- const child = node.child(i);
147
- if (child) findImports(child);
148
- }
149
- };
150
- findImports(rootNode);
151
- return imports;
152
- }
153
- /**
154
- * Extract export information (functions, types, vars) using AST walk.
155
- *
156
- * @param rootNode - Root node of the Go AST.
157
- * @param code - Source code for documentation extraction.
158
- * @returns Array of discovered ExportInfo objects.
159
- */
160
- extractExportsAST(rootNode, code) {
161
- const exports = [];
162
- const isExported = (name) => {
163
- return /^[A-Z]/.test(name);
164
- };
165
- const traverse = (node) => {
166
- if (node.type === "function_declaration" || node.type === "method_declaration") {
167
- const nameNode = node.childForFieldName("name") || node.children.find((c) => c.type === "identifier");
168
- if (nameNode && isExported(nameNode.text)) {
169
- const metadata = this.analyzeMetadata(node, code);
170
- exports.push({
171
- name: nameNode.text,
172
- type: "function",
173
- loc: {
174
- start: {
175
- line: node.startPosition.row + 1,
176
- column: node.startPosition.column
177
- },
178
- end: {
179
- line: node.endPosition.row + 1,
180
- column: node.endPosition.column
181
- }
182
- },
183
- visibility: "public",
184
- parameters: this.extractParameters(node),
185
- ...metadata
186
- });
187
- }
188
- } else if (node.type === "type_spec") {
189
- const nameNode = node.childForFieldName("name") || node.children.find((c) => c.type === "type_identifier");
190
- if (nameNode && isExported(nameNode.text)) {
191
- const metadata = this.analyzeMetadata(node.parent || node, code);
192
- const type = node.children.some((c) => c.type === "struct_type") ? "class" : "interface";
193
- exports.push({
194
- name: nameNode.text,
195
- type,
196
- loc: {
197
- start: {
198
- line: node.startPosition.row + 1,
199
- column: node.startPosition.column
200
- },
201
- end: {
202
- line: node.endPosition.row + 1,
203
- column: node.endPosition.column
204
- }
205
- },
206
- visibility: "public",
207
- ...metadata
208
- });
209
- }
210
- } else if (node.type === "var_spec" || node.type === "const_spec") {
211
- const identifiers = node.children.filter(
212
- (c) => c.type === "identifier"
213
- );
214
- for (const idNode of identifiers) {
215
- if (isExported(idNode.text)) {
216
- const metadata = this.analyzeMetadata(node, code);
217
- exports.push({
218
- name: idNode.text,
219
- type: "variable",
220
- loc: {
221
- start: {
222
- line: idNode.startPosition.row + 1,
223
- column: idNode.startPosition.column
224
- },
225
- end: {
226
- line: idNode.endPosition.row + 1,
227
- column: idNode.endPosition.column
228
- }
229
- },
230
- visibility: "public",
231
- ...metadata
232
- });
233
- }
234
- }
235
- }
236
- for (let i = 0; i < node.childCount; i++) {
237
- const child = node.child(i);
238
- if (child) traverse(child);
239
- }
240
- };
241
- traverse(rootNode);
242
- return exports;
243
- }
244
- extractParameters(node) {
245
- return extractParameterNames(node);
246
- }
247
- getNamingConventions() {
248
- return {
249
- variablePattern: /^[a-zA-Z][a-zA-Z0-9]*$/,
250
- functionPattern: /^[a-zA-Z][a-zA-Z0-9]*$/,
251
- classPattern: /^[a-zA-Z][a-zA-Z0-9]*$/,
252
- constantPattern: /^[a-zA-Z_][a-zA-Z0-9_]*$/
253
- };
254
- }
255
- canHandle(filePath) {
256
- return filePath.toLowerCase().endsWith(".go");
257
- }
258
- };
259
-
260
- export {
261
- GoParser
262
- };