hiiro 0.1.338 → 0.1.339
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.
- checksums.yaml +4 -4
- data/CHANGELOG.md +9 -1
- data/bin/h-pr +21 -2
- data/bin/h-ps +15 -0
- data/lib/hiiro/ps_process.rb +16 -0
- data/lib/hiiro/tasks.rb +16 -0
- data/lib/hiiro/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: bcaeb672d1c537efc87a229a1db28b61533c42507dc9418732297d0564cb0903
|
|
4
|
+
data.tar.gz: 8d90d568d5a7d4b601a267deb60039c74acec7b1151fe1026dac06f60669bdf1
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 43edf56c4056bb07b893c6c93a7b34cf2ea760d52f94f8c243835250c3bcf3c508a61ec3e7ab835d61808e8fc87bf4a400d9387a5afbe4e660c7ca32f30d084a
|
|
7
|
+
data.tar.gz: 63a2754cfebf1a3fba0d6145d9abd7df41b8b2d90a6a0342f2da9d23a9a3674bde800bce9b000d9de587e5de7e01ef7f7f0e7345f76a319c06b53895463067bf
|
data/CHANGELOG.md
CHANGED
|
@@ -1,8 +1,16 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [0.1.339] - 2026-04-07
|
|
4
|
+
|
|
5
|
+
### Added
|
|
6
|
+
- `h ps byport <port> [port2 ...]` — find processes listening on specified port(s)
|
|
7
|
+
- `PsProcess.by_port(*ports)` — query processes by listening port numbers
|
|
8
|
+
- `h task switch` now matches ~/proj/* directories by prefix as fallback when task name doesn't match
|
|
9
|
+
|
|
3
10
|
## [0.1.338] - 2026-04-07
|
|
4
11
|
|
|
5
12
|
### Changed
|
|
13
|
+
- `h pr watch`, `h pr fwatch`, `h pr check` now default to current branch's PR (use `-s` to select via fuzzyfinder)
|
|
6
14
|
- Renamed `registry_entries` table to `registry` (auto-migrates existing data)
|
|
7
15
|
|
|
8
16
|
## [0.1.337] - 2026-04-06
|
|
@@ -316,4 +324,4 @@
|
|
|
316
324
|
- `bin/h-link` — reads/writes links via `Hiiro::Link` SQLite model with YAML dual-write fallback; adds `q`/`query` subcommands
|
|
317
325
|
- `bin/h-pane` — load/save pane homes via `Hiiro::PaneHome` model with YAML dual-write
|
|
318
326
|
- `bin/h-pr` — adds `q`/`query` subcommands for inspecting PR records via raw SQL
|
|
319
|
-
- `plugins/pins.rb` — `Pin` class reads/writes via `Hiiro::PinRecord` SQLite model with YAML dual-write fallback
|
|
327
|
+
- `plugins/pins.rb` — `Pin` class reads/writes via `Hiiro::PinRecord` SQLite model with YAML dual-write fallback
|
data/bin/h-pr
CHANGED
|
@@ -11,11 +11,30 @@ Hiiro.run(*ARGV, plugins: [Pins]) do
|
|
|
11
11
|
pm = pinned_manager = Hiiro::PinnedPRManager.new
|
|
12
12
|
Hiiro::PinnedPRManager.add_resolvers(self)
|
|
13
13
|
|
|
14
|
-
watch_block = ->(
|
|
14
|
+
watch_block = ->(*all_args) {
|
|
15
|
+
opts = Hiiro::Options.setup {
|
|
16
|
+
option(:select, short: :s, type: :flag, desc: 'Select PR via fuzzyfinder')
|
|
17
|
+
}.parse(all_args)
|
|
18
|
+
|
|
19
|
+
original_pr_number = opts.args.first
|
|
20
|
+
watch_args = opts.args[1..] || []
|
|
15
21
|
watch = get_value(:watch)
|
|
16
22
|
fail_fast = get_value(:fail_fast)
|
|
17
23
|
|
|
18
|
-
pr_number =
|
|
24
|
+
pr_number = if opts.select
|
|
25
|
+
resolve(:pr, nil) # triggers fuzzyfinder
|
|
26
|
+
elsif original_pr_number
|
|
27
|
+
resolve(:pr, original_pr_number)
|
|
28
|
+
else
|
|
29
|
+
# Default to current branch's PR
|
|
30
|
+
current_pr = pm.fetch_current_branch_pr
|
|
31
|
+
if current_pr
|
|
32
|
+
current_pr.number.to_s
|
|
33
|
+
else
|
|
34
|
+
STDERR.puts "No PR for current branch. Use -s to select or provide a PR number."
|
|
35
|
+
nil
|
|
36
|
+
end
|
|
37
|
+
end
|
|
19
38
|
return unless pr_number
|
|
20
39
|
|
|
21
40
|
base_cmd = %w[gh pr checks]
|
data/bin/h-ps
CHANGED
|
@@ -20,6 +20,21 @@ Hiiro.run(*ARGV) do
|
|
|
20
20
|
end
|
|
21
21
|
end
|
|
22
22
|
|
|
23
|
+
add_subcmd(:byport) { |*ports|
|
|
24
|
+
if ports.empty?
|
|
25
|
+
puts "Usage: h ps byport <port> [port2 ...]"
|
|
26
|
+
next
|
|
27
|
+
end
|
|
28
|
+
|
|
29
|
+
processes = Hiiro::PsProcess.by_port(*ports)
|
|
30
|
+
|
|
31
|
+
if processes.empty?
|
|
32
|
+
puts "No processes found on port(s): #{ports.join(', ')}"
|
|
33
|
+
else
|
|
34
|
+
processes.each { |p| puts "#{p.pid}\t#{p.dir || '(unknown)'}" }
|
|
35
|
+
end
|
|
36
|
+
}
|
|
37
|
+
|
|
23
38
|
add_subcmd(:search) { |pattern = nil|
|
|
24
39
|
if pattern.nil?
|
|
25
40
|
puts "Usage: h ps search <pattern>"
|
data/lib/hiiro/ps_process.rb
CHANGED
|
@@ -54,6 +54,22 @@ class Hiiro::PsProcess
|
|
|
54
54
|
all.find { |p| p.pid == pid.to_s }
|
|
55
55
|
end
|
|
56
56
|
|
|
57
|
+
# Find processes listening on given port numbers
|
|
58
|
+
def self.by_port(*ports)
|
|
59
|
+
pids = Set.new
|
|
60
|
+
ports.each do |port|
|
|
61
|
+
lsof_output = `lsof -i :#{port.to_i} 2>/dev/null`.lines[1..]
|
|
62
|
+
next unless lsof_output
|
|
63
|
+
|
|
64
|
+
lsof_output.each do |line|
|
|
65
|
+
fields = line.split
|
|
66
|
+
pids << fields[1] if fields[1]
|
|
67
|
+
end
|
|
68
|
+
end
|
|
69
|
+
|
|
70
|
+
all.select { |p| pids.include?(p.pid) }
|
|
71
|
+
end
|
|
72
|
+
|
|
57
73
|
# Find processes with files open in given directories
|
|
58
74
|
def self.in_dirs(*paths)
|
|
59
75
|
pids = Set.new
|
data/lib/hiiro/tasks.rb
CHANGED
|
@@ -964,6 +964,22 @@ class Hiiro
|
|
|
964
964
|
end
|
|
965
965
|
end
|
|
966
966
|
|
|
967
|
+
# If still no task/session found, check ~/proj/* directories by prefix
|
|
968
|
+
unless task
|
|
969
|
+
proj_dirs = Dir.glob(File.expand_path('~/proj/*/'))
|
|
970
|
+
dir_names = proj_dirs.map { |d| File.basename(d) }
|
|
971
|
+
result = Hiiro::Matcher.by_prefix(dir_names, task_name)
|
|
972
|
+
if result.one?
|
|
973
|
+
dir_name = result.first.item
|
|
974
|
+
h.start_tmux_session(dir_name, start_directory: File.expand_path("~/proj/#{dir_name}"))
|
|
975
|
+
puts "Switched to ~/proj/#{dir_name}"
|
|
976
|
+
next
|
|
977
|
+
elsif result.ambiguous?
|
|
978
|
+
puts "Ambiguous match for '#{task_name}': #{result.matches.map(&:item).join(', ')}"
|
|
979
|
+
exit 1
|
|
980
|
+
end
|
|
981
|
+
end
|
|
982
|
+
|
|
967
983
|
tm.switch_to_task(task, app_name: app_name, force: opts.force)
|
|
968
984
|
end
|
|
969
985
|
|
data/lib/hiiro/version.rb
CHANGED