agent-tome 1.0.1 → 1.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +63 -1
- data/CONTRIBUTING.md +1 -1
- data/README.md +5 -5
- data/lib/agent/tome/cli.rb +6 -6
- data/lib/agent/tome/commands/keywords_list.rb +1 -1
- data/lib/agent/tome/commands/search.rb +4 -1
- data/lib/agent/tome/commands/source_search.rb +7 -0
- data/lib/agent/tome/version.rb +1 -1
- metadata +11 -8
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: ccf477af203c9998d05957300bdd978b731d8a54aa751da526969edb1e51f18b
|
|
4
|
+
data.tar.gz: e0fbedd558eb7f7ed9b1367c2bf4b108dbc5a3e19ad73082c13eea7b41da432e
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: d279b0d7050ef32d59899f5ec2bc0b59995c6ee16417feb3aee37b9f85a3c2f68530595bb219871a2f344807c72e4d4d1a3d015ba1394aea2a822510282598c1
|
|
7
|
+
data.tar.gz: 11400db6920a0fdfb544b825e6dc5a322c060b084e171499c78a39cc1cd061cc48c8bae16f32e41280caf6a45f2defabe0691f80febbe7f3f37cf24450b4d3dd
|
data/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,65 @@
|
|
|
1
1
|
## [Unreleased]
|
|
2
2
|
|
|
3
|
+
## [1.1.0] - 2026-11-22
|
|
4
|
+
|
|
5
|
+
### Changed
|
|
6
|
+
|
|
7
|
+
- Requires Ruby 3.3 or newer. Ruby 3.2 no longer gets security fixes, so
|
|
8
|
+
`gem install` on it stays on 1.0.2.
|
|
9
|
+
- Arguments that used to be guessed at are now errors (see Fixed). A script
|
|
10
|
+
that passed `--match` with a misspelt value, or `source-search` with an
|
|
11
|
+
empty `--system`, will now get a non-zero exit instead of results.
|
|
12
|
+
|
|
13
|
+
### Fixed
|
|
14
|
+
|
|
15
|
+
- The gemspec allowed sqlite3 2.0, which Active Record 8 refuses to load.
|
|
16
|
+
With sqlite3 2.0 already installed, `gem install agent-tome` succeeded
|
|
17
|
+
and every command then failed. It now requires sqlite3 2.1 or newer.
|
|
18
|
+
- `search --match all` dropped keywords the tome had never seen before
|
|
19
|
+
counting, so `search ruby nosuchword --match all` returned every article
|
|
20
|
+
tagged `ruby`. It now returns nothing unless an article has every keyword.
|
|
21
|
+
- `search --match` with a value other than `any` or `all` searched with
|
|
22
|
+
`any`, so a typo for `all` gave the broadest results instead of an error.
|
|
23
|
+
A `--match` with nothing after it was treated as a keyword. Both are now
|
|
24
|
+
rejected.
|
|
25
|
+
- `keywords _` and `keywords %` listed every keyword. Both characters now
|
|
26
|
+
match literally.
|
|
27
|
+
- `source-search` with no argument answered with an internal Ruby error
|
|
28
|
+
message. It now says a URL or file path is required. An empty
|
|
29
|
+
`--system` value is rejected instead of searching for a machine with no
|
|
30
|
+
name.
|
|
31
|
+
|
|
32
|
+
### Documentation
|
|
33
|
+
|
|
34
|
+
- The README and `--help` said `keywords` matches a prefix. It matches
|
|
35
|
+
anywhere in the keyword, so `keywords ru` also finds `guru`.
|
|
36
|
+
- The README now mentions `--system` and the `AGENT_TOME_CONFIG_DIR`
|
|
37
|
+
variable.
|
|
38
|
+
|
|
39
|
+
### Internal
|
|
40
|
+
|
|
41
|
+
- Tested on Ruby 4.0 with the newest activerecord, activesupport (8.1.4.1)
|
|
42
|
+
and sqlite3 (2.10.2), and on Ruby 3.3 with the oldest versions the
|
|
43
|
+
gemspec allows (8.0.0 and 2.1.0).
|
|
44
|
+
- Development requires activesupport 8.1.2 or newer, because older
|
|
45
|
+
releases make the parallel test run hang under minitest 6.
|
|
46
|
+
|
|
47
|
+
## [1.0.2] - 2026-09-20
|
|
48
|
+
|
|
49
|
+
### Documentation
|
|
50
|
+
|
|
51
|
+
- The Quick Start showed `create` returning a `global_id`. It returns
|
|
52
|
+
`article_global_id` and `entry_global_id`, so an agent written against the
|
|
53
|
+
README was reading a key that is never there.
|
|
54
|
+
|
|
55
|
+
### Internal
|
|
56
|
+
|
|
57
|
+
- The CLI test lane (`TOME_DRIVER=cli`) had rotted and nothing ran it. It runs
|
|
58
|
+
again, and `rake` now runs both it and the in-process lane, so the executable
|
|
59
|
+
is covered rather than only the service objects underneath it.
|
|
60
|
+
- Development dependencies move to minitest 6, which extracts `minitest/mock`
|
|
61
|
+
into its own gem, plus current activerecord, activesupport and sqlite3.
|
|
62
|
+
|
|
3
63
|
## [1.0.1] - 2026-04-05
|
|
4
64
|
|
|
5
65
|
### Changed
|
|
@@ -29,6 +89,8 @@
|
|
|
29
89
|
- **CLI**: `agent-tome` executable with JSON stdin/stdout interface, exit code 0 on success and non-zero on error.
|
|
30
90
|
- **Claude Code skills**: Companion `tome-lookup` and `tome-capture` skills for AI agent integration.
|
|
31
91
|
|
|
32
|
-
[Unreleased]: https://github.com/beatmadsen/agent-tome/compare/v1.0
|
|
92
|
+
[Unreleased]: https://github.com/beatmadsen/agent-tome/compare/v1.1.0...HEAD
|
|
93
|
+
[1.1.0]: https://github.com/beatmadsen/agent-tome/compare/v1.0.2...v1.1.0
|
|
94
|
+
[1.0.2]: https://github.com/beatmadsen/agent-tome/compare/v1.0.1...v1.0.2
|
|
33
95
|
[1.0.1]: https://github.com/beatmadsen/agent-tome/compare/v1.0.0...v1.0.1
|
|
34
96
|
[1.0.0]: https://github.com/beatmadsen/agent-tome/releases/tag/v1.0.0
|
data/CONTRIBUTING.md
CHANGED
data/README.md
CHANGED
|
@@ -10,14 +10,14 @@ AI agents are brilliant researchers, and terrible at remembering what they found
|
|
|
10
10
|
gem install agent-tome
|
|
11
11
|
```
|
|
12
12
|
|
|
13
|
-
On first run, a config directory is created at `~/.agent-tome/` with a SQLite database at `~/.agent-tome/tome.db`. To use a different database location, edit `~/.agent-tome/config.yml` and change `db_path`.
|
|
13
|
+
On first run, a config directory is created at `~/.agent-tome/` with a SQLite database at `~/.agent-tome/tome.db`. To use a different database location, edit `~/.agent-tome/config.yml` and change `db_path`. To keep the config somewhere else entirely, for example a separate tome per project, set `AGENT_TOME_CONFIG_DIR` to another directory.
|
|
14
14
|
|
|
15
15
|
## Quick Start
|
|
16
16
|
|
|
17
17
|
```bash
|
|
18
18
|
# Your agent just researched Ruby GC internals. Capture what it learned:
|
|
19
19
|
echo '{"description": "Ruby GC internals", "body": "Ruby uses a generational mark-and-sweep garbage collector.", "keywords": ["ruby", "garbage-collection"]}' | agent-tome create
|
|
20
|
-
# => {"
|
|
20
|
+
# => {"article_global_id": "3xK9mWp", "entry_global_id": "VwY75ct", ...}
|
|
21
21
|
|
|
22
22
|
# Two weeks later, a different session hits the same topic.
|
|
23
23
|
# Instead of re-reading the docs, your agent checks the tome:
|
|
@@ -51,12 +51,12 @@ The original entries are preserved. The article ID still works. Keywords and sou
|
|
|
51
51
|
|---------|-------------|
|
|
52
52
|
| `agent-tome create` | Create a new article with its first entry (JSON via stdin) |
|
|
53
53
|
| `agent-tome addend <id>` | Add an addendum to an existing article (JSON via stdin) |
|
|
54
|
-
| `agent-tome search <keywords...>` | Search articles by keywords (`--match any
|
|
54
|
+
| `agent-tome search <keywords...>` | Search articles by keywords (`--match any`, the default, or `--match all`) |
|
|
55
55
|
| `agent-tome fetch <id>` | Retrieve full article content with all entries and sources |
|
|
56
56
|
| `agent-tome related <id>` | Find articles related through shared keywords or references |
|
|
57
57
|
| `agent-tome consolidate <id>` | Merge all addenda into a single consolidated article (JSON via stdin) |
|
|
58
|
-
| `agent-tome keywords <
|
|
59
|
-
| `agent-tome source-search <url-or-path>` | Find articles referencing a given source |
|
|
58
|
+
| `agent-tome keywords <text>` | List keywords containing the text, for vocabulary discovery |
|
|
59
|
+
| `agent-tome source-search <url-or-path>` | Find articles referencing a given source (`--system <name>` limits file paths to one machine) |
|
|
60
60
|
|
|
61
61
|
## Agent Integration
|
|
62
62
|
|
data/lib/agent/tome/cli.rb
CHANGED
|
@@ -124,7 +124,7 @@ module Agent
|
|
|
124
124
|
|
|
125
125
|
i = 0
|
|
126
126
|
while i < @argv.length
|
|
127
|
-
if @argv[i] == "--match"
|
|
127
|
+
if @argv[i] == "--match"
|
|
128
128
|
match = @argv[i + 1]
|
|
129
129
|
i += 2
|
|
130
130
|
else
|
|
@@ -140,9 +140,9 @@ module Agent
|
|
|
140
140
|
source = @argv.shift
|
|
141
141
|
system = nil
|
|
142
142
|
|
|
143
|
-
if @argv[0] == "--system"
|
|
143
|
+
if @argv[0] == "--system"
|
|
144
144
|
@argv.shift
|
|
145
|
-
system = @argv.shift
|
|
145
|
+
system = @argv.shift.to_s
|
|
146
146
|
end
|
|
147
147
|
|
|
148
148
|
[source, system]
|
|
@@ -155,12 +155,12 @@ module Agent
|
|
|
155
155
|
Commands:
|
|
156
156
|
create Create a new article (JSON via stdin)
|
|
157
157
|
addend <id> Add an addendum to an article (JSON via stdin)
|
|
158
|
-
search <keywords...> Search articles by keywords
|
|
158
|
+
search <keywords...> Search articles by keywords [--match any|all]
|
|
159
159
|
fetch <id> Retrieve full article content
|
|
160
160
|
related <id> Find related articles
|
|
161
161
|
consolidate <id> Merge addenda into one article (JSON via stdin)
|
|
162
|
-
keywords <
|
|
163
|
-
source-search <url|path> Find articles by source reference
|
|
162
|
+
keywords <text> List keywords containing the text
|
|
163
|
+
source-search <url|path> Find articles by source reference [--system <name>]
|
|
164
164
|
|
|
165
165
|
Options:
|
|
166
166
|
--help, -h Show this help
|
|
@@ -10,7 +10,7 @@ module Agent
|
|
|
10
10
|
raise ValidationError, "A prefix/substring argument is required" if @prefix.nil? || @prefix.strip.empty?
|
|
11
11
|
|
|
12
12
|
terms = Keyword
|
|
13
|
-
.where("LOWER(term) LIKE ?", "%#{@prefix.downcase}%")
|
|
13
|
+
.where("LOWER(term) LIKE ? ESCAPE '\\'", "%#{Keyword.sanitize_sql_like(@prefix.downcase)}%")
|
|
14
14
|
.order(:term)
|
|
15
15
|
.pluck(:term)
|
|
16
16
|
|
|
@@ -7,8 +7,11 @@ module Agent
|
|
|
7
7
|
@match = match
|
|
8
8
|
end
|
|
9
9
|
|
|
10
|
+
MATCH_MODES = %w[any all].freeze
|
|
11
|
+
|
|
10
12
|
def call
|
|
11
13
|
raise ValidationError, "At least one keyword is required" if @keywords.empty?
|
|
14
|
+
raise ValidationError, "--match must be 'any' or 'all'" unless MATCH_MODES.include?(@match)
|
|
12
15
|
|
|
13
16
|
normalized = @keywords.map { |kw| KeywordNormalizer.call(kw) }
|
|
14
17
|
keyword_ids = Keyword.where(term: normalized).pluck(:id)
|
|
@@ -33,7 +36,7 @@ module Agent
|
|
|
33
36
|
.order("matching_keyword_count DESC")
|
|
34
37
|
|
|
35
38
|
if @match == "all"
|
|
36
|
-
base = base.having("COUNT(DISTINCT article_keywords.keyword_id) = ?",
|
|
39
|
+
base = base.having("COUNT(DISTINCT article_keywords.keyword_id) = ?", normalized_terms.uniq.length)
|
|
37
40
|
end
|
|
38
41
|
|
|
39
42
|
base.limit(1000)
|
|
@@ -8,6 +8,9 @@ module Agent
|
|
|
8
8
|
end
|
|
9
9
|
|
|
10
10
|
def call
|
|
11
|
+
raise ValidationError, "A URL or file path argument is required" if blank?(@source)
|
|
12
|
+
raise ValidationError, "--system needs a system name" if !@system.nil? && blank?(@system)
|
|
13
|
+
|
|
11
14
|
articles = if url?(@source)
|
|
12
15
|
search_by_url
|
|
13
16
|
else
|
|
@@ -21,6 +24,10 @@ module Agent
|
|
|
21
24
|
|
|
22
25
|
private
|
|
23
26
|
|
|
27
|
+
def blank?(str)
|
|
28
|
+
str.nil? || str.strip.empty?
|
|
29
|
+
end
|
|
30
|
+
|
|
24
31
|
def url?(str)
|
|
25
32
|
str.start_with?("http://", "https://")
|
|
26
33
|
end
|
data/lib/agent/tome/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: agent-tome
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.0
|
|
4
|
+
version: 1.1.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Erik T. Madsen
|
|
@@ -43,18 +43,18 @@ dependencies:
|
|
|
43
43
|
requirements:
|
|
44
44
|
- - "~>"
|
|
45
45
|
- !ruby/object:Gem::Version
|
|
46
|
-
version: '2.
|
|
46
|
+
version: '2.1'
|
|
47
47
|
type: :runtime
|
|
48
48
|
prerelease: false
|
|
49
49
|
version_requirements: !ruby/object:Gem::Requirement
|
|
50
50
|
requirements:
|
|
51
51
|
- - "~>"
|
|
52
52
|
- !ruby/object:Gem::Version
|
|
53
|
-
version: '2.
|
|
53
|
+
version: '2.1'
|
|
54
54
|
description: A knowledge base that grows with every session your AI agent runs. Findings
|
|
55
55
|
accumulate in a persistent, append-only store, so your agent can build on what it
|
|
56
|
-
already knows instead of starting from scratch. Keyword-indexed and
|
|
57
|
-
any
|
|
56
|
+
already knows instead of starting from scratch. Keyword-indexed, JSON in and JSON
|
|
57
|
+
out, and callable by any agent that can run a shell command.
|
|
58
58
|
email: []
|
|
59
59
|
executables:
|
|
60
60
|
- agent-tome
|
|
@@ -105,8 +105,11 @@ homepage: https://github.com/beatmadsen/agent-tome
|
|
|
105
105
|
licenses:
|
|
106
106
|
- MIT
|
|
107
107
|
metadata:
|
|
108
|
-
homepage_uri: https://github.com/beatmadsen/agent-tome
|
|
109
108
|
changelog_uri: https://github.com/beatmadsen/agent-tome/blob/main/CHANGELOG.md
|
|
109
|
+
source_code_uri: https://github.com/beatmadsen/agent-tome
|
|
110
|
+
bug_tracker_uri: https://github.com/beatmadsen/agent-tome/issues
|
|
111
|
+
documentation_uri: https://github.com/beatmadsen/agent-tome#readme
|
|
112
|
+
rubygems_mfa_required: 'true'
|
|
110
113
|
rdoc_options: []
|
|
111
114
|
require_paths:
|
|
112
115
|
- lib
|
|
@@ -114,14 +117,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
|
114
117
|
requirements:
|
|
115
118
|
- - ">="
|
|
116
119
|
- !ruby/object:Gem::Version
|
|
117
|
-
version: '3.
|
|
120
|
+
version: '3.3'
|
|
118
121
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
119
122
|
requirements:
|
|
120
123
|
- - ">="
|
|
121
124
|
- !ruby/object:Gem::Version
|
|
122
125
|
version: '0'
|
|
123
126
|
requirements: []
|
|
124
|
-
rubygems_version: 4.0.
|
|
127
|
+
rubygems_version: 4.0.23
|
|
125
128
|
specification_version: 4
|
|
126
129
|
summary: Build a personal encyclopedia of accumulated knowledge, designed for AI agents.
|
|
127
130
|
test_files: []
|