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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: e8acd4525328ec989fc21c5cc4cc12b89cb6bb6f5f7a58cd26e8c4d9e314e47f
4
- data.tar.gz: 767aab54f70478217a1884805be0536a69dc213696f989fe5d7f365e3016b3ad
3
+ metadata.gz: 4c71fbe8e1cf1428433cbbc50cffd41c0d635a12c609b6f7a8e5d777a04a7fc2
4
+ data.tar.gz: e8bd642b1cd3fae5c2fc49c64f5e0dada849896d72d4879f243fe294ca6e521a
5
5
  SHA512:
6
- metadata.gz: 1105b1d12f8a88c6a31f056c024a02d1bdaf200e046dac69be7a3ac179d0413bbc8d90a0d9588f3655ebdb9f4ed912145fefe9197b09b34ff9d6dfa8c762b9dc
7
- data.tar.gz: 4328502564e28fcbb11fef9da5b1e3e33caa7421820349c6290d0d2ec3ce2e2177f7341710233b49b84e398102045fc036df3c5992fd5514e2c10e30dc7d838d
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
- prompt_body = prompt_obj ? prompt_obj.doc.content.strip : prompt_text
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
- claude "run the prompt in the file @#{prompt_file}"
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
@@ -1,3 +1,3 @@
1
1
  class Hiiro
2
- VERSION = "0.1.106"
2
+ VERSION = "0.1.108"
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.106
4
+ version: 0.1.108
5
5
  platform: ruby
6
6
  authors:
7
7
  - Joshua Toyota