@oh-my-pi/pi-coding-agent 15.11.1 → 15.11.2

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 (59) hide show
  1. package/CHANGELOG.md +27 -1
  2. package/dist/cli.js +629 -614
  3. package/dist/types/config/settings-schema.d.ts +36 -0
  4. package/dist/types/extensibility/custom-commands/types.d.ts +6 -3
  5. package/dist/types/extensibility/custom-tools/loader.d.ts +2 -1
  6. package/dist/types/extensibility/custom-tools/types.d.ts +8 -4
  7. package/dist/types/extensibility/extensions/types.d.ts +2 -2
  8. package/dist/types/extensibility/hooks/types.d.ts +8 -4
  9. package/dist/types/irc/bus.d.ts +15 -2
  10. package/dist/types/modes/components/plan-review-overlay.d.ts +2 -0
  11. package/dist/types/modes/rpc/rpc-client.d.ts +10 -1
  12. package/dist/types/modes/rpc/rpc-mode.d.ts +2 -0
  13. package/dist/types/modes/rpc/rpc-types.d.ts +30 -0
  14. package/dist/types/modes/theme/theme.d.ts +1 -1
  15. package/dist/types/session/agent-session.d.ts +17 -3
  16. package/dist/types/slash-commands/available-commands.d.ts +34 -0
  17. package/dist/types/tools/bash.d.ts +1 -1
  18. package/dist/types/tools/browser/attach.d.ts +4 -4
  19. package/dist/types/tools/browser/registry.d.ts +1 -0
  20. package/dist/types/tools/irc.d.ts +3 -2
  21. package/dist/types/tools/path-utils.d.ts +0 -4
  22. package/package.json +11 -11
  23. package/src/config/settings-schema.ts +40 -0
  24. package/src/exec/bash-executor.ts +21 -6
  25. package/src/extensibility/custom-commands/loader.ts +3 -1
  26. package/src/extensibility/custom-commands/types.ts +6 -3
  27. package/src/extensibility/custom-tools/loader.ts +4 -7
  28. package/src/extensibility/custom-tools/types.ts +8 -4
  29. package/src/extensibility/extensions/loader.ts +2 -1
  30. package/src/extensibility/extensions/types.ts +2 -2
  31. package/src/extensibility/hooks/loader.ts +3 -1
  32. package/src/extensibility/hooks/types.ts +8 -4
  33. package/src/internal-urls/docs-index.generated.ts +4 -4
  34. package/src/irc/bus.ts +14 -3
  35. package/src/lsp/defaults.json +6 -0
  36. package/src/lsp/render.ts +2 -28
  37. package/src/memories/index.ts +2 -0
  38. package/src/modes/acp/acp-agent.ts +4 -67
  39. package/src/modes/components/plan-review-overlay.ts +32 -3
  40. package/src/modes/controllers/streaming-reveal.ts +16 -8
  41. package/src/modes/interactive-mode.ts +32 -0
  42. package/src/modes/rpc/rpc-client.ts +32 -0
  43. package/src/modes/rpc/rpc-mode.ts +82 -7
  44. package/src/modes/rpc/rpc-types.ts +23 -0
  45. package/src/modes/theme/theme.ts +7 -7
  46. package/src/modes/utils/ui-helpers.ts +13 -4
  47. package/src/prompts/memories/consolidation_system.md +4 -0
  48. package/src/prompts/system/irc-autoreply.md +6 -0
  49. package/src/prompts/system/irc-incoming.md +1 -1
  50. package/src/prompts/tools/bash.md +1 -0
  51. package/src/prompts/tools/irc.md +1 -1
  52. package/src/session/agent-session.ts +95 -6
  53. package/src/slash-commands/available-commands.ts +105 -0
  54. package/src/tools/bash.ts +5 -1
  55. package/src/tools/browser/attach.ts +26 -7
  56. package/src/tools/browser/registry.ts +11 -1
  57. package/src/tools/irc.ts +16 -4
  58. package/src/tools/job.ts +7 -3
  59. package/src/tools/path-utils.ts +22 -15
@@ -398,6 +398,11 @@ export function formatPathRelativeToCwd(
398
398
  export function stripOuterDoubleQuotes(input: string): string {
399
399
  return input.startsWith('"') && input.endsWith('"') && input.length > 1 ? input.slice(1, -1) : input;
400
400
  }
401
+ function normalizePathSeparators(input: string): string {
402
+ if (isInternalUrlPath(input)) return input;
403
+ if (!input.includes("\\")) return input;
404
+ return input.replace(/\\/g, "/");
405
+ }
401
406
 
402
407
  export function normalizePathLikeInput(input: string): string {
403
408
  return stripOuterDoubleQuotes(input.trim());
@@ -582,19 +587,20 @@ export interface ResolvedMultiFindPattern {
582
587
  targets: ResolvedFindTarget[];
583
588
  scopePath: string;
584
589
  }
585
-
586
- /**
587
- * Split a user path into a base path + glob pattern for tools that delegate to
588
- * APIs accepting separate `path` and `glob` arguments.
589
- */
590
590
  export function parseSearchPath(filePath: string): ParsedSearchPath {
591
- const normalizedPath = filePath.replace(/\\/g, "/");
592
- if (!hasGlobPathChars(normalizedPath)) {
593
- return { basePath: filePath };
591
+ const normalizedPath = normalizePathSeparators(filePath);
592
+ const segments = normalizedPath.split("/");
593
+ let firstGlobIndex = -1;
594
+ for (let i = 0; i < segments.length; i++) {
595
+ if (hasGlobPathChars(segments[i])) {
596
+ firstGlobIndex = i;
597
+ break;
598
+ }
594
599
  }
595
600
 
596
- const segments = normalizedPath.split("/");
597
- const firstGlobIndex = segments.findIndex(segment => hasGlobPathChars(segment));
601
+ if (firstGlobIndex === -1) {
602
+ return { basePath: normalizedPath };
603
+ }
598
604
 
599
605
  if (firstGlobIndex <= 0) {
600
606
  return { basePath: ".", glob: normalizedPath };
@@ -617,7 +623,7 @@ export async function parseSearchPathPreferringLiteral(filePath: string, cwd: st
617
623
  if (!hasGlobPathChars(filePath) || isInternalUrlPath(filePath)) return parseSearchPath(filePath);
618
624
  try {
619
625
  await fs.promises.stat(resolveToCwd(filePath, cwd));
620
- return { basePath: filePath };
626
+ return { basePath: normalizePathSeparators(filePath) };
621
627
  } catch {
622
628
  return parseSearchPath(filePath);
623
629
  }
@@ -632,7 +638,8 @@ export async function parseSearchPathPreferringLiteral(filePath: string, cwd: st
632
638
  // /abs/path/**/\*.ts -> { basePath: "/abs/path", globPattern: "**/*.ts", hasGlob: true }
633
639
  // src/app -> { basePath: "src/app", globPattern: "**/*", hasGlob: false }
634
640
  export function parseFindPattern(pattern: string): ParsedFindPattern {
635
- const segments = pattern.split("/");
641
+ const normalizedPattern = normalizePathSeparators(pattern);
642
+ const segments = normalizedPattern.split("/");
636
643
  let firstGlobIndex = -1;
637
644
  for (let i = 0; i < segments.length; i++) {
638
645
  if (hasGlobPathChars(segments[i])) {
@@ -642,14 +649,14 @@ export function parseFindPattern(pattern: string): ParsedFindPattern {
642
649
  }
643
650
 
644
651
  if (firstGlobIndex === -1) {
645
- return { basePath: pattern, globPattern: "**/*", hasGlob: false };
652
+ return { basePath: normalizedPattern, globPattern: "**/*", hasGlob: false };
646
653
  }
647
654
 
648
655
  if (firstGlobIndex === 0) {
649
- const needsRecursive = !pattern.startsWith("**/");
656
+ const needsRecursive = !normalizedPattern.startsWith("**/");
650
657
  return {
651
658
  basePath: ".",
652
- globPattern: needsRecursive ? `**/${pattern}` : pattern,
659
+ globPattern: needsRecursive ? `**/${normalizedPattern}` : normalizedPattern,
653
660
  hasGlob: true,
654
661
  };
655
662
  }