agentflight 0.1.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.
- package/LICENSE +201 -0
- package/README.md +152 -0
- package/dist/adapters/agentloopkit.d.ts +10 -0
- package/dist/adapters/agentloopkit.d.ts.map +1 -0
- package/dist/adapters/agentloopkit.js +68 -0
- package/dist/adapters/agentloopkit.js.map +1 -0
- package/dist/adapters/projscan.d.ts +10 -0
- package/dist/adapters/projscan.d.ts.map +1 -0
- package/dist/adapters/projscan.js +54 -0
- package/dist/adapters/projscan.js.map +1 -0
- package/dist/cli.d.ts +5 -0
- package/dist/cli.d.ts.map +1 -0
- package/dist/cli.js +95 -0
- package/dist/cli.js.map +1 -0
- package/dist/commands/doctor.d.ts +16 -0
- package/dist/commands/doctor.d.ts.map +1 -0
- package/dist/commands/doctor.js +91 -0
- package/dist/commands/doctor.js.map +1 -0
- package/dist/commands/init.d.ts +9 -0
- package/dist/commands/init.d.ts.map +1 -0
- package/dist/commands/init.js +28 -0
- package/dist/commands/init.js.map +1 -0
- package/dist/commands/replay.d.ts +10 -0
- package/dist/commands/replay.d.ts.map +1 -0
- package/dist/commands/replay.js +32 -0
- package/dist/commands/replay.js.map +1 -0
- package/dist/commands/report.d.ts +10 -0
- package/dist/commands/report.d.ts.map +1 -0
- package/dist/commands/report.js +30 -0
- package/dist/commands/report.js.map +1 -0
- package/dist/commands/resume.d.ts +10 -0
- package/dist/commands/resume.d.ts.map +1 -0
- package/dist/commands/resume.js +34 -0
- package/dist/commands/resume.js.map +1 -0
- package/dist/commands/start.d.ts +20 -0
- package/dist/commands/start.d.ts.map +1 -0
- package/dist/commands/start.js +89 -0
- package/dist/commands/start.js.map +1 -0
- package/dist/commands/status.d.ts +12 -0
- package/dist/commands/status.d.ts.map +1 -0
- package/dist/commands/status.js +55 -0
- package/dist/commands/status.js.map +1 -0
- package/dist/core/config.d.ts +23 -0
- package/dist/core/config.d.ts.map +1 -0
- package/dist/core/config.js +74 -0
- package/dist/core/config.js.map +1 -0
- package/dist/core/doctor.d.ts +22 -0
- package/dist/core/doctor.d.ts.map +1 -0
- package/dist/core/doctor.js +68 -0
- package/dist/core/doctor.js.map +1 -0
- package/dist/core/fs-safe.d.ts +14 -0
- package/dist/core/fs-safe.d.ts.map +1 -0
- package/dist/core/fs-safe.js +31 -0
- package/dist/core/fs-safe.js.map +1 -0
- package/dist/core/git.d.ts +7 -0
- package/dist/core/git.d.ts.map +1 -0
- package/dist/core/git.js +40 -0
- package/dist/core/git.js.map +1 -0
- package/dist/core/output.d.ts +6 -0
- package/dist/core/output.d.ts.map +1 -0
- package/dist/core/output.js +11 -0
- package/dist/core/output.js.map +1 -0
- package/dist/core/paths.d.ts +3 -0
- package/dist/core/paths.d.ts.map +1 -0
- package/dist/core/paths.js +15 -0
- package/dist/core/paths.js.map +1 -0
- package/dist/core/process.d.ts +11 -0
- package/dist/core/process.d.ts.map +1 -0
- package/dist/core/process.js +27 -0
- package/dist/core/process.js.map +1 -0
- package/dist/core/project.d.ts +4 -0
- package/dist/core/project.d.ts.map +1 -0
- package/dist/core/project.js +25 -0
- package/dist/core/project.js.map +1 -0
- package/dist/core/risk.d.ts +4 -0
- package/dist/core/risk.d.ts.map +1 -0
- package/dist/core/risk.js +110 -0
- package/dist/core/risk.js.map +1 -0
- package/dist/core/session.d.ts +26 -0
- package/dist/core/session.d.ts.map +1 -0
- package/dist/core/session.js +83 -0
- package/dist/core/session.js.map +1 -0
- package/dist/core/verification.d.ts +5 -0
- package/dist/core/verification.d.ts.map +1 -0
- package/dist/core/verification.js +14 -0
- package/dist/core/verification.js.map +1 -0
- package/dist/renderers/html-replay.d.ts +17 -0
- package/dist/renderers/html-replay.d.ts.map +1 -0
- package/dist/renderers/html-replay.js +84 -0
- package/dist/renderers/html-replay.js.map +1 -0
- package/dist/renderers/markdown-report.d.ts +16 -0
- package/dist/renderers/markdown-report.d.ts.map +1 -0
- package/dist/renderers/markdown-report.js +80 -0
- package/dist/renderers/markdown-report.js.map +1 -0
- package/dist/renderers/resume-prompt.d.ts +13 -0
- package/dist/renderers/resume-prompt.d.ts.map +1 -0
- package/dist/renderers/resume-prompt.js +34 -0
- package/dist/renderers/resume-prompt.js.map +1 -0
- package/dist/types/index.d.ts +93 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/index.js +2 -0
- package/dist/types/index.js.map +1 -0
- package/package.json +66 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,201 @@
|
|
|
1
|
+
Apache License
|
|
2
|
+
Version 2.0, January 2004
|
|
3
|
+
http://www.apache.org/licenses/
|
|
4
|
+
|
|
5
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
6
|
+
|
|
7
|
+
1. Definitions.
|
|
8
|
+
|
|
9
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
10
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
11
|
+
|
|
12
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
13
|
+
the copyright owner that is granting the License.
|
|
14
|
+
|
|
15
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
16
|
+
other entities that control, are controlled by, or are under common
|
|
17
|
+
control with that entity. For the purposes of this definition,
|
|
18
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
19
|
+
direction or management of such entity, whether by contract or
|
|
20
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
21
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
22
|
+
|
|
23
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
24
|
+
exercising permissions granted by this License.
|
|
25
|
+
|
|
26
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
27
|
+
including but not limited to software source code, documentation
|
|
28
|
+
source, and configuration files.
|
|
29
|
+
|
|
30
|
+
"Object" form shall mean any form resulting from mechanical
|
|
31
|
+
transformation or translation of a Source form, including but
|
|
32
|
+
not limited to compiled object code, generated documentation,
|
|
33
|
+
and conversions to other media types.
|
|
34
|
+
|
|
35
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
36
|
+
Object form, made available under the License, as indicated by a
|
|
37
|
+
copyright notice that is included in or attached to the work
|
|
38
|
+
(an example is provided in the Appendix below).
|
|
39
|
+
|
|
40
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
41
|
+
form, that is based on (or derived from) the Work and for which the
|
|
42
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
43
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
44
|
+
of this License, Derivative Works shall not include works that remain
|
|
45
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
46
|
+
the Work and Derivative Works thereof.
|
|
47
|
+
|
|
48
|
+
"Contribution" shall mean any work of authorship, including
|
|
49
|
+
the original version of the Work and any modifications or additions
|
|
50
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
51
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
52
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
53
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
54
|
+
means any form of electronic, verbal, or written communication sent
|
|
55
|
+
to the Licensor or its representatives, including but not limited to
|
|
56
|
+
communication on electronic mailing lists, source code control systems,
|
|
57
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
58
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
59
|
+
excluding communication that is conspicuously marked or otherwise
|
|
60
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
61
|
+
|
|
62
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
63
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
64
|
+
subsequently incorporated within the Work.
|
|
65
|
+
|
|
66
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
67
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
68
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
69
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
70
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
71
|
+
Work and such Derivative Works in Source or Object form.
|
|
72
|
+
|
|
73
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
74
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
75
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
76
|
+
(except as stated in this section) patent license to make, have made,
|
|
77
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
78
|
+
where such license applies only to those patent claims licensable
|
|
79
|
+
by such Contributor that are necessarily infringed by their
|
|
80
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
81
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
82
|
+
institute patent litigation against any entity (including a
|
|
83
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
84
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
85
|
+
or contributory patent infringement, then any patent licenses
|
|
86
|
+
granted to You under this License for that Work shall terminate
|
|
87
|
+
as of the date such litigation is filed.
|
|
88
|
+
|
|
89
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
90
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
91
|
+
modifications, and in Source or Object form, provided that You
|
|
92
|
+
meet the following conditions:
|
|
93
|
+
|
|
94
|
+
(a) You must give any other recipients of the Work or
|
|
95
|
+
Derivative Works a copy of this License; and
|
|
96
|
+
|
|
97
|
+
(b) You must cause any modified files to carry prominent notices
|
|
98
|
+
stating that You changed the files; and
|
|
99
|
+
|
|
100
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
101
|
+
that You distribute, all copyright, patent, trademark, and
|
|
102
|
+
attribution notices from the Source form of the Work,
|
|
103
|
+
excluding those notices that do not pertain to any part of
|
|
104
|
+
the Derivative Works; and
|
|
105
|
+
|
|
106
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
107
|
+
distribution, then any Derivative Works that You distribute must
|
|
108
|
+
include a readable copy of the attribution notices contained
|
|
109
|
+
within such NOTICE file, excluding those notices that do not
|
|
110
|
+
pertain to any part of the Derivative Works, in at least one
|
|
111
|
+
of the following places: within a NOTICE text file distributed
|
|
112
|
+
as part of the Derivative Works; within the Source form or
|
|
113
|
+
documentation, if provided along with the Derivative Works; or,
|
|
114
|
+
within a display generated by the Derivative Works, if and
|
|
115
|
+
wherever such third-party notices normally appear. The contents
|
|
116
|
+
of the NOTICE file are for informational purposes only and
|
|
117
|
+
do not modify the License. You may add Your own attribution
|
|
118
|
+
notices within Derivative Works that You distribute, alongside
|
|
119
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
120
|
+
that such additional attribution notices cannot be construed
|
|
121
|
+
as modifying the License.
|
|
122
|
+
|
|
123
|
+
You may add Your own copyright statement to Your modifications and
|
|
124
|
+
may provide additional or different license terms and conditions
|
|
125
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
126
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
127
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
128
|
+
the conditions stated in this License.
|
|
129
|
+
|
|
130
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
131
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
132
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
133
|
+
this License, without any additional terms or conditions.
|
|
134
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
135
|
+
the terms of any separate license agreement you may have executed
|
|
136
|
+
with Licensor regarding such Contributions.
|
|
137
|
+
|
|
138
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
139
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
140
|
+
except as required for reasonable and customary use in describing the
|
|
141
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
142
|
+
|
|
143
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
144
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
145
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
146
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
147
|
+
implied, including, without limitation, any warranties or conditions
|
|
148
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
149
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
150
|
+
appropriateness of using or redistributing the Work and assume any
|
|
151
|
+
risks associated with Your exercise of permissions under this License.
|
|
152
|
+
|
|
153
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
154
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
155
|
+
unless required by applicable law (such as deliberate and grossly
|
|
156
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
157
|
+
liable to You for damages, including any direct, indirect, special,
|
|
158
|
+
incidental, or consequential damages of any character arising as a
|
|
159
|
+
result of this License or out of the use or inability to use the
|
|
160
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
161
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
162
|
+
other commercial damages or losses), even if such Contributor
|
|
163
|
+
has been advised of the possibility of such damages.
|
|
164
|
+
|
|
165
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
166
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
167
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
168
|
+
or other liability obligations and/or rights consistent with this
|
|
169
|
+
License. However, in accepting such obligations, You may act only
|
|
170
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
171
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
172
|
+
defend, and hold each Contributor harmless for any liability
|
|
173
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
174
|
+
of your accepting any such warranty or additional liability.
|
|
175
|
+
|
|
176
|
+
END OF TERMS AND CONDITIONS
|
|
177
|
+
|
|
178
|
+
APPENDIX: How to apply the Apache License to your work.
|
|
179
|
+
|
|
180
|
+
To apply the Apache License to your work, attach the following
|
|
181
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
182
|
+
replaced with your own identifying information. (Don't include
|
|
183
|
+
the brackets!) The text should be enclosed in the appropriate
|
|
184
|
+
comment syntax for the file format. We also recommend that a
|
|
185
|
+
file or class name and description of purpose be included on the
|
|
186
|
+
same "printed page" as the copyright notice for easier
|
|
187
|
+
identification within third-party archives.
|
|
188
|
+
|
|
189
|
+
Copyright [yyyy] [name of copyright owner]
|
|
190
|
+
|
|
191
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
192
|
+
you may not use this file except in compliance with the License.
|
|
193
|
+
You may obtain a copy of the License at
|
|
194
|
+
|
|
195
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
196
|
+
|
|
197
|
+
Unless required by applicable law or agreed to in writing, software
|
|
198
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
199
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
200
|
+
See the License for the specific language governing permissions and
|
|
201
|
+
limitations under the License.
|
package/README.md
ADDED
|
@@ -0,0 +1,152 @@
|
|
|
1
|
+
# AgentFlight
|
|
2
|
+
|
|
3
|
+
See what your coding agent did. Prove it works. Know what to do next.
|
|
4
|
+
|
|
5
|
+
AgentFlight is a local-first flight recorder for AI coding agents from Baseframe Labs. It records AI-assisted coding sessions, explains what changed, highlights risk, captures proof gaps, generates replay artifacts, and produces a clean handoff for the next agent or human reviewer.
|
|
6
|
+
|
|
7
|
+
AgentFlight is not another coding agent. It is the trust, observability, replay, and proof layer around tools like Codex, Claude Code, Cursor, Windsurf, Gemini CLI, Aider, OpenCode, and similar coding agents.
|
|
8
|
+
|
|
9
|
+
## Why AgentFlight Exists
|
|
10
|
+
|
|
11
|
+
AI coding agents can move quickly, but developers still need to answer practical review questions:
|
|
12
|
+
|
|
13
|
+
- What changed?
|
|
14
|
+
- Which files are risky?
|
|
15
|
+
- What proof exists?
|
|
16
|
+
- What proof is missing?
|
|
17
|
+
- What should the next agent or reviewer do?
|
|
18
|
+
|
|
19
|
+
AgentFlight makes those answers local, inspectable, and repeatable without uploading source code or adding cloud infrastructure.
|
|
20
|
+
|
|
21
|
+
## How It Works
|
|
22
|
+
|
|
23
|
+
AgentFlight creates a local `.agentflight/` directory in your repo:
|
|
24
|
+
|
|
25
|
+
- `config.json` stores local-first project settings.
|
|
26
|
+
- `sessions/` stores session metadata.
|
|
27
|
+
- `current/` stores the active session, handoff, and resume prompt.
|
|
28
|
+
- `reports/` stores Markdown proof reports and HTML replays.
|
|
29
|
+
|
|
30
|
+
Reports include filenames and summaries by default, not full source diffs. AgentFlight does not collect telemetry and does not upload source code.
|
|
31
|
+
|
|
32
|
+
## Quick Start
|
|
33
|
+
|
|
34
|
+
```bash
|
|
35
|
+
npm install
|
|
36
|
+
npm run build
|
|
37
|
+
npx agentflight init
|
|
38
|
+
npx agentflight start --task "Add example feature"
|
|
39
|
+
npx agentflight status
|
|
40
|
+
npx agentflight report
|
|
41
|
+
npx agentflight replay
|
|
42
|
+
npx agentflight resume
|
|
43
|
+
npx agentflight doctor
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
During local development of this repo, use:
|
|
47
|
+
|
|
48
|
+
```bash
|
|
49
|
+
npm run agentflight -- init
|
|
50
|
+
npm run agentflight -- start --task "Add example feature"
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
## Commands
|
|
54
|
+
|
|
55
|
+
- `agentflight init` initializes `.agentflight/` with safe writes.
|
|
56
|
+
- `agentflight start --task "..."` starts a session and writes the current handoff.
|
|
57
|
+
- `agentflight status` summarizes changed files, risk, verification status, and next action.
|
|
58
|
+
- `agentflight report` generates a Markdown proof report.
|
|
59
|
+
- `agentflight replay` generates a local self-contained HTML replay.
|
|
60
|
+
- `agentflight resume` prints and saves a Codex/Claude-ready continuation prompt.
|
|
61
|
+
- `agentflight doctor` checks local setup, scripts, tools, config, and current session state.
|
|
62
|
+
|
|
63
|
+
Future placeholders exist for `upgrade`, `license`, and `login`; AgentFlight Pro/Team is not available yet.
|
|
64
|
+
|
|
65
|
+
## Example Workflow With Codex Or Claude Code
|
|
66
|
+
|
|
67
|
+
```bash
|
|
68
|
+
agentflight init
|
|
69
|
+
agentflight start --task "Add password reset flow"
|
|
70
|
+
|
|
71
|
+
# Run Codex, Claude Code, Cursor, or another coding agent normally.
|
|
72
|
+
|
|
73
|
+
agentflight status
|
|
74
|
+
npm run typecheck
|
|
75
|
+
npm test
|
|
76
|
+
agentflight report
|
|
77
|
+
agentflight replay
|
|
78
|
+
agentflight resume
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
Use the generated report for review and the resume prompt when handing the work to another agent or human.
|
|
82
|
+
|
|
83
|
+
## Powered By ProjScan And AgentLoopKit
|
|
84
|
+
|
|
85
|
+
AgentFlight is powered by two open engines from Baseframe Labs:
|
|
86
|
+
|
|
87
|
+
- ProjScan provides repo intelligence, risk analysis, codebase understanding, and preflight signals.
|
|
88
|
+
- AgentLoopKit provides task discipline, verification evidence, policies, and handoffs.
|
|
89
|
+
|
|
90
|
+
This repository dogfoods both tools from day one. See [docs/development/dogfooding.md](docs/development/dogfooding.md).
|
|
91
|
+
|
|
92
|
+
Strategic architecture:
|
|
93
|
+
|
|
94
|
+
- ProjScan: repo intelligence engine
|
|
95
|
+
- AgentLoopKit: agent workflow discipline engine
|
|
96
|
+
- AgentFlight: commercial and user-facing experience layer
|
|
97
|
+
|
|
98
|
+
## Local-First And Privacy
|
|
99
|
+
|
|
100
|
+
AgentFlight runs locally. It does not add telemetry, login, billing, cloud sync, or source upload. The MVP reads git status and package metadata, writes human-readable local artifacts, and calls local or `npx` ProjScan/AgentLoopKit commands with graceful fallbacks.
|
|
101
|
+
|
|
102
|
+
Runtime session data is ignored by git by default:
|
|
103
|
+
|
|
104
|
+
- `.agentflight/sessions/`
|
|
105
|
+
- `.agentflight/reports/`
|
|
106
|
+
- `.agentflight/current/`
|
|
107
|
+
|
|
108
|
+
`.agentflight/config.json` is intentionally not ignored, so a project can commit its local AgentFlight defaults if that is useful.
|
|
109
|
+
|
|
110
|
+
## Current Status
|
|
111
|
+
|
|
112
|
+
AgentFlight is in MVP development at `0.1.0`.
|
|
113
|
+
|
|
114
|
+
Implemented:
|
|
115
|
+
|
|
116
|
+
- TypeScript ESM npm CLI package
|
|
117
|
+
- Safe local initialization
|
|
118
|
+
- Session start and current handoff
|
|
119
|
+
- Status risk summary
|
|
120
|
+
- Markdown proof reports
|
|
121
|
+
- Self-contained HTML replay
|
|
122
|
+
- Resume prompt generation
|
|
123
|
+
- Doctor checks
|
|
124
|
+
- Defensive ProjScan and AgentLoopKit adapters
|
|
125
|
+
- Vitest coverage for core behavior, renderers, adapters, and command workflow
|
|
126
|
+
|
|
127
|
+
Not implemented:
|
|
128
|
+
|
|
129
|
+
- Cloud sync
|
|
130
|
+
- Login
|
|
131
|
+
- Billing
|
|
132
|
+
- GitHub App
|
|
133
|
+
- Team dashboards
|
|
134
|
+
- Paid feature gates
|
|
135
|
+
|
|
136
|
+
## Roadmap
|
|
137
|
+
|
|
138
|
+
See [docs/roadmap.md](docs/roadmap.md).
|
|
139
|
+
|
|
140
|
+
## Contributing
|
|
141
|
+
|
|
142
|
+
Use the local verification loop before opening changes:
|
|
143
|
+
|
|
144
|
+
```bash
|
|
145
|
+
npm run verify
|
|
146
|
+
```
|
|
147
|
+
|
|
148
|
+
Keep changes scoped, local-first, and honest about proof. Do not claim tests passed unless they actually ran and passed.
|
|
149
|
+
|
|
150
|
+
## License
|
|
151
|
+
|
|
152
|
+
Apache-2.0. See [LICENSE](LICENSE).
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { CommandRunner } from "../core/process.js";
|
|
2
|
+
import type { ToolAdapterResult } from "../types/index.js";
|
|
3
|
+
export interface InspectAgentLoopKitOptions {
|
|
4
|
+
cwd?: string;
|
|
5
|
+
run?: CommandRunner;
|
|
6
|
+
command?: string;
|
|
7
|
+
}
|
|
8
|
+
export declare function inspectAgentLoopKit(options?: InspectAgentLoopKitOptions): Promise<ToolAdapterResult>;
|
|
9
|
+
export declare function createAgentLoopTask(cwd: string, title: string, run?: CommandRunner): Promise<ToolAdapterResult>;
|
|
10
|
+
//# sourceMappingURL=agentloopkit.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"agentloopkit.d.ts","sourceRoot":"","sources":["../../src/adapters/agentloopkit.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAExD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AAE3D,MAAM,WAAW,0BAA0B;IACzC,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,GAAG,CAAC,EAAE,aAAa,CAAC;IACpB,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,wBAAsB,mBAAmB,CACvC,OAAO,GAAE,0BAA+B,GACvC,OAAO,CAAC,iBAAiB,CAAC,CAsC5B;AAED,wBAAsB,mBAAmB,CACvC,GAAG,EAAE,MAAM,EACX,KAAK,EAAE,MAAM,EACb,GAAG,GAAE,aAA0B,GAC9B,OAAO,CAAC,iBAAiB,CAAC,CAoC5B"}
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import { runCommand } from "../core/process.js";
|
|
2
|
+
export async function inspectAgentLoopKit(options = {}) {
|
|
3
|
+
const run = options.run ?? runCommand;
|
|
4
|
+
const command = options.command ?? "agentloopkit";
|
|
5
|
+
const version = await runWithFallback(run, command, "agentloopkit@latest", ["--version"], options.cwd);
|
|
6
|
+
if (version.exitCode !== 0) {
|
|
7
|
+
return {
|
|
8
|
+
available: false,
|
|
9
|
+
warnings: [`AgentLoopKit unavailable: ${summarizeFailure(version)}`]
|
|
10
|
+
};
|
|
11
|
+
}
|
|
12
|
+
const doctor = await runWithFallback(run, command, "agentloopkit@latest", ["doctor"], options.cwd, 20_000);
|
|
13
|
+
const result = {
|
|
14
|
+
available: true,
|
|
15
|
+
version: version.stdout.trim(),
|
|
16
|
+
summary: doctor.stdout.trim() || "AgentLoopKit available for task discipline.",
|
|
17
|
+
warnings: []
|
|
18
|
+
};
|
|
19
|
+
if (doctor.exitCode !== 0) {
|
|
20
|
+
result.warnings.push(`AgentLoopKit doctor reported issues: ${summarizeFailure(doctor)}`);
|
|
21
|
+
}
|
|
22
|
+
return result;
|
|
23
|
+
}
|
|
24
|
+
export async function createAgentLoopTask(cwd, title, run = runCommand) {
|
|
25
|
+
const result = await runWithFallback(run, "agentloopkit", "agentloopkit@latest", [
|
|
26
|
+
"create-task",
|
|
27
|
+
"--title",
|
|
28
|
+
title,
|
|
29
|
+
"--type",
|
|
30
|
+
"feature",
|
|
31
|
+
"--problem",
|
|
32
|
+
`AgentFlight session task: ${title}`,
|
|
33
|
+
"--outcome",
|
|
34
|
+
"Task is implemented with local verification evidence.",
|
|
35
|
+
"--constraint",
|
|
36
|
+
"Keep changes scoped and do not claim completion without proof."
|
|
37
|
+
], cwd, 20_000);
|
|
38
|
+
if (result.exitCode !== 0) {
|
|
39
|
+
return {
|
|
40
|
+
available: false,
|
|
41
|
+
taskLinked: false,
|
|
42
|
+
warnings: [`AgentLoopKit task creation failed: ${summarizeFailure(result)}`]
|
|
43
|
+
};
|
|
44
|
+
}
|
|
45
|
+
return {
|
|
46
|
+
available: true,
|
|
47
|
+
taskLinked: true,
|
|
48
|
+
summary: result.stdout.trim(),
|
|
49
|
+
warnings: []
|
|
50
|
+
};
|
|
51
|
+
}
|
|
52
|
+
function summarizeFailure(result) {
|
|
53
|
+
return (result.stderr || result.stdout || "no output").trim();
|
|
54
|
+
}
|
|
55
|
+
async function runWithFallback(run, localCommand, packageName, args, cwd, timeoutMs = 10_000) {
|
|
56
|
+
const local = await run(localCommand, args, { cwd, timeoutMs });
|
|
57
|
+
if (local.exitCode === 0)
|
|
58
|
+
return local;
|
|
59
|
+
const fallback = await run("npx", ["--yes", packageName, ...args], { cwd, timeoutMs });
|
|
60
|
+
if (fallback.exitCode === 0)
|
|
61
|
+
return fallback;
|
|
62
|
+
return {
|
|
63
|
+
exitCode: fallback.exitCode,
|
|
64
|
+
stdout: fallback.stdout,
|
|
65
|
+
stderr: `${summarizeFailure(local)}; npx fallback failed: ${summarizeFailure(fallback)}`
|
|
66
|
+
};
|
|
67
|
+
}
|
|
68
|
+
//# sourceMappingURL=agentloopkit.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"agentloopkit.js","sourceRoot":"","sources":["../../src/adapters/agentloopkit.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAShD,MAAM,CAAC,KAAK,UAAU,mBAAmB,CACvC,UAAsC,EAAE;IAExC,MAAM,GAAG,GAAG,OAAO,CAAC,GAAG,IAAI,UAAU,CAAC;IACtC,MAAM,OAAO,GAAG,OAAO,CAAC,OAAO,IAAI,cAAc,CAAC;IAClD,MAAM,OAAO,GAAG,MAAM,eAAe,CACnC,GAAG,EACH,OAAO,EACP,qBAAqB,EACrB,CAAC,WAAW,CAAC,EACb,OAAO,CAAC,GAAG,CACZ,CAAC;IAEF,IAAI,OAAO,CAAC,QAAQ,KAAK,CAAC,EAAE,CAAC;QAC3B,OAAO;YACL,SAAS,EAAE,KAAK;YAChB,QAAQ,EAAE,CAAC,6BAA6B,gBAAgB,CAAC,OAAO,CAAC,EAAE,CAAC;SACrE,CAAC;IACJ,CAAC;IAED,MAAM,MAAM,GAAG,MAAM,eAAe,CAClC,GAAG,EACH,OAAO,EACP,qBAAqB,EACrB,CAAC,QAAQ,CAAC,EACV,OAAO,CAAC,GAAG,EACX,MAAM,CACP,CAAC;IACF,MAAM,MAAM,GAAsB;QAChC,SAAS,EAAE,IAAI;QACf,OAAO,EAAE,OAAO,CAAC,MAAM,CAAC,IAAI,EAAE;QAC9B,OAAO,EAAE,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE,IAAI,6CAA6C;QAC9E,QAAQ,EAAE,EAAE;KACb,CAAC;IAEF,IAAI,MAAM,CAAC,QAAQ,KAAK,CAAC,EAAE,CAAC;QAC1B,MAAM,CAAC,QAAQ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K,CAAC;QAAE,OAAO,KAAK,CAAC;IAEvC,MAAM,QAAQ,GAAG,MAAM,GAAG,CAAC,KAAK,EAAE,CAAC,OAAO,EAAE,WAAW,EAAE,GAAG,IAAI,CAAC,EAAE,EAAE,GAAG,EAAE,SAAS,EAAE,CAAC,CAAC;IACvF,IAAI,QAAQ,CAAC,QAAQ,KAAK,CAAC;QAAE,OAAO,QAAQ,CAAC;IAE7C,OAAO;QACL,QAAQ,EAAE,QAAQ,CAAC,QAAQ;QAC3B,MAAM,EAAE,QAAQ,CAAC,MAAM;QACvB,MAAM,EAAE,GAAG,gBAAgB,CAAC,KAAK,CAAC,0BAA0B,gBAAgB,CAAC,QAAQ,CAAC,EAAE;KACzF,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { CommandRunner } from "../core/process.js";
|
|
2
|
+
import type { ToolAdapterResult } from "../types/index.js";
|
|
3
|
+
export interface InspectProjScanOptions {
|
|
4
|
+
cwd?: string;
|
|
5
|
+
run?: CommandRunner;
|
|
6
|
+
command?: string;
|
|
7
|
+
}
|
|
8
|
+
export declare function inspectProjScan(options?: InspectProjScanOptions): Promise<ToolAdapterResult>;
|
|
9
|
+
export declare function runProjScanBaseline(cwd: string, run?: CommandRunner): Promise<ToolAdapterResult>;
|
|
10
|
+
//# sourceMappingURL=projscan.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"projscan.d.ts","sourceRoot":"","sources":["../../src/adapters/projscan.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAExD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AAE3D,MAAM,WAAW,sBAAsB;IACrC,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,GAAG,CAAC,EAAE,aAAa,CAAC;IACpB,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,wBAAsB,eAAe,CACnC,OAAO,GAAE,sBAA2B,GACnC,OAAO,CAAC,iBAAiB,CAAC,CA+B5B;AAED,wBAAsB,mBAAmB,CACvC,GAAG,EAAE,MAAM,EACX,GAAG,GAAE,aAA0B,GAC9B,OAAO,CAAC,iBAAiB,CAAC,CAsB5B"}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { runCommand } from "../core/process.js";
|
|
2
|
+
export async function inspectProjScan(options = {}) {
|
|
3
|
+
const run = options.run ?? runCommand;
|
|
4
|
+
const command = options.command ?? "projscan";
|
|
5
|
+
const version = await runWithFallback(run, command, "projscan@latest", ["--version"], options.cwd);
|
|
6
|
+
if (version.exitCode !== 0) {
|
|
7
|
+
return {
|
|
8
|
+
available: false,
|
|
9
|
+
warnings: [`ProjScan unavailable: ${summarizeFailure(version)}`]
|
|
10
|
+
};
|
|
11
|
+
}
|
|
12
|
+
const help = await runWithFallback(run, command, "projscan@latest", ["--help"], options.cwd);
|
|
13
|
+
const result = {
|
|
14
|
+
available: true,
|
|
15
|
+
version: version.stdout.trim(),
|
|
16
|
+
summary: "ProjScan available for repo intelligence and risk analysis.",
|
|
17
|
+
warnings: []
|
|
18
|
+
};
|
|
19
|
+
if (help.exitCode !== 0) {
|
|
20
|
+
result.warnings.push(`ProjScan help failed: ${summarizeFailure(help)}`);
|
|
21
|
+
}
|
|
22
|
+
return result;
|
|
23
|
+
}
|
|
24
|
+
export async function runProjScanBaseline(cwd, run = runCommand) {
|
|
25
|
+
const result = await runWithFallback(run, "projscan", "projscan@latest", ["start", "--intent", "Build AgentFlight, a local-first flight recorder for AI coding agents"], cwd, 20_000);
|
|
26
|
+
if (result.exitCode !== 0) {
|
|
27
|
+
return {
|
|
28
|
+
available: false,
|
|
29
|
+
warnings: [`ProjScan baseline failed: ${summarizeFailure(result)}`]
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
return {
|
|
33
|
+
available: true,
|
|
34
|
+
summary: result.stdout.split("\n").slice(0, 4).join("\n").trim(),
|
|
35
|
+
warnings: []
|
|
36
|
+
};
|
|
37
|
+
}
|
|
38
|
+
function summarizeFailure(result) {
|
|
39
|
+
return (result.stderr || result.stdout || "no output").trim();
|
|
40
|
+
}
|
|
41
|
+
async function runWithFallback(run, localCommand, packageName, args, cwd, timeoutMs = 10_000) {
|
|
42
|
+
const local = await run(localCommand, args, { cwd, timeoutMs });
|
|
43
|
+
if (local.exitCode === 0)
|
|
44
|
+
return local;
|
|
45
|
+
const fallback = await run("npx", ["--yes", packageName, ...args], { cwd, timeoutMs });
|
|
46
|
+
if (fallback.exitCode === 0)
|
|
47
|
+
return fallback;
|
|
48
|
+
return {
|
|
49
|
+
exitCode: fallback.exitCode,
|
|
50
|
+
stdout: fallback.stdout,
|
|
51
|
+
stderr: `${summarizeFailure(local)}; npx fallback failed: ${summarizeFailure(fallback)}`
|
|
52
|
+
};
|
|
53
|
+
}
|
|
54
|
+
//# sourceMappingURL=projscan.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"projscan.js","sourceRoot":"","sources":["../../src/adapters/projscan.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAShD,MAAM,CAAC,KAAK,UAAU,eAAe,CACnC,UAAkC,EAAE;IAEpC,MAAM,GAAG,GAAG,OAAO,CAAC,GAAG,IAAI,UAAU,CAAC;IACtC,MAAM,OAAO,GAAG,OAAO,CAAC,OAAO,IAAI,UAAU,CAAC;IAC9C,MAAM,OAAO,GAAG,MAAM,eAAe,CACnC,GAAG,EACH,OAAO,EACP,iBAAiB,EACjB,CAAC,WAAW,CAAC,EACb,OAAO,CAAC,GAAG,CACZ,CAAC;IAEF,IAAI,OAAO,CAAC,QAAQ,KAAK,CAAC,EAAE,CAAC;QAC3B,OAAO;YACL,SAAS,EAAE,KAAK;YAChB,QAAQ,EAAE,CAAC,yBAAyB,gBAAgB,CAAC,OAAO,CAAC,EAAE,CAAC;SACjE,CAAC;IACJ,CAAC;IAED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AC,MAAM,IAAI,WAAW,CAAC,CAAC,IAAI,EAAE,CAAC;AAChE,CAAC;AAED,KAAK,UAAU,eAAe,CAC5B,GAAkB,EAClB,YAAoB,EACpB,WAAmB,EACnB,IAAc,EACd,GAAY,EACZ,SAAS,GAAG,MAAM;IAElB,MAAM,KAAK,GAAG,MAAM,GAAG,CAAC,YAAY,EAAE,IAAI,EAAE,EAAE,GAAG,EAAE,SAAS,EAAE,CAAC,CAAC;IAChE,IAAI,KAAK,CAAC,QAAQ,KAAK,CAAC;QAAE,OAAO,KAAK,CAAC;IAEvC,MAAM,QAAQ,GAAG,MAAM,GAAG,CAAC,KAAK,EAAE,CAAC,OAAO,EAAE,WAAW,EAAE,GAAG,IAAI,CAAC,EAAE,EAAE,GAAG,EAAE,SAAS,EAAE,CAAC,CAAC;IACvF,IAAI,QAAQ,CAAC,QAAQ,KAAK,CAAC;QAAE,OAAO,QAAQ,CAAC;IAE7C,OAAO;QACL,QAAQ,EAAE,QAAQ,CAAC,QAAQ;QAC3B,MAAM,EAAE,QAAQ,CAAC,MAAM;QACvB,MAAM,EAAE,GAAG,gBAAgB,CAAC,KAAK,CAAC,0BAA0B,gBAAgB,CAAC,QAAQ,CAAC,EAAE;KACzF,CAAC;AACJ,CAAC"}
|
package/dist/cli.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cli.d.ts","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":";AAGA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAUpC,wBAAgB,SAAS,IAAI,OAAO,CA2EnC;AAYD,wBAAgB,qBAAqB,CAAC,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,SAAS,GAAG,OAAO,CAG5F"}
|
package/dist/cli.js
ADDED
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { resolve } from "node:path";
|
|
3
|
+
import { fileURLToPath } from "node:url";
|
|
4
|
+
import { Command } from "commander";
|
|
5
|
+
import { getRepositoryRoot } from "./core/git.js";
|
|
6
|
+
import { runDoctorCommand } from "./commands/doctor.js";
|
|
7
|
+
import { runInitCommand } from "./commands/init.js";
|
|
8
|
+
import { runReplayCommand } from "./commands/replay.js";
|
|
9
|
+
import { runReportCommand } from "./commands/report.js";
|
|
10
|
+
import { runResumeCommand } from "./commands/resume.js";
|
|
11
|
+
import { runStartCommand } from "./commands/start.js";
|
|
12
|
+
import { runStatusCommand } from "./commands/status.js";
|
|
13
|
+
export function createCli() {
|
|
14
|
+
const program = new Command();
|
|
15
|
+
program
|
|
16
|
+
.name("agentflight")
|
|
17
|
+
.description("Local-first flight recorder for AI coding agents.")
|
|
18
|
+
.version("0.1.0");
|
|
19
|
+
program
|
|
20
|
+
.command("init")
|
|
21
|
+
.description("Initialise AgentFlight in this repository.")
|
|
22
|
+
.action(async () => {
|
|
23
|
+
await printResult(runInitCommand({ repoRoot: await getRepositoryRoot(process.cwd()) }));
|
|
24
|
+
});
|
|
25
|
+
program
|
|
26
|
+
.command("start")
|
|
27
|
+
.description("Start or resume an AI coding session.")
|
|
28
|
+
.requiredOption("--task <task>", "task title")
|
|
29
|
+
.option("-y, --yes", "initialise safely if AgentFlight is missing")
|
|
30
|
+
.action(async (options) => {
|
|
31
|
+
await printResult(runStartCommand({
|
|
32
|
+
repoRoot: await getRepositoryRoot(process.cwd()),
|
|
33
|
+
task: options.task,
|
|
34
|
+
yes: options.yes
|
|
35
|
+
}));
|
|
36
|
+
});
|
|
37
|
+
program
|
|
38
|
+
.command("status")
|
|
39
|
+
.description("Show what changed since the session started.")
|
|
40
|
+
.action(async () => {
|
|
41
|
+
await printResult(runStatusCommand({ repoRoot: await getRepositoryRoot(process.cwd()) }));
|
|
42
|
+
});
|
|
43
|
+
program
|
|
44
|
+
.command("report")
|
|
45
|
+
.description("Generate a Markdown proof report for the current session.")
|
|
46
|
+
.action(async () => {
|
|
47
|
+
await printResult(runReportCommand({ repoRoot: await getRepositoryRoot(process.cwd()) }));
|
|
48
|
+
});
|
|
49
|
+
program
|
|
50
|
+
.command("replay")
|
|
51
|
+
.description("Generate a local HTML replay of the current session.")
|
|
52
|
+
.action(async () => {
|
|
53
|
+
await printResult(runReplayCommand({ repoRoot: await getRepositoryRoot(process.cwd()) }));
|
|
54
|
+
});
|
|
55
|
+
program
|
|
56
|
+
.command("resume")
|
|
57
|
+
.description("Generate a prompt to continue the current session safely.")
|
|
58
|
+
.action(async () => {
|
|
59
|
+
await printResult(runResumeCommand({ repoRoot: await getRepositoryRoot(process.cwd()) }));
|
|
60
|
+
});
|
|
61
|
+
program
|
|
62
|
+
.command("doctor")
|
|
63
|
+
.description("Check whether AgentFlight is correctly configured.")
|
|
64
|
+
.action(async () => {
|
|
65
|
+
await printResult(runDoctorCommand({ repoRoot: await getRepositoryRoot(process.cwd()) }));
|
|
66
|
+
});
|
|
67
|
+
for (const commandName of ["upgrade", "license", "login"]) {
|
|
68
|
+
program
|
|
69
|
+
.command(commandName)
|
|
70
|
+
.description("Future AgentFlight Pro/Team placeholder.")
|
|
71
|
+
.action(() => {
|
|
72
|
+
console.log("AgentFlight Pro/Team is not available yet.");
|
|
73
|
+
});
|
|
74
|
+
}
|
|
75
|
+
return program;
|
|
76
|
+
}
|
|
77
|
+
async function printResult(promise) {
|
|
78
|
+
try {
|
|
79
|
+
const result = await promise;
|
|
80
|
+
console.log(result.output.trimEnd());
|
|
81
|
+
}
|
|
82
|
+
catch (error) {
|
|
83
|
+
console.error(error instanceof Error ? error.message : String(error));
|
|
84
|
+
process.exitCode = 1;
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
export function isDirectCliInvocation(metaUrl, argvPath) {
|
|
88
|
+
if (!argvPath)
|
|
89
|
+
return false;
|
|
90
|
+
return fileURLToPath(metaUrl) === resolve(argvPath);
|
|
91
|
+
}
|
|
92
|
+
if (isDirectCliInvocation(import.meta.url, process.argv[1])) {
|
|
93
|
+
await createCli().parseAsync(process.argv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AAM,UAAU,qBAAqB,CAAC,OAAe,EAAE,QAA4B;IACjF,IAAI,CAAC,QAAQ;QAAE,OAAO,KAAK,CAAC;IAC5B,OAAO,aAAa,CAAC,OAAO,CAAC,KAAK,OAAO,CAAC,QAAQ,CAAC,CAAC;AACtD,CAAC;AAED,IAAI,qBAAqB,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,EAAE,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;IAC5D,MAAM,SAAS,EAAE,CAAC,UAAU,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;AAC7C,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { DoctorResult } from "../types/index.js";
|
|
2
|
+
export interface DoctorCommandOptions {
|
|
3
|
+
repoRoot: string;
|
|
4
|
+
nodeVersion?: string | undefined;
|
|
5
|
+
npmVersion?: string | null | undefined;
|
|
6
|
+
gitAvailable?: boolean | undefined;
|
|
7
|
+
packageManager?: string | null | undefined;
|
|
8
|
+
projscanAvailable?: boolean | undefined;
|
|
9
|
+
agentloopkitAvailable?: boolean | undefined;
|
|
10
|
+
}
|
|
11
|
+
export interface DoctorCommandResult {
|
|
12
|
+
output: string;
|
|
13
|
+
result: DoctorResult;
|
|
14
|
+
}
|
|
15
|
+
export declare function runDoctorCommand(options: DoctorCommandOptions): Promise<DoctorCommandResult>;
|
|
16
|
+
//# sourceMappingURL=doctor.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"doctor.d.ts","sourceRoot":"","sources":["../../src/commands/doctor.ts"],"names":[],"mappings":"AAWA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAEtD,MAAM,WAAW,oBAAoB;IACnC,QAAQ,EAAE,MAAM,CAAC;IACjB,WAAW,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IACjC,UAAU,CAAC,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,CAAC;IACvC,YAAY,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;IACnC,cAAc,CAAC,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,CAAC;IAC3C,iBAAiB,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;IACxC,qBAAqB,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;CAC7C;AAED,MAAM,WAAW,mBAAmB;IAClC,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,YAAY,CAAC;CACtB;AAED,wBAAsB,gBAAgB,CACpC,OAAO,EAAE,oBAAoB,GAC5B,OAAO,CAAC,mBAAmB,CAAC,CA8C9B"}
|