@vandeepunk/pi-coding-agent 0.0.2 → 0.0.4
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 +105 -0
- package/README.md +6 -6
- package/dist/cli/args.d.ts.map +1 -1
- package/dist/cli/args.js +1 -0
- package/dist/cli/args.js.map +1 -1
- package/dist/config.d.ts +1 -1
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js +2 -2
- package/dist/config.js.map +1 -1
- package/dist/core/agent-session.d.ts.map +1 -1
- package/dist/core/agent-session.js +7 -0
- package/dist/core/agent-session.js.map +1 -1
- package/dist/core/auth-storage.d.ts.map +1 -1
- package/dist/core/auth-storage.js +16 -0
- package/dist/core/auth-storage.js.map +1 -1
- package/dist/core/export-html/template.css +3 -0
- package/dist/core/export-html/template.js +32 -15
- package/dist/core/extensions/loader.d.ts.map +1 -1
- package/dist/core/extensions/loader.js.map +1 -1
- package/dist/core/extensions/runner.d.ts +17 -2
- package/dist/core/extensions/runner.d.ts.map +1 -1
- package/dist/core/extensions/runner.js +53 -9
- package/dist/core/extensions/runner.js.map +1 -1
- package/dist/core/extensions/wrapper.d.ts.map +1 -1
- package/dist/core/extensions/wrapper.js +3 -3
- package/dist/core/extensions/wrapper.js.map +1 -1
- package/dist/core/model-registry.d.ts +3 -1
- package/dist/core/model-registry.d.ts.map +1 -1
- package/dist/core/model-registry.js +133 -37
- package/dist/core/model-registry.js.map +1 -1
- package/dist/core/model-resolver.d.ts.map +1 -1
- package/dist/core/model-resolver.js +5 -5
- package/dist/core/model-resolver.js.map +1 -1
- package/dist/core/package-manager.d.ts +21 -1
- package/dist/core/package-manager.d.ts.map +1 -1
- package/dist/core/package-manager.js +134 -33
- package/dist/core/package-manager.js.map +1 -1
- package/dist/core/prompt-templates.d.ts +3 -3
- package/dist/core/prompt-templates.d.ts.map +1 -1
- package/dist/core/prompt-templates.js +15 -15
- package/dist/core/prompt-templates.js.map +1 -1
- package/dist/core/resource-loader.d.ts.map +1 -1
- package/dist/core/resource-loader.js +6 -6
- package/dist/core/resource-loader.js.map +1 -1
- package/dist/core/settings-manager.d.ts +2 -2
- package/dist/core/settings-manager.d.ts.map +1 -1
- package/dist/core/settings-manager.js +4 -4
- package/dist/core/settings-manager.js.map +1 -1
- package/dist/core/skills.d.ts.map +1 -1
- package/dist/core/skills.js +57 -3
- package/dist/core/skills.js.map +1 -1
- package/dist/core/slash-commands.d.ts.map +1 -1
- package/dist/core/slash-commands.js +1 -0
- package/dist/core/slash-commands.js.map +1 -1
- package/dist/main.d.ts.map +1 -1
- package/dist/main.js +172 -177
- package/dist/main.js.map +1 -1
- package/dist/migrations.d.ts.map +1 -1
- package/dist/migrations.js +11 -11
- package/dist/migrations.js.map +1 -1
- package/dist/modes/interactive/components/assistant-message.d.ts.map +1 -1
- package/dist/modes/interactive/components/assistant-message.js +9 -4
- package/dist/modes/interactive/components/assistant-message.js.map +1 -1
- package/dist/modes/interactive/components/config-selector.d.ts +1 -1
- package/dist/modes/interactive/components/config-selector.d.ts.map +1 -1
- package/dist/modes/interactive/components/config-selector.js +6 -6
- package/dist/modes/interactive/components/config-selector.js.map +1 -1
- package/dist/modes/interactive/components/model-selector.d.ts.map +1 -1
- package/dist/modes/interactive/components/model-selector.js +5 -0
- package/dist/modes/interactive/components/model-selector.js.map +1 -1
- package/dist/modes/interactive/components/scoped-models-selector.d.ts.map +1 -1
- package/dist/modes/interactive/components/scoped-models-selector.js +5 -0
- package/dist/modes/interactive/components/scoped-models-selector.js.map +1 -1
- package/dist/modes/interactive/components/tool-execution.d.ts.map +1 -1
- package/dist/modes/interactive/components/tool-execution.js +49 -34
- package/dist/modes/interactive/components/tool-execution.js.map +1 -1
- package/dist/modes/interactive/interactive-mode.d.ts +0 -1
- package/dist/modes/interactive/interactive-mode.d.ts.map +1 -1
- package/dist/modes/interactive/interactive-mode.js +117 -104
- package/dist/modes/interactive/interactive-mode.js.map +1 -1
- package/dist/utils/git.d.ts +21 -1
- package/dist/utils/git.d.ts.map +1 -1
- package/dist/utils/git.js +150 -4
- package/dist/utils/git.js.map +1 -1
- package/docs/extensions.md +5 -0
- package/docs/models.md +40 -1
- package/docs/packages.md +23 -3
- package/docs/prompt-templates.md +6 -6
- package/docs/providers.md +13 -0
- package/docs/rpc.md +1 -1
- package/docs/sdk.md +5 -3
- package/docs/settings.md +2 -2
- package/examples/extensions/custom-provider-anthropic/package-lock.json +2 -2
- package/examples/extensions/custom-provider-anthropic/package.json +1 -1
- package/examples/extensions/custom-provider-gitlab-duo/package.json +1 -1
- package/examples/extensions/custom-provider-qwen-cli/package.json +1 -1
- package/examples/extensions/hello.ts +1 -1
- package/examples/extensions/subagent/README.md +4 -4
- package/examples/extensions/with-deps/package-lock.json +2 -2
- package/examples/extensions/with-deps/package.json +1 -1
- package/examples/sdk/08-prompt-templates.ts +2 -2
- package/package.json +7 -8
- /package/examples/extensions/subagent/{prompts → commands}/implement-and-review.md +0 -0
- /package/examples/extensions/subagent/{prompts → commands}/implement.md +0 -0
- /package/examples/extensions/subagent/{prompts → commands}/scout-and-plan.md +0 -0
|
@@ -223,9 +223,6 @@ export class InteractiveMode {
|
|
|
223
223
|
this.autocompleteProvider = new CombinedAutocompleteProvider([...slashCommands, ...templateCommands, ...extensionCommands, ...skillCommandList], process.cwd(), fdPath);
|
|
224
224
|
this.defaultEditor.setAutocompleteProvider(this.autocompleteProvider);
|
|
225
225
|
}
|
|
226
|
-
rebuildAutocomplete() {
|
|
227
|
-
this.setupAutocomplete(this.fdPath);
|
|
228
|
-
}
|
|
229
226
|
async init() {
|
|
230
227
|
if (this.isInitialized)
|
|
231
228
|
return;
|
|
@@ -233,7 +230,6 @@ export class InteractiveMode {
|
|
|
233
230
|
this.changelogMarkdown = this.getChangelogForDisplay();
|
|
234
231
|
// Setup autocomplete with fd tool for file path completion
|
|
235
232
|
this.fdPath = await ensureTool("fd");
|
|
236
|
-
this.setupAutocomplete(this.fdPath);
|
|
237
233
|
// Add header container as first child
|
|
238
234
|
this.ui.addChild(this.headerContainer);
|
|
239
235
|
// Add header with keybindings from config (unless silenced)
|
|
@@ -639,104 +635,114 @@ export class InteractiveMode {
|
|
|
639
635
|
return lines.join("\n");
|
|
640
636
|
}
|
|
641
637
|
showLoadedResources(options) {
|
|
642
|
-
const
|
|
643
|
-
|
|
638
|
+
const showListing = options?.force || this.options.verbose || !this.settingsManager.getQuietStartup();
|
|
639
|
+
const showDiagnostics = showListing || options?.showDiagnosticsWhenQuiet === true;
|
|
640
|
+
if (!showListing && !showDiagnostics) {
|
|
644
641
|
return;
|
|
645
642
|
}
|
|
646
643
|
const metadata = this.session.resourceLoader.getPathMetadata();
|
|
647
644
|
const sectionHeader = (name, color = "mdHeading") => theme.fg(color, `[${name}]`);
|
|
648
|
-
const
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
this.
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
const commandDiagnostics = this.session.extensionRunner?.getCommandDiagnostics() ?? [];
|
|
714
|
-
extensionDiagnostics.push(...commandDiagnostics);
|
|
715
|
-
const shortcutDiagnostics = this.session.extensionRunner?.getShortcutDiagnostics() ?? [];
|
|
716
|
-
extensionDiagnostics.push(...shortcutDiagnostics);
|
|
717
|
-
if (extensionDiagnostics.length > 0) {
|
|
718
|
-
const warningLines = this.formatDiagnostics(extensionDiagnostics, metadata);
|
|
719
|
-
this.chatContainer.addChild(new Text(`${theme.fg("warning", "[Extension issues]")}\n${warningLines}`, 0, 0));
|
|
720
|
-
this.chatContainer.addChild(new Spacer(1));
|
|
721
|
-
}
|
|
722
|
-
// Show loaded themes (excluding built-in)
|
|
723
|
-
const loadedThemes = this.session.resourceLoader.getThemes().themes;
|
|
724
|
-
const customThemes = loadedThemes.filter((t) => t.sourcePath);
|
|
725
|
-
if (customThemes.length > 0) {
|
|
726
|
-
const themePaths = customThemes.map((t) => t.sourcePath);
|
|
727
|
-
const groups = this.buildScopeGroups(themePaths, metadata);
|
|
728
|
-
const themeList = this.formatScopeGroups(groups, {
|
|
729
|
-
formatPath: (p) => this.formatDisplayPath(p),
|
|
730
|
-
formatPackagePath: (p, source) => this.getShortPath(p, source),
|
|
731
|
-
});
|
|
732
|
-
this.chatContainer.addChild(new Text(`${sectionHeader("Themes")}\n${themeList}`, 0, 0));
|
|
733
|
-
this.chatContainer.addChild(new Spacer(1));
|
|
645
|
+
const skillsResult = this.session.resourceLoader.getSkills();
|
|
646
|
+
const promptsResult = this.session.resourceLoader.getPrompts();
|
|
647
|
+
const themesResult = this.session.resourceLoader.getThemes();
|
|
648
|
+
if (showListing) {
|
|
649
|
+
const contextFiles = this.session.resourceLoader.getAgentsFiles().agentsFiles;
|
|
650
|
+
if (contextFiles.length > 0) {
|
|
651
|
+
this.chatContainer.addChild(new Spacer(1));
|
|
652
|
+
const contextList = contextFiles
|
|
653
|
+
.map((f) => theme.fg("dim", ` ${this.formatDisplayPath(f.path)}`))
|
|
654
|
+
.join("\n");
|
|
655
|
+
this.chatContainer.addChild(new Text(`${sectionHeader("Context")}\n${contextList}`, 0, 0));
|
|
656
|
+
this.chatContainer.addChild(new Spacer(1));
|
|
657
|
+
}
|
|
658
|
+
const skills = skillsResult.skills;
|
|
659
|
+
if (skills.length > 0) {
|
|
660
|
+
const skillPaths = skills.map((s) => s.filePath);
|
|
661
|
+
const groups = this.buildScopeGroups(skillPaths, metadata);
|
|
662
|
+
const skillList = this.formatScopeGroups(groups, {
|
|
663
|
+
formatPath: (p) => this.formatDisplayPath(p),
|
|
664
|
+
formatPackagePath: (p, source) => this.getShortPath(p, source),
|
|
665
|
+
});
|
|
666
|
+
this.chatContainer.addChild(new Text(`${sectionHeader("Skills")}\n${skillList}`, 0, 0));
|
|
667
|
+
this.chatContainer.addChild(new Spacer(1));
|
|
668
|
+
}
|
|
669
|
+
const templates = this.session.promptTemplates;
|
|
670
|
+
if (templates.length > 0) {
|
|
671
|
+
const templatePaths = templates.map((t) => t.filePath);
|
|
672
|
+
const groups = this.buildScopeGroups(templatePaths, metadata);
|
|
673
|
+
const templateByPath = new Map(templates.map((t) => [t.filePath, t]));
|
|
674
|
+
const templateList = this.formatScopeGroups(groups, {
|
|
675
|
+
formatPath: (p) => {
|
|
676
|
+
const template = templateByPath.get(p);
|
|
677
|
+
return template ? `/${template.name}` : this.formatDisplayPath(p);
|
|
678
|
+
},
|
|
679
|
+
formatPackagePath: (p) => {
|
|
680
|
+
const template = templateByPath.get(p);
|
|
681
|
+
return template ? `/${template.name}` : this.formatDisplayPath(p);
|
|
682
|
+
},
|
|
683
|
+
});
|
|
684
|
+
this.chatContainer.addChild(new Text(`${sectionHeader("Prompts")}\n${templateList}`, 0, 0));
|
|
685
|
+
this.chatContainer.addChild(new Spacer(1));
|
|
686
|
+
}
|
|
687
|
+
const extensionPaths = options?.extensionPaths ?? [];
|
|
688
|
+
if (extensionPaths.length > 0) {
|
|
689
|
+
const groups = this.buildScopeGroups(extensionPaths, metadata);
|
|
690
|
+
const extList = this.formatScopeGroups(groups, {
|
|
691
|
+
formatPath: (p) => this.formatDisplayPath(p),
|
|
692
|
+
formatPackagePath: (p, source) => this.getShortPath(p, source),
|
|
693
|
+
});
|
|
694
|
+
this.chatContainer.addChild(new Text(`${sectionHeader("Extensions", "mdHeading")}\n${extList}`, 0, 0));
|
|
695
|
+
this.chatContainer.addChild(new Spacer(1));
|
|
696
|
+
}
|
|
697
|
+
// Show loaded themes (excluding built-in)
|
|
698
|
+
const loadedThemes = themesResult.themes;
|
|
699
|
+
const customThemes = loadedThemes.filter((t) => t.sourcePath);
|
|
700
|
+
if (customThemes.length > 0) {
|
|
701
|
+
const themePaths = customThemes.map((t) => t.sourcePath);
|
|
702
|
+
const groups = this.buildScopeGroups(themePaths, metadata);
|
|
703
|
+
const themeList = this.formatScopeGroups(groups, {
|
|
704
|
+
formatPath: (p) => this.formatDisplayPath(p),
|
|
705
|
+
formatPackagePath: (p, source) => this.getShortPath(p, source),
|
|
706
|
+
});
|
|
707
|
+
this.chatContainer.addChild(new Text(`${sectionHeader("Themes")}\n${themeList}`, 0, 0));
|
|
708
|
+
this.chatContainer.addChild(new Spacer(1));
|
|
709
|
+
}
|
|
734
710
|
}
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
711
|
+
if (showDiagnostics) {
|
|
712
|
+
const skillDiagnostics = skillsResult.diagnostics;
|
|
713
|
+
if (skillDiagnostics.length > 0) {
|
|
714
|
+
const warningLines = this.formatDiagnostics(skillDiagnostics, metadata);
|
|
715
|
+
this.chatContainer.addChild(new Text(`${theme.fg("warning", "[Skill conflicts]")}\n${warningLines}`, 0, 0));
|
|
716
|
+
this.chatContainer.addChild(new Spacer(1));
|
|
717
|
+
}
|
|
718
|
+
const promptDiagnostics = promptsResult.diagnostics;
|
|
719
|
+
if (promptDiagnostics.length > 0) {
|
|
720
|
+
const warningLines = this.formatDiagnostics(promptDiagnostics, metadata);
|
|
721
|
+
this.chatContainer.addChild(new Text(`${theme.fg("warning", "[Prompt conflicts]")}\n${warningLines}`, 0, 0));
|
|
722
|
+
this.chatContainer.addChild(new Spacer(1));
|
|
723
|
+
}
|
|
724
|
+
const extensionDiagnostics = [];
|
|
725
|
+
const extensionErrors = this.session.resourceLoader.getExtensions().errors;
|
|
726
|
+
if (extensionErrors.length > 0) {
|
|
727
|
+
for (const error of extensionErrors) {
|
|
728
|
+
extensionDiagnostics.push({ type: "error", message: error.error, path: error.path });
|
|
729
|
+
}
|
|
730
|
+
}
|
|
731
|
+
const commandDiagnostics = this.session.extensionRunner?.getCommandDiagnostics() ?? [];
|
|
732
|
+
extensionDiagnostics.push(...commandDiagnostics);
|
|
733
|
+
const shortcutDiagnostics = this.session.extensionRunner?.getShortcutDiagnostics() ?? [];
|
|
734
|
+
extensionDiagnostics.push(...shortcutDiagnostics);
|
|
735
|
+
if (extensionDiagnostics.length > 0) {
|
|
736
|
+
const warningLines = this.formatDiagnostics(extensionDiagnostics, metadata);
|
|
737
|
+
this.chatContainer.addChild(new Text(`${theme.fg("warning", "[Extension issues]")}\n${warningLines}`, 0, 0));
|
|
738
|
+
this.chatContainer.addChild(new Spacer(1));
|
|
739
|
+
}
|
|
740
|
+
const themeDiagnostics = themesResult.diagnostics;
|
|
741
|
+
if (themeDiagnostics.length > 0) {
|
|
742
|
+
const warningLines = this.formatDiagnostics(themeDiagnostics, metadata);
|
|
743
|
+
this.chatContainer.addChild(new Text(`${theme.fg("warning", "[Theme conflicts]")}\n${warningLines}`, 0, 0));
|
|
744
|
+
this.chatContainer.addChild(new Spacer(1));
|
|
745
|
+
}
|
|
740
746
|
}
|
|
741
747
|
}
|
|
742
748
|
/**
|
|
@@ -807,13 +813,16 @@ export class InteractiveMode {
|
|
|
807
813
|
},
|
|
808
814
|
shutdownHandler: () => {
|
|
809
815
|
this.shutdownRequested = true;
|
|
816
|
+
if (!this.session.isStreaming) {
|
|
817
|
+
void this.shutdown();
|
|
818
|
+
}
|
|
810
819
|
},
|
|
811
820
|
onError: (error) => {
|
|
812
821
|
this.showExtensionError(error.extensionPath, error.error, error.stack);
|
|
813
822
|
},
|
|
814
823
|
});
|
|
815
824
|
setRegisteredThemes(this.session.resourceLoader.getThemes().themes);
|
|
816
|
-
this.
|
|
825
|
+
this.setupAutocomplete(this.fdPath);
|
|
817
826
|
const extensionRunner = this.session.extensionRunner;
|
|
818
827
|
if (!extensionRunner) {
|
|
819
828
|
this.showLoadedResources({ extensionPaths: [], force: false });
|
|
@@ -1570,7 +1579,7 @@ export class InteractiveMode {
|
|
|
1570
1579
|
this.editor.setText("");
|
|
1571
1580
|
return;
|
|
1572
1581
|
}
|
|
1573
|
-
if (text === "/quit"
|
|
1582
|
+
if (text === "/quit") {
|
|
1574
1583
|
this.editor.setText("");
|
|
1575
1584
|
await this.shutdown();
|
|
1576
1585
|
return;
|
|
@@ -2529,7 +2538,7 @@ export class InteractiveMode {
|
|
|
2529
2538
|
},
|
|
2530
2539
|
onEnableSkillCommandsChange: (enabled) => {
|
|
2531
2540
|
this.settingsManager.setEnableSkillCommands(enabled);
|
|
2532
|
-
this.
|
|
2541
|
+
this.setupAutocomplete(this.fdPath);
|
|
2533
2542
|
},
|
|
2534
2543
|
onSteeringModeChange: (mode) => {
|
|
2535
2544
|
this.session.setSteeringMode(mode);
|
|
@@ -3097,7 +3106,7 @@ export class InteractiveMode {
|
|
|
3097
3106
|
return;
|
|
3098
3107
|
}
|
|
3099
3108
|
this.resetExtensionUI();
|
|
3100
|
-
const loader = new BorderedLoader(this.ui, theme, "Reloading extensions, skills,
|
|
3109
|
+
const loader = new BorderedLoader(this.ui, theme, "Reloading extensions, skills, commands, themes...", {
|
|
3101
3110
|
cancellable: false,
|
|
3102
3111
|
});
|
|
3103
3112
|
const previousEditor = this.editor;
|
|
@@ -3131,19 +3140,23 @@ export class InteractiveMode {
|
|
|
3131
3140
|
}
|
|
3132
3141
|
this.ui.setShowHardwareCursor(this.settingsManager.getShowHardwareCursor());
|
|
3133
3142
|
this.ui.setClearOnShrink(this.settingsManager.getClearOnShrink());
|
|
3134
|
-
this.
|
|
3143
|
+
this.setupAutocomplete(this.fdPath);
|
|
3135
3144
|
const runner = this.session.extensionRunner;
|
|
3136
3145
|
if (runner) {
|
|
3137
3146
|
this.setupExtensionShortcuts(runner);
|
|
3138
3147
|
}
|
|
3139
3148
|
this.rebuildChatFromMessages();
|
|
3140
3149
|
dismissLoader(this.editor);
|
|
3141
|
-
this.showLoadedResources({
|
|
3150
|
+
this.showLoadedResources({
|
|
3151
|
+
extensionPaths: runner?.getExtensionPaths() ?? [],
|
|
3152
|
+
force: false,
|
|
3153
|
+
showDiagnosticsWhenQuiet: true,
|
|
3154
|
+
});
|
|
3142
3155
|
const modelsJsonError = this.session.modelRegistry.getError();
|
|
3143
3156
|
if (modelsJsonError) {
|
|
3144
3157
|
this.showError(`models.json error: ${modelsJsonError}`);
|
|
3145
3158
|
}
|
|
3146
|
-
this.showStatus("Reloaded extensions, skills,
|
|
3159
|
+
this.showStatus("Reloaded extensions, skills, commands, themes");
|
|
3147
3160
|
}
|
|
3148
3161
|
catch (error) {
|
|
3149
3162
|
dismissLoader(previousEditor);
|