Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions design-docs/TODO_TOOLS_DISCOVERY_IMPLEMENTATION.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,14 +41,14 @@ class MetaAgent {
}
}

@ShellComponent
@Component
class MetaAgentShellCommands(
private val metaAgent: MetaAgent,
private val autonomy: Autonomy
) : ShellCommands {

@ShellMethod("Discover tools for current design")
fun discoverTools(@ShellOption("--domain") domain: String): String {
@Command(description = "Discover tools for current design")
fun discoverTools(@Option(longName = "domain") domain: String): String {
return autonomy.accomplishGoal(
goalName = "discoverTools",
agent = metaAgent,
Expand Down Expand Up @@ -543,13 +543,13 @@ class CredentialManager {
}

// NEW: Shell command integration
@ShellComponent
@Component
class MetaAgentShellCommands {

@ShellMethod("Manage credentials for discovered tools")
@Command(description = "Manage credentials for discovered tools")
fun credentials(
@ShellOption("--tool") toolName: String,
@ShellOption("--action", defaultValue = "set") action: String
@Option(longName = "tool") toolName: String,
@Option(longName = "action", defaultValue = "set") action: String
): String {
return when (action) {
"set" -> setCredentialsForTool(toolName)
Expand Down Expand Up @@ -752,4 +752,4 @@ meta-agent:> generate
5. **Shell Integration**: Natural command-line workflow
6. **Planning Visibility**: Users see GOAP decision-making process

The tools discovery implementation preserves all the sophisticated RAG + Knowledge Graph intelligence while gaining the benefits of agent-native architecture with GOAP planning and persistent state management! 🚀
The tools discovery implementation preserves all the sophisticated RAG + Knowledge Graph intelligence while gaining the benefits of agent-native architecture with GOAP planning and persistent state management! 🚀
4 changes: 2 additions & 2 deletions meta-agent-service/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -110,13 +110,13 @@
<dependency>
<groupId>com.embabel.agent</groupId>
<artifactId>embabel-agent-rag-core</artifactId>
<version>1.0.0-SNAPSHOT</version>
<version>${embabel-agent.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.embabel.agent</groupId>
<artifactId>embabel-agent-rag-tika</artifactId>
<version>1.0.0-SNAPSHOT</version>
<version>${embabel-agent.version}</version>
<scope>test</scope>
</dependency>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,20 +17,19 @@ package com.embabel.metaagent.service.shell

import com.embabel.agent.api.common.autonomy.Autonomy
import com.embabel.metaagent.core.agent.MetaAgent
import org.springframework.shell.CompletionContext
import org.springframework.shell.CompletionProposal
import org.springframework.shell.standard.ShellComponent
import org.springframework.shell.standard.ShellMethod
import org.springframework.shell.standard.ShellOption
import org.springframework.shell.standard.ValueProvider
import org.springframework.shell.core.command.annotation.Command
import org.springframework.shell.core.command.annotation.Option
import org.springframework.shell.core.command.completion.CompletionContext
import org.springframework.shell.core.command.completion.CompletionProposal
import org.springframework.shell.core.command.completion.CompletionProvider
import org.springframework.stereotype.Component

/**
* Provides autocompletion for generated agent Kotlin files.
*/
@Component
class GeneratedAgentFileValueProvider : ValueProvider {
override fun complete(completionContext: CompletionContext): List<CompletionProposal> {
class GeneratedAgentFileValueProvider : CompletionProvider {
override fun apply(completionContext: CompletionContext): List<CompletionProposal> {
val currentInput = completionContext.currentWordUpToCursor() ?: ""
// Try both relative paths (from meta-agent root or meta-agent-service)
val baseDirs = listOf(
Expand Down Expand Up @@ -71,7 +70,7 @@ class GeneratedAgentFileValueProvider : ValueProvider {
* @param metaAgent The core meta-agent instance with @Agent annotation
* @param autonomy The autonomy framework for goal-oriented execution
*/
@ShellComponent
@Component
class MetaAgentShellCommands(
private val metaAgent: MetaAgent,
private val autonomy: Autonomy
Expand Down Expand Up @@ -99,10 +98,10 @@ class MetaAgentShellCommands(
* @param specFile Path to a spec file; resolved relative to CWD when not absolute
* @return Agent specification summary or delegation result
*/
@ShellMethod("Design a new agent from requirements")
@Command(description = "Design a new agent from requirements")
fun design(
@ShellOption(defaultValue = ShellOption.NULL) intent: String?,
@ShellOption(defaultValue = ShellOption.NULL, value = ["--spec-file", "-f"]) specFile: String?,
@Option intent: String?,
@Option(longName = "spec-file", shortName = 'f') specFile: String?,
): String {
val resolvedIntent = resolveDesignIntent(intent, specFile)
?: return resolveDesignIntentError(intent, specFile)
Expand Down Expand Up @@ -162,7 +161,7 @@ class MetaAgentShellCommands(
*
* @return Generated agent code or error message
*/
@ShellMethod("Generate agent code from specification")
@Command(description = "Generate agent code from specification")
fun generate(): String {
return try {
// Delegate to MetaAgent through Autonomy framework using shared session
Expand Down Expand Up @@ -219,7 +218,7 @@ class MetaAgentShellCommands(
*
* @return Test result or placeholder message
*/
@ShellMethod("Test generated agent functionality")
@Command(description = "Test generated agent functionality")
fun test(): String {
return "Test command not yet implemented. This will delegate to MetaAgent testing actions."
}
Expand All @@ -232,7 +231,7 @@ class MetaAgentShellCommands(
*
* @return Recovery result or placeholder message
*/
@ShellMethod("Recover from compilation errors")
@Command(description = "Recover from compilation errors")
fun recover(): String {
return "Recovery command not yet implemented. This will delegate to MetaAgent error recovery actions."
}
Expand All @@ -252,7 +251,7 @@ class MetaAgentShellCommands(
*
* @return Generated tool skeleton or status message
*/
@ShellMethod("Generate tool skeletons matching agent actions")
@Command(description = "Generate tool skeletons matching agent actions")
fun genTools(): String {
// Get GeneratedAgentModel from blackboard
val process = lastAgentProcess
Expand Down Expand Up @@ -467,7 +466,7 @@ $methods
* @param intent Natural language request
* @return Agent response
*/
@ShellMethod("Chat with agents - autonomy chooses the right agent")
@Command(description = "Chat with agents - autonomy chooses the right agent")
fun ask(intent: String): String {
logger.info("🔍 Ask command received intent: '$intent'")

Expand Down Expand Up @@ -513,7 +512,7 @@ $methods
*
* @return Meta-agent status information
*/
@ShellMethod("Show meta-agent status")
@Command(description = "Show meta-agent status")
fun status(): String {
return "Meta-Agent Status:\n" +
"- Agent Name: ${metaAgent.javaClass.simpleName}\n" +
Expand Down Expand Up @@ -548,4 +547,4 @@ internal fun resolveDesignIntentError(intent: String?, specFile: String?): Strin
internal fun resolveSpecFile(path: String): java.io.File {
val file = java.io.File(path)
return if (file.isAbsolute) file else java.io.File(System.getProperty("user.dir"), path)
}
}
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
<spring-boot.version>4.1.0</spring-boot.version>

<!-- Embabel Agent -->
<embabel-agent.version>1.5.0</embabel-agent.version>
<embabel-agent.version>1.5.2-SNAPSHOT</embabel-agent.version>

<!-- HTML Parsing -->
<jsoup.version>1.21.2</jsoup.version>
Expand Down