feat: add go helper client and mcp tools
This commit is contained in:
28
internal/helperclient/contract.go
Normal file
28
internal/helperclient/contract.go
Normal file
@@ -0,0 +1,28 @@
|
||||
package helperclient
|
||||
|
||||
import "encoding/json"
|
||||
|
||||
const HelperProtocolV1 = "isphere.helper.v1"
|
||||
|
||||
type HelperRequest struct {
|
||||
Protocol string `json:"protocol"`
|
||||
RequestID string `json:"request_id"`
|
||||
Op string `json:"op"`
|
||||
TimeoutMS int `json:"timeout_ms"`
|
||||
Args map[string]any `json:"args"`
|
||||
}
|
||||
|
||||
type HelperResponse struct {
|
||||
Protocol string `json:"protocol"`
|
||||
RequestID string `json:"request_id"`
|
||||
Op string `json:"op"`
|
||||
OK bool `json:"ok"`
|
||||
Data map[string]json.RawMessage `json:"data"`
|
||||
Error *HelperError `json:"error"`
|
||||
Warnings []string `json:"warnings"`
|
||||
}
|
||||
|
||||
type HelperError struct {
|
||||
Code string `json:"code"`
|
||||
Message string `json:"message"`
|
||||
}
|
||||
Reference in New Issue
Block a user