kodu 1.1.13 → 1.1.15
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/AGENTS.md +184 -199
- package/README.md +32 -3
- package/dist/src/app.module.js +2 -0
- package/dist/src/app.module.js.map +1 -1
- package/dist/src/commands/init/init.command.js +16 -0
- package/dist/src/commands/init/init.command.js.map +1 -1
- package/dist/src/commands/ops/ops.command.d.ts +4 -0
- package/dist/src/commands/ops/ops.command.js +39 -0
- package/dist/src/commands/ops/ops.command.js.map +1 -0
- package/dist/src/commands/ops/ops.module.d.ts +2 -0
- package/dist/src/commands/ops/ops.module.js +33 -0
- package/dist/src/commands/ops/ops.module.js.map +1 -0
- package/dist/src/commands/ops/ops.types.d.ts +13 -0
- package/dist/src/commands/ops/ops.types.js +12 -0
- package/dist/src/commands/ops/ops.types.js.map +1 -0
- package/dist/src/commands/ops/ops.utils.d.ts +13 -0
- package/dist/src/commands/ops/ops.utils.js +117 -0
- package/dist/src/commands/ops/ops.utils.js.map +1 -0
- package/dist/src/commands/ops/subcommands/ops-env.command.d.ts +17 -0
- package/dist/src/commands/ops/subcommands/ops-env.command.js +109 -0
- package/dist/src/commands/ops/subcommands/ops-env.command.js.map +1 -0
- package/dist/src/commands/ops/subcommands/ops-routes.command.d.ts +18 -0
- package/dist/src/commands/ops/subcommands/ops-routes.command.js +166 -0
- package/dist/src/commands/ops/subcommands/ops-routes.command.js.map +1 -0
- package/dist/src/commands/ops/subcommands/ops-service.command.d.ts +16 -0
- package/dist/src/commands/ops/subcommands/ops-service.command.js +128 -0
- package/dist/src/commands/ops/subcommands/ops-service.command.js.map +1 -0
- package/dist/src/commands/ops/subcommands/ops-sysinfo.command.d.ts +9 -0
- package/dist/src/commands/ops/subcommands/ops-sysinfo.command.js +60 -0
- package/dist/src/commands/ops/subcommands/ops-sysinfo.command.js.map +1 -0
- package/dist/src/commands/pack/pack.command.js +1 -2
- package/dist/src/commands/pack/pack.command.js.map +1 -1
- package/dist/src/core/config/config.schema.d.ts +28 -0
- package/dist/src/core/config/config.schema.js +19 -0
- package/dist/src/core/config/config.schema.js.map +1 -1
- package/dist/src/core/file-system/fs.service.d.ts +4 -1
- package/dist/src/core/file-system/fs.service.js +57 -21
- package/dist/src/core/file-system/fs.service.js.map +1 -1
- package/dist/src/shared/constants.d.ts +1 -0
- package/dist/src/shared/constants.js +2 -1
- package/dist/src/shared/constants.js.map +1 -1
- package/dist/src/shared/ssh/ssh.module.d.ts +2 -0
- package/dist/src/shared/ssh/ssh.module.js +21 -0
- package/dist/src/shared/ssh/ssh.module.js.map +1 -0
- package/dist/src/shared/ssh/ssh.service.d.ts +11 -0
- package/dist/src/shared/ssh/ssh.service.js +53 -0
- package/dist/src/shared/ssh/ssh.service.js.map +1 -0
- package/dist/src/shared/tokenizer/tokenizer.service.js +1 -1
- package/dist/src/shared/tokenizer/tokenizer.service.js.map +1 -1
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/docs/plans/2026-03-01-agentops-design.md +194 -0
- package/docs/plans/2026-03-01-agentops-implementation.md +358 -0
- package/kodu.json +15 -0
- package/kodu.schema.json +59 -0
- package/package.json +1 -1
- package/src/app.module.ts +2 -0
- package/src/commands/init/init.command.ts +16 -0
- package/src/commands/ops/ops.command.ts +30 -0
- package/src/commands/ops/ops.module.ts +20 -0
- package/src/commands/ops/ops.types.ts +24 -0
- package/src/commands/ops/ops.utils.ts +156 -0
- package/src/commands/ops/subcommands/ops-env.command.ts +121 -0
- package/src/commands/ops/subcommands/ops-routes.command.ts +185 -0
- package/src/commands/ops/subcommands/ops-service.command.ts +154 -0
- package/src/commands/ops/subcommands/ops-sysinfo.command.ts +53 -0
- package/src/commands/pack/pack.command.ts +1 -2
- package/src/core/config/config.schema.ts +23 -0
- package/src/core/file-system/fs.service.ts +72 -23
- package/src/shared/constants.ts +1 -0
- package/src/shared/ssh/ssh.module.ts +8 -0
- package/src/shared/ssh/ssh.service.ts +61 -0
- package/src/shared/tokenizer/tokenizer.service.ts +2 -2
- package/.cursor/commands/openspec-apply.md +0 -23
- package/.cursor/commands/openspec-archive.md +0 -27
- package/.cursor/commands/openspec-proposal.md +0 -28
- package/.windsurf/workflows/openspec-apply.md +0 -21
- package/.windsurf/workflows/openspec-archive.md +0 -25
- package/.windsurf/workflows/openspec-proposal.md +0 -26
- package/openspec/AGENTS.md +0 -456
- package/openspec/changes/archive/2026-01-26-translate-project-to-english/design.md +0 -30
- package/openspec/changes/archive/2026-01-26-translate-project-to-english/proposal.md +0 -17
- package/openspec/changes/archive/2026-01-26-translate-project-to-english/specs/ai/spec.md +0 -26
- package/openspec/changes/archive/2026-01-26-translate-project-to-english/specs/cleaner/spec.md +0 -26
- package/openspec/changes/archive/2026-01-26-translate-project-to-english/specs/config/spec.md +0 -22
- package/openspec/changes/archive/2026-01-26-translate-project-to-english/specs/ui/spec.md +0 -33
- package/openspec/changes/archive/2026-01-26-translate-project-to-english/tasks.md +0 -33
- package/openspec/project.md +0 -72
- package/openspec/specs/cleaner/spec.md +0 -31
package/openspec/project.md
DELETED
|
@@ -1,72 +0,0 @@
|
|
|
1
|
-
# Project Context
|
|
2
|
-
|
|
3
|
-
## Purpose
|
|
4
|
-
**Kodu** is a high-performance CLI utility designed to bridge the gap between local development environments and Large Language Models (LLMs). It automates the "last mile" of AI-assisted programming: preparing optimized context, stripping noise (comments) from code, performing instant code reviews, and drafting commit messages.
|
|
5
|
-
|
|
6
|
-
The project prioritizes **Speed** (startup <0.5s), **Determinism** (no AI for critical file modifications), and **Developer Experience** (modern UI, seamless Git integration).
|
|
7
|
-
|
|
8
|
-
## Tech Stack
|
|
9
|
-
The project enforces a "Fresh & Modern" stack strategy. Legacy libraries are strictly prohibited.
|
|
10
|
-
|
|
11
|
-
- **Runtime & Language:** Node.js (ESM `nodenext`), TypeScript (Strict Mode).
|
|
12
|
-
- **Framework:** NestJS + `nest-commander` (CLI architecture).
|
|
13
|
-
- **AI Orchestration:** `@mastra/core` (Model routing and agent management).
|
|
14
|
-
- **Code Analysis (AST):** `ts-morph` (Safe, deterministic code manipulation).
|
|
15
|
-
- **Tokenization:** `js-tiktoken` (Accurate token counting).
|
|
16
|
-
- **Validation & Config:** `zod` (Schema validation), `lilconfig` (Config loading).
|
|
17
|
-
- **System & Git:** `execa` (Process execution), `tinyglobby` (Fast globbing), `node:fs/promises`.
|
|
18
|
-
- **UI/UX:** `@inquirer/*` (Prompts), `yocto-spinner` (Spinners), `picocolors` (Formatting).
|
|
19
|
-
- **Quality Control:** Biome (Linting/Formatting), Knip (Dead code detection).
|
|
20
|
-
|
|
21
|
-
## Project Conventions
|
|
22
|
-
|
|
23
|
-
### Code Style
|
|
24
|
-
- **Linter/Formatter:** We use **Biome** exclusively. Run `npm run lint:fix` to apply standards.
|
|
25
|
-
- **Quotes:** Single quotes preferred.
|
|
26
|
-
- **Indentation:** 2 spaces.
|
|
27
|
-
- **Strictness:** `strictNullChecks` is ON. Avoid `any`; use `unknown` with narrowing/validation (Zod) where possible.
|
|
28
|
-
- **Imports:** Explicit imports preferred. No circular dependencies (enforced by NestJS module structure).
|
|
29
|
-
|
|
30
|
-
### Architecture Patterns
|
|
31
|
-
- **Modular Monolith:** The app is structured into semantic modules:
|
|
32
|
-
- `core/`: Global infrastructure (Config, UI, FS).
|
|
33
|
-
- `shared/`: Reusable business logic (Git, AI, Tokenizer, Cleaner).
|
|
34
|
-
- `commands/`: Feature modules implementing specific CLI commands.
|
|
35
|
-
- **Dependency Injection:** All services must be injected via NestJS DI containers.
|
|
36
|
-
- **Config-First:** Configuration is loaded once in `ConfigModule`, validated via Zod, and injected where needed.
|
|
37
|
-
- **Deterministic Cleaning:** The `clean` command relies purely on AST parsing (`ts-morph`), never on AI generation, to guarantee code safety.
|
|
38
|
-
|
|
39
|
-
### Testing Strategy
|
|
40
|
-
- **Static Analysis as Primary Gate:** We rely heavily on strict static analysis.
|
|
41
|
-
- **Mandatory Check:** Before any commit or PR, you MUST run:
|
|
42
|
-
```bash
|
|
43
|
-
npm run check
|
|
44
|
-
```
|
|
45
|
-
This command executes:
|
|
46
|
-
1. `ts:check` (TypeScript compilation check)
|
|
47
|
-
2. `lint:fix` (Biome formatting and linting)
|
|
48
|
-
3. `knip` (Detection of unused files, exports, and dependencies)
|
|
49
|
-
|
|
50
|
-
### Git Workflow
|
|
51
|
-
- **Commit Messages:** Must follow **Conventional Commits** specification (e.g., `feat:`, `fix:`, `chore:`, `refactor:`).
|
|
52
|
-
- **Branching:** Feature branches off `main`.
|
|
53
|
-
- **Pre-requisites:** The CLI relies on the presence of a git repository for `review` and `commit` commands.
|
|
54
|
-
|
|
55
|
-
## Domain Context
|
|
56
|
-
- **Context Packing:** The core value is converting a file tree into a single, token-optimized string prompt.
|
|
57
|
-
- **Token Budgeting:** Users must always be aware of the "cost" of their context. We display token counts and USD estimates (based on GPT-4o/5 pricing) before API calls.
|
|
58
|
-
- **Privacy:** By default, sensitive files (`.env`, lockfiles) are ignored. Kodu respects both `.gitignore` and its own `kodu.json` ignore lists.
|
|
59
|
-
- **Review Modes:** Code reviews are categorized by intent: `bug` (logic errors), `style` (readability), `security` (vulnerabilities).
|
|
60
|
-
- **Cleaner Logic:** We distinguish between "System comments" (`@ts-ignore`, `TODO`) which are often kept, and "Noise comments" which are removed to save tokens.
|
|
61
|
-
|
|
62
|
-
## Important Constraints
|
|
63
|
-
1. **No Legacy Deps:** Do not install `chalk`, `ora`, `glob`, `inquirer` (legacy), or `fs-extra`. Use the modern alternatives listed in Tech Stack.
|
|
64
|
-
2. **Secrets Management:** API keys are **never** stored in `kodu.json`. They are read strictly from environment variables (default `OPENAI_API_KEY`).
|
|
65
|
-
3. **Performance:** Import costs matter. Use lightweight libraries. The CLI must feel instant.
|
|
66
|
-
4. **Safety:** The `clean` command must handle files safely. It supports dry-runs (`--dry-run`) to preview destruction.
|
|
67
|
-
5. **Validation:** If `kodu.json` is invalid, the app must crash gracefully with a clear error message pointing to the specific Zod validation failure.
|
|
68
|
-
|
|
69
|
-
## External Dependencies
|
|
70
|
-
- **LLM Providers:** Requires access to OpenAI, Anthropic, or Google APIs (via Mastra).
|
|
71
|
-
- **Git CLI:** The user must have `git` installed and initialized in their project.
|
|
72
|
-
- **Clipboard:** Relies on system clipboard access (via `clipboardy`) for `--copy` commands.
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
# cleaner Specification
|
|
2
|
-
|
|
3
|
-
## Purpose
|
|
4
|
-
TBD - created by archiving change add-comprehensive-comment-support. Update Purpose after archive.
|
|
5
|
-
## Requirements
|
|
6
|
-
### Requirement: Recognition of all comment forms
|
|
7
|
-
The `clean` command SHALL detect and remove any form of comments in files (`//`, `/* ... */`, HTML `<!-- ... -->` etc.), except for constructs that fall under `keepJSDoc` or user/system whitelist. HTML `<!-- ... -->` should only be removed in `.html`/`.htm` files, so that strings with similar regular expressions or literals in TypeScript/JavaScript remain untouched. Removal SHALL occur without distorting surrounding code and be reflected in `--dry-run` previews.
|
|
8
|
-
|
|
9
|
-
#### Scenario: Removal of multiline blocks `/* ... */`
|
|
10
|
-
- **WHEN** `kodu clean` is run on a TS/JS file containing a `/* ... */` block that is not marked as JSDoc or is not in the whitelist
|
|
11
|
-
- **THEN** the block is removed, surrounding code remains syntactically correct, and `--dry-run` shows this range without applying changes
|
|
12
|
-
|
|
13
|
-
#### Scenario: Removal of HTML comments inside templates
|
|
14
|
-
- **WHEN** `kodu clean` is run on a template file (`.html` or `.htm`) with comments of the form `<!-- ... -->`
|
|
15
|
-
- **THEN** HTML comments are removed, template structure is preserved, and output/generation does not contain extra blank lines
|
|
16
|
-
|
|
17
|
-
#### Scenario: HTML comment in TypeScript literal remains untouched
|
|
18
|
-
- **WHEN** `kodu clean` is run on a TS/JS file where a template like `` `<!--[\s\S]*?-->` `` is encountered inside a string or regular expression
|
|
19
|
-
- **THEN** the text remains unchanged because HTML parsing is limited to `.html`/`.htm` files only
|
|
20
|
-
|
|
21
|
-
### Requirement: Cleaning only changed files
|
|
22
|
-
The `clean` command SHALL accept the `--changed` flag (short form `-c`), which switches the operation to process only those files in which Git has recorded changes. Extension rules continue to apply and output is lost if no files fall under the filter. Switching to `--dry-run` remains possible, it only changes the message without actual writing.
|
|
23
|
-
|
|
24
|
-
#### Scenario: Cleaning changes in `--changed` mode
|
|
25
|
-
- **WHEN** `kodu clean --changed` is run in a repository with changed TypeScript/HTML files
|
|
26
|
-
- **THEN** the command removes comments only from changed files, others are skipped, and the count of affected files/comments reflects only this selection
|
|
27
|
-
|
|
28
|
-
#### Scenario: `--changed` mode without actual files
|
|
29
|
-
- **WHEN** `kodu clean --changed` is run but Git does not produce a single changed file with a suitable extension
|
|
30
|
-
- **THEN** the command changes nothing and outputs the warning `No changed files to clean.`, and the spinner stops without executing `cleaner.cleanFiles`
|
|
31
|
-
|