@vibedrift/cli 0.4.4 → 0.4.5
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/dist/index.js +20 -33
- package/dist/index.js.map +1 -1
- package/package.json +1 -2
package/dist/index.js
CHANGED
|
@@ -24,6 +24,7 @@ __export(function_extractor_exports, {
|
|
|
24
24
|
extractAllFunctions: () => extractAllFunctions,
|
|
25
25
|
extractFunctionsFromFile: () => extractFunctionsFromFile,
|
|
26
26
|
simpleHash: () => simpleHash,
|
|
27
|
+
toFunctionRef: () => toFunctionRef,
|
|
27
28
|
tokenizeBody: () => tokenizeBody
|
|
28
29
|
});
|
|
29
30
|
function detectDomainCategory(name, body) {
|
|
@@ -149,6 +150,9 @@ function extractAllFunctions(files) {
|
|
|
149
150
|
}
|
|
150
151
|
return allFunctions;
|
|
151
152
|
}
|
|
153
|
+
function toFunctionRef(fn) {
|
|
154
|
+
return { file: fn.file, relativePath: fn.relativePath, name: fn.name, line: fn.line };
|
|
155
|
+
}
|
|
152
156
|
var init_function_extractor = __esm({
|
|
153
157
|
"src/codedna/function-extractor.ts"() {
|
|
154
158
|
"use strict";
|
|
@@ -254,12 +258,9 @@ function fnv1aHash(str) {
|
|
|
254
258
|
const h2 = (hash2 >>> 0).toString(16).padStart(8, "0");
|
|
255
259
|
return h1 + h2;
|
|
256
260
|
}
|
|
257
|
-
function toRef(fn) {
|
|
258
|
-
return { file: fn.file, relativePath: fn.relativePath, name: fn.name, line: fn.line };
|
|
259
|
-
}
|
|
260
261
|
function computeSemanticFingerprints(functions) {
|
|
261
262
|
return functions.map((fn) => ({
|
|
262
|
-
functionRef:
|
|
263
|
+
functionRef: toFunctionRef(fn),
|
|
263
264
|
normalizedHash: fnv1aHash(normalizeBody(fn.rawBody, fn.language))
|
|
264
265
|
}));
|
|
265
266
|
}
|
|
@@ -321,6 +322,7 @@ var init_semantic_fingerprint = __esm({
|
|
|
321
322
|
"src/codedna/semantic-fingerprint.ts"() {
|
|
322
323
|
"use strict";
|
|
323
324
|
init_esm_shims();
|
|
325
|
+
init_function_extractor();
|
|
324
326
|
}
|
|
325
327
|
});
|
|
326
328
|
|
|
@@ -366,9 +368,6 @@ function classifyLine(line, language) {
|
|
|
366
368
|
}
|
|
367
369
|
return null;
|
|
368
370
|
}
|
|
369
|
-
function toRef2(fn) {
|
|
370
|
-
return { file: fn.file, relativePath: fn.relativePath, name: fn.name, line: fn.line };
|
|
371
|
-
}
|
|
372
371
|
function extractOperationSequences(functions) {
|
|
373
372
|
return functions.map((fn) => {
|
|
374
373
|
const lines = fn.rawBody.split("\n");
|
|
@@ -381,7 +380,7 @@ function extractOperationSequences(functions) {
|
|
|
381
380
|
}
|
|
382
381
|
}
|
|
383
382
|
}
|
|
384
|
-
return { functionRef:
|
|
383
|
+
return { functionRef: toFunctionRef(fn), sequence };
|
|
385
384
|
});
|
|
386
385
|
}
|
|
387
386
|
function lcsLength(a, b) {
|
|
@@ -456,6 +455,7 @@ var init_operation_sequence = __esm({
|
|
|
456
455
|
"src/codedna/operation-sequence.ts"() {
|
|
457
456
|
"use strict";
|
|
458
457
|
init_esm_shims();
|
|
458
|
+
init_function_extractor();
|
|
459
459
|
}
|
|
460
460
|
});
|
|
461
461
|
|
|
@@ -4967,9 +4967,6 @@ var DRIFT_WEIGHTS = {
|
|
|
4967
4967
|
|
|
4968
4968
|
// src/drift/architectural-contradiction.ts
|
|
4969
4969
|
init_esm_shims();
|
|
4970
|
-
function getLine(content, index) {
|
|
4971
|
-
return content.slice(0, index).split("\n").length;
|
|
4972
|
-
}
|
|
4973
4970
|
function getLineContent(content, lineNum) {
|
|
4974
4971
|
return (content.split("\n")[lineNum - 1] ?? "").trim();
|
|
4975
4972
|
}
|
|
@@ -4978,7 +4975,7 @@ function extractEvidence(content, pattern, maxResults = 3) {
|
|
|
4978
4975
|
const regex = new RegExp(pattern.source, pattern.flags);
|
|
4979
4976
|
let match;
|
|
4980
4977
|
while ((match = regex.exec(content)) !== null && evidence.length < maxResults) {
|
|
4981
|
-
const line =
|
|
4978
|
+
const line = getLineNumber(content, match.index);
|
|
4982
4979
|
evidence.push({ line, code: getLineContent(content, line) });
|
|
4983
4980
|
}
|
|
4984
4981
|
return evidence;
|
|
@@ -8042,6 +8039,16 @@ function previewToken(token) {
|
|
|
8042
8039
|
if (token.length <= 12) return token.slice(0, 4) + "\u2026";
|
|
8043
8040
|
return token.slice(0, 12) + "\u2026";
|
|
8044
8041
|
}
|
|
8042
|
+
function describeSource(source) {
|
|
8043
|
+
switch (source) {
|
|
8044
|
+
case "flag":
|
|
8045
|
+
return "command-line flag";
|
|
8046
|
+
case "env":
|
|
8047
|
+
return "VIBEDRIFT_TOKEN environment variable";
|
|
8048
|
+
case "config":
|
|
8049
|
+
return "~/.vibedrift/config.json";
|
|
8050
|
+
}
|
|
8051
|
+
}
|
|
8045
8052
|
|
|
8046
8053
|
// src/auth/api.ts
|
|
8047
8054
|
init_esm_shims();
|
|
@@ -8840,16 +8847,6 @@ async function runStatus() {
|
|
|
8840
8847
|
}
|
|
8841
8848
|
console.log("");
|
|
8842
8849
|
}
|
|
8843
|
-
function describeSource(source) {
|
|
8844
|
-
switch (source) {
|
|
8845
|
-
case "flag":
|
|
8846
|
-
return "command-line flag";
|
|
8847
|
-
case "env":
|
|
8848
|
-
return "VIBEDRIFT_TOKEN environment variable";
|
|
8849
|
-
case "config":
|
|
8850
|
-
return "~/.vibedrift/config.json";
|
|
8851
|
-
}
|
|
8852
|
-
}
|
|
8853
8850
|
|
|
8854
8851
|
// src/cli/commands/usage.ts
|
|
8855
8852
|
init_esm_shims();
|
|
@@ -9046,7 +9043,7 @@ async function runDoctor() {
|
|
|
9046
9043
|
if (!resolved) {
|
|
9047
9044
|
info("Login state", "not logged in");
|
|
9048
9045
|
} else {
|
|
9049
|
-
ok("Token source",
|
|
9046
|
+
ok("Token source", describeSource(resolved.source));
|
|
9050
9047
|
ok("Token preview", previewToken(resolved.token));
|
|
9051
9048
|
if (resolved.source === "config") {
|
|
9052
9049
|
if (config.email) ok("Email", config.email);
|
|
@@ -9118,16 +9115,6 @@ function bad(value) {
|
|
|
9118
9115
|
function info(label, value) {
|
|
9119
9116
|
console.log(` ${chalk10.dim("\xB7")} ${label.padEnd(14)} ${chalk10.dim(value)}`);
|
|
9120
9117
|
}
|
|
9121
|
-
function describeSource2(source) {
|
|
9122
|
-
switch (source) {
|
|
9123
|
-
case "flag":
|
|
9124
|
-
return "command-line flag";
|
|
9125
|
-
case "env":
|
|
9126
|
-
return "VIBEDRIFT_TOKEN environment variable";
|
|
9127
|
-
case "config":
|
|
9128
|
-
return "~/.vibedrift/config.json";
|
|
9129
|
-
}
|
|
9130
|
-
}
|
|
9131
9118
|
|
|
9132
9119
|
// src/cli/commands/feedback.ts
|
|
9133
9120
|
init_esm_shims();
|