brute 0.1.8 → 0.1.9
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/lib/brute/agent_stream.rb +4 -1
- data/lib/brute/middleware/message_tracking.rb +15 -1
- data/lib/brute/orchestrator.rb +20 -6
- data/lib/brute/prompts/autonomy.rb +21 -0
- data/lib/brute/prompts/base.rb +23 -0
- data/lib/brute/prompts/build_switch.rb +19 -0
- data/lib/brute/prompts/code_references.rb +21 -0
- data/lib/brute/prompts/code_style.rb +16 -0
- data/lib/brute/prompts/conventions.rb +20 -0
- data/lib/brute/prompts/doing_tasks.rb +11 -0
- data/lib/brute/prompts/editing_approach.rb +20 -0
- data/lib/brute/prompts/editing_constraints.rb +24 -0
- data/lib/brute/prompts/environment.rb +25 -0
- data/lib/brute/prompts/frontend_tasks.rb +21 -0
- data/lib/brute/prompts/git_safety.rb +19 -0
- data/lib/brute/prompts/identity.rb +11 -0
- data/lib/brute/prompts/instructions.rb +18 -0
- data/lib/brute/prompts/max_steps.rb +30 -0
- data/lib/brute/prompts/objectivity.rb +16 -0
- data/lib/brute/prompts/plan_reminder.rb +40 -0
- data/lib/brute/prompts/proactiveness.rb +19 -0
- data/lib/brute/prompts/security_and_safety.rb +17 -0
- data/lib/brute/prompts/skills.rb +22 -0
- data/lib/brute/prompts/task_management.rb +59 -0
- data/lib/brute/prompts/text/agents/compaction.txt +15 -0
- data/lib/brute/prompts/text/agents/explore.txt +17 -0
- data/lib/brute/prompts/text/agents/summary.txt +11 -0
- data/lib/brute/prompts/text/agents/title.txt +40 -0
- data/lib/brute/prompts/text/doing_tasks/anthropic.txt +11 -0
- data/lib/brute/prompts/text/doing_tasks/default.txt +6 -0
- data/lib/brute/prompts/text/doing_tasks/google.txt +9 -0
- data/lib/brute/prompts/text/identity/anthropic.txt +5 -0
- data/lib/brute/prompts/text/identity/default.txt +3 -0
- data/lib/brute/prompts/text/identity/google.txt +1 -0
- data/lib/brute/prompts/text/identity/openai.txt +3 -0
- data/lib/brute/prompts/text/tone_and_style/anthropic.txt +5 -0
- data/lib/brute/prompts/text/tone_and_style/default.txt +9 -0
- data/lib/brute/prompts/text/tone_and_style/google.txt +6 -0
- data/lib/brute/prompts/text/tone_and_style/openai.txt +17 -0
- data/lib/brute/prompts/text/tool_usage/anthropic.txt +16 -0
- data/lib/brute/prompts/text/tool_usage/default.txt +4 -0
- data/lib/brute/prompts/text/tool_usage/google.txt +4 -0
- data/lib/brute/prompts/tone_and_style.rb +11 -0
- data/lib/brute/prompts/tool_usage.rb +11 -0
- data/lib/brute/skill.rb +118 -0
- data/lib/brute/system_prompt.rb +119 -64
- data/lib/brute/tools/question.rb +59 -0
- data/lib/brute/version.rb +1 -1
- data/lib/brute.rb +59 -2
- metadata +45 -2
data/lib/brute.rb
CHANGED
|
@@ -27,6 +27,30 @@ require_relative 'brute/file_mutation_queue'
|
|
|
27
27
|
require_relative 'brute/doom_loop'
|
|
28
28
|
require_relative 'brute/hooks'
|
|
29
29
|
require_relative 'brute/compactor'
|
|
30
|
+
require_relative 'brute/prompts/base'
|
|
31
|
+
require_relative 'brute/prompts/identity'
|
|
32
|
+
require_relative 'brute/prompts/tone_and_style'
|
|
33
|
+
require_relative 'brute/prompts/objectivity'
|
|
34
|
+
require_relative 'brute/prompts/task_management'
|
|
35
|
+
require_relative 'brute/prompts/doing_tasks'
|
|
36
|
+
require_relative 'brute/prompts/tool_usage'
|
|
37
|
+
require_relative 'brute/prompts/conventions'
|
|
38
|
+
require_relative 'brute/prompts/git_safety'
|
|
39
|
+
require_relative 'brute/prompts/code_references'
|
|
40
|
+
require_relative 'brute/prompts/environment'
|
|
41
|
+
require_relative 'brute/prompts/instructions'
|
|
42
|
+
require_relative 'brute/prompts/editing_approach'
|
|
43
|
+
require_relative 'brute/prompts/autonomy'
|
|
44
|
+
require_relative 'brute/prompts/editing_constraints'
|
|
45
|
+
require_relative 'brute/prompts/frontend_tasks'
|
|
46
|
+
require_relative 'brute/prompts/proactiveness'
|
|
47
|
+
require_relative 'brute/prompts/code_style'
|
|
48
|
+
require_relative 'brute/prompts/security_and_safety'
|
|
49
|
+
require_relative 'brute/prompts/skills'
|
|
50
|
+
require_relative 'brute/prompts/plan_reminder'
|
|
51
|
+
require_relative 'brute/prompts/max_steps'
|
|
52
|
+
require_relative 'brute/prompts/build_switch'
|
|
53
|
+
require_relative 'brute/skill'
|
|
30
54
|
require_relative 'brute/system_prompt'
|
|
31
55
|
require_relative 'brute/message_store'
|
|
32
56
|
require_relative 'brute/session'
|
|
@@ -64,6 +88,7 @@ require_relative 'brute/tools/net_fetch'
|
|
|
64
88
|
require_relative 'brute/tools/todo_write'
|
|
65
89
|
require_relative 'brute/tools/todo_read'
|
|
66
90
|
require_relative 'brute/tools/delegate'
|
|
91
|
+
require_relative 'brute/tools/question'
|
|
67
92
|
|
|
68
93
|
# Orchestrator (depends on tools, middleware, and infrastructure)
|
|
69
94
|
require_relative 'brute/orchestrator'
|
|
@@ -81,7 +106,8 @@ module Brute
|
|
|
81
106
|
Tools::NetFetch,
|
|
82
107
|
Tools::TodoWrite,
|
|
83
108
|
Tools::TodoRead,
|
|
84
|
-
Tools::Delegate
|
|
109
|
+
Tools::Delegate,
|
|
110
|
+
Tools::Question
|
|
85
111
|
].freeze
|
|
86
112
|
|
|
87
113
|
# Default provider, resolved from environment.
|
|
@@ -94,13 +120,15 @@ module Brute
|
|
|
94
120
|
end
|
|
95
121
|
|
|
96
122
|
# Create a new orchestrator with sensible defaults.
|
|
97
|
-
def self.agent(cwd: Dir.pwd, tools: TOOLS, session: nil, reasoning: {}, **callbacks)
|
|
123
|
+
def self.agent(cwd: Dir.pwd, model: nil, tools: TOOLS, session: nil, reasoning: {}, agent_name: nil, **callbacks)
|
|
98
124
|
Orchestrator.new(
|
|
99
125
|
provider: provider,
|
|
126
|
+
model: model,
|
|
100
127
|
tools: tools,
|
|
101
128
|
cwd: cwd,
|
|
102
129
|
session: session,
|
|
103
130
|
reasoning: reasoning,
|
|
131
|
+
agent_name: agent_name,
|
|
104
132
|
**callbacks
|
|
105
133
|
)
|
|
106
134
|
end
|
|
@@ -114,6 +142,35 @@ module Brute
|
|
|
114
142
|
'xai' => ->(key) { LLM.xai(key: key) }
|
|
115
143
|
}.freeze
|
|
116
144
|
|
|
145
|
+
# List provider names that have API keys configured in the environment.
|
|
146
|
+
def self.configured_providers
|
|
147
|
+
PROVIDERS.keys.select { |name| api_key_for(name) }
|
|
148
|
+
end
|
|
149
|
+
|
|
150
|
+
# Build a provider instance for the given name using available API keys.
|
|
151
|
+
# Returns nil if no key is found.
|
|
152
|
+
def self.provider_for(name)
|
|
153
|
+
key = api_key_for(name)
|
|
154
|
+
return nil unless key
|
|
155
|
+
|
|
156
|
+
factory = PROVIDERS[name]
|
|
157
|
+
return nil unless factory
|
|
158
|
+
|
|
159
|
+
factory.call(key)
|
|
160
|
+
end
|
|
161
|
+
|
|
162
|
+
# Look up the API key for a given provider name.
|
|
163
|
+
def self.api_key_for(name)
|
|
164
|
+
# Explicit generic key always works
|
|
165
|
+
return ENV["LLM_API_KEY"] if ENV["LLM_API_KEY"]
|
|
166
|
+
|
|
167
|
+
case name
|
|
168
|
+
when "anthropic" then ENV["ANTHROPIC_API_KEY"]
|
|
169
|
+
when "openai" then ENV["OPENAI_API_KEY"]
|
|
170
|
+
when "google" then ENV["GOOGLE_API_KEY"]
|
|
171
|
+
end
|
|
172
|
+
end
|
|
173
|
+
|
|
117
174
|
# Resolve the LLM provider from environment variables.
|
|
118
175
|
#
|
|
119
176
|
# Checks in order:
|
metadata
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: brute
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.1.
|
|
4
|
+
version: 0.1.9
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Brute Contributors
|
|
8
8
|
bindir: bin
|
|
9
9
|
cert_chain: []
|
|
10
|
-
date: 1980-01-
|
|
10
|
+
date: 1980-01-01 00:00:00.000000000 Z
|
|
11
11
|
dependencies:
|
|
12
12
|
- !ruby/object:Gem::Dependency
|
|
13
13
|
name: async
|
|
@@ -114,7 +114,49 @@ files:
|
|
|
114
114
|
- lib/brute/patches/anthropic_tool_role.rb
|
|
115
115
|
- lib/brute/patches/buffer_nil_guard.rb
|
|
116
116
|
- lib/brute/pipeline.rb
|
|
117
|
+
- lib/brute/prompts/autonomy.rb
|
|
118
|
+
- lib/brute/prompts/base.rb
|
|
119
|
+
- lib/brute/prompts/build_switch.rb
|
|
120
|
+
- lib/brute/prompts/code_references.rb
|
|
121
|
+
- lib/brute/prompts/code_style.rb
|
|
122
|
+
- lib/brute/prompts/conventions.rb
|
|
123
|
+
- lib/brute/prompts/doing_tasks.rb
|
|
124
|
+
- lib/brute/prompts/editing_approach.rb
|
|
125
|
+
- lib/brute/prompts/editing_constraints.rb
|
|
126
|
+
- lib/brute/prompts/environment.rb
|
|
127
|
+
- lib/brute/prompts/frontend_tasks.rb
|
|
128
|
+
- lib/brute/prompts/git_safety.rb
|
|
129
|
+
- lib/brute/prompts/identity.rb
|
|
130
|
+
- lib/brute/prompts/instructions.rb
|
|
131
|
+
- lib/brute/prompts/max_steps.rb
|
|
132
|
+
- lib/brute/prompts/objectivity.rb
|
|
133
|
+
- lib/brute/prompts/plan_reminder.rb
|
|
134
|
+
- lib/brute/prompts/proactiveness.rb
|
|
135
|
+
- lib/brute/prompts/security_and_safety.rb
|
|
136
|
+
- lib/brute/prompts/skills.rb
|
|
137
|
+
- lib/brute/prompts/task_management.rb
|
|
138
|
+
- lib/brute/prompts/text/agents/compaction.txt
|
|
139
|
+
- lib/brute/prompts/text/agents/explore.txt
|
|
140
|
+
- lib/brute/prompts/text/agents/summary.txt
|
|
141
|
+
- lib/brute/prompts/text/agents/title.txt
|
|
142
|
+
- lib/brute/prompts/text/doing_tasks/anthropic.txt
|
|
143
|
+
- lib/brute/prompts/text/doing_tasks/default.txt
|
|
144
|
+
- lib/brute/prompts/text/doing_tasks/google.txt
|
|
145
|
+
- lib/brute/prompts/text/identity/anthropic.txt
|
|
146
|
+
- lib/brute/prompts/text/identity/default.txt
|
|
147
|
+
- lib/brute/prompts/text/identity/google.txt
|
|
148
|
+
- lib/brute/prompts/text/identity/openai.txt
|
|
149
|
+
- lib/brute/prompts/text/tone_and_style/anthropic.txt
|
|
150
|
+
- lib/brute/prompts/text/tone_and_style/default.txt
|
|
151
|
+
- lib/brute/prompts/text/tone_and_style/google.txt
|
|
152
|
+
- lib/brute/prompts/text/tone_and_style/openai.txt
|
|
153
|
+
- lib/brute/prompts/text/tool_usage/anthropic.txt
|
|
154
|
+
- lib/brute/prompts/text/tool_usage/default.txt
|
|
155
|
+
- lib/brute/prompts/text/tool_usage/google.txt
|
|
156
|
+
- lib/brute/prompts/tone_and_style.rb
|
|
157
|
+
- lib/brute/prompts/tool_usage.rb
|
|
117
158
|
- lib/brute/session.rb
|
|
159
|
+
- lib/brute/skill.rb
|
|
118
160
|
- lib/brute/snapshot_store.rb
|
|
119
161
|
- lib/brute/system_prompt.rb
|
|
120
162
|
- lib/brute/todo_store.rb
|
|
@@ -126,6 +168,7 @@ files:
|
|
|
126
168
|
- lib/brute/tools/fs_undo.rb
|
|
127
169
|
- lib/brute/tools/fs_write.rb
|
|
128
170
|
- lib/brute/tools/net_fetch.rb
|
|
171
|
+
- lib/brute/tools/question.rb
|
|
129
172
|
- lib/brute/tools/shell.rb
|
|
130
173
|
- lib/brute/tools/todo_read.rb
|
|
131
174
|
- lib/brute/tools/todo_write.rb
|