feat: import agents_and_robots platform as unibots (Matrix-out, unibus transport)
Reemplaza el scaffold del echobot por la plataforma completa de bots traida desde ~/DataProyects/Github/agents_and_robots tras la operacion Matrix-out: los bots ya no hablan por Matrix sino por el bus unibus (modelo todo-rooms + E2E via shell/transportunibus sobre github.com/enmanuel/unibus/pkg/client). - go.mod: replace de unibus -> ../unibus y de fn-registry -> ../../../.. (paths relativos reajustados a la nueva ubicacion dentro de fn_registry). - app.md: bump a 0.2.0, descripcion + arquitectura + comandos + gotchas reales. - modulo Go conservado como github.com/enmanuel/agents (sin reescribir imports). agents_and_robots queda archivado como museo de la era Matrix.
This commit is contained in:
@@ -0,0 +1,58 @@
|
||||
// Package tools defines pure, declarative tool specifications.
|
||||
// No execution happens here — only data describing what tools exist and their contracts.
|
||||
package tools
|
||||
|
||||
// ToolKind identifies the category of a tool.
|
||||
type ToolKind string
|
||||
|
||||
const (
|
||||
ToolKindSSH ToolKind = "ssh"
|
||||
ToolKindHTTP ToolKind = "http"
|
||||
ToolKindScript ToolKind = "script"
|
||||
ToolKindFileOps ToolKind = "file_ops"
|
||||
ToolKindMCP ToolKind = "mcp"
|
||||
)
|
||||
|
||||
// ToolSpec is a pure description of a tool — what it does and what it accepts.
|
||||
// The actual execution lives in shell/effects/.
|
||||
type ToolSpec struct {
|
||||
Name string
|
||||
Kind ToolKind
|
||||
Description string
|
||||
Parameters []ParameterSpec
|
||||
}
|
||||
|
||||
type ParameterSpec struct {
|
||||
Name string
|
||||
Type string
|
||||
Description string
|
||||
Required bool
|
||||
}
|
||||
|
||||
// Registry is a map of available tools, keyed by name.
|
||||
type Registry map[string]ToolSpec
|
||||
|
||||
// Add returns a new Registry with the given spec added.
|
||||
func (r Registry) Add(spec ToolSpec) Registry {
|
||||
out := make(Registry, len(r)+1)
|
||||
for k, v := range r {
|
||||
out[k] = v
|
||||
}
|
||||
out[spec.Name] = spec
|
||||
return out
|
||||
}
|
||||
|
||||
// Get looks up a tool spec by name.
|
||||
func (r Registry) Get(name string) (ToolSpec, bool) {
|
||||
spec, ok := r[name]
|
||||
return spec, ok
|
||||
}
|
||||
|
||||
// Names returns all registered tool names.
|
||||
func (r Registry) Names() []string {
|
||||
names := make([]string, 0, len(r))
|
||||
for k := range r {
|
||||
names = append(names, k)
|
||||
}
|
||||
return names
|
||||
}
|
||||
@@ -0,0 +1,37 @@
|
||||
package tools
|
||||
|
||||
// SSHCommandSpec describes an SSH command to execute. Pure data — no execution.
|
||||
type SSHCommandSpec struct {
|
||||
Target string // references a named target in ssh config
|
||||
Command string
|
||||
Timeout string
|
||||
}
|
||||
|
||||
// HTTPCallSpec describes an HTTP call to make. Pure data.
|
||||
type HTTPCallSpec struct {
|
||||
Method string
|
||||
URL string
|
||||
Headers map[string]string
|
||||
Body string
|
||||
Timeout string
|
||||
}
|
||||
|
||||
// ScriptSpec describes a script to run. Pure data.
|
||||
type ScriptSpec struct {
|
||||
Name string
|
||||
Args []string
|
||||
Timeout string
|
||||
}
|
||||
|
||||
// FileOpsSpec describes a file operation. Pure data.
|
||||
type FileOpsSpec struct {
|
||||
Op string // read | write | list | delete
|
||||
Path string
|
||||
}
|
||||
|
||||
// MCPCallSpec describes a call to an MCP server. Pure data.
|
||||
type MCPCallSpec struct {
|
||||
ServerName string
|
||||
ToolName string
|
||||
Arguments map[string]any
|
||||
}
|
||||
Reference in New Issue
Block a user