@aiready/core 0.19.3 → 0.19.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/chunk-QAFB3HXQ.mjs +574 -0
- package/dist/client.d.mts +33 -46
- package/dist/client.d.ts +33 -46
- package/dist/client.js +75 -36
- package/dist/client.mjs +7 -1
- package/dist/index.d.mts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +75 -36
- package/dist/index.mjs +7 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -37,6 +37,7 @@ __export(index_exports, {
|
|
|
37
37
|
DEFAULT_COST_CONFIG: () => DEFAULT_COST_CONFIG,
|
|
38
38
|
DEFAULT_EXCLUDE: () => DEFAULT_EXCLUDE,
|
|
39
39
|
DEFAULT_TOOL_WEIGHTS: () => DEFAULT_TOOL_WEIGHTS,
|
|
40
|
+
FRIENDLY_TOOL_NAMES: () => FRIENDLY_TOOL_NAMES,
|
|
40
41
|
IssueSchema: () => IssueSchema,
|
|
41
42
|
IssueType: () => IssueType,
|
|
42
43
|
IssueTypeSchema: () => IssueTypeSchema,
|
|
@@ -56,6 +57,8 @@ __export(index_exports, {
|
|
|
56
57
|
SeveritySchema: () => SeveritySchema,
|
|
57
58
|
SpokeOutputSchema: () => SpokeOutputSchema,
|
|
58
59
|
TOOL_NAME_MAP: () => TOOL_NAME_MAP,
|
|
60
|
+
ToolName: () => ToolName,
|
|
61
|
+
ToolNameSchema: () => ToolNameSchema,
|
|
59
62
|
TypeScriptParser: () => TypeScriptParser,
|
|
60
63
|
UnifiedReportSchema: () => UnifiedReportSchema,
|
|
61
64
|
VAGUE_FILE_NAMES: () => VAGUE_FILE_NAMES,
|
|
@@ -145,6 +148,38 @@ var Severity = /* @__PURE__ */ ((Severity2) => {
|
|
|
145
148
|
return Severity2;
|
|
146
149
|
})(Severity || {});
|
|
147
150
|
var SeveritySchema = import_zod.z.nativeEnum(Severity);
|
|
151
|
+
var ToolName = /* @__PURE__ */ ((ToolName2) => {
|
|
152
|
+
ToolName2["PatternDetect"] = "pattern-detect";
|
|
153
|
+
ToolName2["ContextAnalyzer"] = "context-analyzer";
|
|
154
|
+
ToolName2["NamingConsistency"] = "naming-consistency";
|
|
155
|
+
ToolName2["AiSignalClarity"] = "ai-signal-clarity";
|
|
156
|
+
ToolName2["AgentGrounding"] = "agent-grounding";
|
|
157
|
+
ToolName2["TestabilityIndex"] = "testability-index";
|
|
158
|
+
ToolName2["DocDrift"] = "doc-drift";
|
|
159
|
+
ToolName2["DependencyHealth"] = "dependency-health";
|
|
160
|
+
ToolName2["ChangeAmplification"] = "change-amplification";
|
|
161
|
+
ToolName2["CognitiveLoad"] = "cognitive-load";
|
|
162
|
+
ToolName2["PatternEntropy"] = "pattern-entropy";
|
|
163
|
+
ToolName2["ConceptCohesion"] = "concept-cohesion";
|
|
164
|
+
ToolName2["SemanticDistance"] = "semantic-distance";
|
|
165
|
+
return ToolName2;
|
|
166
|
+
})(ToolName || {});
|
|
167
|
+
var ToolNameSchema = import_zod.z.nativeEnum(ToolName);
|
|
168
|
+
var FRIENDLY_TOOL_NAMES = {
|
|
169
|
+
["pattern-detect" /* PatternDetect */]: "Semantic Duplicates",
|
|
170
|
+
["context-analyzer" /* ContextAnalyzer */]: "Context Fragmentation",
|
|
171
|
+
["naming-consistency" /* NamingConsistency */]: "Naming Consistency",
|
|
172
|
+
["ai-signal-clarity" /* AiSignalClarity */]: "AI Signal Clarity",
|
|
173
|
+
["agent-grounding" /* AgentGrounding */]: "Agent Grounding",
|
|
174
|
+
["testability-index" /* TestabilityIndex */]: "Testability Index",
|
|
175
|
+
["doc-drift" /* DocDrift */]: "Documentation Health",
|
|
176
|
+
["dependency-health" /* DependencyHealth */]: "Dependency Health",
|
|
177
|
+
["change-amplification" /* ChangeAmplification */]: "Change Amplification",
|
|
178
|
+
["cognitive-load" /* CognitiveLoad */]: "Cognitive Load",
|
|
179
|
+
["pattern-entropy" /* PatternEntropy */]: "Pattern Entropy",
|
|
180
|
+
["concept-cohesion" /* ConceptCohesion */]: "Concept Cohesion",
|
|
181
|
+
["semantic-distance" /* SemanticDistance */]: "Semantic Distance"
|
|
182
|
+
};
|
|
148
183
|
var IssueType = /* @__PURE__ */ ((IssueType2) => {
|
|
149
184
|
IssueType2["DuplicatePattern"] = "duplicate-pattern";
|
|
150
185
|
IssueType2["PatternInconsistency"] = "pattern-inconsistency";
|
|
@@ -242,10 +277,12 @@ var UnifiedReportSchema = import_zod.z.object({
|
|
|
242
277
|
overall: import_zod.z.number(),
|
|
243
278
|
rating: import_zod.z.string(),
|
|
244
279
|
timestamp: import_zod.z.string(),
|
|
245
|
-
breakdown: import_zod.z.array(
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
280
|
+
breakdown: import_zod.z.array(
|
|
281
|
+
import_zod.z.object({
|
|
282
|
+
toolName: import_zod.z.union([ToolNameSchema, import_zod.z.string()]),
|
|
283
|
+
score: import_zod.z.number()
|
|
284
|
+
}).catchall(import_zod.z.any())
|
|
285
|
+
)
|
|
249
286
|
}).optional()
|
|
250
287
|
}).catchall(import_zod.z.any());
|
|
251
288
|
|
|
@@ -1035,28 +1072,34 @@ function generateHTML(graph) {
|
|
|
1035
1072
|
|
|
1036
1073
|
// src/scoring.ts
|
|
1037
1074
|
var DEFAULT_TOOL_WEIGHTS = {
|
|
1038
|
-
"pattern-detect": 22,
|
|
1039
|
-
"context-analyzer": 19,
|
|
1040
|
-
consistency: 14,
|
|
1041
|
-
"ai-signal-clarity": 11,
|
|
1042
|
-
"agent-grounding": 10,
|
|
1043
|
-
testability: 10,
|
|
1044
|
-
"doc-drift": 8,
|
|
1045
|
-
|
|
1075
|
+
["pattern-detect" /* PatternDetect */]: 22,
|
|
1076
|
+
["context-analyzer" /* ContextAnalyzer */]: 19,
|
|
1077
|
+
["naming-consistency" /* NamingConsistency */]: 14,
|
|
1078
|
+
["ai-signal-clarity" /* AiSignalClarity */]: 11,
|
|
1079
|
+
["agent-grounding" /* AgentGrounding */]: 10,
|
|
1080
|
+
["testability-index" /* TestabilityIndex */]: 10,
|
|
1081
|
+
["doc-drift" /* DocDrift */]: 8,
|
|
1082
|
+
["dependency-health" /* DependencyHealth */]: 6,
|
|
1083
|
+
["change-amplification" /* ChangeAmplification */]: 8
|
|
1046
1084
|
};
|
|
1047
1085
|
var TOOL_NAME_MAP = {
|
|
1048
|
-
patterns: "pattern-detect"
|
|
1049
|
-
|
|
1050
|
-
|
|
1051
|
-
"
|
|
1052
|
-
|
|
1053
|
-
|
|
1054
|
-
"
|
|
1055
|
-
|
|
1056
|
-
|
|
1057
|
-
"
|
|
1058
|
-
|
|
1059
|
-
|
|
1086
|
+
patterns: "pattern-detect" /* PatternDetect */,
|
|
1087
|
+
"pattern-detect": "pattern-detect" /* PatternDetect */,
|
|
1088
|
+
context: "context-analyzer" /* ContextAnalyzer */,
|
|
1089
|
+
"context-analyzer": "context-analyzer" /* ContextAnalyzer */,
|
|
1090
|
+
consistency: "naming-consistency" /* NamingConsistency */,
|
|
1091
|
+
"naming-consistency": "naming-consistency" /* NamingConsistency */,
|
|
1092
|
+
"ai-signal": "ai-signal-clarity" /* AiSignalClarity */,
|
|
1093
|
+
"ai-signal-clarity": "ai-signal-clarity" /* AiSignalClarity */,
|
|
1094
|
+
grounding: "agent-grounding" /* AgentGrounding */,
|
|
1095
|
+
"agent-grounding": "agent-grounding" /* AgentGrounding */,
|
|
1096
|
+
testability: "testability-index" /* TestabilityIndex */,
|
|
1097
|
+
"testability-index": "testability-index" /* TestabilityIndex */,
|
|
1098
|
+
"doc-drift": "doc-drift" /* DocDrift */,
|
|
1099
|
+
"deps-health": "dependency-health" /* DependencyHealth */,
|
|
1100
|
+
"dependency-health": "dependency-health" /* DependencyHealth */,
|
|
1101
|
+
"change-amp": "change-amplification" /* ChangeAmplification */,
|
|
1102
|
+
"change-amplification": "change-amplification" /* ChangeAmplification */
|
|
1060
1103
|
};
|
|
1061
1104
|
var CONTEXT_TIER_THRESHOLDS = {
|
|
1062
1105
|
compact: { idealTokens: 3e3, criticalTokens: 1e4, idealDepth: 4 },
|
|
@@ -1090,22 +1133,16 @@ function getRecommendedThreshold(fileCount, modelTier = "standard") {
|
|
|
1090
1133
|
return base + modelBonus;
|
|
1091
1134
|
}
|
|
1092
1135
|
function normalizeToolName(shortName) {
|
|
1093
|
-
return TOOL_NAME_MAP[shortName] || shortName;
|
|
1136
|
+
return TOOL_NAME_MAP[shortName.toLowerCase()] || shortName;
|
|
1094
1137
|
}
|
|
1095
1138
|
function getToolWeight(toolName, toolConfig, cliOverride) {
|
|
1096
|
-
if (cliOverride !== void 0)
|
|
1097
|
-
|
|
1098
|
-
}
|
|
1099
|
-
if (toolConfig?.scoreWeight !== void 0) {
|
|
1100
|
-
return toolConfig.scoreWeight;
|
|
1101
|
-
}
|
|
1139
|
+
if (cliOverride !== void 0) return cliOverride;
|
|
1140
|
+
if (toolConfig?.scoreWeight !== void 0) return toolConfig.scoreWeight;
|
|
1102
1141
|
return DEFAULT_TOOL_WEIGHTS[toolName] || 5;
|
|
1103
1142
|
}
|
|
1104
1143
|
function parseWeightString(weightStr) {
|
|
1105
1144
|
const weights = /* @__PURE__ */ new Map();
|
|
1106
|
-
if (!weightStr)
|
|
1107
|
-
return weights;
|
|
1108
|
-
}
|
|
1145
|
+
if (!weightStr) return weights;
|
|
1109
1146
|
const pairs = weightStr.split(",");
|
|
1110
1147
|
for (const pair of pairs) {
|
|
1111
1148
|
const [toolShortName, weightStr2] = pair.split(":");
|
|
@@ -1137,8 +1174,7 @@ function calculateOverallScore(toolOutputs, config, cliWeights) {
|
|
|
1137
1174
|
const calculationWeights = {};
|
|
1138
1175
|
for (const [toolName, output] of toolOutputs.entries()) {
|
|
1139
1176
|
const weight = weights.get(toolName) || 5;
|
|
1140
|
-
|
|
1141
|
-
weightedSum += weightedScore;
|
|
1177
|
+
weightedSum += output.score * weight;
|
|
1142
1178
|
totalWeight += weight;
|
|
1143
1179
|
toolsUsed.push(toolName);
|
|
1144
1180
|
calculationWeights[toolName] = weight;
|
|
@@ -3135,6 +3171,7 @@ function getRepoMetadata(directory) {
|
|
|
3135
3171
|
DEFAULT_COST_CONFIG,
|
|
3136
3172
|
DEFAULT_EXCLUDE,
|
|
3137
3173
|
DEFAULT_TOOL_WEIGHTS,
|
|
3174
|
+
FRIENDLY_TOOL_NAMES,
|
|
3138
3175
|
IssueSchema,
|
|
3139
3176
|
IssueType,
|
|
3140
3177
|
IssueTypeSchema,
|
|
@@ -3154,6 +3191,8 @@ function getRepoMetadata(directory) {
|
|
|
3154
3191
|
SeveritySchema,
|
|
3155
3192
|
SpokeOutputSchema,
|
|
3156
3193
|
TOOL_NAME_MAP,
|
|
3194
|
+
ToolName,
|
|
3195
|
+
ToolNameSchema,
|
|
3157
3196
|
TypeScriptParser,
|
|
3158
3197
|
UnifiedReportSchema,
|
|
3159
3198
|
VAGUE_FILE_NAMES,
|
package/dist/index.mjs
CHANGED
|
@@ -4,6 +4,7 @@ import {
|
|
|
4
4
|
AnalysisStatusSchema,
|
|
5
5
|
CONTEXT_TIER_THRESHOLDS,
|
|
6
6
|
DEFAULT_TOOL_WEIGHTS,
|
|
7
|
+
FRIENDLY_TOOL_NAMES,
|
|
7
8
|
IssueSchema,
|
|
8
9
|
IssueType,
|
|
9
10
|
IssueTypeSchema,
|
|
@@ -19,6 +20,8 @@ import {
|
|
|
19
20
|
SeveritySchema,
|
|
20
21
|
SpokeOutputSchema,
|
|
21
22
|
TOOL_NAME_MAP,
|
|
23
|
+
ToolName,
|
|
24
|
+
ToolNameSchema,
|
|
22
25
|
UnifiedReportSchema,
|
|
23
26
|
calculateOverallScore,
|
|
24
27
|
formatScore,
|
|
@@ -32,7 +35,7 @@ import {
|
|
|
32
35
|
getToolWeight,
|
|
33
36
|
normalizeToolName,
|
|
34
37
|
parseWeightString
|
|
35
|
-
} from "./chunk-
|
|
38
|
+
} from "./chunk-QAFB3HXQ.mjs";
|
|
36
39
|
|
|
37
40
|
// src/types/contract.ts
|
|
38
41
|
function validateSpokeOutput(toolName, output) {
|
|
@@ -2530,6 +2533,7 @@ export {
|
|
|
2530
2533
|
DEFAULT_COST_CONFIG,
|
|
2531
2534
|
DEFAULT_EXCLUDE,
|
|
2532
2535
|
DEFAULT_TOOL_WEIGHTS,
|
|
2536
|
+
FRIENDLY_TOOL_NAMES,
|
|
2533
2537
|
IssueSchema,
|
|
2534
2538
|
IssueType,
|
|
2535
2539
|
IssueTypeSchema,
|
|
@@ -2549,6 +2553,8 @@ export {
|
|
|
2549
2553
|
SeveritySchema,
|
|
2550
2554
|
SpokeOutputSchema,
|
|
2551
2555
|
TOOL_NAME_MAP,
|
|
2556
|
+
ToolName,
|
|
2557
|
+
ToolNameSchema,
|
|
2552
2558
|
TypeScriptParser,
|
|
2553
2559
|
UnifiedReportSchema,
|
|
2554
2560
|
VAGUE_FILE_NAMES,
|