hiiro 0.1.374 → 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: 2eeea73b7e9f5a66d4156b20253a3b5815802c65c1ca9740694647fd9e2347e4
4
- data.tar.gz: 3f79d0998110b47a4bc98f27764042a0ac48f263a6a2abb1ed8d59a6ddf512c3
3
+ metadata.gz: 608c0e99d75c4cec38c9f12c577ea7e5035953372a3ab0176a824531754ccbeb
4
+ data.tar.gz: 3d0e98cc504d5838444432d80551d5131654221a4167223d4937670d50c523e2
5
5
  SHA512:
6
- metadata.gz: b023e9228aa0f2bc9053df47ce1fb37ad81b545c4ddbbb81735e0a32da501641252b61ed86ecd9319188b2838c90c9183283f3233087c825799e48905cb5d0bb
7
- data.tar.gz: 5c952b79fb9bcf1697e7a1b88d86f097e6ba91220db03dc682ced02475ec10fa638da33578019e55fa2cfc441665a3808cee2ba7b45107056a8676cedf23ab2d
6
+ metadata.gz: a60de68ce1d1dcfbd7e839d6675d4d62f878c12debeecbac3f6c5a6e29f5ca534d7fdd5a173a4913191c4225b994dbd78de4b807af634063bc9872e5deae6f86
7
+ data.tar.gz: 3ef9b8c14c4bbf9e01762e66f0303c00bb16177679752f20af5cfdee4cf7c22ba496b3023fae2e3d7cc6f33c1527be22c342e9a55cd721e817d49eb5ae4c4ab2
data/CHANGELOG.md CHANGED
@@ -2,6 +2,11 @@
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
+
5
10
  ## [0.1.374] - 2026-09-14
6
11
 
7
12
  ### Changed
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
@@ -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.374"
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.374
4
+ version: 0.1.375
5
5
  platform: ruby
6
6
  authors:
7
7
  - Joshua Toyota