hiiro 0.1.191 → 0.1.193
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/lib/hiiro/queue.rb +9 -8
- data/lib/hiiro/tasks.rb +24 -5
- data/lib/hiiro/tmux.rb +2 -2
- data/lib/hiiro/version.rb +1 -1
- metadata +6 -3
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 86964aa974dac110a631a4e226a8bc07eafd0b6e460c520637bf0a464a28114f
|
|
4
|
+
data.tar.gz: c0afb0b932a43d7f93f17832a453d69a799d6992ad91892cca824298d23b2c28
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: d9fefad6d1320023865f6beeaffc0076ce1284caf8a39393abdd8e5d3df8e4ff0682961a5cac293070d50f22767266d368926c43ea8cade165bfaeffdaae3da3
|
|
7
|
+
data.tar.gz: dc09cf57deb1c146b9a82fe78ab2a31dad8a272050a2ebfd79dd0ccbb6ff828ab7c1f265239b5945331962e5a15e4a05280d025a2685fdf14f8fb0c5bb600519
|
data/lib/hiiro/queue.rb
CHANGED
|
@@ -116,7 +116,7 @@ class Hiiro
|
|
|
116
116
|
|
|
117
117
|
# Write a clean prompt file (no frontmatter) for claude
|
|
118
118
|
raw = File.read(running_md).strip
|
|
119
|
-
prompt_body = prompt_obj ? prompt_obj.doc.content.strip : strip_frontmatter(raw)
|
|
119
|
+
prompt_body = prompt_obj ? strip_frontmatter(prompt_obj.doc.content.strip) : strip_frontmatter(raw)
|
|
120
120
|
prompt_file = File.join(dirs[:running], "#{name}.prompt")
|
|
121
121
|
File.write(prompt_file, prompt_body + "\n")
|
|
122
122
|
|
|
@@ -419,10 +419,7 @@ class Hiiro
|
|
|
419
419
|
|
|
420
420
|
h.add_subcmd(:session) {
|
|
421
421
|
work_dir = File.expand_path('~/work')
|
|
422
|
-
|
|
423
|
-
system('tmux', 'new-session', '-d', '-s', TMUX_SESSION, '-c', work_dir)
|
|
424
|
-
end
|
|
425
|
-
system('tmux', 'switch-client', '-t', TMUX_SESSION)
|
|
422
|
+
Tmux.open_session(TMUX_SESSION, start_directory: work_dir)
|
|
426
423
|
}
|
|
427
424
|
|
|
428
425
|
h.add_subcmd(:add) { |*args|
|
|
@@ -454,7 +451,9 @@ class Hiiro
|
|
|
454
451
|
|
|
455
452
|
tmpfile.close
|
|
456
453
|
editor = ENV['EDITOR'] || 'vim'
|
|
457
|
-
|
|
454
|
+
editor_args = [editor]
|
|
455
|
+
editor_args << '+$' if editor.include?('vim')
|
|
456
|
+
system(*editor_args, tmpfile.path)
|
|
458
457
|
content = File.read(tmpfile.path).strip
|
|
459
458
|
tmpfile.unlink
|
|
460
459
|
if content.empty?
|
|
@@ -463,7 +462,7 @@ class Hiiro
|
|
|
463
462
|
end
|
|
464
463
|
end
|
|
465
464
|
|
|
466
|
-
result = q.add_with_frontmatter(content, task_info:)
|
|
465
|
+
result = q.add_with_frontmatter(content, task_info: ti)
|
|
467
466
|
if result
|
|
468
467
|
puts "Created: #{result[:path]}"
|
|
469
468
|
else
|
|
@@ -509,7 +508,9 @@ class Hiiro
|
|
|
509
508
|
end
|
|
510
509
|
end
|
|
511
510
|
|
|
512
|
-
|
|
511
|
+
editor_args = [editor]
|
|
512
|
+
editor_args << '+$' if editor.include?('vim')
|
|
513
|
+
system(*editor_args, path)
|
|
513
514
|
}
|
|
514
515
|
|
|
515
516
|
h.add_subcmd(:ready) { |name = nil|
|
data/lib/hiiro/tasks.rb
CHANGED
|
@@ -185,17 +185,21 @@ class Hiiro
|
|
|
185
185
|
puts "#{label}:"
|
|
186
186
|
puts
|
|
187
187
|
|
|
188
|
+
# Build a session→tty map once so we can show which terminal tab each session
|
|
189
|
+
# is attached in (e.g. "@s000" for Ghostty tab using ttys000).
|
|
190
|
+
client_map = TmuxSession.client_map
|
|
191
|
+
|
|
188
192
|
# Collect rows as {prefix, name, tree, branch, session} so we can
|
|
189
193
|
# compute max column widths before rendering.
|
|
190
194
|
rows = []
|
|
191
195
|
items.each do |task|
|
|
192
196
|
marker = (current && current.name == task.name) ? "*" : " "
|
|
193
|
-
rows << { prefix: "#{marker} ", **task.display_data(scope: scope, environment: environment) }
|
|
197
|
+
rows << { prefix: "#{marker} ", **task.display_data(scope: scope, environment: environment, client_map: client_map) }
|
|
194
198
|
|
|
195
199
|
if scope == :task
|
|
196
200
|
subtasks(task).each do |st|
|
|
197
201
|
sub_marker = (current && current.name == st.name) ? "*" : " "
|
|
198
|
-
rows << { prefix: "#{sub_marker} - ", **st.display_data(scope: :subtask, environment: environment) }
|
|
202
|
+
rows << { prefix: "#{sub_marker} - ", **st.display_data(scope: :subtask, environment: environment, client_map: client_map) }
|
|
199
203
|
end
|
|
200
204
|
end
|
|
201
205
|
end
|
|
@@ -233,7 +237,9 @@ class Hiiro
|
|
|
233
237
|
puts
|
|
234
238
|
extra_name_col = [extra_sessions.map { |s| s.name.length }.max, name_col].max
|
|
235
239
|
extra_sessions.sort_by(&:name).each do |session|
|
|
236
|
-
|
|
240
|
+
tty = client_map[session.name]
|
|
241
|
+
suffix = tty ? " @#{tty.sub('ttys', 's')}" : ""
|
|
242
|
+
puts format(" %-#{extra_name_col}s (tmux session%s)", session.name, suffix)
|
|
237
243
|
end
|
|
238
244
|
end
|
|
239
245
|
end
|
|
@@ -885,6 +891,16 @@ class Hiiro
|
|
|
885
891
|
output.lines(chomp: true).map { |name| new(name) }
|
|
886
892
|
end
|
|
887
893
|
|
|
894
|
+
# Returns { session_name => "ttysXXX" } for sessions with attached clients.
|
|
895
|
+
# The tty identifies which terminal tab (e.g. Ghostty tab) the client is in.
|
|
896
|
+
def self.client_map
|
|
897
|
+
output = `tmux list-clients -F '\#{client_tty}|\#{session_name}' 2>/dev/null`
|
|
898
|
+
output.lines(chomp: true).each_with_object({}) do |line, map|
|
|
899
|
+
tty, session = line.split('|', 2)
|
|
900
|
+
map[session] ||= tty.delete_prefix('/dev/')
|
|
901
|
+
end
|
|
902
|
+
end
|
|
903
|
+
|
|
888
904
|
def initialize(name)
|
|
889
905
|
@name = name
|
|
890
906
|
end
|
|
@@ -989,15 +1005,18 @@ class Hiiro
|
|
|
989
1005
|
h
|
|
990
1006
|
end
|
|
991
1007
|
|
|
992
|
-
def display_data(scope: :task, environment:)
|
|
1008
|
+
def display_data(scope: :task, environment:, client_map: {})
|
|
993
1009
|
display_name = (scope == :subtask) ? short_name : name
|
|
994
1010
|
tree = environment.find_tree(tree_name)
|
|
995
1011
|
branch = tree&.branch || (tree&.detached? ? '(detached)' : '(none)')
|
|
1012
|
+
sname = session_name || '(none)'
|
|
1013
|
+
tty = client_map[sname]
|
|
1014
|
+
session_str = tty ? "#{sname} @#{tty.sub('ttys', 's')}" : sname
|
|
996
1015
|
{
|
|
997
1016
|
name: display_name,
|
|
998
1017
|
tree: tree_name || '(none)',
|
|
999
1018
|
branch: "[#{branch}]",
|
|
1000
|
-
session: "(#{
|
|
1019
|
+
session: "(#{session_str})"
|
|
1001
1020
|
}
|
|
1002
1021
|
end
|
|
1003
1022
|
end
|
data/lib/hiiro/tmux.rb
CHANGED
|
@@ -125,12 +125,12 @@ class Hiiro
|
|
|
125
125
|
|
|
126
126
|
def attach_session(name)
|
|
127
127
|
resolved = find_session(name)&.name || name.to_s.tr('.', '_')
|
|
128
|
-
run_system('attach-session', '-t', resolved)
|
|
128
|
+
run_system('attach-session', '-t', "=#{resolved}")
|
|
129
129
|
end
|
|
130
130
|
|
|
131
131
|
def switch_client(name)
|
|
132
132
|
resolved = find_session(name)&.name || name.to_s.tr('.', '_')
|
|
133
|
-
run_system('switch-client', '-t', resolved)
|
|
133
|
+
run_system('switch-client', '-t', "=#{resolved}")
|
|
134
134
|
end
|
|
135
135
|
|
|
136
136
|
def detach_client(session: nil)
|
data/lib/hiiro/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: hiiro
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.1.
|
|
4
|
+
version: 0.1.193
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Joshua Toyota
|
|
8
|
+
autorequire:
|
|
8
9
|
bindir: exe
|
|
9
10
|
cert_chain: []
|
|
10
|
-
date:
|
|
11
|
+
date: 2026-03-10 00:00:00.000000000 Z
|
|
11
12
|
dependencies:
|
|
12
13
|
- !ruby/object:Gem::Dependency
|
|
13
14
|
name: pry
|
|
@@ -185,6 +186,7 @@ metadata:
|
|
|
185
186
|
homepage_uri: https://github.com/unixsuperhero/hiiro
|
|
186
187
|
source_code_uri: https://github.com/unixsuperhero/hiiro
|
|
187
188
|
changelog_uri: https://github.com/unixsuperhero/hiiro/blob/main/CHANGELOG.md
|
|
189
|
+
post_install_message:
|
|
188
190
|
rdoc_options: []
|
|
189
191
|
require_paths:
|
|
190
192
|
- lib
|
|
@@ -199,7 +201,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
199
201
|
- !ruby/object:Gem::Version
|
|
200
202
|
version: '0'
|
|
201
203
|
requirements: []
|
|
202
|
-
rubygems_version:
|
|
204
|
+
rubygems_version: 3.3.7
|
|
205
|
+
signing_key:
|
|
203
206
|
specification_version: 4
|
|
204
207
|
summary: A lightweight CLI framework for Ruby
|
|
205
208
|
test_files: []
|