htm 0.0.15 → 0.0.17

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.
Files changed (75) hide show
  1. checksums.yaml +4 -4
  2. data/.envrc +1 -0
  3. data/CHANGELOG.md +67 -0
  4. data/README.md +97 -1592
  5. data/bin/htm_mcp +31 -0
  6. data/config/database.yml +7 -4
  7. data/docs/getting-started/installation.md +31 -11
  8. data/docs/guides/mcp-server.md +456 -21
  9. data/docs/multi_framework_support.md +2 -2
  10. data/examples/mcp_client.rb +2 -2
  11. data/examples/rails_app/.gitignore +2 -0
  12. data/examples/rails_app/Gemfile +22 -0
  13. data/examples/rails_app/Gemfile.lock +438 -0
  14. data/examples/rails_app/Procfile.dev +1 -0
  15. data/examples/rails_app/README.md +98 -0
  16. data/examples/rails_app/Rakefile +5 -0
  17. data/examples/rails_app/app/assets/stylesheets/application.css +83 -0
  18. data/examples/rails_app/app/assets/stylesheets/inter-font.css +6 -0
  19. data/examples/rails_app/app/controllers/application_controller.rb +19 -0
  20. data/examples/rails_app/app/controllers/dashboard_controller.rb +27 -0
  21. data/examples/rails_app/app/controllers/files_controller.rb +205 -0
  22. data/examples/rails_app/app/controllers/memories_controller.rb +102 -0
  23. data/examples/rails_app/app/controllers/robots_controller.rb +44 -0
  24. data/examples/rails_app/app/controllers/search_controller.rb +46 -0
  25. data/examples/rails_app/app/controllers/tags_controller.rb +30 -0
  26. data/examples/rails_app/app/javascript/application.js +4 -0
  27. data/examples/rails_app/app/javascript/controllers/application.js +9 -0
  28. data/examples/rails_app/app/javascript/controllers/index.js +6 -0
  29. data/examples/rails_app/app/views/dashboard/index.html.erb +123 -0
  30. data/examples/rails_app/app/views/files/index.html.erb +108 -0
  31. data/examples/rails_app/app/views/files/new.html.erb +321 -0
  32. data/examples/rails_app/app/views/files/show.html.erb +130 -0
  33. data/examples/rails_app/app/views/layouts/application.html.erb +124 -0
  34. data/examples/rails_app/app/views/memories/_memory_card.html.erb +51 -0
  35. data/examples/rails_app/app/views/memories/deleted.html.erb +62 -0
  36. data/examples/rails_app/app/views/memories/edit.html.erb +35 -0
  37. data/examples/rails_app/app/views/memories/index.html.erb +81 -0
  38. data/examples/rails_app/app/views/memories/new.html.erb +71 -0
  39. data/examples/rails_app/app/views/memories/show.html.erb +126 -0
  40. data/examples/rails_app/app/views/robots/index.html.erb +106 -0
  41. data/examples/rails_app/app/views/robots/new.html.erb +36 -0
  42. data/examples/rails_app/app/views/robots/show.html.erb +79 -0
  43. data/examples/rails_app/app/views/search/index.html.erb +184 -0
  44. data/examples/rails_app/app/views/shared/_navbar.html.erb +52 -0
  45. data/examples/rails_app/app/views/shared/_stat_card.html.erb +52 -0
  46. data/examples/rails_app/app/views/tags/index.html.erb +131 -0
  47. data/examples/rails_app/app/views/tags/show.html.erb +67 -0
  48. data/examples/rails_app/bin/dev +8 -0
  49. data/examples/rails_app/bin/rails +4 -0
  50. data/examples/rails_app/bin/rake +4 -0
  51. data/examples/rails_app/config/application.rb +33 -0
  52. data/examples/rails_app/config/boot.rb +5 -0
  53. data/examples/rails_app/config/database.yml +15 -0
  54. data/examples/rails_app/config/environment.rb +5 -0
  55. data/examples/rails_app/config/importmap.rb +7 -0
  56. data/examples/rails_app/config/routes.rb +38 -0
  57. data/examples/rails_app/config/tailwind.config.js +35 -0
  58. data/examples/rails_app/config.ru +5 -0
  59. data/examples/rails_app/log/.keep +0 -0
  60. data/examples/rails_app/tmp/local_secret.txt +1 -0
  61. data/lib/htm/active_record_config.rb +2 -5
  62. data/lib/htm/configuration.rb +35 -2
  63. data/lib/htm/database.rb +3 -6
  64. data/lib/htm/mcp/cli.rb +333 -0
  65. data/lib/htm/mcp/group_tools.rb +476 -0
  66. data/lib/htm/mcp/resources.rb +89 -0
  67. data/lib/htm/mcp/server.rb +98 -0
  68. data/lib/htm/mcp/tools.rb +488 -0
  69. data/lib/htm/models/file_source.rb +5 -3
  70. data/lib/htm/railtie.rb +0 -4
  71. data/lib/htm/tasks.rb +7 -4
  72. data/lib/htm/version.rb +1 -1
  73. data/lib/tasks/htm.rake +6 -9
  74. metadata +59 -4
  75. data/bin/htm_mcp.rb +0 -621
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 9ae4db5f168c495f5afef19f740f16ee9b39136cd54403f54090921cb6952275
4
- data.tar.gz: 454816f53e620a72efeae7bd8b6c0a30c459403b4f1b6a3d0ca7adf30f3cda7c
3
+ metadata.gz: 964868a160989db5a7f8baa524e89d82552166f5d065f30685a17597ddec627b
4
+ data.tar.gz: 963b4d21d30ee51d08c34af26a1d2d1284b17d03ac39734ad81be0d0b3cd1a45
5
5
  SHA512:
6
- metadata.gz: 52adbf798f4004961936f9112878d245c6872bf812611efa47bc9b7808ba39510d79d0902f109db8169e1cd0d5420338094edd7719f995f67c1b3def07a2a4d2
7
- data.tar.gz: 7ac9e6a8913b9b836ddfdfdb909857ac62bdd2c5d6c6c904c2a257224fc80499a118afd3d63a3a14d0daed838e11c02b2f2149eddb8c0385ebb2d5be9ab258f8
6
+ metadata.gz: 2c061077debb17b3bcee1c70e1136cdf8d1248ca100815adb75eb522aa39c40ac1a8863c07684d89da36a7c8df37f6b22b3c98669939cfaf177ea37d51716435
7
+ data.tar.gz: 49b6ec15849051d17c85261d7529374d7d5f95be381b96415c10e0e883b08c3f52c5b3303c04ae850376dd23682dd4f387218eed1c6a5b1fab28c2f8eac2c183
data/.envrc CHANGED
@@ -2,6 +2,7 @@
2
2
 
3
3
  export RR=`pwd`
4
4
 
5
+ export RAILS_ENV=development
5
6
  export HTM_EXTRACT_PROPOSITIONS=true
6
7
 
7
8
  # Database connection - Localhost PostgreSQL
data/CHANGELOG.md CHANGED
@@ -7,6 +7,73 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
7
7
 
8
8
  ## [Unreleased]
9
9
 
10
+ ## [0.0.17] - 2025-12-18
11
+
12
+ ### Added
13
+ - **HTM_ENV environment variable** - Non-Rails users can now use `HTM_ENV` instead of `RAILS_ENV`
14
+ - Priority: `HTM_ENV` > `RAILS_ENV` > `RACK_ENV` > `'development'`
15
+ - `HTM.env` returns the current environment name
16
+ - `HTM.test?`, `HTM.development?`, `HTM.production?` helper methods
17
+ - Example: `HTM_ENV=test htm_mcp setup`
18
+ - **MCP CLI subcommands** - `bin/htm_mcp` now supports multiple commands for database management
19
+ - `htm_mcp setup` / `htm_mcp init` - Initialize database schema
20
+ - `htm_mcp verify` - Verify database connection, extensions, and migration status
21
+ - `htm_mcp stats` - Show memory statistics including database size and file sources
22
+ - `htm_mcp version` - Show HTM version
23
+ - `htm_mcp help` - Comprehensive help with all environment variables
24
+ - `htm_mcp` / `htm_mcp server` / `htm_mcp stdio` - Start MCP server (default behavior)
25
+ - **Migration status display** - `htm_mcp verify` now shows applied/pending migrations with +/- indicators
26
+ - **Database size in stats** - `htm_mcp stats` displays database size via `pg_size_pretty`
27
+ - **Error suggestions** - CLI provides helpful suggestions for common database errors (connection refused, missing database, auth failures, missing extensions)
28
+ - **Rails demo application** - Full-featured web UI for exploring HTM capabilities
29
+ - Located in `examples/rails_app/` - minimal Rails 7.2 application
30
+ - **Dashboard** - Overview of memories, robots, tags, and files with quick stats
31
+ - **Memories** - Browse, create, edit, delete, and restore memories with tag filtering
32
+ - **Search** - Semantic search with vector/fulltext/hybrid strategies and strategy comparison mode
33
+ - **Tags** - Hierarchical tag browser with memory counts
34
+ - **Robots** - View robots, switch active robot, see memory associations
35
+ - **Files** - Load markdown files via path or native file picker, directory uploads, sync tracking
36
+ - Dark theme UI using Tailwind CSS
37
+ - Upload progress overlay with stage indicators
38
+ - Error handling with graceful degradation for search failures
39
+ - **FileSource#needs_sync? default argument** - Now works without argument by reading file mtime from filesystem
40
+ - **RobotGroup MCP tools** - 12 new tools for high-availability robot coordination
41
+ - `CreateGroupTool` - Create a new robot group with shared working memory
42
+ - `ListGroupsTool` - List all active robot groups in the session
43
+ - `GetGroupStatusTool` - Get detailed status of a robot group
44
+ - `JoinGroupTool` - Add a robot to an existing group
45
+ - `LeaveGroupTool` - Remove a robot from a group
46
+ - `GroupRememberTool` - Store memory shared across group members
47
+ - `GroupRecallTool` - Recall memories from a group's shared context
48
+ - `GetGroupWorkingMemoryTool` - Get a group's working memory contents
49
+ - `PromoteRobotTool` - Promote a passive robot to active role
50
+ - `FailoverTool` - Trigger failover to next available robot
51
+ - `SyncGroupTool` - Synchronize group state across members
52
+ - `ShutdownGroupTool` - Gracefully shutdown a robot group
53
+ - **RobotGroups MCP resource** - `htm://groups` returns active robot groups and their status
54
+ - **MCPGroupSession module** - Session state management for robot groups in MCP server
55
+ - **MCP server test suite** - 59 tests with 174 assertions covering all tools and resources
56
+
57
+ ### Changed
58
+ - **Renamed `bin/htm_mcp.rb` to `bin/htm_mcp`** - Cleaner executable name without extension
59
+ - **MCP server refactored into modules** - Code moved from monolithic file to `lib/htm/mcp/`:
60
+ - `lib/htm/mcp/cli.rb` - CLI command handling
61
+ - `lib/htm/mcp/server.rb` - Server setup and lifecycle
62
+ - `lib/htm/mcp/tools.rb` - Individual MCP tools (11 tools)
63
+ - `lib/htm/mcp/group_tools.rb` - Robot group tools (12 tools)
64
+ - `lib/htm/mcp/resources.rb` - MCP resources (4 resources)
65
+ - **README.md MCP section** - Reorganized tools by category (Session & Memory, Robot Group)
66
+ - **docs/guides/mcp-server.md** - Comprehensive RobotGroup tools documentation with examples, updated for CLI commands
67
+
68
+ ### Fixed
69
+ - **MCP server direct execution** - Added `require 'bundler/setup'` to `bin/htm_mcp` for execution without `bundle exec`
70
+ - Fixes timeout issues when MCP clients invoke the server directly
71
+ - Server now loads gems correctly from Gemfile when run as `./bin/htm_mcp`
72
+ - **ontology_test.rb** - Added `configure_htm_with_mocks` to prevent real LLM calls during tests
73
+ - `test_node_creation_without_tags` and `test_empty_tag_array_no_topics` now pass
74
+ - **job_adapter_test.rb** - Fixed environment detection test to properly handle `HTM_ENV` priority
75
+ - Test now saves and restores all relevant environment variables (`HTM_ENV`, `RAILS_ENV`, `RACK_ENV`)
76
+
10
77
  ## [0.0.15] - 2025-12-06
11
78
 
12
79
  ### Added