Class: SolidAgent::Generators::ManifestGenerator

Inherits:
Rails::Generators::NamedBase
  • Object
show all
Defined in:
lib/generators/solid_agent/manifest/manifest_generator.rb

Instance Method Summary collapse

Instance Method Details

#create_manifest_fileObject



30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
# File 'lib/generators/solid_agent/manifest/manifest_generator.rb', line 30

def create_manifest_file
  @model = options[:model]
  @tools = options[:tools]
  @preset = options[:template]
  @format = options[:format].to_sym
  @contextual = options[:context]
  @description = options[:description] || default_description

  # Apply preset template configuration
  apply_preset if @preset

  case @format
  when :agent_md
    template "agent.md.erb", manifest_path(".agent.md")
  when :dotprompt
    template "prompt.erb", manifest_path(".prompt")
  else
    template "agent.md.erb", manifest_path(".agent.md")
  end
end

#show_next_stepsObject



51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
# File 'lib/generators/solid_agent/manifest/manifest_generator.rb', line 51

def show_next_steps
  say ""
  say "Manifest created successfully!", :green
  say ""
  say "File generated:"
  say "  #{manifest_path(extension_for_format)}"
  say ""
  say "Usage:", :yellow
  say "  # Parse the manifest"
  say "  manifest = SolidAgent::AgentManifest.parse(\"#{manifest_path(extension_for_format)}\")"
  say ""
  say "  # Load as agent class"
  say "  klass = SolidAgent::AgentManifest.load_agent(\"#{manifest_path(extension_for_format)}\")"
  say ""
  say "  # Validate the manifest"
  say "  SolidAgent::AgentManifest.validate!(\"#{manifest_path(extension_for_format)}\")"
  say ""

  if @tools.any?
    say "Tool stubs added. Implement the tool methods in your agent class:", :yellow
    @tools.each do |tool|
      say "  def #{tool}(args)"
      say "    # Implement #{tool} logic"
      say "  end"
    end
    say ""
  end
end