ai-devkit 0.5.0 → 0.7.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/README.md +31 -81
- package/dist/cli.js +10 -0
- package/dist/cli.js.map +1 -1
- package/dist/commands/init.d.ts.map +1 -1
- package/dist/commands/init.js +1 -1
- package/dist/commands/init.js.map +1 -1
- package/dist/commands/memory.d.ts +3 -0
- package/dist/commands/memory.d.ts.map +1 -0
- package/dist/commands/memory.js +53 -0
- package/dist/commands/memory.js.map +1 -0
- package/dist/commands/setup.d.ts +6 -0
- package/dist/commands/setup.d.ts.map +1 -0
- package/dist/commands/setup.js +112 -0
- package/dist/commands/setup.js.map +1 -0
- package/dist/commands/skill.d.ts +3 -0
- package/dist/commands/skill.d.ts.map +1 -0
- package/dist/commands/skill.js +77 -0
- package/dist/commands/skill.js.map +1 -0
- package/dist/lib/EnvironmentSelector.d.ts +3 -1
- package/dist/lib/EnvironmentSelector.d.ts.map +1 -1
- package/dist/lib/EnvironmentSelector.js +74 -18
- package/dist/lib/EnvironmentSelector.js.map +1 -1
- package/dist/lib/SkillManager.d.ts +33 -0
- package/dist/lib/SkillManager.d.ts.map +1 -0
- package/dist/lib/SkillManager.js +254 -0
- package/dist/lib/SkillManager.js.map +1 -0
- package/dist/lib/TemplateManager.d.ts +9 -0
- package/dist/lib/TemplateManager.d.ts.map +1 -1
- package/dist/lib/TemplateManager.js +50 -0
- package/dist/lib/TemplateManager.js.map +1 -1
- package/dist/templates/commands/capture-knowledge.md +50 -0
- package/dist/templates/commands/check-implementation.md +25 -0
- package/dist/templates/commands/code-review.md +85 -0
- package/dist/templates/commands/debug.md +49 -0
- package/dist/templates/commands/execute-plan.md +75 -0
- package/dist/templates/commands/new-requirement.md +131 -0
- package/dist/templates/commands/remember.md +27 -0
- package/dist/templates/commands/review-design.md +16 -0
- package/dist/templates/commands/review-requirements.md +14 -0
- package/dist/templates/commands/simplify-implementation.md +148 -0
- package/dist/templates/commands/update-planning.md +65 -0
- package/dist/templates/commands/writing-test.md +48 -0
- package/dist/templates/env/base.md +83 -0
- package/dist/templates/phases/deployment.md +72 -0
- package/dist/templates/phases/design.md +60 -0
- package/dist/templates/phases/implementation.md +65 -0
- package/dist/templates/phases/monitoring.md +80 -0
- package/dist/templates/phases/planning.md +60 -0
- package/dist/templates/phases/requirements.md +51 -0
- package/dist/templates/phases/testing.md +81 -0
- package/dist/templates/templates/commands/capture-knowledge.md +50 -0
- package/dist/templates/templates/commands/check-implementation.md +25 -0
- package/dist/templates/templates/commands/code-review.md +85 -0
- package/dist/templates/templates/commands/debug.md +49 -0
- package/dist/templates/templates/commands/execute-plan.md +75 -0
- package/dist/templates/templates/commands/new-requirement.md +131 -0
- package/dist/templates/templates/commands/remember.md +27 -0
- package/dist/templates/templates/commands/review-design.md +16 -0
- package/dist/templates/templates/commands/review-requirements.md +14 -0
- package/dist/templates/templates/commands/simplify-implementation.md +148 -0
- package/dist/templates/templates/commands/update-planning.md +65 -0
- package/dist/templates/templates/commands/writing-test.md +48 -0
- package/dist/templates/templates/env/base.md +83 -0
- package/dist/templates/templates/phases/deployment.md +72 -0
- package/dist/templates/templates/phases/design.md +60 -0
- package/dist/templates/templates/phases/implementation.md +65 -0
- package/dist/templates/templates/phases/monitoring.md +80 -0
- package/dist/templates/templates/phases/planning.md +60 -0
- package/dist/templates/templates/phases/requirements.md +51 -0
- package/dist/templates/templates/phases/testing.md +81 -0
- package/dist/types.d.ts +2 -0
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js.map +1 -1
- package/dist/util/env.d.ts +4 -0
- package/dist/util/env.d.ts.map +1 -1
- package/dist/util/env.js +25 -0
- package/dist/util/env.js.map +1 -1
- package/dist/util/git.d.ts +15 -0
- package/dist/util/git.d.ts.map +1 -0
- package/dist/util/git.js +82 -0
- package/dist/util/git.js.map +1 -0
- package/dist/util/skill.d.ts +13 -0
- package/dist/util/skill.d.ts.map +1 -0
- package/dist/util/skill.js +34 -0
- package/dist/util/skill.js.map +1 -0
- package/package.json +4 -2
- package/project.json +29 -0
- package/templates/commands/remember.md +27 -0
- package/templates/commands/review-design.md +1 -0
- package/templates/commands/review-requirements.md +1 -0
- package/templates/env/base.md +32 -0
- package/CHANGELOG.md +0 -87
- package/web/.nojekyll +0 -2
- package/web/CNAME +0 -1
- package/web/README.md +0 -100
- package/web/app/favicon.ico +0 -0
- package/web/app/globals.css +0 -122
- package/web/app/layout.tsx +0 -106
- package/web/app/page.tsx +0 -119
- package/web/app/roadmap/page.tsx +0 -150
- package/web/app/robots.ts +0 -16
- package/web/app/sitemap.ts +0 -46
- package/web/app/vision/page.tsx +0 -49
- package/web/components/Footer.tsx +0 -81
- package/web/components/GitHubButton.tsx +0 -49
- package/web/components/GitHubStars.tsx +0 -27
- package/web/components/Header.tsx +0 -108
- package/web/components/MarkdownContent.tsx +0 -35
- package/web/components/SkipToContent.tsx +0 -11
- package/web/content/pages/vision.md +0 -44
- package/web/content/roadmap/1-web.md +0 -9
- package/web/content/roadmap/2-integrations.md +0 -7
- package/web/content/roadmap/3-cli-enhancements.md +0 -8
- package/web/content/roadmap/4-local-memory.md +0 -8
- package/web/eslint.config.mjs +0 -18
- package/web/lib/GitHubContext.tsx +0 -57
- package/web/lib/content/loader.ts +0 -152
- package/web/lib/content/types.ts +0 -37
- package/web/lib/utils.ts +0 -12
- package/web/next.config.ts +0 -11
- package/web/package-lock.json +0 -8837
- package/web/package.json +0 -34
- package/web/postcss.config.mjs +0 -7
- package/web/public/file.svg +0 -1
- package/web/public/globe.svg +0 -1
- package/web/public/next.svg +0 -1
- package/web/public/vercel.svg +0 -1
- package/web/public/window.svg +0 -1
package/README.md
CHANGED
|
@@ -1,6 +1,9 @@
|
|
|
1
|
-
#
|
|
1
|
+
# @ai-devkit/cli
|
|
2
|
+
> Part of [AI DevKit](https://github.com/Codeaholicguy/ai-devkit)
|
|
2
3
|
|
|
3
|
-
|
|
4
|
+
The official command-line interface for **AI DevKit**.
|
|
5
|
+
|
|
6
|
+
This tool orchestrates the setup and management of AI-assisted development environments, ensuring your project is ready for agents like Cursor, Claude Code, and more.
|
|
4
7
|
|
|
5
8
|
[](https://www.npmjs.com/package/ai-devkit)
|
|
6
9
|
[](https://opensource.org/licenses/MIT)
|
|
@@ -30,12 +33,6 @@ Initialize AI DevKit in your project:
|
|
|
30
33
|
```bash
|
|
31
34
|
# Interactive mode (recommended)
|
|
32
35
|
ai-devkit init
|
|
33
|
-
|
|
34
|
-
# With flags
|
|
35
|
-
ai-devkit init --environment cursor --all
|
|
36
|
-
|
|
37
|
-
# Initialize specific phases
|
|
38
|
-
ai-devkit init --phases requirements,design,planning
|
|
39
36
|
```
|
|
40
37
|
|
|
41
38
|
This will:
|
|
@@ -66,7 +63,6 @@ Initialize AI DevKit in your project.
|
|
|
66
63
|
- `-a, --all`: Initialize all phases at once
|
|
67
64
|
- `-p, --phases <phases>`: Comma-separated list of specific phases
|
|
68
65
|
|
|
69
|
-
**Examples:**
|
|
70
66
|
```bash
|
|
71
67
|
# Interactive mode
|
|
72
68
|
ai-devkit init
|
|
@@ -130,50 +126,11 @@ Supported Tools & Agents:
|
|
|
130
126
|
| [Windsurf](https://windsurf.com/) | 🚧 | Testing |
|
|
131
127
|
| [Kilo Code](https://github.com/Kilo-Org/kilocode) | 🚧 | Testing |
|
|
132
128
|
| [Roo Code](https://roocode.com/) | 🚧 | Testing |
|
|
133
|
-
| [Codex CLI](https://github.com/openai/codex) |
|
|
129
|
+
| [Codex CLI](https://github.com/openai/codex) | ✅ | Only Global |
|
|
134
130
|
| [Amp](https://ampcode.com/) | 🚧 | Testing |
|
|
135
131
|
|
|
136
132
|
Templates are designed to provide structure while remaining concise and AI-friendly.
|
|
137
133
|
|
|
138
|
-
## Environment Setup
|
|
139
|
-
|
|
140
|
-
### Cursor
|
|
141
|
-
|
|
142
|
-
Generated files:
|
|
143
|
-
- `.cursor/rules/`: Project-specific rules as Markdown files (per [Cursor documentation](https://cursor.com/docs/context/rules))
|
|
144
|
-
- `.cursor/commands/`: Custom slash commands as Markdown files (per [Cursor documentation](https://cursor.com/docs/agent/chat/commands))
|
|
145
|
-
|
|
146
|
-
Available slash commands:
|
|
147
|
-
- `/new-requirement`: Complete workflow for adding a new feature from requirements to PR
|
|
148
|
-
- `/code-review`: Structured local code review against design docs before pushing changes
|
|
149
|
-
- `/execute-plan`: Walk a feature plan task-by-task with interactive prompts
|
|
150
|
-
- `/writing-test`: Write unit/integration tests targeting 100% coverage
|
|
151
|
-
- `/update-planning`: Update planning and task breakdown
|
|
152
|
-
- `/check-implementation`: Compare implementation with design
|
|
153
|
-
- `/review-design`: Review system design and architecture
|
|
154
|
-
- `/review-requirements`: Review and summarize requirements
|
|
155
|
-
|
|
156
|
-
Each command is stored as a plain Markdown file in `.cursor/commands/` and will automatically appear when you type `/` in Cursor's chat input.
|
|
157
|
-
|
|
158
|
-
### Claude Code
|
|
159
|
-
|
|
160
|
-
Generated files:
|
|
161
|
-
- `.claude/CLAUDE.md`: Workspace configuration and guidelines
|
|
162
|
-
- `.claude/commands/`: Custom commands as Markdown files
|
|
163
|
-
|
|
164
|
-
Available commands:
|
|
165
|
-
- `new-requirement` - Complete workflow for adding a new feature from requirements to PR
|
|
166
|
-
- `code-review` - Structured local code review against design docs before pushing changes
|
|
167
|
-
- `execute-plan` - Walk a feature plan task-by-task with interactive prompts
|
|
168
|
-
- `writing-test` - Write unit/integration tests targeting 100% coverage
|
|
169
|
-
- `update-planning` - Update planning and task breakdown
|
|
170
|
-
- `check-implementation` - Compare implementation with design
|
|
171
|
-
- `review-design` - Review system design and architecture
|
|
172
|
-
- `review-requirements` - Review and summarize requirements
|
|
173
|
-
- `capture-knowledge` - Analyze and explain code with recursive dependency analysis and Mermaid diagrams
|
|
174
|
-
|
|
175
|
-
Commands can be referenced in Claude Code chats to guide AI assistance through your development phases.
|
|
176
|
-
|
|
177
134
|
## Workflow Examples
|
|
178
135
|
|
|
179
136
|
### Initial Project Setup
|
|
@@ -184,31 +141,36 @@ Commands can be referenced in Claude Code chats to guide AI assistance through y
|
|
|
184
141
|
```
|
|
185
142
|
|
|
186
143
|
2. **Start with requirements:**
|
|
187
|
-
-
|
|
188
|
-
-
|
|
144
|
+
- Use slash command to start filling the requirement `/new-requerement`
|
|
145
|
+
- Your AI assistant will help clarify and document requirements
|
|
146
|
+
- Use slash command to review the requirement `/review-requirement`
|
|
189
147
|
|
|
190
148
|
3. **Design your system:**
|
|
191
|
-
-
|
|
192
|
-
-
|
|
193
|
-
-
|
|
194
|
-
|
|
149
|
+
- Review `docs/ai/design/` and feature-specific files
|
|
150
|
+
- Use slash command to review the design `/review-design`
|
|
151
|
+
- Your AI assistant will help clarify and document design
|
|
152
|
+
|
|
195
153
|
4. **Plan your work:**
|
|
196
|
-
-
|
|
197
|
-
-
|
|
154
|
+
- Review `docs/ai/planning/` and feature-specific plans
|
|
155
|
+
- Clarify and document plan with AI assistant
|
|
198
156
|
|
|
199
157
|
5. **Implement with guidance:**
|
|
200
|
-
-
|
|
201
|
-
-
|
|
158
|
+
- When the plan is ready, your AI assistant will help you implement the code
|
|
159
|
+
- You can start the execution of the plan with the command `/execute-plan`
|
|
160
|
+
- AI assistant will help you to review the code and update the implementation notes
|
|
161
|
+
- After executing each task, you can check the implementation and compare it with the design with AI support by using the command `/check-implementation`
|
|
162
|
+
- Once the implementation is good, you can review the code with AI support by using the command `/code-review`
|
|
202
163
|
|
|
203
164
|
6. **Test thoroughly:**
|
|
204
|
-
-
|
|
205
|
-
-
|
|
165
|
+
- After implementation is done, you can start testing
|
|
166
|
+
- Use `docs/ai/testing/` as your testing guide
|
|
167
|
+
- Use slash command to start writing test `/writing-test`
|
|
206
168
|
|
|
207
169
|
7. **Deploy confidently:**
|
|
208
|
-
- Follow deployment procedures in `docs/ai/deployment
|
|
170
|
+
- Follow deployment procedures in `docs/ai/deployment/`
|
|
209
171
|
|
|
210
172
|
8. **Monitor and iterate:**
|
|
211
|
-
- Set up monitoring per `docs/ai/monitoring
|
|
173
|
+
- Set up monitoring per `docs/ai/monitoring/`
|
|
212
174
|
|
|
213
175
|
## Use Cases
|
|
214
176
|
|
|
@@ -242,18 +204,21 @@ The `.ai-devkit.json` file tracks your setup:
|
|
|
242
204
|
|
|
243
205
|
## Development
|
|
244
206
|
|
|
245
|
-
To work on
|
|
207
|
+
To work on the CLI package:
|
|
246
208
|
|
|
247
209
|
```bash
|
|
248
210
|
# Clone the repository
|
|
249
211
|
git clone <repository-url>
|
|
250
212
|
cd ai-devkit
|
|
251
213
|
|
|
252
|
-
# Install dependencies
|
|
214
|
+
# Install dependencies for the monorepo
|
|
253
215
|
npm install
|
|
254
216
|
|
|
217
|
+
# Navigate to CLI package
|
|
218
|
+
cd packages/cli
|
|
219
|
+
|
|
255
220
|
# Run in development mode
|
|
256
|
-
npm run dev init
|
|
221
|
+
npm run dev -- init
|
|
257
222
|
|
|
258
223
|
# Build
|
|
259
224
|
npm run build
|
|
@@ -263,8 +228,6 @@ npm link
|
|
|
263
228
|
ai-devkit init
|
|
264
229
|
```
|
|
265
230
|
|
|
266
|
-
> **Note:** `ai-devkit init` now ensures the current directory is a git repository. If git is available and the repo isn't initialized, it will run `git init` automatically.
|
|
267
|
-
|
|
268
231
|
## Contributing
|
|
269
232
|
|
|
270
233
|
Contributions are welcome! Please feel free to submit issues and pull requests.
|
|
@@ -279,20 +242,7 @@ MIT
|
|
|
279
242
|
|
|
280
243
|
## Quick Reference
|
|
281
244
|
|
|
282
|
-
| Task | Command |
|
|
283
|
-
|------|---------|
|
|
284
|
-
| Initialize everything | `npx ai-devkit init --all` |
|
|
285
|
-
| Initialize for Cursor | `npx ai-devkit init --environment cursor` |
|
|
286
|
-
| Add specific phases | `npx ai-devkit init --phases requirements,design` |
|
|
287
|
-
| Add one phase later | `npx ai-devkit phase testing` |
|
|
288
|
-
| Guided feature workflow | `/new-requirement` (Cursor & Claude) |
|
|
289
|
-
| Execute feature plan | `/execute-plan` (Cursor & Claude) |
|
|
290
|
-
| Generate tests | `/writing-test` (Cursor & Claude) |
|
|
291
|
-
| Local code review | `/code-review` (Cursor & Claude) |
|
|
292
|
-
| Help | `npx ai-devkit --help` |
|
|
293
|
-
|
|
294
245
|
| Quick links | Description |
|
|
295
246
|
|-------------|-------------|
|
|
296
247
|
| [CHANGELOG.md](CHANGELOG.md) | Recent changes and release notes |
|
|
297
|
-
| [templates/](templates/) | Phase and environment templates |
|
|
298
248
|
|
package/dist/cli.js
CHANGED
|
@@ -4,6 +4,9 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
4
4
|
const commander_1 = require("commander");
|
|
5
5
|
const init_1 = require("./commands/init");
|
|
6
6
|
const phase_1 = require("./commands/phase");
|
|
7
|
+
const setup_1 = require("./commands/setup");
|
|
8
|
+
const memory_1 = require("./commands/memory");
|
|
9
|
+
const skill_1 = require("./commands/skill");
|
|
7
10
|
const program = new commander_1.Command();
|
|
8
11
|
program
|
|
9
12
|
.name('ai-devkit')
|
|
@@ -20,5 +23,12 @@ program
|
|
|
20
23
|
.command('phase [name]')
|
|
21
24
|
.description('Add a specific phase template (requirements|design|planning|implementation|testing|deployment|monitoring)')
|
|
22
25
|
.action(phase_1.phaseCommand);
|
|
26
|
+
program
|
|
27
|
+
.command('setup')
|
|
28
|
+
.description('Set up AI DevKit commands globally')
|
|
29
|
+
.option('-g, --global', 'Install commands to global environment folders')
|
|
30
|
+
.action(setup_1.setupCommand);
|
|
31
|
+
(0, memory_1.registerMemoryCommand)(program);
|
|
32
|
+
(0, skill_1.registerSkillCommand)(program);
|
|
23
33
|
program.parse();
|
|
24
34
|
//# sourceMappingURL=cli.js.map
|
package/dist/cli.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cli.js","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":";;;AAEA,yCAAoC;AACpC,0CAA8C;AAC9C,4CAAgD;
|
|
1
|
+
{"version":3,"file":"cli.js","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":";;;AAEA,yCAAoC;AACpC,0CAA8C;AAC9C,4CAAgD;AAChD,4CAAgD;AAChD,8CAA0D;AAC1D,4CAAwD;AAExD,MAAM,OAAO,GAAG,IAAI,mBAAO,EAAE,CAAC;AAE9B,OAAO;KACJ,IAAI,CAAC,WAAW,CAAC;KACjB,WAAW,CAAC,0CAA0C,CAAC;KACvD,OAAO,CAAC,OAAO,CAAC,CAAC;AAEpB,OAAO;KACJ,OAAO,CAAC,MAAM,CAAC;KACf,WAAW,CAAC,+CAA+C,CAAC;KAC5D,MAAM,CAAC,yBAAyB,EAAE,8CAA8C,CAAC;KACjF,MAAM,CAAC,WAAW,EAAE,uBAAuB,CAAC;KAC5C,MAAM,CAAC,uBAAuB,EAAE,8CAA8C,CAAC;KAC/E,MAAM,CAAC,kBAAW,CAAC,CAAC;AAEvB,OAAO;KACJ,OAAO,CAAC,cAAc,CAAC;KACvB,WAAW,CAAC,2GAA2G,CAAC;KACxH,MAAM,CAAC,oBAAY,CAAC,CAAC;AAExB,OAAO;KACJ,OAAO,CAAC,OAAO,CAAC;KAChB,WAAW,CAAC,oCAAoC,CAAC;KACjD,MAAM,CAAC,cAAc,EAAE,gDAAgD,CAAC;KACxE,MAAM,CAAC,oBAAY,CAAC,CAAC;AAExB,IAAA,8BAAqB,EAAC,OAAO,CAAC,CAAC;AAC/B,IAAA,4BAAoB,EAAC,OAAO,CAAC,CAAC;AAE9B,OAAO,CAAC,KAAK,EAAE,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"init.d.ts","sourceRoot":"","sources":["../../src/commands/init.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,eAAe,
|
|
1
|
+
{"version":3,"file":"init.d.ts","sourceRoot":"","sources":["../../src/commands/init.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,eAAe,EAAuB,MAAM,UAAU,CAAC;AAqChE,UAAU,WAAW;IACnB,WAAW,CAAC,EAAE,eAAe,EAAE,CAAC;IAChC,GAAG,CAAC,EAAE,OAAO,CAAC;IACd,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,wBAAsB,WAAW,CAAC,OAAO,EAAE,WAAW,iBAqHrD"}
|
package/dist/commands/init.js
CHANGED
|
@@ -125,7 +125,7 @@ async function initCommand(options) {
|
|
|
125
125
|
shouldCopy = overwrite;
|
|
126
126
|
}
|
|
127
127
|
if (shouldCopy) {
|
|
128
|
-
|
|
128
|
+
await templateManager.copyPhaseTemplate(phase);
|
|
129
129
|
await configManager.addPhase(phase);
|
|
130
130
|
console.log(chalk_1.default.green(`[OK] Created ${phase} phase`));
|
|
131
131
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"init.js","sourceRoot":"","sources":["../../src/commands/init.ts"],"names":[],"mappings":";;;;;AAkDA,kCAqHC;AAvKD,iDAAyC;AACzC,wDAAgC;AAChC,kDAA0B;AAC1B,0CAA8C;AAC9C,4DAAyD;AACzD,oEAAiE;AACjE,wDAAqD;AACrD,
|
|
1
|
+
{"version":3,"file":"init.js","sourceRoot":"","sources":["../../src/commands/init.ts"],"names":[],"mappings":";;;;;AAkDA,kCAqHC;AAvKD,iDAAyC;AACzC,wDAAgC;AAChC,kDAA0B;AAC1B,0CAA8C;AAC9C,4DAAyD;AACzD,oEAAiE;AACjE,wDAAqD;AACrD,oCAAgE;AAChE,2CAAwD;AAExD,SAAS,cAAc;IACrB,IAAI,CAAC;QACH,IAAA,wBAAQ,EAAC,eAAe,EAAE,EAAE,KAAK,EAAE,QAAQ,EAAE,CAAC,CAAC;QAC/C,OAAO,IAAI,CAAC;IACd,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,KAAK,CAAC;IACf,CAAC;AACH,CAAC;AAED,SAAS,mBAAmB;IAC1B,IAAI,CAAC,cAAc,EAAE,EAAE,CAAC;QACtB,OAAO,CAAC,GAAG,CACT,eAAK,CAAC,MAAM,CACV,iGAAiG,CAClG,CACF,CAAC;QACF,OAAO;IACT,CAAC;IAED,IAAI,CAAC;QACH,IAAA,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@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"memory.d.ts","sourceRoot":"","sources":["../../src/commands/memory.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAIzC,wBAAgB,qBAAqB,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CA2C5D"}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.registerMemoryCommand = registerMemoryCommand;
|
|
7
|
+
const chalk_1 = __importDefault(require("chalk"));
|
|
8
|
+
const api_1 = require("@ai-devkit/memory/api");
|
|
9
|
+
function registerMemoryCommand(program) {
|
|
10
|
+
const memoryCommand = program
|
|
11
|
+
.command('memory')
|
|
12
|
+
.description('Interact with the knowledge memory service');
|
|
13
|
+
memoryCommand
|
|
14
|
+
.command('store')
|
|
15
|
+
.description('Store a new knowledge item')
|
|
16
|
+
.requiredOption('-t, --title <title>', 'Title of the knowledge item (10-100 chars)')
|
|
17
|
+
.requiredOption('-c, --content <content>', 'Content of the knowledge item (50-5000 chars)')
|
|
18
|
+
.option('--tags <tags>', 'Comma-separated tags (e.g., "api,backend")')
|
|
19
|
+
.option('-s, --scope <scope>', 'Scope: global, project:<name>, or repo:<name>', 'global')
|
|
20
|
+
.action((options) => {
|
|
21
|
+
try {
|
|
22
|
+
const result = (0, api_1.memoryStoreCommand)(options);
|
|
23
|
+
console.log(JSON.stringify(result, null, 2));
|
|
24
|
+
}
|
|
25
|
+
catch (error) {
|
|
26
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
27
|
+
console.error(chalk_1.default.red(`[ERROR] ${message}`));
|
|
28
|
+
process.exit(1);
|
|
29
|
+
}
|
|
30
|
+
});
|
|
31
|
+
memoryCommand
|
|
32
|
+
.command('search')
|
|
33
|
+
.description('Search for knowledge items')
|
|
34
|
+
.requiredOption('-q, --query <query>', 'Search query (3-500 chars)')
|
|
35
|
+
.option('--tags <tags>', 'Comma-separated context tags to boost results')
|
|
36
|
+
.option('-s, --scope <scope>', 'Scope filter')
|
|
37
|
+
.option('-l, --limit <limit>', 'Maximum results (1-20)', '5')
|
|
38
|
+
.action((options) => {
|
|
39
|
+
try {
|
|
40
|
+
const result = (0, api_1.memorySearchCommand)({
|
|
41
|
+
...options,
|
|
42
|
+
limit: options.limit ? parseInt(options.limit, 10) : 5
|
|
43
|
+
});
|
|
44
|
+
console.log(JSON.stringify(result, null, 2));
|
|
45
|
+
}
|
|
46
|
+
catch (error) {
|
|
47
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
48
|
+
console.error(chalk_1.default.red(`[ERROR] ${message}`));
|
|
49
|
+
process.exit(1);
|
|
50
|
+
}
|
|
51
|
+
});
|
|
52
|
+
}
|
|
53
|
+
//# sourceMappingURL=memory.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"memory.js","sourceRoot":"","sources":["../../src/commands/memory.ts"],"names":[],"mappings":";;;;;AAKA,sDA2CC;AAhDD,kDAA0B;AAE1B,+CAAgF;AAGhF,SAAgB,qBAAqB,CAAC,OAAgB;IACpD,MAAM,aAAa,GAAG,OAAO;SAC1B,OAAO,CAAC,QAAQ,CAAC;SACjB,WAAW,CAAC,4CAA4C,CAAC,CAAC;IAE7D,aAAa;SACV,OAAO,CAAC,OAAO,CAAC;SAChB,WAAW,CAAC,4BAA4B,CAAC;SACzC,cAAc,CAAC,qBAAqB,EAAE,4CAA4C,CAAC;SACnF,cAAc,CAAC,yBAAyB,EAAE,+CAA+C,CAAC;SAC1F,MAAM,CAAC,eAAe,EAAE,4CAA4C,CAAC;SACrE,MAAM,CAAC,qBAAqB,EAAE,+CAA+C,EAAE,QAAQ,CAAC;SACxF,MAAM,CAAC,CAAC,OAA2B,EAA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OAAO,GAAG,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;YACvE,OAAO,CAAC,KAAK,CAAC,eAAK,CAAC,GAAG,CAAC,WAAW,OAAO,EAAE,CAAC,CAAC,CAAC;YAC/C,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QAClB,CAAC;IACH,CAAC,CAAC,CAAC;AACP,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"setup.d.ts","sourceRoot":"","sources":["../../src/commands/setup.ts"],"names":[],"mappings":"AAQA,UAAU,YAAY;IAClB,MAAM,CAAC,EAAE,OAAO,CAAC;CACpB;AAED,wBAAsB,YAAY,CAAC,OAAO,EAAE,YAAY,iBAQvD"}
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
36
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
37
|
+
};
|
|
38
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
|
+
exports.setupCommand = setupCommand;
|
|
40
|
+
const inquirer_1 = __importDefault(require("inquirer"));
|
|
41
|
+
const chalk_1 = __importDefault(require("chalk"));
|
|
42
|
+
const path = __importStar(require("path"));
|
|
43
|
+
const TemplateManager_1 = require("../lib/TemplateManager");
|
|
44
|
+
const EnvironmentSelector_1 = require("../lib/EnvironmentSelector");
|
|
45
|
+
const env_1 = require("../util/env");
|
|
46
|
+
async function setupCommand(options) {
|
|
47
|
+
if (!options.global) {
|
|
48
|
+
console.log(chalk_1.default.yellow('Please use --global flag to set up global commands.'));
|
|
49
|
+
console.log(chalk_1.default.blue('Usage: ai-devkit setup --global'));
|
|
50
|
+
return;
|
|
51
|
+
}
|
|
52
|
+
await setupGlobalCommands();
|
|
53
|
+
}
|
|
54
|
+
async function setupGlobalCommands() {
|
|
55
|
+
const templateManager = new TemplateManager_1.TemplateManager();
|
|
56
|
+
const environmentSelector = new EnvironmentSelector_1.EnvironmentSelector();
|
|
57
|
+
console.log(chalk_1.default.blue('Global Setup\n'));
|
|
58
|
+
console.log(chalk_1.default.gray('This will copy AI DevKit commands to your global environment folders.\n'));
|
|
59
|
+
const selectedEnvironments = await environmentSelector.selectGlobalEnvironments();
|
|
60
|
+
if (selectedEnvironments.length === 0) {
|
|
61
|
+
console.log(chalk_1.default.yellow('No environments selected. Setup cancelled.'));
|
|
62
|
+
return;
|
|
63
|
+
}
|
|
64
|
+
environmentSelector.displaySelectionSummary(selectedEnvironments);
|
|
65
|
+
for (const envCode of selectedEnvironments) {
|
|
66
|
+
await processGlobalEnvironment(envCode, templateManager);
|
|
67
|
+
}
|
|
68
|
+
console.log(chalk_1.default.green('\n✅ Global setup completed successfully!\n'));
|
|
69
|
+
console.log(chalk_1.default.blue('Your commands are now available globally for the selected environments.'));
|
|
70
|
+
}
|
|
71
|
+
async function processGlobalEnvironment(envCode, templateManager) {
|
|
72
|
+
const envName = (0, env_1.getEnvironmentDisplayName)(envCode);
|
|
73
|
+
const env = (0, env_1.getEnvironment)(envCode);
|
|
74
|
+
if (!env || !env.globalCommandPath) {
|
|
75
|
+
console.log(chalk_1.default.red(`[ERROR] ${envName} does not support global setup.`));
|
|
76
|
+
return;
|
|
77
|
+
}
|
|
78
|
+
console.log(chalk_1.default.blue(`\nSetting up ${envName}...`));
|
|
79
|
+
console.log(chalk_1.default.gray(` Global path: ~/${env.globalCommandPath}`));
|
|
80
|
+
const commandsExist = await templateManager.checkGlobalCommandsExist(envCode);
|
|
81
|
+
if (commandsExist) {
|
|
82
|
+
const { shouldOverwrite } = await inquirer_1.default.prompt([
|
|
83
|
+
{
|
|
84
|
+
type: 'confirm',
|
|
85
|
+
name: 'shouldOverwrite',
|
|
86
|
+
message: `Global commands already exist for ${envName}. Overwrite?`,
|
|
87
|
+
default: false
|
|
88
|
+
}
|
|
89
|
+
]);
|
|
90
|
+
if (!shouldOverwrite) {
|
|
91
|
+
console.log(chalk_1.default.yellow(`[SKIP] Skipped ${envName} (files already exist)`));
|
|
92
|
+
return;
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
try {
|
|
96
|
+
const copiedFiles = await templateManager.copyCommandsToGlobal(envCode);
|
|
97
|
+
console.log(chalk_1.default.green(`[OK] Copied ${copiedFiles.length} commands to ${envName} global folder`)); // Show copied files
|
|
98
|
+
copiedFiles.forEach(file => {
|
|
99
|
+
const fileName = path.basename(file);
|
|
100
|
+
console.log(chalk_1.default.gray(` • ${fileName}`));
|
|
101
|
+
});
|
|
102
|
+
}
|
|
103
|
+
catch (error) {
|
|
104
|
+
if (error instanceof Error) {
|
|
105
|
+
console.log(chalk_1.default.red(`[ERROR] Failed to set up ${envName}: ${error.message}`));
|
|
106
|
+
}
|
|
107
|
+
else {
|
|
108
|
+
console.log(chalk_1.default.red(`[ERROR] Failed to set up ${envName}`));
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
//# sourceMappingURL=setup.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"setup.js","sourceRoot":"","sources":["../../src/commands/setup.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAYA,oCAQC;AApBD,wDAAgC;AAChC,kDAA0B;AAC1B,2CAA6B;AAC7B,4DAAyD;AACzD,oEAAiE;AAEjE,qCAAwE;AAMjE,KAAK,UAAU,YAAY,CAAC,OAAqB;IACpD,IAAI,CAAC,OAAO,CAAC,MAAM,EAAE,CAAC;QAClB,OAAO,CAAC,GAAG,CAAC,eAAK,CAAC,MAAM,CAAC,qDAAqD,CAAC,CAAC,CAAC;QACjF,OAAO,CAAC,GAAG,CAAC,eAAK,CAAC,IAAI,CAAC,iCAAiC,CAAC,CAAC,CAAC;QAC3D,OAAO;IACX,CAAC;IAED,MAAM,mBAAmB,EAAE,CAAC;AAChC,CAAC;AAED,KAAK,UAAU,mBAAmB;IAC9B,MAAM,eAAe,GAAG,IAAI,iCAAe,EAAE,CAAC;IAC9C,MAAM,mBAAmB,GAAG,IAAI,yCAAmB,EAAE,CAAC;IAEtD,OAAO,CAAC,GAAG,CAAC,eAAK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K,CAAC,GAAG,CAAC,4BAA4B,OAAO,EAAE,CAAC,CAAC,CAAC;QAClE,CAAC;IACL,CAAC;AACL,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"skill.d.ts","sourceRoot":"","sources":["../../src/commands/skill.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAKpC,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CA+E3D"}
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.registerSkillCommand = registerSkillCommand;
|
|
7
|
+
const chalk_1 = __importDefault(require("chalk"));
|
|
8
|
+
const Config_1 = require("../lib/Config");
|
|
9
|
+
const SkillManager_1 = require("../lib/SkillManager");
|
|
10
|
+
function registerSkillCommand(program) {
|
|
11
|
+
const skillCommand = program
|
|
12
|
+
.command('skill')
|
|
13
|
+
.description('Manage Agent Skills');
|
|
14
|
+
skillCommand
|
|
15
|
+
.command('add <registry-repo> <skill-name>')
|
|
16
|
+
.description('Install a skill from a registry (e.g., ai-devkit skill add anthropics/skills frontend-design)')
|
|
17
|
+
.action(async (registryRepo, skillName) => {
|
|
18
|
+
try {
|
|
19
|
+
const configManager = new Config_1.ConfigManager();
|
|
20
|
+
const skillManager = new SkillManager_1.SkillManager(configManager);
|
|
21
|
+
await skillManager.addSkill(registryRepo, skillName);
|
|
22
|
+
}
|
|
23
|
+
catch (error) {
|
|
24
|
+
console.error(chalk_1.default.red(`\nFailed to add skill: ${error.message}\n`));
|
|
25
|
+
process.exit(1);
|
|
26
|
+
}
|
|
27
|
+
});
|
|
28
|
+
skillCommand
|
|
29
|
+
.command('list')
|
|
30
|
+
.description('List all installed skills in the current project')
|
|
31
|
+
.action(async () => {
|
|
32
|
+
try {
|
|
33
|
+
const configManager = new Config_1.ConfigManager();
|
|
34
|
+
const skillManager = new SkillManager_1.SkillManager(configManager);
|
|
35
|
+
const skills = await skillManager.listSkills();
|
|
36
|
+
if (skills.length === 0) {
|
|
37
|
+
console.log(chalk_1.default.yellow('\nNo skills installed in this project.'));
|
|
38
|
+
console.log(chalk_1.default.dim('Install a skill with: ai-devkit skill add <registry>/<repo> <skill-name>\n'));
|
|
39
|
+
return;
|
|
40
|
+
}
|
|
41
|
+
console.log(chalk_1.default.bold('\nInstalled Skills:\n'));
|
|
42
|
+
const maxNameLength = Math.max(...skills.map(s => s.name.length), 10);
|
|
43
|
+
const maxRegistryLength = Math.max(...skills.map(s => s.registry.length), 15);
|
|
44
|
+
console.log(chalk_1.default.dim(' ') +
|
|
45
|
+
chalk_1.default.bold('Skill Name'.padEnd(maxNameLength + 2)) +
|
|
46
|
+
chalk_1.default.bold('Registry'.padEnd(maxRegistryLength + 2)) +
|
|
47
|
+
chalk_1.default.bold('Environments'));
|
|
48
|
+
console.log(chalk_1.default.dim(' ' + '─'.repeat(maxNameLength + maxRegistryLength + 30)));
|
|
49
|
+
skills.forEach(skill => {
|
|
50
|
+
console.log(' ' +
|
|
51
|
+
chalk_1.default.cyan(skill.name.padEnd(maxNameLength + 2)) +
|
|
52
|
+
chalk_1.default.dim(skill.registry.padEnd(maxRegistryLength + 2)) +
|
|
53
|
+
chalk_1.default.green(skill.environments.join(', ')));
|
|
54
|
+
});
|
|
55
|
+
console.log(chalk_1.default.dim(`\n Total: ${skills.length} skill(s)\n`));
|
|
56
|
+
}
|
|
57
|
+
catch (error) {
|
|
58
|
+
console.error(chalk_1.default.red(`\nFailed to list skills: ${error.message}\n`));
|
|
59
|
+
process.exit(1);
|
|
60
|
+
}
|
|
61
|
+
});
|
|
62
|
+
skillCommand
|
|
63
|
+
.command('remove <skill-name>')
|
|
64
|
+
.description('Remove a skill from the current project')
|
|
65
|
+
.action(async (skillName) => {
|
|
66
|
+
try {
|
|
67
|
+
const configManager = new Config_1.ConfigManager();
|
|
68
|
+
const skillManager = new SkillManager_1.SkillManager(configManager);
|
|
69
|
+
await skillManager.removeSkill(skillName);
|
|
70
|
+
}
|
|
71
|
+
catch (error) {
|
|
72
|
+
console.error(chalk_1.default.red(`\nFailed to remove skill: ${error.message}\n`));
|
|
73
|
+
process.exit(1);
|
|
74
|
+
}
|
|
75
|
+
});
|
|
76
|
+
}
|
|
77
|
+
//# sourceMappingURL=skill.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"skill.js","sourceRoot":"","sources":["../../src/commands/skill.ts"],"names":[],"mappings":";;;;;AAKA,oDA+EC;AAnFD,kDAA0B;AAC1B,0CAA8C;AAC9C,sDAAmD;AAEnD,SAAgB,oBAAoB,CAAC,OAAgB;IACnD,MAAM,YAAY,GAAG,OAAO;SACzB,OAAO,CAAC,OAAO,CAAC;SAChB,WAAW,CAAC,qBAAqB,CAAC,CAAC;IAEtC,YAAY;SACT,OAAO,CAAC,kCAAkC,CAAC;SAC3C,WAAW,CAAC,+FAA+F,CAAC;SAC5G,MAAM,CAAC,KAAK,EAAE,YAAoB,EAAE,SAAiB,EAAE,EAAE;QACxD,IAAI,CAAC;YACH,MAAM,aAAa,GAAG,IAAI,sBAAa,EAAE,CAAC;YAC1C,MAAM,YAAY,GAAG,IAAI,2BAAY,CAAC,aAAa,CAAC,CAAC;YAErD,MAAM,YAAY,CAAC,QAAQ,CAAC,YAAY,EAAE,SAAS,CAAC,CAAC;QACvD,CAAC;QAAC,OAAO,KAAU,EAAE,CAAC;YACpB,OAAO,CAAC,KAAK,CAAC,eAAK,CAAC,GAAG,CAAC,0BAA0B,KAAK,CAAC,OAAO,IAAI,CAAC,CAAC,CAAC;YACtE,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QAClB,CAAC;IACH,CAAC,CAAC,CAAC;IAEL,YAAY;SACT,OAAO,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OAAO,CAAC,KAAK,CAAC,eAAK,CAAC,GAAG,CAAC,6BAA6B,KAAK,CAAC,OAAO,IAAI,CAAC,CAAC,CAAC;YACzE,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QAClB,CAAC;IACH,CAAC,CAAC,CAAC;AACP,CAAC"}
|
|
@@ -1,7 +1,9 @@
|
|
|
1
|
-
import { EnvironmentCode } from
|
|
1
|
+
import { EnvironmentCode } from "../types";
|
|
2
2
|
export declare class EnvironmentSelector {
|
|
3
3
|
selectEnvironments(): Promise<EnvironmentCode[]>;
|
|
4
4
|
confirmOverride(conflicts: EnvironmentCode[]): Promise<boolean>;
|
|
5
5
|
displaySelectionSummary(selected: EnvironmentCode[]): void;
|
|
6
|
+
selectGlobalEnvironments(): Promise<EnvironmentCode[]>;
|
|
7
|
+
selectSkillEnvironments(): Promise<EnvironmentCode[]>;
|
|
6
8
|
}
|
|
7
9
|
//# sourceMappingURL=EnvironmentSelector.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EnvironmentSelector.d.ts","sourceRoot":"","sources":["../../src/lib/EnvironmentSelector.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"EnvironmentSelector.d.ts","sourceRoot":"","sources":["../../src/lib/EnvironmentSelector.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AAQ3C,qBAAa,mBAAmB;IACxB,kBAAkB,IAAI,OAAO,CAAC,eAAe,EAAE,CAAC;IA6BhD,eAAe,CAAC,SAAS,EAAE,eAAe,EAAE,GAAG,OAAO,CAAC,OAAO,CAAC;IAmBrE,uBAAuB,CAAC,QAAQ,EAAE,eAAe,EAAE,GAAG,IAAI;IAapD,wBAAwB,IAAI,OAAO,CAAC,eAAe,EAAE,CAAC;IAkCtD,uBAAuB,IAAI,OAAO,CAAC,eAAe,EAAE,CAAC;CAiC5D"}
|