riffer-rig 0.18.0 → 0.19.1

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: 3f763fde525806f5e4780b0d3c64fc1fa54aeecca27a37c04a6959672187ba58
4
- data.tar.gz: 65ac529e22f788cdd0dc30b2d07af925af178bb38be01c37d2ab5900e32630be
3
+ metadata.gz: 956c768753795449f251c88032d34e29431990e85256a12f596bab048bbbd8fd
4
+ data.tar.gz: 4794240023e70cb83aa0ebea70bc42406976591b6aa174a43cb5802026970e08
5
5
  SHA512:
6
- metadata.gz: eb10f8f4c869e48c6666b10de70e8df32ea18a60a0e52e2b93b6ddb07f0345b6895b93841f5ea6bf56d6ff0b4310216526b305d964b508c584d76abb573a5e94
7
- data.tar.gz: 929e2929f45fe8833737e4d3db3e2536c54181f95cfd7be0ee32a72bd84174008977a3f1ec221cbef505609cac61589698799bc70e624e02ecbb05883eb3516c
6
+ metadata.gz: a2cf805167fb267b267c433a7f204382980fac9c9a29eb2382d3ff2cf6a4ba804d83ca6fe2a3af47118bf61f4cf9de7a23105dea32039319359a81e3592168ae
7
+ data.tar.gz: c3642d77288f25120880f3dbd83d922166e7ac5e986cd012fb0b55bf2cf1e269b901a6e81fc74f58297249c25388ef00918fb74255c38c91fdb3a8ab7e49b799
data/CHANGELOG.md CHANGED
@@ -1,5 +1,19 @@
1
1
  # Changelog
2
2
 
3
+ ## [0.19.1](https://github.com/bottrall/riffer-rig/compare/v0.19.0...v0.19.1) (2026-11-11)
4
+
5
+
6
+ ### Bug Fixes
7
+
8
+ * trust rig.rb by content and strip control characters from notices ([#629](https://github.com/bottrall/riffer-rig/issues/629)) ([593a569](https://github.com/bottrall/riffer-rig/commit/593a569f5e4f45699c88d30732fb0fbd7240cb08)), closes [#627](https://github.com/bottrall/riffer-rig/issues/627)
9
+
10
+ ## [0.19.0](https://github.com/bottrall/riffer-rig/compare/v0.18.0...v0.19.0) (2026-11-07)
11
+
12
+
13
+ ### Features
14
+
15
+ * expand ~ in catalog file paths ([#623](https://github.com/bottrall/riffer-rig/issues/623)) ([99609b5](https://github.com/bottrall/riffer-rig/commit/99609b536634108aeb472a31c63dc5ae545752e4))
16
+
3
17
  ## [0.18.0](https://github.com/bottrall/riffer-rig/compare/v0.17.0...v0.18.0) (2026-11-07)
4
18
 
5
19
 
@@ -24,4 +24,17 @@ module Riffer::Rig::Directories
24
24
  def riffer(root, *names)
25
25
  File.join(root, '.riffer', *names)
26
26
  end
27
+
28
+ # @rbs path: String
29
+ # @rbs home: String
30
+ # @rbs return: String
31
+ def expand_home(path, home)
32
+ if path == '~'
33
+ home
34
+ elsif path.start_with?('~/')
35
+ File.join(home, path.delete_prefix('~/'))
36
+ else
37
+ path
38
+ end
39
+ end
27
40
  end
@@ -1,5 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
+ require 'digest'
4
+
3
5
  class Riffer::Rig::Loader::ExtensionSource
4
6
  EXTENSION_FEATURE = 'riffer/rig/extension'
5
7
 
@@ -124,13 +126,15 @@ class Riffer::Rig::Loader::ExtensionSource
124
126
  decisions = Riffer::Rig::Trust.read(trust_path)
125
127
  return decisions if decisions.is_a?(String)
126
128
 
129
+ sha256 = Digest::SHA256.file(path).hexdigest
127
130
  stored = decisions[path]
128
- return stored unless stored.nil?
131
+ return stored.trusted if stored && stored.sha256 == sha256
129
132
 
130
- decision = @host.confirm("Trust #{path}?") if @host.capabilities.include?(:confirm)
131
- return false if decision.nil?
133
+ answer = @host.confirm("Trust #{path}?") if @host.capabilities.include?(:confirm)
134
+ return false if answer.nil?
132
135
 
133
- Riffer::Rig::Trust.store(trust_path, path, decision) || decision
136
+ decision = Riffer::Rig::Trust::Decision.new(sha256: sha256, trusted: answer)
137
+ Riffer::Rig::Trust.store(trust_path, path, decision) || answer
134
138
  end
135
139
 
136
140
  # @rbs return: String
@@ -88,7 +88,7 @@ class Riffer::Rig::Loader
88
88
  credentials = install_credentials(provider)
89
89
  raise ConfigurationError, credentials if credentials.is_a?(String)
90
90
 
91
- @riffer_config.catalog_files = document.catalog_files
91
+ @riffer_config.catalog_files = document.catalog_files.map { |path| Riffer::Rig::Directories.expand_home(path, @home) }
92
92
  stripped = { skills: options.skills, agents_md: options.agents_md }.reject { |_name, kept| kept }.keys
93
93
  discovered = options.extensions ? @source.discover(autoload: document.autoload) : [] #: Array[Riffer::Rig::Extension]
94
94
 
@@ -69,7 +69,7 @@ class Riffer::Rig::Terminal::Renderer
69
69
  # @rbs text: String
70
70
  # @rbs return: String
71
71
  def wrapped(text)
72
- Riffer::Rig::Terminal::TurnReport.wrap(text, @width.call)
72
+ Riffer::Rig::Terminal::TurnReport.wrap(text.gsub(Riffer::Rig::Terminal::Markdown::CONTROL, ''), @width.call)
73
73
  end
74
74
 
75
75
  # @rbs text: String
@@ -0,0 +1,23 @@
1
+ # frozen_string_literal: true
2
+
3
+ class Riffer::Rig::Trust::Decision
4
+ include Riffer::Rig::Support::Equatable
5
+
6
+ # @dynamic sha256, trusted
7
+ attr_reader :sha256 #: String
8
+ attr_reader :trusted #: bool
9
+
10
+ # @rbs sha256: String
11
+ # @rbs trusted: bool
12
+ # @rbs return: void
13
+ def initialize(sha256:, trusted:)
14
+ @sha256 = sha256
15
+ @trusted = trusted
16
+ freeze
17
+ end
18
+
19
+ # @rbs return: Hash[Symbol, untyped]
20
+ def to_h
21
+ { sha256: sha256, trusted: trusted }
22
+ end
23
+ end
@@ -4,7 +4,7 @@ module Riffer::Rig::Trust
4
4
  extend self
5
5
 
6
6
  # @rbs path: String
7
- # @rbs return: (Hash[String, bool] | String)
7
+ # @rbs return: (Hash[String, Riffer::Rig::Trust::Decision] | String)
8
8
  def read(path)
9
9
  document = Riffer::Rig::Support::JsonFile.read(path)
10
10
  document.is_a?(String) ? document : decisions(document)
@@ -12,17 +12,29 @@ module Riffer::Rig::Trust
12
12
 
13
13
  # @rbs path: String
14
14
  # @rbs file: String
15
- # @rbs decision: bool
15
+ # @rbs decision: Riffer::Rig::Trust::Decision
16
16
  # @rbs return: String?
17
17
  def store(path, file, decision)
18
- Riffer::Rig::Support::JsonFile.update(path) { |document| decisions(document).merge(file => decision) }
18
+ Riffer::Rig::Support::JsonFile.update(path) do |document|
19
+ decisions(document).transform_values(&:to_h).merge(file => decision.to_h)
20
+ end
19
21
  end
20
22
 
21
23
  private
22
24
 
23
25
  # @rbs document: Hash[untyped, untyped]
24
- # @rbs return: Hash[String, bool]
26
+ # @rbs return: Hash[String, Riffer::Rig::Trust::Decision]
25
27
  def decisions(document)
26
- document.select { |_file, decision| [true, false].include?(decision) }
28
+ document.filter_map do |file, entry|
29
+ next unless decision?(entry)
30
+
31
+ [file, Riffer::Rig::Trust::Decision.new(sha256: entry['sha256'], trusted: entry['trusted'])]
32
+ end.to_h
33
+ end
34
+
35
+ # @rbs entry: untyped
36
+ # @rbs return: bool
37
+ def decision?(entry)
38
+ entry.is_a?(Hash) && entry['sha256'].is_a?(String) && [true, false].include?(entry['trusted'])
27
39
  end
28
40
  end
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Riffer
4
4
  module Rig
5
- VERSION = '0.18.0'
5
+ VERSION = '0.19.1'
6
6
  end
7
7
  end
@@ -13,4 +13,9 @@ module Riffer::Rig::Directories
13
13
  # @rbs *names: String
14
14
  # @rbs return: String
15
15
  def riffer: (String root, *String names) -> String
16
+
17
+ # @rbs path: String
18
+ # @rbs home: String
19
+ # @rbs return: String
20
+ def expand_home: (String path, String home) -> String
16
21
  end
@@ -0,0 +1,18 @@
1
+ # Generated from lib/riffer/rig/trust/decision.rb with RBS::Inline
2
+
3
+ class Riffer::Rig::Trust::Decision
4
+ include Riffer::Rig::Support::Equatable
5
+
6
+ # @dynamic sha256, trusted
7
+ attr_reader sha256: String
8
+
9
+ attr_reader trusted: bool
10
+
11
+ # @rbs sha256: String
12
+ # @rbs trusted: bool
13
+ # @rbs return: void
14
+ def initialize: (sha256: String, trusted: bool) -> void
15
+
16
+ # @rbs return: Hash[Symbol, untyped]
17
+ def to_h: () -> Hash[Symbol, untyped]
18
+ end
@@ -2,18 +2,22 @@
2
2
 
3
3
  module Riffer::Rig::Trust
4
4
  # @rbs path: String
5
- # @rbs return: (Hash[String, bool] | String)
6
- def read: (String path) -> (Hash[String, bool] | String)
5
+ # @rbs return: (Hash[String, Riffer::Rig::Trust::Decision] | String)
6
+ def read: (String path) -> (Hash[String, Riffer::Rig::Trust::Decision] | String)
7
7
 
8
8
  # @rbs path: String
9
9
  # @rbs file: String
10
- # @rbs decision: bool
10
+ # @rbs decision: Riffer::Rig::Trust::Decision
11
11
  # @rbs return: String?
12
- def store: (String path, String file, bool decision) -> String?
12
+ def store: (String path, String file, Riffer::Rig::Trust::Decision decision) -> String?
13
13
 
14
14
  private
15
15
 
16
16
  # @rbs document: Hash[untyped, untyped]
17
- # @rbs return: Hash[String, bool]
18
- def decisions: (Hash[untyped, untyped] document) -> Hash[String, bool]
17
+ # @rbs return: Hash[String, Riffer::Rig::Trust::Decision]
18
+ def decisions: (Hash[untyped, untyped] document) -> Hash[String, Riffer::Rig::Trust::Decision]
19
+
20
+ # @rbs entry: untyped
21
+ # @rbs return: bool
22
+ def decision?: (untyped entry) -> bool
19
23
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: riffer-rig
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.18.0
4
+ version: 0.19.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jake Bottrall
@@ -15,28 +15,28 @@ dependencies:
15
15
  requirements:
16
16
  - - "~>"
17
17
  - !ruby/object:Gem::Version
18
- version: 0.13.0
18
+ version: 0.14.0
19
19
  type: :runtime
20
20
  prerelease: false
21
21
  version_requirements: !ruby/object:Gem::Requirement
22
22
  requirements:
23
23
  - - "~>"
24
24
  - !ruby/object:Gem::Version
25
- version: 0.13.0
25
+ version: 0.14.0
26
26
  - !ruby/object:Gem::Dependency
27
27
  name: base64
28
28
  requirement: !ruby/object:Gem::Requirement
29
29
  requirements:
30
30
  - - "~>"
31
31
  - !ruby/object:Gem::Version
32
- version: '0.2'
32
+ version: '0.3'
33
33
  type: :runtime
34
34
  prerelease: false
35
35
  version_requirements: !ruby/object:Gem::Requirement
36
36
  requirements:
37
37
  - - "~>"
38
38
  - !ruby/object:Gem::Version
39
- version: '0.2'
39
+ version: '0.3'
40
40
  - !ruby/object:Gem::Dependency
41
41
  name: event_stream_parser
42
42
  requirement: !ruby/object:Gem::Requirement
@@ -85,14 +85,14 @@ dependencies:
85
85
  requirements:
86
86
  - - "~>"
87
87
  - !ruby/object:Gem::Version
88
- version: 0.53.0
88
+ version: 0.55.0
89
89
  type: :runtime
90
90
  prerelease: false
91
91
  version_requirements: !ruby/object:Gem::Requirement
92
92
  requirements:
93
93
  - - "~>"
94
94
  - !ruby/object:Gem::Version
95
- version: 0.53.0
95
+ version: 0.55.0
96
96
  - !ruby/object:Gem::Dependency
97
97
  name: zeitwerk
98
98
  requirement: !ruby/object:Gem::Requirement
@@ -290,6 +290,7 @@ files:
290
290
  - lib/riffer/rig/tools/read.rb
291
291
  - lib/riffer/rig/tools/write.rb
292
292
  - lib/riffer/rig/trust.rb
293
+ - lib/riffer/rig/trust/decision.rb
293
294
  - lib/riffer/rig/version.rb
294
295
  - sig/generated/riffer/rig.rbs
295
296
  - sig/generated/riffer/rig/acp.rbs
@@ -462,6 +463,7 @@ files:
462
463
  - sig/generated/riffer/rig/tools/read.rbs
463
464
  - sig/generated/riffer/rig/tools/write.rbs
464
465
  - sig/generated/riffer/rig/trust.rbs
466
+ - sig/generated/riffer/rig/trust/decision.rbs
465
467
  - sig/generated/riffer/rig/version.rbs
466
468
  - sig/manual/riffer/rig.rbs
467
469
  - sig/manual/riffer/rig/acp/mapper.rbs