corydora 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/CHANGELOG.md +11 -0
- package/LICENSE +21 -0
- package/README.md +165 -0
- package/dist/agents/builtin-agents.d.ts +2 -0
- package/dist/agents/builtin-agents.js +75 -0
- package/dist/agents/builtin-agents.js.map +1 -0
- package/dist/agents/catalog.d.ts +4 -0
- package/dist/agents/catalog.js +49 -0
- package/dist/agents/catalog.js.map +1 -0
- package/dist/agents/frontmatter.d.ts +5 -0
- package/dist/agents/frontmatter.js +30 -0
- package/dist/agents/frontmatter.js.map +1 -0
- package/dist/commands/agents-import.d.ts +2 -0
- package/dist/commands/agents-import.js +12 -0
- package/dist/commands/agents-import.js.map +1 -0
- package/dist/commands/agents-list.d.ts +2 -0
- package/dist/commands/agents-list.js +26 -0
- package/dist/commands/agents-list.js.map +1 -0
- package/dist/commands/attach.d.ts +1 -0
- package/dist/commands/attach.js +16 -0
- package/dist/commands/attach.js.map +1 -0
- package/dist/commands/config-validate.d.ts +2 -0
- package/dist/commands/config-validate.js +10 -0
- package/dist/commands/config-validate.js.map +1 -0
- package/dist/commands/doctor.d.ts +2 -0
- package/dist/commands/doctor.js +32 -0
- package/dist/commands/doctor.js.map +1 -0
- package/dist/commands/helpers.d.ts +4 -0
- package/dist/commands/helpers.js +21 -0
- package/dist/commands/helpers.js.map +1 -0
- package/dist/commands/init.d.ts +7 -0
- package/dist/commands/init.js +117 -0
- package/dist/commands/init.js.map +1 -0
- package/dist/commands/run.d.ts +11 -0
- package/dist/commands/run.js +90 -0
- package/dist/commands/run.js.map +1 -0
- package/dist/commands/status.d.ts +2 -0
- package/dist/commands/status.js +40 -0
- package/dist/commands/status.js.map +1 -0
- package/dist/commands/stop.d.ts +2 -0
- package/dist/commands/stop.js +25 -0
- package/dist/commands/stop.js.map +1 -0
- package/dist/config/env.d.ts +2 -0
- package/dist/config/env.js +68 -0
- package/dist/config/env.js.map +1 -0
- package/dist/config/files.d.ts +6 -0
- package/dist/config/files.js +74 -0
- package/dist/config/files.js.map +1 -0
- package/dist/config/schema.d.ts +93 -0
- package/dist/config/schema.js +113 -0
- package/dist/config/schema.js.map +1 -0
- package/dist/constants.d.ts +16 -0
- package/dist/constants.js +79 -0
- package/dist/constants.js.map +1 -0
- package/dist/filesystem/discovery.d.ts +6 -0
- package/dist/filesystem/discovery.js +74 -0
- package/dist/filesystem/discovery.js.map +1 -0
- package/dist/filesystem/gitignore.d.ts +1 -0
- package/dist/filesystem/gitignore.js +37 -0
- package/dist/filesystem/gitignore.js.map +1 -0
- package/dist/filesystem/project.d.ts +3 -0
- package/dist/filesystem/project.js +103 -0
- package/dist/filesystem/project.js.map +1 -0
- package/dist/git/isolation.d.ts +15 -0
- package/dist/git/isolation.js +64 -0
- package/dist/git/isolation.js.map +1 -0
- package/dist/git/repository.d.ts +5 -0
- package/dist/git/repository.js +28 -0
- package/dist/git/repository.js.map +1 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +114 -0
- package/dist/index.js.map +1 -0
- package/dist/providers/api.d.ts +2 -0
- package/dist/providers/api.js +438 -0
- package/dist/providers/api.js.map +1 -0
- package/dist/providers/cli.d.ts +2 -0
- package/dist/providers/cli.js +326 -0
- package/dist/providers/cli.js.map +1 -0
- package/dist/providers/fake.d.ts +11 -0
- package/dist/providers/fake.js +61 -0
- package/dist/providers/fake.js.map +1 -0
- package/dist/providers/index.d.ts +4 -0
- package/dist/providers/index.js +27 -0
- package/dist/providers/index.js.map +1 -0
- package/dist/providers/utils.d.ts +40 -0
- package/dist/providers/utils.js +228 -0
- package/dist/providers/utils.js.map +1 -0
- package/dist/queue/render.d.ts +2 -0
- package/dist/queue/render.js +52 -0
- package/dist/queue/render.js.map +1 -0
- package/dist/queue/state.d.ts +12 -0
- package/dist/queue/state.js +117 -0
- package/dist/queue/state.js.map +1 -0
- package/dist/runtime/prompts.d.ts +17 -0
- package/dist/runtime/prompts.js +102 -0
- package/dist/runtime/prompts.js.map +1 -0
- package/dist/runtime/run-session.d.ts +11 -0
- package/dist/runtime/run-session.js +292 -0
- package/dist/runtime/run-session.js.map +1 -0
- package/dist/runtime/scheduler.d.ts +4 -0
- package/dist/runtime/scheduler.js +63 -0
- package/dist/runtime/scheduler.js.map +1 -0
- package/dist/runtime/tmux.d.ts +8 -0
- package/dist/runtime/tmux.js +58 -0
- package/dist/runtime/tmux.js.map +1 -0
- package/dist/types/domain.d.ts +206 -0
- package/dist/types/domain.js +2 -0
- package/dist/types/domain.js.map +1 -0
- package/dist/ui/menu.d.ts +1 -0
- package/dist/ui/menu.js +18 -0
- package/dist/ui/menu.js.map +1 -0
- package/dist/ui/output.d.ts +8 -0
- package/dist/ui/output.js +32 -0
- package/dist/ui/output.js.map +1 -0
- package/logo.webp +0 -0
- package/package.json +89 -0
- package/schemas/corydora.schema.json +194 -0
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
All notable changes to Corydora are documented in this file.
|
|
4
|
+
|
|
5
|
+
## [0.1.0] - 2026-03-22
|
|
6
|
+
|
|
7
|
+
### Added
|
|
8
|
+
|
|
9
|
+
- Initial public baseline for the Corydora CLI project
|
|
10
|
+
- Provider-neutral overnight code scrubbing workflow and task queues
|
|
11
|
+
- Built-in agents, runtime adapters, CI, docs, and npm publishing scaffolding
|
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 James Lee Baker
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the 'Software'), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,165 @@
|
|
|
1
|
+
# Corydora
|
|
2
|
+
|
|
3
|
+
[](#project-status)
|
|
4
|
+
[](https://github.com/glorioustephan/corydora/actions/workflows/ci.yml)
|
|
5
|
+
[](https://www.npmjs.com/package/corydora)
|
|
6
|
+
[](https://www.npmjs.com/package/corydora)
|
|
7
|
+
[](./LICENSE)
|
|
8
|
+
[](https://glorioustephan.github.io/corydora/)
|
|
9
|
+
|
|
10
|
+
<p align="center">
|
|
11
|
+
<img src="./logo.webp" alt="Corydora" width="320px" />
|
|
12
|
+
</p>
|
|
13
|
+
|
|
14
|
+
Corydora is a globally installable CLI for overnight AI-assisted codebase cleanup. It detects the
|
|
15
|
+
AI runtimes available in a project, creates a `.corydora.json` config plus a `.corydora/` working
|
|
16
|
+
area, scans files in isolated passes, renders category-specific task queues, and applies small
|
|
17
|
+
safe fixes one task at a time on a dedicated branch or worktree.
|
|
18
|
+
|
|
19
|
+
## Project Status
|
|
20
|
+
|
|
21
|
+
Corydora is currently in **alpha**. The CLI, scheduler, queue/state model, provider adapter layer,
|
|
22
|
+
and release workflows are implemented, but this is still an early open-source package and the
|
|
23
|
+
runtime matrix is not equally mature across providers.
|
|
24
|
+
|
|
25
|
+
### Current readiness
|
|
26
|
+
|
|
27
|
+
- Core CLI commands are implemented and covered by automated tests.
|
|
28
|
+
- CI is configured for `lint`, `format:check`, `typecheck`, `test`, and `build` on every push and
|
|
29
|
+
pull request to `main`.
|
|
30
|
+
- The package supports Node `20.19.0` or newer.
|
|
31
|
+
- CI, publish, and local version-manager hints are standardized on Node `24.14.0`.
|
|
32
|
+
- npm publishing is configured through GitHub Actions using **npm trusted publishing** and GitHub
|
|
33
|
+
OIDC.
|
|
34
|
+
- CI currently runs on `ubuntu-latest` only; a multi-OS matrix is not in place yet.
|
|
35
|
+
- CLI-backed runtimes (`claude-cli`, `codex-cli`, `gemini-cli`) support native agent/tool editing.
|
|
36
|
+
- API-backed runtimes currently use a constrained JSON rewrite mode that is best suited to
|
|
37
|
+
single-file tasks.
|
|
38
|
+
- Background tmux runs on macOS use `caffeinate -i` when available so overnight sessions can keep running with the display asleep.
|
|
39
|
+
- Runtime request size, timeout, and retry budgets are configurable in `.corydora.json`.
|
|
40
|
+
- Provider smoke tests exist but are opt-in because they depend on local vendor auth and binaries.
|
|
41
|
+
- Coverage reporting and coverage thresholds are not wired into CI yet.
|
|
42
|
+
|
|
43
|
+
### Testability today
|
|
44
|
+
|
|
45
|
+
- Unit coverage: config parsing, queue state, scheduler selection, fake runtime.
|
|
46
|
+
- Integration coverage: `init`, `doctor`, `run --dry-run`, and a full fake-provider run.
|
|
47
|
+
- Manual smoke path: build the CLI and run it against a temporary git fixture.
|
|
48
|
+
- Real-provider validation: gated behind `CORYDORA_ENABLE_PROVIDER_SMOKE=1`.
|
|
49
|
+
|
|
50
|
+
## Install
|
|
51
|
+
|
|
52
|
+
```bash
|
|
53
|
+
pnpm add -g corydora
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
## Quickstart
|
|
57
|
+
|
|
58
|
+
```bash
|
|
59
|
+
corydora
|
|
60
|
+
corydora init
|
|
61
|
+
corydora doctor
|
|
62
|
+
corydora run --dry-run
|
|
63
|
+
corydora run --background
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
## Development
|
|
67
|
+
|
|
68
|
+
```bash
|
|
69
|
+
fnm use
|
|
70
|
+
# or: nvm use
|
|
71
|
+
pnpm install
|
|
72
|
+
pnpm lint
|
|
73
|
+
pnpm format:check
|
|
74
|
+
pnpm typecheck
|
|
75
|
+
pnpm test
|
|
76
|
+
pnpm build
|
|
77
|
+
pnpm pack:preview
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
The main verification surface right now is:
|
|
81
|
+
|
|
82
|
+
- `pnpm lint`
|
|
83
|
+
- `pnpm format:check`
|
|
84
|
+
- `pnpm typecheck`
|
|
85
|
+
- `pnpm test`
|
|
86
|
+
- `pnpm build`
|
|
87
|
+
- `pnpm pack:preview`
|
|
88
|
+
|
|
89
|
+
`pnpm check` runs the core verification steps and is also used by `prepublishOnly`. `pnpm
|
|
90
|
+
pack:preview` produces the exact npm tarball shape that CI uploads as a workflow artifact.
|
|
91
|
+
|
|
92
|
+
### Commit workflow
|
|
93
|
+
|
|
94
|
+
- `pnpm commit` launches Commitizen with the conventional changelog prompt.
|
|
95
|
+
- Conventional Commit types drive semantic versioning through release-please:
|
|
96
|
+
`fix` => patch, `feat` => minor, and `!` / `BREAKING CHANGE` => major.
|
|
97
|
+
- Release PRs update `package.json` and `CHANGELOG.md`; you no longer need to push version tags by
|
|
98
|
+
hand.
|
|
99
|
+
- ESLint uses a flat config in `eslint.config.mjs`.
|
|
100
|
+
- Prettier uses `prettier.config.mjs` and `.editorconfig`.
|
|
101
|
+
|
|
102
|
+
## Command Surface
|
|
103
|
+
|
|
104
|
+
- `corydora` launches `init` when `.corydora.json` is missing, otherwise opens a short interactive menu.
|
|
105
|
+
- `corydora init` creates `.corydora.json`, `.corydora/`, markdown queue files, and a local env template.
|
|
106
|
+
- `corydora run` starts a rolling scan/fix loop with resumable state.
|
|
107
|
+
- `corydora status` shows the current or most recent run state.
|
|
108
|
+
- `corydora attach` attaches to a tmux-backed background run.
|
|
109
|
+
- `corydora stop` requests a graceful stop and kills the tmux session when one exists.
|
|
110
|
+
- `corydora doctor` reports runtime availability and auth/config hints.
|
|
111
|
+
- `corydora agents list` shows builtin and imported agents.
|
|
112
|
+
- `corydora agents import <dir>` imports external agent metadata into `.corydora/agents/`.
|
|
113
|
+
- `corydora config validate` validates `.corydora.json`.
|
|
114
|
+
|
|
115
|
+
## Docs
|
|
116
|
+
|
|
117
|
+
Full documentation is available at **[glorioustephan.github.io/corydora](https://glorioustephan.github.io/corydora/)**.
|
|
118
|
+
|
|
119
|
+
- [Getting Started](https://glorioustephan.github.io/corydora/getting-started)
|
|
120
|
+
- [Quickstart](https://glorioustephan.github.io/corydora/quickstart)
|
|
121
|
+
- [CLI Reference](https://glorioustephan.github.io/corydora/cli-reference)
|
|
122
|
+
- [Configuration](https://glorioustephan.github.io/corydora/configuration)
|
|
123
|
+
- [Providers](https://glorioustephan.github.io/corydora/providers/)
|
|
124
|
+
- [Agent Catalog](https://glorioustephan.github.io/corydora/agents/)
|
|
125
|
+
- [Security Model](https://glorioustephan.github.io/corydora/security)
|
|
126
|
+
- [How It Works](https://glorioustephan.github.io/corydora/how-it-works)
|
|
127
|
+
|
|
128
|
+
## CI/CD
|
|
129
|
+
|
|
130
|
+
Corydora ships two GitHub Actions workflows:
|
|
131
|
+
|
|
132
|
+
- `ci.yml`: runs `pnpm install --frozen-lockfile`, `pnpm lint`, `pnpm format:check`, `pnpm
|
|
133
|
+
typecheck`, `pnpm test`, and `pnpm build` on pushes and pull requests to `main`, then uploads an
|
|
134
|
+
npm tarball preview artifact.
|
|
135
|
+
- `publish.yml`: runs release-please on pushes to `main`, opens or updates a release PR from
|
|
136
|
+
Conventional Commits, and publishes to npm only when merging that release PR creates a release.
|
|
137
|
+
|
|
138
|
+
### Trusted publishing requirements
|
|
139
|
+
|
|
140
|
+
Before the first public release, configure npm trusted publishing for this repository:
|
|
141
|
+
|
|
142
|
+
1. Create the GitHub repository that will host Corydora.
|
|
143
|
+
2. Confirm the `repository`, `homepage`, and `bugs` fields in `package.json` match the real repo.
|
|
144
|
+
3. If `corydora` does not exist on npm yet, publish it once manually from your user account so the
|
|
145
|
+
package page and settings exist.
|
|
146
|
+
4. In npm package settings for `corydora`, add a trusted publisher for GitHub Actions with workflow
|
|
147
|
+
filename `publish.yml`.
|
|
148
|
+
5. Optionally add a `RELEASE_PLEASE_TOKEN` GitHub secret if you want bot-created release PRs to
|
|
149
|
+
trigger other workflows normally.
|
|
150
|
+
6. Optionally protect the `npm` GitHub environment before enabling publish.
|
|
151
|
+
7. After trusted publishing is configured, publish future releases by merging the release PR that
|
|
152
|
+
release-please opens against `main`.
|
|
153
|
+
|
|
154
|
+
Trusted publishing also requires GitHub-hosted runners, Node `22.14.0` or newer, and npm CLI
|
|
155
|
+
`11.5.1` or newer. The publish workflow pins Node `24.14.0` and upgrades npm explicitly before it
|
|
156
|
+
calls `npm publish`.
|
|
157
|
+
|
|
158
|
+
## Notes
|
|
159
|
+
|
|
160
|
+
- Secrets never belong in `.corydora.json`.
|
|
161
|
+
- `.corydora/.env.local` is ignored by default.
|
|
162
|
+
- Markdown queue files are projections of machine state in `.corydora/state/`.
|
|
163
|
+
- The root `CHANGELOG.md` is the canonical release history and is maintained by release-please.
|
|
164
|
+
- The npm publish workflow assumes GitHub-hosted runners, which is also what npm trusted publishing
|
|
165
|
+
currently requires.
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
export const BUILTIN_AGENTS = [
|
|
2
|
+
{
|
|
3
|
+
id: 'bug-investigator',
|
|
4
|
+
label: 'Bug Investigator',
|
|
5
|
+
description: 'Find correctness bugs and concrete failure paths in one file at a time.',
|
|
6
|
+
categories: ['bugs'],
|
|
7
|
+
techLenses: ['typescript', 'refactoring'],
|
|
8
|
+
prompt: 'Focus on concrete bugs, edge-case failures, and misleading behavior. Prefer narrow fixes and testable evidence.',
|
|
9
|
+
source: 'builtin',
|
|
10
|
+
},
|
|
11
|
+
{
|
|
12
|
+
id: 'performance-engineer',
|
|
13
|
+
label: 'Performance Engineer',
|
|
14
|
+
description: 'Find unnecessary renders, repeated work, and heavy I/O hot spots.',
|
|
15
|
+
categories: ['performance'],
|
|
16
|
+
techLenses: ['typescript', 'react', 'nextjs', 'electron'],
|
|
17
|
+
prompt: 'Look for measurable performance improvements. Prefer small changes with clear user-facing impact.',
|
|
18
|
+
source: 'builtin',
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
id: 'test-hardener',
|
|
22
|
+
label: 'Test Hardener',
|
|
23
|
+
description: 'Identify missing tests, flaky patterns, and weak validation.',
|
|
24
|
+
categories: ['tests'],
|
|
25
|
+
techLenses: ['typescript', 'react', 'nextjs', 'node-cli'],
|
|
26
|
+
prompt: 'Focus on observable behavior and missing safety nets. Recommend the narrowest test or validation addition.',
|
|
27
|
+
source: 'builtin',
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
id: 'todo-triager',
|
|
31
|
+
label: 'Todo Triager',
|
|
32
|
+
description: 'Turns comments, skipped code paths, and deferred work into concrete tasks.',
|
|
33
|
+
categories: ['todo'],
|
|
34
|
+
techLenses: ['typescript', 'refactoring'],
|
|
35
|
+
prompt: 'Convert vague technical debt into actionable, scoped tasks. Avoid broad rewrites.',
|
|
36
|
+
source: 'builtin',
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
id: 'feature-scout',
|
|
40
|
+
label: 'Feature Scout',
|
|
41
|
+
description: 'Identifies small feature opportunities that fit the existing architecture.',
|
|
42
|
+
categories: ['features'],
|
|
43
|
+
techLenses: ['react', 'nextjs', 'node-cli', 'electron'],
|
|
44
|
+
prompt: 'Propose only incremental product improvements. Features are queued by default and not auto-fixed unless enabled.',
|
|
45
|
+
source: 'builtin',
|
|
46
|
+
},
|
|
47
|
+
{
|
|
48
|
+
id: 'security-auditor',
|
|
49
|
+
label: 'Security Auditor',
|
|
50
|
+
description: 'Looks for frontend and backend security issues with concrete exploit paths.',
|
|
51
|
+
categories: ['bugs'],
|
|
52
|
+
techLenses: ['security', 'typescript', 'react', 'nextjs', 'node-cli'],
|
|
53
|
+
prompt: 'Prioritize trust boundaries, unsafe input handling, auth assumptions, and exploitable patterns.',
|
|
54
|
+
source: 'builtin',
|
|
55
|
+
},
|
|
56
|
+
{
|
|
57
|
+
id: 'database-reviewer',
|
|
58
|
+
label: 'Database Reviewer',
|
|
59
|
+
description: 'Finds risky queries, schema drift issues, and performance bottlenecks around data access.',
|
|
60
|
+
categories: ['bugs', 'performance'],
|
|
61
|
+
techLenses: ['database', 'typescript', 'node-cli'],
|
|
62
|
+
prompt: 'Focus on concrete query risks, indexing concerns, and data-layer correctness.',
|
|
63
|
+
source: 'builtin',
|
|
64
|
+
},
|
|
65
|
+
{
|
|
66
|
+
id: 'refactoring-engineer',
|
|
67
|
+
label: 'Refactoring Engineer',
|
|
68
|
+
description: 'Finds low-risk structural cleanups that make future work easier.',
|
|
69
|
+
categories: ['todo', 'performance', 'tests'],
|
|
70
|
+
techLenses: ['refactoring', 'typescript'],
|
|
71
|
+
prompt: 'Prefer low-risk structure improvements that reduce complexity without changing behavior.',
|
|
72
|
+
source: 'builtin',
|
|
73
|
+
},
|
|
74
|
+
];
|
|
75
|
+
//# sourceMappingURL=builtin-agents.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"builtin-agents.js","sourceRoot":"","sources":["../../src/agents/builtin-agents.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,cAAc,GAAsB;IAC/C;QACE,EAAE,EAAE,kBAAkB;QACtB,KAAK,EAAE,kBAAkB;QACzB,WAAW,EAAE,yEAAyE;QACtF,UAAU,EAAE,CAAC,MAAM,CAAC;QACpB,UAAU,EAAE,CAAC,YAAY,EAAE,aAAa,CAAC;QACzC,MAAM,EACJ,iHAAiH;QACnH,MAAM,EAAE,SAAS;KAClB;IACD;QACE,EAAE,E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BAAmB;QACvB,KAAK,EAAE,mBAAmB;QAC1B,WAAW,EACT,2FAA2F;QAC7F,UAAU,EAAE,CAAC,MAAM,EAAE,aAAa,CAAC;QACnC,UAAU,EAAE,CAAC,UAAU,EAAE,YAAY,EAAE,UAAU,CAAC;QAClD,MAAM,EAAE,+EAA+E;QACvF,MAAM,EAAE,SAAS;KAClB;IACD;QACE,EAAE,EAAE,sBAAsB;QAC1B,KAAK,EAAE,sBAAsB;QAC7B,WAAW,EAAE,kEAAkE;QAC/E,UAAU,EAAE,CAAC,MAAM,EAAE,aAAa,EAAE,OAAO,CAAC;QAC5C,UAAU,EAAE,CAAC,aAAa,EAAE,YAAY,CAAC;QACzC,MAAM,EACJ,0FAA0F;QAC5F,MAAM,EAAE,SAAS;KAClB;CACF,CAAC"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { AgentDefinition, ImportedAgentRecord, CorydoraConfig } from '../types/domain.js';
|
|
2
|
+
export declare function loadImportedAgents(projectRoot: string, config: CorydoraConfig): Promise<ImportedAgentRecord[]>;
|
|
3
|
+
export declare function listAgents(projectRoot: string, config: CorydoraConfig): Promise<AgentDefinition[]>;
|
|
4
|
+
export declare function importAgentsFromDirectory(projectRoot: string, config: CorydoraConfig, sourceDirectory: string): Promise<ImportedAgentRecord[]>;
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { readdir, readFile, writeFile } from 'node:fs/promises';
|
|
2
|
+
import { existsSync } from 'node:fs';
|
|
3
|
+
import { basename, extname, resolve } from 'node:path';
|
|
4
|
+
import { BUILTIN_AGENTS } from './builtin-agents.js';
|
|
5
|
+
import { parseMarkdownFrontmatter } from './frontmatter.js';
|
|
6
|
+
function importedAgentsPath(projectRoot, config) {
|
|
7
|
+
return resolve(projectRoot, config.paths.agentsDir, 'imported-agents.json');
|
|
8
|
+
}
|
|
9
|
+
export async function loadImportedAgents(projectRoot, config) {
|
|
10
|
+
const filePath = importedAgentsPath(projectRoot, config);
|
|
11
|
+
if (!existsSync(filePath)) {
|
|
12
|
+
return [];
|
|
13
|
+
}
|
|
14
|
+
const raw = await readFile(filePath, 'utf8');
|
|
15
|
+
const parsed = JSON.parse(raw);
|
|
16
|
+
return Array.isArray(parsed.agents) ? parsed.agents : [];
|
|
17
|
+
}
|
|
18
|
+
export async function listAgents(projectRoot, config) {
|
|
19
|
+
const imported = await loadImportedAgents(projectRoot, config);
|
|
20
|
+
return [...BUILTIN_AGENTS, ...imported];
|
|
21
|
+
}
|
|
22
|
+
export async function importAgentsFromDirectory(projectRoot, config, sourceDirectory) {
|
|
23
|
+
const entries = await readdir(sourceDirectory, { withFileTypes: true });
|
|
24
|
+
const imported = [];
|
|
25
|
+
for (const entry of entries) {
|
|
26
|
+
if (!entry.isFile() || extname(entry.name) !== '.md') {
|
|
27
|
+
continue;
|
|
28
|
+
}
|
|
29
|
+
const absolutePath = resolve(sourceDirectory, entry.name);
|
|
30
|
+
const raw = await readFile(absolutePath, 'utf8');
|
|
31
|
+
const parsed = parseMarkdownFrontmatter(raw);
|
|
32
|
+
const fallbackId = basename(entry.name, '.md');
|
|
33
|
+
imported.push({
|
|
34
|
+
id: parsed.attributes.name ?? fallbackId,
|
|
35
|
+
label: parsed.attributes.name ?? fallbackId,
|
|
36
|
+
description: parsed.attributes.description ?? 'Imported external agent metadata.',
|
|
37
|
+
categories: ['todo'],
|
|
38
|
+
techLenses: ['refactoring'],
|
|
39
|
+
prompt: parsed.body.trim().slice(0, 4000),
|
|
40
|
+
source: 'imported',
|
|
41
|
+
originalPath: absolutePath,
|
|
42
|
+
importedAt: new Date().toISOString(),
|
|
43
|
+
});
|
|
44
|
+
}
|
|
45
|
+
const filePath = importedAgentsPath(projectRoot, config);
|
|
46
|
+
await writeFile(filePath, `${JSON.stringify({ agents: imported }, null, 2)}\n`, 'utf8');
|
|
47
|
+
return imported;
|
|
48
|
+
}
|
|
49
|
+
//# sourceMappingURL=catalog.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,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,kBAAkB,CAAC,WAAW,EAAE,MAAM,CAAC,CAAC;IACzD,MAAM,SAAS,CAAC,QAAQ,EAAE,GAAG,IAAI,CAAC,SAAS,CAAC,EAAE,MAAM,EAAE,QAAQ,EAAE,EAAE,IAAI,EAAE,CAAC,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;IACxF,OAAO,QAAQ,CAAC;AAClB,CAAC"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
export function parseMarkdownFrontmatter(raw) {
|
|
2
|
+
const match = raw.match(/^---\s*\n([\s\S]*?)\n---\s*\n?([\s\S]*)$/);
|
|
3
|
+
if (!match) {
|
|
4
|
+
return {
|
|
5
|
+
attributes: {},
|
|
6
|
+
body: raw,
|
|
7
|
+
};
|
|
8
|
+
}
|
|
9
|
+
const [, frontmatterBlock = '', body = ''] = match;
|
|
10
|
+
const attributes = frontmatterBlock.split('\n').reduce((acc, line) => {
|
|
11
|
+
const separatorIndex = line.indexOf(':');
|
|
12
|
+
if (separatorIndex === -1) {
|
|
13
|
+
return acc;
|
|
14
|
+
}
|
|
15
|
+
const key = line.slice(0, separatorIndex).trim();
|
|
16
|
+
const value = line
|
|
17
|
+
.slice(separatorIndex + 1)
|
|
18
|
+
.trim()
|
|
19
|
+
.replace(/^["']|["']$/g, '');
|
|
20
|
+
if (key.length > 0 && value.length > 0) {
|
|
21
|
+
acc[key] = value;
|
|
22
|
+
}
|
|
23
|
+
return acc;
|
|
24
|
+
}, {});
|
|
25
|
+
return {
|
|
26
|
+
attributes,
|
|
27
|
+
body,
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
//# sourceMappingURL=frontmatter.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"frontmatter.js","sourceRoot":"","sources":["../../src/agents/frontmatter.ts"],"names":[],"mappings":"AAKA,MAAM,UAAU,wBAAwB,CAAC,GAAW;IAClD,MAAM,KAAK,GAAG,GAAG,CAAC,KAAK,CAAC,0CAA0C,CAAC,CAAC;IACpE,IAAI,CAAC,KAAK,EAAE,CAAC;QACX,OAAO;YACL,UAAU,EAAE,EAAE;YACd,IAAI,EAAE,GAAG;SACV,CAAC;IACJ,CAAC;IAED,MAAM,CAAC,EAAE,gBAAgB,GAAG,EAAE,EAAE,IAAI,GAAG,EAAE,CAAC,GAAG,KAAK,CAAC;IACnD,MAAM,UAAU,GAAG,gBAAgB,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,MAAM,CAAyB,CAAC,GAAG,EAAE,IAAI,EAAE,EAAE;QAC3F,MAAM,cAAc,GAAG,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;QACzC,IAAI,cAAc,KAAK,CAAC,CAAC,EAAE,CAAC;YAC1B,OAAO,GAAG,CAAC;QACb,CAAC;QAED,MAAM,GAAG,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,EAAE,cAAc,CAAC,CAAC,IAAI,EAAE,CAAC;QACjD,MAAM,KAAK,GAAG,IAAI;aACf,KAAK,CAAC,cAAc,GAAG,CAAC,CAAC;aACzB,IAAI,EAAE;aACN,OAAO,CAAC,cAAc,EAAE,EAAE,CAAC,CAAC;QAC/B,IAAI,GAAG,CAAC,MAAM,GAAG,CAAC,IAAI,KAAK,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;YACvC,GAAG,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC;QACnB,CAAC;QAED,OAAO,GAAG,CAAC;IACb,CAAC,EAAE,EAAE,CAAC,CAAC;IAEP,OAAO;QACL,UAAU;QACV,IAAI;KACL,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { importAgentsFromDirectory } from '../agents/catalog.js';
|
|
2
|
+
import { loadRequiredConfig } from './helpers.js';
|
|
3
|
+
export async function runAgentsImportCommand(projectRoot, sourceDirectory, json, ui) {
|
|
4
|
+
const config = await loadRequiredConfig(projectRoot);
|
|
5
|
+
const imported = await importAgentsFromDirectory(projectRoot, config, sourceDirectory);
|
|
6
|
+
if (json) {
|
|
7
|
+
ui.printJson(imported);
|
|
8
|
+
return;
|
|
9
|
+
}
|
|
10
|
+
ui.success(`Imported ${imported.length} agent(s) from ${sourceDirectory}.`);
|
|
11
|
+
}
|
|
12
|
+
//# sourceMappingURL=agents-import.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"agents-import.js","sourceRoot":"","sources":["../../src/commands/agents-import.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,yBAAyB,EAAE,MAAM,sBAAsB,CAAC;AACjE,OAAO,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAC;AAGlD,MAAM,CAAC,KAAK,UAAU,sBAAsB,CAC1C,WAAmB,EACnB,eAAuB,EACvB,IAAa,EACb,EAAM;IAEN,MAAM,MAAM,GAAG,MAAM,kBAAkB,CAAC,WAAW,CAAC,CAAC;IACrD,MAAM,QAAQ,GAAG,MAAM,yBAAyB,CAAC,WAAW,EAAE,MAAM,EAAE,eAAe,CAAC,CAAC;IAEvF,IAAI,IAAI,EAAE,CAAC;QACT,EAAE,CAAC,SAAS,CAAC,QAAQ,CAAC,CAAC;QACvB,OAAO;IACT,CAAC;IAED,EAAE,CAAC,OAAO,CAAC,YAAY,QAAQ,CAAC,MAAM,kBAAkB,eAAe,GAAG,CAAC,CAAC;AAC9E,CAAC"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { BUILTIN_AGENTS } from '../agents/builtin-agents.js';
|
|
2
|
+
import { listAgents } from '../agents/catalog.js';
|
|
3
|
+
import { loadRequiredConfig } from './helpers.js';
|
|
4
|
+
export async function runAgentsListCommand(projectRoot, json, ui) {
|
|
5
|
+
try {
|
|
6
|
+
const config = await loadRequiredConfig(projectRoot);
|
|
7
|
+
const agents = await listAgents(projectRoot, config);
|
|
8
|
+
if (json) {
|
|
9
|
+
ui.printJson(agents);
|
|
10
|
+
return;
|
|
11
|
+
}
|
|
12
|
+
for (const agent of agents) {
|
|
13
|
+
ui.info(`${agent.id} [${agent.source}] -> ${agent.description}`);
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
catch {
|
|
17
|
+
if (json) {
|
|
18
|
+
ui.printJson(BUILTIN_AGENTS);
|
|
19
|
+
return;
|
|
20
|
+
}
|
|
21
|
+
for (const agent of BUILTIN_AGENTS) {
|
|
22
|
+
ui.info(`${agent.id} [builtin] -> ${agent.description}`);
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
//# sourceMappingURL=agents-list.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"agents-list.js","sourceRoot":"","sources":["../../src/commands/agents-list.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAC;AAC7D,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAClD,OAAO,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAC;AAGlD,MAAM,CAAC,KAAK,UAAU,oBAAoB,CACxC,WAAmB,EACnB,IAAa,EACb,EAAM;IAEN,IAAI,CAAC;QACH,MAAM,MAAM,GAAG,MAAM,kBAAkB,CAAC,WAAW,CAAC,CAAC;QACrD,MAAM,MAAM,GAAG,MAAM,UAAU,CAAC,WAAW,EAAE,MAAM,CAAC,CAAC;QACrD,IAAI,IAAI,EAAE,CAAC;YACT,EAAE,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC;YACrB,OAAO;QACT,CAAC;QAED,KAAK,MAAM,KAAK,IAAI,MAAM,EAAE,CAAC;YAC3B,EAAE,CAAC,IAAI,CAAC,GAAG,KAAK,CAAC,EAAE,KAAK,KAAK,CAAC,MAAM,QAAQ,KAAK,CAAC,WAAW,EAAE,CAAC,CAAC;QACnE,CAAC;IACH,CAAC;IAAC,MAAM,CAAC;QACP,IAAI,IAAI,EAAE,CAAC;YACT,EAAE,CAAC,SAAS,CAAC,cAAc,CAAC,CAAC;YAC7B,OAAO;QACT,CAAC;QAED,KAAK,MAAM,KAAK,IAAI,cAAc,EAAE,CAAC;YACnC,EAAE,CAAC,IAAI,CAAC,GAAG,KAAK,CAAC,EAAE,iBAAiB,KAAK,CAAC,WAAW,EAAE,CAAC,CAAC;QAC3D,CAAC;IACH,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function runAttachCommand(projectRoot: string): Promise<void>;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { loadRunState } from '../queue/state.js';
|
|
2
|
+
import { loadRequiredConfig } from './helpers.js';
|
|
3
|
+
import { attachToSession, tmuxSessionExists } from '../runtime/tmux.js';
|
|
4
|
+
export async function runAttachCommand(projectRoot) {
|
|
5
|
+
const config = await loadRequiredConfig(projectRoot);
|
|
6
|
+
const runState = await loadRunState(projectRoot, config);
|
|
7
|
+
const sessionName = runState?.background?.sessionName;
|
|
8
|
+
if (!sessionName) {
|
|
9
|
+
throw new Error('No tmux-backed Corydora session is recorded for this project.');
|
|
10
|
+
}
|
|
11
|
+
if (!tmuxSessionExists(sessionName)) {
|
|
12
|
+
throw new Error(`tmux session "${sessionName}" is not running.`);
|
|
13
|
+
}
|
|
14
|
+
attachToSession(sessionName);
|
|
15
|
+
}
|
|
16
|
+
//# sourceMappingURL=attach.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"attach.js","sourceRoot":"","sources":["../../src/commands/attach.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACjD,OAAO,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAC;AAClD,OAAO,EAAE,eAAe,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AAExE,MAAM,CAAC,KAAK,UAAU,gBAAgB,CAAC,WAAmB;IACxD,MAAM,MAAM,GAAG,MAAM,kBAAkB,CAAC,WAAW,CAAC,CAAC;IACrD,MAAM,QAAQ,GAAG,MAAM,YAAY,CAAC,WAAW,EAAE,MAAM,CAAC,CAAC;IACzD,MAAM,WAAW,GAAG,QAAQ,EAAE,UAAU,EAAE,WAAW,CAAC;IACtD,IAAI,CAAC,WAAW,EAAE,CAAC;QACjB,MAAM,IAAI,KAAK,CAAC,+DAA+D,CAAC,CAAC;IACnF,CAAC;IAED,IAAI,CAAC,iBAAiB,CAAC,WAAW,CAAC,EAAE,CAAC;QACpC,MAAM,IAAI,KAAK,CAAC,iBAAiB,WAAW,mBAAmB,CAAC,CAAC;IACnE,CAAC;IAED,eAAe,CAAC,WAAW,CAAC,CAAC;AAC/B,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { loadRequiredConfig } from './helpers.js';
|
|
2
|
+
export async function runConfigValidateCommand(projectRoot, json, ui) {
|
|
3
|
+
const config = await loadRequiredConfig(projectRoot);
|
|
4
|
+
if (json) {
|
|
5
|
+
ui.printJson({ ok: true, config });
|
|
6
|
+
return;
|
|
7
|
+
}
|
|
8
|
+
ui.success('Configuration is valid.');
|
|
9
|
+
}
|
|
10
|
+
//# sourceMappingURL=config-validate.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"config-validate.js","sourceRoot":"","sources":["../../src/commands/config-validate.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAC;AAGlD,MAAM,CAAC,KAAK,UAAU,wBAAwB,CAC5C,WAAmB,EACnB,IAAa,EACb,EAAM;IAEN,MAAM,MAAM,GAAG,MAAM,kBAAkB,CAAC,WAAW,CAAC,CAAC;IACrD,IAAI,IAAI,EAAE,CAAC;QACT,EAAE,CAAC,SAAS,CAAC,EAAE,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC,CAAC;QACnC,OAAO;IACT,CAAC;IAED,EAAE,CAAC,OAAO,CAAC,yBAAyB,CAAC,CAAC;AACxC,CAAC"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { detectProjectFingerprint } from '../filesystem/project.js';
|
|
2
|
+
import { probeAvailableRuntimes, getRuntimeAdapters } from '../providers/index.js';
|
|
3
|
+
import { supportsBackgroundKeepAwake, supportsTmux } from '../runtime/tmux.js';
|
|
4
|
+
export async function runDoctorCommand(projectRoot, json, ui) {
|
|
5
|
+
const [fingerprint, probes] = await Promise.all([
|
|
6
|
+
Promise.resolve(detectProjectFingerprint(projectRoot)),
|
|
7
|
+
probeAvailableRuntimes(projectRoot),
|
|
8
|
+
]);
|
|
9
|
+
const runtimeChecks = await Promise.all(getRuntimeAdapters().map(async (adapter) => ({
|
|
10
|
+
provider: adapter.id,
|
|
11
|
+
checks: await adapter.doctor(projectRoot),
|
|
12
|
+
})));
|
|
13
|
+
const payload = {
|
|
14
|
+
fingerprint,
|
|
15
|
+
tmuxAvailable: supportsTmux(),
|
|
16
|
+
backgroundKeepAwakeAvailable: supportsBackgroundKeepAwake(),
|
|
17
|
+
runtimes: probes,
|
|
18
|
+
checks: runtimeChecks,
|
|
19
|
+
};
|
|
20
|
+
if (json) {
|
|
21
|
+
ui.printJson(payload);
|
|
22
|
+
return;
|
|
23
|
+
}
|
|
24
|
+
ui.info(`Package manager: ${fingerprint.packageManager}`);
|
|
25
|
+
ui.info(`Frameworks: ${fingerprint.frameworks.join(', ') || 'none detected'}`);
|
|
26
|
+
ui.info(`tmux available: ${supportsTmux() ? 'yes' : 'no'}`);
|
|
27
|
+
ui.info(`background keep-awake available: ${supportsBackgroundKeepAwake() ? 'yes' : 'no'}`);
|
|
28
|
+
for (const probe of probes) {
|
|
29
|
+
ui.info(`${probe.provider}: installed=${probe.installed} auth=${probe.auth.status} (${probe.auth.message})`);
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
//# sourceMappingURL=doctor.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"doctor.js","sourceRoot":"","sources":["../../src/commands/doctor.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,wBAAwB,EAAE,MAAM,0BAA0B,CAAC;AACpE,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EAAE,CAAC,IAAI,CAAC,oCAAoC,2BAA2B,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC;IAE5F,KAAK,MAAM,KAAK,IAAI,MAAM,EAAE,CAAC;QAC3B,EAAE,CAAC,IAAI,CACL,GAAG,KAAK,CAAC,QAAQ,eAAe,KAAK,CAAC,SAAS,SAAS,KAAK,CAAC,IAAI,CAAC,MAAM,KAAK,KAAK,CAAC,IAAI,CAAC,OAAO,GAAG,CACpG,CAAC;IACJ,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { CorydoraConfig } from '../types/domain.js';
|
|
2
|
+
export declare function resolveProjectRoot(startDir: string): string;
|
|
3
|
+
export declare function configExists(projectRoot: string): boolean;
|
|
4
|
+
export declare function loadRequiredConfig(projectRoot: string, configPath?: string): Promise<CorydoraConfig>;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { existsSync } from 'node:fs';
|
|
2
|
+
import { resolve } from 'node:path';
|
|
3
|
+
import { CONFIG_FILE_NAME } from '../constants.js';
|
|
4
|
+
import { loadConfig } from '../config/files.js';
|
|
5
|
+
import { loadProjectEnv } from '../config/env.js';
|
|
6
|
+
import { findGitRoot } from '../filesystem/project.js';
|
|
7
|
+
export function resolveProjectRoot(startDir) {
|
|
8
|
+
return findGitRoot(startDir);
|
|
9
|
+
}
|
|
10
|
+
export function configExists(projectRoot) {
|
|
11
|
+
return existsSync(resolve(projectRoot, CONFIG_FILE_NAME));
|
|
12
|
+
}
|
|
13
|
+
export async function loadRequiredConfig(projectRoot, configPath) {
|
|
14
|
+
if (!configExists(projectRoot) && !configPath) {
|
|
15
|
+
throw new Error(`No ${CONFIG_FILE_NAME} file found in ${projectRoot}. Run "corydora init" first.`);
|
|
16
|
+
}
|
|
17
|
+
const config = await loadConfig(projectRoot, configPath);
|
|
18
|
+
await loadProjectEnv(projectRoot, config);
|
|
19
|
+
return config;
|
|
20
|
+
}
|
|
21
|
+
//# sourceMappingURL=helpers.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"helpers.js","sourceRoot":"","sources":["../../src/commands/helpers.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AACrC,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AACnD,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAChD,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAGvD,MAAM,UAAU,kBAAkB,CAAC,QAAgB;IACjD,OAAO,WAAW,CAAC,QAAQ,CAAC,CAAC;AAC/B,CAAC;AAED,MAAM,UAAU,YAAY,CAAC,WAAmB;IAC9C,OAAO,UAAU,CAAC,OAAO,CAAC,WAAW,EAAE,gBAAgB,CAAC,CAAC,CAAC;AAC5D,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,kBAAkB,CACtC,WAAmB,EACnB,UAAmB;IAEnB,IAAI,CAAC,YAAY,CAAC,WAAW,CAAC,IAAI,CAAC,UAAU,EAAE,CAAC;QAC9C,MAAM,IAAI,KAAK,CACb,MAAM,gBAAgB,kBAAkB,WAAW,8BAA8B,CAClF,CAAC;IACJ,CAAC;IAED,MAAM,MAAM,GAAG,MAAM,UAAU,CAAC,WAAW,EAAE,UAAU,CAAC,CAAC;IACzD,MAAM,cAAc,CAAC,WAAW,EAAE,MAAM,CAAC,CAAC;IAC1C,OAAO,MAAM,CAAC;AAChB,CAAC"}
|