ask-rails 0.14.0 → 0.15.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 +14 -0
- data/README.md +3 -3
- data/lib/ask/rails/railtie.rb +14 -0
- data/lib/ask/rails/version.rb +1 -1
- data/lib/generators/ask/agent/templates/agent.rb +2 -2
- data/lib/generators/ask/install/templates/application_agent.rb +5 -3
- 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: 59ba33037208fef8912b1943bc2da59f8a726f89d5d06b5a489128e66ab0068d
|
|
4
|
+
data.tar.gz: 2ed8a54baec5bb27c79892430643e1fd035791970c5f784e6af2b9c83c4f5b4a
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: c86ae3b8971c9a7844a89945bd57f87d4cf94af230dbc05ba58163035a1ff99c75b6ae9c36bcd52b48613ee0f702d913262ca4cf90d357d09eb27c6abcca7398
|
|
7
|
+
data.tar.gz: 03bbfcdad570a35fbe36e53e8cf3f91174001f23d30d87fe98e8ee6ab01c7c409064ef019d6baf352397a4ec816e58556258859065145c9056cdfd26a18442ac
|
data/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,17 @@
|
|
|
1
|
+
## [0.15.0] — 2026-07-30
|
|
2
|
+
|
|
3
|
+
### Added
|
|
4
|
+
|
|
5
|
+
- **Zeitwerk integration — agent directories are ignored by the autoloader.**
|
|
6
|
+
ask-agent discovers agents, tools, and skills via direct `require`
|
|
7
|
+
(`app/agents/<name>/agent.rb`, `shared/tools/*.rb`, ...). Their class
|
|
8
|
+
names (`SupportBot::Agent`) don't match Zeitwerk's constant mapping
|
|
9
|
+
(`SupportBot::Agent` from `app/agents/support_bot/agent.rb` would be
|
|
10
|
+
expected as `SupportBot::Agent` — ambiguous), so the railtie now tells
|
|
11
|
+
Zeitwerk to ignore every directory under `app/agents/`. Prevents
|
|
12
|
+
`NameError` at eager load in production while keeping development
|
|
13
|
+
discovery intact.
|
|
14
|
+
|
|
1
15
|
## [0.14.0] — 2026-07-30
|
|
2
16
|
|
|
3
17
|
### Notes
|
data/README.md
CHANGED
|
@@ -45,15 +45,15 @@ Creates the agent directory convention used by ask-agent discovery:
|
|
|
45
45
|
|
|
46
46
|
```
|
|
47
47
|
app/agents/support_bot/
|
|
48
|
-
├── agent.rb #
|
|
48
|
+
├── agent.rb # module SupportBot; class Agent < ApplicationAgent
|
|
49
49
|
├── instructions.md # auto-loaded as the system prompt
|
|
50
50
|
└── tools/ # per-agent tools (referenced with `tools :tool_name`)
|
|
51
51
|
```
|
|
52
52
|
|
|
53
53
|
```ruby
|
|
54
54
|
# app/agents/support_bot/agent.rb
|
|
55
|
-
module
|
|
56
|
-
class
|
|
55
|
+
module SupportBot
|
|
56
|
+
class Agent < ApplicationAgent
|
|
57
57
|
model "gpt-4o"
|
|
58
58
|
# tools :search_knowledge_base
|
|
59
59
|
end
|
data/lib/ask/rails/railtie.rb
CHANGED
|
@@ -3,6 +3,20 @@
|
|
|
3
3
|
module Ask
|
|
4
4
|
module Rails
|
|
5
5
|
class Railtie < ::Rails::Railtie
|
|
6
|
+
# ask-agent discovers agents, tools, and skills itself via direct
|
|
7
|
+
# `require` (app/agents/<name>/agent.rb, shared/tools/*.rb, ...).
|
|
8
|
+
# Zeitwerk must not try to autoload those directories — the class
|
|
9
|
+
# names inside (e.g. `NlOperatorAgent`) don't match the Zeitwerk
|
|
10
|
+
# constant mapping (e.g. `NlOperator::Agent`) and eager loading
|
|
11
|
+
# would raise. Keep the directories out of Zeitwerk entirely.
|
|
12
|
+
initializer "ask_rails.zeitwerk" do |app|
|
|
13
|
+
agents_path = app.root.join("app/agents")
|
|
14
|
+
next unless agents_path.directory?
|
|
15
|
+
|
|
16
|
+
Dir.glob(agents_path.join("*")).each do |entry|
|
|
17
|
+
Rails.autoloaders.main.ignore(entry) if File.directory?(entry)
|
|
18
|
+
end
|
|
19
|
+
end
|
|
6
20
|
end
|
|
7
21
|
end
|
|
8
22
|
end
|
data/lib/ask/rails/version.rb
CHANGED
|
@@ -9,8 +9,8 @@
|
|
|
9
9
|
# Instructions load automatically from instructions.md next to this file.
|
|
10
10
|
# Per-agent tools live in tools/ — reference them with `tools :tool_name`.
|
|
11
11
|
#
|
|
12
|
-
module
|
|
13
|
-
class
|
|
12
|
+
module <%= class_name %>
|
|
13
|
+
class Agent < ApplicationAgent
|
|
14
14
|
# model "gpt-4o"
|
|
15
15
|
# provider :openai
|
|
16
16
|
# max_turns 25
|
|
@@ -5,9 +5,11 @@
|
|
|
5
5
|
# Subclass this to define agents:
|
|
6
6
|
#
|
|
7
7
|
# # app/agents/support_bot/agent.rb
|
|
8
|
-
#
|
|
9
|
-
#
|
|
10
|
-
#
|
|
8
|
+
# module SupportBot
|
|
9
|
+
# class Agent < ApplicationAgent
|
|
10
|
+
# model "gpt-4o"
|
|
11
|
+
# tools :search_knowledge_base
|
|
12
|
+
# end
|
|
11
13
|
# end
|
|
12
14
|
#
|
|
13
15
|
# # app/agents/support_bot/instructions.md — auto-loaded as the system prompt
|