@fleetagent/pi-coding-agent 0.0.4 → 0.0.6
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 +48 -0
- package/README.md +28 -5
- package/dist/cli/args.d.ts +2 -0
- package/dist/cli/args.d.ts.map +1 -1
- package/dist/cli/args.js +9 -0
- package/dist/cli/args.js.map +1 -1
- package/dist/core/agent-session.d.ts +4 -3
- package/dist/core/agent-session.d.ts.map +1 -1
- package/dist/core/agent-session.js +44 -8
- package/dist/core/agent-session.js.map +1 -1
- package/dist/core/diagnostics.d.ts +1 -1
- package/dist/core/diagnostics.d.ts.map +1 -1
- package/dist/core/diagnostics.js.map +1 -1
- package/dist/core/extensions/runner.d.ts +4 -0
- package/dist/core/extensions/runner.d.ts.map +1 -1
- package/dist/core/extensions/runner.js +5 -1
- package/dist/core/extensions/runner.js.map +1 -1
- package/dist/core/extensions/types.d.ts +2 -1
- package/dist/core/extensions/types.d.ts.map +1 -1
- package/dist/core/extensions/types.js.map +1 -1
- package/dist/core/package-manager.d.ts +1 -0
- package/dist/core/package-manager.d.ts.map +1 -1
- package/dist/core/package-manager.js +130 -12
- package/dist/core/package-manager.js.map +1 -1
- package/dist/core/resource-loader.d.ts +30 -0
- package/dist/core/resource-loader.d.ts.map +1 -1
- package/dist/core/resource-loader.js +94 -0
- package/dist/core/resource-loader.js.map +1 -1
- package/dist/core/rules.d.ts +57 -0
- package/dist/core/rules.d.ts.map +1 -0
- package/dist/core/rules.js +384 -0
- package/dist/core/rules.js.map +1 -0
- package/dist/core/settings-manager.d.ts +5 -0
- package/dist/core/settings-manager.d.ts.map +1 -1
- package/dist/core/settings-manager.js +14 -0
- package/dist/core/settings-manager.js.map +1 -1
- package/dist/core/slash-commands.d.ts +1 -1
- package/dist/core/slash-commands.d.ts.map +1 -1
- package/dist/core/slash-commands.js +1 -1
- package/dist/core/slash-commands.js.map +1 -1
- package/dist/core/system-prompt.d.ts +3 -0
- package/dist/core/system-prompt.d.ts.map +1 -1
- package/dist/core/system-prompt.js +11 -3
- package/dist/core/system-prompt.js.map +1 -1
- package/dist/core/tools/read.d.ts.map +1 -1
- package/dist/core/tools/read.js +6 -2
- package/dist/core/tools/read.js.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -0
- package/dist/index.js.map +1 -1
- package/dist/main.d.ts.map +1 -1
- package/dist/main.js +3 -0
- package/dist/main.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 +12 -3
- package/dist/modes/interactive/components/config-selector.js.map +1 -1
- package/dist/modes/interactive/components/settings-selector.d.ts.map +1 -1
- package/dist/modes/interactive/components/settings-selector.js +1 -1
- package/dist/modes/interactive/components/settings-selector.js.map +1 -1
- package/dist/modes/interactive/interactive-mode.d.ts.map +1 -1
- package/dist/modes/interactive/interactive-mode.js +34 -4
- package/dist/modes/interactive/interactive-mode.js.map +1 -1
- package/dist/modes/rpc/rpc-client.d.ts +14 -1
- package/dist/modes/rpc/rpc-client.d.ts.map +1 -1
- package/dist/modes/rpc/rpc-client.js +34 -11
- package/dist/modes/rpc/rpc-client.js.map +1 -1
- package/dist/modes/rpc/rpc-mode.d.ts.map +1 -1
- package/dist/modes/rpc/rpc-mode.js +18 -0
- package/dist/modes/rpc/rpc-mode.js.map +1 -1
- package/dist/modes/rpc/rpc-types.d.ts +17 -2
- package/dist/modes/rpc/rpc-types.d.ts.map +1 -1
- package/dist/modes/rpc/rpc-types.js.map +1 -1
- package/docs/extensions.md +9 -8
- package/docs/index.md +3 -2
- package/docs/packages.md +6 -4
- package/docs/quickstart.md +1 -1
- package/docs/rpc.md +4 -2
- package/docs/rules.md +102 -0
- package/docs/sdk.md +1 -1
- package/docs/settings.md +3 -2
- package/docs/usage.md +4 -2
- package/examples/extensions/README.md +1 -1
- package/examples/extensions/custom-provider-anthropic/package.json +1 -1
- package/examples/extensions/custom-provider-gitlab-duo/package.json +1 -1
- package/examples/extensions/dynamic-resources/RULES.md +8 -0
- package/examples/extensions/dynamic-resources/index.ts +1 -0
- package/examples/extensions/reload-runtime.ts +2 -2
- package/examples/extensions/sandbox/package.json +1 -1
- package/examples/extensions/with-deps/package.json +1 -1
- package/examples/sdk/12-full-control.ts +1 -0
- package/examples/sdk/README.md +1 -1
- package/npm-shrinkwrap.json +12 -12
- package/package.json +4 -4
|
@@ -327,9 +327,10 @@ export class InteractiveMode {
|
|
|
327
327
|
description: this.prefixAutocompleteDescription(cmd.description, cmd.sourceInfo),
|
|
328
328
|
getArgumentCompletions: cmd.getArgumentCompletions,
|
|
329
329
|
}));
|
|
330
|
-
// Build skill commands from
|
|
330
|
+
// Build skill/rule commands from loaded resources (if enabled)
|
|
331
331
|
this.skillCommands.clear();
|
|
332
332
|
const skillCommandList = [];
|
|
333
|
+
const ruleCommandList = [];
|
|
333
334
|
if (this.settingsManager.getEnableSkillCommands()) {
|
|
334
335
|
for (const skill of this.session.resourceLoader.getSkills().skills) {
|
|
335
336
|
const commandName = `skill:${skill.name}`;
|
|
@@ -339,8 +340,15 @@ export class InteractiveMode {
|
|
|
339
340
|
description: this.prefixAutocompleteDescription(skill.description, skill.sourceInfo),
|
|
340
341
|
});
|
|
341
342
|
}
|
|
343
|
+
for (const rule of this.session.resourceLoader.getRules().rules) {
|
|
344
|
+
const commandName = `rule:${rule.name}`;
|
|
345
|
+
ruleCommandList.push({
|
|
346
|
+
name: commandName,
|
|
347
|
+
description: this.prefixAutocompleteDescription(rule.description, rule.sourceInfo),
|
|
348
|
+
});
|
|
349
|
+
}
|
|
342
350
|
}
|
|
343
|
-
return new CombinedAutocompleteProvider([...slashCommands, ...templateCommands, ...extensionCommands, ...skillCommandList], this.activeSession.getCwd(), this.fdPath);
|
|
351
|
+
return new CombinedAutocompleteProvider([...slashCommands, ...templateCommands, ...extensionCommands, ...skillCommandList, ...ruleCommandList], this.activeSession.getCwd(), this.fdPath);
|
|
344
352
|
}
|
|
345
353
|
setupAutocompleteProvider() {
|
|
346
354
|
let provider = this.createBaseAutocompleteProvider();
|
|
@@ -970,6 +978,7 @@ export class InteractiveMode {
|
|
|
970
978
|
this.chatContainer.addChild(new Spacer(1));
|
|
971
979
|
};
|
|
972
980
|
const skillsResult = this.session.resourceLoader.getSkills();
|
|
981
|
+
const rulesResult = this.session.resourceLoader.getRules();
|
|
973
982
|
const promptsResult = this.session.resourceLoader.getPrompts();
|
|
974
983
|
const themesResult = this.session.resourceLoader.getThemes();
|
|
975
984
|
const extensions = options?.extensions ??
|
|
@@ -988,6 +997,11 @@ export class InteractiveMode {
|
|
|
988
997
|
sourceInfos.set(skill.filePath, skill.sourceInfo);
|
|
989
998
|
}
|
|
990
999
|
}
|
|
1000
|
+
for (const rule of rulesResult.rules) {
|
|
1001
|
+
if (rule.sourceInfo) {
|
|
1002
|
+
sourceInfos.set(rule.filePath, rule.sourceInfo);
|
|
1003
|
+
}
|
|
1004
|
+
}
|
|
991
1005
|
for (const prompt of promptsResult.prompts) {
|
|
992
1006
|
if (prompt.sourceInfo) {
|
|
993
1007
|
sourceInfos.set(prompt.filePath, prompt.sourceInfo);
|
|
@@ -1018,6 +1032,16 @@ export class InteractiveMode {
|
|
|
1018
1032
|
const skillCompactList = formatCompactList(skills.map((skill) => skill.name));
|
|
1019
1033
|
addLoadedSection("Skills", skillCompactList, skillList);
|
|
1020
1034
|
}
|
|
1035
|
+
const rules = rulesResult.rules;
|
|
1036
|
+
if (rules.length > 0) {
|
|
1037
|
+
const groups = this.buildScopeGroups(rules.map((rule) => ({ path: rule.filePath, sourceInfo: rule.sourceInfo })));
|
|
1038
|
+
const ruleList = this.formatScopeGroups(groups, {
|
|
1039
|
+
formatPath: (item) => this.formatDisplayPath(item.path),
|
|
1040
|
+
formatPackagePath: (item) => this.getShortPath(item.path, item.sourceInfo),
|
|
1041
|
+
});
|
|
1042
|
+
const ruleCompactList = formatCompactList(rules.map((rule) => rule.name));
|
|
1043
|
+
addLoadedSection("Rules", ruleCompactList, ruleList);
|
|
1044
|
+
}
|
|
1021
1045
|
const templates = this.session.promptTemplates;
|
|
1022
1046
|
if (templates.length > 0) {
|
|
1023
1047
|
const groups = this.buildScopeGroups(templates.map((template) => ({ path: template.filePath, sourceInfo: template.sourceInfo })));
|
|
@@ -1067,6 +1091,12 @@ export class InteractiveMode {
|
|
|
1067
1091
|
this.chatContainer.addChild(new Text(`${theme.fg("warning", "[Skill conflicts]")}\n${warningLines}`, 0, 0));
|
|
1068
1092
|
this.chatContainer.addChild(new Spacer(1));
|
|
1069
1093
|
}
|
|
1094
|
+
const ruleDiagnostics = rulesResult.diagnostics;
|
|
1095
|
+
if (ruleDiagnostics.length > 0) {
|
|
1096
|
+
const warningLines = this.formatDiagnostics(ruleDiagnostics, sourceInfos);
|
|
1097
|
+
this.chatContainer.addChild(new Text(`${theme.fg("warning", "[Rule conflicts]")}\n${warningLines}`, 0, 0));
|
|
1098
|
+
this.chatContainer.addChild(new Spacer(1));
|
|
1099
|
+
}
|
|
1070
1100
|
const promptDiagnostics = promptsResult.diagnostics;
|
|
1071
1101
|
if (promptDiagnostics.length > 0) {
|
|
1072
1102
|
const warningLines = this.formatDiagnostics(promptDiagnostics, sourceInfos);
|
|
@@ -4041,7 +4071,7 @@ export class InteractiveMode {
|
|
|
4041
4071
|
const borderColor = (s) => theme.fg("border", s);
|
|
4042
4072
|
reloadBox.addChild(new DynamicBorder(borderColor));
|
|
4043
4073
|
reloadBox.addChild(new Spacer(1));
|
|
4044
|
-
reloadBox.addChild(new Text(theme.fg("muted", "Reloading keybindings, extensions, skills, prompts, themes..."), 1, 0));
|
|
4074
|
+
reloadBox.addChild(new Text(theme.fg("muted", "Reloading keybindings, extensions, skills, rules, prompts, themes..."), 1, 0));
|
|
4045
4075
|
reloadBox.addChild(new Spacer(1));
|
|
4046
4076
|
reloadBox.addChild(new DynamicBorder(borderColor));
|
|
4047
4077
|
const previousEditor = this.editor;
|
|
@@ -4093,7 +4123,7 @@ export class InteractiveMode {
|
|
|
4093
4123
|
if (modelsJsonError) {
|
|
4094
4124
|
this.showError(`models.json error: ${modelsJsonError}`);
|
|
4095
4125
|
}
|
|
4096
|
-
this.showStatus("Reloaded keybindings, extensions, skills, prompts, themes");
|
|
4126
|
+
this.showStatus("Reloaded keybindings, extensions, skills, rules, prompts, themes");
|
|
4097
4127
|
}
|
|
4098
4128
|
catch (error) {
|
|
4099
4129
|
dismissReloadBox(previousEditor);
|