Documentation
¶
Overview ¶
Package agentsdk provides a thin, runtime-neutral SDK for managed Agents to make nested invocations through the NeKiro A2A Router. It validates inherited platform context and sends exactly one request to the Agent Router v1 boundary. It contains no model, tool, workflow, memory, retry, cache, or Agent Runtime behavior.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client is a thin SDK client for nested Router calls. Both limits are explicit deployment policy; no response or event-size default is supplied.
func NewClient ¶
func NewClient(doer HTTPDoer, routerURL, token string, responseLimit, eventLimit int64) (*Client, error)
NewClient creates a nested invocation SDK client with explicit limits in bytes. The limits must be in the contract range 1..2147483647.
func (*Client) Invoke ¶
func (c *Client) Invoke(ctx context.Context, pc PlatformContext, nr NestedRequest) (*NestedResult, error)
Invoke sends one non-streaming nested invocation. Streaming requests must use InvokeStream so the caller can consume events incrementally.
func (*Client) InvokeStream ¶
func (c *Client) InvokeStream(ctx context.Context, pc PlatformContext, nr NestedRequest) (*NestedResultStream, error)
InvokeStream sends one streaming nested invocation and returns a decoder over the live SSE body. Call Recv until io.EOF, then Close the stream.
type HTTPDoer ¶
HTTPDoer is the minimal HTTP transport interface. The SDK performs exactly one request and does not follow redirects or retry.
type NestedRequest ¶
type NestedRequest struct {
TargetAgentID string
Capability string
Input json.RawMessage
Stream bool
}
NestedRequest carries the untrusted target work for a nested invocation. It contains only the fields permitted by the Agent Router v1 contract.
func (NestedRequest) Validate ¶
func (nr NestedRequest) Validate() error
Validate checks that the NestedRequest fields are present and safe.
type NestedResult ¶
type NestedResult struct {
InvocationID string
RootTaskID string
TraceID string
Status string
Result json.RawMessage
}
NestedResult carries the response from a successful non-streaming nested invocation.
type NestedResultStream ¶
type NestedResultStream struct {
// contains filtered or unexported fields
}
NestedResultStream incrementally decodes and validates Agent Router SSE events. The child Invocation ID is learned from the first accepted event.
func (*NestedResultStream) Close ¶
func (stream *NestedResultStream) Close() error
Close releases the response body. A stream that has not reached a valid terminal event is reported as interrupted rather than silently accepted.
func (*NestedResultStream) InvocationID ¶
func (stream *NestedResultStream) InvocationID() string
InvocationID returns the child ID after the accepted event has been read.
func (*NestedResultStream) Recv ¶
func (stream *NestedResultStream) Recv() (contracts.InvocationResultStreamEventV2, error)
Recv reads and validates the next SSE event. io.EOF is returned only after a valid terminal event has been consumed and the stream has ended.
type PlatformContext ¶
type PlatformContext struct {
InvocationID string
RootTaskID string
TraceID string
WorkspaceID string
AgentID string
}
PlatformContext carries the trusted inherited Invocation identity presented by the managed transport. All fields are required safe identifiers; no value is inferred or synthesized.
func (PlatformContext) Validate ¶
func (pc PlatformContext) Validate() error
Validate checks that all PlatformContext fields are present and safe identifiers. It fails without synthesizing identity or correlation.
type RouterError ¶
type RouterError struct {
StatusCode int
Code contracts.PlatformErrorCode
TraceID contracts.TraceID
InvocationID string
RootTaskID string
}
RouterError contains only validated safe error fields from the Agent Router. Raw response bytes are deliberately not retained or exposed.
func (*RouterError) Error ¶
func (e *RouterError) Error() string
Directories
¶
| Path | Synopsis |
|---|---|
|
Package host provides the lifecycle boundary for a managed Agent Runtime.
|
Package host provides the lifecycle boundary for a managed Agent Runtime. |
|
registration
|
|
|
nacos
Package nacos composes NeKiro Core registration primitives into a public Runtime-facing Nacos registration lifecycle.
|
Package nacos composes NeKiro Core registration primitives into a public Runtime-facing Nacos registration lifecycle. |