(deps commandDeps)
| 117 | } |
| 118 | |
| 119 | func newChannelListCommand(deps commandDeps) *cobra.Command { |
| 120 | return &cobra.Command{ |
| 121 | Use: agentKernelListKey, |
| 122 | Short: "List coordination channels visible to the current agent session", |
| 123 | Example: ` # List coordination channels visible to this session |
| 124 | agh ch list |
| 125 | |
| 126 | # Print channel discovery metadata as JSON |
| 127 | agh ch list -o json`, |
| 128 | RunE: func(cmd *cobra.Command, _ []string) error { |
| 129 | client, err := clientFromDeps(deps) |
| 130 | if err != nil { |
| 131 | return err |
| 132 | } |
| 133 | credentials, err := requireAgentCommandIdentity(cmd.Context(), deps, client, agentActionCLI("ch.list")) |
| 134 | if err != nil { |
| 135 | return err |
| 136 | } |
| 137 | channels, err := client.AgentChannels(cmd.Context(), credentials) |
| 138 | if err != nil { |
| 139 | return err |
| 140 | } |
| 141 | return writeCommandOutput(cmd, agentChannelsBundle(channels)) |
| 142 | }, |
| 143 | } |
| 144 | } |
| 145 | |
| 146 | func newChannelRecvCommand(deps commandDeps) *cobra.Command { |
| 147 | var wait bool |
no test coverage detected