ollama_chat 0.0.79 → 0.0.80
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/.utilsrc +1 -0
- data/CHANGES.md +113 -0
- data/README.md +100 -44
- data/bin/ollama_chat_send +1 -1
- data/lib/ollama_chat/chat.rb +591 -286
- data/lib/ollama_chat/command_concern.rb +159 -0
- data/lib/ollama_chat/config_handling.rb +3 -3
- data/lib/ollama_chat/conversation.rb +1 -1
- data/lib/ollama_chat/dialog.rb +39 -0
- data/lib/ollama_chat/follow_chat.rb +11 -1
- data/lib/ollama_chat/information.rb +46 -90
- data/lib/ollama_chat/input_content.rb +58 -14
- data/lib/ollama_chat/location_handling.rb +0 -3
- data/lib/ollama_chat/message_output.rb +1 -1
- data/lib/ollama_chat/ollama_chat_config/default_config.yml +1 -5
- data/lib/ollama_chat/pager.rb +3 -3
- data/lib/ollama_chat/personae_management.rb +36 -6
- data/lib/ollama_chat/server_socket.rb +1 -1
- data/lib/ollama_chat/source_fetching.rb +14 -3
- data/lib/ollama_chat/state_selectors.rb +4 -2
- data/lib/ollama_chat/switches.rb +8 -6
- data/lib/ollama_chat/tools/browse.rb +1 -0
- data/lib/ollama_chat/tools/copy_to_clipboard.rb +1 -1
- data/lib/ollama_chat/tools/directory_structure.rb +13 -2
- data/lib/ollama_chat/tools/execute_grep.rb +1 -0
- data/lib/ollama_chat/tools/execute_ri.rb +1 -1
- data/lib/ollama_chat/tools/file_context.rb +2 -1
- data/lib/ollama_chat/tools/generate_password.rb +1 -1
- data/lib/ollama_chat/tools/get_cve.rb +1 -0
- data/lib/ollama_chat/tools/get_endoflife.rb +1 -0
- data/lib/ollama_chat/tools/get_jira_issue.rb +1 -0
- data/lib/ollama_chat/tools/get_location.rb +1 -6
- data/lib/ollama_chat/tools/get_rfc.rb +1 -0
- data/lib/ollama_chat/tools/get_time.rb +1 -5
- data/lib/ollama_chat/tools/get_url.rb +1 -0
- data/lib/ollama_chat/tools/open_file_in_editor.rb +1 -0
- data/lib/ollama_chat/tools/paste_from_clipboard.rb +1 -1
- data/lib/ollama_chat/tools/paste_into_editor.rb +1 -1
- data/lib/ollama_chat/tools/patch_file.rb +4 -5
- data/lib/ollama_chat/tools/read_file.rb +2 -1
- data/lib/ollama_chat/tools/resolve_tag.rb +1 -1
- data/lib/ollama_chat/tools/run_tests.rb +1 -2
- data/lib/ollama_chat/tools/search_web.rb +1 -0
- data/lib/ollama_chat/tools/write_file.rb +1 -0
- data/lib/ollama_chat/utils/analyze_directory.rb +14 -6
- data/lib/ollama_chat/utils/fetcher.rb +0 -9
- data/lib/ollama_chat/utils/path_validator.rb +41 -20
- data/lib/ollama_chat/version.rb +1 -1
- data/lib/ollama_chat/web_searching.rb +0 -1
- data/lib/ollama_chat.rb +1 -0
- data/ollama_chat.gemspec +4 -4
- data/spec/ollama_chat/chat_spec.rb +139 -45
- data/spec/ollama_chat/information_spec.rb +9 -7
- data/spec/ollama_chat/tools/directory_structure_spec.rb +3 -0
- data/spec/ollama_chat/tools/patch_file_spec.rb +1 -1
- data/spec/ollama_chat/tools/read_file_spec.rb +2 -2
- data/spec/ollama_chat/utils/analyze_directory_spec.rb +8 -0
- data/spec/spec_helper.rb +9 -0
- metadata +3 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 5116e552c78df5d85138b112ef43b4a80bbb7e2ce03fd5cbd5e58f7adbde948d
|
|
4
|
+
data.tar.gz: 22ff0f77807fa3560ce394a0e840ea367770596f2a261cddb650c24eaf362d01
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: ad573ad4cfdd39455f2720e2283e4487afaae6d17dbb451580289afdfef77b433fb426bb2cc516225db514365d788b8441efeb11ab9b0f2916accc5817d619a1
|
|
7
|
+
data.tar.gz: 583cb266287eaad72e28543e34003da6b72f072f1c45b751327b6218b9ed842c35639759d8f37a0fd8051167fcbd735a3c32c4b0c9443a5c4cf2074ace755a03
|
data/.utilsrc
CHANGED
data/CHANGES.md
CHANGED
|
@@ -1,5 +1,118 @@
|
|
|
1
1
|
# Changes
|
|
2
2
|
|
|
3
|
+
## 2026-03-18 v0.0.80
|
|
4
|
+
|
|
5
|
+
### Output & Paging
|
|
6
|
+
|
|
7
|
+
- Remove the automatic `info` call from the main flow
|
|
8
|
+
- Wrap all output handling inside a `use_pager do |output|` block
|
|
9
|
+
- Pass the `output:` keyword to sub‑methods (`collection_stats`,
|
|
10
|
+
`Switches.show`, etc.)
|
|
11
|
+
- Adjust `Pager` to use a local `buffer` variable and `output.puts buffer`
|
|
12
|
+
- Update `StateSelectors.show` and `Switches.show` to accept `output: STDOUT`
|
|
13
|
+
and use `output.puts`
|
|
14
|
+
- Modify `Switches.set` to accept `output: STDOUT` and call
|
|
15
|
+
`self.show(output:)`
|
|
16
|
+
|
|
17
|
+
### Collection & Runtime Info
|
|
18
|
+
|
|
19
|
+
- Change `collection_stats` signature to `output: STDOUT` and replace
|
|
20
|
+
`STDOUT.puts` with `output.puts`
|
|
21
|
+
- Show runtime‑information only when `runtime_info.on? && content` is true
|
|
22
|
+
- Append a JSON line for runtime‑info instead of a plain‑text list
|
|
23
|
+
|
|
24
|
+
### Tool Call Handling
|
|
25
|
+
|
|
26
|
+
- Initialize `tools_used` hash in `OllamaChat::FollowChat#handle_tool_calls`
|
|
27
|
+
- Store the formatted size of each tool result using `Tins::Unit.format`
|
|
28
|
+
- Replace the non‑existent `full?` check with `size ==
|
|
29
|
+
response.message.tool_calls.size`
|
|
30
|
+
- Show a summary of tool call results and pause for user confirmation
|
|
31
|
+
|
|
32
|
+
### Confirmation Prompt
|
|
33
|
+
|
|
34
|
+
- Add `confirm?` method to `OllamaChat::Dialog` for single‑character
|
|
35
|
+
confirmation prompts
|
|
36
|
+
- Replace all `ask?` calls with `confirm?`
|
|
37
|
+
|
|
38
|
+
### Command DSL
|
|
39
|
+
|
|
40
|
+
- Add a `command` DSL in `command_concern.rb` for registering chat commands
|
|
41
|
+
- Include `OllamaChat::CommandConcern` in `chat.rb` and drop the old
|
|
42
|
+
`handle_input` logic
|
|
43
|
+
- Replace hard‑coded command handling with the new DSL (e.g., `/toggle`,
|
|
44
|
+
`/input`, `/revise`, etc.)
|
|
45
|
+
|
|
46
|
+
### Documentation & README
|
|
47
|
+
|
|
48
|
+
- Update `README.md` to show the new `/toggle` syntax and expanded command
|
|
49
|
+
table
|
|
50
|
+
- Update `bin/ollama_chat_send` help text to reflect the renamed `/input`
|
|
51
|
+
command
|
|
52
|
+
|
|
53
|
+
### Utility Helpers
|
|
54
|
+
|
|
55
|
+
- Add `go_command` helper in `dialog.rb` for parsing command‑line options
|
|
56
|
+
- Add `file_set_each`, `all_file_set`, and `provide_file_set_content` to
|
|
57
|
+
`input_content.rb`
|
|
58
|
+
- Update `context_spook` to use `file_set_each` and accept an `all` flag
|
|
59
|
+
- Add `strip_internal_json_markers` helper in `chat.rb`
|
|
60
|
+
- Add `choose_file_set` helper in `OllamaChat::Dialog` returning a `Set` of
|
|
61
|
+
expanded `Pathname` objects
|
|
62
|
+
|
|
63
|
+
### Source Fetching & Links
|
|
64
|
+
|
|
65
|
+
- Refactor `source_fetching.rb` to coerce sources to string
|
|
66
|
+
- Add a lazy `links` method and remove the old `links` method from `Chat`
|
|
67
|
+
|
|
68
|
+
### Retrieval Snippets
|
|
69
|
+
|
|
70
|
+
- Update retrieval‑snippet injection to use a JSON block instead of a
|
|
71
|
+
plain‑text list
|
|
72
|
+
- Use `strip_internal_json_markers` for `:ollama_chat_retrieval_snippets` and
|
|
73
|
+
`:ollama_chat_runtime_information`
|
|
74
|
+
- Truncate user query to `config.embedding.model.context_length` before calling
|
|
75
|
+
`@documents.find_where`
|
|
76
|
+
|
|
77
|
+
### Directory Structure Tool
|
|
78
|
+
|
|
79
|
+
- Add `suffix` parameter to `directory_structure` function
|
|
80
|
+
- Update `OllamaChat::Utils::AnalyzeDirectory.generate_structure` to accept a
|
|
81
|
+
`suffix:` argument and filter files accordingly
|
|
82
|
+
- Ensure only files matching the given extension are included; hidden files and
|
|
83
|
+
symlinks remain excluded
|
|
84
|
+
|
|
85
|
+
### Persona Management
|
|
86
|
+
|
|
87
|
+
- Update persona option labels to `keep`, `reload_default`, `choose_different`
|
|
88
|
+
- Add interactive persona reload options via a menu in `reload_default_persona`
|
|
89
|
+
- Use `SearchUI::Wrapper` and `OllamaChat::Utils::Chooser` for selection
|
|
90
|
+
- Update `@default_persona` when selecting “load_new”
|
|
91
|
+
|
|
92
|
+
### Path Validation
|
|
93
|
+
|
|
94
|
+
- Add `check_file` flag to `path_validator.rb` method signature
|
|
95
|
+
- Guard against non‑directory parents and file existence when `check_file:true`
|
|
96
|
+
- Propagate `check_file` flag in calls from `file_context`, `patch_file`, and
|
|
97
|
+
`read_file`
|
|
98
|
+
|
|
99
|
+
### Tests & Specs
|
|
100
|
+
|
|
101
|
+
- Adjust specs to stub `OC::PAGER`, expect `use_pager` yielding a `StringIO`,
|
|
102
|
+
and verify `STDOUT.puts` calls
|
|
103
|
+
- Update test expectations for new command handling and help output
|
|
104
|
+
- Expect `OllamaChat::InvalidPathError` instead of `Errno::ENOENT` in relevant
|
|
105
|
+
specs
|
|
106
|
+
- Add `asset_pathname` helper in `spec_helper.rb`
|
|
107
|
+
|
|
108
|
+
### Miscellaneous
|
|
109
|
+
|
|
110
|
+
- Add `reline` gem to `.utilsrc` dependency list
|
|
111
|
+
- Consider `-c` flag to skip persona setup when loading an existing
|
|
112
|
+
conversation
|
|
113
|
+
- Standardize `register_name` method comments to `@return [String] the
|
|
114
|
+
registered name for this tool`
|
|
115
|
+
|
|
3
116
|
## 2026-03-13 v0.0.79
|
|
4
117
|
|
|
5
118
|
- Added `tmp/*` to Rakefile ignore list for cleaner builds.
|
data/README.md
CHANGED
|
@@ -152,48 +152,104 @@ subject - the young, blue-eyed cat.
|
|
|
152
152
|
The following commands can be given inside the chat, if prefixed by a `/`:
|
|
153
153
|
|
|
154
154
|
```
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
/
|
|
159
|
-
|
|
160
|
-
/
|
|
161
|
-
|
|
162
|
-
/
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
/
|
|
166
|
-
|
|
167
|
-
/
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
/
|
|
178
|
-
|
|
179
|
-
/
|
|
180
|
-
|
|
181
|
-
/
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
/
|
|
187
|
-
|
|
188
|
-
/
|
|
189
|
-
|
|
190
|
-
/
|
|
191
|
-
|
|
192
|
-
/
|
|
193
|
-
|
|
194
|
-
/
|
|
195
|
-
|
|
196
|
-
|
|
155
|
+
╭──────────────────┬────────────────────┬──────────────────┬──────────────────────────────────────────────────────────╮
|
|
156
|
+
│ CMD │ SUBCMD │ OPTS │ HELP │
|
|
157
|
+
╞══════════════════╪════════════════════╪══════════════════╪══════════════════════════════════════════════════════════╡
|
|
158
|
+
│ /copy │ │ │ to copy last response to clipboard │
|
|
159
|
+
├──────────────────┼────────────────────┼──────────────────┼──────────────────────────────────────────────────────────┤
|
|
160
|
+
│ /paste │ │ │ to paste content from the clipboard │
|
|
161
|
+
├──────────────────┼────────────────────┼──────────────────┼──────────────────────────────────────────────────────────┤
|
|
162
|
+
│ /config │ edit │ │ output/edit/reload configuration │
|
|
163
|
+
│ │ reload │ │ │
|
|
164
|
+
├──────────────────┼────────────────────┼──────────────────┼──────────────────────────────────────────────────────────┤
|
|
165
|
+
│ /document_policy │ │ │ pick a scan policy for documents │
|
|
166
|
+
├──────────────────┼────────────────────┼──────────────────┼──────────────────────────────────────────────────────────┤
|
|
167
|
+
│ /toggle │ embedding﹡ │ │ toggle switch │
|
|
168
|
+
│ │ location﹡ │ │ │
|
|
169
|
+
│ │ markdown﹡ │ │ │
|
|
170
|
+
│ │ runtime_info﹡ │ │ │
|
|
171
|
+
│ │ stream﹡ │ │ │
|
|
172
|
+
│ │ think_loud﹡ │ │ │
|
|
173
|
+
│ │ voice﹡ │ │ │
|
|
174
|
+
├──────────────────┼────────────────────┼──────────────────┼──────────────────────────────────────────────────────────┤
|
|
175
|
+
│ /model │ │ │ change the model │
|
|
176
|
+
├──────────────────┼────────────────────┼──────────────────┼──────────────────────────────────────────────────────────┤
|
|
177
|
+
│ /system │ change │ │ change/show system prompt │
|
|
178
|
+
├──────────────────┼────────────────────┼──────────────────┼──────────────────────────────────────────────────────────┤
|
|
179
|
+
│ /think │ │ │ choose ollama think mode setting for models │
|
|
180
|
+
├──────────────────┼────────────────────┼──────────────────┼──────────────────────────────────────────────────────────┤
|
|
181
|
+
│ /tools │ disable │ │ list enabled, enable/disable tools, │
|
|
182
|
+
│ │ enable │ │ support on/off │
|
|
183
|
+
│ │ off │ │ │
|
|
184
|
+
│ │ on │ │ │
|
|
185
|
+
├──────────────────┼────────────────────┼──────────────────┼──────────────────────────────────────────────────────────┤
|
|
186
|
+
│ /voice │ │ │ change the voice │
|
|
187
|
+
├──────────────────┼────────────────────┼──────────────────┼──────────────────────────────────────────────────────────┤
|
|
188
|
+
│ /list │ │ [n=1] │ list the last n / all conversation exchanges │
|
|
189
|
+
├──────────────────┼────────────────────┼──────────────────┼──────────────────────────────────────────────────────────┤
|
|
190
|
+
│ /last │ │ [n=1] │ show the last n / 1 system/assistant message │
|
|
191
|
+
├──────────────────┼────────────────────┼──────────────────┼──────────────────────────────────────────────────────────┤
|
|
192
|
+
│ /drop │ │ [n=1] │ drop the last n exchanges, defaults to 1 │
|
|
193
|
+
├──────────────────┼────────────────────┼──────────────────┼──────────────────────────────────────────────────────────┤
|
|
194
|
+
│ /clear │ all﹡ │ │ clear these records │
|
|
195
|
+
│ │ history﹡ │ │ │
|
|
196
|
+
│ │ links﹡ │ │ │
|
|
197
|
+
│ │ messages﹡ │ │ │
|
|
198
|
+
│ │ tags﹡ │ │ │
|
|
199
|
+
├──────────────────┼────────────────────┼──────────────────┼──────────────────────────────────────────────────────────┤
|
|
200
|
+
│ /links │ clear﹡ │ │ display (or clear) links used in the chat │
|
|
201
|
+
├──────────────────┼────────────────────┼──────────────────┼──────────────────────────────────────────────────────────┤
|
|
202
|
+
│ /revise │ edit﹡ │ │ revise the last message (and/or edit the query) │
|
|
203
|
+
├──────────────────┼────────────────────┼──────────────────┼──────────────────────────────────────────────────────────┤
|
|
204
|
+
│ /prompt │ │ │ prefill user prompt with preset prompts │
|
|
205
|
+
├──────────────────┼────────────────────┼──────────────────┼──────────────────────────────────────────────────────────┤
|
|
206
|
+
│ /change_response │ │ │ edit the last response in EDITOR │
|
|
207
|
+
├──────────────────┼────────────────────┼──────────────────┼──────────────────────────────────────────────────────────┤
|
|
208
|
+
│ /save │ │ path │ store conversation messages │
|
|
209
|
+
├──────────────────┼────────────────────┼──────────────────┼──────────────────────────────────────────────────────────┤
|
|
210
|
+
│ /load │ │ path │ load conversation messages │
|
|
211
|
+
├──────────────────┼────────────────────┼──────────────────┼──────────────────────────────────────────────────────────┤
|
|
212
|
+
│ /collection │ change﹡ │ │ change (default) collection or clear │
|
|
213
|
+
│ │ clear﹡ │ │ │
|
|
214
|
+
├──────────────────┼────────────────────┼──────────────────┼──────────────────────────────────────────────────────────┤
|
|
215
|
+
│ /persona │ add │ │ manage and load/play personae for roleplay │
|
|
216
|
+
│ │ delete │ │ │
|
|
217
|
+
│ │ edit │ │ │
|
|
218
|
+
│ │ file │ │ │
|
|
219
|
+
│ │ info │ │ │
|
|
220
|
+
│ │ list │ │ │
|
|
221
|
+
│ │ load │ │ │
|
|
222
|
+
│ │ play │ │ │
|
|
223
|
+
├──────────────────┼────────────────────┼──────────────────┼──────────────────────────────────────────────────────────┤
|
|
224
|
+
│ /compose │ │ │ compose content using an EDITOR │
|
|
225
|
+
├──────────────────┼────────────────────┼──────────────────┼──────────────────────────────────────────────────────────┤
|
|
226
|
+
│ /web │ │ [number=1] query │ query web for so many results │
|
|
227
|
+
├──────────────────┼────────────────────┼──────────────────┼──────────────────────────────────────────────────────────┤
|
|
228
|
+
│ /input │ context │ [-w|-a] [arg…] │ Read content from files, URLs, or glob patterns │
|
|
229
|
+
│ │ context pattern │ │ and optionally transform it. │
|
|
230
|
+
│ │ embedding │ │ Use subcommands: context, embedding, path, summary, │
|
|
231
|
+
│ │ embedding pattern │ │ import (the default). │
|
|
232
|
+
│ │ path │ │ Use pattern mode for local files. │
|
|
233
|
+
│ │ path pattern │ │ Options: │
|
|
234
|
+
│ │ pattern │ │ -w <words> (summary subcommand only, default 100) │
|
|
235
|
+
│ │ summary │ │ -a (pattern mode only, include all files for patterns) │
|
|
236
|
+
│ │ summary pattern │ │ │
|
|
237
|
+
├──────────────────┼────────────────────┼──────────────────┼──────────────────────────────────────────────────────────┤
|
|
238
|
+
│ /pipe │ │ path │ write last response to command's stdin │
|
|
239
|
+
├──────────────────┼────────────────────┼──────────────────┼──────────────────────────────────────────────────────────┤
|
|
240
|
+
│ /vim │ │ │ insert the last message into a vim (server) │
|
|
241
|
+
├──────────────────┼────────────────────┼──────────────────┼──────────────────────────────────────────────────────────┤
|
|
242
|
+
│ /output │ │ path │ save last response to path │
|
|
243
|
+
├──────────────────┼────────────────────┼──────────────────┼──────────────────────────────────────────────────────────┤
|
|
244
|
+
│ /reconnect │ │ │ reconnect to current ollama server │
|
|
245
|
+
├──────────────────┼────────────────────┼──────────────────┼──────────────────────────────────────────────────────────┤
|
|
246
|
+
│ /quit │ │ │ quit/exit the application │
|
|
247
|
+
│ /exit │ │ │ │
|
|
248
|
+
├──────────────────┼────────────────────┼──────────────────┼──────────────────────────────────────────────────────────┤
|
|
249
|
+
│ /info │ │ │ show information for current session │
|
|
250
|
+
├──────────────────┼────────────────────┼──────────────────┼──────────────────────────────────────────────────────────┤
|
|
251
|
+
│ /help │ me │ │ to view this help (me=interactive ai help) │
|
|
252
|
+
╰──────────────────┴────────────────────┴──────────────────┴──────────────────────────────────────────────────────────╯
|
|
197
253
|
```
|
|
198
254
|
|
|
199
255
|
### Using `ollama_chat_send` to send input to a running `ollama_chat`
|
|
@@ -221,10 +277,10 @@ endfunction
|
|
|
221
277
|
|
|
222
278
|
The `ollama_chat_send` command now supports additional parameters to enhance functionality:
|
|
223
279
|
|
|
224
|
-
- **Terminal Input (`-t`)**: Sends input as terminal commands, enabling special commands like `/
|
|
280
|
+
- **Terminal Input (`-t`)**: Sends input as terminal commands, enabling special commands like `/input`.
|
|
225
281
|
|
|
226
282
|
```bash
|
|
227
|
-
$ echo "/
|
|
283
|
+
$ echo "/input https://example.com/some-content" | ollama_chat_send -t
|
|
228
284
|
```
|
|
229
285
|
|
|
230
286
|
- **Wait for Response (`-r`)**: Enables two-way communication by waiting for and returning the server's response.
|
data/bin/ollama_chat_send
CHANGED
|
@@ -19,7 +19,7 @@ def usage(rc = 0)
|
|
|
19
19
|
|
|
20
20
|
Options:
|
|
21
21
|
-r Wait for the response from Ollama Chat and output it
|
|
22
|
-
-t Send input as terminal input including commands, e. g. /
|
|
22
|
+
-t Send input as terminal input including commands, e. g. /input
|
|
23
23
|
-p Send input with source parsing enabled (defaults to disabled)
|
|
24
24
|
-f CONFIG file to read
|
|
25
25
|
-d DIR the working directory to derive the socket file from
|