@aiready/core 0.24.7 → 0.24.9
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-LRM26BOB.mjs +888 -0
- package/dist/client/index.d.mts +1 -1
- package/dist/client/index.d.ts +1 -1
- package/dist/client/index.js +158 -158
- package/dist/client/index.mjs +1 -1
- package/dist/index-DGbarGnr.d.mts +1307 -0
- package/dist/index-DGbarGnr.d.ts +1307 -0
- package/dist/index-DUnnB68N.d.mts +1307 -0
- package/dist/index-DUnnB68N.d.ts +1307 -0
- package/dist/index-McIRPbHO.d.mts +1307 -0
- package/dist/index-McIRPbHO.d.ts +1307 -0
- package/dist/index.d.mts +63 -63
- package/dist/index.d.ts +63 -63
- package/dist/index.js +175 -167
- package/dist/index.mjs +18 -10
- package/package.json +4 -2
package/dist/index.js
CHANGED
|
@@ -2214,66 +2214,8 @@ __export(index_exports, {
|
|
|
2214
2214
|
});
|
|
2215
2215
|
module.exports = __toCommonJS(index_exports);
|
|
2216
2216
|
|
|
2217
|
-
// src/types/business.ts
|
|
2218
|
-
var import_zod = require("zod");
|
|
2219
|
-
var LeadSource = /* @__PURE__ */ ((LeadSource2) => {
|
|
2220
|
-
LeadSource2["ClawMoreHero"] = "clawmore-hero";
|
|
2221
|
-
LeadSource2["ClawMoreWaitlist"] = "clawmore-waitlist";
|
|
2222
|
-
LeadSource2["ClawMoreBeta"] = "clawmore-beta";
|
|
2223
|
-
LeadSource2["AiReadyPlatform"] = "aiready-platform";
|
|
2224
|
-
return LeadSource2;
|
|
2225
|
-
})(LeadSource || {});
|
|
2226
|
-
var LeadSourceSchema = import_zod.z.nativeEnum(LeadSource);
|
|
2227
|
-
var LeadSchema = import_zod.z.object({
|
|
2228
|
-
id: import_zod.z.string(),
|
|
2229
|
-
email: import_zod.z.string().email(),
|
|
2230
|
-
name: import_zod.z.string().min(1),
|
|
2231
|
-
interest: import_zod.z.string().default("General"),
|
|
2232
|
-
notes: import_zod.z.string().optional(),
|
|
2233
|
-
timestamp: import_zod.z.string().datetime(),
|
|
2234
|
-
source: LeadSourceSchema,
|
|
2235
|
-
status: import_zod.z.enum(["new", "contacted", "qualified", "converted", "archived"]).default("new")
|
|
2236
|
-
});
|
|
2237
|
-
var LeadSubmissionSchema = LeadSchema.omit({
|
|
2238
|
-
id: true,
|
|
2239
|
-
timestamp: true,
|
|
2240
|
-
status: true
|
|
2241
|
-
});
|
|
2242
|
-
var ManagedAccountSchema = import_zod.z.object({
|
|
2243
|
-
id: import_zod.z.string(),
|
|
2244
|
-
// Internal UUID
|
|
2245
|
-
accountId: import_zod.z.string(),
|
|
2246
|
-
// AWS Account ID
|
|
2247
|
-
userId: import_zod.z.string(),
|
|
2248
|
-
// Owner (caopengau@gmail.com)
|
|
2249
|
-
stripeSubscriptionId: import_zod.z.string(),
|
|
2250
|
-
// AI Token Management
|
|
2251
|
-
tokenStrategy: import_zod.z.enum(["managed", "byok"]).default("managed"),
|
|
2252
|
-
byokConfig: import_zod.z.object({
|
|
2253
|
-
openaiKey: import_zod.z.string().optional(),
|
|
2254
|
-
anthropicKey: import_zod.z.string().optional(),
|
|
2255
|
-
openrouterKey: import_zod.z.string().optional()
|
|
2256
|
-
}).optional(),
|
|
2257
|
-
// Financials (in cents)
|
|
2258
|
-
baseFeeCents: import_zod.z.number().default(2900),
|
|
2259
|
-
includedComputeCents: import_zod.z.number().default(1500),
|
|
2260
|
-
// $15.00 AWS included
|
|
2261
|
-
includedTokenCents: import_zod.z.number().default(500),
|
|
2262
|
-
// $5.00 Managed Tokens included
|
|
2263
|
-
// Pre-paid Balance (credits)
|
|
2264
|
-
prepaidTokenBalanceCents: import_zod.z.number().default(0),
|
|
2265
|
-
// Users buy these in $10 packs
|
|
2266
|
-
currentMonthlyTokenSpendCents: import_zod.z.number().default(0),
|
|
2267
|
-
// Governance
|
|
2268
|
-
status: import_zod.z.enum(["provisioning", "active", "warning", "quarantined", "suspended"]).default("provisioning"),
|
|
2269
|
-
lastCostSyncAt: import_zod.z.string().datetime().optional(),
|
|
2270
|
-
region: import_zod.z.string().default("ap-southeast-2"),
|
|
2271
|
-
// Alerting thresholds (percentage of includedComputeCents)
|
|
2272
|
-
alertThresholds: import_zod.z.array(import_zod.z.number()).default([50, 80, 100, 150])
|
|
2273
|
-
});
|
|
2274
|
-
|
|
2275
2217
|
// src/types/enums.ts
|
|
2276
|
-
var
|
|
2218
|
+
var import_zod = require("zod");
|
|
2277
2219
|
var Severity = /* @__PURE__ */ ((Severity2) => {
|
|
2278
2220
|
Severity2["Critical"] = "critical";
|
|
2279
2221
|
Severity2["Major"] = "major";
|
|
@@ -2281,7 +2223,7 @@ var Severity = /* @__PURE__ */ ((Severity2) => {
|
|
|
2281
2223
|
Severity2["Info"] = "info";
|
|
2282
2224
|
return Severity2;
|
|
2283
2225
|
})(Severity || {});
|
|
2284
|
-
var SeveritySchema =
|
|
2226
|
+
var SeveritySchema = import_zod.z.nativeEnum(Severity);
|
|
2285
2227
|
var ToolName = /* @__PURE__ */ ((ToolName2) => {
|
|
2286
2228
|
ToolName2["PatternDetect"] = "pattern-detect";
|
|
2287
2229
|
ToolName2["ContextAnalyzer"] = "context-analyzer";
|
|
@@ -2299,7 +2241,7 @@ var ToolName = /* @__PURE__ */ ((ToolName2) => {
|
|
|
2299
2241
|
ToolName2["ContractEnforcement"] = "contract-enforcement";
|
|
2300
2242
|
return ToolName2;
|
|
2301
2243
|
})(ToolName || {});
|
|
2302
|
-
var ToolNameSchema =
|
|
2244
|
+
var ToolNameSchema = import_zod.z.nativeEnum(ToolName);
|
|
2303
2245
|
var FRIENDLY_TOOL_NAMES = {
|
|
2304
2246
|
["pattern-detect" /* PatternDetect */]: "Semantic Duplicates",
|
|
2305
2247
|
["context-analyzer" /* ContextAnalyzer */]: "Context Fragmentation",
|
|
@@ -2338,14 +2280,14 @@ var IssueType = /* @__PURE__ */ ((IssueType2) => {
|
|
|
2338
2280
|
IssueType2["ContractGap"] = "contract-gap";
|
|
2339
2281
|
return IssueType2;
|
|
2340
2282
|
})(IssueType || {});
|
|
2341
|
-
var IssueTypeSchema =
|
|
2283
|
+
var IssueTypeSchema = import_zod.z.nativeEnum(IssueType);
|
|
2342
2284
|
var AnalysisStatus = /* @__PURE__ */ ((AnalysisStatus2) => {
|
|
2343
2285
|
AnalysisStatus2["Processing"] = "processing";
|
|
2344
2286
|
AnalysisStatus2["Completed"] = "completed";
|
|
2345
2287
|
AnalysisStatus2["Failed"] = "failed";
|
|
2346
2288
|
return AnalysisStatus2;
|
|
2347
2289
|
})(AnalysisStatus || {});
|
|
2348
|
-
var AnalysisStatusSchema =
|
|
2290
|
+
var AnalysisStatusSchema = import_zod.z.nativeEnum(AnalysisStatus);
|
|
2349
2291
|
var ModelTier = /* @__PURE__ */ ((ModelTier2) => {
|
|
2350
2292
|
ModelTier2["Compact"] = "compact";
|
|
2351
2293
|
ModelTier2["Standard"] = "standard";
|
|
@@ -2353,149 +2295,207 @@ var ModelTier = /* @__PURE__ */ ((ModelTier2) => {
|
|
|
2353
2295
|
ModelTier2["Frontier"] = "frontier";
|
|
2354
2296
|
return ModelTier2;
|
|
2355
2297
|
})(ModelTier || {});
|
|
2356
|
-
var ModelTierSchema =
|
|
2298
|
+
var ModelTierSchema = import_zod.z.nativeEnum(ModelTier);
|
|
2357
2299
|
|
|
2358
2300
|
// src/types/common.ts
|
|
2359
|
-
var
|
|
2360
|
-
var LocationSchema =
|
|
2361
|
-
file:
|
|
2362
|
-
line:
|
|
2363
|
-
column:
|
|
2364
|
-
endLine:
|
|
2365
|
-
endColumn:
|
|
2301
|
+
var import_zod2 = require("zod");
|
|
2302
|
+
var LocationSchema = import_zod2.z.object({
|
|
2303
|
+
file: import_zod2.z.string(),
|
|
2304
|
+
line: import_zod2.z.number(),
|
|
2305
|
+
column: import_zod2.z.number().optional(),
|
|
2306
|
+
endLine: import_zod2.z.number().optional(),
|
|
2307
|
+
endColumn: import_zod2.z.number().optional()
|
|
2366
2308
|
});
|
|
2367
2309
|
|
|
2368
2310
|
// src/types/schemas/issue.ts
|
|
2369
|
-
var
|
|
2370
|
-
var IssueSchema =
|
|
2311
|
+
var import_zod3 = require("zod");
|
|
2312
|
+
var IssueSchema = import_zod3.z.object({
|
|
2371
2313
|
type: IssueTypeSchema,
|
|
2372
2314
|
severity: SeveritySchema,
|
|
2373
|
-
message:
|
|
2315
|
+
message: import_zod3.z.string(),
|
|
2374
2316
|
location: LocationSchema,
|
|
2375
|
-
suggestion:
|
|
2317
|
+
suggestion: import_zod3.z.string().optional()
|
|
2376
2318
|
});
|
|
2377
2319
|
|
|
2378
2320
|
// src/types/schemas/metrics.ts
|
|
2379
|
-
var
|
|
2380
|
-
var MetricsSchema =
|
|
2381
|
-
tokenCost:
|
|
2382
|
-
complexityScore:
|
|
2383
|
-
consistencyScore:
|
|
2384
|
-
docFreshnessScore:
|
|
2321
|
+
var import_zod4 = require("zod");
|
|
2322
|
+
var MetricsSchema = import_zod4.z.object({
|
|
2323
|
+
tokenCost: import_zod4.z.number().optional(),
|
|
2324
|
+
complexityScore: import_zod4.z.number().optional(),
|
|
2325
|
+
consistencyScore: import_zod4.z.number().optional(),
|
|
2326
|
+
docFreshnessScore: import_zod4.z.number().optional(),
|
|
2385
2327
|
// AI agent readiness metrics (v0.12+)
|
|
2386
|
-
aiSignalClarityScore:
|
|
2387
|
-
agentGroundingScore:
|
|
2388
|
-
testabilityScore:
|
|
2389
|
-
docDriftScore:
|
|
2390
|
-
dependencyHealthScore:
|
|
2328
|
+
aiSignalClarityScore: import_zod4.z.number().optional(),
|
|
2329
|
+
agentGroundingScore: import_zod4.z.number().optional(),
|
|
2330
|
+
testabilityScore: import_zod4.z.number().optional(),
|
|
2331
|
+
docDriftScore: import_zod4.z.number().optional(),
|
|
2332
|
+
dependencyHealthScore: import_zod4.z.number().optional(),
|
|
2391
2333
|
modelContextTier: ModelTierSchema.optional(),
|
|
2392
2334
|
// Business value metrics
|
|
2393
|
-
estimatedMonthlyCost:
|
|
2394
|
-
estimatedDeveloperHours:
|
|
2395
|
-
comprehensionDifficultyIndex:
|
|
2335
|
+
estimatedMonthlyCost: import_zod4.z.number().optional(),
|
|
2336
|
+
estimatedDeveloperHours: import_zod4.z.number().optional(),
|
|
2337
|
+
comprehensionDifficultyIndex: import_zod4.z.number().optional(),
|
|
2396
2338
|
// Extended metrics for specific spokes
|
|
2397
|
-
totalSymbols:
|
|
2398
|
-
totalExports:
|
|
2339
|
+
totalSymbols: import_zod4.z.number().optional(),
|
|
2340
|
+
totalExports: import_zod4.z.number().optional()
|
|
2399
2341
|
});
|
|
2400
2342
|
|
|
2401
2343
|
// src/types/schemas/report.ts
|
|
2402
|
-
var
|
|
2403
|
-
var AnalysisResultSchema =
|
|
2404
|
-
fileName:
|
|
2405
|
-
issues:
|
|
2344
|
+
var import_zod5 = require("zod");
|
|
2345
|
+
var AnalysisResultSchema = import_zod5.z.object({
|
|
2346
|
+
fileName: import_zod5.z.string(),
|
|
2347
|
+
issues: import_zod5.z.array(IssueSchema),
|
|
2406
2348
|
metrics: MetricsSchema
|
|
2407
2349
|
});
|
|
2408
|
-
var SpokeSummarySchema =
|
|
2409
|
-
totalFiles:
|
|
2410
|
-
totalIssues:
|
|
2411
|
-
criticalIssues:
|
|
2412
|
-
majorIssues:
|
|
2413
|
-
score:
|
|
2414
|
-
}).catchall(
|
|
2415
|
-
var SpokeOutputSchema =
|
|
2416
|
-
results:
|
|
2350
|
+
var SpokeSummarySchema = import_zod5.z.object({
|
|
2351
|
+
totalFiles: import_zod5.z.number().optional(),
|
|
2352
|
+
totalIssues: import_zod5.z.number().optional(),
|
|
2353
|
+
criticalIssues: import_zod5.z.number().optional(),
|
|
2354
|
+
majorIssues: import_zod5.z.number().optional(),
|
|
2355
|
+
score: import_zod5.z.number().optional()
|
|
2356
|
+
}).catchall(import_zod5.z.any());
|
|
2357
|
+
var SpokeOutputSchema = import_zod5.z.object({
|
|
2358
|
+
results: import_zod5.z.array(AnalysisResultSchema),
|
|
2417
2359
|
summary: SpokeSummarySchema,
|
|
2418
|
-
metadata:
|
|
2419
|
-
toolName:
|
|
2420
|
-
version:
|
|
2421
|
-
timestamp:
|
|
2422
|
-
config:
|
|
2423
|
-
}).catchall(
|
|
2360
|
+
metadata: import_zod5.z.object({
|
|
2361
|
+
toolName: import_zod5.z.string(),
|
|
2362
|
+
version: import_zod5.z.string().optional(),
|
|
2363
|
+
timestamp: import_zod5.z.string().optional(),
|
|
2364
|
+
config: import_zod5.z.any().optional()
|
|
2365
|
+
}).catchall(import_zod5.z.any()).optional()
|
|
2424
2366
|
});
|
|
2425
|
-
var UnifiedReportSchema =
|
|
2426
|
-
summary:
|
|
2427
|
-
totalFiles:
|
|
2428
|
-
totalIssues:
|
|
2429
|
-
criticalIssues:
|
|
2430
|
-
majorIssues:
|
|
2431
|
-
businessImpact:
|
|
2432
|
-
estimatedMonthlyWaste:
|
|
2433
|
-
potentialSavings:
|
|
2434
|
-
productivityHours:
|
|
2367
|
+
var UnifiedReportSchema = import_zod5.z.object({
|
|
2368
|
+
summary: import_zod5.z.object({
|
|
2369
|
+
totalFiles: import_zod5.z.number(),
|
|
2370
|
+
totalIssues: import_zod5.z.number(),
|
|
2371
|
+
criticalIssues: import_zod5.z.number(),
|
|
2372
|
+
majorIssues: import_zod5.z.number(),
|
|
2373
|
+
businessImpact: import_zod5.z.object({
|
|
2374
|
+
estimatedMonthlyWaste: import_zod5.z.number().optional(),
|
|
2375
|
+
potentialSavings: import_zod5.z.number().optional(),
|
|
2376
|
+
productivityHours: import_zod5.z.number().optional()
|
|
2435
2377
|
}).optional()
|
|
2436
2378
|
}),
|
|
2437
|
-
results:
|
|
2438
|
-
scoring:
|
|
2439
|
-
overall:
|
|
2440
|
-
rating:
|
|
2441
|
-
timestamp:
|
|
2442
|
-
breakdown:
|
|
2443
|
-
|
|
2444
|
-
toolName:
|
|
2445
|
-
score:
|
|
2446
|
-
}).catchall(
|
|
2379
|
+
results: import_zod5.z.array(AnalysisResultSchema),
|
|
2380
|
+
scoring: import_zod5.z.object({
|
|
2381
|
+
overall: import_zod5.z.number(),
|
|
2382
|
+
rating: import_zod5.z.string(),
|
|
2383
|
+
timestamp: import_zod5.z.string(),
|
|
2384
|
+
breakdown: import_zod5.z.array(
|
|
2385
|
+
import_zod5.z.object({
|
|
2386
|
+
toolName: import_zod5.z.union([ToolNameSchema, import_zod5.z.string()]),
|
|
2387
|
+
score: import_zod5.z.number()
|
|
2388
|
+
}).catchall(import_zod5.z.any())
|
|
2447
2389
|
)
|
|
2448
2390
|
}).optional()
|
|
2449
|
-
}).catchall(
|
|
2391
|
+
}).catchall(import_zod5.z.any());
|
|
2450
2392
|
|
|
2451
2393
|
// src/types/schemas/config.ts
|
|
2452
|
-
var
|
|
2453
|
-
var AIReadyConfigSchema =
|
|
2394
|
+
var import_zod6 = require("zod");
|
|
2395
|
+
var AIReadyConfigSchema = import_zod6.z.object({
|
|
2454
2396
|
/** Files or directories to exclude from scan */
|
|
2455
|
-
exclude:
|
|
2397
|
+
exclude: import_zod6.z.array(import_zod6.z.string()).optional(),
|
|
2456
2398
|
/** Fail CI/CD if score below threshold (0-100) */
|
|
2457
|
-
threshold:
|
|
2399
|
+
threshold: import_zod6.z.number().optional(),
|
|
2458
2400
|
/** Fail on issues: critical, major, any */
|
|
2459
|
-
failOn:
|
|
2401
|
+
failOn: import_zod6.z.enum(["critical", "major", "any", "none"]).optional(),
|
|
2460
2402
|
/** Scan-specific configuration */
|
|
2461
|
-
scan:
|
|
2462
|
-
include:
|
|
2463
|
-
exclude:
|
|
2464
|
-
parallel:
|
|
2465
|
-
deep:
|
|
2466
|
-
tools:
|
|
2403
|
+
scan: import_zod6.z.object({
|
|
2404
|
+
include: import_zod6.z.array(import_zod6.z.string()).optional(),
|
|
2405
|
+
exclude: import_zod6.z.array(import_zod6.z.string()).optional(),
|
|
2406
|
+
parallel: import_zod6.z.boolean().optional(),
|
|
2407
|
+
deep: import_zod6.z.boolean().optional(),
|
|
2408
|
+
tools: import_zod6.z.array(import_zod6.z.string()).optional()
|
|
2467
2409
|
}).optional(),
|
|
2468
2410
|
/** Output-specific configuration */
|
|
2469
|
-
output:
|
|
2411
|
+
output: import_zod6.z.object({
|
|
2470
2412
|
/** Output format (json, console, html) */
|
|
2471
|
-
format:
|
|
2413
|
+
format: import_zod6.z.enum(["json", "console", "html"]).optional(),
|
|
2472
2414
|
/** Output file path */
|
|
2473
|
-
path:
|
|
2415
|
+
path: import_zod6.z.string().optional(),
|
|
2474
2416
|
/** Output directory */
|
|
2475
|
-
saveTo:
|
|
2417
|
+
saveTo: import_zod6.z.string().optional(),
|
|
2476
2418
|
/** Whether to show score breakdown in console */
|
|
2477
|
-
showBreakdown:
|
|
2419
|
+
showBreakdown: import_zod6.z.boolean().optional(),
|
|
2478
2420
|
/** Baseline report to compare against */
|
|
2479
|
-
compareBaseline:
|
|
2421
|
+
compareBaseline: import_zod6.z.string().optional()
|
|
2480
2422
|
}).optional(),
|
|
2481
2423
|
/** Tool-specific configuration overrides (Strictly ToolName -> Config) */
|
|
2482
|
-
tools:
|
|
2424
|
+
tools: import_zod6.z.record(import_zod6.z.string(), import_zod6.z.any()).optional(),
|
|
2483
2425
|
/** Scoring profile and weights */
|
|
2484
|
-
scoring:
|
|
2426
|
+
scoring: import_zod6.z.object({
|
|
2485
2427
|
/** Name of the scoring profile (e.g. "strict", "balanced") */
|
|
2486
|
-
profile:
|
|
2428
|
+
profile: import_zod6.z.string().optional(),
|
|
2487
2429
|
/** Custom weights for tools and metrics */
|
|
2488
|
-
weights:
|
|
2430
|
+
weights: import_zod6.z.record(import_zod6.z.string(), import_zod6.z.number()).optional()
|
|
2489
2431
|
}).optional(),
|
|
2490
2432
|
/** Visualizer settings (interactive graph) */
|
|
2491
|
-
visualizer:
|
|
2492
|
-
groupingDirs:
|
|
2493
|
-
graph:
|
|
2494
|
-
maxNodes:
|
|
2495
|
-
maxEdges:
|
|
2433
|
+
visualizer: import_zod6.z.object({
|
|
2434
|
+
groupingDirs: import_zod6.z.array(import_zod6.z.string()).optional(),
|
|
2435
|
+
graph: import_zod6.z.object({
|
|
2436
|
+
maxNodes: import_zod6.z.number().optional(),
|
|
2437
|
+
maxEdges: import_zod6.z.number().optional()
|
|
2496
2438
|
}).optional()
|
|
2497
2439
|
}).optional()
|
|
2498
|
-
}).catchall(
|
|
2440
|
+
}).catchall(import_zod6.z.any());
|
|
2441
|
+
|
|
2442
|
+
// src/types/business.ts
|
|
2443
|
+
var import_zod7 = require("zod");
|
|
2444
|
+
var LeadSource = /* @__PURE__ */ ((LeadSource2) => {
|
|
2445
|
+
LeadSource2["ClawMoreHero"] = "clawmore-hero";
|
|
2446
|
+
LeadSource2["ClawMoreWaitlist"] = "clawmore-waitlist";
|
|
2447
|
+
LeadSource2["ClawMoreBeta"] = "clawmore-beta";
|
|
2448
|
+
LeadSource2["AiReadyPlatform"] = "aiready-platform";
|
|
2449
|
+
return LeadSource2;
|
|
2450
|
+
})(LeadSource || {});
|
|
2451
|
+
var LeadSourceSchema = import_zod7.z.nativeEnum(LeadSource);
|
|
2452
|
+
var LeadSchema = import_zod7.z.object({
|
|
2453
|
+
id: import_zod7.z.string(),
|
|
2454
|
+
email: import_zod7.z.string().email(),
|
|
2455
|
+
name: import_zod7.z.string().min(1),
|
|
2456
|
+
interest: import_zod7.z.string().default("General"),
|
|
2457
|
+
notes: import_zod7.z.string().optional(),
|
|
2458
|
+
timestamp: import_zod7.z.string().datetime(),
|
|
2459
|
+
source: LeadSourceSchema,
|
|
2460
|
+
status: import_zod7.z.enum(["new", "contacted", "qualified", "converted", "archived"]).default("new")
|
|
2461
|
+
});
|
|
2462
|
+
var LeadSubmissionSchema = LeadSchema.omit({
|
|
2463
|
+
id: true,
|
|
2464
|
+
timestamp: true,
|
|
2465
|
+
status: true
|
|
2466
|
+
});
|
|
2467
|
+
var ManagedAccountSchema = import_zod7.z.object({
|
|
2468
|
+
id: import_zod7.z.string(),
|
|
2469
|
+
// Internal UUID
|
|
2470
|
+
accountId: import_zod7.z.string(),
|
|
2471
|
+
// AWS Account ID
|
|
2472
|
+
userId: import_zod7.z.string(),
|
|
2473
|
+
// Owner (caopengau@gmail.com)
|
|
2474
|
+
stripeSubscriptionId: import_zod7.z.string(),
|
|
2475
|
+
// AI Token Management
|
|
2476
|
+
tokenStrategy: import_zod7.z.enum(["managed", "byok"]).default("managed"),
|
|
2477
|
+
byokConfig: import_zod7.z.object({
|
|
2478
|
+
openaiKey: import_zod7.z.string().optional(),
|
|
2479
|
+
anthropicKey: import_zod7.z.string().optional(),
|
|
2480
|
+
openrouterKey: import_zod7.z.string().optional()
|
|
2481
|
+
}).optional(),
|
|
2482
|
+
// Financials (in cents)
|
|
2483
|
+
baseFeeCents: import_zod7.z.number().default(2900),
|
|
2484
|
+
includedComputeCents: import_zod7.z.number().default(1500),
|
|
2485
|
+
// $15.00 AWS included
|
|
2486
|
+
includedTokenCents: import_zod7.z.number().default(500),
|
|
2487
|
+
// $5.00 Managed Tokens included
|
|
2488
|
+
// Pre-paid Balance (credits)
|
|
2489
|
+
prepaidTokenBalanceCents: import_zod7.z.number().default(0),
|
|
2490
|
+
// Users buy these in $10 packs
|
|
2491
|
+
currentMonthlyTokenSpendCents: import_zod7.z.number().default(0),
|
|
2492
|
+
// Governance
|
|
2493
|
+
status: import_zod7.z.enum(["provisioning", "active", "warning", "quarantined", "suspended"]).default("provisioning"),
|
|
2494
|
+
lastCostSyncAt: import_zod7.z.string().datetime().optional(),
|
|
2495
|
+
region: import_zod7.z.string().default("ap-southeast-2"),
|
|
2496
|
+
// Alerting thresholds (percentage of includedComputeCents)
|
|
2497
|
+
alertThresholds: import_zod7.z.array(import_zod7.z.number()).default([50, 80, 100, 150])
|
|
2498
|
+
});
|
|
2499
2499
|
|
|
2500
2500
|
// src/types.ts
|
|
2501
2501
|
var GLOBAL_INFRA_OPTIONS = [
|
|
@@ -3810,15 +3810,19 @@ function mergeConfigWithDefaults(userConfig, defaults) {
|
|
|
3810
3810
|
if (!mergedConfig.toolConfigs) mergedConfig.toolConfigs = {};
|
|
3811
3811
|
for (const [toolName, toolConfig] of Object.entries(userConfig.tools)) {
|
|
3812
3812
|
if (typeof toolConfig === "object" && toolConfig !== null) {
|
|
3813
|
-
|
|
3814
|
-
|
|
3813
|
+
const toolConfigs = mergedConfig.toolConfigs;
|
|
3814
|
+
toolConfigs[toolName] = {
|
|
3815
|
+
...toolConfigs[toolName],
|
|
3815
3816
|
...toolConfig
|
|
3816
3817
|
};
|
|
3817
3818
|
}
|
|
3818
3819
|
}
|
|
3819
3820
|
}
|
|
3820
3821
|
if (userConfig.output) {
|
|
3821
|
-
mergedConfig.output = {
|
|
3822
|
+
mergedConfig.output = {
|
|
3823
|
+
...mergedConfig.output,
|
|
3824
|
+
...userConfig.output
|
|
3825
|
+
};
|
|
3822
3826
|
}
|
|
3823
3827
|
return mergedConfig;
|
|
3824
3828
|
}
|
|
@@ -6547,23 +6551,27 @@ async function executeSpokeCli(name, description, options, analyzeFn) {
|
|
|
6547
6551
|
console.log(import_chalk6.default.cyan(`Analyzing ${description.toLowerCase()}...`));
|
|
6548
6552
|
try {
|
|
6549
6553
|
const report = await analyzeFn({
|
|
6550
|
-
|
|
6551
|
-
|
|
6554
|
+
...options,
|
|
6555
|
+
rootDir: options.rootDir ?? process.cwd()
|
|
6552
6556
|
});
|
|
6553
6557
|
console.log(import_chalk6.default.bold(`
|
|
6554
6558
|
${name} Analysis Results:`));
|
|
6559
|
+
const reportRecord = report;
|
|
6560
|
+
const summary = reportRecord.summary;
|
|
6555
6561
|
console.log(
|
|
6556
|
-
`Rating: ${
|
|
6562
|
+
`Rating: ${summary.rating.toUpperCase()} (Score: ${summary.score})`
|
|
6557
6563
|
);
|
|
6558
|
-
|
|
6564
|
+
const issues = reportRecord.issues;
|
|
6565
|
+
if (issues && issues.length > 0) {
|
|
6559
6566
|
console.log(import_chalk6.default.red(`
|
|
6560
|
-
Found ${
|
|
6567
|
+
Found ${issues.length} issues.`));
|
|
6561
6568
|
} else {
|
|
6562
6569
|
console.log(import_chalk6.default.green("\nNo issues detected."));
|
|
6563
6570
|
}
|
|
6564
6571
|
return report;
|
|
6565
6572
|
} catch (err) {
|
|
6566
|
-
|
|
6573
|
+
const errorMessage = err instanceof Error ? err.message : String(err);
|
|
6574
|
+
console.error(import_chalk6.default.red(`Error during ${name} analysis: ${errorMessage}`));
|
|
6567
6575
|
process.exit(1);
|
|
6568
6576
|
}
|
|
6569
6577
|
}
|
package/dist/index.mjs
CHANGED
|
@@ -52,7 +52,7 @@ import {
|
|
|
52
52
|
getToolWeight,
|
|
53
53
|
normalizeToolName,
|
|
54
54
|
parseWeightString
|
|
55
|
-
} from "./chunk-
|
|
55
|
+
} from "./chunk-LRM26BOB.mjs";
|
|
56
56
|
import {
|
|
57
57
|
TypeScriptParser
|
|
58
58
|
} from "./chunk-5IVDH26E.mjs";
|
|
@@ -1366,15 +1366,19 @@ function mergeConfigWithDefaults(userConfig, defaults) {
|
|
|
1366
1366
|
if (!mergedConfig.toolConfigs) mergedConfig.toolConfigs = {};
|
|
1367
1367
|
for (const [toolName, toolConfig] of Object.entries(userConfig.tools)) {
|
|
1368
1368
|
if (typeof toolConfig === "object" && toolConfig !== null) {
|
|
1369
|
-
|
|
1370
|
-
|
|
1369
|
+
const toolConfigs = mergedConfig.toolConfigs;
|
|
1370
|
+
toolConfigs[toolName] = {
|
|
1371
|
+
...toolConfigs[toolName],
|
|
1371
1372
|
...toolConfig
|
|
1372
1373
|
};
|
|
1373
1374
|
}
|
|
1374
1375
|
}
|
|
1375
1376
|
}
|
|
1376
1377
|
if (userConfig.output) {
|
|
1377
|
-
mergedConfig.output = {
|
|
1378
|
+
mergedConfig.output = {
|
|
1379
|
+
...mergedConfig.output,
|
|
1380
|
+
...userConfig.output
|
|
1381
|
+
};
|
|
1378
1382
|
}
|
|
1379
1383
|
return mergedConfig;
|
|
1380
1384
|
}
|
|
@@ -3571,23 +3575,27 @@ async function executeSpokeCli(name, description, options, analyzeFn) {
|
|
|
3571
3575
|
console.log(chalk6.cyan(`Analyzing ${description.toLowerCase()}...`));
|
|
3572
3576
|
try {
|
|
3573
3577
|
const report = await analyzeFn({
|
|
3574
|
-
|
|
3575
|
-
|
|
3578
|
+
...options,
|
|
3579
|
+
rootDir: options.rootDir ?? process.cwd()
|
|
3576
3580
|
});
|
|
3577
3581
|
console.log(chalk6.bold(`
|
|
3578
3582
|
${name} Analysis Results:`));
|
|
3583
|
+
const reportRecord = report;
|
|
3584
|
+
const summary = reportRecord.summary;
|
|
3579
3585
|
console.log(
|
|
3580
|
-
`Rating: ${
|
|
3586
|
+
`Rating: ${summary.rating.toUpperCase()} (Score: ${summary.score})`
|
|
3581
3587
|
);
|
|
3582
|
-
|
|
3588
|
+
const issues = reportRecord.issues;
|
|
3589
|
+
if (issues && issues.length > 0) {
|
|
3583
3590
|
console.log(chalk6.red(`
|
|
3584
|
-
Found ${
|
|
3591
|
+
Found ${issues.length} issues.`));
|
|
3585
3592
|
} else {
|
|
3586
3593
|
console.log(chalk6.green("\nNo issues detected."));
|
|
3587
3594
|
}
|
|
3588
3595
|
return report;
|
|
3589
3596
|
} catch (err) {
|
|
3590
|
-
|
|
3597
|
+
const errorMessage = err instanceof Error ? err.message : String(err);
|
|
3598
|
+
console.error(chalk6.red(`Error during ${name} analysis: ${errorMessage}`));
|
|
3591
3599
|
process.exit(1);
|
|
3592
3600
|
}
|
|
3593
3601
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aiready/core",
|
|
3
|
-
"version": "0.24.
|
|
3
|
+
"version": "0.24.9",
|
|
4
4
|
"description": "Shared utilities for AIReady analysis tools",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"module": "./dist/index.mjs",
|
|
@@ -62,6 +62,8 @@
|
|
|
62
62
|
"test": "vitest run --hookTimeout=30000",
|
|
63
63
|
"lint": "eslint src",
|
|
64
64
|
"clean": "rm -rf dist",
|
|
65
|
-
"release": "pnpm build && pnpm publish --no-git-checks"
|
|
65
|
+
"release": "pnpm build && pnpm publish --no-git-checks",
|
|
66
|
+
"type-check": "tsc --noEmit",
|
|
67
|
+
"format-check": "prettier --check . --ignore-path ../../.prettierignore"
|
|
66
68
|
}
|
|
67
69
|
}
|