legion-data 1.4.16 → 1.4.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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 5bd9e4445c0af956871ee6127cae3555e357a8ec03178151b44c2479ce2e7921
4
- data.tar.gz: 95267b3b7e289cc4348b50b205464d6e777387a465c615c278e274a8c5286042
3
+ metadata.gz: 553774f2d1b934cfad7a7c13f6b87dbcee6c30092c9b7b2b1763108e9f718492
4
+ data.tar.gz: 01f2e52421540967cad7d9679a20f430f73267415c840af08728d039e224d8be
5
5
  SHA512:
6
- metadata.gz: 191e560fb2575d4e31069a3cad534fbdc7e4826aea7e3601d99583797a405c7fc6467764c166da95366492a82fa178dfd54fa0ff55b2354e2759aa42aaf12165
7
- data.tar.gz: c7ab4e6b845346d7662d23c0d993779fbbbd56dc4bff5fdbd6fd65d168d51ecb9a5249ec488299586b5d0bbe798ae4f68a40ecd75b1c41cd1196346b1886cc13
6
+ metadata.gz: '0108d46d80e410069b73c683091f9eaa07b773492429a2caba79660c369c3fb7fc4674fd1d0b43a8a872f1604ab2af0c30e41ab2e685e71642b287b5706ed1d6'
7
+ data.tar.gz: 18edf4b93b7f8f85e333a6c680e1d8ca9588db236a2404d59852f06771abc61a86bb7ab998500040604aa91073b144390b7c7b1fa95fdcdb24c004a82ac2fb17
data/CHANGELOG.md CHANGED
@@ -1,5 +1,13 @@
1
1
  # Legion::Data Changelog
2
2
 
3
+ ## [1.4.17] - 2026-03-22
4
+
5
+ ### Added
6
+ - `Legion::Data::Helper` mixin module with data convenience methods for LEX extensions (data_path, data_class, models_class, data_connected?, data_connection, local_data_connected?, local_data_connection, local_data_model)
7
+
8
+ ### Fixed
9
+ - Add missing `require 'spec_helper'` in `helper_spec.rb` that caused `NameError: uninitialized constant Legion::Data::Helper`
10
+
3
11
  ## [1.4.16] - 2026-03-22
4
12
 
5
13
  ### Changed
data/CLAUDE.md CHANGED
@@ -8,7 +8,7 @@
8
8
  Manages persistent database storage for the LegionIO framework. Supports SQLite (default), MySQL, and PostgreSQL via Sequel ORM. Provides automatic schema migrations and data models for extensions, functions, runners, nodes, tasks, settings, digital workers, task relationships, Apollo shared knowledge tables (PostgreSQL only), tenants, webhooks, audit log, and archive tables. Also provides a parallel local SQLite database (`Legion::Data::Local`) for agentic cognitive state persistence.
9
9
 
10
10
  **GitHub**: https://github.com/LegionIO/legion-data
11
- **Version**: 1.4.4
11
+ **Version**: 1.4.12
12
12
  **License**: Apache-2.0
13
13
 
14
14
  ## Supported Databases
@@ -46,7 +46,7 @@ Legion::Data (singleton module)
46
46
  │ ├── .shutdown # Close local connection
47
47
  │ └── .reset! # Clear all state (testing)
48
48
 
49
- ├── Migration # Auto-migration system (25 migrations, Sequel DSL)
49
+ ├── Migration # Auto-migration system (26 migrations, Sequel DSL)
50
50
  │ └── migrations/
51
51
  │ ├── 001_add_schema_columns
52
52
  │ ├── 002_add_nodes
@@ -182,7 +182,7 @@ Per-adapter credential defaults are defined in `Settings::CREDS`:
182
182
  | `lib/legion/data.rb` | Module entry, setup/shutdown lifecycle |
183
183
  | `lib/legion/data/connection.rb` | Sequel database connection (adapter selection) |
184
184
  | `lib/legion/data/migration.rb` | Migration runner |
185
- | `lib/legion/data/migrations/` | 25 numbered migration files (Sequel DSL) |
185
+ | `lib/legion/data/migrations/` | 26 numbered migration files (Sequel DSL) |
186
186
  | `lib/legion/data/model.rb` | Model autoloader |
187
187
  | `lib/legion/data/local.rb` | Local SQLite module for agentic cognitive state |
188
188
  | `lib/legion/data/models/` | Sequel models (Extension, Function, Runner, Node, Task, TaskLog, Setting, DigitalWorker, Relationship, ApolloEntry, ApolloRelation, ApolloExpertise, ApolloAccessLog, AuditLog, RbacRoleAssignment, RbacRunnerGrant, RbacCrossTeamGrant) |
data/README.md CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  Persistent database storage for the [LegionIO](https://github.com/LegionIO/LegionIO) framework. Provides database connectivity via Sequel ORM, automatic schema migrations, and data models for extensions, functions, runners, nodes, tasks, settings, digital workers, task relationships, and Apollo shared knowledge tables.
4
4
 
5
- **Version**: 1.4.4
5
+ **Version**: 1.4.12
6
6
 
7
7
  ## Supported Databases
8
8
 
@@ -0,0 +1,39 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Legion
4
+ module Data
5
+ module Helper
6
+ def data_path
7
+ @data_path ||= "#{full_path}/data"
8
+ end
9
+
10
+ def data_class
11
+ @data_class ||= lex_class::Data
12
+ end
13
+
14
+ def models_class
15
+ @models_class ||= data_class::Model
16
+ end
17
+
18
+ def data_connected?
19
+ defined?(Legion::Settings) && Legion::Settings[:data][:connected]
20
+ end
21
+
22
+ def data_connection
23
+ Legion::Data::Connection.sequel
24
+ end
25
+
26
+ def local_data_connected?
27
+ Legion::Data::Local.connected?
28
+ end
29
+
30
+ def local_data_connection
31
+ Legion::Data::Local.connection
32
+ end
33
+
34
+ def local_data_model(table_name)
35
+ Legion::Data::Local.model(table_name)
36
+ end
37
+ end
38
+ end
39
+ end
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Legion
4
4
  module Data
5
- VERSION = '1.4.16'
5
+ VERSION = '1.4.17'
6
6
  end
7
7
  end
data/lib/legion/data.rb CHANGED
@@ -11,6 +11,7 @@ require_relative 'data/local'
11
11
  require_relative 'data/spool'
12
12
  require_relative 'data/partition_manager'
13
13
  require_relative 'data/archiver'
14
+ require_relative 'data/helper'
14
15
 
15
16
  module Legion
16
17
  module Data
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: legion-data
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.4.16
4
+ version: 1.4.17
5
5
  platform: ruby
6
6
  authors:
7
7
  - Esity
@@ -96,6 +96,7 @@ files:
96
96
  - lib/legion/data/encryption/sequel_plugin.rb
97
97
  - lib/legion/data/event_store.rb
98
98
  - lib/legion/data/event_store/projection.rb
99
+ - lib/legion/data/helper.rb
99
100
  - lib/legion/data/local.rb
100
101
  - lib/legion/data/migration.rb
101
102
  - lib/legion/data/migrations/001_add_schema_columns.rb