adapt-api 1.0.0 → 1.0.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.
- package/README.md +69 -28
- package/docs/FILE_REFERENCE.md +83 -0
- package/package.json +9 -4
package/README.md
CHANGED
|
@@ -1,75 +1,116 @@
|
|
|
1
1
|
# adapt-api
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Professional Node.js CLI package for ADAPT-based API readiness assessment.
|
|
4
4
|
|
|
5
|
-
##
|
|
5
|
+
## Contributors
|
|
6
6
|
|
|
7
|
-
-
|
|
8
|
-
-
|
|
9
|
-
- Modular ADAPT engine (spec loading, heuristic checks, LLM evaluation, disposition rules)
|
|
10
|
-
- Output factory for `json`, `text`, or `pdf`
|
|
11
|
-
- Spinner-based progress with `ora`
|
|
12
|
-
- Local config persistence via `conf` in the user config directory
|
|
7
|
+
- Pankaj Kumar Jain
|
|
8
|
+
- Jahnavi Thirumalasetty
|
|
13
9
|
|
|
14
|
-
##
|
|
10
|
+
## Overview
|
|
15
11
|
|
|
16
|
-
|
|
12
|
+
`adapt-api` evaluates OpenAPI/RAML specifications for agent-readiness using the ADAPT framework.
|
|
13
|
+
The installed package name is `adapt-api`, while the executable command is `apiadapt`.
|
|
14
|
+
|
|
15
|
+
## Key Capabilities
|
|
16
|
+
|
|
17
|
+
- Persistent CLI configuration (`llm`, `model`, `format`, `api key`, `base url`)
|
|
18
|
+
- Multi-provider LLM evaluation (`ollama`, `openai`, `anthropic`)
|
|
19
|
+
- Heuristic fallback assessment when LLM is unavailable
|
|
20
|
+
- ADAPT disposition and summary generation
|
|
21
|
+
- Output rendering in `text`, `json`, and `pdf`
|
|
22
|
+
- Manual/help experience with practical command examples
|
|
23
|
+
|
|
24
|
+
## Installation
|
|
25
|
+
|
|
26
|
+
`adapt-api` is already published on npm, and this GitHub repository contains the same source code used for the package.
|
|
27
|
+
|
|
28
|
+
Install the latest published CLI globally:
|
|
17
29
|
|
|
18
30
|
```bash
|
|
19
31
|
npm install -g adapt-api
|
|
20
32
|
```
|
|
21
33
|
|
|
22
|
-
|
|
34
|
+
If you want to run or modify the source from this repository:
|
|
23
35
|
|
|
24
36
|
```bash
|
|
25
37
|
npm install
|
|
26
38
|
```
|
|
27
39
|
|
|
28
|
-
|
|
40
|
+
Optionally link the local build for command testing:
|
|
29
41
|
|
|
30
42
|
```bash
|
|
31
43
|
npm link
|
|
32
44
|
```
|
|
33
45
|
|
|
34
|
-
##
|
|
46
|
+
## CLI Command
|
|
35
47
|
|
|
36
|
-
|
|
48
|
+
After installation, run:
|
|
37
49
|
|
|
38
50
|
```bash
|
|
39
|
-
apiadapt
|
|
51
|
+
apiadapt --help
|
|
40
52
|
```
|
|
41
53
|
|
|
42
|
-
|
|
54
|
+
## Quick Start
|
|
55
|
+
|
|
56
|
+
Set defaults (OpenAI example):
|
|
43
57
|
|
|
44
58
|
```bash
|
|
45
|
-
apiadapt config
|
|
59
|
+
apiadapt config --llm openai --model gpt-4o-mini --format json --api-key <OPENAI_API_KEY>
|
|
46
60
|
```
|
|
47
61
|
|
|
48
|
-
|
|
62
|
+
Evaluate a spec:
|
|
49
63
|
|
|
50
64
|
```bash
|
|
51
|
-
apiadapt eval ./openapi.yaml
|
|
65
|
+
apiadapt eval ./openapi.yaml --format text --print
|
|
52
66
|
```
|
|
53
67
|
|
|
54
|
-
|
|
68
|
+
Generate a PDF report:
|
|
55
69
|
|
|
56
70
|
```bash
|
|
57
|
-
apiadapt eval ./openapi.yaml --format pdf --output ./report.pdf
|
|
71
|
+
apiadapt eval ./openapi.yaml --format pdf --output ./reports/adapt-report.pdf
|
|
58
72
|
```
|
|
59
73
|
|
|
60
|
-
|
|
74
|
+
Open full manual:
|
|
61
75
|
|
|
62
76
|
```bash
|
|
63
|
-
apiadapt
|
|
77
|
+
apiadapt manual
|
|
64
78
|
```
|
|
65
79
|
|
|
66
|
-
##
|
|
80
|
+
## Command Reference
|
|
67
81
|
|
|
68
82
|
- `apiadapt config [--llm] [--model] [--format] [--api-key] [--base-url]`
|
|
83
|
+
- Saves persistent defaults for provider/model/output and connection settings.
|
|
69
84
|
- `apiadapt eval <file_path> [--format] [--output] [--print]`
|
|
85
|
+
- Executes ADAPT assessment and prints/saves formatted output.
|
|
86
|
+
- `apiadapt manual` (alias: `apiadapt man`)
|
|
87
|
+
- Displays full usage manual with examples.
|
|
88
|
+
|
|
89
|
+
## LLM Provider Notes
|
|
90
|
+
|
|
91
|
+
- `ollama`: defaults to `http://localhost:11434` unless `--base-url` is set.
|
|
92
|
+
- `openai`: requires `--api-key`; base URL defaults to `https://api.openai.com`.
|
|
93
|
+
- `anthropic`: requires `--api-key`; base URL defaults to `https://api.anthropic.com`.
|
|
94
|
+
|
|
95
|
+
If LLM requests fail, evaluation gracefully falls back to heuristic ADAPT checks.
|
|
96
|
+
|
|
97
|
+
## Publishing
|
|
98
|
+
|
|
99
|
+
Pre-publish validation:
|
|
100
|
+
|
|
101
|
+
```bash
|
|
102
|
+
npm run prepublishOnly
|
|
103
|
+
npm pack --dry-run
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
Publish:
|
|
107
|
+
|
|
108
|
+
```bash
|
|
109
|
+
npm publish --access public
|
|
110
|
+
```
|
|
111
|
+
|
|
112
|
+
## File Documentation
|
|
70
113
|
|
|
71
|
-
|
|
114
|
+
Detailed file-by-file purpose and functionality documentation is available at:
|
|
72
115
|
|
|
73
|
-
-
|
|
74
|
-
- Ollama defaults to `http://localhost:11434`; override with `--base-url`.
|
|
75
|
-
- If LLM evaluation fails, the CLI falls back to heuristic assessment and still returns output.
|
|
116
|
+
- `docs/FILE_REFERENCE.md`
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
# File Reference
|
|
2
|
+
|
|
3
|
+
This document explains the purpose and functionality of each maintained source file in `adapt-api`.
|
|
4
|
+
|
|
5
|
+
## Root Files
|
|
6
|
+
|
|
7
|
+
- `package.json`
|
|
8
|
+
Defines npm package metadata, dependencies, scripts, publish settings, and CLI binary mapping.
|
|
9
|
+
|
|
10
|
+
- `package-lock.json`
|
|
11
|
+
Locks dependency versions for reproducible installs.
|
|
12
|
+
|
|
13
|
+
- `README.md`
|
|
14
|
+
Primary user/developer documentation including installation, usage, and publishing.
|
|
15
|
+
|
|
16
|
+
- `LICENSE`
|
|
17
|
+
Project license terms and contributor copyright notice.
|
|
18
|
+
|
|
19
|
+
- `.gitignore`
|
|
20
|
+
Excludes local artifacts (`node_modules`, temp config, generated reports, tarballs).
|
|
21
|
+
|
|
22
|
+
## CLI Entrypoint
|
|
23
|
+
|
|
24
|
+
- `bin/apiadapt.js`
|
|
25
|
+
Executable entry script (with shebang) that invokes the main CLI runner and handles top-level errors.
|
|
26
|
+
|
|
27
|
+
## Core CLI Wiring
|
|
28
|
+
|
|
29
|
+
- `src/cli.js`
|
|
30
|
+
Registers commands/options using `commander`, defines help text, and routes commands to handlers.
|
|
31
|
+
|
|
32
|
+
## Command Handlers
|
|
33
|
+
|
|
34
|
+
- `src/commands/config.js`
|
|
35
|
+
Implements `apiadapt config`; supports flag-based and interactive configuration updates.
|
|
36
|
+
|
|
37
|
+
- `src/commands/eval.js`
|
|
38
|
+
Implements `apiadapt eval`; runs assessment flow, renders output, and writes/prints results.
|
|
39
|
+
|
|
40
|
+
- `src/commands/manual.js`
|
|
41
|
+
Implements `apiadapt manual`; prints complete command manual and examples.
|
|
42
|
+
|
|
43
|
+
## Engine Layer
|
|
44
|
+
|
|
45
|
+
- `src/engine/evaluator.js`
|
|
46
|
+
Orchestrates full evaluation pipeline: file loading, heuristic pass, LLM pass, disposition, and metadata.
|
|
47
|
+
|
|
48
|
+
- `src/engine/heuristics.js`
|
|
49
|
+
Provides deterministic baseline ADAPT checks when LLM output is unavailable or invalid.
|
|
50
|
+
|
|
51
|
+
- `src/engine/disposition.js`
|
|
52
|
+
Encapsulates ADAPT disposition rules and human-readable summary generation from identified gaps.
|
|
53
|
+
|
|
54
|
+
- `src/engine/llmClients.js`
|
|
55
|
+
Integrates provider-specific LLM calls (Ollama/OpenAI/Anthropic), parsing, normalization, and timeout/error handling.
|
|
56
|
+
|
|
57
|
+
- `src/engine/SystemPrompt.txt`
|
|
58
|
+
Canonical ADAPT system prompt consumed by `llmClients.js` for LLM assessment requests.
|
|
59
|
+
|
|
60
|
+
## Output Formatters
|
|
61
|
+
|
|
62
|
+
- `src/formatters/index.js`
|
|
63
|
+
Selects formatter by output type and centralizes output file write behavior.
|
|
64
|
+
|
|
65
|
+
- `src/formatters/jsonFormatter.js`
|
|
66
|
+
Serializes report payloads into pretty-printed JSON.
|
|
67
|
+
|
|
68
|
+
- `src/formatters/textFormatter.js`
|
|
69
|
+
Builds readable plain-text report output for terminal or file usage.
|
|
70
|
+
|
|
71
|
+
- `src/formatters/pdfFormatter.js`
|
|
72
|
+
Generates a headless PDF assessment report using `pdfkit`.
|
|
73
|
+
|
|
74
|
+
## Utility Modules
|
|
75
|
+
|
|
76
|
+
- `src/utils/configStore.js`
|
|
77
|
+
Manages persistent local configuration with validation and lazy config initialization.
|
|
78
|
+
|
|
79
|
+
- `src/utils/specLoader.js`
|
|
80
|
+
Reads API spec files, infers type (JSON/YAML/RAML), parses content, and returns normalized metadata.
|
|
81
|
+
|
|
82
|
+
- `src/utils/prompts.js`
|
|
83
|
+
Provides small interactive question helper for CLI prompt flows.
|
package/package.json
CHANGED
|
@@ -1,12 +1,16 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "adapt-api",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.2",
|
|
4
4
|
"description": "ADAPT API readiness assessment CLI",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
7
|
-
"homepage": "https://
|
|
7
|
+
"homepage": "https://github.com/apiadapt/adapt-framework#readme",
|
|
8
8
|
"bugs": {
|
|
9
|
-
"url": "https://
|
|
9
|
+
"url": "https://github.com/apiadapt/adapt-framework/issues"
|
|
10
|
+
},
|
|
11
|
+
"repository": {
|
|
12
|
+
"type": "git",
|
|
13
|
+
"url": "https://github.com/apiadapt/adapt-framework.git"
|
|
10
14
|
},
|
|
11
15
|
"bin": {
|
|
12
16
|
"apiadapt": "./bin/apiadapt.js"
|
|
@@ -14,6 +18,7 @@
|
|
|
14
18
|
"files": [
|
|
15
19
|
"bin/",
|
|
16
20
|
"src/",
|
|
21
|
+
"docs/",
|
|
17
22
|
"README.md",
|
|
18
23
|
"LICENSE"
|
|
19
24
|
],
|
|
@@ -41,6 +46,6 @@
|
|
|
41
46
|
"fs-extra": "^11.3.2",
|
|
42
47
|
"js-yaml": "^4.1.0",
|
|
43
48
|
"ora": "^9.0.0",
|
|
44
|
-
"pdfkit": "^0.
|
|
49
|
+
"pdfkit": "^0.18.0"
|
|
45
50
|
}
|
|
46
51
|
}
|