hiiro 0.1.373 → 0.1.375

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: 20aa34021bb82c2fc10ecd805e991d93fd555502ca17efe9817acc077759e9c9
4
- data.tar.gz: d09d4366627e7ceeab982e147f08ddd0e7a650ccaa0264dd409ea102e80741d6
3
+ metadata.gz: 608c0e99d75c4cec38c9f12c577ea7e5035953372a3ab0176a824531754ccbeb
4
+ data.tar.gz: 3d0e98cc504d5838444432d80551d5131654221a4167223d4937670d50c523e2
5
5
  SHA512:
6
- metadata.gz: fb229c4ba5594b4c04ff0099a8ddde05a4ba690acc10fa2d35c821b9636e52656a7903b1e4460f1e69695f10731509933f0d89452439883e275a09512da9bfb6
7
- data.tar.gz: c5f5055c742cbe17f6d67ad01decfdafac89a7132144c62b9e95fd76f05e1f951bdb01f2b5697ddca5acadcd0679aeb4aa2f81f1699115ca70c744c7607745b1
6
+ metadata.gz: a60de68ce1d1dcfbd7e839d6675d4d62f878c12debeecbac3f6c5a6e29f5ca534d7fdd5a173a4913191c4225b994dbd78de4b807af634063bc9872e5deae6f86
7
+ data.tar.gz: 3ef9b8c14c4bbf9e01762e66f0303c00bb16177679752f20af5cfdee4cf7c22ba496b3023fae2e3d7cc6f33c1527be22c342e9a55cd721e817d49eb5ae4c4ab2
data/CHANGELOG.md CHANGED
@@ -2,6 +2,19 @@
2
2
 
3
3
  ## [Unreleased]
4
4
 
5
+ ## [0.1.375] - 2026-09-14
6
+
7
+ ### Changed
8
+ - `t switch`, `t tab open`, and `t pane open` no longer default to the current task; with no destination they open the picker (tasks, workspaces, panes, or tabs) and fail non-interactively. `.` still means the current task
9
+
10
+ ## [0.1.374] - 2026-09-14
11
+
12
+ ### Changed
13
+ - `h alert` plays sounds through terminal-notifier's `-sound` (macOS system sound names, `none` for silent, `-S` accepted as an alias for `-s`) instead of a separate `afplay` process
14
+
15
+ ### Removed
16
+ - Support for custom sound files in `~/.config/hiiro/sounds/`
17
+
5
18
  ## [0.1.372] - 2026-09-14
6
19
 
7
20
  ### Changed
data/CLAUDE.md CHANGED
@@ -331,7 +331,7 @@ macOS notification wrapper using terminal-notifier:
331
331
 
332
332
  ```ruby
333
333
  Hiiro::Notification.show(hiiro) # Show notification based on hiiro.args
334
- # Supports: -m message, -t title, -l link, -c command, -s sound
334
+ # Supports: -m message, -t title, -l link, -c command, -s sound (macOS system sound name via terminal-notifier -sound; none for silent)
335
335
  ```
336
336
 
337
337
  ### Hiiro::Queue (lib/hiiro/queue.rb)
data/docs/t.md CHANGED
@@ -112,7 +112,7 @@ t pane run [TASK] ID|LABEL [--] COMMAND...
112
112
  t pane split [TASK] ID|LABEL [--direction right|down] [--directory PATH] [--command COMMAND]
113
113
  ```
114
114
 
115
- These require a running Herdr server. The workspace label is the task session or name with `.` replaced by `_`. `switch` also accepts the name of a live Herdr workspace that belongs to no task, exactly or by unique prefix, and focuses it; a task with the same name wins. An exact pane ID such as `w6:p2` focuses that pane, and the picker lists every live pane with its directory and foreground command. When the name is ambiguous, or no task or context is given, a terminal gets a fuzzy finder over tasks and loose workspaces, with duplicate workspace names numbered in the label only. `switch` focuses the existing task workspace or creates it in the start directory (`--directory`, else primary directory, worktree, or home), and saves the task as the fallback when it was named explicitly. `--show` only prints the workspace, tabs, and panes. Tab and pane references match a live ID or label, then a unique prefix; with no reference and several candidates a fuzzy finder opens.
115
+ These require a running Herdr server. The workspace label is the task session or name with `.` replaced by `_`. `switch` also accepts the name of a live Herdr workspace that belongs to no task, exactly or by unique prefix, and focuses it; a task with the same name wins. An exact pane ID such as `w6:p2` focuses that pane, and the picker lists every live pane with its directory and foreground command. When the name is ambiguous, or no task or context is given, a terminal gets a fuzzy finder over tasks and loose workspaces, with duplicate workspace names numbered in the label only. Commands that jump somewhere never assume the current task: `t switch`, `t tab open`, and `t pane open` with no task open the picker instead (or fail when stdin is not a terminal); `.` still names the current task explicitly. `t pane open PANE_ID` and `t tab open TAB_ID` jump to any live pane or tab. `switch` focuses the existing task workspace or creates it in the start directory (`--directory`, else primary directory, worktree, or home), and saves the task as the fallback when it was named explicitly. `--show` only prints the workspace, tabs, and panes. Tab and pane references match a live ID or label, then a unique prefix; with no reference and several candidates a fuzzy finder opens.
116
116
 
117
117
  ## Native AI sessions
118
118
 
data/lib/hiiro/herdr.rb CHANGED
@@ -102,6 +102,8 @@ class Hiiro
102
102
  @agent_status = data['agent_status']
103
103
  end
104
104
 
105
+ def name = label
106
+
105
107
  alias name label
106
108
  alias index number
107
109
  alias panes pane_count
@@ -13,7 +13,8 @@ class Hiiro
13
13
 
14
14
  def options
15
15
  @options ||= Options.parse(args) do
16
- option(:sound, short: :s, default: 'basso', desc: 'sound name')
16
+ option(:sound, short: :s, default: 'Basso', desc: 'macOS system sound name, or none')
17
+ option(:sound_alias, short: :S, desc: 'alias for -s')
17
18
  option(:title, short: :t, desc: 'title')
18
19
  option(:message, short: :m, desc: 'message')
19
20
  option(:link, short: :l, desc: 'link to open')
@@ -25,32 +26,28 @@ class Hiiro
25
26
  @args ||= hiiro.args
26
27
  end
27
28
 
28
- def sounds
29
- custom = Dir.glob(File.join(Dir.home, '.config/hiiro/sounds/*'))
30
-
31
- @sounds ||= custom.each_with_object({}) do |fn, h|
32
- basename = File.basename(fn, File.extname(fn))
33
- h[basename.downcase] = fn
34
- end
29
+ # System sound name for terminal-notifier's -sound, or nil for silent.
30
+ # Herdr has its own sounds, so no separate afplay process is started.
31
+ def sound
32
+ name = (options.sound_alias || options.sound).to_s.strip
33
+ return nil if name.empty? || name.casecmp?('none')
34
+ name == 'default' ? name : name.capitalize
35
35
  end
36
36
 
37
- def show
38
- return unless has_cmd?
39
-
37
+ def command
40
38
  cmd = [binpath]
41
39
  cmd += ['-message', options.message] if options.message
42
40
  cmd += ['-title', options.title.tr('()[]', '')] if options.title
43
41
  cmd += ['-open', options.link] if options.link
44
42
  cmd += ['-execute', options.command] if options.command
45
- Process.detach(spawn(*cmd))
46
-
47
- play_sound
43
+ cmd += ['-sound', sound] if sound
44
+ cmd
48
45
  end
49
46
 
50
- def play_sound
51
- if options.sound && sounds[options.sound]
52
- Process.detach(spawn('afplay', sounds[options.sound.downcase]))
53
- end
47
+ def show
48
+ return unless has_cmd?
49
+
50
+ Process.detach(spawn(*command))
54
51
  end
55
52
 
56
53
  def binpath
@@ -565,15 +565,50 @@ class Hiiro
565
565
  target = pick_switch_target(task_matches, ws_matches, panes: [])
566
566
  return [target, target.is_a?(Hiiro::TaskRecord)]
567
567
  end
568
- args.shift if first == '.'
568
+ if first == '.'
569
+ args.shift
570
+ no_args!(args)
571
+ return [Hiiro::CurrentTask.new(herdr: -> { herdr_client }, pin: true).resolve!, false]
572
+ end
569
573
  no_args!(args)
570
- begin
571
- [Hiiro::CurrentTask.new(herdr: -> { herdr_client }, pin: true).resolve!, false]
572
- rescue Hiiro::Error => e
573
- raise unless $stdin.tty? && e.message.start_with?('No current task')
574
- target = pick_switch_target(Hiiro::TaskRecord.all_as_list, loose_workspaces)
575
- [target, target.is_a?(Hiiro::TaskRecord)]
574
+ # Jumping somewhere never assumes the current task: pick a destination.
575
+ raise Error, 'Name a task, workspace, or pane to switch to, or use . for the current task' unless $stdin.tty?
576
+ target = pick_switch_target(Hiiro::TaskRecord.all_as_list, loose_workspaces)
577
+ [target, target.is_a?(Hiiro::TaskRecord)]
578
+ end
579
+
580
+ def require_picker!(what)
581
+ raise Error, "Name a task or #{what} to jump to" unless $stdin.tty?
582
+ end
583
+
584
+ def tab_line(tab)
585
+ workspace = live_workspaces.find { |candidate| candidate.id == tab.workspace_id }
586
+ [tab.id, workspace&.name, tab.label].compact.join(' ')
587
+ end
588
+
589
+ # `pane open` / `tab open` with no task: pick from every live pane or tab.
590
+ def jump_to_pane(reference)
591
+ panes = live_panes.values.flatten
592
+ pane = if reference
593
+ live_item('pane', panes, reference)
594
+ else
595
+ require_picker!('pane')
596
+ fuzzyfind_from_map(panes.to_h { |candidate| [pane_line(candidate), candidate] }) || raise(Error, 'Nothing selected')
576
597
  end
598
+ focus_pane_target(pane)
599
+ end
600
+
601
+ def jump_to_tab(reference)
602
+ tabs = client.tabs(all: true).to_a
603
+ tab = if reference
604
+ live_item('tab', tabs, reference)
605
+ else
606
+ require_picker!('tab')
607
+ fuzzyfind_from_map(tabs.to_h { |candidate| [tab_line(candidate), candidate] }) || raise(Error, 'Nothing selected')
608
+ end
609
+ check_result(client.focus_workspace(tab.workspace_id))
610
+ check_result(client.focus_tab(tab.id))
611
+ puts tab_line(tab)
577
612
  end
578
613
 
579
614
  # --- Worktrees (shared with h task via Hiiro::TaskManager) ---
@@ -829,11 +864,15 @@ class Hiiro
829
864
  new_tab(task, single(rest, optional: true))
830
865
  end
831
866
  add_cmd(:open, args: ['task?', 'reference?'], opts: TASK_OPTIONS) do
832
- task, rest = take_task(opts.args)
833
- workspace = workspace_for(task)
834
- tab = live_item('tab', client.tabs(workspace: workspace), single(rest, optional: true))
835
- check_result(client.focus_workspace(workspace.id))
836
- check_result(client.focus_tab(tab.id))
867
+ if opts.task || opts.find || opts.args.first == '.' || (opts.args.first && lookup_task(opts.args.first))
868
+ task, rest = take_task(opts.args)
869
+ workspace = workspace_for(task)
870
+ tab = live_item('tab', client.tabs(workspace: workspace), single(rest, optional: true))
871
+ check_result(client.focus_workspace(workspace.id))
872
+ check_result(client.focus_tab(tab.id))
873
+ else
874
+ jump_to_tab(single(opts.args, optional: true))
875
+ end
837
876
  end
838
877
  end
839
878
  end
@@ -848,10 +887,16 @@ class Hiiro
848
887
  add_cmd(:list, :ls, args: ['task?'], opts: TASK_OPTIONS) do
849
888
  client.panes(workspace: workspace_for(take_task_only(opts.args))).each { |pane| puts pane }
850
889
  end
851
- %w[open read].each do |action|
852
- add_cmd(action, args: ['task?', 'pane?'], opts: TASK_OPTIONS) do
890
+ add_cmd(:read, args: ['task?', 'pane?'], opts: TASK_OPTIONS) do
891
+ task, rest = take_task(opts.args)
892
+ pane_action(task, 'read', rest)
893
+ end
894
+ add_cmd(:open, args: ['task?', 'pane?'], opts: TASK_OPTIONS) do
895
+ if opts.task || opts.find || opts.args.first == '.' || (opts.args.first && lookup_task(opts.args.first))
853
896
  task, rest = take_task(opts.args)
854
- pane_action(task, action, rest)
897
+ pane_action(task, 'open', rest)
898
+ else
899
+ jump_to_pane(single(opts.args, optional: true))
855
900
  end
856
901
  end
857
902
  add_cmd(:run, args: ['task?', 'pane', 'command...'], passthrough: true) do
data/lib/hiiro/version.rb CHANGED
@@ -1,4 +1,4 @@
1
1
  class Hiiro
2
- VERSION = "0.1.373"
2
+ VERSION = "0.1.375"
3
3
  SUPPORTED_RUBY_VERSION = ">= 3.2.0"
4
4
  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.373
4
+ version: 0.1.375
5
5
  platform: ruby
6
6
  authors:
7
7
  - Joshua Toyota