ollama_agent 0.1.0 → 0.3.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/.cursor/skills/ruby-code-review-levels/SKILL.md +115 -0
- data/.cursor/skills/self-improvement-sandbox-safety/SKILL.md +65 -0
- data/.env.example +25 -0
- data/CHANGELOG.md +40 -0
- data/README.md +135 -4
- data/docs/ARCHITECTURE.md +42 -0
- data/docs/PERFORMANCE.md +22 -0
- data/docs/SESSIONS.md +48 -0
- data/docs/TOOLS.md +53 -0
- data/docs/TOOL_RUNTIME.md +154 -0
- data/docs/superpowers/plans/2026-03-26-production-ready-ollama-agent.md +2454 -0
- data/docs/superpowers/specs/2026-03-26-production-ready-ollama-agent-design.md +400 -0
- data/lib/ollama_agent/agent/agent_config.rb +53 -0
- data/lib/ollama_agent/agent/client_wiring.rb +76 -0
- data/lib/ollama_agent/agent/prompt_wiring.rb +55 -0
- data/lib/ollama_agent/agent/session_wiring.rb +53 -0
- data/lib/ollama_agent/agent.rb +148 -73
- data/lib/ollama_agent/agent_prompt.rb +31 -1
- data/lib/ollama_agent/chat_stream_carry.rb +88 -0
- data/lib/ollama_agent/chat_stream_thinking_format.rb +29 -0
- data/lib/ollama_agent/cli.rb +394 -4
- data/lib/ollama_agent/console.rb +177 -5
- data/lib/ollama_agent/context/manager.rb +100 -0
- data/lib/ollama_agent/context/token_counter.rb +33 -0
- data/lib/ollama_agent/diff_path_validator.rb +32 -10
- data/lib/ollama_agent/env_config.rb +44 -0
- data/lib/ollama_agent/external_agents/TODO-plan.md +1948 -0
- data/lib/ollama_agent/external_agents/argv_interp.rb +21 -0
- data/lib/ollama_agent/external_agents/default_agents.yml +60 -0
- data/lib/ollama_agent/external_agents/delegate_logger.rb +31 -0
- data/lib/ollama_agent/external_agents/delegate_timeout_status.rb +12 -0
- data/lib/ollama_agent/external_agents/env_helpers.rb +38 -0
- data/lib/ollama_agent/external_agents/path_validator.rb +32 -0
- data/lib/ollama_agent/external_agents/probe.rb +122 -0
- data/lib/ollama_agent/external_agents/registry.rb +50 -0
- data/lib/ollama_agent/external_agents/runner.rb +118 -0
- data/lib/ollama_agent/external_agents.rb +9 -0
- data/lib/ollama_agent/global_dotenv.rb +39 -0
- data/lib/ollama_agent/model_env.rb +26 -0
- data/lib/ollama_agent/ollama_chat_thinking_stream.rb +41 -0
- data/lib/ollama_agent/ollama_connection.rb +6 -1
- data/lib/ollama_agent/patch_risk.rb +81 -0
- data/lib/ollama_agent/patch_support.rb +27 -1
- data/lib/ollama_agent/path_sandbox.rb +62 -0
- data/lib/ollama_agent/prompt_skills/clean_ruby.md +131 -0
- data/lib/ollama_agent/prompt_skills/code_review.md +112 -0
- data/lib/ollama_agent/prompt_skills/design_patterns.md +56 -0
- data/lib/ollama_agent/prompt_skills/manifest.yml +25 -0
- data/lib/ollama_agent/prompt_skills/ollama_agent_patterns.md +132 -0
- data/lib/ollama_agent/prompt_skills/rails_best_practices.md +41 -0
- data/lib/ollama_agent/prompt_skills/rails_style.md +138 -0
- data/lib/ollama_agent/prompt_skills/rspec.md +280 -0
- data/lib/ollama_agent/prompt_skills/rubocop.md +7 -0
- data/lib/ollama_agent/prompt_skills/ruby_style.md +121 -0
- data/lib/ollama_agent/prompt_skills/solid.md +270 -0
- data/lib/ollama_agent/prompt_skills/solid_ruby.md +223 -0
- data/lib/ollama_agent/prompt_skills.rb +169 -0
- data/lib/ollama_agent/repo_list.rb +4 -1
- data/lib/ollama_agent/resilience/audit_logger.rb +79 -0
- data/lib/ollama_agent/resilience/retry_middleware.rb +45 -0
- data/lib/ollama_agent/resilience/retry_policy.rb +51 -0
- data/lib/ollama_agent/ruby_index_tool_support.rb +17 -6
- data/lib/ollama_agent/runner.rb +123 -0
- data/lib/ollama_agent/sandboxed_tools/delegate_external.rb +62 -0
- data/lib/ollama_agent/sandboxed_tools/file_read_write.rb +100 -0
- data/lib/ollama_agent/sandboxed_tools/search_text.rb +60 -0
- data/lib/ollama_agent/sandboxed_tools.rb +55 -116
- data/lib/ollama_agent/search_backend.rb +93 -0
- data/lib/ollama_agent/self_improvement/analyzer.rb +34 -0
- data/lib/ollama_agent/self_improvement/improver.rb +340 -0
- data/lib/ollama_agent/self_improvement/modes.rb +25 -0
- data/lib/ollama_agent/self_improvement/ruby_mastery_context.rb +66 -0
- data/lib/ollama_agent/self_improvement.rb +5 -0
- data/lib/ollama_agent/session/session.rb +8 -0
- data/lib/ollama_agent/session/store.rb +68 -0
- data/lib/ollama_agent/streaming/console_streamer.rb +29 -0
- data/lib/ollama_agent/streaming/hooks.rb +39 -0
- data/lib/ollama_agent/tool_arguments.rb +13 -1
- data/lib/ollama_agent/tool_content_parser.rb +1 -1
- data/lib/ollama_agent/tool_runtime/executor.rb +34 -0
- data/lib/ollama_agent/tool_runtime/json_extractor.rb +62 -0
- data/lib/ollama_agent/tool_runtime/loop.rb +72 -0
- data/lib/ollama_agent/tool_runtime/memory.rb +32 -0
- data/lib/ollama_agent/tool_runtime/ollama_json_planner.rb +98 -0
- data/lib/ollama_agent/tool_runtime/plan_extractor.rb +12 -0
- data/lib/ollama_agent/tool_runtime/registry.rb +60 -0
- data/lib/ollama_agent/tool_runtime/tool.rb +24 -0
- data/lib/ollama_agent/tool_runtime.rb +24 -0
- data/lib/ollama_agent/tools/registry.rb +55 -0
- data/lib/ollama_agent/tools_schema.rb +74 -1
- data/lib/ollama_agent/user_prompt.rb +35 -0
- data/lib/ollama_agent/version.rb +1 -1
- data/lib/ollama_agent.rb +25 -0
- data/reproduce_429.rb +40 -0
- data/sig/ollama_agent.rbs +111 -1
- metadata +78 -2
data/sig/ollama_agent.rbs
CHANGED
|
@@ -1,4 +1,114 @@
|
|
|
1
1
|
module OllamaAgent
|
|
2
2
|
VERSION: String
|
|
3
|
-
|
|
3
|
+
|
|
4
|
+
class Error < StandardError
|
|
5
|
+
end
|
|
6
|
+
|
|
7
|
+
class ConfigurationError < Error
|
|
8
|
+
end
|
|
9
|
+
|
|
10
|
+
module EnvConfig
|
|
11
|
+
def self.strict_env?: () -> bool
|
|
12
|
+
def self.warn_invalid: (String name, untyped raw, untyped fallback) -> void
|
|
13
|
+
def self.fetch_int: (String name, Integer default, ?strict: bool) -> Integer
|
|
14
|
+
def self.fetch_float: (String name, Float default, ?strict: bool) -> Float
|
|
15
|
+
end
|
|
16
|
+
|
|
17
|
+
module PathSandbox
|
|
18
|
+
def self.allowed?: (String root_abs, String root_real, String? user_path) -> bool
|
|
19
|
+
def self.lexically_under_root_abs?: (String expanded_abs, String root_abs) -> bool
|
|
20
|
+
def self.candidate_under_root?: (String expanded_abs, String root_real, String root_abs) -> bool
|
|
21
|
+
def self.under_root_real?: (String path_real, String root_real) -> bool
|
|
22
|
+
def self.nonexistent_path_allowed_under_root?: (String expanded_abs, String root_real, String root_abs) -> bool
|
|
23
|
+
end
|
|
24
|
+
|
|
25
|
+
module SearchBackend
|
|
26
|
+
def self.clear_cache!: () -> void
|
|
27
|
+
def self.rg_executable: () -> String?
|
|
28
|
+
def self.grep_executable: () -> String?
|
|
29
|
+
end
|
|
30
|
+
|
|
31
|
+
class Agent
|
|
32
|
+
attr_reader client: untyped
|
|
33
|
+
attr_reader root: String
|
|
34
|
+
attr_reader hooks: Streaming::Hooks
|
|
35
|
+
|
|
36
|
+
def initialize: (?client: untyped, ?config: AgentConfig?, **untyped) -> void
|
|
37
|
+
def run: (String query) -> void
|
|
38
|
+
|
|
39
|
+
class AgentConfig
|
|
40
|
+
attr_reader model: String?
|
|
41
|
+
attr_reader root: String?
|
|
42
|
+
attr_reader confirm_patches: bool
|
|
43
|
+
attr_reader read_only: bool
|
|
44
|
+
attr_reader orchestrator: bool
|
|
45
|
+
attr_reader stdin: IO
|
|
46
|
+
attr_reader stdout: IO
|
|
47
|
+
|
|
48
|
+
def initialize: (**untyped) -> void
|
|
49
|
+
def resolved_confirm_delegation: () -> bool
|
|
50
|
+
end
|
|
51
|
+
end
|
|
52
|
+
|
|
53
|
+
class Runner
|
|
54
|
+
def self.build: (**untyped) -> Runner
|
|
55
|
+
def run: (String query) -> void
|
|
56
|
+
def hooks: () -> Streaming::Hooks
|
|
57
|
+
end
|
|
58
|
+
|
|
59
|
+
module Streaming
|
|
60
|
+
class Hooks
|
|
61
|
+
EVENTS: Array[Symbol]
|
|
62
|
+
MISSING_BLOCK_MESSAGE: String
|
|
63
|
+
|
|
64
|
+
def initialize: () -> void
|
|
65
|
+
def on: (Symbol event) { (untyped payload) -> void } -> void
|
|
66
|
+
def emit: (Symbol event, untyped payload) -> void
|
|
67
|
+
def subscribed?: (Symbol event) -> bool
|
|
68
|
+
end
|
|
69
|
+
end
|
|
70
|
+
|
|
71
|
+
module Resilience
|
|
72
|
+
class RetryPolicy
|
|
73
|
+
DEFAULT_MAX_ATTEMPTS: Integer
|
|
74
|
+
DEFAULT_BASE_DELAY: Float
|
|
75
|
+
RETRYABLE: Array[singleton(Class)]
|
|
76
|
+
|
|
77
|
+
attr_reader max_attempts: Integer
|
|
78
|
+
attr_reader base_delay: Float
|
|
79
|
+
|
|
80
|
+
def initialize: (?max_attempts: Integer, ?base_delay: Float) -> void
|
|
81
|
+
def retryable_http_error?: (StandardError error) -> bool
|
|
82
|
+
def backoff: (Integer attempt) -> Float
|
|
83
|
+
end
|
|
84
|
+
|
|
85
|
+
class RetryMiddleware
|
|
86
|
+
def initialize: (client: untyped, ?max_attempts: Integer, ?hooks: Streaming::Hooks?, ?base_delay: Float) -> void
|
|
87
|
+
def chat: (**untyped) -> untyped
|
|
88
|
+
end
|
|
89
|
+
end
|
|
90
|
+
|
|
91
|
+
module ToolRuntime
|
|
92
|
+
module PlanExtractor
|
|
93
|
+
end
|
|
94
|
+
|
|
95
|
+
class Loop
|
|
96
|
+
attr_reader max_steps: Integer
|
|
97
|
+
attr_reader plan_extractor: untyped
|
|
98
|
+
|
|
99
|
+
def planner: () -> untyped
|
|
100
|
+
|
|
101
|
+
def initialize: (
|
|
102
|
+
?plan_extractor: untyped,
|
|
103
|
+
?planner: untyped,
|
|
104
|
+
registry: Registry,
|
|
105
|
+
executor: Executor,
|
|
106
|
+
memory: Memory,
|
|
107
|
+
?logger: untyped,
|
|
108
|
+
?max_steps: Integer
|
|
109
|
+
) -> void
|
|
110
|
+
|
|
111
|
+
def run: (context: untyped) -> untyped
|
|
112
|
+
end
|
|
113
|
+
end
|
|
4
114
|
end
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: ollama_agent
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.
|
|
4
|
+
version: 0.3.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Shubham Taywade
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: exe
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2026-
|
|
11
|
+
date: 2026-04-10 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: dotenv
|
|
@@ -120,22 +120,72 @@ files:
|
|
|
120
120
|
- ".cursor/.gitignore"
|
|
121
121
|
- ".cursor/skills/ollama-agent-patterns/SKILL.md"
|
|
122
122
|
- ".cursor/skills/ollama-agent-patterns/reference.md"
|
|
123
|
+
- ".cursor/skills/ruby-code-review-levels/SKILL.md"
|
|
124
|
+
- ".cursor/skills/self-improvement-sandbox-safety/SKILL.md"
|
|
123
125
|
- ".env.example"
|
|
124
126
|
- CHANGELOG.md
|
|
125
127
|
- CODE_OF_CONDUCT.md
|
|
126
128
|
- LICENSE.txt
|
|
127
129
|
- README.md
|
|
128
130
|
- Rakefile
|
|
131
|
+
- docs/ARCHITECTURE.md
|
|
132
|
+
- docs/PERFORMANCE.md
|
|
133
|
+
- docs/SESSIONS.md
|
|
134
|
+
- docs/TOOLS.md
|
|
135
|
+
- docs/TOOL_RUNTIME.md
|
|
136
|
+
- docs/superpowers/plans/2026-03-26-production-ready-ollama-agent.md
|
|
137
|
+
- docs/superpowers/specs/2026-03-26-production-ready-ollama-agent-design.md
|
|
129
138
|
- exe/ollama_agent
|
|
130
139
|
- lib/ollama_agent.rb
|
|
131
140
|
- lib/ollama_agent/agent.rb
|
|
141
|
+
- lib/ollama_agent/agent/agent_config.rb
|
|
142
|
+
- lib/ollama_agent/agent/client_wiring.rb
|
|
143
|
+
- lib/ollama_agent/agent/prompt_wiring.rb
|
|
144
|
+
- lib/ollama_agent/agent/session_wiring.rb
|
|
132
145
|
- lib/ollama_agent/agent_prompt.rb
|
|
146
|
+
- lib/ollama_agent/chat_stream_carry.rb
|
|
147
|
+
- lib/ollama_agent/chat_stream_thinking_format.rb
|
|
133
148
|
- lib/ollama_agent/cli.rb
|
|
134
149
|
- lib/ollama_agent/console.rb
|
|
150
|
+
- lib/ollama_agent/context/manager.rb
|
|
151
|
+
- lib/ollama_agent/context/token_counter.rb
|
|
135
152
|
- lib/ollama_agent/diff_path_validator.rb
|
|
153
|
+
- lib/ollama_agent/env_config.rb
|
|
154
|
+
- lib/ollama_agent/external_agents.rb
|
|
155
|
+
- lib/ollama_agent/external_agents/TODO-plan.md
|
|
156
|
+
- lib/ollama_agent/external_agents/argv_interp.rb
|
|
157
|
+
- lib/ollama_agent/external_agents/default_agents.yml
|
|
158
|
+
- lib/ollama_agent/external_agents/delegate_logger.rb
|
|
159
|
+
- lib/ollama_agent/external_agents/delegate_timeout_status.rb
|
|
160
|
+
- lib/ollama_agent/external_agents/env_helpers.rb
|
|
161
|
+
- lib/ollama_agent/external_agents/path_validator.rb
|
|
162
|
+
- lib/ollama_agent/external_agents/probe.rb
|
|
163
|
+
- lib/ollama_agent/external_agents/registry.rb
|
|
164
|
+
- lib/ollama_agent/external_agents/runner.rb
|
|
165
|
+
- lib/ollama_agent/global_dotenv.rb
|
|
166
|
+
- lib/ollama_agent/model_env.rb
|
|
167
|
+
- lib/ollama_agent/ollama_chat_thinking_stream.rb
|
|
136
168
|
- lib/ollama_agent/ollama_connection.rb
|
|
169
|
+
- lib/ollama_agent/patch_risk.rb
|
|
137
170
|
- lib/ollama_agent/patch_support.rb
|
|
171
|
+
- lib/ollama_agent/path_sandbox.rb
|
|
172
|
+
- lib/ollama_agent/prompt_skills.rb
|
|
173
|
+
- lib/ollama_agent/prompt_skills/clean_ruby.md
|
|
174
|
+
- lib/ollama_agent/prompt_skills/code_review.md
|
|
175
|
+
- lib/ollama_agent/prompt_skills/design_patterns.md
|
|
176
|
+
- lib/ollama_agent/prompt_skills/manifest.yml
|
|
177
|
+
- lib/ollama_agent/prompt_skills/ollama_agent_patterns.md
|
|
178
|
+
- lib/ollama_agent/prompt_skills/rails_best_practices.md
|
|
179
|
+
- lib/ollama_agent/prompt_skills/rails_style.md
|
|
180
|
+
- lib/ollama_agent/prompt_skills/rspec.md
|
|
181
|
+
- lib/ollama_agent/prompt_skills/rubocop.md
|
|
182
|
+
- lib/ollama_agent/prompt_skills/ruby_style.md
|
|
183
|
+
- lib/ollama_agent/prompt_skills/solid.md
|
|
184
|
+
- lib/ollama_agent/prompt_skills/solid_ruby.md
|
|
138
185
|
- lib/ollama_agent/repo_list.rb
|
|
186
|
+
- lib/ollama_agent/resilience/audit_logger.rb
|
|
187
|
+
- lib/ollama_agent/resilience/retry_middleware.rb
|
|
188
|
+
- lib/ollama_agent/resilience/retry_policy.rb
|
|
139
189
|
- lib/ollama_agent/ruby_index.rb
|
|
140
190
|
- lib/ollama_agent/ruby_index/builder.rb
|
|
141
191
|
- lib/ollama_agent/ruby_index/extractor_visitor.rb
|
|
@@ -144,13 +194,39 @@ files:
|
|
|
144
194
|
- lib/ollama_agent/ruby_index/naming.rb
|
|
145
195
|
- lib/ollama_agent/ruby_index_tool_support.rb
|
|
146
196
|
- lib/ollama_agent/ruby_search_modes.rb
|
|
197
|
+
- lib/ollama_agent/runner.rb
|
|
147
198
|
- lib/ollama_agent/sandboxed_tools.rb
|
|
199
|
+
- lib/ollama_agent/sandboxed_tools/delegate_external.rb
|
|
200
|
+
- lib/ollama_agent/sandboxed_tools/file_read_write.rb
|
|
201
|
+
- lib/ollama_agent/sandboxed_tools/search_text.rb
|
|
202
|
+
- lib/ollama_agent/search_backend.rb
|
|
203
|
+
- lib/ollama_agent/self_improvement.rb
|
|
204
|
+
- lib/ollama_agent/self_improvement/analyzer.rb
|
|
205
|
+
- lib/ollama_agent/self_improvement/improver.rb
|
|
206
|
+
- lib/ollama_agent/self_improvement/modes.rb
|
|
207
|
+
- lib/ollama_agent/self_improvement/ruby_mastery_context.rb
|
|
208
|
+
- lib/ollama_agent/session/session.rb
|
|
209
|
+
- lib/ollama_agent/session/store.rb
|
|
210
|
+
- lib/ollama_agent/streaming/console_streamer.rb
|
|
211
|
+
- lib/ollama_agent/streaming/hooks.rb
|
|
148
212
|
- lib/ollama_agent/think_param.rb
|
|
149
213
|
- lib/ollama_agent/timeout_param.rb
|
|
150
214
|
- lib/ollama_agent/tool_arguments.rb
|
|
151
215
|
- lib/ollama_agent/tool_content_parser.rb
|
|
216
|
+
- lib/ollama_agent/tool_runtime.rb
|
|
217
|
+
- lib/ollama_agent/tool_runtime/executor.rb
|
|
218
|
+
- lib/ollama_agent/tool_runtime/json_extractor.rb
|
|
219
|
+
- lib/ollama_agent/tool_runtime/loop.rb
|
|
220
|
+
- lib/ollama_agent/tool_runtime/memory.rb
|
|
221
|
+
- lib/ollama_agent/tool_runtime/ollama_json_planner.rb
|
|
222
|
+
- lib/ollama_agent/tool_runtime/plan_extractor.rb
|
|
223
|
+
- lib/ollama_agent/tool_runtime/registry.rb
|
|
224
|
+
- lib/ollama_agent/tool_runtime/tool.rb
|
|
225
|
+
- lib/ollama_agent/tools/registry.rb
|
|
152
226
|
- lib/ollama_agent/tools_schema.rb
|
|
227
|
+
- lib/ollama_agent/user_prompt.rb
|
|
153
228
|
- lib/ollama_agent/version.rb
|
|
229
|
+
- reproduce_429.rb
|
|
154
230
|
- sig/ollama_agent.rbs
|
|
155
231
|
homepage: https://github.com/shubhamtaywade82/ollama_agent
|
|
156
232
|
licenses:
|