soka-rails 0.0.1.beta4 → 0.0.2
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 +18 -0
- data/lib/generators/soka/agent/templates/agent.rb.tt +1 -1
- data/lib/soka/rails/railtie.rb +56 -5
- data/lib/soka/rails/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 956c0fc8a0ecef6e81f471a6674f4a0c7c5df800f720618ecf54a32c87583d1f
|
4
|
+
data.tar.gz: d7d16aff15e796d33c284bb77f1db2f7ff42ba61dbf3fb7f76ded2e87a0758d5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fd259ec01dcb6ba6c760685a3d1f94bf0091a9298014f696c782cf7839e182651d1e9c44457ed9505bc76a6b048ab72a9bc9b16063c43b436a5b7d48ce98ad17
|
7
|
+
data.tar.gz: 3383aba5cdbf64703815efe55214ad63e9ae8d8aedcd6f845c97ef4c6382cf91ba8a9cd0217c75a4fa7db38fa62507072a3550d64c8098dadfa85fd97e0585d9
|
data/CHANGELOG.md
CHANGED
@@ -5,6 +5,24 @@ All notable changes to this project will be documented in this file.
|
|
5
5
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
6
6
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
7
7
|
|
8
|
+
## [0.0.2] - 2025-08-01
|
9
|
+
|
10
|
+
### Fixed
|
11
|
+
- Comment out private keyword in agent template
|
12
|
+
- Resolve Rails autoloading issues for agents and tools
|
13
|
+
|
14
|
+
### Changed
|
15
|
+
- Add link to full changelog in release notes
|
16
|
+
|
17
|
+
## [0.0.1] - 2025-08-01
|
18
|
+
|
19
|
+
### Added
|
20
|
+
- Extract version-specific changelog for GitHub releases
|
21
|
+
|
22
|
+
### Changed
|
23
|
+
- Release workflow now parses CHANGELOG.md to extract entries for specific versions
|
24
|
+
- GitHub releases use extracted content as release notes instead of auto-generated notes
|
25
|
+
|
8
26
|
## [0.0.1.beta4] - 2025-08-01
|
9
27
|
|
10
28
|
### Fixed
|
data/lib/soka/rails/railtie.rb
CHANGED
@@ -1,14 +1,65 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
+
require 'soka'
|
4
|
+
|
3
5
|
module Soka
|
4
6
|
module Rails
|
5
7
|
# Rails integration for Soka, configuring autoloading and initializers
|
8
|
+
#
|
9
|
+
# This Railtie ensures that Soka agents and tools can be autoloaded
|
10
|
+
# properly by Rails' Zeitwerk autoloader. It sets up app/soka as a
|
11
|
+
# root directory and collapses subdirectories to avoid namespace requirements.
|
12
|
+
#
|
13
|
+
# @example Directory structure
|
14
|
+
# app/soka/
|
15
|
+
# ├── agents/
|
16
|
+
# │ ├── application_agent.rb # Defines ApplicationAgent (not Agents::ApplicationAgent)
|
17
|
+
# │ └── search_agent.rb # Defines SearchAgent (not Agents::SearchAgent)
|
18
|
+
# └── tools/
|
19
|
+
# ├── application_tool.rb # Defines ApplicationTool (not Tools::ApplicationTool)
|
20
|
+
# └── search_tool.rb # Defines SearchTool (not Tools::SearchTool)
|
6
21
|
class Railtie < ::Rails::Railtie
|
7
|
-
#
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
22
|
+
# Configuration for collapsed directories
|
23
|
+
# Users can modify this in an initializer if needed
|
24
|
+
config.soka_collapsed_dirs = %w[agents tools]
|
25
|
+
|
26
|
+
# Set up Zeitwerk autoloading for Soka directories
|
27
|
+
#
|
28
|
+
# This initializer runs after Rails sets up its autoloaders but before
|
29
|
+
# eager loading begins. It configures app/soka as a root directory
|
30
|
+
# and collapses specified subdirectories.
|
31
|
+
initializer 'soka.setup_autoloading',
|
32
|
+
after: :setup_once_autoloader,
|
33
|
+
before: :eager_load! do |app|
|
34
|
+
setup_soka_autoloading(app)
|
35
|
+
end
|
36
|
+
|
37
|
+
private
|
38
|
+
|
39
|
+
def setup_soka_autoloading(app)
|
40
|
+
soka_path = app.root.join('app/soka')
|
41
|
+
return unless soka_path.exist?
|
42
|
+
|
43
|
+
configure_autoloader(soka_path)
|
44
|
+
rescue StandardError => e
|
45
|
+
::Rails.logger&.error "[Soka] Failed to configure autoloading: #{e.message}"
|
46
|
+
raise
|
47
|
+
end
|
48
|
+
|
49
|
+
def configure_autoloader(soka_path)
|
50
|
+
# Add app/soka as a root directory without namespace
|
51
|
+
# This allows classes in app/soka to be loaded at the top level
|
52
|
+
::Rails.autoloaders.main.push_dir(soka_path.to_s)
|
53
|
+
|
54
|
+
# Collapse configured directories
|
55
|
+
# This removes the directory name from the expected constant path
|
56
|
+
# e.g., app/soka/agents/foo.rb defines Foo instead of Agents::Foo
|
57
|
+
config.soka_collapsed_dirs.each do |dir|
|
58
|
+
dir_path = soka_path.join(dir)
|
59
|
+
::Rails.autoloaders.main.collapse(dir_path.to_s) if dir_path.exist?
|
60
|
+
end
|
61
|
+
|
62
|
+
::Rails.logger&.debug "[Soka] Configured autoloading for #{soka_path}"
|
12
63
|
end
|
13
64
|
end
|
14
65
|
end
|
data/lib/soka/rails/version.rb
CHANGED