Documentation
¶
Overview ¶
Package mcpserver answers the Model Context Protocol over one connection, so an agent can ask what its run has cost while it works. Its four tools only read: the run's status file, the newest check run on a pull request, the policy over a rows file, and a ledger's view of a pull request. Every amount in an answer is a decimal string beside its currency.
Index ¶
Constants ¶
const ( RunStatus = "run_status" PullResult = "pull_result" PolicyCheck = "policy_check" LedgerPull = "ledger_pull" )
The tools' names.
const Name = "costroid"
Name is the name the server gives itself when a client connects.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Ledger ¶
type Ledger struct {
// contains filtered or unexported fields
}
Ledger is a costroid serve the person named when they started the server. The agent names a pull request, never the host, so the token goes nowhere else.
type Options ¶
type Options struct {
Version string
// Getenv names the status file, as costroid run reads it.
Getenv func(string) string
// Result reads the newest result object on a pull request's head.
Result func(ctx context.Context, number int) (history.Posted, error)
// Policy gives the verdict costroid policy gives on the same request.
Policy func(ctx context.Context, request PolicyRequest) (policy.Verdict, error)
// Ledger is the costroid serve the person named, nil for none.
Ledger *Ledger
}
Options are what the tools read through.
type PolicyRequest ¶
type PolicyRequest struct {
Rows string `json:"rows" jsonschema:"the rows file costroid run wrote"`
Config string `` /* 127-byte string literal not displayed */
WorkflowAdded string `` /* 146-byte string literal not displayed */
At string `json:"at,omitempty" jsonschema:"the time of the check, as RFC 3339; now when empty"`
}
PolicyRequest is costroid policy's flags, as policy_check takes them.