@mozole/cli 1.0.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 +9 -0
- package/README.md +196 -0
- package/dist/cli.d.ts +4 -0
- package/dist/cli.d.ts.map +1 -0
- package/dist/cli.js +85 -0
- package/dist/cli.js.map +1 -0
- package/dist/commands/adopt.d.ts +4 -0
- package/dist/commands/adopt.d.ts.map +1 -0
- package/dist/commands/adopt.js +258 -0
- package/dist/commands/adopt.js.map +1 -0
- package/dist/commands/doctor.d.ts +4 -0
- package/dist/commands/doctor.d.ts.map +1 -0
- package/dist/commands/doctor.js +241 -0
- package/dist/commands/doctor.js.map +1 -0
- package/dist/commands/logs.d.ts +3 -0
- package/dist/commands/logs.d.ts.map +1 -0
- package/dist/commands/logs.js +32 -0
- package/dist/commands/logs.js.map +1 -0
- package/dist/commands/new.d.ts +3 -0
- package/dist/commands/new.d.ts.map +1 -0
- package/dist/commands/new.js +84 -0
- package/dist/commands/new.js.map +1 -0
- package/dist/commands/qa.d.ts +7 -0
- package/dist/commands/qa.d.ts.map +1 -0
- package/dist/commands/qa.js +95 -0
- package/dist/commands/qa.js.map +1 -0
- package/dist/commands/stats.d.ts +19 -0
- package/dist/commands/stats.d.ts.map +1 -0
- package/dist/commands/stats.js +100 -0
- package/dist/commands/stats.js.map +1 -0
- package/dist/commands/verify.d.ts +5 -0
- package/dist/commands/verify.d.ts.map +1 -0
- package/dist/commands/verify.js +53 -0
- package/dist/commands/verify.js.map +1 -0
- package/dist/config/project.d.ts +43 -0
- package/dist/config/project.d.ts.map +1 -0
- package/dist/config/project.js +57 -0
- package/dist/config/project.js.map +1 -0
- package/dist/context/cce.d.ts +8 -0
- package/dist/context/cce.d.ts.map +1 -0
- package/dist/context/cce.js +72 -0
- package/dist/context/cce.js.map +1 -0
- package/dist/governor/fingerprint.d.ts +7 -0
- package/dist/governor/fingerprint.d.ts.map +1 -0
- package/dist/governor/fingerprint.js +109 -0
- package/dist/governor/fingerprint.js.map +1 -0
- package/dist/governor/hook.d.ts +10 -0
- package/dist/governor/hook.d.ts.map +1 -0
- package/dist/governor/hook.js +127 -0
- package/dist/governor/hook.js.map +1 -0
- package/dist/governor/state.d.ts +35 -0
- package/dist/governor/state.d.ts.map +1 -0
- package/dist/governor/state.js +55 -0
- package/dist/governor/state.js.map +1 -0
- package/dist/integrations/antigravity.d.ts +20 -0
- package/dist/integrations/antigravity.d.ts.map +1 -0
- package/dist/integrations/antigravity.js +145 -0
- package/dist/integrations/antigravity.js.map +1 -0
- package/dist/output.d.ts +5 -0
- package/dist/output.d.ts.map +1 -0
- package/dist/output.js +2 -0
- package/dist/output.js.map +1 -0
- package/dist/platform/executable.d.ts +7 -0
- package/dist/platform/executable.d.ts.map +1 -0
- package/dist/platform/executable.js +35 -0
- package/dist/platform/executable.js.map +1 -0
- package/dist/platform/process.d.ts +24 -0
- package/dist/platform/process.d.ts.map +1 -0
- package/dist/platform/process.js +107 -0
- package/dist/platform/process.js.map +1 -0
- package/dist/qa/runner.d.ts +26 -0
- package/dist/qa/runner.d.ts.map +1 -0
- package/dist/qa/runner.js +322 -0
- package/dist/qa/runner.js.map +1 -0
- package/dist/qa/server.d.ts +10 -0
- package/dist/qa/server.d.ts.map +1 -0
- package/dist/qa/server.js +131 -0
- package/dist/qa/server.js.map +1 -0
- package/dist/scaffold/templates.d.ts +4 -0
- package/dist/scaffold/templates.d.ts.map +1 -0
- package/dist/scaffold/templates.js +186 -0
- package/dist/scaffold/templates.js.map +1 -0
- package/dist/scaffold/write.d.ts +2 -0
- package/dist/scaffold/write.d.ts.map +1 -0
- package/dist/scaffold/write.js +24 -0
- package/dist/scaffold/write.js.map +1 -0
- package/dist/telemetry/store.d.ts +27 -0
- package/dist/telemetry/store.d.ts.map +1 -0
- package/dist/telemetry/store.js +59 -0
- package/dist/telemetry/store.js.map +1 -0
- package/dist/verify/runner.d.ts +15 -0
- package/dist/verify/runner.d.ts.map +1 -0
- package/dist/verify/runner.js +91 -0
- package/dist/verify/runner.js.map +1 -0
- package/dist/version.d.ts +35 -0
- package/dist/version.d.ts.map +1 -0
- package/dist/version.js +35 -0
- package/dist/version.js.map +1 -0
- package/package.json +53 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Mozole contributors
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
|
6
|
+
|
|
7
|
+
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
|
8
|
+
|
|
9
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,196 @@
|
|
|
1
|
+
# Mozole CLI
|
|
2
|
+
|
|
3
|
+
`mozole` is a production-oriented web bootstrap and agent harness. It creates static-first React Router Framework Mode projects with a pinned toolchain, compact Codex, Claude Code, and Google Antigravity guidance, deterministic verification, semantic CCE retrieval, and Playwright QA that does not spend routine agent context on screenshots.
|
|
4
|
+
|
|
5
|
+
## Requirements and installation
|
|
6
|
+
|
|
7
|
+
- Node.js 22 or newer
|
|
8
|
+
- npm
|
|
9
|
+
- Windows or Linux (WSL is optional, not required)
|
|
10
|
+
- Git is recommended
|
|
11
|
+
- For CCE: Python 3.11+, a C/C++ build toolchain, CMake, and either `uvx` or an installed `cce`
|
|
12
|
+
|
|
13
|
+
```sh
|
|
14
|
+
npm install --global @mozole/cli
|
|
15
|
+
mozole --version
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
The release pins its complete generated-project matrix in `src/version.ts`; generation never requests floating `latest` packages.
|
|
19
|
+
|
|
20
|
+
## Create a project
|
|
21
|
+
|
|
22
|
+
```sh
|
|
23
|
+
mozole new my-site
|
|
24
|
+
cd my-site
|
|
25
|
+
npm run dev
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
There is no questionnaire. Mozole writes into a sibling staging directory, installs the pinned npm graph and Chromium, then atomically moves the completed project into place. A failed pre-move bootstrap removes the staging directory. CCE initialization is best-effort after the move because it may require machine-level native prerequisites; its full log is kept under `.mozole/logs/`.
|
|
29
|
+
|
|
30
|
+
The generated app follows current React Router Framework Mode conventions:
|
|
31
|
+
|
|
32
|
+
```ts
|
|
33
|
+
// react-router.config.ts
|
|
34
|
+
export default {
|
|
35
|
+
ssr: false,
|
|
36
|
+
prerender: true,
|
|
37
|
+
} satisfies Config;
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
React Router documents this combination as static pre-rendering without a runtime SSR server. Every statically declared route in `app/routes.ts` gets real HTML at build time. The starter emits `/`, `/about`, and `/contact` under `build/client/`, alongside route data and assets. See the official [React Router pre-rendering guide](https://reactrouter.com/how-to/pre-rendering).
|
|
41
|
+
|
|
42
|
+
Deploy `build/client/` to Apache, LiteSpeed, nginx, a CDN, object storage, or shared hosting. Known routes do not need SPA fallback or a production Node process. Build output is disposable and ignored by Git.
|
|
43
|
+
|
|
44
|
+
## Commands
|
|
45
|
+
|
|
46
|
+
```text
|
|
47
|
+
mozole new <name>
|
|
48
|
+
mozole adopt <path>
|
|
49
|
+
mozole doctor
|
|
50
|
+
mozole verify [--force]
|
|
51
|
+
mozole qa
|
|
52
|
+
mozole qa --interactive
|
|
53
|
+
mozole qa --visual
|
|
54
|
+
mozole qa --force
|
|
55
|
+
mozole stats
|
|
56
|
+
mozole logs [name] [--raw]
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
### Adopt an existing project
|
|
60
|
+
|
|
61
|
+
```sh
|
|
62
|
+
mozole adopt ../existing-app
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
Adoption accepts React projects using Vite or React Router, preserves application files, adds missing harness files, and merges only the required package scripts/dependencies. Changed package and existing agent-hook JSON files are backed up under `.mozole/backups/`. Existing hook groups are preserved, and Mozole's advisory group is appended once. Marked instructions, hook settings, ignore rules, and package mutations are idempotent.
|
|
66
|
+
|
|
67
|
+
### Diagnose the environment
|
|
68
|
+
|
|
69
|
+
```sh
|
|
70
|
+
mozole doctor
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
Doctor reports platform/runtime, Git, Codex, Claude Code, Antigravity, CCE, Chromium, Mozole metadata, and pinned project tools. Missing optional agent runtimes are visible without making a healthy frontend unusable. A malformed or incomplete checked-in Antigravity workspace integration is a project error; missing Node/npm/project build dependencies or Chromium also produce a nonzero status.
|
|
74
|
+
|
|
75
|
+
### Deterministic verification
|
|
76
|
+
|
|
77
|
+
```sh
|
|
78
|
+
mozole verify
|
|
79
|
+
# generated-project alias
|
|
80
|
+
npm run verify
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
Checks run in order: Biome, strict TypeScript, Vitest, and the React Router production build. Extra verifiers can be listed in `.mozole/project.json`; this is also where a future PHP harness can add Composer validation, static analysis, formatting, and tests. Full subprocess logs stay in `.mozole/logs/`. Successful terminal output is deliberately compressed; a failure includes a bounded relevant excerpt.
|
|
84
|
+
|
|
85
|
+
Successful verification evidence is fingerprinted from relevant source, test, configuration, package, and lock files. An unchanged repeat returns `VERIFY CURRENT` without starting Biome, TypeScript, Vitest, or a build. Documentation, generated output, caches, screenshots, and logs do not invalidate that evidence. Use `mozole verify --force` when fresh execution is intentional. A relevant change or any forced failure invalidates reuse.
|
|
86
|
+
|
|
87
|
+
### Browser QA
|
|
88
|
+
|
|
89
|
+
```sh
|
|
90
|
+
mozole qa # deterministic probes, zero screenshots
|
|
91
|
+
mozole qa --interactive # plus safe keyboard/control probes
|
|
92
|
+
mozole qa --visual # explicit screenshots in .mozole/qa/
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
QA discovers an already-running configured server or starts its own Vite process on an available loopback port. It waits for readiness, visits only configured routes, and checks three default viewports (`375×812`, `768×1024`, `1440×900`). Probes cover HTTP reachability, runtime/console errors, failed requests, horizontal overflow, geometry, internal links, important-element visibility, document language/title/headings, accessible names, and—when requested—safe interactions and keyboard focus. Owned browsers and process trees are closed on success, failure, Ctrl+C, and timeout.
|
|
96
|
+
|
|
97
|
+
Normal QA and verification contain no screenshot path. Screenshot capture exists only inside the `visual` branch, uses stable `<viewport>-<route>.png` names, and is tested as opt-in.
|
|
98
|
+
|
|
99
|
+
Successful normal, interactive, and visual QA evidence is cached separately. Runtime source, routes, server settings, dependencies, and viewport changes invalidate QA; a README-only edit does not. An unchanged repeat returns `QA CURRENT` without launching a server or Chromium. Visual reuse also verifies every screenshot's content hash and existence. `mozole qa --force` and `mozole qa --visual --force` always collect fresh evidence.
|
|
100
|
+
|
|
101
|
+
Viewports, routes, server command/arguments, readiness path, telemetry, and verifier extensions are explicit in `.mozole/project.json`.
|
|
102
|
+
|
|
103
|
+
## CCE, Codex, and Claude Code
|
|
104
|
+
|
|
105
|
+
Mozole integrates Elara Labs' local [Code Context Engine](https://github.com/elara-labs/code-context-engine), currently pinned to `0.4.25`. If `cce` is installed, Mozole runs:
|
|
106
|
+
|
|
107
|
+
```sh
|
|
108
|
+
cce init --agent all
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
If only `uvx` exists, it runs the equivalent pinned `uvx --from code-context-engine[local]==0.4.25 ...` invocation. CCE builds incremental vector, lexical, and code-graph indexes, registers MCP for supported agents, and exposes `cce status`, `cce search`, and `cce savings`. Source remains local under CCE's default configuration. If setup cannot finish, the project still works and `mozole doctor` reports the gap.
|
|
112
|
+
|
|
113
|
+
CCE normally writes its own instruction blocks during initialization. Mozole snapshots and restores `AGENTS.md` and `CLAUDE.md` around that operation: the index, hooks, and MCP registrations remain, while the compact shared project guidance stays the sole instruction source.
|
|
114
|
+
|
|
115
|
+
Generated `AGENTS.md` is intentionally short: commands, architecture, verification/QA policy, and retrieval-first behavior. Codex officially loads project guidance from `AGENTS.md` ([OpenAI documentation](https://learn.chatgpt.com/docs/agent-configuration/agents-md)). `CLAUDE.md` imports that same file instead of duplicating the handbook. Agents are told to retrieve relevant exact chunks first, inspect changed regions, and ask for more context when retrieval is insufficient.
|
|
116
|
+
|
|
117
|
+
## Google Antigravity
|
|
118
|
+
|
|
119
|
+
`mozole new` provisions Antigravity without requiring the IDE or CLI to be installed. `mozole adopt` adds the same files conservatively:
|
|
120
|
+
|
|
121
|
+
```text
|
|
122
|
+
.agents/
|
|
123
|
+
├── mcp_config.json
|
|
124
|
+
├── rules/mozole.md
|
|
125
|
+
└── workflows/
|
|
126
|
+
├── mozole-verify.md
|
|
127
|
+
├── mozole-qa.md
|
|
128
|
+
├── mozole-qa-interactive.md
|
|
129
|
+
└── mozole-qa-visual.md
|
|
130
|
+
```
|
|
131
|
+
|
|
132
|
+
Google documents `.agents/mcp_config.json` as the workspace-local MCP configuration and `.agents/rules/` plus `.agents/workflows/` as workspace customizations ([Antigravity CLI MCP](https://codelabs.developers.google.com/genai-for-dev-antigravity-cli), [Antigravity IDE customization](https://codelabs.developers.google.com/getting-started-agy-ide)). Mozole registers one stdio server named `mozole-cce` using CCE's documented `cce serve` entry point. CCE discovers the project from `.context-engine.yaml`, so no user-specific absolute path or second index is needed. If Mozole is using its pinned `uvx` fallback, the MCP entry uses the same pinned package invocation.
|
|
133
|
+
|
|
134
|
+
The Antigravity rule points to the shared `AGENTS.md` contract and contains only Antigravity-specific retrieval, QA, browser, and stopping guidance. Workflows delegate to Mozole rather than duplicating verification or browser logic. Use `/mozole-verify`, `/mozole-qa`, `/mozole-qa-interactive`, or `/mozole-qa-visual`; ordinary QA stays screenshot-free, while visual artifacts remain explicitly opt-in.
|
|
135
|
+
|
|
136
|
+
Adoption preserves unrelated MCP servers, top-level MCP properties, rules, workflows, agents, and skills. Only the `mozole-cce` entry and Mozole-prefixed rule/workflow files are owned by Mozole. Existing MCP configuration is validated before project mutation and backed up under `.mozole/backups/` before a merge.
|
|
137
|
+
|
|
138
|
+
Troubleshooting:
|
|
139
|
+
|
|
140
|
+
```sh
|
|
141
|
+
mozole doctor # runtime and workspace integration
|
|
142
|
+
agy # start Antigravity CLI when installed
|
|
143
|
+
# inside Antigravity
|
|
144
|
+
/mcp # inspect mozole-cce connectivity
|
|
145
|
+
cce status # inspect the shared local index
|
|
146
|
+
mozole adopt . # repair/update Mozole-owned workspace files
|
|
147
|
+
```
|
|
148
|
+
|
|
149
|
+
Antigravity's documented CLI executable is `agy`; its absence is optional and does not block creation. Mozole does not add speculative Antigravity hooks or require plugin installation because workspace MCP, rules, and workflows provide the needed integration directly.
|
|
150
|
+
|
|
151
|
+
## Token governor
|
|
152
|
+
|
|
153
|
+
The generated harness adds a local, advisory governor around CCE and Mozole's concise runners for Codex, Claude Code, and Antigravity:
|
|
154
|
+
|
|
155
|
+
- `.mozole/state/governor.json` stores disposable verification, QA, visual-artifact, read, and command fingerprints. It never stores source contents, command text, transcripts, or secrets.
|
|
156
|
+
- `.codex/hooks.json` and `.claude/settings.json` use documented `PreToolUse` command hooks to warn once about identical unchanged reads or commands. They return context only and never deny or rewrite a tool call.
|
|
157
|
+
- Codex requires review and trust for project hooks; inspect them with `/hooks`. See the official [Codex hooks reference](https://developers.openai.com/codex/hooks).
|
|
158
|
+
- Claude Code loads shared project hooks from `.claude/settings.json`. See the official [Claude Code hooks reference](https://code.claude.com/docs/en/hooks).
|
|
159
|
+
|
|
160
|
+
The policy is state-aware, not a generic call limit. Changed files reset read evidence, relevant project mutations reset command evidence, and `--force` remains an explicit escape hatch. Completion guidance asks agents to stop only when requested changes, deterministic verification, relevant QA, and known-issue resolution provide strong evidence.
|
|
161
|
+
|
|
162
|
+
Verbose subprocess output remains available progressively:
|
|
163
|
+
|
|
164
|
+
```sh
|
|
165
|
+
mozole logs # list retained logs
|
|
166
|
+
mozole logs verify-tests # final 80 lines
|
|
167
|
+
mozole logs verify-tests --raw
|
|
168
|
+
```
|
|
169
|
+
|
|
170
|
+
## Efficiency telemetry
|
|
171
|
+
|
|
172
|
+
```sh
|
|
173
|
+
mozole stats
|
|
174
|
+
```
|
|
175
|
+
|
|
176
|
+
Telemetry is local in `.mozole/telemetry.json`. Mozole records verification raw/delivered/suppressed character counts, avoided verification and QA runs, saved browser launches, reused visual artifacts, repeated-read/work warnings, QA probes, and screenshots. If a local CCE installation has savings data, selected measured CCE lines are shown. Character reduction is labeled as output compression, not model tokens, billing, or OpenAI/Anthropic savings.
|
|
177
|
+
|
|
178
|
+
## PHP compatibility
|
|
179
|
+
|
|
180
|
+
The frontend build is ordinary static output, so `build/client/` can live next to `backend/`, `composer.json`, or existing PHP entry points. Mozole does not install or require PHP. The verifier list is ecosystem-neutral, allowing PHP checks to be added without changing the TypeScript pipeline. CCE can continue indexing the combined repository where its installed grammar set supports the source language.
|
|
181
|
+
|
|
182
|
+
## Windows and Linux
|
|
183
|
+
|
|
184
|
+
All filesystem work uses Node path/fs APIs. Child processes receive structured argument arrays with `shell: false`; Windows uses `.cmd` executable resolution and `taskkill /T`, while POSIX systems use process groups. Paths are never interpolated into shell commands. CI runs lint, strict typecheck, unit/integration tests, compilation, a real project generation, static-route assertions, and screenshot-free browser QA on native Windows and Ubuntu runners.
|
|
185
|
+
|
|
186
|
+
## Development and release
|
|
187
|
+
|
|
188
|
+
```sh
|
|
189
|
+
npm ci
|
|
190
|
+
npx playwright install chromium
|
|
191
|
+
npm run verify
|
|
192
|
+
npm run test:smoke
|
|
193
|
+
npm pack --dry-run
|
|
194
|
+
```
|
|
195
|
+
|
|
196
|
+
The suite covers path normalization, Windows executable resolution, structured process execution, config discovery, output filtering, telemetry defaults, QA port conflicts, transactional generation, conservative/idempotent adoption, generated-project verification, static prerender output, and the normal-QA screenshot invariant. Update the matrix centrally in `src/version.ts`, run the full native CI matrix, inspect the packed files, then publish with npm provenance according to the release environment.
|
package/dist/cli.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cli.d.ts","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":";AAaA,wBAAgB,eAAe,CAC7B,QAAQ,EAAE,MAAM,EAChB,WAAW,EAAE,MAAM,GAAG,SAAS,GAC9B,OAAO,CAOT;AAGD,wBAAsB,IAAI,CACxB,IAAI,WAAwB,EAC5B,GAAG,SAAgB,GAClB,OAAO,CAAC,MAAM,CAAC,CAiEjB"}
|
package/dist/cli.js
ADDED
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { realpathSync } from "node:fs";
|
|
3
|
+
import { fileURLToPath } from "node:url";
|
|
4
|
+
import { adoptCommand } from "./commands/adopt.js";
|
|
5
|
+
import { doctorCommand } from "./commands/doctor.js";
|
|
6
|
+
import { logsCommand } from "./commands/logs.js";
|
|
7
|
+
import { newCommand } from "./commands/new.js";
|
|
8
|
+
import { qaCommand } from "./commands/qa.js";
|
|
9
|
+
import { statsCommand } from "./commands/stats.js";
|
|
10
|
+
import { verifyCommand } from "./commands/verify.js";
|
|
11
|
+
import { governorHookCommand } from "./governor/hook.js";
|
|
12
|
+
import { CLI_VERSION } from "./version.js";
|
|
13
|
+
export function isCliEntrypoint(entryUrl, invokedPath) {
|
|
14
|
+
if (!invokedPath)
|
|
15
|
+
return false;
|
|
16
|
+
try {
|
|
17
|
+
return realpathSync(fileURLToPath(entryUrl)) === realpathSync(invokedPath);
|
|
18
|
+
}
|
|
19
|
+
catch {
|
|
20
|
+
return false;
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
const help = `mozole ${CLI_VERSION}\n\nUsage:\n mozole new <name>\n mozole adopt <path>\n mozole doctor\n mozole verify [--force]\n mozole qa [--interactive | --visual] [--force]\n mozole stats\n mozole logs [name] [--raw]`;
|
|
24
|
+
export async function main(args = process.argv.slice(2), cwd = process.cwd()) {
|
|
25
|
+
const [command, value, ...rest] = args;
|
|
26
|
+
if (!command ||
|
|
27
|
+
command === "help" ||
|
|
28
|
+
command === "--help" ||
|
|
29
|
+
command === "-h") {
|
|
30
|
+
console.log(help);
|
|
31
|
+
return 0;
|
|
32
|
+
}
|
|
33
|
+
if (command === "--version" || command === "-v") {
|
|
34
|
+
console.log(CLI_VERSION);
|
|
35
|
+
return 0;
|
|
36
|
+
}
|
|
37
|
+
if (command === "new")
|
|
38
|
+
return newCommand(value, cwd);
|
|
39
|
+
if (command === "adopt")
|
|
40
|
+
return adoptCommand(value, cwd);
|
|
41
|
+
if (command === "doctor")
|
|
42
|
+
return doctorCommand(cwd);
|
|
43
|
+
if (command === "verify") {
|
|
44
|
+
const flags = [value, ...rest].filter((flag) => Boolean(flag));
|
|
45
|
+
const unknown = flags.filter((flag) => flag !== "--force");
|
|
46
|
+
if (unknown.length) {
|
|
47
|
+
console.error(`Unknown verify option: ${unknown[0]}`);
|
|
48
|
+
return 2;
|
|
49
|
+
}
|
|
50
|
+
return verifyCommand(cwd, console, { force: flags.includes("--force") });
|
|
51
|
+
}
|
|
52
|
+
if (command === "stats")
|
|
53
|
+
return statsCommand(cwd);
|
|
54
|
+
if (command === "logs") {
|
|
55
|
+
const flags = [value, ...rest].filter((flag) => Boolean(flag));
|
|
56
|
+
const positional = flags.filter((flag) => flag !== "--raw");
|
|
57
|
+
const unknown = flags.find((flag) => flag.startsWith("--") && flag !== "--raw");
|
|
58
|
+
if (unknown || positional.length > 1) {
|
|
59
|
+
console.error(`Unknown logs option: ${unknown ?? positional[1]}`);
|
|
60
|
+
return 2;
|
|
61
|
+
}
|
|
62
|
+
const name = positional[0];
|
|
63
|
+
return logsCommand(cwd, name, flags.includes("--raw"));
|
|
64
|
+
}
|
|
65
|
+
if (command === "governor" && value === "hook")
|
|
66
|
+
return governorHookCommand();
|
|
67
|
+
if (command === "qa") {
|
|
68
|
+
const flags = [value, ...rest].filter((flag) => Boolean(flag));
|
|
69
|
+
const unknown = flags.filter((flag) => !["--interactive", "--visual", "--force"].includes(flag));
|
|
70
|
+
if (unknown.length) {
|
|
71
|
+
console.error(`Unknown QA option: ${unknown[0]}`);
|
|
72
|
+
return 2;
|
|
73
|
+
}
|
|
74
|
+
return qaCommand(cwd, {
|
|
75
|
+
interactive: flags.includes("--interactive"),
|
|
76
|
+
visual: flags.includes("--visual"),
|
|
77
|
+
force: flags.includes("--force"),
|
|
78
|
+
});
|
|
79
|
+
}
|
|
80
|
+
console.error(`Unknown command: ${command}\n\n${help}`);
|
|
81
|
+
return 2;
|
|
82
|
+
}
|
|
83
|
+
if (isCliEntrypoint(import.meta.url, process.argv[1]))
|
|
84
|
+
process.exitCode = await main();
|
|
85
|
+
//# sourceMappingURL=cli.js.map
|
package/dist/cli.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cli.js","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACvC,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACzC,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACnD,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AACrD,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AACjD,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAC/C,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAC7C,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACnD,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AACrD,OAAO,EAAE,mBAAmB,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C,CAAC,CAAC;IACnD,OAAO,CAAC,QAAQ,GAAG,MAAM,IAAI,EAAE,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"adopt.d.ts","sourceRoot":"","sources":["../../src/commands/adopt.ts"],"names":[],"mappings":"AAiBA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AA0B3C,wBAAgB,YAAY,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,EAAE,CAKrD;AAgED,wBAAsB,YAAY,CAChC,KAAK,EAAE,MAAM,GAAG,SAAS,EACzB,GAAG,EAAE,MAAM,EACX,MAAM,GAAE,MAAgB,GACvB,OAAO,CAAC,MAAM,CAAC,CAmPjB"}
|
|
@@ -0,0 +1,258 @@
|
|
|
1
|
+
import { access, copyFile, mkdir, readFile, rename, writeFile, } from "node:fs/promises";
|
|
2
|
+
import path from "node:path";
|
|
3
|
+
import { readConfig } from "../config/project.js";
|
|
4
|
+
import { cceCommand, initializeCce } from "../context/cce.js";
|
|
5
|
+
import { assertAntigravityMcpMergeable, cceMcpServer, configureAntigravityMcp, mergeAntigravityMcp, } from "../integrations/antigravity.js";
|
|
6
|
+
import { npmExecutable } from "../platform/executable.js";
|
|
7
|
+
import { run } from "../platform/process.js";
|
|
8
|
+
import { projectConfig, projectTemplates } from "../scaffold/templates.js";
|
|
9
|
+
import { writeFiles } from "../scaffold/write.js";
|
|
10
|
+
import { TOOLCHAIN } from "../version.js";
|
|
11
|
+
async function exists(file) {
|
|
12
|
+
try {
|
|
13
|
+
await access(file);
|
|
14
|
+
return true;
|
|
15
|
+
}
|
|
16
|
+
catch {
|
|
17
|
+
return false;
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
async function atomicJson(file, value) {
|
|
21
|
+
const temporary = `${file}.mozole-tmp`;
|
|
22
|
+
await writeFile(temporary, `${JSON.stringify(value, null, 2)}\n`, "utf8");
|
|
23
|
+
await rename(temporary, file);
|
|
24
|
+
}
|
|
25
|
+
export function detectRoutes(source) {
|
|
26
|
+
const routes = ["/"];
|
|
27
|
+
for (const match of source.matchAll(/route\(\s*["']([^"']+)["']/g))
|
|
28
|
+
routes.push(`/${match[1]}`.replaceAll("//", "/"));
|
|
29
|
+
return [...new Set(routes)];
|
|
30
|
+
}
|
|
31
|
+
async function ensureAgentBlock(file, block) {
|
|
32
|
+
const begin = "<!-- mozole:begin -->";
|
|
33
|
+
if (!(await exists(file))) {
|
|
34
|
+
await writeFile(file, `${block.trim()}\n`, "utf8");
|
|
35
|
+
return true;
|
|
36
|
+
}
|
|
37
|
+
const current = await readFile(file, "utf8");
|
|
38
|
+
if (current.includes(begin))
|
|
39
|
+
return false;
|
|
40
|
+
await writeFile(file, `${current.trimEnd()}\n\n${block.trim()}\n`, "utf8");
|
|
41
|
+
return true;
|
|
42
|
+
}
|
|
43
|
+
async function ensureGitignore(root) {
|
|
44
|
+
const file = path.join(root, ".gitignore");
|
|
45
|
+
const current = (await exists(file)) ? await readFile(file, "utf8") : "";
|
|
46
|
+
const required = [
|
|
47
|
+
".mozole/logs/",
|
|
48
|
+
".mozole/qa/",
|
|
49
|
+
".mozole/state/",
|
|
50
|
+
".mozole/telemetry.json",
|
|
51
|
+
".cce/",
|
|
52
|
+
];
|
|
53
|
+
const existing = new Set(current.split(/\r?\n/).map((line) => line.trim()));
|
|
54
|
+
const missing = required.filter((line) => !existing.has(line));
|
|
55
|
+
if (!missing.length)
|
|
56
|
+
return;
|
|
57
|
+
await writeFile(file, `${current.trimEnd()}${current.trim() ? "\n\n" : ""}# Mozole local state\n${missing.join("\n")}\n`, "utf8");
|
|
58
|
+
}
|
|
59
|
+
async function validateJsonObject(file) {
|
|
60
|
+
if (!(await exists(file)))
|
|
61
|
+
return false;
|
|
62
|
+
const value = JSON.parse(await readFile(file, "utf8"));
|
|
63
|
+
if (!value || typeof value !== "object" || Array.isArray(value))
|
|
64
|
+
throw new Error(`Expected a JSON object in ${file}`);
|
|
65
|
+
return true;
|
|
66
|
+
}
|
|
67
|
+
async function mergeHookConfig(file, template, backupFile) {
|
|
68
|
+
const currentText = await readFile(file, "utf8");
|
|
69
|
+
if (currentText.includes("mozole governor hook"))
|
|
70
|
+
return;
|
|
71
|
+
const current = JSON.parse(currentText);
|
|
72
|
+
const desired = JSON.parse(template);
|
|
73
|
+
const hooks = current.hooks && typeof current.hooks === "object"
|
|
74
|
+
? current.hooks
|
|
75
|
+
: {};
|
|
76
|
+
current.hooks = hooks;
|
|
77
|
+
const existing = Array.isArray(hooks.PreToolUse) ? hooks.PreToolUse : [];
|
|
78
|
+
hooks.PreToolUse = [...existing, ...desired.hooks.PreToolUse];
|
|
79
|
+
await mkdir(path.dirname(backupFile), { recursive: true });
|
|
80
|
+
await copyFile(file, backupFile);
|
|
81
|
+
await atomicJson(file, current);
|
|
82
|
+
}
|
|
83
|
+
export async function adoptCommand(input, cwd, output = console) {
|
|
84
|
+
if (!input) {
|
|
85
|
+
output.error("Usage: mozole adopt <path>");
|
|
86
|
+
return 2;
|
|
87
|
+
}
|
|
88
|
+
const root = path.resolve(cwd, input);
|
|
89
|
+
const packagePath = path.join(root, "package.json");
|
|
90
|
+
const controller = new AbortController();
|
|
91
|
+
const abort = () => controller.abort();
|
|
92
|
+
process.once("SIGINT", abort);
|
|
93
|
+
process.once("SIGTERM", abort);
|
|
94
|
+
try {
|
|
95
|
+
const original = await readFile(packagePath, "utf8");
|
|
96
|
+
const packageJson = JSON.parse(original);
|
|
97
|
+
await assertAntigravityMcpMergeable(root);
|
|
98
|
+
const allDependencies = {
|
|
99
|
+
...packageJson.dependencies,
|
|
100
|
+
...packageJson.devDependencies,
|
|
101
|
+
};
|
|
102
|
+
if (!allDependencies.react ||
|
|
103
|
+
(!allDependencies.vite && !allDependencies["@react-router/dev"]))
|
|
104
|
+
throw new Error("Expected a React project using Vite or React Router Framework Mode.");
|
|
105
|
+
const name = packageJson.name ?? path.basename(root);
|
|
106
|
+
const templates = projectTemplates(name);
|
|
107
|
+
const codexHooksPath = path.join(root, ".codex", "hooks.json");
|
|
108
|
+
const claudeSettingsPath = path.join(root, ".claude", "settings.json");
|
|
109
|
+
const hadCodexHooks = await validateJsonObject(codexHooksPath);
|
|
110
|
+
const hadClaudeSettings = await validateJsonObject(claudeSettingsPath);
|
|
111
|
+
const configPath = path.join(root, ".mozole", "project.json");
|
|
112
|
+
const config = (await exists(configPath))
|
|
113
|
+
? await (async () => {
|
|
114
|
+
try {
|
|
115
|
+
return await readConfig(root);
|
|
116
|
+
}
|
|
117
|
+
catch (error) {
|
|
118
|
+
throw new Error(`Existing .mozole/project.json is invalid: ${error instanceof Error ? error.message : String(error)}`);
|
|
119
|
+
}
|
|
120
|
+
})()
|
|
121
|
+
: projectConfig(name);
|
|
122
|
+
config.name = name;
|
|
123
|
+
const routeSourcePath = path.join(root, "app", "routes.ts");
|
|
124
|
+
if (await exists(routeSourcePath))
|
|
125
|
+
config.routes = detectRoutes(await readFile(routeSourcePath, "utf8"));
|
|
126
|
+
const desiredScripts = {
|
|
127
|
+
lint: "biome check .",
|
|
128
|
+
format: "biome format --write .",
|
|
129
|
+
typecheck: packageJson.scripts?.typecheck ?? "tsc --noEmit",
|
|
130
|
+
"test:run": packageJson.scripts?.["test:run"] ?? "vitest run",
|
|
131
|
+
verify: "mozole verify",
|
|
132
|
+
"verify:force": "mozole verify --force",
|
|
133
|
+
qa: "mozole qa",
|
|
134
|
+
"qa:force": "mozole qa --force",
|
|
135
|
+
"qa:interactive": "mozole qa --interactive",
|
|
136
|
+
"qa:visual": "mozole qa --visual",
|
|
137
|
+
};
|
|
138
|
+
const next = structuredClone(packageJson);
|
|
139
|
+
next.scripts = {
|
|
140
|
+
...desiredScripts,
|
|
141
|
+
...packageJson.scripts,
|
|
142
|
+
verify: "mozole verify",
|
|
143
|
+
"verify:force": "mozole verify --force",
|
|
144
|
+
qa: "mozole qa",
|
|
145
|
+
"qa:force": "mozole qa --force",
|
|
146
|
+
"qa:interactive": "mozole qa --interactive",
|
|
147
|
+
"qa:visual": "mozole qa --visual",
|
|
148
|
+
};
|
|
149
|
+
next.devDependencies = {
|
|
150
|
+
"@mozole/cli": process.env.MOZOLE_CLI_SPEC ?? TOOLCHAIN.mozoleCli,
|
|
151
|
+
"@playwright/test": packageJson.devDependencies?.["@playwright/test"] ??
|
|
152
|
+
TOOLCHAIN.playwright,
|
|
153
|
+
"@biomejs/biome": packageJson.devDependencies?.["@biomejs/biome"] ?? TOOLCHAIN.biome,
|
|
154
|
+
"@testing-library/jest-dom": packageJson.devDependencies?.["@testing-library/jest-dom"] ??
|
|
155
|
+
TOOLCHAIN.testingLibraryJestDom,
|
|
156
|
+
"@testing-library/react": packageJson.devDependencies?.["@testing-library/react"] ??
|
|
157
|
+
TOOLCHAIN.testingLibraryReact,
|
|
158
|
+
"@testing-library/user-event": packageJson.devDependencies?.["@testing-library/user-event"] ??
|
|
159
|
+
TOOLCHAIN.testingLibraryUserEvent,
|
|
160
|
+
"@vitejs/plugin-react": packageJson.devDependencies?.["@vitejs/plugin-react"] ??
|
|
161
|
+
TOOLCHAIN.viteReact,
|
|
162
|
+
jsdom: packageJson.devDependencies?.jsdom ?? TOOLCHAIN.jsdom,
|
|
163
|
+
typescript: packageJson.devDependencies?.typescript ?? TOOLCHAIN.typescript,
|
|
164
|
+
vitest: packageJson.devDependencies?.vitest ?? TOOLCHAIN.vitest,
|
|
165
|
+
...packageJson.devDependencies,
|
|
166
|
+
};
|
|
167
|
+
const nextText = `${JSON.stringify(next, null, 2)}\n`;
|
|
168
|
+
const packageChanged = nextText !== original;
|
|
169
|
+
if (packageChanged) {
|
|
170
|
+
const backupDir = path.join(root, ".mozole", "backups");
|
|
171
|
+
await mkdir(backupDir, { recursive: true });
|
|
172
|
+
await copyFile(packagePath, path.join(backupDir, "package.json.before-adopt"));
|
|
173
|
+
await atomicJson(packagePath, next);
|
|
174
|
+
}
|
|
175
|
+
const template = (key) => {
|
|
176
|
+
const value = templates[key];
|
|
177
|
+
if (value === undefined)
|
|
178
|
+
throw new Error(`Missing internal template: ${key}`);
|
|
179
|
+
return value;
|
|
180
|
+
};
|
|
181
|
+
await writeFiles(root, {
|
|
182
|
+
".mozole/project.json": `${JSON.stringify(config, null, 2)}\n`,
|
|
183
|
+
".mozole/toolchain.json": template(".mozole/toolchain.json"),
|
|
184
|
+
".context-engine.yaml": template(".context-engine.yaml"),
|
|
185
|
+
"biome.json": template("biome.json"),
|
|
186
|
+
"vitest.config.ts": template("vitest.config.ts"),
|
|
187
|
+
"tests/setup.ts": template("tests/setup.ts"),
|
|
188
|
+
".codex/hooks.json": template(".codex/hooks.json"),
|
|
189
|
+
".claude/settings.json": template(".claude/settings.json"),
|
|
190
|
+
});
|
|
191
|
+
await writeFiles(root, {
|
|
192
|
+
".agents/rules/mozole.md": template(".agents/rules/mozole.md"),
|
|
193
|
+
".agents/workflows/mozole-verify.md": template(".agents/workflows/mozole-verify.md"),
|
|
194
|
+
".agents/workflows/mozole-qa.md": template(".agents/workflows/mozole-qa.md"),
|
|
195
|
+
".agents/workflows/mozole-qa-interactive.md": template(".agents/workflows/mozole-qa-interactive.md"),
|
|
196
|
+
".agents/workflows/mozole-qa-visual.md": template(".agents/workflows/mozole-qa-visual.md"),
|
|
197
|
+
}, true);
|
|
198
|
+
const antigravityMcpPath = path.join(root, ".agents", "mcp_config.json");
|
|
199
|
+
const antigravityMcpBefore = (await exists(antigravityMcpPath))
|
|
200
|
+
? await readFile(antigravityMcpPath, "utf8")
|
|
201
|
+
: undefined;
|
|
202
|
+
const cce = await cceCommand();
|
|
203
|
+
const cceLauncher = cce?.prefix.length ? "uvx" : "cce";
|
|
204
|
+
const antigravityMcpWillChange = antigravityMcpBefore !== undefined &&
|
|
205
|
+
`${JSON.stringify(mergeAntigravityMcp(JSON.parse(antigravityMcpBefore), cceMcpServer(cceLauncher)), null, 2)}\n` !== antigravityMcpBefore;
|
|
206
|
+
const backupDir = path.join(root, ".mozole", "backups");
|
|
207
|
+
if (antigravityMcpWillChange && antigravityMcpBefore !== undefined) {
|
|
208
|
+
await mkdir(backupDir, { recursive: true });
|
|
209
|
+
await writeFile(path.join(backupDir, "antigravity-mcp-config.json.before-adopt"), antigravityMcpBefore, "utf8");
|
|
210
|
+
}
|
|
211
|
+
if (hadCodexHooks)
|
|
212
|
+
await mergeHookConfig(codexHooksPath, template(".codex/hooks.json"), path.join(backupDir, "codex-hooks.json.before-adopt"));
|
|
213
|
+
if (hadClaudeSettings)
|
|
214
|
+
await mergeHookConfig(claudeSettingsPath, template(".claude/settings.json"), path.join(backupDir, "claude-settings.json.before-adopt"));
|
|
215
|
+
const block = "<!-- mozole:begin -->\n## Mozole workflow\n\nRetrieve exact CCE context, make localized edits, inspect the diff, then verify. Avoid rereading unchanged files, repeated current checks, routine narration, and repeated successful logs. Stop when requested work, verification, and relevant QA are complete with no unresolved issue. Normal QA never takes screenshots; visual QA is explicit. Use `--force` only for intentionally fresh evidence.\n<!-- mozole:end -->";
|
|
216
|
+
await ensureAgentBlock(path.join(root, "AGENTS.md"), block);
|
|
217
|
+
await ensureAgentBlock(path.join(root, "CLAUDE.md"), `<!-- mozole:begin -->\n@AGENTS.md\n<!-- mozole:end -->`);
|
|
218
|
+
await ensureGitignore(root);
|
|
219
|
+
if (packageChanged && process.env.MOZOLE_SKIP_INSTALL !== "1") {
|
|
220
|
+
const installed = await run(npmExecutable(), ["install", "--no-fund", "--no-audit"], {
|
|
221
|
+
cwd: root,
|
|
222
|
+
timeoutMs: 600_000,
|
|
223
|
+
signal: controller.signal,
|
|
224
|
+
logFile: path.join(root, ".mozole", "logs", "npm-install.log"),
|
|
225
|
+
});
|
|
226
|
+
if (installed.exitCode !== 0)
|
|
227
|
+
throw new Error("npm install failed; package.json backup is in .mozole/backups/.");
|
|
228
|
+
if (process.env.MOZOLE_SKIP_BROWSER !== "1") {
|
|
229
|
+
const browser = await run(npmExecutable(), ["exec", "--", "playwright", "install", "chromium"], {
|
|
230
|
+
cwd: root,
|
|
231
|
+
timeoutMs: 600_000,
|
|
232
|
+
signal: controller.signal,
|
|
233
|
+
logFile: path.join(root, ".mozole", "logs", "playwright-install.log"),
|
|
234
|
+
});
|
|
235
|
+
if (browser.exitCode !== 0)
|
|
236
|
+
throw new Error("Chromium installation failed; package.json backup is in .mozole/backups/.");
|
|
237
|
+
}
|
|
238
|
+
}
|
|
239
|
+
if (process.env.MOZOLE_SKIP_CCE !== "1" && !config.cce.initialized)
|
|
240
|
+
await initializeCce(root, controller.signal);
|
|
241
|
+
// CCE may create or update workspace agent files; restore Mozole's
|
|
242
|
+
// managed MCP entry after it finishes so Antigravity cannot lose CCE.
|
|
243
|
+
await configureAntigravityMcp(root, cceLauncher);
|
|
244
|
+
if (controller.signal.aborted)
|
|
245
|
+
throw new Error("Adoption cancelled.");
|
|
246
|
+
output.log(`ADOPT PASS\n\n${root}\nApplication code preserved.${packageChanged ? "\npackage.json backup: .mozole/backups/package.json.before-adopt" : "\nAlready up to date."}`);
|
|
247
|
+
return 0;
|
|
248
|
+
}
|
|
249
|
+
catch (error) {
|
|
250
|
+
output.error(`ADOPT FAIL\n\n${error instanceof Error ? error.message : String(error)}`);
|
|
251
|
+
return controller.signal.aborted ? 130 : 1;
|
|
252
|
+
}
|
|
253
|
+
finally {
|
|
254
|
+
process.removeListener("SIGINT", abort);
|
|
255
|
+
process.removeListener("SIGTERM", abort);
|
|
256
|
+
}
|
|
257
|
+
}
|
|
258
|
+
//# sourceMappingURL=adopt.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"adopt.js","sourceRoot":"","sources":["../../src/commands/adopt.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,MAAM,EACN,QAAQ,EACR,KAAK,EACL,QAAQ,EACR,MAAM,EACN,SAAS,GACV,MAAM,kBAAkB,CAAC;AAC1B,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAClD,OAAO,EAAE,UAAU,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;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AC,MAAM,CAAC,GAAG,CAAC,WAAW;YAChE,MAAM,aAAa,CAAC,IAAI,EAAE,UAAU,CAAC,MAAM,CAAC,CAAC;QAC/C,mEAAmE;QACnE,sEAAsE;QACtE,MAAM,uBAAuB,CAAC,IAAI,EAAE,WAAW,CAAC,CAAC;QACjD,IAAI,UAAU,CAAC,MAAM,CAAC,OAAO;YAAE,MAAM,IAAI,KAAK,CAAC,qBAAqB,CAAC,CAAC;QACtE,MAAM,CAAC,GAAG,CACR,iBAAiB,IAAI,gCAAgC,cAAc,CAAC,CAAC,CAAC,kEAAkE,CAAC,CAAC,CAAC,uBAAuB,EAAE,CACrK,CAAC;QACF,OAAO,CAAC,CAAC;IACX,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,MAAM,CAAC,KAAK,CACV,iBAAiB,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,EAAE,CAC1E,CAAC;QACF,OAAO,UAAU,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;IAC7C,CAAC;YAAS,CAAC;QACT,OAAO,CAAC,cAAc,CAAC,QAAQ,EAAE,KAAK,CAAC,CAAC;QACxC,OAAO,CAAC,cAAc,CAAC,SAAS,EAAE,KAAK,CAAC,CAAC;IAC3C,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { Output } from "../output.js";
|
|
2
|
+
export declare function detectAntigravityRuntime(resolve?: (name: string) => Promise<string | undefined>): Promise<string | undefined>;
|
|
3
|
+
export declare function doctorCommand(cwd: string, output?: Output): Promise<number>;
|
|
4
|
+
//# sourceMappingURL=doctor.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"doctor.d.ts","sourceRoot":"","sources":["../../src/commands/doctor.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AAyC3C,wBAAsB,wBAAwB,CAC5C,OAAO,GAAE,CAAC,IAAI,EAAE,MAAM,KAAK,OAAO,CAAC,MAAM,GAAG,SAAS,CAAqB,GACzE,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC,CAE7B;AACD,wBAAsB,aAAa,CACjC,GAAG,EAAE,MAAM,EACX,MAAM,GAAE,MAAgB,GACvB,OAAO,CAAC,MAAM,CAAC,CAsNjB"}
|