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:
Mario Zechner 2026-01-20 23:34:53 +01:00
parent 866d21c252
commit b846a4bfcf
51 changed files with 2724 additions and 1852 deletions

View file

@ -163,6 +163,42 @@ describe("parseArgs", () => {
});
});
describe("--skill flag", () => {
test("parses single --skill", () => {
const result = parseArgs(["--skill", "./skill-dir"]);
expect(result.skills).toEqual(["./skill-dir"]);
});
test("parses multiple --skill flags", () => {
const result = parseArgs(["--skill", "./skill-a", "--skill", "./skill-b"]);
expect(result.skills).toEqual(["./skill-a", "./skill-b"]);
});
});
describe("--prompt-template flag", () => {
test("parses single --prompt-template", () => {
const result = parseArgs(["--prompt-template", "./prompts"]);
expect(result.promptTemplates).toEqual(["./prompts"]);
});
test("parses multiple --prompt-template flags", () => {
const result = parseArgs(["--prompt-template", "./one", "--prompt-template", "./two"]);
expect(result.promptTemplates).toEqual(["./one", "./two"]);
});
});
describe("--theme flag", () => {
test("parses single --theme", () => {
const result = parseArgs(["--theme", "./theme.json"]);
expect(result.themes).toEqual(["./theme.json"]);
});
test("parses multiple --theme flags", () => {
const result = parseArgs(["--theme", "./dark.json", "--theme", "./light.json"]);
expect(result.themes).toEqual(["./dark.json", "./light.json"]);
});
});
describe("--no-skills flag", () => {
test("parses --no-skills flag", () => {
const result = parseArgs(["--no-skills"]);
@ -170,6 +206,20 @@ describe("parseArgs", () => {
});
});
describe("--no-prompt-templates flag", () => {
test("parses --no-prompt-templates flag", () => {
const result = parseArgs(["--no-prompt-templates"]);
expect(result.noPromptTemplates).toBe(true);
});
});
describe("--no-themes flag", () => {
test("parses --no-themes flag", () => {
const result = parseArgs(["--no-themes"]);
expect(result.noThemes).toBe(true);
});
});
describe("--no-tools flag", () => {
test("parses --no-tools flag", () => {
const result = parseArgs(["--no-tools"]);