inloop-brain 0.0.9 → 0.0.10

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: 61025b8763503388d32c42d1169bd9e4231da28b6d383a7e9039fe55bc5e951e
4
- data.tar.gz: 3da29a86dca04caf0b20cb08bc1cc7a7c1597613bee59042d2cf0ef863b62499
3
+ metadata.gz: af66fbbb5672cf09b9b5eb5d4ae4d018adc4dd7f2a5be343dae2c93a74732bac
4
+ data.tar.gz: 21efedeaa7f002463d145091df3772c0839db24cbfc762d797a8344f657b85ec
5
5
  SHA512:
6
- metadata.gz: 4c484e3325531265497f6e2e1bd914e0b6f4525505840095af558330b2c28edaf8528eb9325205bdb349725db605640af96c622298b46474009d8bc186e8d23e
7
- data.tar.gz: 7f516136819c318c81718348a61598c414b931fa3d54c385f8d11868081035e0c251963bc760906674a111f0be6269754cf35e91ef8a4adfbe7c9ef9381791e4
6
+ metadata.gz: 03b35d39d7f88c6d788cace6ba09cd524bb4fed2bb3ca6ca4080d23a2d33877a4da7ba7b106db57d596e8aa7f0f3499a0eda25529beacf1731c4968a4390f824
7
+ data.tar.gz: b198e63d50a928d4e7095598795437aae57071e7bf2003bf7bfb9ec6544286cd50f137f3d41f48401c2c2d61a6b7811edf7b927ab03d072811d88a579b833fbc
data/README.md CHANGED
@@ -33,6 +33,7 @@ Use an API key generated from the Brain API share link in app.inloop.studio. The
33
33
  - `INLOOP_BRAIN_MODEL`: Model name to send (default: inloop-brain)
34
34
  - `INLOOP_BRAIN_HOST`: Host override (default: app.inloop.studio)
35
35
  - `INLOOP_BRAIN_PROTOCOL`: Protocol override (default: https)
36
+ - `INLOOP_BRAIN_SSL_STRICT`: Set to `1` to enforce strict TLS verification (disables the default compatibility behavior that ignores missing certificate CRLs)
36
37
 
37
38
  ### Options
38
39
 
@@ -44,7 +45,7 @@ Use an API key generated from the Brain API share link in app.inloop.studio. The
44
45
 
45
46
  ### Dependencies
46
47
 
47
- - bundler (~> 2.0)
48
+ - bundler (>= 2.0, < 5)
48
49
  - rake (~> 13.0)
49
50
  - rspec (~> 3.0)
50
51
 
data/bin/inloop-brain CHANGED
@@ -2,10 +2,13 @@
2
2
 
3
3
  # bin/inloop-brain - A command-line tool to interact with the Inloop Brain API (OpenAI-compatible)
4
4
 
5
+ $LOAD_PATH.unshift(File.expand_path("../lib", __dir__))
6
+
5
7
  require 'optparse'
6
8
  require 'net/http'
7
9
  require 'uri'
8
10
  require 'json'
11
+ require 'inloop_brain/ssl'
9
12
 
10
13
  # Parse command line options
11
14
  options = {}
@@ -74,6 +77,23 @@ end
74
77
  http = Net::HTTP.new(uri.host, uri.port)
75
78
  http.use_ssl = (uri.scheme == 'https')
76
79
 
80
+ # Some environments enable CRL checking globally for TLS verification but do not
81
+ # provide the CRLs, causing OpenSSL to abort with:
82
+ # "certificate verify failed (unable to get certificate CRL)"
83
+ # We keep certificate verification enabled, but soft-fail only those CRL-missing
84
+ # errors by default. Set INLOOP_BRAIN_SSL_STRICT=1 to disable this compatibility
85
+ # behavior.
86
+ if http.use_ssl?
87
+ http.verify_mode = OpenSSL::SSL::VERIFY_PEER
88
+ http.verify_hostname = true if http.respond_to?(:verify_hostname=)
89
+
90
+ strict_ssl = ENV.fetch('INLOOP_BRAIN_SSL_STRICT', '').to_s.downcase
91
+ strict_ssl = %w[1 true yes].include?(strict_ssl)
92
+ unless strict_ssl
93
+ http.verify_callback = InloopBrain::SSL.allow_missing_crl_verify_callback(debug: options[:debug])
94
+ end
95
+ end
96
+
77
97
  # Add proper timeout settings
78
98
  http.open_timeout = 10
79
99
  http.read_timeout = 60
@@ -83,7 +103,7 @@ request = Net::HTTP::Post.new(uri)
83
103
  request['Content-Type'] = 'application/json'
84
104
  request['Accept'] = 'application/json'
85
105
  request['Authorization'] = "Bearer #{options[:key]}"
86
- request['User-Agent'] = 'Inloop-Brain-CLI/0.0.9'
106
+ request['User-Agent'] = 'Inloop-Brain-CLI/0.0.10'
87
107
 
88
108
  messages = []
89
109
  messages << { role: 'system', content: options[:system] } if options[:system].to_s.strip != ''
@@ -0,0 +1,34 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'openssl'
4
+
5
+ module InloopBrain
6
+ module SSL
7
+ # Compatibility verify callback that soft-fails missing CRL errors.
8
+ #
9
+ # Some systems enable CRL checking globally for TLS verification but do not
10
+ # ship or fetch CRLs, causing OpenSSL to fail with:
11
+ # "certificate verify failed (unable to get certificate CRL)"
12
+ #
13
+ # This callback preserves strict verification for all other errors.
14
+ def self.allow_missing_crl_verify_callback(debug: false, io: $stderr)
15
+ proc do |preverify_ok, store_ctx|
16
+ if preverify_ok
17
+ true
18
+ else
19
+ err = store_ctx.error
20
+ if err == OpenSSL::X509::V_ERR_UNABLE_TO_GET_CRL ||
21
+ err == OpenSSL::X509::V_ERR_UNABLE_TO_GET_CRL_ISSUER
22
+ if debug
23
+ io.puts "Warning: SSL certificate CRL unavailable (#{store_ctx.error_string}); continuing without CRL check"
24
+ end
25
+ store_ctx.error = OpenSSL::X509::V_OK if store_ctx.respond_to?(:error=)
26
+ true
27
+ else
28
+ false
29
+ end
30
+ end
31
+ end
32
+ end
33
+ end
34
+ end
metadata CHANGED
@@ -1,29 +1,35 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: inloop-brain
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.9
4
+ version: 0.0.10
5
5
  platform: ruby
6
6
  authors:
7
7
  - Abhishek Parolkar
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2026-02-02 00:00:00.000000000 Z
11
+ date: 2026-02-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - "~>"
17
+ - - ">="
18
18
  - !ruby/object:Gem::Version
19
19
  version: '2.0'
20
+ - - "<"
21
+ - !ruby/object:Gem::Version
22
+ version: '5'
20
23
  type: :development
21
24
  prerelease: false
22
25
  version_requirements: !ruby/object:Gem::Requirement
23
26
  requirements:
24
- - - "~>"
27
+ - - ">="
25
28
  - !ruby/object:Gem::Version
26
29
  version: '2.0'
30
+ - - "<"
31
+ - !ruby/object:Gem::Version
32
+ version: '5'
27
33
  - !ruby/object:Gem::Dependency
28
34
  name: rake
29
35
  requirement: !ruby/object:Gem::Requirement
@@ -61,13 +67,10 @@ executables:
61
67
  extensions: []
62
68
  extra_rdoc_files: []
63
69
  files:
64
- - ".github/workflows/push.yml"
65
- - Gemfile
66
70
  - LICENSE.txt
67
71
  - README.md
68
- - Rakefile
69
72
  - bin/inloop-brain
70
- - inloop-brain.gemspec
73
+ - lib/inloop_brain/ssl.rb
71
74
  homepage: https://inloop.studio
72
75
  licenses:
73
76
  - Nonstandard
@@ -1,34 +0,0 @@
1
- name: Publish RubyGem
2
-
3
- on:
4
- workflow_dispatch:
5
- inputs:
6
- release_tag:
7
- description: "Optional git tag to publish"
8
- required: false
9
- default: ""
10
-
11
- jobs:
12
- publish:
13
- runs-on: ubuntu-latest
14
- permissions:
15
- contents: write
16
- id-token: write
17
- steps:
18
- - name: Checkout repository
19
- uses: actions/checkout@v4
20
- with:
21
- fetch-depth: 0
22
-
23
- - name: Checkout tag
24
- if: inputs.release_tag != ''
25
- run: git checkout "${{ inputs.release_tag }}"
26
-
27
- - name: Set up Ruby
28
- uses: ruby/setup-ruby@v1
29
- with:
30
- ruby-version: "3.2"
31
- bundler-cache: true
32
-
33
- - name: Release gem via Trusted Publisher (OIDC)
34
- uses: rubygems/release-gem@v1
data/Gemfile DELETED
@@ -1,3 +0,0 @@
1
- source "https://rubygems.org"
2
-
3
- gemspec
data/Rakefile DELETED
@@ -1,6 +0,0 @@
1
- require "bundler/gem_tasks"
2
- require "rspec/core/rake_task"
3
-
4
- RSpec::Core::RakeTask.new(:spec)
5
-
6
- task :default => :spec
data/inloop-brain.gemspec DELETED
@@ -1,32 +0,0 @@
1
-
2
-
3
- Gem::Specification.new do |spec|
4
- spec.name = "inloop-brain"
5
- spec.version = "0.0.9"
6
- spec.authors = ["Abhishek Parolkar"]
7
- spec.email = ["abhishek@inloop.studio"]
8
-
9
- spec.summary = "Command-line interface for the Inloop Brain Access Kit"
10
- spec.description = "A simple command-line tool that sends prompts to the Inloop Brain Access Kit API and returns responses"
11
- spec.homepage = "https://inloop.studio"
12
- spec.license = "Nonstandard"
13
- spec.required_ruby_version = Gem::Requirement.new(">= 2.6.0")
14
-
15
- spec.metadata["homepage_uri"] = spec.homepage
16
- spec.metadata["source_code_uri"] = "https://github.com/inloopstudio-team/inloop-brain"
17
- spec.metadata["changelog_uri"] = "https://github.com/inloopstudio-team/inloop-brain/blob/main/CHANGELOG.md" # Replace with actual changelog URL
18
-
19
- # Specify which files should be added to the gem when it is released.
20
- # The `git ls-files -z` loads the files in the RubyGem that have been added into git.
21
- spec.files = Dir.chdir(File.expand_path('..', __FILE__)) do
22
- `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
23
- end
24
- spec.bindir = "bin"
25
- spec.executables = ["inloop-brain"]
26
-
27
-
28
- # Dependencies
29
- spec.add_development_dependency "bundler", "~> 2.0"
30
- spec.add_development_dependency "rake", "~> 13.0"
31
- spec.add_development_dependency "rspec", "~> 3.0"
32
- end