@bikky/compiler 0.1.0 → 0.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.idea/copilot.data.migration.agent.xml +6 -0
- package/.idea/copilot.data.migration.ask.xml +6 -0
- package/.idea/copilot.data.migration.ask2agent.xml +6 -0
- package/.idea/copilot.data.migration.edit.xml +6 -0
- package/Libraries/DelayLib.d.mts +34 -2
- package/Libraries/DelayLib.d.mts.map +1 -1
- package/Libraries/DelayLib.mjs +173 -11
- package/Libraries/DelayLib.mjs.map +1 -1
- package/Libraries/DelayLib.mts +219 -14
- package/Libraries/GlobalTypes.d.ts +5 -1
- package/Source/ASTBuilder.d.ts.map +1 -1
- package/Source/ASTHelper.d.ts +1 -1
- package/Source/ASTHelper.d.ts.map +1 -1
- package/Source/ASTHelper.js +22 -4
- package/Source/ASTInterface/Crawler.d.ts +8 -2
- package/Source/ASTInterface/Crawler.d.ts.map +1 -1
- package/Source/ASTInterface/Crawler.js +36 -20
- package/Source/MiscHelpers.d.ts +21 -0
- package/Source/MiscHelpers.d.ts.map +1 -0
- package/Source/MiscHelpers.js +152 -0
- package/Transformers/DelayTransformer.js +52 -0
- package/Transformers/Main.d.ts +2 -1
- package/Transformers/Main.d.ts.map +1 -1
- package/Transformers/Main.js +4 -12
- package/Transformers/ReplicableTransformer.d.ts +2 -0
- package/Transformers/ReplicableTransformer.d.ts.map +1 -0
- package/Transformers/ReplicableTransformer.js +427 -0
- package/package.json +4 -3
- package/tsconfig.build.libs.tsbuildinfo +1 -1
- package/tsconfig.build.src.tsbuildinfo +1 -1
- package/tsconfig.json +4 -5
- package/Transformers/Qdrant.d.ts +0 -18
- package/Transformers/Qdrant.d.ts.map +0 -1
- package/Transformers/Qdrant.js +0 -148
package/Transformers/Qdrant.js
DELETED
|
@@ -1,148 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
-
});
|
|
10
|
-
};
|
|
11
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
exports.Qdrant = void 0;
|
|
13
|
-
const ts = require("typescript");
|
|
14
|
-
const Crawler_js_1 = require("../Source/ASTInterface/Crawler.js");
|
|
15
|
-
const ASTHelper_js_1 = require("../Source/ASTHelper.js");
|
|
16
|
-
const axios_1 = require("axios");
|
|
17
|
-
var chunks = new Map();
|
|
18
|
-
var Qdrant;
|
|
19
|
-
(function (Qdrant) {
|
|
20
|
-
Qdrant.port = "6333";
|
|
21
|
-
function sendDefinition(chunk) {
|
|
22
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
23
|
-
let payload = {
|
|
24
|
-
filePath: chunk.filePath,
|
|
25
|
-
symbolType: chunk.symbolType,
|
|
26
|
-
access: chunk.access,
|
|
27
|
-
modifiers: chunk.modifiers,
|
|
28
|
-
name: chunk.name,
|
|
29
|
-
metadata: chunk.metadata,
|
|
30
|
-
text: chunk.text,
|
|
31
|
-
};
|
|
32
|
-
const response = yield axios_1.default.post("http://localhost:1235/v1/embeddings", {
|
|
33
|
-
model: "qwen3-embedding-8b", // required, even if ignored
|
|
34
|
-
input: chunk.text,
|
|
35
|
-
}, {
|
|
36
|
-
headers: { "Content-Type": "application/json" }
|
|
37
|
-
});
|
|
38
|
-
console.log(response);
|
|
39
|
-
yield axios_1.default.put(`http://localhost:${Qdrant.port}/collections/my_codebase_vectors/points`, {
|
|
40
|
-
points: [
|
|
41
|
-
{
|
|
42
|
-
id: chunk.id,
|
|
43
|
-
vector: response.data[0].embedding, // Assuming the response contains an array of embeddings
|
|
44
|
-
payload
|
|
45
|
-
}
|
|
46
|
-
]
|
|
47
|
-
});
|
|
48
|
-
});
|
|
49
|
-
}
|
|
50
|
-
Qdrant.sendDefinition = sendDefinition;
|
|
51
|
-
})(Qdrant || (exports.Qdrant = Qdrant = {}));
|
|
52
|
-
function hasExportModifier(node) {
|
|
53
|
-
var _a, _b;
|
|
54
|
-
return (_b = (_a = node.modifiers) === null || _a === void 0 ? void 0 : _a.some((m) => m.kind === ts.SyntaxKind.ExportKeyword)) !== null && _b !== void 0 ? _b : false;
|
|
55
|
-
}
|
|
56
|
-
function isNotPrivate(node) {
|
|
57
|
-
var _a;
|
|
58
|
-
return (_a = node.modifiers) === null || _a === void 0 ? void 0 : _a.every((m) => m.kind !== ts.SyntaxKind.PrivateKeyword);
|
|
59
|
-
}
|
|
60
|
-
function isProtected(node) {
|
|
61
|
-
var _a;
|
|
62
|
-
return (_a = node.modifiers) === null || _a === void 0 ? void 0 : _a.every((m) => m.kind !== ts.SyntaxKind.ProtectedKeyword);
|
|
63
|
-
}
|
|
64
|
-
Crawler_js_1.Crawler.OnFile((file) => __awaiter(void 0, void 0, void 0, function* () {
|
|
65
|
-
if (chunks.size > 0) {
|
|
66
|
-
for (let chunk of chunks.values()) {
|
|
67
|
-
yield Qdrant.sendDefinition(chunk);
|
|
68
|
-
}
|
|
69
|
-
chunks.clear();
|
|
70
|
-
}
|
|
71
|
-
}));
|
|
72
|
-
Crawler_js_1.Crawler.Register((node) => {
|
|
73
|
-
// True is if it should be evaluated, false is if it should be skipped.
|
|
74
|
-
if (ts.isClassDeclaration(node) && hasExportModifier(node)) {
|
|
75
|
-
return true;
|
|
76
|
-
}
|
|
77
|
-
if (ts.isMethodDeclaration(node) && hasExportModifier(node.parent) && isNotPrivate(node)) {
|
|
78
|
-
return true;
|
|
79
|
-
}
|
|
80
|
-
if (ts.isPropertyDeclaration(node) && hasExportModifier(node.parent) && isProtected(node)) {
|
|
81
|
-
return true;
|
|
82
|
-
}
|
|
83
|
-
if (ts.isFunctionDeclaration(node) && hasExportModifier(node)) {
|
|
84
|
-
return true;
|
|
85
|
-
}
|
|
86
|
-
return false;
|
|
87
|
-
}, (node) => {
|
|
88
|
-
var _a, _b, _c;
|
|
89
|
-
let fileName = Crawler_js_1.Crawler.GetFile().ts.fileName;
|
|
90
|
-
//Operates on nodes that passed the checks in the previous function.
|
|
91
|
-
if (ts.isClassDeclaration(node)) {
|
|
92
|
-
chunks.set(node, {
|
|
93
|
-
id: `class:${fileName}:${node.name}`,
|
|
94
|
-
filePath: fileName,
|
|
95
|
-
name: node.name.text,
|
|
96
|
-
symbolType: "class",
|
|
97
|
-
access: "public",
|
|
98
|
-
text: (0, ASTHelper_js_1.getNodeText)(node, Crawler_js_1.Crawler.GetFile().ts),
|
|
99
|
-
metadata: {
|
|
100
|
-
methods: [],
|
|
101
|
-
properties: [],
|
|
102
|
-
},
|
|
103
|
-
});
|
|
104
|
-
}
|
|
105
|
-
if (ts.isMethodDeclaration(node)) {
|
|
106
|
-
let id = `method:${fileName}:${node.name.getText()}`;
|
|
107
|
-
let klass = chunks.get(node.parent);
|
|
108
|
-
klass.metadata.methods.push(id);
|
|
109
|
-
chunks.set(node, {
|
|
110
|
-
id: id,
|
|
111
|
-
filePath: fileName,
|
|
112
|
-
name: node.name.getText(),
|
|
113
|
-
symbolType: "method",
|
|
114
|
-
access: isProtected(node) ? "protected" : "public",
|
|
115
|
-
text: (0, ASTHelper_js_1.getNodeText)(node, Crawler_js_1.Crawler.GetFile().ts),
|
|
116
|
-
metadata: { class: klass.id, className: klass.name },
|
|
117
|
-
});
|
|
118
|
-
}
|
|
119
|
-
if (ts.isPropertyDeclaration(node)) {
|
|
120
|
-
let id = `property:${fileName}:${node.name.getText()}`;
|
|
121
|
-
let klass = chunks.get(node.parent);
|
|
122
|
-
klass.metadata.properties.push(id);
|
|
123
|
-
chunks.set(node, {
|
|
124
|
-
id: id,
|
|
125
|
-
filePath: fileName,
|
|
126
|
-
name: node.name.getText(),
|
|
127
|
-
symbolType: "property",
|
|
128
|
-
access: isProtected(node) ? "protected" : "public",
|
|
129
|
-
modifiers: ((_a = node.modifiers) === null || _a === void 0 ? void 0 : _a.some((m) => m.kind === ts.SyntaxKind.ReadonlyKeyword)) ? "readonly" : undefined,
|
|
130
|
-
text: (0, ASTHelper_js_1.getNodeText)(node, Crawler_js_1.Crawler.GetFile().ts),
|
|
131
|
-
metadata: { class: klass.id, className: klass.name },
|
|
132
|
-
});
|
|
133
|
-
}
|
|
134
|
-
if (ts.isFunctionDeclaration(node)) {
|
|
135
|
-
chunks.set(node, {
|
|
136
|
-
id: `function:${fileName}:${(_c = (_b = node.name) === null || _b === void 0 ? void 0 : _b.getText()) !== null && _c !== void 0 ? _c : "default"}`,
|
|
137
|
-
filePath: fileName,
|
|
138
|
-
name: node.name.text,
|
|
139
|
-
symbolType: "function",
|
|
140
|
-
access: "public",
|
|
141
|
-
text: (0, ASTHelper_js_1.getNodeText)(node, Crawler_js_1.Crawler.GetFile().ts),
|
|
142
|
-
metadata: {},
|
|
143
|
-
});
|
|
144
|
-
}
|
|
145
|
-
//No transforms needed.
|
|
146
|
-
return node;
|
|
147
|
-
});
|
|
148
|
-
//# sourceMappingURL=Qdrant.js.map
|