mirror of
https://github.com/YspCoder/clawgo.git
synced 2026-05-06 03:37:31 +08:00
add child-model agent_task flow with node model capability and stricter device contracts
This commit is contained in:
@@ -137,6 +137,8 @@ func (m *Manager) SupportsAction(nodeID, action string) bool {
|
||||
switch action {
|
||||
case "run":
|
||||
return n.Capabilities.Run
|
||||
case "agent_task":
|
||||
return n.Capabilities.Model
|
||||
case "camera_snap", "camera_clip":
|
||||
return n.Capabilities.Camera
|
||||
case "screen_record", "screen_snapshot":
|
||||
@@ -162,6 +164,10 @@ func (m *Manager) PickFor(action string) (NodeInfo, bool) {
|
||||
if n.Capabilities.Run {
|
||||
return n, true
|
||||
}
|
||||
case "agent_task":
|
||||
if n.Capabilities.Model {
|
||||
return n, true
|
||||
}
|
||||
case "camera_snap", "camera_clip":
|
||||
if n.Capabilities.Camera {
|
||||
return n, true
|
||||
|
||||
@@ -75,6 +75,8 @@ func actionHTTPPath(action string) string {
|
||||
return "/run"
|
||||
case "invoke":
|
||||
return "/invoke"
|
||||
case "agent_task":
|
||||
return "/agent/task"
|
||||
case "camera_snap":
|
||||
return "/camera/snap"
|
||||
case "camera_clip":
|
||||
|
||||
@@ -6,6 +6,7 @@ import "time"
|
||||
type Capabilities struct {
|
||||
Run bool `json:"run"`
|
||||
Invoke bool `json:"invoke"`
|
||||
Model bool `json:"model"`
|
||||
Camera bool `json:"camera"`
|
||||
Screen bool `json:"screen"`
|
||||
Location bool `json:"location"`
|
||||
@@ -23,6 +24,7 @@ type NodeInfo struct {
|
||||
Token string `json:"token,omitempty"`
|
||||
Capabilities Capabilities `json:"capabilities"`
|
||||
Actions []string `json:"actions,omitempty"`
|
||||
Models []string `json:"models,omitempty"`
|
||||
RegisteredAt time.Time `json:"registered_at,omitempty"`
|
||||
LastSeenAt time.Time `json:"last_seen_at"`
|
||||
Online bool `json:"online"`
|
||||
@@ -32,6 +34,8 @@ type NodeInfo struct {
|
||||
type Request struct {
|
||||
Action string `json:"action"`
|
||||
Node string `json:"node,omitempty"`
|
||||
Task string `json:"task,omitempty"`
|
||||
Model string `json:"model,omitempty"`
|
||||
Args map[string]interface{} `json:"args,omitempty"`
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user