agent-tome 1.0.2 → 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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: f1fbc39a213cb029fa3095a2716194d056372b7b46cb9aeb108658cbbeb371f7
4
- data.tar.gz: b428bfa0a59dc8458c4e8d40753cdc5f97fc4cbf9545f68b5a816539570bc90c
3
+ metadata.gz: ccf477af203c9998d05957300bdd978b731d8a54aa751da526969edb1e51f18b
4
+ data.tar.gz: e0fbedd558eb7f7ed9b1367c2bf4b108dbc5a3e19ad73082c13eea7b41da432e
5
5
  SHA512:
6
- metadata.gz: f81e6f87f3f00dbab2259211ce10ed0bd0bca7cf84891f08e314df5c4ed4c8e5cfde181b3e6a430625157911d394e5222450460080f45587f213bfc5d6d4da26
7
- data.tar.gz: 317cbc98e8a99f2f596262b6ecdabe935854a8dba82413ef3e1bca4e436b2cf1e005d8b8200c28c8f88753b3397146d010249f625a6855e4cfb85b9e763deb53
6
+ metadata.gz: d279b0d7050ef32d59899f5ec2bc0b59995c6ee16417feb3aee37b9f85a3c2f68530595bb219871a2f344807c72e4d4d1a3d015ba1394aea2a822510282598c1
7
+ data.tar.gz: 11400db6920a0fdfb544b825e6dc5a322c060b084e171499c78a39cc1cd061cc48c8bae16f32e41280caf6a45f2defabe0691f80febbe7f3f37cf24450b4d3dd
data/CHANGELOG.md CHANGED
@@ -1,5 +1,49 @@
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
+
3
47
  ## [1.0.2] - 2026-09-20
4
48
 
5
49
  ### Documentation
@@ -45,6 +89,8 @@
45
89
  - **CLI**: `agent-tome` executable with JSON stdin/stdout interface, exit code 0 on success and non-zero on error.
46
90
  - **Claude Code skills**: Companion `tome-lookup` and `tome-capture` skills for AI agent integration.
47
91
 
48
- [Unreleased]: https://github.com/beatmadsen/agent-tome/compare/v1.0.1...HEAD
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
49
95
  [1.0.1]: https://github.com/beatmadsen/agent-tome/compare/v1.0.0...v1.0.1
50
96
  [1.0.0]: https://github.com/beatmadsen/agent-tome/releases/tag/v1.0.0
data/CONTRIBUTING.md CHANGED
@@ -1,3 +1,3 @@
1
1
  # Contributing
2
2
 
3
- Issues and pull requests welcome. Run `bin/setup` then `rake test`.
3
+ Issues and pull requests welcome. Run `bin/setup` then `rake`, which runs the suite twice: once in process and once through the `agent-tome` executable.
data/README.md CHANGED
@@ -10,7 +10,7 @@ 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
 
@@ -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` or `--match all`) |
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 <prefix>` | List keywords matching a prefix for vocabulary discovery |
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
 
@@ -124,7 +124,7 @@ module Agent
124
124
 
125
125
  i = 0
126
126
  while i < @argv.length
127
- if @argv[i] == "--match" && i + 1 < @argv.length
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" && @argv[1]
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 <prefix> List keywords matching a prefix
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) = ?", keyword_ids.length)
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
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Agent
4
4
  module Tome
5
- VERSION = "1.0.2"
5
+ VERSION = "1.1.0"
6
6
  end
7
7
  end
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.2
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.0'
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.0'
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 searchable from
57
- any CLI.
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,7 +105,6 @@ 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
110
109
  source_code_uri: https://github.com/beatmadsen/agent-tome
111
110
  bug_tracker_uri: https://github.com/beatmadsen/agent-tome/issues
@@ -118,14 +117,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
118
117
  requirements:
119
118
  - - ">="
120
119
  - !ruby/object:Gem::Version
121
- version: '3.2'
120
+ version: '3.3'
122
121
  required_rubygems_version: !ruby/object:Gem::Requirement
123
122
  requirements:
124
123
  - - ">="
125
124
  - !ruby/object:Gem::Version
126
125
  version: '0'
127
126
  requirements: []
128
- rubygems_version: 4.0.9
127
+ rubygems_version: 4.0.23
129
128
  specification_version: 4
130
129
  summary: Build a personal encyclopedia of accumulated knowledge, designed for AI agents.
131
130
  test_files: []