@agentlighthouse/core 0.1.0-alpha.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 (78) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +16 -0
  3. package/dist/analyzers/mcp.d.ts +8 -0
  4. package/dist/analyzers/mcp.d.ts.map +1 -0
  5. package/dist/analyzers/mcp.js +214 -0
  6. package/dist/analyzers/openapi.d.ts +7 -0
  7. package/dist/analyzers/openapi.d.ts.map +1 -0
  8. package/dist/analyzers/openapi.js +344 -0
  9. package/dist/analyzers/readiness.d.ts +8 -0
  10. package/dist/analyzers/readiness.d.ts.map +1 -0
  11. package/dist/analyzers/readiness.js +766 -0
  12. package/dist/analyzers/tasks.d.ts +3 -0
  13. package/dist/analyzers/tasks.d.ts.map +1 -0
  14. package/dist/analyzers/tasks.js +140 -0
  15. package/dist/changes/files.d.ts +5 -0
  16. package/dist/changes/files.d.ts.map +1 -0
  17. package/dist/changes/files.js +71 -0
  18. package/dist/comparison/compare.d.ts +14 -0
  19. package/dist/comparison/compare.d.ts.map +1 -0
  20. package/dist/comparison/compare.js +323 -0
  21. package/dist/config/profile.d.ts +16 -0
  22. package/dist/config/profile.d.ts.map +1 -0
  23. package/dist/config/profile.js +47 -0
  24. package/dist/detection/project.d.ts +4 -0
  25. package/dist/detection/project.d.ts.map +1 -0
  26. package/dist/detection/project.js +225 -0
  27. package/dist/findings/helpers.d.ts +36 -0
  28. package/dist/findings/helpers.d.ts.map +1 -0
  29. package/dist/findings/helpers.js +115 -0
  30. package/dist/findings/locations.d.ts +4 -0
  31. package/dist/findings/locations.d.ts.map +1 -0
  32. package/dist/findings/locations.js +117 -0
  33. package/dist/generators/artifacts.d.ts +6 -0
  34. package/dist/generators/artifacts.d.ts.map +1 -0
  35. package/dist/generators/artifacts.js +255 -0
  36. package/dist/index.d.ts +486 -0
  37. package/dist/index.d.ts.map +1 -0
  38. package/dist/index.js +451 -0
  39. package/dist/probes/commands.d.ts +7 -0
  40. package/dist/probes/commands.d.ts.map +1 -0
  41. package/dist/probes/commands.js +198 -0
  42. package/dist/reporters/cli.d.ts +4 -0
  43. package/dist/reporters/cli.d.ts.map +1 -0
  44. package/dist/reporters/cli.js +42 -0
  45. package/dist/reporters/comparison.d.ts +13 -0
  46. package/dist/reporters/comparison.d.ts.map +1 -0
  47. package/dist/reporters/comparison.js +227 -0
  48. package/dist/reporters/github-summary.d.ts +4 -0
  49. package/dist/reporters/github-summary.d.ts.map +1 -0
  50. package/dist/reporters/github-summary.js +4 -0
  51. package/dist/reporters/json.d.ts +3 -0
  52. package/dist/reporters/json.d.ts.map +1 -0
  53. package/dist/reporters/json.js +3 -0
  54. package/dist/reporters/markdown.d.ts +3 -0
  55. package/dist/reporters/markdown.d.ts.map +1 -0
  56. package/dist/reporters/markdown.js +146 -0
  57. package/dist/reporters/pr-summary.d.ts +8 -0
  58. package/dist/reporters/pr-summary.d.ts.map +1 -0
  59. package/dist/reporters/pr-summary.js +38 -0
  60. package/dist/reporters/sarif.d.ts +3 -0
  61. package/dist/reporters/sarif.d.ts.map +1 -0
  62. package/dist/reporters/sarif.js +119 -0
  63. package/dist/reporters/shared.d.ts +8 -0
  64. package/dist/reporters/shared.d.ts.map +1 -0
  65. package/dist/reporters/shared.js +26 -0
  66. package/dist/scanners/filesystem.d.ts +6 -0
  67. package/dist/scanners/filesystem.d.ts.map +1 -0
  68. package/dist/scanners/filesystem.js +231 -0
  69. package/dist/schemas/types.d.ts +6652 -0
  70. package/dist/schemas/types.d.ts.map +1 -0
  71. package/dist/schemas/types.js +383 -0
  72. package/dist/scoring/calibration.d.ts +18 -0
  73. package/dist/scoring/calibration.d.ts.map +1 -0
  74. package/dist/scoring/calibration.js +231 -0
  75. package/dist/scoring/model.d.ts +21 -0
  76. package/dist/scoring/model.d.ts.map +1 -0
  77. package/dist/scoring/model.js +109 -0
  78. package/package.json +58 -0
@@ -0,0 +1,255 @@
1
+ export class StarterArtifactGenerator {
2
+ id = "starter-artifacts";
3
+ generate(signals) {
4
+ return [
5
+ {
6
+ path: "AGENTS.md",
7
+ description: "Agent operating guide",
8
+ content: agentsTemplate(signals)
9
+ },
10
+ {
11
+ path: "CLAUDE.md",
12
+ description: "Claude Code project memory",
13
+ content: claudeTemplate(signals)
14
+ },
15
+ {
16
+ path: "llms.txt",
17
+ description: "LLM-readable project map",
18
+ content: llmsTemplate(signals)
19
+ },
20
+ {
21
+ path: ".agentlighthouseignore",
22
+ description: "AgentLighthouse scan ignore file",
23
+ content: agentLighthouseIgnoreTemplate()
24
+ },
25
+ {
26
+ path: "agentlighthouse.tasks.yaml",
27
+ description: "Starter deterministic agent task benchmark",
28
+ content: benchmarkTemplate(signals)
29
+ }
30
+ ];
31
+ }
32
+ }
33
+ function commandOrFallback(signals, script, fallback) {
34
+ return signals.packageJson?.scripts[script] ? `pnpm ${script}` : fallback;
35
+ }
36
+ function agentsTemplate(signals) {
37
+ const projectName = signals.projectName;
38
+ return `# Agent Instructions for ${projectName}
39
+
40
+ ## Project Overview
41
+ ${projectName} is a software project that should be easy for AI coding agents to inspect, modify, test, and document safely. Keep this file current whenever setup, architecture, or workflows change.
42
+
43
+ ## Setup Commands
44
+ - Install dependencies: pnpm install
45
+ - Start local development: ${commandOrFallback(signals, "dev", "pnpm dev")}
46
+ - Build: ${commandOrFallback(signals, "build", "pnpm build")}
47
+
48
+ ## Test, Lint, and Typecheck Commands
49
+ - Tests: ${commandOrFallback(signals, "test", "pnpm test")}
50
+ - Lint: ${commandOrFallback(signals, "lint", "pnpm lint")}
51
+ - Typecheck: ${commandOrFallback(signals, "typecheck", "pnpm typecheck")}
52
+
53
+ ## Coding Conventions
54
+ - Prefer small, typed modules with clear ownership boundaries.
55
+ - Follow existing naming, formatting, and package structure before introducing new abstractions.
56
+ - Keep deterministic logic separate from optional model-provider integrations.
57
+ - Add or update tests for scanner, scoring, generator, and CLI behavior when functionality changes.
58
+
59
+ ## Architecture Notes
60
+ - Keep core product logic in shared packages, not in UI or CLI command handlers.
61
+ - Treat generated artifacts as suggestions unless a command explicitly writes them.
62
+ - Make future integrations possible through interfaces rather than hardcoded provider logic.
63
+
64
+ ## Files and Directories to Avoid Modifying Casually
65
+ - Do not edit dependency directories, generated build output, coverage, or temporary validation repositories.
66
+ - Do not commit secrets, local environment files, or third-party repositories cloned for validation.
67
+ - Avoid broad formatting churn unless the task is specifically about formatting.
68
+
69
+ ## Privacy and Security Rules
70
+ - Never expose secrets, credentials, private tokens, or user data in docs, examples, reports, or tests.
71
+ - Use obviously fake placeholders such as EXAMPLE_API_KEY instead of realistic secrets.
72
+ - Be explicit when a workflow would send code, docs, or logs to an external LLM or service.
73
+
74
+ ## Adding New Features
75
+ - Start in the smallest package that owns the behavior.
76
+ - Add schemas or interfaces before wiring feature-specific implementations.
77
+ - Include a realistic sample or validation case when adding scanner rules.
78
+
79
+ ## Reporting Uncertainty
80
+ - If behavior depends on unavailable services, credentials, or private context, say so clearly.
81
+ - Prefer a conservative finding with evidence over an overconfident recommendation.
82
+ `;
83
+ }
84
+ function claudeTemplate(signals) {
85
+ return `# Claude Project Memory: ${signals.projectName}
86
+
87
+ ${signals.projectName} should remain agent-readable, deterministic by default, and easy to validate locally.
88
+
89
+ ## Preferred Workflow
90
+ - Install with pnpm install.
91
+ - Run tests before handing back scanner, scoring, or generator changes.
92
+ - Run lint and typecheck for TypeScript changes.
93
+ - Keep generated files and third-party validation repositories out of commits.
94
+
95
+ ## Testing Expectations
96
+ - Core scanner and scoring changes need focused unit tests.
97
+ - CLI behavior should stay thin and rely on core contracts.
98
+ - Documentation changes should keep commands consistent with package scripts.
99
+
100
+ ## Product Boundaries
101
+ - Do not turn this project into a general chatbot, AI IDE, model gateway, or hosted governance suite by default.
102
+ - Generation is a feature; verification and evidence-based readiness scoring are the product.
103
+
104
+ ## Naming Conventions
105
+ - Use "AgentLighthouse" for the product.
106
+ - Use "agent-readiness" for the product category.
107
+ - Keep finding IDs stable and namespaced by analyzer area.
108
+ `;
109
+ }
110
+ function llmsTemplate(signals) {
111
+ return `# ${signals.projectName}
112
+
113
+ Agent-readable project map for AI coding assistants.
114
+
115
+ ## Overview
116
+ ${signals.projectName} is designed to be inspected and improved by coding agents using deterministic project context.
117
+
118
+ ## Key Links
119
+ - [README](README.md)
120
+ - [Architecture](docs/ARCHITECTURE.md)
121
+ - [Product Spec](docs/PRODUCT_SPEC.md)
122
+ - [Scoring Model](docs/SCORING_MODEL.md)
123
+ - [Development Guide](docs/DEVELOPMENT.md)
124
+ - [Validation Guide](docs/VALIDATION.md)
125
+ - [Agent Instructions](AGENTS.md)
126
+ - [Agent Task Benchmark](agentlighthouse.tasks.yaml)
127
+
128
+ ## Example Usage
129
+ - Run a scan: \`agentlighthouse scan .\`
130
+ - Generate starter artifacts: \`agentlighthouse init .\`
131
+ `;
132
+ }
133
+ function agentLighthouseIgnoreTemplate() {
134
+ return `node_modules/
135
+ .git/
136
+ dist/
137
+ build/
138
+ coverage/
139
+ .next/
140
+ .turbo/
141
+ .vercel/
142
+ .tmp/
143
+ vendor/
144
+ *.log
145
+ .env
146
+ .env.*
147
+ secrets/
148
+ *.key
149
+ *.pem
150
+ pnpm-lock.yaml
151
+ package-lock.json
152
+ yarn.lock
153
+ `;
154
+ }
155
+ function benchmarkTemplate(signals) {
156
+ return `version: 0.1.0
157
+ project: ${signals.projectName}
158
+ tasks:
159
+ - id: install-project
160
+ title: Install the project
161
+ persona: new contributor using an AI coding agent
162
+ objective: Install dependencies, identify the package manager, and verify the project reaches a working local state.
163
+ projectAreas:
164
+ - setup
165
+ - documentation
166
+ requiredDocs:
167
+ - README.md
168
+ - AGENTS.md
169
+ allowedFiles:
170
+ - package.json
171
+ - README.md
172
+ - AGENTS.md
173
+ disallowedFiles:
174
+ - node_modules/**
175
+ - .env
176
+ expectedActions:
177
+ - Read README and AGENTS.md before running commands.
178
+ - Identify the package manager from package metadata.
179
+ expectedOutputs:
180
+ - A short note with the install command and any missing prerequisite.
181
+ successCriteria:
182
+ - Dependencies install without undocumented prerequisites.
183
+ - The agent can identify the package manager.
184
+ verificationCommands:
185
+ - pnpm test
186
+ riskLevel: low
187
+ commonFailureModes:
188
+ - Runs an install command that is not documented.
189
+ - Ignores package manager metadata.
190
+ - id: run-tests
191
+ title: Run the test suite
192
+ persona: maintainer checking a small change
193
+ objective: Run the documented verification commands and summarize failures with actionable file paths.
194
+ projectAreas:
195
+ - tests
196
+ - ci
197
+ requiredDocs:
198
+ - README.md
199
+ - AGENTS.md
200
+ allowedFiles:
201
+ - package.json
202
+ - packages/**
203
+ - apps/**
204
+ disallowedFiles:
205
+ - node_modules/**
206
+ - dist/**
207
+ expectedActions:
208
+ - Run the test command.
209
+ - Run typecheck or lint if documented.
210
+ expectedOutputs:
211
+ - Test result summary with failing command and file paths if any.
212
+ successCriteria:
213
+ - The documented test command is discoverable.
214
+ - Test output can be interpreted without hidden context.
215
+ verificationCommands:
216
+ - pnpm test
217
+ - pnpm typecheck
218
+ riskLevel: low
219
+ commonFailureModes:
220
+ - Reports success without running the documented command.
221
+ - Omits failing file paths.
222
+ - id: add-small-scanner-rule
223
+ title: Add a small scanner rule
224
+ persona: product engineer extending deterministic analysis
225
+ objective: Add a deterministic scanner rule for a missing documentation signal and cover it with a unit test.
226
+ projectAreas:
227
+ - packages/core
228
+ - tests
229
+ requiredDocs:
230
+ - docs/ARCHITECTURE.md
231
+ - docs/RULES.md
232
+ - AGENTS.md
233
+ allowedFiles:
234
+ - packages/core/**
235
+ - docs/RULES.md
236
+ disallowedFiles:
237
+ - validation/reports/external/**
238
+ expectedActions:
239
+ - Add a stable finding rule ID.
240
+ - Add or update a focused unit test.
241
+ expectedOutputs:
242
+ - Code change plus passing test command.
243
+ successCriteria:
244
+ - The agent finds the scanner and analyzer modules.
245
+ - The new rule produces a structured finding.
246
+ - Tests pass.
247
+ verificationCommands:
248
+ - pnpm test
249
+ - pnpm typecheck
250
+ riskLevel: medium
251
+ commonFailureModes:
252
+ - Adds a vague finding without an agent failure mode.
253
+ - Changes scoring globally without a test.
254
+ `;
255
+ }