hiiro 0.1.299 → 0.1.301

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: f6adcb250dc950c9cf8ff1c6c0ad043cb40f1088a81369fe44f5ebef5dfb0098
4
- data.tar.gz: ea797738c121e4b8ba16a184a9f9614d624a4724412068fe12f05542ff0d6a91
3
+ metadata.gz: eddeaacae610f11d820f5e40cc9793a5acb22c1c52fd56f06c7a8cc630af0345
4
+ data.tar.gz: b29d5ad2aea54d91c613cecb4067138eef8449457ee6f33327fd057d1a83d9e0
5
5
  SHA512:
6
- metadata.gz: 72642cfd9f9159ef3f423793990b34eabbc9b904f22276b4f282416ff639fbfeda6d600ffca7f2c0948436ed8817f09a41b4ab4a2ca9c516393b4883c079cfce
7
- data.tar.gz: 60e5258472d103050ea9d9d145c6cb228c07f2e520cd222a47bcb614384c1744fbe762c1345f1ace55ceb91b9746237b7b6a011e6affe6da3ddcccab7bf589a1
6
+ metadata.gz: 5e8341fafcb812fb200829d62ecc2a9ac0878c203c9121eecfee3fbb9891b2245278e52202b7b9e6b66adc771882de98cb9b29df95a63e2f959899c7dc3b790a
7
+ data.tar.gz: c0d5ae46f2acc4032f3bff7980e110e2835b871dfe05c4e07cf93f822132ce3acaf2aa924be89326b55cc229d238ffd32d6ab71f1937851bed4bc35887ba4871
data/CHANGELOG.md CHANGED
@@ -1,80 +1 @@
1
- ```markdown
2
- ## v0.1.299 (2026-03-27)
3
-
4
- ### Added
5
- - `bin/h-pr open`: now supports opening multiple PRs in sequence (e.g., `h pr open 123 456`)
6
-
7
- ### Changed
8
- - `bin/h-claude`: simplified directory traversal and file globbing logic for better maintainability
9
-
10
- ## v0.1.298 (2026-03-27)
11
-
12
- ### Changed
13
- - `Hiiro::Config`: now uses `Pathname` to walk up the directory tree instead of string manipulation for better robustness
14
- - `h cl agents/commands/skills`: now walks from current working directory up to home directory to locate agent/command/skill files
15
-
16
- ## v0.1.297 (2026-03-27)
17
-
18
- ### Added
19
- - `bin/h-rnext`: new subcommand for navigating to the next Ruby file in the current directory
20
-
21
- ## v0.1.296 (2026-03-27)
22
-
23
- ### Changed
24
- - `Hiiro::Git::Pr`: added `red?`, `green?`, `pending?`, `active?`, `drafts?`, `conflicts?` predicate methods and `matches_filters?(opts, forced: [])` — filter logic now lives on the `Pr` object instead of in `PinnedPRManager` lambdas
25
- - `PinnedPRManager`: removed `FILTER_PREDICATES` constant; `apply_filters` and `filter_active?` now delegate to `Pr#matches_filters?`
26
-
27
- ## v0.1.295 (2026-03-26)
28
-
29
- ### Changed
30
- - `h pr ls`/`h pr update`: filter flags now use AND-across-dimensions logic — state flags (`-o`, `-m`, `-D`, `-c`) OR within their group, check flags (`-r`, `-g`, `-p`) OR within theirs, and the two groups AND together; e.g. `-o -g` shows open PRs with passing checks, `-o -r -g` shows open PRs with failing or passing checks
31
-
32
- ## v0.1.294 (2026-03-26)
33
-
34
- ### Fixed
35
- - `h pr ls`/`h pr update`: filter flags (`-r`, `-g`, `-p`, etc.) from `pm.add_options` now register correctly; switched from `pm.add_options(self)` inside implicit `instance_eval` block to explicit block parameter `|o|` with `pm.add_options(o)`, matching the pattern already used by `h pr green`/`red`/`old`
36
-
37
- ## v0.1.293 (2026-03-26)
38
-
39
- ### Changed
40
- - `h pr update`: filter options now extracted to `PinnedPRManager` for better code organization and reusability
41
-
42
- ## v0.1.292 (2026-03-26)
43
-
44
- ### Added
45
- - `h pr update`: now accepts filter flags (`--active`, `--failing`, `--ready`, `--all`) to control which PRs are refreshed and displayed after update
46
-
47
- ## v0.1.291 (2026-03-26)
48
-
49
- ### Added
50
- - `Options#mutual_exclusion(*names)` — star-topology mutual exclusion: first flag is the hub (clears all others when set); any other flag only clears the hub (spokes can coexist freely); last encountered in argv wins
51
- - `h pr ls`: new `--all`/`-a` flag (show all tracked PRs, no filter); all filter flags are declared mutually exclusive so `-oa`, `-ao`, `--all --active` etc. do the right thing
52
- - `h pr update`: now accepts the same filter flags as `h pr ls` and passes them through, so `h pr update -r` refreshes then shows only failing PRs
53
-
54
- ## v0.1.290 (2026-03-26)
55
-
56
- ### Fixed
57
- - `h pr ls`/`h pr update`: revert `statusCheckRollup` contexts limit to 100 and add pagination to retrieve all checks beyond the first 100; GitHub's GraphQL API silently returns null when limit is exceeded, causing all checks to vanish
58
-
59
- ## v0.1.289 (2026-03-26)
60
-
61
- ### Fixed
62
- - `h queue run`/`watch`: frontmatter `session_name` now directly controls which tmux session the task launches in; working directory seeded from that session's active pane when no tree is specified
63
- - `h queue sadd`: now immediately launches a new tmux window in the target session after adding to queue, consistent with `hadd`/`vadd` behavior (previously just added to pending with no launch)
64
- - `h pr ls`: revert `statusCheckRollup` contexts limit from 250 back to 100; GitHub's GraphQL API caps connections at 100 — exceeding it silently returns null for the entire field, causing all checks to vanish from the list
65
- - `h pr update`: paginate beyond the first 100 checks for PRs that hit the limit; show `❓` status for PRs where pagination still couldn't retrieve all checks
66
-
67
- ## v0.1.288 (2026-03-26)
68
-
69
- ### Fixed
70
- - `h pr ls` / `h pr update`: PRs with >100 checks now show accurate status. GraphQL query was using `contexts(last: 100)`, truncating check runs for PRs with 100+ checks and silently dropping failures that happened to fall outside the window. Increased limit to 250.
71
-
72
- ## v0.1.287 (2026-03-26)
73
-
74
- ### Added
75
- - `h pr status`: show current branch PR checks summary (failures, pending, success counts)
76
- - `h todo`: fuzzyfinder fallback for item selection when no exact match
77
-
78
- ### Changed
79
- - PR list now shows pending indicator alongside failures
80
- ```
1
+ Done. Updated CHANGELOG.md to consolidate all changes for v0.1.301 (check_version, delayed_update, h-claude verbose flags and glob_path refactor, and tmux session matching fixes) into a single release entry organized by Added/Changed/Fixed.
data/bin/h-claude CHANGED
@@ -15,6 +15,54 @@ opts = Hiiro::Options.setup {
15
15
  option(:size, short: :s, default: nil)
16
16
  }
17
17
 
18
+ tool_opts = Hiiro::Options.setup {
19
+ flag(:full, short: :f, default: false, desc: 'fulltext search - full grep file or dir')
20
+ flag(:verbose, short: :v, default: false, desc: 'display claude dirs in stderr')
21
+ flag(:veryverbose, short: :V, default: false, desc: 'display all stderr messages')
22
+ }
23
+
24
+ def glob_path(glob, bname=nil, opts:)
25
+ filters = opts.args
26
+ fulltext = opts.full
27
+ bname ||= ''
28
+ filters ||= []
29
+ filters = ['.*'] if filters.empty?
30
+
31
+ claude_paths.map { |path|
32
+ [
33
+ path.split&.first,
34
+ path.glob(glob),
35
+ ]
36
+ }.each do |path, fs|
37
+ next if fs.empty?
38
+
39
+ $stderr.puts if opts.verbose || opts.veryverbose
40
+ $stderr.puts "PATH: #{path}" if opts.verbose || opts.veryverbose
41
+
42
+ re_s = filters.join(?|)
43
+ re = Regexp.new(re_s)
44
+ fs.each do |f|
45
+ more_args = f.file? ? [] : ['-r']
46
+ cmd = ['egrep', *more_args, '-m1', re_s, f.to_s]
47
+ kwcmd = { out: File.open('/dev/null', 'w') }
48
+ base_f = f.basename(bname)
49
+
50
+ matches =
51
+ if fulltext
52
+ system(*cmd, **kwcmd)
53
+ else
54
+ base_f.to_s.match?(re)
55
+ end
56
+
57
+ if matches
58
+ puts base_f
59
+ else
60
+ $stderr.puts "SKIPPING #{base_f}" if opts.veryverbose
61
+ end
62
+ end
63
+ end
64
+ end
65
+
18
66
  def permission_flag(opts)
19
67
  opts.danger ? '--dangerously-skip-permissions' : '--allow-dangerously-skip-permissions'
20
68
  end
@@ -103,16 +151,26 @@ add_subcmd(:env) { |*args|
103
151
  IO.popen(['claude', '-p'], 'w') { |io| io.write(prompt) }
104
152
  }
105
153
 
106
- add_subcmd(:agents) {
107
- puts claude_paths.flat_map { |p| p.glob('agents/*.md').map { |f| f.basename('.md') } }
154
+ add_subcmd(:all) { |*args|
155
+ opts = tool_opts.parse(args)
156
+ glob_path('agents/*.md', '.md', opts: opts)
157
+ glob_path('commands/*.md', '.md', opts: opts)
158
+ glob_path('skills/*/', opts: opts)
159
+ }
160
+
161
+ add_subcmd(:agents) { |*args|
162
+ opts = tool_opts.parse(args)
163
+ glob_path('agents/*.md', '.md', opts: opts)
108
164
  }
109
165
 
110
- add_subcmd(:commands) {
111
- puts claude_paths.flat_map { |p| p.glob('commands/*.md').map { |f| f.basename('.md') } }
166
+ add_subcmd(:commands) { |*args|
167
+ opts = tool_opts.parse(args)
168
+ glob_path('commands/*.md', '.md', opts: opts)
112
169
  }
113
170
 
114
- add_subcmd(:skills) {
115
- puts claude_paths.flat_map { |p| p.glob('skills/*/').map { |d| d.basename } }
171
+ add_subcmd(:skills) { |*args|
172
+ opts = tool_opts.parse(args)
173
+ glob_path('skills/*/', opts: opts)
116
174
  }
117
175
 
118
176
  add_subcmd(:new) { |*args|
data/exe/h CHANGED
@@ -165,6 +165,59 @@ Hiiro.run(*ARGV, cwd: Dir.pwd, tasks: true) do
165
165
  Hiiro::AppFiles.build_hiiro(this, af, environment: environment).run
166
166
  end
167
167
 
168
+ add_subcmd(:check_version) do |*args|
169
+ opts = Hiiro::Options.setup {
170
+ flag(:all, short: :a, desc: 'Check all rbenv versions')
171
+ }.parse!(args)
172
+
173
+ expected = opts.args.first
174
+ versions = opts.all ? Hiiro::Rbenv.versions : [Hiiro::Rbenv.current_version]
175
+
176
+ mismatched = 0
177
+ versions.each do |ver|
178
+ output = Hiiro::Rbenv.capture('gem', 'list', 'hiiro', '--exact', version: ver)
179
+ actual = output.match(/hiiro \(([^)]+)\)/)&.captures&.first
180
+ ok = expected.nil? || actual == expected
181
+ mismatched += 1 unless ok
182
+ status = ok ? "\e[32m✓\e[0m" : "\e[31m✗\e[0m"
183
+ puts " #{status} ruby #{ver}: hiiro #{actual || '(not installed)'}"
184
+ end
185
+
186
+ exit(mismatched == 0 ? 0 : 1)
187
+ end
188
+
189
+ add_subcmd(:delayed_update) do |*args|
190
+ expected = args.first
191
+ unless expected
192
+ puts "Usage: h delayed_update <expected_version>"
193
+ next
194
+ end
195
+
196
+ script = <<~RUBY
197
+ #!/usr/bin/env ruby
198
+ expected = #{expected.inspect}
199
+ sleep 5
200
+ system('h', 'update', '-a')
201
+ versions = `rbenv versions --bare`.lines(chomp: true)
202
+ mismatched = versions.reject do |ver|
203
+ output = `RBENV_VERSION=\#{ver} rbenv exec gem list hiiro --exact 2>/dev/null`
204
+ output.match?(/hiiro \\(#{Regexp.escape(expected)}\\)/)
205
+ end
206
+ if mismatched.empty?
207
+ system('say', 'hiiro updated')
208
+ elsif mismatched.size == versions.size
209
+ system('say', 'no versions updated')
210
+ else
211
+ system('say', "\#{mismatched.size} version\#{mismatched.size == 1 ? '' : 's'} not updated")
212
+ end
213
+ RUBY
214
+
215
+ path = "/tmp/h-delayed-update-#{$$}.rb"
216
+ File.write(path, script)
217
+ FileUtils.chmod(0755, path)
218
+ system('h', 'bg', 'run', path)
219
+ end
220
+
168
221
  add_subcmd(:rnext) do |*args|
169
222
  system('git', 'rnext', *args)
170
223
  end
data/lib/hiiro/tasks.rb CHANGED
@@ -139,7 +139,7 @@ class Hiiro
139
139
 
140
140
  Dir.chdir(base_dir)
141
141
  # Create the session detached first so colors are applied before the user attaches
142
- unless system('tmux', 'has-session', '-t', session_name, err: File::NULL)
142
+ unless system('tmux', 'has-session', '-t', "=#{session_name}", err: File::NULL)
143
143
  system('tmux', 'new-session', '-d', '-s', session_name, '-c', Dir.pwd)
144
144
  end
145
145
  Hiiro::TaskColors.apply(session_name, color_index)
@@ -158,7 +158,7 @@ class Hiiro
158
158
  tree_path = tree ? tree.path : File.join(Hiiro::WORK_DIR, task.tree_name)
159
159
 
160
160
  session_name = task.session_name
161
- session_exists = system('tmux', 'has-session', '-t', session_name, err: File::NULL)
161
+ session_exists = system('tmux', 'has-session', '-t', "=#{session_name}", err: File::NULL)
162
162
 
163
163
  if session_exists
164
164
  session = environment.find_session(session_name)
@@ -178,7 +178,7 @@ class Hiiro
178
178
  if Dir.exist?(base_dir)
179
179
  Dir.chdir(base_dir)
180
180
  # Create detached first so colors are applied before the user attaches
181
- unless system('tmux', 'has-session', '-t', session_name, err: File::NULL)
181
+ unless system('tmux', 'has-session', '-t', "=#{session_name}", err: File::NULL)
182
182
  system('tmux', 'new-session', '-d', '-s', session_name, '-c', Dir.pwd)
183
183
  end
184
184
  Hiiro::TaskColors.apply(session_name, task.color_index) if task.color_index
@@ -1480,7 +1480,7 @@ class Hiiro
1480
1480
 
1481
1481
  def find_session(abbreviated)
1482
1482
  return nil if abbreviated.nil?
1483
- session_matcher.find(abbreviated).first&.item
1483
+ session_matcher.find(abbreviated).resolved&.item
1484
1484
  end
1485
1485
 
1486
1486
  def find_app(abbreviated)
@@ -74,14 +74,14 @@ class Hiiro
74
74
 
75
75
  def select
76
76
  if ENV['TMUX']
77
- system('tmux', 'switch-client', '-t', name)
77
+ system('tmux', 'switch-client', '-t', "=#{name}")
78
78
  else
79
- system('tmux', 'attach-session', '-t', name)
79
+ system('tmux', 'attach-session', '-t', "=#{name}")
80
80
  end
81
81
  end
82
82
 
83
83
  def attach
84
- system('tmux', 'attach-session', '-t', name)
84
+ system('tmux', 'attach-session', '-t', "=#{name}")
85
85
  end
86
86
 
87
87
  def detach
data/lib/hiiro/tmux.rb CHANGED
@@ -108,7 +108,11 @@ class Hiiro
108
108
  def find_session(name)
109
109
  normalized = name.to_s.tr('.', '_')
110
110
  sessions.find { |s| s.name == normalized } ||
111
- Matcher.by_prefix(sessions.map(&:name), normalized)&.resolved&.then { |m| sessions.find { |s| s.name == m.item } }
111
+ Matcher.by_prefix(sessions.map(&:name), normalized)&.resolved&.then do |m|
112
+ # Don't cross path boundaries: 'oncall' must not match 'oncall/posoi'
113
+ next nil if m.item.length > normalized.length && m.item[normalized.length] == '/'
114
+ sessions.find { |s| s.name == m.item }
115
+ end
112
116
  end
113
117
 
114
118
  def session_exists?(name)
data/lib/hiiro/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  class Hiiro
2
- VERSION = "0.1.299"
2
+ VERSION = "0.1.301"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: hiiro
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.299
4
+ version: 0.1.301
5
5
  platform: ruby
6
6
  authors:
7
7
  - Joshua Toyota