hiiro 0.1.106 → 0.1.108
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 +11 -4
- 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: 4c71fbe8e1cf1428433cbbc50cffd41c0d635a12c609b6f7a8e5d777a04a7fc2
|
|
4
|
+
data.tar.gz: e8bd642b1cd3fae5c2fc49c64f5e0dada849896d72d4879f243fe294ca6e521a
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: b0116b6b1be1bc51bbc5bfe58a66f950ae8ecaef2dbd55797d93db3bf1da2c442944789578ace492ce5806b3e53263e0800e32a27780433f41ddc6e29b121465
|
|
7
|
+
data.tar.gz: 6f07e95b036c5f7f9aa786e8c45b632766d439beb8ef0ef5fff72ab4b186a855392e84deaf062cabb7093b8d3aa9fabe100f78ade0117124265dd3c787afccba
|
data/lib/hiiro/queue.rb
CHANGED
|
@@ -89,7 +89,6 @@ class Hiiro
|
|
|
89
89
|
FileUtils.mv(md_file, running_md)
|
|
90
90
|
|
|
91
91
|
prompt_obj = Prompt.from_file(running_md, hiiro: hiiro)
|
|
92
|
-
prompt_text = File.read(running_md).strip
|
|
93
92
|
|
|
94
93
|
# Determine target tmux session and working directory from frontmatter
|
|
95
94
|
target_session = TMUX_SESSION
|
|
@@ -115,7 +114,8 @@ class Hiiro
|
|
|
115
114
|
end
|
|
116
115
|
|
|
117
116
|
# Write a clean prompt file (no frontmatter) for claude
|
|
118
|
-
|
|
117
|
+
raw = File.read(running_md).strip
|
|
118
|
+
prompt_body = prompt_obj ? prompt_obj.doc.content.strip : strip_frontmatter(raw)
|
|
119
119
|
prompt_file = File.join(dirs[:running], "#{name}.prompt")
|
|
120
120
|
File.write(prompt_file, prompt_body + "\n")
|
|
121
121
|
|
|
@@ -123,10 +123,9 @@ class Hiiro
|
|
|
123
123
|
script_path = File.join(dirs[:running], "#{name}.sh")
|
|
124
124
|
File.write(script_path, <<~SH)
|
|
125
125
|
#!/usr/bin/env bash
|
|
126
|
-
set -e
|
|
127
126
|
|
|
128
127
|
cd #{Shellwords.shellescape(working_dir)}
|
|
129
|
-
|
|
128
|
+
cat #{Shellwords.shellescape(prompt_file)} | claude
|
|
130
129
|
HQ_EXIT=$?
|
|
131
130
|
|
|
132
131
|
# Move task files to done/failed based on exit code
|
|
@@ -170,6 +169,14 @@ class Hiiro
|
|
|
170
169
|
puts "Launched: #{name} [#{target_session}:#{win_name}]"
|
|
171
170
|
end
|
|
172
171
|
|
|
172
|
+
def strip_frontmatter(text)
|
|
173
|
+
lines = text.lines
|
|
174
|
+
return text unless lines.first&.strip == '---'
|
|
175
|
+
end_idx = lines[1..].index { |l| l.strip == '---' }
|
|
176
|
+
return text unless end_idx
|
|
177
|
+
lines[(end_idx + 2)..].join.strip
|
|
178
|
+
end
|
|
179
|
+
|
|
173
180
|
def short_window_name(name)
|
|
174
181
|
base = name[0, 8]
|
|
175
182
|
return base unless existing_window_name?(base)
|
data/lib/hiiro/version.rb
CHANGED