@fleetagent/pi-coding-agent 0.0.5 → 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.
Files changed (95) hide show
  1. package/CHANGELOG.md +32 -0
  2. package/README.md +28 -5
  3. package/dist/cli/args.d.ts +2 -0
  4. package/dist/cli/args.d.ts.map +1 -1
  5. package/dist/cli/args.js +9 -0
  6. package/dist/cli/args.js.map +1 -1
  7. package/dist/core/agent-session.d.ts +4 -3
  8. package/dist/core/agent-session.d.ts.map +1 -1
  9. package/dist/core/agent-session.js +44 -8
  10. package/dist/core/agent-session.js.map +1 -1
  11. package/dist/core/diagnostics.d.ts +1 -1
  12. package/dist/core/diagnostics.d.ts.map +1 -1
  13. package/dist/core/diagnostics.js.map +1 -1
  14. package/dist/core/extensions/runner.d.ts +4 -0
  15. package/dist/core/extensions/runner.d.ts.map +1 -1
  16. package/dist/core/extensions/runner.js +5 -1
  17. package/dist/core/extensions/runner.js.map +1 -1
  18. package/dist/core/extensions/types.d.ts +2 -1
  19. package/dist/core/extensions/types.d.ts.map +1 -1
  20. package/dist/core/extensions/types.js.map +1 -1
  21. package/dist/core/package-manager.d.ts +1 -0
  22. package/dist/core/package-manager.d.ts.map +1 -1
  23. package/dist/core/package-manager.js +130 -12
  24. package/dist/core/package-manager.js.map +1 -1
  25. package/dist/core/resource-loader.d.ts +30 -0
  26. package/dist/core/resource-loader.d.ts.map +1 -1
  27. package/dist/core/resource-loader.js +94 -0
  28. package/dist/core/resource-loader.js.map +1 -1
  29. package/dist/core/rules.d.ts +57 -0
  30. package/dist/core/rules.d.ts.map +1 -0
  31. package/dist/core/rules.js +384 -0
  32. package/dist/core/rules.js.map +1 -0
  33. package/dist/core/settings-manager.d.ts +5 -0
  34. package/dist/core/settings-manager.d.ts.map +1 -1
  35. package/dist/core/settings-manager.js +14 -0
  36. package/dist/core/settings-manager.js.map +1 -1
  37. package/dist/core/slash-commands.d.ts +1 -1
  38. package/dist/core/slash-commands.d.ts.map +1 -1
  39. package/dist/core/slash-commands.js +1 -1
  40. package/dist/core/slash-commands.js.map +1 -1
  41. package/dist/core/system-prompt.d.ts +3 -0
  42. package/dist/core/system-prompt.d.ts.map +1 -1
  43. package/dist/core/system-prompt.js +11 -3
  44. package/dist/core/system-prompt.js.map +1 -1
  45. package/dist/core/tools/read.d.ts.map +1 -1
  46. package/dist/core/tools/read.js +6 -2
  47. package/dist/core/tools/read.js.map +1 -1
  48. package/dist/index.d.ts +1 -0
  49. package/dist/index.d.ts.map +1 -1
  50. package/dist/index.js +2 -0
  51. package/dist/index.js.map +1 -1
  52. package/dist/main.d.ts.map +1 -1
  53. package/dist/main.js +3 -0
  54. package/dist/main.js.map +1 -1
  55. package/dist/modes/interactive/components/config-selector.d.ts +1 -1
  56. package/dist/modes/interactive/components/config-selector.d.ts.map +1 -1
  57. package/dist/modes/interactive/components/config-selector.js +12 -3
  58. package/dist/modes/interactive/components/config-selector.js.map +1 -1
  59. package/dist/modes/interactive/components/settings-selector.d.ts.map +1 -1
  60. package/dist/modes/interactive/components/settings-selector.js +1 -1
  61. package/dist/modes/interactive/components/settings-selector.js.map +1 -1
  62. package/dist/modes/interactive/interactive-mode.d.ts.map +1 -1
  63. package/dist/modes/interactive/interactive-mode.js +34 -4
  64. package/dist/modes/interactive/interactive-mode.js.map +1 -1
  65. package/dist/modes/rpc/rpc-client.d.ts +2 -0
  66. package/dist/modes/rpc/rpc-client.d.ts.map +1 -1
  67. package/dist/modes/rpc/rpc-client.js +27 -11
  68. package/dist/modes/rpc/rpc-client.js.map +1 -1
  69. package/dist/modes/rpc/rpc-mode.d.ts.map +1 -1
  70. package/dist/modes/rpc/rpc-mode.js +8 -0
  71. package/dist/modes/rpc/rpc-mode.js.map +1 -1
  72. package/dist/modes/rpc/rpc-types.d.ts +1 -1
  73. package/dist/modes/rpc/rpc-types.d.ts.map +1 -1
  74. package/dist/modes/rpc/rpc-types.js.map +1 -1
  75. package/docs/extensions.md +9 -8
  76. package/docs/index.md +3 -2
  77. package/docs/packages.md +6 -4
  78. package/docs/quickstart.md +1 -1
  79. package/docs/rpc.md +4 -2
  80. package/docs/rules.md +102 -0
  81. package/docs/sdk.md +1 -1
  82. package/docs/settings.md +3 -2
  83. package/docs/usage.md +4 -2
  84. package/examples/extensions/README.md +1 -1
  85. package/examples/extensions/custom-provider-anthropic/package.json +1 -1
  86. package/examples/extensions/custom-provider-gitlab-duo/package.json +1 -1
  87. package/examples/extensions/dynamic-resources/RULES.md +8 -0
  88. package/examples/extensions/dynamic-resources/index.ts +1 -0
  89. package/examples/extensions/reload-runtime.ts +2 -2
  90. package/examples/extensions/sandbox/package.json +1 -1
  91. package/examples/extensions/with-deps/package.json +1 -1
  92. package/examples/sdk/12-full-control.ts +1 -0
  93. package/examples/sdk/README.md +1 -1
  94. package/npm-shrinkwrap.json +12 -12
  95. 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 session.skills (if enabled)
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);