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

Function newNetworkInboxCommand

internal/cli/network.go:943–970  ·  view source on GitHub ↗
(deps commandDeps, workspaceRef *string)

Source from the content-addressed store, hash-verified

941}
942
943func newNetworkInboxCommand(deps commandDeps, workspaceRef *string) *cobra.Command {
944 var sessionID string
945
946 cmd := &cobra.Command{
947 Use: "inbox",
948 Short: "Show queued inbound messages for one session",
949 RunE: func(cmd *cobra.Command, _ []string) error {
950 client, err := clientFromDeps(deps)
951 if err != nil {
952 return err
953 }
954 workspace, err := resolveNetworkWorkspaceRef(cmd, deps, client, workspaceRef)
955 if err != nil {
956 return err
957 }
958
959 messages, err := client.NetworkInbox(cmd.Context(), workspace, strings.TrimSpace(sessionID))
960 if err != nil {
961 return err
962 }
963 return writeCommandOutput(cmd, networkInboxBundle(messages))
964 },
965 }
966
967 cmd.Flags().StringVar(&sessionID, "session", "", "Target session id")
968 mustMarkFlagRequired(cmd, "session")
969 return cmd
970}
971
972type networkSubscriptionFlags struct {
973 channel string

Callers 1

newNetworkCommandFunction · 0.85

Calls 6

clientFromDepsFunction · 0.85
writeCommandOutputFunction · 0.85
networkInboxBundleFunction · 0.85
mustMarkFlagRequiredFunction · 0.85
NetworkInboxMethod · 0.65

Tested by

no test coverage detected