ollama_chat 0.0.135 → 0.0.137
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 +88 -0
- data/Rakefile +2 -2
- data/lib/ollama_chat/commands.rb +6 -6
- data/lib/ollama_chat/database/models/collection.rb +2 -1
- data/lib/ollama_chat/information.rb +58 -0
- data/lib/ollama_chat/oc.rb +9 -1
- data/lib/ollama_chat/ollama_chat_config/default_config.yml +1 -0
- data/lib/ollama_chat/ollama_chat_config/fastfetch-profile.jsonc +13 -0
- data/lib/ollama_chat/rag_handling.rb +15 -4
- data/lib/ollama_chat/system_prompt_management.rb +3 -3
- data/lib/ollama_chat/tools/execute_shell.rb +72 -32
- data/lib/ollama_chat/version.rb +1 -1
- data/ollama_chat.gemspec +7 -7
- data/spec/ollama_chat/commands_spec.rb +2 -2
- data/spec/ollama_chat/kramdown_ansi_spec.rb +1 -1
- data/spec/ollama_chat/rag_handling_spec.rb +58 -0
- data/spec/ollama_chat/tools/execute_shell_spec.rb +68 -0
- metadata +9 -8
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: '00825774cef8e349ad7666a4e3046995bfa4803216d75fe688c8479a3bfce6c2'
|
|
4
|
+
data.tar.gz: 45f95f47c73c711686b479c49ac6fec3309fe3a68c385fb9d780e28f8f10dd13
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 157e6951f84674cae4cc74e3423f9569f6cb30efc92109d7b27538ed7424e4d938e03513b9d3d0044b233be9f74b06572218c4ab128b5881d4361424585bf285
|
|
7
|
+
data.tar.gz: 98eed217eca3fc4e396110ec20729e9e10bad64e5bf40539df1768ccd70c21ede9896855ba94a4b551ab3133c3e6020f45383de2ef59e7e9e75206c168f685d7
|
data/CHANGES.md
CHANGED
|
@@ -1,5 +1,93 @@
|
|
|
1
1
|
# Changes
|
|
2
2
|
|
|
3
|
+
## 2026-10-23 v0.0.137
|
|
4
|
+
|
|
5
|
+
### Fixes
|
|
6
|
+
|
|
7
|
+
- Fixed a double-scheme bug in `OC::URL` default generation by delegating to
|
|
8
|
+
`Ollama.base_url`, ensuring correct handling of `HOST` values that already
|
|
9
|
+
include `http://` or `https://`.
|
|
10
|
+
- Prevented deletion of the `default` collection in `delete_collection`,
|
|
11
|
+
returning a warning feedback instead.
|
|
12
|
+
- Reset `session.current_collection` to `'default'` when the active collection
|
|
13
|
+
is deleted.
|
|
14
|
+
|
|
15
|
+
### Improvements
|
|
16
|
+
|
|
17
|
+
- Ensured the `default` collection row always exists in the database by
|
|
18
|
+
unioning it with `chat.documents.collections` during `Collection.sync`.
|
|
19
|
+
- Removed four vestigial `refresh_system_prompt` calls from
|
|
20
|
+
`create_collection`, `edit_collection`, `rename_collection`, and
|
|
21
|
+
`delete_collection`, as collection data no longer interpolates into the
|
|
22
|
+
system prompt.
|
|
23
|
+
|
|
24
|
+
### Build & CI
|
|
25
|
+
|
|
26
|
+
- Updated `ollama-ruby` dependency from **1.25** to **1.26**.
|
|
27
|
+
- Updated `kramdown-ansi` dependency from **~> 0.6** to **~> 0.7**.
|
|
28
|
+
- Updated `gem_hadar` development dependency from **2.20.1** to **2.21.0**.
|
|
29
|
+
|
|
30
|
+
### Testing
|
|
31
|
+
|
|
32
|
+
- Added specs for `delete_collection` to verify refusal to delete the `default`
|
|
33
|
+
collection, resetting `current_collection` when the active collection is
|
|
34
|
+
deleted, and leaving `current_collection` unchanged for non-active
|
|
35
|
+
collections.
|
|
36
|
+
|
|
37
|
+
### Documentation
|
|
38
|
+
|
|
39
|
+
- Updated YARD documentation for `refresh_system_prompt` to accurately reflect
|
|
40
|
+
the placeholders used (`persona`, `persona_name`, `runtime_info`).
|
|
41
|
+
|
|
42
|
+
## 2026-10-21 v0.0.136
|
|
43
|
+
|
|
44
|
+
### Features
|
|
45
|
+
|
|
46
|
+
- Added a `machine` key to the static runtime information, injecting a compact
|
|
47
|
+
host description into the system prompt via a new `machine_profile` method in
|
|
48
|
+
`information.rb`.
|
|
49
|
+
- Introduced a new `OC::FASTFETCH` configuration option to resolve the
|
|
50
|
+
`fastfetch` executable path.
|
|
51
|
+
- Added a new `fastfetch-profile.jsonc` configuration file to define the
|
|
52
|
+
modules used for the machine profile.
|
|
53
|
+
- Added `always-allow` and `direct` modes to the `execute_shell` tool, allowing
|
|
54
|
+
users to remember command approvals for the session.
|
|
55
|
+
- Extended the `execute_shell` confirmation prompt to include `a` (always allow
|
|
56
|
+
with pager) and `d` (always allow direct to `STDOUT`) options.
|
|
57
|
+
|
|
58
|
+
### Fixes
|
|
59
|
+
|
|
60
|
+
- Updated the `kramdown_ansi` table separator spec to use pipe-bounded syntax
|
|
61
|
+
(`| Name | Age |`) to align with `kramdown-ansi` **0.6** requirements,
|
|
62
|
+
preventing literal dashes from leaking into the output.
|
|
63
|
+
- Renamed the `/last` command option from `-p` to `-d` for consistency with the
|
|
64
|
+
`execute_shell` direct mode flag.
|
|
65
|
+
|
|
66
|
+
### Improvements
|
|
67
|
+
|
|
68
|
+
- Refactored `execute_shell` output display to use a shared `write_output`
|
|
69
|
+
helper for both pager and direct output paths.
|
|
70
|
+
- Updated the `execute_shell` tool description to document the new
|
|
71
|
+
`always-allow` and `direct` options.
|
|
72
|
+
|
|
73
|
+
### Build & CI
|
|
74
|
+
|
|
75
|
+
- Updated the `kramdown-ansi` dependency constraint from **0.5** to **0.6** in
|
|
76
|
+
`Rakefile` and `ollama_chat.gemspec`.
|
|
77
|
+
- Added `lib/ollama_chat/ollama_chat_config/fastfetch-profile.jsonc` to the
|
|
78
|
+
gemspec files list.
|
|
79
|
+
- Added `git config --global --add safe.directory /work` to the CI test script
|
|
80
|
+
in `.all_images.yml`.
|
|
81
|
+
|
|
82
|
+
### Testing
|
|
83
|
+
|
|
84
|
+
- Added four new specs for `execute_shell` covering `always-allow` and `direct`
|
|
85
|
+
mode behaviors, including repeat execution and command differentiation.
|
|
86
|
+
- Updated `commands_spec.rb` to reflect the rename of the `/last` command
|
|
87
|
+
option from `-p` to `-d`.
|
|
88
|
+
- Added a `before` block in `execute_shell_spec.rb` to clear the
|
|
89
|
+
`always_allowed` hash and prevent cross-spec contamination.
|
|
90
|
+
|
|
3
91
|
## 2026-10-19 v0.0.135
|
|
4
92
|
|
|
5
93
|
### Features
|
data/Rakefile
CHANGED
|
@@ -39,7 +39,7 @@ GemHadar do
|
|
|
39
39
|
)
|
|
40
40
|
|
|
41
41
|
dependency 'excon', '~> 1.0'
|
|
42
|
-
dependency 'ollama-ruby', '~> 1.
|
|
42
|
+
dependency 'ollama-ruby', '~> 1.26'
|
|
43
43
|
dependency 'documentrix', '>= 0.8.0'
|
|
44
44
|
dependency 'unix_socks', '>= 0.4'
|
|
45
45
|
dependency 'rss', '~> 0.3'
|
|
@@ -47,7 +47,7 @@ GemHadar do
|
|
|
47
47
|
dependency 'redis', '~> 5.0'
|
|
48
48
|
dependency 'mime-types', '~> 3.0'
|
|
49
49
|
dependency 'reverse_markdown', '~> 3.0'
|
|
50
|
-
dependency 'kramdown-ansi', '~> 0.
|
|
50
|
+
dependency 'kramdown-ansi', '~> 0.7'
|
|
51
51
|
dependency 'complex_config', '~> 0.22', '>= 0.22.2'
|
|
52
52
|
dependency 'tins', '~> 1.61'
|
|
53
53
|
dependency 'search_ui', '>= 0.2'
|
data/lib/ollama_chat/commands.rb
CHANGED
|
@@ -285,15 +285,15 @@ module OllamaChat::Commands
|
|
|
285
285
|
|
|
286
286
|
command(
|
|
287
287
|
name: :last,
|
|
288
|
-
regexp: %r(^/last((?:\s+(?:-[
|
|
289
|
-
options: '[-
|
|
288
|
+
regexp: %r(^/last((?:\s+(?:-[dtsv]))*)(?:\s+(\d*))?$),
|
|
289
|
+
options: '[-d|-t|-s|n=1]',
|
|
290
290
|
help: <<~EOT
|
|
291
291
|
🔍 Show or speak last message(s)
|
|
292
|
-
|
|
293
|
-
|
|
292
|
+
Options: -d (direct), -t (show thinking),
|
|
293
|
+
-s (hide thinking) -v (voice output)
|
|
294
294
|
EOT
|
|
295
295
|
) do |opts,number|
|
|
296
|
-
opts = go_command('
|
|
296
|
+
opts = go_command('dtsv', opts.to_s)
|
|
297
297
|
n = number.to_i.clamp(1..)
|
|
298
298
|
if opts[?v]
|
|
299
299
|
messages.speak_last(n)
|
|
@@ -306,7 +306,7 @@ module OllamaChat::Commands
|
|
|
306
306
|
else
|
|
307
307
|
self.think_loud.on?
|
|
308
308
|
end
|
|
309
|
-
messages.show_last(n, think_loud:, pager: !opts[?
|
|
309
|
+
messages.show_last(n, think_loud:, pager: !opts[?d])
|
|
310
310
|
end
|
|
311
311
|
:next
|
|
312
312
|
end
|
|
@@ -51,7 +51,8 @@ class OllamaChat::Database::Models::Collection < Sequel::Model(OllamaChat::DB)
|
|
|
51
51
|
#
|
|
52
52
|
# @param chat [OllamaChat::Chat] the chat instance providing the configuration
|
|
53
53
|
def self.sync(chat)
|
|
54
|
-
chat.documents.collections.
|
|
54
|
+
all_collections = (%w[ default ] + chat.documents.collections).to_set
|
|
55
|
+
all_collections.each do |name|
|
|
55
56
|
where(name: name.to_s).first and next
|
|
56
57
|
create(
|
|
57
58
|
name: name.to_s,
|
|
@@ -341,6 +341,7 @@ module OllamaChat::Information
|
|
|
341
341
|
current_directory: Pathname.pwd.expand_path.to_path,
|
|
342
342
|
languages: config.languages * ', ',
|
|
343
343
|
location: location.on?.full? { location_description } || 'n/a',
|
|
344
|
+
machine: machine_profile || 'n/a',
|
|
344
345
|
user: ,
|
|
345
346
|
}
|
|
346
347
|
end
|
|
@@ -474,6 +475,63 @@ module OllamaChat::Information
|
|
|
474
475
|
|
|
475
476
|
private
|
|
476
477
|
|
|
478
|
+
# Builds and caches a compact, single-line description of the host
|
|
479
|
+
# machine, derived from a `fastfetch` run against the bundled profile
|
|
480
|
+
# (+OC::FASTFETCH+). The profile requests a focused set of modules
|
|
481
|
+
# (os, kernel, cpu, gpu, de, wm, terminal, memory, editor, packages,
|
|
482
|
+
# chassis, board, bios) so the result stays small enough to inject into
|
|
483
|
+
# the system prompt at zero per-turn cost.
|
|
484
|
+
#
|
|
485
|
+
# Gracefully degrades to `'n/a'` when +fastfetch+ is not installed or
|
|
486
|
+
# the config is missing, so a missing optional dependency never breaks
|
|
487
|
+
# session startup.
|
|
488
|
+
#
|
|
489
|
+
# @return [String] e.g.
|
|
490
|
+
# `C64 1541 (c64) · 6502@1MHz m64 · MOS Technology 6502 ·
|
|
491
|
+
# NVIDIA GeForce RTX 5090 (32GB) · VIC-II (no DE) · Home Computer ·
|
|
492
|
+
# PET2001N-Board · MOS 3.0 UEFI 4000 · 64 KiB · vim 1.0 · 1 pkgs`
|
|
493
|
+
def machine_profile
|
|
494
|
+
return @machine_profile if defined?(@machine_profile)
|
|
495
|
+
@machine_profile = nil
|
|
496
|
+
unless fastfetch = OC::FASTFETCH?
|
|
497
|
+
log(:warn, 'Fastfetch executable not found, skipping machine profile!')
|
|
498
|
+
return
|
|
499
|
+
end
|
|
500
|
+
config = Shellwords.escape(File.join(__dir__, 'ollama_chat_config', 'fastfetch-profile.jsonc'))
|
|
501
|
+
out = `#{fastfetch} -c #{config} --format json 2>/dev/null`.full? or return
|
|
502
|
+
mods = JSON.parse(out, object_class: JSON::GenericObject)
|
|
503
|
+
@machine_profile =
|
|
504
|
+
mods.map do |m|
|
|
505
|
+
r = m.result or next
|
|
506
|
+
case m.type
|
|
507
|
+
when 'OS'
|
|
508
|
+
"%s %s (%s)" % [ r.name, r.versionID, r.idLike ]
|
|
509
|
+
when 'Kernel'
|
|
510
|
+
"%s %s" % [ r.release, r.architecture ]
|
|
511
|
+
when 'CPU'
|
|
512
|
+
r.cpu
|
|
513
|
+
when 'GPU'
|
|
514
|
+
(r.find { _1.type == 'Discrete' } || r.first)&.name
|
|
515
|
+
when 'WM'
|
|
516
|
+
suffix = mods.any? { _1.type == 'DE' && _1.result } ? '' : ' (no DE)'
|
|
517
|
+
"%s/%s%s" % [ r.processName, r.protocolName, suffix ]
|
|
518
|
+
when 'Memory'
|
|
519
|
+
format_bytes(r.total)
|
|
520
|
+
when 'Editor'
|
|
521
|
+
"%s %s" % [ r.exe, r.version ]
|
|
522
|
+
when 'Packages'
|
|
523
|
+
"%s pkgs" % r.all
|
|
524
|
+
when 'Chassis'
|
|
525
|
+
r.type
|
|
526
|
+
when 'Board'
|
|
527
|
+
r.name
|
|
528
|
+
when 'BIOS'
|
|
529
|
+
"%s %s" % [ r.type, r.version ]
|
|
530
|
+
end
|
|
531
|
+
end.compact * ' · '
|
|
532
|
+
rescue JSON::ParserError
|
|
533
|
+
end
|
|
534
|
+
|
|
477
535
|
# Lazily builds and caches the {ContextUsage} bound to this chat,
|
|
478
536
|
# which owns the ANSI/emoji presentation logic for context usage.
|
|
479
537
|
#
|
data/lib/ollama_chat/oc.rb
CHANGED
|
@@ -89,6 +89,14 @@ module OC
|
|
|
89
89
|
end
|
|
90
90
|
end
|
|
91
91
|
|
|
92
|
+
FASTFETCH = set do
|
|
93
|
+
description 'Path to fastfetch executable for system information'
|
|
94
|
+
|
|
95
|
+
default do
|
|
96
|
+
`which 2>/dev/null fastfetch`.full?(:chomp)
|
|
97
|
+
end
|
|
98
|
+
end
|
|
99
|
+
|
|
92
100
|
KRAMDOWN_ANSI_OLLAMA_CHAT_STYLES = set do
|
|
93
101
|
description 'Styles to use for kramdown-ansi markdown'
|
|
94
102
|
|
|
@@ -106,7 +114,7 @@ module OC
|
|
|
106
114
|
|
|
107
115
|
URL = set do
|
|
108
116
|
description 'Ollama base URL to connect to'
|
|
109
|
-
default {
|
|
117
|
+
default { host = OC::OLLAMA::HOST? and Ollama.base_url(host).to_s }
|
|
110
118
|
sensitive true
|
|
111
119
|
decode { URI.parse(_1) if _1.present? }
|
|
112
120
|
check { value.scheme =~ /\Ahttps?\z/ }
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://github.com/fastfetch-cli/fastfetch/raw/dev/doc/json_schema.json",
|
|
3
|
+
"display": {
|
|
4
|
+
"showErrors": false,
|
|
5
|
+
"noBuffer": true
|
|
6
|
+
},
|
|
7
|
+
"logo": null,
|
|
8
|
+
"modules": [
|
|
9
|
+
"os", "kernel", "cpu", "gpu", "de", "wm",
|
|
10
|
+
"terminal", "memory", "editor",
|
|
11
|
+
"packages", "chassis", "board", "bios"
|
|
12
|
+
]
|
|
13
|
+
}
|
|
@@ -480,7 +480,6 @@ module OllamaChat::RAGHandling
|
|
|
480
480
|
col&.update(name: new_collection.to_s)
|
|
481
481
|
log(:info, "Collection renamed", data: { old_name: current_collection, new_name: new_collection })
|
|
482
482
|
feedback("Renamed current collection #{current_collection} to #{new_collection}.", type: :info)
|
|
483
|
-
refresh_system_prompt
|
|
484
483
|
rescue Sequel::UniqueConstraintViolation
|
|
485
484
|
feedback("Renaming to #{new_collection} failed, it already exists in database.", type: :warn)
|
|
486
485
|
rescue => e
|
|
@@ -678,7 +677,6 @@ module OllamaChat::RAGHandling
|
|
|
678
677
|
end
|
|
679
678
|
feedback("Created collection '#{name}'.", type: :success)
|
|
680
679
|
log(:info, "Collection created", data: { name:, description:, patterns: })
|
|
681
|
-
refresh_system_prompt
|
|
682
680
|
rescue Sequel::UniqueConstraintViolation
|
|
683
681
|
feedback("Collection #{name.inspect} already exists.", type: :warn)
|
|
684
682
|
rescue Sequel::Error => e
|
|
@@ -737,7 +735,6 @@ module OllamaChat::RAGHandling
|
|
|
737
735
|
end
|
|
738
736
|
feedback("Updated collection '#{col.name}'.", type: :success)
|
|
739
737
|
log(:info, "Collection updated", data: { name: col.name, enabled: col.enabled })
|
|
740
|
-
refresh_system_prompt
|
|
741
738
|
rescue Sequel::Error => e
|
|
742
739
|
feedback("Database error: #{e.message}", type: :warn)
|
|
743
740
|
end
|
|
@@ -761,17 +758,31 @@ module OllamaChat::RAGHandling
|
|
|
761
758
|
next
|
|
762
759
|
end
|
|
763
760
|
|
|
761
|
+
if target_name.to_s == 'default'
|
|
762
|
+
feedback(
|
|
763
|
+
"Cannot delete #{target_name.inspect}: it is the default collection. " \
|
|
764
|
+
'Switch to another collection first.',
|
|
765
|
+
type: :warn
|
|
766
|
+
)
|
|
767
|
+
next
|
|
768
|
+
end
|
|
769
|
+
|
|
770
|
+
destroyed = false
|
|
764
771
|
if confirm?(prompt: "⚠️ Are you sure you want to permanently delete #{target_name.inspect}? (y/n) ", yes: /\Ay/i)
|
|
765
772
|
begin
|
|
766
773
|
col.chat = self
|
|
767
774
|
col.destroy
|
|
775
|
+
destroyed = true
|
|
768
776
|
feedback("Deleted collection #{target_name.inspect}.", type: :success)
|
|
769
777
|
log(:info, "Collection deleted", data: { name: target_name })
|
|
770
|
-
refresh_system_prompt
|
|
771
778
|
rescue Sequel::Error => e
|
|
772
779
|
feedback("Database error: #{e.message}", type: :warn)
|
|
773
780
|
rescue => e
|
|
774
781
|
feedback("Error removing from Documentrix: #{e.message}", type: :warn)
|
|
782
|
+
ensure
|
|
783
|
+
if destroyed && session.current_collection == target_name
|
|
784
|
+
session.update(current_collection: 'default')
|
|
785
|
+
end
|
|
775
786
|
end
|
|
776
787
|
else
|
|
777
788
|
feedback("Deletion denied.", type: :denied)
|
|
@@ -42,11 +42,11 @@ module OllamaChat::SystemPromptManagement
|
|
|
42
42
|
end
|
|
43
43
|
|
|
44
44
|
# Re-interpolates the current system prompt with fresh dynamic values
|
|
45
|
-
# (persona content,
|
|
45
|
+
# (persona content, persona name, runtime info).
|
|
46
46
|
#
|
|
47
47
|
# Call this after any operation that mutates the sources baked into
|
|
48
|
-
# the system prompt, such as
|
|
49
|
-
#
|
|
48
|
+
# the system prompt, such as switching personas or toggling runtime
|
|
49
|
+
# info.
|
|
50
50
|
#
|
|
51
51
|
# Safe to call when no system prompt is set; returns immediately.
|
|
52
52
|
def refresh_system_prompt
|
|
@@ -13,6 +13,13 @@ class OllamaChat::Tools::ExecuteShell
|
|
|
13
13
|
# @return [String] the registered name for this tool
|
|
14
14
|
def self.register_name = 'execute_shell'
|
|
15
15
|
|
|
16
|
+
# In-memory set of always-allowed command strings (per process).
|
|
17
|
+
#
|
|
18
|
+
# @return [Hash{String => true}]
|
|
19
|
+
def self.always_allowed
|
|
20
|
+
@always_allowed ||= {}
|
|
21
|
+
end
|
|
22
|
+
|
|
16
23
|
# Compaction summary: one-liner for lookup_group output.
|
|
17
24
|
#
|
|
18
25
|
# @param result [String] the raw JSON result string
|
|
@@ -35,7 +42,9 @@ class OllamaChat::Tools::ExecuteShell
|
|
|
35
42
|
description: <<~EOT,
|
|
36
43
|
Shell executor – Runs a shell command via `sh -c`. The
|
|
37
44
|
command is opened in your editor for review/modification,
|
|
38
|
-
then a mandatory y/n/i confirm prompt gates execution.
|
|
45
|
+
then a mandatory y/n/i/a confirm prompt gates execution.
|
|
46
|
+
Answering a remembers the command for the session
|
|
47
|
+
(skips editor and confirm on repeat).
|
|
39
48
|
Last resort: use ONLY when no dedicated tool covers
|
|
40
49
|
the task (e.g. `git commit`, `bundle install`, `make`).
|
|
41
50
|
Prefer `execute_grep`, `list_directory`, `read_file`,
|
|
@@ -77,27 +86,42 @@ class OllamaChat::Tools::ExecuteShell
|
|
|
77
86
|
monochrome = args.monochrome.nil? ? true : args.monochrome
|
|
78
87
|
|
|
79
88
|
unless OllamaChat.test_mode?
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
feedback "\n$ #{command}\n"
|
|
86
|
-
answer = chat.confirm?(
|
|
87
|
-
prompt: '❓ Allow ✅[y]es / ⛔️[n]o / 📝[i]nstruct? '
|
|
88
|
-
)&.to_s&.downcase
|
|
89
|
-
|
|
90
|
-
case answer
|
|
91
|
-
when 'y'
|
|
92
|
-
# proceed to execution
|
|
93
|
-
when 'n'
|
|
94
|
-
raise OllamaChat::ToolFunctionArgumentError,
|
|
95
|
-
"Shell command cancelled by user: #{command}"
|
|
89
|
+
mode = self.class.always_allowed[command]
|
|
90
|
+
if mode
|
|
91
|
+
label = mode == :direct ? '📄 Direct' : '☑️ Always allowed'
|
|
92
|
+
feedback "#{label} (this process)\n$ #{command}\n"
|
|
96
93
|
else
|
|
97
|
-
|
|
98
|
-
resolve = instr.full? || 'You **MUST** ask the user for instructions!'
|
|
94
|
+
reviewed = review(command)
|
|
99
95
|
raise OllamaChat::ToolFunctionArgumentError,
|
|
100
|
-
|
|
96
|
+
"Shell command cancelled by user: #{command}" unless reviewed
|
|
97
|
+
command = reviewed
|
|
98
|
+
|
|
99
|
+
feedback(<<~EOT)
|
|
100
|
+
$ #{command}
|
|
101
|
+
|
|
102
|
+
y once · n cancel · i instruct me · a always (pager) · d always (direct)
|
|
103
|
+
|
|
104
|
+
EOT
|
|
105
|
+
answer = chat.confirm?(
|
|
106
|
+
prompt: '❓ Allow ✅[y]es / ⛔️[n]o / 📝[i]nstruct / 🔁[a]lways / 📄[d]irect? '
|
|
107
|
+
)&.to_s&.downcase
|
|
108
|
+
|
|
109
|
+
case answer
|
|
110
|
+
when 'y'
|
|
111
|
+
# proceed to execution
|
|
112
|
+
when 'a'
|
|
113
|
+
self.class.always_allowed[command] = :always
|
|
114
|
+
when 'd'
|
|
115
|
+
self.class.always_allowed[command] = :direct
|
|
116
|
+
when 'n'
|
|
117
|
+
raise OllamaChat::ToolFunctionArgumentError,
|
|
118
|
+
"Shell command cancelled by user: #{command}"
|
|
119
|
+
else
|
|
120
|
+
instr = chat.ask?(prompt: '📝 Instructions: ')&.strip
|
|
121
|
+
resolve = instr.full? || 'You **MUST** ask the user for instructions!'
|
|
122
|
+
raise OllamaChat::ToolFunctionArgumentError,
|
|
123
|
+
"User instruct: #{resolve} (command: #{command})"
|
|
124
|
+
end
|
|
101
125
|
end
|
|
102
126
|
end
|
|
103
127
|
|
|
@@ -114,7 +138,7 @@ class OllamaChat::Tools::ExecuteShell
|
|
|
114
138
|
stderr_bytes: stderr.bytesize,
|
|
115
139
|
})
|
|
116
140
|
|
|
117
|
-
display(stdout, stderr, exit_code)
|
|
141
|
+
display(stdout, stderr, exit_code, direct: mode == :direct)
|
|
118
142
|
|
|
119
143
|
{
|
|
120
144
|
stdout:, stderr:, exit_code:, command:,
|
|
@@ -137,20 +161,36 @@ class OllamaChat::Tools::ExecuteShell
|
|
|
137
161
|
edited.full?(:chomp)
|
|
138
162
|
end
|
|
139
163
|
|
|
140
|
-
# Display command output through the pager.
|
|
141
|
-
def display(stdout, stderr, exit_code)
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
if stderr.present?
|
|
148
|
-
io.puts bold { "stderr:" }, ""
|
|
149
|
-
io.puts stderr
|
|
164
|
+
# Display command output through the pager or directly to STDOUT.
|
|
165
|
+
def display(stdout, stderr, exit_code, direct: false)
|
|
166
|
+
if direct
|
|
167
|
+
write_output(STDOUT, stdout, stderr, exit_code)
|
|
168
|
+
else
|
|
169
|
+
chat.use_pager(force: true) do |io|
|
|
170
|
+
write_output(io, stdout, stderr, exit_code)
|
|
150
171
|
end
|
|
151
|
-
io.puts bold{ "🎌 exit: #{exit_code}" }
|
|
152
172
|
end
|
|
153
173
|
end
|
|
154
174
|
|
|
175
|
+
# Writes the output of a command or process to an IO object,
|
|
176
|
+
# formatting the stdout and stderr sections with bold headers,
|
|
177
|
+
# followed by a bold line indicating the exit code.
|
|
178
|
+
#
|
|
179
|
+
# @param io [ IO ] the IO object to write to
|
|
180
|
+
# @param stdout [ String ] the standard output content to display
|
|
181
|
+
# @param stderr [ String ] the standard error content to display
|
|
182
|
+
# @param exit_code [ Integer ] the exit code of the process
|
|
183
|
+
def write_output(io, stdout, stderr, exit_code)
|
|
184
|
+
if stdout.present?
|
|
185
|
+
io.puts bold { "stdout:" }, ""
|
|
186
|
+
io.puts stdout
|
|
187
|
+
end
|
|
188
|
+
if stderr.present?
|
|
189
|
+
io.puts bold { "stderr:" }, ""
|
|
190
|
+
io.puts stderr
|
|
191
|
+
end
|
|
192
|
+
io.puts bold { "🎌 exit: #{exit_code}" }
|
|
193
|
+
end
|
|
194
|
+
|
|
155
195
|
self
|
|
156
196
|
end.register
|
data/lib/ollama_chat/version.rb
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
# by hand; it is rewritten on every `rake version` invocation.
|
|
6
6
|
module OllamaChat
|
|
7
7
|
# The current version of the OllamaChat gem as a String.
|
|
8
|
-
VERSION = '0.0.
|
|
8
|
+
VERSION = '0.0.137'
|
|
9
9
|
VERSION_ARRAY = VERSION.split('.').map(&:to_i) # :nodoc:
|
|
10
10
|
VERSION_MAJOR = VERSION_ARRAY[0] # :nodoc:
|
|
11
11
|
VERSION_MINOR = VERSION_ARRAY[1] # :nodoc:
|
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.137 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.137".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]
|
|
@@ -13,18 +13,18 @@ Gem::Specification.new do |s|
|
|
|
13
13
|
s.email = "flori@ping.de".freeze
|
|
14
14
|
s.executables = ["ollama_chat".freeze, "ollama_chat_send".freeze, "ollama_chat_log".freeze]
|
|
15
15
|
s.extra_rdoc_files = ["README.md".freeze, "lib/ollama_chat.rb".freeze, "lib/ollama_chat/asr.rb".freeze, "lib/ollama_chat/chat.rb".freeze, "lib/ollama_chat/clipboard.rb".freeze, "lib/ollama_chat/collection_search.rb".freeze, "lib/ollama_chat/command_concern.rb".freeze, "lib/ollama_chat/commands.rb".freeze, "lib/ollama_chat/compaction.rb".freeze, "lib/ollama_chat/config_handling.rb".freeze, "lib/ollama_chat/context_usage.rb".freeze, "lib/ollama_chat/conversation.rb".freeze, "lib/ollama_chat/database.rb".freeze, "lib/ollama_chat/database/duplicatable.rb".freeze, "lib/ollama_chat/database/migrations.rb".freeze, "lib/ollama_chat/database/migrations/001_initial_schema.rb".freeze, "lib/ollama_chat/database/migrations/002_add_links_to_sessions.rb".freeze, "lib/ollama_chat/database/migrations/003_add_history_to_sessions.rb".freeze, "lib/ollama_chat/database/migrations/004_add_profile_to_model_options.rb".freeze, "lib/ollama_chat/database/migrations/005_add_context_format_to_sessions.rb".freeze, "lib/ollama_chat/database/migrations/006_rename_system_prompt_context_to_system.rb".freeze, "lib/ollama_chat/database/migrations/007_add_collections_table.rb".freeze, "lib/ollama_chat/database/migrations/008_drop_think_mode_constraint.rb".freeze, "lib/ollama_chat/database/migrations/009_add_app_states_table.rb".freeze, "lib/ollama_chat/database/migrations/010_add_enabled_to_collections.rb".freeze, "lib/ollama_chat/database/migrations/011_add_trigger_to_sessions.rb".freeze, "lib/ollama_chat/database/migrations/012_add_context_manifest_enabled_to_sessions.rb".freeze, "lib/ollama_chat/database/models/app_state.rb".freeze, "lib/ollama_chat/database/models/collection.rb".freeze, "lib/ollama_chat/database/models/favourite.rb".freeze, "lib/ollama_chat/database/models/model_options.rb".freeze, "lib/ollama_chat/database/models/prompt.rb".freeze, "lib/ollama_chat/database/models/session.rb".freeze, "lib/ollama_chat/database/row_locking.rb".freeze, "lib/ollama_chat/dialog.rb".freeze, "lib/ollama_chat/document_cache.rb".freeze, "lib/ollama_chat/favourites_management.rb".freeze, "lib/ollama_chat/feedback.rb".freeze, "lib/ollama_chat/file_editing.rb".freeze, "lib/ollama_chat/follow_chat.rb".freeze, "lib/ollama_chat/history.rb".freeze, "lib/ollama_chat/http_handling.rb".freeze, "lib/ollama_chat/information.rb".freeze, "lib/ollama_chat/input_content.rb".freeze, "lib/ollama_chat/invidious.rb".freeze, "lib/ollama_chat/kramdown_ansi.rb".freeze, "lib/ollama_chat/links_set.rb".freeze, "lib/ollama_chat/location_handling.rb".freeze, "lib/ollama_chat/logging.rb".freeze, "lib/ollama_chat/message.rb".freeze, "lib/ollama_chat/message_editing.rb".freeze, "lib/ollama_chat/message_format.rb".freeze, "lib/ollama_chat/message_list.rb".freeze, "lib/ollama_chat/message_output.rb".freeze, "lib/ollama_chat/model_handling.rb".freeze, "lib/ollama_chat/model_handling/model_cache.rb".freeze, "lib/ollama_chat/oc.rb".freeze, "lib/ollama_chat/ollama_chat_config.rb".freeze, "lib/ollama_chat/pager.rb".freeze, "lib/ollama_chat/parsing.rb".freeze, "lib/ollama_chat/personae_management.rb".freeze, "lib/ollama_chat/prompt_handling.rb".freeze, "lib/ollama_chat/prompt_management.rb".freeze, "lib/ollama_chat/rag_handling.rb".freeze, "lib/ollama_chat/redis_cache.rb".freeze, "lib/ollama_chat/say.rb".freeze, "lib/ollama_chat/server_socket.rb".freeze, "lib/ollama_chat/session_management.rb".freeze, "lib/ollama_chat/source_fetching.rb".freeze, "lib/ollama_chat/speaker.rb".freeze, "lib/ollama_chat/state_selectors.rb".freeze, "lib/ollama_chat/switches.rb".freeze, "lib/ollama_chat/system_prompt_management.rb".freeze, "lib/ollama_chat/think_control.rb".freeze, "lib/ollama_chat/token_estimator.rb".freeze, "lib/ollama_chat/token_estimator/crude.rb".freeze, "lib/ollama_chat/tool_call_processor.rb".freeze, "lib/ollama_chat/tool_calling.rb".freeze, "lib/ollama_chat/tools.rb".freeze, "lib/ollama_chat/tools/browse.rb".freeze, "lib/ollama_chat/tools/compute_bmi.rb".freeze, "lib/ollama_chat/tools/concern.rb".freeze, "lib/ollama_chat/tools/copy_to_clipboard.rb".freeze, "lib/ollama_chat/tools/delete_file.rb".freeze, "lib/ollama_chat/tools/eval_ruby.rb".freeze, "lib/ollama_chat/tools/execute_grep.rb".freeze, "lib/ollama_chat/tools/execute_jira_twg.rb".freeze, "lib/ollama_chat/tools/execute_ri.rb".freeze, "lib/ollama_chat/tools/execute_shell.rb".freeze, "lib/ollama_chat/tools/forget.rb".freeze, "lib/ollama_chat/tools/generate_image.rb".freeze, "lib/ollama_chat/tools/generate_password.rb".freeze, "lib/ollama_chat/tools/get_current_weather.rb".freeze, "lib/ollama_chat/tools/get_cve.rb".freeze, "lib/ollama_chat/tools/get_endoflife.rb".freeze, "lib/ollama_chat/tools/get_ghr.rb".freeze, "lib/ollama_chat/tools/get_jira_issue.rb".freeze, "lib/ollama_chat/tools/get_location.rb".freeze, "lib/ollama_chat/tools/get_rfc.rb".freeze, "lib/ollama_chat/tools/get_time.rb".freeze, "lib/ollama_chat/tools/get_url.rb".freeze, "lib/ollama_chat/tools/list_directory.rb".freeze, "lib/ollama_chat/tools/lookup_gem_path.rb".freeze, "lib/ollama_chat/tools/lookup_group.rb".freeze, "lib/ollama_chat/tools/memorize.rb".freeze, "lib/ollama_chat/tools/move_file.rb".freeze, "lib/ollama_chat/tools/open_file_in_editor.rb".freeze, "lib/ollama_chat/tools/paste_from_clipboard.rb".freeze, "lib/ollama_chat/tools/paste_into_editor.rb".freeze, "lib/ollama_chat/tools/patch_file.rb".freeze, "lib/ollama_chat/tools/read_file.rb".freeze, "lib/ollama_chat/tools/resolve_tag.rb".freeze, "lib/ollama_chat/tools/roll_dice.rb".freeze, "lib/ollama_chat/tools/run_tests.rb".freeze, "lib/ollama_chat/tools/search_knowledge.rb".freeze, "lib/ollama_chat/tools/search_web.rb".freeze, "lib/ollama_chat/tools/write_file.rb".freeze, "lib/ollama_chat/tts.rb".freeze, "lib/ollama_chat/utils.rb".freeze, "lib/ollama_chat/utils/analyze_directory.rb".freeze, "lib/ollama_chat/utils/audio_player.rb".freeze, "lib/ollama_chat/utils/backup.rb".freeze, "lib/ollama_chat/utils/cache_fetcher.rb".freeze, "lib/ollama_chat/utils/chooser.rb".freeze, "lib/ollama_chat/utils/excon_logger.rb".freeze, "lib/ollama_chat/utils/fetcher.rb".freeze, "lib/ollama_chat/utils/json_jsonl_io.rb".freeze, "lib/ollama_chat/utils/log_rotation.rb".freeze, "lib/ollama_chat/utils/log_viewer.rb".freeze, "lib/ollama_chat/utils/ordered_queue.rb".freeze, "lib/ollama_chat/utils/path_completer.rb".freeze, "lib/ollama_chat/utils/path_validator.rb".freeze, "lib/ollama_chat/utils/png_metadata_extractor.rb".freeze, "lib/ollama_chat/utils/strip_ansi.rb".freeze, "lib/ollama_chat/utils/tag_resolver.rb".freeze, "lib/ollama_chat/utils/utf8_converter.rb".freeze, "lib/ollama_chat/utils/value_formatter.rb".freeze, "lib/ollama_chat/uuid_v7.rb".freeze, "lib/ollama_chat/version.rb".freeze, "lib/ollama_chat/vim.rb".freeze, "lib/ollama_chat/web_searching.rb".freeze]
|
|
16
|
-
s.files = [".utilsrc".freeze, "CHANGES.md".freeze, "Gemfile".freeze, "LICENSE".freeze, "README.md".freeze, "Rakefile".freeze, "bin/ollama_chat".freeze, "bin/ollama_chat_log".freeze, "bin/ollama_chat_send".freeze, "config/searxng/settings.yml".freeze, "config/sherlock.md".freeze, "docker-compose.yml".freeze, "lib/ollama_chat.rb".freeze, "lib/ollama_chat/asr.rb".freeze, "lib/ollama_chat/chat.rb".freeze, "lib/ollama_chat/clipboard.rb".freeze, "lib/ollama_chat/collection_search.rb".freeze, "lib/ollama_chat/command_concern.rb".freeze, "lib/ollama_chat/commands.rb".freeze, "lib/ollama_chat/compaction.rb".freeze, "lib/ollama_chat/config_handling.rb".freeze, "lib/ollama_chat/context_usage.rb".freeze, "lib/ollama_chat/conversation.rb".freeze, "lib/ollama_chat/database.rb".freeze, "lib/ollama_chat/database/duplicatable.rb".freeze, "lib/ollama_chat/database/migrations.rb".freeze, "lib/ollama_chat/database/migrations/001_initial_schema.rb".freeze, "lib/ollama_chat/database/migrations/002_add_links_to_sessions.rb".freeze, "lib/ollama_chat/database/migrations/003_add_history_to_sessions.rb".freeze, "lib/ollama_chat/database/migrations/004_add_profile_to_model_options.rb".freeze, "lib/ollama_chat/database/migrations/005_add_context_format_to_sessions.rb".freeze, "lib/ollama_chat/database/migrations/006_rename_system_prompt_context_to_system.rb".freeze, "lib/ollama_chat/database/migrations/007_add_collections_table.rb".freeze, "lib/ollama_chat/database/migrations/008_drop_think_mode_constraint.rb".freeze, "lib/ollama_chat/database/migrations/009_add_app_states_table.rb".freeze, "lib/ollama_chat/database/migrations/010_add_enabled_to_collections.rb".freeze, "lib/ollama_chat/database/migrations/011_add_trigger_to_sessions.rb".freeze, "lib/ollama_chat/database/migrations/012_add_context_manifest_enabled_to_sessions.rb".freeze, "lib/ollama_chat/database/models/app_state.rb".freeze, "lib/ollama_chat/database/models/collection.rb".freeze, "lib/ollama_chat/database/models/favourite.rb".freeze, "lib/ollama_chat/database/models/model_options.rb".freeze, "lib/ollama_chat/database/models/prompt.rb".freeze, "lib/ollama_chat/database/models/session.rb".freeze, "lib/ollama_chat/database/row_locking.rb".freeze, "lib/ollama_chat/dialog.rb".freeze, "lib/ollama_chat/document_cache.rb".freeze, "lib/ollama_chat/favourites_management.rb".freeze, "lib/ollama_chat/feedback.rb".freeze, "lib/ollama_chat/file_editing.rb".freeze, "lib/ollama_chat/follow_chat.rb".freeze, "lib/ollama_chat/history.rb".freeze, "lib/ollama_chat/http_handling.rb".freeze, "lib/ollama_chat/information.rb".freeze, "lib/ollama_chat/input_content.rb".freeze, "lib/ollama_chat/invidious.rb".freeze, "lib/ollama_chat/kramdown_ansi.rb".freeze, "lib/ollama_chat/links_set.rb".freeze, "lib/ollama_chat/location_handling.rb".freeze, "lib/ollama_chat/logging.rb".freeze, "lib/ollama_chat/message.rb".freeze, "lib/ollama_chat/message_editing.rb".freeze, "lib/ollama_chat/message_format.rb".freeze, "lib/ollama_chat/message_list.rb".freeze, "lib/ollama_chat/message_output.rb".freeze, "lib/ollama_chat/model_handling.rb".freeze, "lib/ollama_chat/model_handling/model_cache.rb".freeze, "lib/ollama_chat/oc.rb".freeze, "lib/ollama_chat/ollama_chat_config.rb".freeze, "lib/ollama_chat/ollama_chat_config/default_config.yml".freeze, "lib/ollama_chat/pager.rb".freeze, "lib/ollama_chat/parsing.rb".freeze, "lib/ollama_chat/personae_management.rb".freeze, "lib/ollama_chat/prompt_handling.rb".freeze, "lib/ollama_chat/prompt_management.rb".freeze, "lib/ollama_chat/rag_handling.rb".freeze, "lib/ollama_chat/redis_cache.rb".freeze, "lib/ollama_chat/say.rb".freeze, "lib/ollama_chat/server_socket.rb".freeze, "lib/ollama_chat/session_management.rb".freeze, "lib/ollama_chat/source_fetching.rb".freeze, "lib/ollama_chat/speaker.rb".freeze, "lib/ollama_chat/state_selectors.rb".freeze, "lib/ollama_chat/switches.rb".freeze, "lib/ollama_chat/system_prompt_management.rb".freeze, "lib/ollama_chat/think_control.rb".freeze, "lib/ollama_chat/token_estimator.rb".freeze, "lib/ollama_chat/token_estimator/crude.rb".freeze, "lib/ollama_chat/tool_call_processor.rb".freeze, "lib/ollama_chat/tool_calling.rb".freeze, "lib/ollama_chat/tools.rb".freeze, "lib/ollama_chat/tools/browse.rb".freeze, "lib/ollama_chat/tools/compute_bmi.rb".freeze, "lib/ollama_chat/tools/concern.rb".freeze, "lib/ollama_chat/tools/copy_to_clipboard.rb".freeze, "lib/ollama_chat/tools/delete_file.rb".freeze, "lib/ollama_chat/tools/eval_ruby.rb".freeze, "lib/ollama_chat/tools/execute_grep.rb".freeze, "lib/ollama_chat/tools/execute_jira_twg.rb".freeze, "lib/ollama_chat/tools/execute_ri.rb".freeze, "lib/ollama_chat/tools/execute_shell.rb".freeze, "lib/ollama_chat/tools/forget.rb".freeze, "lib/ollama_chat/tools/generate_image.rb".freeze, "lib/ollama_chat/tools/generate_password.rb".freeze, "lib/ollama_chat/tools/get_current_weather.rb".freeze, "lib/ollama_chat/tools/get_cve.rb".freeze, "lib/ollama_chat/tools/get_endoflife.rb".freeze, "lib/ollama_chat/tools/get_ghr.rb".freeze, "lib/ollama_chat/tools/get_jira_issue.rb".freeze, "lib/ollama_chat/tools/get_location.rb".freeze, "lib/ollama_chat/tools/get_rfc.rb".freeze, "lib/ollama_chat/tools/get_time.rb".freeze, "lib/ollama_chat/tools/get_url.rb".freeze, "lib/ollama_chat/tools/list_directory.rb".freeze, "lib/ollama_chat/tools/lookup_gem_path.rb".freeze, "lib/ollama_chat/tools/lookup_group.rb".freeze, "lib/ollama_chat/tools/memorize.rb".freeze, "lib/ollama_chat/tools/move_file.rb".freeze, "lib/ollama_chat/tools/open_file_in_editor.rb".freeze, "lib/ollama_chat/tools/paste_from_clipboard.rb".freeze, "lib/ollama_chat/tools/paste_into_editor.rb".freeze, "lib/ollama_chat/tools/patch_file.rb".freeze, "lib/ollama_chat/tools/read_file.rb".freeze, "lib/ollama_chat/tools/resolve_tag.rb".freeze, "lib/ollama_chat/tools/roll_dice.rb".freeze, "lib/ollama_chat/tools/run_tests.rb".freeze, "lib/ollama_chat/tools/search_knowledge.rb".freeze, "lib/ollama_chat/tools/search_web.rb".freeze, "lib/ollama_chat/tools/write_file.rb".freeze, "lib/ollama_chat/tts.rb".freeze, "lib/ollama_chat/utils.rb".freeze, "lib/ollama_chat/utils/analyze_directory.rb".freeze, "lib/ollama_chat/utils/audio_player.rb".freeze, "lib/ollama_chat/utils/backup.rb".freeze, "lib/ollama_chat/utils/cache_fetcher.rb".freeze, "lib/ollama_chat/utils/chooser.rb".freeze, "lib/ollama_chat/utils/excon_logger.rb".freeze, "lib/ollama_chat/utils/fetcher.rb".freeze, "lib/ollama_chat/utils/json_jsonl_io.rb".freeze, "lib/ollama_chat/utils/log_rotation.rb".freeze, "lib/ollama_chat/utils/log_viewer.rb".freeze, "lib/ollama_chat/utils/ordered_queue.rb".freeze, "lib/ollama_chat/utils/path_completer.rb".freeze, "lib/ollama_chat/utils/path_validator.rb".freeze, "lib/ollama_chat/utils/png_metadata_extractor.rb".freeze, "lib/ollama_chat/utils/strip_ansi.rb".freeze, "lib/ollama_chat/utils/tag_resolver.rb".freeze, "lib/ollama_chat/utils/utf8_converter.rb".freeze, "lib/ollama_chat/utils/value_formatter.rb".freeze, "lib/ollama_chat/uuid_v7.rb".freeze, "lib/ollama_chat/version.rb".freeze, "lib/ollama_chat/vim.rb".freeze, "lib/ollama_chat/web_searching.rb".freeze, "ollama_chat.gemspec".freeze, "redis/redis.conf".freeze, "spec/assets/api_ps.json".freeze, "spec/assets/api_show.json".freeze, "spec/assets/api_tags.json".freeze, "spec/assets/api_version.json".freeze, "spec/assets/conversation.json".freeze, "spec/assets/conversation.jsonl".freeze, "spec/assets/deep/deeper/empty.txt".freeze, "spec/assets/deep/deeper/not-empty.txt".freeze, "spec/assets/deep/empty.txt".freeze, "spec/assets/duckduckgo.html".freeze, "spec/assets/example.atom".freeze, "spec/assets/example.csv".freeze, "spec/assets/example.epub".freeze, "spec/assets/example.html".freeze, "spec/assets/example.pdf".freeze, "spec/assets/example.ps".freeze, "spec/assets/example.rb".freeze, "spec/assets/example.rss".freeze, "spec/assets/example.xml".freeze, "spec/assets/example_with_quote.html".freeze, "spec/assets/fluffy.png".freeze, "spec/assets/kitten.jpg".freeze, "spec/assets/linux.oga".freeze, "spec/assets/miyu.png".freeze, "spec/assets/pirateweather.json".freeze, "spec/assets/prompt.txt".freeze, "spec/assets/searxng.json".freeze, "spec/ollama_chat/asr_spec.rb".freeze, "spec/ollama_chat/chat_spec.rb".freeze, "spec/ollama_chat/clipboard_spec.rb".freeze, "spec/ollama_chat/collection_search_spec.rb".freeze, "spec/ollama_chat/command_concern_spec.rb".freeze, "spec/ollama_chat/commands_spec.rb".freeze, "spec/ollama_chat/compaction_spec.rb".freeze, "spec/ollama_chat/config_handling_spec.rb".freeze, "spec/ollama_chat/context_usage_spec.rb".freeze, "spec/ollama_chat/conversation_spec.rb".freeze, "spec/ollama_chat/database/models/favourite_spec.rb".freeze, "spec/ollama_chat/favourites_management_spec.rb".freeze, "spec/ollama_chat/file_editing_spec.rb".freeze, "spec/ollama_chat/follow_chat_spec.rb".freeze, "spec/ollama_chat/history_spec.rb".freeze, "spec/ollama_chat/http_handling_spec.rb".freeze, "spec/ollama_chat/information_spec.rb".freeze, "spec/ollama_chat/input_content_spec.rb".freeze, "spec/ollama_chat/invidious_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/message_spec.rb".freeze, "spec/ollama_chat/model_handling/model_cache_spec.rb".freeze, "spec/ollama_chat/model_handling_spec.rb".freeze, "spec/ollama_chat/parsing_spec.rb".freeze, "spec/ollama_chat/personae_management_spec.rb".freeze, "spec/ollama_chat/prompt_handling_spec.rb".freeze, "spec/ollama_chat/prompt_management_spec.rb".freeze, "spec/ollama_chat/rag_handling_spec.rb".freeze, "spec/ollama_chat/redis_cache_spec.rb".freeze, "spec/ollama_chat/server_socket_spec.rb".freeze, "spec/ollama_chat/session_management_spec.rb".freeze, "spec/ollama_chat/source_fetching_spec.rb".freeze, "spec/ollama_chat/speaker_spec.rb".freeze, "spec/ollama_chat/state_selectors_spec.rb".freeze, "spec/ollama_chat/switches_spec.rb".freeze, "spec/ollama_chat/system_prompt_management_spec.rb".freeze, "spec/ollama_chat/think_control_spec.rb".freeze, "spec/ollama_chat/token_estimator_spec.rb".freeze, "spec/ollama_chat/tool_call_processor_spec.rb".freeze, "spec/ollama_chat/tool_calling_spec.rb".freeze, "spec/ollama_chat/tools/browse_spec.rb".freeze, "spec/ollama_chat/tools/compute_bmi_spec.rb".freeze, "spec/ollama_chat/tools/concern_spec.rb".freeze, "spec/ollama_chat/tools/copy_to_clipboard_spec.rb".freeze, "spec/ollama_chat/tools/delete_file_spec.rb".freeze, "spec/ollama_chat/tools/execute_grep_spec.rb".freeze, "spec/ollama_chat/tools/execute_jira_twg_spec.rb".freeze, "spec/ollama_chat/tools/execute_ri_spec.rb".freeze, "spec/ollama_chat/tools/execute_shell_spec.rb".freeze, "spec/ollama_chat/tools/forget_spec.rb".freeze, "spec/ollama_chat/tools/generate_image_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_ghr_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/list_directory_spec.rb".freeze, "spec/ollama_chat/tools/lookup_gem_path_spec.rb".freeze, "spec/ollama_chat/tools/lookup_group_spec.rb".freeze, "spec/ollama_chat/tools/memorize_spec.rb".freeze, "spec/ollama_chat/tools/move_file_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/roll_dice_spec.rb".freeze, "spec/ollama_chat/tools/run_tests_spec.rb".freeze, "spec/ollama_chat/tools/search_knowledge_spec.rb".freeze, "spec/ollama_chat/tools/search_web_spec.rb".freeze, "spec/ollama_chat/tools/write_file_spec.rb".freeze, "spec/ollama_chat/tts_spec.rb".freeze, "spec/ollama_chat/utils/analyze_directory_spec.rb".freeze, "spec/ollama_chat/utils/audio_player_spec.rb".freeze, "spec/ollama_chat/utils/cache_fetcher_spec.rb".freeze, "spec/ollama_chat/utils/excon_logger_spec.rb".freeze, "spec/ollama_chat/utils/fetcher_spec.rb".freeze, "spec/ollama_chat/utils/log_rotation_spec.rb".freeze, "spec/ollama_chat/utils/log_viewer_spec.rb".freeze, "spec/ollama_chat/utils/ordered_queue_spec.rb".freeze, "spec/ollama_chat/utils/path_completer_spec.rb".freeze, "spec/ollama_chat/utils/png_metadata_extractor_spec.rb".freeze, "spec/ollama_chat/vim_spec.rb".freeze, "spec/ollama_chat/web_searching_spec.rb".freeze, "spec/spec_helper.rb".freeze, "tmp/.keep".freeze]
|
|
16
|
+
s.files = [".utilsrc".freeze, "CHANGES.md".freeze, "Gemfile".freeze, "LICENSE".freeze, "README.md".freeze, "Rakefile".freeze, "bin/ollama_chat".freeze, "bin/ollama_chat_log".freeze, "bin/ollama_chat_send".freeze, "config/searxng/settings.yml".freeze, "config/sherlock.md".freeze, "docker-compose.yml".freeze, "lib/ollama_chat.rb".freeze, "lib/ollama_chat/asr.rb".freeze, "lib/ollama_chat/chat.rb".freeze, "lib/ollama_chat/clipboard.rb".freeze, "lib/ollama_chat/collection_search.rb".freeze, "lib/ollama_chat/command_concern.rb".freeze, "lib/ollama_chat/commands.rb".freeze, "lib/ollama_chat/compaction.rb".freeze, "lib/ollama_chat/config_handling.rb".freeze, "lib/ollama_chat/context_usage.rb".freeze, "lib/ollama_chat/conversation.rb".freeze, "lib/ollama_chat/database.rb".freeze, "lib/ollama_chat/database/duplicatable.rb".freeze, "lib/ollama_chat/database/migrations.rb".freeze, "lib/ollama_chat/database/migrations/001_initial_schema.rb".freeze, "lib/ollama_chat/database/migrations/002_add_links_to_sessions.rb".freeze, "lib/ollama_chat/database/migrations/003_add_history_to_sessions.rb".freeze, "lib/ollama_chat/database/migrations/004_add_profile_to_model_options.rb".freeze, "lib/ollama_chat/database/migrations/005_add_context_format_to_sessions.rb".freeze, "lib/ollama_chat/database/migrations/006_rename_system_prompt_context_to_system.rb".freeze, "lib/ollama_chat/database/migrations/007_add_collections_table.rb".freeze, "lib/ollama_chat/database/migrations/008_drop_think_mode_constraint.rb".freeze, "lib/ollama_chat/database/migrations/009_add_app_states_table.rb".freeze, "lib/ollama_chat/database/migrations/010_add_enabled_to_collections.rb".freeze, "lib/ollama_chat/database/migrations/011_add_trigger_to_sessions.rb".freeze, "lib/ollama_chat/database/migrations/012_add_context_manifest_enabled_to_sessions.rb".freeze, "lib/ollama_chat/database/models/app_state.rb".freeze, "lib/ollama_chat/database/models/collection.rb".freeze, "lib/ollama_chat/database/models/favourite.rb".freeze, "lib/ollama_chat/database/models/model_options.rb".freeze, "lib/ollama_chat/database/models/prompt.rb".freeze, "lib/ollama_chat/database/models/session.rb".freeze, "lib/ollama_chat/database/row_locking.rb".freeze, "lib/ollama_chat/dialog.rb".freeze, "lib/ollama_chat/document_cache.rb".freeze, "lib/ollama_chat/favourites_management.rb".freeze, "lib/ollama_chat/feedback.rb".freeze, "lib/ollama_chat/file_editing.rb".freeze, "lib/ollama_chat/follow_chat.rb".freeze, "lib/ollama_chat/history.rb".freeze, "lib/ollama_chat/http_handling.rb".freeze, "lib/ollama_chat/information.rb".freeze, "lib/ollama_chat/input_content.rb".freeze, "lib/ollama_chat/invidious.rb".freeze, "lib/ollama_chat/kramdown_ansi.rb".freeze, "lib/ollama_chat/links_set.rb".freeze, "lib/ollama_chat/location_handling.rb".freeze, "lib/ollama_chat/logging.rb".freeze, "lib/ollama_chat/message.rb".freeze, "lib/ollama_chat/message_editing.rb".freeze, "lib/ollama_chat/message_format.rb".freeze, "lib/ollama_chat/message_list.rb".freeze, "lib/ollama_chat/message_output.rb".freeze, "lib/ollama_chat/model_handling.rb".freeze, "lib/ollama_chat/model_handling/model_cache.rb".freeze, "lib/ollama_chat/oc.rb".freeze, "lib/ollama_chat/ollama_chat_config.rb".freeze, "lib/ollama_chat/ollama_chat_config/default_config.yml".freeze, "lib/ollama_chat/ollama_chat_config/fastfetch-profile.jsonc".freeze, "lib/ollama_chat/pager.rb".freeze, "lib/ollama_chat/parsing.rb".freeze, "lib/ollama_chat/personae_management.rb".freeze, "lib/ollama_chat/prompt_handling.rb".freeze, "lib/ollama_chat/prompt_management.rb".freeze, "lib/ollama_chat/rag_handling.rb".freeze, "lib/ollama_chat/redis_cache.rb".freeze, "lib/ollama_chat/say.rb".freeze, "lib/ollama_chat/server_socket.rb".freeze, "lib/ollama_chat/session_management.rb".freeze, "lib/ollama_chat/source_fetching.rb".freeze, "lib/ollama_chat/speaker.rb".freeze, "lib/ollama_chat/state_selectors.rb".freeze, "lib/ollama_chat/switches.rb".freeze, "lib/ollama_chat/system_prompt_management.rb".freeze, "lib/ollama_chat/think_control.rb".freeze, "lib/ollama_chat/token_estimator.rb".freeze, "lib/ollama_chat/token_estimator/crude.rb".freeze, "lib/ollama_chat/tool_call_processor.rb".freeze, "lib/ollama_chat/tool_calling.rb".freeze, "lib/ollama_chat/tools.rb".freeze, "lib/ollama_chat/tools/browse.rb".freeze, "lib/ollama_chat/tools/compute_bmi.rb".freeze, "lib/ollama_chat/tools/concern.rb".freeze, "lib/ollama_chat/tools/copy_to_clipboard.rb".freeze, "lib/ollama_chat/tools/delete_file.rb".freeze, "lib/ollama_chat/tools/eval_ruby.rb".freeze, "lib/ollama_chat/tools/execute_grep.rb".freeze, "lib/ollama_chat/tools/execute_jira_twg.rb".freeze, "lib/ollama_chat/tools/execute_ri.rb".freeze, "lib/ollama_chat/tools/execute_shell.rb".freeze, "lib/ollama_chat/tools/forget.rb".freeze, "lib/ollama_chat/tools/generate_image.rb".freeze, "lib/ollama_chat/tools/generate_password.rb".freeze, "lib/ollama_chat/tools/get_current_weather.rb".freeze, "lib/ollama_chat/tools/get_cve.rb".freeze, "lib/ollama_chat/tools/get_endoflife.rb".freeze, "lib/ollama_chat/tools/get_ghr.rb".freeze, "lib/ollama_chat/tools/get_jira_issue.rb".freeze, "lib/ollama_chat/tools/get_location.rb".freeze, "lib/ollama_chat/tools/get_rfc.rb".freeze, "lib/ollama_chat/tools/get_time.rb".freeze, "lib/ollama_chat/tools/get_url.rb".freeze, "lib/ollama_chat/tools/list_directory.rb".freeze, "lib/ollama_chat/tools/lookup_gem_path.rb".freeze, "lib/ollama_chat/tools/lookup_group.rb".freeze, "lib/ollama_chat/tools/memorize.rb".freeze, "lib/ollama_chat/tools/move_file.rb".freeze, "lib/ollama_chat/tools/open_file_in_editor.rb".freeze, "lib/ollama_chat/tools/paste_from_clipboard.rb".freeze, "lib/ollama_chat/tools/paste_into_editor.rb".freeze, "lib/ollama_chat/tools/patch_file.rb".freeze, "lib/ollama_chat/tools/read_file.rb".freeze, "lib/ollama_chat/tools/resolve_tag.rb".freeze, "lib/ollama_chat/tools/roll_dice.rb".freeze, "lib/ollama_chat/tools/run_tests.rb".freeze, "lib/ollama_chat/tools/search_knowledge.rb".freeze, "lib/ollama_chat/tools/search_web.rb".freeze, "lib/ollama_chat/tools/write_file.rb".freeze, "lib/ollama_chat/tts.rb".freeze, "lib/ollama_chat/utils.rb".freeze, "lib/ollama_chat/utils/analyze_directory.rb".freeze, "lib/ollama_chat/utils/audio_player.rb".freeze, "lib/ollama_chat/utils/backup.rb".freeze, "lib/ollama_chat/utils/cache_fetcher.rb".freeze, "lib/ollama_chat/utils/chooser.rb".freeze, "lib/ollama_chat/utils/excon_logger.rb".freeze, "lib/ollama_chat/utils/fetcher.rb".freeze, "lib/ollama_chat/utils/json_jsonl_io.rb".freeze, "lib/ollama_chat/utils/log_rotation.rb".freeze, "lib/ollama_chat/utils/log_viewer.rb".freeze, "lib/ollama_chat/utils/ordered_queue.rb".freeze, "lib/ollama_chat/utils/path_completer.rb".freeze, "lib/ollama_chat/utils/path_validator.rb".freeze, "lib/ollama_chat/utils/png_metadata_extractor.rb".freeze, "lib/ollama_chat/utils/strip_ansi.rb".freeze, "lib/ollama_chat/utils/tag_resolver.rb".freeze, "lib/ollama_chat/utils/utf8_converter.rb".freeze, "lib/ollama_chat/utils/value_formatter.rb".freeze, "lib/ollama_chat/uuid_v7.rb".freeze, "lib/ollama_chat/version.rb".freeze, "lib/ollama_chat/vim.rb".freeze, "lib/ollama_chat/web_searching.rb".freeze, "ollama_chat.gemspec".freeze, "redis/redis.conf".freeze, "spec/assets/api_ps.json".freeze, "spec/assets/api_show.json".freeze, "spec/assets/api_tags.json".freeze, "spec/assets/api_version.json".freeze, "spec/assets/conversation.json".freeze, "spec/assets/conversation.jsonl".freeze, "spec/assets/deep/deeper/empty.txt".freeze, "spec/assets/deep/deeper/not-empty.txt".freeze, "spec/assets/deep/empty.txt".freeze, "spec/assets/duckduckgo.html".freeze, "spec/assets/example.atom".freeze, "spec/assets/example.csv".freeze, "spec/assets/example.epub".freeze, "spec/assets/example.html".freeze, "spec/assets/example.pdf".freeze, "spec/assets/example.ps".freeze, "spec/assets/example.rb".freeze, "spec/assets/example.rss".freeze, "spec/assets/example.xml".freeze, "spec/assets/example_with_quote.html".freeze, "spec/assets/fluffy.png".freeze, "spec/assets/kitten.jpg".freeze, "spec/assets/linux.oga".freeze, "spec/assets/miyu.png".freeze, "spec/assets/pirateweather.json".freeze, "spec/assets/prompt.txt".freeze, "spec/assets/searxng.json".freeze, "spec/ollama_chat/asr_spec.rb".freeze, "spec/ollama_chat/chat_spec.rb".freeze, "spec/ollama_chat/clipboard_spec.rb".freeze, "spec/ollama_chat/collection_search_spec.rb".freeze, "spec/ollama_chat/command_concern_spec.rb".freeze, "spec/ollama_chat/commands_spec.rb".freeze, "spec/ollama_chat/compaction_spec.rb".freeze, "spec/ollama_chat/config_handling_spec.rb".freeze, "spec/ollama_chat/context_usage_spec.rb".freeze, "spec/ollama_chat/conversation_spec.rb".freeze, "spec/ollama_chat/database/models/favourite_spec.rb".freeze, "spec/ollama_chat/favourites_management_spec.rb".freeze, "spec/ollama_chat/file_editing_spec.rb".freeze, "spec/ollama_chat/follow_chat_spec.rb".freeze, "spec/ollama_chat/history_spec.rb".freeze, "spec/ollama_chat/http_handling_spec.rb".freeze, "spec/ollama_chat/information_spec.rb".freeze, "spec/ollama_chat/input_content_spec.rb".freeze, "spec/ollama_chat/invidious_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/message_spec.rb".freeze, "spec/ollama_chat/model_handling/model_cache_spec.rb".freeze, "spec/ollama_chat/model_handling_spec.rb".freeze, "spec/ollama_chat/parsing_spec.rb".freeze, "spec/ollama_chat/personae_management_spec.rb".freeze, "spec/ollama_chat/prompt_handling_spec.rb".freeze, "spec/ollama_chat/prompt_management_spec.rb".freeze, "spec/ollama_chat/rag_handling_spec.rb".freeze, "spec/ollama_chat/redis_cache_spec.rb".freeze, "spec/ollama_chat/server_socket_spec.rb".freeze, "spec/ollama_chat/session_management_spec.rb".freeze, "spec/ollama_chat/source_fetching_spec.rb".freeze, "spec/ollama_chat/speaker_spec.rb".freeze, "spec/ollama_chat/state_selectors_spec.rb".freeze, "spec/ollama_chat/switches_spec.rb".freeze, "spec/ollama_chat/system_prompt_management_spec.rb".freeze, "spec/ollama_chat/think_control_spec.rb".freeze, "spec/ollama_chat/token_estimator_spec.rb".freeze, "spec/ollama_chat/tool_call_processor_spec.rb".freeze, "spec/ollama_chat/tool_calling_spec.rb".freeze, "spec/ollama_chat/tools/browse_spec.rb".freeze, "spec/ollama_chat/tools/compute_bmi_spec.rb".freeze, "spec/ollama_chat/tools/concern_spec.rb".freeze, "spec/ollama_chat/tools/copy_to_clipboard_spec.rb".freeze, "spec/ollama_chat/tools/delete_file_spec.rb".freeze, "spec/ollama_chat/tools/execute_grep_spec.rb".freeze, "spec/ollama_chat/tools/execute_jira_twg_spec.rb".freeze, "spec/ollama_chat/tools/execute_ri_spec.rb".freeze, "spec/ollama_chat/tools/execute_shell_spec.rb".freeze, "spec/ollama_chat/tools/forget_spec.rb".freeze, "spec/ollama_chat/tools/generate_image_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_ghr_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/list_directory_spec.rb".freeze, "spec/ollama_chat/tools/lookup_gem_path_spec.rb".freeze, "spec/ollama_chat/tools/lookup_group_spec.rb".freeze, "spec/ollama_chat/tools/memorize_spec.rb".freeze, "spec/ollama_chat/tools/move_file_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/roll_dice_spec.rb".freeze, "spec/ollama_chat/tools/run_tests_spec.rb".freeze, "spec/ollama_chat/tools/search_knowledge_spec.rb".freeze, "spec/ollama_chat/tools/search_web_spec.rb".freeze, "spec/ollama_chat/tools/write_file_spec.rb".freeze, "spec/ollama_chat/tts_spec.rb".freeze, "spec/ollama_chat/utils/analyze_directory_spec.rb".freeze, "spec/ollama_chat/utils/audio_player_spec.rb".freeze, "spec/ollama_chat/utils/cache_fetcher_spec.rb".freeze, "spec/ollama_chat/utils/excon_logger_spec.rb".freeze, "spec/ollama_chat/utils/fetcher_spec.rb".freeze, "spec/ollama_chat/utils/log_rotation_spec.rb".freeze, "spec/ollama_chat/utils/log_viewer_spec.rb".freeze, "spec/ollama_chat/utils/ordered_queue_spec.rb".freeze, "spec/ollama_chat/utils/path_completer_spec.rb".freeze, "spec/ollama_chat/utils/png_metadata_extractor_spec.rb".freeze, "spec/ollama_chat/vim_spec.rb".freeze, "spec/ollama_chat/web_searching_spec.rb".freeze, "spec/spec_helper.rb".freeze, "tmp/.keep".freeze]
|
|
17
17
|
s.homepage = "https://github.com/flori/ollama_chat".freeze
|
|
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 = "4.0.
|
|
21
|
+
s.rubygems_version = "4.0.23".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/asr_spec.rb".freeze, "spec/ollama_chat/chat_spec.rb".freeze, "spec/ollama_chat/clipboard_spec.rb".freeze, "spec/ollama_chat/collection_search_spec.rb".freeze, "spec/ollama_chat/command_concern_spec.rb".freeze, "spec/ollama_chat/commands_spec.rb".freeze, "spec/ollama_chat/compaction_spec.rb".freeze, "spec/ollama_chat/config_handling_spec.rb".freeze, "spec/ollama_chat/context_usage_spec.rb".freeze, "spec/ollama_chat/conversation_spec.rb".freeze, "spec/ollama_chat/database/models/favourite_spec.rb".freeze, "spec/ollama_chat/favourites_management_spec.rb".freeze, "spec/ollama_chat/file_editing_spec.rb".freeze, "spec/ollama_chat/follow_chat_spec.rb".freeze, "spec/ollama_chat/history_spec.rb".freeze, "spec/ollama_chat/http_handling_spec.rb".freeze, "spec/ollama_chat/information_spec.rb".freeze, "spec/ollama_chat/input_content_spec.rb".freeze, "spec/ollama_chat/invidious_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/message_spec.rb".freeze, "spec/ollama_chat/model_handling/model_cache_spec.rb".freeze, "spec/ollama_chat/model_handling_spec.rb".freeze, "spec/ollama_chat/parsing_spec.rb".freeze, "spec/ollama_chat/personae_management_spec.rb".freeze, "spec/ollama_chat/prompt_handling_spec.rb".freeze, "spec/ollama_chat/prompt_management_spec.rb".freeze, "spec/ollama_chat/rag_handling_spec.rb".freeze, "spec/ollama_chat/redis_cache_spec.rb".freeze, "spec/ollama_chat/server_socket_spec.rb".freeze, "spec/ollama_chat/session_management_spec.rb".freeze, "spec/ollama_chat/source_fetching_spec.rb".freeze, "spec/ollama_chat/speaker_spec.rb".freeze, "spec/ollama_chat/state_selectors_spec.rb".freeze, "spec/ollama_chat/switches_spec.rb".freeze, "spec/ollama_chat/system_prompt_management_spec.rb".freeze, "spec/ollama_chat/think_control_spec.rb".freeze, "spec/ollama_chat/token_estimator_spec.rb".freeze, "spec/ollama_chat/tool_call_processor_spec.rb".freeze, "spec/ollama_chat/tool_calling_spec.rb".freeze, "spec/ollama_chat/tools/browse_spec.rb".freeze, "spec/ollama_chat/tools/compute_bmi_spec.rb".freeze, "spec/ollama_chat/tools/concern_spec.rb".freeze, "spec/ollama_chat/tools/copy_to_clipboard_spec.rb".freeze, "spec/ollama_chat/tools/delete_file_spec.rb".freeze, "spec/ollama_chat/tools/execute_grep_spec.rb".freeze, "spec/ollama_chat/tools/execute_jira_twg_spec.rb".freeze, "spec/ollama_chat/tools/execute_ri_spec.rb".freeze, "spec/ollama_chat/tools/execute_shell_spec.rb".freeze, "spec/ollama_chat/tools/forget_spec.rb".freeze, "spec/ollama_chat/tools/generate_image_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_ghr_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/list_directory_spec.rb".freeze, "spec/ollama_chat/tools/lookup_gem_path_spec.rb".freeze, "spec/ollama_chat/tools/lookup_group_spec.rb".freeze, "spec/ollama_chat/tools/memorize_spec.rb".freeze, "spec/ollama_chat/tools/move_file_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/roll_dice_spec.rb".freeze, "spec/ollama_chat/tools/run_tests_spec.rb".freeze, "spec/ollama_chat/tools/search_knowledge_spec.rb".freeze, "spec/ollama_chat/tools/search_web_spec.rb".freeze, "spec/ollama_chat/tools/write_file_spec.rb".freeze, "spec/ollama_chat/tts_spec.rb".freeze, "spec/ollama_chat/utils/analyze_directory_spec.rb".freeze, "spec/ollama_chat/utils/audio_player_spec.rb".freeze, "spec/ollama_chat/utils/cache_fetcher_spec.rb".freeze, "spec/ollama_chat/utils/excon_logger_spec.rb".freeze, "spec/ollama_chat/utils/fetcher_spec.rb".freeze, "spec/ollama_chat/utils/log_rotation_spec.rb".freeze, "spec/ollama_chat/utils/log_viewer_spec.rb".freeze, "spec/ollama_chat/utils/ordered_queue_spec.rb".freeze, "spec/ollama_chat/utils/path_completer_spec.rb".freeze, "spec/ollama_chat/utils/png_metadata_extractor_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
|
|
|
25
25
|
s.specification_version = 4
|
|
26
26
|
|
|
27
|
-
s.add_development_dependency(%q<gem_hadar>.freeze, [">= 2.
|
|
27
|
+
s.add_development_dependency(%q<gem_hadar>.freeze, [">= 2.21.0".freeze])
|
|
28
28
|
s.add_development_dependency(%q<all_images>.freeze, ["~> 0.12".freeze])
|
|
29
29
|
s.add_development_dependency(%q<rspec>.freeze, ["~> 3.2".freeze])
|
|
30
30
|
s.add_development_dependency(%q<kramdown>.freeze, ["~> 2.0".freeze])
|
|
@@ -33,7 +33,7 @@ Gem::Specification.new do |s|
|
|
|
33
33
|
s.add_development_dependency(%q<simplecov>.freeze, [">= 0".freeze])
|
|
34
34
|
s.add_development_dependency(%q<utils>.freeze, [">= 0".freeze])
|
|
35
35
|
s.add_runtime_dependency(%q<excon>.freeze, ["~> 1.0".freeze])
|
|
36
|
-
s.add_runtime_dependency(%q<ollama-ruby>.freeze, ["~> 1.
|
|
36
|
+
s.add_runtime_dependency(%q<ollama-ruby>.freeze, ["~> 1.26".freeze])
|
|
37
37
|
s.add_runtime_dependency(%q<documentrix>.freeze, [">= 0.8.0".freeze])
|
|
38
38
|
s.add_runtime_dependency(%q<unix_socks>.freeze, [">= 0.4".freeze])
|
|
39
39
|
s.add_runtime_dependency(%q<rss>.freeze, ["~> 0.3".freeze])
|
|
@@ -41,7 +41,7 @@ Gem::Specification.new do |s|
|
|
|
41
41
|
s.add_runtime_dependency(%q<redis>.freeze, ["~> 5.0".freeze])
|
|
42
42
|
s.add_runtime_dependency(%q<mime-types>.freeze, ["~> 3.0".freeze])
|
|
43
43
|
s.add_runtime_dependency(%q<reverse_markdown>.freeze, ["~> 3.0".freeze])
|
|
44
|
-
s.add_runtime_dependency(%q<kramdown-ansi>.freeze, ["~> 0.
|
|
44
|
+
s.add_runtime_dependency(%q<kramdown-ansi>.freeze, ["~> 0.7".freeze])
|
|
45
45
|
s.add_runtime_dependency(%q<complex_config>.freeze, ["~> 0.22".freeze, ">= 0.22.2".freeze])
|
|
46
46
|
s.add_runtime_dependency(%q<tins>.freeze, ["~> 1.61".freeze])
|
|
47
47
|
s.add_runtime_dependency(%q<search_ui>.freeze, [">= 0.2".freeze])
|
|
@@ -153,9 +153,9 @@ describe OllamaChat::Commands, protect_env: true do
|
|
|
153
153
|
expect(chat.handle_input("/last 2")).to eq :next
|
|
154
154
|
end
|
|
155
155
|
|
|
156
|
-
it 'returns :next when input is "/last -
|
|
156
|
+
it 'returns :next when input is "/last -d 2"' do
|
|
157
157
|
expect(chat.messages).to receive(:show_last).with(2, think_loud: true, pager: false)
|
|
158
|
-
expect(chat.handle_input("/last -
|
|
158
|
+
expect(chat.handle_input("/last -d 2")).to eq :next
|
|
159
159
|
end
|
|
160
160
|
|
|
161
161
|
it 'speaks last message with -v' do
|
|
@@ -51,7 +51,7 @@ describe OllamaChat::KramdownANSI do
|
|
|
51
51
|
end
|
|
52
52
|
|
|
53
53
|
it 'removes table separator rows' do
|
|
54
|
-
input
|
|
54
|
+
input = "| Name | Age |\n|------|-----|\n|Foo | 42|\n"
|
|
55
55
|
result = chat.kramdown_markdown_remove(input)
|
|
56
56
|
expect(result).not_to include('-')
|
|
57
57
|
end
|
|
@@ -647,6 +647,16 @@ describe OllamaChat::RAGHandling do
|
|
|
647
647
|
chat.delete_collection
|
|
648
648
|
end
|
|
649
649
|
|
|
650
|
+
it 'refuses to delete the default collection' do
|
|
651
|
+
expect(chat).to receive(:choose_entry).
|
|
652
|
+
and_return('default', '[CANCEL]')
|
|
653
|
+
expect(chat).to receive(:feedback).
|
|
654
|
+
with(a_string_including('it is the default collection'), type: :warn)
|
|
655
|
+
expect(chat).not_to receive(:confirm?)
|
|
656
|
+
|
|
657
|
+
expect { chat.delete_collection }.not_to change { col_model.count }
|
|
658
|
+
end
|
|
659
|
+
|
|
650
660
|
it 'deletes the collection when confirmed' do
|
|
651
661
|
col_model.create(name: 'del', description: 'd', patterns: [])
|
|
652
662
|
expect(chat).to receive(:choose_entry).and_return('del', '[CANCEL]')
|
|
@@ -672,6 +682,54 @@ describe OllamaChat::RAGHandling do
|
|
|
672
682
|
expect { chat.delete_collection }
|
|
673
683
|
.not_to change { col_model.count }
|
|
674
684
|
end
|
|
685
|
+
|
|
686
|
+
context 'when the deleted collection is the active one' do
|
|
687
|
+
let :session do
|
|
688
|
+
double('Session')
|
|
689
|
+
end
|
|
690
|
+
|
|
691
|
+
before do
|
|
692
|
+
chat.instance_variable_set(:@session, session)
|
|
693
|
+
end
|
|
694
|
+
|
|
695
|
+
it 'resets current_collection to default' do
|
|
696
|
+
col_model.create(name: 'active', description: 'd', patterns: [])
|
|
697
|
+
expect(chat).to receive(:choose_entry).
|
|
698
|
+
and_return('active', '[CANCEL]')
|
|
699
|
+
expect(chat).to receive(:confirm?).and_return(true)
|
|
700
|
+
|
|
701
|
+
# after_destroy → switch_collection + documents.clear
|
|
702
|
+
expect(docs).to receive(:collection).and_return('default')
|
|
703
|
+
expect(docs).to receive(:collection=).with('active')
|
|
704
|
+
expect(docs).to receive(:clear)
|
|
705
|
+
expect(docs).to receive(:collection=).with('default')
|
|
706
|
+
|
|
707
|
+
# ensure → deleted collection was current, so reset to default
|
|
708
|
+
expect(session).to receive(:current_collection).and_return('active')
|
|
709
|
+
expect(session).to receive(:update).with(current_collection: 'default')
|
|
710
|
+
|
|
711
|
+
expect { chat.delete_collection }
|
|
712
|
+
.to change { col_model.count }.by(-1)
|
|
713
|
+
end
|
|
714
|
+
|
|
715
|
+
it 'leaves current_collection alone for a non-active collection' do
|
|
716
|
+
col_model.create(name: 'side', description: 'd', patterns: [])
|
|
717
|
+
expect(chat).to receive(:choose_entry).
|
|
718
|
+
and_return('side', '[CANCEL]')
|
|
719
|
+
expect(chat).to receive(:confirm?).and_return(true)
|
|
720
|
+
|
|
721
|
+
expect(docs).to receive(:collection).and_return('default')
|
|
722
|
+
expect(docs).to receive(:collection=).with('side')
|
|
723
|
+
expect(docs).to receive(:clear)
|
|
724
|
+
expect(docs).to receive(:collection=).with('default')
|
|
725
|
+
|
|
726
|
+
expect(session).to receive(:current_collection).and_return('default')
|
|
727
|
+
expect(session).not_to receive(:update)
|
|
728
|
+
|
|
729
|
+
expect { chat.delete_collection }
|
|
730
|
+
.to change { col_model.count }.by(-1)
|
|
731
|
+
end
|
|
732
|
+
end
|
|
675
733
|
end
|
|
676
734
|
|
|
677
735
|
describe '#create_memory_collection' do
|
|
@@ -10,6 +10,7 @@ describe OllamaChat::Tools::ExecuteShell do
|
|
|
10
10
|
end
|
|
11
11
|
|
|
12
12
|
before do
|
|
13
|
+
described_class.always_allowed.clear
|
|
13
14
|
allow(OllamaChat).to receive(:test_mode?).and_return(false)
|
|
14
15
|
allow(chat).to receive(:log)
|
|
15
16
|
allow(OC).to receive(:EDITOR?).and_return('vim')
|
|
@@ -206,6 +207,73 @@ describe OllamaChat::Tools::ExecuteShell do
|
|
|
206
207
|
expect(json.error).to eq 'OllamaChat::ToolFunctionArgumentError'
|
|
207
208
|
end
|
|
208
209
|
|
|
210
|
+
it 'answers a to remember allow and proceed to execution' do
|
|
211
|
+
expect(chat).to receive(:edit_text).and_return('bundle install')
|
|
212
|
+
expect(chat).to receive(:confirm?).and_return('a')
|
|
213
|
+
expect(chat).to receive(:use_pager) { |&blk| blk.call(StringIO.new) }
|
|
214
|
+
expect(Open3).to receive(:capture3)
|
|
215
|
+
.with('sh', '-c', 'bundle install')
|
|
216
|
+
.and_return(['ok', '', double('s', exitstatus: 0)])
|
|
217
|
+
|
|
218
|
+
result = tool.execute(tool_call('bundle install'), chat:)
|
|
219
|
+
expect(json_object(result).exit_code).to eq 0
|
|
220
|
+
end
|
|
221
|
+
|
|
222
|
+
it 'answers d to remember direct and print without pager' do
|
|
223
|
+
expect(chat).to receive(:edit_text).and_return('id')
|
|
224
|
+
expect(chat).to receive(:confirm?).and_return('d')
|
|
225
|
+
allow(chat).to receive(:use_pager) { |&blk| blk.call(StringIO.new) }
|
|
226
|
+
allow(Open3).to receive(:capture3)
|
|
227
|
+
.and_return(['uid=1000', '', double('s', exitstatus: 0)])
|
|
228
|
+
|
|
229
|
+
tool.execute(tool_call('id'), chat:)
|
|
230
|
+
|
|
231
|
+
# second call: no editor, no confirm, no pager
|
|
232
|
+
expect(chat).not_to receive(:edit_text)
|
|
233
|
+
expect(chat).not_to receive(:confirm?)
|
|
234
|
+
expect(chat).not_to receive(:use_pager)
|
|
235
|
+
allow(STDOUT).to receive(:puts)
|
|
236
|
+
allow(Open3).to receive(:capture3)
|
|
237
|
+
.and_return(['uid=1000', '', double('s', exitstatus: 0)])
|
|
238
|
+
|
|
239
|
+
tool.execute(tool_call('id'), chat:)
|
|
240
|
+
end
|
|
241
|
+
|
|
242
|
+
it 'skips editor and confirm on second call after a but still pages' do
|
|
243
|
+
expect(chat).to receive(:edit_text).and_return('bundle install')
|
|
244
|
+
expect(chat).to receive(:confirm?).and_return('a')
|
|
245
|
+
allow(chat).to receive(:use_pager) { |&blk| blk.call(StringIO.new) }
|
|
246
|
+
allow(Open3).to receive(:capture3)
|
|
247
|
+
.and_return(['ok', '', double('s', exitstatus: 0)])
|
|
248
|
+
|
|
249
|
+
tool.execute(tool_call('bundle install'), chat:)
|
|
250
|
+
|
|
251
|
+
expect(chat).not_to receive(:edit_text)
|
|
252
|
+
expect(chat).not_to receive(:confirm?)
|
|
253
|
+
expect(chat).to receive(:use_pager) { |&blk| blk.call(StringIO.new) }
|
|
254
|
+
allow(Open3).to receive(:capture3)
|
|
255
|
+
.and_return(['ok', '', double('s', exitstatus: 0)])
|
|
256
|
+
|
|
257
|
+
tool.execute(tool_call('bundle install'), chat:)
|
|
258
|
+
end
|
|
259
|
+
|
|
260
|
+
it 'does not skip confirm for a different command after a' do
|
|
261
|
+
expect(chat).to receive(:edit_text).and_return('ls')
|
|
262
|
+
expect(chat).to receive(:confirm?).and_return('a')
|
|
263
|
+
allow(chat).to receive(:use_pager) { |&blk| blk.call(StringIO.new) }
|
|
264
|
+
allow(Open3).to receive(:capture3)
|
|
265
|
+
.and_return(['ok', '', double('s', exitstatus: 0)])
|
|
266
|
+
|
|
267
|
+
tool.execute(tool_call('ls'), chat:)
|
|
268
|
+
|
|
269
|
+
expect(chat).to receive(:edit_text).and_return('rm -rf /')
|
|
270
|
+
expect(chat).to receive(:confirm?).and_return('n')
|
|
271
|
+
expect(Open3).not_to receive(:capture3)
|
|
272
|
+
|
|
273
|
+
result = tool.execute(tool_call('rm -rf /'), chat:)
|
|
274
|
+
expect(json_object(result).error).not_to be_nil
|
|
275
|
+
end
|
|
276
|
+
|
|
209
277
|
it 'summary_template includes the command and exit code' do
|
|
210
278
|
result = {
|
|
211
279
|
stdout: 'x', stderr: '', exit_code: 0,
|
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.137
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Florian Frank
|
|
@@ -15,14 +15,14 @@ dependencies:
|
|
|
15
15
|
requirements:
|
|
16
16
|
- - ">="
|
|
17
17
|
- !ruby/object:Gem::Version
|
|
18
|
-
version: 2.
|
|
18
|
+
version: 2.21.0
|
|
19
19
|
type: :development
|
|
20
20
|
prerelease: false
|
|
21
21
|
version_requirements: !ruby/object:Gem::Requirement
|
|
22
22
|
requirements:
|
|
23
23
|
- - ">="
|
|
24
24
|
- !ruby/object:Gem::Version
|
|
25
|
-
version: 2.
|
|
25
|
+
version: 2.21.0
|
|
26
26
|
- !ruby/object:Gem::Dependency
|
|
27
27
|
name: all_images
|
|
28
28
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -141,14 +141,14 @@ dependencies:
|
|
|
141
141
|
requirements:
|
|
142
142
|
- - "~>"
|
|
143
143
|
- !ruby/object:Gem::Version
|
|
144
|
-
version: '1.
|
|
144
|
+
version: '1.26'
|
|
145
145
|
type: :runtime
|
|
146
146
|
prerelease: false
|
|
147
147
|
version_requirements: !ruby/object:Gem::Requirement
|
|
148
148
|
requirements:
|
|
149
149
|
- - "~>"
|
|
150
150
|
- !ruby/object:Gem::Version
|
|
151
|
-
version: '1.
|
|
151
|
+
version: '1.26'
|
|
152
152
|
- !ruby/object:Gem::Dependency
|
|
153
153
|
name: documentrix
|
|
154
154
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -253,14 +253,14 @@ dependencies:
|
|
|
253
253
|
requirements:
|
|
254
254
|
- - "~>"
|
|
255
255
|
- !ruby/object:Gem::Version
|
|
256
|
-
version: '0.
|
|
256
|
+
version: '0.7'
|
|
257
257
|
type: :runtime
|
|
258
258
|
prerelease: false
|
|
259
259
|
version_requirements: !ruby/object:Gem::Requirement
|
|
260
260
|
requirements:
|
|
261
261
|
- - "~>"
|
|
262
262
|
- !ruby/object:Gem::Version
|
|
263
|
-
version: '0.
|
|
263
|
+
version: '0.7'
|
|
264
264
|
- !ruby/object:Gem::Dependency
|
|
265
265
|
name: complex_config
|
|
266
266
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -690,6 +690,7 @@ files:
|
|
|
690
690
|
- lib/ollama_chat/oc.rb
|
|
691
691
|
- lib/ollama_chat/ollama_chat_config.rb
|
|
692
692
|
- lib/ollama_chat/ollama_chat_config/default_config.yml
|
|
693
|
+
- lib/ollama_chat/ollama_chat_config/fastfetch-profile.jsonc
|
|
693
694
|
- lib/ollama_chat/pager.rb
|
|
694
695
|
- lib/ollama_chat/parsing.rb
|
|
695
696
|
- lib/ollama_chat/personae_management.rb
|
|
@@ -919,7 +920,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
919
920
|
- !ruby/object:Gem::Version
|
|
920
921
|
version: '0'
|
|
921
922
|
requirements: []
|
|
922
|
-
rubygems_version: 4.0.
|
|
923
|
+
rubygems_version: 4.0.23
|
|
923
924
|
specification_version: 4
|
|
924
925
|
summary: A command-line interface (CLI) for interacting with an Ollama AI model.
|
|
925
926
|
test_files:
|