@oh-my-pi/pi-coding-agent 3.33.0 → 3.34.0

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 (67) hide show
  1. package/CHANGELOG.md +34 -9
  2. package/docs/custom-tools.md +1 -1
  3. package/docs/extensions.md +4 -4
  4. package/docs/hooks.md +2 -2
  5. package/docs/sdk.md +4 -8
  6. package/examples/custom-tools/README.md +2 -2
  7. package/examples/extensions/README.md +1 -1
  8. package/examples/extensions/todo.ts +1 -1
  9. package/examples/hooks/custom-compaction.ts +4 -2
  10. package/examples/hooks/handoff.ts +1 -1
  11. package/examples/hooks/qna.ts +1 -1
  12. package/examples/sdk/02-custom-model.ts +1 -1
  13. package/examples/sdk/README.md +1 -1
  14. package/package.json +5 -5
  15. package/src/capability/ssh.ts +42 -0
  16. package/src/cli/file-processor.ts +1 -1
  17. package/src/cli/list-models.ts +1 -1
  18. package/src/core/agent-session.ts +19 -5
  19. package/src/core/auth-storage.ts +1 -1
  20. package/src/core/compaction/branch-summarization.ts +2 -2
  21. package/src/core/compaction/compaction.ts +2 -2
  22. package/src/core/compaction/utils.ts +1 -1
  23. package/src/core/custom-tools/types.ts +1 -1
  24. package/src/core/extensions/runner.ts +1 -1
  25. package/src/core/extensions/types.ts +1 -1
  26. package/src/core/extensions/wrapper.ts +1 -1
  27. package/src/core/hooks/runner.ts +2 -2
  28. package/src/core/hooks/types.ts +1 -1
  29. package/src/core/index.ts +11 -0
  30. package/src/core/messages.ts +1 -1
  31. package/src/core/model-registry.ts +1 -1
  32. package/src/core/model-resolver.ts +7 -6
  33. package/src/core/sdk.ts +26 -2
  34. package/src/core/session-manager.ts +1 -1
  35. package/src/core/ssh/connection-manager.ts +466 -0
  36. package/src/core/ssh/ssh-executor.ts +190 -0
  37. package/src/core/ssh/sshfs-mount.ts +162 -0
  38. package/src/core/ssh-executor.ts +5 -0
  39. package/src/core/system-prompt.ts +424 -1
  40. package/src/core/title-generator.ts +2 -2
  41. package/src/core/tools/index.test.ts +1 -0
  42. package/src/core/tools/index.ts +3 -0
  43. package/src/core/tools/output.ts +1 -1
  44. package/src/core/tools/read.ts +24 -11
  45. package/src/core/tools/renderers.ts +2 -0
  46. package/src/core/tools/ssh.ts +302 -0
  47. package/src/core/tools/task/index.ts +1 -1
  48. package/src/core/tools/task/types.ts +1 -1
  49. package/src/core/tools/task/worker.ts +1 -1
  50. package/src/core/voice.ts +1 -1
  51. package/src/discovery/index.ts +3 -0
  52. package/src/discovery/ssh.ts +162 -0
  53. package/src/main.ts +1 -1
  54. package/src/modes/interactive/components/assistant-message.ts +1 -1
  55. package/src/modes/interactive/components/custom-message.ts +1 -1
  56. package/src/modes/interactive/components/footer.ts +1 -1
  57. package/src/modes/interactive/components/hook-message.ts +1 -1
  58. package/src/modes/interactive/components/model-selector.ts +1 -1
  59. package/src/modes/interactive/components/oauth-selector.ts +1 -1
  60. package/src/modes/interactive/components/status-line.ts +1 -1
  61. package/src/modes/interactive/interactive-mode.ts +1 -1
  62. package/src/modes/print-mode.ts +1 -1
  63. package/src/modes/rpc/rpc-client.ts +1 -1
  64. package/src/modes/rpc/rpc-types.ts +1 -1
  65. package/src/prompts/system-prompt.md +4 -0
  66. package/src/prompts/tools/ssh.md +74 -0
  67. package/src/utils/image-resize.ts +1 -1
@@ -0,0 +1,74 @@
1
+ Execute commands on remote SSH hosts.
2
+
3
+ ## Critical: Match Commands to Host Shell
4
+
5
+ Each host runs a specific shell. **You MUST use commands native to that shell.**
6
+
7
+ ### Command Reference
8
+
9
+ **linux/bash, linux/zsh, macos/bash, macos/zsh** — Unix-like systems:
10
+ - Files: `ls`, `cat`, `head`, `tail`, `grep`, `find`
11
+ - System: `ps`, `top`, `df`, `uname`, `free` (Linux), `df`, `uname`, `top` (macOS)
12
+ - Navigation: `cd`, `pwd`
13
+
14
+ **windows/bash, windows/sh** — Windows with Unix compatibility layer (WSL, Cygwin, Git Bash):
15
+ - Files: `ls`, `cat`, `head`, `tail`, `grep`, `find`
16
+ - System: `ps`, `top`, `df`, `uname`
17
+ - Navigation: `cd`, `pwd`
18
+ - Note: These are Windows hosts but use Unix commands
19
+
20
+ **windows/powershell** — Native Windows PowerShell:
21
+ - Files: `Get-ChildItem`, `Get-Content`, `Select-String`
22
+ - System: `Get-Process`, `Get-ComputerInfo`
23
+ - Navigation: `Set-Location`, `Get-Location`
24
+
25
+ **windows/cmd** — Native Windows Command Prompt:
26
+ - Files: `dir`, `type`, `findstr`, `where`
27
+ - System: `tasklist`, `systeminfo`
28
+ - Navigation: `cd`, `echo %CD%`
29
+
30
+ ## Execution Pattern
31
+
32
+ 1. Check the host's shell type from "Available hosts" below
33
+ 2. Use ONLY commands for that shell type
34
+ 3. Construct your command using the reference above
35
+
36
+ ## Examples
37
+
38
+ <example>
39
+ Task: List files in /home/user on host "server1"
40
+ Host: server1 (10.0.0.1) | linux/bash
41
+ Command: `ls -la /home/user`
42
+ </example>
43
+
44
+ <example>
45
+ Task: Show running processes on host "winbox"
46
+ Host: winbox (192.168.1.5) | windows/cmd
47
+ Command: `tasklist /v`
48
+ </example>
49
+
50
+ <example>
51
+ Task: Check disk usage on host "wsl-dev"
52
+ Host: wsl-dev (192.168.1.10) | windows/bash
53
+ Command: `df -h`
54
+ Note: Windows host with WSL — use Unix commands
55
+ </example>
56
+
57
+ <example>
58
+ Task: Get system info on host "macbook"
59
+ Host: macbook (10.0.0.20) | macos/zsh
60
+ Command: `uname -a && sw_vers`
61
+ </example>
62
+
63
+ ## Parameters
64
+
65
+ - **host**: Host name from "Available hosts" below
66
+ - **command**: Command to execute (see Command Reference above)
67
+ - **cwd**: Working directory (optional)
68
+ - **timeout**: Timeout in seconds (optional)
69
+
70
+ ## Output
71
+
72
+ Truncated at 50KB. Exit codes captured.
73
+
74
+ **Before executing: verify host shell type below and use matching commands.**
@@ -1,4 +1,4 @@
1
- import type { ImageContent } from "@mariozechner/pi-ai";
1
+ import type { ImageContent } from "@oh-my-pi/pi-ai";
2
2
  import { getImageDimensionsWithImageMagick, resizeWithImageMagick } from "./image-magick.js";
3
3
 
4
4
  export interface ImageResizeOptions {