ollama_chat 0.0.81 → 0.0.83
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/CHANGES.md +135 -104
- data/Rakefile +2 -2
- data/lib/ollama_chat/chat.rb +4 -4
- data/lib/ollama_chat/config_handling.rb +3 -3
- data/lib/ollama_chat/conversation.rb +1 -1
- data/lib/ollama_chat/dialog.rb +24 -8
- data/lib/ollama_chat/follow_chat.rb +13 -4
- data/lib/ollama_chat/message_output.rb +1 -1
- data/lib/ollama_chat/ollama_chat_config/default_config.yml +22 -0
- data/lib/ollama_chat/personae_management.rb +2 -2
- data/lib/ollama_chat/server_socket.rb +1 -1
- data/lib/ollama_chat/tools/paste_into_editor.rb +4 -5
- data/lib/ollama_chat/tools/resolve_tag.rb +1 -1
- data/lib/ollama_chat/utils/tag_resolver.rb +14 -7
- data/lib/ollama_chat/version.rb +1 -1
- data/ollama_chat.gemspec +5 -5
- data/spec/ollama_chat/tools/resolve_tag_spec.rb +6 -0
- metadata +6 -6
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 8947d6cdb437ce85afb32cb689bad1b16de54c2afb35da9f0eac7b1f1fff19df
|
|
4
|
+
data.tar.gz: 3a03448c69d3f8883e11d5de11e9f44c455a4a8e95e2d93593d945dc99a0be63
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 02e28130adb2881c44ea053035b5b39eb43025bf0e761063e6442a031b8b8acd88fe588850438ff0ae3c9fcf039ca4cff32bcb5abae4bcca4a349852a217580b
|
|
7
|
+
data.tar.gz: 1055061e111fff2384020505b467b60ab30facc7fbf5733856061adc6834401a5414ba28a6716452b5b5fe2bb8ec5a77d54fc81d2e3ed065f0b9568847ce326c
|
data/CHANGES.md
CHANGED
|
@@ -1,34 +1,65 @@
|
|
|
1
1
|
# Changes
|
|
2
2
|
|
|
3
|
+
## 2026-03-24 v0.0.83
|
|
4
|
+
|
|
5
|
+
- Added timeout support to `Dialog#confirm?`: introduced optional `timeout:`
|
|
6
|
+
and `default:` parameters, injected `IO.select` logic to respect the supplied
|
|
7
|
+
timeout and return the `default` when timed out, and updated YARD comments to
|
|
8
|
+
document the new parameters and return behavior.
|
|
9
|
+
- Normalized namespaced tool calls in `OllamaChat`: updated
|
|
10
|
+
`lib/ollama_chat/follow_chat.rb` to extract the basename from `name` when it
|
|
11
|
+
contains a slash, added a warning log `@chat.log(:warn, msg)` to inform users
|
|
12
|
+
when a namespaced tool call is corrected, and adjusted the `name` variable so
|
|
13
|
+
that `@chat.tool_configured?(name)` and subsequent logic use the corrected
|
|
14
|
+
tool name.
|
|
15
|
+
- Updated `OllamaChat::Dialog#choose_collection` to convert
|
|
16
|
+
`@documents.collections` to an array before concatenation, ensuring
|
|
17
|
+
consistent behavior when collections are not already arrays (e.g., NULL
|
|
18
|
+
objects).
|
|
19
|
+
|
|
20
|
+
## 2026-03-21 v0.0.82
|
|
21
|
+
|
|
22
|
+
- Add a `before` block setting `OC::OLLAMA::CHAT::TOOLS::CTAGS_TOOL` to `ctags`
|
|
23
|
+
in the `resolve_tag` spec.
|
|
24
|
+
- Updated `OllamaChat::Tools::PasteIntoEditor` description to use `text`
|
|
25
|
+
instead of `string` and clarified that no file or line is required when
|
|
26
|
+
pasting into the editor.
|
|
27
|
+
- Added bell and question mark emojis to various `confirm?` and `ask?` prompts
|
|
28
|
+
across multiple modules for clearer UX.
|
|
29
|
+
- Updated prompt string to `⏎ Press …` for better display.
|
|
30
|
+
- Enhanced `OllamaChat::Tools::ResolveTag` and `OllamaChat::Utils::TagResolver`
|
|
31
|
+
with a new `kinds` method, updated `kind` parameter description, refactored
|
|
32
|
+
`kind_of`, and fixed tag‑parsing regex to capture all columns.
|
|
33
|
+
|
|
3
34
|
## 2026-03-20 v0.0.81
|
|
4
35
|
|
|
5
36
|
- Added `http_handling.rb` and `path_completer.rb` to gemspec
|
|
6
37
|
`s.extra_rdoc_files`, `s.files`, and `s.test_files` lists, ensuring these
|
|
7
|
-
modules are documented and packaged.
|
|
8
|
-
- Updated `http_options` to build SSL and proxy settings.
|
|
9
|
-
- Completed `get_url` to merge headers, pass cache, debug, and reraise flags.
|
|
10
|
-
- Updated YARD comments with parameter and return details.
|
|
11
|
-
- Fixed `config.request_headers` usage and added `merge`.
|
|
12
|
-
- Declared `proxy` variable in options hash.
|
|
13
|
-
- Added `debug` flag from `config` to fetcher call.
|
|
38
|
+
modules are documented and packaged.
|
|
39
|
+
- Updated `http_options` to build SSL and proxy settings.
|
|
40
|
+
- Completed `get_url` to merge headers, pass cache, debug, and reraise flags.
|
|
41
|
+
- Updated YARD comments with parameter and return details.
|
|
42
|
+
- Fixed `config.request_headers` usage and added `merge`.
|
|
43
|
+
- Declared `proxy` variable in options hash.
|
|
44
|
+
- Added `debug` flag from `config` to fetcher call.
|
|
14
45
|
- Added `PathCompleter` utility in `lib/ollama_chat/utils/path_completer.rb`
|
|
15
|
-
that expands `./` and `~/` paths using `Dir.glob` and `File.expand_path`.
|
|
16
|
-
- Updated `lib/ollama_chat/utils.rb` to require the new helper.
|
|
46
|
+
that expands `./` and `~/` paths using `Dir.glob` and `File.expand_path`.
|
|
47
|
+
- Updated `lib/ollama_chat/utils.rb` to require the new helper.
|
|
17
48
|
- Replaced inline path completion logic in `lib/ollama_chat/chat.rb` with
|
|
18
|
-
`OllamaChat::Utils::PathCompleter.new(pre, input).complete`.
|
|
49
|
+
`OllamaChat::Utils::PathCompleter.new(pre, input).complete`.
|
|
19
50
|
- Added tests for `PathCompleter` in
|
|
20
51
|
`spec/ollama_chat/utils/path_completer_spec.rb`, stubbing `expand_path` for
|
|
21
|
-
home‑directory case.
|
|
52
|
+
home‑directory case.
|
|
22
53
|
- Added duration metric to tool call results: recorded `start = Time.now`
|
|
23
54
|
before each tool call, stored `tools_used[name]` as a hash with `size` and
|
|
24
55
|
`duration` keys, calculated `duration` with `Time.now - start` and formatted
|
|
25
56
|
as `Tins::Duration.new(...).to_s`, kept size formatting using
|
|
26
|
-
`Tins::Unit.format(..., unit: ?B, prefix: 1024, format: '%.1f %U')`.
|
|
57
|
+
`Tins::Unit.format(..., unit: ?B, prefix: 1024, format: '%.1f %U')`.
|
|
27
58
|
- Added `./` file path completion to Reline: updated
|
|
28
59
|
`OllamaChat::Chat#enable_command_completion` to add `./` path completion,
|
|
29
60
|
replaced old `RELINE` completion proc with a new `case before` block that
|
|
30
61
|
checks for `^/` and `./` patterns, ensuring file path completions are only
|
|
31
|
-
offered when the user starts with `./`.
|
|
62
|
+
offered when the user starts with `./`.
|
|
32
63
|
- Added user name to runtime info and prompts: added `OC::USER` config variable
|
|
33
64
|
with default from `ENV['USER']`, included `user` in the hash returned by
|
|
34
65
|
`runtime_information_values`, extended default prompts in
|
|
@@ -40,166 +71,166 @@
|
|
|
40
71
|
|
|
41
72
|
### Output & Paging
|
|
42
73
|
|
|
43
|
-
- Remove the automatic `info` call from the main flow
|
|
44
|
-
- Wrap all output handling inside a `use_pager do |output|` block
|
|
74
|
+
- Remove the automatic `info` call from the main flow
|
|
75
|
+
- Wrap all output handling inside a `use_pager do |output|` block
|
|
45
76
|
- Pass the `output:` keyword to sub‑methods (`collection_stats`,
|
|
46
|
-
`Switches.show`, etc.)
|
|
47
|
-
- Adjust `Pager` to use a local `buffer` variable and `output.puts buffer`
|
|
77
|
+
`Switches.show`, etc.)
|
|
78
|
+
- Adjust `Pager` to use a local `buffer` variable and `output.puts buffer`
|
|
48
79
|
- Update `StateSelectors.show` and `Switches.show` to accept `output: STDOUT`
|
|
49
|
-
and use `output.puts`
|
|
80
|
+
and use `output.puts`
|
|
50
81
|
- Modify `Switches.set` to accept `output: STDOUT` and call
|
|
51
82
|
`self.show(output:)`
|
|
52
83
|
|
|
53
84
|
### Collection & Runtime Info
|
|
54
85
|
|
|
55
86
|
- Change `collection_stats` signature to `output: STDOUT` and replace
|
|
56
|
-
`STDOUT.puts` with `output.puts`
|
|
57
|
-
- Show runtime‑information only when `runtime_info.on? && content` is true
|
|
87
|
+
`STDOUT.puts` with `output.puts`
|
|
88
|
+
- Show runtime‑information only when `runtime_info.on? && content` is true
|
|
58
89
|
- Append a JSON line for runtime‑info instead of a plain‑text list
|
|
59
90
|
|
|
60
91
|
### Tool Call Handling
|
|
61
92
|
|
|
62
|
-
- Initialize `tools_used` hash in `OllamaChat::FollowChat#handle_tool_calls`
|
|
63
|
-
- Store the formatted size of each tool result using `Tins::Unit.format`
|
|
93
|
+
- Initialize `tools_used` hash in `OllamaChat::FollowChat#handle_tool_calls`
|
|
94
|
+
- Store the formatted size of each tool result using `Tins::Unit.format`
|
|
64
95
|
- Replace the non‑existent `full?` check with `size ==
|
|
65
|
-
response.message.tool_calls.size`
|
|
96
|
+
response.message.tool_calls.size`
|
|
66
97
|
- Show a summary of tool call results and pause for user confirmation
|
|
67
98
|
|
|
68
99
|
### Confirmation Prompt
|
|
69
100
|
|
|
70
101
|
- Add `confirm?` method to `OllamaChat::Dialog` for single‑character
|
|
71
|
-
confirmation prompts
|
|
102
|
+
confirmation prompts
|
|
72
103
|
- Replace all `ask?` calls with `confirm?`
|
|
73
104
|
|
|
74
105
|
### Command DSL
|
|
75
106
|
|
|
76
|
-
- Add a `command` DSL in `command_concern.rb` for registering chat commands
|
|
107
|
+
- Add a `command` DSL in `command_concern.rb` for registering chat commands
|
|
77
108
|
- Include `OllamaChat::CommandConcern` in `chat.rb` and drop the old
|
|
78
|
-
`handle_input` logic
|
|
109
|
+
`handle_input` logic
|
|
79
110
|
- Replace hard‑coded command handling with the new DSL (e.g., `/toggle`,
|
|
80
111
|
`/input`, `/revise`, etc.)
|
|
81
112
|
|
|
82
113
|
### Documentation & README
|
|
83
114
|
|
|
84
115
|
- Update `README.md` to show the new `/toggle` syntax and expanded command
|
|
85
|
-
table
|
|
116
|
+
table
|
|
86
117
|
- Update `bin/ollama_chat_send` help text to reflect the renamed `/input`
|
|
87
118
|
command
|
|
88
119
|
|
|
89
120
|
### Utility Helpers
|
|
90
121
|
|
|
91
|
-
- Add `go_command` helper in `dialog.rb` for parsing command‑line options
|
|
122
|
+
- Add `go_command` helper in `dialog.rb` for parsing command‑line options
|
|
92
123
|
- Add `file_set_each`, `all_file_set`, and `provide_file_set_content` to
|
|
93
|
-
`input_content.rb`
|
|
94
|
-
- Update `context_spook` to use `file_set_each` and accept an `all` flag
|
|
95
|
-
- Add `strip_internal_json_markers` helper in `chat.rb`
|
|
124
|
+
`input_content.rb`
|
|
125
|
+
- Update `context_spook` to use `file_set_each` and accept an `all` flag
|
|
126
|
+
- Add `strip_internal_json_markers` helper in `chat.rb`
|
|
96
127
|
- Add `choose_file_set` helper in `OllamaChat::Dialog` returning a `Set` of
|
|
97
128
|
expanded `Pathname` objects
|
|
98
129
|
|
|
99
130
|
### Source Fetching & Links
|
|
100
131
|
|
|
101
|
-
- Refactor `source_fetching.rb` to coerce sources to string
|
|
132
|
+
- Refactor `source_fetching.rb` to coerce sources to string
|
|
102
133
|
- Add a lazy `links` method and remove the old `links` method from `Chat`
|
|
103
134
|
|
|
104
135
|
### Retrieval Snippets
|
|
105
136
|
|
|
106
137
|
- Update retrieval‑snippet injection to use a JSON block instead of a
|
|
107
|
-
plain‑text list
|
|
138
|
+
plain‑text list
|
|
108
139
|
- Use `strip_internal_json_markers` for `:ollama_chat_retrieval_snippets` and
|
|
109
|
-
`:ollama_chat_runtime_information`
|
|
140
|
+
`:ollama_chat_runtime_information`
|
|
110
141
|
- Truncate user query to `config.embedding.model.context_length` before calling
|
|
111
142
|
`@documents.find_where`
|
|
112
143
|
|
|
113
144
|
### Directory Structure Tool
|
|
114
145
|
|
|
115
|
-
- Add `suffix` parameter to `directory_structure` function
|
|
146
|
+
- Add `suffix` parameter to `directory_structure` function
|
|
116
147
|
- Update `OllamaChat::Utils::AnalyzeDirectory.generate_structure` to accept a
|
|
117
|
-
`suffix:` argument and filter files accordingly
|
|
148
|
+
`suffix:` argument and filter files accordingly
|
|
118
149
|
- Ensure only files matching the given extension are included; hidden files and
|
|
119
150
|
symlinks remain excluded
|
|
120
151
|
|
|
121
152
|
### Persona Management
|
|
122
153
|
|
|
123
|
-
- Update persona option labels to `keep`, `reload_default`, `choose_different`
|
|
124
|
-
- Add interactive persona reload options via a menu in `reload_default_persona`
|
|
125
|
-
- Use `SearchUI::Wrapper` and `OllamaChat::Utils::Chooser` for selection
|
|
154
|
+
- Update persona option labels to `keep`, `reload_default`, `choose_different`
|
|
155
|
+
- Add interactive persona reload options via a menu in `reload_default_persona`
|
|
156
|
+
- Use `SearchUI::Wrapper` and `OllamaChat::Utils::Chooser` for selection
|
|
126
157
|
- Update `@default_persona` when selecting “load_new”
|
|
127
158
|
|
|
128
159
|
### Path Validation
|
|
129
160
|
|
|
130
|
-
- Add `check_file` flag to `path_validator.rb` method signature
|
|
131
|
-
- Guard against non‑directory parents and file existence when `check_file:true`
|
|
161
|
+
- Add `check_file` flag to `path_validator.rb` method signature
|
|
162
|
+
- Guard against non‑directory parents and file existence when `check_file:true`
|
|
132
163
|
- Propagate `check_file` flag in calls from `file_context`, `patch_file`, and
|
|
133
164
|
`read_file`
|
|
134
165
|
|
|
135
166
|
### Tests & Specs
|
|
136
167
|
|
|
137
168
|
- Adjust specs to stub `OC::PAGER`, expect `use_pager` yielding a `StringIO`,
|
|
138
|
-
and verify `STDOUT.puts` calls
|
|
139
|
-
- Update test expectations for new command handling and help output
|
|
169
|
+
and verify `STDOUT.puts` calls
|
|
170
|
+
- Update test expectations for new command handling and help output
|
|
140
171
|
- Expect `OllamaChat::InvalidPathError` instead of `Errno::ENOENT` in relevant
|
|
141
|
-
specs
|
|
172
|
+
specs
|
|
142
173
|
- Add `asset_pathname` helper in `spec_helper.rb`
|
|
143
174
|
|
|
144
175
|
### Miscellaneous
|
|
145
176
|
|
|
146
|
-
- Add `reline` gem to `.utilsrc` dependency list
|
|
177
|
+
- Add `reline` gem to `.utilsrc` dependency list
|
|
147
178
|
- Consider `-c` flag to skip persona setup when loading an existing
|
|
148
|
-
conversation
|
|
179
|
+
conversation
|
|
149
180
|
- Standardize `register_name` method comments to `@return [String] the
|
|
150
|
-
registered name for this tool`
|
|
181
|
+
registered name for this tool`
|
|
151
182
|
|
|
152
183
|
## 2026-03-13 v0.0.79
|
|
153
184
|
|
|
154
|
-
- Added `tmp/*` to Rakefile ignore list for cleaner builds.
|
|
155
|
-
- Updated gemspec: changed `s.rubygems_version` to **3.6.9**.
|
|
156
|
-
- Added `logging.rb` to `extra_rdoc_files` and `files` in gemspec.
|
|
157
|
-
- Adjusted gemspec file list to reflect new structure.
|
|
158
|
-
- Removed `Runtime Directory` (`-d`) explanation from `README.md`.
|
|
159
|
-
- Updated URL in `README.md`.
|
|
185
|
+
- Added `tmp/*` to Rakefile ignore list for cleaner builds.
|
|
186
|
+
- Updated gemspec: changed `s.rubygems_version` to **3.6.9**.
|
|
187
|
+
- Added `logging.rb` to `extra_rdoc_files` and `files` in gemspec.
|
|
188
|
+
- Adjusted gemspec file list to reflect new structure.
|
|
189
|
+
- Removed `Runtime Directory` (`-d`) explanation from `README.md`.
|
|
190
|
+
- Updated URL in `README.md`.
|
|
160
191
|
- Added explicit check that `args.path.full?` is true before calling
|
|
161
192
|
`assert_valid_path`, raising `ArgumentError` with message `'require path to
|
|
162
|
-
file to be patched'`.
|
|
193
|
+
file to be patched'`.
|
|
163
194
|
- Updated path assignment to first validate presence, then assert validity
|
|
164
|
-
against `config.tools.functions.patch_file.allowed?`.
|
|
195
|
+
against `config.tools.functions.patch_file.allowed?`.
|
|
165
196
|
- Updated `OllamaChat::Tools::ExecuteGrep` to accept new options `before`,
|
|
166
|
-
`after`, and `context`.
|
|
167
|
-
- Added helper method `normalize_number` for optional integer arguments.
|
|
197
|
+
`after`, and `context`.
|
|
198
|
+
- Added helper method `normalize_number` for optional integer arguments.
|
|
168
199
|
- Adjusted command template in `default_config.yml` to include `-B`, `-A`, and
|
|
169
|
-
`-C` flags based on provided values.
|
|
200
|
+
`-C` flags based on provided values.
|
|
170
201
|
- Refactored logging: replaced `logger.error` / `logger.warn` calls with
|
|
171
|
-
`log(:error, …)` or `log(:warn, …)` across multiple files.
|
|
202
|
+
`log(:error, …)` or `log(:warn, …)` across multiple files.
|
|
172
203
|
- Added optional `warn: true` flag to new helper so that critical errors also
|
|
173
204
|
trigger a user‑visible warning output while still being written to the log
|
|
174
|
-
file.
|
|
205
|
+
file.
|
|
175
206
|
- Implemented `OllamaChat::Logging#log(severity, msg, warn:)` in `logging.rb`;
|
|
176
207
|
it formats exceptions with backtraces and forwards messages to the underlying
|
|
177
|
-
Ruby `Logger`.
|
|
208
|
+
Ruby `Logger`.
|
|
178
209
|
- Updated `spec_helper.rb` by adding a global `config.before` hook that sets
|
|
179
210
|
temporary paths for `OC::OLLAMA::CHAT::HISTORY` and `LOGFILE` so all specs
|
|
180
|
-
run against isolated files.
|
|
181
|
-
- Added `tmp/*` to `.gitignore`.
|
|
211
|
+
run against isolated files.
|
|
212
|
+
- Added `tmp/*` to `.gitignore`.
|
|
182
213
|
- Created new module `OllamaChat::Logging` that lazily builds a Logger writing
|
|
183
|
-
to the file defined by `OC::OLLAMA::CHAT::LOGFILE` in XDG STATE.
|
|
214
|
+
to the file defined by `OC::OLLAMA::CHAT::LOGFILE` in XDG STATE.
|
|
184
215
|
- Required this logging module in `lib/ollama_chat.rb` and included it in
|
|
185
|
-
`class OllamaChat::Chat` so every chat instance has access to `logger`.
|
|
216
|
+
`class OllamaChat::Chat` so every chat instance has access to `logger`.
|
|
186
217
|
- Logged connection messages via `@chat.logger.info` before printing the
|
|
187
|
-
“Connecting …” line in `OllamaChat::Dialog#connect_message`.
|
|
218
|
+
“Connecting …” line in `OllamaChat::Dialog#connect_message`.
|
|
188
219
|
- Centralized tool‑call error handling: log unconfigured, unregistered or
|
|
189
220
|
disabled tools with `@chat.logger.error`, and record each executed function
|
|
190
|
-
payload using `JSON.pretty_generate`.
|
|
221
|
+
payload using `JSON.pretty_generate`.
|
|
191
222
|
- Introduced an explicit vs implicit confirmation flow (`:explicit`,
|
|
192
223
|
`:implicite`, `:denied`) in `OllamaChat::FollowChat#follow_chat` and log the
|
|
193
|
-
outcome accordingly.
|
|
224
|
+
outcome accordingly.
|
|
194
225
|
- Switched chat history storage from XDG CACHE to XDG STATE by updating
|
|
195
226
|
`OC::OLLAMA::CHAT::HISTORY` path, adjusting file operations in
|
|
196
227
|
`lib/ollama_chat/history.rb`, and adding a new config entry for `LOGFILE`
|
|
197
|
-
under state home in `oc.rb`.
|
|
228
|
+
under state home in `oc.rb`.
|
|
198
229
|
- Enhanced PatchFile tool: updated documentation to specify `unified diff
|
|
199
|
-
format` and `JSON response`.
|
|
200
|
-
- Added private method `digest` that returns `MD5` of a file path.
|
|
230
|
+
format` and `JSON response`.
|
|
231
|
+
- Added private method `digest` that returns `MD5` of a file path.
|
|
201
232
|
- Modified `apply_patch` to compute old digest, run patch command, compare
|
|
202
|
-
digests, set `success` flag accordingly.
|
|
233
|
+
digests, set `success` flag accordingly.
|
|
203
234
|
- Improved error handling: now includes `success`, clearer messages, empty
|
|
204
235
|
result on failure.
|
|
205
236
|
|
|
@@ -229,64 +260,64 @@
|
|
|
229
260
|
inserted `%{time}` placeholder into prompts section of `default_config.yml`;
|
|
230
261
|
added Git placeholders (`%{git_current_branch}`, `%{git_remote_origin}`)
|
|
231
262
|
under **Git** key; reformatted terminal info under a single **Terminal**
|
|
232
|
-
heading with height and width.
|
|
263
|
+
heading with height and width.
|
|
233
264
|
- Extend weather tool to include six‑day forecast: updated `GetCurrentWeather`
|
|
234
265
|
description to mention a six‑day forecast; functionality unchanged; tool
|
|
235
|
-
still requires no arguments.
|
|
266
|
+
still requires no arguments.
|
|
236
267
|
- Rename `insert_into_editor` tool to `paste_into_editor`: updated
|
|
237
268
|
`lib/ollama_chat/tools.rb` to require `paste_into_editor`; renamed and
|
|
238
269
|
updated class from `InsertIntoEditor` to `PasteIntoEditor` in
|
|
239
270
|
`paste_into_editor.rb`, changing its register name, description text, and
|
|
240
271
|
method logic; switched default config key in `default_config.yml` from
|
|
241
272
|
`insert_into_editor` to `paste_into_editor`; refactored spec files; adjusted
|
|
242
|
-
all internal references.
|
|
273
|
+
all internal references.
|
|
243
274
|
|
|
244
275
|
## 2026-03-09 v0.0.76
|
|
245
276
|
|
|
246
277
|
- Added `client:` and `current_directory:` keys to `runtime_info_values` in
|
|
247
|
-
`chat.rb`.
|
|
278
|
+
`chat.rb`.
|
|
248
279
|
- Implemented `#client` method returning `"progname **0.0.75**"` in
|
|
249
|
-
`information.rb`.
|
|
250
|
-
- Introduced helper `location_description?` in `location_handling.rb`.
|
|
280
|
+
`information.rb`.
|
|
281
|
+
- Introduced helper `location_description?` in `location_handling.rb`.
|
|
251
282
|
- Simplified `MessageList#to_ary` to return a duplicate of the internal array,
|
|
252
|
-
removing automatic system prompt + location injection.
|
|
283
|
+
removing automatic system prompt + location injection.
|
|
253
284
|
- Updated default config placeholders for `%{client}` and
|
|
254
|
-
`%{current_directory}` in `default_config.yml`.
|
|
285
|
+
`%{current_directory}` in `default_config.yml`.
|
|
255
286
|
- Adjusted web searching logic to use `location_description?` instead of
|
|
256
|
-
deprecated methods.
|
|
287
|
+
deprecated methods.
|
|
257
288
|
- Removed tests that expected location‑augmented system prompts from
|
|
258
|
-
`spec/ollama_chat/message_list_spec.rb`.
|
|
289
|
+
`spec/ollama_chat/message_list_spec.rb`.
|
|
259
290
|
- Standardized JSON output formatting across tools: aligned JSON keys, added
|
|
260
291
|
spaces after commas, and added trailing commas in tool responses such as
|
|
261
292
|
`copy_to_clipboard`, `gem_path_lookup`, `generate_password`, `get_endoflife`,
|
|
262
293
|
`get_rfc`, `insert_into_editor`, `open_file_in_editor`,
|
|
263
|
-
`paste_from_clipboard`, and `search_web`.
|
|
294
|
+
`paste_from_clipboard`, and `search_web`.
|
|
264
295
|
- Added trailing commas to JSON objects for consistency and easier future
|
|
265
|
-
edits.
|
|
296
|
+
edits.
|
|
266
297
|
- Standardized error field formatting, ensuring each error block includes a
|
|
267
|
-
space after the colon and a trailing comma where appropriate.
|
|
298
|
+
space after the colon and a trailing comma where appropriate.
|
|
268
299
|
- Added helper `disable_content_parsing` in `chat.rb` that sets `@parse_content
|
|
269
|
-
= false`.
|
|
300
|
+
= false`.
|
|
270
301
|
- Refactored command handlers to call `disable_content_parsing` instead of
|
|
271
|
-
assigning directly to `@parse_content`.
|
|
302
|
+
assigning directly to `@parse_content`.
|
|
272
303
|
- Updated persona setup logic so that a returned persona result triggers
|
|
273
304
|
`disable_content_parsing`; otherwise parsing is enabled with
|
|
274
|
-
`enable_command_completion`.
|
|
275
|
-
- Added explanatory comments around the new helper for clarity.
|
|
305
|
+
`enable_command_completion`.
|
|
306
|
+
- Added explanatory comments around the new helper for clarity.
|
|
276
307
|
- Improved clean flow: captured return value of `clean` and set `@parse_content
|
|
277
|
-
= true` when a persona profile is returned.
|
|
308
|
+
= true` when a persona profile is returned.
|
|
278
309
|
- Replaced old flag `@persona_setup` with `@default_persona`; ensured it
|
|
279
|
-
defaults to `:none` in an `ensure` block after setup.
|
|
310
|
+
defaults to `:none` in an `ensure` block after setup.
|
|
280
311
|
- Added new method `reload_default_persona` that prompts for confirmation
|
|
281
|
-
before reloading the default persona file if one exists.
|
|
312
|
+
before reloading the default persona file if one exists.
|
|
282
313
|
- Modified `clean(what)` to return the result of `reload_default_persona`,
|
|
283
|
-
enabling the caller to react to a reload.
|
|
314
|
+
enabling the caller to react to a reload.
|
|
284
315
|
- Adjusted `/clear` command handling in the chat loop to use the returned value
|
|
285
|
-
from `clean` and only proceed when nothing is returned.
|
|
316
|
+
from `clean` and only proceed when nothing is returned.
|
|
286
317
|
- Renamed local variable `runtime_info` to `runtime_info_values` in `chat.rb`
|
|
287
|
-
for clarity.
|
|
318
|
+
for clarity.
|
|
288
319
|
- Updated runtime info prompt interpolation to use `runtime_info_values`
|
|
289
|
-
instead of `runtime_info`.
|
|
320
|
+
instead of `runtime_info`.
|
|
290
321
|
- Updated `/.utilsrc` by adding gems to the `code_indexer` configuration:
|
|
291
322
|
`all_images`, `const_conf`, `context_spook`, `csv`, `fileutils`, `gem_hadar`,
|
|
292
323
|
`infobar`, `irb`, `kramdown`, and `kramdown-parser-gfm`.
|
|
@@ -298,28 +329,28 @@
|
|
|
298
329
|
prompt, and normalizing tool name handling.
|
|
299
330
|
- Added new tool `OllamaChat::Tools::ResolveTag` with utility
|
|
300
331
|
`OllamaChat::Utils::TagResolver` to parse tag files; enabled in
|
|
301
|
-
`default_config.yml` and added corresponding tests.
|
|
332
|
+
`default_config.yml` and added corresponding tests.
|
|
302
333
|
- Introduced `runtime_info` switch in `OllamaChat::Switches`; added
|
|
303
334
|
`/runtime_info` command handling in `chat.rb`, runtime info block injection,
|
|
304
335
|
and display via `information.rb`; added `prompts/runtime_info` template and
|
|
305
336
|
`languages:` array; added `runtime_info.toggle`, `runtime_info.show`,
|
|
306
|
-
`runtime_info.on?`, `runtime_info.enabled` support.
|
|
337
|
+
`runtime_info.on?`, `runtime_info.enabled` support.
|
|
307
338
|
- Updated `OllamaChat::Tools::DirectoryStructure` description to note it can
|
|
308
|
-
locate one or multiple files, referencing `max_depth`.
|
|
339
|
+
locate one or multiple files, referencing `max_depth`.
|
|
309
340
|
- Clarified usage of `browse`, `copy_to_clipboard`, `open_file_in_editor`,
|
|
310
341
|
`insert_into_editor` tools in documentation strings; fixed double‑negative
|
|
311
|
-
typo in `insert_into_editor.rb`.
|
|
342
|
+
typo in `insert_into_editor.rb`.
|
|
312
343
|
- Renamed `import_url` tool to `get_url`: updated config key, tool
|
|
313
344
|
registration, class name `OllamaChat::Tools::GetURL`, spec file names, method
|
|
314
345
|
calls to `config.tools.functions.get_url.schemes?`, replaced all
|
|
315
|
-
`chat.import` with `OllamaChat::Utils::Fetcher.get`.
|
|
346
|
+
`chat.import` with `OllamaChat::Utils::Fetcher.get`.
|
|
316
347
|
- Added path validation and error handling to `OllamaChat::Tools::RunTests`:
|
|
317
348
|
new private method `check_path(path)` prevents using `"./"` and validates
|
|
318
349
|
existence; wrapped execution in rescue block returning JSON with `error:` and
|
|
319
|
-
`message:`; updated function description accordingly.
|
|
320
|
-
- Refined and unified tool descriptions with consistent punctuation.
|
|
350
|
+
`message:`; updated function description accordingly.
|
|
351
|
+
- Refined and unified tool descriptions with consistent punctuation.
|
|
321
352
|
- Added explicit persona loading verification when editing: confirmation step
|
|
322
|
-
before applying edited personality configurations.
|
|
353
|
+
before applying edited personality configurations.
|
|
323
354
|
- Improved persona loading and prompt formatting: updated
|
|
324
355
|
`setup_persona_from_opts`, `info_persona`, `load_persona_file` to return
|
|
325
356
|
`[pathname, content]`, added newline in `play_persona_prompt`, adjusted
|
data/Rakefile
CHANGED
|
@@ -41,7 +41,7 @@ GemHadar do
|
|
|
41
41
|
)
|
|
42
42
|
|
|
43
43
|
dependency 'excon', '~> 1.0'
|
|
44
|
-
dependency 'ollama-ruby', '~> 1.
|
|
44
|
+
dependency 'ollama-ruby', '~> 1.21'
|
|
45
45
|
dependency 'documentrix', '>= 0.0.4'
|
|
46
46
|
dependency 'unix_socks', '~> 0.3'
|
|
47
47
|
dependency 'rss', '~> 0.3'
|
|
@@ -49,7 +49,7 @@ GemHadar do
|
|
|
49
49
|
dependency 'redis', '~> 5.0'
|
|
50
50
|
dependency 'mime-types', '~> 3.0'
|
|
51
51
|
dependency 'reverse_markdown', '~> 3.0'
|
|
52
|
-
dependency 'kramdown-ansi', '~> 0.
|
|
52
|
+
dependency 'kramdown-ansi', '~> 0.5'
|
|
53
53
|
dependency 'complex_config', '~> 0.22', '>= 0.22.2'
|
|
54
54
|
dependency 'tins', '~> 1.52'
|
|
55
55
|
dependency 'search_ui', '~> 0.1'
|
data/lib/ollama_chat/chat.rb
CHANGED
|
@@ -492,7 +492,7 @@ class OllamaChat::Chat
|
|
|
492
492
|
STDOUT.puts "Exiting chooser."
|
|
493
493
|
break
|
|
494
494
|
when '[ALL]'
|
|
495
|
-
if confirm?(prompt: 'Are you sure? (y/n) ') =~ /y/i
|
|
495
|
+
if confirm?(prompt: '🔔 Are you sure? (y/n) ') =~ /y/i
|
|
496
496
|
@documents.clear
|
|
497
497
|
STDOUT.puts "Cleared collection #{bold{@documents.collection}}."
|
|
498
498
|
break
|
|
@@ -537,7 +537,7 @@ class OllamaChat::Chat
|
|
|
537
537
|
end
|
|
538
538
|
when 'edit'
|
|
539
539
|
if result = edit_persona and
|
|
540
|
-
confirm?(prompt: 'Load new persona profile? (y/n) ') =~ /y/i
|
|
540
|
+
confirm?(prompt: '🔔 Load new persona profile? (y/n) ') =~ /y/i
|
|
541
541
|
then
|
|
542
542
|
result
|
|
543
543
|
else
|
|
@@ -868,7 +868,7 @@ class OllamaChat::Chat
|
|
|
868
868
|
STDOUT.puts "Exiting chooser."
|
|
869
869
|
break
|
|
870
870
|
when '[ALL]'
|
|
871
|
-
if confirm?(prompt: 'Are you sure? (y/n) ') =~ /y/i
|
|
871
|
+
if confirm?(prompt: '🔔 Are you sure? (y/n) ') =~ /y/i
|
|
872
872
|
links.clear
|
|
873
873
|
STDOUT.puts "Cleared all links in list."
|
|
874
874
|
break
|
|
@@ -916,7 +916,7 @@ class OllamaChat::Chat
|
|
|
916
916
|
@documents.clear
|
|
917
917
|
STDOUT.puts "Cleared all tags."
|
|
918
918
|
when 'all'
|
|
919
|
-
if confirm?(prompt: 'Are you sure to clear messages and collection? (y/n) ') =~ /y/i
|
|
919
|
+
if confirm?(prompt: '🔔 Are you sure to clear messages and collection? (y/n) ') =~ /y/i
|
|
920
920
|
messages.clear
|
|
921
921
|
@documents.clear
|
|
922
922
|
links.clear
|
|
@@ -58,7 +58,7 @@ module OllamaChat::ConfigHandling
|
|
|
58
58
|
unless diff_tool = OC::DIFF_TOOL?
|
|
59
59
|
exit 1
|
|
60
60
|
end
|
|
61
|
-
if confirm?(prompt: 'Do you want to fix the config? (y/n) ') =~ /y/i
|
|
61
|
+
if confirm?(prompt: '🔔 Do you want to fix the config? (y/n) ') =~ /y/i
|
|
62
62
|
system Shellwords.join([
|
|
63
63
|
diff_tool,
|
|
64
64
|
@ollama_chat_config.filename,
|
|
@@ -84,7 +84,7 @@ module OllamaChat::ConfigHandling
|
|
|
84
84
|
# `ollama_chat` if desired.
|
|
85
85
|
def edit_config
|
|
86
86
|
if result = edit_file(@ollama_chat_config.filename)
|
|
87
|
-
if confirm?(prompt: "Do you want to restart #{progname}? (y/n) ") =~ /y/i
|
|
87
|
+
if confirm?(prompt: "🔔 Do you want to restart #{progname}? (y/n) ") =~ /y/i
|
|
88
88
|
save_conversation(OC::XDG_CACHE_HOME + 'backup.json')
|
|
89
89
|
save_history
|
|
90
90
|
exec($0, *ARGV)
|
|
@@ -101,7 +101,7 @@ module OllamaChat::ConfigHandling
|
|
|
101
101
|
# @example Restarting the app after confirmation
|
|
102
102
|
# config.reload_config # => restarts if user answers "y"
|
|
103
103
|
def reload_config
|
|
104
|
-
if confirm?(prompt: "Do you want to restart #{progname}? (y/n) ") =~ /y/i
|
|
104
|
+
if confirm?(prompt: "🔔 Do you want to restart #{progname}? (y/n) ") =~ /y/i
|
|
105
105
|
save_conversation(OC::XDG_CACHE_HOME + 'backup.json')
|
|
106
106
|
save_history
|
|
107
107
|
exec($0, *ARGV)
|
|
@@ -27,7 +27,7 @@ module OllamaChat::Conversation
|
|
|
27
27
|
# chat.save_conversation('conversations/2023-10-15_my_session.json')
|
|
28
28
|
def save_conversation(filename)
|
|
29
29
|
File.exist?(filename) &&
|
|
30
|
-
confirm?(prompt: "File #{filename.to_s.inspect} already exists, overwrite? (y/n) ") !~ /y/i and
|
|
30
|
+
confirm?(prompt: "🔔 File #{filename.to_s.inspect} already exists, overwrite? (y/n) ") !~ /y/i and
|
|
31
31
|
return
|
|
32
32
|
if messages.save_conversation(filename)
|
|
33
33
|
STDOUT.puts "Saved conversation to #{filename.to_s.inspect}."
|
data/lib/ollama_chat/dialog.rb
CHANGED
|
@@ -27,15 +27,31 @@ module OllamaChat::Dialog
|
|
|
27
27
|
# from the user in raw mode, then returns that character. This is best used
|
|
28
28
|
# for confirmation prompts.
|
|
29
29
|
#
|
|
30
|
-
# @param prompt
|
|
31
|
-
# @
|
|
32
|
-
|
|
30
|
+
# @param prompt [String] the prompt to display to the user
|
|
31
|
+
# @param timeout [Integer, nil] optional timeout in seconds; if nil, the
|
|
32
|
+
# method blocks until input, if 0 the method immediatly returns the default
|
|
33
|
+
# value.
|
|
34
|
+
# @param default [Object, nil] value returned when the timeout expires
|
|
35
|
+
# (defaults to `nil`)
|
|
36
|
+
#
|
|
37
|
+
# @return [Object] the character entered by the user, or the `default` value
|
|
38
|
+
# if a timeout occurs
|
|
39
|
+
def confirm?(prompt:, timeout: nil, default: nil)
|
|
40
|
+
return default if timeout&.zero?
|
|
41
|
+
if prompt.include?('%s')
|
|
42
|
+
prompt = prompt % (timeout ? ('timeout in %us' % timeout) : 'no timeout')
|
|
43
|
+
end
|
|
33
44
|
print prompt
|
|
34
45
|
system 'stty raw'
|
|
35
|
-
c =
|
|
46
|
+
c = if timeout
|
|
47
|
+
ready = IO.select([ STDIN ], nil, nil, timeout)
|
|
48
|
+
ready ? STDIN.getc : nil
|
|
49
|
+
else
|
|
50
|
+
STDIN.getc
|
|
51
|
+
end
|
|
36
52
|
system 'stty cooked'
|
|
37
53
|
puts
|
|
38
|
-
c
|
|
54
|
+
c || default
|
|
39
55
|
end
|
|
40
56
|
|
|
41
57
|
private
|
|
@@ -78,13 +94,13 @@ module OllamaChat::Dialog
|
|
|
78
94
|
#
|
|
79
95
|
# @param current_collection [ String, nil ] the name of the currently active collection
|
|
80
96
|
def choose_collection(current_collection)
|
|
81
|
-
collections = [ current_collection ] + @documents.collections
|
|
97
|
+
collections = [ current_collection ] + @documents.collections.to_a
|
|
82
98
|
collections = collections.compact.map(&:to_s).uniq.sort
|
|
83
99
|
collections.unshift('[EXIT]').unshift('[NEW]')
|
|
84
100
|
collection = OllamaChat::Utils::Chooser.choose(collections) || current_collection
|
|
85
101
|
case collection
|
|
86
102
|
when '[NEW]'
|
|
87
|
-
@documents.collection = ask?(prompt: "Enter name of the new collection: ")
|
|
103
|
+
@documents.collection = ask?(prompt: "❓ Enter name of the new collection: ")
|
|
88
104
|
when nil, '[EXIT]'
|
|
89
105
|
STDOUT.puts "Exiting chooser."
|
|
90
106
|
when /./
|
|
@@ -122,7 +138,7 @@ module OllamaChat::Dialog
|
|
|
122
138
|
system =
|
|
123
139
|
case chosen
|
|
124
140
|
when '[NEW]'
|
|
125
|
-
ask?(prompt: "Enter new system prompt to use: ")
|
|
141
|
+
ask?(prompt: "❓ Enter new system prompt to use: ")
|
|
126
142
|
when '[EXIT]'
|
|
127
143
|
STDOUT.puts "Exiting chooser."
|
|
128
144
|
return
|
|
@@ -100,6 +100,12 @@ class OllamaChat::FollowChat
|
|
|
100
100
|
|
|
101
101
|
response.message.tool_calls.each do |tool_call|
|
|
102
102
|
name = tool_call.function.name
|
|
103
|
+
if name =~ %r(/)
|
|
104
|
+
new_name = File.basename(name.to_s)
|
|
105
|
+
msg = "Received namespaced tool call for #{name}, correcting to #{new_name}"
|
|
106
|
+
@chat.log(:warn, msg)
|
|
107
|
+
name = new_name
|
|
108
|
+
end
|
|
103
109
|
unless @chat.tool_configured?(name)
|
|
104
110
|
msg = "Error: Unconfigured tool named %s ignored => Skip.\n" % name
|
|
105
111
|
@chat.tool_call_results[name] = msg
|
|
@@ -123,7 +129,7 @@ class OllamaChat::FollowChat
|
|
|
123
129
|
function = JSON.pretty_generate(tool_call.function)
|
|
124
130
|
@chat.log(:info, function)
|
|
125
131
|
if @chat.tool_function(name).require_confirmation?
|
|
126
|
-
prompt = "I want to execute tool %s\n%s\nConfirm? (y/n) " % [
|
|
132
|
+
prompt = "🔔 I want to execute tool %s\n%s\nConfirm? (y/n) " % [
|
|
127
133
|
bold { name },
|
|
128
134
|
italic { function },
|
|
129
135
|
]
|
|
@@ -178,9 +184,12 @@ class OllamaChat::FollowChat
|
|
|
178
184
|
|
|
179
185
|
if tools_used.full?
|
|
180
186
|
infobar.reset
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
187
|
+
tools_used.each do |name, info|
|
|
188
|
+
puts "🔧 Tool functions #{name} returned result:",
|
|
189
|
+
info.to_yaml.sub(/\A---\s*\n/, '').gsub(/^/, ' '), ""
|
|
190
|
+
timeout = @chat.tool_function(name).result_display_timeout?
|
|
191
|
+
@chat.confirm?(prompt: '⏎ Press any key to continue (%s). ', timeout:)
|
|
192
|
+
end
|
|
184
193
|
end
|
|
185
194
|
end
|
|
186
195
|
|
|
@@ -83,7 +83,7 @@ module OllamaChat::MessageOutput
|
|
|
83
83
|
def attempt_to_write_file(filename, message)
|
|
84
84
|
path = Pathname.new(filename.to_s).expand_path
|
|
85
85
|
if !path.exist? ||
|
|
86
|
-
confirm?(prompt: "File #{path.to_s.inspect} already exists, overwrite? (y/n) ") =~ /y/i
|
|
86
|
+
confirm?(prompt: "🔔 File #{path.to_s.inspect} already exists, overwrite? (y/n) ") =~ /y/i
|
|
87
87
|
then
|
|
88
88
|
File.open(path, ?w) do |output|
|
|
89
89
|
output.write(message.content)
|
|
@@ -156,34 +156,43 @@ tools:
|
|
|
156
156
|
enabled: true
|
|
157
157
|
functions:
|
|
158
158
|
get_current_weather:
|
|
159
|
+
result_display_timeout: 3
|
|
159
160
|
url: "https://api.pirateweather.net/forecast/KeyInHeader/%{lat},%{lon}?units=%{units}"
|
|
160
161
|
default: false
|
|
161
162
|
get_cve:
|
|
163
|
+
result_display_timeout: 3
|
|
162
164
|
url: 'https://cveawg.mitre.org/api/cve/%{cve_id}'
|
|
163
165
|
default: true
|
|
164
166
|
get_endoflife:
|
|
167
|
+
result_display_timeout: 3
|
|
165
168
|
url: "https://endoflife.date/api/v1/products/%{product}"
|
|
166
169
|
default: false
|
|
167
170
|
get_time:
|
|
171
|
+
result_display_timeout: 3
|
|
168
172
|
default: true
|
|
169
173
|
get_location:
|
|
174
|
+
result_display_timeout: 3
|
|
170
175
|
default: true
|
|
171
176
|
file_context:
|
|
172
177
|
default: false
|
|
173
178
|
require_confirmation: false
|
|
179
|
+
result_display_timeout: 3
|
|
174
180
|
allowed:
|
|
175
181
|
- './spec'
|
|
176
182
|
directory_structure:
|
|
177
183
|
default: true
|
|
178
184
|
require_confirmation: false
|
|
185
|
+
result_display_timeout: 3
|
|
179
186
|
exclude:
|
|
180
187
|
- corpus
|
|
181
188
|
- pkg
|
|
182
189
|
execute_grep:
|
|
183
190
|
default: true
|
|
191
|
+
result_display_timeout: 3
|
|
184
192
|
cmd: |
|
|
185
193
|
grep #{'-i' if ignore_case} -m #{max_results} -r #{before.full? { "-B %u " % it }}#{after.full? { "-A %u " % it }}#{context.full? { "-C %u " % it }}#{pattern} #{path}
|
|
186
194
|
browse:
|
|
195
|
+
result_display_timeout: 3
|
|
187
196
|
default: true
|
|
188
197
|
write_file:
|
|
189
198
|
default: true
|
|
@@ -193,6 +202,7 @@ tools:
|
|
|
193
202
|
read_file:
|
|
194
203
|
default: true
|
|
195
204
|
require_confirmation: false
|
|
205
|
+
result_display_timeout: 3
|
|
196
206
|
allowed:
|
|
197
207
|
- './tmp'
|
|
198
208
|
- './lib'
|
|
@@ -200,42 +210,54 @@ tools:
|
|
|
200
210
|
search_web:
|
|
201
211
|
default: true
|
|
202
212
|
require_confirmation: true
|
|
213
|
+
result_display_timeout: 3
|
|
203
214
|
max_results: 25
|
|
204
215
|
get_url:
|
|
205
216
|
default: true
|
|
206
217
|
require_confirmation: true
|
|
218
|
+
result_display_timeout: 3
|
|
207
219
|
schemes:
|
|
208
220
|
- http
|
|
209
221
|
- https
|
|
210
222
|
gem_path_lookup:
|
|
223
|
+
result_display_timeout: 3
|
|
211
224
|
default: true
|
|
212
225
|
open_file_in_editor:
|
|
213
226
|
default: true
|
|
214
227
|
require_confirmation: true
|
|
228
|
+
result_display_timeout: 0
|
|
215
229
|
run_tests:
|
|
216
230
|
require_confirmation: true
|
|
231
|
+
result_display_timeout: 3
|
|
217
232
|
default: true
|
|
218
233
|
allowed:
|
|
219
234
|
- "./spec"
|
|
220
235
|
- "./test"
|
|
221
236
|
- "./tests"
|
|
222
237
|
get_jira_issue:
|
|
238
|
+
result_display_timeout: 3
|
|
223
239
|
default: false
|
|
224
240
|
get_rfc:
|
|
225
241
|
url: "https://www.rfc-editor.org/rfc/rfc%{rfc_id}.txt"
|
|
242
|
+
result_display_timeout: 3
|
|
226
243
|
default: true
|
|
227
244
|
generate_password:
|
|
228
245
|
default: true
|
|
229
246
|
copy_to_clipboard:
|
|
247
|
+
result_display_timeout: 3
|
|
230
248
|
default: true
|
|
231
249
|
paste_from_clipboard:
|
|
250
|
+
result_display_timeout: 3
|
|
232
251
|
default: true
|
|
233
252
|
paste_into_editor:
|
|
253
|
+
result_display_timeout: 3
|
|
234
254
|
require_confirmation: true
|
|
235
255
|
default: true
|
|
236
256
|
execute_ri:
|
|
257
|
+
result_display_timeout: 3
|
|
237
258
|
default: true
|
|
238
259
|
resolve_tag:
|
|
260
|
+
result_display_timeout: 3
|
|
239
261
|
default: true
|
|
240
262
|
patch_file:
|
|
241
263
|
default: true
|
|
@@ -127,7 +127,7 @@ module OllamaChat::PersonaeManagement
|
|
|
127
127
|
# if the user cancels.
|
|
128
128
|
def add_persona
|
|
129
129
|
persona_name = ask?(
|
|
130
|
-
prompt: "Enter the name of the new persona (or press return to cancel): "
|
|
130
|
+
prompt: "❓ Enter the name of the new persona (or press return to cancel): "
|
|
131
131
|
).full? or return
|
|
132
132
|
|
|
133
133
|
pathname = personae_directory + "#{persona_name}.md"
|
|
@@ -173,7 +173,7 @@ module OllamaChat::PersonaeManagement
|
|
|
173
173
|
STDOUT.puts "Deleting '#{bold{persona.sub_ext('')}}'..."
|
|
174
174
|
STDOUT.puts "Backup will be saved to: #{backup_pathname}"
|
|
175
175
|
|
|
176
|
-
if confirm?(prompt: "Are you sure? (y/n) ") =~ /y/i
|
|
176
|
+
if confirm?(prompt: "🔔 Are you sure? (y/n) ") =~ /y/i
|
|
177
177
|
FileUtils.mv pathname, backup_pathname
|
|
178
178
|
STDOUT.puts "✅ Persona #{bold{persona.sub_ext('')}} deleted successfully"
|
|
179
179
|
{
|
|
@@ -117,7 +117,7 @@ module OllamaChat::ServerSocket
|
|
|
117
117
|
running using the same directory or that a previous process left a stale
|
|
118
118
|
socket file.
|
|
119
119
|
EOT
|
|
120
|
-
if confirm?(prompt: 'Do you want to remove the existing socket file and continue? (y/n) ') =~ /y/i
|
|
120
|
+
if confirm?(prompt: '🔔 Do you want to remove the existing socket file and continue? (y/n) ') =~ /y/i
|
|
121
121
|
FileUtils.rm_f socket_path
|
|
122
122
|
retry
|
|
123
123
|
else
|
|
@@ -15,11 +15,10 @@ class OllamaChat::Tools::PasteIntoEditor
|
|
|
15
15
|
function: Tool::Function.new(
|
|
16
16
|
name:,
|
|
17
17
|
description: <<~EOT,
|
|
18
|
-
Editor helper – Pastes a
|
|
19
|
-
|
|
20
|
-
If no `text` is supplied, the tool will automatically use the last
|
|
21
|
-
response.
|
|
22
|
-
requested by the user.
|
|
18
|
+
Editor helper – Pastes a text (or last reply if omitted) into
|
|
19
|
+
the editor, no file or line is required.
|
|
20
|
+
If no `text` is supplied, the tool will automatically use the last
|
|
21
|
+
assistant response.
|
|
23
22
|
EOT
|
|
24
23
|
parameters: Tool::Function::Parameters.new(
|
|
25
24
|
type: 'object',
|
|
@@ -32,7 +32,7 @@ class OllamaChat::Tools::ResolveTag
|
|
|
32
32
|
),
|
|
33
33
|
kind: Tool::Function::Parameters::Property.new(
|
|
34
34
|
type: 'string',
|
|
35
|
-
description: 'Optional tag kind (
|
|
35
|
+
description: 'Optional tag kind (%s).' % OllamaChat::Utils::TagResolver.kinds.to_json
|
|
36
36
|
),
|
|
37
37
|
directory: Tool::Function::Parameters::Property.new(
|
|
38
38
|
type: 'string',
|
|
@@ -10,19 +10,26 @@ class OllamaChat::Utils::TagResolver
|
|
|
10
10
|
HEADERS = %i[ symbol filename regexp kind rest ]
|
|
11
11
|
private_constant :HEADERS
|
|
12
12
|
|
|
13
|
-
#
|
|
14
|
-
#
|
|
13
|
+
# The kinds method returns a mapping of single character kind identifiers to
|
|
14
|
+
# human‑readable descriptions for Ruby ctags kinds.
|
|
15
15
|
#
|
|
16
|
-
# @
|
|
17
|
-
|
|
18
|
-
def self.kind_of(kind)
|
|
16
|
+
# @return [Hash] a hash mapping kind identifiers to their descriptions.
|
|
17
|
+
def self.kinds
|
|
19
18
|
ctags = ::OC::OLLAMA::CHAT::TOOLS::CTAGS_TOOL? or
|
|
20
19
|
raise OllamaChat::ConfigMissingError,
|
|
21
20
|
'need ctags tool path defined in %s' % (
|
|
22
21
|
::OC::OLLAMA::CHAT::TOOLS::CTAGS_TOOL!.env_var_name
|
|
23
22
|
)
|
|
24
23
|
@kinds ||= `#{ctags} --list-kinds=Ruby`.lines.map { _1.chomp.split(/\s+/, 2) }.to_h
|
|
25
|
-
|
|
24
|
+
end
|
|
25
|
+
|
|
26
|
+
# Return a human‑readable description of a ctags tag kind. For example, `f`
|
|
27
|
+
# (function) becomes "methods".
|
|
28
|
+
#
|
|
29
|
+
# @param [String] kind The single character kind identifier from the tags file.
|
|
30
|
+
# @return [String]
|
|
31
|
+
def self.kind_of(kind)
|
|
32
|
+
kinds.fetch(kind, 'unknown')
|
|
26
33
|
end
|
|
27
34
|
|
|
28
35
|
# A lightweight struct representing a single tag entry. It extends the base
|
|
@@ -85,7 +92,7 @@ class OllamaChat::Utils::TagResolver
|
|
|
85
92
|
results = []
|
|
86
93
|
@tags_file.each_line do |line|
|
|
87
94
|
line.chomp!
|
|
88
|
-
line =~ /\A([^\t]+)\t([^\t]+)\t\/\^([^\t]+)\$\/\;"\t([^\t])
|
|
95
|
+
line =~ /\A([^\t]+)\t([^\t]+)\t\/\^([^\t]+)\$\/\;"\t([^\t])(.*)/ or next
|
|
89
96
|
obj = TagResult.new(*$~.captures)
|
|
90
97
|
next unless obj.symbol == symbol
|
|
91
98
|
if kind
|
data/lib/ollama_chat/version.rb
CHANGED
data/ollama_chat.gemspec
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
# -*- encoding: utf-8 -*-
|
|
2
|
-
# stub: ollama_chat 0.0.
|
|
2
|
+
# stub: ollama_chat 0.0.83 ruby lib
|
|
3
3
|
|
|
4
4
|
Gem::Specification.new do |s|
|
|
5
5
|
s.name = "ollama_chat".freeze
|
|
6
|
-
s.version = "0.0.
|
|
6
|
+
s.version = "0.0.83".freeze
|
|
7
7
|
|
|
8
8
|
s.required_rubygems_version = Gem::Requirement.new(">= 0".freeze) if s.respond_to? :required_rubygems_version=
|
|
9
9
|
s.require_paths = ["lib".freeze]
|
|
@@ -18,7 +18,7 @@ Gem::Specification.new do |s|
|
|
|
18
18
|
s.licenses = ["MIT".freeze]
|
|
19
19
|
s.rdoc_options = ["--title".freeze, "OllamaChat - A command-line interface (CLI) for interacting with an Ollama AI model.".freeze, "--main".freeze, "README.md".freeze]
|
|
20
20
|
s.required_ruby_version = Gem::Requirement.new(">= 3.2".freeze)
|
|
21
|
-
s.rubygems_version = "
|
|
21
|
+
s.rubygems_version = "4.0.8".freeze
|
|
22
22
|
s.summary = "A command-line interface (CLI) for interacting with an Ollama AI model.".freeze
|
|
23
23
|
s.test_files = ["spec/assets/example.rb".freeze, "spec/ollama_chat/chat_spec.rb".freeze, "spec/ollama_chat/clipboard_spec.rb".freeze, "spec/ollama_chat/follow_chat_spec.rb".freeze, "spec/ollama_chat/information_spec.rb".freeze, "spec/ollama_chat/input_content_spec.rb".freeze, "spec/ollama_chat/kramdown_ansi_spec.rb".freeze, "spec/ollama_chat/message_editing_spec.rb".freeze, "spec/ollama_chat/message_list_spec.rb".freeze, "spec/ollama_chat/message_output_spec.rb".freeze, "spec/ollama_chat/model_handling_spec.rb".freeze, "spec/ollama_chat/parsing_spec.rb".freeze, "spec/ollama_chat/redis_cache_spec.rb".freeze, "spec/ollama_chat/server_socket_spec.rb".freeze, "spec/ollama_chat/source_fetching_spec.rb".freeze, "spec/ollama_chat/state_selectors_spec.rb".freeze, "spec/ollama_chat/switches_spec.rb".freeze, "spec/ollama_chat/think_control_spec.rb".freeze, "spec/ollama_chat/tools/browse_spec.rb".freeze, "spec/ollama_chat/tools/copy_to_clipboard_spec.rb".freeze, "spec/ollama_chat/tools/directory_structure_spec.rb".freeze, "spec/ollama_chat/tools/execute_grep_spec.rb".freeze, "spec/ollama_chat/tools/execute_ri_spec.rb".freeze, "spec/ollama_chat/tools/file_context_spec.rb".freeze, "spec/ollama_chat/tools/gem_path_lookup_spec.rb".freeze, "spec/ollama_chat/tools/generate_password_spec.rb".freeze, "spec/ollama_chat/tools/get_current_weather_spec.rb".freeze, "spec/ollama_chat/tools/get_cve_spec.rb".freeze, "spec/ollama_chat/tools/get_endoflife_spec.rb".freeze, "spec/ollama_chat/tools/get_jira_issue_spec.rb".freeze, "spec/ollama_chat/tools/get_location_spec.rb".freeze, "spec/ollama_chat/tools/get_rfc_spec.rb".freeze, "spec/ollama_chat/tools/get_time_spec.rb".freeze, "spec/ollama_chat/tools/get_url_spec.rb".freeze, "spec/ollama_chat/tools/open_file_in_editor_spec.rb".freeze, "spec/ollama_chat/tools/paste_from_clipboard_spec.rb".freeze, "spec/ollama_chat/tools/paste_into_editor_spec.rb".freeze, "spec/ollama_chat/tools/patch_file_spec.rb".freeze, "spec/ollama_chat/tools/read_file_spec.rb".freeze, "spec/ollama_chat/tools/resolve_tag_spec.rb".freeze, "spec/ollama_chat/tools/run_tests_spec.rb".freeze, "spec/ollama_chat/tools/search_web_spec.rb".freeze, "spec/ollama_chat/tools/write_file_spec.rb".freeze, "spec/ollama_chat/utils/analyze_directory_spec.rb".freeze, "spec/ollama_chat/utils/cache_fetcher_spec.rb".freeze, "spec/ollama_chat/utils/fetcher_spec.rb".freeze, "spec/ollama_chat/utils/file_argument_spec.rb".freeze, "spec/ollama_chat/utils/path_completer_spec.rb".freeze, "spec/ollama_chat/vim_spec.rb".freeze, "spec/ollama_chat/web_searching_spec.rb".freeze, "spec/spec_helper.rb".freeze]
|
|
24
24
|
|
|
@@ -34,7 +34,7 @@ Gem::Specification.new do |s|
|
|
|
34
34
|
s.add_development_dependency(%q<context_spook>.freeze, [">= 0".freeze])
|
|
35
35
|
s.add_development_dependency(%q<utils>.freeze, [">= 0".freeze])
|
|
36
36
|
s.add_runtime_dependency(%q<excon>.freeze, ["~> 1.0".freeze])
|
|
37
|
-
s.add_runtime_dependency(%q<ollama-ruby>.freeze, ["~> 1.
|
|
37
|
+
s.add_runtime_dependency(%q<ollama-ruby>.freeze, ["~> 1.21".freeze])
|
|
38
38
|
s.add_runtime_dependency(%q<documentrix>.freeze, [">= 0.0.4".freeze])
|
|
39
39
|
s.add_runtime_dependency(%q<unix_socks>.freeze, ["~> 0.3".freeze])
|
|
40
40
|
s.add_runtime_dependency(%q<rss>.freeze, ["~> 0.3".freeze])
|
|
@@ -42,7 +42,7 @@ Gem::Specification.new do |s|
|
|
|
42
42
|
s.add_runtime_dependency(%q<redis>.freeze, ["~> 5.0".freeze])
|
|
43
43
|
s.add_runtime_dependency(%q<mime-types>.freeze, ["~> 3.0".freeze])
|
|
44
44
|
s.add_runtime_dependency(%q<reverse_markdown>.freeze, ["~> 3.0".freeze])
|
|
45
|
-
s.add_runtime_dependency(%q<kramdown-ansi>.freeze, ["~> 0.
|
|
45
|
+
s.add_runtime_dependency(%q<kramdown-ansi>.freeze, ["~> 0.5".freeze])
|
|
46
46
|
s.add_runtime_dependency(%q<complex_config>.freeze, ["~> 0.22".freeze, ">= 0.22.2".freeze])
|
|
47
47
|
s.add_runtime_dependency(%q<tins>.freeze, ["~> 1.52".freeze])
|
|
48
48
|
s.add_runtime_dependency(%q<search_ui>.freeze, ["~> 0.1".freeze])
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: ollama_chat
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.0.
|
|
4
|
+
version: 0.0.83
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Florian Frank
|
|
@@ -155,14 +155,14 @@ dependencies:
|
|
|
155
155
|
requirements:
|
|
156
156
|
- - "~>"
|
|
157
157
|
- !ruby/object:Gem::Version
|
|
158
|
-
version: '1.
|
|
158
|
+
version: '1.21'
|
|
159
159
|
type: :runtime
|
|
160
160
|
prerelease: false
|
|
161
161
|
version_requirements: !ruby/object:Gem::Requirement
|
|
162
162
|
requirements:
|
|
163
163
|
- - "~>"
|
|
164
164
|
- !ruby/object:Gem::Version
|
|
165
|
-
version: '1.
|
|
165
|
+
version: '1.21'
|
|
166
166
|
- !ruby/object:Gem::Dependency
|
|
167
167
|
name: documentrix
|
|
168
168
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -267,14 +267,14 @@ dependencies:
|
|
|
267
267
|
requirements:
|
|
268
268
|
- - "~>"
|
|
269
269
|
- !ruby/object:Gem::Version
|
|
270
|
-
version: '0.
|
|
270
|
+
version: '0.5'
|
|
271
271
|
type: :runtime
|
|
272
272
|
prerelease: false
|
|
273
273
|
version_requirements: !ruby/object:Gem::Requirement
|
|
274
274
|
requirements:
|
|
275
275
|
- - "~>"
|
|
276
276
|
- !ruby/object:Gem::Version
|
|
277
|
-
version: '0.
|
|
277
|
+
version: '0.5'
|
|
278
278
|
- !ruby/object:Gem::Dependency
|
|
279
279
|
name: complex_config
|
|
280
280
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -703,7 +703,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
703
703
|
- !ruby/object:Gem::Version
|
|
704
704
|
version: '0'
|
|
705
705
|
requirements: []
|
|
706
|
-
rubygems_version:
|
|
706
|
+
rubygems_version: 4.0.8
|
|
707
707
|
specification_version: 4
|
|
708
708
|
summary: A command-line interface (CLI) for interacting with an Ollama AI model.
|
|
709
709
|
test_files:
|