mirror of
https://github.com/getcompanion-ai/co-mono.git
synced 2026-04-15 06:04:40 +00:00
feat(coding-agent): ResourceLoader, package management, and /reload command (#645)
- Add ResourceLoader interface and DefaultResourceLoader implementation - Add PackageManager for npm/git extension sources with install/remove/update - Add session.reload() and session.bindExtensions() APIs - Add /reload command in interactive mode - Add CLI flags: --skill, --theme, --prompt-template, --no-themes, --no-prompt-templates - Add pi install/remove/update commands for extension management - Refactor settings.json to use arrays for skills, prompts, themes - Remove legacy SkillsSettings source flags and filters - Update SDK examples and documentation for ResourceLoader pattern - Add theme registration and loadThemeFromPath for dynamic themes - Add getShellEnv to include bin dir in PATH for bash commands
This commit is contained in:
parent
866d21c252
commit
b846a4bfcf
51 changed files with 2724 additions and 1852 deletions
|
|
@ -115,10 +115,22 @@ Additional paths via `settings.json`:
|
|||
|
||||
```json
|
||||
{
|
||||
"extensions": ["/path/to/extension.ts", "/path/to/extension/dir"]
|
||||
"extensions": [
|
||||
"npm:@foo/bar@1.0.0",
|
||||
"git:github.com/user/repo@v1",
|
||||
"/path/to/extension.ts",
|
||||
"/path/to/extension/dir"
|
||||
]
|
||||
}
|
||||
```
|
||||
|
||||
Use `pi install` and `pi remove` to manage extension sources in settings:
|
||||
|
||||
```bash
|
||||
pi install npm:@foo/bar@1.0.0
|
||||
pi remove npm:@foo/bar
|
||||
```
|
||||
|
||||
**Discovery rules:**
|
||||
|
||||
1. **Direct files:** `extensions/*.ts` or `*.js` → loaded directly
|
||||
|
|
@ -146,13 +158,17 @@ Additional paths via `settings.json`:
|
|||
"zod": "^3.0.0"
|
||||
},
|
||||
"pi": {
|
||||
"extensions": ["./src/safety-gates.ts", "./src/custom-tools.ts"]
|
||||
"extensions": ["./src/safety-gates.ts", "./src/custom-tools.ts"],
|
||||
"skills": ["./skills/"],
|
||||
"prompts": ["./prompts/"],
|
||||
"themes": ["./themes/dark.json"]
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
The `package.json` approach enables:
|
||||
- Multiple extensions from one package
|
||||
- Skills, prompts, and themes declared alongside extensions
|
||||
- Third-party npm dependencies (resolved via jiti)
|
||||
- Nested source structure (no depth limit within the package)
|
||||
- Deployment to and installation from npm
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue