silas 0.6.2 → 0.6.3
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 +209 -0
- data/README.md +4 -2
- data/app/controllers/silas/channels/slack_controller.rb +2 -0
- data/app/controllers/silas/inbox/sessions_controller.rb +3 -1
- data/app/helpers/silas/inbox/trace_helper.rb +224 -2
- data/app/mailboxes/silas/agent_mailbox.rb +4 -0
- data/app/models/silas/tool_invocation.rb +37 -6
- data/app/views/layouts/silas/inbox.html.erb +69 -3
- data/app/views/silas/inbox/invocations/_detail.html.erb +21 -0
- data/app/views/silas/inbox/invocations/_invocation.html.erb +39 -24
- data/app/views/silas/inbox/sessions/_child.html.erb +14 -0
- data/app/views/silas/inbox/sessions/_row.html.erb +13 -2
- data/app/views/silas/inbox/sessions/show.html.erb +33 -0
- data/app/views/silas/inbox/steps/_step.html.erb +8 -1
- data/app/views/silas/inbox/turns/_header.html.erb +7 -2
- data/docs/agents.md +15 -3
- data/docs/channels.md +53 -2
- data/docs/configuration.md +2 -1
- data/docs/connections.md +8 -5
- data/docs/guarantees.md +16 -5
- data/docs/headless.md +120 -0
- data/docs/traces.md +131 -0
- data/docs/tutorial.md +6 -4
- data/docs/vs-eve.md +41 -17
- data/docs/why-silas.md +6 -6
- data/lib/generators/silas/install/install_generator.rb +21 -0
- data/lib/generators/silas/install/templates/initializer.rb +5 -0
- data/lib/silas/channel.rb +85 -11
- data/lib/silas/configuration.rb +16 -1
- data/lib/silas/doctor.rb +35 -2
- data/lib/silas/registry.rb +20 -2
- data/lib/silas/tool.rb +38 -5
- data/lib/silas/version.rb +1 -1
- metadata +5 -1
data/lib/silas/tool.rb
CHANGED
|
@@ -23,16 +23,16 @@ module Silas
|
|
|
23
23
|
class << self
|
|
24
24
|
def description(text = nil)
|
|
25
25
|
@description = text if text
|
|
26
|
-
|
|
26
|
+
inherited_setting(:@description) || ""
|
|
27
27
|
end
|
|
28
28
|
|
|
29
29
|
def param(name, type = :string, desc: nil)
|
|
30
|
-
|
|
30
|
+
own_param_refinements[name.to_sym] = { type: type.to_s, desc: desc }
|
|
31
31
|
end
|
|
32
32
|
|
|
33
33
|
def approval(policy = nil, &block)
|
|
34
34
|
@approval_policy = block || policy unless policy.nil? && block.nil?
|
|
35
|
-
|
|
35
|
+
inherited_setting(:@approval_policy) || :never
|
|
36
36
|
end
|
|
37
37
|
alias approval_policy approval
|
|
38
38
|
|
|
@@ -40,7 +40,7 @@ module Silas
|
|
|
40
40
|
def idempotent! = @effect_mode = :idempotent
|
|
41
41
|
def at_most_once! = @effect_mode = :at_most_once
|
|
42
42
|
|
|
43
|
-
def effect_mode =
|
|
43
|
+
def effect_mode = inherited_setting(:@effect_mode) || :at_most_once
|
|
44
44
|
|
|
45
45
|
def tool_name
|
|
46
46
|
name.demodulize.underscore
|
|
@@ -79,9 +79,42 @@ module Silas
|
|
|
79
79
|
|
|
80
80
|
private
|
|
81
81
|
|
|
82
|
-
|
|
82
|
+
# Ruby does NOT inherit class-level instance variables. Without this walk,
|
|
83
|
+
# factoring shared declarations into a base class —
|
|
84
|
+
#
|
|
85
|
+
# class MoneyTool < Silas::Tool
|
|
86
|
+
# transactional!
|
|
87
|
+
# approval :always
|
|
88
|
+
# end
|
|
89
|
+
# class IssueRefund < MoneyTool; end
|
|
90
|
+
#
|
|
91
|
+
# — silently drops both in the subclass, and drops them into the LEAST
|
|
92
|
+
# safe defaults: no database transaction (:at_most_once) and no human
|
|
93
|
+
# gate (:never). Silently disarming the two declarations the ledger acts
|
|
94
|
+
# on is the worst failure this DSL could have, so settings resolve up the
|
|
95
|
+
# ancestry: nearest explicit declaration wins.
|
|
96
|
+
def inherited_setting(ivar)
|
|
97
|
+
klass = self
|
|
98
|
+
while klass.respond_to?(:inherited_setting, true)
|
|
99
|
+
value = klass.instance_variable_get(ivar)
|
|
100
|
+
return value unless value.nil?
|
|
101
|
+
|
|
102
|
+
klass = klass.superclass
|
|
103
|
+
end
|
|
104
|
+
nil
|
|
105
|
+
end
|
|
106
|
+
|
|
107
|
+
def own_param_refinements
|
|
83
108
|
@param_refinements ||= {}
|
|
84
109
|
end
|
|
110
|
+
|
|
111
|
+
# Merged down the ancestry so a base class's `param` refinements survive;
|
|
112
|
+
# a subclass redeclaring the same param wins.
|
|
113
|
+
def param_refinements
|
|
114
|
+
return own_param_refinements unless superclass.respond_to?(:param_refinements, true)
|
|
115
|
+
|
|
116
|
+
superclass.send(:param_refinements).merge(own_param_refinements)
|
|
117
|
+
end
|
|
85
118
|
end
|
|
86
119
|
|
|
87
120
|
# Instance-side delegation so a resolved instance answers the Ledger.
|
data/lib/silas/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: silas
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.6.
|
|
4
|
+
version: 0.6.3
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Daniel St Paul
|
|
@@ -146,7 +146,9 @@ files:
|
|
|
146
146
|
- app/views/silas/channels/approvals/error.html.erb
|
|
147
147
|
- app/views/silas/channels/approvals/show.html.erb
|
|
148
148
|
- app/views/silas/inbox/invocations/_approval_card.html.erb
|
|
149
|
+
- app/views/silas/inbox/invocations/_detail.html.erb
|
|
149
150
|
- app/views/silas/inbox/invocations/_invocation.html.erb
|
|
151
|
+
- app/views/silas/inbox/sessions/_child.html.erb
|
|
150
152
|
- app/views/silas/inbox/sessions/_cost.html.erb
|
|
151
153
|
- app/views/silas/inbox/sessions/_row.html.erb
|
|
152
154
|
- app/views/silas/inbox/sessions/index.html.erb
|
|
@@ -175,11 +177,13 @@ files:
|
|
|
175
177
|
- docs/conventions.md
|
|
176
178
|
- docs/evals.md
|
|
177
179
|
- docs/guarantees.md
|
|
180
|
+
- docs/headless.md
|
|
178
181
|
- docs/inbox-and-api.md
|
|
179
182
|
- docs/memory.md
|
|
180
183
|
- docs/providers.md
|
|
181
184
|
- docs/sandbox.md
|
|
182
185
|
- docs/tools.md
|
|
186
|
+
- docs/traces.md
|
|
183
187
|
- docs/tutorial.md
|
|
184
188
|
- docs/vs-eve.md
|
|
185
189
|
- docs/why-silas.md
|