@aiready/agent-grounding 0.13.0 → 0.13.2

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.
@@ -1,6 +1,6 @@
1
1
 
2
2
  
3
- > @aiready/agent-grounding@0.12.0 build /Users/pengcao/projects/aiready/packages/agent-grounding
3
+ > @aiready/agent-grounding@0.13.2 build /Users/pengcao/projects/aiready/packages/agent-grounding
4
4
  > tsup src/index.ts src/cli.ts --format cjs,esm --dts
5
5
 
6
6
  CLI Building entry: src/cli.ts, src/index.ts
@@ -9,16 +9,16 @@
9
9
  CLI Target: es2020
10
10
  CJS Build start
11
11
  ESM Build start
12
- CJS dist/cli.js 16.65 KB
13
- CJS dist/index.js 12.42 KB
14
- CJS ⚡️ Build success in 51ms
15
12
  ESM dist/cli.mjs 5.16 KB
13
+ ESM dist/index.mjs 1.18 KB
16
14
  ESM dist/chunk-AWAS2KB5.mjs 9.83 KB
17
- ESM dist/index.mjs 1.30 KB
18
- ESM ⚡️ Build success in 50ms
15
+ ESM ⚡️ Build success in 114ms
16
+ CJS dist/cli.js 16.65 KB
17
+ CJS dist/index.js 12.30 KB
18
+ CJS ⚡️ Build success in 114ms
19
19
  DTS Build start
20
- DTS ⚡️ Build success in 1988ms
20
+ DTS ⚡️ Build success in 4182ms
21
21
  DTS dist/cli.d.ts 20.00 B
22
- DTS dist/index.d.ts 2.49 KB
22
+ DTS dist/index.d.ts 2.54 KB
23
23
  DTS dist/cli.d.mts 20.00 B
24
- DTS dist/index.d.mts 2.49 KB
24
+ DTS dist/index.d.mts 2.54 KB
@@ -1,18 +1,19 @@
1
1
 
2
2
  
3
- > @aiready/agent-grounding@0.12.0 test /Users/pengcao/projects/aiready/packages/agent-grounding
3
+ > @aiready/agent-grounding@0.13.1 test /Users/pengcao/projects/aiready/packages/agent-grounding
4
4
  > vitest run
5
5
 
6
6
  [?25l
7
7
   RUN  v4.0.18 /Users/pengcao/projects/aiready/packages/agent-grounding
8
8
 
9
- ✓ src/__tests__/provider.test.ts (2 tests) 6ms
10
- ✓ src/__tests__/scoring.test.ts (2 tests) 2ms
11
- ✓ src/__tests__/analyzer.test.ts (3 tests) 559ms
9
+ ✓ src/__tests__/provider.test.ts (2 tests) 29ms
10
+ ✓ src/__tests__/scoring.test.ts (2 tests) 25ms
11
+ ✓ src/__tests__/analyzer.test.ts (3 tests) 504ms
12
+ ✓ should detect deep directories and vague file names  429ms
12
13
 
13
14
   Test Files  3 passed (3)
14
15
   Tests  7 passed (7)
15
-  Start at  16:14:19
16
-  Duration  3.12s (transform 817ms, setup 0ms, import 6.90s, tests 567ms, environment 25ms)
16
+  Start at  02:00:17
17
+  Duration  3.04s (transform 719ms, setup 0ms, import 4.70s, tests 558ms, environment 0ms)
17
18
 
18
19
  [?25h
package/dist/index.d.mts CHANGED
@@ -1,9 +1,10 @@
1
- import { ToolProvider, Issue, IssueType, ScanOptions, ToolScoringOutput } from '@aiready/core';
1
+ import * as _aiready_core from '@aiready/core';
2
+ import { Issue, IssueType, ScanOptions, ToolScoringOutput } from '@aiready/core';
2
3
 
3
4
  /**
4
5
  * Agent Grounding Tool Provider
5
6
  */
6
- declare const AgentGroundingProvider: ToolProvider;
7
+ declare const AgentGroundingProvider: _aiready_core.ToolProvider;
7
8
 
8
9
  interface AgentGroundingOptions extends ScanOptions {
9
10
  /** Max directory depth before flagging as "too deep" */
package/dist/index.d.ts CHANGED
@@ -1,9 +1,10 @@
1
- import { ToolProvider, Issue, IssueType, ScanOptions, ToolScoringOutput } from '@aiready/core';
1
+ import * as _aiready_core from '@aiready/core';
2
+ import { Issue, IssueType, ScanOptions, ToolScoringOutput } from '@aiready/core';
2
3
 
3
4
  /**
4
5
  * Agent Grounding Tool Provider
5
6
  */
6
- declare const AgentGroundingProvider: ToolProvider;
7
+ declare const AgentGroundingProvider: _aiready_core.ToolProvider;
7
8
 
8
9
  interface AgentGroundingOptions extends ScanOptions {
9
10
  /** Max directory depth before flagging as "too deep" */
package/dist/index.js CHANGED
@@ -324,41 +324,38 @@ function calculateGroundingScore(report) {
324
324
  }
325
325
 
326
326
  // src/provider.ts
327
- var AgentGroundingProvider = {
327
+ var AgentGroundingProvider = (0, import_core3.createProvider)({
328
328
  id: import_core3.ToolName.AgentGrounding,
329
329
  alias: ["agent-grounding", "grounding", "navigation"],
330
- async analyze(options) {
331
- const report = await analyzeAgentGrounding(
332
- options
333
- );
334
- const results = report.issues.map((i) => ({
335
- fileName: i.location.file,
336
- issues: [i],
330
+ version: "0.9.5",
331
+ defaultWeight: 10,
332
+ async analyzeReport(options) {
333
+ return analyzeAgentGrounding(options);
334
+ },
335
+ getResults(report) {
336
+ return report.issues.map((issue) => ({
337
+ fileName: issue.location.file,
338
+ issues: [issue],
337
339
  metrics: {
338
340
  agentGroundingScore: report.summary.score
339
341
  }
340
342
  }));
341
- return import_core3.SpokeOutputSchema.parse({
342
- results,
343
- summary: report.summary,
344
- metadata: {
345
- toolName: import_core3.ToolName.AgentGrounding,
346
- version: "0.9.5",
347
- timestamp: (/* @__PURE__ */ new Date()).toISOString(),
348
- rawData: report.rawData
349
- }
350
- });
351
343
  },
352
- score(output, options) {
344
+ getSummary(report) {
345
+ return report.summary;
346
+ },
347
+ getMetadata(report) {
348
+ return { rawData: report.rawData };
349
+ },
350
+ score(output) {
353
351
  const report = {
354
352
  summary: output.summary,
355
353
  rawData: output.metadata.rawData,
356
354
  recommendations: output.summary.recommendations || []
357
355
  };
358
356
  return calculateGroundingScore(report);
359
- },
360
- defaultWeight: 10
361
- };
357
+ }
358
+ });
362
359
 
363
360
  // src/index.ts
364
361
  import_core4.ToolRegistry.register(AgentGroundingProvider);
package/dist/index.mjs CHANGED
@@ -8,44 +8,41 @@ import { ToolRegistry } from "@aiready/core";
8
8
 
9
9
  // src/provider.ts
10
10
  import {
11
- ToolName,
12
- SpokeOutputSchema
11
+ createProvider,
12
+ ToolName
13
13
  } from "@aiready/core";
14
- var AgentGroundingProvider = {
14
+ var AgentGroundingProvider = createProvider({
15
15
  id: ToolName.AgentGrounding,
16
16
  alias: ["agent-grounding", "grounding", "navigation"],
17
- async analyze(options) {
18
- const report = await analyzeAgentGrounding(
19
- options
20
- );
21
- const results = report.issues.map((i) => ({
22
- fileName: i.location.file,
23
- issues: [i],
17
+ version: "0.9.5",
18
+ defaultWeight: 10,
19
+ async analyzeReport(options) {
20
+ return analyzeAgentGrounding(options);
21
+ },
22
+ getResults(report) {
23
+ return report.issues.map((issue) => ({
24
+ fileName: issue.location.file,
25
+ issues: [issue],
24
26
  metrics: {
25
27
  agentGroundingScore: report.summary.score
26
28
  }
27
29
  }));
28
- return SpokeOutputSchema.parse({
29
- results,
30
- summary: report.summary,
31
- metadata: {
32
- toolName: ToolName.AgentGrounding,
33
- version: "0.9.5",
34
- timestamp: (/* @__PURE__ */ new Date()).toISOString(),
35
- rawData: report.rawData
36
- }
37
- });
38
30
  },
39
- score(output, options) {
31
+ getSummary(report) {
32
+ return report.summary;
33
+ },
34
+ getMetadata(report) {
35
+ return { rawData: report.rawData };
36
+ },
37
+ score(output) {
40
38
  const report = {
41
39
  summary: output.summary,
42
40
  rawData: output.metadata.rawData,
43
41
  recommendations: output.summary.recommendations || []
44
42
  };
45
43
  return calculateGroundingScore(report);
46
- },
47
- defaultWeight: 10
48
- };
44
+ }
45
+ });
49
46
 
50
47
  // src/index.ts
51
48
  ToolRegistry.register(AgentGroundingProvider);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aiready/agent-grounding",
3
- "version": "0.13.0",
3
+ "version": "0.13.2",
4
4
  "description": "Measures how well an AI agent can navigate a codebase autonomously without human assistance",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.mjs",
@@ -40,7 +40,7 @@
40
40
  "chalk": "^5.3.0",
41
41
  "commander": "^14.0.0",
42
42
  "glob": "^13.0.0",
43
- "@aiready/core": "0.23.0"
43
+ "@aiready/core": "0.23.2"
44
44
  },
45
45
  "devDependencies": {
46
46
  "@types/node": "^24.0.0",
@@ -18,7 +18,7 @@ describe('Agent Grounding Provider', () => {
18
18
  const output = await AgentGroundingProvider.analyze({ rootDir: '.' });
19
19
 
20
20
  expect(output.summary.score).toBe(90);
21
- expect(output.metadata.toolName).toBe('agent-grounding');
21
+ expect(output.metadata!.toolName).toBe('agent-grounding');
22
22
  });
23
23
 
24
24
  it('should score an output', () => {
@@ -5,9 +5,12 @@ import { ToolName } from '@aiready/core';
5
5
 
6
6
  describe('Agent Grounding Scoring', () => {
7
7
  const mockReport: AgentGroundingReport = {
8
+ issues: [],
8
9
  summary: {
9
10
  score: 65,
10
11
  rating: 'moderate',
12
+ filesAnalyzed: 0,
13
+ directoriesAnalyzed: 0,
11
14
  dimensions: {
12
15
  structureClarityScore: 60,
13
16
  selfDocumentationScore: 70,
@@ -16,7 +19,6 @@ describe('Agent Grounding Scoring', () => {
16
19
  domainConsistencyScore: 65,
17
20
  },
18
21
  },
19
- results: [],
20
22
  rawData: {
21
23
  totalFiles: 20,
22
24
  totalDirectories: 5,
@@ -27,6 +29,8 @@ describe('Agent Grounding Scoring', () => {
27
29
  totalExports: 50,
28
30
  untypedExports: 10,
29
31
  inconsistentDomainTerms: 5,
32
+ barrelExports: 0,
33
+ domainVocabularySize: 0,
30
34
  },
31
35
  recommendations: ['Fix vague filenames'],
32
36
  };
@@ -50,6 +54,7 @@ describe('Agent Grounding Scoring', () => {
50
54
  it('should set high priority for low scores', () => {
51
55
  const lowScoreReport: AgentGroundingReport = {
52
56
  ...mockReport,
57
+ issues: [],
53
58
  summary: {
54
59
  ...mockReport.summary,
55
60
  score: 40,
package/src/provider.ts CHANGED
@@ -1,11 +1,8 @@
1
1
  import {
2
- ToolProvider,
2
+ AnalysisResult,
3
+ createProvider,
3
4
  ToolName,
4
- SpokeOutput,
5
5
  ScanOptions,
6
- ToolScoringOutput,
7
- AnalysisResult,
8
- SpokeOutputSchema,
9
6
  } from '@aiready/core';
10
7
  import { analyzeAgentGrounding } from './analyzer';
11
8
  import { calculateGroundingScore } from './scoring';
@@ -14,44 +11,35 @@ import { AgentGroundingOptions, AgentGroundingReport } from './types';
14
11
  /**
15
12
  * Agent Grounding Tool Provider
16
13
  */
17
- export const AgentGroundingProvider: ToolProvider = {
14
+ export const AgentGroundingProvider = createProvider({
18
15
  id: ToolName.AgentGrounding,
19
16
  alias: ['agent-grounding', 'grounding', 'navigation'],
20
-
21
- async analyze(options: ScanOptions): Promise<SpokeOutput> {
22
- const report = await analyzeAgentGrounding(
23
- options as AgentGroundingOptions
24
- );
25
-
26
- const results: AnalysisResult[] = report.issues.map((i) => ({
27
- fileName: i.location.file,
28
- issues: [i] as any[],
17
+ version: '0.9.5',
18
+ defaultWeight: 10,
19
+ async analyzeReport(options: ScanOptions) {
20
+ return analyzeAgentGrounding(options as AgentGroundingOptions);
21
+ },
22
+ getResults(report): AnalysisResult[] {
23
+ return report.issues.map((issue) => ({
24
+ fileName: issue.location.file,
25
+ issues: [issue] as any[],
29
26
  metrics: {
30
27
  agentGroundingScore: report.summary.score,
31
28
  },
32
29
  }));
33
-
34
- return SpokeOutputSchema.parse({
35
- results,
36
- summary: report.summary,
37
- metadata: {
38
- toolName: ToolName.AgentGrounding,
39
- version: '0.9.5',
40
- timestamp: new Date().toISOString(),
41
- rawData: report.rawData,
42
- },
43
- });
44
30
  },
45
-
46
- score(output: SpokeOutput, options: ScanOptions): ToolScoringOutput {
31
+ getSummary(report) {
32
+ return report.summary;
33
+ },
34
+ getMetadata(report) {
35
+ return { rawData: report.rawData };
36
+ },
37
+ score(output) {
47
38
  const report = {
48
39
  summary: output.summary,
49
40
  rawData: (output.metadata as any).rawData,
50
41
  recommendations: (output.summary as any).recommendations || [],
51
42
  } as unknown as AgentGroundingReport;
52
-
53
43
  return calculateGroundingScore(report);
54
44
  },
55
-
56
- defaultWeight: 10,
57
- };
45
+ });