ruby_llm-browser 0.1.0 → 0.2.0

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.
@@ -2,12 +2,13 @@
2
2
 
3
3
  module RubyLLM
4
4
  module Browser
5
- # Read-only preflight diagnostics for a live browser deployment.
5
+ # Read-only configuration diagnostics for an offline or live backend.
6
6
  #
7
7
  # The Doctor never makes a network call, never starts a session and never prints a
8
- # credential. It reports the version pins, the environment overrides that the SDK
9
- # would otherwise honour, and whether the configured backend is qualified to start a
10
- # session. A `:fail` check means live use must not proceed.
8
+ # credential. Common checks report RubyLLM compatibility and backend capabilities.
9
+ # Only Stagehand backends inspect Stagehand's SDK and environment. FakeBackend
10
+ # checks do not load the SDK or inspect provider credentials. A local pass never
11
+ # qualifies a provider's actual guarantees. A `:fail` check blocks use.
11
12
  #
12
13
  # report = RubyLLM::Browser::Doctor.new(backend: backend).report
13
14
  # raise report[:summary] unless report[:ok]
@@ -23,13 +24,15 @@ module RubyLLM
23
24
  @env = env
24
25
  end
25
26
 
26
- # @return [Hash] `{ ok:, summary:, checks: [...] }`, safe to log
27
+ # @return [Hash] `{ mode:, ok:, summary:, checks: [...] }`, safe to log.
28
+ # Mode is `:offline` for FakeBackend in fake mode, `:unconfigured` without
29
+ # a backend, and `:live` otherwise. Existing report keys remain available.
27
30
  def report
28
- checks = [
29
- ruby_llm_check, stagehand_check, egress_check, local_binary_check,
30
- custom_headers_check, base_url_check, credentials_check
31
- ].compact
31
+ checks = [ ruby_llm_check, egress_check, local_binary_check, custom_headers_check ]
32
+ checks.concat([ stagehand_check, base_url_check, credentials_check ]) if backend.is_a?(StagehandBackend)
33
+ checks.compact!
32
34
  {
35
+ mode: mode,
33
36
  ok: checks.none? { |check| check[:status] == :fail },
34
37
  summary: summary_for(checks),
35
38
  checks: checks
@@ -40,6 +43,13 @@ module RubyLLM
40
43
 
41
44
  private
42
45
 
46
+ def mode
47
+ return :unconfigured unless backend
48
+ return :offline if backend.is_a?(FakeBackend) && backend.capabilities.server_mode == :fake
49
+
50
+ :live
51
+ end
52
+
43
53
  def ruby_llm_check
44
54
  version = Gem::Version.new(RubyLLM::VERSION)
45
55
  required = Gem::Version.new("2.0.0")
@@ -72,7 +82,12 @@ module RubyLLM
72
82
  "Stagehand backend is unsupported until provider egress and cleanup are qualified")
73
83
  end
74
84
  if capabilities.enforced_egress?
75
- check(:egress_isolation, :pass, "the backend asserts enforced, browser-side egress isolation")
85
+ detail = if mode == :offline
86
+ "FakeBackend performs no network I/O; live egress is not verified"
87
+ else
88
+ "the backend asserts enforced, browser-side egress isolation"
89
+ end
90
+ check(:egress_isolation, :pass, detail)
76
91
  else
77
92
  check(:egress_isolation, :fail,
78
93
  "the backend does not assert enforced egress isolation; live sessions are refused")
@@ -4,6 +4,6 @@ module RubyLLM
4
4
  module Browser
5
5
  # The Gem version. Development happens ahead of any public release: the packaged
6
6
  # version is not a RubyGems publication claim.
7
- VERSION = "0.1.0"
7
+ VERSION = "0.2.0"
8
8
  end
9
9
  end
@@ -47,6 +47,17 @@ module RubyLLM
47
47
  # operation and session lifecycle, budgets and one-use action approvals.
48
48
  module Browser
49
49
  class << self
50
+ # Builds the read-only tool pair for a host-supplied context and schema.
51
+ #
52
+ # chat.with_tools(*RubyLLM::Browser.tools(context: context, schema: schema))
53
+ #
54
+ # No operation is dispatched. Act is never included. Constructor validation
55
+ # applies here; the host policy validates schema contents when Extract runs.
56
+ # @return [Array<Inspect, Extract>] fresh instances sharing the supplied context
57
+ def tools(context:, schema:)
58
+ [ Inspect.new(context: context), Extract.new(context: context, schema: schema) ]
59
+ end
60
+
50
61
  # Process-wide defaults (see {Configuration}).
51
62
  def configuration
52
63
  @configuration ||= Configuration.new
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ruby_llm-browser
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andy Wang
@@ -171,9 +171,11 @@ files:
171
171
  - docs/SECURITY_MODEL.md
172
172
  - docs/SPEC_BASELINE.md
173
173
  - docs/WORK.md
174
+ - docs/_advanced/development-and-testing.md
174
175
  - docs/_advanced/live-backend-qualification.md
175
176
  - docs/_advanced/rails-integration.md
176
177
  - docs/_config.yml
178
+ - docs/_core_features/diagnostics.md
177
179
  - docs/_core_features/inspect-extract.md
178
180
  - docs/_core_features/offline-act.md
179
181
  - docs/_core_features/operation-lifecycle.md
@@ -184,9 +186,12 @@ files:
184
186
  - docs/_getting_started/configuration.md
185
187
  - docs/_getting_started/getting-started.md
186
188
  - docs/_getting_started/overview.md
189
+ - docs/_getting_started/whats-new-in-0-2.md
187
190
  - docs/_plugins/versioned_docs.rb
191
+ - docs/_reference/api-and-configuration.md
188
192
  - docs/_reference/api-reference.md
189
193
  - docs/_reference/release-history.md
194
+ - docs/_reference/roadmap.md
190
195
  - docs/_reference/upgrading.md
191
196
  - docs/bin/build-api.sh
192
197
  - docs/bin/build.sh