@qulib/core 0.3.1 → 0.4.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.
Files changed (70) hide show
  1. package/dist/analyze.d.ts +2 -0
  2. package/dist/analyze.d.ts.map +1 -1
  3. package/dist/analyze.js +29 -1
  4. package/dist/harness/decision-logger.d.ts +1 -0
  5. package/dist/harness/decision-logger.d.ts.map +1 -1
  6. package/dist/harness/decision-logger.js +15 -22
  7. package/dist/harness/run-options.d.ts +3 -0
  8. package/dist/harness/run-options.d.ts.map +1 -1
  9. package/dist/harness/state-manager.d.ts +3 -0
  10. package/dist/harness/state-manager.d.ts.map +1 -1
  11. package/dist/harness/state-manager.js +15 -18
  12. package/dist/index.d.ts +9 -1
  13. package/dist/index.d.ts.map +1 -1
  14. package/dist/index.js +5 -0
  15. package/dist/llm/cost-intelligence.d.ts +13 -0
  16. package/dist/llm/cost-intelligence.d.ts.map +1 -1
  17. package/dist/llm/cost-intelligence.js +13 -0
  18. package/dist/llm/provider-registry.d.ts +9 -0
  19. package/dist/llm/provider-registry.d.ts.map +1 -0
  20. package/dist/llm/provider-registry.js +15 -0
  21. package/dist/llm/provider.d.ts +9 -11
  22. package/dist/llm/provider.d.ts.map +1 -1
  23. package/dist/llm/provider.interface.d.ts +16 -0
  24. package/dist/llm/provider.interface.d.ts.map +1 -0
  25. package/dist/llm/provider.interface.js +1 -0
  26. package/dist/llm/provider.js +8 -51
  27. package/dist/llm/providers/anthropic.d.ts +16 -0
  28. package/dist/llm/providers/anthropic.d.ts.map +1 -0
  29. package/dist/llm/providers/anthropic.js +104 -0
  30. package/dist/phases/act.d.ts.map +1 -1
  31. package/dist/phases/act.js +20 -6
  32. package/dist/phases/observe.d.ts.map +1 -1
  33. package/dist/phases/observe.js +20 -2
  34. package/dist/phases/think-finalize.d.ts.map +1 -1
  35. package/dist/phases/think-finalize.js +12 -3
  36. package/dist/phases/think.d.ts.map +1 -1
  37. package/dist/phases/think.js +14 -2
  38. package/dist/schemas/automation-maturity.schema.d.ts +78 -0
  39. package/dist/schemas/automation-maturity.schema.d.ts.map +1 -0
  40. package/dist/schemas/automation-maturity.schema.js +24 -0
  41. package/dist/schemas/config.schema.d.ts +37 -0
  42. package/dist/schemas/config.schema.d.ts.map +1 -1
  43. package/dist/schemas/config.schema.js +11 -0
  44. package/dist/schemas/gap-analysis.schema.d.ts +6 -6
  45. package/dist/schemas/index.d.ts +2 -1
  46. package/dist/schemas/index.d.ts.map +1 -1
  47. package/dist/schemas/index.js +2 -1
  48. package/dist/schemas/public-surface.schema.d.ts +4 -4
  49. package/dist/schemas/repo-analysis.schema.d.ts +134 -0
  50. package/dist/schemas/repo-analysis.schema.d.ts.map +1 -1
  51. package/dist/schemas/repo-analysis.schema.js +29 -0
  52. package/dist/telemetry/emit.d.ts +3 -0
  53. package/dist/telemetry/emit.d.ts.map +1 -0
  54. package/dist/telemetry/emit.js +11 -0
  55. package/dist/telemetry/telemetry.interface.d.ts +13 -0
  56. package/dist/telemetry/telemetry.interface.d.ts.map +1 -0
  57. package/dist/telemetry/telemetry.interface.js +3 -0
  58. package/dist/tools/automation-maturity.d.ts +4 -0
  59. package/dist/tools/automation-maturity.d.ts.map +1 -0
  60. package/dist/tools/automation-maturity.js +163 -0
  61. package/dist/tools/framework-detector.d.ts +15 -0
  62. package/dist/tools/framework-detector.d.ts.map +1 -0
  63. package/dist/tools/framework-detector.js +153 -0
  64. package/dist/tools/gap-engine.d.ts +1 -1
  65. package/dist/tools/gap-engine.d.ts.map +1 -1
  66. package/dist/tools/gap-engine.js +13 -3
  67. package/dist/tools/repo-scanner.d.ts +16 -0
  68. package/dist/tools/repo-scanner.d.ts.map +1 -1
  69. package/dist/tools/repo-scanner.js +31 -2
  70. package/package.json +1 -1
@@ -1,3 +1,19 @@
1
+ /**
2
+ * @module repo-scanner
3
+ * @packageBoundary @qulib/core (candidate: @qulib/analyzer)
4
+ *
5
+ * This module performs static analysis of a repository's file structure.
6
+ * It is currently embedded in @qulib/core because repo scanning is part of
7
+ * the observe phase and @qulib/core is the only consumer.
8
+ *
9
+ * Extraction to @qulib/analyzer is appropriate when:
10
+ * 1. A consumer needs repo analysis without URL crawling
11
+ * 2. The module grows to include PRD/Jira/Confluence ingestion
12
+ * 3. A standalone CLI command `qulib analyze-repo` is needed
13
+ *
14
+ * Before extraction: ensure RepoAnalysis schema is re-exported from @qulib/analyzer
15
+ * and @qulib/core depends on @qulib/analyzer (not the reverse).
16
+ */
1
17
  import { type RepoAnalysis } from '../schemas/repo-analysis.schema.js';
2
18
  export declare function scanRepo(repoPath: string): Promise<RepoAnalysis>;
3
19
  //# sourceMappingURL=repo-scanner.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"repo-scanner.d.ts","sourceRoot":"","sources":["../../src/tools/repo-scanner.ts"],"names":[],"mappings":"AAGA,OAAO,EAAsB,KAAK,YAAY,EAAE,MAAM,oCAAoC,CAAC;AAiC3F,wBAAsB,QAAQ,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,YAAY,CAAC,CA4HtE"}
1
+ {"version":3,"file":"repo-scanner.d.ts","sourceRoot":"","sources":["../../src/tools/repo-scanner.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAKH,OAAO,EAAsB,KAAK,YAAY,EAAE,MAAM,oCAAoC,CAAC;AAmC3F,wBAAsB,QAAQ,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,YAAY,CAAC,CAyItE"}
@@ -1,7 +1,25 @@
1
+ /**
2
+ * @module repo-scanner
3
+ * @packageBoundary @qulib/core (candidate: @qulib/analyzer)
4
+ *
5
+ * This module performs static analysis of a repository's file structure.
6
+ * It is currently embedded in @qulib/core because repo scanning is part of
7
+ * the observe phase and @qulib/core is the only consumer.
8
+ *
9
+ * Extraction to @qulib/analyzer is appropriate when:
10
+ * 1. A consumer needs repo analysis without URL crawling
11
+ * 2. The module grows to include PRD/Jira/Confluence ingestion
12
+ * 3. A standalone CLI command `qulib analyze-repo` is needed
13
+ *
14
+ * Before extraction: ensure RepoAnalysis schema is re-exported from @qulib/analyzer
15
+ * and @qulib/core depends on @qulib/analyzer (not the reverse).
16
+ */
1
17
  import { readFile } from 'node:fs/promises';
2
18
  import { relative, basename } from 'node:path';
3
19
  import glob from 'fast-glob';
4
20
  import { RepoAnalysisSchema } from '../schemas/repo-analysis.schema.js';
21
+ import { detectFramework } from './framework-detector.js';
22
+ import { computeAutomationMaturity } from './automation-maturity.js';
5
23
  const IGNORE_PATTERNS = ['**/node_modules/**', '**/.next/**', '**/dist/**', '**/build/**'];
6
24
  function toPosix(path) {
7
25
  return path.split('\\').join('/');
@@ -127,7 +145,7 @@ export async function scanRepo(repoPath) {
127
145
  missingTestIds.push(rel);
128
146
  }
129
147
  }
130
- return RepoAnalysisSchema.parse({
148
+ const base = {
131
149
  scannedAt: new Date().toISOString(),
132
150
  repoPath,
133
151
  routes,
@@ -143,5 +161,16 @@ export async function scanRepo(repoPath) {
143
161
  existingE2eFiles,
144
162
  existingComponentFiles,
145
163
  },
146
- });
164
+ };
165
+ let parsed = RepoAnalysisSchema.parse(base);
166
+ try {
167
+ const framework = await detectFramework(repoPath);
168
+ parsed = RepoAnalysisSchema.parse({ ...parsed, framework });
169
+ }
170
+ catch (error) {
171
+ const msg = error instanceof Error ? error.message : String(error);
172
+ console.warn(`[qulib] framework detection failed for ${repoPath}: ${msg}`);
173
+ }
174
+ const automationMaturity = computeAutomationMaturity(parsed);
175
+ return RepoAnalysisSchema.parse({ ...parsed, automationMaturity });
147
176
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@qulib/core",
3
- "version": "0.3.1",
3
+ "version": "0.4.0",
4
4
  "description": "Qulib — analyze deployed web apps for honest quality gaps (CLI + programmatic API)",
5
5
  "license": "MIT",
6
6
  "author": "Tapesh Nagarwal",