activeagent 0.4.2.rc1 → 0.4.2.rc2

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: 9502dc9a10e641ee19eda0abaaab702610935eabde01ea947fc661a8d88af2e1
4
- data.tar.gz: 3828eb1a71d0de917c5140f67b065e7e5b4c076de1572e58d658590d5da964d7
3
+ metadata.gz: 1ac9862cc06ad052e647933e771cb13ee76b4dbf43f5cdd61b871e017d685477
4
+ data.tar.gz: cf42d4608113a3ca73432fdd404c319f97ddde53919440c54a0247c1002b3f00
5
5
  SHA512:
6
- metadata.gz: 5dba06808ee99e8f986a9f255a6ab9e112e83b7d512b592126da6ff5d8f9ff2568664abf0ca92d6096abc7ef025364f1e835f14bde70fab32c9ccbf94be24617
7
- data.tar.gz: 96eb68d1cc75a05dda5d6835fef6e68b3724a049742d1e189567a1378b3ea6edefe0c1ca2471183ceed27f8873143c21dbfc15ae2ad5e935471ff64e7a189ce5
6
+ metadata.gz: 23f7ccf62009efc9a46f0fb3e200866850519178bec86a36edb00e0d7252023bb1bbeb88da3087d2eaa565749ac0c3ae43e25e576615804fa7368617c6010c71
7
+ data.tar.gz: bda215bf93b1e86352871be452fec8bbb7c77d3638ffa608e44ca4694b87a5dd5f9cf08bd1d87687e6116e65347aa3253b50970b012b9b76522ae6c4e3070016
@@ -1,3 +1,3 @@
1
1
  module ActiveAgent
2
- VERSION = "0.4.2.rc1"
2
+ VERSION = "0.4.2.rc2"
3
3
  end
@@ -0,0 +1,25 @@
1
+ Description:
2
+ Sets up ActiveAgent in your Rails application by creating the necessary
3
+ configuration files and application agent class.
4
+
5
+ This generator creates:
6
+ - Configuration file (config/active_agent.yml)
7
+ - Application agent base class (app/agents/application_agent.rb)
8
+ - Layout templates for agent views (via template engine hooks)
9
+
10
+ Examples:
11
+ `bin/rails generate active_agent:install`
12
+
13
+ creates the basic ActiveAgent setup:
14
+ Config: config/active_agent.yml
15
+ Base Agent: app/agents/application_agent.rb
16
+ Layouts: app/views/layouts/agent.html.erb
17
+ app/views/layouts/agent.text.erb
18
+ app/views/layouts/agent.json.erb
19
+
20
+ `bin/rails generate active_agent:install --template-engine=haml`
21
+
22
+ creates ActiveAgent setup with Haml layouts instead of ERB.
23
+
24
+ After running this generator, you can create individual agents with:
25
+ `bin/rails generate active_agent:agent AGENT_NAME ACTION_NAME`
@@ -1,18 +1,30 @@
1
1
  Description:
2
2
  Generates a new agent and its views. Passes the agent name, either
3
- CamelCased or under_scored, and an optional list of prompts as arguments.
3
+ CamelCased or under_scored, and an optional list of actions as arguments.
4
4
 
5
- This generates a agent class in app/agents and invokes your template
6
- engine and test framework generators.
5
+ This generates an agent class in app/agents and invokes your template
6
+ engine and test framework generators. If no ApplicationAgent exists,
7
+ it will be created automatically.
8
+
9
+ Views are created for each action in three formats:
10
+ - HTML (.html.erb) - for rich text responses
11
+ - Text (.text.erb) - for plain text responses
12
+ - JSON (.json.erb) - for structured function calling responses
7
13
 
8
14
  Examples:
9
15
  `bin/rails generate active_agent:agent inventory search`
10
16
 
11
17
  creates an inventory agent class, views, and test:
12
- Agent: app/agents/inventory_agent.rb
13
- Views: app/views/inventory_agent/search.text.erb [...]
18
+ Agent: app/agents/inventory_agent.rb
19
+ Views: app/views/inventory_agent/search.html.erb
20
+ app/views/inventory_agent/search.text.erb
21
+ app/views/inventory_agent/search.json.erb
14
22
  Test: test/agents/inventory_agent_test.rb
15
23
 
16
24
  `bin/rails generate active_agent:agent inventory search update report`
17
25
 
18
26
  creates an inventory agent with search, update, and report actions.
27
+
28
+ `bin/rails generate active_agent:agent admin/user create --template-engine=haml`
29
+
30
+ creates a namespaced admin/user agent with Haml templates.
@@ -3,6 +3,9 @@
3
3
  module ActiveAgent
4
4
  module Generators
5
5
  class InstallGenerator < ::Rails::Generators::Base
6
+ def self.usage_path
7
+ @usage_path ||= File.expand_path("../USAGE", __dir__)
8
+ end
6
9
  source_root File.expand_path("templates", __dir__)
7
10
 
8
11
  hook_for :template_engine, :test_framework
@@ -10,6 +13,20 @@ module ActiveAgent
10
13
  def create_configuration
11
14
  template "active_agent.yml", "config/active_agent.yml"
12
15
  end
16
+
17
+ def create_application_agent
18
+ in_root do
19
+ if !File.exist?(application_agent_file_name)
20
+ template "application_agent.rb", application_agent_file_name
21
+ end
22
+ end
23
+ end
24
+
25
+ private
26
+
27
+ def application_agent_file_name
28
+ "app/agents/application_agent.rb"
29
+ end
13
30
  end
14
31
  end
15
32
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: activeagent
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.2.rc1
4
+ version: 0.4.2.rc2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Justin Bowen
@@ -184,6 +184,7 @@ files:
184
184
  - lib/active_agent/test_case.rb
185
185
  - lib/active_agent/version.rb
186
186
  - lib/activeagent.rb
187
+ - lib/generators/USAGE
187
188
  - lib/generators/active_agent/USAGE
188
189
  - lib/generators/active_agent/agent_generator.rb
189
190
  - lib/generators/active_agent/install_generator.rb