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.
- checksums.yaml +4 -4
- data/CHANGELOG.md +15 -0
- data/CONTRIBUTING.md +8 -1
- data/README.md +25 -96
- data/docs/API.md +5 -172
- data/docs/RAILS.md +5 -162
- data/docs/README.md +22 -12
- data/docs/RELEASE_ACTION_PLAN.md +28 -13
- data/docs/RELEASE_AUDIT.md +19 -0
- data/docs/RELEASING.md +13 -6
- data/docs/SECURITY_MODEL.md +1 -1
- data/docs/WORK.md +22 -0
- data/docs/_advanced/development-and-testing.md +100 -0
- data/docs/_advanced/live-backend-qualification.md +5 -0
- data/docs/_advanced/rails-integration.md +143 -29
- data/docs/_config.yml +8 -4
- data/docs/_core_features/diagnostics.md +68 -0
- data/docs/_core_features/inspect-extract.md +18 -2
- data/docs/_data/navigation.yml +2 -0
- data/docs/_getting_started/getting-started.md +11 -1
- data/docs/_getting_started/whats-new-in-0-2.md +47 -0
- data/docs/_plugins/versioned_docs.rb +3 -3
- data/docs/_reference/api-and-configuration.md +188 -0
- data/docs/_reference/api-reference.md +3 -2
- data/docs/_reference/release-history.md +2 -1
- data/docs/_reference/roadmap.md +163 -0
- data/docs/_reference/upgrading.md +44 -13
- data/docs/index.md +2 -3
- data/examples/plain_ruby.rb +7 -4
- data/lib/ruby_llm/browser/doctor.rb +25 -10
- data/lib/ruby_llm/browser/version.rb +1 -1
- data/lib/ruby_llm/browser.rb +11 -0
- metadata +6 -1
|
@@ -2,12 +2,13 @@
|
|
|
2
2
|
|
|
3
3
|
module RubyLLM
|
|
4
4
|
module Browser
|
|
5
|
-
# Read-only
|
|
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.
|
|
9
|
-
#
|
|
10
|
-
#
|
|
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
|
-
|
|
30
|
-
|
|
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
|
-
|
|
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")
|
data/lib/ruby_llm/browser.rb
CHANGED
|
@@ -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.
|
|
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
|