legionio 1.6.32 → 1.6.33

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: 382eadc81bfd7449fe1d3d8c5c9e833795cb17deaab9d6b00c04a0d10508ad88
4
- data.tar.gz: c3df12bdc9300f8c1cf4ace607b623140286c78c7615b35f774809c5ecb7e53e
3
+ metadata.gz: 47493b86202b34c55a068f274c8b63c9840edb681728a80b5b301df2bf1913f5
4
+ data.tar.gz: 99480b62f0f5be82bea044e37f67b8e1fb22e4bc3a9d6885ff549b4decbcd90c
5
5
  SHA512:
6
- metadata.gz: eb50b2ab0354df1dbcf053bb6794944ec29265c482bc274dafdc2c42a288e0349a187d07ff5172ad36ed203729a6714e5c2a9601e032c3592e1f8df22276ce39
7
- data.tar.gz: c0a172f265bd7bf5e07bf34460d7f9a5b7be2b872c11e21f5de47e7354a67a0e4e425a7b3ef70d9bc9b54c61ccb920f820ab9b33ab059a38ff9977f0852f560d
6
+ metadata.gz: 619a2c7e66a072f6acc233b4a924e4129716174967a7d7ab470f7b3dcc81383618cb5b448805e1ab1b14ae0ba3a51df00fd4e2fa4c2ab091092d2fe8d17a37e3
7
+ data.tar.gz: '08dc265a6a6add0debffb0421ad81793929f6adaf137fb81bd5120aa745941ae733e6223763bc958c3b1d211ee2ca62aa599b39f53739cce306c4215420e97c3'
data/CHANGELOG.md CHANGED
@@ -2,6 +2,14 @@
2
2
 
3
3
  ## [Unreleased]
4
4
 
5
+ ## [1.6.33] - 2026-03-28
6
+
7
+ ### Added
8
+ - `knowledge` registered as top-level CLI subcommand (previously only accessible via `legionio ai knowledge`). Fixes knowledge capture hooks that call `legionio knowledge capture commit/transcript`.
9
+
10
+ ### Fixed
11
+ - Claude Code hook format in `setup claude-code`: PostToolUse and Stop hooks now emit the new `hooks` array wrapper format with `type: command` entries. Detection supports both old and new formats via `hook_commands` helper.
12
+
5
13
  ## [1.6.32] - 2026-03-28
6
14
 
7
15
  ### Added
@@ -350,8 +350,8 @@ module Legion
350
350
 
351
351
  hooks = existing['hooks'] || {}
352
352
 
353
- has_commit = Array(hooks['PostToolUse']).any? { |h| h['command']&.include?('knowledge capture commit') }
354
- has_transcript = Array(hooks['Stop']).any? { |h| h['command']&.include?('knowledge capture transcript') }
353
+ has_commit = Array(hooks['PostToolUse']).any? { |h| hook_commands(h).any? { |c| c.include?('knowledge capture commit') } }
354
+ has_transcript = Array(hooks['Stop']).any? { |h| hook_commands(h).any? { |c| c.include?('knowledge capture transcript') } }
355
355
  if has_commit && has_transcript && !options[:force]
356
356
  puts ' Write-back hooks already present (use --force to overwrite)' unless options[:json]
357
357
  return
@@ -363,15 +363,14 @@ module Legion
363
363
  unless has_commit
364
364
  hooks['PostToolUse'] << {
365
365
  'matcher' => 'Bash',
366
- 'command' => 'legionio knowledge capture commit',
367
- 'timeout' => 10_000
366
+ 'hooks' => [{ 'type' => 'command', 'command' => 'legionio knowledge capture commit', 'timeout' => 10_000 }]
368
367
  }
369
368
  end
370
369
 
371
370
  unless has_transcript
372
371
  hooks['Stop'] << {
373
- 'command' => 'legionio knowledge capture transcript',
374
- 'timeout' => 30_000
372
+ 'matcher' => '',
373
+ 'hooks' => [{ 'type' => 'command', 'command' => 'legionio knowledge capture transcript', 'timeout' => 30_000 }]
375
374
  }
376
375
  end
377
376
 
@@ -381,6 +380,13 @@ module Legion
381
380
  puts ' Installed write-back hooks for knowledge capture' unless options[:json]
382
381
  end
383
382
 
383
+ def hook_commands(hook_entry)
384
+ # Support both old format (command at top level) and new format (hooks array)
385
+ cmds = Array(hook_entry['hooks']).filter_map { |h| h['command'] }
386
+ cmds << hook_entry['command'] if hook_entry['command']
387
+ cmds
388
+ end
389
+
384
390
  def write_mcp_servers_json(_out, path, installed)
385
391
  existing = load_json_file(path)
386
392
  servers = existing['mcpServers'] || {}
data/lib/legion/cli.rb CHANGED
@@ -254,6 +254,9 @@ module Legion
254
254
  subcommand 'init', Legion::CLI::Init
255
255
 
256
256
  # --- Interactive & shortcuts ---
257
+ desc 'knowledge SUBCOMMAND', 'Search and manage the document knowledge base'
258
+ subcommand 'knowledge', Legion::CLI::Knowledge
259
+
257
260
  desc 'codegen SUBCOMMAND', 'Manage self-generating functions'
258
261
  subcommand 'codegen', CodegenCommand
259
262
 
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Legion
4
- VERSION = '1.6.32'
4
+ VERSION = '1.6.33'
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: legionio
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.6.32
4
+ version: 1.6.33
5
5
  platform: ruby
6
6
  authors:
7
7
  - Esity