refactor(dirs): restructured environment variable access and simplified configuration in test suite

- Refactored environment variable access to use dedicated getter/setter functions in test suite.
- Simplified configuration constants by removing ompConfig dependency and using hardcoded values.
- Introduced module-level caching for agent directory and subdirectory paths to improve performance.
- Added setAgentDir() function to manage agent directory updates and cache invalidation.
- Reorganized dirs.ts with logical section headers and consolidated subdirectory functions using helper utilities.
- Updated directory accessor functions to accept optional agentDir parameter for flexibility.
This commit is contained in:
can1357
2026-02-13 15:26:06 +01:00
parent fb72f5d6a6
commit 08e9c685f3
4 changed files with 197 additions and 228 deletions
+2 -28
View File
@@ -448,6 +448,7 @@ The `--system-prompt` CLI flag overrides both files. Use `--append-system-prompt
### Custom Models and Providers
Add custom models (Ollama, vLLM, LM Studio, etc.) via `~/.omp/agent/models.yml` (`models.json` is still supported for legacy configs):
> See [models.yml provider integration guide](docs/models.md) for full schema, merge behavior, and provider integration patterns.
```json
@@ -751,7 +752,7 @@ export default function (omp: HookAPI) {
content,
display: true,
},
true
true,
); // triggerTurn: start agent loop
}
});
@@ -1036,33 +1037,6 @@ Omp is a fork of [Pi](https://github.com/badlogic/pi) by [Mario Zechner](https:/
## Development
### Forking / Rebranding
Configure via `package.json`:
```json
{
"ompConfig": {
"name": "omp",
"configDir": ".omp"
}
}
```
Change `name`, `configDir`, and `bin` field for your fork. Affects CLI banner, config paths, and environment variable names.
### Path Resolution
Three execution modes: npm install, standalone binary, tsx from source.
**Always use `src/config.ts`** for package assets:
```typescript
import { getPackageDir } from "./config.js";
```
Never use `__dirname` directly for package assets.
### Debug Command
`/debug` (hidden) writes rendered lines with ANSI codes to `~/.omp/agent/omp-debug.log` for TUI debugging, as well as the last set of messages that were sent to the LLM.
-4
View File
@@ -3,10 +3,6 @@
"version": "12.0.0",
"description": "Coding agent CLI with read, bash, edit, write tools and session management",
"type": "module",
"ompConfig": {
"name": "omp",
"configDir": ".omp"
},
"bin": {
"omp": "src/cli.ts"
},