@qulib/core 0.2.1 → 0.3.0
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/README.md +45 -3
- package/dist/analyze.d.ts +16 -4
- package/dist/analyze.d.ts.map +1 -1
- package/dist/analyze.js +98 -38
- package/dist/cli/cost-doctor.d.ts +2 -0
- package/dist/cli/cost-doctor.d.ts.map +1 -0
- package/dist/cli/cost-doctor.js +72 -0
- package/dist/cli/index.js +61 -0
- package/dist/harness/progress-log.d.ts +7 -0
- package/dist/harness/progress-log.d.ts.map +1 -0
- package/dist/harness/progress-log.js +1 -0
- package/dist/harness/run-options.d.ts +2 -0
- package/dist/harness/run-options.d.ts.map +1 -1
- package/dist/index.d.ts +6 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -0
- package/dist/llm/content-hash.d.ts +2 -0
- package/dist/llm/content-hash.d.ts.map +1 -0
- package/dist/llm/content-hash.js +4 -0
- package/dist/llm/context-builder.js +1 -1
- package/dist/llm/cost-intelligence.d.ts +29 -0
- package/dist/llm/cost-intelligence.d.ts.map +1 -0
- package/dist/llm/cost-intelligence.js +153 -0
- package/dist/llm/provider.d.ts +11 -1
- package/dist/llm/provider.d.ts.map +1 -1
- package/dist/llm/provider.js +43 -4
- package/dist/phases/act.d.ts.map +1 -1
- package/dist/phases/act.js +4 -1
- package/dist/phases/observe.js +1 -1
- package/dist/phases/think-finalize.d.ts +6 -0
- package/dist/phases/think-finalize.d.ts.map +1 -0
- package/dist/phases/think-finalize.js +164 -0
- package/dist/phases/think.d.ts +2 -0
- package/dist/phases/think.d.ts.map +1 -1
- package/dist/phases/think.js +16 -65
- package/dist/reporters/markdown-reporter.d.ts.map +1 -1
- package/dist/reporters/markdown-reporter.js +23 -3
- package/dist/schemas/config.schema.d.ts +364 -0
- package/dist/schemas/config.schema.d.ts.map +1 -1
- package/dist/schemas/config.schema.js +55 -1
- package/dist/schemas/cost-intelligence.schema.d.ts +229 -0
- package/dist/schemas/cost-intelligence.schema.d.ts.map +1 -0
- package/dist/schemas/cost-intelligence.schema.js +41 -0
- package/dist/schemas/decision-log.schema.d.ts +2 -2
- package/dist/schemas/gap-analysis.schema.d.ts +288 -49
- package/dist/schemas/gap-analysis.schema.d.ts.map +1 -1
- package/dist/schemas/gap-analysis.schema.js +7 -3
- package/dist/schemas/index.d.ts +3 -1
- package/dist/schemas/index.d.ts.map +1 -1
- package/dist/schemas/index.js +3 -1
- package/dist/schemas/public-surface.schema.d.ts +268 -0
- package/dist/schemas/public-surface.schema.d.ts.map +1 -0
- package/dist/schemas/public-surface.schema.js +15 -0
- package/dist/schemas/repo-analysis.schema.d.ts +6 -6
- package/dist/tools/auth-block-gap.d.ts +3 -0
- package/dist/tools/auth-block-gap.d.ts.map +1 -0
- package/dist/tools/auth-block-gap.js +19 -0
- package/dist/tools/auth-detector.d.ts +2 -1
- package/dist/tools/auth-detector.d.ts.map +1 -1
- package/dist/tools/auth-detector.js +28 -3
- package/dist/tools/auth-explorer.d.ts +4 -0
- package/dist/tools/auth-explorer.d.ts.map +1 -0
- package/dist/tools/auth-explorer.js +346 -0
- package/dist/tools/auth-surface-analyzer.d.ts +4 -0
- package/dist/tools/auth-surface-analyzer.d.ts.map +1 -0
- package/dist/tools/auth-surface-analyzer.js +154 -0
- package/dist/tools/cypress-explorer.d.ts +2 -1
- package/dist/tools/cypress-explorer.d.ts.map +1 -1
- package/dist/tools/cypress-explorer.js +1 -1
- package/dist/tools/explorer.interface.d.ts +2 -1
- package/dist/tools/explorer.interface.d.ts.map +1 -1
- package/dist/tools/gap-engine.d.ts +3 -1
- package/dist/tools/gap-engine.d.ts.map +1 -1
- package/dist/tools/gap-engine.js +39 -12
- package/dist/tools/oauth-providers.d.ts +7 -0
- package/dist/tools/oauth-providers.d.ts.map +1 -0
- package/dist/tools/oauth-providers.js +21 -0
- package/dist/tools/playwright-explorer.d.ts +2 -1
- package/dist/tools/playwright-explorer.d.ts.map +1 -1
- package/dist/tools/playwright-explorer.js +21 -3
- package/dist/tools/public-surface.d.ts +5 -0
- package/dist/tools/public-surface.d.ts.map +1 -0
- package/dist/tools/public-surface.js +13 -0
- package/dist/tools/user-providers.d.ts +15 -0
- package/dist/tools/user-providers.d.ts.map +1 -0
- package/dist/tools/user-providers.js +62 -0
- package/package.json +6 -2
|
@@ -0,0 +1,229 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const LlmDataQualitySchema: z.ZodEnum<["actual", "estimated", "mixed", "none"]>;
|
|
3
|
+
export declare const LlmOperationTypeSchema: z.ZodEnum<["scenario-generation"]>;
|
|
4
|
+
export declare const LlmUsageRecordSchema: z.ZodObject<{
|
|
5
|
+
provider: z.ZodString;
|
|
6
|
+
model: z.ZodString;
|
|
7
|
+
inputTokens: z.ZodNumber;
|
|
8
|
+
outputTokens: z.ZodNumber;
|
|
9
|
+
estimatedCostUsd: z.ZodOptional<z.ZodNumber>;
|
|
10
|
+
operationType: z.ZodEnum<["scenario-generation"]>;
|
|
11
|
+
timestamp: z.ZodString;
|
|
12
|
+
promptHash: z.ZodOptional<z.ZodString>;
|
|
13
|
+
resultHash: z.ZodOptional<z.ZodString>;
|
|
14
|
+
dataQuality: z.ZodEnum<["actual", "estimated", "mixed", "none"]>;
|
|
15
|
+
notes: z.ZodOptional<z.ZodString>;
|
|
16
|
+
}, "strip", z.ZodTypeAny, {
|
|
17
|
+
provider: string;
|
|
18
|
+
model: string;
|
|
19
|
+
inputTokens: number;
|
|
20
|
+
outputTokens: number;
|
|
21
|
+
operationType: "scenario-generation";
|
|
22
|
+
timestamp: string;
|
|
23
|
+
dataQuality: "none" | "actual" | "estimated" | "mixed";
|
|
24
|
+
estimatedCostUsd?: number | undefined;
|
|
25
|
+
promptHash?: string | undefined;
|
|
26
|
+
resultHash?: string | undefined;
|
|
27
|
+
notes?: string | undefined;
|
|
28
|
+
}, {
|
|
29
|
+
provider: string;
|
|
30
|
+
model: string;
|
|
31
|
+
inputTokens: number;
|
|
32
|
+
outputTokens: number;
|
|
33
|
+
operationType: "scenario-generation";
|
|
34
|
+
timestamp: string;
|
|
35
|
+
dataQuality: "none" | "actual" | "estimated" | "mixed";
|
|
36
|
+
estimatedCostUsd?: number | undefined;
|
|
37
|
+
promptHash?: string | undefined;
|
|
38
|
+
resultHash?: string | undefined;
|
|
39
|
+
notes?: string | undefined;
|
|
40
|
+
}>;
|
|
41
|
+
export declare const RepeatedAiPatternSchema: z.ZodObject<{
|
|
42
|
+
promptHash: z.ZodString;
|
|
43
|
+
count: z.ZodNumber;
|
|
44
|
+
recommendation: z.ZodString;
|
|
45
|
+
}, "strip", z.ZodTypeAny, {
|
|
46
|
+
recommendation: string;
|
|
47
|
+
promptHash: string;
|
|
48
|
+
count: number;
|
|
49
|
+
}, {
|
|
50
|
+
recommendation: string;
|
|
51
|
+
promptHash: string;
|
|
52
|
+
count: number;
|
|
53
|
+
}>;
|
|
54
|
+
export declare const DeterministicMaturitySchema: z.ZodObject<{
|
|
55
|
+
level: z.ZodNumber;
|
|
56
|
+
label: z.ZodString;
|
|
57
|
+
rationale: z.ZodString;
|
|
58
|
+
ceilingNote: z.ZodOptional<z.ZodString>;
|
|
59
|
+
}, "strip", z.ZodTypeAny, {
|
|
60
|
+
label: string;
|
|
61
|
+
level: number;
|
|
62
|
+
rationale: string;
|
|
63
|
+
ceilingNote?: string | undefined;
|
|
64
|
+
}, {
|
|
65
|
+
label: string;
|
|
66
|
+
level: number;
|
|
67
|
+
rationale: string;
|
|
68
|
+
ceilingNote?: string | undefined;
|
|
69
|
+
}>;
|
|
70
|
+
export declare const CostIntelligenceSchema: z.ZodObject<{
|
|
71
|
+
maxOutputTokensPerLlmCall: z.ZodNumber;
|
|
72
|
+
budgetRole: z.ZodLiteral<"max-output-tokens-per-llm-call">;
|
|
73
|
+
records: z.ZodArray<z.ZodObject<{
|
|
74
|
+
provider: z.ZodString;
|
|
75
|
+
model: z.ZodString;
|
|
76
|
+
inputTokens: z.ZodNumber;
|
|
77
|
+
outputTokens: z.ZodNumber;
|
|
78
|
+
estimatedCostUsd: z.ZodOptional<z.ZodNumber>;
|
|
79
|
+
operationType: z.ZodEnum<["scenario-generation"]>;
|
|
80
|
+
timestamp: z.ZodString;
|
|
81
|
+
promptHash: z.ZodOptional<z.ZodString>;
|
|
82
|
+
resultHash: z.ZodOptional<z.ZodString>;
|
|
83
|
+
dataQuality: z.ZodEnum<["actual", "estimated", "mixed", "none"]>;
|
|
84
|
+
notes: z.ZodOptional<z.ZodString>;
|
|
85
|
+
}, "strip", z.ZodTypeAny, {
|
|
86
|
+
provider: string;
|
|
87
|
+
model: string;
|
|
88
|
+
inputTokens: number;
|
|
89
|
+
outputTokens: number;
|
|
90
|
+
operationType: "scenario-generation";
|
|
91
|
+
timestamp: string;
|
|
92
|
+
dataQuality: "none" | "actual" | "estimated" | "mixed";
|
|
93
|
+
estimatedCostUsd?: number | undefined;
|
|
94
|
+
promptHash?: string | undefined;
|
|
95
|
+
resultHash?: string | undefined;
|
|
96
|
+
notes?: string | undefined;
|
|
97
|
+
}, {
|
|
98
|
+
provider: string;
|
|
99
|
+
model: string;
|
|
100
|
+
inputTokens: number;
|
|
101
|
+
outputTokens: number;
|
|
102
|
+
operationType: "scenario-generation";
|
|
103
|
+
timestamp: string;
|
|
104
|
+
dataQuality: "none" | "actual" | "estimated" | "mixed";
|
|
105
|
+
estimatedCostUsd?: number | undefined;
|
|
106
|
+
promptHash?: string | undefined;
|
|
107
|
+
resultHash?: string | undefined;
|
|
108
|
+
notes?: string | undefined;
|
|
109
|
+
}>, "many">;
|
|
110
|
+
budgetWarnings: z.ZodArray<z.ZodString, "many">;
|
|
111
|
+
usageSummary: z.ZodObject<{
|
|
112
|
+
totalInputTokens: z.ZodNumber;
|
|
113
|
+
totalOutputTokens: z.ZodNumber;
|
|
114
|
+
dataQuality: z.ZodEnum<["actual", "estimated", "mixed", "none"]>;
|
|
115
|
+
}, "strip", z.ZodTypeAny, {
|
|
116
|
+
dataQuality: "none" | "actual" | "estimated" | "mixed";
|
|
117
|
+
totalInputTokens: number;
|
|
118
|
+
totalOutputTokens: number;
|
|
119
|
+
}, {
|
|
120
|
+
dataQuality: "none" | "actual" | "estimated" | "mixed";
|
|
121
|
+
totalInputTokens: number;
|
|
122
|
+
totalOutputTokens: number;
|
|
123
|
+
}>;
|
|
124
|
+
repeatedOperations: z.ZodArray<z.ZodObject<{
|
|
125
|
+
promptHash: z.ZodString;
|
|
126
|
+
count: z.ZodNumber;
|
|
127
|
+
recommendation: z.ZodString;
|
|
128
|
+
}, "strip", z.ZodTypeAny, {
|
|
129
|
+
recommendation: string;
|
|
130
|
+
promptHash: string;
|
|
131
|
+
count: number;
|
|
132
|
+
}, {
|
|
133
|
+
recommendation: string;
|
|
134
|
+
promptHash: string;
|
|
135
|
+
count: number;
|
|
136
|
+
}>, "many">;
|
|
137
|
+
deterministicMaturity: z.ZodObject<{
|
|
138
|
+
level: z.ZodNumber;
|
|
139
|
+
label: z.ZodString;
|
|
140
|
+
rationale: z.ZodString;
|
|
141
|
+
ceilingNote: z.ZodOptional<z.ZodString>;
|
|
142
|
+
}, "strip", z.ZodTypeAny, {
|
|
143
|
+
label: string;
|
|
144
|
+
level: number;
|
|
145
|
+
rationale: string;
|
|
146
|
+
ceilingNote?: string | undefined;
|
|
147
|
+
}, {
|
|
148
|
+
label: string;
|
|
149
|
+
level: number;
|
|
150
|
+
rationale: string;
|
|
151
|
+
ceilingNote?: string | undefined;
|
|
152
|
+
}>;
|
|
153
|
+
conversionRecommendations: z.ZodArray<z.ZodString, "many">;
|
|
154
|
+
}, "strip", z.ZodTypeAny, {
|
|
155
|
+
maxOutputTokensPerLlmCall: number;
|
|
156
|
+
budgetRole: "max-output-tokens-per-llm-call";
|
|
157
|
+
records: {
|
|
158
|
+
provider: string;
|
|
159
|
+
model: string;
|
|
160
|
+
inputTokens: number;
|
|
161
|
+
outputTokens: number;
|
|
162
|
+
operationType: "scenario-generation";
|
|
163
|
+
timestamp: string;
|
|
164
|
+
dataQuality: "none" | "actual" | "estimated" | "mixed";
|
|
165
|
+
estimatedCostUsd?: number | undefined;
|
|
166
|
+
promptHash?: string | undefined;
|
|
167
|
+
resultHash?: string | undefined;
|
|
168
|
+
notes?: string | undefined;
|
|
169
|
+
}[];
|
|
170
|
+
budgetWarnings: string[];
|
|
171
|
+
usageSummary: {
|
|
172
|
+
dataQuality: "none" | "actual" | "estimated" | "mixed";
|
|
173
|
+
totalInputTokens: number;
|
|
174
|
+
totalOutputTokens: number;
|
|
175
|
+
};
|
|
176
|
+
repeatedOperations: {
|
|
177
|
+
recommendation: string;
|
|
178
|
+
promptHash: string;
|
|
179
|
+
count: number;
|
|
180
|
+
}[];
|
|
181
|
+
deterministicMaturity: {
|
|
182
|
+
label: string;
|
|
183
|
+
level: number;
|
|
184
|
+
rationale: string;
|
|
185
|
+
ceilingNote?: string | undefined;
|
|
186
|
+
};
|
|
187
|
+
conversionRecommendations: string[];
|
|
188
|
+
}, {
|
|
189
|
+
maxOutputTokensPerLlmCall: number;
|
|
190
|
+
budgetRole: "max-output-tokens-per-llm-call";
|
|
191
|
+
records: {
|
|
192
|
+
provider: string;
|
|
193
|
+
model: string;
|
|
194
|
+
inputTokens: number;
|
|
195
|
+
outputTokens: number;
|
|
196
|
+
operationType: "scenario-generation";
|
|
197
|
+
timestamp: string;
|
|
198
|
+
dataQuality: "none" | "actual" | "estimated" | "mixed";
|
|
199
|
+
estimatedCostUsd?: number | undefined;
|
|
200
|
+
promptHash?: string | undefined;
|
|
201
|
+
resultHash?: string | undefined;
|
|
202
|
+
notes?: string | undefined;
|
|
203
|
+
}[];
|
|
204
|
+
budgetWarnings: string[];
|
|
205
|
+
usageSummary: {
|
|
206
|
+
dataQuality: "none" | "actual" | "estimated" | "mixed";
|
|
207
|
+
totalInputTokens: number;
|
|
208
|
+
totalOutputTokens: number;
|
|
209
|
+
};
|
|
210
|
+
repeatedOperations: {
|
|
211
|
+
recommendation: string;
|
|
212
|
+
promptHash: string;
|
|
213
|
+
count: number;
|
|
214
|
+
}[];
|
|
215
|
+
deterministicMaturity: {
|
|
216
|
+
label: string;
|
|
217
|
+
level: number;
|
|
218
|
+
rationale: string;
|
|
219
|
+
ceilingNote?: string | undefined;
|
|
220
|
+
};
|
|
221
|
+
conversionRecommendations: string[];
|
|
222
|
+
}>;
|
|
223
|
+
export type LlmDataQuality = z.infer<typeof LlmDataQualitySchema>;
|
|
224
|
+
export type LlmOperationType = z.infer<typeof LlmOperationTypeSchema>;
|
|
225
|
+
export type LlmUsageRecord = z.infer<typeof LlmUsageRecordSchema>;
|
|
226
|
+
export type RepeatedAiPattern = z.infer<typeof RepeatedAiPatternSchema>;
|
|
227
|
+
export type DeterministicMaturity = z.infer<typeof DeterministicMaturitySchema>;
|
|
228
|
+
export type CostIntelligence = z.infer<typeof CostIntelligenceSchema>;
|
|
229
|
+
//# sourceMappingURL=cost-intelligence.schema.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cost-intelligence.schema.d.ts","sourceRoot":"","sources":["../../src/schemas/cost-intelligence.schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,eAAO,MAAM,oBAAoB,qDAAmD,CAAC;AAErF,eAAO,MAAM,sBAAsB,oCAAkC,CAAC;AAEtE,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAY/B,CAAC;AAEH,eAAO,MAAM,uBAAuB;;;;;;;;;;;;EAIlC,CAAC;AAEH,eAAO,MAAM,2BAA2B;;;;;;;;;;;;;;;EAKtC,CAAC;AAEH,eAAO,MAAM,sBAAsB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAajC,CAAC;AAEH,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAC;AAClE,MAAM,MAAM,gBAAgB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,sBAAsB,CAAC,CAAC;AACtE,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAC;AAClE,MAAM,MAAM,iBAAiB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,uBAAuB,CAAC,CAAC;AACxE,MAAM,MAAM,qBAAqB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,2BAA2B,CAAC,CAAC;AAChF,MAAM,MAAM,gBAAgB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,sBAAsB,CAAC,CAAC"}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export const LlmDataQualitySchema = z.enum(['actual', 'estimated', 'mixed', 'none']);
|
|
3
|
+
export const LlmOperationTypeSchema = z.enum(['scenario-generation']);
|
|
4
|
+
export const LlmUsageRecordSchema = z.object({
|
|
5
|
+
provider: z.string(),
|
|
6
|
+
model: z.string(),
|
|
7
|
+
inputTokens: z.number().int().min(0),
|
|
8
|
+
outputTokens: z.number().int().min(0),
|
|
9
|
+
estimatedCostUsd: z.number().optional(),
|
|
10
|
+
operationType: LlmOperationTypeSchema,
|
|
11
|
+
timestamp: z.string().datetime(),
|
|
12
|
+
promptHash: z.string().optional(),
|
|
13
|
+
resultHash: z.string().optional(),
|
|
14
|
+
dataQuality: LlmDataQualitySchema,
|
|
15
|
+
notes: z.string().optional(),
|
|
16
|
+
});
|
|
17
|
+
export const RepeatedAiPatternSchema = z.object({
|
|
18
|
+
promptHash: z.string(),
|
|
19
|
+
count: z.number().int().min(2),
|
|
20
|
+
recommendation: z.string(),
|
|
21
|
+
});
|
|
22
|
+
export const DeterministicMaturitySchema = z.object({
|
|
23
|
+
level: z.number().int().min(0).max(5),
|
|
24
|
+
label: z.string(),
|
|
25
|
+
rationale: z.string(),
|
|
26
|
+
ceilingNote: z.string().optional(),
|
|
27
|
+
});
|
|
28
|
+
export const CostIntelligenceSchema = z.object({
|
|
29
|
+
maxOutputTokensPerLlmCall: z.number().int().positive(),
|
|
30
|
+
budgetRole: z.literal('max-output-tokens-per-llm-call'),
|
|
31
|
+
records: z.array(LlmUsageRecordSchema),
|
|
32
|
+
budgetWarnings: z.array(z.string()),
|
|
33
|
+
usageSummary: z.object({
|
|
34
|
+
totalInputTokens: z.number().int().min(0),
|
|
35
|
+
totalOutputTokens: z.number().int().min(0),
|
|
36
|
+
dataQuality: LlmDataQualitySchema,
|
|
37
|
+
}),
|
|
38
|
+
repeatedOperations: z.array(RepeatedAiPatternSchema),
|
|
39
|
+
deterministicMaturity: DeterministicMaturitySchema,
|
|
40
|
+
conversionRecommendations: z.array(z.string()),
|
|
41
|
+
});
|
|
@@ -6,14 +6,14 @@ export declare const DecisionLogEntrySchema: z.ZodObject<{
|
|
|
6
6
|
reason: z.ZodString;
|
|
7
7
|
metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
8
8
|
}, "strip", z.ZodTypeAny, {
|
|
9
|
-
reason: string;
|
|
10
9
|
timestamp: string;
|
|
10
|
+
reason: string;
|
|
11
11
|
phase: "observe" | "think" | "act" | "harness";
|
|
12
12
|
decision: string;
|
|
13
13
|
metadata?: Record<string, unknown> | undefined;
|
|
14
14
|
}, {
|
|
15
|
-
reason: string;
|
|
16
15
|
timestamp: string;
|
|
16
|
+
reason: string;
|
|
17
17
|
phase: "observe" | "think" | "act" | "harness";
|
|
18
18
|
decision: string;
|
|
19
19
|
metadata?: Record<string, unknown> | undefined;
|