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

Function newAgentHeartbeatInspectCommand

internal/cli/authored_context.go:340–364  ·  view source on GitHub ↗
(deps commandDeps)

Source from the content-addressed store, hash-verified

338}
339
340func newAgentHeartbeatInspectCommand(deps commandDeps) *cobra.Command {
341 cmd := &cobra.Command{
342 Use: "inspect <agent>",
343 Short: "Inspect one agent's resolved Heartbeat policy",
344 Example: " agh agent heartbeat inspect coder --workspace checkout-api --json",
345 Args: exactOneNonBlankArg(),
346 RunE: func(cmd *cobra.Command, args []string) error {
347 client, err := clientFromDeps(deps)
348 if err != nil {
349 return err
350 }
351 query, err := agentQueryFromCommand(cmd)
352 if err != nil {
353 return err
354 }
355 record, err := client.GetAgentHeartbeat(cmd.Context(), args[0], query)
356 if err != nil {
357 return err
358 }
359 return writeCommandOutput(cmd, agentHeartbeatBundle(&record))
360 },
361 }
362 addWorkspaceFlag(cmd)
363 return cmd
364}
365
366func newAgentHeartbeatValidateCommand(deps commandDeps) *cobra.Command {
367 var input authoredBodyInput

Callers 1

newAgentHeartbeatCommandFunction · 0.85

Calls 7

exactOneNonBlankArgFunction · 0.85
clientFromDepsFunction · 0.85
agentQueryFromCommandFunction · 0.85
writeCommandOutputFunction · 0.85
agentHeartbeatBundleFunction · 0.85
addWorkspaceFlagFunction · 0.85
GetAgentHeartbeatMethod · 0.65

Tested by

no test coverage detected