MCPcopy Create free account
hub / github.com/compozy/agh / toolApprovalBundle

Function toolApprovalBundle

internal/cli/tool_operator.go:617–643  ·  view source on GitHub ↗
(response ToolApprovalRecord)

Source from the content-addressed store, hash-verified

615}
616
617func toolApprovalBundle(response ToolApprovalRecord) outputBundle {
618 return outputBundle{
619 jsonValue: struct {
620 Approval ToolApprovalRecord `json:"approval"`
621 }{Approval: response},
622 human: func() (string, error) {
623 return renderHumanSection("Tool Approval", []keyValue{
624 {Label: toolOperatorToolIDValue, Value: response.ToolID.String()},
625 {Label: "Approval Token", Value: stringOrDash(response.ApprovalToken)},
626 {Label: "Input Digest", Value: stringOrDash(response.InputDigest)},
627 {Label: toolOperatorExpiresValue, Value: stringOrDash(formatTime(response.ExpiresAt))},
628 }), nil
629 },
630 toon: func() (string, error) {
631 return renderToonObject(
632 "tool_approval",
633 []string{toolOperatorToolIDKey, "approval_token", "input_digest", toolOperatorExpiresAtKey},
634 []string{
635 response.ToolID.String(),
636 response.ApprovalToken,
637 response.InputDigest,
638 formatTime(response.ExpiresAt),
639 },
640 ), nil
641 },
642 }
643}
644
645func toolInvokeBundle(response ToolInvokeResponseRecord) outputBundle {
646 return outputBundle{

Callers 1

newToolApproveCommandFunction · 0.85

Calls 5

renderHumanSectionFunction · 0.85
stringOrDashFunction · 0.85
formatTimeFunction · 0.85
renderToonObjectFunction · 0.85
StringMethod · 0.45

Tested by

no test coverage detected